mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-09-09 09:51:34 -07:00
label overworld loop functions
This commit is contained in:
parent
ace57ec827
commit
58af27eaeb
@ -3,23 +3,23 @@ INCLUDE "includes.asm"
|
||||
|
||||
SECTION "Events", ROMX, BANK[EVENTS]
|
||||
|
||||
Function966b0: ; 966b0
|
||||
OverworldLoop: ; 966b0
|
||||
xor a
|
||||
ld [$d432], a
|
||||
.asm_966b4
|
||||
ld a, [$d432]
|
||||
ld hl, .pointers
|
||||
ld [MapStatus], a
|
||||
.loop
|
||||
ld a, [MapStatus]
|
||||
ld hl, .jumps
|
||||
rst JumpTable
|
||||
ld a, [$d432]
|
||||
ld a, [MapStatus]
|
||||
cp 3 ; done
|
||||
jr nz, .asm_966b4
|
||||
jr nz, .loop
|
||||
.done
|
||||
ret
|
||||
|
||||
.pointers
|
||||
dw Function96724
|
||||
dw Function9673e
|
||||
dw Function96773
|
||||
.jumps
|
||||
dw StartMap
|
||||
dw EnterMap
|
||||
dw HandleMap
|
||||
dw .done
|
||||
; 966cb
|
||||
|
||||
@ -115,12 +115,12 @@ Function9671e: ; 9671e
|
||||
; 96724
|
||||
|
||||
|
||||
Function96724: ; 96724
|
||||
StartMap: ; 96724
|
||||
xor a
|
||||
ld [ScriptVar], a
|
||||
xor a
|
||||
ld [ScriptRunning], a
|
||||
ld hl, $d432
|
||||
ld hl, MapStatus
|
||||
ld bc, $3e
|
||||
call ByteFill
|
||||
callba Function113e5
|
||||
@ -129,28 +129,31 @@ Function96724: ; 96724
|
||||
; 9673e
|
||||
|
||||
|
||||
Function9673e: ; 9673e
|
||||
EnterMap: ; 9673e
|
||||
xor a
|
||||
ld [$d453], a
|
||||
ld [$d454], a
|
||||
call Function968d1
|
||||
callba Function15363
|
||||
call Function966cb
|
||||
|
||||
ld a, [$ff9f]
|
||||
cp $f7
|
||||
jr nz, .asm_9675a
|
||||
call Function966d0
|
||||
.asm_9675a
|
||||
|
||||
ld a, [$ff9f]
|
||||
cp $f3
|
||||
jr nz, .asm_96764
|
||||
xor a
|
||||
ld [PoisonStepCount], a
|
||||
.asm_96764
|
||||
|
||||
xor a
|
||||
ld [$ff9f], a
|
||||
ld a, $2
|
||||
ld [$d432], a
|
||||
ld a, 2 ; HandleMap
|
||||
ld [MapStatus], a
|
||||
ret
|
||||
; 9676d
|
||||
|
||||
@ -162,14 +165,17 @@ Function9676d: ; 9676d
|
||||
; 96773
|
||||
|
||||
|
||||
Function96773: ; 96773
|
||||
HandleMap: ; 96773
|
||||
call ResetOverworldDelay
|
||||
call Function967c1
|
||||
callba Function97e08
|
||||
call DoEvents
|
||||
ld a, [$d432]
|
||||
cp 2
|
||||
call MapEvents
|
||||
|
||||
; Not immediately entering a connected map will cause problems.
|
||||
ld a, [MapStatus]
|
||||
cp 2 ; HandleMap
|
||||
ret nz
|
||||
|
||||
call Function967d1
|
||||
call NextOverworldFrame
|
||||
call Function967e1
|
||||
@ -178,25 +184,25 @@ Function96773: ; 96773
|
||||
; 96795
|
||||
|
||||
|
||||
DoEvents: ; 96795
|
||||
ld a, [$d433]
|
||||
ld hl, .pointers
|
||||
MapEvents: ; 96795
|
||||
ld a, [MapEventStatus]
|
||||
ld hl, .jumps
|
||||
rst JumpTable
|
||||
ret
|
||||
|
||||
.pointers
|
||||
dw Function967a1
|
||||
dw Function967ae
|
||||
.jumps
|
||||
dw .events
|
||||
dw .no_events
|
||||
; 967a1
|
||||
|
||||
Function967a1: ; 967a1
|
||||
.events ; 967a1
|
||||
call PlayerEvents
|
||||
call Function966cb
|
||||
callba ScriptEvents
|
||||
ret
|
||||
; 967ae
|
||||
|
||||
Function967ae: ; 967ae
|
||||
.no_events ; 967ae
|
||||
ret
|
||||
; 967af
|
||||
|
||||
@ -220,11 +226,11 @@ NextOverworldFrame: ; 967b7
|
||||
ret
|
||||
; 967c1
|
||||
|
||||
|
||||
Function967c1: ; 967c1
|
||||
ld a, [$d433]
|
||||
cp 1
|
||||
ld a, [MapEventStatus]
|
||||
cp 1 ; no events
|
||||
ret z
|
||||
|
||||
call UpdateTime
|
||||
call GetJoypad
|
||||
call TimeOfDayPals
|
||||
@ -256,13 +262,13 @@ Function967f4: ; 967f4
|
||||
call Function966d0
|
||||
|
||||
.asm_96806
|
||||
ld a, $0
|
||||
ld [$d433], a
|
||||
ld a, 0 ; events
|
||||
ld [MapEventStatus], a
|
||||
ret
|
||||
|
||||
.asm_9680c
|
||||
ld a, $1
|
||||
ld [$d433], a
|
||||
ld a, 1 ; no events
|
||||
ld [MapEventStatus], a
|
||||
ret
|
||||
; 96812
|
||||
|
||||
@ -270,8 +276,8 @@ Function96812: ; 96812
|
||||
ld hl, $d150
|
||||
bit 6, [hl]
|
||||
ret z
|
||||
callba Function81ca
|
||||
|
||||
callba Function81ca
|
||||
ret
|
||||
; 9681f
|
||||
|
||||
@ -335,6 +341,7 @@ CheckTrainerBattle3: ; 96867
|
||||
nop
|
||||
call CheckTrainerBattle2
|
||||
jr nc, .asm_96872
|
||||
|
||||
ld a, 1
|
||||
scf
|
||||
ret
|
||||
|
2
main.asm
2
main.asm
@ -4189,7 +4189,7 @@ Function5e5d: ; 5e5d
|
||||
res 7, [hl]
|
||||
ld hl, $d83e
|
||||
set 1, [hl]
|
||||
callba Function966b0
|
||||
callba OverworldLoop
|
||||
ld a, [$d4b5]
|
||||
cp $2
|
||||
jr z, .asm_5e80
|
||||
|
Loading…
Reference in New Issue
Block a user