Skip to content

Commit

Permalink
Name unnamed labels in seafoam islands and pokemon mansion script fil…
Browse files Browse the repository at this point in the history
…es (#435)

* Update PokemonMansion1F.asm

* Name unnamed seafoam/mansion labels
  • Loading branch information
Vortyne authored Nov 19, 2023
1 parent 4ac6f54 commit 5739aea
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 105 deletions.
2 changes: 1 addition & 1 deletion engine/overworld/push_boulder.asm
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ DoBoulderDustAnimation::
call DiscardButtonPresses
ld [wJoyIgnore], a
call ResetBoulderPushFlags
set 7, [hl]
set 7, [hl] ; [wFlags_0xcd60]
ld a, [wBoulderSpriteIndex]
ldh [hSpriteIndex], a
call GetSpriteMovementByte2Pointer
Expand Down
28 changes: 14 additions & 14 deletions scripts/PokemonMansion1F.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PokemonMansion1F_Script:
call Mansion1Subscript1
call Mansion1CheckReplaceSwitchDoorBlocks
call EnableAutoTextBoxDrawing
ld hl, Mansion1TrainerHeaders
ld de, PokemonMansion1F_ScriptPointers
Expand All @@ -8,37 +8,37 @@ PokemonMansion1F_Script:
ld [wPokemonMansion1FCurScript], a
ret

Mansion1Subscript1:
Mansion1CheckReplaceSwitchDoorBlocks:
ld hl, wCurrentMapScriptFlags
bit 5, [hl]
res 5, [hl]
ret z
CheckEvent EVENT_MANSION_SWITCH_ON
jr nz, .asm_442ec
jr nz, .switchTurnedOn
lb bc, 6, 12
call Mansion1Script_4430b
call Mansion1LoadEmptyFloorTileBlock
lb bc, 3, 8
call Mansion1Script_44304
call Mansion1LoadHorizontalGateBlock
lb bc, 8, 10
call Mansion1Script_44304
call Mansion1LoadHorizontalGateBlock
lb bc, 13, 13
jp Mansion1Script_44304
.asm_442ec
jp Mansion1LoadHorizontalGateBlock
.switchTurnedOn
lb bc, 6, 12
call Mansion1Script_44304
call Mansion1LoadHorizontalGateBlock
lb bc, 3, 8
call Mansion1Script_4430b
call Mansion1LoadEmptyFloorTileBlock
lb bc, 8, 10
call Mansion1Script_4430b
call Mansion1LoadEmptyFloorTileBlock
lb bc, 13, 13
jp Mansion1Script_4430b
jp Mansion1LoadEmptyFloorTileBlock

Mansion1Script_44304:
Mansion1LoadHorizontalGateBlock:
ld a, $2d
ld [wNewTileBlockID], a
jr Mansion1ReplaceBlock

Mansion1Script_4430b:
Mansion1LoadEmptyFloorTileBlock:
ld a, $e
ld [wNewTileBlockID], a
Mansion1ReplaceBlock:
Expand Down
22 changes: 11 additions & 11 deletions scripts/PokemonMansion2F.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PokemonMansion2F_Script:
call Mansion2Script_51fee
call Mansion2CheckReplaceSwitchDoorBlocks
call EnableAutoTextBoxDrawing
ld hl, Mansion2TrainerHeaders
ld de, PokemonMansion2F_ScriptPointers
Expand All @@ -8,36 +8,36 @@ PokemonMansion2F_Script:
ld [wPokemonMansion2FCurScript], a
ret

Mansion2Script_51fee:
Mansion2CheckReplaceSwitchDoorBlocks:
ld hl, wCurrentMapScriptFlags
bit 5, [hl]
res 5, [hl]
ret z
CheckEvent EVENT_MANSION_SWITCH_ON
jr nz, .asm_52016
jr nz, .switchTurnedOn
ld a, $e
lb bc, 2, 4
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ld a, $54
lb bc, 4, 9
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ld a, $5f
lb bc, 11, 3
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ret
.asm_52016
.switchTurnedOn
ld a, $5f
lb bc, 2, 4
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ld a, $e
lb bc, 4, 9
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ld a, $e
lb bc, 11, 3
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ret

Mansion2Script_5202f:
Mansion2ReplaceBlock:
ld [wNewTileBlockID], a
predef_jump ReplaceTileBlock

Expand Down
24 changes: 12 additions & 12 deletions scripts/PokemonMansion3F.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PokemonMansion3F_Script:
call Mansion3Script_52204
call Mansion3CheckReplaceSwitchDoorBlocks
call EnableAutoTextBoxDrawing
ld hl, Mansion3TrainerHeaders
ld de, PokemonMansion3F_ScriptPointers
Expand All @@ -8,27 +8,27 @@ PokemonMansion3F_Script:
ld [wPokemonMansion3FCurScript], a
ret

Mansion3Script_52204:
Mansion3CheckReplaceSwitchDoorBlocks:
ld hl, wCurrentMapScriptFlags
bit 5, [hl]
res 5, [hl]
ret z
CheckEvent EVENT_MANSION_SWITCH_ON
jr nz, .asm_52224
jr nz, .switchTurnedOn
ld a, $e
lb bc, 2, 7
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ld a, $5f
lb bc, 5, 7
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ret
.asm_52224
.switchTurnedOn
ld a, $5f
lb bc, 2, 7
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ld a, $e
lb bc, 5, 7
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ret

PokemonMansion3F_ScriptPointers:
Expand All @@ -38,8 +38,8 @@ PokemonMansion3F_ScriptPointers:
dw_const EndTrainerBattle, SCRIPT_POKEMONMANSION3F_END_BATTLE

PokemonMansion3FDefaultScript:
ld hl, CoordsData_52254
call Mansion3Script_5225b
ld hl, .holeCoords
call .isPlayerFallingDownHole
ld a, [wWhichDungeonWarp]
and a
jp z, CheckFightingMapTrainers
Expand All @@ -51,13 +51,13 @@ PokemonMansion3FDefaultScript:
ld [wDungeonWarpDestinationMap], a
ret

CoordsData_52254:
.holeCoords:
dbmapcoord 16, 14
dbmapcoord 17, 14
dbmapcoord 19, 14
db -1 ; end

Mansion3Script_5225b:
.isPlayerFallingDownHole:
xor a
ld [wWhichDungeonWarp], a
ld a, [wd72d]
Expand Down
24 changes: 12 additions & 12 deletions scripts/PokemonMansionB1F.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PokemonMansionB1F_Script:
call Mansion4Script_523cf
call MansionB1FCheckReplaceSwitchDoorBlocks
call EnableAutoTextBoxDrawing
ld hl, Mansion4TrainerHeaders
ld de, PokemonMansionB1F_ScriptPointers
Expand All @@ -8,39 +8,39 @@ PokemonMansionB1F_Script:
ld [wPokemonMansionB1FCurScript], a
ret

Mansion4Script_523cf:
MansionB1FCheckReplaceSwitchDoorBlocks:
ld hl, wCurrentMapScriptFlags
bit 5, [hl]
res 5, [hl]
ret z
CheckEvent EVENT_MANSION_SWITCH_ON
jr nz, .asm_523ff
jr nz, .switchTurnedOn
ld a, $e
ld bc, $80d
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ld a, $e
ld bc, $b06
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ld a, $5f
ld bc, $304
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ld a, $54
ld bc, $808
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ret
.asm_523ff
.switchTurnedOn
ld a, $2d
ld bc, $80d
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ld a, $5f
ld bc, $b06
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ld a, $e
ld bc, $304
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ld a, $e
ld bc, $808
call Mansion2Script_5202f
call Mansion2ReplaceBlock
ret

Mansion4Script_Switches::
Expand Down
12 changes: 6 additions & 6 deletions scripts/SeafoamIslands1F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@ SeafoamIslands1F_Script:
ld hl, wFlags_0xcd60
bit 7, [hl]
res 7, [hl]
jr z, .asm_4483b
jr z, .noBoulderWasPushed
ld hl, Seafoam1HolesCoords
call CheckBoulderCoords
ret nc
EventFlagAddress hl, EVENT_SEAFOAM1_BOULDER1_DOWN_HOLE
ld a, [wCoordIndex]
cp $1
jr nz, .asm_44819
jr nz, .boulder2FellDownHole
SetEventReuseHL EVENT_SEAFOAM1_BOULDER1_DOWN_HOLE
ld a, HS_SEAFOAM_ISLANDS_1F_BOULDER_1
ld [wObjectToHide], a
ld a, HS_SEAFOAM_ISLANDS_B1F_BOULDER_1
ld [wObjectToShow], a
jr .asm_44825
.asm_44819
jr .hideAndShowBoulderObjects
.boulder2FellDownHole
SetEventAfterBranchReuseHL EVENT_SEAFOAM1_BOULDER2_DOWN_HOLE, EVENT_SEAFOAM1_BOULDER1_DOWN_HOLE
ld a, HS_SEAFOAM_ISLANDS_1F_BOULDER_2
ld [wObjectToHide], a
ld a, HS_SEAFOAM_ISLANDS_B1F_BOULDER_2
ld [wObjectToShow], a
.asm_44825
.hideAndShowBoulderObjects
ld a, [wObjectToHide]
ld [wMissableObjectIndex], a
predef HideObject
ld a, [wObjectToShow]
ld [wMissableObjectIndex], a
predef_jump ShowObject
.asm_4483b
.noBoulderWasPushed
ld a, SEAFOAM_ISLANDS_B1F
ld [wDungeonWarpDestinationMap], a
ld hl, Seafoam1HolesCoords
Expand Down
12 changes: 6 additions & 6 deletions scripts/SeafoamIslandsB1F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@ SeafoamIslandsB1F_Script:
ld hl, wFlags_0xcd60
bit 7, [hl]
res 7, [hl]
jr z, .asm_46362
jr z, .noBoulderWasPushed
ld hl, Seafoam2HolesCoords
call CheckBoulderCoords
ret nc
EventFlagAddress hl, EVENT_SEAFOAM2_BOULDER1_DOWN_HOLE
ld a, [wCoordIndex]
cp $1
jr nz, .asm_46340
jr nz, .boulder2FellDownHole
SetEventReuseHL EVENT_SEAFOAM2_BOULDER1_DOWN_HOLE
ld a, HS_SEAFOAM_ISLANDS_B1F_BOULDER_1
ld [wObjectToHide], a
ld a, HS_SEAFOAM_ISLANDS_B2F_BOULDER_1
ld [wObjectToShow], a
jr .asm_4634c
.asm_46340
jr .hideAndShowBoulderObjects
.boulder2FellDownHole
SetEventAfterBranchReuseHL EVENT_SEAFOAM2_BOULDER2_DOWN_HOLE, EVENT_SEAFOAM2_BOULDER1_DOWN_HOLE
ld a, HS_SEAFOAM_ISLANDS_B1F_BOULDER_2
ld [wObjectToHide], a
ld a, HS_SEAFOAM_ISLANDS_B2F_BOULDER_2
ld [wObjectToShow], a
.asm_4634c
.hideAndShowBoulderObjects
ld a, [wObjectToHide]
ld [wMissableObjectIndex], a
predef HideObject
ld a, [wObjectToShow]
ld [wMissableObjectIndex], a
predef_jump ShowObject
.asm_46362
.noBoulderWasPushed
ld a, SEAFOAM_ISLANDS_B2F
ld [wDungeonWarpDestinationMap], a
ld hl, Seafoam2HolesCoords
Expand Down
12 changes: 6 additions & 6 deletions scripts/SeafoamIslandsB2F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@ SeafoamIslandsB2F_Script:
ld hl, wFlags_0xcd60
bit 7, [hl]
res 7, [hl]
jr z, .asm_4649e
jr z, .noBoulderWasPushed
ld hl, Seafoam3HolesCoords
call CheckBoulderCoords
ret nc
EventFlagAddress hl, EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE
ld a, [wCoordIndex]
cp $1
jr nz, .asm_4647c
jr nz, .boulder2FellDownHole
SetEventReuseHL EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE
ld a, HS_SEAFOAM_ISLANDS_B2F_BOULDER_1
ld [wObjectToHide], a
ld a, HS_SEAFOAM_ISLANDS_B3F_BOULDER_3
ld [wObjectToShow], a
jr .asm_46488
.asm_4647c
jr .hideAndShowBoulderObjects
.boulder2FellDownHole
SetEventAfterBranchReuseHL EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE
ld a, HS_SEAFOAM_ISLANDS_B2F_BOULDER_2
ld [wObjectToHide], a
ld a, HS_SEAFOAM_ISLANDS_B3F_BOULDER_4
ld [wObjectToShow], a
.asm_46488
.hideAndShowBoulderObjects
ld a, [wObjectToHide]
ld [wMissableObjectIndex], a
predef HideObject
ld a, [wObjectToShow]
ld [wMissableObjectIndex], a
predef_jump ShowObject
.asm_4649e
.noBoulderWasPushed
ld a, SEAFOAM_ISLANDS_B3F
ld [wDungeonWarpDestinationMap], a
ld hl, Seafoam3HolesCoords
Expand Down
Loading

0 comments on commit 5739aea

Please sign in to comment.