flat assembler
Message board for the users of flat assembler.
Index
> Main > VBE study Goto page 1, 2, 3, 4 Next |
Author |
|
baldr 17 Jun 2010, 00:56
Teehee,
Before you get any samples, did you read VBE standard? It's crucial to know what you're doing.
|
|||
17 Jun 2010, 00:56 |
|
Teehee 17 Jun 2010, 01:09
i'm still reading this, baldr:
_________________ Sorry if bad english. |
|||||||||||
17 Jun 2010, 01:09 |
|
Tyler 17 Jun 2010, 02:47
A very good VBE link: http://davmac.org/davpage/vesa.html
It answers many of your questions, lists some "standard" mode numbers, and has bitfield maps of common VBE structures. |
|||
17 Jun 2010, 02:47 |
|
Teehee 17 Jun 2010, 16:17
i like it, Tyler, Thanks.
A few questions: 1. What is OEM? 2. a mode "linear framebuffer" supported uses no banks (windows)? |
|||
17 Jun 2010, 16:17 |
|
cod3b453 18 Jun 2010, 07:47
1. http://en.wikipedia.org/wiki/Original_equipment_manufacturer
2. Correct, the LFB is a 32bit memory region and so does away with banking. |
|||
18 Jun 2010, 07:47 |
|
DJ Mauretto 18 Jun 2010, 08:05
Hello
Here there is a utility for Vbe test that i wrote some time ago for Dos/Win98/Xp, Vista and Windows 7 report wrong data but you can try. _________________ Nil Volentibus Arduum |
|||
18 Jun 2010, 08:05 |
|
edfed 18 Jun 2010, 10:43
DJ Mauretto wrote: Hello thanks, it looks very cool, i just wonder... where is the source, just because i like to read sources...to learn more and more again. |
|||
18 Jun 2010, 10:43 |
|
DJ Mauretto 18 Jun 2010, 12:19
Oops
I have already wrote a Vesa utility in DOS subforum 640*480 4bit resolution, this is the same utility but in 80*25 standard vga resolution.. Maybe...... NB:This source code is part of a collection of various utilities that give information about the computer, all gathered in a boot disk. In the source code you will find things without meaning because they belong the system I'm writing .. _________________ Nil Volentibus Arduum |
|||
18 Jun 2010, 12:19 |
|
Teehee 18 Jun 2010, 22:57
DJ Mauretto, i have see that you got some topics about VGA/VBE. Can you write a step-by-step article/tutorial about VBE? i have found many difficults to use VBE in the practice (expecially in resolutions like 1280x1024), bc they talk about the teory but do not show how to do in the code (while showing the teory).
|
|||
18 Jun 2010, 22:57 |
|
DJ Mauretto 19 Jun 2010, 07:58
I do not have time to write a tutorial, if you search on the net There are lots of information, you can ask in this forum. If you like programming is important that you learn to take information from official documents, add a bit of imagination, and many practical tests as long as you understand, do not ever depend on others, this is the right path _________________ Nil Volentibus Arduum |
|||
19 Jun 2010, 07:58 |
|
Teehee 19 Jun 2010, 11:36
*ahem*
ok, then i'll start to ask: 1. how to set flat/linear framebuffer in 1280x1024? 2. how to plot a pixel on that resolution? 3. what does these numbers mean (in bold): 119h - 1280x1024 32K (1:5:5:5) 11Ah - 1280x1024 64K (5:6:5) 11Bh - 1280x1024 16.8M (8:8:8 ) 4. and what does 32k/64k/16,8M mean? colors possibilities? 32k = 32768 colors? |
|||
19 Jun 2010, 11:36 |
|
edfed 19 Jun 2010, 11:59
yes, 32k is 32768 colors.
1:5:5:5 is color components organisation. there, one single bit folowed by 5 for red, 5 for green, 5 for blue. 5:6:5 means, 5 red, 6green, 5blue. to set flat linera frame buffer in 1280*1024, it is the same as for other modes, when you set the ves mode, the vesa bios returns you vesa info block. in this block, there is a dword that tells you the base linear adress of your frame buffer. and to plot a pixel, you make it: mul pixel.y,bpsl mul pixel.x,bpp mov [base_adress+pixel.x+pixel.y],color |
|||
19 Jun 2010, 11:59 |
|
Teehee 19 Jun 2010, 12:16
edfed, which of these color values is visible to a human eye? 32k is enough to a good color resolution? and how do i know if it is 8, 16 or 32 bit colors?
2. whats bpsl? 3. how can i work with alpha value? (ex: 0xAARRGGBB) Quote: there is a dword that tells you the base linear adress of your frame buffer. I didn't find it. Where it is? [edit] i find it: PhysBasePtr, right? Last edited by Teehee on 19 Jun 2010, 12:43; edited 1 time in total |
|||
19 Jun 2010, 12:16 |
|
edfed 19 Jun 2010, 12:38
alpha value is virtual.
when you put a pixel with alpha, you should do a calculation with the screen to let back ground appear transparentlly. on the screen in 32 bit per pixel, the alpha byte is always ignored. byte per scan line |
|||
19 Jun 2010, 12:38 |
|
Teehee 19 Jun 2010, 13:38
i'm doing a test to plot a pixel, but something is wrong, i can't see anything:
Code: org 100h mov ax, 0xA000 mov es, ax ;mov ax, 4F00h ; get info ;mov di, VbeInfoBlock ;int 10h ;call checkSucessful mov ax, 4F02h ; set mode mov bx, 11Bh int 10h call checkSucessful mov ax, 4F01h ; get modeinfo mov cx, 11Bh mov di, VbeModeInfoBlock int 10h call checkSucessful ; plot pixel mov eax, [pixel.y] mul [VbeModeInfoBlock.BytesPerScanLine] push eax mov eax, [pixel.x] mul [VbeModeInfoBlock.BitsPerPixel] pop ebx add eax,ebx mov dword[VbeModeInfoBlock.PhysBasePtr+eax],0x000FFFF ; exit exit: mov ax,1 int 16h int 20h pixel: .y dd 50 .x dd 50 ; ### functions ### hex2str: ; EAX = value ; EDI = buffer mov edx,eax mov ecx,8 .format_hex: rol edx,4 movzx ax,dl and al,0x0f cmp al,0x0a sbb al,0x69 das mov word[edi],ax inc edi loop .format_hex mov byte[edi],'$' ; EDI = string ret print: mov ax,3 ; back text mode int 10h ; DX = string mov ah,9 ; print int 21h ret checkSucessful: ; AX = VBE status cmp ax, VBE_SUCESSFUL je @f mov dx, vberror call print @@: ret ; ### VARS ### vberror db ' VBE not supported!$' buf rb 16 VBE_SUCESSFUL = 004Fh ; structs VbeInfoBlock: .VbeSignature db 'VESA' ; VBE Signature .VbeVersion dw 0300h ; VBE Version .OemStringPtr dd ? ; VbeFarPtr to OEM String .Capabilities db 4 dup (?) ; Capabilities of graphics controller .VideoModePtr dd ? ; VbeFarPtr to VideoModeList .TotalMemory dw ? ; Number of 64kb memory blocks ; Added for VBE 2.0+ .OemSoftwareRev dw ? ; VBE implementation Software revision .OemVendorNamePtr dd ? ; VbeFarPtr to Vendor Name String .OemProductNamePtr dd ? ; VbeFarPtr to Product Name String .OemProductRevPtr dd ? ; VbeFarPtr to Product Revision String db 222 dup (?) ; Reserved for VBE implementation scratch ; area .OemData db 256 dup (?) ; Data Area for OEM Strings VbeModeInfoBlock: ; Mandatory information for all VBE revisions .ModeAttributes dw ? ; mode attributes .WinAAttributes db ? ; window A attributes .WinBAttributes db ? ; window B attributes .WinGranularity dw ? ; window granularity .WinSize dw ? ; window size .WinASegment dw ? ; window A start segment .WinBSegment dw ? ; window B start segment .WinFuncPtr dd ? ; real mode pointer to window function .BytesPerScanLine dw ? ; bytes per scan line ; Mandatory information for VBE 1.2 and above .XResolution dw ? ; horizontal resolution in pixels or characters .YResolution dw ? ; vertical resolution in pixels or characters .XCharSize db ? ; character cell width in pixels .YCharSize db ? ; character cell height in pixels .NumberOfPlanes db ? ; number of memory planes .BitsPerPixel db ? ; bits per pixel .NumberOfBanks db ? ; number of banks .MemoryModel db ? ; memory model type .BankSize db ? ; bank size in KB .NumberOfImagePages db ? ; number of images db 1 ; reserved for page function ; Direct Color fields (required for direct/6 and YUV/7 memory models) .RedMaskSize db ? ; size of direct color red mask in bits .RedFieldPosition db ? ; bit position of lsb of red mask .GreenMaskSize db ? ; size of direct color green mask in bits .GreenFieldPosition db ? ; bit position of lsb of green mask .BlueMaskSize db ? ; size of direct color blue mask in bits .BlueFieldPosition db ? ; bit position of lsb of blue mask .RsvdMaskSize db ? ; size of direct color reserved mask in bits .RsvdFieldPosition db ? ; bit position of lsb of reserved mask .DirectColorModeInfo db ? ; direct color mode attributes ; Mandatory information for VBE 2.0 and above .PhysBasePtr dd ? ; physical address for flat memory frame buffer dd 0 ; Reserved - always set to 0 dw 0 ; Reserved - always set to 0 ; Mandatory information for VBE 3.0 and above .LinBytesPerScanLine dw ? ; bytes per scan line for linear modes .BnkNumberOfImagePages db ? ; number of images for banked modes .LinNumberOfImagePages db ? ; number of images for linear modes .LinRedMaskSize db ? ; size of direct color red mask (linear modes) .LinRedFieldPosition db ? ; bit position of lsb of red mask (linear modes) .LinGreenMaskSize db ? ; size of direct color green mask (linear modes) .LinGreenFieldPosition db ? ; bit position of lsb of green mask (linear modes) .LinBlueMaskSize db ? ; size of direct color blue mask (linear modes) .LinBlueFieldPosition db ? ; bit position of lsb of blue mask (linear modes) .LinRsvdMaskSize db ? ; size of direct color reserved mask (linear modes) .LinRsvdFieldPosition db ? ; bit position of lsb of reserved mask (linear modes) .MaxPixelClock dd ? ; maximum pixel clock (in Hz) for graphics mode db 189 dup (?) ; reserved: remainder of ModeInfoBlock _________________ Sorry if bad english. |
|||
19 Jun 2010, 13:38 |
|
edfed 19 Jun 2010, 14:16
Code: mov dword[VbeModeInfoBlock.PhysBasePtr+eax],0x000FFFF are you sue you understand what a pointer is? base adress is a value, the poitner to the value is not the value. if you want to access the right memory, you should load the pointer first. then, mov edi,baseaddress mov [edi+x+y],color and one more thing is, in real mode, you cannot access the extended memory. the linear frame buffer of my card is (for example) 480 000 then, i cannot access it from real mode 0A000h segment, i should witch in pmode, and then, create a descriptor for the vesa frame buffer. |
|||
19 Jun 2010, 14:16 |
|
baldr 19 Jun 2010, 14:25
Teehee,
Read standard carefully. Linear frame buffer is requested by setting bit 14 in bx for int10/4F02. Your address calculation is incorrect: you multiply X coordinate by bits-per-pixel — do you think adjacent pixels are 32 bytes apart? Anyway, even if address was calculated correctly, without protected/unreal mode you can't access linear frame buffer, A000:0/B000:0 regions are for windowed frame buffer access. |
|||
19 Jun 2010, 14:25 |
|
Teehee 19 Jun 2010, 14:55
Quote: and then, create a descriptor for the vesa frame buffer baldr wrote: Read standard carefully. *** I switched to PM and did this: Code: mov edi, VbeModeInfoBlock.PhysBasePtr mov dword[edi],0xFFFFFFF ; i suposed to be 0,0 pos can't see anything.
|
|||||||||||
19 Jun 2010, 14:55 |
|
DJ Mauretto 20 Jun 2010, 10:32
All completely wrong , do not use protected mode
do your testing on XP, VESA works fine on xp. _________________ Nil Volentibus Arduum |
|||
20 Jun 2010, 10:32 |
|
Goto page 1, 2, 3, 4 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.