+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Newbie seeking help with hacking Nintendo World Cup (NES game)
Pages: [1]
Author Topic: Newbie seeking help with hacking Nintendo World Cup (NES game)  (Read 519 times)
Dacicus
Guest
« on: July 23, 2007, 05:08:28 pm »

Hello, everyone.

I'm interested in making a hack of Nintendo World Cup that allows players to select any of the 13 teams in versus mode, rather than only the 5 teams usually available. The team IDs range from 0x00 to 0x0C in order from top to bottom and left to right as displayed on the team select screen for the tournament mode (e.g. USA = 0x00, Holland = 0x01, Italy = 0x0C). I have been able to find the location in the ROM file that stores the team IDs for the 5 teams that can be chosen normally (0xD77A), and it is possible to change the values to enable other teams. However, this still limits the number of available teams to 5, and it also introduces graphical glitches (incorrect graphics being loaded for player heads, ball invisible), as depicted below.

Example of normal graphics
Example of graphical glitches when replacing USA with Argentina

I'm not very experienced with ROM hacking, so I'd like to get some help with this, be it someone looking at the ROM or just pointing me to a document that would be enlightening. Also, I have some more information about both ROM and RAM addresses, so feel free to ask about anything you think might be helpful.

Thank you in advance.

Update: I've been running two instances of FCEUXD SP simultaneously, selecting versus mode on one and tournament mode on the other in order to (hopefully) figure out what the differences are. I've been putting a conditional breakpoint on the reading of address $0000; this seems to store what button is being pressed at any given time, and pressing Start ($0000==#10) is the only way to select a mode. However, I would like to know if there are any better breakpoints that would stop execution when Start is pressed.

In order to figure out what differences there may be while selecting between the two modes, I dumped the RAM using the Hex Editor after the breakpoint occurred. I made two dumps of the RAM after selecting tournament mode in order to eliminate any addresses that wouldn't be relevant to deciding between the two modes (e.g. addresses that might contain what music is being played or will be played at any specific time). I'd also like any input about this technique for eliminating addresses, especially if there are better ways to go about it.

Thanks again.

Update 2: After spending a lot of time stepping through assembly code, I was only able to successfully determine the branch point that causes the password prompt to load or not. Getting tired of that, I decided to take a close look at the ROM with Tile Layer Pro. I probably should have done that when I first noticed the graphical glitches posted above. In any case, it appears that the upper head graphics (that aren't displayed correctly in the second picture above) are all stored at the offset that Tile Layer Pro calls 0x2E010. However, if you scroll down to 0x38C10, there are a series of twelve sets of upper head graphics. I'm pretty sure that these are the graphics for your team and the twelve opposing teams in the tournament mode. Then, starting at 0x3BC10, there are another six sets of graphics.

In summary, I believe that the graphics loaded on the right side of the PPU Viewer in FCEUXD SP for the player heads (the four lowest rows) are hardcoded into the ROM. When you select tournament mode or when one side in versus mode is the USA, the proper graphics from the first twelve sets is loaded. When the USA is not one of the teams in versus mode, the appropriate graphics from the six later sets are loaded (there are six ways to pair up the four non-USA teams available in versus mode). However, if you change the values at 0xD77A, the graphics loaded for the player heads are the letters visible at 0x20010 in Tile Layer Pro, leading to the results in the second picture linked above.

I guess this makes the game much harder to change, but I'd still like some feedback as to ways to possibly achieve what I want.
« Last Edit: July 27, 2007, 06:13:18 pm by Dacicus »
southark2
Guest
« Reply #1 on: July 29, 2007, 05:38:02 am »

Tho I like the game I am not much help, and it's hard to beat the game unless you have two players on the same team, and thats hard to accomplish in a emulator, a long time ago a friend of mine owned it, and we use to play it a lot, and beat the game many times and we never lost a singe game. 

I would try looking at the graphics in another graphics editor such as yychr, tile layer pro unless you have the patched version can some times not show all of the character data for certain roms.
Dacicus
Guest
« Reply #2 on: July 30, 2007, 03:11:48 pm »

YY-CHR shows the same graphics as Tile Layer Pro. In case my last post (Update 2) wasn't clear, here's a table that explains how the upper head graphics are stored in the ROM (they're uncompressed, as far as I can tell):

AddressGraphics
0x38C10You vs. Argentina in tournament mode; You vs. USA in tournament mode*
0x39010You vs. France in tournament mode; USA vs. France in versus mode
0x39410You vs. Cameroon in tournament mode
0x39810You vs. Japan in tournament mode
0x39C10You vs. England in tournament mode; USA vs. England in versus mode
0x3A010You vs. Mexico in tournament mode
0x3A410You vs. Russia in tournament mode
0x3A810You vs. Spain in tournament mode
0x3AC10You vs. W. Germany in tournament mode; USA vs. W. Germany in versus mode
0x3B010You vs. Holland in tournament mode
0x3B410You vs. Brazil in tournament mode
0x3B810You vs. Italy in tournament mode; USA vs. Italy in versus mode
0x3BC10England vs. France in versus mode
0x3C010England vs. Italy in versus mode
0x3C410England vs. W. Germany in versus mode
0x3C810France vs. Italy in versus mode
0x3CC10France vs. W. Germany in versus mode
0x3D010Italy vs. W. Germany in versus mode

What I'd like to figure out at this point is how the game decides which set of graphics to load into tiles $C0 through $FF of the rightmost pattern table displayed in the PPU Viewer of FCEUXD SP.

Quote from: Me_Dave
it's hard to beat the game unless you have two players on the same team, and thats hard to accomplish in a emulator
Since you brought up multiplayer, would you happen to know how many players FCEUXD SP allows in network play?

*If you choose to play as a team other than USA in tournament mode, you'll eventually have to play against the USA team. The graphics of the Argentina players are used for the USA players in this case.
southark2
Guest
« Reply #3 on: July 30, 2007, 03:36:16 pm »

Fce ultra Is not on my emulator of choice list, because I don't like it, and I have never played the game on line either, tho it would be cool to find someone else who's good at it to play with over the net,  I don't really have that much time to spare, on the nes in order to have more than two players you had to have the four player controller adapter, I think Nintendo also made a 8 player adapter, but I don't know if this game supported more than 4 players, and like I said it's been years since I even played it, sorry  :banghead:
Dacicus
Guest
« Reply #4 on: July 30, 2007, 04:16:12 pm »

There's one thing I forgot to post earlier. Namely, the graphics displayed in the little windows in which you can give commands to your teammates are displayed correctly even if you change the teams in versus mode. For example, if you replace USA by Argentina, the correct graphics are displayed for Argentina in the command windows. These graphics don't appear anywhere in the PPU Viewer, though. Here are their addresses in the ROM:

AddressTeam
0x2E050USA (the USA team has 10 heads instead of 6 for various reasons)
0x2E190Argentina
0x2E250France
0x2E310Cameroon
0x2E3D0Japan
0x2E490England
0x2E550Mexico
0x2E610Russia
0x2E6D0Spain
0x2E790W. Germany
0x2E850Holland
0x2E910Brazil
0x2E9D0Italy

Since these graphics are displayed properly regardless of what mode you're playing in, I think it should be possible to make the other graphics show up correctly.

Update: I just read Disch's document on NES Memory Mapping, and it helped me understand what's going on with the graphics. FCEUXD SP says that Nintendo World Cup uses Mapper 4. From what I've observed in the PPU Viewer, it appears to use the first version of CHR swapping described in Disch's document. What I'm interested in doing apparently amounts to swapping part of the last 1k slot in from one place and another part of it from another place. Is this possible?
« Last Edit: July 30, 2007, 06:11:52 pm by Dacicus »
Disch
Guest
« Reply #5 on: July 30, 2007, 07:00:21 pm »

Quote from: Dacicus on July 30, 2007, 04:16:12 pm
What I'm interested in doing apparently amounts to swapping part of the last 1k slot in from one place and another part of it from another place. Is this possible?

Not with CHR-ROM, no.

1 slot = 1 page.  You can't split a slot up.
Dacicus
Guest
« Reply #6 on: July 31, 2007, 11:28:16 am »

Okay, I see. So, what if I replace some of the other game graphics (like the ones at 0x30010) with more team head combinations? Would it be possible to load those into the last 1k slot by changing some code?

Update: I've been able to find the branches that determine which team select screen is displayed. The one at $E72C determines if the tournament mode one with all 13 teams shows up, and the one at $E6B6 determines if the versus mode one with only 5 teams shows up. In both cases, the negative flag is set if the player has chosen versus mode, but not if the player has chosen tournament mode. Therefore, switching the types of branches in these changes the screen that loads (i.e. change the BMI to BPL and the BPL to BMI).

There's still a problem, though. The tournament mode team select screen allows only one player to choose the team, since all players are on the same team in the tournament. This means that the player 1 team in versus mode can now be any of the 13 teams, but the other team is stuck as the USA. I'd like some help in figuring out a way to enable the second player to choose a team on this screen. The teams selected are stored at RAM addresses $0514 and $0515, btw. Any input about my question about the graphics above would also be appreciated.

Thanks in advance.
« Last Edit: August 02, 2007, 02:07:59 pm by Dacicus »
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC