documenting code relating to the unused raisable moving blocks

This commit is contained in:
BlinkingBerry 2024-08-25 22:30:25 +01:00
parent 0418e5bb3b
commit 3bbf36a77a
6 changed files with 36 additions and 32 deletions

View File

@ -1,9 +1,9 @@
; define sprite variants by selecting tile n° and setting OAM attributes (palette + flags) in a list
Entity8CSpriteVariants::
RaisableBlockSpriteVariants::
db $F8, OAM_GBC_PAL_0 | OAMF_PAL1
db $FA, OAM_GBC_PAL_0 | OAMF_PAL1
Entity8CHandler::
RaisableBlockShiftedRightEntityHandler::
ldh a, [hActiveEntityState] ;; 06:4EA1 $F0 $F0
and a ;; 06:4EA3 $A7
jr nz, .update ;; 06:4EA4 $20 $11
@ -21,28 +21,28 @@ Entity8CHandler::
ld hl, wEntitiesPosZTable ;; 06:4EAE $21 $10 $C3
add hl, bc ;; 06:4EB1 $09
ld [hl], $10 ;; 06:4EB2 $36 $10
; Done
jp IncrementEntityState ;; 06:4EB4 $C3 $12 $3B
.update
ld de, Entity8CSpriteVariants ;; 06:4EB7 $11 $9D $4E
ld de, RaisableBlockSpriteVariants ;; 06:4EB7 $11 $9D $4E
call RenderActiveEntitySpritesPair ;; 06:4EBA $CD $C0 $3B
call ReturnIfNonInteractive_06 ;; 06:4EBD $CD $C6 $64
ldh a, [hMovingBlockMoverState] ;; 06:4EC0 $F0 $BA
cp $02 ;; 06:4EC2 $FE $02
jr z, .movingBlockMoverRetracting ;; 06:4EC4 $28 $2C
jr z, .shoveLink ;; 06:4EC4 $28 $2C
and a ;; 06:4EC6 $A7
jr z, .jr_006_4EE3 ;; 06:4EC7 $28 $1A
jr z, .moverNotGrabbed ;; 06:4EC7 $28 $1A
; If the moving block mover is being pulled, raise the block into the air
ld hl, wEntitiesInertiaTable ;; 06:4EC9 $21 $D0 $C3
add hl, bc ;; 06:4ECC $09
inc [hl] ;; 06:4ECD $34
ld a, [hl] ;; 06:4ECE $7E
cp $0A ;; 06:4ECF $FE $0A
jr nz, .ret_4EE2 ;; 06:4ED1 $20 $0F
jr nz, .return ;; 06:4ED1 $20 $0F
ld [hl], b ;; 06:4ED3 $70
@ -53,34 +53,33 @@ Entity8CHandler::
add hl, bc ;; 06:4EDB $09
ld a, [hl] ;; 06:4EDC $7E
cp $20 ;; 06:4EDD $FE $20
jr nc, .ret_4EE2 ;; 06:4EDF $30 $01
jr nc, .return ;; 06:4EDF $30 $01
inc [hl] ;; 06:4EE1 $34
.ret_4EE2
.return
ret ;; 06:4EE2 $C9
.jr_006_4EE3
.moverNotGrabbed
ld hl, wEntitiesPosZTable ;; 06:4EE3 $21 $10 $C3
add hl, bc ;; 06:4EE6 $09
ld a, [hl] ;; 06:4EE7 $7E
and a ;; 06:4EE8 $A7
jr z, jr_006_4F0E ;; 06:4EE9 $28 $23
.jr_4EEB
jr z, .onGround ;; 06:4EE9 $28 $23
; If the moving block mover isn't grabbed, and the block is in the air, fall slowly
ldh a, [hFrameCounter] ;; 06:4EEB $F0 $E7
.jr_4EED
and $0F ;; 06:4EED $E6 $0F
jr nz, .movingBlockMoverRetracting ;; 06:4EEF $20 $01
jr nz, .shoveLink ;; 06:4EEF $20 $01
dec [hl] ;; 06:4EF1 $35
.movingBlockMoverRetracting
.shoveLink
ld a, [hl] ;; 06:4EF2 $7E
cp $04 ;; 06:4EF3 $FE $04
jr nc, .ret_4F0D ;; 06:4EF5 $30 $16
jr nc, .shoveLinkEnd ;; 06:4EF5 $30 $16
; If the block hits Link while falling, shove him away
call CheckLinkCollisionWithEnemy_trampoline ;; 06:4EF7 $CD $5A $3B
ret nc ;; 06:4EFA $D0
@ -93,25 +92,30 @@ Entity8CHandler::
ldh a, [hMultiPurpose1] ;; 06:4F09 $F0 $D8
ldh [hLinkSpeedX], a ;; 06:4F0B $E0 $9A
.ret_4F0D
.shoveLinkEnd
ret ;; 06:4F0D $C9
jr_006_4F0E:
.onGround
call CheckLinkCollisionWithEnemy_trampoline ;; 06:4F0E $CD $5A $3B
ret nc ;; 06:4F11 $D0
jp label_006_641F ;; 06:4F12 $C3 $1F $64
jp PushLinkOutOfEntity_06.forcePush ;; 06:4F12 $C3 $1F $64
Entity8DHandler::
RaisableBlockShiftedDownEntityHandler::
ldh a, [hActiveEntityState] ;; 06:4F15 $F0 $F0
and a ;; 06:4F17 $A7
jp nz, Entity8CHandler.update ;; 06:4F18 $C2 $B7 $4E
jp nz, RaisableBlockShiftedRightEntityHandler.update ; 06:4F18 $C2 $B7 $4E
; Init
; (hActiveEntityState == 0)
; wEntitiesPosYTable += 8
ld hl, wEntitiesPosYTable ;; 06:4F1B $21 $10 $C2
add hl, bc ;; 06:4F1E $09
ld a, [hl] ;; 06:4F1F $7E
add $08 ;; 06:4F20 $C6 $08
ld [hl], a ;; 06:4F22 $77
; wEntitiesPosZTable += 10
ld hl, wEntitiesPosZTable ;; 06:4F23 $21 $10 $C3
add hl, bc ;; 06:4F26 $09
ld [hl], $10 ;; 06:4F27 $36 $10

View File

@ -153,8 +153,8 @@ EntityHandlersTable::
._89 far_pointer HinoxEntityHandler
._8A far_pointer TileGlintShownEntityHandler
._8B far_pointer TileGlintHiddenEntityHandler
._8C far_pointer Entity8CHandler ; unused moving block?
._8D far_pointer Entity8DHandler ; unused moving block?
._8C far_pointer RaisableBlockShiftedRightEntityHandler ; unused
._8D far_pointer RaisableBlockShiftedDownEntityHandler ; unused
._8E far_pointer CueBallEntityHandler
._8F far_pointer MaskedMimicGoriyaEntityHandler
._90 far_pointer ThreeOfAKindEntityHandler ; $90

View File

@ -37,7 +37,7 @@ PushLinkOutOfEntity_06::
call CheckLinkCollisionWithEnemy_trampoline ;; 06:641A $CD $5A $3B
jr nc, ret_006_643C ;; 06:641D $30 $1D
label_006_641F:
.forcePush
call CopyLinkFinalPositionToPosition ;; 06:641F $CD $BE $0C
call ResetPegasusBoots ;; 06:6422 $CD $B6 $0C
ld a, [wC1A6] ;; 06:6425 $FA $A6 $C1

View File

@ -190,8 +190,8 @@ DEF ENTITY_ARMOS_KNIGHT EQU $88
DEF ENTITY_HINOX EQU $89
DEF ENTITY_TILE_GLINT_SHOWN EQU $8A
DEF ENTITY_TILE_GLINT_HIDDEN EQU $8B
DEF ENTITY_8C EQU $8C ; unknown
DEF ENTITY_8D EQU $8D ; unknown
DEF ENTITY_RAISABLE_BLOCK_SHIFTED_RIGHT EQU $8C ; unused
DEF ENTITY_RAISABLE_BLOCK_SHIFTED_DOWN EQU $8D ; unused
DEF ENTITY_CUE_BALL EQU $8E
DEF ENTITY_MASKED_MIMIC_GORIYA EQU $8F
DEF ENTITY_THREE_OF_A_KIND EQU $90

View File

@ -189,8 +189,8 @@ entity_types = [
'ENTITY_HINOX',
'ENTITY_TILE_GLINT_SHOWN',
'ENTITY_TILE_GLINT_HIDDEN',
'ENTITY_8C',
'ENTITY_8D',
'ENTITY_RAISABLE_BLOCK_SHIFTED_RIGHT',
'ENTITY_RAISABLE_BLOCK_SHIFTED_DOWN',
'ENTITY_CUE_BALL',
'ENTITY_MASKED_MIMIC_GORIYA',
'ENTITY_THREE_OF_A_KIND',

View File

@ -305,8 +305,8 @@ rules = [
0x89: "ENTITY_HINOX",
0x8A: "ENTITY_TILE_GLINT_SHOWN",
0x8B: "ENTITY_TILE_GLINT_HIDDEN",
0x8C: "ENTITY_8C",
0x8D: "ENTITY_8D",
0x8C: "ENTITY_RAISABLE_BLOCK_SHIFTED_RIGHT",
0x8D: "ENTITY_RAISABLE_BLOCK_SHIFTED_DOWN",
0x8E: "ENTITY_CUE_BALL",
0x8F: "ENTITY_MASKED_MIMIC_GORIYA",
0x90: "ENTITY_THREE_OF_A_KIND",