flat assembler
Message board for the users of flat assembler.

Index > Main > VBE study

Goto page Previous  1, 2, 3, 4  Next
Author
Thread Post new topic Reply to topic
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 20 Jun 2010, 10:56
but then i will can't use linear framebuffer.


a lil question: what are VGA hardware registers?
Post 20 Jun 2010, 10:56
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 20 Jun 2010, 11:54
This is a very old development snapshot of my OS, with unrelated stuff removed. I'm afraid there's not many comments and it's not particularly clean but it at least shows you how to get the list of available modes (VESA.asm - finds all LFB modes >=1024x768x32) and draw in protected mode (display.asm).


Description:
Download
Filename: src.zip
Filesize: 17.05 KB
Downloaded: 462 Time(s)

Post 20 Jun 2010, 11:54
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 20 Jun 2010, 12:04
Post 20 Jun 2010, 12:04
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 20 Jun 2010, 13:24
Teehee,

int10/4F01 expects pointer to ModeInfoBlock in es:di, and you didn't set es (or di if you want to keep es at 0x800) properly.

mov edi, VbeModeInfoBlock.PhysBasePtr and mov edi, [VbeModeInfoBlock.PhysBasePtr] do quite different things.

mov dword[edi],0xFFFFFFF expects ds to be set properly.

As a sidenote, 0x11B is a 24bpp (i.e. 3 byte-per-pixel) Bochs VBE mode. 0x145 mode can be easier to program, unless you're into [edi*3] addressing and word+byte movs so much.

----8<----
DJ Mauretto wrote:
…do not use protected mode
do your testing on XP, VESA works fine on xp.
Teehee explicitly stated that he wants to use linear frame buffer. How does your comment apply?


----8<----
cod3b453,

Was mov di,(INIT_TEMP + sizeof.VBEInfoBlock + sizeof.VBEModeInfoBlock) before int 0x10 in VESA_Start function a workaround for some VBIOS, or just a leftover?
Post 20 Jun 2010, 13:24
View user's profile Send private message Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto 20 Jun 2010, 13:54
Quote:
Teehee explicitly stated that he wants to use linear frame buffer. How does your comment apply?

Teeheeè a beginner, my advice is to start
with something simple

_________________
Nil Volentibus Arduum Razz
Post 20 Jun 2010, 13:54
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 20 Jun 2010, 19:00
DJ Mauretto,

Dancing with 64 KiB windows around 3¾ MiB video memory for 1280×1024×24bpp is simple? I doubt it.
Post 20 Jun 2010, 19:00
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 20 Jun 2010, 20:36
baldr wrote:
...
Was mov di,(INIT_TEMP + sizeof.VBEInfoBlock + sizeof.VBEModeInfoBlock) before int 0x10 in VESA_Start function a workaround for some VBIOS, or just a leftover?
Looks to be leftover - set mode can take a CRTC info block in es:di but in this case it doesn't matter if this line is removed.
Post 20 Jun 2010, 20:36
View user's profile Send private message Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 21 Jun 2010, 17:44
When the manual says i need to set ES:DI to pointer a structure i must to do, for instance:
Code:
mov ax, ModeInfoBlock
mov es, ax
mov di, ax    

?
or:
Code:
push ds
pop es
mov di, ModeInfoBlock    

?
or neither one? Smile
Post 21 Jun 2010, 17:44
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 21 Jun 2010, 18:10
If the structure is below linear address 0x10000, use es = 0, di = <address> otherwise you have to use a suitable es such that (es*16)+di = <address> (real mode segmented addressing).
Code:
; if the_struct is below 0x10000
xor ax,ax
mov es,ax
mov di,the_struct

; for address 0x12345, you can do:
mov ax,0x1234
mov es,ax
mov di,0x0005
; or
mov ax,0x1000
mov es,ax
mov di,0x2345    

You can use push ds, pop es if ds is a correct value.
Post 21 Jun 2010, 18:10
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 22 Jun 2010, 21:38
An interesting piece of info about Windows XP version of NTVDM: You can set the video mode with the VBE functions, I did it and the screen went black. The only way I got back to the desktop was to ctrl+alt+del to bring up the task manager and killed my prog. I haven't tried on any other versions.
Post 22 Jun 2010, 21:38
View user's profile Send private message Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 22 Jun 2010, 23:05
Post 22 Jun 2010, 23:05
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 23 Jun 2010, 01:34
Teehee,

You may refer to FreeVGA pages for useful info.
Post 23 Jun 2010, 01:34
View user's profile Send private message Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 23 Jun 2010, 03:07
FreeVGA is one of the better ones Razz
Also i liked this masters manual...


Description:
Download
Filename: vga_master.txt
Filesize: 651.37 KB
Downloaded: 815 Time(s)


_________________
Coding a 3D game engine with fasm is like trying to eat an elephant,
you just have to keep focused and take it one 'byte' at a time.
Post 23 Jun 2010, 03:07
View user's profile Send private message Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 23 Jun 2010, 23:17
I'll read them all. (it will take a long time Shocked )

***
i'm trying to get the supported VBE mode list but im getting these values: (see img).

is there something wrong?

my code to get that values:
Code:
org 100h
                push  ds
                pop   es

                mov   di, VbeInfoBlock
                mov   ax, VBE_GET_CONTROLLER_INFO
                int   10h

                mov   ax, 03h
                int   10h

                xor   ecx, ecx
                mov   ebx, VbeInfoBlock.VideoModePtr
           @@:  mov    bx, word[ebx+ecx*2]
                pusha
                lea   esi, [buf+4+ecx*8]
                movzx eax,bx
                mov   ebx, String.FORMAT_HEX
                call  String.eax2str
                popa
                inc   ecx
                cmp    bx, -1
                jne   @b

         print: mov   dx, buf
                mov   ah, 09h
                int   21h
      wait_key: mov   ah, 01h
                int   21h
          exit: int   20h



   buf db 254 dup 0
       db '$'



include '\FASM\mylibs\string.asm'
include '\FASM\mylibs\VBE.inc'    


Description:
Filesize: 5.63 KB
Viewed: 13199 Time(s)

imagem.png



_________________
Sorry if bad english.
Post 23 Jun 2010, 23:17
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 24 Jun 2010, 06:33
Teehee,

mov ebx, VbeInfoBlock.VideoModePtr is wrong (as you might expect). It moves offset of VbeInfoBlock.VideoModePtr into ebx, not contents.
Post 24 Jun 2010, 06:33
View user's profile Send private message Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 24 Jun 2010, 18:40
i'm always confusing that! Confused

should i use mov ebx, [VbeInfoBlock.VideoModePtr] or lea ebx,[VbeInfo..] ? (in any case i get no values Sad)
Post 24 Jun 2010, 18:40
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 24 Jun 2010, 22:21
lea means load effective adress, then, you will load the effective adress of vbeinfo if you use lea
mov means move datas
then, you will obtin the data at vbeinfo with mov.
Post 24 Jun 2010, 22:21
View user's profile Send private message Visit poster's website Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 24 Jun 2010, 22:37
Please attach the 2 other files so i can play with it...
I am too lazy to make them from scratch...
Post 24 Jun 2010, 22:37
View user's profile Send private message Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 24 Jun 2010, 23:36
Smile


Description:
Download
Filename: VBE.inc
Filesize: 6.91 KB
Downloaded: 393 Time(s)

Description:
Download
Filename: string.asm
Filesize: 1.44 KB
Downloaded: 355 Time(s)


_________________
Sorry if bad english.
Post 24 Jun 2010, 23:36
View user's profile Send private message Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 25 Jun 2010, 00:40
Step 1:
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; VESA SuperVGA BIOS (VBE) - Get SuperVGA information
; AX = 4f00h
; ES:DI -> buffer for SuperVGA information (see #00077)
; Return:AL = 4fh if function supported
; AH = status
; 00h successful
; ES:DI buffer filled
; 01h failed
; ---VBE v2.0---
; 02h function not supported by current hardware configuration
; 03h function invalid in current video mode
;
; Desc: Determine whether VESA BIOS extensions are present and the
;       capabilities supported by the display adapter
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

        ; Assume cs=ds=es

        mov     di,VbeInfoBlock
        mov     ax,4f00h        ; Get SuperVGA information
        int     10h
        cmp     al,4fh          ; Is function supported?
        jne     vbe_not_supported
        cmp     ah,00h          ; Is status successful?
        jne     vbe_not_supported

        ; ...

  vbe_not_supported:

         ; ...
    

Of course you can combine the AH,AL tests...
Post 25 Jun 2010, 00:40
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.