New (old) guy - help modifying battletoads double dragon NES rom

Started by tblake05, January 22, 2022, 05:10:59 PM

Previous topic - Next topic

tblake05

Hello all! My name is Tim. I'm 35 years young and miss the technology I had when I was young. I'm into vintage computers, records, vintage video games and arcade games. Which is what brought me here....

I remember when I was younger, 16 or so, modifying roms for more enemies and harder levels on my parents old windows ME computer. Time went on (20 years or so) and now it seems brand new to me again. Like I forgot everything.

So here I am, my project..... I've got a Nintendo playchoice 10, dual monitor that I'm restoring. It's working well, just needs some cosmetics. That's besides the point. One of my favorite NES games, battletoads - double dragon was never officially released on the playchoice. But there are ways to play NES roms. (I don't want to hear about raspberry by or any multi-Cade nonsense, legacy hardware is the way to go)

My problem.... the NES rom when being played on the playchoice-10 can only be played as a single player because there is no player 2 start button.

The rom goes.....

-turn on
-main intro happens and you select 1 player, 2 player a, or 2 player b.
-all is fine up to here but if you select 2 player you move onto the next screen
- here each player moves their cursor and chooses the character they wish to be and push start. Player 2 has no start button so the game hangs.

Is there a way to remap the "start" button at this point to either be the "a" or "b" button. And only have it remapped for just this point in the game?

However it may also have to be remapped on the continue screen as well because I think players have to push "start" to continue after dying.

Can these buttons be remapped for just that point? Or is that not possible?  Anyone want to take on the project? As I'm sure I don't have the time, patience, or knowledge to do it anymore. Let me know how much it would cost.

Ps, BTDD is my little nephews favorite game on his Super Nintendo so he would love it if he could play it on my playchoice. So any guidance would be greatly appreciated.

Thanks!!!

~Tim

Bavi_H

For the US version (PRG+CHR CRC32 CEB65B06):

To allow START or A on the character select screen, go to NES file offset hex 318D0 and change the value from hex 33 to hex B3.

To allow START or A on the continue screen, go to NES file offset hex 366A1 and change the value from hex 10 to hex 90.

tblake05

 :woot!:

Holy cow, thanks a TON!!!

Which hex editor would you recommend?

Bavi_H

Any hex editor will work, they're all pretty much the same.

If you already have the emulator FCEUX, it has a hex editor window you can use.

To view the NES file:
1. Open FCEUX and open the game.
2. Go to the Debug menu and choose Hex Editor.
3. In the Hex Editor window, go to the View menu and choose ROM File. (This shows the contents of the NES file.)

To change values:
1. In the File menu, choose Goto Address, then enter the address.
2. The text cursor is now positioned at the value for that address. Confirm the value matches the "from" value in the instructions.
3. Type over the value to replace it.

To save the changes:
Go to the File menu and choose Save Rom As.


tblake05

Great thanks a ton!!!

January 26, 2022, 10:24:05 PM - (Auto Merged - Double Posts are not allowed before 7 days.)

Quote from: Bavi_H on January 24, 2022, 12:25:47 PM
Any hex editor will work, they're all pretty much the same.

If you already have the emulator FCEUX, it has a hex editor window you can use.

To view the NES file:
1. Open FCEUX and open the game.
2. Go to the Debug menu and choose Hex Editor.
3. In the Hex Editor window, go to the View menu and choose ROM File. (This shows the contents of the NES file.)

To change values:
1. In the File menu, choose Goto Address, then enter the address.
2. The text cursor is now positioned at the value for that address. Confirm the value matches the "from" value in the instructions.
3. Type over the value to replace it.

To save the changes:
Go to the File menu and choose Save Rom As.



Didn't work.

I wonder if I am using the wrong version of the ROM?  How do I verify which one I have?

Bavi_H

Quote from: Bavi_H on January 23, 2022, 02:47:27 PMFor the US version (PRG+CHR CRC32 CEB65B06)

Quote from: tblake05 on January 24, 2022, 01:47:40 PMI wonder if I am using the wrong version of the ROM?  How do I verify which one I have?

Here's a way to verify the NES file matches the one I was using:

1. Open FCEUX and open the game.
2. Go to the Help menu and choose Message Log.
3. Look for the line ROM CRC32. If the value is 0xceb65b06 then it is the US version I was looking at.

KingMike

If it doesn't work, make sure your ROM isn't set to Read-Only.
Find your ROM in Windows Explorer, right-click on it, select Properties and see if Read-Only is checked.
(and that it is also unzipped as well, not sure how clear that was)
"My watch says 30 chickens" Google, 2018

Bavi_H

Quote from: KingMike on January 27, 2022, 11:55:15 AMIf it doesn't work, make sure your ROM isn't set to Read-Only.

(Note: I recommend using the "Save Rom As" command to save the changes to a new file, instead of using the "Save Rom" command which will overwrite the original file. If you use the "Save Rom As" command, then it doesn't matter if the original file is read-only or not.)

tblake05

So I think I had the rom in a zip folder still- as I tried it again, and IT WORKED!!!!!!

Question though, would it be possible to do the same for Player 1 as well, just to keep it uniform?  (my OCD, you know).

What bits do I change for that?

You are seriously the best sir!

Bavi_H

Quote from: tblake05 on February 06, 2022, 07:13:01 PMwould it be possible to do the same for Player 1 as well, just to keep it uniform?

The changes I described for the character select screen and for the continue screen already work for both controller 1 and controller 2.

If you want to change the main menu, you can do this:
  • To allow controller 1 START or A to confirm the item on the main menu, go to NES file offset hex 319CD and change the value from hex 10 to hex 90.

And I was thinking about it, and I wondered if it would be even better to allow START or A or B, so you can press any button to confirm a selection. If you want to do that, you can do this:
  • To allow (controller 1) START or A or B to confirm the item on the main menu, go to NES file offset hex 319CD and change the value from hex 10 to hex D0.
  • To allow (controller 1 or 2) START or A or B to confirm the selection on the character select screen, go to NES file offset hex 318D0 and change the value from hex 33 to hex F3.
  • To allow (controller 1 or 2) START or A or B on the continue screen, go to NES file offset hex 366A1 and change the value from hex 10 to hex D0.

tblake05

I'm back!!!

New issue, and it only happens when playing BTDD on the PC10....

In video cut scenes, as in, between certain levels or after both players selecting their fighters, there are short video's.  The video's can be skipped by either player pushing any button.  about 50/50 of the time on the playchoice, this resets the game.  I cannot make it happen in PC emulation to watch the data stream.  Plus it does it on my modified rom as well as an unmodified original rom.

Does anyone have any idea why this might happen? and how to fix it?

I was thinking a workaround may be to just inhibit controller input on the videos.  Though it would make gameplay longer.  Otherwise I could inhibit all buttons but start?  What would you guys suggest?

And how do I do I go about it?

Thanks a ton!!

~Tim

Bavi_H

I was interested in trying to re-create the bug to troubleshoot it futher. I began attempting to run Battletoads Double Dragon in the NO$NES emulator PlayChoice-10 mode. But I ended up encountering the following issue in both NO$NES's NES and PlayChoice-10 modes: After the initial pre-level cutscene is either bypassed or finishes natrually and the level is just about to start, the game freezes. In the PlayChoice-10 mode, it then resets the NES game after about 4 seconds. I suspect the NO$NES emulator isn't precise enough to run the Battletoads Double Dragon game correctly. But perhaps this issue has some similarities to the issue you are experiencing.

In the NO$NES everynes.htm document, there is a section about differences to be aware of when running NES games in a PlayChoice-10. The following differences may be relevant: "NES NMI Disable The PC10 BIOS is watching the NES NMI signal. If the NES disables NMIs for a longer period (around 255 frames), then it'll treat the game to have locked up, and will terminate the game. [...] NES Pause / Timings [...] reportedly, the PC10 RGB-PPU timing isn't exactly same as NES NTSC-PPU timing (reportedly something to do with missing dots on some NTSC scanlines or so)."

When I investigated using debuggers and tools in NO$NES and Mesen, I discovered the following. The game displays the scores and health status bar at the top of the screen, then switches the graphics for the rest of the screen to display the level. The game sets up a sprite zero hit to occur at the bottom right of the status bar area to tell when to switch the graphics. In the NO$NES emulator, the sprite zero hit never happens for some reason and the game remains stuck in a loop checking for the sprite zero hit. This loop also has the effect of preventing the NMI from firing, so in the PlayChoice-10 mode, the BIOS notices the NES game is frozen and aborts it after about 4 seconds.

If you are willing to test this, here are some mods that move or bypass the status bar sprite zero hit.

Like the mods earlier in this thread, the following mods are for the US version (PRG+CHR CRC32 CEB65B06)
NES file offset hex: original value hex → new value hex


A. Move the status bar sprite zero hit left 8 pixels.

32239: 9F → 9E
38062: FE → F6

Maybe moving the sprite zero hit position a little bit to the left may help the game work reliably on the PlayChoice-10? This mod moves the sprite zero hit position left 8 pixels.


B. Disable the status bar sprite zero hit check loop

1A3: F0 FB → EA EA

This mod will disable the loop that checks for the sprite zero hit at the bottom of the status bar. This will cause the bottom half of status bar to be missing, but it might be useful for testing purposes. If the game runs okay otherwise, then that suggests this sprite zero hit check loop is the cause of the problem.

tblake05

Bavi_H, once again, thank you for the tremendous amount of effort and help.  I'll give these both a shot and let you know. 

tblake05

Quote from: Bavi_H on March 28, 2022, 02:26:49 AM
I was interested in trying to re-create the bug to troubleshoot it futher. I began attempting to run Battletoads Double Dragon in the NO$NES emulator PlayChoice-10 mode. But I ended up encountering the following issue in both NO$NES's NES and PlayChoice-10 modes: After the initial pre-level cutscene is either bypassed or finishes natrually and the level is just about to start, the game freezes. In the PlayChoice-10 mode, it then resets the NES game after about 4 seconds. I suspect the NO$NES emulator isn't precise enough to run the Battletoads Double Dragon game correctly. But perhaps this issue has some similarities to the issue you are experiencing.

In the NO$NES everynes.htm document, there is a section about differences to be aware of when running NES games in a PlayChoice-10. The following differences may be relevant: "NES NMI Disable The PC10 BIOS is watching the NES NMI signal. If the NES disables NMIs for a longer period (around 255 frames), then it'll treat the game to have locked up, and will terminate the game. [...] NES Pause / Timings [...] reportedly, the PC10 RGB-PPU timing isn't exactly same as NES NTSC-PPU timing (reportedly something to do with missing dots on some NTSC scanlines or so)."

When I investigated using debuggers and tools in NO$NES and Mesen, I discovered the following. The game displays the scores and health status bar at the top of the screen, then switches the graphics for the rest of the screen to display the level. The game sets up a sprite zero hit to occur at the bottom right of the status bar area to tell when to switch the graphics. In the NO$NES emulator, the sprite zero hit never happens for some reason and the game remains stuck in a loop checking for the sprite zero hit. This loop also has the effect of preventing the NMI from firing, so in the PlayChoice-10 mode, the BIOS notices the NES game is frozen and aborts it after about 4 seconds.

If you are willing to test this, here are some mods that move or bypass the status bar sprite zero hit.

Like the mods earlier in this thread, the following mods are for the US version (PRG+CHR CRC32 CEB65B06)
NES file offset hex: original value hex → new value hex


A. Move the status bar sprite zero hit left 8 pixels.

32239: 9F → 9E
38062: FE → F6

Maybe moving the sprite zero hit position a little bit to the left may help the game work reliably on the PlayChoice-10? This mod moves the sprite zero hit position left 8 pixels.


B. Disable the status bar sprite zero hit check loop

1A3: F0 FB → EA EA

This mod will disable the loop that checks for the sprite zero hit at the bottom of the status bar. This will cause the bottom half of status bar to be missing, but it might be useful for testing purposes. If the game runs okay otherwise, then that suggests this sprite zero hit check loop is the cause of the problem.

Hey again Bavi H!

Attempt A still reboots the rom, though it seems not as often.

Attempt B like you say is missing half the title bar.  If fixed the rebooting issue at cut scenes completely, though now there is an issue when walking up and down the ship, the entire screen bounces.

Maybe the incompatibility just cannot be fixed.  Should I just disable key presses (controller input) during cut scenes, how would I do that?

Thanks again for the help.

~Tim

Bavi_H

Hello Tim (tblake05).

Thank you for testing and describing the results you saw.

I was wondering, how do you get these ROM mods on to your PlayChoice-10? Do you have to reprogram a ROM chip every time you modify the game? Does it require time, money, or effort each time? I hope it's not too frustrating we haven't found a solution yet.

I haven't been able to re-create the exact symptoms you describe in the NES and PlayChoice-10 emulators I'm using, so I've only been making guesses about what might be causing it. My guess is that some of the timing a real PlayChoice-10 uses is just a little bit different than the NES. I hope I can eventually see the same kind of symptoms you describe in an emulator and find a better solution.


If you're willing to keep testing things, maybe you could tell me any of the information below about your system? I'm not sure the best details to ask for, but maybe some of this information could help recreate the symptoms you are seeing.
    Are you using an original BIOS or a modified BIOS? Is there a checksum or some way to identify what BIOS you have?

    Do you have a one-screen or a two-screen unit? Upright, countertop, or red tent?

    Do you have a custom instruction screen created for the game? (I read that each game's instruction screen can have a customized demo time limit. Although that doesn't sound like it should affect anything once the game is started, I believe the computer for the PlayChoice-10 screens has the ability to freeze or otherwise mess with the NES computer timing. So I wonder if any differences in the instruction screen might cause timing differences between your system and the emulator I'm using.)

You asked if there was a way to disable controller input or only allow the START button on the cutscenes. You can try the mods below, but note the following:
    The game has a common routine that runs every frame. Part of the common routine reads the controllers and saves button bit flags to specific RAM addresses. Later in the frame, specific code for certain screens can check those button bit flags if desired. If the game is at a point where the controllers are ignored, the button flags will not be checked, but the initial code that saves the button flags into RAM still runs every frame.

    So the code that actually reads the controllers can't be disabled because that would affect the entire game, but various code that checks the saved button flags can be altered. I can't tell if these mods will alleviate the symptoms you are experiencing.

Mods for the US version (PRG+CHR CRC32 CEB65B06)
NES file offset hex: original bytes hex new bytes hex

Don't look at the controller button values during cutscenes:
31A0C: A5 31 05 32 A9 00 EA EA

Only allow the START button to skip cutscenes:
31A10: F0 99 29 10 29 10 F0 97


tblake05

Hello again bavi! And thanks for the help!

I'm using my stock PC10 dual monitor. Stock bias.

Yes it does just write onto an eeprom from my programmer, then into a pc10 repro cartridge and onto the stock pc10 board. It does use the title screen. So I'll mess around with that.

It's a slow process because my pc10 is apart right now getting restored and one monitor is having issues.

I'll try what you suggest and report back. Thanks!!