Menu

#66 CGA 2-color graphics mode

closed
Qbix
None
3
2012-09-07
2004-12-25
Jim
No

First off, let me just say that I'm new to Sourceforge
and to your codebase, so it's very likely that I'll do
something dumb here, but I guess that's half the fun.
At least I'm not new to programming.

Anyway, I don't consider this patch, small as it is, to
be finished just yet, but I took it as far as I could
and need comments from someone more familiar with the
project. Basically, I thought I'd take advantage of
the holidays to do some programming, and to have a goal
firmly in mind, I decided to try to get a particular
game I remember from several years ago (Life & Death)
working better with DOSBox.

The very first screen in the game (the software
company's logo) uses the 2-color CGA mode 6, and the
image was pretty distorted. Looking into it a little,
I noticed that in setting the mode, the VGA mode
register is OR'ed with 0x20 for all CGA modes. Then
when VGA_DetermineMode runs, it sees the bit set at
0x20 and sets the mode over to M_CGA4. I suspect that
to be fully correct, some other flag should still be
set in the mode register for M_CGA2, but I'm not sure
what that would be, so I've left that out. I changed
some code to work around this issue and also set
vga.draw.blocks to width*2, as only the left side of
the screen was being drawn at that point.

The last part is the part I'm not so sure about. The
changes I made fixed most of the image, but there were
still double images. The upper half of the screen was
correct, but then there was a duplicate image in the
lower half, only offset by a certain amount. I got
around this by cutting the vertical display end for
mode 6 in half.

So, where I am now is that the image displayed seems
correct, but it is 640x200, so the screen is wide
rather than scaling to a more normal aspect ratio. I
noticed that in setting up the scaling, only a
doubleheight flag can be passed (where it seems that 4x
vertical scaling would be needed) so passing scaling
arguments through would require more extensive changes.
However, I don't know if that's necessary, and being
new to the codebase, I want to see what someone else
has to say about this, so I've given plenty of details.
This is pretty low priority, but I'd appreciate
hearing some thoughts about it.

Discussion

  • Jim

    Jim - 2004-12-25

    Diff against Version 0.63

     
  • Qbix

    Qbix - 2005-04-29

    Logged In: YES
    user_id=535630

    Yes it's very tricky.
    I committed some changes to the cvs which fix the LND logo and
    the graphics in spacewar and the mode 6 graphics in Romance
    Of the middle kingdoms 1

    I will attach them here as well

     
  • Qbix

    Qbix - 2005-04-29

    a new diff that seems to be working for me

     
  • Qbix

    Qbix - 2005-04-29

    Logged In: YES
    user_id=535630

    btw thank you for you patch as it got me started on where
    the problem was.

    I will close this report.
    you can still respond to it (or reopen it if it's wrong in
    your opinion

     

Log in to post a comment.