diff options
-rw-r--r-- | home/map.asm | 235 | ||||
-rw-r--r-- | home/overworld.asm | 3 | ||||
-rw-r--r-- | home/unknown_388f.asm | 2 | ||||
-rw-r--r-- | shim.sym | 7 | ||||
-rw-r--r-- | tools/map2link.py | 2 | ||||
-rw-r--r-- | wram.asm | 2 |
6 files changed, 247 insertions, 4 deletions
diff --git a/home/map.asm b/home/map.asm index 643ba1a..c07bc96 100644 --- a/home/map.asm +++ b/home/map.asm @@ -1538,6 +1538,202 @@ FillEastConnectionStrip:: ; 2a60 jr nz, .loop ret +Function2a85:: +.asm_2a85: ; 00:2a85 + call LoadMap + call Function2a8d + jr .asm_2a85 + +Function2a8d:: ; 00:2a8d + push hl + push de + push bc + push af + + ld a, [wd637] + and $f + add a + ld e, a + ld d, $0 + ld hl, .Pointers + add hl, de + add hl, de + + ld a, [hli] + call Bankswitch + + inc hl + ld a, [hli] + ld h, [hl] + ld l, a + ld de, .Return + push de + jp hl + +.Return: ; 00:2aac + pop af + pop bc + pop de + pop hl + ret + +.Pointers: ; 00:2ab1 + dbbw $00, $55, Function2ae5 + dbbw $00, $55, Function2b52 + dbbw $00, $55, Function2b77 + dbbw $0e, $33, Function3904 + dbbw $00, $55, Function2b39 + dbbw $0e, $33, Function391f + dbbw $00, $33, Function2b78 + dbbw $00, $33, Function2b78 + dbbw $0e, $33, Function3904 + dbbw $00, $55, Function2b79 + dbbw $00, $55, Function2b87 + dbbw $0e, $33, Function3920 + dbbw $05, $33, Function14777 + +Function2ae5:: +.asm_2ae5: ; 00:2ae5 + ld hl, wJoypadFlags + set 4, [hl] + set 6, [hl] + call UpdateTime + call TimeOfDayPals + ld hl, wJoypadFlags + res 4, [hl] + res 6, [hl] + call GetJoypad + call Function2be5 + ld hl, wc5ed + bit 7, [hl] + res 7, [hl] + ret nz + call Function38e3 + ret nz + call OverworldStartButtonCheck + ret nz + ld hl, PlaceWaitingText + ld a, $3 + call FarCall_hl + ldh a, [hMapEntryMethod] + and a + ret nz + call Function2c4a + jr nc, .asm_2ae5 + callba Function824c + ld a, [wc5ed] + bit 6, a + jr nz, .asm_2ae5 + call CheckMovingOffEdgeOfMap + ret c + call WarpCheck + ret c + jr .asm_2ae5 + +Function2b39:: + ld hl, wJoypadFlags + res 4, [hl] + res 6, [hl] + ld hl, wce63 + res 6, [hl] + res 7, [hl] + ld hl, wVramState + res 7, [hl] + ld a, $0 + call WriteIntod637 + ret + +Function2b52:: +.asm_2b52: ; 00:2b52 + call UpdateTime + ld a, [wVramState] + bit 7, a + jr z, Function2b39 + ldh a, [hMapEntryMethod] + and a + ret nz + call Function2c4a + jr nc, .asm_2b52 + callba Function824c + call CheckMovingOffEdgeOfMap + ret c + call WarpCheck + ret c + jr .asm_2b52 + +Function2b77:: + ret + +Function2b78:: + ret + +Function2b79:: + callab Functionfce3e + ld a, $4 + call WriteIntod637 + ret + +Function2b87:: +.asm_2b87: ; 00:2b87 + call UpdateTime + call GetJoypad + call OverworldStartButtonCheck + ret nz + callab Functionc000 + call Function2ba8 + jr nc, .asm_2b87 + callba Function824c + jr .asm_2b87 + +Function2ba8:: ; 00:2ba8 + ldh a, [hROMBank] + push af + ld a, $1 + call Bankswitch + call Function50b9 + call Function18a0 + ld a, $3 + call Bankswitch + call Functiond6e4 + ld a, $1 + call Bankswitch + call _UpdateSprites + call DelayFrame + call Function2075 + ld hl, wd14f + set 2, [hl] + call DelayFrame + pop af + call Bankswitch + and a + ld a, [wcb6e] + bit 5, a + ret z + bit 6, a + jr z, Function2ba8 + scf + ret + +Function2be5:: ; 00:2be5 + ld a, [wce63] + bit 7, a + ret nz + ld a, [wMapGroup] + ld b, a + ld a, [wMapId] + ld c, a + call SwitchToAnyMapBank + call QueueMapTextSubroutine + ld hl, wMapScriptPtr + ld a, [hli] + ld h, [hl] + ld l, a + ld de, .Return + push de + jp hl + +.Return: ; 00:2c04 + ret SECTION "LoadTilesetGFX", ROM0[$2D26] LoadTilesetGFX:: ; 2d26 @@ -1892,8 +2088,45 @@ GetBlockLocation:: ; 2ef8 add hl, bc ret +GetFacingSignpost:: ; 00:2f1d + call GetFacingTileCoord + ld b, a + ld a, d + sub $4 + ld d, a + ld a, e + sub $4 + ld e, a + ld a, [wCurrMapSignCount] + and a + ret z + ld c, a + ld hl, wCurrMapSigns +.asm_2f32: ; 00:2f32 + ld a, [hli] + cp e + jr nz, .asm_2f3e + ld a, [hli] + cp d + jr nz, .asm_2f3f + ld a, [hli] + cp b ; useless comparison + jr .asm_2f46 + +.asm_2f3e: ; 00:2f3e + inc hl +.asm_2f3f: ; 00:2f3f + inc hl + inc hl + dec c + jr nz, .asm_2f32 + xor a + ret + +.asm_2f46: ; 00:2f46 + scf + ret -SECTION "LoadTileset", ROM0[$2F48] LoadTileset:: ; 2f48 push hl push bc diff --git a/home/overworld.asm b/home/overworld.asm index 4b10b72..8ea66ca 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -42,6 +42,9 @@ CheckStartmenuSelectHook: dec a ret +Function2c4a:: +; TODO + if DEBUG SECTION "Install StartMenu Hook Function", ROM0[$35EC] else diff --git a/home/unknown_388f.asm b/home/unknown_388f.asm index 58c83fa..453c2f8 100644 --- a/home/unknown_388f.asm +++ b/home/unknown_388f.asm @@ -80,7 +80,7 @@ Function3904:: Function391f:: ret -Function3910:: +Function3920:: ld a, [wcd5d] cp $1 jr z, .asm_392d @@ -1,5 +1,4 @@ ; ROM0 -00:2F1D GetFacingSignpost 00:3111 Function3111 00:3171 Function3171 00:319B Function319b @@ -29,6 +28,7 @@ 01:4031 DebugMenu 01:40EB Function40eb 01:5007 Function5007 +01:50B9 Function50b9 01:5190 _UpdateSprites 01:5190 Function5190 01:53CC MainMenu @@ -45,6 +45,7 @@ 02:4125 Function8125 02:4131 Function8131 02:413D Function813d +02:424C Function824c 02:43E8 Function83e8 02:45DF QueueFollowerFirstStep 02:462E Function862e @@ -58,6 +59,7 @@ 02:528B Function928b 02:5695 CheckSGB +03:4000 Functionc000 03:4791 DebugWarp 03:479F DebugWarp.Destinations 03:488D Tilesets @@ -71,6 +73,7 @@ 03:4E10 Functionce10_2 03:4E3C Functionce3c 03:4E7C Functionce7c +03:56E4 Functiond6e4 03:5886 Functiond886 03:5A28 Functionda28 03:5A4F Functionda4f @@ -111,6 +114,7 @@ ; ptr Copied to c5eb ; word Unknown (2 bytes) 05:470E UnknownMapBufferPointers +05:4777 Function14777 05:4CAC Function14cac 05:4DAC Function14dac 05:4DC4 Function14dc4 @@ -455,6 +459,7 @@ 3A:52C7 Music 3F:40E9 InGameDebugMenu +3F:4E3E Functionfce3e 3F:5B66 Functionfdb66 3F:6255 Functionfe255 3F:64CE MonsterTest diff --git a/tools/map2link.py b/tools/map2link.py index f78e46f..f1cd3a3 100644 --- a/tools/map2link.py +++ b/tools/map2link.py @@ -179,7 +179,7 @@ def main(): if section.start > start: print(f'\t; ${start:04x}', file=args.linkfile) print(f'\torg ${section.start:04x}', file=args.linkfile) - print(f'\t"{section.name}" ; size: ${section.size:04x}', file=args.linkfile) + print(f'\t"{section.name}" ; ${section.start:04x}, size: ${section.size:04x}', file=args.linkfile) start = section.end @@ -233,6 +233,8 @@ wVBCopyDst:: ds 2 ; cb65 wVBCopyDoubleSize:: ds 1 ; cb67 wVBCopyDoubleSrc:: ds 2 ; cb68 wVBCopyDoubleDst:: ds 2 ; cb6a + ds 2 +wcb6e:: db SECTION "CB71", WRAM0[$CB70] |