shithub: pokecrystal

Download patch

ref: e4d82e92d0ce9742278c67e9288e523ccfb24911
parent: 1f9e688b76c90403d14f1ab68b47b0e7d1df24c6
author: Rangi <[email protected]>
date: Tue Jun 8 16:35:04 EDT 2021

Rename `prioritysjump` to `sdefer`

--- a/docs/event_commands.md
+++ b/docs/event_commands.md
@@ -470,7 +470,7 @@
 ## `$8C`: <code>deactivatefacing <i>length</i></code>
 
 
-## `$8D`: <code>prioritysjump <i>script</i></code>
+## `$8D`: <code>sdefer <i>script</i></code>
 
 
 ## `$8E`: `warpcheck`
--- a/engine/overworld/events.asm
+++ b/engine/overworld/events.asm
@@ -436,11 +436,11 @@
 	bit 3, [hl]
 	jr z, .nope
 
-	ld hl, wPriorityScriptAddr
+	ld hl, wDeferredScriptAddr
 	ld a, [hli]
 	ld h, [hl]
 	ld l, a
-	ld a, [wPriorityScriptBank]
+	ld a, [wDeferredScriptBank]
 	call CallScript
 	scf
 	ret
--- a/engine/overworld/scripting.asm
+++ b/engine/overworld/scripting.asm
@@ -205,7 +205,7 @@
 	dw Script_newloadmap                 ; 8a
 	dw Script_pause                      ; 8b
 	dw Script_deactivatefacing           ; 8c
-	dw Script_prioritysjump              ; 8d
+	dw Script_sdefer                     ; 8d
 	dw Script_warpcheck                  ; 8e
 	dw Script_stopandsjump               ; 8f
 	dw Script_endcallback                ; 90
@@ -1388,13 +1388,13 @@
 	ld [wScriptPos + 1], a
 	ret
 
-Script_prioritysjump:
+Script_sdefer:
 	ld a, [wScriptBank]
-	ld [wPriorityScriptBank], a
+	ld [wDeferredScriptBank], a
 	call GetScriptByte
-	ld [wPriorityScriptAddr], a
+	ld [wDeferredScriptAddr], a
 	call GetScriptByte
-	ld [wPriorityScriptAddr + 1], a
+	ld [wDeferredScriptAddr + 1], a
 	ld hl, wScriptFlags
 	set 3, [hl]
 	ret
--- a/macros/legacy.asm
+++ b/macros/legacy.asm
@@ -119,7 +119,8 @@
 
 jump           EQUS "sjump"
 farjump        EQUS "farsjump"
-priorityjump   EQUS "prioritysjump"
+priorityjump   EQUS "sdefer"
+prioritysjump  EQUS "sdefer"
 ptcall         EQUS "memcall"
 ptjump         EQUS "memjump"
 ptpriorityjump EQUS "stopandsjump"
--- a/macros/scripts/events.asm
+++ b/macros/scripts/events.asm
@@ -883,9 +883,9 @@
 	db \1 ; time
 ENDM
 
-	const prioritysjump_command ; $8d
-prioritysjump: MACRO
-	db prioritysjump_command
+	const sdefer_command ; $8d
+sdefer: MACRO
+	db sdefer_command
 	dw \1 ; pointer
 ENDM
 
--- a/maps/BattleTower1F.asm
+++ b/maps/BattleTower1F.asm
@@ -26,11 +26,11 @@
 	writetext Text_WeveBeenWaitingForYou
 	waitbutton
 	closetext
-	prioritysjump Script_ResumeBattleTowerChallenge
+	sdefer Script_ResumeBattleTowerChallenge
 	end
 
 .LeftWithoutSaving
-	prioritysjump BattleTower_LeftWithoutSaving
+	sdefer BattleTower_LeftWithoutSaving
 	setval BATTLETOWERACTION_CHALLENGECANCELED
 	special BattleTowerAction
 	setval BATTLETOWERACTION_06
--- a/maps/BattleTowerBattleRoom.asm
+++ b/maps/BattleTowerBattleRoom.asm
@@ -11,7 +11,7 @@
 
 .EnterBattleRoom:
 	disappear BATTLETOWERBATTLEROOM_YOUNGSTER
-	prioritysjump Script_BattleRoom
+	sdefer Script_BattleRoom
 	setscene SCENE_FINISHED
 .DummyScene:
 	end
--- a/maps/BattleTowerElevator.asm
+++ b/maps/BattleTowerElevator.asm
@@ -9,7 +9,7 @@
 	def_callbacks
 
 .Scene0:
-	prioritysjump .RideElevator
+	sdefer .RideElevator
 	setscene SCENE_FINISHED
 .Scene1:
 	end
--- a/maps/BattleTowerHallway.asm
+++ b/maps/BattleTowerHallway.asm
@@ -9,7 +9,7 @@
 	def_callbacks
 
 .Scene0:
-	prioritysjump .ChooseBattleRoom
+	sdefer .ChooseBattleRoom
 	setscene SCENE_FINISHED
 .Scene1:
 	end
--- a/maps/BrunosRoom.asm
+++ b/maps/BrunosRoom.asm
@@ -10,7 +10,7 @@
 	callback MAPCALLBACK_TILES, .BrunosRoomDoors
 
 .LockDoor:
-	prioritysjump .BrunosDoorLocksBehindYou
+	sdefer .BrunosDoorLocksBehindYou
 	end
 
 .DummyScene:
--- a/maps/BurnedTower1F.asm
+++ b/maps/BurnedTower1F.asm
@@ -15,7 +15,7 @@
 	callback MAPCALLBACK_TILES, .HoleAndLadder
 
 .EusineScene:
-	prioritysjump .MeetEusine
+	sdefer .MeetEusine
 	end
 
 .DummyScene1:
--- a/maps/CeruleanGym.asm
+++ b/maps/CeruleanGym.asm
@@ -17,7 +17,7 @@
 	end
 
 .GruntRunsOut:
-	prioritysjump .GruntRunsOutScript
+	sdefer .GruntRunsOutScript
 	end
 
 .GruntRunsOutScript:
--- a/maps/Colosseum.asm
+++ b/maps/Colosseum.asm
@@ -13,7 +13,7 @@
 	callback MAPCALLBACK_NEWMAP, .PreparePokecenter2F
 
 .InitializeColosseum:
-	prioritysjump .InitializeAndPreparePokecenter2F
+	sdefer .InitializeAndPreparePokecenter2F
 	end
 
 .DummyScene1:
--- a/maps/DragonShrine.asm
+++ b/maps/DragonShrine.asm
@@ -12,7 +12,7 @@
 	def_callbacks
 
 .DragonShrineTest:
-	prioritysjump .DragonShrineTestScript
+	sdefer .DragonShrineTestScript
 	end
 
 .DummyScene:
--- a/maps/EcruteakGym.asm
+++ b/maps/EcruteakGym.asm
@@ -15,7 +15,7 @@
 	def_callbacks
 
 .ForcedToLeave:
-	prioritysjump EcruteakGymClosed
+	sdefer EcruteakGymClosed
 	end
 
 .DummyScene:
--- a/maps/EcruteakPokecenter1F.asm
+++ b/maps/EcruteakPokecenter1F.asm
@@ -13,7 +13,7 @@
 	def_callbacks
 
 .MeetBill:
-	prioritysjump .BillActivatesTimeCapsule
+	sdefer .BillActivatesTimeCapsule
 	end
 
 .DummyScene:
--- a/maps/ElmsLab.asm
+++ b/maps/ElmsLab.asm
@@ -19,7 +19,7 @@
 	callback MAPCALLBACK_OBJECTS, .MoveElmCallback
 
 .MeetElm:
-	prioritysjump .WalkUpToElm
+	sdefer .WalkUpToElm
 	end
 
 .DummyScene1:
--- a/maps/FastShip1F.asm
+++ b/maps/FastShip1F.asm
@@ -16,7 +16,7 @@
 	end
 
 .EnterFastShip:
-	prioritysjump .EnterFastShipScript
+	sdefer .EnterFastShipScript
 	end
 
 .DummyScene2:
--- a/maps/HallOfFame.asm
+++ b/maps/HallOfFame.asm
@@ -9,7 +9,7 @@
 	def_callbacks
 
 .EnterHallOfFame:
-	prioritysjump .EnterHallOfFameScript
+	sdefer .EnterHallOfFameScript
 	end
 
 .DummyScene:
--- a/maps/KarensRoom.asm
+++ b/maps/KarensRoom.asm
@@ -10,7 +10,7 @@
 	callback MAPCALLBACK_TILES, .KarensRoomDoors
 
 .LockDoor:
-	prioritysjump .KarensDoorLocksBehindYou
+	sdefer .KarensDoorLocksBehindYou
 	end
 
 .DummyScene:
--- a/maps/KogasRoom.asm
+++ b/maps/KogasRoom.asm
@@ -10,7 +10,7 @@
 	callback MAPCALLBACK_TILES, .KogasRoomDoors
 
 .LockDoor:
-	prioritysjump .KogasDoorLocksBehindYou
+	sdefer .KogasDoorLocksBehindYou
 	end
 
 .DummyScene:
--- a/maps/LancesRoom.asm
+++ b/maps/LancesRoom.asm
@@ -12,7 +12,7 @@
 	callback MAPCALLBACK_TILES, .LancesRoomDoors
 
 .LockDoor:
-	prioritysjump .LancesDoorLocksBehindYou
+	sdefer .LancesDoorLocksBehindYou
 	end
 
 .DummyScene:
--- a/maps/MahoganyMart1F.asm
+++ b/maps/MahoganyMart1F.asm
@@ -17,7 +17,7 @@
 	end
 
 .LanceUncoversStaircase:
-	prioritysjump MahoganyMart1FLanceUncoversStaircaseScript
+	sdefer MahoganyMart1FLanceUncoversStaircaseScript
 	end
 
 .MahoganyMart1FStaircase:
--- a/maps/MobileBattleRoom.asm
+++ b/maps/MobileBattleRoom.asm
@@ -6,7 +6,7 @@
 	def_callbacks
 
 .InitializeMobileBattleRoom:
-	prioritysjump .InitializeAndPreparePokecenter2F
+	sdefer .InitializeAndPreparePokecenter2F
 	end
 
 .DummyScene:
--- a/maps/MobileTradeRoom.asm
+++ b/maps/MobileTradeRoom.asm
@@ -6,7 +6,7 @@
 	def_callbacks
 
 .InitializeMobileTradeRoom:
-	prioritysjump .InitializeAndPreparePokecenter2F
+	sdefer .InitializeAndPreparePokecenter2F
 	end
 
 .DummyScene:
--- a/maps/MountMoon.asm
+++ b/maps/MountMoon.asm
@@ -9,7 +9,7 @@
 	def_callbacks
 
 .RivalEncounter:
-	prioritysjump .RivalBattle
+	sdefer .RivalBattle
 	end
 
 .DummyScene:
--- a/maps/MrPokemonsHouse.asm
+++ b/maps/MrPokemonsHouse.asm
@@ -10,7 +10,7 @@
 	def_callbacks
 
 .MeetMrPokemon:
-	prioritysjump .MrPokemonEvent
+	sdefer .MrPokemonEvent
 	end
 
 .DummyScene:
--- a/maps/OlivinePort.asm
+++ b/maps/OlivinePort.asm
@@ -18,7 +18,7 @@
 	end
 
 .LeaveFastShip:
-	prioritysjump .LeaveFastShipScript
+	sdefer .LeaveFastShipScript
 	end
 
 .LeaveFastShipScript:
--- a/maps/Pokecenter2F.asm
+++ b/maps/Pokecenter2F.asm
@@ -21,29 +21,29 @@
 	clearevent EVENT_MYSTERY_GIFT_DELIVERY_GUY
 	checkevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_2
 	iftrue .Scene0Done
-	prioritysjump Pokecenter2F_AppearMysteryGiftDeliveryGuy
+	sdefer Pokecenter2F_AppearMysteryGiftDeliveryGuy
 
 .Scene0Done:
 	end
 
 .Scene1:
-	prioritysjump Script_LeftCableTradeCenter
+	sdefer Script_LeftCableTradeCenter
 	end
 
 .Scene2:
-	prioritysjump Script_LeftCableColosseum
+	sdefer Script_LeftCableColosseum
 	end
 
 .Scene3:
-	prioritysjump Script_LeftTimeCapsule
+	sdefer Script_LeftTimeCapsule
 	end
 
 .Scene4:
-	prioritysjump Script_LeftMobileTradeRoom
+	sdefer Script_LeftMobileTradeRoom
 	end
 
 .Scene5:
-	prioritysjump Script_LeftMobileBattleRoom
+	sdefer Script_LeftMobileBattleRoom
 	end
 
 Pokecenter2F_AppearMysteryGiftDeliveryGuy:
--- a/maps/Route35NationalParkGate.asm
+++ b/maps/Route35NationalParkGate.asm
@@ -20,7 +20,7 @@
 	end
 
 .LeaveContestEarly:
-	prioritysjump .LeavingContestEarly
+	sdefer .LeavingContestEarly
 	end
 
 .CheckIfContestRunning:
--- a/maps/Route36NationalParkGate.asm
+++ b/maps/Route36NationalParkGate.asm
@@ -29,7 +29,7 @@
 	end
 
 .LeaveContestEarly:
-	prioritysjump .LeavingContestEarly
+	sdefer .LeavingContestEarly
 	end
 
 .CheckIfContestRunning:
--- a/maps/Route43Gate.asm
+++ b/maps/Route43Gate.asm
@@ -14,7 +14,7 @@
 	callback MAPCALLBACK_NEWMAP, .CheckIfRockets
 
 .RocketShakedown:
-	prioritysjump .RocketTakeover
+	sdefer .RocketTakeover
 	end
 
 .DummyScene:
--- a/maps/RuinsOfAlphAerodactylChamber.asm
+++ b/maps/RuinsOfAlphAerodactylChamber.asm
@@ -12,7 +12,7 @@
 	end
 
 .OpenWall:
-	prioritysjump .WallOpenScript
+	sdefer .WallOpenScript
 	end
 
 .DummyScene:
--- a/maps/RuinsOfAlphHoOhChamber.asm
+++ b/maps/RuinsOfAlphHoOhChamber.asm
@@ -13,7 +13,7 @@
 	end
 
 .OpenWall:
-	prioritysjump .WallOpenScript
+	sdefer .WallOpenScript
 	end
 
 .DummyScene:
--- a/maps/RuinsOfAlphInnerChamber.asm
+++ b/maps/RuinsOfAlphInnerChamber.asm
@@ -14,7 +14,7 @@
 	end
 
 .UnownAppear:
-	prioritysjump .StrangePresenceScript
+	sdefer .StrangePresenceScript
 	end
 
 .StrangePresenceScript:
--- a/maps/RuinsOfAlphKabutoChamber.asm
+++ b/maps/RuinsOfAlphKabutoChamber.asm
@@ -16,7 +16,7 @@
 	end
 
 .OpenWall:
-	prioritysjump .WallOpenScript
+	sdefer .WallOpenScript
 	end
 
 .DummyScene:
--- a/maps/RuinsOfAlphOmanyteChamber.asm
+++ b/maps/RuinsOfAlphOmanyteChamber.asm
@@ -13,7 +13,7 @@
 	end
 
 .OpenWall:
-	prioritysjump .WallOpenScript
+	sdefer .WallOpenScript
 	end
 
 .DummyScene:
--- a/maps/RuinsOfAlphResearchCenter.asm
+++ b/maps/RuinsOfAlphResearchCenter.asm
@@ -15,7 +15,7 @@
 	end
 
 .GetUnownDex:
-	prioritysjump .GetUnownDexScript
+	sdefer .GetUnownDexScript
 	end
 
 .ScientistCallback:
--- a/maps/TeamRocketBaseB3F.asm
+++ b/maps/TeamRocketBaseB3F.asm
@@ -25,7 +25,7 @@
 	callback MAPCALLBACK_TILES, .CheckGiovanniDoor
 
 .LanceGetsPassword:
-	prioritysjump LanceGetPasswordScript
+	sdefer LanceGetPasswordScript
 	end
 
 .DummyScene1:
--- a/maps/TimeCapsule.asm
+++ b/maps/TimeCapsule.asm
@@ -11,7 +11,7 @@
 	callback MAPCALLBACK_OBJECTS, .SetWhichChris
 
 .InitializeTimeCapsule:
-	prioritysjump .InitializeAndPreparePokecenter2F
+	sdefer .InitializeAndPreparePokecenter2F
 	end
 
 .DummyScene:
--- a/maps/TinTower1F.asm
+++ b/maps/TinTower1F.asm
@@ -20,7 +20,7 @@
 	callback MAPCALLBACK_TILES, .StairsCallback
 
 .FaceSuicune:
-	prioritysjump .SuicuneBattle
+	sdefer .SuicuneBattle
 	end
 
 .DummyScene:
--- a/maps/TradeCenter.asm
+++ b/maps/TradeCenter.asm
@@ -11,7 +11,7 @@
 	callback MAPCALLBACK_OBJECTS, .SetWhichChris
 
 .InitializeTradeCenter:
-	prioritysjump .InitializeAndPreparePokecenter2F
+	sdefer .InitializeAndPreparePokecenter2F
 	end
 
 .DummyScene:
--- a/maps/VermilionPort.asm
+++ b/maps/VermilionPort.asm
@@ -15,7 +15,7 @@
 	end
 
 .LeaveFastShip:
-	prioritysjump .LeaveFastShipScript
+	sdefer .LeaveFastShipScript
 	end
 
 .FlyPoint:
--- a/maps/WillsRoom.asm
+++ b/maps/WillsRoom.asm
@@ -10,7 +10,7 @@
 	callback MAPCALLBACK_TILES, .WillsRoomDoors
 
 .LockDoor:
-	prioritysjump .WillsDoorLocksBehindYou
+	sdefer .WillsDoorLocksBehindYou
 	end
 
 .DummyScene:
--- a/wram.asm
+++ b/wram.asm
@@ -2659,7 +2659,7 @@
 wMapEventStatus:: db
 
 wScriptFlags::
-; bit 3: priority jump
+; bit 3: run deferred script
 	db
 	ds 1
 wScriptFlags2::
@@ -2680,10 +2680,10 @@
 	ds 1
 wScriptDelay:: db
 
-wPriorityScriptBank::
+wDeferredScriptBank::
 wScriptTextBank::
 	db
-wPriorityScriptAddr::
+wDeferredScriptAddr::
 wScriptTextAddr::
 	dw
 	ds 1