How to program EGA graphics, in x86 assembly. - Forum

Ultra lightweight, highly experimental, WIP, feel free to try ;)


Forum Navigation
You need to log in to create posts and topics.

How to program EGA graphics, in x86 assembly.

I've had it to my wits end. I'm working on a game right now, and I've implemented PCjr/Tandy 1000 graphics, as well as CGA graphics, but EGA is driving me insane. I can kinda get a single 'sprite' drawn to the screen, but after that every thing else is colored incorrectly, and most of the things I've tried have had a weird affect on all of the screen's graphics. I'm done trying to figure this out. I've looked high-and-low on the internet for examples, and I currently have 2 different IBM technical manuals open, relating to EGA, but I just can't get it.

If anyone can, please help me, this is very frustrating. It's all about these bitplanes...

The main idea I gather (or, as far as I can tell), is that I write the screen data I want, to A000, but one value at a time, first intensity, then red, then green, then blue (though I'm sure I can do whatever order I want). And after I'm done, I output 0n02h to 03C4h, where n represents bitplane 1-4 (iRGB).

I'm not entirely sure why 03 (11b) would represent the blue bitplane when it would seem to me that the planes should be represented by 8, 4, 2, and 1 respectively (1 bit each, since that is how they appear in the technical manuals). But like I said, I can't figure this crap out, and I'm too frustrated to continue today, so I'm gonna post here, and do something else for the rest of the day.

I geuss You should output 020nh instead.