Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!rpi!zaphod.mps.ohio-state.edu!n8emr!bluemoon!andy From: andy@bluemoon.uucp (Andy Vaught) Newsgroups: comp.os.msdos.programmer Subject: Re: VGA screen, writemode 2, help needed. Keywords: vga writemode 2, bitmask register is ukuxnad? Message-ID: <3u1732w164w@bluemoon.uucp> Date: 7 Jun 91 22:41:01 GMT References: <1991Jun6.202226.13217@odin.diku.dk> Sender: bbs@bluemoon.uucp (BBS Login) Organization: Blue Moon BBS ((614) 868-998[0][2][4]) Lines: 29 zonker@diku.dk (Claus Engdahl) writes: > Hi. > > I'm desperately seeking help from one of you VGA gurus out there. > > I am trying to write to screen, using writemode 2. I manage to get > something written, but the bitmask register seems to work in strange > and wonderous ways :-( > > Having read "Programmers guide to the EGA and VGA cards", I managed to > cook up the following routine: > Whoa! theres your problem right there-- lousy docs! I wasted my money on this book too. Information is duplicated through the whole book, with each duplication leaving something different out. I eventually ended up realising what was going on, but it took far more skull sweat than it should have. The way to fix your program is to do a "dummy read" of the location containing the pixels you want to change. This read has the effect of initializing the internal 32-bit latch to the contents of screen memory. During the write operation, the ALU operates on what is in the latch, not what is in the memory location in question. After the operation is complete, then the new contents of the latch are written to video memory. ------------------------------------------------------------------ Andy Vaught (Fuzzy Andy) :: C Code. C Code Run. Run C code, Run... Grad Student on Vacation :: before I whip out my 12-Gauge andy@bluemoon.uucp :: Dynamic Debugging Tool!