object_struct

This commit is contained in:
PikalaxALT 2015-11-02 11:15:32 -05:00
parent 76e2ea534f
commit d35cfad0de
15 changed files with 333 additions and 361 deletions

View File

@ -3247,7 +3247,7 @@ MonFaintedAnimation: ; 3d444
Function3d490: ; 3d490 Function3d490: ; 3d490
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld c, a ld c, a
.asm_3d493 .asm_3d493
push bc push bc
@ -3271,7 +3271,7 @@ Function3d490: ; 3d490
; 3d4ae ; 3d4ae
Function3d4ae: ; 3d4ae Function3d4ae: ; 3d4ae
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld c, a ld c, a
cp $8 cp $8
jr nz, .back jr nz, .back
@ -9486,7 +9486,7 @@ Function3fc30: ; 3fc30
Function3fc5b: ; 3fc5b Function3fc5b: ; 3fc5b
ld hl, Sprites ld hl, Sprites
xor a xor a
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld b, $6 ld b, $6
ld e, $a8 ld e, $a8
.asm_3fc65 .asm_3fc65
@ -9497,10 +9497,10 @@ Function3fc5b: ; 3fc5b
inc hl inc hl
ld [hl], e ld [hl], e
inc hl inc hl
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld [hli], a ld [hli], a
inc a inc a
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld a, $1 ld a, $1
ld [hli], a ld [hli], a
ld a, d ld a, d
@ -9508,9 +9508,9 @@ Function3fc5b: ; 3fc5b
ld d, a ld d, a
dec c dec c
jr nz, .asm_3fc69 jr nz, .asm_3fc69
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
add $3 add $3
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld a, e ld a, e
add $8 add $8
ld e, a ld e, a

View File

@ -516,7 +516,7 @@ const_value SET 1
const OBJECT_SPRITE const OBJECT_SPRITE
const OBJECT_MAP_OBJECT_INDEX const OBJECT_MAP_OBJECT_INDEX
const OBJECT_SPRITE_TILE const OBJECT_SPRITE_TILE
const OBJECT_03 const OBJECT_MOVEMENTTYPE
const OBJECT_FLAGS1 const OBJECT_FLAGS1
const OBJECT_FLAGS2 const OBJECT_FLAGS2
const OBJECT_PALETTE const OBJECT_PALETTE

View File

@ -396,7 +396,7 @@ CheckTileEvent: ; 96874
ret ret
.return6 .return6
ld a, [StandingTile] ld a, [PlayerStandingTile]
call CheckPitTile call CheckPitTile
jr nz, .pittile jr nz, .pittile
ld a, 6 ld a, 6
@ -606,7 +606,7 @@ TryObjectEvent: ; 969b5
.IsObject .IsObject
call PlayTalkObject call PlayTalkObject
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
call GetObjectStruct call GetObjectStruct
ld hl, OBJECT_MAP_OBJECT_INDEX ld hl, OBJECT_MAP_OBJECT_INDEX
add hl, bc add hl, bc

View File

@ -161,7 +161,7 @@ CanUseSweetScent:: ; 97cfd
jr nc, .no jr nc, .no
.ice_check .ice_check
ld a, [StandingTile] ld a, [PlayerStandingTile]
call CheckIceTile call CheckIceTile
jr z, .no jr z, .no
scf scf
@ -235,7 +235,7 @@ ChooseWildEncounter_BugContest:: ; 97d31
; 97d64 ; 97d64
TryWildEncounter_BugContest: ; 97d64 TryWildEncounter_BugContest: ; 97d64
ld a, [StandingTile] ld a, [PlayerStandingTile]
call CheckSuperTallGrassTile call CheckSuperTallGrassTile
ld b, 40 percent ld b, 40 percent
jr z, .ok jr z, .ok
@ -352,7 +352,7 @@ Function97e08:: ; 97e08
ld hl, wd6de ld hl, wd6de
xor a xor a
.asm_97e0c .asm_97e0c
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld a, [hl] ld a, [hl]
and a and a
jr z, .asm_97e19 jr z, .asm_97e19
@ -365,7 +365,7 @@ Function97e08:: ; 97e08
.asm_97e19 .asm_97e19
ld de, $0006 ld de, $0006
add hl, de add hl, de
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
inc a inc a
cp $4 cp $4
jr nz, .asm_97e0c jr nz, .asm_97e0c

View File

@ -828,7 +828,7 @@ Function4759: ; 4759
ret ret
; 4769 ; 4769
Function4769: ; 4769 RestoreDefaultMovement: ; 4769
ld hl, OBJECT_MAP_OBJECT_INDEX ld hl, OBJECT_MAP_OBJECT_INDEX
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
@ -1029,7 +1029,7 @@ Function4851: ; 4851
jp Function4b26 jp Function4b26
; 4869 ; 4869
Function4869: ; 4869 Function4869: ; standing?
call Function462a call Function462a
call Function467b call Function467b
ld hl, OBJECT_11 ld hl, OBJECT_11
@ -1083,7 +1083,7 @@ Function48a0: ; 48a0
; 48a6 ; 48a6
Function48a6: ; 48a6 Function48a6: ; 48a6
ld hl, Function500e ld hl, Function500e ; scripted
jp Function5041 jp Function5041
; 48ac ; 48ac
@ -1500,7 +1500,7 @@ Function4af0: ; 4af0
add hl, bc add hl, bc
ld [hl], 2 ld [hl], 2
ld hl, wd4cf ld hl, wd4cf
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
cp [hl] cp [hl]
jr z, .ok jr z, .ok
ld hl, OBJECT_09 ld hl, OBJECT_09
@ -2047,7 +2047,7 @@ Function4e0c: ; 4e0c
; 4e13 ; 4e13
Function4e13: ; 4e13 Function4e13: ; 4e13
call Function4769 call RestoreDefaultMovement
call Function1a47 call Function1a47
ld hl, OBJECT_FACING ld hl, OBJECT_FACING
add hl, bc add hl, bc
@ -2396,7 +2396,7 @@ UpdateJumpPosition: ; 4fd5
db -11, -10, -9, -8, -6, -4, 0, 0 db -11, -10, -9, -8, -6, -4, 0, 0
; 5000 ; 5000
Function5000: ; 5000 Function5000: ; unscripted?
ld a, [wc2de] ld a, [wc2de]
ld hl, wc2df ld hl, wc2df
ld [hl], a ld [hl], a
@ -2406,8 +2406,8 @@ Function5000: ; 5000
ret ret
; 500e ; 500e
Function500e: ; 500e Function500e: ; scripted
ld hl, wc2e3 ld hl, wMovementDataPointer
call Function1aae call Function1aae
ret ret
; 5015 ; 5015
@ -2418,7 +2418,7 @@ Function5015: ; 5015
ld e, [hl] ld e, [hl]
inc [hl] inc [hl]
ld d, 0 ld d, 0
ld hl, wc2e2 ld hl, wMovementPerson
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
@ -2448,7 +2448,7 @@ Function5037: ; 5037
; 503d ; 503d
Function503d: ; 503d Function503d: ; 503d
ld a, [wc2e2] ld a, [wMovementPerson]
ret ret
; 5041 ; 5041
@ -2467,14 +2467,14 @@ Function5041: ; 5041
CopyMovementPointer: ; 5055 CopyMovementPointer: ; 5055
ld a, l ld a, l
ld [wc2eb], a ld [wMovementPointer], a
ld a, h ld a, h
ld [wc2ec], a ld [wMovementPointer + 1], a
ret ret
; 505e ; 505e
GetMovementByte: ; 505e GetMovementByte: ; 505e
ld hl, wc2eb ld hl, wMovementPointer
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
@ -2489,7 +2489,7 @@ Function5065: ; 5065
DoMovementFunction: ; 506b DoMovementFunction: ; 506b
push af push af
call Function54b8 call ApplyMovementToFollower
pop af pop af
ld hl, MovementPointers ld hl, MovementPointers
rst JumpTable rst JumpTable
@ -2502,14 +2502,14 @@ INCLUDE "engine/movement.asm"
; 54b8 ; 54b8
Function54b8: ; 54b8 ApplyMovementToFollower: ; 54b8
ld e, a ld e, a
ld a, [wd4ce] ld a, [wObjectFollow_Follower]
cp -1 cp -1
ret z ret z
ld a, [wd4cd] ld a, [wObjectFollow_Leader]
ld d, a ld d, a
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
cp d cp d
ret nz ret nz
ld a, e ld a, e
@ -2565,7 +2565,7 @@ Function54e6: ; 54e6
; 550a ; 550a
Function550a: ; 550a Function550a: ; 550a
ld a, [wd4cd] ld a, [wObjectFollow_Leader]
cp -1 cp -1
jr z, .nope jr z, .nope
push bc push bc
@ -2581,7 +2581,7 @@ Function550a: ; 550a
.nope .nope
ld a, $ff ld a, $ff
ld [wd4ce], a ld [wObjectFollow_Follower], a
ld a, $47 ld a, $47
scf scf
ret ret
@ -2652,7 +2652,7 @@ Function5565: ; 5565
Function5579: ; 5579 Function5579: ; 5579
push bc push bc
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld c, a ld c, a
call Function5582 call Function5582
pop bc pop bc
@ -2713,7 +2713,7 @@ Function55b9: ; 55b9
ld [hli], a ld [hli], a
ld a, [de] ld a, [de]
ld [hli], a ld [hli], a
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld [hli], a ld [hli], a
push hl push hl
ld hl, OBJECT_MAP_X ld hl, OBJECT_MAP_X
@ -2738,7 +2738,7 @@ Function55e0:: ; 55e0
ld bc, ObjectStructs ld bc, ObjectStructs
xor a xor a
.loop .loop
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
call GetObjectSprite call GetObjectSprite
jr z, .ok jr z, .ok
call Function565c call Function565c
@ -2748,7 +2748,7 @@ Function55e0:: ; 55e0
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
inc a inc a
cp NUM_OBJECT_STRUCTS cp NUM_OBJECT_STRUCTS
jr nz, .loop jr nz, .loop
@ -2802,13 +2802,13 @@ Function5645: ; 5645
xor a xor a
ld bc, ObjectStructs ld bc, ObjectStructs
.loop .loop
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
call Function5680 call Function5680
ld hl, OBJECT_STRUCT_LENGTH ld hl, OBJECT_STRUCT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
inc a inc a
cp NUM_OBJECT_STRUCTS cp NUM_OBJECT_STRUCTS
jr nz, .loop jr nz, .loop
@ -3033,7 +3033,7 @@ Function5781: ; 5781
ld bc, ObjectStructs ld bc, ObjectStructs
xor a xor a
.loop .loop
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
call GetObjectSprite call GetObjectSprite
jr z, .next jr z, .next
call Function437b call Function437b
@ -3043,7 +3043,7 @@ Function5781: ; 5781
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
inc a inc a
cp NUM_OBJECT_STRUCTS cp NUM_OBJECT_STRUCTS
jr nz, .loop jr nz, .loop
@ -3056,7 +3056,7 @@ Function579d: ; 579d
ld [wc2df], a ld [wc2df], a
xor a xor a
ld [wd04e], a ld [wd04e], a
ld [wd4e2], a ld [PlayerObject12], a
call Function57bc call Function57bc
callba CheckWarpCollision callba CheckWarpCollision
call c, SpawnInFacingDown call c, SpawnInFacingDown
@ -3101,7 +3101,7 @@ Function57db: ; 57db
Function57e2: ; 57e2 Function57e2: ; 57e2
ld a, d ld a, d
and $80 and %10000000
ret z ret z
ld bc, NONE ; debug? ld bc, NONE ; debug?
ld hl, OBJECT_FACING ld hl, OBJECT_FACING
@ -3123,69 +3123,69 @@ Function57e2: ; 57e2
ret ret
; 5803 ; 5803
Function5803:: ; 5803 StartFollow:: ; 5803
push bc push bc
ld a, b ld a, b
call Function5815 call SetLeaderIfVisible
pop bc pop bc
ret c ret c
ld a, c ld a, c
call Function582c call SetFollowerIfVisible
callba Function848a callba Function848a
ret ret
; 5815 ; 5815
Function5815: ; 5815 SetLeaderIfVisible: ; 5815
call Function18de call CheckObjectVisibility
ret c ret c
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
ld [wd4cd], a ld [wObjectFollow_Leader], a
ret ret
; 581f ; 581f
Function581f:: ; 581f StopFollow:: ; 581f
call Function5826 call ResetLeader
call Function5847 call ResetFollower
ret ret
; 5826 ; 5826
Function5826: ; 5826 ResetLeader: ; 5826
ld a, -1 ld a, -1
ld [wd4cd], a ld [wObjectFollow_Leader], a
ret ret
; 582c ; 582c
Function582c: ; 582c SetFollowerIfVisible: ; 582c
push af push af
call Function5847 call ResetFollower
pop af pop af
call Function18de call CheckObjectVisibility
ret c ret c
ld hl, OBJECT_03 ld hl, OBJECT_MOVEMENTTYPE
add hl, bc add hl, bc
ld [hl], $13 ld [hl], SPRITEMOVEDATA_13
ld hl, OBJECT_09 ld hl, OBJECT_09
add hl, bc add hl, bc
ld [hl], 0 ld [hl], 0
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
ld [wd4ce], a ld [wObjectFollow_Follower], a
ret ret
; 5847 ; 5847
Function5847: ; 5847 ResetFollower: ; 5847
ld a, [wd4ce] ld a, [wObjectFollow_Follower]
cp -1 cp -1
ret z ret z
call GetObjectStruct call GetObjectStruct
callba Function58e3 callba Function58e3
ld a, -1 ld a, -1
ld [wd4ce], a ld [wObjectFollow_Follower], a
ret ret
; 585c ; 585c
SetFlagsForMovement_1:: ; 585c SetFlagsForMovement_1:: ; 585c
ld a, c ld a, c
call Function18de call CheckObjectVisibility
ret c ret c
push bc push bc
call Function587a call Function587a
@ -3198,7 +3198,7 @@ SetFlagsForMovement_1:: ; 585c
; 586e ; 586e
Function586e: ; 586e Function586e: ; 586e
call Function18de call CheckObjectVisibility
ret c ret c
ld hl, OBJECT_FLAGS2 ld hl, OBJECT_FLAGS2
add hl, bc add hl, bc
@ -3231,7 +3231,7 @@ Function587a: ; 587a
; 5897 ; 5897
_SetFlagsForMovement_2:: ; 5897 _SetFlagsForMovement_2:: ; 5897
ld a, [wd4cd] ld a, [wObjectFollow_Leader]
cp -1 cp -1
ret z ret z
push bc push bc
@ -3242,7 +3242,7 @@ _SetFlagsForMovement_2:: ; 5897
pop bc pop bc
cp c cp c
ret nz ret nz
ld a, [wd4ce] ld a, [wObjectFollow_Follower]
cp -1 cp -1
ret z ret z
call GetObjectStruct call GetObjectStruct
@ -3278,7 +3278,7 @@ Function58b9:: ; 58b9
; 58d8 ; 58d8
Function58d8: ; 58d8 Function58d8: ; 58d8
call Function18de call CheckObjectVisibility
ret c ret c
ld hl, OBJECT_FLAGS2 ld hl, OBJECT_FLAGS2
add hl, bc add hl, bc
@ -3298,7 +3298,7 @@ Function58e3: ; 58e3
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
pop bc pop bc
ld hl, OBJECT_03 ld hl, OBJECT_MOVEMENTTYPE
add hl, bc add hl, bc
ld [hl], a ld [hl], a
ld hl, OBJECT_09 ld hl, OBJECT_09
@ -3316,7 +3316,7 @@ Function5903: ; 5903
ld hl, .standing_movefns ld hl, .standing_movefns
add hl, de add hl, de
ld a, [hl] ld a, [hl]
ld hl, OBJECT_03 ld hl, OBJECT_MOVEMENTTYPE
add hl, bc add hl, bc
ld [hl], a ld [hl], a
ld hl, OBJECT_09 ld hl, OBJECT_09
@ -3431,13 +3431,13 @@ Function5991: ; 5991
Function59a4: ; 59a4 Function59a4: ; 59a4
xor a xor a
ld hl, wc2eb ld hl, wMovementPointer
ld bc, 13 ld bc, 13
call ByteFill call ByteFill
ld d, 0 ld d, 0
ld bc, ObjectStructs ld bc, ObjectStructs
ld hl, wc2eb ld hl, wMovementPointer
.loop .loop
push hl push hl
call GetObjectSprite call GetObjectSprite
@ -3488,7 +3488,7 @@ Function59a4: ; 59a4
; 59f3 ; 59f3
Function59f3: ; 59f3 Function59f3: ; 59f3
ld hl, wc2eb ld hl, wMovementPointer
.next .next
ld a, [hli] ld a, [hli]
ld d, a ld d, a
@ -3677,16 +3677,16 @@ endr
.Addresses ; 5ace .Addresses ; 5ace
dw PlayerStruct dw PlayerStruct
dw ObjectStruct1 dw Object1Struct
dw ObjectStruct2 dw Object2Struct
dw ObjectStruct3 dw Object3Struct
dw ObjectStruct4 dw Object4Struct
dw ObjectStruct5 dw Object5Struct
dw ObjectStruct6 dw Object6Struct
dw ObjectStruct7 dw Object7Struct
dw ObjectStruct8 dw Object8Struct
dw ObjectStruct9 dw Object9Struct
dw ObjectStruct10 dw Object10Struct
dw ObjectStruct11 dw Object11Struct
dw ObjectStruct12 dw Object12Struct
; 5ae8 ; 5ae8

View File

@ -205,8 +205,8 @@ Movement_4a: ; 51b8
; 51c1 ; 51c1
Movement_step_end: ; 51c1 Movement_step_end: ; 51c1
call Function4769 call RestoreDefaultMovement
ld hl, OBJECT_03 ld hl, OBJECT_MOVEMENTTYPE
add hl, bc add hl, bc
ld [hl], a ld [hl], a
ld hl, OBJECT_27 ld hl, OBJECT_27
@ -221,8 +221,8 @@ Movement_step_end: ; 51c1
; 51db ; 51db
Movement_48: ; 51db Movement_48: ; 51db
call Function4769 call RestoreDefaultMovement
ld hl, OBJECT_03 ld hl, OBJECT_MOVEMENTTYPE
add hl, bc add hl, bc
ld [hl], a ld [hl], a
ld hl, OBJECT_27 ld hl, OBJECT_27
@ -242,8 +242,8 @@ Movement_48: ; 51db
Movement_remove_person: ; 51fd Movement_remove_person: ; 51fd
call Function4357 call Function4357
ld hl, wd4cd ld hl, wObjectFollow_Leader
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
cp [hl] cp [hl]
jr nz, .asm_520a jr nz, .asm_520a
ld [hl], $ff ld [hl], $ff
@ -738,7 +738,7 @@ NormalStep: ; 5412
.asm_5430 .asm_5430
ld hl, wd4cf ld hl, wd4cf
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
cp [hl] cp [hl]
jr z, .asm_543f jr z, .asm_543f
@ -761,7 +761,7 @@ TurningStep: ; 5446
add hl, bc add hl, bc
ld [hl], $4 ld [hl], $4
ld hl, wd4cf ld hl, wd4cf
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
cp [hl] cp [hl]
jr z, .asm_5461 jr z, .asm_5461
ld hl, OBJECT_09 ld hl, OBJECT_09
@ -784,7 +784,7 @@ SlideStep: ; 5468
add hl, bc add hl, bc
ld [hl], $1 ld [hl], $1
ld hl, wd4cf ld hl, wd4cf
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
cp [hl] cp [hl]
jr z, .asm_5483 jr z, .asm_5483
ld hl, OBJECT_09 ld hl, OBJECT_09
@ -813,7 +813,7 @@ JumpStep: ; 548a
ld [hl], $2 ld [hl], $2
call Function5529 call Function5529
ld hl, wd4cf ld hl, wd4cf
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
cp [hl] cp [hl]
jr z, .asm_54b1 jr z, .asm_54b1
ld hl, OBJECT_09 ld hl, OBJECT_09

View File

@ -1191,7 +1191,7 @@ endr
ApplyPersonFacing: ; 0x9728b ApplyPersonFacing: ; 0x9728b
ld a, d ld a, d
push de push de
call Function18de call CheckObjectVisibility
jr c, .not_visible ; 0x97290 $27 jr c, .not_visible ; 0x97290 $27
ld hl, OBJECT_SPRITE ld hl, OBJECT_SPRITE
add hl, bc add hl, bc
@ -1258,7 +1258,7 @@ Script_appear: ; 0x972dd
call GetScriptByte call GetScriptByte
call GetScriptPerson call GetScriptPerson
call _CopyObjectStruct call _CopyObjectStruct
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld b, 0 ; clear ld b, 0 ; clear
call ApplyEventActionAppearDisappear call ApplyEventActionAppearDisappear
ret ret
@ -1276,7 +1276,7 @@ Script_disappear: ; 0x972ee
ld a, [hLastTalked] ld a, [hLastTalked]
.ok .ok
call DeleteObjectStruct call DeleteObjectStruct
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld b, 1 ; set ld b, 1 ; set
call ApplyEventActionAppearDisappear call ApplyEventActionAppearDisappear
callba RefreshMapAppearDisappear callba RefreshMapAppearDisappear
@ -1316,14 +1316,14 @@ Script_follow: ; 0x97325
call GetScriptByte call GetScriptByte
call GetScriptPerson call GetScriptPerson
ld c, a ld c, a
callba Function5803 callba StartFollow
ret ret
; 0x9733a ; 0x9733a
Script_stopfollow: ; 0x9733a Script_stopfollow: ; 0x9733a
; script command 0x71 ; script command 0x71
callba Function581f callba StopFollow
ret ret
; 0x97341 ; 0x97341

View File

@ -1515,11 +1515,11 @@ FacingPlayerDistance:: ; 36ad
add hl, bc add hl, bc
ld e, [hl] ld e, [hl]
ld a, [MapX] ld a, [PlayerMapX]
cp d cp d
jr z, .CheckY jr z, .CheckY
ld a, [MapY] ld a, [PlayerMapY]
cp e cp e
jr z, .CheckX jr z, .CheckX
@ -1527,7 +1527,7 @@ FacingPlayerDistance:: ; 36ad
ret ret
.CheckY .CheckY
ld a, [MapY] ld a, [PlayerMapY]
sub e sub e
jr z, .NotFacing jr z, .NotFacing
jr nc, .Above jr nc, .Above
@ -1545,7 +1545,7 @@ FacingPlayerDistance:: ; 36ad
jr .CheckFacing jr .CheckFacing
.CheckX .CheckX
ld a, [MapX] ld a, [PlayerMapX]
sub d sub d
jr z, .NotFacing jr z, .NotFacing
jr nc, .Left jr nc, .Left

View File

@ -356,14 +356,14 @@ JoyTextDelay:: ; a57
; a80 ; a80
Functiona80:: ; a80 Functiona80:: ; a80
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
push af push af
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
push af push af
xor a xor a
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld a, 6 ld a, 6
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
.loop .loop
push hl push hl
@ -377,9 +377,9 @@ Functiona80:: ; a80
jr z, .loop jr z, .loop
pop af pop af
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
pop af pop af
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ret ret
; aa5 ; aa5
@ -459,37 +459,37 @@ Functionb06:: ; b06
cp b cp b
pop bc pop bc
jr nz, .asm_b27 jr nz, .asm_b27
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
dec a dec a
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ret nz ret nz
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
dec a dec a
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
ret nz ret nz
ld a, "─" ld a, "─"
ld [hl], a ld [hl], a
ld a, -1 ld a, -1
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld a, 6 ld a, 6
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
ret ret
.asm_b27 .asm_b27
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
and a and a
ret z ret z
dec a dec a
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ret nz ret nz
dec a dec a
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
dec a dec a
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
ret nz ret nz
ld a, $6 ld a, $6
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
ld a, $ee ld a, $ee
ld [hl], a ld [hl], a
ret ret

View File

@ -252,10 +252,10 @@ Function2252:: ; 2252
; 2266 ; 2266
Function2266:: ; 2266 Function2266:: ; 2266
ld a, [MapY] ld a, [PlayerMapY]
sub $4 sub $4
ld e, a ld e, a
ld a, [MapX] ld a, [PlayerMapX]
sub $4 sub $4
ld d, a ld d, a
ld a, [wCurrMapWarpCount] ld a, [wCurrMapWarpCount]
@ -652,11 +652,11 @@ Function2457:: ; 2457
; 2471 ; 2471
Function2471:: ; 2471 Function2471:: ; 2471
ld hl, ObjectStruct1 ld hl, Object1Struct
ld bc, OBJECT_STRUCT_LENGTH * (NUM_OBJECT_STRUCTS - 1) ld bc, OBJECT_STRUCT_LENGTH * (NUM_OBJECT_STRUCTS - 1)
xor a xor a
call ByteFill call ByteFill
ld hl, ObjectStruct1 ld hl, Object1Struct
ld de, OBJECT_STRUCT_LENGTH ld de, OBJECT_STRUCT_LENGTH
ld c, NUM_OBJECT_STRUCTS - 1 ld c, NUM_OBJECT_STRUCTS - 1
xor a xor a
@ -729,9 +729,9 @@ ChangeMap:: ; 24e4
ld hl, OverworldMap ld hl, OverworldMap
ld a, [MapWidth] ld a, [MapWidth]
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
add $6 add $6
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld c, a ld c, a
ld b, 0 ld b, 0
rept 3 rept 3
@ -750,7 +750,7 @@ endr
ld b, a ld b, a
.asm_250c .asm_250c
push hl push hl
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
ld c, a ld c, a
.asm_2510 .asm_2510
ld a, [de] ld a, [de]
@ -759,7 +759,7 @@ endr
dec c dec c
jr nz, .asm_2510 jr nz, .asm_2510
pop hl pop hl
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
add l add l
ld l, a ld l, a
jr nc, .asm_251e jr nc, .asm_251e
@ -794,10 +794,10 @@ FillMapConnections:: ; 2524
ld e, a ld e, a
ld a, [NorthConnectionStripLocation + 1] ld a, [NorthConnectionStripLocation + 1]
ld d, a ld d, a
ld a, [NorthMapObjectIndexBuffer1] ld a, [NorthMapObjectIndexBuffer]
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld a, [NorthMapObjectIndexBuffer2] ld a, [NorthObjectStructIndexBuffer]
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
call FillNorthConnectionStrip call FillNorthConnectionStrip
.South .South
@ -817,10 +817,10 @@ FillMapConnections:: ; 2524
ld e, a ld e, a
ld a, [SouthConnectionStripLocation + 1] ld a, [SouthConnectionStripLocation + 1]
ld d, a ld d, a
ld a, [SouthMapObjectIndexBuffer1] ld a, [SouthMapObjectIndexBuffer]
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld a, [SouthMapObjectIndexBuffer2] ld a, [SouthObjectStructIndexBuffer]
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
call FillSouthConnectionStrip call FillSouthConnectionStrip
.West .West
@ -843,7 +843,7 @@ FillMapConnections:: ; 2524
ld a, [WestConnectionStripLength] ld a, [WestConnectionStripLength]
ld b, a ld b, a
ld a, [WestConnectedMapWidth] ld a, [WestConnectedMapWidth]
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
call FillWestConnectionStrip call FillWestConnectionStrip
.East .East
@ -866,7 +866,7 @@ FillMapConnections:: ; 2524
ld a, [EastConnectionStripLength] ld a, [EastConnectionStripLength]
ld b, a ld b, a
ld a, [EastConnectedMapWidth] ld a, [EastConnectedMapWidth]
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
call FillEastConnectionStrip call FillEastConnectionStrip
.Done .Done
@ -882,7 +882,7 @@ FillSouthConnectionStrip:: ; 25d3
push de push de
push hl push hl
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld b, a ld b, a
.x .x
ld a, [hli] ld a, [hli]
@ -892,7 +892,7 @@ FillSouthConnectionStrip:: ; 25d3
jr nz, .x jr nz, .x
pop hl pop hl
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
ld e, a ld e, a
ld d, 0 ld d, 0
add hl, de add hl, de
@ -917,7 +917,7 @@ FillEastConnectionStrip:: ; 25f6
.asm_25f6 .asm_25f6
ld a, [MapWidth] ld a, [MapWidth]
add 6 add 6
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
push de push de
@ -933,13 +933,13 @@ FillEastConnectionStrip:: ; 25f6
inc de inc de
pop hl pop hl
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld e, a ld e, a
ld d, 0 ld d, 0
add hl, de add hl, de
pop de pop de
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
add e add e
ld e, a ld e, a
jr nc, .asm_2617 jr nc, .asm_2617
@ -1171,7 +1171,7 @@ CoordinatesEventText:: ; 2702
CheckObjectMask:: ; 2707 CheckObjectMask:: ; 2707
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld e, a ld e, a
ld d, $0 ld d, $0
ld hl, wObjectMasks ld hl, wObjectMasks
@ -1181,7 +1181,7 @@ CheckObjectMask:: ; 2707
; 2712 ; 2712
MaskObject:: ; 2712 MaskObject:: ; 2712
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld e, a ld e, a
ld d, $0 ld d, $0
ld hl, wObjectMasks ld hl, wObjectMasks
@ -1191,7 +1191,7 @@ MaskObject:: ; 2712
; 271e ; 271e
UnmaskObject:: ; 271e UnmaskObject:: ; 271e
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld e, a ld e, a
ld d, $0 ld d, $0
ld hl, wObjectMasks ld hl, wObjectMasks
@ -1463,7 +1463,7 @@ SaveScreen:: ; 289d
ld de, XCoord + 1 ld de, XCoord + 1
ld a, [MapWidth] ld a, [MapWidth]
add $6 add $6
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld a, [wd151] ld a, [wd151]
and a and a
jr z, .asm_28cb jr z, .asm_28cb
@ -1477,7 +1477,7 @@ SaveScreen:: ; 289d
.asm_28c0 .asm_28c0
ld de, wdcbf ld de, wdcbf
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld c, a ld c, a
ld b, $0 ld b, $0
add hl, bc add hl, bc
@ -1512,7 +1512,7 @@ LoadNeighboringBlockData:: ; 28e3
ld l, a ld l, a
ld a, [MapWidth] ld a, [MapWidth]
add $6 add $6
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld de, XCoord + 1 ld de, XCoord + 1
ld b, $6 ld b, $6
ld c, $5 ld c, $5
@ -1537,7 +1537,7 @@ Function28f7:: ; 28f7
.asm_2908 .asm_2908
pop hl pop hl
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld c, a ld c, a
ld b, $0 ld b, $0
add hl, bc add hl, bc
@ -1552,15 +1552,15 @@ Function2914:: ; 2914
ld [TilePermissions], a ld [TilePermissions], a
call Function296c call Function296c
call Function294d call Function294d
ld a, [MapX] ld a, [PlayerMapX]
ld d, a ld d, a
ld a, [MapY] ld a, [PlayerMapY]
ld e, a ld e, a
call Function2a3c call Function2a3c
ld [StandingTile], a ld [PlayerStandingTile], a
call Function29ff call Function29ff
ret nz ret nz
ld a, [StandingTile] ld a, [PlayerStandingTile]
and 7 and 7
ld hl, .data_2945 ld hl, .data_2945
add l add l
@ -1580,9 +1580,9 @@ Function2914:: ; 2914
; 294d ; 294d
Function294d:: ; 294d Function294d:: ; 294d
ld a, [MapX] ld a, [PlayerMapX]
ld d, a ld d, a
ld a, [MapY] ld a, [PlayerMapY]
ld e, a ld e, a
push de push de
inc e inc e
@ -1598,9 +1598,9 @@ Function294d:: ; 294d
; 296c ; 296c
Function296c:: ; 296c Function296c:: ; 296c
ld a, [MapX] ld a, [PlayerMapX]
ld d, a ld d, a
ld a, [MapY] ld a, [PlayerMapY]
ld e, a ld e, a
push de push de
dec d dec d
@ -1725,10 +1725,10 @@ endr
ld h, [hl] ld h, [hl]
ld l, a ld l, a
ld a, [MapX] ld a, [PlayerMapX]
add d add d
ld d, a ld d, a
ld a, [MapY] ld a, [PlayerMapY]
add e add e
ld e, a ld e, a
ld a, [hl] ld a, [hl]
@ -1906,10 +1906,10 @@ CheckStandingOnXYTrigger:: ; 2ae7
call CheckTriggers call CheckTriggers
ld b, a ld b, a
; Load your current coordinates into de. This will be used to check if your position is in the xy-trigger table for the current map. ; Load your current coordinates into de. This will be used to check if your position is in the xy-trigger table for the current map.
ld a, [MapX] ld a, [PlayerMapX]
sub 4 sub 4
ld d, a ld d, a
ld a, [MapY] ld a, [PlayerMapY]
sub 4 sub 4
ld e, a ld e, a

View File

@ -21,7 +21,7 @@ Function180e:: ; 180e
ld hl, UsedSprites + 2 ld hl, UsedSprites + 2
ld c, SPRITE_GFX_LIST_CAPACITY - 1 ld c, SPRITE_GFX_LIST_CAPACITY - 1
ld b, a ld b, a
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
cp 0 cp 0
jr z, .nope jr z, .nope
ld a, b ld a, b
@ -78,14 +78,14 @@ Function1836:: ; 1836
Function184a:: ; 184a Function184a:: ; 184a
ld a, [StandingTile] ld a, [PlayerStandingTile]
call GetTileCollision call GetTileCollision
ld b, a ld b, a
ret ret
; 1852 ; 1852
CheckOnWater:: ; 1852 CheckOnWater:: ; 1852
ld a, [StandingTile] ld a, [PlayerStandingTile]
call GetTileCollision call GetTileCollision
sub 1 sub 1
ret z ret z
@ -209,7 +209,7 @@ CheckWaterfallTile:: ; 18bd
; 18c3 ; 18c3
CheckStandingOnEntrance:: ; 18c3 CheckStandingOnEntrance:: ; 18c3
ld a, [StandingTile] ld a, [PlayerStandingTile]
cp $71 ; door cp $71 ; door
ret z ret z
cp $79 cp $79
@ -232,16 +232,16 @@ GetMapObject:: ; 18d2
; 18de ; 18de
Function18de:: ; 18de CheckObjectVisibility:: ; 18de
; Sets carry if the object is not visible on the screen. ; Sets carry if the object is not visible on the screen.
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
call GetMapObject call GetMapObject
ld hl, MAPOBJECT_OBJECT_STRUCT_ID ld hl, MAPOBJECT_OBJECT_STRUCT_ID
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
cp -1 cp -1
jr z, .not_visible jr z, .not_visible
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
call GetObjectStruct call GetObjectStruct
and a and a
ret ret
@ -326,7 +326,7 @@ CheckObjectTime:: ; 18f5
; 194d ; 194d
Function194d:: ; 194d Function194d:: ; 194d
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
call GetMapObject call GetMapObject
call CopyObjectStruct call CopyObjectStruct
ret ret
@ -335,22 +335,22 @@ Function194d:: ; 194d
_CopyObjectStruct:: ; 1956 _CopyObjectStruct:: ; 1956
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
call UnmaskObject call UnmaskObject
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
call GetMapObject call GetMapObject
callba CopyObjectStruct callba CopyObjectStruct
ret ret
; 1967 ; 1967
Function1967:: ; 1967 Function1967:: ; 1967
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
call GetMapObject call GetMapObject
ld hl, MAPOBJECT_OBJECT_STRUCT_ID ld hl, MAPOBJECT_OBJECT_STRUCT_ID
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
cp -1 cp -1
ret z ret z ; already hidden
ld [hl], -1 ld [hl], -1
push af push af
call Function1985 call Function1985
@ -361,18 +361,18 @@ Function1967:: ; 1967
; 1985 ; 1985
Function1985:: ; 1985 Function1985:: ; 1985
ld hl, wd4cd ld hl, wObjectFollow_Leader
cp [hl] cp [hl]
jr z, .ok jr z, .ok
ld hl, wd4ce ld hl, wObjectFollow_Follower
cp [hl] cp [hl]
ret nz ret nz
.ok .ok
callba Function581f callba StopFollow
ld a, -1 ld a, -1
ld [wd4cd], a ld [wObjectFollow_Leader], a
ld [wd4ce], a ld [wObjectFollow_Follower], a
ret ret
; 199f ; 199f
@ -413,11 +413,11 @@ Function19b8:: ; 19b8
cp $d cp $d
ret nc ret nc
ld b, a ld b, a
ld a, [wd4cd] ld a, [wObjectFollow_Leader]
cp b cp b
jr nz, .ok jr nz, .ok
ld a, -1 ld a, -1
ld [wd4cd], a ld [wObjectFollow_Leader], a
.ok .ok
ld a, b ld a, b
@ -429,19 +429,19 @@ Function19b8:: ; 19b8
Function19e9:: ; 19e9 Function19e9:: ; 19e9
ld [wc2e2], a ld [wMovementPerson], a
ld a, [hROMBank] ld a, [hROMBank]
ld [wc2e3], a ld [wMovementDataPointer], a
ld a, l ld a, l
ld [wc2e3 + 1], a ld [wMovementDataPointer + 1], a
ld a, h ld a, h
ld [wc2e3 + 2], a ld [wMovementDataPointer + 2], a
ld a, [wc2e2] ld a, [wMovementPerson]
call Function18de call CheckObjectVisibility
ret c ret c
ld hl, OBJECT_03 ld hl, OBJECT_MOVEMENTTYPE
add hl, bc add hl, bc
ld [hl], $14 ld [hl], SPRITEMOVEDATA_14
ld hl, OBJECT_09 ld hl, OBJECT_09
add hl, bc add hl, bc
ld [hl], 0 ld [hl], 0
@ -486,7 +486,7 @@ FindFirstEmptyObjectStruct:: ; 1a13
Function1a2f:: ; 1a2f Function1a2f:: ; 1a2f
ld hl, OBJECT_03 ld hl, OBJECT_MOVEMENTTYPE
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
cp OBJECT_STRUCT_3_DATA_HEIGHT cp OBJECT_STRUCT_3_DATA_HEIGHT
@ -544,7 +544,7 @@ Function1a61:: ; 1a61
; 1a71 ; 1a71
Function1a71:: ; 1a71 Function1a71:: ; 1a71
ld hl, OBJECT_03 ld hl, OBJECT_MOVEMENTTYPE
add hl, de add hl, de
ld [hl], a ld [hl], a
push de push de

View File

@ -32,8 +32,8 @@ hJoyDown EQU $ffa8
hJoyLast EQU $ffa9 hJoyLast EQU $ffa9
hInMenu EQU $ffaa hInMenu EQU $ffaa
hMapObjectIndexBuffer1 EQU $ffaf hMapObjectIndexBuffer EQU $ffaf
hMapObjectIndexBuffer2 EQU $ffb0 hObjectStructIndexBuffer EQU $ffb0
hPastLeadingZeroes EQU $ffb3 hPastLeadingZeroes EQU $ffb3

164
main.asm
View File

@ -2345,14 +2345,14 @@ CheckFacingObject:: ; 6fd9
call CheckCounterTile call CheckCounterTile
jr nz, .asm_6ff1 jr nz, .asm_6ff1
ld a, [MapX] ld a, [PlayerMapX]
sub d sub d
cpl cpl
inc a inc a
add d add d
ld d, a ld d, a
ld a, [MapY] ld a, [PlayerMapY]
sub e sub e
cpl cpl
inc a inc a
@ -2362,7 +2362,7 @@ CheckFacingObject:: ; 6fd9
.asm_6ff1 .asm_6ff1
ld bc, ObjectStructs ; redundant ld bc, ObjectStructs ; redundant
ld a, 0 ld a, 0
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
call Function7041 call Function7041
ret nc ret nc
ld hl, OBJECT_DIRECTION_WALKING ld hl, OBJECT_DIRECTION_WALKING
@ -2390,7 +2390,7 @@ Function7009: ; 7009
; 7015 ; 7015
Function7015: ; unreferenced Function7015: ; unreferenced
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
call GetObjectStruct call GetObjectStruct
call Function7021 call Function7021
call Function7041 call Function7041
@ -2430,7 +2430,7 @@ Function7041: ; 7041
ld bc, ObjectStructs ld bc, ObjectStructs
xor a xor a
.loop .loop
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
call GetObjectSprite call GetObjectSprite
jr z, .nope jr z, .nope
ld hl, OBJECT_FLAGS1 ld hl, OBJECT_FLAGS1
@ -2458,9 +2458,9 @@ Function7041: ; 7041
jr nz, .ok jr nz, .ok
.ok2 .ok2
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld l, a ld l, a
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
cp l cp l
jr nz, .setcarry jr nz, .setcarry
@ -2475,9 +2475,9 @@ Function7041: ; 7041
ld a, [hl] ld a, [hl]
cp e cp e
jr nz, .nope jr nz, .nope
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld l, a ld l, a
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
cp l cp l
jr nz, .setcarry jr nz, .setcarry
@ -2486,7 +2486,7 @@ Function7041: ; 7041
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
inc a inc a
cp NUM_OBJECT_STRUCTS cp NUM_OBJECT_STRUCTS
jr nz, .loop jr nz, .loop
@ -2590,20 +2590,20 @@ Function70ed: ; 70ed
; 7113 ; 7113
Function7113: ; unreferenced Function7113: ; unreferenced
ld a, [MapX] ld a, [PlayerMapX]
ld d, a ld d, a
ld a, [MapY] ld a, [PlayerMapY]
ld e, a ld e, a
ld bc, ObjectStructs ld bc, ObjectStructs
xor a xor a
.loop .loop
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
call GetObjectSprite call GetObjectSprite
jr z, .asm_7160 jr z, .asm_7160
ld hl, OBJECT_03 ld hl, OBJECT_MOVEMENTTYPE
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
cp $15 cp SPRITEMOVEDATA_15
jr nz, .asm_7136 jr nz, .asm_7136
call Function7171 call Function7171
jr c, .asm_716f jr c, .asm_716f
@ -2620,7 +2620,7 @@ Function7113: ; unreferenced
ld a, [hl] ld a, [hl]
cp d cp d
jr nz, .asm_714e jr nz, .asm_714e
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
cp $0 cp $0
jr z, .asm_7160 jr z, .asm_7160
jr .asm_716f jr .asm_716f
@ -2643,7 +2643,7 @@ Function7113: ; unreferenced
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
inc a inc a
cp NUM_OBJECT_STRUCTS cp NUM_OBJECT_STRUCTS
jr nz, .loop jr nz, .loop
@ -3198,8 +3198,8 @@ Function8000: ; 8000
GetSpawnCoord: ; 8029 GetSpawnCoord: ; 8029
ld a, -1 ld a, -1
ld [wd4cd], a ld [wObjectFollow_Leader], a
ld [wd4ce], a ld [wObjectFollow_Follower], a
ld a, $0 ld a, $0
ld hl, PlayerObjectTemplate ld hl, PlayerObjectTemplate
call Function19a6 call Function19a6
@ -3221,10 +3221,10 @@ GetSpawnCoord: ; 8029
.ok .ok
ld [hl], e ld [hl], e
ld a, $0 ld a, $0
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld bc, MapObjects ld bc, MapObjects
ld a, $0 ld a, $0
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
ld de, ObjectStructs ld de, ObjectStructs
call Function8116 call Function8116
ld a, $0 ld a, $0
@ -3269,7 +3269,7 @@ PlayerSpawn_ConvertCoords: ; 808f
Function80a1:: ; 80a1 Function80a1:: ; 80a1
ld a, b ld a, b
call Function18de call CheckObjectVisibility
ret c ret c
ld hl, OBJECT_MAP_X ld hl, OBJECT_MAP_X
add hl, bc add hl, bc
@ -3277,7 +3277,7 @@ Function80a1:: ; 80a1
ld hl, OBJECT_MAP_Y ld hl, OBJECT_MAP_Y
add hl, bc add hl, bc
ld e, [hl] ld e, [hl]
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld b, a ld b, a
call CopyDECoordsToMapObject call CopyDECoordsToMapObject
and a and a
@ -3288,26 +3288,26 @@ RefreshPlayerCoords: ; 80b8
ld a, [XCoord] ld a, [XCoord]
add 4 add 4
ld d, a ld d, a
ld hl, MapX ld hl, PlayerMapX
sub [hl] sub [hl]
ld [hl], d ld [hl], d
ld hl, MapObjects + MAPOBJECT_X_COORD ld hl, MapObjects + MAPOBJECT_X_COORD
ld [hl], d ld [hl], d
ld hl, MapX2 ld hl, PlayerNextMapX
ld [hl], d ld [hl], d
ld d, a ld d, a
ld a, [YCoord] ld a, [YCoord]
add 4 add 4
ld e, a ld e, a
ld hl, MapY ld hl, PlayerMapY
sub [hl] sub [hl]
ld [hl], e ld [hl], e
ld hl, MapObjects + MAPOBJECT_Y_COORD ld hl, MapObjects + MAPOBJECT_Y_COORD
ld [hl], e ld [hl], e
ld hl, MapY2 ld hl, PlayerNextMapY
ld [hl], e ld [hl], e
ld e, a ld e, a
ld a, [wd4cd] ld a, [wObjectFollow_Leader]
cp $0 cp $0
ret nz ret nz
ret ret
@ -3322,12 +3322,12 @@ CopyObjectStruct:: ; 80e7
ld a, 1 ld a, 1
ld de, OBJECT_STRUCT_LENGTH ld de, OBJECT_STRUCT_LENGTH
.loop .loop
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
ld a, [hl] ld a, [hl]
and a and a
jr z, .done jr z, .done
add hl, de add hl, de
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
inc a inc a
cp NUM_OBJECT_STRUCTS cp NUM_OBJECT_STRUCTS
jr nz, .loop jr nz, .loop
@ -3354,11 +3354,11 @@ Function8116: ; 8116
; 811d ; 811d
Function811d: ; 811d Function811d: ; 811d
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
ld hl, MAPOBJECT_OBJECT_STRUCT_ID ld hl, MAPOBJECT_OBJECT_STRUCT_ID
add hl, bc add hl, bc
ld [hl], a ld [hl], a
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld [wc2f0], a ld [wc2f0], a
ld hl, MAPOBJECT_SPRITE ld hl, MAPOBJECT_SPRITE
add hl, bc add hl, bc
@ -3406,7 +3406,7 @@ Function8177: ; 8177
ld bc, MapObjects + OBJECT_LENGTH ld bc, MapObjects + OBJECT_LENGTH
ld a, 1 ld a, 1
.loop .loop
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld hl, MAPOBJECT_SPRITE ld hl, MAPOBJECT_SPRITE
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
@ -3447,7 +3447,7 @@ Function8177: ; 8177
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
inc a inc a
cp NUM_OBJECTS cp NUM_OBJECTS
jr nz, .loop jr nz, .loop
@ -3491,7 +3491,7 @@ Function81ea: ; 81ea
ld bc, MapObjects + OBJECT_LENGTH ld bc, MapObjects + OBJECT_LENGTH
ld a, 1 ld a, 1
.loop .loop
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld hl, MAPOBJECT_SPRITE ld hl, MAPOBJECT_SPRITE
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
@ -3526,7 +3526,7 @@ Function81ea: ; 81ea
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
inc a inc a
cp NUM_OBJECTS cp NUM_OBJECTS
jr nz, .loop jr nz, .loop
@ -3549,7 +3549,7 @@ Function823e: ; 823e
ld bc, MapObjects + OBJECT_LENGTH ld bc, MapObjects + OBJECT_LENGTH
ld a, 1 ld a, 1
.loop .loop
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld hl, MAPOBJECT_SPRITE ld hl, MAPOBJECT_SPRITE
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
@ -3584,7 +3584,7 @@ Function823e: ; 823e
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
inc a inc a
cp NUM_OBJECTS cp NUM_OBJECTS
jr nz, .loop jr nz, .loop
@ -3773,13 +3773,13 @@ Function8388: ; 8388
Function839e:: ; 839e Function839e:: ; 839e
push bc push bc
ld a, c ld a, c
call Function18de call CheckObjectVisibility
ld d, b ld d, b
ld e, c ld e, c
pop bc pop bc
ret c ret c
ld a, b ld a, b
call Function18de call CheckObjectVisibility
ret c ret c
ld hl, OBJECT_MAP_X ld hl, OBJECT_MAP_X
add hl, bc add hl, bc
@ -3841,13 +3841,13 @@ Function839e:: ; 839e
ld hl, OBJECT_SPRITE_Y ld hl, OBJECT_SPRITE_Y
add hl, de add hl, de
ld [hl], a ld [hl], a
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
ld hl, OBJECT_32 ld hl, OBJECT_32
add hl, de add hl, de
ld [hl], a ld [hl], a
ld hl, OBJECT_03 ld hl, OBJECT_MOVEMENTTYPE
add hl, de add hl, de
ld [hl], $1a ld [hl], SPRITEMOVEDATA_1A
ld hl, OBJECT_09 ld hl, OBJECT_09
add hl, de add hl, de
ld [hl], $0 ld [hl], $0
@ -3977,7 +3977,7 @@ Function848a: ; 848a
; 849d ; 849d
Function849d: ; 849d Function849d: ; 849d
ld a, [wd4cd] ld a, [wObjectFollow_Leader]
call GetObjectStruct call GetObjectStruct
ld hl, OBJECT_MAP_X ld hl, OBJECT_MAP_X
add hl, bc add hl, bc
@ -3985,7 +3985,7 @@ Function849d: ; 849d
ld hl, OBJECT_MAP_Y ld hl, OBJECT_MAP_Y
add hl, bc add hl, bc
ld e, [hl] ld e, [hl]
ld a, [wd4ce] ld a, [wObjectFollow_Follower]
call GetObjectStruct call GetObjectStruct
ld hl, OBJECT_MAP_X ld hl, OBJECT_MAP_X
add hl, bc add hl, bc
@ -5325,7 +5325,7 @@ Script_UsedWaterfall: ; 0xcb20
CheckContinueWaterfall: ; cb38 CheckContinueWaterfall: ; cb38
xor a xor a
ld [ScriptVar], a ld [ScriptVar], a
ld a, [StandingTile] ld a, [PlayerStandingTile]
call CheckWaterfallTile call CheckWaterfallTile
ret z ret z
callba MobileFn_1060c1 callba MobileFn_1060c1
@ -6067,7 +6067,7 @@ GetFacingObject: ; cf0d
callba CheckFacingObject callba CheckFacingObject
jr nc, .fail jr nc, .fail
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
call GetObjectStruct call GetObjectStruct
ld hl, OBJECT_MAP_OBJECT_INDEX ld hl, OBJECT_MAP_OBJECT_INDEX
add hl, bc add hl, bc
@ -17687,7 +17687,7 @@ INCLUDE "gfx/overworld/sprite_headers.asm"
Function1499a:: ; 1499a Function1499a:: ; 1499a
ld a, [StandingTile] ld a, [PlayerStandingTile]
cp $60 cp $60
jr z, .asm_149ad jr z, .asm_149ad
cp $68 cp $68
@ -17704,7 +17704,7 @@ Function1499a:: ; 1499a
; 149af ; 149af
Function149af:: ; 149af Function149af:: ; 149af
ld a, [StandingTile] ld a, [PlayerStandingTile]
cp $70 cp $70
jr z, .asm_149c4 jr z, .asm_149c4
cp $76 cp $76
@ -17724,7 +17724,7 @@ Function149af:: ; 149af
CheckWarpCollision: ; 149c6 CheckWarpCollision: ; 149c6
ld de, 1 ld de, 1
ld hl, .blocks ld hl, .blocks
ld a, [StandingTile] ld a, [PlayerStandingTile]
call IsInArray call IsInArray
ret ret
; 149d3 ; 149d3
@ -17743,7 +17743,7 @@ CheckWarpCollision: ; 149c6
; 149dd ; 149dd
CheckGrassCollision:: ; 149dd CheckGrassCollision:: ; 149dd
ld a, [StandingTile] ld a, [PlayerStandingTile]
ld hl, .blocks ld hl, .blocks
ld de, 1 ld de, 1
call IsInArray call IsInArray
@ -17783,7 +17783,7 @@ CheckCutCollision: ; 149f5
; 14a07 ; 14a07
Function14a07:: ; 14a07 Function14a07:: ; 14a07
ld a, [StandingTile] ld a, [PlayerStandingTile]
ld de, $001f ld de, $001f
cp $71 ; door cp $71 ; door
ret z ret z
@ -41815,15 +41815,15 @@ Function4aad3: ; 4aad3
ld c, a ld c, a
xor a xor a
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
.loop .loop
push bc push bc
push hl push hl
ld e, 0 ld e, 0
callba Function8e83f callba Function8e83f
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
inc a inc a
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
pop hl pop hl
pop bc pop bc
dec c dec c
@ -46604,7 +46604,7 @@ Function503e0: ; 503e0
ret z ret z
ld c, a ld c, a
xor a xor a
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
.asm_503ea .asm_503ea
push bc push bc
push hl push hl
@ -46612,9 +46612,9 @@ Function503e0: ; 503e0
ld a, BANK(Function8e83f) ld a, BANK(Function8e83f)
ld e, $0 ld e, $0
rst FarCall rst FarCall
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
inc a inc a
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
pop hl pop hl
pop bc pop bc
dec c dec c
@ -49273,7 +49273,7 @@ CheckTileMovement: ; 800b7
; Tiles such as waterfalls and warps move the player ; Tiles such as waterfalls and warps move the player
; in a given direction, overriding input. ; in a given direction, overriding input.
ld a, [StandingTile] ld a, [PlayerStandingTile]
ld c, a ld c, a
call CheckWhirlpoolTile call CheckWhirlpoolTile
jr c, .asm_800c4 jr c, .asm_800c4
@ -49434,7 +49434,7 @@ TryStep: ; 8016b
cp 2 cp 2
jr z, .asm_801be jr z, .asm_801be
ld a, [StandingTile] ld a, [PlayerStandingTile]
call CheckIceTile call CheckIceTile
jr nc, .ice jr nc, .ice
@ -49521,7 +49521,7 @@ TrySurfStep: ; 801c0
TryJumpLedge: ; 801f3 TryJumpLedge: ; 801f3
ld a, [StandingTile] ld a, [PlayerStandingTile]
ld e, a ld e, a
and $f0 and $f0
cp $a0 ; ledge cp $a0 ; ledge
@ -49573,7 +49573,7 @@ CheckEdgeWarp: ; 80226
ld d, 0 ld d, 0
ld hl, .EdgeWarps ld hl, .EdgeWarps
add hl, de add hl, de
ld a, [StandingTile] ld a, [PlayerStandingTile]
cp [hl] cp [hl]
jr nz, .asm_80259 jr nz, .asm_80259
@ -49757,7 +49757,7 @@ GetMovementAction: ; 802ec
; tile collision pointer ; tile collision pointer
.table1 .table1
db STANDING, FACE_CURRENT, 0, 0 db STANDING, FACE_CURRENT, 0, 0
dw StandingTile dw PlayerStandingTile
.table2 .table2
db RIGHT, FACE_RIGHT, 1, 0 db RIGHT, FACE_RIGHT, 1, 0
dw TileRight dw TileRight
@ -49773,13 +49773,13 @@ GetMovementAction: ; 802ec
IsNPCInFront: ; 80341 IsNPCInFront: ; 80341
ld a, 0 ld a, 0
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ld a, [MapX] ld a, [PlayerMapX]
ld d, a ld d, a
ld a, [WalkingX] ld a, [WalkingX]
add d add d
ld d, a ld d, a
ld a, [MapY] ld a, [PlayerMapY]
ld e, a ld e, a
ld a, [WalkingY] ld a, [WalkingY]
add e add e
@ -49963,7 +49963,7 @@ Function80404:: ; 80404
jr z, .asm_80420 jr z, .asm_80420
cp $f0 cp $f0
jr z, .asm_80420 jr z, .asm_80420
ld a, [StandingTile] ld a, [PlayerStandingTile]
call CheckIceTile call CheckIceTile
jr nc, .asm_8041e jr nc, .asm_8041e
ld a, [PlayerState] ld a, [PlayerState]
@ -58179,7 +58179,7 @@ Function8e862: ; 8e862 (23:6862)
Function8e86c: ; 8e86c (23:686c) Function8e86c: ; 8e86c (23:686c)
push bc push bc
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
ld hl, PartyMon1Item ld hl, PartyMon1Item
ld bc, PartyMon2 - PartyMon1 ld bc, PartyMon2 - PartyMon1
call AddNTimes call AddNTimes
@ -58251,7 +58251,7 @@ Function8e8d5: ; 8e8d5 (23:68d5)
Function8e8df: ; 8e8df (23:68df) Function8e8df: ; 8e8df (23:68df)
push bc push bc
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
ld hl, PartyMon1Item ld hl, PartyMon1Item
ld bc, $30 ld bc, $30
call AddNTimes call AddNTimes
@ -58279,7 +58279,7 @@ Function8e8df: ; 8e8df (23:68df)
Function8e908: ; 8e908 (23:6908) Function8e908: ; 8e908 (23:6908)
ld a, [wc3b7] ld a, [wc3b7]
push af push af
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
ld hl, PartySpecies ld hl, PartySpecies
ld e, a ld e, a
ld d, $0 ld d, $0
@ -58288,7 +58288,7 @@ Function8e908: ; 8e908 (23:6908)
call ReadMonMenuIcon call ReadMonMenuIcon
ld [CurIcon], a ld [CurIcon], a
call Function8e9db call Function8e9db
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
rept 4 rept 4
add a add a
endr endr
@ -58305,7 +58305,7 @@ endr
Function8e936: ; 8e936 (23:6936) Function8e936: ; 8e936 (23:6936)
push bc push bc
ld a, [hMapObjectIndexBuffer2] ld a, [hObjectStructIndexBuffer]
ld b, a ld b, a
call Function8e94c call Function8e94c
ld a, b ld a, b
@ -77866,11 +77866,11 @@ Function104263: ; 104263 (41:4263)
ld c, $0 ld c, $0
Function104265: ; 104265 (41:4265) Function104265: ; 104265 (41:4265)
; back up the value of c to hMapObjectIndexBuffer1 ; back up the value of c to hMapObjectIndexBuffer
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
push af push af
ld a, c ld a, c
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
; for each row on the screen ; for each row on the screen
ld c, SCREEN_HEIGHT ld c, SCREEN_HEIGHT
@ -77886,7 +77886,7 @@ Function104265: ; 104265 (41:4265)
jr nz, .loop2 jr nz, .loop2
; load the original value of c into hl 12 times ; load the original value of c into hl 12 times
ld a, [hMapObjectIndexBuffer1] ld a, [hMapObjectIndexBuffer]
ld b, 12 ld b, 12
.loop3 .loop3
ld [hli], a ld [hli], a
@ -77896,9 +77896,9 @@ Function104265: ; 104265 (41:4265)
dec c dec c
jr nz, .loop1 jr nz, .loop1
; restore the original value of hMapObjectIndexBuffer1 ; restore the original value of hMapObjectIndexBuffer
pop af pop af
ld [hMapObjectIndexBuffer1], a ld [hMapObjectIndexBuffer], a
ret ret
@ -78411,7 +78411,7 @@ CheckMovingOffEdgeOfMap:: ; 104820 (41:4820)
and a and a
ret ret
.down .down
ld a, [MapY] ld a, [PlayerMapY]
sub 4 sub 4
ld b, a ld b, a
ld a, [MapHeight] ld a, [MapHeight]
@ -78421,21 +78421,21 @@ CheckMovingOffEdgeOfMap:: ; 104820 (41:4820)
and a and a
ret ret
.up .up
ld a, [MapY] ld a, [PlayerMapY]
sub 4 sub 4
cp -1 cp -1
jr z, .ok jr z, .ok
and a and a
ret ret
.left .left
ld a, [MapX] ld a, [PlayerMapX]
sub $4 sub $4
cp -1 cp -1
jr z, .ok jr z, .ok
and a and a
ret ret
.right .right
ld a, [MapX] ld a, [PlayerMapX]
sub 4 sub 4
ld b, a ld b, a
ld a, [MapWidth] ld a, [MapWidth]

View File

@ -14428,7 +14428,7 @@ Function11ad1b: ; 11ad1b
ld a, [wcfa9] ld a, [wcfa9]
ld [wcd82], a ld [wcd82], a
dec a dec a
ld [hMapObjectIndexBuffer2], a ld [hObjectStructIndexBuffer], a
ld a, $10 ld a, $10
ld [wc3b7], a ld [wc3b7], a
ld hl, Function8e83f ld hl, Function8e83f

132
wram.asm
View File

@ -306,12 +306,12 @@ ScriptVar:: ; c2dd
wc2de:: ds 1 wc2de:: ds 1
wc2df:: ds 3 wc2df:: ds 3
wc2e2:: ds 1 wMovementPerson:: ds 1
wc2e3:: ds 3 wMovementDataPointer:: ds 3
wc2e6:: ds 4 wc2e6:: ds 4
wc2ea:: ds 1 wc2ea:: ds 1
wc2eb:: ds 1 wMovementPointer:: ds 2
wc2ec:: ds 4 ds 3
wc2f0:: ds 1 wc2f0:: ds 1
wc2f1:: ds 1 wc2f1:: ds 1
wc2f2:: ds 1 wc2f2:: ds 1
@ -1649,9 +1649,9 @@ NorthConnectionStripPointer:: ; d1ab
ds 2 ds 2
NorthConnectionStripLocation:: ; d1ad NorthConnectionStripLocation:: ; d1ad
ds 2 ds 2
NorthMapObjectIndexBuffer1:: ; d1af NorthMapObjectIndexBuffer:: ; d1af
ds 1 ds 1
NorthMapObjectIndexBuffer2:: ; d1b0 NorthObjectStructIndexBuffer:: ; d1b0
ds 1 ds 1
NorthConnectionStripYOffset:: ; d1b1 NorthConnectionStripYOffset:: ; d1b1
ds 1 ds 1
@ -1669,9 +1669,9 @@ SouthConnectionStripPointer:: ; d1b7
ds 2 ds 2
SouthConnectionStripLocation:: ; d1b9 SouthConnectionStripLocation:: ; d1b9
ds 2 ds 2
SouthMapObjectIndexBuffer1:: ; d1bb SouthMapObjectIndexBuffer:: ; d1bb
ds 1 ds 1
SouthMapObjectIndexBuffer2:: ; d1bc SouthObjectStructIndexBuffer:: ; d1bc
ds 1 ds 1
SouthConnectionStripYOffset:: ; d1bd SouthConnectionStripYOffset:: ; d1bd
ds 1 ds 1
@ -2036,85 +2036,57 @@ CurDay:: ; d4cb
ds 1 ds 1
ds 1 ds 1
wd4cd:: ds 1 wObjectFollow_Leader:: ds 1
wd4ce:: ds 1 wObjectFollow_Follower:: ds 1
wd4cf:: ds 1 wd4cf:: ds 1
wd4d0:: ds 1 wd4d0:: ds 1
wd4d1:: ds 5 wd4d1:: ds 1
ds 4
ObjectStructs:: ObjectStructs::
object_struct: MACRO
PlayerStruct:: ; d4d6 \1Struct::
ds 2 \1Sprite:: ds 1
PlayerSprite:: ; d4d8 \1MapObjectIndex:: ds 1
\1SpriteTile:: ds 1
\1MovementType:: ds 1
\1Flags:: ds 2
\1Palette:: ds 1
\1Walking:: ds 1
\1Direction:: ds 1
ds 1 ds 1
\1StepDuration:: ds 1
\1Action:: ds 1
\1Object12:: ds 1
\1Facing:: ds 1
\1StandingTile:: ds 1
\1NextTile:: ds 1
\1MapX:: ds 1
\1MapY:: ds 1
\1NextMapX:: ds 1
\1NextMapY:: ds 1
ds 3 ds 3
PlayerPalette:: ; d4dc \1SpriteX:: ds 1
ds 1 \1SpriteY:: ds 1
ds 1 \1SpriteXOffset:: ds 1
PlayerDirection:: ; d4de \1SpriteYOffset:: ds 1
; uses bits 2 and 3 / $0c / %00001100 ds 6
; %00 down ds 7
; %01 up ENDM
; %10 left
; $11 right
ds 1
ds 2
PlayerAction:: ; d4e1
; 1 standing
; 2 walking
; 4 spinning
; 6 fishing
ds 1
wd4e2:: ds 1
PlayerFacing:: ; d4e3
ds 1
StandingTile:: ; d4e4
ds 1
StandingTile2:: ; d4e5
ds 1
; relative to the map struct including borders
MapX:: ; d4e6
ds 1
MapY:: ; d4e7
ds 1
MapX2:: ; d4e8
ds 1
MapY2:: ; d4e9
ds 1
ds 3
; relative to the bg map, in px
PlayerSpriteX:: ; d4ed
ds 1
PlayerSpriteY:: ; d4ee
ds 1
ds 15
ObjectStruct1:: ; d4fe object_struct Player
ds OBJECT_STRUCT_LENGTH object_struct Object1
ObjectStruct2:: ; d526 object_struct Object2
ds OBJECT_STRUCT_LENGTH object_struct Object3
ObjectStruct3:: ; d54e object_struct Object4
ds OBJECT_STRUCT_LENGTH object_struct Object5
ObjectStruct4:: ; d576 object_struct Object6
ds OBJECT_STRUCT_LENGTH object_struct Object7
ObjectStruct5:: ; d59e object_struct Object8
ds OBJECT_STRUCT_LENGTH object_struct Object9
ObjectStruct6:: ; d5c6 object_struct Object10
ds OBJECT_STRUCT_LENGTH object_struct Object11
ObjectStruct7:: ; d5ee object_struct Object12
ds OBJECT_STRUCT_LENGTH
ObjectStruct8:: ; d616
ds OBJECT_STRUCT_LENGTH
ObjectStruct9:: ; d63e
ds OBJECT_STRUCT_LENGTH
ObjectStruct10:: ; d666
ds OBJECT_STRUCT_LENGTH
ObjectStruct11:: ; d68e
ds OBJECT_STRUCT_LENGTH
ObjectStruct12:: ; d6b6
ds OBJECT_STRUCT_LENGTH
; d6de
wd6de:: wd6de::
ds 64 ds 64