Jump to content
NHL'94 Forums

Merry Christmas from Mr. X


77

Recommended Posts

got an email from MarkeyJester this morning...

Above is the download link to a disassembly of NHL94, the earliest build I could find from your forum's site. Extract the folder and its contents to anywhere you desire (be it desktop, or a specific directory, it's up to you).
You will have "Source.asm" which is the MAIN SOURCE CODE, it includes the vector table, the initialisation routines, and most of everything about the game itself. You can open this with "Notepad.exe", but be warned, there's a lot of "dc.b" data, notepad will take a HUGE amount of time to load and edit this source, I therefore recommend downloading and using another text editor, such as "Notepad++" which you can get online for free.
There are several other folders, some have art/mappings/palette files split from "Source.asm" into a binary file, so it can be edited separately, these files are included into "Source.asm" using "incbin". There aren't many things split from "Source.asm", but, it's a start. The folders are just there to give you an idea of how you would go about splitting the files from the source code. It needs a LOT of work to become 100% editable without breaking the game.
"Source.asm" was extremely bloated, and so, I have split a large piece of the "dc.b" data into separate source files inside the "Unknown" folder, these are included into "Source.asm". This is just to make it easier for text editors to open the main source, there's so much data that isn't split into binary files yet, that the source is simply too large to open with standard "Notepad.exe".
Now, if you edit something in "Source.asm", like, change any instructions, add any instructions, remove instructions, or change data, or whatever... After saving, double click on "_Assemble.bat", a black window will appear, when it's finished it'll ask you to press any key to continue (pressing enter will close the window). This will assemble the instructions in "Source.asm" as well as including any data or other source from the other folders, and it'll create a binary ROM called "NHL Hockey 94.bin", which you can open with an emulator, or put on a flash cart and play on hardware, or do whatever it is you want to do. That ROM will contain any changes you have made.
Inside the "_0 Temp" folder is the "ida" disassembled main file, and the original NHL 94 ROM that I used to disassemble. It's simply in there so that "_Assemble.bat" can compare the newly assembled ROM with the original, to find any differences, this was used to help make the source code assemble 100% to the original (which it currently does), if you want to remove this, then right click on "_Assemble.bat", and click on "Edit" in the right click menu, and remove this line:

"_Assembly ToolsCompRom.exe" 200 "_0 TempNHL Hockey 94 Ori.bin" "NHL Hockey 94.bin"
This will stop "_Assemble.bat" from warning you that the ROMs are different. Keep this in if you want to split more stuff but want to keep the ROM 1:1 to the original, it'll help warn you if you've split anything incorrectly.
Inside the "_Assembly Tools" folder are a few programs that are used for assembling the ROM correctly. "asm68k" is a 68k assembler, and the "AS" folder and its contents is the Z80 assembler. I haven't disassembled the Z80 ROM however, so, this assembler is useless at the moment until someone disassembles the sound driver and creates a source code file for it.
"asm68k" and "AS" are NOT my programs, they are assemblers I have collected off the internet for assembling the game. The other programs in there however, such as "CheckFix.exe", "CompRom.exe", "FixSource.exe", "ListEqu.exe", and "PatchRom.exe" are my programs for doing addition things, such as applying the checksum value correctly, and patching the checksum routine into the main ROM, and cross-referencing the source labels/equates between source files, and so forth. Basically, just there to make sure the game assembles as properly as possible. I have left the source codes for these programs there, for anyone who knows C to edit them if necessary.
The game is not quite ready for proper editing I'm afraid, but it is nevertheless a starting point for your community to work on and build off of. You can continue your research from where I left off.
Be warned, EA used an interesting (and personally stupid) method of reading string data, they have a few "bsr" or "jsr" instructions, with the string data DIRECTLY AFTER IT, the subroutine the "bsr" and "jsr" instructions are jumping to, load the return address from the stack (i.e. the address of the string data), and load that string data correctly, they then change the return address to be directly after the string data, so when the subroutine returns, the CPU continues reading code after the string data. While this may have been handy for the programmers, it is completely unoptimal from a speed point of view. You WILL find this happening all over the place in the source code, it's quite popular. There are several bytes inbetween the string data, these will often be extra symbols that are not part of ASCII standard. Often the first byte or two bytes will be a "chatacter count", for the number of characters and symbols inside the string, so watch out for that. I started commented much of the subroutines that deal with reading the string data, but it's still not documented enough for understanding.
As for the fighting code, I did find a huge load of empty/null subroutines, (i.e. the 68k calls a routine that has nothing but a return instruction). Only one of these null routines has code under the return instruction, but it doesn't seem to be anything to do with fighting, the other null routines have no code under them. I strongly suspect that the code wasn't simply stopped by an "rts" instruction, but instead, the entire routine was ripped out of the game before release. Basically, if those null routines are the fighting routines, then they no longer exists in this ROM. The good news is, porting the fighting back in from 93 or 92, should be as simple as copying a routine of instructions across, this assuming however that the null routines are the fighting routines, and that those routines don't call other subroutines. If they do, then you will need to find a matching subroutine from 94 to reference. THIS IS ALL SPECULATION HOWEVER, DO NOT ASSUME THIS IS THE CASE.
I have commented a lot of the initialisation routines to give you all a head start, but this game is quite weird in the way it was coded, I would go as far to say that it may have been coded in a high level language, such as C, but I'm not sure on that as there are aspects that look humanly made.

As for payment, just forget about it, consider this a gift and nothing more.
Have a Merry Christmas~

~MarkeyJester

Edited by 77
  • Love 1
Link to comment
Share on other sites

can't believe we finally got the source and from a porn star no less!

Not the source, just a disassembly

http://forum.nhl94.com/index.php/topic/17841-guy-in-uk-making-a-new-sega-genesis-with-original-dev-kit/?p=164292

Neat that you can make changes and rebuild, though. My hacks do the changes in-place, which is less flexible.

Maybe we can post all the 'code' parts to a wiki and start figuring out what it all does. Some free wiki candidates? https://en.wikipedia.org/wiki/Comparison_of_wiki_hosting_services

This wiki already exists: http://nhl94.wikia.com/wiki/N.H.L.94_Wiki

Link to comment
Share on other sites

  • 1 year later...
  • 10 months later...
  • 2 years later...

This is pretty cool and useful.  It was posted before I had my elementary understanding of assembly language (which I learned from Markey Jester's site!).  Makes a lot more sense, I like the way the subroutines are identified into pieces.  Yes, there is a TON of work to do, but this organization helps a lot.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Who's Online   0 Members, 0 Anonymous, 91 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...