kingraph Posted August 19, 2017 Report Share Posted August 19, 2017 (edited) This thread will be my notes and attempt to expand NHL'95 to a 34 team ROM. Before I start, I'd like to thank @wboy, @slapshot67, and @smozoma up front, as just about all of my hacking knowledge has come from them. I will try to give credit where appropriate, but 95% of this will be one of those guys. So my initial thoughts are as follows: Expand the '95 ROM from 2MB to 4MB to create room for more teams, graphics: Not needed, enough empty space to use in 2MB. Also going over 2MB creates RAM issues. Find the team data and move it to a new spot in the expanded ROM. Create data for 34 teams: DONE! Change the team pointers to the new data: DONE! "Decompress" graphics (logos, banners, player cards, etc.) - DONE! Change pointers to the new graphics - DONE! Make '95 recognize the new teams/graphics, able to select in menu - DONE! Figure out how the season data works, incorporate into 34 teams - WIP Same with trade player and other unknown '95 stuff ADD: Music, figure out how to make sure the music works for new teams - DONE! So here goes. I expect this to be a pretty long project, with many bumps along the way, but ultimately fun. Edited October 10, 2017 by kingraph Updated 10/10 w/ current status 2 6 Quote Link to comment Share on other sites More sharing options...
kingraph Posted August 19, 2017 Author Report Share Posted August 19, 2017 TEAM DATA Now, I have the great fortune of wboy's program - NOSE - to save me lots of time! So using NOSE, it was easy to locate the team data in the game: So the offset for the team data actually starts at 07E2 (All-Stars East). The structure for each team data is as follows: * Header of '0092" - "The first 2 bytes of the team, typically 0092 is the offset + team start offset (e.g. 0092+00005330 for ANH) that takes you to the start of the roster data (also correctly bypassing any free bytes if they exist) - Thanks @wboy * "000C" (not sure what that does) * 2 bytes that are the length of team data * "0052 004C 0050". Again, I'm not sure what those last 6 bytes are, but they are the same for each team, so I don't think it's important at the moment. * Home/Away palettes (32 bytes), followed by 32 for the 3rd and 4th palette (not used as far as I know). * Off/Def/PP/PK/Home Adv/Def Adv (3 bytes) * 1 byte that determines the number of forwards and defensemen * Goalie bytes (2) * Lines info (64 bytes) * Player information. First two bytes are name length, followed by the name, then 8 bytes for ratings * Length of City - City Name - Length of Team Abr - Team Abr - Length of Team Name - Team Name - Length of Stadium Name - Stadium Name. END! After the Stadium Name, the next team offset starts with "0092..." Now, the wonderful thing about NOSE is when you change the player data, the program automatically shifts everything around correctly and adjusts the values so you don't have to do all of this in Hex! Thanks wboy! Team Pointer / Order of Teams Data Since I now have the offsets for all the team data, all I had to do was search for "00000D66" in Hex to find the team data pointers. Lo and behold: The pointer table became pretty clear right after I found the first one. You can see it's a set of 28 pointers that matches up with each team offset from the NOSE image. In fact, the first set of team data (ASE) is located right after the last pointer at offset @07E2. Now, the next step will be to remap that data to a new spot in the ROM, change the pointers, clear out the old team data and see if the ROM still works. SPOILER, I have already done this successfully (yay!), but will post more later. 2 Quote Link to comment Share on other sites More sharing options...
CoachMac Posted August 19, 2017 Report Share Posted August 19, 2017 Strong Work! Quote Link to comment Share on other sites More sharing options...
Blake Posted August 19, 2017 Report Share Posted August 19, 2017 I can't wait to see this ROM! Quote Link to comment Share on other sites More sharing options...
smozoma Posted August 19, 2017 Report Share Posted August 19, 2017 Awesome. If I may suggest: don't stop at 34 teams unless there is a technical reason to do so. Make as many as possible. One thing found out recently: the music was actually broken in the 30-team NHL94 ROM but it just coincidentally kept working anyway. It broke down in the 32-team ROM and had to be fixed. So you may run into that issue. I think player cards can indeed be colour, but it's probably set up to all share 1 palette, so you'd have problems with shirt/sweater colours. The palette may be only 8 colours, as well. I'm not familiar with adding/expanding palettes, so I can't be of help in solving that limitation. If you get stuck on anything in particular I can try looking into it, but I may be slow. Wish I could help more. 1 1 Quote Link to comment Share on other sites More sharing options...
kingraph Posted August 19, 2017 Author Report Share Posted August 19, 2017 Thanks for the notes smoz, and I didn't even think about music pointers. I'll add it on the list of "to do". I picked 34 as a starting point, but if we can add more I'd do it. I just have no idea what I'm gonna run into. 1 Quote Link to comment Share on other sites More sharing options...
kingraph Posted August 20, 2017 Author Report Share Posted August 20, 2017 EXPANDING ROM ISSUE When I expand the ROM from 2MB to 4MB ( or ANY size), there is a problem that occurs on the startup screen player cards/text that causes the game to freeze if you don't cycle through teams and/or start playing. This is without adding ANY additional code or changes. Just expanding the ROM. After digging around, this person on ROMHacking.net was experiencing the same problem: http://www.romhacking.net/forum/index.php?topic=15151.0 And the author found out that: Quote Seems that some games maps the save state Ram at 0x200000-0x203FFF (16KB). His solution was to not write any code in the 200000 - 203FFF section, leave it 0 and his game worked. However, I tried all of these things and am still having the same issue. The GOOD news is that it doesn't seem to be a fatal problem as long as you pick teams and play. The player cards work in the matchups screens and as far as I can tell the rest of the game works as normal. My ASSUMPTION is that '95 does load some data related to player cards/names into a section of the ROM "at the end", and then has specific instructions to look at those offsets to display the player names/cards. By changing the size of the ROM, the data shifts and screws up all the offsets. So, I will see if I can find anything that references offsets 200000 or greater. Not critical, but worth noting. 1 Quote Link to comment Share on other sites More sharing options...
smozoma Posted August 20, 2017 Report Share Posted August 20, 2017 I think this is an issue that can be found and fixed using the debugger and tracing, quite easily. It allows you to specify address ranges to record accesses to. So you use the expanded area and then see what instructions write or read there. Tony H's tutorial explains how to do this. Let me know if it gives you any trouble. Once the instructions are found, you could either try remapping to 0x400000, or just "NOP" the instructions by overwrting it with a bunch of bytes with values 4E71 (NOP instruction means "no operation", it does nothing) 1 1 Quote Link to comment Share on other sites More sharing options...
kingraph Posted August 20, 2017 Author Report Share Posted August 20, 2017 1 hour ago, smozoma said: I think this is an issue that can be found and fixed using the debugger and tracing, quite easily. It allows you to specify address ranges to record accesses to. So you use the expanded area and then see what instructions write or read there. Tony H's tutorial explains how to do this. Let me know if it gives you any trouble. Once the instructions are found, you could either try remapping to 0x400000, or just "NOP" the instructions by overwrting it with a bunch of bytes with values 4E71 (NOP instruction means "no operation", it does nothing) Ahhh, I was trying the trace on the player cards and names, didn't think to look at the trace in the expanded area to see if anything is written there. Thanks for the tip, I will try. 1 Quote Link to comment Share on other sites More sharing options...
kingraph Posted August 21, 2017 Author Report Share Posted August 21, 2017 OK, so my first test was to see what would happen if I moved the team data to an expanded part of the ROM, changed the pointers, and deleted the old team data. Since I already had these locations, this was a fairly simple task. I moved all the team data to offset @240000, and expanded the roster space for each team to have 26 players: The game loaded and as far as I can tell everything is working fine (except for the player card/name issue I noted before...need to start the game or keep switching teams or else game will crash). I'm happy about this, so now you can edit the player names/rosters without space limitation issue. I understand how I can add additional team data, so adding the data for 6 more teams is rather simple. I also won't have an issue expanding the pointer table since the old team data that followed it is new gone, leaving room to add 6 more pointers. My goal now is to find the code, or area of the ROM, that tells the game that there are 28 teams you can select (26 in playoffs) and change that value to 34 (or whatever). @wboy did a "HOW TO: Limit selectable teams" for '94 and '93 which gives great information on how to do this for '94, but unfortunately it seems it's different in '95. There is no "001C 001C" hex value located in the ROM, soooooooooo the hunt begins! Oh, here is the ROM in case anyone wants to test and see if any other bugs are noticed EDIT: I messed up home jersey colors...will post later Okay, test: NHL95_02c_MoveTeamData.bin 1 Quote Link to comment Share on other sites More sharing options...
smozoma Posted August 21, 2017 Report Share Posted August 21, 2017 4 hours ago, kingraph said: @wboy did a "HOW TO: Limit selectable teams" for '94 and '93 which gives great information on how to do this for '94, but unfortunately it seems it's different in '95. There is no "001C 001C" hex value located in the ROM, soooooooooo the hunt begins! Oh, here is the ROM in case anyone wants to test and see if any other bugs are noticed EDIT: I messed up home jersey colors...will post later Okay, test: NHL95_02c_MoveTeamData.bin Here is how I would figure this out: (since you will be doing stuff in the game menu, which is currently crashing for you, you can either use an un-expanded ROM, or just pause/unpause the game as necessary to avoid it crashing) Load the game. Go to the menu. If necessary, pause the emulator with ESC. Use the RAM Search feature in the emulator. Set it for "1 byte," "unsigned." Click the "Reset" button in the RAM search. Unpause the game (if necessary), and change the home team right/up one team, then pause again. This probably increases a variable in the game. So in the RAM search, set it to "Greater Than" and "Previous Value", and then click the "Search" button. That will clear a lot of the values in the list, the ones that didn't increase. In the game again, change to the team right/up by 1 again. Click search again. Do this process several times, and there will probably only be one or several values left in the list. Then, (without using the "Search" button), try changing the team both left and right, and loop around the end of the team list... one of the values should stick out as the 'correct' value, or maybe there will be a couple values that are always the same. Then you use that address (hopefully there is just one) for the "Hook RAM" trace. Also do a "Trace" at the same time. The RAM trace will tell you which line of code was modifying that address in the RAM. And then you look it up in the code trace, and each time it tries to increment the value, it will do a comparison against some value (probably 001C) to see if it needs to loop back to the 0th team. Then you find that line of code in the ROM and change the value. Try changing it to a lower value to verify that it works, that the game now ignores a team. After that's done, then you also need to try all that for the Away team, and then you also need to do it in playoffs mode and perhaps season mode, as it might (or might not) use a different value/address for the comparison. Note: the address listed in the code trace may be 2 lower than in the RAM trace. For example, it might be 01:A248 in the RAM trace, but 01:A246 in the code trace. 1 1 Quote Link to comment Share on other sites More sharing options...
segathon Posted August 21, 2017 Report Share Posted August 21, 2017 My excitedment at the progress of an updated NHL 95 rom 1 1 Quote Link to comment Share on other sites More sharing options...
smozoma Posted August 21, 2017 Report Share Posted August 21, 2017 Forgot to mention... If the game uses *all* of the SRAM (aka saved ram, battery memory) for the season data, that could be problematic... Although since it's an emulator, maybe you can just tell it there is more sram that it can use :). 1 Quote Link to comment Share on other sites More sharing options...
segathon Posted August 21, 2017 Report Share Posted August 21, 2017 two things 1. I'm a novice at this stuff, but @joetberry did some hacks a while ago on 95. Might be the same as NHL 94 stuff. But probably worth a scan if he has found something you haven't located yet http://joetberry9.tripod.com/howto.html 2. Another thing you may find when diving into NHL 95 and it could be from the SRAM that @smozoma mentioned is that NHL 95 desyncs quite often in online play. 1 Quote Link to comment Share on other sites More sharing options...
mack Posted August 21, 2017 Report Share Posted August 21, 2017 I am rooting for you so much man, good luck. 2 Quote Link to comment Share on other sites More sharing options...
kingraph Posted August 21, 2017 Author Report Share Posted August 21, 2017 5 hours ago, segathon said: two things 1. I'm a novice at this stuff, but @joetberry did some hacks a while ago on 95. Might be the same as NHL 94 stuff. But probably worth a scan if he has found something you haven't located yet http://joetberry9.tripod.com/howto.html 2. Another thing you may find when diving into NHL 95 and it could be from the SRAM that @smozoma mentioned is that NHL 95 desyncs quite often in online play. Thanks! Looks like he found the team data that was covered in my first post, thanks for sharing! 5 hours ago, mack said: I am rooting for you so much man, good luck. Thanks, I'll need it! 1 Quote Link to comment Share on other sites More sharing options...
jer_33 Posted August 22, 2017 Report Share Posted August 22, 2017 So is your plan to try and include the additional teams in season mode, or just for regular play? Quote Link to comment Share on other sites More sharing options...
kingraph Posted August 22, 2017 Author Report Share Posted August 22, 2017 1 hour ago, jer_33 said: So is your plan to try and include the additional teams in season mode, or just for regular play? I am first going to try to get this to work for regular play. If I manage to get that working, I'll start to check out Season Mode -- if it's even possible. I am thinking there might be some issue with that, sort of like the "LEAVE OFF!" on user records on wboy's 30 team ROM. But I'm faaaaaaaaar from that point at this time. Team Selection Progress Update Last night I seem to have found the values that limit team selection for Player 1 and Player 2 using the RAM Watch and Trace method (thanks @Tony H and @smozoma!). @085EAB - selectable teams for Player 01 @085EAC - selectable teams for Player 02 Both values are set to 1C (28 in decimal). Changing to a lower value capped the available selected teams. Changing to 1E and the game did try to find 2 more teams (yay!), but were blank. Not sure if I have to add more pointers and team data for that to work? Adding as a "to do" test. The playoff teams were also limited when I changed these values, however no such luck when I increased the value -- they remained capped at 26 teams. So there must be some other cap on the playoffs somewhere that I have to find (either 1A or 19), but I didn't have much luck last night finding anything on playoffs. 1 Quote Link to comment Share on other sites More sharing options...
chaos Posted August 23, 2017 Report Share Posted August 23, 2017 5 hours ago, kingraph said: I am first going to try to get this to work for regular play. If I manage to get that working, I'll start to check out Season Mode -- if it's even possible. I am thinking there might be some issue with that, sort of like the "LEAVE OFF!" on user records on wboy's 30 team ROM. But I'm faaaaaaaaar from that point at this time. Team Selection Progress Update Last night I seem to have found the values that limit team selection for Player 1 and Player 2 using the RAM Watch and Trace method (thanks @Tony H and @smozoma!). @085EAB - selectable teams for Player 01 @085EAC - selectable teams for Player 02 Both values are set to 1C (28 in decimal). Changing to a lower value capped the available selected teams. Changing to 1E and the game did try to find 2 more teams (yay!), but were blank. Not sure if I have to add more pointers and team data for that to work? Adding as a "to do" test. The playoff teams were also limited when I changed these values, however no such luck when I increased the value -- they remained capped at 26 teams. So there must be some other cap on the playoffs somewhere that I have to find (either 1A or 19), but I didn't have much luck last night finding anything on playoffs. Did you add any data for the teams? Did you add the "new" teams to the pointer table or did you just increase the number of selectable teams? If I remember right, I think you also would have to change the value for the pointer table length. When you add a new team to the pointer table, you have to change the value of pointer table length too. It's probably the first or second byte before the pointer table begins (there may be a 00 spacer , and you have to account for that in the length value as well). 1 1 Quote Link to comment Share on other sites More sharing options...
kingraph Posted August 23, 2017 Author Report Share Posted August 23, 2017 34 minutes ago, chaos said: Did you add any data for the teams? Did you add the "new" teams to the pointer table or did you just increase the number of selectable teams? If I remember right, I think you also would have to change the value for the pointer table length. When you add a new team to the pointer table, you have to change the value of pointer table length too. It's probably the first or second byte before the pointer table begins (there may be a 00 spacer , and you have to account for that in the length value as well). Good tip on the pointer table length...I figured there would be something like this, but didn't see any documentation. I'll check into that. I think for now I just increased the selectable number of teams, but I will add teams and see if I can change the length for the ROM to pick up teams 29, 30, etc. Side note - I am pretty sure I found the correct playoff hex values to change, but that's still not working for me either...can't pick ASE/ASW teams (but they do show up as Player 2 option). And I did update the playoff tree to include them here and there. 1 Quote Link to comment Share on other sites More sharing options...
smozoma Posted August 23, 2017 Report Share Posted August 23, 2017 33 minutes ago, kingraph said: Good tip on the pointer table length...I figured there would be something like this, but didn't see any documentation. I'll check into that. I think for now I just increased the selectable number of teams, but I will add teams and see if I can change the length for the ROM to pick up teams 29, 30, etc. Side note - I am pretty sure I found the correct playoff hex values to change, but that's still not working for me either...can't pick ASE/ASW teams (but they do show up as Player 2 option). And I did update the playoff tree to include them here and there. I assume you also moved the pointer table into the expanded section of the rom? For the playoff matchups, I wonder if maybe you didn't set the teams as both home and away teams in some matchups? 1 Quote Link to comment Share on other sites More sharing options...
kingraph Posted August 23, 2017 Author Report Share Posted August 23, 2017 1 hour ago, smozoma said: I assume you also moved the pointer table into the expanded section of the rom? For the playoff matchups, I wonder if maybe you didn't set the teams as both home and away teams in some matchups? I left the pointer table in the same location. I noticed that wboy left the pointer in the same location in '94 because immediately after the pointer table was the old team data, which was moved/erased, leaving plenty of room to expand the pointer table. FYI, he then put the player card pointers, team selection logo pointers, and finally the ice logo pointers. Then more free space from the deleted player data. I'm going to goof around some more with the playoff matchups...I thought I had included ASE/ASW in the 1/8 spot east and west, but I didn't spend too much time on that. 1 Quote Link to comment Share on other sites More sharing options...
slapshot67 Posted August 23, 2017 Report Share Posted August 23, 2017 i was messing around with this rom and you might not have to expand to 4mb, I added 2 extra teams, there are no player cards or logos yet, but team 29 and 30 do play. add this to roms.ini if you want to view in nose [GM T-50856 -30] Comments=NHL 95 - 30 Team ROM OriginalROMProductCode=GM T-50856 -00 Teams=30 also the title screen and zoom in nhl 95 pics are now editable. is there only 6 cards per team? or can you view the whole team like 94? NHL 95 - 30 Team ROM.bin 2 Quote Link to comment Share on other sites More sharing options...
kingraph Posted August 23, 2017 Author Report Share Posted August 23, 2017 44 minutes ago, slapshot67 said: i was messing around with this rom and you might not have to expand to 4mb, I added 2 extra teams, there are no player cards or logos yet, but team 29 and 30 do play. add this to roms.ini if you want to view in nose [GM T-50856 -30] Comments=NHL 95 - 30 Team ROM OriginalROMProductCode=GM T-50856 -00 Teams=30 also the title screen and zoom in nhl 95 pics are now editable. is there only 6 cards per team? or can you view the whole team like 94? NHL 95 - 30 Team ROM.bin Wow, I will check this out, thanks! There are only 6 player cards per team in '95, limited to the starting lineup. 1 Quote Link to comment Share on other sites More sharing options...
kingraph Posted August 23, 2017 Author Report Share Posted August 23, 2017 Also, if you have a moment, can you share the process that you went through to get the two extra teams to pick up in the game? And if I wanted to expand this to 34 would that also be possible? I noticed the selectable teams for playoffs is still 26, which is what I was currently searching for. I'm happy to do the legwork, as well as making all of the graphics editable. Any help/guidance you can provide would likely save me many many hours. 1 Quote Link to comment Share on other sites More sharing options...
slapshot67 Posted August 23, 2017 Report Share Posted August 23, 2017 I just added the 2 extra teams to the pointer table and added the teams data. I'm pretty sure it can handle more teams. I have added menu logos, ice logos, team banners, and scoreboard banners. still trying to figure out the menu select banners. I will see if I can do those player cards. NHL 95 - 30 Team ROM4.bin 3 Quote Link to comment Share on other sites More sharing options...
Engelby77 Posted August 23, 2017 Report Share Posted August 23, 2017 Are you going to add Vegas ? Quote Link to comment Share on other sites More sharing options...
CoachMac Posted August 23, 2017 Report Share Posted August 23, 2017 (edited) 2 hours ago, Engelby77 said: Are you going to add Vegas ? You/we can add anybody you want with an expanded rom. So yeah, I would guess someone will probably add Vegas on a 32 or 32+ team rom. Slapshot/Skip and Naples will for sure. PS Slapshot plus KingRaph awesome work on 95! Edited August 23, 2017 by CoachMac 2 Quote Link to comment Share on other sites More sharing options...
segathon Posted August 23, 2017 Report Share Posted August 23, 2017 Awesome work guys! 1 Quote Link to comment Share on other sites More sharing options...
kingraph Posted August 23, 2017 Author Report Share Posted August 23, 2017 6 hours ago, slapshot67 said: I just added the 2 extra teams to the pointer table and added the teams data. I'm pretty sure it can handle more teams. I have added menu logos, ice logos, team banners, and scoreboard banners. still trying to figure out the menu select banners. I will see if I can do those player cards. NHL 95 - 30 Team ROM4.bin That's awesome! I didn't find any pointer table length, so I guess as soon as you add teams and change the selectable teams value, it will look for the next pointer? On the version I was working on, the game got messed up when I got to team 29 and 30, so it wasn't as straightforward as adding team data and pointers for me. Unless I messed something up, I'll have to take another look. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.