setting graphics mode in ASM

Started by
9 comments, last by MattCarpenter 21 years, 9 months ago
quote:
Bochs has SVGA capability, I just cant use interrupts (VESA) to set the video mode. I''m tired of the low resolution mode 13h, So I want to know how to use the i/o ports to set a higher resolution


AFAIK, there is no such thing as a true SVGA standard. Doesn''t Bochs provide a method to use VESA? Perhaps a VESA BIOS of its own?

quote:
Once one has set the video mode, how does one get and modify the graphics? If I remember right, a char (byte) pointer to 1000h will do, but a protected-mode compiler won''t like that, will it?


Assuming you are developing under DOS, it depends on the protected mode environment your extender provides.

Under DJGPP, you have to use a selector called _dos_ds to access the VRAM at 0xA0000. You can set FS to this selector by doing: _farsetsel(_dos_ds);

Then, you can peek/poke using the _farnspeek*() and _farnspoke*() functions. There are also the _farpeek*()/_farpoke*() functions which require you to pass the selector each time.

Once you use _farsetsel(), the FS register is set to the selector you passed so in assembly language, you can use FS segment overrides or move FS to DS or ES when necessary (for example, to blit using MOVS, you can set ES to FS to access VRAM and use DS to access your buffer.)

See the go32.h and sys/farptr.h header files DJGPP provides.

With Watcom and DOS4GW things are much easier. Just set a pointer to 0xa0000 and you''re set DOS4GW''s default data selector allows you to access all memory.


---
Bart
----Bart

This topic is closed to new replies.

Advertisement