News: 11 March 2016 - Forum Rules, Mobile Version
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia

Author Topic: Nintendo Vs - NES Hardware Hacks  (Read 1211 times)

Psyklax

  • Sr. Member
  • ****
  • Posts: 412
    • View Profile
    • Psyklax Translations
Nintendo Vs - NES Hardware Hacks
« on: October 21, 2017, 02:07:10 pm »
Okay guys, I've got a new project. Good news is it won't be so hard to complete as previous projects of mine. Bad news is it's not quite as interesting. :D

I made a thread where I posted a bunch of Game Genie codes to activate free play on Nintendo Vs games so that you can play them on a real NES without worrying about inserting coins. Just one problem: each game used a PPU that had the colours intentionally mixed up for copy protection purposes, so the game looks all messed up. Sure, you can still play the games, but it's not much fun...

So I decided I needed to do some proper hacking: nobody's actually gonna plug an arcade board into their NES, so why not make a proper patch instead of changing one byte? I've started with Dr Mario - no reason - and got some interesting results.


http://s346165667.websitehome.co.uk/psyktrans/drmariovs.ips

Let me explain how I did it, first of all.

First, I used the information on the nesdev wiki that details the palette that Dr Mario uses (on the RP2C04-0003 chip). I put that information in a table file, and made another table file which corresponded to the correct order of colours. The palettes are stored in the game in a block (or in the case of Dr Mario, two blocks which are subtly different from one another). Once I found the block, I dumped each part with Thingy32 - yes, that ancient thing, but it was the best thing for the job in this case. I then looked at the dump, and manually typed in each colour, but with the correct table file. The result? All the colours now have their correct values. I'd love to automate the process, but Thingy32 just inserted a bunch of nothing when I tried, and I don't know of another program that would do it.

When I did this, however, two really weird things happened. Normally, you have to flip the dipswitches to activate free play mode, but after modifying the palettes, free play was automatically activated. I have no idea why... but it needs testing on a real NES, to see if it's not just FCEUX acting weird.

Second thing is one of the colours in the game. It appears that the game has a routine that changes the background colour depending on the level you're on, separate from the palette blocks. When I corrected the rest of the palette, it looked identical to the original game, but if you play the unmodified Vs ROM in FCEUX, the background is grey. Why? Because the colour used ($03) is grey on the RP2C04-0003 chip, but purple on a real NES. But the value is the same in both the original game and the Vs version. Is this a bug? I don't know. Another reason to test it on a real NES - and see a real arcade cabinet, too. I found one video on YouTube of it, but the quality meant it was inconclusive (it's like that dress all over again... :D ).

I finished off the hack by making the input just like the original: now you start the game by pressing Start, whereas on the Vs version you press Select on the title screen and A or B on the menu.

Admittedly, this isn't the best example of a Vs game worth playing on your real NES, as I imagine it's practically identical. Nevertheless, it's a first step, and if anyone has a flash cart and could try it on the real thing I would be VERY keen to hear feedback (I don't have a flash cart).

I created a new thread because if all goes well, you'll be seeing a lot more games in future. :)

EDIT: just noticed something after a quick test: the controllers are swapped! Never realised that that was a feature of the Vs system. Quite why they swapped the registers I don't know, but I think it's a simple fix. I also seemed to have a problem inputting my name in the high score table. Oh, and there's no pause function, obviously. :)
« Last Edit: October 21, 2017, 04:15:43 pm by Psyklax »

Ar8temis008

  • Jr. Member
  • **
  • Posts: 45
    • View Profile
Re: Nintendo Vs - NES Hardware Hacks
« Reply #1 on: October 21, 2017, 04:40:45 pm »
This is really interesting. What games are you planning on doing if this goes as planned? Most vs nes games are just arcade ports, from what I remember.

Psyklax

  • Sr. Member
  • ****
  • Posts: 412
    • View Profile
    • Psyklax Translations
Re: Nintendo Vs - NES Hardware Hacks
« Reply #2 on: October 21, 2017, 06:05:36 pm »
This is really interesting. What games are you planning on doing if this goes as planned? Most vs nes games are just arcade ports, from what I remember.

They're not arcade ports: the Vs games are NES games put into arcade machines. And I'm planning on doing all of them (there aren't that many).

Basically a stock NES can support 32KB of program ROM and 8KB of character ROM, but the Vs System boards take six chips which means you can have two 8KB character ROMs instead of one, and a 16KB program ROM plus three more 8KB program ROMs. Of course, that is just the stock system: developers put more inside and used mappers, just like the NES. But it means that early NES games released on the Vs System often have extra graphics because of the extra space.

The CPU is identical and the PPU is ALMOST identical, except for two differences: it adds a few colours to the original NES's palette (whether any games actually use them, I'll find out as I do this project) and the colour identification is jumbled up on different games due to copy protection.

I became interested because someone in another thread asked about enabling free play on a game and I didn't realise that Vs games were actually a bit different to their NES counterparts in some cases (I think I assumed it was like the Play Choice 10 which was literally a box of NES cartridges).

Anyway, a quick update: I've swapped the joysticks over so P1 and P2 control the correct things, and the high score table is fine. I'm not adding a pause function though, wayyy too much effort. :D Click on the .ips file in the first post for an updated patch and someone PLEASE try it on a real NES and let me know how it goes. The sooner I get a positive response on it, the sooner I can get to work on all the other games (after all, playing on real hardware is kind of the main point of this project).

Asaki

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 141
    • View Profile
Re: Nintendo Vs - NES Hardware Hacks
« Reply #3 on: October 21, 2017, 06:58:41 pm »
(I think I assumed it was like the Play Choice 10 which was literally a box of NES cartridges).

Actually, some of those are modified, also. Off the top of my head, I know the PC10 version of Punch-Out!! will save your high scores.

I can check this out later tonight.

Would be nice to not have free-play enabled, if you can figure out what happened. Like you said, some of the games (like Golf) have a pretty nice title screen that gets skipped in free-play mode.

Psyklax

  • Sr. Member
  • ****
  • Posts: 412
    • View Profile
    • Psyklax Translations
Re: Nintendo Vs - NES Hardware Hacks
« Reply #4 on: October 21, 2017, 08:00:21 pm »
Would be nice to not have free-play enabled, if you can figure out what happened. Like you said, some of the games (like Golf) have a pretty nice title screen that gets skipped in free-play mode.

In the case of Dr Mario, you don't miss anything with it being free play, as the title screen is still there. You usually do miss something, though, so instead I want to change it so that you insert coins with Select and start with Start, but after a few minutes trying with Super Mario Bros, I can't figure out how. The game polls $4016 for controller input, but then looks for a different bit of that register to see if the service button has been activated (by inserting a coin). If someone could point me in the right direction on this, it will be great for all the games in the future.

Speaking of SMB, I've just been working on it. :) I've used my free play hack for now, simply because I can't figure out how to use coins, as stated above. Still, I eventually found all the colours - they're hiding throughout the ROM. :D Check it out:


http://s346165667.websitehome.co.uk/psyktrans/smb.ips

EDIT: a little technical detail that may be of interest to some. The two games I've done already often use colour $2F for black, while their NES counterparts use $0F. The reason? $0F on the Vs PPU is a brand new colour that doesn't exist on the NES PPU, so they use the black at $2F instead. Now, I figured that black is black, so I don't think it matters if they're $2F instead of $0F, but if anyone reports anything weird going on, I can easily replace all the $2F bytes with $0F, for compatibility. The NES can be weird like that.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6177
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Nintendo Vs - NES Hardware Hacks
« Reply #5 on: October 21, 2017, 10:08:59 pm »
They're not arcade ports: the Vs games are NES games put into arcade machines. And I'm planning on doing all of them (there aren't that many).

I only know for sure Super Mario Bros. and Castlevania but I'm sure other games as well had subtle changes made to make them harder so that even if you were pretty good at the NES, you probably wouldn't just drop a quarter and win on the VS.

And then there's VS. Gradius. They took the console port of an arcade game, and ported it BACK to the arcade. I wonder WHY? :D
Quote
Sir Howard Stringer, chief executive of Sony, on Christmas sales of the PS3:
"It's a little fortuitous that the Wii is running out of hardware."

Psyklax

  • Sr. Member
  • ****
  • Posts: 412
    • View Profile
    • Psyklax Translations
Re: Nintendo Vs - NES Hardware Hacks
« Reply #6 on: October 22, 2017, 03:26:43 am »
I'm sure other games as well had subtle changes made to make them harder so that even if you were pretty good at the NES, you probably wouldn't just drop a quarter and win on the VS.

Indeed, it certainly seems like they're being mean with SMB, adding in more enemies and taking away bonuses. This is why I find it intriguing to get them working properly.

And yes, releasing Gradius to the arcade when there was a presumably superior version already there does seem odd.

Asaki

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 141
    • View Profile
Re: Nintendo Vs - NES Hardware Hacks
« Reply #7 on: October 22, 2017, 04:40:47 am »
Tested Dr. Mario, seems to be fine. Yes, free-play is enabled on a real NES, too.

It appears that the game has a routine that changes the background colour depending on the level you're on, separate from the palette blocks. When I corrected the rest of the palette, it looked identical to the original game, but if you play the unmodified Vs ROM in FCEUX, the background is grey.

I'm not super great at the game, so I only played it long enough to beat a stage or two, and the background didn't change color. I'm not exactly sure if that's what you meant or not.

Psyklax

  • Sr. Member
  • ****
  • Posts: 412
    • View Profile
    • Psyklax Translations
Re: Nintendo Vs - NES Hardware Hacks
« Reply #8 on: October 22, 2017, 06:33:25 am »
Tested Dr. Mario, seems to be fine. Yes, free-play is enabled on a real NES, too.

I'm not super great at the game, so I only played it long enough to beat a stage or two, and the background didn't change color. I'm not exactly sure if that's what you meant or not.

Thanks for testing! :)

I'm not certain that the background changes colour, but I know the background is affected by something totally separate from the other palette info in the ROM. My point was that the palette in the Vs ROM has been changed to match the PPU used in the arcade version, but this background colour is the same in both - that is, the value hasn't changed, which means the colour is different (grey instead of purple). The only way of knowing if that grey colour is intentional or an accident is by playing the real Vs machine. But any footage on YouTube is clearly being emulated through FCEUX (presumably) and thus isn't reliable.

It's a small but curious point. :) You can see I've posted SMB too, since it's probably more interesting for people. Sadly I needed to use free play so you can't see the title screen.

pcfreak324

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: Nintendo Vs - NES Hardware Hacks
« Reply #9 on: October 22, 2017, 10:38:52 am »
There are already a few patches available to change the colour plattes to run on different PPUs:

https://forums.arcade-museum.com/showthread.php?t=375524

You might use them as a base for your work. Things that still need to be fixed are the controls (swap controllers and map select to insert coin).

Psyklax

  • Sr. Member
  • ****
  • Posts: 412
    • View Profile
    • Psyklax Translations
Re: Nintendo Vs - NES Hardware Hacks
« Reply #10 on: October 23, 2017, 05:53:37 pm »
There are already a few patches available to change the colour plattes to run on different PPUs:

Yes, I know, but I like to do things myself, so I'm not sure I'll refer to other patches. I've got a way of changing the palettes myself and it seems to be working so far. Speaking of which...


http://s346165667.websitehome.co.uk/psyktrans/iceclimber.ips

I've done Ice Climber. I picked this one next because someone in another thread got me into this whole mess in the first place with Ice Climber. :D Free play is activated (it's easier than enabling coins - if you want to see the attract mode, just load the thing up without my patch :D ), colours are fixed (unless I missed something - there were some hard to find colours in there), and input is corrected.

The problem with the colours is that I have to go through the ROM finding every value that refers to a colour, and sometimes they're not obvious. In the three Nintendo games I've done they're generally marked with the destination before them, plus the number of bytes to copy over (usually $3F00 and $20, so as to fill up the palette memory in the PPU). Sometimes, though, they're stashed away in weird places, as was the case with Ice Climber. Hopefully I won't get a situation where I miss some colours somehow.

I've also updated the SMB patch because I missed some colours. ICYMI:
http://s346165667.websitehome.co.uk/psyktrans/smb.ips

Asaki

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 141
    • View Profile
Re: Nintendo Vs - NES Hardware Hacks
« Reply #11 on: October 23, 2017, 06:12:59 pm »
Could you do the two Golf games next? There shouldn't be too many colors, and no one has done them yet.

BTW, you might need some help on the light gun games. The guy who did Duck Hunt said he had to hack a lot of stuff to get it to use the NES Zapper.

Psyklax

  • Sr. Member
  • ****
  • Posts: 412
    • View Profile
    • Psyklax Translations
Re: Nintendo Vs - NES Hardware Hacks
« Reply #12 on: October 23, 2017, 06:55:56 pm »
Could you do the two Golf games next? There shouldn't be too many colors, and no one has done them yet.

BTW, you might need some help on the light gun games. The guy who did Duck Hunt said he had to hack a lot of stuff to get it to use the NES Zapper.

Well, if you insist... ;) Golf is interesting because there's a Ladies version that I believe didn't come out anywhere else. Of course it's just a sprite change and nothing more, but still...

And I imagine I'll be dealing with the light gun games last: I'm sure that even though they work fine through FCEUX, a real NES is a different matter.

EDIT: well, I've just been working on Golf and discovered something weird: the Men's version appears to have the NES palette instead of the Vs one, while the Ladies' version uses the Vs palette. Very odd, but it saves me a bit of trouble. :D I've just switched around the controls on both so they're probably done already, but I won't be uploading anything until I've fixed the palettes of the Ladies' version, which will be very soon.
« Last Edit: October 23, 2017, 07:56:55 pm by Psyklax »

pcfreak324

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: Nintendo Vs - NES Hardware Hacks
« Reply #13 on: October 23, 2017, 11:34:39 pm »
There are two Vs. Golf Men versions. The Japan version (included in GoodNES) uses the RC2C03B PPU/palette and the other one (non-Japanese, included in the MAME romset) uses the same PPU/palette as the Ladie's version (RP2C04-0002).

Did you also see my post the other thread of yours? For some games it might be possible to fix the palette via a few Game Genie codes that alter the DIP switch settings.

Psyklax

  • Sr. Member
  • ****
  • Posts: 412
    • View Profile
    • Psyklax Translations
Re: Nintendo Vs - NES Hardware Hacks
« Reply #14 on: October 24, 2017, 02:44:59 am »
There are two Vs. Golf Men versions. The Japan version (included in GoodNES) uses the RC2C03B PPU/palette and the other one (non-Japanese, included in the MAME romset) uses the same PPU/palette as the Ladie's version (RP2C04-0002).

Well that would certainly explain it. I noticed this one was Japanese. The Ladies one appears to be English though.

Did you also see my post the other thread of yours? For some games it might be possible to fix the palette via a few Game Genie codes that alter the DIP switch settings.

Yes I saw, but I'm pretty certain the ones I've done so far can't be done that way. The only one i know of is Super Xevious.

EDIT: Golf's ready! :)


http://s346165667.websitehome.co.uk/psyktrans/golf.ips
http://s346165667.websitehome.co.uk/psyktrans/golfl.ips

I've tested both the men's and women's versions and everything seems to be working, although the men's was easier since I don't need to mess with the palette as already mentioned. You start the game with Start but a weird thing seems to happen on the men's version: in a two player game, both players press player 2's Start button to continue, whereas the women's one has you press whichever button is logical. Don't know why. Also the Japanese on the men's version is just sprites that are removed on the women's version, so I ignored them.

Remember, nothing I've posted in this thread is final, I can change anything. I might change all the black colours from $2F to $0F since the latter is considered the "canonical black" for NES games, while on the Vs System it was used for a different colour so they switched to $2F for black (or whatever is the equivalent on that PPU). I may figure out how to change the coin mechanism to the Select button, but frankly I think free play is easier to use on a NES, even though you stupidly lose the title screen when you do (bad design).

Keep your feedback coming, guys, especially checking them on the real hardware - and with two players! I take care in making sure the inputs are correct! :)
« Last Edit: October 24, 2017, 02:14:20 pm by Psyklax »

pcfreak324

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: Nintendo Vs - NES Hardware Hacks
« Reply #15 on: October 24, 2017, 12:46:34 pm »
Yes I saw, but I'm pretty certain the ones I've done so far can't be done that way. The only one i know of is Super Xevious.
If you want to convert Vs. Super Xevious you also need to bypass the built-in security. Please refer to this post for instructions on how this can be achieved: https://forums.arcade-museum.com/showpost.php?p=2618079&postcount=16

October 25, 2017, 02:19:08 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Vs. Ladies Golf is working on my Analogue Nt mini. The colours seem to be correct. But there are problems with the button mapping in two player mode. Player two ocassionally swings its golf club by itself without any buttons pressed.
« Last Edit: October 25, 2017, 02:19:46 pm by pcfreak324 »

pcfreak324

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: Nintendo Vs - NES Hardware Hacks
« Reply #16 on: November 07, 2017, 12:25:17 pm »
I found a way to change the palette in Vs. Tetris by turning on the corresponding DIP switches.

Open the headered rom Tetris (VS).nes from GoodNES in a hex editor. Both at offset 3C55 and 3C5C the values 29 have to be changed to A9.

EDIT:
For Vs. Super Sky Kid, go to offset 7BBF and change the value 29 to A9.
For Vs. RBI Baseball, go to offset F1E9 and change the value 29 to A9.
« Last Edit: November 07, 2017, 03:16:07 pm by pcfreak324 »

Psyklax

  • Sr. Member
  • ****
  • Posts: 412
    • View Profile
    • Psyklax Translations
Re: Nintendo Vs - NES Hardware Hacks
« Reply #17 on: November 07, 2017, 05:11:43 pm »
For Vs. Super Sky Kid, go to offset 7BBF and change the value 29 to A9.
For Vs. RBI Baseball, go to offset F1E9 and change the value 29 to A9.

Uh, didn't I already go through this in my Game Genie thread (which led to this thread)?
http://www.romhacking.net/forum/index.php?topic=25137.0

EDIT: I misunderstood what you were saying there: I though you were doing free play codes for some reason. Yes, the Super Sky Kid change works a treat (I didn't test RBI Baseball but I'll have a look sometime). That makes things a lot easier - some of these games have been a bitch to change because the colours are all over the place in the ROM.

By the way, sorry if anybody was looking forward to more hacks of Vs games (both of you :D ) but real life has got me distracted.

By which I mean I just got a Wii. :D Yes, I know I'm ten years too late: I'm a retro gamer.
« Last Edit: November 07, 2017, 05:21:02 pm by Psyklax »

pcfreak324

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: Nintendo Vs - NES Hardware Hacks
« Reply #18 on: November 08, 2017, 08:29:28 am »
Finally got Vs. Raid on Bungeling Bay working.

Extract the rom from the MAME romset and run this command in the command line:

copy /b "mds-rb4-2 b.6d" + "mds-rb4-2 b.6c" + "mds-rb4-2 b.6b" + "mds-rb4-2 b.6a" + "mds-rb4-2 b.8b" + "mds-rb4-2 b.8a" bnglngby.nes

Then open the rom bnglngby.nes in a hex editor and add the iNES header at the top:
4E 45 53 1A 02 02 39 60 00 00 00 00 00 00 00 00

Next, go to offset 16EF and overwrite 4C DE 96 with EA EA EA (this part contains a copy protection that needs to be bypassed).

EDIT: Enable Free Play in Vs. Raid on Bungeling Bay

Go to offset 1DA and change 29 to A9.
Go to offset 13F8 and change 29 to A9.
Go to offset 1403 and change 29 FC to A9 04.
« Last Edit: November 08, 2017, 09:12:35 am by pcfreak324 »