Skip to content

Commit

Permalink
Identify more map script labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Nov 19, 2023
1 parent 64061e2 commit 26a342b
Show file tree
Hide file tree
Showing 17 changed files with 101 additions and 102 deletions.
24 changes: 12 additions & 12 deletions engine/events/cinnabar_lab.asm
Original file line number Diff line number Diff line change
Expand Up @@ -52,40 +52,40 @@ GiveFossilToCinnabarLab::
ld a, b
ld [wFossilMon], a
call LoadFossilItemAndMonName
ld hl, LabFossil_610ae
ld hl, .ScientistSeesFossilText
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
jr nz, .cancelledGivingFossil
ld hl, LabFossil_610b3
ld hl, .ScientistTakesFossilText
call PrintText
ld a, [wFossilItem]
ldh [hItemToRemoveID], a
farcall RemoveItemByID
ld hl, LabFossil_610b8
ld hl, .GoForAWalkText
call PrintText
SetEvents EVENT_GAVE_FOSSIL_TO_LAB, EVENT_LAB_STILL_REVIVING_FOSSIL
ret
.cancelledGivingFossil
ld hl, LabFossil_610bd
ld hl, .ComeAgainText
call PrintText
ret

LabFossil_610ae:
text_far _Lab4Text_610ae
.ScientistSeesFossilText:
text_far _CinnabarLabFossilRoomScientist1SeesFossilText
text_end

LabFossil_610b3:
text_far _Lab4Text_610b3
.ScientistTakesFossilText:
text_far _CinnabarLabFossilRoomScientist1TakesFossilText
text_end

LabFossil_610b8:
text_far _Lab4Text_610b8
.GoForAWalkText:
text_far _CinnabarLabFossilRoomScientist1GoForAWalkText2
text_end

LabFossil_610bd:
text_far _Lab4Text_610bd
.ComeAgainText:
text_far _CinnabarLabFossilRoomScientist1ComeAgainText
text_end

PrintFossilsInBag:
Expand Down
22 changes: 11 additions & 11 deletions scripts/CeladonMartElevator.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ CeladonMartElevator_Script:
bit 5, [hl]
res 5, [hl]
push hl
call nz, CeladonMartElevatorScript_4861c
call nz, CeladonMartElevatorStoreWarpEntriesScript
pop hl
bit 7, [hl]
res 7, [hl]
call nz, CeladonMartElevatorScript_48654
call nz, CeladonMartElevatorShakeScript
xor a
ld [wAutoTextBoxDrawingControl], a
inc a
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ret

CeladonMartElevatorScript_4861c:
CeladonMartElevatorStoreWarpEntriesScript:
ld hl, wWarpEntries
ld a, [wWarpedFromWhichWarp]
ld b, a
ld a, [wWarpedFromWhichMap]
ld c, a
call CeladonMartElevatorScript_4862a

CeladonMartElevatorScript_4862a:
call .StoreWarpEntry
; fallthrough
.StoreWarpEntry:
inc hl
inc hl
ld a, b
Expand All @@ -31,12 +31,12 @@ CeladonMartElevatorScript_4862a:
ld [hli], a
ret

CeladonMartElevatorScript_48631:
CeladonMartElevatorCopyWarpMapsScript:
ld hl, CeladonMartElevatorFloors
call LoadItemList
ld hl, CeladonMartElevatorWarpMaps
ld de, wElevatorWarpMaps
ld bc, CeladonMartElevatorWarpMapsEnd - CeladonMartElevatorWarpMaps
ld bc, CeladonMartElevatorWarpMaps.End - CeladonMartElevatorWarpMaps
jp CopyData

CeladonMartElevatorFloors:
Expand All @@ -56,9 +56,9 @@ CeladonMartElevatorWarpMaps:
db 2, CELADON_MART_3F
db 2, CELADON_MART_4F
db 2, CELADON_MART_5F
CeladonMartElevatorWarpMapsEnd:
.End:

CeladonMartElevatorScript_48654:
CeladonMartElevatorShakeScript:
farjp ShakeElevator

CeladonMartElevator_TextPointers:
Expand All @@ -67,7 +67,7 @@ CeladonMartElevator_TextPointers:

CeladonMartElevatorText:
text_asm
call CeladonMartElevatorScript_48631
call CeladonMartElevatorCopyWarpMapsScript
ld hl, CeladonMartElevatorWarpMaps
predef DisplayElevatorFloorMenu
jp TextScriptEnd
10 changes: 5 additions & 5 deletions scripts/CeruleanBadgeHouse.asm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CeruleanBadgeHouseMiddleAgedManText:
xor a
ld [wCurrentMenuItem], a
ld [wListScrollOffset], a
.asm_74e23
.loop
ld hl, .WhichBadgeText
call PrintText
ld hl, .BadgeItemList
Expand All @@ -32,7 +32,7 @@ CeruleanBadgeHouseMiddleAgedManText:
ld a, SPECIALLISTMENU
ld [wListMenuID], a
call DisplayListMenuID
jr c, .asm_74e60
jr c, .done
ld hl, CeruleanBadgeHouseBadgeTextPointers
ld a, [wcf91]
sub BOULDERBADGE
Expand All @@ -44,8 +44,8 @@ CeruleanBadgeHouseMiddleAgedManText:
ld h, [hl]
ld l, a
call PrintText
jr .asm_74e23
.asm_74e60
jr .loop
.done
xor a
ld [wListScrollOffset], a
ld hl, .VisitAnyTimeText
Expand All @@ -54,7 +54,7 @@ CeruleanBadgeHouseMiddleAgedManText:

.BadgeItemList:
table_width 1, .BadgeItemList
db NUM_BADGES
db NUM_BADGES ; #
db BOULDERBADGE
db CASCADEBADGE
db THUNDERBADGE
Expand Down
12 changes: 6 additions & 6 deletions scripts/CeruleanCity.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CeruleanCity_Script:
ld a, [wCeruleanCityCurScript]
jp CallFunctionInTable

CeruleanCityScript_1948c:
CeruleanCityClearScripts:
xor a ; SCRIPT_CERULEANCITY_DEFAULT
ld [wJoyIgnore], a
ld [wCeruleanCityCurScript], a
Expand All @@ -23,7 +23,7 @@ CeruleanCity_ScriptPointers:
CeruleanCityRocketDefeatedScript:
ld a, [wIsInBattle]
cp $ff
jp z, CeruleanCityScript_1948c
jp z, CeruleanCityClearScripts
ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
SetEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF
Expand Down Expand Up @@ -117,7 +117,7 @@ CeruleanCityMovement1:
db NPC_MOVEMENT_DOWN
db -1 ; end

CeruleanCityScript_1955d:
CeruleanCityFaceRivalScript:
ld a, CERULEANCITY_RIVAL
ldh [hSpriteIndex], a
xor a ; SPRITE_FACING_DOWN
Expand Down Expand Up @@ -160,16 +160,16 @@ CeruleanCityRivalBattleScript:

xor a
ldh [hJoyHeld], a
call CeruleanCityScript_1955d
call CeruleanCityFaceRivalScript
ld a, SCRIPT_CERULEANCITY_RIVAL_DEFEATED
ld [wCeruleanCityCurScript], a
ret

CeruleanCityRivalDefeatedScript:
ld a, [wIsInBattle]
cp $ff
jp z, CeruleanCityScript_1948c
call CeruleanCityScript_1955d
jp z, CeruleanCityClearScripts
call CeruleanCityFaceRivalScript
ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
SetEvent EVENT_BEAT_CERULEAN_RIVAL
Expand Down
12 changes: 6 additions & 6 deletions scripts/ChampionsRoom.asm
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ ChampionsRoomRivalDefeatedScript:
ld [wJoyIgnore], a
ld a, TEXT_CHAMPIONSROOM_RIVAL
ldh [hSpriteIndexOrTextID], a
call RivalScript_760c8
call ChampionsRoom_DisplayTextID_AllowABSelectStart
ld a, CHAMPIONSROOM_RIVAL
ldh [hSpriteIndex], a
call SetSpriteMovementBytesToFF
Expand All @@ -112,7 +112,7 @@ ChampionsRoomOakArrivesScript:
farcall Music_Cities1AlternateTempo
ld a, TEXT_CHAMPIONSROOM_OAK
ldh [hSpriteIndexOrTextID], a
call RivalScript_760c8
call ChampionsRoom_DisplayTextID_AllowABSelectStart
ld a, CHAMPIONSROOM_OAK
ldh [hSpriteIndex], a
call SetSpriteMovementBytesToFF
Expand Down Expand Up @@ -153,7 +153,7 @@ ChampionsRoomOakCongratulatesPlayerScript:
call SetSpriteFacingDirectionAndDelay
ld a, TEXT_CHAMPIONSROOM_OAK_CONGRATULATES_PLAYER
ldh [hSpriteIndexOrTextID], a
call RivalScript_760c8
call ChampionsRoom_DisplayTextID_AllowABSelectStart
ld a, SCRIPT_CHAMPIONSROOM_OAK_DISAPPOINTED_WITH_RIVAL
ld [wChampionsRoomCurScript], a
ret
Expand All @@ -166,7 +166,7 @@ ChampionsRoomOakDisappointedWithRivalScript:
call SetSpriteFacingDirectionAndDelay
ld a, TEXT_CHAMPIONSROOM_OAK_DISAPPOINTED_WITH_RIVAL
ldh [hSpriteIndexOrTextID], a
call RivalScript_760c8
call ChampionsRoom_DisplayTextID_AllowABSelectStart
ld a, SCRIPT_CHAMPIONSROOM_OAK_COME_WITH_ME
ld [wChampionsRoomCurScript], a
ret
Expand All @@ -179,7 +179,7 @@ ChampionsRoomOakComeWithMeScript:
call SetSpriteFacingDirectionAndDelay
ld a, TEXT_CHAMPIONSROOM_OAK_COME_WITH_ME
ldh [hSpriteIndexOrTextID], a
call RivalScript_760c8
call ChampionsRoom_DisplayTextID_AllowABSelectStart
ld de, OakExitChampionsRoomMovement
ld a, CHAMPIONSROOM_OAK
ldh [hSpriteIndex], a
Expand Down Expand Up @@ -232,7 +232,7 @@ ChampionsRoomCleanupScript:
ld [wChampionsRoomCurScript], a
ret

RivalScript_760c8:
ChampionsRoom_DisplayTextID_AllowABSelectStart:
ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
call DisplayTextID
Expand Down
6 changes: 3 additions & 3 deletions scripts/CinnabarGym.asm
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ CinnabarGymGetOpponentTextScript:

CinnabarGymFlagAction:
predef_jump FlagActionPredef

; fallthrough
CinnabarGymOpenGateScript:
ld a, [wIsInBattle]
cp $ff
Expand All @@ -107,12 +107,12 @@ CinnabarGymOpenGateScript:
call CinnabarGymFlagAction
ld a, c
and a
jr nz, .asm_7581b
jr nz, .no_sound
call WaitForSoundToFinish
ld a, SFX_GO_INSIDE
call PlaySound
call WaitForSoundToFinish
.asm_7581b
.no_sound
ld a, [wTrainerHeaderFlagBit]
ldh [hGymGateIndex], a
AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2
Expand Down
9 changes: 4 additions & 5 deletions scripts/FightingDojo.asm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FightingDojo_Script:
ld [wFightingDojoCurScript], a
ret

FightingDojoScript_5cd70:
FightingDojoResetScripts:
xor a ; SCRIPT_FIGHTINGDOJO_DEFAULT
ld [wJoyIgnore], a
ld [wFightingDojoCurScript], a
Expand Down Expand Up @@ -56,19 +56,18 @@ FightingDojoDefaultScript:
FightingDojoKarateMasterPostBattleScript:
ld a, [wIsInBattle]
cp $ff
jp z, FightingDojoScript_5cd70
jp z, FightingDojoResetScripts
ld a, [wcf0d]
and a
jr z, .asm_5cde4
jr z, .already_facing
ld a, PLAYER_DIR_RIGHT
ld [wPlayerMovingDirection], a
ld a, FIGHTINGDOJO_KARATE_MASTER
ldh [hSpriteIndex], a
ld a, SPRITE_FACING_LEFT
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay

.asm_5cde4
.already_facing
ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
SetEventRange EVENT_BEAT_KARATE_MASTER, EVENT_BEAT_FIGHTING_DOJO_TRAINER_3
Expand Down
24 changes: 12 additions & 12 deletions scripts/GameCorner.asm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ GameCornerSelectLuckySlotMachine:
call Random
ldh a, [hRandomAdd]
cp $7
jr nc, .asm_48be2
jr nc, .not_max
ld a, $8
.asm_48be2
.not_max
srl a
srl a
srl a
Expand Down Expand Up @@ -63,26 +63,26 @@ GameCornerRocketBattleScript:
ld a, GAMECORNER_ROCKET
ldh [hSpriteIndex], a
call SetSpriteMovementBytesToFF
ld de, GameCornerMovement_Grunt_WalkAroundPlayer
ld de, GameCornerMovement_Rocket_WalkAroundPlayer
ld a, [wYCoord]
cp 6
jr nz, .asm_48c43
ld de, GameCornerMovement_Grunt_WalkDirect
jr .asm_48c4d
.asm_48c43
jr nz, .not_direct_movement
ld de, GameCornerMovement_Rocket_WalkDirect
jr .got_rocket_movement
.not_direct_movement
ld a, [wXCoord]
cp 8
jr nz, .asm_48c4d
ld de, GameCornerMovement_Grunt_WalkDirect
.asm_48c4d
jr nz, .got_rocket_movement
ld de, GameCornerMovement_Rocket_WalkDirect
.got_rocket_movement
ld a, GAMECORNER_ROCKET
ldh [hSpriteIndex], a
call MoveSprite
ld a, SCRIPT_GAMECORNER_ROCKET_EXIT
ld [wGameCornerCurScript], a
ret

GameCornerMovement_Grunt_WalkAroundPlayer:
GameCornerMovement_Rocket_WalkAroundPlayer:
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
Expand All @@ -93,7 +93,7 @@ GameCornerMovement_Grunt_WalkAroundPlayer:
db NPC_MOVEMENT_RIGHT
db -1 ; end

GameCornerMovement_Grunt_WalkDirect:
GameCornerMovement_Rocket_WalkDirect:
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
Expand Down
Loading

0 comments on commit 26a342b

Please sign in to comment.