shithub: pokered

Download patch

ref: 76b882d9523915ca8ced96e8c5e889ca2728241e
parent: 594c58a289cbad3954899d76ed000f483389472f
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Thu Jul 16 08:32:19 EDT 2020

Reformat map scripts' coordinate and movement data

'dbmapcoord' has X, Y order like other coordinate-related data macros

--- a/constants/input_constants.asm
+++ b/constants/input_constants.asm
@@ -8,6 +8,7 @@
 	const BIT_D_UP
 	const BIT_D_DOWN
 
+NO_INPUT EQU 0
 A_BUTTON EQU 1 << BIT_A_BUTTON
 B_BUTTON EQU 1 << BIT_B_BUTTON
 SELECT   EQU 1 << BIT_SELECT
--- a/constants/sprite_data_constants.asm
+++ b/constants/sprite_data_constants.asm
@@ -11,6 +11,8 @@
 	const NPC_MOVEMENT_LEFT  ; $80
 	const NPC_MOVEMENT_RIGHT ; $C0
 
+NPC_CHANGE_FACING EQU $E0
+
 ; player direction constants
 	const_def
 	const PLAYER_DIR_BIT_RIGHT ; 0
--- a/engine/overworld/auto_movement.asm
+++ b/engine/overworld/auto_movement.asm
@@ -128,21 +128,21 @@
 	ret
 
 RLEList_ProfOakWalkToLab:
-	db NPC_MOVEMENT_DOWN, $05
-	db NPC_MOVEMENT_LEFT, $01
-	db NPC_MOVEMENT_DOWN, $05
-	db NPC_MOVEMENT_RIGHT, $03
-	db NPC_MOVEMENT_UP, $01
-	db $E0, $01 ; stand still
-	db $FF
+	db NPC_MOVEMENT_DOWN, 5
+	db NPC_MOVEMENT_LEFT, 1
+	db NPC_MOVEMENT_DOWN, 5
+	db NPC_MOVEMENT_RIGHT, 3
+	db NPC_MOVEMENT_UP, 1
+	db NPC_CHANGE_FACING, 1
+	db -1 ; end
 
 RLEList_PlayerWalkToLab:
-	db D_UP, $02
-	db D_RIGHT, $03
-	db D_DOWN, $05
-	db D_LEFT, $01
-	db D_DOWN, $06
-	db $FF
+	db D_UP, 2
+	db D_RIGHT, 3
+	db D_DOWN, 5
+	db D_LEFT, 1
+	db D_DOWN, 6
+	db -1 ; end
 
 PalletMovementScript_Done:
 	ld a, [wSimulatedJoypadStatesIndex]
@@ -190,18 +190,18 @@
 	ret
 
 RLEList_PewterMuseumPlayer:
-	db 0, $01
-	db D_UP, $03
-	db D_LEFT, $0D
-	db D_UP, $06
-	db $FF
+	db NO_INPUT, 1
+	db D_UP, 3
+	db D_LEFT, 13
+	db D_UP, 6
+	db -1 ; end
 
 RLEList_PewterMuseumGuy:
-	db NPC_MOVEMENT_UP, $06
-	db NPC_MOVEMENT_LEFT, $0D
-	db NPC_MOVEMENT_UP, $03
-	db NPC_MOVEMENT_LEFT, $01
-	db $FF
+	db NPC_MOVEMENT_UP, 6
+	db NPC_MOVEMENT_LEFT, 13
+	db NPC_MOVEMENT_UP, 3
+	db NPC_MOVEMENT_LEFT, 1
+	db -1 ; end
 
 PewterMovementScript_Done:
 	ld a, [wSimulatedJoypadStatesIndex]
@@ -249,22 +249,22 @@
 	ret
 
 RLEList_PewterGymPlayer:
-	db 0, $01
-	db D_RIGHT, $02
-	db D_DOWN, $05
-	db D_LEFT, $0B
-	db D_UP, $05
-	db D_LEFT, $0F
-	db $FF
+	db NO_INPUT, 1
+	db D_RIGHT, 2
+	db D_DOWN, 5
+	db D_LEFT, 11
+	db D_UP, 5
+	db D_LEFT, 15
+	db -1 ; end
 
 RLEList_PewterGymGuy:
-	db NPC_MOVEMENT_DOWN, $02
-	db NPC_MOVEMENT_LEFT, $0F
-	db NPC_MOVEMENT_UP, $05
-	db NPC_MOVEMENT_LEFT, $0B
-	db NPC_MOVEMENT_DOWN, $05
-	db NPC_MOVEMENT_RIGHT, $03
-	db $FF
+	db NPC_MOVEMENT_DOWN, 2
+	db NPC_MOVEMENT_LEFT, 15
+	db NPC_MOVEMENT_UP, 5
+	db NPC_MOVEMENT_LEFT, 11
+	db NPC_MOVEMENT_DOWN, 5
+	db NPC_MOVEMENT_RIGHT, 3
+	db -1 ; end
 
 FreezeEnemyTrainerSprite::
 	ld a, [wCurMap]
@@ -275,7 +275,7 @@
 	ld b, a
 .loop
 	ld a, [hli]
-	cp $ff
+	cp -1
 	jr z, .notRival
 	cp b
 	ret z ; the rival leaves after battling, so don't freeze him
@@ -289,4 +289,4 @@
 	db OPP_SONY1
 	db OPP_SONY2
 	db OPP_SONY3
-	db $ff
+	db -1 ; end
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -169,7 +169,7 @@
 	pop hl
 	ld de, wNPCMovementDirections
 	call LoadDEPlusA ; a = [wNPCMovementDirections + movement byte 1]
-	cp $e0
+	cp NPC_CHANGE_FACING
 	jp z, ChangeFacingDirection
 	cp STAY
 	jr nz, .next
--- a/home/pathfinding.asm
+++ b/home/pathfinding.asm
@@ -25,7 +25,7 @@
 	ld [hli], a
 	inc de
 	inc c
-	cp $FF ; have we reached the end of the movement data?
+	cp -1 ; have we reached the end of the movement data?
 	jr nz, .loop
 
 	ld a, c
--- a/macros/coords.asm
+++ b/macros/coords.asm
@@ -83,3 +83,8 @@
 		ld a, [(\2) * SCREEN_WIDTH + (\1) + wTileMap]
 	ENDC
 ENDM
+
+dbmapcoord: MACRO
+; x, y
+	db \2, \1
+ENDM
--- a/macros/scripts/maps.asm
+++ b/macros/scripts/maps.asm
@@ -67,6 +67,14 @@
 	dw \3, \5, \4, \4
 ENDM
 
+;\1 x position
+;\2 y position
+;\3 movement data
+map_coord_movement: MACRO
+	dbmapcoord \1, \2
+	dw \3
+ENDM
+
 
 ;\1 map name
 ;\2 map id
--- a/scripts/AgathasRoom.asm
+++ b/scripts/AgathasRoom.asm
@@ -87,11 +87,11 @@
 	ret
 
 AgathaEntranceCoords:
-	db $0A,$04
-	db $0A,$05
-	db $0B,$04
-	db $0B,$05
-	db $FF
+	dbmapcoord  4, 10
+	dbmapcoord  5, 10
+	dbmapcoord  4, 11
+	dbmapcoord  5, 11
+	db -1 ; end
 
 AgathaScript3:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/BillsHouse.asm
+++ b/scripts/BillsHouse.asm
@@ -33,7 +33,7 @@
 	db NPC_MOVEMENT_UP
 	db NPC_MOVEMENT_UP
 	db NPC_MOVEMENT_UP
-	db $FF
+	db -1 ; end
 
 ; make Bill walk around the player
 MovementData_1e7a0:
@@ -42,7 +42,7 @@
 	db NPC_MOVEMENT_UP
 	db NPC_MOVEMENT_LEFT
 	db NPC_MOVEMENT_UP
-	db $FF
+	db -1 ; end
 
 BillsHouseScript2:
 	ld a, [wd730]
@@ -93,7 +93,7 @@
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 BillsHouseScript4:
 	ld a, [wd730]
--- a/scripts/BrunosRoom.asm
+++ b/scripts/BrunosRoom.asm
@@ -87,11 +87,11 @@
 	ret
 
 BrunoEntranceCoords:
-	db $0A,$04
-	db $0A,$05
-	db $0B,$04
-	db $0B,$05
-	db $FF
+	dbmapcoord  4, 10
+	dbmapcoord  5, 10
+	dbmapcoord  4, 11
+	dbmapcoord  5, 11
+	db -1 ; end
 
 BrunoScript3:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/CeladonMartRoof.asm
+++ b/scripts/CeladonMartRoof.asm
@@ -38,7 +38,7 @@
 	db FRESH_WATER
 	db SODA_POP
 	db LEMONADE
-	db $00
+	db 0 ; end
 
 CeladonMartRoofScript_GiveDrinkToGirl:
 	ld hl, wd730
--- a/scripts/CeruleanCity.asm
+++ b/scripts/CeruleanCity.asm
@@ -101,20 +101,20 @@
 	ret
 
 CeruleanCityCoords1:
-	db $07,$1e
-	db $09,$1e
-	db $ff
+	dbmapcoord 30,  7
+	dbmapcoord 30,  9
+	db -1 ; end
 
 CeruleanCityCoords2:
-	db $06,$14
-	db $06,$15
-	db $ff
+	dbmapcoord 20,  6
+	dbmapcoord 21,  6
+	db -1 ; end
 
 CeruleanCityMovement1:
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 CeruleanCityScript_1955d:
 	ld a, 1
@@ -205,7 +205,7 @@
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 CeruleanCityMovement4:
 	db NPC_MOVEMENT_RIGHT
@@ -215,7 +215,7 @@
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 CeruleanCityScript3:
 	ld a, [wd730]
--- a/scripts/ChampionsRoom.asm
+++ b/scripts/ChampionsRoom.asm
@@ -40,10 +40,10 @@
 	ret
 
 GaryEntrance_RLEMovement:
-	db D_UP,1
-	db D_RIGHT,1
-	db D_UP,3
-	db $ff
+	db D_UP, 1
+	db D_RIGHT, 1
+	db D_UP, 3
+	db -1 ; end
 
 GaryScript2:
 	ld a, [wSimulatedJoypadStatesIndex]
@@ -132,7 +132,7 @@
 	db NPC_MOVEMENT_UP
 	db NPC_MOVEMENT_UP
 	db NPC_MOVEMENT_UP
-	db $FF
+	db -1 ; end
 
 GaryScript5:
 	ld a, [wd730]
@@ -190,7 +190,7 @@
 OakExitGaryRoomMovement:
 	db NPC_MOVEMENT_UP
 	db NPC_MOVEMENT_UP
-	db $FF
+	db -1 ; end
 
 GaryScript8:
 	ld a, [wd730]
@@ -217,9 +217,9 @@
 	ret
 
 WalkToHallOfFame_RLEMovment:
-	db D_UP,4
-	db D_LEFT,1
-	db $ff
+	db D_UP, 4
+	db D_LEFT, 1
+	db -1 ; end
 
 GaryScript10:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/CinnabarGym.asm
+++ b/scripts/CinnabarGym.asm
@@ -71,11 +71,11 @@
 MovementData_757d7:
 	db NPC_MOVEMENT_LEFT
 	db NPC_MOVEMENT_UP
-	db $FF
+	db -1 ; end
 
 MovementData_757da:
 	db NPC_MOVEMENT_LEFT
-	db $FF
+	db -1 ; end
 
 CinnabarGymScript1:
 	ld a, [wd730]
--- a/scripts/GameCorner.asm
+++ b/scripts/GameCorner.asm
@@ -90,7 +90,7 @@
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
-	db $FF
+	db -1 ; end
 
 MovementData_48c63:
 	db NPC_MOVEMENT_RIGHT
@@ -98,7 +98,7 @@
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
-	db $FF
+	db -1 ; end
 
 CeladonGameCornerScript2:
 	ld a, [wd730]
--- a/scripts/HallOfFame.asm
+++ b/scripts/HallOfFame.asm
@@ -69,8 +69,8 @@
 	ret
 
 RLEMovement5a528:
-	db D_UP,$5
-	db $ff
+	db D_UP, 5
+	db -1 ; end
 
 HallofFameRoomScript1:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/LancesRoom.asm
+++ b/scripts/LancesRoom.asm
@@ -78,12 +78,12 @@
 	jp LanceShowOrHideEntranceBlocks
 
 LanceTriggerMovementCoords:
-	db $01,$05
-	db $02,$06
-	db $0B,$05
-	db $0B,$06
-	db $10,$18
-	db $FF
+	dbmapcoord  5,  1
+	dbmapcoord  6,  2
+	dbmapcoord  5, 11
+	dbmapcoord  6, 11
+	dbmapcoord 24, 16
+	db -1 ; end
 
 LanceScript2:
 	call EndTrainerBattle
@@ -110,15 +110,15 @@
 	ret
 
 WalkToLance_RLEList:
-	db D_UP, $0C
-	db D_LEFT, $0C
-	db D_DOWN, $07
-	db D_LEFT, $06
-	db $FF
+	db D_UP, 12
+	db D_LEFT, 12
+	db D_DOWN, 7
+	db D_LEFT, 6
+	db -1 ; end
 
 LanceScript3:
-	ld a, [wSimulatedJoypadStatesIndex]
-	and a
+	ld  a, [wSimulatedJoypadStatesIndex]
+	and  a
 	ret nz
 	call Delay3
 	xor a
--- a/scripts/LoreleisRoom.asm
+++ b/scripts/LoreleisRoom.asm
@@ -89,11 +89,11 @@
 	ret
 
 LoreleiEntranceCoords:
-	db $0A,$04
-	db $0A,$05
-	db $0B,$04
-	db $0B,$05
-	db $FF
+	dbmapcoord  4, 10
+	dbmapcoord  5, 10
+	dbmapcoord  4, 11
+	dbmapcoord  5, 11
+	db -1 ; end
 
 LoreleiScript3:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/MtMoonB2F.asm
+++ b/scripts/MtMoonB2F.asm
@@ -19,23 +19,23 @@
 	ret
 
 CoordsData_49d37:
-	db $05,$0B
-	db $05,$0C
-	db $05,$0D
-	db $05,$0E
-	db $06,$0B
-	db $06,$0C
-	db $06,$0D
-	db $06,$0E
-	db $07,$0B
-	db $07,$0C
-	db $07,$0D
-	db $07,$0E
-	db $08,$0B
-	db $08,$0C
-	db $08,$0D
-	db $08,$0E
-	db $FF
+	dbmapcoord 11,  5
+	dbmapcoord 12,  5
+	dbmapcoord 13,  5
+	dbmapcoord 14,  5
+	dbmapcoord 11,  6
+	dbmapcoord 12,  6
+	dbmapcoord 13,  6
+	dbmapcoord 14,  6
+	dbmapcoord 11,  7
+	dbmapcoord 12,  7
+	dbmapcoord 13,  7
+	dbmapcoord 14,  7
+	dbmapcoord 11,  8
+	dbmapcoord 12,  8
+	dbmapcoord 13,  8
+	dbmapcoord 14,  8
+	db -1 ; end
 
 MtMoon3Script_49d58:
 	xor a
@@ -110,22 +110,22 @@
 	ret
 
 CoordsData_49dea:
-	db $07,$0C
-	db $06,$0B
-	db $05,$0C
-	db $FF
+	dbmapcoord 12,  7
+	dbmapcoord 11,  6
+	dbmapcoord 12,  5
+	db -1 ; end
 
 CoordsData_49df1:
-	db $07,$0D
-	db $06,$0E
-	db $05,$0E
-	db $FF
+	dbmapcoord 13,  7
+	dbmapcoord 14,  6
+	dbmapcoord 14,  5
+	db -1 ; end
 
 MovementData_49df8:
 	db NPC_MOVEMENT_RIGHT
 MovementData_49df9:
 	db NPC_MOVEMENT_UP
-	db $FF
+	db -1 ; end
 
 MtMoon3Script5:
 	ld a, [wd730]
--- a/scripts/MtMoonPokecenter.asm
+++ b/scripts/MtMoonPokecenter.asm
@@ -11,7 +11,7 @@
 	dw MtMoonTradeNurseText
 
 MtMoonHealNurseText:
-	db $ff
+	script_pokecenter_nurse
 
 MtMoonPokecenterText2:
 	text_far _MtMoonPokecenterText1
--- a/scripts/OaksLab.asm
+++ b/scripts/OaksLab.asm
@@ -60,7 +60,7 @@
 	db NPC_MOVEMENT_UP
 	db NPC_MOVEMENT_UP
 	db NPC_MOVEMENT_UP
-	db $FF
+	db -1 ; end
 
 OaksLabScript2:
 	ld a, [wd730]
@@ -101,8 +101,8 @@
 	ret
 
 PlayerEntryMovementRLE:
-	db D_UP,$8
-	db $ff
+	db D_UP, 8
+	db -1 ; end
 
 OaksLabScript4:
 	ld a, [wSimulatedJoypadStatesIndex]
@@ -212,7 +212,7 @@
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_UP
-	db $FF
+	db -1 ; end
 
 .MiddleBallMovement2
 	db NPC_MOVEMENT_DOWN
@@ -219,7 +219,7 @@
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
-	db $FF
+	db -1 ; end
 
 .Squirtle
 	ld de, .RightBallMovement1
@@ -237,7 +237,7 @@
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_UP
-	db $FF
+	db -1 ; end
 
 .RightBallMovement2
 	db NPC_MOVEMENT_DOWN
@@ -245,7 +245,7 @@
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
-	db $FF
+	db -1 ; end
 
 .Bulbasaur
 	ld de, .LeftBallMovement1
@@ -274,10 +274,10 @@
 
 .LeftBallMovement1
 	db NPC_MOVEMENT_DOWN
-	db NPC_MOVEMENT_RIGHT ; not yet terminated!
+	db NPC_MOVEMENT_RIGHT
 .LeftBallMovement2
 	db NPC_MOVEMENT_RIGHT
-	db $FF
+	db -1 ; end
 
 .moveBlue
 	ld a, $1
@@ -462,13 +462,13 @@
 	ret
 
 .RivalExitMovement
-	db $E0 ; change sprite facing direction
+	db NPC_CHANGE_FACING
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 OaksLabScript14:
 	ld a, [wd730]
--- a/scripts/PewterCity.asm
+++ b/scripts/PewterCity.asm
@@ -37,11 +37,11 @@
 	jp DisplayTextID
 
 CoordsData_19277:
-	db $11,$23
-	db $11,$24
-	db $12,$25
-	db $13,$25
-	db $ff
+	dbmapcoord 35, 17
+	dbmapcoord 36, 17
+	dbmapcoord 37, 18
+	dbmapcoord 37, 19
+	db -1 ; end
 
 PewterCityScript1:
 	ld a, [wNPCMovementScriptPointerTableNum]
@@ -85,7 +85,7 @@
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 PewterCityScript2:
 	ld a, [wd730]
@@ -154,7 +154,7 @@
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
-	db $FF
+	db -1 ; end
 
 PewterCityScript5:
 	ld a, [wd730]
--- a/scripts/PokemonMansion3F.asm
+++ b/scripts/PokemonMansion3F.asm
@@ -51,10 +51,10 @@
 	ret
 
 CoordsData_52254:
-	db $0E,$10
-	db $0E,$11
-	db $0E,$13
-	db $FF
+	dbmapcoord 16, 14
+	dbmapcoord 17, 14
+	dbmapcoord 19, 14
+	db -1 ; end
 
 Mansion3Script_5225b:
 	xor a
--- a/scripts/PokemonTower2F.asm
+++ b/scripts/PokemonTower2F.asm
@@ -58,9 +58,9 @@
 	ret
 
 CoordsData_6055e:
-	db $05,$0F
-	db $06,$0E
-	db $0F ; isn't this supposed to end in $ff?
+	dbmapcoord 15,  5
+	dbmapcoord 14,  6
+	db $0F ; end? (should be $ff?)
 
 PokemonTower2Script1:
 	ld a, [wIsInBattle]
@@ -98,7 +98,7 @@
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
-	db $FF
+	db -1 ; end
 
 MovementData_605b2:
 	db NPC_MOVEMENT_DOWN
@@ -109,7 +109,7 @@
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 PokemonTower2Script2:
 	ld a, [wd730]
--- a/scripts/PokemonTower5F.asm
+++ b/scripts/PokemonTower5F.asm
@@ -42,11 +42,11 @@
 	ret
 
 CoordsData_60992:
-	db $08,$0A
-	db $08,$0B
-	db $09,$0A
-	db $09,$0B
-	db $FF
+	dbmapcoord 10,  8
+	dbmapcoord 11,  8
+	dbmapcoord 10,  9
+	dbmapcoord 11,  9
+	db -1 ; end
 
 PokemonTower5F_TextPointers:
 	dw PokemonTower5Text1
--- a/scripts/PokemonTower6F.asm
+++ b/scripts/PokemonTower6F.asm
@@ -42,8 +42,8 @@
 	ret
 
 CoordsData_60b45:
-	db $10,$0A
-	db $FF
+	dbmapcoord 10, 16
+	db -1 ; end
 
 PokemonTower6Script4:
 	ld a, [wIsInBattle]
--- a/scripts/PokemonTower7F.asm
+++ b/scripts/PokemonTower7F.asm
@@ -117,30 +117,18 @@
 	jr .asm_60dcb
 
 CoordsData_60de3:
-	db $0C,$09
-	dw MovementData_60e13
-	db $0B,$0A
-	dw MovementData_60e1b
-	db $0B,$0B
-	dw MovementData_60e22
-	db $0B,$0C
-	dw MovementData_60e22
-	db $0A,$0C
-	dw MovementData_60e28
-	db $09,$0B
-	dw MovementData_60e30
-	db $09,$0A
-	dw MovementData_60e22
-	db $09,$09
-	dw MovementData_60e22
-	db $08,$09
-	dw MovementData_60e37
-	db $07,$0A
-	dw MovementData_60e22
-	db $07,$0B
-	dw MovementData_60e22
-	db $07,$0C
-	dw MovementData_60e22
+	map_coord_movement  9, 12, MovementData_60e13
+	map_coord_movement 10, 11, MovementData_60e1b
+	map_coord_movement 11, 11, MovementData_60e22
+	map_coord_movement 12, 11, MovementData_60e22
+	map_coord_movement 12, 10, MovementData_60e28
+	map_coord_movement 11,  9, MovementData_60e30
+	map_coord_movement 10,  9, MovementData_60e22
+	map_coord_movement  9,  9, MovementData_60e22
+	map_coord_movement  9,  8, MovementData_60e37
+	map_coord_movement 10,  7, MovementData_60e22
+	map_coord_movement 11,  7, MovementData_60e22
+	map_coord_movement 12,  7, MovementData_60e22
 
 MovementData_60e13:
 	db NPC_MOVEMENT_RIGHT
@@ -150,7 +138,7 @@
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_LEFT
-	db $FF
+	db -1 ; end
 
 MovementData_60e1b:
 	db NPC_MOVEMENT_DOWN
@@ -159,7 +147,7 @@
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 MovementData_60e22:
 	db NPC_MOVEMENT_DOWN
@@ -167,7 +155,7 @@
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 MovementData_60e28:
 	db NPC_MOVEMENT_LEFT
@@ -177,7 +165,7 @@
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 MovementData_60e30:
 	db NPC_MOVEMENT_DOWN
@@ -186,7 +174,7 @@
 	db NPC_MOVEMENT_LEFT
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 MovementData_60e37:
 	db NPC_MOVEMENT_RIGHT
@@ -196,7 +184,7 @@
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 PokemonTower7F_TextPointers:
 	dw PokemonTower7Text1
--- a/scripts/RocketHideoutB2F.asm
+++ b/scripts/RocketHideoutB2F.asm
@@ -33,273 +33,227 @@
 	ld [wCurMapScript], a
 	ret
 
-;format:
-;db y,x
-;dw pointer to movement
 RocketHideout2ArrowTilePlayerMovement:
-	db $9,$4
-	dw RocketHideout2ArrowMovement1
-	db $b,$4
-	dw RocketHideout2ArrowMovement2
-	db $f,$4
-	dw RocketHideout2ArrowMovement3
-	db $10,$4
-	dw RocketHideout2ArrowMovement4
-	db $13,$4
-	dw RocketHideout2ArrowMovement1
-	db $16,$4
-	dw RocketHideout2ArrowMovement5
-	db $e,$5
-	dw RocketHideout2ArrowMovement6
-	db $16,$6
-	dw RocketHideout2ArrowMovement7
-	db $18,$6
-	dw RocketHideout2ArrowMovement8
-	db $9,$8
-	dw RocketHideout2ArrowMovement9
-	db $c,$8
-	dw RocketHideout2ArrowMovement10
-	db $f,$8
-	dw RocketHideout2ArrowMovement8
-	db $13,$8
-	dw RocketHideout2ArrowMovement9
-	db $17,$8
-	dw RocketHideout2ArrowMovement11
-	db $e,$9
-	dw RocketHideout2ArrowMovement12
-	db $16,$9
-	dw RocketHideout2ArrowMovement12
-	db $9,$a
-	dw RocketHideout2ArrowMovement13
-	db $a,$a
-	dw RocketHideout2ArrowMovement14
-	db $f,$a
-	dw RocketHideout2ArrowMovement15
-	db $11,$a
-	dw RocketHideout2ArrowMovement16
-	db $13,$a
-	dw RocketHideout2ArrowMovement17
-	db $19,$a
-	dw RocketHideout2ArrowMovement2
-	db $e,$b
-	dw RocketHideout2ArrowMovement18
-	db $10,$b
-	dw RocketHideout2ArrowMovement19
-	db $12,$b
-	dw RocketHideout2ArrowMovement12
-	db $9,$c
-	dw RocketHideout2ArrowMovement20
-	db $b,$c
-	dw RocketHideout2ArrowMovement21
-	db $d,$c
-	dw RocketHideout2ArrowMovement22
-	db $11,$c
-	dw RocketHideout2ArrowMovement23
-	db $a,$d
-	dw RocketHideout2ArrowMovement24
-	db $c,$d
-	dw RocketHideout2ArrowMovement25
-	db $10,$d
-	dw RocketHideout2ArrowMovement26
-	db $12,$d
-	dw RocketHideout2ArrowMovement27
-	db $13,$d
-	dw RocketHideout2ArrowMovement28
-	db $16,$d
-	dw RocketHideout2ArrowMovement29
-	db $17,$d
-	dw RocketHideout2ArrowMovement30
-	db $11,$e
-	dw RocketHideout2ArrowMovement31
-	db $10,$f
-	dw RocketHideout2ArrowMovement12
-	db $e,$10
-	dw RocketHideout2ArrowMovement32
-	db $10,$10
-	dw RocketHideout2ArrowMovement33
-	db $12,$10
-	dw RocketHideout2ArrowMovement34
-	db $a,$11
-	dw RocketHideout2ArrowMovement35
-	db $b,$11
-	dw RocketHideout2ArrowMovement36
-	db $FF
+	map_coord_movement  4,  9, RocketHideout2ArrowMovement1
+	map_coord_movement  4, 11, RocketHideout2ArrowMovement2
+	map_coord_movement  4, 15, RocketHideout2ArrowMovement3
+	map_coord_movement  4, 16, RocketHideout2ArrowMovement4
+	map_coord_movement  4, 19, RocketHideout2ArrowMovement1
+	map_coord_movement  4, 22, RocketHideout2ArrowMovement5
+	map_coord_movement  5, 14, RocketHideout2ArrowMovement6
+	map_coord_movement  6, 22, RocketHideout2ArrowMovement7
+	map_coord_movement  6, 24, RocketHideout2ArrowMovement8
+	map_coord_movement  8,  9, RocketHideout2ArrowMovement9
+	map_coord_movement  8, 12, RocketHideout2ArrowMovement10
+	map_coord_movement  8, 15, RocketHideout2ArrowMovement8
+	map_coord_movement  8, 19, RocketHideout2ArrowMovement9
+	map_coord_movement  8, 23, RocketHideout2ArrowMovement11
+	map_coord_movement  9, 14, RocketHideout2ArrowMovement12
+	map_coord_movement  9, 22, RocketHideout2ArrowMovement12
+	map_coord_movement 10,  9, RocketHideout2ArrowMovement13
+	map_coord_movement 10, 10, RocketHideout2ArrowMovement14
+	map_coord_movement 10, 15, RocketHideout2ArrowMovement15
+	map_coord_movement 10, 17, RocketHideout2ArrowMovement16
+	map_coord_movement 10, 19, RocketHideout2ArrowMovement17
+	map_coord_movement 10, 25, RocketHideout2ArrowMovement2
+	map_coord_movement 11, 14, RocketHideout2ArrowMovement18
+	map_coord_movement 11, 16, RocketHideout2ArrowMovement19
+	map_coord_movement 11, 18, RocketHideout2ArrowMovement12
+	map_coord_movement 12,  9, RocketHideout2ArrowMovement20
+	map_coord_movement 12, 11, RocketHideout2ArrowMovement21
+	map_coord_movement 12, 13, RocketHideout2ArrowMovement22
+	map_coord_movement 12, 17, RocketHideout2ArrowMovement23
+	map_coord_movement 13, 10, RocketHideout2ArrowMovement24
+	map_coord_movement 13, 12, RocketHideout2ArrowMovement25
+	map_coord_movement 13, 16, RocketHideout2ArrowMovement26
+	map_coord_movement 13, 18, RocketHideout2ArrowMovement27
+	map_coord_movement 13, 19, RocketHideout2ArrowMovement28
+	map_coord_movement 13, 22, RocketHideout2ArrowMovement29
+	map_coord_movement 13, 23, RocketHideout2ArrowMovement30
+	map_coord_movement 14, 17, RocketHideout2ArrowMovement31
+	map_coord_movement 15, 16, RocketHideout2ArrowMovement12
+	map_coord_movement 16, 14, RocketHideout2ArrowMovement32
+	map_coord_movement 16, 16, RocketHideout2ArrowMovement33
+	map_coord_movement 16, 18, RocketHideout2ArrowMovement34
+	map_coord_movement 17, 10, RocketHideout2ArrowMovement35
+	map_coord_movement 17, 11, RocketHideout2ArrowMovement36
+	db -1 ; end
 
 ;format: direction, count
 ;each list is read starting from the $FF and working backwards
 RocketHideout2ArrowMovement1:
-	db D_LEFT,$02
-	db $FF
+	db D_LEFT, 2
+	db -1 ; end
 
 RocketHideout2ArrowMovement2:
-	db D_RIGHT,$04
-	db $FF
+	db D_RIGHT, 4
+	db -1 ; end
 
 RocketHideout2ArrowMovement3:
-	db D_UP,$04
-	db D_RIGHT,$04
-	db $FF
+	db D_UP, 4
+	db D_RIGHT, 4
+	db -1 ; end
 
 RocketHideout2ArrowMovement4:
-	db D_UP,$04
-	db D_RIGHT,$04
-	db D_UP,$01
-	db $FF
+	db D_UP, 4
+	db D_RIGHT, 4
+	db D_UP, 1
+	db -1 ; end
 
 RocketHideout2ArrowMovement5:
-	db D_LEFT,$02
-	db D_UP,$03
-	db $FF
+	db D_LEFT, 2
+	db D_UP, 3
+	db -1 ; end
 
 RocketHideout2ArrowMovement6:
-	db D_DOWN,$02
-	db D_RIGHT,$04
-	db $FF
+	db D_DOWN, 2
+	db D_RIGHT, 4
+	db -1 ; end
 
 RocketHideout2ArrowMovement7:
-	db D_UP,$02
-	db $FF
+	db D_UP, 2
+	db -1 ; end
 
 RocketHideout2ArrowMovement8:
-	db D_UP,$04
-	db $FF
+	db D_UP, 4
+	db -1 ; end
 
 RocketHideout2ArrowMovement9:
-	db D_LEFT,$06
-	db $FF
+	db D_LEFT, 6
+	db -1 ; end
 
 RocketHideout2ArrowMovement10:
-	db D_UP,$01
-	db $FF
+	db D_UP, 1
+	db -1 ; end
 
 RocketHideout2ArrowMovement11:
-	db D_LEFT,$06
-	db D_UP,$04
-	db $FF
+	db D_LEFT, 6
+	db D_UP, 4
+	db -1 ; end
 
 RocketHideout2ArrowMovement12:
-	db D_DOWN,$02
-	db $FF
+	db D_DOWN, 2
+	db -1 ; end
 
 RocketHideout2ArrowMovement13:
-	db D_LEFT,$08
-	db $FF
+	db D_LEFT, 8
+	db -1 ; end
 
 RocketHideout2ArrowMovement14:
-	db D_LEFT,$08
-	db D_UP,$01
-	db $FF
+	db D_LEFT, 8
+	db D_UP, 1
+	db -1 ; end
 
 RocketHideout2ArrowMovement15:
-	db D_LEFT,$08
-	db D_UP,$06
-	db $FF
+	db D_LEFT, 8
+	db D_UP, 6
+	db -1 ; end
 
 RocketHideout2ArrowMovement16:
-	db D_UP,$02
-	db D_RIGHT,$04
-	db $FF
+	db D_UP, 2
+	db D_RIGHT, 4
+	db -1 ; end
 
 RocketHideout2ArrowMovement17:
-	db D_UP,$02
-	db D_RIGHT,$04
-	db D_UP,$02
-	db $FF
+	db D_UP, 2
+	db D_RIGHT, 4
+	db D_UP, 2
+	db -1 ; end
 
 RocketHideout2ArrowMovement18:
-	db D_DOWN,$02
-	db D_RIGHT,$04
-	db D_DOWN,$02
-	db $FF
+	db D_DOWN, 2
+	db D_RIGHT, 4
+	db D_DOWN, 2
+	db -1 ; end
 
 RocketHideout2ArrowMovement19:
-	db D_DOWN,$02
-	db D_RIGHT,$04
-	db $FF
+	db D_DOWN, 2
+	db D_RIGHT, 4
+	db -1 ; end
 
 RocketHideout2ArrowMovement20:
-	db D_LEFT,$0A
-	db $FF
+	db D_LEFT, 10
+	db -1 ; end
 
 RocketHideout2ArrowMovement21:
-	db D_LEFT,$0A
-	db D_UP,$02
-	db $FF
+	db D_LEFT, 10
+	db D_UP, 2
+	db -1 ; end
 
 RocketHideout2ArrowMovement22:
-	db D_LEFT,$0A
-	db D_UP,$04
-	db $FF
+	db D_LEFT, 10
+	db D_UP, 4
+	db -1 ; end
 
 RocketHideout2ArrowMovement23:
-	db D_UP,$02
-	db D_RIGHT,$02
-	db $FF
+	db D_UP, 2
+	db D_RIGHT, 2
+	db -1 ; end
 
 RocketHideout2ArrowMovement24:
-	db D_RIGHT,$01
-	db D_DOWN,$02
-	db $FF
+	db D_RIGHT, 1
+	db D_DOWN, 2
+	db -1 ; end
 
 RocketHideout2ArrowMovement25:
-	db D_RIGHT,$01
-	db $FF
+	db D_RIGHT, 1
+	db -1 ; end
 
 RocketHideout2ArrowMovement26:
-	db D_DOWN,$02
-	db D_RIGHT,$02
-	db $FF
+	db D_DOWN, 2
+	db D_RIGHT, 2
+	db -1 ; end
 
 RocketHideout2ArrowMovement27:
-	db D_DOWN,$02
-	db D_LEFT,$02
-	db $FF
+	db D_DOWN, 2
+	db D_LEFT, 2
+	db -1 ; end
 
 RocketHideout2ArrowMovement28:
-	db D_UP,$02
-	db D_RIGHT,$04
-	db D_UP,$02
-	db D_LEFT,$03
-	db $FF
+	db D_UP, 2
+	db D_RIGHT, 4
+	db D_UP, 2
+	db D_LEFT, 3
+	db -1 ; end
 
 RocketHideout2ArrowMovement29:
-	db D_DOWN,$02
-	db D_LEFT,$04
-	db $FF
+	db D_DOWN, 2
+	db D_LEFT, 4
+	db -1 ; end
 
 RocketHideout2ArrowMovement30:
-	db D_LEFT,$06
-	db D_UP,$04
-	db D_LEFT,$05
-	db $FF
+	db D_LEFT, 6
+	db D_UP, 4
+	db D_LEFT, 5
+	db -1 ; end
 
 RocketHideout2ArrowMovement31:
-	db D_UP,$02
-	db $FF
+	db D_UP, 2
+	db -1 ; end
 
 RocketHideout2ArrowMovement32:
-	db D_UP,$01
-	db $FF
+	db D_UP, 1
+	db -1 ; end
 
 RocketHideout2ArrowMovement33:
-	db D_UP,$03
-	db $FF
+	db D_UP, 3
+	db -1 ; end
 
 RocketHideout2ArrowMovement34:
-	db D_UP,$05
-	db $FF
+	db D_UP, 5
+	db -1 ; end
 
 RocketHideout2ArrowMovement35:
-	db D_RIGHT,$01
-	db D_DOWN,$02
-	db D_LEFT,$04
-	db $FF
+	db D_RIGHT, 1
+	db D_DOWN, 2
+	db D_LEFT, 4
+	db -1 ; end
 
 RocketHideout2ArrowMovement36:
-	db D_LEFT,$0A
-	db D_UP,$02
-	db D_LEFT,$05
-	db $FF
+	db D_LEFT, 10
+	db D_UP, 2
+	db D_LEFT, 5
+	db -1 ; end
 
 RocketHideout2Script3:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/RocketHideoutB3F.asm
+++ b/scripts/RocketHideoutB3F.asm
@@ -33,103 +33,84 @@
 	ld [wCurMapScript], a
 	ret
 
-;format:
-;db y,x
-;dw pointer to movement
 RocketHideout3ArrowTilePlayerMovement:
-	db $d,$a
-	dw RocketHideout3ArrowMovement6
-	db $13,$a
-	dw RocketHideout3ArrowMovement1
-	db $12,$b
-	dw RocketHideout3ArrowMovement2
-	db $b,$c
-	dw RocketHideout3ArrowMovement3
-	db $11,$c
-	dw RocketHideout3ArrowMovement4
-	db $14,$c
-	dw RocketHideout3ArrowMovement5
-	db $10,$d
-	dw RocketHideout3ArrowMovement6
-	db $b,$e
-	dw RocketHideout3ArrowMovement7
-	db $f,$e
-	dw RocketHideout3ArrowMovement6
-	db $11,$e
-	dw RocketHideout3ArrowMovement8
-	db $13,$e
-	dw RocketHideout3ArrowMovement9
-	db $10,$f
-	dw RocketHideout3ArrowMovement7
-	db $12,$f
-	dw RocketHideout3ArrowMovement10
-	db $d,$10
-	dw RocketHideout3ArrowMovement11
-	db $c,$11
-	dw RocketHideout3ArrowMovement10
-	db $10,$12
-	dw RocketHideout3ArrowMovement12
-	db $FF
+	map_coord_movement 10, 13, RocketHideout3ArrowMovement6
+	map_coord_movement 10, 19, RocketHideout3ArrowMovement1
+	map_coord_movement 11, 18, RocketHideout3ArrowMovement2
+	map_coord_movement 12, 11, RocketHideout3ArrowMovement3
+	map_coord_movement 12, 17, RocketHideout3ArrowMovement4
+	map_coord_movement 12, 20, RocketHideout3ArrowMovement5
+	map_coord_movement 13, 16, RocketHideout3ArrowMovement6
+	map_coord_movement 14, 11, RocketHideout3ArrowMovement7
+	map_coord_movement 14, 15, RocketHideout3ArrowMovement6
+	map_coord_movement 14, 17, RocketHideout3ArrowMovement8
+	map_coord_movement 14, 19, RocketHideout3ArrowMovement9
+	map_coord_movement 15, 16, RocketHideout3ArrowMovement7
+	map_coord_movement 15, 18, RocketHideout3ArrowMovement10
+	map_coord_movement 16, 13, RocketHideout3ArrowMovement11
+	map_coord_movement 17, 12, RocketHideout3ArrowMovement10
+	map_coord_movement 18, 16, RocketHideout3ArrowMovement12
+	db -1 ; end
 
 ;format: direction, count
 ;each list is read starting from the $FF and working backwards
 RocketHideout3ArrowMovement1:
-	db D_RIGHT,$04
-	db D_UP,$04
-	db D_RIGHT,$04
-	db $FF
+	db D_RIGHT, 4
+	db D_UP, 4
+	db D_RIGHT, 4
+	db -1 ; end
 
 RocketHideout3ArrowMovement2:
-	db D_DOWN,$04
-	db D_RIGHT,$04
-	db $FF
+	db D_DOWN, 4
+	db D_RIGHT, 4
+	db -1 ; end
 
 RocketHideout3ArrowMovement3:
-	db D_LEFT,$02
-	db $FF
+	db D_LEFT, 2
+	db -1 ; end
 
 RocketHideout3ArrowMovement4:
-	db D_RIGHT,$04
-	db D_UP,$02
-	db D_RIGHT,$02
-	db $FF
+	db D_RIGHT, 4
+	db D_UP, 2
+	db D_RIGHT, 2
+	db -1 ; end
 
 RocketHideout3ArrowMovement5:
-	db D_RIGHT,$04
-	db D_UP,$02
-	db D_RIGHT,$02
-	db D_UP,$03
-	db $FF
+	db D_RIGHT, 4
+	db D_UP, 2
+	db D_RIGHT, 2
+	db D_UP, 3
+	db -1 ; end
 
 RocketHideout3ArrowMovement6:
-	db D_RIGHT,$04
-	db $FF
+	db D_RIGHT, 4
+	db -1 ; end
 
 RocketHideout3ArrowMovement7:
-	db D_RIGHT,$02
-	db $FF
+	db D_RIGHT, 2
+	db -1 ; end
 
 RocketHideout3ArrowMovement8:
-	db D_RIGHT,$04
-	db D_UP,$02
-	db $FF
+	db D_RIGHT, 4
+	db D_UP, 2
+	db -1 ; end
 
 RocketHideout3ArrowMovement9:
-	db D_RIGHT,$04
-	db D_UP,$04
-	db $FF
+	db D_RIGHT, 4
+	db D_UP, 4
+	db -1 ; end
 
 RocketHideout3ArrowMovement10:
-	db D_DOWN,$04
-	db $FF
+	db D_DOWN, 4
+	db -1 ; end
 
 RocketHideout3ArrowMovement11:
-	db D_UP,$02
-	db $FF
+	db D_UP, 2
+	db -1 ; end
 
 RocketHideout3ArrowMovement12:
-	db D_UP,$01
-	db $FF
+	db D_UP, 1
+	db -1 ; end
 
 RocketHideout3Script3:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/Route16Gate1F.asm
+++ b/scripts/Route16Gate1F.asm
@@ -44,11 +44,11 @@
 	ret
 
 CoordsData_49714:
-	db $07,$04
-	db $08,$04
-	db $09,$04
-	db $0A,$04
-	db $FF
+	dbmapcoord  4,  7
+	dbmapcoord  4,  8
+	dbmapcoord  4,  9
+	dbmapcoord  4, 10
+	db -1 ; end
 
 Route16GateScript1:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/Route18Gate1F.asm
+++ b/scripts/Route18Gate1F.asm
@@ -44,11 +44,11 @@
 	ret
 
 CoordsData_498cc:
-	db $03,$04
-	db $04,$04
-	db $05,$04
-	db $06,$04
-	db $FF
+	dbmapcoord  4,  3
+	dbmapcoord  4,  4
+	dbmapcoord  4,  5
+	dbmapcoord  4,  6
+	db -1 ; end
 
 Route18GateScript1:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/Route20.asm
+++ b/scripts/Route20.asm
@@ -33,7 +33,7 @@
 	db HS_SEAFOAM_ISLANDS_B2F_BOULDER_2
 	db HS_SEAFOAM_ISLANDS_B3F_BOULDER_3
 	db HS_SEAFOAM_ISLANDS_B3F_BOULDER_4
-	db $FF
+	db -1 ; end
 
 .asm_50cef
 	CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE
--- a/scripts/Route22.asm
+++ b/scripts/Route22.asm
@@ -52,7 +52,7 @@
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
-	db $FF
+	db -1 ; end
 
 Route22Script0:
 	CheckEvent EVENT_ROUTE22_RIVAL_WANTS_BATTLE
@@ -75,9 +75,9 @@
 	ret
 
 .Route22RivalBattleCoords
-	db $04, $1D
-	db $05, $1D
-	db $FF
+	dbmapcoord 29,  4
+	dbmapcoord 29,  5
+	db -1 ; end
 
 .firstRivalBattle
 	ld a, $1
@@ -141,9 +141,9 @@
 
 StarterMons_50faf:
 ; starter the rival picked, rival trainer number
-	db STARTER2,$04
-	db STARTER3,$05
-	db STARTER1,$06
+	db STARTER2, 4
+	db STARTER3, 5
+	db STARTER1, 6
 
 Route22Script2:
 	ld a, [wIsInBattle]
@@ -202,7 +202,7 @@
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 Route22RivalExitMovementData2:
 	db NPC_MOVEMENT_UP
@@ -215,7 +215,7 @@
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 Route22Script3:
 	ld a, [wd730]
@@ -296,9 +296,9 @@
 	ret
 
 StarterMons_510d9:
-	db STARTER2,$0a
-	db STARTER3,$0b
-	db STARTER1,$0c
+	db STARTER2, 10
+	db STARTER3, 11
+	db STARTER1, 12
 
 Route22Script5:
 	ld a, [wIsInBattle]
@@ -355,12 +355,11 @@
 
 MovementData_5114c:
 	db NPC_MOVEMENT_LEFT
-
 MovementData_5114d:
 	db NPC_MOVEMENT_LEFT
 	db NPC_MOVEMENT_LEFT
 	db NPC_MOVEMENT_LEFT
-	db $FF
+	db -1 ; end
 
 Route22Script6:
 	ld a, [wd730]
--- a/scripts/Route22Gate.asm
+++ b/scripts/Route22Gate.asm
@@ -28,9 +28,9 @@
 	jp DisplayTextID
 
 Route22GateScriptCoords:
-	db 2,4
-	db 2,5
-	db $ff
+	dbmapcoord  4,  2
+	dbmapcoord  5,  2
+	db -1 ; end
 
 Route22GateScript_1e6ba:
 	ld a, $1
--- a/scripts/Route23.asm
+++ b/scripts/Route23.asm
@@ -32,16 +32,16 @@
 	EventFlagBit c, EVENT_PASSED_EARTHBADGE_CHECK + 1, EVENT_PASSED_CASCADEBADGE_CHECK
 .asm_51224
 	ld a, [hli]
-	cp $ff
+	cp -1
 	ret z
 	inc e
 	dec c
 	cp b
 	jr nz, .asm_51224
-	cp $23
+	cp 35
 	jr nz, .asm_51237
 	ld a, [wXCoord]
-	cp $e
+	cp 14
 	ret nc
 .asm_51237
 	ld a, e
@@ -61,8 +61,14 @@
 	ret
 
 YCoordsData_51255:
-	db $23,$38,$55,$60,$69,$77,$88
-	db $FF
+	db 35
+	db 56
+	db 85
+	db 96
+	db 105
+	db 119
+	db 136
+	db -1 ; end
 
 Route23Script_5125d:
 	ld hl, BadgeTextPointers
--- a/scripts/Route24.asm
+++ b/scripts/Route24.asm
@@ -45,8 +45,8 @@
 	ret
 
 CoordsData_5140e:
-	db $0F,$0A
-	db $FF
+	dbmapcoord 10, 15
+	db -1 ; end
 
 Route24Script4:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/Route5Gate.asm
+++ b/scripts/Route5Gate.asm
@@ -46,9 +46,9 @@
 	ret
 
 CoordsData_1df8f:
-	db 3,3
-	db 3,4
-	db $ff
+	dbmapcoord  3,  3
+	dbmapcoord  4,  3
+	db -1 ; end
 
 Route5GateScript1:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/Route6Gate.asm
+++ b/scripts/Route6Gate.asm
@@ -39,9 +39,9 @@
 	jp DisplayTextID
 
 CoordsData_1e08c:
-	db $02,$03
-	db $02,$04
-	db $FF
+	dbmapcoord  3,  2
+	dbmapcoord  4,  2
+	db -1 ; end
 
 Route6GateScript1:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/Route7Gate.asm
+++ b/scripts/Route7Gate.asm
@@ -52,9 +52,9 @@
 	ret
 
 CoordsData_1e167:
-	db 3,3
-	db 4,3
-	db $ff
+	dbmapcoord  3,  3
+	dbmapcoord  3,  4
+	db -1 ; end
 
 Route7GateScript1:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/Route8Gate.asm
+++ b/scripts/Route8Gate.asm
@@ -50,9 +50,9 @@
 	jp DisplayTextID
 
 CoordsData_1e22c:
-	db 3,2
-	db 4,2
-	db $ff
+	dbmapcoord  2,  3
+	dbmapcoord  2,  4
+	db -1 ; end
 
 Route8GateScript1:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/SSAnne2F.asm
+++ b/scripts/SSAnne2F.asm
@@ -58,17 +58,16 @@
 
 MovementData_6140c:
 	db NPC_MOVEMENT_DOWN
-
 MovementData_6140d:
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 CoordsData_61411:
-	db $08,$24
-	db $08,$25
-	db $FF
+	dbmapcoord 36,  8
+	dbmapcoord 37,  8
+	db -1 ; end
 
 SSAnne2Script_61416:
 	ld a, [wXCoord]
@@ -156,13 +155,12 @@
 MovementData_614b7:
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_DOWN
-
 MovementData_614b9:
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 SSAnne2Script3:
 	ld a, [wd730]
--- a/scripts/SafariZoneGate.asm
+++ b/scripts/SafariZoneGate.asm
@@ -43,9 +43,9 @@
 	ret
 
 .CoordsData_75221:
-	db $02,$03
-	db $02,$04
-	db $FF
+	dbmapcoord  3,  2
+	dbmapcoord  4,  2
+	db -1 ; end
 
 .SafariZoneEntranceScript1
 	call SafariZoneEntranceScript_752b4
--- a/scripts/SeafoamIslands1F.asm
+++ b/scripts/SeafoamIslands1F.asm
@@ -38,9 +38,9 @@
 	jp IsPlayerOnDungeonWarp
 
 Seafoam1HolesCoords:
-	db $06,$11
-	db $06,$18
-	db $ff
+	dbmapcoord 17,  6
+	dbmapcoord 24,  6
+	db -1 ; end
 
 SeafoamIslands1F_TextPointers:
 	dw BoulderText
--- a/scripts/SeafoamIslandsB1F.asm
+++ b/scripts/SeafoamIslandsB1F.asm
@@ -37,9 +37,9 @@
 	jp IsPlayerOnDungeonWarp
 
 Seafoam2HolesCoords:
-	db $06,$12
-	db $06,$17
-	db $ff
+	dbmapcoord 18,  6
+	dbmapcoord 23,  6
+	db -1 ; end
 
 SeafoamIslandsB1F_TextPointers:
 	dw BoulderText
--- a/scripts/SeafoamIslandsB2F.asm
+++ b/scripts/SeafoamIslandsB2F.asm
@@ -37,9 +37,9 @@
 	jp IsPlayerOnDungeonWarp
 
 Seafoam3HolesCoords:
-	db $06,$13
-	db $06,$16
-	db $ff
+	dbmapcoord 19,  6
+	dbmapcoord 22,  6
+	db -1 ; end
 
 SeafoamIslandsB2F_TextPointers:
 	dw BoulderText
--- a/scripts/SeafoamIslandsB3F.asm
+++ b/scripts/SeafoamIslandsB3F.asm
@@ -45,9 +45,9 @@
 	jp CallFunctionInTable
 
 Seafoam4HolesCoords:
-	db $10,$03
-	db $10,$06
-	db $ff
+	dbmapcoord  3, 16
+	dbmapcoord  6, 16
+	db -1 ; end
 
 SeafoamIslandsB3F_ScriptPointers:
 	dw SeafoamIslands4Script0
@@ -77,10 +77,10 @@
 	ret
 
 RLEMovement46632:
-	db D_DOWN,6
-	db D_RIGHT,5
-	db D_DOWN,3
-	db $ff
+	db D_DOWN, 6
+	db D_RIGHT, 5
+	db D_DOWN, 3
+	db -1 ; end
 
 SeafoamIslands4Script1:
 	ld a, [wSimulatedJoypadStatesIndex]
@@ -120,17 +120,17 @@
 	ret
 
 RLEData_4667f:
-	db D_DOWN,$06
-	db D_RIGHT,$02
-	db D_DOWN,$04
-	db D_LEFT,$01
-	db $FF
+	db D_DOWN, 6
+	db D_RIGHT, 2
+	db D_DOWN, 4
+	db D_LEFT, 1
+	db -1 ; end
 
 RLEData_46688:
-	db D_DOWN,$06
-	db D_RIGHT,$02
-	db D_DOWN,$04
-	db $FF
+	db D_DOWN, 6
+	db D_RIGHT, 2
+	db D_DOWN, 4
+	db -1 ; end
 
 SeafoamIslands4Script3:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/SeafoamIslandsB4F.asm
+++ b/scripts/SeafoamIslandsB4F.asm
@@ -53,11 +53,11 @@
 	ret
 
 .Coords
-	db $11,$14
-	db $11,$15
-	db $10,$14
-	db $10,$15
-	db $FF
+	dbmapcoord 20, 17
+	dbmapcoord 21, 17
+	dbmapcoord 20, 16
+	dbmapcoord 21, 16
+	db -1 ; end
 
 SeafoamIslands5Script1:
 	ld a, [wSimulatedJoypadStatesIndex]
@@ -96,21 +96,21 @@
 	ret
 
 .Coords
-	db $0E,$04
-	db $0E,$05
-	db $FF
+	dbmapcoord  4, 14
+	dbmapcoord  5, 14
+	db -1 ; end
 
 RLEMovementData_46852:
-	db D_UP,$03
-	db D_RIGHT,$02
-	db D_UP,$01
-	db $FF
+	db D_UP, 3
+	db D_RIGHT, 2
+	db D_UP, 1
+	db -1 ; end
 
 RLEMovementData_46859:
-	db D_UP,$03
-	db D_RIGHT,$03
-	db D_UP,$01
-	db $FF
+	db D_UP, 3
+	db D_RIGHT, 3
+	db D_UP, 1
+	db -1 ; end
 
 SeafoamIslands5Script3:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/SilphCo10F.asm
+++ b/scripts/SilphCo10F.asm
@@ -24,8 +24,8 @@
 	predef_jump ReplaceTileBlock
 
 SilphCo10GateCoords:
-	db $04,$05
-	db $FF
+	dbmapcoord  5,  4
+	db -1 ; end
 
 SilphCo10Text_5a176:
 	ldh a, [hUnlockedSilphCoDoors]
--- a/scripts/SilphCo11F.asm
+++ b/scripts/SilphCo11F.asm
@@ -24,8 +24,8 @@
 	predef_jump ReplaceTileBlock
 
 SilphCo11GateCoords:
-	db $06,$03
-	db $FF
+	dbmapcoord  3,  6
+	db -1 ; end
 
 SilphCo11Script_62137:
 	push hl
@@ -85,7 +85,7 @@
 	ld hl, MissableObjectIDs_62194
 .asm_62184
 	ld a, [hli]
-	cp $ff
+	cp -1
 	ret z
 	push hl
 	ld [wMissableObjectIndex], a
@@ -100,7 +100,7 @@
 	db HS_SAFFRON_CITY_B
 	db HS_SAFFRON_CITY_C
 	db HS_SAFFRON_CITY_D
-	db $FF
+	db -1 ; end
 
 MissableObjectIDs_6219b:
 	db HS_SAFFRON_CITY_1
@@ -143,7 +143,7 @@
 	db HS_SILPH_CO_11F_1
 	db HS_SILPH_CO_11F_2
 	db HS_SILPH_CO_11F_3
-	db $FF
+	db -1 ; end
 
 SilphCo11Script_621c4:
 	xor a
@@ -186,15 +186,15 @@
 	jp SilphCo11Script_621c8
 
 CoordsData_62211:
-	db $0D,$06
-	db $0C,$07
-	db $FF
+	dbmapcoord  6, 13
+	dbmapcoord  7, 12
+	db -1 ; end
 
 MovementData_62216:
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 SilphCo11Script_6221a:
 	ld [wPlayerMovingDirection], a
--- a/scripts/SilphCo2F.asm
+++ b/scripts/SilphCo2F.asm
@@ -33,9 +33,9 @@
 	predef_jump ReplaceTileBlock
 
 SilphCo2GateCoords:
-	db $02,$02
-	db $05,$02
-	db $FF
+	dbmapcoord  2,  2
+	dbmapcoord  2,  5
+	db -1 ; end
 
 SilphCo2Script_59d43:
 	push hl
--- a/scripts/SilphCo3F.asm
+++ b/scripts/SilphCo3F.asm
@@ -33,9 +33,9 @@
 	predef_jump ReplaceTileBlock
 
 SilphCo3GateCoords:
-	db $04,$04
-	db $04,$08
-	db $FF
+	dbmapcoord  4,  4
+	dbmapcoord  8,  4
+	db -1 ; end
 
 SilphCo3Script_59fad:
 	EventFlagAddress hl, EVENT_SILPH_CO_3_UNLOCKED_DOOR1
--- a/scripts/SilphCo4F.asm
+++ b/scripts/SilphCo4F.asm
@@ -33,9 +33,9 @@
 	predef_jump ReplaceTileBlock
 
 SilphCo4GateCoords:
-	db $06,$02
-	db $04,$06
-	db $FF
+	dbmapcoord  2,  6
+	dbmapcoord  6,  4
+	db -1 ; end
 
 SilphCo4Script_19d5d:
 	push hl
--- a/scripts/SilphCo5F.asm
+++ b/scripts/SilphCo5F.asm
@@ -42,10 +42,10 @@
 	predef_jump ReplaceTileBlock
 
 SilphCo5GateCoords:
-	db $02,$03
-	db $06,$03
-	db $05,$07
-	db $FF
+	dbmapcoord  3,  2
+	dbmapcoord  3,  6
+	dbmapcoord  7,  5
+	db -1 ; end
 
 SilphCo5Script_19f9e:
 	EventFlagAddress hl, EVENT_SILPH_CO_5_UNLOCKED_DOOR1
--- a/scripts/SilphCo6F.asm
+++ b/scripts/SilphCo6F.asm
@@ -24,8 +24,8 @@
 	predef_jump ReplaceTileBlock
 
 SilphCo6GateCoords:
-	db $06,$02
-	db $FF
+	dbmapcoord  2,  6
+	db -1 ; end
 
 SilphCo6Script_1a1e6:
 	ldh a, [hUnlockedSilphCoDoors]
--- a/scripts/SilphCo7F.asm
+++ b/scripts/SilphCo7F.asm
@@ -42,10 +42,10 @@
 	predef_jump ReplaceTileBlock
 
 SilphCo7GateCoords:
-	db $03,$05
-	db $02,$0A
-	db $06,$0A
-	db $FF
+	dbmapcoord  5,  3
+	dbmapcoord 10,  2
+	dbmapcoord 10,  6
+	db -1 ; end
 
 SilphCo7Text_51bc8:
 	push hl
@@ -156,9 +156,9 @@
 	jp SilphCo7Text_51c10
 
 CoordsData_51c78:
-	db $02,$03
-	db $03,$03
-	db $FF
+	dbmapcoord  3,  2
+	dbmapcoord  3,  3
+	db -1 ; end
 
 MovementData_51c7d:
 	db NPC_MOVEMENT_UP
@@ -165,7 +165,7 @@
 	db NPC_MOVEMENT_UP
 	db NPC_MOVEMENT_UP
 	db NPC_MOVEMENT_UP
-	db $FF
+	db -1 ; end
 
 SilphCo7Script3:
 	ld a, [wd730]
@@ -238,7 +238,7 @@
 MovementData_51d1a:
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
-	db $FF
+	db -1 ; end
 
 MovementData_51d1d:
 	db NPC_MOVEMENT_LEFT
@@ -248,7 +248,7 @@
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_RIGHT
 	db NPC_MOVEMENT_DOWN
-	db $FF
+	db -1 ; end
 
 SilphCo7Script5:
 	ld a, [wd730]
--- a/scripts/SilphCo8F.asm
+++ b/scripts/SilphCo8F.asm
@@ -24,8 +24,8 @@
 	predef_jump ReplaceTileBlock
 
 SilphCo8GateCoords:
-	db $04,$03
-	db $FF
+	dbmapcoord  3,  4
+	db -1 ; end
 
 SilphCo8Script_56541:
 	push hl
--- a/scripts/SilphCo9F.asm
+++ b/scripts/SilphCo9F.asm
@@ -51,11 +51,11 @@
 	predef_jump ReplaceTileBlock
 
 SilphCo9GateCoords:
-	db $04,$01
-	db $02,$09
-	db $05,$09
-	db $06,$05
-	db $FF
+	dbmapcoord  1,  4
+	dbmapcoord  9,  2
+	dbmapcoord  9,  5
+	dbmapcoord  5,  6
+	db -1 ; end
 
 SilphCo9Script_5d837:
 	push hl
--- a/scripts/VermilionCity.asm
+++ b/scripts/VermilionCity.asm
@@ -68,8 +68,8 @@
 	ret
 
 SSAnneTicketCheckCoords:
-	db $1e,$12 ; y, x
-	db $ff
+	dbmapcoord 18, 30
+	db -1 ; end
 
 VermilionCityScript4:
 	ld hl, SSAnneTicketCheckCoords
@@ -191,9 +191,9 @@
 	jp TextScriptEnd
 
 .inFrontOfOrBehindGuardCoords
-	db $1d,$13 ; y, x of tile in front of guard
-	db $1f,$13 ; y, x of tile behind guard
-	db $ff
+	dbmapcoord 19, 29 ; in front of guard
+	dbmapcoord 19, 31 ; behind guard
+	db -1 ; end
 
 SSAnneWelcomeText4:
 	text_far _SSAnneWelcomeText4
--- a/scripts/VermilionDock.asm
+++ b/scripts/VermilionDock.asm
@@ -155,6 +155,7 @@
 	ret
 
 VermilionDockOAMBlock:
+	; tile id, attribute
 	db $fc, $10
 	db $fd, $10
 	db $fe, $10
--- a/scripts/VictoryRoad1F.asm
+++ b/scripts/VictoryRoad1F.asm
@@ -35,8 +35,8 @@
 	ret
 
 CoordsData_5da5c:
-	db $0D,$11
-	db $FF
+	dbmapcoord 17, 13
+	db -1 ; end
 
 VictoryRoad1F_TextPointers:
 	dw VictoryRoad1Text1
--- a/scripts/VictoryRoad2F.asm
+++ b/scripts/VictoryRoad2F.asm
@@ -64,9 +64,9 @@
 	ret
 
 CoordsData_51816:
-	db $10,$01
-	db $10,$09
-	db $FF
+	dbmapcoord  1, 16
+	dbmapcoord  9, 16
+	db -1 ; end
 
 VictoryRoad2F_TextPointers:
 	dw VictoryRoad2Text1
--- a/scripts/VictoryRoad3F.asm
+++ b/scripts/VictoryRoad3F.asm
@@ -51,9 +51,9 @@
 	predef_jump ShowObject
 
 .coordsData_449f9:
-	db $05,$03
-	db $0F,$17
-	db $FF
+	dbmapcoord  3,  5
+	dbmapcoord 23, 15
+	db -1 ; end
 
 .asm_449fe
 	ld a, VICTORY_ROAD_2F
--- a/scripts/ViridianGym.asm
+++ b/scripts/ViridianGym.asm
@@ -49,84 +49,68 @@
 	ld [wCurMapScript], a
 	ret
 
-;format:
-;db y,x
-;dw pointer to movement
 ViridianGymArrowTilePlayerMovement:
-	db $b,$13
-	dw ViridianGymArrowMovement1
-	db $1,$13
-	dw ViridianGymArrowMovement2
-	db $2,$12
-	dw ViridianGymArrowMovement3
-	db $2,$b
-	dw ViridianGymArrowMovement4
-	db $a,$10
-	dw ViridianGymArrowMovement5
-	db $6,$4
-	dw ViridianGymArrowMovement6
-	db $d,$5
-	dw ViridianGymArrowMovement7
-	db $e,$4
-	dw ViridianGymArrowMovement8
-	db $f,$0
-	dw ViridianGymArrowMovement9
-	db $f,$1
-	dw ViridianGymArrowMovement10
-	db $10,$d
-	dw ViridianGymArrowMovement11
-	db $11,$d
-	dw ViridianGymArrowMovement12
-	db $FF
+	map_coord_movement 19, 11, ViridianGymArrowMovement1
+	map_coord_movement 19,  1, ViridianGymArrowMovement2
+	map_coord_movement 18,  2, ViridianGymArrowMovement3
+	map_coord_movement 11,  2, ViridianGymArrowMovement4
+	map_coord_movement 16, 10, ViridianGymArrowMovement5
+	map_coord_movement  4,  6, ViridianGymArrowMovement6
+	map_coord_movement  5, 13, ViridianGymArrowMovement7
+	map_coord_movement  4, 14, ViridianGymArrowMovement8
+	map_coord_movement  0, 15, ViridianGymArrowMovement9
+	map_coord_movement  1, 15, ViridianGymArrowMovement10
+	map_coord_movement 13, 16, ViridianGymArrowMovement11
+	map_coord_movement 13, 17, ViridianGymArrowMovement12
+	db -1 ; end
 
-;format: direction, count
 ViridianGymArrowMovement1:
-	db D_UP,$09
-	db $FF
+	db D_UP, 9
+	db -1 ; end
 
 ViridianGymArrowMovement2:
-	db D_LEFT,$08
-	db $FF
+	db D_LEFT, 8
+	db -1 ; end
 
 ViridianGymArrowMovement3:
-	db D_DOWN,$09
-	db $FF
+	db D_DOWN, 9
+	db -1 ; end
 
 ViridianGymArrowMovement4:
-	db D_RIGHT,$06
-	db $FF
+	db D_RIGHT, 6
+	db -1 ; end
 
 ViridianGymArrowMovement5:
-	db D_DOWN,$02
-	db $FF
+	db D_DOWN, 2
+	db -1 ; end
 
 ViridianGymArrowMovement6:
-	db D_DOWN,$07
-	db $FF
+	db D_DOWN, 7
+	db -1 ; end
 
 ViridianGymArrowMovement7:
-	db D_RIGHT,$08
-	db $FF
+	db D_RIGHT, 8
+	db -1 ; end
 
 ViridianGymArrowMovement8:
-	db D_RIGHT,$09
-	db $FF
+	db D_RIGHT, 9
+	db -1 ; end
 
 ViridianGymArrowMovement9:
-	db D_UP,$08
-	db $FF
+	db D_UP, 8
+	db -1 ; end
 
 ViridianGymArrowMovement10:
-	db D_UP,$06
-	db $FF
+	db D_UP, 6
+	db -1 ; end
 
 ViridianGymArrowMovement11:
-	db D_LEFT,$06
-	db $FF
+	db D_LEFT, 6
+	db -1 ; end
 
 ViridianGymArrowMovement12:
-	db D_LEFT,$0C
-	db $FF
+	db D_LEFT, 12
+	db -1 ; end
 
 ViridianGymScript4:
 	ld a, [wSimulatedJoypadStatesIndex]
--- a/scripts/ViridianMart.asm
+++ b/scripts/ViridianMart.asm
@@ -40,9 +40,9 @@
 	ret
 
 RLEMovement1d4bb:
-	db D_LEFT, $01
-	db D_UP, $02
-	db $ff
+	db D_LEFT, 1
+	db D_UP, 2
+	db -1 ; end
 
 ViridianMartScript1:
 	ld a, [wSimulatedJoypadStatesIndex]