|
|
|
|
|
by userbinator
2264 days ago
|
|
I'm fairly certain a real hardware VGA implementation would maintain that index as an unsigned 8-bit value. I've found an authoritative source - a datasheet for an IBM RAMDAC used for their VGA-compatible video cards: ftp://retronn.de/docs/pc_hardware/DACs/IBM37RGB524.pdf An increment past 0xff will "wrap around" to 0x00.
I suppose there's probably some demoscene code out there somewhere that repeatedly updates the entire palette, outputting to the address write register once then just banging on 0x3c9 repeatedly...I haven't looked, but definitely check the "tiny" (512b and below) category if you want to find tricks like these. I'm also reasonably certain there's going to be at least one which does that for a palette animation effect, taking advantage of the wraparound so it won't have to reset the write index again (and thus saving some precious bytes.) Here's an interesting discussion I found about the behaviour of the DAC ports on actual hardware, also from an emulation perspective (DOSbox): https://github.com/joncampbell123/dosbox-x/issues/502 |
|