Reworked lua script making it easier to configure certain things

Some SPC documnetation
More logo documnetation
Fixed decompilation error in bank B3
This commit is contained in:
p4plus2 2017-10-26 14:04:04 -07:00
parent 797a16ffc4
commit 233cdc8882
9 changed files with 465 additions and 466 deletions

214
DKC2.lua
View file

@ -1,3 +1,5 @@
getmetatable('').__index = function(str, i) return string.sub(str, i, i) end
local function remove(data, value) local function remove(data, value)
data = table.remove(data, value) data = table.remove(data, value)
if type(data) == "nil" then if type(data) == "nil" then
@ -6,6 +8,48 @@ local function remove(data, value)
return data return data
end end
local function parse_line(line)
local result = {}
local pos = string.find(line, '%g') or (string.len(line) + 1)
while line[pos] ~= "" do
if (line[pos] == '"') then
local start_pos, end_pos = string.find(line, '%b""', pos)
table.insert(result, string.sub(line, start_pos + 1, end_pos - 1))
pos = end_pos + 2
else
local found_at = string.find(line, ',', pos)
table.insert(result, string.sub(line, pos, found_at and (found_at - 1) or -1))
pos = (found_at and found_at or string.len(line)) + 1
end
pos = string.find(line, '%g', pos) or (string.len(line) + 1)
end
return result
end
local function load_csv(path)
local file = io.open(path, "rb")
local csv = {}
if file then
for line in io.lines(path) do
table.insert(csv, parse_line(line))
end
file:close()
end
return csv;
end
local function list_to_map(list)
local map = {}
for index, entry in ipairs(list) do
map[tonumber(entry[1])] = entry[2]
end
return map
end
local function write_long(value, offset) local function write_long(value, offset)
memory2.WRAM:write(bit.band(value, 0xFF), offset) memory2.WRAM:write(bit.band(value, 0xFF), offset)
memory2.WRAM:write(bit.band(bit.lrshift(value, 8), 0xFF), offset+1) memory2.WRAM:write(bit.band(bit.lrshift(value, 8), 0xFF), offset+1)
@ -143,6 +187,13 @@ local x_padding = -400
local y_padding = 0 local y_padding = 0
local context = gui.renderctx.new(256, 224) local context = gui.renderctx.new(256, 224)
--config files
local sound_effects_path = "sound_effects.txt"
local musics_path = "music.txt"
local sprites_path = "sprites.txt"
local ram_watch_path = "ram_watch.txt"
local exec_watch_path = "exec_watch.txt"
--Add transparency to a color with default opacity --Add transparency to a color with default opacity
local function trans(color) local function trans(color)
return color + (opacity * 0x1000000) return color + (opacity * 0x1000000)
@ -221,11 +272,17 @@ local function toggle_layer(layer)
bsnes.enablelayer(layer, 1, layer_state[layer]) bsnes.enablelayer(layer, 1, layer_state[layer])
end end
local sprites_list = load_csv(sprites_path)
local sprites_map = list_to_map(sprites_list)
local sprite_table = 0x0DE2 local sprite_table = 0x0DE2
local sprite_routine_list = to_pc(0xB38348)
local function display_sprite() local function display_sprite()
local sprite_slot = clamp(slot, 0, 23) local sprite_slot = clamp(slot, 0, 23)
local slot_offset = sprite_table + sprite_slot * 0x5E local slot_offset = sprite_table + sprite_slot * 0x5E
local sprite_string = "Slot number (0x%04X): %d\n" .. local sprite_string = "Slot number (0x%04X): %d\n" ..
"Sprite: %s\n" ..
"Sprite routine: $B3%04X\n" ..
"Sprite number(0x00): %04X\n" .. "Sprite number(0x00): %04X\n" ..
"Render order(0x02): %04X\n" .. "Render order(0x02): %04X\n" ..
"Position(0x04/0x08): (%04X.%04X, %04X.%04X)\n" .. "Position(0x04/0x08): (%04X.%04X, %04X.%04X)\n" ..
@ -248,8 +305,11 @@ local function display_sprite()
"Spawn code(0x58):%04X\n" .. "Spawn code(0x58):%04X\n" ..
"Unknown data(0x5A):\n%s\n" "Unknown data(0x5A):\n%s\n"
sprite_name = sprites_map[read_word(slot_offset)] or "UNKNOWN"
text(0, 0, string.format(sprite_string, text(0, 0, string.format(sprite_string,
slot_offset, sprite_slot, --current slot slot_offset, sprite_slot, --current slot
sprite_name, --sprite name
read_rom_word(sprite_routine_list + read_word(slot_offset)), --sprite routine
read_word(slot_offset), --Sprite number read_word(slot_offset), --Sprite number
read_word(slot_offset+0x02), --Render order read_word(slot_offset+0x02), --Render order
read_word(slot_offset+0x06), read_word(slot_offset+0x04), --X position read_word(slot_offset+0x06), read_word(slot_offset+0x04), --X position
@ -257,7 +317,7 @@ local function display_sprite()
read_word(slot_offset+0x0C), --Potential ground height (7F00 == no ground) read_word(slot_offset+0x0C), --Potential ground height (7F00 == no ground)
read_word(slot_offset+0x0E), --Potential ground distance (80xx == no ground) read_word(slot_offset+0x0E), --Potential ground distance (80xx == no ground)
read_word(slot_offset+0x010), --Interaction type, dictates movements relative to blocks read_word(slot_offset+0x010), --Interaction type, dictates movements relative to blocks
read_word(slot_offset+0x012), --YXPPCCCCT TTTTTTTT properties read_word(slot_offset+0x012), --YXPPCCCT TTTTTTTT properties
read_word(slot_offset+0x014), --Unknown read_word(slot_offset+0x014), --Unknown
read_word(slot_offset+0x16), --Sprite frame copy 1 read_word(slot_offset+0x16), --Sprite frame copy 1
read_word(slot_offset+0x18), --Sprite frame copy 2 read_word(slot_offset+0x18), --Sprite frame copy 2
@ -277,130 +337,11 @@ local function display_sprite()
)) ))
end end
local sound_effect_map = { local musics_list = load_csv(musics_path)
"0x00 -- Nothing", local musics_map = list_to_map(musics_list)
"0x01 -- Nothing?",
"0x02 -- Klomp walking", local sound_effect_list = load_csv(sound_effects_path)
"0x03 -- Monkey sound (unused)", local sound_effect_map = list_to_map(sound_effect_list)
"0x04 -- Spin/cartwheel into enemy",
"0x05 -- Switch Kongs",
"0x06 -- Diddy hurt/lost",
"0x07 -- Dixie hurt/lost",
"0x08 -- Collect bananna",
"0x09 -- Collect something (unused)",
"0x0A -- Diddy loses life",
"0x0B -- Rambi charging",
"0x0C -- Something breaking (investigate)",
"0x0D -- Zinger like sound (investigate)",
"0x0E -- Zinger killed",
"0x0F -- Klick-Klack walking",
"0x10 -- Klick-Klack splat",
"0x11 -- Klobber skidding",
"0x12 -- Klobber waking up",
"0x13 -- Quiet sound (investigate)",
"0x14 -- Explosion of some sort (investigate)",
"0x15 -- Kannon shooting",
"0x16 -- Klampon eating player",
"0x17 -- Klampon snapping jaw while walking",
"0x18 -- Jump on kroc type enemy",
"0x19 -- Blow open bonus wall (investigate)",
"0x1A -- Shoot from cannon",
"0x1B -- Kong in barrel",
"0x1C -- Count down in bonus game",
"0x1D -- Rattly jump",
"0x1E -- More monkey sounds (unused?)",
"0x1F -- Klinger sliding down",
"0x20 -- Dixie loses life",
"0x21 -- Blowing sound (unused?)",
"0x22 -- Reveal token (unused?)",
"0x23 -- Diddy juggling",
"0x24 -- Neek squeak",
"0x25 -- Blowing gum variant (unused?)",
"0x26 -- Dixie blowing gum",
"0x27 -- Collect kong letter pitch 1",
"0x28 -- Collect kong letter pitch 2",
"0x29 -- Collect kong letter pitch 3",
"0x2A -- Collect kong letter pitch 4",
"0x2B -- Lose life/ballon pop",
"0x2C -- Gain life",
"0x2D -- Collect coin",
"0x2E -- K. Rool message",
"0x2F -- Squawks attack",
"0x30 -- Squawks flapping 1",
"0x31 -- Squawks flapping 2",
"0x32 -- Necky attacking",
"0x33 -- Menu move",
"0x34 -- Menu select",
"0x35 -- Reveal token",
"0x36 -- Collect token",
"0x37 -- Klick Klack flipping over",
"0x38 -- Collect life",
"0x39 -- Krow ghost exploding twinkle",
"0x3A -- Krow ghost exploding",
"0x3B -- Zinger sound (unused?)",
"0x3C -- Zinger sound higher pitch(unused?)",
"0x3D -- Zinger buzzing",
"0x3E -- Increase tempo/stop buzzing",
"0x3F -- Flitter buzzing",
"0x40 -- Team up",
"0x41 -- Animal buddy destoryed by sign (used with 0x42, 0x43, 0x44)",
"0x42 -- Animal buddy destoryed by sign (used with 0x41, 0x43, 0x44)",
"0x43 -- Animal buddy destoryed by sign (used with 0x41, 0x42, 0x44)",
"0x44 -- Animal buddy destoryed by sign (used with 0x41, 0x42, 0x43)",
"0x45 -- Rattly hurt",
"0x46 -- Squitter shoot web",
"0x47 -- Squitter shooting platform",
"0x48 -- Rattly idle jump",
"0x49 -- Rattly high jump",
"0x4A -- Load cannon ball into cannon",
"0x4B -- Shoot cannon (From Kannon)",
"0x4C -- Cannon ball falling from sky",
"0x4D -- Squitter jump (investigate)",
"0x4E -- Spiny walking",
"0x4F -- Squawks hurt",
"0x50 -- Invincible",
"0x51 -- Hit Kruncha",
"0x52 -- Rolling barrel",
"0x53 -- Rambi headbutt",
"0x54 -- Rambi trample",
"0x55 -- Animal transformation sound (semi unused)",
"0x56 -- Collect DK coin",
"0x57 -- Necky dying",
"0x58 -- Cat-O-9-Tails hurt",
"0x59 -- Kudgel hurt",
"0x5A -- K. Rool passing out",
"0x5B -- K. Rool falling into water",
"0x5C -- K. Rool falling into water (unused?)",
"0x5D -- Krook jumped on",
"0x5E -- Pause/unpause game",
"0x5F -- Wrong/invalid selection",
"0x60 -- Egg cracking sound",
"0x61 -- Krow flapping",
"0x62 -- Jumping in and out of water, or krow getting hit",
"0x63 -- Clapper arf",
"0x64 -- Krow grabbing egg",
"0x65 -- Enguard jab, or egg falling",
"0x66 -- Lost Enguard, Kleaver hooks",
"0x67 -- Time running out in bonus",
"0x68 -- Ambient in water",
"0x69 -- Puft up inflating, Kleaver sinking",
"0x6A -- Puft up exploding, Kleaver sinking 2",
"0x6B -- Swimming, Kleaver vibrating, Race count down",
"0x6C -- Shuri spinning, Kleaver boiling, Race go",
"0x6D -- Clapper clap",
"0x6E -- Jump on green kroc head/Klapper blowing",
"0x6F -- Jump on brown kroc head",
"0x70 -- Crashing mixed with DK (unused?)",
"0x71 -- Deeper rambi head butt (unused?)",
"0x72 -- Quieter monkey sound (unused?)",
"0x73 -- Engaurd-like jab (unused?)",
"0x74 -- Monkey sound (unused?)",
"0x75 -- Weird monkey echo (Unused?)",
"0x76 -- quieter monkey sound (unused?)",
"0x77 -- Unknown",
"0x78 -- Scared by boss",
"0x79 -- Caw of Krow"
}
local sound_index = 0x0632 local sound_index = 0x0632
local sound_buffer = 0x0622 local sound_buffer = 0x0622
@ -454,7 +395,7 @@ local function display_sound()
"sfx E(0x0E): %02X\n" .. "sfx E(0x0E): %02X\n" ..
"sfx F(0x0F): %02X\n\n" .. "sfx F(0x0F): %02X\n\n" ..
"SPC transfer id 0x%02X\n" .. "SPC transfer id 0x%02X\n" ..
"Current song 0x%04X\n" .. "Current song 0x%04X (%s)\n" ..
"Mono/Stereo 0x%02X\n\n" .. "Mono/Stereo 0x%02X\n\n" ..
"Play sound effect: %s\n" "Play sound effect: %s\n"
@ -486,8 +427,9 @@ local function display_sound()
read_byte(effect_buffer+0x0F), read_byte(effect_buffer+0x0F),
read_byte(spc_transfer_id), read_byte(spc_transfer_id),
read_byte(current_song), read_byte(current_song),
musics_map[read_byte(current_song)],
read_byte(stereo_flag), read_byte(stereo_flag),
sound_effect_map[sound_effect+1] sound_effect_map[sound_effect]
)) ))
end end
@ -575,7 +517,7 @@ local function display_level()
"$0515 (0x00) Header: 0x%04X\n" .. "$0515 (0x00) Header: 0x%04X\n" ..
"$0517 (0x02): 0x%04X\n" .. "$0517 (0x02): 0x%04X\n" ..
"$0519 (0x04): 0x%04X\n" .. "$0519 (0x04): 0x%04X\n" ..
"$051B (0x06): 0x%04X\n" .. "$051B (0x06): Music id 0x%04X\n" ..
"$051D (0x08): 0x%04X\n" .. "$051D (0x08): 0x%04X\n" ..
"$051F (0x0A): 0x%04X\n" .. "$051F (0x0A): 0x%04X\n" ..
"$0521 (0x0C): 0x%04X\n" .. "$0521 (0x0C): 0x%04X\n" ..
@ -640,12 +582,18 @@ local function display_level()
end end
local watched_addresses = {} local watched_addresses = {}
local exec_watched_addresses = {}
local exec_watched_count = {}
local function display_watch() local function display_watch()
local watch_string = "" local watch_string = ""
for address, read_callback in pairs(watched_addresses) do for address, read_callback in pairs(watched_addresses) do
watch_string = watch_string .. read_callback() watch_string = watch_string .. read_callback()
end end
watch_string = watch_string .. "\n\n"
for address, read_callback in pairs(exec_watched_addresses) do
watch_string = watch_string .. read_callback()
end
text(0, 0, watch_string) text(0, 0, watch_string)
end end
@ -869,6 +817,16 @@ function delete_watch(address)
watched_addresses = remove(watched_addresses, address) watched_addresses = remove(watched_addresses, address)
end end
function add_exec_watch(name, address)
exec_watched_addresses[address] = function() return string.format(name .. ": %02X\n", exec_watched_count[address]) end
exec_watched_count[address] = 0
memory2.ROM:registerexec(to_pc(address), function() exec_watched_count[address] = exec_watched_count[address] + 1 end)
end
function delete_exec_watch(address)
exec_watched_addresses = remove(exec_watched_addresses, address)
end
--I personally don't want to use these in actual code for clarity reasons --I personally don't want to use these in actual code for clarity reasons
--but on the fly I do want to type a lot less --but on the fly I do want to type a lot less

View file

@ -1814,13 +1814,13 @@ init_rareware_logo:
STA $211A ;$809195 |/ STA $211A ;$809195 |/
REP #$20 ;$809198 | REP #$20 ;$809198 |
LDA #$7400 ;$80919A |\ Clear $800 of VRAM at $E800 LDA #$7400 ;$80919A |\ Clear $800 of VRAM at $E800
JSR CODE_80B109 ;$80919D |/ JSR clear_VRAM_block ;$80919D |/
LDA #$7000 ;$8091A0 |\ Clear $800 of VRAM at $E000 LDA #$7000 ;$8091A0 |\ Clear $800 of VRAM at $E000
JSR CODE_80B109 ;$8091A3 |/ JSR clear_VRAM_block ;$8091A3 |/
LDA #$7800 ;$8091A6 |\ Clear $800 of VRAM at $F000 LDA #$7800 ;$8091A6 |\ Clear $800 of VRAM at $F000
JSR CODE_80B109 ;$8091A9 |/ JSR clear_VRAM_block ;$8091A9 |/
LDA #$7C00 ;$8091AC |\ Clear $800 of VRAM at $F800 LDA #$7C00 ;$8091AC |\ Clear $800 of VRAM at $F800
JSR CODE_80B109 ;$8091AF |/ JSR clear_VRAM_block ;$8091AF |/
LDX #DATA_F52FC7 ;$8091B2 |\ Load pointer to Nintendo presents layer 1 tilemap LDX #DATA_F52FC7 ;$8091B2 |\ Load pointer to Nintendo presents layer 1 tilemap
LDY.w #DATA_F52FC7>>16 ;$8091B5 | | LDY.w #DATA_F52FC7>>16 ;$8091B5 | |
LDA #$0000 ;$8091B8 | | LDA #$0000 ;$8091B8 | |
@ -2035,7 +2035,7 @@ run_rareware_logo: ; \
LDX #$007F ;$809423 |\ Upload $1440 bytes from $7F0500 to VRAM address $8000 LDX #$007F ;$809423 |\ Upload $1440 bytes from $7F0500 to VRAM address $8000
LDA #$0500 ;$809426 | | The first half of tiledata for the Nintendo Presents LDA #$0500 ;$809426 | | The first half of tiledata for the Nintendo Presents
LDY #$1440 ;$809429 | | LDY #$1440 ;$809429 | |
JSL DMA_to_VRAM ;$80942C |/ JSL DMA_to_VRAM ;$80942C |/ DMA the payload
CODE_809430: ; | CODE_809430: ; |
LDA $2A ;$809430 |\ If the frame count is not exactly $0111 LDA $2A ;$809430 |\ If the frame count is not exactly $0111
CMP #$0111 ;$809432 | | CMP #$0111 ;$809432 | |
@ -2045,7 +2045,7 @@ CODE_809430: ; |
LDX #$007F ;$80943D |\ Upload $1440 bytes from $7F1940 to VRAM address $9440 LDX #$007F ;$80943D |\ Upload $1440 bytes from $7F1940 to VRAM address $9440
LDA #$1940 ;$809440 | | The second half of tiledata for the Nintendo Presents LDA #$1940 ;$809440 | | The second half of tiledata for the Nintendo Presents
LDY #$1440 ;$809443 | | LDY #$1440 ;$809443 | |
JSL DMA_to_VRAM ;$809446 |/ JSL DMA_to_VRAM ;$809446 |/ DMA the payload
LDA #$0000 ;$80944A | LDA #$0000 ;$80944A |
LDX #$001E ;$80944D | Number of bytes to clear minus 2 LDX #$001E ;$80944D | Number of bytes to clear minus 2
.clear_palette ; | .clear_palette ; |
@ -2108,10 +2108,10 @@ CODE_8094CF: ; |
STA $7A ;$8094DA | STA $7A ;$8094DA |
CODE_8094DC: ; | CODE_8094DC: ; |
JSR CODE_80B061 ;$8094DC | JSR CODE_80B061 ;$8094DC |
INC $2A ;$8094DF | INC $2A ;$8094DF | Increment the frame counter
LDA $2A ;$8094E1 | LDA $2A ;$8094E1 |\ Check if this is the first frame of the logo
CMP #$0001 ;$8094E3 | CMP #$0001 ;$8094E3 | |
BNE CODE_8094EC ;$8094E6 | BNE CODE_8094EC ;$8094E6 |/
JSL CODE_B58009 ;$8094E8 | JSL CODE_B58009 ;$8094E8 |
CODE_8094EC: ; | CODE_8094EC: ; |
LDA $2A ;$8094EC | LDA $2A ;$8094EC |
@ -2610,9 +2610,9 @@ CODE_8097EB: ; |
LDY #$0800 ;$809912 | LDY #$0800 ;$809912 |
JSL DMA_to_VRAM ;$809915 | JSL DMA_to_VRAM ;$809915 |
LDA #$7400 ;$809919 | LDA #$7400 ;$809919 |
JSR CODE_80B109 ;$80991C | JSR clear_VRAM_block ;$80991C |
LDA #$7800 ;$80991F | LDA #$7800 ;$80991F |
JSR CODE_80B109 ;$809922 | JSR clear_VRAM_block ;$809922 |
LDX #DATA_EC4749 ;$809925 | LDX #DATA_EC4749 ;$809925 |
LDY.w #DATA_EC4749>>16 ;$809928 | LDY.w #DATA_EC4749>>16 ;$809928 |
LDA #$0000 ;$80992B | LDA #$0000 ;$80992B |
@ -5225,22 +5225,22 @@ CODE_80B106: ; |
WAI ;$80B106 | WAI ;$80B106 |
BRA CODE_80B106 ;$80B107 / BRA CODE_80B106 ;$80B107 /
CODE_80B109: clear_VRAM_block:
STA $2116 ;$80B109 \ STA $2116 ;$80B109 \ Store address to VRAM block to clear
LDA #DATA_80B116 ;$80B10C | LDA #.VRAM_zero_fill ;$80B10C |\ Set DMA source word (uses low byte of size as fixed data)
STA $4302 ;$80B10F | STA $4302 ;$80B10F | |
STA $4308 ;$80B112 | STA $4308 ;$80B112 |/
%offset(DATA_80B116, 1) %offset(.VRAM_zero_fill, 1) ; | Generate a label for fixed VRAM data
LDA #$0800 ;$80B115 | LDA #$0800 ;$80B115 |\ Set DMA size to $0800
STA $4305 ;$80B118 | STA $4305 ;$80B118 |/
LDA #$1809 ;$80B11B | LDA #$1809 ;$80B11B |\ Set DMA destination to $2118, two register write once, fixed
STA $4300 ;$80B11E | STA $4300 ;$80B11E |/
SEP #$20 ;$80B121 | SEP #$20 ;$80B121 |
STZ $4304 ;$80B123 | STZ $4304 ;$80B123 | Set DMA source bank to 00.
LDA #$01 ;$80B126 | LDA #$01 ;$80B126 |\ Enable channel 1 DMA
STA $420B ;$80B128 | STA $420B ;$80B128 |/
REP #$20 ;$80B12B | REP #$20 ;$80B12B |
RTS ;$80B12D / RTS ;$80B12D / VRAM block is clear, return
DATA_80B12E: DATA_80B12E:
db $00, $17, $1B, $1F, $00, $0C, $11, $17 db $00, $17, $1B, $1F, $00, $0C, $11, $17
@ -5686,7 +5686,7 @@ CODE_80B5FA:
LDY #$2000 ;$80B628 | LDY #$2000 ;$80B628 |
JSL DMA_to_VRAM ;$80B62B | JSL DMA_to_VRAM ;$80B62B |
LDA #$7C00 ;$80B62F | LDA #$7C00 ;$80B62F |
JSR CODE_80B109 ;$80B632 | JSR clear_VRAM_block ;$80B632 |
LDA #$7D00 ;$80B635 | LDA #$7D00 ;$80B635 |
STA $2116 ;$80B638 | STA $2116 ;$80B638 |
LDX.w #DATA_F80D66>>16 ;$80B63B | LDX.w #DATA_F80D66>>16 ;$80B63B |
@ -12617,6 +12617,7 @@ CODE_80F3B0: ; |
STZ $1730 ;$80F3B0 | STZ $1730 ;$80F3B0 |
RTS ;$80F3B3 / RTS ;$80F3B3 /
CODE_80F3B4:
LDA #$0001 ;$80F3B4 | LDA #$0001 ;$80F3B4 |
STA $420B ;$80F3B7 | STA $420B ;$80F3B7 |
JMP CODE_80F3F2 ;$80F3BA / JMP CODE_80F3F2 ;$80F3BA /

View file

@ -4779,9 +4779,7 @@ DATA_B3A45D:
CODE_B3A465: CODE_B3A465:
LDY #$0008 ;$B3A465 \ LDY #$0008 ;$B3A465 \
LDA [$8E],y ;$B3A468 | LDA [$8E],y ;$B3A468 |
CMP #$00 ;$B3A46A | CMP #$6000 ;$B3A46A |
RTS ;$B3A46C /
BNE CODE_B3A488 ;$B3A46D | BNE CODE_B3A488 ;$B3A46D |
LDA $30,x ;$B3A46F | LDA $30,x ;$B3A46F |
ORA #$0080 ;$B3A471 | ORA #$0080 ;$B3A471 |
@ -8468,7 +8466,7 @@ CODE_B3BF32: ; |
CLC ;$B3BF55 | CLC ;$B3BF55 |
CODE_B3BF56: ; | CODE_B3BF56: ; |
RTS ;$B3BF56 / RTS ;$B3BF56 /
CODE_B3BF57: CODE_B3BF57:
JSR CODE_B3A369 ;$B3BF57 / JSR CODE_B3A369 ;$B3BF57 /
@ -15948,5 +15946,3 @@ DATA_B3F4D8:
db $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00 db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00
db $00, $00, $00, $00, $00, $00, $00, $00

View file

@ -19,8 +19,8 @@ CODE_B5800F:
CODE_B58012: CODE_B58012:
JMP CODE_B581CE ;$B58012 | JMP CODE_B581CE ;$B58012 |
CODE_B58015: null_spc_command_entry:
JMP CODE_B581DA ;$B58015 | JMP null_spc_command ;$B58015 |
CODE_B58018: CODE_B58018:
JMP CODE_B581DB ;$B58018 | JMP CODE_B581DB ;$B58018 |
@ -152,26 +152,26 @@ CODE_B580D5:
STA $1C ;$B580D8 | STA $1C ;$B580D8 |
LDX #$00FF ;$B580DA | LDX #$00FF ;$B580DA |
JSR write_spc_command ;$B580DD | JSR write_spc_command ;$B580DD |
JSR CODE_B58469 ;$B580E0 | JSR upload_song_sample_set ;$B580E0 |
JSR CODE_B5825C ;$B580E3 | JSR upload_song_data ;$B580E3 |
JSR CODE_B58277 ;$B580E6 | JSR upload_song_sound_effects ;$B580E6 |
JSR execute_spc_sound_engine ;$B580E9 | JSR execute_spc_sound_engine ;$B580E9 |
PLB ;$B580EC | PLB ;$B580EC |
RTL ;$B580ED / RTL ;$B580ED /
CODE_B580EE: CODE_B580EE: ; \
PHB ;$B580EE \ PHB ;$B580EE |\ Change to current databank
PHK ;$B580EF | PHK ;$B580EF | |
PLB ;$B580F0 | PLB ;$B580F0 |/
JSR CODE_B5816D ;$B580F1 | JSR clear_sound_buffers ;$B580F1 |
LDX #$00FE ;$B580F4 | LDX #$00FE ;$B580F4 |\ Tell the SPC engine to start playing music
JSR write_spc_command ;$B580F7 | JSR write_spc_command ;$B580F7 |/
LDA $1E ;$B580FA | LDA $1E ;$B580FA |\ Write mono or stereo setting to SPC engine
XBA ;$B580FC | XBA ;$B580FC | |
ORA #$00FA ;$B580FD | ORA #$00FA ;$B580FD | |
TAX ;$B58100 | TAX ;$B58100 | |
JSR write_spc_command ;$B58101 | JSR write_spc_command ;$B58101 |/
PLB ;$B58104 | PLB ;$B58104 | Restore databank
RTL ;$B58105 / RTL ;$B58105 /
CODE_B58106: CODE_B58106:
@ -181,19 +181,19 @@ CODE_B58106:
STA $1C ;$B58109 | STA $1C ;$B58109 |
LDX #$00FF ;$B5810B | LDX #$00FF ;$B5810B |
JSR write_spc_command ;$B5810E | JSR write_spc_command ;$B5810E |
JSR CODE_B58469 ;$B58111 | JSR upload_song_sample_set ;$B58111 |
JSR CODE_B5825C ;$B58114 | JSR upload_song_data ;$B58114 |
JSR CODE_B58277 ;$B58117 | JSR upload_song_sound_effects ;$B58117 |
JSR CODE_B5816D ;$B5811A | JSR clear_sound_buffers ;$B5811A |
JSR execute_spc_sound_engine ;$B5811D | JSR execute_spc_sound_engine ;$B5811D |
LDX #$00FE ;$B58120 | LDX #$00FE ;$B58120 |\ Tell the SPC engine to start playing music
JSR write_spc_command ;$B58123 | JSR write_spc_command ;$B58123 |/
LDA $1E ;$B58126 | LDA $1E ;$B58126 |\ Write mono or stereo setting to SPC engine
XBA ;$B58128 | XBA ;$B58128 | |
ORA #$00FA ;$B58129 | ORA #$00FA ;$B58129 | |
TAX ;$B5812C | TAX ;$B5812C | |
JSR write_spc_command ;$B5812D | JSR write_spc_command ;$B5812D |/
PLB ;$B58130 | PLB ;$B58130 | Restore databank
RTL ;$B58131 / RTL ;$B58131 /
CODE_B58132: CODE_B58132:
@ -205,35 +205,35 @@ CODE_B58132:
STA $1C ;$B58139 | STA $1C ;$B58139 |
LDX #$00FF ;$B5813B | LDX #$00FF ;$B5813B |
JSR write_spc_command ;$B5813E | JSR write_spc_command ;$B5813E |
JSR CODE_B58469 ;$B58141 | JSR upload_song_sample_set ;$B58141 |
JSR CODE_B5825C ;$B58144 | JSR upload_song_data ;$B58144 |
JSR CODE_B58277 ;$B58147 | JSR upload_song_sound_effects ;$B58147 |
JSR CODE_B5816D ;$B5814A | JSR clear_sound_buffers ;$B5814A |
JSR execute_spc_sound_engine ;$B5814D | JSR execute_spc_sound_engine ;$B5814D |
PLA ;$B58150 | PLA ;$B58150 |
AND #$FF00 ;$B58151 | AND #$FF00 ;$B58151 |
ORA #$00FB ;$B58154 | ORA #$00FB ;$B58154 |
TAX ;$B58157 | TAX ;$B58157 |
JSR write_spc_command ;$B58158 | JSR write_spc_command ;$B58158 |
LDX #$00FE ;$B5815B | LDX #$00FE ;$B5815B |\ Tell the SPC engine to start playing music
JSR write_spc_command ;$B5815E | JSR write_spc_command ;$B5815E |/
LDA $1E ;$B58161 | LDA $1E ;$B58161 |\ Write mono or stereo setting to SPC engine
XBA ;$B58163 | XBA ;$B58163 | |
ORA #$00FA ;$B58164 | ORA #$00FA ;$B58164 | |
TAX ;$B58167 | TAX ;$B58167 | |
JSR write_spc_command ;$B58168 | JSR write_spc_command ;$B58168 |/
PLB ;$B5816B | PLB ;$B5816B | Restore databank
RTL ;$B5816C / RTL ;$B5816C /
CODE_B5816D: clear_sound_buffers:
LDX #$0007 ;$B5816D \ LDX #$0007 ;$B5816D \
CODE_B58170: ; | .clear_buffer_entry ; |
STZ $0621,x ;$B58170 | STZ $0621,x ;$B58170 |
STZ $0629,x ;$B58173 | STZ $0629,x ;$B58173 |
STZ $0619,x ;$B58176 | STZ $0619,x ;$B58176 |
DEX ;$B58179 | DEX ;$B58179 |
DEX ;$B5817A | DEX ;$B5817A |
BPL CODE_B58170 ;$B5817B | BPL .clear_buffer_entry ;$B5817B |
STZ $0634 ;$B5817D | STZ $0634 ;$B5817D |
STZ $0636 ;$B58180 | STZ $0636 ;$B58180 |
LDA #$0002 ;$B58183 | LDA #$0002 ;$B58183 |
@ -242,7 +242,7 @@ CODE_B58170: ; |
RTS ;$B5818C / RTS ;$B5818C /
upload_spc_engine_wrapper: upload_spc_engine_wrapper:
JSR upload_spc_engine ;$B5818D \ JSR upload_spc_engine ;$B5818D \ Wrapper around SPC engine upload routine
RTL ;$B58190 / RTL ;$B58190 /
upload_spc_engine: upload_spc_engine:
@ -257,8 +257,8 @@ upload_spc_engine:
JSR execute_spc_sound_engine ;$B581A7 | Jump to the sound engine entry JSR execute_spc_sound_engine ;$B581A7 | Jump to the sound engine entry
RTS ;$B581AA / RTS ;$B581AA /
CODE_B581AB: .dead_code
RTS ;$B581AB / RTS ;$B581AB > Dead code
execute_spc_sound_engine: ; \ execute_spc_sound_engine: ; \
LDA #$0672 ;$B581AC |\ Load the sound engine entry point LDA #$0672 ;$B581AC |\ Load the sound engine entry point
@ -290,8 +290,8 @@ CODE_B581CE:
JSR write_spc_command ;$B581D6 | JSR write_spc_command ;$B581D6 |
RTL ;$B581D9 / RTL ;$B581D9 /
CODE_B581DA: null_spc_command:
RTL ;$B581DA / RTL ;$B581DA > Unused SPC command that does nothing
CODE_B581DB: CODE_B581DB:
PHB ;$B581DB \ PHB ;$B581DB \
@ -302,14 +302,14 @@ CODE_B581DB:
ORA #$00FB ;$B581E2 | ORA #$00FB ;$B581E2 |
TAX ;$B581E5 | TAX ;$B581E5 |
JSR write_spc_command ;$B581E6 | JSR write_spc_command ;$B581E6 |
LDX #$00FE ;$B581E9 | LDX #$00FE ;$B581E9 |\ Tell the SPC engine to start playing music
JSR write_spc_command ;$B581EC | JSR write_spc_command ;$B581EC |/
LDA $1E ;$B581EF | LDA $1E ;$B581EF |\ Write mono or stereo setting to SPC engine
XBA ;$B581F1 | XBA ;$B581F1 | |
ORA #$00FA ;$B581F2 | ORA #$00FA ;$B581F2 | |
TAX ;$B581F5 | TAX ;$B581F5 | |
JSR write_spc_command ;$B581F6 | JSR write_spc_command ;$B581F6 |/
PLB ;$B581F9 | PLB ;$B581F9 | Restore databank
RTL ;$B581FA / RTL ;$B581FA /
write_spc_command: write_spc_command:
@ -366,33 +366,33 @@ upload_spc_base_engine: ; \
REP #$30 ;$B58259 | REP #$30 ;$B58259 |
RTS ;$B5825B / All done, new SPC base engine set up. RTS ;$B5825B / All done, new SPC base engine set up.
CODE_B5825C: upload_song_data:
LDA $1C ;$B5825C \ LDA $1C ;$B5825C \ Load currently set song
CLC ;$B5825E | CLC ;$B5825E |\ Multiply song number by 6 to get an offset to song data
ROL A ;$B5825F | ROL A ;$B5825F | | Effectively (X << 1) + (X << 2)
STA $32 ;$B58260 | STA $32 ;$B58260 | |
ROL A ;$B58262 | ROL A ;$B58262 | |
CLC ;$B58263 | CLC ;$B58263 | |
ADC $32 ;$B58264 | ADC $32 ;$B58264 |/
TAX ;$B58266 | TAX ;$B58266 | Move offset to an index register
LDA.l DATA_EE1086,x ;$B58267 | LDA.l song_data,x ;$B58267 |\ Load pointer to song data
STA $32 ;$B5826B | STA $32 ;$B5826B | |
LDA.l DATA_EE1088,x ;$B5826D | LDA.l song_data+2,x ;$B5826D | |
STA $34 ;$B58271 | STA $34 ;$B58271 |/
JSR upload_inline_spc_block ;$B58273 | JSR upload_inline_spc_block ;$B58273 | Upload song data
RTS ;$B58276 / RTS ;$B58276 /
CODE_B58277: upload_song_sound_effects: ; \
LDA $1C ;$B58277 \ LDA $1C ;$B58277 |\ Triple song id
CLC ;$B58279 | CLC ;$B58279 | |
ADC $1C ;$B5827A | ADC $1C ;$B5827A | |
ADC $1C ;$B5827C | ADC $1C ;$B5827C |/
TAX ;$B5827E | TAX ;$B5827E | Move offset to an index register
LDA.l DATA_EE117B,x ;$B5827F | LDA.l DATA_EE117B,x ;$B5827F |\ Load pointer to song specific sound effects
STA $32 ;$B58283 | STA $32 ;$B58283 | |
LDA.l DATA_EE117D,x ;$B58285 | LDA.l DATA_EE117D,x ;$B58285 | |
STA $34 ;$B58289 | STA $34 ;$B58289 |/
JSR upload_inline_spc_block ;$B5828B | JSR upload_inline_spc_block ;$B5828B | Upload sound effect data
RTS ;$B5828E / RTS ;$B5828E /
upload_spc_sound_engine: upload_spc_sound_engine:
@ -420,18 +420,18 @@ upload_global_samples: ; \
STA $06 ;$B582BD |/ STA $06 ;$B582BD |/
STZ $0A ;$B582BF | Reset the sample counter STZ $0A ;$B582BF | Reset the sample counter
JSR sample_uploader ;$B582C1 | JSR sample_uploader ;$B582C1 |
LDA $02 ;$B582C4 |\ LDA $02 ;$B582C4 |\ Set next pending source directory ARAM destination
STA $04 ;$B582C6 |/ STA $04 ;$B582C6 |/
LDA $06 ;$B582C8 |\ LDA $06 ;$B582C8 |\ Set next pending sample data ARAM destination
STA $08 ;$B582CA |/ STA $08 ;$B582CA |/
LDA $0A ;$B582CC |\ LDA $0A ;$B582CC |\ Set next pending sample number
STA $0C ;$B582CE |/ STA $0C ;$B582CE |/
RTS ;$B582D0 / RTS ;$B582D0 /
sample_uploader: sample_uploader:
STZ $0A ;$B582D1 \ Reset the sample counter STZ $0A ;$B582D1 \ Reset the sample counter
LDX #$0000 ;$B582D3 | LDX #$0000 ;$B582D3 |
LDA $0A ;$B582D6 |\ LDA $0A ;$B582D6 |\ Copy sample number (always zero in this case)
STA $3A ;$B582D8 |/ STA $3A ;$B582D8 |/
LDA $0E ;$B582DA |\ Copy sample map pointer LDA $0E ;$B582DA |\ Copy sample map pointer
STA $3E ;$B582DC | | STA $3E ;$B582DC | |
@ -654,26 +654,26 @@ upload_spc_block:
LDY #$00 ;$B58465 | Reset the data index LDY #$00 ;$B58465 | Reset the data index
BRA .wait_for_echo ;$B58467 / BRA .wait_for_echo ;$B58467 /
CODE_B58469: upload_song_sample_set:
LDA $1C ;$B58469 \ LDA $1C ;$B58469 \ Load currently set song
CLC ;$B5846B | CLC ;$B5846B |\ Multiply song number by 6 to song sample set offset
ROL A ;$B5846C | ROL A ;$B5846C | | Effectively (X << 1) + (X << 2)
STA $32 ;$B5846D | STA $32 ;$B5846D | |
ROL A ;$B5846F | ROL A ;$B5846F | |
CLC ;$B58470 | CLC ;$B58470 | |
ADC $32 ;$B58471 | ADC $32 ;$B58471 |/
TAX ;$B58473 | TAX ;$B58473 | Move offset to an index register
LDA.l DATA_EE1089,x ;$B58474 | LDA.l song_sample_sets,x ;$B58474 |\ Load pointer to song sample set
STA $0E ;$B58478 | STA $0E ;$B58478 | |
LDA.l DATA_EE108B,x ;$B5847A | LDA.l song_sample_sets+2,x ;$B5847A | |
STA $10 ;$B5847E | STA $10 ;$B5847E |/
LDA $04 ;$B58480 | LDA $04 ;$B58480 |\ Set next pending source directory ARAM destination
STA $02 ;$B58482 | STA $02 ;$B58482 |/
LDA $08 ;$B58484 | LDA $08 ;$B58484 |\ Set next pending sample data ARAM destination
STA $06 ;$B58486 | STA $06 ;$B58486 |/
LDA $0C ;$B58488 | LDA $0C ;$B58488 |\ Set next pending sample number
STA $0A ;$B5848A | STA $0A ;$B5848A |/
JSR sample_uploader ;$B5848C | JSR sample_uploader ;$B5848C | Upload the samples
RTS ;$B5848F / RTS ;$B5848F /
DATA_B58490: DATA_B58490:

View file

@ -909,6 +909,7 @@ CODE_BB8565: ; |
STA $12,x ;$BB8579 | STA $12,x ;$BB8579 |
PLY ;$BB857B | PLY ;$BB857B |
PLB ;$BB857C | PLB ;$BB857C |
t:
INY ;$BB857D | INY ;$BB857D |
INY ;$BB857E | INY ;$BB857E |
JMP CODE_BB8485 ;$BB857F / JMP CODE_BB8485 ;$BB857F /

View file

@ -132,10 +132,12 @@ CODE_0660:
MOV A, $1313+Y ;$066A | MOV A, $1313+Y ;$066A |
MOV $E6, A ;$066D | MOV $E6, A ;$066D |
JMP CODE_0678 ;$066F | JMP CODE_0678 ;$066F |
CODE_0672:
MOV $E6, #$13 ;$0672 | MOV $E6, #$13 ;$0672 |
MOV $E5, #$00 ;$0675 | MOV $E5, #$00 ;$0675 |
CODE_0678: ; | CODE_0678: ; |
CALL $100B ;$0678 | CALL CODE_100B ;$0678 |
MOV A, #$00 ;$067B | MOV A, #$00 ;$067B |
MOV $1C, A ;$067D | MOV $1C, A ;$067D |
MOV $1D, A ;$067F | MOV $1D, A ;$067F |
@ -2091,12 +2093,9 @@ sample_table:
dl !null_pointer dl !null_pointer
dl !null_pointer dl !null_pointer
DATA_EE1086: song_data:
%offset(DATA_EE1088, 2) %offset(song_sample_sets, 3)
dl DATA_EE1939 dl DATA_EE1939
DATA_EE1089:
%offset(DATA_EE108B, 2)
dl DATA_EE1223 dl DATA_EE1223
dl DATA_EE195F dl DATA_EE195F
dl DATA_EE124D dl DATA_EE124D

207
music.txt
View file

@ -1,175 +1,32 @@
Music IDs 0x00, "Nothing"
0x0000 -- Nothing 0x01, "Island map"
0x0001 -- Island map 0x02, "Main theme"
0x0002 -- Main theme 0x03, "Swamp"
0x0003 -- Swamp 0x04, "Swanky"
0x0004 -- Swanky 0x05, "Enchanted wood"
0x0005 -- Enchanted wood 0x06, "Ship deck"
0x0006 -- Ship deck 0x07, "Mine"
0x0007 -- Mine 0x08, "Funky"
0x0008 -- Funky 0x09, "Brambles"
0x0009 -- Brambles 0x0A, "Klubba"
0x000A -- Klubba 0x0B, "Wasp hive"
0x000B -- Wasp hive 0x0C, "Wrinkly"
0x000C -- Wrinkly 0x0D, "Lava"
0x000D -- Lava 0x0E, "Roller coaster"
0x000E -- Roller coaster 0x0F, "Bonus"
0x000F -- Bonus 0x10, "Ship hold"
0x0010 -- Ship hold 0x11, "Fanfare"
0x0011 -- Fanfare 0x12, "Ship deck 2"
0x0012 -- Ship deck 2 0x13, "Rescue kong"
0x0013 -- Rescue kong 0x14, "Game over"
0x0014 -- Game over 0x15, "Big boss"
0x0015 -- Big boss 0x16, "Castle"
0x0016 -- Castle 0x17, "Haunted"
0x0017 -- Haunted 0x18, "Select"
0x0018 -- Select 0x19, "Cranky"
0x0019 -- Cranky 0x1A, "Ice"
0x001A -- Ice 0x1B, "Jungle"
0x001B -- Jungle 0x1C, "Lost world"
0x001C -- Lost world 0x1D, "Rigging"
0x001D -- Rigging 0x1E, "Credits"
0x001E -- Credits 0x1F, "Krool"
0x001F -- Krool
In level music prefixes
0x0000 -- normal
0x0100 -- death
0x0200 -- diddy win
0x0300 -- dixie win
0x0400 -- no dance win (invalid for boss music)
Bonus music prefixes
0x0000 -- Bonus transition screen
0x0100 -- Complete (already one)
0x0200 -- lose
0x0300 -- In the bonus
OW music, Swanky, Cranky, Wrinkly, Fanfare, Gameover, and Credits have no prefixes
Sound effects:
0x00 -- Nothing
0x01 -- Nothing?
0x02 -- Klomp walking
0x03 -- Monkey sound (unused)
0x04 -- Spin/cartwheel into enemy
0x05 -- Switch Kongs
0x06 -- Diddy hurt/lost
0x07 -- Dixie hurt/lost
0x08 -- Collect bananna
0x09 -- Collect something (unused)
0x0A -- Diddy loses life
0x0B -- Rambi charging
0x0C -- Something breaking (investigate)
0x0D -- Zinger like sound (investigate)
0x0E -- Zinger killed
0x0F -- Klick-Klack walking
0x10 -- Klick-Klack splat
0x11 -- Klobber skidding
0x12 -- Klobber waking up
0x13 -- Quiet sound (investigate)
0x14 -- Explosion of some sort (investigate)
0x15 -- Kannon shooting
0x16 -- Klampon eating player
0x17 -- Klampon snapping jaw while walking
0x18 -- Jump on kroc type enemy
0x19 -- Blow open bonus wall
0x1A -- Shoot from cannon
0x1B -- Kong in barrel
0x1C -- Count down in bonus game
0x1D -- Rattly jump
0x1E -- More monkey sounds (unused?)
0x1F -- Klinger sliding down
0x20 -- Dixie loses life
0x21 -- Blowing sound (unused?)
0x22 -- Reveal token (unused?)
0x23 -- Diddy juggling
0x24 -- Neek squeak
0x25 -- Blowing gum variant (unused?)
0x26 -- Dixie blowing gum
0x27 -- Collect kong letter pitch 1
0x28 -- Collect kong letter pitch 2
0x29 -- Collect kong letter pitch 3
0x2A -- Collect kong letter pitch 4
0x2B -- Lose life/ballon pop
0x2C -- Gain life
0x2D -- Collect coin
0x2E -- K. Rool message
0x2F -- Squawks attack
0x30 -- Squawks flapping 1
0x31 -- Squawks flapping 2
0x32 -- Spiny walking (investigate)
0x33 -- Menu move
0x34 -- Menu select
0x35 -- Reveal token
0x36 -- Collect kremcoin
0x37 -- Klick Klack flipping over
0x38 -- Collect life
0x39 -- Krow ghost exploding twinkle
0x3A -- Krow ghost exploding
0x3B -- Zinger sound (unused?)
0x3C -- Zinger sound higher pitch(unused?)
0x3D -- Zinger buzzing
0x3E -- Increase tempo/stop buzzing
0x3F -- Flitter buzzing
0x40 -- Team up
0x41 -- Animal buddy destoryed by sign (used with 0x42, 0x43, 0x44)
0x42 -- Animal buddy destoryed by sign (used with 0x41, 0x43, 0x44)
0x43 -- Animal buddy destoryed by sign (used with 0x41, 0x42, 0x44)
0x44 -- Animal buddy destoryed by sign (used with 0x41, 0x42, 0x43)
0x45 -- Rattly hurt
0x46 -- Squitter shoot web
0x47 -- Squitter shooting platform
0x48 -- Rattly idle jump
0x49 -- Rattly high jump
0x4A -- Load cannon ball into cannon
0x4B -- Shoot cannon (unused?)
0x4C -- Cannon ball falling from sky
0x4D -- Squitter jump (investigate)
0x4E -- Spiny walking
0x4F -- Squawks hurt
0x50 -- Invincible
0x51 -- Hit Kruncha
0x52 -- Rolling barrel
0x53 -- Rambi headbutt
0x54 -- Rambi trample
0x55 -- Animal transformation sound (semi unused)
0x56 -- Collect DK coin
0x57 -- Necky attacking
0x58 -- Cat-O-9-Tails hurt
0x59 -- Kudgel hurt
0x5A -- K. Rool passing out
0x5B -- K. Rool falling into water
0x5C -- K. Rool falling into water (unused?)
0x5D -- Krook jumped on
0x5E -- Pause/unpause game
0x5F -- Wrong/invalid selection
0x60 -- Egg cracking sound
0x61 -- Krow flapping
0x62 -- Jumping in and out of water, or krow hit
0x63 -- Clapper arf
0x64 -- Krow grabbing egg
0x65 -- Enguard jab
0x66 -- Lost Enguard, Kleaver hooks
0x67 -- Time running out in bonus
0x68 -- Ambient in water
0x69 -- Puft up inflating, Kleaver sinking
0x6A -- Puft up exploding, Kleaver sinking 2
0x6B -- Swimming, Kleaver vibrating, Race count down
0x6C -- Shuri spinning, Kleaver boiling, Race go
0x6D -- Clapper clap
0x6E -- Jump on green kroc head, Klapper blowing
0x6F -- Jump on brown kroc head
0x70 -- Crashing mixed with DK (unused?)
0x71 -- Deeper rambi head butt (unused?)
0x72 -- Quieter monkey sound (unused?)
0x73 -- Engaurd-like jab (unused?)
0x74 -- Monkey sound (unused?)
0x75 -- Weird monkey echo (Unused?)
0x76 -- quieter monkey sound (unused?)
0x77 -- Unknown
0x78 -- Scared by boss
0x79 -- Caw of Krow
Note: 0x60+ can have multiple uses. Ones before that may still be sample dependant.

View file

@ -431,23 +431,21 @@ Various compressed data:
$F9C775 $F9C775
$FA4C3E $FA4C3E
;these are not exactly right, they are in the wrong order.... +0 command 0x80(CODE_BB84C0) return success
command 0x80(CODE_BB84C0): SEC and return ;success +4 command 0x81(CODE_BB84C7) todo
command 0x81(CODE_BB84C7): evil? ;evil +4 command 0x82(CODE_BB84D8) null command (goto next)
command 0x82(CODE_BB84D8): Goto next command ;skip +4 command 0x83(CODE_BB84DA) load subconfig
command 0x83(CODE_BB84DA): load sub config ;subconfig +4 command 0x84(CODE_BB84EE) set palette
command 0x84(CODE_BB84EE): Set palette? ;palette +4 command 0x85(CODE_BB850C) Set x/y/priority
command 0x85(CODE_BB850C): Set X/Y/priority? ;directedpriority +6 command 0x86(CODE_BB8521) shift spawn relative to parent sprite/set render priority/something with $1C
command 0x86(CODE_BB8521): reads +2 (?) ;too tired +6 command 0x87(CODE_BB8582) set property in sprite (based on parent X flip)
command 0x87(CODE_BB8582): reads +2, relative x flip? ;maybe +2 command 0x88(CODE_BB85A2) Spawn at to $0A3E/$0A40
command 0x88(CODE_BB85A2): relative x/y ;relative +A command 0x89(CODE_BB86D5) alloc palette/vram
command 0x89(CODE_BB86D5): allocate VRAM? ;VRAM +1C command 0x8A(CODE_BB85BC) bulk settings
command 0x8A(CODE_BB85BC): read +$1A, bulk copy ;bulk +4 command 0x8B(CODE_BB860E) Set sprite proiroty
command 0x8B(CODE_BB860E): x/y stuff ;ehh +4 command 0x8C(CODE_BB8646) jump to command CODE_BB84EE
command 0x8C(CODE_BB8646): jump to cmd 0x84 ;removed probably +4 command 0x8D(CODE_BB8678) Alt set palette (uses FD5EE table)
command 0x8D(CODE_BB8678): more palette voodoo ;voodoo +A command 0x8E(CODE_BB879E) Another palette/vram allocation routine
command 0x8E(CODE_BB879E): VRAM alloc 2? ;VRAM2
$05FD = index to control buffer $05FD = index to control buffer
@ -457,8 +455,23 @@ $05FD = index to control buffer
CODE_BB842C one of several spawn sprite routines
music notes:
sound effects 0x60+ can have multiple uses. Ones before that may still be sample dependant.
In level music prefixes
0x0000 -- normal
0x0100 -- death
0x0200 -- diddy win
0x0300 -- dixie win
0x0400 -- no dance win (invalid for boss music)
Bonus music prefixes
0x0000 -- Bonus transition screen
0x0100 -- Complete (already one)
0x0200 -- lose
0x0300 -- In the bonus
OW music, Swanky, Cranky, Wrinkly, Fanfare, Gameover, and Credits have no prefixes

174
sprites.txt Normal file
View file

@ -0,0 +1,174 @@
0x000, "Game intro brilliancy * / Sprites true ending *"
0x004, "Sprites on overworld / Sprites true ending *"
0x008, "Kongs on map"
0x010, "Squawks' cookie"
0x014, "Running feet smoke * / Clapper "spit" *"
0x018, "Kannonball's fragment *"
0x01c, "Krow's egg fragment * / Kannonball's fragment *"
0x020, "Krow's egg fragment *"
0x024, "Hook (boss level)"
0x028, "Level with mobile water setup [when loading level] *"
0x02c, "Kleever's fragment *"
0x034, "Kleever's fragment *"
0x038, "Kleever's fragment *"
0x03c, "Kleever's fragment *"
0x040, "Init for 140? Appears for instance in the end of Barrel Bayou if you do back."
0x044, "Kleever's fragment *"
0x048, "Kleever's fragment *"
0x04c, "Kreepy Krow's dying stars *"
0x050, "Kaptain K. Roll's dying brilliancy *"
0x054, "Kaptain K. Roll's alga *"
0x058, "Poftup Spike"
0x05c, "Bulrush's base *"
0x060, "Barrel's fragments 1 *"
0x064, "Barrel's fragments 2 *"
0x068, "Zing King spikes"
0x06c, "Kannon"
0x074, "Klubba"
0x078, "Kudgel"
0x07c, "Zing King [Rambi Rumble]"
0x080, "Zing King [boss]"
0x084, "A flag for the 1-UP Balloon in K. Roll cabin"
0x088, "Chest groups"
0x08c, "(appears on top-left sometimes) [aux] * / (makes sprites not disappear when offscreen in some parts)"
0x094, "Door / Exit"
0x098, "Kaptain K. Roll's altar animation"
0x09c, "Klubba barrel brilliancy generator *"
0x0a0, "Klubba's barrel brilliancy"
0x0ac, "Water level activator *"
0x0b0, "End of Level Target / Water delimiter??? / Sprite delimiter? / Camera control?"
0x0b4, "TNT Barrel's fire *"
0x0b8, "TNT Barrel's fire *"
0x0bc, "Kackle (blue)"
0x0c0, "Horizontal wind activator? *"
0x0c4, "Verical wind activator? *"
0x0d0, "Tire"
0x0d4, "**Go throw solid block**"
0x0d8, "[Activator of sprites?]"
0x0e0, "Kong invincibility effect *"
0x0e4, "Diddy"
0x0e8, "Dixie"
0x0f0, "Appears when some [unidiretional?] sprites go offscreen"
0x0fc, "Dixie cry"
0x100, "Krow's head stunning stars * / Cat-O-9-Tails dizziness starts *"
0x108, "Squitter webbing projectile"
0x10c, "Kong water splash *"
0x118, "Squitter webbing platform"
0x11c, "DK Barrel (complement?) *"
0x120, "Bonus Barrel [aux]"
0x124, "Bonus Wall"
0x128, "Hot Air Balloon"
0x12c, "[like 08c]"
0x130, "Water splash (when enemy dies and falls into the sea or lava)"
0x134, "[like 08c]"
0x138, "Bonus countdown"
0x13c, "Cannon"
0x140, "Barrel [all?]"
0x144, "Iron Ball *REAL NAME?*"
0x148, "Animal Crate"
0x14c, "Hook"
0x150, "Invincibility Barrel"
0x154, "Halfway Barrel"
0x158, "Skull Cart"
0x15c, "75 Kremkoins / Banana Coin / DK Coin"
0x160, "End of Level Target [aux] *"
0x164, "End of Level Target [barrel] *"
0x168, "End of Level Target [aux] *"
0x16c, "End of Level Target (reward)"
0x170, "Banana Bunch"
0x174, "KONG Coins"
0x178, "Live Balloon"
0x17c, "Kudgel's TNT Barrel falling"
0x180, "KrokHead Barrel [and its aux symbol]"
0x184, "Scroll / Funky's Flight / Klubba's barrel"
0x188, "Banana Coin on Funky's Flight"
0x18c, "Cranky / Funky"
0x190, "Squitter"
0x194, "Rattly"
0x198, "Squawks / Quawks"
0x19c, "Rambi"
0x1a0, "Enguarde"
0x1a4, "Wooden Barrel"
0x1a8, "DK Barrel (floating)"
0x1ac, "Klobber"
0x1b0, "Cannonball"
0x1b4, "Krow's egg"
0x1b8, "TNT Barrel"
0x1bc, "Crate"
0x1c0, "Chest"
0x1c4, "Kreepy Krow's egg"
0x1cc, "Diddy's stereo / Dixie guitar"
0x1d0, "Kannon's Barrel / Kannon's Ball"
0x1d4, "Kannon's Smoke * / Zing King's smoke *"
0x1d8, "Kruncha"
0x1dc, "Click-Clack"
0x1e0, "Kutless"
0x1e4, "Neek (rat)"
0x1e8, "DK Barrel"
0x1e8, "Klobber [aux]"
0x1ec, "Klomp"
0x1f0, "Klampon"
0x1f8, "Flotsam (green) / Flotsam (blue)"
0x1fc, "Spiny"
0x200, "Klinger"
0x204, "Cat-O-9-Tails"
0x208, "Puftup"
0x20c, "Lockjaw"
0x210, "Snapjaw"
0x214, "Mini-Necky"
0x218, "Zinger"
0x21c, "Kaboing (gray)"
0x220, "Flitter"
0x224, "Krow's body"
0x228, "Krow's head"
0x22c, "Kreepy Krow's body"
0x230, "Kreepy Krow's head"
0x234, "Shuri"
0x238, "TNT Barrel's explosion * / Zing King's hit star *"
0x23c, "Rambi Crate Smoke *"
0x248, "TNT Barrel's fire *"
0x24c, "TNT Barrel's fire *"
0x250, "[like 8c]"
0x254, "Ghost Rope"
0x258, "No-Rambi Sign / No-Enguarde Sign / No-Squitter Sign"
0x25c, "Krook"
0x260, "Krook's hook"
0x264, "Kaptain K. Roll"
0x268, "Kaptain K. Roll's blunderbuss"
0x26c, "Kaptain K. Roll's blunderbuss air"
0x270, "Kaptain K. Roll's kannonballs"
0x274, "Kaptain K. Roll's blunderbuss fire"
0x278, "Klubba's bat"
0x27c, "Kudgel's bat"
0x280, "Donkey Kong's rope [wrong hitbox] *"
0x284, "Donkey Kong [wrong hitbox] *"
0x298, "Kleever's lava splash / Kudgel's stunning smoke / Kudgel's dying effect (fire) / Kreepy Krow's dying effect / Kaptain K. Roll's kannonballs smoke"
0x29c, "Kaptain K. Roll's eyes after explosion / Podium winners (ending)"
0x2a0, "Kaptain K. Roll's barrels/kannonballs"
0x2a4, "Kleever's blade *WRONG HITBOX OFFSET*"
0x2a8, "Kaptain K. Roll's water"
0x2ac, "Kaptain K. Roll's fish"
0x2b0, "Kleever's spining fragment"
0x2b4, "Kleever's spining fragment"
0x2b8, "Zing King's sting"
0x2bc, "Zing King's smoke after getting small *"
0x2c0, "Zing King's friends"
0x2c4, "Kleever's skull"
0x2c8, "Kleever's fire hand"
0x2cc, "Kleever's fireball"
0x2d0, "Kleever's base on lava"
0x2d4, "KrocHead (green) / KrocHead (brown)"
0x2d8, "Bulrush *wrong hitbox*"
0x2dc, "Animal reward before being able to grab it"
0x2e0, "Glimmer"
0x2e4, "Kloak"
0x2e8, "Kloak's projectile (box)"
0x2ec, "Gate [and its aux]"
0x2f0, "Klank"
0x2f4, "Skull Cart's spark *"
0x2f8, "Plus Barrel / Minus Barrel"
0x2fc, "Check Barrel"
0x304, "Clapper"
0x308, "Animal "explosion" smoke *"
0x30c, "Screech"
0x310, "Cart kill reward"