Trying to make a GD-ROM VGA patcher
Posted: Sat Jul 30, 2022 2:11 am
(Not totally sure if which category is the right place to post this. Move it if necessary.)
My Dreamcast is connected to a CRT monitor with a VGA box. Most games support VGA, but there are a few that don't. I picked up Soul Fighter recently, only to discover I can't try it with my set up. How annoying. I don't want to have to move to another room and use s-video, I want to play it using VGA where I normally do.
There a this "PAL Enforcer" program that forces games to run in 50 Hz PAL mode by overriding the video setting registers. It sets a breakpoint to occur when one of the video registers was written, then overwrites it with the desired mode. The code to do this would be loaded into an unused section of the syscall area. I figured I could modify it to work as a "VGA Enforcer" to force games that don't support VGA to run in a VGA video mode.
At first, I used the breakpoint controller, like PAL Enforcer did. It didn't seem to work. I wasn't sure how if was getting disabled or I modified it wrong, so I decided I'd replace the GD-ROM syscall point to change the video settings every time the GD drive was accessed, which is generally polled at least once every frame. The Enforcer polled the drive to check for the disc change, so it would work for sure in the Enforcer, if I wrote it correctly.
It seemed to work. If I booted the Dreamcast in NTSC and loaded the VGA Enforcer, I could flick the switch on by VGA box back to VGA and see the "Swap Disc" screen in VGA, so it successfully switched the video mode.
However, I still couldn't get it to work after swapping discs. The PAL Enforcer program booted the GD-ROM with some kind of reboot syscall, but that apparently ends up disabling the patch. To work around this, I guess I need to manually load 1ST_READ.BIN (and IP.BIN?) from the GD, and jump to it.
Does anyone happen to have code that does this already? I could figure it out on my own, but if someone else has probably already done this, it would save me time if I could just reuse it. It's annoying having to swap discs every time I test it...
My Dreamcast is connected to a CRT monitor with a VGA box. Most games support VGA, but there are a few that don't. I picked up Soul Fighter recently, only to discover I can't try it with my set up. How annoying. I don't want to have to move to another room and use s-video, I want to play it using VGA where I normally do.
There a this "PAL Enforcer" program that forces games to run in 50 Hz PAL mode by overriding the video setting registers. It sets a breakpoint to occur when one of the video registers was written, then overwrites it with the desired mode. The code to do this would be loaded into an unused section of the syscall area. I figured I could modify it to work as a "VGA Enforcer" to force games that don't support VGA to run in a VGA video mode.
At first, I used the breakpoint controller, like PAL Enforcer did. It didn't seem to work. I wasn't sure how if was getting disabled or I modified it wrong, so I decided I'd replace the GD-ROM syscall point to change the video settings every time the GD drive was accessed, which is generally polled at least once every frame. The Enforcer polled the drive to check for the disc change, so it would work for sure in the Enforcer, if I wrote it correctly.
It seemed to work. If I booted the Dreamcast in NTSC and loaded the VGA Enforcer, I could flick the switch on by VGA box back to VGA and see the "Swap Disc" screen in VGA, so it successfully switched the video mode.
However, I still couldn't get it to work after swapping discs. The PAL Enforcer program booted the GD-ROM with some kind of reboot syscall, but that apparently ends up disabling the patch. To work around this, I guess I need to manually load 1ST_READ.BIN (and IP.BIN?) from the GD, and jump to it.
Does anyone happen to have code that does this already? I could figure it out on my own, but if someone else has probably already done this, it would save me time if I could just reuse it. It's annoying having to swap discs every time I test it...