Grievous Bodily 'ARM screen geometry

Discuss VIDC, translation to VIDC20 and emulation of VIDC
Post Reply
JonAbbott
Posts: 1739
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Grievous Bodily 'ARM screen geometry

Post by JonAbbott » Wed Nov 02, 2016 7:31 pm

None of the emulators get the geometry correct for this game. ADFFS' VIDC translation also gets it wrong.

I've compared the original, running on an ARM2/RO2 A310 vs Pi3 and the issue is probably the right border. When scrolling horizontally the left border width is changing, but the right border isn't; as a consequence the screen width is changing.

The game doesn't set HBSR/HBER. The only values set in-game are HDSR/HDER which are set to the scroll position + 1C / EC respectively, resulting in a screen width of 398 pixels. The scroll position values go from 0 to 3, so the game is sliding the visible window between 0 and 6 pixels in 2 pixel increments.

JonAbbott
Posts: 1739
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: Grievous Bodily 'ARM screen geometry

Post by JonAbbott » Thu Nov 03, 2016 11:11 am

RO2 and 3 use slightly different HBSR / HBER values for MODE 9 (the game uses an overscan MODE 9), modifying GBA's Mode Extension module to set the borders using either RO2 or RO3 values doesn't resolve the scrolling, although it does alter the left border width slightly, depending on which values are used.

JonAbbott
Posts: 1739
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

Re: Grievous Bodily 'ARM screen geometry

Post by JonAbbott » Fri Nov 04, 2016 12:50 pm

I've now tracked down the issues with this game:
  1. It doesn't set HBSR / HBER, so relies on both being set by the OS to the correct value (RO2 is using HBSR=54 / HBER=238)
  2. Its setting the screen geometry, before it swaps frames
  3. The frame swap doesn't occur during flyback
All of which begs the question: How is it smooth on VIDC?

I've also noticed that the display is two pixels wider on an A3xx. Watching the game under Arculator, you can see the game altering HDSR mid-frame, making it two pixels thinner. This combined with the fact the game is smooth on RO2, possibly implies changes to HDSR/HDER don't occur mid-frame, but shift back until the next flyback.

A possible fix: The Mode Extension needs HBSR / HBER adding to the VIDC parameter list (880D8000 / 943B8000 respectively), the VSync code @ AC214 needs to not call the VIDC code, and the frame swap code needs to branch to the VIDC code @ AC26C instead of exiting @ AC4F4

And just to add to the complications, the copy of GBA we've been working off isn't the original Fourth Dimension release, but appears to be a modified version that's had the protection stripped out.

I've now received and imaged a set of original floppies on the Kryoflux and will create a new set of JFD's, with a boot script that corrects the above issues.

Post Reply