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

Author Topic: [Help] Specific NBA Jam TE SNES ROM Questions  (Read 818 times)

eskayelle

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
[Help] Specific NBA Jam TE SNES ROM Questions
« on: June 20, 2017, 02:11:39 pm »
Hello.  I've gotten about as far as my understanding of hex codes and tiles will get me in my NBA Jam TE ROM hack, but there are a few nice additions I'd like to make to my ROM if I can figure out how.  If anyone can help answer one or more of the questions below, that'd be huge.  Here's my "wish list":

1) I'd like to hack the Acclaim logo such that I change out the word "entertainment" within the graphic.  Using TileMolester, I can't seem to find the tiles for the Acclaim logo.  Does anyone know the address for where the Acclaim graphic at the start of the game is held?  OFFSET VALUE RECEIVED!
2) I'd like to change the player sprite that's in the Acclaim screen such that he looks like Vlade Divac.  I have a separate forum topic ("Head Graphic Hacking") out with questions on where the pointers may be and how to change them such that the character becomes Vlade Divac.  If someone has ideas on this, please let me know.    SOLVED!
3) I'd like to change the Rookies' uniforms such that they look like Olympics uniforms.  I'm not sure if this requires ASM hacking or simple tile editing, as I don't know where to locate the uniforms in the ROM (Is there a specific set of addresses I should look for?  And how large are the tiles?  2x2?  Something else?  How many animations would need adjustment?).  If someone knows how to change the uniform colors, please let me know how that might be done.    SOLVED!
4) I'd like to set up the team select screen such that two buttons cycle backward through the various player combinations.  Currently, A, B, X, and Y all cycle forward.  This looks like it requires an ASM hack, which I don't know how to do.  Is there code someone would be able to provide me (and explain how to insert it) that would do this?  And, would inserting that code lead to adding bytes and therefore cause problems in the ROM with pointers or size, etc.?  (I'm probably overstepping on this one, so please feel free to ignore.)
5) I'd like to understand how to replace the compressed portraits sitting in the 7F bank of the ROM.  It may require changing pointers, but I don't 100% understand what that means and where the pointers would need to point (would a new bank need to be added and new portraits pointed over to there)?  Looking to understand the theory here and how it'd work.  DISCUSSED BELOW.
6) I've read of a bug in the original game where players who beat all 27 teams don't get their initials in the Grand Champions screen (from playing the game years ago, I seem to remember my initials not registering).  If there's a bug fix, is there a simple hex edit I can do, or does it require an ASM hack?    SOLVED!

Thanks for reading!
« Last Edit: August 01, 2018, 09:54:59 pm by eskayelle »

eskayelle

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: [Help] Specific NBA Jam TE SNES ROM Questions
« Reply #1 on: May 08, 2018, 03:51:01 pm »
Hello, all.  It's been about a year since I put aside my NBA Jam TE hacking project.  I'd been able to swap out portraits (except for compressed ones), change team names in the menu and on the scoreboard, edit the courtside banners, change codes for secret characters, display attributes for secret characters when placing them in a menu (I replaced the Rookies with the 1992 Dream Team and used Bird's secret character to save a roster slot), edited the names in the attract mode roster screen, edited the final credits, created an OP secret character, revised face sprites, and edited the features attract screens, but I wasn't able to figure out the items in this previous message.  Wonder if anyone had ever come upon some answers they could share?

phonymike

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: [Help] Specific NBA Jam TE SNES ROM Questions
« Reply #2 on: May 28, 2018, 03:30:39 am »
Good work on the game, impressive you did all that without assembly work!

Hope this isn't too much, I've spent some time (that's putting it lightly) figuring out the compression routine. Those 31 compressed portraits were laughing at me with a face hidden by said compression scheme. So I wrote a decompression command line tool, just spits out the binary data to a file, so I could see the portraits or perhaps convert them to bitmap files with my portrait command line tool. The cool thing from all of this was that not just those portraits are compressed, more stuff like the Acclaim logo are compressed as well. I have yet to write the re-compression part because I don't know where to start and I think it's actually unnecessary.

Compressed items are the 31 portraits, Acclaim logo, Iguana screen, title screen (graphics and map I think), and a few other things that don't seem important but might be garbage data.

I say it's unnecessary because I figure just throw the uncompressed graphics into rom (it's 24 mbit, nobody will care if it's expanded to 32 mbit), then those screens would load immediately instead of taking a few seconds to decompress to ram.


So, to get you started I'd suggest using your hex editor and making the game 32 mbit, make sure you delete the 512 (0x200) byte header at the beginning of the rom. Just add zeros until it's 4,194,304 bytes, or use Lunar Expand. Then copy the portrait data of a player (0x690 bytes and a 0x40 byte palette data I forget exactly), and paste it anywhere in all that free space. Then grab Lunar Address, set it to LoROM 80:8000, and type in the hex editor address on the left, and get the snes mem address on the right. That's the address you can overwrite the compressed 7F1860 locations with. 7F1860 is a snes WRAM memory address, because the game decompresses the data from rom to ram, and that's where the pointer loads the image from, while all the other pointers are to uncompressed rom locations (type them into lunar address to see the file location.) So if you put a portrait at the beginning of the expanded rom area, 0x300000, you would put E08000 over 7F1860 in the pointer table and it should work, byteswap it of course so 0x00 0x80 0xE0.

That should help you get around the compressed player portraits. It will require a little assembly to skip the decompression code and just load uncompressed graphics from rom.

Lunar Expand: https://fusoya.eludevisibility.org/le/index.html
Lunar Address: https://fusoya.eludevisibility.org/la/index.html


So here's some locations for the compressed graphic stuff. On the left is the snes memory location (in rom) where the data starts, type it into Lunar Address to get the file address. On the right is where it gets decompressed to, this will only be visible in an emulator, notice where the portrait data gets put. The full screen graphics copy to the same place because they're on screen at different times. There might be more stuff but I haven't really looked.

Code: [Select]
A9:8000 decompression routine starts

11:8000 compressed portrait data copies to 7F:1860
2C:A3D0 compressed acclaim logo copies to 7F:0000
31:B025 compressed ?? exec: 89:8000 copies to 7F:0000
3B:8470 compressed iguana data copies to 7F:0000
42:8000 compressed title screen graphics
4F:8000 compressed ?? exec: 89:83D5 copies to 7E:2C78
03:D01D compressed ?? exec: 89:8135 copies to 7F:0000
0C:809F compressed portrait name data?
0C:CA5E compressed title screen map data?

Looking at the compressed portrait data, it's at snes mem rom location 11:8000, which is 0x88000 in the hex editor. The first two bytes of data (0xF3 and 0x78) are the size of the compressed data, of course byte swapped. So the compressed data is 0x78F3 long. If you subtract those two bytes from the length, and jump ahead that many bytes, you'll get to the start of the data (it decompresses from the end), which starts with how big the decompressed data is, in this case 0x30, 0xD3, so the decompressed data is 0xD330 long, 57% compression ratio nice!

Now I show these locations because you can pull up a snes emulator with a debugger (I use Geiger's snes9x1.51.ep10r2) and set a breakpoint on execution when the routine starts, and see every time it's used (not very much really) and see the source and destination of the graphics.

Geiger's snes9x: http://geigercount.net/crypt/


I hope that shines some light on some advanced topics. I could help with inserting uncompressed portraits and name graphics into expanded rom. I've been getting pretty good with asm modifications.