ref: af205a72170526ea098da0e4e7b013ecad74af8e
parent: 3a24cff5eb7ae82b6f9ee8ac24e64496adab7a7e
author: yenatch <[email protected]>
date: Fri Aug 23 12:06:43 EDT 2013
BitTable2 -> EngineFlags
--- a/engine/bittable2.asm
+++ /dev/null
@@ -1,198 +1,0 @@
-; All locations are in WRAM bank 1.
-
- ; location, bit
-
- ; pokegear
- dwb $d957, %00000010 ; radio card
- dwb $d957, %00000001 ; map card
- dwb $d957, %00000100 ; phone card
- dwb $d957, %00001000 ; expn card
- dwb $d957, %10000000 ; on/off
-
- ; DaycareMan, %10000000 ; daycare 1 on
- dwb DaycareMan, %01000000 ; monster 1 and 2 are compatible
- ; DaycareMan, %00100000 ; egg is ready
- dwb DaycareMan, %00000001 ; monster 1 in daycare
-
- ; DaycareLady, %10000000 = daycare 2 on
- dwb DaycareLady, %00000001 ; monster 2 in daycare
-
- dwb $d854, %00000001 ; mom saving money
- dwb $d854, %10000000 ; dst
-
- dwb $dc39, %00000001
-
- dwb $d84c, %00000001 ; pokedex
- dwb $d84c, %00000010 ; unown dex
- dwb $d84c, %00001000 ; pokerus
- dwb $d84c, %00010000 ; rocket signal on ch20
- dwb $d84c, %01000000 ; credits skip
- dwb $d84c, %10000000 ; bug contest on
- dwb $d84d, %00000100 ; bug contest timer
- dwb $d84d, %00000010 ; rockets in radio tower
- dwb $d84d, %00000001 ; bike shop call enabled (1024 bike steps reqd)
- dwb $d84d, %00010000
- dwb $d84d, %00100000 ; give pokerus; berry -> berry juice when trading?
- dwb $d84d, %01000000
- dwb $d84d, %10000000 ; rockets in mahogany
-
- dwb $dbf5, %00000001 ; strength active
- dwb $dbf5, %00000010 ; always on bike (cant surf)
- dwb $dbf5, %00000100 ; downhill (cycling road)
-
- dwb JohtoBadges, %00000001 ; zephyrbadge
- dwb JohtoBadges, %00000010 ; hivebadge
- dwb JohtoBadges, %00000100 ; plainbadge
- dwb JohtoBadges, %00001000 ; fogbadge
- dwb JohtoBadges, %00010000 ; mineralbadge
- dwb JohtoBadges, %00100000 ; stormbadge
- dwb JohtoBadges, %01000000 ; glacierbadge
- dwb JohtoBadges, %10000000 ; risingbadge
-
- dwb KantoBadges, %00000001 ; boulderbadge
- dwb KantoBadges, %00000010 ; cascadebadge
- dwb KantoBadges, %00000100 ; thunderbadge
- dwb KantoBadges, %00001000 ; rainbowbadge
- dwb KantoBadges, %00010000 ; soulbadge
- dwb KantoBadges, %00100000 ; marshbadge
- dwb KantoBadges, %01000000 ; volcanobadge
- dwb KantoBadges, %10000000 ; earthbadge
-
- ; unown sets
- dwb UnlockedUnowns, %00000001 ; 1
- dwb UnlockedUnowns, %00000010 ; 2
- dwb UnlockedUnowns, %00000100 ; 3
- dwb UnlockedUnowns, %00001000 ; 4
- dwb UnlockedUnowns, %00010000 ; 5
- dwb UnlockedUnowns, %00100000 ; 6
- dwb UnlockedUnowns, %01000000 ; 7
- dwb UnlockedUnowns, %10000000 ; 8
-
- ; fly
- dwb FlypointPerms, %00000001 ; your house
- dwb FlypointPerms, %00000010 ; viridian pokecenter
- dwb FlypointPerms, %00000100 ; pallet
- dwb FlypointPerms, %00001000 ; viridian
- dwb FlypointPerms, %00010000 ; pewter
- dwb FlypointPerms, %00100000 ; cerulean
- dwb FlypointPerms, %01000000 ; rock tunnel
- dwb FlypointPerms, %10000000 ; vermilion
- dwb FlypointPerms + 1, %00000001 ; lavender
- dwb FlypointPerms + 1, %00000010 ; saffron
- dwb FlypointPerms + 1, %00000100 ; celadon
- dwb FlypointPerms + 1, %00001000 ; fuchsia
- dwb FlypointPerms + 1, %00010000 ; cinnabar
- dwb FlypointPerms + 1, %00100000 ; indigo plateau
- dwb FlypointPerms + 1, %01000000 ; new bark
- dwb FlypointPerms + 1, %10000000 ; cherrygrove
- dwb FlypointPerms + 2, %00000001 ; violet
- dwb FlypointPerms + 2, %00000100 ; azalea
- dwb FlypointPerms + 2, %00001000 ; cianwood
- dwb FlypointPerms + 2, %00010000 ; goldenrod
- dwb FlypointPerms + 2, %00100000 ; olivine
- dwb FlypointPerms + 2, %01000000 ; ecruteak
- dwb FlypointPerms + 2, %10000000 ; mahogany
- dwb FlypointPerms + 3, %00000001 ; lake of rage
- dwb FlypointPerms + 3, %00000010 ; blackthorn
- dwb FlypointPerms + 3, %00000100 ; silver cave
- dwb FlypointPerms + 3, %00010000 ; unused
-
- dwb $dc9d, %00000001 ; lucky number show
- dwb $d84d, %00001000
-
- dwb $dc1e, %00000001 ; kurt making balls
- dwb $dc1e, %00000010
- dwb $dc1e, %00000100 ; special wilddata?
- dwb $dc1e, %00001000 ; time capsule (24h wait)
- dwb $dc1e, %00010000 ; all fruit trees
- dwb $dc1e, %00100000 ; shuckle given
- dwb $dc1e, %01000000 ; goldenrod underground merchant closed
- dwb $dc1e, %10000000 ; fought in trainer hall today
-
- dwb $dc1f, %00000001 ; mt moon square clefairy
- dwb $dc1f, %00000010 ; union cave lapras
- dwb $dc1f, %00000100 ; goldenrod underground haircut used
- dwb $dc1f, %00001000 ; goldenrod mall happiness event floor05 person07
- dwb $dc1f, %00010000 ; tea in blues house
- dwb $dc1f, %00100000 ; indigo plateau rival fight
- dwb $dc1f, %01000000
- dwb $dc1f, %10000000
-
- dwb $dc20, %00000001 ; $60
- dwb $dc20, %00000010 ; goldenrod dept store sale is on
-
- dwb $cfbc, %10000000 ; $62
-
- dwb PlayerGender, %00000001 ; player is female
-
- dwb $dbf3, %00000100 ; have gs ball after kurt examined it
-
- ; rematches
- dwb $dc4c, %00000001 ; jack
- dwb $dc4c, %00000010 ; huey
- dwb $dc4c, %00000100 ; gaven
- dwb $dc4c, %00001000 ; beth
- dwb $dc4c, %00010000 ; jose
- dwb $dc4c, %00100000 ; reena
- dwb $dc4c, %01000000 ; joey
- dwb $dc4c, %10000000 ; wade
- dwb $dc4d, %00000001 ; ralph
- dwb $dc4d, %00000010 ; liz
- dwb $dc4d, %00000100 ; anthony
- dwb $dc4d, %00001000 ; todd
- dwb $dc4d, %00010000 ; gina
- dwb $dc4d, %00100000 ; arnie
- dwb $dc4d, %01000000 ; alan
- dwb $dc4d, %10000000 ; dana
- dwb $dc4e, %00000001 ; chad
- dwb $dc4e, %00000010 ; tully
- dwb $dc4e, %00000100 ; brent
- dwb $dc4e, %00001000 ; tiffany
- dwb $dc4e, %00010000 ; vance
- dwb $dc4e, %00100000 ; wilton
- dwb $dc4e, %01000000 ; parry
- dwb $dc4e, %10000000 ; erin
-
- dwb $dc50, %00000001 ; beverly has nugget
- dwb $dc50, %00000010 ; jose has star piece
- dwb $dc50, %00000100 ; wade has item (see bittable1 $032b-e)
- dwb $dc50, %00001000 ; gina has leaf stone
- dwb $dc50, %00010000 ; alan has fire stone
- dwb $dc50, %00100000 ; liz has thunderstone
- dwb $dc50, %01000000 ; derek has nugget
- dwb $dc50, %10000000 ; tully has water stone
-
- dwb $dc51, %00000001 ; tiffany has pink bow
- dwb $dc51, %00000010 ; wilton has item (see bittable1 $032f-31)
-
- dwb $dc54, %00000001
- dwb $dc54, %00000010
- dwb $dc54, %00000100
- dwb $dc54, %00001000
- dwb $dc54, %00010000
- dwb $dc54, %00100000
- dwb $dc54, %01000000
- dwb $dc54, %10000000
-
- dwb $dc55, %00000001
- dwb $dc55, %00000010
- dwb $dc55, %00000100
- dwb $dc55, %00001000
- dwb $dc55, %00010000
- dwb $dc55, %00100000
- dwb $dc55, %01000000
- dwb $dc55, %10000000
-
- dwb $dc56, %00000001
- dwb $dc56, %00000010
- dwb $dc56, %00000100
- dwb $dc56, %00001000
- dwb $dc56, %00010000
- dwb $dc56, %00100000
- dwb $dc56, %01000000
- dwb $dc56, %10000000
-
- dwb $d45b, %00000100 ; female player has been transformed into male
-
- dwb $dc20, %00000100 ; dunsparce swarm
- dwb $dc20, %00001000 ; yanma swarm
--- /dev/null
+++ b/engine/engine_flags.asm
@@ -1,0 +1,198 @@
+; All locations are in WRAM bank 1.
+
+ ; location, bit
+
+ ; pokegear
+ dwb $d957, %00000010 ; radio card
+ dwb $d957, %00000001 ; map card
+ dwb $d957, %00000100 ; phone card
+ dwb $d957, %00001000 ; expn card
+ dwb $d957, %10000000 ; on/off
+
+ ; DaycareMan, %10000000 ; daycare 1 on
+ dwb DaycareMan, %01000000 ; monster 1 and 2 are compatible
+ ; DaycareMan, %00100000 ; egg is ready
+ dwb DaycareMan, %00000001 ; monster 1 in daycare
+
+ ; DaycareLady, %10000000 = daycare 2 on
+ dwb DaycareLady, %00000001 ; monster 2 in daycare
+
+ dwb $d854, %00000001 ; mom saving money
+ dwb $d854, %10000000 ; dst
+
+ dwb $dc39, %00000001
+
+ dwb $d84c, %00000001 ; pokedex
+ dwb $d84c, %00000010 ; unown dex
+ dwb $d84c, %00001000 ; pokerus
+ dwb $d84c, %00010000 ; rocket signal on ch20
+ dwb $d84c, %01000000 ; credits skip
+ dwb $d84c, %10000000 ; bug contest on
+ dwb $d84d, %00000100 ; bug contest timer
+ dwb $d84d, %00000010 ; rockets in radio tower
+ dwb $d84d, %00000001 ; bike shop call enabled (1024 bike steps reqd)
+ dwb $d84d, %00010000
+ dwb $d84d, %00100000 ; give pokerus; berry -> berry juice when trading?
+ dwb $d84d, %01000000
+ dwb $d84d, %10000000 ; rockets in mahogany
+
+ dwb $dbf5, %00000001 ; strength active
+ dwb $dbf5, %00000010 ; always on bike (cant surf)
+ dwb $dbf5, %00000100 ; downhill (cycling road)
+
+ dwb JohtoBadges, %00000001 ; zephyrbadge
+ dwb JohtoBadges, %00000010 ; hivebadge
+ dwb JohtoBadges, %00000100 ; plainbadge
+ dwb JohtoBadges, %00001000 ; fogbadge
+ dwb JohtoBadges, %00010000 ; mineralbadge
+ dwb JohtoBadges, %00100000 ; stormbadge
+ dwb JohtoBadges, %01000000 ; glacierbadge
+ dwb JohtoBadges, %10000000 ; risingbadge
+
+ dwb KantoBadges, %00000001 ; boulderbadge
+ dwb KantoBadges, %00000010 ; cascadebadge
+ dwb KantoBadges, %00000100 ; thunderbadge
+ dwb KantoBadges, %00001000 ; rainbowbadge
+ dwb KantoBadges, %00010000 ; soulbadge
+ dwb KantoBadges, %00100000 ; marshbadge
+ dwb KantoBadges, %01000000 ; volcanobadge
+ dwb KantoBadges, %10000000 ; earthbadge
+
+ ; unown sets
+ dwb UnlockedUnowns, %00000001 ; 1
+ dwb UnlockedUnowns, %00000010 ; 2
+ dwb UnlockedUnowns, %00000100 ; 3
+ dwb UnlockedUnowns, %00001000 ; 4
+ dwb UnlockedUnowns, %00010000 ; 5
+ dwb UnlockedUnowns, %00100000 ; 6
+ dwb UnlockedUnowns, %01000000 ; 7
+ dwb UnlockedUnowns, %10000000 ; 8
+
+ ; fly
+ dwb FlypointPerms, %00000001 ; your house
+ dwb FlypointPerms, %00000010 ; viridian pokecenter
+ dwb FlypointPerms, %00000100 ; pallet
+ dwb FlypointPerms, %00001000 ; viridian
+ dwb FlypointPerms, %00010000 ; pewter
+ dwb FlypointPerms, %00100000 ; cerulean
+ dwb FlypointPerms, %01000000 ; rock tunnel
+ dwb FlypointPerms, %10000000 ; vermilion
+ dwb FlypointPerms + 1, %00000001 ; lavender
+ dwb FlypointPerms + 1, %00000010 ; saffron
+ dwb FlypointPerms + 1, %00000100 ; celadon
+ dwb FlypointPerms + 1, %00001000 ; fuchsia
+ dwb FlypointPerms + 1, %00010000 ; cinnabar
+ dwb FlypointPerms + 1, %00100000 ; indigo plateau
+ dwb FlypointPerms + 1, %01000000 ; new bark
+ dwb FlypointPerms + 1, %10000000 ; cherrygrove
+ dwb FlypointPerms + 2, %00000001 ; violet
+ dwb FlypointPerms + 2, %00000100 ; azalea
+ dwb FlypointPerms + 2, %00001000 ; cianwood
+ dwb FlypointPerms + 2, %00010000 ; goldenrod
+ dwb FlypointPerms + 2, %00100000 ; olivine
+ dwb FlypointPerms + 2, %01000000 ; ecruteak
+ dwb FlypointPerms + 2, %10000000 ; mahogany
+ dwb FlypointPerms + 3, %00000001 ; lake of rage
+ dwb FlypointPerms + 3, %00000010 ; blackthorn
+ dwb FlypointPerms + 3, %00000100 ; silver cave
+ dwb FlypointPerms + 3, %00010000 ; unused
+
+ dwb $dc9d, %00000001 ; lucky number show
+ dwb $d84d, %00001000
+
+ dwb $dc1e, %00000001 ; kurt making balls
+ dwb $dc1e, %00000010
+ dwb $dc1e, %00000100 ; special wilddata?
+ dwb $dc1e, %00001000 ; time capsule (24h wait)
+ dwb $dc1e, %00010000 ; all fruit trees
+ dwb $dc1e, %00100000 ; shuckle given
+ dwb $dc1e, %01000000 ; goldenrod underground merchant closed
+ dwb $dc1e, %10000000 ; fought in trainer hall today
+
+ dwb $dc1f, %00000001 ; mt moon square clefairy
+ dwb $dc1f, %00000010 ; union cave lapras
+ dwb $dc1f, %00000100 ; goldenrod underground haircut used
+ dwb $dc1f, %00001000 ; goldenrod mall happiness event floor05 person07
+ dwb $dc1f, %00010000 ; tea in blues house
+ dwb $dc1f, %00100000 ; indigo plateau rival fight
+ dwb $dc1f, %01000000
+ dwb $dc1f, %10000000
+
+ dwb $dc20, %00000001 ; $60
+ dwb $dc20, %00000010 ; goldenrod dept store sale is on
+
+ dwb $cfbc, %10000000 ; $62
+
+ dwb PlayerGender, %00000001 ; player is female
+
+ dwb $dbf3, %00000100 ; have gs ball after kurt examined it
+
+ ; rematches
+ dwb $dc4c, %00000001 ; jack
+ dwb $dc4c, %00000010 ; huey
+ dwb $dc4c, %00000100 ; gaven
+ dwb $dc4c, %00001000 ; beth
+ dwb $dc4c, %00010000 ; jose
+ dwb $dc4c, %00100000 ; reena
+ dwb $dc4c, %01000000 ; joey
+ dwb $dc4c, %10000000 ; wade
+ dwb $dc4d, %00000001 ; ralph
+ dwb $dc4d, %00000010 ; liz
+ dwb $dc4d, %00000100 ; anthony
+ dwb $dc4d, %00001000 ; todd
+ dwb $dc4d, %00010000 ; gina
+ dwb $dc4d, %00100000 ; arnie
+ dwb $dc4d, %01000000 ; alan
+ dwb $dc4d, %10000000 ; dana
+ dwb $dc4e, %00000001 ; chad
+ dwb $dc4e, %00000010 ; tully
+ dwb $dc4e, %00000100 ; brent
+ dwb $dc4e, %00001000 ; tiffany
+ dwb $dc4e, %00010000 ; vance
+ dwb $dc4e, %00100000 ; wilton
+ dwb $dc4e, %01000000 ; parry
+ dwb $dc4e, %10000000 ; erin
+
+ dwb $dc50, %00000001 ; beverly has nugget
+ dwb $dc50, %00000010 ; jose has star piece
+ dwb $dc50, %00000100 ; wade has item (see bittable1 $032b-e)
+ dwb $dc50, %00001000 ; gina has leaf stone
+ dwb $dc50, %00010000 ; alan has fire stone
+ dwb $dc50, %00100000 ; liz has thunderstone
+ dwb $dc50, %01000000 ; derek has nugget
+ dwb $dc50, %10000000 ; tully has water stone
+
+ dwb $dc51, %00000001 ; tiffany has pink bow
+ dwb $dc51, %00000010 ; wilton has item (see bittable1 $032f-31)
+
+ dwb $dc54, %00000001
+ dwb $dc54, %00000010
+ dwb $dc54, %00000100
+ dwb $dc54, %00001000
+ dwb $dc54, %00010000
+ dwb $dc54, %00100000
+ dwb $dc54, %01000000
+ dwb $dc54, %10000000
+
+ dwb $dc55, %00000001
+ dwb $dc55, %00000010
+ dwb $dc55, %00000100
+ dwb $dc55, %00001000
+ dwb $dc55, %00010000
+ dwb $dc55, %00100000
+ dwb $dc55, %01000000
+ dwb $dc55, %10000000
+
+ dwb $dc56, %00000001
+ dwb $dc56, %00000010
+ dwb $dc56, %00000100
+ dwb $dc56, %00001000
+ dwb $dc56, %00010000
+ dwb $dc56, %00100000
+ dwb $dc56, %01000000
+ dwb $dc56, %10000000
+
+ dwb $d45b, %00000100 ; female player has been transformed into male
+
+ dwb $dc20, %00000100 ; dunsparce swarm
+ dwb $dc20, %00001000 ; yanma swarm
--- a/main.asm
+++ b/main.asm
@@ -7343,7 +7343,7 @@
Function2ead: ; 2ead
ld de, $000b
ld b, $2
- callba GetFlag2
+ callba EngineFlagAction
ld a, c
and a
ret
@@ -18031,7 +18031,7 @@
ld de, SpecialShuckleOT
call CopyName2
-; Bittable2 flag for this event.
+; Engine flag for this event.
ld hl, $dc1e
set 5, [hl]
@@ -20764,12 +20764,11 @@
ret
; c721
-CheckFlag2: ; c721
-; using bittable2
-; check flag id in de
-; return carry if flag is not set
+CheckEngineFlag: ; c721
+; Check engine flag de
+; Return carry if flag is not set
ld b, $02 ; check flag
- callba GetFlag2
+ callba EngineFlagAction
ld a, c
and a
jr nz, .isset
@@ -20782,7 +20781,7 @@
CheckBadge: ; c731
; input: a = badge flag id ($1b-$2b)
- call CheckFlag2
+ call CheckEngineFlag
ret nc
ld hl, BadgeRequiredText
call Function1d67 ; push text to queue
@@ -21136,7 +21135,7 @@
jr c, .quit
ld de, $1e ; FLAG_FOG_BADGE
- call CheckFlag2
+ call CheckEngineFlag
jr c, .quit
ld d, SURF
@@ -21341,7 +21340,7 @@
call CheckPartyMove
jr c, .asm_cb74
ld de, $0022
- call CheckFlag2
+ call CheckEngineFlag
jr c, .asm_cb74
call Functioncb07
jr c, .asm_cb74
@@ -21534,7 +21533,7 @@
call CheckPartyMove
jr c, .asm_ce5c
ld de, $0021
- call CheckFlag2
+ call CheckEngineFlag
jr c, .asm_ce5c
call Functioncdde
jr c, .asm_ce5c
@@ -21780,7 +21779,7 @@
call CheckPartyMove
jr c, .asm_d19f
ld de, $001c
- call CheckFlag2
+ call CheckEngineFlag
jr c, .asm_d19f
ld a, BANK(UnknownScript_0xd1a9)
ld hl, UnknownScript_0xd1a9
@@ -55472,8 +55471,8 @@
-GetFlag2: ; 80430
-; Do action b on flag de from BitTable2
+EngineFlagAction: ; 80430
+; Do action b on engine flag de
;
; b = 0: reset flag
; = 1: set flag
@@ -55491,8 +55490,8 @@
jr c, .read ; cp 0 can't set carry!
jr .invalid
-; There are only $a2 flags in BitTable2, so anything beyond that
-; is invalid too.
+; There are only $a2 engine flags, so
+; anything beyond that is invalid too.
.ceiling
ld a, e
@@ -55506,10 +55505,10 @@
ld e, a
ld d, a
-; Read BitTable2 for this flag's location.
+; Get this flag's location.
.read
- ld hl, BitTable2
+ ld hl, EngineFlags
; location
add hl, de
add hl, de
@@ -55557,8 +55556,8 @@
; 80462
-BitTable2: ; 80462
-INCLUDE "engine/bittable2.asm"
+EngineFlags: ; 80462
+INCLUDE "engine/engine_flags.asm"
; 80648