Merge branch 'master' of https://github.com/pret/pokecrystal
This commit is contained in:
@@ -47,7 +47,7 @@ SetFacingStandAction: ; 44b5
|
||||
SetFacingStepAction: ; 44c1
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
bit SLIDING, [hl]
|
||||
bit SLIDING_F, [hl]
|
||||
jp nz, SetFacingCurrent
|
||||
|
||||
ld hl, OBJECT_STEP_FRAME
|
||||
@@ -59,7 +59,7 @@ SetFacingStepAction: ; 44c1
|
||||
|
||||
rrca
|
||||
rrca
|
||||
and %00000011
|
||||
maskbits NUM_DIRECTIONS
|
||||
ld d, a
|
||||
|
||||
call GetSpriteDirection
|
||||
@@ -74,7 +74,7 @@ SetFacingStepAction: ; 44c1
|
||||
SetFacingSkyfall: ; 44e4
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
bit SLIDING, [hl]
|
||||
bit SLIDING_F, [hl]
|
||||
jp nz, SetFacingCurrent
|
||||
|
||||
ld hl, OBJECT_STEP_FRAME
|
||||
@@ -86,7 +86,7 @@ SetFacingSkyfall: ; 44e4
|
||||
|
||||
rrca
|
||||
rrca
|
||||
and %00000011
|
||||
maskbits NUM_DIRECTIONS
|
||||
ld d, a
|
||||
|
||||
call GetSpriteDirection
|
||||
@@ -101,7 +101,7 @@ SetFacingSkyfall: ; 44e4
|
||||
SetFacingBumpAction: ; 4508
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
bit SLIDING, [hl]
|
||||
bit SLIDING_F, [hl]
|
||||
jp nz, SetFacingCurrent
|
||||
|
||||
ld hl, OBJECT_STEP_FRAME
|
||||
@@ -112,7 +112,7 @@ SetFacingBumpAction: ; 4508
|
||||
rrca
|
||||
rrca
|
||||
rrca
|
||||
and %00000011
|
||||
maskbits NUM_DIRECTIONS
|
||||
ld d, a
|
||||
|
||||
call GetSpriteDirection
|
||||
@@ -245,7 +245,7 @@ SetFacingWeirdTree: ; 45ab
|
||||
ld a, [hl]
|
||||
inc a
|
||||
ld [hl], a
|
||||
and %00001100
|
||||
maskbits NUM_DIRECTIONS, 2
|
||||
rrca
|
||||
rrca
|
||||
add FACING_WEIRD_TREE_0
|
||||
|
@@ -93,7 +93,7 @@ Function437b: ; 437b
|
||||
.ok2
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
bit 1, [hl]
|
||||
bit WONT_DELETE_F, [hl]
|
||||
jr nz, .yes2
|
||||
call DeleteMapObject
|
||||
scf
|
||||
@@ -146,7 +146,7 @@ Function437b: ; 437b
|
||||
.HandleObjectAction:
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
bit INVISIBLE, [hl]
|
||||
bit INVISIBLE_F, [hl]
|
||||
jr nz, SetFacingStanding
|
||||
ld hl, OBJECT_FLAGS2
|
||||
add hl, bc
|
||||
@@ -161,7 +161,7 @@ Function437b: ; 437b
|
||||
Function4440: ; 4440
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
bit INVISIBLE, [hl]
|
||||
bit INVISIBLE_F, [hl]
|
||||
jr nz, SetFacingStanding
|
||||
asm_4448:
|
||||
ld de, ObjectActionPairPointers + 2 ; use second column
|
||||
@@ -233,7 +233,7 @@ Function462a: ; 462a
|
||||
UpdateTallGrassFlags: ; 463f
|
||||
ld hl, OBJECT_FLAGS2
|
||||
add hl, bc
|
||||
bit OVERHEAD, [hl]
|
||||
bit OVERHEAD_F, [hl]
|
||||
jr z, .ok
|
||||
ld hl, OBJECT_NEXT_TILE
|
||||
add hl, bc
|
||||
@@ -260,13 +260,13 @@ SetTallGrassFlags: ; 4661
|
||||
.set
|
||||
ld hl, OBJECT_FLAGS2
|
||||
add hl, bc
|
||||
set OVERHEAD, [hl]
|
||||
set OVERHEAD_F, [hl]
|
||||
ret
|
||||
|
||||
.reset
|
||||
ld hl, OBJECT_FLAGS2
|
||||
add hl, bc
|
||||
res OVERHEAD, [hl]
|
||||
res OVERHEAD_F, [hl]
|
||||
ret
|
||||
; 4679
|
||||
|
||||
@@ -298,7 +298,7 @@ InitStep: ; 4690
|
||||
ld [hl], a
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
bit FIXED_FACING, [hl]
|
||||
bit FIXED_FACING_F, [hl]
|
||||
jr nz, GetNextTile
|
||||
add a
|
||||
add a
|
||||
@@ -696,7 +696,7 @@ MapObjectMovementPattern: ; 47dd
|
||||
and %00000011
|
||||
or 0
|
||||
call InitStep
|
||||
call Function6ec1
|
||||
call CanObjectMoveInDirection
|
||||
jr c, .ok2
|
||||
ld de, SFX_STRENGTH
|
||||
call PlaySFX
|
||||
@@ -1049,7 +1049,7 @@ MapObjectMovementPattern: ; 47dd
|
||||
|
||||
.RandomWalkContinue:
|
||||
call InitStep
|
||||
call Function6ec1 ; check whether the object can move in that direction
|
||||
call CanObjectMoveInDirection ; check whether the object can move in that direction
|
||||
jr c, .NewDuration
|
||||
call UpdateTallGrassFlags
|
||||
ld hl, OBJECT_ACTION
|
||||
@@ -2156,7 +2156,7 @@ DespawnEmote: ; 5579
|
||||
push af
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, de
|
||||
bit EMOTE_OBJECT, [hl]
|
||||
bit EMOTE_OBJECT_F, [hl]
|
||||
jr z, .next
|
||||
ld hl, OBJECT_SPRITE
|
||||
add hl, de
|
||||
@@ -2445,7 +2445,7 @@ Function56cd: ; 56cd
|
||||
ld [hUsedSpriteTile], a
|
||||
ld hl, OBJECT_PALETTE
|
||||
add hl, bc
|
||||
bit 7, [hl]
|
||||
bit BIG_OBJECT_F, [hl]
|
||||
jr z, .ok7
|
||||
ld a, d
|
||||
add 2
|
||||
@@ -2575,7 +2575,7 @@ ContinueSpawnFacing: ; 57db
|
||||
|
||||
_SetPlayerPalette: ; 57e2
|
||||
ld a, d
|
||||
and %10000000
|
||||
and 1 << 7
|
||||
ret z
|
||||
ld bc, 0 ; debug?
|
||||
ld hl, OBJECT_FACING
|
||||
@@ -2585,13 +2585,13 @@ _SetPlayerPalette: ; 57e2
|
||||
ld [hl], a
|
||||
ld a, d
|
||||
swap a
|
||||
and %00000111
|
||||
and PALETTE_MASK
|
||||
ld d, a
|
||||
ld bc, wPlayerStruct
|
||||
ld hl, OBJECT_PALETTE
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and %11111000
|
||||
and $ff ^ PALETTE_MASK
|
||||
or d
|
||||
ld [hl], a
|
||||
ret
|
||||
@@ -2919,10 +2919,10 @@ InitSprites: ; 5991
|
||||
ld e, PRIORITY_LOW
|
||||
ld hl, OBJECT_FLAGS2
|
||||
add hl, bc
|
||||
bit LOW_PRIORITY, [hl]
|
||||
bit LOW_PRIORITY_F, [hl]
|
||||
jr nz, .add
|
||||
ld e, PRIORITY_NORM
|
||||
bit HIGH_PRIORITY, [hl]
|
||||
bit HIGH_PRIORITY_F, [hl]
|
||||
jr z, .add
|
||||
ld e, PRIORITY_HIGH
|
||||
jr .add
|
||||
@@ -2974,35 +2974,35 @@ InitSprites: ; 5991
|
||||
ld hl, OBJECT_SPRITE_TILE
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and %01111111
|
||||
and $ff ^ (1 << 7)
|
||||
ld [hFFC1], a
|
||||
xor a
|
||||
bit 7, [hl]
|
||||
jr nz, .skip1
|
||||
or %00001000
|
||||
or VRAM_BANK_1
|
||||
.skip1
|
||||
ld hl, OBJECT_FLAGS2
|
||||
add hl, bc
|
||||
ld e, [hl]
|
||||
bit 7, e
|
||||
jr z, .skip2
|
||||
or %10000000
|
||||
or PRIORITY
|
||||
.skip2
|
||||
bit 4, e
|
||||
bit USE_OBP1_F, e
|
||||
jr z, .skip3
|
||||
or %00010000
|
||||
or OBP_NUM
|
||||
.skip3
|
||||
ld hl, OBJECT_PALETTE
|
||||
add hl, bc
|
||||
ld d, a
|
||||
ld a, [hl]
|
||||
and %00000111
|
||||
and PALETTE_MASK
|
||||
or d
|
||||
ld d, a
|
||||
xor a
|
||||
bit 3, e
|
||||
bit OVERHEAD_F, e
|
||||
jr z, .skip4
|
||||
or %10000000
|
||||
or PRIORITY
|
||||
.skip4
|
||||
ld [hFFC2], a
|
||||
ld hl, OBJECT_SPRITE_X
|
||||
@@ -3064,7 +3064,7 @@ InitSprites: ; 5991
|
||||
ld e, [hl]
|
||||
inc hl
|
||||
ld a, [hFFC1]
|
||||
bit 2, e
|
||||
bit ABSOLUTE_TILE_ID_F, e
|
||||
jr z, .nope1
|
||||
xor a
|
||||
.nope1
|
||||
@@ -3073,7 +3073,7 @@ InitSprites: ; 5991
|
||||
ld [bc], a ; tile id
|
||||
inc c
|
||||
ld a, e
|
||||
bit 1, a
|
||||
bit RELATIVE_ATTRIBUTES_F, a
|
||||
jr z, .nope2
|
||||
ld a, [hFFC2]
|
||||
or e
|
||||
|
@@ -377,42 +377,42 @@ Movement_tree_shake: ; 5279
|
||||
Movement_remove_sliding: ; 5293
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
res SLIDING, [hl]
|
||||
res SLIDING_F, [hl]
|
||||
jp ContinueReadingMovement
|
||||
; 529c
|
||||
|
||||
Movement_set_sliding: ; 529c
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
set SLIDING, [hl]
|
||||
set SLIDING_F, [hl]
|
||||
jp ContinueReadingMovement
|
||||
; 52a5
|
||||
|
||||
Movement_remove_fixed_facing: ; 52a5
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
res FIXED_FACING, [hl]
|
||||
res FIXED_FACING_F, [hl]
|
||||
jp ContinueReadingMovement
|
||||
; 52ae
|
||||
|
||||
Movement_fix_facing: ; 52ae
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
set FIXED_FACING, [hl]
|
||||
set FIXED_FACING_F, [hl]
|
||||
jp ContinueReadingMovement
|
||||
; 52b7
|
||||
|
||||
Movement_show_object: ; 52b7
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
res INVISIBLE, [hl]
|
||||
res INVISIBLE_F, [hl]
|
||||
jp ContinueReadingMovement
|
||||
; 52c0
|
||||
|
||||
Movement_hide_object: ; 52c0
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
set INVISIBLE, [hl]
|
||||
set INVISIBLE_F, [hl]
|
||||
jp ContinueReadingMovement
|
||||
; 52c9
|
||||
|
||||
@@ -838,7 +838,7 @@ JumpStep: ; 548a
|
||||
|
||||
ld hl, OBJECT_FLAGS2
|
||||
add hl, bc
|
||||
res OVERHEAD, [hl]
|
||||
res OVERHEAD_F, [hl]
|
||||
|
||||
ld hl, OBJECT_ACTION
|
||||
add hl, bc
|
||||
|
@@ -1,37 +1,38 @@
|
||||
Function6ec1: ; 6ec1
|
||||
CanObjectMoveInDirection: ; 6ec1
|
||||
|
||||
ld hl, OBJECT_PALETTE
|
||||
add hl, bc
|
||||
bit 5, [hl]
|
||||
jr z, .not_bit_5
|
||||
bit SWIMMING_F, [hl]
|
||||
jr z, .not_swimming
|
||||
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
bit 4, [hl] ; lost, uncomment next line to fix
|
||||
; jr nz, .resume
|
||||
bit NOCLIP_TILES_F, [hl] ; lost, uncomment next line to fix
|
||||
; jr nz, .noclip_tiles
|
||||
push hl
|
||||
push bc
|
||||
call Function6f2c
|
||||
call WillObjectBumpIntoLand
|
||||
pop bc
|
||||
pop hl
|
||||
ret c
|
||||
jr .resume
|
||||
jr .continue
|
||||
|
||||
.not_bit_5
|
||||
.not_swimming
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
bit 4, [hl]
|
||||
jr nz, .resume
|
||||
bit NOCLIP_TILES_F, [hl]
|
||||
jr nz, .noclip_tiles
|
||||
push hl
|
||||
push bc
|
||||
call Function6f07
|
||||
call WillObjectBumpIntoWater
|
||||
pop bc
|
||||
pop hl
|
||||
ret c
|
||||
|
||||
.resume
|
||||
bit 6, [hl]
|
||||
jr nz, .bit_6
|
||||
.noclip_tiles
|
||||
.continue
|
||||
bit NOCLIP_OBJS_F, [hl]
|
||||
jr nz, .noclip_objs
|
||||
|
||||
push hl
|
||||
push bc
|
||||
@@ -40,9 +41,9 @@ Function6ec1: ; 6ec1
|
||||
pop hl
|
||||
ret c
|
||||
|
||||
.bit_6
|
||||
bit 5, [hl]
|
||||
jr nz, .bit_5
|
||||
.noclip_objs
|
||||
bit MOVE_ANYWHERE_F, [hl]
|
||||
jr nz, .move_anywhere
|
||||
push hl
|
||||
call HasObjectReachedMovementLimit
|
||||
pop hl
|
||||
@@ -53,13 +54,13 @@ Function6ec1: ; 6ec1
|
||||
pop hl
|
||||
ret c
|
||||
|
||||
.bit_5
|
||||
.move_anywhere
|
||||
and a
|
||||
ret
|
||||
; 6f07
|
||||
|
||||
|
||||
Function6f07: ; 6f07
|
||||
WillObjectBumpIntoWater: ; 6f07
|
||||
call Function6f5f
|
||||
ret c
|
||||
ld hl, OBJECT_NEXT_MAP_X
|
||||
@@ -78,12 +79,12 @@ Function6f07: ; 6f07
|
||||
ld d, a
|
||||
call GetTileCollision
|
||||
and a ; LANDTILE
|
||||
jr z, Function6f3e
|
||||
jr z, WillObjectBumpIntoTile
|
||||
scf
|
||||
ret
|
||||
; 6f2c
|
||||
|
||||
Function6f2c: ; 6f2c
|
||||
WillObjectBumpIntoLand: ; 6f2c
|
||||
call Function6f5f
|
||||
ret c
|
||||
ld hl, OBJECT_NEXT_TILE
|
||||
@@ -91,12 +92,12 @@ Function6f2c: ; 6f2c
|
||||
ld a, [hl]
|
||||
call GetTileCollision
|
||||
cp WATERTILE
|
||||
jr z, Function6f3e
|
||||
jr z, WillObjectBumpIntoTile
|
||||
scf
|
||||
ret
|
||||
; 6f3e
|
||||
|
||||
Function6f3e: ; 6f3e
|
||||
WillObjectBumpIntoTile: ; 6f3e
|
||||
ld hl, OBJECT_NEXT_TILE
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
@@ -331,7 +332,7 @@ IsNPCAtCoord: ; 7041
|
||||
|
||||
ld hl, OBJECT_PALETTE
|
||||
add hl, bc
|
||||
bit 7, [hl]
|
||||
bit BIG_OBJECT_F, [hl]
|
||||
jr z, .got
|
||||
|
||||
call Function7171
|
||||
|
@@ -684,7 +684,7 @@ DoPlayerMovement:: ; 80000
|
||||
|
||||
ld hl, OBJECT_PALETTE
|
||||
add hl, bc
|
||||
bit 6, [hl]
|
||||
bit STRENGTH_BOULDER_F, [hl]
|
||||
jr z, .not_boulder
|
||||
|
||||
ld hl, OBJECT_FLAGS2
|
||||
@@ -696,7 +696,7 @@ DoPlayerMovement:: ; 80000
|
||||
ld hl, OBJECT_RANGE
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and $fc
|
||||
and %11111100
|
||||
or d
|
||||
ld [hl], a
|
||||
|
||||
|
@@ -1071,7 +1071,7 @@ ApplyObjectFacing:
|
||||
jr c, .not_visible ; STILL_SPRITE
|
||||
ld hl, OBJECT_FLAGS1
|
||||
add hl, bc
|
||||
bit FIXED_FACING, [hl]
|
||||
bit FIXED_FACING_F, [hl]
|
||||
jr nz, .not_visible
|
||||
pop de
|
||||
ld a, e
|
||||
|
Reference in New Issue
Block a user