Trying to make a GD-ROM VGA patcher

General Dreamcast discussion applies here. Before posting here please check the other forums in the Dreamcast section to see if your topic would fit better in those categories.

Moderators: pcwzrd13, mazonemayu

Forum rules
Please check the other forums in the Dreamcast section before posting here to see if your topic would fit better in those categories. Example: A new game/homebrew release would go in the New Releases/Homebrew/Emulation section: http://dreamcast-talk.com/forum/viewforum.php?f=5 or if you're having an issue with getting your Dreamcast to work or a game to boot it would go in the Support section: http://dreamcast-talk.com/forum/viewforum.php?f=42
Post Reply
TapamN
letterbomb
Posts: 149
Joined: Sun Jan 10, 2021 10:52 pm

Trying to make a GD-ROM VGA patcher

Post by TapamN »

(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...
User avatar
fafadou
Gold Lion
Posts: 1663
Joined: Mon Nov 14, 2016 10:45 am

Re: Trying to make a GD-ROM VGA patcher

Post by fafadou »

You can compare a 1ST_READ.BIN original version and a patched one made by japanese_cake ?
I know it's not possible to convert bangai-o due to 2D graphism that japanese_cake said, but for Soul fighter, I guess it's possible.
User avatar
-drez01-
Tank Jr.
Posts: 344
Joined: Tue Feb 17, 2009 7:19 pm
Dreamcast Games you play Online: Quake III Arena
Location: Canada

Re: Trying to make a GD-ROM VGA patcher

Post by -drez01- »

.
Last edited by -drez01- on Sat Jul 30, 2022 11:05 pm, edited 1 time in total.
User avatar
-drez01-
Tank Jr.
Posts: 344
Joined: Tue Feb 17, 2009 7:19 pm
Dreamcast Games you play Online: Quake III Arena
Location: Canada

Re: Trying to make a GD-ROM VGA patcher

Post by -drez01- »

I tried the compiled version of NTSC enforcer (which is in 50hrz mode..) and after the swap disc screen all I get is a black screen. I was using a retail GD. Tried VGA and composite. Wouldn't boot the game after.

Have you gotten anything to boot with this? You should at least be able to hear it. Maybe its not your code..

There are many other ways to force VGA on non VGA games. Like Codebreaker and UTOPIA 1.5 (tho the menu doesn't support VGA, it forces VGA after swapping discs and pressing start..). I think Game shark and Import Enabler work too tho I'm not 100%. Possibly even PSO Patcher?

If you are working on a GD VGA patcher for the games that simply don't work with anything else then carry on, my bad. I don't know if Soul Fighter is one of those games..
TapamN
letterbomb
Posts: 149
Joined: Sun Jan 10, 2021 10:52 pm

Re: Trying to make a GD-ROM VGA patcher

Post by TapamN »

The NTSC Enforcer forces NTSC 480i/240. I'm just basing my code on it, but modifying it force VGA.

I can get stuff to boot using the PAL Enforcer's boot method, but my override code doesn't seem to be running afterwards. It just runs like normal.

The goal is to get games that can't run in VGA when using one of the existing methods (like cable swap after boot, Codebreaker). Stuff like Bangai-Oh, Airforce Delta, KoF 98, and Soul Fighter. Stuff that you can already get force to run, like Trickstyle isn't the point.

Getting Bangai-Oh might be a little more complicated, since it incorrectly boots into 640x480 if you bypass the BIOS's cable check, but I have some ideas that might get around it. The simplest thing that might work would be to keep the VGA box in NTSC mode (or keep the cable unplugged) until the Bangai-Oh boots (i.e. do the disc swap blind) so the game initializes as though it's on NTSC, then switch the box/cable to VGA afterwards. Another option is to set another breakpoint on the cable type address so that when the game tries to read it, the patcher overrides it and makes the game think it's still an NTSC cable.

I managed to get the breakpoint patcher to activate during the disc swap screen, but breakpoints also seem to get disabled after booting the game. I'm surprised the original worked.

Another issue with the PAL Enforcer's boot method is that it doesn't bypass disable the BIOS's VGA check. You have to have the VGA box in NTSC mode or you get sent to the BIOS with an error message.
User avatar
fafadou
Gold Lion
Posts: 1663
Joined: Mon Nov 14, 2016 10:45 am

Re: Trying to make a GD-ROM VGA patcher

Post by fafadou »

No matter the way, enjoy some no VGA games in VGA will be so awesome !
trickymainly
shadow
Posts: 5
Joined: Mon Aug 22, 2022 3:27 am
Dreamcast Games you play Online: I want winner

Re: Trying to make a GD-ROM VGA patcher

Post by trickymainly »

fafadou wrote:No matter the way, enjoy some no VGA games in VGA will be so awesome !

That's right, enjoying some games without VGA in VGA is great. very fun
User avatar
cbx
shadow
Posts: 12
Joined: Sun Jan 29, 2023 11:56 am
Location: Germany

Re: Trying to make a GD-ROM VGA patcher

Post by cbx »

Soul Fighter actually works with the Kaico HDMI adapter. The display reports 480i@60hz.
User avatar
fafadou
Gold Lion
Posts: 1663
Joined: Mon Nov 14, 2016 10:45 am

Re: Trying to make a GD-ROM VGA patcher

Post by fafadou »

Good, hope we can reach 480p one day.
Post Reply