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

Author Topic: Head Graphic Hacking (NBA Jam TE, SNES)  (Read 2028 times)

eskayelle

  • Full Member
  • ***
  • Posts: 134
  • NBA Jam 2Kxx / TMNT of Rage / Pong de las TMNT Dev
    • View Profile
Head Graphic Hacking (NBA Jam TE, SNES)
« on: May 25, 2017, 07:04:53 am »
Hello.  I'm trying some hacking in the SNES NBA Jam TE rom; I'd like to modify a head graphic tile to look like Hulk Hogan.  Wondering if anyone has some of the info below?
1) What is the size of the head sprite tile (portraits are 6x7, using TileMolester; how big are head sprites)?  How many pixels does this translate to (portraits are 48x56; what about heads)? 
2) How many head sprites are there per character? 4 (one per direction)?  More (do the dunk animations use any different sprites)?
3) Are the head sprites ordered in a sequence in the rom, such that - for any one character type - they're all in a block together?  Will that block also include the palette info?
4) If 3 is "yes", how many bytes are in that block?  How many bytes per head sprite versus palette?  What's the order/sequence of the block?
5) What's the address in the rom where I'd be able to find the first set of tiles for the head sprites?
Thanks in advance for any guidance you can provide!

May 29, 2017, 10:02:37 am - (Auto Merged - Double Posts are not allowed before 7 days.)
I figured I'd pare down my question for now, based on my research and experimenting with ROMs, to get to the meat of things.

Byte 18 and 19 of Jam's player stats data provide a head graphic pointer.  For example, if I want to use Vlade Divac's head on a character, I would (in the hex), set those two bytes to C3 B7 (or $#B7C3).  I want to modify this graphic (and all related ones in the animations, though I'm not sure how many that is just yet).  How would I go about using this pointer to back into the address for the tileset in the ROM?

If an SNES header is 0x200 in length, do I add the 0x200, giving me B9C3 (did I miss the math on that)?  And... if I'm going down the right path, I'm missing part of the address still.  If the stats are located in addresses of $1Fxxxx, do I tack on that 1F as a prefix, getting me $1FB9C3?  That address seems to put me into the code, not the tileset, so I know I'm still doing something wrong, but I'm not sure what.
« Last Edit: May 29, 2017, 10:02:37 am by eskayelle »

Mattrizzle

  • Jr. Member
  • **
  • Posts: 46
    • View Profile
Re: Head Graphic Hacking (NBA Jam TE, SNES)
« Reply #1 on: May 29, 2017, 10:18:06 am »
  • The size of a head sprite is 2x2, which is 16x16 pixels.
  • There are 16 different sprites per head type. Dunking sprites are included in this number, and may be used for other actions (e.g. getting knocked down by another player).
  • Yes, all sprites for a head type are included in the same block. The palette is not included in the block, as every head sprite in the game shares the same palette.
  • There are 8B0 bytes in each block. Each head graphic occupies 8B bytes, but the first B bytes are unnecessary. Upon setting a breakpoint on them, I found that they are never read anywhere in code. Similar bytes exist prior to other graphics (e.g. the team logos) for setting the coordinates and size of sprite tiles for Object Attribute Memory (OAM), but they aren't used here.
  • The first address where a head sprite can be found is 1EB6E. This is the secret player Kabuki's first one (the block containing his head graphics can be found between 1EB63 and 1F412.

My document at the following link should answer the remaining questions you have: http://mattrizzle.caffie.net/docs/nbajamte/nbajamte_heads.txt

If there is anything I need to clarify, please let me know.

eskayelle

  • Full Member
  • ***
  • Posts: 134
  • NBA Jam 2Kxx / TMNT of Rage / Pong de las TMNT Dev
    • View Profile
Re: Head Graphic Hacking (NBA Jam TE, SNES)
« Reply #2 on: May 29, 2017, 08:40:19 pm »
Thanks, Mattrizzle!  I used the info you provided in this chain, plus the text file you linked, to set up some HEX2DEC conversions in Excel and calculate each of the 16 tiles for a given player.  I seemed to be messing something up importing the ZSNES save states into YY-CHR, but using TileMolester (2x2 tiles, 4bpp planar/composite) and ZSNES, I located every head for Lohaus and Divac.

From previous posts you had provided on this site, along with some Jam TE-specific tools folks had written over the years, I've been able to create and insert portraits, rename characters to match to those portraits, reset initials for secret players, edit stats per player, reconfigure rosters (I recast the Detroit Pistons to the Motor City Bad Boys of the late 80s/early 90s, as well as revised the Rookies to cycle through the 1992 Dream Team), and reset for certain teams how many players are available before all 27 teams are defeated.  Looking forward to working with these tiles next!

Thanks again!

eskayelle

  • Full Member
  • ***
  • Posts: 134
  • NBA Jam 2Kxx / TMNT of Rage / Pong de las TMNT Dev
    • View Profile
Re: Head Graphic Hacking (NBA Jam TE, SNES)
« Reply #3 on: June 13, 2017, 01:00:56 am »
I'm currently trying to modify the player in the Acclaim logo screen to look more like me, ala Vlade Divac's head sprite and body type.  After doing a fair amount of ROM corruption, I'm finding that I need to change the head sprite at address $1FC83D to do this (I've hacked the ROM quite a bit and think I inadvertently changed a pointer).  That address is the head sprite for my Charles Barkley character, so I don't want to swap that head out for Vlade Divac's.  I've tried a number of ROM corruptions and can't seem to find the address that is pointing to $1FC83D, so I'm not sure where to go to point/change the Acclaim player's graphics to the Vlade Divac-type character I created.  Wondering your advice for this.

[UPDATE]: I took the original ROM and my hacked ROM.  In both cases, I determined that the location in the ROM $B1F0F (this is a roster pointer table that establishes who the first player on the Phoenix Suns will be) establishes what head will be used in the Acclaim graphic.  When I changed the value to 37 in each ROM (value for player Luc Longley), the head in the Acclaim logo graphic changed to the one used for Luc Longley, but the body color never changed to match the change in the head.

How do I use this info to get me back to the address in the ROM where 1) it points to $B1F0F for the head (so that I can change that pointer to an address that will have the head I want) and so 2) I can find the pointer to the body type so I can change that to match the head?
« Last Edit: August 01, 2018, 10:00:21 pm by eskayelle »