flat assembler
Message board for the users of flat assembler.
Index
> Main > Using VESA mode |
Author |
|
rhyno_dagreat 02 Aug 2006, 18:38
Also, I have another issue, if I try to go any higher than mode 101h (640 x 480 with 256 colors), it compiles okay but when I run it, my monitor puts up a message "Out of scan range" then below that "14.8kHz/154Hz".
|
|||
02 Aug 2006, 18:38 |
|
donkey7 02 Aug 2006, 20:21
i've programmed some demos a few years ago - http://asembler.republika.pl/bin/progsy.zip (comments and labels in polish - demos for directx, vesa banked and linear modes - from 320x200x8 to 640x480x24).
there are two vesa modes - banked and linear. in 16- bit you can use only banked mode. why it's named banked? screen is divided into 64 kb parts called banks. you must switch to apropriate bank before drawing anything on screen. in 32- bit (protected mode - you can use dpmi, pmodew, wdosx or other pmode servers) you can use linear framebuffer. but it uses paging to map video memory to system memory. it's much faster and imo it's easier to use. i recommend you linear mode, but if you will be using banked mode don't forget about bank switching. afair it done like that: Code: mov ax,$4f05 mov dx,bank_number_starting_from_zero int $10 |
|||
02 Aug 2006, 20:21 |
|
rhyno_dagreat 03 Aug 2006, 01:35
I'll be doing this as a test for an OS GUI most likely, but how does accessing the linear framebuffer work? Is that what I'm doing in that program by accessing video memory directly?
|
|||
03 Aug 2006, 01:35 |
|
donkey7 03 Aug 2006, 11:45
in both modes you accesses video memory directly. the only difference is that in banked mode you can use only 16- bit addressing, while in linear mode you can use 32- bit addressing and you don't need to switch between banks (which is slow on moder gfx cards).
example of filling screen with color. 16- bit banked mode: Quote:
32- bit linear mode: Code: mov edi,screen_bufer mov ecx,number_of_pixels mov al,color rep stosb |
|||
03 Aug 2006, 11:45 |
|
rhyno_dagreat 03 Aug 2006, 17:54
Thanks again, Donkey! I think I get it now... But I'm wondering, with my source code up there, how can I write to all of the screen the way I'm going? Or is it impossible because the loop counter and BX are both only limited to one word each?
|
|||
03 Aug 2006, 17:54 |
|
cod3b453 03 Aug 2006, 22:19
This probably should have gone in the OS Construction area...
What I did is enable gate A20 and setup VESA mode with linear buffer bit set in 16 bit real mode, then switch to protected mode, this allows you to load the 32 bit video address pointer and use ecx to loop your drawing algorithm. Enabling A20 means it uses linear buffer, as I learnt recently . Using protected mode you can also use larger screen resolutions easily (if you want). HTH |
|||
03 Aug 2006, 22:19 |
|
rhyno_dagreat 04 Aug 2006, 03:44
Ah, I see! Thanks!
|
|||
04 Aug 2006, 03:44 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.