Skip to content

Commit

Permalink
PC-98: Limit the graphics layer to the number of active display lines…
Browse files Browse the repository at this point in the history
… programmed into the GDC so First Queen can display the status bar correctly at the bottom of the screen
  • Loading branch information
joncampbell123 committed Jul 24, 2019
1 parent 7684b8f commit 9b0d5f5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
@@ -1,4 +1,9 @@
0.82.20 (next)
- PC-98 graphics emulation fixed to render only the
number of active display lines programmed into
the GDC instead of matching the text layer. This
fixes the status bar at the bottom of the screen
in "First Queen" and "First Queen II".
- Normal CPU core fixed not to immediately process
interrupts on STI but to wait a little bit so that
a STI + CLI sequence does not cause interrupt
Expand Down
12 changes: 12 additions & 0 deletions src/hardware/vga_draw.cpp
Expand Up @@ -1908,6 +1908,18 @@ static Bit8u* VGA_PC98_Xlat32_Draw_Line(Bitu vidstart, Bitu line) {
if (pc98_gdc[GDC_SLAVE].doublescan && pc98_graphics_hide_odd_raster_200line && pc98_allow_scanline_effect)
ok_raster = (vga.draw.lines_done & 1) == 0;

// Generally the master and slave GDC are given the same active display area, timing, etc.
// however some games reprogram the slave (graphics) GDC to reduce the active display area.
//
// Without this consideration, graphics display will be incorrect relative to actual hardware.
//
// This will NOT cause correct display if other parameters like blanking area are changed!
//
// Examples:
// - "First Queen" and "First Queen II" (reduces active lines count to 384 to display status bar at the bottom of the screen)
if (vga.draw.lines_done >= pc98_gdc[GDC_SLAVE].active_display_lines)
ok_raster = false;

// Graphic RAM layer (or blank)
// Think of it as a 3-plane GRB color graphics mode, each plane is 1 bit per pixel.
// G-RAM is addressed 16 bits per RAM cycle.
Expand Down

3 comments on commit 9b0d5f5

@cracyc
Copy link

@cracyc cracyc commented on 9b0d5f5 Jul 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to look at Dragon Buster which sets the slave 7220 to have a bigger vertical back porch so the graphics layer is shifted down relative to the text for the top status bar.

@joncampbell123
Copy link
Owner Author

@joncampbell123 joncampbell123 commented on 9b0d5f5 Jul 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried, but Dragon Buster seems to be stuck in a loop waiting for an interrupt from the floppy controller (something with port 90h), can't get it to run yet.

Are there any other games that do similar tricks shifting the graphics layer around through modification of the blanking area?

@cracyc
Copy link

@cracyc cracyc commented on 9b0d5f5 Jul 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I can think of.

Please sign in to comment.