VOGONS


Obitus VGA Issues

Topic actions

First post, by cuttock

User metadata
Rank Newbie
Rank
Newbie

Hello gang! 😀
Obitus. Plain and simple, it works just fine on Wondows 98 and XP. I've downloaded several versions, and none work in VGA, only EGA.
Any idea?

Reply 1 of 23, by jal

User metadata
Rank Oldbie
Rank
Oldbie
cuttock wrote:

Hello gang! 😀
Obitus. Plain and simple, it works just fine on Wondows 98 and XP. I've downloaded several versions, and none work in VGA, only EGA.
Any idea?

DOSbox doesn't emulate EGA, only VGA. Do you mean it starts in 16 color mode instead of 256 color mode? Can you provide screendumps?

JAL

Reply 3 of 23, by eL_PuSHeR

User metadata
Rank l33t++
Rank
l33t++

I cannot agree. Cool Croc Twins also displays this behaviour. It runs in CGA, EGA but it complains saying there is no VGA detected (even if it uses a 16c mode with VGA palette colours). If you run it under native WinXP NTVDM, VGA is properly detected. 😕

Reply 4 of 23, by cuttock

User metadata
Rank Newbie
Rank
Newbie

Fellas, thanks for your attention. Well, as the great el pushor says, this problem occurs on other games. Basically, the game won't allow me to select VGA (or Tandy) screen modes, only CGA & VGA. When playing in Win 98 or XP< all modes are allowed.
Look at the following screens!

Attachments

  • Clipboard06.gif
    Filename
    Clipboard06.gif
    File size
    3.26 KiB
    Views
    1708 views
    File comment
    Only 2 modes allowed.
    File license
    Fair use/fair dealing exception
  • Clipboard07.gif
    Filename
    Clipboard07.gif
    File size
    59.11 KiB
    Views
    1708 views
    File comment
    The game in not so glorious EGA.
    File license
    Fair use/fair dealing exception

Reply 5 of 23, by jal

User metadata
Rank Oldbie
Rank
Oldbie
cuttock wrote:

Fellas, thanks for your attention. Well, as the great el pushor says, this problem occurs on other games. Basically, the game won't allow me to select VGA (or Tandy) screen modes, only CGA & VGA. When playing in Win 98 or XP< all modes are allowed.
Look at the following screens!

It would be interesting (and probably easy) to debug the detection scheme. Do you have the game available for testing somewhere?

Edit: I found it at Underdogs, so I'll see if I can find the problem...

JAL

Reply 6 of 23, by jal

User metadata
Rank Oldbie
Rank
Oldbie

Bug found. Obitus executes the following piece of code to determine whether a VGA is present, using the VGA DAC registers:

  cs:031A BAC803         mov    dx,03C8
cs:031D B000 mov al,00
cs:031F EE out dx,al
cs:0320 42 inc dx
cs:0321 B000 mov al,00
cs:0323 EE out dx,al
cs:0324 B000 mov al,00
cs:0326 EE out dx,al
cs:0327 B000 mov al,00
cs:0329 EE out dx,al
cs:032A BAC803 mov dx,03C8
cs:032D EC in al,dx

It then checks to see whether al returns 01, if so it allows VGA. DOSbox returns 0xff here, so Obitus doesn't see VGA. The reading of al and checking against a certain value is not a safe thing to do (many chipsets implement this in a different way), but at least DOSbox should follow the VGA standard.

I included a patched version of the EXE that works with DOSbox, so you can play it until this bug gets fixed.

Edit: I submitted the bug to Sourceforge, including a simpel testprogram.

JAL

Attachments

  • Filename
    OBITUSUF.zip
    File size
    8.07 KiB
    Downloads
    150 downloads
    File license
    Fair use/fair dealing exception
Last edited by jal on 2005-02-11, 10:42. Edited 1 time in total.

Reply 7 of 23, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

hmm 0xff would indicate they read of an unhandled port ?
dunno.

I have some more exes with vga problems somewhere.

Water flows down the stream
How to ask questions the smart way!

Reply 8 of 23, by eL_PuSHeR

User metadata
Rank l33t++
Rank
l33t++

Hmmm, maybe "Cool Croc Twins" suffers for the same "checking code". It uses a 16c VGA mode too.

PS - Have to check some bios VGA features to see what's the outcome of reading/writing AL=00 to ports 03C8h and 03C9h.

PS2 - I entered that piece of code into Windows XP NTVDM's debug and returned AX=0000

Reply 9 of 23, by jal

User metadata
Rank Oldbie
Rank
Oldbie
Qbix wrote:

hmm 0xff would indicate they read of an unhandled port ?
dunno.

I have some more exes with vga problems somewhere.

0xff is indeed the the value when reading an unhandled port. However, 0x3c8 should be a perfectly readible port, as it's the DAC index register.

I have only old DOSbox sources at hand (version 0.61 I think), but there's the bug already. In VGA_SetupDAC, there's only a write handler defined for 0x3c8, not a read handler:

void VGA_SetupDAC(void) {
// cut some code

/* Setup the DAC IO port Handlers */
IO_RegisterWriteHandler(0x3c6,write_p3c6,"PEL Mask");
IO_RegisterReadHandler(0x3c6,read_p3c6,"PEL Mask");
IO_RegisterWriteHandler(0x3c7,write_p3c7,"PEL Read Mode");
IO_RegisterReadHandler(0x3c7,read_p3c7,"PEL Status Mode");
IO_RegisterWriteHandler(0x3c8,write_p3c8,"PEL Write Mode");
// where's the read handler for 0x3c8???
IO_RegisterWriteHandler(0x3c9,write_p3c9,"PEL Data");
IO_RegisterReadHandler(0x3c9,read_p3c9,"PEL Data");
};

JAL

Reply 10 of 23, by jal

User metadata
Rank Oldbie
Rank
Oldbie
eL_PuSHeR wrote:

Hmmm, maybe "Cool Croc Twins" suffers for the same "checking code". It uses a 16c VGA mode too.

PS - Have to check some bios VGA features to see what's the outcome of reading/writing AL=00 to ports 03C8h and 03C9h.

PS2 - I entered that piece of code into Windows XP NTVDM's debug and returned AX=0000

You should write three values to 0x3c9. 3c8 is the index port: when writing to the port, that value determines the data register index for the color to modify. E.g. if you want to change color 15, write 15 to 3c8. After outputting the RGB values (three bytes) to 3c9, the index autoincrements, and reading it will result in the value 16.

I've included here the simple testprogram I also included in the sourceforge bugtracker. It writes three 0's to 3c9 after writing a zero to 3c8, so 3c8 yields 1 in NTVDM, but 0xff in DOSbox (probably due to a missing readhandler).

JAL

Attachments

  • Filename
    TESTDAC.EXE
    File size
    2.56 KiB
    Downloads
    160 downloads
    File license
    Fair use/fair dealing exception
Last edited by jal on 2005-02-11, 11:03. Edited 1 time in total.

Reply 11 of 23, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

3C8h (R/W): PEL Address Write Mode
bit 0-7 The PEL data register (0..255) to be written to 3C9h.
Note: After writing the 3 bytes at 3C9h this register will increment, pointing
to the next data register.

you are right.
it's r/w

Water flows down the stream
How to ask questions the smart way!

Reply 13 of 23, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I attached a small patch to the code.
it gives the 01 index return at my place.

Water flows down the stream
How to ask questions the smart way!

Reply 14 of 23, by cuttock

User metadata
Rank Newbie
Rank
Newbie

Wow you guys went way over my head in expertise level here....

and I am glad you did:)

Thank you for the fix, Jal! I guess it's not what you'd call a fault exclusive to DosBox or the programmers of the game, but a little of both?

In any case i got it working thanks to you guys.
As you can see, the game's look and mood is terrifically improved in VGA!

Attachments

  • Obituswww.gif
    Filename
    Obituswww.gif
    File size
    77.02 KiB
    Views
    1663 views
    File license
    Fair use/fair dealing exception

Reply 15 of 23, by jal

User metadata
Rank Oldbie
Rank
Oldbie
cuttock wrote:

Thank you for the fix, Jal! I guess it's not what you'd call a fault exclusive to DosBox or the programmers of the game, but a little of both?

You're welcome cuttock, glad to be of help. It's a bug in DOSbox, but the game could check for VGA in about 10.000 better ways too 😀.

JAL

Reply 16 of 23, by jal

User metadata
Rank Oldbie
Rank
Oldbie
eL_PuSHeR wrote:

Hmmm, maybe "Cool Croc Twins" suffers for the same "checking code". It uses a 16c VGA mode too.

It does. I just debugged, and it uses exactly the same checking sequence. I can't provide a patched version however, since it suffers from encryption and CRC-checking.

JAL

Reply 17 of 23, by eL_PuSHeR

User metadata
Rank l33t++
Rank
l33t++

Here. My version. I have unpacked it. I would like you to patch it just for knowledge sake.

Attachments

  • Filename
    COOLCROC.ZIP
    File size
    367.9 KiB
    Downloads
    150 downloads
    File license
    Fair use/fair dealing exception

Reply 18 of 23, by jal

User metadata
Rank Oldbie
Rank
Oldbie
eL_PuSHeR wrote:

Here. My version. I have unpacked it. I would like you to patch it just for knowledge sake.

Ah, so you don't believe me? With a hex editor and all the information above, you could patch it yourself, you lazy !@#$!#@% 😀.

But okay, since I'm in a good mood today, here it is.

JAL

Attachments

  • Filename
    COOLFIX.zip
    File size
    283.34 KiB
    Downloads
    143 downloads
    File license
    Fair use/fair dealing exception