ref: 82a05a1752b476caab8951fe03f539dcc1a63669
parent: e2b378f5e32ea1416fbc9ac5e96d23be244e4a6b
parent: 50fc9c3389ae8130d3670683f22f3e49555c57a3
author: yenatch <[email protected]>
date: Thu Dec 28 14:34:43 EST 2017
Merge pull request #443 from xCrystal/master Misc style cleanup and documentation
--- a/constants/deco_constants.asm
+++ b/constants/deco_constants.asm
@@ -57,7 +57,7 @@
deco: MACRO
const DECO_\1
enum DECOFLAG_\1
-endm
+ENDM
; decorations:
; - DecorationAttributes (see data/decorations/attributes.asm)
--- a/constants/engine_flags.asm
+++ b/constants/engine_flags.asm
@@ -16,7 +16,7 @@
const ENGINE_DST
; wUnusedTwoDayTimerOn
const ENGINE_0A
-; StatusFlags
+; wStatusFlags
const ENGINE_POKEDEX
const ENGINE_UNOWN_DEX
const ENGINE_POKERUS
@@ -23,7 +23,7 @@
const ENGINE_ROCKET_SIGNAL_ON_CH20
const ENGINE_CREDITS_SKIP
const ENGINE_BUG_CONTEST_ON ; 10
-; StatusFlags2
+; wStatusFlags2
const ENGINE_BUG_CONTEST_TIMER
const ENGINE_SAFARI_ZONE
const ENGINE_ROCKETS_IN_RADIO_TOWER
@@ -31,11 +31,11 @@
const ENGINE_GIVE_POKERUS
const ENGINE_FLORIA
const ENGINE_ROCKETS_IN_MAHOGANY
-; BikeFlags
+; wBikeFlags
const ENGINE_STRENGTH_ACTIVE
const ENGINE_ALWAYS_ON_BIKE
const ENGINE_DOWNHILL
-; JohtoBadges
+; wJohtoBadges
const ENGINE_ZEPHYRBADGE
const ENGINE_HIVEBADGE
const ENGINE_PLAINBADGE
@@ -44,7 +44,7 @@
const ENGINE_STORMBADGE ; 20
const ENGINE_GLACIERBADGE
const ENGINE_RISINGBADGE
-; KantoBadges
+; wKantoBadges
const ENGINE_BOULDERBADGE
const ENGINE_CASCADEBADGE
const ENGINE_THUNDERBADGE
@@ -53,7 +53,7 @@
const ENGINE_MARSHBADGE
const ENGINE_VOLCANOBADGE
const ENGINE_EARTHBADGE
-; UnlockedUnowns
+; wUnlockedUnowns
const ENGINE_UNLOCKED_UNOWNS_1
const ENGINE_UNLOCKED_UNOWNS_2
const ENGINE_UNLOCKED_UNOWNS_3
@@ -62,7 +62,7 @@
const ENGINE_UNLOCKED_UNOWNS_6 ; 30
const ENGINE_UNLOCKED_UNOWNS_7
const ENGINE_UNLOCKED_UNOWNS_8
-; VisitedSpawns
+; wVisitedSpawns
const ENGINE_FLYPOINT_KRISS_HOUSE
const ENGINE_FLYPOINT_VIRIDIAN_POKECENTER
const ENGINE_FLYPOINT_PALLET
@@ -92,9 +92,9 @@
const ENGINE_FLYPOINT_UNUSED
; wLuckyNumberShowFlag
const ENGINE_LUCKY_NUMBER_SHOW
-; StatusFlags2
+; wStatusFlags2
const ENGINE_4F
-; DailyFlags
+; wDailyFlags
const ENGINE_KURT_MAKING_BALLS ; 50
const ENGINE_DAILY_BUG_CONTEST
const ENGINE_SPECIAL_WILDDATA
@@ -103,7 +103,7 @@
const ENGINE_SHUCKLE_GIVEN
const ENGINE_GOLDENROD_UNDERGROUND_MERCHANT_CLOSED
const ENGINE_FOUGHT_IN_TRAINER_HALL_TODAY
-; WeeklyFlags
+; wWeeklyFlags
const ENGINE_MT_MOON_SQUARE_CLEFAIRY
const ENGINE_UNION_CAVE_LAPRAS
const ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT
@@ -112,12 +112,12 @@
const ENGINE_INDIGO_PLATEAU_RIVAL_FIGHT
const ENGINE_DAILY_MOVE_TUTOR
const ENGINE_BUENAS_PASSWORD
-; SwarmFlags
+; wSwarmFlags
const ENGINE_BUENAS_PASSWORD_2 ; 60
const ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON
-; GameTimerPause
+; wGameTimerPause
const ENGINE_62
-; PlayerGender
+; wPlayerGender
const ENGINE_PLAYER_IS_FEMALE
; wCelebiEvent
const ENGINE_HAVE_EXAMINED_GS_BALL
@@ -184,7 +184,7 @@
const ENGINE_ERIN_SATURDAY_NIGHT
; wPlayerSpriteSetupFlags
const ENGINE_KRIS_IN_CABLE_CLUB
-; SwarmFlags
+; wSwarmFlags
const ENGINE_DUNSPARCE_SWARM ; a0
const ENGINE_YANMA_SWARM
NUM_ENGINE_FLAGS EQU const_value
--- a/constants/map_constants.asm
+++ b/constants/map_constants.asm
@@ -1,9 +1,9 @@
-newgroup: macro
+newgroup: MACRO
const_value = const_value + 1
enum_start 1
-endm
+ENDM
-mapgroup: macro
+mapgroup: MACRO
;\1: map id
;\2: height: in blocks
;\3: width: in blocks
@@ -11,7 +11,7 @@
enum MAP_\1
\1_HEIGHT EQU \2
\1_WIDTH EQU \3
-endm
+ENDM
; map group ids
; `newgroup` indexes are for:
--- a/constants/wram_constants.asm
+++ b/constants/wram_constants.asm
@@ -131,7 +131,7 @@
const DEXMODE_ABC
const DEXMODE_UNOWN
-; JohtoBadges:
+; wJohtoBadges:
const_def
const ZEPHYRBADGE
const HIVEBADGE
@@ -143,7 +143,7 @@
const RISINGBADGE
NUM_JOHTO_BADGES EQU const_value
-; KantoBadges:
+; wKantoBadges:
const_def
const BOULDERBADGE
const CASCADEBADGE
--- a/data/battle_anims/objects.asm
+++ b/data/battle_anims/objects.asm
@@ -14,7 +14,7 @@
db \4 ; callback
db \5 ; palette
db \6 ; tile offset
-endm
+ENDM
BattleAnimObjects: ; ccb56
; entries correspond to ANIM_OBJ_* constants
--- a/data/emotes.asm
+++ b/data/emotes.asm
@@ -2,7 +2,7 @@
; graphics pointer, length, starting tile
dw \1
db \2 tiles, BANK(\1)
- dw VTiles1 tile \3
+ dw vTiles1 tile \3
ENDM
Emotes: ; 144d
--- a/data/engine_flags.asm
+++ b/data/engine_flags.asm
@@ -26,110 +26,110 @@
engine_flag wUnusedTwoDayTimerOn, 0 ; unused, possibly related to a 2-day timer
- engine_flag StatusFlags, 0 ; pokedex
- engine_flag StatusFlags, 1 ; unown dex
- engine_flag StatusFlags, 3 ; pokerus
- engine_flag StatusFlags, 4 ; rocket signal on ch20
- engine_flag StatusFlags, 6 ; credits skip
- engine_flag StatusFlags, 7 ; bug contest on ; $10
- engine_flag StatusFlags2, 2 ; bug contest timer
- engine_flag StatusFlags2, 1 ; safari zone?
- engine_flag StatusFlags2, 0 ; rockets in radio tower
- engine_flag StatusFlags2, 4 ; bike shop call enabled (1024 bike steps reqd)
- engine_flag StatusFlags2, 5 ; give pokerus
- engine_flag StatusFlags2, 6 ; berry -> berry juice when trading?
- engine_flag StatusFlags2, 7 ; rockets in mahogany
+ engine_flag wStatusFlags, 0 ; pokedex
+ engine_flag wStatusFlags, 1 ; unown dex
+ engine_flag wStatusFlags, 3 ; pokerus
+ engine_flag wStatusFlags, 4 ; rocket signal on ch20
+ engine_flag wStatusFlags, 6 ; credits skip
+ engine_flag wStatusFlags, 7 ; bug contest on ; $10
+ engine_flag wStatusFlags2, 2 ; bug contest timer
+ engine_flag wStatusFlags2, 1 ; safari zone?
+ engine_flag wStatusFlags2, 0 ; rockets in radio tower
+ engine_flag wStatusFlags2, 4 ; bike shop call enabled (1024 bike steps reqd)
+ engine_flag wStatusFlags2, 5 ; give pokerus
+ engine_flag wStatusFlags2, 6 ; berry -> berry juice when trading?
+ engine_flag wStatusFlags2, 7 ; rockets in mahogany
- engine_flag BikeFlags, 0 ; strength active ; $18
- engine_flag BikeFlags, 1 ; always on bike (cant surf)
- engine_flag BikeFlags, 2 ; downhill (cycling road)
+ engine_flag wBikeFlags, 0 ; strength active ; $18
+ engine_flag wBikeFlags, 1 ; always on bike (cant surf)
+ engine_flag wBikeFlags, 2 ; downhill (cycling road)
- engine_flag JohtoBadges, 0 ; zephyrbadge
- engine_flag JohtoBadges, 1 ; hivebadge
- engine_flag JohtoBadges, 2 ; plainbadge
- engine_flag JohtoBadges, 3 ; fogbadge
- engine_flag JohtoBadges, 4 ; mineralbadge
- engine_flag JohtoBadges, 5 ; stormbadge ; $20
- engine_flag JohtoBadges, 6 ; glacierbadge
- engine_flag JohtoBadges, 7 ; risingbadge
+ engine_flag wJohtoBadges, 0 ; zephyrbadge
+ engine_flag wJohtoBadges, 1 ; hivebadge
+ engine_flag wJohtoBadges, 2 ; plainbadge
+ engine_flag wJohtoBadges, 3 ; fogbadge
+ engine_flag wJohtoBadges, 4 ; mineralbadge
+ engine_flag wJohtoBadges, 5 ; stormbadge ; $20
+ engine_flag wJohtoBadges, 6 ; glacierbadge
+ engine_flag wJohtoBadges, 7 ; risingbadge
- engine_flag KantoBadges, 0 ; boulderbadge
- engine_flag KantoBadges, 1 ; cascadebadge
- engine_flag KantoBadges, 2 ; thunderbadge
- engine_flag KantoBadges, 3 ; rainbowbadge
- engine_flag KantoBadges, 4 ; soulbadge
- engine_flag KantoBadges, 5 ; marshbadge ; $28
- engine_flag KantoBadges, 6 ; volcanobadge
- engine_flag KantoBadges, 7 ; earthbadge
+ engine_flag wKantoBadges, 0 ; boulderbadge
+ engine_flag wKantoBadges, 1 ; cascadebadge
+ engine_flag wKantoBadges, 2 ; thunderbadge
+ engine_flag wKantoBadges, 3 ; rainbowbadge
+ engine_flag wKantoBadges, 4 ; soulbadge
+ engine_flag wKantoBadges, 5 ; marshbadge ; $28
+ engine_flag wKantoBadges, 6 ; volcanobadge
+ engine_flag wKantoBadges, 7 ; earthbadge
; unown sets
- engine_flag UnlockedUnowns, 0 ; 1
- engine_flag UnlockedUnowns, 1 ; 2
- engine_flag UnlockedUnowns, 2 ; 3
- engine_flag UnlockedUnowns, 3 ; 4
- engine_flag UnlockedUnowns, 4 ; 5
- engine_flag UnlockedUnowns, 5 ; 6 ; $30
- engine_flag UnlockedUnowns, 6 ; 7
- engine_flag UnlockedUnowns, 7 ; 8
+ engine_flag wUnlockedUnowns, 0 ; 1
+ engine_flag wUnlockedUnowns, 1 ; 2
+ engine_flag wUnlockedUnowns, 2 ; 3
+ engine_flag wUnlockedUnowns, 3 ; 4
+ engine_flag wUnlockedUnowns, 4 ; 5
+ engine_flag wUnlockedUnowns, 5 ; 6 ; $30
+ engine_flag wUnlockedUnowns, 6 ; 7
+ engine_flag wUnlockedUnowns, 7 ; 8
; fly
- engine_flag VisitedSpawns, 0 ; your house
- engine_flag VisitedSpawns, 1 ; viridian pokecenter
- engine_flag VisitedSpawns, 2 ; pallet
- engine_flag VisitedSpawns, 3 ; viridian
- engine_flag VisitedSpawns, 4 ; pewter
- engine_flag VisitedSpawns, 5 ; cerulean ; $38
- engine_flag VisitedSpawns, 6 ; rock tunnel
- engine_flag VisitedSpawns, 7 ; vermilion
- engine_flag VisitedSpawns + 1, 0 ; lavender
- engine_flag VisitedSpawns + 1, 1 ; saffron
- engine_flag VisitedSpawns + 1, 2 ; celadon
- engine_flag VisitedSpawns + 1, 3 ; fuchsia
- engine_flag VisitedSpawns + 1, 4 ; cinnabar
- engine_flag VisitedSpawns + 1, 5 ; indigo plateau ; $40
- engine_flag VisitedSpawns + 1, 6 ; new bark
- engine_flag VisitedSpawns + 1, 7 ; cherrygrove
- engine_flag VisitedSpawns + 2, 0 ; violet
- ; union cave
- engine_flag VisitedSpawns + 2, 2 ; azalea
- engine_flag VisitedSpawns + 2, 3 ; cianwood
- engine_flag VisitedSpawns + 2, 4 ; goldenrod
- engine_flag VisitedSpawns + 2, 5 ; olivine
- engine_flag VisitedSpawns + 2, 6 ; ecruteak ; $48
- engine_flag VisitedSpawns + 2, 7 ; mahogany
- engine_flag VisitedSpawns + 3, 0 ; lake of rage
- engine_flag VisitedSpawns + 3, 1 ; blackthorn
- engine_flag VisitedSpawns + 3, 2 ; silver cave
- ; fast ship
- engine_flag VisitedSpawns + 3, 4 ; unused
+ engine_flag wVisitedSpawns, 0 ; your house
+ engine_flag wVisitedSpawns, 1 ; viridian pokecenter
+ engine_flag wVisitedSpawns, 2 ; pallet
+ engine_flag wVisitedSpawns, 3 ; viridian
+ engine_flag wVisitedSpawns, 4 ; pewter
+ engine_flag wVisitedSpawns, 5 ; cerulean ; $38
+ engine_flag wVisitedSpawns, 6 ; rock tunnel
+ engine_flag wVisitedSpawns, 7 ; vermilion
+ engine_flag wVisitedSpawns + 1, 0 ; lavender
+ engine_flag wVisitedSpawns + 1, 1 ; saffron
+ engine_flag wVisitedSpawns + 1, 2 ; celadon
+ engine_flag wVisitedSpawns + 1, 3 ; fuchsia
+ engine_flag wVisitedSpawns + 1, 4 ; cinnabar
+ engine_flag wVisitedSpawns + 1, 5 ; indigo plateau ; $40
+ engine_flag wVisitedSpawns + 1, 6 ; new bark
+ engine_flag wVisitedSpawns + 1, 7 ; cherrygrove
+ engine_flag wVisitedSpawns + 2, 0 ; violet
+ ; union cave
+ engine_flag wVisitedSpawns + 2, 2 ; azalea
+ engine_flag wVisitedSpawns + 2, 3 ; cianwood
+ engine_flag wVisitedSpawns + 2, 4 ; goldenrod
+ engine_flag wVisitedSpawns + 2, 5 ; olivine
+ engine_flag wVisitedSpawns + 2, 6 ; ecruteak ; $48
+ engine_flag wVisitedSpawns + 2, 7 ; mahogany
+ engine_flag wVisitedSpawns + 3, 0 ; lake of rage
+ engine_flag wVisitedSpawns + 3, 1 ; blackthorn
+ engine_flag wVisitedSpawns + 3, 2 ; silver cave
+ ; fast ship
+ engine_flag wVisitedSpawns + 3, 4 ; unused
engine_flag wLuckyNumberShowFlag, 0 ; lucky number show
- engine_flag StatusFlags2, 3 ; ????
+ engine_flag wStatusFlags2, 3 ; ????
- engine_flag DailyFlags, 0 ; kurt making balls ; $50
- engine_flag DailyFlags, 1 ; ????
- engine_flag DailyFlags, 2 ; special wilddata?
- engine_flag DailyFlags, 3 ; time capsule (24h wait)
- engine_flag DailyFlags, 4 ; all fruit trees
- engine_flag DailyFlags, 5 ; shuckle given
- engine_flag DailyFlags, 6 ; goldenrod underground merchant closed
- engine_flag DailyFlags, 7 ; fought in trainer hall today
+ engine_flag wDailyFlags, 0 ; kurt making balls ; $50
+ engine_flag wDailyFlags, 1 ; ????
+ engine_flag wDailyFlags, 2 ; special wilddata?
+ engine_flag wDailyFlags, 3 ; time capsule (24h wait)
+ engine_flag wDailyFlags, 4 ; all fruit trees
+ engine_flag wDailyFlags, 5 ; shuckle given
+ engine_flag wDailyFlags, 6 ; goldenrod underground merchant closed
+ engine_flag wDailyFlags, 7 ; fought in trainer hall today
- engine_flag WeeklyFlags, 0 ; mt moon square clefairy ; $58
- engine_flag WeeklyFlags, 1 ; union cave lapras
- engine_flag WeeklyFlags, 2 ; goldenrod underground haircut used
- engine_flag WeeklyFlags, 3 ; goldenrod mall happiness event floor05 object07
- engine_flag WeeklyFlags, 4 ; tea in blues house
- engine_flag WeeklyFlags, 5 ; indigo plateau rival fight
- engine_flag WeeklyFlags, 6 ; move tutor
- engine_flag WeeklyFlags, 7 ; buenas password
+ engine_flag wWeeklyFlags, 0 ; mt moon square clefairy ; $58
+ engine_flag wWeeklyFlags, 1 ; union cave lapras
+ engine_flag wWeeklyFlags, 2 ; goldenrod underground haircut used
+ engine_flag wWeeklyFlags, 3 ; goldenrod mall happiness event floor05 object07
+ engine_flag wWeeklyFlags, 4 ; tea in blues house
+ engine_flag wWeeklyFlags, 5 ; indigo plateau rival fight
+ engine_flag wWeeklyFlags, 6 ; move tutor
+ engine_flag wWeeklyFlags, 7 ; buenas password
- engine_flag SwarmFlags, 0 ; buenas password 2
- engine_flag SwarmFlags, 1 ; goldenrod dept store sale is on
+ engine_flag wSwarmFlags, 0 ; buenas password 2
+ engine_flag wSwarmFlags, 1 ; goldenrod dept store sale is on
- engine_flag GameTimerPause, 7 ; $62
+ engine_flag wGameTimerPause, 7 ; $62
- engine_flag PlayerGender, 0 ; player is female
+ engine_flag wPlayerGender, 0 ; player is female
engine_flag wCelebiEvent, 2 ; have gs ball after kurt examined it
@@ -200,7 +200,7 @@
engine_flag wPlayerSpriteSetupFlags, 2 ; female player has been transformed into male
- engine_flag SwarmFlags, 2 ; dunsparce swarm ; $a0
- engine_flag SwarmFlags, 3 ; yanma swarm
+ engine_flag wSwarmFlags, 2 ; dunsparce swarm ; $a0
+ engine_flag wSwarmFlags, 3 ; yanma swarm
; 80648
--- a/data/items/mom_phone.asm
+++ b/data/items/mom_phone.asm
@@ -1,4 +1,4 @@
-momitem: macro
+momitem: MACRO
; money to trigger, cost, kind, item
dt \1
dt \2
--- a/data/map_objects.asm
+++ b/data/map_objects.asm
@@ -1,7 +1,7 @@
-sprite_movement_data: macro
+sprite_movement_data: MACRO
db \1, \2, \3, \4, \5
dn \6, 0
-endm
+ENDM
SpriteMovementData:: ; 4273
; entries correspond to SPRITEMOVEDATA_* constants
--- a/data/odd_eggs.asm
+++ b/data/odd_eggs.asm
@@ -1,7 +1,7 @@
-prob: macro
+prob: MACRO
prob_total = prob_total + (\1)
dw prob_total * $ffff / 100
-endm
+ENDM
OddEggProbabilities:
prob_total = 0
--- a/data/palettes/town_map.asm
+++ b/data/palettes/town_map.asm
@@ -6,13 +6,13 @@
const PAL_TOWNMAP_POI ; 4
const PAL_TOWNMAP_POI_MTN ; 5
-townmappals: macro
+townmappals: MACRO
rept _NARG / 2
dn PAL_TOWNMAP_\2, PAL_TOWNMAP_\1
shift
shift
endr
-endm
+ENDM
; gfx/pokegear/town_map.png
townmappals EARTH, EARTH, EARTH, MOUNTAIN, MOUNTAIN, MOUNTAIN
--- a/data/phone_contacts.asm
+++ b/data/phone_contacts.asm
@@ -1,4 +1,4 @@
-phone: macro
+phone: MACRO
; trainer class, trainer id, map, ?, script 1, ?, script 2
db \1, \2
map \3
@@ -6,7 +6,7 @@
dba \5
db \6
dba \7
-endm
+ENDM
PhoneContacts: ; 9045f
; entries correspond to PHONE_* constants
--- a/data/phone_special.asm
+++ b/data/phone_special.asm
@@ -1,9 +1,9 @@
-specialcall: macro
+specialcall: MACRO
; condition, contact, script
dw \1
db \2
dba \3
-endm
+ENDM
SpecialPhoneCallList: ; 90627
; entries correspond to SPECIALCALL_* constants
--- a/data/unown_words.asm
+++ b/data/unown_words.asm
@@ -1,4 +1,4 @@
-unownword: macro
+unownword: MACRO
x = 1
rept STRLEN(\1)
db STRSUB(\1, x, 1) - $40
@@ -5,7 +5,7 @@
x = x + 1
endr
db -1
-endm
+ENDM
UnownWords: ; fba5a
; entries correspond to Unown forms
--- a/data/wild/roammon_maps.asm
+++ b/data/wild/roammon_maps.asm
@@ -1,7 +1,7 @@
; Maps that roaming monsters can be on, and possible maps they can jump to.
; Notably missing are Route 40 and Route 41, which are water routes.
-roam_map: macro
+roam_map: MACRO
; map, # of other maps, other maps
map \1
db \2
@@ -10,7 +10,7 @@
shift
endr
db 0
-endm
+ENDM
RoamMaps: ; 2a40f
roam_map ROUTE_29, 2, ROUTE_30, ROUTE_46
--- a/data/wild/treemon_maps.asm
+++ b/data/wild/treemon_maps.asm
@@ -1,7 +1,7 @@
-treemon_map: macro
+treemon_map: MACRO
map \1
db \2 ; treemon set
-endm
+ENDM
TreeMonMaps: ; b825e
treemon_map ROUTE_26, 4
--- a/engine/battle/battle_transition.asm
+++ b/engine/battle/battle_transition.asm
@@ -92,7 +92,7 @@
; Load the tiles used in the Pokeball Graphic that fills the screen
; at the start of every Trainer battle.
ld de, TrainerBattlePokeballTiles
- ld hl, VTiles1 tile $7e
+ ld hl, vTiles1 tile $7e
ld b, BANK(TrainerBattlePokeballTiles)
ld c, 2
call Request2bpp
@@ -103,7 +103,7 @@
ld [rVBK], a
ld de, TrainerBattlePokeballTiles
- ld hl, VTiles4 tile $7e
+ ld hl, vTiles4 tile $7e
ld b, BANK(TrainerBattlePokeballTiles)
ld c, 2
call Request2bpp
@@ -828,11 +828,11 @@
; 8c792 (23:4792)
.boxes ; 8c792
-zoombox: macro
+zoombox: MACRO
; width, height, start y, start x
db \1, \2
dwcoord \3, \4
-endm
+ENDM
zoombox 4, 2, 8, 8
zoombox 6, 4, 7, 7
zoombox 8, 6, 6, 6
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -5309,13 +5309,13 @@
Battle_StatsScreen: ; 3e308
call DisableLCD
- ld hl, VTiles2 tile $31
- ld de, VTiles0
+ ld hl, vTiles2 tile $31
+ ld de, vTiles0
ld bc, $11 tiles
call CopyBytes
- ld hl, VTiles2
- ld de, VTiles0 tile $11
+ ld hl, vTiles2
+ ld de, vTiles0 tile $11
ld bc, $31 tiles
call CopyBytes
@@ -5330,13 +5330,13 @@
call DisableLCD
- ld hl, VTiles0
- ld de, VTiles2 tile $31
+ ld hl, vTiles0
+ ld de, vTiles2 tile $31
ld bc, $11 tiles
call CopyBytes
- ld hl, VTiles0 tile $11
- ld de, VTiles2
+ ld hl, vTiles0 tile $11
+ ld de, vTiles2
ld bc, $31 tiles
call CopyBytes
@@ -6371,8 +6371,14 @@
jr c, .GenerateDVs ; try again
.Magikarp:
-; Skimming this part recommended
+; These filters are untranslated.
+; They expect at wMagikarpLength a 2-byte value in mm,
+; but the value is in feet and inches (one byte each).
+; The first filter is supposed to make very large Magikarp even rarer,
+; by targeting those 1600 mm or larger.
+; After the conversion to feet, it is unable to target any,
+; as the largest possible Magikarp is 5'3'', which reads as 1283.
ld a, [TempEnemyMonSpecies]
cp MAGIKARP
jr nz, .Happiness
@@ -6382,9 +6388,9 @@
ld bc, PlayerID
callfar CalcMagikarpLength
-; We're clear if the length is < 1536
+; No reason to keep going if length > 1536 (i.e. if length / 256 != 6)
ld a, [wMagikarpLength]
- cp HIGH(1536)
+ cp HIGH(1536) ; this compares to 6'0'', should be cp 5
jr nz, .CheckMagikarpArea
; 5% chance of skipping both size checks
@@ -6391,9 +6397,9 @@
call Random
cp 5 percent
jr c, .CheckMagikarpArea
-; Try again if > 1614
+; Try again if length > 1615
ld a, [wMagikarpLength + 1]
- cp LOW(1614) + 2
+ cp LOW(1616) ; this compares to 6'80'', should be cp 3
jr nc, .GenerateDVs
; 20% chance of skipping this check
@@ -6400,9 +6406,9 @@
call Random
cp 20 percent - 1
jr c, .CheckMagikarpArea
-; Try again if > 1598
+; Try again if length > 1599
ld a, [wMagikarpLength + 1]
- cp LOW(1598) + 2
+ cp LOW(1600) ; this compares to 6'64'', should be cp 2
jr nc, .GenerateDVs
.CheckMagikarpArea:
@@ -6415,6 +6421,9 @@
; Intended behavior enforces a minimum size at Lake of Rage
; The real behavior prevents size flooring in the Lake of Rage area
+
+; Moreover, due to the check not being translated to feet, all Magikarp
+; smaller than 4'0'' may be caught by the filter, a lot more than intended
ld a, [MapGroup]
cp GROUP_LAKE_OF_RAGE
jr z, .Happiness
@@ -6427,7 +6436,7 @@
jr c, .Happiness
; Floor at length 1024
ld a, [wMagikarpLength]
- cp HIGH(1024)
+ cp HIGH(1024) ; compares to 4'0'', cp 3 would be closer to intended value
jr c, .GenerateDVs ; try again
; Finally done with DVs
@@ -6695,7 +6704,7 @@
CheckUnownLetter: ; 3eb75
; Return carry if the Unown letter hasn't been unlocked yet
- ld a, [UnlockedUnowns]
+ ld a, [wUnlockedUnowns]
ld c, a
ld de, 0
@@ -6779,7 +6788,7 @@
call FinishBattleAnim
ld a, [OtherTrainerClass]
ld [TrainerClass], a
- ld de, VTiles2
+ ld de, vTiles2
callfar GetTrainerPic
hlcoord 19, 0
ld c, 0
@@ -7074,7 +7083,7 @@
and a
ret nz
- ld a, [JohtoBadges]
+ ld a, [wJohtoBadges]
; Swap badges 3 (PlainBadge) and 5 (MineralBadge).
ld d, a
@@ -7155,15 +7164,15 @@
LoadHPExpBarGFX: ; unreferenced
ld de, EnemyHPBarBorderGFX
- ld hl, VTiles2 tile $6c
+ ld hl, vTiles2 tile $6c
lb bc, BANK(EnemyHPBarBorderGFX), 4
call Get1bpp
ld de, HPExpBarBorderGFX
- ld hl, VTiles2 tile $73
+ ld hl, vTiles2 tile $73
lb bc, BANK(HPExpBarBorderGFX), 6
call Get1bpp
ld de, ExpBarGFX
- ld hl, VTiles2 tile $55
+ ld hl, vTiles2 tile $55
lb bc, BANK(ExpBarGFX), 8
jp Get2bpp
; 3edd1
@@ -8286,7 +8295,7 @@
ld [CurPartySpecies], a
ld hl, BattleMonDVs
predef GetUnownLetter
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
predef GetMonBackpic
pop af
ld [CurPartySpecies], a
@@ -8325,7 +8334,7 @@
call GetBaseData
ld hl, EnemyMonDVs
predef GetUnownLetter
- ld de, VTiles2
+ ld de, vTiles2
predef GetAnimatedFrontpicPredef
pop af
ld [CurPartySpecies], a
@@ -8382,7 +8391,7 @@
call DisableSpriteUpdates
farcall ClearBattleRAM
call InitEnemy
- call BackUpVBGMap2
+ call BackUpBGMap2
ld b, SCGB_BATTLE_GRAYSCALE
call GetSGBLayout
ld hl, rLCDC
@@ -8428,13 +8437,13 @@
jp InitEnemyWildmon ; wild
; 3f568
-BackUpVBGMap2: ; 3f568
+BackUpBGMap2: ; 3f568
ld a, [rSVBK]
push af
ld a, $6 ; BANK(wDecompressScratch)
ld [rSVBK], a
ld hl, wDecompressScratch
- ld bc, $40 tiles ; VBGMap3 - VBGMap2
+ ld bc, $40 tiles ; vBGMap3 - vBGMap2
ld a, $2
call ByteFill
ld a, [rVBK]
@@ -8442,8 +8451,8 @@
ld a, $1
ld [rVBK], a
ld de, wDecompressScratch
- hlbgcoord 0, 0 ; VBGMap2
- lb bc, BANK(BackUpVBGMap2), $40
+ hlbgcoord 0, 0 ; vBGMap2
+ lb bc, BANK(BackUpBGMap2), $40
call Request2bpp
pop af
ld [rVBK], a
@@ -8467,7 +8476,7 @@
ld [OTPartyMon1Item], a
.ok
- ld de, VTiles2
+ ld de, vTiles2
callfar GetTrainerPic
xor a
ld [hGraphicStartTile], a
@@ -8531,7 +8540,7 @@
ld a, [UnownLetter]
ld [wFirstUnownSeen], a
.skip_unown
- ld de, VTiles2
+ ld de, vTiles2
predef GetAnimatedFrontpicPredef
xor a
ld [TrainerClass], a
@@ -9336,7 +9345,7 @@
; 3fbff
GetTrainerBackpic: ; 3fbff
-; Load the player character's backpic (6x6) into VRAM starting from VTiles2 tile $31.
+; Load the player character's backpic (6x6) into VRAM starting from vTiles2 tile $31.
; Special exception for Dude.
ld b, BANK(DudeBackpic)
@@ -9349,7 +9358,7 @@
ld a, [wPlayerSpriteSetupFlags]
bit 2, a ; transformed to male
jr nz, .Chris
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .Chris
@@ -9363,7 +9372,7 @@
ld hl, ChrisBackpic
.Decompress:
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
ld c, $31
predef DecompressPredef
ret
@@ -9374,8 +9383,8 @@
push af
ld a, $6
ld [rSVBK], a
- ld hl, VTiles0
- ld de, VTiles2 tile $31
+ ld hl, vTiles0
+ ld de, vTiles2 tile $31
ld a, [hROMBank]
ld b, a
ld c, $31
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -726,7 +726,7 @@
.obeylevel
; The maximum obedience level is constrained by owned badges:
- ld hl, JohtoBadges
+ ld hl, wJohtoBadges
; risingbadge
bit RISINGBADGE, [hl]
--- a/engine/battle/misc.asm
+++ b/engine/battle/misc.asm
@@ -176,9 +176,9 @@
ld hl, .BadgeTypes
- ld a, [KantoBadges]
+ ld a, [wKantoBadges]
ld b, a
- ld a, [JohtoBadges]
+ ld a, [wJohtoBadges]
ld c, a
.CheckBadge:
--- a/engine/battle/start_battle.asm
+++ b/engine/battle/start_battle.asm
@@ -191,7 +191,7 @@
call ClearWindowData
ld hl, hBGMapAddress
- xor a ; LOW(VBGMap0)
+ xor a ; LOW(vBGMap0)
ld [hli], a
- ld [hl], HIGH(VBGMap0)
+ ld [hl], HIGH(vBGMap0)
ret
--- a/engine/battle/trainer_huds.asm
+++ b/engine/battle/trainer_huds.asm
@@ -232,7 +232,7 @@
LoadBallIconGFX: ; 2c165
ld de, .gfx
- ld hl, VTiles0 tile $31
+ ld hl, vTiles0 tile $31
lb bc, BANK(LoadBallIconGFX), 4
call Get2bpp_2
ret
--- a/engine/battle_anims/anim_commands.asm
+++ b/engine/battle_anims/anim_commands.asm
@@ -236,16 +236,16 @@
; Appears to be unused.
xor a
ld [hBGMapMode], a
- ld a, LOW(VBGMap0 tile $28)
+ ld a, LOW(vBGMap0 tile $28)
ld [hBGMapAddress], a
- ld a, HIGH(VBGMap0 tile $28)
+ ld a, HIGH(vBGMap0 tile $28)
ld [hBGMapAddress + 1], a
call WaitBGMap2
ld a, $60
ld [hWY], a
- xor a ; LOW(VBGMap0)
+ xor a ; LOW(vBGMap0)
ld [hBGMapAddress], a
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
ld [hBGMapAddress + 1], a
call BattleAnimDelayFrame
ret
@@ -693,7 +693,7 @@
ld [wBattleAnimTemp0], a
.loop
ld a, [wBattleAnimTemp0]
- cp (VTiles1 - VTiles0) / $10 - $31
+ cp (vTiles1 - vTiles0) / $10 - $31
ret nc
call GetBattleAnimByte
ld [hli], a
@@ -706,7 +706,7 @@
rept 4
add hl, hl
endr
- ld de, VTiles0 tile $31
+ ld de, vTiles0 tile $31
add hl, de
ld a, [BattleAnimByte]
call LoadBattleAnimObj
@@ -816,13 +816,13 @@
ld a, $49
ld [hl], a
- ld hl, VTiles0 tile $73
- ld de, VTiles2 tile $06
+ ld hl, vTiles0 tile $73
+ ld de, vTiles2 tile $06
ld a, $70
ld [wBattleAnimTemp0], a
ld a, $7
call .LoadFootprint
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
ld a, $60
ld [wBattleAnimTemp0], a
ld a, $6
@@ -871,13 +871,13 @@
ld a, $43
ld [hl], a
- ld hl, VTiles0 tile $66
- ld de, VTiles2 tile $05
+ ld hl, vTiles0 tile $66
+ ld de, vTiles2 tile $05
ld a, $70
ld [wBattleAnimTemp0], a
ld a, $7
call .LoadHead
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
ld a, $60
ld [wBattleAnimTemp0], a
ld a, $6
@@ -930,7 +930,7 @@
ld [CurPartySpecies], a ; CurPartySpecies
ld hl, BattleMonDVs ; BattleMonDVs
predef GetUnownLetter
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
predef GetMonFrontpic
jr .done
@@ -939,7 +939,7 @@
ld [CurPartySpecies], a ; CurPartySpecies
ld hl, EnemyMonDVs ; EnemyMonDVs
predef GetUnownLetter
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
predef GetMonBackpic
.done
@@ -951,12 +951,12 @@
BattleAnimCmd_UpdateActorPic: ; cc622 (33:4622)
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
ld a, [hBattleTurn]
and a
jr z, .player
- ld hl, VTiles2 tile $00
+ ld hl, vTiles2 tile $00
ld b, 0
ld c, $31
call Request2bpp
@@ -963,7 +963,7 @@
ret
.player
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
ld b, 0
ld c, $24
call Request2bpp
@@ -1007,7 +1007,7 @@
ld de, sScratch + (3 * 7 + 6) tiles
call .CopyTile
- ld hl, VTiles2 tile $00
+ ld hl, vTiles2 tile $00
ld de, sScratch
lb bc, BANK(GetSubstitutePic), 7 * 7
call Request2bpp
@@ -1027,7 +1027,7 @@
ld de, sScratch + (3 * 6 + 5) tiles
call .CopyTile
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
ld de, sScratch
lb bc, BANK(GetSubstitutePic), 6 * 6
call Request2bpp
@@ -1075,7 +1075,7 @@
ld de, sScratch + $1a tiles
call CopyMinimizePic
- ld hl, VTiles2 tile $00
+ ld hl, vTiles2 tile $00
ld de, sScratch
lb bc, BANK(GetMinimizePic), $31
ret
@@ -1083,7 +1083,7 @@
.player
ld de, sScratch + $160
call CopyMinimizePic
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
ld de, sScratch
lb bc, BANK(GetMinimizePic), $24
ret
@@ -1108,7 +1108,7 @@
xor a
call GetSRAMBank
call GetMinimizePic
- ld hl, VTiles0 tile $00
+ ld hl, vTiles0 tile $00
call Request2bpp
call CloseSRAM
pop af
@@ -1157,7 +1157,7 @@
ld hl, BattleMonDVs
predef GetUnownLetter
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
predef GetMonFrontpic
jr .done
@@ -1164,7 +1164,7 @@
.player
ld hl, EnemyMonDVs
predef GetUnownLetter
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
predef GetMonBackpic
.done
--- a/engine/battle_anims/bg_effects.asm
+++ b/engine/battle_anims/bg_effects.asm
@@ -871,7 +871,7 @@
bgsquare: MACRO
dn \1, \2
dw \3
-endm
+ENDM
bgsquare 6, 6, .SixBySix
bgsquare 4, 4, .FourByFour
--- a/engine/billspc.asm
+++ b/engine/billspc.asm
@@ -1107,7 +1107,7 @@
ld hl, TempMonDVs
predef GetUnownLetter
call GetBaseData
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
predef GetMonFrontpic
xor a
ld [wBillsPC_MonHasMail], a
@@ -1450,7 +1450,7 @@
ld a, [wd004]
inc a
ld [wBillsPC_NumMonsInBox], a
-endm
+ENDM
CopyBoxmonSpecies: ; e2d30 (38:6d30)
xor a
@@ -2261,7 +2261,7 @@
BillsPC_InitGFX: ; e33e8 (38:73e8)
call DisableLCD
- ld hl, VTiles2 tile $00
+ ld hl, vTiles2 tile $00
ld bc, $31 tiles
xor a
call ByteFill
@@ -2268,11 +2268,11 @@
call LoadStandardFont
call LoadFontsBattleExtra
ld hl, PCMailGFX
- ld de, VTiles2 tile $5c
+ ld de, vTiles2 tile $5c
ld bc, 4 tiles
call CopyBytes
ld hl, PCSelectLZ
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
call Decompress
ld a, 6
call SkipMusic
--- a/engine/breeding.asm
+++ b/engine/breeding.asm
@@ -704,15 +704,15 @@
farcall BlankScreen
call DisableLCD
ld hl, EggHatchGFX
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
ld bc, $20
ld a, BANK(EggHatchGFX)
call FarCopyBytes
farcall ClearSpriteAnims
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
ld a, [wJumptableIndex]
call GetHatchlingFrontpic
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
ld a, EGG
call GetEggFrontpic
ld de, MUSIC_EVOLUTION
@@ -719,7 +719,7 @@
call PlayMusic
call EnableLCD
hlcoord 7, 4
- ld b, HIGH(VBGMap0)
+ ld b, HIGH(vBGMap0)
ld c, $31 ; Egg tiles start here
ld a, EGG
call Hatch_UpdateFrontpicBGMapCenter
@@ -768,7 +768,7 @@
call ClearSprites
call Hatch_InitShellFragments
hlcoord 6, 3
- ld b, HIGH(VBGMap0)
+ ld b, HIGH(vBGMap0)
ld c, $00 ; Hatchling tiles start here
ld a, [wJumptableIndex]
call Hatch_UpdateFrontpicBGMapCenter
--- a/engine/card_flip.asm
+++ b/engine/card_flip.asm
@@ -16,20 +16,20 @@
call LoadFontsExtra
ld hl, CardFlipLZ01
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
call Decompress
ld hl, CardFlipLZ02
- ld de, VTiles2 tile $3e
+ ld de, vTiles2 tile $3e
call Decompress
ld hl, CardFlipLZ03
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
call Decompress
ld hl, CardFlipOffButtonGFX
- ld de, VTiles1 tile $6f
+ ld de, vTiles1 tile $6f
ld bc, 1 tiles
call CopyBytes
ld hl, CardFlipOnButtonGFX
- ld de, VTiles1 tile $75
+ ld de, vTiles1 tile $75
ld bc, 1 tiles
call CopyBytes
@@ -619,11 +619,11 @@
; e0521
CardFlip_ShiftDigitsLeftTwoPixels: ; e0521 (38:4521)
- ld de, VTiles1 tile ("0" & $7f)
- ld hl, VTiles1 tile ("0" & $7f) + 2
+ ld de, vTiles1 tile ("0" & $7f)
+ ld hl, vTiles1 tile ("0" & $7f) + 2
ld bc, 10 tiles - 2
call CopyBytes
- ld hl, VTiles1 tile $7f + 1 tiles - 2
+ ld hl, vTiles1 tile $7f + 1 tiles - 2
xor a
ld [hli], a
ld [hl], a
@@ -1413,7 +1413,7 @@
dbpixel \1, \2
dw \3
endc
-endm
+ENDM
cardflip_cursor 11, 2, .Impossible
cardflip_cursor 12, 2, .Impossible
--- a/engine/caught_data.asm
+++ b/engine/caught_data.asm
@@ -193,7 +193,7 @@
.NotPokecenter2F:
call GetWorldMapLocation
ld b, a
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
rrca
or b
ld [hl], a
--- a/engine/cgb_layouts.asm
+++ b/engine/cgb_layouts.asm
@@ -183,7 +183,7 @@
; 8eb9
_CGB_PokegearPals: ; 8eb9
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .male
ld hl, FemalePokegearPals
@@ -719,7 +719,7 @@
; fill screen with opposite-gender palette for the card border
hlcoord 0, 0, AttrMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
and a
ld a, $1 ; kris
jr z, .got_gender
@@ -729,7 +729,7 @@
; fill trainer sprite area with same-gender palette
hlcoord 14, 1, AttrMap
lb bc, 7, 5
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
and a
ld a, $0 ; chris
jr z, .got_gender2
@@ -768,7 +768,7 @@
ld a, $7 ; pryce
call FillBoxCGB
; clair uses kris's palette
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
and a
push af
jr z, .got_gender3
@@ -847,7 +847,7 @@
cp BATTLETYPE_TUTORIAL
jr z, .tutorial_male
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .tutorial_male
--- a/engine/color.asm
+++ b/engine/color.asm
@@ -718,7 +718,7 @@
ld a, [wPlayerSpriteSetupFlags]
bit 2, a ; transformed to male
jr nz, .male
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
and a
jr z, .male
ld hl, KrisPalette
@@ -902,7 +902,7 @@
; CGB only
ld a, $1
ld [rVBK], a
- ld hl, VTiles0
+ ld hl, vTiles0
ld bc, $200 tiles
xor a
call ByteFill
@@ -1069,7 +1069,7 @@
ld a, %11100100
ld [rBGP], a
ld hl, PredefPals
- ld de, VTiles1
+ ld de, vTiles1
ld bc, $100 tiles
call CopyData
call DrawDefaultTiles
@@ -1085,7 +1085,7 @@
call DisableLCD
ld a, $e4
ld [rBGP], a
- ld de, VTiles1
+ ld de, vTiles1
ld bc, 20 tiles
call CopyData
ld b, 18
@@ -1119,7 +1119,7 @@
call DisableLCD
ld a, %11100100
ld [rBGP], a
- ld de, VTiles1
+ ld de, vTiles1
ld b, $80
.loop
push bc
--- a/engine/credits.asm
+++ b/engine/credits.asm
@@ -33,17 +33,17 @@
jr nz, .load_loop
ld de, CreditsBorderGFX
- ld hl, VTiles2 tile $20
+ ld hl, vTiles2 tile $20
lb bc, BANK(CreditsBorderGFX), $09
call Request2bpp
ld de, CopyrightGFX
- ld hl, VTiles2 tile $60
+ ld hl, vTiles2 tile $60
lb bc, BANK(CopyrightGFX), $1d
call Request2bpp
ld de, TheEndGFX
- ld hl, VTiles2 tile $40
+ ld hl, vTiles2 tile $40
lb bc, BANK(TheEndGFX), $10
call Request2bpp
@@ -55,7 +55,7 @@
call Credits_LoadBorderGFX
ld e, l
ld d, h
- ld hl, VTiles2
+ ld hl, vTiles2
lb bc, BANK(CreditsMonsGFX), 16
call Request2bpp
@@ -193,9 +193,9 @@
ld [Requested2bppSource], a
ld a, h
ld [Requested2bppSource + 1], a
- ld a, LOW(VTiles2)
+ ld a, LOW(vTiles2)
ld [Requested2bppDest], a
- ld a, HIGH(VTiles2)
+ ld a, HIGH(vTiles2)
ld [Requested2bppDest + 1], a
jr Credits_RequestGFX
--- a/engine/crystal_intro.asm
+++ b/engine/crystal_intro.asm
@@ -3,9 +3,9 @@
call PlayMusic
call ClearBGPalettes
call ClearTileMap
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
ld [hBGMapAddress + 1], a
- xor a ; LOW(VBGMap0)
+ xor a ; LOW(vBGMap0)
ld [hBGMapAddress], a
ld [hJoyDown], a
ld [hSCX], a
@@ -51,7 +51,7 @@
.GetGFLogoGFX: ; e45e8
ld de, GameFreakLogo
- ld hl, VTiles2
+ ld hl, vTiles2
lb bc, BANK(GameFreakLogo), $1c
call Get1bpp
@@ -65,12 +65,12 @@
ld a, BANK(IntroLogoGFX)
call FarDecompress
- ld hl, VTiles0
+ ld hl, vTiles0
ld de, wDecompressScratch
lb bc, 1, 8 tiles
call Request2bpp
- ld hl, VTiles1
+ ld hl, vTiles1
ld de, wDecompressScratch + $80 tiles
lb bc, 1, 8 tiles
call Request2bpp
@@ -470,10 +470,10 @@
ld a, $0
ld [rVBK], a
ld hl, IntroUnownsGFX
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroPulseGFX
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroTilemap002
debgcoord 0, 0
@@ -546,7 +546,7 @@
ld a, $0
ld [rVBK], a
ld hl, IntroBackgroundGFX
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroTilemap004
debgcoord 0, 0
@@ -609,10 +609,10 @@
ld a, $0
ld [rVBK], a
ld hl, IntroUnownsGFX
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroPulseGFX
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroTilemap006
debgcoord 0, 0
@@ -706,17 +706,17 @@
call Intro_DecompressRequest2bpp_64Tiles
ld hl, IntroPichuWooperGFX
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
call Intro_DecompressRequest2bpp_128Tiles
ld a, $0
ld [rVBK], a
ld hl, IntroSuicuneRunGFX
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
call Intro_DecompressRequest2bpp_255Tiles
ld hl, IntroBackgroundGFX
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroTilemap004
@@ -877,7 +877,7 @@
ld a, $0
ld [rVBK], a
ld hl, IntroUnownsGFX
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroTilemap008
debgcoord 0, 0
@@ -1001,10 +1001,10 @@
ld a, $0
ld [rVBK], a
ld hl, IntroSuicuneRunGFX
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
call Intro_DecompressRequest2bpp_255Tiles
ld hl, IntroBackgroundGFX
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroTilemap004
debgcoord 0, 0
@@ -1105,13 +1105,13 @@
ld a, $0
ld [rVBK], a
ld hl, IntroSuicuneJumpGFX
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroUnownBackGFX
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
call Intro_DecompressRequest2bpp_128Tiles
ld de, IntroGrass4GFX
- ld hl, VTiles1 tile $00
+ ld hl, vTiles1 tile $00
lb bc, BANK(IntroGrass4GFX), 1
call Request2bpp
ld hl, IntroTilemap010
@@ -1187,7 +1187,7 @@
ld a, $0
ld [rVBK], a
ld hl, IntroSuicuneCloseGFX
- ld de, VTiles1 tile $00
+ ld de, vTiles1 tile $00
call Intro_DecompressRequest2bpp_255Tiles
ld hl, IntroTilemap012
debgcoord 0, 0
@@ -1253,13 +1253,13 @@
ld a, $0
ld [rVBK], a
ld hl, IntroSuicuneBackGFX
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroUnownsGFX
- ld de, VTiles1 tile $00
+ ld de, vTiles1 tile $00
call Intro_DecompressRequest2bpp_128Tiles
ld de, IntroGrass4GFX
- ld hl, VTiles1 tile $7f
+ ld hl, vTiles1 tile $7f
lb bc, BANK(IntroGrass4GFX), 1
call Request2bpp
ld hl, IntroTilemap014
@@ -1431,7 +1431,7 @@
ld a, $0
ld [rVBK], a
ld hl, IntroCrystalUnownsGFX
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
call Intro_DecompressRequest2bpp_128Tiles
ld hl, IntroTilemap017
debgcoord 0, 0
@@ -1922,9 +1922,9 @@
ld [Requested2bppSource], a
ld a, [hli]
ld [Requested2bppSource + 1], a
- ld a, LOW(VTiles2 tile $09)
+ ld a, LOW(vTiles2 tile $09)
ld [Requested2bppDest], a
- ld a, HIGH(VTiles2 tile $09)
+ ld a, HIGH(vTiles2 tile $09)
ld [Requested2bppDest + 1], a
ld a, 4
ld [Requested2bppSize], a
--- a/engine/debug.asm
+++ b/engine/debug.asm
@@ -104,14 +104,14 @@
Function81948: ; 81948
ld a, $1
ld [rVBK], a
- ld hl, VTiles0
- ld bc, sScratch - VTiles0
+ ld hl, vTiles0
+ ld bc, sScratch - vTiles0
xor a
call ByteFill
ld a, $0
ld [rVBK], a
- ld hl, VTiles0
- ld bc, sScratch - VTiles0
+ ld hl, vTiles0
+ ld bc, sScratch - vTiles0
xor a
call ByteFill
hlcoord 0, 0, AttrMap
@@ -128,15 +128,15 @@
Function8197c: ; 8197c
ld hl, DebugColorTestGFX + $10
- ld de, VTiles2 tile $6a
+ ld de, vTiles2 tile $6a
ld bc, $160
call CopyBytes
ld hl, DebugColorTestGFX
- ld de, VTiles0
+ ld de, vTiles0
ld bc, $10
call CopyBytes
call LoadStandardFont
- ld hl, VTiles1
+ ld hl, vTiles1
lb bc, 8, 0
.asm_8199d
ld a, [hl]
@@ -314,7 +314,7 @@
ld [wBoxAlignment], a
hlcoord 12, 3
call _PrepMonFrontpic
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
predef GetMonBackpic
ld a, $31
ld [hGraphicStartTile], a
@@ -345,7 +345,7 @@
ld de, StringBuffer1
hlcoord 4, 1
call PlaceString
- ld de, VTiles2
+ ld de, vTiles2
callfar GetTrainerPic
xor a
ld [TempEnemyMonSpecies], a
@@ -1062,14 +1062,14 @@
xor a
ld [hBGMapMode], a
ld de, DebugColorTestGFX + $10
- ld hl, VTiles2 tile $6a
+ ld hl, vTiles2 tile $6a
lb bc, BANK(DebugColorTestGFX), $16
call Request2bpp
ld de, DebugColorTestGFX
- ld hl, VTiles1
+ ld hl, vTiles1
lb bc, BANK(DebugColorTestGFX), 1
call Request2bpp
- ld a, HIGH(VBGMap1)
+ ld a, HIGH(vBGMap1)
ld [hBGMapAddress + 1], a
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
--- a/engine/diploma.asm
+++ b/engine/diploma.asm
@@ -10,7 +10,7 @@
call ClearSprites
call DisableLCD
ld hl, DiplomaGFX
- ld de, VTiles2
+ ld de, vTiles2
call Decompress
ld hl, DiplomaPage1Tilemap
decoord 0, 0
--- a/engine/dma_transfer.asm
+++ b/engine/dma_transfer.asm
@@ -594,13 +594,13 @@
ld [rVBK], a
ld c, $8
ld hl, wScratchTileMap + $80
- debgcoord 0, 0, VBGMap1
+ debgcoord 0, 0, vBGMap1
call HDMATransfer_Wait127Scanlines
ld a, $0
ld [rVBK], a
ld c, $8
ld hl, wScratchTileMap
- debgcoord 0, 0, VBGMap1
+ debgcoord 0, 0, vBGMap1
call HDMATransfer_Wait127Scanlines
ret
--- a/engine/dummy_game.asm
+++ b/engine/dummy_game.asm
@@ -12,10 +12,10 @@
call GetSGBLayout
callfar ClearSpriteAnims
ld hl, LZ_e2221
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
call Decompress
ld hl, Unknown_e00ed
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
ld bc, 4 tiles
ld a, BANK(Unknown_e00ed)
call FarCopyBytes
--- a/engine/events.asm
+++ b/engine/events.asm
@@ -491,7 +491,7 @@
and a
jr nz, .nothing
- ld hl, StatusFlags2
+ ld hl, wStatusFlags2
bit 2, [hl] ; bug contest
jr z, .do_daily
--- a/engine/events/celebi.asm
+++ b/engine/events/celebi.asm
@@ -72,11 +72,11 @@
LoadCelebiGFX: ; 49912
farcall ClearSpriteAnims
ld de, SpecialCelebiLeafGFX
- ld hl, VTiles1
+ ld hl, vTiles1
lb bc, BANK(SpecialCelebiLeafGFX), 4
call Request2bpp
ld de, SpecialCelebiGFX
- ld hl, VTiles0 tile $84
+ ld hl, vTiles0 tile $84
lb bc, BANK(SpecialCelebiGFX), $10
call Request2bpp
xor a
--- a/engine/events/crystal_unown.asm
+++ b/engine/events/crystal_unown.asm
@@ -178,7 +178,7 @@
shift
endr
db $ff
-endm
+ENDM
.UnownText_Escape:
; db $08, $44, $04, $00, $2e, $08, $ff
--- a/engine/events/field_moves.asm
+++ b/engine/events/field_moves.asm
@@ -8,7 +8,7 @@
BlindingFlash: ; 8c7e1
farcall FadeOutPalettes
- ld hl, StatusFlags
+ ld hl, wStatusFlags
set 2, [hl] ; Flash
farcall ReplaceTimeOfDayPals
farcall UpdateTimeOfDayPal
@@ -22,11 +22,11 @@
ShakeHeadbuttTree: ; 8c80a
farcall ClearSpriteAnims
ld de, CutGrassGFX
- ld hl, VTiles1
+ ld hl, vTiles1
lb bc, BANK(CutGrassGFX), 4
call Request2bpp
ld de, HeadbuttTreeGFX
- ld hl, VTiles1 tile $04
+ ld hl, vTiles1 tile $04
lb bc, BANK(HeadbuttTreeGFX), 8
call Request2bpp
call Cut_Headbutt_GetPixelFacing
@@ -67,7 +67,7 @@
xor a
call ByteFill
ld de, Font
- ld hl, VTiles1
+ ld hl, vTiles1
lb bc, BANK(Font), 12
call Get1bpp
call ReplaceKrisSprite
@@ -141,11 +141,11 @@
.LoadCutGFX: ; 8c96d
callfar ClearSpriteAnims ; pointless to farcall
ld de, CutGrassGFX
- ld hl, VTiles1
+ ld hl, vTiles1
lb bc, BANK(CutGrassGFX), 4
call Request2bpp
ld de, CutTreeGFX
- ld hl, VTiles1 tile $4
+ ld hl, vTiles1 tile $4
lb bc, BANK(CutTreeGFX), 4
call Request2bpp
ret
@@ -413,7 +413,7 @@
FlyFunction_InitGFX: ; 8cb9b (23:4b9b)
callfar ClearSpriteAnims
ld de, CutGrassGFX
- ld hl, VTiles1 tile $00
+ ld hl, vTiles1 tile $00
lb bc, BANK(CutGrassGFX), 4
call Request2bpp
ld a, [CurPartyMon]
--- a/engine/events/fish.asm
+++ b/engine/events/fish.asm
@@ -97,7 +97,7 @@
; Return the index of fishgroup d in de.
push hl
- ld hl, DailyFlags
+ ld hl, wDailyFlags
bit 2, [hl]
pop hl
jr z, .done
--- a/engine/events/fruit_trees.asm
+++ b/engine/events/fruit_trees.asm
@@ -43,7 +43,7 @@
; 4404c
TryResetFruitTrees: ; 4404c
- ld hl, DailyFlags
+ ld hl, wDailyFlags
bit 4, [hl]
ret nz
jp ResetFruitTrees
@@ -70,7 +70,7 @@
ld [hli], a
ld [hli], a
ld [hl], a
- ld hl, DailyFlags
+ ld hl, wDailyFlags
set 4, [hl]
ret
; 44078
--- a/engine/events/halloffame.asm
+++ b/engine/events/halloffame.asm
@@ -2,7 +2,7 @@
HallOfFame:: ; 0x8640e
call HallOfFame_FadeOutMusic
- ld a, [StatusFlags]
+ ld a, [wStatusFlags]
push af
ld a, 1
ld [wGameLogicPaused], a
@@ -11,7 +11,7 @@
ld [wSpawnAfterChampion], a
; Enable the Pokégear map to cycle through all of Kanto
- ld hl, StatusFlags
+ ld hl, wStatusFlags
set 6, [hl] ; hall of fame
farcall HallOfFame_InitSaveIfNeeded
@@ -52,7 +52,7 @@
call DisableSpriteUpdates
ld a, SPAWN_RED
ld [wSpawnAfterChampion], a
- ld a, [StatusFlags]
+ ld a, [wStatusFlags]
ld b, a
farcall Credits
ret
@@ -249,7 +249,7 @@
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
call ByteFill
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
predef GetMonBackpic
ld a, $31
ld [hGraphicStartTile], a
@@ -533,7 +533,7 @@
HOF_AnimatePlayerPic: ; 86810
call ClearBGPalettes
- ld hl, VTiles2 tile HALLOFFAME_COLON
+ ld hl, vTiles2 tile HALLOFFAME_COLON
ld de, FontExtra + 13 tiles ; "<COLON>"
lb bc, BANK(FontExtra), 1
call Request2bpp
--- a/engine/events/heal_machine_anim.asm
+++ b/engine/events/heal_machine_anim.asm
@@ -72,7 +72,7 @@
.LoadGFX: ; 12383
call .LoadPalettes
ld de, .HealMachineGFX
- ld hl, VTiles0 tile $7c
+ ld hl, vTiles0 tile $7c
lb bc, BANK(.HealMachineGFX), $2
call Request2bpp
ret
--- a/engine/events/magikarp.asm
+++ b/engine/events/magikarp.asm
@@ -79,7 +79,7 @@
; 0xfbbae
Magikarp_LoadFeetInchesChars: ; fbbae
- ld hl, VTiles2 tile "′" ; $6e
+ ld hl, vTiles2 tile "′" ; $6e
ld de, .feetinchchars
lb bc, BANK(.feetinchchars), 2
call Request2bpp
@@ -108,7 +108,7 @@
; fbbfc
CalcMagikarpLength: ; fbbfc
-; Return Magikarp's length (in mm) at wMagikarpLength (big endian).
+; Return Magikarp's length (in feet and inches) at wMagikarpLength (big endian).
;
; input:
; de: EnemyMonDVs
@@ -247,6 +247,10 @@
ld e, l
.done
+ ; convert from mm to feet and inches
+ ; in = mm / 25.4
+ ; ft = in / 12
+
; hl = de × 10
ld h, d
ld l, e
@@ -275,9 +279,9 @@
ld e, a
ld hl, wMagikarpLength
- ld [hl], d
+ ld [hl], d ; ft
inc hl
- ld [hl], e
+ ld [hl], e ; in
ret
; fbc9a
@@ -305,8 +309,11 @@
; fbca8
.Lengths: ; fbca8
-; ????, divisor
- dwb 110, 1
+; [wMagikarpLength] = z * 100 + (bc - x) / y
+; First argument is the bc threshold as well as x.
+; Second argument is y.
+; In reality, due to the bug at .BCLessThanDE, the threshold is determined by only register b.
+ dwb 110, 1 ; not used unless the bug is fixed
dwb 310, 2
dwb 710, 4
dwb 2710, 20
--- a/engine/events/magnet_train.asm
+++ b/engine/events/magnet_train.asm
@@ -134,7 +134,7 @@
farcall GetPlayerIcon
pop af
ld [rSVBK], a
- ld hl, VTiles0
+ ld hl, vTiles0
ld c, 4
call Request2bpp
ld hl, 12 tiles
@@ -141,7 +141,7 @@
add hl, de
ld d, h
ld e, l
- ld hl, VTiles0 tile $04
+ ld hl, vTiles0 tile $04
ld c, 4
call Request2bpp
call MagnetTrain_InitLYOverrides
@@ -328,7 +328,7 @@
push af
ld a, $1
ld [rSVBK], a
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .got_gender
ld b, SPRITE_ANIM_INDEX_MAGNET_TRAIN_BLUE
--- a/engine/events/overworld.asm
+++ b/engine/events/overworld.asm
@@ -358,7 +358,7 @@
ld de, ENGINE_FOGBADGE
call CheckBadge
jr c, .asm_c956
- ld hl, BikeFlags
+ ld hl, wBikeFlags
bit 1, [hl] ; always on bike
jr nz, .cannotsurf
ld a, [PlayerState]
@@ -520,7 +520,7 @@
call CheckPartyMove
jr c, .quit
- ld hl, BikeFlags
+ ld hl, wBikeFlags
bit 1, [hl] ; always on bike (can't surf)
jr nz, .quit
@@ -1008,7 +1008,7 @@
ret
SetStrengthFlag: ; cd12
- ld hl, BikeFlags
+ ld hl, wBikeFlags
set 0, [hl]
ld a, [CurPartyMon]
ld e, a
@@ -1086,7 +1086,7 @@
call CheckEngineFlag
jr c, .nope
- ld hl, BikeFlags
+ ld hl, wBikeFlags
bit 0, [hl]
jr z, .already_using
@@ -1683,7 +1683,7 @@
ret
.GetOffBike:
- ld hl, BikeFlags
+ ld hl, wBikeFlags
bit 1, [hl]
jr nz, .CantGetOffBike
ld hl, Script_GetOffBike
--- a/engine/events/pokepic.asm
+++ b/engine/events/pokepic.asm
@@ -11,7 +11,7 @@
ld a, [CurPartySpecies]
ld [CurSpecies], a
call GetBaseData
- ld de, VTiles1
+ ld de, vTiles1
predef GetMonFrontpic
ld a, [wMenuBorderTopCoord]
inc a
--- a/engine/events/pokerus/pokerus.asm
+++ b/engine/events/pokerus/pokerus.asm
@@ -18,7 +18,7 @@
; If we haven't been to Goldenrod City at least once,
; prevent the contraction of Pokerus.
- ld hl, StatusFlags2
+ ld hl, wStatusFlags2
bit 6, [hl]
ret z
call Random
@@ -123,7 +123,7 @@
; any berry held by a Shuckle may be converted to berry juice
ConvertBerriesToBerryJuice: ; 2ede6
- ld hl, StatusFlags2
+ ld hl, wStatusFlags2
bit 6, [hl]
ret z
call Random
--- a/engine/events/print_unown.asm
+++ b/engine/events/print_unown.asm
@@ -15,12 +15,12 @@
call ClearTileMap
ld de, UnownDexATile
- ld hl, VTiles1 tile $6f
+ ld hl, vTiles1 tile $6f
lb bc, BANK(UnownDexBTile), 1
call Request1bpp
ld de, UnownDexBTile
- ld hl, VTiles1 tile $75
+ ld hl, vTiles1 tile $75
lb bc, BANK(UnownDexBTile), 1
call Request1bpp
@@ -139,7 +139,7 @@
ld [CurPartySpecies], a
xor a
ld [wBoxAlignment], a
- ld de, VTiles2
+ ld de, vTiles2
predef GetMonFrontpic
call .Load2bppToSRAM
hlcoord 1, 6
@@ -147,7 +147,7 @@
ld [hGraphicStartTile], a
lb bc, 7, 7
predef PlaceGraphic
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
farcall RotateUnownFrontpic
ret
@@ -184,7 +184,7 @@
ld bc, $31 tiles
xor a
call ByteFill
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
ld de, sScratch
ld c, $31
ld a, [hROMBank]
--- a/engine/events/print_unown_2.asm
+++ b/engine/events/print_unown_2.asm
@@ -105,7 +105,7 @@
endr
y = y + 1
endr
-endm
+ENDM
UnownPrinter_OverworldMapRectangle: ; e008b
overworldmaprect 7, 7
--- a/engine/events/special.asm
+++ b/engine/events/special.asm
@@ -53,7 +53,7 @@
call CopyName2
; Engine flag for this event.
- ld hl, DailyFlags
+ ld hl, wDailyFlags
set 5, [hl]
; setflag ENGINE_SHUCKLE_GIVEN
ld a, 1
--- a/engine/events/sweet_scent.asm
+++ b/engine/events/sweet_scent.asm
@@ -36,7 +36,7 @@
SweetScentEncounter: ; 506ef
farcall CanUseSweetScent
jr nc, .no_battle
- ld hl, StatusFlags2
+ ld hl, wStatusFlags2
bit 2, [hl]
jr nz, .not_in_bug_contest
farcall GetMapEncounterRate
--- a/engine/events_2.asm
+++ b/engine/events_2.asm
@@ -2,7 +2,7 @@
WarpToSpawnPoint:: ; 97c28
- ld hl, StatusFlags2
+ ld hl, wStatusFlags2
res 1, [hl] ; safari zone?
res 2, [hl] ; bug contest
ret
@@ -108,7 +108,7 @@
jr c, .nope
call CanUseSweetScent
jr nc, .nope
- ld hl, StatusFlags2
+ ld hl, wStatusFlags2
bit 2, [hl] ; bug contest
jr nz, .bug_contest
farcall TryWildEncounter
@@ -149,7 +149,7 @@
; 97cfd
CanUseSweetScent:: ; 97cfd
- ld hl, StatusFlags
+ ld hl, wStatusFlags
bit 5, [hl]
jr nz, .no
ld a, [wEnvironment]
@@ -263,7 +263,7 @@
; If the bike shop owner doesn't have our number, or
; if we've already gotten the call, we don't have to
; be here.
- ld hl, StatusFlags2
+ ld hl, wStatusFlags2
bit 4, [hl] ; bike shop call
jr z, .NoCall
@@ -314,7 +314,7 @@
ld [wSpecialPhoneCallID], a
xor a
ld [wSpecialPhoneCallID + 1], a
- ld hl, StatusFlags2
+ ld hl, wStatusFlags2
res 4, [hl] ; bike shop call
scf
ret
--- a/engine/events_3.asm
+++ b/engine/events_3.asm
@@ -132,7 +132,7 @@
LoadMapNameSignGFX: ; b80c6
ld de, MapEntryFrameGFX
- ld hl, VTiles2 tile $60
+ ld hl, vTiles2 tile $60
lb bc, BANK(MapEntryFrameGFX), $e
call Get2bpp
ret
@@ -648,19 +648,19 @@
ld [rVBK], a
ld de, FishingGFX
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .got_gender
ld de, KrisFishingGFX
.got_gender
- ld hl, VTiles0 tile $02
+ ld hl, vTiles0 tile $02
call .LoadGFX
- ld hl, VTiles0 tile $06
+ ld hl, vTiles0 tile $06
call .LoadGFX
- ld hl, VTiles0 tile $0a
+ ld hl, vTiles0 tile $0a
call .LoadGFX
- ld hl, VTiles1 tile $7c
+ ld hl, vTiles1 tile $7c
call .LoadGFX
pop af
--- a/engine/evolution_animation.asm
+++ b/engine/evolution_animation.asm
@@ -39,7 +39,7 @@
farcall ClearSpriteAnims
ld de, .GFX
- ld hl, VTiles0
+ ld hl, vTiles0
lb bc, BANK(.GFX), 8
call Request2bpp
@@ -58,8 +58,8 @@
ld [CurSpecies], a
call .PlaceFrontpic
- ld de, VTiles2
- ld hl, VTiles2 tile $31
+ ld de, vTiles2
+ ld hl, vTiles2 tile $31
ld bc, 7 * 7
call Request2bpp
@@ -167,7 +167,7 @@
call GetBaseData
ld a, $1
ld [wBoxAlignment], a
- ld de, VTiles2
+ ld de, vTiles2
predef GetAnimatedFrontpicPredef
xor a
ld [wBoxAlignment], a
--- a/engine/gbc_only.asm
+++ b/engine/gbc_only.asm
@@ -20,12 +20,12 @@
ld [rSVBK], a
ld de, $d000
- ld hl, VTiles2
+ ld hl, vTiles2
lb bc, BANK(GBCOnlyGFX), $54
call Get2bpp
ld de, Font
- ld hl, VTiles1
+ ld hl, vTiles1
lb bc, BANK(Font), $80
call Get1bpp
--- a/engine/init_gender.asm
+++ b/engine/init_gender.asm
@@ -3,7 +3,7 @@
ld [wd474], a
xor a
ld [wd473], a
- ld [PlayerGender], a
+ ld [wPlayerGender], a
ld [wd475], a
ld [wd476], a
ld [wd477], a
@@ -37,7 +37,7 @@
call CloseWindow
ld a, [wMenuCursorY]
dec a
- ld [PlayerGender], a
+ ld [wPlayerGender], a
ld c, 10
call DelayFrames
ret
@@ -105,7 +105,7 @@
LoadGenderScreenLightBlueTile: ; 48e64 (12:4e64)
ld de, .LightBlueTile
- ld hl, VTiles2 tile $00
+ ld hl, vTiles2 tile $00
lb bc, BANK(.LightBlueTile), 1
call Get2bpp
ret
--- a/engine/init_hof_credits.asm
+++ b/engine/init_hof_credits.asm
@@ -6,7 +6,7 @@
call LoadStandardFont
call LoadFontsBattleExtra
hlbgcoord 0, 0
- ld bc, VBGMap1 - VBGMap0
+ ld bc, vBGMap1 - vBGMap0
ld a, " "
call ByteFill
hlcoord 0, 0, AttrMap
@@ -36,7 +36,7 @@
call LoadStandardFont
call LoadFontsBattleExtra
hlbgcoord 0, 0
- ld bc, VBGMap1 - VBGMap0
+ ld bc, vBGMap1 - vBGMap0
ld a, " "
call ByteFill
hlcoord 0, 0, AttrMap
--- a/engine/init_map.asm
+++ b/engine/init_map.asm
@@ -27,7 +27,7 @@
ld a, $90
ld [hWY], a
call OverworldTextModeSwitch
- ld a, HIGH(VBGMap1)
+ ld a, HIGH(vBGMap1)
call .LoadBGMapAddrIntoHRAM
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
farcall LoadOW_BGPal7
@@ -38,11 +38,11 @@
ld [hBGMapMode], a
ld [hWY], a
farcall HDMATransfer_FillBGMap0WithBlack ; no need to farcall
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
call .LoadBGMapAddrIntoHRAM
- xor a ; LOW(VBGMap0)
+ xor a ; LOW(vBGMap0)
ld [wBGMapAnchor], a
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
ld [wBGMapAnchor + 1], a
xor a
ld [hSCX], a
@@ -90,9 +90,9 @@
ld [rHDMA1], a
ld a, LOW(wDecompressScratch)
ld [rHDMA2], a
- ld a, HIGH(VBGMap0 % $8000)
+ ld a, HIGH(vBGMap0 % $8000)
ld [rHDMA3], a
- ld a, LOW(VBGMap0 % $8000)
+ ld a, LOW(vBGMap0 % $8000)
ld [rHDMA4], a
ld a, $3f
ld [hDMATransfer], a
--- a/engine/intro_menu.asm
+++ b/engine/intro_menu.asm
@@ -193,8 +193,8 @@
xor a
ld [MonType], a
- ld [JohtoBadges], a
- ld [KantoBadges], a
+ ld [wJohtoBadges], a
+ ld [wKantoBadges], a
ld [Coins], a
ld [Coins + 1], a
@@ -483,7 +483,7 @@
xor a
ld [wDontPlayMapMusicOnReload], a
ld [wLinkMode], a
- ld hl, GameTimerPause
+ ld hl, wGameTimerPause
set 0, [hl]
res 7, [hl]
ld hl, wEnteredMapFromContinue
@@ -540,7 +540,7 @@
xor a
ld [hBGMapMode], a
ld hl, .MenuDataHeader_Dex
- ld a, [StatusFlags]
+ ld a, [wStatusFlags]
bit 0, a ; pokedex
jr nz, .pokedex_header
ld hl, .MenuDataHeader_NoDex
@@ -631,7 +631,7 @@
Continue_DisplayBadgeCount: ; 5f58
push hl
- ld hl, JohtoBadges
+ ld hl, wJohtoBadges
ld b, 2
call CountSetBits
pop hl
@@ -641,7 +641,7 @@
; 5f6b
Continue_DisplayPokedexNumCaught: ; 5f6b
- ld a, [StatusFlags]
+ ld a, [wStatusFlags]
bit 0, a ; Pokedex
ret z
push hl
@@ -813,7 +813,7 @@
ld hl, PlayerName
ld de, .Chris
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .Male
ld de, .Kris
@@ -942,7 +942,7 @@
; 619c
Intro_PrepTrainerPic: ; 619c
- ld de, VTiles2
+ ld de, vTiles2
farcall GetTrainerPic
xor a
ld [hGraphicStartTile], a
@@ -953,7 +953,7 @@
; 61b4
ShrinkFrame: ; 61b4
- ld de, VTiles2
+ ld de, vTiles2
ld c, $31
predef DecompressPredef
xor a
@@ -968,7 +968,7 @@
farcall GetPlayerIcon
ld c, $c
- ld hl, VTiles0
+ ld hl, vTiles0
call Request2bpp
ld hl, Sprites
@@ -989,7 +989,7 @@
ld [hli], a
ld b, 0
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .male
ld b, 1
@@ -1376,7 +1376,7 @@
call ClearTileMap
call LoadFontsExtra
ld de, CopyrightGFX
- ld hl, VTiles2 tile $60
+ ld hl, vTiles2 tile $60
lb bc, BANK(CopyrightGFX), $1d
call Request2bpp
hlcoord 2, 7
@@ -1405,9 +1405,9 @@
call ClearWindowData
call ClearBGPalettes
call ClearTileMap
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
ld [hBGMapAddress + 1], a
- xor a ; LOW(VBGMap0)
+ xor a ; LOW(vBGMap0)
ld [hBGMapAddress], a
ld [hJoyDown], a
ld [hSCX], a
--- a/engine/link_trade.asm
+++ b/engine/link_trade.asm
@@ -4,7 +4,7 @@
__LoadTradeScreenBorder: ; 16d421
ld de, LinkCommsBorderGFX
- ld hl, VTiles2
+ ld hl, vTiles2
lb bc, BANK(LinkCommsBorderGFX), 70
call Get2bpp
ret
@@ -139,7 +139,7 @@
LinkComms_LoadPleaseWaitTextboxBorderGFX: ; 16d69a
ld de, LinkCommsBorderGFX + $30 tiles
- ld hl, VTiles2 tile $76
+ ld hl, vTiles2 tile $76
lb bc, BANK(LinkCommsBorderGFX), 8
call Get2bpp
ret
--- a/engine/mail_2.asm
+++ b/engine/mail_2.asm
@@ -28,7 +28,7 @@
ld de, SpanishItalianFont
.got_font
- ld hl, VTiles1
+ ld hl, vTiles1
lb bc, BANK(StandardEnglishFont), $80
call Get1bpp
pop de
@@ -128,7 +128,7 @@
LoadSurfMailGFX: ; b9317
push bc
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
ld de, SurfMailBorderGFX
ld c, 8 * 8
call LoadMailGFX_Color2
@@ -142,7 +142,7 @@
LoadLiteBlueMailGFX: ; b9335
push bc
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
ld de, LiteBlueMailBorderGFX
ld c, 8 * 8
call LoadMailGFX_Color2
@@ -213,7 +213,7 @@
LoadEonMailGFX: ; b93d2
push bc
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
ld de, EonMailBorder1GFX
ld c, 1 * 8
call LoadMailGFX_Color2
@@ -232,7 +232,7 @@
ld de, MailEeveeGFX
ld c, 6 * 8
call LoadMailGFX_Color3
- ld hl, VTiles2 tile $3d
+ ld hl, vTiles2 tile $3d
ld de, MailLargeCircleGFX
ld c, 4 * 8
call LoadMailGFX_Color1
@@ -263,7 +263,7 @@
LoadLovelyMailGFX: ; b944b
push bc
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
ld de, LovelyMailBorderGFX
ld c, 5 * 8
call LoadMailGFX_Color2
@@ -326,7 +326,7 @@
LoadMorphMailGFX: ; b94d6
push bc
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
ld bc, 5 * 8
call MailGFX_GenerateMonochromeTilesColor2
ld de, MorphMailBorderCornerGFX + 3 * 8
@@ -402,7 +402,7 @@
LoadBlueSkyMailGFX: ; b9582
push bc
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
ld de, EonMailBorder1GFX
ld c, 1 * 8
call LoadMailGFX_Color2
@@ -490,7 +490,7 @@
LoadFlowerMailGFX: ; b963e
push bc
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
ld de, FlowerMailBorderGFX
ld c, 8 * 8
call LoadMailGFX_Color1
@@ -545,7 +545,7 @@
LoadPortraitMailGFX: ; b96ca
push bc
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
ld de, PortraitMailBorderGFX
ld c, 5 * 8
call LoadMailGFX_Color2
@@ -552,7 +552,7 @@
ld de, PortraitMailUnderlineGFX
ld c, 1 * 8
call LoadMailGFX_Color2
- ld hl, VTiles2 tile $3d
+ ld hl, vTiles2 tile $3d
ld de, PortraitMailLargePokeballGFX
ld c, 4 * 8
call LoadMailGFX_Color1
@@ -576,7 +576,7 @@
LoadMusicMailGFX: ; b9710
push bc
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
ld de, MusicMailBorderGFX
ld c, 4 * 8
call LoadMailGFX_Color2
@@ -619,7 +619,7 @@
LoadMirageMailGFX: ; b9776
push bc
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
ld bc, 5 * 8
call MailGFX_GenerateMonochromeTilesColor2
ld de, BlueSkyMailGrassGFX
--- a/engine/main_menu.asm
+++ b/engine/main_menu.asm
@@ -9,7 +9,7 @@
ld b, SCGB_DIPLOMA
call GetSGBLayout
call SetPalettes
- ld hl, GameTimerPause
+ ld hl, wGameTimerPause
res 0, [hl]
call MainMenu_GetWhichMenu
ld [wWhichIndexSet], a
@@ -168,7 +168,7 @@
cp -1
call CloseSRAM
jr nz, .mystery_gift
- ld a, [StatusFlags]
+ ld a, [wStatusFlags]
bit 7, a
ld a, $1 ; Continue
jr z, .ok
@@ -182,7 +182,7 @@
ret
.mystery_gift
- ld a, [StatusFlags]
+ ld a, [wStatusFlags]
bit 7, a
jr z, .ok3
jr .ok3
--- a/engine/map_setup.asm
+++ b/engine/map_setup.asm
@@ -168,7 +168,7 @@
.CheckBiking: ; 1550c (5:550c)
and a
- ld hl, BikeFlags
+ ld hl, wBikeFlags
bit 1, [hl]
ret z
ld a, PLAYER_BIKE
--- a/engine/mart.asm
+++ b/engine/mart.asm
@@ -58,7 +58,7 @@
ld a, [hli]
or [hl]
jr z, .skip_set
- ld hl, DailyFlags
+ ld hl, wDailyFlags
set 6, [hl]
.skip_set
@@ -81,7 +81,7 @@
RooftopSale: ; 15ac4
ld b, BANK(RooftopSaleData1)
ld de, RooftopSaleData1
- ld hl, StatusFlags
+ ld hl, wStatusFlags
bit 6, [hl] ; hall of fame
jr z, .ok
ld b, BANK(RooftopSaleData2)
--- a/engine/mon_icons.asm
+++ b/engine/mon_icons.asm
@@ -331,7 +331,7 @@
add hl, hl
endr
- ld de, VTiles0
+ ld de, vTiles0
add hl, de
push hl
--- a/engine/mystery_gift.asm
+++ b/engine/mystery_gift.asm
@@ -1277,7 +1277,7 @@
call ClearBGPalettes
call DisableLCD
ld hl, MysteryGiftGFX
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
ld a, BANK(MysteryGiftGFX)
ld bc, MysteryGiftGFXEnd - MysteryGiftGFX
call FarCopyBytes
@@ -1576,12 +1576,12 @@
call ClearBGPalettes
call DisableLCD
ld hl, MysteryGiftJP_GFX
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
ld a, BANK(MysteryGiftJP_GFX)
lb bc, 4, 0
call FarCopyBytes
ld hl, MysteryGiftJP_GFX + $400
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
ld a, BANK(MysteryGiftJP_GFX)
ld bc, $80
call FarCopyBytes
--- a/engine/namingscreen.asm
+++ b/engine/namingscreen.asm
@@ -175,7 +175,7 @@
.Box: ; 117f5 (4:57f5)
ld de, PokeBallSpriteGFX
- ld hl, VTiles0 tile $00
+ ld hl, vTiles0 tile $00
lb bc, BANK(PokeBallSpriteGFX), $4
call Request2bpp
xor a
@@ -217,7 +217,7 @@
.LoadSprite: ; 11847 (4:5847)
push de
- ld hl, VTiles0 tile $00
+ ld hl, vTiles0 tile $00
ld c, $4
push bc
call Request2bpp
@@ -226,7 +226,7 @@
add hl, de
ld e, l
ld d, h
- ld hl, VTiles0 tile $04
+ ld hl, vTiles0 tile $04
call Request2bpp
xor a
ld hl, wSpriteAnimDict
@@ -905,22 +905,22 @@
call LoadFontsExtra
ld de, NamingScreenGFX_MiddleLine
- ld hl, VTiles1 tile $6b
+ ld hl, vTiles1 tile $6b
lb bc, BANK(NamingScreenGFX_MiddleLine), 1
call Get1bpp
ld de, NamingScreenGFX_UnderLine
- ld hl, VTiles1 tile $72
+ ld hl, vTiles1 tile $72
lb bc, BANK(NamingScreenGFX_UnderLine), 1
call Get1bpp
- ld de, VTiles2 tile $60
+ ld de, vTiles2 tile $60
ld hl, NamingScreenGFX_Border
ld bc, 1 tiles
ld a, BANK(NamingScreenGFX_Border)
call FarCopyBytes
- ld de, VTiles0 tile $7e
+ ld de, vTiles0 tile $7e
ld hl, NamingScreenGFX_Cursor
ld bc, 2 tiles
ld a, BANK(NamingScreenGFX_Cursor)
@@ -998,7 +998,7 @@
call ClearBGPalettes
call DisableLCD
call LoadNamingScreenGFX
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
ld hl, .MailIcon
ld bc, 8 tiles
ld a, BANK(.MailIcon)
--- a/engine/overworld.asm
+++ b/engine/overworld.asm
@@ -64,7 +64,7 @@
ld a, [wPlayerSpriteSetupFlags]
bit 2, a
jr nz, .go
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .go
ld hl, .Kris
@@ -663,10 +663,10 @@
add hl, hl
endr
ld a, l
- add LOW(VTiles0)
+ add LOW(vTiles0)
ld l, a
ld a, h
- adc HIGH(VTiles0)
+ adc HIGH(vTiles0)
ld h, a
ret
; 14418
--- a/engine/pack.asm
+++ b/engine/pack.asm
@@ -1294,7 +1294,7 @@
ld a, [BattleType]
cp BATTLETYPE_TUTORIAL
jr z, .male_dude
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr nz, .female
.male_dude
@@ -1304,7 +1304,7 @@
ld a, [hli]
ld e, a
ld d, [hl]
- ld hl, VTiles2 tile $50
+ ld hl, vTiles2 tile $50
lb bc, BANK(PackGFX), 15
call Request2bpp
ret
@@ -1411,7 +1411,7 @@
call ClearSprites
call DisableLCD
ld hl, PackMenuGFX
- ld de, VTiles2
+ ld de, vTiles2
ld bc, $60 tiles
ld a, BANK(PackMenuGFX)
call FarCopyBytes
--- a/engine/pic_animation.asm
+++ b/engine/pic_animation.asm
@@ -56,7 +56,7 @@
rept _NARG
; Workaround for a bug where macro args can't come after the start of a symbol
if !def(\1_POKEANIM)
-\1_POKEANIM equs "PokeAnim_\1_"
+\1_POKEANIM EQUS "PokeAnim_\1_"
endc
db (\1_POKEANIM - PokeAnim_SetupCommands) / 2
shift
@@ -142,9 +142,9 @@
; d00da
PokeAnim_SetupCommands: ; d00da
-setup_command: macro
+setup_command: MACRO
\1_: dw \1
-endm
+ENDM
setup_command PokeAnim_Finish
setup_command PokeAnim_BasePic
setup_command PokeAnim_SetWait
@@ -586,7 +586,7 @@
endr
y = y + 7
endr
-endm
+ENDM
PokeAnim_ConvertAndApplyBitmask: ; d036b
xor a
@@ -1120,7 +1120,7 @@
ld l, e
push bc
push hl
- ld de, VTiles2
+ ld de, vTiles2
predef GetAnimatedFrontpicPredef
pop hl
pop bc
--- a/engine/player_gfx.asm
+++ b/engine/player_gfx.asm
@@ -1,7 +1,7 @@
Function88248: ; 88248
; XXX
ld c, CAL
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .okay
ld c, KAREN
@@ -58,7 +58,7 @@
ShowPlayerNamingChoices: ; 88297
ld hl, ChrisNameMenuHeader
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .GotGender
ld hl, KrisNameMenuHeader
@@ -76,7 +76,7 @@
GetPlayerNameArray: ; 88318 This Function is never called
ld hl, PlayerName
ld de, MalePlayerNameArray
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .done
ld de, FemalePlayerNameArray
@@ -92,7 +92,7 @@
ld de, ChrisSpriteGFX
ld b, BANK(ChrisSpriteGFX)
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .done
@@ -105,17 +105,17 @@
GetCardPic: ; 8833e
ld hl, ChrisCardPic
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .GotClass
ld hl, KrisCardPic
.GotClass:
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
ld bc, $23 tiles
ld a, BANK(ChrisCardPic) ; BANK(KrisCardPic)
call FarCopyBytes
ld hl, CardGFX
- ld de, VTiles2 tile $23
+ ld de, vTiles2 tile $23
ld bc, 6 tiles
ld a, BANK(CardGFX)
call FarCopyBytes
@@ -131,7 +131,7 @@
INCBIN "gfx/trainer_card/trainer_card.2bpp"
GetPlayerBackpic: ; 88825
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, GetChrisBackpic
call GetKrisBackpic
@@ -140,7 +140,7 @@
GetChrisBackpic: ; 88830
ld hl, ChrisBackpic
ld b, BANK(ChrisBackpic)
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
ld c, 7 * 7
predef DecompressPredef
ret
@@ -150,7 +150,7 @@
xor a
ld [hBGMapMode], a
ld e, 0
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .GotClass
ld e, 1
@@ -159,13 +159,13 @@
ld a, e
ld [TrainerClass], a
ld de, ChrisPic
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .GotPic
ld de, KrisPic
.GotPic:
- ld hl, VTiles2
+ ld hl, vTiles2
ld b, BANK(ChrisPic) ; BANK(KrisPic)
ld c, 7 * 7
call Get2bpp
@@ -179,7 +179,7 @@
; Get class
ld e, CHRIS
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .GotClass
ld e, KRIS
@@ -189,12 +189,12 @@
; Load pic
ld de, ChrisPic
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .GotPic
ld de, KrisPic
.GotPic:
- ld hl, VTiles2
+ ld hl, vTiles2
ld b, BANK(ChrisPic) ; BANK(KrisPic)
ld c, 7 * 7 ; dimensions
call Get2bpp
@@ -216,7 +216,7 @@
GetKrisBackpic: ; 88ec9
; Kris's backpic is uncompressed.
ld de, KrisBackpic
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
lb bc, BANK(KrisBackpic), 7 * 7 ; dimensions
call Get2bpp
ret
--- a/engine/player_movement.asm
+++ b/engine/player_movement.asm
@@ -18,7 +18,7 @@
; Standing downhill instead moves down.
- ld hl, BikeFlags
+ ld hl, wBikeFlags
bit 2, [hl] ; downhill
ret z
@@ -285,7 +285,7 @@
call .BikeCheck
jr nz, .walk
- ld hl, BikeFlags
+ ld hl, wBikeFlags
bit 2, [hl] ; downhill
jr z, .fast
@@ -672,7 +672,7 @@
.CheckStrengthBoulder: ; 8036f
- ld hl, BikeFlags
+ ld hl, wBikeFlags
bit 0, [hl] ; using strength
jr z, .not_boulder
--- a/engine/player_object.asm
+++ b/engine/player_object.asm
@@ -33,7 +33,7 @@
ld a, [wPlayerSpriteSetupFlags]
bit 2, a
jr nz, .ok
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .ok
ln e, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT
--- a/engine/player_step.asm
+++ b/engine/player_step.asm
@@ -156,7 +156,7 @@
ld a, [wBGMapAnchor + 1]
inc a
and $3
- or HIGH(VBGMap0)
+ or HIGH(vBGMap0)
ld [wBGMapAnchor + 1], a
.not_overflowed
ld hl, wMetatileStandingY
@@ -187,7 +187,7 @@
ld a, [wBGMapAnchor + 1]
dec a
and $3
- or HIGH(VBGMap0)
+ or HIGH(vBGMap0)
ld [wBGMapAnchor + 1], a
.not_underflowed
ld hl, wMetatileStandingY
--- a/engine/pokedex.asm
+++ b/engine/pokedex.asm
@@ -103,7 +103,7 @@
ret
Pokedex_CheckUnlockedUnownMode: ; 400a2
- ld a, [StatusFlags]
+ ld a, [wStatusFlags]
bit 1, a
jr nz, .unlocked
@@ -828,7 +828,7 @@
.decompress
ld hl, PokedexLZ
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
lb bc, BANK(PokedexLZ), $3a
call DecompressRequest2bpp
@@ -2402,7 +2402,7 @@
ld a, [wd265]
ld [CurPartySpecies], a
call GetBaseData
- ld de, VTiles2
+ ld de, vTiles2
predef GetMonFrontpic
ret
@@ -2410,7 +2410,7 @@
ld a, BANK(sScratch)
call GetSRAMBank
farcall LoadQuestionMarkPic
- ld hl, VTiles2
+ ld hl, vTiles2
ld de, sScratch
ld c, 7 * 7
ld a, [hROMBank]
@@ -2445,7 +2445,7 @@
push hl
ld e, l
ld d, h
- ld hl, VTiles2 tile $62
+ ld hl, vTiles2 tile $62
lb bc, BANK(Footprints), 2
call Request1bpp
pop hl
@@ -2457,7 +2457,7 @@
ld e, l
ld d, h
- ld hl, VTiles2 tile $64
+ ld hl, vTiles2 tile $64
lb bc, BANK(Footprints), 2
call Request1bpp
@@ -2466,13 +2466,13 @@
Pokedex_LoadGFX: ; 414b7
call DisableLCD
- ld hl, VTiles2
+ ld hl, vTiles2
ld bc, $31 tiles
xor a
call ByteFill
call Pokedex_LoadInvertedFont
call LoadFontsExtra
- ld hl, VTiles2 tile $60
+ ld hl, vTiles2 tile $60
ld bc, $20 tiles
call Pokedex_InvertTiles
call Pokedex_CheckSGB
@@ -2482,12 +2482,12 @@
.LoadPokedexLZ:
ld hl, PokedexLZ
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
call Decompress
.LoadPokedexSlowpokeLZ:
ld hl, PokedexSlowpokeLZ
- ld de, VTiles0
+ ld de, vTiles0
call Decompress
ld a, 6
call SkipMusic
@@ -2496,7 +2496,7 @@
Pokedex_LoadInvertedFont: ; 414fb
call LoadStandardFont
- ld hl, VTiles1
+ ld hl, vTiles1
ld bc, $80 tiles
Pokedex_InvertTiles: ; 41504
@@ -2536,7 +2536,7 @@
ld bc, 27 tiles
call Pokedex_InvertTiles
ld de, sScratch + $188
- ld hl, VTiles2 tile $40
+ ld hl, vTiles2 tile $40
lb bc, BANK(Pokedex_LoadUnownFont), 27
call Request2bpp
call CloseSRAM
@@ -2555,7 +2555,7 @@
ld a, UNOWN
ld [CurPartySpecies], a
call GetBaseData
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
predef GetMonFrontpic
pop af
ld [UnownLetter], a
@@ -2585,7 +2585,7 @@
call EnableLCD
call WaitBGMap
call GetBaseData
- ld de, VTiles2
+ ld de, vTiles2
predef GetMonFrontpic
ld a, SCGB_POKEDEX
call Pokedex_GetSGBLayout
--- a/engine/pokedex_3.asm
+++ b/engine/pokedex_3.asm
@@ -1,12 +1,12 @@
LoadSGBPokedexGFX: ; 1ddf1c
ld hl, SGBPokedexGFX_LZ
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
call Decompress
ret
LoadSGBPokedexGFX2: ; 1ddf26 (77:5f26)
ld hl, SGBPokedexGFX_LZ
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
lb bc, BANK(SGBPokedexGFX_LZ), $3a
call DecompressRequest2bpp
ret
--- a/engine/pokegear.asm
+++ b/engine/pokegear.asm
@@ -35,9 +35,9 @@
pop af
ld [Options], a
call ClearBGPalettes
- xor a ; LOW(VBGMap0)
+ xor a ; LOW(vBGMap0)
ld [hBGMapAddress], a
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
ld [hBGMapAddress + 1], a
ld a, $90
ld [hWY], a
@@ -88,15 +88,15 @@
Pokegear_LoadGFX: ; 90c4e
call ClearVBank1
ld hl, TownMapGFX
- ld de, VTiles2
+ ld de, vTiles2
ld a, BANK(TownMapGFX)
call FarDecompress
ld hl, PokegearGFX
- ld de, VTiles2 + $30 tiles
+ ld de, vTiles2 + $30 tiles
ld a, BANK(PokegearGFX)
call FarDecompress
ld hl, PokegearSpritesGFX
- ld de, VTiles0
+ ld de, vTiles0
ld a, BANK(PokegearSpritesGFX)
call Decompress
ld a, [MapGroup]
@@ -113,7 +113,7 @@
ld a, b
; standing sprite
push af
- ld de, VTiles0 tile $10
+ ld de, vTiles0 tile $10
ld bc, 4 tiles
call FarCopyBytes
pop af
@@ -121,7 +121,7 @@
; walking sprite
ld de, 12 tiles
add hl, de
- ld de, VTiles0 tile $14
+ ld de, vTiles0 tile $14
ld bc, 4 tiles
call FarCopyBytes
ret
@@ -128,7 +128,7 @@
.ssaqua
ld hl, FastShipGFX
- ld de, VTiles0 tile $10
+ ld de, vTiles0 tile $10
ld bc, 8 tiles
call CopyBytes
ret
@@ -243,9 +243,9 @@
ld a, [wcf65]
and a
jr nz, .kanto_0
- xor a ; LOW(VBGMap0)
+ xor a ; LOW(vBGMap0)
ld [hBGMapAddress], a
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
ld [hBGMapAddress + 1], a
call .UpdateBGMap
ld a, $90
@@ -252,9 +252,9 @@
jr .finish
.kanto_0
- xor a ; LOW(VBGMap1)
+ xor a ; LOW(vBGMap1)
ld [hBGMapAddress], a
- ld a, HIGH(VBGMap1)
+ ld a, HIGH(vBGMap1)
ld [hBGMapAddress + 1], a
call .UpdateBGMap
xor a
@@ -657,7 +657,7 @@
push af
depixel 0, 0
ld b, SPRITE_ANIM_INDEX_RED_WALK
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .got_gender
ld b, SPRITE_ANIM_INDEX_BLUE_WALK
@@ -734,7 +734,7 @@
; 910e8
TownMap_GetKantoLandmarkLimits: ; 910e8
- ld a, [StatusFlags]
+ ld a, [wStatusFlags]
bit 6, a
jr z, .not_hof
ld d, ROUTE_28
@@ -1583,7 +1583,7 @@
.EvolutionRadio:
; This station airs in the Lake of Rage area when Rocket are still in Mahogany.
- ld a, [StatusFlags]
+ ld a, [wStatusFlags]
bit 4, a
jr z, .NoSignal
ld a, [wPokegearMapPlayerIconLandmark]
@@ -1669,7 +1669,7 @@
ld hl, PlayRadioShow
call Radio_BackUpFarCallParams
ld de, NotBuenasPasswordName
- ld a, [StatusFlags2]
+ ld a, [wStatusFlags2]
bit 0, a
ret z
ld de, BuenasPasswordName
@@ -2119,7 +2119,7 @@
farcall ClearSpriteAnims
call LoadTownMapGFX
ld de, FlyMapLabelBorderGFX
- ld hl, VTiles2 tile $30
+ ld hl, vTiles2 tile $30
lb bc, BANK(FlyMapLabelBorderGFX), 6
call Request1bpp
call FlyMap
@@ -2161,9 +2161,9 @@
call ClearBGPalettes
ld a, $90
ld [hWY], a
- xor a ; LOW(VBGMap0)
+ xor a ; LOW(vBGMap0)
ld [hBGMapAddress], a
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
ld [hBGMapAddress + 1], a
ld a, [wTownMapPlayerIconLandmark]
ld e, a
@@ -2329,7 +2329,7 @@
HasVisitedSpawn: ; 91c50
; Check if spawn point c has been visited.
- ld hl, VisitedSpawns
+ ld hl, wVisitedSpawns
ld b, CHECK_FLAG
ld d, 0
predef FlagPredef
@@ -2455,11 +2455,11 @@
ld a, $1
ld [hInMenu], a
ld de, PokedexNestIconGFX
- ld hl, VTiles0 tile $7f
+ ld hl, vTiles0 tile $7f
lb bc, BANK(PokedexNestIconGFX), 1
call Request2bpp
call .GetPlayerOrFastShipIcon
- ld hl, VTiles0 tile $78
+ ld hl, vTiles0 tile $78
ld c, 4
call Request2bpp
call LoadTownMapGFX
@@ -2466,7 +2466,7 @@
call FillKantoMap
call .PlaceString_MonsNest
call TownMapPals
- hlbgcoord 0, 0, VBGMap1
+ hlbgcoord 0, 0, vBGMap1
call TownMapBGUpdate
call FillJohtoMap
call .PlaceString_MonsNest
@@ -2530,7 +2530,7 @@
ret
.right
- ld a, [StatusFlags]
+ ld a, [wStatusFlags]
bit 6, a ; hall of fame
ret z
ld a, [hWY]
@@ -2659,7 +2659,7 @@
inc de
push bc
ld c, 0 ; RED
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .got_gender
inc c ; BLUE
@@ -2871,7 +2871,7 @@
push af
farcall GetPlayerIcon
; Standing icon
- ld hl, VTiles0 tile $10
+ ld hl, vTiles0 tile $10
ld c, 4 ; # tiles
call Request2bpp
; Walking icon
@@ -2879,7 +2879,7 @@
add hl, de
ld d, h
ld e, l
- ld hl, VTiles0 tile $14
+ ld hl, vTiles0 tile $14
ld c, 4 ; # tiles
ld a, BANK(ChrisSpriteGFX) ; does nothing
call Request2bpp
@@ -2886,7 +2886,7 @@
; Animation/palette
depixel 0, 0
ld b, SPRITE_ANIM_INDEX_RED_WALK ; Male
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .got_gender
ld b, SPRITE_ANIM_INDEX_BLUE_WALK ; Female
@@ -2913,7 +2913,7 @@
LoadTownMapGFX: ; 91ff2
ld hl, TownMapGFX
- ld de, VTiles2
+ ld de, vTiles2
lb bc, BANK(TownMapGFX), $30
call DecompressRequest2bpp
ret
@@ -2948,13 +2948,13 @@
farcall ClearSpriteAnims
call LoadTownMapGFX
ld de, FlyMapLabelBorderGFX
- ld hl, VTiles2 tile $30
+ ld hl, vTiles2 tile $30
lb bc, BANK(FlyMapLabelBorderGFX), 6
call Request1bpp
call FillKantoMap
call TownMapBubble
call TownMapPals
- hlbgcoord 0, 0, VBGMap1
+ hlbgcoord 0, 0, vBGMap1
call TownMapBGUpdate
call FillJohtoMap
call TownMapBubble
@@ -3003,9 +3003,9 @@
call ClearBGPalettes
ld a, $90
ld [hWY], a
- xor a ; LOW(VBGMap0)
+ xor a ; LOW(vBGMap0)
ld [hBGMapAddress], a
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
ld [hBGMapAddress + 1], a
ld a, [wTownMapPlayerIconLandmark]
ld e, a
--- a/engine/print_party.asm
+++ b/engine/print_party.asm
@@ -141,17 +141,17 @@
call LoadFontsBattleExtra
ld de, GBPrinterHPIcon
- ld hl, VTiles2 tile $71
+ ld hl, vTiles2 tile $71
lb bc, BANK(GBPrinterHPIcon), 1
call Request1bpp
ld de, GBPrinterLvIcon
- ld hl, VTiles2 tile $6e
+ ld hl, vTiles2 tile $6e
lb bc, BANK(GBPrinterLvIcon), 1
call Request1bpp
ld de, ShinyIconGFX
- ld hl, VTiles2 tile $3f
+ ld hl, vTiles2 tile $3f
lb bc, BANK(ShinyIconGFX), 1
call Get2bpp
--- a/engine/printer.asm
+++ b/engine/printer.asm
@@ -49,7 +49,7 @@
ld a, [wPrinterQueueLength]
push af
- ld hl, VTiles1
+ ld hl, vTiles1
ld de, FontInversed
lb bc, BANK(FontInversed), $80
call Request1bpp
--- a/engine/radio.asm
+++ b/engine/radio.asm
@@ -4,7 +4,7 @@
cp POKE_FLUTE_RADIO
jr nc, .ok
; If Team Rocket is not occupying the radio tower, we don't need to be here.
- ld a, [StatusFlags2]
+ ld a, [wStatusFlags2]
bit 0, a ; checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
jr z, .ok
; If we're in Kanto, we don't need to be here.
@@ -1176,11 +1176,11 @@
jr nc, PeoplePlaces4
push af
ld hl, .E4Names
- ld a, [StatusFlags]
+ ld a, [wStatusFlags]
bit 6, a ; ENGINE_CREDITS_SKIP
jr z, .ok
ld hl, .KantoLeaderNames
- ld a, [KantoBadges]
+ ld a, [wKantoBadges]
cp %11111111
jr nz, .ok
ld hl, .MiscNames
@@ -1571,7 +1571,7 @@
jp c, BuenasPassword8
ld a, [wBuenasPassword]
; If we already generated the password today, we don't need to generate a new one.
- ld hl, WeeklyFlags
+ ld hl, wWeeklyFlags
bit 7, [hl]
jr nz, .AlreadyGotIt
; There are only 11 groups to choose from.
@@ -1593,7 +1593,7 @@
add e
ld [wBuenasPassword], a
; Set the flag so that we don't generate a new password this week.
- ld hl, WeeklyFlags
+ ld hl, wWeeklyFlags
set 7, [hl]
.AlreadyGotIt:
ld c, a
@@ -1737,7 +1737,7 @@
BuenasPasswordAfterMidnight:
push hl
- ld hl, WeeklyFlags
+ ld hl, wWeeklyFlags
res 7, [hl]
pop hl
ld a, BUENAS_PASSWORD_8
@@ -1744,7 +1744,7 @@
jp NextRadioLine
BuenasPassword8:
- ld hl, WeeklyFlags
+ ld hl, wWeeklyFlags
res 7, [hl]
ld hl, BuenaRadioMidnightText10
ld a, BUENAS_PASSWORD_9
@@ -1812,7 +1812,7 @@
farcall NoRadioName
pop af
ld [hBGMapMode], a
- ld hl, WeeklyFlags
+ ld hl, wWeeklyFlags
res 7, [hl]
ld a, BUENAS_PASSWORD
ld [wCurrentRadioLine], a
--- a/engine/routines/drawkrispackgfx.asm
+++ b/engine/routines/drawkrispackgfx.asm
@@ -5,7 +5,7 @@
ld a, [hli]
ld e, a
ld d, [hl]
- ld hl, VTiles2 tile $50
+ ld hl, vTiles2 tile $50
lb bc, BANK(PackFGFX), 15
call Request2bpp
ret
--- a/engine/routines/phonering_copytilemapatonce.asm
+++ b/engine/routines/phonering_copytilemapatonce.asm
@@ -21,11 +21,11 @@
jr c, .wait
di
- ld a, BANK(VBGMap2)
+ ld a, BANK(vBGMap2)
ld [rVBK], a
hlcoord 0, 0, AttrMap
call .CopyTilemapAtOnce
- ld a, BANK(VBGMap0)
+ ld a, BANK(vBGMap0)
ld [rVBK], a
hlcoord 0, 0
call .CopyTilemapAtOnce
--- a/engine/routines/savemenu_copytilemapatonce.asm
+++ b/engine/routines/savemenu_copytilemapatonce.asm
@@ -18,11 +18,11 @@
jr c, .WaitLY
di
- ld a, BANK(VBGMap2)
+ ld a, BANK(vBGMap2)
ld [rVBK], a
hlcoord 0, 0, AttrMap
call .CopyTilemapAtOnce
- ld a, BANK(VBGMap0)
+ ld a, BANK(vBGMap0)
ld [rVBK], a
hlcoord 0, 0
call .CopyTilemapAtOnce
--- a/engine/routines/trademonfrontpic.asm
+++ b/engine/routines/trademonfrontpic.asm
@@ -1,7 +1,7 @@
GetTrademonFrontpic: ; 4d7fd
ld a, [wOTTrademonSpecies]
ld hl, wOTTrademonDVs
- ld de, VTiles2
+ ld de, vTiles2
push de
push af
predef GetUnownLetter
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -691,8 +691,8 @@
ld de, StartDay
ld bc, 8
call CopyBytes
- ld hl, sPlayerData + StatusFlags - wPlayerData
- ld de, StatusFlags
+ ld hl, sPlayerData + wStatusFlags - wPlayerData
+ ld de, wStatusFlags
ld a, [hl]
ld [de], a
call CloseSRAM
@@ -710,8 +710,8 @@
ld de, StartDay
ld bc, 8
call CopyBytes
- ld hl, sBackupPlayerData + StatusFlags - wPlayerData
- ld de, StatusFlags
+ ld hl, sBackupPlayerData + wStatusFlags - wPlayerData
+ ld de, wStatusFlags
ld a, [hl]
ld [de], a
call CloseSRAM
--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -2609,7 +2609,7 @@
Script_wildoff:
; script command 0x38
- ld hl, StatusFlags
+ ld hl, wStatusFlags
set 5, [hl]
ret
@@ -2616,7 +2616,7 @@
Script_wildon:
; script command 0x37
- ld hl, StatusFlags
+ ld hl, wStatusFlags
res 5, [hl]
ret
@@ -2991,12 +2991,12 @@
Script_halloffame:
; script command 0xa1
- ld hl, GameTimerPause
+ ld hl, wGameTimerPause
res 0, [hl]
farcall TrainerRankings_HallOfFame
farcall TrainerRankings_HallOfFame2
farcall HallOfFame
- ld hl, GameTimerPause
+ ld hl, wGameTimerPause
set 0, [hl]
jr ReturnFromCredits
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -1,3 +1,4 @@
+SLOTS_NOBIAS EQU -1
SLOTS_NOMATCH EQU -1
SLOTS_SEVEN EQU $00
SLOTS_POKEBALL EQU $04
@@ -7,6 +8,57 @@
SLOTS_STARYU EQU $14
REEL_SIZE EQU 15
+; SlotsJumptable constants
+ const_def
+ const SLOTS_INIT
+ const SLOTS_BET_AND_START
+ const SLOTS_WAIT_START
+ const SLOTS_WAIT_REEL1
+ const SLOTS_WAIT_STOP_REEL1
+ const SLOTS_WAIT_REEL2
+ const SLOTS_WAIT_STOP_REEL2
+ const SLOTS_WAIT_REEL3
+ const SLOTS_WAIT_STOP_REEL3
+ const SLOTS_NEXT_09
+ const SLOTS_NEXT_0a
+ const SLOTS_NEXT_0b
+ const SLOTS_FLASH_IF_WIN
+ const SLOTS_FLASH_SCREEN
+ const SLOTS_GIVE_EARNED_COINS
+ const SLOTS_PAYOUT_TEXT_AND_ANIM
+ const SLOTS_PAYOUT_ANIM
+ const SLOTS_RESTART_OF_QUIT
+ const SLOTS_QUIT
+SLOTS_END_LOOP_F EQU 7
+
+; ReelActionJumptable constants
+ const_def
+ const REEL_ACTION_DO_NOTHING
+ const REEL_ACTION_STOP_REEL_IGNORE_JOYPAD
+ const REEL_ACTION_QUADRUPLE_RATE
+ const REEL_ACTION_DOUBLE_RATE
+ const REEL_ACTION_NORMAL_RATE
+ const REEL_ACTION_HALF_RATE
+ const REEL_ACTION_QUARTER_RATE
+ const REEL_ACTION_STOP_REEL1
+ const REEL_ACTION_STOP_REEL2
+ const REEL_ACTION_STOP_REEL3
+ const REEL_ACTION_SET_UP_REEL2_SKIP_TO_7
+ const REEL_ACTION_WAIT_REEL2_SKIP_TO_7
+ const REEL_ACTION_FAST_SPIN_REEL2_UNTIL_LINED_UP_7S
+ const REEL_ACTION_UNUSED
+ const REEL_ACTION_CHECK_DROP_REEL
+ const REEL_ACTION_WAIT_DROP_REEL
+ const REEL_ACTION_START_SLOW_ADVANCE_REEL3
+ const REEL_ACTION_WAIT_SLOW_ADVANCE_REEL3
+ const REEL_ACTION_INIT_GOLEM
+ const REEL_ACTION_WAIT_GOLEM
+ const REEL_ACTION_END_GOLEM
+ const REEL_ACTION_INIT_CHANSEY
+ const REEL_ACTION_WAIT_CHANSEY
+ const REEL_ACTION_WAIT_EGG
+ const REEL_ACTION_DROP_REEL
+
_SlotMachine:
ld hl, Options
set NO_TEXT_SCROLL, [hl]
@@ -23,7 +75,7 @@
farcall TrainerRankings_EndSlotsWinStreak
ld hl, Options
res NO_TEXT_SCROLL, [hl]
- ld hl, rLCDC ; $ff40
+ ld hl, rLCDC
res 2, [hl]
ret
@@ -36,7 +88,7 @@
call DelayFrame
call DisableLCD
hlbgcoord 0, 0
- ld bc, VBGMap1 - VBGMap0
+ ld bc, vBGMap1 - vBGMap0
ld a, " "
call ByteFill
ld b, SCGB_SLOT_MACHINE
@@ -48,19 +100,19 @@
call ByteFill
ld hl, Slots2LZ
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
call Decompress
ld hl, Slots3LZ
- ld de, VTiles0 tile $40
+ ld de, vTiles0 tile $40
call Decompress
ld hl, Slots1LZ
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
call Decompress
ld hl, Slots2LZ
- ld de, VTiles2 tile $25
+ ld de, vTiles2 tile $25
call Decompress
ld hl, SlotsTilemap
@@ -68,32 +120,32 @@
ld bc, SCREEN_WIDTH * 12
call CopyBytes
- ld hl, rLCDC ; $ff40
+ ld hl, rLCDC
set 2, [hl]
call EnableLCD
- ld hl, wSlots ; Alias: wTrademons
- ld bc, wSlotsEnd - wSlots ; Alias: wTrademonsEnd
+ ld hl, wSlots
+ ld bc, wSlotsEnd - wSlots
xor a
call ByteFill
- call InitReelTiles
+ call Slots_InitReelTiles
call Slots_GetPals
ld a, $7
ld hl, wSpriteAnimDict
ld [hli], a
ld [hl], $40
- xor a
+ xor a ; SLOTS_INIT
ld [wJumptableIndex], a
- ld a, SLOTS_NOMATCH
+ ld a, SLOTS_NOBIAS
ld [wSlotBias], a
ld de, MUSIC_GAME_CORNER
call PlayMusic
xor a
- ld [wd002], a
+ ld [wKeepSevenBiasChance], a ; 87.5% chance
call Random
and %00101010
ret nz
- ld a, $1
- ld [wd002], a
+ ld a, 1
+ ld [wKeepSevenBiasChance], a ; 12.5% chance
ret
Slots_GetPals: ; 9279b (24:679b)
@@ -110,7 +162,7 @@
SlotsLoop: ; 927af (24:67af)
ld a, [wJumptableIndex]
- bit 7, a
+ bit SLOTS_END_LOOP_F, a
jr nz, .stop
call SlotsJumptable
call Slots_SpinReels
@@ -214,68 +266,68 @@
jumptable .Jumptable, wJumptableIndex
.Jumptable:
- dw Slots_Init ; 00
- dw Slots_BetAndStart ; 01
- dw Slots_WaitStart ; 02
- dw Slots_WaitReel1 ; 03
- dw Slots_WaitStopReel1 ; 04
- dw Slots_WaitReel2 ; 05
- dw Slots_WaitStopReel2 ; 06
- dw Slots_WaitReel3 ; 07
- dw Slots_WaitStopReel3 ; 08
- dw Slots_Next ; 09
- dw Slots_Next ; 0a
- dw Slots_Next ; 0b
- dw Slots_FlashIfWin ; 0c
- dw Slots_FlashScreen ; 0d
- dw Slots_GiveEarnedCoins ; 0e
- dw Slots_PayoutTextAndAnim ; 0f
- dw Slots_PayoutAnim ; 10
- dw Slots_RestartOrQuit ; 11
- dw Slots_Quit ; 12
+ dw SlotsAction_Init ; 00
+ dw SlotsAction_BetAndStart ; 01
+ dw SlotsAction_WaitStart ; 02
+ dw SlotsAction_WaitReel1 ; 03
+ dw SlotsAction_WaitStopReel1 ; 04
+ dw SlotsAction_WaitReel2 ; 05
+ dw SlotsAction_WaitStopReel2 ; 06
+ dw SlotsAction_WaitReel3 ; 07
+ dw SlotsAction_WaitStopReel3 ; 08
+ dw SlotsAction_Next ; 09
+ dw SlotsAction_Next ; 0a
+ dw SlotsAction_Next ; 0b
+ dw SlotsAction_FlashIfWin ; 0c
+ dw SlotsAction_FlashScreen ; 0d
+ dw SlotsAction_GiveEarnedCoins ; 0e
+ dw SlotsAction_PayoutTextAndAnim ; 0f
+ dw SlotsAction_PayoutAnim ; 10
+ dw SlotsAction_RestartOrQuit ; 11
+ dw SlotsAction_Quit ; 12
-Slots_Next: ; 92879 (24:6879)
+SlotsAction_Next: ; 92879 (24:6879)
ld hl, wJumptableIndex
inc [hl]
ret
-Slots_Init: ; 9287e (24:687e)
- call Slots_Next
+SlotsAction_Init: ; 9287e (24:687e)
+ call SlotsAction_Next
xor a
ld [wFirstTwoReelsMatching], a
ld [wFirstTwoReelsMatchingSevens], a
- ld a, -1
+ ld a, SLOTS_NOMATCH
ld [wSlotMatched], a
ret
-Slots_BetAndStart: ; 9288e (24:688e)
+SlotsAction_BetAndStart: ; 9288e (24:688e)
call Slots_AskBet
jr nc, .proceed
- ld a, 18
+ ld a, SLOTS_QUIT
ld [wJumptableIndex], a
ret
.proceed
- call Slots_Next
+ call SlotsAction_Next
call Slots_IlluminateBetLights
call Slots_InitBias
ld a, 32
- ld [wcf64], a
- ld a, 4
+ ld [wSlotsDelay], a
+ ld a, REEL_ACTION_NORMAL_RATE
ld [wReel1ReelAction], a
ld [wReel2ReelAction], a
ld [wReel3ReelAction], a
- ld a, $4
- ld [wReel1Slot09], a
- ld [wReel2Slot09], a
- ld [wReel3Slot09], a
+ ld a, 4
+ ld [wReel1ManipCounter], a
+ ld [wReel2ManipCounter], a
+ ld [wReel3ManipCounter], a
call WaitSFX
ld a, SFX_SLOT_MACHINE_START
call Slots_PlaySFX
ret
-Slots_WaitStart: ; 928c6 (24:68c6)
- ld hl, wcf64
+SlotsAction_WaitStart: ; 928c6 (24:68c6)
+ ld hl, wSlotsDelay
ld a, [hl]
and a
jr z, .proceed
@@ -283,22 +335,22 @@
ret
.proceed
- call Slots_Next
+ call SlotsAction_Next
xor a
ld [hJoypadSum], a
ret
-Slots_WaitReel1: ; 928d6 (24:68d6)
- ld hl, hJoypadSum ; $ffa5
+SlotsAction_WaitReel1: ; 928d6 (24:68d6)
+ ld hl, hJoypadSum
ld a, [hl]
and A_BUTTON
ret z
- call Slots_Next
+ call SlotsAction_Next
call Slots_StopReel1
ld [wReel1ReelAction], a
-Slots_WaitStopReel1: ; 928e6 (24:68e6)
+SlotsAction_WaitStopReel1: ; 928e6 (24:68e6)
ld a, [wReel1ReelAction]
- cp $0
+ cp REEL_ACTION_DO_NOTHING
ret nz
ld a, SFX_STOP_SLOT
call Slots_PlaySFX
@@ -305,20 +357,20 @@
ld bc, wReel1
ld de, wReel1Stopped
call Slots_LoadReelState
- call Slots_Next
+ call SlotsAction_Next
xor a
ld [hJoypadSum], a
-Slots_WaitReel2: ; 92900 (24:6900)
- ld hl, hJoypadSum ; $ffa5
+SlotsAction_WaitReel2: ; 92900 (24:6900)
+ ld hl, hJoypadSum
ld a, [hl]
and A_BUTTON
ret z
- call Slots_Next
+ call SlotsAction_Next
call Slots_StopReel2
ld [wReel2ReelAction], a
-Slots_WaitStopReel2: ; 92910 (24:6910)
+SlotsAction_WaitStopReel2: ; 92910 (24:6910)
ld a, [wReel2ReelAction]
- cp $0
+ cp REEL_ACTION_DO_NOTHING
ret nz
ld a, SFX_STOP_SLOT
call Slots_PlaySFX
@@ -325,20 +377,20 @@
ld bc, wReel2
ld de, wReel2Stopped
call Slots_LoadReelState
- call Slots_Next
+ call SlotsAction_Next
xor a
ld [hJoypadSum], a
-Slots_WaitReel3: ; 9292a (24:692a)
- ld hl, hJoypadSum ; $ffa5
+SlotsAction_WaitReel3: ; 9292a (24:692a)
+ ld hl, hJoypadSum
ld a, [hl]
and A_BUTTON
ret z
- call Slots_Next
+ call SlotsAction_Next
call Slots_StopReel3
ld [wReel3ReelAction], a
-Slots_WaitStopReel3: ; 9293a (24:693a)
+SlotsAction_WaitStopReel3: ; 9293a (24:693a)
ld a, [wReel3ReelAction]
- cp $0
+ cp REEL_ACTION_DO_NOTHING
ret nz
ld a, SFX_STOP_SLOT
call Slots_PlaySFX
@@ -345,25 +397,25 @@
ld bc, wReel3
ld de, wReel3Stopped
call Slots_LoadReelState
- call Slots_Next
+ call SlotsAction_Next
xor a
ld [hJoypadSum], a
ret
-Slots_FlashIfWin: ; 92955 (24:6955)
+SlotsAction_FlashIfWin: ; 92955 (24:6955)
ld a, [wSlotMatched]
- cp -1
+ cp SLOTS_NOMATCH
jr nz, .GotIt
- call Slots_Next
- call Slots_Next
+ call SlotsAction_Next
+ call SlotsAction_Next
ret
.GotIt:
- call Slots_Next
+ call SlotsAction_Next
ld a, 16
- ld [wcf64], a
-Slots_FlashScreen: ; 9296b (24:696b)
- ld hl, wcf64
+ ld [wSlotsDelay], a
+SlotsAction_FlashScreen: ; 9296b (24:696b)
+ ld hl, wSlotsDelay
ld a, [hl]
and a
jr z, .done
@@ -380,26 +432,26 @@
.done
call Slots_GetPals
- call Slots_Next
+ call SlotsAction_Next
ret
-Slots_GiveEarnedCoins: ; 92987 (24:6987)
+SlotsAction_GiveEarnedCoins: ; 92987 (24:6987)
xor a
ld [wFirstTwoReelsMatching], a
ld [wFirstTwoReelsMatchingSevens], a
ld a, %11100100
call DmgToCgbBGPals
- call SlotGetPayout
+ call Slots_GetPayout
xor a
- ld [wcf64], a
- call Slots_Next
+ ld [wSlotsDelay], a
+ call SlotsAction_Next
ret
-Slots_PayoutTextAndAnim: ; 9299e (24:699e)
- call SlotPayoutText
- call Slots_Next
-Slots_PayoutAnim: ; 929a4 (24:69a4)
- ld hl, wcf64
+SlotsAction_PayoutTextAndAnim: ; 9299e (24:699e)
+ call Slots_PayoutText
+ call SlotsAction_Next
+SlotsAction_PayoutAnim: ; 929a4 (24:69a4)
+ ld hl, wSlotsDelay
ld a, [hl]
inc [hl]
and $1
@@ -418,7 +470,7 @@
ld d, [hl]
inc hl
ld e, [hl]
- call Slot_CheckCoinCaseFull
+ call Slots_CheckCoinCaseFull
jr c, .okay
inc de
.okay
@@ -425,7 +477,7 @@
ld [hl], e
dec hl
ld [hl], d
- ld a, [wcf64]
+ ld a, [wSlotsDelay]
and $7
ret z ; ret nz would be more appropriate
ld de, SFX_GET_COIN_FROM_SLOTS
@@ -433,26 +485,26 @@
ret
.done
- call Slots_Next
+ call SlotsAction_Next
ret
-Slots_RestartOrQuit: ; 929d9 (24:69d9)
+SlotsAction_RestartOrQuit: ; 929d9 (24:69d9)
call Slots_DeilluminateBetLights
call WaitPressAorB_BlinkCursor
call Slots_AskPlayAgain
jr c, .exit_slots
- ld a, 0
+ ld a, SLOTS_INIT
ld [wJumptableIndex], a
ret
.exit_slots
- ld a, 18
+ ld a, SLOTS_QUIT
ld [wJumptableIndex], a
ret
-Slots_Quit: ; 929f0 (24:69f0)
+SlotsAction_Quit: ; 929f0 (24:69f0)
ld hl, wJumptableIndex
- set 7, [hl]
+ set SLOTS_END_LOOP_F, [hl]
ret
Slots_LoadReelState: ; 929f6 (24:69f6)
@@ -469,7 +521,7 @@
ld [de], a
ret
-Slot_CheckCoinCaseFull: ; 92a04 (24:6a04)
+Slots_CheckCoinCaseFull: ; 92a04 (24:6a04)
ld a, d
cp HIGH(MAX_COINS)
jr c, .not_full
@@ -504,10 +556,18 @@
ret
Slots_StopReel1: ; 92a2b (24:6a2b)
- ld a, $7
+; Always set the REEL_ACTION_STOP_REEL1 action.
+ ld a, REEL_ACTION_STOP_REEL1
ret
Slots_StopReel2: ; 92a2e (24:6a2e)
+; As long as, the following three meet, there's a 31.25% chance
+; to set action REEL_ACTION_SET_UP_REEL2_SKIP_TO_7:
+; - Bet is >= 2 coins
+; - There's a 7 symbol visible in reel #1
+; - Current spin isn't biased or is biased towards SEVEN
+; In any other case, REEL_ACTION_STOP_REEL2 is set.
+
ld a, [wSlotBet]
cp $2
jr c, .dont_jump
@@ -514,7 +574,7 @@
ld a, [wSlotBias]
and a
jr z, .skip
- cp SLOTS_NOMATCH
+ cp SLOTS_NOBIAS
jr nz, .dont_jump
.skip
call .CheckReel1ForASeven
@@ -522,11 +582,11 @@
call Random
cp $50 ; 32%
jr nc, .dont_jump
- ld a, $a
+ ld a, REEL_ACTION_SET_UP_REEL2_SKIP_TO_7
ret
.dont_jump
- ld a, $8
+ ld a, REEL_ACTION_STOP_REEL2
ret
.CheckReel1ForASeven: ; 92a51 (24:6a51)
@@ -541,6 +601,21 @@
ret
Slots_StopReel3: ; 92a60 (24:6a60)
+; If no matching SEVEN symbols in reels #1 and #2:
+; - REEL_ACTION_STOP_REEL3, 100%
+
+; If matching SEVEN symbols and NO bias to SEVEN:
+; - REEL_ACTION_STOP_REEL3, 37.5%
+; - REEL_ACTION_START_SLOW_ADVANCE_REEL3, 31.3%
+; - REEL_ACTION_INIT_GOLEM, 31.3%
+; - REEL_ACTION_INIT_CHANSEY, 0%
+
+; If matching SEVEN symbols and bias to SEVEN:
+; - REEL_ACTION_STOP_REEL3, 29.7%
+; - REEL_ACTION_START_SLOW_ADVANCE_REEL3, 23.4%
+; - REEL_ACTION_INIT_GOLEM, 23.4%
+; - REEL_ACTION_INIT_CHANSEY, 23.4%
+
ld a, [wFirstTwoReelsMatching]
and a
jr z, .stop
@@ -557,7 +632,7 @@
jr nc, .slow_advance
cp 60
jr nc, .golem
- ld a, $15
+ ld a, REEL_ACTION_INIT_CHANSEY
ret
.biased
@@ -567,18 +642,18 @@
cp 80
jr nc, .slow_advance
.golem
- ld a, $12
+ ld a, REEL_ACTION_INIT_GOLEM
ret
.slow_advance
- ld a, $10
+ ld a, REEL_ACTION_START_SLOW_ADVANCE_REEL3
ret
.stop
- ld a, $9
+ ld a, REEL_ACTION_STOP_REEL3
ret
-InitReelTiles: ; 92a98 (24:6a98)
+Slots_InitReelTiles: ; 92a98 (24:6a98)
ld bc, wReel1
ld hl, wReel1OAMAddr - wReel1
add hl, bc
@@ -637,14 +712,14 @@
.OAM: ; 92af9 (24:6af9)
ld hl, wReel1ReelAction - wReel1
add hl, bc
- ld [hl], $0
+ ld [hl], REEL_ACTION_DO_NOTHING
ld hl, wReel1Position - wReel1
add hl, bc
ld [hl], REEL_SIZE - 1
ld hl, wReel1SpinDistance - wReel1
add hl, bc
- ld [hl], $0
- call UpdateReelPositionAndOAM
+ ld [hl], REEL_ACTION_DO_NOTHING
+ call Slots_UpdateReelPositionAndOAM
ret
Slots_SpinReels: ; 92b0f (24:6b0f)
@@ -662,7 +737,7 @@
ld a, [hl]
and $f
jr nz, .skip
- call Function92bd4
+ call ReelActionJumptable
.skip
ld hl, wReel1SpinRate - wReel1
add hl, bc
@@ -675,7 +750,7 @@
add [hl]
ld [hl], a
and $f
- jr z, UpdateReelPositionAndOAM
+ jr z, Slots_UpdateReelPositionAndOAM
ld hl, wReel1OAMAddr - wReel1
add hl, bc
ld a, [hli]
@@ -693,7 +768,7 @@
jr nz, .loop
ret
-UpdateReelPositionAndOAM: ; 92b53 (24:6b53)
+Slots_UpdateReelPositionAndOAM: ; 92b53 (24:6b53)
ld hl, wReel1XCoord - wReel1
add hl, bc
ld a, [hl]
@@ -786,12 +861,12 @@
db 0, 1, 2, 3, 4, 5
; 92bd4
-Function92bd4: ; 92bd4 (24:6bd4)
+ReelActionJumptable: ; 92bd4 (24:6bd4)
ld hl, wReel1ReelAction - wReel1
add hl, bc
ld e, [hl]
ld d, 0
- ld hl, .dw
+ ld hl, .Jumptable
add hl, de
add hl, de
ld a, [hli]
@@ -801,10 +876,9 @@
; 92be4 (24:6be4)
-.dw ; 92be4
-
+.Jumptable: ; 92be4
dw ReelAction_DoNothing ; 00
- dw Slots_StopReelIgnoreJoypad ; 01
+ dw ReelAction_StopReelIgnoreJoypad ; 01
dw ReelAction_QuadrupleRate ; 02
dw ReelAction_DoubleRate ; 03
dw ReelAction_NormalRate ; 04
@@ -816,7 +890,7 @@
dw ReelAction_SetUpReel2SkipTo7 ; 0a
dw ReelAction_WaitReel2SkipTo7 ; 0b
dw ReelAction_FastSpinReel2UntilLinedUp7s ; 0c
- dw ReelAction_BoringReelDrops ; 0d
+ dw ReelAction_Unused ; 0d
dw ReelAction_CheckDropReel ; 0e
dw ReelAction_WaitDropReel ; 0f
dw ReelAction_StartSlowAdvanceReel3 ; 10
@@ -824,7 +898,7 @@
dw ReelAction_InitGolem ; 12
dw ReelAction_WaitGolem ; 13
dw ReelAction_EndGolem ; 14
- dw Slots_InitChansey ; 15
+ dw ReelAction_InitChansey ; 15
dw ReelAction_WaitChansey ; 16
dw ReelAction_WaitEgg ; 17
dw ReelAction_DropReel ; 18
@@ -838,7 +912,7 @@
ReelAction_QuadrupleRate: ; 92c17
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $10
+ ld [hl], 16
ret
; 92c1e
@@ -846,7 +920,7 @@
ReelAction_DoubleRate: ; 92c1e
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $8
+ ld [hl], 8
ret
; 92c25
@@ -854,7 +928,7 @@
ReelAction_NormalRate: ; 92c25
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $4
+ ld [hl], 4
ret
; 92c2c
@@ -862,7 +936,7 @@
ReelAction_HalfRate: ; 92c2c
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $2
+ ld [hl], 2
ret
; 92c33
@@ -870,7 +944,7 @@
ReelAction_QuarterRate: ; 92c33
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $1
+ ld [hl], 1
ret
; 92c3a
@@ -878,15 +952,15 @@
Slots_StopReel: ; 92c3a
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $0
+ ld [hl], 0
ld hl, wReel1ReelAction - wReel1
add hl, bc
- ld [hl], $1
- ld hl, wReel1Slot0f - wReel1
+ ld [hl], REEL_ACTION_STOP_REEL_IGNORE_JOYPAD
+ ld hl, wReel1StopDelay - wReel1
add hl, bc
- ld [hl], $3
-Slots_StopReelIgnoreJoypad: ; 92c4c
- ld hl, wReel1Slot0f - wReel1
+ ld [hl], 3
+ReelAction_StopReelIgnoreJoypad: ; 92c4c
+ ld hl, wReel1StopDelay - wReel1
add hl, bc
ld a, [hl]
and a
@@ -897,7 +971,7 @@
.EndReel:
ld hl, wReel1ReelAction - wReel1
add hl, bc
- ld a, $0
+ ld a, REEL_ACTION_DO_NOTHING
ld [hl], a
ret
@@ -904,10 +978,15 @@
; 92c5e
ReelAction_StopReel1: ; 92c5e
+; If no bias: don't manipulate reel.
+; If bias: manipulate reel up to wReel1ManipCounter (i.e. 4) times,
+; stoping early if the biased symbol shows up anywhere in reel #1,
+; even if the current bet won't allow lining it up.
+
ld a, [wSlotBias]
- cp SLOTS_NOMATCH
+ cp SLOTS_NOBIAS
jr z, .NoBias
- ld hl, wReel1Slot09 - wReel1
+ ld hl, wReel1ManipCounter - wReel1
add hl, bc
ld a, [hl]
and a
@@ -938,6 +1017,11 @@
; 92c86
ReelAction_StopReel2: ; 92c86
+; If no bias: don't manipulate reel.
+; If bias: manipulate reel up to wReel2ManipCounter (i.e. 4) times,
+; stoping early if the biased symbol is lined up in the first two
+; reels, according to the lines that the current bet allows.
+
call Slots_CheckMatchedFirstTwoReels
jr nc, .nope
ld a, [wSlotBuildingMatch]
@@ -946,9 +1030,9 @@
jr z, .NoBias
.nope
ld a, [wSlotBias]
- cp SLOTS_NOMATCH
+ cp SLOTS_NOBIAS
jr z, .NoBias
- ld hl, wReel1Slot09 - wReel1
+ ld hl, wReel1ManipCounter - wReel1
add hl, bc
ld a, [hl]
and a
@@ -963,12 +1047,16 @@
; 92ca9
ReelAction_StopReel3: ; 92ca9
+; Manipulate the reel up to wReel3ManipCounter (i.e. 4) times,
+; stopping early if the bias symbol is lined up for a win.
+; If not biased to any symbols, stop as soon as nothing is lined up.
+
call Slots_CheckMatchedAllThreeReels
jr nc, .NoMatch
ld hl, wSlotBias
cp [hl]
jr z, .NoBias
- ld hl, wReel1Slot09 - wReel1
+ ld hl, wReel1ManipCounter - wReel1
add hl, bc
ld a, [hl]
and a
@@ -978,9 +1066,9 @@
.NoMatch:
ld a, [wSlotBias]
- cp SLOTS_NOMATCH
+ cp SLOTS_NOBIAS
jr z, .NoBias
- ld hl, wReel1Slot09 - wReel1
+ ld hl, wReel1ManipCounter - wReel1
add hl, bc
ld a, [hl]
and a
@@ -995,6 +1083,11 @@
; 92cd2
ReelAction_SetUpReel2SkipTo7: ; 92cd2
+; Unique reel 2 action (see Slots_StopReel2)
+; Ensures that 7 symbols become lined up in the first two reels,
+; but more often than not, this is only a way to get our hopes up, as
+; it makes exciting reel #3 modes with no success hope more common.
+
call Slots_CheckMatchedFirstTwoReels
jr nc, .no_match
ld a, [wFirstTwoReelsMatchingSevens]
@@ -1008,19 +1101,19 @@
call Slots_PlaySFX
ld hl, wReel1ReelAction - wReel1
add hl, bc
- inc [hl]
- ld hl, wReel1Slot0a - wReel1
+ inc [hl] ; REEL_ACTION_WAIT_REEL2_SKIP_TO_7
+ ld hl, wReel1ManipDelay - wReel1
add hl, bc
- ld [hl], $20
+ ld [hl], 32
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $0
+ ld [hl], 0
ret
; 92cf8
ReelAction_WaitReel2SkipTo7: ; 92cf8
- ld hl, wReel1Slot0a - wReel1
+ ld hl, wReel1ManipDelay - wReel1
add hl, bc
ld a, [hl]
and a
@@ -1033,10 +1126,10 @@
call Slots_PlaySFX
ld hl, wReel1ReelAction - wReel1
add hl, bc
- inc [hl]
+ inc [hl] ; REEL_ACTION_FAST_SPIN_REEL2_UNTIL_LINED_UP_7S
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $8
+ ld [hl], 8
ret
; 92d13
@@ -1053,6 +1146,14 @@
; 92d20
ReelAction_InitGolem: ; 92d20
+; Ensures SEVENs are lined up if there's bias to SEVEN.
+; Ensures nothing is lined up if there's no bias symbols.
+; No other bias symbols are compatible with this mode.
+
+; This is achieved by throwing Golem until the desired result
+; is produced. The amount of Golem thrown can be anywhere from
+; 1 to 14 for SEVEN bias, and 4-8 for no bias.
+
call Slots_CheckMatchedAllThreeReels
ret c
ld a, SFX_STOP_SLOT
@@ -1060,11 +1161,11 @@
call Slots_WaitSFX
ld hl, wReel1ReelAction - wReel1
add hl, bc
- inc [hl]
+ inc [hl] ; REEL_ACTION_WAIT_GOLEM
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $0
- call Function92fc0
+ ld [hl], 0
+ call Slots_GetNumberOfGolems
push bc
push af
depixel 12, 13
@@ -1076,9 +1177,9 @@
ld [hl], a
pop bc
xor a
- ld [wcf64], a
+ ld [wSlotsDelay], a
ReelAction_WaitGolem: ; 92d4f
- ld a, [wcf64]
+ ld a, [wSlotsDelay]
cp 2
jr z, .two
cp 1
@@ -1093,10 +1194,10 @@
.one
ld hl, wReel1ReelAction - wReel1
add hl, bc
- inc [hl]
+ inc [hl] ; REEL_ACTION_END_GOLEM
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $8
+ ld [hl], 8
ret
; 92d6e
@@ -1103,18 +1204,23 @@
ReelAction_EndGolem: ; 92d6e
xor a
- ld [wcf64], a
+ ld [wSlotsDelay], a
ld hl, wReel1ReelAction - wReel1
add hl, bc
- dec [hl]
+ dec [hl] ; REEL_ACTION_WAIT_GOLEM
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $0
+ ld [hl], 0
ret
; 92d7e
-Slots_InitChansey: ; 92d7e
+ReelAction_InitChansey: ; 92d7e
+; Ensures the lining up of SEVEN symbols, but this mode is only possible
+; when there is bias to SEVEN symbols (and even then, it's still rare).
+; Chansey releases and egg and reel #3 is made to advance 17 slots very
+; quickly as many times as necessary for the match to SEVENs to show up.
+
call Slots_CheckMatchedAllThreeReels
ret c
ld a, SFX_STOP_SLOT
@@ -1122,10 +1228,10 @@
call Slots_WaitSFX
ld hl, wReel1ReelAction - wReel1
add hl, bc
- inc [hl]
+ inc [hl] ; REEL_ACTION_WAIT_CHANSEY
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $0
+ ld [hl], 0
push bc
depixel 12, 0
ld a, SPRITE_ANIM_INDEX_SLOTS_CHANSEY
@@ -1132,35 +1238,35 @@
call _InitSpriteAnimStruct
pop bc
xor a
- ld [wcf64], a
+ ld [wSlotsDelay], a
ret
; 92da4
ReelAction_WaitChansey: ; 92da4
- ld a, [wcf64]
+ ld a, [wSlotsDelay]
and a
ret z
ld hl, wReel1ReelAction - wReel1
add hl, bc
- inc [hl]
- ld a, $2
- ld [wcf64], a
+ inc [hl] ; REEL_ACTION_WAIT_EGG
+ ld a, 2
+ ld [wSlotsDelay], a
ReelAction_WaitEgg: ; 92db3
- ld a, [wcf64]
+ ld a, [wSlotsDelay]
cp $4
ret c
ld hl, wReel1ReelAction - wReel1
add hl, bc
- inc [hl]
+ inc [hl] ; REEL_ACTION_DROP_REEL
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $10
- ld hl, wReel1Slot0a - wReel1
+ ld [hl], 16
+ ld hl, wReel1ManipDelay - wReel1
add hl, bc
- ld [hl], $11
+ ld [hl], 17
ReelAction_DropReel: ; 92dca
- ld hl, wReel1Slot0a - wReel1
+ ld hl, wReel1ManipDelay - wReel1
add hl, bc
ld a, [hl]
and a
@@ -1173,8 +1279,8 @@
jr nc, .EggAgain
and a
jr nz, .EggAgain
- ld a, $5
- ld [wcf64], a
+ ld a, 5
+ ld [wSlotsDelay], a
call Slots_StopReel
ret
@@ -1181,18 +1287,18 @@
.EggAgain:
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $0
+ ld [hl], 0
ld hl, wReel1ReelAction - wReel1
add hl, bc
dec [hl]
- dec [hl]
- ld a, $1
- ld [wcf64], a
+ dec [hl] ; REEL_ACTION_WAIT_CHANSEY
+ ld a, 1
+ ld [wSlotsDelay], a
ret
; 92df7
-ReelAction_BoringReelDrops: ; 92df7
+ReelAction_Unused: ; 92df7
call Slots_CheckMatchedAllThreeReels
ret c
ld a, SFX_STOP_SLOT
@@ -1200,13 +1306,13 @@
call Slots_WaitSFX
ld hl, wReel1ReelAction - wReel1
add hl, bc
- inc [hl]
- call Function92fc0
- ld hl, wReel1Slot0a - wReel1
+ inc [hl] ; REEL_ACTION_CHECK_DROP_REEL
+ call Slots_GetNumberOfGolems
+ ld hl, wReel1ManipDelay - wReel1
add hl, bc
ld [hl], a
ReelAction_CheckDropReel: ; 92e10
- ld hl, wReel1Slot0a - wReel1
+ ld hl, wReel1ManipDelay - wReel1
add hl, bc
ld a, [hl]
and a
@@ -1219,13 +1325,13 @@
dec [hl]
ld hl, wReel1ReelAction - wReel1
add hl, bc
- inc [hl]
+ inc [hl] ; REEL_ACTION_WAIT_DROP_REEL
ld hl, wReel1Slot0b - wReel1
add hl, bc
- ld [hl], $20
+ ld [hl], 32
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $0
+ ld [hl], 0
ReelAction_WaitDropReel: ; 92e31
ld hl, wReel1Slot0b - wReel1
add hl, bc
@@ -1241,12 +1347,19 @@
dec [hl]
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $8 ; 2x
+ ld [hl], 8
ret
; 92e47
ReelAction_StartSlowAdvanceReel3: ; 92e47
+; Ensures SEVENs are lined up if there's bias to SEVEN.
+; Ensures nothing is lined up if there's no bias symbols.
+; No other bias symbols are compatible with this mode.
+
+; This is achieved by slowly advancing the reel a full round,
+; plus any necessary slot until the desired result is produced.
+
call Slots_CheckMatchedAllThreeReels
ret c
ld a, SFX_STOP_SLOT
@@ -1254,15 +1367,15 @@
call Slots_WaitSFX
ld hl, wReel1SpinRate - wReel1
add hl, bc
- ld [hl], $1
+ ld [hl], 1
ld hl, wReel1ReelAction - wReel1
add hl, bc
- inc [hl]
- ld hl, wReel1Slot0a - wReel1
+ inc [hl] ; REEL_ACTION_WAIT_SLOW_ADVANCE_REEL3
+ ld hl, wReel1ManipDelay - wReel1
add hl, bc
- ld [hl], $10
+ ld [hl], 16
ReelAction_WaitSlowAdvanceReel3: ; 92e64
- ld hl, wReel1Slot0a - wReel1
+ ld hl, wReel1ManipDelay - wReel1
add hl, bc
ld a, [hl]
and a
@@ -1396,11 +1509,11 @@
ld [wSlotBuildingMatch], a
and a
jr nz, .matching_sevens
- ld a, $1
+ ld a, 1
ld [wFirstTwoReelsMatchingSevens], a
.matching_sevens
- ld a, $1
+ ld a, 1
ld [wFirstTwoReelsMatching], a
ret
@@ -1407,7 +1520,7 @@
; 92f1d
Slots_CheckMatchedAllThreeReels: ; 92f1d
- ld a, $ff
+ ld a, SLOTS_NOMATCH
ld [wSlotMatched], a
call Slots_GetCurrentReelState
call Slots_CopyReelState
@@ -1427,7 +1540,7 @@
.return
ld a, [wSlotMatched]
- cp $ff
+ cp SLOTS_NOMATCH
jr nz, .matched_nontrivial
and a
ret
@@ -1542,7 +1655,7 @@
; 92fc0
-Function92fc0: ; 92fc0
+Slots_GetNumberOfGolems: ; 92fc0
ld hl, wReel1Position - wReel1
add hl, bc
ld a, [hl]
@@ -1629,7 +1742,7 @@
db $14, SLOTS_SQUIRTLE ; 5/128
db $28, SLOTS_PIKACHU ; 5/64
db $30, SLOTS_CHERRY ; 1/32
- db $ff, SLOTS_NOMATCH ; everything else
+ db $ff, SLOTS_NOBIAS ; everything else
; 93031
.Lucky: ; 93031
@@ -1639,7 +1752,7 @@
db $10, SLOTS_SQUIRTLE ; 1/32
db $1e, SLOTS_PIKACHU ; 7/128
db $50, SLOTS_CHERRY ; 25/128
- db $ff, SLOTS_NOMATCH ; everything else
+ db $ff, SLOTS_NOBIAS ; everything else
; 9303f
Slots_IlluminateBetLights: ; 9303f (24:703f)
@@ -1798,9 +1911,9 @@
text_jump UnknownText_0x1c5092
db "@"
-SlotGetPayout: ; 93124 (24:7124)
+Slots_GetPayout: ; 93124 (24:7124)
ld a, [wSlotMatched]
- cp -1
+ cp SLOTS_NOMATCH
jr z, .no_win
srl a
ld e, a
@@ -1831,9 +1944,9 @@
ld [hl], a
ret
-SlotPayoutText: ; 93158 (24:7158)
+Slots_PayoutText: ; 93158 (24:7158)
ld a, [wSlotMatched]
- cp -1
+ cp SLOTS_NOMATCH
jr nz, .MatchedSomething
ld hl, .Text_Darn
call PrintText
@@ -1912,21 +2025,26 @@
ld a, SFX_2ND_PLACE
call Slots_PlaySFX
call WaitSFX
- ld a, [wd002]
+
+; Oddly, the rarest mode (wKeepSevenBiasChance = 1) is the one with
+; the worse odds to favor seven symbol streaks (12.5% vs 25%).
+; it's possible that either the wKeepSevenBiasChance initialization
+; or this code was intended to lead to flipped percentages.
+ ld a, [wKeepSevenBiasChance]
and a
- jr nz, .asm_931ff
+ jr nz, .lowerSevenStreakOdds
call Random
- and $14
- ret z
- ld a, $ff
+ and %0010100
+ ret z ; 25% chance to stick with seven symbol bias
+ ld a, SLOTS_NOBIAS
ld [wSlotBias], a
ret
-.asm_931ff
+.lowerSevenStreakOdds
call Random
- and $1c
- ret z
- ld a, $ff
+ and %0011100
+ ret z ; 12.5% chance to stick with seven symbol bias
+ ld a, SLOTS_NOBIAS
ld [wSlotBias], a
ret
@@ -1948,7 +2066,7 @@
; 9321d
-SlotMachine_AnimateGolem: ; 9321d (24:721d)
+Slots_AnimateGolem: ; 9321d (24:721d)
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
add hl, bc
ld e, [hl]
@@ -1974,8 +2092,8 @@
ld a, [hl]
and a
jr nz, .retain
- ld a, $2
- ld [wcf64], a
+ ld a, 2
+ ld [wSlotsDelay], a
ld hl, SPRITEANIMSTRUCT_INDEX
add hl, bc
ld [hl], $0
@@ -2016,8 +2134,8 @@
ld hl, SPRITEANIMSTRUCT_0D
add hl, bc
ld [hl], $2
- ld a, $1
- ld [wcf64], a
+ ld a, 1
+ ld [wSlotsDelay], a
ld a, SFX_PLACE_PUZZLE_PIECE_DOWN
call Slots_PlaySFX
ret
@@ -2086,11 +2204,11 @@
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
add hl, bc
inc [hl]
- ld a, $1
- ld [wcf64], a
+ ld a, 1
+ ld [wSlotsDelay], a
.one ; 932e0 (24:72e0)
- ld a, [wcf64]
+ ld a, [wSlotsDelay]
cp $2
jr z, .retain
cp $5
--- a/engine/sprite_anims.asm
+++ b/engine/sprite_anims.asm
@@ -357,7 +357,7 @@
ret
.SlotsGolem: ; 8d422 (23:5422)
- callfar SlotMachine_AnimateGolem
+ callfar Slots_AnimateGolem
ret
.SlotsChansey: ; 8d429 (23:5429)
--- a/engine/sprites.asm
+++ b/engine/sprites.asm
@@ -386,7 +386,7 @@
GetSpriteAnimVTile: ; 8d109
; a = wSpriteAnimDict[a] if a in wSpriteAnimDict else 0
-; VTiles offset
+; vTiles offset
push hl
push bc
ld hl, wSpriteAnimDict
@@ -631,7 +631,7 @@
ld de, SGBEndOfExpBarGFX
.load
- ld hl, VTiles0 tile $00
+ ld hl, vTiles0 tile $00
lb bc, BANK(EndOfExpBarGFX), 1
call Request2bpp
ld c, 8
--- a/engine/start_menu.asm
+++ b/engine/start_menu.asm
@@ -7,7 +7,7 @@
farcall ReanchorBGMap_NoOAMUpdate
- ld hl, StatusFlags2
+ ld hl, wStatusFlags2
bit 2, [hl] ; bug catching contest
ld hl, .MenuDataHeader
jr z, .GotMenuData
@@ -284,7 +284,7 @@
ld [wWhichIndexSet], a
call .FillMenuList
- ld hl, StatusFlags
+ ld hl, wStatusFlags
bit 0, [hl]
jr z, .no_pokedex
ld a, 0 ; pokedex
@@ -301,7 +301,7 @@
ld a, [wLinkMode]
and a
jr nz, .no_pack
- ld hl, StatusFlags2
+ ld hl, wStatusFlags2
bit 2, [hl] ; bug catching contest
jr nz, .no_pack
ld a, 2 ; pack
@@ -321,7 +321,7 @@
ld a, [wLinkMode]
and a
jr nz, .no_save
- ld hl, StatusFlags2
+ ld hl, wStatusFlags2
bit 2, [hl] ; bug catching contest
ld a, 8 ; quit
jr nz, .write
@@ -390,7 +390,7 @@
; 128d1
.DrawBugContestStatusBox: ; 128d1
- ld hl, StatusFlags2
+ ld hl, wStatusFlags2
bit 2, [hl] ; bug catching contest
ret z
farcall StartMenu_DrawBugContestStatusBox
@@ -398,7 +398,7 @@
; 128de
.DrawBugContestStatus: ; 128de
- ld hl, StatusFlags2
+ ld hl, wStatusFlags2
bit 2, [hl] ; bug catching contest
jr nz, .contest
ret
--- a/engine/stats_screen.asm
+++ b/engine/stats_screen.asm
@@ -865,7 +865,7 @@
call IsAPokemon
ret c
call StatsScreen_LoadTextBoxSpaceGFX
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
predef GetAnimatedFrontpicPredef
hlcoord 0, 0
ld d, $0
@@ -954,7 +954,7 @@
ld [rVBK], a
ld de, TextBoxSpaceGFX
lb bc, BANK(TextBoxSpaceGFX), 1
- ld hl, VTiles2 tile $7f
+ ld hl, vTiles2 tile $7f
call Get2bpp
pop af
ld [rVBK], a
@@ -1071,7 +1071,7 @@
ld a, $1
ld [wBoxAlignment], a
call StatsScreen_LoadTextBoxSpaceGFX
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
predef GetAnimatedFrontpicPredef
pop de
hlcoord 0, 0
--- a/engine/time.asm
+++ b/engine/time.asm
@@ -101,7 +101,7 @@
call CheckDayDependentEventHL
ret nc
xor a
- ld hl, DailyFlags
+ ld hl, wDailyFlags
ld [hli], a
ld [hli], a
ld [hli], a
@@ -226,7 +226,7 @@
; 1151c
; XXX
- ld hl, DailyFlags
+ ld hl, wDailyFlags
set 2, [hl]
ret
; 11522
@@ -233,7 +233,7 @@
; XXX
and a
- ld hl, DailyFlags
+ ld hl, wDailyFlags
bit 2, [hl]
ret nz
scf
--- a/engine/timeofdaypals.asm
+++ b/engine/timeofdaypals.asm
@@ -215,7 +215,7 @@
ret
.DarkCave:
- ld a, [StatusFlags]
+ ld a, [wStatusFlags]
bit 2, a ; Flash
jr nz, .UsedFlash
ld a, %11111111 ; 3, 3, 3, 3
--- a/engine/timeset.asm
+++ b/engine/timeset.asm
@@ -24,15 +24,15 @@
ld [hBGMapMode], a
call LoadStandardFont
ld de, TimeSetBackgroundGFX
- ld hl, VTiles2 tile $00
+ ld hl, vTiles2 tile $00
lb bc, BANK(TimeSetBackgroundGFX), 1
call Request1bpp
ld de, TimeSetUpArrowGFX
- ld hl, VTiles2 tile $01
+ ld hl, vTiles2 tile $01
lb bc, BANK(TimeSetUpArrowGFX), 1
call Request1bpp
ld de, TimeSetDownArrowGFX
- ld hl, VTiles2 tile $02
+ ld hl, vTiles2 tile $02
lb bc, BANK(TimeSetDownArrowGFX), 1
call Request1bpp
call .ClearScreen
@@ -410,11 +410,11 @@
ld a, $1
ld [hInMenu], a
ld de, TimeSetUpArrowGFX
- ld hl, VTiles1 tile $6f
+ ld hl, vTiles1 tile $6f
lb bc, BANK(TimeSetUpArrowGFX), 1
call Request1bpp
ld de, TimeSetDownArrowGFX
- ld hl, VTiles1 tile $75
+ ld hl, vTiles1 tile $75
lb bc, BANK(TimeSetDownArrowGFX), 1
call Request1bpp
xor a
--- a/engine/title.asm
+++ b/engine/title.asm
@@ -26,7 +26,7 @@
; Decompress running Suicune gfx
ld hl, TitleSuicuneGFX
- ld de, VTiles1
+ ld de, vTiles1
call Decompress
@@ -42,7 +42,7 @@
; BG Map 1:
; line 0 (copyright)
- hlbgcoord 0, 0, VBGMap1
+ hlbgcoord 0, 0, vBGMap1
ld bc, 1 bgrows
ld a, 7 ; palette
call ByteFill
@@ -99,12 +99,12 @@
; Decompress logo
ld hl, TitleLogoGFX
- ld de, VTiles1
+ ld de, vTiles1
call Decompress
; Decompress background crystal
ld hl, TitleCrystalGFX
- ld de, VTiles0
+ ld de, vTiles0
call Decompress
@@ -122,7 +122,7 @@
call DrawTitleGraphic
; Draw copyright text
- hlbgcoord 3, 0, VBGMap1
+ hlbgcoord 3, 0, vBGMap1
lb bc, 1, 13
ld d, $c
ld e, $10
@@ -260,10 +260,10 @@
; 10eece
.Frames: ; 10eece
- db $80 ; VTiles4 tile $00
- db $88 ; VTiles4 tile $08
- db $00 ; VTiles5 tile $00
- db $08 ; VTiles5 tile $08
+ db $80 ; vTiles4 tile $00
+ db $88 ; vTiles4 tile $08
+ db $00 ; vTiles5 tile $00
+ db $08 ; vTiles5 tile $08
; 10eed2
--- a/engine/trade_animation.asm
+++ b/engine/trade_animation.asm
@@ -149,8 +149,8 @@
jr z, .NotCGB
ld a, $1
ld [rVBK], a
- ld hl, VTiles0
- ld bc, sScratch - VTiles0
+ ld hl, vTiles0
+ ld bc, sScratch - vTiles0
xor a
call ByteFill
ld a, $0
@@ -158,19 +158,19 @@
.NotCGB:
hlbgcoord 0, 0
- ld bc, sScratch - VBGMap0
+ ld bc, sScratch - vBGMap0
ld a, " "
call ByteFill
ld hl, TradeGameBoyLZ
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
call Decompress
ld hl, TradeArrowGFX
- ld de, VTiles1 tile $6d
+ ld de, vTiles1 tile $6d
ld bc, $10
ld a, BANK(TradeArrowGFX)
call FarCopyBytes
ld hl, TradeArrowGFX + $10
- ld de, VTiles1 tile $6e
+ ld de, vTiles1 tile $6e
ld bc, $10
ld a, BANK(TradeArrowGFX)
call FarCopyBytes
@@ -186,11 +186,11 @@
call LoadTradeBallAndCableGFX
ld a, [wPlayerTrademonSpecies]
ld hl, wPlayerTrademonDVs
- ld de, VTiles0
+ ld de, vTiles0
call TradeAnim_GetFrontpic
ld a, [wOTTrademonSpecies]
ld hl, wOTTrademonDVs
- ld de, VTiles0 tile $31
+ ld de, vTiles0 tile $31
call TradeAnim_GetFrontpic
ld a, [wPlayerTrademonSpecies]
ld de, wPlayerTrademonSpeciesName
@@ -490,7 +490,7 @@
call DisableLCD
callfar ClearSpriteAnims
hlbgcoord 0, 0
- ld bc, sScratch - VBGMap0
+ ld bc, sScratch - vBGMap0
ld a, " "
call ByteFill
xor a
@@ -627,7 +627,7 @@
push af
call ClearBGPalettes
call WaitTop
- ld a, HIGH(VBGMap1)
+ ld a, HIGH(vBGMap1)
ld [hBGMapAddress + 1], a
call ClearTileMap
hlcoord 0, 0
@@ -657,7 +657,7 @@
call ByteFill
call WaitBGMap
call WaitTop
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
ld [hBGMapAddress + 1], a
call ClearTileMap
ret
@@ -776,7 +776,7 @@
TradeAnim_ScrollOutRight: ; 293ea
call WaitTop
- ld a, HIGH(VBGMap1)
+ ld a, HIGH(vBGMap1)
ld [hBGMapAddress + 1], a
call WaitBGMap
ld a, $7
@@ -785,7 +785,7 @@
ld [hWY], a
call DelayFrame
call WaitTop
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
ld [hBGMapAddress + 1], a
call ClearTileMap
call TradeAnim_IncrementJumptableIndex
@@ -802,7 +802,7 @@
ret
.done
- ld a, HIGH(VBGMap1)
+ ld a, HIGH(vBGMap1)
ld [hBGMapAddress + 1], a
call WaitBGMap
ld a, $7
@@ -809,7 +809,7 @@
ld [hWX], a
ld a, $90
ld [hWY], a
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
ld [hBGMapAddress + 1], a
call TradeAnim_AdvanceScriptPointer
ret
@@ -895,14 +895,14 @@
; 294bb
TradeAnim_ShowGivemonFrontpic: ; 294bb
- ld de, VTiles0
+ ld de, vTiles0
jr TradeAnim_ShowFrontpic
TradeAnim_ShowGetmonFrontpic: ; 294c0
- ld de, VTiles0 tile $31
+ ld de, vTiles0 tile $31
TradeAnim_ShowFrontpic: ; 294c3
call DelayFrame
- ld hl, VTiles2
+ ld hl, vTiles2
lb bc, 10, $31
call Request2bpp
call WaitTop
@@ -1009,7 +1009,7 @@
TrademonStats_MonTemplate: ; 29573
call WaitTop
call TradeAnim_BlankTileMap
- ld a, HIGH(VBGMap1)
+ ld a, HIGH(vBGMap1)
ld [hBGMapAddress + 1], a
hlcoord 3, 0
ld b, $6
@@ -1032,7 +1032,7 @@
TrademonStats_Egg: ; 295a1
call WaitTop
call TradeAnim_BlankTileMap
- ld a, HIGH(VBGMap1)
+ ld a, HIGH(vBGMap1)
ld [hBGMapAddress + 1], a
hlcoord 3, 0
ld b, 6
@@ -1055,7 +1055,7 @@
TrademonStats_WaitBGMap: ; 295d8
call WaitBGMap
call WaitTop
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
ld [hBGMapAddress + 1], a
ret
@@ -1499,15 +1499,15 @@
LoadTradeBallAndCableGFX: ; 2982b
call DelayFrame
ld de, TradeBallGFX
- ld hl, VTiles0 tile $62
+ ld hl, vTiles0 tile $62
lb bc, BANK(TradeBallGFX), $6
call Request2bpp
ld de, TradePoofGFX
- ld hl, VTiles0 tile $68
+ ld hl, vTiles0 tile $68
lb bc, BANK(TradePoofGFX), $c
call Request2bpp
ld de, TradeCableGFX
- ld hl, VTiles0 tile $74
+ ld hl, vTiles0 tile $74
lb bc, BANK(TradeCableGFX), $4
call Request2bpp
xor a
@@ -1523,7 +1523,7 @@
ld e, $3
callfar LoadMenuMonIcon
ld de, TradeBubbleGFX
- ld hl, VTiles0 tile $72
+ ld hl, vTiles0 tile $72
lb bc, BANK(TradeBubbleGFX), $4
call Request2bpp
xor a
--- a/engine/trainer_card.asm
+++ b/engine/trainer_card.asm
@@ -37,13 +37,13 @@
farcall GetCardPic
ld hl, CardRightCornerGFX
- ld de, VTiles2 tile $1c
+ ld de, vTiles2 tile $1c
ld bc, 1 tiles
ld a, BANK(CardRightCornerGFX)
call FarCopyBytes
ld hl, CardStatusGFX
- ld de, VTiles2 tile $29
+ ld de, vTiles2 tile $29
ld bc, 86 tiles
ld a, BANK(CardStatusGFX)
call FarCopyBytes
@@ -98,7 +98,7 @@
call TrainerCard_InitBorder
call WaitBGMap
ld de, CardStatusGFX
- ld hl, VTiles2 tile $29
+ ld hl, vTiles2 tile $29
lb bc, BANK(CardStatusGFX), 86
call Request2bpp
call TrainerCard_Page1_PrintDexCaught_GameTime
@@ -120,7 +120,7 @@
.KantoCheck:
; unreferenced
- ld a, [KantoBadges]
+ ld a, [wKantoBadges]
and a
ret z
ld a, $4
@@ -136,11 +136,11 @@
call TrainerCard_InitBorder
call WaitBGMap
ld de, LeaderGFX
- ld hl, VTiles2 tile $29
+ ld hl, vTiles2 tile $29
lb bc, BANK(LeaderGFX), $56
call Request2bpp
ld de, BadgeGFX
- ld hl, VTiles0 tile $00
+ ld hl, vTiles0 tile $00
lb bc, BANK(BadgeGFX), $2c
call Request2bpp
call TrainerCard_Page2_3_InitObjectsAndStrings
@@ -166,7 +166,7 @@
.KantoCheck:
; unreferenced
- ld a, [KantoBadges]
+ ld a, [wKantoBadges]
and a
ret z
ld a, $4
@@ -185,11 +185,11 @@
call TrainerCard_InitBorder
call WaitBGMap
ld de, LeaderGFX2
- ld hl, VTiles2 tile $29
+ ld hl, vTiles2 tile $29
lb bc, BANK(LeaderGFX2), $56
call Request2bpp
ld de, BadgeGFX2
- ld hl, VTiles0 tile $00
+ ld hl, vTiles0 tile $00
lb bc, BANK(BadgeGFX2), $2c
call Request2bpp
call TrainerCard_Page2_3_InitObjectsAndStrings
@@ -281,7 +281,7 @@
hlcoord 2, 8
ld de, .StatusTilemap
call TrainerCardSetup_PlaceTilemapString
- ld a, [StatusFlags] ; pokedex
+ ld a, [wStatusFlags]
bit 0, a
ret nz
hlcoord 1, 9
@@ -562,7 +562,7 @@
; cycle 1: face tile, in1 tile, in2 tile, in3 tile
; cycle 2: face tile, in1 tile, in2 tile, in3 tile
- dw JohtoBadges
+ dw wJohtoBadges
; Zephyrbadge
db $68, $18, 0
--- a/engine/unown_puzzle.asm
+++ b/engine/unown_puzzle.asm
@@ -19,11 +19,11 @@
xor a
call ByteFill
ld hl, UnownPuzzleCursorGFX
- ld de, VTiles1 tile $60
+ ld de, vTiles1 tile $60
ld bc, 4 tiles
call CopyBytes
ld hl, UnownPuzzleStartCancelLZ
- ld de, VTiles1 tile $6d
+ ld de, vTiles1 tile $6d
call Decompress
call LoadUnownPuzzlePiecesGFX
hlcoord 0, 0
@@ -114,13 +114,13 @@
; e126d
.PuzzlePieceInitialPositions: ; e126d
-initpuzcoord: macro
+initpuzcoord: MACRO
rept _NARG / 2
db \1 puzcoord \2
shift
shift
endr
-endm
+ENDM
initpuzcoord 0,0, 0,1, 0,2, 0,3, 0,4, 0,5
initpuzcoord 1,0, 1,5
initpuzcoord 2,0, 2,5
@@ -599,11 +599,11 @@
UnownPuzzleCoordData: ; e1559
-puzzle_coords: macro
+puzzle_coords: MACRO
dbpixel \1, \2, \3, \4
dwcoord \5, \6
db \7, \8
-endm
+ENDM
; OAM coords, tilemap coords, vacant tile, filler
puzzle_coords 3, 3, 4, 4, 1, 0, PUZZLE_BORDER, 0
puzzle_coords 6, 3, 4, 4, 4, 0, PUZZLE_BORDER, 0
@@ -648,8 +648,8 @@
puzzle_coords 18, 18, 4, 4, 16, 15, PUZZLE_BORDER, 0
ConvertLoadedPuzzlePieces: ; e1631
- ld hl, VTiles2
- ld de, VTiles0
+ ld hl, vTiles2
+ ld de, vTiles0
ld b, 6
.loop
push bc
@@ -821,14 +821,14 @@
; e1703
GFXHeaders: ; e1703
- dw .TileBordersGFX + 0 tiles, VTiles0 tile $00
- dw .TileBordersGFX + 1 tiles, VTiles0 tile $01
- dw .TileBordersGFX + 2 tiles, VTiles0 tile $02
- dw .TileBordersGFX + 3 tiles, VTiles0 tile $0c
- dw .TileBordersGFX + 4 tiles, VTiles0 tile $0e
- dw .TileBordersGFX + 5 tiles, VTiles0 tile $18
- dw .TileBordersGFX + 6 tiles, VTiles0 tile $19
- dw .TileBordersGFX + 7 tiles, VTiles0 tile $1a
+ dw .TileBordersGFX + 0 tiles, vTiles0 tile $00
+ dw .TileBordersGFX + 1 tiles, vTiles0 tile $01
+ dw .TileBordersGFX + 2 tiles, vTiles0 tile $02
+ dw .TileBordersGFX + 3 tiles, vTiles0 tile $0c
+ dw .TileBordersGFX + 4 tiles, vTiles0 tile $0e
+ dw .TileBordersGFX + 5 tiles, vTiles0 tile $18
+ dw .TileBordersGFX + 6 tiles, vTiles0 tile $19
+ dw .TileBordersGFX + 7 tiles, vTiles0 tile $1a
; e1723
.TileBordersGFX: ; e1723
@@ -845,7 +845,7 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld de, VTiles2
+ ld de, vTiles2
call Decompress
call ConvertLoadedPuzzlePieces
ret
--- a/engine/unused_title.asm
+++ b/engine/unused_title.asm
@@ -16,18 +16,18 @@
ld [hl], a ; wTitleScreenTimer + 1
ld hl, UnusedTitleBG_GFX
- ld de, VTiles2
- ld bc, VBGMap0 - VTiles2
+ ld de, vTiles2
+ ld bc, vBGMap0 - vTiles2
call CopyBytes
ld hl, UnusedTitleBG_GFX + $80 tiles
- ld de, VTiles1
- ld bc, VTiles2 - VTiles1
+ ld de, vTiles1
+ ld bc, vTiles2 - vTiles1
call CopyBytes
ld hl, UnusedTitleFG_GFX
- ld de, VTiles0
- ld bc, VTiles1 - VTiles0
+ ld de, vTiles0
+ ld bc, vTiles1 - vTiles0
call CopyBytes
ld hl, UnusedTitleBG_Tilemap
--- a/engine/warp_connection.asm
+++ b/engine/warp_connection.asm
@@ -233,9 +233,9 @@
ret
.ClearBGMap: ; 104770 (41:4770)
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
ld [wBGMapAnchor + 1], a
- xor a ; LOW(VBGMap0)
+ xor a ; LOW(vBGMap0)
ld [wBGMapAnchor], a
ld [hSCY], a
ld [hSCX], a
@@ -247,7 +247,7 @@
ld [rVBK], a
xor a
- ld bc, VBGMap1 - VBGMap0
+ ld bc, vBGMap1 - vBGMap0
hlbgcoord 0, 0
call ByteFill
@@ -255,7 +255,7 @@
ld [rVBK], a
ld a, "<BLACK>"
- ld bc, VBGMap1 - VBGMap0
+ ld bc, vBGMap1 - vBGMap0
hlbgcoord 0, 0
call ByteFill
ret
--- a/engine/wildmons.asm
+++ b/engine/wildmons.asm
@@ -336,7 +336,7 @@
cp UNOWN
jr nz, .done
- ld a, [UnlockedUnowns]
+ ld a, [wUnlockedUnowns]
and a
jr z, .nowildbattle
@@ -428,7 +428,7 @@
_SwarmWildmonCheck
call CopyCurrMapDE
push hl
- ld hl, SwarmFlags
+ ld hl, wSwarmFlags
bit 2, [hl]
pop hl
jr z, .CheckYanma
@@ -445,7 +445,7 @@
.CheckYanma:
push hl
- ld hl, SwarmFlags
+ ld hl, wSwarmFlags
bit 3, [hl]
pop hl
jr z, _NoSwarmWildmon
--- a/gfx/font.asm
+++ b/gfx/font.asm
@@ -104,7 +104,7 @@
_LoadStandardFont:: ; fb449
ld de, Font
- ld hl, VTiles1
+ ld hl, vTiles1
lb bc, BANK(Font), $80
ld a, [rLCDC]
bit 7, a
@@ -111,19 +111,19 @@
jp z, Copy1bpp
ld de, Font
- ld hl, VTiles1
+ ld hl, vTiles1
lb bc, BANK(Font), $20
call Get1bpp_2
ld de, Font + $20 * LEN_1BPP_TILE
- ld hl, VTiles1 tile $20
+ ld hl, vTiles1 tile $20
lb bc, BANK(Font), $20
call Get1bpp_2
ld de, Font + $40 * LEN_1BPP_TILE
- ld hl, VTiles1 tile $40
+ ld hl, vTiles1 tile $40
lb bc, BANK(Font), $20
call Get1bpp_2
ld de, Font + $60 * LEN_1BPP_TILE
- ld hl, VTiles1 tile $60
+ ld hl, vTiles1 tile $60
lb bc, BANK(Font), $20
call Get1bpp_2
ret
@@ -131,15 +131,15 @@
_LoadFontsExtra1:: ; fb48a
ld de, MobilePhoneTilesGFX
- ld hl, VTiles2 tile "<BLACK>" ; $60
+ ld hl, vTiles2 tile "<BLACK>" ; $60
lb bc, BANK(MobilePhoneTilesGFX), 1
call Get1bpp_2
ld de, OverworldPhoneIconGFX
- ld hl, VTiles2 tile "<PHONE>" ; $62
+ ld hl, vTiles2 tile "<PHONE>" ; $62
lb bc, BANK(OverworldPhoneIconGFX), 1
call Get2bpp_2
ld de, FontExtra + 3 * LEN_2BPP_TILE
- ld hl, VTiles2 tile $63
+ ld hl, vTiles2 tile $63
lb bc, BANK(FontExtra), $16
call Get2bpp_2
jr LoadFrame
@@ -147,7 +147,7 @@
_LoadFontsExtra2:: ; fb4b0
ld de, FontsExtra2_UpArrowGFX
- ld hl, VTiles2 tile "▲" ; $61
+ ld hl, vTiles2 tile "▲" ; $61
ld b, BANK(FontsExtra2_UpArrowGFX)
ld c, 1
call Get2bpp_2
@@ -156,7 +156,7 @@
_LoadFontsBattleExtra:: ; fb4be
ld de, FontBattleExtra
- ld hl, VTiles2 tile $60
+ ld hl, vTiles2 tile $60
lb bc, BANK(FontBattleExtra), $19
call Get2bpp_2
jr LoadFrame
@@ -170,10 +170,10 @@
call AddNTimes
ld d, h
ld e, l
- ld hl, VTiles2 tile "┌" ; $79
+ ld hl, vTiles2 tile "┌" ; $79
lb bc, BANK(Frames), 6
call Get1bpp_2
- ld hl, VTiles2 tile " " ; $7f
+ ld hl, vTiles2 tile " " ; $7f
ld de, TextBoxSpaceGFX
lb bc, BANK(TextBoxSpaceGFX), 1
call Get1bpp_2
@@ -182,10 +182,10 @@
LoadBattleFontsHPBar: ; fb4f2
ld de, FontBattleExtra
- ld hl, VTiles2 tile $60
+ ld hl, vTiles2 tile $60
lb bc, BANK(FontBattleExtra), $c
call Get2bpp_2
- ld hl, VTiles2 tile $70
+ ld hl, vTiles2 tile $70
ld de, FontBattleExtra tile $10
lb bc, BANK(FontBattleExtra), 3
call Get2bpp_2
@@ -193,19 +193,19 @@
LoadHPBar: ; fb50d
ld de, EnemyHPBarBorderGFX
- ld hl, VTiles2 tile $6c
+ ld hl, vTiles2 tile $6c
lb bc, BANK(EnemyHPBarBorderGFX), 4
call Get1bpp_2
ld de, HPExpBarBorderGFX
- ld hl, VTiles2 tile $73
+ ld hl, vTiles2 tile $73
lb bc, BANK(HPExpBarBorderGFX), 6
call Get1bpp_2
ld de, ExpBarGFX
- ld hl, VTiles2 tile $55
+ ld hl, vTiles2 tile $55
lb bc, BANK(ExpBarGFX), 9
call Get2bpp_2
ld de, MobilePhoneTilesGFX + 9 * LEN_2BPP_TILE
- ld hl, VTiles2 tile $5e
+ ld hl, vTiles2 tile $5e
lb bc, BANK(MobilePhoneTilesGFX), 2
call Get2bpp_2
ret
@@ -214,24 +214,24 @@
StatsScreen_LoadFont: ; fb53e
call _LoadFontsBattleExtra
ld de, EnemyHPBarBorderGFX
- ld hl, VTiles2 tile $6c
+ ld hl, vTiles2 tile $6c
lb bc, BANK(EnemyHPBarBorderGFX), 4
call Get1bpp_2
ld de, HPExpBarBorderGFX
- ld hl, VTiles2 tile $78
+ ld hl, vTiles2 tile $78
lb bc, BANK(HPExpBarBorderGFX), 1
call Get1bpp_2
ld de, HPExpBarBorderGFX + 3 * LEN_1BPP_TILE
- ld hl, VTiles2 tile $76
+ ld hl, vTiles2 tile $76
lb bc, BANK(HPExpBarBorderGFX), 2
call Get1bpp_2
ld de, ExpBarGFX
- ld hl, VTiles2 tile $55
+ ld hl, vTiles2 tile $55
lb bc, BANK(ExpBarGFX), 8
call Get2bpp_2
LoadStatsScreenPageTilesGFX: ; fb571
ld de, StatsScreenPageTilesGFX
- ld hl, VTiles2 tile $31
+ ld hl, vTiles2 tile $31
lb bc, BANK(StatsScreenPageTilesGFX), $11
call Get2bpp_2
ret
--- a/gfx/load_pics.asm
+++ b/gfx/load_pics.asm
@@ -132,7 +132,7 @@
ret
GetAnimatedFrontpic: ; 51103
- ld a, BANK(VTiles3)
+ ld a, BANK(vTiles3)
ld [rVBK], a
push hl
ld de, wDecompressScratch
--- a/gfx/overworld_font.asm
+++ b/gfx/overworld_font.asm
@@ -1,10 +1,10 @@
LoadOverworldFont:: ; 106594
ld de, .font
- ld hl, VTiles1
+ ld hl, vTiles1
lb bc, BANK(.font), $80
call Get2bpp
ld de, .space
- ld hl, VTiles2 tile $7f
+ ld hl, vTiles2 tile $7f
lb bc, BANK(.space), 1
call Get2bpp
ret
--- a/home.asm
+++ b/home.asm
@@ -574,11 +574,11 @@
jr c, .wait
di
- ld a, BANK(VTiles3)
+ ld a, BANK(vTiles3)
ld [rVBK], a
hlcoord 0, 0, AttrMap
call .StackPointerMagic
- ld a, BANK(VTiles0)
+ ld a, BANK(vTiles0)
ld [rVBK], a
hlcoord 0, 0
call .StackPointerMagic
@@ -597,7 +597,7 @@
; 327b
.StackPointerMagic: ; 327b
-; Copy all tiles to VBGMap
+; Copy all tiles to vBGMap
ld [hSPBuffer], sp
ld sp, hl
ld a, [hBGMapAddress + 1]
@@ -1074,7 +1074,7 @@
jr c, .not_pokemon
push hl
- ld de, VTiles2
+ ld de, vTiles2
predef GetMonFrontpic
pop hl
xor a
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -461,7 +461,7 @@
cp PLAYER_SURF_PIKA
jr z, .surf
- ld a, [StatusFlags2]
+ ld a, [wStatusFlags2]
bit 2, a
jr nz, .contest
--- a/home/flag.asm
+++ b/home/flag.asm
@@ -7,7 +7,7 @@
ResetBikeFlags:: ; 2e56
xor a
- ld hl, BikeFlags
+ ld hl, wBikeFlags
ld [hli], a
ld [hl], a
ret
@@ -22,7 +22,7 @@
ret
.asm_2e69
- ld hl, StatusFlags
+ ld hl, wStatusFlags
res 2, [hl]
ret
; 2e6f
--- a/home/game_time.asm
+++ b/home/game_time.asm
@@ -38,7 +38,7 @@
ret nz
; Is the timer paused?
- ld hl, GameTimerPause
+ ld hl, wGameTimerPause
bit 0, [hl]
ret z
--- a/home/init.asm
+++ b/home/init.asm
@@ -141,9 +141,9 @@
farcall InitCGBPals
- ld a, HIGH(VBGMap1)
+ ld a, HIGH(vBGMap1)
ld [hBGMapAddress + 1], a
- xor a ; LOW(VBGMap1)
+ xor a ; LOW(vBGMap1)
ld [hBGMapAddress], a
farcall StartClock
@@ -185,7 +185,7 @@
xor a
ld [rVBK], a
.clear
- ld hl, VTiles0
+ ld hl, vTiles0
ld bc, $2000
xor a
call ByteFill
--- a/home/map.asm
+++ b/home/map.asm
@@ -1241,10 +1241,10 @@
ld h, a
ld bc, $0200
add hl, bc
-; cap d at HIGH(VBGMap0)
+; cap d at HIGH(vBGMap0)
ld a, h
and %00000011
- or HIGH(VBGMap0)
+ or HIGH(vBGMap0)
ld e, l
ld d, a
call UpdateBGMapRow
@@ -1369,10 +1369,10 @@
ld e, a
jr nc, .skip
inc d
-; cap d at HIGH(VBGMap0)
+; cap d at HIGH(vBGMap0)
ld a, d
and $3
- or HIGH(VBGMap0)
+ or HIGH(vBGMap0)
ld d, a
.skip
@@ -1409,7 +1409,7 @@
call FarDecompress
ld hl, wDecompressScratch
- ld de, VTiles2
+ ld de, vTiles2
ld bc, $60 tiles
call CopyBytes
@@ -1419,7 +1419,7 @@
ld [rVBK], a
ld hl, wDecompressScratch + $60 tiles
- ld de, VTiles2
+ ld de, vTiles2
ld bc, $60 tiles
call CopyBytes
@@ -2305,7 +2305,7 @@
ret
.radiotower
- ld a, [StatusFlags2]
+ ld a, [wStatusFlags2]
bit 0, a
jr z, .clearedradiotower
ld de, MUSIC_ROCKET_OVERTURE
@@ -2320,7 +2320,7 @@
jr .done
.mahoganymart
- ld a, [StatusFlags2]
+ ld a, [wStatusFlags2]
bit 7, a
jr z, .clearedmahogany
ld de, MUSIC_ROCKET_HIDEOUT
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -43,7 +43,7 @@
db $40 ; tile backup
db 12, 0 ; start coords
db 17, 19 ; end coords
- dw VTiles0
+ dw vTiles0
db 0 ; default option
; 1d67
--- a/home/text.asm
+++ b/home/text.asm
@@ -200,7 +200,7 @@
jp PlaceNextChar
CheckDict:: ; 1087
-dict: macro
+dict: MACRO
if \1 == 0
and a
else
@@ -207,14 +207,14 @@
cp \1
endc
jp z, \2
-endm
+ENDM
-dict2: macro
+dict2: MACRO
cp \1
jr nz, ._\@
ld a, \2
._\@:
-endm
+ENDM
dict "<DAY>", Char15
dict "<LINE>", LineChar
@@ -309,11 +309,11 @@
; 1186
-print_name: macro
+print_name: MACRO
push de
ld de, \1
jp PlaceCommandCharacter
-endm
+ENDM
PrintMomsName: print_name MomsName ; 1186
PrintPlayerName: print_name PlayerName ; 118d
@@ -400,7 +400,7 @@
call PlaceString
ld h, b
ld l, c
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
ld de, String_kun
jr z, PlaceCommandCharacter
--- a/home/video.asm
+++ b/home/video.asm
@@ -143,9 +143,9 @@
ld h, a
push hl
- xor a ; LOW(VBGMap1)
+ xor a ; LOW(vBGMap1)
ld [hBGMapAddress], a
- ld a, HIGH(VBGMap1)
+ ld a, HIGH(vBGMap1)
ld [hBGMapAddress + 1], a
ld a, [hBGMapMode]
--- a/macros/base_stats.asm
+++ b/macros/base_stats.asm
@@ -1,10 +1,10 @@
; Used in data/pokemon/base_stats/*.asm
-define: macro
+define: MACRO
if !def(\1)
-\1 equs \2
+\1 EQUS \2
endc
-endm
+ENDM
const_value = 0
--- a/macros/code.asm
+++ b/macros/code.asm
@@ -2,11 +2,11 @@
lb: MACRO ; r, hi, lo
ld \1, (\2 & $ff) << 8 + (\3 & $ff)
- ENDM
+ENDM
ln: MACRO ; r, hi, lo
ld \1, (\2 & $f) << 4 + (\3 & $f)
- ENDM
+ENDM
ldpixel: MACRO
if _NARG >= 5
@@ -14,7 +14,7 @@
else
lb \1, \2 * 8, \3 * 8
endc
- ENDM
+ENDM
depixel EQUS "ldpixel de,"
bcpixel EQUS "ldpixel bc,"
@@ -33,12 +33,12 @@
ld h, [hl]
ld l, a
jp hl
- ENDM
+ENDM
; Many mobile functions were dummied out in localization.
mobile EQUS "ret"
-maskbits: macro
+maskbits: MACRO
; example usage in rejection sampling:
; .loop
; call Random
@@ -52,4 +52,4 @@
endc
endr
and x
- ENDM
+ENDM
--- a/macros/coords.asm
+++ b/macros/coords.asm
@@ -1,6 +1,6 @@
-bccoord equs "coord bc,"
-decoord equs "coord de,"
-hlcoord equs "coord hl,"
+bccoord EQUS "coord bc,"
+decoord EQUS "coord de,"
+hlcoord EQUS "coord hl,"
coord: MACRO
; register, x, y[, origin]
@@ -9,7 +9,7 @@
else
ld \1, \4 + SCREEN_WIDTH * (\3) + (\2)
endc
- ENDM
+ENDM
dwcoord: MACRO
rept _NARG / 2
@@ -17,7 +17,7 @@
shift
shift
endr
- ENDM
+ENDM
ldcoord_a: MACRO
if _NARG < 3
@@ -25,7 +25,7 @@
else
ld [\3 + SCREEN_WIDTH * (\2) + (\1)], a
endc
- ENDM
+ENDM
lda_coord: MACRO
if _NARG < 3
@@ -33,7 +33,7 @@
else
ld a, [\3 + SCREEN_WIDTH * (\2) + (\1)]
endc
- ENDM
+ENDM
bgrows EQUS "* $20" ; SCREEN_WIDTH
@@ -46,6 +46,6 @@
IF _NARG >= 4
ld \1, \3 bgrows + \2 + \4
ELSE
- ld \1, \3 bgrows + \2 + VBGMap0
+ ld \1, \3 bgrows + \2 + vBGMap0
ENDC
ENDM
--- a/macros/data.asm
+++ b/macros/data.asm
@@ -3,27 +3,27 @@
dwb: MACRO
dw \1
db \2
- ENDM
+ENDM
dbw: MACRO
db \1
dw \2
- ENDM
+ENDM
dbbw: MACRO
db \1, \2
dw \3
- ENDM
+ENDM
dbww: MACRO
db \1
dw \2, \3
- ENDM
+ENDM
dbwww: MACRO
db \1
dw \2, \3, \4
- ENDM
+ENDM
dn: MACRO ; nybbles
rept _NARG / 2
@@ -31,7 +31,7 @@
shift
shift
endr
- ENDM
+ENDM
dc: MACRO ; "crumbs"
rept _NARG / 4
@@ -41,7 +41,7 @@
shift
shift
endr
- ENDM
+ENDM
dx: MACRO
x = 8 * ((\1) - 1)
@@ -49,19 +49,19 @@
db ((\2) >> x) & $ff
x = x + -8
endr
- ENDM
+ENDM
dt: MACRO ; three-byte (big-endian)
dx 3, \1
- ENDM
+ENDM
dd: MACRO ; four-byte (big-endian)
dx 4, \1
- ENDM
+ENDM
bigdw: MACRO ; big-endian word
dx 2, \1
- ENDM
+ENDM
dba: MACRO ; dbw bank, address
rept _NARG
@@ -68,7 +68,7 @@
dbw BANK(\1), \1
shift
endr
- ENDM
+ENDM
dab: MACRO ; dwb address, bank
rept _NARG
@@ -75,7 +75,7 @@
dwb \1, BANK(\1)
shift
endr
- ENDM
+ENDM
dba_pic: MACRO ; dbw bank, address
db BANK(\1) - PICS_FIX
@@ -89,7 +89,7 @@
else
db \1 * 8, \2 * 8
endc
-endm
+ENDM
dsprite: MACRO
; conditional segment is there because not every instance of
@@ -99,7 +99,7 @@
else
db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, \6
endc
-endm
+ENDM
sine_wave: MACRO
--- a/macros/enum.asm
+++ b/macros/enum.asm
@@ -1,6 +1,6 @@
; Enumerate variables
-enum_start: macro
+enum_start: MACRO
if _NARG >= 1
__enum__ = \1
else
@@ -11,16 +11,16 @@
else
__enumdir__ = +1
endc
-endm
+ENDM
-enum: macro
+enum: MACRO
\1 = __enum__
__enum__ = __enum__ + __enumdir__
-endm
+ENDM
-enum_set: macro
+enum_set: MACRO
__enum__ = \1
-endm
+ENDM
; Enumerate constants
--- a/macros/rst.asm
+++ b/macros/rst.asm
@@ -6,13 +6,13 @@
ld a, BANK(\1)
ld hl, \1
rst FarCall
- ENDM
+ENDM
callfar: MACRO ; address, bank
ld hl, \1
ld a, BANK(\1)
rst FarCall
- ENDM
+ENDM
; legacy support for pre-2018 pokecrystal
callba EQUS "farcall"
@@ -26,4 +26,4 @@
call \1
pop af
rst Bankswitch
- ENDM
+ENDM
--- a/macros/scripts/audio.asm
+++ b/macros/scripts/audio.asm
@@ -1,72 +1,72 @@
-musicheader: macro
+musicheader: MACRO
; number of tracks, track idx, address
dbw ((\1 - 1) << 6) + (\2 - 1), \3
- endm
+ENDM
note: MACRO
dn (\1), (\2) - 1
- ENDM
+ENDM
-sound: macro
+sound: MACRO
note \1, \2
db \3 ; intensity
dw \4 ; frequency
- endm
+ENDM
-noise: macro
+noise: MACRO
note \1, \2 ; duration
db \3 ; intensity
db \4 ; frequency
- endm
+ENDM
; MusicCommands indexes (see audio/engine.asm)
enum_start $d8
enum notetype_cmd ; $d8
-octave: macro
+octave: MACRO
db notetype_cmd - (\1)
- endm
+ENDM
-notetype: macro
+notetype: MACRO
db notetype_cmd
db \1 ; note_length
if _NARG >= 2
db \2 ; intensity
endc
- endm
+ENDM
enum pitchoffset_cmd ; $d9
-pitchoffset: macro
+pitchoffset: MACRO
db pitchoffset_cmd
dn \1, \2 - 1 ; octave, key
- endm
+ENDM
enum tempo_cmd ; $da
-tempo: macro
+tempo: MACRO
db tempo_cmd
bigdw \1 ; tempo
- endm
+ENDM
enum dutycycle_cmd ; $db
-dutycycle: macro
+dutycycle: MACRO
db dutycycle_cmd
db \1 ; duty_cycle
- endm
+ENDM
enum intensity_cmd ; $dc
-intensity: macro
+intensity: MACRO
db intensity_cmd
db \1 ; intensity
- endm
+ENDM
enum soundinput_cmd ; $dd
-soundinput: macro
+soundinput: MACRO
db soundinput_cmd
db \1 ; input
- endm
+ENDM
enum sound_duty_cmd ; $de
-sound_duty: macro
+sound_duty: MACRO
db sound_duty_cmd
if _NARG == 4
db \1 | (\2 << 2) | (\3 << 4) | (\4 << 6) ; duty sequence
@@ -73,193 +73,193 @@
else
db \1 ; one-byte duty value for legacy support
endc
- endm
+ENDM
enum togglesfx_cmd ; $df
-togglesfx: macro
+togglesfx: MACRO
db togglesfx_cmd
- endm
+ENDM
enum slidepitchto_cmd ; $e0
-slidepitchto: macro
+slidepitchto: MACRO
db slidepitchto_cmd
db \1 - 1 ; duration
dn \2, \3 ; octave, pitch
- endm
+ENDM
enum vibrato_cmd ; $e1
-vibrato: macro
+vibrato: MACRO
db vibrato_cmd
db \1 ; delay
db \2 ; extent
- endm
+ENDM
enum unknownmusic0xe2_cmd ; $e2
-unknownmusic0xe2: macro
+unknownmusic0xe2: MACRO
db unknownmusic0xe2_cmd
db \1 ; unknown
- endm
+ENDM
enum togglenoise_cmd ; $e3
-togglenoise: macro
+togglenoise: MACRO
db togglenoise_cmd
db \1 ; id
- endm
+ENDM
enum panning_cmd ; $e4
-panning: macro
+panning: MACRO
db panning_cmd
db \1 ; tracks
- endm
+ENDM
enum volume_cmd ; $e5
-volume: macro
+volume: MACRO
db volume_cmd
db \1 ; volume
- endm
+ENDM
enum tone_cmd ; $e6
-tone: macro
+tone: MACRO
db tone_cmd
bigdw \1 ; tone
- endm
+ENDM
enum unknownmusic0xe7_cmd ; $e7
-unknownmusic0xe7: macro
+unknownmusic0xe7: MACRO
db unknownmusic0xe7_cmd
db \1 ; unknown
- endm
+ENDM
enum unknownmusic0xe8_cmd ; $e8
-unknownmusic0xe8: macro
+unknownmusic0xe8: MACRO
db unknownmusic0xe8_cmd
db \1 ; unknown
- endm
+ENDM
enum tempo_relative_cmd ; $e9
-tempo_relative: macro
+tempo_relative: MACRO
db tempo_relative_cmd
bigdw \1 ; value
- endm
+ENDM
enum restartchannel_cmd ; $ea
-restartchannel: macro
+restartchannel: MACRO
db restartchannel_cmd
dw \1 ; address
- endm
+ENDM
enum newsong_cmd ; $eb
-newsong: macro
+newsong: MACRO
db newsong_cmd
bigdw \1 ; id
- endm
+ENDM
enum sfxpriorityon_cmd ; $ec
-sfxpriorityon: macro
+sfxpriorityon: MACRO
db sfxpriorityon_cmd
- endm
+ENDM
enum sfxpriorityoff_cmd ; $ed
-sfxpriorityoff: macro
+sfxpriorityoff: MACRO
db sfxpriorityoff_cmd
- endm
+ENDM
enum unknownmusic0xee_cmd ; $ee
-unknownmusic0xee: macro
+unknownmusic0xee: MACRO
db unknownmusic0xee_cmd
dw \1 ; address
- endm
+ENDM
enum stereopanning_cmd ; $ef
-stereopanning: macro
+stereopanning: MACRO
db stereopanning_cmd
db \1 ; tracks
- endm
+ENDM
enum sfxtogglenoise_cmd ; $f0
-sfxtogglenoise: macro
+sfxtogglenoise: MACRO
db sfxtogglenoise_cmd
db \1 ; id
- endm
+ENDM
enum music0xf1_cmd ; $f1
-music0xf1: macro
+music0xf1: MACRO
db music0xf1_cmd
- endm
+ENDM
enum music0xf2_cmd ; $f2
-music0xf2: macro
+music0xf2: MACRO
db music0xf2_cmd
- endm
+ENDM
enum music0xf3_cmd ; $f3
-music0xf3: macro
+music0xf3: MACRO
db music0xf3_cmd
- endm
+ENDM
enum music0xf4_cmd ; $f4
-music0xf4: macro
+music0xf4: MACRO
db music0xf4_cmd
- endm
+ENDM
enum music0xf5_cmd ; $f5
-music0xf5: macro
+music0xf5: MACRO
db music0xf5_cmd
- endm
+ENDM
enum music0xf6_cmd ; $f6
-music0xf6: macro
+music0xf6: MACRO
db music0xf6_cmd
- endm
+ENDM
enum music0xf7_cmd ; $f7
-music0xf7: macro
+music0xf7: MACRO
db music0xf7_cmd
- endm
+ENDM
enum music0xf8_cmd ; $f8
-music0xf8: macro
+music0xf8: MACRO
db music0xf8_cmd
- endm
+ENDM
enum unknownmusic0xf9_cmd ; $f9
-unknownmusic0xf9: macro
+unknownmusic0xf9: MACRO
db unknownmusic0xf9_cmd
- endm
+ENDM
enum setcondition_cmd ; $fa
-setcondition: macro
+setcondition: MACRO
db setcondition_cmd
db \1 ; condition
- endm
+ENDM
enum jumpif_cmd ; $fb
-jumpif: macro
+jumpif: MACRO
db jumpif_cmd
db \1 ; condition
dw \2 ; address
- endm
+ENDM
enum jumpchannel_cmd ; $fc
-jumpchannel: macro
+jumpchannel: MACRO
db jumpchannel_cmd
dw \1 ; address
- endm
+ENDM
enum loopchannel_cmd ; $fd
-loopchannel: macro
+loopchannel: MACRO
db loopchannel_cmd
db \1 ; count
dw \2 ; address
- endm
+ENDM
enum callchannel_cmd ; $fe
-callchannel: macro
+callchannel: MACRO
db callchannel_cmd
dw \1 ; address
- endm
+ENDM
enum endchannel_cmd ; $ff
-endchannel: macro
+endchannel: MACRO
db endchannel_cmd
- endm
+ENDM
--- a/macros/scripts/battle_anims.asm
+++ b/macros/scripts/battle_anims.asm
@@ -1,54 +1,54 @@
-anim_wait: macro
+anim_wait: MACRO
if \1 >= $d0
flip out
endc
db \1
- endm
+ENDM
; BattleAnimCommands indexes (see engine/battle_anims/anim_commands.asm)
enum_start $d0
enum anim_obj_command ; $d0
-anim_obj: macro
+anim_obj: MACRO
db anim_obj_command
db \1 ; obj
db (\2 << 3) + \3 ; x
db (\4 << 3) + \5 ; y
db \6 ; param
- endm
+ENDM
enum anim_1gfx_command ; $d1
-anim_1gfx: macro
+anim_1gfx: MACRO
db anim_1gfx_command
db \1 ; gfx1
- endm
+ENDM
enum anim_2gfx_command ; $d2
-anim_2gfx: macro
+anim_2gfx: MACRO
db anim_2gfx_command
db \1 ; gfx1
db \2 ; gfx2
- endm
+ENDM
enum anim_3gfx_command ; $d3
-anim_3gfx: macro
+anim_3gfx: MACRO
db anim_3gfx_command
db \1 ; gfx1
db \2 ; gfx2
db \3 ; gfx3
- endm
+ENDM
enum anim_4gfx_command ; $d4
-anim_4gfx: macro
+anim_4gfx: MACRO
db anim_4gfx_command
db \1 ; gfx1
db \2 ; gfx2
db \3 ; gfx3
db \4 ; gfx4
- endm
+ENDM
enum anim_5gfx_command ; $d5
-anim_5gfx: macro
+anim_5gfx: MACRO
db anim_5gfx_command
db \1 ; gfx1
db \2 ; gfx2
@@ -55,240 +55,240 @@
db \3 ; gfx3
db \4 ; gfx4
db \5 ; gfx5
- endm
+ENDM
enum anim_incobj_command ; $d6
-anim_incobj: macro
+anim_incobj: MACRO
db anim_incobj_command
db \1 ; id
- endm
+ENDM
enum anim_setobj_command ; $d7
-anim_setobj: macro
+anim_setobj: MACRO
db anim_setobj_command
db \1 ; id
db \2 ; obj
- endm
+ENDM
enum anim_incbgeffect_command ; $d8
-anim_incbgeffect: macro
+anim_incbgeffect: MACRO
db anim_incbgeffect_command
db \1 ; effect
- endm
+ENDM
enum anim_enemyfeetobj_command ; $d9
-anim_enemyfeetobj: macro
+anim_enemyfeetobj: MACRO
db anim_enemyfeetobj_command
- endm
+ENDM
enum anim_playerheadobj_command ; $da
-anim_playerheadobj: macro
+anim_playerheadobj: MACRO
db anim_playerheadobj_command
- endm
+ENDM
enum anim_checkpokeball_command ; $db
-anim_checkpokeball: macro
+anim_checkpokeball: MACRO
db anim_checkpokeball_command
- endm
+ENDM
enum anim_transform_command ; $dc
-anim_transform: macro
+anim_transform: MACRO
db anim_transform_command
- endm
+ENDM
enum anim_raisesub_command ; $dd
-anim_raisesub: macro
+anim_raisesub: MACRO
db anim_raisesub_command
- endm
+ENDM
enum anim_dropsub_command ; $de
-anim_dropsub: macro
+anim_dropsub: MACRO
db anim_dropsub_command
- endm
+ENDM
enum anim_resetobp0_command ; $df
-anim_resetobp0: macro
+anim_resetobp0: MACRO
db anim_resetobp0_command
- endm
+ENDM
enum anim_sound_command ; $e0
-anim_sound: macro
+anim_sound: MACRO
db anim_sound_command
db (\1 << 2) | \2 ; duration, tracks
db \3 ; id
- endm
+ENDM
enum anim_cry_command ; $e1
-anim_cry: macro
+anim_cry: MACRO
db anim_cry_command
db \1 ; pitch
- endm
+ENDM
enum anim_minimizeopp_command ; $e2
-anim_minimizeopp: macro
+anim_minimizeopp: MACRO
db anim_minimizeopp_command
- endm
+ENDM
enum anim_oamon_command ; $e3
-anim_oamon: macro
+anim_oamon: MACRO
db anim_oamon_command
- endm
+ENDM
enum anim_oamoff_command ; $e4
-anim_oamoff: macro
+anim_oamoff: MACRO
db anim_oamoff_command
- endm
+ENDM
enum anim_clearobjs_command ; $e5
-anim_clearobjs: macro
+anim_clearobjs: MACRO
db anim_clearobjs_command
- endm
+ENDM
enum anim_beatup_command ; $e6
-anim_beatup: macro
+anim_beatup: MACRO
db anim_beatup_command
- endm
+ENDM
enum anim_0xe7_command ; $e7
-anim_0xe7: macro
+anim_0xe7: MACRO
db anim_0xe7_command
- endm
+ENDM
enum anim_updateactorpic_command ; $e8
-anim_updateactorpic: macro
+anim_updateactorpic: MACRO
db anim_updateactorpic_command
- endm
+ENDM
enum anim_minimize_command ; $e9
-anim_minimize: macro
+anim_minimize: MACRO
db anim_minimize_command
- endm
+ENDM
enum anim_0xea_command ; $ea
-anim_0xea: macro
+anim_0xea: MACRO
db anim_0xea_command
- endm
+ENDM
enum anim_0xeb_command ; $eb
-anim_0xeb: macro
+anim_0xeb: MACRO
db anim_0xeb_command
- endm
+ENDM
enum anim_0xec_command ; $ec
-anim_0xec: macro
+anim_0xec: MACRO
db anim_0xec_command
- endm
+ENDM
enum anim_0xed_command ; $ed
-anim_0xed: macro
+anim_0xed: MACRO
db anim_0xed_command
- endm
+ENDM
enum anim_if_param_and_command ; $ee
-anim_if_param_and: macro
+anim_if_param_and: MACRO
db anim_if_param_and_command
db \1 ; value
dw \2 ; address
- endm
+ENDM
enum anim_jumpuntil_command ; $ef
-anim_jumpuntil: macro
+anim_jumpuntil: MACRO
db anim_jumpuntil_command
dw \1 ; address
- endm
+ENDM
enum anim_bgeffect_command ; $f0
-anim_bgeffect: macro
+anim_bgeffect: MACRO
db anim_bgeffect_command
db \1 ; effect
db \2 ; unknown
db \3 ; unknown
db \4 ; unknown
- endm
+ENDM
enum anim_bgp_command ; $f1
-anim_bgp: macro
+anim_bgp: MACRO
db anim_bgp_command
db \1 ; colors
- endm
+ENDM
enum anim_obp0_command ; $f2
-anim_obp0: macro
+anim_obp0: MACRO
db anim_obp0_command
db \1 ; colors
- endm
+ENDM
enum anim_obp1_command ; $f3
-anim_obp1: macro
+anim_obp1: MACRO
db anim_obp1_command
db \1 ; colors
- endm
+ENDM
enum anim_clearsprites_command ; $f4
-anim_clearsprites: macro
+anim_clearsprites: MACRO
db anim_clearsprites_command
- endm
+ENDM
enum anim_0xf5_command ; $f5
-anim_0xf5: macro
+anim_0xf5: MACRO
db anim_0xf5_command
- endm
+ENDM
enum anim_0xf6_command ; $f6
-anim_0xf6: macro
+anim_0xf6: MACRO
db anim_0xf6_command
- endm
+ENDM
enum anim_0xf7_command ; $f7
-anim_0xf7: macro
+anim_0xf7: MACRO
db anim_0xf7_command
- endm
+ENDM
enum anim_if_param_equal_command ; $f8
-anim_if_param_equal: macro
+anim_if_param_equal: MACRO
db anim_if_param_equal_command
db \1 ; value
dw \2 ; address
- endm
+ENDM
enum anim_setvar_command ; $f9
-anim_setvar: macro
+anim_setvar: MACRO
db anim_setvar_command
db \1 ; value
- endm
+ENDM
enum anim_incvar_command ; $fa
-anim_incvar: macro
+anim_incvar: MACRO
db anim_incvar_command
- endm
+ENDM
enum anim_if_var_equal_command ; $fb
-anim_if_var_equal: macro
+anim_if_var_equal: MACRO
db anim_if_var_equal_command
db \1 ; value
dw \2 ; address
- endm
+ENDM
enum anim_jump_command ; $fc
-anim_jump: macro
+anim_jump: MACRO
db anim_jump_command
dw \1 ; address
- endm
+ENDM
enum anim_loop_command ; $fd
-anim_loop: macro
+anim_loop: MACRO
db anim_loop_command
db \1 ; count
dw \2 ; address
- endm
+ENDM
enum anim_call_command ; $fe
-anim_call: macro
+anim_call: MACRO
db anim_call_command
dw \1 ; address
- endm
+ENDM
enum anim_ret_command ; $ff
-anim_ret: macro
+anim_ret: MACRO
db anim_ret_command
- endm
+ENDM
--- a/macros/scripts/battle_commands.asm
+++ b/macros/scripts/battle_commands.asm
@@ -1,7 +1,7 @@
-command: macro
+command: MACRO
enum \1_command
-\1 equs "db \1_command"
-endm
+\1 EQUS "db \1_command"
+ENDM
; BattleCommandPointers indexes (see data/battle_command_pointers.asm)
enum_start 1
--- a/macros/scripts/events.asm
+++ b/macros/scripts/events.asm
@@ -2,104 +2,104 @@
enum_start
enum scall_command ; $00
-scall: macro
+scall: MACRO
db scall_command
dw \1 ; pointer
- endm
+ENDM
enum farscall_command ; $01
-farscall: macro
+farscall: MACRO
db farscall_command
dba \1
- endm
+ENDM
enum ptcall_command ; $02
-ptcall: macro
+ptcall: MACRO
db ptcall_command
dw \1 ; pointer
- endm
+ENDM
enum jump_command ; $03
-jump: macro
+jump: MACRO
db jump_command
dw \1 ; pointer
- endm
+ENDM
enum farjump_command ; $04
-farjump: macro
+farjump: MACRO
db farjump_command
dba \1
- endm
+ENDM
enum ptjump_command ; $05
-ptjump: macro
+ptjump: MACRO
db ptjump_command
dw \1 ; pointer
- endm
+ENDM
enum if_equal_command ; $06
-if_equal: macro
+if_equal: MACRO
db if_equal_command
db \1 ; byte
dw \2 ; pointer
- endm
+ENDM
enum if_not_equal_command ; $07
-if_not_equal: macro
+if_not_equal: MACRO
db if_not_equal_command
db \1 ; byte
dw \2 ; pointer
- endm
+ENDM
enum iffalse_command ; $08
-iffalse: macro
+iffalse: MACRO
db iffalse_command
dw \1 ; pointer
- endm
+ENDM
enum iftrue_command ; $09
-iftrue: macro
+iftrue: MACRO
db iftrue_command
dw \1 ; pointer
- endm
+ENDM
enum if_greater_than_command ; $0a
-if_greater_than: macro
+if_greater_than: MACRO
db if_greater_than_command
db \1 ; byte
dw \2 ; pointer
- endm
+ENDM
enum if_less_than_command ; $0b
-if_less_than: macro
+if_less_than: MACRO
db if_less_than_command
db \1 ; byte
dw \2 ; pointer
- endm
+ENDM
enum jumpstd_command ; $0c
-jumpstd: macro
+jumpstd: MACRO
db jumpstd_command
dw \1 ; predefined_script
- endm
+ENDM
enum callstd_command ; $0d
-callstd: macro
+callstd: MACRO
db callstd_command
dw \1 ; predefined_script
- endm
+ENDM
enum callasm_command ; $0e
-callasm: macro
+callasm: MACRO
db callasm_command
dba \1
- endm
+ENDM
enum special_command ; $0f
-special: macro
+special: MACRO
db special_command
dw (\1Special - SpecialsPointers) / 3
- endm
+ENDM
add_special: MACRO
\1Special::
@@ -107,98 +107,98 @@
ENDM
enum ptcallasm_command ; $10
-ptcallasm: macro
+ptcallasm: MACRO
db ptcallasm_command
dw \1 ; asm
- endm
+ENDM
enum checkmapscene_command ; $11
-checkmapscene: macro
+checkmapscene: MACRO
db checkmapscene_command
map \1 ; map
- endm
+ENDM
enum setmapscene_command ; $12
-setmapscene: macro
+setmapscene: MACRO
db setmapscene_command
map \1 ; map
db \2 ; scene_id
- endm
+ENDM
enum checkscene_command ; $13
-checkscene: macro
+checkscene: MACRO
db checkscene_command
- endm
+ENDM
enum setscene_command ; $14
-setscene: macro
+setscene: MACRO
db setscene_command
db \1 ; scene_id
- endm
+ENDM
enum writebyte_command ; $15
-writebyte: macro
+writebyte: MACRO
db writebyte_command
db \1 ; value
- endm
+ENDM
enum addvar_command ; $16
-addvar: macro
+addvar: MACRO
db addvar_command
db \1 ; value
- endm
+ENDM
enum random_command ; $17
-random: macro
+random: MACRO
db random_command
db \1 ; input
- endm
+ENDM
enum checkver_command ; $18
-checkver: macro
+checkver: MACRO
db checkver_command
- endm
+ENDM
enum copybytetovar_command ; $19
-copybytetovar: macro
+copybytetovar: MACRO
db copybytetovar_command
dw \1 ; address
- endm
+ENDM
enum copyvartobyte_command ; $1a
-copyvartobyte: macro
+copyvartobyte: MACRO
db copyvartobyte_command
dw \1 ; address
- endm
+ENDM
enum loadvar_command ; $1b
-loadvar: macro
+loadvar: MACRO
db loadvar_command
dw \1 ; address
db \2 ; value
- endm
+ENDM
enum checkcode_command ; $1c
-checkcode: macro
+checkcode: MACRO
db checkcode_command
db \1 ; variable_id
- endm
+ENDM
enum writevarcode_command ; $1d
-writevarcode: macro
+writevarcode: MACRO
db writevarcode_command
db \1 ; variable_id
- endm
+ENDM
enum writecode_command ; $1e
-writecode: macro
+writecode: MACRO
db writecode_command
db \1 ; variable_id
db \2 ; value
- endm
+ENDM
enum giveitem_command ; $1f
-giveitem: macro
+giveitem: MACRO
db giveitem_command
db \1 ; item
if _NARG == 2
@@ -206,10 +206,10 @@
else
db 1
endc
- endm
+ENDM
enum takeitem_command ; $20
-takeitem: macro
+takeitem: MACRO
db takeitem_command
db \1 ; item
if _NARG == 2
@@ -217,76 +217,76 @@
else
db 1
endc
- endm
+ENDM
enum checkitem_command ; $21
-checkitem: macro
+checkitem: MACRO
db checkitem_command
db \1 ; item
- endm
+ENDM
enum givemoney_command ; $22
-givemoney: macro
+givemoney: MACRO
db givemoney_command
db \1 ; account
dt \2 ; money
- endm
+ENDM
enum takemoney_command ; $23
-takemoney: macro
+takemoney: MACRO
db takemoney_command
db \1 ; account
dt \2 ; money
- endm
+ENDM
enum checkmoney_command ; $24
-checkmoney: macro
+checkmoney: MACRO
db checkmoney_command
db \1 ; account
dt \2 ; money
- endm
+ENDM
enum givecoins_command ; $25
-givecoins: macro
+givecoins: MACRO
db givecoins_command
dw \1 ; coins
- endm
+ENDM
enum takecoins_command ; $26
-takecoins: macro
+takecoins: MACRO
db takecoins_command
dw \1 ; coins
- endm
+ENDM
enum checkcoins_command ; $27
-checkcoins: macro
+checkcoins: MACRO
db checkcoins_command
dw \1 ; coins
- endm
+ENDM
enum addcellnum_command ; $28
-addcellnum: macro
+addcellnum: MACRO
db addcellnum_command
db \1 ; person
- endm
+ENDM
enum delcellnum_command ; $29
-delcellnum: macro
+delcellnum: MACRO
db delcellnum_command
db \1 ; person
- endm
+ENDM
enum checkcellnum_command ; $2a
-checkcellnum: macro
+checkcellnum: MACRO
db checkcellnum_command
db \1 ; person
- endm
+ENDM
enum checktime_command ; $2b
-checktime: macro
+checktime: MACRO
db checktime_command
db \1 ; time
- endm
+ENDM
checkmorn EQUS "checktime MORN"
checkday EQUS "checktime DAY"
@@ -293,13 +293,13 @@
checknite EQUS "checktime NITE"
enum checkpoke_command ; $2c
-checkpoke: macro
+checkpoke: MACRO
db checkpoke_command
db \1 ; pkmn
- endm
+ENDM
enum givepoke_command ; $2d
-givepoke: macro
+givepoke: MACRO
db givepoke_command
db \1 ; pokemon
db \2 ; level
@@ -317,676 +317,676 @@
else
db 0, 0
endc
- endm
+ENDM
enum giveegg_command ; $2e
-giveegg: macro
+giveegg: MACRO
db giveegg_command
db \1 ; pkmn
db \2 ; level
- endm
+ENDM
enum givepokeitem_command ; $2f
-givepokeitem: macro
+givepokeitem: MACRO
db givepokeitem_command
dw \1 ; pointer
- endm
+ENDM
enum checkpokeitem_command ; $30
-checkpokeitem: macro
+checkpokeitem: MACRO
db checkpokeitem_command
dw \1 ; pointer
- endm
+ENDM
enum checkevent_command ; $31
-checkevent: macro
+checkevent: MACRO
db checkevent_command
dw \1 ; event_flag
- endm
+ENDM
enum clearevent_command ; $32
-clearevent: macro
+clearevent: MACRO
db clearevent_command
dw \1 ; event_flag
- endm
+ENDM
enum setevent_command ; $33
-setevent: macro
+setevent: MACRO
db setevent_command
dw \1 ; event_flag
- endm
+ENDM
enum checkflag_command ; $34
-checkflag: macro
+checkflag: MACRO
db checkflag_command
dw \1 ; engine_flag
- endm
+ENDM
enum clearflag_command ; $35
-clearflag: macro
+clearflag: MACRO
db clearflag_command
dw \1 ; engine_flag
- endm
+ENDM
enum setflag_command ; $36
-setflag: macro
+setflag: MACRO
db setflag_command
dw \1 ; engine_flag
- endm
+ENDM
enum wildon_command ; $37
-wildon: macro
+wildon: MACRO
db wildon_command
- endm
+ENDM
enum wildoff_command ; $38
-wildoff: macro
+wildoff: MACRO
db wildoff_command
- endm
+ENDM
enum xycompare_command ; $39
-xycompare: macro
+xycompare: MACRO
db xycompare_command
dw \1 ; pointer
- endm
+ENDM
enum warpmod_command ; $3a
-warpmod: macro
+warpmod: MACRO
db warpmod_command
db \1 ; warp_id
map \2 ; map
- endm
+ENDM
enum blackoutmod_command ; $3b
-blackoutmod: macro
+blackoutmod: MACRO
db blackoutmod_command
map \1 ; map
- endm
+ENDM
enum warp_command ; $3c
-warp: macro
+warp: MACRO
db warp_command
map \1 ; map
db \2 ; x
db \3 ; y
- endm
+ENDM
enum readmoney_command ; $3d
-readmoney: macro
+readmoney: MACRO
db readmoney_command
db \1 ; account
db \2 ; memory
- endm
+ENDM
enum readcoins_command ; $3e
-readcoins: macro
+readcoins: MACRO
db readcoins_command
db \1 ; memory
- endm
+ENDM
enum RAM2MEM_command ; $3f
-RAM2MEM: macro
+RAM2MEM: MACRO
db RAM2MEM_command
db \1 ; memory
- endm
+ENDM
enum pokenamemem_command ; $40
-pokenamemem: macro
+pokenamemem: MACRO
db pokenamemem_command
db \1 ; pokemon
db \2 ; memory
- endm
+ENDM
enum itemtotext_command ; $41
-itemtotext: macro
+itemtotext: MACRO
db itemtotext_command
db \1 ; item
db \2 ; memory
- endm
+ENDM
enum mapnametotext_command ; $42
-mapnametotext: macro
+mapnametotext: MACRO
db mapnametotext_command
db \1 ; memory
- endm
+ENDM
enum trainertotext_command ; $43
-trainertotext: macro
+trainertotext: MACRO
db trainertotext_command
db \1 ; trainer_id
db \2 ; trainer_group
db \3 ; memory
- endm
+ENDM
enum stringtotext_command ; $44
-stringtotext: macro
+stringtotext: MACRO
db stringtotext_command
dw \1 ; text_pointer
db \2 ; memory
- endm
+ENDM
enum itemnotify_command ; $45
-itemnotify: macro
+itemnotify: MACRO
db itemnotify_command
- endm
+ENDM
enum pocketisfull_command ; $46
-pocketisfull: macro
+pocketisfull: MACRO
db pocketisfull_command
- endm
+ENDM
enum opentext_command ; $47
-opentext: macro
+opentext: MACRO
db opentext_command
- endm
+ENDM
enum refreshscreen_command ; $48
-refreshscreen: macro
+refreshscreen: MACRO
db refreshscreen_command
db \1 ; dummy
- endm
+ENDM
enum closetext_command ; $49
-closetext: macro
+closetext: MACRO
db closetext_command
- endm
+ENDM
enum loadbytec2cf_command ; $4a
-loadbytec2cf: macro
+loadbytec2cf: MACRO
db loadbytec2cf_command
db \1 ; byte
- endm
+ENDM
enum farwritetext_command ; $4b
-farwritetext: macro
+farwritetext: MACRO
db farwritetext_command
dba \1
- endm
+ENDM
enum writetext_command ; $4c
-writetext: macro
+writetext: MACRO
db writetext_command
dw \1 ; text_pointer
- endm
+ENDM
enum repeattext_command ; $4d
-repeattext: macro
+repeattext: MACRO
db repeattext_command
db \1 ; byte
db \2 ; byte
- endm
+ENDM
enum yesorno_command ; $4e
-yesorno: macro
+yesorno: MACRO
db yesorno_command
- endm
+ENDM
enum loadmenudata_command ; $4f
-loadmenudata: macro
+loadmenudata: MACRO
db loadmenudata_command
dw \1 ; data
- endm
+ENDM
enum closewindow_command ; $50
-closewindow: macro
+closewindow: MACRO
db closewindow_command
- endm
+ENDM
enum jumptextfaceplayer_command ; $51
-jumptextfaceplayer: macro
+jumptextfaceplayer: MACRO
db jumptextfaceplayer_command
dw \1 ; text_pointer
- endm
+ENDM
; IF _CRYSTAL
enum farjumptext_command ; $52
-farjumptext: macro
+farjumptext: MACRO
db farjumptext_command
dba \1
- endm
+ENDM
; ENDC
enum jumptext_command ; $53
-jumptext: macro
+jumptext: MACRO
db jumptext_command
dw \1 ; text_pointer
- endm
+ENDM
enum waitbutton_command ; $54
-waitbutton: macro
+waitbutton: MACRO
db waitbutton_command
- endm
+ENDM
enum buttonsound_command ; $55
-buttonsound: macro
+buttonsound: MACRO
db buttonsound_command
- endm
+ENDM
enum pokepic_command ; $56
-pokepic: macro
+pokepic: MACRO
db pokepic_command
db \1 ; pokemon
- endm
+ENDM
enum closepokepic_command ; $57
-closepokepic: macro
+closepokepic: MACRO
db closepokepic_command
- endm
+ENDM
enum _2dmenu_command ; $58
-_2dmenu: macro
+_2dmenu: MACRO
db _2dmenu_command
- endm
+ENDM
enum verticalmenu_command ; $59
-verticalmenu: macro
+verticalmenu: MACRO
db verticalmenu_command
- endm
+ENDM
enum loadpikachudata_command ; $5a
-loadpikachudata: macro
+loadpikachudata: MACRO
db loadpikachudata_command
- endm
+ENDM
enum randomwildmon_command ; $5b
-randomwildmon: macro
+randomwildmon: MACRO
db randomwildmon_command
- endm
+ENDM
enum loadmemtrainer_command ; $5c
-loadmemtrainer: macro
+loadmemtrainer: MACRO
db loadmemtrainer_command
- endm
+ENDM
enum loadwildmon_command ; $5d
-loadwildmon: macro
+loadwildmon: MACRO
db loadwildmon_command
db \1 ; pokemon
db \2 ; level
- endm
+ENDM
enum loadtrainer_command ; $5e
-loadtrainer: macro
+loadtrainer: MACRO
db loadtrainer_command
db \1 ; trainer_group
db \2 ; trainer_id
- endm
+ENDM
enum startbattle_command ; $5f
-startbattle: macro
+startbattle: MACRO
db startbattle_command
- endm
+ENDM
enum reloadmapafterbattle_command ; $60
-reloadmapafterbattle: macro
+reloadmapafterbattle: MACRO
db reloadmapafterbattle_command
- endm
+ENDM
enum catchtutorial_command ; $61
-catchtutorial: macro
+catchtutorial: MACRO
db catchtutorial_command
db \1 ; byte
- endm
+ENDM
enum trainertext_command ; $62
-trainertext: macro
+trainertext: MACRO
db trainertext_command
db \1 ; which_text
- endm
+ENDM
enum trainerflagaction_command ; $63
-trainerflagaction: macro
+trainerflagaction: MACRO
db trainerflagaction_command
db \1 ; action
- endm
+ENDM
enum winlosstext_command ; $64
-winlosstext: macro
+winlosstext: MACRO
db winlosstext_command
dw \1 ; win_text_pointer
dw \2 ; loss_text_pointer
- endm
+ENDM
enum scripttalkafter_command ; $65
-scripttalkafter: macro
+scripttalkafter: MACRO
db scripttalkafter_command
- endm
+ENDM
enum end_if_just_battled_command ; $66
-end_if_just_battled: macro
+end_if_just_battled: MACRO
db end_if_just_battled_command
- endm
+ENDM
enum check_just_battled_command ; $67
-check_just_battled: macro
+check_just_battled: MACRO
db check_just_battled_command
- endm
+ENDM
enum setlasttalked_command ; $68
-setlasttalked: macro
+setlasttalked: MACRO
db setlasttalked_command
db \1 ; object id
- endm
+ENDM
enum applymovement_command ; $69
-applymovement: macro
+applymovement: MACRO
db applymovement_command
db \1 ; object id
dw \2 ; data
- endm
+ENDM
enum applymovement2_command ; $6a
-applymovement2: macro
+applymovement2: MACRO
db applymovement2_command
dw \1 ; data
- endm
+ENDM
enum faceplayer_command ; $6b
-faceplayer: macro
+faceplayer: MACRO
db faceplayer_command
- endm
+ENDM
enum faceobject_command ; $6c
-faceobject: macro
+faceobject: MACRO
db faceobject_command
db \1 ; object1
db \2 ; object2
- endm
+ENDM
enum variablesprite_command ; $6d
-variablesprite: macro
+variablesprite: MACRO
db variablesprite_command
db \1 - SPRITE_VARS ; byte
db \2 ; sprite
- endm
+ENDM
enum disappear_command ; $6e
-disappear: macro
+disappear: MACRO
db disappear_command
db \1 ; object id
- endm
+ENDM
enum appear_command ; $6f
-appear: macro
+appear: MACRO
db appear_command
db \1 ; object id
- endm
+ENDM
enum follow_command ; $70
-follow: macro
+follow: MACRO
db follow_command
db \1 ; object2
db \2 ; object1
- endm
+ENDM
enum stopfollow_command ; $71
-stopfollow: macro
+stopfollow: MACRO
db stopfollow_command
- endm
+ENDM
enum moveobject_command ; $72
-moveobject: macro
+moveobject: MACRO
db moveobject_command
db \1 ; object id
db \2 ; x
db \3 ; y
- endm
+ENDM
enum writeobjectxy_command ; $73
-writeobjectxy: macro
+writeobjectxy: MACRO
db writeobjectxy_command
db \1 ; object id
- endm
+ENDM
enum loademote_command ; $74
-loademote: macro
+loademote: MACRO
db loademote_command
db \1 ; bubble
- endm
+ENDM
enum showemote_command ; $75
-showemote: macro
+showemote: MACRO
db showemote_command
db \1 ; bubble
db \2 ; object id
db \3 ; time
- endm
+ENDM
enum spriteface_command ; $76
-spriteface: macro
+spriteface: MACRO
db spriteface_command
db \1 ; object id
db \2 ; facing
- endm
+ENDM
enum follownotexact_command ; $77
-follownotexact: macro
+follownotexact: MACRO
db follownotexact_command
db \1 ; object2
db \2 ; object1
- endm
+ENDM
enum earthquake_command ; $78
-earthquake: macro
+earthquake: MACRO
db earthquake_command
db \1 ; param
- endm
+ENDM
enum changemap_command ; $79
-changemap: macro
+changemap: MACRO
db changemap_command
db \1 ; map_bank
dw \2 ; map_data_pointer
- endm
+ENDM
enum changeblock_command ; $7a
-changeblock: macro
+changeblock: MACRO
db changeblock_command
db \1 ; x
db \2 ; y
db \3 ; block
- endm
+ENDM
enum reloadmap_command ; $7b
-reloadmap: macro
+reloadmap: MACRO
db reloadmap_command
- endm
+ENDM
enum reloadmappart_command ; $7c
-reloadmappart: macro
+reloadmappart: MACRO
db reloadmappart_command
- endm
+ENDM
enum writecmdqueue_command ; $7d
-writecmdqueue: macro
+writecmdqueue: MACRO
db writecmdqueue_command
dw \1 ; queue_pointer
- endm
+ENDM
enum delcmdqueue_command ; $7e
-delcmdqueue: macro
+delcmdqueue: MACRO
db delcmdqueue_command
db \1 ; byte
- endm
+ENDM
enum playmusic_command ; $7f
-playmusic: macro
+playmusic: MACRO
db playmusic_command
dw \1 ; music_pointer
- endm
+ENDM
enum encountermusic_command ; $80
-encountermusic: macro
+encountermusic: MACRO
db encountermusic_command
- endm
+ENDM
enum musicfadeout_command ; $81
-musicfadeout: macro
+musicfadeout: MACRO
db musicfadeout_command
dw \1 ; music
db \2 ; fadetime
- endm
+ENDM
enum playmapmusic_command ; $82
-playmapmusic: macro
+playmapmusic: MACRO
db playmapmusic_command
- endm
+ENDM
enum dontrestartmapmusic_command ; $83
-dontrestartmapmusic: macro
+dontrestartmapmusic: MACRO
db dontrestartmapmusic_command
- endm
+ENDM
enum cry_command ; $84
-cry: macro
+cry: MACRO
db cry_command
dw \1 ; cry_id
- endm
+ENDM
enum playsound_command ; $85
-playsound: macro
+playsound: MACRO
db playsound_command
dw \1 ; sound_pointer
- endm
+ENDM
enum waitsfx_command ; $86
-waitsfx: macro
+waitsfx: MACRO
db waitsfx_command
- endm
+ENDM
enum warpsound_command ; $87
-warpsound: macro
+warpsound: MACRO
db warpsound_command
- endm
+ENDM
enum specialsound_command ; $88
-specialsound: macro
+specialsound: MACRO
db specialsound_command
- endm
+ENDM
enum passtoengine_command ; $89
-passtoengine: macro
+passtoengine: MACRO
db passtoengine_command
db \1 ; data_pointer
- endm
+ENDM
enum newloadmap_command ; $8a
-newloadmap: macro
+newloadmap: MACRO
db newloadmap_command
db \1 ; which_method
- endm
+ENDM
enum pause_command ; $8b
-pause: macro
+pause: MACRO
db pause_command
db \1 ; length
- endm
+ENDM
enum deactivatefacing_command ; $8c
-deactivatefacing: macro
+deactivatefacing: MACRO
db deactivatefacing_command
db \1 ; time
- endm
+ENDM
enum priorityjump_command ; $8d
-priorityjump: macro
+priorityjump: MACRO
db priorityjump_command
dw \1 ; pointer
- endm
+ENDM
enum warpcheck_command ; $8e
-warpcheck: macro
+warpcheck: MACRO
db warpcheck_command
- endm
+ENDM
enum ptpriorityjump_command ; $8f
-ptpriorityjump: macro
+ptpriorityjump: MACRO
db ptpriorityjump_command
dw \1 ; pointer
- endm
+ENDM
enum return_command ; $90
-return: macro
+return: MACRO
db return_command
- endm
+ENDM
enum end_command ; $91
-end: macro
+end: MACRO
db end_command
- endm
+ENDM
enum reloadandreturn_command ; $92
-reloadandreturn: macro
+reloadandreturn: MACRO
db reloadandreturn_command
db \1 ; which_method
- endm
+ENDM
enum end_all_command ; $93
-end_all: macro
+end_all: MACRO
db end_all_command
- endm
+ENDM
enum pokemart_command ; $94
-pokemart: macro
+pokemart: MACRO
db pokemart_command
db \1 ; dialog_id
dw \2 ; mart_id
- endm
+ENDM
enum elevator_command ; $95
-elevator: macro
+elevator: MACRO
db elevator_command
dw \1 ; floor_list_pointer
- endm
+ENDM
enum trade_command ; $96
-trade: macro
+trade: MACRO
db trade_command
db \1 ; trade_id
- endm
+ENDM
enum askforphonenumber_command ; $97
-askforphonenumber: macro
+askforphonenumber: MACRO
db askforphonenumber_command
db \1 ; number
- endm
+ENDM
enum phonecall_command ; $98
-phonecall: macro
+phonecall: MACRO
db phonecall_command
dw \1 ; caller_name
- endm
+ENDM
enum hangup_command ; $99
-hangup: macro
+hangup: MACRO
db hangup_command
- endm
+ENDM
enum describedecoration_command ; $9a
-describedecoration: macro
+describedecoration: MACRO
db describedecoration_command
db \1 ; byte
- endm
+ENDM
enum fruittree_command ; $9b
-fruittree: macro
+fruittree: MACRO
db fruittree_command
db \1 ; tree_id
- endm
+ENDM
enum specialphonecall_command ; $9c
-specialphonecall: macro
+specialphonecall: MACRO
db specialphonecall_command
dw \1 ; call_id
- endm
+ENDM
enum checkphonecall_command ; $9d
-checkphonecall: macro
+checkphonecall: MACRO
db checkphonecall_command
- endm
+ENDM
enum verbosegiveitem_command ; $9e
-verbosegiveitem: macro
+verbosegiveitem: MACRO
db verbosegiveitem_command
db \1 ; item
if _NARG == 2
@@ -994,76 +994,76 @@
else
db 1
endc
- endm
+ENDM
enum verbosegiveitem2_command ; $9f
-verbosegiveitem2: macro
+verbosegiveitem2: MACRO
db verbosegiveitem2_command
db \1 ; item
db \2 ; var
- endm
+ENDM
enum swarm_command ; $a0
-swarm: macro
+swarm: MACRO
db swarm_command
db \1 ; flag
map \2 ; map
- endm
+ENDM
enum halloffame_command ; $a1
-halloffame: macro
+halloffame: MACRO
db halloffame_command
- endm
+ENDM
enum credits_command ; $a2
-credits: macro
+credits: MACRO
db credits_command
- endm
+ENDM
enum warpfacing_command ; $a3
-warpfacing: macro
+warpfacing: MACRO
db warpfacing_command
db \1 ; facing
map \2 ; map
db \3 ; x
db \4 ; y
- endm
+ENDM
enum battletowertext_command ; $a4
-battletowertext: macro
+battletowertext: MACRO
db battletowertext_command
db \1 ; memory
- endm
+ENDM
enum landmarktotext_command ; $a5
-landmarktotext: macro
+landmarktotext: MACRO
db landmarktotext_command
db \1 ; id
db \2 ; memory
- endm
+ENDM
enum trainerclassname_command ; $a6
-trainerclassname: macro
+trainerclassname: MACRO
db trainerclassname_command
db \1 ; id
db \2 ; memory
- endm
+ENDM
enum name_command ; $a7
-name: macro
+name: MACRO
db name_command
db \1 ; type
db \2 ; id
db \3 ; memory
- endm
+ENDM
enum wait_command ; $a8
-wait: macro
+wait: MACRO
db wait_command
db \1 ; duration
- endm
+ENDM
enum check_save_command ; $a9
-check_save: macro
+check_save: MACRO
db check_save_command
- endm
+ENDM
--- a/macros/scripts/gfx_anims.asm
+++ b/macros/scripts/gfx_anims.asm
@@ -1,6 +1,6 @@
; pic + oam animations
-frame: macro
+frame: MACRO
db \1
x = \2
if _NARG > 2
@@ -10,35 +10,35 @@
endr
endc
db x
- endm
+ENDM
enum_start $fc
enum delanim_command ; $fc
-delanim: macro ; used for oam
+delanim: MACRO ; used for oam
db delanim_command
- endm
+ENDM
enum dorepeat_command ; $fd
-dorepeat: macro
+dorepeat: MACRO
db dorepeat_command
db \1 ; #
- endm
+ENDM
enum setrepeat_command ; $fe
-setrepeat: macro
+setrepeat: MACRO
db setrepeat_command
db \1 ; #
- endm
+ENDM
enum endanim_command ; $ff
-endanim: macro
+endanim: MACRO
db endanim_command
- endm
+ENDM
__enum__ = $fe
enum dorestart_command ; $fe
-dorestart: macro ; used for oam
+dorestart: MACRO ; used for oam
db dorestart_command
- endm
+ENDM
--- a/macros/scripts/maps.asm
+++ b/macros/scripts/maps.asm
@@ -1,15 +1,15 @@
-map: macro
+map: MACRO
;\1: map id
db GROUP_\1, MAP_\1
-endm
+ENDM
-scene_script: macro
+scene_script: MACRO
;\1: script pointer
dw \1, 0
-endm
+ENDM
-warp_def: macro
+warp_def: MACRO
;\1: y: top to bottom, starts at 0
;\2: x: left to right, starts at 0
;\3: warp destination: starts at 1
@@ -16,9 +16,9 @@
;\4: map id: from constants/map_constants.asm
db \1, \2, \3
map \4
-endm
+ENDM
-coord_event: macro
+coord_event: MACRO
;\1: scene id: controlled by setscene/setmapscene
;\2: y: top to bottom, starts at 0
;\3: x: left to right, starts at 0
@@ -26,9 +26,9 @@
db \1, \2, \3, $0
dw \4
db $0, $0
-endm
+ENDM
-bg_event: macro
+bg_event: MACRO
;\1: y: top to bottom, starts at 0
;\2: x: left to right, starts at 0
;\3: function: a BGEVENT_* constant
@@ -35,9 +35,9 @@
;\4: script pointer
db \1, \2, \3
dw \4
-endm
+ENDM
-object_event: macro
+object_event: MACRO
;\1: sprite: a SPRITE_* constant
;\2: y: top to bottom, starts at 0
;\3: x: left to right, starts at 0
@@ -65,10 +65,10 @@
dw \9
shift
dw \9
-endm
+ENDM
-trainer: macro
+trainer: MACRO
;\1: flag: an EVENT_BEAT_* constant
;\2: trainer group
;\3: trainer id
@@ -79,9 +79,9 @@
dw \1
db \2, \3
dw \4, \5, \6, \7
-endm
+ENDM
-itemball: macro
+itemball: MACRO
;\1: item: from constants/item_constants.asm
;\2: quantity: default 1
if _NARG == 2
@@ -89,9 +89,9 @@
else
db \1, 1
endc
-endm
+ENDM
-elevfloor: macro
+elevfloor: MACRO
;\1: floor: a FLOOR_* constant
;\2: warp destination: starts at 1
;\3: map id
@@ -99,10 +99,10 @@
map \3
ENDM
-stonetable: macro
+stonetable: MACRO
;\1: warp id
;\2: object_event id
;\3: script pointer
db \1, \2
dw \3
-endm
+ENDM
--- a/macros/scripts/movement.asm
+++ b/macros/scripts/movement.asm
@@ -4,243 +4,243 @@
; Directional movements
enum movement_turn_head ; $00
-turn_head: macro
+turn_head: MACRO
db movement_turn_head | \1
- endm
+ENDM
__enum__ = __enum__ + 3
enum movement_turn_step ; $04
-turn_step: macro
+turn_step: MACRO
db movement_turn_step | \1
- endm
+ENDM
__enum__ = __enum__ + 3
enum movement_slow_step ; $08
-slow_step: macro
+slow_step: MACRO
db movement_slow_step | \1
- endm
+ENDM
__enum__ = __enum__ + 3
enum movement_step ; $0c
-step: macro
+step: MACRO
db movement_step | \1
- endm
+ENDM
__enum__ = __enum__ + 3
enum movement_big_step ; $10
-big_step: macro
+big_step: MACRO
db movement_big_step | \1
- endm
+ENDM
__enum__ = __enum__ + 3
enum movement_slow_slide_step ; $14
-slow_slide_step: macro
+slow_slide_step: MACRO
db movement_slow_slide_step | \1
- endm
+ENDM
__enum__ = __enum__ + 3
enum movement_slide_step ; $18
-slide_step: macro
+slide_step: MACRO
db movement_slide_step | \1
- endm
+ENDM
__enum__ = __enum__ + 3
enum movement_fast_slide_step ; $1c
-fast_slide_step: macro
+fast_slide_step: MACRO
db movement_fast_slide_step | \1
- endm
+ENDM
__enum__ = __enum__ + 3
enum movement_turn_away ; $20
-turn_away: macro
+turn_away: MACRO
db movement_turn_away | \1
- endm
+ENDM
__enum__ = __enum__ + 3
enum movement_turn_in ; $24
-turn_in: macro
+turn_in: MACRO
db movement_turn_in | \1
- endm
+ENDM
__enum__ = __enum__ + 3
enum movement_turn_waterfall ; $28
-turn_waterfall: macro
+turn_waterfall: MACRO
db movement_turn_waterfall | \1
- endm
+ENDM
__enum__ = __enum__ + 3
enum movement_slow_jump_step ; $2c
-slow_jump_step: macro
+slow_jump_step: MACRO
db movement_slow_jump_step | \1
- endm
+ENDM
__enum__ = __enum__ + 3
enum movement_jump_step ; $30
-jump_step: macro
+jump_step: MACRO
db movement_jump_step | \1
- endm
+ENDM
__enum__ = __enum__ + 3
enum movement_fast_jump_step ; $34
-fast_jump_step: macro
+fast_jump_step: MACRO
db movement_fast_jump_step | \1
- endm
+ENDM
__enum__ = __enum__ + 3
; Control
enum movement_remove_sliding ; $38
-remove_sliding: macro
+remove_sliding: MACRO
db movement_remove_sliding
- endm
+ENDM
enum movement_set_sliding ; $39
-set_sliding: macro
+set_sliding: MACRO
db movement_set_sliding
- endm
+ENDM
enum movement_remove_fixed_facing ; $3a
-remove_fixed_facing: macro
+remove_fixed_facing: MACRO
db movement_remove_fixed_facing
- endm
+ENDM
enum movement_fix_facing ; $3b
-fix_facing: macro
+fix_facing: MACRO
db movement_fix_facing
- endm
+ENDM
enum movement_show_object ; $3c
-show_object: macro
+show_object: MACRO
db movement_show_object
- endm
+ENDM
enum movement_hide_object ; $3d
-hide_object: macro
+hide_object: MACRO
db movement_hide_object
- endm
+ENDM
; Sleep
enum movement_step_sleep ; $3e
-step_sleep: macro
+step_sleep: MACRO
if \1 <= 8
db movement_step_sleep + \1 - 1
else
db movement_step_sleep + 8, \1
endc
-endm
+ENDM
__enum__ = __enum__ + 8
enum movement_step_end ; $47
-step_end: macro
+step_end: MACRO
db movement_step_end
- endm
+ENDM
enum movement_step_48 ; $48
-step_48: macro
+step_48: MACRO
db movement_step_48
db \1 ; ???
- endm
+ENDM
enum movement_remove_object ; $49
-remove_object: macro
+remove_object: MACRO
db movement_remove_object
- endm
+ENDM
enum movement_step_loop ; $4a
-step_loop: macro
+step_loop: MACRO
db movement_step_loop
- endm
+ENDM
enum movement_step_4b ; $4b
-step_4b: macro
+step_4b: MACRO
db movement_step_4b
- endm
+ENDM
enum movement_teleport_from ; $4c
-teleport_from: macro
+teleport_from: MACRO
db movement_teleport_from
- endm
+ENDM
enum movement_teleport_to ; $4d
-teleport_to: macro
+teleport_to: MACRO
db movement_teleport_to
- endm
+ENDM
enum movement_skyfall ; $4e
-skyfall: macro
+skyfall: MACRO
db movement_skyfall
- endm
+ENDM
enum movement_step_dig ; $4f
-step_dig: macro
+step_dig: MACRO
db movement_step_dig
db \1 ; length
- endm
+ENDM
enum movement_step_bump ; $50
-step_bump: macro
+step_bump: MACRO
db movement_step_bump
- endm
+ENDM
enum movement_fish_got_bite ; $51
-fish_got_bite: macro
+fish_got_bite: MACRO
db movement_fish_got_bite
- endm
+ENDM
enum movement_fish_cast_rod ; $52
-fish_cast_rod: macro
+fish_cast_rod: MACRO
db movement_fish_cast_rod
- endm
+ENDM
enum movement_hide_emote ; $53
-hide_emote: macro
+hide_emote: MACRO
db movement_hide_emote
- endm
+ENDM
enum movement_show_emote ; $54
-show_emote: macro
+show_emote: MACRO
db movement_show_emote
- endm
+ENDM
enum movement_step_shake ; $55
-step_shake: macro
+step_shake: MACRO
db movement_step_shake
db \1 ; displacement
- endm
+ENDM
enum movement_tree_shake ; $56
-tree_shake: macro
+tree_shake: MACRO
db movement_tree_shake
- endm
+ENDM
enum movement_rock_smash ; $57
-rock_smash: macro
+rock_smash: MACRO
db movement_rock_smash
db \1 ; length
- endm
+ENDM
enum movement_return_dig ; $58
-return_dig: macro
+return_dig: MACRO
db movement_return_dig
db \1 ; length
- endm
+ENDM
enum movement_skyfall_top ; $59
-skyfall_top: macro
+skyfall_top: MACRO
db movement_skyfall_top
- endm
+ENDM
--- a/macros/scripts/text.asm
+++ b/macros/scripts/text.asm
@@ -14,116 +14,116 @@
text_from_ram: MACRO
db TX_RAM
dw \1
- ENDM
+ENDM
enum TX_BCD ; $02
-text_bcd: macro
+text_bcd: MACRO
db TX_BCD
dw \1
db \2
- ENDM
+ENDM
enum TX_MOVE ; $03
-text_move: macro
+text_move: MACRO
db TX_MOVE
dw \1
- ENDM
+ENDM
enum TX_BOX ; $04
-text_box: macro
+text_box: MACRO
db TX_BOX
dw \1
db \2, \3
- ENDM
+ENDM
enum TX_LOW ; $05
-text_low: macro
+text_low: MACRO
db TX_LOW
- endm
+ENDM
enum WAIT_BUTTON ; $06
-text_waitbutton: macro
+text_waitbutton: MACRO
db WAIT_BUTTON
- endm
+ENDM
enum TX_SCROLL ; $07
-text_scroll: macro
+text_scroll: MACRO
db TX_SCROLL
- endm
+ENDM
enum START_ASM ; $08
-start_asm: macro
+start_asm: MACRO
db START_ASM
- endm
+ENDM
enum TX_NUM ; $09
-deciram: macro
+deciram: MACRO
db TX_NUM
dw \1 ; address
dn \2, \3 ; bytes, digits
- endm
+ENDM
enum TX_EXIT ; $0a
-interpret_data: macro
+interpret_data: MACRO
db TX_EXIT
- endm
+ENDM
enum TX_SOUND_0B ; $0b
-sound_dex_fanfare_50_79: macro
+sound_dex_fanfare_50_79: MACRO
db TX_SOUND_0B
- endm
+ENDM
enum TX_DOTS ; $0c
-limited_interpret_data: macro
+limited_interpret_data: MACRO
db TX_DOTS
db \1
- endm
+ENDM
enum TX_LINK_WAIT_BUTTON ; $0d
-link_wait_button: macro
+link_wait_button: MACRO
db TX_LINK_WAIT_BUTTON
- endm
+ENDM
enum TX_SOUND_0E ; $0e
-sound_dex_fanfare_20_49: macro
+sound_dex_fanfare_20_49: MACRO
db TX_SOUND_0E
- endm
+ENDM
enum TX_SOUND_0F ; $0f
-sound_item: macro
+sound_item: MACRO
db TX_SOUND_0F
- endm
+ENDM
enum TX_SOUND_10 ; $10
-sound_caught_mon: macro
+sound_caught_mon: MACRO
db TX_SOUND_10
- endm
+ENDM
enum TX_SOUND_11 ; $11
-sound_dex_fanfare_80_109: macro
+sound_dex_fanfare_80_109: MACRO
db TX_SOUND_11
- endm
+ENDM
enum TX_SOUND_12 ; $12
-sound_fanfare: macro
+sound_fanfare: MACRO
db TX_SOUND_12
- endm
+ENDM
enum TX_SOUND_13 ; $13
-sound_slot_machine_start: macro
+sound_slot_machine_start: MACRO
db TX_SOUND_13
- endm
+ENDM
enum TX_STRINGBUFFER ; $14
-text_buffer: macro
+text_buffer: MACRO
db TX_STRINGBUFFER
db \1
- endm
+ENDM
enum TX_DAY ; $15
-current_day: macro
+current_day: MACRO
db TX_DAY
- endm
+ENDM
enum TX_FAR ; $16
text_jump: MACRO
@@ -130,4 +130,4 @@
db TX_FAR
dw \1
db BANK(\1)
- ENDM
+ENDM
--- a/macros/scripts/trade_anims.asm
+++ b/macros/scripts/trade_anims.asm
@@ -2,169 +2,169 @@
enum_start
enum tradeanim_next_command ; $00
-tradeanim_next: macro
+tradeanim_next: MACRO
db tradeanim_next_command
-endm
+ENDM
enum tradeanim_show_givemon_data_command ; $01
-tradeanim_show_givemon_data: macro
+tradeanim_show_givemon_data: MACRO
db tradeanim_show_givemon_data_command
-endm
+ENDM
enum tradeanim_show_getmon_data_command ; $02
-tradeanim_show_getmon_data: macro
+tradeanim_show_getmon_data: MACRO
db tradeanim_show_getmon_data_command
-endm
+ENDM
enum tradeanim_enter_link_tube_command ; $03
-tradeanim_enter_link_tube: macro
+tradeanim_enter_link_tube: MACRO
db tradeanim_enter_link_tube_command
-endm
+ENDM
__enum__ set $5
enum tradeanim_exit_link_tube_command ; $05
-tradeanim_exit_link_tube: macro
+tradeanim_exit_link_tube: MACRO
db tradeanim_exit_link_tube_command
-endm
+ENDM
enum tradeanim_tube_to_ot_command ; $06
-tradeanim_tube_to_ot: macro
+tradeanim_tube_to_ot: MACRO
db tradeanim_tube_to_ot_command
-endm
+ENDM
__enum__ set $0e
enum tradeanim_tube_to_player_command ; $0e
-tradeanim_tube_to_player: macro
+tradeanim_tube_to_player: MACRO
db tradeanim_tube_to_player_command
-endm
+ENDM
__enum__ set $16
enum tradeanim_sent_to_ot_text_command ; $16
-tradeanim_sent_to_ot_text: macro
+tradeanim_sent_to_ot_text: MACRO
db tradeanim_sent_to_ot_text_command
-endm
+ENDM
enum tradeanim_ot_bids_farewell_command ; $17
-tradeanim_ot_bids_farewell: macro
+tradeanim_ot_bids_farewell: MACRO
db tradeanim_ot_bids_farewell_command
-endm
+ENDM
enum tradeanim_take_care_of_text_command ; $18
-tradeanim_take_care_of_text: macro
+tradeanim_take_care_of_text: MACRO
db tradeanim_take_care_of_text_command
-endm
+ENDM
enum tradeanim_ot_sends_text_1_command ; $19
-tradeanim_ot_sends_text_1: macro
+tradeanim_ot_sends_text_1: MACRO
db tradeanim_ot_sends_text_1_command
-endm
+ENDM
enum tradeanim_ot_sends_text_2_command ; $1a
-tradeanim_ot_sends_text_2: macro
+tradeanim_ot_sends_text_2: MACRO
db tradeanim_ot_sends_text_2_command
-endm
+ENDM
enum tradeanim_setup_givemon_scroll_command ; $1b
-tradeanim_setup_givemon_scroll: macro
+tradeanim_setup_givemon_scroll: MACRO
db tradeanim_setup_givemon_scroll_command
-endm
+ENDM
enum tradeanim_do_givemon_scroll_command ; $1c
-tradeanim_do_givemon_scroll: macro
+tradeanim_do_givemon_scroll: MACRO
db tradeanim_do_givemon_scroll_command
-endm
+ENDM
enum tradeanim_frontpic_scroll_command ; $1d
-tradeanim_frontpic_scroll: macro
+tradeanim_frontpic_scroll: MACRO
db tradeanim_frontpic_scroll_command
-endm
+ENDM
enum tradeanim_textbox_scroll_command ; $1e
-tradeanim_textbox_scroll: macro
+tradeanim_textbox_scroll: MACRO
db tradeanim_textbox_scroll_command
-endm
+ENDM
enum tradeanim_scroll_out_right_command ; $1f
-tradeanim_scroll_out_right: macro
+tradeanim_scroll_out_right: MACRO
db tradeanim_scroll_out_right_command
-endm
+ENDM
__enum__ set $21
enum tradeanim_wait_80_command ; $21
-tradeanim_wait_80: macro
+tradeanim_wait_80: MACRO
db tradeanim_wait_80_command
-endm
+ENDM
enum tradeanim_wait_40_command ; $22
-tradeanim_wait_40: macro
+tradeanim_wait_40: MACRO
db tradeanim_wait_40_command
-endm
+ENDM
enum tradeanim_rocking_ball_command ; $23
-tradeanim_rocking_ball: macro
+tradeanim_rocking_ball: MACRO
db tradeanim_rocking_ball_command
-endm
+ENDM
enum tradeanim_drop_ball_command ; $24
-tradeanim_drop_ball: macro
+tradeanim_drop_ball: MACRO
db tradeanim_drop_ball_command
-endm
+ENDM
enum tradeanim_wait_anim_command ; $25
-tradeanim_wait_anim: macro
+tradeanim_wait_anim: MACRO
db tradeanim_wait_anim_command
-endm
+ENDM
__enum__ set $27
enum tradeanim_poof_command ; $27
-tradeanim_poof: macro
+tradeanim_poof: MACRO
db tradeanim_poof_command
-endm
+ENDM
enum tradeanim_bulge_through_tube_command ; $28
-tradeanim_bulge_through_tube: macro
+tradeanim_bulge_through_tube: MACRO
db tradeanim_bulge_through_tube_command
-endm
+ENDM
enum tradeanim_give_trademon_sfx_command ; $29
-tradeanim_give_trademon_sfx: macro
+tradeanim_give_trademon_sfx: MACRO
db tradeanim_give_trademon_sfx_command
-endm
+ENDM
enum tradeanim_get_trademon_sfx_command ; $2a
-tradeanim_get_trademon_sfx: macro
+tradeanim_get_trademon_sfx: MACRO
db tradeanim_get_trademon_sfx_command
-endm
+ENDM
enum tradeanim_end_command ; $2b
-tradeanim_end: macro
+tradeanim_end: MACRO
db tradeanim_end_command
-endm
+ENDM
enum tradeanim_animate_frontpic_command ; $2c
-tradeanim_animate_frontpic: macro
+tradeanim_animate_frontpic: MACRO
db tradeanim_animate_frontpic_command
-endm
+ENDM
enum tradeanim_wait_96_command ; $2d
-tradeanim_wait_96: macro
+tradeanim_wait_96: MACRO
db tradeanim_wait_96_command
-endm
+ENDM
enum tradeanim_wait_80_if_ot_egg_command ; $2e
-tradeanim_wait_80_if_ot_egg: macro
+tradeanim_wait_80_if_ot_egg: MACRO
db tradeanim_wait_80_if_ot_egg_command
-endm
+ENDM
enum tradeanim_wait_180_if_ot_egg_command ; $2f
-tradeanim_wait_180_if_ot_egg: macro
+tradeanim_wait_180_if_ot_egg: MACRO
db tradeanim_wait_180_if_ot_egg_command
-endm
+ENDM
; Mobile
@@ -171,85 +171,85 @@
enum_start $01
enum mobiletradeanim_showgivemon_command ; $01
-mobiletradeanim_showgivemon: macro
+mobiletradeanim_showgivemon: MACRO
db mobiletradeanim_showgivemon_command
-endm
+ENDM
enum mobiletradeanim_02_command ; $02
-mobiletradeanim_02: macro
+mobiletradeanim_02: MACRO
db mobiletradeanim_02_command
-endm
+ENDM
enum mobiletradeanim_sendmon_command ; $03
-mobiletradeanim_sendmon: macro
+mobiletradeanim_sendmon: MACRO
db mobiletradeanim_sendmon_command
-endm
+ENDM
__enum__ set $05
enum mobiletradeanim_05_command ; $05
-mobiletradeanim_05: macro
+mobiletradeanim_05: MACRO
db mobiletradeanim_05_command
-endm
+ENDM
enum mobiletradeanim_06_command ; $06
-mobiletradeanim_06: macro
+mobiletradeanim_06: MACRO
db mobiletradeanim_06_command
-endm
+ENDM
enum mobiletradeanim_07_command ; $07
-mobiletradeanim_07: macro
+mobiletradeanim_07: MACRO
db mobiletradeanim_07_command
-endm
+ENDM
enum mobiletradeanim_receivemon_command ; $08
-mobiletradeanim_receivemon: macro
+mobiletradeanim_receivemon: MACRO
db mobiletradeanim_receivemon_command
-endm
+ENDM
__enum__ set $0b
enum mobiletradeanim_showgetmon_command ; $0b
-mobiletradeanim_showgetmon: macro
+mobiletradeanim_showgetmon: MACRO
db mobiletradeanim_showgetmon_command
-endm
+ENDM
enum mobiletradeanim_end_command ; $0c
-mobiletradeanim_end: macro
+mobiletradeanim_end: MACRO
db mobiletradeanim_end_command
-endm
+ENDM
enum mobiletradeanim_showgtsgivemon_command ; $0d
-mobiletradeanim_showgtsgivemon: macro
+mobiletradeanim_showgtsgivemon: MACRO
db mobiletradeanim_showgtsgivemon_command
-endm
+ENDM
enum mobiletradeanim_showgtsgetmon_command ; $0e
-mobiletradeanim_showgtsgetmon: macro
+mobiletradeanim_showgtsgetmon: MACRO
db mobiletradeanim_showgtsgetmon_command
-endm
+ENDM
enum mobiletradeanim_0f_command ; $0f
-mobiletradeanim_0f: macro
+mobiletradeanim_0f: MACRO
db mobiletradeanim_0f_command
-endm
+ENDM
enum mobiletradeanim_10_command ; $10
-mobiletradeanim_10: macro
+mobiletradeanim_10: MACRO
db mobiletradeanim_10_command
-endm
+ENDM
enum mobiletradeanim_11_command ; $11
-mobiletradeanim_11: macro
+mobiletradeanim_11: MACRO
db mobiletradeanim_11_command
-endm
+ENDM
enum mobiletradeanim_12_command ; $12
-mobiletradeanim_12: macro
+mobiletradeanim_12: MACRO
db mobiletradeanim_12_command
-endm
+ENDM
enum mobiletradeanim_showoddegg_command ; $13
-mobiletradeanim_showoddegg: macro
+mobiletradeanim_showoddegg: MACRO
db mobiletradeanim_showoddegg_command
-endm
+ENDM
--- a/macros/tilesets.asm
+++ b/macros/tilesets.asm
@@ -8,8 +8,8 @@
shift
shift
endr
-endm
+ENDM
tilecoll: MACRO
db COLL_\1, COLL_\2, COLL_\3, COLL_\4
-endm
+ENDM
--- a/macros/wram.asm
+++ b/macros/wram.asm
@@ -189,7 +189,7 @@
\1Pkmn3NameEnd::
\1TrainerData:: ds BATTLETOWER_TRAINERDATALENGTH
\1TrainerEnd::
-endm
+ENDM
mailmsg: MACRO
\1Message:: ds MAIL_MSG_LENGTH
@@ -200,7 +200,7 @@
\1Species:: db
\1Type:: db
\1End::
-endm
+ENDM
roam_struct: MACRO
\1Species:: db
@@ -211,11 +211,11 @@
\1DVs:: dw
ENDM
-bugcontestwinner: macro
+bugcontestwinner: MACRO
\1WinnerID:: db
\1Mon:: db
\1Score:: dw
-endm
+ENDM
hof_mon: MACRO
\1Species:: db
@@ -224,7 +224,7 @@
\1Level:: db
\1Nickname:: ds PKMN_NAME_LENGTH +- 1
\1End::
-endm
+ENDM
hall_of_fame: MACRO
\1WinCount:: db
@@ -265,7 +265,7 @@
\1Accuracy:: db
\1PP:: db
\1EffectChance:: db
-endm
+ENDM
slot_reel: MACRO
\1ReelAction:: db
@@ -275,14 +275,14 @@
\1SpinRate:: db
\1OAMAddr:: dw
\1XCoord:: db
-\1Slot09:: ds 1
-\1Slot0a:: ds 1
+\1ManipCounter:: db
+\1ManipDelay:: db
\1Slot0b:: ds 1
\1Slot0c:: ds 1
\1Slot0d:: ds 1
\1Slot0e:: ds 1
-\1Slot0f:: ds 1
-endm
+\1StopDelay:: db
+ENDM
object_struct: MACRO
\1Struct::
@@ -337,7 +337,7 @@
\1ObjectScript:: dw
\1ObjectEventFlag:: dw
ds 2
-endm
+ENDM
sprite_anim_struct: MACRO
\1Index:: db
@@ -384,7 +384,7 @@
\1_Anim15:: ds 1
\1_Anim16:: ds 1
\1_Anim17:: ds 1
-endm
+ENDM
battle_bg_effect: MACRO
\1_Function:: db
@@ -391,4 +391,4 @@
\1_01:: ds 1
\1_02:: ds 1
\1_03:: ds 1
-endm
+ENDM
--- a/maps/GoldenrodUndergroundSwitchRoomEntrances.asm
+++ b/maps/GoldenrodUndergroundSwitchRoomEntrances.asm
@@ -4,10 +4,10 @@
UNDERGROUND_DOOR_OPEN1 EQU $2d
UNDERGROUND_DOOR_OPEN2 EQU $3d
-ugdoor: macro
+ugdoor: MACRO
\1_YCOORD EQU \2
\1_XCOORD EQU \3
-endm
+ENDM
ugdoor UGDOOR_1, $10, $06
ugdoor UGDOOR_2, $0a, $06
@@ -26,9 +26,9 @@
ugdoor UGDOOR_15, $12, $0a
ugdoor UGDOOR_16, $12, $0c
-doorstate: macro
+doorstate: MACRO
changeblock UGDOOR_\1_YCOORD, UGDOOR_\1_XCOORD, UNDERGROUND_DOOR_\2
-endm
+ENDM
const_value set 2
const GOLDENRODUNDERGROUNDSWITCHROOMENTRANCES_PHARMACIST1
--- a/maps/map_headers.asm
+++ b/maps/map_headers.asm
@@ -1,4 +1,4 @@
-map_header: macro
+map_header: MACRO
;\1: map label
;\2: tileset: a TILESET_* constant
;\3: environment: TOWN, ROUTE, INDOOR, CAVE, ENVIRONMENT_5, GATE, or DUNGEON
@@ -13,7 +13,7 @@
db \4, \5
dn \6, \7
db \8
-endm
+ENDM
MapGroupPointers::
; pointers to the first map header of each map group
--- a/maps/second_map_headers.asm
+++ b/maps/second_map_headers.asm
@@ -1,4 +1,4 @@
-map_header_2: macro
+map_header_2: MACRO
;\1: map label
;\2: map id
;\3: border block
@@ -12,9 +12,9 @@
dw \1_MapScriptHeader
dw \1_MapEventHeader
db \4
-endm
+ENDM
-connection: macro
+connection: MACRO
if "\1" == "north"
;\2: map id
;\3: map label (eventually will be rolled into map id)
@@ -82,7 +82,7 @@
db 0
dw OverworldMap + \2_WIDTH + 7
endc
-endm
+ENDM
map_header_2 NewBarkTown, NEW_BARK_TOWN, $5, WEST | EAST
--- a/mobile/battle_tower_5c.asm
+++ b/mobile/battle_tower_5c.asm
@@ -110,7 +110,7 @@
ld bc, NAME_LENGTH_JAPANESE - 1
call CopyBytes
ld bc, PlayerID
- ld de, PlayerGender
+ ld de, wPlayerGender
farcall GetMobileOTTrainerClass
ld de, wBT_OTTempPkmn1CaughtGender
ld a, c
--- a/mobile/fixed_words.asm
+++ b/mobile/fixed_words.asm
@@ -322,11 +322,11 @@
call SetPalettes
call DisableLCD
ld hl, GFX_11d67e
- ld de, VTiles2
+ ld de, vTiles2
ld bc, $60
call CopyBytes
ld hl, LZ_11d6de
- ld de, VTiles0
+ ld de, vTiles0
call Decompress
call EnableLCD
farcall ReloadMapPart
@@ -4209,7 +4209,7 @@
; 11f220
MobileEZChatData_WordAndPageCounts:
-macro_11f220: macro
+macro_11f220: MACRO
; parameter: number of words
db \1
; 12 words per page (0-based indexing)
@@ -4218,7 +4218,7 @@
x = x +- 1
endc
db x
-endm
+ENDM
macro_11f220 18 ; 01: Types
macro_11f220 36 ; 02: Greetings
macro_11f220 69 ; 03: People
@@ -4240,10 +4240,10 @@
; allocated size for each.
; These arrays are expanded dynamically to accomodate
; any Pokemon you've seen that starts with each kana.\
-macro_11f23c: macro
+macro_11f23c: MACRO
dw x - w3_d000, \1
x = x + 2 * \1
-endm
+ENDM
x = $d012
macro_11f23c $2f ; a
macro_11f23c $1e ; i
--- a/mobile/mobile_12.asm
+++ b/mobile/mobile_12.asm
@@ -22,11 +22,11 @@
call Function486bf
call LoadFontsExtra
ld de, MobileUpArrowGFX
- ld hl, VTiles2 tile $10
+ ld hl, vTiles2 tile $10
lb bc, BANK(MobileUpArrowGFX), 1
call Request1bpp
ld de, MobileDownArrowGFX
- ld hl, VTiles2 tile $11
+ ld hl, vTiles2 tile $11
lb bc, BANK(MobileDownArrowGFX), 1
call Request1bpp
call Function4a3a7
@@ -84,7 +84,7 @@
ld a, [wd002]
bit 6, a
jr nz, .asm_48113
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
ld hl, Strings_484fb
call GetNthString
ld d, h
@@ -298,7 +298,7 @@
ld de, String_484ff
call PlaceString
call WaitBGMap
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
inc a
ld [wMenuCursorBuffer], a
call StaticMenuJoypad
@@ -316,11 +316,11 @@
cp $50
jr nz, .asm_482e1
ld a, $1
- ld [PlayerGender], a
+ ld [wPlayerGender], a
jr .asm_482f1
.asm_482ed
xor a
- ld [PlayerGender], a
+ ld [wPlayerGender], a
.asm_482f1
ld d, h
ld e, l
@@ -804,10 +804,10 @@
ld a, A_BUTTON
add B_BUTTON
ld [hli], a ; joypad filter
- ; ld a, [PlayerGender]
+ ; ld a, [wPlayerGender]
; xor 1
; inc a
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
and a
jr z, .male
ld a, 2
--- a/mobile/mobile_22.asm
+++ b/mobile/mobile_22.asm
@@ -25,17 +25,17 @@
Function89168: ; 89168 (22:5168)
- ld hl, GameTimerPause
+ ld hl, wGameTimerPause
set 7, [hl]
ret
Function8916e: ; 8916e (22:516e)
- ld hl, GameTimerPause
+ ld hl, wGameTimerPause
res 7, [hl]
ret
Function89174: ; 89174 (22:5174)
- ld hl, GameTimerPause
+ ld hl, wGameTimerPause
bit 7, [hl]
ret
@@ -535,7 +535,7 @@
ret
Function893ef: ; 893ef
- ld de, VTiles0
+ ld de, vTiles0
ld hl, GFX_8940b
ld bc, $20
ld a, BANK(GFX_8940b)
@@ -556,12 +556,12 @@
; 8942b
Function8942b: ; 8942b (22:542b)
- ld de, VTiles0 tile $02
+ ld de, vTiles0 tile $02
ld hl, MobileAdapterGFX + $7d0
ld bc, $80
ld a, BANK(MobileAdapterGFX)
call FarCopyBytes
- ld de, VTiles0 tile $0a
+ ld de, vTiles0 tile $0a
ld hl, MobileAdapterGFX + $c60
ld bc, $40
ld a, BANK(MobileAdapterGFX)
@@ -583,7 +583,7 @@
Function89455: ; 89455 (22:5455)
ld hl, MobileAdapterGFX + $7d0
- ld de, VTiles2 tile $0c
+ ld de, vTiles2 tile $0c
ld bc, $490
ld a, BANK(MobileAdapterGFX)
call FarCopyBytes
@@ -591,12 +591,12 @@
Function89464: ; 89464
ld hl, MobileAdapterGFX
- ld de, VTiles2
+ ld de, vTiles2
ld bc, $200
ld a, BANK(MobileAdapterGFX)
call FarCopyBytes
ld hl, MobileAdapterGFX + $660
- ld de, VTiles2 tile $20
+ ld de, vTiles2 tile $20
ld bc, $170
ld a, BANK(MobileAdapterGFX)
call FarCopyBytes
@@ -619,7 +619,7 @@
Function89492: ; 89492 (22:5492)
ld d, 0
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
ret z
inc d
@@ -1227,7 +1227,7 @@
ld [TrainerClass], a
xor a
ld [CurPartySpecies], a
- ld de, VTiles2 tile $37
+ ld de, vTiles2 tile $37
farcall GetTrainerPic
pop bc
ret
@@ -1269,13 +1269,13 @@
Function89807: ; 89807 (22:5807)
ld hl, MobileAdapterGFX + $200
- ld a, [PlayerGender]
+ ld a, [wPlayerGender]
bit 0, a
jr z, .asm_89814
ld hl, MobileAdapterGFX + $200 + $230
.asm_89814
call DisableLCD
- ld de, VTiles2 tile $37
+ ld de, vTiles2 tile $37
ld bc, $230
ld a, BANK(MobileAdapterGFX)
call FarCopyBytes
--- a/mobile/mobile_22_2.asm
+++ b/mobile/mobile_22_2.asm
@@ -597,17 +597,17 @@
Function8b690: ; 8b690
ld hl, GFX_17afa5 + $514
- ld de, VTiles2
+ ld de, vTiles2
ld bc, $160
ld a, BANK(GFX_17afa5)
call FarCopyBytes
ld hl, GFX_17afa5 + $514 + $160 - $10
- ld de, VTiles2 tile $61
+ ld de, vTiles2 tile $61
ld bc, $10
ld a, BANK(GFX_17afa5)
call FarCopyBytes
ld hl, GFX_17afa5 + $514 + $160
- ld de, VTiles1 tile $6e
+ ld de, vTiles1 tile $6e
ld bc, $10
ld a, BANK(GFX_17afa5)
call FarCopyBytes
--- a/mobile/mobile_40.asm
+++ b/mobile/mobile_40.asm
@@ -2543,7 +2543,7 @@
dbwww $80, PlayerName, NAME_LENGTH, NULL
dbwww $80, PlayerID, 2, NULL
dbwww $80, wSecretID, 2, NULL
- dbwww $80, PlayerGender, 1, NULL
+ dbwww $80, wPlayerGender, 1, NULL
dbwww $04, $a603, 8, NULL
dbwww $04, $a007, PARTYMON_STRUCT_LENGTH, NULL
db -1
@@ -2812,7 +2812,7 @@
call CloseSRAM
ld hl, wdc41
res 4, [hl]
- ld hl, GameTimerPause
+ ld hl, wGameTimerPause
bit 7, [hl]
jr z, .skip
ld hl, wdc41
@@ -4703,7 +4703,7 @@
call ClearSprites
farcall Function8adb3
ret c
- ld hl, GameTimerPause
+ ld hl, wGameTimerPause
set 7, [hl]
ld hl, wdc41
set 4, [hl]
@@ -4711,7 +4711,7 @@
; 101ead
Function101ead: ; 101ead
- ld hl, GameTimerPause
+ ld hl, wGameTimerPause
bit 7, [hl]
jr nz, .asm_101ec8
ld hl, wdc41
@@ -6843,7 +6843,7 @@
Function102dd3: ; 102dd3
call DisableLCD
ld de, GFX_1032a2
- ld hl, VTiles0
+ ld hl, vTiles0
lb bc, BANK(GFX_1032a2), 4
call Get2bpp
farcall __LoadTradeScreenBorder
@@ -7896,7 +7896,7 @@
Function103700: ; 103700
ld c, $0a
- ld hl, SwarmFlags
+ ld hl, wSwarmFlags
bit 4, [hl]
jr z, .asm_10370f
farcall Function1008a6
@@ -7994,11 +7994,11 @@
Function10378c: ; 10378c
ld c, 0
- ld hl, SwarmFlags
+ ld hl, wSwarmFlags
bit 4, [hl]
jr nz, .already_set
ld c, $01
- ld hl, SwarmFlags
+ ld hl, wSwarmFlags
set 4, [hl]
.already_set
@@ -8020,7 +8020,7 @@
ld a, c
and a
ret z
- ld hl, SwarmFlags
+ ld hl, wSwarmFlags
res 4, [hl]
ret
; 1037c2
--- a/mobile/mobile_41.asm
+++ b/mobile/mobile_41.asm
@@ -1011,20 +1011,20 @@
Function106464:: ; 106464
ld de, MobilePhoneTilesGFX
- ld hl, VTiles2 tile $60
+ ld hl, vTiles2 tile $60
lb bc, BANK(MobilePhoneTilesGFX), 1
call Get2bpp
ld de, FontsExtra2_UpArrowGFX
- ld hl, VTiles2 tile $61
+ ld hl, vTiles2 tile $61
lb bc, BANK(FontsExtra2_UpArrowGFX), 1
call Get2bpp
ld de, GFX_106514
- ld hl, VTiles2 tile $62
+ ld hl, vTiles2 tile $62
ld c, 9
ld b, BANK(GFX_106514)
call Get2bpp
ld de, $40b0
- ld hl, VTiles2 tile $6b
+ ld hl, vTiles2 tile $6b
ld b, $f ; XXX no graphics at 0f:40b0
call Get2bpp
farcall LoadFrame
@@ -1039,11 +1039,11 @@
call AddNTimes
ld d, h
ld e, l
- ld hl, VTiles2 tile $79
+ ld hl, vTiles2 tile $79
ld c, 6
ld b, BANK(Frames)
call Function1064c3
- ld hl, VTiles2 tile $7f
+ ld hl, vTiles2 tile $7f
ld de, TextBoxSpaceGFX
ld c, 1
ld b, BANK(TextBoxSpaceGFX)
--- a/mobile/mobile_42.asm
+++ b/mobile/mobile_42.asm
@@ -149,7 +149,7 @@
call ClearSprites
call ClearTileMap
call DisableLCD
- call MobileTradeAnim_ClearVTiles
+ call MobileTradeAnim_ClearTiles
call MobileTradeAnim_ClearBGMap
call LoadStandardFont
call LoadFontsBattleExtra
@@ -157,13 +157,13 @@
ld a, $1
ld [rVBK], a
ld hl, LZ_108da7
- ld de, VTiles2
+ ld de, vTiles2
call Decompress
ld a, $0
ld [rVBK], a
ld hl, LZ_108d27
- ld de, VTiles0 tile $20
+ ld de, vTiles0 tile $20
call Decompress
call EnableLCD
@@ -180,12 +180,12 @@
call DelayFrame
ld de, TradeBallGFX
- ld hl, VTiles0
+ ld hl, vTiles0
lb bc, BANK(TradeBallGFX), $06
call Request2bpp
ld de, TradePoofGFX
- ld hl, VTiles0 tile $06
+ ld hl, vTiles0 tile $06
lb bc, BANK(TradePoofGFX), $0c
call Request2bpp
@@ -196,12 +196,12 @@
ld a, [wPlayerTrademonSpecies]
ld hl, wPlayerTrademonDVs
- ld de, VTiles0 tile $30
+ ld de, vTiles0 tile $30
call MobileTradeAnim_GetFrontpic
ld a, [wOTTrademonSpecies]
ld hl, wOTTrademonDVs
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
call MobileTradeAnim_GetFrontpic
ld a, [wPlayerTrademonSpecies]
@@ -225,7 +225,7 @@
call ClearSprites
call ClearTileMap
call DisableLCD
- call MobileTradeAnim_ClearVTiles
+ call MobileTradeAnim_ClearTiles
call MobileTradeAnim_ClearBGMap
call LoadStandardFont
call LoadFontsBattleExtra
@@ -255,16 +255,16 @@
ret
; 1081ad
-MobileTradeAnim_ClearVTiles: ; 1081ad
+MobileTradeAnim_ClearTiles: ; 1081ad
ld a, $1
ld [rVBK], a
- ld hl, VTiles0
+ ld hl, vTiles0
ld bc, 3 * $80 tiles
xor a
call ByteFill
ld a, $0
ld [rVBK], a
- ld hl, VTiles0
+ ld hl, vTiles0
ld bc, 3 * $80 tiles
xor a
call ByteFill
@@ -549,7 +549,7 @@
ld a, [wOTTrademonSpecies]
ld [CurPartySpecies], a
ld hl, wOTTrademonDVs
- ld de, VTiles2
+ ld de, vTiles2
call Function108201
call EnableLCD
farcall DeinitializeAllSprites
@@ -616,11 +616,11 @@
call Function10898a
call DelayFrame
ld de, TradeBallGFX
- ld hl, VTiles0
+ ld hl, vTiles0
lb bc, BANK(TradeBallGFX), $06
call Request2bpp
ld de, TradePoofGFX
- ld hl, VTiles0 tile $06
+ ld hl, vTiles0 tile $06
lb bc, BANK(TradePoofGFX), $0c
call Request2bpp
ld a, [wPlayerTrademonDVs]
@@ -684,17 +684,17 @@
ld a, [wOTTrademonSpecies]
ld [CurPartySpecies], a
ld hl, wOTTrademonDVs
- ld de, VTiles2
+ ld de, vTiles2
call Function108201
call EnableLCD
farcall DeinitializeAllSprites
call DelayFrame
ld de, TradeBallGFX
- ld hl, VTiles0
+ ld hl, vTiles0
lb bc, BANK(TradeBallGFX), $06
call Request2bpp
ld de, TradePoofGFX
- ld hl, VTiles0 tile $06
+ ld hl, vTiles0 tile $06
lb bc, BANK(TradePoofGFX), $0c
call Request2bpp
xor a
@@ -753,17 +753,17 @@
ld a, [wOTTrademonSpecies]
ld [CurPartySpecies], a
ld hl, wOTTrademonDVs
- ld de, VTiles2
+ ld de, vTiles2
call Function108201
call EnableLCD
farcall DeinitializeAllSprites
call DelayFrame
ld de, TradeBallGFX
- ld hl, VTiles0
+ ld hl, vTiles0
lb bc, BANK(TradeBallGFX), $06
call Request2bpp
ld de, TradePoofGFX
- ld hl, VTiles0 tile $06
+ ld hl, vTiles0 tile $06
lb bc, BANK(TradePoofGFX), $0c
call Request2bpp
xor a
@@ -860,12 +860,12 @@
ld a, $1
ld [rVBK], a
ld hl, LZ_108da7
- ld de, VTiles2
+ ld de, vTiles2
call Decompress
ld a, $0
ld [rVBK], a
ld hl, LZ_108d27
- ld de, VTiles0 tile $20
+ ld de, vTiles0 tile $20
call Decompress
call Function108c80
call Function108c6d
@@ -904,12 +904,12 @@
ld a, $1
ld [rVBK], a
ld hl, LZ_108da7
- ld de, VTiles2
+ ld de, vTiles2
call Decompress
ld a, $0
ld [rVBK], a
ld hl, LZ_108d27
- ld de, VTiles0 tile $20
+ ld de, vTiles0 tile $20
call Decompress
call Function108c80
call Function108c6d
@@ -1194,7 +1194,7 @@
call ClearSprites
call ClearTileMap
call DisableLCD
- call MobileTradeAnim_ClearVTiles
+ call MobileTradeAnim_ClearTiles
call MobileTradeAnim_ClearBGMap
call EnableLCD
call GetMobileTradeAnimByte
@@ -1223,14 +1223,14 @@
; 10895e
Function10895e: ; 10895e
- ld de, VTiles0 tile $30
+ ld de, vTiles0 tile $30
jr asm_108966
Function108963:
- ld de, VTiles2 tile $31
+ ld de, vTiles2 tile $31
asm_108966
call DelayFrame
- ld hl, VTiles2
+ ld hl, vTiles2
lb bc, $a, $31 ; $a is the bank of ?????
call Request2bpp
call WaitTop
@@ -1245,7 +1245,7 @@
; 10898a
Function10898a: ; 10898a
- ld de, VTiles2
+ ld de, vTiles2
call MobileTradeAnim_GetFrontpic
call WaitTop
call MobileTradeAnim_ClearTilemap
@@ -1297,7 +1297,7 @@
MobileTradeAnim_DisplayEggData
call WaitTop
call MobileTradeAnim_ClearTilemap
- ld a, HIGH(VBGMap1)
+ ld a, HIGH(vBGMap1)
ld [hBGMapAddress + 1], a
hlcoord 5, 0
ld b, 6
@@ -1320,7 +1320,7 @@
Function108a33: ; 108a33
call WaitTop
call MobileTradeAnim_ClearTilemap
- ld a, HIGH(VBGMap1)
+ ld a, HIGH(vBGMap1)
ld [hBGMapAddress + 1], a
hlcoord 5, 0
ld b, 6
@@ -1340,7 +1340,7 @@
MobileTradeAnim_LoadMonTemplate: ; 108a5b
call WaitTop
call MobileTradeAnim_ClearTilemap
- ld a, HIGH(VBGMap1)
+ ld a, HIGH(vBGMap1)
ld [hBGMapAddress + 1], a
hlcoord 4, 0
ld b, 6
@@ -1363,7 +1363,7 @@
MobileTradeAnim_MonDisplay_UpdateBGMap: ; 108a87
call WaitBGMap
call WaitTop
- ld a, HIGH(VBGMap0)
+ ld a, HIGH(vBGMap0)
ld [hBGMapAddress + 1], a
ret
; 108a92
@@ -1432,7 +1432,7 @@
.asm_108adf
ld a, $1
ld [rVBK], a
- ld hl, VTiles2 tile $4a
+ ld hl, vTiles2 tile $4a
lb bc, BANK(GFX_1092c7), 16
call Get2bpp_2
call DelayFrame
@@ -1698,7 +1698,7 @@
debgcoord 0, 0
call Decompress
ld hl, LZ_108fe7
- debgcoord 0, 0, VBGMap1
+ debgcoord 0, 0, vBGMap1
call Decompress
ret
; 108c80
@@ -1710,7 +1710,7 @@
debgcoord 0, 0
call Decompress
ld hl, LZ_1090a7
- debgcoord 0, 0, VBGMap1
+ debgcoord 0, 0, vBGMap1
call Decompress
ld a, $0
ld [rVBK], a
--- a/mobile/mobile_45.asm
+++ b/mobile/mobile_45.asm
@@ -4401,7 +4401,7 @@
Function1158c2: ; 1158c2
ld a, e
- ld [SwarmFlags], a
+ ld [wSwarmFlags], a
ld a, d
ld [$dc21], a
xor a
@@ -4422,7 +4422,7 @@
ld l, c
ld h, b
xor a
- ld [WeeklyFlags], a
+ ld [wWeeklyFlags], a
.asm_1158e5
ld b, $3
@@ -4447,7 +4447,7 @@
push hl
dec hl
ld a, c
- ld [WeeklyFlags], a
+ ld [wWeeklyFlags], a
.asm_115908
xor a
ld [hld], a
@@ -4468,7 +4468,7 @@
ld [$dc1a], a
push de
push hl
- ld hl, SwarmFlags
+ ld hl, wSwarmFlags
ld a, [hli]
ld h, [hl]
ld l, a
@@ -4562,7 +4562,7 @@
ld a, $a
ld [hli], a
push hl
- ld hl, SwarmFlags
+ ld hl, wSwarmFlags
ld a, [hli]
ld h, [hl]
ld l, a
@@ -4587,7 +4587,7 @@
jp nz, .asm_1158e5
.asm_1159c4
- ld a, [WeeklyFlags]
+ ld a, [wWeeklyFlags]
cp $0
jr z, .asm_1159d8
push hl
@@ -5061,9 +5061,9 @@
Function115c49: ; 115c49
ld a, e
- ld [WeeklyFlags], a
+ ld [wWeeklyFlags], a
ld a, d
- ld [SwarmFlags], a
+ ld [wSwarmFlags], a
xor a
ld [de], a
inc de
@@ -5131,7 +5131,7 @@
ld [$dc1a], a
push de
push hl
- ld hl, WeeklyFlags
+ ld hl, wWeeklyFlags
ld a, [hli]
ld h, [hl]
ld l, a
@@ -5243,9 +5243,9 @@
.asm_115d38
push de
push hl
- ld a, [WeeklyFlags]
+ ld a, [wWeeklyFlags]
ld l, a
- ld a, [SwarmFlags]
+ ld a, [wSwarmFlags]
ld h, a
ld e, [hl]
inc hl
--- a/mobile/mobile_45_sprite_engine.asm
+++ b/mobile/mobile_45_sprite_engine.asm
@@ -1,6 +1,6 @@
Function115d99: ; 115d99
ld de, GFX_11601a
- ld hl, VTiles0 tile $60
+ ld hl, vTiles0 tile $60
lb bc, BANK(GFX_11601a), $14
call Get2bpp
xor a
--- a/mobile/mobile_46.asm
+++ b/mobile/mobile_46.asm
@@ -1198,7 +1198,7 @@
ld [wcd4f], a
ld a, $1
ld [rSVBK], a
- ld a, [StatusFlags]
+ ld a, [wStatusFlags]
bit 6, a ; Hall Of Fame
jr nz, .asm_11896b
ld hl, Strings_Ll0ToL40 ; Address to list of strings with the choosable levels
--- a/mobile/mobile_5b.asm
+++ b/mobile/mobile_5b.asm
@@ -170,7 +170,7 @@
MobileSystemSplashScreen_InitGFX: ; 16c108
call DisableLCD
- ld hl, VTiles2
+ ld hl, vTiles2
ld de, .Tiles
lb bc, BANK(.Tiles), $68
call Get2bpp
@@ -708,7 +708,7 @@
; 16cc18
Function16cc18: ; 16cc18
- ld hl, VTiles1
+ ld hl, vTiles1
ld de, GFX_16cca3
lb bc, BANK(GFX_16cca3), $2e
call Get2bpp
@@ -763,7 +763,7 @@
; 16cc6e
Function16cc6e: ; 16cc6e
- hlbgcoord 0, 0, VBGMap1
+ hlbgcoord 0, 0, vBGMap1
jr Function16cc73
Function16cc73:
--- a/mobile/mobile_5c.asm
+++ b/mobile/mobile_5c.asm
@@ -273,7 +273,7 @@
ld a, $1
ld [rVBK], a
ld de, wd000
- ld hl, VTiles0
+ ld hl, vTiles0
lb bc, $6, $c1
call Get2bpp
xor a
@@ -282,7 +282,7 @@
ld de, wd000
call Decompress
ld de, UnknBGPals
- ld hl, VTiles0
+ ld hl, vTiles0
lb bc, $6, $53
call Get2bpp
pop af
@@ -295,7 +295,7 @@
ld a, $1
ld [rVBK], a
ld de, GFX_171848
- ld hl, VTiles1 tile $41
+ ld hl, vTiles1 tile $41
lb bc, BANK(GFX_171848), $18
call Get2bpp
xor a
@@ -687,11 +687,11 @@
Function171c87: ; 171c87 (5c:5c87)
call DisableLCD
ld hl, GFX_171db1
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
ld bc, $6e0
call CopyBytes
ld hl, LZ_172abd
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
call Decompress
call EnableLCD
ld hl, Tilemap_172491
@@ -759,11 +759,11 @@
Function171d2b: ; 171d2b (5c:5d2b)
call DisableLCD
ld hl, GFX_171db1
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
ld bc, $6e0
call CopyBytes
ld hl, LZ_172abd
- ld de, VTiles0 tile $00
+ ld de, vTiles0 tile $00
call Decompress
call EnableLCD
ld hl, Tilemap_172685
@@ -862,7 +862,7 @@
call ByteFill
call DisableLCD
ld hl, GameBoyN64GFX
- ld de, VTiles2 tile $00
+ ld de, vTiles2 tile $00
ld bc, $610
call CopyBytes
call EnableLCD
--- a/mobile/mobile_5e.asm
+++ b/mobile/mobile_5e.asm
@@ -738,7 +738,7 @@
ld a, $1
ld [rVBK], a
- ld hl, VTiles5 tile $00
+ ld hl, vTiles5 tile $00
ld de, GFX_17afa5
lb bc, BANK(GFX_17afa5), $80
call Get2bpp
@@ -746,12 +746,12 @@
pop af
ld [rVBK], a
- ld hl, VTiles0 tile $00
+ ld hl, vTiles0 tile $00
ld de, GFX_17afa5 + $4c0
lb bc, BANK(GFX_17afa5), 5
call Get2bpp
- ld hl, VTiles0 tile $05
+ ld hl, vTiles0 tile $05
ld de, GFX_11601a
lb bc, BANK(GFX_11601a), 4
call Get2bpp
--- a/mobile/mobile_5f.asm
+++ b/mobile/mobile_5f.asm
@@ -1,7 +1,7 @@
Function17c000: ; 17c000
call DisableLCD
- ld hl, VTiles2
+ ld hl, vTiles2
ld bc, $31 tiles
xor a
call ByteFill
@@ -56,7 +56,7 @@
ld [rSVBK], a
ld hl, MobileSelectGFX
- ld de, VTiles0 tile $30
+ ld de, vTiles0 tile $30
ld bc, $20 tiles
call CopyBytes
@@ -64,12 +64,12 @@
ld [rVBK], a
ld hl, HaveWantGFX
- ld de, VTiles2
+ ld de, vTiles2
ld bc, $80 tiles
call CopyBytes
ld hl, HaveWantGFX + $800
- ld de, VTiles1
+ ld de, vTiles1
ld bc, $10 tiles
call CopyBytes
@@ -629,7 +629,7 @@
call ClearScreen
farcall ReloadMapPart
call DisableLCD
- ld hl, VTiles1 tile $6e
+ ld hl, vTiles1 tile $6e
ld de, $c608
ld bc, 1 tiles
call CopyBytes
@@ -636,21 +636,21 @@
ld a, $1
ld [rVBK], a
ld hl, PokemonNewsGFX
- ld de, VTiles1
+ ld de, vTiles1
ld bc, $48 tiles
call CopyBytes
xor a
- ld hl, VTiles2 tile $7f
+ ld hl, vTiles2 tile $7f
ld bc, 1 tiles
call ByteFill
ld hl, $c608
- ld de, VTiles1 tile $6e
+ ld de, vTiles1 tile $6e
ld bc, 1 tiles
call CopyBytes
xor a
ld [rVBK], a
ld hl, GFX_17eb7e
- ld de, VTiles2 tile $60
+ ld de, vTiles2 tile $60
ld bc, 1 tiles
call CopyBytes
call EnableLCD
@@ -677,7 +677,7 @@
Function17d405:
call DisableLCD
- ld hl, VTiles1 tile $6e
+ ld hl, vTiles1 tile $6e
ld de, $c608
ld bc, 1 tiles
call CopyBytes
@@ -684,15 +684,15 @@
ld a, $1
ld [rVBK], a
ld hl, PokemonNewsGFX
- ld de, VTiles1
+ ld de, vTiles1
ld bc, $48 tiles
call CopyBytes
xor a
- ld hl, VTiles2 tile $7f
+ ld hl, vTiles2 tile $7f
ld bc, 1 tiles
call ByteFill
ld hl, $c608
- ld de, VTiles1 tile $6e
+ ld de, vTiles1 tile $6e
ld bc, 1 tiles
call CopyBytes
xor a
@@ -1531,7 +1531,7 @@
ld a, [$c709]
ld d, a
push de
- ld de, VTiles2
+ ld de, vTiles2
farcall GetTrainerPic
pop hl
decoord 0, 0
@@ -2952,7 +2952,7 @@
ld [wcf66], a
farcall Function118233
ld de, GFX_17eb7e
- ld hl, VTiles2 tile $60
+ ld hl, vTiles2 tile $60
lb bc, BANK(GFX_17eb7e), 1
call Get2bpp
ld a, [wc300]
--- a/mobile/mobile_menu.asm
+++ b/mobile/mobile_menu.asm
@@ -628,7 +628,7 @@
Function4a485: ; 4a485 (12:6485)
ld de, GFX_49c0c
- ld hl, VTiles2 tile $00
+ ld hl, vTiles2 tile $00
lb bc, BANK(GFX_49c0c), 13
call Get2bpp
ret
--- a/tilesets/animations.asm
+++ b/tilesets/animations.asm
@@ -37,7 +37,7 @@
Tileset0Anim: ; 0xfc01b
TilesetJohto2Anim: ; 0xfc01b
TilesetKantoAnim: ; 0xfc01b
- dw VTiles2 tile $14, AnimateWaterTile
+ dw vTiles2 tile $14, AnimateWaterTile
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
@@ -51,9 +51,9 @@
; 0xfc047
TilesetParkAnim: ; 0xfc047
- dw VTiles2 tile $14, AnimateWaterTile
+ dw vTiles2 tile $14, AnimateWaterTile
dw NULL, WaitTileAnimation
- dw VTiles2 tile $5f, AnimateFountain
+ dw vTiles2 tile $5f, AnimateFountain
dw NULL, WaitTileAnimation
dw NULL, TileAnimationPalette
dw NULL, WaitTileAnimation
@@ -73,7 +73,7 @@
dw NULL, ForestTreeLeftAnimation2
dw NULL, ForestTreeRightAnimation2
dw NULL, AnimateFlowerTile
- dw VTiles2 tile $14, AnimateWaterTile
+ dw vTiles2 tile $14, AnimateWaterTile
dw NULL, TileAnimationPalette
dw NULL, StandingTileFrame8
dw NULL, DoneTileAnimation
@@ -80,7 +80,7 @@
; 0xfc0a3
TilesetJohto1Anim: ; 0xfc0a3
- dw VTiles2 tile $14, AnimateWaterTile
+ dw vTiles2 tile $14, AnimateWaterTile
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
dw NULL, TileAnimationPalette
@@ -96,9 +96,9 @@
; 0xfc0d7
TilesetAnimfc0d7: ; 0xfc0d7
- dw VTiles2 tile $03, WriteTileToBuffer
+ dw vTiles2 tile $03, WriteTileToBuffer
dw wTileAnimBuffer, ScrollTileRightLeft
- dw VTiles2 tile $03, WriteTileFromBuffer
+ dw vTiles2 tile $03, WriteTileFromBuffer
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
@@ -110,9 +110,9 @@
; 0xfc103
TilesetAnimfc103: ; 0xfc103
- dw VTiles2 tile $14, WriteTileToBuffer
+ dw vTiles2 tile $14, WriteTileToBuffer
dw wTileAnimBuffer, ScrollTileRightLeft
- dw VTiles2 tile $14, WriteTileFromBuffer
+ dw vTiles2 tile $14, WriteTileFromBuffer
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
@@ -124,7 +124,7 @@
; 0xfc12f
TilesetPortAnim: ; 0xfc12f
- dw VTiles2 tile $14, AnimateWaterTile
+ dw vTiles2 tile $14, AnimateWaterTile
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
@@ -150,48 +150,48 @@
; 0xfc17f
TilesetAnimfc17f: ; 0xfc17f
- dw VTiles2 tile $53, WriteTileToBuffer
+ dw vTiles2 tile $53, WriteTileToBuffer
dw wTileAnimBuffer, ScrollTileDown
dw wTileAnimBuffer, ScrollTileDown
- dw VTiles2 tile $53, WriteTileFromBuffer
- dw VTiles2 tile $03, WriteTileToBuffer
+ dw vTiles2 tile $53, WriteTileFromBuffer
+ dw vTiles2 tile $03, WriteTileToBuffer
dw wTileAnimBuffer, ScrollTileRightLeft
- dw VTiles2 tile $03, WriteTileFromBuffer
- dw VTiles2 tile $53, WriteTileToBuffer
+ dw vTiles2 tile $03, WriteTileFromBuffer
+ dw vTiles2 tile $53, WriteTileToBuffer
dw wTileAnimBuffer, ScrollTileDown
dw wTileAnimBuffer, ScrollTileDown
- dw VTiles2 tile $53, WriteTileFromBuffer
+ dw vTiles2 tile $53, WriteTileFromBuffer
dw NULL, DoneTileAnimation
; 0xfc1af
TilesetAnimfc1af: ; 0xfc1af
- dw VTiles2 tile $54, WriteTileToBuffer
+ dw vTiles2 tile $54, WriteTileToBuffer
dw wTileAnimBuffer, ScrollTileDown
dw wTileAnimBuffer, ScrollTileDown
- dw VTiles2 tile $54, WriteTileFromBuffer
+ dw vTiles2 tile $54, WriteTileFromBuffer
dw NULL, WaitTileAnimation
- dw VTiles2 tile $03, WriteTileToBuffer
+ dw vTiles2 tile $03, WriteTileToBuffer
dw wTileAnimBuffer, ScrollTileRightLeft
- dw VTiles2 tile $03, WriteTileFromBuffer
+ dw vTiles2 tile $03, WriteTileFromBuffer
dw NULL, WaitTileAnimation
- dw VTiles2 tile $54, WriteTileToBuffer
+ dw vTiles2 tile $54, WriteTileToBuffer
dw wTileAnimBuffer, ScrollTileDown
dw wTileAnimBuffer, ScrollTileDown
- dw VTiles2 tile $54, WriteTileFromBuffer
+ dw vTiles2 tile $54, WriteTileFromBuffer
dw NULL, DoneTileAnimation
; 0xfc1e7
TilesetCaveAnim: ; 0xfc1e7
TilesetWhirlIslandsAnim: ; 0xfc1e7
- dw VTiles2 tile $14, WriteTileToBuffer
+ dw vTiles2 tile $14, WriteTileToBuffer
dw NULL, FlickeringCaveEntrancePalette
dw wTileAnimBuffer, ScrollTileRightLeft
dw NULL, FlickeringCaveEntrancePalette
- dw VTiles2 tile $14, WriteTileFromBuffer
+ dw vTiles2 tile $14, WriteTileFromBuffer
dw NULL, FlickeringCaveEntrancePalette
dw NULL, TileAnimationPalette
dw NULL, FlickeringCaveEntrancePalette
- dw VTiles2 tile $40, WriteTileToBuffer
+ dw vTiles2 tile $40, WriteTileToBuffer
dw NULL, FlickeringCaveEntrancePalette
dw wTileAnimBuffer, ScrollTileDown
dw NULL, FlickeringCaveEntrancePalette
@@ -199,21 +199,21 @@
dw NULL, FlickeringCaveEntrancePalette
dw wTileAnimBuffer, ScrollTileDown
dw NULL, FlickeringCaveEntrancePalette
- dw VTiles2 tile $40, WriteTileFromBuffer
+ dw vTiles2 tile $40, WriteTileFromBuffer
dw NULL, FlickeringCaveEntrancePalette
dw NULL, DoneTileAnimation
; 0xfc233
TilesetIcePathAnim: ; 0xfc233
- dw VTiles2 tile $35, WriteTileToBuffer
+ dw vTiles2 tile $35, WriteTileToBuffer
dw NULL, FlickeringCaveEntrancePalette
dw wTileAnimBuffer, ScrollTileRightLeft
dw NULL, FlickeringCaveEntrancePalette
- dw VTiles2 tile $35, WriteTileFromBuffer
+ dw vTiles2 tile $35, WriteTileFromBuffer
dw NULL, FlickeringCaveEntrancePalette
dw NULL, TileAnimationPalette
dw NULL, FlickeringCaveEntrancePalette
- dw VTiles2 tile $31, WriteTileToBuffer
+ dw vTiles2 tile $31, WriteTileToBuffer
dw NULL, FlickeringCaveEntrancePalette
dw wTileAnimBuffer, ScrollTileDown
dw NULL, FlickeringCaveEntrancePalette
@@ -221,7 +221,7 @@
dw NULL, FlickeringCaveEntrancePalette
dw wTileAnimBuffer, ScrollTileDown
dw NULL, FlickeringCaveEntrancePalette
- dw VTiles2 tile $31, WriteTileFromBuffer
+ dw vTiles2 tile $31, WriteTileFromBuffer
dw NULL, FlickeringCaveEntrancePalette
dw NULL, DoneTileAnimation
; 0xfc27f
@@ -246,9 +246,9 @@
; 0xfc2bf
TilesetAnimfc2bf: ; 0xfc2bf
- dw VTiles2 tile $4f, WriteTileToBuffer
+ dw vTiles2 tile $4f, WriteTileToBuffer
dw wTileAnimBuffer, ScrollTileRightLeft
- dw VTiles2 tile $4f, WriteTileFromBuffer
+ dw vTiles2 tile $4f, WriteTileFromBuffer
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation
@@ -521,7 +521,7 @@
.asm_fc47d
ld sp, hl
- ld hl, VTiles2 tile $0c
+ ld hl, vTiles2 tile $0c
jp WriteTile
; fc484
@@ -567,7 +567,7 @@
.asm_fc4eb
ld sp, hl
- ld hl, VTiles2 tile $0f
+ ld hl, vTiles2 tile $0f
jp WriteTile
; fc4f2
@@ -599,7 +599,7 @@
.asm_fc515
ld sp, hl
- ld hl, VTiles2 tile $0c
+ ld hl, vTiles2 tile $0c
jp WriteTile
; fc51c
@@ -635,7 +635,7 @@
.asm_fc545
ld sp, hl
- ld hl, VTiles2 tile $0f
+ ld hl, vTiles2 tile $0f
jp WriteTile
; fc54c
@@ -691,7 +691,7 @@
add hl, de
ld sp, hl
- ld hl, VTiles2 + $30 ; tile 4
+ ld hl, vTiles2 + $30 ; tile 4
jp WriteTile
; fc58c
@@ -721,7 +721,7 @@
ld hl, SafariFountainFrames
add hl, de
ld sp, hl
- ld hl, VTiles2 tile $5b
+ ld hl, vTiles2 tile $5b
jp WriteTile
; fc5eb
@@ -741,7 +741,7 @@
ld hl, SafariFountainFrames
add hl, de
ld sp, hl
- ld hl, VTiles2 tile $38
+ ld hl, vTiles2 tile $38
jp WriteTile
; fc605
@@ -1025,16 +1025,16 @@
; fc750
-SproutPillarTilePointer1: dw VTiles2 tile $2d, SproutPillarTile1
-SproutPillarTilePointer2: dw VTiles2 tile $2f, SproutPillarTile2
-SproutPillarTilePointer3: dw VTiles2 tile $3d, SproutPillarTile3
-SproutPillarTilePointer4: dw VTiles2 tile $3f, SproutPillarTile4
-SproutPillarTilePointer5: dw VTiles2 tile $3c, SproutPillarTile5
-SproutPillarTilePointer6: dw VTiles2 tile $2c, SproutPillarTile6
-SproutPillarTilePointer7: dw VTiles2 tile $4d, SproutPillarTile7
-SproutPillarTilePointer8: dw VTiles2 tile $4f, SproutPillarTile8
-SproutPillarTilePointer9: dw VTiles2 tile $5d, SproutPillarTile9
-SproutPillarTilePointer10: dw VTiles2 tile $5f, SproutPillarTile10
+SproutPillarTilePointer1: dw vTiles2 tile $2d, SproutPillarTile1
+SproutPillarTilePointer2: dw vTiles2 tile $2f, SproutPillarTile2
+SproutPillarTilePointer3: dw vTiles2 tile $3d, SproutPillarTile3
+SproutPillarTilePointer4: dw vTiles2 tile $3f, SproutPillarTile4
+SproutPillarTilePointer5: dw vTiles2 tile $3c, SproutPillarTile5
+SproutPillarTilePointer6: dw vTiles2 tile $2c, SproutPillarTile6
+SproutPillarTilePointer7: dw vTiles2 tile $4d, SproutPillarTile7
+SproutPillarTilePointer8: dw vTiles2 tile $4f, SproutPillarTile8
+SproutPillarTilePointer9: dw vTiles2 tile $5d, SproutPillarTile9
+SproutPillarTilePointer10: dw vTiles2 tile $5f, SproutPillarTile10
SproutPillarTile1: INCBIN "gfx/tilesets/sprout-pillar/1.2bpp"
SproutPillarTile2: INCBIN "gfx/tilesets/sprout-pillar/2.2bpp"
@@ -1049,10 +1049,10 @@
; fca98
-WhirlpoolFrames1: dw VTiles2 tile $32, WhirlpoolTiles1
-WhirlpoolFrames2: dw VTiles2 tile $33, WhirlpoolTiles2
-WhirlpoolFrames3: dw VTiles2 tile $42, WhirlpoolTiles3
-WhirlpoolFrames4: dw VTiles2 tile $43, WhirlpoolTiles4
+WhirlpoolFrames1: dw vTiles2 tile $32, WhirlpoolTiles1
+WhirlpoolFrames2: dw vTiles2 tile $33, WhirlpoolTiles2
+WhirlpoolFrames3: dw vTiles2 tile $42, WhirlpoolTiles3
+WhirlpoolFrames4: dw vTiles2 tile $43, WhirlpoolTiles4
; fcaa8
WhirlpoolTiles1: INCBIN "gfx/tilesets/whirlpool/1.2bpp"
--- a/tilesets/roofs.asm
+++ b/tilesets/roofs.asm
@@ -10,7 +10,7 @@
ld hl, Roofs
ld bc, $90
call AddNTimes
- ld de, VTiles2 tile $0a
+ ld de, vTiles2 tile $0a
ld bc, $90
call CopyBytes
ret
--- a/tilesets/tilesets.asm
+++ b/tilesets/tilesets.asm
@@ -1,9 +1,9 @@
-tileset: macro
+tileset: MACRO
dba \1GFX, \1Meta, \1Coll
dw \1Anim
dw NULL
dw \1PalMap
-endm
+ENDM
Tilesets:: ; 4d596
; entries correspond to TILESET_* constants
--- a/vram.asm
+++ b/vram.asm
@@ -1,16 +1,16 @@
SECTION "VRAM0", VRAM
-VTiles0:: ds $800
-VTiles1:: ds $800
-VTiles2:: ds $800
-VBGMap0:: ds $400
-VBGMap1:: ds $400
+vTiles0:: ds $800
+vTiles1:: ds $800
+vTiles2:: ds $800
+vBGMap0:: ds $400
+vBGMap1:: ds $400
SECTION "VRAM1", VRAM
-VTiles3:: ds $800
-VTiles4:: ds $800
-VTiles5:: ds $800
-VBGMap2:: ds $400
-VBGMap3:: ds $400
+vTiles3:: ds $800
+vTiles4:: ds $800
+vTiles5:: ds $800
+vBGMap2:: ds $400
+vBGMap3:: ds $400
--- a/wram.asm
+++ b/wram.asm
@@ -212,7 +212,7 @@
UNION ; c300
; wSpriteAnimDict is a 10x2 dictionary
; keys: taken from third column of SpriteAnimSeqData
-; values: VTiles
+; values: vTiles
wSpriteAnimDict:: ds 10 * 2
wSpriteAnimationStructs::
@@ -1320,6 +1320,7 @@
; miscellaneous
wNrOfBeatenBattleTowerTrainers::
wMomBankDigitCursorPosition::
+wSlotsDelay::
db
wCurrPocket::
wPrinterQueueLength::
@@ -1431,7 +1432,7 @@
wcfbb:: db
-GameTimerPause:: ; cfbc
+wGameTimerPause:: ; cfbc
; bit 0
db
@@ -1629,10 +1630,9 @@
; miscellaneous
wTempDayOfWeek::
wApricorns::
+wKeepSevenBiasChance:: ; used in the slots to handle the favoring of 7 symbol streaks
db
-
ds 2
-
StartFlypoint:: db
EndFlypoint:: db
@@ -2238,7 +2238,7 @@
wMapStatusEnd:: ds 2 ; d470
wCrystalData::
-PlayerGender:: ; d472
+wPlayerGender:: ; d472
; bit 0:
; 0 male
; 1 female
@@ -2348,7 +2348,7 @@
ds 1
wSecretID:: dw
-StatusFlags:: ; d84c
+wStatusFlags:: ; d84c
; 0 - pokedex
; 1 - unown dex
; 2 -
@@ -2359,7 +2359,7 @@
; 7 - bug contest on
db
-StatusFlags2:: ; d84d
+wStatusFlags2:: ; d84d
; 0 - rockets
; 1 -
; 2 - bug contest timer
@@ -2377,8 +2377,8 @@
Coins:: dw ; d855
Badges::
-JohtoBadges:: flag_array NUM_JOHTO_BADGES ; d857
-KantoBadges:: flag_array NUM_KANTO_BADGES ; d858
+wJohtoBadges:: flag_array NUM_JOHTO_BADGES ; d857
+wKantoBadges:: flag_array NUM_KANTO_BADGES ; d858
TMsHMs:: ds NUM_TMS + NUM_HMS ; d859
@@ -2557,7 +2557,7 @@
ds 1
-BikeFlags:: ; dbf5
+wBikeFlags:: ; dbf5
; bit 0: using strength
; bit 1: always on bike
; bit 2: downhill
@@ -2599,9 +2599,9 @@
MomItemTriggerBalance:: ds 3 ; dc19
wDailyResetTimer:: dw ; dc1c
-DailyFlags:: db
-WeeklyFlags:: db
-SwarmFlags:: db
+wDailyFlags:: db
+wWeeklyFlags:: db
+wSwarmFlags:: db
ds 2
wStartDay:: db
ds 3
@@ -2660,7 +2660,7 @@
wMapData::
-VisitedSpawns:: flag_array NUM_SPAWNS ; dca5
+wVisitedSpawns:: flag_array NUM_SPAWNS ; dca5
wDigWarpNumber:: db ; dcaa
wDigMapGroup:: db ; dcab
@@ -2717,7 +2717,7 @@
EndPokedexSeen::
UnownDex:: ds NUM_UNOWN ; ded9
-UnlockedUnowns:: db ; def3
+wUnlockedUnowns:: db ; def3
wFirstUnownSeen:: db
wDayCareMan:: ; def5