diff --git a/main.asm b/main.asm index 1ad96ebef..4961de9e6 100644 --- a/main.asm +++ b/main.asm @@ -61777,7 +61777,32 @@ Function51322: ; 51322 jp CloseSRAM ; 5138b -INCBIN "baserom.gbc",$5138b,$513cb - $5138b +Function5138b: ; 5138b + ld hl, PartyCount + call Function513cb + ld a, [PartyCount] + dec a + ld [$d265], a + ld hl, PartyMon1Nickname + ld bc, $000b + ld de, DefaultFlypoint + call Function513e0 + ld a, [PartyCount] + dec a + ld [$d265], a + ld hl, PartyMon1OT + ld bc, $000b + ld de, $d00d + call Function513e0 + ld a, [PartyCount] + dec a + ld [$d265], a + ld hl, PartyMon1Species + ld bc, $0030 + ld de, $d018 + call Function513e0 + ret +; 513cb Function513cb: ; 513cb inc [hl] @@ -84210,7 +84235,7 @@ Functione0000: ; e0000 ld de, DefaultFlypoint call Functione004e call Functione0057 - ld hl, $408b + ld hl, Unknown_e008b pop bc add hl, bc add hl, bc @@ -84296,6 +84321,7 @@ Functione0078: ; e0078 ret ; e008b +Unknown_e008b: ; e008b INCBIN "baserom.gbc",$e008b,$e00ed - $e008b ; no known jump sources @@ -84347,7 +84373,7 @@ Functione00ee: ; e00ee (38:40ee) ld a, $2 ld [$cf64], a ld [$cf65], a - ld de, $12 + ld de, MUSIC_GAME_CORNER call PlayMusic .asm_e0170 ld a, [$cf63] @@ -84357,7 +84383,7 @@ Functione00ee: ; e00ee (38:40ee) jr .asm_e0170 .asm_e017c call WaitSFX - ld de, $9d + ld de, SFX_QUIT_SLOTS call PlaySFX call WaitSFX call WhiteBGMap @@ -84369,8 +84395,8 @@ Functione00ee: ; e00ee (38:40ee) Functione0191: ; e0191 (38:4191) ld a, [$cf63] ld e, a - ld d, $0 - ld hl, $41a0 + ld d, 0 + ld hl, Jumptable_e01a0 add hl, de add hl, de ld a, [hli] @@ -84379,7 +84405,7 @@ Functione0191: ; e0191 (38:4191) jp [hl] ; e01a0 (38:41a0) -Tablee01a0: ; e01a0 +Jumptable_e01a0: ; e01a0 dw Functione01b5 dw Functione01d2 dw Functione0217 @@ -84492,7 +84518,7 @@ Functione0217: ; e0217 ld a, [$ffa9] and $1 jr nz, .asm_e027c - ld de, $002f + ld de, SFX_KINESIS call PlaySFX call Functione0849 ld c, $4 @@ -84504,7 +84530,7 @@ Functione0217: ; e0217 jr .asm_e025c .asm_e027c - ld de, $002c + ld de, SFX_SLOT_MACHINE_START call PlaySFX ld a, $3 .asm_e0284 @@ -84567,7 +84593,7 @@ Functione02da: ; e02da ld [$ff9b], a call Functione0960 call WaitSFX - ld de, $009a + ld de, SFX_CHOOSE_A_CARD call PlaySFX call WaitSFX ld a, [$c6e8] @@ -84618,7 +84644,7 @@ Functione031e: ; e031e ld a, $1 ld [hBGMapMode], a call Functione0366 - ld hl, $435b + ld hl, UnknownText_0xe035b call PrintText jr .asm_e0350 @@ -84637,7 +84663,11 @@ UnknownText_0xe0356: ; 0xe0356 db "@" ; 0xe035b -INCBIN "baserom.gbc", $e035b, $e0360 - $e035b +UnknownText_0xe035b: ; 0xe035b + ; The cards have been shuffled. + text_jump UnknownText_0x1c57f4 + db "@" +; 0xe0360 Functione0360: ; e0360 ld hl, $cf63 @@ -84918,7 +84948,7 @@ INCBIN "baserom.gbc", $e0553, $e0637 - $e0553 Functione0637: ; e0637 call Functione0398 add hl, hl - ld de, $4643 + ld de, Jumptable_e0643 add hl, de ld a, [hli] ld h, [hl] @@ -84926,15 +84956,378 @@ Functione0637: ; e0637 jp [hl] ; e0643 -INCBIN "baserom.gbc", $e0643, $e0849 - $e0643 +Jumptable_e0643: ; e0643 + dw Functione06a3 + dw Functione06a3 + dw Functione06a6 + dw Functione06a6 + dw Functione06b0 + dw Functione06b0 + dw Functione06a3 + dw Functione06a3 + dw Functione06ec + dw Functione06f6 + dw Functione0702 + dw Functione070e + dw Functione06c2 + dw Functione0722 + dw Functione0770 + dw Functione0774 + dw Functione0778 + dw Functione077c + dw Functione06c2 + dw Functione072c + dw Functione0780 + dw Functione0784 + dw Functione0788 + dw Functione078c + dw Functione06cc + dw Functione0738 + dw Functione0790 + dw Functione0794 + dw Functione0798 + dw Functione079c + dw Functione06cc + dw Functione0744 + dw Functione07a0 + dw Functione07a4 + dw Functione07a8 + dw Functione07ac + dw Functione06d8 + dw Functione0750 + dw Functione07b0 + dw Functione07b4 + dw Functione07b8 + dw Functione07bc + dw Functione06d8 + dw Functione075c + dw Functione07c0 + dw Functione07c4 + dw Functione07c8 + dw Functione07cc +; e06a3 + +Functione06a3: ; e06a3 + jp Functione07db +; e06a6 + +Functione06a6: ; e06a6 + ld a, [CurEnemyMoveNum] + and $2 + jp nz, Functione07db + jr Functione06ba + +Functione06b0: ; e06b0 + ld a, [CurEnemyMoveNum] + and $2 + jr nz, Functione06ba + jp Functione07db + +Functione06ba: ; e06ba + ld c, $6 + ld de, SFX_2ND_PLACE + jp Functione07eb +; e06c2 + +Functione06c2: ; e06c2 + ld a, [CurEnemyMoveNum] + and $18 + jr z, Functione06e4 + jp Functione07db + +Functione06cc: ; e06cc + ld a, [CurEnemyMoveNum] + and $18 + cp $8 + jr z, Functione06e4 + jp Functione07db + +Functione06d8: ; e06d8 + ld a, [CurEnemyMoveNum] + and $18 + cp $10 + jr z, Functione06e4 + jp Functione07db + +Functione06e4: ; e06e4 + ld c, $9 + ld de, SFX_2ND_PLACE + jp Functione07eb +; e06ec + +Functione06ec: ; e06ec + ld a, [CurEnemyMoveNum] + and $3 + jr z, Functione071a + jp Functione07db + +Functione06f6: ; e06f6 + ld a, [CurEnemyMoveNum] + and $3 + cp $1 + jr z, Functione071a + jp Functione07db + +Functione0702: ; e0702 + ld a, [CurEnemyMoveNum] + and $3 + cp $2 + jr z, Functione071a + jp Functione07db + +Functione070e: ; e070e + ld a, [CurEnemyMoveNum] + and $3 + cp $3 + jr z, Functione071a + jp Functione07db + +Functione071a: ; e071a + ld c, $c + ld de, SFX_2ND_PLACE + jp Functione07eb +; e0722 + +Functione0722: ; e0722 + ld a, [CurEnemyMoveNum] + and $1c + jr z, Functione0768 + jp Functione07db + +Functione072c: ; e072c + ld a, [CurEnemyMoveNum] + and $1c + cp $4 + jr z, Functione0768 + jp Functione07db + +Functione0738: ; e0738 + ld a, [CurEnemyMoveNum] + and $1c + cp $8 + jr z, Functione0768 + jp Functione07db + +Functione0744: ; e0744 + ld a, [CurEnemyMoveNum] + and $1c + cp $c + jr z, Functione0768 + jp Functione07db + +Functione0750: ; e0750 + ld a, [CurEnemyMoveNum] + and $1c + cp $10 + jr z, Functione0768 + jp Functione07db + +Functione075c: ; e075c + ld a, [CurEnemyMoveNum] + and $1c + cp $14 + jr z, Functione0768 + jp Functione07db + +Functione0768: ; e0768 + ld c, $12 + ld de, SFX_2ND_PLACE + jp Functione07eb +; e0770 + + +Functione0770: ; e0770 + ld e, $0 + jr Functione07ce + +Functione0774: ; e0774 + ld e, $1 + jr Functione07ce + +Functione0778: ; e0778 + ld e, $2 + jr Functione07ce + +Functione077c: ; e077c + ld e, $3 + jr Functione07ce + +Functione0780: ; e0780 + ld e, $4 + jr Functione07ce + +Functione0784: ; e0784 + ld e, $5 + jr Functione07ce + +Functione0788: ; e0788 + ld e, $6 + jr Functione07ce + +Functione078c: ; e078c + ld e, $7 + jr Functione07ce + +Functione0790: ; e0790 + ld e, $8 + jr Functione07ce + +Functione0794: ; e0794 + ld e, $9 + jr Functione07ce + +Functione0798: ; e0798 + ld e, $a + jr Functione07ce + +Functione079c: ; e079c + ld e, $b + jr Functione07ce + +Functione07a0: ; e07a0 + ld e, $c + jr Functione07ce + +Functione07a4: ; e07a4 + ld e, $d + jr Functione07ce + +Functione07a8: ; e07a8 + ld e, $e + jr Functione07ce + +Functione07ac: ; e07ac + ld e, $f + jr Functione07ce + +Functione07b0: ; e07b0 + ld e, $10 + jr Functione07ce + +Functione07b4: ; e07b4 + ld e, $11 + jr Functione07ce + +Functione07b8: ; e07b8 + ld e, $12 + jr Functione07ce + +Functione07bc: ; e07bc + ld e, $13 + jr Functione07ce + +Functione07c0: ; e07c0 + ld e, $14 + jr Functione07ce + +Functione07c4: ; e07c4 + ld e, $15 + jr Functione07ce + +Functione07c8: ; e07c8 + ld e, $16 + jr Functione07ce + +Functione07cc: ; e07cc + ld e, $17 + +Functione07ce: ; e07ce + ld a, [CurEnemyMoveNum] + cp e + jr nz, Functione07db + ld c, $48 + ld de, SFX_2ND_PLACE + jr Functione07eb + +Functione07db: ; e07db + ld de, SFX_WRONG + call PlaySFX + ld hl, UnknownText_0xe0816 + call Functione0489 + call WaitSFX + ret + +Functione07eb: ; e07eb + push bc + push de + ld hl, UnknownText_0xe0811 + call Functione0489 + pop de + call PlaySFX + call WaitSFX + pop bc +.asm_e07fb + push bc + call Functione0833 + jr c, .asm_e0804 + call Functione081b + +.asm_e0804 + call Functione049c + ld c, $2 + call DelayFrames + pop bc + dec c + jr nz, .asm_e07fb + ret +; e0811 + +UnknownText_0xe0811: ; 0xe0811 + ; Yeah! + text_jump UnknownText_0x1c5813 + db "@" +; 0xe0816 + +UnknownText_0xe0816: ; 0xe0816 + ; Darn… + text_jump UnknownText_0x1c581a + db "@" +; 0xe081b + +Functione081b: ; e081b + ld a, [Coins] + ld h, a + ld a, [$d856] + ld l, a + inc hl + ld a, h + ld [Coins], a + ld a, l + ld [$d856], a + ld de, SFX_PAY_DAY + call PlaySFX + ret +; e0833 + +Functione0833: ; e0833 + ld a, [Coins] + cp 9999 / $100 + jr c, .asm_e0847 + jr z, .asm_e083e + jr .asm_e0845 + +.asm_e083e + ld a, [Coins + 1] + cp 9999 % $100 + jr c, .asm_e0847 + +.asm_e0845 + scf + ret + +.asm_e0847 + and a + ret +; e0849 Functione0849: ; e0849 call Functione03ac - ld hl, $4853 + ld hl, Unknown_e0853 call Functione0509 ret ; e0853 +Unknown_e0853: ; e0853 INCBIN "baserom.gbc", $e0853, $e089c - $e0853 Functione089c: ; e089c @@ -85072,7 +85465,7 @@ Functione093d: ; e093d inc [hl] Functione0959: ; e0959 - ld de, $0003 + ld de, SFX_POKEBALLS_PLACED_ON_TABLE call PlaySFX ret ; e0960 @@ -85090,7 +85483,7 @@ Functione0960: ; e0960 call Functione0398 add hl, hl add hl, hl - ld de, $4981 + ld de, Unknown_e0981 add hl, de ld a, [hli] ld c, a @@ -85103,6 +85496,7 @@ Functione0960: ; e0960 ret ; e0981 +Unknown_e0981: ; e0981 INCBIN "baserom.gbc", $e0981, $e0c37 - $e0981 ; known jump sources: e0147 (38:4147) @@ -85138,7 +85532,7 @@ Functione0c37: ; e0c37 (38:4c37) push af ld a, $5 ld [rSVBK], a ; $ff00+$70 - ld hl, $4c93 + ld hl, Unknown_e0c93 ld de, Unkn1Pals ; $d000 ld bc, $48 call CopyBytes @@ -85147,6 +85541,7 @@ Functione0c37: ; e0c37 (38:4c37) ret ; e0c93 (38:4c93) +Unknown_e0c93: ; e0c93 INCBIN "baserom.gbc",$e0c93,$e1190 - $e0c93 Functione1190: ; e1190 @@ -85244,7 +85639,7 @@ Functione124e: ; e124e .asm_e1252 call Random and $f - ld hl, $526d + ld hl, Unknown_e126d ld e, a ld d, $0 add hl, de @@ -85261,6 +85656,7 @@ Functione124e: ; e124e ret ; e126d +Unknown_e126d: ; e126d INCBIN "baserom.gbc",$e126d,$e127d - $e126d Functione127d: ; e127d @@ -85310,8 +85706,8 @@ Functione128d: ; e128d Functione12ca: ; e12ca ld a, [$cf63] ld e, a - ld d, $0 - ld hl, $52d9 + ld d, 0 + ld hl, Jumptable_e12d9 add hl, de add hl, de ld a, [hli] @@ -85320,7 +85716,177 @@ Functione12ca: ; e12ca jp [hl] ; e12d9 -INCBIN "baserom.gbc",$e12d9,$e13ee - $e12d9 +Jumptable_e12d9: ; e12d9 + dw Functione12db +; e12db + +Functione12db: ; e12db + ld a, [hJoyPressed] + and $8 + jp nz, Functione13de + ld a, [hJoyPressed] + and A_BUTTON + jp nz, Functione1376 + ld hl, $ffa9 + ld a, [hl] + and $40 + jr nz, .asm_e1301 + ld a, [hl] + and $80 + jr nz, .asm_e130d + ld a, [hl] + and $20 + jr nz, .asm_e1325 + ld a, [hl] + and $10 + jr nz, .asm_e1345 + ret + +.asm_e1301 + ld hl, $cf65 + ld a, [hl] + cp $6 + ret c + sub $6 + ld [hl], a + jr .asm_e1364 + +.asm_e130d + ld hl, $cf65 + ld a, [hl] + cp $19 + ret z + cp $1a + ret z + cp $1b + ret z + cp $1c + ret z + cp $1e + ret nc + add $6 + ld [hl], a + jr .asm_e1364 + +.asm_e1325 + ld hl, $cf65 + ld a, [hl] + and a + ret z + cp $6 + ret z + cp $c + ret z + cp $12 + ret z + cp $18 + ret z + cp $1e + ret z + cp $23 + jr z, .asm_e1341 + dec [hl] + jr .asm_e1364 + +.asm_e1341 + ld [hl], $1e + jr .asm_e1364 + +.asm_e1345 + ld hl, $cf65 + ld a, [hl] + cp $5 + ret z + cp $b + ret z + cp $11 + ret z + cp $17 + ret z + cp $1d + ret z + cp $23 + ret z + cp $1e + jr z, .asm_e1362 + inc [hl] + jr .asm_e1364 + +.asm_e1362 + ld [hl], $23 + +.asm_e1364 + ld a, [$cf64] + and a + jr nz, .asm_e136f + ld de, SFX_POUND + jr .asm_e1372 + +.asm_e136f + ld de, SFX_MOVE_PUZZLE_PIECE + +.asm_e1372 + call PlaySFX + ret +; e1376 + +Functione1376: ; e1376 + ld a, [$cf64] + and a + jr nz, .asm_e139f + call Functione1475 + and a + jr z, Functione13e4 + ld de, SFX_MEGA_KICK + call PlaySFX + ld [hl], $0 + ld [$cf66], a + call Functione14d9 + call Functione1441 + call WaitBGMap + call WaitSFX + ld a, $1 + ld [$cf64], a + ret + +.asm_e139f + call Functione1475 + and a + jr nz, Functione13e4 + ld de, SFX_PLACE_PUZZLE_PIECE_DOWN + call PlaySFX + ld a, [$cf66] + ld [hl], a + call Functione141f + call WaitBGMap + xor a + ld [$cf66], a + call Functione14d9 + xor a + ld [$cf64], a + call WaitSFX + call Functione14a0 + ret nc + call Functione128d + call ClearSprites + ld de, SFX_1ST_PLACE + call PlaySFX + call WaitSFX + call Functionaa5 + ld a, $1 + ld [$d0ec], a + +Functione13de: ; e13de + ld hl, $cf63 + set 7, [hl] + ret + +Functione13e4: ; e13e4 + ld de, SFX_WRONG + call PlaySFX + call WaitSFX + ret +; e13ee Functione13ee: ; e13ee ld de, $0014 @@ -85420,8 +85986,8 @@ Functione1441: ; e1441 Functione1463: ; e1463 ld e, a - ld d, $0 - ld hl, $5559 + ld d, 0 + ld hl, Unknown_e1559 add hl, de ld a, [$cf65] ld e, a @@ -85446,7 +86012,7 @@ Functione1475: ; e1475 Functione1481: ; e1481 ld a, [$cf66] - ld hl, $548f + ld hl, Unknown_e148f add l ld l, a ld a, $0 @@ -85456,7 +86022,31 @@ Functione1481: ; e1481 ret ; e148f -INCBIN "baserom.gbc",$e148f,$e14d9 - $e148f +Unknown_e148f: ; e148f +INCBIN "baserom.gbc", $e148f, $e14a0 - $e148f + +Functione14a0: ; e14a0 + ld hl, Unknown_e14b5 + ld de, PlayerSDefLevel + ld c, $24 +.asm_e14a8 + ld a, [de] + cp [hl] + jr nz, .asm_e14b3 + inc de + inc hl + dec c + jr nz, .asm_e14a8 + scf + ret + +.asm_e14b3 + and a + ret +; e14b5 + +Unknown_e14b5: ; e14b5 +INCBIN "baserom.gbc", $e14b5, $e14d9 - $e14b5 Functione14d9: ; e14d9 call Functione1481 @@ -85469,11 +86059,11 @@ Functione14d9: ; e14d9 ld a, [DefaultFlypoint] cp $e0 jr z, .asm_e14f2 - ld hl, $550f + ld hl, Unknown_e150f jr .asm_e14f5 .asm_e14f2 - ld hl, $5534 + ld hl, Unknown_e1534 .asm_e14f5 ld de, Sprites @@ -85499,7 +86089,14 @@ Functione14d9: ; e14d9 jr .asm_e14f8 ; e150f -INCBIN "baserom.gbc",$e150f,$e1631 - $e150f +Unknown_e150f: ; e150f +INCBIN "baserom.gbc",$e150f,$e1534 - $e150f + +Unknown_e1534: ; e1534 +INCBIN "baserom.gbc",$e1534,$e1559 - $e1534 + +Unknown_e1559: ; e1559 +INCBIN "baserom.gbc",$e1559,$e1631 - $e1559 Functione1631: ; e1631 ld hl, VTiles2 @@ -85596,7 +86193,7 @@ Functione1654: ; e1654 Functione16aa: ; e16aa push hl - ld hl, $56b7 + ld hl, Unknown_e16b7 add l ld l, a ld a, $0 @@ -85607,10 +86204,11 @@ Functione16aa: ; e16aa ret ; e16b7 +Unknown_e16b7: ; e16b7 INCBIN "baserom.gbc",$e16b7,$e16c7 - $e16b7 Functione16c7: ; e16c7 - ld hl, $5703 + ld hl, Unknown_e1703 ld a, $8 .asm_e16cc push af @@ -85663,14 +86261,15 @@ Functione16e2: ; e16e2 ret ; e1703 +Unknown_e1703: ; e1703 INCBIN "baserom.gbc",$e1703,$e17a3 - $e1703 Functione17a3: ; e17a3 ld a, [ScriptVar] and $3 ld e, a - ld d, $0 - ld hl, $57bd + ld d, 0 + ld hl, Unknown_e17bd add hl, de add hl, de ld a, [hli] @@ -85682,6 +86281,7 @@ Functione17a3: ; e17a3 ret ; e17bd +Unknown_e17bd: ; e17bd INCBIN "baserom.gbc",$e17bd,$e1e5b - $e17bd ; no known jump sources @@ -85699,7 +86299,7 @@ Functione1e67: ; e1e67 (38:5e67) ld b, $8 call GetSGBLayout callab Function8cf53 - ld hl, $6221 + ld hl, LZ_e2221 ld de, $9000 call Decompress ld hl, $40ed @@ -85909,7 +86509,7 @@ Functione1fba: ; e1fba Functione1fcc: ; e1fcc ld a, [hJoypadPressed] - and $1 + and A_BUTTON ret z xor a ld [$c708], a @@ -85993,7 +86593,7 @@ Functione2010: ; e2010 ld hl, $c4a5 add hl, de call Functione2128 - ld hl, $6083 + ld hl, UnknownText_0xe2083 call PrintText ret @@ -86006,12 +86606,38 @@ Functione2010: ; e2010 ld a, [$c701] call Functione2183 call Functione2128 - ld hl, $6098 + ld hl, UnknownText_0xe2098 call PrintText ret ; e2083 -INCBIN "baserom.gbc", $e2083, $e209d - $e2083 +UnknownText_0xe2083: ; 0xe2083 + start_asm +; 0xe2084 + +Functione2084: ; e2084 + push bc + ld hl, $c5a6 + call Functione2128 + ld hl, UnknownText_0xe2093 + pop bc + inc bc + inc bc + inc bc + ret +; e2093 + +UnknownText_0xe2093: ; 0xe2093 + ; , yeah! + text_jump UnknownText_0x1c1a5b + db "@" +; 0xe2098 + +UnknownText_0xe2098: ; 0xe2098 + ; Darn… + text_jump UnknownText_0x1c1a65 + db "@" +; 0xe209d Functione209d: ; e209d ld hl, PlayerSDefLevel @@ -86082,15 +86708,16 @@ Functione2101: ; e2101 ld a, [$cfa9] dec a ld l, a - ld h, $0 + ld h, 0 add hl, hl add hl, hl add hl, hl - ld de, $6110 + ld de, Unknown_e2110 add hl, de ret ; e2110 +Unknown_e2110: ; e2110 INCBIN "baserom.gbc", $e2110, $e2128 - $e2110 Functione2128: ; e2128 @@ -86131,17 +86758,23 @@ Functione2152: ; e2152 ld a, $1 call ByteFill ld hl, TileMap - ld de, $6177 + ld de, String_e2177 call PlaceString ld hl, $c4af - ld de, $617d + ld de, String_e217d call PlaceString - ld hl, $6176 + ld hl, UnknownText_0xe2176 call PrintText ret ; e2176 -INCBIN "baserom.gbc", $e2176, $e2183 - $e2176 +UnknownText_0xe2176: ; 0xe2176 + db "@" +; 0xe2177 + +String_e2177: db "とったもの@" +String_e217d: db "あと かい@" +; e2183 Functione2183: ; e2183 ld d, $0 @@ -86259,6 +86892,7 @@ Functione21a1: ; e21a1 (38:61a1) ret ; e2221 (38:6221) +LZ_e2221: ; e2221 INCBIN "baserom.gbc",$e2221,$e2391 - $e2221 ; no known jump sources @@ -86302,7 +86936,7 @@ Functione2391: ; e2391 (38:6391) ; known jump sources: e23be (38:63be) Functione23d5: ; e23d5 (38:63d5) ld a, [$cf63] - ld hl, $63df + ld hl, Jumptable_e23df call Functione33df jp [hl] @@ -86322,7 +86956,7 @@ Functione23e9: ; e23e9 (38:63e9) call ClearSprites call Functione2d30 call Functione2a8e - ld de, $74dd + ld de, String_e34dd call Functione2a6e ld a, $5 ld [$cb2d], a @@ -86370,7 +87004,11 @@ Functione241a: ; e241a (38:641a) ret ; e2452 (38:6452) -INCBIN "baserom.gbc",$e2452,$e2457 - $e2452 +.asm_e2452 + ld hl, $cf63 + dec [hl] + ret + .asm_e2457 ld a, $4 ld [$cf63], a @@ -86385,7 +87023,7 @@ Functione245d: ; e245d (38:645d) ld [CurPartySpecies], a ; $d108 ld a, $17 call Functione33d0 - ld de, $74ea + ld de, String_e34ea call Functione2a6e ld a, $1 ld [$cfa9], a @@ -86404,8 +87042,8 @@ Functione247d: ; e247d (38:647d) dec a and $3 ld e, a - ld d, $0 - ld hl, $64a1 + ld d, 0 + ld hl, BillsPCDepositJumptable add hl, de add hl, de ld a, [hli] @@ -86434,7 +87072,7 @@ BillsPCDepositFuncDeposit: ; e24a9 (38:64a9) ld [$cb2a], a ret .asm_e24c1 - ld de, $74ea + ld de, String_e34ea call Functione2a6e ret @@ -86458,7 +87096,7 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0) jr c, BillsPCDepositFuncCancel ld a, [$cfa9] push af - ld de, $74f4 + ld de, String_e34f4 call Functione2a6e call Function1d6e lb bc, 14, 11 @@ -86484,7 +87122,7 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0) pop af ret .asm_e252c - ld de, $74ea + ld de, String_e34ea call Functione2a6e pop af ld [$cfa9], a @@ -86514,7 +87152,21 @@ BillsPCDepositMenuData: ; 0xe2545 (38:6545) db "CANCEL@" ; 0xe2564 (38:6564) -INCBIN "baserom.gbc",$e2564,$e2583 - $e2564 +Functione2564: ; e2564 + ld hl, TileMap + ld b, $4 + ld c, $8 + call ClearBox + ld hl, $c4f0 + ld b, $a + ld c, $9 + call ClearBox + ld hl, $c5b8 + ld b, $2 + ld c, $8 + call ClearBox + ret +; e2583 ; no known jump sources Functione2583: ; e2583 (38:6583) @@ -86579,7 +87231,7 @@ Functione25dc: ; e25dc (38:65dc) call ClearSprites call Functione2d30 call Functione2a8e - ld de, $74dd + ld de, String_e34dd call Functione2a6e ld a, $5 ld [$cb2d], a @@ -86627,11 +87279,16 @@ Functione2612: ; e2612 (38:6612) ret ; e264a (38:664a) -INCBIN "baserom.gbc",$e264a,$e264f - $e264a +.asm_e264a + ld hl, $cf63 + dec [hl] + ret + .asm_e264f ld a, $4 ld [$cf63], a ret +; e2655 ; no known jump sources Functione2655: ; e2655 (38:6655) @@ -86642,7 +87299,7 @@ Functione2655: ; e2655 (38:6655) ld [CurPartySpecies], a ; $d108 ld a, $17 call Functione33d0 - ld de, $74ea + ld de, String_e34ea call Functione2a6e ld a, $1 ld [$cfa9], a @@ -86691,7 +87348,7 @@ BillsPCWithdrawFuncWithdraw: ; e26a1 (38:66a1) ld [$cb2a], a ret .asm_e26b9 - ld de, $74ea + ld de, String_e34ea call Functione2a6e ret @@ -86713,7 +87370,7 @@ BillsPCWithdrawFuncRelease: ; e26d8 (38:66d8) push af call Functione2f5f jr c, .asm_e2720 - ld de, $74f4 + ld de, String_e34f4 call Functione2a6e call Function1d6e lb bc, 14, 11 @@ -86739,7 +87396,7 @@ BillsPCWithdrawFuncRelease: ; e26d8 (38:66d8) pop af ret .asm_e2720 - ld de, $74ea + ld de, String_e34ea call Functione2a6e pop af ld [$cfa9], a @@ -86818,7 +87475,7 @@ Functione27ba: ; e27ba ld [hBGMapMode], a call ClearSprites call Functione2d30 - ld de, $74dd + ld de, String_e34dd call Functione2a6e ld a, $5 ld [$cb2d], a @@ -86894,7 +87551,7 @@ Functione283d: ; e283d ld [CurPartySpecies], a ld a, $17 call Functione33d0 - ld de, $74ea + ld de, String_e34ea call Functione2a6e ld a, $1 ld [$cfa9], a @@ -86903,7 +87560,7 @@ Functione283d: ; e283d ; e285d Functione285d: ; e285d - ld hl, $68c3 + ld hl, MenuDataHeader_0xe28c3 call Function1d3c ld a, [$cfa9] call Function1d4b @@ -86911,10 +87568,10 @@ Functione285d: ; e285d jp c, Functione28bd ld a, [$cfa9] dec a - and $3 + and 3 ld e, a - ld d, $0 - ld hl, $6881 + ld d, 0 + ld hl, Jumptable_e2881 add hl, de add hl, de ld a, [hli] @@ -86923,7 +87580,37 @@ Functione285d: ; e285d jp [hl] ; e2881 -INCBIN "baserom.gbc", $e2881, $e28bd - $e2881 +Jumptable_e2881: ; e2881 + dw Functione2887 + dw Functione28a5 + dw Functione28bd +; e2887 + +Functione2887: ; e2887 + call Functione2f18 + jp c, Functione28bd + ld a, [$cb2a] + ld [$cb2f], a + ld a, [$cb2b] + ld [$cb30], a + ld a, [$cb2e] + ld [$cb31], a + ld a, $4 + ld [$cf63], a + ret +; e28a5 + +Functione28a5: ; e28a5 + call Function1d6e + call Functione2f7e + call Function1c07 + call Functione2ac6 + call Functione2def + ld [CurPartySpecies], a + ld a, $17 + call Functione33d0 + ret +; e28bd Functione28bd: ; e28bd ld a, $0 @@ -86931,13 +87618,27 @@ Functione28bd: ; e28bd ret ; e28c3 -INCBIN "baserom.gbc", $e28c3, $e28df - $e28c3 +MenuDataHeader_0xe28c3: ; 0xe28c3 + db $40 ; flags + db 04, 09 ; start coords + db 13, 19 ; end coords + dw MenuData2_0xe28cb + db 1 ; default option +; 0xe28cb + +MenuData2_0xe28cb: ; 0xe28cb + db $80 ; flags + db 3 ; items + db "MOVE@" + db "STATS@" + db "CANCEL@" +; 0xe28df Functione28df: ; e28df xor a ld [hBGMapMode], a call Functione2d30 - ld de, $7500 + ld de, String_e3500 call Functione2a6e ld a, $5 ld [$cb2d], a @@ -87246,14 +87947,16 @@ Functione2a8e: ; e2a8e (38:6a8e) ld d, h jr .asm_e2ab6 .asm_e2ab3 - ld de, $6abd + ld de, String_e2abd .asm_e2ab6 ld hl, $c4be call PlaceString ret ; e2abd (38:6abd) -INCBIN "baserom.gbc",$e2abd,$e2ac6 - $e2abd +String_e2abd: + db "PARTY ゅょ@" +; e2ac6 ; known jump sources: e2403 (38:6403), e2435 (38:6435), e24d1 (38:64d1), e25fb (38:65fb), e262d (38:662d), e26c9 (38:66c9) Functione2ac6: ; e2ac6 (38:6ac6) @@ -87479,7 +88182,9 @@ Functione2c2c: ; e2c2c (38:6c2c) ret ; e2c67 (38:6c67) -INCBIN "baserom.gbc",$e2c67,$e2c6e - $e2c67 +String_e2c67: + db "CANCEL@" +; e2c6e ; known jump sources: e2c56 (38:6c56) Functione2c6e: ; e2c6e (38:6c6e) @@ -87488,7 +88193,7 @@ Functione2c6e: ; e2c6e (38:6c6e) ret z cp $ff jr nz, .asm_e2c7c - ld de, $6c67 + ld de, String_e2c67 call PlaceString ret .asm_e2c7c @@ -87582,12 +88287,14 @@ Functione2c6e: ; e2c6e (38:6c6e) call CloseSRAM pop hl .asm_e2d23 - ld de, $6d2a + ld de, String_e2d2a call PlaceString ret ; e2d2a (38:6d2a) -INCBIN "baserom.gbc",$e2d2a,$e2d30 - $e2d2a +String_e2d2a: + db "-----@" +; e2d30 ; known jump sources: e23ef (38:63ef), e25e7 (38:65e7) Functione2d30: ; e2d30 (38:6d30) @@ -87753,7 +88460,7 @@ Unknown_e2e2b: ; e2e2b INCBIN "baserom.gbc", $e2e2b, $e2e8c - $e2e2b Functione2e8c: ; e2e8c - ld hl, $6eac + ld hl, Unknown_e2eac ld de, Sprites .asm_e2e92 ld a, [hl] @@ -87778,6 +88485,7 @@ Functione2e8c: ; e2e8c jr .asm_e2e92 ; e2eac +Unknown_e2eac: ; e2eac INCBIN "baserom.gbc", $e2eac, $e2ee5 - $e2eac Functione2ee5: ; e2ee5 @@ -87804,9 +88512,9 @@ Functione2ee5: ; e2ee5 ret .asm_e2f02 - ld de, $7521 + ld de, String_e3521 call Functione2a6e - ld de, $0019 + ld de, SFX_WRONG call WaitPlaySFX call WaitSFX ld c, $32 @@ -87836,13 +88544,13 @@ Functione2f18: ; e2f18 (38:6f18) and a ret .asm_e2f3f - ld de, $7544 + ld de, String_e3544 jr .asm_e2f4c .asm_e2f44 - ld de, $7531 + ld de, String_e3531 jr .asm_e2f4c .asm_e2f49 - ld de, $750f + ld de, String_e350f .asm_e2f4c call Functione2a6e ld de, SFX_WRONG @@ -87856,14 +88564,14 @@ Functione2f18: ; e2f18 (38:6f18) ; known jump sources: e24e5 (38:64e5), e26dc (38:66dc) Functione2f5f: ; e2f5f (38:6f5f) ld a, [CurPartySpecies] ; $d108 - cp $fd + cp EGG jr z, .asm_e2f68 and a ret .asm_e2f68 - ld de, $7597 + ld de, String_e3597 call Functione2a6e - ld de, $19 + ld de, SFX_WRONG call WaitPlaySFX call WaitSFX ld c, $32 @@ -87887,11 +88595,11 @@ Functione2f7e: ; e2f7e (38:6f7e) Functione2f95: ; e2f95 (38:6f95) ld hl, hJoyPressed ; $ffa7 ld a, [hl] - and $33 + and A_BUTTON | B_BUTTON | D_RIGHT + D_LEFT ld [$cf73], a jr nz, .asm_e2fd0 ld a, [hl] - and $c0 + and D_DOWN | D_UP ld [$cf73], a jr nz, .asm_e2faa jr .asm_e2fd0 @@ -88018,7 +88726,7 @@ Functione307c: ; e307c (38:707c) call TextBox call WaitBGMap ld hl, $c5e1 - ld de, $7563 + ld de, String_e3563 call PlaceString ld l, c ld h, b @@ -88031,9 +88739,9 @@ Functione307c: ; e307c (38:707c) and a ret .asm_e30e4 - ld de, $7575 + ld de, String_e3575 call Functione2a6e - ld de, $19 + ld de, SFX_WRONG call WaitPlaySFX call WaitSFX ld c, $32 @@ -88074,7 +88782,7 @@ Functione30fa: ; e30fa (38:70fa) call TextBox call WaitBGMap ld hl, $c5e1 - ld de, $756b + ld de, String_e356b call PlaceString ld l, c ld h, b @@ -88087,9 +88795,9 @@ Functione30fa: ; e30fa (38:70fa) and a ret .asm_e316a - ld de, $7586 + ld de, String_e3586 call Functione2a6e - ld de, $19 + ld de, SFX_WRONG call WaitPlaySFX call WaitSFX ld c, $32 @@ -88120,7 +88828,7 @@ Functione3180: ; e3180 (38:7180) ld [$d265], a call GetPokemonName ld hl, $c5e1 - ld de, $7551 + ld de, String_e3551 call PlaceString ld c, $50 call DelayFrames @@ -88128,7 +88836,7 @@ Functione3180: ; e3180 (38:7180) ld bc, $112 call TextBox ld hl, $c5e1 - ld de, $755e + ld de, String_e355e call PlaceString ld l, c ld h, b @@ -88152,7 +88860,7 @@ Functione31e7: ; e31e7 ld bc, $0112 call TextBox ld hl, $c5e1 - ld de, $7233 + ld de, String_e3233 call PlaceString ld c, $14 call DelayFrames @@ -88175,18 +88883,170 @@ Functione31e7: ; e31e7 set 1, c .asm_e321d - ld hl, $7245 + ld hl, Jumptable_e3245 add hl, bc add hl, bc ld a, [hli] ld h, [hl] ld l, a - ld de, $722a + ld de, Functione322a push de jp [hl] ; e322a -INCBIN "baserom.gbc", $e322a, $e3357 - $e322a +Functione322a: ; e322a + pop af + ld e, a + callba Function14ad5 + ret +; e3233 + +String_e3233: + db "Saving… Leave ON!@" +; e3245 + +Jumptable_e3245: ; e3245 + dw Functione324d + dw Functione3267 + dw Functione327d + dw Functione3284 +; e324d + +Functione324d: ; e324d + ld hl, $cb31 + ld a, [$cb2e] + cp [hl] + jr z, .asm_e325d + call Functione32b0 + call Functione32fa + ret + +.asm_e325d + call Functione32b0 + call Functione328e + call Functione32fa + ret +; e3267 + +Functione3267: ; e3267 + call Functione3316 + ld a, $1 + ld [$c2cd], a + callba Function14b85 + xor a + ld [$c2cd], a + call Functione32fa + ret +; e327d + +Functione327d: ; e327d + call Functione32b0 + call Functione3346 + ret +; e3284 + +Functione3284: ; e3284 + call Functione3316 + call Functione328e + call Functione3346 + ret +; e328e + +Functione328e: ; e328e + ld a, [$cb2b] + ld hl, $cb2a + add [hl] + ld e, a + ld a, [$cb30] + ld hl, $cb2f + add [hl] + cp e + ret nc + ld hl, $cb2b + ld a, [hl] + and a + jr z, .asm_e32a8 + dec [hl] + ret + +.asm_e32a8 + ld hl, $cb2a + ld a, [hl] + and a + ret z + dec [hl] + ret +; e32b0 + +Functione32b0: ; e32b0 + ld a, [$cb31] + dec a + ld e, a + callba Function14ac2 + ld a, [$cb30] + ld hl, $cb2f + add [hl] + ld [CurPartyMon], a + ld a, $1 + call GetSRAMBank + ld hl, BoxSpecies + call Functione3357 + ld hl, BoxMon1Nickname + call Functione3363 + ld hl, BoxMon1OT + call Functione3376 + ld hl, BoxMon1Species + ld bc, $0020 + call Functione3389 + call CloseSRAM + callba Function5088b + ld a, $1 + ld [$d10b], a + callba Functione039 + ret +; e32fa + +Functione32fa: ; e32fa + ld a, [$cb2e] + dec a + ld e, a + callba Function14ac2 + ld a, [$cb2b] + ld hl, $cb2a + add [hl] + ld [CurPartyMon], a + callba Function51322 + ret +; e3316 + +Functione3316: ; e3316 + ld a, [$cb30] + ld hl, $cb2f + add [hl] + ld [CurPartyMon], a + ld hl, PartySpecies + call Functione3357 + ld hl, PartyMon1Nickname + call Functione3363 + ld hl, PartyMon1OT + call Functione3376 + ld hl, PartyMon1Species + ld bc, $0030 + call Functione3389 + xor a + ld [$d10b], a + callba Functione039 + ret +; e3346 + +Functione3346: ; e3346 + ld a, [$cb2b] + ld hl, $cb2a + add [hl] + ld [CurPartyMon], a + callba Function5138b + ret +; e3357 ; known jump sources: e2ff2 (38:6ff2), e3023 (38:7023), e3052 (38:7052) Functione3357: ; e3357 (38:7357) @@ -88230,8 +89090,8 @@ Functione3389: ; e3389 (38:7389) Functione3396: ; e3396 (38:7396) dec b ld c, b - ld b, $0 - ld hl, $73a6 + ld b, 0 + ld hl, Unknown_e33a6 add hl, bc add hl, bc add hl, bc @@ -88243,7 +89103,23 @@ Functione3396: ; e3396 (38:7396) ret ; e33a6 (38:73a6) -INCBIN "baserom.gbc",$e33a6,$e33d0 - $e33a6 +Unknown_e33a6: ; e33a6 + ; bank, address + dbw $02, $a000 + dbw $02, $a450 + dbw $02, $a8a0 + dbw $02, $acf0 + dbw $02, $b140 + dbw $02, $b590 + dbw $02, $b9e0 + dbw $03, $a000 + dbw $03, $a450 + dbw $03, $a8a0 + dbw $03, $acf0 + dbw $03, $b140 + dbw $03, $b590 + dbw $03, $b9e0 +; e33d0 ; known jump sources: e240d (38:640d), e246b (38:646b), e24dc (38:64dc), e2605 (38:6605), e2663 (38:6663), e26d4 (38:66d4) Functione33d0: ; e33d0 (38:73d0) @@ -88292,7 +89168,23 @@ PCSelectLZ: INCBIN "gfx/pc.2bpp.lz" PCMailGFX: INCBIN "gfx/pc_mail.2bpp" ; e34dd -INCBIN "baserom.gbc",$e34dd,$e35aa - $e34dd +String_e34dd: db "Choose a ゅょ.@" +String_e34ea: db "What's up?@" +String_e34f4: db "Release ゅょ?@" +String_e3500: db "Move to where?@" +String_e350f: db "It's your last ゅょ!@" +String_e3521: db "There's no room!@" +String_e3531: db "No more usable ゅょ!@" +String_e3544: db "Remove MAIL.@" +String_e3551: db "Released ゅょ.@" +String_e355e: db "Bye,@" +String_e3563: db "Stored @" +String_e356b: db "Got @" +String_e3570: db "Non.@" +String_e3575: db "The BOX is full.@" +String_e3586: db "The party's full!@" +String_e3597: db "No releasing EGGS!@" +; e35aa ; no known jump sources Functione35aa: ; e35aa (38:75aa)