DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Share ROM offsets and general DKC hacking documentation

DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Postby Mattrizzle » July 3rd, 2008, 1:31 pm

The addresses in this post are for the V1.O U ROM, but the other versions should have addresses in close proximity to these. Feel free to reply with your questions if you can't understand what all of this mumbo-jumbo means. I know from the past that I'm not very great at explaining things the first time through.

3BCC9C-3BF78F Sprite tilemap/graphic pointers (2,749 pointers, each is 4 bytes)
All of the pointers are in SNES HiROM format, which means you'll have to subtract C00000 from the pointer to get the true PC address.

Sprite tilemap format(used throughout DKC trilogy)
Byte 1: number of 2x2 tiles in tilemap
Byte 2: number of 1x1 tiles in tilemap
Byte 3: start of 1x1 graphics
Byte 4: relative starting offset of graphics(10= start at second tile)
Byte 5: unused byte?
Byte 6: First tile to use for second group of graphics
Byte 7: where to place this group(10=second row in RAM)
Byte 8: number of 1x1 tile graphics group 2 is comprised of
Byte 9: X-coordinate of first tile
Byte 10: Y-coordinate of first tile
Byte 11: X-coordinate of second tile
Byte 12: Y-coordinate of second tile
...etc., until start of graphics

3E8572-3E88E1 Animation sequence pointers (440 pointers, each is two bytes)
3E88E2-3EEF50 Animation sequences

Animation sequence format
LL ss SS LL ss SS LL ss SS ... 80 00
LL: Length of time to display frame (00-7F)
ss SS: Sprite pointer relative to $3BCC9C (low, high)

Animation sequence scripts(many are still unknown)
These scripts are placed before the animation frame on which they are executed.
80 00: end of animation (loops to beginning)
81 ll mm hh: jump to ASM subroutine at hhmmll
82 oo OO: jumps to animation sequence at offset OOoo
83 ll mm: jumps to ASM subroutine at mmll (unknown trigger)
84 ll mm hh: jump to ASM subroutine at hhmmll when object turns around
85 LL ss SS -- --:
86 LL ss SS -- -- xx XX yy YY:
87 LL ss SS xx XX yy YY:
88 xx XX yy YY:
8B LL ss SS xx XX yy YY:
8C -- --:
8D -- -- -- --:
8E ??: Play sound effect ?? on the following animation frame
8F ??: Play sound effect ?? on the following animation frame(different channel?)
90 ??: Play sound effect ?? on the following animation frame(different channel?)

3CC388-3CC3D5 Title screen/map screen/Kong family animation sequence pointers (78 pointers, each is 2 bytes)
3CC3D6-3CEF99 Title screen/map screen/Kong family animation sequences

Title screen/map screen animation sequence format(much is still unknown)
00 00 00 00 ll LL ss SS 00 00 00 00 ll LL ss SS ... 00 00 00 00 FE FF
ll LL: Length of time to display frame (000-7FF)
ss SS: Sprite pointer relative to $3BCC9C (low, high)
FE FF: end of animation (loops to beginning)

As a bonus, many of the unused sprites I've found after weeks of spelunking through the DKC ROM can be found in this topic. Enjoy!
Treasure Hunter
Bananas received 171
Posts: 390
Joined: 2008

Re: DKC Sprite Tilemap and Animation Data Found!

Postby Simion32 » July 3rd, 2008, 1:52 pm

Wow, I never knew there was that much unused stuff in DKC!

Thanks to you, Mattrizzle, I can finally work with the sprite data. I was planning on researching it myself but you beat me to it! ;)
Sage of Discovery
Bananas received 254
Posts: 2659
Joined: 2008

Re: DKC Sprite Tilemap and Animation Data Found!

Postby Mattrizzle » July 4th, 2008, 4:34 pm

More info, this time it's the collision data for each sprite:
3B8000-3B9579 Sprite collision data pointers (2,749 pointers, each is 2 bytes)
3B9800-3BA425 Sprite collision data (387 sets, each is 8 bytes)
Bytes 1-2: horizontal displacement of collision box
Bytes 3-4: vertical displacement of collision box
Bytes 5-6: width of collision box
Bytes 7-8: height of collision box
Last edited by Qyzbud on August 5th, 2008, 9:18 pm, edited 3 times in total.
Reason: Removed duplicate info caused by topic copying
Treasure Hunter
Bananas received 171
Posts: 390
Joined: 2008

Re: DKC Sprite Tilemap and Animation Data Found!

Postby Simion32 » July 4th, 2008, 5:15 pm

Mattrizzle wrote:More data, this time it's the collision data for each sprite
Just what I needed, physics data! Thanks for posting that info! :D

Mattrizzle, are the offsets of tiles in sprites signed values relative to the center point (eg. 0-7F positive, FF-80 negative)? That's about the only thing I didn't quite gather from your explanation.

I'd try to help with the uncovering of all this great info, but I'm busy with part of DELTA at the moment. Keep on going, this is proving to be very interesting and useful!
Last edited by Qyzbud on August 5th, 2008, 9:19 pm, edited 1 time in total.
Reason: Removed duplicate info caused by topic copying
Sage of Discovery
Bananas received 254
Posts: 2659
Joined: 2008

Re: DKC Sprite Tilemap and Animation Data Found!

Postby Mattrizzle » July 5th, 2008, 3:20 am

Simion32 wrote:Just what I needed, physics data! Thanks for posting that info! :D

You're welcome. ;)

Mattrizzle, are the offsets of tiles in sprites signed values relative to the center point (eg. 0-7F positive, FF-80 negative)? That's about the only thing I didn't quite gather from your explanation.

No. The values for the tile coordinates are unsigned, so(I guess) 7F, 7F would be the closest to the center. The horizontal values run from left to right, while the vertical values run from top to bottom.

However, the collision coordinates are handled in the way you mentioned. For instance, a horizontal displacement of FFF0 means the hitbox will be placed 16 pixels to the left of the center point, while a horizontal displacement of 0010 will shift the hitbox 16 pixels to the right. Likewise, negative values for for vertical displacement will move the hitbox up and positive values will shift it down. If both displacement values are set to 0000, the top left corner of the hitbox will be centered on the origin(again, just a guess).
Last edited by Qyzbud on August 5th, 2008, 9:20 pm, edited 1 time in total.
Reason: Removed duplicate info caused by topic copying
Treasure Hunter
Bananas received 171
Posts: 390
Joined: 2008

Re: DKC Sprite Tilemap and Animation Data Found!

Postby Qyzbud » July 23rd, 2008, 12:24 pm

I noticed this thread a while back, but haven't found the time to post a significant reply until now (and even now it'll have to be brief! :roll:).

First off, incredible work, Mattrizzle! Your time spent ROM spelunking has turned up loads of useful and interesting info. I'm sure these details will come in handy for a variety of advanced DKC projects, and at the very least, I know Simion will love you long time. :D

One of these days (hopefully soon) I'm going to start adding content to the Studies & Docs section of DKC Atlas, so at that point I'll want to put up all of this vital hacker documentation up. I would like to give you, Simion and RaccoonSam (amongst others) credit on the site for your discoveries, and your efforts in recording and documenting this info. I may have to ask you data spelunkers for a bit of help when organising the Studies & Docs section logically and accurately, so hopefully I can call on you for assistance when the time comes.

As for the nature of this thread - it seems that most discussion is about the rather amazing assortment of unused sprites you discovered. Really, these discoveries (and any future beta sprite/media finds) are significant enough to deserve their own thread. Having another thread would help keep these two separate discussions distinct from one another, so I'll work on making a clean and logical thread-split when I get a chance.
Atlas Author
Bananas received 671
Posts: 3228
Joined: 2008

Re: DKC Sprite Tilemap and Animation Data Found!

Postby Simion32 » July 25th, 2008, 6:38 pm

Mattrizzle wrote:Byte 4: relative starting offset of graphics(10= start at second tile)
Byte 5: unused byte?
I'm working on getting sprite dumping coded into the DKCRE, and I have found out what the 4th and 5th bytes are really for. For example, take a look at offset 0x38262E. The fifth byte isn't $00, so it had to be used for something. I investigated further and wrote down my findings...

To highlight those findings, here's a revision I've made to your sprite tilemap explanation:
Byte 1:Number of 16² tiles in Group A
Byte 2:Number of 8² tiles in Group B
Byte 3:Start of Group B 8² tiles relative to start of graphics (Measured in 8² tiles)
Byte 4:Number of 8² tiles in Group C
Byte 5:Start of Group C 8² tiles relative to start of graphics (Measured in 8² tiles)
Byte 6:Start of Group D 8² tiles relative to start of graphics (Measured in 8² tiles)
Byte 7:Where to place Group D in VRAM upon the display of this sprite. (Measured in 8² tiles)
Byte 8:Number of 8² tiles in Group D
Bytes:Group A, B and C position data
Bytes:Sprite graphics for Groups A, B, and C
Bytes:Group D graphics, if present.

EDIT: Any chance you know how the game determines which pallet to use? I'm assuming you just used a tile editor with an imported pallet from a savestate... but when trying to dump everything straight from the ROM, this may get a bit confusing. I'm hoping to find a pallet table or something that designates which set of colors to use. It may not be that simple, though. :|
Sage of Discovery
Bananas received 254
Posts: 2659
Joined: 2008

Re: DKC Sprite Tilemap and Animation Data Found!

Postby Mattrizzle » July 29th, 2008, 5:29 am

I'm glad to hear you're still making progress, Simion!

Simion32 wrote:Any chance you know how the game determines which pallet to use? I'm assuming you just used a tile editor with an imported pallet from a savestate... but when trying to dump everything straight from the ROM, this may get a bit confusing.
That would be in the object's code, which the object bytes are actually pointers to. One instance is the first Gnawty type used in Jungle Hijinxs. Its value is B413, which points to 0x35B413.

The object format is fairly simple, consisting of mainly RAM addresses followed by the value to store into the address. As with the animation data, there are a few different control codes. I will list these below:

Spoiler!
00 80: End object data
00 81 nn NN: Default animation(NNnn)
00 82 aa AA: Jump to object data at address AAaa
00 83: Subroutine branches to "end object data" code (unused)
00 84: No horizontal or vertical flip (unused)
00 85: Set horizontal flip (unused)
00 86: Set vertical flip (unused)
00 87: Set horizontal and vertical flip (unused)
00 88 pp PP: Palette pointer(PPpp) (Points to bank BC normally, but when bit 4 of $1E15
is set, this points to bank 7F and 5A53 is subtracted from PPpp)
00 89: Set priority equal to 0 (unused)
00 8A: Set priority equal to 1 (unused)
00 8B: Set priority equal to 2 (unused)
00 8C: Set priority equal to 3 (unused)
00 8D: Unknown (unused)
00 8E ff FF: Orientation/Priority
00 8F xx XX yy YY: When an object is spawned by another object, this determines its coordinates relative to the parent object
00 90: Unknown, used by six objects
00 91 qq 00: Set palette line [00-07] (unused)
00 92 xx XX yy YY: Unknown coordinates, Only used by lives counter
00 93: Unknown, only used by two objects
00 94 ?? ?? ?? ?? ?? ??: Unknown, appears to be used by objects spawned from item caches
00 95 ll mm: Execute pointer
00 96: Unknown (unused)
00 97 ff FF: Orientation; checks level theme ($32) for exceptions


RAM Addresses(NOTE: many addresses/values are still missing)
Spoiler!
$0D11 Determines the sprite used for an object without a default animation
$0D45 Primary Behavior
    #$00: NULL
    #$01: Donkey Kong
    #$02: Diddy Kong
    #$05: Kritter
    #$06: Klump
    #$09: Rambi
    #$0A: Expresso
    #$0B: Winky
    #$0C: Enguarde
    #$0D: Squawks
    #$0E: Coconut-throwing Necky
    #$10: Necky coconut
    #$11: Exit
    #$14: Concealed exit
    #$15: Banana bunch
    #$18: Animal crate
    #$19: Zinger
    #$1A: Klaptrap
    #$1B: Tire(in ground)
    #$1C: Tire(in ground)
    #$1D: Pushable tire
    #$1E: Pushable tire
    #$1F: Tire
    #$20: Invincible; rushes toward you if hit with a barrel (Mincer)
    #$21: Fast animation(?)
    #$22: Steel Keg
    #$23: Normal Barrel
    #$24: Fragile Barrel
    #$25: Oil Drum?
    #$26: DK Barrel
    #$27: TNT Barrel
    #$28: Burning Oil Drum
    #$29: Slippa
    #$2A: Falls off the screen
    #$2B: Nothing?
    #$2C: Static; no collision
    #$2E: Falls off the screen
    #$2F: Army
    #$30: Rope
    #$31: Swinging rope
    #$34: Extra Life Balloon
    #$35: Static; explodes
    #$36: Static; causes snow to fall
    #$38: Auto-fire Barrel Cannon
    #$3E: Glitchy; hovers left and right
    #$41: Displays lives counter on screen
    #$45: Animal Token
    #$46: Blue Krusha
    #$48: CRASHES
    #$4A: Continue Barrel
    #$4B: Mini-Necky
    #$4C: Dumb Drum
    #$4D: Gnawty
    #$4F: Necky
    #$50: Manky Kong
    #$51: Mine Cart
    #$53: Chomps
    #$54: Chomps Jr.
    #$55: Bitesize
    #$56: Squidge
    #$57: Croctopus
    #$59: ??? (Same routine as Clambo pearl)
    #$5A: Hanging lamp
    #$5C: Fuel Drum
    #$5E: CRASHES
    #$61: Clambo
    #$62: Clambo pearl
    #$63: On/Off Barrel
    #$66: Continue Barrel sparkles
    #$68: Rockkroc
    #$6A: Exit
    #$6B: Underwater exit
    #$6C: Bonus game/boss room setup
    #$6D: 1UP sound; random object appears
    #$70: Bonus Klap-Trap/bosses
    #$71: Invincible; large collision area
    #$72: Bonus timer
    #$74: Nintendo Banana
    #$76: Giant Animal Token
    #$77: Ending cast sequence
    #$78: Silver Krusha

$1029 Status

$109D Knockback(bitwise)
    #$0000: No knockback
    #$0001: Knockback when stomping
    #$0002: Knockback when rolling

$11A1 Interaction
    #$0001-Enable stomp/hand slap vulnerability
    #$0002-Enable stomp/hand slap/roll/Animal Buddy attack vulnerability
    #$0004-Enable invulnerability to barrels
    #$0008-Stomping "merges" you with the object (i.e. Animal Buddies)
    #$0010-Carryable: Yes (doesn't work like you'd think for most objects, though)
    #$0020-? (many objects use this, but there is no obvious difference when it is disabled)
    #$0040-Enable interaction with platforms
    #$0080-Unknown; enabled on D.K./Diddy
    #$0100-Unknown; enabled on bonus walls

$1375 Multipurpose object table
    For a Fuel Drum ($0D45= #$005C), this determines how many units it refills(value is multiplied by #$2000)

$13E9 Multipurpose object table

$145D Multipurpose object table
    For an Extra Life Balloon ($0D45= #$0034), this determines how many lives it will give you

$14C5 Multipurpose object table
    When $152D is #$0008 or #$006F, this determines jump height

$14F9 Multipurpose object table

$152D Movement behavior
#$0000 NULL
#$0001 Walks in a fixed range ($13E9: byte 1= distance right from origin; byte 2= distance left from origin)
#$0002 Walks in a straight line
#$0003 Leaps back and forth, changes animation to jumping Kritter (Gold Kritter)
#$0004 Moves forward while jumping, changes animation to jumping Kritter (Blue Kritter)
#$0005-0007 Unused duplicate of #$0008
#$0008 Jumps when player does (Purple Klap-Trap; $14C5= Jump Height)
#$0009-000C Unused duplicate of #$000D
#$000D Jumps, small and large hops, changes animation to jumping Kritter (Grey Kritter; Brown Kritter; $1375= Jump Rhythm Pointer [F4ED or F507])
#$000E-001A Unused duplicate of #$001B
#$001B Moves vertically in a fixed range (Zinger; Mincer; Necky)
#$001C Moves horizontally in a fixed range (Zinger; Mincer; Necky; Chomps)
#$001D Moves in a circle (Zinger; Mincer; Necky)
#$001E-0054 NULL
#$0055-0063 Unused duplicate of #$0064
#$0064 ?
#$0065 ?
#$0066 ? (Millstone Gnawty)
#$0067 Moves in an arch (Zinger; Mincer)
#$0068 Leaps back and forth using standard animation (Gold Kritter)
#$0069 ? (standard platform)
#$006A Constant Movement (Necky)
#$006B ?
#$006C Moves in a straight line, doesn't interact with level (Chomps Jr.; Croctopus; Millstone Gnawty)
#$006D ? (tank platform)
#$006E Delay before moving(used in conjunction with $1491)
#$006F Jumps when player does; walks in a fixed range (Purple Klap-Trap; used in conjunction with $13E9 and $14C5)
#$0070 ?

$1561 Movement status? (usually set to #$0000)

**Updated June 17, 2010**
Treasure Hunter
Bananas received 171
Posts: 390
Joined: 2008

Re: DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Postby Qyzbud » August 6th, 2008, 3:36 pm

Okay guys, I finally got around to splitting the Unused Sprites of DKC discussion from this topic.

Feel free to recommence the DKC ROM offsets discussion.


Note: Mattrizzle, I've retitled this topic to cater for broader research, as you suggested.
Atlas Author
Bananas received 671
Posts: 3228
Joined: 2008

Re: DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Postby Simion32 » September 8th, 2008, 6:15 am

List of all animation digits used in object code:
(excludes major objects such as DK/Diddy/Animal Buddies, and also excludes sub-animations)
Spoiler!
[AnimPals]
0005 = 876A
0006 = 8A1C
000E = 86D4
0010 = 8710
0012 = 8262
0014 = 8F44
0015 = 86F2
0016 = 8E18
0018 = 89A4
0019 = 8E18
001A = 87A6
001B = 8404
001C = 83AA
001D = 8404
001E = 8404
0020 = 8AEE
0022 = 8F44
0023 = 8F44
0024 = 8F44
0026 = 872E
0027 = 872E
0028 = 8F44
0029 = 8602
002C = 89C2
002F = 8E18
0030 = 8F26
0031 = 865C
0034 = 8D64
0038 = 8AEE
0039 = 8A76
0043 = 8A76
0045 = 89A4
0046 = 8A1C
0048 = 86F2
004A = 881E
004B = 8A76
004C = 8F44
004D = 8A3A
004F = 8D64
0051 = 8F44
0053 = 8AD0
0054 = 8AEE
0055 = 8AEE
0056 = 8EEA
0057 = 8C74
0058 = 89A4
005A = 8F44
005C = 8C38
005D = 8350
0061 = 8C92
0066 = 89A4
0068 = 8D64
006A = 8262
006B = 8262
006C = 8F44
006F = 8F44
0071 = 865C
0072 = 86F2
0073 = 8C92
0075 = 8280
0076 = 89A4
0077 = 89A4
00D1 = 8F44
00D2 = 8F44
00D3 = 8D64
00D5 = 876A
00D6 = 872E
00DE = 8D64
00E9 = 8E18
00ED = 872E
00FB = 86D4
00FE = 8A76
0102 = 8F44
0104 = 89A4
0109 = 87A6
0113 = 8E18
0115 = 872E
0117 = 8710
011B = 8C92
011C = 8F44
011F = 8D82
012F = 872E
0137 = 86F2
013E = 8F26
0141 = 8F44
0143 = 8C38
0148 = 8A76
014E = 8A1C
0153 = 8A76
0154 = 8F44
015A = 8A1C
015E = 83AA
0164 = 8F26
0169 = 86D4
016A = 8AD0
016D = 8AB2
016F = 8AEE
0172 = 8F44
0175 = 89A4
0176 = 8C74
017C = 8F44
017E = 8C74
0181 = 8C92
019C = 8350
019D = 8350
019E = 8280
01A4 = 8602
2670 = 8EEA
26AC = 865C
I find it strange that my object code scanner didn't pick up any value for the Kongs and Animal Buddies, though that may be because those animations aren't in object code. They are more likely activated by some ASM code elsewhere (since they are 'major' objects).

EDIT: Palette info is probably not correct.
Sage of Discovery
Bananas received 254
Posts: 2659
Joined: 2008

Re: DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Postby Simion32 » September 22nd, 2008, 5:00 am

Mattrizzle, the animation digits that you say are used object code are NOT the same as the actual animation pointer digits. For example, a Kritter's death animation/behavior is represented by $0005 in object code, but the death animation digit is $00EA. :|

(Edited: Nevermind, that was the object code. This is confusing me. Still need to know what's up with those animation digits though.)
Sage of Discovery
Bananas received 254
Posts: 2659
Joined: 2008

Re: DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Postby Gabriel » September 22nd, 2008, 5:12 am

I am not sure if this is directly related to what you are saying, but do you know how to follow an object short to its ASM code? Here is an example object 9A61 is a ground-slappable hidden banana bunch. Using 9A61, how would I make it so a different object is spawned? Also do you have any ideas on how to make custom barrels? An example barrel is D52D, an auto barrel that points up and shoots up. How would I make it shoot in a different direction?
Tourist
Bananas received 1
Posts: 16
Joined: 2008

Re: DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Postby Simion32 » September 26th, 2008, 1:53 pm

Oops, I didn't see your post until after I edited mine, but anyway...

I suppose you would take 9A61 and add 0x350000 to it, to get 0x359A61.

Then just modify the object code, I guess. Look at Mattrizzle's explanation above to see what the control codes do.

EDIT Before Bumping
Regarding behavior animation digits: Ah, I see! The digits are stored within the object behavior ASM code, and each set of ASM commands is referenced by a digit. In this case, the behavior digit for a Kritter is 0005, and in the ASM there is a "LDA #$00EA" instruction which is where the $00EA comes from... NOW I understand it! :D

But this does mean I'll have to make a list of all "animation digit + palette" combinations manually... :roll:
Also for your information, I plan on extracting beta items too; I want the extraction to as complete as possible.

Gabriel, I don't know how you would modify a barrel to shoot different directions, it might involve re-arranging object code. I'll probably check it out later when I'm less involved in this animation/palette list stuff.
Sage of Discovery
Bananas received 254
Posts: 2659
Joined: 2008

Re: DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Postby Kiddy14 » September 30th, 2008, 2:33 pm

Is posting about palettes right here?

Sorry, I may seem a nuisance but I have been in the Unused DKC Sprites thread and read a lot of stuff about paletts. My question is not to ask how exactly they work (as I have no idea in ROM hacking or hexadecimal things and that), but just want to know if what I think is kind of correct. Sprites and layers are not colored in the game right? The colors are assigned upon loading. So the game stores where to put the colors in a palette table list? Like, if we divided a DK sprite with the bundaries of the colors we see when he has a pallete, and every division we give it a number, the game would look in the assigned palette table for the numbers and their respective colors; and that's how the shaded and 2nd player colors work, am I in-tune here? =P
My question, now, is if that's how the Orang-utan Gang and Torchlight Trouble effects work... they use pallets or transparent layers? O.o
Sorry, I may be taking you away from your work now with these questions xD

Also, I remember about something I asked you in the DKCLB thread:
Kiddy14 wrote:Mmm... well here's another doubt I have :oops: :

Since for making the LB you have to extract the DKC resources, and you made a previous post about the Kong's speed, I wanted to ask this (admins, if this is going too off-topic, please split it):

Well, I've been noticing this since I started playing DKC2. There are some sprites where their "frame-rate" depends on the actual speed of the object while some don't. Example: All of Dixie's walking/running/carrying sprites animate faster the faster she's walking/run, blah... but they get slower the slower she moves. Diddy, on the other side, has his walking sprites animated at the same "frame-rate" whereas he is walking slow or fast.

How will the LB display the sprites with the different speed? Sorry, I'm getting to "tecnique" with this stuff =P

So you told me there must be some code for the animation speed. I may think the sprites have a low animation speed that Rare customized and made the Kongs' animation speed faster depending on it. For example, if Dixie slows down, her animation speed does it too; but if she accelerates, she animates faster; and if you run down a slippery hill, Dixie would animate extremely fast, but Diddy too, even though when running slow or fast his animation is always the same, so when running faster than his fastest speed his sprites move faster.
This also happens in DKC, specially in slippery levels. Though in DKC3, this only seems to happen when Dixie or Kiddy are carrying something. Is kind of weird how Rare applied this.

You know I feel I'm kind of not giving anything worthwhile to the thread so I'd like you to not find that "code" unless it is your next thing in the list or you are already finding it... :oops:
Expedition Leader
Bananas received 25
Posts: 1134
Joined: 2008

Re: DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Postby Simion32 » October 1st, 2008, 8:59 am

Kiddy14 wrote:The colors are assigned upon loading. (...) So the game stores where to put the colors in a palette table list?
Yes; let me clarify... the graphics are made up of numbers instead of real color values, and when putting something onscreen it looks up the colors for each image from palettes. Each number in the graphics represents a color from the palette. I hope you can understand that, I tried not to get too technical. ;)
Kiddy14 wrote:My question, now, is if that's how the Orang-utan Gang and Torchlight Trouble effects work... they use pallets or transparent layers? O.o
Well, first an original set of colors is loaded from a palette. Then the game "darkens" the colors in the palette to make the environments appear darker. In the case of torchlight trouble, It's just a fancy layering effect.

Remember, the SNES cannot do true alpha transparency - it can only combine/darken/brighten colors from layers (sprites have their own layer). SNES transparency is the effect of two layers being combined.
Kiddy14 wrote:So you told me there must be some code for the animation speed. I may think the sprites have a low animation speed that Rare customized and made the Kongs' animation speed faster depending on it (...) so I'd like you to not find that "code" unless it is your next thing in the list or you are already finding it...
I think I may already have the code for it, but I'm not sure.

What the game does, is it has a number of frames that each sprite lasts in an animation. The number of frames can be from 00-7F. Then when the game is running, it compares this relative to some variable speed (such as how fast DK is moving) to get the final animation speed.
Sage of Discovery
Bananas received 254
Posts: 2659
Joined: 2008

Re: DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Postby Kiddy14 » October 1st, 2008, 1:50 pm

Simion32 wrote:Each number in the graphics represents a color from the palette.

So I was kind of in the correct way =P yay! xD
Simion32 wrote:Well, first an original set of colors is loaded from a palette. Then the game "darkens" the colors in the palette to make the environments appear darker.

So that's why the game lags in this transition. But the effect is progressive; does that mean the game manually changes the palette in a smooth way, like changing the colors until they match the last palette; or are there kind of 30 palettes for the progressive light effect?
Simion32 wrote:Then when the game is running, it compares this relative to some variable speed (such as how fast DK is moving) to get the final animation speed.

Snow is different right? Donkey moves faster here and Diddy slower.
Expedition Leader
Bananas received 25
Posts: 1134
Joined: 2008

Re: DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Postby Simion32 » October 26th, 2008, 3:58 am

Banana Group Map Format: XX YY SB...
XX = Number of columns
YY = Number of rows
SB... = Banana Slot Bits. There is one byte for every 8 banana slots. The bits (slots) are read from least to most significant in each byte until each slot in the grid has been read. A 1 means that a banana is there, 0 if there isn't one in that slot. Also: the bananas are placed in columns from bottom to top... then it proceeds to the column to the right of that column and places bananas there, and so forth.

For example, 04 04 FF EE would form a banana group like this:
bananahack0.PNG
Hacked banana formation with slot data FF EE.
bananahack0.PNG (1.03 KiB) Viewed 25743 times
Sage of Discovery
Bananas received 254
Posts: 2659
Joined: 2008


Re: DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Postby Simion32 » October 26th, 2008, 1:23 pm

Just multiply the columns by the rows to get the total number of bits that will be used. Then just divide by 8 to find out how may bytes you'll need to store all of the bits.

Another example: 03 03 FF 01 would create a 3x3 square of bananas; the seven empty bits in the last byte won't be used.
Sage of Discovery
Bananas received 254
Posts: 2659
Joined: 2008

Re: DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Postby Raccoon Sam » October 28th, 2008, 4:35 am

Guess it's a minor contribution, but Gnawty Bosses' health is at 0x35F897
Trailblazer
Bananas received 35
Posts: 265
Joined: 2008

Re: DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Postby Mattrizzle » July 29th, 2010, 12:38 am

Hefty bump, but it is my own topic:

3F8177-3F835A Primary behavior code pointers (0x00-0x78; paged by $0D45 x4)
bytes 1-2: pointer
bytes 3-4: unknown

3FF180-3FF2A1 Movement behavior code pointers (0x00-0x71; paged by $152D x2)
A large amount of values are unused here, which could be useful for making custom movement code!

Game mode subroutine locations:
Spoiler!
BA2C?-???? Rareware/Nintendo Presents
C9B4-CF2C Intro sequence
D4C5-D5C0 Title Screen (Subsequent playthroughs)
DE7B-DF7D Game Over screen
DF7E-E164 Player Selection for new game
E165-???? Map Screen
E1F8-???? Enter Level
E9E8-???? This game pak is not designed for use on your Super Famicom/Super NES. Use of this adaptor may result in serious damage to your console.
EA04-???? <Data Error> This game pak is not designed for use with a video game modifyer (sic)(Unused?)
EA20-???? This product will not operate when connected to a device which makes unauthorized copies. Please refer to your instruction booklet for further information. (Unused?)
EAA6-EFDB Cranky's Cabin
EFDC-F276 Candy's Save Point
F277-F350 © 1994 Nintendo screen
F351-F422 Title Screen (Initial playthrough)
F423-F707 Funky's Flights
F70E-FBBE Select a Game menu
FBBF-FCBC Language Select (UNUSED)


List of "empty" space padded with unused/duplicate data:
Spoiler!
007A21-007FFF (0x5DF bytes)
0174BA-017FFF (0xB46 bytes)
01F3E8-01FFFF (0xC18 bytes)
02F7ED-02FFFF (0x813 bytes)
04FDC2-04FFFF (0x23E bytes)
0A6C50-0A7FFF (0x13B0 bytes)
10E87C-10FFFF (0x1784 bytes)
13E1A9-13FFFF (0x1E57 bytes)
17FA3C-17FFFF (0x5C4 bytes)
18EED0-18FFFF (0x1130 bytes)
1CE9E0-1CFFFF (0x1620 bytes)
1DEC90-1DFFFF (0x1370 bytes)
1FE186-1FFFFF (0x1E7A bytes)
21E8A7-21FFFF (0x1759 bytes)
22E58F-22FFFF (0x1A71 bytes)
24EC4F-24FFFF (0x13B1 bytes)
25F23B-25FFFF (0xDC5 bytes)
280000-28047F (0x480 bytes) Language Select Screen (Tilemap)
280480-280EBF (0xA40 bytes) Language Select Screen (Graphics)
280EE6-282465 (0x1580 bytes) Jungle foreground trees (Graphics)
282466-282665 (0x200 bytes) Jungle foreground trees (Tilemap)
282666-287A49 (0x53E4 bytes) 30 unused D.K. sprites
28E5B8-28FFFF (0x1A48 bytes)
29E2CC-29FFFF (0x1D34 bytes)
2BE1B4-2BFFFF (0x1E4C bytes)
2DE076-2DFFFF (0x1F8A bytes)
31EAE5-31FFFF (0x151B bytes)
32F152-32FFFF (0xEAE bytes)
33F908-33FFFF (0x6F8 bytes)
357D92-357FFF (0x26E bytes)
35FE0B-35FFFF (0x1F5 bytes) End of object code bank
38A17E-38A1E1 (0x64 bytes) German level name pointers--unused in U v1.0
38A246-38A507 (0x2C2 bytes) German level names--unused in U v1.0
39FF65-39FFFF (0x9A bytes)
3AE09F-3AFFFF (0x1F61 bytes)
3BB154-3BC7FF (0x16AC bytes)
3BF790-3BFFFF (0x870 bytes) End of sprite pointer bank--could be utilized for additional sprite pointers (five hundred and forty more, but only 323 can be used due to hitbox pointers)
3C35CA-3C5839 (0x2270 bytes) German dialogue text--unused in U v1.0
3C5C4D-3C7FFF (0x23B3 bytes)
3CFB4B-3CFFFF (0x4B5 bytes)
3D72D0-3D7FFF (0xD30 bytes)
3DFFDC-3DFFFF (0x24 bytes)
3F6261-3F7FFF (0x1739 bytes)
Treasure Hunter
Bananas received 171
Posts: 390
Joined: 2008

Re: DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.)

Postby Simion32 » July 29th, 2010, 4:52 am

Great finds Mattrizzle!

Needless to say you're a major contributor to the Delta Project. You'll definitely be near the top of the credits list for all of the great research you've done. :geek:
Sage of Discovery
Bananas received 254
Posts: 2659
Joined: 2008

Re: DKC ROM Offsets (Sprite Tilemap/Animation Routines, etc.

Postby Simion32 » August 15th, 2010, 5:28 am

List of all Main Levels...

BY LEVEL / WORLD:
Spoiler!
Name | Size | Location
-------------------------------X--------X---------
Level 1-1 Jungle Hijinxs | 0x1500 | 0x190000 Kongo Jungle
Level 1-2 Ropey Rampage | 0x2080 | 0x191700
Level 1-3 Reptile Rumble | 0x1A00 | 0x1A0100
Level 1-4 Coral Capers | 0x1C80 | 0x298C80
Level 1-5 Barrel Cannon Canyon | 0x29E0 | 0x196360
-------------------------------X--------X--------------------------
Level 2-1 Winky's Walkway | 0x13C0 | 0x0BCC80 Monkey Mines
Level 2-2 Mine Cart Carnage | 0x4900 | 0x260D88
Mine Cart Carnage BG2| 0x4900 | 0x265688
Level 2-3 Bouncy Bonanza | 0x2480 | 0x1A1B00
Level 2-4 Stop & Go Station | 0x2680 | 0x1B3A4C
Level 2-5 Millstone Mayhem | 0x2C00 | 0x2C1F28
-------------------------------X--------X--------------------------
Level 3-1 Vulture Culture | 0x2A00 | 0x036400 Vine Valley
Level 3-2 Tree Top Town | 0x2900 | 0x030000
Level 3-3 Forest Frenzy | 0x2900 | 0x039200
Level 3-4 Temple Tempest | 0x3200 | 0x2C4B28
Level 3-5 Orang-utan Gang | 0x25E0 | 0x193780
Level 3-6 Clam City | 0x1900 | 0x29AA00
-------------------------------X--------X--------------------------
Level 4-1 Snow Barrel Blast | 0x36E0 | 0x203836 Gorilla Glacier
Level 4-2 Slipslide Ride | 0x2E00 | 0x2105E5
Level 4-3 Ice Age Alley | 0x29A0 | 0x207836
Level 4-4 Croctopus Chase | 0x4480 | 0x293080
Level 4-5 Torchlight Trouble | 0x1500 | 0x1A7100
Level 4-6 Rope Bridge Rumble | 0x2300 | 0x032B00
-------------------------------X--------X--------------------------
Level 5-1 Oil Drum Alley | 0x2D60 | 0x220200 Kremcroc Industries, Inc.
Level 5-2 Trick Track Trek | 0x2E00 | 0x0B6B80
Level 5-3 Elevator Antics | 0x2900 | 0x1A8600
Level 5-4 Poison Pond | 0x3080 | 0x290000
Level 5-5 Mine Cart Madness | 0x3A00 | 0x0B0000
Level 5-6 Blackout Basement | 0x2900 | 0x222F60
-------------------------------X--------X--------------------------
Level 6-1 Tanked Up Trouble | 0x3000 | 0x0B9980 Chimp Caverns
Level 6-2 Manic Mincers | 0x2880 | 0x1A4080
Level 6-3 Misty Mine | 0x3180 | 0x1B08CC
Level 6-4 Loopy Lights | 0x2F00 | 0x1B67CC
Level 6-5 Platform Perils | 0x3080 | 0x0B3B00
-------------------------------X--------X--------------------------
Boss Lairs | 0x0200 | 0x03EDA0 Boss Levels
Final Boss | 0x0200 | 0x230000

BY DATA SIZE:
Spoiler!
Name | Size | Location
-------------------------------X--------X---------
Level 2-2 Mine Cart Carnage | 0x4900 | 0x260D88 Huge $4000+
Mine Cart Carnage BG2| 0x4900 | 0x265688
Level 4-4 Croctopus Chase | 0x4480 | 0x293080
-------------------------------X--------X--------------------------
Level 5-5 Mine Cart Madness | 0x3A00 | 0x0B0000 Large $3000+
Level 4-1 Snow Barrel Blast | 0x36E0 | 0x203836
Level 3-4 Temple Tempest | 0x3200 | 0x2C4B28
Level 6-3 Misty Mine | 0x3180 | 0x1B08CC
Level 5-4 Poison Pond | 0x3080 | 0x290000
Level 6-5 Platform Perils | 0x3080 | 0x0B3B00
Level 6-1 Tanked Up Trouble | 0x3000 | 0x0B9980
-------------------------------X--------X--------------------------
Level 6-4 Loopy Lights | 0x2F00 | 0x1B67CC Average $2000+
Level 4-2 Slipslide Ride | 0x2E00 | 0x2105E5
Level 5-2 Trick Track Trek | 0x2E00 | 0x0B6B80
Level 5-1 Oil Drum Alley | 0x2D60 | 0x220200
Level 2-5 Millstone Mayhem | 0x2C00 | 0x2C1F28
Level 3-1 Vulture Culture | 0x2A00 | 0x036400
Level 1-5 Barrel Cannon Canyon | 0x29E0 | 0x196360
Level 4-3 Ice Age Alley | 0x29A0 | 0x207836
Level 3-2 Tree Top Town | 0x2900 | 0x030000
Level 3-3 Forest Frenzy | 0x2900 | 0x039200
Level 5-3 Elevator Antics | 0x2900 | 0x1A8600
Level 5-6 Blackout Basement | 0x2900 | 0x222F60
Level 6-2 Manic Mincers | 0x2880 | 0x1A4080
Level 2-4 Stop & Go Station | 0x2680 | 0x1B3A4C
Level 3-5 Orang-utan Gang | 0x25E0 | 0x193780
Level 2-3 Bouncy Bonanza | 0x2480 | 0x1A1B00
Level 4-6 Rope Bridge Rumble | 0x2300 | 0x032B00
Level 1-2 Ropey Rampage | 0x2080 | 0x191700
-------------------------------X--------X--------------------------
Level 1-4 Coral Capers | 0x1C80 | 0x298C80 Small $1000+
Level 1-3 Reptile Rumble | 0x1A00 | 0x1A0100
Level 3-6 Clam City | 0x1900 | 0x29AA00
Level 1-1 Jungle Hijinxs | 0x1500 | 0x190000
Level 4-5 Torchlight Trouble | 0x1500 | 0x1A7100
Level 2-1 Winky's Walkway | 0x13C0 | 0x0BCC80
-------------------------------X--------X--------------------------
Boss Lairs | 0x0200 | 0x03EDA0 Tiny $0000+
Final Boss | 0x0200 | 0x230000

BY ROM-OFFSET / ARCHETYPE:
Spoiler!
Name | Size | Location
-------------------------------X--------X---------
Level 3-2 Tree Top Town | 0x2900 | 0x030000 Treetowns
Level 4-6 Rope Bridge Rumble | 0x2300 | 0x032B00
-------------------------------X--------X--------------------------
Level 3-1 Vulture Culture | 0x2A00 | 0x036400 Forests
Level 3-3 Forest Frenzy | 0x2900 | 0x039200
-------------------------------X--------X--------------------------
Boss Lairs | 0x0200 | 0x03EDA0 Bosses
-------------------------------X--------X--------------------------
Level 5-5 Mine Cart Madness | 0x3A00 | 0x0B0000 Walkways
Level 6-5 Platform Perils | 0x3080 | 0x0B3B00
Level 5-2 Trick Track Trek | 0x2E00 | 0x0B6B80
Level 6-1 Tanked Up Trouble | 0x3000 | 0x0B9980
Level 2-1 Winky's Walkway | 0x13C0 | 0x0BCC80
-------------------------------X--------X--------------------------
Level 1-1 Jungle Hijinxs | 0x1500 | 0x190000 Jungles
Level 1-2 Ropey Rampage | 0x2080 | 0x191700
Level 3-5 Orang-utan Gang | 0x25E0 | 0x193780
Level 1-5 Barrel Cannon Canyon | 0x29E0 | 0x196360
-------------------------------X--------X--------------------------
Level 1-3 Reptile Rumble | 0x1A00 | 0x1A0100 Caves
Level 2-3 Bouncy Bonanza | 0x2480 | 0x1A1B00
Level 6-2 Manic Mincers | 0x2880 | 0x1A4080
Level 4-5 Torchlight Trouble | 0x1500 | 0x1A7100
Level 5-3 Elevator Antics | 0x2900 | 0x1A8600
-------------------------------X--------X--------------------------
Level 6-3 Misty Mine | 0x3180 | 0x1B08CC Mines
Level 2-4 Stop & Go Station | 0x2680 | 0x1B3A4C
Level 6-4 Loopy Lights | 0x2F00 | 0x1B67CC
-------------------------------X--------X--------------------------
Level 4-1 Snow Barrel Blast | 0x36E0 | 0x203836 Glaciers
Level 4-3 Ice Age Alley | 0x29A0 | 0x207836
-------------------------------X--------X--------------------------
Level 4-2 Slipslide Ride | 0x2E00 | 0x2105E5 Crystal Caves
-------------------------------X--------X--------------------------
Level 5-1 Oil Drum Alley | 0x2D60 | 0x220200 Factories
Level 5-6 Blackout Basement | 0x2900 | 0x222F60
-------------------------------X--------X--------------------------
Final Boss | 0x0200 | 0x230000 King K. Rool
-------------------------------X--------X--------------------------
Level 2-2 Mine Cart Carnage | 0x4900 | 0x260D88 Mine Carts
Mine Cart Carnage BG2| 0x4900 | 0x265688
-------------------------------X--------X--------------------------
Level 5-4 Poison Pond | 0x3080 | 0x290000 Corals
Level 4-4 Croctopus Chase | 0x4480 | 0x293080
Level 1-4 Coral Capers | 0x1C80 | 0x298C80
Level 3-6 Clam City | 0x1900 | 0x29AA00
-------------------------------X--------X--------------------------
Level 2-5 Millstone Mayhem | 0x2C00 | 0x2C1F28 Temples
Level 3-4 Temple Tempest | 0x3200 | 0x2C4B28
Sage of Discovery
Bananas received 254
Posts: 2659
Joined: 2008

Re: DKC Beta Hack

Postby Mattrizzle » September 10th, 2011, 4:25 pm

Simion32 says: I moved this valuable post here for future reference before another topic's deletion.

Markster wrote:1. The jumping kritters are green.
There happen to be 2 unused green jumping Kritter objects:
99A9 Kritter (green, constant movement, jumps very high)
99E7 Kritter (green, constant movement, jumps very low)

2. There is a night verion of Jungle Hijinx.
How are you sure they didn't just backtrack through the level after it turned to night?

5. Donkey kong can't kill Klump's by jumping on them.
3FA7F8 [A3] Change to 0A to make Klumps invulnerable to Donkey Kong's stomp

10. You can collect more than 100 bananas.
A362 [63 00] Maximum value the banana counter can get to before resetting to 00 - Change to E7 03 to make the maximum 999
A36B [64 00] Value to subtract from the banana counter when the value at the offset above is exceeded - Change to E8 03
These have just one problem: You won't get an extra life until you collect 1000 bananas!

11. Donkey kong can't kill blue krushas by jumping on there head.
3FA802 [99] Change to 00 to make Blue Krushas invulnerable to Donkey Kong's stomp
Treasure Hunter
Bananas received 171
Posts: 390
Joined: 2008


Return to Documentation

Who is online

Users browsing this forum: No registered users and 1 guest

cron