Skip to main content
GameDev.net gamedev.net
🔒 Locked

supervga programming

Started by Xeee Dec 28, 2001 at 6:08 AM 9 replies 1.9k views
Original Post
Xeee
Xeee
i''m still working with dos programming , and i don''t wanna change to win32 untill i master it . i made several games with bgi @ 640*480*16 colors , but these limits are annoying me , also i can feel that bgi is not the one for games (it is kinda slow , i don''t feel that any animation is smooth) , i wonder back in those days , how did they make things like prehistoric 1 and 2 , so i decided to make up my own library , but i faced a lot of problems , the first one is how to use int 10 with ax=4F05(CPU VIDEO MEMORY CONTROL) , VESA standards and so on ...... so i am asking for help , if there is anybody who made a svga library , i would b gratefull if he helps me . all i hope to reach is 800*600*265 or 800*600*65335 thanks for help . ...Xeee
xee..
Ook666
Ook666

There is Allegro, but it isn''t DOS only, it''s portable to Windows, Linux, BeOS and QNX.
It''s a game library so it does bitmaps, lighting, keyboard, mouse and joystick I/O, has datafile routines, midi and streaming sound for you.
It has also timers to do the timing
It''s homepage is on http://alleg.sourceforge.net
If you have questions about it then you ca look at the forums on www.allegro.cc or go to #allegro on EFnet

Hehe, this looks like an ad
Hope this helps, Allegro is really easy to use, even easier than SDL.
Dredge-Master
Dredge-Master
for BGI files, use VESA.H and VESA.BGI

I used if for HCAD in 1994 and it ran happily on at 8bitx1024x768.
Do a search on the net for it, the drivers should still be around somewhere. I used it with Borland C++ v2.0 (with the really cool IDE) for the 286 and it ran fine.



Beer - the love catalyst
good ol'' homepage
Beer - the love catalystgood ol' homepage
Xeee
Xeee
i think that you miss understood me , 3 or 4 months ago , i was looking for a better library , but now i wanna make mine , y not , if the mathematics is the problem , a friend of mine can help me , i wanna know how to make one , the problem is that i can''t write to anything other than the first 64K of the screen , i wanna know how to switch to another bank .(i''m using Direct memory access to A0000 , bios (WRITE GRAPHICS PIXEL) is very slow)
i know that A0000 is mapped to one of the banks representing the screen , how to map it to another one ???

...Xeee
xee..
Xeee
Xeee
about allegro , it works only on djgpp , right???
if it works on all compilers then i''ll use it but if it doesn''t i won''t .

...Xeee
xee..
Martee
Martee
Allegro works on just about any modern compiler, including Borland, MSVC, and GCC.
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
bernatk
bernatk
Since it''s xmas and I am feeling generous, I share my vesa library I have wrote back in the dos era. Hope this helps.

Here it is: vesa.rar. It uses Watcom C and Tasm.


--
bernie
www.bkgames.com
trzy
trzy
First, it would be best to switch to DJGPP. Dealing with hardware under DJGPP (protected mode) and real-mode compilers (like TurboC) is quite different, so there will be a slight learning curve.

There are plenty of resources on the web to help get you started, and www.delorie.com/djgpp/doc has some helpful documents.

For VESA, give http://www.inversereality.org/tutorials/graphics%20programming/graphicsprogramming.html a shot. The tutorials demonstrate graphics programming under DJGPP with C++.

You''ll probably want to familiarize yourself with protected mode concepts, such as selectors, and how DPMI works. Knowledge of assembly language will be helpful, but you should be able to get by even if you don''t have it.

---
Bart
----Bart
Dredge-Master
Dredge-Master
oh I see, you mean using the asm calls and stuff and memory copying.

Simple, on a screen such as vesa in 8bit, 1024x768, you have to write to the video memory in 12 seperate blocks of 65536, and stuff like that. It isn''t one large block of data in memory. Just lots of small ones. I forgot if you had to change the destination address or not, I don''t think you did but I think you had to change something to tell it which part to write too.

Just call the asm functions to set the display, then start playing with the memory addressing.



Beer - the love catalyst
good ol'' homepage
Beer - the love catalystgood ol' homepage
trzy
trzy
Dredge-Master: You''re talking about bank switching, which is what was required until VESA 2.0. Previously, there was no way to create frame buffers larger than 64KB, so you just wrote to 0xA000:0000 and called a VESA function to switch banks.

The problem with bank switching is that it''s slow, because you have to call a Video BIOS function to do it. In protected mode (DJGPP, Watcom), it gets worse because the processor has to switch into Virtual 8086 mode to carry out the BIOS call, which takes a lot of time.

The solutions were to create a protected mode interface for VESA, which allowed you to call the bank switching function quickly in protected mode, and to allow for linear frame buffers in VESA 2.0. The latter is very useful, and very fast. It will create a linear buffer for you to copy to all at once, just like good old Mode 0x13 Of course, it''s only available when in protected mode. You get a selector for the frame buffer, and the buffer starts at offset 0 when using the selector. Easy!

Perhaps I should post my DJGPP VESA library online. It only supports linear frame buffers, so VESA 2.0 is required.

---
Bart
----Bart

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.