document tile asm functions

This commit is contained in:
theo3 2023-12-31 17:29:08 -08:00
parent 5049daabc5
commit 37ac9cb0fb
147 changed files with 973 additions and 931 deletions

View File

@ -931,8 +931,8 @@ _0800271A:
bne _0800270A
pop {r4, r5, r6, pc}
thumb_func_start sub_08002724
sub_08002724: @ 0x08002724
thumb_func_start UnpackTextNibbles
UnpackTextNibbles: @ 0x08002724
push {r4, r5, lr}
movs r2, #0x10
movs r3, #0xf
@ -1019,24 +1019,25 @@ _080027E6:
movs r0, #4
bx lr
// almost identical to LinearMoveDirection
// r0 = Entity*
// r1 = speed
// r2 = direction
non_word_aligned_thumb_func_start sub_080027EA
sub_080027EA: @ 0x080027EA
non_word_aligned_thumb_func_start LinearMoveDirectionOLD
LinearMoveDirectionOLD: @ 0x080027EA
push {r4, r5, r6, r7, lr}
movs r3, #0x80
tst r2, r3
bne _08002860
movs r4, #0x2a
ldrh r3, [r0, r4]
ldrh r3, [r0, r4] // collisions
movs r4, #7
tst r2, r4
bne _08002812
push {r0, r1, r2, r3}
adds r0, r2, #0
adds r1, r3, #0
bl sub_08002864
bl CalcCollisionDirectionOLD
adds r4, r0, #0
pop {r0, r1, r2, r3}
cmp r2, r4
@ -1063,7 +1064,7 @@ _08002812:
_08002834:
adds r4, r0, #0
pop {r0, r1, r2, r3}
ldr r5, [r0, #0x2c]
ldr r5, [r0, #0x2c] // x
adds r5, r5, r4
str r5, [r0, #0x2c]
_0800283E:
@ -1081,15 +1082,16 @@ _0800283E:
_08002856:
adds r4, r0, #0
pop {r0, r1, r2, r3}
ldr r5, [r0, #0x30]
ldr r5, [r0, #0x30] // y
subs r5, r5, r4
str r5, [r0, #0x30]
_08002860:
adds r1, r6, #0
pop {r4, r5, r6, r7, pc}
thumb_func_start sub_08002864
sub_08002864: @ 0x08002864
// collision related, probably leftover from FS
thumb_func_start CalcCollisionDirectionOLD
CalcCollisionDirectionOLD: @ 0x08002864
adds r2, r0, #0
lsrs r2, r2, #3
cmp r2, #0

View File

@ -621,26 +621,26 @@ _0800439C: .4byte gSpritePtrs
_080043A0: .4byte gSpritePtrs
_080043A4: .4byte gGFXSlots+4
thumb_func_start sub_080043A8
sub_080043A8: @ 0x080043A8
movs r1, #0xb
b _080043B6
thumb_func_start CreateDrownFX
CreateDrownFX: @ 0x080043A8
movs r1, #0xb // FX_WATER_SPLASH
b create_fx
thumb_func_start CreateChestSpawner
CreateChestSpawner: @ 0x080043AC
movs r1, #0xc
b _080043B6
thumb_func_start CreateLavaDrownFX
CreateLavaDrownFX: @ 0x080043AC
movs r1, #0xc // FX_LAVA_SPLASH
b create_fx
thumb_func_start sub_080043B0
sub_080043B0: @ 0x080043AC
movs r1, #0x52
b _080043B6
thumb_func_start CreateSwampDrownFX
CreateSwampDrownFX: @ 0x080043AC
movs r1, #0x52 // FX_GREEN_SPLASH
b create_fx
thumb_func_start CreateItemOnGround
CreateItemOnGround: @ 0x080043B4
movs r1, #0
thumb_func_start CreatePitFallFX
CreatePitFallFX: @ 0x080043B4
movs r1, #0 // FX_FALL_DOWN
_080043B6:
create_fx:
push {r4, lr}
adds r4, r0, #0
movs r0, #0xf
@ -648,10 +648,10 @@ _080043B6:
bl CreateObject
cmp r0, #0
beq _080043E0 @ Branch if entity could not be created
beq _080043E0
movs r1, #0x48
ldr r1, [r4, r1] @ Unused?
ldr r1, [r4, r1] // load hitbox (unused)
ldrh r3, [r4, #0x2e]
strh r3, [r0, #0x2e]
@ -664,11 +664,11 @@ _080043B6:
ldrb r3, [r4, #8]
cmp r3, #3 @ Is the spawner an enemy?
cmp r3, #3 // is parent entity an enemy?
bne _080043E0
movs r1, #1
strb r1, [r0, #0xb] @ Set base parameter
strb r1, [r0, #0xb] // copy entity.type2
_080043E0:
adds r0, r4, #0

View File

@ -5,57 +5,67 @@
.text
thumb_func_start sub_080043E8
sub_080043E8: @ 0x080043E8
.macro hazard_tile tile:req, hazard_type:req
.short \tile
.short \hazard_type
.endm
thumb_func_start GetTileHazardType
GetTileHazardType: @ 0x080043E8
push {r4, lr}
ldrb r1, [r0, #0xc]
cmp r1, #0
beq _08004414
beq no_hazard // action == 0
adds r4, r0, #0
bl sub_08016AD2
bl UpdateCollisionLayer
movs r3, #0x36
ldrsh r2, [r4, r3]
cmp r2, #0
bmi _08004414
cmp r0, #0
beq _08004414
add r3, pc, #0x10
_08004404:
bmi no_hazard // collisionLayer is negative
cmp r0, #0 // are we on a tile?
beq no_hazard
adr r3, hazard_list-4
loop:
adds r3, #4
ldrh r1, [r3]
cmp r1, #0
beq _08004414
beq no_hazard
cmp r0, r1
bne _08004404
bne loop
ldrh r0, [r3, #2]
pop {r4, pc}
_08004414:
no_hazard:
movs r0, #0
pop {r4, pc}
_08004418:
.byte 0x0D, 0x00, 0x01, 0x00, 0x10, 0x00, 0x02, 0x00
.byte 0x11, 0x00, 0x02, 0x00, 0x5A, 0x00, 0x03, 0x00, 0x13, 0x00, 0x04, 0x00, 0x00, 0x00
hazard_list:
hazard_tile 0xD, 0x1
hazard_tile 0x10, 0x2
hazard_tile 0x11, 0x2
hazard_tile 0x5A, 0x3
hazard_tile 0x13, 0x4
.short 0x0000
non_word_aligned_thumb_func_start sub_0800442E
sub_0800442E: @ 0x0800442E
push {r0, lr}
bl sub_080043E8
bl GetTileHazardType
cmp r0, #0
beq _08004448
lsls r0, r0, #2
add r1, pc, #0xC
beq not_hazard
lsls r0, #2
adr r1, _0800444C - 4
ldr r1, [r1, r0]
pop {r0}
bl _call_via_r1
movs r0, #1
pop {pc}
_08004448:
not_hazard:
movs r0, #0
pop {r1, pc}
_0800444C: .4byte CreateItemOnGround
_08004450: .4byte sub_080043A8
_08004454: .4byte CreateChestSpawner
_08004458: .4byte sub_080043B0
_0800444C: .4byte CreatePitFallFX
_08004450: .4byte CreateDrownFX
_08004454: .4byte CreateLavaDrownFX
_08004458: .4byte CreateSwampDrownFX
thumb_func_start sub_0800445C
sub_0800445C: @ 0x0800445C
@ -171,6 +181,7 @@ _08004516:
adds r0, r2, #0
bx lr
// r0 = Entity*
thumb_func_start sub_0800451C
sub_0800451C: @ 0x0800451C
push {r0, lr}
@ -196,17 +207,17 @@ sub_0800451C: @ 0x0800451C
sub_08004542: @ 0x08004542
movs r1, #0x38
movs r2, #2
strb r2, [r0, r1]
strb r2, [r0, r1] // entity->collisionLayer = 2
movs r2, #0xc0
ldrb r1, [r0, #0x1b]
bics r1, r2
adds r1, #0x40
strb r1, [r0, #0x1b]
strb r1, [r0, #0x1b] // update spriteOrientation
movs r2, #0xc0
ldrb r1, [r0, #0x19]
bics r1, r2
adds r1, #0x40
strb r1, [r0, #0x19]
strb r1, [r0, #0x19] // update spriteRendering
bx lr
non_word_aligned_thumb_func_start ResetCollisionLayer

View File

@ -29,22 +29,22 @@ gUnk_08007CAC:: @ 08007CAC
.endif
.endif
non_word_aligned_thumb_func_start sub_08007DD6
sub_08007DD6: @ 0x08007DD6
non_word_aligned_thumb_func_start ActTileToTile
ActTileToTile: @ 0x08007DD6
push {lr}
bl sub_08007DE0
bl ActTileConv
adds r0, r3, #0
pop {pc}
thumb_func_start sub_08007DE0
sub_08007DE0: @ 0x08007DE0
thumb_func_start ActTileConv
ActTileConv: @ 0x08007DE0
subs r1, #4
_08007DE2:
adds r1, #4
ldrh r3, [r1]
cmp r3, #0
cmp r3, #0 // reached end
beq _08007DF2
cmp r0, r3
cmp r0, r3 // equal
bne _08007DE2
ldrh r3, [r1, #2]
movs r2, #1

View File

@ -71,7 +71,7 @@ _08001230:
ldr r3, _0800135C @ =UpdateAnimationVariableFrames
bx r3
_0800123E:
ldr r3, _08001360 @ =CreateItemOnGround
ldr r3, _08001360 @ =CreatePitFallFX
bx r3
non_word_aligned_thumb_func_start GenericConfused
@ -155,19 +155,19 @@ _080012BA:
gUnk_080012C8::
.4byte 0x00000000
_080012CC: .4byte sub_08001214
_080012D0: .4byte sub_080043A8
_080012D4: .4byte CreateChestSpawner
_080012D8: .4byte sub_080043B0
_080012D0: .4byte CreateDrownFX
_080012D4: .4byte CreateLavaDrownFX
_080012D8: .4byte CreateSwampDrownFX
thumb_func_start sub_080012DC
sub_080012DC: @ 0x080012DC
push {r4, r5, lr}
adds r4, r0, #0
movs r5, #0x3a
ldrb r1, [r4, r5]
ldrb r1, [r4, r5] // gust jar state
lsrs r1, r1, #3
bhs _08001302
bl sub_080043E8
bl GetTileHazardType
cmp r0, #4
beq _08001302
cmp r0, #0
@ -241,7 +241,7 @@ _08001352:
.align 2, 0
_08001358: .4byte gEnemyFunctions
_0800135C: .4byte UpdateAnimationVariableFrames
_08001360: .4byte CreateItemOnGround
_08001360: .4byte CreatePitFallFX
_08001364: .4byte 0x00001800
_08001368: .4byte gUnk_080012C8
_0800136C: .4byte gUnk_080012C8

View File

@ -120,8 +120,8 @@ _080B1A64:
ldrh r0, [r1, r0]
bx lr
arm_func_start arm_GetRelativeCollisionTile
arm_GetRelativeCollisionTile: @ 0x080B1A8C
arm_func_start arm_GetActTileRelative
arm_GetActTileRelative: @ 0x080B1A8C
ldrh r3, [r0, #0x2e]
add r3, r3, r1
ldrh r1, [r0, #0x32]

View File

@ -26,7 +26,7 @@ sub_0800857C: @ 0x0800857C
_0800859C:
ldrh r1, [r0, #0x24]
ldrb r2, [r0, #0x15]
bl sub_080027EA
bl LinearMoveDirectionOLD
pop {r4 - r7}
mov r8, r4
@ -57,11 +57,11 @@ sub_080085CC: @ 0x080085CC
ldr r2, _0800888C @ =gPlayerState
ldr r1, _08008890 @ =gUnk_080083FC
movs r3, #0x26
ldrb r3, [r2, r3]
ldrb r3, [r2, r3] // swim_state
orrs r3, r3
beq _080085E6
ldr r2, [r2, #0x30]
movs r3, #0x80
movs r3, #0x80 // flags & PL_MINISH
ands r2, r3
beq _0800861A
ldr r1, _08008894 @ =gUnk_0800839C
@ -70,12 +70,12 @@ _080085E6:
ldr r1, _08008898 @ =gUnk_0800845C
ldrb r3, [r2, #2]
orrs r3, r3
bne _0800861A
ldr r2, [r2, #0x30]
bne _0800861A // jump_status != 0
ldr r2, [r2, #0x30] // flags & PL_PARACHUTE
ldr r3, _0800889C @ =0x01000000
tst r2, r3
bne _0800861A
movs r3, #0x80
movs r3, #0x80 // // flags & PL_MINISH
ldr r1, _080088A0 @ =gUnk_0800833C
ands r2, r3
bne _0800861A
@ -83,15 +83,15 @@ _080085E6:
ldr r3, _080088A8 @ =gPlayerState
ldrb r2, [r3, #0x1c]
orrs r2, r2
bne _0800861A
bne _0800861A // field_0x1c != 0
ldrb r2, [r3, #5]
orrs r2, r2
bne _0800861A
bne _0800861A // heldObject != 0
ldr r1, _080088AC @ =gUnk_0800851C
movs r2, #0xaa
ldrb r2, [r3, r2]
orrs r2, r2
bne _0800861A
bne _0800861A // attachedBeetleCount != 0
ldr r1, _080088B0 @ =gUnk_080082DC
_0800861A:
mov r11, r1
@ -169,7 +169,7 @@ _08008684:
_080086AC:
mov r0, r8
movs r2, #0x2a
strh r7, [r0, r2]
strh r7, [r0, r2] // collisions
pop {pc}
thumb_func_start sub_080086B4
@ -265,17 +265,17 @@ _08008754:
ands r2, r3
pop {pc}
non_word_aligned_thumb_func_start sub_0800875A
sub_0800875A: @ 0x0800875A
non_word_aligned_thumb_func_start DoItemTileInteraction
DoItemTileInteraction: @ 0x0800875A
push {r2, r4, lr}
ldrb r3, [r0, #0x14]
ldrb r3, [r0, #0x14] // item.animationState
movs r2, #6
ands r3, r2
ldr r4, _080088D0 @ =gUnk_08007DF4
ldrsb r2, [r4, r3]
adds r3, #1
ldrsb r3, [r4, r3]
bl sub_08008782
bl DoTileInteractionOffset
pop {r2, r4}
cmp r0, #0
beq _08008780
@ -288,21 +288,21 @@ sub_0800875A: @ 0x0800875A
_08008780:
pop {pc}
non_word_aligned_thumb_func_start sub_08008782
sub_08008782: @ 0x08008782
non_word_aligned_thumb_func_start DoTileInteractionOffset
DoTileInteractionOffset: @ 0x08008782
push {r4}
ldrh r4, [r0, #0x2e]
adds r2, r2, r4
ldrh r4, [r0, #0x32]
adds r3, r3, r4
pop {r4}
b sub_08008796
b DoTileInteraction
thumb_func_start sub_08008790
sub_08008790: @ 0x08008790
thumb_func_start DoTileInteractionHere
DoTileInteractionHere: @ 0x08008790
ldrh r2, [r0, #0x2e]
ldrh r3, [r0, #0x32]
b sub_08008796
b DoTileInteraction
// r0: Entity*
// r1: tile filter?
@ -310,8 +310,8 @@ sub_08008790: @ 0x08008790
// r3: y
// Somehow involved in trampling tiles, digging with claws, picking up tiles..
non_word_aligned_thumb_func_start sub_08008796
sub_08008796: @ 0x08008796
non_word_aligned_thumb_func_start DoTileInteraction
DoTileInteraction: @ 0x08008796
push {r4, r5, r6, r7, lr}
push {r2, r3}
ldr r2, _080088D4 @ =gRoomControls
@ -319,17 +319,17 @@ sub_08008796: @ 0x08008796
movs r2, #1
cmp r2, r3
pop {r2, r3}
beq _080087CE
beq _080087CE_return0
push {r0, r1, r2, r3}
pop {r4, r5, r6, r7}
adds r0, r6, #0
adds r1, r7, #0
movs r2, #0x38
ldrb r2, [r4, r2]
ldrb r2, [r4, r2] // collision layer
bl GetTileTypeByPos
ldr r1, _080088D8 @ =gUnk_080046A4
bl sub_08007DE0
beq _080087CE
bl ActTileConv
beq _080087CE_return0
lsls r1, r3, #3
adds r3, r5, #0
ldr r0, _080088DC @ =gUnk_080047F6
@ -338,51 +338,51 @@ sub_08008796: @ 0x08008796
lsrs r0, r3
lsrs r0, r0, #1
bhs _080087D2
_080087CE:
_080087CE_return0:
movs r0, #0
pop {r4, r5, r6, r7, pc}
_080087D2:
ldrb r0, [r5, #2]
ldrb r1, [r5, #3]
ldrb r0, [r5, #2] // object id
ldrb r1, [r5, #3] // object type
cmp r0, #0xff
beq _0800883A
beq after_create_obj
cmp r3, #6
beq _0800883A
beq after_create_obj
cmp r3, #0xe
beq _0800883A
beq after_create_obj
cmp r3, #0xa
beq _0800883A
beq after_create_obj
cmp r3, #0xb
beq _0800883A
beq after_create_obj
cmp r3, #0xd
bne _080087F6
cmp r0, #0xf
bne _0800883A
cmp r1, #0x17
bne _0800883A
cmp r0, #0xf // SPECIAL_FX
bne after_create_obj
cmp r1, #0x17 // FX_GRASS_CUT
bne after_create_obj
_080087F6:
movs r2, #0
cmp r0, #0xf
cmp r0, #0xf // SPECIAL_FX
bne _080087FE
movs r2, #0x80
_080087FE:
bl CreateObject
bl CreateObject // r0 = id, r1 = type, r2 = type2
cmp r0, #0
beq _0800883A
ldrb r1, [r5, #2]
beq after_create_obj
ldrb r1, [r5, #2] // object id
cmp r1, #0
beq _08008820
beq no_offset
movs r2, #0xf
adds r1, r6, #0
bics r1, r2
adds r1, #8
strh r1, [r0, #0x2e]
strh r1, [r0, #0x2e] // x
adds r1, r7, #0
bics r1, r2
adds r1, #8
strh r1, [r0, #0x32]
strh r1, [r0, #0x32] // y
b _0800882C
_08008820:
no_offset:
ldrh r1, [r4, #0x2e]
strh r1, [r0, #0x2e]
ldrh r1, [r4, #0x32]
@ -391,12 +391,12 @@ _08008820:
strh r1, [r1, #0x36]
_0800882C:
movs r3, #0x50
str r4, [r1, r3]
str r4, [r1, r3] // set parent to r4
movs r3, #0x38
ldrb r1, [r4, r3]
ldrb r1, [r4, r3] // copy collision layer from parent
strb r1, [r0, r3]
bl UpdateSpriteForCollisionLayer
_0800883A:
after_create_obj:
ldr r1, _080088E0 @ =gRoomControls
ldrh r0, [r1, #6]
subs r2, r6, r0
@ -417,7 +417,7 @@ _0800883A:
beq _08008876
push {r0, r1}
adds r0, r2, #0
bl GetLayerByIndex
bl GetTileBuffer
adds r3, r0, #4
pop {r0, r1}
lsls r1, r1, #1
@ -461,22 +461,22 @@ _080088DC: .4byte gUnk_080047F6
_080088E0: .4byte gRoomControls
_080088E4: .4byte 0x00004000
_080088E8: .4byte 0x0000FFFF
_080088EC:
velocities1:
.byte 0, -3, 3, -3
.byte 3, 0, 3, 3
.byte 0, 3, -3, 3
.byte -3, 0, -3, -3
_080088FC:
ice_velocities:
.byte 0, -10, 10, -10
.byte 10, 0, 10, 10
.byte 0, 10, -10, 10
.byte -10, 0, -10, -10
_0800890C:
velocities3:
.byte 0, 6, -6, 0
.byte 0, -6, 6, 0
.byte 19, 18, 18, 16
.byte 16, 17, 17, 19
_0800891C:
reset_vel:
push {r0}
bl ResetPlayerVelocity
pop {r0}
@ -497,7 +497,7 @@ UpdateIcePlayerVelocity: @ 0x0800892E
_UpdateIcePlayerVelocity:
push {lr}
ldrb r2, [r0, #0x14]
ldrb r2, [r0, #0x14] // animationState
lsrs r2, r2, #1
lsls r2, r2, #3
ldr r1, _08008A68 @ =gPlayerState
@ -522,20 +522,20 @@ _08008956:
movs r3, #0x80
tst r2, r3
bne _080089C0
_08008960:
ldrb r3, [r1, #5]
_08008960: // r1 = gPlayerState
ldrb r3, [r1, #5] // heldObject
cmp r3, #2
beq _0800891C
beq reset_vel
cmp r3, #1
beq _0800891C
ldr r4, _08008A74 @ =_080088FC
beq reset_vel
ldr r4, _08008A74 @ =ice_velocities
ldrb r3, [r1, #2]
adds r1, r2, #0
orrs r3, r3
orrs r3, r3 // jump_status != 0
beq _08008992
push {r2}
movs r3, #0x14
ldrb r1, [r0, r3]
ldrb r1, [r0, r3] // field_0x14
lsrs r1, r1, #1
lsls r1, r1, #1
lsrs r2, r2, #2
@ -544,7 +544,7 @@ _08008960:
adds r2, #2
movs r4, #7
ands r2, r4
ldr r4, _08008A78 @ =_080088EC
ldr r4, _08008A78 @ =velocities1
cmp r2, #4
beq _08008992
bhs _080089A8
@ -557,25 +557,25 @@ _08008992:
ldrsb r2, [r4, r3]
adds r3, #1
ldrsb r3, [r4, r3]
bl sub_08008A46
bl AddPlayerVelocity
b _080089C0
_080089A8:
movs r3, #0x14
ldrb r3, [r0, r3]
lsrs r3, r3, #1
lsls r3, r3, #1
ldr r4, _08008A7C @ =_0800890C
ldr r4, _08008A7C @ =velocities3
adds r4, r4, r3
movs r3, #0
ldrsb r2, [r4, r3]
adds r3, #1
ldrsb r3, [r4, r3]
bl sub_08008A46
bl AddPlayerVelocity
_080089C0:
ldr r1, _08008A80 @ =gPlayerState
movs r4, #0x8c
movs r2, #8
ldrsh r3, [r1, r4]
ldrsh r3, [r1, r4] // vel_x
orrs r3, r3
beq _080089E4
bpl _080089D2
@ -585,7 +585,7 @@ _080089D2:
push {r0, r1}
adds r1, r3, #0
push {r2}
bl sub_080027EA
bl LinearMoveDirectionOLD
pop {r0}
bl sub_0807A5B8
pop {r0, r1}
@ -602,7 +602,7 @@ _080089F4:
push {r0, r1}
adds r1, r3, #0
push {r2}
bl sub_080027EA
bl LinearMoveDirectionOLD
pop {r0}
bl sub_0807A5B8
pop {r0, r1}
@ -646,18 +646,18 @@ _08008A3E:
beq _08008A3A
b _08008A38
non_word_aligned_thumb_func_start sub_08008A46
sub_08008A46: @ 0x08008A46
non_word_aligned_thumb_func_start AddPlayerVelocity
AddPlayerVelocity: @ 0x08008A46
push {lr}
ldr r1, _08008A84 @ =gPlayerState
movs r4, #0x8c
ldrsh r5, [r1, r4]
ldrsh r5, [r1, r4] // vel_x
adds r5, r5, r2
bl sub_08008A88
movs r4, #0x8e
bl ClampPlayerVelocity
movs r4, #0x8e // vel_y
ldrsh r5, [r1, r4]
adds r5, r5, r3
bl sub_08008A88
bl ClampPlayerVelocity
pop {pc}
_08008A60:
eors r3, r3
@ -667,14 +667,14 @@ _08008A60:
_08008A68: .4byte gPlayerState
_08008A6C: .4byte gPlayerState
_08008A70: .4byte gPlayerState
_08008A74: .4byte _080088FC
_08008A78: .4byte _080088EC
_08008A7C: .4byte _0800890C
_08008A74: .4byte ice_velocities
_08008A78: .4byte velocities1
_08008A7C: .4byte velocities3
_08008A80: .4byte gPlayerState
_08008A84: .4byte gPlayerState
thumb_func_start sub_08008A88
sub_08008A88: @ 0x08008A88
thumb_func_start ClampPlayerVelocity
ClampPlayerVelocity: @ 0x08008A88
orrs r5, r5
bmi _08008A94
ldr r6, _08008B38 @ =0x00000180
@ -758,13 +758,13 @@ CheckNEastTile: @ 0x08008B02
push {r0, r1, lr}
movs r1, #0
movs r2, #0
bl GetRelativeCollisionTile
bl GetActTileRelative
// check if north east collision?
ldr r1, =0x4000
tst r0, r1
bne _08008B1E
ldr r1, =gUnk_08007CAC
bl sub_08007DE0
bl ActTileConv
movs r2, #1
cmp r3, #1
beq _08008B20

View File

@ -4,32 +4,33 @@
.syntax unified
.text
.thumb
.macro transition_tile tile:req, src_layer:req dest_layer:req
.short \tile
.byte \src_layer, \dest_layer
.endm
gUnk_08016984:: @ 08016984
.incbin "code_08016984/gUnk_08016984.bin"
.text
non_word_aligned_thumb_func_start GetNextScriptCommandHalfword
GetNextScriptCommandHalfword: @ 0x08016986
GetNextScriptCommandHalfword::
ldrh r0, [r0]
bx lr
non_word_aligned_thumb_func_start GetNextScriptCommandHalfwordAfterCommandMetadata
GetNextScriptCommandHalfwordAfterCommandMetadata: @ 0x0801698A
GetNextScriptCommandHalfwordAfterCommandMetadata::
ldrh r0, [r0, #2]
bx lr
non_word_aligned_thumb_func_start GetNextScriptCommandWord
GetNextScriptCommandWord: @ 0x0801698E
GetNextScriptCommandWord::
ldrh r1, [r0]
ldrh r0, [r0, #2]
lsls r0, r0, #0x10
orrs r0, r1
bx lr
thumb_func_start GetNextScriptCommandWordAfterCommandMetadata
GetNextScriptCommandWordAfterCommandMetadata: @ 0x08016998
GetNextScriptCommandWordAfterCommandMetadata::
ldrh r1, [r0, #2]
ldrh r0, [r0, #4]
lsls r0, r0, #0x10
@ -37,17 +38,15 @@ GetNextScriptCommandWordAfterCommandMetadata: @ 0x08016998
bx lr
.align 2, 0
gUnk_080169A4::
.byte 0x01, 0xFF, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x01, 0x00
.byte 0xFF, 0x01, 0x00, 0x00, 0x02, 0xFF, 0x01, 0xFE, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0x01, 0xFF, 0x02
.byte 0x00, 0x00, 0x01, 0x01, 0x02, 0xFF, 0x02, 0xFE, 0xFE, 0x02, 0xFF, 0x03, 0xFD, 0xFF, 0xFE, 0x01
.byte 0x01, 0xFD, 0xFF, 0xFF, 0x03, 0xFE, 0x02, 0x00, 0x00, 0xFF, 0xFE, 0x03, 0xFD, 0x02, 0xFF, 0x00
.byte 0x00, 0xFD, 0x02, 0x00, 0x00, 0xFF, 0x00, 0xFE, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02
.byte 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00
.byte 0x00, 0x00, 0x01, 0x00
gShakeOffsets::
.byte 1, -1, 0, 1, 1, 0, 0, 1, -1, -1, 1, 0, -1, 1, 0, 0
.byte 2, -1, 1, -2, 0, -1, -1, 0, -1, 1, -1, 2, 0, 0, 1, 1
.byte 2, -1, 2, -2, -2, 2, -1, 3, -3, -1, -2, 1, 1, -3, -1, -1
.byte 3, -2, 2, 0, 0, -1, -2, 3, -3, 2, -1, 0, 0, -3, 2, 0
.byte 0, -1, 0, -2, 0, -1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 1
.byte 2, 0, 1, 0, 0, 0, -1, 0, -1, 0, -1, 0, 0, 0, 1, 0
thumb_func_start UpdateSpriteForCollisionLayer
UpdateSpriteForCollisionLayer: @ 0x08016A04
UpdateSpriteForCollisionLayer::
movs r1, #0x38
ldrb r1, [r0, r1]
lsls r1, r1, #1
@ -69,8 +68,7 @@ UpdateSpriteForCollisionLayer: @ 0x08016A04
_08016A28:
.byte 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x40, 0x40
thumb_func_start ResolveCollisionLayer
ResolveCollisionLayer: @ 0x08016A30
ResolveCollisionLayer::
push {r4, r5, lr}
adds r4, r0, #0
movs r5, #0x38
@ -102,41 +100,51 @@ _08016A64:
bl UpdateSpriteForCollisionLayer
pop {r4, r5, pc}
thumb_func_start sub_08016A6C
sub_08016A6C: @ 0x08016A6C
CheckOnLayerTransition::
push {r4, r5, lr}
adds r4, r0, #0
bl GetActTile
add r1, pc, #0x38
_08016A76:
adds r1, #4
ldrh r2, [r1]
bl GetActTile // tile under me
adr r1, gTransitionTiles-4
loop:
adds r1, #4 // p += 4
ldrh r2, [r1] // *(u16*)(p)
cmp r2, #0
beq _08016A90
beq not_found
cmp r2, r0
bne _08016A76
bne loop // found the tile under me?
movs r2, #0x38
ldrb r3, [r4, r2]
ldrb r5, [r1, #2]
cmp r3, r5
beq _08016A90
ldrb r5, [r1, #3]
strb r5, [r4, r2]
_08016A90:
ldrb r3, [r4, r2] // collision layer
ldrb r5, [r1, #2] // *(u8*)(p + 2)
cmp r3, r5 // am i on the right later?
beq not_found
ldrb r5, [r1, #3] // *(u8*)(p + 3)
strb r5, [r4, r2] // move to a new layer
not_found:
pop {r4, r5, pc}
.align 2, 0
_08016A94:
.byte 0x2A, 0x00, 0x03, 0x03, 0x2D, 0x00, 0x03, 0x03, 0x2B, 0x00, 0x03, 0x03
.byte 0x2C, 0x00, 0x03, 0x03, 0x4C, 0x00, 0x03, 0x03, 0x4E, 0x00, 0x03, 0x03, 0x4D, 0x00, 0x03, 0x03
.byte 0x4F, 0x00, 0x03, 0x03, 0x0A, 0x00, 0x02, 0x01, 0x09, 0x00, 0x02, 0x01, 0x0C, 0x00, 0x01, 0x02
.byte 0x0B, 0x00, 0x01, 0x02, 0x52, 0x00, 0x03, 0x03, 0x27, 0x00, 0x03, 0x03, 0x26, 0x00, 0x03, 0x03
.byte 0x00, 0x00
non_word_aligned_thumb_func_start sub_08016AD2
sub_08016AD2: @ 0x08016AD2
transition_tile 0x2A, 3, 3
transition_tile 0x2D, 3, 3
transition_tile 0x2B, 3, 3
transition_tile 0x2C, 3, 3
transition_tile 0x4C, 3, 3
transition_tile 0x4E, 3, 3
transition_tile 0x4D, 3, 3
transition_tile 0x4F, 3, 3
gTransitionTiles:
transition_tile 0x0A, 2, 1
transition_tile 0x09, 2, 1
transition_tile 0x0C, 1, 2
transition_tile 0x0B, 1, 2
transition_tile 0x52, 3, 3
transition_tile 0x27, 3, 3
transition_tile 0x26, 3, 3
.short 0x0000
UpdateCollisionLayer::
push {r4, lr}
adds r4, r0, #0
bl sub_08016A6C
bl CheckOnLayerTransition
push {r0}
adds r0, r4, #0
bl UpdateSpriteForCollisionLayer

View File

@ -54,8 +54,8 @@ CloneTile: @ 0x08000152
ldrh r0, [r3, r0]
lsrs r2, r2, #2
non_word_aligned_thumb_func_start SetTile
SetTile: @ r0 = tile type, r1, = tile position, r2 = layer
non_word_aligned_thumb_func_start SetBottomTile
SetBottomTile: @ r0 = tile type, r1, = tile position, r2 = layer
push {r4-r7, lr}
lsls r3, r2, #3
ldr r4, _08000208 @ =gUnk_08000228
@ -65,7 +65,7 @@ SetTile: @ r0 = tile type, r1, = tile position, r2 = layer
strh r0, [r5, r6]
ldr r6, _0800020C @ =0x00004000
cmp r0, r6
blo _0800019A
blo tile_wrong_type
push {r1, r2}
subs r4, r0, r6
ldr r3, _08000210 @ =gUnk_080B7910
@ -77,12 +77,12 @@ SetTile: @ r0 = tile type, r1, = tile position, r2 = layer
bl sub_08000148
pop {r0, r1} @ tilepos, layer
push {r0, r1}
bl DeleteLoadedTileEntity
bl UnregisterInteractTile
adds r0, r7, #0
pop {r1, r2}
bl sub_0801AF48
bl RegisterInteractTile
pop {r4, r5, r6, r7, pc}
_0800019A:
tile_wrong_type:
adds r3, #4
ldr r4, [r4, r3]
lsls r0, r0, #1
@ -96,7 +96,7 @@ _0800019A:
lsrs r2, r2, #2
bl sub_08000148
pop {r0, r1}
bl DeleteLoadedTileEntity
bl UnregisterInteractTile
pop {r4, r5, r6, r7, pc}
.align 2, 0
_080001C0: .4byte gMapBottom+0x6004
@ -265,9 +265,9 @@ GetTileType: @ 0x080002B0
@ r0: Entity*
@ r1: u32
@ r2: u32
thumb_func_start GetRelativeCollisionTile
GetRelativeCollisionTile: @ 0x080002B4
ldr r3, _08000320 @ =ram_GetRelativeCollisionTile
thumb_func_start GetActTileRelative
GetActTileRelative: @ 0x080002B4
ldr r3, _08000320 @ =ram_GetActTileRelative
bx r3
@ call 0x080B1AA8
@ -410,7 +410,7 @@ _08000310: .4byte ram_GetTileTypeByPos
_08000314: .4byte ram_sub_080B1A48
_08000318: .4byte ram_sub_080B1A58
_0800031C: .4byte ram_GetTileType
_08000320: .4byte ram_GetRelativeCollisionTile
_08000320: .4byte ram_GetActTileRelative
_08000324: .4byte ram_GetActTile
_08000328: .4byte ram_sub_080B1AB4
_0800032C: .4byte ram_sub_080B1AC8

View File

@ -9,7 +9,7 @@ extern void CloneTile(u32, u32, u32);
extern u32 GetTileTypeByEntity(struct Entity_*);
extern u32 GetTileTypeByPos(s32 x, s32 y, u32 layer);
extern u32 GetTileType(u32 position, u32 layer);
extern void SetTile(u32 index, u32 position, u32 layer);
extern void SetBottomTile(u32 index, u32 position, u32 layer);
extern void UpdateScrollVram(void);
extern u32 sub_080B1B0C(struct Entity_*);
extern u32 sub_080B1BA4(u32, u32, u32);
@ -29,7 +29,7 @@ u32 BounceUpdate(struct Entity_*, u32 acceleration);
extern u32 CheckOnScreen(struct Entity_*);
extern bool32 EntityInRectRadius(struct Entity_*, struct Entity_*, u32, u32);
extern void UpdateAnimationVariableFrames(struct Entity_*, u32);
extern u32 sub_080043E8(struct Entity_*);
extern u32 GetTileHazardType(struct Entity_*);
/**
* Basic collision, only used between player and dazed enemies.
* (Probablity leftover from Four Swords)
@ -44,7 +44,7 @@ extern u32 sub_080086B4(u32, u32, const u8*);
extern u32 ResolveCollisionLayer(struct Entity_*);
extern void sub_0800417E(struct Entity_*, u32);
extern u32 sub_0800442E(struct Entity_*);
extern u32 sub_08007DD6(u32, const u16*);
extern u32 ActTileToTile(u32, const u16*);
extern void SoundReqClipped(struct Entity_*, u32);
extern u32 sub_0800132C(struct Entity_*, struct Entity_*);
extern u32 sub_080B1B44(u32, u32);
@ -54,7 +54,7 @@ extern u32 sub_080B1AE0(u16, u8);
extern u32 GetActTile(struct Entity_*);
extern u32 sub_0800445C(struct Entity_*);
extern u32 sub_080B1AF0(struct Entity_*, s32, s32);
extern u32 GetRelativeCollisionTile(struct Entity_*, u32, u32);
extern u32 GetActTileRelative(struct Entity_*, u32, u32);
extern bool32 sub_080B1B54(u32);
extern u32 CheckRectOnScreen(s32, s32, u32, u32);

View File

@ -62,7 +62,6 @@ void EnemySetFXOffset(Entity*, s32, s32, s32);
Entity* EnemyCreateProjectile(Entity*, u32, u32);
void GenericDeath(Entity*);
void sub_08002724(void*, u8*);
void sub_080026C4(u8*, u8*, u8*, u32);
void sub_080026F2(u8*, void*, u8*, u32);
bool32 sub_08049FA0(Entity*);

View File

@ -14,10 +14,10 @@
// Identified - to be sorted into header files
extern u32 CheckRegionOnScreen(u32, u32, u32, u32);
extern void CopyOAM(void);
extern void CreateChestSpawner(Entity*);
extern void CreateLavaDrownFX(Entity*);
extern Entity* CreateGroundItem(Entity*, u32, u32);
extern Entity* CreateGroundItemWithFlags(Entity*, u32, u32, u32);
extern void CreateItemOnGround(Entity*);
extern void CreatePitFallFX(Entity*);
extern void CreateMagicSparkles(u32, u32, u32);
extern void CreateMinishEntrance(u32 tile);
extern u32 CreateRandomItemDrop(Entity*, u32);
@ -25,7 +25,7 @@ extern void DrawDirect(u32 spriteIndex, u32 frameIndex);
extern void DrawEntities(void);
extern bool32 EntityWithinDistance(Entity*, s32, s32, s32);
extern void FlushSprites(void);
extern LayerStruct* GetLayerByIndex(u32);
extern LayerStruct* GetTileBuffer(u32);
extern u32 GetTileIndex(u32 tilePos, u32 layer);
extern u32 GiveItem(u32, u32);
extern bool32 LoadFixedGFX(Entity*, u32);
@ -57,7 +57,7 @@ extern u32 sub_080B1B18(s32, s32, u32);
extern u32 sub_080B1B44(u32, u32);
extern s32 sub_080012DC(Entity*);
extern void sub_08001318(Entity*);
extern void sub_080027EA(Entity*, u32, u32);
extern void LinearMoveDirectionOLD(Entity*, u32, u32);
extern void sub_080028E0(Entity*);
extern u32 sub_080040A2(Entity*);
extern u32 sub_080040D8(Entity*, u8*, s32, s32);
@ -66,15 +66,15 @@ extern u32 sub_0800419C(Entity*, Entity*, u32, u32);
extern u32 sub_080041DC(Entity*, u32, u32);
extern void sub_080042BA(Entity*, u32);
extern void sub_080042D0(Entity*, u32, u16);
extern void sub_080043A8(Entity*);
extern void CreateDrownFX(Entity*);
extern u32 sub_0800445C(Entity*);
extern void sub_080044AE(Entity*, u32, u32);
extern u32 BounceUpdate(Entity*, u32);
extern void sub_0800451C(Entity*);
extern void sub_08004542(Entity*);
extern void sub_080085B0(Entity*);
extern u16* sub_08008796(Entity*, u32, u32, u32);
extern void sub_08016AD2(Entity*);
extern u16* DoTileInteraction(Entity*, u32, u32, u32);
extern void UpdateCollisionLayer(Entity*);
extern u32 sub_0801766C(Entity*);
extern void sub_0801AFE4(void);
extern void UpdateUIElements(void);

View File

@ -6,18 +6,18 @@
typedef struct {
/*0x0000*/ BgSettings* bgSettings;
/*0x0004*/ u16 mapData[0x1000]; // tilemap data? <-- gMapDataTop / gMapDataBottom
/*0x2004*/ u8 collisionData[0x1000]; // more tilemap data? <-- gUnk_0200D654 / gUnk_02027EB4
/*0x3004*/ u16 mapDataClone[0x1000]; // more tilemap data? <-- gUnk_0200E654 / gUnk_02028EB4
/*0x5004*/ u16 metatileTypes[0x800]; // gMetatileTypesTop, gMetatileTypesBottom
/*0x6004*/ u16 unkData2[0x800]; // gUnk_02011654,gUnk_0202BEB4
/*0x7004*/ u16 metatiles[0x2000]; // gMetatilesTop, gMetatilesBottom
/*0xb004*/ u8 unkData3[0x1000]; // gUnk_02016654, gUnk_02030EB4
/*0x0004*/ u16 mapData[0x1000]; // tilemap data? <-- gMapDataTop / gMapDataBottom
/*0x2004*/ u8 collisionData[0x1000]; // more tilemap data? <-- gUnk_0200D654 / gUnk_02027EB4
/*0x3004*/ u16 mapDataOriginal[0x1000]; // more tilemap data? <-- gUnk_0200E654 / gUnk_02028EB4
/*0x5004*/ u16 metatileTypes[0x800]; // gMetatileTypesTop, gMetatileTypesBottom
/*0x6004*/ u16 unkData2[0x800]; // gUnk_02011654,gUnk_0202BEB4
/*0x7004*/ u16 metatiles[0x2000]; // gMetatilesTop, gMetatilesBottom
/*0xb004*/ u8 unkData3[0x1000]; // gUnk_02016654, gUnk_02030EB4
} LayerStruct;
extern LayerStruct gMapTop;
extern LayerStruct gMapBottom;
LayerStruct* GetLayerByIndex(u32);
LayerStruct* GetTileBuffer(u32);
#endif // MAP_H

View File

@ -762,7 +762,7 @@ void PlayerShrinkByRay(void);
// player.s
extern u32 PlayerCheckNEastTile();
extern u32* sub_08008790(Entity*, u32);
extern u32* DoTileInteractionHere(Entity*, u32);
extern void UpdateIcePlayerVelocity(Entity*);
extern void sub_08008AC6(Entity*);
extern void sub_08008926(Entity*);

View File

@ -1,6 +1,23 @@
#ifndef TILES_H
#define TILES_H
typedef enum {
TILE_ACT_CUT = 0x0,
TILE_ACT_ROCKBREAKER = 0x1,
TILE_ACT_BOOMERANG = 0x2,
TILE_ACT_BOMB = 0x3,
TILE_ACT_ARROW = 0x4,
TILE_ACT_GUST = 0x5,
TILE_ACT_LIFT = 0x6,
TILE_ACT_FIRE = 0x7,
TILE_ACT_PLAYER_WALK = 0x8,
TILE_ACT_ENEMY_WALK = 0x9,
TILE_ACT_PACCI = 0xA,
TILE_ACT_SWORDBEAM = 0xC,
TILE_ACT_DIG = 0xD,
TILE_ACT_MINIGUST = 0xE,
} TileInteraction;
typedef enum {
CUT_BUSH = 0x1C,
CUT_GRASS = 0x1D,

View File

@ -169,7 +169,7 @@ SECTIONS {
. = 0x000057BC; ram_sub_080B1A48 = .;
. = 0x000057CC; ram_sub_080B1A58 = .;
. = 0x000057D4; ram_GetTileType = .;
. = 0x00005800; ram_GetRelativeCollisionTile = .;
. = 0x00005800; ram_GetActTileRelative = .;
. = 0x0000581C; ram_GetActTile = .;
. = 0x00005828; ram_sub_080B1AB4 = .;
. = 0x0000583C; ram_sub_080B1AC8 = .;

View File

@ -217,7 +217,7 @@ u32 UpdatePlayerCollision(void) {
}
}
}
layer = GetLayerByIndex(gPlayerEntity.base.collisionLayer);
layer = GetTileBuffer(gPlayerEntity.base.collisionLayer);
ptr1 = &gUnk_080B4468[gPlayerEntity.base.animationState & 6];
position = COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr1[0], -ptr1[1]);
tileType = GetTileType(position, gPlayerEntity.base.collisionLayer);
@ -509,13 +509,13 @@ u32 UpdatePlayerCollision(void) {
if (gPlayerState.field_0x35 != 0) {
return 0;
}
SetTile(0x4054, position, gPlayerEntity.base.collisionLayer);
SetBottomTile(0x4054, position, gPlayerEntity.base.collisionLayer);
return 4;
case 0x4053:
if (gPlayerState.field_0x35 != 6) {
return 0;
}
SetTile(0x4054, position, gPlayerEntity.base.collisionLayer);
SetBottomTile(0x4054, position, gPlayerEntity.base.collisionLayer);
return 4;
case 0x4055:
position--;
@ -529,7 +529,7 @@ u32 UpdatePlayerCollision(void) {
}
for (index = 0; index < 3; index++) {
if (sub_0801A8D0(gPlayerClones[index], 0) == position) {
SetTile(0x4059, position, gPlayerEntity.base.collisionLayer);
SetBottomTile(0x4059, position, gPlayerEntity.base.collisionLayer);
return 4;
}
}
@ -546,7 +546,7 @@ u32 UpdatePlayerCollision(void) {
}
for (index = 0; index < 3; index++) {
if (sub_0801A8D0(gPlayerClones[index], 6) == position) {
SetTile(0x4059, position, gPlayerEntity.base.collisionLayer);
SetBottomTile(0x4059, position, gPlayerEntity.base.collisionLayer);
return 4;
}
}
@ -563,7 +563,7 @@ u32 UpdatePlayerCollision(void) {
if ((gPlayerEntity.base.frame & 1) == 0) {
return 0;
}
SetTile(0x4074, position, gPlayerEntity.base.collisionLayer);
SetBottomTile(0x4074, position, gPlayerEntity.base.collisionLayer);
gPlayerState.pushedObject = 0xa0;
gPlayerState.queued_action = PLAYER_PUSH;
gPlayerState.flags |= PL_BUSY;
@ -582,7 +582,7 @@ u32 UpdatePlayerCollision(void) {
if ((gPlayerEntity.base.frame & 1) == 0) {
return 0;
}
SetTile(0x4074, position, gPlayerEntity.base.collisionLayer);
SetBottomTile(0x4074, position, gPlayerEntity.base.collisionLayer);
sub_080001D0(0xd, position, gPlayerEntity.base.collisionLayer);
return 1;
default:
@ -638,7 +638,7 @@ bool32 sub_0801A370(LayerStruct* layer, u32 position) {
if (!sub_0801A4F8()) {
return FALSE;
}
topLayer = GetLayerByIndex(2);
topLayer = GetTileBuffer(2);
offset = gUnk_080B4488[gPlayerEntity.base.animationState >> 1];
pos = position + offset;
tileType = GetTileType(pos, gPlayerEntity.base.collisionLayer);
@ -748,7 +748,7 @@ u32 sub_0801A570(Entity* this, u32 param_2) {
if (this == NULL) {
return 0xffff;
}
layer = GetLayerByIndex(this->collisionLayer);
layer = GetTileBuffer(this->collisionLayer);
metatileTypes = layer->metatileTypes;
index1 = 4;
index2 = 2;
@ -904,7 +904,7 @@ u32 sub_0801A8D0(Entity* this, u32 param_2) {
if (this == NULL)
return 0xffff;
mapData = GetLayerByIndex(this->collisionLayer)->mapData;
mapData = GetTileBuffer(this->collisionLayer)->mapData;
if (param_2 == 0) {
position = COORD_TO_TILE_OFFSET(this, 0, 8);
tile = mapData[position];
@ -930,7 +930,7 @@ u32 sub_0801A8D0(Entity* this, u32 param_2) {
bool32 sub_0801A980(void) {
u16 tileType;
const s16* ptr;
GetLayerByIndex(gPlayerEntity.base.collisionLayer);
GetTileBuffer(gPlayerEntity.base.collisionLayer);
ptr = &gUnk_080B44A8[gPlayerEntity.base.animationState & 6];
tileType =
GetTileType(COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr[0], -ptr[1]), gPlayerEntity.base.collisionLayer);
@ -982,7 +982,7 @@ bool32 sub_0801AA58(Entity* this, u32 param_2, u32 param_3) {
Entity* object;
u32 temp;
layer = GetLayerByIndex(this->collisionLayer);
layer = GetTileBuffer(this->collisionLayer);
if (((layer->collisionData[param_2 + gUnk_080B4488[param_3 >> 3]] == 0) ||
((u8)(layer->collisionData[param_2 + gUnk_080B4488[param_3 >> 3]] - 0x20) < 0x20))) {
@ -1007,7 +1007,7 @@ bool32 sub_0801AA58(Entity* this, u32 param_2, u32 param_3) {
void sub_0801AB08(u16* specialData, LayerStruct* layer) {
u16* metatiles;
u16* mapData;
u16* mapDataClone;
u16* mapDataOriginal;
u16 index;
u16 innerIndex;
u32 tmp2;
@ -1020,7 +1020,7 @@ void sub_0801AB08(u16* specialData, LayerStruct* layer) {
tmp3 = 2;
}
tmp2 = tmp3 << 0xc;
mapDataClone = layer->mapDataClone;
mapDataOriginal = layer->mapDataOriginal;
mapData = layer->mapData;
for (index = 0; index < 0x40; index++) {
@ -1028,7 +1028,7 @@ void sub_0801AB08(u16* specialData, LayerStruct* layer) {
if (mapData[0] < 0x4000) {
tmp1 = mapData[0] << 2;
} else {
tmp1 = sub_0801AC68(tmp2, mapDataClone[0]);
tmp1 = sub_0801AC68(tmp2, mapDataOriginal[0]);
}
metatiles = layer->metatiles + tmp1;
specialData[0] = metatiles[0];
@ -1039,7 +1039,7 @@ void sub_0801AB08(u16* specialData, LayerStruct* layer) {
if (mapData[1] < 0x4000) {
tmp1 = mapData[1] << 2;
} else {
tmp1 = sub_0801AC68(tmp2 + 1, mapDataClone[1]);
tmp1 = sub_0801AC68(tmp2 + 1, mapDataOriginal[1]);
}
metatiles = layer->metatiles + tmp1;
specialData[0] = metatiles[0];
@ -1050,7 +1050,7 @@ void sub_0801AB08(u16* specialData, LayerStruct* layer) {
if (mapData[2] < 0x4000) {
tmp1 = mapData[2] << 2;
} else {
tmp1 = sub_0801AC68(tmp2 + 2, mapDataClone[2]);
tmp1 = sub_0801AC68(tmp2 + 2, mapDataOriginal[2]);
}
metatiles = layer->metatiles + tmp1;
specialData[0] = metatiles[0];
@ -1061,7 +1061,7 @@ void sub_0801AB08(u16* specialData, LayerStruct* layer) {
if (mapData[3] < 0x4000) {
tmp1 = mapData[3] << 2;
} else {
tmp1 = sub_0801AC68(tmp2 + 3, mapDataClone[3]);
tmp1 = sub_0801AC68(tmp2 + 3, mapDataOriginal[3]);
}
metatiles = layer->metatiles + tmp1;
specialData[0] = metatiles[0];
@ -1071,7 +1071,7 @@ void sub_0801AB08(u16* specialData, LayerStruct* layer) {
specialData += 2;
mapData += 4;
mapDataClone += 4;
mapDataOriginal += 4;
tmp2 = (u16)(tmp2 + 4);
}
specialData = specialData + 0x80;
@ -1215,13 +1215,13 @@ void sub_0801AE44(bool32 loadGfx) {
void SetMultipleTiles(const TileData* tileData, u32 basePosition, u32 layer) {
while (tileData->tile != -1) {
SetTile((u16)tileData->tile, basePosition + tileData->position, layer);
SetBottomTile((u16)tileData->tile, basePosition + tileData->position, layer);
tileData++;
}
}
// Add a new entry at the end of gUnk_0200B240
void sub_0801AF48(u32 data, u32 position, u32 layer) {
void RegisterInteractTile(u32 data, u32 position, u32 layer) {
u32 index;
if ((data < 0x4000) && (gRoomTransition.field30 == 0)) {
index = gRoomVars.tileEntityCount;
@ -1233,7 +1233,7 @@ void sub_0801AF48(u32 data, u32 position, u32 layer) {
}
}
void DeleteLoadedTileEntity(u32 position, s32 layer) {
void UnregisterInteractTile(u32 position, s32 layer) {
u32 count;
struct_0200B240* ptr;
u32 positionLayer;
@ -1289,7 +1289,7 @@ void sub_0801AFE4(void) {
for (x = 0; x < width; x++) {
for (ptr = gUnk_080B44D0; ptr->collision != 0; ptr++) {
if (ptr->collision == *collisionData) {
SetTile(ptr->tileIndex, y * 0x40 + x, 1);
SetBottomTile(ptr->tileIndex, y * 0x40 + x, 1);
break;
}
}

View File

@ -167,7 +167,7 @@ u32 sub_0804A044(Entity* entA, Entity* entB, u32 arg2) {
//! @bug flags & 5 can never equal 0xA
if (flags && ((flags & 5) != 0xA)) {
layer = GetLayerByIndex(entA->collisionLayer);
layer = GetTileBuffer(entA->collisionLayer);
if (xDiff < 0) {
xDiff = -xDiff;
}

View File

@ -403,11 +403,11 @@ void sub_080307D4(ArmosEntity* this) {
void sub_080307EC(ArmosEntity* this) {
u32 position = COORD_TO_TILE(super);
this->unk_78 = GetTileIndex(position, super->collisionLayer);
SetTile(0x4022, position, (u32)super->collisionLayer);
SetBottomTile(0x4022, position, (u32)super->collisionLayer);
}
void sub_08030834(ArmosEntity* this) {
SetTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer);
}
bool32 sub_0803086C(ArmosEntity* this) {
@ -435,11 +435,11 @@ bool32 sub_0803086C(ArmosEntity* this) {
return TRUE;
}
} else {
SetTile(0x4022, pos, super->collisionLayer);
SetBottomTile(0x4022, pos, super->collisionLayer);
}
} else {
if (CheckPlayerInRegion(centerX, centerY + 6, 2, 5) != 0) {
SetTile(0x4049, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(0x4049, COORD_TO_TILE(super), super->collisionLayer);
}
}
}

View File

@ -442,7 +442,7 @@ void sub_08028FFC(BusinessScrubEntity* this) {
super->x.HALF.HI = this->unk_78;
super->y.HALF.HI = this->unk_7a;
InitializeAnimation(super, 0);
SetTile(0x4022, this->unk_76, super->collisionLayer);
SetBottomTile(0x4022, this->unk_76, super->collisionLayer);
}
void sub_08029078(BusinessScrubEntity* this) {
@ -456,7 +456,7 @@ void sub_08029078(BusinessScrubEntity* this) {
super->spriteIndex = 0xd0;
sub_08028FDC(this);
sub_080290E0(this, 1);
SetTile(this->unk_74, this->unk_76, super->collisionLayer);
SetBottomTile(this->unk_74, this->unk_76, super->collisionLayer);
}
}

View File

@ -34,7 +34,7 @@ void sub_0801FAF8(ChuchuEntity* this);
void sub_0801FB14(ChuchuEntity* this);
void sub_0801FB34(ChuchuEntity* this);
void sub_0801FB68(ChuchuEntity* this);
u32 sub_0801FBD0(ChuchuEntity* this);
u32 CheckWaterTile(ChuchuEntity* this);
void Chuchu_JumpAtPlayer(ChuchuEntity* this);
extern void (*const Chuchu_Functions[])(ChuchuEntity*);
@ -72,7 +72,7 @@ void Chuchu(ChuchuEntity* this) {
/* ... */
break;
case 2:
sub_080043A8(super);
CreateDrownFX(super);
return;
}
}
@ -196,7 +196,7 @@ void sub_0801F0C8(ChuchuEntity* this) {
}
void sub_0801F12C(ChuchuEntity* this) {
if (sub_0801FBD0(this)) {
if (CheckWaterTile(this)) {
sub_0801F328(this);
} else {
if ((super->subtimer++ & 7) == 0) {
@ -232,7 +232,7 @@ void sub_0801F1B0(ChuchuEntity* this) {
}
if (super->frame & ANIM_DONE) {
if (sub_0801FBD0(this)) {
if (CheckWaterTile(this)) {
sub_0801F328(this);
} else {
sub_0801F340(this);
@ -261,7 +261,7 @@ void sub_0801F270(ChuchuEntity* this) {
ProcessMovement5(super);
GetNextFrame(super);
if (sub_0801FBD0(this))
if (CheckWaterTile(this))
return;
if (--super->timer != 0)
@ -390,7 +390,7 @@ void sub_0801F4EC(ChuchuEntity* this) {
}
void sub_0801F508(ChuchuEntity* this) {
if (sub_0801FBD0(this)) {
if (CheckWaterTile(this)) {
this->unk_83 = 0;
sub_0801F730(this);
} else {
@ -429,7 +429,7 @@ void sub_0801F584(ChuchuEntity* this) {
}
if (super->frame & ANIM_DONE) {
if (sub_0801FBD0(this)) {
if (CheckWaterTile(this)) {
this->unk_83 = 0;
sub_0801F730(this);
} else {
@ -464,7 +464,7 @@ void sub_0801F688(ChuchuEntity* this) {
if (this->unk_83)
this->unk_83--;
if (sub_0801FBD0(this) || this->unk_83) {
if (CheckWaterTile(this) || this->unk_83) {
super->direction = sub_08049F84(super, 1);
ProcessMovement5(super);
GetNextFrame(super);
@ -572,7 +572,7 @@ void sub_0801F884(ChuchuEntity* this) {
}
void sub_0801F8C0(ChuchuEntity* this) {
if (sub_0801FBD0(this)) {
if (CheckWaterTile(this)) {
sub_0801FAE0(this);
} else if (sub_08049FDC(super, 1) == 0) {
sub_0801F730(this);
@ -605,7 +605,7 @@ void sub_0801F940(ChuchuEntity* this) {
}
if (super->frame & ANIM_DONE) {
if (sub_0801FBD0(this)) {
if (CheckWaterTile(this)) {
sub_0801FAE0(this);
} else {
super->action = 6;
@ -635,7 +635,7 @@ void sub_0801F9E0(ChuchuEntity* this) {
}
void sub_0801FA30(ChuchuEntity* this) {
if (sub_0801FBD0(this)) {
if (CheckWaterTile(this)) {
super->direction = sub_08049F84(super, 1);
ProcessMovement5(super);
GetNextFrame(super);
@ -714,7 +714,7 @@ void sub_0801FB68(ChuchuEntity* this) {
super->zVelocity = 0;
}
u32 sub_0801FBD0(ChuchuEntity* this) {
u32 CheckWaterTile(ChuchuEntity* this) {
if (GetActTile(super) == 0x10) {
return 1;
} else {

View File

@ -561,7 +561,7 @@ void sub_080262A8(ChuchuBossEntity* this) {
gPlayerEntity.base.animationState = 0;
gRoomControls.camera_target = super;
gRoomControls.scrollSpeed = 1;
SetTile(0x4022, 0x2c8, 1);
SetBottomTile(0x4022, 0x2c8, 1);
}
}

View File

@ -48,7 +48,7 @@ void DoorMimic_OnCollision(DoorMimicEntity* this) {
}
void DoorMimic_OnDeath(DoorMimicEntity* this) {
SetTile(this->unk_7c, this->unk_7e, super->collisionLayer);
SetBottomTile(this->unk_7c, this->unk_7e, super->collisionLayer);
CreateFx(super, FX_POT_SHATTER, 0);
EnemyDisableRespawn(super);
DeleteThisEntity();
@ -125,7 +125,7 @@ void sub_080221C0(DoorMimicEntity* this) {
u32 tile = COORD_TO_TILE(super) + gUnk_080B4488[super->type2];
this->unk_7e = tile;
this->unk_7c = GetTileIndex(tile, super->collisionLayer);
SetTile(gUnk_080CB79C[super->type2], tile, super->collisionLayer);
SetBottomTile(gUnk_080CB79C[super->type2], tile, super->collisionLayer);
}
// clang-format off

View File

@ -85,10 +85,10 @@ void Enemy64_Init(Enemy64Entity* this) {
Entity* tail;
if (CheckFlags(0x7c)) {
SetTile(0x4081, 10, 2);
SetTile(0x4081, 0x4a, 2);
SetTile(0x4081, 0x8a, 2);
SetTile(0x4081, 0xca, 2);
SetBottomTile(0x4081, 10, 2);
SetBottomTile(0x4081, 0x4a, 2);
SetBottomTile(0x4081, 0x8a, 2);
SetBottomTile(0x4081, 0xca, 2);
DeleteThisEntity();
} else {
sub_0807B7D8(0x323, 10, 1);
@ -440,19 +440,19 @@ void Enemy64_Action4_SubAction7(Enemy64Entity* this) {
DeleteThisEntity();
} else if (super->timer == 16) {
sub_0807B7D8(0x36, 0xca, 1);
SetTile(0x4081, 0xca, 2);
SetBottomTile(0x4081, 0xca, 2);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 24) {
sub_0807B7D8(0x36, 0x8a, 1);
SetTile(0x4081, 0x8a, 2);
SetBottomTile(0x4081, 0x8a, 2);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 32) {
sub_0807B7D8(0x36, 0x4a, 1);
SetTile(0x4081, 0x4a, 2);
SetBottomTile(0x4081, 0x4a, 2);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 40) {
sub_0807B7D8(0x36, 10, 1);
SetTile(0x4081, 10, 2);
SetBottomTile(0x4081, 10, 2);
SoundReq(SFX_HEART_GET);
}
}

View File

@ -335,18 +335,18 @@ void sub_08030F00(EyegoreEntity* this) {
this->unk_84 = tileIndex;
tileIndex = GetTileIndex(position + 0x41, super->collisionLayer);
this->unk_86 = tileIndex;
SetTile(0x4022, position, super->collisionLayer);
SetTile(0x4022, position + 1, super->collisionLayer);
SetTile(0x4022, position + 0x40, super->collisionLayer);
SetTile(0x4022, position + 0x41, super->collisionLayer);
SetBottomTile(0x4022, position, super->collisionLayer);
SetBottomTile(0x4022, position + 1, super->collisionLayer);
SetBottomTile(0x4022, position + 0x40, super->collisionLayer);
SetBottomTile(0x4022, position + 0x41, super->collisionLayer);
}
void sub_08030FB4(EyegoreEntity* this) {
u32 position = COORD_TO_TILE_OFFSET(super, 8, 0x14);
SetTile(this->unk_80, position, super->collisionLayer);
SetTile(this->unk_82, position + 1, super->collisionLayer);
SetTile(this->unk_84, position + 0x40, super->collisionLayer);
SetTile(this->unk_86, position + 0x41, super->collisionLayer);
SetBottomTile(this->unk_80, position, super->collisionLayer);
SetBottomTile(this->unk_82, position + 1, super->collisionLayer);
SetBottomTile(this->unk_84, position + 0x40, super->collisionLayer);
SetBottomTile(this->unk_86, position + 0x41, super->collisionLayer);
}
void sub_08031024(EyegoreEntity* this) {
@ -439,8 +439,8 @@ void sub_08031024(EyegoreEntity* this) {
void sub_08031250(EyegoreEntity* this) {
u32 tmp2;
u32 tmp = (u32)super->animationState * 4;
sub_08008796(super, 9, super->x.HALF.HI + gUnk_080CE2C0[tmp], super->y.HALF.HI + gUnk_080CE2C0[tmp + 1]);
sub_08008796(super, 9, super->x.HALF.HI + gUnk_080CE2C0[tmp + 2], super->y.HALF.HI + gUnk_080CE2C0[tmp + 3]);
DoTileInteraction(super, 9, super->x.HALF.HI + gUnk_080CE2C0[tmp], super->y.HALF.HI + gUnk_080CE2C0[tmp + 1]);
DoTileInteraction(super, 9, super->x.HALF.HI + gUnk_080CE2C0[tmp + 2], super->y.HALF.HI + gUnk_080CE2C0[tmp + 3]);
if (this->unk_79 != 0) {
tmp2 = 0;
if ((super->x.HALF.HI - (u32)this->unk_74) + 2 < 5) {

View File

@ -99,7 +99,7 @@ void FlyingPot_OnCollision(FlyingPotEntity* this) {
super->zVelocity = Q_16_16(2.625);
super->spritePriority.b1 = 1;
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
} else if (super->z.HALF.HI != 0) {
sub_08037408(this);
}
@ -145,7 +145,7 @@ void FlyingPot_SubAction2(FlyingPotEntity* this) {
COLLISION_OFF(super);
super->spriteOffsetX = 0;
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
if (sub_0806F520(super)) {
@ -177,7 +177,7 @@ void FlyingPot_Init(FlyingPotEntity* this) {
tile = TILE(super->x.HALF.HI, super->y.HALF.HI);
this->tileIndex = GetTileIndex(tile, super->collisionLayer);
SetTile(0x4000, tile, super->collisionLayer);
SetBottomTile(0x4000, tile, super->collisionLayer);
InitializeAnimation(super, 5);
}
@ -185,7 +185,7 @@ void FlyingPot_Action1(FlyingPotEntity* this) {
sub_08037418(this);
if (GetTileTypeByEntity(super) != 0x4000) {
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
sub_08037408(this);
}
@ -210,7 +210,7 @@ void FlyingPot_Action2(FlyingPotEntity* this) {
super->flags2 = 0xF;
super->hitbox = &gUnk_080FD34C;
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetBottomTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
}
@ -257,7 +257,7 @@ void sub_08037418(FlyingPotEntity* this) {
u32 tile = COORD_TO_TILE(super);
if (GetTileIndex(tile, super->collisionLayer) == 0x4067) {
SetTile(this->tileIndex, tile, super->collisionLayer);
SetBottomTile(this->tileIndex, tile, super->collisionLayer);
DeleteThisEntity();
}
}

View File

@ -50,7 +50,7 @@ void FlyingSkull_OnCollision(FlyingSkullEntity* this) {
COLLISION_OFF(super);
super->zVelocity = Q_16_16(2.625);
super->spritePriority.b1 = 1;
SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
} else if (super->z.HALF.HI) {
sub_0803A0E0(this);
}
@ -89,7 +89,7 @@ void sub_08039CE0(FlyingSkullEntity* this) {
super->timer = 1;
super->z.HALF.HI = -1;
super->spriteOffsetX = 0;
SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
}
if (sub_0806F520(super)) {
@ -121,7 +121,7 @@ void sub_08039D74(FlyingSkullEntity* this) {
tmp = COORD_TO_TILE(super);
this->unk_0x74 = GetTileIndex(tmp, super->collisionLayer);
SetTile(0x4060, tmp, super->collisionLayer);
SetBottomTile(0x4060, tmp, super->collisionLayer);
InitializeAnimation(super, 0);
}
@ -130,7 +130,7 @@ void sub_08039DD8(FlyingSkullEntity* this) {
if (super->type == 0) {
if (GetTileTypeByEntity(super) == 0x4073) {
SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
sub_0803A0E0(this);
}
@ -147,7 +147,7 @@ void sub_08039DD8(FlyingSkullEntity* this) {
if (player != NULL) {
player->type2 = 1;
CopyPosition(super, player);
SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
DeleteEntity(super);
}
}
@ -167,7 +167,7 @@ void sub_08039EE4(FlyingSkullEntity* this) {
super->hitbox = (Hitbox*)&gUnk_080FD340;
gPlayerEntity.base.animationState;
this->unk_0x76 = gPlayerEntity.base.animationState;
SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
}
void sub_08039F4C(FlyingSkullEntity* this) {
@ -200,7 +200,7 @@ void sub_08039FAC(FlyingSkullEntity* this) {
super->hitType = 0xa0;
super->flags2 = 0xf;
super->hitbox = (Hitbox*)&gUnk_080FD34C;
SetTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(this->unk_0x74, COORD_TO_TILE(super), super->collisionLayer);
}
}
@ -249,7 +249,7 @@ void sub_0803A0E0(FlyingSkullEntity* this) {
void sub_0803A100(FlyingSkullEntity* this) {
u32 tile = COORD_TO_TILE(super);
if (GetTileIndex(tile, super->collisionLayer) == 0x4067) {
SetTile(this->unk_0x74, tile, super->collisionLayer);
SetBottomTile(this->unk_0x74, tile, super->collisionLayer);
DeleteThisEntity();
}
}

View File

@ -250,7 +250,7 @@ void sub_080464C0(GyorgFemaleEntity* this) {
void sub_08046518(void) {
u16* ptr = gMapTop.metatileTypes;
u16* sl = &gMapTop.mapData[sub_08046518_offset];
u16* stack1 = &gMapTop.mapDataClone[sub_08046518_offset];
u16* stack1 = &gMapTop.mapDataOriginal[sub_08046518_offset];
u8* stack2 = &gMapTop.unkData3[sub_08046518_offset];
u8* r6 = &gMapTop.collisionData[sub_08046518_offset];
u32 i;

View File

@ -373,8 +373,8 @@ void sub_0802C1C0(HelmasaurEntity* this) {
void sub_0802C1CC(HelmasaurEntity* this) {
const s8* ptr = &gUnk_080CD464[super->animationState << 2];
sub_08008796(super, 9, super->x.HALF.HI + ptr[0], super->y.HALF.HI + ptr[1]);
sub_08008796(super, 9, super->x.HALF.HI + ptr[2], super->y.HALF.HI + ptr[3]);
DoTileInteraction(super, 9, super->x.HALF.HI + ptr[0], super->y.HALF.HI + ptr[1]);
DoTileInteraction(super, 9, super->x.HALF.HI + ptr[2], super->y.HALF.HI + ptr[3]);
}
void sub_0802C218(HelmasaurEntity* this) {

View File

@ -167,7 +167,8 @@ void MazaalBracelet_OnCollision(MazaalBraceletEntity* this) {
if (super->type < 2) {
if (super->action != 0x2b) {
if ((0 < super->iframes) && ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x15) || (super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe))))) {
if ((0 < super->iframes) && ((super->contactFlags == (CONTACT_TAKE_DAMAGE | 0x15) ||
(super->contactFlags == (CONTACT_TAKE_DAMAGE | 0xe))))) {
super->action = 0x28;
COLLISION_OFF(super);
entity = (MazaalBraceletEntity*)super->parent;

View File

@ -96,7 +96,7 @@ void sub_08034CC4(MazaalMacroEntity* this) {
this->unk_78 = 0x4b0;
sub_08034F70(this);
InitializeAnimation(super, super->type);
SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
entity = CreateEnemy(MAZAAL_MACRO, 2);
if (entity != NULL) {
super->child = entity;

View File

@ -117,7 +117,7 @@ void sub_08037E14(Entity* this) {
s32 x, y;
this->timer = 8;
dir = (GetFacingDirection(this, &gPlayerEntity.base) + 4) & 0x18;
layer = (u8*)GetLayerByIndex(this->collisionLayer)->collisionData;
layer = (u8*)GetTileBuffer(this->collisionLayer)->collisionData;
ptr = gUnk_080CF498 + (dir >> 2);
x = this->x.HALF.HI + *ptr;
y = this->y.HALF.HI + *(ptr + 1);

View File

@ -446,7 +446,8 @@ void sub_080244E8(PestoEntity* this) {
super->timer = 12;
this->unk_83 &= ~0x80;
entity = super->child;
SetTile(((PestoEntity*)entity)->unk_70, COORD_TO_TILE(entity), entity->collisionLayer);
SetBottomTile(((PestoEntity*)entity)->unk_70, COORD_TO_TILE(entity),
entity->collisionLayer);
DeleteEntity(entity);
super->z.HALF.HI -= 0xe;
this->unk_78 -= 0xe;

View File

@ -276,7 +276,7 @@ bool32 Rollobite_TryToHoleUp(RollobiteEntity* this) {
super->y.HALF.HI += 13;
super->zVelocity = Q_16_16(2.0);
InitializeAnimation(super, super->animationState + 0x14);
SetTile(0x4034, tile, super->collisionLayer);
SetBottomTile(0x4034, tile, super->collisionLayer);
return TRUE;
}
}

View File

@ -40,7 +40,7 @@ void RupeeLike(RupeeLikeEntity* this) {
u32 uVar1;
if (super->type2 == 0) {
uVar1 = (u8)sub_080043E8(super);
uVar1 = (u8)GetTileHazardType(super);
if (uVar1 != 0) {
if (super->action == 4) {
sub_080296D8(this);

View File

@ -94,7 +94,7 @@ void SpinyBeetle_Init(SpinyBeetleEntity* this) {
this->unk_7b = 0;
this->tile = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tile, super->collisionLayer);
SetTile(0x4022, this->tile, super->collisionLayer);
SetBottomTile(0x4022, this->tile, super->collisionLayer);
obj = CreateObject(OBJECT_ON_BEETLE, super->type, 0);
if (obj == NULL) {
@ -259,7 +259,7 @@ void sub_08033B44(SpinyBeetleEntity* this) {
}
}
SetTile(0x4022, this->tile, super->collisionLayer);
SetBottomTile(0x4022, this->tile, super->collisionLayer);
InitializeAnimation(super, 0);
}

View File

@ -437,7 +437,7 @@ void sub_08039AD4(StalfosEntity* this) {
super->action = 0xb;
super->child = projectile;
InitAnimationForceUpdate(super, super->animationState + 0x18);
SetTile(0x4067, position, super->collisionLayer);
SetBottomTile(0x4067, position, super->collisionLayer);
return;
}
}

View File

@ -285,6 +285,6 @@ void sub_0803E4D8(VaatiProjectileEntity* this) {
tile = TILE(super->x.HALF.HI, super->y.HALF.HI + 8);
if (sub_080B1B44(tile, gPlayerEntity.base.collisionLayer) != 0xff) {
SetTile(0x4074, tile, gPlayerEntity.base.collisionLayer);
SetBottomTile(0x4074, tile, gPlayerEntity.base.collisionLayer);
}
}

View File

@ -26,7 +26,7 @@ void WizzrobeFire_OnCollision(WizzrobeEntity* this) {
}
EnemyFunctionHandlerAfterCollision(super, WizzrobeFire_Functions);
if (super->health == 0) {
SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
}
}
@ -111,7 +111,7 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) {
super->timer = 40;
super->subtimer = 0;
super->flags &= ~0x80;
SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
EnqueueSFX(SFX_156);
InitializeAnimation(super, super->direction >> 3);
}

View File

@ -35,7 +35,7 @@ void WizzrobeIce_OnCollision(WizzrobeEntity* this) {
}
}
if (super->health == 0) {
SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
}
}
@ -118,7 +118,7 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) {
super->timer = 40;
super->subtimer = 0;
super->flags &= ~0x80;
SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
EnqueueSFX(SFX_156);
InitializeAnimation(super, super->direction >> 3);
}

View File

@ -42,7 +42,7 @@ void WizzrobeWind_OnCollision(WizzrobeEntity* this) {
}
}
if (super->health == 0) {
SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
}
}
@ -135,7 +135,7 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) {
super->subtimer = 0;
super->flags &= ~0x80;
EnqueueSFX(SFX_156);
SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
InitializeAnimation(super, super->direction >> 3);
}
break;
@ -208,7 +208,7 @@ void sub_0802F888(WizzrobeEntity* this) {
super->direction = (sub_08049F84(super, 3) + 4) & 0x18;
this->tilePosition = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tilePosition, super->collisionLayer);
SetTile(0x4071, this->tilePosition, super->collisionLayer);
SetBottomTile(0x4071, this->tilePosition, super->collisionLayer);
}
void sub_0802F8E4(WizzrobeEntity* this) {

View File

@ -219,8 +219,8 @@ void PlayerUpdate(PlayerEntity* this) {
}
HandlePlayerLife(super);
DoPlayerAction(this);
if ((super->z.WORD == 0) && (super->action == 1 || super->action == 9))
sub_08008790(super, 8);
if ((super->z.WORD == 0) && (super->action == PLAYER_NORMAL || super->action == PLAYER_MINISH))
DoTileInteractionHere(super, 8);
sub_080171F0();
}
sub_08078FB0(super);

View File

@ -6,7 +6,7 @@
#include "object.h"
s32 sub_080774A0(void);
extern s32 sub_0800875A(Entity*, u32, ItemBehavior*);
extern s32 DoItemTileInteraction(Entity*, u32, ItemBehavior*);
extern void UpdatePlayerMovement(void);
extern bool32 sub_0807B5B0(Entity*);
void sub_08077130(ItemBehavior*, u32);
@ -70,7 +70,7 @@ void sub_080771C8(ItemBehavior* this, u32 index) {
CreateObjectWithParent(&gPlayerEntity.base, MOLE_MITTS_PARTICLE, this->playerFrame, 1);
}
if ((this->playerFrame & 0x10) != 0) {
if (sub_0800875A(&gPlayerEntity.base, 0xd, this) == 0) {
if (DoItemTileInteraction(&gPlayerEntity.base, 0xd, this) == 0) {
SetItemAnim(this, ANIM_MOLEMITTS_MISS);
this->stateID = 3;
SoundReq(SFX_ITEM_GLOVES_AIR);

View File

@ -14,7 +14,7 @@ void sub_08076518(ItemBehavior*, u32);
void sub_080765E0(ItemBehavior*, u32);
void sub_0807660C(ItemBehavior*, u32);
extern s32 sub_0800875A(Entity*, u32, ItemBehavior*);
extern s32 DoItemTileInteraction(Entity*, u32, ItemBehavior*);
extern const u16 gUnk_0811BE38[];
extern const u16 gUnk_0811BE40[];
@ -168,7 +168,7 @@ void sub_080762D8(ItemBehavior* this, u32 index) {
if (!gPlayerState.jump_status) {
if (gPlayerState.heldObject == 1 && sub_0800875A(&gPlayerEntity.base, 6, this) != 0) {
if (gPlayerState.heldObject == 1 && DoItemTileInteraction(&gPlayerEntity.base, 6, this) != 0) {
sub_08076088(this, NULL, index);
return;
} else if (gUnk_0811BE38[gPlayerEntity.base.animationState >> 1] & gPlayerState.playerInput.heldInput) {

View File

@ -53,9 +53,9 @@ void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager* this) {
tile = 0x81 << 7; // 0x4080
for (entrance = GetDiggingCaveEntranceForRoom(entrance, room); entrance != 0;
entrance = GetDiggingCaveEntranceForRoom(entrance, room)) {
SetTile(tile, entrance->sourceTilePosition + TILE_POS(-1, 1), 1);
SetTile(tile, entrance->sourceTilePosition + TILE_POS(0, 1), 1);
SetTile(tile, entrance->sourceTilePosition + TILE_POS(1, 1), 1);
SetBottomTile(tile, entrance->sourceTilePosition + TILE_POS(-1, 1), 1);
SetBottomTile(tile, entrance->sourceTilePosition + TILE_POS(0, 1), 1);
SetBottomTile(tile, entrance->sourceTilePosition + TILE_POS(1, 1), 1);
entrance++;
}
}

View File

@ -16,7 +16,7 @@ void FlameManager_Main(FlameManager* this) {
this->field_0x38 = TILE(this->field_0x38, this->field_0x3a);
if (GetTileType(this->field_0x38, 2) == 0x75) {
super->action = 1;
SetTile(0x406a, this->field_0x38, 1);
SetBottomTile(0x406a, this->field_0x38, 1);
} else {
DeleteThisEntity();
}
@ -26,7 +26,7 @@ void FlameManager_Main(FlameManager* this) {
DeleteThisEntity();
}
if (GetTileType(this->field_0x38, 2) == 0x76) {
SetTile(0x406b, this->field_0x38, 1);
SetBottomTile(0x406b, this->field_0x38, 1);
DeleteThisEntity();
}
}

View File

@ -33,7 +33,7 @@ void sub_0805CBD0(Manager29* this) {
this->unk_38 = (this->unk_38 >> 4 & 0x3fU) | (((this->unk_3a << 0x10) >> 0x14 & 0x3fU) << 6);
this->unk_3a = (this->unk_3c >> 4 & 0x3f) | (((this->unk_36 + this->unk_37 * 0x100) >> 4 & 0x3fU) << 6);
this->unk_3c = GetTileType(this->unk_38, this->unk_34);
layer = GetLayerByIndex(this->unk_34);
layer = GetTileBuffer(this->unk_34);
this->unk_28 = (u16*)layer->metatileTypes;
this->unk_2c = &layer->mapData[(s16)this->unk_3a];
}

View File

@ -31,7 +31,7 @@ void TileChangeObserveManager_Init(TileChangeObserveManager* this) {
DeleteThisEntity();
} else {
super->action = 1;
tile = &GetLayerByIndex(this->field_0x3a)->mapData[this->tilePosition];
tile = &GetTileBuffer(this->field_0x3a)->mapData[this->tilePosition];
this->observedTile = tile;
this->initialTile = tile[0];
}

View File

@ -10,7 +10,7 @@
#include "functions.h"
void WaterfallBottomManager_Main(WaterfallBottomManager* this) {
SetTile(0x4014, 0x5c3, 1);
SetBottomTile(0x4014, 0x5c3, 1);
if ((gRoomControls.origin_y + 200 < gPlayerEntity.base.y.HALF.HI) &&
((u32)(gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x) - 0x30 < 0x11)) {
gPlayerEntity.base.collisionLayer = 3;

View File

@ -1612,7 +1612,7 @@ void CalculateEntityTileCollisions(Entity* this, u32 direction, u32 collisionTyp
u32 hitboxUnkX;
u32 hitboxUnkY;
layer = GetLayerByIndex(this->collisionLayer)->collisionData;
layer = GetTileBuffer(this->collisionLayer)->collisionData;
hb = this->hitbox;
xMin = this->x.HALF.HI + hb->offset_x;
yMin = this->y.HALF.HI + hb->offset_y;

View File

@ -78,20 +78,20 @@ void sub_08067418(CastorWildsStatueEntity* this) {
this->tilePos = COORD_TO_TILE(super);
if (super->type == 0) {
super->hitbox = (Hitbox*)&gUnk_08110E94;
SetTile(0x4022, this->tilePos - 1, super->collisionLayer);
SetTile(0x4022, this->tilePos, super->collisionLayer);
SetTile(0x4022, this->tilePos + 0x3f, super->collisionLayer);
SetTile(0x4022, this->tilePos + 0x40, super->collisionLayer);
SetBottomTile(0x4022, this->tilePos - 1, super->collisionLayer);
SetBottomTile(0x4022, this->tilePos, super->collisionLayer);
SetBottomTile(0x4022, this->tilePos + 0x3f, super->collisionLayer);
SetBottomTile(0x4022, this->tilePos + 0x40, super->collisionLayer);
} else {
super->collisionLayer = 3;
super->spriteOrientation.flipY = 1;
super->spriteRendering.b3 = 1;
super->spritePriority.b0 = 2;
if (CheckLocalFlag(HIKYOU_00_SEKIZOU) == 0) {
SetTile(0x4022, 0xe81, 1);
SetTile(0x4022, 0xe82, 1);
SetTile(0x4022, 0xe83, 1);
SetTile(0x4022, 0xec3, 1);
SetBottomTile(0x4022, 0xe81, 1);
SetBottomTile(0x4022, 0xe82, 1);
SetBottomTile(0x4022, 0xe83, 1);
SetBottomTile(0x4022, 0xec3, 1);
}
}
InitScriptForNPC(super);

View File

@ -36,12 +36,12 @@ void sub_0806DD90(Entity* this) {
InitializeAnimation(this, animIndex);
x = this->x.HALF.HI;
y = this->y.HALF.HI;
SetTile(0x4072, TILE(x - 0x18, y - 0x10), this->collisionLayer);
SetTile(0x4072, TILE(x - 0x18, y), this->collisionLayer);
SetTile(0x4072, TILE(x - 0x18, y + 0x10), this->collisionLayer);
SetTile(0x4072, TILE(x + 0x18, y - 0x10), this->collisionLayer);
SetTile(0x4072, TILE(x + 0x18, y), this->collisionLayer);
SetTile(0x4072, TILE(x + 0x18, y + 0x10), this->collisionLayer);
SetBottomTile(0x4072, TILE(x - 0x18, y - 0x10), this->collisionLayer);
SetBottomTile(0x4072, TILE(x - 0x18, y), this->collisionLayer);
SetBottomTile(0x4072, TILE(x - 0x18, y + 0x10), this->collisionLayer);
SetBottomTile(0x4072, TILE(x + 0x18, y - 0x10), this->collisionLayer);
SetBottomTile(0x4072, TILE(x + 0x18, y), this->collisionLayer);
SetBottomTile(0x4072, TILE(x + 0x18, y + 0x10), this->collisionLayer);
}
void sub_0806DEC8(Entity* this) {

View File

@ -235,7 +235,7 @@ void sub_08069B44(DogEntity* this) {
super->action = 4;
}
if ((super->type == 2) && (CheckLocalFlag(MACHI_02_DOG) == 0)) {
SetTile(0x4072, TILE(super->x.HALF.HI, super->y.HALF.HI - 8), super->collisionLayer);
SetBottomTile(0x4072, TILE(super->x.HALF.HI, super->y.HALF.HI - 8), super->collisionLayer);
}
}
}

View File

@ -586,12 +586,12 @@ void sub_080626E0(Entity* this, ScriptExecutionContext* context) {
}
void sub_08062788(Entity* this, ScriptExecutionContext* context) {
SetTile(0x4072, 0x60b, 1);
SetTile(0x4072, 0x60c, 1);
SetTile(0x4072, 0x60d, 1);
SetTile(0x4072, 0x64b, 1);
SetTile(0x4072, 0x64c, 1);
SetTile(0x4072, 0x64d, 1);
SetBottomTile(0x4072, 0x60b, 1);
SetBottomTile(0x4072, 0x60c, 1);
SetBottomTile(0x4072, 0x60d, 1);
SetBottomTile(0x4072, 0x64b, 1);
SetBottomTile(0x4072, 0x64c, 1);
SetBottomTile(0x4072, 0x64d, 1);
}
void sub_080627E8(Entity* this, ScriptExecutionContext* context) {

View File

@ -68,7 +68,7 @@ u32 PointInsideRadius(s32, s32, s32);
u32 sub_080611D4(Entity*);
extern u32 sub_08079FD4(Entity*, u32);
extern void sub_08016AD2(Entity*);
extern void UpdateCollisionLayer(Entity*);
bool32 sub_08061630(NPC5Entity*, s32, s32, s32);
bool32 sub_08061720(NPC5Entity*, s32, s32, s32);
@ -471,7 +471,7 @@ bool32 sub_08061170(NPC5Entity* this) {
}
return FALSE;
} else {
sub_08016AD2(super);
UpdateCollisionLayer(super);
return TRUE;
}
}
@ -501,7 +501,7 @@ u32 sub_080611D4(Entity* this) {
ptr = (s8*)gUnk_0810AC4C;
a = ptr[x];
b = ptr[x + 1];
uVar2 = GetRelativeCollisionTile(this, a, b);
uVar2 = GetActTileRelative(this, a, b);
ptr2 = gUnk_0810AC54;
do {

View File

@ -29,7 +29,7 @@ void AngryStatue(Entity* this) {
void AngryStatue_Init(Entity* this) {
this->action = 1;
this->hitbox = (Hitbox*)&gUnk_080FD178;
SetTile(0x4022, COORD_TO_TILE(this), this->collisionLayer);
SetBottomTile(0x4022, COORD_TO_TILE(this), this->collisionLayer);
InitializeAnimation(this, this->type);
}

View File

@ -107,12 +107,12 @@ void sub_0809CDF0(BakerOvenEntity* this) {
(((super->y.HALF.HI - gRoomControls.origin_y) >> 4 & 0x3f) << 6);
y = this->unk_80;
SetTile(0x402e, y - 0x01, super->collisionLayer);
SetTile(0x4022, y - 0x00, super->collisionLayer);
SetTile(0x4022, y + 0x01, super->collisionLayer);
SetTile(0x4026, y - 0x41, super->collisionLayer);
SetTile(0x4026, y - 0x40, super->collisionLayer);
SetTile(0x4024, y - 0x3f, super->collisionLayer);
SetTile(0x4026, y - 0x81, super->collisionLayer);
SetTile(0x4026, y - 0x80, super->collisionLayer);
SetBottomTile(0x402e, y - 0x01, super->collisionLayer);
SetBottomTile(0x4022, y - 0x00, super->collisionLayer);
SetBottomTile(0x4022, y + 0x01, super->collisionLayer);
SetBottomTile(0x4026, y - 0x41, super->collisionLayer);
SetBottomTile(0x4026, y - 0x40, super->collisionLayer);
SetBottomTile(0x4024, y - 0x3f, super->collisionLayer);
SetBottomTile(0x4026, y - 0x81, super->collisionLayer);
SetBottomTile(0x4026, y - 0x80, super->collisionLayer);
}

View File

@ -257,8 +257,8 @@ void Beanstalk_Action1Type7(BeanstalkEntity* this) {
this->unk_70 = TILE(super->x.HALF.HI, this->unk_6c);
while (TRUE) {
this->unk_70 = TILE(super->x.HALF.HI, this->unk_6c);
SetTile(0x4017, this->unk_70, 2);
SetTile(0x4017, this->unk_70, 1);
SetBottomTile(0x4017, this->unk_70, 2);
SetBottomTile(0x4017, this->unk_70, 1);
this->unk_6c += 0x10;
if (this->unk_6c >= gRoomControls.origin_y + gRoomControls.height)
break;
@ -307,7 +307,7 @@ void Beanstalk_Action1Type8SubAction0(BeanstalkEntity* this) {
super->spriteOrientation.flipY = 2;
this->unk_70 = COORD_TO_TILE(super);
SetTile(0x4017, this->unk_70, 1);
SetBottomTile(0x4017, this->unk_70, 1);
super->subAction = 1;
obj = CreateObjectWithParent(super, CHUCHU_BOSS_PARTICLE, 0, 0);
if (obj != NULL) {
@ -339,12 +339,12 @@ void Beanstalk_Action1Type9(BeanstalkEntity* this) {
if (gPlayerState.floor_type == SURFACE_LADDER) {
super->spritePriority.b0 = 0;
if (sub_080B1A0C(super, 0, -0x18) != 0x4014) {
SetTile(0x4014, COORD_TO_TILE_OFFSET(super, 0, 0x18), 1);
SetBottomTile(0x4014, COORD_TO_TILE_OFFSET(super, 0, 0x18), 1);
}
} else {
super->spritePriority.b0 = 5;
if (this->unk_72 != sub_080B1A0C(super, 0, -0x18)) {
SetTile(this->unk_72, COORD_TO_TILE_OFFSET(super, 0, 0x18), 1);
SetBottomTile(this->unk_72, COORD_TO_TILE_OFFSET(super, 0, 0x18), 1);
}
}
}

View File

@ -137,10 +137,10 @@ void sub_08099910(BigIceBlockEntity* this) {
switch (uVar2) {
default:
SetTile(0x4022, position - 0x41, super->collisionLayer);
SetTile(0x4022, position - 0x40, super->collisionLayer);
SetTile(0x4022, position - 1, super->collisionLayer);
SetTile(0x4022, position, super->collisionLayer);
SetBottomTile(0x4022, position - 0x41, super->collisionLayer);
SetBottomTile(0x4022, position - 0x40, super->collisionLayer);
SetBottomTile(0x4022, position - 1, super->collisionLayer);
SetBottomTile(0x4022, position, super->collisionLayer);
break;
case 1:
iVar1 = sub_080B1AE0(position - 0x41, super->collisionLayer);
@ -148,27 +148,27 @@ void sub_08099910(BigIceBlockEntity* this) {
if (iVar1 == 0x12) {
uVar3 = 0x4079;
}
SetTile(uVar3, position - 0x41, super->collisionLayer);
SetTile(0x4022, position - 0x40, super->collisionLayer);
SetBottomTile(uVar3, position - 0x41, super->collisionLayer);
SetBottomTile(0x4022, position - 0x40, super->collisionLayer);
iVar1 = sub_080B1AE0(position - 0x3f, super->collisionLayer);
uVar3 = 0x4025;
if (iVar1 == 0x12) {
uVar3 = 0x407b;
}
SetTile(uVar3, position - 0x3f, super->collisionLayer);
SetBottomTile(uVar3, position - 0x3f, super->collisionLayer);
iVar1 = sub_080B1AE0(position - 1, super->collisionLayer);
uVar3 = 0x4024;
if (iVar1 == 0x12) {
uVar3 = 0x4079;
}
SetTile(uVar3, position - 1, super->collisionLayer);
SetTile(0x4022, position, super->collisionLayer);
SetBottomTile(uVar3, position - 1, super->collisionLayer);
SetBottomTile(0x4022, position, super->collisionLayer);
iVar1 = sub_080B1AE0(position + 1, super->collisionLayer);
uVar3 = 0x4025;
if (iVar1 == 0x12) {
uVar3 = 0x407b;
}
SetTile(uVar3, position + 1, super->collisionLayer);
SetBottomTile(uVar3, position + 1, super->collisionLayer);
return;
break;
case 2:
@ -177,27 +177,27 @@ void sub_08099910(BigIceBlockEntity* this) {
if (iVar1 == 0x12) {
uVar3 = 0x4077;
}
SetTile(uVar3, position - 0x41, super->collisionLayer);
SetBottomTile(uVar3, position - 0x41, super->collisionLayer);
iVar1 = sub_080B1AE0(position - 0x40, super->collisionLayer);
uVar3 = 0x4023;
if (iVar1 == 0x12) {
uVar3 = 0x4077;
}
SetTile(uVar3, position - 0x40, super->collisionLayer);
SetTile(0x4022, position - 1, super->collisionLayer);
SetTile(0x4022, position, super->collisionLayer);
SetBottomTile(uVar3, position - 0x40, super->collisionLayer);
SetBottomTile(0x4022, position - 1, super->collisionLayer);
SetBottomTile(0x4022, position, super->collisionLayer);
iVar1 = sub_080B1AE0(position + 0x3f, super->collisionLayer);
uVar3 = 0x4026;
if (iVar1 == 0x12) {
uVar3 = 0x407c;
}
SetTile(uVar3, position + 0x3f, super->collisionLayer);
SetBottomTile(uVar3, position + 0x3f, super->collisionLayer);
iVar1 = sub_080B1AE0(position + 0x40, super->collisionLayer);
uVar3 = 0x4026;
if (iVar1 == 0x12) {
uVar3 = 0x407c;
}
SetTile(uVar3, position + 0x40, super->collisionLayer);
SetBottomTile(uVar3, position + 0x40, super->collisionLayer);
break;
case 3:
iVar1 = sub_080B1AE0(position - 0x41, super->collisionLayer);
@ -205,50 +205,50 @@ void sub_08099910(BigIceBlockEntity* this) {
if (iVar1 == 0x12) {
uVar3 = 0x4075;
}
SetTile(uVar3, position - 0x41, super->collisionLayer);
SetBottomTile(uVar3, position - 0x41, super->collisionLayer);
iVar1 = sub_080B1AE0(position - 0x40, super->collisionLayer);
uVar3 = 0x4023;
if (iVar1 == 0x12) {
uVar3 = 0x4077;
}
SetTile(uVar3, position - 0x40, super->collisionLayer);
SetBottomTile(uVar3, position - 0x40, super->collisionLayer);
iVar1 = sub_080B1AE0(position - 0x3f, super->collisionLayer);
uVar3 = 0x4028;
if (iVar1 == 0x12) {
uVar3 = 0x4076;
}
SetTile(uVar3, position - 0x3f, super->collisionLayer);
SetBottomTile(uVar3, position - 0x3f, super->collisionLayer);
iVar1 = sub_080B1AE0(position - 1, super->collisionLayer);
uVar3 = 0x4024;
if (iVar1 == 0x12) {
uVar3 = 0x4079;
}
SetTile(uVar3, position - 1, super->collisionLayer);
SetTile(0x4022, position, super->collisionLayer);
SetBottomTile(uVar3, position - 1, super->collisionLayer);
SetBottomTile(0x4022, position, super->collisionLayer);
iVar1 = sub_080B1AE0(position + 1, super->collisionLayer);
uVar3 = 0x4025;
if (iVar1 == 0x12) {
uVar3 = 0x407b;
}
SetTile(uVar3, position + 1, super->collisionLayer);
SetBottomTile(uVar3, position + 1, super->collisionLayer);
iVar1 = sub_080B1AE0(position + 0x3f, super->collisionLayer);
uVar3 = 0x4029;
if (iVar1 == 0x12) {
uVar3 = 0x4078;
}
SetTile(uVar3, position + 0x3f, super->collisionLayer);
SetBottomTile(uVar3, position + 0x3f, super->collisionLayer);
iVar1 = sub_080B1AE0(position + 0x40, super->collisionLayer);
uVar3 = 0x4026;
if (iVar1 == 0x12) {
uVar3 = 0x407c;
}
SetTile(uVar3, position + 0x40, super->collisionLayer);
SetBottomTile(uVar3, position + 0x40, super->collisionLayer);
iVar1 = sub_080B1AE0(position + 0x41, super->collisionLayer);
uVar3 = 0x402a;
if (iVar1 == 0x12) {
uVar3 = 0x407a;
}
SetTile(uVar3, position + 0x41, super->collisionLayer);
SetBottomTile(uVar3, position + 0x41, super->collisionLayer);
break;
}
}

View File

@ -50,8 +50,8 @@ void BigPushableLever_Init(BigPushableLeverEntity* this) {
void BigPushableLever_Idle(BigPushableLeverEntity* this) {
if (BigPushableLever_ShouldStartPushing(this)) {
super->action = PUSHING;
SetTile(this->tileIndexUpper, this->tilePositionUpper, super->collisionLayer);
SetTile(this->tileIndexLower, this->tilePositionLower, super->collisionLayer);
SetBottomTile(this->tileIndexUpper, this->tilePositionUpper, super->collisionLayer);
SetBottomTile(this->tileIndexLower, this->tilePositionLower, super->collisionLayer);
EnqueueSFX(SFX_132);
RequestPriorityDuration(super, 30);
if (PlayerCanBeMoved()) {
@ -90,8 +90,8 @@ void BigPushableLever_SetTiles(BigPushableLeverEntity* this) {
this->tilePositionLower = this->tilePositionUpper - 0x40;
this->tileIndexUpper = GetTileIndex(this->tilePositionUpper, super->collisionLayer);
this->tileIndexLower = GetTileIndex(this->tilePositionLower, super->collisionLayer);
SetTile(0x4057, this->tilePositionUpper, super->collisionLayer);
SetTile(0x4058, this->tilePositionLower, super->collisionLayer);
SetBottomTile(0x4057, this->tilePositionUpper, super->collisionLayer);
SetBottomTile(0x4058, this->tilePositionLower, super->collisionLayer);
InitializeAnimation(super, 1);
} else {
super->type2 = 1;
@ -99,8 +99,8 @@ void BigPushableLever_SetTiles(BigPushableLeverEntity* this) {
this->tilePositionLower = this->tilePositionUpper - 1;
this->tileIndexUpper = GetTileIndex(this->tilePositionUpper, super->collisionLayer);
this->tileIndexLower = GetTileIndex(this->tilePositionLower, super->collisionLayer);
SetTile(0x4055, this->tilePositionUpper, super->collisionLayer);
SetTile(0x4056, this->tilePositionLower, super->collisionLayer);
SetBottomTile(0x4055, this->tilePositionUpper, super->collisionLayer);
SetBottomTile(0x4056, this->tilePositionLower, super->collisionLayer);
InitializeAnimation(super, 0);
}
}
@ -111,7 +111,7 @@ bool32 BigPushableLever_ShouldStartPushing(BigPushableLeverEntity* this) {
return TRUE;
}
BigPushableLever_CalculateSpriteOffsets(this);
SetTile(gUnk_081236E8[super->type2], this->tilePositionLower, super->collisionLayer);
SetBottomTile(gUnk_081236E8[super->type2], this->tilePositionLower, super->collisionLayer);
} else {
this->timer = 60;
super->spriteOffsetX = 0;

View File

@ -53,7 +53,7 @@ void Board_Init(BoardEntity* this) {
UpdateSpriteForCollisionLayer(super);
super->spritePriority.b0 = 6;
if (super->type == 0) {
SetTile(0x4074, this->tile - 0x40, super->collisionLayer);
SetBottomTile(0x4074, this->tile - 0x40, super->collisionLayer);
}
sub_08098BE8(this);
}

View File

@ -58,7 +58,7 @@ void Bollard_Action1(BollardEntity* this) {
}
super->action = 2;
InitializeAnimation(super, 3);
SetTile(this->tileIndex, this->tile, super->collisionLayer);
SetBottomTile(this->tileIndex, this->tile, super->collisionLayer);
EnqueueSFX(SFX_1A5);
}
@ -95,7 +95,7 @@ void sub_0808B3AC(BollardEntity* this) {
this->tile = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tile, super->collisionLayer);
this->unk74 = sub_080B1B44(this->tile, super->collisionLayer);
SetTile(0x400b, this->tile, super->collisionLayer);
SetBottomTile(0x400b, this->tile, super->collisionLayer);
}
void sub_0808B41C(BollardEntity* this) {

View File

@ -177,28 +177,28 @@ void sub_0808C500(BossDoorEntity* this) {
this->unk_78 = GetTileIndex(this->unk_74 - 1, super->collisionLayer);
this->unk_7a = GetTileIndex(this->unk_74, super->collisionLayer);
this->unk_7c = GetTileIndex(this->unk_74 + 1, super->collisionLayer);
SetTile(0x4022, this->unk_74 - 1, super->collisionLayer);
SetTile(0x4022, this->unk_74, super->collisionLayer);
SetTile(0x4022, this->unk_74 + 1, super->collisionLayer);
SetBottomTile(0x4022, this->unk_74 - 1, super->collisionLayer);
SetBottomTile(0x4022, this->unk_74, super->collisionLayer);
SetBottomTile(0x4022, this->unk_74 + 1, super->collisionLayer);
} else {
this->unk_78 = GetTileIndex(this->unk_74 - 0x40, super->collisionLayer);
this->unk_7a = GetTileIndex(this->unk_74, super->collisionLayer);
this->unk_7c = GetTileIndex(this->unk_74 + 0x40, super->collisionLayer);
SetTile(0x4022, this->unk_74 - 0x40, super->collisionLayer);
SetTile(0x4022, this->unk_74, super->collisionLayer);
SetTile(0x4022, this->unk_74 + 0x40, super->collisionLayer);
SetBottomTile(0x4022, this->unk_74 - 0x40, super->collisionLayer);
SetBottomTile(0x4022, this->unk_74, super->collisionLayer);
SetBottomTile(0x4022, this->unk_74 + 0x40, super->collisionLayer);
}
}
void sub_0808C5D0(BossDoorEntity* this) {
if ((this->unk_76 == 0) || (this->unk_76 == 2)) {
SetTile(this->unk_78, this->unk_74 - 1, super->collisionLayer);
SetTile(this->unk_7a, this->unk_74, super->collisionLayer);
SetTile(this->unk_7c, this->unk_74 + 1, super->collisionLayer);
SetBottomTile(this->unk_78, this->unk_74 - 1, super->collisionLayer);
SetBottomTile(this->unk_7a, this->unk_74, super->collisionLayer);
SetBottomTile(this->unk_7c, this->unk_74 + 1, super->collisionLayer);
} else {
SetTile(this->unk_78, this->unk_74 - 0x40, super->collisionLayer);
SetTile(this->unk_7a, this->unk_74, super->collisionLayer);
SetTile(this->unk_7c, this->unk_74 + 0x40, super->collisionLayer);
SetBottomTile(this->unk_78, this->unk_74 - 0x40, super->collisionLayer);
SetBottomTile(this->unk_7a, this->unk_74, super->collisionLayer);
SetBottomTile(this->unk_7c, this->unk_74 + 0x40, super->collisionLayer);
}
}

View File

@ -68,7 +68,7 @@ void Bush_Init(BushEntity* this) {
super->hitbox = (Hitbox*)&gUnk_081205B4;
this->unk_72 = 0;
this->unk_70 = GetTileIndex(COORD_TO_TILE(super), super->collisionLayer);
SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
InitializeAnimation(super, gUnk_08120588[super->type].unk_0);
}

View File

@ -105,7 +105,7 @@ void Button_Action4(ButtonEntity* this) {
super->timer--;
if (super->subtimer != 0) {
super->subtimer = 0;
SetTile(0x4035, this->unk_74, super->collisionLayer);
SetBottomTile(0x4035, this->unk_74, super->collisionLayer);
}
if (sub_08081CB0(this)) {
super->action = 3;
@ -230,7 +230,7 @@ void sub_08081E6C(ButtonEntity* this) {
if (tile < 0x4000)
return;
r1 = GetLayerByIndex(r5);
r1 = GetTileBuffer(r5);
r4 = (super->type == 0 ? 0x7a : 0x78);
tmp = r1->metatiles;
tmp = tmp + (r1->unkData2[r4] << 2);
@ -239,7 +239,7 @@ void sub_08081E6C(ButtonEntity* this) {
if (sub_08081F00((u32*)tmp2, (u32*)tmp))
return;
SetTileType(r4, r6, r5);
SetTile(tile, r6, r5);
SetBottomTile(tile, r6, r5);
}
u32 sub_08081F00(u32* unk1, u32* unk2) {
@ -279,7 +279,7 @@ bool32 sub_08081F7C(ButtonEntity* this, u32 r7) {
sub_08081F24(super);
SoundReq(SFX_BUTTON_PRESS);
if (this->unk_70 != 0xFFFF)
SetTile(this->unk_70, this->unk_74, super->collisionLayer);
SetBottomTile(this->unk_70, this->unk_74, super->collisionLayer);
return FALSE;
}
}

View File

@ -43,38 +43,38 @@ void CabinFurniture_Init(CabinFurnitureEntity* this) {
super->spritePriority.b0 = 6;
uVar7 = this->tile;
uVar6 = uVar7 - 1;
SetTile(0x4022, uVar6, uVar1);
SetTile(0x4022, uVar7, uVar1);
SetTile(0x4022, uVar7 + 1, uVar1);
SetTile(0x4022, uVar7 + 0x3f, uVar1);
SetTile(0x4022, uVar7 + 0x40, uVar1);
SetTile(0x4022, uVar7 + 0x41, uVar1);
SetTile(0x403d, uVar7 - 0x41, uVar1);
SetTile(0x403d, uVar7 - 0x40, uVar1);
SetTile(0x4026, uVar7 - 0x3f, uVar1);
SetTile(0x4026, uVar7 - 0x81, uVar1);
SetTile(0x4026, uVar7 - 0x80, uVar1);
SetBottomTile(0x4022, uVar6, uVar1);
SetBottomTile(0x4022, uVar7, uVar1);
SetBottomTile(0x4022, uVar7 + 1, uVar1);
SetBottomTile(0x4022, uVar7 + 0x3f, uVar1);
SetBottomTile(0x4022, uVar7 + 0x40, uVar1);
SetBottomTile(0x4022, uVar7 + 0x41, uVar1);
SetBottomTile(0x403d, uVar7 - 0x41, uVar1);
SetBottomTile(0x403d, uVar7 - 0x40, uVar1);
SetBottomTile(0x4026, uVar7 - 0x3f, uVar1);
SetBottomTile(0x4026, uVar7 - 0x81, uVar1);
SetBottomTile(0x4026, uVar7 - 0x80, uVar1);
break;
case 1:
super->action = 1;
uVar6 = this->tile;
SetTile(0x4022, uVar6, uVar1);
SetTile(0x4022, uVar6 + 0x40, uVar1);
SetTile(0x4025, uVar6 + 0x41, uVar1);
SetBottomTile(0x4022, uVar6, uVar1);
SetBottomTile(0x4022, uVar6 + 0x40, uVar1);
SetBottomTile(0x4025, uVar6 + 0x41, uVar1);
if (CheckLocalFlag(0x4f) == 0) {
SetTile(0x402f, uVar6 + 1, uVar1);
SetBottomTile(0x402f, uVar6 + 1, uVar1);
} else {
SetTile(0x402d, uVar6 + 1, uVar1);
SetBottomTile(0x402d, uVar6 + 1, uVar1);
}
break;
case 2:
super->action = 1;
uVar7 = this->tile;
uVar6 = uVar7 - 0x41;
SetTile(0x4022, uVar6, uVar1);
SetTile(0x4022, uVar7 - 0x40, uVar1);
SetTile(0x4022, uVar7 - 1, uVar1);
SetTile(0x4022, uVar7, uVar1);
SetBottomTile(0x4022, uVar6, uVar1);
SetBottomTile(0x4022, uVar7 - 0x40, uVar1);
SetBottomTile(0x4022, uVar7 - 1, uVar1);
SetBottomTile(0x4022, uVar7, uVar1);
break;
}
}

View File

@ -97,7 +97,7 @@ void CarlovObject_Type1Init(CarlovObjectEntity* this) {
if (super->timer == 0) {
super->action = 1;
super->subtimer = 120;
SetTile(0x4022, this->unk_76, super->collisionLayer);
SetBottomTile(0x4022, this->unk_76, super->collisionLayer);
} else {
super->action = 3;
super->spriteSettings.draw = 0;
@ -111,7 +111,7 @@ void CarlovObject_Type1Action1(CarlovObjectEntity* this) {
super->action = 2;
super->timer = 7;
super->direction = 0;
SetTile(this->unk_74, this->unk_76, super->collisionLayer);
SetBottomTile(this->unk_74, this->unk_76, super->collisionLayer);
EnqueueSFX(SFX_10B);
}
}
@ -140,7 +140,7 @@ void CarlovObject_Type1Action4(CarlovObjectEntity* this) {
super->action = 5;
sub_08083814(super, 2);
EnqueueSFX(SFX_10B);
SetTile(0x4022, this->unk_76, super->collisionLayer);
SetBottomTile(0x4022, this->unk_76, super->collisionLayer);
}
}

View File

@ -54,13 +54,13 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) {
if (CheckGlobalFlag(WATERBEAN_OUT)) {
if (CheckGlobalFlag(WATERBEAN_PUT) == 0) {
PositionRelative(&gPlayerEntity.base, super, 0, 0x10000);
SetTile(0x4022, 0xdc, super->collisionLayer);
SetBottomTile(0x4022, 0xdc, super->collisionLayer);
} else {
if (CheckLocalFlag(super->type2) == 0) {
InitializeAnimation(super, 10);
super->y.HALF.HI += 4;
super->action = 4;
SetTile(0x403b, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(0x403b, COORD_TO_TILE(super), super->collisionLayer);
return;
}
super->type2 = 0;
@ -107,7 +107,7 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) {
InitializeAnimation(super, 0xb);
super->y.HALF.HI += 4;
super->action = 4;
SetTile(0x4032, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(0x4032, COORD_TO_TILE(super), super->collisionLayer);
return;
} else {
super->type2 = 0;
@ -329,5 +329,5 @@ void sub_08096A78(CrenelBeanSproutEntity* this) {
SnapToTile(super);
super->y.HALF.HI += 4;
super->action = 3;
SetTile(0x403b, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(0x403b, COORD_TO_TILE(super), super->collisionLayer);
}

View File

@ -98,39 +98,39 @@ void sub_0809B0B0(DoubleBookshelfEntity* this) {
case 0:
this->unk_84 = 0;
this->unk_82 = position + 2;
SetTile(0x4082, position - 1, layer);
SetTile(0x4022, position, layer);
SetTile(0x4022, position + 1, layer);
SetTile(0x4022, position + 2, layer);
SetBottomTile(0x4082, position - 1, layer);
SetBottomTile(0x4022, position, layer);
SetBottomTile(0x4022, position + 1, layer);
SetBottomTile(0x4022, position + 2, layer);
break;
case 1:
this->unk_84 = 1;
this->unk_82 = position;
SetTile(0x405f, position, layer);
SetTile(0x4022, position + 1, layer);
SetTile(0x4022, position + 2, layer);
SetTile(0x4082, position + 3, layer);
SetBottomTile(0x405f, position, layer);
SetBottomTile(0x4022, position + 1, layer);
SetBottomTile(0x4022, position + 2, layer);
SetBottomTile(0x4082, position + 3, layer);
break;
case 2:
this->unk_84 = 1;
this->unk_82 = position;
SetTile(0x4082, position + 3, layer);
SetTile(0x4022, position + 2, layer);
SetTile(0x405f, position, layer);
SetBottomTile(0x4082, position + 3, layer);
SetBottomTile(0x4022, position + 2, layer);
SetBottomTile(0x405f, position, layer);
SetFlag(((DoubleBookshelfEntity*)super->parent)->unk_86);
break;
case 3:
this->unk_84 = 0;
this->unk_82 = position + 2;
SetTile(0x4082, position - 1, layer);
SetTile(0x4022, position, layer);
SetTile(0x405f, position + 2, layer);
SetBottomTile(0x4082, position - 1, layer);
SetBottomTile(0x4022, position, layer);
SetBottomTile(0x405f, position + 2, layer);
ClearFlag(((DoubleBookshelfEntity*)super->parent)->unk_86);
break;
case 4:
SetTile(0x4022, position, layer);
SetTile(0x4022, position + 1, layer);
SetTile(0x4022, position + 2, layer);
SetBottomTile(0x4022, position, layer);
SetBottomTile(0x4022, position + 1, layer);
SetBottomTile(0x4022, position + 2, layer);
break;
}
}
@ -157,7 +157,7 @@ void sub_0809B274(DoubleBookshelfEntity* this) {
case 1:
if (player->x.HALF.HI + 0x1c > super->x.HALF.HI) {
this->unk_84 = 2;
SetTile(0x4022, this->unk_80 + 2, 1);
SetBottomTile(0x4022, this->unk_80 + 2, 1);
sub_0809B358((DoubleBookshelfEntity*)super->child);
return;
}
@ -182,7 +182,7 @@ void sub_0809B334(DoubleBookshelfEntity* this) {
s32 index;
u32 position = this->unk_80 - 0x81;
for (index = 2; index >= 0; index--, position++) {
SetTile(0x4026, position, 1);
SetBottomTile(0x4026, position, 1);
}
}
@ -194,7 +194,7 @@ void sub_0809B358(DoubleBookshelfEntity* this) {
const u16* array = &gUnk_08123D68[this->unk_84];
u32 position = this->unk_80 - 0x82;
for (index = 4; index >= 0;) {
SetTile(*array, position, 1);
SetBottomTile(*array, position, 1);
index--;
position++;
array += 2;

View File

@ -305,9 +305,9 @@ void sub_08087F58(FigurineDeviceEntity* this) {
switch (super->type) {
case 0:
case 1:
SetTile(0x4022, this->unk_78 - 1, 1);
SetTile(0x4022, this->unk_78, 1);
SetTile(0x4022, this->unk_78 + 1, 1);
SetBottomTile(0x4022, this->unk_78 - 1, 1);
SetBottomTile(0x4022, this->unk_78, 1);
SetBottomTile(0x4022, this->unk_78 + 1, 1);
break;
}
}

View File

@ -35,7 +35,7 @@ void Fireplace_Init(FireplaceEntity* this) {
DeleteThisEntity();
} else {
sub_0807B7D8(0x30b, TILE(super->x.HALF.HI, super->y.HALF.HI), 2);
SetTile(0x4061, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetBottomTile(0x4061, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
Fireplace_Action1(this);
}
@ -57,6 +57,6 @@ void sub_0809B7C0(FireplaceEntity* this) {
void sub_0809B7DC(FireplaceEntity* this) {
sub_0807B7D8(0xc3 << 2, TILE(super->x.HALF.HI, super->y.HALF.HI), 2);
SetTile(0x4062, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetBottomTile(0x4062, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
super->timer = 1;
}

View File

@ -113,33 +113,33 @@ void FrozenWaterElement_Action2(FrozenWaterElementEntity* this) {
void sub_0809C0A8(FrozenWaterElementEntity* this) {
u32 position = COORD_TO_TILE(super);
SetTile(0x4022, position - 0x41, super->collisionLayer);
SetTile(0x4022, position - 0x40, super->collisionLayer);
SetTile(0x4022, position - 0x3f, super->collisionLayer);
SetTile(0x4022, position - 2, super->collisionLayer);
SetTile(0x4022, position - 1, super->collisionLayer);
SetTile(0x4022, position, super->collisionLayer);
SetTile(0x4022, position + 1, super->collisionLayer);
SetTile(0x4022, position + 2, super->collisionLayer);
SetTile(0x4022, position + 0x3e, super->collisionLayer);
SetTile(0x4022, position + 0x3f, super->collisionLayer);
SetTile(0x4022, position + 0x40, super->collisionLayer);
SetTile(0x4022, position + 0x41, super->collisionLayer);
SetTile(0x4022, position + 0x42, super->collisionLayer);
SetTile(0x4022, position + 0x7f, super->collisionLayer);
SetTile(0x4022, position + 0x80, super->collisionLayer);
SetTile(0x4022, position + 0x81, super->collisionLayer);
SetTile(0x4022, position + 0x13f, super->collisionLayer);
SetTile(0x4022, position + 0x140, super->collisionLayer);
SetTile(0x4022, position + 0x141, super->collisionLayer);
SetTile(0x4022, position + 0x17f, super->collisionLayer);
SetTile(0x4022, position + 0x181, super->collisionLayer);
SetTile(0x4022, position + 0x1bd, super->collisionLayer);
SetTile(0x4022, position + 0x1be, super->collisionLayer);
SetTile(0x4022, position + 0x1bf, super->collisionLayer);
SetTile(0x4022, position + 0x1c1, super->collisionLayer);
SetTile(0x4022, position + 0x1c2, super->collisionLayer);
SetTile(0x4022, position + 0x1c3, super->collisionLayer);
SetBottomTile(0x4022, position - 0x41, super->collisionLayer);
SetBottomTile(0x4022, position - 0x40, super->collisionLayer);
SetBottomTile(0x4022, position - 0x3f, super->collisionLayer);
SetBottomTile(0x4022, position - 2, super->collisionLayer);
SetBottomTile(0x4022, position - 1, super->collisionLayer);
SetBottomTile(0x4022, position, super->collisionLayer);
SetBottomTile(0x4022, position + 1, super->collisionLayer);
SetBottomTile(0x4022, position + 2, super->collisionLayer);
SetBottomTile(0x4022, position + 0x3e, super->collisionLayer);
SetBottomTile(0x4022, position + 0x3f, super->collisionLayer);
SetBottomTile(0x4022, position + 0x40, super->collisionLayer);
SetBottomTile(0x4022, position + 0x41, super->collisionLayer);
SetBottomTile(0x4022, position + 0x42, super->collisionLayer);
SetBottomTile(0x4022, position + 0x7f, super->collisionLayer);
SetBottomTile(0x4022, position + 0x80, super->collisionLayer);
SetBottomTile(0x4022, position + 0x81, super->collisionLayer);
SetBottomTile(0x4022, position + 0x13f, super->collisionLayer);
SetBottomTile(0x4022, position + 0x140, super->collisionLayer);
SetBottomTile(0x4022, position + 0x141, super->collisionLayer);
SetBottomTile(0x4022, position + 0x17f, super->collisionLayer);
SetBottomTile(0x4022, position + 0x181, super->collisionLayer);
SetBottomTile(0x4022, position + 0x1bd, super->collisionLayer);
SetBottomTile(0x4022, position + 0x1be, super->collisionLayer);
SetBottomTile(0x4022, position + 0x1bf, super->collisionLayer);
SetBottomTile(0x4022, position + 0x1c1, super->collisionLayer);
SetBottomTile(0x4022, position + 0x1c2, super->collisionLayer);
SetBottomTile(0x4022, position + 0x1c3, super->collisionLayer);
}
void sub_0809C23C(FrozenWaterElementEntity* this) {

View File

@ -217,14 +217,14 @@ static void FurnitureInit(FurnitureEntity* this) {
break;
case 0x40:
super->y.HALF.HI = (super->y.HALF.HI & ~0xF) | 4;
SetTile(0x4017, this->tile - 128, 1);
SetTile(0x4017, this->tile - 64, 1);
SetBottomTile(0x4017, this->tile - 128, 1);
SetBottomTile(0x4017, this->tile - 64, 1);
break;
case 0x80:
super->frameIndex = 0;
super->y.HALF.HI = (super->y.HALF.HI & ~0xF) | 6;
this->tile = COORD_TO_TILE(super);
SetTile(0x4026, this->tile, super->collisionLayer);
SetBottomTile(0x4026, this->tile, super->collisionLayer);
break;
case 0x200:
break;
@ -260,8 +260,8 @@ static void FurnitureInit(FurnitureEntity* this) {
tile = this->tile - 129;
cnt = super->type != 26 ? 3 : 2;
for (i = 0; i < cnt; ++i, ++tile) {
SetTile(0x4026, tile, 2);
SetTile(0x4026, tile, 1);
SetBottomTile(0x4026, tile, 2);
SetBottomTile(0x4026, tile, 1);
sub_080001D0(0, tile + 64, 1);
}
break;
@ -287,22 +287,22 @@ static void FurnitureInit(FurnitureEntity* this) {
case STAIRCASE:
super->collisionLayer = 1;
super->spriteOrientation.flipY = 2;
SetTile(0x4074, this->tile - 64, super->collisionLayer);
SetBottomTile(0x4074, this->tile - 64, super->collisionLayer);
sub_080001D0(63, this->tile - 64, super->collisionLayer);
SetTile(0x4017, this->tile, super->collisionLayer);
SetTile(0x4017, this->tile + 64, super->collisionLayer);
SetBottomTile(0x4017, this->tile, super->collisionLayer);
SetBottomTile(0x4017, this->tile + 64, super->collisionLayer);
break;
case MINISH_CHEESE:
if (super->type2 != 0)
super->spriteOffsetX = -4;
break;
case WOODEN_TABLE:
SetTile(0x4023, this->tile - 65, super->collisionLayer);
SetTile(0x4023, this->tile - 64, super->collisionLayer);
SetTile(0x4023, this->tile - 63, super->collisionLayer);
SetBottomTile(0x4023, this->tile - 65, super->collisionLayer);
SetBottomTile(0x4023, this->tile - 64, super->collisionLayer);
SetBottomTile(0x4023, this->tile - 63, super->collisionLayer);
break;
case LOW_BOOKSHELF:
SetTile(0x4022, this->tile + 65, super->collisionLayer);
SetBottomTile(0x4022, this->tile + 65, super->collisionLayer);
}
}
@ -340,9 +340,9 @@ static void FurnitureUpdate(FurnitureEntity* this) {
case 0x80:
if (gPlayerEntity.base.y.HALF.HI < super->y.HALF.HI + 8) {
if (gPlayerState.floor_type != SURFACE_LADDER && GetTileTypeByEntity(super) == 0x4017) {
SetTile(0x4026, this->tile, super->collisionLayer);
SetTile(0x403D, this->tile - 64, super->collisionLayer);
SetTile(0x403D, this->tile - 128, super->collisionLayer);
SetBottomTile(0x4026, this->tile, super->collisionLayer);
SetBottomTile(0x403D, this->tile - 64, super->collisionLayer);
SetBottomTile(0x403D, this->tile - 128, super->collisionLayer);
}
} else {
if (gPlayerEntity.base.collisionLayer & 2) {
@ -350,9 +350,9 @@ static void FurnitureUpdate(FurnitureEntity* this) {
UpdateSpriteForCollisionLayer(&gPlayerEntity.base);
}
if (GetTileTypeByEntity(super) != 0x4017) {
SetTile(0x4017, this->tile, super->collisionLayer);
SetTile(0x4017, this->tile - 64, super->collisionLayer);
SetTile(0x4014, this->tile - 128, super->collisionLayer);
SetBottomTile(0x4017, this->tile, super->collisionLayer);
SetBottomTile(0x4017, this->tile - 64, super->collisionLayer);
SetBottomTile(0x4014, this->tile - 128, super->collisionLayer);
}
}
break;
@ -377,28 +377,28 @@ static void sub_08090B6C(FurnitureEntity* this) {
num = 2;
}
for (i = -num; i <= num; ++i) {
SetTile(0x4022, tile + i, cl);
SetBottomTile(0x4022, tile + i, cl);
}
if (px & 8) {
sub_08090CDC(0x4024, tile - i, cl);
sub_08090CDC(0x4025, tile + i, cl);
} else {
SetTile(0x4022, tile - i, cl);
SetBottomTile(0x4022, tile - i, cl);
}
break;
case 1:
num = w2 / 8;
for (i = -num; i <= num; i++) {
SetTile(0x4022, tile + i, cl);
SetBottomTile(0x4022, tile + i, cl);
}
if (px & 8) {
sub_08090CDC(0x4024, tile - i, cl);
if (i != 0) {
SetTile(0x4022, tile + i, cl);
SetBottomTile(0x4022, tile + i, cl);
}
} else {
if (i != 0) {
SetTile(0x4022, tile - i, cl);
SetBottomTile(0x4022, tile - i, cl);
}
sub_08090CDC(0x4025, tile + i, cl);
}
@ -406,10 +406,10 @@ static void sub_08090B6C(FurnitureEntity* this) {
case 2:
num = w2 / 4;
for (i = -num; i < num; ++i) {
SetTile(0x4022, tile + i, cl);
SetBottomTile(0x4022, tile + i, cl);
}
if (px & 8) {
SetTile(0x4022, tile + i, cl);
SetBottomTile(0x4022, tile + i, cl);
} else {
sub_08090CDC(0x4024, tile - i - 1, cl);
sub_08090CDC(0x4025, tile + i, cl);
@ -418,7 +418,7 @@ static void sub_08090B6C(FurnitureEntity* this) {
case 3:
num = w2 / 4;
for (i = -num; i <= num; ++i) {
SetTile(0x4022, tile + i, cl);
SetBottomTile(0x4022, tile + i, cl);
}
if (px & 8) {
sub_08090CDC(0x4025, tile + i, cl);
@ -436,7 +436,7 @@ static void sub_08090CDC(u32 id, u32 pos, u32 layer) {
u32 id2;
if ((cur & 0x4000) == 0) {
SetTile(id, pos, layer);
SetBottomTile(id, pos, layer);
} else {
switch (cur) {
case 0x4025:
@ -474,7 +474,7 @@ static void sub_08090CDC(u32 id, u32 pos, u32 layer) {
default:
return;
}
SetTile(next, pos, layer);
SetBottomTile(next, pos, layer);
}
}

View File

@ -59,8 +59,8 @@ void GentariCurtain_Init(GentariCurtainEntity* this) {
this->tile2 = COORD_TO_TILE_OFFSET(super, 0, -8);
this->tileIndex = GetTileIndex(this->tile, 1);
this->tileIndex2 = GetTileIndex(this->tile2, 1);
SetTile(0x4022, this->tile, 1);
SetTile(0x4022, this->tile2, 1);
SetBottomTile(0x4022, this->tile, 1);
SetBottomTile(0x4022, this->tile2, 1);
InitAnimationForceUpdate(super, 0);
} else {
super->action = 1;
@ -80,8 +80,8 @@ void GentariCurtain_Action2(GentariCurtainEntity* this) {
UpdateAnimationSingleFrame(super);
if ((super->frame & ANIM_DONE) != 0) {
super->action = 3;
SetTile(this->tileIndex, this->tile, 1);
SetTile(this->tileIndex2, this->tile2, 1);
SetBottomTile(this->tileIndex, this->tile, 1);
SetBottomTile(this->tileIndex2, this->tile2, 1);
sub_08092214(this);
sub_0809223C(this);
InitAnimationForceUpdate(super, 1);

View File

@ -50,33 +50,33 @@ void sub_0808E55C(GiantBookLadderEntity* this) {
case 2:
position = this->unk74;
unaff_r9 = position - 0x101;
SetTile(0x408f, unaff_r9, super->collisionLayer);
SetTile(0x408f, position - 0x100, super->collisionLayer);
SetTile(0x406c, position - 0x102, super->collisionLayer);
SetTile(0x406d, position - 0xff, super->collisionLayer);
SetBottomTile(0x408f, unaff_r9, super->collisionLayer);
SetBottomTile(0x408f, position - 0x100, super->collisionLayer);
SetBottomTile(0x406c, position - 0x102, super->collisionLayer);
SetBottomTile(0x406d, position - 0xff, super->collisionLayer);
type = super->type;
uVar5 = 6;
if (type != 0) {
uVar5 = 4;
SetTile(0x4072, position + 0x3f, super->collisionLayer);
SetTile(0x4072, position + 0x40, super->collisionLayer);
SetTile(0x4072, position + 0x7f, super->collisionLayer);
SetTile(0x4072, position + 0x80, super->collisionLayer);
SetBottomTile(0x4072, position + 0x3f, super->collisionLayer);
SetBottomTile(0x4072, position + 0x40, super->collisionLayer);
SetBottomTile(0x4072, position + 0x7f, super->collisionLayer);
SetBottomTile(0x4072, position + 0x80, super->collisionLayer);
}
break;
case 1:
position = this->unk74;
unaff_r9 = position - 1;
SetTile(0x408e, unaff_r9, super->collisionLayer);
SetTile(0x408e, position, super->collisionLayer);
SetBottomTile(0x408e, unaff_r9, super->collisionLayer);
SetBottomTile(0x408e, position, super->collisionLayer);
uVar5 = 2;
break;
}
for (uVar4 = 0; uVar4 < uVar5; uVar4++) {
unaff_r9 += 0x40;
SetTile(0x408e, unaff_r9, super->collisionLayer);
SetTile(0x408e, unaff_r9 + 1, super->collisionLayer);
SetBottomTile(0x408e, unaff_r9, super->collisionLayer);
SetBottomTile(0x408e, unaff_r9 + 1, super->collisionLayer);
}
}

View File

@ -35,6 +35,6 @@ void sub_0808D618(Entity* this) {
((((this->y.HALF.HI - gRoomControls.origin_y) >> 4) & 0x3F) * 64);
for (i = 0; i < 13; i++) {
SetTile(16500, tilePos + arr[i], 1);
SetBottomTile(16500, tilePos + arr[i], 1);
}
}

View File

@ -38,10 +38,10 @@ void GiantRock2_Init(GiantRock2Entity* this) {
position = (this->tile - 0x80);
tileIndex = 0x4022;
for (index = 4; index > -1; index--) {
SetTile(tileIndex, position - 2, collisionLayer);
SetTile(tileIndex, position - 1, collisionLayer);
SetTile(tileIndex, position, collisionLayer);
SetTile(tileIndex, position + 1, collisionLayer);
SetBottomTile(tileIndex, position - 2, collisionLayer);
SetBottomTile(tileIndex, position - 1, collisionLayer);
SetBottomTile(tileIndex, position, collisionLayer);
SetBottomTile(tileIndex, position + 1, collisionLayer);
position += 0x40;
}
}

View File

@ -155,7 +155,7 @@ void sub_08093984(GiantTwigEntity* this) {
}
for (index = 0; index < 0x13; index++) {
SetTile(0x4074, array[index] + this->tilePosition, 1);
SetBottomTile(0x4074, array[index] + this->tilePosition, 1);
}
}
@ -174,47 +174,47 @@ void GiantTwig_Type3Idle(GiantTwigEntity* this) {
void sub_08093A1C(GiantTwigEntity* this) {
switch (super->type) {
case 0:
SetTile(0x4024, this->tilePosition + 0x3c, super->collisionLayer);
SetTile(0x4022, this->tilePosition + 0x3d, super->collisionLayer);
SetTile(0x4022, this->tilePosition + 0x3e, super->collisionLayer);
SetTile(0x4029, this->tilePosition + 0x7c, super->collisionLayer);
SetTile(0x4026, this->tilePosition + 0x7d, super->collisionLayer);
SetTile(0x4026, this->tilePosition + 0x7e, super->collisionLayer);
SetTile(0x403d, this->tilePosition + 0x40, super->collisionLayer);
SetTile(0x403d, this->tilePosition + 0x80, super->collisionLayer);
SetTile(0x4027, this->tilePosition + 0x41, super->collisionLayer);
SetTile(0x4023, this->tilePosition + 0x42, super->collisionLayer);
SetTile(0x406d, this->tilePosition + 0x43, super->collisionLayer);
SetTile(0x4029, this->tilePosition + 0x81, super->collisionLayer);
SetTile(0x4026, this->tilePosition + 0x82, super->collisionLayer);
SetTile(0x4026, this->tilePosition + 0x83, super->collisionLayer);
SetBottomTile(0x4024, this->tilePosition + 0x3c, super->collisionLayer);
SetBottomTile(0x4022, this->tilePosition + 0x3d, super->collisionLayer);
SetBottomTile(0x4022, this->tilePosition + 0x3e, super->collisionLayer);
SetBottomTile(0x4029, this->tilePosition + 0x7c, super->collisionLayer);
SetBottomTile(0x4026, this->tilePosition + 0x7d, super->collisionLayer);
SetBottomTile(0x4026, this->tilePosition + 0x7e, super->collisionLayer);
SetBottomTile(0x403d, this->tilePosition + 0x40, super->collisionLayer);
SetBottomTile(0x403d, this->tilePosition + 0x80, super->collisionLayer);
SetBottomTile(0x4027, this->tilePosition + 0x41, super->collisionLayer);
SetBottomTile(0x4023, this->tilePosition + 0x42, super->collisionLayer);
SetBottomTile(0x406d, this->tilePosition + 0x43, super->collisionLayer);
SetBottomTile(0x4029, this->tilePosition + 0x81, super->collisionLayer);
SetBottomTile(0x4026, this->tilePosition + 0x82, super->collisionLayer);
SetBottomTile(0x4026, this->tilePosition + 0x83, super->collisionLayer);
break;
case 1:
if ((super->type2 & 1) != 0) {
SetTile(0x406d, this->tilePosition - 0x81, super->collisionLayer);
SetTile(0x4022, this->tilePosition - 0x41, super->collisionLayer);
SetTile(0x4029, this->tilePosition - 2, super->collisionLayer);
SetTile(0x4026, this->tilePosition - 1, super->collisionLayer);
SetTile(0x4022, this->tilePosition, super->collisionLayer);
SetTile(0x406d, this->tilePosition + 1, super->collisionLayer);
SetTile(0x406e, this->tilePosition + 0x40, super->collisionLayer);
SetTile(0x4022, this->tilePosition + 0x41, super->collisionLayer);
SetTile(0x406d, this->tilePosition + 0x42, super->collisionLayer);
SetBottomTile(0x406d, this->tilePosition - 0x81, super->collisionLayer);
SetBottomTile(0x4022, this->tilePosition - 0x41, super->collisionLayer);
SetBottomTile(0x4029, this->tilePosition - 2, super->collisionLayer);
SetBottomTile(0x4026, this->tilePosition - 1, super->collisionLayer);
SetBottomTile(0x4022, this->tilePosition, super->collisionLayer);
SetBottomTile(0x406d, this->tilePosition + 1, super->collisionLayer);
SetBottomTile(0x406e, this->tilePosition + 0x40, super->collisionLayer);
SetBottomTile(0x4022, this->tilePosition + 0x41, super->collisionLayer);
SetBottomTile(0x406d, this->tilePosition + 0x42, super->collisionLayer);
} else {
SetTile(0x406c, this->tilePosition - 0x7f, super->collisionLayer);
SetTile(0x4022, this->tilePosition - 0x3f, super->collisionLayer);
SetTile(0x406c, this->tilePosition - 1, super->collisionLayer);
SetTile(0x4022, this->tilePosition, super->collisionLayer);
SetTile(0x4026, this->tilePosition + 1, super->collisionLayer);
SetTile(0x402a, this->tilePosition + 2, super->collisionLayer);
SetTile(0x406c, this->tilePosition + 0x3e, super->collisionLayer);
SetTile(0x4022, this->tilePosition + 0x3f, super->collisionLayer);
SetTile(0x406f, this->tilePosition + 0x40, super->collisionLayer);
SetBottomTile(0x406c, this->tilePosition - 0x7f, super->collisionLayer);
SetBottomTile(0x4022, this->tilePosition - 0x3f, super->collisionLayer);
SetBottomTile(0x406c, this->tilePosition - 1, super->collisionLayer);
SetBottomTile(0x4022, this->tilePosition, super->collisionLayer);
SetBottomTile(0x4026, this->tilePosition + 1, super->collisionLayer);
SetBottomTile(0x402a, this->tilePosition + 2, super->collisionLayer);
SetBottomTile(0x406c, this->tilePosition + 0x3e, super->collisionLayer);
SetBottomTile(0x4022, this->tilePosition + 0x3f, super->collisionLayer);
SetBottomTile(0x406f, this->tilePosition + 0x40, super->collisionLayer);
return;
}
break;
case 3:
SetTile(0x4022, this->tilePosition, super->collisionLayer);
SetBottomTile(0x4022, this->tilePosition, super->collisionLayer);
break;
}
}
@ -223,12 +223,12 @@ void sub_08093C70(GiantTwigEntity* this) {
if (this->unk_78 != 0) {
if (gPlayerState.heldObject != 0) {
this->unk_78 = 0;
SetTile(0x4022, this->tilePosition + 0x3f, super->collisionLayer);
SetTile(0x4022, this->tilePosition + 0x40, super->collisionLayer);
SetTile(0x4022, this->tilePosition + 0x41, super->collisionLayer);
SetTile(0x4026, this->tilePosition + 0x7f, super->collisionLayer);
SetTile(0x4026, this->tilePosition + 0x80, super->collisionLayer);
SetTile(0x4026, this->tilePosition + 0x81, super->collisionLayer);
SetBottomTile(0x4022, this->tilePosition + 0x3f, super->collisionLayer);
SetBottomTile(0x4022, this->tilePosition + 0x40, super->collisionLayer);
SetBottomTile(0x4022, this->tilePosition + 0x41, super->collisionLayer);
SetBottomTile(0x4026, this->tilePosition + 0x7f, super->collisionLayer);
SetBottomTile(0x4026, this->tilePosition + 0x80, super->collisionLayer);
SetBottomTile(0x4026, this->tilePosition + 0x81, super->collisionLayer);
}
} else {
@ -236,12 +236,12 @@ void sub_08093C70(GiantTwigEntity* this) {
if (--this->unk_7a == 0) {
this->unk_78++;
this->unk_7a = 0x3c;
SetTile(0x403d, this->tilePosition + 0x3f, super->collisionLayer);
SetTile(0x403d, this->tilePosition + 0x40, super->collisionLayer);
SetTile(0x4027, this->tilePosition + 0x41, super->collisionLayer);
SetTile(0x403d, this->tilePosition + 0x7f, super->collisionLayer);
SetTile(0x403d, this->tilePosition + 0x80, super->collisionLayer);
SetTile(0x4029, this->tilePosition + 0x81, super->collisionLayer);
SetBottomTile(0x403d, this->tilePosition + 0x3f, super->collisionLayer);
SetBottomTile(0x403d, this->tilePosition + 0x40, super->collisionLayer);
SetBottomTile(0x4027, this->tilePosition + 0x41, super->collisionLayer);
SetBottomTile(0x403d, this->tilePosition + 0x7f, super->collisionLayer);
SetBottomTile(0x403d, this->tilePosition + 0x80, super->collisionLayer);
SetBottomTile(0x4029, this->tilePosition + 0x81, super->collisionLayer);
}
}
}

View File

@ -183,10 +183,10 @@ void sub_0808C148(JarPortalEntity* this, u32 a2) {
pos = COORD_TO_TILE(super);
if (!a2) {
SetTile(16530, pos - 1, super->collisionLayer);
SetTile(16531, pos, super->collisionLayer);
SetTile(16532, pos + 63, super->collisionLayer);
SetTile(16533, pos + 64, super->collisionLayer);
SetBottomTile(16530, pos - 1, super->collisionLayer);
SetBottomTile(16531, pos, super->collisionLayer);
SetBottomTile(16532, pos + 63, super->collisionLayer);
SetBottomTile(16533, pos + 64, super->collisionLayer);
} else {
RestorePrevTileEntity(pos - 1, super->collisionLayer);
RestorePrevTileEntity(pos, super->collisionLayer);

View File

@ -37,7 +37,7 @@ void LadderUp(Entity* this) {
return;
}
this->y.HALF.HI = (this->y.HALF.HI & 0xfff0) + 0xc;
SetTile(0x4023, COORD_TO_TILE(this), this->collisionLayer);
SetBottomTile(0x4023, COORD_TO_TILE(this), this->collisionLayer);
break;
case 1:
if (GravityUpdate(this, Q_8_8(16.0)) == 0) {
@ -66,16 +66,16 @@ void LadderUp(Entity* this) {
if (this->type2 == 0) {
if (gPlayerEntity.base.y.HALF.HI < this->y.HALF.HI) {
if (gPlayerState.floor_type != SURFACE_LADDER && (GetTileTypeByEntity(this) == 0x4017)) {
SetTile(0x4023, COORD_TO_TILE(this), this->collisionLayer);
SetBottomTile(0x4023, COORD_TO_TILE(this), this->collisionLayer);
RestorePrevTileEntity(COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer);
}
} else {
if (GetTileTypeByEntity(this) != 0x4017) {
SetTile(0x4017, COORD_TO_TILE(this), this->collisionLayer);
SetBottomTile(0x4017, COORD_TO_TILE(this), this->collisionLayer);
if (this->type == 0) {
SetTile(0x4017, COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer);
SetBottomTile(0x4017, COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer);
} else {
SetTile(0x4014, COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer);
SetBottomTile(0x4014, COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer);
}
}
}

View File

@ -87,13 +87,13 @@ void LightDoor_Action4(LightDoorEntity* this) {
void sub_080850FC(LightDoorEntity* this) {
u32 position = COORD_TO_TILE(super);
u32 layer = super->collisionLayer;
SetTile(0x403d, position - 0x41, layer);
SetTile(0x403d, position - 0x40, layer);
SetTile(0x403d, position - 0x3f, layer);
SetTile(0x403d, position - 1, layer);
SetTile(0x403d, position, layer);
SetTile(0x403d, position + 1, layer);
SetTile(0x403d, position + 0x3f, layer);
SetTile(0x403d, position + 0x40, layer);
SetTile(0x403d, position + 0x41, layer);
SetBottomTile(0x403d, position - 0x41, layer);
SetBottomTile(0x403d, position - 0x40, layer);
SetBottomTile(0x403d, position - 0x3f, layer);
SetBottomTile(0x403d, position - 1, layer);
SetBottomTile(0x403d, position, layer);
SetBottomTile(0x403d, position + 1, layer);
SetBottomTile(0x403d, position + 0x3f, layer);
SetBottomTile(0x403d, position + 0x40, layer);
SetBottomTile(0x403d, position + 0x41, layer);
}

View File

@ -99,7 +99,7 @@ static void sub_0809EAD8(LightableSwitchEntity* this) {
UpdateRailMovement(super, (u16**)&super->child, &this->unk_74);
} else {
SetTile(0x4050, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(0x4050, COORD_TO_TILE(super), super->collisionLayer);
}
}

View File

@ -329,10 +329,10 @@ void LilypadLarge_Action2(LilypadLargeEntity* this) {
void sub_08085A44(LilypadLargeEntity* this) {
super->speed = 0x200;
if (GetRelativeCollisionTile(super, 0x10, 0x18) != 0x11) {
if (GetActTileRelative(super, 0x10, 0x18) != 0x11) {
super->direction = 0x18;
} else {
if (GetRelativeCollisionTile(super, -0x10, 0x18) != 0x11) {
if (GetActTileRelative(super, -0x10, 0x18) != 0x11) {
super->direction = 8;
} else {
super->direction = 0x10;
@ -353,7 +353,7 @@ void sub_08085A98(LilypadLargeEntity* this) {
this->unk_78.WORD -= 0x20000;
SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
}
if (GetRelativeCollisionTile(super, 0, 0x18) != 0x11) {
if (GetActTileRelative(super, 0, 0x18) != 0x11) {
super->subAction = 2;
if (gArea.locationIndex == 0x1b) {
super->y.HALF.HI += 0xd0;
@ -456,7 +456,7 @@ void LilypadLarge_Action5(LilypadLargeEntity* this) {
void sub_08085D28(LilypadLargeEntity* this) {
if (((gPlayerState.framestate != PL_STATE_TALKEZLO) && ((gPlayerState.flags & PL_FLAGS2) != 0)) &&
(GetRelativeCollisionTile(super, 0, 0x18) == 0x11)) {
(GetActTileRelative(super, 0, 0x18) == 0x11)) {
super->action = 2;
super->subAction = 0;
PausePlayer();

View File

@ -118,8 +118,8 @@ void sub_08094980(LinkEmptyingBottleEntity* this, u32 searchTileIndex, u32 repla
xOffset = gUnk_08122A28[index];
yOffset = gUnk_08122A28[index + 1];
if (searchTileIndex == sub_080B1A0C(super, xOffset, yOffset)) {
SetTile(replaceTileIndex, TILE(super->x.HALF.HI + xOffset, super->y.HALF.HI + yOffset),
super->collisionLayer);
SetBottomTile(replaceTileIndex, TILE(super->x.HALF.HI + xOffset, super->y.HALF.HI + yOffset),
super->collisionLayer);
}
index += 2;
}

View File

@ -162,7 +162,7 @@ void LockedDoor_Action1(LockedDoorEntity* this) {
if (--super->timer == 0) {
super->action = 2;
super->timer = 7;
SetTile(this->unk_74, this->unk_76, super->collisionLayer);
SetBottomTile(this->unk_74, this->unk_76, super->collisionLayer);
EnqueueSFX(SFX_10B);
}
}
@ -262,12 +262,12 @@ void sub_080836A0(LockedDoorEntity* this) {
super->spriteSettings.draw = 1;
super->x.HALF.HI = this->unk_70;
super->y.HALF.HI = this->unk_72;
SetTile(0x4022, this->unk_76, super->collisionLayer);
SetBottomTile(0x4022, this->unk_76, super->collisionLayer);
}
void sub_080836DC(Entity* this, u32 unk_0, u32 unk_1) {
const struct_0811F680* tmp;
SetTile(0x4022, unk_1, this->collisionLayer);
SetBottomTile(0x4022, unk_1, this->collisionLayer);
this->timer = 7;
this->spriteSettings.draw = 1;
this->direction = (unk_0 << 3) ^ DirectionSouth;

View File

@ -74,38 +74,38 @@ void sub_0809E5F0(MacroAcornEntity* this) {
this->unk_80 = position;
switch (super->type) {
case 2:
SetTile(0x4022, position - 0x3d, 1);
SetTile(0x406d, position - 0x3c, 1);
SetBottomTile(0x4022, position - 0x3d, 1);
SetBottomTile(0x406d, position - 0x3c, 1);
case 0:
SetTile(0x406c, position - 0x42, 1);
SetTile(0x4022, position - 0x41, 1);
SetTile(0x4022, position - 0x40, 1);
SetTile(0x4022, position - 0x3f, 1);
SetTile(0x4022, position - 2, 1);
SetTile(0x4022, position - 1, 1);
SetTile(0x4022, position, 1);
SetTile(0x4022, position + 1, 1);
SetTile(0x406e, position + 0x3e, 1);
SetTile(0x4022, position + 0x3f, 1);
SetTile(0x4022, position + 0x40, 1);
SetTile(0x406f, position + 0x41, 1);
SetBottomTile(0x406c, position - 0x42, 1);
SetBottomTile(0x4022, position - 0x41, 1);
SetBottomTile(0x4022, position - 0x40, 1);
SetBottomTile(0x4022, position - 0x3f, 1);
SetBottomTile(0x4022, position - 2, 1);
SetBottomTile(0x4022, position - 1, 1);
SetBottomTile(0x4022, position, 1);
SetBottomTile(0x4022, position + 1, 1);
SetBottomTile(0x406e, position + 0x3e, 1);
SetBottomTile(0x4022, position + 0x3f, 1);
SetBottomTile(0x4022, position + 0x40, 1);
SetBottomTile(0x406f, position + 0x41, 1);
break;
case 3:
SetTile(0x4022, position - 0x44, 1);
SetTile(0x406c, position - 0x45, 1);
SetBottomTile(0x4022, position - 0x44, 1);
SetBottomTile(0x406c, position - 0x45, 1);
case 1:
SetTile(0x4022, position - 0x42, 1);
SetTile(0x4022, position - 0x41, 1);
SetTile(0x4022, position - 0x40, 1);
SetTile(0x406d, position - 0x3f, 1);
SetTile(0x4022, position - 2, 1);
SetTile(0x4022, position - 1, 1);
SetTile(0x4022, position, 1);
SetTile(0x4022, position + 1, 1);
SetTile(0x406e, position + 0x3e, 1);
SetTile(0x4022, position + 0x3f, 1);
SetTile(0x4022, position + 0x40, 1);
SetTile(0x406f, position + 0x41, 1);
SetBottomTile(0x4022, position - 0x42, 1);
SetBottomTile(0x4022, position - 0x41, 1);
SetBottomTile(0x4022, position - 0x40, 1);
SetBottomTile(0x406d, position - 0x3f, 1);
SetBottomTile(0x4022, position - 2, 1);
SetBottomTile(0x4022, position - 1, 1);
SetBottomTile(0x4022, position, 1);
SetBottomTile(0x4022, position + 1, 1);
SetBottomTile(0x406e, position + 0x3e, 1);
SetBottomTile(0x4022, position + 0x3f, 1);
SetBottomTile(0x4022, position + 0x40, 1);
SetBottomTile(0x406f, position + 0x41, 1);
break;
}
}

View File

@ -150,7 +150,7 @@ void sub_0809A958(MacroBookEntity* this) {
for (index = 0; index < 5; index++, tilePos += 0x40) {
for (index2 = 0; index2 < 4; index2++, tileIndexPtr++) {
if ((*tileIndexPtr & 0x4000) != 0) {
SetTile(*tileIndexPtr, tilePos + index2, 1);
SetBottomTile(*tileIndexPtr, tilePos + index2, 1);
}
}
}

View File

@ -87,7 +87,7 @@ void sub_08097EB8(MacroDecorationEntity* this) {
const s16* tilePosPtr;
u16 tile = COORD_TO_TILE(super);
for (tilePosPtr = tilePosArray; *tilePosPtr != 0x7fff; tilePosPtr += 2) {
SetTile((u16)tilePosPtr[1], tile + tilePosPtr[0], 1);
SetBottomTile((u16)tilePosPtr[1], tile + tilePosPtr[0], 1);
}
}

View File

@ -39,9 +39,9 @@ void MacroShoe_Init(Entity* this) {
this->action = 1;
this->hitbox = (Hitbox*)MacroShoe_TypeHitboxes[this->type];
if (this->type2 == 1) {
SetTile(0x4024, 0x410, 1);
SetTile(0x4026, 0x411, 1);
SetTile(0x4025, 0x412, 1);
SetBottomTile(0x4024, 0x410, 1);
SetBottomTile(0x4026, 0x411, 1);
SetBottomTile(0x4025, 0x412, 1);
}
}

View File

@ -74,7 +74,7 @@ void Mask_Init(MaskEntity* this) {
this->unk_7a = sub_080B1B44(this->unk_7e, 1);
SetTile(0x4022, this->unk_7e, 1);
SetBottomTile(0x4022, this->unk_7e, 1);
}
// Probably related to knocking it down
@ -99,7 +99,7 @@ void Mask_Action1(MaskEntity* this) {
}
// Presumably, make the mask fall
SetTile(this->unk_7c, this->unk_7e, 1);
SetBottomTile(this->unk_7c, this->unk_7e, 1);
sub_08000148(this->unk_7a, this->unk_7e, 1);

View File

@ -118,13 +118,13 @@ void sub_080A080C(MetalDoorEntity* this) {
this->unk_76 = GetTileIndex(this->unk_74 - 1, super->collisionLayer);
this->unk_78 = GetTileIndex(this->unk_74, super->collisionLayer);
this->unk_7a = GetTileIndex(this->unk_74 + 1, super->collisionLayer);
SetTile(0x4022, this->unk_74 - 1, super->collisionLayer);
SetTile(0x4022, this->unk_74, super->collisionLayer);
SetTile(0x4022, this->unk_74 + 1, super->collisionLayer);
SetBottomTile(0x4022, this->unk_74 - 1, super->collisionLayer);
SetBottomTile(0x4022, this->unk_74, super->collisionLayer);
SetBottomTile(0x4022, this->unk_74 + 1, super->collisionLayer);
}
void sub_080A0870(MetalDoorEntity* this) {
SetTile(this->unk_76, this->unk_74 - 1, super->collisionLayer);
SetTile(this->unk_78, this->unk_74, super->collisionLayer);
SetTile(this->unk_7a, this->unk_74 + 1, super->collisionLayer);
SetBottomTile(this->unk_76, this->unk_74 - 1, super->collisionLayer);
SetBottomTile(this->unk_78, this->unk_74, super->collisionLayer);
SetBottomTile(this->unk_7a, this->unk_74 + 1, super->collisionLayer);
}

View File

@ -59,7 +59,7 @@ void Minecart_Init(MinecartEntity* this) {
super->speed = 0x700;
super->spritePriority.b1 = 3;
InitAnimationForceUpdate(super, super->type2 + 4 + super->animationState);
SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
}
void Minecart_Action1(MinecartEntity* this) {
@ -163,9 +163,9 @@ void Minecart_Action3(MinecartEntity* this) {
super->subtimer = 60;
}
uVar3 = GetRelativeCollisionTile(super, gUnk_081223C8[super->animationState * 2],
gUnk_081223C8[super->animationState * 2 + 1]);
iVar2 = sub_08007DD6(uVar3, gUnk_081223D8[super->animationState]);
uVar3 = GetActTileRelative(super, gUnk_081223C8[super->animationState * 2],
gUnk_081223C8[super->animationState * 2 + 1]);
iVar2 = ActTileToTile(uVar3, gUnk_081223D8[super->animationState]);
if (iVar2 == 0) {
super->direction = DirectionTurnAround(super->direction);
super->animationState = AnimationStateFlip90(super->animationState);
@ -290,7 +290,7 @@ void Minecart_Action6(MinecartEntity* this) {
minecartData->room = gRoomControls.room;
minecartData->animationState = super->animationState;
InitAnimationForceUpdate(super, super->animationState + 0x10);
SetTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
} else {
UpdateAnimationSingleFrame(super);
gPlayerEntity.base.spritePriority.b0 = super->spritePriority.b0 - 1;

View File

@ -63,7 +63,7 @@ void MinecartDoor_Init(MinecartDoorEntity* this) {
} else {
super->action = 1;
super->spriteSettings.draw = 1;
SetTile(0x4022, this->unk_76, super->collisionLayer);
SetBottomTile(0x4022, this->unk_76, super->collisionLayer);
}
}
}
@ -73,7 +73,7 @@ void MinecartDoor_Action1(MinecartDoorEntity* this) {
super->action = 2;
super->timer = 7;
super->direction = super->type << 3;
SetTile(this->unk_74, this->unk_76, super->collisionLayer);
SetBottomTile(this->unk_74, this->unk_76, super->collisionLayer);
EnqueueSFX(SFX_10B);
}
}

View File

@ -83,7 +83,7 @@ void MinishVillageObject_Type1(Entity* this) {
this->subtimer = 0;
this->frameIndex = 0;
this->spritePriority.b0 = 7;
SetTile(0x4069, COORD_TO_TILE(this) - 0x40, 1);
SetBottomTile(0x4069, COORD_TO_TILE(this) - 0x40, 1);
break;
case 2:
if ((gRoomTransition.frameCount & 3U) == 0) {
@ -217,7 +217,7 @@ void MinishVillageObject_Type8_Init(Entity* this) {
if (this->type2 != 0) {
tilePosition -= 0x40;
}
SetTile(0x4069, tilePosition, this->collisionLayer);
SetBottomTile(0x4069, tilePosition, this->collisionLayer);
}
}
@ -230,7 +230,7 @@ void MinishVillageObject_Type8_Action1(Entity* this) {
this->timer = 8;
this->spriteRendering.alphaBlend = 0;
gScreen.controls.layerFXControl = 0;
SetTile(0x4069, COORD_TO_TILE(this), this->collisionLayer);
SetBottomTile(0x4069, COORD_TO_TILE(this), this->collisionLayer);
}
}
}

View File

@ -40,7 +40,7 @@ void Object30_Init(Object30Entity* this) {
const u16* ptr;
switch (super->type) {
case 0:
data = GetLayerByIndex(super->collisionLayer);
data = GetTileBuffer(super->collisionLayer);
ptr = &data->mapData[sub_0806F798(super)];
this->unk_6c = (u16*)ptr;
this->unk_68 = ptr[0];

View File

@ -34,7 +34,7 @@ void Object37(Entity* this) {
void Object37_Init(Object37Entity* this) {
u16* puVar1;
puVar1 = GetLayerByIndex(super->collisionLayer)->mapData + sub_0806F798(super);
puVar1 = GetTileBuffer(super->collisionLayer)->mapData + sub_0806F798(super);
this->unk78 = puVar1;
this->unk70 = *puVar1;
super->action = 1;

View File

@ -133,23 +133,23 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) {
if (this->unk7b & 0x80) {
this->unk7b &= ~0x80;
if ((this->unk7b & 0x40) != 0) {
SetTile(0x402c, this->tilePos - 1, super->collisionLayer);
SetTile(0x403d, this->tilePos + 1, super->collisionLayer);
SetBottomTile(0x402c, this->tilePos - 1, super->collisionLayer);
SetBottomTile(0x403d, this->tilePos + 1, super->collisionLayer);
} else {
SetTile(0x403d, this->tilePos - 1, super->collisionLayer);
SetTile(0x402d, this->tilePos + 1, super->collisionLayer);
SetBottomTile(0x403d, this->tilePos - 1, super->collisionLayer);
SetBottomTile(0x402d, this->tilePos + 1, super->collisionLayer);
}
} else if (this->unk7b & 0x40) {
if (xDist >= 5) {
this->unk7b &= ~(0x40 | 0x80);
SetTile(0x403d, this->tilePos - 1, super->collisionLayer);
SetTile(0x402d, this->tilePos + 1, super->collisionLayer);
SetBottomTile(0x403d, this->tilePos - 1, super->collisionLayer);
SetBottomTile(0x402d, this->tilePos + 1, super->collisionLayer);
}
} else {
if (-xDist > 4) {
this->unk7b |= 0x40;
SetTile(0x402c, this->tilePos - 1, super->collisionLayer);
SetTile(0x403d, this->tilePos + 1, super->collisionLayer);
SetBottomTile(0x402c, this->tilePos - 1, super->collisionLayer);
SetBottomTile(0x403d, this->tilePos + 1, super->collisionLayer);
}
}
}
@ -223,7 +223,7 @@ void sub_080931A4(ObjectBlockingStairsEntity* this, u32 param_2) {
for (index = 0, iVar5 = 0; index < 9; index++) {
u32 pos = tilePos + iVar5 + index - 1;
SetTile(pTileTypes[index], pos, collisionLayer);
SetBottomTile(pTileTypes[index], pos, collisionLayer);
switch (index) {
case 2:
iVar5 = 0x3d;

View File

@ -192,7 +192,7 @@ void sub_08097098(ObjectOnPillarEntity* this) {
u16 tileType;
this->unk_76 = 0x20;
EnqueueSFX(SFX_10F);
SetTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetBottomTile(this->tileIndex, this->tilePosition, super->collisionLayer);
tileType = GetTileType(gUnk_080B4488[super->direction >> 3] + this->tilePosition, super->collisionLayer);
if ((tileType == 0x79) || tileType == 0x77) {
super->spriteOffsetY = 2;
@ -202,7 +202,7 @@ void sub_08097098(ObjectOnPillarEntity* this) {
void sub_080970F4(ObjectOnPillarEntity* this) {
this->tilePosition = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tilePosition, super->collisionLayer);
SetTile(0x4036, this->tilePosition, super->collisionLayer);
SetBottomTile(0x4036, this->tilePosition, super->collisionLayer);
}
bool32 sub_08097144(ObjectOnPillarEntity* this) {
@ -255,7 +255,7 @@ void sub_080971E0(ObjectOnPillarEntity* this) {
super->action = 4;
super->frameIndex = 1;
super->spritePriority.b0 = 7;
SetTile(0, COORD_TO_TILE(super), super->collisionLayer);
SetBottomTile(0, COORD_TO_TILE(super), super->collisionLayer);
DeleteThisEntity();
break;
case 1:

View File

@ -152,7 +152,7 @@ void ObjectOnSpinyBeetle_Action2Subaction2(ObjectOnSpinyBeetleEntity* this) {
}
void ObjectOnSpinyBeetle_Action2Subaction3(ObjectOnSpinyBeetleEntity* this) {
switch (sub_080043E8(super)) {
switch (GetTileHazardType(super)) {
case 2:
CreateFx(super, FX_WATER_SPLASH, 0);
break;

View File

@ -22,7 +22,7 @@ void PalaceArchway_Init(Entity* this) {
this->frameIndex = this->type2;
this->spriteRendering.b3 = 3;
this->spritePriority.b0 = 7;
SetTile(0x4069, COORD_TO_TILE(this), this->collisionLayer);
SetBottomTile(0x4069, COORD_TO_TILE(this), this->collisionLayer);
}
void PalaceArchway_Action1(Entity* this) {

Some files were not shown because too many files have changed in this diff Show More