Multi-page 320x200 EGA 16 color mode page addresses

DOS specific questions.
torstum
Posts: 14
Joined: Jun 02, 2006 14:26
Location: Portugal

Multi-page 320x200 EGA 16 color mode page addresses

Postby torstum » Jul 06, 2006 22:08

I've been looking at PC memory maps, but I can't find the memory address where those 8 pages go. Do they go to the Video card's memory? If so, is it possible for me to access them directly? Is it wise to do so for an inexperienced (in assembler) programmer? Is there a RAM memory space that continuously maps itself to the video card's memory bank? Or am I just talking nonsense?

Is there a tutorial that specifically deals with EGA multi-pages? I've seen lots of VGA tutorials, but not EGA ones.

I ask this because I've come across with one of the best compilers I've seen (GFA-Basic) which apparently lacks a page-flipping command. Plus I've tried to circumvent this by invoking a BIOS interrupt call to set the active page, but GFA always writes to address &HB800, no matter what I do. Is it possible to redirect graphics commands (perhaps by changing a pointer or something)? How can I do full-screen vector graphics without page-flipping? Sorry if this should have gone to the General Programming section.
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Postby MichaelW » Jul 07, 2006 10:13

I think you are referring to EGA/VGA mode 0Dh, 320x200, 16 colors, and 8 display pages on a VGA or fully populated EGA. The EGA/VGA graphics buffer is mapped into the host address space at segment address A000h. In addition to the VGA BIOS, IIRC the visible page can be set by manipulating the Start Address High and Start Address Low registers in the CRT Controller (done through I/O ports).

Why not FreeBASIC?
torstum
Posts: 14
Joined: Jun 02, 2006 14:26
Location: Portugal

Postby torstum » Jul 07, 2006 22:01

Thanks, that was helpful. I still can't see how eight 32K long pages can fit into 128K, but it doesn't matter, since I only need two pages.

FreeBasic is the future, the only reason I can think for not using it right now is the fact that it doesn't fit into a floppy disk.:)

GFA-Basic is one of those rare, arcane programming gems that are almost unknow, but immensely powerful, hence my interest. It seems to be as fast as C, has full-featured GUI commands, creates EXEs, is an interpreter, etc...
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Postby MichaelW » Jul 07, 2006 23:23

I don’t understand the 128K value. A standard VGA, or a “fully populated” EGA, has 256KB of display memory split into four 64KB bit planes, selectively mapped into a 64KB “window” in the host address space, starting at address A0000h. Eight 320*200 = 64000 pixel pages can fit into 256KB of display memory because each pixel occupies only 4 bits (1 bit in each of the 4 bit planes).

The VGA was introduced in 1987, and after 19 years I have doubts that there are many EGA systems still in service.
torstum
Posts: 14
Joined: Jun 02, 2006 14:26
Location: Portugal

Postby torstum » Jul 07, 2006 23:49

I think I see it now. Looking again at the memory map:

http://www.answers.com/topic/pc-memory-map

the second 128K free memory space extends itself from C800 to EFFF. If I'm wrong please correct me. May I Poke into these areas without fear?
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Postby MichaelW » Jul 08, 2006 0:48

It should be OK to read these areas, but writing into these areas could cause problems, depending on what is running on your system. With recent hardware the only area that will be useful for graphics will be from A000:0000 to A000:FFFF.
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Postby cha0s » Jul 08, 2006 2:46

Code: Select all

DEF SEG = &HA000
POKE( y * 320 + x ), col


Memories... >.>

Return to “DOS”

Who is online

Users browsing this forum: No registered users and 1 guest