mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Object masks
This commit is contained in:
parent
6b2d0ae841
commit
76e2ea534f
@ -313,7 +313,7 @@ SuspendMapAnims: ; 154d3
|
||||
LoadObjectsRunCallback_02: ; 154d7
|
||||
ld a, $2
|
||||
call RunMapCallback
|
||||
callba Function2454f
|
||||
callba LoadObjectMasks
|
||||
callba Function8177
|
||||
ret
|
||||
; 154ea (5:54ea)
|
||||
|
16
home/map.asm
16
home/map.asm
@ -1170,33 +1170,33 @@ CoordinatesEventText:: ; 2702
|
||||
; 2707
|
||||
|
||||
|
||||
Function2707:: ; 2707
|
||||
CheckObjectMask:: ; 2707
|
||||
ld a, [hMapObjectIndexBuffer1]
|
||||
ld e, a
|
||||
ld d, $0
|
||||
ld hl, wd81e
|
||||
ld hl, wObjectMasks
|
||||
add hl, de
|
||||
ld a, [hl]
|
||||
ret
|
||||
; 2712
|
||||
|
||||
Function2712:: ; 2712
|
||||
MaskObject:: ; 2712
|
||||
ld a, [hMapObjectIndexBuffer1]
|
||||
ld e, a
|
||||
ld d, $0
|
||||
ld hl, wd81e
|
||||
ld hl, wObjectMasks
|
||||
add hl, de
|
||||
ld [hl], $ff
|
||||
ld [hl], -1 ; ,masked
|
||||
ret
|
||||
; 271e
|
||||
|
||||
Function271e:: ; 271e
|
||||
UnmaskObject:: ; 271e
|
||||
ld a, [hMapObjectIndexBuffer1]
|
||||
ld e, a
|
||||
ld d, $0
|
||||
ld hl, wd81e
|
||||
ld hl, wObjectMasks
|
||||
add hl, de
|
||||
ld [hl], $0
|
||||
ld [hl], 0 ; unmasked
|
||||
ret
|
||||
; 272a
|
||||
|
||||
|
@ -251,7 +251,7 @@ Function18de:: ; 18de
|
||||
ret
|
||||
; 18f5
|
||||
|
||||
Function18f5:: ; 18f5
|
||||
CheckObjectTime:: ; 18f5
|
||||
ld hl, MAPOBJECT_HOUR
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
@ -336,7 +336,7 @@ Function194d:: ; 194d
|
||||
|
||||
_CopyObjectStruct:: ; 1956
|
||||
ld [hMapObjectIndexBuffer1], a
|
||||
call Function271e
|
||||
call UnmaskObject
|
||||
ld a, [hMapObjectIndexBuffer1]
|
||||
call GetMapObject
|
||||
callba CopyObjectStruct
|
||||
@ -378,7 +378,7 @@ Function1985:: ; 1985
|
||||
|
||||
DeleteObjectStruct:: ; 199f
|
||||
call Function1967
|
||||
call Function2712
|
||||
call MaskObject
|
||||
ret
|
||||
; 19a6
|
||||
|
||||
|
33
main.asm
33
main.asm
@ -3315,9 +3315,9 @@ RefreshPlayerCoords: ; 80b8
|
||||
|
||||
|
||||
CopyObjectStruct:: ; 80e7
|
||||
call Function2707
|
||||
call CheckObjectMask
|
||||
and a
|
||||
ret nz
|
||||
ret nz ; masked
|
||||
ld hl, ObjectStructs + OBJECT_STRUCT_LENGTH * 1
|
||||
ld a, 1
|
||||
ld de, OBJECT_STRUCT_LENGTH
|
||||
@ -22936,22 +22936,22 @@ MenuDataHeader_0x24547: ; 0x24547
|
||||
db 1 ; default option
|
||||
; 0x2454f
|
||||
|
||||
Function2454f: ; 2454f
|
||||
ld hl, wd81e
|
||||
LoadObjectMasks: ; 2454f
|
||||
ld hl, wObjectMasks
|
||||
xor a
|
||||
ld bc, NUM_OBJECTS
|
||||
call ByteFill
|
||||
nop
|
||||
ld bc, MapObjects
|
||||
ld de, wd81e
|
||||
ld de, wObjectMasks
|
||||
xor a
|
||||
.loop
|
||||
push af
|
||||
push bc
|
||||
push de
|
||||
call Function245a7
|
||||
call GetObjectTimeMask
|
||||
jr c, .next
|
||||
call Function2457d
|
||||
call CheckObjectFlag
|
||||
.next
|
||||
pop de
|
||||
ld [de], a
|
||||
@ -22967,12 +22967,12 @@ Function2454f: ; 2454f
|
||||
jr nz, .loop
|
||||
ret
|
||||
|
||||
Function2457d: ; 2457d (9:457d)
|
||||
CheckObjectFlag: ; 2457d (9:457d)
|
||||
ld hl, MAPOBJECT_SPRITE
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and a
|
||||
jr z, .minus_one
|
||||
jr z, .masked
|
||||
ld hl, MAPOBJECT_EVENT_FLAG
|
||||
add hl, bc
|
||||
ld a, [hli]
|
||||
@ -22983,24 +22983,25 @@ Function2457d: ; 2457d (9:457d)
|
||||
jr nz, .check
|
||||
ld a, e
|
||||
cp -1
|
||||
jr z, .zero
|
||||
jr .minus_one
|
||||
jr z, .unmasked
|
||||
jr .masked
|
||||
.check
|
||||
ld b, CHECK_FLAG
|
||||
call EventFlagAction
|
||||
ld a, c
|
||||
and a
|
||||
jr nz, .minus_one
|
||||
.zero
|
||||
jr nz, .masked
|
||||
.unmasked
|
||||
xor a
|
||||
ret
|
||||
.minus_one
|
||||
|
||||
.masked
|
||||
ld a, -1
|
||||
scf
|
||||
ret
|
||||
|
||||
Function245a7: ; 245a7 (9:45a7)
|
||||
call Function18f5
|
||||
GetObjectTimeMask: ; 245a7 (9:45a7)
|
||||
call CheckObjectTime
|
||||
ld a, -1
|
||||
ret c
|
||||
xor a
|
||||
|
Loading…
Reference in New Issue
Block a user