Undocumented video modes

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
guferr
Posts: 22
Joined: Sat Aug 20, 2011 1:57 pm

Undocumented video modes

Post by guferr »

Hi, i was trying to make an video recorder for my O.S. (via int 08h), so i started by creating an DOS interrupt to make it. This interrupt tries to identify the video mode trough the int 010h, and then records the video memory in the hard disk, in the correct mode for the identified video mode. It works fine with various programs and video modes, both text and graphic, but i got stuck on the simpsons game for DOS, what uses an video mode that seems to be 320*200 with 256 colors, and int 010h is informing that too (mode 04h), but the recording doesn't work on this game, all i got are some columns, and the rest stay black. I made various tests, and i tried to write on that video mode (inside the game), like i would do on the mode 04h, but only some columns change, the rest stay untouched.
Searching on the internet i found something about "unusual" or "undocumented" video modes, that are "branches" of video mode 04h, but they didn't explain how to operate on those video modes. And the worst, i lost those pages, so now i have nothing talking about it. Do someone know about those video modes? Thanks for the help :).

Obs.: This game tries to replace the int 08h, so i had to make some tricks to fool the game, so my original int 08h can stay running.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Undocumented video modes

Post by Brendan »

Hi,

Sounds like "Mode X" (or a variation of it) to me...


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
guferr
Posts: 22
Joined: Sat Aug 20, 2011 1:57 pm

Re: Undocumented video modes

Post by guferr »

Thanks Brendan, those were the video modes that i was talking about, but the question is:
How to identify between them (Mode X, Y and Q).
And, how to operate on them, what are the memory areas used by them (would they begin from A0000h just like mode 013h?) and how the operate the registers to select the color planes. I think this may be the same way you do on mode 12h. I just want to know if there's any more detailed article, because this wikipedia article is just one superficial explanation. I think i can do something from here, but a little more help would save me time.
Thanks for the help :).
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: Undocumented video modes

Post by VolTeK »

User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Undocumented video modes

Post by Brendan »

Hi,
guferr wrote:How to identify between them (Mode X, Y and Q).
If the program asked for "320*200" then you'd have to check the VGA card's registers to see if they were left in the default state for "320*200" or if the program tweaked them for "mode X", "mode Y" or "mode Q".

Of course it's entirely possible for a program to do a complete video mode switch without using the BIOS or VBE at all. To guard against that, you could ignore the BIOS/VBE yourself and get all the information needed to decode display memory directly from the video card's registers; which might not be too messy if you know the card is 100% VGA compatible (but quickly becomes a nightmare for SVGA - different code for different cards).

The other alternative might be to run the program inside an emulator. For example, you could use DOSEMU, and modify the emulator so that you get the video data directly from DOSEMU's framebuffer (before DOSEMU sends it to the real video card) so that you don't need to care what the program itself actually does with the emulated video card.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Undocumented video modes

Post by Combuster »

If a framegrabber is all you want, Dosbox is the way to go.

What happens behind the scenes is that some programs don't use int 10h to set the video mode they want and instead program the hardware directly (with the consequence that any calls to int 10h will likely report wrong information). There is a ton of information on the VGA already lying around, with our wiki being a good starting point. The Mode X article should have directed you to that subject as well (did you search?).
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
guferr
Posts: 22
Joined: Sat Aug 20, 2011 1:57 pm

Re: Undocumented video modes

Post by guferr »

Thanks, that is all i need. I just discovered the game video mode is 320*240 256 colors. Making a video recorder wasn't Exactly my goal, it was just the program that make me wonder that. I wanted to know that for future programs. Thanks.
Post Reply