VOGONS

Common searches


First post, by jomalin

User metadata
Rank Newbie
Rank
Newbie

I have a game that does this (assembler code) to set the video mode:

mov ah,00 (set video mode)
mov al,13h (VGA, 320x200, 256 colors)
INT 10

I want to extract the palette.

I know i can use Dosbox to save a .PNG with palette inside, but this palette it is not the original because in VGA, each component (R, G, B) is a byte that has a 6 bits value (from 0 to 63 + two 0's) and in the PNG palette, these 6 bits values are converted to 8 bits values by Dosbox when saving the PNG.

Using the Dosbox debugger, there is the command MEMDUMPBIN that makes dumps from a memory address to a file.
So the question is, what it is the address i must pass to MEMDUMPBIN where the VGA palette starts?

THANKS

Reply 1 of 3, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It's nowhere in memory to be dumped. You can read it out of the VGA DAC registers (port 0x3c7 is read index, port 0x3c9 is data), but if you're only interested in the default palette then you can get that from the DOSBox source code: vga_palette[] array in int10_modes.cpp

Reply 2 of 3, by jomalin

User metadata
Rank Newbie
Rank
Newbie
ripsaw8080 wrote:

It's nowhere in memory to be dumped. You can read it out of the VGA DAC registers (port 0x3c7 is read index, port 0x3c9 is data), but if you're only interested in the default palette then you can get that from the DOSBox source code: vga_palette[] array in int10_modes.cpp

Thanks ripsaw8080 for your fast response, but if the game is running and msdos is singletask, how can i execute the code to deal with ports to do this? Maybe i need a TSR program? I don't know how to write TSR programs 🙁 I want to extract the palette from a particular game (the palette is COMPRESSED in the game files).

Will be good if someone knows a little utlity to write the VGA palette to a file.