ref: 5c4dc08ee451f699471ce69fc8f98265bc80939d
parent: d4aa6edfa744a45cc82b20cd813462af870b6fef
parent: 740f91370db08d2e30c16f34be83c6d14e7d1c60
author: Bryan Bishop <[email protected]>
date: Sun Sep 8 07:18:39 EDT 2013
Merge branch 'master' into refactor-preprocessor
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+PYTHON := python
.SUFFIXES: .asm .tx .o .gbc .png .2bpp .lz
TEXTFILES := $(shell find ./ -type f -name '*.asm' | grep -v pokecrystal.asm | grep -v constants.asm | grep -v gbhw.asm | grep -v hram.asm | grep -v constants | grep -v wram.asm)
@@ -13,14 +14,14 @@
rm -f pokecrystal.o pokecrystal.gbc
@echo 'rm -f $(TEXTFILES:.asm=.tx)'
@rm -f $(TEXTFILES:.asm=.tx)
-pokecrystal.o: $(TEXTFILES:.asm=.tx) wram.asm constants.asm $(shell find constants/ -type f -name '*constants.asm') hram.asm gbhw.asm $(LZ_GFX) $(TWOBPP_GFX)
- python prequeue.py $(TEXTQUEUE)
+pokecrystal.o: $(TEXTFILES:.asm=.tx) wram.asm constants.asm $(shell find constants/ -type f -name '*.asm') hram.asm gbhw.asm $(LZ_GFX) $(TWOBPP_GFX)
+ $(PYTHON) prequeue.py $(TEXTQUEUE)
rgbasm -o pokecrystal.o pokecrystal.asm
.asm.tx:
$(eval TEXTQUEUE := $(TEXTQUEUE) $<)
@rm -f $@
baserom.gbc:
- python -c "import os; assert 'baserom.gbc' in os.listdir('.'), 'Wait! Need baserom.gbc first. Check README and INSTALL for details.';"
+ $(PYTHON) -c "import os; assert 'baserom.gbc' in os.listdir('.'), 'Wait! Need baserom.gbc first. Check README and INSTALL for details.';"
pokecrystal.gbc: pokecrystal.o
rgblink -n pokecrystal.sym -m pokecrystal.map -o $@ $<
@@ -27,22 +28,22 @@
rgbfix -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -p 0 -r 3 -t PM_CRYSTAL $@
pngs:
- python extras/pokemontools/gfx.py mass-decompress
- python extras/pokemontools/gfx.py dump-pngs
+ $(PYTHON) extras/pokemontools/gfx.py mass-decompress
+ $(PYTHON) extras/pokemontools/gfx.py dump-pngs
lzs: $(LZ_GFX) $(TWOBPP_GFX)
@:
gfx/pics/%/front.lz: gfx/pics/%/tiles.2bpp gfx/pics/%/front.png
- python extras/pokemontools/gfx.py png-to-lz --front $^
+ $(PYTHON) extras/pokemontools/gfx.py png-to-lz --front $^
gfx/pics/%/tiles.2bpp: gfx/pics/%/tiles.png
- python extras/pokemontools/gfx.py png-to-2bpp $<
+ $(PYTHON) extras/pokemontools/gfx.py png-to-2bpp $<
gfx/pics/%/back.lz: gfx/pics/%/back.png
- python extras/pokemontools/gfx.py png-to-lz --vert $<
+ $(PYTHON) extras/pokemontools/gfx.py png-to-lz --vert $<
gfx/trainers/%.lz: gfx/trainers/%.png
- python extras/pokemontools/gfx.py png-to-lz --vert $<
+ $(PYTHON) extras/pokemontools/gfx.py png-to-lz --vert $<
.png.lz:
- python extras/pokemontools/gfx.py png-to-lz $<
+ $(PYTHON) extras/pokemontools/gfx.py png-to-lz $<
.png.2bpp:
- python extras/pokemontools/gfx.py png-to-lz $<
+ $(PYTHON) extras/pokemontools/gfx.py png-to-lz $<
--- a/audio/music/bugcatchingcontestresults.asm
+++ /dev/null
@@ -1,177 +1,0 @@
-_Music_BugCatchingContestResults: ; 0xefb3e
- db $c0
- dw _Music_BugCatchingContestResults_Ch1
- db $01
- dw _Music_BugCatchingContestResults_Ch2
- db $02
- dw _Music_BugCatchingContestResults_Ch3
- db $03
- dw _Music_BugCatchingContestResults_Ch4
-; 0xefb4a
-
-_Music_BugCatchingContestResults_Ch1: ; 0xefb4a
- tempo $9000
- volume $77
- notetype $0c, $51
- note $01
- octave2
- note $80
- note $02
- note $80
- note $02
- note $80
- note $02
- note $80
- note $00
- note $01
- note $a0
- note $02
- note $a0
- note $02
- note $a0
- note $02
- note $a0
- note $00
- note $01
- note $a0
- note $02
- note $a0
- note $02
- note $a0
- note $02
- note $a0
- note $00
- note $01
- note $c0
- note $02
- note $b0
- note $02
- note $a0
- note $02
- note $80
- note $00
- loopchannel $00, $7b52 ; end
-; 0xefb7b
-
-_Music_BugCatchingContestResults_Ch2: ; 0xefb7b
- notetype $0c, $61
- octave2
- note $11
- octave3
- note $50
- note $00
- octave1
- note $81
- octave3
- note $50
- note $00
- octave1
- note $a1
- octave3
- note $50
- note $00
- octave1
- note $c1
- octave3
- note $50
- note $00
- octave2
- note $31
- octave3
- note $60
- note $00
- octave1
- note $a1
- octave3
- note $60
- note $00
- octave1
- note $c1
- octave3
- note $60
- note $00
- octave2
- note $21
- octave3
- note $60
- note $00
- octave2
- note $31
- octave3
- note $60
- note $00
- octave1
- note $a1
- octave3
- note $60
- note $00
- loopchannel $02, $7ba6
- octave2
- note $81
- octave3
- note $80
- note $00
- octave2
- note $31
- octave3
- note $70
- note $00
- octave2
- note $81
- octave3
- note $60
- note $00
- octave2
- note $31
- octave3
- note $30
- note $00
- loopchannel $00, $7b7e ; end
-; 0xefbcc
-
-_Music_BugCatchingContestResults_Ch3: ; 0xefbcc
- vibrato $08, $24
- notetype $0c, $23
- octave4
- note $54
- note $00
- note $50
- note $60
- note $83
- octave5
- note $13
- octave4
- note $c7
- note $a7
- note $34
- note $00
- note $30
- note $50
- note $63
- note $c3
- note $a7
- note $87
- loopchannel $00, $7bd2 ; end
-; 0xefbe9
-
-_Music_BugCatchingContestResults_Ch4: ; 0xefbe9
- togglenoise $04
- notetype $06
- note $23
- note $23
- note $21
- note $21
- note $21
- note $21
- note $23
- note $23
- note $80
- note $80
- note $80
- note $80
- note $80
- note $80
- note $80
- note $80
- loopchannel $00, $7bed ; end
-; 0xefc01
--- /dev/null
+++ b/audio/music/contestresults.asm
@@ -1,0 +1,177 @@
+_Music_BugCatchingContestResults: ; 0xefb3e
+ db $c0
+ dw _Music_BugCatchingContestResults_Ch1
+ db $01
+ dw _Music_BugCatchingContestResults_Ch2
+ db $02
+ dw _Music_BugCatchingContestResults_Ch3
+ db $03
+ dw _Music_BugCatchingContestResults_Ch4
+; 0xefb4a
+
+_Music_BugCatchingContestResults_Ch1: ; 0xefb4a
+ tempo $9000
+ volume $77
+ notetype $0c, $51
+ note $01
+ octave2
+ note $80
+ note $02
+ note $80
+ note $02
+ note $80
+ note $02
+ note $80
+ note $00
+ note $01
+ note $a0
+ note $02
+ note $a0
+ note $02
+ note $a0
+ note $02
+ note $a0
+ note $00
+ note $01
+ note $a0
+ note $02
+ note $a0
+ note $02
+ note $a0
+ note $02
+ note $a0
+ note $00
+ note $01
+ note $c0
+ note $02
+ note $b0
+ note $02
+ note $a0
+ note $02
+ note $80
+ note $00
+ loopchannel $00, $7b52 ; end
+; 0xefb7b
+
+_Music_BugCatchingContestResults_Ch2: ; 0xefb7b
+ notetype $0c, $61
+ octave2
+ note $11
+ octave3
+ note $50
+ note $00
+ octave1
+ note $81
+ octave3
+ note $50
+ note $00
+ octave1
+ note $a1
+ octave3
+ note $50
+ note $00
+ octave1
+ note $c1
+ octave3
+ note $50
+ note $00
+ octave2
+ note $31
+ octave3
+ note $60
+ note $00
+ octave1
+ note $a1
+ octave3
+ note $60
+ note $00
+ octave1
+ note $c1
+ octave3
+ note $60
+ note $00
+ octave2
+ note $21
+ octave3
+ note $60
+ note $00
+ octave2
+ note $31
+ octave3
+ note $60
+ note $00
+ octave1
+ note $a1
+ octave3
+ note $60
+ note $00
+ loopchannel $02, $7ba6
+ octave2
+ note $81
+ octave3
+ note $80
+ note $00
+ octave2
+ note $31
+ octave3
+ note $70
+ note $00
+ octave2
+ note $81
+ octave3
+ note $60
+ note $00
+ octave2
+ note $31
+ octave3
+ note $30
+ note $00
+ loopchannel $00, $7b7e ; end
+; 0xefbcc
+
+_Music_BugCatchingContestResults_Ch3: ; 0xefbcc
+ vibrato $08, $24
+ notetype $0c, $23
+ octave4
+ note $54
+ note $00
+ note $50
+ note $60
+ note $83
+ octave5
+ note $13
+ octave4
+ note $c7
+ note $a7
+ note $34
+ note $00
+ note $30
+ note $50
+ note $63
+ note $c3
+ note $a7
+ note $87
+ loopchannel $00, $7bd2 ; end
+; 0xefbe9
+
+_Music_BugCatchingContestResults_Ch4: ; 0xefbe9
+ togglenoise $04
+ notetype $06
+ note $23
+ note $23
+ note $21
+ note $21
+ note $21
+ note $21
+ note $23
+ note $23
+ note $80
+ note $80
+ note $80
+ note $80
+ note $80
+ note $80
+ note $80
+ note $80
+ loopchannel $00, $7bed ; end
+; 0xefc01
--- /dev/null
+++ b/audio/music/johtogymbattle.asm
@@ -1,0 +1,1039 @@
+_Music_JohtoGymLeaderBattle: ; 0xea50d
+ db $80
+ dw _Music_JohtoGymLeaderBattle_Ch1
+ db $01
+ dw _Music_JohtoGymLeaderBattle_Ch2
+ db $02
+ dw _Music_JohtoGymLeaderBattle_Ch3
+; 0xea516
+
+_Music_JohtoGymLeaderBattle_Ch1: ; 0xea516
+ tempo $6500
+ volume $77
+ dutycycle $03
+ tone $0200
+ vibrato $12, $15
+ notetype $0c, $b2
+ octave3
+ note $b0
+ note $a0
+ note $90
+ note $a0
+ loopchannel $04, $6526
+ note $20
+ note $10
+ octave2
+ note $b0
+ octave3
+ note $10
+ loopchannel $03, $652f
+ intensity $4b
+ note $23
+ intensity $b2
+ note $35
+ note $45
+ note $13
+ note $65
+ note $35
+ note $43
+ note $35
+ note $45
+ note $13
+ note $65
+ note $85
+ intensity $b7
+ note $13
+ intensity $b2
+ note $85
+ note $95
+ note $63
+ note $95
+ note $65
+ note $93
+ note $85
+ note $95
+ note $63
+ note $95
+ octave4
+ note $15
+ octave3
+ note $91
+ note $61
+ intensity $b5
+ note $35
+ note $85
+ note $61
+ note $81
+ note $93
+ note $83
+ note $63
+ note $83
+ intensity $b7
+ note $9b
+ intensity $b2
+ note $83
+ intensity $b7
+ octave4
+ note $2b
+ intensity $b2
+ note $13
+ intensity $b5
+ octave3
+ note $35
+ note $85
+ note $61
+ note $81
+ note $93
+ note $83
+ note $63
+ note $83
+ intensity $b7
+ note $97
+ note $87
+ note $67
+ note $47
+ intensity $70
+ note $17
+ intensity $77
+ note $17
+ intensity $b4
+ note $41
+ note $51
+ note $65
+ note $81
+ note $43
+ intensity $77
+ octave2
+ note $b7
+ note $b7
+ intensity $c5
+ octave3
+ note $81
+ note $91
+ note $b5
+ note $b1
+ note $93
+ intensity $c7
+ note $87
+ note $63
+ note $51
+ note $21
+ intensity $a0
+ note $17
+ intensity $a7
+ note $17
+ intensity $b2
+ note $65
+ note $63
+ note $51
+ note $63
+ note $65
+ note $65
+ note $61
+ note $91
+ note $55
+ note $53
+ note $61
+ note $51
+ note $21
+ note $15
+ note $15
+ note $13
+ note $65
+ note $61
+ note $91
+ note $51
+ note $61
+ note $91
+ note $61
+ note $13
+ note $65
+ note $51
+ note $91
+ note $51
+ note $83
+ note $53
+ note $61
+ note $51
+ note $61
+ note $85
+ note $83
+ octave4
+ note $11
+ octave3
+ note $81
+ note $11
+ note $15
+ note $15
+ note $13
+ note $25
+ note $25
+ note $23
+ note $35
+ note $35
+ note $33
+ note $45
+ note $45
+ note $43
+ intensity $80
+ note $8f
+ intensity $90
+ note $9f
+ intensity $a0
+ note $a7
+ note $b1
+ note $a1
+ note $91
+ note $a1
+ intensity $b0
+ note $b7
+ note $c1
+ note $b1
+ note $a1
+ octave4
+ note $21
+ intensity $b7
+ note $17
+ note $23
+ note $13
+ octave3
+ note $91
+ octave4
+ note $11
+ octave3
+ note $91
+ octave4
+ note $41
+ octave3
+ note $91
+ octave4
+ note $21
+ octave3
+ note $91
+ octave4
+ note $11
+ note $93
+ note $43
+ note $93
+ note $43
+ note $43
+ octave3
+ note $93
+ octave4
+ note $43
+ octave3
+ note $93
+ note $97
+ note $a3
+ note $93
+ note $41
+ note $91
+ note $41
+ octave4
+ note $21
+ octave3
+ note $41
+ note $a1
+ note $41
+ note $81
+ octave4
+ note $23
+ octave3
+ note $93
+ octave4
+ note $23
+ octave3
+ note $93
+ note $93
+ note $23
+ note $93
+ note $23
+ note $c7
+ note $a7
+ note $97
+ note $77
+ intensity $b4
+ note $a3
+ octave4
+ note $23
+ octave3
+ note $c3
+ octave4
+ note $53
+ intensity $92
+ note $41
+ note $41
+ note $41
+ note $41
+ intensity $b2
+ note $41
+ note $41
+ note $41
+ note $41
+ intensity $c2
+ note $4f
+ intensity $50
+ octave3
+ note $1f
+ note $6f
+ note $5f
+ intensity $97
+ note $49
+ intensity $b4
+ octave2
+ note $b1
+ octave3
+ note $41
+ note $71
+ loopchannel $00, $655d ; end
+; 0xea65f
+
+_Music_JohtoGymLeaderBattle_Ch2: ; 0xea65f
+ dutycycle $03
+ vibrato $08, $36
+ tone $0100
+ notetype $0c, $c2
+ octave4
+ note $70
+ note $60
+ note $50
+ note $b0
+ loopchannel $04, $666a
+ note $70
+ note $60
+ note $70
+ note $b0
+ loopchannel $04, $6673
+ note $a5
+ octave3
+ note $b5
+ note $83
+ octave4
+ note $35
+ octave3
+ note $a5
+ note $b3
+ note $a5
+ note $b5
+ note $83
+ octave4
+ note $35
+ note $45
+ intensity $b0
+ octave3
+ note $43
+ intensity $c2
+ octave4
+ note $31
+ intensity $92
+ octave3
+ note $31
+ note $31
+ intensity $c2
+ octave4
+ note $43
+ intensity $92
+ octave3
+ note $31
+ intensity $c2
+ octave4
+ note $13
+ note $81
+ notetype $0c, $92
+ octave3
+ note $31
+ note $31
+ intensity $c2
+ octave4
+ note $33
+ intensity $92
+ octave3
+ note $31
+ intensity $c2
+ octave4
+ note $41
+ intensity $92
+ octave3
+ note $41
+ intensity $c2
+ octave4
+ note $31
+ intensity $92
+ octave3
+ note $31
+ note $31
+ intensity $c2
+ octave4
+ note $43
+ intensity $92
+ octave3
+ note $31
+ intensity $c2
+ octave4
+ note $11
+ intensity $92
+ octave3
+ note $41
+ intensity $c2
+ octave4
+ note $81
+ intensity $92
+ octave3
+ note $61
+ note $61
+ intensity $c2
+ octave4
+ note $91
+ intensity $92
+ octave3
+ note $61
+ note $61
+ intensity $c2
+ octave4
+ note $71
+ intensity $b2
+ octave3
+ note $90
+ note $a0
+ intensity $c7
+ note $b7
+ intensity $c4
+ octave4
+ note $31
+ note $11
+ octave3
+ note $b1
+ octave4
+ note $11
+ intensity $c7
+ note $27
+ intensity $c4
+ note $61
+ note $41
+ note $21
+ note $41
+ intensity $b0
+ note $65
+ intensity $b7
+ note $65
+ intensity $c2
+ note $43
+ intensity $b0
+ note $95
+ intensity $b7
+ note $95
+ intensity $c2
+ note $63
+ intensity $c7
+ octave3
+ note $b7
+ intensity $c4
+ octave4
+ note $31
+ note $11
+ octave3
+ note $b1
+ octave4
+ note $11
+ intensity $c7
+ note $27
+ intensity $c4
+ note $61
+ note $41
+ note $21
+ note $41
+ intensity $b0
+ note $2f
+ intensity $b7
+ note $2f
+ intensity $a4
+ octave3
+ note $65
+ note $45
+ note $63
+ intensity $c6
+ octave4
+ note $15
+ octave3
+ note $b5
+ octave4
+ note $13
+ intensity $a4
+ octave3
+ note $25
+ note $15
+ note $23
+ intensity $c6
+ octave4
+ note $25
+ note $15
+ note $23
+ intensity $3c
+ note $19
+ intensity $b7
+ note $15
+ intensity $b0
+ note $57
+ intensity $b7
+ note $57
+ intensity $b0
+ octave3
+ note $2f
+ octave2
+ note $b7
+ octave3
+ note $25
+ note $41
+ note $1f
+ note $5f
+ intensity $a0
+ octave5
+ note $23
+ intensity $a7
+ octave5
+ note $2b
+ intensity $b7
+ octave4
+ note $b7
+ octave5
+ note $25
+ note $41
+ intensity $a0
+ note $17
+ intensity $a7
+ note $17
+ intensity $3e
+ note $55
+ intensity $a6
+ note $59
+ intensity $c2
+ octave3
+ note $65
+ note $65
+ note $63
+ note $75
+ note $75
+ note $73
+ note $85
+ note $85
+ note $83
+ note $95
+ note $95
+ note $93
+ intensity $90
+ octave4
+ note $1f
+ intensity $a0
+ note $2f
+ intensity $b0
+ note $3f
+ intensity $b7
+ note $47
+ intensity $4c
+ note $45
+ intensity $c2
+ note $70
+ note $80
+ intensity $c7
+ note $97
+ note $a1
+ note $91
+ note $71
+ note $a1
+ note $93
+ octave5
+ note $13
+ octave4
+ note $a3
+ note $93
+ octave5
+ note $43
+ octave4
+ note $93
+ octave5
+ note $43
+ octave4
+ note $93
+ octave5
+ note $41
+ note $21
+ note $11
+ note $21
+ note $11
+ octave4
+ note $a1
+ note $91
+ note $a1
+ note $47
+ note $51
+ note $41
+ note $21
+ note $51
+ note $43
+ note $93
+ note $53
+ note $23
+ note $93
+ note $23
+ note $93
+ note $23
+ note $a1
+ note $91
+ note $71
+ note $51
+ note $41
+ note $51
+ note $41
+ note $21
+ note $47
+ note $27
+ octave3
+ note $c7
+ note $a7
+ octave4
+ note $43
+ note $93
+ note $53
+ note $a3
+ intensity $c0
+ note $97
+ intensity $c7
+ note $97
+ intensity $c2
+ note $9f
+ intensity $80
+ octave3
+ note $6f
+ octave4
+ note $1f
+ octave3
+ note $cf
+ note $8f
+ loopchannel $00, $66ee ; end
+; 0xea7f4
+
+_Music_JohtoGymLeaderBattle_Ch3: ; 0xea7f4
+ notetype $0c, $19
+ octave4
+ note $60
+ note $00
+ octave3
+ note $a1
+ octave4
+ note $60
+ note $00
+ octave3
+ note $91
+ octave4
+ note $60
+ note $00
+ octave3
+ note $81
+ octave4
+ note $60
+ note $00
+ octave3
+ note $71
+ octave4
+ note $90
+ note $00
+ octave3
+ note $61
+ octave4
+ note $90
+ note $00
+ octave3
+ note $51
+ note $61
+ note $81
+ note $93
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea952
+ note $81
+ note $31
+ note $61
+ note $81
+ note $91
+ note $91
+ note $81
+ note $61
+ note $81
+ note $31
+ note $61
+ note $81
+ note $91
+ note $41
+ note $73
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea952
+ note $81
+ note $31
+ note $61
+ note $81
+ note $91
+ note $91
+ note $81
+ note $61
+ note $81
+ note $31
+ note $61
+ note $81
+ note $91
+ octave4
+ note $11
+ octave3
+ note $b1
+ note $91
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea963
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea963
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea96a
+ note $21
+ note $91
+ note $21
+ note $91
+ note $21
+ note $b1
+ note $a1
+ note $91
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea963
+ note $31
+ note $81
+ note $31
+ note $81
+ note $31
+ note $81
+ note $91
+ note $81
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea96a
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea96a
+ note $11
+ note $81
+ note $b1
+ note $11
+ note $41
+ note $61
+ note $81
+ note $b1
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea971
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea96a
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea978
+ octave3
+ note $81
+ note $91
+ note $61
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea971
+ note $11
+ note $81
+ note $11
+ note $81
+ note $11
+ note $51
+ note $61
+ note $81
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea96a
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea978
+ octave3
+ note $11
+ note $21
+ note $91
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea971
+ note $11
+ note $81
+ note $11
+ note $81
+ note $61
+ note $51
+ note $61
+ note $81
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea96a
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea978
+ octave3
+ note $61
+ octave2
+ note $b1
+ octave3
+ note $91
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea971
+ note $11
+ note $81
+ note $11
+ octave4
+ note $11
+ octave3
+ note $b1
+ note $81
+ note $61
+ note $81
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea983
+ note $01
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea990
+ octave4
+ note $21
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea99c
+ note $01
+ note $41
+ note $b1
+ octave4
+ note $41
+ octave3
+ note $41
+ note $b1
+ octave4
+ note $41
+ octave3
+ note $41
+ octave4
+ note $41
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea983
+ note $81
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea990
+ note $91
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea99c
+ note $a1
+ octave4
+ note $41
+ octave3
+ note $b1
+ note $41
+ octave4
+ note $41
+ octave3
+ note $41
+ octave4
+ note $41
+ note $33
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea9a9
+ note $41
+ note $91
+ note $41
+ octave4
+ note $21
+ octave3
+ note $41
+ note $a1
+ note $41
+ note $91
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea9a9
+ note $41
+ note $91
+ note $41
+ note $91
+ note $41
+ note $a1
+ note $91
+ note $71
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea9b1
+ note $21
+ note $71
+ note $21
+ octave4
+ note $21
+ octave3
+ note $21
+ note $a1
+ note $21
+ note $81
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea9b1
+ note $21
+ note $71
+ note $21
+ note $71
+ note $21
+ note $41
+ note $51
+ note $a1
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea9a9
+ note $41
+ note $91
+ note $41
+ note $91
+ note $41
+ note $91
+ note $a1
+ octave4
+ note $21
+ octave3
+ note $41
+ note $91
+ note $41
+ note $a1
+ note $41
+ note $c1
+ note $41
+ octave4
+ note $21
+ octave3
+ note $91
+ note $41
+ note $71
+ note $91
+ note $a1
+ note $a1
+ note $91
+ note $71
+ note $91
+ note $41
+ note $71
+ note $91
+ note $71
+ note $71
+ note $51
+ note $71
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea9b8
+ note $61
+ note $11
+ note $41
+ note $61
+ note $41
+ note $41
+ note $21
+ note $41
+ callchannel _Music_JohtoGymLeaderBattle_sub_0xea9b8
+ note $61
+ note $11
+ note $41
+ note $61
+ note $41
+ note $71
+ note $61
+ note $41
+ loopchannel $00, $683f ; end
+; 0xea952
+
+_Music_JohtoGymLeaderBattle_sub_0xea952: ; 0xea952
+; subroutine
+ note $81
+ note $31
+ note $61
+ note $81
+ note $91
+ note $91
+ note $81
+ note $61
+ note $81
+ note $31
+ note $61
+ note $81
+ note $61
+ note $61
+ note $41
+ note $61
+ endchannel ; end
+; 0xea963
+
+_Music_JohtoGymLeaderBattle_sub_0xea963: ; 0xea963
+; subroutine
+ note $31
+ note $81
+ loopchannel $04, $6963
+ endchannel ; end
+; 0xea96a
+
+_Music_JohtoGymLeaderBattle_sub_0xea96a: ; 0xea96a
+; subroutine
+ note $21
+ note $91
+ loopchannel $04, $696a
+ endchannel ; end
+; 0xea971
+
+_Music_JohtoGymLeaderBattle_sub_0xea971: ; 0xea971
+; subroutine
+ note $11
+ note $81
+ loopchannel $04, $6971
+ endchannel ; end
+; 0xea978
+
+_Music_JohtoGymLeaderBattle_sub_0xea978: ; 0xea978
+; subroutine
+ octave2
+ note $b1
+ octave3
+ note $61
+ octave2
+ note $b1
+ octave3
+ note $61
+ octave2
+ note $b1
+ endchannel ; end
+; 0xea983
+
+_Music_JohtoGymLeaderBattle_sub_0xea983: ; 0xea983
+; subroutine
+ octave3
+ note $11
+ note $81
+ octave4
+ note $11
+ octave3
+ note $11
+ note $81
+ octave4
+ note $11
+ octave3
+ note $11
+ endchannel ; end
+; 0xea990
+
+_Music_JohtoGymLeaderBattle_sub_0xea990: ; 0xea990
+; subroutine
+ note $21
+ note $91
+ octave4
+ note $21
+ octave3
+ note $21
+ note $91
+ octave4
+ note $21
+ octave3
+ note $21
+ endchannel ; end
+; 0xea99c
+
+_Music_JohtoGymLeaderBattle_sub_0xea99c: ; 0xea99c
+; subroutine
+ octave3
+ note $31
+ note $a1
+ octave4
+ note $31
+ octave3
+ note $31
+ note $a1
+ octave4
+ note $31
+ octave3
+ note $31
+ endchannel ; end
+; 0xea9a9
+
+_Music_JohtoGymLeaderBattle_sub_0xea9a9: ; 0xea9a9
+; subroutine
+ octave3
+ note $41
+ note $91
+ loopchannel $04, $69a9
+ endchannel ; end
+; 0xea9b1
+
+_Music_JohtoGymLeaderBattle_sub_0xea9b1: ; 0xea9b1
+; subroutine
+ note $21
+ note $71
+ loopchannel $04, $69b1
+ endchannel ; end
+; 0xea9b8
+
+_Music_JohtoGymLeaderBattle_sub_0xea9b8: ; 0xea9b8
+; subroutine
+ note $61
+ note $11
+ note $41
+ note $61
+ note $71
+ note $71
+ note $61
+ note $41
+ endchannel ; end
+; 0xea9c1
--- a/audio/music/johtogymleaderbattle.asm
+++ /dev/null
@@ -1,1039 +1,0 @@
-_Music_JohtoGymLeaderBattle: ; 0xea50d
- db $80
- dw _Music_JohtoGymLeaderBattle_Ch1
- db $01
- dw _Music_JohtoGymLeaderBattle_Ch2
- db $02
- dw _Music_JohtoGymLeaderBattle_Ch3
-; 0xea516
-
-_Music_JohtoGymLeaderBattle_Ch1: ; 0xea516
- tempo $6500
- volume $77
- dutycycle $03
- tone $0200
- vibrato $12, $15
- notetype $0c, $b2
- octave3
- note $b0
- note $a0
- note $90
- note $a0
- loopchannel $04, $6526
- note $20
- note $10
- octave2
- note $b0
- octave3
- note $10
- loopchannel $03, $652f
- intensity $4b
- note $23
- intensity $b2
- note $35
- note $45
- note $13
- note $65
- note $35
- note $43
- note $35
- note $45
- note $13
- note $65
- note $85
- intensity $b7
- note $13
- intensity $b2
- note $85
- note $95
- note $63
- note $95
- note $65
- note $93
- note $85
- note $95
- note $63
- note $95
- octave4
- note $15
- octave3
- note $91
- note $61
- intensity $b5
- note $35
- note $85
- note $61
- note $81
- note $93
- note $83
- note $63
- note $83
- intensity $b7
- note $9b
- intensity $b2
- note $83
- intensity $b7
- octave4
- note $2b
- intensity $b2
- note $13
- intensity $b5
- octave3
- note $35
- note $85
- note $61
- note $81
- note $93
- note $83
- note $63
- note $83
- intensity $b7
- note $97
- note $87
- note $67
- note $47
- intensity $70
- note $17
- intensity $77
- note $17
- intensity $b4
- note $41
- note $51
- note $65
- note $81
- note $43
- intensity $77
- octave2
- note $b7
- note $b7
- intensity $c5
- octave3
- note $81
- note $91
- note $b5
- note $b1
- note $93
- intensity $c7
- note $87
- note $63
- note $51
- note $21
- intensity $a0
- note $17
- intensity $a7
- note $17
- intensity $b2
- note $65
- note $63
- note $51
- note $63
- note $65
- note $65
- note $61
- note $91
- note $55
- note $53
- note $61
- note $51
- note $21
- note $15
- note $15
- note $13
- note $65
- note $61
- note $91
- note $51
- note $61
- note $91
- note $61
- note $13
- note $65
- note $51
- note $91
- note $51
- note $83
- note $53
- note $61
- note $51
- note $61
- note $85
- note $83
- octave4
- note $11
- octave3
- note $81
- note $11
- note $15
- note $15
- note $13
- note $25
- note $25
- note $23
- note $35
- note $35
- note $33
- note $45
- note $45
- note $43
- intensity $80
- note $8f
- intensity $90
- note $9f
- intensity $a0
- note $a7
- note $b1
- note $a1
- note $91
- note $a1
- intensity $b0
- note $b7
- note $c1
- note $b1
- note $a1
- octave4
- note $21
- intensity $b7
- note $17
- note $23
- note $13
- octave3
- note $91
- octave4
- note $11
- octave3
- note $91
- octave4
- note $41
- octave3
- note $91
- octave4
- note $21
- octave3
- note $91
- octave4
- note $11
- note $93
- note $43
- note $93
- note $43
- note $43
- octave3
- note $93
- octave4
- note $43
- octave3
- note $93
- note $97
- note $a3
- note $93
- note $41
- note $91
- note $41
- octave4
- note $21
- octave3
- note $41
- note $a1
- note $41
- note $81
- octave4
- note $23
- octave3
- note $93
- octave4
- note $23
- octave3
- note $93
- note $93
- note $23
- note $93
- note $23
- note $c7
- note $a7
- note $97
- note $77
- intensity $b4
- note $a3
- octave4
- note $23
- octave3
- note $c3
- octave4
- note $53
- intensity $92
- note $41
- note $41
- note $41
- note $41
- intensity $b2
- note $41
- note $41
- note $41
- note $41
- intensity $c2
- note $4f
- intensity $50
- octave3
- note $1f
- note $6f
- note $5f
- intensity $97
- note $49
- intensity $b4
- octave2
- note $b1
- octave3
- note $41
- note $71
- loopchannel $00, $655d ; end
-; 0xea65f
-
-_Music_JohtoGymLeaderBattle_Ch2: ; 0xea65f
- dutycycle $03
- vibrato $08, $36
- tone $0100
- notetype $0c, $c2
- octave4
- note $70
- note $60
- note $50
- note $b0
- loopchannel $04, $666a
- note $70
- note $60
- note $70
- note $b0
- loopchannel $04, $6673
- note $a5
- octave3
- note $b5
- note $83
- octave4
- note $35
- octave3
- note $a5
- note $b3
- note $a5
- note $b5
- note $83
- octave4
- note $35
- note $45
- intensity $b0
- octave3
- note $43
- intensity $c2
- octave4
- note $31
- intensity $92
- octave3
- note $31
- note $31
- intensity $c2
- octave4
- note $43
- intensity $92
- octave3
- note $31
- intensity $c2
- octave4
- note $13
- note $81
- notetype $0c, $92
- octave3
- note $31
- note $31
- intensity $c2
- octave4
- note $33
- intensity $92
- octave3
- note $31
- intensity $c2
- octave4
- note $41
- intensity $92
- octave3
- note $41
- intensity $c2
- octave4
- note $31
- intensity $92
- octave3
- note $31
- note $31
- intensity $c2
- octave4
- note $43
- intensity $92
- octave3
- note $31
- intensity $c2
- octave4
- note $11
- intensity $92
- octave3
- note $41
- intensity $c2
- octave4
- note $81
- intensity $92
- octave3
- note $61
- note $61
- intensity $c2
- octave4
- note $91
- intensity $92
- octave3
- note $61
- note $61
- intensity $c2
- octave4
- note $71
- intensity $b2
- octave3
- note $90
- note $a0
- intensity $c7
- note $b7
- intensity $c4
- octave4
- note $31
- note $11
- octave3
- note $b1
- octave4
- note $11
- intensity $c7
- note $27
- intensity $c4
- note $61
- note $41
- note $21
- note $41
- intensity $b0
- note $65
- intensity $b7
- note $65
- intensity $c2
- note $43
- intensity $b0
- note $95
- intensity $b7
- note $95
- intensity $c2
- note $63
- intensity $c7
- octave3
- note $b7
- intensity $c4
- octave4
- note $31
- note $11
- octave3
- note $b1
- octave4
- note $11
- intensity $c7
- note $27
- intensity $c4
- note $61
- note $41
- note $21
- note $41
- intensity $b0
- note $2f
- intensity $b7
- note $2f
- intensity $a4
- octave3
- note $65
- note $45
- note $63
- intensity $c6
- octave4
- note $15
- octave3
- note $b5
- octave4
- note $13
- intensity $a4
- octave3
- note $25
- note $15
- note $23
- intensity $c6
- octave4
- note $25
- note $15
- note $23
- intensity $3c
- note $19
- intensity $b7
- note $15
- intensity $b0
- note $57
- intensity $b7
- note $57
- intensity $b0
- octave3
- note $2f
- octave2
- note $b7
- octave3
- note $25
- note $41
- note $1f
- note $5f
- intensity $a0
- octave5
- note $23
- intensity $a7
- octave5
- note $2b
- intensity $b7
- octave4
- note $b7
- octave5
- note $25
- note $41
- intensity $a0
- note $17
- intensity $a7
- note $17
- intensity $3e
- note $55
- intensity $a6
- note $59
- intensity $c2
- octave3
- note $65
- note $65
- note $63
- note $75
- note $75
- note $73
- note $85
- note $85
- note $83
- note $95
- note $95
- note $93
- intensity $90
- octave4
- note $1f
- intensity $a0
- note $2f
- intensity $b0
- note $3f
- intensity $b7
- note $47
- intensity $4c
- note $45
- intensity $c2
- note $70
- note $80
- intensity $c7
- note $97
- note $a1
- note $91
- note $71
- note $a1
- note $93
- octave5
- note $13
- octave4
- note $a3
- note $93
- octave5
- note $43
- octave4
- note $93
- octave5
- note $43
- octave4
- note $93
- octave5
- note $41
- note $21
- note $11
- note $21
- note $11
- octave4
- note $a1
- note $91
- note $a1
- note $47
- note $51
- note $41
- note $21
- note $51
- note $43
- note $93
- note $53
- note $23
- note $93
- note $23
- note $93
- note $23
- note $a1
- note $91
- note $71
- note $51
- note $41
- note $51
- note $41
- note $21
- note $47
- note $27
- octave3
- note $c7
- note $a7
- octave4
- note $43
- note $93
- note $53
- note $a3
- intensity $c0
- note $97
- intensity $c7
- note $97
- intensity $c2
- note $9f
- intensity $80
- octave3
- note $6f
- octave4
- note $1f
- octave3
- note $cf
- note $8f
- loopchannel $00, $66ee ; end
-; 0xea7f4
-
-_Music_JohtoGymLeaderBattle_Ch3: ; 0xea7f4
- notetype $0c, $19
- octave4
- note $60
- note $00
- octave3
- note $a1
- octave4
- note $60
- note $00
- octave3
- note $91
- octave4
- note $60
- note $00
- octave3
- note $81
- octave4
- note $60
- note $00
- octave3
- note $71
- octave4
- note $90
- note $00
- octave3
- note $61
- octave4
- note $90
- note $00
- octave3
- note $51
- note $61
- note $81
- note $93
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea952
- note $81
- note $31
- note $61
- note $81
- note $91
- note $91
- note $81
- note $61
- note $81
- note $31
- note $61
- note $81
- note $91
- note $41
- note $73
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea952
- note $81
- note $31
- note $61
- note $81
- note $91
- note $91
- note $81
- note $61
- note $81
- note $31
- note $61
- note $81
- note $91
- octave4
- note $11
- octave3
- note $b1
- note $91
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea963
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea963
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea96a
- note $21
- note $91
- note $21
- note $91
- note $21
- note $b1
- note $a1
- note $91
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea963
- note $31
- note $81
- note $31
- note $81
- note $31
- note $81
- note $91
- note $81
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea96a
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea96a
- note $11
- note $81
- note $b1
- note $11
- note $41
- note $61
- note $81
- note $b1
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea971
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea96a
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea978
- octave3
- note $81
- note $91
- note $61
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea971
- note $11
- note $81
- note $11
- note $81
- note $11
- note $51
- note $61
- note $81
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea96a
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea978
- octave3
- note $11
- note $21
- note $91
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea971
- note $11
- note $81
- note $11
- note $81
- note $61
- note $51
- note $61
- note $81
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea96a
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea978
- octave3
- note $61
- octave2
- note $b1
- octave3
- note $91
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea971
- note $11
- note $81
- note $11
- octave4
- note $11
- octave3
- note $b1
- note $81
- note $61
- note $81
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea983
- note $01
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea990
- octave4
- note $21
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea99c
- note $01
- note $41
- note $b1
- octave4
- note $41
- octave3
- note $41
- note $b1
- octave4
- note $41
- octave3
- note $41
- octave4
- note $41
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea983
- note $81
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea990
- note $91
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea99c
- note $a1
- octave4
- note $41
- octave3
- note $b1
- note $41
- octave4
- note $41
- octave3
- note $41
- octave4
- note $41
- note $33
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea9a9
- note $41
- note $91
- note $41
- octave4
- note $21
- octave3
- note $41
- note $a1
- note $41
- note $91
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea9a9
- note $41
- note $91
- note $41
- note $91
- note $41
- note $a1
- note $91
- note $71
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea9b1
- note $21
- note $71
- note $21
- octave4
- note $21
- octave3
- note $21
- note $a1
- note $21
- note $81
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea9b1
- note $21
- note $71
- note $21
- note $71
- note $21
- note $41
- note $51
- note $a1
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea9a9
- note $41
- note $91
- note $41
- note $91
- note $41
- note $91
- note $a1
- octave4
- note $21
- octave3
- note $41
- note $91
- note $41
- note $a1
- note $41
- note $c1
- note $41
- octave4
- note $21
- octave3
- note $91
- note $41
- note $71
- note $91
- note $a1
- note $a1
- note $91
- note $71
- note $91
- note $41
- note $71
- note $91
- note $71
- note $71
- note $51
- note $71
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea9b8
- note $61
- note $11
- note $41
- note $61
- note $41
- note $41
- note $21
- note $41
- callchannel _Music_JohtoGymLeaderBattle_sub_0xea9b8
- note $61
- note $11
- note $41
- note $61
- note $41
- note $71
- note $61
- note $41
- loopchannel $00, $683f ; end
-; 0xea952
-
-_Music_JohtoGymLeaderBattle_sub_0xea952: ; 0xea952
-; subroutine
- note $81
- note $31
- note $61
- note $81
- note $91
- note $91
- note $81
- note $61
- note $81
- note $31
- note $61
- note $81
- note $61
- note $61
- note $41
- note $61
- endchannel ; end
-; 0xea963
-
-_Music_JohtoGymLeaderBattle_sub_0xea963: ; 0xea963
-; subroutine
- note $31
- note $81
- loopchannel $04, $6963
- endchannel ; end
-; 0xea96a
-
-_Music_JohtoGymLeaderBattle_sub_0xea96a: ; 0xea96a
-; subroutine
- note $21
- note $91
- loopchannel $04, $696a
- endchannel ; end
-; 0xea971
-
-_Music_JohtoGymLeaderBattle_sub_0xea971: ; 0xea971
-; subroutine
- note $11
- note $81
- loopchannel $04, $6971
- endchannel ; end
-; 0xea978
-
-_Music_JohtoGymLeaderBattle_sub_0xea978: ; 0xea978
-; subroutine
- octave2
- note $b1
- octave3
- note $61
- octave2
- note $b1
- octave3
- note $61
- octave2
- note $b1
- endchannel ; end
-; 0xea983
-
-_Music_JohtoGymLeaderBattle_sub_0xea983: ; 0xea983
-; subroutine
- octave3
- note $11
- note $81
- octave4
- note $11
- octave3
- note $11
- note $81
- octave4
- note $11
- octave3
- note $11
- endchannel ; end
-; 0xea990
-
-_Music_JohtoGymLeaderBattle_sub_0xea990: ; 0xea990
-; subroutine
- note $21
- note $91
- octave4
- note $21
- octave3
- note $21
- note $91
- octave4
- note $21
- octave3
- note $21
- endchannel ; end
-; 0xea99c
-
-_Music_JohtoGymLeaderBattle_sub_0xea99c: ; 0xea99c
-; subroutine
- octave3
- note $31
- note $a1
- octave4
- note $31
- octave3
- note $31
- note $a1
- octave4
- note $31
- octave3
- note $31
- endchannel ; end
-; 0xea9a9
-
-_Music_JohtoGymLeaderBattle_sub_0xea9a9: ; 0xea9a9
-; subroutine
- octave3
- note $41
- note $91
- loopchannel $04, $69a9
- endchannel ; end
-; 0xea9b1
-
-_Music_JohtoGymLeaderBattle_sub_0xea9b1: ; 0xea9b1
-; subroutine
- note $21
- note $71
- loopchannel $04, $69b1
- endchannel ; end
-; 0xea9b8
-
-_Music_JohtoGymLeaderBattle_sub_0xea9b8: ; 0xea9b8
-; subroutine
- note $61
- note $11
- note $41
- note $61
- note $71
- note $71
- note $61
- note $41
- endchannel ; end
-; 0xea9c1
--- /dev/null
+++ b/audio/music/johtowildbattle.asm
@@ -1,0 +1,579 @@
+_Music_JohtoWildPokemonBattle: ; 0xf5dc5
+ db $80
+ dw _Music_JohtoWildPokemonBattle_Ch1
+ db $01
+ dw _Music_JohtoWildPokemonBattle_Ch2
+ db $02
+ dw _Music_JohtoWildPokemonBattle_Ch3
+; 0xf5dce
+
+_Music_JohtoWildPokemonBattle_Ch1: ; 0xf5dce
+ tempo $6800
+ volume $77
+ dutycycle $03
+ tone $0200
+ vibrato $12, $15
+ notetype $0c, $b2
+ octave4
+ note $10
+ octave3
+ note $c0
+ note $b0
+ note $a0
+ note $b0
+ note $a0
+ note $90
+ note $80
+ note $90
+ note $80
+ note $70
+ note $60
+ note $70
+ note $60
+ note $50
+ note $40
+ note $50
+ note $40
+ note $30
+ note $20
+ note $30
+ note $20
+ note $10
+ octave2
+ note $c0
+ octave3
+ note $10
+ octave2
+ note $c0
+ note $b0
+ note $a0
+ note $b0
+ note $c0
+ octave3
+ note $10
+ note $20
+ intensity $b2
+ note $85
+ octave2
+ note $b5
+ octave3
+ note $33
+ note $13
+ note $23
+ note $37
+ note $45
+ octave2
+ note $b5
+ octave3
+ note $43
+ note $13
+ note $33
+ intensity $b5
+ note $47
+ intensity $b2
+ octave4
+ note $35
+ octave3
+ note $b5
+ octave4
+ note $33
+ note $13
+ note $23
+ note $37
+ note $45
+ octave3
+ note $b5
+ octave4
+ note $43
+ note $13
+ note $33
+ intensity $6f
+ note $47
+ intensity $b6
+ octave3
+ note $35
+ octave2
+ note $c5
+ note $c3
+ octave3
+ note $65
+ note $55
+ note $13
+ note $97
+ note $b0
+ note $a0
+ note $80
+ note $70
+ note $80
+ note $90
+ note $a0
+ note $b0
+ octave4
+ note $17
+ octave3
+ note $c0
+ note $b0
+ note $90
+ note $80
+ note $90
+ note $a0
+ note $b0
+ note $c0
+ note $35
+ octave2
+ note $c5
+ note $c3
+ octave3
+ note $65
+ note $55
+ note $33
+ note $57
+ note $37
+ note $17
+ note $67
+ note $45
+ note $15
+ note $13
+ note $75
+ note $65
+ note $23
+ note $a7
+ note $c0
+ note $b0
+ note $90
+ note $80
+ note $90
+ note $a0
+ note $b0
+ note $c0
+ octave4
+ note $27
+ note $10
+ octave3
+ note $c0
+ note $a0
+ note $90
+ note $a0
+ note $b0
+ note $c0
+ octave4
+ note $10
+ octave3
+ note $45
+ note $15
+ note $13
+ note $75
+ note $65
+ note $23
+ note $67
+ note $47
+ note $27
+ note $77
+ intensity $b7
+ note $55
+ note $35
+ note $53
+ note $65
+ note $55
+ note $13
+ note $67
+ note $17
+ note $55
+ note $35
+ note $63
+ note $8f
+ octave4
+ note $37
+ note $87
+ note $8f
+ note $3f
+ octave3
+ note $13
+ note $33
+ note $13
+ octave2
+ note $c3
+ octave3
+ note $1f
+ note $33
+ note $53
+ note $33
+ note $73
+ note $8f
+ loopchannel $00, $5e2d ; end
+; 0xf5ea2
+
+_Music_JohtoWildPokemonBattle_Ch2: ; 0xf5ea2
+ dutycycle $03
+ vibrato $08, $36
+ tone $0100
+ callchannel _Music_JohtoWildPokemonBattle_sub_0xf5f5d
+ notetype $0c, $c2
+ octave4
+ note $85
+ octave3
+ note $35
+ note $83
+ note $63
+ note $73
+ note $87
+ note $95
+ note $35
+ note $93
+ note $63
+ note $83
+ intensity $c7
+ note $97
+ intensity $c2
+ octave4
+ note $85
+ note $35
+ note $83
+ note $63
+ note $73
+ note $87
+ note $95
+ note $35
+ note $93
+ note $63
+ note $83
+ intensity $6f
+ note $97
+ intensity $c4
+ octave3
+ note $85
+ note $35
+ note $31
+ note $81
+ octave4
+ note $11
+ octave3
+ note $c1
+ note $a1
+ note $81
+ note $61
+ note $81
+ note $a1
+ octave4
+ note $21
+ intensity $b0
+ note $4f
+ intensity $b7
+ note $4f
+ intensity $c4
+ octave3
+ note $85
+ note $35
+ note $31
+ note $81
+ octave4
+ note $13
+ octave3
+ note $c3
+ note $a3
+ note $c3
+ intensity $b0
+ note $af
+ intensity $b6
+ note $af
+ intensity $c4
+ note $95
+ note $45
+ note $41
+ note $91
+ octave4
+ note $21
+ note $11
+ octave3
+ note $b1
+ note $91
+ note $71
+ note $91
+ note $b1
+ octave4
+ note $31
+ intensity $b0
+ note $5f
+ intensity $b7
+ note $5f
+ intensity $c4
+ octave3
+ note $95
+ note $45
+ note $41
+ note $91
+ octave4
+ note $23
+ note $13
+ octave3
+ note $b3
+ note $93
+ intensity $b0
+ note $bf
+ intensity $b5
+ note $bf
+ intensity $c6
+ octave4
+ note $cb
+ note $81
+ note $c1
+ octave5
+ note $31
+ note $11
+ octave4
+ note $c1
+ note $a1
+ note $81
+ note $a1
+ note $c1
+ note $81
+ note $ab
+ octave3
+ note $61
+ note $a1
+ octave4
+ note $11
+ octave3
+ note $c1
+ note $a1
+ note $81
+ note $61
+ note $81
+ note $a1
+ octave4
+ note $11
+ intensity $c7
+ note $3f
+ note $87
+ octave5
+ note $17
+ octave4
+ note $cf
+ note $8f
+ octave3
+ note $53
+ note $73
+ note $53
+ note $33
+ note $5f
+ note $83
+ note $a3
+ note $83
+ note $b3
+ note $cf
+ loopchannel $00, $5ed1 ; end
+; 0xf5f5d
+
+_Music_JohtoWildPokemonBattle_sub_0xf5f5d: ; 0xf5f5d
+; subroutine
+ notetype $0c, $c2
+ octave4
+ note $60
+ note $70
+ note $80
+ octave5
+ note $80
+ octave4
+ note $60
+ note $70
+ note $80
+ octave5
+ note $80
+ octave4
+ note $60
+ note $70
+ note $80
+ octave5
+ note $80
+ octave4
+ note $60
+ note $70
+ note $80
+ octave5
+ note $80
+ octave4
+ note $60
+ note $70
+ note $80
+ octave5
+ note $80
+ octave4
+ note $60
+ note $70
+ note $80
+ octave5
+ note $80
+ octave4
+ note $60
+ note $70
+ note $80
+ octave5
+ note $80
+ octave4
+ note $60
+ note $70
+ note $80
+ octave5
+ note $80
+ endchannel ; end
+; 0xf5f91
+
+_Music_JohtoWildPokemonBattle_Ch3: ; 0xf5f91
+ notetype $0c, $14
+ octave4
+ note $81
+ octave5
+ note $31
+ octave4
+ note $81
+ octave5
+ note $21
+ octave4
+ note $71
+ octave5
+ note $11
+ octave4
+ note $71
+ note $c1
+ note $61
+ note $b1
+ note $61
+ note $a1
+ note $61
+ note $31
+ note $81
+ note $61
+ note $31
+ note $81
+ note $31
+ note $81
+ note $31
+ note $81
+ note $31
+ note $81
+ note $31
+ note $81
+ note $31
+ note $81
+ note $31
+ note $51
+ note $61
+ note $81
+ callchannel _Music_JohtoWildPokemonBattle_sub_0xf6055
+ note $41
+ note $91
+ note $41
+ note $91
+ note $41
+ note $41
+ note $81
+ note $61
+ note $31
+ note $81
+ loopchannel $06, $5fc6
+ note $31
+ note $51
+ note $61
+ note $81
+ callchannel _Music_JohtoWildPokemonBattle_sub_0xf6055
+ note $61
+ note $61
+ note $81
+ note $81
+ note $91
+ note $81
+ note $61
+ note $41
+ note $31
+ note $81
+ loopchannel $07, $5fdb
+ note $73
+ callchannel _Music_JohtoWildPokemonBattle_sub_0xf6055
+ callchannel _Music_JohtoWildPokemonBattle_sub_0xf6055
+ note $31
+ note $81
+ loopchannel $07, $5fe8
+ note $31
+ note $a1
+ note $11
+ note $61
+ loopchannel $05, $5ff0
+ note $51
+ note $31
+ note $11
+ note $31
+ note $51
+ note $61
+ callchannel _Music_JohtoWildPokemonBattle_sub_0xf6055
+ note $41
+ note $91
+ note $41
+ note $91
+ note $41
+ note $91
+ note $83
+ note $51
+ note $a1
+ loopchannel $08, $6006
+ callchannel _Music_JohtoWildPokemonBattle_sub_0xf6055
+ note $41
+ note $91
+ note $41
+ note $91
+ note $41
+ note $91
+ note $41
+ note $b1
+ note $21
+ note $71
+ note $21
+ note $71
+ note $21
+ note $71
+ note $21
+ note $71
+ note $21
+ note $71
+ note $61
+ note $71
+ note $91
+ note $71
+ note $61
+ note $41
+ note $31
+ note $81
+ loopchannel $08, $6027
+ note $11
+ note $61
+ loopchannel $07, $602d
+ note $51
+ note $11
+ note $33
+ note $83
+ note $33
+ note $83
+ note $31
+ note $81
+ loopchannel $0c, $6039
+ note $11
+ note $51
+ loopchannel $07, $603f
+ note $61
+ note $71
+ note $31
+ note $81
+ loopchannel $06, $6047
+ note $a1
+ note $81
+ note $71
+ note $51
+ loopchannel $00, $5fdb ; end
+; 0xf6055
+
+_Music_JohtoWildPokemonBattle_sub_0xf6055: ; 0xf6055
+; subroutine
+ note $41
+ note $91
+ loopchannel $04, $6055
+ endchannel ; end
+; 0xf605c
--- /dev/null
+++ b/audio/music/johtowildbattlenight.asm
@@ -1,0 +1,35 @@
+_Music_JohtoWildPokemonBattleNight: ; 0xf605c
+ db $80
+ dw _Music_JohtoWildPokemonBattleNight_Ch1
+ db $01
+ dw _Music_JohtoWildPokemonBattleNight_Ch2
+ db $02
+ dw _Music_JohtoWildPokemonBattleNight_Ch3
+; 0xf6065
+
+_Music_JohtoWildPokemonBattleNight_Ch1: ; 0xf6065
+ tempo $6b00
+ volume $77
+ dutycycle $03
+ tone $0200
+ vibrato $10, $25
+ loopchannel $00, $5ddb ; end
+; 0xf6076
+
+_Music_JohtoWildPokemonBattleNight_Ch2: ; 0xf6076
+ dutycycle $03
+ vibrato $20, $36
+ tone $0100
+ callchannel _Music_JohtoWildPokemonBattle_sub_0xf5f5d
+ notetype $0c, $c2
+ octave4
+ note $85
+ tone $0100
+ dutycycle $02
+ loopchannel $00, $5eb2 ; end
+; 0xf608f
+
+_Music_JohtoWildPokemonBattleNight_Ch3: ; 0xf608f
+ notetype $0c, $11
+ loopchannel $00, $5f94 ; end
+; 0xf6096
--- a/audio/music/johtowildpokemonbattle.asm
+++ /dev/null
@@ -1,579 +1,0 @@
-_Music_JohtoWildPokemonBattle: ; 0xf5dc5
- db $80
- dw _Music_JohtoWildPokemonBattle_Ch1
- db $01
- dw _Music_JohtoWildPokemonBattle_Ch2
- db $02
- dw _Music_JohtoWildPokemonBattle_Ch3
-; 0xf5dce
-
-_Music_JohtoWildPokemonBattle_Ch1: ; 0xf5dce
- tempo $6800
- volume $77
- dutycycle $03
- tone $0200
- vibrato $12, $15
- notetype $0c, $b2
- octave4
- note $10
- octave3
- note $c0
- note $b0
- note $a0
- note $b0
- note $a0
- note $90
- note $80
- note $90
- note $80
- note $70
- note $60
- note $70
- note $60
- note $50
- note $40
- note $50
- note $40
- note $30
- note $20
- note $30
- note $20
- note $10
- octave2
- note $c0
- octave3
- note $10
- octave2
- note $c0
- note $b0
- note $a0
- note $b0
- note $c0
- octave3
- note $10
- note $20
- intensity $b2
- note $85
- octave2
- note $b5
- octave3
- note $33
- note $13
- note $23
- note $37
- note $45
- octave2
- note $b5
- octave3
- note $43
- note $13
- note $33
- intensity $b5
- note $47
- intensity $b2
- octave4
- note $35
- octave3
- note $b5
- octave4
- note $33
- note $13
- note $23
- note $37
- note $45
- octave3
- note $b5
- octave4
- note $43
- note $13
- note $33
- intensity $6f
- note $47
- intensity $b6
- octave3
- note $35
- octave2
- note $c5
- note $c3
- octave3
- note $65
- note $55
- note $13
- note $97
- note $b0
- note $a0
- note $80
- note $70
- note $80
- note $90
- note $a0
- note $b0
- octave4
- note $17
- octave3
- note $c0
- note $b0
- note $90
- note $80
- note $90
- note $a0
- note $b0
- note $c0
- note $35
- octave2
- note $c5
- note $c3
- octave3
- note $65
- note $55
- note $33
- note $57
- note $37
- note $17
- note $67
- note $45
- note $15
- note $13
- note $75
- note $65
- note $23
- note $a7
- note $c0
- note $b0
- note $90
- note $80
- note $90
- note $a0
- note $b0
- note $c0
- octave4
- note $27
- note $10
- octave3
- note $c0
- note $a0
- note $90
- note $a0
- note $b0
- note $c0
- octave4
- note $10
- octave3
- note $45
- note $15
- note $13
- note $75
- note $65
- note $23
- note $67
- note $47
- note $27
- note $77
- intensity $b7
- note $55
- note $35
- note $53
- note $65
- note $55
- note $13
- note $67
- note $17
- note $55
- note $35
- note $63
- note $8f
- octave4
- note $37
- note $87
- note $8f
- note $3f
- octave3
- note $13
- note $33
- note $13
- octave2
- note $c3
- octave3
- note $1f
- note $33
- note $53
- note $33
- note $73
- note $8f
- loopchannel $00, $5e2d ; end
-; 0xf5ea2
-
-_Music_JohtoWildPokemonBattle_Ch2: ; 0xf5ea2
- dutycycle $03
- vibrato $08, $36
- tone $0100
- callchannel _Music_JohtoWildPokemonBattle_sub_0xf5f5d
- notetype $0c, $c2
- octave4
- note $85
- octave3
- note $35
- note $83
- note $63
- note $73
- note $87
- note $95
- note $35
- note $93
- note $63
- note $83
- intensity $c7
- note $97
- intensity $c2
- octave4
- note $85
- note $35
- note $83
- note $63
- note $73
- note $87
- note $95
- note $35
- note $93
- note $63
- note $83
- intensity $6f
- note $97
- intensity $c4
- octave3
- note $85
- note $35
- note $31
- note $81
- octave4
- note $11
- octave3
- note $c1
- note $a1
- note $81
- note $61
- note $81
- note $a1
- octave4
- note $21
- intensity $b0
- note $4f
- intensity $b7
- note $4f
- intensity $c4
- octave3
- note $85
- note $35
- note $31
- note $81
- octave4
- note $13
- octave3
- note $c3
- note $a3
- note $c3
- intensity $b0
- note $af
- intensity $b6
- note $af
- intensity $c4
- note $95
- note $45
- note $41
- note $91
- octave4
- note $21
- note $11
- octave3
- note $b1
- note $91
- note $71
- note $91
- note $b1
- octave4
- note $31
- intensity $b0
- note $5f
- intensity $b7
- note $5f
- intensity $c4
- octave3
- note $95
- note $45
- note $41
- note $91
- octave4
- note $23
- note $13
- octave3
- note $b3
- note $93
- intensity $b0
- note $bf
- intensity $b5
- note $bf
- intensity $c6
- octave4
- note $cb
- note $81
- note $c1
- octave5
- note $31
- note $11
- octave4
- note $c1
- note $a1
- note $81
- note $a1
- note $c1
- note $81
- note $ab
- octave3
- note $61
- note $a1
- octave4
- note $11
- octave3
- note $c1
- note $a1
- note $81
- note $61
- note $81
- note $a1
- octave4
- note $11
- intensity $c7
- note $3f
- note $87
- octave5
- note $17
- octave4
- note $cf
- note $8f
- octave3
- note $53
- note $73
- note $53
- note $33
- note $5f
- note $83
- note $a3
- note $83
- note $b3
- note $cf
- loopchannel $00, $5ed1 ; end
-; 0xf5f5d
-
-_Music_JohtoWildPokemonBattle_sub_0xf5f5d: ; 0xf5f5d
-; subroutine
- notetype $0c, $c2
- octave4
- note $60
- note $70
- note $80
- octave5
- note $80
- octave4
- note $60
- note $70
- note $80
- octave5
- note $80
- octave4
- note $60
- note $70
- note $80
- octave5
- note $80
- octave4
- note $60
- note $70
- note $80
- octave5
- note $80
- octave4
- note $60
- note $70
- note $80
- octave5
- note $80
- octave4
- note $60
- note $70
- note $80
- octave5
- note $80
- octave4
- note $60
- note $70
- note $80
- octave5
- note $80
- octave4
- note $60
- note $70
- note $80
- octave5
- note $80
- endchannel ; end
-; 0xf5f91
-
-_Music_JohtoWildPokemonBattle_Ch3: ; 0xf5f91
- notetype $0c, $14
- octave4
- note $81
- octave5
- note $31
- octave4
- note $81
- octave5
- note $21
- octave4
- note $71
- octave5
- note $11
- octave4
- note $71
- note $c1
- note $61
- note $b1
- note $61
- note $a1
- note $61
- note $31
- note $81
- note $61
- note $31
- note $81
- note $31
- note $81
- note $31
- note $81
- note $31
- note $81
- note $31
- note $81
- note $31
- note $81
- note $31
- note $51
- note $61
- note $81
- callchannel _Music_JohtoWildPokemonBattle_sub_0xf6055
- note $41
- note $91
- note $41
- note $91
- note $41
- note $41
- note $81
- note $61
- note $31
- note $81
- loopchannel $06, $5fc6
- note $31
- note $51
- note $61
- note $81
- callchannel _Music_JohtoWildPokemonBattle_sub_0xf6055
- note $61
- note $61
- note $81
- note $81
- note $91
- note $81
- note $61
- note $41
- note $31
- note $81
- loopchannel $07, $5fdb
- note $73
- callchannel _Music_JohtoWildPokemonBattle_sub_0xf6055
- callchannel _Music_JohtoWildPokemonBattle_sub_0xf6055
- note $31
- note $81
- loopchannel $07, $5fe8
- note $31
- note $a1
- note $11
- note $61
- loopchannel $05, $5ff0
- note $51
- note $31
- note $11
- note $31
- note $51
- note $61
- callchannel _Music_JohtoWildPokemonBattle_sub_0xf6055
- note $41
- note $91
- note $41
- note $91
- note $41
- note $91
- note $83
- note $51
- note $a1
- loopchannel $08, $6006
- callchannel _Music_JohtoWildPokemonBattle_sub_0xf6055
- note $41
- note $91
- note $41
- note $91
- note $41
- note $91
- note $41
- note $b1
- note $21
- note $71
- note $21
- note $71
- note $21
- note $71
- note $21
- note $71
- note $21
- note $71
- note $61
- note $71
- note $91
- note $71
- note $61
- note $41
- note $31
- note $81
- loopchannel $08, $6027
- note $11
- note $61
- loopchannel $07, $602d
- note $51
- note $11
- note $33
- note $83
- note $33
- note $83
- note $31
- note $81
- loopchannel $0c, $6039
- note $11
- note $51
- loopchannel $07, $603f
- note $61
- note $71
- note $31
- note $81
- loopchannel $06, $6047
- note $a1
- note $81
- note $71
- note $51
- loopchannel $00, $5fdb ; end
-; 0xf6055
-
-_Music_JohtoWildPokemonBattle_sub_0xf6055: ; 0xf6055
-; subroutine
- note $41
- note $91
- loopchannel $04, $6055
- endchannel ; end
-; 0xf605c
--- a/audio/music/johtowildpokemonbattlenight.asm
+++ /dev/null
@@ -1,35 +1,0 @@
-_Music_JohtoWildPokemonBattleNight: ; 0xf605c
- db $80
- dw _Music_JohtoWildPokemonBattleNight_Ch1
- db $01
- dw _Music_JohtoWildPokemonBattleNight_Ch2
- db $02
- dw _Music_JohtoWildPokemonBattleNight_Ch3
-; 0xf6065
-
-_Music_JohtoWildPokemonBattleNight_Ch1: ; 0xf6065
- tempo $6b00
- volume $77
- dutycycle $03
- tone $0200
- vibrato $10, $25
- loopchannel $00, $5ddb ; end
-; 0xf6076
-
-_Music_JohtoWildPokemonBattleNight_Ch2: ; 0xf6076
- dutycycle $03
- vibrato $20, $36
- tone $0100
- callchannel _Music_JohtoWildPokemonBattle_sub_0xf5f5d
- notetype $0c, $c2
- octave4
- note $85
- tone $0100
- dutycycle $02
- loopchannel $00, $5eb2 ; end
-; 0xf608f
-
-_Music_JohtoWildPokemonBattleNight_Ch3: ; 0xf608f
- notetype $0c, $11
- loopchannel $00, $5f94 ; end
-; 0xf6096
--- /dev/null
+++ b/audio/music/kantogymbattle.asm
@@ -1,0 +1,604 @@
+_Music_KantoGymLeaderBattle: ; 0xec720
+ db $80
+ dw _Music_KantoGymLeaderBattle_Ch1
+ db $01
+ dw _Music_KantoGymLeaderBattle_Ch2
+ db $02
+ dw _Music_KantoGymLeaderBattle_Ch3
+; 0xec729
+
+_Music_KantoGymLeaderBattle_Ch1: ; 0xec729
+ tempo $6500
+ volume $77
+ dutycycle $03
+ tone $0200
+ vibrato $12, $15
+ notetype $0c, $b2
+ octave3
+ note $b0
+ note $a0
+ note $90
+ note $80
+ note $90
+ note $80
+ note $70
+ note $80
+ note $70
+ note $60
+ note $70
+ note $60
+ note $50
+ note $60
+ note $50
+ note $40
+ note $50
+ note $40
+ note $30
+ note $40
+ note $30
+ note $20
+ note $30
+ note $20
+ note $10
+ note $20
+ note $10
+ octave2
+ note $c0
+ octave3
+ note $10
+ octave2
+ note $c0
+ note $b0
+ note $c0
+ note $b1
+ note $b5
+ note $b1
+ note $b5
+ note $b1
+ note $b7
+ intensity $b7
+ note $c1
+ intensity $b2
+ note $b1
+ note $b5
+ note $b1
+ note $b5
+ note $b1
+ note $b7
+ intensity $b7
+ octave3
+ note $51
+ intensity $b2
+ octave2
+ note $b1
+ note $b5
+ note $b1
+ note $b5
+ note $b1
+ note $b7
+ intensity $b7
+ note $c1
+ intensity $b2
+ note $b1
+ note $b5
+ note $b1
+ note $b5
+ note $b1
+ intensity $b4
+ octave3
+ note $53
+ note $53
+ note $51
+ callchannel _Music_KantoGymLeaderBattle_sub_0xec832
+ octave2
+ note $b1
+ intensity $b7
+ note $97
+ note $c7
+ octave3
+ note $49
+ note $55
+ callchannel _Music_KantoGymLeaderBattle_sub_0xec832
+ note $41
+ intensity $b7
+ note $27
+ octave2
+ note $c7
+ note $99
+ octave3
+ note $55
+ intensity $b2
+ note $41
+ note $41
+ note $80
+ note $50
+ note $40
+ note $80
+ note $41
+ note $41
+ note $b0
+ note $90
+ note $50
+ note $b0
+ note $41
+ note $41
+ note $c0
+ note $b0
+ note $90
+ note $c0
+ note $41
+ intensity $b7
+ note $51
+ intensity $b2
+ note $41
+ note $41
+ note $80
+ note $50
+ note $40
+ note $80
+ note $41
+ note $41
+ note $b0
+ note $90
+ note $50
+ note $b0
+ note $41
+ note $41
+ note $c0
+ note $b0
+ note $90
+ note $c0
+ note $91
+ intensity $b5
+ note $c1
+ note $41
+ note $21
+ octave2
+ note $b3
+ note $41
+ note $91
+ note $c1
+ octave3
+ note $51
+ note $43
+ note $21
+ octave2
+ note $b1
+ note $b1
+ note $41
+ note $b1
+ octave3
+ note $21
+ intensity $b7
+ octave2
+ note $c7
+ note $b7
+ note $99
+ note $c5
+ intensity $b5
+ octave3
+ note $41
+ note $21
+ octave2
+ note $b3
+ note $41
+ note $91
+ note $c1
+ octave3
+ note $51
+ note $43
+ note $21
+ octave2
+ note $b1
+ note $b1
+ note $91
+ note $b1
+ octave3
+ note $21
+ intensity $b7
+ note $57
+ note $77
+ note $8f
+ intensity $b2
+ octave2
+ note $91
+ note $91
+ intensity $b7
+ octave3
+ note $2b
+ intensity $b2
+ note $91
+ note $63
+ intensity $b5
+ octave2
+ note $63
+ note $81
+ note $91
+ note $b1
+ intensity $b2
+ note $b1
+ note $b1
+ intensity $b7
+ octave3
+ note $4b
+ intensity $b2
+ note $b1
+ note $83
+ intensity $b7
+ octave4
+ note $45
+ intensity $4c
+ octave3
+ note $33
+ loopchannel $00, $478b ; end
+; 0xec832
+
+_Music_KantoGymLeaderBattle_sub_0xec832: ; 0xec832
+; subroutine
+ intensity $b5
+ note $41
+ octave2
+ note $b1
+ octave3
+ note $41
+ note $53
+ note $41
+ note $21
+ octave2
+ note $b1
+ note $41
+ note $91
+ note $b1
+ octave3
+ note $41
+ note $51
+ note $41
+ note $21
+ endchannel ; end
+; 0xec847
+
+_Music_KantoGymLeaderBattle_Ch2: ; 0xec847
+ dutycycle $03
+ vibrato $08, $36
+ tone $0100
+ notetype $0c, $c2
+ octave4
+ note $b0
+ note $90
+ note $b0
+ octave5
+ note $40
+ loopchannel $08, $4852
+ octave3
+ intensity $c2
+ note $41
+ note $41
+ note $70
+ note $50
+ note $40
+ note $70
+ note $41
+ note $41
+ note $b0
+ note $90
+ note $70
+ note $b0
+ note $41
+ note $41
+ note $c0
+ note $b0
+ note $90
+ note $c0
+ note $31
+ intensity $c7
+ note $51
+ intensity $c2
+ note $41
+ note $41
+ note $70
+ note $50
+ note $40
+ note $70
+ note $41
+ note $41
+ note $b0
+ note $90
+ note $70
+ note $b0
+ note $41
+ note $41
+ note $c0
+ note $b0
+ note $90
+ note $c0
+ note $91
+ intensity $c7
+ note $c1
+ intensity $c2
+ octave4
+ loopchannel $02, $485d
+ callchannel _Music_KantoGymLeaderBattle_sub_0xec907
+ note $57
+ note $97
+ note $c9
+ note $95
+ callchannel _Music_KantoGymLeaderBattle_sub_0xec907
+ note $57
+ note $97
+ note $c9
+ octave4
+ note $55
+ note $47
+ intensity $b7
+ note $47
+ intensity $a2
+ note $05
+ octave5
+ note $53
+ note $53
+ note $51
+ intensity $a0
+ note $47
+ intensity $a7
+ note $47
+ note $0b
+ intensity $c5
+ octave3
+ note $b3
+ note $c3
+ note $93
+ note $b3
+ note $c3
+ note $93
+ note $53
+ intensity $b0
+ note $47
+ note $4f
+ intensity $b7
+ note $4b
+ intensity $c5
+ note $b3
+ note $c3
+ note $93
+ note $b3
+ note $c3
+ note $93
+ note $c3
+ intensity $b0
+ note $b7
+ intensity $b7
+ note $b7
+ intensity $b0
+ octave4
+ note $47
+ intensity $b7
+ note $47
+ intensity $c2
+ octave3
+ note $21
+ note $21
+ intensity $c7
+ note $67
+ intensity $c2
+ octave4
+ note $23
+ note $61
+ note $23
+ intensity $c7
+ note $93
+ note $81
+ note $61
+ note $41
+ intensity $c2
+ octave3
+ note $41
+ note $41
+ intensity $c7
+ note $87
+ intensity $c2
+ octave4
+ note $43
+ note $81
+ note $43
+ intensity $c7
+ note $b5
+ octave3
+ note $a3
+ loopchannel $00, $4894 ; end
+; 0xec907
+
+_Music_KantoGymLeaderBattle_sub_0xec907: ; 0xec907
+; subroutine
+ dutycycle $02
+ intensity $d1
+ octave3
+ note $b1
+ intensity $a2
+ note $b1
+ intensity $d1
+ note $91
+ intensity $a2
+ note $91
+ intensity $d1
+ note $b1
+ intensity $a2
+ note $b1
+ intensity $c5
+ note $c1
+ octave4
+ note $21
+ note $21
+ octave3
+ note $c3
+ note $b1
+ note $91
+ note $71
+ note $91
+ note $b1
+ dutycycle $03
+ intensity $b0
+ endchannel ; end
+; 0xec92e
+
+_Music_KantoGymLeaderBattle_Ch3: ; 0xec92e
+ notetype $0c, $19
+ octave2
+ note $50
+ note $00
+ note $c2
+ note $00
+ loopchannel $06, $4934
+ note $c1
+ note $91
+ note $c1
+ note $40
+ note $00
+ note $40
+ note $00
+ note $73
+ note $40
+ note $00
+ note $40
+ note $00
+ note $b3
+ note $40
+ note $00
+ note $40
+ note $00
+ note $c3
+ note $30
+ note $00
+ note $61
+ note $40
+ note $00
+ note $40
+ note $00
+ note $73
+ note $40
+ note $00
+ note $40
+ note $00
+ note $b3
+ note $40
+ note $00
+ note $40
+ note $00
+ note $c3
+ note $40
+ note $00
+ note $51
+ loopchannel $02, $493d
+ octave2
+ note $41
+ note $b1
+ loopchannel $08, $4965
+ note $51
+ note $c1
+ loopchannel $04, $496c
+ octave1
+ note $c1
+ octave2
+ note $51
+ octave1
+ note $c1
+ octave2
+ note $53
+ note $c1
+ octave3
+ note $51
+ octave2
+ note $c1
+ octave2
+ note $71
+ octave3
+ note $21
+ loopchannel $08, $497f
+ octave2
+ note $51
+ note $c1
+ loopchannel $07, $4987
+ octave3
+ note $51
+ octave2
+ note $c1
+ note $40
+ note $00
+ note $40
+ note $00
+ note $b3
+ note $40
+ note $00
+ note $40
+ note $00
+ note $c3
+ note $40
+ note $00
+ note $40
+ note $00
+ note $b3
+ note $40
+ note $00
+ note $51
+ loopchannel $02, $4992
+ note $41
+ note $b1
+ loopchannel $07, $49a8
+ octave3
+ note $21
+ octave2
+ note $b1
+ note $51
+ note $c1
+ octave3
+ note $51
+ octave2
+ note $51
+ note $c1
+ octave3
+ note $51
+ octave2
+ note $51
+ note $c1
+ loopchannel $05, $49bb
+ octave2
+ note $71
+ octave3
+ note $21
+ loopchannel $07, $49c2
+ octave2
+ note $b1
+ octave3
+ note $21
+ octave2
+ note $51
+ note $b1
+ octave3
+ note $51
+ note $71
+ note $91
+ note $71
+ note $51
+ note $21
+ octave2
+ note $41
+ note $b1
+ loopchannel $04, $49d8
+ note $21
+ note $91
+ loopchannel $08, $49df
+ note $41
+ note $b1
+ loopchannel $04, $49e5
+ octave3
+ note $41
+ octave2
+ note $b1
+ note $41
+ note $31
+ note $31
+ note $b1
+ octave3
+ note $41
+ note $61
+ loopchannel $00, $4965 ; end
+; 0xec9fa
--- a/audio/music/kantogymleaderbattle.asm
+++ /dev/null
@@ -1,604 +1,0 @@
-_Music_KantoGymLeaderBattle: ; 0xec720
- db $80
- dw _Music_KantoGymLeaderBattle_Ch1
- db $01
- dw _Music_KantoGymLeaderBattle_Ch2
- db $02
- dw _Music_KantoGymLeaderBattle_Ch3
-; 0xec729
-
-_Music_KantoGymLeaderBattle_Ch1: ; 0xec729
- tempo $6500
- volume $77
- dutycycle $03
- tone $0200
- vibrato $12, $15
- notetype $0c, $b2
- octave3
- note $b0
- note $a0
- note $90
- note $80
- note $90
- note $80
- note $70
- note $80
- note $70
- note $60
- note $70
- note $60
- note $50
- note $60
- note $50
- note $40
- note $50
- note $40
- note $30
- note $40
- note $30
- note $20
- note $30
- note $20
- note $10
- note $20
- note $10
- octave2
- note $c0
- octave3
- note $10
- octave2
- note $c0
- note $b0
- note $c0
- note $b1
- note $b5
- note $b1
- note $b5
- note $b1
- note $b7
- intensity $b7
- note $c1
- intensity $b2
- note $b1
- note $b5
- note $b1
- note $b5
- note $b1
- note $b7
- intensity $b7
- octave3
- note $51
- intensity $b2
- octave2
- note $b1
- note $b5
- note $b1
- note $b5
- note $b1
- note $b7
- intensity $b7
- note $c1
- intensity $b2
- note $b1
- note $b5
- note $b1
- note $b5
- note $b1
- intensity $b4
- octave3
- note $53
- note $53
- note $51
- callchannel _Music_KantoGymLeaderBattle_sub_0xec832
- octave2
- note $b1
- intensity $b7
- note $97
- note $c7
- octave3
- note $49
- note $55
- callchannel _Music_KantoGymLeaderBattle_sub_0xec832
- note $41
- intensity $b7
- note $27
- octave2
- note $c7
- note $99
- octave3
- note $55
- intensity $b2
- note $41
- note $41
- note $80
- note $50
- note $40
- note $80
- note $41
- note $41
- note $b0
- note $90
- note $50
- note $b0
- note $41
- note $41
- note $c0
- note $b0
- note $90
- note $c0
- note $41
- intensity $b7
- note $51
- intensity $b2
- note $41
- note $41
- note $80
- note $50
- note $40
- note $80
- note $41
- note $41
- note $b0
- note $90
- note $50
- note $b0
- note $41
- note $41
- note $c0
- note $b0
- note $90
- note $c0
- note $91
- intensity $b5
- note $c1
- note $41
- note $21
- octave2
- note $b3
- note $41
- note $91
- note $c1
- octave3
- note $51
- note $43
- note $21
- octave2
- note $b1
- note $b1
- note $41
- note $b1
- octave3
- note $21
- intensity $b7
- octave2
- note $c7
- note $b7
- note $99
- note $c5
- intensity $b5
- octave3
- note $41
- note $21
- octave2
- note $b3
- note $41
- note $91
- note $c1
- octave3
- note $51
- note $43
- note $21
- octave2
- note $b1
- note $b1
- note $91
- note $b1
- octave3
- note $21
- intensity $b7
- note $57
- note $77
- note $8f
- intensity $b2
- octave2
- note $91
- note $91
- intensity $b7
- octave3
- note $2b
- intensity $b2
- note $91
- note $63
- intensity $b5
- octave2
- note $63
- note $81
- note $91
- note $b1
- intensity $b2
- note $b1
- note $b1
- intensity $b7
- octave3
- note $4b
- intensity $b2
- note $b1
- note $83
- intensity $b7
- octave4
- note $45
- intensity $4c
- octave3
- note $33
- loopchannel $00, $478b ; end
-; 0xec832
-
-_Music_KantoGymLeaderBattle_sub_0xec832: ; 0xec832
-; subroutine
- intensity $b5
- note $41
- octave2
- note $b1
- octave3
- note $41
- note $53
- note $41
- note $21
- octave2
- note $b1
- note $41
- note $91
- note $b1
- octave3
- note $41
- note $51
- note $41
- note $21
- endchannel ; end
-; 0xec847
-
-_Music_KantoGymLeaderBattle_Ch2: ; 0xec847
- dutycycle $03
- vibrato $08, $36
- tone $0100
- notetype $0c, $c2
- octave4
- note $b0
- note $90
- note $b0
- octave5
- note $40
- loopchannel $08, $4852
- octave3
- intensity $c2
- note $41
- note $41
- note $70
- note $50
- note $40
- note $70
- note $41
- note $41
- note $b0
- note $90
- note $70
- note $b0
- note $41
- note $41
- note $c0
- note $b0
- note $90
- note $c0
- note $31
- intensity $c7
- note $51
- intensity $c2
- note $41
- note $41
- note $70
- note $50
- note $40
- note $70
- note $41
- note $41
- note $b0
- note $90
- note $70
- note $b0
- note $41
- note $41
- note $c0
- note $b0
- note $90
- note $c0
- note $91
- intensity $c7
- note $c1
- intensity $c2
- octave4
- loopchannel $02, $485d
- callchannel _Music_KantoGymLeaderBattle_sub_0xec907
- note $57
- note $97
- note $c9
- note $95
- callchannel _Music_KantoGymLeaderBattle_sub_0xec907
- note $57
- note $97
- note $c9
- octave4
- note $55
- note $47
- intensity $b7
- note $47
- intensity $a2
- note $05
- octave5
- note $53
- note $53
- note $51
- intensity $a0
- note $47
- intensity $a7
- note $47
- note $0b
- intensity $c5
- octave3
- note $b3
- note $c3
- note $93
- note $b3
- note $c3
- note $93
- note $53
- intensity $b0
- note $47
- note $4f
- intensity $b7
- note $4b
- intensity $c5
- note $b3
- note $c3
- note $93
- note $b3
- note $c3
- note $93
- note $c3
- intensity $b0
- note $b7
- intensity $b7
- note $b7
- intensity $b0
- octave4
- note $47
- intensity $b7
- note $47
- intensity $c2
- octave3
- note $21
- note $21
- intensity $c7
- note $67
- intensity $c2
- octave4
- note $23
- note $61
- note $23
- intensity $c7
- note $93
- note $81
- note $61
- note $41
- intensity $c2
- octave3
- note $41
- note $41
- intensity $c7
- note $87
- intensity $c2
- octave4
- note $43
- note $81
- note $43
- intensity $c7
- note $b5
- octave3
- note $a3
- loopchannel $00, $4894 ; end
-; 0xec907
-
-_Music_KantoGymLeaderBattle_sub_0xec907: ; 0xec907
-; subroutine
- dutycycle $02
- intensity $d1
- octave3
- note $b1
- intensity $a2
- note $b1
- intensity $d1
- note $91
- intensity $a2
- note $91
- intensity $d1
- note $b1
- intensity $a2
- note $b1
- intensity $c5
- note $c1
- octave4
- note $21
- note $21
- octave3
- note $c3
- note $b1
- note $91
- note $71
- note $91
- note $b1
- dutycycle $03
- intensity $b0
- endchannel ; end
-; 0xec92e
-
-_Music_KantoGymLeaderBattle_Ch3: ; 0xec92e
- notetype $0c, $19
- octave2
- note $50
- note $00
- note $c2
- note $00
- loopchannel $06, $4934
- note $c1
- note $91
- note $c1
- note $40
- note $00
- note $40
- note $00
- note $73
- note $40
- note $00
- note $40
- note $00
- note $b3
- note $40
- note $00
- note $40
- note $00
- note $c3
- note $30
- note $00
- note $61
- note $40
- note $00
- note $40
- note $00
- note $73
- note $40
- note $00
- note $40
- note $00
- note $b3
- note $40
- note $00
- note $40
- note $00
- note $c3
- note $40
- note $00
- note $51
- loopchannel $02, $493d
- octave2
- note $41
- note $b1
- loopchannel $08, $4965
- note $51
- note $c1
- loopchannel $04, $496c
- octave1
- note $c1
- octave2
- note $51
- octave1
- note $c1
- octave2
- note $53
- note $c1
- octave3
- note $51
- octave2
- note $c1
- octave2
- note $71
- octave3
- note $21
- loopchannel $08, $497f
- octave2
- note $51
- note $c1
- loopchannel $07, $4987
- octave3
- note $51
- octave2
- note $c1
- note $40
- note $00
- note $40
- note $00
- note $b3
- note $40
- note $00
- note $40
- note $00
- note $c3
- note $40
- note $00
- note $40
- note $00
- note $b3
- note $40
- note $00
- note $51
- loopchannel $02, $4992
- note $41
- note $b1
- loopchannel $07, $49a8
- octave3
- note $21
- octave2
- note $b1
- note $51
- note $c1
- octave3
- note $51
- octave2
- note $51
- note $c1
- octave3
- note $51
- octave2
- note $51
- note $c1
- loopchannel $05, $49bb
- octave2
- note $71
- octave3
- note $21
- loopchannel $07, $49c2
- octave2
- note $b1
- octave3
- note $21
- octave2
- note $51
- note $b1
- octave3
- note $51
- note $71
- note $91
- note $71
- note $51
- note $21
- octave2
- note $41
- note $b1
- loopchannel $04, $49d8
- note $21
- note $91
- loopchannel $08, $49df
- note $41
- note $b1
- loopchannel $04, $49e5
- octave3
- note $41
- octave2
- note $b1
- note $41
- note $31
- note $31
- note $b1
- octave3
- note $41
- note $61
- loopchannel $00, $4965 ; end
-; 0xec9fa
--- /dev/null
+++ b/audio/music/kantowildbattle.asm
@@ -1,0 +1,1229 @@
+_Music_KantoWildPokemonBattle: ; 0xed06d
+ db $80
+ dw _Music_KantoWildPokemonBattle_Ch1
+ db $01
+ dw _Music_KantoWildPokemonBattle_Ch2
+ db $02
+ dw _Music_KantoWildPokemonBattle_Ch3
+; 0xed076
+
+; 0xed076
+ db $03
+; 0xed077
+
+_Music_KantoWildPokemonBattle_Ch1: ; 0xed077
+ tempo $7000
+ volume $77
+ vibrato $12, $23
+ dutycycle $02
+ notetype $0c, $b7
+ note $0f
+ octave4
+ note $b5
+ note $a0
+ note $90
+ note $a0
+ note $90
+ note $80
+ note $70
+ note $90
+ note $80
+ note $70
+ note $60
+ notetype $0c, $b7
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed18a
+ octave4
+ note $63
+ note $23
+ octave3
+ note $c7
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed18a
+ note $07
+ note $80
+ note $c0
+ octave4
+ note $20
+ octave3
+ note $c0
+ note $80
+ note $c0
+ octave4
+ note $30
+ note $40
+ intensity $b1
+ note $55
+ note $15
+ octave3
+ note $83
+ octave4
+ note $55
+ note $15
+ note $53
+ intensity $b7
+ note $60
+ note $20
+ octave3
+ note $90
+ octave4
+ note $10
+ note $20
+ octave3
+ note $90
+ note $60
+ note $80
+ note $93
+ note $70
+ note $80
+ note $90
+ octave4
+ note $10
+ note $23
+ octave3
+ note $60
+ note $90
+ octave4
+ note $20
+ note $50
+ note $62
+ note $80
+ note $93
+ intensity $b1
+ octave3
+ note $85
+ note $65
+ note $53
+ note $95
+ note $85
+ note $63
+ octave4
+ note $15
+ octave3
+ note $b5
+ note $83
+ notetype $08, $b7
+ octave2
+ note $81
+ octave3
+ note $11
+ note $51
+ note $11
+ note $51
+ note $81
+ note $51
+ note $81
+ octave4
+ note $11
+ octave3
+ note $81
+ octave4
+ note $11
+ note $51
+ note $61
+ note $21
+ octave3
+ note $91
+ octave4
+ note $21
+ octave3
+ note $91
+ note $61
+ note $91
+ note $61
+ note $21
+ note $61
+ note $21
+ octave2
+ note $91
+ notetype $0c, $b7
+ octave3
+ note $93
+ octave4
+ note $23
+ intensity $71
+ note $60
+ note $60
+ intensity $91
+ note $60
+ note $60
+ intensity $b1
+ note $90
+ note $90
+ intensity $d1
+ note $90
+ note $90
+ intensity $c7
+ note $50
+ note $30
+ note $20
+ note $30
+ note $5b
+ note $57
+ intensity $b1
+ note $50
+ note $30
+ note $10
+ octave3
+ note $b0
+ note $a0
+ note $80
+ note $60
+ note $50
+ intensity $b7
+ note $37
+ note $67
+ note $b7
+ octave4
+ note $37
+ octave3
+ note $87
+ octave4
+ note $17
+ note $57
+ note $87
+ note $07
+ octave3
+ note $47
+ note $97
+ octave4
+ note $17
+ octave3
+ note $b7
+ note $07
+ octave4
+ note $37
+ octave3
+ note $91
+ note $61
+ note $31
+ note $61
+ octave4
+ note $13
+ note $05
+ note $10
+ note $04
+ note $21
+ note $10
+ note $0c
+ note $23
+ note $05
+ note $20
+ note $04
+ note $61
+ note $40
+ note $04
+ note $27
+ intensity $b1
+ octave3
+ note $10
+ note $40
+ note $30
+ note $20
+ loopchannel $08, $515b
+ note $20
+ note $60
+ note $50
+ note $40
+ loopchannel $08, $5166
+ note $10
+ note $40
+ note $30
+ note $20
+ loopchannel $10, $516e
+ note $20
+ note $50
+ note $40
+ note $30
+ loopchannel $08, $5176
+ note $10
+ note $40
+ note $30
+ note $20
+ loopchannel $08, $517e
+ loopchannel $00, $5091 ; end
+; 0xed18a
+
+_Music_KantoWildPokemonBattle_sub_0xed18a: ; 0xed18a
+; subroutine
+ octave4
+ note $10
+ note $04
+ octave3
+ note $c0
+ note $04
+ note $b0
+ note $02
+ note $09
+ octave4
+ note $11
+ note $01
+ note $41
+ note $20
+ note $04
+ note $10
+ note $04
+ octave3
+ note $c0
+ note $02
+ endchannel ; end
+; 0xed19f
+
+_Music_KantoWildPokemonBattle_Ch2: ; 0xed19f
+ dutycycle $01
+ vibrato $12, $23
+ notetype $0c, $b1
+ octave4
+ note $80
+ note $70
+ note $60
+ note $50
+ note $80
+ note $70
+ note $60
+ note $50
+ note $80
+ note $70
+ note $60
+ note $50
+ note $80
+ note $70
+ note $60
+ note $50
+ note $80
+ note $70
+ note $60
+ note $50
+ note $70
+ note $60
+ note $50
+ note $40
+ note $60
+ note $50
+ note $40
+ note $30
+ note $50
+ note $40
+ note $30
+ note $20
+ notetype $0c, $b7
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed2c6
+ octave2
+ note $61
+ octave1
+ note $c0
+ note $00
+ octave2
+ note $81
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed2c6
+ octave2
+ note $80
+ note $00
+ octave1
+ note $c0
+ note $00
+ octave2
+ note $60
+ note $70
+ notetype $06, $b7
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed307
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed307
+ forceoctave $01
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed307
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed307
+ forceoctave $00
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed307
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed307
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed307
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed307
+ forceoctave $01
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed307
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed307
+ forceoctave $00
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed307
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed307
+ note $0f
+ octave3
+ note $bf
+ octave4
+ note $3f
+ note $6f
+ notetype $0c, $b7
+ note $5f
+ note $87
+ octave5
+ note $17
+ note $07
+ octave3
+ note $97
+ octave4
+ note $17
+ note $47
+ note $67
+ note $60
+ octave3
+ note $b0
+ note $90
+ note $b0
+ octave4
+ note $60
+ octave3
+ note $b0
+ note $90
+ note $b0
+ octave4
+ note $97
+ note $90
+ note $60
+ note $30
+ octave3
+ note $c0
+ octave4
+ note $60
+ note $30
+ octave3
+ note $c0
+ note $90
+ notetype $06, $b7
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed31b
+ forceoctave $01
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed31b
+ forceoctave $00
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed340
+ octave2
+ note $11
+ note $01
+ octave3
+ note $83
+ octave2
+ note $11
+ note $01
+ note $11
+ note $01
+ octave4
+ note $13
+ octave2
+ note $11
+ note $01
+ octave4
+ note $43
+ octave2
+ note $11
+ note $01
+ octave4
+ note $23
+ octave2
+ note $21
+ note $01
+ note $21
+ note $01
+ octave4
+ note $23
+ octave2
+ note $21
+ note $01
+ note $21
+ note $01
+ octave4
+ note $23
+ octave2
+ note $21
+ note $01
+ note $21
+ note $01
+ octave4
+ note $23
+ octave2
+ note $21
+ note $01
+ note $21
+ note $01
+ octave4
+ note $23
+ octave2
+ note $21
+ note $01
+ octave4
+ note $63
+ octave2
+ note $21
+ note $01
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed340
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed354
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed340
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed354
+ forceoctave $01
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed340
+ forceoctave $00
+ note $21
+ note $01
+ octave3
+ note $93
+ octave2
+ note $21
+ note $01
+ note $21
+ note $01
+ octave4
+ note $23
+ octave2
+ note $21
+ note $01
+ octave3
+ note $b3
+ octave2
+ note $21
+ note $01
+ callchannel _Music_KantoWildPokemonBattle_sub_0xed340
+ note $11
+ note $01
+ octave3
+ note $83
+ octave2
+ note $11
+ note $01
+ note $11
+ note $01
+ octave4
+ note $13
+ octave2
+ note $11
+ note $01
+ octave3
+ note $b3
+ octave2
+ note $11
+ note $01
+ loopchannel $00, $51c8 ; end
+; 0xed2c6
+
+_Music_KantoWildPokemonBattle_sub_0xed2c6: ; 0xed2c6
+; subroutine
+ octave2
+ note $10
+ note $01
+ note $10
+ octave1
+ note $80
+ note $00
+ octave2
+ note $10
+ note $00
+ octave3
+ note $11
+ octave2
+ note $10
+ note $00
+ octave1
+ note $80
+ note $01
+ note $80
+ octave2
+ note $12
+ note $10
+ octave1
+ note $81
+ octave2
+ note $11
+ octave1
+ note $81
+ octave2
+ note $71
+ octave1
+ note $81
+ octave2
+ note $81
+ note $20
+ note $01
+ note $20
+ octave1
+ note $90
+ note $00
+ octave2
+ note $20
+ note $00
+ octave3
+ note $20
+ note $00
+ octave2
+ note $21
+ octave1
+ note $90
+ note $01
+ note $90
+ octave2
+ note $20
+ note $01
+ note $20
+ octave1
+ note $90
+ note $00
+ octave2
+ note $20
+ note $00
+ octave1
+ note $81
+ endchannel ; end
+; 0xed307
+
+_Music_KantoWildPokemonBattle_sub_0xed307: ; 0xed307
+; subroutine
+ octave2
+ note $11
+ note $03
+ note $10
+ note $00
+ note $11
+ octave3
+ note $11
+ octave2
+ note $13
+ note $01
+ note $11
+ note $01
+ note $11
+ octave3
+ note $11
+ note $01
+ octave2
+ note $13
+ endchannel ; end
+; 0xed31b
+
+_Music_KantoWildPokemonBattle_sub_0xed31b: ; 0xed31b
+; subroutine
+ octave2
+ note $11
+ note $03
+ note $11
+ note $03
+ octave1
+ note $80
+ note $00
+ note $80
+ note $00
+ octave2
+ note $51
+ note $01
+ note $51
+ note $01
+ note $51
+ note $15
+ note $11
+ note $03
+ note $11
+ octave1
+ note $81
+ octave2
+ note $51
+ note $11
+ octave1
+ note $81
+ octave2
+ note $11
+ note $03
+ note $11
+ note $51
+ note $81
+ note $c1
+ octave3
+ note $11
+ endchannel ; end
+; 0xed340
+
+_Music_KantoWildPokemonBattle_sub_0xed340: ; 0xed340
+; subroutine
+ octave3
+ note $83
+ octave2
+ note $11
+ note $01
+ note $11
+ note $01
+ octave3
+ note $83
+ octave2
+ note $11
+ note $01
+ note $11
+ note $01
+ octave3
+ note $83
+ octave2
+ note $11
+ note $01
+ endchannel ; end
+; 0xed354
+
+_Music_KantoWildPokemonBattle_sub_0xed354: ; 0xed354
+; subroutine
+ note $11
+ note $01
+ octave3
+ note $83
+ octave2
+ note $11
+ note $01
+ note $11
+ note $01
+ octave3
+ note $83
+ octave2
+ note $11
+ note $01
+ octave3
+ note $83
+ octave2
+ note $11
+ note $01
+ endchannel ; end
+; 0xed368
+
+_Music_KantoWildPokemonBattle_Ch3: ; 0xed368
+ vibrato $14, $23
+ notetype $0c, $14
+ octave3
+ note $10
+ note $00
+ note $10
+ octave4
+ note $10
+ octave3
+ note $20
+ note $00
+ note $20
+ octave4
+ note $20
+ octave3
+ note $30
+ note $00
+ note $30
+ octave4
+ note $30
+ octave3
+ note $40
+ note $00
+ note $40
+ octave4
+ note $40
+ octave3
+ note $50
+ note $00
+ note $50
+ octave4
+ note $50
+ octave3
+ note $60
+ note $00
+ note $60
+ octave4
+ note $60
+ octave3
+ note $70
+ note $00
+ note $70
+ octave4
+ note $70
+ octave3
+ note $80
+ note $00
+ note $80
+ octave4
+ note $80
+ notetype $0c, $14
+ octave5
+ note $80
+ note $01
+ octave4
+ note $80
+ note $01
+ octave5
+ note $80
+ note $02
+ octave4
+ note $80
+ note $00
+ octave5
+ note $80
+ note $01
+ octave4
+ note $80
+ octave3
+ note $80
+ note $c0
+ octave4
+ note $10
+ note $30
+ note $45
+ octave5
+ note $41
+ note $01
+ note $81
+ note $90
+ note $01
+ octave4
+ note $90
+ note $01
+ octave5
+ note $90
+ note $02
+ octave4
+ note $90
+ note $00
+ octave5
+ note $90
+ note $01
+ octave4
+ note $90
+ octave6
+ note $25
+ octave5
+ note $90
+ note $60
+ note $c0
+ note $80
+ note $60
+ note $30
+ note $80
+ note $60
+ note $30
+ octave4
+ note $c0
+ octave5
+ note $80
+ note $01
+ octave4
+ note $80
+ note $01
+ octave5
+ note $80
+ note $02
+ octave4
+ note $80
+ note $00
+ octave5
+ note $80
+ note $01
+ octave4
+ note $80
+ note $10
+ note $30
+ note $40
+ note $60
+ note $85
+ octave5
+ note $41
+ note $01
+ note $81
+ note $90
+ note $01
+ octave4
+ note $80
+ note $01
+ octave5
+ note $90
+ note $02
+ octave4
+ note $80
+ note $00
+ octave5
+ note $90
+ note $01
+ octave4
+ note $80
+ note $23
+ note $93
+ octave5
+ note $66
+ note $70
+ note $81
+ intensity $24
+ note $10
+ octave4
+ note $80
+ octave5
+ note $10
+ octave4
+ note $80
+ intensity $14
+ octave5
+ note $71
+ intensity $24
+ note $10
+ octave4
+ note $80
+ octave5
+ note $10
+ octave4
+ note $80
+ intensity $14
+ octave5
+ note $51
+ intensity $24
+ note $10
+ octave4
+ note $80
+ intensity $14
+ octave5
+ note $81
+ intensity $24
+ note $10
+ octave4
+ note $80
+ octave5
+ note $10
+ octave4
+ note $80
+ intensity $14
+ octave5
+ note $a1
+ intensity $24
+ note $10
+ octave4
+ note $80
+ octave5
+ note $10
+ octave4
+ note $80
+ intensity $14
+ octave5
+ note $81
+ intensity $24
+ note $10
+ octave4
+ note $90
+ intensity $14
+ octave5
+ note $9b
+ note $81
+ note $61
+ note $91
+ note $81
+ note $20
+ note $60
+ note $90
+ octave6
+ note $10
+ note $27
+ octave5
+ note $11
+ intensity $24
+ octave4
+ note $50
+ note $80
+ note $50
+ note $80
+ intensity $14
+ note $b1
+ intensity $24
+ note $50
+ note $80
+ note $50
+ note $80
+ intensity $14
+ note $91
+ intensity $24
+ note $50
+ note $80
+ intensity $14
+ octave5
+ note $21
+ intensity $24
+ octave4
+ note $50
+ note $80
+ note $50
+ note $80
+ intensity $14
+ octave5
+ note $11
+ intensity $24
+ octave4
+ note $50
+ note $80
+ note $50
+ note $80
+ intensity $14
+ note $b1
+ intensity $24
+ note $50
+ note $80
+ intensity $14
+ octave5
+ note $61
+ intensity $24
+ octave4
+ note $80
+ octave5
+ note $10
+ octave4
+ note $80
+ octave5
+ note $10
+ intensity $14
+ note $51
+ intensity $24
+ octave4
+ note $80
+ octave5
+ note $10
+ octave4
+ note $80
+ octave5
+ note $10
+ intensity $14
+ note $31
+ intensity $24
+ octave4
+ note $80
+ octave5
+ note $10
+ intensity $14
+ octave4
+ note $b3
+ octave5
+ note $13
+ note $33
+ note $63
+ note $9f
+ notetype $06, $14
+ note $90
+ note $00
+ intensity $24
+ note $90
+ note $00
+ intensity $34
+ note $90
+ note $00
+ note $90
+ note $00
+ note $90
+ note $00
+ note $90
+ note $00
+ intensity $24
+ note $90
+ note $00
+ note $90
+ note $00
+ note $90
+ note $00
+ note $90
+ note $00
+ intensity $14
+ note $90
+ note $00
+ note $90
+ note $00
+ octave6
+ note $20
+ note $00
+ note $20
+ note $00
+ note $20
+ note $00
+ note $20
+ note $00
+ octave5
+ note $81
+ note $61
+ note $51
+ note $61
+ notetype $0c, $15
+ note $8b
+ note $87
+ notetype $06, $15
+ note $80
+ note $00
+ note $80
+ note $00
+ note $80
+ note $00
+ note $80
+ note $00
+ intensity $24
+ note $80
+ note $00
+ note $80
+ note $00
+ intensity $14
+ note $80
+ note $00
+ note $80
+ note $00
+ notetype $0c, $14
+ octave2
+ note $bf
+ note $b0
+ note $01
+ note $b0
+ note $01
+ note $b0
+ note $00
+ octave3
+ note $b0
+ note $01
+ note $b0
+ note $01
+ note $b0
+ note $00
+ note $10
+ note $01
+ notetype $06, $15
+ note $10
+ note $00
+ note $11
+ octave4
+ note $11
+ octave3
+ note $13
+ note $01
+ note $11
+ note $01
+ note $11
+ octave4
+ note $11
+ note $01
+ octave3
+ note $13
+ note $11
+ note $03
+ note $10
+ note $00
+ note $11
+ octave4
+ note $11
+ octave3
+ note $13
+ note $01
+ note $11
+ note $01
+ note $11
+ octave2
+ note $b1
+ note $01
+ note $b1
+ note $01
+ notetype $0c, $14
+ note $9f
+ note $9f
+ note $b1
+ note $01
+ note $b0
+ note $02
+ note $b0
+ note $00
+ octave3
+ note $b0
+ note $00
+ octave2
+ note $b0
+ note $00
+ octave3
+ note $b0
+ note $00
+ note $31
+ note $01
+ note $30
+ note $02
+ note $30
+ note $00
+ octave4
+ note $30
+ note $00
+ octave2
+ note $c0
+ note $00
+ octave3
+ note $c0
+ note $00
+ octave5
+ note $53
+ octave4
+ note $10
+ note $50
+ note $80
+ note $c0
+ octave5
+ note $10
+ note $00
+ note $50
+ note $04
+ note $61
+ note $50
+ note $00
+ octave4
+ note $10
+ octave3
+ note $80
+ octave4
+ note $10
+ note $50
+ note $80
+ note $50
+ note $10
+ note $50
+ note $80
+ octave5
+ note $10
+ note $50
+ note $80
+ note $63
+ octave4
+ note $20
+ note $60
+ note $90
+ octave5
+ note $10
+ note $20
+ note $00
+ note $60
+ note $04
+ note $91
+ note $80
+ note $04
+ note $67
+ intensity $13
+ note $85
+ note $75
+ note $51
+ note $01
+ note $85
+ note $a5
+ note $81
+ note $01
+ note $9b
+ note $81
+ note $61
+ note $91
+ note $81
+ note $03
+ octave6
+ note $27
+ octave5
+ note $15
+ octave4
+ note $b5
+ note $91
+ note $01
+ octave5
+ note $25
+ note $15
+ octave4
+ note $b1
+ note $01
+ octave5
+ note $65
+ note $55
+ note $31
+ note $01
+ octave4
+ note $b3
+ octave5
+ note $13
+ note $33
+ note $63
+ note $9f
+ note $9f
+ note $8f
+ note $8f
+ loopchannel $00, $539e ; end
+; 0xed5c6
--- a/audio/music/kantowildpokemonbattle.asm
+++ /dev/null
@@ -1,1229 +1,0 @@
-_Music_KantoWildPokemonBattle: ; 0xed06d
- db $80
- dw _Music_KantoWildPokemonBattle_Ch1
- db $01
- dw _Music_KantoWildPokemonBattle_Ch2
- db $02
- dw _Music_KantoWildPokemonBattle_Ch3
-; 0xed076
-
-; 0xed076
- db $03
-; 0xed077
-
-_Music_KantoWildPokemonBattle_Ch1: ; 0xed077
- tempo $7000
- volume $77
- vibrato $12, $23
- dutycycle $02
- notetype $0c, $b7
- note $0f
- octave4
- note $b5
- note $a0
- note $90
- note $a0
- note $90
- note $80
- note $70
- note $90
- note $80
- note $70
- note $60
- notetype $0c, $b7
- callchannel _Music_KantoWildPokemonBattle_sub_0xed18a
- octave4
- note $63
- note $23
- octave3
- note $c7
- callchannel _Music_KantoWildPokemonBattle_sub_0xed18a
- note $07
- note $80
- note $c0
- octave4
- note $20
- octave3
- note $c0
- note $80
- note $c0
- octave4
- note $30
- note $40
- intensity $b1
- note $55
- note $15
- octave3
- note $83
- octave4
- note $55
- note $15
- note $53
- intensity $b7
- note $60
- note $20
- octave3
- note $90
- octave4
- note $10
- note $20
- octave3
- note $90
- note $60
- note $80
- note $93
- note $70
- note $80
- note $90
- octave4
- note $10
- note $23
- octave3
- note $60
- note $90
- octave4
- note $20
- note $50
- note $62
- note $80
- note $93
- intensity $b1
- octave3
- note $85
- note $65
- note $53
- note $95
- note $85
- note $63
- octave4
- note $15
- octave3
- note $b5
- note $83
- notetype $08, $b7
- octave2
- note $81
- octave3
- note $11
- note $51
- note $11
- note $51
- note $81
- note $51
- note $81
- octave4
- note $11
- octave3
- note $81
- octave4
- note $11
- note $51
- note $61
- note $21
- octave3
- note $91
- octave4
- note $21
- octave3
- note $91
- note $61
- note $91
- note $61
- note $21
- note $61
- note $21
- octave2
- note $91
- notetype $0c, $b7
- octave3
- note $93
- octave4
- note $23
- intensity $71
- note $60
- note $60
- intensity $91
- note $60
- note $60
- intensity $b1
- note $90
- note $90
- intensity $d1
- note $90
- note $90
- intensity $c7
- note $50
- note $30
- note $20
- note $30
- note $5b
- note $57
- intensity $b1
- note $50
- note $30
- note $10
- octave3
- note $b0
- note $a0
- note $80
- note $60
- note $50
- intensity $b7
- note $37
- note $67
- note $b7
- octave4
- note $37
- octave3
- note $87
- octave4
- note $17
- note $57
- note $87
- note $07
- octave3
- note $47
- note $97
- octave4
- note $17
- octave3
- note $b7
- note $07
- octave4
- note $37
- octave3
- note $91
- note $61
- note $31
- note $61
- octave4
- note $13
- note $05
- note $10
- note $04
- note $21
- note $10
- note $0c
- note $23
- note $05
- note $20
- note $04
- note $61
- note $40
- note $04
- note $27
- intensity $b1
- octave3
- note $10
- note $40
- note $30
- note $20
- loopchannel $08, $515b
- note $20
- note $60
- note $50
- note $40
- loopchannel $08, $5166
- note $10
- note $40
- note $30
- note $20
- loopchannel $10, $516e
- note $20
- note $50
- note $40
- note $30
- loopchannel $08, $5176
- note $10
- note $40
- note $30
- note $20
- loopchannel $08, $517e
- loopchannel $00, $5091 ; end
-; 0xed18a
-
-_Music_KantoWildPokemonBattle_sub_0xed18a: ; 0xed18a
-; subroutine
- octave4
- note $10
- note $04
- octave3
- note $c0
- note $04
- note $b0
- note $02
- note $09
- octave4
- note $11
- note $01
- note $41
- note $20
- note $04
- note $10
- note $04
- octave3
- note $c0
- note $02
- endchannel ; end
-; 0xed19f
-
-_Music_KantoWildPokemonBattle_Ch2: ; 0xed19f
- dutycycle $01
- vibrato $12, $23
- notetype $0c, $b1
- octave4
- note $80
- note $70
- note $60
- note $50
- note $80
- note $70
- note $60
- note $50
- note $80
- note $70
- note $60
- note $50
- note $80
- note $70
- note $60
- note $50
- note $80
- note $70
- note $60
- note $50
- note $70
- note $60
- note $50
- note $40
- note $60
- note $50
- note $40
- note $30
- note $50
- note $40
- note $30
- note $20
- notetype $0c, $b7
- callchannel _Music_KantoWildPokemonBattle_sub_0xed2c6
- octave2
- note $61
- octave1
- note $c0
- note $00
- octave2
- note $81
- callchannel _Music_KantoWildPokemonBattle_sub_0xed2c6
- octave2
- note $80
- note $00
- octave1
- note $c0
- note $00
- octave2
- note $60
- note $70
- notetype $06, $b7
- callchannel _Music_KantoWildPokemonBattle_sub_0xed307
- callchannel _Music_KantoWildPokemonBattle_sub_0xed307
- forceoctave $01
- callchannel _Music_KantoWildPokemonBattle_sub_0xed307
- callchannel _Music_KantoWildPokemonBattle_sub_0xed307
- forceoctave $00
- callchannel _Music_KantoWildPokemonBattle_sub_0xed307
- callchannel _Music_KantoWildPokemonBattle_sub_0xed307
- callchannel _Music_KantoWildPokemonBattle_sub_0xed307
- callchannel _Music_KantoWildPokemonBattle_sub_0xed307
- forceoctave $01
- callchannel _Music_KantoWildPokemonBattle_sub_0xed307
- callchannel _Music_KantoWildPokemonBattle_sub_0xed307
- forceoctave $00
- callchannel _Music_KantoWildPokemonBattle_sub_0xed307
- callchannel _Music_KantoWildPokemonBattle_sub_0xed307
- note $0f
- octave3
- note $bf
- octave4
- note $3f
- note $6f
- notetype $0c, $b7
- note $5f
- note $87
- octave5
- note $17
- note $07
- octave3
- note $97
- octave4
- note $17
- note $47
- note $67
- note $60
- octave3
- note $b0
- note $90
- note $b0
- octave4
- note $60
- octave3
- note $b0
- note $90
- note $b0
- octave4
- note $97
- note $90
- note $60
- note $30
- octave3
- note $c0
- octave4
- note $60
- note $30
- octave3
- note $c0
- note $90
- notetype $06, $b7
- callchannel _Music_KantoWildPokemonBattle_sub_0xed31b
- forceoctave $01
- callchannel _Music_KantoWildPokemonBattle_sub_0xed31b
- forceoctave $00
- callchannel _Music_KantoWildPokemonBattle_sub_0xed340
- octave2
- note $11
- note $01
- octave3
- note $83
- octave2
- note $11
- note $01
- note $11
- note $01
- octave4
- note $13
- octave2
- note $11
- note $01
- octave4
- note $43
- octave2
- note $11
- note $01
- octave4
- note $23
- octave2
- note $21
- note $01
- note $21
- note $01
- octave4
- note $23
- octave2
- note $21
- note $01
- note $21
- note $01
- octave4
- note $23
- octave2
- note $21
- note $01
- note $21
- note $01
- octave4
- note $23
- octave2
- note $21
- note $01
- note $21
- note $01
- octave4
- note $23
- octave2
- note $21
- note $01
- octave4
- note $63
- octave2
- note $21
- note $01
- callchannel _Music_KantoWildPokemonBattle_sub_0xed340
- callchannel _Music_KantoWildPokemonBattle_sub_0xed354
- callchannel _Music_KantoWildPokemonBattle_sub_0xed340
- callchannel _Music_KantoWildPokemonBattle_sub_0xed354
- forceoctave $01
- callchannel _Music_KantoWildPokemonBattle_sub_0xed340
- forceoctave $00
- note $21
- note $01
- octave3
- note $93
- octave2
- note $21
- note $01
- note $21
- note $01
- octave4
- note $23
- octave2
- note $21
- note $01
- octave3
- note $b3
- octave2
- note $21
- note $01
- callchannel _Music_KantoWildPokemonBattle_sub_0xed340
- note $11
- note $01
- octave3
- note $83
- octave2
- note $11
- note $01
- note $11
- note $01
- octave4
- note $13
- octave2
- note $11
- note $01
- octave3
- note $b3
- octave2
- note $11
- note $01
- loopchannel $00, $51c8 ; end
-; 0xed2c6
-
-_Music_KantoWildPokemonBattle_sub_0xed2c6: ; 0xed2c6
-; subroutine
- octave2
- note $10
- note $01
- note $10
- octave1
- note $80
- note $00
- octave2
- note $10
- note $00
- octave3
- note $11
- octave2
- note $10
- note $00
- octave1
- note $80
- note $01
- note $80
- octave2
- note $12
- note $10
- octave1
- note $81
- octave2
- note $11
- octave1
- note $81
- octave2
- note $71
- octave1
- note $81
- octave2
- note $81
- note $20
- note $01
- note $20
- octave1
- note $90
- note $00
- octave2
- note $20
- note $00
- octave3
- note $20
- note $00
- octave2
- note $21
- octave1
- note $90
- note $01
- note $90
- octave2
- note $20
- note $01
- note $20
- octave1
- note $90
- note $00
- octave2
- note $20
- note $00
- octave1
- note $81
- endchannel ; end
-; 0xed307
-
-_Music_KantoWildPokemonBattle_sub_0xed307: ; 0xed307
-; subroutine
- octave2
- note $11
- note $03
- note $10
- note $00
- note $11
- octave3
- note $11
- octave2
- note $13
- note $01
- note $11
- note $01
- note $11
- octave3
- note $11
- note $01
- octave2
- note $13
- endchannel ; end
-; 0xed31b
-
-_Music_KantoWildPokemonBattle_sub_0xed31b: ; 0xed31b
-; subroutine
- octave2
- note $11
- note $03
- note $11
- note $03
- octave1
- note $80
- note $00
- note $80
- note $00
- octave2
- note $51
- note $01
- note $51
- note $01
- note $51
- note $15
- note $11
- note $03
- note $11
- octave1
- note $81
- octave2
- note $51
- note $11
- octave1
- note $81
- octave2
- note $11
- note $03
- note $11
- note $51
- note $81
- note $c1
- octave3
- note $11
- endchannel ; end
-; 0xed340
-
-_Music_KantoWildPokemonBattle_sub_0xed340: ; 0xed340
-; subroutine
- octave3
- note $83
- octave2
- note $11
- note $01
- note $11
- note $01
- octave3
- note $83
- octave2
- note $11
- note $01
- note $11
- note $01
- octave3
- note $83
- octave2
- note $11
- note $01
- endchannel ; end
-; 0xed354
-
-_Music_KantoWildPokemonBattle_sub_0xed354: ; 0xed354
-; subroutine
- note $11
- note $01
- octave3
- note $83
- octave2
- note $11
- note $01
- note $11
- note $01
- octave3
- note $83
- octave2
- note $11
- note $01
- octave3
- note $83
- octave2
- note $11
- note $01
- endchannel ; end
-; 0xed368
-
-_Music_KantoWildPokemonBattle_Ch3: ; 0xed368
- vibrato $14, $23
- notetype $0c, $14
- octave3
- note $10
- note $00
- note $10
- octave4
- note $10
- octave3
- note $20
- note $00
- note $20
- octave4
- note $20
- octave3
- note $30
- note $00
- note $30
- octave4
- note $30
- octave3
- note $40
- note $00
- note $40
- octave4
- note $40
- octave3
- note $50
- note $00
- note $50
- octave4
- note $50
- octave3
- note $60
- note $00
- note $60
- octave4
- note $60
- octave3
- note $70
- note $00
- note $70
- octave4
- note $70
- octave3
- note $80
- note $00
- note $80
- octave4
- note $80
- notetype $0c, $14
- octave5
- note $80
- note $01
- octave4
- note $80
- note $01
- octave5
- note $80
- note $02
- octave4
- note $80
- note $00
- octave5
- note $80
- note $01
- octave4
- note $80
- octave3
- note $80
- note $c0
- octave4
- note $10
- note $30
- note $45
- octave5
- note $41
- note $01
- note $81
- note $90
- note $01
- octave4
- note $90
- note $01
- octave5
- note $90
- note $02
- octave4
- note $90
- note $00
- octave5
- note $90
- note $01
- octave4
- note $90
- octave6
- note $25
- octave5
- note $90
- note $60
- note $c0
- note $80
- note $60
- note $30
- note $80
- note $60
- note $30
- octave4
- note $c0
- octave5
- note $80
- note $01
- octave4
- note $80
- note $01
- octave5
- note $80
- note $02
- octave4
- note $80
- note $00
- octave5
- note $80
- note $01
- octave4
- note $80
- note $10
- note $30
- note $40
- note $60
- note $85
- octave5
- note $41
- note $01
- note $81
- note $90
- note $01
- octave4
- note $80
- note $01
- octave5
- note $90
- note $02
- octave4
- note $80
- note $00
- octave5
- note $90
- note $01
- octave4
- note $80
- note $23
- note $93
- octave5
- note $66
- note $70
- note $81
- intensity $24
- note $10
- octave4
- note $80
- octave5
- note $10
- octave4
- note $80
- intensity $14
- octave5
- note $71
- intensity $24
- note $10
- octave4
- note $80
- octave5
- note $10
- octave4
- note $80
- intensity $14
- octave5
- note $51
- intensity $24
- note $10
- octave4
- note $80
- intensity $14
- octave5
- note $81
- intensity $24
- note $10
- octave4
- note $80
- octave5
- note $10
- octave4
- note $80
- intensity $14
- octave5
- note $a1
- intensity $24
- note $10
- octave4
- note $80
- octave5
- note $10
- octave4
- note $80
- intensity $14
- octave5
- note $81
- intensity $24
- note $10
- octave4
- note $90
- intensity $14
- octave5
- note $9b
- note $81
- note $61
- note $91
- note $81
- note $20
- note $60
- note $90
- octave6
- note $10
- note $27
- octave5
- note $11
- intensity $24
- octave4
- note $50
- note $80
- note $50
- note $80
- intensity $14
- note $b1
- intensity $24
- note $50
- note $80
- note $50
- note $80
- intensity $14
- note $91
- intensity $24
- note $50
- note $80
- intensity $14
- octave5
- note $21
- intensity $24
- octave4
- note $50
- note $80
- note $50
- note $80
- intensity $14
- octave5
- note $11
- intensity $24
- octave4
- note $50
- note $80
- note $50
- note $80
- intensity $14
- note $b1
- intensity $24
- note $50
- note $80
- intensity $14
- octave5
- note $61
- intensity $24
- octave4
- note $80
- octave5
- note $10
- octave4
- note $80
- octave5
- note $10
- intensity $14
- note $51
- intensity $24
- octave4
- note $80
- octave5
- note $10
- octave4
- note $80
- octave5
- note $10
- intensity $14
- note $31
- intensity $24
- octave4
- note $80
- octave5
- note $10
- intensity $14
- octave4
- note $b3
- octave5
- note $13
- note $33
- note $63
- note $9f
- notetype $06, $14
- note $90
- note $00
- intensity $24
- note $90
- note $00
- intensity $34
- note $90
- note $00
- note $90
- note $00
- note $90
- note $00
- note $90
- note $00
- intensity $24
- note $90
- note $00
- note $90
- note $00
- note $90
- note $00
- note $90
- note $00
- intensity $14
- note $90
- note $00
- note $90
- note $00
- octave6
- note $20
- note $00
- note $20
- note $00
- note $20
- note $00
- note $20
- note $00
- octave5
- note $81
- note $61
- note $51
- note $61
- notetype $0c, $15
- note $8b
- note $87
- notetype $06, $15
- note $80
- note $00
- note $80
- note $00
- note $80
- note $00
- note $80
- note $00
- intensity $24
- note $80
- note $00
- note $80
- note $00
- intensity $14
- note $80
- note $00
- note $80
- note $00
- notetype $0c, $14
- octave2
- note $bf
- note $b0
- note $01
- note $b0
- note $01
- note $b0
- note $00
- octave3
- note $b0
- note $01
- note $b0
- note $01
- note $b0
- note $00
- note $10
- note $01
- notetype $06, $15
- note $10
- note $00
- note $11
- octave4
- note $11
- octave3
- note $13
- note $01
- note $11
- note $01
- note $11
- octave4
- note $11
- note $01
- octave3
- note $13
- note $11
- note $03
- note $10
- note $00
- note $11
- octave4
- note $11
- octave3
- note $13
- note $01
- note $11
- note $01
- note $11
- octave2
- note $b1
- note $01
- note $b1
- note $01
- notetype $0c, $14
- note $9f
- note $9f
- note $b1
- note $01
- note $b0
- note $02
- note $b0
- note $00
- octave3
- note $b0
- note $00
- octave2
- note $b0
- note $00
- octave3
- note $b0
- note $00
- note $31
- note $01
- note $30
- note $02
- note $30
- note $00
- octave4
- note $30
- note $00
- octave2
- note $c0
- note $00
- octave3
- note $c0
- note $00
- octave5
- note $53
- octave4
- note $10
- note $50
- note $80
- note $c0
- octave5
- note $10
- note $00
- note $50
- note $04
- note $61
- note $50
- note $00
- octave4
- note $10
- octave3
- note $80
- octave4
- note $10
- note $50
- note $80
- note $50
- note $10
- note $50
- note $80
- octave5
- note $10
- note $50
- note $80
- note $63
- octave4
- note $20
- note $60
- note $90
- octave5
- note $10
- note $20
- note $00
- note $60
- note $04
- note $91
- note $80
- note $04
- note $67
- intensity $13
- note $85
- note $75
- note $51
- note $01
- note $85
- note $a5
- note $81
- note $01
- note $9b
- note $81
- note $61
- note $91
- note $81
- note $03
- octave6
- note $27
- octave5
- note $15
- octave4
- note $b5
- note $91
- note $01
- octave5
- note $25
- note $15
- octave4
- note $b1
- note $01
- octave5
- note $65
- note $55
- note $31
- note $01
- octave4
- note $b3
- octave5
- note $13
- note $33
- note $63
- note $9f
- note $9f
- note $8f
- note $8f
- loopchannel $00, $539e ; end
-; 0xed5c6
--- /dev/null
+++ b/audio/music/lakeofragerocketradio.asm
@@ -1,0 +1,41 @@
+_Music_LakeOfRageRocketsRadioSignal: ; 0xef5b1
+ db $80
+ dw _Music_LakeOfRageRocketsRadioSignal_Ch1
+ db $01
+ dw _Music_LakeOfRageRocketsRadioSignal_Ch2
+ db $02
+ dw _Music_LakeOfRageRocketsRadioSignal_Ch3
+; 0xef5ba
+
+_Music_LakeOfRageRocketsRadioSignal_Ch1: ; 0xef5ba
+ tempo $a000
+ volume $77
+ dutycycle $01
+ tone $1811
+ vibrato $00, $f0
+ stereopanning $f0
+ notetype $0c, $a7
+ octave7
+ note $83
+ note $73
+ note $83
+ note $73
+ note $0f
+ loopchannel $00, $75c9 ; end
+; 0xef5d6
+
+_Music_LakeOfRageRocketsRadioSignal_Ch2: ; 0xef5d6
+ dutycycle $01
+ vibrato $13, $e8
+ notetype $0c, $a7
+ note $01
+ stereopanning $0f
+ loopchannel $00, $75c9 ; end
+; 0xef5e5
+
+_Music_LakeOfRageRocketsRadioSignal_Ch3: ; 0xef5e5
+ notetype $0c, $26
+ vibrato $10, $44
+ note $03
+ loopchannel $00, $75c9 ; end
+; 0xef5f0
--- a/audio/music/lakeofragerocketsradiosignal.asm
+++ /dev/null
@@ -1,41 +1,0 @@
-_Music_LakeOfRageRocketsRadioSignal: ; 0xef5b1
- db $80
- dw _Music_LakeOfRageRocketsRadioSignal_Ch1
- db $01
- dw _Music_LakeOfRageRocketsRadioSignal_Ch2
- db $02
- dw _Music_LakeOfRageRocketsRadioSignal_Ch3
-; 0xef5ba
-
-_Music_LakeOfRageRocketsRadioSignal_Ch1: ; 0xef5ba
- tempo $a000
- volume $77
- dutycycle $01
- tone $1811
- vibrato $00, $f0
- stereopanning $f0
- notetype $0c, $a7
- octave7
- note $83
- note $73
- note $83
- note $73
- note $0f
- loopchannel $00, $75c9 ; end
-; 0xef5d6
-
-_Music_LakeOfRageRocketsRadioSignal_Ch2: ; 0xef5d6
- dutycycle $01
- vibrato $13, $e8
- notetype $0c, $a7
- note $01
- stereopanning $0f
- loopchannel $00, $75c9 ; end
-; 0xef5e5
-
-_Music_LakeOfRageRocketsRadioSignal_Ch3: ; 0xef5e5
- notetype $0c, $26
- vibrato $10, $44
- note $03
- loopchannel $00, $75c9 ; end
-; 0xef5f0
--- /dev/null
+++ b/audio/music/ruinsofalphradio.asm
@@ -1,0 +1,81 @@
+_Music_RuinsOfAlphRadioSignal: ; 0xeedcb
+ db $80
+ dw _Music_RuinsOfAlphRadioSignal_Ch1
+ db $01
+ dw _Music_RuinsOfAlphRadioSignal_Ch2
+ db $02
+ dw _Music_RuinsOfAlphRadioSignal_Ch3
+; 0xeedd4
+
+_Music_RuinsOfAlphRadioSignal_Ch1: ; 0xeedd4
+ tempo $a000
+ volume $77
+ dutycycle $00
+ tone $1801
+ vibrato $00, $f0
+ stereopanning $f0
+ notetype $06, $71
+ callchannel _Music_RuinsOfAlphRadioSignal_sub_0xeee01
+ notetype $0c, $a1
+ note $0f
+ note $0f
+ callchannel _Music_RuinsOfAlphRadioSignal_sub_0xeee08
+ notetype $0c, $a1
+ note $0f
+ note $0f
+ callchannel _Music_RuinsOfAlphRadioSignal_sub_0xeee01
+ notetype $0c, $a1
+ note $0f
+ loopchannel $00, $6de3 ; end
+; 0xeee01
+
+_Music_RuinsOfAlphRadioSignal_sub_0xeee01: ; 0xeee01
+; subroutine
+ octave4
+ note $80
+ note $70
+ note $80
+ note $70
+ note $17
+ endchannel ; end
+; 0xeee08
+
+_Music_RuinsOfAlphRadioSignal_sub_0xeee08: ; 0xeee08
+; subroutine
+ octave4
+ note $80
+ note $70
+ note $80
+ note $70
+ note $13
+ note $80
+ octave5
+ note $17
+ endchannel ; end
+; 0xeee12
+
+_Music_RuinsOfAlphRadioSignal_Ch2: ; 0xeee12
+ dutycycle $01
+ vibrato $01, $e0
+ stereopanning $0f
+ notetype $06, $81
+ callchannel _Music_RuinsOfAlphRadioSignal_sub_0xeee01
+ notetype $0c, $a1
+ note $0f
+ note $0f
+ notetype $06, $81
+ callchannel _Music_RuinsOfAlphRadioSignal_sub_0xeee08
+ notetype $0c, $a1
+ note $0f
+ loopchannel $00, $6e17 ; end
+; 0xeee32
+
+_Music_RuinsOfAlphRadioSignal_Ch3: ; 0xeee32
+ notetype $06, $26
+ octave2
+ note $10
+ note $20
+ note $10
+ note $0f
+ loopchannel $00, $6e35 ; end
+; 0xeee3e
--- a/audio/music/ruinsofalphradiosignal.asm
+++ /dev/null
@@ -1,81 +1,0 @@
-_Music_RuinsOfAlphRadioSignal: ; 0xeedcb
- db $80
- dw _Music_RuinsOfAlphRadioSignal_Ch1
- db $01
- dw _Music_RuinsOfAlphRadioSignal_Ch2
- db $02
- dw _Music_RuinsOfAlphRadioSignal_Ch3
-; 0xeedd4
-
-_Music_RuinsOfAlphRadioSignal_Ch1: ; 0xeedd4
- tempo $a000
- volume $77
- dutycycle $00
- tone $1801
- vibrato $00, $f0
- stereopanning $f0
- notetype $06, $71
- callchannel _Music_RuinsOfAlphRadioSignal_sub_0xeee01
- notetype $0c, $a1
- note $0f
- note $0f
- callchannel _Music_RuinsOfAlphRadioSignal_sub_0xeee08
- notetype $0c, $a1
- note $0f
- note $0f
- callchannel _Music_RuinsOfAlphRadioSignal_sub_0xeee01
- notetype $0c, $a1
- note $0f
- loopchannel $00, $6de3 ; end
-; 0xeee01
-
-_Music_RuinsOfAlphRadioSignal_sub_0xeee01: ; 0xeee01
-; subroutine
- octave4
- note $80
- note $70
- note $80
- note $70
- note $17
- endchannel ; end
-; 0xeee08
-
-_Music_RuinsOfAlphRadioSignal_sub_0xeee08: ; 0xeee08
-; subroutine
- octave4
- note $80
- note $70
- note $80
- note $70
- note $13
- note $80
- octave5
- note $17
- endchannel ; end
-; 0xeee12
-
-_Music_RuinsOfAlphRadioSignal_Ch2: ; 0xeee12
- dutycycle $01
- vibrato $01, $e0
- stereopanning $0f
- notetype $06, $81
- callchannel _Music_RuinsOfAlphRadioSignal_sub_0xeee01
- notetype $0c, $a1
- note $0f
- note $0f
- notetype $06, $81
- callchannel _Music_RuinsOfAlphRadioSignal_sub_0xeee08
- notetype $0c, $a1
- note $0f
- loopchannel $00, $6e17 ; end
-; 0xeee32
-
-_Music_RuinsOfAlphRadioSignal_Ch3: ; 0xeee32
- notetype $06, $26
- octave2
- note $10
- note $20
- note $10
- note $0f
- loopchannel $00, $6e35 ; end
-; 0xeee3e
--- a/constants.asm
+++ b/constants.asm
@@ -23,101 +23,9 @@
Bankswitch EQU $10
JumpTable EQU $28
+INCLUDE "macros.asm"
-dwb: MACRO
- dw \1
- db \2
- ENDM
-dbw: MACRO
- db \1
- dw \2
- ENDM
-
-dn: MACRO
- db \1 << 4 + \2
- ENDM
-
-dt: MACRO ; three-byte (big-endian)
- db (\1 >> 16) & $ff
- db (\1 >> 8) & $ff
- db \1 & $ff
- ENDM
-
-bigdw: MACRO ; big-endian word
- dw ((\1)/$100) + (((\1)&$ff)*$100)
- ENDM
-
-callab: MACRO ; address, bank
- ld hl, \1
- ld a, BANK(\1)
- rst FarCall
- ENDM
-
-callba: MACRO ; bank, address
- ld a, BANK(\1)
- ld hl, \1
- rst FarCall
- ENDM
-
-TX_RAM: MACRO
- db 1
- dw \1
- ENDM
-
-TX_FAR: MACRO
- db $16
- dw \1
- db BANK(\1)
- ENDM
-
-RGB: MACRO
- dw ((\3 << 10) | (\2 << 5) | (\1))
- ENDM
-
-note: MACRO
- db \1
- ENDM
-
-; It's better to use *coord than FuncCoord.
-FuncCoord: MACRO
-Coord = $c4a0 + 20 * \2 + \1
- ENDM
-
-bccoord: MACRO
- FuncCoord \1, \2
- ld bc, Coord
- ENDM
-
-decoord: MACRO
- FuncCoord \1, \2
- ld de, Coord
- ENDM
-
-hlcoord: MACRO
- FuncCoord \1, \2
- ld hl, Coord
- ENDM
-
-
-; pic animations
-frame: MACRO
- db \1
- db \2
- ENDM
-setrepeat: MACRO
- db $fe
- db \1
- ENDM
-dorepeat: MACRO
- db $fd
- db \1
- ENDM
-endanim: MACRO
- db $ff
- ENDM
-
-
NONE EQU 0
@@ -282,6 +190,9 @@
SCREEN_HEIGHT EQU 18
SCREEN_WIDTH_PX EQU 160
SCREEN_HEIGHT_PX EQU 144
+
+BG_MAP_WIDTH EQU 32
+BG_MAP_HEIGHT EQU 32
TILE_WIDTH EQU 8
--- a/constants/event_flags.asm
+++ b/constants/event_flags.asm
@@ -1,6 +1,594 @@
-EVENT_FOUGHT_SUDOWOODO EQU $02a
-EVENT_FOUGHT_HO_OH EQU $317
-EVENT_FOUGHT_LUGIA EQU $318
-EVENT_FOUGHT_SUICUNE EQU $335
-EVENT_FOUGHT_SNORLAX EQU $750
-
+EVENT_GOT_TM31_MUD_SLAP EQU $008
+EVENT_GOT_TM49_FURY_CUTTER EQU $009
+EVENT_GOT_TM01_DYNAMICPUNCH EQU $00a
+EVENT_GOT_TM45_ATTRACT EQU $00b
+EVENT_GOT_TM30_SHADOW_BALL EQU $00c
+EVENT_GOT_TM23_IRON_TAIL EQU $00d
+EVENT_GOT_TM16_ICY_WIND EQU $00e
+EVENT_GOT_TM24_DRAGONBREATH EQU $00f
+EVENT_GOT_HM01_CUT EQU $010
+EVENT_GOT_HM02_FLY EQU $011
+EVENT_GOT_HM03_SURF EQU $012
+EVENT_GOT_HM04_STRENGTH EQU $013
+EVENT_GOT_HM05_FLASH EQU $014
+EVENT_GOT_HM06_WHIRLPOOL EQU $015
+EVENT_GOT_OLD_ROD EQU $017
+EVENT_GOT_GOOD_ROD EQU $018
+EVENT_GOT_SUPER_ROD EQU $019
+EVENT_GOT_A_POKEMON_FROM_ELM EQU $01a
+EVENT_GOT_CYNDAQUIL_FROM_ELM EQU $01b
+EVENT_GOT_TOTODILE_FROM_ELM EQU $01c
+EVENT_GOT_CHIKORITA_FROM_ELM EQU $01d
+EVENT_GOT_MYSTERY_EGG_FROM_MR_POKEMON EQU $01e
+EVENT_GAVE_MYSTERY_EGG_TO_ELM EQU $01f
+EVENT_JASMINE_RETURNED_TO_GYM EQU $020
+EVENT_CLEARED_RADIO_TOWER EQU $021
+EVENT_CLEARED_ROCKET_HIDEOUT EQU $022
+EVENT_GOT_SECRETPOTION_FROM_PHARMACY EQU $023
+EVENT_GOT_SS_TICKET_FROM_ELM EQU $024
+EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER EQU $025
+EVENT_REFUSED_TO_HELP_LANCE_AT_LAKE_OF_RAGE EQU $026
+EVENT_GOT_BERRY_FROM_ROUTE_30_HOUSE EQU $027
+EVENT_MADE_WHITNEY_CRY EQU $028
+EVENT_FOUGHT_SUDOWOODO EQU $02a
+EVENT_CLEARED_SLOWPOKE_WELL EQU $02b
+EVENT_REFUSED_TO_TAKE_EGG_FROM_ELMS_AIDE EQU $02c
+EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE EQU $02d
+EVENT_MADE_UNOWN_APPEAR_IN_RUINS EQU $02e
+EVENT_HEALED_MOOMOO EQU $03d
+EVENT_GOT_TM13_SNORE_FROM_MOOMOO_FARM EQU $03e
+EVENT_TALKED_TO_FARMER_ABOUT_MOOMOO EQU $03f
+EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST EQU $040
+EVENT_DUDE_TALKED_TO_YOU EQU $041
+EVENT_LEARNED_TO_CATCH_POKEMON EQU $042
+EVENT_ELM_CALLED_ABOUT_STOLEN_POKEMON EQU $043
+EVENT_GOT_SHUCKIE EQU $045
+EVENT_MANIA_TOOK_SHUCKIE_OR_LET_YOU_KEEP_HIM EQU $046
+EVENT_GOT_SUNNY_DAY_FROM_RADIO_TOWER EQU $047
+EVENT_GOT_PINK_BOW_FROM_MARY EQU $048
+EVENT_USED_BASEMENT_KEY EQU $049
+EVENT_GOT_TM08_ROCK_SMASH EQU $04b
+EVENT_GOT_MYSTIC_WATER_IN_CHERRYGROVE EQU $04d
+EVENT_GOT_TM05_ROAR EQU $04e
+EVENT_GOT_EEVEE EQU $04f
+EVENT_GOT_KENYA EQU $050
+EVENT_GAVE_KENYA EQU $051
+EVENT_GOT_HP_UP_FROM_RANDY EQU $052
+EVENT_GOT_TM50_NIGHTMARE EQU $053
+EVENT_TOGEPI_HATCHED EQU $054
+EVENT_SHOWED_TOGEPI_TO_ELM EQU $055
+EVENT_GOT_EVERSTONE_FROM_ELM EQU $056
+EVENT_GOT_QUICK_CLAW EQU $057
+EVENT_GOT_TM10_HIDDEN_POWER EQU $058
+EVENT_GOT_TM36_SLUDGE_BOMB EQU $059
+EVENT_GOT_ITEMFINDER EQU $05a
+EVENT_GOT_BICYCLE EQU $05b
+EVENT_GOT_SQUIRTBOTTLE EQU $05c
+EVENT_GOT_MIRACLE_SEED_IN_ROUTE_32 EQU $05d
+EVENT_GOT_CHARCOAL_IN_CHARCOAL_KILN EQU $05e
+EVENT_GOT_TM02_HEADBUTT EQU $05f
+EVENT_DECIDED_TO_HELP_LANCE EQU $060
+EVENT_GOT_TYROGUE_FROM_KIYO EQU $061
+EVENT_MET_FRIEDA_OF_FRIDAY EQU $062
+EVENT_GOT_POISON_BARB_FROM_FRIEDA EQU $063
+EVENT_MET_TUSCANY_OF_TUESDAY EQU $064
+EVENT_GOT_PINK_BOW_FROM_TUSCANY EQU $065
+EVENT_MET_ARTHUR_OF_THURSDAY EQU $066
+EVENT_GOT_HARD_STONE_FROM_ARTHUR EQU $067
+EVENT_MET_SUNNY_OF_SUNDAY EQU $068
+EVENT_GOT_MAGNET_FROM_SUNNY EQU $069
+EVENT_MET_WESLEY_OF_WEDNESDAY EQU $06a
+EVENT_GOT_BLACKBELT_FROM_WESLEY EQU $06b
+EVENT_MET_SANTOS_OF_SATURDAY EQU $06c
+EVENT_GOT_SPELL_TAG_FROM_SANTOS EQU $06d
+EVENT_MET_MONICA_OF_MONDAY EQU $06e
+EVENT_GOT_SHARP_BEAK_FROM_MONICA EQU $06f
+EVENT_GOT_SOFT_SAND_FROM_KATE EQU $070
+EVENT_GOT_METAL_COAT_FROM_GRANDPA_ON_SS_AQUA EQU $071
+EVENT_GOT_BLACKGLASSES_IN_DARK_CAVE EQU $072
+EVENT_GOT_KINGS_ROCK_IN_SLOWPOKE_WELL EQU $073
+EVENT_GOT_TM47_STEEL_WING EQU $074
+EVENT_GOT_TM37_SANDSTORM EQU $075
+EVENT_TOLD_ELM_ABOUT_TOGEPI_OVER_THE_PHONE EQU $077
+EVENT_GOT_CLEAR_BELL EQU $078
+EVENT_GOT_SILVER_WING EQU $079
+EVENT_GOT_TM12_SWEET_SCENT EQU $07a
+EVENT_RELEASED_THE_BEASTS EQU $07b
+EVENT_GOT_MASTER_BALL_FROM_ELM EQU $07c
+EVENT_FOUND_REVIVE_IN_ROCKET_BASE_B1F EQU $086
+EVENT_CAN_GIVE_GS_BALL_TO_KURT EQU $0be
+EVENT_RETURNED_MACHINE_PART EQU $0c9
+EVENT_MET_MANAGER_AT_POWER_PLANT EQU $0ca
+EVENT_MET_ROCKET_GRUNT_AT_CERULEAN_GYM EQU $0cb
+EVENT_MET_REDS_MOM EQU $0cc
+EVENT_RESTORED_POWER_TO_KANTO EQU $0cd
+EVENT_GOT_COINS_FROM_GAMBLER_AT_CELADON EQU $0ce
+EVENT_MET_COPYCAT_FOUND_OUT_ABOUT_LOST_ITEM EQU $0cf
+EVENT_RETURNED_LOST_ITEM_TO_COPYCAT EQU $0d0
+EVENT_GOT_PASS_FROM_COPYCAT EQU $0d1
+EVENT_GOT_LOST_ITEM_FROM_FAN_CLUB EQU $0d2
+EVENT_LISTENED_TO_FAN_CLUB_PRESIDENT_BUT_BAG_WAS_FULL EQU $0d3
+EVENT_LISTENED_TO_FAN_CLUB_PRESIDENT EQU $0d4
+EVENT_TALKED_TO_SEAFOAM_GYM_GUY_ONCE EQU $0d5
+EVENT_ENABLE_DIPLOMA_PRINTING EQU $0d6
+EVENT_CLEARED_NUGGET_BRIDGE EQU $0d8
+EVENT_TALKED_TO_WARDENS_GRANDDAUGHTER EQU $0d9
+EVENT_GOT_TM03_CURSE EQU $0da
+EVENT_GOT_CLEANSE_TAG EQU $0db
+EVENT_GOT_TM19_GIGA_DRAIN EQU $0dc
+EVENT_GOT_TM06_TOXIC EQU $0dd
+EVENT_GOT_UP_GRADE EQU $0de
+EVENT_GOT_TM07_ZAP_CANNON EQU $0df
+EVENT_GOT_TM42_DREAM_EATER EQU $0e0
+EVENT_GOT_TM29_PSYCHIC EQU $0e3
+EVENT_FOUND_LEFTOVERS_IN_CELADON_CAFE EQU $0f9
+EVENT_FOUND_MACHINE_PART_IN_CERULEAN_GYM EQU $0fb
+EVENT_SHOWED_BEVERLY_MARILL EQU $261
+EVENT_SHOWED_DEREK_PIKACHU EQU $28d
+EVENT_SHOWED_TIFFANY_CLEFAIRY EQU $293
+EVENT_BUENA_OFFERED_HER_PHONE_NUMBER_NO_BLUE_CARD EQU $29e
+EVENT_SWITCH_1 EQU $2d3
+EVENT_SWITCH_2 EQU $2d4
+EVENT_SWITCH_3 EQU $2d5
+EVENT_EMERGENCY_SWITCH EQU $2d6
+EVENT_SWITCH_4 EQU $2d7
+EVENT_SWITCH_5 EQU $2d8
+EVENT_SWITCH_6 EQU $2d9
+EVENT_SWITCH_7 EQU $2da
+EVENT_SWITCH_8 EQU $2db
+EVENT_SWITCH_9 EQU $2dc
+EVENT_SWITCH_10 EQU $2dd
+EVENT_SWITCH_11 EQU $2de
+EVENT_SWITCH_12 EQU $2df
+EVENT_SWITCH_13 EQU $2e0
+EVENT_SWITCH_14 EQU $2e1
+EVENT_UNCOVERED_STAIRCASE_IN_MAHOGANY_MART EQU $2e2
+EVENT_TURNED_OFF_SECURITY_CAMERAS EQU $2e3
+EVENT_SECURITY_CAMERA_1 EQU $2e4
+EVENT_SECURITY_CAMERA_2 EQU $2e5
+EVENT_SECURITY_CAMERA_3 EQU $2e6
+EVENT_SECURITY_CAMERA_4 EQU $2e7
+EVENT_SECURITY_CAMERA_5 EQU $2e8
+EVENT_EXPLODING_TRAP_1 EQU $2e9
+EVENT_EXPLODING_TRAP_2 EQU $2ea
+EVENT_EXPLODING_TRAP_3 EQU $2eb
+EVENT_EXPLODING_TRAP_4 EQU $2ec
+EVENT_EXPLODING_TRAP_5 EQU $2ed
+EVENT_EXPLODING_TRAP_6 EQU $2ee
+EVENT_EXPLODING_TRAP_7 EQU $2ef
+EVENT_EXPLODING_TRAP_8 EQU $2f0
+EVENT_EXPLODING_TRAP_9 EQU $2f1
+EVENT_EXPLODING_TRAP_10 EQU $2f2
+EVENT_EXPLODING_TRAP_11 EQU $2f3
+EVENT_EXPLODING_TRAP_12 EQU $2f4
+EVENT_EXPLODING_TRAP_13 EQU $2f5
+EVENT_EXPLODING_TRAP_14 EQU $2f6
+EVENT_EXPLODING_TRAP_15 EQU $2f7
+EVENT_EXPLODING_TRAP_16 EQU $2f8
+EVENT_EXPLODING_TRAP_17 EQU $2f9
+EVENT_EXPLODING_TRAP_18 EQU $2fa
+EVENT_EXPLODING_TRAP_19 EQU $2fb
+EVENT_EXPLODING_TRAP_20 EQU $2fc
+EVENT_EXPLODING_TRAP_21 EQU $2fd
+EVENT_EXPLODING_TRAP_22 EQU $2fe
+EVENT_LEARNED_HAIL_GIOVANNI EQU $2ff
+EVENT_OPENED_DOOR_TO_ROCKET_HIDEOUT_TRANSMITTER EQU $300
+EVENT_WILLS_ROOM_EXIT_OPEN EQU $30a
+EVENT_WILLS_ROOM_ENTRANCE_CLOSED EQU $30b
+EVENT_KOGAS_ROOM_EXIT_OPEN EQU $30c
+EVENT_KOGAS_ROOM_ENTRANCE_CLOSED EQU $30d
+EVENT_BRUNOS_ROOM_EXIT_OPEN EQU $30e
+EVENT_KARENS_ROOM_ENTRANCE_CLOSED EQU $30f
+EVENT_KARENS_ROOM_EXIT_OPEN EQU $310
+EVENT_LANCES_ROOM_ENTRANCE_CLOSED EQU $311
+EVENT_FOUGHT_HO_OH EQU $317
+EVENT_FOUGHT_LUGIA EQU $318
+EVENT_BEAT_RIVAL_IN_MT_MOON EQU $319
+EVENT_MET_BILLS_GRANDPA EQU $31a
+EVENT_SHOWED_LICKITUNG_TO_BILLS_GRANDPA EQU $31b
+EVENT_SHOWED_ODDISH_TO_BILLS_GRANDPA EQU $31c
+EVENT_SHOWED_STARYU_TO_BILLS_GRANDPA EQU $31d
+EVENT_SHOWED_GROWLITHE_VULPIX_TO_BILLS_GRANDPA EQU $31e
+EVENT_SHOWED_PICHU_TO_BILLS_GRANDPA EQU $31f
+EVENT_GOT_EVERSTONE_FROM_BILLS_GRANDPA EQU $320
+EVENT_GOT_LEAF_STONE_FROM_BILLS_GRANDPA EQU $321
+EVENT_GOT_WATER_STONE_FROM_BILLS_GRANDPA EQU $322
+EVENT_GOT_FIRE_STONE_FROM_BILLS_GRANDPA EQU $323
+EVENT_GOT_THUNDERSTONE_FROM_BILLS_GRANDPA EQU $324
+EVENT_LISTENED_TO_RADIO_IN_NEIGHBORS_HOUSE EQU $325
+EVENT_WALL_OPENED_IN_HO_OH_CHAMBER EQU $326
+EVENT_WALL_OPENED_IN_KABUTO_CHAMBER EQU $327
+EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER EQU $328
+EVENT_WALL_OPENED_IN_AERODACTYL_CHAMBER EQU $329
+EVENT_WADE_HAS_BERRY EQU $32b
+EVENT_WADE_HAS_PSNCUREBERRY EQU $32c
+EVENT_WADE_HAS_PRZCUREBERRY EQU $32d
+EVENT_WADE_HAS_BITTER_BERRY EQU $32e
+EVENT_WILTON_HAS_ULTRA_BALL EQU $32f
+EVENT_WILTON_HAS_GREAT_BALL EQU $330
+EVENT_WILTON_HAS_POKE_BALL EQU $331
+EVENT_KOJI_ALLOWS_YOU_PASSAGE_TO_TIN_TOWER EQU $334
+EVENT_FOUGHT_SUICUNE EQU $335
+EVENT_GOT_RAINBOW_WING EQU $336
+EVENT_HUEY_PROTEIN EQU $337
+EVENT_JOEY_HP_UP EQU $338
+EVENT_VANCE_CARBOS EQU $339
+EVENT_PARRY_IRON EQU $33a
+EVENT_ERIN_CALCIUM EQU $33b
+EVENT_BUENA_OFFERED_HER_PHONE_NUMBER EQU $33c
+EVENT_MET_BUENA EQU $33d
+EVENT_GOT_ODD_EGG EQU $33e
+EVENT_GOT_GS_BALL_FROM_POKECOM_CENTER EQU $340
+EVENT_BEAT_SWIMMERF_ELAINE EQU $3e8
+EVENT_BEAT_SWIMMERF_PAULA EQU $3e9
+EVENT_BEAT_SWIMMERF_KAYLEE EQU $3ea
+EVENT_BEAT_SWIMMERF_SUSIE EQU $3eb
+EVENT_BEAT_SWIMMERF_DENISE EQU $3ec
+EVENT_BEAT_SWIMMERF_KARA EQU $3ed
+EVENT_BEAT_SWIMMERF_WENDY EQU $3ee
+EVENT_BEAT_SWIMMERF_DAWN EQU $3f3
+EVENT_BEAT_SWIMMERF_NICOLE EQU $3f5
+EVENT_BEAT_SWIMMERF_LORI EQU $3f6
+EVENT_BEAT_SWIMMERF_NIKKI EQU $3f8
+EVENT_BEAT_SWIMMERF_DIANA EQU $3f9
+EVENT_BEAT_SWIMMERF_BRIANA EQU $3fa
+EVENT_BEAT_BIRD_KEEPER_ROD EQU $3fb
+EVENT_BEAT_BIRD_KEEPER_ABE EQU $3fc
+EVENT_BEAT_BIRD_KEEPER_BRYAN EQU $3fd
+EVENT_BEAT_BIRD_KEEPER_THEO EQU $3fe
+EVENT_BEAT_BIRD_KEEPER_TOBY EQU $3ff
+EVENT_BEAT_BIRD_KEEPER_DENIS EQU $400
+EVENT_BEAT_BIRD_KEEPER_VANCE_1 EQU $401
+EVENT_BEAT_BIRD_KEEPER_HANK EQU $402
+EVENT_BEAT_BIRD_KEEPER_ROY EQU $403
+EVENT_BEAT_BIRD_KEEPER_BORIS EQU $404
+EVENT_BEAT_BIRD_KEEPER_BOB EQU $405
+EVENT_BEAT_BIRD_KEEPER_PETER EQU $407
+EVENT_BEAT_BIRD_KEEPER_JOSE EQU $408
+EVENT_BEAT_BIRD_KEEPER_PERRY EQU $409
+EVENT_BEAT_BIRD_KEEPER_BRET EQU $40a
+EVENT_BEAT_BOARDER_RONALD EQU $40e
+EVENT_BEAT_BOARDER_BRAD EQU $40f
+EVENT_BEAT_BOARDER_DOUGLAS EQU $410
+EVENT_BEAT_SAGE_CHOW EQU $411
+EVENT_BEAT_SAGE_NICO EQU $412
+EVENT_BEAT_SAGE_JIN EQU $413
+EVENT_BEAT_SAGE_TROY EQU $414
+EVENT_BEAT_SAGE_JEFFREY EQU $415
+EVENT_BEAT_SAGE_PING EQU $416
+EVENT_BEAT_SAGE_EDMOND EQU $417
+EVENT_BEAT_SAGE_NEAL EQU $418
+EVENT_BEAT_SAGE_LI EQU $419
+EVENT_BEAT_CAMPER_ROLAND EQU $41a
+EVENT_BEAT_CAMPER_TODD_1 EQU $41b
+EVENT_BEAT_CAMPER_IVAN EQU $41c
+EVENT_BEAT_CAMPER_ELLIOT EQU $41d
+EVENT_BEAT_CAMPER_LLOYD EQU $41f
+EVENT_BEAT_CAMPER_DEAN EQU $420
+EVENT_BEAT_CAMPER_SID EQU $421
+EVENT_BEAT_CAMPER_TED EQU $424
+EVENT_BEAT_CAMPER_JERRY EQU $42b
+EVENT_BEAT_CAMPER_SPENCER EQU $42c
+EVENT_BEAT_BURGLAR_DUNCAN EQU $42d
+EVENT_BEAT_BURGLAR_EDDIE EQU $42e
+EVENT_BEAT_BURGLAR_COREY EQU $42f
+EVENT_BEAT_BIKER_DWAYNE EQU $433
+EVENT_BEAT_BIKER_HARRIS EQU $434
+EVENT_BEAT_BIKER_ZEKE EQU $435
+EVENT_BEAT_BIKER_CHARLES EQU $436
+EVENT_BEAT_BIKER_RILEY EQU $437
+EVENT_BEAT_BIKER_JOEL EQU $438
+EVENT_BEAT_BIKER_GLENN EQU $439
+EVENT_BEAT_PSYCHIC_NATHAN EQU $43a
+EVENT_BEAT_PSYCHIC_FRANKLIN EQU $43b
+EVENT_BEAT_PSYCHIC_HERMAN EQU $43c
+EVENT_BEAT_PSYCHIC_FIDEL EQU $43d
+EVENT_BEAT_PSYCHIC_GREG EQU $43e
+EVENT_BEAT_PSYCHIC_NORMAN EQU $43f
+EVENT_BEAT_PSYCHIC_MARK EQU $440
+EVENT_BEAT_PSYCHIC_PHIL EQU $441
+EVENT_BEAT_PSYCHIC_RICHARD EQU $442
+EVENT_BEAT_PSYCHIC_GILBERT EQU $443
+EVENT_BEAT_PSYCHIC_JARED EQU $444
+EVENT_BEAT_PSYCHIC_RODNEY EQU $445
+EVENT_BEAT_FIREBREATHER_OTIS EQU $446
+EVENT_BEAT_FIREBREATHER_BURT EQU $449
+EVENT_BEAT_FIREBREATHER_BILL EQU $44a
+EVENT_BEAT_FIREBREATHER_WALT EQU $44b
+EVENT_BEAT_FIREBREATHER_RAY EQU $44c
+EVENT_BEAT_FIREBREATHER_LYLE EQU $44d
+EVENT_BEAT_FISHER_JUSTIN EQU $44e
+EVENT_BEAT_FISHER_RALPH_1 EQU $44f
+EVENT_BEAT_FISHER_ARNOLD EQU $450
+EVENT_BEAT_FISHER_KYLE EQU $451
+EVENT_BEAT_FISHER_HENRY EQU $452
+EVENT_BEAT_FISHER_MARVIN EQU $453
+EVENT_BEAT_FISHER_TULLY_1 EQU $454
+EVENT_BEAT_FISHER_ANDRE EQU $455
+EVENT_BEAT_FISHER_RAYMOND EQU $456
+EVENT_BEAT_FISHER_WILTON_1 EQU $457
+EVENT_BEAT_FISHER_EDGAR EQU $458
+EVENT_BEAT_FISHER_JONAH EQU $459
+EVENT_BEAT_FISHER_MARTIN EQU $45a
+EVENT_BEAT_FISHER_STEPHEN EQU $45b
+EVENT_BEAT_FISHER_BARNEY EQU $45c
+EVENT_BEAT_FISHER_SCOTT EQU $462
+EVENT_BEAT_TWINS_AMY_AND_MAY EQU $464
+EVENT_BEAT_TWINS_ANN_AND_ANNE EQU $465
+EVENT_BEAT_TWINS_JO_AND_ZOE EQU $468
+EVENT_BEAT_TWINS_MEG_AND_PEG EQU $46a
+EVENT_BEAT_SCHOOLBOY_JACK_1 EQU $46c
+EVENT_BEAT_SCHOOLBOY_KIP EQU $46d
+EVENT_BEAT_SCHOOLBOY_ALAN EQU $46e
+EVENT_BEAT_SCHOOLBOY_JOHNNY EQU $46f
+EVENT_BEAT_SCHOOLBOY_DANNY EQU $470
+EVENT_BEAT_SCHOOLBOY_TOMMY EQU $471
+EVENT_BEAT_SCHOOLBOY_DUDLEY EQU $472
+EVENT_BEAT_SCHOOLBOY_JOE EQU $473
+EVENT_BEAT_SCHOOLBOY_BILLY EQU $474
+EVENT_BEAT_SCHOOLBOY_CHAD_1 EQU $475
+EVENT_BEAT_SCHOOLBOY_NATE EQU $476
+EVENT_BEAT_SCHOOLBOY_RICKY EQU $477
+EVENT_BEAT_PICNICKER_LIZ_1 EQU $47e
+EVENT_BEAT_PICNICKER_GINA_1 EQU $47f
+EVENT_BEAT_PICNICKER_BROOKE EQU $480
+EVENT_BEAT_PICNICKER_KIM EQU $481
+EVENT_BEAT_PICNICKER_HOPE EQU $483
+EVENT_BEAT_PICNICKER_SHARON EQU $484
+EVENT_BEAT_PICNICKER_DEBRA EQU $485
+EVENT_BEAT_PICNICKER_ERIN_1 EQU $487
+EVENT_BEAT_PICNICKER_HEIDI EQU $48a
+EVENT_BEAT_PICNICKER_EDNA EQU $48b
+EVENT_BEAT_PICNICKER_TANYA EQU $490
+EVENT_BEAT_PICNICKER_TIFFANY_3 EQU $491
+EVENT_BEAT_GUITARIST_CLYDE EQU $493
+EVENT_BEAT_GUITARIST_VINCENT EQU $494
+EVENT_BEAT_JUGGLER_IRWIN_1 EQU $495
+EVENT_BEAT_JUGGLER_FRITZ EQU $496
+EVENT_BEAT_JUGGLER_HORTON EQU $497
+EVENT_BEAT_GENTLEMAN_PRESTON EQU $49a
+EVENT_BEAT_GENTLEMAN_EDWARD EQU $49b
+EVENT_BEAT_GENTLEMAN_GREGORY EQU $49c
+EVENT_BEAT_GENTLEMAN_ALFRED EQU $49e
+EVENT_BEAT_SCIENTIST_ROSS EQU $49f
+EVENT_BEAT_SCIENTIST_MITCH EQU $4a0
+EVENT_BEAT_SCIENTIST_JED EQU $4a1
+EVENT_BEAT_SCIENTIST_MARC EQU $4a2
+EVENT_BEAT_SCIENTIST_RICH EQU $4a3
+EVENT_BEAT_BLACKBELT_YOSHI EQU $4a5
+EVENT_BEAT_BLACKBELT_LAO EQU $4a7
+EVENT_BEAT_BLACKBELT_NOB EQU $4a8
+EVENT_BEAT_BLACKBELT_LUNG EQU $4aa
+EVENT_BEAT_BLACKBELT_KENJI_3 EQU $4ab
+EVENT_BEAT_BLACKBELT_WAI EQU $4ac
+EVENT_BEAT_BEAUTY_VICTORIA EQU $4ad
+EVENT_BEAT_BEAUTY_SAMANTHA EQU $4ae
+EVENT_BEAT_BEAUTY_CASSIE EQU $4b2
+EVENT_BEAT_BEAUTY_JULIA EQU $4ba
+EVENT_BEAT_BEAUTY_VALERIE EQU $4bc
+EVENT_BEAT_FALKNER EQU $4bd
+EVENT_BEAT_BUGSY EQU $4be
+EVENT_BEAT_WHITNEY EQU $4bf
+EVENT_BEAT_MORTY EQU $4c0
+EVENT_BEAT_JASMINE EQU $4c1
+EVENT_BEAT_CHUCK EQU $4c2
+EVENT_BEAT_PRYCE EQU $4c3
+EVENT_BEAT_CLAIR EQU $4c4
+EVENT_BEAT_BROCK EQU $4c5
+EVENT_BEAT_MISTY EQU $4c6
+EVENT_BEAT_LTSURGE EQU $4c7
+EVENT_BEAT_JANINE EQU $4c9
+EVENT_BEAT_SABRINA EQU $4ca
+EVENT_BEAT_BLUE EQU $4cc
+EVENT_BEAT_POKEFANM_WILLIAM EQU $4cd
+EVENT_BEAT_POKEFANM_DEREK EQU $4ce
+EVENT_BEAT_POKEFANM_ROBERT EQU $4cf
+EVENT_BEAT_POKEFANM_JOSHUA EQU $4d0
+EVENT_BEAT_POKEFANM_CARTER EQU $4d1
+EVENT_BEAT_POKEFANM_TREVOR EQU $4d2
+EVENT_BEAT_POKEFANM_BRANDON EQU $4d3
+EVENT_BEAT_POKEFANM_JEREMY EQU $4d4
+EVENT_BEAT_POKEFANM_COLIN EQU $4d5
+EVENT_BEAT_POKEFANM_ALEX EQU $4d8
+EVENT_BEAT_POKEFANF_BEVERLY EQU $4d9
+EVENT_BEAT_POKEFANF_RUTH EQU $4da
+EVENT_BEAT_POKEFANF_GEORGIA EQU $4dd
+EVENT_BEAT_KIMONO_GIRL_NAOKO EQU $4df
+EVENT_BEAT_KIMONO_GIRL_SAYO EQU $4e0
+EVENT_BEAT_KIMONO_GIRL_ZUKI EQU $4e1
+EVENT_BEAT_KIMONO_GIRL_KUNI EQU $4e2
+EVENT_BEAT_KIMONO_GIRL_MIKI EQU $4e3
+EVENT_BEAT_POKEMANIAC_LARRY EQU $4e4
+EVENT_BEAT_POKEMANIAC_ANDREW EQU $4e5
+EVENT_BEAT_POKEMANIAC_CALVIN EQU $4e6
+EVENT_BEAT_POKEMANIAC_SHANE EQU $4e7
+EVENT_BEAT_POKEMANIAC_BEN EQU $4e8
+EVENT_BEAT_POKEMANIAC_BRENT EQU $4e9
+EVENT_BEAT_POKEMANIAC_RON EQU $4ea
+EVENT_BEAT_POKEMANIAC_ETHAN EQU $4eb
+EVENT_BEAT_POKEMANIAC_ISSAC EQU $4ee
+EVENT_BEAT_POKEMANIAC_DONALD EQU $4ef
+EVENT_BEAT_POKEMANIAC_ZACH EQU $4f0
+EVENT_BEAT_ROCKET_GRUNTM_1 EQU $4f1
+EVENT_BEAT_ROCKET_GRUNTM_2 EQU $4f2
+EVENT_BEAT_ROCKET_GRUNTM_3 EQU $4f3
+EVENT_BEAT_ROCKET_GRUNTM_4 EQU $4f4
+EVENT_BEAT_ROCKET_GRUNTM_5 EQU $4f5
+EVENT_BEAT_ROCKET_GRUNTM_6 EQU $4f6
+EVENT_BEAT_ROCKET_GRUNTM_7 EQU $4f7
+EVENT_BEAT_ROCKET_GRUNTM_8 EQU $4f8
+EVENT_BEAT_ROCKET_GRUNTM_9 EQU $4f9
+EVENT_BEAT_ROCKET_GRUNTM_10 EQU $4fa
+EVENT_BEAT_ROCKET_GRUNTM_11 EQU $4fb
+EVENT_BEAT_ROCKET_GRUNTM_12 EQU $4fd
+EVENT_BEAT_ROCKET_GRUNTM_13 EQU $4fe
+EVENT_BEAT_ROCKET_GRUNTM_14 EQU $4ff
+EVENT_BEAT_ROCKET_GRUNTM_15 EQU $500
+EVENT_BEAT_ROCKET_GRUNTM_16 EQU $501
+EVENT_BEAT_ROCKET_GRUNTM_17 EQU $502
+EVENT_BEAT_ROCKET_GRUNTM_18 EQU $503
+EVENT_BEAT_ROCKET_GRUNTM_19 EQU $508
+EVENT_BEAT_ROCKET_GRUNTM_20 EQU $509
+EVENT_BEAT_ROCKET_GRUNTM_21 EQU $50c
+EVENT_BEAT_ROCKET_GRUNTM_22 EQU $50d
+EVENT_BEAT_ROCKET_GRUNTF_1 EQU $510
+EVENT_BEAT_ROCKET_GRUNTF_2 EQU $511
+EVENT_BEAT_ROCKET_GRUNTF_3 EQU $512
+EVENT_BEAT_ROCKET_GRUNTF_4 EQU $513
+EVENT_BEAT_ROCKET_GRUNTF_5 EQU $514
+EVENT_BEAT_LASS_CARRIE EQU $515
+EVENT_BEAT_LASS_BRIDGET EQU $516
+EVENT_BEAT_LASS_KRISE EQU $518
+EVENT_BEAT_LASS_CONNIE_1 EQU $519
+EVENT_BEAT_LASS_LAURA EQU $51b
+EVENT_BEAT_LASS_SHANNON EQU $51c
+EVENT_BEAT_LASS_MICHELLE EQU $51d
+EVENT_BEAT_LASS_DANA EQU $51e
+EVENT_BEAT_LASS_ELLEN EQU $51f
+EVENT_BEAT_HIKER_RUSSELL EQU $525
+EVENT_BEAT_HIKER_PHILLIP EQU $526
+EVENT_BEAT_HIKER_LEONARD EQU $527
+EVENT_BEAT_HIKER_ANTHONY_2 EQU $528
+EVENT_BEAT_HIKER_BENJAMIN EQU $529
+EVENT_BEAT_HIKER_ERIK EQU $52a
+EVENT_BEAT_HIKER_MICHAEL EQU $52b
+EVENT_BEAT_HIKER_PARRY_3 EQU $52c
+EVENT_BEAT_HIKER_TIMOTHY EQU $52d
+EVENT_BEAT_HIKER_BAILEY EQU $52e
+EVENT_BEAT_HIKER_TIM EQU $530
+EVENT_BEAT_HIKER_NOLAND EQU $531
+EVENT_BEAT_HIKER_SIDNEY EQU $532
+EVENT_BEAT_HIKER_KENNY EQU $533
+EVENT_BEAT_HIKER_JIM EQU $534
+EVENT_BEAT_HIKER_DANIEL EQU $535
+EVENT_BEAT_BUG_CATCHER_DON EQU $538
+EVENT_BEAT_BUG_CATCHER_ROB EQU $539
+EVENT_BEAT_BUG_CATCHER_ED EQU $53a
+EVENT_BEAT_BUG_CATCHER_WADE_1 EQU $53b
+EVENT_BEAT_BUG_CATCHER_BENNY EQU $53c
+EVENT_BEAT_BUG_CATCHER_AL EQU $53d
+EVENT_BEAT_BUG_CATCHER_JOSH EQU $53e
+EVENT_BEAT_BUG_CATCHER_ARNIE_1 EQU $53f
+EVENT_BEAT_BUG_CATCHER_KEN EQU $540
+EVENT_BEAT_BUG_CATCHER_DOUG EQU $543
+EVENT_BEAT_COOLTRAINERM_NICK EQU $548
+EVENT_BEAT_COOLTRAINERM_AARON EQU $549
+EVENT_BEAT_COOLTRAINERM_PAUL EQU $54a
+EVENT_BEAT_COOLTRAINERM_CODY EQU $54b
+EVENT_BEAT_COOLTRAINERM_MIKE EQU $54c
+EVENT_BEAT_COOLTRAINERM_RYAN EQU $54f
+EVENT_BEAT_COOLTRAINERM_JAKE EQU $550
+EVENT_BEAT_COOLTRAINERM_GAVEN_3 EQU $551
+EVENT_BEAT_COOLTRAINERM_BLAKE EQU $552
+EVENT_BEAT_COOLTRAINERM_BRIAN EQU $553
+EVENT_BEAT_COOLTRAINERM_SEAN EQU $557
+EVENT_BEAT_COOLTRAINERM_ALLEN EQU $55a
+EVENT_BEAT_COOLTRAINERF_GWEN EQU $55b
+EVENT_BEAT_COOLTRAINERF_LOIS EQU $55c
+EVENT_BEAT_COOLTRAINERF_FRAN EQU $55d
+EVENT_BEAT_COOLTRAINERF_LOLA EQU $55e
+EVENT_BEAT_COOLTRAINERF_KATE EQU $55f
+EVENT_BEAT_COOLTRAINERF_IRENE EQU $560
+EVENT_BEAT_COOLTRAINERF_KELLY EQU $561
+EVENT_BEAT_COOLTRAINERF_JOYCE EQU $562
+EVENT_BEAT_COOLTRAINERF_BETH_1 EQU $563
+EVENT_BEAT_COOLTRAINERF_REENA_1 EQU $564
+EVENT_BEAT_COOLTRAINERF_MEGAN EQU $565
+EVENT_BEAT_COOLTRAINERF_CAROL EQU $567
+EVENT_BEAT_COOLTRAINERF_QUINN EQU $568
+EVENT_BEAT_COOLTRAINERF_EMMA EQU $569
+EVENT_BEAT_COOLTRAINERF_CYBIL EQU $56a
+EVENT_BEAT_COOLTRAINERF_JENN EQU $56b
+EVENT_BEAT_ROCKET_EXECUTIVEF EQU $56f
+EVENT_BEAT_ROCKET_EXECUTIVEM EQU $572
+EVENT_BEAT_SAILOR_EUGENE EQU $575
+EVENT_BEAT_SAILOR_HUEY_1 EQU $576
+EVENT_BEAT_SAILOR_TERRELL EQU $577
+EVENT_BEAT_SAILOR_KENT EQU $578
+EVENT_BEAT_SAILOR_ERNEST EQU $579
+EVENT_BEAT_SAILOR_JEFF EQU $57a
+EVENT_BEAT_SAILOR_GARRETT EQU $57b
+EVENT_BEAT_SAILOR_KENNETH EQU $57c
+EVENT_BEAT_SAILOR_HARRY EQU $57e
+EVENT_BEAT_SUPER_NERD_ERIC EQU $582
+EVENT_BEAT_SUPER_NERD_SAM EQU $586
+EVENT_BEAT_SUPER_NERD_TOM EQU $587
+EVENT_BEAT_SUPER_NERD_PAT EQU $588
+EVENT_BEAT_SUPER_NERD_SHAWN EQU $589
+EVENT_BEAT_SUPER_NERD_TERU EQU $58a
+EVENT_BEAT_MEDIUM_MARTHA EQU $58b
+EVENT_BEAT_MEDIUM_GRACE EQU $58c
+EVENT_BEAT_MEDIUM_REBECCA EQU $590
+EVENT_BEAT_MEDIUM_DORIS EQU $591
+EVENT_BEAT_SKIER_ROXANNE EQU $592
+EVENT_BEAT_SKIER_CLARISSA EQU $593
+EVENT_BEAT_SWIMMERM_HAROLD EQU $594
+EVENT_BEAT_SWIMMERM_SIMON EQU $595
+EVENT_BEAT_SWIMMERM_RANDALL EQU $596
+EVENT_BEAT_SWIMMERM_CHARLIE EQU $597
+EVENT_BEAT_SWIMMERM_GEORGE EQU $598
+EVENT_BEAT_SWIMMERM_BERKE EQU $599
+EVENT_BEAT_SWIMMERM_KIRK EQU $59a
+EVENT_BEAT_SWIMMERM_MATHEW EQU $59b
+EVENT_BEAT_SWIMMERM_JEROME EQU $5a1
+EVENT_BEAT_SWIMMERM_TUCKER EQU $5a2
+EVENT_BEAT_SWIMMERM_CAMERON EQU $5a4
+EVENT_BEAT_SWIMMERM_SETH EQU $5a5
+EVENT_BEAT_SWIMMERM_PARKER EQU $5a8
+EVENT_BEAT_YOUNGSTER_JOEY_1 EQU $5a9
+EVENT_BEAT_YOUNGSTER_MIKEY EQU $5aa
+EVENT_BEAT_YOUNGSTER_ALBERT EQU $5ab
+EVENT_BEAT_YOUNGSTER_GORDON EQU $5ac
+EVENT_BEAT_YOUNGSTER_SAMUEL EQU $5ad
+EVENT_BEAT_YOUNGSTER_IAN EQU $5ae
+EVENT_BEAT_YOUNGSTER_WARREN EQU $5b1
+EVENT_BEAT_YOUNGSTER_JIMMY EQU $5b2
+EVENT_BEAT_YOUNGSTER_OWEN EQU $5b3
+EVENT_BEAT_YOUNGSTER_JASON EQU $5b4
+EVENT_BEAT_TEACHER_COLETTE EQU $5b5
+EVENT_BEAT_TEACHER_HILLARY EQU $5b6
+EVENT_BEAT_TEACHER_SHIRLEY EQU $5b7
+EVENT_BEAT_ELITE_4_KAREN EQU $5bb
+EVENT_BEAT_CHAMPION_LANCE EQU $5bc
+EVENT_BEAT_COOLTRAINERM_DARIN EQU $5bd
+EVENT_BEAT_COOLTRAINERF_CARA EQU $5be
+EVENT_BEAT_TWINS_LEA_AND_PIA EQU $5bf
+EVENT_BEAT_BUG_CATCHER_WAYNE EQU $5c0
+EVENT_BEAT_BEAUTY_OLIVIA EQU $5c1
+EVENT_BEAT_POKEMANIAC_MILER EQU $5c4
+EVENT_BEAT_SUPER_NERD_HUGH EQU $5c5
+EVENT_BEAT_SUPER_NERD_MARKUS EQU $5c6
+EVENT_BEAT_POKEFANM_REX EQU $5c7
+EVENT_BEAT_POKEFANM_ALLAN EQU $5c8
+EVENT_BEAT_SAGE_GAKU EQU $5c9
+EVENT_BEAT_SAGE_MASA EQU $5ca
+EVENT_BEAT_SAGE_KOJI EQU $5cb
+EVENT_GUIDE_GENT_VISIBLE_IN_CHERRYGROVE EQU $6ff
+EVENT_ELMS_AIDE_IN_VIOLET_POKEMON_CENTER EQU $700
+EVENT_ELMS_AIDE_IN_LAB EQU $701
+EVENT_BOULDER_IN_ICE_PATH_1 EQU $70d
+EVENT_BOULDER_IN_ICE_PATH_2 EQU $70e
+EVENT_BOULDER_IN_ICE_PATH_3 EQU $70f
+EVENT_BOULDER_IN_ICE_PATH_4 EQU $710
+EVENT_FOUGHT_SNORLAX EQU $750
+EVENT_PICKED_UP_FOCUS_BAND EQU $77d
+EVENT_PICKED_UP_GOLD_BERRY_FROM_HO_OH_ITEM_ROOM EQU $794
+EVENT_PICKED_UP_MYSTERYBERRY_FROM_HO_OH_ITEM_ROOM EQU $795
+EVENT_PICKED_UP_REVIVAL_HERB_FROM_HO_OH_ITEM_ROOM EQU $796
+EVENT_PICKED_UP_CHARCOAL_FROM_HO_OH_ITEM_ROOM EQU $797
+EVENT_PICKED_UP_BERRY_FROM_KABUTO_ITEM_ROOM EQU $798
+EVENT_PICKED_UP_PSNCUREBERRY_FROM_KABUTO_ITEM_ROOM EQU $799
+EVENT_PICKED_UP_HEAL_POWDER_FROM_KABUTO_ITEM_ROOM EQU $79a
+EVENT_PICKED_UP_ENERGYPOWDER_FROM_KABUTO_ITEM_ROOM EQU $79b
+EVENT_PICKED_UP_MYSTERYBERRY_FROM_OMANYTE_ITEM_ROOM EQU $79c
+EVENT_PICKED_UP_MYSTIC_WATER_FROM_OMANYTE_ITEM_ROOM EQU $79d
+EVENT_PICKED_UP_STARDUST_FROM_OMANYTE_ITEM_ROOM EQU $79e
+EVENT_PICKED_UP_STAR_PIECE_FROM_OMANYTE_ITEM_ROOM EQU $79f
+EVENT_PICKED_UP_GOLD_BERRY_FROM_AERODACTYL_ITEM_ROOM EQU $7a0
+EVENT_PICKED_UP_MOON_STONE_FROM_AERODACTYL_ITEM_ROOM EQU $7a1
+EVENT_PICKED_UP_HEAL_POWDER_FROM_AERODACTYL_ITEM_ROOM EQU $7a2
+EVENT_PICKED_UP_ENERGY_ROOT_FROM_AERODACTYL_ITEM_ROOM EQU $7a3
+EVENT_SAW_SUICUNE_AT_CIANWOOD_CITY EQU $7ae
+EVENT_SAW_SUICUNE_ON_ROUTE_42 EQU $7af
+EVENT_SAW_SUICUNE_ON_ROUTE_36 EQU $7b0
+EVENT_SET_WHEN_FOUGHT_HO_OH EQU $7b7
--- a/engine/copy.asm
+++ b/engine/copy.asm
@@ -248,13 +248,13 @@
.asm_edc
ld a, e
- ld [$cf68], a
+ ld [Requested2bppSource], a
ld a, d
- ld [$cf69], a
+ ld [Requested2bppSource + 1], a
ld a, l
- ld [$cf6a], a
+ ld [Requested2bppDest], a
ld a, h
- ld [$cf6b], a
+ ld [Requested2bppDest + 1], a
.asm_eec
ld a, c
@@ -262,10 +262,10 @@
cp [hl]
jr nc, .asm_f08
- ld [$cf67], a
+ ld [Requested2bpp], a
.wait
call DelayFrame
- ld a, [$cf67]
+ ld a, [Requested2bpp]
and a
jr nz, .wait
@@ -281,10 +281,10 @@
.asm_f08
ld a, [$ffd3]
- ld [$cf67], a
+ ld [Requested2bpp], a
.asm_f0d
call DelayFrame
- ld a, [$cf67]
+ ld a, [Requested2bpp]
and a
jr nz, .asm_f0d
ld a, c
@@ -322,13 +322,13 @@
.asm_f40
ld a, e
- ld [$cf6d], a
+ ld [Requested1bppSource], a
ld a, d
- ld [$cf6e], a
+ ld [Requested1bppSource + 1], a
ld a, l
- ld [$cf6f], a
+ ld [Requested1bppDest], a
ld a, h
- ld [$cf70], a
+ ld [Requested1bppDest + 1], a
.asm_f50
ld a, c
ld hl, $ffd3
@@ -335,10 +335,10 @@
cp [hl]
jr nc, .asm_f6c
- ld [$cf6c], a
+ ld [Requested1bpp], a
.wait
call DelayFrame
- ld a, [$cf6c]
+ ld a, [Requested1bpp]
and a
jr nz, .wait
@@ -354,10 +354,10 @@
.asm_f6c
ld a, [$ffd3]
- ld [$cf6c], a
+ ld [Requested1bpp], a
.asm_f71
call DelayFrame
- ld a, [$cf6c]
+ ld a, [Requested1bpp]
and a
jr nz, .asm_f71
ld a, c
--- /dev/null
+++ b/engine/delay.asm
@@ -1,0 +1,23 @@
+DelayFrame: ; 45a
+; Wait for one frame
+ ld a, 1
+ ld [VBlankOccurred], a
+
+; Wait for the next VBlank, halting to conserve battery
+.halt
+ halt ; rgbasm adds a nop after this instruction by default
+ ld a, [VBlankOccurred]
+ and a
+ jr nz, .halt
+ ret
+; 468
+
+
+DelayFrames: ; 468
+; Wait c frames
+ call DelayFrame
+ dec c
+ jr nz, DelayFrames
+ ret
+; 46f
+
--- /dev/null
+++ b/engine/farcall.asm
@@ -1,0 +1,55 @@
+FarCall_de: ; 2d54
+; Call a:de.
+; Preserves other registers.
+
+ ld [hBuffer], a
+ ld a, [hROMBank]
+ push af
+ ld a, [hBuffer]
+ rst Bankswitch
+ call .de
+ jr ReturnFarCall
+
+.de
+ push de
+ ret
+; 2d63
+
+
+FarCall_hl: ; 2d63
+; Call a:hl.
+; Preserves other registers.
+
+ ld [hBuffer], a
+ ld a, [hROMBank]
+ push af
+ ld a, [hBuffer]
+ rst Bankswitch
+ call Function2d82
+; 2d6e
+
+ReturnFarCall: ; 2d6e
+; We want to retain the contents of f.
+; To do this, we can pop to bc instead of af.
+
+ ld a, b
+ ld [$cfb9], a
+ ld a, c
+ ld [$cfba], a
+
+; Restore the working bank.
+ pop bc
+ ld a, b
+ rst Bankswitch
+
+ ld a, [$cfb9]
+ ld b, a
+ ld a, [$cfba]
+ ld c, a
+ ret
+; 2d82
+
+Function2d82: ; 2d82
+ jp [hl]
+; 2d83
+
--- /dev/null
+++ b/engine/game_time.asm
@@ -1,0 +1,132 @@
+ResetGameTime: ; 208a
+ xor a
+ ld [GameTimeCap], a
+ ld [GameTimeHours], a
+ ld [GameTimeHours + 1], a
+ ld [GameTimeMinutes], a
+ ld [GameTimeSeconds], a
+ ld [GameTimeFrames], a
+ ret
+; 209e
+
+
+GameTimer: ; 209e
+
+ nop
+
+ ld a, [rSVBK]
+ push af
+ ld a, 1
+ ld [rSVBK], a
+
+ call UpdateGameTimer
+
+ pop af
+ ld [rSVBK], a
+ ret
+; 20ad
+
+
+UpdateGameTimer: ; 20ad
+; Increment the game timer by one frame.
+; The game timer is capped at 999:59:59.00.
+
+
+; Don't update if game logic is paused.
+ ld a, [$c2cd]
+ and a
+ ret nz
+
+; Is the timer paused?
+ ld hl, GameTimerPause
+ bit 0, [hl]
+ ret z
+
+; Is the timer already capped?
+ ld hl, GameTimeCap
+ bit 0, [hl]
+ ret nz
+
+
+; +1 frame
+ ld hl, GameTimeFrames
+ ld a, [hl]
+ inc a
+
+ cp 60 ; frames/second
+ jr nc, .second
+
+ ld [hl], a
+ ret
+
+
+.second
+ xor a
+ ld [hl], a
+
+; +1 second
+ ld hl, GameTimeSeconds
+ ld a, [hl]
+ inc a
+
+ cp 60 ; seconds/minute
+ jr nc, .minute
+
+ ld [hl], a
+ ret
+
+
+.minute
+ xor a
+ ld [hl], a
+
+; +1 minute
+ ld hl, GameTimeMinutes
+ ld a, [hl]
+ inc a
+
+ cp 60 ; minutes/hour
+ jr nc, .hour
+
+ ld [hl], a
+ ret
+
+
+.hour
+ xor a
+ ld [hl], a
+
+; +1 hour
+ ld a, [GameTimeHours]
+ ld h, a
+ ld a, [GameTimeHours + 1]
+ ld l, a
+ inc hl
+
+
+; Cap the timer after 1000 hours.
+ ld a, h
+ cp 1000 / $100
+ jr c, .ok
+
+ ld a, l
+ cp 1000 % $100
+ jr c, .ok
+
+ ld hl, GameTimeCap
+ set 0, [hl]
+
+ ld a, 59 ; 999:59:59.00
+ ld [GameTimeMinutes], a
+ ld [GameTimeSeconds], a
+ ret
+
+
+.ok
+ ld a, h
+ ld [GameTimeHours], a
+ ld a, l
+ ld [GameTimeHours + 1], a
+ ret
+; 210f
+
--- /dev/null
+++ b/engine/map_objects.asm
@@ -1,0 +1,683 @@
+; Functions handling map objects.
+
+
+GetSpritePalette: ; 17ff
+ push hl
+ push de
+ push bc
+ ld c, a
+ callba _GetSpritePalette
+ ld a, c
+ pop bc
+ pop de
+ pop hl
+ ret
+; 180e
+
+
+Function180e: ; 180e
+ push hl
+ push bc
+ ld hl, $d156
+ ld c, $1f
+ ld b, a
+ ld a, [hConnectionStripLength]
+ cp $0
+ jr z, .asm_182b
+ ld a, b
+.asm_181d
+ cp [hl]
+ jr z, .asm_1830
+ inc hl
+ inc hl
+ dec c
+ jr nz, .asm_181d
+ ld a, [$d155]
+ scf
+ jr .asm_1833
+
+.asm_182b
+ ld a, [$d155]
+ jr .asm_1833
+
+.asm_1830
+ inc hl
+ xor a
+ ld a, [hl]
+
+.asm_1833
+ pop bc
+ pop hl
+ ret
+; 1836
+
+Function1836: ; 1836
+ push de
+ push hl
+
+ ld b, a
+ ld a, [hROMBank]
+ push af
+ ld a, BANK(Function142a7)
+ rst Bankswitch
+
+ ld a, b
+ call Function142a7
+ ld c, a
+
+ pop de
+ ld a, d
+ rst Bankswitch
+
+ pop hl
+ pop de
+ ret
+; 184a
+
+
+
+Function184a: ; 184a
+ ld a, [StandingTile]
+ call GetTileCollision
+ ld b, a
+ ret
+; 1852
+
+Function1852: ; 1852
+ ld a, [StandingTile]
+ call GetTileCollision
+ sub 1
+ ret z
+ and a
+ ret
+; 185d
+
+
+GetTileCollision: ; 185d
+; Get the collision type of tile a.
+
+ push de
+ push hl
+
+ ld hl, TileCollisionTable
+ ld e, a
+ ld d, 0
+ add hl, de
+
+ ld a, [hROMBank]
+ push af
+ ld a, BANK(TileCollisionTable)
+ rst Bankswitch
+ ld e, [hl]
+ pop af
+ rst Bankswitch
+
+ ld a, e
+ and $f ; lo nybble only
+
+ pop hl
+ pop de
+ ret
+; 1875
+
+
+Function1875: ; 1875
+ ld d, a
+ and $f0
+ cp $10
+ jr z, .asm_1882
+ cp $20
+ jr z, .asm_1888
+ scf
+ ret
+
+.asm_1882
+ ld a, d
+ and 7
+ ret z
+ scf
+ ret
+
+.asm_1888
+ ld a, d
+ and 7
+ ret z
+ scf
+ ret
+; 188e
+
+Function188e: ; 188e
+ cp $14
+ ret z
+ cp $1c
+ ret
+; 1894
+
+CheckCutTreeTile: ; 1894
+ cp $12
+ ret z
+ cp $1a
+ ret
+; 189a
+
+CheckHeadbuttTreeTile: ; 189a
+ cp $15
+ ret z
+ cp $1d
+ ret
+; 18a0
+
+CheckCounterTile: ; 18a0
+ cp $90
+ ret z
+ cp $98
+ ret
+; 18a6
+
+CheckPitTile: ; 18a6
+ cp $60
+ ret z
+ cp $68
+ ret
+; 18ac
+
+CheckIceTile: ; 18ac
+ cp $23
+ ret z
+ cp $2b
+ ret z
+ scf
+ ret
+; 18b4
+
+CheckWhirlpoolTile: ; 18b4
+ nop
+ cp $24
+ ret z
+ cp $2c
+ ret z
+ scf
+ ret
+; 18bd
+
+CheckWaterfallTile: ; 18bd
+ cp $33
+ ret z
+ cp $3b
+ ret
+; 18c3
+
+CheckStandingOnEntrance: ; 18c3
+ ld a, [StandingTile]
+ cp $71 ; door
+ ret z
+ cp $79
+ ret z
+ cp $7a ; stairs
+ ret z
+ cp $7b ; cave
+ ret
+; 18d2
+
+
+GetMapObject: ; 18d2
+; Return the location of map object a in bc.
+ ld hl, MapObjects
+ ld bc, $10
+ call AddNTimes
+ ld b, h
+ ld c, l
+ ret
+; 18de
+
+
+Function18de: ; 18de
+ ld [hConnectionStripLength], a
+ call GetMapObject
+ ld hl, $0000
+ add hl, bc
+ ld a, [hl]
+ cp $ff
+ jr z, .asm_18f3
+ ld [hConnectedMapWidth], a
+ call Function1ae5
+ and a
+ ret
+
+.asm_18f3
+ scf
+ ret
+; 18f5
+
+Function18f5: ; 18f5
+ ld hl, $0006
+ add hl, bc
+ ld a, [hl]
+ cp $ff
+ jr nz, .asm_1921
+ ld hl, $0007
+ add hl, bc
+ ld a, [hl]
+ cp $ff
+ jr z, .asm_191c
+ ld hl, .data_191e
+ ld a, [TimeOfDay]
+ add l
+ ld l, a
+ jr nc, .asm_1912
+ inc h
+
+.asm_1912
+ ld a, [hl]
+ ld hl, $0007
+ add hl, bc
+ and [hl]
+ jr nz, .asm_191c
+ scf
+ ret
+
+.asm_191c
+ and a
+ ret
+
+.data_191e
+ db $1
+ db $2
+ db $4
+
+.asm_1921
+ ld hl, $0006
+ add hl, bc
+ ld d, [hl]
+ ld hl, $0007
+ add hl, bc
+ ld e, [hl]
+ ld hl, hHours
+ ld a, d
+ cp e
+ jr z, .asm_1949
+ jr c, .asm_193f
+ ld a, [hl]
+ cp d
+ jr nc, .asm_1949
+ cp e
+ jr c, .asm_1949
+ jr z, .asm_1949
+ jr .asm_194b
+
+.asm_193f
+ ld a, e
+ cp [hl]
+ jr c, .asm_194b
+ ld a, [hl]
+ cp d
+ jr nc, .asm_1949
+ jr .asm_194b
+
+.asm_1949
+ and a
+ ret
+
+.asm_194b
+ scf
+ ret
+; 194d
+
+Function194d: ; 194d
+ ld [hConnectionStripLength], a
+ call GetMapObject
+ call $40e7
+ ret
+; 1956
+
+
+
+Function1956: ; 1956
+ ld [hConnectionStripLength], a
+ call Function271e
+ ld a, [hConnectionStripLength]
+ call GetMapObject
+ ld a, $2
+ ld hl, $40e7
+ rst FarCall
+ ret
+; 1967
+
+Function1967: ; 1967
+ ld [hConnectionStripLength], a
+ call GetMapObject
+ ld hl, $0000
+ add hl, bc
+ ld a, [hl]
+ cp $ff
+ ret z
+ ld [hl], $ff
+ push af
+ call Function1985
+ pop af
+ call Function1ae5
+ callba Function4357
+ ret
+; 1985
+
+Function1985: ; 1985
+ ld hl, $d4cd
+ cp [hl]
+ jr z, .asm_1990
+ ld hl, $d4ce
+ cp [hl]
+ ret nz
+
+.asm_1990
+ callba Function581f
+ ld a, $ff
+ ld [$d4cd], a
+ ld [$d4ce], a
+ ret
+; 199f
+
+Function199f: ; 199f
+ call Function1967
+ call Function2712
+ ret
+; 19a6
+
+Function19a6: ; 19a6
+ push hl
+ call GetMapObject
+ ld d, b
+ ld e, c
+ ld a, $ff
+ ld [de], a
+ inc de
+ pop hl
+ ld bc, $000f
+ call CopyBytes
+ ret
+; 19b8
+
+Function19b8: ; 19b8
+ call GetMapObject
+ ld hl, $0000
+ add hl, bc
+ ld a, [hl]
+ push af
+ ld [hl], $ff
+ inc hl
+ ld bc, $000f
+ xor a
+ call ByteFill
+ pop af
+ cp $ff
+ ret z
+ cp $d
+ ret nc
+ ld b, a
+ ld a, [$d4cd]
+ cp b
+ jr nz, .asm_19de
+ ld a, $ff
+ ld [$d4cd], a
+
+.asm_19de
+ ld a, b
+ call Function1ae5
+ callba Function4357
+ ret
+; 19e9
+
+
+
+Function19e9: ; 19e9
+ ld [$c2e2], a
+ ld a, [hROMBank]
+ ld [$c2e3], a
+ ld a, l
+ ld [$c2e4], a
+ ld a, h
+ ld [$c2e5], a
+ ld a, [$c2e2]
+ call Function18de
+ ret c
+ ld hl, $0003
+ add hl, bc
+ ld [hl], $14
+ ld hl, $0009
+ add hl, bc
+ ld [hl], $0
+ ld hl, VramState
+ set 7, [hl]
+ and a
+ ret
+; 1a13
+
+
+
+Function1a13: ; 1a13
+ push bc
+ push de
+ ld hl, $d4d6
+ ld de, $0028
+ ld c, $d
+.asm_1a1d
+ ld a, [hl]
+ and a
+ jr z, .asm_1a28
+ add hl, de
+ dec c
+ jr nz, .asm_1a1d
+ xor a
+ jr .asm_1a2c
+
+.asm_1a28
+ ld a, $d
+ sub c
+ scf
+
+.asm_1a2c
+ pop de
+ pop bc
+ ret
+; 1a2f
+
+
+
+Function1a2f: ; 1a2f
+ ld hl, $0003
+ add hl, bc
+ ld a, [hl]
+ cp $25
+ jr c, .asm_1a39
+ xor a
+
+.asm_1a39
+ ld hl, Data4273
+ ld e, a
+ ld d, 0
+ add hl, de
+ add hl, de
+ add hl, de
+ add hl, de
+ add hl, de
+ add hl, de
+ ld a, [hl]
+ ret
+; 1a47
+
+Function1a47: ; 1a47
+ push bc
+ push de
+ ld e, a
+ ld d, 0
+ ld hl, Data4273 + 1
+ add hl, de
+ add hl, de
+ add hl, de
+ add hl, de
+ add hl, de
+ add hl, de
+ ld a, BANK(Data4273)
+ call GetFarByte
+ add a
+ add a
+ and $c
+ pop de
+ pop bc
+ ret
+; 1a61
+
+
+Function1a61: ; 1a61
+ ld l, a
+ ld a, [hROMBank]
+ push af
+ ld a, BANK(Data4273)
+ rst Bankswitch
+ ld a, l
+ push bc
+
+ call Function1a71
+
+ pop bc
+ pop af
+ rst Bankswitch
+
+ ret
+; 1a71
+
+Function1a71: ; 1a71
+ ld hl, $0003
+ add hl, de
+ ld [hl], a
+ push de
+ ld e, a
+ ld d, 0
+ ld hl, Data4273 + 1
+ add hl, de
+ add hl, de
+ add hl, de
+ add hl, de
+ add hl, de
+ add hl, de
+ ld b, h
+ ld c, l
+ pop de
+ ld a, [bc]
+ inc bc
+ rlca
+ rlca
+ and $c
+ ld hl, $0008
+ add hl, de
+ ld [hl], a
+ ld a, [bc]
+ inc bc
+ ld hl, $000b
+ add hl, de
+ ld [hl], a
+ ld a, [bc]
+ inc bc
+ ld hl, $0004
+ add hl, de
+ ld [hl], a
+ ld a, [bc]
+ inc bc
+ ld hl, $0005
+ add hl, de
+ ld [hl], a
+ ld a, [bc]
+ inc bc
+ ld hl, $0006
+ add hl, de
+ ld [hl], a
+ ret
+; 1aae
+
+Function1aae: ; 1aae
+ ld a, [hROMBank]
+ push af
+ ld a, [hli]
+ rst Bankswitch
+
+ ld a, [hli]
+ ld d, [hl]
+ ld hl, $001b
+ add hl, bc
+ add [hl]
+ ld e, a
+ ld a, d
+ adc $0
+ ld d, a
+ inc [hl]
+ ld a, [de]
+ ld h, a
+ pop af
+ rst Bankswitch
+
+ ld a, h
+ ret
+; 1ac6
+
+Function1ac6: ; 1ac6
+ ld hl, VramState
+ set 0, [hl]
+ ret
+; 1acc
+
+Function1acc: ; 1acc
+ ld hl, VramState
+ res 0, [hl]
+ ret
+; 1ad2
+
+
+Function1ad2: ; 1ad2
+ ld a, [VramState]
+ bit 0, a
+ ret z
+ callba Function55e0
+ callba Function5920
+ ret
+; 1ae5
+
+
+Function1ae5: ; 1ae5
+ ld bc, $0028
+ ld hl, $d4d6
+ call AddNTimes
+ ld b, h
+ ld c, l
+ ret
+; 1af1
+
+Function1af1: ; 1af1
+ ld hl, $0000
+ add hl, bc
+ ld a, [hl]
+ and a
+ ret
+; 1af8
+
+Function1af8: ; 1af8
+ push af
+ ld hl, $0008
+ add hl, bc
+ ld a, [hl]
+ and $f3
+ ld e, a
+ pop af
+ and $c
+ or e
+ ld [hl], a
+ ret
+; 1b07
+
+
+GetSpriteDirection: ; 1b07
+ ld hl, $0008
+ add hl, bc
+ ld a, [hl]
+ and $c
+ ret
+; 1b0f
+
--- /dev/null
+++ b/engine/menu.asm
@@ -1,0 +1,603 @@
+; Functions used in displaying and handling menus.
+
+
+LoadMenuDataHeader: ; 0x1d35
+ call Function1d3c
+ call Function1c00
+ ret
+
+Function1d3c: ; 0x1d3c
+ ld de, $cf81
+ ld bc, $0010
+ call CopyBytes
+ ld a, [hROMBank]
+ ld [$cf8a], a
+ ret
+; 0x1d4b
+
+Function1d4b: ; 1d4b
+ ld [$cf88], a
+ ret
+; 1d4f
+
+
+Function1d4f: ; 1d4f
+ push hl
+ call Function1d58
+ pop hl
+ jp PrintText
+; 1d57
+
+Function1d57: ; 1d57
+ ret
+; 1d58
+
+Function1d58: ; 1d58
+ ld hl, MenuDataHeader_0x1d5f
+ call LoadMenuDataHeader
+ ret
+; 1d5f
+
+MenuDataHeader_0x1d5f: ; 1d5f
+ db $40 ; tile backup
+ db 12, 0 ; start coords
+ db 17, 19 ; end coords
+ dw VTiles0
+ db 0 ; default option
+; 1d67
+
+Function1d67: ; 1d67
+ call Function1d4f
+ call Function1c17
+ ret
+; 1d6e
+
+Function1d6e: ; 1d6e
+ ld hl, MenuDataHeader_0x1d75
+ call LoadMenuDataHeader
+ ret
+; 1d75
+
+MenuDataHeader_0x1d75: ; 1d75
+ db $40 ; tile backup
+ db 0, 0 ; start coords
+ db 17, 19 ; end coords
+ dw $0000
+ db 1 ; default option
+; 1d7d
+
+Function1d7d: ; 1d7d
+ call Function1c07
+ ret
+; 1d81
+
+Function1d81: ; 0x1d81
+ xor a
+ ld [hBGMapMode], a
+ call Function1cbb
+ call Function1ad2
+ call Function1c89
+ call Function321c
+ call Function1c66
+ ld a, [$cf91]
+ bit 7, a
+ jr z, .asm_1da7 ; 0x1d98 $d
+ call Function1c10
+ call Function1bc9
+ call Function1ff8
+ bit 1, a
+ jr z, .asm_1da9 ; 0x1da5 $2
+.asm_1da7
+ scf
+ ret
+.asm_1da9
+ and a
+ ret
+; 0x1dab
+
+Function1dab: ; 1dab
+ call LoadMenuDataHeader
+ call Function1d81
+ call Function1c17
+ ld a, [$cfa9]
+ ret
+; 1db8
+
+Function1db8: ; 0x1db8
+ push hl
+ push bc
+ push af
+ ld hl, $cf86
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ inc hl
+ inc hl
+ pop af
+ call GetNthString
+ ld d, h
+ ld e, l
+ call CopyName1
+ pop bc
+ pop hl
+ ret
+; 0x1dcf
+
+
+Function1dcf: ; 1dcf
+ ld bc, $0e07
+
+Function1dd2: ; 1dd2
+ jr Function1dd9
+
+Function1dd4: ; 1dd4
+ call LoadMenuDataHeader
+ jr Function1dfe
+
+Function1dd9: ; 1dd9
+ push bc
+ ld hl, MenuDataHeader_0x1e1d
+ call Function1d3c
+ pop bc
+ ld a, b
+ cp $e
+ jr nz, .asm_1de9
+ ld a, $e
+ ld b, a
+
+.asm_1de9
+ ld a, b
+ ld [$cf83], a
+ add $5
+ ld [$cf85], a
+ ld a, c
+ ld [$cf82], a
+ add $4
+ ld [$cf84], a
+ call Function1c00
+
+Function1dfe: ; 1dfe
+ call Function1d81
+ push af
+ ld c, $f
+ call DelayFrames
+ call Function1c17
+ pop af
+ jr c, .asm_1e16
+ ld a, [$cfa9]
+ cp $2
+ jr z, .asm_1e16
+ and a
+ ret
+
+.asm_1e16
+ ld a, $2
+ ld [$cfa9], a
+ scf
+ ret
+; 1e1d
+
+MenuDataHeader_0x1e1d: ; 1e1d
+ db $40 ; tile backup
+ db 5, 10 ; start coords
+ db 9, 15 ; end coords
+ dw MenuData2_0x1e25
+ db 1 ; default option
+; 1e25
+
+MenuData2_0x1e25: ; 1e25
+ db $c0 ; flags
+ db 2
+ db "YES@"
+ db "NO@"
+; 1e2e
+
+Function1e2e: ; 1e2e
+ call Function1e35
+ call Function1c00
+ ret
+; 1e35
+
+Function1e35: ; 1e35
+ push de
+ call Function1d3c
+ pop de
+ ld a, [$cf83]
+ ld h, a
+ ld a, [$cf85]
+ sub h
+ ld h, a
+ ld a, d
+ ld [$cf83], a
+ add h
+ ld [$cf85], a
+ ld a, [$cf82]
+ ld l, a
+ ld a, [$cf84]
+ sub l
+ ld l, a
+ ld a, e
+ ld [$cf82], a
+ add l
+ ld [$cf84], a
+ ret
+; 1e5d
+
+Function1e5d: ; 1e5d
+ call MenuFunc_1e7f
+ call MenuWriteText
+ call Function1eff
+ call Function1f23
+ call Function1bdd
+ call Function1ff8
+ ret
+; 1e70
+
+SetUpMenu: ; 1e70
+ call MenuFunc_1e7f ; ???
+ call MenuWriteText
+ call Function1eff ; set up selection pointer
+ ld hl, $cfa5
+ set 7, [hl]
+ ret
+
+MenuFunc_1e7f: ; 0x1e7f
+ call Function1c66
+ call Function1ebd
+ call Function1ea6
+ call Function1cbb
+ ret
+
+MenuWriteText: ; 0x1e8c
+ xor a
+ ld [hBGMapMode], a
+ call Function1ebd ; sort out the text
+ call Function1eda ; actually write it
+ call Function2e31
+ ld a, [hOAMUpdate]
+ push af
+ ld a, $1
+ ld [hOAMUpdate], a
+ call Function321c
+ pop af
+ ld [hOAMUpdate], a
+ ret
+; 0x1ea6
+
+Function1ea6: ; 1ea6
+ ld a, [$cf83]
+ ld c, a
+ ld a, [$cf85]
+ sub c
+ ld c, a
+ ld a, [$cf92]
+ add a
+ inc a
+ ld b, a
+ ld a, [$cf82]
+ add b
+ ld [$cf84], a
+ ret
+; 1ebd
+
+Function1ebd: ; 1ebd
+ ld hl, $cf93
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, [$cf76]
+ and a
+ jr z, .asm_1ed3
+ ld b, a
+ ld c, $ff
+.asm_1ecc
+ ld a, [hli]
+ cp c
+ jr nz, .asm_1ecc
+ dec b
+ jr nz, .asm_1ecc
+
+.asm_1ed3
+ ld d, h
+ ld e, l
+ ld a, [hl]
+ ld [$cf92], a
+ ret
+; 1eda
+
+Function1eda: ; 1eda
+ call Function1cfd
+ ld bc, $002a
+ add hl, bc
+.asm_1ee1
+ inc de
+ ld a, [de]
+ cp $ff
+ ret z
+ ld [MenuSelection], a
+ push de
+ push hl
+ ld d, h
+ ld e, l
+ ld hl, $cf95
+ call Function1efb
+ pop hl
+ ld de, $0028
+ add hl, de
+ pop de
+ jr .asm_1ee1
+; 1efb
+
+Function1efb: ; 1efb
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 1eff
+
+Function1eff: ; 1eff
+ call Function1c10
+ ld hl, $cfa8
+ ld a, [$cf91]
+ bit 3, a
+ jr z, .asm_1f0e
+ set 3, [hl]
+
+.asm_1f0e
+ ld a, [$cf91]
+ bit 2, a
+ jr z, .asm_1f19
+ set 5, [hl]
+ set 4, [hl]
+
+.asm_1f19
+ ret
+; 1f1a
+
+
+Function1f1a: ; 1f1a
+ call Function1bd3
+ ld hl, $cfa8
+ and [hl]
+ jr Function1f2a
+; 1f23
+
+Function1f23: ; 1f23
+ xor a
+ ld [$cf73], a
+ call Function1bc9
+; 1f2a
+
+Function1f2a: ; 1f2a
+ bit 0, a
+ jr nz, .asm_1f52
+ bit 1, a
+ jr nz, .asm_1f6d
+ bit 3, a
+ jr nz, .asm_1f6d
+ bit 4, a
+ jr nz, .asm_1f44
+ bit 5, a
+ jr nz, .asm_1f4b
+ xor a
+ ld [$cf73], a
+ jr .asm_1f57
+
+.asm_1f44
+ ld a, $10
+ ld [$cf73], a
+ jr .asm_1f57
+
+.asm_1f4b
+ ld a, $20
+ ld [$cf73], a
+ jr .asm_1f57
+
+.asm_1f52
+ ld a, $1
+ ld [$cf73], a
+
+.asm_1f57
+ call Function1ebd
+ ld a, [$cfa9]
+ ld l, a
+ ld h, $0
+ add hl, de
+ ld a, [hl]
+ ld [MenuSelection], a
+ ld a, [$cfa9]
+ ld [$cf88], a
+ and a
+ ret
+
+.asm_1f6d
+ ld a, $2
+ ld [$cf73], a
+ ld a, $ff
+ ld [MenuSelection], a
+ scf
+ ret
+; 1f79
+
+Function1f79: ; 1f79
+ push de
+ ld hl, $cf97
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, [MenuSelection]
+ call GetNthString
+ ld d, h
+ ld e, l
+ pop hl
+ call PlaceString
+ ret
+; 1f8d
+
+Function1f8d: ; 1f8d
+ push de
+ ld a, [MenuSelection]
+ call Function1fb1
+ inc hl
+ inc hl
+ ld a, [hli]
+ ld d, [hl]
+ ld e, a
+ pop hl
+ call PlaceString
+ ret
+; 1f9e
+
+Function1f9e: ; 1f9e
+ call Function1fb1
+ inc hl
+ inc hl
+ ld a, [hli]
+ ld d, [hl]
+ ld e, a
+ ret
+; 1fa7
+
+Function1fa7: ; 1fa7
+ ld a, [MenuSelection]
+ call Function1fb1
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 1fb1
+
+Function1fb1: ; 1fb1
+ ld e, a
+ ld d, $0
+ ld hl, $cf97
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ add hl, de
+ add hl, de
+ add hl, de
+ add hl, de
+ ret
+; 1fbf
+
+Function1fbf: ; 1fbf
+ ld hl, $cf71
+ call Function1ff0
+ ld hl, $cf81
+ call Function1ff0
+ ld hl, $cf91
+ call Function1ff0
+ ld hl, $cfa1
+ call Function1ff0
+ ld a, [rSVBK]
+ push af
+ ld a, $7
+ ld [rSVBK], a
+ xor a
+ ld hl, $dfff
+ ld [hld], a
+ ld [hld], a
+ ld a, l
+ ld [$cf71], a
+ ld a, h
+ ld [$cf72], a
+ pop af
+ ld [rSVBK], a
+ ret
+; 1ff0
+
+Function1ff0: ; 1ff0
+ ld bc, $0010
+ xor a
+ call ByteFill
+ ret
+; 1ff8
+
+Function1ff8: ; 1ff8
+ push af
+ and $3
+ jr z, .asm_2007
+ ld hl, $cf81
+ bit 3, [hl]
+ jr nz, .asm_2007
+ call PlayClickSFX
+
+.asm_2007
+ pop af
+ ret
+; 2009
+
+
+PlayClickSFX: ; 2009
+ push de
+ ld de, SFX_READ_TEXT_2
+ call StartSFX
+ pop de
+ ret
+; 0x2012
+
+Function2012: ; 2012
+ call Function1d4f
+ call Functiona46
+ call Function1c07
+ ret
+; 201c
+
+Function201c: ; 201c
+ ld [hBuffer], a
+ ld a, [hROMBank]
+ push af
+ ld a, [hBuffer]
+ rst Bankswitch
+
+ call PlaceString
+ pop af
+ rst Bankswitch
+
+ ret
+; 202a
+
+Function202a: ; 202a
+ ld a, [hROMBank]
+ ld [$cf94], a
+ ld a, $9
+ ld hl, $400e
+ rst FarCall
+ ld a, [$cf88]
+ ret
+; 2039
+
+Function2039: ; 2039
+ ld a, [hROMBank]
+ ld [$cf94], a
+ ld a, $9
+ ld hl, $4022
+ rst FarCall
+ ld a, [$cf88]
+ ret
+; 2048
+
+Function2048: ; 2048
+ ld a, [hROMBank]
+ ld [$cf94], a
+ ld a, $9
+ ld hl, $403c
+ rst FarCall
+ ld a, [$cf88]
+ ret
+; 2057
+
+Function2057: ; 2057
+ ld a, [hROMBank]
+ push af
+ ld a, $21
+ rst Bankswitch
+
+ call $42db
+ pop af
+ rst Bankswitch
+
+ ret
+; 2063
+
--- /dev/null
+++ b/engine/rtc.asm
@@ -1,0 +1,25 @@
+RTC: ; 46f
+; update time and time-sensitive palettes
+
+; rtc enabled?
+ ld a, [$c2ce]
+ cp 0
+ ret z
+
+ call UpdateTime
+
+; obj update on?
+ ld a, [VramState]
+ bit 0, a ; obj update
+ ret z
+
+TimeOfDayPals: ; 47e
+ callab _TimeOfDayPals
+ ret
+; 485
+
+UpdateTimePals: ; 485
+ callab _UpdateTimePals
+ ret
+; 48c
+
--- /dev/null
+++ b/engine/sine.asm
@@ -1,0 +1,22 @@
+Cosine: ; 1b0f
+; Return d * cos(a) in hl
+ add $10 ; 90 degrees
+
+Sine: ; 1b11
+; Return d * sin(a) in hl
+; a is a signed 6-bit value.
+
+ ld e, a
+
+ ld a, [hROMBank]
+ push af
+ ld a, BANK(_Sine)
+ rst Bankswitch
+
+ call _Sine
+
+ pop af
+ rst Bankswitch
+ ret
+; 1b1e
+
--- a/engine/text.asm
+++ b/engine/text.asm
@@ -155,6 +155,7 @@
PrintText: ; 1057
call Function106c
+Function105a: ; 105a
push hl
hlcoord 1, 14
ld bc, 18 + 3<<8
--- a/engine/vblank.asm
+++ b/engine/vblank.asm
@@ -119,9 +119,9 @@
call UpdateBGMap
; these have their own timing checks
- call SafeLoadTiles
- call SafeLoadTiles2
- call SafeTileAnimation
+ call Serve2bppRequest
+ call Serve1bppRequest
+ call AnimateTileset
.doneframeaction
; oam update off?
@@ -131,8 +131,8 @@
; update oam by dma transfer
call hPushOAM
-; 403f:
-; ld a, $c4
+; @PushOAM:
+; ld a, Sprites >> 8
; ld [rDMA], a
; ld a, $28
; .loop
@@ -230,11 +230,11 @@
; these have their own timing checks
call UpdateBGMap
- call LoadTiles
+ call Serve2bppRequest@VBlank
; update oam by dma transfer
call hPushOAM
-; 403f:
-; ld a, $c4
+; @PushOAM:
+; ld a, Sprites >> 8
; ld [rDMA], a
; ld a, $28
; .loop
@@ -338,12 +338,12 @@
jr c, .vblankoccurred
; else
call UpdateBGMap
- call LoadTiles
+ call Serve2bppRequest@VBlank
; update oam by dma transfer
call hPushOAM
-; 403f:
-; ld a, $c4 ; Sprites / $100
+; @PushOAM:
+; ld a, Sprites >> 8
; ld [rDMA], a
; ld a, $28
; .loop
@@ -410,12 +410,12 @@
ld [$ff8a], a
call UpdateBGMap
- call SafeLoadTiles
+ call Serve2bppRequest
; update oam by dma transfer
call hPushOAM
-; 403f:
-; ld a, $c4
+; @PushOAM:
+; ld a, Sprites >> 8
; ld [rDMA], a
; ld a, $28
; .loop
@@ -465,7 +465,7 @@
jr c, .vblankoccurred
call UpdateBGMap
- call SafeLoadTiles
+ call Serve2bppRequest
.vblankoccurred
; tell other fns vblank happened
@@ -521,8 +521,8 @@
call UpdateCGBPals
jr c, .vblankoccurred
- call SafeLoadTiles
- call SafeLoadTiles2
+ call Serve2bppRequest
+ call Serve1bppRequest
call DMATransfer
.vblankoccurred
--- /dev/null
+++ b/engine/video.asm
@@ -1,0 +1,487 @@
+; Functions dealing with VRAM.
+
+DMATransfer: ; 15d8
+; Return carry if the transfer is completed.
+
+ ld a, [hDMATransfer]
+ and a
+ ret z
+
+; Start transfer
+ ld [rHDMA5], a
+
+; Execution is halted until the transfer is complete.
+
+ xor a
+ ld [hDMATransfer], a
+ scf
+ ret
+; 15e3
+
+
+UpdateBGMapBuffer: ; 15e3
+; Copy [$ffdc] 16x8 tiles from BGMapBuffer
+; to bg map addresses in BGMapBufferPtrs.
+
+; [$ffdc] must be even since this is done in pairs.
+
+; Return carry on success.
+
+ ld a, [hBGMapUpdate]
+ and a
+ ret z
+
+ ld a, [rVBK]
+ push af
+ ld [hSPBuffer], sp
+
+ ld hl, BGMapBufferPtrs
+ ld sp, hl
+
+; We can now pop the addresses of affected spots on the BG Map
+
+ ld hl, BGMapPalBuffer
+ ld de, BGMapBuffer
+
+
+.next
+; Copy a pair of 16x8 blocks (one 16x16 block)
+
+rept 2
+; Get our BG Map address
+ pop bc
+
+; Palettes
+ ld a, 1
+ ld [rVBK], a
+
+ ld a, [hli]
+ ld [bc], a
+ inc c
+ ld a, [hli]
+ ld [bc], a
+ dec c
+
+; Tiles
+ ld a, 0
+ ld [rVBK], a
+
+ ld a, [de]
+ inc de
+ ld [bc], a
+ inc c
+ ld a, [de]
+ inc de
+ ld [bc], a
+endr
+
+; We've done 2 16x8 blocks
+ ld a, [$ffdc]
+ dec a
+ dec a
+ ld [$ffdc], a
+
+ jr nz, .next
+
+
+ ld a, [hSPBuffer]
+ ld l, a
+ ld a, [hSPBuffer + 1]
+ ld h, a
+ ld sp, hl
+
+ pop af
+ ld [rVBK], a
+
+ xor a
+ ld [hBGMapUpdate], a
+ scf
+ ret
+; 163a
+
+
+WaitTop: ; 163a
+; Wait until the top third of the BG Map is being updated.
+
+ ld a, [hBGMapMode]
+ and a
+ ret z
+
+ ld a, [hBGMapThird]
+ and a
+ jr z, .done
+
+ call DelayFrame
+ jr WaitTop
+
+.done
+ xor a
+ ld [hBGMapMode], a
+ ret
+; 164c
+
+
+UpdateBGMap: ; 164c
+; Update the BG Map, in thirds, from TileMap and AttrMap.
+
+ ld a, [hBGMapMode]
+ and a
+ ret z
+
+; BG Map 0
+ dec a ; 1
+ jr z, .Tiles
+ dec a ; 2
+ jr z, .Attr
+
+; BG Map 1
+ dec a
+
+ ld a, [hBGMapAddress]
+ ld l, a
+ ld a, [hBGMapAddress + 1]
+ ld h, a
+ push hl
+
+ xor a
+ ld [hBGMapAddress], a
+ ld a, VBGMap1 >> 8
+ ld [hBGMapAddress + 1], a
+
+ ld a, [hBGMapMode]
+ push af
+ cp 3
+ call z, .Tiles
+ pop af
+ cp 4
+ call z, .Attr
+
+ pop hl
+ ld a, l
+ ld [hBGMapAddress], a
+ ld a, h
+ ld [hBGMapAddress + 1], a
+ ret
+
+
+.Attr
+ ld a, 1
+ ld [rVBK], a
+
+ ld hl, AttrMap
+ call .update
+
+ ld a, 0
+ ld [rVBK], a
+ ret
+
+
+.Tiles
+ ld hl, TileMap
+
+
+.update
+ ld [hSPBuffer], sp
+
+; Which third?
+ ld a, [hBGMapThird]
+ and a ; 0
+ jr z, .top
+ dec a ; 1
+ jr z, .middle
+ ; 2
+
+
+THIRD_HEIGHT EQU SCREEN_HEIGHT / 3
+
+
+.bottom
+ ld de, 2 * THIRD_HEIGHT * SCREEN_WIDTH
+ add hl, de
+ ld sp, hl
+
+ ld a, [hBGMapAddress + 1]
+ ld h, a
+ ld a, [hBGMapAddress]
+ ld l, a
+
+ ld de, 2 * THIRD_HEIGHT * BG_MAP_WIDTH
+ add hl, de
+
+; Next time: top third
+ xor a
+ jr .start
+
+
+.middle
+ ld de, THIRD_HEIGHT * SCREEN_WIDTH
+ add hl, de
+ ld sp, hl
+
+ ld a, [hBGMapAddress + 1]
+ ld h, a
+ ld a, [hBGMapAddress]
+ ld l, a
+
+ ld de, THIRD_HEIGHT * BG_MAP_WIDTH
+ add hl, de
+
+; Next time: bottom third
+ ld a, 2
+ jr .start
+
+
+.top
+ ld sp, hl
+
+ ld a, [hBGMapAddress + 1]
+ ld h, a
+ ld a, [hBGMapAddress]
+ ld l, a
+
+; Next time: middle third
+ ld a, 1
+
+
+.start
+; Which third to update next time
+ ld [hBGMapThird], a
+
+; Rows of tiles in a third
+ ld a, SCREEN_HEIGHT / 3
+
+; Discrepancy between TileMap and BGMap
+ ld bc, BG_MAP_WIDTH - (SCREEN_WIDTH - 1)
+
+
+.row
+; Copy a row of 20 tiles
+rept SCREEN_WIDTH / 2 - 1
+ pop de
+ ld [hl], e
+ inc l
+ ld [hl], d
+ inc l
+endr
+ pop de
+ ld [hl], e
+ inc l
+ ld [hl], d
+
+ add hl, bc
+ dec a
+ jr nz, .row
+
+
+ ld a, [hSPBuffer]
+ ld l, a
+ ld a, [hSPBuffer + 1]
+ ld h, a
+ ld sp, hl
+ ret
+; 170a
+
+
+Serve1bppRequest: ; 170a
+; Only call during the first fifth of VBlank
+
+ ld a, [Requested1bpp]
+ and a
+ ret z
+
+; Back out if we're too far into VBlank
+ ld a, [rLY]
+ cp 144
+ ret c
+ cp 146
+ ret nc
+
+; Copy [Requested1bpp] 1bpp tiles from [Requested1bppSource] to [Requested1bppDest]
+
+ ld [hSPBuffer], sp
+
+; Source
+ ld hl, Requested1bppSource
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld sp, hl
+
+; Destination
+ ld hl, Requested1bppDest
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+
+; # tiles to copy
+ ld a, [Requested1bpp]
+ ld b, a
+
+ xor a
+ ld [Requested1bpp], a
+
+.next
+
+rept 3
+ pop de
+ ld [hl], e
+ inc l
+ ld [hl], e
+ inc l
+ ld [hl], d
+ inc l
+ ld [hl], d
+ inc l
+endr
+ pop de
+ ld [hl], e
+ inc l
+ ld [hl], e
+ inc l
+ ld [hl], d
+ inc l
+ ld [hl], d
+
+ inc hl
+ dec b
+ jr nz, .next
+
+
+ ld a, l
+ ld [Requested1bppDest], a
+ ld a, h
+ ld [Requested1bppDest + 1], a
+
+ ld [Requested1bppSource], sp
+
+ ld a, [hSPBuffer]
+ ld l, a
+ ld a, [hSPBuffer + 1]
+ ld h, a
+ ld sp, hl
+ ret
+; 1769
+
+
+Serve2bppRequest: ; 1769
+; Only call during the first fifth of VBlank
+
+ ld a, [Requested2bpp]
+ and a
+ ret z
+
+; Back out if we're too far into VBlank
+ ld a, [rLY]
+ cp 144
+ ret c
+ cp 146
+ ret nc
+ jr _Serve2bppRequest
+
+
+Serve2bppRequest@VBlank: ; 1778
+
+ ld a, [Requested2bpp]
+ and a
+ ret z
+
+_Serve2bppRequest: ; 177d
+; Copy [Requested2bpp] 2bpp tiles from [Requested2bppSource] to [Requested2bppDest]
+
+ ld [hSPBuffer], sp
+
+; Source
+ ld hl, Requested2bppSource
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld sp, hl
+
+; Destination
+ ld hl, Requested2bppDest
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+
+; # tiles to copy
+ ld a, [Requested2bpp]
+ ld b, a
+
+ xor a
+ ld [Requested2bpp], a
+
+.next
+
+rept 7
+ pop de
+ ld [hl], e
+ inc l
+ ld [hl], d
+ inc l
+endr
+ pop de
+ ld [hl], e
+ inc l
+ ld [hl], d
+
+ inc hl
+ dec b
+ jr nz, .next
+
+
+ ld a, l
+ ld [Requested2bppDest], a
+ ld a, h
+ ld [Requested2bppDest + 1], a
+
+ ld [Requested2bppSource], sp
+
+ ld a, [hSPBuffer]
+ ld l, a
+ ld a, [hSPBuffer + 1]
+ ld h, a
+ ld sp, hl
+ ret
+; 17d3
+
+
+AnimateTileset: ; 17d3
+; Only call during the first fifth of VBlank
+
+ ld a, [$ffde]
+ and a
+ ret z
+
+; Back out if we're too far into VBlank
+ ld a, [rLY]
+ cp 144
+ ret c
+ cp 151
+ ret nc
+
+ ld a, [hROMBank]
+ push af
+ ld a, BANK(_AnimateTileset)
+ rst Bankswitch
+
+ ld a, [rSVBK]
+ push af
+ ld a, 1
+ ld [rSVBK], a
+
+ ld a, [rVBK]
+ push af
+ ld a, 0
+ ld [rVBK], a
+
+ call _AnimateTileset
+
+ pop af
+ ld [rVBK], a
+ pop af
+ ld [rSVBK], a
+ pop af
+ rst Bankswitch
+ ret
+; 17ff
+
binary files a/gfx/tilesets/00.lz b/gfx/tilesets/00.lz differ
binary files a/gfx/tilesets/01.lz b/gfx/tilesets/01.lz differ
binary files a/gfx/tilesets/02.lz b/gfx/tilesets/02.lz differ
binary files a/gfx/tilesets/03.lz b/gfx/tilesets/03.lz differ
binary files a/gfx/tilesets/04.lz b/gfx/tilesets/04.lz differ
binary files a/gfx/tilesets/05.lz b/gfx/tilesets/05.lz differ
binary files a/gfx/tilesets/06.lz b/gfx/tilesets/06.lz differ
binary files a/gfx/tilesets/07.lz b/gfx/tilesets/07.lz differ
binary files a/gfx/tilesets/08.lz b/gfx/tilesets/08.lz differ
binary files a/gfx/tilesets/09.lz b/gfx/tilesets/09.lz differ
binary files a/gfx/tilesets/10.lz b/gfx/tilesets/10.lz differ
binary files a/gfx/tilesets/11.lz b/gfx/tilesets/11.lz differ
binary files a/gfx/tilesets/12.lz b/gfx/tilesets/12.lz differ
binary files a/gfx/tilesets/14.lz b/gfx/tilesets/14.lz differ
binary files a/gfx/tilesets/15.lz b/gfx/tilesets/15.lz differ
binary files a/gfx/tilesets/16.lz b/gfx/tilesets/16.lz differ
binary files a/gfx/tilesets/18.lz b/gfx/tilesets/18.lz differ
binary files a/gfx/tilesets/19.lz b/gfx/tilesets/19.lz differ
binary files a/gfx/tilesets/20.lz b/gfx/tilesets/20.lz differ
binary files a/gfx/tilesets/21.lz b/gfx/tilesets/21.lz differ
binary files a/gfx/tilesets/22.lz b/gfx/tilesets/22.lz differ
binary files a/gfx/tilesets/23.lz b/gfx/tilesets/23.lz differ
binary files a/gfx/tilesets/24.lz b/gfx/tilesets/24.lz differ
binary files a/gfx/tilesets/25.lz b/gfx/tilesets/25.lz differ
binary files a/gfx/tilesets/26.lz b/gfx/tilesets/26.lz differ
binary files a/gfx/tilesets/27.lz b/gfx/tilesets/27.lz differ
binary files a/gfx/tilesets/28.lz b/gfx/tilesets/28.lz differ
binary files a/gfx/tilesets/29.lz b/gfx/tilesets/29.lz differ
binary files a/gfx/tilesets/30.lz b/gfx/tilesets/30.lz differ
binary files a/gfx/tilesets/31.lz b/gfx/tilesets/31.lz differ
binary files a/gfx/tilesets/32.lz b/gfx/tilesets/32.lz differ
binary files a/gfx/tilesets/33.lz b/gfx/tilesets/33.lz differ
binary files a/gfx/tilesets/34.lz b/gfx/tilesets/34.lz differ
binary files a/gfx/tilesets/35.lz b/gfx/tilesets/35.lz differ
binary files a/gfx/tilesets/36.lz b/gfx/tilesets/36.lz differ
--- /dev/null
+++ b/interrupts.asm
@@ -1,0 +1,17 @@
+; Game Boy hardware interrupts
+
+SECTION "vblank",ROM0[$40]
+ jp VBlank
+
+SECTION "lcd",ROM0[$48]
+ jp LCD
+
+SECTION "timer",ROM0[$50]
+ jp Timer
+
+SECTION "serial",ROM0[$58]
+ jp Serial
+
+SECTION "joypad",ROM0[$60]
+ jp JoypadInt
+
--- /dev/null
+++ b/items/marts.asm
@@ -1,0 +1,443 @@
+Marts: ; 160a9
+ dw Mart0
+ dw Mart1
+ dw Mart2
+ dw Mart3
+ dw Mart4
+ dw Mart5
+ dw Mart6
+ dw Mart7
+ dw Mart8
+ dw Mart9
+ dw Mart10
+ dw Mart11
+ dw Mart12
+ dw Mart13
+ dw Mart14
+ dw Mart15
+ dw Mart16
+ dw Mart17
+ dw Mart18
+ dw Mart19
+ dw Mart20
+ dw Mart21
+ dw Mart22
+ dw Mart23
+ dw Mart24
+ dw Mart25
+ dw Mart26
+ dw Mart27
+ dw Mart28
+ dw Mart29
+ dw Mart30
+ dw Mart31
+ dw Mart32
+ dw Mart33
+MartsEnd
+; 160ed
+
+
+Mart0: ; 160ed
+ db 4 ; # items
+ db POTION
+ db ANTIDOTE
+ db PARLYZ_HEAL
+ db AWAKENING
+ db $ff
+; 160f3
+
+Mart1: ; 160f3
+ db 5 ; # items
+ db POKE_BALL
+ db POTION
+ db ANTIDOTE
+ db PARLYZ_HEAL
+ db AWAKENING
+ db $ff
+; 160fa
+
+Mart2: ; 160fa
+ db 10 ; # items
+ db POKE_BALL
+ db POTION
+ db ESCAPE_ROPE
+ db ANTIDOTE
+ db PARLYZ_HEAL
+ db AWAKENING
+ db X_DEFEND
+ db X_ATTACK
+ db X_SPEED
+ db FLOWER_MAIL
+ db $ff
+; 16106
+
+Mart3: ; 16106
+ db 9 ; # items
+ db CHARCOAL
+ db POKE_BALL
+ db POTION
+ db SUPER_POTION
+ db ESCAPE_ROPE
+ db REPEL
+ db ANTIDOTE
+ db PARLYZ_HEAL
+ db FLOWER_MAIL
+ db $ff
+; 16111
+
+Mart4: ; 16111
+ db 5 ; # items
+ db POTION
+ db SUPER_POTION
+ db HYPER_POTION
+ db FULL_HEAL
+ db REVIVE
+ db $ff
+; 16118
+
+Mart5: ; 16118
+ db 7 ; # items
+ db POTION
+ db SUPER_POTION
+ db ANTIDOTE
+ db PARLYZ_HEAL
+ db AWAKENING
+ db BURN_HEAL
+ db ICE_HEAL
+ db $ff
+; 16121
+
+Mart6: ; 16121
+ db 8 ; # items
+ db POKE_BALL
+ db GREAT_BALL
+ db ESCAPE_ROPE
+ db REPEL
+ db REVIVE
+ db FULL_HEAL
+ db POKE_DOLL
+ db FLOWER_MAIL
+ db $ff
+; 1612b
+
+Mart7: ; 1612b
+ db 7 ; # items
+ db X_SPEED
+ db X_SPECIAL
+ db X_DEFEND
+ db X_ATTACK
+ db DIRE_HIT
+ db GUARD_SPEC
+ db X_ACCURACY
+ db $ff
+; 16134
+
+Mart8: ; 16134
+ db 5 ; # items
+ db PROTEIN
+ db IRON
+ db CARBOS
+ db CALCIUM
+ db HP_UP
+ db $ff
+; 1613b
+
+Mart9: ; 1613b
+ db 3 ; # items
+ db TM_41
+ db TM_48
+ db TM_33
+ db $ff
+; 16140
+
+Mart10: ; 16140
+ db 4 ; # items
+ db TM_41
+ db TM_48
+ db TM_33
+ db TM_02
+ db $ff
+; 16146
+
+Mart11: ; 16146
+ db 4 ; # items
+ db TM_41
+ db TM_48
+ db TM_33
+ db TM_08
+ db $ff
+; 1614c
+
+Mart12: ; 1614c
+ db 5 ; # items
+ db TM_41
+ db TM_48
+ db TM_33
+ db TM_02
+ db TM_08
+ db $ff
+; 16153
+
+Mart13: ; 16153
+ db 9 ; # items
+ db GREAT_BALL
+ db SUPER_POTION
+ db HYPER_POTION
+ db ANTIDOTE
+ db PARLYZ_HEAL
+ db AWAKENING
+ db ICE_HEAL
+ db SUPER_REPEL
+ db SURF_MAIL
+ db $ff
+; 1615e
+
+Mart14: ; 1615e
+ db 10 ; # items
+ db POKE_BALL
+ db GREAT_BALL
+ db POTION
+ db SUPER_POTION
+ db ANTIDOTE
+ db PARLYZ_HEAL
+ db AWAKENING
+ db BURN_HEAL
+ db ICE_HEAL
+ db REVIVE
+ db $ff
+; 1616a
+
+Mart15: ; 1616a
+ db 4 ; # items
+ db TINYMUSHROOM
+ db SLOWPOKETAIL
+ db POKE_BALL
+ db POTION
+ db $ff
+; 16170
+
+Mart16: ; 16170
+ db 9 ; # items
+ db RAGECANDYBAR
+ db GREAT_BALL
+ db SUPER_POTION
+ db HYPER_POTION
+ db ANTIDOTE
+ db PARLYZ_HEAL
+ db SUPER_REPEL
+ db REVIVE
+ db FLOWER_MAIL
+ db $ff
+; 1617b
+
+Mart17: ; 1617b
+ db 9 ; # items
+ db GREAT_BALL
+ db ULTRA_BALL
+ db HYPER_POTION
+ db MAX_POTION
+ db FULL_HEAL
+ db REVIVE
+ db MAX_REPEL
+ db X_DEFEND
+ db X_ATTACK
+ db $ff
+; 16186
+
+Mart18: ; 16186
+ db 9 ; # items
+ db ULTRA_BALL
+ db HYPER_POTION
+ db FULL_HEAL
+ db REVIVE
+ db ANTIDOTE
+ db PARLYZ_HEAL
+ db AWAKENING
+ db BURN_HEAL
+ db FLOWER_MAIL
+ db $ff
+; 16191
+
+Mart19: ; 16191
+ db 7 ; # items
+ db GREAT_BALL
+ db SUPER_POTION
+ db SUPER_REPEL
+ db ANTIDOTE
+ db PARLYZ_HEAL
+ db AWAKENING
+ db BURN_HEAL
+ db $ff
+; 1619a
+
+Mart20: ; 1619a
+ db 9 ; # items
+ db GREAT_BALL
+ db ULTRA_BALL
+ db SUPER_POTION
+ db SUPER_REPEL
+ db FULL_HEAL
+ db X_DEFEND
+ db X_ATTACK
+ db DIRE_HIT
+ db SURF_MAIL
+ db $ff
+; 161a5
+
+Mart21: ; 161a5
+ db 8 ; # items
+ db GREAT_BALL
+ db POTION
+ db SUPER_POTION
+ db MAX_REPEL
+ db ANTIDOTE
+ db PARLYZ_HEAL
+ db AWAKENING
+ db BURN_HEAL
+ db $ff
+; 161af
+
+Mart22: ; 161af
+ db 8 ; # items
+ db ULTRA_BALL
+ db SUPER_POTION
+ db HYPER_POTION
+ db REVIVE
+ db PARLYZ_HEAL
+ db AWAKENING
+ db BURN_HEAL
+ db LITEBLUEMAIL
+ db $ff
+; 161b9
+
+Mart23: ; 161b9
+ db 7 ; # items
+ db POTION
+ db SUPER_POTION
+ db HYPER_POTION
+ db MAX_POTION
+ db REVIVE
+ db SUPER_REPEL
+ db MAX_REPEL
+ db $ff
+; 161c2
+
+Mart24: ; 161c2
+ db 10 ; # items
+ db POKE_BALL
+ db GREAT_BALL
+ db ULTRA_BALL
+ db ESCAPE_ROPE
+ db FULL_HEAL
+ db ANTIDOTE
+ db BURN_HEAL
+ db ICE_HEAL
+ db AWAKENING
+ db PARLYZ_HEAL
+ db $ff
+; 161ce
+
+Mart25: ; 161ce
+ db 5 ; # items
+ db TM_10
+ db TM_11
+ db TM_17
+ db TM_18
+ db TM_37
+ db $ff
+; 161d5
+
+Mart26: ; 161d5
+ db 3 ; # items
+ db POKE_DOLL
+ db LOVELY_MAIL
+ db SURF_MAIL
+ db $ff
+; 161da
+
+Mart27: ; 161da
+ db 5 ; # items
+ db HP_UP
+ db PROTEIN
+ db IRON
+ db CARBOS
+ db CALCIUM
+ db $ff
+; 161e1
+
+Mart28: ; 161e1
+ db 7 ; # items
+ db X_ACCURACY
+ db GUARD_SPEC
+ db DIRE_HIT
+ db X_ATTACK
+ db X_DEFEND
+ db X_SPEED
+ db X_SPECIAL
+ db $ff
+; 161ea
+
+Mart29: ; 161ea
+ db 7 ; # items
+ db GREAT_BALL
+ db ULTRA_BALL
+ db SUPER_POTION
+ db HYPER_POTION
+ db FULL_HEAL
+ db MAX_REPEL
+ db FLOWER_MAIL
+ db $ff
+; 161f3
+
+Mart30: ; 161f3
+ db 8 ; # items
+ db GREAT_BALL
+ db ULTRA_BALL
+ db HYPER_POTION
+ db MAX_POTION
+ db FULL_HEAL
+ db X_ATTACK
+ db X_DEFEND
+ db FLOWER_MAIL
+ db $ff
+; 161fd
+
+Mart31: ; 161fd
+ db 6 ; # items
+ db POKE_DOLL
+ db FRESH_WATER
+ db SODA_POP
+ db LEMONADE
+ db REPEL
+ db PORTRAITMAIL
+ db $ff
+; 16205
+
+Mart32: ; 16205
+ db 7 ; # items
+ db ULTRA_BALL
+ db MAX_REPEL
+ db HYPER_POTION
+ db MAX_POTION
+ db FULL_RESTORE
+ db REVIVE
+ db FULL_HEAL
+ db $ff
+; 1620e
+
+Mart33: ; 1620e
+ db 4 ; # items
+ db ENERGYPOWDER
+ db ENERGY_ROOT
+ db HEAL_POWDER
+ db REVIVAL_HERB
+ db $ff
+; 16214
+
+DefaultMart: ; 16214
+ db 2 ; # items
+ db POKE_BALL
+ db POTION
+ db $ff
+; 16218
+
--- /dev/null
+++ b/macros.asm
@@ -1,0 +1,95 @@
+; rgbds macros
+
+dwb: MACRO
+ dw \1
+ db \2
+ ENDM
+
+dbw: MACRO
+ db \1
+ dw \2
+ ENDM
+
+dn: MACRO
+ db \1 << 4 + \2
+ ENDM
+
+dt: MACRO ; three-byte (big-endian)
+ db (\1 >> 16) & $ff
+ db (\1 >> 8) & $ff
+ db \1 & $ff
+ ENDM
+
+bigdw: MACRO ; big-endian word
+ dw ((\1)/$100) + (((\1)&$ff)*$100)
+ ENDM
+
+callab: MACRO ; address, bank
+ ld hl, \1
+ ld a, BANK(\1)
+ rst FarCall
+ ENDM
+
+callba: MACRO ; bank, address
+ ld a, BANK(\1)
+ ld hl, \1
+ rst FarCall
+ ENDM
+
+TX_RAM: MACRO
+ db 1
+ dw \1
+ ENDM
+
+TX_FAR: MACRO
+ db $16
+ dw \1
+ db BANK(\1)
+ ENDM
+
+RGB: MACRO
+ dw ((\3 << 10) | (\2 << 5) | (\1))
+ ENDM
+
+note: MACRO
+ db \1
+ ENDM
+
+; It's better to use *coord than FuncCoord.
+FuncCoord: MACRO
+Coord = $c4a0 + 20 * \2 + \1
+ ENDM
+
+bccoord: MACRO
+ FuncCoord \1, \2
+ ld bc, Coord
+ ENDM
+
+decoord: MACRO
+ FuncCoord \1, \2
+ ld de, Coord
+ ENDM
+
+hlcoord: MACRO
+ FuncCoord \1, \2
+ ld hl, Coord
+ ENDM
+
+
+; pic animations
+frame: MACRO
+ db \1
+ db \2
+ ENDM
+setrepeat: MACRO
+ db $fe
+ db \1
+ ENDM
+dorepeat: MACRO
+ db $fd
+ db \1
+ ENDM
+endanim: MACRO
+ db $ff
+ ENDM
+
--- a/main.asm
+++ b/main.asm
@@ -1,1371 +1,36 @@
SECTION "bank0",ROM0
-SECTION "rst0",ROM0[$0]
- di
- jp Start
-SECTION "rst8",ROM0[$8] ; FarCall
- jp FarCall_hl
+INCLUDE "rst.asm"
-SECTION "rst10",ROM0[$10] ; Bankswitch
- ld [hROMBank], a
- ld [MBC3RomBank], a
- ret
+INCLUDE "interrupts.asm"
-SECTION "rst18",ROM0[$18] ; Unused
- rst $38
-SECTION "rst20",ROM0[$20] ; Unused
- rst $38
+SECTION "header",ROM0[$100]
-SECTION "rst28",ROM0[$28] ; JumpTable
- push de
- ld e, a
- ld d, 0
- add hl, de
- add hl, de
- ld a, [hli]
- ld h, [hl]
- ld l, a
- pop de
- jp [hl]
-
-; rst30 is midst rst28
-
-SECTION "rst38",ROM0[$38] ; Unused
- rst $38
-
-SECTION "vblank",ROM0[$40] ; vblank interrupt
- jp VBlank
-
-SECTION "lcd",ROM0[$48] ; lcd interrupt
- jp LCD
-
-SECTION "timer",ROM0[$50] ; timer interrupt
- jp Timer
-
-SECTION "serial",ROM0[$58] ; serial interrupt
- jp Serial
-
-SECTION "joypad",ROM0[$60] ; joypad interrupt
- jp JoypadInt
-
-SECTION "romheader",ROM0[$100]
Start:
nop
jp _Start
+
SECTION "start",ROM0[$150]
INCLUDE "engine/init.asm"
-
-
INCLUDE "engine/vblank.asm"
-
-
-DelayFrame: ; 45a
-; Wait for one frame
- ld a, 1
- ld [VBlankOccurred], a
-
-; Wait for the next VBlank, halting to conserve battery
-.halt
- halt ; rgbasm adds a nop after this instruction by default
- ld a, [VBlankOccurred]
- and a
- jr nz, .halt
- ret
-; 468
-
-
-DelayFrames: ; 468
-; Wait c frames
- call DelayFrame
- dec c
- jr nz, DelayFrames
- ret
-; 46f
-
-
-RTC: ; 46f
-; update time and time-sensitive palettes
-
-; rtc enabled?
- ld a, [$c2ce]
- cp 0
- ret z
-
- call UpdateTime
-
-; obj update on?
- ld a, [VramState]
- bit 0, a ; obj update
- ret z
-
-TimeOfDayPals: ; 47e
- callab _TimeOfDayPals
- ret
-; 485
-
-
-Function485: ; 485
- callab UpdateTimePals
- ret
-; 48c
-
-
+INCLUDE "engine/delay.asm"
+INCLUDE "engine/rtc.asm"
INCLUDE "engine/fade.asm"
-
-
INCLUDE "engine/lcd.asm"
-
-
INCLUDE "engine/time.asm"
-
-
INCLUDE "engine/serial.asm"
-
-
INCLUDE "engine/joypad.asm"
-
-
INCLUDE "engine/decompress.asm"
-
-
INCLUDE "engine/palettes.asm"
-
-
INCLUDE "engine/copy.asm"
-
-
INCLUDE "engine/text.asm"
+INCLUDE "engine/video.asm"
+INCLUDE "engine/map_objects.asm"
+INCLUDE "engine/sine.asm"
-
-DMATransfer: ; 15d8
-; DMA transfer
-; return carry if successful
-
-; anything to transfer?
- ld a, [hDMATransfer]
- and a
- ret z
-; start transfer
- ld [rHDMA5], a
-; indicate that transfer has occurred
- xor a
- ld [hDMATransfer], a
-; successful transfer
- scf
- ret
-; 15e3
-
-
-UpdateBGMapBuffer: ; 15e3
-; write [$ffdc] 16x8 tiles from BGMapBuffer to bg map addresses in BGMapBufferPtrs
-; [$ffdc] must be even since this is done in 16x16 blocks
-
-; return carry if successful
-
-; any tiles to update?
- ld a, [hBGMapUpdate]
- and a
- ret z
-; save wram bank
- ld a, [rVBK]
- push af
-; save sp
- ld [hSPBuffer], sp
-
-; temp stack
- ld hl, BGMapBufferPtrs
- ld sp, hl
-; we can now pop the addresses of affected spots in bg map
-
-; get pal and tile buffers
- ld hl, BGMapPalBuffer
- ld de, BGMapBuffer
-
-.loop
-; draw one 16x16 block
-
-; top half:
-
-; get bg map address
- pop bc
-; update palettes
- ld a, $1
- ld [rVBK], a
-; tile 1
- ld a, [hli]
- ld [bc], a
- inc c
-; tile 2
- ld a, [hli]
- ld [bc], a
- dec c
-; update tiles
- ld a, $0
- ld [rVBK], a
-; tile 1
- ld a, [de]
- inc de
- ld [bc], a
- inc c
-; tile 2
- ld a, [de]
- inc de
- ld [bc], a
-
-; bottom half:
-
-; get bg map address
- pop bc
-; update palettes
- ld a, $1
- ld [rVBK], a
-; tile 1
- ld a, [hli]
- ld [bc], a
- inc c
-; tile 2
- ld a, [hli]
- ld [bc], a
- dec c
-; update tiles
- ld a, $0
- ld [rVBK], a
-; tile 1
- ld a, [de]
- inc de
- ld [bc], a
- inc c
-; tile 2
- ld a, [de]
- inc de
- ld [bc], a
-
-; we've done 2 16x8 blocks
- ld a, [$ffdc]
- dec a
- dec a
- ld [$ffdc], a
-
-; if there are more left, get the next 16x16 block
- jr nz, .loop
-
-
-; restore sp
- ld a, [hSPBuffer]
- ld l, a
- ld a, [$ffda]
- ld h, a
- ld sp, hl
-
-; restore vram bank
- pop af
- ld [rVBK], a
-
-; we don't need to update bg map until new tiles are loaded
- xor a
- ld [hBGMapUpdate], a
-
-; successfully updated bg map
- scf
- ret
-; 163a
-
-
-WaitTop: ; 163a
- ld a, [hBGMapMode]
- and a
- ret z
-
-; wait until top third of bg map can be updated
- ld a, [hBGMapThird]
- and a
- jr z, .quit
-
- call DelayFrame
- jr WaitTop
-
-.quit
- xor a
- ld [hBGMapMode], a
- ret
-; 164c
-
-
-UpdateBGMap: ; 164c
-; get mode
- ld a, [hBGMapMode]
- and a
- ret z
-
-; don't save bg map address
- dec a ; 1
- jr z, .tiles
- dec a ; 2
- jr z, .attr
- dec a ; ?
-
-; save bg map address
- ld a, [hBGMapAddress]
- ld l, a
- ld a, [$ffd7]
- ld h, a
- push hl
-
-; bg map 1 (VBGMap1)
- xor a
- ld [hBGMapAddress], a
- ld a, $9c
- ld [$ffd7], a
-
-; get mode again
- ld a, [hBGMapMode]
- push af
- cp 3
- call z, .tiles
- pop af
- cp 4
- call z, .attr
-
-; restore bg map address
- pop hl
- ld a, l
- ld [hBGMapAddress], a
- ld a, h
- ld [$ffd7], a
- ret
-
-.attr
-; switch vram banks
- ld a, 1
- ld [rVBK], a
-; bg map 1
- ld hl, AttrMap
- call .getthird
-; restore vram bank
- ld a, 0
- ld [rVBK], a
- ret
-
-.tiles
-; bg map 0
- ld hl, TileMap
-
-.getthird
-; save sp
- ld [hSPBuffer], sp
-
-; # tiles to move down * 6 (which third?)
- ld a, [hBGMapThird]
- and a ; 0
- jr z, .top
- dec a ; 1
- jr z, .middle
-
-; .bottom ; 2
-; move 12 tiles down
- ld de, $00f0 ; TileMap(0,12) - TileMap
- add hl, de
-; stack now points to source
- ld sp, hl
-; get bg map address
- ld a, [$ffd7]
- ld h, a
- ld a, [hBGMapAddress]
- ld l, a
-; move 12 tiles down
- ld de, $0180 ; bgm(0,12)
- add hl, de
-; start at top next time
- xor a
- jr .start
-
-.middle
-; move 6 tiles down
- ld de, $0078 ; TileMap(0,6) - TileMap
- add hl, de
-; stack now points to source
- ld sp, hl
-; get bg map address
- ld a, [$ffd7]
- ld h, a
- ld a, [hBGMapAddress]
- ld l, a
-; move 6 tiles down
- ld de, $00c0 ; bgm(0,6)
- add hl, de
-; start at bottom next time
- ld a, 2
- jr .start
-
-.top
-; stack now points to source
- ld sp, hl
-; get bg map address
- ld a, [$ffd7]
- ld h, a
- ld a, [hBGMapAddress]
- ld l, a
-; start at middle next time
- ld a, 1
-
-.start
-; which third to draw next update
- ld [hBGMapThird], a
-; # rows per third
- ld a, 6 ; SCREEN_HEIGHT / 3
-; # tiles from the edge of the screen to the next row
- ld bc, $000d ; BG_WIDTH + 1 - SCREEN_WIDTH
-
-.row
-; write a row of 20 tiles
-rept 9
- pop de
- ld [hl], e
- inc l
- ld [hl], d
- inc l
-endr
- pop de
- ld [hl], e
- inc l
- ld [hl], d
-; next row
- add hl, bc
-; done?
- dec a
- jr nz, .row
-
-; restore sp
- ld a, [hSPBuffer]
- ld l, a
- ld a, [$ffda]
- ld h, a
- ld sp, hl
- ret
-; 170a
-
-
-SafeLoadTiles2: ; 170a
-; only execute during first fifth of vblank
-; any tiles to draw?
- ld a, [$cf6c]
- and a
- ret z
-; abort if too far into vblank
- ld a, [rLY]
-; ly = 144-145?
- cp 144
- ret c
- cp 146
- ret nc
-
-GetTiles2: ; 1717
-; load [$cf6c] tiles from [$cf6d-e] to [$cf6f-70]
-; save sp
- ld [hSPBuffer], sp
-
-; sp = [$cf6d-e] tile source
- ld hl, $cf6d
- ld a, [hli]
- ld h, [hl]
- ld l, a
- ld sp, hl
-
-; hl = [$cf6f-70] tile dest
- ld hl, $cf6f
- ld a, [hli]
- ld h, [hl]
- ld l, a
-
-; # tiles to draw
- ld a, [$cf6c]
- ld b, a
-
-; clear tile queue
- xor a
- ld [$cf6c], a
-
-.loop
-; put 1 tile (16 bytes) into hl from sp
-
-rept 3
- pop de
- ld [hl], e
- inc l
- ld [hl], e
- inc l
- ld [hl], d
- inc l
- ld [hl], d
- inc l
-endr
- pop de
- ld [hl], e
- inc l
- ld [hl], e
- inc l
- ld [hl], d
- inc l
- ld [hl], d
-; next tile
- inc hl
-; done?
- dec b
- jr nz, .loop
-
-; update $cf6f-70
- ld a, l
- ld [$cf6f], a
- ld a, h
- ld [$cf70], a
-
-; update $cf6d-e
- ld [$cf6d], sp
-
-; restore sp
- ld a, [hSPBuffer]
- ld l, a
- ld a, [$ffda]
- ld h, a
- ld sp, hl
- ret
-; 1769
-
-
-SafeLoadTiles: ; 1769
-; only execute during first fifth of vblank
-; any tiles to draw?
- ld a, [$cf67]
- and a
- ret z
-; abort if too far into vblank
- ld a, [rLY]
-; ly = 144-145?
- cp 144
- ret c
- cp 146
- ret nc
- jr GetTiles
-
-LoadTiles: ; 1778
-; use only if time is allotted
-; any tiles to draw?
- ld a, [$cf67]
- and a
- ret z
-; get tiles
-
-GetTiles: ; 177d
-; load [$cf67] tiles from [$cf68-9] to [$cf6a-b]
-
-; save sp
- ld [hSPBuffer], sp
-
-; sp = [$cf68-9] tile source
- ld hl, $cf68
- ld a, [hli]
- ld h, [hl]
- ld l, a
- ld sp, hl
-
-; hl = [$cf6a-b] tile dest
- ld hl, $cf6a
- ld a, [hli]
- ld h, [hl]
- ld l, a
-
-; # tiles to draw
- ld a, [$cf67]
- ld b, a
-; clear tile queue
- xor a
- ld [$cf67], a
-
-.loop
-; put 1 tile (16 bytes) into hl from sp
-rept 7
- pop de
- ld [hl], e
- inc l
- ld [hl], d
- inc l
-endr
- pop de
- ld [hl], e
- inc l
- ld [hl], d
-; next tile
- inc hl
-; done?
- dec b
- jr nz, .loop
-
-; update $cf6a-b
- ld a, l
- ld [$cf6a], a
- ld a, h
- ld [$cf6b], a
-
-; update $cf68-9
- ld [$cf68], sp
-
-; restore sp
- ld a, [hSPBuffer]
- ld l, a
- ld a, [$ffda]
- ld h, a
- ld sp, hl
- ret
-; 17d3
-
-
-SafeTileAnimation: ; 17d3
-; call from vblank
-
- ld a, [$ffde]
- and a
- ret z
-
-; abort if too far into vblank
- ld a, [rLY]
-; ret unless ly = 144-150
- cp 144
- ret c
- cp 151
- ret nc
-
-; save affected banks
-; switch to new banks
- ld a, [hROMBank]
- push af ; save bank
- ld a, BANK(DoTileAnimation)
- rst Bankswitch ; bankswitch
-
- ld a, [rSVBK]
- push af ; save wram bank
- ld a, $1 ; wram bank 1
- ld [rSVBK], a
-
- ld a, [rVBK]
- push af ; save vram bank
- ld a, $0 ; vram bank 0
- ld [rVBK], a
-
-; take care of tile animation queue
- call DoTileAnimation
-
-; restore affected banks
- pop af
- ld [rVBK], a
- pop af
- ld [rSVBK], a
- pop af
- rst Bankswitch ; bankswitch
- ret
-; 17ff
-
-
-GetSpritePalette: ; 17ff
- push hl
- push de
- push bc
- ld c, a
- callba _GetSpritePalette
- ld a, c
- pop bc
- pop de
- pop hl
- ret
-; 180e
-
-Function180e: ; 180e
- push hl
- push bc
- ld hl, $d156
- ld c, $1f
- ld b, a
- ld a, [hConnectionStripLength]
- cp $0
- jr z, .asm_182b
- ld a, b
-.asm_181d
- cp [hl]
- jr z, .asm_1830
- inc hl
- inc hl
- dec c
- jr nz, .asm_181d
- ld a, [$d155]
- scf
- jr .asm_1833
-
-.asm_182b
- ld a, [$d155]
- jr .asm_1833
-
-.asm_1830
- inc hl
- xor a
- ld a, [hl]
-
-.asm_1833
- pop bc
- pop hl
- ret
-; 1836
-
-Function1836: ; 1836
- push de
- push hl
-
- ld b, a
- ld a, [hROMBank]
- push af
- ld a, BANK(Function142a7)
- rst Bankswitch
-
- ld a, b
- call Function142a7
- ld c, a
-
- pop de
- ld a, d
- rst Bankswitch
-
- pop hl
- pop de
- ret
-; 184a
-
-
-
-Function184a: ; 184a
- ld a, [StandingTile]
- call GetTileCollision
- ld b, a
- ret
-; 1852
-
-Function1852: ; 1852
- ld a, [StandingTile]
- call GetTileCollision
- sub 1
- ret z
- and a
- ret
-; 185d
-
-
-GetTileCollision: ; 185d
-; Get the collision type of tile a.
-
- push de
- push hl
-
- ld hl, TileCollisionTable
- ld e, a
- ld d, 0
- add hl, de
-
- ld a, [hROMBank]
- push af
- ld a, BANK(TileCollisionTable)
- rst Bankswitch
- ld e, [hl]
- pop af
- rst Bankswitch
-
- ld a, e
- and $f ; lo nybble only
-
- pop hl
- pop de
- ret
-; 1875
-
-
-Function1875: ; 1875
- ld d, a
- and $f0
- cp $10
- jr z, .asm_1882
- cp $20
- jr z, .asm_1888
- scf
- ret
-
-.asm_1882
- ld a, d
- and 7
- ret z
- scf
- ret
-
-.asm_1888
- ld a, d
- and 7
- ret z
- scf
- ret
-; 188e
-
-Function188e: ; 188e
- cp $14
- ret z
- cp $1c
- ret
-; 1894
-
-CheckCutTreeTile: ; 1894
- cp $12
- ret z
- cp $1a
- ret
-; 189a
-
-CheckHeadbuttTreeTile: ; 189a
- cp $15
- ret z
- cp $1d
- ret
-; 18a0
-
-CheckCounterTile: ; 18a0
- cp $90
- ret z
- cp $98
- ret
-; 18a6
-
-CheckPitTile: ; 18a6
- cp $60
- ret z
- cp $68
- ret
-; 18ac
-
-CheckIceTile: ; 18ac
- cp $23
- ret z
- cp $2b
- ret z
- scf
- ret
-; 18b4
-
-CheckWhirlpoolTile: ; 18b4
- nop
- cp $24
- ret z
- cp $2c
- ret z
- scf
- ret
-; 18bd
-
-CheckWaterfallTile: ; 18bd
- cp $33
- ret z
- cp $3b
- ret
-; 18c3
-
-CheckStandingOnEntrance: ; 18c3
- ld a, [StandingTile]
- cp $71 ; door
- ret z
- cp $79
- ret z
- cp $7a ; stairs
- ret z
- cp $7b ; cave
- ret
-; 18d2
-
-
-GetMapObject: ; 18d2
-; Return the location of map object a in bc.
- ld hl, MapObjects
- ld bc, $10
- call AddNTimes
- ld b, h
- ld c, l
- ret
-; 18de
-
-
-Function18de: ; 18de
- ld [hConnectionStripLength], a
- call GetMapObject
- ld hl, $0000
- add hl, bc
- ld a, [hl]
- cp $ff
- jr z, .asm_18f3
- ld [hConnectedMapWidth], a
- call Function1ae5
- and a
- ret
-
-.asm_18f3
- scf
- ret
-; 18f5
-
-Function18f5: ; 18f5
- ld hl, $0006
- add hl, bc
- ld a, [hl]
- cp $ff
- jr nz, .asm_1921
- ld hl, $0007
- add hl, bc
- ld a, [hl]
- cp $ff
- jr z, .asm_191c
- ld hl, .data_191e
- ld a, [TimeOfDay]
- add l
- ld l, a
- jr nc, .asm_1912
- inc h
-
-.asm_1912
- ld a, [hl]
- ld hl, $0007
- add hl, bc
- and [hl]
- jr nz, .asm_191c
- scf
- ret
-
-.asm_191c
- and a
- ret
-
-.data_191e
- db $1
- db $2
- db $4
-
-.asm_1921
- ld hl, $0006
- add hl, bc
- ld d, [hl]
- ld hl, $0007
- add hl, bc
- ld e, [hl]
- ld hl, hHours
- ld a, d
- cp e
- jr z, .asm_1949
- jr c, .asm_193f
- ld a, [hl]
- cp d
- jr nc, .asm_1949
- cp e
- jr c, .asm_1949
- jr z, .asm_1949
- jr .asm_194b
-
-.asm_193f
- ld a, e
- cp [hl]
- jr c, .asm_194b
- ld a, [hl]
- cp d
- jr nc, .asm_1949
- jr .asm_194b
-
-.asm_1949
- and a
- ret
-
-.asm_194b
- scf
- ret
-; 194d
-
-Function194d: ; 194d
- ld [hConnectionStripLength], a
- call GetMapObject
- call $40e7
- ret
-; 1956
-
-
-
-Function1956: ; 1956
- ld [hConnectionStripLength], a
- call Function271e
- ld a, [hConnectionStripLength]
- call GetMapObject
- ld a, $2
- ld hl, $40e7
- rst FarCall
- ret
-; 1967
-
-Function1967: ; 1967
- ld [hConnectionStripLength], a
- call GetMapObject
- ld hl, $0000
- add hl, bc
- ld a, [hl]
- cp $ff
- ret z
- ld [hl], $ff
- push af
- call Function1985
- pop af
- call Function1ae5
- callba Function4357
- ret
-; 1985
-
-Function1985: ; 1985
- ld hl, $d4cd
- cp [hl]
- jr z, .asm_1990
- ld hl, $d4ce
- cp [hl]
- ret nz
-
-.asm_1990
- callba Function581f
- ld a, $ff
- ld [$d4cd], a
- ld [$d4ce], a
- ret
-; 199f
-
-Function199f: ; 199f
- call Function1967
- call Function2712
- ret
-; 19a6
-
-Function19a6: ; 19a6
- push hl
- call GetMapObject
- ld d, b
- ld e, c
- ld a, $ff
- ld [de], a
- inc de
- pop hl
- ld bc, $000f
- call CopyBytes
- ret
-; 19b8
-
-Function19b8: ; 19b8
- call GetMapObject
- ld hl, $0000
- add hl, bc
- ld a, [hl]
- push af
- ld [hl], $ff
- inc hl
- ld bc, $000f
- xor a
- call ByteFill
- pop af
- cp $ff
- ret z
- cp $d
- ret nc
- ld b, a
- ld a, [$d4cd]
- cp b
- jr nz, .asm_19de
- ld a, $ff
- ld [$d4cd], a
-
-.asm_19de
- ld a, b
- call Function1ae5
- callba Function4357
- ret
-; 19e9
-
-
-
-Function19e9: ; 19e9
- ld [$c2e2], a
- ld a, [hROMBank]
- ld [$c2e3], a
- ld a, l
- ld [$c2e4], a
- ld a, h
- ld [$c2e5], a
- ld a, [$c2e2]
- call Function18de
- ret c
- ld hl, $0003
- add hl, bc
- ld [hl], $14
- ld hl, $0009
- add hl, bc
- ld [hl], $0
- ld hl, VramState
- set 7, [hl]
- and a
- ret
-; 1a13
-
-
-
-Function1a13: ; 1a13
- push bc
- push de
- ld hl, $d4d6
- ld de, $0028
- ld c, $d
-.asm_1a1d
- ld a, [hl]
- and a
- jr z, .asm_1a28
- add hl, de
- dec c
- jr nz, .asm_1a1d
- xor a
- jr .asm_1a2c
-
-.asm_1a28
- ld a, $d
- sub c
- scf
-
-.asm_1a2c
- pop de
- pop bc
- ret
-; 1a2f
-
-
-
-Function1a2f: ; 1a2f
- ld hl, $0003
- add hl, bc
- ld a, [hl]
- cp $25
- jr c, .asm_1a39
- xor a
-
-.asm_1a39
- ld hl, Data4273
- ld e, a
- ld d, 0
- add hl, de
- add hl, de
- add hl, de
- add hl, de
- add hl, de
- add hl, de
- ld a, [hl]
- ret
-; 1a47
-
-Function1a47: ; 1a47
- push bc
- push de
- ld e, a
- ld d, 0
- ld hl, Data4273 + 1
- add hl, de
- add hl, de
- add hl, de
- add hl, de
- add hl, de
- add hl, de
- ld a, BANK(Data4273)
- call GetFarByte
- add a
- add a
- and $c
- pop de
- pop bc
- ret
-; 1a61
-
-
-Function1a61: ; 1a61
- ld l, a
- ld a, [hROMBank]
- push af
- ld a, BANK(Data4273)
- rst Bankswitch
- ld a, l
- push bc
-
- call Function1a71
-
- pop bc
- pop af
- rst Bankswitch
-
- ret
-; 1a71
-
-Function1a71: ; 1a71
- ld hl, $0003
- add hl, de
- ld [hl], a
- push de
- ld e, a
- ld d, 0
- ld hl, Data4273 + 1
- add hl, de
- add hl, de
- add hl, de
- add hl, de
- add hl, de
- add hl, de
- ld b, h
- ld c, l
- pop de
- ld a, [bc]
- inc bc
- rlca
- rlca
- and $c
- ld hl, $0008
- add hl, de
- ld [hl], a
- ld a, [bc]
- inc bc
- ld hl, $000b
- add hl, de
- ld [hl], a
- ld a, [bc]
- inc bc
- ld hl, $0004
- add hl, de
- ld [hl], a
- ld a, [bc]
- inc bc
- ld hl, $0005
- add hl, de
- ld [hl], a
- ld a, [bc]
- inc bc
- ld hl, $0006
- add hl, de
- ld [hl], a
- ret
-; 1aae
-
-Function1aae: ; 1aae
- ld a, [hROMBank]
- push af
- ld a, [hli]
- rst Bankswitch
-
- ld a, [hli]
- ld d, [hl]
- ld hl, $001b
- add hl, bc
- add [hl]
- ld e, a
- ld a, d
- adc $0
- ld d, a
- inc [hl]
- ld a, [de]
- ld h, a
- pop af
- rst Bankswitch
-
- ld a, h
- ret
-; 1ac6
-
-Function1ac6: ; 1ac6
- ld hl, VramState
- set 0, [hl]
- ret
-; 1acc
-
-Function1acc: ; 1acc
- ld hl, VramState
- res 0, [hl]
- ret
-; 1ad2
-
-
-Function1ad2: ; 1ad2
- ld a, [VramState]
- bit 0, a
- ret z
- callba Function55e0
- callba Function5920
- ret
-; 1ae5
-
-
-Function1ae5: ; 1ae5
- ld bc, $0028
- ld hl, $d4d6
- call AddNTimes
- ld b, h
- ld c, l
- ret
-; 1af1
-
-Function1af1: ; 1af1
- ld hl, $0000
- add hl, bc
- ld a, [hl]
- and a
- ret
-; 1af8
-
-Function1af8: ; 1af8
- push af
- ld hl, $0008
- add hl, bc
- ld a, [hl]
- and $f3
- ld e, a
- pop af
- and $c
- or e
- ld [hl], a
- ret
-; 1b07
-
-
-GetSpriteDirection: ; 1b07
- ld hl, $0008
- add hl, bc
- ld a, [hl]
- and $c
- ret
-; 1b0f
-
-
-Function1b0f: ; 1b0f
- add $10
-
-Function1b11: ; 1b11
- ld e, a
-
- ld a, [hROMBank]
- push af
- ld a, BANK(Function84d9)
- rst Bankswitch
-
- call Function84d9
-
- pop af
- rst Bankswitch
- ret
-; 1b1e
-
Function1b1e: ; 1b1e
ld [$d003], a
xor a
@@ -1808,607 +473,9 @@
; 1d35
-LoadMenuDataHeader: ; 0x1d35
- call Function1d3c
- call Function1c00
- ret
+INCLUDE "engine/menu.asm"
-Function1d3c: ; 0x1d3c
- ld de, $cf81
- ld bc, $0010
- call CopyBytes
- ld a, [hROMBank]
- ld [$cf8a], a
- ret
-; 0x1d4b
-Function1d4b: ; 1d4b
- ld [$cf88], a
- ret
-; 1d4f
-
-
-Function1d4f: ; 1d4f
- push hl
- call Function1d58
- pop hl
- jp PrintText
-; 1d57
-
-Function1d57: ; 1d57
- ret
-; 1d58
-
-Function1d58: ; 1d58
- ld hl, MenuDataHeader_0x1d5f
- call LoadMenuDataHeader
- ret
-; 1d5f
-
-MenuDataHeader_0x1d5f: ; 1d5f
- db $40 ; tile backup
- db 12, 0 ; start coords
- db 17, 19 ; end coords
- dw VTiles0
- db 0 ; default option
-; 1d67
-
-Function1d67: ; 1d67
- call Function1d4f
- call Function1c17
- ret
-; 1d6e
-
-Function1d6e: ; 1d6e
- ld hl, MenuDataHeader_0x1d75
- call LoadMenuDataHeader
- ret
-; 1d75
-
-MenuDataHeader_0x1d75: ; 1d75
- db $40 ; tile backup
- db 0, 0 ; start coords
- db 17, 19 ; end coords
- dw $0000
- db 1 ; default option
-; 1d7d
-
-Function1d7d: ; 1d7d
- call Function1c07
- ret
-; 1d81
-
-Function1d81: ; 0x1d81
- xor a
- ld [hBGMapMode], a
- call Function1cbb
- call Function1ad2
- call Function1c89
- call Function321c
- call Function1c66
- ld a, [$cf91]
- bit 7, a
- jr z, .asm_1da7 ; 0x1d98 $d
- call Function1c10
- call Function1bc9
- call Function1ff8
- bit 1, a
- jr z, .asm_1da9 ; 0x1da5 $2
-.asm_1da7
- scf
- ret
-.asm_1da9
- and a
- ret
-; 0x1dab
-
-Function1dab: ; 1dab
- call LoadMenuDataHeader
- call Function1d81
- call Function1c17
- ld a, [$cfa9]
- ret
-; 1db8
-
-Function1db8: ; 0x1db8
- push hl
- push bc
- push af
- ld hl, $cf86
- ld a, [hli]
- ld h, [hl]
- ld l, a
- inc hl
- inc hl
- pop af
- call GetNthString
- ld d, h
- ld e, l
- call CopyName1
- pop bc
- pop hl
- ret
-; 0x1dcf
-
-
-Function1dcf: ; 1dcf
- ld bc, $0e07
-
-Function1dd2: ; 1dd2
- jr Function1dd9
-
-Function1dd4: ; 1dd4
- call LoadMenuDataHeader
- jr Function1dfe
-
-Function1dd9: ; 1dd9
- push bc
- ld hl, MenuDataHeader_0x1e1d
- call Function1d3c
- pop bc
- ld a, b
- cp $e
- jr nz, .asm_1de9
- ld a, $e
- ld b, a
-
-.asm_1de9
- ld a, b
- ld [$cf83], a
- add $5
- ld [$cf85], a
- ld a, c
- ld [$cf82], a
- add $4
- ld [$cf84], a
- call Function1c00
-
-Function1dfe: ; 1dfe
- call Function1d81
- push af
- ld c, $f
- call DelayFrames
- call Function1c17
- pop af
- jr c, .asm_1e16
- ld a, [$cfa9]
- cp $2
- jr z, .asm_1e16
- and a
- ret
-
-.asm_1e16
- ld a, $2
- ld [$cfa9], a
- scf
- ret
-; 1e1d
-
-MenuDataHeader_0x1e1d: ; 1e1d
- db $40 ; tile backup
- db 5, 10 ; start coords
- db 9, 15 ; end coords
- dw MenuData2_0x1e25
- db 1 ; default option
-; 1e25
-
-MenuData2_0x1e25: ; 1e25
- db $c0 ; flags
- db 2
- db "YES@"
- db "NO@"
-; 1e2e
-
-Function1e2e: ; 1e2e
- call Function1e35
- call Function1c00
- ret
-; 1e35
-
-Function1e35: ; 1e35
- push de
- call Function1d3c
- pop de
- ld a, [$cf83]
- ld h, a
- ld a, [$cf85]
- sub h
- ld h, a
- ld a, d
- ld [$cf83], a
- add h
- ld [$cf85], a
- ld a, [$cf82]
- ld l, a
- ld a, [$cf84]
- sub l
- ld l, a
- ld a, e
- ld [$cf82], a
- add l
- ld [$cf84], a
- ret
-; 1e5d
-
-Function1e5d: ; 1e5d
- call MenuFunc_1e7f
- call MenuWriteText
- call Function1eff
- call Function1f23
- call Function1bdd
- call Function1ff8
- ret
-; 1e70
-
-SetUpMenu: ; 1e70
- call MenuFunc_1e7f ; ???
- call MenuWriteText
- call Function1eff ; set up selection pointer
- ld hl, $cfa5
- set 7, [hl]
- ret
-
-MenuFunc_1e7f: ; 0x1e7f
- call Function1c66
- call Function1ebd
- call Function1ea6
- call Function1cbb
- ret
-
-MenuWriteText: ; 0x1e8c
- xor a
- ld [hBGMapMode], a
- call Function1ebd ; sort out the text
- call Function1eda ; actually write it
- call Function2e31
- ld a, [hOAMUpdate]
- push af
- ld a, $1
- ld [hOAMUpdate], a
- call Function321c
- pop af
- ld [hOAMUpdate], a
- ret
-; 0x1ea6
-
-Function1ea6: ; 1ea6
- ld a, [$cf83]
- ld c, a
- ld a, [$cf85]
- sub c
- ld c, a
- ld a, [$cf92]
- add a
- inc a
- ld b, a
- ld a, [$cf82]
- add b
- ld [$cf84], a
- ret
-; 1ebd
-
-Function1ebd: ; 1ebd
- ld hl, $cf93
- ld a, [hli]
- ld h, [hl]
- ld l, a
- ld a, [$cf76]
- and a
- jr z, .asm_1ed3
- ld b, a
- ld c, $ff
-.asm_1ecc
- ld a, [hli]
- cp c
- jr nz, .asm_1ecc
- dec b
- jr nz, .asm_1ecc
-
-.asm_1ed3
- ld d, h
- ld e, l
- ld a, [hl]
- ld [$cf92], a
- ret
-; 1eda
-
-Function1eda: ; 1eda
- call Function1cfd
- ld bc, $002a
- add hl, bc
-.asm_1ee1
- inc de
- ld a, [de]
- cp $ff
- ret z
- ld [MenuSelection], a
- push de
- push hl
- ld d, h
- ld e, l
- ld hl, $cf95
- call Function1efb
- pop hl
- ld de, $0028
- add hl, de
- pop de
- jr .asm_1ee1
-; 1efb
-
-Function1efb: ; 1efb
- ld a, [hli]
- ld h, [hl]
- ld l, a
- jp [hl]
-; 1eff
-
-Function1eff: ; 1eff
- call Function1c10
- ld hl, $cfa8
- ld a, [$cf91]
- bit 3, a
- jr z, .asm_1f0e
- set 3, [hl]
-
-.asm_1f0e
- ld a, [$cf91]
- bit 2, a
- jr z, .asm_1f19
- set 5, [hl]
- set 4, [hl]
-
-.asm_1f19
- ret
-; 1f1a
-
-
-Function1f1a: ; 1f1a
- call Function1bd3
- ld hl, $cfa8
- and [hl]
- jr Function1f2a
-; 1f23
-
-Function1f23: ; 1f23
- xor a
- ld [$cf73], a
- call Function1bc9
-; 1f2a
-
-Function1f2a: ; 1f2a
- bit 0, a
- jr nz, .asm_1f52
- bit 1, a
- jr nz, .asm_1f6d
- bit 3, a
- jr nz, .asm_1f6d
- bit 4, a
- jr nz, .asm_1f44
- bit 5, a
- jr nz, .asm_1f4b
- xor a
- ld [$cf73], a
- jr .asm_1f57
-
-.asm_1f44
- ld a, $10
- ld [$cf73], a
- jr .asm_1f57
-
-.asm_1f4b
- ld a, $20
- ld [$cf73], a
- jr .asm_1f57
-
-.asm_1f52
- ld a, $1
- ld [$cf73], a
-
-.asm_1f57
- call Function1ebd
- ld a, [$cfa9]
- ld l, a
- ld h, $0
- add hl, de
- ld a, [hl]
- ld [MenuSelection], a
- ld a, [$cfa9]
- ld [$cf88], a
- and a
- ret
-
-.asm_1f6d
- ld a, $2
- ld [$cf73], a
- ld a, $ff
- ld [MenuSelection], a
- scf
- ret
-; 1f79
-
-Function1f79: ; 1f79
- push de
- ld hl, $cf97
- ld a, [hli]
- ld h, [hl]
- ld l, a
- ld a, [MenuSelection]
- call GetNthString
- ld d, h
- ld e, l
- pop hl
- call PlaceString
- ret
-; 1f8d
-
-Function1f8d: ; 1f8d
- push de
- ld a, [MenuSelection]
- call Function1fb1
- inc hl
- inc hl
- ld a, [hli]
- ld d, [hl]
- ld e, a
- pop hl
- call PlaceString
- ret
-; 1f9e
-
-Function1f9e: ; 1f9e
- call Function1fb1
- inc hl
- inc hl
- ld a, [hli]
- ld d, [hl]
- ld e, a
- ret
-; 1fa7
-
-Function1fa7: ; 1fa7
- ld a, [MenuSelection]
- call Function1fb1
- ld a, [hli]
- ld h, [hl]
- ld l, a
- jp [hl]
-; 1fb1
-
-Function1fb1: ; 1fb1
- ld e, a
- ld d, $0
- ld hl, $cf97
- ld a, [hli]
- ld h, [hl]
- ld l, a
- add hl, de
- add hl, de
- add hl, de
- add hl, de
- ret
-; 1fbf
-
-Function1fbf: ; 1fbf
- ld hl, $cf71
- call Function1ff0
- ld hl, $cf81
- call Function1ff0
- ld hl, $cf91
- call Function1ff0
- ld hl, $cfa1
- call Function1ff0
- ld a, [rSVBK]
- push af
- ld a, $7
- ld [rSVBK], a
- xor a
- ld hl, $dfff
- ld [hld], a
- ld [hld], a
- ld a, l
- ld [$cf71], a
- ld a, h
- ld [$cf72], a
- pop af
- ld [rSVBK], a
- ret
-; 1ff0
-
-Function1ff0: ; 1ff0
- ld bc, $0010
- xor a
- call ByteFill
- ret
-; 1ff8
-
-Function1ff8: ; 1ff8
- push af
- and $3
- jr z, .asm_2007
- ld hl, $cf81
- bit 3, [hl]
- jr nz, .asm_2007
- call PlayClickSFX
-
-.asm_2007
- pop af
- ret
-; 2009
-
-
-PlayClickSFX: ; 2009
- push de
- ld de, SFX_READ_TEXT_2
- call StartSFX
- pop de
- ret
-; 0x2012
-
-Function2012: ; 2012
- call Function1d4f
- call Functiona46
- call Function1c07
- ret
-; 201c
-
-Function201c: ; 201c
- ld [hBuffer], a
- ld a, [hROMBank]
- push af
- ld a, [hBuffer]
- rst Bankswitch
-
- call PlaceString
- pop af
- rst Bankswitch
-
- ret
-; 202a
-
-Function202a: ; 202a
- ld a, [hROMBank]
- ld [$cf94], a
- ld a, $9
- ld hl, $400e
- rst FarCall
- ld a, [$cf88]
- ret
-; 2039
-
-Function2039: ; 2039
- ld a, [hROMBank]
- ld [$cf94], a
- ld a, $9
- ld hl, $4022
- rst FarCall
- ld a, [$cf88]
- ret
-; 2048
-
-Function2048: ; 2048
- ld a, [hROMBank]
- ld [$cf94], a
- ld a, $9
- ld hl, $403c
- rst FarCall
- ld a, [$cf88]
- ret
-; 2057
-
-Function2057: ; 2057
- ld a, [hROMBank]
- push af
- ld a, $21
- rst Bankswitch
-
- call $42db
- pop af
- rst Bankswitch
-
- ret
-; 2063
-
-
AskSerial: ; 2063
; send out a handshake while serial int is off
ld a, [$c2d4]
@@ -2448,147 +515,9 @@
; 208a
-ResetGameTime: ; 208a
- xor a
- ld [GameTimeCap], a
- ld [GameTimeHours], a
- ld [GameTimeHours + 1], a
- ld [GameTimeMinutes], a
- ld [GameTimeSeconds], a
- ld [GameTimeFrames], a
- ret
-; 209e
+INCLUDE "engine/game_time.asm"
-GameTimer: ; 209e
-; precautionary
- nop
-
-; save wram bank
- ld a, [rSVBK]
- push af
-
- ld a, $1
- ld [rSVBK], a
-
- call UpdateGameTimer
-
-; restore wram bank
- pop af
- ld [rSVBK], a
- ret
-; 20ad
-
-
-UpdateGameTimer: ; 20ad
-; increment the game timer by one frame
-; capped at 999:59:59.00 after exactly 1000 hours
-
-; pause game update?
- ld a, [$c2cd]
- and a
- ret nz
-
-; game timer paused?
- ld hl, GameTimerPause
- bit 0, [hl]
- ret z
-
-; reached cap? (999:00:00.00)
- ld hl, GameTimeCap
- bit 0, [hl]
- ret nz
-
-; increment frame counter
- ld hl, GameTimeFrames ; frame counter
- ld a, [hl]
- inc a
-
-; reached 1 second?
- cp 60 ; frames/second
- jr nc, .second ; 20c5 $2
-
-; update frame counter
- ld [hl], a
- ret
-
-.second
-; reset frame counter
- xor a
- ld [hl], a
-
-; increment second counter
- ld hl, GameTimeSeconds
- ld a, [hl]
- inc a
-
-; reached 1 minute?
- cp 60 ; seconds/minute
- jr nc, .minute
-
-; update second counter
- ld [hl], a
- ret
-
-.minute
-; reset second counter
- xor a
- ld [hl], a
-
-; increment minute counter
- ld hl, GameTimeMinutes
- ld a, [hl]
- inc a
-
-; reached 1 hour?
- cp 60 ; minutes/hour
- jr nc, .hour
-
-; update minute counter
- ld [hl], a
- ret
-
-.hour
-; reset minute counter
- xor a
- ld [hl], a
-
-; increment hour counter
- ld a, [GameTimeHours]
- ld h, a
- ld a, [GameTimeHours+1]
- ld l, a
- inc hl
-
-; reached 1000 hours?
- ld a, h
- cp $3 ; 1000 / $100
- jr c, .updatehr
-
- ld a, l
- cp $e8 ; 1000 & $ff
- jr c, .updatehr
-
-; cap at 999:59:59.00
- ld hl, GameTimeCap
- set 0, [hl] ; stop timer
-
- ld a, 59
- ld [GameTimeMinutes], a
- ld [GameTimeSeconds], a
-
-; this will never be run again
- ret
-
-.updatehr
- ld a, h
- ld [GameTimeHours], a
- ld a, l
- ld [GameTimeHours+1], a
- ret
-; 210f
-
-
Function210f: ; 210f
ld hl, $c7e8
ld bc, $0018
@@ -2685,7 +614,7 @@
Function217a: ; 217a
ld a, [hROMBank]
push af
- ld a, [TileSetBlocksBank]
+ ld a, [TilesetBlocksBank]
rst Bankswitch
call Function2198
@@ -2733,31 +662,14 @@
add hl, hl
add hl, hl
add hl, hl
- ld a, [TileSetBlocksAddress]
+ ld a, [TilesetBlocksAddress]
add l
ld l, a
- ld a, [$d1de]
+ ld a, [TilesetBlocksAddress + 1]
adc h
ld h, a
- ld a, [hli]
- ld [de], a
- inc de
- ld a, [hli]
- ld [de], a
- inc de
- ld a, [hli]
- ld [de], a
- inc de
- ld a, [hli]
- ld [de], a
- inc de
- ld a, e
- add $14
- ld e, a
- jr nc, .asm_21d8
- inc d
-.asm_21d8
+rept 3
ld a, [hli]
ld [de], a
inc de
@@ -2770,32 +682,15 @@
ld a, [hli]
ld [de], a
inc de
- ld a, e
- add $14
- ld e, a
- jr nc, .asm_21eb
- inc d
-.asm_21eb
- ld a, [hli]
- ld [de], a
- inc de
- ld a, [hli]
- ld [de], a
- inc de
- ld a, [hli]
- ld [de], a
- inc de
- ld a, [hli]
- ld [de], a
- inc de
ld a, e
- add $14
+ add 20
ld e, a
- jr nc, .asm_21fe
+ jr nc, .next\@
inc d
+.next\@
+endr
-.asm_21fe
ld a, [hli]
ld [de], a
inc de
@@ -2808,6 +703,7 @@
ld a, [hli]
ld [de], a
inc de
+
pop hl
ld de, $0004
add hl, de
@@ -2835,9 +731,7 @@
Function222a: ; 222a
ld a, $fa
ld [$ff9f], a
- ld a, $5
- ld hl, $5363
- rst FarCall
+ callba Function15363
xor a
ld [$ff9f], a
ret
@@ -2847,9 +741,7 @@
call Function2252
ret nc
push bc
- ld a, $5
- ld hl, $49af
- rst FarCall
+ callba Function149af
pop bc
ret nc
call Function22a7
@@ -2867,18 +759,18 @@
; 2252
Function2252: ; 2252
- ld a, $5
- ld hl, $499a
- rst FarCall
+ callba Function1499a
ret nc
+
ld a, [hROMBank]
push af
+
call Function2c52
call Function2266
+
pop de
ld a, d
rst Bankswitch
-
ret
; 2266
@@ -2943,11 +835,12 @@
Function22a7: ; 22a7
ld a, [hROMBank]
push af
+
call Function2c52
call Function22b4
+
pop af
rst Bankswitch
-
scf
ret
; 22b4
@@ -3007,16 +900,16 @@
ret
; 2300
-
Function2300: ; 2300
- cp $3
+ cp INDOOR
ret z
- cp $6
+ cp GATE
ret z
cp $5
ret
; 2309
+
Function2309: ; 2309
call Function2326
call Function2c52
@@ -3035,8 +928,6 @@
ret
; 2326
-
-
Function2326: ; 2326
call Function2c3d
call Function2c1c
@@ -3092,29 +983,31 @@
ld [SouthConnectedMapGroup], a
ld [WestConnectedMapGroup], a
ld [EastConnectedMapGroup], a
+
ld a, [$d1a8]
ld b, a
+
bit 3, b
jr z, .asm_2384
- ld de, NorthConnectedMapGroup
+ ld de, NorthMapConnection
call GetMapConnection
.asm_2384
bit 2, b
jr z, .asm_238e
- ld de, SouthConnectedMapGroup
+ ld de, SouthMapConnection
call GetMapConnection
.asm_238e
bit 1, b
jr z, .asm_2398
- ld de, WestConnectedMapGroup
+ ld de, WestMapConnection
call GetMapConnection
.asm_2398
bit 0, b
jr z, .asm_23a2
- ld de, EastConnectedMapGroup
+ ld de, EastMapConnection
call GetMapConnection
.asm_23a2
@@ -3122,7 +1015,6 @@
; 23a3
-
GetMapConnection: ; 23a3
; Load map connection struct at hl into de.
ld c, SouthMapConnection - NorthMapConnection
@@ -3584,6 +1476,7 @@
ret
; 261f
+
CallScript: ; 261f
; Call a script at a:hl.
@@ -3592,10 +1485,10 @@
ld [ScriptPos], a
ld a, h
ld [ScriptPos + 1], a
-
+
ld a, $ff
ld [ScriptRunning], a
-
+
scf
ret
; 2631
@@ -3614,7 +1507,8 @@
push af
call Function2c52
call Function2653
- jr nc, .asm_2650
+ jr nc, .done
+
call GetMapEventBank
ld b, a
ld d, h
@@ -3621,10 +1515,9 @@
ld e, l
call Function2674
-.asm_2650
+.done
pop af
rst Bankswitch
-
ret
; 2653
@@ -3685,7 +1578,7 @@
push hl
call SpeechTextBox
call Function2e31
- ld a, $1
+ ld a, 1
ld [hOAMUpdate], a
call Function321c
pop hl
@@ -3699,6 +1592,8 @@
; 26b7
Function26b7: ; 26b7
+; Call a:de.
+
ld [hBuffer], a
ld a, [hROMBank]
push af
@@ -3705,14 +1600,13 @@
ld a, [hBuffer]
rst Bankswitch
- call Function26c5
+ call .de
+
pop af
rst Bankswitch
-
ret
-; 26c5
-Function26c5: ; 26c5
+.de
push de
ret
; 26c7
@@ -3725,10 +1619,10 @@
ld a, c
call Function19e9
+
pop hl
ld a, h
rst Bankswitch
-
ret
; 26d4
@@ -3738,10 +1632,8 @@
push hl
push bc
-
ld a, [hROMBank]
push af
-
ld a, [ScriptBank]
rst Bankswitch
@@ -3761,7 +1653,6 @@
pop af
rst Bankswitch
ld a, b
-
pop bc
pop hl
ret
@@ -4006,11 +1897,11 @@
; 2821
Function2821: ; 2821
- ld hl, TileSetAddress
+ ld hl, TilesetAddress
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [TileSetBank]
+ ld a, [TilesetBank]
ld e, a
ld a, [rSVBK]
push af
@@ -4381,7 +2272,7 @@
ld h, $0
add hl, hl
add hl, hl
- ld a, [TileSetCollisionAddress]
+ ld a, [TilesetCollisionAddress]
ld c, a
ld a, [$d1e1]
ld b, a
@@ -4397,7 +2288,7 @@
inc hl
.asm_2a5c
- ld a, [TileSetCollisionBank]
+ ld a, [TilesetCollisionBank]
call GetFarByte
ret
@@ -4629,7 +2520,7 @@
ld b, $9
call GetSGBLayout
callba Function49409
- call Function485
+ call UpdateTimePals
call DelayFrame
ld a, $1
ld [$ffde], a
@@ -4985,7 +2876,7 @@
ld bc, $000f
ld a, [$d199]
call AddNTimes
- ld de, TileSetBank
+ ld de, TilesetBank
ld bc, $000f
ld a, $13
call FarCopyBytes
@@ -5015,131 +2906,59 @@
; 2d54
-FarCall_de: ; 2d54
-; Call a:de.
-; Preserves other registers.
+INCLUDE "engine/farcall.asm"
- ld [hBuffer], a
- ld a, [hROMBank]
- push af
- ld a, [hBuffer]
- rst Bankswitch
- call .de
- jr ReturnFarCall
-.de
- push de
- ret
-; 2d63
+Predef: ; 2d83
+; Call predefined function a.
+; Preserves bc, de, hl and f.
-
-FarCall_hl: ; 2d63
-; Call a:hl.
-; Preserves other registers.
-
- ld [hBuffer], a
+ ld [PredefID], a
ld a, [hROMBank]
push af
- ld a, [hBuffer]
+
+ ld a, BANK(GetPredefPointer)
rst Bankswitch
- call Function2d82
-; 2d6e
+ call GetPredefPointer ; stores hl in PredefTemp
-ReturnFarCall: ; 2d6e
-; We want to retain the contents of f.
-; To do this, we can pop to bc instead of af.
-
- ld a, b
- ld [$cfb9], a
- ld a, c
- ld [$cfba], a
-
-; Restore the working bank.
- pop bc
- ld a, b
+; Switch to the new function's bank
rst Bankswitch
-
- ld a, [$cfb9]
- ld b, a
- ld a, [$cfba]
- ld c, a
- ret
-; 2d82
-Function2d82: ; 2d82
- jp [hl]
-; 2d83
+; Instead of directly calling stuff,
+; push it to the stack in reverse.
-
-Predef: ; 2d83
-; call a function from given id a
-
-; relies on $cfb4-8
-
-; this function is somewhat unreadable at a glance
-; the execution flow is as follows:
-; save bank
-; get function from id
-; call function
-; restore bank
-; these are pushed to the stack in reverse
-
-; most of the $cfbx trickery is just juggling hl (which is preserved)
-; this allows hl, de and bc to be passed to the function
-
-; input:
-; a: id
-; parameters bc, de, hl
-
-; store id
- ld [$cfb4], a
-
-; save bank
- ld a, [hROMBank] ; current bank
- push af
-
-; get Predef function to call
-; GetPredefFn also stores hl in $cfb5-6
- ld a, BANK(GetPredefFn)
- rst Bankswitch
- call GetPredefFn
-; switch bank to Predef function
- rst Bankswitch
-
-; clean up after Predef call
- ld hl, .cleanup
+ ld hl, .Return
push hl
-; call Predef function from ret
- ld a, [$cfb7]
+; Call the Predef function
+ ld a, [PredefAddress]
ld h, a
- ld a, [$cfb8]
+ ld a, [PredefAddress + 1]
ld l, a
push hl
-
-; get hl back
- ld a, [$cfb5]
+
+; Get hl back
+ ld a, [PredefTemp]
ld h, a
- ld a, [$cfb6]
+ ld a, [PredefTemp + 1]
ld l, a
ret
-.cleanup
-; store hl
+.Return
+; Clean up after the Predef call
+
ld a, h
- ld [$cfb5], a
+ ld [PredefTemp], a
ld a, l
- ld [$cfb6], a
-
-; restore bank
- pop hl ; popping a pushed af. h = a (old bank)
+ ld [PredefTemp+1], a
+
+ pop hl
ld a, h
rst Bankswitch
-
-; get hl back
- ld a, [$cfb5]
+
+ ld a, [PredefTemp]
ld h, a
- ld a, [$cfb6]
+ ld a, [PredefTemp + 1]
ld l, a
ret
; 2dba
@@ -5254,7 +3073,7 @@
Function2e50: ; 2e50
xor a
- ld hl, $da72
+ ld hl, EventFlags
ld [hli], a
ret
; 2e56
@@ -6923,7 +4742,7 @@
Function3524: ; 3524
ld hl, VramState
bit 0, [hl]
- jp nz, Function485
+ jp nz, UpdateTimePals
jp Function32f9
; 352f
@@ -7206,7 +5025,7 @@
pop af
ld [$ffe0], a
ld a, b
- ld [CurFruit], a
+ ld [$d03f], a
ld a, c
ld [MartPointer], a
jr Function367e
@@ -7214,7 +5033,7 @@
Function3674: ; 3674
ld a, $1
- ld [CurFruit], a
+ ld [$d03f], a
ld a, $ff
ld [MartPointer], a
@@ -8250,16 +6069,19 @@
ld a, [hLCDStatCustom]
and a
ret z
- ld a, $0
- ld [$cf68], a
+
+ ld a, $00
+ ld [Requested2bppSource], a
ld a, $d2
- ld [$cf69], a
- ld a, $0
- ld [$cf6a], a
+ ld [Requested2bppSource + 1], a
+
+ ld a, $00
+ ld [Requested2bppDest], a
ld a, $d1
- ld [$cf6b], a
+ ld [Requested2bppDest + 1], a
+
ld a, $9
- ld [$cf67], a
+ ld [Requested2bpp], a
ret
; 3b2a
@@ -9239,7 +7061,7 @@
; 403f
PushOAM: ; 403f
- ld a, $c4
+ ld a, Sprites >> 8
ld [rDMA], a
ld a, $28
.loop
@@ -11176,7 +8998,7 @@
inc [hl]
ld a, [hl]
ld d, $60
- call Function1b11
+ call Sine
ld a, h
sub $60
ld hl, $001a
@@ -11249,7 +9071,7 @@
inc [hl]
ld a, [hl]
ld d, $60
- call Function1b11
+ call Sine
ld a, h
sub $60
ld hl, $001a
@@ -11340,7 +9162,7 @@
inc [hl]
ld a, [hl]
ld d, $60
- call Function1b11
+ call Sine
ld a, h
sub $60
ld hl, $001a
@@ -12514,7 +10336,7 @@
.asm_57c4
ld a, $0
- ld [$d4e1], a
+ ld [PlayerAction], a
ret
; 57ca
@@ -14196,7 +12018,7 @@
ld [hWY], a
ld b, $8
call GetSGBLayout
- call Function485
+ call UpdateTimePals
ld a, [$cf64]
cp $5
jr c, .asm_625e
@@ -14294,7 +12116,7 @@
; Lay out a base (all lines scrolling together).
ld e, a
- ld hl, $d100
+ ld hl, LYOverrides
ld bc, 8 * 10 ; logo height
call ByteFill
@@ -16746,7 +14568,7 @@
call Function1b1e
ld a, $3e
call Function1b3f
- ld a, [CurFruit]
+ ld a, [$d03f]
dec a
jr z, Function833b
ld a, [$ffe0]
@@ -17069,17 +14891,22 @@
ret
; 84d9
-Function84d9: ; 84d9
+_Sine: ; 84d9
+; A simple sine function.
+; Return d * sin(e) in hl.
+
+; e is a signed 6-bit value.
ld a, e
- and $3f
- cp $20
- jr nc, .asm_84e5
+ and %111111
+ cp %100000
+ jr nc, .negative
+
call Function84ef
ld a, h
ret
-.asm_84e5
- and $1f
+.negative
+ and %011111
call Function84ef
ld a, h
xor $ff
@@ -17091,7 +14918,7 @@
ld e, a
ld a, d
ld d, 0
- ld hl, $450b
+ ld hl, SineWave
add hl, de
add hl, de
ld e, [hl]
@@ -17098,55 +14925,56 @@
inc hl
ld d, [hl]
ld hl, 0
-.asm_84fe
+
+; Factor amplitude
+.multiply
srl a
- jr nc, .asm_8503
+ jr nc, .even
add hl, de
-
-.asm_8503
+.even
sla e
rl d
and a
- jr nz, .asm_84fe
+ jr nz, .multiply
ret
; 850b
-INCBIN "baserom.gbc", $850b, $854b - $850b
+SineWave: ; 850b
+; A $20-word table representing a sine wave.
+; 90 degrees is index $10 at a base amplitude of $100.
+x set 0
+ rept $20
+ dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up
+x set x + $100 * $40000
+ endr
+; 854b
-GetPredefFn: ; 854b
-; input:
-; [$cfb4] id
+GetPredefPointer: ; 854b
+; Return the bank and address of PredefID in a and PredefAddress.
-; save hl for later
+; Save hl for later (back in Predef)
ld a, h
- ld [$cfb5], a
+ ld [PredefTemp], a
ld a, l
- ld [$cfb6], a
-
+ ld [PredefTemp + 1], a
+
push de
-
-; get id
- ld a, [$cfb4]
+ ld a, [PredefID]
ld e, a
- ld d, $0
+ ld d, 0
ld hl, PredefPointers
-; seek
add hl, de
add hl, de
add hl, de
-
pop de
-
-; store address in [$cfb7-8]
-; addr lo
+
ld a, [hli]
- ld [$cfb8], a
-; addr hi
+ ld [PredefAddress + 1], a
ld a, [hli]
- ld [$cfb7], a
-; get bank
+ ld [PredefAddress], a
ld a, [hl]
+
ret
; 856b
@@ -17155,7 +14983,7 @@
; address, bank
dwb Function6508, BANK(Function6508)
- dwb $747a, $01
+ dwb Function747a, BANK(Function747a)
dwb $4658, $03
dwb $57c1, $13 ; Flag, BANK(Flag)
dwb $4699, $03
@@ -17168,8 +14996,8 @@
dwb $46e0, $03
dwb Functione167, BANK(Functione167)
dwb Functione17b, BANK(Functione17b)
- dwb $5639, $04
- dwb $566a, $04
+ dwb CanLearnTMHMMove, BANK(CanLearnTMHMMove)
+ dwb GetTMHMMove, BANK(GetTMHMMove)
dwb $4eef, $0a
dwb $4b3e, $0b ; PrintMoveDescription, BANK(PrintMoveDescription)
dwb Function3df48, BANK(Function3df48) ; UpdatePlayerHUD
@@ -17185,7 +15013,7 @@
dwb $61e6, $10
dwb $4f63, $0a
dwb $4f24, $0a
- dwb $484a, $14
+ dwb Function5084a, BANK(Function5084a)
dwb $4d6f, $14
dwb $4d2e, $14
dwb $4cdb, $14
@@ -17199,11 +15027,11 @@
dwb PrintMoveType, BANK(PrintMoveType)
dwb PrintType, BANK(PrintType)
dwb PrintMonTypes, BANK(PrintMonTypes)
- dwb $5040, $14 ; GetUnownLetter
+ dwb GetUnownLetter, BANK(GetUnownLetter)
dwb $7cdd, $32
dwb $40d5, $33
dwb $5853, $02
- dwb $464c, $02 ; LoadSGBLayout, BANK(LoadSGBLayout)
+ dwb Function864c, BANK(Function864c) ; LoadSGBLayout, BANK(LoadSGBLayout)
dwb $5d11, $24
dwb CheckContestMon, BANK(CheckContestMon)
dwb Function8c20f, BANK(Function8c20f)
@@ -17221,7 +15049,7 @@
dwb DecompressPredef, BANK(DecompressPredef)
dwb Function0x347d3, BANK(Function0x347d3)
dwb $7908, $3e
- dwb $7877, $3e
+ dwb Functionfb877, BANK(Functionfb877)
dwb $4000, $34
dwb Function50d0a, BANK(Function50d0a)
dwb $40a3, $34
@@ -17266,57 +15094,82 @@
; 8a68
-CheckShininess: ; 0x8a68
-; given a pointer to Attack/Defense DV in bc, determine if monster is shiny.
-; if shiny, set carry.
- ld l,c
- ld h,b
- ld a,[hl]
- and a,%00100000 ; is attack DV xx1x?
- jr z,.NotShiny
- ld a,[hli]
- and a,%1111
- cp $A ; is defense DV 1010?
- jr nz,.NotShiny
- ld a,[hl]
- and a,%11110000
- cp $A0 ; is speed DV 1010?
- jr nz,.NotShiny
- ld a,[hl]
- and a,%1111
- cp $A ; is special DV 1010?
- jr nz,.NotShiny
+CheckShininess: ; 8a68
+; Check if a mon is shiny by DVs at bc.
+; Return carry if shiny.
+
+ ld l, c
+ ld h, b
+
+; Attack
+ ld a, [hl]
+ and %0010 << 4
+ jr z, .NotShiny
+
+; Defense
+ ld a, [hli]
+ and %1111
+ cp %1010
+ jr nz, .NotShiny
+
+; Speed
+ ld a, [hl]
+ and %1111 << 4
+ cp %1010 << 4
+ jr nz, .NotShiny
+
+; Special
+ ld a, [hl]
+ and %1111
+ cp %1010
+ jr nz, .NotShiny
+
+.Shiny
scf
ret
+
.NotShiny
- and a ; clear carry flag
+ and a
ret
; 8a88
CheckContestMon: ; 8a88
+; Check a mon's DVs at hl in the bug catching contest.
+; Return shiny if its DVs are good enough to place in the contest.
+
+; Attack
ld a, [hl]
- cp $a0
- jr c, .asm_8aa2
+ cp 10 << 4
+ jr c, .Bad
+
+; Defense
ld a, [hli]
and $f
- cp $a
- jr c, .asm_8aa2
+ cp 10
+ jr c, .Bad
+
+; Speed
ld a, [hl]
- cp $a0
- jr c, .asm_8aa2
+ cp 10 << 4
+ jr c, .Bad
+
+; Special
ld a, [hl]
and $f
- cp $a
- jr c, .asm_8aa2
+ cp 10
+ jr c, .Bad
+
+.Good
scf
ret
-.asm_8aa2
+.Bad
and a
ret
; 8aa4
+
Function8aa4: ; 8aa4
push de
push bc
@@ -18218,184 +16071,253 @@
SpecialsPointers: ; c029
dbw BANK(Function97c28), Function97c28
- dbw $0a, $5ce8
- dbw $0a, $5d11
- dbw $0a, $5d92
- dbw $0a, $5e66
- dbw $0a, $5e82
- dbw $0a, $5efa
- dbw $0a, $5eee
- dbw $0a, $5c92
- dbw $0a, $5cf1
- dbw $0a, $5cfa
- dbw $0a, $5bfb
- dbw $0a, $5c7b
- dbw $0a, $5ec4
- dbw $0a, $5ed9
- dbw $0a, $5eaf
- dbw $0a, $5f47
- dbw $03, $42f6
- dbw $03, $4309
- dbw $41, $50b9
- dbw $03, $434a
- dbw $13, $59e5
- dbw $04, $7a12
- dbw $04, $7a31
- dbw $04, $75db
- dbw $3e, $7b32
- dbw $3e, $7cd2
- dbw $03, $4658
- dbw $05, $559a
- dbw $03, $42e7
- dbw $05, $66d6
- dbw $05, $672a
- dbw $05, $6936
- dbw $0b, $4547
- dbw $05, $6218
- dbw $23, $4c04
+ dbw BANK(Function29ce8), Function29ce8
+ dbw BANK(Function29d11), Function29d11
+ dbw BANK(Function29d92), Function29d92
+ dbw BANK(Function29e66), Function29e66
+ dbw BANK(Function29e82), Function29e82
+ dbw BANK(Function29efa), Function29efa
+ dbw BANK(Function29eee), Function29eee
+ dbw BANK(Function29c92), Function29c92
+ dbw BANK(Function29cf1), Function29cf1
+ dbw BANK(Function29cfa), Function29cfa
+ dbw BANK(Function29bfb), Function29bfb
+ dbw BANK(Function29c7b), Function29c7b
+ dbw BANK(Function29ec4), Function29ec4
+ dbw BANK(Function29ed9), Function29ed9
+ dbw BANK(Function29eaf), Function29eaf
+ dbw BANK(Function29f47), Function29f47
+ dbw BANK(Functionc2f6), Functionc2f6
+ dbw BANK(Functionc309), Functionc309
+ dbw BANK(Function1050b9), Function1050b9
+ dbw BANK(Functionc34a), Functionc34a
+ dbw BANK(Function4d9e5), Function4d9e5
+ dbw BANK(Function13a12), Function13a12
+ dbw BANK(Function13a31), Function13a31
+ dbw BANK(Function135db), Function135db
+ dbw BANK(Functionfbb32), Functionfbb32
+ dbw BANK(Functionfbcd2), Functionfbcd2
+ dbw BANK(Functionc658), Functionc658
+ dbw BANK(Function1559a), Function1559a
+ dbw BANK(Functionc2e7), Functionc2e7
+ dbw BANK(Function166d6), Function166d6
+ dbw BANK(Function1672a), Function1672a
+ dbw BANK(Function16936), Function16936
+ dbw BANK(Function2c547), Function2c547
+ dbw BANK(Function16218), Function16218
+ dbw BANK(Function8cc04), Function8cc04
dbw BANK(SpecialNameRival), SpecialNameRival
- dbw $24, $4913
- dbw $03, $42c0
- dbw $03, $42cd
- dbw $03, $4355
- dbw $03, $4360
- dbw $03, $4373
- dbw $03, $4380
- dbw $03, $438d
- dbw $03, $43db
+ dbw BANK(Function90913), Function90913
+ dbw BANK(Functionc2c0), Functionc2c0
+ dbw BANK(Functionc2cd), Functionc2cd
+ dbw BANK(Functionc355), Functionc355
+ dbw BANK(Functionc360), Functionc360
+ dbw BANK(Functionc373), Functionc373
+ dbw BANK(Functionc380), Functionc380
+ dbw BANK(Functionc38d), Functionc38d
+ dbw BANK(Functionc3db), Functionc3db
dbw BANK(Function8c084), Function8c084
- dbw $23, $4092
- dbw $23, $40b6
+ dbw BANK(Function8c092), Function8c092
+ dbw BANK(Function8c0b6), Function8c0b6
dbw BANK(Function8c079), Function8c079
- dbw $23, $40ab
+ dbw BANK(Function8c0ab), Function8c0ab
dbw BANK(Functiond91), Functiond91
dbw BANK(WhiteBGMap), WhiteBGMap
- dbw BANK(Function485), Function485
+ dbw BANK(UpdateTimePals), UpdateTimePals
dbw BANK(ClearTileMap), ClearTileMap
dbw BANK(Function1ad2), Function1ad2
dbw BANK(Functione4a), Functione4a
- dbw $03, $4230
- dbw $03, $4252
+ dbw BANK(Functionc230), Functionc230
+ dbw BANK(Functionc252), Functionc252
dbw BANK(WaitSFX),WaitSFX
dbw BANK(Function3cdf), Function3cdf
dbw BANK(Function3d47), Function3d47
- dbw $04, $6324
- dbw $02, $4379
- dbw $03, $425a
- dbw $03, $4268
- dbw $03, $4276
- dbw $03, $4284
- dbw $03, $43ef
- dbw $05, $7421
- dbw $05, $7440
- dbw $04, $79a8
- dbw $03, $43fc
- dbw $09, $6feb
- dbw $09, $7043
+ dbw BANK(Function12324), Function12324
+ dbw BANK(Function8379), Function8379
+ dbw BANK(Functionc25a), Functionc25a
+ dbw BANK(Functionc268), Functionc268
+ dbw BANK(Functionc276), Functionc276
+ dbw BANK(Functionc284), Functionc284
+ dbw BANK(Functionc3ef), Functionc3ef
+ dbw BANK(Function17421), Function17421
+ dbw BANK(Function17440), Function17440
+ dbw BANK(Function139a8), Function139a8
+ dbw BANK(Functionc3fc), Functionc3fc
+ dbw BANK(Function26feb), Function26feb
+ dbw BANK(Function27043), Function27043
dbw BANK(SpecialGiveShuckle), SpecialGiveShuckle
dbw BANK(SpecialReturnShuckle), SpecialReturnShuckle
- dbw $01, $73f7
+ dbw BANK(Function73f7), Function73f7
dbw BANK(SpecialCheckPokerus),SpecialCheckPokerus
dbw BANK(Function24b25), Function24b25
- dbw $09, $4b4e
+ dbw BANK(Function24b4e), Function24b4e
dbw BANK(Function24ae8), Function24ae8
- dbw $13, $587a
- dbw $03, $4434
- dbw $03, $4422
- dbw $13, $59d3
- dbw $22, $4018
- dbw $03, $42b9
- dbw $03, $42da
- dbw $01, $718d
- dbw $01, $71ac
- dbw $0a, $64ab
- dbw $0a, $651f
- dbw $0a, $6567
+ dbw BANK(Function4d87a), Function4d87a
+ dbw BANK(Functionc434), Functionc434
+ dbw BANK(Functionc422), Functionc422
+ dbw BANK(Function4d9d3), Function4d9d3
+ dbw BANK(Function88018), Function88018
+ dbw BANK(Functionc2b9), Functionc2b9
+ dbw BANK(Functionc2da), Functionc2da
+ dbw BANK(Function718d), Function718d
+ dbw BANK(Function71ac), Function71ac
+ dbw BANK(Function2a4ab), Function2a4ab
+ dbw BANK(Function2a51f), Function2a51f
+ dbw BANK(Function2a567), Function2a567
dbw BANK(Function14209), Function14209
- dbw $3e, $7841
+ dbw BANK(Functionfb841), Functionfb841
dbw BANK(SpecialSnorlaxAwake),SpecialSnorlaxAwake
- dbw $01, $7413
- dbw $01, $7418
- dbw $01, $741d
- dbw $03, $4472
+ dbw BANK(Function7413), Function7413
+ dbw BANK(Function7418), Function7418
+ dbw BANK(Function741d), Function741d
+ dbw BANK(Functionc472), Functionc472
dbw BANK(ProfOaksPCBoot), ProfOaksPCBoot
dbw BANK(SpecialGameboyCheck),SpecialGameboyCheck
dbw BANK(SpecialTrainerHouse),SpecialTrainerHouse
- dbw $05, $6dc7
+ dbw BANK(Function16dc7), Function16dc7
dbw BANK(InitRoamMons), InitRoamMons
- dbw $03, $448f
- dbw $03, $449f
- dbw $03, $44ac
- dbw $46, $6c3e
- dbw $46, $7444
- dbw $46, $75e8
- dbw $46, $77e5
- dbw $46, $7879
- dbw $46, $7920
- dbw $46, $793b
- dbw $5c, $40b0
- dbw $5c, $40ba
- dbw $5c, $4114
- dbw $5c, $4215
- dbw $5c, $44e1
- dbw $5c, $421d
- dbw $5c, $4b44
- dbw $46, $7a38
- dbw $5c, $4bd3
- dbw $45, $7656
+ dbw BANK(Functionc48f), Functionc48f
+ dbw BANK(Functionc49f), Functionc49f
+ dbw BANK(Functionc4ac), Functionc4ac
+ dbw BANK(Function11ac3e), Function11ac3e
+ dbw BANK(Function11b444), Function11b444
+ dbw BANK(Function11b5e8), Function11b5e8
+ dbw BANK(Function11b7e5), Function11b7e5
+ dbw BANK(Function11b879), Function11b879
+ dbw BANK(Function11b920), Function11b920
+ dbw BANK(Function11b93b), Function11b93b
+ dbw BANK(Function1700b0), Function1700b0
+ dbw BANK(Function1700ba), Function1700ba
+ dbw BANK(Function170114), Function170114
+ dbw BANK(Function170215), Function170215
+ dbw BANK(Function1704e1), Function1704e1
+ dbw BANK(Function17021d), Function17021d
+ dbw BANK(Function170b44), Function170b44
+ dbw BANK(Function11ba38), Function11ba38
+ dbw BANK(Function170bd3), Function170bd3
+ dbw BANK(Function117656), Function117656
dbw BANK(Reset), Reset
- dbw $40, $51f1
- dbw $40, $5220
- dbw $40, $5225
- dbw $40, $5231
+ dbw BANK(Function1011f1), Function1011f1
+ dbw BANK(Function101220), Function101220
+ dbw BANK(Function101225), Function101225
+ dbw BANK(Function101231), Function101231
dbw BANK(Function4925b), Function4925b
- dbw $22, $6def
- dbw $47, $41ab
- dbw $5c, $4687
- dbw $22, $6e68
- dbw $5f, $5224
- dbw $5f, $52b6
- dbw $5f, $52ce
- dbw $5f, $753d
- dbw $40, $7612
+ dbw BANK(Function8adef), Function8adef
+ dbw BANK(Function11c1ab), Function11c1ab
+ dbw BANK(Function170687), Function170687
+ dbw BANK(Function8ae68), Function8ae68
+ dbw BANK(Function17d224), Function17d224
+ dbw BANK(Function17d2b6), Function17d2b6
+ dbw BANK(Function17d2ce), Function17d2ce
+ dbw BANK(Function17f53d), Function17f53d
+ dbw BANK(Function103612), Function103612
dbw BANK(SpecialHoOhChamber),SpecialHoOhChamber
- dbw $40, $6142
- dbw $12, $589a
- dbw $12, $5bf9
- dbw $13, $70bc
- dbw $22, $6f6b
- dbw $22, $6fd4
+ dbw BANK(Function102142), Function102142
+ dbw BANK(Function4989a), Function4989a
+ dbw BANK(Function49bf9), Function49bf9
+ dbw BANK(Function4f0bc), Function4f0bc
+ dbw BANK(Function8af6b), Function8af6b
+ dbw BANK(Function8afd4), Function8afd4
dbw BANK(SpecialDratini),SpecialDratini
- dbw $04, $5485
+ dbw BANK(Function11485), Function11485
dbw BANK(SpecialBeastsCheck),SpecialBeastsCheck
dbw BANK(SpecialMonCheck),SpecialMonCheck
- dbw $03, $4225
- dbw $5c, $4bd2
- dbw $40, $766e
- dbw $40, $77eb
- dbw $40, $783c
- dbw $41, $60a2
+ dbw BANK(Functionc225), Functionc225
+ dbw BANK(Function170bd2), Function170bd2
+ dbw BANK(Function10366e), Function10366e
+ dbw BANK(Function1037eb), Function1037eb
+ dbw BANK(Function10383c), Function10383c
+ dbw BANK(Function1060a2), Function1060a2
dbw BANK(Function14168), Function14168
- dbw $40, $77c2
- dbw $41, $630f
- dbw $40, $7780
- dbw $40, $787b
- dbw $12, $6e12
- dbw $41, $47eb
- dbw $12, $6927
- dbw $24, $4a54
- dbw $24, $4a88
- dbw $03, $4224
+ dbw BANK(Function1037c2), Function1037c2
+ dbw BANK(Function10630f), Function10630f
+ dbw BANK(Function103780), Function103780
+ dbw BANK(Function10387b), Function10387b
+ dbw BANK(Function4ae12), Function4ae12
+ dbw BANK(Function1047eb), Function1047eb
+ dbw BANK(Function4a927), Function4a927
+ dbw BANK(Function90a54), Function90a54
+ dbw BANK(Function90a88), Function90a88
+ dbw BANK(Functionc224), Functionc224
; c224
-INCBIN "baserom.gbc", $c224, $c29d - $c224
+Functionc224: ; c224
+ ret
+; c225
+Functionc225: ; c225
+ ld a, [ScriptVar]
+ ld d, a
+ callba Function57e2
+ ret
+; c230
+
+Functionc230: ; c230
+ ld a, [ScriptVar]
+ dec a
+ call CheckSeenMon
+ ret nz
+ ld a, [ScriptVar]
+ dec a
+ call SetSeenAndCaughtMon
+ call FadeToMenu
+ ld a, [ScriptVar]
+ ld [$d265], a
+ callba Functionfb877
+ call Function2b4d
+ ret
+; c252
+
+Functionc252: ; c252
+ ld a, [ScriptVar]
+ dec a
+ call SetCaughtMon
+ ret
+; c25a
+
+Functionc25a: ; c25a
+ ld a, [ScriptVar]
+ ld b, a
+ callba Function4dbd2
+ jr z, Functionc298
+ jr Functionc292
+
+Functionc268: ; c268
+ ld a, [ScriptVar]
+ ld b, a
+ callba Function4dbd9
+ jr z, Functionc298
+ jr Functionc292
+
+Functionc276: ; c276
+ ld a, [ScriptVar]
+ ld b, a
+ callba Function4dbe0
+ jr z, Functionc298
+ jr Functionc292
+
+Functionc284: ; c284
+ ld a, [ScriptVar]
+ ld b, a
+ callba Function4dbe6
+ jr z, Functionc298
+ jr Functionc292
+
+Functionc292: ; c292
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+
+Functionc298: ; c298
+ xor a
+ ld [ScriptVar], a
+ ret
+; c29d
+
SpecialNameRival: ; 0xc29d
ld b, $2 ; rival
ld de, RivalName
- ld a, BANK(Function116b7)
- ld hl, Function116b7
- rst $8
+ callba Function116b7
; default to "SILVER"
ld hl, RivalName
ld de, DefaultRivalName
@@ -18406,8 +16328,199 @@
DefaultRivalName: ; 0xc2b2
db "SILVER@"
-INCBIN "baserom.gbc", $c2b9, $c3e2 - $c2b9
+Functionc2b9: ; c2b9
+ callba Functionfb6ed
+ ret
+; c2c0
+Functionc2c0: ; c2c0
+ call FadeToMenu
+ callba Function9191c
+ call Function2b4d
+ ret
+; c2cd
+
+Functionc2cd: ; c2cd
+ call FadeToMenu
+ callba Function16be4
+ call Function2b4d
+ ret
+; c2da
+
+Functionc2da: ; c2da
+ call FadeToMenu
+ callba Function3f836
+ call Function2b4d
+ ret
+; c2e7
+
+Functionc2e7: ; c2e7
+ xor a
+ ld [ScriptVar], a
+ callba Function156d9
+ ld a, c
+ ld [ScriptVar], a
+ ret
+; c2f6
+
+Functionc2f6: ; c2f6
+ ld a, $0
+ call GetSRAMBank
+ ld a, [$abe2]
+ and a
+ jr z, .asm_c302
+ inc a
+
+.asm_c302
+ ld [ScriptVar], a
+ call CloseSRAM
+ ret
+; c309
+
+Functionc309: ; c309
+ ld a, $0
+ call GetSRAMBank
+ ld a, [$abe2]
+ ld [CurItem], a
+ ld a, $1
+ ld [$d10c], a
+ ld hl, NumItems
+ call Function2f66
+ jr nc, .asm_c33d
+ xor a
+ ld [$abe2], a
+ call CloseSRAM
+ ld a, [CurItem]
+ ld [$d265], a
+ call GetItemName
+ ld hl, UnknownText_0xc345
+ call PrintText
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+
+.asm_c33d
+ call CloseSRAM
+ xor a
+ ld [ScriptVar], a
+ ret
+; c345
+
+UnknownText_0xc345: ; 0xc345
+ ; received item
+ text_jump UnknownText_0x1bd3be, BANK(UnknownText_0x1bd3be)
+ db "@"
+; 0xc34a
+
+Functionc34a: ; c34a
+ callba Function1369d
+ ld a, b
+ ld [ScriptVar], a
+ ret
+; c355
+
+Functionc355: ; c355
+ ld a, [ScriptVar]
+ ld e, a
+ callba Function91a53
+ ret
+; c360
+
+Functionc360: ; c360
+ call FadeToMenu
+ callba Functione1190
+ ld a, [$d0ec]
+ ld [ScriptVar], a
+ call Function2b4d
+ ret
+; c373
+
+Functionc373: ; c373
+ call Functionc3ae
+ ret c
+ ld a, $24
+ ld hl, $66c7
+ call Functionc39a
+ ret
+; c380
+
+Functionc380: ; c380
+ call Functionc3ae
+ ret c
+ ld a, $38
+ ld hl, $40ee
+ call Functionc39a
+ ret
+; c38d
+
+Functionc38d: ; c38d
+ call Functionc3ae
+ ret c
+ ld a, $38
+ ld hl, $5e5b
+ call Functionc39a
+ ret
+; c39a
+
+Functionc39a: ; c39a
+ call Function31cf
+ call FadeToMenu
+ ld hl, $d0e8
+ ld a, [hli]
+ push af
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ pop af
+ rst FarCall
+ call Function2b4d
+ ret
+; c3ae
+
+Functionc3ae: ; c3ae
+ ld hl, Coins
+ ld a, [hli]
+ or [hl]
+ jr z, .asm_c3c4
+ ld a, $36
+ ld [CurItem], a
+ ld hl, NumItems
+ call PickUpItem
+ jr nc, .asm_c3c9
+ and a
+ ret
+
+.asm_c3c4
+ ld hl, UnknownText_0xc3d1
+ jr .asm_c3cc
+
+.asm_c3c9
+ ld hl, UnknownText_0xc3d6
+
+.asm_c3cc
+ call PrintText
+ scf
+ ret
+; c3d1
+
+UnknownText_0xc3d1: ; 0xc3d1
+ ; You have no coins.
+ text_jump UnknownText_0x1bd3d7, BANK(UnknownText_0x1bd3d7)
+ db "@"
+; 0xc3d6
+
+UnknownText_0xc3d6: ; 0xc3d6
+ ; You don't have a COIN CASE.
+ text_jump UnknownText_0x1bd3eb, BANK(UnknownText_0x1bd3eb)
+ db "@"
+; 0xc3db
+
+Functionc3db: ; c3db
+ call WhiteBGMap
+ call Function2879
+ ret
+; c3e2
+
ScriptReturnCarry: ; c3e2
jr c, .carry
xor a
@@ -18419,9 +16532,20 @@
ret
; c3ef
-INCBIN "baserom.gbc", $c3ef, $c403 - $c3ef
+Functionc3ef: ; c3ef
+ callba Function1150c
+ ld a, [$dc3a]
+ ld [ScriptVar], a
+ ret
+; c3fc
+Functionc3fc: ; c3fc
+ ld a, [ScriptVar]
+ ld [$dfce], a
+ ret
+; c403
+
Functionc403: ; c403
ld a, c
and a
@@ -18447,8 +16571,19 @@
jp ScriptReturnCarry
; c422
-INCBIN "baserom.gbc", $c422, $c43d - $c422
+Functionc422: ; c422
+ callba Function1152b
+ ld hl, $dc9d
+ res 0, [hl]
+ callba Function5d33
+ ret
+; c434
+Functionc434: ; c434
+ callba Function11542
+ jp ScriptReturnCarry
+; c43d
+
SpecialSnorlaxAwake: ; 0xc43d
; Check if the Poké Flute channel is playing, and if the player is standing
; next to Snorlax.
@@ -18498,7 +16633,10 @@
db $24, $09
db $ff
-INCBIN "baserom.gbc", $c472, $c478 - $c472
+Functionc472: ; c472
+ ld a, [CurPartySpecies]
+ jp Function37ce
+; c478
SpecialGameboyCheck: ; c478
; check cgb
@@ -18524,8 +16662,30 @@
ld [ScriptVar], a
ret
-INCBIN "baserom.gbc", $c48f, $c4b9 - $c48f
+Functionc48f: ; c48f
+ ld a, $0
+ ld [MusicFadeIDLo], a
+ ld a, $0
+ ld [MusicFadeIDHi], a
+ ld a, $2
+ ld [MusicFade], a
+ ret
+; c49f
+Functionc49f: ; c49f
+ call FadeToMenu
+ callba Function1dd702
+ call Function2b4d
+ ret
+; c4ac
+
+Functionc4ac: ; c4ac
+ call FadeToMenu
+ callba Function84688
+ call Function2b4d
+ ret
+; c4b9
+
SpecialTrainerHouse: ; 0xc4b9
ld a, 0
call GetSRAMBank
@@ -18742,9 +16902,58 @@
ret
; 0xc658
-INCBIN "baserom.gbc", $c658, $c6ea - $c658
+Functionc658: ; c658
+ xor a
+ ld [CurPartyMon], a
+ ld hl, PartySpecies
+.asm_c65f
+ ld a, [hli]
+ cp $ff
+ jr z, .asm_c676
+ cp $fd
+ jr z, .asm_c66d
+ push hl
+ call Functionc677
+ pop hl
+.asm_c66d
+ ld a, [CurPartyMon]
+ inc a
+ ld [CurPartyMon], a
+ jr .asm_c65f
+.asm_c676
+ ret
+; c677
+
+Functionc677: ; c677
+ ld a, $0
+ call GetPartyParamLocation
+ ld d, h
+ ld e, l
+ ld hl, $0020
+ add hl, de
+ xor a
+ ld [hli], a
+ ld [hl], a
+ ld hl, $0024
+ add hl, de
+ ld b, h
+ ld c, l
+ dec bc
+ dec bc
+ ld a, [hli]
+ ld [bc], a
+ inc bc
+ ld a, [hl]
+ ld [bc], a
+ callba Functionf8b9
+ ret
+; c699
+
+INCBIN "baserom.gbc", $c699, $c6ea - $c699
+
+
Functionc6ea: ; c6ea
xor a
ld hl, MagikarpLength
@@ -21238,9 +19447,181 @@
; dd21
-INCBIN "baserom.gbc", $dd21, $de6e - $dd21
+Functiondd21: ; dd21
+ ld a, [BreedMon1Species]
+ ld [CurPartySpecies], a
+ ld de, $0022
+ call StartSFX
+ call WaitSFX
+ call Functione698
+ ld a, b
+ ld [DefaultFlypoint], a
+ ld a, e
+ ld [CurPartyLevel], a
+ xor a
+ ld [$d10b], a
+ jp Functiondd64
+; dd42
+Functiondd42: ; dd42
+ ld a, [BreedMon2Species]
+ ld [CurPartySpecies], a
+ ld de, $0022
+ call StartSFX
+ call WaitSFX
+ call Functione6b3
+ ld a, b
+ ld [DefaultFlypoint], a
+ ld a, e
+ ld [CurPartyLevel], a
+ ld a, $1
+ ld [$d10b], a
+ jp Functiondd64
+; dd64
+Functiondd64: ; dd64
+ ld hl, PartyCount
+ ld a, [hl]
+ cp $6
+ jr nz, .asm_dd6e
+ scf
+ ret
+
+.asm_dd6e
+ inc a
+ ld [hl], a
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [$d10b]
+ and a
+ ld a, [BreedMon1Species]
+ ld de, BreedMon1Nick
+ jr z, .asm_dd86
+ ld a, [BreedMon2Species]
+ ld de, BreedMon2Nick
+
+.asm_dd86
+ ld [hli], a
+ ld [CurSpecies], a
+ ld a, $ff
+ ld [hl], a
+ ld hl, PartyMon1Nickname
+ ld a, [PartyCount]
+ dec a
+ call SkipNames
+ push hl
+ ld h, d
+ ld l, e
+ pop de
+ call CopyBytes
+ push hl
+ ld hl, PartyMon1OT
+ ld a, [PartyCount]
+ dec a
+ call SkipNames
+ ld d, h
+ ld e, l
+ pop hl
+ call CopyBytes
+ push hl
+ call Functionde1a
+ pop hl
+ ld bc, $0020
+ call CopyBytes
+ call GetBaseData
+ call Functionde1a
+ ld b, d
+ ld c, e
+ ld hl, $001f
+ add hl, bc
+ ld a, [CurPartyLevel]
+ ld [hl], a
+ ld hl, $0024
+ add hl, bc
+ ld d, h
+ ld e, l
+ ld hl, $000a
+ add hl, bc
+ push bc
+ ld b, $1
+ call Functione167
+ ld hl, PartyMon1Move1
+ ld a, [PartyCount]
+ dec a
+ ld bc, $0030
+ call AddNTimes
+ ld d, h
+ ld e, l
+ ld a, $1
+ ld [Buffer1], a
+ ld a, $1b
+ call Predef
+ ld a, [PartyCount]
+ dec a
+ ld [CurPartyMon], a
+ callba Functionc677
+ ld a, [CurPartyLevel]
+ ld d, a
+ callab Function50e47
+ pop bc
+ ld hl, $0008
+ add hl, bc
+ ld a, [hMultiplicand]
+ ld [hli], a
+ ld a, [$ffb5]
+ ld [hli], a
+ ld a, [$ffb6]
+ ld [hl], a
+ and a
+ ret
+; de1a
+
+Functionde1a: ; de1a
+ ld a, [PartyCount]
+ dec a
+ ld hl, PartyMon1Species
+ ld bc, $0030
+ call AddNTimes
+ ld d, h
+ ld e, l
+ ret
+; de2a
+
+Functionde2a: ; de2a
+ ld de, BreedMon1Nick
+ call Functionde44
+ xor a
+ ld [$d10b], a
+ jp Functione039
+; de37
+
+Functionde37: ; de37
+ ld de, BreedMon2Nick
+ call Functionde44
+ xor a
+ ld [$d10b], a
+ jp Functione039
+; de44
+
+Functionde44: ; de44
+ ld a, [CurPartyMon]
+ ld hl, PartyMon1Nickname
+ call SkipNames
+ call CopyBytes
+ ld a, [CurPartyMon]
+ ld hl, PartyMon1OT
+ call SkipNames
+ call CopyBytes
+ ld a, [CurPartyMon]
+ ld hl, PartyMon1Species
+ ld bc, $0030
+ call AddNTimes
+ ld bc, $0020
+ jp CopyBytes
+; de6e
+
+
Functionde6e: ; de6e
ld a, 1 ; BANK(BoxCount)
call GetSRAMBank
@@ -21942,7 +20323,7 @@
and a
jr z, .asm_e2e1
ld a, [CurItem]
- ld [$ad27], a
+ ld [BoxMon1Item], a
.asm_e2e1
ld a, [CurPartySpecies]
@@ -22012,7 +20393,7 @@
.asm_e35e
ld a, $1
call GetSRAMBank
- ld de, $afa6
+ ld de, BoxMon1OT
.asm_e366
ld a, [ScriptBank]
call GetFarByte
@@ -22024,7 +20405,7 @@
ld a, [ScriptBank]
call GetFarByte
ld b, a
- ld hl, $ad2c
+ ld hl, BoxMon1ID
call Random
ld [hli], a
call Random
@@ -22071,7 +20452,7 @@
ld a, $1
call GetSRAMBank
ld hl, $d050
- ld de, $b082
+ ld de, BoxMon1Nickname
ld bc, $000b
call CopyBytes
call CloseSRAM
@@ -22166,7 +20547,7 @@
Functione5bb: ; e5bb
ld a, [CurPartyMon]
- ld hl, $ad26
+ ld hl, BoxMon1Species
ld bc, $0020
call AddNTimes
ld de, TempMonSpecies
@@ -22178,9 +20559,39 @@
ret
; e5d9
-INCBIN "baserom.gbc", $e5d9, $e6ce - $e5d9
+INCBIN "baserom.gbc", $e5d9, $e698 - $e5d9
+Functione698: ; e698
+ ld hl, BreedMon1Species
+ ld de, TempMonSpecies
+ ld bc, $0020
+ call CopyBytes
+ callab Function50e1b
+ ld a, [$df2b]
+ ld b, a
+ ld a, d
+ ld e, a
+ sub b
+ ld d, a
+ ret
+; e6b3
+Functione6b3: ; e6b3
+ ld hl, BreedMon2Species
+ ld de, TempMonSpecies
+ ld bc, $0020
+ call CopyBytes
+ callab Function50e1b
+ ld a, [$df64]
+ ld b, a
+ ld a, d
+ ld e, a
+ sub b
+ ld d, a
+ ret
+; e6ce
+
+
Functione6ce: ; e6ce
ld a, [$df9c]
and a
@@ -22596,7 +21007,41 @@
ret
; f8b9
-INCBIN "baserom.gbc", $f8b9, $f8ec - $f8b9
+Functionf8b9: ; f8b9
+ ld a, $17
+ call GetPartyParamLocation
+ push hl
+ ld a, $2
+ call GetPartyParamLocation
+ pop de
+ xor a
+ ld [$cfa9], a
+ ld [MonType], a
+ ld c, $4
+.asm_f8ce
+ ld a, [hli]
+ and a
+ ret z
+ push hl
+ push de
+ push bc
+ call Functionf8ec
+ pop bc
+ pop de
+ ld a, [de]
+ and $c0
+ ld b, a
+ ld a, [$d265]
+ add b
+ ld [de], a
+ inc de
+ ld hl, $cfa9
+ inc [hl]
+ pop hl
+ dec c
+ jr nz, .asm_f8ce
+ ret
+; f8ec
Functionf8ec: ; f8ec
@@ -23062,9 +21507,152 @@
ret
; 113e5
-INCBIN "baserom.gbc", $113e5, $114dd - $113e5
+Function113e5: ; 113e5
+ xor a
+ ld [$d464], a
+Function113e9: ; 113e9
+ ld a, [$d464]
+ cp 3
+ jr c, .asm_113f2
+ ld a, 3
+.asm_113f2
+ ld e, a
+ ld d, 0
+ ld hl, .data_113fd
+ add hl, de
+ ld a, [hl]
+ jp Function1142e
+; 113fd
+
+.data_113fd
+ db 20, 10, 5, 3
+; 11401
+
+Function11401: ; 11401
+ call Function1143c
+ ret nc
+ ld hl, $d464
+ ld a, [hl]
+ cp 3
+ jr nc, .asm_1140e
+ inc [hl]
+
+.asm_1140e
+ call Function113e9
+ scf
+ ret
+; 11413
+
+Function11413: ; 11413
+ ld a, 1
+
+Function11415: ; 11415
+ ld [hl], a
+ push hl
+ call UpdateTime
+ pop hl
+ inc hl
+ call Function11621
+ ret
+; 11420
+
+Function11420: ; 11420
+ inc hl
+ push hl
+ call Function115cf
+ call Function115c8
+ pop hl
+ dec hl
+ call Function11586
+ ret
+; 1142e
+
+Function1142e: ; 1142e
+ ld hl, $d465
+ ld [hl], a
+ call UpdateTime
+ ld hl, $d466
+ call Function1162e
+ ret
+; 1143c
+
+Function1143c: ; 1143c
+ ld hl, $d466
+ call Function115d6
+ call Function115ae
+ ld hl, $d465
+ call Function11586
+ ret
+; 1144c
+
+Function1144c: ; 1144c
+ ld hl, $dc1c
+ jp Function11413
+; 11452
+
+Function11452: ; 11452
+ ld hl, $dc1c
+ call Function11420
+ ret nc
+ xor a
+ ld hl, $dc1e
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hl], a
+ ld hl, $dc4c
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld hl, $dc50
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld hl, $dc54
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld hl, $dc58
+ ld a, [hl]
+ and a
+ jr z, .asm_11480
+ dec [hl]
+ jr nz, .asm_11483
+
+.asm_11480
+ call Function11485
+
+.asm_11483
+ jr Function1144c
+; 11485
+
+Function11485: ; 11485
+ call Random
+ and 3
+ add 3
+ ld [$dc58], a
+ ret
+; 11490
+
+Function11490: ; 11490
+ ld a, $14
+ ld [$d46c], a
+ ld a, $0
+ ld [$d46d], a
+ call UpdateTime
+ ld hl, $dc35
+ call Function11613
+ ret
+; 114a4
+
+INCBIN "baserom.gbc", $114a4, $114dd - $114a4
+
+
Function114dd: ; 114dd
call UpdateTime
ld hl, $dc23
@@ -23072,9 +21660,252 @@
ret
; 114e7
-INCBIN "baserom.gbc", $114e7, $11621 - $114e7
+Function114e7: ; 114e7
+ ld hl, $dc23
+ call Function115cf
+ call Function115c8
+ and a
+ jr z, .asm_114fa
+ ld b, a
+ callba Function13988
+.asm_114fa
+ xor a
+ ret
+; 114fc
+
+Function114fc: ; 114fc
+ ld a, $2
+ ld hl, $dc3a
+ ld [hl], a
+ call UpdateTime
+ ld hl, $dc3b
+ call Function11621
+ ret
+; 1150c
+
+Function1150c: ; 1150c
+ ld hl, $dc3b
+ call Function115cf
+ call Function115c8
+ ld hl, $dc3a
+ call Function11586
+ ret
+; 1151c
+
+Function1151c: ; 1151c
+ ld hl, $dc1e
+ set 2, [hl]
+ ret
+; 11522
+
+Function11522: ; 11522
+ and a
+ ld hl, $dc1e
+ bit 2, [hl]
+ ret nz
+ scf
+ ret
+; 1152b
+
+Function1152b: ; 1152b
+ call Function11534
+ ld hl, $dc2d
+ jp Function11415
+; 11534
+
+Function11534: ; 11534
+ call GetWeekday
+ ld c, a
+ ld a, $5
+ sub c
+ jr z, .asm_1153f
+ jr nc, .asm_11541
+
+.asm_1153f
+ add $7
+
+.asm_11541
+ ret
+; 11542
+
+Function11542: ; 11542
+ ld hl, $dc2d
+ jp Function11420
+; 11548
+
+Function11548: ; 11548
+ ld a, $0
+ call GetSRAMBank
+ ld hl, $abfa
+ ld a, [hli]
+ ld [Buffer1], a
+ ld a, [hl]
+ ld [Buffer2], a
+ call CloseSRAM
+ ld hl, Buffer1
+ call Function11420
+ jr nc, .asm_11572
+ ld hl, Buffer1
+ call Function11413
+ call CloseSRAM
+ callba Function1050c8
+
+.asm_11572
+ ld a, $0
+ call GetSRAMBank
+ ld hl, Buffer1
+ ld a, [hli]
+ ld [$abfa], a
+ ld a, [hl]
+ ld [$abfb], a
+ call CloseSRAM
+ ret
+; 11586
+
+Function11586: ; 11586
+ cp $ff
+ jr z, .asm_11595
+ ld c, a
+ ld a, [hl]
+ sub c
+ jr nc, .asm_11590
+ xor a
+
+.asm_11590
+ ld [hl], a
+ jr z, .asm_11595
+ xor a
+ ret
+
+.asm_11595
+ xor a
+ ld [hl], a
+ scf
+ ret
+; 11599
+
+Function11599: ; 11599
+ ld a, [$cfd7]
+ and a
+ jr nz, Function115cc
+ ld a, [$cfd6]
+ and a
+ jr nz, Function115cc
+ ld a, [$cfd5]
+ jr nz, Function115cc
+ ld a, [$cfd4]
+ ret
+; 115ae
+
+Function115ae: ; 115ae
+ ld a, [$cfd7]
+ and a
+ jr nz, Function115cc
+ ld a, [$cfd6]
+ and a
+ jr nz, Function115cc
+ ld a, [$cfd5]
+ ret
+; 115be
+
+Function115be: ; 115be
+ ld a, [$cfd7]
+ and a
+ jr nz, Function115cc
+ ld a, [$cfd6]
+ ret
+; 115c8
+
+Function115c8: ; 115c8
+ ld a, [$cfd7]
+ ret
+; 115cc
+
+Function115cc: ; 115cc
+ ld a, $ff
+ ret
+; 115cf
+
+Function115cf: ; 115cf
+ xor a
+ jr Function11605
+; 115d2
+
+Function115d2: ; 115d2
+ inc hl
+ xor a
+ jr Function115f8
+; 115d6
+
+Function115d6: ; 115d6
+ inc hl
+ inc hl
+ xor a
+ jr Function115eb
+; 115db
+
+Function115db: ; 115db
+ inc hl
+ inc hl
+ inc hl
+ ld a, [hSeconds]
+ ld c, a
+ sub [hl]
+ jr nc, .asm_115e6
+ add 60
+.asm_115e6
+ ld [hl], c
+ dec hl
+ ld [$cfd4], a
+
+Function115eb: ; 115eb
+ ld a, [hMinutes]
+ ld c, a
+ sbc [hl]
+ jr nc, .asm_115f3
+ add 60
+.asm_115f3
+ ld [hl], c
+ dec hl
+ ld [$cfd5], a
+
+Function115f8: ; 115f8
+ ld a, [hHours]
+ ld c, a
+ sbc [hl]
+ jr nc, .asm_11600
+ add 24
+.asm_11600
+ ld [hl], c
+ dec hl
+ ld [$cfd6], a
+
+Function11605
+ ld a, [CurDay]
+ ld c, a
+ sbc [hl]
+ jr nc, .asm_1160e
+ add 140
+.asm_1160e
+ ld [hl], c
+ ld [$cfd7], a
+ ret
+; 11613
+
+Function11613: ; 11613
+ ld a, [CurDay]
+ ld [hli], a
+ ld a, [hHours]
+ ld [hli], a
+ ld a, [hMinutes]
+ ld [hli], a
+ ld a, [hSeconds]
+ ld [hli], a
+ ret
+; 11621
+
Function11621: ; 11621
ld a, [CurDay]
ld [hl], a
@@ -23081,9 +21912,73 @@
ret
; 11626
-INCBIN "baserom.gbc", $11626, $1167a - $11626
+Function11626: ; 11626
+ ld a, [CurDay]
+ ld [hli], a
+ ld a, [hHours]
+ ld [hli], a
+ ret
+; 1162e
-TechnicalMachines: ; 0x1167a
+Function1162e: ; 1162e
+ ld a, [CurDay]
+ ld [hli], a
+ ld a, [hHours]
+ ld [hli], a
+ ld a, [hMinutes]
+ ld [hli], a
+ ret
+; 11639
+
+CanLearnTMHMMove: ; 11639
+ ld a, [CurPartySpecies]
+ ld [CurSpecies], a
+ call GetBaseData
+ ld hl, BaseTMHM
+ push hl
+
+ ld a, [$d262]
+ ld b, a
+ ld c, 0
+ ld hl, TMHMMoves
+.loop
+ ld a, [hli]
+ and a
+ jr z, .end
+ cp b
+ jr z, .asm_11659
+ inc c
+ jr .loop
+
+.asm_11659
+ pop hl
+ ld b, CHECK_FLAG
+ push de
+ ld d, 0
+ ld a, PREDEF_FLAG
+ call Predef
+ pop de
+ ret
+
+.end
+ pop hl
+ ld c, 0
+ ret
+; 1166a
+
+GetTMHMMove: ; 1166a
+ ld a, [$d265]
+ dec a
+ ld hl, TMHMMoves
+ ld b, 0
+ ld c, a
+ add hl, bc
+ ld a, [hl]
+ ld [$d265], a
+ ret
+; 1167a
+
+TMHMMoves: ; 1167a
db DYNAMICPUNCH
db HEADBUTT
db CURSE
@@ -23142,8 +22037,14 @@
db WHIRLPOOL
db WATERFALL
-INCBIN "baserom.gbc", $116b3, $116b7 - $116b3
+; Move tutor
+ db FLAMETHROWER
+ db THUNDERBOLT
+ db ICE_BEAM
+ db 0 ; end
+; 116b7
+
Function116b7: ; 0x116b7
call Function2ed3
call Function116c1
@@ -23460,8 +22361,230 @@
end
; 0x122ce
-INCBIN "baserom.gbc", $122ce, $124c8 - $122ce
+INCBIN "baserom.gbc", $122ce, $12324 - $122ce
+Function12324: ; 12324
+ ld a, [PartyCount]
+ and a
+ ret z
+ ld a, [ScriptVar]
+ ld [Buffer1], a
+ ld a, [rOBP1]
+ ld [Buffer2], a
+ call Function1233e
+ ld a, [Buffer2]
+ call Functiond24
+ ret
+; 1233e
+
+Function1233e: ; 1233e
+ xor a
+ ld [$d1ec], a
+.asm_12342
+ ld a, [Buffer1]
+ ld e, a
+ ld d, $0
+ ld hl, $6365
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, [$d1ec]
+ ld e, a
+ inc a
+ ld [$d1ec], a
+ add hl, de
+ ld a, [hl]
+ cp $5
+ jr z, .asm_12364
+ ld hl, $6377
+ rst JumpTable
+ jr .asm_12342
+
+.asm_12364
+ ret
+; 12365
+
+INCBIN "baserom.gbc", $12365, $12377 - $12365
+
+Table12377: ; 12377
+ dw Function12383
+ dw Function12393
+ dw Function123a1
+ dw Function123bf
+ dw Function123c8
+ dw Function123db
+; 12383
+
+Function12383: ; 12383
+ call Function12434
+ ld de, $63fc
+ ld hl, $87c0
+ ld bc, $0402
+ call Request2bpp
+ ret
+; 12393
+
+Function12393: ; 12393
+ ld hl, $c480
+ ld de, $63dc
+ call Function124a3
+ call Function124a3
+ jr Function123a7
+
+Function123a1: ; 123a1
+ ld hl, $c480
+ ld de, $641c
+
+Function123a7: ; 123a7
+ ld a, [PartyCount]
+ ld b, a
+.asm_123ab
+ call Function124a3
+ push de
+ ld de, $0012
+ call StartSFX
+ pop de
+ ld c, $1e
+ call DelayFrames
+ dec b
+ jr nz, .asm_123ab
+ ret
+; 123bf
+
+Function123bf: ; 123bf
+ ld de, $000d
+ call StartMusic
+ jp Function12459
+; 123c8
+
+Function123c8: ; 123c8
+ ld de, $00aa
+ call StartSFX
+ call Function12459
+ call WaitSFX
+ ld de, $000d
+ call StartSFX
+ ret
+; 123db
+
+Function123db: ; 123db
+ ret
+; 123dc
+
+INCBIN "baserom.gbc", $123dc, $12434 - $123dc
+
+Function12434: ; 12434
+ call Function3218
+ jr nz, .asm_1243e
+ ld a, $e0
+ ld [rOBP1], a
+ ret
+
+.asm_1243e
+ ld hl, $6451
+ ld de, CurMart
+ ld bc, $0008
+ ld a, $5
+ call Function306b
+ ld a, $1
+ ld [hCGBPalUpdate], a
+ ret
+; 12451
+
+INCBIN "baserom.gbc", $12451, $12459 - $12451
+
+Function12459: ; 12459
+ ld c, $8
+.asm_1245b
+ push bc
+ call Function12469
+ ld c, $a
+ call DelayFrames
+ pop bc
+ dec c
+ jr nz, .asm_1245b
+ ret
+; 12469
+
+Function12469: ; 12469
+ call Function3218
+ jr nz, .asm_12475
+ ld a, [rOBP1]
+ xor $28
+ ld [rOBP1], a
+ ret
+
+.asm_12475
+ ld a, [rSVBK]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ ld hl, CurMart
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ push de
+ ld c, $3
+.asm_12486
+ ld a, [hli]
+ ld e, a
+ ld a, [hld]
+ ld d, a
+ dec hl
+ ld a, d
+ ld [hld], a
+ ld a, e
+ ld [hli], a
+ inc hl
+ inc hl
+ inc hl
+ dec c
+ jr nz, .asm_12486
+ pop de
+ dec hl
+ ld a, d
+ ld [hld], a
+ ld a, e
+ ld [hl], a
+ pop af
+ ld [rSVBK], a
+ ld a, $1
+ ld [hCGBPalUpdate], a
+ ret
+; 124a3
+
+Function124a3: ; 124a3
+ push bc
+ ld a, [Buffer1]
+ ld bc, $1020
+ cp $1
+ jr z, .asm_124b1
+ ld bc, $0000
+
+.asm_124b1
+ ld a, [de]
+ add c
+ inc de
+ ld [hli], a
+ ld a, [de]
+ add b
+ inc de
+ ld [hli], a
+ ld a, [de]
+ inc de
+ ld [hli], a
+ ld a, [de]
+ inc de
+ ld [hli], a
+ pop bc
+ ret
+; 124c1
+
+INCBIN "baserom.gbc", $124c1, $124c8 - $124c1
+
UnknownScript_0x124c8: ; 0x124c8
refreshscreen $0
3callasm BANK(Function124fa), Function124fa
@@ -23592,12 +22715,12 @@
call Function2e20
callba Function64bf
call .DrawBugContestStatus
- call Function485
+ call UpdateTimePals
jr .Select
.Reopen
call Function1ad2
- call Function485
+ call UpdateTimePals
call .SetUpMenuItems
ld a, [$d0d2]
ld [$cf88], a
@@ -23645,7 +22768,7 @@
call Function1c07
.ReturnEnd2
call Function2dcf
- call Function485
+ call UpdateTimePals
ret
.GetInput
@@ -24926,8 +24049,65 @@
ret
; 12f5b
-INCBIN "baserom.gbc", $12f5b, $12fba - $12f5b
+Function12f5b: ; 12f5b
+ ld hl, Options
+ ld a, [hl]
+ push af
+ set 4, [hl]
+ call Functione58
+ call Function12f73
+ pop bc
+ ld a, b
+ ld [Options], a
+ push af
+ call WhiteBGMap
+ pop af
+ ret
+; 12f73
+Function12f73: ; 12f73
+ call Function13172
+ ld de, $6fb2
+ call Function1bb1
+ call Function131ef
+ ld hl, $cfa5
+ set 6, [hl]
+ jr Function12f93
+
+Function12f86: ; 12f86
+ call Function1bd3
+ bit 1, a
+ jp nz, Function12f9f
+ bit 0, a
+ jp nz, Function12f9c
+
+Function12f93: ; 12f93
+ call Function13235
+ call Function13256
+ jp Function12f86
+; 12f9c
+
+Function12f9c: ; 12f9c
+ and a
+ jr Function12fa0
+
+Function12f9f: ; 12f9f
+ scf
+
+Function12fa0: ; 12fa0
+ push af
+ xor a
+ ld [$d0e3], a
+ ld hl, $cfa5
+ res 6, [hl]
+ call ClearSprites
+ call ClearTileMap
+ pop af
+ ret
+; 12fb2
+
+INCBIN "baserom.gbc", $12fb2, $12fba - $12fb2
+
Function12fba: ; 12fba
ld a, [CurPartySpecies]
cp EGG
@@ -25275,7 +24455,7 @@
ld a, [CurSpecies]
ld b, a
ld hl, $c592
- ld a, $2a
+ ld a, PREDEF_PRINT_MOVE_TYPE
call Predef
ld a, [CurSpecies]
dec a
@@ -25591,7 +24771,7 @@
ld a, b
ld [EngineBuffer1], a
ld a, e
- ld [CurFruit], a
+ ld [$d03f], a
ld a, d
ld [MartPointer], a
call Function1345a
@@ -25601,7 +24781,7 @@
Function1345a: ; 1345a
ld de, CurMart
ld bc, $0004
- ld hl, CurFruit
+ ld hl, $d03f
ld a, [hli]
ld h, [hl]
ld l, a
@@ -25622,7 +24802,7 @@
; 1347d
Function1347d: ; 1347d
- ld hl, CurFruit
+ ld hl, $d03f
ld a, [hli]
ld h, [hl]
ld l, a
@@ -25673,7 +24853,7 @@
Function134c0: ; 134c0
push af
- ld hl, CurFruit
+ ld hl, $d03f
ld a, [hli]
ld h, [hl]
ld l, a
@@ -25831,7 +25011,14 @@
; 135db
-INCBIN "baserom.gbc", $135db, $135eb - $135db
+Function135db: ; 135db
+ xor a
+ ld [$df9c], a
+ ld a, $14
+ ld [$dc79], a
+ callba Function11490
+ ret
+; 135eb
UnknownScript_0x135eb: ; 0x135eb
writecode $3, $6
@@ -25907,9 +25094,461 @@
; 0x1369d
-INCBIN "baserom.gbc", $1369d, $13b87 - $1369d
+Function1369d: ; 1369d
+ call Function13900
+ callba Function105f79
+ call Function13819
+ ld a, [$d00a]
+ call Function13730
+ ld a, [$d00b]
+ ld [$d265], a
+ call GetPokemonName
+ ld hl, $7719
+ call PrintText
+ ld a, [EndFlypoint]
+ call Function13730
+ ld a, [MovementBuffer]
+ ld [$d265], a
+ call GetPokemonName
+ ld hl, $7702
+ call PrintText
+ ld a, [DefaultFlypoint]
+ call Function13730
+ ld a, [$d003]
+ ld [$d265], a
+ call GetPokemonName
+ ld hl, $76eb
+ call PrintText
+ jp Function13807
+; 136eb
+INCBIN "baserom.gbc", $136eb, $13730 - $136eb
+Function13730: ; 13730
+ dec a
+ jr z, .asm_13777
+ ld c, a
+ ld b, $0
+ ld hl, $7783
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, [hli]
+ ld c, a
+ push hl
+ push bc
+ callab Function3952d
+ ld hl, StringBuffer1
+ ld de, $d016
+ ld bc, $000d
+ call CopyBytes
+ ld hl, $d016
+.asm_13757
+ ld a, [hli]
+ cp $50
+ jr nz, .asm_13757
+ dec hl
+ ld [hl], $7f
+ inc hl
+ ld d, h
+ ld e, l
+ pop bc
+ pop hl
+ push de
+ ld a, [hl]
+ ld b, a
+ callab Function3994c
+ ld hl, StringBuffer1
+ pop de
+ ld bc, $000a
+ jp CopyBytes
+
+.asm_13777
+ ld hl, PlayerName
+ ld de, $d016
+ ld bc, $000b
+ jp CopyBytes
+; 13783
+
+INCBIN "baserom.gbc", $13783, $13807 - $13783
+
+Function13807: ; 13807
+ ld hl, $d00a
+ ld de, $fffc
+ ld b, $3
+.asm_1380f
+ ld a, [hl]
+ cp $1
+ jr z, .asm_13818
+ add hl, de
+ dec b
+ jr nz, .asm_1380f
+
+.asm_13818
+ ret
+; 13819
+
+Function13819: ; 13819
+ call Function13833
+ call Function138b0
+ ld hl, $d00e
+ ld a, $1
+ ld [hli], a
+ ld a, [$df9c]
+ ld [hli], a
+ ld a, [hProduct]
+ ld [hli], a
+ ld a, [hMultiplicand]
+ ld [hl], a
+ call Function1383e
+ ret
+; 13833
+
+Function13833: ; 13833
+ ld hl, DefaultFlypoint
+ ld b, $c
+ xor a
+.asm_13839
+ ld [hli], a
+ dec b
+ jr nz, .asm_13839
+ ret
+; 1383e
+
+Function1383e: ; 1383e
+ ld de, $d010
+ ld hl, $d004
+ ld c, $2
+ call StringCmp
+ jr c, .asm_1386b
+ ld hl, EndFlypoint
+ ld de, $d00a
+ ld bc, $0004
+ call CopyBytes
+ ld hl, DefaultFlypoint
+ ld de, EndFlypoint
+ ld bc, $0004
+ call CopyBytes
+ ld hl, DefaultFlypoint
+ call Function138a0
+ jr .asm_1389f
+
+.asm_1386b
+ ld de, $d010
+ ld hl, $d008
+ ld c, $2
+ call StringCmp
+ jr c, .asm_1388c
+ ld hl, EndFlypoint
+ ld de, $d00a
+ ld bc, $0004
+ call CopyBytes
+ ld hl, EndFlypoint
+ call Function138a0
+ jr .asm_1389f
+
+.asm_1388c
+ ld de, $d010
+ ld hl, $d00c
+ ld c, $2
+ call StringCmp
+ jr c, .asm_1389f
+ ld hl, $d00a
+ call Function138a0
+
+.asm_1389f
+ ret
+; 138a0
+
+Function138a0: ; 138a0
+ ld de, $d00e
+ ld a, [de]
+ inc de
+ ld [hli], a
+ ld a, [de]
+ inc de
+ ld [hli], a
+ ld a, [de]
+ inc de
+ ld [hli], a
+ ld a, [de]
+ inc de
+ ld [hl], a
+ ret
+; 138b0
+
+Function138b0: ; 138b0
+ ld e, $0
+.asm_138b2
+ push de
+ call Function139ed
+ pop de
+ jr nz, .asm_138f9
+ ld a, e
+ inc a
+ inc a
+ ld [$d00e], a
+ dec a
+ ld c, a
+ ld b, $0
+ ld hl, $7783
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ inc hl
+ inc hl
+.asm_138cd
+ call Random
+ and $3
+ cp $3
+ jr z, .asm_138cd
+ ld c, a
+ ld b, $0
+ add hl, bc
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld [$d00f], a
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ call Random
+ and $7
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, h
+ ld [$d010], a
+ ld a, l
+ ld [$d011], a
+ push de
+ call Function1383e
+ pop de
+
+.asm_138f9
+ inc e
+ ld a, e
+ cp $a
+ jr nz, .asm_138b2
+ ret
+; 13900
+
+Function13900: ; 13900
+ xor a
+ ld [hProduct], a
+ ld [hMultiplicand], a
+ ld a, [$df9c]
+ and a
+ jr z, .asm_1397e
+ ld a, [$dfc1]
+ call Function1397f
+ ld a, [$dfc1]
+ call Function1397f
+ ld a, [$dfc1]
+ call Function1397f
+ ld a, [$dfc1]
+ call Function1397f
+ ld a, [$dfc3]
+ call Function1397f
+ ld a, [$dfc5]
+ call Function1397f
+ ld a, [$dfc7]
+ call Function1397f
+ ld a, [$dfc9]
+ call Function1397f
+ ld a, [$dfcb]
+ call Function1397f
+ ld a, [$dfb1]
+ ld b, a
+ and $2
+ add a
+ add a
+ ld c, a
+ swap b
+ ld a, b
+ and $2
+ add a
+ add c
+ ld d, a
+ ld a, [$dfb2]
+ ld b, a
+ and $2
+ ld c, a
+ swap b
+ ld a, b
+ and $2
+ srl a
+ add c
+ add c
+ add d
+ add d
+ call Function1397f
+ ld a, [$dfbf]
+ srl a
+ srl a
+ srl a
+ call Function1397f
+ ld a, [$df9d]
+ and a
+ jr z, .asm_1397e
+ ld a, $1
+ call Function1397f
+
+.asm_1397e
+ ret
+; 1397f
+
+Function1397f: ; 1397f
+ ld hl, hMultiplicand
+ add [hl]
+ ld [hl], a
+ ret nc
+ dec hl
+ inc [hl]
+ ret
+; 13988
+
+Function13988: ; 13988
+ ld hl, PartyMon1PokerusStatus
+ ld a, [PartyCount]
+ and a
+ ret z
+ ld c, a
+.asm_13991
+ ld a, [hl]
+ and $f
+ jr z, .asm_139a0
+ sub b
+ jr nc, .asm_1399a
+ xor a
+
+.asm_1399a
+ ld d, a
+ ld a, [hl]
+ and $f0
+ add d
+ ld [hl], a
+
+.asm_139a0
+ ld de, PartyMon2 - PartyMon1
+ add hl, de
+ dec c
+ jr nz, .asm_13991
+ ret
+; 139a8
+
+Function139a8: ; 139a8
+ ld c, $a
+ ld hl, $79fe
+.asm_139ad
+ push bc
+ push hl
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ ld b, $0
+ call EventFlagAction
+ pop hl
+ inc hl
+ inc hl
+ pop bc
+ dec c
+ jr nz, .asm_139ad
+ ld c, $5
+.asm_139c0
+ push bc
+.asm_139c1
+ call Random
+ cp $fa
+ jr nc, .asm_139c1
+ ld c, $19
+ call SimpleDivide
+ ld e, b
+ ld d, $0
+ ld hl, $79fe
+ add hl, de
+ add hl, de
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ push de
+ ld b, $2
+ call EventFlagAction
+ pop de
+ ld a, c
+ and a
+ jr nz, .asm_139c1
+ ld b, $1
+ call EventFlagAction
+ pop bc
+ dec c
+ jr nz, .asm_139c0
+ ret
+; 139ed
+
+Function139ed: ; 139ed
+ ld hl, $79fe
+ ld e, a
+ ld d, $0
+ add hl, de
+ add hl, de
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ ld b, $2
+ call EventFlagAction
+ ret
+; 139fe
+
+INCBIN "baserom.gbc", $139fe, $13a12 - $139fe
+
+Function13a12: ; 13a12
+ ld hl, PartyMon1CurHP
+ ld a, [hli]
+ or [hl]
+ jr z, .asm_13a2b
+ ld hl, PartyCount
+ ld a, $1
+ ld [hli], a
+ inc hl
+ ld a, [hl]
+ ld [$df9b], a
+ ld [hl], $ff
+ xor a
+ ld [ScriptVar], a
+ ret
+
+.asm_13a2b
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+; 13a31
+
+Function13a31: ; 13a31
+ ld hl, $dcd9
+ ld a, [$df9b]
+ ld [hl], a
+ ld b, $1
+.asm_13a3a
+ ld a, [hli]
+ cp $ff
+ jr z, .asm_13a42
+ inc b
+ jr .asm_13a3a
+
+.asm_13a42
+ ld a, b
+ ld [PartyCount], a
+ ret
+; 13a47
+
+INCBIN "baserom.gbc", $13a47, $13b87 - $13a47
+
+
GetSquareRoot: ; 13b87
; Return the square root of de in b.
@@ -27655,9 +27294,51 @@
ret
; 14a1a
-INCBIN "baserom.gbc", $14a1a, $14b5f - $14a1a
+INCBIN "baserom.gbc", $14a1a, $14a58 - $14a1a
+Function14a58: ; 14a58
+ call Function14b54
+ callba Function14056
+ callba Function1050d9
+ call Function14df7
+ call Function14e13
+ call Function14e76
+ call Function14e8b
+ callba Function44725
+ callba Function1406a
+ call Function14b5a
+ ret
+; 14a83
+INCBIN "baserom.gbc", $14a83, $14ab2 - $14a83
+
+Function14ab2: ; 14ab2
+ call Function14b89
+ jr c, .asm_14ac1
+ call Function14b54
+ call Function14be3
+ call Function14b5a
+ and a
+
+.asm_14ac1
+ ret
+; 14ac2
+
+INCBIN "baserom.gbc", $14ac2, $14b54 - $14ac2
+
+Function14b54: ; 14b54
+ ld a, $1
+ ld [$c2cd], a
+ ret
+; 14b5a
+
+Function14b5a: ; 14b5a
+ xor a
+ ld [$c2cd], a
+ ret
+; 14b5f
+
+
Function14b5f: ; 14b5f
ld a, $1
call GetSRAMBank
@@ -27685,9 +27366,89 @@
ret
; 14b89
-INCBIN "baserom.gbc", $14b89, $14c10 - $14b89
+Function14b89: ; 14b89
+ ld a, [$cfcd]
+ and a
+ jr z, .asm_14ba8
+ call Function14bcb
+ jr z, .asm_14b9e
+ ld hl, $5297
+ call Function14baf
+ jr nz, .asm_14bad
+ jr .asm_14ba8
+.asm_14b9e
+ ld hl, $5292
+ call Function14baf
+ jr nz, .asm_14bad
+ jr .asm_14bab
+.asm_14ba8
+ call Function14cbb
+
+.asm_14bab
+ and a
+ ret
+
+.asm_14bad
+ scf
+ ret
+; 14baf
+
+Function14baf: ; 14baf
+ ld b, $5
+ call Function269a
+ call Function1d58
+ ld bc, $0007
+ call Function1dd2
+ ld a, [$cfa9]
+ dec a
+ call Function1c17
+ push af
+ call Functiond90
+ pop af
+ and a
+ ret
+; 14bcb
+
+Function14bcb: ; 14bcb
+ ld a, $1
+ call GetSRAMBank
+ ld hl, $a009
+ ld a, [hli]
+ ld c, [hl]
+ ld b, a
+ call CloseSRAM
+ ld a, [PlayerID]
+ cp b
+ ret nz
+ ld a, [$d47c]
+ cp c
+ ret
+; 14be3
+
+Function14be3: ; 14be3
+ call Function14c99
+ call Function14c10
+ ld c, $20
+ call DelayFrames
+ ld a, [Options]
+ push af
+ ld a, $3
+ ld [Options], a
+ ld hl, $528d
+ call PrintText
+ pop af
+ ld [Options], a
+ ld de, $0025
+ call WaitPlaySFX
+ call WaitSFX
+ ld c, $1e
+ call DelayFrames
+ ret
+; 14c10
+
+
Function14c10: ; 14c10
ld a, $1
ld [$cfcd], a
@@ -27768,7 +27529,24 @@
jr .asm_14c93
; 14c99
-INCBIN "baserom.gbc", $14c99, $14cbb - $14c99
+Function14c99: ; 14c99
+ xor a
+ ld [hJoypadReleased], a
+ ld [hJoypadPressed], a
+ ld [hJoypadSum], a
+ ld [hJoypadDown], a
+ ld a, [Options]
+ push af
+ ld a, $3
+ ld [Options], a
+ ld hl, $5288
+ call PrintText
+ pop af
+ ld [Options], a
+ ld c, $10
+ call DelayFrames
+ ret
+; 14cbb
Function14cbb: ; 14cbb
@@ -28072,9 +27850,22 @@
ret
; 14fd7
-INCBIN "baserom.gbc", $14fd7, $1509a - $14fd7
+INCBIN "baserom.gbc", $14fd7, $1500c - $14fd7
+Function1500c: ; 1500c
+ ld a, $1
+ call GetSRAMBank
+ ld hl, $a865
+ ld de, PartyCount
+ ld bc, $031e
+ call CopyBytes
+ call CloseSRAM
+ ret
+; 15021
+INCBIN "baserom.gbc", $15021, $1509a - $15021
+
+
Function1509a: ; 1509a
ld a, $1
call GetSRAMBank
@@ -28128,7 +27919,7 @@
push de
ld a, $1
call GetSRAMBank
- ld hl, $ad10
+ ld hl, BoxCount
ld de, EnemyMoveAnimation
ld bc, $01e0
call CopyBytes
@@ -28368,8 +28159,150 @@
jr .asm_1541d
; 15440
-INCBIN "baserom.gbc", $15440, $15736 - $15440
+INCBIN "baserom.gbc", $15440, $1559a - $15440
+Function1559a: ; 1559a
+ call Function15650
+ ret c
+ call Function156b3
+ ld hl, $5a27
+ call Function15a20
+ ld hl, $5a2c
+ call Function157bb
+ ld hl, $55d6
+ call LoadMenuDataHeader
+.asm_155b3
+ xor a
+ ld [hBGMapMode], a
+ call Function1563e
+ ld [$cf76], a
+ call Function1e5d
+ jr c, .asm_155cc
+ ld a, [MenuSelection]
+ ld hl, $55e6
+ call Function1fa7
+ jr nc, .asm_155b3
+
+.asm_155cc
+ call Function156b8
+ call Function1c07
+ call Function1c17
+ ret
+; 155d6
+
+INCBIN "baserom.gbc", $155d6, $1563e - $155d6
+
+Function1563e: ; 1563e
+ call Function2ead
+ jr nz, .asm_15646
+ ld a, $0
+ ret
+
+.asm_15646
+ ld a, [$d95e]
+ and a
+ ld a, $1
+ ret z
+ ld a, $2
+ ret
+; 15650
+
+Function15650: ; 15650
+ ld a, [PartyCount]
+ and a
+ ret nz
+ ld de, $000f
+ call StartSFX
+ ld hl, $5663
+ call Function15a20
+ scf
+ ret
+; 15663
+
+INCBIN "baserom.gbc", $15663, $156b3 - $15663
+
+Function156b3: ; 156b3
+ ld de, $000d
+ jr Function156d0
+
+Function156b8: ; 156b8
+ ld de, $000e
+ call Function156d0
+ call WaitSFX
+ ret
+
+Function156c1: ; 156c1
+ ld de, $000f
+ jr Function156d0
+
+Function156c6: ; 156c6
+ ld de, $0020
+ call Function156d0
+ ld de, $0020
+
+Function156d0: ; 156d0
+ push de
+ call WaitSFX
+ pop de
+ call StartSFX
+ ret
+; 156d9
+
+Function156d9: ; 156d9
+ call Function156b3
+ ld hl, $56ff
+ call Function15a20
+ ld b, $1
+ call Function15704
+ and a
+ jr nz, .asm_156f9
+ call Function2173
+ call Function321c
+ call Function1ad2
+ call Function156b8
+ ld c, $0
+ ret
+
+.asm_156f9
+ call WhiteBGMap
+ ld c, $1
+ ret
+; 156ff
+
+INCBIN "baserom.gbc", $156ff, $15704 - $156ff
+
+Function15704: ; 15704
+ ld a, b
+ ld [$cf76], a
+ ld hl, $57cc
+ call Function157bb
+ call Function15715
+ call Function1c07
+ ret
+; 15715
+
+Function15715: ; 15715
+ xor a
+ ld [$d0d7], a
+ ld [$d0dd], a
+ ld hl, KrissPCMenuData
+ call LoadMenuDataHeader
+.asm_15722
+ call UpdateTimePals
+ call Function1e5d
+ jr c, .asm_15731
+ call Function1fa7
+ jr nc, .asm_15722
+ jr .asm_15732
+
+.asm_15731
+ xor a
+
+.asm_15732
+ call Function1c07
+ ret
+; 15736
+
KrissPCMenuData: ; 0x15736
db %01000000
db 0, 0 ; top left corner coords (y, x)
@@ -28429,8 +28362,19 @@
db LOG_OFF
db $ff
-INCBIN "baserom.gbc", $157bb, $157d1 - $157bb
+Function157bb: ; 157bb
+ ld a, [Options]
+ push af
+ set 4, a
+ ld [Options], a
+ call Function1d4f
+ pop af
+ ld [Options], a
+ ret
+; 157cc
+INCBIN "baserom.gbc", $157cc, $157d1 - $157cc
+
KrisWithdrawItemMenu: ; 0x157d1
call Function1d6e
ld a, BANK(ClearPCItemScreen)
@@ -28754,7 +28698,7 @@
jr .asm_159f8
.asm_159ef
- call $56c7
+ call Function156c6
.asm_159f2
ld a, $9
@@ -28793,9 +28737,15 @@
dbw BANK(Function24ac3), Function24ac3
dbw BANK(Function244c3), Function244c3
-INCBIN "baserom.gbc", $15a20, $15a45 - $15a20
+Function15a20: ; 15a20
+ call Function1d4f
+ call Function1c07
+ ret
+; 15a27
+INCBIN "baserom.gbc", $15a27, $15a45 - $15a27
+
OpenMartDialog: ; 15a45
call GetMart
ld a, c
@@ -28808,11 +28758,11 @@
; 15a57
.dialogs
- dw MartDialog
- dw HerbShop
- dw BargainShop
- dw Pharmacist
- dw VendingMachine
+ dw MartDialog
+ dw HerbShop
+ dw BargainShop
+ dw Pharmacist
+ dw VendingMachine
; 15a61
MartDialog: ; 15a61
@@ -28894,7 +28844,7 @@
Function15b10: ; 15b10
ld a, b
- ld [CurFruit], a
+ ld [$d03f], a
ld a, e
ld [MartPointer], a
ld a, d
@@ -28940,12 +28890,12 @@
ret
.table_15b56
- dw Function15b62
- dw Function15b6e
- dw Function15b8d
- dw Function15b9a
- dw Function15ba3
- dw Function15baf
+ dw Function15b62
+ dw Function15b6e
+ dw Function15b8d
+ dw Function15b9a
+ dw Function15ba3
+ dw Function15baf
; 15b62
Function15b62: ; 15b62
@@ -29016,7 +28966,7 @@
ld l, a
ld de, CurMart
.CopyMart
- ld a, [CurFruit]
+ ld a, [$d03f]
call GetFarByte
ld [de], a
inc hl
@@ -29182,11 +29132,11 @@
; 15cb0
.data_15cb0 ; 15cb0
- dwb $5cbf, 0
- dwb $5ccb, 0
- dwb $5cd7, 1
- dwb $5ce3, 0
- dwb $5cbf, 2
+ dwb $5cbf, 0
+ dwb $5ccb, 0
+ dwb $5cd7, 1
+ dwb $5ce3, 0
+ dwb $5cbf, 2
; 15cbf
INCBIN "baserom.gbc", $15cbf, $15cef - $15cbf
@@ -29391,14 +29341,26 @@
Function15ee0: ; 15ee0
callba CheckItemMenu
ld a, [$d142]
- ld hl, $5eee
+ ld hl, Table15eee
rst JumpTable
ret
; 15eee
-INCBIN "baserom.gbc", $15eee, $15efd - $15eee
+Table15eee: ; 15eee
+ dw Function15efd
+ dw Function15efc
+ dw Function15efc
+ dw Function15efc
+ dw Function15efd
+ dw Function15efd
+ dw Function15efd
+; 15efc
+Function15efc: ; 15efc
+ ret
+; 15efd
+
Function15efd: ; 15efd
callba _CheckTossableItem
ld a, [$d142]
@@ -29699,453 +29661,911 @@
; 160a9
-Marts: ; 160a9
- dw Mart0
- dw Mart1
- dw Mart2
- dw Mart3
- dw Mart4
- dw Mart5
- dw Mart6
- dw Mart7
- dw Mart8
- dw Mart9
- dw Mart10
- dw Mart11
- dw Mart12
- dw Mart13
- dw Mart14
- dw Mart15
- dw Mart16
- dw Mart17
- dw Mart18
- dw Mart19
- dw Mart20
- dw Mart21
- dw Mart22
- dw Mart23
- dw Mart24
- dw Mart25
- dw Mart26
- dw Mart27
- dw Mart28
- dw Mart29
- dw Mart30
- dw Mart31
- dw Mart32
- dw Mart33
-MartsEnd
-; 160ed
+INCLUDE "items/marts.asm"
-Mart0: ; 160ed
- db 4 ; # items
- db POTION
- db ANTIDOTE
- db PARLYZ_HEAL
- db AWAKENING
- db $ff
-; 160f3
+Function16218: ; 16218
+ ld a, [$ffaa]
+ push af
+ ld a, $1
+ ld [$ffaa], a
+ xor a
+ ld [$cf63], a
+.asm_16223
+ ld a, [$cf63]
+ bit 7, a
+ jr nz, .asm_1622f
+ call Function16233
+ jr .asm_16223
-Mart1: ; 160f3
- db 5 ; # items
- db POKE_BALL
- db POTION
- db ANTIDOTE
- db PARLYZ_HEAL
- db AWAKENING
- db $ff
-; 160fa
+.asm_1622f
+ pop af
+ ld [$ffaa], a
+ ret
+; 16233
-Mart2: ; 160fa
- db 10 ; # items
- db POKE_BALL
- db POTION
- db ESCAPE_ROPE
- db ANTIDOTE
- db PARLYZ_HEAL
- db AWAKENING
- db X_DEFEND
- db X_ATTACK
- db X_SPEED
- db FLOWER_MAIL
- db $ff
-; 16106
+Function16233: ; 16233
+ ld a, [$cf63]
+ ld e, a
+ ld d, $0
+ ld hl, $6242
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 16242
-Mart3: ; 16106
- db 9 ; # items
- db CHARCOAL
- db POKE_BALL
- db POTION
- db SUPER_POTION
- db ESCAPE_ROPE
- db REPEL
- db ANTIDOTE
- db PARLYZ_HEAL
- db FLOWER_MAIL
- db $ff
-; 16111
+INCBIN "baserom.gbc", $16242, $166d6 - $16242
-Mart4: ; 16111
- db 5 ; # items
- db POTION
- db SUPER_POTION
- db HYPER_POTION
- db FULL_HEAL
- db REVIVE
- db $ff
-; 16118
+Function166d6: ; 166d6
+ ld hl, DaycareMan
+ bit 0, [hl]
+ jr nz, .asm_166fe
+ ld hl, DaycareMan
+ ld a, $0
+ call Function1678f
+ jr c, .asm_16724
+ call Function16798
+ jr c, .asm_16721
+ callba Functionde2a
+ ld hl, DaycareMan
+ set 0, [hl]
+ call Function167f6
+ call Function16a3b
+ ret
-Mart5: ; 16118
- db 7 ; # items
- db POTION
- db SUPER_POTION
- db ANTIDOTE
- db PARLYZ_HEAL
- db AWAKENING
- db BURN_HEAL
- db ICE_HEAL
- db $ff
-; 16121
+.asm_166fe
+ callba Functione698
+ ld hl, BreedMon1Nick
+ call Function1686d
+ call Function16807
+ jr c, .asm_16721
+ callba Functiondd21
+ call Function16850
+ ld hl, DaycareMan
+ res 0, [hl]
+ res 5, [hl]
+ jr .asm_16724
-Mart6: ; 16121
- db 8 ; # items
- db POKE_BALL
- db GREAT_BALL
- db ESCAPE_ROPE
- db REPEL
- db REVIVE
- db FULL_HEAL
- db POKE_DOLL
- db FLOWER_MAIL
- db $ff
-; 1612b
+.asm_16721
+ call Function1689b
+
+.asm_16724
+ ld a, $13
+ call Function1689b
+ ret
+; 1672a
+
+Function1672a: ; 1672a
+ ld hl, DaycareLady
+ bit 0, [hl]
+ jr nz, .asm_16752
+ ld hl, DaycareLady
+ ld a, $2
+ call Function16781
+ jr c, .asm_1677b
+ call Function16798
+ jr c, .asm_16778
+ callba Functionde37
+ ld hl, DaycareLady
+ set 0, [hl]
+ call Function167f6
+ call Function16a3b
+ ret
+
+.asm_16752
+ callba Functione6b3
+ ld hl, BreedMon2Nick
+ call Function1686d
+ call Function16807
+ jr c, .asm_16778
+ callba Functiondd42
+ call Function16850
+ ld hl, DaycareLady
+ res 0, [hl]
+ ld hl, DaycareMan
+ res 5, [hl]
+ jr .asm_1677b
+
+.asm_16778
+ call Function1689b
+
+.asm_1677b
+ ld a, $13
+ call Function1689b
+ ret
+; 16781
+
+Function16781: ; 16781
+ bit 7, [hl]
+ jr nz, .asm_16788
+ set 7, [hl]
+ inc a
+
+.asm_16788
+ call Function1689b
+ call Function1dcf
+ ret
+; 1678f
+
+Function1678f: ; 1678f
+ set 7, [hl]
+ call Function1689b
+ call Function1dcf
+ ret
+; 16798
+
+Function16798: ; 16798
+ ld a, [PartyCount]
+ cp $2
+ jr c, .asm_167e5
+ ld a, $4
+ call Function1689b
+ ld b, $6
+ callba Function5001d
+ jr c, .asm_167dd
+ ld a, [CurPartySpecies]
+ cp $fd
+ jr z, .asm_167e1
+ callba Functione538
+ jr c, .asm_167e9
+ ld hl, PartyMon1Item
+ ld bc, $0030
+ ld a, [CurPartyMon]
+ call AddNTimes
+ ld d, [hl]
+ callba Functionb9e76
+ jr c, .asm_167ed
+ ld hl, PartyMon1Nickname
+ ld a, [CurPartyMon]
+ call GetNick
+ and a
+ ret
+
+.asm_167dd
+ ld a, $12
+ scf
+ ret
+
+.asm_167e1
+ ld a, $6
+ scf
+ ret
+
+.asm_167e5
+ ld a, $7
+ scf
+ ret
+
+.asm_167e9
+ ld a, $8
+ scf
+ ret
+
+.asm_167ed
+ ld a, $a
+ scf
+ ret
+; 167f1
-Mart7: ; 1612b
- db 7 ; # items
- db X_SPEED
- db X_SPECIAL
- db X_DEFEND
- db X_ATTACK
- db DIRE_HIT
- db GUARD_SPEC
- db X_ACCURACY
- db $ff
-; 16134
+INCBIN "baserom.gbc", $167f1, $167f6 - $167f1
-Mart8: ; 16134
- db 5 ; # items
- db PROTEIN
- db IRON
- db CARBOS
- db CALCIUM
- db HP_UP
- db $ff
-; 1613b
+Function167f6: ; 167f6
+ ld a, $5
+ call Function1689b
+ ld a, [CurPartySpecies]
+ call Function37ce
+ ld a, $9
+ call Function1689b
+ ret
+; 16807
-Mart9: ; 1613b
- db 3 ; # items
- db TM_41
- db TM_48
- db TM_33
- db $ff
-; 16140
+Function16807: ; 16807
+ ld a, [$d087]
+ and a
+ jr nz, .asm_16819
+ ld a, $f
+ call Function1689b
+ call Function1dcf
+ jr c, .asm_16844
+ jr .asm_1682d
-Mart10: ; 16140
- db 4 ; # items
- db TM_41
- db TM_48
- db TM_33
- db TM_02
- db $ff
-; 16146
+.asm_16819
+ ld a, $b
+ call Function1689b
+ call Function1dcf
+ jr c, .asm_16844
+ ld a, $c
+ call Function1689b
+ call Function1dcf
+ jr c, .asm_16844
-Mart11: ; 16146
- db 4 ; # items
- db TM_41
- db TM_48
- db TM_33
- db TM_08
- db $ff
-; 1614c
+.asm_1682d
+ ld de, Money
+ ld bc, $d088
+ callba Function1600b
+ jr c, .asm_16848
+ ld a, [PartyCount]
+ cp $6
+ jr nc, .asm_1684c
+ and a
+ ret
-Mart12: ; 1614c
- db 5 ; # items
- db TM_41
- db TM_48
- db TM_33
- db TM_02
- db TM_08
- db $ff
-; 16153
+.asm_16844
+ ld a, $12
+ scf
+ ret
-Mart13: ; 16153
- db 9 ; # items
- db GREAT_BALL
- db SUPER_POTION
- db HYPER_POTION
- db ANTIDOTE
- db PARLYZ_HEAL
- db AWAKENING
- db ICE_HEAL
- db SUPER_REPEL
- db SURF_MAIL
- db $ff
-; 1615e
+.asm_16848
+ ld a, $11
+ scf
+ ret
-Mart14: ; 1615e
- db 10 ; # items
- db POKE_BALL
- db GREAT_BALL
- db POTION
- db SUPER_POTION
- db ANTIDOTE
- db PARLYZ_HEAL
- db AWAKENING
- db BURN_HEAL
- db ICE_HEAL
- db REVIVE
- db $ff
-; 1616a
+.asm_1684c
+ ld a, $10
+ scf
+ ret
+; 16850
-Mart15: ; 1616a
- db 4 ; # items
- db TINYMUSHROOM
- db SLOWPOKETAIL
- db POKE_BALL
- db POTION
- db $ff
-; 16170
+Function16850: ; 16850
+ ld bc, $d088
+ ld de, Money
+ callba Function15ffa
+ ld a, $d
+ call Function1689b
+ ld a, [CurPartySpecies]
+ call Function37ce
+ ld a, $e
+ call Function1689b
+ ret
+; 1686d
-Mart16: ; 16170
- db 9 ; # items
- db RAGECANDYBAR
- db GREAT_BALL
- db SUPER_POTION
- db HYPER_POTION
- db ANTIDOTE
- db PARLYZ_HEAL
- db SUPER_REPEL
- db REVIVE
- db FLOWER_MAIL
- db $ff
-; 1617b
+Function1686d: ; 1686d
+ ld a, b
+ ld [StringBuffer2], a
+ ld a, d
+ ld [$d087], a
+ ld de, StringBuffer1
+ ld bc, $000b
+ call CopyBytes
+ ld hl, $0000
+ ld bc, $0064
+ ld a, [$d087]
+ call AddNTimes
+ ld de, $0064
+ add hl, de
+ xor a
+ ld [$d088], a
+ ld a, h
+ ld [$d089], a
+ ld a, l
+ ld [$d08a], a
+ ret
+; 1689b
-Mart17: ; 1617b
- db 9 ; # items
- db GREAT_BALL
- db ULTRA_BALL
- db HYPER_POTION
- db MAX_POTION
- db FULL_HEAL
- db REVIVE
- db MAX_REPEL
- db X_DEFEND
- db X_ATTACK
- db $ff
-; 16186
+Function1689b: ; 1689b
+ ld e, a
+ ld d, $0
+ ld hl, $68aa
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ call PrintText
+ ret
+; 168aa
-Mart18: ; 16186
- db 9 ; # items
- db ULTRA_BALL
- db HYPER_POTION
- db FULL_HEAL
- db REVIVE
- db ANTIDOTE
- db PARLYZ_HEAL
- db AWAKENING
- db BURN_HEAL
- db FLOWER_MAIL
- db $ff
-; 16191
+INCBIN "baserom.gbc", $168aa, $16936 - $168aa
-Mart19: ; 16191
- db 7 ; # items
- db GREAT_BALL
- db SUPER_POTION
- db SUPER_REPEL
- db ANTIDOTE
- db PARLYZ_HEAL
- db AWAKENING
- db BURN_HEAL
- db $ff
-; 1619a
+Function16936: ; 16936
+ ld hl, DaycareMan
+ bit 6, [hl]
+ jr nz, .asm_16949
+ ld hl, .data_16944
+ call PrintText
+ ret
-Mart20: ; 1619a
- db 9 ; # items
- db GREAT_BALL
- db ULTRA_BALL
- db SUPER_POTION
- db SUPER_REPEL
- db FULL_HEAL
- db X_DEFEND
- db X_ATTACK
- db DIRE_HIT
- db SURF_MAIL
- db $ff
-; 161a5
+.data_16944
+ db $16
+ db $f6
+ db $5e
+ db $6f
+ db $50
-Mart21: ; 161a5
- db 8 ; # items
- db GREAT_BALL
- db POTION
- db SUPER_POTION
- db MAX_REPEL
- db ANTIDOTE
- db PARLYZ_HEAL
- db AWAKENING
- db BURN_HEAL
- db $ff
-; 161af
+.asm_16949
+ ld hl, $6993
+ call PrintText
+ call Function1dcf
+ jr c, .asm_1697c
+ ld a, [PartyCount]
+ cp $6
+ jr nc, .asm_16987
+ call Function169ac
+ ld hl, DaycareMan
+ res 6, [hl]
+ call Function16a3b
+ ld hl, $6998
+ call PrintText
+ ld de, $0096
+ call StartSFX
+ ld c, $78
+ call DelayFrames
+ ld hl, $699d
+ jr .asm_1697f
-Mart22: ; 161af
- db 8 ; # items
- db ULTRA_BALL
- db SUPER_POTION
- db HYPER_POTION
- db REVIVE
- db PARLYZ_HEAL
- db AWAKENING
- db BURN_HEAL
- db LITEBLUEMAIL
- db $ff
-; 161b9
+.asm_1697c
+ ld hl, $69a2
-Mart23: ; 161b9
- db 7 ; # items
- db POTION
- db SUPER_POTION
- db HYPER_POTION
- db MAX_POTION
- db REVIVE
- db SUPER_REPEL
- db MAX_REPEL
- db $ff
-; 161c2
+.asm_1697f
+ call PrintText
+ xor a
+ ld [ScriptVar], a
+ ret
-Mart24: ; 161c2
- db 10 ; # items
- db POKE_BALL
- db GREAT_BALL
- db ULTRA_BALL
- db ESCAPE_ROPE
- db FULL_HEAL
- db ANTIDOTE
- db BURN_HEAL
- db ICE_HEAL
- db AWAKENING
- db PARLYZ_HEAL
- db $ff
-; 161ce
+.asm_16987
+ ld hl, $69a7
+ call PrintText
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+; 16993
-Mart25: ; 161ce
- db 5 ; # items
- db TM_10
- db TM_11
- db TM_17
- db TM_18
- db TM_37
- db $ff
-; 161d5
+INCBIN "baserom.gbc", $16993, $169ac - $16993
-Mart26: ; 161d5
- db 3 ; # items
- db POKE_DOLL
- db LOVELY_MAIL
- db SURF_MAIL
- db $ff
-; 161da
+Function169ac: ; 169ac
+ ld a, [$df9a]
+ ld [CurPartyLevel], a
+ ld hl, PartyCount
+ ld a, [hl]
+ cp $6
+ jr nc, .asm_16a2f
+ inc a
+ ld [hl], a
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, $fd
+ ld [hli], a
+ ld a, [EggSpecies]
+ ld [CurSpecies], a
+ ld [CurPartySpecies], a
+ ld a, $ff
+ ld [hl], a
+ ld hl, PartyMon1Nickname
+ ld bc, $000b
+ call Function16a31
+ ld hl, EggNick
+ call CopyBytes
+ ld hl, PartyMon1OT
+ ld bc, $000b
+ call Function16a31
+ ld hl, EggOT
+ call CopyBytes
+ ld hl, PartyMon1Species
+ ld bc, $0030
+ call Function16a31
+ ld hl, EggSpecies
+ ld bc, $0020
+ call CopyBytes
+ call GetBaseData
+ ld a, [PartyCount]
+ dec a
+ ld hl, PartyMon1Species
+ ld bc, $0030
+ call AddNTimes
+ ld b, h
+ ld c, l
+ ld hl, $0007
+ add hl, bc
+ push hl
+ ld hl, $0024
+ add hl, bc
+ ld d, h
+ ld e, l
+ pop hl
+ push bc
+ ld b, $0
+ ld a, $c
+ call Predef
+ pop bc
+ ld hl, $0022
+ add hl, bc
+ xor a
+ ld [hli], a
+ ld [hl], a
+ and a
+ ret
-Mart27: ; 161da
- db 5 ; # items
- db HP_UP
- db PROTEIN
- db IRON
- db CARBOS
- db CALCIUM
- db $ff
-; 161e1
+.asm_16a2f
+ scf
+ ret
+; 16a31
-Mart28: ; 161e1
- db 7 ; # items
- db X_ACCURACY
- db GUARD_SPEC
- db DIRE_HIT
- db X_ATTACK
- db X_DEFEND
- db X_SPEED
- db X_SPECIAL
- db $ff
-; 161ea
+Function16a31: ; 16a31
+ ld a, [PartyCount]
+ dec a
+ call AddNTimes
+ ld d, h
+ ld e, l
+ ret
+; 16a3b
-Mart29: ; 161ea
- db 7 ; # items
- db GREAT_BALL
- db ULTRA_BALL
- db SUPER_POTION
- db HYPER_POTION
- db FULL_HEAL
- db MAX_REPEL
- db FLOWER_MAIL
- db $ff
-; 161f3
+Function16a3b: ; 16a3b
+ ld a, [DaycareLady]
+ bit 0, a
+ ret z
+ ld a, [DaycareMan]
+ bit 0, a
+ ret z
+ callab Function16e1d
+ ld a, [$d265]
+ and a
+ ret z
+ inc a
+ ret z
+ ld hl, DaycareMan
+ set 5, [hl]
+.asm_16a59
+ call Random
+ cp $96
+ jr c, .asm_16a59
+ ld [StepsToEgg], a
+ jp Function16a66
+; 16a66
-Mart30: ; 161f3
- db 8 ; # items
- db GREAT_BALL
- db ULTRA_BALL
- db HYPER_POTION
- db MAX_POTION
- db FULL_HEAL
- db X_ATTACK
- db X_DEFEND
- db FLOWER_MAIL
- db $ff
-; 161fd
+Function16a66: ; 16a66
+ xor a
+ ld hl, EggSpecies
+ ld bc, $0020
+ call ByteFill
+ ld hl, EggNick
+ ld bc, $000b
+ call ByteFill
+ ld hl, EggOT
+ ld bc, $000b
+ call ByteFill
+ ld a, [$df21]
+ ld [TempMonDVs], a
+ ld a, [$df22]
+ ld [$d124], a
+ ld a, [BreedMon1Species]
+ ld [CurPartySpecies], a
+ ld a, $3
+ ld [MonType], a
+ ld a, [BreedMon1Species]
+ cp $84
+ ld a, $1
+ jr z, .asm_16ab6
+ ld a, [BreedMon2Species]
+ cp $84
+ ld a, $0
+ jr z, .asm_16ab6
+ callba GetGender
+ ld a, $0
+ jr z, .asm_16ab6
+ inc a
-Mart31: ; 161fd
- db 6 ; # items
- db POKE_DOLL
- db FRESH_WATER
- db SODA_POP
- db LEMONADE
- db REPEL
- db PORTRAITMAIL
- db $ff
-; 16205
+.asm_16ab6
+ ld [DittoInDaycare], a
+ and a
+ ld a, [BreedMon1Species]
+ jr z, .asm_16ac2
+ ld a, [BreedMon2Species]
-Mart32: ; 16205
- db 7 ; # items
- db ULTRA_BALL
- db MAX_REPEL
- db HYPER_POTION
- db MAX_POTION
- db FULL_RESTORE
- db REVIVE
- db FULL_HEAL
- db $ff
-; 1620e
+.asm_16ac2
+ ld [CurPartySpecies], a
+ callab GetPreEvolution
+ callab GetPreEvolution
+ ld a, $5
+ ld [CurPartyLevel], a
+ ld a, [CurPartySpecies]
+ cp $1d
+ jr nz, .asm_16ae8
+ call Random
+ cp $80
+ ld a, $1d
+ jr c, .asm_16ae8
+ ld a, $20
-Mart33: ; 1620e
- db 4 ; # items
- db ENERGYPOWDER
- db ENERGY_ROOT
- db HEAL_POWDER
- db REVIVAL_HERB
- db $ff
-; 16214
+.asm_16ae8
+ ld [CurPartySpecies], a
+ ld [CurSpecies], a
+ ld [EggSpecies], a
+ call GetBaseData
+ ld hl, EggNick
+ ld de, $6be0
+ call CopyName2
+ ld hl, PlayerName
+ ld de, EggOT
+ ld bc, $000b
+ call CopyBytes
+ xor a
+ ld [$df7c], a
+ ld de, $df7d
+ xor a
+ ld [Buffer1], a
+ ld a, $1b
+ call Predef
+ callba Function170bf
+ ld hl, $df81
+ ld a, [PlayerID]
+ ld [hli], a
+ ld a, [$d47c]
+ ld [hl], a
+ ld a, [CurPartyLevel]
+ ld d, a
+ callab Function50e47
+ ld hl, $df83
+ ld a, [hMultiplicand]
+ ld [hli], a
+ ld a, [$ffb5]
+ ld [hli], a
+ ld a, [$ffb6]
+ ld [hl], a
+ xor a
+ ld b, $a
+ ld hl, $df86
+.asm_16b46
+ ld [hli], a
+ dec b
+ jr nz, .asm_16b46
+ ld hl, $df90
+ call Random
+ ld [hli], a
+ ld [TempMonDVs], a
+ call Random
+ ld [hld], a
+ ld [$d124], a
+ ld de, $df21
+ ld a, [BreedMon1Species]
+ cp $84
+ jr z, .asm_16b98
+ ld de, $df5a
+ ld a, [BreedMon2Species]
+ cp $84
+ jr z, .asm_16b98
+ ld a, $3
+ ld [MonType], a
+ push hl
+ callba GetGender
+ pop hl
+ ld de, $df21
+ ld bc, $df5a
+ jr c, .asm_16bab
+ jr z, .asm_16b90
+ ld a, [DittoInDaycare]
+ and a
+ jr z, .asm_16b98
+ ld d, b
+ ld e, c
+ jr .asm_16b98
-DefaultMart: ; 16214
- db 2 ; # items
- db POKE_BALL
- db POTION
- db $ff
-; 16218
+.asm_16b90
+ ld a, [DittoInDaycare]
+ and a
+ jr nz, .asm_16b98
+ ld d, b
+ ld e, c
+.asm_16b98
+ ld a, [de]
+ inc de
+ and $f
+ ld b, a
+ ld a, [hl]
+ and $f0
+ add b
+ ld [hli], a
+ ld a, [de]
+ and $7
+ ld b, a
+ ld a, [hl]
+ and $f8
+ add b
+ ld [hl], a
-INCBIN "baserom.gbc", $16218, $16e1d - $16218
+.asm_16bab
+ ld hl, StringBuffer1
+ ld de, $d050
+ ld bc, $000b
+ call CopyBytes
+ ld hl, $df7d
+ ld de, $df92
+ ld a, $5
+ call Predef
+ ld hl, $d050
+ ld de, StringBuffer1
+ ld bc, $000b
+ call CopyBytes
+ ld a, [BaseEggSteps]
+ ld hl, $df96
+ ld [hli], a
+ xor a
+ ld [hli], a
+ ld [hli], a
+ ld [hl], a
+ ld a, [CurPartyLevel]
+ ld [$df9a], a
+ ret
+; 16be0
+INCBIN "baserom.gbc", $16be0, $16be4 - $16be0
+Function16be4: ; 16be4
+ ld a, [UnownDex]
+ and a
+ ret z
+
+ ld a, [$ffaa]
+ push af
+ ld a, $1
+ ld [$ffaa], a
+ ld a, [Options]
+ push af
+ set 4, a
+ ld [Options], a
+ call WhiteBGMap
+ call ClearTileMap
+
+ ld de, UnownDexATile
+ ld hl, $8ef0
+ ld bc, $0501
+ call Request1bpp
+
+ ld de, UnownDexBTile
+ ld hl, $8f50
+ ld bc, $0501
+ call Request1bpp
+
+ ld hl, TileMap
+ ld bc, $0312
+ call TextBox
+
+ ld hl, $c504
+ ld bc, $0707
+ call TextBox
+
+ ld hl, $c5b8
+ ld bc, $0212
+ call TextBox
+
+ ld hl, $c4c9
+ ld de, AlphRuinsStampString
+ call PlaceString
+
+ ld hl, $c5e1
+ ld de, UnownDexDoWhatString
+ call PlaceString
+
+ ld hl, $c522
+ ld de, UnownDexMenuString
+ call PlaceString
+
+ xor a
+ ld [$cf63], a
+ call Function16cc8
+ call WaitBGMap
+
+ ld a, UNOWN
+ ld [CurPartySpecies], a
+ xor a
+ ld [TempMonDVs], a
+ ld [TempMonDVs + 1], a
+
+ ld b, $1c
+ call GetSGBLayout
+ call Function32f9
+
+.asm_16c6b
+ call Functiona57
+
+ ld a, [hJoyPressed]
+ and BUTTON_B
+ jr nz, .asm_16c95
+
+ ld a, [hJoyPressed]
+ and BUTTON_A
+ jr nz, .asm_16c82
+
+ call Function16ca0
+ call DelayFrame
+ jr .asm_16c6b
+
+.asm_16c82
+ ld a, [$cf63]
+ push af
+ callba Function84560
+ call Function3d47
+ pop af
+ ld [$cf63], a
+ jr .asm_16c6b
+
+.asm_16c95
+ pop af
+ ld [Options], a
+ pop af
+ ld [$ffaa], a
+ call Function222a
+ ret
+; 16ca0
+
+Function16ca0: ; 16ca0
+ ld a, [$ffa9]
+ and $10
+ jr nz, .asm_16cb9
+ ld a, [$ffa9]
+ and $20
+ jr nz, .asm_16cad
+ ret
+
+.asm_16cad
+ ld hl, $cf63
+ ld a, [hl]
+ and a
+ jr nz, .asm_16cb6
+ ld [hl], $1b
+
+.asm_16cb6
+ dec [hl]
+ jr .asm_16cc4
+
+.asm_16cb9
+ ld hl, $cf63
+ ld a, [hl]
+ cp $1a
+ jr c, .asm_16cc3
+ ld [hl], $ff
+
+.asm_16cc3
+ inc [hl]
+
+.asm_16cc4
+ call Function16cc8
+ ret
+; 16cc8
+
+Function16cc8: ; 16cc8
+ ld a, [$cf63]
+ cp 26
+ jr z, Function16d20
+ inc a
+ ld [UnownLetter], a
+ ld a, UNOWN
+ ld [CurPartySpecies], a
+ xor a
+ ld [$c2c6], a
+ ld de, VTiles2
+ ld a, $3c
+ call Predef
+ call Function16cff
+ ld hl, $c519
+ xor a
+ ld [$ffad], a
+ ld bc, $0707
+ ld a, $13
+ call Predef
+ ld de, $9310
+ callba Functione0000
+ ret
+; 16cff
+
+Function16cff: ; 16cff
+ ld a, [rSVBK]
+ push af
+ ld a, $6
+ ld [rSVBK], a
+ ld a, $0
+ call GetSRAMBank
+ ld de, Unkn1Pals
+ ld hl, $a000
+ ld a, [hROMBank]
+ ld b, a
+ ld c, $31
+ call Get2bpp
+ call CloseSRAM
+ pop af
+ ld [rSVBK], a
+ ret
+; 16d20
+
+Function16d20: ; 16d20
+ ld hl, $c519
+ ld bc, $0707
+ call ClearBox
+ ld hl, $c555
+ ld de, UnownDexVacantString
+ call PlaceString
+ xor a
+ call GetSRAMBank
+ ld hl, $a000
+ ld bc, $0310
+ xor a
+ call ByteFill
+ ld hl, $9310
+ ld de, $a000
+ ld c, $31
+ ld a, [hROMBank]
+ ld b, a
+ call Get2bpp
+ call CloseSRAM
+ ld c, $14
+ call DelayFrames
+ ret
+; 16d57
+
+AlphRuinsStampString:
+ db " ALPH RUINS STAMP@"
+
+UnownDexDoWhatString:
+ db "Do what?@"
+
+UnownDexMenuString:
+ db $ef, " PRINT", $4e
+ db $f5, " CANCEL", $4e
+ db $df, " PREVIOUS", $4e
+ db $eb, " NEXT@"
+
+UnownDexVacantString:
+ db "VACANT@"
+; 16d9c
+
+UnownDexATile: ; 16d9c
+ INCBIN "baserom.gbc", $16d9c, $16da4 - $16d9c
+UnownDexBTile: ; 16da4
+ INCBIN "baserom.gbc", $16da4, $16dac - $16da4
+; 16dac
+
+Function16dac: ; 16dac
+ ld hl, TileMap
+ ld bc, $0168
+ ld a, $7f
+ call ByteFill
+ ld hl, $c583
+ ld a, $31
+ ld [$ffad], a
+ ld bc, $0707
+ ld a, $13
+ call Predef
+ ret
+; 16dc7
+
+Function16dc7: ; 16dc7
+ ld hl, $6e04
+ call PrintText
+ callba Function50000
+ jr c, .asm_16df8
+ ld a, [CurPartySpecies]
+ cp $fd
+ jr z, .asm_16dfd
+ ld hl, $6e09
+ call PrintText
+ call Function2ed3
+ callba Function8461a
+ call Function2b74
+ ld a, [$ffac]
+ and a
+ jr nz, .asm_16df8
+ ld hl, $6e0e
+ jr .asm_16e00
+
+.asm_16df8
+ ld hl, $6e13
+ jr .asm_16e00
+
+.asm_16dfd
+ ld hl, $6e18
+
+.asm_16e00
+ call PrintText
+ ret
+; 16e04
+
+INCBIN "baserom.gbc", $16e04, $16e1d - $16e04
+
+
Function16e1d: ; 16e1d
call Function16ed6
ld c, $0
@@ -30333,88 +30753,316 @@
jr .loop
; 16f5e
-INCBIN "baserom.gbc", $16f5e, $174ba - $16f5e
+INCBIN "baserom.gbc", $16f5e, $170bf - $16f5e
+Function170bf: ; 170bf
+ call Function17197
+ ld d, h
+ ld e, l
+ ld b, $4
+.asm_170c6
+ ld a, [de]
+ and a
+ jr z, .asm_170e3
+ ld hl, $df7d
+ ld c, $4
+.asm_170cf
+ ld a, [de]
+ cp [hl]
+ jr z, .asm_170df
+ inc hl
+ dec c
+ jr nz, .asm_170cf
+ call Function170e4
+ jr nc, .asm_170df
+ call Function17169
-SECTION "bank6",ROMX,BANK[$6]
+.asm_170df
+ inc de
+ dec b
+ jr nz, .asm_170c6
-Tileset03GFX: ; 0x18000
-INCBIN "gfx/tilesets/03.lz"
-; 0x18605
+.asm_170e3
+ ret
+; 170e4
- db $00
+Function170e4: ; 170e4
+ push bc
+ ld a, [EggSpecies]
+ dec a
+ ld c, a
+ ld b, $0
+ ld hl, $7b11
+ add hl, bc
+ add hl, bc
+ ld a, $8
+ call GetFarHalfword
+.asm_170f6
+ ld a, $8
+ call GetFarByte
+ cp $ff
+ jr z, .asm_17107
+ ld b, a
+ ld a, [de]
+ cp b
+ jr z, .asm_17163
+ inc hl
+ jr .asm_170f6
-Tileset03Meta: ; 0x18606
-INCBIN "tilesets/03_metatiles.bin"
-; 0x18e06
+.asm_17107
+ call Function1720b
+ ld b, $4
+.asm_1710c
+ ld a, [de]
+ cp [hl]
+ jr z, .asm_17116
+ inc hl
+ dec b
+ jr z, .asm_17146
+ jr .asm_1710c
-Tileset03Coll: ; 0x18e06
-INCBIN "tilesets/03_collision.bin"
-; 0x19006
+.asm_17116
+ ld a, [EggSpecies]
+ dec a
+ ld c, a
+ ld b, $0
+ ld hl, $65b1
+ add hl, bc
+ add hl, bc
+ ld a, $10
+ call GetFarHalfword
+.asm_17127
+ ld a, $10
+ call GetFarByte
+ inc hl
+ and a
+ jr nz, .asm_17127
+.asm_17130
+ ld a, $10
+ call GetFarByte
+ and a
+ jr z, .asm_17146
+ inc hl
+ ld a, $10
+ call GetFarByte
+ ld b, a
+ ld a, [de]
+ cp b
+ jr z, .asm_17163
+ inc hl
+ jr .asm_17130
-Tileset00GFX: ; 0x19006
-Tileset01GFX: ; 0x19006
-INCBIN "gfx/tilesets/01.lz"
-; 0x19c0d
+.asm_17146
+ ld hl, $567a
+.asm_17149
+ ld a, $4
+ call GetFarByte
+ inc hl
+ and a
+ jr z, .asm_17166
+ ld b, a
+ ld a, [de]
+ cp b
+ jr nz, .asm_17149
+ ld [$d262], a
+ ld a, $e
+ call Predef
+ ld a, c
+ and a
+ jr z, .asm_17166
- db $00
+.asm_17163
+ pop bc
+ scf
+ ret
-Tileset00Meta: ; 0x19c0e
-Tileset01Meta: ; 0x19c0e
-INCBIN "tilesets/01_metatiles.bin"
-; 0x1a40e
+.asm_17166
+ pop bc
+ and a
+ ret
+; 17169
-Tileset00Coll: ; 0x1a40e
-Tileset01Coll: ; 0x1a40e
-INCBIN "tilesets/01_collision.bin"
-; 0x1a60e
+Function17169: ; 17169
+ push de
+ push bc
+ ld a, [de]
+ ld b, a
+ ld hl, $df7d
+ ld c, $4
+.asm_17172
+ ld a, [hli]
+ and a
+ jr z, .asm_17187
+ dec c
+ jr nz, .asm_17172
+ ld de, $df7d
+ ld hl, $df7e
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [hli]
+ ld [de], a
-Tileset29GFX: ; 0x1a60e
-INCBIN "gfx/tilesets/29.lz"
-; 0x1af38
+.asm_17187
+ dec hl
+ ld [hl], b
+ ld hl, $df7d
+ ld de, $df92
+ ld a, $5
+ call Predef
+ pop bc
+ pop de
+ ret
+; 17197
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
+Function17197: ; 17197
+ ld hl, $df47
+ ld a, [BreedMon1Species]
+ cp $84
+ jr z, .asm_171b1
+ ld a, [BreedMon2Species]
+ cp $84
+ jr z, .asm_171d7
+ ld a, [DittoInDaycare]
+ and a
+ ret z
+ ld hl, $df0e
+ ret
-Tileset29Meta: ; 0x1af3e
-INCBIN "tilesets/29_metatiles.bin"
-; 0x1b33e
+.asm_171b1
+ ld a, [CurPartySpecies]
+ push af
+ ld a, [BreedMon2Species]
+ ld [CurPartySpecies], a
+ ld a, [$df5a]
+ ld [TempMonDVs], a
+ ld a, [$df5b]
+ ld [$d124], a
+ ld a, $3
+ ld [MonType], a
+ ld a, $24
+ call Predef
+ jr c, .asm_171fb
+ jr nz, .asm_171fb
+ jr .asm_17203
-Tileset29Coll: ; 0x1b33e
-INCBIN "tilesets/29_collision.bin"
-; 0x1b43e
+.asm_171d7
+ ld a, [CurPartySpecies]
+ push af
+ ld a, [BreedMon1Species]
+ ld [CurPartySpecies], a
+ ld a, [$df21]
+ ld [TempMonDVs], a
+ ld a, [$df22]
+ ld [$d124], a
+ ld a, $3
+ ld [MonType], a
+ ld a, $24
+ call Predef
+ jr c, .asm_17203
+ jr nz, .asm_17203
-Tileset20GFX: ; 0x1b43e
-INCBIN "gfx/tilesets/20.lz"
-; 0x1b8f1
+.asm_171fb
+ ld hl, $df47
+ pop af
+ ld [CurPartySpecies], a
+ ret
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
+.asm_17203
+ ld hl, $df0e
+ pop af
+ ld [CurPartySpecies], a
+ ret
+; 1720b
-Tileset20Meta: ; 0x1b8fe
-INCBIN "tilesets/20_metatiles.bin"
-; 0x1bcfe
+Function1720b: ; 1720b
+ ld hl, $df0e
+ ld a, [BreedMon1Species]
+ cp $84
+ ret z
+ ld a, [BreedMon2Species]
+ cp $84
+ jr z, .asm_17220
+ ld a, [DittoInDaycare]
+ and a
+ ret z
-Tileset20Coll: ; 0x1bcfe
-INCBIN "tilesets/20_collision.bin"
-; 0x1bdfe
+.asm_17220
+ ld hl, $df47
+ ret
+; 17224
+INCBIN "baserom.gbc", $17224, $17421 - $17224
+Function17421: ; 17421
+ ld hl, $7467
+ call PrintText
+ ld a, [BreedMon1Species]
+ call Function37ce
+ ld a, [DaycareLady]
+ bit 0, a
+ jr z, Function1745f
+ call Functionaaf
+ ld hl, BreedMon2Nick
+ call Function1746c
+ jp PrintText
+
+Function17440: ; 17440
+ ld hl, $7462
+ call PrintText
+ ld a, [BreedMon2Species]
+ call Function37ce
+ ld a, [DaycareMan]
+ bit 0, a
+ jr z, Function1745f
+ call Functionaaf
+ ld hl, BreedMon1Nick
+ call Function1746c
+ jp PrintText
+
+Function1745f: ; 1745f
+ jp Functiona80
+; 17462
+
+INCBIN "baserom.gbc", $17462, $1746c - $17462
+
+Function1746c: ; 1746c
+ push bc
+ ld de, StringBuffer1
+ ld bc, $000b
+ call CopyBytes
+ call Function16e1d
+ pop bc
+ ld a, [$d265]
+ ld hl, $749c
+ cp $ff
+ jr z, .asm_1749b
+ ld hl, $74a1
+ and a
+ jr z, .asm_1749b
+ ld hl, $74a6
+ cp $e6
+ jr nc, .asm_1749b
+ cp $46
+ ld hl, $74ab
+ jr nc, .asm_1749b
+ ld hl, $74b0
+
+.asm_1749b
+ ret
+; 1749c
+
+INCBIN "baserom.gbc", $1749c, $174ba - $1749c
+
+
+SECTION "bank6",ROMX,BANK[$6]
+
+INCLUDE "tilesets/data_1.asm"
+
+
SECTION "bank7",ROMX,BANK[$7]
Function1c000: ; 1c000
@@ -30437,100 +31085,8 @@
INCBIN "baserom.gbc", $1c021, $1c30c - $1c021
-Tileset07GFX: ; 0x1c30c
-INCBIN "gfx/tilesets/07.lz"
-; 0x1c73b
+INCLUDE "tilesets/data_2.asm"
- db $00
-
-Tileset07Meta: ; 0x1c73c
-INCBIN "tilesets/07_metatiles.bin"
-; 0x1cb3c
-
-Tileset07Coll: ; 0x1cb3c
-INCBIN "tilesets/07_collision.bin"
-; 0x1cc3c
-
-Tileset09GFX: ; 0x1cc3c
-INCBIN "gfx/tilesets/09.lz"
-; 0x1d047
-
- db $00
- db $00
- db $00
- db $00
- db $00
-
-Tileset09Meta: ; 0x1d04c
-INCBIN "tilesets/09_metatiles.bin"
-; 0x1d44c
-
-Tileset09Coll: ; 0x1d44c
-INCBIN "tilesets/09_collision.bin"
-; 0x1d54c
-
-Tileset06GFX: ; 0x1d54c
-INCBIN "gfx/tilesets/06.lz"
-; 0x1d924
-
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
-
-Tileset06Meta: ; 0x1d92c
-INCBIN "tilesets/06_metatiles.bin"
-; 0x1dd2c
-
-Tileset06Coll: ; 0x1dd2c
-INCBIN "tilesets/06_collision.bin"
-; 0x1de2c
-
-Tileset13GFX: ; 0x1de2c
-INCBIN "gfx/tilesets/13.lz"
-; 0x1e58c
-
-Tileset13Meta: ; 0x1e58c
-INCBIN "tilesets/13_metatiles.bin"
-; 0x1e98c
-
-Tileset13Coll: ; 0x1e98c
-INCBIN "tilesets/13_collision.bin"
-; 0x1ea8c
-
-Tileset24GFX: ; 0x1ea8c
-INCBIN "gfx/tilesets/24.lz"
-; 0x1ee0e
-
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
-
-Tileset24Meta: ; 0x1ee1c
-Tileset30Meta: ; 0x1ee1c
-INCBIN "tilesets/30_metatiles.bin"
-; 0x1f21c
-
-Tileset24Coll: ; 0x1f21c
-Tileset30Coll: ; 0x1f21c
-INCBIN "tilesets/30_collision.bin"
-; 0x1f31c
-
; Songs i
Music_Credits: INCLUDE "audio/music/credits.asm"
@@ -30542,117 +31098,8 @@
INCBIN "baserom.gbc", $20000, $20181 - $20000
-Tileset23GFX: ; 0x20181
-INCBIN "gfx/tilesets/23.lz"
-; 0x206d2
+INCLUDE "tilesets/data_3.asm"
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
-
-Tileset23Meta: ; 0x206e1
-INCBIN "tilesets/23_metatiles.bin"
-; 0x20ae1
-
-Tileset23Coll: ; 0x20ae1
-INCBIN "tilesets/23_collision.bin"
-; 0x20be1
-
-Tileset10GFX: ; 0x20be1
-INCBIN "gfx/tilesets/10.lz"
-; 0x213e0
-
- db $00
-
-Tileset10Meta: ; 0x213e1
-INCBIN "tilesets/10_metatiles.bin"
-; 0x217e1
-
-Tileset10Coll: ; 0x217e1
-INCBIN "tilesets/10_collision.bin"
-; 0x218e1
-
-Tileset12GFX: ; 0x218e1
-INCBIN "gfx/tilesets/12.lz"
-; 0x22026
-
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
-
-Tileset12Meta: ; 0x22031
-INCBIN "tilesets/12_metatiles.bin"
-; 0x22431
-
-Tileset12Coll: ; 0x22431
-INCBIN "tilesets/12_collision.bin"
-; 0x22531
-
-Tileset14GFX: ; 0x22531
-INCBIN "gfx/tilesets/14.lz"
-; 0x22ae2
-
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
-
-Tileset14Meta: ; 0x22af1
-INCBIN "tilesets/14_metatiles.bin"
-; 0x22ef1
-
-Tileset14Coll: ; 0x22ef1
-INCBIN "tilesets/14_collision.bin"
-; 0x22ff1
-
-Tileset17GFX: ; 0x22ff1
-INCBIN "gfx/tilesets/17.lz"
-; 0x23391
-
-Tileset17Meta: ; 0x23391
-INCBIN "tilesets/17_metatiles.bin"
-; 0x23791
-
-Tileset17Coll: ; 0x23791
-INCBIN "tilesets/17_collision.bin"
-; 0x23891
-
-; todo
-Tileset31Meta: ; 0x23891
-INCBIN "tilesets/31_metatiles.bin"
-; 0x23b11
-
EggMovePointers: ; 0x23b11
INCLUDE "stats/egg_move_pointers.asm"
@@ -33323,21 +33770,68 @@
ret
; 26a44
-INCBIN "baserom.gbc", $26a44, $26c72 - $26a44
+Function26a44: ; 26a44
+ ld a, c
+ call Function269dd
+ ld de, $0005
+ add hl, de
+ ld a, [hl]
+ ld c, a
+ ret
+; 26a4f
+INCBIN "baserom.gbc", $26a4f, $26b8d - $26a4f
+
+DecorationNames: ; 26b8d
+ db "CANCEL@"
+ db "PUT IT AWAY@"
+ db "MAGNAPLANT@"
+ db "TROPICPLANT@"
+ db "JUMBOPLANT@"
+ db "TOWN MAP@"
+ db "NES@"
+ db "SUPER NES@"
+ db "NINTENDO 64@"
+ db "VIRTUAL BOY@"
+ db "GOLD TROPHY@"
+ db "SILVER TROPHY@"
+ db "SURF PIKACHU DOLL@"
+ db " BED@"
+ db " CARPET@"
+ db " POSTER@"
+ db " DOLL@"
+ db "BIG @"
+ db "FEATHERY@"
+ db "PIKACHU@"
+ db "PINK@"
+ db "POLKADOT@"
+ db "RED@"
+ db "BLUE@"
+ db "YELLOW@"
+ db "GREEN@"
+; 26c72
+
Function26c72: ; 26c72
ld a, [hli]
ld e, [hl]
ld bc, StringBuffer2
push bc
- ld hl, $6c7e
+ ld hl, Table26c7e
rst JumpTable
pop de
ret
; 26c7e
-INCBIN "baserom.gbc", $26c7e, $26c8c - $26c7e
+Table26c7e: ; 26c7e
+ dw Function26c8c
+ dw Function26c8d
+ dw Function26c90
+ dw Function26c97
+ dw Function26c9e
+ dw Function26ca6
+ dw Function26cae
+; 26c8c
Function26c8c: ; 26c8c
@@ -33346,52 +33840,59 @@
Function26c8d: ; 26c8d
ld a, e
- jr .asm_26cca
+ jr Function26cca
+Function26c90: ; 26c90
call Function26c8d
ld a, $d
- jr .asm_26cca
+ jr Function26cca
+Function26c97: ; 26c97
call Function26c8d
ld a, $e
- jr .asm_26cca
+ jr Function26cca
+Function26c9e: ; 26c9e
ld a, e
- call $6cc0
+ call Function26cc0
ld a, $f
- jr .asm_26cca
+ jr Function26cca
+Function26ca6: ; 26ca6
ld a, e
- call $6cc0
+ call Function26cc0
ld a, $10
- jr .asm_26cca
+ jr Function26cca
+Function26cae: ; 26cae
push de
ld a, $11
- call $6cca
+ call Function26cca
pop de
ld a, e
- jr .asm_26cc0
+ jr Function26cc0
+Function26cb8: ; 26cb8
push de
- call $6cca
+ call Function26cca
pop de
ld a, e
- jr .asm_26cca
+ jr Function26cca
-.asm_26cc0
+Function26cc0: ; 26cc0
push bc
ld [$d265], a
call GetPokemonName
pop bc
- jr .asm_26cda
+ jr Function26cda
-.asm_26cca
- call $6ccf
- jr .asm_26cda
+Function26cca: ; 26cca
+ call Function26ccf
+ jr Function26cda
+Function26ccf: ; 26ccf
push bc
- ld hl, $6b8d
+ ld hl, DecorationNames
call GetNthString
ld d, h
ld e, l
@@ -33398,7 +33899,7 @@
pop bc
ret
-.asm_26cda
+Function26cda: ; 26cda
ld h, b
ld l, c
call CopyName2
@@ -33453,25 +33954,54 @@
Function26f59: ; 26f59
ld a, b
- ld hl, $6f5f
+ ld hl, Table26f5f
rst JumpTable
ret
; 26f5f
-INCBIN "baserom.gbc", $26f5f, $26fb9 - $26f5f
+Table26f5f: ; 26f5f
+ dw Function26f69
+ dw Function26fb9
+ dw Function26fbe
+ dw Function26fdd
+ dw Function26fc3
+; 26f69
+Function26f69: ; 26f69
+ ld a, [Poster]
+ ld hl, $6f84
+ ld de, $0003
+ call IsInArray
+ jr c, .asm_26f7d
+ ld de, $6fb8
+ ld b, $9
+ ret
+.asm_26f7d
+ ld b, $9
+ inc hl
+ ld a, [hli]
+ ld d, [hl]
+ ld e, a
+ ret
+; 26f84
+
+INCBIN "baserom.gbc", $26f84, $26fb9 - $26f84
+
+
Function26fb9: ; 26fb9
ld a, [LeftOrnament]
- jr .asm_26fc8
+ jr Function26fc8
+Function26fbe: ; 26fbe
ld a, [RightOrnament]
- jr .asm_26fc8
+ jr Function26fc8
+Function26fc3: ; 26fc3
ld a, [Console]
- jr .asm_26fc8
+ jr Function26fc8
-.asm_26fc8
+Function26fc8: ; 26fc8
ld c, a
ld de, StringBuffer3
call Function26eea
@@ -33489,9 +34019,118 @@
ret
; 26fe3
-INCBIN "baserom.gbc", $26fe3, $2709e - $26fe3
+INCBIN "baserom.gbc", $26fe3, $26feb - $26fe3
+Function26feb: ; 26feb
+ ld de, $0004
+ ld a, [Bed]
+ call Function27037
+ ld de, $0704
+ ld a, [Plant]
+ call Function27037
+ ld de, $0600
+ ld a, [Poster]
+ call Function27037
+ call Function27027
+ ld de, $0000
+ call Function27092
+ ld a, [Carpet]
+ and a
+ ret z
+ call Function27085
+ ld [hl], a
+ push af
+ ld de, $0002
+ call Function27092
+ pop af
+ inc a
+ ld [hli], a
+ inc a
+ ld [hli], a
+ dec a
+ ld [hl], a
+ ret
+; 27027
+Function27027: ; 27027
+ ld b, $1
+ ld a, [Poster]
+ and a
+ jr nz, .asm_27031
+ ld b, $0
+
+.asm_27031
+ ld de, $02cc
+ jp EventFlagAction
+; 27037
+
+Function27037: ; 27037
+ push af
+ call Function27092
+ pop af
+ and a
+ ret z
+ call Function27085
+ ld [hl], a
+ ret
+; 27043
+
+Function27043: ; 27043
+ ld de, $0741
+ ld hl, VariableSprites
+ ld a, [Console]
+ call Function27074
+ ld de, $0742
+ ld hl, $d82f
+ ld a, [LeftOrnament]
+ call Function27074
+ ld de, $0743
+ ld hl, $d830
+ ld a, [RightOrnament]
+ call Function27074
+ ld de, $0744
+ ld hl, $d831
+ ld a, [BigDoll]
+ call Function27074
+ ret
+; 27074
+
+Function27074: ; 27074
+ and a
+ jr z, .asm_27080
+ call Function27085
+ ld [hl], a
+ ld b, $0
+ jp EventFlagAction
+
+.asm_27080
+ ld b, $1
+ jp EventFlagAction
+; 27085
+
+Function27085: ; 27085
+ ld c, a
+ push de
+ push hl
+ callba Function26a44
+ pop hl
+ pop de
+ ld a, c
+ ret
+; 27092
+
+Function27092: ; 27092
+ ld a, d
+ add $4
+ ld d, a
+ ld a, e
+ add $4
+ ld e, a
+ call Function2a66
+ ret
+; 2709e
+
+
Function2709e: ; 2709e
ld a, [CurPartyMon]
ld hl, PartyMon1CaughtLocation
@@ -33514,100 +34153,8 @@
ret
; 270c4
+INCLUDE "trainers/dvs.asm"
-GetTrainerDVs: ; 270c4
-; get dvs based on trainer class
-; output: bc
- push hl
-; dec trainer class so there's no filler entry for $00
- ld a, [OtherTrainerClass]
- dec a
- ld c, a
- ld b, $0
-; seek table
- ld hl, TrainerClassDVs
- add hl, bc
- add hl, bc
-; get dvs
- ld a, [hli]
- ld b, a
- ld c, [hl]
-; we're done
- pop hl
- ret
-; 270d6
-
-TrainerClassDVs ; 270d6
-; AtkDef, SpdSpc
- db $9A, $77 ; falkner
- db $88, $88 ; bugsy
- db $98, $88 ; whitney
- db $98, $88 ; morty
- db $98, $88 ; pryce
- db $98, $88 ; jasmine
- db $98, $88 ; chuck
- db $7C, $DD ; clair
- db $DD, $DD ; rival1
- db $98, $88 ; pokemon prof
- db $DC, $DD ; will
- db $DC, $DD ; cal
- db $DC, $DD ; bruno
- db $7F, $DF ; karen
- db $DC, $DD ; koga
- db $DC, $DD ; champion
- db $98, $88 ; brock
- db $78, $88 ; misty
- db $98, $88 ; lt surge
- db $98, $88 ; scientist
- db $78, $88 ; erika
- db $98, $88 ; youngster
- db $98, $88 ; schoolboy
- db $98, $88 ; bird keeper
- db $58, $88 ; lass
- db $98, $88 ; janine
- db $D8, $C8 ; cooltrainerm
- db $7C, $C8 ; cooltrainerf
- db $69, $C8 ; beauty
- db $98, $88 ; pokemaniac
- db $D8, $A8 ; gruntm
- db $98, $88 ; gentleman
- db $98, $88 ; skier
- db $68, $88 ; teacher
- db $7D, $87 ; sabrina
- db $98, $88 ; bug catcher
- db $98, $88 ; fisher
- db $98, $88 ; swimmerm
- db $78, $88 ; swimmerf
- db $98, $88 ; sailor
- db $98, $88 ; super nerd
- db $98, $88 ; rival2
- db $98, $88 ; guitarist
- db $A8, $88 ; hiker
- db $98, $88 ; biker
- db $98, $88 ; blaine
- db $98, $88 ; burglar
- db $98, $88 ; firebreather
- db $98, $88 ; juggler
- db $98, $88 ; blackbelt
- db $D8, $A8 ; executivem
- db $98, $88 ; psychic
- db $6A, $A8 ; picnicker
- db $98, $88 ; camper
- db $7E, $A8 ; executivef
- db $98, $88 ; sage
- db $78, $88 ; medium
- db $98, $88 ; boarder
- db $98, $88 ; pokefanm
- db $68, $8A ; kimono girl
- db $68, $A8 ; twins
- db $6D, $88 ; pokefanf
- db $FD, $DE ; red
- db $9D, $DD ; blue
- db $98, $88 ; officer
- db $7E, $A8 ; gruntf
- db $98, $88 ; mysticalman
-; 2715c
-
Function2715c: ; 2715c
call WhiteBGMap
call ClearTileMap
@@ -33695,13 +34242,2502 @@
MoveEffects: ; 2732e
INCLUDE "battle/moves/move_effects.asm"
-INCBIN "baserom.gbc", $27a28, $27a2d - $27a28
+Function27a28: ; 27a28
+ call Function2500e
+ ld b, a
+ ret
+; 27a2d
SECTION "bankA",ROMX,BANK[$A]
-INCBIN "baserom.gbc", $28000, $2a0e7 - $28000
+Function28000: ; 28000
+ call WhiteBGMap
+ ld c, $50
+ call DelayFrames
+ call Functionfdb
+ call ClearSprites
+ call Function1ad2
+ xor a
+ ld [hSCX], a
+ ld [hSCY], a
+ ld c, $50
+ call DelayFrames
+ call Functionfdb
+ call Function1ad2
+ call Functione51
+ call Functione58
+ callba Function16d69a
+ call Function3200
+ ld hl, $c543
+ ld b, $2
+ ld c, $c
+ ld d, h
+ ld e, l
+ callba Function4d35b
+ ld hl, $c56c
+ ld de, $4419
+ call PlaceString
+ call Function28eff
+ call Function3200
+ ld hl, $cf5d
+ xor a
+ ld [hli], a
+ ld [hl], $50
+ ld a, [InLinkBattle]
+ cp $1
+ jp nz, Function28177
+Function2805d: ; 2805d
+ call Function28426
+ call Function28499
+ call Function28434
+ xor a
+ ld [$cf56], a
+ call Function87d
+ ld a, [$ffcb]
+ cp $2
+ jr nz, .asm_28091
+ ld c, $3
+ call DelayFrames
+ xor a
+ ld [hSerialSend], a
+ ld a, $1
+ ld [rSC], a
+ ld a, $81
+ ld [rSC], a
+ call DelayFrame
+ xor a
+ ld [hSerialSend], a
+ ld a, $1
+ ld [rSC], a
+ ld a, $81
+ ld [rSC], a
+
+.asm_28091
+ ld de, $0000
+ call StartMusic
+ ld c, $3
+ call DelayFrames
+ xor a
+ ld [rIF], a
+ ld a, $8
+ ld [rIE], a
+ ld hl, $d1f3
+ ld de, EnemyMonSpecies
+ ld bc, $0011
+ call Function75f
+ ld a, $fe
+ ld [de], a
+ ld hl, OverworldMap
+ ld de, $d26b
+ ld bc, $01a8
+ call Function75f
+ ld a, $fe
+ ld [de], a
+ ld hl, EnemyMoveAnimation
+ ld de, PlayerSDefLevel
+ ld bc, $00c8
+ call Function75f
+ xor a
+ ld [rIF], a
+ ld a, $1d
+ ld [rIE], a
+ call Function287ab
+ ld hl, $d26b
+ call Function287ca
+ push hl
+ ld bc, $000b
+ add hl, bc
+ ld a, [hl]
+ pop hl
+ and a
+ jp z, Function28b22
+ cp $7
+ jp nc, Function28b22
+ ld de, OverworldMap
+ ld bc, $01a2
+ call Function2879e
+ ld de, PlayerSDefLevel
+ ld hl, $c813
+ ld c, $2
+.asm_280fe
+ ld a, [de]
+ inc de
+ and a
+ jr z, .asm_280fe
+ cp $fd
+ jr z, .asm_280fe
+ cp $fe
+ jr z, .asm_280fe
+ cp $ff
+ jr z, .asm_2811d
+ push hl
+ push bc
+ ld b, $0
+ dec a
+ ld c, a
+ add hl, bc
+ ld a, $fe
+ ld [hl], a
+ pop bc
+ pop hl
+ jr .asm_280fe
+
+.asm_2811d
+ ld hl, $c90f
+ dec c
+ jr nz, .asm_280fe
+ ld hl, OverworldMap
+ ld de, $d26b
+ ld bc, $000b
+ call CopyBytes
+ ld de, OTPartyCount
+ ld a, [hli]
+ ld [de], a
+ inc de
+.asm_28135
+ ld a, [hli]
+ cp $ff
+ jr z, .asm_2814e
+ ld [$d265], a
+ push hl
+ push de
+ callab Functionfb908
+ pop de
+ pop hl
+ ld a, [$d265]
+ ld [de], a
+ inc de
+ jr .asm_28135
+
+.asm_2814e
+ ld [de], a
+ ld hl, $c813
+ call Function2868a
+ ld a, $a8
+ ld [$d102], a
+ ld a, $d3
+ ld [$d103], a
+ ld de, $0000
+ call StartMusic
+ ld a, [$ffcb]
+ cp $2
+ ld c, $42
+ call z, DelayFrames
+ ld de, $002b
+ call StartMusic
+ jp Function287e3
+; 28177
+
+Function28177: ; 28177
+ call Function28426
+ call Function28595
+ call Function28434
+ call Function29dba
+ ld a, [ScriptVar]
+ and a
+ jp z, Function283b2
+ ld a, [$ffcb]
+ cp $2
+ jr nz, .asm_281ae
+ ld c, $3
+ call DelayFrames
+ xor a
+ ld [hSerialSend], a
+ ld a, $1
+ ld [rSC], a
+ ld a, $81
+ ld [rSC], a
+ call DelayFrame
+ xor a
+ ld [hSerialSend], a
+ ld a, $1
+ ld [rSC], a
+ ld a, $81
+ ld [rSC], a
+
+.asm_281ae
+ ld de, $0000
+ call StartMusic
+ ld c, $3
+ call DelayFrames
+ xor a
+ ld [rIF], a
+ ld a, $8
+ ld [rIE], a
+ ld hl, $d1f3
+ ld de, EnemyMonSpecies
+ ld bc, $0011
+ call Function75f
+ ld a, $fe
+ ld [de], a
+ ld hl, OverworldMap
+ ld de, $d26b
+ ld bc, $01c2
+ call Function75f
+ ld a, $fe
+ ld [de], a
+ ld hl, EnemyMoveAnimation
+ ld de, PlayerSDefLevel
+ ld bc, $00c8
+ call Function75f
+ ld a, [InLinkBattle]
+ cp $2
+ jr nz, .asm_281fd
+ ld hl, $c9f4
+ ld de, $cb84
+ ld bc, $0186
+ call Function283f2
+
+.asm_281fd
+ xor a
+ ld [rIF], a
+ ld a, $1d
+ ld [rIE], a
+ ld de, $0000
+ call StartMusic
+ call Function287ab
+ ld hl, $d26b
+ call Function287ca
+ ld de, OverworldMap
+ ld bc, $01b9
+ call Function2879e
+ ld de, PlayerSDefLevel
+ ld hl, $c813
+ ld c, $2
+.asm_28224
+ ld a, [de]
+ inc de
+ and a
+ jr z, .asm_28224
+ cp $fd
+ jr z, .asm_28224
+ cp $fe
+ jr z, .asm_28224
+ cp $ff
+ jr z, .asm_28243
+ push hl
+ push bc
+ ld b, $0
+ dec a
+ ld c, a
+ add hl, bc
+ ld a, $fe
+ ld [hl], a
+ pop bc
+ pop hl
+ jr .asm_28224
+
+.asm_28243
+ ld hl, $c90f
+ dec c
+ jr nz, .asm_28224
+ ld a, [InLinkBattle]
+ cp $2
+ jp nz, .asm_282fe
+ ld hl, $cb84
+.asm_28254
+ ld a, [hli]
+ cp $20
+ jr nz, .asm_28254
+.asm_28259
+ ld a, [hli]
+ cp $fe
+ jr z, .asm_28259
+ cp $20
+ jr z, .asm_28259
+ dec hl
+ ld de, $cb84
+ ld bc, $0190
+ call CopyBytes
+ ld hl, $cb84
+ ld bc, $00c6
+.asm_28272
+ ld a, [hl]
+ cp $21
+ jr nz, .asm_28279
+ ld [hl], $fe
+
+.asm_28279
+ inc hl
+ dec bc
+ ld a, b
+ or c
+ jr nz, .asm_28272
+ ld de, $cc9e
+.asm_28282
+ ld a, [de]
+ inc de
+ cp $ff
+ jr z, .asm_28294
+ ld hl, $cc4a
+ dec a
+ ld b, $0
+ ld c, a
+ add hl, bc
+ ld [hl], $fe
+ jr .asm_28282
+
+.asm_28294
+ ld hl, $cb84
+ ld de, $c9f4
+ ld b, $6
+.asm_2829c
+ push bc
+ ld bc, $0021
+ call CopyBytes
+ ld a, $e
+ add e
+ ld e, a
+ ld a, $0
+ adc d
+ ld d, a
+ pop bc
+ dec b
+ jr nz, .asm_2829c
+ ld de, $c9f4
+ ld b, $6
+.asm_282b4
+ push bc
+ ld a, $21
+ add e
+ ld e, a
+ ld a, $0
+ adc d
+ ld d, a
+ ld bc, $000e
+ call CopyBytes
+ pop bc
+ dec b
+ jr nz, .asm_282b4
+ ld b, $6
+ ld de, $c9f4
+.asm_282cc
+ push bc
+ push de
+ callba Function1de5c8
+ ld a, c
+ or a
+ jr z, .asm_282ee
+ sub $3
+ jr nc, .asm_282e4
+ callba Function1df203
+ jr .asm_282ee
+
+.asm_282e4
+ cp $2
+ jr nc, .asm_282ee
+ callba Function1df220
+
+.asm_282ee
+ pop de
+ ld hl, $002f
+ add hl, de
+ ld d, h
+ ld e, l
+ pop bc
+ dec b
+ jr nz, .asm_282cc
+ ld de, $cb0e
+ xor a
+ ld [de], a
+
+.asm_282fe
+ ld hl, OverworldMap
+ ld de, $d26b
+ ld bc, $000b
+ call CopyBytes
+ ld de, OTPartyCount
+ ld bc, $0008
+ call CopyBytes
+ ld de, $d276
+ ld bc, $0002
+ call CopyBytes
+ ld de, OTPartyMon1Species
+ ld bc, $01a4
+ call CopyBytes
+ ld a, $a8
+ ld [$d102], a
+ ld a, $d3
+ ld [$d103], a
+ ld de, $0000
+ call StartMusic
+ ld a, [$ffcb]
+ cp $2
+ ld c, $42
+ call z, DelayFrames
+ ld a, [InLinkBattle]
+ cp $3
+ jr nz, .asm_283a9
+ ld a, $c
+ ld [OtherTrainerClass], a
+ call Functionfdb
+ callba Function4d354
+ ld hl, Options
+ ld a, [hl]
+ push af
+ and $20
+ or $3
+ ld [hl], a
+ ld hl, $d26b
+ ld de, $c656
+ ld bc, $000b
+ call CopyBytes
+ call Function222a
+ ld a, [$c2d7]
+ push af
+ ld a, $1
+ ld [$c2d7], a
+ ld a, [rIE]
+ push af
+ ld a, [rIF]
+ push af
+ xor a
+ ld [rIF], a
+ ld a, [rIE]
+ set 1, a
+ ld [rIE], a
+ pop af
+ ld [rIF], a
+ ld a, $16
+ call Predef
+ ld a, [rIF]
+ ld h, a
+ xor a
+ ld [rIF], a
+ pop af
+ ld [rIE], a
+ ld a, h
+ ld [rIF], a
+ pop af
+ ld [$c2d7], a
+ pop af
+ ld [Options], a
+ callba Function1500c
+ jp Function28b22
+
+.asm_283a9
+ ld de, $002b
+ call StartMusic
+ jp Function287e3
+; 283b2
+
+Function283b2: ; 283b2
+ ld de, $43ed
+ ld b, $a
+.asm_283b7
+ call DelayFrame
+ call Function908
+ dec b
+ jr nz, .asm_283b7
+ xor a
+ ld [hld], a
+ ld [hl], a
+ ld [$ff9e], a
+ push de
+ ld hl, $c590
+ ld b, $4
+ ld c, $12
+ push de
+ ld d, h
+ ld e, l
+ callba Function4d35b
+ pop de
+ pop hl
+ ld bc, $c5b9
+ call Function13e5
+ call Function4b6
+ call Functionfdb
+ ld b, $8
+ call GetSGBLayout
+ call Function3200
+ ret
+; 283ed
+
+INCBIN "baserom.gbc", $283ed, $283f2 - $283ed
+
+Function283f2: ; 283f2
+ ld a, $1
+ ld [$ffcc], a
+.asm_283f6
+ ld a, [hl]
+ ld [hSerialSend], a
+ call Function78a
+ push bc
+ ld b, a
+ inc hl
+ ld a, $30
+.asm_28401
+ dec a
+ jr nz, .asm_28401
+ ld a, [$ffcc]
+ and a
+ ld a, b
+ pop bc
+ jr z, .asm_28411
+ dec hl
+ xor a
+ ld [$ffcc], a
+ jr .asm_283f6
+
+.asm_28411
+ ld [de], a
+ inc de
+ dec bc
+ ld a, b
+ or c
+ jr nz, .asm_283f6
+ ret
+; 28419
+
+INCBIN "baserom.gbc", $28419, $28426 - $28419
+
+Function28426: ; 28426
+ ld hl, OverworldMap
+ ld bc, $0514
+.asm_2842c
+ xor a
+ ld [hli], a
+ dec bc
+ ld a, b
+ or c
+ jr nz, .asm_2842c
+ ret
+; 28434
+
+Function28434: ; 28434
+ ld hl, $d1f3
+ ld a, $fd
+ ld b, $7
+.asm_2843b
+ ld [hli], a
+ dec b
+ jr nz, .asm_2843b
+ ld b, $a
+.asm_28441
+ call Random
+ cp $fd
+ jr nc, .asm_28441
+ ld [hli], a
+ dec b
+ jr nz, .asm_28441
+ ld hl, EnemyMoveAnimation
+ ld a, $fd
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld b, $c8
+ xor a
+.asm_28457
+ ld [hli], a
+ dec b
+ jr nz, .asm_28457
+ ld hl, $c818
+ ld de, PlayerMoveType
+ ld bc, $0000
+.asm_28464
+ inc c
+ ld a, c
+ cp $fd
+ jr z, .asm_2848c
+ ld a, b
+ dec a
+ jr nz, .asm_2847f
+ push bc
+ ld a, [InLinkBattle]
+ cp $1
+ ld b, $d
+ jr z, .asm_2847a
+ ld b, $27
+
+.asm_2847a
+ ld a, c
+ cp b
+ pop bc
+ jr z, .asm_28495
+
+.asm_2847f
+ inc hl
+ ld a, [hl]
+ cp $fe
+ jr nz, .asm_28464
+ ld a, c
+ ld [de], a
+ inc de
+ ld [hl], $ff
+ jr .asm_28464
+
+.asm_2848c
+ ld a, $ff
+ ld [de], a
+ inc de
+ ld bc, Start
+ jr .asm_28464
+
+.asm_28495
+ ld a, $ff
+ ld [de], a
+ ret
+; 28499
+
+Function28499: ; 28499
+ ld de, OverworldMap
+ ld a, $fd
+ ld b, $6
+.asm_284a0
+ ld [de], a
+ inc de
+ dec b
+ jr nz, .asm_284a0
+ ld hl, PlayerName
+ ld bc, $000b
+ call CopyBytes
+ push de
+ ld hl, PartyCount
+ ld a, [hli]
+ ld [de], a
+ inc de
+.asm_284b5
+ ld a, [hli]
+ cp $ff
+ jr z, .asm_284ce
+ ld [$d265], a
+ push hl
+ push de
+ callab Functionfb8f1
+ pop de
+ pop hl
+ ld a, [$d265]
+ ld [de], a
+ inc de
+ jr .asm_284b5
+
+.asm_284ce
+ ld [de], a
+ pop de
+ ld hl, $0008
+ add hl, de
+ ld d, h
+ ld e, l
+ ld hl, PartyMon1Species
+ ld c, $6
+.asm_284db
+ push bc
+ call Function284f6
+ ld bc, $0030
+ add hl, bc
+ pop bc
+ dec c
+ jr nz, .asm_284db
+ ld hl, PartyMonOT
+ call .asm_284f0
+ ld hl, PartyMonNicknames
+.asm_284f0
+ ld bc, $0042
+ jp CopyBytes
+; 284f6
+
+Function284f6: ; 284f6
+ ld b, h
+ ld c, l
+ push de
+ push bc
+ ld a, [hl]
+ ld [$d265], a
+ callab Functionfb8f1
+ pop bc
+ pop de
+ ld a, [$d265]
+ ld [de], a
+ inc de
+ ld hl, $0022
+ add hl, bc
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [hl]
+ ld [de], a
+ inc de
+ xor a
+ ld [de], a
+ inc de
+ ld hl, $0020
+ add hl, bc
+ ld a, [hl]
+ ld [de], a
+ inc de
+ ld a, [bc]
+ cp $51
+ jr z, .asm_28528
+ cp $52
+ jr nz, .asm_28530
+
+.asm_28528
+ ld a, $17
+ ld [de], a
+ inc de
+ ld [de], a
+ inc de
+ jr .asm_28544
+
+.asm_28530
+ push bc
+ dec a
+ ld hl, $542b
+ ld bc, $0020
+ call AddNTimes
+ ld bc, $0002
+ ld a, $14
+ call FarCopyBytes
+ pop bc
+
+.asm_28544
+ push bc
+ ld hl, $0001
+ add hl, bc
+ ld bc, $001a
+ call CopyBytes
+ pop bc
+ ld hl, $001f
+ add hl, bc
+ ld a, [hl]
+ ld [de], a
+ ld [CurPartyLevel], a
+ inc de
+ push bc
+ ld hl, $0024
+ add hl, bc
+ ld bc, $0008
+ call CopyBytes
+ pop bc
+ push de
+ push bc
+ ld a, [bc]
+ dec a
+ push bc
+ ld b, $0
+ ld c, a
+ ld hl, $7656
+ add hl, bc
+ ld a, $3e
+ call GetFarByte
+ ld [BaseSpecialAttack], a
+ pop bc
+ ld hl, $000a
+ add hl, bc
+ ld c, $5
+ ld b, $1
+ ld a, $d
+ call Predef
+ pop bc
+ pop de
+ ld a, [$ffb5]
+ ld [de], a
+ inc de
+ ld a, [$ffb6]
+ ld [de], a
+ inc de
+ ld h, b
+ ld l, c
+ ret
+; 28595
+
+Function28595: ; 28595
+ ld de, OverworldMap
+ ld a, $fd
+ ld b, $6
+.asm_2859c
+ ld [de], a
+ inc de
+ dec b
+ jr nz, .asm_2859c
+ ld hl, PlayerName
+ ld bc, $000b
+ call CopyBytes
+ ld hl, PartyCount
+ ld bc, $0008
+ call CopyBytes
+ ld hl, PlayerID
+ ld bc, $0002
+ call CopyBytes
+ ld hl, PartyMon1Species
+ ld bc, $0120
+ call CopyBytes
+ ld hl, PartyMon1OT
+ ld bc, $0042
+ call CopyBytes
+ ld hl, PartyMon1Nickname
+ ld bc, $0042
+ call CopyBytes
+ ld a, [InLinkBattle]
+ cp $2
+ ret nz
+ ld de, $c9f4
+ ld a, $20
+ call Function28682
+ ld a, $0
+ call GetSRAMBank
+ ld hl, $a600
+ ld b, $6
+.asm_285ef
+ push bc
+ ld bc, $0021
+ call CopyBytes
+ ld bc, $000e
+ add hl, bc
+ pop bc
+ dec b
+ jr nz, .asm_285ef
+ ld hl, $a600
+ ld b, $6
+.asm_28603
+ push bc
+ ld bc, $0021
+ add hl, bc
+ ld bc, $000e
+ call CopyBytes
+ pop bc
+ dec b
+ jr nz, .asm_28603
+ ld b, $6
+ ld de, $a600
+ ld hl, $c9f9
+.asm_2861a
+ push bc
+ push hl
+ push de
+ push hl
+ callba Function1de5c8
+ pop de
+ ld a, c
+ or a
+ jr z, .asm_2863f
+ sub $3
+ jr nc, .asm_28635
+ callba Function1df1e6
+ jr .asm_2863f
+
+.asm_28635
+ cp $2
+ jr nc, .asm_2863f
+ callba Function1df220
+
+.asm_2863f
+ pop de
+ ld hl, $002f
+ add hl, de
+ ld d, h
+ ld e, l
+ pop hl
+ ld bc, $0021
+ add hl, bc
+ pop bc
+ dec b
+ jr nz, .asm_2861a
+ call CloseSRAM
+ ld hl, $c9f9
+ ld bc, $00c6
+.asm_28658
+ ld a, [hl]
+ cp $fe
+ jr nz, .asm_2865f
+ ld [hl], $21
+
+.asm_2865f
+ inc hl
+ dec bc
+ ld a, b
+ or c
+ jr nz, .asm_28658
+ ld hl, $cabf
+ ld de, $cb13
+ ld b, $54
+ ld c, $0
+.asm_2866f
+ inc c
+ ld a, [hl]
+ cp $fe
+ jr nz, .asm_2867a
+ ld [hl], $ff
+ ld a, c
+ ld [de], a
+ inc de
+
+.asm_2867a
+ inc hl
+ dec b
+ jr nz, .asm_2866f
+ ld a, $ff
+ ld [de], a
+ ret
+; 28682
+
+Function28682: ; 28682
+ ld c, $5
+.asm_28684
+ ld [de], a
+ inc de
+ dec c
+ jr nz, .asm_28684
+ ret
+; 2868a
+
+Function2868a: ; 2868a
+ push hl
+ ld d, h
+ ld e, l
+ ld bc, $cbea
+ ld hl, $cbe8
+ ld a, c
+ ld [hli], a
+ ld [hl], b
+ ld hl, OTPartyMon1Species
+ ld c, $6
+.asm_2869b
+ push bc
+ call Function286ba
+ pop bc
+ dec c
+ jr nz, .asm_2869b
+ pop hl
+ ld bc, $0108
+ add hl, bc
+ ld de, OTPartyMon1OT
+ ld bc, $0042
+ call CopyBytes
+ ld de, OTPartyMon1Nickname
+ ld bc, $0042
+ jp CopyBytes
+; 286ba
+
+Function286ba: ; 286ba
+ ld b, h
+ ld c, l
+ ld a, [de]
+ inc de
+ push bc
+ push de
+ ld [$d265], a
+ callab Functionfb908
+ pop de
+ pop bc
+ ld a, [$d265]
+ ld [bc], a
+ ld [CurSpecies], a
+ ld hl, $0022
+ add hl, bc
+ ld a, [de]
+ inc de
+ ld [hli], a
+ ld a, [de]
+ inc de
+ ld [hl], a
+ inc de
+ ld hl, $0020
+ add hl, bc
+ ld a, [de]
+ inc de
+ ld [hl], a
+ ld hl, $cbe8
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, [de]
+ ld [hli], a
+ inc de
+ ld a, [de]
+ ld [hli], a
+ inc de
+ ld a, l
+ ld [$cbe8], a
+ ld a, h
+ ld [$cbe9], a
+ push bc
+ ld hl, $0001
+ add hl, bc
+ push hl
+ ld h, d
+ ld l, e
+ pop de
+ push bc
+ ld a, [hli]
+ ld b, a
+ call Function28771
+ ld a, b
+ ld [de], a
+ inc de
+ pop bc
+ ld bc, $0019
+ call CopyBytes
+ pop bc
+ ld d, h
+ ld e, l
+ ld hl, $001f
+ add hl, bc
+ ld a, [de]
+ inc de
+ ld [hl], a
+ ld [CurPartyLevel], a
+ push bc
+ ld hl, $0024
+ add hl, bc
+ push hl
+ ld h, d
+ ld l, e
+ pop de
+ ld bc, $0008
+ call CopyBytes
+ pop bc
+ call GetBaseData
+ push de
+ push bc
+ ld d, h
+ ld e, l
+ ld hl, $000a
+ add hl, bc
+ ld c, $5
+ ld b, $1
+ ld a, $d
+ call Predef
+ pop bc
+ pop hl
+ ld a, [$ffb5]
+ ld [hli], a
+ ld a, [$ffb6]
+ ld [hli], a
+ push hl
+ push bc
+ ld hl, $000a
+ add hl, bc
+ ld c, $6
+ ld b, $1
+ ld a, $d
+ call Predef
+ pop bc
+ pop hl
+ ld a, [$ffb5]
+ ld [hli], a
+ ld a, [$ffb6]
+ ld [hli], a
+ push hl
+ ld hl, $001b
+ add hl, bc
+ ld a, $46
+ ld [hli], a
+ xor a
+ ld [hli], a
+ ld [hli], a
+ ld [hl], a
+ pop hl
+ inc de
+ inc de
+ ret
+; 28771
+
+Function28771: ; 28771
+ ld a, b
+ and a
+ ret z
+ push hl
+ ld hl, $4785
+.asm_28778
+ ld a, [hli]
+ and a
+ jr z, .asm_28783
+ cp b
+ jr z, .asm_28782
+ inc hl
+ jr .asm_28778
+
+.asm_28782
+ ld b, [hl]
+
+.asm_28783
+ pop hl
+ ret
+; 28785
+
+INCBIN "baserom.gbc", $28785, $2879e - $28785
+
+Function2879e: ; 2879e
+.asm_2879e
+ ld a, [hli]
+ cp $fe
+ jr z, .asm_2879e
+ ld [de], a
+ inc de
+ dec bc
+ ld a, b
+ or c
+ jr nz, .asm_2879e
+ ret
+; 287ab
+
+Function287ab: ; 287ab
+ ld a, [$ffcb]
+ cp $2
+ ret z
+ ld hl, EnemyMonSpecies
+ call Function287d8
+ ld de, LinkBattleRNs
+ ld c, $a
+.asm_287bb
+ ld a, [hli]
+ cp $fe
+ jr z, .asm_287bb
+ cp $fd
+ jr z, .asm_287bb
+ ld [de], a
+ inc de
+ dec c
+ jr nz, .asm_287bb
+ ret
+; 287ca
+
+Function287ca: ; 287ca
+.asm_287ca
+ ld a, [hli]
+ and a
+ jr z, .asm_287ca
+ cp $fd
+ jr z, .asm_287ca
+ cp $fe
+ jr z, .asm_287ca
+ dec hl
+ ret
+; 287d8
+
+Function287d8: ; 287d8
+.asm_287d8
+ ld a, [hli]
+ cp $fd
+ jr z, .asm_287d8
+ cp $fe
+ jr z, .asm_287d8
+ dec hl
+ ret
+; 287e3
+
+Function287e3: ; 287e3
+ call Functionfdb
+ call Function28ef8
+ callba Function16d673
+ xor a
+ ld hl, $cf51
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld [hl], a
+ ld a, $1
+ ld [$cfa9], a
+ inc a
+ ld [$cf56], a
+ jp Function2888b
+; 28803
+
+Function28803: ; 28803
+ ld a, $1
+ ld [MonType], a
+ ld a, $c1
+ ld [$cfa8], a
+ ld a, [OTPartyCount]
+ ld [$cfa3], a
+ ld a, $1
+ ld [$cfa4], a
+ ld a, $9
+ ld [$cfa1], a
+ ld a, $6
+ ld [$cfa2], a
+ ld a, $1
+ ld [$cfaa], a
+ ld a, $10
+ ld [$cfa7], a
+ ld a, $20
+ ld [$cfa5], a
+ xor a
+ ld [$cfa6], a
+
+Function28835: ; 28835
+ callba Function16d70c
+ ld a, d
+ and a
+ jp z, Function2891c
+ bit 0, a
+ jr z, .asm_2885b
+ ld a, $1
+ ld [$d263], a
+ callab Function50db9
+ ld hl, OTPartyMon1Species
+ callba Function4d319
+ jp Function2891c
+
+.asm_2885b
+ bit 6, a
+ jr z, .asm_28883
+ ld a, [$cfa9]
+ ld b, a
+ ld a, [OTPartyCount]
+ cp b
+ jp nz, Function2891c
+ xor a
+ ld [MonType], a
+ call Function1bf7
+ push hl
+ push bc
+ ld bc, $000b
+ add hl, bc
+ ld [hl], $7f
+ pop bc
+ pop hl
+ ld a, [PartyCount]
+ ld [$cfa9], a
+ jr Function2888b
+
+.asm_28883
+ bit 7, a
+ jp z, Function2891c
+ jp Function28ac9
+; 2888b
+
+Function2888b: ; 2888b
+ callba Function49856
+ xor a
+ ld [MonType], a
+ ld a, $c1
+ ld [$cfa8], a
+ ld a, [PartyCount]
+ ld [$cfa3], a
+ ld a, $1
+ ld [$cfa4], a
+ ld a, $1
+ ld [$cfa1], a
+ ld a, $6
+ ld [$cfa2], a
+ ld a, $1
+ ld [$cfaa], a
+ ld a, $10
+ ld [$cfa7], a
+ ld a, $20
+ ld [$cfa5], a
+ xor a
+ ld [$cfa6], a
+ call Function3200
+
+Function288c5: ; 288c5
+ callba Function16d70c
+ ld a, d
+ and a
+ jr nz, .asm_288d2
+ jp Function2891c
+
+.asm_288d2
+ bit 0, a
+ jr z, .asm_288d9
+ jp Function28926
+
+.asm_288d9
+ bit 7, a
+ jr z, .asm_288fe
+ ld a, [$cfa9]
+ dec a
+ jp nz, Function2891c
+ ld a, $1
+ ld [MonType], a
+ call Function1bf7
+ push hl
+ push bc
+ ld bc, $000b
+ add hl, bc
+ ld [hl], $7f
+ pop bc
+ pop hl
+ ld a, $1
+ ld [$cfa9], a
+ jp Function28803
+
+.asm_288fe
+ bit 6, a
+ jr z, Function2891c
+ ld a, [$cfa9]
+ ld b, a
+ ld a, [PartyCount]
+ cp b
+ jr nz, Function2891c
+ call Function1bf7
+ push hl
+ push bc
+ ld bc, $000b
+ add hl, bc
+ ld [hl], $7f
+ pop bc
+ pop hl
+ jp Function28ade
+; 2891c
+
+Function2891c: ; 2891c
+ ld a, [MonType]
+ and a
+ jp z, Function288c5
+ jp Function28835
+; 28926
+
+Function28926: ; 28926
+ call Function309d
+ ld a, [$cfa9]
+ push af
+ ld hl, $c5cc
+ ld b, $1
+ ld c, $12
+ call Function28eef
+ ld hl, $c5e2
+ ld de, $4ab4
+ call PlaceString
+ callba Function4d354
+
+.asm_28946
+ ld a, $7f
+ ld [$c5eb], a
+ ld a, $13
+ ld [$cfa8], a
+ ld a, $1
+ ld [$cfa3], a
+ ld a, $1
+ ld [$cfa4], a
+ ld a, $10
+ ld [$cfa1], a
+ ld a, $1
+ ld [$cfa2], a
+ ld a, $1
+ ld [$cfa9], a
+ ld [$cfaa], a
+ ld a, $20
+ ld [$cfa7], a
+ xor a
+ ld [$cfa5], a
+ ld [$cfa6], a
+ call Function1bd3
+ bit 4, a
+ jr nz, .asm_2898d
+ bit 1, a
+ jr z, .asm_289cd
+.asm_28983
+ pop af
+ ld [$cfa9], a
+ call Function30b4
+ jp Function2888b
+
+.asm_2898d
+ ld a, $7f
+ ld [$c5e1], a
+ ld a, $23
+ ld [$cfa8], a
+ ld a, $1
+ ld [$cfa3], a
+ ld a, $1
+ ld [$cfa4], a
+ ld a, $10
+ ld [$cfa1], a
+ ld a, $b
+ ld [$cfa2], a
+ ld a, $1
+ ld [$cfa9], a
+ ld [$cfaa], a
+ ld a, $20
+ ld [$cfa7], a
+ xor a
+ ld [$cfa5], a
+ ld [$cfa6], a
+ call Function1bd3
+ bit 5, a
+ jp nz, .asm_28946
+ bit 1, a
+ jr nz, .asm_28983
+ jr .asm_289fe
+
+.asm_289cd
+ pop af
+ ld [$cfa9], a
+ ld a, $4
+ ld [$d263], a
+ callab Function50db9
+ callba Function4d319
+ call Function30b4
+ ld hl, $c4ba
+ ld bc, $0601
+ ld a, $7f
+ call Function28b77
+ ld hl, $c4c5
+ ld bc, $0601
+ ld a, $7f
+ call Function28b77
+ jp Function2888b
+
+.asm_289fe
+ call Function1bee
+ pop af
+ ld [$cfa9], a
+ dec a
+ ld [DefaultFlypoint], a
+ ld [$cf56], a
+ callba Function16d6ce
+ ld a, [$cf51]
+ cp $f
+ jp z, Function287e3
+ ld [$d003], a
+ call Function28b68
+ ld c, $64
+ call DelayFrames
+ callba Functionfb57e
+ jr c, .asm_28a58
+ callba Functionfb5dd
+ jp nc, Function28b87
+ xor a
+ ld [$cf57], a
+ ld [$cf52], a
+ ld hl, $c590
+ ld b, $4
+ ld c, $12
+ call Function28eef
+ callba Function4d354
+ ld hl, $4aaf
+ ld bc, $c5b9
+ call Function13e5
+ jr .asm_28a89
+
+.asm_28a58
+ xor a
+ ld [$cf57], a
+ ld [$cf52], a
+ ld a, [$d003]
+ ld hl, OTPartySpecies
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [hl]
+ ld [$d265], a
+ call GetPokemonName
+ ld hl, $c590
+ ld b, $4
+ ld c, $12
+ call Function28eef
+ callba Function4d354
+ ld hl, $4ac4
+ ld bc, $c5b9
+ call Function13e5
+
+.asm_28a89
+ ld hl, $c590
+ ld b, $4
+ ld c, $12
+ call Function28eef
+ ld hl, $c5b9
+ ld de, $4ece
+ call PlaceString
+ ld a, $1
+ ld [$cf56], a
+ callba Function16d6ce
+ ld c, $64
+ call DelayFrames
+ jp Function287e3
+; 28aaf
+
+INCBIN "baserom.gbc", $28aaf, $28ac9 - $28aaf
+
+Function28ac9: ; 28ac9
+ ld a, [$cfa9]
+ cp $1
+ jp nz, Function2891c
+ call Function1bf7
+ push hl
+ push bc
+ ld bc, $000b
+ add hl, bc
+ ld [hl], $7f
+ pop bc
+ pop hl
+
+Function28ade: ; 28ade
+.asm_28ade
+ ld a, $ed
+ ld [$c5fd], a
+.asm_28ae3
+ call Functiona57
+ ld a, [$ffa9]
+ and a
+ jr z, .asm_28ae3
+ bit 0, a
+ jr nz, .asm_28b0b
+ push af
+ ld a, $7f
+ ld [$c5fd], a
+ pop af
+ bit 6, a
+ jr z, .asm_28b03
+ ld a, [OTPartyCount]
+ ld [$cfa9], a
+ jp Function28803
+
+.asm_28b03
+ ld a, $1
+ ld [$cfa9], a
+ jp Function2888b
+
+.asm_28b0b
+ ld a, $ec
+ ld [$c5fd], a
+ ld a, $f
+ ld [$cf56], a
+ callba Function16d6ce
+ ld a, [$cf51]
+ cp $f
+ jr nz, .asm_28ade
+
+Function28b22: ; 28b22
+ call Function4b6
+ call Functionfdb
+ ld b, $8
+ call GetSGBLayout
+ call Function3200
+ xor a
+ ld [$cfbb], a
+ xor a
+ ld [rSB], a
+ ld [hSerialSend], a
+ ld a, $1
+ ld [rSC], a
+ ld a, $81
+ ld [rSC], a
+ ret
+; 28b42
+
+INCBIN "baserom.gbc", $28b42, $28b68 - $28b42
+
+Function28b68: ; 28b68
+ ld a, [$cf51]
+ ld hl, $c55a
+ ld bc, $0014
+ call AddNTimes
+ ld [hl], $ec
+ ret
+; 28b77
+
+Function28b77: ; 28b77
+.asm_28b77
+ push bc
+ push hl
+.asm_28b79
+ ld [hli], a
+ dec c
+ jr nz, .asm_28b79
+ pop hl
+ ld bc, $0014
+ add hl, bc
+ pop bc
+ dec b
+ jr nz, .asm_28b77
+ ret
+; 28b87
+
+Function28b87: ; 28b87
+ xor a
+ ld [$cf57], a
+ ld [$cf52], a
+ ld hl, $c590
+ ld b, $4
+ ld c, $12
+ call Function28eef
+ callba Function4d354
+ ld a, [DefaultFlypoint]
+ ld hl, PartySpecies
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [hl]
+ ld [$d265], a
+ call GetPokemonName
+ ld hl, StringBuffer1
+ ld de, $d004
+ ld bc, $000b
+ call CopyBytes
+ ld a, [$d003]
+ ld hl, OTPartySpecies
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [hl]
+ ld [$d265], a
+ call GetPokemonName
+ ld hl, $4eb8
+ ld bc, $c5b9
+ call Function13e5
+ call Function1d6e
+ ld hl, $c536
+ ld b, $3
+ ld c, $7
+ call Function28eef
+ ld de, $4eab
+ ld hl, $c54c
+ call PlaceString
+ ld a, $8
+ ld [$cfa1], a
+ ld a, $b
+ ld [$cfa2], a
+ ld a, $1
+ ld [$cfa4], a
+ ld a, $2
+ ld [$cfa3], a
+ xor a
+ ld [$cfa5], a
+ ld [$cfa6], a
+ ld a, $20
+ ld [$cfa7], a
+ ld a, $3
+ ld [$cfa8], a
+ ld a, $1
+ ld [$cfa9], a
+ ld [$cfaa], a
+ callba Function4d354
+ call Function1bd3
+ push af
+ call Function1d7d
+ call Function3200
+ pop af
+ bit 1, a
+ jr nz, .asm_28c33
+ ld a, [$cfa9]
+ dec a
+ jr z, .asm_28c54
+
+.asm_28c33
+ ld a, $1
+ ld [$cf56], a
+ ld hl, $c590
+ ld b, $4
+ ld c, $12
+ call Function28eef
+ ld hl, $c5b9
+ ld de, $4ece
+ call PlaceString
+ callba Function16d6ce
+ jp Function28ea3
+
+.asm_28c54
+ ld a, $2
+ ld [$cf56], a
+ callba Function16d6ce
+ ld a, [$cf51]
+ dec a
+ jr nz, .asm_28c7b
+ ld hl, $c590
+ ld b, $4
+ ld c, $12
+ call Function28eef
+ ld hl, $c5b9
+ ld de, $4ece
+ call PlaceString
+ jp Function28ea3
+
+.asm_28c7b
+ ld hl, $a600
+ ld a, [DefaultFlypoint]
+ ld bc, $002f
+ call AddNTimes
+ ld a, $0
+ call GetSRAMBank
+ ld d, h
+ ld e, l
+ ld bc, $002f
+ add hl, bc
+ ld a, [DefaultFlypoint]
+ ld c, a
+.asm_28c96
+ inc c
+ ld a, c
+ cp $6
+ jr z, .asm_28ca6
+ push bc
+ ld bc, $002f
+ call CopyBytes
+ pop bc
+ jr .asm_28c96
+
+.asm_28ca6
+ ld hl, $a600
+ ld a, [PartyCount]
+ dec a
+ ld bc, $002f
+ call AddNTimes
+ push hl
+ ld hl, $c9f4
+ ld a, [$d003]
+ ld bc, $002f
+ call AddNTimes
+ pop de
+ ld bc, $002f
+ call CopyBytes
+ call CloseSRAM
+ ld hl, PlayerName
+ ld de, $c6e7
+ ld bc, $000b
+ call CopyBytes
+ ld a, [DefaultFlypoint]
+ ld hl, PartySpecies
+ ld b, $0
+ ld c, a
+ add hl, bc
+ ld a, [hl]
+ ld [PlayerSDefLevel], a
+ push af
+ ld a, [DefaultFlypoint]
+ ld hl, PartyMon1OT
+ call SkipNames
+ ld de, $c6f2
+ ld bc, $000b
+ call CopyBytes
+ ld hl, PartyMon1ID
+ ld a, [DefaultFlypoint]
+ call GetPartyLocation
+ ld a, [hli]
+ ld [PlayerScreens], a
+ ld a, [hl]
+ ld [EnemyScreens], a
+ ld hl, PartyMon1DVs
+ ld a, [DefaultFlypoint]
+ call GetPartyLocation
+ ld a, [hli]
+ ld [$c6fd], a
+ ld a, [hl]
+ ld [$c6fe], a
+ ld a, [DefaultFlypoint]
+ ld hl, PartyMon1Species
+ call GetPartyLocation
+ ld b, h
+ ld c, l
+ callba Function4f301
+ ld a, c
+ ld [$c701], a
+ ld hl, $d26b
+ ld de, $c719
+ ld bc, $000b
+ call CopyBytes
+ ld a, [$d003]
+ ld hl, OTPartySpecies
+ ld b, $0
+ ld c, a
+ add hl, bc
+ ld a, [hl]
+ ld [PlayerLightScreenCount], a
+ ld a, [$d003]
+ ld hl, OTPartyMon1OT
+ call SkipNames
+ ld de, $c724
+ ld bc, $000b
+ call CopyBytes
+ ld hl, OTPartyMon1ID
+ ld a, [$d003]
+ call GetPartyLocation
+ ld a, [hli]
+ ld [$c731], a
+ ld a, [hl]
+ ld [$c732], a
+ ld hl, OTPartyMon1AtkDefDV
+ ld a, [$d003]
+ call GetPartyLocation
+ ld a, [hli]
+ ld [$c72f], a
+ ld a, [hl]
+ ld [$c730], a
+ ld a, [$d003]
+ ld hl, OTPartyMon1Species
+ call GetPartyLocation
+ ld b, h
+ ld c, l
+ callba Function4f301
+ ld a, c
+ ld [$c733], a
+ ld a, [DefaultFlypoint]
+ ld [CurPartyMon], a
+ ld hl, PartySpecies
+ ld b, $0
+ ld c, a
+ add hl, bc
+ ld a, [hl]
+ ld [DefaultFlypoint], a
+ xor a
+ ld [$d10b], a
+ callab Functione039
+ ld a, [PartyCount]
+ dec a
+ ld [CurPartyMon], a
+ ld a, $1
+ ld [$d1e9], a
+ ld a, [$d003]
+ push af
+ ld hl, OTPartySpecies
+ ld b, $0
+ ld c, a
+ add hl, bc
+ ld a, [hl]
+ ld [$d003], a
+ ld c, $64
+ call DelayFrames
+ call ClearTileMap
+ call Functione58
+ ld b, $8
+ call GetSGBLayout
+ ld a, [$ffcb]
+ cp $1
+ jr z, .asm_28de4
+ ld a, $1e
+ call Predef
+ jr .asm_28de9
+
+.asm_28de4
+ ld a, $1d
+ call Predef
+
+.asm_28de9
+ pop af
+ ld c, a
+ ld [CurPartyMon], a
+ ld hl, OTPartySpecies
+ ld d, $0
+ ld e, a
+ add hl, de
+ ld a, [hl]
+ ld [CurPartySpecies], a
+ ld hl, OTPartyMon1Species
+ ld a, c
+ call GetPartyLocation
+ ld de, TempMonSpecies
+ ld bc, $0030
+ call CopyBytes
+ ld a, $7
+ call Predef
+ ld a, [PartyCount]
+ dec a
+ ld [CurPartyMon], a
+ callab Function421d8
+ call Functionfdb
+ call Function28ef8
+ call Function28eff
+ callba Function4d354
+ ld b, $1
+ pop af
+ ld c, a
+ cp $97
+ jr z, .asm_28e49
+ ld a, [CurPartySpecies]
+ cp $97
+ jr z, .asm_28e49
+ ld b, $2
+ ld a, c
+ cp $fb
+ jr z, .asm_28e49
+ ld a, [CurPartySpecies]
+ cp $fb
+ jr z, .asm_28e49
+ ld b, $0
+
+.asm_28e49
+ ld a, b
+ ld [$cf56], a
+ push bc
+ call Function862
+ pop bc
+ ld a, [InLinkBattle]
+ cp $1
+ jr z, .asm_28e63
+ ld a, b
+ and a
+ jr z, .asm_28e63
+ ld a, [$cf52]
+ cp b
+ jr nz, .asm_28e49
+
+.asm_28e63
+ callba Function14a58
+ callba Function1060af
+ callba Function106187
+ ld c, $28
+ call DelayFrames
+ ld hl, $c590
+ ld b, $4
+ ld c, $12
+ call Function28eef
+ ld hl, $c5b9
+ ld de, $4ebd
+ call PlaceString
+ callba Function4d354
+ ld c, $32
+ call DelayFrames
+ ld a, [InLinkBattle]
+ cp $1
+ jp z, Function2805d
+ jp Function28177
+; 28ea3
+
+Function28ea3: ; 28ea3
+ ld c, $64
+ call DelayFrames
+ jp Function287e3
+; 28eab
+
+INCBIN "baserom.gbc", $28eab, $28eef - $28eab
+
+Function28eef: ; 28eef
+ ld d, h
+ ld e, l
+ callba Function16d6ca
+ ret
+; 28ef8
+
+Function28ef8: ; 28ef8
+ callba Function16d696
+ ret
+; 28eff
+
+Function28eff: ; 28eff
+ callba Function16d6a7
+ call Function32f9
+ ret
+; 28f09
+
+INCBIN "baserom.gbc", $28f09, $29bfb - $28f09
+
+Function29bfb: ; 29bfb
+ ld hl, PartySpecies
+ ld b, $6
+.asm_29c00
+ ld a, [hli]
+ cp $ff
+ jr z, .asm_29c0c
+ cp $98
+ jr nc, .asm_29c42
+ dec b
+ jr nz, .asm_29c00
+
+.asm_29c0c
+ ld a, [PartyCount]
+ ld b, a
+ ld hl, PartyMon1Item
+.asm_29c13
+ push hl
+ push bc
+ ld d, [hl]
+ callba Functionb9e76
+ pop bc
+ pop hl
+ jr c, .asm_29c5e
+ ld de, $0030
+ add hl, de
+ dec b
+ jr nz, .asm_29c13
+ ld hl, PartyMon1Move1
+ ld a, [PartyCount]
+ ld b, a
+.asm_29c2e
+ ld c, $4
+.asm_29c30
+ ld a, [hli]
+ cp $a6
+ jr nc, .asm_29c4c
+ dec c
+ jr nz, .asm_29c30
+ ld de, $002c
+ add hl, de
+ dec b
+ jr nz, .asm_29c2e
+ xor a
+ jr .asm_29c63
+
+.asm_29c42
+ ld [$d265], a
+ call GetPokemonName
+ ld a, $1
+ jr .asm_29c63
+
+.asm_29c4c
+ push bc
+ ld [$d265], a
+ call GetMoveName
+ call CopyName1
+ pop bc
+ call Function29c67
+ ld a, $2
+ jr .asm_29c63
+
+.asm_29c5e
+ call Function29c67
+ ld a, $3
+
+.asm_29c63
+ ld [ScriptVar], a
+ ret
+; 29c67
+
+Function29c67: ; 29c67
+ ld a, [PartyCount]
+ sub b
+ ld c, a
+ inc c
+ ld b, $0
+ ld hl, PartyCount
+ add hl, bc
+ ld a, [hl]
+ ld [$d265], a
+ call GetPokemonName
+ ret
+; 29c7b
+
+Function29c7b: ; 29c7b
+ ld c, $a
+ call DelayFrames
+ ld a, $4
+ call Function29f17
+ ld c, $28
+ call DelayFrames
+ xor a
+ ld [$ff9e], a
+ inc a
+ ld [InLinkBattle], a
+ ret
+; 29c92
+
+Function29c92: ; 29c92
+ ld c, $3
+ call DelayFrames
+ ld a, $ff
+ ld [$ffcb], a
+ xor a
+ ld [rSB], a
+ ld [hSerialReceive], a
+ ld a, $1
+ ld [rSC], a
+ ld a, $81
+ ld [rSC], a
+ ld c, $3
+ call DelayFrames
+ xor a
+ ld [rSB], a
+ ld [hSerialReceive], a
+ ld a, $0
+ ld [rSC], a
+ ld a, $80
+ ld [rSC], a
+ ld c, $3
+ call DelayFrames
+ xor a
+ ld [rSB], a
+ ld [hSerialReceive], a
+ ld [rSC], a
+ ld c, $3
+ call DelayFrames
+ ld a, $ff
+ ld [$ffcb], a
+ ld a, [rIF]
+ push af
+ xor a
+ ld [rIF], a
+ ld a, $f
+ ld [rIE], a
+ pop af
+ ld [rIF], a
+ ld hl, $cf5b
+ xor a
+ ld [hli], a
+ ld [hl], a
+ ld [$ff9e], a
+ ld [InLinkBattle], a
+ ret
+; 29ce8
+
+Function29ce8: ; 29ce8
+ ld a, $1
+ ld [$cf56], a
+ ld [$d265], a
+ ret
+; 29cf1
+
+Function29cf1: ; 29cf1
+ ld a, $2
+ ld [$cf56], a
+ ld [$d265], a
+ ret
+; 29cfa
+
+Function29cfa: ; 29cfa
+ ld a, $2
+ ld [rSB], a
+ xor a
+ ld [hSerialReceive], a
+ ld a, $0
+ ld [rSC], a
+ ld a, $80
+ ld [rSC], a
+ xor a
+ ld [$cf56], a
+ ld [$d265], a
+ ret
+; 29d11
+
+Function29d11: ; 29d11
+ ld a, [$cf56]
+ and a
+ jr z, .asm_29d2f
+ ld a, $2
+ ld [rSB], a
+ xor a
+ ld [hSerialReceive], a
+ ld a, $0
+ ld [rSC], a
+ ld a, $80
+ ld [rSC], a
+ call DelayFrame
+ call DelayFrame
+ call DelayFrame
+
+.asm_29d2f
+ ld a, $2
+ ld [$cf5c], a
+ ld a, $ff
+ ld [$cf5b], a
+.asm_29d39
+ ld a, [$ffcb]
+ cp $2
+ jr z, .asm_29d79
+ cp $1
+ jr z, .asm_29d79
+ ld a, $ff
+ ld [$ffcb], a
+ ld a, $2
+ ld [rSB], a
+ xor a
+ ld [hSerialReceive], a
+ ld a, $0
+ ld [rSC], a
+ ld a, $80
+ ld [rSC], a
+ ld a, [$cf5b]
+ dec a
+ ld [$cf5b], a
+ jr nz, .asm_29d68
+ ld a, [$cf5c]
+ dec a
+ ld [$cf5c], a
+ jr z, .asm_29d8d
+
+.asm_29d68
+ ld a, $1
+ ld [rSB], a
+ ld a, $1
+ ld [rSC], a
+ ld a, $81
+ ld [rSC], a
+ call DelayFrame
+ jr .asm_29d39
+
+.asm_29d79
+ call Function908
+ call DelayFrame
+ call Function908
+ ld c, $32
+ call DelayFrames
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+
+.asm_29d8d
+ xor a
+ ld [ScriptVar], a
+ ret
+; 29d92
+
+Function29d92: ; 29d92
+ ld a, $1
+ ld [$cf56], a
+ ld hl, $cf5b
+ ld a, $3
+ ld [hli], a
+ xor a
+ ld [hl], a
+ call WaitBGMap
+ ld a, $2
+ ld [$ff9e], a
+ call DelayFrame
+ call DelayFrame
+ call Function29e0c
+ xor a
+ ld [$ff9e], a
+ ld a, [ScriptVar]
+ and a
+ ret nz
+ jp Function29f04
+; 29dba
+
+Function29dba: ; 29dba
+ ld a, $5
+ ld [$cf56], a
+ ld hl, $cf5b
+ ld a, $3
+ ld [hli], a
+ xor a
+ ld [hl], a
+ call WaitBGMap
+ ld a, $2
+ ld [$ff9e], a
+ call DelayFrame
+ call DelayFrame
+ call Function29e0c
+ ld a, [ScriptVar]
+ and a
+ jr z, .asm_29e08
+ ld bc, rIE
+.asm_29de0
+ dec bc
+ ld a, b
+ or c
+ jr nz, .asm_29de0
+ ld a, [$cf51]
+ cp $5
+ jr nz, .asm_29e03
+ ld a, $6
+ ld [$cf56], a
+ ld hl, $cf5b
+ ld a, $1
+ ld [hli], a
+ ld [hl], $32
+ call Function29e0c
+ ld a, [$cf51]
+ cp $6
+ jr z, .asm_29e08
+
+.asm_29e03
+ xor a
+ ld [ScriptVar], a
+ ret
+
+.asm_29e08
+ xor a
+ ld [$ff9e], a
+ ret
+; 29e0c
+
+Function29e0c: ; 29e0c
+ xor a
+ ld [$ffca], a
+ ld a, [$cf5b]
+ ld h, a
+ ld a, [$cf5c]
+ ld l, a
+ push hl
+ call Function29e3b
+ pop hl
+ jr nz, .asm_29e2f
+ call Function29e47
+ call Function29e53
+ call Function29e3b
+ jr nz, .asm_29e2f
+ call Function29e47
+ xor a
+ jr .asm_29e31
+
+.asm_29e2f
+ ld a, $1
+
+.asm_29e31
+ ld [ScriptVar], a
+ ld hl, $cf5b
+ xor a
+ ld [hli], a
+ ld [hl], a
+ ret
+; 29e3b
+
+Function29e3b: ; 29e3b
+ call Function87d
+ ld hl, $cf5b
+ ld a, [hli]
+ inc a
+ ret nz
+ ld a, [hl]
+ inc a
+ ret
+; 29e47
+
+Function29e47: ; 29e47
+ ld b, $a
+.asm_29e49
+ call DelayFrame
+ call Function908
+ dec b
+ jr nz, .asm_29e49
+ ret
+; 29e53
+
+Function29e53: ; 29e53
+ dec h
+ srl h
+ rr l
+ srl h
+ rr l
+ inc h
+ ld a, h
+ ld [$cf5b], a
+ ld a, l
+ ld [$cf5c], a
+ ret
+; 29e66
+
+Function29e66: ; 29e66
+ ld a, [$d265]
+ push af
+ callba Function14ab2
+ ld a, $1
+ jr nc, .asm_29e75
+ xor a
+
+.asm_29e75
+ ld [ScriptVar], a
+ ld c, $1e
+ call DelayFrames
+ pop af
+ ld [$d265], a
+ ret
+; 29e82
+
+Function29e82: ; 29e82
+ ld a, [$d265]
+ call Function29f17
+ push af
+ call Function908
+ call DelayFrame
+ call Function908
+ pop af
+ ld b, a
+ ld a, [$d265]
+ cp b
+ jr nz, .asm_29eaa
+ ld a, [$d265]
+ inc a
+ ld [InLinkBattle], a
+ xor a
+ ld [$ff9e], a
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+
+.asm_29eaa
+ xor a
+ ld [ScriptVar], a
+ ret
+; 29eaf
+
+Function29eaf: ; 29eaf
+ ld a, $1
+ ld [InLinkBattle], a
+ call Function2ed3
+ callab Function28000
+ call Function2ee4
+ xor a
+ ld [$ff9e], a
+ ret
+; 29ec4
+
+Function29ec4: ; 29ec4
+ ld a, $2
+ ld [InLinkBattle], a
+ call Function2ed3
+ callab Function28000
+ call Function2ee4
+ xor a
+ ld [$ff9e], a
+ ret
+; 29ed9
+
+Function29ed9: ; 29ed9
+ ld a, $3
+ ld [InLinkBattle], a
+ call Function2ed3
+ callab Function28000
+ call Function2ee4
+ xor a
+ ld [$ff9e], a
+ ret
+; 29eee
+
+Function29eee: ; 29eee
+ xor a
+ ld [InLinkBattle], a
+ ld c, $3
+ call DelayFrames
+ jp Function29f04
+; 29efa
+
+Function29efa: ; 29efa
+ ld c, $28
+ call DelayFrames
+ ld a, $e
+ jp Function29f17
+; 29f04
+
+Function29f04: ; 29f04
+ ld c, $3
+ call DelayFrames
+ ld a, $ff
+ ld [$ffcb], a
+ ld a, $2
+ ld [rSB], a
+ xor a
+ ld [hSerialReceive], a
+ ld [rSC], a
+ ret
+; 29f17
+
+Function29f17: ; 29f17
+ add $d0
+ ld [$cf56], a
+ ld [$cf57], a
+ ld a, $2
+ ld [$ff9e], a
+ call DelayFrame
+ call DelayFrame
+.asm_29f29
+ call Function83b
+ ld a, [$cf51]
+ ld b, a
+ and $f0
+ cp $d0
+ jr z, .asm_29f40
+ ld a, [$cf52]
+ ld b, a
+ and $f0
+ cp $d0
+ jr nz, .asm_29f29
+
+.asm_29f40
+ xor a
+ ld [$ff9e], a
+ ld a, b
+ and $f
+ ret
+; 29f47
+
+Function29f47: ; 29f47
+ ld a, [$ffcb]
+ cp $1
+ ld a, $1
+ jr z, .asm_29f50
+ dec a
+
+.asm_29f50
+ ld [ScriptVar], a
+ ret
+; 29f54
+
+INCBIN "baserom.gbc", $29f54, $2a0e7 - $29f54
+
Function2a0e7: ; 2a0e7
; Try to trigger a wild encounter.
call Function2a103
@@ -34303,9 +37339,191 @@
ret
; 2a4ab
-INCBIN "baserom.gbc", $2a4ab, $2a5e9 - $2a4ab
+Function2a4ab: ; 2a4ab
+ callba Function90439
+ ld d, b
+ ld e, c
+ ld hl, WildMons1
+ ld bc, $002f
+ call Function2a288
+ jr c, .asm_2a4c6
+ ld hl, WildMons3
+ call Function2a288
+ jr nc, .asm_2a514
+.asm_2a4c6
+ push hl
+ ld bc, $000d
+ add hl, bc
+ ld a, [TimeOfDay]
+ ld bc, $000e
+ call AddNTimes
+.asm_2a4d4
+ call Random
+ and $3
+ jr z, .asm_2a4d4
+ dec a
+ ld c, a
+ ld b, $0
+ add hl, bc
+ add hl, bc
+ inc hl
+ ld c, [hl]
+ pop hl
+ ld de, $0005
+ add hl, de
+ inc hl
+ ld b, $4
+.asm_2a4eb
+ ld a, [hli]
+ cp c
+ jr z, .asm_2a514
+ inc hl
+ dec b
+ jr nz, .asm_2a4eb
+ push bc
+ dec c
+ ld a, c
+ call CheckCaughtMon
+ pop bc
+ jr nz, .asm_2a514
+ ld de, StringBuffer1
+ call CopyName1
+ ld a, c
+ ld [$d265], a
+ call GetPokemonName
+ ld hl, $651a
+ call PrintText
+ xor a
+ ld [ScriptVar], a
+ ret
+.asm_2a514
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+; 2a51a
+
+INCBIN "baserom.gbc", $2a51a, $2a51f - $2a51a
+
+Function2a51f: ; 2a51f
+ callba Function90439
+ ld d, b
+ ld e, c
+ ld hl, WildMons1
+ ld bc, $002f
+ call Function2a288
+ jr c, .asm_2a538
+ ld hl, WildMons3
+ call Function2a288
+
+.asm_2a538
+ ld bc, $0005
+ add hl, bc
+ ld a, [TimeOfDay]
+ inc a
+ ld bc, $000e
+.asm_2a543
+ dec a
+ jr z, .asm_2a549
+ add hl, bc
+ jr .asm_2a543
+
+.asm_2a549
+ call Random
+ and $3
+ ld c, a
+ ld b, $0
+ add hl, bc
+ add hl, bc
+ inc hl
+ ld a, [hl]
+ ld [$d265], a
+ call GetPokemonName
+ ld hl, StringBuffer1
+ ld de, StringBuffer4
+ ld bc, $000b
+ jp CopyBytes
+; 2a567
+
+Function2a567: ; 2a567
+ callba Function90439
+ ld hl, $5999
+ ld a, d
+ dec a
+ ld c, a
+ ld b, $0
+ add hl, bc
+ add hl, bc
+ ld a, $e
+ call GetFarHalfword
+.asm_2a57c
+ dec e
+ jr z, .asm_2a58b
+.asm_2a57f
+ ld a, $e
+ call GetFarByte
+ inc hl
+ cp $ff
+ jr nz, .asm_2a57f
+ jr .asm_2a57c
+
+.asm_2a58b
+ ld a, $e
+ call GetFarByte
+ inc hl
+ cp $50
+ jr nz, .asm_2a58b
+ ld a, $e
+ call GetFarByte
+ inc hl
+ ld bc, $0002
+ cp $0
+ jr z, .asm_2a5b3
+ ld bc, $0006
+ cp $1
+ jr z, .asm_2a5b3
+ ld bc, $0003
+ cp $2
+ jr z, .asm_2a5b3
+ ld bc, $0007
+
+.asm_2a5b3
+ ld e, $0
+ push hl
+.asm_2a5b6
+ inc e
+ add hl, bc
+ ld a, $e
+ call GetFarByte
+ cp $ff
+ jr nz, .asm_2a5b6
+ pop hl
+.asm_2a5c2
+ call Random
+ and $7
+ cp e
+ jr nc, .asm_2a5c2
+ inc a
+.asm_2a5cb
+ dec a
+ jr z, .asm_2a5d1
+ add hl, bc
+ jr .asm_2a5cb
+
+.asm_2a5d1
+ inc hl
+ ld a, $e
+ call GetFarByte
+ ld [$d265], a
+ call GetPokemonName
+ ld hl, StringBuffer1
+ ld de, StringBuffer4
+ ld bc, $000b
+ jp CopyBytes
+; 2a5e9
+
+
WildMons1: ; 0x2a5e9
INCLUDE "stats/wild/johto_grass.asm"
@@ -34849,9 +38067,133 @@
db "MYSTICALMAN@"
-INCBIN "baserom.gbc", $2c41a, $2c7fb - $2c41a
+INCBIN "baserom.gbc", $2c41a, $2c547 - $2c41a
+Function2c547: ; 2c547
+ ld hl, $45ef
+ call PrintText
+ call Function1dcf
+ jr c, .asm_2c5c3
+ ld hl, $45f4
+ call PrintText
+ callba Function50000
+ jr c, .asm_2c5c3
+ ld a, [CurPartySpecies]
+ cp $fd
+ jr z, .asm_2c5bc
+ ld a, [CurPartyMon]
+ ld hl, PartyMon1Move2
+ ld bc, $0030
+ call AddNTimes
+ ld a, [hl]
+ and a
+ jr z, .asm_2c5ca
+ ld hl, $45ea
+ call PrintText
+ call Function1d6e
+ callba Function12f5b
+ push af
+ call Function2b74
+ pop af
+ jr c, .asm_2c5c3
+ ld a, [$cfa9]
+ push af
+ ld a, [CurSpecies]
+ ld [$d265], a
+ call GetMoveName
+ ld hl, $45d6
+ call PrintText
+ call Function1dcf
+ pop bc
+ jr c, .asm_2c5c3
+ call Function2c5f9
+ call WaitSFX
+ ld de, $0097
+ call StartSFX
+ call WaitSFX
+ ld hl, $45db
+ call PrintText
+ ret
+.asm_2c5bc
+ ld hl, $45e0
+ call PrintText
+ ret
+
+.asm_2c5c3
+ ld hl, $45e5
+ call PrintText
+ ret
+
+.asm_2c5ca
+ ld hl, $45d1
+ call PrintText
+ ret
+; 2c5d1
+
+INCBIN "baserom.gbc", $2c5d1, $2c5f9 - $2c5d1
+
+Function2c5f9: ; 2c5f9
+ ld a, b
+ push bc
+ dec a
+ ld c, a
+ ld b, $0
+ ld hl, PartyMon1Move1
+ add hl, bc
+ ld a, [CurPartyMon]
+ ld bc, $0030
+ call AddNTimes
+ pop bc
+ push bc
+ inc b
+.asm_2c60f
+ ld a, b
+ cp $5
+ jr z, .asm_2c61b
+ inc hl
+ ld a, [hld]
+ ld [hl], a
+ inc hl
+ inc b
+ jr .asm_2c60f
+
+.asm_2c61b
+ xor a
+ ld [hl], a
+ pop bc
+ ld a, b
+ push bc
+ dec a
+ ld c, a
+ ld b, $0
+ ld hl, PartyMon1PP
+ add hl, bc
+ ld a, [CurPartyMon]
+ ld bc, $0030
+ call AddNTimes
+ pop bc
+ inc b
+.asm_2c633
+ ld a, b
+ cp $5
+ jr z, .asm_2c63f
+ inc hl
+ ld a, [hld]
+ ld [hl], a
+ inc hl
+ inc b
+ jr .asm_2c633
+
+.asm_2c63f
+ xor a
+ ld [hl], a
+ ret
+; 2c642
+
+INCBIN "baserom.gbc", $2c642, $2c7fb - $2c642
+
+
Function2c7fb: ; 2c7fb
ld hl, StringBuffer2
ld de, $d066
@@ -35360,96 +38702,11 @@
SECTION "bankC",ROMX,BANK[$C]
-Tileset15GFX: ; 0x30000
-INCBIN "gfx/tilesets/15.lz"
-; 0x304d7
+INCLUDE "tilesets/data_4.asm"
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
+INCBIN "baserom.gbc", $329f0, $333f0 - $329f0
-Tileset15Meta: ; 0x304e0
-INCBIN "tilesets/15_metatiles.bin"
-; 0x308e0
-Tileset15Coll: ; 0x308e0
-INCBIN "tilesets/15_collision.bin"
-; 0x309e0
-
-Tileset25GFX: ; 0x309e0
-INCBIN "gfx/tilesets/25.lz"
-; 0x30e78
-
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
-
-Tileset25Meta: ; 0x30e80
-INCBIN "tilesets/25_metatiles.bin"
-; 0x31280
-
-Tileset25Coll: ; 0x31280
-INCBIN "tilesets/25_collision.bin"
-; 0x31380
-
-Tileset27GFX: ; 0x31380
-INCBIN "gfx/tilesets/27.lz"
-; 0x318dc
-
- db $00
- db $00
- db $00
- db $00
-
-Tileset27Meta: ; 0x318e0
-INCBIN "tilesets/27_metatiles.bin"
-; 0x31ce0
-
-Tileset27Coll: ; 0x31ce0
-INCBIN "tilesets/27_collision.bin"
-; 0x31de0
-
-Tileset28GFX: ; 0x31de0
-INCBIN "gfx/tilesets/28.lz"
-; 0x321a6
-
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
-
-Tileset28Meta: ; 0x321b0
-INCBIN "tilesets/28_metatiles.bin"
-; 0x325b0
-
-Tileset28Coll: ; 0x325b0
-INCBIN "tilesets/28_collision.bin"
-; 0x326b0
-
-Tileset30GFX: ; 0x326b0
-INCBIN "gfx/tilesets/30.lz"
-; 0x329ed
-
-INCBIN "baserom.gbc", $329ed, $333f0 - $329ed
-
-
SECTION "bankD",ROMX,BANK[$D]
INCLUDE "battle/effect_commands.asm"
@@ -36155,11 +39412,14 @@
ld a, [$cfc0]
bit 0, a
ld hl, $d26b
- jp nz, $5984
+ jp nz, Function39984
+
ld a, [OtherTrainerID]
ld b, a
ld a, [OtherTrainerClass]
ld c, a
+
+Function3994c: ; 3994c
ld a, c
cp $c
jr nz, .asm_3996d
@@ -36172,7 +39432,7 @@
ld a, $0
call GetSRAMBank
ld hl, $abfe
- call $5984
+ call Function39984
jp CloseSRAM
.asm_3996d
@@ -36186,9 +39446,10 @@
ld h, [hl]
ld l, a
pop bc
+
.asm_3997a
dec b
- jr z, .asm_39984
+ jr z, Function39984
.asm_3997d
ld a, [hli]
cp $ff
@@ -36195,7 +39456,7 @@
jr nz, .asm_3997d
jr .asm_3997a
-.asm_39984
+Function39984: ; 39984
ld de, StringBuffer1
push de
ld bc, $000b
@@ -36212,8 +39473,6 @@
ret
; 39999
-
-
TrainerGroups: ; 0x39999
INCLUDE "trainers/trainer_pointers.asm"
@@ -40881,7 +44140,7 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, $d
+ ld a, BANK(BattleCommand70)
rst FarCall
pop bc
pop de
@@ -40904,13 +44163,13 @@
; 3defc
.data_3defc
- dbw $1f, $61ac
- dbw $20, $61b0
- dbw $21, $61b4
- dbw $22, $61b8
- dbw $23, $61bc
- dbw $24, $61c0
- dbw $25, $61c4
+ dbw $1f, BattleCommand70
+ dbw $20, BattleCommand71
+ dbw $21, BattleCommand72
+ dbw $22, BattleCommand73
+ dbw $23, BattleCommand74
+ dbw $24, BattleCommand75
+ dbw $25, BattleCommand76
db $ff
; 3df12
@@ -41957,10 +45216,10 @@
ld a, [$d0e3]
and a
jr z, .asm_3e6bf
- ld hl, BattleMonMove1
- call $66a5
- ld hl, BattleMonPPMove1
- call $66a5
+ ld hl, BattleMonMoves
+ call .asm_3e6a5
+ ld hl, BattleMonPP
+ call .asm_3e6a5
ld hl, PlayerDisableCount
ld a, [hl]
swap a
@@ -41994,15 +45253,15 @@
ld a, [PlayerSubStatus5]
bit 3, a
jr nz, .asm_3e69e
- ld hl, PartyMon1Move1
+ ld hl, PartyMon1Moves
ld a, [CurBattleMon]
call GetPartyLocation
push hl
- call $66a5
+ call .asm_3e6a5
pop hl
ld bc, $0015
add hl, bc
- call $66a5
+ call .asm_3e6a5
.asm_3e69e
xor a
@@ -42009,11 +45268,12 @@
ld [$d0e3], a
jp Function3e4bc
+.asm_3e6a5
push hl
ld a, [$d0e3]
dec a
ld c, a
- ld b, $0
+ ld b, 0
add hl, bc
ld d, h
ld e, l
@@ -42021,7 +45281,7 @@
ld a, [$cfa9]
dec a
ld c, a
- ld b, $0
+ ld b, 0
add hl, bc
ld a, [de]
ld b, [hl]
@@ -42039,14 +45299,17 @@
MoveInfoBox: ; 3e6c8
xor a
ld [hBGMapMode], a
- ld hl, $c540
- ld b, $3
- ld c, $9
+
+ hlcoord 0, 8
+ ld b, 3
+ ld c, 9
call TextBox
call MobileTextBorder
+
ld a, [PlayerDisableCount]
and a
jr z, .asm_3e6f4
+
swap a
and $f
ld b, a
@@ -42053,50 +45316,56 @@
ld a, [$cfa9]
cp b
jr nz, .asm_3e6f4
- ld hl, $c569
+
+ hlcoord 1, 10
ld de, .Disabled
call PlaceString
- jr .asm_3e74e
+ jr .done
.asm_3e6f4
ld hl, $cfa9
dec [hl]
call SetPlayerTurn
- ld hl, BattleMonMove1
+ ld hl, BattleMonMoves
ld a, [$cfa9]
ld c, a
- ld b, $0
+ ld b, 0
add hl, bc
ld a, [hl]
ld [CurPlayerMove], a
+
ld a, [CurBattleMon]
ld [CurPartyMon], a
- ld a, $4
+ ld a, WILDMON
ld [MonType], a
callab Functionf8ec
+
ld hl, $cfa9
ld c, [hl]
inc [hl]
- ld b, $0
- ld hl, BattleMonPPMove1
+ ld b, 0
+ ld hl, BattleMonPP
add hl, bc
ld a, [hl]
and $3f
ld [StringBuffer1], a
call Function3e75f
- ld hl, $c555
+
+ hlcoord 1, 9
ld de, .Type
call PlaceString
- ld hl, $c583
- ld [hl], $f3
+
+ hlcoord 7, 11
+ ld [hl], "/"
+
callab UpdateMoveData
ld a, [PlayerMoveAnimation]
ld b, a
- ld hl, $c56a
- ld a, $2a
+ hlcoord 2, 10
+ ld a, PREDEF_PRINT_MOVE_TYPE
call Predef
-.asm_3e74e
+.done
ret
; 3e74f
@@ -42108,11 +45377,11 @@
Function3e75f: ; 3e75f
- ld hl, $c581
+ hlcoord 5, 11
ld a, [InLinkBattle]
cp $4
jr c, .asm_3e76c
- ld hl, $c581
+ hlcoord 5, 11
.asm_3e76c
push hl
@@ -42122,7 +45391,7 @@
pop hl
inc hl
inc hl
- ld [hl], $f3
+ ld [hl], "/"
inc hl
ld de, $d265
ld bc, $0102
@@ -42131,12 +45400,13 @@
; 3e786
Function3e786: ; 3e786
- ld a, $a5
+ ld a, STRUGGLE
ld [CurPlayerMove], a
ld a, [PlayerDisableCount]
and a
- ld hl, BattleMonPPMove1
+ ld hl, BattleMonPP
jr nz, .asm_3e79f
+
ld a, [hli]
or [hl]
inc hl
@@ -42170,7 +45440,7 @@
.asm_3e7b4
ld hl, BattleText_0x80c72
call StdBattleTextBox
- ld c, $3c
+ ld c, 60
call DelayFrames
xor a
ret
@@ -45942,9 +49212,99 @@
jp [hl]
; 40115
-INCBIN "baserom.gbc", $40115, $40ad5 - $40115
+INCBIN "baserom.gbc", $40115, $40741 - $40115
+Function40741: ; 40741
+ push de
+ ld de, $0014
+.asm_40745
+ ld [hl], a
+ add hl, de
+ dec b
+ jr nz, .asm_40745
+ pop de
+ ret
+; 4074c
+INCBIN "baserom.gbc", $4074c, $407fd - $4074c
+
+Function407fd: ; 407fd
+ call Function40aa6
+ ld hl, TileMap
+ ld bc, $0f12
+ call Function40ad5
+ ld hl, $c4b3
+ ld [hl], $34
+ ld hl, $c4c7
+ ld a, $7f
+ ld b, $f
+ call Function40741
+ ld [hl], $39
+ ld hl, $c569
+ ld bc, $0013
+ ld a, $61
+ call ByteFill
+ ld hl, $c5f5
+ ld bc, $0012
+ ld a, $7f
+ call ByteFill
+ ld hl, $c535
+ ld de, $4852
+ call Function40acd
+ ld hl, $c55d
+ ld de, $485c
+ call Function40acd
+ ld hl, $c5f4
+ ld de, $4867
+ call Function40acd
+ call Function40ab2
+ ret
+; 4084f
+
+INCBIN "baserom.gbc", $4084f, $40aa6 - $4084f
+
+Function40aa6: ; 40aa6
+ ld hl, TileMap
+ ld a, $32
+ ld bc, $0168
+ call ByteFill
+ ret
+; 40ab2
+
+Function40ab2: ; 40ab2
+ ld hl, $c4b5
+ xor a
+ ld b, $7
+.asm_40ab8
+ ld c, $7
+ push af
+ push hl
+.asm_40abc
+ ld [hli], a
+ add $7
+ dec c
+ jr nz, .asm_40abc
+ pop hl
+ ld de, $0014
+ add hl, de
+ pop af
+ inc a
+ dec b
+ jr nz, .asm_40ab8
+ ret
+; 40acd
+
+Function40acd: ; 40acd
+.asm_40acd
+ ld a, [de]
+ cp $ff
+ ret z
+ inc de
+ ld [hli], a
+ jr .asm_40acd
+; 40ad5
+
+
Function40ad5: ; 40ad5
push hl
ld a, $33
@@ -45990,9 +49350,23 @@
jr .asm_40b07
; 40b0f
-INCBIN "baserom.gbc", $40b0f, $40bb1 - $40b0f
+INCBIN "baserom.gbc", $40b0f, $40ba0 - $40b0f
+Function40ba0: ; 40ba0
+ ld hl, $c4c6
+ ld a, $62
+ ld [hli], a
+ inc a
+ ld [hl], a
+ ld hl, $c4da
+ ld a, $64
+ ld [hli], a
+ inc a
+ ld [hl], a
+ ret
+; 40bb1
+
Function40bb1: ; 40bb1
ld a, [$c7d1]
ld hl, $c7d0
@@ -46033,8 +49407,45 @@
jp [hl]
; 40bf0
-INCBIN "baserom.gbc", $40bf0, $40c65 - $40bf0
+INCBIN "baserom.gbc", $40bf0, $40c30 - $40bf0
+Function40c30: ; 40c30
+ xor a
+ ld [$c7d2], a
+ ld hl, PlayerSDefLevel
+ ld de, AlphabeticalPokedexOrder
+ ld c, $fb
+.asm_40c3c
+ push bc
+ ld a, [de]
+ ld [$d265], a
+ call Function40bd0
+ jr z, .asm_40c51
+ ld a, [$d265]
+ ld [hli], a
+ ld a, [$c7d2]
+ inc a
+ ld [$c7d2], a
+
+.asm_40c51
+ inc de
+ pop bc
+ dec c
+ jr nz, .asm_40c3c
+ ld a, [$c7d2]
+ ld c, $0
+.asm_40c5b
+ cp $fb
+ jr z, .asm_40c64
+ ld [hl], c
+ inc hl
+ inc a
+ jr .asm_40c5b
+
+.asm_40c64
+ ret
+; 40c65
+
AlphabeticalPokedexOrder: ; 0x40c65
INCLUDE "stats/pokedex/order_alpha.asm"
@@ -46059,9 +49470,19 @@
ret
; 40e7d
-INCBIN "baserom.gbc", $40e7d, $41432 - $40e7d
+INCBIN "baserom.gbc", $40e7d, $41423 - $40e7d
+Function41423: ; 41423
+ ld b, a
+ call GetSGBLayout
+ ld a, $e4
+ call DmgToCgbBGPals
+ ld a, $e0
+ call Functioncf8
+ ret
+; 41432
+
Function41432: ; 41432
ld e, a
ld d, $0
@@ -46103,9 +49524,44 @@
ret
; 41478
-INCBIN "baserom.gbc", $41478, $414b7 - $41478
+INCBIN "baserom.gbc", $41478, $4147b - $41478
+Function4147b: ; 4147b
+ ld a, [$d265]
+ dec a
+ and $f8
+ srl a
+ srl a
+ srl a
+ ld e, $0
+ ld d, a
+ ld a, [$d265]
+ dec a
+ and $7
+ swap a
+ ld l, a
+ ld h, $0
+ add hl, de
+ ld de, $5434
+ add hl, de
+ push hl
+ ld e, l
+ ld d, h
+ ld hl, $9620
+ ld bc, $3e02
+ call Request1bpp
+ pop hl
+ ld de, $0080
+ add hl, de
+ ld e, l
+ ld d, h
+ ld hl, $9640
+ ld bc, $3e02
+ call Request1bpp
+ ret
+; 414b7
+
Function414b7: ; 414b7
call DisableLCD
ld hl, VTiles2
@@ -46185,9 +49641,45 @@
ret
; 41a58
-INCBIN "baserom.gbc", $41a58, $41af7 - $41a58
+INCBIN "baserom.gbc", $41a58, $41a7f - $41a58
+Function41a7f: ; 41a7f
+ xor a
+ ld [hBGMapMode], a
+ callba Function1de247
+ call Function41af7
+ call DisableLCD
+ call Functione51
+ call Functione5f
+ call Function414b7
+ call Function4147b
+ ld a, [$d265]
+ ld [CurPartySpecies], a
+ call Function407fd
+ call Function40ba0
+ ld hl, $c5f4
+ ld [hl], $3b
+ inc hl
+ ld bc, $0013
+ ld a, $7f
+ call ByteFill
+ callba Function4424d
+ call EnableLCD
+ call WaitBGMap
+ call GetBaseData
+ ld de, VTiles2
+ ld a, $3c
+ call Predef
+ ld a, $4
+ call Function41423
+ ld a, [CurPartySpecies]
+ call Function37ce
+ ret
+; 41ad7
+INCBIN "baserom.gbc", $41ad7, $41af7 - $41ad7
+
+
Function41af7: ; 41af7
xor a
ld [hBGMapMode], a
@@ -47244,9 +50736,167 @@
jr .asm_44210
; 44228
-INCBIN "baserom.gbc", $44228, $44378 - $44228
+INCBIN "baserom.gbc", $44228, $4424d - $44228
+Function4424d: ; 4424d
+ call GetPokemonName
+ ld hl, $c4e5
+ call PlaceString
+ ld a, [$d265]
+ ld b, a
+ call Function44333
+ ld a, b
+ push af
+ ld hl, $c50d
+ call Function13d4
+ ld h, b
+ ld l, c
+ push de
+ ld hl, $c542
+ ld a, $5c
+ ld [hli], a
+ ld a, $5d
+ ld [hli], a
+ ld de, $d265
+ ld bc, $8103
+ call PrintNum
+ ld a, [$d265]
+ dec a
+ call CheckSeenMon
+ pop hl
+ pop bc
+ ret z
+ ld a, [CurPartySpecies]
+ ld [CurSpecies], a
+ inc hl
+ ld a, b
+ push af
+ push hl
+ call GetFarHalfword
+ ld d, l
+ ld e, h
+ pop hl
+ inc hl
+ inc hl
+ ld a, d
+ or e
+ jr z, .asm_442b0
+ push hl
+ push de
+ ld hl, [sp+$0]
+ ld d, h
+ ld e, l
+ ld hl, $c538
+ ld bc, $0224
+ call PrintNum
+ ld hl, $c53a
+ ld [hl], $5e
+ pop af
+ pop hl
+.asm_442b0
+ pop af
+ push af
+ inc hl
+ push hl
+ dec hl
+ call GetFarHalfword
+ ld d, l
+ ld e, h
+ ld a, e
+ or d
+ jr z, .asm_442cd
+ push de
+ ld hl, [sp+$0]
+ ld d, h
+ ld e, l
+ ld hl, $c55f
+ ld bc, ClearVRAM
+ call PrintNum
+ pop de
+
+.asm_442cd
+ ld bc, $0512
+ ld hl, $c57e
+ call ClearBox
+ ld hl, $c569
+ ld bc, $0013
+ ld a, $61
+ call ByteFill
+ ld hl, $c555
+ ld [hl], $55
+ inc hl
+ ld [hl], $55
+ ld hl, $c569
+ ld [hl], $56
+ inc hl
+ ld [hl], $57
+ pop de
+ inc de
+ pop af
+ ld hl, $c57e
+ push af
+ call Function13d4
+ pop bc
+ ld a, [$cf65]
+ or a
+ ret z
+ push bc
+ push de
+ ld bc, $0512
+ ld hl, $c57e
+ call ClearBox
+ ld hl, $c569
+ ld bc, $0013
+ ld a, $61
+ call ByteFill
+ ld hl, $c555
+ ld [hl], $55
+ inc hl
+ ld [hl], $55
+ ld hl, $c569
+ ld [hl], $56
+ inc hl
+ ld [hl], $58
+ pop de
+ inc de
+ pop af
+ ld hl, $c57e
+ call Function13d4
+ ret
+; 44331
+
+INCBIN "baserom.gbc", $44331, $44333 - $44331
+
+Function44333: ; 44333
+ push hl
+ ld hl, PokedexDataPointerTable
+ ld a, b
+ dec a
+ ld d, $0
+ ld e, a
+ add hl, de
+ add hl, de
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ push de
+ rlca
+ rlca
+ and $3
+ ld hl, $4351
+ ld d, $0
+ ld e, a
+ add hl, de
+ ld b, [hl]
+ pop de
+ pop hl
+ ret
+; 44351
+
+INCBIN "baserom.gbc", $44351, $44378 - $44351
+
+
PokedexDataPointerTable: ; 0x44378
INCLUDE "stats/pokedex/entry_pointers.asm"
@@ -47742,9 +51392,48 @@
ret
; 4802f
-INCBIN "baserom.gbc", $4802f, $48e81 - $4802f
+INCBIN "baserom.gbc", $4802f, $48c63 - $4802f
+Function48c63: ; 48c63
+ ld a, $50
+ ld [de], a
+ ld a, c
+ cp $30
+ jr nc, .asm_48c8c
+ and a
+ jr z, .asm_48c8c
+ dec c
+ push de
+ ld h, d
+ ld l, e
+ ld a, $50
+ ld b, $7
+.asm_48c76
+ ld [hli], a
+ dec b
+ jr nz, .asm_48c76
+ ld hl, $455b
+ ld a, c
+ call GetNthString
+.asm_48c81
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [hl]
+ cp $50
+ jr nz, .asm_48c81
+ and a
+ pop de
+ ret
+.asm_48c8c
+ scf
+ ret
+; 48c8e
+
+INCBIN "baserom.gbc", $48c8e, $48e81 - $48c8e
+
+
Function48e81: ; 48e81
ld hl, $4e93
add hl, de
@@ -47870,9 +51559,28 @@
ret
; 4930a
-INCBIN "baserom.gbc", $4930a, $49409 - $4930a
+INCBIN "baserom.gbc", $4930a, $49336 - $4930a
+Function49336: ; 49336
+.asm_49336
+ push bc
+ push hl
+.asm_49338
+ ld [hli], a
+ dec c
+ jr nz, .asm_49338
+ pop hl
+ ld bc, $0014
+ add hl, bc
+ pop bc
+ dec b
+ jr nz, .asm_49336
+ ret
+; 49346
+INCBIN "baserom.gbc", $49346, $49409 - $49346
+
+
Function49409: ; 49409
ld hl, $5418
ld de, $d038
@@ -47882,8 +51590,178 @@
ret
; 49418
-INCBIN "baserom.gbc", $49418, $49962 - $49418
+INCBIN "baserom.gbc", $49418, $49797 - $49418
+Function49797: ; 49797
+ ld hl, AttrMap
+ ld bc, $1002
+ ld a, $4
+ call Function49336
+ ld a, $3
+ ld [$cded], a
+ ld [$cef1], a
+ ld hl, $cddb
+ ld bc, $0812
+ ld a, $5
+ call Function49336
+ ld hl, $ce7b
+ ld bc, $0812
+ ld a, $6
+ call Function49336
+ ld hl, $cf19
+ ld bc, $0214
+ ld a, $4
+ call Function49336
+ ld a, $3
+ ld bc, $0601
+ ld hl, $cdf3
+ call Function49336
+ ld a, $3
+ ld bc, $0601
+ ld hl, $cdfe
+ call Function49336
+ ld a, $3
+ ld bc, $0601
+ ld hl, $ce93
+ call Function49336
+ ld a, $3
+ ld bc, $0601
+ ld hl, $ce9e
+ call Function49336
+ ld a, $2
+ ld hl, $cf1b
+ ld [hli], a
+ ld a, $7
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld a, $2
+ ld [hl], a
+ ld hl, $cf2f
+ ld a, $3
+ ld bc, $0006
+ call ByteFill
+ ret
+; 49811
+
+Function49811: ; 49811
+ ld hl, $5826
+ ld de, $d010
+ ld bc, $0030
+ ld a, $5
+ call Function306b
+ callba Function96a4
+ ret
+; 49826
+
+INCBIN "baserom.gbc", $49826, $49856 - $49826
+
+Function49856: ; 49856
+ call Function49797
+ ret
+; 4985a
+
+INCBIN "baserom.gbc", $4985a, $4989a - $4985a
+
+Function4989a: ; 4989a
+ call DelayFrame
+ ld a, [VramState]
+ push af
+ xor a
+ ld [VramState], a
+ call Function49912
+ ld de, $0750
+ ld a, $2c
+ call Function3b2a
+ ld hl, $0003
+ add hl, bc
+ ld [hl], $84
+ ld hl, $0002
+ add hl, bc
+ ld [hl], $1f
+ ld hl, $000f
+ add hl, bc
+ ld a, $80
+ ld [hl], a
+ ld a, $a0
+ ld [$cf64], a
+ ld d, $0
+.asm_498ca
+ ld a, [$cf63]
+ bit 7, a
+ jr nz, .asm_498ee
+ push bc
+ call Function49bae
+ inc d
+ push de
+ ld a, $90
+ ld [$c3b5], a
+ callba Function8cf7a
+ call Function49935
+ ld c, $2
+ call DelayFrames
+ pop de
+ pop bc
+ jr .asm_498ca
+
+.asm_498ee
+ pop af
+ ld [VramState], a
+ call Function498f9
+ call Function49bf3
+ ret
+; 498f9
+
+Function498f9: ; 498f9
+ ld hl, $c402
+ xor a
+ ld c, $4
+.asm_498ff
+ ld [hli], a
+ inc hl
+ inc hl
+ inc hl
+ inc a
+ dec c
+ jr nz, .asm_498ff
+ ld hl, $c410
+ ld bc, $0090
+ xor a
+ call ByteFill
+ ret
+; 49912
+
+Function49912: ; 49912
+ callba Function8cf53
+ ld de, $5962
+ ld hl, VTiles1
+ ld bc, $1204
+ call Request2bpp
+ ld de, $59a2
+ ld hl, $8840
+ ld bc, $1210
+ call Request2bpp
+ xor a
+ ld [$cf63], a
+ ret
+; 49935
+
+Function49935: ; 49935
+ ld hl, $cf64
+ ld a, [hl]
+ and a
+ jr z, .asm_4993e
+ dec [hl]
+ ret
+
+.asm_4993e
+ ld hl, $cf63
+ set 7, [hl]
+ ret
+; 49944
+
+INCBIN "baserom.gbc", $49944, $49962 - $49944
+
SpecialCelebiGFX:
INCBIN "gfx/special/celebi/leaf.2bpp"
INCBIN "gfx/special/celebi/1.2bpp"
@@ -47891,8 +51769,96 @@
INCBIN "gfx/special/celebi/3.2bpp"
INCBIN "gfx/special/celebi/4.2bpp"
-INCBIN "baserom.gbc", $49aa2, $49cdc - $49aa2
+INCBIN "baserom.gbc", $49aa2, $49bae - $49aa2
+Function49bae: ; 49bae
+ push hl
+ push bc
+ push de
+ ld a, d
+ ld d, $3
+ ld e, d
+ cp $0
+ jr z, .asm_49bd0
+ cp d
+ jr z, .asm_49bd4
+ call Function49bed
+ cp d
+ jr z, .asm_49bd8
+ call Function49bed
+ cp d
+ jr z, .asm_49bdc
+ call Function49bed
+ cp d
+ jr c, .asm_49be9
+ jr .asm_49be5
+
+.asm_49bd0
+ ld a, $84
+ jr .asm_49bde
+
+.asm_49bd4
+ ld a, $88
+ jr .asm_49bde
+
+.asm_49bd8
+ ld a, $8c
+ jr .asm_49bde
+
+.asm_49bdc
+ ld a, $90
+
+.asm_49bde
+ ld hl, $0003
+ add hl, bc
+ ld [hl], a
+ jr .asm_49be9
+
+.asm_49be5
+ pop de
+ ld d, $ff
+ push de
+
+.asm_49be9
+ pop de
+ pop bc
+ pop hl
+ ret
+; 49bed
+
+Function49bed: ; 49bed
+ push af
+ ld a, d
+ add e
+ ld d, a
+ pop af
+ ret
+; 49bf3
+
+Function49bf3: ; 49bf3
+ ld a, $b
+ ld [BattleType], a
+ ret
+; 49bf9
+
+Function49bf9: ; 49bf9
+ ld a, [$d0ee]
+ bit 6, a
+ jr z, .asm_49c07
+ ld a, $1
+ ld [ScriptVar], a
+ jr .asm_49c0b
+
+.asm_49c07
+ xor a
+ ld [ScriptVar], a
+
+.asm_49c0b
+ ret
+; 49c0c
+
+INCBIN "baserom.gbc", $49c0c, $49cdc - $49c0c
+
MainMenu: ; 49cdc
xor a
ld [$c2d7], a
@@ -48164,7 +52130,7 @@
ld a, $24
ld hl, $4b3e
rst FarCall
- ld [hl], $9c
+ ld [hl], ":"
inc hl
ld de, hMinutes
ld bc, $8102
@@ -48501,12 +52467,12 @@
; run CheckOwnMon on each Pokémon in the PC
ld a, $1
call GetSRAMBank
- ld a, [$ad10]
+ ld a, [BoxCount]
and a
jr z, .asm_4a766 ; 0x4a748 $1c
ld d, a
- ld hl, $ad26
- ld bc, $afa6
+ ld hl, BoxMon1Species
+ ld bc, BoxMon1OT
.asm_4a751
call CheckOwnMon
jr nc, .asm_4a75a ; 0x4a754 $4
@@ -48681,9 +52647,802 @@
ret
; 0x4a843
-INCBIN "baserom.gbc", $4a843, $4ae78 - $4a843
+INCBIN "baserom.gbc", $4a843, $4a927 - $4a843
+Function4a927: ; 4a927
+ ld a, [ScriptVar]
+ ld [CurItem], a
+ ld hl, PCItems
+ call PickUpItem
+ jr c, .asm_4a948
+ ld a, [ScriptVar]
+ ld [CurItem], a
+ ld hl, NumItems
+ call PickUpItem
+ jr c, .asm_4a948
+ xor a
+ ld [ScriptVar], a
+ ret
+.asm_4a948
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+; 4a94e
+
+Function4a94e: ; 4a94e
+ call FadeToMenu
+ ld a, $ff
+ ld hl, DefaultFlypoint
+ ld bc, $0003
+ call ByteFill
+ xor a
+ ld [$d018], a
+ ld [$d019], a
+ ld b, $14
+ call GetSGBLayout
+ call Function32f9
+ call Function4aa22
+ jr c, .asm_4a985
+ jr z, .asm_4a9a1
+ jr .asm_4a97b
+
+.asm_4a974
+ call Function4aa25
+ jr c, .asm_4a985
+ jr z, .asm_4a9a1
+
+.asm_4a97b
+ call Function4ac58
+ ld hl, $d019
+ res 1, [hl]
+ jr .asm_4a974
+
+.asm_4a985
+ ld a, [$d018]
+ and a
+ jr nz, .asm_4a990
+ call Function4aba8
+ jr c, .asm_4a974
+
+.asm_4a990
+ call Function2b3c
+ ld hl, DefaultFlypoint
+ ld a, $ff
+ ld bc, $0003
+ call ByteFill
+ scf
+ jr .asm_4a9af
+
+.asm_4a9a1
+ call Function4a9c3
+ jr c, .asm_4a9b0
+ call Function4a9d7
+ jr c, .asm_4a974
+ call Function2b3c
+ and a
+
+.asm_4a9af
+ ret
+
+.asm_4a9b0
+ ld de, $0019
+ call StartSFX
+ ld hl, $69be
+ call PrintText
+ jr .asm_4a974
+; 4a9be
+
+INCBIN "baserom.gbc", $4a9be, $4a9c3 - $4a9be
+
+Function4a9c3: ; 4a9c3
+ ld hl, DefaultFlypoint
+ ld a, $ff
+ cp [hl]
+ jr z, .asm_4a9d5
+ inc hl
+ cp [hl]
+ jr z, .asm_4a9d5
+ inc hl
+ cp [hl]
+ jr z, .asm_4a9d5
+ and a
+ ret
+
+.asm_4a9d5
+ scf
+ ret
+; 4a9d7
+
+Function4a9d7: ; 4a9d7
+ ld a, [DefaultFlypoint]
+ ld hl, PartyMon1Nickname
+ call GetNick
+ ld h, d
+ ld l, e
+ ld de, EndFlypoint
+ ld bc, $0006
+ call CopyBytes
+ ld a, [$d003]
+ ld hl, PartyMon1Nickname
+ call GetNick
+ ld h, d
+ ld l, e
+ ld de, $d00c
+ ld bc, $0006
+ call CopyBytes
+ ld a, [$d004]
+ ld hl, PartyMon1Nickname
+ call GetNick
+ ld h, d
+ ld l, e
+ ld de, $d012
+ ld bc, $0006
+ call CopyBytes
+ ld hl, $6a1d
+ call PrintText
+ call Function1dcf
+ ret
+; 4aa1d
+
+INCBIN "baserom.gbc", $4aa1d, $4aa22 - $4aa1d
+
+Function4aa22: ; 4aa22
+ call WhiteBGMap
+
+Function4aa25: ; 4aa25
+ callba Function5004f
+ callba Function50405
+ call Function4aad3
+ ld a, $9
+ ld [PartyMenuActionText], a
+ callba WritePartyMenuTilemap
+ xor a
+ ld [PartyMenuActionText], a
+ callba PrintPartyMenuText
+ call Function4aab6
+ call WaitBGMap
+ call Function32f9
+ call DelayFrame
+ call Function4ab1a
+ jr z, .asm_4aa66
+ push af
+ call Function4aafb
+ jr c, .asm_4aa67
+ call Function4ab06
+ jr c, .asm_4aa67
+ pop af
+
+.asm_4aa66
+ ret
+
+.asm_4aa67
+ ld hl, $d019
+ set 1, [hl]
+ pop af
+ ret
+; 4aa6e
+
+INCBIN "baserom.gbc", $4aa6e, $4aa7a - $4aa6e
+
+Function4aa7a: ; 4aa7a
+ ld hl, DefaultFlypoint
+ ld d, $3
+.asm_4aa7f
+ ld e, $6
+ ld a, [hli]
+ push de
+ push hl
+ cp $ff
+ jr z, .asm_4aab3
+ ld hl, $c314
+ inc a
+ ld d, a
+.asm_4aa8d
+ ld a, [hl]
+ and a
+ jr z, .asm_4aaa5
+ cp d
+ jr z, .asm_4aa9a
+ jr .asm_4aaa5
+
+ ld a, $3
+ jr .asm_4aa9c
+
+.asm_4aa9a
+ ld a, $2
+
+.asm_4aa9c
+ push hl
+ ld c, l
+ ld b, h
+ ld hl, $0002
+ add hl, bc
+ ld [hl], a
+ pop hl
+
+.asm_4aaa5
+ ld bc, $0010
+ add hl, bc
+ dec e
+ jr nz, .asm_4aa8d
+ pop hl
+ pop de
+ dec d
+ jr nz, .asm_4aa7f
+ jr .asm_4aab5
+
+.asm_4aab3
+ pop hl
+ pop de
+
+.asm_4aab5
+ ret
+; 4aab6
+
+Function4aab6: ; 4aab6
+ ld hl, DefaultFlypoint
+ ld d, $3
+.asm_4aabb
+ ld a, [hli]
+ cp $ff
+ jr z, .asm_4aad2
+ push de
+ push hl
+ ld hl, $c4b4
+ ld bc, $0028
+ call AddNTimes
+ ld [hl], $ec
+ pop hl
+ pop de
+ dec d
+ jr nz, .asm_4aabb
+
+.asm_4aad2
+ ret
+; 4aad3
+
+Function4aad3: ; 4aad3
+ ld hl, PartyCount
+ ld a, [hli]
+ and a
+ ret z
+ ld c, a
+ xor a
+ ld [hConnectedMapWidth], a
+.asm_4aadd
+ push bc
+ push hl
+ ld e, $0
+ callba Function8e83f
+ ld a, [hConnectedMapWidth]
+ inc a
+ ld [hConnectedMapWidth], a
+ pop hl
+ pop bc
+ dec c
+ jr nz, .asm_4aadd
+ call Function4aa7a
+ callba Function8cf69
+ ret
+; 4aafb
+
+Function4aafb: ; 4aafb
+ ld a, [CurPartySpecies]
+ cp $fd
+ jr z, .asm_4ab04
+ and a
+ ret
+
+.asm_4ab04
+ scf
+ ret
+; 4ab06
+
+Function4ab06: ; 4ab06
+ ld a, [CurPartyMon]
+ ld bc, $0030
+ ld hl, PartyMon1CurHP
+ call AddNTimes
+ ld a, [hli]
+ ld b, a
+ ld a, [hl]
+ or b
+ jr nz, .asm_4ab19
+ scf
+
+.asm_4ab19
+ ret
+; 4ab1a
+
+Function4ab1a: ; 4ab1a
+.asm_4ab1a
+ ld a, $fb
+ ld [$cfa8], a
+ ld a, $26
+ ld [$cfa7], a
+ ld a, $2
+ ld [$cfa4], a
+ call Function4adf7
+ call Function1bc9
+ call Function4abc3
+ jr c, .asm_4ab1a
+ push af
+ call Function4ab99
+ call nc, Function1bee
+ pop af
+ bit 1, a
+ jr nz, .asm_4ab6d
+ ld a, [PartyCount]
+ inc a
+ ld b, a
+ ld a, [$cfa9]
+ ld [$d0d8], a
+ cp b
+ jr z, .asm_4ab7e
+ ld a, [$cfa9]
+ dec a
+ ld [CurPartyMon], a
+ ld c, a
+ ld b, $0
+ ld hl, PartySpecies
+ add hl, bc
+ ld a, [hl]
+ ld [CurPartySpecies], a
+ ld de, $0008
+ call StartSFX
+ call WaitSFX
+ ld a, $1
+ and a
+ ret
+
+.asm_4ab6d
+ ld a, [$cfa9]
+ ld [$d0d8], a
+.asm_4ab73
+ ld de, $0008
+ call StartSFX
+ call WaitSFX
+ scf
+ ret
+
+.asm_4ab7e
+ ld a, $1
+ ld [$d018], a
+ ld a, [$cfaa]
+ cp $2
+ jr z, .asm_4ab73
+ ld de, $0008
+ call StartSFX
+ call WaitSFX
+ xor a
+ ld [$d018], a
+ and a
+ ret
+; 4ab99
+
+Function4ab99: ; 4ab99
+ bit 1, a
+ jr z, .asm_4aba6
+ ld a, [DefaultFlypoint]
+ cp $ff
+ jr z, .asm_4aba6
+ scf
+ ret
+
+.asm_4aba6
+ and a
+ ret
+; 4aba8
+
+Function4aba8: ; 4aba8
+ ld hl, $d004
+ ld a, [hl]
+ cp $ff
+ jr nz, .asm_4abbe
+ dec hl
+ ld a, [hl]
+ cp $ff
+ jr nz, .asm_4abbe
+ dec hl
+ ld a, [hl]
+ cp $ff
+ jr nz, .asm_4abbe
+ and a
+ ret
+
+.asm_4abbe
+ ld a, $ff
+ ld [hl], a
+ scf
+ ret
+; 4abc3
+
+Function4abc3: ; 4abc3
+ bit 3, a
+ jr z, .asm_4abd5
+ ld a, [PartyCount]
+ inc a
+ ld [$cfa9], a
+ ld a, $1
+ ld [$cfaa], a
+ jr .asm_4ac29
+
+.asm_4abd5
+ bit 6, a
+ jr z, .asm_4abeb
+ ld a, [$cfa9]
+ ld [$cfa9], a
+ and a
+ jr nz, .asm_4ac29
+ ld a, [PartyCount]
+ inc a
+ ld [$cfa9], a
+ jr .asm_4ac29
+
+.asm_4abeb
+ bit 7, a
+ jr z, .asm_4ac08
+ ld a, [$cfa9]
+ ld [$cfa9], a
+ ld a, [PartyCount]
+ inc a
+ inc a
+ ld b, a
+ ld a, [$cfa9]
+ cp b
+ jr nz, .asm_4ac29
+ ld a, $1
+ ld [$cfa9], a
+ jr .asm_4ac29
+
+.asm_4ac08
+ bit 4, a
+ jr nz, .asm_4ac10
+ bit 5, a
+ jr z, .asm_4ac56
+
+.asm_4ac10
+ ld a, [$cfa9]
+ ld b, a
+ ld a, [PartyCount]
+ inc a
+ cp b
+ jr nz, .asm_4ac29
+ ld a, [$cfaa]
+ cp $1
+ jr z, .asm_4ac26
+ ld a, $1
+ jr .asm_4ac29
+
+.asm_4ac26
+ ld [$cfaa], a
+
+.asm_4ac29
+ ld hl, $c4b4
+ ld bc, $0d01
+ call ClearBox
+ call Function4aab6
+ ld a, [PartyCount]
+ ld hl, $c4ba
+.asm_4ac3b
+ ld bc, $0028
+ add hl, bc
+ dec a
+ jr nz, .asm_4ac3b
+ ld [hl], $7f
+ ld a, [$cfa9]
+ ld b, a
+ ld a, [PartyCount]
+ inc a
+ cp b
+ jr z, .asm_4ac54
+ ld a, $1
+ ld [$cfaa], a
+
+.asm_4ac54
+ scf
+ ret
+
+.asm_4ac56
+ and a
+ ret
+; 4ac58
+
+Function4ac58: ; 4ac58
+ ld bc, $0212
+ ld hl, $c5cd
+ call ClearBox
+ callba Function8ea4a
+ ld hl, $6ca2
+ call LoadMenuDataHeader
+ ld hl, $d019
+ bit 1, [hl]
+ jr z, .asm_4ac89
+ ld hl, $c5af
+ ld b, $3
+ ld c, $7
+ call TextBox
+ ld hl, $c5c5
+ ld de, $6da7
+ call PlaceString
+ jr .asm_4ac96
+
+.asm_4ac89
+ ld hl, $c55f
+ ld b, $7
+ ld c, $7
+ call TextBox
+ call Function4ad68
+
+.asm_4ac96
+ ld a, $1
+ ld [hBGMapMode], a
+ call Function4acaa
+ call Function1c07
+ and a
+ ret
+; 4aca2
+
+INCBIN "baserom.gbc", $4aca2, $4acaa - $4aca2
+
+Function4acaa: ; 4acaa
+.asm_4acaa
+ ld a, $a0
+ ld [$cf91], a
+ ld a, [$d019]
+ bit 1, a
+ jr z, .asm_4acc2
+ ld a, $2
+ ld [$cf92], a
+ ld a, $c
+ ld [$cf82], a
+ jr .asm_4accc
+
+.asm_4acc2
+ ld a, $4
+ ld [$cf92], a
+ ld a, $8
+ ld [$cf82], a
+
+.asm_4accc
+ ld a, $b
+ ld [$cf83], a
+ ld a, $1
+ ld [$cf88], a
+ call Function1c10
+ ld hl, $cfa5
+ set 6, [hl]
+ call Function1bc9
+ ld de, $0008
+ call StartSFX
+ ld a, [hJoyPressed]
+ bit 0, a
+ jr nz, .asm_4acf4
+ bit 1, a
+ jr nz, .asm_4acf3
+ jr .asm_4acaa
+
+.asm_4acf3
+ ret
+
+.asm_4acf4
+ ld a, [$d019]
+ bit 1, a
+ jr nz, .asm_4ad0e
+ ld a, [$cfa9]
+ cp $1
+ jr z, Function4ad17
+ cp $2
+ jp z, Function4ad56
+ cp $3
+ jp z, Function4ad60
+ jr .asm_4acf3
+
+.asm_4ad0e
+ ld a, [$cfa9]
+ cp $1
+ jr z, Function4ad56
+ jr .asm_4acf3
+
+Function4ad17: ; 4ad17
+ call Function4adb2
+ jr z, .asm_4ad4a
+ ld hl, DefaultFlypoint
+ ld a, $ff
+ cp [hl]
+ jr z, .asm_4ad39
+ inc hl
+ cp [hl]
+ jr z, .asm_4ad39
+ inc hl
+ cp [hl]
+ jr z, .asm_4ad39
+ ld de, $0019
+ call WaitPlaySFX
+ ld hl, UnknownText_0x4ad51
+ call PrintText
+ ret
+
+.asm_4ad39
+ ld a, [CurPartyMon]
+ ld [hl], a
+ call Function4a9c3
+ ret c
+ ld a, [$d019]
+ set 0, a
+ ld [$d019], a
+ ret
+
+.asm_4ad4a
+ ld a, $ff
+ ld [hl], a
+ call Function4adc2
+ ret
+
+UnknownText_0x4ad51: ; 0x4ad51
+ ; Only three #MON may enter.
+ text_jump UnknownText_0x1c521c, BANK(UnknownText_0x1c521c)
+ db "@"
+; 0x4ad56
+
+Function4ad56: ; 4ad56
+ callba OpenPartyStats
+ call Function3200
+ ret
+; 4ad60
+
+Function4ad60: ; 4ad60
+ callba Function12fba
+ ret
+; 4ad67
+
+INCBIN "baserom.gbc", $4ad67, $4ad68 - $4ad67
+
+Function4ad68: ; 4ad68
+ ld hl, $c59d
+ ld de, $6d88
+ call PlaceString
+ call Function4adb2
+ jr c, .asm_4ad7e
+ ld hl, $c575
+ ld de, $6da0
+ jr .asm_4ad84
+
+.asm_4ad7e
+ ld hl, $c575
+ ld de, $6d9a
+
+.asm_4ad84
+ call PlaceString
+ ret
+; 4ad88
+
+INCBIN "baserom.gbc", $4ad88, $4adb2 - $4ad88
+
+Function4adb2: ; 4adb2
+ ld hl, DefaultFlypoint
+ ld a, [CurPartyMon]
+ cp [hl]
+ ret z
+ inc hl
+ cp [hl]
+ ret z
+ inc hl
+ cp [hl]
+ ret z
+ scf
+ ret
+; 4adc2
+
+Function4adc2: ; 4adc2
+ ld a, [DefaultFlypoint]
+ cp $ff
+ jr nz, .asm_4ade5
+ ld a, [$d003]
+ cp $ff
+ jr nz, .asm_4addd
+ ld a, [$d004]
+ ld [DefaultFlypoint], a
+ ld a, $ff
+ ld [$d004], a
+ jr .asm_4ade5
+
+.asm_4addd
+ ld [DefaultFlypoint], a
+ ld a, $ff
+ ld [$d003], a
+
+.asm_4ade5
+ ld a, [$d003]
+ cp $ff
+ ret nz
+ ld b, a
+ ld a, [$d004]
+ ld [$d003], a
+ ld a, b
+ ld [$d004], a
+ ret
+; 4adf7
+
+Function4adf7: ; 4adf7
+ ld a, [$d019]
+ bit 0, a
+ ret z
+ ld a, [PartyCount]
+ inc a
+ ld [$cfa9], a
+ ld a, $1
+ ld [$cfaa], a
+ ld a, [$d019]
+ res 0, a
+ ld [$d019], a
+ ret
+; 4ae12
+
+Function4ae12: ; 4ae12
+ call Function4ae1f
+ ld a, $0
+ jr c, .asm_4ae1b
+ ld a, $1
+
+.asm_4ae1b
+ ld [ScriptVar], a
+ ret
+; 4ae1f
+
+Function4ae1f: ; 4ae1f
+ ld bc, $0e07
+ push bc
+ ld hl, MenuDataHeader_0x1e1d
+ call Function1d3c
+ pop bc
+ ld a, b
+ ld [$cf83], a
+ add $5
+ ld [$cf85], a
+ ld a, c
+ ld [$cf82], a
+ add $4
+ ld [$cf84], a
+ call Function1c00
+ call Function1d81
+ push af
+ ld c, $f
+ call DelayFrames
+ call Function4ae5e
+ pop af
+ jr c, .asm_4ae57
+ ld a, [$cfa9]
+ cp $2
+ jr z, .asm_4ae57
+ and a
+ ret
+
+.asm_4ae57
+ ld a, $2
+ ld [$cfa9], a
+ scf
+ ret
+; 4ae5e
+
+Function4ae5e: ; 4ae5e
+ ld a, [hOAMUpdate]
+ push af
+ call Function1c07
+ call Function1ad2
+ xor a
+ ld [hOAMUpdate], a
+ call DelayFrame
+ ld a, $1
+ ld [hOAMUpdate], a
+ call Function321c
+ pop af
+ ld [hOAMUpdate], a
+ ret
+; 4ae78
+
+
SECTION "bank13",ROMX,BANK[$13]
Function4c000: ; 4c000
@@ -48698,7 +53457,7 @@
push hl
srl a
jr c, .asm_4c021
- ld hl, TileSetPalettes
+ ld hl, TilesetPalettes
add [hl]
ld l, a
ld a, [$d1e7]
@@ -48709,7 +53468,7 @@
jr .asm_4c031
.asm_4c021
- ld hl, TileSetPalettes
+ ld hl, TilesetPalettes
add [hl]
ld l, a
ld a, [$d1e7]
@@ -48741,7 +53500,7 @@
push hl
srl a
jr c, .asm_4c05b
- ld hl, TileSetPalettes
+ ld hl, TilesetPalettes
add [hl]
ld l, a
ld a, [$d1e7]
@@ -48752,7 +53511,7 @@
jr .asm_4c06b
.asm_4c05b
- ld hl, TileSetPalettes
+ ld hl, TilesetPalettes
add [hl]
ld l, a
ld a, [$d1e7]
@@ -48774,135 +53533,9 @@
; 4c075
-Tileset03PalMap: ; 0x4c075
-INCBIN "tilesets/03_palette_map.bin"
-; 0x4c0e5
+INCLUDE "tilesets/palette_maps.asm"
-Tileset00PalMap: ; 0x4c0e5
-Tileset01PalMap: ; 0x4c0e5
-INCBIN "tilesets/01_palette_map.bin"
-; 0x4c155
-Tileset02PalMap: ; 0x4c155
-INCBIN "tilesets/02_palette_map.bin"
-; 0x4c1c5
-
-Tileset05PalMap: ; 0x4c1c5
-INCBIN "tilesets/05_palette_map.bin"
-; 0x4c235
-
-Tileset06PalMap: ; 0x4c235
-INCBIN "tilesets/06_palette_map.bin"
-; 0x4c2a5
-
-Tileset07PalMap: ; 0x4c2a5
-INCBIN "tilesets/07_palette_map.bin"
-; 0x4c315
-
-Tileset08PalMap: ; 0x4c315
-INCBIN "tilesets/08_palette_map.bin"
-; 0x4c385
-
-Tileset09PalMap: ; 0x4c385
-INCBIN "tilesets/09_palette_map.bin"
-; 0x4c3f5
-
-Tileset10PalMap: ; 0x4c3f5
-INCBIN "tilesets/10_palette_map.bin"
-; 0x4c465
-
-Tileset11PalMap: ; 0x4c465
-INCBIN "tilesets/11_palette_map.bin"
-; 0x4c4d5
-
-Tileset12PalMap: ; 0x4c4d5
-INCBIN "tilesets/12_palette_map.bin"
-; 0x4c545
-
-Tileset13PalMap: ; 0x4c545
-INCBIN "tilesets/13_palette_map.bin"
-; 0x4c5b5
-
-Tileset14PalMap: ; 0x4c5b5
-INCBIN "tilesets/14_palette_map.bin"
-; 0x4c625
-
-Tileset15PalMap: ; 0x4c625
-INCBIN "tilesets/15_palette_map.bin"
-; 0x4c695
-
-Tileset16PalMap: ; 0x4c695
-INCBIN "tilesets/16_palette_map.bin"
-; 0x4c705
-
-Tileset23PalMap: ; 0x4c705
-INCBIN "tilesets/23_palette_map.bin"
-; 0x4c775
-
-Tileset24PalMap: ; 0x4c775
-Tileset30PalMap: ; 0x4c775
-INCBIN "tilesets/30_palette_map.bin"
-; 0x4c7e5
-
-Tileset25PalMap: ; 0x4c7e5
-INCBIN "tilesets/25_palette_map.bin"
-; 0x4c855
-
-Tileset26PalMap: ; 0x4c855
-Tileset32PalMap: ; 0x4c855
-Tileset33PalMap: ; 0x4c855
-Tileset34PalMap: ; 0x4c855
-Tileset35PalMap: ; 0x4c855
-Tileset36PalMap: ; 0x4c855
-INCBIN "tilesets/36_palette_map.bin"
-; 0x4c8c5
-
-Tileset27PalMap: ; 0x4c8c5
-INCBIN "tilesets/27_palette_map.bin"
-; 0x4c935
-
-Tileset17PalMap: ; 0x4c935
-INCBIN "tilesets/17_palette_map.bin"
-; 0x4c9a5
-
-Tileset28PalMap: ; 0x4c9a5
-INCBIN "tilesets/28_palette_map.bin"
-; 0x4ca15
-
-Tileset18PalMap: ; 0x4ca15
-INCBIN "tilesets/18_palette_map.bin"
-; 0x4ca85
-
-Tileset19PalMap: ; 0x4ca85
-INCBIN "tilesets/19_palette_map.bin"
-; 0x4caf5
-
-Tileset20PalMap: ; 0x4caf5
-INCBIN "tilesets/20_palette_map.bin"
-; 0x4cb65
-
-INCBIN "baserom.gbc", $4cb65, $4cbd5-$4cb65
-
-Tileset29PalMap: ; 0x4cbd5
-INCBIN "tilesets/29_palette_map.bin"
-; 0x4cc45
-
-Tileset31PalMap: ; 0x4cc45
-INCBIN "tilesets/31_palette_map.bin"
-; 0x4ccb5
-
-Tileset21PalMap: ; 0x4ccb5
-INCBIN "tilesets/21_palette_map.bin"
-; 0x4cd25
-
-Tileset22PalMap: ; 0x4cd25
-INCBIN "tilesets/22_palette_map.bin"
-; 0x4cd95
-
-Tileset04PalMap: ; 0x4cd95
-INCBIN "tilesets/04_palette_map.bin"
-; 0x4ce05
-
INCBIN "baserom.gbc", $4ce05, $4ce1f - $4ce05
TileCollisionTable: ; 4ce1f
@@ -49192,9 +53825,36 @@
ret
; 4d249
-INCBIN "baserom.gbc", $4d249, $4d35b - $4d249
+INCBIN "baserom.gbc", $4d249, $4d319 - $4d249
+Function4d319: ; 4d319
+ ld a, [$cfa9]
+ dec a
+ ld [CurPartyMon], a
+ call LowVolume
+ ld a, $25
+ call Predef
+ ld a, [CurPartyMon]
+ inc a
+ ld [$cfa9], a
+ call Functionfdb
+ call WhiteBGMap
+ call MaxVolume
+ callba Function28ef8
+ callba Function4d354
+ callba Function16d673
+ callba Function28eff
+ call Function3200
+ ret
+; 4d354
+Function4d354: ; 4d354
+ call WaitBGMap
+ call Function3200
+ ret
+; 4d35b
+
+
Function4d35b: ; 4d35b
ld h, d
ld l, e
@@ -49538,305 +54198,8 @@
INCBIN "baserom.gbc", $4d580, $4d596 - $4d580
Tilesets:
+INCLUDE "tilesets/tileset_headers.asm"
-Tileset00: ; 0x4d596
- dbw BANK(Tileset00GFX), Tileset00GFX
- dbw BANK(Tileset00Meta), Tileset00Meta
- dbw BANK(Tileset00Coll), Tileset00Coll
- dw Tileset00Anim
- dw $0000
- dw Tileset00PalMap
-
-Tileset01: ; 0x4d5a5
- dbw BANK(Tileset01GFX), Tileset01GFX
- dbw BANK(Tileset01Meta), Tileset01Meta
- dbw BANK(Tileset01Coll), Tileset01Coll
- dw Tileset01Anim
- dw $0000
- dw Tileset01PalMap
-
-Tileset02: ; 0x4d5b4
- dbw BANK(Tileset02GFX), Tileset02GFX
- dbw BANK(Tileset02Meta), Tileset02Meta
- dbw BANK(Tileset02Coll), Tileset02Coll
- dw Tileset02Anim
- dw $0000
- dw Tileset02PalMap
-
-Tileset03: ; 0x4d5c3
- dbw BANK(Tileset03GFX), Tileset03GFX
- dbw BANK(Tileset03Meta), Tileset03Meta
- dbw BANK(Tileset03Coll), Tileset03Coll
- dw Tileset03Anim
- dw $0000
- dw Tileset03PalMap
-
-Tileset04: ; 0x4d5d2
- dbw BANK(Tileset04GFX), Tileset04GFX
- dbw BANK(Tileset04Meta), Tileset04Meta
- dbw BANK(Tileset04Coll), Tileset04Coll
- dw Tileset04Anim
- dw $0000
- dw Tileset04PalMap
-
-Tileset05: ; 0x4d5e1
- dbw BANK(Tileset05GFX), Tileset05GFX
- dbw BANK(Tileset05Meta), Tileset05Meta
- dbw BANK(Tileset05Coll), Tileset05Coll
- dw Tileset05Anim
- dw $0000
- dw Tileset05PalMap
-
-Tileset06: ; 0x4d5f0
- dbw BANK(Tileset06GFX), Tileset06GFX
- dbw BANK(Tileset06Meta), Tileset06Meta
- dbw BANK(Tileset06Coll), Tileset06Coll
- dw Tileset06Anim
- dw $0000
- dw Tileset06PalMap
-
-Tileset07: ; 0x4d5ff
- dbw BANK(Tileset07GFX), Tileset07GFX
- dbw BANK(Tileset07Meta), Tileset07Meta
- dbw BANK(Tileset07Coll), Tileset07Coll
- dw Tileset07Anim
- dw $0000
- dw Tileset07PalMap
-
-Tileset08: ; 0x4d60e
- dbw BANK(Tileset08GFX), Tileset08GFX
- dbw BANK(Tileset08Meta), Tileset08Meta
- dbw BANK(Tileset08Coll), Tileset08Coll
- dw Tileset08Anim
- dw $0000
- dw Tileset08PalMap
-
-Tileset09: ; 0x4d61d
- dbw BANK(Tileset09GFX), Tileset09GFX
- dbw BANK(Tileset09Meta), Tileset09Meta
- dbw BANK(Tileset09Coll), Tileset09Coll
- dw Tileset09Anim
- dw $0000
- dw Tileset09PalMap
-
-Tileset10: ; 0x4d62c
- dbw BANK(Tileset10GFX), Tileset10GFX
- dbw BANK(Tileset10Meta), Tileset10Meta
- dbw BANK(Tileset10Coll), Tileset10Coll
- dw Tileset10Anim
- dw $0000
- dw Tileset10PalMap
-
-Tileset11: ; 0x4d63b
- dbw BANK(Tileset11GFX), Tileset11GFX
- dbw BANK(Tileset11Meta), Tileset11Meta
- dbw BANK(Tileset11Coll), Tileset11Coll
- dw Tileset11Anim
- dw $0000
- dw Tileset11PalMap
-
-Tileset12: ; 0x4d64a
- dbw BANK(Tileset12GFX), Tileset12GFX
- dbw BANK(Tileset12Meta), Tileset12Meta
- dbw BANK(Tileset12Coll), Tileset12Coll
- dw Tileset12Anim
- dw $0000
- dw Tileset12PalMap
-
-Tileset13: ; 0x4d659
- dbw BANK(Tileset13GFX), Tileset13GFX
- dbw BANK(Tileset13Meta), Tileset13Meta
- dbw BANK(Tileset13Coll), Tileset13Coll
- dw Tileset13Anim
- dw $0000
- dw Tileset13PalMap
-
-Tileset14: ; 0x4d668
- dbw BANK(Tileset14GFX), Tileset14GFX
- dbw BANK(Tileset14Meta), Tileset14Meta
- dbw BANK(Tileset14Coll), Tileset14Coll
- dw Tileset14Anim
- dw $0000
- dw Tileset14PalMap
-
-Tileset15: ; 0x4d677
- dbw BANK(Tileset15GFX), Tileset15GFX
- dbw BANK(Tileset15Meta), Tileset15Meta
- dbw BANK(Tileset15Coll), Tileset15Coll
- dw Tileset15Anim
- dw $0000
- dw Tileset15PalMap
-
-Tileset16: ; 0x4d686
- dbw BANK(Tileset16GFX), Tileset16GFX
- dbw BANK(Tileset16Meta), Tileset16Meta
- dbw BANK(Tileset16Coll), Tileset16Coll
- dw Tileset16Anim
- dw $0000
- dw Tileset16PalMap
-
-Tileset17: ; 0x4d695
- dbw BANK(Tileset17GFX), Tileset17GFX
- dbw BANK(Tileset17Meta), Tileset17Meta
- dbw BANK(Tileset17Coll), Tileset17Coll
- dw Tileset17Anim
- dw $0000
- dw Tileset17PalMap
-
-Tileset18: ; 0x4d6a4
- dbw BANK(Tileset18GFX), Tileset18GFX
- dbw BANK(Tileset18Meta), Tileset18Meta
- dbw BANK(Tileset18Coll), Tileset18Coll
- dw Tileset18Anim
- dw $0000
- dw Tileset18PalMap
-
-Tileset19: ; 0x4d6b3
- dbw BANK(Tileset19GFX), Tileset19GFX
- dbw BANK(Tileset19Meta), Tileset19Meta
- dbw BANK(Tileset19Coll), Tileset19Coll
- dw Tileset19Anim
- dw $0000
- dw Tileset19PalMap
-
-Tileset20: ; 0x4d6c2
- dbw BANK(Tileset20GFX), Tileset20GFX
- dbw BANK(Tileset20Meta), Tileset20Meta
- dbw BANK(Tileset20Coll), Tileset20Coll
- dw Tileset20Anim
- dw $0000
- dw Tileset20PalMap
-
-Tileset21: ; 0x4d6d1
- dbw BANK(Tileset21GFX), Tileset21GFX
- dbw BANK(Tileset21Meta), Tileset21Meta
- dbw BANK(Tileset21Coll), Tileset21Coll
- dw Tileset21Anim
- dw $0000
- dw Tileset21PalMap
-
-Tileset22: ; 0x4d6e0
- dbw BANK(Tileset22GFX), Tileset22GFX
- dbw BANK(Tileset22Meta), Tileset22Meta
- dbw BANK(Tileset22Coll), Tileset22Coll
- dw Tileset22Anim
- dw $0000
- dw Tileset22PalMap
-
-Tileset23: ; 0x4d6ef
- dbw BANK(Tileset23GFX), Tileset23GFX
- dbw BANK(Tileset23Meta), Tileset23Meta
- dbw BANK(Tileset23Coll), Tileset23Coll
- dw Tileset23Anim
- dw $0000
- dw Tileset23PalMap
-
-Tileset24: ; 0x4d6fe
- dbw BANK(Tileset24GFX), Tileset24GFX
- dbw BANK(Tileset24Meta), Tileset24Meta
- dbw BANK(Tileset24Coll), Tileset24Coll
- dw Tileset24Anim
- dw $0000
- dw Tileset24PalMap
-
-Tileset25: ; 0x4d70d
- dbw BANK(Tileset25GFX), Tileset25GFX
- dbw BANK(Tileset25Meta), Tileset25Meta
- dbw BANK(Tileset25Coll), Tileset25Coll
- dw Tileset25Anim
- dw $0000
- dw Tileset25PalMap
-
-Tileset26: ; 0x4d71c
- dbw BANK(Tileset26GFX), Tileset26GFX
- dbw BANK(Tileset26Meta), Tileset26Meta
- dbw BANK(Tileset26Coll), Tileset26Coll
- dw Tileset26Anim
- dw $0000
- dw Tileset26PalMap
-
-Tileset27: ; 0x4d72b
- dbw BANK(Tileset27GFX), Tileset27GFX
- dbw BANK(Tileset27Meta), Tileset27Meta
- dbw BANK(Tileset27Coll), Tileset27Coll
- dw Tileset27Anim
- dw $0000
- dw Tileset27PalMap
-
-Tileset28: ; 0x4d73a
- dbw BANK(Tileset28GFX), Tileset28GFX
- dbw BANK(Tileset28Meta), Tileset28Meta
- dbw BANK(Tileset28Coll), Tileset28Coll
- dw Tileset28Anim
- dw $0000
- dw Tileset28PalMap
-
-Tileset29: ; 0x4d749
- dbw BANK(Tileset29GFX), Tileset29GFX
- dbw BANK(Tileset29Meta), Tileset29Meta
- dbw BANK(Tileset29Coll), Tileset29Coll
- dw Tileset29Anim
- dw $0000
- dw Tileset29PalMap
-
-Tileset30: ; 0x4d758
- dbw BANK(Tileset30GFX), Tileset30GFX
- dbw BANK(Tileset30Meta), Tileset30Meta
- dbw BANK(Tileset30Coll), Tileset30Coll
- dw Tileset30Anim
- dw $0000
- dw Tileset30PalMap
-
-Tileset31: ; 0x4d767
- dbw BANK(Tileset31GFX), Tileset31GFX
- dbw BANK(Tileset31Meta), Tileset31Meta
- dbw BANK(Tileset31Coll), Tileset31Coll
- dw Tileset31Anim
- dw $0000
- dw Tileset31PalMap
-
-Tileset32: ; 0x4d776
- dbw BANK(Tileset32GFX), Tileset32GFX
- dbw BANK(Tileset32Meta), Tileset32Meta
- dbw BANK(Tileset32Coll), Tileset32Coll
- dw Tileset32Anim
- dw $0000
- dw Tileset32PalMap
-
-Tileset33: ; 0x4d785
- dbw BANK(Tileset33GFX), Tileset33GFX
- dbw BANK(Tileset33Meta), Tileset33Meta
- dbw BANK(Tileset33Coll), Tileset33Coll
- dw Tileset33Anim
- dw $0000
- dw Tileset33PalMap
-
-Tileset34: ; 0x4d794
- dbw BANK(Tileset34GFX), Tileset34GFX
- dbw BANK(Tileset34Meta), Tileset34Meta
- dbw BANK(Tileset34Coll), Tileset34Coll
- dw Tileset34Anim
- dw $0000
- dw Tileset34PalMap
-
-Tileset35: ; 0x4d7a3
- dbw BANK(Tileset35GFX), Tileset35GFX
- dbw BANK(Tileset35Meta), Tileset35Meta
- dbw BANK(Tileset35Coll), Tileset35Coll
- dw Tileset35Anim
- dw $0000
- dw Tileset35PalMap
-
-Tileset36: ; 0x4d7b2
- dbw BANK(Tileset36GFX), Tileset36GFX
- dbw BANK(Tileset36Meta), Tileset36Meta
- dbw BANK(Tileset36Coll), Tileset36Coll
- dw Tileset36Anim
- dw $0000
- dw Tileset36PalMap
-
-; 0x4d7c1
-
INCBIN "baserom.gbc", $4d7c1, $4d860 - $4d7c1
CheckPokerus: ; 4d860
@@ -49866,9 +54229,367 @@
ret
; 4d87a
-INCBIN "baserom.gbc", $4d87a, $4db3b - $4d87a
+Function4d87a: ; 4d87a
+ xor a
+ ld [ScriptVar], a
+ ld [$d265], a
+ ld a, [PartyCount]
+ and a
+ ret z
+ ld d, a
+ ld hl, PartyMon1ID
+ ld bc, PartySpecies
+.asm_4d88d
+ ld a, [bc]
+ inc bc
+ cp $fd
+ call nz, Function4d939
+ push bc
+ ld bc, $0030
+ add hl, bc
+ pop bc
+ dec d
+ jr nz, .asm_4d88d
+ ld a, $1
+ call GetSRAMBank
+ ld a, [BoxCount]
+ and a
+ jr z, .asm_4d8c8
+ ld d, a
+ ld hl, BoxMon1ID
+ ld bc, BoxSpecies
+.asm_4d8af
+ ld a, [bc]
+ inc bc
+ cp $fd
+ jr z, .asm_4d8bf
+ call Function4d939
+ jr nc, .asm_4d8bf
+ ld a, $1
+ ld [$d265], a
+.asm_4d8bf
+ push bc
+ ld bc, $0020
+ add hl, bc
+ pop bc
+ dec d
+ jr nz, .asm_4d8af
+.asm_4d8c8
+ call CloseSRAM
+ ld c, $0
+.asm_4d8cd
+ ld a, [$db72]
+ and $f
+ cp c
+ jr z, .asm_4d90b
+ ld hl, $599f
+ ld b, $0
+ add hl, bc
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ call GetSRAMBank
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, [hl]
+ and a
+ jr z, .asm_4d90b
+ push bc
+ ld b, h
+ ld c, l
+ inc bc
+ ld de, $001c
+ add hl, de
+ ld d, a
+.asm_4d8f1
+ ld a, [bc]
+ inc bc
+ cp $fd
+ jr z, .asm_4d901
+ call Function4d939
+ jr nc, .asm_4d901
+ ld a, $1
+ ld [$d265], a
+
+.asm_4d901
+ push bc
+ ld bc, $0020
+ add hl, bc
+ pop bc
+ dec d
+ jr nz, .asm_4d8f1
+ pop bc
+
+.asm_4d90b
+ inc c
+ ld a, c
+ cp $e
+ jr c, .asm_4d8cd
+ call CloseSRAM
+ ld a, [ScriptVar]
+ and a
+ ret z
+ callba Function1060cd
+ ld a, [$d265]
+ and a
+ push af
+ ld a, [CurPartySpecies]
+ ld [$d265], a
+ call GetPokemonName
+ ld hl, $59c9
+ pop af
+ jr z, .asm_4d936
+ ld hl, $59ce
+
+.asm_4d936
+ jp PrintText
+; 4d939
+
+Function4d939: ; 4d939
+ push bc
+ push de
+ push hl
+ ld d, h
+ ld e, l
+ ld hl, Buffer1
+ ld bc, $8205
+ call PrintNum
+ ld hl, DefaultFlypoint
+ ld de, $dc9f
+ ld bc, $8205
+ call PrintNum
+ ld b, $5
+ ld c, $0
+ ld hl, EndFlypoint
+ ld de, $d1ee
+.asm_4d95d
+ ld a, [de]
+ cp [hl]
+ jr nz, .asm_4d967
+ dec de
+ dec hl
+ inc c
+ dec b
+ jr nz, .asm_4d95d
+
+.asm_4d967
+ pop hl
+ push hl
+ ld de, $fffa
+ add hl, de
+ ld a, [hl]
+ pop hl
+ pop de
+ push af
+ ld a, c
+ ld b, $1
+ cp $5
+ jr z, .asm_4d984
+ ld b, $2
+ cp $3
+ jr nc, .asm_4d984
+ ld b, $3
+ cp $2
+ jr nz, .asm_4d99b
+
+.asm_4d984
+ inc b
+ ld a, [ScriptVar]
+ and a
+ jr z, .asm_4d98e
+ cp b
+ jr c, .asm_4d99b
+
+.asm_4d98e
+ dec b
+ ld a, b
+ ld [ScriptVar], a
+ pop bc
+ ld a, b
+ ld [CurPartySpecies], a
+ pop bc
+ scf
+ ret
+
+.asm_4d99b
+ pop bc
+ pop bc
+ and a
+ ret
+; 4d99f
+
+INCBIN "baserom.gbc", $4d99f, $4d9d3 - $4d99f
+
+Function4d9d3: ; 4d9d3
+ ld hl, StringBuffer3
+ ld de, $dc9f
+ ld bc, $8205
+ call PrintNum
+ ld a, $50
+ ld [$d09e], a
+ ret
+; 4d9e5
+
+Function4d9e5: ; 4d9e5
+ ld a, [$df9c]
+ and a
+ jp z, Function4db35
+ ld [CurPartySpecies], a
+ ld [CurSpecies], a
+ call GetBaseData
+ ld hl, PartyCount
+ ld a, [hl]
+ cp $6
+ jp nc, Function4daa3
+ inc a
+ ld [hl], a
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [$df9c]
+ ld [hli], a
+ ld [CurSpecies], a
+ ld a, $ff
+ ld [hl], a
+ ld hl, PartyMon1Species
+ ld a, [PartyCount]
+ dec a
+ ld bc, $0030
+ call AddNTimes
+ ld d, h
+ ld e, l
+ ld hl, $df9c
+ ld bc, $0030
+ call CopyBytes
+ ld a, [PartyCount]
+ dec a
+ ld hl, PartyMon1OT
+ call SkipNames
+ ld d, h
+ ld e, l
+ ld hl, PlayerName
+ call CopyBytes
+ ld a, [CurPartySpecies]
+ ld [$d265], a
+ call GetPokemonName
+ ld hl, StringBuffer1
+ ld de, $d050
+ ld bc, $000b
+ call CopyBytes
+ call Function4db3b
+ jr c, .asm_4da66
+ ld a, [PartyCount]
+ dec a
+ ld [CurPartyMon], a
+ xor a
+ ld [MonType], a
+ ld de, $d050
+ callab Functione3de
+
+.asm_4da66
+ ld a, [PartyCount]
+ dec a
+ ld hl, PartyMon1Nickname
+ call SkipNames
+ ld d, h
+ ld e, l
+ ld hl, $d050
+ call CopyBytes
+ ld a, [PartyCount]
+ dec a
+ ld hl, PartyMon1Level
+ call GetPartyLocation
+ ld a, [hl]
+ ld [CurPartyLevel], a
+ call Function4db49
+ ld a, [PartyCount]
+ dec a
+ ld hl, PartyMon1CaughtLocation
+ call GetPartyLocation
+ ld a, [hl]
+ and $80
+ ld b, $13
+ or b
+ ld [hl], a
+ xor a
+ ld [$df9c], a
+ and a
+ ld [ScriptVar], a
+ ret
+; 4daa3
+
+Function4daa3: ; 4daa3
+ ld a, $1
+ call GetSRAMBank
+ ld hl, BoxCount
+ ld a, [hl]
+ cp $14
+ call CloseSRAM
+ jr nc, .asm_4db08
+ xor a
+ ld [CurPartyMon], a
+ ld hl, $df9c
+ ld de, $d018
+ ld bc, $0020
+ call CopyBytes
+ ld hl, PlayerName
+ ld de, $d00d
+ ld bc, $000b
+ call CopyBytes
+ callab Function51322
+ ld a, [CurPartySpecies]
+ ld [$d265], a
+ call GetPokemonName
+ call Function4db3b
+ ld hl, StringBuffer1
+ jr c, .asm_4daf7
+ ld a, $2
+ ld [MonType], a
+ ld de, $d050
+ callab Functione3de
+ ld hl, $d050
+
+.asm_4daf7
+ ld a, $1
+ call GetSRAMBank
+ ld de, BoxMon1Nickname
+ ld bc, $000b
+ call CopyBytes
+ call CloseSRAM
+
+.asm_4db08
+ ld a, $1
+ call GetSRAMBank
+ ld a, [BoxMon1Level]
+ ld [CurPartyLevel], a
+ call CloseSRAM
+ call Function4db83
+ ld a, $1
+ call GetSRAMBank
+ ld hl, BoxMon1CaughtLocation
+ ld a, [hl]
+ and $80
+ ld b, $13
+ or b
+ ld [hl], a
+ call CloseSRAM
+ xor a
+ ld [$df9c], a
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+; 4db35
+
+Function4db35: ; 4db35
+ ld a, $2
+ ld [ScriptVar], a
+ ret
+; 4db3b
+
+
Function4db3b: ; 4db3b
ld hl, $5b44
call PrintText
@@ -49918,7 +54639,7 @@
Function4db83: ; 4db83
ld a, $1
call GetSRAMBank
- ld hl, $ad43
+ ld hl, BoxMon1CaughtLevel
call $5b53
call CloseSRAM
ret
@@ -49928,7 +54649,7 @@
push bc
ld a, $1
call GetSRAMBank
- ld hl, $ad43
+ ld hl, BoxMon1CaughtLevel
pop bc
call $5baf
call CloseSRAM
@@ -49951,8 +54672,147 @@
ret
; 4dbb8
-INCBIN "baserom.gbc", $4dbb8, $4dc8a - $4dbb8
+INCBIN "baserom.gbc", $4dbb8, $4dbd2 - $4dbb8
+Function4dbd2: ; 4dbd2
+ ld hl, PartyMon1Level
+ call Function4dc31
+ ret
+; 4dbd9
+
+Function4dbd9: ; 4dbd9
+ ld hl, PartyMon1Happiness
+ call Function4dc0a
+ ret
+; 4dbe0
+
+Function4dbe0: ; 4dbe0
+ ld hl, PartyMon1Species
+ jp Function4dc56
+; 4dbe6
+
+Function4dbe6: ; 4dbe6
+ ld hl, PartyMon1Species
+ call Function4dc56
+ ret z
+ ld a, c
+ ld hl, PartyMon1ID
+ ld bc, $0030
+ call AddNTimes
+ ld a, [PlayerID]
+ cp [hl]
+ jr nz, .asm_4dc08
+ inc hl
+ ld a, [$d47c]
+ cp [hl]
+ jr nz, .asm_4dc08
+ ld a, $1
+ and a
+ ret
+
+.asm_4dc08
+ xor a
+ ret
+; 4dc0a
+
+Function4dc0a: ; 4dc0a
+ ld c, $0
+ ld a, [PartyCount]
+ ld d, a
+.asm_4dc10
+ ld a, d
+ dec a
+ push hl
+ push bc
+ ld bc, $0030
+ call AddNTimes
+ pop bc
+ ld a, b
+ cp [hl]
+ pop hl
+ jr z, .asm_4dc22
+ jr nc, .asm_4dc26
+
+.asm_4dc22
+ ld a, c
+ or $1
+ ld c, a
+
+.asm_4dc26
+ sla c
+ dec d
+ jr nz, .asm_4dc10
+ call Function4dc67
+ ld a, c
+ and a
+ ret
+; 4dc31
+
+Function4dc31: ; 4dc31
+ ld c, $0
+ ld a, [PartyCount]
+ ld d, a
+.asm_4dc37
+ ld a, d
+ dec a
+ push hl
+ push bc
+ ld bc, $0030
+ call AddNTimes
+ pop bc
+ ld a, b
+ cp [hl]
+ pop hl
+ jr c, .asm_4dc4b
+ ld a, c
+ or $1
+ ld c, a
+
+.asm_4dc4b
+ sla c
+ dec d
+ jr nz, .asm_4dc37
+ call Function4dc67
+ ld a, c
+ and a
+ ret
+; 4dc56
+
+Function4dc56: ; 4dc56
+ ld c, $ff
+ ld hl, PartySpecies
+.asm_4dc5b
+ ld a, [hli]
+ cp $ff
+ ret z
+ inc c
+ cp b
+ jr nz, .asm_4dc5b
+ ld a, $1
+ and a
+ ret
+; 4dc67
+
+Function4dc67: ; 4dc67
+ ld e, $fe
+ ld hl, PartySpecies
+.asm_4dc6c
+ ld a, [hli]
+ cp $ff
+ ret z
+ cp $fd
+ jr nz, .asm_4dc77
+ ld a, c
+ and e
+ ld c, a
+
+.asm_4dc77
+ rlc e
+ jr .asm_4dc6c
+; 4dc7b
+
+INCBIN "baserom.gbc", $4dc7b, $4dc8a - $4dc7b
+
StatsScreenInit: ; 4dc8a
ld hl, StatsScreenMain
jr .gotaddress
@@ -50017,14 +54877,14 @@
INCBIN "baserom.gbc", $4dcf7, $4dd2a - $4dcf7
StatsScreenPointerTable: ; 4dd2a
- dw $5d72 ; regular pokémon
- dw EggStatsInit ; egg
- dw $5de6
- dw $5dac
- dw $5dc6
- dw $5de6
- dw $5dd6
- dw $5d6c
+ dw $5d72 ; regular pokémon
+ dw EggStatsInit ; egg
+ dw $5de6
+ dw $5dac
+ dw $5dc6
+ dw $5de6
+ dw $5dd6
+ dw $5d6c
; 4dd3a
@@ -50041,10 +54901,10 @@
INCBIN "baserom.gbc", $4ddac, $4e21e - $4ddac
IDNoString: ; 4e21e
- db $73, "№.@"
+ db $73, "№.@"
OTString: ; 4e222
- db "OT/@"
+ db "OT/@"
; 4e226
INCBIN "baserom.gbc", $4e226, $4e33a - $4e226
@@ -50106,22 +54966,22 @@
; 0x4e3c0
EggString: ; 4e3c0
- db "EGG@"
+ db "EGG@"
FiveQMarkString: ; 4e3c4
- db "?????@"
+ db "?????@"
EggSoonString: ; 0x4e3ca
- db "It's making sounds", $4e, "inside. It's going", $4e, "to hatch soon!@"
+ db "It's making sounds", $4e, "inside. It's going", $4e, "to hatch soon!@"
EggCloseString: ; 0x4e3fd
- db "It moves around", $4e, "inside sometimes.", $4e, "It must be close", $4e, "to hatching.@"
+ db "It moves around", $4e, "inside sometimes.", $4e, "It must be close", $4e, "to hatching.@"
EggMoreTimeString: ; 0x4e43d
- db "Wonder what's", $4e, "inside? It needs", $4e, "more time, though.@"
+ db "Wonder what's", $4e, "inside? It needs", $4e, "more time, though.@"
EggALotMoreTimeString: ; 0x4e46e
- db "This EGG needs a", $4e, "lot more time to", $4e, "hatch.@"
+ db "This EGG needs a", $4e, "lot more time to", $4e, "hatch.@"
; 0x4e497
@@ -50147,9 +55007,23 @@
ret
; 4e554
-INCBIN "baserom.gbc", $4e554, $4e5e1 - $4e554
+Function4e554: ; 4e554
+ ld a, [BattleType]
+ dec a
+ ld c, a
+ ld hl, $6564
+ ld b, $0
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 4e564
+INCBIN "baserom.gbc", $4e564, $4e5e1 - $4e564
+
Function4e5e1: ; 4e5e1
push hl
push de
@@ -50581,9 +55455,54 @@
ret
; 4e929
-INCBIN "baserom.gbc", $4e929, $4e980 - $4e929
+Function4e929: ; 4e929
+ ld h, b
+ ld l, c
+ call Function4e930
+ ld c, a
+ ret
+; 4e930
+Function4e930: ; 4e930
+ ld a, [hli]
+ xor [hl]
+ ld c, a
+ jr z, .asm_4e941
+ srl c
+ srl c
+.asm_4e939
+ srl c
+ ld a, c
+ cp $18
+ jr nc, .asm_4e939
+ inc c
+.asm_4e941
+ ld a, [de]
+ cp $1
+ ld hl, $695d
+ jr nz, .asm_4e958
+ ld hl, $6976
+ ld a, c
+ and a
+ jr z, .asm_4e958
+.asm_4e950
+ srl c
+ ld a, c
+ cp $9
+ jr nc, .asm_4e950
+ inc c
+
+.asm_4e958
+ ld b, $0
+ add hl, bc
+ ld a, [hl]
+ ret
+; 4e95d
+
+INCBIN "baserom.gbc", $4e95d, $4e980 - $4e95d
+
+
Function4e980: ; 4e980
ld a, [rSVBK]
push af
@@ -50659,7 +55578,7 @@
; 4e9e5
Function4e9e5: ; 4e9e5
- ld hl, $d100
+ ld hl, LYOverrides
ld a, $90
ld bc, $0090
call ByteFill
@@ -50667,7 +55586,7 @@
; 4e9f1
Function4e9f1: ; 4e9f1
- ld hl, $d100
+ ld hl, LYOverrides
ld a, d
ld c, $3e
.asm_4e9f7
@@ -50875,9 +55794,303 @@
ret
; 4eb38
-INCBIN "baserom.gbc", $4eb38, $4f301 - $4eb38
+INCBIN "baserom.gbc", $4eb38, $4f0bc - $4eb38
+Function4f0bc: ; 4f0bc
+ ld a, $0
+ call Function4f26d
+ call Functiona36
+ ld b, $6
+ callba Function50000
+ jr c, .asm_4f0e1
+ ld a, [CurPartySpecies]
+ cp $fd
+ jr z, .asm_4f0e8
+ call IsAPokemon
+ jr c, .asm_4f0e7
+ call Function4f134
+ call Function4f0ee
+ ret
+.asm_4f0e1
+ ld a, $5
+ call Function4f26d
+ ret
+
+.asm_4f0e7
+ ret
+
+.asm_4f0e8
+ ld a, $6
+ call Function4f26d
+ ret
+; 4f0ee
+
+Function4f0ee: ; 4f0ee
+ ld a, [DefaultFlypoint]
+ ld hl, $70f6
+ rst JumpTable
+ ret
+; 4f0f6
+
+Table4f0f6: ; 4f0f6
+ dw Function4f100
+ dw Function4f10e
+ dw Function4f11f
+ dw Function4f125
+ dw Function4f12b
+; 4f100
+
+Function4f100: ; 4f100
+ ld a, $2
+ call Function4f26d
+ ld a, $3
+ call Function4f26d
+ call Function4f2b4
+ ret
+; 4f10e
+
+Function4f10e: ; 4f10e
+ call Function4f242
+ ld a, $4
+ call Function4f26d
+ ld a, $3
+ call Function4f26d
+ call Function4f2b4
+ ret
+; 4f11f
+
+Function4f11f: ; 4f11f
+ ld a, $1
+ call Function4f26d
+ ret
+; 4f125
+
+Function4f125: ; 4f125
+ ld a, $1
+ call Function4f26d
+ ret
+; 4f12b
+
+Function4f12b: ; 4f12b
+ ld a, $7
+ call Function4f26d
+ call Function4f2b4
+ ret
+; 4f134
+
+Function4f134: ; 4f134
+ ld a, $1d
+ call GetPartyParamLocation
+ ld a, [hli]
+ ld [$d03b], a
+ ld a, [hld]
+ ld [$d03c], a
+ or [hl]
+ jr z, .asm_4f170
+ ld a, $1
+ ld [DefaultFlypoint], a
+ ld a, $6
+ call GetPartyParamLocation
+ ld a, [PlayerID]
+ cp [hl]
+ jr nz, .asm_4f15f
+ inc hl
+ ld a, [$d47c]
+ jr nz, .asm_4f15f
+ ld a, $0
+ ld [DefaultFlypoint], a
+
+.asm_4f15f
+ call Function4f18c
+ call Function4f242
+ call Function4f176
+ call Function4f1c5
+ call Function4f20a
+ and a
+ ret
+
+.asm_4f170
+ ld a, $2
+ ld [DefaultFlypoint], a
+ ret
+; 4f176
+
+Function4f176: ; 4f176
+ ld a, [CurPartyMon]
+ ld hl, PartyMon1Nickname
+ ld bc, $000b
+ call AddNTimes
+ ld de, $d003
+ ld bc, $000b
+ call CopyBytes
+ ret
+; 4f18c
+
+Function4f18c: ; 4f18c
+ ld a, $50
+ ld hl, $d036
+ ld bc, $0004
+ call ByteFill
+ ld a, [$d03b]
+ and $3f
+ jr z, .asm_4f1b4
+ cp $1
+ jr nz, .asm_4f1a4
+ ld a, $5
+
+.asm_4f1a4
+ ld [$d03a], a
+ ld hl, $d036
+ ld de, $d03a
+ ld bc, $4103
+ call PrintNum
+ ret
+
+.asm_4f1b4
+ ld de, $d036
+ ld hl, $71c1
+ ld bc, $0004
+ call CopyBytes
+ ret
+; 4f1c1
+
+INCBIN "baserom.gbc", $4f1c1, $4f1c5 - $4f1c1
+
+Function4f1c5: ; 4f1c5
+ ld a, [$d03b]
+ and $c0
+ jr z, .asm_4f1df
+ rlca
+ rlca
+ dec a
+ ld hl, $71e6
+ call GetNthString
+ ld d, h
+ ld e, l
+ ld hl, $d01f
+ call CopyName2
+ and a
+ ret
+
+.asm_4f1df
+ ld de, $d01f
+ call Function4f1f8
+ ret
+; 4f1e6
+
+INCBIN "baserom.gbc", $4f1e6, $4f1f8 - $4f1e6
+
+Function4f1f8: ; 4f1f8
+ ld hl, $7202
+ ld bc, $000b
+ call CopyBytes
+ ret
+; 4f202
+
+INCBIN "baserom.gbc", $4f202, $4f20a - $4f202
+
+Function4f20a: ; 4f20a
+ ld a, [$d03c]
+ and $7f
+ jr z, .asm_4f22e
+ cp $7f
+ jr z, .asm_4f234
+ cp $7e
+ jr z, .asm_4f23b
+ ld e, a
+ callba GetLandmarkName
+ ld hl, StringBuffer1
+ ld de, $d00e
+ ld bc, $0011
+ call CopyBytes
+ and a
+ ret
+
+.asm_4f22e
+ ld de, $d00e
+ jp Function4f1f8
+
+.asm_4f234
+ ld a, $4
+ ld [DefaultFlypoint], a
+ scf
+ ret
+
+.asm_4f23b
+ ld a, $3
+ ld [DefaultFlypoint], a
+ scf
+ ret
+; 4f242
+
+Function4f242: ; 4f242
+ ld a, [CurPartyMon]
+ ld hl, PartyMon1OT
+ ld bc, $000b
+ call AddNTimes
+ ld de, $d02a
+ ld bc, $000b
+ call CopyBytes
+ ld hl, $726b
+ ld a, [$d03c]
+ bit 7, a
+ jr z, .asm_4f264
+ ld hl, $726c
+
+.asm_4f264
+ ld de, $d035
+ ld a, $50
+ ld [de], a
+ ret
+; 4f26b
+
+INCBIN "baserom.gbc", $4f26b, $4f26d - $4f26b
+
+Function4f26d: ; 4f26d
+ ld e, a
+ ld d, $0
+ ld hl, $727c
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ call PrintText
+ ret
+; 4f27c
+
+INCBIN "baserom.gbc", $4f27c, $4f2b4 - $4f27c
+
+Function4f2b4: ; 4f2b4
+ ld a, $1f
+ call GetPartyParamLocation
+ ld a, [$d03a]
+ ld c, a
+ ld a, [hl]
+ sub c
+ ld c, a
+ ld hl, $72d6
+ ld de, $0003
+.asm_4f2c6
+ cp [hl]
+ jr c, .asm_4f2ce
+ jr z, .asm_4f2ce
+ add hl, de
+ jr .asm_4f2c6
+
+.asm_4f2ce
+ inc hl
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ call PrintText
+ ret
+; 4f2d6
+
+INCBIN "baserom.gbc", $4f2d6, $4f301 - $4f2d6
+
+
Function4f301: ; 4f301
ld hl, $001e
add hl, bc
@@ -50974,7 +56187,7 @@
cp $ff
jr z, .asm_50084 ; 0x5007a $8
push hl
- ld hl, $4089
+ ld hl, Table50089
rst JumpTable
pop hl
jr .asm_50077 ; 0x50082 $f3
@@ -50984,9 +56197,53 @@
ret
; 0x50089
-INCBIN "baserom.gbc", $50089, $500cf - $50089
+Table50089: ; 50089
+ dw Function5009b
+ dw Function500cf
+ dw Function50138
+ dw Function50176
+ dw Function501b2
+ dw Function501e0
+ dw Function5022f
+ dw Function502b1
+ dw Function50307
+; 5009b
+Function5009b: ; 5009b
+ ld hl, $c4b7
+ ld a, [PartyCount]
+ and a
+ jr z, .asm_500bf
+ ld c, a
+ ld b, $0
+.asm_500a7
+ push bc
+ push hl
+ push hl
+ ld hl, PartyMon1Nickname
+ ld a, b
+ call GetNick
+ pop hl
+ call PlaceString
+ pop hl
+ ld de, $0028
+ add hl, de
+ pop bc
+ inc b
+ dec c
+ jr nz, .asm_500a7
+.asm_500bf
+ dec hl
+ dec hl
+ ld de, $40c8
+ call PlaceString
+ ret
+; 500c8
+
+INCBIN "baserom.gbc", $500c8, $500cf - $500c8
+
+
Function500cf: ; 500cf
xor a
ld [$cda9], a
@@ -51585,35 +56842,35 @@
; 0x504d2
PartyMenuStrings: ; 0x504d2
- dw ChooseAMonString
- dw UseOnWhichPKMNString
- dw WhichPKMNString
- dw TeachWhichPKMNString
- dw MoveToWhereString
- dw UseOnWhichPKMNString
- dw ChooseAMonString ; Probably used to be ChooseAFemalePKMNString
- dw ChooseAMonString ; Probably used to be ChooseAMalePKMNString
- dw ToWhichPKMNString
+ dw ChooseAMonString
+ dw UseOnWhichPKMNString
+ dw WhichPKMNString
+ dw TeachWhichPKMNString
+ dw MoveToWhereString
+ dw UseOnWhichPKMNString
+ dw ChooseAMonString ; Probably used to be ChooseAFemalePKMNString
+ dw ChooseAMonString ; Probably used to be ChooseAMalePKMNString
+ dw ToWhichPKMNString
ChooseAMonString: ; 0x504e4
- db "Choose a #MON.@"
+ db "Choose a #MON.@"
UseOnWhichPKMNString: ; 0x504f3
- db "Use on which ", $e1, $e2, "?@"
+ db "Use on which ", $e1, $e2, "?@"
WhichPKMNString: ; 0x50504
- db "Which ", $e1, $e2, "?@"
+ db "Which ", $e1, $e2, "?@"
TeachWhichPKMNString: ; 0x5050e
- db "Teach which ", $e1, $e2, "?@"
+ db "Teach which ", $e1, $e2, "?@"
MoveToWhereString: ; 0x5051e
- db "Move to where?@"
+ db "Move to where?@"
ChooseAFemalePKMNString: ; 0x5052d ; UNUSED
- db "Choose a ♀", $e1, $e2, ".@"
+ db "Choose a ♀", $e1, $e2, ".@"
ChooseAMalePKMNString: ; 0x5053b ; UNUSED
- db "Choose a ♂", $e1, $e2, ".@"
+ db "Choose a ♂", $e1, $e2, ".@"
ToWhichPKMNString: ; 0x50549
- db "To which ", $e1, $e2, "?@"
+ db "To which ", $e1, $e2, "?@"
YouHaveNoPKMNString: ; 0x50556
- db "You have no ", $e1, $e2, "!@"
+ db "You have no ", $e1, $e2, "!@"
Function50566: ; 50566
@@ -51667,7 +56924,7 @@
ld a, [CurPartyMon]
ld e, a
ld d, 0
- ld hl, CurFruit
+ ld hl, $d03f
add hl, de
ld [hl], c
ld a, [EngineBuffer1]
@@ -51761,7 +57018,7 @@
Function5067b: ; 5067b
xor a
ld [CurPartyMon], a
- ld de, CurFruit
+ ld de, $d03f
.asm_50682
push de
ld a, [de]
@@ -52644,9 +57901,65 @@
ret
; 50d5b
-INCBIN "baserom.gbc", $50d5b, $50e1b - $50d5b
+INCBIN "baserom.gbc", $50d5b, $50db9 - $50d5b
+Function50db9: ; 50db9
+ ld a, [$d263]
+ cp $1
+ jr nz, .asm_50dca
+ ld hl, OTPartyCount
+ ld de, OTPartyMon1OT
+ ld a, $6
+ jr .asm_50dfc
+.asm_50dca
+ cp $4
+ jr nz, .asm_50dd8
+ ld hl, PartyCount
+ ld de, PartyMon1OT
+ ld a, $5
+ jr .asm_50dfc
+
+.asm_50dd8
+ cp $5
+ jr nz, .asm_50de6
+ ld hl, CurMart
+ ld de, PokemonNames
+ ld a, $1
+ jr .asm_50dfc
+
+.asm_50de6
+ cp $2
+ jr nz, .asm_50df4
+ ld hl, NumItems
+ ld de, Function50000
+ ld a, $4
+ jr .asm_50dfc
+
+.asm_50df4
+ ld hl, CurMart
+ ld de, Function50000
+ ld a, $4
+
+.asm_50dfc
+ ld [$cf61], a
+ ld a, l
+ ld [LYOverrides], a
+ ld a, h
+ ld [$d101], a
+ ld a, e
+ ld [$d102], a
+ ld a, d
+ ld [$d103], a
+ ld bc, $67c1
+ ld a, c
+ ld [$d104], a
+ ld a, b
+ ld [$d105], a
+ ret
+; 50e1b
+
+
Function50e1b: ; 50e1b
ld a, [TempMonSpecies]
ld [CurSpecies], a
@@ -52946,8 +58259,121 @@
; 5127c
-INCBIN "baserom.gbc", $5127c, $51424 - $5127c
+INCBIN "baserom.gbc", $5127c, $51322 - $5127c
+Function51322: ; 51322
+ ld a, $1
+ call GetSRAMBank
+ ld hl, BoxCount
+ call Function513cb
+ ld a, [BoxCount]
+ dec a
+ ld [$d265], a
+ ld hl, BoxMon1Nickname
+ ld bc, $000b
+ ld de, DefaultFlypoint
+ call Function513e0
+ ld a, [BoxCount]
+ dec a
+ ld [$d265], a
+ ld hl, BoxMon1OT
+ ld bc, $000b
+ ld de, $d00d
+ call Function513e0
+ ld a, [BoxCount]
+ dec a
+ ld [$d265], a
+ ld hl, BoxMon1Species
+ ld bc, $0020
+ ld de, $d018
+ call Function513e0
+ ld hl, $d01a
+ ld de, TempMonMove1
+ ld bc, $0004
+ call CopyBytes
+ ld hl, $d02f
+ ld de, TempMonPP
+ ld bc, $0004
+ call CopyBytes
+ ld a, [CurPartyMon]
+ ld b, a
+ callba Functiondcb6
+ jp CloseSRAM
+; 5138b
+
+INCBIN "baserom.gbc", $5138b, $513cb - $5138b
+
+Function513cb: ; 513cb
+ inc [hl]
+ inc hl
+ ld a, [CurPartyMon]
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [CurPartySpecies]
+ ld c, a
+.asm_513d8
+ ld a, [hl]
+ ld [hl], c
+ inc hl
+ inc c
+ ld c, a
+ jr nz, .asm_513d8
+ ret
+; 513e0
+
+Function513e0: ; 513e0
+ push de
+ push hl
+ push bc
+ ld a, [$d265]
+ dec a
+ call AddNTimes
+ push hl
+ add hl, bc
+ ld d, h
+ ld e, l
+ pop hl
+.asm_513ef
+ push bc
+ ld a, [$d265]
+ ld b, a
+ ld a, [CurPartyMon]
+ cp b
+ pop bc
+ jr z, .asm_51415
+ push hl
+ push de
+ push bc
+ call CopyBytes
+ pop bc
+ pop de
+ pop hl
+ push hl
+ ld a, l
+ sub c
+ ld l, a
+ ld a, h
+ sbc b
+ ld h, a
+ pop de
+ ld a, [$d265]
+ dec a
+ ld [$d265], a
+ jr .asm_513ef
+
+.asm_51415
+ pop bc
+ pop hl
+ ld a, [CurPartyMon]
+ call AddNTimes
+ ld d, h
+ ld e, l
+ pop hl
+ call CopyBytes
+ ret
+; 51424
+
BaseData:
INCLUDE "stats/base_stats.asm"
@@ -53518,7 +58944,7 @@
jr c, .asm_801f1
call Function80341
- ld [CurFruit], a
+ ld [$d03f], a
and a
jr z, .asm_801f1
cp 2
@@ -54236,8 +59662,68 @@
ret
; 8442c
-INCBIN "baserom.gbc", $8442c, $845d4 - $8442c
+INCBIN "baserom.gbc", $8442c, $84560 - $8442c
+Function84560: ; 84560
+ ld a, [$cf65]
+ push af
+ xor a
+ ld [$ffac], a
+ call Function8474c
+ ld a, [rIE]
+ push af
+ xor a
+ ld [rIF], a
+ ld a, $9
+ ld [rIE], a
+ ld hl, $ff9e
+ ld a, [hl]
+ push af
+ ld [hl], $4
+ xor a
+ ld [hBGMapMode], a
+ call Function309d
+ callba Function16dac
+ ld a, $0
+ call Function84419
+ call Function30b4
+ call Function84742
+ ld a, $9
+ ld [$cf65], a
+.asm_84597
+ call Functiona57
+ call Function846f6
+ jr c, .asm_845c0
+ ld a, [$cf63]
+ bit 7, a
+ jr nz, .asm_845c0
+ call Function84022
+ ld a, [$cf63]
+ cp $2
+ jr nc, .asm_845b5
+ ld a, $3
+ ld [$ca81], a
+
+.asm_845b5
+ call Function84757
+ call Function84785
+ call DelayFrame
+ jr .asm_84597
+
+.asm_845c0
+ pop af
+ ld [$ff9e], a
+ call Function84411
+ call Function30b4
+ xor a
+ ld [rIF], a
+ pop af
+ ld [rIE], a
+ pop af
+ ld [$cf65], a
+ ret
+; 845d4
+
Function845d4: ; 845d4
call Function845db
call Function84425
@@ -54280,8 +59766,113 @@
ret
; 8461a
-INCBIN "baserom.gbc", $8461a, $846f6 - $8461a
+Function8461a: ; 8461a
+ ld a, [$cf65]
+ push af
+ xor a
+ ld [$ffac], a
+ call Function8474c
+ ld a, [rIE]
+ push af
+ xor a
+ ld [rIF], a
+ ld a, $9
+ ld [rIE], a
+ xor a
+ ld [hBGMapMode], a
+ callba Function1dc381
+ ld a, $10
+ call Function84419
+ ld hl, $ff9e
+ ld a, [hl]
+ push af
+ ld [hl], $4
+ ld a, $8
+ ld [$cf65], a
+ call Function84742
+ call Function843f0
+ jr c, .asm_84671
+ call Function84411
+ ld c, $c
+ call DelayFrames
+ xor a
+ ld [hBGMapMode], a
+ callba Function1dc47b
+ ld a, $3
+ call Function84419
+ ld a, $9
+ ld [$cf65], a
+ call Function84742
+ call Function843f0
+.asm_84671
+ pop af
+ ld [$ff9e], a
+ call Function84411
+ call Function84735
+ xor a
+ ld [rIF], a
+ pop af
+ ld [rIE], a
+ call Function84425
+ pop af
+ ld [$cf65], a
+ ret
+; 84688
+
+Function84688: ; 84688
+ ld a, [$cf65]
+ push af
+ callba Function1dd709
+ xor a
+ ld [$ffac], a
+ call Function8474c
+ ld a, [rIE]
+ push af
+ xor a
+ ld [rIF], a
+ ld a, $9
+ ld [rIE], a
+ ld hl, $ff9e
+ ld a, [hl]
+ push af
+ ld [hl], $4
+ ld a, $10
+ call Function84419
+ call Function84742
+ ld a, $9
+ ld [$cf65], a
+ call Function843f0
+ jr c, .asm_846e2
+ call Function84411
+ ld c, $c
+ call DelayFrames
+ call Function309d
+ xor a
+ ld [hBGMapMode], a
+ callba Function1dd7ae
+ ld a, $3
+ call Function84419
+ call Function30b4
+ call Function84742
+ ld a, $9
+ ld [$cf65], a
+ call Function843f0
+
+.asm_846e2
+ pop af
+ ld [$ff9e], a
+ call Function84411
+ xor a
+ ld [rIF], a
+ pop af
+ ld [rIE], a
+ call Function84425
+ pop af
+ ld [$cf65], a
+ ret
+; 846f6
+
Function846f6: ; 846f6
ld a, [hJoyDown]
and $2
@@ -54333,7 +59924,14 @@
ret
; 84742
-INCBIN "baserom.gbc", $84742, $8474c - $84742
+Function84742: ; 84742
+ xor a
+ ld [hJoyReleased], a
+ ld [hJoyPressed], a
+ ld [hJoyDown], a
+ ld [$ffa9], a
+ ret
+; 8474c
Function8474c: ; 8474c
ld de, $005b
@@ -55183,8 +60781,359 @@
SECTION "bank22",ROMX,BANK[$22]
-INCBIN "baserom.gbc", $88000, $88258 - $88000
+Function88000: ; 88000
+ ld hl, $4007
+ call PrintText
+ ret
+; 88007
+INCBIN "baserom.gbc", $88007, $8800c - $88007
+
+Function8800c: ; 8800c
+ ld hl, $4013
+ call PrintText
+ ret
+; 88013
+
+INCBIN "baserom.gbc", $88013, $88018 - $88013
+
+Function88018: ; 88018
+ call Function1d6e
+ ld c, $1
+ xor a
+ ld [$d0e4], a
+ ld [$dca4], a
+.asm_88024
+ push bc
+ call Function88000
+ pop bc
+ ld a, c
+ ld [MenuSelection], a
+ call Function88055
+ ld a, c
+ ld [ScriptVar], a
+ and a
+ jr z, .asm_88051
+ ld [CurItem], a
+ ld a, [$cfa9]
+ ld c, a
+ push bc
+ call Function8800c
+ call Function880c2
+ pop bc
+ jr nc, .asm_88024
+ ld a, [$d10c]
+ ld [$dca4], a
+ call Function88161
+
+.asm_88051
+ call Function1d7d
+ ret
+; 88055
+
+Function88055: ; 88055
+ callba Function24c64
+ jr c, .asm_88083
+ ld hl, $4086
+ call Function1d3c
+ ld a, [MenuSelection]
+ ld [$cf88], a
+ xor a
+ ld [hBGMapMode], a
+ call Function352f
+ call Function1ad2
+ call Function350c
+ ld a, [$cf73]
+ cp $2
+ jr z, .asm_88083
+ ld a, [MenuSelection]
+ cp $ff
+ jr nz, .asm_88084
+
+.asm_88083
+ xor a
+
+.asm_88084
+ ld c, a
+ ret
+; 88086
+
+INCBIN "baserom.gbc", $88086, $880c2 - $88086
+
+Function880c2: ; 880c2
+ ld a, [CurItem]
+ ld [MenuSelection], a
+ call Function88139
+ jr z, .asm_88109
+ ld a, [$d10c]
+ ld [$d10d], a
+ ld a, $1
+ ld [$d10c], a
+ ld hl, $410d
+ call LoadMenuDataHeader
+.asm_880de
+ xor a
+ ld [hBGMapMode], a
+ call Function1cbb
+ call Function1ad2
+ call Function88116
+ call Function88126
+ call Function321c
+ callba Function27a28
+ jr nc, .asm_880de
+ push bc
+ call PlayClickSFX
+ pop bc
+ ld a, b
+ cp $ff
+ jr z, .asm_88109
+ ld a, [$d10c]
+ ld [$d10c], a
+ scf
+
+.asm_88109
+ call Function1c17
+ ret
+; 8810d
+
+INCBIN "baserom.gbc", $8810d, $88116 - $8810d
+
+Function88116: ; 88116
+ call Function1cfd
+ ld de, $0015
+ add hl, de
+ ld d, h
+ ld e, l
+ callba Function24ab4
+ ret
+; 88126
+
+Function88126: ; 88126
+ call Function1cfd
+ ld de, $0032
+ add hl, de
+ ld [hl], $f1
+ inc hl
+ ld de, $d10c
+ ld bc, $8102
+ jp PrintNum
+; 88139
+
+Function88139: ; 88139
+ push bc
+ ld hl, NumItems
+ ld a, [CurItem]
+ ld c, a
+ ld b, $0
+.asm_88143
+ inc hl
+ ld a, [hli]
+ cp $ff
+ jr z, .asm_88153
+ cp c
+ jr nz, .asm_88143
+ ld a, [hl]
+ add b
+ ld b, a
+ jr nc, .asm_88143
+ ld b, $ff
+
+.asm_88153
+ ld a, b
+ sub $63
+ jr c, .asm_8815a
+ ld b, $63
+
+.asm_8815a
+ ld a, b
+ ld [$d10c], a
+ and a
+ pop bc
+ ret
+; 88161
+
+Function88161: ; 88161
+ push de
+ push bc
+ ld hl, NumItems
+ ld a, [CurItem]
+ ld c, a
+ ld e, $0
+ xor a
+ ld [$d107], a
+ ld a, $ff
+ ld [DefaultFlypoint], a
+.asm_88175
+ ld a, [$d107]
+ inc a
+ ld [$d107], a
+ inc hl
+ ld a, [hli]
+ cp $ff
+ jr z, .asm_88198
+ cp c
+ jr nz, .asm_88175
+ ld d, $0
+ push hl
+ ld hl, DefaultFlypoint
+ add hl, de
+ inc e
+ ld a, [$d107]
+ dec a
+ ld [hli], a
+ ld a, $ff
+ ld [hl], a
+ pop hl
+ jr .asm_88175
+
+.asm_88198
+ ld a, e
+ and a
+ jr z, .asm_881fa
+ dec a
+ jr z, .asm_881d0
+ ld hl, DefaultFlypoint
+.asm_881a2
+ ld a, [hl]
+ ld c, a
+ push hl
+.asm_881a5
+ inc hl
+ ld a, [hl]
+ cp $ff
+ jr z, .asm_881c9
+ ld b, a
+ ld a, c
+ call Function88201
+ ld e, a
+ ld a, b
+ call Function88201
+ sub e
+ jr z, .asm_881bc
+ jr c, .asm_881c0
+ jr .asm_881a5
+
+.asm_881bc
+ ld a, c
+ sub b
+ jr nc, .asm_881a5
+
+.asm_881c0
+ ld a, c
+ ld c, b
+ ld [hl], a
+ ld a, c
+ pop hl
+ ld [hl], a
+ push hl
+ jr .asm_881a5
+
+.asm_881c9
+ pop hl
+ inc hl
+ ld a, [hl]
+ cp $ff
+ jr nz, .asm_881a2
+
+.asm_881d0
+ ld hl, DefaultFlypoint
+.asm_881d3
+ ld a, [hl]
+ cp $ff
+ jr z, .asm_881fa
+ push hl
+ ld [$d107], a
+ call Function88211
+ pop hl
+ ld a, [$d10c]
+ and a
+ jr z, .asm_881fa
+ push hl
+ ld a, [hli]
+ ld c, a
+.asm_881e9
+ ld a, [hli]
+ cp $ff
+ jr z, .asm_881f6
+ cp c
+ jr c, .asm_881e9
+ dec a
+ dec hl
+ ld [hli], a
+ jr .asm_881e9
+
+.asm_881f6
+ pop hl
+ inc hl
+ jr .asm_881d3
+
+.asm_881fa
+ ld a, [$d10c]
+ and a
+ pop bc
+ pop de
+ ret
+; 88201
+
+Function88201: ; 88201
+ push hl
+ push bc
+ ld hl, NumItems
+ inc hl
+ ld c, a
+ ld b, $0
+ add hl, bc
+ add hl, bc
+ inc hl
+ ld a, [hl]
+ pop bc
+ pop hl
+ ret
+; 88211
+
+Function88211: ; 88211
+ push bc
+ ld hl, NumItems
+ ld a, [$d107]
+ ld c, a
+ ld b, $0
+ inc hl
+ add hl, bc
+ add hl, bc
+ ld a, [CurItem]
+ ld c, a
+ ld a, [hli]
+ cp $ff
+ jr z, .asm_88243
+ cp c
+ jr nz, .asm_88243
+ ld a, [$d10c]
+ ld c, a
+ ld a, [hl]
+ sub c
+ ld b, c
+ jr nc, .asm_88235
+ add c
+ ld b, a
+
+.asm_88235
+ push bc
+ ld hl, NumItems
+ ld a, b
+ ld [$d10c], a
+ call Function2f53
+ pop bc
+ ld a, c
+ sub b
+
+.asm_88243
+ ld [$d10c], a
+ pop bc
+ ret
+; 88248
+
+INCBIN "baserom.gbc", $88248, $88258 - $88248
+
MovePlayerPicRight: ; 88258
hlcoord 6, 4
ld de, 1
@@ -55421,8 +61370,713 @@
KrisBackpic: ; 88ed6
-INCBIN "baserom.gbc", $88ed6, $896ff - $88ed6
+INCBIN "baserom.gbc", $88ed6, $89160 - $88ed6
+Function89160: ; 89160
+ push af
+ ld a, $4
+ call GetSRAMBank
+ pop af
+ ret
+; 89168
+
+INCBIN "baserom.gbc", $89168, $89193 - $89168
+
+Function89193: ; 89193
+ push de
+ push hl
+.asm_89195
+ ld a, [hli]
+ ld [de], a
+ inc de
+ dec c
+ jr nz, .asm_89195
+ pop hl
+ pop de
+ ret
+; 8919e
+
+INCBIN "baserom.gbc", $8919e, $891ab - $8919e
+
+Function891ab: ; 891ab
+ call Function89240
+ callba Function104061
+ call Function8923c
+ ret
+; 891b8
+
+Function891b8: ; 891b8
+ call Function8923c
+ ld hl, TileMap
+ ld a, $7f
+ ld bc, $0168
+ call ByteFill
+ call DelayFrame
+ ret
+; 891ca
+
+INCBIN "baserom.gbc", $891ca, $891de - $891ca
+
+Function891de: ; 891de
+ call Function8923c
+ call ClearPalettes
+ ld hl, AttrMap
+ ld a, $7
+ ld bc, $0168
+ call ByteFill
+ ld hl, TileMap
+ ld a, $7f
+ ld bc, $0168
+ call ByteFill
+ call Function891ab
+ ret
+; 891fe
+
+Function891fe: ; 891fe
+ push bc
+ call Function891de
+ ld c, $10
+ call DelayFrames
+ pop bc
+ ret
+; 89209
+
+Function89209: ; 89209
+ ld a, $1
+ ld [$c2ce], a
+ ret
+; 8920f
+
+Function8920f: ; 8920f
+ ld a, $0
+ ld [$c2ce], a
+ ret
+; 89215
+
+Function89215: ; 89215
+ push hl
+ push bc
+ ld bc, $0939
+ add hl, bc
+ ld [hl], a
+ pop bc
+ pop hl
+ ret
+; 8921f
+
+INCBIN "baserom.gbc", $8921f, $8923c - $8921f
+
+Function8923c: ; 8923c
+ xor a
+ ld [hBGMapMode], a
+ ret
+; 89240
+
+Function89240: ; 89240
+ ld a, $1
+ ld [hBGMapMode], a
+ ret
+; 89245
+
+INCBIN "baserom.gbc", $89245, $89259 - $89245
+
+Function89259: ; 89259
+ ld bc, $0e07
+ jr Function89261
+
+Function8925e: ; 8925e
+ ld bc, $0e0c
+
+Function89261: ; 89261
+ push af
+ push bc
+ ld hl, $52a3
+ call Function1d3c
+ pop bc
+ ld hl, $cf82
+ ld a, c
+ ld [hli], a
+ ld a, b
+ ld [hli], a
+ ld a, c
+ add $4
+ ld [hli], a
+ ld a, b
+ add $5
+ ld [hl], a
+ pop af
+ ld [$cf88], a
+ call Function1c00
+ call Function8923c
+ call Function89209
+ call Function1d81
+ push af
+ ld c, $a
+ call DelayFrames
+ call Function1c17
+ call Function8920f
+ pop af
+ jr c, .asm_892a1
+ ld a, [$cfa9]
+ cp $2
+ jr z, .asm_892a1
+ and a
+ ret
+
+.asm_892a1
+ scf
+ ret
+; 892a3
+
+INCBIN "baserom.gbc", $892a3, $892b7 - $892a3
+
+Function892b7: ; 892b7
+ ld d, b
+ ld e, c
+ ld hl, $0000
+ add hl, bc
+ ld a, $50
+ ld bc, $0006
+ call ByteFill
+ ld b, d
+ ld c, e
+ ld hl, $0006
+ add hl, bc
+ ld a, $50
+ ld bc, $0006
+ call ByteFill
+ ld b, d
+ ld c, e
+ ld hl, $000c
+ add hl, bc
+ xor a
+ ld [hli], a
+ ld [hl], a
+ ld hl, $000e
+ add hl, bc
+ ld [hli], a
+ ld [hl], a
+ ld hl, $0010
+ add hl, bc
+ ld [hl], a
+ ld hl, $0011
+ add hl, bc
+ ld a, $ff
+ ld bc, $0008
+ call ByteFill
+ ld b, d
+ ld c, e
+ ld e, $6
+ ld hl, $0019
+ add hl, bc
+.asm_892fb
+ ld a, $ff
+ ld [hli], a
+ ld a, $ff
+ ld [hli], a
+ dec e
+ jr nz, .asm_892fb
+ ret
+; 89305
+
+INCBIN "baserom.gbc", $89305, $8931b - $89305
+
+Function8931b: ; 8931b
+ push hl
+ ld hl, $a03b
+ ld a, [MenuSelection]
+ dec a
+ ld bc, $0025
+ call AddNTimes
+ ld b, h
+ ld c, l
+ pop hl
+ ret
+; 8932d
+
+Function8932d: ; 8932d
+ ld hl, $0000
+ add hl, bc
+
+Function89331: ; 89331
+ push bc
+ ld c, $5
+.asm_89334
+ ld a, [hli]
+ cp $50
+ jr z, .asm_89340
+ cp $7f
+ jr nz, .asm_89343
+ dec c
+ jr nz, .asm_89334
+
+.asm_89340
+ scf
+ jr .asm_89344
+
+.asm_89343
+ and a
+
+.asm_89344
+ pop bc
+ ret
+; 89346
+
+INCBIN "baserom.gbc", $89346, $8934a - $89346
+
+Function8934a: ; 8934a
+ ld hl, $0006
+ add hl, bc
+ push bc
+ ld c, $5
+.asm_89351
+ ld a, [hli]
+ cp $50
+ jr z, .asm_8935d
+ cp $7f
+ jr nz, .asm_89360
+ dec c
+ jr nz, .asm_89351
+
+.asm_8935d
+ scf
+ jr .asm_89361
+
+.asm_89360
+ and a
+
+.asm_89361
+ pop bc
+ ret
+; 89363
+
+Function89363: ; 89363
+ ld h, b
+ ld l, c
+ jr .asm_8936b
+
+ ld hl, $0019
+ add hl, bc
+
+.asm_8936b
+ push de
+ ld e, $6
+.asm_8936e
+ ld a, [hli]
+ cp $ff
+ jr nz, .asm_8937e
+ ld a, [hli]
+ cp $ff
+ jr nz, .asm_8937e
+ dec e
+ jr nz, .asm_8936e
+ scf
+ jr .asm_8937f
+
+.asm_8937e
+ and a
+
+.asm_8937f
+ pop de
+ ret
+; 89381
+
+Function89381: ; 89381
+ push bc
+ push de
+ call Function89b45
+ jr c, .asm_89392
+ push hl
+ ld a, $ff
+ ld bc, $0008
+ call ByteFill
+ pop hl
+
+.asm_89392
+ pop de
+ ld c, $8
+ call Function89193
+ pop bc
+ ret
+; 8939a
+
+Function8939a: ; 8939a
+ push bc
+ ld hl, $0000
+ add hl, bc
+ ld de, DefaultFlypoint
+ ld c, $6
+ call Function89193
+ pop bc
+ ld hl, $0011
+ add hl, bc
+ ld de, $d008
+ call Function89381
+ ret
+; 893b3
+
+INCBIN "baserom.gbc", $893b3, $893cc - $893b3
+
+Function893cc: ; 893cc
+ call DisableLCD
+ call ClearSprites
+ call Functione51
+ call Functione5f
+ call Function893ef
+ call Function89464
+ call EnableLCD
+ ret
+; 893e2
+
+INCBIN "baserom.gbc", $893e2, $893ef - $893e2
+
+Function893ef: ; 893ef
+ ld de, VTiles0
+ ld hl, $540b
+ ld bc, $0020
+ ld a, $22
+ call FarCopyBytes
+ ret
+; 893fe
+
+INCBIN "baserom.gbc", $893fe, $89464 - $893fe
+
+Function89464: ; 89464
+ ld hl, $59ef
+ ld de, VTiles2
+ ld bc, $0200
+ ld a, $5e
+ call FarCopyBytes
+ ld hl, $604f
+ ld de, $9200
+ ld bc, $0170
+ ld a, $5e
+ call FarCopyBytes
+ ret
+; 89481
+
+Function89481: ; 89481
+ ld d, $2
+ call Function8934a
+ ret c
+ ld d, $0
+ ld hl, $0010
+ add hl, bc
+ bit 0, [hl]
+ ret z
+ inc d
+ ret
+; 89492
+
+INCBIN "baserom.gbc", $89492, $8949c - $89492
+
+Function8949c: ; 8949c
+ ld a, [rSVBK]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ ld hl, $54b3
+ ld de, $d038
+ ld bc, $0008
+ call CopyBytes
+ pop af
+ ld [rSVBK], a
+ ret
+; 894b3
+
+INCBIN "baserom.gbc", $894b3, $894bb - $894b3
+
+Function894bb: ; 894bb
+ call Function894dc
+ push bc
+ call Function8956f
+ call Function8949c
+ call Function8a60d
+ pop bc
+ ret
+; 894ca
+
+INCBIN "baserom.gbc", $894ca, $894dc - $894ca
+
+Function894dc: ; 894dc
+ push bc
+ ld a, [rSVBK]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ ld c, d
+ ld b, $0
+ ld hl, $5509
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld de, Unkn1Pals
+ ld bc, $0018
+ call CopyBytes
+ ld hl, $5557
+ ld de, $d018
+ ld bc, $0018
+ call CopyBytes
+ pop af
+ ld [rSVBK], a
+ pop bc
+ ret
+; 89509
+
+INCBIN "baserom.gbc", $89509, $8956f - $89509
+
+Function8956f: ; 8956f
+ push bc
+ ld hl, $0010
+ add hl, bc
+ ld d, h
+ ld e, l
+ ld hl, $000c
+ add hl, bc
+ ld b, h
+ ld c, l
+ callba Function4e929
+ ld a, c
+ ld [TrainerClass], a
+ ld a, [rSVBK]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ ld hl, $d030
+ ld a, $ff
+ ld [hli], a
+ ld a, $7f
+ ld [hl], a
+ pop af
+ ld [rSVBK], a
+ ld a, [TrainerClass]
+ ld h, $0
+ ld l, a
+ add hl, hl
+ add hl, hl
+ ld de, $70ce
+ add hl, de
+ ld a, [rSVBK]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ ld de, $d032
+ ld c, $4
+.asm_895b1
+ ld a, $2
+ call GetFarByte
+ ld [de], a
+ inc de
+ inc hl
+ dec c
+ jr nz, .asm_895b1
+ ld hl, $d036
+ xor a
+ ld [hli], a
+ ld [hl], a
+ pop af
+ ld [rSVBK], a
+ pop bc
+ ret
+; 895c7
+
+INCBIN "baserom.gbc", $895c7, $895f2 - $895c7
+
+Function895f2: ; 895f2
+ push bc
+ xor a
+ ld hl, AttrMap
+ ld bc, $0168
+ call ByteFill
+ call Function89605
+ call Function89655
+ pop bc
+ ret
+; 89605
+
+Function89605: ; 89605
+ ld hl, $ce14
+ ld a, $1
+ ld de, $0014
+ ld c, $e
+.asm_8960f
+ ld [hl], a
+ dec c
+ jr z, .asm_8961b
+ add hl, de
+ inc a
+ ld [hl], a
+ dec a
+ add hl, de
+ dec c
+ jr nz, .asm_8960f
+
+.asm_8961b
+ ld hl, $cf19
+ ld c, $a
+ ld a, $2
+.asm_89622
+ ld [hli], a
+ dec a
+ ld [hli], a
+ inc a
+ dec c
+ jr nz, .asm_89622
+ ld hl, $ceb6
+ ld a, $4
+ ld bc, $0004
+ call ByteFill
+ ld a, $5
+ ld bc, $000e
+ call ByteFill
+ ret
+; 8963d
+
+Function8963d: ; 8963d
+ ld hl, $ce21
+ ld a, $6
+ ld de, $0014
+ ld bc, $0707
+.asm_89648
+ push hl
+ ld c, $7
+.asm_8964b
+ ld [hli], a
+ dec c
+ jr nz, .asm_8964b
+ pop hl
+ add hl, de
+ dec b
+ jr nz, .asm_89648
+ ret
+; 89655
+
+Function89655: ; 89655
+ ld hl, $ceca
+ ld de, $0014
+ ld a, $5
+ ld b, $4
+.asm_8965f
+ ld c, $12
+ push hl
+.asm_89662
+ ld [hli], a
+ dec c
+ jr nz, .asm_89662
+ pop hl
+ add hl, de
+ dec b
+ jr nz, .asm_8965f
+ ret
+; 8966c
+
+Function8966c: ; 8966c
+ push bc
+ call Function89688
+ ld hl, $c4a4
+ ld c, $8
+ call Function896f5
+ pop bc
+ ret
+; 8967a
+
+INCBIN "baserom.gbc", $8967a, $89688 - $8967a
+
+Function89688: ; 89688
+ ld hl, TileMap
+ ld a, $1
+ ld e, $14
+ call Function896e1
+ ld a, $2
+ ld e, $14
+ call Function896eb
+ ld a, $3
+ ld [hli], a
+ ld a, $4
+ ld e, $12
+ call Function896e1
+ ld a, $6
+ ld [hli], a
+ push bc
+ ld c, $d
+.asm_896a9
+ call Function896cb
+ dec c
+ jr z, .asm_896b5
+ call Function896d6
+ dec c
+ jr nz, .asm_896a9
+
+.asm_896b5
+ pop bc
+ ld a, $19
+ ld [hli], a
+ ld a, $1a
+ ld e, $12
+ call Function896e1
+ ld a, $1c
+ ld [hli], a
+ ld a, $2
+ ld e, $14
+ call Function896eb
+ ret
+; 896cb
+
+Function896cb: ; 896cb
+ ld de, $0013
+ ld a, $7
+ ld [hl], a
+ add hl, de
+ ld a, $9
+ ld [hli], a
+ ret
+; 896d6
+
+Function896d6: ; 896d6
+ ld de, $0013
+ ld a, $a
+ ld [hl], a
+ add hl, de
+ ld a, $b
+ ld [hli], a
+ ret
+; 896e1
+
+Function896e1: ; 896e1
+.asm_896e1
+ ld [hli], a
+ inc a
+ dec e
+ ret z
+ ld [hli], a
+ dec a
+ dec e
+ jr nz, .asm_896e1
+ ret
+; 896eb
+
+Function896eb: ; 896eb
+.asm_896eb
+ ld [hli], a
+ dec a
+ dec e
+ ret z
+ ld [hli], a
+ inc a
+ dec e
+ jr nz, .asm_896eb
+ ret
+; 896f5
+
+Function896f5: ; 896f5
+ call Function8971f
+ call Function89736
+ inc hl
+ inc hl
+ ld b, 2
+
ClearScreenArea: ; 0x896ff
; clears an area of the screen
; INPUT:
@@ -55460,8 +62114,828 @@
ret
; 0x8971f
-INCBIN "baserom.gbc", $8971f, $8addb - $8971f
+Function8971f: ; 8971f
+ ld a, $2c
+ ld [hli], a
+ ld a, $2d
+ ld [hld], a
+ push hl
+ ld de, $0014
+ add hl, de
+ ld a, $31
+ ld [hli], a
+ ld a, $32
+ ld [hld], a
+ add hl, de
+ ld a, $35
+ ld [hl], a
+ pop hl
+ ret
+; 89736
+Function89736: ; 89736
+ push hl
+ inc hl
+ inc hl
+ ld e, c
+ ld d, $0
+ add hl, de
+ ld a, $2f
+ ld [hli], a
+ ld a, $30
+ ld [hld], a
+ ld de, $0014
+ add hl, de
+ ld a, $33
+ ld [hli], a
+ ld a, $34
+ ld [hl], a
+ add hl, de
+ ld a, $1f
+ ld [hl], a
+ pop hl
+ ret
+; 89753
+
+Function89753: ; 89753
+ ld a, $c
+ ld [hl], a
+ xor a
+ call Function89215
+ ret
+; 8975b
+
+Function8975b: ; 8975b
+ ld a, $1d
+ ld [hli], a
+ inc a
+ ld [hli], a
+ ld a, $d
+ ld [hl], a
+ dec hl
+ dec hl
+ ld a, $4
+ ld e, $3
+.asm_89769
+ call Function89215
+ inc hl
+ dec e
+ jr nz, .asm_89769
+ ret
+; 89771
+
+Function89771: ; 89771
+ ld a, $12
+ ld [hl], a
+ ld a, $3
+ call Function89215
+ ret
+; 8977a
+
+Function8977a: ; 8977a
+ ld e, $4
+ ld d, $13
+.asm_8977e
+ ld a, d
+ ld [hl], a
+ ld a, $4
+ call Function89215
+ inc hl
+ inc d
+ dec e
+ jr nz, .asm_8977e
+ ld e, $e
+.asm_8978c
+ ld a, d
+ ld [hl], a
+ xor a
+ call Function89215
+ inc hl
+ dec e
+ jr nz, .asm_8978c
+ ret
+; 89797
+
+Function89797: ; 89797
+ push bc
+ ld a, $e
+ ld [hl], a
+ ld bc, $0014
+ add hl, bc
+ ld a, $11
+ ld [hli], a
+ ld a, $10
+ ld c, $8
+.asm_897a6
+ ld [hli], a
+ dec c
+ jr nz, .asm_897a6
+ ld a, $f
+ ld [hl], a
+ pop bc
+ ret
+; 897af
+
+Function897af: ; 897af
+ push bc
+ ld hl, $0010
+ add hl, bc
+ ld d, h
+ ld e, l
+ ld hl, $000c
+ add hl, bc
+ ld b, h
+ ld c, l
+ callba Function4e929
+ ld a, c
+ ld [TrainerClass], a
+ xor a
+ ld [CurPartySpecies], a
+ ld de, $9370
+ callba Function5120d
+ pop bc
+ ret
+; 897d5
+
+Function897d5: ; 897d5
+ push bc
+ call Function8934a
+ jr nc, .asm_897f3
+ ld hl, $ce21
+ xor a
+ ld de, $0014
+ ld bc, $0707
+.asm_897e5
+ push hl
+ ld c, $7
+.asm_897e8
+ ld [hli], a
+ dec c
+ jr nz, .asm_897e8
+ pop hl
+ add hl, de
+ dec b
+ jr nz, .asm_897e5
+ pop bc
+ ret
+
+.asm_897f3
+ ld a, $37
+ ld [$ffad], a
+ ld hl, $c4e8
+ ld bc, $0707
+ ld a, $13
+ call Predef
+ call Function8963d
+ pop bc
+ ret
+; 89807
+
+INCBIN "baserom.gbc", $89807, $89844 - $89807
+
+Function89844: ; 89844
+ call Function89481
+ call Function894bb
+ call Function897af
+ push bc
+ call Function3200
+ call Function32f9
+ pop bc
+ ret
+; 89856
+
+Function89856: ; 89856
+ push bc
+ call Function891b8
+ pop bc
+ call Function895f2
+ call Function8966c
+ call Function899d3
+ call Function898aa
+ call Function898be
+ call Function898dc
+ call Function898f3
+ push bc
+ ld bc, $d008
+ ld hl, $c56a
+ call Function89975
+ pop bc
+ call Function897d5
+ ret
+; 8987f
+
+INCBIN "baserom.gbc", $8987f, $898aa - $8987f
+
+Function898aa: ; 898aa
+ ld a, [MenuSelection]
+ and a
+ ret z
+ push bc
+ ld hl, $c4ba
+ ld de, MenuSelection
+ ld bc, $8102
+ call PrintNum
+ pop bc
+ ret
+; 898be
+
+Function898be: ; 898be
+ push bc
+ ld de, DefaultFlypoint
+ ld hl, DefaultFlypoint
+ call Function89331
+ jr nc, .asm_898cd
+ ld de, $5116
+
+.asm_898cd
+ ld hl, $c4bd
+ ld a, [MenuSelection]
+ and a
+ jr nz, .asm_898d7
+ dec hl
+
+.asm_898d7
+ call PlaceString
+ pop bc
+ ret
+; 898dc
+
+Function898dc: ; 898dc
+ ld hl, $0006
+ add hl, bc
+ push bc
+ ld d, h
+ ld e, l
+ call Function8934a
+ jr nc, .asm_898eb
+ ld de, $5116
+
+.asm_898eb
+ ld hl, $c4f6
+ call PlaceString
+ pop bc
+ ret
+; 898f3
+
+Function898f3: ; 898f3
+ push bc
+ ld hl, $000c
+ add hl, bc
+ ld d, h
+ ld e, l
+ call Function8934a
+ jr c, .asm_8990a
+ ld hl, $c509
+ ld bc, $8205
+ call PrintNum
+ jr .asm_89913
+
+.asm_8990a
+ ld hl, $c509
+ ld de, $5116
+ call PlaceString
+
+.asm_89913
+ pop bc
+ ret
+; 89915
+
+Function89915: ; 89915
+ push bc
+ push hl
+ ld de, $5942
+ ld c, $8
+.asm_8991c
+ ld a, [de]
+ ld [hl], a
+ ld a, $4
+ call Function89215
+ inc hl
+ inc de
+ dec c
+ jr nz, .asm_8991c
+ pop hl
+ ld b, $4
+ ld c, $2b
+ ld a, $8
+ ld de, $594a
+.asm_89932
+ push af
+ ld a, [de]
+ cp [hl]
+ jr nz, .asm_8993b
+ call Function8994e
+ inc de
+
+.asm_8993b
+ inc hl
+ pop af
+ dec a
+ jr nz, .asm_89932
+ pop bc
+ ret
+; 89942
+
+INCBIN "baserom.gbc", $89942, $8994e - $89942
+
+Function8994e: ; 8994e
+ push hl
+ push de
+ ld de, $0014
+ ld a, l
+ sub e
+ ld l, a
+ ld a, h
+ sbc d
+ ld h, a
+ ld a, c
+ ld [hl], a
+ ld a, b
+ call Function89215
+ pop de
+ pop hl
+ ret
+; 89962
+
+Function89962: ; 89962
+ push bc
+ ld c, $4
+ ld b, $20
+.asm_89967
+ ld a, b
+ ld [hl], a
+ ld a, $4
+ call Function89215
+ inc hl
+ inc b
+ dec c
+ jr nz, .asm_89967
+ pop bc
+ ret
+; 89975
+
+Function89975: ; 89975
+ push bc
+ ld e, $8
+.asm_89978
+ ld a, [bc]
+ ld d, a
+ call Function8998b
+ swap d
+ inc hl
+ ld a, d
+ call Function8998b
+ inc bc
+ inc hl
+ dec e
+ jr nz, .asm_89978
+ pop bc
+ ret
+; 8998b
+
+Function8998b: ; 8998b
+ push bc
+ and $f
+ cp $a
+ jr nc, .asm_89997
+ ld c, $f6
+ add c
+ jr .asm_89999
+
+.asm_89997
+ ld a, $7f
+
+.asm_89999
+ ld [hl], a
+ pop bc
+ ret
+; 8999c
+
+INCBIN "baserom.gbc", $8999c, $899d3 - $8999c
+
+Function899d3: ; 899d3
+ ld hl, $c4f1
+ call Function89753
+ ld hl, $c506
+ call Function8975b
+ ld hl, $c555
+ call Function89771
+ ld hl, $c57d
+ call Function8977a
+ ld hl, $c505
+ call Function89797
+ ld hl, $c4f2
+ call Function89962
+ ld hl, $c556
+ call Function89915
+ ret
+; 899fe
+
+Function899fe: ; 899fe
+ push bc
+ push hl
+ ld hl, $0019
+ add hl, bc
+ ld b, h
+ ld c, l
+ pop hl
+ call Function89a0c
+ pop bc
+ ret
+; 89a0c
+
+Function89a0c: ; 89a0c
+ push hl
+ call Function89363
+ pop hl
+ jr c, .asm_89a1c
+ ld d, h
+ ld e, l
+ callba Function11c08f
+ ret
+
+.asm_89a1c
+ ld de, $5153
+ call PlaceString
+ ret
+; 89a23
+
+INCBIN "baserom.gbc", $89a23, $89a57 - $89a23
+
+Function89a57: ; 89a57
+ call Function354b
+ bit 6, c
+ jr nz, .asm_89a78
+ bit 7, c
+ jr nz, .asm_89a81
+ bit 0, c
+ jr nz, .asm_89a70
+ bit 1, c
+ jr nz, .asm_89a70
+ bit 3, c
+ jr nz, .asm_89a74
+ scf
+ ret
+
+.asm_89a70
+ ld a, $1
+ and a
+ ret
+
+.asm_89a74
+ ld a, $2
+ and a
+ ret
+
+.asm_89a78
+ call Function89a9b
+ call nc, Function89a8a
+ ld a, $0
+ ret
+
+.asm_89a81
+ call Function89a93
+ call nc, Function89a8a
+ ld a, $0
+ ret
+; 89a8a
+
+Function89a8a: ; 89a8a
+ push af
+ ld de, $0062
+ call StartSFX
+ pop af
+ ret
+; 89a93
+
+Function89a93: ; 89a93
+ ld d, $28
+ ld e, $1
+ call Function89aa3
+ ret
+; 89a9b
+
+Function89a9b: ; 89a9b
+ ld d, $1
+ ld e, $ff
+ call Function89aa3
+ ret
+; 89aa3
+
+Function89aa3: ; 89aa3
+ ld a, [MenuSelection]
+ ld c, a
+ push bc
+.asm_89aa8
+ ld a, [MenuSelection]
+ cp d
+ jr z, .asm_89ac0
+ add e
+ jr nz, .asm_89ab2
+ inc a
+
+.asm_89ab2
+ ld [MenuSelection], a
+ call Function89ac7
+ jr nc, .asm_89aa8
+ call Function89ae6
+ pop bc
+ and a
+ ret
+
+.asm_89ac0
+ pop bc
+ ld a, c
+ ld [MenuSelection], a
+ scf
+ ret
+; 89ac7
+
+Function89ac7: ; 89ac7
+ call Function89160
+ call Function8931b
+ call Function89ad4
+ call CloseSRAM
+ ret
+; 89ad4
+
+Function89ad4: ; 89ad4
+ push de
+ call Function8932d
+ jr c, .asm_89ae3
+ ld hl, $0011
+ add hl, bc
+ call Function89b45
+ jr c, .asm_89ae4
+
+.asm_89ae3
+ and a
+
+.asm_89ae4
+ pop de
+ ret
+; 89ae6
+
+Function89ae6: ; 89ae6
+ ld hl, $d031
+ xor a
+ ld [hl], a
+ ld a, [MenuSelection]
+.asm_89aee
+ cp $6
+ jr c, .asm_89afc
+ sub $5
+ ld c, a
+ ld a, [hl]
+ add $5
+ ld [hl], a
+ ld a, c
+ jr .asm_89aee
+
+.asm_89afc
+ ld [$d030], a
+ ret
+; 89b00
+
+INCBIN "baserom.gbc", $89b00, $89b45 - $89b00
+
+Function89b45: ; 89b45
+ push hl
+ push bc
+ ld c, $10
+ ld e, $0
+.asm_89b4b
+ ld a, [hli]
+ ld b, a
+ and $f
+ cp $a
+ jr c, .asm_89b5a
+ ld a, c
+ cp $b
+ jr nc, .asm_89b74
+ jr .asm_89b71
+
+.asm_89b5a
+ dec c
+ swap b
+ inc e
+ ld a, b
+ and $f
+ cp $a
+ jr c, .asm_89b6c
+ ld a, c
+ cp $b
+ jr nc, .asm_89b74
+ jr .asm_89b71
+
+.asm_89b6c
+ inc e
+ dec c
+ jr nz, .asm_89b4b
+ dec e
+
+.asm_89b71
+ scf
+ jr .asm_89b75
+
+.asm_89b74
+ and a
+
+.asm_89b75
+ pop bc
+ pop hl
+ ret
+; 89b78
+
+INCBIN "baserom.gbc", $89b78, $8a60d - $89b78
+
+Function8a60d: ; 8a60d
+ ld a, [rSVBK]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ ld hl, $6624
+ ld de, Unkn2Pals
+ ld bc, $0008
+ call CopyBytes
+ pop af
+ ld [rSVBK], a
+ ret
+; 8a624
+
+INCBIN "baserom.gbc", $8a624, $8ac4e - $8a624
+
+Function8ac4e: ; 8ac4e
+ xor a
+ ld [MenuSelection], a
+ push de
+ call Function891de
+ call WhiteBGMap
+ call Function893cc
+ pop bc
+ call Function89844
+ call Function8939a
+ call Function89856
+ ld hl, $c5a5
+ call Function899fe
+ call Function891ab
+ ret
+; 8ac70
+
+Function8ac70: ; 8ac70
+ push de
+ ld a, $3
+ call Function8b94a
+
+Function8ac76: ; 8ac76
+ call Function891fe
+ call Function8b677
+
+Function8ac7c: ; 8ac7c
+ call Function8b7bd
+ jr z, .asm_8acf0
+ ld a, c
+ ld [$d02f], a
+ ld [MenuSelection], a
+ call Function89160
+ call Function8931b
+ call Function8932d
+ call CloseSRAM
+ jr nc, .asm_8acb0
+ call Function89160
+ ld hl, $0011
+ add hl, bc
+ call Function89b45
+ call CloseSRAM
+ jr nc, .asm_8accc
+ call Function89160
+ call Function892b7
+ call CloseSRAM
+ jr .asm_8accc
+
+.asm_8acb0
+ call Function8ad0b
+ jr c, Function8ac76
+ and a
+ jr nz, .asm_8accc
+ call Function89160
+ ld h, b
+ ld l, c
+ ld d, $0
+ ld e, $6
+ add hl, de
+ ld d, h
+ ld e, l
+ pop hl
+ ld c, $1f
+ call Function89193
+ jr .asm_8ace4
+
+.asm_8accc
+ pop hl
+ call Function89160
+ ld d, b
+ ld e, c
+ ld c, $6
+ call Function89193
+ ld a, $6
+ add e
+ ld e, a
+ ld a, $0
+ adc d
+ ld d, a
+ ld c, $1f
+ call Function89193
+
+.asm_8ace4
+ call CloseSRAM
+ call Functione51
+ ld a, [$d02f]
+ ld c, a
+ and a
+ ret
+
+.asm_8acf0
+ ld hl, $6d06
+ call PrintText
+ ld a, $2
+ call Function89259
+ jp c, Function8ac7c
+ call Functione51
+ pop de
+ ld c, $0
+ scf
+ ret
+; 8ad06
+
+INCBIN "baserom.gbc", $8ad06, $8ad0b - $8ad06
+
+Function8ad0b: ; 8ad0b
+.asm_8ad0b
+ ld a, [MenuSelection]
+ ld [$d02f], a
+ call Function891de
+ call WhiteBGMap
+ call Function893cc
+ call Function89160
+ call Function8931b
+ push bc
+ call Function89844
+ call Function8939a
+ call Function89856
+ ld hl, $c5a5
+ call Function899fe
+ call CloseSRAM
+ call Function891ab
+ pop bc
+.asm_8ad37
+ push bc
+ call Function89a57
+ pop bc
+ jr c, .asm_8ad37
+ and a
+ jr z, .asm_8ad0b
+ cp $2
+ jr z, .asm_8ad37
+ call Function8923c
+ push bc
+ ld hl, $c590
+ ld b, $4
+ ld c, $12
+ call TextBox
+ ld de, $6d89
+ ld hl, $c5b9
+ call PlaceString
+ ld a, $2
+ call Function8925e
+ jr c, .asm_8ad87
+ call Function8923c
+ ld hl, $c590
+ ld b, $4
+ ld c, $12
+ call TextBox
+ ld de, $6d9c
+ ld hl, $c5b9
+ call PlaceString
+ ld a, $1
+ call Function8925e
+ jr c, .asm_8ad84
+ ld a, $0
+ jr .asm_8ad86
+
+.asm_8ad84
+ ld a, $1
+
+.asm_8ad86
+ and a
+
+.asm_8ad87
+ pop bc
+ ret
+; 8ad89
+
+INCBIN "baserom.gbc", $8ad89, $8addb - $8ad89
+
SpecialHoOhChamber: ; 0x8addb
ld hl, PartySpecies
ld a, [hl]
@@ -55567,8 +63041,374 @@
ret
; 8ae68
-INCBIN "baserom.gbc", $8ae68, $8b170 - $8ae68
+Function8ae68: ; 8ae68
+ ld a, [ScriptVar]
+ ld hl, $6ed5
+ and a
+ jr z, .asm_8ae79
+ ld d, $0
+ ld e, $5
+.asm_8ae75
+ add hl, de
+ dec a
+ jr nz, .asm_8ae75
+.asm_8ae79
+ call LoadMenuDataHeader
+ xor a
+ ld [hBGMapMode], a
+ call Function1cbb
+ call Function1ad2
+ call Function321c
+ call Function1cfd
+ inc hl
+ ld d, $0
+ ld e, $14
+ add hl, de
+ add hl, de
+ ld a, [ScriptVar]
+ ld c, a
+ ld de, $6ebc
+ and a
+ jr z, .asm_8aea5
+.asm_8ae9c
+ ld a, [de]
+ inc de
+ cp $ff
+ jr nz, .asm_8ae9c
+ dec c
+ jr nz, .asm_8ae9c
+
+.asm_8aea5
+ call Function8af09
+ ld bc, $0939
+ add hl, bc
+ call Function8aee9
+ call Function3200
+ call Functiona36
+ call PlayClickSFX
+ call Function1c17
+ ret
+; 8aebc
+
+INCBIN "baserom.gbc", $8aebc, $8aee9 - $8aebc
+
+Function8aee9: ; 8aee9
+.asm_8aee9
+ ld a, [de]
+ cp $ff
+ ret z
+ cp $60
+ ld a, $d
+ jr c, .asm_8aef5
+ ld a, $5
+
+.asm_8aef5
+ call Function8aefd
+ inc hl
+ inc hl
+ inc de
+ jr .asm_8aee9
+; 8aefd
+
+Function8aefd: ; 8aefd
+ push hl
+ ld [hli], a
+ ld [hld], a
+ ld b, $0
+ ld c, $14
+ add hl, bc
+ ld [hli], a
+ ld [hl], a
+ pop hl
+ ret
+; 8af09
+
+Function8af09: ; 8af09
+ push hl
+ push de
+.asm_8af0b
+ ld a, [de]
+ cp $ff
+ jr z, .asm_8af19
+ ld c, a
+ call Function8af1c
+ inc hl
+ inc hl
+ inc de
+ jr .asm_8af0b
+
+.asm_8af19
+ pop de
+ pop hl
+ ret
+; 8af1c
+
+Function8af1c: ; 8af1c
+ push hl
+ ld a, c
+ cp $60
+ jr z, .asm_8af3b
+ cp $62
+ jr z, .asm_8af4b
+ cp $64
+ jr z, .asm_8af5b
+ ld [hli], a
+ inc a
+ ld [hld], a
+ dec a
+ ld b, $0
+ ld c, $14
+ add hl, bc
+ ld c, $10
+ add c
+ ld [hli], a
+ inc a
+ ld [hl], a
+ pop hl
+ ret
+
+.asm_8af3b
+ ld [hl], $5b
+ inc hl
+ ld [hl], $5c
+ ld bc, $0013
+ add hl, bc
+ ld [hl], $4d
+ inc hl
+ ld [hl], $5d
+ pop hl
+ ret
+
+.asm_8af4b
+ ld [hl], $4e
+ inc hl
+ ld [hl], $4f
+ ld bc, $0013
+ add hl, bc
+ ld [hl], $5e
+ inc hl
+ ld [hl], $5f
+ pop hl
+ ret
+
+.asm_8af5b
+ ld [hl], $2
+ inc hl
+ ld [hl], $3
+ ld bc, $0013
+ add hl, bc
+ ld [hl], $3
+ inc hl
+ ld [hl], $2
+ pop hl
+ ret
+; 8af6b
+
+Function8af6b: ; 8af6b
+ xor a
+ ld [$cf76], a
+ ld hl, $6fa9
+ call Function1d3c
+ ld a, [$dc4a]
+ ld c, a
+ callba Functionb8f8f
+ ld a, [$cf83]
+ add c
+ add $2
+ ld [$cf85], a
+ call Function1c00
+ call Function1e5d
+ callba Function4ae5e
+ ld b, $0
+ ld a, [MenuSelection]
+ ld c, a
+ ld a, [$dc4a]
+ and $3
+ cp c
+ jr nz, .asm_8afa4
+ ld b, $1
+
+.asm_8afa4
+ ld a, b
+ ld [ScriptVar], a
+ ret
+; 8afa9
+
+INCBIN "baserom.gbc", $8afa9, $8afd4 - $8afa9
+
+Function8afd4: ; 8afd4
+ xor a
+ ld [$d0e4], a
+ ld a, $1
+ ld [MenuSelection], a
+ call Function8b0d6
+ call Function8b090
+ ld hl, $7072
+ call PrintText
+ jr .asm_8aff1
+
+.asm_8afeb
+ ld hl, $7072
+ call Function105a
+
+.asm_8aff1
+ call DelayFrame
+ call Function1ad2
+ call Function8b097
+ call Function8b0e2
+ jr z, .asm_8b05f
+ ld [$cf75], a
+ call Function8b154
+ ld a, [hl]
+ ld [$d265], a
+ call GetItemName
+ ld hl, $7077
+ call Function105a
+ call Function1dcf
+ jr c, .asm_8afeb
+ ld a, [$cf75]
+ call Function8b154
+ inc hl
+ ld a, [hld]
+ ld c, a
+ ld a, [$dc4b]
+ cp c
+ jr c, .asm_8b047
+ ld a, [hli]
+ push hl
+ ld [CurItem], a
+ ld a, $1
+ ld [$d10c], a
+ ld hl, NumItems
+ call Function2f66
+ pop hl
+ jr nc, .asm_8b04c
+ ld a, [hl]
+ ld c, a
+ ld a, [$dc4b]
+ sub c
+ ld [$dc4b], a
+ call Function8b097
+ jr .asm_8b051
+
+.asm_8b047
+ ld hl, $7081
+ jr .asm_8b05a
+
+.asm_8b04c
+ ld hl, $7086
+ jr .asm_8b05a
+
+.asm_8b051
+ ld de, $0022
+ call StartSFX
+ ld hl, $707c
+
+.asm_8b05a
+ call Function105a
+ jr .asm_8afeb
+
+.asm_8b05f
+ call Function1c17
+ call Function1c17
+ ld hl, $708b
+ call PrintText
+ call Functiona36
+ call PlayClickSFX
+ ret
+; 8b072
+
+INCBIN "baserom.gbc", $8b072, $8b090 - $8b072
+
+Function8b090: ; 8b090
+ ld hl, $70d1
+ call LoadMenuDataHeader
+ ret
+; 8b097
+
+Function8b097: ; 8b097
+ ld de, $dc4b
+ call Function8b09e
+ ret
+; 8b09e
+
+Function8b09e: ; 8b09e
+ push de
+ xor a
+ ld [hBGMapMode], a
+ ld hl, $70d1
+ call Function1d3c
+ call Function1cbb
+ call Function1ad2
+ call Function1cfd
+ ld bc, $0015
+ add hl, bc
+ ld de, $70ca
+ call PlaceString
+ ld h, b
+ ld l, c
+ inc hl
+ ld a, $7f
+ ld [hli], a
+ ld [hld], a
+ pop de
+ ld bc, $0102
+ call PrintNum
+ ret
+; 8b0ca
+
+INCBIN "baserom.gbc", $8b0ca, $8b0d6 - $8b0ca
+
+Function8b0d6: ; 8b0d6
+ ld hl, $70dd
+ call LoadMenuDataHeader
+ ret
+; 8b0dd
+
+INCBIN "baserom.gbc", $8b0dd, $8b0e2 - $8b0dd
+
+Function8b0e2: ; 8b0e2
+ ld hl, $7113
+ call Function1d3c
+ ld a, [MenuSelection]
+ ld [$cf88], a
+ xor a
+ ld [$cf76], a
+ ld [hBGMapMode], a
+ call Function352f
+ call Function1ad2
+ call Function350c
+ ld a, [MenuSelection]
+ ld c, a
+ ld a, [$cfa9]
+ ld [MenuSelection], a
+ ld a, [$cf73]
+ cp $2
+ jr z, .asm_8b111
+ ld a, c
+ and a
+ ret nz
+
+.asm_8b111
+ xor a
+ ret
+; 8b113
+
+INCBIN "baserom.gbc", $8b113, $8b154 - $8b113
+
+Function8b154: ; 8b154
+ dec a
+ ld hl, $715e
+ ld b, $0
+ ld c, a
+ add hl, bc
+ add hl, bc
+ ret
+; 8b15e
+
+INCBIN "baserom.gbc", $8b15e, $8b170 - $8b15e
+
SpecialDratini: ; 0x8b170
; if ScriptVar is 0 or 1, change the moveset of the last Dratini in the party.
; 0: give it a special moveset with Extremespeed.
@@ -55680,9 +63520,138 @@
scf
ret
-INCBIN "baserom.gbc", $8b1e1, $8b342 - $8b1e1
+Function8b1e1: ; 8b1e1
+ ld de, $71ed
+ call Function8b25b
+ ret z
+ call Function8b231
+ scf
+ ret
+; 8b1ed
+INCBIN "baserom.gbc", $8b1ed, $8b201 - $8b1ed
+Function8b201: ; 8b201
+ ld hl, StringBuffer2
+ ld [hl], $f9
+ inc hl
+ ld [hl], $50
+ ld de, $7215
+ call Function8b25b
+ ret z
+ call Function8b231
+ scf
+ ret
+; 8b215
+
+INCBIN "baserom.gbc", $8b215, $8b231 - $8b215
+
+Function8b231: ; 8b231
+ ld hl, $7238
+ call PrintText
+ ret
+; 8b238
+
+INCBIN "baserom.gbc", $8b238, $8b25b - $8b238
+
+Function8b25b: ; 8b25b
+ ld bc, $0000
+.asm_8b25e
+ call Function8b26c
+ call c, Function8b28e
+ call Function8b276
+ jr nz, .asm_8b25e
+ ld a, b
+ and a
+ ret
+; 8b26c
+
+Function8b26c: ; 8b26c
+ push de
+ push bc
+ call Function8b27a
+ ld a, c
+ rst JumpTable
+ pop bc
+ pop de
+ ret
+; 8b276
+
+Function8b276: ; 8b276
+ inc c
+ ld a, [de]
+ cp c
+ ret
+; 8b27a
+
+Function8b27a: ; 8b27a
+ inc de
+ ld a, [de]
+ ld l, a
+ inc de
+ ld a, [de]
+ ld h, a
+ ret
+; 8b281
+
+Function8b281: ; 8b281
+ inc de
+ inc de
+ inc de
+ ld a, [de]
+ ld l, a
+ inc de
+ ld a, [de]
+ ld h, a
+ ret
+; 8b28a
+
+Function8b28a: ; 8b28a
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ret
+; 8b28e
+
+Function8b28e: ; 8b28e
+ push de
+ push bc
+ ld a, b
+ and a
+ call z, Function8b29d
+ pop bc
+ call Function8b2a9
+ ld b, $1
+ pop de
+ ret
+; 8b29d
+
+Function8b29d: ; 8b29d
+ push de
+ call Function8b281
+ call Function8b28a
+ call PrintText
+ pop de
+ ret
+; 8b2a9
+
+Function8b2a9: ; 8b2a9
+ push bc
+ call Function8b281
+ inc hl
+ inc hl
+ ld b, $0
+ add hl, bc
+ add hl, bc
+ call Function8b28a
+ call PrintText
+ pop bc
+ ret
+; 8b2bb
+
+INCBIN "baserom.gbc", $8b2bb, $8b342 - $8b2bb
+
+
Function8b342: ; 8b342
call GetSecondaryMapHeaderPointer
ld d, h
@@ -55690,7 +63659,7 @@
xor a
.asm_8b348
push af
- ld hl, $7354
+ ld hl, Table8b354
rst JumpTable
pop af
inc a
@@ -55699,9 +63668,17 @@
ret
; 8b354
-INCBIN "baserom.gbc", $8b354, $8b35b - $8b354
+Table8b354: ; 8b354
+ dw Function8b35a
+ dw Function8b35b
+ dw Function8b35c
+; 8b35a
+Function8b35a: ; 8b35a
+ ret
+; 8b35b
+
Function8b35b: ; 8b35b
ret
; 8b35c
@@ -55710,9 +63687,338 @@
ret
; 8b35d
-INCBIN "baserom.gbc", $8b35d, $8ba24 - $8b35d
+INCBIN "baserom.gbc", $8b35d, $8b677 - $8b35d
+Function8b677: ; 8b677
+ call WhiteBGMap
+ call DisableLCD
+ call Function8b690
+ call Function8b6bb
+ call Function8b6ed
+ call EnableLCD
+ call Function891ab
+ call Function32f9
+ ret
+; 8b690
+Function8b690: ; 8b690
+ ld hl, $74b9
+ ld de, VTiles2
+ ld bc, $0160
+ ld a, $5e
+ call FarCopyBytes
+ ld hl, $7609
+ ld de, $9610
+ ld bc, $0010
+ ld a, $5e
+ call FarCopyBytes
+ ld hl, $7619
+ ld de, $8ee0
+ ld bc, $0010
+ ld a, $5e
+ call FarCopyBytes
+ ret
+; 8b6bb
+
+Function8b6bb: ; 8b6bb
+ ld a, [rSVBK]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ ld hl, $76d5
+ ld de, Unkn1Pals
+ ld bc, $0018
+ call CopyBytes
+ pop af
+ ld [rSVBK], a
+ call Function8949c
+ ret
+; 8b6d5
+
+INCBIN "baserom.gbc", $8b6d5, $8b6ed - $8b6d5
+
+Function8b6ed: ; 8b6ed
+ ld hl, AttrMap
+ ld bc, $012c
+ xor a
+ call ByteFill
+ ld hl, $cef1
+ ld bc, $0050
+ ld a, $7
+ call ByteFill
+ ret
+; 8b703
+
+Function8b703: ; 8b703
+ call Function8923c
+ push hl
+ ld a, $c
+ ld [hli], a
+ inc a
+ call Function8b73e
+ inc a
+ ld [hl], a
+ pop hl
+ push hl
+ push bc
+ ld de, $0014
+ add hl, de
+.asm_8b717
+ push hl
+ ld a, $f
+ ld [hli], a
+ ld a, $7f
+ call Function8b73e
+ ld a, $11
+ ld [hl], a
+ pop hl
+ ld de, $0014
+ add hl, de
+ dec b
+ jr nz, .asm_8b717
+ call Function8b732
+ pop bc
+ pop hl
+ jr Function8b744
+; 8b732
+
+Function8b732: ; 8b732
+ ld a, $12
+ ld [hli], a
+ ld a, $13
+ call Function8b73e
+ ld a, $14
+ ld [hl], a
+ ret
+; 8b73e
+
+Function8b73e: ; 8b73e
+ ld d, c
+.asm_8b73f
+ ld [hli], a
+ dec d
+ jr nz, .asm_8b73f
+ ret
+; 8b744
+
+Function8b744: ; 8b744
+ ld de, $0939
+ add hl, de
+ inc b
+ inc b
+ inc c
+ inc c
+ xor a
+.asm_8b74d
+ push bc
+ push hl
+.asm_8b74f
+ ld [hli], a
+ dec c
+ jr nz, .asm_8b74f
+ pop hl
+ ld de, $0014
+ add hl, de
+ pop bc
+ dec b
+ jr nz, .asm_8b74d
+ ret
+; 8b75d
+
+Function8b75d: ; 8b75d
+ call Function8923c
+ ld hl, TileMap
+ ld a, $1
+ ld bc, $0014
+ call ByteFill
+ ld hl, $c4b4
+ ld a, $2
+ ld [hl], a
+ ld hl, $c4bd
+ ld c, $b
+ call Function8b788
+ ld hl, $c4b5
+ ld a, $4
+ ld e, $8
+.asm_8b780
+ ld [hli], a
+ inc a
+ dec e
+ jr nz, .asm_8b780
+ jr Function8b79e
+; 8b787
+
+Function8b787: ; 8b787
+ ret
+; 8b788
+
+Function8b788: ; 8b788
+.asm_8b788
+ ld a, $2
+ ld [hli], a
+ dec c
+ ret z
+ ld a, $1
+ ld [hli], a
+ dec c
+ ret z
+ ld a, $3
+ ld [hli], a
+ dec c
+ ret z
+ ld a, $1
+ ld [hli], a
+ dec c
+ jr nz, .asm_8b788
+ ret
+; 8b79e
+
+Function8b79e: ; 8b79e
+ ld hl, $cded
+ ld a, $1
+ ld [hli], a
+ ld hl, $cdf6
+ ld e, $b
+.asm_8b7a9
+ ld a, $2
+ ld [hli], a
+ dec e
+ ret z
+ xor a
+ ld [hli], a
+ dec e
+ ret z
+ ld a, $1
+ ld [hli], a
+ dec e
+ ret z
+ xor a
+ ld [hli], a
+ dec e
+ jr nz, .asm_8b7a9
+ ret
+; 8b7bd
+
+Function8b7bd: ; 8b7bd
+ call Function8b855
+ ld hl, $7867
+ call Function1d3c
+ ld a, [$d030]
+ ld [$cf88], a
+ ld a, [$d031]
+ ld [$d0e4], a
+ ld a, [$d032]
+ and a
+ jr z, .asm_8b7e0
+ ld a, [$cf81]
+ set 3, a
+ ld [$cf81], a
+
+.asm_8b7e0
+ ld a, [$d0e3]
+ and a
+ jr z, .asm_8b7ea
+ dec a
+ ld [$cf77], a
+
+.asm_8b7ea
+ ld hl, $c4c8
+ ld b, $b
+ ld c, $12
+ call Function8b703
+ call Function8b75d
+ call Function1ad2
+ call Function89209
+ call Function350c
+ call Function8920f
+ ld a, [$cf73]
+ cp $2
+ jr z, .asm_8b823
+ cp $20
+ jr nz, .asm_8b813
+ call Function8b832
+ jr .asm_8b7ea
+
+.asm_8b813
+ cp $10
+ jr nz, .asm_8b81c
+ call Function8b83e
+ jr .asm_8b7ea
+
+.asm_8b81c
+ ld a, [MenuSelection]
+ cp $ff
+ jr nz, .asm_8b824
+
+.asm_8b823
+ xor a
+
+.asm_8b824
+ ld c, a
+ ld a, [$cfa9]
+ ld [$d030], a
+ ld a, [$d0e4]
+ ld [$d031], a
+ ret
+; 8b832
+
+Function8b832: ; 8b832
+ ld a, [$d0e4]
+ ld hl, $cf92
+ sub [hl]
+ jr nc, Function8b84b
+ xor a
+ jr Function8b84b
+; 8b83e
+
+Function8b83e: ; 8b83e
+ ld a, [$d0e4]
+ ld hl, $cf92
+ add [hl]
+ cp $24
+ jr c, Function8b84b
+ ld a, $24
+
+Function8b84b: ; 8b84b
+ ld [$d0e4], a
+ ld a, [$cfa9]
+ ld [$cf88], a
+ ret
+; 8b855
+
+Function8b855: ; 8b855
+ ld a, $28
+ ld hl, DefaultFlypoint
+ ld [hli], a
+ ld c, $28
+ xor a
+.asm_8b85e
+ inc a
+ ld [hli], a
+ dec c
+ jr nz, .asm_8b85e
+ ld a, $ff
+ ld [hl], a
+ ret
+; 8b867
+
+INCBIN "baserom.gbc", $8b867, $8b94a - $8b867
+
+Function8b94a: ; 8b94a
+ ld [$d033], a
+ xor a
+ ld [$d0e4], a
+ ld [$d032], a
+ ld [$d0e3], a
+ ld [$d031], a
+ ld a, $1
+ ld [$d030], a
+ ret
+; 8b960
+
+INCBIN "baserom.gbc", $8b960, $8ba24 - $8b960
+
+
SECTION "bank23",ROMX,BANK[$23]
INCBIN "baserom.gbc", $8c000, $8c001 - $8c000
@@ -55790,7 +64096,7 @@
; restore bg palette 8
- ld hl, CurFruit ; last byte in Unkn1Pals
+ ld hl, $d03f ; last byte in Unkn1Pals
; save wram bank
ld a, [rSVBK]
@@ -55815,7 +64121,7 @@
ld [rSVBK], a
; update palettes
- call UpdateTimePals
+ call _UpdateTimePals
call DelayFrame
; successful change
@@ -55829,7 +64135,7 @@
; 8c070
-UpdateTimePals: ; 8c070
+_UpdateTimePals: ; 8c070
ld c, $9 ; normal
call GetTimePalFade
call DmgToCgbTimePals
@@ -55853,9 +64159,40 @@
ret
; 8c092
-INCBIN "baserom.gbc", $8c092, $8c0c1 - $8c092
+Function8c092: ; 8c092
+ call Function8c0c1
+ ld c, $9
+ call GetTimePalFade
+ ld b, $4
+.asm_8c09c
+ call DmgToCgbTimePals
+ inc hl
+ inc hl
+ inc hl
+ ld c, $7
+ call DelayFrames
+ dec b
+ jr nz, .asm_8c09c
+ ret
+; 8c0ab
+Function8c0ab: ; 8c0ab
+ ld c, $0
+ call GetTimePalFade
+ ld b, $4
+ call Function8c15e
+ ret
+; 8c0b6
+Function8c0b6: ; 8c0b6
+ ld c, $9
+ call GetTimePalFade
+ ld b, $4
+ call Function8c16d
+ ret
+; 8c0c1
+
+
Function8c0c1: ; 8c0c1
ld a, [rSVBK]
push af
@@ -56328,7 +64665,7 @@
push af
ld a, $5
ld [rSVBK], a
- ld hl, $d100
+ ld hl, LYOverrides
call Function8c6ef
ld hl, $d200
call Function8c6ef
@@ -56414,8 +64751,324 @@
jp [hl]
; 8ca1b
-INCBIN "baserom.gbc", $8ca1b, $8cf4f - $8ca1b
+INCBIN "baserom.gbc", $8ca1b, $8cc04 - $8ca1b
+Function8cc04: ; 8cc04
+ ld a, [ScriptVar]
+ and a
+ jr nz, .asm_8cc14
+ ld a, $1
+ ld bc, $4060
+ ld de, $fca0
+ jr .asm_8cc1c
+
+.asm_8cc14
+ ld a, $ff
+ ld bc, $c0a0
+ ld de, $b460
+
+.asm_8cc1c
+ ld h, a
+ ld a, [rSVBK]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ ld a, h
+ ld [$d191], a
+ ld a, c
+ ld [$d192], a
+ ld a, b
+ ld [$d193], a
+ ld a, e
+ ld [$d194], a
+ ld a, d
+ ld [$d195], a
+ ld a, [hSCX]
+ push af
+ ld a, [hSCY]
+ push af
+ call Function8ccc9
+ ld hl, $ff9e
+ ld a, [hl]
+ push af
+ ld [hl], $1
+.asm_8cc48
+ ld a, [$cf63]
+ and a
+ jr z, .asm_8cc66
+ bit 7, a
+ jr nz, .asm_8cc6b
+ callab Function8cf69
+ call Function8cdf7
+ call Function8cc99
+ call Function3b0c
+ call DelayFrame
+ jr .asm_8cc48
+
+.asm_8cc66
+ call Function8ceae
+ jr .asm_8cc48
+
+.asm_8cc6b
+ pop af
+ ld [$ff9e], a
+ call WhiteBGMap
+ xor a
+ ld [hLCDStatCustom], a
+ ld [$ffc7], a
+ ld [$ffc8], a
+ ld [hSCX], a
+ ld [Requested2bppSource], a
+ ld [$cf69], a
+ ld [Requested2bppDest], a
+ ld [$cf6b], a
+ ld [Requested2bpp], a
+ call ClearTileMap
+ pop af
+ ld [hSCY], a
+ pop af
+ ld [hSCX], a
+ xor a
+ ld [hBGMapMode], a
+ pop af
+ ld [rSVBK], a
+ ret
+; 8cc99
+
+Function8cc99: ; 8cc99
+ ld hl, $d200
+ ld c, $2f
+ ld a, [$cf64]
+ add a
+ ld [hSCX], a
+ call Function8ccc4
+ ld c, $30
+ ld a, [$cf65]
+ call Function8ccc4
+ ld c, $31
+ ld a, [$cf64]
+ add a
+ call Function8ccc4
+ ld a, [$d191]
+ ld d, a
+ ld hl, $cf64
+ ld a, [hl]
+ add d
+ add d
+ ld [hl], a
+ ret
+; 8ccc4
+
+Function8ccc4: ; 8ccc4
+.asm_8ccc4
+ ld [hli], a
+ dec c
+ jr nz, .asm_8ccc4
+ ret
+; 8ccc9
+
+Function8ccc9: ; 8ccc9
+ call WhiteBGMap
+ call ClearSprites
+ call DisableLCD
+ callab Function8cf53
+ call Function8cdc3
+ call Function8cd27
+ ld a, $90
+ ld [hWY], a
+ call EnableLCD
+ xor a
+ ld [hBGMapMode], a
+ ld [hSCX], a
+ ld [hSCY], a
+ ld a, [rSVBK]
+ push af
+ ld a, $1
+ ld [rSVBK], a
+ callba GetPlayerIcon
+ pop af
+ ld [rSVBK], a
+ ld hl, VTiles0
+ ld c, $4
+ call Request2bpp
+ ld hl, $00c0
+ add hl, de
+ ld d, h
+ ld e, l
+ ld hl, $8040
+ ld c, $4
+ call Request2bpp
+ call Function8cda6
+ ld hl, $cf63
+ xor a
+ ld [hli], a
+ ld a, [$d192]
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ ld de, $0005
+ call StartMusic2
+ ret
+; 8cd27
+
+Function8cd27: ; 8cd27
+ ld hl, VBGMap0
+ xor a
+.asm_8cd2b
+ call Function8cd74
+ ld b, $10
+ call Function8cd6c
+ inc a
+ cp $12
+ jr c, .asm_8cd2b
+ ld hl, $98c0
+ ld de, $4eff
+ ld c, $14
+ call Function8cd65
+ ld hl, $98e0
+ ld de, $4f13
+ ld c, $14
+ call Function8cd65
+ ld hl, $9900
+ ld de, $4f27
+ ld c, $14
+ call Function8cd65
+ ld hl, $9920
+ ld de, $4f3b
+ ld c, $14
+ call Function8cd65
+ ret
+; 8cd65
+
+Function8cd65: ; 8cd65
+.asm_8cd65
+ ld a, [de]
+ inc de
+ ld [hli], a
+ dec c
+ jr nz, .asm_8cd65
+ ret
+; 8cd6c
+
+Function8cd6c: ; 8cd6c
+.asm_8cd6c
+ ld [hl], e
+ inc hl
+ ld [hl], d
+ inc hl
+ dec b
+ jr nz, .asm_8cd6c
+ ret
+; 8cd74
+
+Function8cd74: ; 8cd74
+ push hl
+ ld e, a
+ ld d, $0
+ ld hl, $4d82
+ add hl, de
+ add hl, de
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ pop hl
+ ret
+; 8cd82
+
+INCBIN "baserom.gbc", $8cd82, $8cda6 - $8cd82
+
+Function8cda6: ; 8cda6
+ ld hl, LYOverrides
+ ld bc, $0090
+ ld a, [$d192]
+ call ByteFill
+ ld hl, $d200
+ ld bc, $0090
+ ld a, [$d192]
+ call ByteFill
+ ld a, $43
+ ld [hLCDStatCustom], a
+ ret
+; 8cdc3
+
+Function8cdc3: ; 8cdc3
+ ld a, $1
+ ld [rVBK], a
+ ld hl, VBGMap0
+ ld bc, $0080
+ ld a, $2
+ call ByteFill
+ ld hl, $9880
+ ld bc, $0140
+ xor a
+ call ByteFill
+ ld hl, $99c0
+ ld bc, $0080
+ ld a, $2
+ call ByteFill
+ ld hl, $9907
+ ld bc, $0006
+ ld a, $4
+ call ByteFill
+ ld a, $0
+ ld [rVBK], a
+ ret
+; 8cdf7
+
+Function8cdf7: ; 8cdf7
+ ld a, [$cf63]
+ ld e, a
+ ld d, $0
+ ld hl, $4e06
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 8ce06
+
+INCBIN "baserom.gbc", $8ce06, $8ceae - $8ce06
+
+Function8ceae: ; 8ceae
+ callba Function8cf69
+ call Function8cdf7
+ call Function8cc99
+ call Function3b0c
+ call DelayFrame
+ ld a, [rSVBK]
+ push af
+ ld a, $1
+ ld [rSVBK], a
+ ld a, [TimeOfDayPal]
+ push af
+ ld a, [$d19a]
+ push af
+ ld a, [TimeOfDay]
+ and $3
+ ld [TimeOfDayPal], a
+ ld a, $1
+ ld [$d19a], a
+ ld b, $9
+ call GetSGBLayout
+ call UpdateTimePals
+ ld a, [rBGP]
+ ld [$cfc7], a
+ ld a, [rOBP0]
+ ld [$cfc8], a
+ ld a, [rOBP1]
+ ld [$cfc9], a
+ pop af
+ ld [$d19a], a
+ pop af
+ ld [TimeOfDayPal], a
+ pop af
+ ld [rSVBK], a
+ ret
+; 8ceff
+
+INCBIN "baserom.gbc", $8ceff, $8cf4f - $8ceff
+
Function8cf4f: ; 8cf4f
call Function3238
ret
@@ -57522,9 +66175,21 @@
SECTION "bank24",ROMX,BANK[$24]
-INCBIN "baserom.gbc", $90000, $9000f - $90000
+Function90000: ; 90000
+ call Function9001c
+ jr c, .asm_9000d
+ call Function9002d
+ jr nc, .asm_9000d
+ ld [hl], c
+ xor a
+ ret
+.asm_9000d
+ scf
+ ret
+; 9000f
+
Function9000f: ; 9000f
call Function9001c
jr nc, .asm_90017
@@ -57559,9 +66224,60 @@
ret
; 9002d
-INCBIN "baserom.gbc", $9002d, $90069 - $9002d
+Function9002d: ; 9002d
+ call Function90040
+ ld b, a
+ ld hl, $dc7c
+.asm_90034
+ ld a, [hli]
+ and a
+ jr z, .asm_9003d
+ dec b
+ jr nz, .asm_90034
+ xor a
+ ret
+.asm_9003d
+ dec hl
+ scf
+ ret
+; 90040
+Function90040: ; 90040
+ xor a
+ ld [Buffer1], a
+ ld hl, $4066
+.asm_90047
+ ld a, [hli]
+ cp $ff
+ jr z, .asm_9005f
+ cp c
+ jr z, .asm_9005d
+ push bc
+ push hl
+ ld c, a
+ call Function9001c
+ jr c, .asm_9005b
+ ld hl, Buffer1
+ inc [hl]
+
+.asm_9005b
+ pop hl
+ pop bc
+
+.asm_9005d
+ jr .asm_90047
+
+.asm_9005f
+ ld a, $a
+ ld hl, Buffer1
+ sub [hl]
+ ret
+; 90066
+
+INCBIN "baserom.gbc", $90066, $90069 - $90066
+
+
Function90069: ; 90069
ld a, [hROMBank]
push af
@@ -57710,8 +66426,172 @@
ret
; 90380
-INCBIN "baserom.gbc", $90380, $909f2 - $90380
+INCBIN "baserom.gbc", $90380, $9039a - $90380
+Function9039a: ; 9039a
+ push hl
+ ld hl, $445f
+ ld bc, $000c
+ call AddNTimes
+ ld a, [hli]
+ ld b, [hl]
+ ld c, a
+ pop hl
+ ret
+; 903a9
+
+INCBIN "baserom.gbc", $903a9, $90439 - $903a9
+
+Function90439: ; 90439
+ ld a, [$dbf9]
+ call Function9039a
+ ld d, c
+ ld e, b
+ push de
+ ld a, [$dbf9]
+ ld hl, $4461
+ ld bc, $000c
+ call AddNTimes
+ ld b, [hl]
+ inc hl
+ ld c, [hl]
+ push bc
+ call GetWorldMapLocation
+ ld e, a
+ callba GetLandmarkName
+ pop bc
+ pop de
+ ret
+; 9045f
+
+INCBIN "baserom.gbc", $9045f, $90913 - $9045f
+
+Function90913: ; 90913
+ ld a, [$ffaa]
+ push af
+ ld a, $1
+ ld [$ffaa], a
+ ld de, $4903
+ ld hl, $8ef0
+ ld bc, $2401
+ call Request1bpp
+ ld de, $490b
+ ld hl, $8f50
+ ld bc, $2401
+ call Request1bpp
+ xor a
+ ld [DefaultFlypoint], a
+.asm_90936
+ ld hl, $c590
+ ld bc, $0412
+ call TextBox
+ call Function1d6e
+ ld hl, $4a3f
+ call PrintText
+ ld hl, $c4e5
+ ld b, $2
+ ld c, $9
+ call TextBox
+ ld hl, $c4ea
+ ld [hl], $ef
+ ld hl, $c526
+ ld [hl], $f5
+ ld hl, $c50e
+ call Function909de
+ call Function321c
+ ld c, $a
+ call DelayFrames
+.asm_9096a
+ call Functiona57
+ call Function90993
+ jr nc, .asm_9096a
+ call Function1c07
+ call Function1ad2
+ ld hl, $4a44
+ call PrintText
+ call Function1dcf
+ jr c, .asm_90936
+ ld a, [DefaultFlypoint]
+ ld [StringBuffer2], a
+ call $0663
+ call Functione51
+ pop af
+ ld [$ffaa], a
+ ret
+; 90993
+
+Function90993: ; 90993
+ ld a, [hJoyPressed]
+ and $1
+ jr z, .asm_9099b
+ scf
+ ret
+
+.asm_9099b
+ ld hl, $ffa9
+ ld a, [hl]
+ and $40
+ jr nz, .asm_909ba
+ ld a, [hl]
+ and $80
+ jr nz, .asm_909ad
+ call DelayFrame
+ and a
+ ret
+
+.asm_909ad
+ ld hl, DefaultFlypoint
+ ld a, [hl]
+ and a
+ jr nz, .asm_909b6
+ ld a, $7
+
+.asm_909b6
+ dec a
+ ld [hl], a
+ jr .asm_909c6
+
+.asm_909ba
+ ld hl, DefaultFlypoint
+ ld a, [hl]
+ cp $6
+ jr c, .asm_909c4
+ ld a, $ff
+
+.asm_909c4
+ inc a
+ ld [hl], a
+
+.asm_909c6
+ xor a
+ ld [hBGMapMode], a
+ ld hl, $c4fa
+ ld b, $2
+ ld c, $9
+ call ClearBox
+ ld hl, $c50e
+ call Function909de
+ call WaitBGMap
+ and a
+ ret
+; 909de
+
+Function909de: ; 909de
+ push hl
+ ld a, [DefaultFlypoint]
+ ld e, a
+ ld d, $0
+ ld hl, $49f2
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld d, [hl]
+ ld e, a
+ pop hl
+ call PlaceString
+ ret
+; 909f2
+
dw Sunday
dw Monday
dw Tuesday
@@ -57737,8 +66617,215 @@
db "SATURDAY@"
-INCBIN "baserom.gbc", $90a3f, $914dd - $90a3f
+INCBIN "baserom.gbc", $90a3f, $90a54 - $90a3f
+Function90a54: ; 90a54
+ ld a, [$d4c2]
+ set 7, a
+ ld [$d4c2], a
+ ld hl, $c5b9
+ ld bc, $0312
+ call ClearBox
+ ld hl, $4a6c
+ call Function13e5
+ ret
+; 90a6c
+
+INCBIN "baserom.gbc", $90a6c, $90a88 - $90a6c
+
+Function90a88: ; 90a88
+ ld a, [$d4c2]
+ res 7, a
+ ld [$d4c2], a
+ ld hl, $c5b9
+ ld bc, $0312
+ call ClearBox
+ ld hl, $4aa0
+ call Function13e5
+ ret
+; 90aa0
+
+INCBIN "baserom.gbc", $90aa0, $90c4e - $90aa0
+
+Function90c4e: ; 90c4e
+ call Functiond79
+ ld hl, $4ba0
+ ld de, VTiles2
+ ld a, $3e
+ call FarDecompress
+ ld hl, $62e4
+ ld de, $9300
+ ld a, $77
+ call FarDecompress
+ ld hl, PokegearSpritesGFX
+ ld de, VTiles0
+ ld a, $24
+ call Decompress
+ ld a, [MapGroup]
+ ld b, a
+ ld a, [MapNumber]
+ ld c, a
+ call GetWorldMapLocation
+ cp $5f
+ jr z, .asm_90ca5
+ callba GetPlayerIcon
+ push de
+ ld h, d
+ ld l, e
+ ld a, b
+ push af
+ ld de, $8100
+ ld bc, $0040
+ call FarCopyBytes
+ pop af
+ pop hl
+ ld de, $00c0
+ add hl, de
+ ld de, $8140
+ ld bc, $0040
+ call FarCopyBytes
+ ret
+
+.asm_90ca5
+ ld hl, $4cb2
+ ld de, $8100
+ ld bc, $0080
+ call CopyBytes
+ ret
+; 90cb2
+
+INCBIN "baserom.gbc", $90cb2, $90d56 - $90cb2
+
+Function90d56: ; 90d56
+ ld a, [MapGroup]
+ ld b, a
+ ld a, [MapNumber]
+ ld c, a
+ call GetWorldMapLocation
+ cp $0
+ ret nz
+ ld a, [BackupMapGroup]
+ ld b, a
+ ld a, [BackupMapNumber]
+ ld c, a
+ call GetWorldMapLocation
+ ret
+; 90d70
+
+INCBIN "baserom.gbc", $90d70, $9106a - $90d70
+
+Function9106a: ; 9106a
+ push af
+ ld de, $0000
+ ld b, $a
+ ld a, [PlayerGender]
+ bit 0, a
+ jr z, .asm_91079
+ ld b, $1e
+
+.asm_91079
+ ld a, b
+ call Function3b2a
+ ld hl, $0003
+ add hl, bc
+ ld [hl], $10
+ pop af
+ ld e, a
+ push bc
+ callba GetLandmarkCoords
+ pop bc
+ ld hl, $0004
+ add hl, bc
+ ld [hl], e
+ ld hl, $0005
+ add hl, bc
+ ld [hl], d
+ ret
+; 91098
+
+Function91098: ; 91098
+ push af
+ ld de, $0000
+ ld a, $d
+ call Function3b2a
+ ld hl, $0003
+ add hl, bc
+ ld [hl], $4
+ ld hl, $0002
+ add hl, bc
+ ld [hl], $0
+ pop af
+ push bc
+ call Function910d4
+ pop bc
+ ret
+; 910b4
+
+Function910b4: ; 910b4
+ push af
+ ld hl, $c4a8
+ ld bc, $020c
+ call ClearBox
+ pop af
+ ld e, a
+ push de
+ callba GetLandmarkName
+ pop de
+ callba Function1de2c5
+ ld hl, $c4a8
+ ld [hl], $34
+ ret
+; 910d4
+
+Function910d4: ; 910d4
+ push bc
+ ld e, a
+ callba GetLandmarkCoords
+ pop bc
+ ld hl, $0004
+ add hl, bc
+ ld [hl], e
+ ld hl, $0005
+ add hl, bc
+ ld [hl], d
+ ret
+; 910e8
+
+Function910e8: ; 910e8
+ ld a, [StatusFlags]
+ bit 6, a
+ jr z, .asm_910f4
+ ld d, $5e
+ ld e, $2f
+ ret
+
+.asm_910f4
+ ld d, $5e
+ ld e, $58
+ ret
+; 910f9
+
+INCBIN "baserom.gbc", $910f9, $91492 - $910f9
+
+Function91492: ; 91492
+ ld a, [EnemyTurnsTaken]
+ cp $fe
+ jr z, .asm_914a3
+ cp $ff
+ call z, Function3d03
+ xor a
+ ld [EnemyTurnsTaken], a
+ ret
+
+.asm_914a3
+ call Function3d47
+ xor a
+ ld [EnemyTurnsTaken], a
+ ret
+; 914ab
+
+INCBIN "baserom.gbc", $914ab, $914dd - $914ab
+
PokegearSpritesGFX: ; 914dd
INCBIN "gfx/misc/pokegear_sprites.lz"
; 91508
@@ -57757,8 +66844,224 @@
db "# FLUTE@"
; 9191c
-INCBIN "baserom.gbc", $9191c, $91ae1 - $9191c
+Function9191c: ; 9191c
+ ld hl, Options
+ ld a, [hl]
+ push af
+ set 4, [hl]
+ ld a, [$ffaa]
+ push af
+ ld a, $1
+ ld [$ffaa], a
+ ld a, [VramState]
+ push af
+ xor a
+ ld [VramState], a
+ call WhiteBGMap
+ call ClearTileMap
+ call ClearSprites
+ call DisableLCD
+ call Function90c4e
+ callba Function8cf53
+ ld a, $8
+ call Function3cb4
+ ld a, $e3
+ ld [rLCDC], a
+ call Function90d56
+ ld [DefaultFlypoint], a
+ ld [$d003], a
+ xor a
+ ld [hBGMapMode], a
+ call Function91a04
+ call Function3200
+ ld a, [DefaultFlypoint]
+ call Function9106a
+ ld a, [$d003]
+ call Function91098
+ ld a, c
+ ld [$d004], a
+ ld a, b
+ ld [StartFlypoint], a
+ ld b, $2
+ call GetSGBLayout
+ call Function32f9
+ ld a, [hCGB]
+ and a
+ jr z, .asm_9198b
+ ld a, $e4
+ call Functioncf8
+ call DelayFrame
+.asm_9198b
+ ld a, [DefaultFlypoint]
+ cp $2f
+ jr nc, .asm_9199b
+ ld d, $2e
+ ld e, $1
+ call Function919b0
+ jr .asm_919a1
+
+.asm_9199b
+ call Function910e8
+ call Function919b0
+
+.asm_919a1
+ pop af
+ ld [VramState], a
+ pop af
+ ld [$ffaa], a
+ pop af
+ ld [Options], a
+ call WhiteBGMap
+ ret
+; 919b0
+
+Function919b0: ; 919b0
+.asm_919b0
+ call Functiona57
+ ld hl, hJoyPressed
+ ld a, [hl]
+ and $2
+ ret nz
+ ld hl, $ffa9
+ ld a, [hl]
+ and $40
+ jr nz, .asm_919d4
+ ld a, [hl]
+ and $80
+ jr nz, .asm_919e1
+.asm_919c7
+ push de
+ callba Function8cf69
+ pop de
+ call DelayFrame
+ jr .asm_919b0
+
+.asm_919d4
+ ld hl, $d003
+ ld a, [hl]
+ cp d
+ jr c, .asm_919de
+ ld a, e
+ dec a
+ ld [hl], a
+
+.asm_919de
+ inc [hl]
+ jr .asm_919ec
+
+.asm_919e1
+ ld hl, $d003
+ ld a, [hl]
+ cp e
+ jr nz, .asm_919eb
+ ld a, d
+ inc a
+ ld [hl], a
+
+.asm_919eb
+ dec [hl]
+
+.asm_919ec
+ push de
+ ld a, [$d003]
+ call Function910b4
+ ld a, [$d004]
+ ld c, a
+ ld a, [StartFlypoint]
+ ld b, a
+ ld a, [$d003]
+ call Function910d4
+ pop de
+ jr .asm_919c7
+; 91a04
+
+Function91a04: ; 91a04
+ ld a, [DefaultFlypoint]
+ cp $2f
+ jr nc, .asm_91a0f
+ ld e, $0
+ jr .asm_91a11
+
+.asm_91a0f
+ ld e, $1
+
+.asm_91a11
+ callba Function91ae1
+ ld a, $7
+ ld bc, $0006
+ ld hl, $c4a1
+ call ByteFill
+ ld hl, TileMap
+ ld [hl], $6
+ ld hl, $c4a7
+ ld [hl], $17
+ ld hl, $c4bb
+ ld [hl], $16
+ ld hl, $c4cf
+ ld [hl], $26
+ ld a, $7
+ ld bc, $000b
+ ld hl, $c4d0
+ call ByteFill
+ ld hl, $c4db
+ ld [hl], $17
+ ld a, [$d003]
+ call Function910b4
+ callba TownMapPals
+ ret
+; 91a53
+
+Function91a53: ; 91a53
+ ld hl, Options
+ ld a, [hl]
+ push af
+ set 4, [hl]
+ call Function91a87
+ ld c, $64
+ call DelayFrames
+.asm_91a62
+ call Functiona57
+ ld a, [hJoyPressed]
+ and $3
+ jr nz, .asm_91a7f
+ ld a, [EnemyEvaLevel]
+ ld l, a
+ ld a, [$c6db]
+ ld h, a
+ ld a, [EnemyAccLevel]
+ and a
+ jr z, .asm_91a7a
+ rst FarCall
+
+.asm_91a7a
+ call DelayFrame
+ jr .asm_91a62
+
+.asm_91a7f
+ pop af
+ ld [Options], a
+ call Function91492
+ ret
+; 91a87
+
+Function91a87: ; 91a87
+ ld a, $ff
+ ld [EnemyTurnsTaken], a
+ ld hl, $5ab9
+ ld d, $0
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld de, $5a9b
+ push de
+ jp [hl]
+; 91a9b
+
+INCBIN "baserom.gbc", $91a9b, $91ae1 - $91a9b
+
Function91ae1: ; 91ae1
ld a, e
and a
@@ -58567,9 +67870,7 @@
ld [$d453], a
ld [$d454], a
call Function968d1
- ld a, $5
- ld hl, $5363
- rst FarCall
+ callba Function15363
call Function966cb
ld a, [$ff9f]
cp $f7
@@ -60352,1338 +69653,24 @@
SECTION "bank2A",ROMX,BANK[$2A]
-Route32_BlockData: ; 0xa8000
- INCBIN "maps/Route32.blk"
-; 0xa81c2
+INCLUDE "maps/blockdata_1.asm"
-Route40_BlockData: ; 0xa81c2
- INCBIN "maps/Route40.blk"
-; 0xa8276
-Route36_BlockData: ; 0xa8276
- INCBIN "maps/Route36.blk"
-; 0xa8384
-
-Route44_BlockData: ; 0xa8384
- INCBIN "maps/Route44.blk"
-; 0xa8492
-
-Route28_BlockData: ; 0xa8492
- INCBIN "maps/Route28.blk"
-; 0xa8546
-
-BetaHerosHouse_BlockData: ; 0xa8546
- INCBIN "maps/BetaHerosHouse.blk"
-; 0xa8552
-
-CeladonCity_BlockData: ; 0xa8552
- INCBIN "maps/CeladonCity.blk"
-; 0xa86ba
-
-SaffronCity_BlockData: ; 0xa86ba
- INCBIN "maps/SaffronCity.blk"
-; 0xa8822
-
-Route2_BlockData: ; 0xa8822
- INCBIN "maps/Route2.blk"
-; 0xa8930
-
-ElmsHouse_BlockData: ; 0xa8930
- INCBIN "maps/ElmsHouse.blk"
-; 0xa8940
-
-BetaSproutTower1_BlockData: ; 0xa8940
- INCBIN "maps/BetaSproutTower1.blk"
-; 0xa899a
-
-Route11_BlockData: ; 0xa899a
- INCBIN "maps/Route11.blk"
-; 0xa8a4e
-
-BetaSproutTower5_BlockData: ; 0xa8a4e
- INCBIN "maps/BetaSproutTower5.blk"
-; 0xa8aa8
-
-Route15_BlockData: ; 0xa8aa8
- INCBIN "maps/Route15.blk"
-; 0xa8b5c
-
-BetaSproutTower9_BlockData: ; 0xa8b5c
- INCBIN "maps/BetaSproutTower9.blk"
-; 0xa8b80
-
-Route19_BlockData: ; 0xa8b80
- INCBIN "maps/Route19.blk"
-; 0xa8c34
-
-BetaBlackthornCity_BlockData: ; 0xa8c34
- INCBIN "maps/BetaBlackthornCity.blk"
-; 0xa8d9c
-
-Route10South_BlockData: ; 0xa8d9c
- INCBIN "maps/Route10South.blk"
-; 0xa8df6
-
-CinnabarPokeCenter2FBeta_BlockData: ; 0xa8df6
- INCBIN "maps/CinnabarPokeCenter2FBeta.blk"
-; 0xa8e16
-
-Route41_BlockData: ; 0xa8e16
- INCBIN "maps/Route41.blk"
-; 0xa90b9
-
-Route33_BlockData: ; 0xa90b9
- INCBIN "maps/Route33.blk"
-; 0xa9113
-
-Route45_BlockData: ; 0xa9113
- INCBIN "maps/Route45.blk"
-; 0xa92d5
-
-Route29_BlockData: ; 0xa92d5
- INCBIN "maps/Route29.blk"
-; 0xa93e3
-
-Route37_BlockData: ; 0xa93e3
- INCBIN "maps/Route37.blk"
-; 0xa943d
-
-LavenderTown_BlockData: ; 0xa943d
- INCBIN "maps/LavenderTown.blk"
-; 0xa9497
-
-PalletTown_BlockData: ; 0xa9497
- INCBIN "maps/PalletTown.blk"
-; 0xa94f1
-
-Route25_BlockData: ; 0xa94f1
- INCBIN "maps/Route25.blk"
-; 0xa95ff
-
-Route24_BlockData: ; 0xa95ff
- INCBIN "maps/Route24.blk"
-; 0xa9659
-
-BetaVioletCity_BlockData: ; 0xa9659
- INCBIN "maps/BetaVioletCity.blk"
-; 0xa97c1
-
-Route3_BlockData: ; 0xa97c1
- INCBIN "maps/Route3.blk"
-; 0xa98cf
-
-PewterCity_BlockData: ; 0xa98cf
- INCBIN "maps/PewterCity.blk"
-; 0xa9a37
-
-BetaIlexForest_BlockData: ; 0xa9a37
- INCBIN "maps/BetaIlexForest.blk"
-; 0xa9b9f
-
-BetaSproutTower2_BlockData: ; 0xa9b9f
- INCBIN "maps/BetaSproutTower2.blk"
-; 0xa9bf9
-
-Route12_BlockData: ; 0xa9bf9
- INCBIN "maps/Route12.blk"
-; 0xa9d07
-
-BetaGoldenrodCity_BlockData: ; 0xa9d07
- INCBIN "maps/BetaGoldenrodCity.blk"
-; 0xa9e6f
-
-Route20_BlockData: ; 0xa9e6f
- INCBIN "maps/Route20.blk"
-; 0xa9f7d
-
-BetaSproutTower6_BlockData: ; 0xa9f7d
- INCBIN "maps/BetaSproutTower6.blk"
-; 0xa9fd7
-
-BetaPokecenterMainHouse_BlockData: ; 0xa9fd7
- INCBIN "maps/BetaPokecenterMainHouse.blk"
-; 0xa9ff7
-
-Route30_BlockData: ; 0xa9ff7
- INCBIN "maps/Route30.blk"
-; 0xaa105
-
-Route26_BlockData: ; 0xaa105
- INCBIN "maps/Route26.blk"
-; 0xaa321
-
-Route42_BlockData: ; 0xaa321
- INCBIN "maps/Route42.blk"
-; 0xaa42f
-
-Route34_BlockData: ; 0xaa42f
- INCBIN "maps/Route34.blk"
-; 0xaa53d
-
-Route46_BlockData: ; 0xaa53d
- INCBIN "maps/Route46.blk"
-; 0xaa5f1
-
-FuchsiaCity_BlockData: ; 0xaa5f1
- INCBIN "maps/FuchsiaCity.blk"
-; 0xaa759
-
-Route38_BlockData: ; 0xaa759
- INCBIN "maps/Route38.blk"
-; 0xaa80d
-
-BetaCianwoodCity_BlockData: ; 0xaa80d
- INCBIN "maps/BetaCianwoodCity.blk"
-; 0xaa867
-
-OlivineVoltorbHouse_BlockData: ; 0xaa867
- INCBIN "maps/OlivineVoltorbHouse.blk"
-; 0xaa877
-
-SafariZoneFuchsiaGateBeta_BlockData: ; 0xaa877
- INCBIN "maps/SafariZoneFuchsiaGateBeta.blk"
-; 0xaa88b
-
-BetaTeakCity_BlockData: ; 0xaa88b
- INCBIN "maps/BetaTeakCity.blk"
-; 0xaa9f3
-
-BetaCherrygroveCity_BlockData: ; 0xaa9f3
- INCBIN "maps/BetaCherrygroveCity.blk"
-; 0xaaa4d
-
-CinnabarIsland_BlockData: ; 0xaaa4d
- INCBIN "maps/CinnabarIsland.blk"
-; 0xaaaa7
-
-Route4_BlockData: ; 0xaaaa7
- INCBIN "maps/Route4.blk"
-; 0xaab5b
-
-Route8_BlockData: ; 0xaab5b
- INCBIN "maps/Route8.blk"
-; 0xaac0f
-
-BetaSproutTower3_BlockData: ; 0xaac0f
- INCBIN "maps/BetaSproutTower3.blk"
-; 0xaac69
-
-ViridianCity_BlockData: ; 0xaac69
- INCBIN "maps/ViridianCity.blk"
-; 0xaadd1
-
-Route13_BlockData: ; 0xaadd1
- INCBIN "maps/Route13.blk"
-; 0xaaedf
-
-Route21_BlockData: ; 0xaaedf
- INCBIN "maps/Route21.blk"
-; 0xaaf93
-
-BetaSproutTower7_BlockData: ; 0xaaf93
- INCBIN "maps/BetaSproutTower7.blk"
-; 0xaafed
-
-Route17_BlockData: ; 0xaafed
- INCBIN "maps/Route17.blk"
-; 0xab1af
-
-BetaMahoganyTown_BlockData: ; 0xab1af
- INCBIN "maps/BetaMahoganyTown.blk"
-; 0xab209
-
-Route31_BlockData: ; 0xab209
- INCBIN "maps/Route31.blk"
-; 0xab2bd
-
-Route27_BlockData: ; 0xab2bd
- INCBIN "maps/Route27.blk"
-; 0xab425
-
-Route35_BlockData: ; 0xab425
- INCBIN "maps/Route35.blk"
-; 0xab4d9
-
-Route43_BlockData: ; 0xab4d9
- INCBIN "maps/Route43.blk"
-; 0xab5e7
-
-Route39_BlockData: ; 0xab5e7
- INCBIN "maps/Route39.blk"
-; 0xab69b
-
-KrissHouse1F_BlockData: ; 0xab69b
- INCBIN "maps/KrissHouse1F.blk"
-; 0xab6af
-
-Route38EcruteakGate_BlockData: ; 0xab6af
- INCBIN "maps/Route38EcruteakGate.blk"
-; 0xab6c3
-
-BetaAzaleaTown_BlockData: ; 0xab6c3
- INCBIN "maps/BetaAzaleaTown.blk"
-; 0xab82b
-
-VermilionCity_BlockData: ; 0xab82b
- INCBIN "maps/VermilionCity.blk"
-; 0xab993
-
-BetaOlivineCity_BlockData: ; 0xab993
- INCBIN "maps/BetaOlivineCity.blk"
-; 0xabafb
-
-BetaNewBarkTown_BlockData: ; 0xabafb
- INCBIN "maps/BetaNewBarkTown.blk"
-; 0xabb55
-
-ElmsLab_BlockData: ; 0xabb55
- INCBIN "maps/ElmsLab.blk"
-; 0xabb73
-
-CeruleanCity_BlockData: ; 0xabb73
- INCBIN "maps/CeruleanCity.blk"
-; 0xabcdb
-
-Route1_BlockData: ; 0xabcdb
- INCBIN "maps/Route1.blk"
-; 0xabd8f
-
-Route5_BlockData: ; 0xabd8f
- INCBIN "maps/Route5.blk"
-; 0xabde9
-
-Route9_BlockData: ; 0xabde9
- INCBIN "maps/Route9.blk"
-; 0xabef7
-
-Route22_BlockData: ; 0xabef7
- INCBIN "maps/Route22.blk"
-; 0xabfab
-
-
SECTION "bank2B",ROMX,BANK[$2B]
-Route14_BlockData: ; 0xac000
- INCBIN "maps/Route14.blk"
-; 0xac0b4
+INCLUDE "maps/blockdata_2.asm"
-BetaSproutTower8_BlockData: ; 0xac0b4
- INCBIN "maps/BetaSproutTower8.blk"
-; 0xac10e
-OlivineMart_BlockData: ; 0xac10e
- INCBIN "maps/OlivineMart.blk"
-; 0xac126
-
-Route10North_BlockData: ; 0xac126
- INCBIN "maps/Route10North.blk"
-; 0xac180
-
-BetaLakeOfRage_BlockData: ; 0xac180
- INCBIN "maps/BetaLakeOfRage.blk"
-; 0xac2e8
-
-OlivinePokeCenter1F_BlockData: ; 0xac2e8
- INCBIN "maps/OlivinePokeCenter1F.blk"
-; 0xac2fc
-
-BetaPewterMuseumOfScience1F_BlockData: ; 0xac2fc
- INCBIN "maps/BetaPewterMuseumOfScience1F.blk"
-; 0xac324
-
-BetaPewterMuseumOfScience2F_BlockData: ; 0xac324
- INCBIN "maps/BetaPewterMuseumOfScience2F.blk"
-; 0xac340
-
-EarlsPokemonAcademy_BlockData: ; 0xac340
- INCBIN "maps/EarlsPokemonAcademy.blk"
-; 0xac360
-
-BetaCinnabarIslandPokemonLabHallway_BlockData: ; 0xac360
- INCBIN "maps/BetaCinnabarIslandPokemonLabHallway.blk"
-; 0xac384
-
-BetaCinnabarIslandPokemonLabRoom1_BlockData: ; 0xac384
- INCBIN "maps/BetaCinnabarIslandPokemonLabRoom1.blk"
-; 0xac394
-
-BetaCinnabarIslandPokemonLabRoom2_BlockData: ; 0xac394
- INCBIN "maps/BetaCinnabarIslandPokemonLabRoom2.blk"
-; 0xac3a4
-
-BetaCinnabarIslandPokemonLabRoom3_BlockData: ; 0xac3a4
- INCBIN "maps/BetaCinnabarIslandPokemonLabRoom3.blk"
-; 0xac3b4
-
-GoldenrodDeptStore1F_BlockData: ; 0xac3b4
- INCBIN "maps/GoldenrodDeptStore1F.blk"
-; 0xac3d4
-
-GoldenrodDeptStore2F_BlockData: ; 0xac3d4
- INCBIN "maps/GoldenrodDeptStore2F.blk"
-; 0xac3f4
-
-GoldenrodDeptStore3F_BlockData: ; 0xac3f4
- INCBIN "maps/GoldenrodDeptStore3F.blk"
-; 0xac414
-
-GoldenrodDeptStore4F_BlockData: ; 0xac414
- INCBIN "maps/GoldenrodDeptStore4F.blk"
-; 0xac434
-
-GoldenrodDeptStore5F_BlockData: ; 0xac434
- INCBIN "maps/GoldenrodDeptStore5F.blk"
-; 0xac454
-
-GoldenrodDeptStore6F_BlockData: ; 0xac454
- INCBIN "maps/GoldenrodDeptStore6F.blk"
-; 0xac474
-
-GoldenrodDeptStoreElevator_BlockData: ; 0xac474
- INCBIN "maps/GoldenrodDeptStoreElevator.blk"
-; 0xac478
-
-CeladonMansion1F_BlockData: ; 0xac478
- INCBIN "maps/CeladonMansion1F.blk"
-; 0xac48c
-
-CeladonMansion2F_BlockData: ; 0xac48c
- INCBIN "maps/CeladonMansion2F.blk"
-; 0xac4a0
-
-CeladonMansion3F_BlockData: ; 0xac4a0
- INCBIN "maps/CeladonMansion3F.blk"
-; 0xac4b4
-
-CeladonMansionRoof_BlockData: ; 0xac4b4
- INCBIN "maps/CeladonMansionRoof.blk"
-; 0xac4c8
-
-BetaHouse_BlockData: ; 0xac4c8
- INCBIN "maps/BetaHouse.blk"
-; 0xac4d8
-
-CeladonGameCorner_BlockData: ; 0xac4d8
- INCBIN "maps/CeladonGameCorner.blk"
-; 0xac51e
-
-CeladonGameCornerPrizeRoom_BlockData: ; 0xac51e
- INCBIN "maps/CeladonGameCornerPrizeRoom.blk"
-; 0xac527
-
-Colosseum_BlockData: ; 0xac527
- INCBIN "maps/Colosseum.blk"
-; 0xac53b
-
-TradeCenter_BlockData: ; 0xac53b
- INCBIN "maps/TradeCenter.blk"
-; 0xac54f
-
-EcruteakLugiaSpeechHouse_BlockData: ; 0xac54f
- INCBIN "maps/EcruteakLugiaSpeechHouse.blk"
-; 0xac55f
-
-BetaCave_BlockData: ; 0xac55f
- INCBIN "maps/BetaCave.blk"
-; 0xac5b9
-
-UnionCaveB1F_BlockData: ; 0xac5b9
- INCBIN "maps/UnionCaveB1F.blk"
-; 0xac66d
-
-UnionCaveB2F_BlockData: ; 0xac66d
- INCBIN "maps/UnionCaveB2F.blk"
-; 0xac721
-
-UnionCave1F_BlockData: ; 0xac721
- INCBIN "maps/UnionCave1F.blk"
-; 0xac7d5
-
-NationalPark_BlockData: ; 0xac7d5
- INCBIN "maps/NationalPark.blk"
-; 0xac9f1
-
-Route6UndergroundEntrance_BlockData: ; 0xac9f1
- INCBIN "maps/Route6UndergroundEntrance.blk"
-; 0xaca01
-
-BetaPokecenterTradeStation_BlockData: ; 0xaca01
- INCBIN "maps/BetaPokecenterTradeStation.blk"
-; 0xaca11
-
-KurtsHouse_BlockData: ; 0xaca11
- INCBIN "maps/KurtsHouse.blk"
-; 0xaca31
-
-GoldenrodMagnetTrainStation_BlockData: ; 0xaca31
- INCBIN "maps/GoldenrodMagnetTrainStation.blk"
-; 0xaca8b
-
-RuinsofAlphOutside_BlockData: ; 0xaca8b
- INCBIN "maps/RuinsofAlphOutside.blk"
-; 0xacb3f
-
-BetaAlphRuinUnsolvedPuzzleRoom_BlockData: ; 0xacb3f
- INCBIN "maps/BetaAlphRuinUnsolvedPuzzleRoom.blk"
-; 0xacb53
-
-RuinsofAlphInnerChamber_BlockData: ; 0xacb53
- INCBIN "maps/RuinsofAlphInnerChamber.blk"
-; 0xacbdf
-
-RuinsofAlphHoOhChamber_BlockData: ; 0xacbdf
- INCBIN "maps/RuinsofAlphHoOhChamber.blk"
-; 0xacbf3
-
-SproutTower1F_BlockData: ; 0xacbf3
- INCBIN "maps/SproutTower1F.blk"
-; 0xacc43
-
-BetaSproutTowerCutOut1_BlockData: ; 0xacc43
- INCBIN "maps/BetaSproutTowerCutOut1.blk"
-; 0xacc4d
-
-SproutTower2F_BlockData: ; 0xacc4d
- INCBIN "maps/SproutTower2F.blk"
-; 0xacc9d
-
-BetaSproutTowerCutOut2_BlockData: ; 0xacc9d
- INCBIN "maps/BetaSproutTowerCutOut2.blk"
-; 0xacca7
-
-SproutTower3F_BlockData: ; 0xacca7
- INCBIN "maps/SproutTower3F.blk"
-; 0xaccf7
-
-BetaSproutTowerCutOut3_BlockData: ; 0xaccf7
- INCBIN "maps/BetaSproutTowerCutOut3.blk"
-; 0xacd01
-
-RadioTower1F_BlockData: ; 0xacd01
- INCBIN "maps/RadioTower1F.blk"
-; 0xacd25
-
-RadioTower2F_BlockData: ; 0xacd25
- INCBIN "maps/RadioTower2F.blk"
-; 0xacd49
-
-RadioTower3F_BlockData: ; 0xacd49
- INCBIN "maps/RadioTower3F.blk"
-; 0xacd6d
-
-RadioTower4F_BlockData: ; 0xacd6d
- INCBIN "maps/RadioTower4F.blk"
-; 0xacd91
-
-RadioTower5F_BlockData: ; 0xacd91
- INCBIN "maps/RadioTower5F.blk"
-; 0xacdb5
-
-NewBarkTown_BlockData: ; 0xacdb5
- INCBIN "maps/NewBarkTown.blk"
-; 0xace0f
-
-CherrygroveCity_BlockData: ; 0xace0f
- INCBIN "maps/CherrygroveCity.blk"
-; 0xacec3
-
-VioletCity_BlockData: ; 0xacec3
- INCBIN "maps/VioletCity.blk"
-; 0xad02b
-
-AzaleaTown_BlockData: ; 0xad02b
- INCBIN "maps/AzaleaTown.blk"
-; 0xad0df
-
-CianwoodCity_BlockData: ; 0xad0df
- INCBIN "maps/CianwoodCity.blk"
-; 0xad274
-
-GoldenrodCity_BlockData: ; 0xad274
- INCBIN "maps/GoldenrodCity.blk"
-; 0xad3dc
-
-OlivineCity_BlockData: ; 0xad3dc
- INCBIN "maps/OlivineCity.blk"
-; 0xad544
-
-EcruteakCity_BlockData: ; 0xad544
- INCBIN "maps/EcruteakCity.blk"
-; 0xad6ac
-
-MahoganyTown_BlockData: ; 0xad6ac
- INCBIN "maps/MahoganyTown.blk"
-; 0xad706
-
-LakeofRage_BlockData: ; 0xad706
- INCBIN "maps/LakeofRage.blk"
-; 0xad86e
-
-BlackthornCity_BlockData: ; 0xad86e
- INCBIN "maps/BlackthornCity.blk"
-; 0xad9d6
-
-SilverCaveOutside_BlockData: ; 0xad9d6
- INCBIN "maps/SilverCaveOutside.blk"
-; 0xadb3e
-
-Route6_BlockData: ; 0xadb3e
- INCBIN "maps/Route6.blk"
-; 0xadb98
-
-Route7_BlockData: ; 0xadb98
- INCBIN "maps/Route7.blk"
-; 0xadbf2
-
-Route16_BlockData: ; 0xadbf2
- INCBIN "maps/Route16.blk"
-; 0xadc4c
-
-Route18_BlockData: ; 0xadc4c
- INCBIN "maps/Route18.blk"
-; 0xadca6
-
-WarehouseEntrance_BlockData: ; 0xadca6
- INCBIN "maps/WarehouseEntrance.blk"
-; 0xaddb4
-
-UndergroundPathSwitchRoomEntrances_BlockData: ; 0xaddb4
- INCBIN "maps/UndergroundPathSwitchRoomEntrances.blk"
-; 0xadec2
-
-GoldenrodDeptStoreB1F_BlockData: ; 0xadec2
- INCBIN "maps/GoldenrodDeptStoreB1F.blk"
-; 0xadf1c
-
-UndergroundWarehouse_BlockData: ; 0xadf1c
- INCBIN "maps/UndergroundWarehouse.blk"
-; 0xadf76
-
-BetaElevator_BlockData: ; 0xadf76
- INCBIN "maps/BetaElevator.blk"
-; 0xadf8f
-
-TinTower1F_BlockData: ; 0xadf8f
- INCBIN "maps/TinTower1F.blk"
-; 0xadfe9
-
-TinTower2F_BlockData: ; 0xadfe9
- INCBIN "maps/TinTower2F.blk"
-; 0xae043
-
-TinTower3F_BlockData: ; 0xae043
- INCBIN "maps/TinTower3F.blk"
-; 0xae09d
-
-TinTower4F_BlockData: ; 0xae09d
- INCBIN "maps/TinTower4F.blk"
-; 0xae0f7
-
-TinTower5F_BlockData: ; 0xae0f7
- INCBIN "maps/TinTower5F.blk"
-; 0xae151
-
-TinTower6F_BlockData: ; 0xae151
- INCBIN "maps/TinTower6F.blk"
-; 0xae1ab
-
-TinTower7F_BlockData: ; 0xae1ab
- INCBIN "maps/TinTower7F.blk"
-; 0xae205
-
-TinTower8F_BlockData: ; 0xae205
- INCBIN "maps/TinTower8F.blk"
-; 0xae25f
-
-TinTower9F_BlockData: ; 0xae25f
- INCBIN "maps/TinTower9F.blk"
-; 0xae2b9
-
-TinTowerRoof_BlockData: ; 0xae2b9
- INCBIN "maps/TinTowerRoof.blk"
-; 0xae313
-
-BurnedTower1F_BlockData: ; 0xae313
- INCBIN "maps/BurnedTower1F.blk"
-; 0xae36d
-
-BurnedTowerB1F_BlockData: ; 0xae36d
- INCBIN "maps/BurnedTowerB1F.blk"
-; 0xae3c7
-
-BetaCaveTestMap_BlockData: ; 0xae3c7
- INCBIN "maps/BetaCaveTestMap.blk"
-; 0xae4d5
-
-MountMortar1FOutside_BlockData: ; 0xae4d5
- INCBIN "maps/MountMortar1FOutside.blk"
-; 0xae63d
-
-MountMortar1FInside_BlockData: ; 0xae63d
- INCBIN "maps/MountMortar1FInside.blk"
-; 0xae859
-
-MountMortar2FInside_BlockData: ; 0xae859
- INCBIN "maps/MountMortar2FInside.blk"
-; 0xae9c1
-
-MountMortarB1F_BlockData: ; 0xae9c1
- INCBIN "maps/MountMortarB1F.blk"
-; 0xaeb29
-
-IcePath1F_BlockData: ; 0xaeb29
- INCBIN "maps/IcePath1F.blk"
-; 0xaec91
-
-IcePathB1F_BlockData: ; 0xaec91
- INCBIN "maps/IcePathB1F.blk"
-; 0xaed45
-
-IcePathB2FMahoganySide_BlockData: ; 0xaed45
- INCBIN "maps/IcePathB2FMahoganySide.blk"
-; 0xaed9f
-
-IcePathB2FBlackthornSide_BlockData: ; 0xaed9f
- INCBIN "maps/IcePathB2FBlackthornSide.blk"
-; 0xaedcc
-
-IcePathB3F_BlockData: ; 0xaedcc
- INCBIN "maps/IcePathB3F.blk"
-; 0xaee26
-
-WhirlIslandNW_BlockData: ; 0xaee26
- INCBIN "maps/WhirlIslandNW.blk"
-; 0xaee53
-
-WhirlIslandNE_BlockData: ; 0xaee53
- INCBIN "maps/WhirlIslandNE.blk"
-; 0xaeead
-
-WhirlIslandSW_BlockData: ; 0xaeead
- INCBIN "maps/WhirlIslandSW.blk"
-; 0xaef07
-
-WhirlIslandCave_BlockData: ; 0xaef07
- INCBIN "maps/WhirlIslandCave.blk"
-; 0xaef34
-
-WhirlIslandSE_BlockData: ; 0xaef34
- INCBIN "maps/WhirlIslandSE.blk"
-; 0xaef61
-
-WhirlIslandB1F_BlockData: ; 0xaef61
- INCBIN "maps/WhirlIslandB1F.blk"
-; 0xaf0c9
-
-WhirlIslandB2F_BlockData: ; 0xaf0c9
- INCBIN "maps/WhirlIslandB2F.blk"
-; 0xaf17d
-
-WhirlIslandLugiaChamber_BlockData: ; 0xaf17d
- INCBIN "maps/WhirlIslandLugiaChamber.blk"
-; 0xaf1d7
-
-SilverCaveRoom1_BlockData: ; 0xaf1d7
- INCBIN "maps/SilverCaveRoom1.blk"
-; 0xaf28b
-
-SilverCaveRoom2_BlockData: ; 0xaf28b
- INCBIN "maps/SilverCaveRoom2.blk"
-; 0xaf399
-
-SilverCaveRoom3_BlockData: ; 0xaf399
- INCBIN "maps/SilverCaveRoom3.blk"
-; 0xaf44d
-
-BetaRocketHideout1_BlockData: ; 0xaf44d
- INCBIN "maps/BetaRocketHideout1.blk"
-; 0xaf55b
-
-BetaRocketHideout2_BlockData: ; 0xaf55b
- INCBIN "maps/BetaRocketHideout2.blk"
-; 0xaf669
-
-BetaEmptyHouse_BlockData: ; 0xaf669
- INCBIN "maps/BetaEmptyHouse.blk"
-; 0xaf777
-
-BetaRocketHideout3_BlockData: ; 0xaf777
- INCBIN "maps/BetaRocketHideout3.blk"
-; 0xaf885
-
-MahoganyMart1F_BlockData: ; 0xaf885
- INCBIN "maps/MahoganyMart1F.blk"
-; 0xaf895
-
-TeamRocketBaseB1F_BlockData: ; 0xaf895
- INCBIN "maps/TeamRocketBaseB1F.blk"
-; 0xaf91c
-
-TeamRocketBaseB2F_BlockData: ; 0xaf91c
- INCBIN "maps/TeamRocketBaseB2F.blk"
-; 0xaf9a3
-
-TeamRocketBaseB3F_BlockData: ; 0xaf9a3
- INCBIN "maps/TeamRocketBaseB3F.blk"
-; 0xafa2a
-
-BetaRoute23EarlyVersion_BlockData: ; 0xafa2a
- INCBIN "maps/BetaRoute23EarlyVersion.blk"
-; 0xafa84
-
-IndigoPlateauPokeCenter1F_BlockData: ; 0xafa84
- INCBIN "maps/IndigoPlateauPokeCenter1F.blk"
-; 0xafac3
-
-WillsRoom_BlockData: ; 0xafac3
- INCBIN "maps/WillsRoom.blk"
-; 0xafaf0
-
-KogasRoom_BlockData: ; 0xafaf0
- INCBIN "maps/KogasRoom.blk"
-; 0xafb1d
-
-BrunosRoom_BlockData: ; 0xafb1d
- INCBIN "maps/BrunosRoom.blk"
-; 0xafb4a
-
-KarensRoom_BlockData: ; 0xafb4a
- INCBIN "maps/KarensRoom.blk"
-; 0xafb77
-
-AzaleaGym_BlockData: ; 0xafb77
- INCBIN "maps/AzaleaGym.blk"
-; 0xafb9f
-
-VioletGym_BlockData: ; 0xafb9f
- INCBIN "maps/VioletGym.blk"
-; 0xafbc7
-
-GoldenrodGym_BlockData: ; 0xafbc7
- INCBIN "maps/GoldenrodGym.blk"
-; 0xafc21
-
-EcruteakGym_BlockData: ; 0xafc21
- INCBIN "maps/EcruteakGym.blk"
-; 0xafc4e
-
-MahoganyGym_BlockData: ; 0xafc4e
- INCBIN "maps/MahoganyGym.blk"
-; 0xafc7b
-
-OlivineGym_BlockData: ; 0xafc7b
- INCBIN "maps/OlivineGym.blk"
-; 0xafca3
-
-BetaUnknown_BlockData: ; 0xafca3
- INCBIN "maps/BetaUnknown.blk"
-; 0xafcb7
-
-CianwoodGym_BlockData: ; 0xafcb7
- INCBIN "maps/CianwoodGym.blk"
-; 0xafce4
-
-BlackthornGym1F_BlockData: ; 0xafce4
- INCBIN "maps/BlackthornGym1F.blk"
-; 0xafd11
-
-BlackthornGym2F_BlockData: ; 0xafd11
- INCBIN "maps/BlackthornGym2F.blk"
-; 0xafd3e
-
-OlivineLighthouse1F_BlockData: ; 0xafd3e
- INCBIN "maps/OlivineLighthouse1F.blk"
-; 0xafd98
-
-OlivineLighthouse2F_BlockData: ; 0xafd98
- INCBIN "maps/OlivineLighthouse2F.blk"
-; 0xafdf2
-
-OlivineLighthouse3F_BlockData: ; 0xafdf2
- INCBIN "maps/OlivineLighthouse3F.blk"
-; 0xafe4c
-
-OlivineLighthouse4F_BlockData: ; 0xafe4c
- INCBIN "maps/OlivineLighthouse4F.blk"
-; 0xafea6
-
-OlivineLighthouse5F_BlockData: ; 0xafea6
- INCBIN "maps/OlivineLighthouse5F.blk"
-; 0xaff00
-
-OlivineLighthouse6F_BlockData: ; 0xaff00
- INCBIN "maps/OlivineLighthouse6F.blk"
-; 0xaff5a
-
-
SECTION "bank2C",ROMX,BANK[$2C]
-BetaCave2_BlockData: ; 0xb0000
- INCBIN "maps/BetaCave2.blk"
-; 0xb0023
+INCLUDE "maps/blockdata_3.asm"
-SlowpokeWellB1F_BlockData: ; 0xb0023
- INCBIN "maps/SlowpokeWellB1F.blk"
-; 0xb007d
-SlowpokeWellB2F_BlockData: ; 0xb007d
- INCBIN "maps/SlowpokeWellB2F.blk"
-; 0xb00d7
-
-IlexForest_BlockData: ; 0xb00d7
- INCBIN "maps/IlexForest.blk"
-; 0xb026c
-
-DarkCaveVioletEntrance_BlockData: ; 0xb026c
- INCBIN "maps/DarkCaveVioletEntrance.blk"
-; 0xb03d4
-
-DarkCaveBlackthornEntrance_BlockData: ; 0xb03d4
- INCBIN "maps/DarkCaveBlackthornEntrance.blk"
-; 0xb04e2
-
-RuinsofAlphResearchCenter_BlockData: ; 0xb04e2
- INCBIN "maps/RuinsofAlphResearchCenter.blk"
-; 0xb04f2
-
-GoldenrodBikeShop_BlockData: ; 0xb04f2
- INCBIN "maps/GoldenrodBikeShop.blk"
-; 0xb0502
-
-DanceTheatre_BlockData: ; 0xb0502
- INCBIN "maps/DanceTheatre.blk"
-; 0xb052c
-
-EcruteakHouse_BlockData: ; 0xb052c
- INCBIN "maps/EcruteakHouse.blk"
-; 0xb0586
-
-GoldenrodGameCorner_BlockData: ; 0xb0586
- INCBIN "maps/GoldenrodGameCorner.blk"
-; 0xb05cc
-
-Route35NationalParkgate_BlockData: ; 0xb05cc
- INCBIN "maps/Route35NationalParkgate.blk"
-; 0xb05dc
-
-Route36NationalParkgate_BlockData: ; 0xb05dc
- INCBIN "maps/Route36NationalParkgate.blk"
-; 0xb05f0
-
-FastShip1F_BlockData: ; 0xb05f0
- INCBIN "maps/FastShip1F.blk"
-; 0xb0680
-
-FastShipB1F_BlockData: ; 0xb0680
- INCBIN "maps/FastShipB1F.blk"
-; 0xb0700
-
-BetaSsAquaInsideCutOut_BlockData: ; 0xb0700
- INCBIN "maps/BetaSsAquaInsideCutOut.blk"
-; 0xb0710
-
-FastShipCabins_NNW_NNE_NE_BlockData: ; 0xb0710
- INCBIN "maps/FastShipCabins_NNW_NNE_NE.blk"
-; 0xb0750
-
-FastShipCabins_SW_SSW_NW_BlockData: ; 0xb0750
- INCBIN "maps/FastShipCabins_SW_SSW_NW.blk"
-; 0xb0790
-
-FastShipCabins_SE_SSE_CaptainsCabin_BlockData: ; 0xb0790
- INCBIN "maps/FastShipCabins_SE_SSE_CaptainsCabin.blk"
-; 0xb07e5
-
-OlivinePort_BlockData: ; 0xb07e5
- INCBIN "maps/OlivinePort.blk"
-; 0xb0899
-
-VermilionPort_BlockData: ; 0xb0899
- INCBIN "maps/VermilionPort.blk"
-; 0xb094d
-
-OlivineCafe_BlockData: ; 0xb094d
- INCBIN "maps/OlivineCafe.blk"
-; 0xb095d
-
-KrissHouse2F_BlockData: ; 0xb095d
- INCBIN "maps/KrissHouse2F.blk"
-; 0xb0969
-
-SaffronTrainStation_BlockData: ; 0xb0969
- INCBIN "maps/SaffronTrainStation.blk"
-; 0xb09c3
-
-CeruleanGym_BlockData: ; 0xb09c3
- INCBIN "maps/CeruleanGym.blk"
-; 0xb09eb
-
-VermilionGym_BlockData: ; 0xb09eb
- INCBIN "maps/VermilionGym.blk"
-; 0xb0a18
-
-SaffronGym_BlockData: ; 0xb0a18
- INCBIN "maps/SaffronGym.blk"
-; 0xb0a72
-
-PowerPlant_BlockData: ; 0xb0a72
- INCBIN "maps/PowerPlant.blk"
-; 0xb0acc
-
-PokemonFanClub_BlockData: ; 0xb0acc
- INCBIN "maps/PokemonFanClub.blk"
-; 0xb0ae0
-
-FightingDojo_BlockData: ; 0xb0ae0
- INCBIN "maps/FightingDojo.blk"
-; 0xb0afe
-
-SilphCo1F_BlockData: ; 0xb0afe
- INCBIN "maps/SilphCo1F.blk"
-; 0xb0b1e
-
-ViridianGym_BlockData: ; 0xb0b1e
- INCBIN "maps/ViridianGym.blk"
-; 0xb0b4b
-
-TrainerHouse1F_BlockData: ; 0xb0b4b
- INCBIN "maps/TrainerHouse1F.blk"
-; 0xb0b6e
-
-TrainerHouseB1F_BlockData: ; 0xb0b6e
- INCBIN "maps/TrainerHouseB1F.blk"
-; 0xb0b96
-
-RedsHouse1F_BlockData: ; 0xb0b96
- INCBIN "maps/RedsHouse1F.blk"
-; 0xb0ba6
-
-RedsHouse2F_BlockData: ; 0xb0ba6
- INCBIN "maps/RedsHouse2F.blk"
-; 0xb0bb6
-
-OaksLab_BlockData: ; 0xb0bb6
- INCBIN "maps/OaksLab.blk"
-; 0xb0bd4
-
-MrFujisHouse_BlockData: ; 0xb0bd4
- INCBIN "maps/MrFujisHouse.blk"
-; 0xb0be8
-
-LavRadioTower1F_BlockData: ; 0xb0be8
- INCBIN "maps/LavRadioTower1F.blk"
-; 0xb0c10
-
-SilverCaveItemRooms_BlockData: ; 0xb0c10
- INCBIN "maps/SilverCaveItemRooms.blk"
-; 0xb0c6a
-
-DayCare_BlockData: ; 0xb0c6a
- INCBIN "maps/DayCare.blk"
-; 0xb0c7e
-
-SoulHouse_BlockData: ; 0xb0c7e
- INCBIN "maps/SoulHouse.blk"
-; 0xb0c92
-
-PewterGym_BlockData: ; 0xb0c92
- INCBIN "maps/PewterGym.blk"
-; 0xb0cb5
-
-CeladonGym_BlockData: ; 0xb0cb5
- INCBIN "maps/CeladonGym.blk"
-; 0xb0ce2
-
-BetaHouse2_BlockData: ; 0xb0ce2
- INCBIN "maps/BetaHouse2.blk"
-; 0xb0cf6
-
-CeladonCafe_BlockData: ; 0xb0cf6
- INCBIN "maps/CeladonCafe.blk"
-; 0xb0d0e
-
-BetaCeladonMansion_BlockData: ; 0xb0d0e
- INCBIN "maps/BetaCeladonMansion.blk"
-; 0xb0d26
-
-RockTunnel1F_BlockData: ; 0xb0d26
- INCBIN "maps/RockTunnel1F.blk"
-; 0xb0e34
-
-RockTunnelB1F_BlockData: ; 0xb0e34
- INCBIN "maps/RockTunnelB1F.blk"
-; 0xb0f42
-
-DiglettsCave_BlockData: ; 0xb0f42
- INCBIN "maps/DiglettsCave.blk"
-; 0xb0ff6
-
-MountMoon_BlockData: ; 0xb0ff6
- INCBIN "maps/MountMoon.blk"
-; 0xb107d
-
-SeafoamGym_BlockData: ; 0xb107d
- INCBIN "maps/SeafoamGym.blk"
-; 0xb1091
-
-MrPokemonsHouse_BlockData: ; 0xb1091
- INCBIN "maps/MrPokemonsHouse.blk"
-; 0xb10a1
-
-VictoryRoadGate_BlockData: ; 0xb10a1
- INCBIN "maps/VictoryRoadGate.blk"
-; 0xb10fb
-
-OlivinePortPassage_BlockData: ; 0xb10fb
- INCBIN "maps/OlivinePortPassage.blk"
-; 0xb1155
-
-FuchsiaGym_BlockData: ; 0xb1155
- INCBIN "maps/FuchsiaGym.blk"
-; 0xb1182
-
-SafariZoneBeta_BlockData: ; 0xb1182
- INCBIN "maps/SafariZoneBeta.blk"
-; 0xb1236
-
-Underground_BlockData: ; 0xb1236
- INCBIN "maps/Underground.blk"
-; 0xb1260
-
-Route39Barn_BlockData: ; 0xb1260
- INCBIN "maps/Route39Barn.blk"
-; 0xb1270
-
-VictoryRoad_BlockData: ; 0xb1270
- INCBIN "maps/VictoryRoad.blk"
-; 0xb13d8
-
-Route23_BlockData: ; 0xb13d8
- INCBIN "maps/Route23.blk"
-; 0xb1432
-
-LancesRoom_BlockData: ; 0xb1432
- INCBIN "maps/LancesRoom.blk"
-; 0xb146e
-
-HallOfFame_BlockData: ; 0xb146e
- INCBIN "maps/HallOfFame.blk"
-; 0xb1491
-
-CopycatsHouse1F_BlockData: ; 0xb1491
- INCBIN "maps/CopycatsHouse1F.blk"
-; 0xb14a1
-
-CopycatsHouse2F_BlockData: ; 0xb14a1
- INCBIN "maps/CopycatsHouse2F.blk"
-; 0xb14b0
-
-GoldenrodFlowerShop_BlockData: ; 0xb14b0
- INCBIN "maps/GoldenrodFlowerShop.blk"
-; 0xb14c0
-
-MountMoonSquare_BlockData: ; 0xb14c0
- INCBIN "maps/MountMoonSquare.blk"
-; 0xb1547
-
-WiseTriosRoom_BlockData: ; 0xb1547
- INCBIN "maps/WiseTriosRoom.blk"
-; 0xb1557
-
-DragonsDen1F_BlockData: ; 0xb1557
- INCBIN "maps/DragonsDen1F.blk"
-; 0xb1584
-
-DragonsDenB1F_BlockData: ; 0xb1584
- INCBIN "maps/DragonsDenB1F.blk"
-; 0xb16ec
-
-TohjoFalls_BlockData: ; 0xb16ec
- INCBIN "maps/TohjoFalls.blk"
-; 0xb1773
-
-RuinsofAlphHoOhItemRoom_BlockData: ; 0xb1773
- INCBIN "maps/RuinsofAlphHoOhItemRoom.blk"
-; 0xb1787
-
-RuinsofAlphHoOhWordRoom_BlockData: ; 0xb1787
- INCBIN "maps/RuinsofAlphHoOhWordRoom.blk"
-; 0xb17ff
-
-RuinsofAlphKabutoWordRoom_BlockData: ; 0xb17ff
- INCBIN "maps/RuinsofAlphKabutoWordRoom.blk"
-; 0xb1845
-
-RuinsofAlphOmanyteWordRoom_BlockData: ; 0xb1845
- INCBIN "maps/RuinsofAlphOmanyteWordRoom.blk"
-; 0xb1895
-
-RuinsofAlphAerodactylWordRoom_BlockData: ; 0xb1895
- INCBIN "maps/RuinsofAlphAerodactylWordRoom.blk"
-; 0xb18db
-
-DragonShrine_BlockData: ; 0xb18db
- INCBIN "maps/DragonShrine.blk"
-; 0xb18f4
-
-BattleTower1F_BlockData: ; 0xb18f4
- INCBIN "maps/BattleTower1F.blk"
-; 0xb191c
-
-BattleTowerBattleRoom_BlockData: ; 0xb191c
- INCBIN "maps/BattleTowerBattleRoom.blk"
-; 0xb192c
-
-GoldenrodPokeComCenter2FMobile_BlockData: ; 0xb192c
- INCBIN "maps/GoldenrodPokeComCenter2FMobile.blk"
-; 0xb1a2c
-
-MobileTradeRoomMobile_BlockData: ; 0xb1a2c
- INCBIN "maps/MobileTradeRoomMobile.blk"
-; 0xb1a40
-
-MobileBattleRoom_BlockData: ; 0xb1a40
- INCBIN "maps/MobileBattleRoom.blk"
-; 0xb1a54
-
-BattleTowerHallway_BlockData: ; 0xb1a54
- INCBIN "maps/BattleTowerHallway.blk"
-; 0xb1a6a
-
-BattleTowerElevator_BlockData: ; 0xb1a6a
- INCBIN "maps/BattleTowerElevator.blk"
-; 0xb1a6e
-
-BattleTowerOutside_BlockData: ; 0xb1a6e
- INCBIN "maps/BattleTowerOutside.blk"
-; 0xb1afa
-
-BetaBlank_BlockData: ; 0xb1afa
- INCBIN "maps/BetaBlank.blk"
-; 0xb1b22
-
-GoldenrodDeptStoreRoof_BlockData: ; 0xb1b22
- INCBIN "maps/GoldenrodDeptStoreRoof.blk"
-; 0xb1b42
-
-
SECTION "bank2D",ROMX,BANK[$2D]
-Tileset21GFX: ; 0xb4000
-INCBIN "gfx/tilesets/21.lz"
-; 0xb4893
+INCLUDE "tilesets/data_5.asm"
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
-Tileset21Meta: ; 0xb48a0
-INCBIN "tilesets/21_metatiles.bin"
-; 0xb4ca0
-
-Tileset21Coll: ; 0xb4ca0
-INCBIN "tilesets/21_collision.bin"
-; 0xb4da0
-
-Tileset22GFX: ; 0xb4da0
-INCBIN "gfx/tilesets/22.lz"
-; 0xb50d1
-
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
-
-Tileset22Meta: ; 0xb50e0
-INCBIN "tilesets/22_metatiles.bin"
-; 0xb54e0
-
-Tileset22Coll: ; 0xb54e0
-INCBIN "tilesets/22_collision.bin"
-; 0xb55e0
-
-Tileset08GFX: ; 0xb55e0
-INCBIN "gfx/tilesets/08.lz"
-; 0xb59db
-
- db $00
- db $00
- db $00
- db $00
- db $00
-
-Tileset08Meta: ; 0xb59e0
-INCBIN "tilesets/08_metatiles.bin"
-; 0xb5de0
-
-Tileset08Coll: ; 0xb5de0
-INCBIN "tilesets/08_collision.bin"
-; 0xb5ee0
-
-Tileset02GFX: ; 0xb5ee0
-Tileset04GFX: ; 0xb5ee0
-INCBIN "gfx/tilesets/04.lz"
-; 0xb6ae7
-
- db $00
-
-Tileset02Meta: ; 0xb6ae8
-INCBIN "tilesets/02_metatiles.bin"
-; 0xb72e8
-
-Tileset02Coll: ; 0xb72e8
-INCBIN "tilesets/02_collision.bin"
-; 0xb74e8
-
-Tileset16GFX: ; 0xb74e8
-INCBIN "gfx/tilesets/16.lz"
-; 0xb799a
-
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
-
-Tileset16Meta: ; 0xb79a8
-INCBIN "tilesets/16_metatiles.bin"
-; 0xb7da8
-
-Tileset16Coll: ; 0xb7da8
-INCBIN "tilesets/16_collision.bin"
-; 0xb7ea8
-
-
SECTION "bank2E",ROMX,BANK[$2E]
Functionb8000: ; b8000
@@ -62199,8 +70186,44 @@
db $ff ; end
; b83e5
-INCBIN "baserom.gbc", $b83e5, $b9229 - $b83e5
+INCBIN "baserom.gbc", $b83e5, $b8f8f - $b83e5
+Functionb8f8f: ; b8f8f
+ ld a, c
+ swap a
+ and $f
+ ld hl, $4ff9
+ ld d, $0
+ ld e, a
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, [hli]
+ ld b, a
+ push hl
+ inc hl
+ ld a, c
+ and $f
+ ld c, a
+ push hl
+ ld hl, $4fb8
+ ld e, b
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ pop de
+ call _hl_
+ pop hl
+ ld c, [hl]
+ ret
+; b8fb8
+
+INCBIN "baserom.gbc", $b8fb8, $b9229 - $b8fb8
+
Functionb9229: ; b9229
ld a, [CurPartyMon]
ld hl, $a600
@@ -63193,7 +71216,7 @@
; cc8d3
Functioncc8d3: ; cc8d3
- ld hl, $d100
+ ld hl, LYOverrides
ld bc, $0354
.asm_cc8d9
ld [hl], $0
@@ -63732,123 +71755,648 @@
SECTION "bank37",ROMX,BANK[$37]
-Tileset31GFX: ; 0xdc000
-INCBIN "gfx/tilesets/31.lz"
-; 0xdc3ce
+INCLUDE "tilesets/data_6.asm"
- db $00
- db $00
-Tileset18GFX: ; 0xdc3d0
-INCBIN "gfx/tilesets/18.lz"
-; 0xdcc4e
+SECTION "bank38",ROMX,BANK[$38]
- db $00
- db $00
+Functione0000: ; e0000
+ push de
+ xor a
+ call GetSRAMBank
+ ld hl, $a000
+ ld bc, $0000
+.asm_e000b
+ push bc
+ push hl
+ push bc
+ ld de, DefaultFlypoint
+ call Functione004e
+ call Functione0057
+ ld hl, $408b
+ pop bc
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld e, a
+ ld d, [hl]
+ ld hl, $d012
+ call Functione004e
+ pop hl
+ ld bc, $0010
+ add hl, bc
+ pop bc
+ inc c
+ ld a, c
+ cp $31
+ jr c, .asm_e000b
+ ld hl, OverworldMap
+ ld de, $a000
+ ld bc, $0310
+ call CopyBytes
+ pop hl
+ ld de, $a000
+ ld c, $31
+ ld a, [hROMBank]
+ ld b, a
+ call Get2bpp
+ call CloseSRAM
+ ret
+; e004e
-Tileset18Meta: ; 0xdcc50
-INCBIN "tilesets/18_metatiles.bin"
-; 0xdd050
+Functione004e: ; e004e
+ ld c, $10
+.asm_e0050
+ ld a, [hli]
+ ld [de], a
+ inc de
+ dec c
+ jr nz, .asm_e0050
+ ret
+; e0057
-Tileset18Coll: ; 0xdd050
-INCBIN "tilesets/18_collision.bin"
-; 0xdd150
+Functione0057: ; e0057
+ ld hl, $d012
+ ld e, $80
+ ld d, $8
+.asm_e005e
+ push hl
+ ld hl, DefaultFlypoint
+ call Functione0078
+ pop hl
+ ld a, b
+ ld [hli], a
+ push hl
+ ld hl, $d003
+ call Functione0078
+ pop hl
+ ld a, b
+ ld [hli], a
+ srl e
+ dec d
+ jr nz, .asm_e005e
+ ret
+; e0078
-Tileset05GFX: ; 0xdd150
-INCBIN "gfx/tilesets/05.lz"
-; 0xdd5f8
+Functione0078: ; e0078
+ ld b, $0
+ ld c, $8
+.asm_e007c
+ ld a, [hli]
+ and e
+ jr z, .asm_e0083
+ scf
+ jr .asm_e0084
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
+.asm_e0083
+ and a
-Tileset05Meta: ; 0xdd600
-INCBIN "tilesets/05_metatiles.bin"
-; 0xdda00
+.asm_e0084
+ rr b
+ inc hl
+ dec c
+ jr nz, .asm_e007c
+ ret
+; e008b
-Tileset05Coll: ; 0xdda00
-INCBIN "tilesets/05_collision.bin"
-; 0xddb00
+INCBIN "baserom.gbc", $e008b, $e1190 - $e008b
-Tileset19GFX: ; 0xddb00
-INCBIN "gfx/tilesets/19.lz"
-; 0xddf64
+Functione1190: ; e1190
+ ld a, [$ffaa]
+ push af
+ ld a, $1
+ ld [$ffaa], a
+ call WhiteBGMap
+ call ClearTileMap
+ call ClearSprites
+ xor a
+ ld [hBGMapMode], a
+ call DisableLCD
+ ld hl, EnemyMoveAnimation
+ ld bc, $01e0
+ xor a
+ call ByteFill
+ ld hl, $57c5
+ ld de, $8e00
+ ld bc, $0040
+ call CopyBytes
+ ld hl, $5805
+ ld de, $8ed0
+ call Decompress
+ call Functione17a3
+ ld hl, TileMap
+ ld bc, $0168
+ ld a, $ee
+ call ByteFill
+ ld hl, $c4e0
+ ld bc, $0c0c
+ ld a, $ef
+ call Functione13ee
+ call Functione124e
+ call Functione13fe
+ call Functione127d
+ xor a
+ ld [hSCY], a
+ ld [hSCX], a
+ ld [rWY], a
+ ld [$cf63], a
+ ld [$cf64], a
+ ld [$cf65], a
+ ld [$cf66], a
+ ld a, $93
+ ld [rLCDC], a
+ call WaitBGMap
+ ld b, $18
+ call GetSGBLayout
+ ld a, $e4
+ call DmgToCgbBGPals
+ ld a, $24
+ call Functioncf8
+ xor a
+ ld [$d0ec], a
+ call DelayFrame
+.asm_e1217
+ call Functiona57
+ ld a, [$cf63]
+ bit 7, a
+ jr nz, .asm_e123d
+ call Functione12ca
+ ld a, [$cf64]
+ and a
+ jr nz, .asm_e1230
+ ld a, [$ff9b]
+ and $10
+ jr z, .asm_e1235
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
+.asm_e1230
+ call Functione14d9
+ jr .asm_e1238
-Tileset19Meta: ; 0xddf70
-INCBIN "tilesets/19_metatiles.bin"
-; 0xde370
+.asm_e1235
+ call ClearSprites
-Tileset19Coll: ; 0xde370
-INCBIN "tilesets/19_collision.bin"
-; 0xde470
+.asm_e1238
+ call DelayFrame
+ jr .asm_e1217
-Tileset31Coll: ; 0xde470
-INCBIN "tilesets/31_collision.bin"
-; 0xde570
+.asm_e123d
+ pop af
+ ld [$ffaa], a
+ call WhiteBGMap
+ call ClearTileMap
+ call ClearSprites
+ ld a, $e3
+ ld [rLCDC], a
+ ret
+; e124e
-Tileset11GFX: ; 0xde570
-INCBIN "gfx/tilesets/11.lz"
-; 0xde98a
+Functione124e: ; e124e
+ ld c, $1
+ ld b, $10
+.asm_e1252
+ call Random
+ and $f
+ ld hl, $526d
+ ld e, a
+ ld d, $0
+ add hl, de
+ ld e, [hl]
+ ld hl, PlayerSDefLevel
+ add hl, de
+ ld a, [hl]
+ and a
+ jr nz, .asm_e1252
+ ld [hl], c
+ inc c
+ dec b
+ jr nz, .asm_e1252
+ ret
+; e126d
- db $00
- db $00
- db $00
- db $00
- db $00
- db $00
+INCBIN "baserom.gbc", $e126d, $e127d - $e126d
-Tileset11Meta: ; 0xde990
-INCBIN "tilesets/11_metatiles.bin"
-; 0xded90
+Functione127d: ; e127d
+ call Functione128d
+ ld hl, $c5e5
+ ld a, $f6
+ ld c, $a
+.asm_e1287
+ ld [hli], a
+ inc a
+ dec c
+ jr nz, .asm_e1287
+ ret
+; e128d
-Tileset11Coll: ; 0xded90
-INCBIN "tilesets/11_collision.bin"
-; 0xdee90
+Functione128d: ; e128d
+ ld hl, $c5d0
+ ld a, $f0
+ ld [hli], a
+ ld bc, $000a
+ ld a, $f1
+ call ByteFill
+ ld hl, $c5db
+ ld a, $f2
+ ld [hli], a
+ ld hl, $c5e4
+ ld a, $f3
+ ld [hli], a
+ ld bc, $000a
+ ld a, $ef
+ call ByteFill
+ ld hl, $c5ef
+ ld a, $f3
+ ld [hli], a
+ ld hl, $c5f8
+ ld a, $f4
+ ld [hli], a
+ ld bc, $000a
+ ld a, $f1
+ call ByteFill
+ ld hl, $c603
+ ld a, $f5
+ ld [hl], a
+ ret
+; e12ca
-Tileset04Meta: ; 0xdee90
-INCBIN "tilesets/04_metatiles.bin"
-; 0xdf690
+Functione12ca: ; e12ca
+ ld a, [$cf63]
+ ld e, a
+ ld d, $0
+ ld hl, $52d9
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; e12d9
-Tileset04Coll: ; 0xdf690
-INCBIN "tilesets/04_collision.bin"
-; 0xdf890
+INCBIN "baserom.gbc", $e12d9, $e13ee - $e12d9
-Tileset32Meta: ; 0xdf890
-INCBIN "tilesets/32_metatiles.bin"
-; 0xdfc90
+Functione13ee: ; e13ee
+ ld de, $0014
+.asm_e13f1
+ push bc
+ push hl
+.asm_e13f3
+ ld [hli], a
+ dec c
+ jr nz, .asm_e13f3
+ pop hl
+ add hl, de
+ pop bc
+ dec b
+ jr nz, .asm_e13f1
+ ret
+; e13fe
-Tileset32Coll: ; 0xdfc90
-Tileset33Coll: ; 0xdfc90
-Tileset34Coll: ; 0xdfc90
-Tileset35Coll: ; 0xdfc90
-Tileset36Coll: ; 0xdfc90
-INCBIN "tilesets/36_collision.bin"
-; 0xdfd90
+Functione13fe: ; e13fe
+ xor a
+ ld [$cf65], a
+ ld c, $24
+.asm_e1404
+ push bc
+ call Functione1475
+ ld [$cf66], a
+ and a
+ jr z, .asm_e1413
+ call Functione141f
+ jr .asm_e1416
+.asm_e1413
+ call Functione1441
-SECTION "bank38",ROMX,BANK[$38]
+.asm_e1416
+ ld hl, $cf65
+ inc [hl]
+ pop bc
+ dec c
+ jr nz, .asm_e1404
+ ret
+; e141f
-INCBIN "baserom.gbc", $e0000, $e37f9 - $e0000
+Functione141f: ; e141f
+ ld a, $2
+ call Functione1463
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ push hl
+ call Functione1481
+ pop hl
+ ld de, $0014
+ ld b, $3
+.asm_e1431
+ ld c, $3
+ push hl
+.asm_e1434
+ ld [hli], a
+ inc a
+ dec c
+ jr nz, .asm_e1434
+ add $9
+ pop hl
+ add hl, de
+ dec b
+ jr nz, .asm_e1431
+ ret
+; e1441
+Functione1441: ; e1441
+ ld a, $2
+ call Functione1463
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ push hl
+ ld a, $4
+ call Functione1463
+ ld a, [hl]
+ pop hl
+ ld de, $0014
+ ld b, $3
+.asm_e1456
+ ld c, $3
+ push hl
+.asm_e1459
+ ld [hli], a
+ dec c
+ jr nz, .asm_e1459
+ pop hl
+ add hl, de
+ dec b
+ jr nz, .asm_e1456
+ ret
+; e1463
+Functione1463: ; e1463
+ ld e, a
+ ld d, $0
+ ld hl, $5559
+ add hl, de
+ ld a, [$cf65]
+ ld e, a
+ add hl, de
+ add hl, de
+ add hl, de
+ add hl, de
+ add hl, de
+ add hl, de
+ ret
+; e1475
+
+Functione1475: ; e1475
+ ld hl, PlayerSDefLevel
+ ld a, [$cf65]
+ ld e, a
+ ld d, $0
+ add hl, de
+ ld a, [hl]
+ ret
+; e1481
+
+Functione1481: ; e1481
+ ld a, [$cf66]
+ ld hl, $548f
+ add l
+ ld l, a
+ ld a, $0
+ adc h
+ ld h, a
+ ld a, [hl]
+ ret
+; e148f
+
+INCBIN "baserom.gbc", $e148f, $e14d9 - $e148f
+
+Functione14d9: ; e14d9
+ call Functione1481
+ ld [DefaultFlypoint], a
+ xor a
+ call Functione1463
+ ld a, [hli]
+ ld b, [hl]
+ ld c, a
+ ld a, [DefaultFlypoint]
+ cp $e0
+ jr z, .asm_e14f2
+ ld hl, $550f
+ jr .asm_e14f5
+
+.asm_e14f2
+ ld hl, $5534
+
+.asm_e14f5
+ ld de, Sprites
+.asm_e14f8
+ ld a, [hli]
+ cp $ff
+ ret z
+ add b
+ ld [de], a
+ inc de
+ ld a, [hli]
+ add c
+ ld [de], a
+ inc de
+ ld a, [DefaultFlypoint]
+ add [hl]
+ ld [de], a
+ inc hl
+ inc de
+ ld a, [hli]
+ ld [de], a
+ inc de
+ jr .asm_e14f8
+; e150f
+
+INCBIN "baserom.gbc", $e150f, $e1631 - $e150f
+
+Functione1631: ; e1631
+ ld hl, VTiles2
+ ld de, VTiles0
+ ld b, $6
+.asm_e1639
+ push bc
+ push hl
+ push hl
+ call Functione1654
+ pop hl
+ ld bc, $0008
+ add hl, bc
+ call Functione1654
+ pop hl
+ ld bc, $0060
+ add hl, bc
+ pop bc
+ dec b
+ jr nz, .asm_e1639
+ call Functione16c7
+ ret
+; e1654
+
+Functione1654: ; e1654
+ ld c, $6
+.asm_e1656
+ push bc
+ push hl
+ push hl
+ ld c, $4
+.asm_e165b
+ push bc
+ ld a, [hli]
+ and $f0
+ swap a
+ call Functione16aa
+ ld c, a
+ ld a, [hli]
+ and $f0
+ swap a
+ call Functione16aa
+ ld b, a
+ ld a, c
+ ld [de], a
+ inc de
+ ld a, b
+ ld [de], a
+ inc de
+ ld a, c
+ ld [de], a
+ inc de
+ ld a, b
+ ld [de], a
+ inc de
+ pop bc
+ dec c
+ jr nz, .asm_e165b
+ pop hl
+ ld c, $4
+.asm_e1681
+ push bc
+ ld a, [hli]
+ and $f
+ call Functione16aa
+ ld c, a
+ ld a, [hli]
+ and $f
+ call Functione16aa
+ ld b, a
+ ld a, c
+ ld [de], a
+ inc de
+ ld a, b
+ ld [de], a
+ inc de
+ ld a, c
+ ld [de], a
+ inc de
+ ld a, b
+ ld [de], a
+ inc de
+ pop bc
+ dec c
+ jr nz, .asm_e1681
+ pop hl
+ ld bc, $0010
+ add hl, bc
+ pop bc
+ dec c
+ jr nz, .asm_e1656
+ ret
+; e16aa
+
+Functione16aa: ; e16aa
+ push hl
+ ld hl, $56b7
+ add l
+ ld l, a
+ ld a, $0
+ adc h
+ ld h, a
+ ld a, [hl]
+ pop hl
+ ret
+; e16b7
+
+INCBIN "baserom.gbc", $e16b7, $e16c7 - $e16b7
+
+Functione16c7: ; e16c7
+ ld hl, $5703
+ ld a, $8
+.asm_e16cc
+ push af
+ push hl
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ call Functione16e2
+ pop hl
+ inc hl
+ inc hl
+ inc hl
+ inc hl
+ pop af
+ dec a
+ jr nz, .asm_e16cc
+ ret
+; e16e2
+
+Functione16e2: ; e16e2
+ ld bc, $0404
+.asm_e16e5
+ push bc
+.asm_e16e6
+ push de
+ push hl
+ ld b, $10
+.asm_e16ea
+ ld a, [de]
+ or [hl]
+ ld [hli], a
+ inc de
+ dec b
+ jr nz, .asm_e16ea
+ pop hl
+ ld de, $0030
+ add hl, de
+ pop de
+ dec c
+ jr nz, .asm_e16e6
+ ld bc, $0180
+ add hl, bc
+ pop bc
+ dec b
+ jr nz, .asm_e16e5
+ ret
+; e1703
+
+INCBIN "baserom.gbc", $e1703, $e17a3 - $e1703
+
+Functione17a3: ; e17a3
+ ld a, [ScriptVar]
+ and $3
+ ld e, a
+ ld d, $0
+ ld hl, $57bd
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld de, VTiles2
+ call Decompress
+ call Functione1631
+ ret
+; e17bd
+
+INCBIN "baserom.gbc", $e17bd, $e37f9 - $e17bd
+
+
SECTION "bank39",ROMX,BANK[$39]
CopyrightGFX: ; e4000
@@ -64916,7 +73464,7 @@
Music_RocketBattle: INCLUDE "audio/music/rocketbattle.asm"
Music_ElmsLab: INCLUDE "audio/music/elmslab.asm"
Music_DarkCave: INCLUDE "audio/music/darkcave.asm"
-Music_JohtoGymBattle: INCLUDE "audio/music/johtogymleaderbattle.asm"
+Music_JohtoGymBattle: INCLUDE "audio/music/johtogymbattle.asm"
Music_ChampionBattle: INCLUDE "audio/music/championbattle.asm"
Music_SSAqua: INCLUDE "audio/music/ssaqua.asm"
Music_NewBarkTown: INCLUDE "audio/music/newbarktown.asm"
@@ -64935,9 +73483,9 @@
Music_Route1: INCLUDE "audio/music/route1.asm"
Music_Route3: INCLUDE "audio/music/route3.asm"
Music_Route12: INCLUDE "audio/music/route12.asm"
-Music_KantoGymBattle: INCLUDE "audio/music/kantogymleaderbattle.asm"
+Music_KantoGymBattle: INCLUDE "audio/music/kantogymbattle.asm"
Music_KantoTrainerBattle: INCLUDE "audio/music/kantotrainerbattle.asm"
-Music_KantoWildBattle: INCLUDE "audio/music/kantowildpokemonbattle.asm"
+Music_KantoWildBattle: INCLUDE "audio/music/kantowildbattle.asm"
Music_PokemonCenter: INCLUDE "audio/music/pokemoncenter.asm"
Music_LookLass: INCLUDE "audio/music/looklass.asm"
Music_LookOfficer: INCLUDE "audio/music/lookofficer.asm"
@@ -64954,15 +73502,15 @@
Music_Route37: INCLUDE "audio/music/route37.asm"
Music_RocketHideout: INCLUDE "audio/music/rockethideout.asm"
Music_DragonsDen: INCLUDE "audio/music/dragonsden.asm"
-Music_RuinsOfAlphRadio: INCLUDE "audio/music/ruinsofalphradiosignal.asm"
+Music_RuinsOfAlphRadio: INCLUDE "audio/music/ruinsofalphradio.asm"
Music_LookBeauty: INCLUDE "audio/music/lookbeauty.asm"
Music_Route26: INCLUDE "audio/music/route26.asm"
Music_EcruteakCity: INCLUDE "audio/music/ecruteakcity.asm"
-Music_LakeOfRageRocketRadio:INCLUDE "audio/music/lakeofragerocketsradiosignal.asm"
+Music_LakeOfRageRocketRadio:INCLUDE "audio/music/lakeofragerocketradio.asm"
Music_MagnetTrain: INCLUDE "audio/music/magnettrain.asm"
Music_LavenderTown: INCLUDE "audio/music/lavendertown.asm"
Music_DancingHall: INCLUDE "audio/music/dancinghall.asm"
-Music_ContestResults: INCLUDE "audio/music/bugcatchingcontestresults.asm"
+Music_ContestResults: INCLUDE "audio/music/contestresults.asm"
Music_Route30: INCLUDE "audio/music/route30.asm"
SECTION "bank3C",ROMX,BANK[$3C]
@@ -65005,8 +73553,8 @@
Music_AzaleaTown: INCLUDE "audio/music/azaleatown.asm"
Music_CherrygroveCity: INCLUDE "audio/music/cherrygrovecity.asm"
Music_UnionCave: INCLUDE "audio/music/unioncave.asm"
-Music_JohtoWildBattle: INCLUDE "audio/music/johtowildpokemonbattle.asm"
-Music_JohtoWildBattleNight: INCLUDE "audio/music/johtowildpokemonbattlenight.asm"
+Music_JohtoWildBattle: INCLUDE "audio/music/johtowildbattle.asm"
+Music_JohtoWildBattleNight: INCLUDE "audio/music/johtowildbattlenight.asm"
Music_JohtoTrainerBattle: INCLUDE "audio/music/johtotrainerbattle.asm"
Music_LookYoungster: INCLUDE "audio/music/lookyoungster.asm"
Music_TinTower: INCLUDE "audio/music/tintower.asm"
@@ -65099,8 +73647,10 @@
ld hl, $9630
ld bc, $3e16
call Functiondc9
- jr .asm_fb4cc
+ jr Functionfb4cc
+; fb4b0
+Functionfb4b0: ; fb4b0
ld de, $5424
ld hl, $9610
ld b, $3e
@@ -65107,14 +73657,17 @@
ld c, $1
call Functiondc9
ret
+; fb4be
+Functionfb4be: ; fb4be
ld de, $4600
ld hl, $9600
ld bc, $3e19
call Functiondc9
- jr .asm_fb4cc
+ jr Functionfb4cc
+; fb4cc
-.asm_fb4cc
+Functionfb4cc: ; fb4cc
ld a, [TextBoxFrame]
and 7
ld bc, $0030
@@ -65141,7 +73694,7 @@
ld de, $4700
ld bc, $3e03
call Functiondc9
- call $74cc
+ call Functionfb4cc
ld de, $4ac0
ld hl, $96c0
ld bc, $3e04
@@ -65162,7 +73715,7 @@
; fb53e
Functionfb53e: ; fb53e
- call $74be
+ call Functionfb4be
ld de, $4ac0
ld hl, $96c0
ld bc, $3e04
@@ -65186,9 +73739,443 @@
ret
; fb57e
-INCBIN "baserom.gbc", $fb57e, $fba18 - $fb57e
+Functionfb57e: ; fb57e
+ ld a, [$d003]
+ ld hl, OTPartyMon1Species
+ call GetPartyLocation
+ push hl
+ ld a, [$d003]
+ inc a
+ ld c, a
+ ld b, $0
+ ld hl, OTPartyCount
+ add hl, bc
+ ld a, [hl]
+ pop hl
+ cp $fd
+ jr z, .asm_fb59c
+ cp [hl]
+ jr nz, .asm_fb5db
+.asm_fb59c
+ ld b, h
+ ld c, l
+ ld hl, $001f
+ add hl, bc
+ ld a, [hl]
+ cp $65
+ jr nc, .asm_fb5db
+ ld a, [InLinkBattle]
+ cp $1
+ jr nz, .asm_fb5d9
+ ld hl, OTPartySpecies
+ ld a, [$d003]
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [hl]
+ cp $51
+ jr z, .asm_fb5d9
+ cp $52
+ jr z, .asm_fb5d9
+ ld [CurSpecies], a
+ call GetBaseData
+ ld hl, $cbea
+ add hl, bc
+ add hl, bc
+ ld a, [BaseType1]
+ cp [hl]
+ jr nz, .asm_fb5db
+ inc hl
+ ld a, [BaseType2]
+ cp [hl]
+ jr nz, .asm_fb5db
+.asm_fb5d9
+ and a
+ ret
+
+.asm_fb5db
+ scf
+ ret
+; fb5dd
+
+Functionfb5dd: ; fb5dd
+ ld a, [DefaultFlypoint]
+ ld d, a
+ ld a, [PartyCount]
+ ld b, a
+ ld c, $0
+.asm_fb5e7
+ ld a, c
+ cp d
+ jr z, .asm_fb5f8
+ push bc
+ ld a, c
+ ld hl, PartyMon1CurHP
+ call GetPartyLocation
+ pop bc
+ ld a, [hli]
+ or [hl]
+ jr nz, .asm_fb60b
+
+.asm_fb5f8
+ inc c
+ dec b
+ jr nz, .asm_fb5e7
+ ld a, [$d003]
+ ld hl, OTPartyMon1CurHP
+ call GetPartyLocation
+ ld a, [hli]
+ or [hl]
+ jr nz, .asm_fb60b
+ scf
+ ret
+
+.asm_fb60b
+ and a
+ ret
+; fb60d
+
+Functionfb60d: ; fb60d
+ ld hl, $c4a4
+ ld de, PlayerName
+ call PlaceString
+ ld a, $14
+ ld [bc], a
+ ld hl, $c544
+ ld de, $d26b
+ call PlaceString
+ ld a, $14
+ ld [bc], a
+ ld hl, $c4bb
+ ld de, PartySpecies
+ call Functionfb634
+ ld hl, $c55b
+ ld de, OTPartySpecies
+
+Functionfb634: ; fb634
+ ld c, $0
+.asm_fb636
+ ld a, [de]
+ cp $ff
+ ret z
+ ld [$d265], a
+ push bc
+ push hl
+ push de
+ push hl
+ ld a, c
+ ld [hProduct], a
+ call GetPokemonName
+ pop hl
+ call PlaceString
+ pop de
+ inc de
+ pop hl
+ ld bc, $0014
+ add hl, bc
+ pop bc
+ inc c
+ jr .asm_fb636
+; fb656
+
+INCBIN "baserom.gbc", $fb656, $fb6ed - $fb656
+
+Functionfb6ed: ; fb6ed
+ ld hl, $780f
+ call PrintText
+ call Function1dcf
+ jp c, .asm_fb77e
+ ld hl, $7814
+ call PrintText
+ callba Function50000
+ jr c, .asm_fb77e
+ ld a, [CurPartySpecies]
+ cp $fd
+ jr z, .asm_fb783
+ call GetCurNick
+ call Functionfb78a
+ jr c, .asm_fb779
+ ld hl, $7819
+ call PrintText
+ call Function1dcf
+ jr c, .asm_fb77e
+ ld hl, $781e
+ call PrintText
+ xor a
+ ld [MonType], a
+ ld a, [CurPartySpecies]
+ ld [$d265], a
+ ld [CurSpecies], a
+ call GetBaseData
+ ld b, $0
+ ld de, StringBuffer2
+ callba Function116b7
+ call Functionfb7be
+ ld hl, $7837
+ jr c, .asm_fb76c
+ call Functionfb7d3
+ ld hl, $7837
+ jr c, .asm_fb76c
+ ld hl, PartyMon1Nickname
+ ld bc, $000b
+ ld a, [CurPartyMon]
+ call AddNTimes
+ ld e, l
+ ld d, h
+ ld hl, StringBuffer2
+ ld bc, $000b
+ call CopyBytes
+ ld hl, $7823
+
+.asm_fb76c
+ push hl
+ call GetCurNick
+ ld hl, $783c
+ call PrintText
+ pop hl
+ jr .asm_fb786
+
+.asm_fb779
+ ld hl, $782d
+ jr .asm_fb786
+
+.asm_fb77e
+ ld hl, $7828
+ jr .asm_fb786
+
+.asm_fb783
+ ld hl, $7832
+
+.asm_fb786
+ call PrintText
+ ret
+; fb78a
+
+Functionfb78a: ; fb78a
+ ld hl, PartyMon1OT
+ ld bc, $000b
+ ld a, [CurPartyMon]
+ call AddNTimes
+ ld de, PlayerName
+ ld c, $b
+ call .asm_fb7b1
+ jr c, .asm_fb7bc
+ ld hl, PartyMon1ID
+ ld bc, $0030
+ ld a, [CurPartyMon]
+ call AddNTimes
+ ld de, PlayerID
+ ld c, $2
+.asm_fb7b1
+ ld a, [de]
+ cp [hl]
+ jr nz, .asm_fb7bc
+ inc hl
+ inc de
+ dec c
+ jr nz, .asm_fb7b1
+ and a
+ ret
+
+.asm_fb7bc
+ scf
+ ret
+; fb7be
+
+Functionfb7be: ; fb7be
+ ld hl, StringBuffer2
+ ld c, $a
+.asm_fb7c3
+ ld a, [hli]
+ cp $50
+ jr z, .asm_fb7cf
+ cp $7f
+ jr nz, .asm_fb7d1
+ dec c
+ jr nz, .asm_fb7c3
+
+.asm_fb7cf
+ scf
+ ret
+
+.asm_fb7d1
+ and a
+ ret
+; fb7d3
+
+Functionfb7d3: ; fb7d3
+ ld hl, PartyMon1Nickname
+ ld bc, $000b
+ ld a, [CurPartyMon]
+ call AddNTimes
+ push hl
+ call Functionfb802
+ ld b, c
+ ld hl, StringBuffer2
+ call Functionfb802
+ pop hl
+ ld a, c
+ cp b
+ jr nz, .asm_fb7fe
+ ld de, StringBuffer2
+.asm_fb7f2
+ ld a, [de]
+ cp $50
+ jr z, .asm_fb800
+ cp [hl]
+ jr nz, .asm_fb7fe
+ inc hl
+ inc de
+ jr .asm_fb7f2
+
+.asm_fb7fe
+ and a
+ ret
+
+.asm_fb800
+ scf
+ ret
+; fb802
+
+Functionfb802: ; fb802
+ ld c, $0
+.asm_fb804
+ ld a, [hli]
+ cp $50
+ ret z
+ inc c
+ ld a, c
+ cp $a
+ jr nz, .asm_fb804
+ ret
+; fb80f
+
+INCBIN "baserom.gbc", $fb80f, $fb841 - $fb80f
+
+Functionfb841: ; fb841
+ ld a, [ScriptVar]
+ call Function37f3
+ jr c, .asm_fb876
+ ld hl, CryPitch
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld bc, $fec0
+ add hl, bc
+ ld a, l
+ ld [CryPitch], a
+ ld a, h
+ ld [CryEcho], a
+ ld hl, CryLength
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld bc, $0060
+ add hl, bc
+ ld a, l
+ ld [CryLength], a
+ ld a, h
+ ld [$c2b3], a
+ callba PlayCry
+ call WaitSFX
+
+.asm_fb876
+ ret
+; fb877
+
+Functionfb877: ; fb877
+ ld a, [$ffde]
+ push af
+ xor a
+ ld [$ffde], a
+ call LowVolume
+ call WhiteBGMap
+ call ClearTileMap
+ call Function1ad2
+ call ClearSprites
+ ld a, [$cf65]
+ push af
+ ld a, [hSCX]
+ add $5
+ ld [hSCX], a
+ xor a
+ ld [$cf65], a
+ callba Function41a7f
+ call Functiona80
+ ld a, $1
+ ld [$cf65], a
+ callba Function4424d
+ call Functiona80
+ pop af
+ ld [$cf65], a
+ call MaxVolume
+ call Function4b6
+ ld a, [hSCX]
+ add $fb
+ ld [hSCX], a
+ call Functionfb8c8
+ pop af
+ ld [$ffde], a
+ ret
+; fb8c8
+
+Functionfb8c8: ; fb8c8
+ call ClearTileMap
+ call Functione5f
+ call Functione51
+ callba Function40ab2
+ call Function3200
+ callba Function3da97
+ ld a, [hli]
+ ld [TempMonDVs], a
+ ld a, [hl]
+ ld [$d124], a
+ ld b, $1c
+ call GetSGBLayout
+ call Function32f9
+ ret
+; fb8f1
+
+Functionfb8f1: ; fb8f1
+ push bc
+ push hl
+ ld a, [$d265]
+ ld b, a
+ ld c, $0
+ ld hl, $791c
+.asm_fb8fc
+ inc c
+ ld a, [hli]
+ cp b
+ jr nz, .asm_fb8fc
+ ld a, c
+ ld [$d265], a
+ pop hl
+ pop bc
+ ret
+; fb908
+
+Functionfb908: ; fb908
+ push bc
+ push hl
+ ld a, [$d265]
+ dec a
+ ld hl, $791c
+ ld b, $0
+ ld c, a
+ add hl, bc
+ ld a, [hl]
+ ld [$d265], a
+ pop hl
+ pop bc
+ ret
+; fb91c
+
+INCBIN "baserom.gbc", $fb91c, $fba18 - $fb91c
+
+
Functionfba18: ; fba18
ld a, [UnownLetter]
ld c, a
@@ -65210,12 +74197,116 @@
ret
; fba2e
-INCBIN "baserom.gbc", $fba2e, $fbbfc - $fba2e
+INCBIN "baserom.gbc", $fba2e, $fbb32 - $fba2e
+Functionfbb32: ; fbb32
+ callba Function50000
+ jr c, .asm_fbb9e
+ ld a, [CurPartySpecies]
+ cp $81
+ jr nz, .asm_fbba4
+ ld a, [CurPartyMon]
+ ld hl, PartyMon1Species
+ ld bc, $0030
+ call AddNTimes
+ push hl
+ ld bc, $0015
+ add hl, bc
+ ld d, h
+ ld e, l
+ pop hl
+ ld bc, $0006
+ add hl, bc
+ ld b, h
+ ld c, l
+ call CalcMagikarpLength
+ call Functionfbbdb
+ callba Function105f33
+ ld hl, $7ba9
+ call PrintText
+ ld hl, Buffer1
+ ld de, $dfe8
+ ld c, $2
+ call StringCmp
+ jr nc, .asm_fbb98
+ ld hl, Buffer1
+ ld de, $dfe8
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [hl]
+ ld [de], a
+ inc de
+ ld a, [CurPartyMon]
+ ld hl, PartyMon1OT
+ call SkipNames
+ call CopyBytes
+ ld a, $3
+ ld [ScriptVar], a
+ ret
+
+.asm_fbb98
+ ld a, $2
+ ld [ScriptVar], a
+ ret
+
+.asm_fbb9e
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+
+.asm_fbba4
+ xor a
+ ld [ScriptVar], a
+ ret
+; fbba9
+
+INCBIN "baserom.gbc", $fbba9, $fbbae - $fbba9
+
+Functionfbbae: ; fbbae
+ ld hl, $96e0
+ ld de, $7bbb
+ ld bc, $3e02
+ call Request2bpp
+ ret
+; fbbbb
+
+INCBIN "baserom.gbc", $fbbbb, $fbbdb - $fbbbb
+
+Functionfbbdb: ; fbbdb
+ call Functionfbbae
+ ld hl, StringBuffer1
+ ld de, Buffer1
+ ld bc, $4102
+ call PrintNum
+ ld [hl], $6e
+ inc hl
+ ld de, Buffer2
+ ld bc, $4102
+ call PrintNum
+ ld [hl], $6f
+ inc hl
+ ld [hl], $50
+ ret
+; fbbfc
+
INCLUDE "battle/magikarp_length.asm"
-INCBIN "baserom.gbc", $fbccf, $fbced - $fbccf
+INCBIN "baserom.gbc", $fbccf, $fbcd2 - $fbccf
+Functionfbcd2: ; fbcd2
+ ld a, [$dfe8]
+ ld [Buffer1], a
+ ld a, [$dfe9]
+ ld [Buffer2], a
+ call Functionfbbdb
+ ld hl, $7ce8
+ call PrintText
+ ret
+; fbce8
+
+INCBIN "baserom.gbc", $fbce8, $fbced - $fbce8
+
INCLUDE "battle/hidden_power.asm"
INCBIN "baserom.gbc", $fbd54, $fbda4 - $fbd54
@@ -65430,43 +74521,43 @@
SECTION "bank3F",ROMX,BANK[$3F]
-DoTileAnimation: ; fc000
-; Iterate over a given pointer array of animation functions
-; (one per frame).
+_AnimateTileset: ; fc000
+; Iterate over a given pointer array of
+; animation functions (one per frame).
+
; Typically in wra1, vra0
-; Beginning of animation pointer array
- ld a, [TileSetAnim]
+ ld a, [TilesetAnim]
ld e, a
- ld a, [TileSetAnim + 1]
+ ld a, [TilesetAnim + 1]
ld d, a
-; Play this frame.
- ld a, [hTileAnimFrame] ; frame count
+ ld a, [hTileAnimFrame]
ld l, a
inc a
ld [hTileAnimFrame], a
-
-; Each pointer has:
+
ld h, 0
add hl, hl
add hl, hl
add hl, de
-; 2-byte parameter (all functions take input de)
+; 2-byte parameter
+; All functions take input de.
ld e, [hl]
inc hl
ld d, [hl]
inc hl
-
+
; Function address
ld a, [hli]
ld h, [hl]
ld l, a
-
+
jp [hl]
; fc01b
+
Tileset00Anim: ; 0xfc01b
Tileset02Anim: ; 0xfc01b
Tileset03Anim: ; 0xfc01b
@@ -65568,23 +74659,23 @@
Tileset30Anim: ; 0xfc1e7
; param, function
dw $9140, WriteTileToBuffer
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $cf41, ScrollTileRightLeft
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $9140, WriteTileFromBuffer
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $0000, TileAnimationPalette
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $9400, WriteTileToBuffer
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $cf41, ScrollTileDown
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $cf41, ScrollTileDown
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $cf41, ScrollTileDown
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $9400, WriteTileFromBuffer
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $0000, DoneTileAnimation
; 0xfc233
@@ -65591,23 +74682,23 @@
Tileset29Anim: ; 0xfc233
; param, function
dw $9350, WriteTileToBuffer
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $cf41, ScrollTileRightLeft
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $9350, WriteTileFromBuffer
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $0000, TileAnimationPalette
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $9310, WriteTileToBuffer
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $cf41, ScrollTileDown
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $cf41, ScrollTileDown
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $cf41, ScrollTileDown
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $9310, WriteTileFromBuffer
- dw $0000, $471e
+ dw $0000, Functionfc71e
dw $0000, DoneTileAnimation
; 0xfc27f
@@ -66369,9 +75460,47 @@
; fc71e
-INCBIN "baserom.gbc", $fc71e, $fc750 - $fc71e
+Functionfc71e: ; fc71e
+ ld a, [hCGB]
+ and a
+ ret z
+ ld a, [rBGP]
+ cp $e4
+ ret nz
+ ld a, [$d847]
+ cp $ff
+ ret nz
+
+ ld a, [rSVBK]
+ push af
+
+ ld a, 5
+ ld [rSVBK], a
+ ld a, $a0
+ ld [rBGPI], a
+ ld a, [$ff9b]
+ and 2
+ jr nz, .asm_fc743
+ ld hl, $d020
+ jr .asm_fc746
+
+.asm_fc743
+ ld hl, $d022
+
+.asm_fc746
+ ld a, [hli]
+ ld [rBGPD], a
+ ld a, [hli]
+ ld [rBGPD], a
+
+ pop af
+ ld [rSVBK], a
+ ret
+; fc750
+
+
SproutPillarTilePointers: ; fc750
SproutPillarTilePointer1:
dw $92d0, SproutPillarTile1
@@ -66980,9 +76109,429 @@
SECTION "bank40",ROMX,BANK[$40]
-INCBIN "baserom.gbc", $100000, $10032e - $100000
+Function100000: ; 100000
+ ld a, [rSVBK]
+ push af
+ ld a, $1
+ ld [rSVBK], a
+ call Function100022
+ call Function1000ba
+ call Function100675
+ call Function100057
+ call Function10016f
+ call Function100276
+ push bc
+ call Function100301
+ pop bc
+ pop af
+ ld [rSVBK], a
+ ret
+; 100022
+Function100022: ; 100022
+ push de
+ push bc
+ call Function100063
+ pop bc
+ pop de
+ ld a, d
+ ld [$cd21], a
+ ld a, e
+ ld [CreditsTimer], a
+ ld a, c
+ ld [$cd23], a
+ ld a, b
+ ld [$cd24], a
+ callba Function10127e
+ callba Function106462
+ callba Function106464
+ callba Function11615a
+ ld hl, VramState
+ set 1, [hl]
+ ret
+; 100057
+Function100057: ; 100057
+ call Function1000a4
+ call Function222a
+ ld hl, VramState
+ res 1, [hl]
+ ret
+; 100063
+
+Function100063: ; 100063
+ xor a
+ ld hl, BGMapBuffer
+ ld bc, $0065
+ call ByteFill
+ xor a
+ ld hl, $c300
+ ld bc, Start
+ call ByteFill
+ ld a, [rIE]
+ ld [BGMapBuffer], a
+ xor a
+ ld [$ffde], a
+ ld [hLCDStatCustom], a
+ ret
+; 100082
+
+INCBIN "baserom.gbc", $100082, $1000a4 - $100082
+
+Function1000a4: ; 1000a4
+ di
+ xor a
+ ld [$ffc9], a
+ ld [$ffe9], a
+ xor a
+ ld [$ff9e], a
+ call Function2ff7
+ xor a
+ ld [rIF], a
+ ld a, [BGMapBuffer]
+ ld [rIE], a
+ ei
+ ret
+; 1000ba
+
+Function1000ba: ; 1000ba
+.asm_1000ba
+ ld hl, $cd23
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, [$cd25]
+ ld e, a
+ ld d, $0
+ add hl, de
+ add hl, de
+ ld a, [CreditsTimer]
+ call GetFarHalfword
+ ld a, [CreditsTimer]
+ rst FarCall
+ call Function1000e8
+ call Function1000fa
+ call Function100144
+ call Function100163
+ ld a, [$cd2b]
+ and a
+ jr z, .asm_1000ba
+ call DelayFrame
+ ret
+; 1000e8
+
+Function1000e8: ; 1000e8
+ ld hl, $cd29
+ bit 7, [hl]
+ ret z
+ callba Function115dd3
+ ld hl, $cd29
+ set 6, [hl]
+ ret
+; 1000fa
+
+Function1000fa: ; 1000fa
+ ld a, [$c30d]
+ and a
+ ret z
+ ld hl, $cd29
+ bit 4, [hl]
+ ret z
+ ld a, [$cd2b]
+ and a
+ jr nz, .asm_100117
+ callba Function11619d
+ ld hl, $cd29
+ set 6, [hl]
+ ret
+
+.asm_100117
+ di
+ xor a
+ ld [rIF], a
+ ld a, [rIE]
+ and $13
+ ld [rIE], a
+ xor a
+ ld [$ffc9], a
+ ld [$ffe9], a
+ ei
+ ld a, [InLinkBattle]
+ push af
+ xor a
+ ld [InLinkBattle], a
+ ld a, $4
+ ld [$c319], a
+ callba Function11619d
+ ld hl, $cd29
+ set 6, [hl]
+ pop af
+ ld [InLinkBattle], a
+ ret
+; 100144
+
+Function100144: ; 100144
+ ld hl, $cd29
+ bit 5, [hl]
+ jr z, .asm_100155
+ res 5, [hl]
+ res 2, [hl]
+ res 6, [hl]
+ call Function100320
+ ret
+
+.asm_100155
+ bit 2, [hl]
+ ret z
+ res 2, [hl]
+ res 6, [hl]
+ callba Function10402d
+ ret
+; 100163
+
+Function100163: ; 100163
+ ld hl, $cd29
+ bit 6, [hl]
+ ret z
+ res 6, [hl]
+ call DelayFrame
+ ret
+; 10016f
+
+Function10016f: ; 10016f
+ ld a, [$cd2b]
+ cp $1
+ ret z
+ cp $2
+ ret z
+ cp $ff
+ jp z, .asm_1001f5
+ cp $fe
+ jr z, .asm_1001c4
+ cp $f5
+ jr z, .asm_1001e7
+ cp $f6
+ jr z, .asm_1001b6
+ cp $fa
+ jp z, .asm_1001bd
+ cp $f7
+ jp z, .asm_1001ee
+ cp $f4
+ jr z, .asm_1001d2
+ cp $f3
+ jr z, .asm_1001cb
+ cp $f1
+ jr z, .asm_1001c4
+ cp $f2
+ jr z, .asm_1001c4
+ cp $fc
+ jr z, .asm_1001e6
+ cp $fb
+ jr z, .asm_1001af
+ cp $f8
+ ret z
+ ret
+
+.asm_1001af
+ ld a, $d7
+ ld de, $0000
+ jr .asm_1001d7
+
+.asm_1001b6
+ ld a, $d5
+ ld de, $0000
+ jr .asm_1001d7
+
+.asm_1001bd
+ ld a, $d6
+ ld de, $0000
+ jr .asm_1001d7
+
+.asm_1001c4
+ ld a, $d2
+ ld de, $0002
+ jr .asm_1001d7
+
+.asm_1001cb
+ ld a, $d1
+ ld de, $0001
+ jr .asm_1001d7
+
+.asm_1001d2
+ ld a, $d0
+ ld de, $0000
+
+.asm_1001d7
+ ld [$c300], a
+ ld a, d
+ ld [$c302], a
+ ld a, e
+ ld [$c301], a
+ call Function10020b
+ ret
+
+.asm_1001e6
+ ret
+
+.asm_1001e7
+ ld de, String10025e
+ call Function100232
+ ret
+
+.asm_1001ee
+ ld de, String10024d
+ call Function100232
+ ret
+
+.asm_1001f5
+ ld a, [$cd2c]
+ ld [$c300], a
+ ld a, [$cd2d]
+ ld [$c302], a
+ ld a, [$cd2d]
+ ld [$c301], a
+ call Function10020b
+ ret
+; 10020b
+
+Function10020b: ; 10020b
+ xor a
+ ld [$c303], a
+ callba Function8c084
+ callba Function106464
+ call HideSprites
+ call DelayFrame
+ ld a, [rSVBK]
+ push af
+ ld a, $1
+ ld [rSVBK], a
+ callba Function17f555
+ pop af
+ ld [rSVBK], a
+ ret
+; 100232
+
+Function100232: ; 100232
+ push de
+ callba Function106464
+ call Function3f20
+ call Function1ad2
+ hlcoord 1, 2
+ pop de
+ call PlaceString
+ call Function100320
+ call Functiona36
+ ret
+; 10024d
+
+String10024d: ; 10024d
+ db "つうしんを キャンセル しました@"
+; 10025e
+
+String10025e: ; 10025e
+ db "おともだちと えらんだ へやが", $4e
+ db "ちがうようです@"
+; 100276
+
+Function100276: ; 100276
+ ld a, [$cd2b]
+ cp $1
+ jr z, .asm_10029f
+ cp $2
+ jr z, .asm_100296
+ cp $f5
+ jr z, .asm_1002a5
+ cp $f6
+ jr z, .asm_1002a5
+ cp $f7
+ jr z, .asm_100293
+ cp $f8
+ jr z, .asm_1002b1
+ jr .asm_1002c0
+
+.asm_100293
+ ld c, $2
+ ret
+
+.asm_100296
+ callba Script_reloadmappart
+ ld c, $4
+ ret
+
+.asm_10029f
+ call Function1002dc
+ ld c, $0
+ ret
+
+.asm_1002a5
+ callba Script_reloadmappart
+ call Function1002ed
+ ld c, $3
+ ret
+
+.asm_1002b1
+ call Function1002c9
+ call Function1002dc
+ ld de, String10024d
+ call Function100232
+ ld c, $2
+ ret
+
+.asm_1002c0
+ call Function1002c9
+ call Function1002dc
+ ld c, $1
+ ret
+; 1002c9
+
+Function1002c9: ; 1002c9
+ ld hl, $cd2a
+ bit 0, [hl]
+ ret z
+ callba Function3f6d0
+ callba Function1500c
+ ret
+; 1002dc
+
+Function1002dc: ; 1002dc
+ ld a, $f8
+ ld [$ff9f], a
+ callba Function15363
+ xor a
+ ld [$ff9f], a
+ call Functione51
+ ret
+; 1002ed
+
+Function1002ed: ; 1002ed
+ callba Function49409
+ callba Function96a4
+ ld a, $1
+ ld [hCGBPalUpdate], a
+ call DelayFrame
+ ret
+; 100301
+
+Function100301: ; 100301
+ ld hl, $cd2a
+ bit 1, [hl]
+ ret z
+ callba Function106464
+ callba Function10202c
+ callba Function115dd3
+ call Function100320
+ call Functiona36
+ ret
+; 100320
+
+Function100320: ; 100320
+ callba Function104099
+ ret
+; 100327
+
+INCBIN "baserom.gbc", $100327, $10032e - $100327
+
+
Function10032e: ; 10032e
call Function10034d
ld e, a
@@ -67311,9 +76860,19 @@
ret
; 100504
-INCBIN "baserom.gbc", $100504, $10062d - $100504
+Function100504: ; 100504
+ push de
+ call Function3f20
+ call Function1ad2
+ pop de
+ ld hl, $c4cc
+ call PlaceString
+ ret
+; 100513
+INCBIN "baserom.gbc", $100513, $10062d - $100513
+
Function10062d: ; 10062d
push bc
call Function10064e
@@ -67366,9 +76925,72 @@
ret
; 100665
-INCBIN "baserom.gbc", $100665, $1006dc - $100665
+INCBIN "baserom.gbc", $100665, $100675 - $100665
+Function100675: ; 100675
+ ld hl, $cd2a
+ bit 2, [hl]
+ set 2, [hl]
+ ret nz
+ call Function1006d3
+ ret
+; 100681
+Function100681: ; 100681
+ push hl
+ ld hl, $cd2a
+ bit 2, [hl]
+ ld hl, $cd2a
+ set 2, [hl]
+ pop hl
+ jr nz, .asm_100694
+ push hl
+ call Function1006d3
+ pop hl
+
+.asm_100694
+ ld de, $cd32
+ ld a, [de]
+ and a
+ jr nz, .asm_1006bb
+ inc de
+ push de
+ call .asm_1006b4
+ ld de, String1006c2
+ call PlaceString
+ ld h, b
+ ld l, c
+ pop de
+ inc de
+ call .asm_1006b4
+ ld de, String1006c6
+ call PlaceString
+ ret
+
+.asm_1006b4
+ ld bc, $8102
+ call PrintNum
+ ret
+
+.asm_1006bb
+ ld de, String1006ca
+ call PlaceString
+ ret
+; 1006c2
+
+String1006c2: ; 1006c2
+ db "ふん @"
+String1006c6: ; 1006c6
+ db "びょう@"
+String1006ca: ; 1006ca
+ db "1じかんいじょう@"
+; 1006d3
+
+Function1006d3: ; 1006d3
+ call UpdateTime
+ ld de, $cd34
+ ld hl, $cd38
+
Function1006dc: ; 1006dc
ld a, [hld]
ld c, a
@@ -67402,9 +77024,35 @@
ret
; 1006fd
-INCBIN "baserom.gbc", $1006fd, $10079c - $1006fd
+Function1006fd: ; 1006fd
+ ld a, $4
+ ld hl, $a800
+ call GetSRAMBank
+ xor a
+ ld [hli], a
+ ld [hli], a
+ ld [hli], a
+ call CloseSRAM
+ ret
+; 10070d
+Function10070d: ; 10070d
+ ld a, $4
+ ld hl, $a800
+ call GetSRAMBank
+ xor a
+ ld [hli], a
+ ld a, $a
+ ld [hli], a
+ xor a
+ ld [hli], a
+ call CloseSRAM
+ ret
+; 100720
+INCBIN "baserom.gbc", $100720, $10079c - $100720
+
+
Function10079c: ; 10079c
ld a, [$cd21]
cp $1
@@ -67511,9 +77159,46 @@
ret
; 100846
-INCBIN "baserom.gbc", $100846, $1008e0 - $100846
+INCBIN "baserom.gbc", $100846, $1008a6 - $100846
+Function1008a6: ; 1008a6
+ ld a, $4
+ ld hl, $a800
+ call GetSRAMBank
+ ld a, [hli]
+ ld [StringBuffer2], a
+ ld a, [hli]
+ ld [$d087], a
+ ld a, [hli]
+ ld [$d088], a
+ call CloseSRAM
+ ld a, [$d088]
+ ld b, a
+ ld a, $0
+ sub b
+ jr nc, .asm_1008c8
+ add $3c
+.asm_1008c8
+ ld b, a
+ ld a, [$d087]
+ ld c, a
+ ld a, $a
+ sbc c
+ ld c, a
+ jr c, .asm_1008da
+ ld a, [StringBuffer2]
+ and a
+ jr nz, .asm_1008da
+ ret
+
+.asm_1008da
+ call Function10070d
+ ld c, $0
+ ret
+; 1008e0
+
+
Function1008e0: ; 1008e0
ld a, [hBGMapMode]
ld b, a
@@ -68373,9 +78058,647 @@
ret
; 100edf
-INCBIN "baserom.gbc", $100edf, $10389d - $100edf
+INCBIN "baserom.gbc", $100edf, $1011f1 - $100edf
+Function1011f1: ; 1011f1
+ ld a, $4
+ call GetSRAMBank
+ ld a, [$a60c]
+ ld [$dc41], a
+ call CloseSRAM
+ ld hl, $dc41
+ res 4, [hl]
+ ld hl, GameTimerPause
+ bit 7, [hl]
+ jr z, .asm_101210
+ ld hl, $dc41
+ set 4, [hl]
+.asm_101210
+ call Function10209c
+ xor a
+ ld [$dc5f], a
+ ld [$dc60], a
+ ld a, $4
+ ld [InLinkBattle], a
+ ret
+; 101220
+
+Function101220: ; 101220
+ xor a
+ ld [InLinkBattle], a
+ ret
+; 101225
+
+Function101225: ; 101225
+ ld d, $1
+ ld e, $40
+ ld bc, $5297
+ call Function100000
+ jr Function10123d
+
+Function101231: ; 101231
+ ld d, $2
+ ld e, $40
+ ld bc, $5297
+ call Function100000
+ jr Function10123d
+
+Function10123d: ; 10123d
+ xor a
+ ld [ScriptVar], a
+ ld a, c
+ ld hl, Table101247
+ rst JumpTable
+ ret
+; 101247
+
+Table101247: ; 101247
+ dw Function101251
+ dw Function10127d
+ dw Function10127c
+ dw Function10126c
+ dw Function101265
+; 101251
+
+Function101251: ; 101251
+ call Function1ad2
+ call ResetWindow
+ ld hl, $61f4
+ call Function1021e0
+ call Function1020ea
+ ret c
+ call Function102142
+ ret
+; 101265
+
+Function101265: ; 101265
+ ld hl, $61ef
+ call Function1021e0
+ ret
+; 10126c
+
+Function10126c: ; 10126c
+ call Function1ad2
+ callba Script_reloadmappart
+ ld hl, $61f4
+ call Function1021e0
+ ret
+; 10127c
+
+Function10127c: ; 10127c
+ ret
+; 10127d
+
+Function10127d: ; 10127d
+ ret
+; 10127e
+
+Function10127e: ; 10127e
+ ld a, [$dc5f]
+ and a
+ jr z, .asm_101290
+ cp $1
+ ld c, $27
+ jr z, .asm_101292
+ cp $2
+ ld c, $37
+ jr z, .asm_101292
+
+.asm_101290
+ ld c, $0
+
+.asm_101292
+ ld a, c
+ ld [$cd25], a
+ ret
+; 101297
+
+INCBIN "baserom.gbc", $101297, $1013aa - $101297
+
+Function1013aa: ; 1013aa
+ call WhiteBGMap
+ call Function1d7d
+ call Function2bae
+ callba Function106464
+ call Function1ad2
+ call Function2b5c
+ ret
+; 1013c0
+
+INCBIN "baserom.gbc", $1013c0, $1013d6 - $1013c0
+
+Function1013d6: ; 1013d6
+ callba Function104000
+ ret
+; 1013dd
+
+INCBIN "baserom.gbc", $1013dd, $10142c - $1013dd
+
+Function10142c: ; 10142c
+ ld a, $1
+ ld [$c305], a
+ callba Function115e18
+ ret
+; 101438
+
+INCBIN "baserom.gbc", $101438, $101ee4 - $101438
+
+Function101ee4: ; 101ee4
+ ld d, $0
+ ld hl, $5ef5
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld d, [hl]
+ ld e, a
+ callba Function100504
+ ret
+; 101ef5
+
+INCBIN "baserom.gbc", $101ef5, $10202c - $101ef5
+
+Function10202c: ; 10202c
+ callba Function115d99
+ ld hl, $cd29
+ set 7, [hl]
+ ld c, $2
+ call Function10142c
+ ld e, $d
+ call Function101ee4
+ ld hl, $c4f4
+ call Function100681
+ ret
+; 102048
+
+INCBIN "baserom.gbc", $102048, $10209c - $102048
+
+Function10209c: ; 10209c
+ ld a, $ff
+ ld hl, $dc42
+ ld bc, $0008
+ call ByteFill
+ ret
+; 1020a8
+
+INCBIN "baserom.gbc", $1020a8, $1020ea - $1020a8
+
+Function1020ea: ; 1020ea
+ ld hl, $dc41
+ bit 4, [hl]
+ jr z, .asm_102110
+ ld hl, $dc41
+ bit 2, [hl]
+ jr nz, .asm_102110
+ call Function10218d
+ ld hl, EnemyMoveAnimation
+ bit 4, [hl]
+ jr z, .asm_102110
+ ld hl, EnemyMoveAnimation
+ bit 2, [hl]
+ jr nz, .asm_102110
+ call Function102112
+ jr z, .asm_102110
+ and a
+ ret
+
+.asm_102110
+ scf
+ ret
+; 102112
+
+Function102112: ; 102112
+ ld a, $4
+ call GetSRAMBank
+ ld hl, $a041
+ ld c, $28
+.asm_10211c
+ push hl
+ ld de, PlayerMoveAnimation
+ ld b, $1f
+.asm_102122
+ ld a, [de]
+ cp [hl]
+ jr nz, .asm_10212f
+ inc de
+ inc hl
+ dec b
+ jr nz, .asm_102122
+ pop hl
+ xor a
+ jr .asm_10213c
+
+.asm_10212f
+ pop hl
+ ld de, $0025
+ add hl, de
+ dec c
+ jr nz, .asm_10211c
+ ld a, $1
+ and a
+ jr .asm_10213c
+
+.asm_10213c
+ push af
+ call CloseSRAM
+ pop af
+ ret
+; 102142
+
+Function102142: ; 102142
+ call Function10218d
+ call Function102180
+ ld hl, $61d1
+ call Function1d4f
+ ld de, $0090
+ call StartSFX
+ call Functiona36
+ call Function1c07
+ call Function10219f
+ ld hl, $61d6
+ call Function1d4f
+ call Function1dcf
+ call Function1c07
+ jr c, .asm_10217c
+ call Function1021b8
+ jr c, .asm_10217c
+ call Function10218d
+ call Function102180
+ ld hl, $61db
+ call PrintText
+
+.asm_10217c
+ call Function1013d6
+ ret
+; 102180
+
+Function102180: ; 102180
+ ld hl, EnemyMoveEffect
+ ld de, StringBuffer2
+ ld bc, $000b
+ call CopyBytes
+ ret
+; 10218d
+
+Function10218d: ; 10218d
+ ld hl, $dc00
+ ld de, EnemyMoveAnimation
+ ld bc, $0026
+ ld a, $5
+ call Function306b
+ ld de, EnemyMoveEffect
+ ret
+; 10219f
+
+Function10219f: ; 10219f
+ call FadeToMenu
+ call Function10218d
+ ld de, EnemyMoveEffect
+ callba Function8ac4e
+ call Functiona36
+ call PlayClickSFX
+ call Function1013aa
+ ret
+; 1021b8
+
+Function1021b8: ; 1021b8
+ call FadeToMenu
+ call Function10218d
+ ld de, PlayerMoveAnimation
+ callba Function8ac70
+ ld a, c
+ ld [StringBuffer1], a
+ push af
+ call Function1013aa
+ pop af
+ ret
+; 1021d1
+
+INCBIN "baserom.gbc", $1021d1, $1021e0 - $1021d1
+
+Function1021e0: ; 1021e0
+ call Function1d4f
+ call Functiona36
+ call Function1c07
+ ret
+; 1021ea
+
+INCBIN "baserom.gbc", $1021ea, $103612 - $1021ea
+
+Function103612: ; 103612
+ ld hl, $7640
+ call LoadMenuDataHeader
+ ld a, [$dc40]
+ and $f
+ jr z, .asm_103622
+ ld [$cf88], a
+
+.asm_103622
+ call Function1d81
+ call Function1c17
+ jr c, .asm_10363b
+ ld a, [$cfa9]
+ ld [ScriptVar], a
+ ld c, a
+ ld a, [$dc40]
+ and $f0
+ or c
+ ld [$dc40], a
+ ret
+
+.asm_10363b
+ xor a
+ ld [ScriptVar], a
+ ret
+; 103640
+
+INCBIN "baserom.gbc", $103640, $10366e - $103640
+
+Function10366e: ; 10366e
+ callba Function10632f
+ bit 7, c
+ jr z, .asm_10369b
+ ld hl, $775d
+ call PrintText
+ call Function1dcf
+ jr c, .asm_103696
+ callba Function8b1e1
+ jr nc, .asm_103690
+ call Functiona36
+ jr .asm_103696
+
+.asm_103690
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+
+.asm_103696
+ xor a
+ ld [ScriptVar], a
+ ret
+
+.asm_10369b
+ ld hl, $dc40
+ bit 7, [hl]
+ set 7, [hl]
+ jr nz, .asm_1036b5
+ ld hl, $7762
+ call PrintText
+ call Function1dcf
+ jr c, .asm_1036b5
+ call Function1036f9
+ call Functiona36
+
+.asm_1036b5
+ call Function103700
+ jr c, .asm_1036f4
+ ld hl, $7747
+ call LoadMenuDataHeader
+ call Function1d81
+ call Function1c07
+ jr c, .asm_1036f4
+ ld a, [$cfa9]
+ cp $1
+ jr z, .asm_1036d9
+ cp $2
+ jr z, .asm_1036f4
+ cp $3
+ jr z, .asm_1036ec
+ jr .asm_1036b5
+
+.asm_1036d9
+ callba Function8b1e1
+ jr nc, .asm_1036e6
+ call Functiona36
+ jr .asm_1036f4
+
+.asm_1036e6
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+
+.asm_1036ec
+ call Function1036f9
+ call Functiona36
+ jr .asm_1036b5
+
+.asm_1036f4
+ xor a
+ ld [ScriptVar], a
+ ret
+; 1036f9
+
+Function1036f9: ; 1036f9
+ ld hl, $7767
+ call PrintText
+ ret
+; 103700
+
+Function103700: ; 103700
+ ld c, $a
+ ld hl, $dc20
+ bit 4, [hl]
+ jr z, .asm_10370f
+ callba Function1008a6
+
+.asm_10370f
+ ld a, c
+ ld [StringBuffer2], a
+ ld a, [StringBuffer2]
+ cp $5
+ jr nc, .asm_103724
+ cp $2
+ jr nc, .asm_10372c
+ cp $1
+ jr nc, .asm_103734
+ jr .asm_10373c
+
+.asm_103724
+ ld hl, $776c
+ call PrintText
+ and a
+ ret
+
+.asm_10372c
+ ld hl, $7771
+ call PrintText
+ and a
+ ret
+
+.asm_103734
+ ld hl, $7776
+ call PrintText
+ and a
+ ret
+
+.asm_10373c
+ ld hl, $777b
+ call PrintText
+ call Functiona36
+ scf
+ ret
+; 103747
+
+INCBIN "baserom.gbc", $103747, $103780 - $103747
+
+Function103780: ; 103780
+ ld a, [$d265]
+ push af
+ call Function10378c
+ pop af
+ ld [$d265], a
+ ret
+; 10378c
+
+Function10378c: ; 10378c
+ ld c, $0
+ ld hl, $dc20
+ bit 4, [hl]
+ jr nz, .asm_10379c
+ ld c, $1
+ ld hl, $dc20
+ set 4, [hl]
+
+.asm_10379c
+ push bc
+ callba Function14ab2
+ pop bc
+ jr c, .asm_1037b5
+ ld a, $1
+ ld [ScriptVar], a
+ ld a, c
+ and a
+ ret z
+ callba Function1006fd
+ ret
+
+.asm_1037b5
+ xor a
+ ld [ScriptVar], a
+ ld a, c
+ and a
+ ret z
+ ld hl, $dc20
+ res 4, [hl]
+ ret
+; 1037c2
+
+Function1037c2: ; 1037c2
+ call Function103823
+ jr c, .asm_1037de
+ ld a, [$dc5f]
+ and a
+ jr z, .asm_1037de
+ ld hl, $77e6
+ call PrintText
+ call Function1dcf
+ jr c, .asm_1037de
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+
+.asm_1037de
+ xor a
+ ld [$dc5f], a
+ ld [ScriptVar], a
+ ret
+; 1037e6
+
+INCBIN "baserom.gbc", $1037e6, $1037eb - $1037e6
+
+Function1037eb: ; 1037eb
+ call Function103823
+ jr nc, .asm_103807
+ ld hl, $7819
+ call PrintText
+ call Functiona36
+ ld hl, $781e
+ call PrintText
+ call Functiona36
+ xor a
+ ld [ScriptVar], a
+ ret
+
+.asm_103807
+ ld a, [$dc60]
+ and a
+ jr nz, .asm_103813
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+
+.asm_103813
+ ld a, $2
+ ld [ScriptVar], a
+ ret
+; 103819
+
+INCBIN "baserom.gbc", $103819, $103823 - $103819
+
+Function103823: ; 103823
+ callba Function10632f
+ bit 7, c
+ jr nz, .asm_103838
+ callba Function1008a6
+ ld a, c
+ cp $1
+ jr c, .asm_10383a
+
+.asm_103838
+ xor a
+ ret
+
+.asm_10383a
+ scf
+ ret
+; 10383c
+
+Function10383c: ; 10383c
+ ld a, $1
+ ld [$dc60], a
+ xor a
+ ld hl, $dc5c
+ ld [hli], a
+ ld [hli], a
+ ld [hl], a
+ ld hl, $7876
+ call PrintText
+ call Functiona36
+ callba Script_reloadmappart
+ callba Function4a94e
+ jr c, .asm_103870
+ ld hl, DefaultFlypoint
+ ld de, $dc5c
+ ld bc, $0003
+ call CopyBytes
+ xor a
+ ld [ScriptVar], a
+ ret
+
+.asm_103870
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+; 103876
+
+INCBIN "baserom.gbc", $103876, $10387b - $103876
+
+Function10387b: ; 10387b
+ callba Function10632f
+ bit 7, c
+ ret nz
+ callba Function1008a6
+ ld a, c
+ ld [StringBuffer2], a
+ ld hl, $7898
+ call PrintText
+ call Functiona36
+ ret
+; 103898
+
+INCBIN "baserom.gbc", $103898, $10389d - $103898
+
+
SECTION "bank41",ROMX,BANK[$41]
Function104000: ; 104000
@@ -68399,9 +78722,17 @@
jp Function104177
; 104067
-INCBIN "baserom.gbc", $104067, $104110 - $104067
+INCBIN "baserom.gbc", $104067, $104099 - $104067
+Function104099: ; 104099
+ ld hl, Function104061
+ ld hl, $40a2
+ jp Function104177
+; 1040a2
+INCBIN "baserom.gbc", $1040a2, $104110 - $1040a2
+
+
Function104110: ; 104110
ld hl, $4116
jp Function104177
@@ -68750,9 +79081,16 @@
; 1046c6
-INCBIN "baserom.gbc", $1046c6, $10486d - $1046c6
+INCBIN "baserom.gbc", $1046c6, $1047eb - $1046c6
+Function1047eb: ; 1047eb
+ ld b, $9
+ jp GetSGBLayout
+; 1047f0
+INCBIN "baserom.gbc", $1047f0, $10486d - $1047f0
+
+
Function10486d: ; 10486d
ld hl, OverworldMap
ld a, [XCoord]
@@ -68800,9 +79138,34 @@
ret
; 1048ba
-INCBIN "baserom.gbc", $1048ba, $1050d9 - $1048ba
+INCBIN "baserom.gbc", $1048ba, $1050b9 - $1048ba
+Function1050b9: ; 1050b9
+ call Function105106
+ ld hl, $abe3
+ ld a, [hl]
+ inc a
+ jr nz, .asm_1050c5
+ ld [hld], a
+ ld [hl], a
+.asm_1050c5
+ jp CloseSRAM
+; 1050c8
+
+Function1050c8: ; 1050c8
+ call Function105106
+ ld a, [$abe5]
+ cp $ff
+ jr z, .asm_1050d6
+ xor a
+ ld [$abe5], a
+
+.asm_1050d6
+ jp CloseSRAM
+; 1050d9
+
+
Function1050d9: ; 1050d9
call Function105106
ld hl, $abe2
@@ -69197,9 +79560,21 @@
HallOfFame2: ; 0x105ef6
ret
-INCBIN "baserom.gbc", $105ef7, $106008 - $105ef7
+INCBIN "baserom.gbc", $105ef7, $105f33 - $105ef7
+Function105f33: ; 105f33
+ ret
+; 105f34
+INCBIN "baserom.gbc", $105f34, $105f79 - $105f34
+
+Function105f79: ; 105f79
+ ret
+; 105f7a
+
+INCBIN "baserom.gbc", $105f7a, $106008 - $105f7a
+
+
Function106008: ; 106008
ret
; 106009
@@ -69244,8 +79619,20 @@
ret
; 106095
-INCBIN "baserom.gbc", $106095, $1060b5 - $106095
+INCBIN "baserom.gbc", $106095, $1060a2 - $106095
+Function1060a2: ; 1060a2
+ ret
+; 1060a3
+
+INCBIN "baserom.gbc", $1060a3, $1060af - $1060a3
+
+Function1060af: ; 1060af
+ ret
+; 1060b0
+
+INCBIN "baserom.gbc", $1060b0, $1060b5 - $1060b0
+
Function1060b5: ; 1060b5
ret
; 1060b6
@@ -69263,9 +79650,15 @@
ret
; 1060c2
-INCBIN "baserom.gbc", $1060c2, $1060d3 - $1060c2
+INCBIN "baserom.gbc", $1060c2, $1060cd - $1060c2
+Function1060cd: ; 1060cd
+ ret
+; 1060ce
+INCBIN "baserom.gbc", $1060ce, $1060d3 - $1060ce
+
+
Function1060d3: ; 1060d3
ret
; 1060d4
@@ -69509,9 +79902,52 @@
ret
; 10630f
-INCBIN "baserom.gbc", $10630f, $106594 - $10630f
+Function10630f: ; 10630f
+ xor a
+ ld [ScriptVar], a
+ ret
+; 106314
+INCBIN "baserom.gbc", $106314, $10632f - $106314
+Function10632f: ; 10632f
+ or a
+ ret
+; 106331
+
+INCBIN "baserom.gbc", $106331, $106462 - $106331
+
+Function106462: ; 106462
+ ret
+; 106463
+
+INCBIN "baserom.gbc", $106463, $106464 - $106463
+
+Function106464: ; 106464
+ ld de, $5214
+ ld hl, $9600
+ ld bc, $3e01
+ call Get2bpp
+ ld de, $5424
+ ld hl, $9610
+ ld bc, $3e01
+ call Get2bpp
+ ld de, $6514
+ ld hl, $9620
+ ld c, $9
+ ld b, $41
+ call Get2bpp
+ ld de, $40b0
+ ld hl, $96b0
+ ld b, $f
+ call Get2bpp
+ callba Functionfb4cc
+ ret
+; 10649b
+
+INCBIN "baserom.gbc", $10649b, $106594 - $10649b
+
+
Function106594: ; 106594
ld de, $65ad
ld hl, VTiles1
@@ -69529,8 +79965,239 @@
SECTION "bank42",ROMX,BANK[$42]
-INCBIN "baserom.gbc", $108000, $109407 - $108000
+INCBIN "baserom.gbc", $108000, $108016 - $108000
+Function108016: ; 108016
+ ld a, $0
+ ld [$cf65], a
+ ld de, $4021
+ jp Function108089
+; 108021
+
+INCBIN "baserom.gbc", $108021, $108089 - $108021
+
+Function108089: ; 108089
+ ld hl, BattleEnded
+ ld [hl], e
+ inc hl
+ ld [hl], d
+ ld a, [$ffde]
+ push af
+ xor a
+ ld [$ffde], a
+ ld hl, VramState
+ ld a, [hl]
+ push af
+ res 0, [hl]
+ ld hl, Options
+ ld a, [hl]
+ push af
+ set 4, [hl]
+ call Function108157
+.asm_1080a6
+ call Function10824b
+ jr nc, .asm_1080a6
+ pop af
+ ld [Options], a
+ pop af
+ ld [VramState], a
+ pop af
+ ld [$ffde], a
+ ret
+; 1080b7
+
+INCBIN "baserom.gbc", $1080b7, $108157 - $1080b7
+
+Function108157: ; 108157
+ xor a
+ ld [$cf63], a
+ call WhiteBGMap
+ call ClearSprites
+ call ClearTileMap
+ call DisableLCD
+ call Function1081ad
+ call Function1081ca
+ call Functione51
+ call Functione58
+ call EnableLCD
+ xor a
+ ld [hSCX], a
+ ld [hSCY], a
+ ld a, $7
+ ld [hWX], a
+ ld a, $90
+ ld [hWY], a
+ callba Function8cf53
+ xor a
+ ld hl, $c300
+ ld [hli], a
+ ld [hl], $0
+ call DelayFrame
+ ld a, [PlayerSDefLevel]
+ ld de, PlayerAccLevel
+ call Function108239
+ ld a, [PlayerLightScreenCount]
+ ld de, PlayerReflectCount
+ call Function108239
+ xor a
+ call Function108b98
+ call Function108af4
+ ret
+; 1081ad
+
+Function1081ad: ; 1081ad
+ ld a, $1
+ ld [rVBK], a
+ ld hl, VTiles0
+ ld bc, $1800
+ xor a
+ call ByteFill
+ ld a, $0
+ ld [rVBK], a
+ ld hl, VTiles0
+ ld bc, $1800
+ xor a
+ call ByteFill
+ ret
+; 1081ca
+
+Function1081ca: ; 1081ca
+ ld a, $1
+ ld [rVBK], a
+ ld hl, VBGMap0
+ ld bc, $0800
+ ld a, $0
+ call ByteFill
+ ld a, $0
+ ld [rVBK], a
+ ld hl, VBGMap0
+ ld bc, $0800
+ ld a, $7f
+ call ByteFill
+ ret
+; 1081e9
+
+INCBIN "baserom.gbc", $1081e9, $108239 - $1081e9
+
+Function108239: ; 108239
+ push de
+ ld [$d265], a
+ call GetPokemonName
+ ld hl, StringBuffer1
+ pop de
+ ld bc, $000b
+ call CopyBytes
+ ret
+; 10824b
+
+Function10824b: ; 10824b
+ ld a, [$cf63]
+ bit 7, a
+ jr nz, .asm_10825a
+ call Function10827b
+ call DelayFrame
+ and a
+ ret
+
+.asm_10825a
+ xor a
+ ld [hSCX], a
+ ld [hSCY], a
+ ld a, $7
+ ld [hWX], a
+ ld a, $90
+ ld [hWY], a
+ call Functione51
+ call Functione58
+ callba Function106462
+ callba Function106464
+ scf
+ ret
+; 10827b
+
+Function10827b: ; 10827b
+ ld a, [$cf63]
+ ld e, a
+ ld d, $0
+ ld hl, $428a
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 10828a
+
+INCBIN "baserom.gbc", $10828a, $108af4 - $10828a
+
+Function108af4: ; 108af4
+ ld a, [rSVBK]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ ld a, [$cf65]
+ and $1
+ jr z, .asm_108b1c
+ ld hl, $5187
+ ld de, Unkn2Pals
+ ld bc, $0040
+ call CopyBytes
+ ld hl, $5187
+ ld de, OBPals
+ ld bc, $0040
+ call CopyBytes
+ jr .asm_108b34
+
+.asm_108b1c
+ ld hl, $5147
+ ld de, Unkn2Pals
+ ld bc, $0040
+ call CopyBytes
+ ld hl, $5147
+ ld de, OBPals
+ ld bc, $0040
+ call CopyBytes
+
+.asm_108b34
+ pop af
+ ld [rSVBK], a
+ ld a, $e4
+ call Functioncf8
+ ld a, $e4
+ call DmgToCgbBGPals
+ call DelayFrame
+ ret
+; 108b45
+
+INCBIN "baserom.gbc", $108b45, $108b98 - $108b45
+
+Function108b98: ; 108b98
+ ld d, a
+ ld a, [rSVBK]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ ld a, [$cf65]
+ and $1
+ xor d
+ jr z, .asm_108bad
+ ld hl, $4ba0
+ jr .asm_108bb0
+
+.asm_108bad
+ ld hl, $4b98
+
+.asm_108bb0
+ ld de, $d038
+ ld bc, $0040
+ call CopyBytes
+ pop af
+ ld [rSVBK], a
+ ret
+; 108bbd
+
+INCBIN "baserom.gbc", $108bbd, $109407 - $108bbd
+
IntroLogoGFX: ; 109407
INCBIN "gfx/intro/logo.lz"
; 10983f
@@ -69588,7 +80255,7 @@
call $5a95
xor a
ld [$cf66], a
- ld hl, $d100
+ ld hl, LYOverrides
ld bc, Start
xor a
call ByteFill
@@ -70199,9 +80866,195 @@
jp [hl]
; 11425c
-INCBIN "baserom.gbc", $11425c, $117a7f - $11425c
+INCBIN "baserom.gbc", $11425c, $115d99 - $11425c
+Function115d99: ; 115d99
+ ld de, $601a
+ ld hl, $8600
+ ld bc, $4514
+ call Get2bpp
+ xor a
+ ld [$c305], a
+ ld [$c306], a
+ ld [$c309], a
+ ld [$c30a], a
+ ld [$c30b], a
+ ld [$c30c], a
+ ld a, $10
+ ld [$c307], a
+ ld a, $18
+ ld [$c308], a
+ ret
+; 115dc3
+INCBIN "baserom.gbc", $115dc3, $115dd3 - $115dc3
+
+Function115dd3: ; 115dd3
+ ld a, [$c305]
+ and a
+ ret z
+ ld a, $a0
+ ld hl, $c47c
+ ld bc, $0020
+ call ByteFill
+ call Function115e22
+ ld a, [$c309]
+ sla a
+ ld c, a
+ ld b, $0
+ ld hl, $5e86
+ add hl, bc
+ ld a, [hli]
+ ld e, a
+ ld a, [hl]
+ ld d, a
+ push de
+ pop hl
+ ld de, $c47c
+ ld a, [$c307]
+ ld c, a
+ ld a, [$c308]
+ ld b, a
+ ld a, [hli]
+.asm_115e04
+ push af
+ ld a, [hli]
+ add b
+ ld [de], a
+ inc de
+ ld a, [hli]
+ add c
+ ld [de], a
+ inc de
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [hli]
+ ld [de], a
+ inc de
+ pop af
+ dec a
+ jr nz, .asm_115e04
+ ret
+; 115e18
+
+Function115e18: ; 115e18
+ ld a, c
+ ld [$c30a], a
+ xor a
+ ld [$c30b], a
+ jr Function115e2b
+; 115e22
+
+Function115e22: ; 115e22
+ ld hl, $c30c
+ dec [hl]
+ ret nz
+ ld hl, $c30b
+ inc [hl]
+
+Function115e2b: ; 115e2b
+ ld a, [$c30a]
+ sla a
+ ld c, a
+ ld b, $0
+ ld hl, $5e59
+ add hl, bc
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ push de
+ pop hl
+ ld a, [$c30b]
+ sla a
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [hli]
+ cp $ff
+ jr nz, .asm_115e51
+ xor a
+ ld [$c30b], a
+ jr Function115e2b
+
+.asm_115e51
+ ld [$c309], a
+ ld a, [hl]
+ ld [$c30c], a
+ ret
+; 115e59
+
+INCBIN "baserom.gbc", $115e59, $11615a - $115e59
+
+Function11615a: ; 11615a
+ xor a
+ ld [$c30d], a
+ ld [$c319], a
+ ld [$c310], a
+ ld [$c311], a
+ ld [$c312], a
+ ld [$c313], a
+ ld [$c314], a
+ ld [$c315], a
+ ld [$c318], a
+ ld [$c3f6], a
+ ld [$c3f8], a
+ ld [$c3f2], a
+ ld [$c3f4], a
+ ld a, $24
+ ld [$c3f5], a
+ ld a, $7
+ ld [$c3f7], a
+ ld a, $b0
+ ld [$c30e], a
+ ld [$c3f1], a
+ ld a, $48
+ ld [$c30f], a
+ ld [$c3f3], a
+ ret
+; 11619d
+
+Function11619d: ; 11619d
+ ld a, [$c30d]
+ and a
+ ret z
+ ld a, [$c319]
+ cp $2
+ jr c, .asm_1161b4
+ ld a, $a0
+ ld hl, Sprites
+ ld bc, $0064
+ call ByteFill
+
+.asm_1161b4
+ call Function1161b8
+ ret
+; 1161b8
+
+Function1161b8: ; 1161b8
+ ld a, [$c319]
+ ld e, a
+ ld d, $0
+ ld hl, $61c7
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 1161c7
+
+INCBIN "baserom.gbc", $1161c7, $117656 - $1161c7
+
+Function117656: ; 117656
+ callba GiveOddEgg
+ ret
+; 11765d
+
+INCBIN "baserom.gbc", $11765d, $117a7f - $11765d
+
+
; everything from here to the end of the bank is related to the
; Mobile Stadium option from the continue/newgame menu.
; XXX better function names
@@ -70551,8 +81404,385 @@
SECTION "bank46",ROMX,BANK[$46]
-INCBIN "baserom.gbc", $118000, $118ba5 - $118000
+Function118000: ; 118000
+ ld a, $1
+ ld [$cd38], a
+ jr .asm_11800b
+ xor a
+ ld [$cd38], a
+
+.asm_11800b
+ call Function1183cb
+ ld a, $18
+ ld [$cd33], a
+ ld a, $19
+ ld [$cd34], a
+ ld a, $4
+ ld [$c3f0], a
+ ld a, [rSVBK]
+ push af
+ ld a, $3
+ ld [rSVBK], a
+.asm_118024
+ call Functiona57
+ call Function118473
+ ld a, [$cf66]
+ cp $1b
+ jr c, .asm_118037
+ ld a, [$cd34]
+ ld [$cf66], a
+
+.asm_118037
+ call Function1184a5
+ call Function11a8fa
+ callba Function115dd3
+ callba Function11619d
+ call DelayFrame
+ ld a, [$cf66]
+ ld hl, $cd33
+ cp [hl]
+ jr nz, .asm_118024
+ pop af
+ ld [rSVBK], a
+ call Function118452
+ call Function222a
+ ret
+; 11805f
+
+Function11805f: ; 11805f
+ ld a, $1
+ ld [$cd38], a
+ call Function1183cb
+ ld a, $18
+ ld [$cd33], a
+ ld a, $19
+ ld [$cd34], a
+ ld a, $4
+ ld [$c3f0], a
+ ld a, [rSVBK]
+ push af
+ ld a, $3
+ ld [rSVBK], a
+.asm_11807d
+ call Functiona57
+ call Function118473
+ ld a, [$cf66]
+ cp $1b
+ jr c, .asm_118090
+ ld a, [$cd34]
+ ld [$cf66], a
+
+.asm_118090
+ call Function11857c
+ call Function11a8fa
+ callba Function115dd3
+ callba Function11619d
+ call DelayFrame
+ ld a, [$cf66]
+ ld hl, $cd33
+ cp [hl]
+ jr nz, .asm_11807d
+ pop af
+ ld [rSVBK], a
+ call Function118452
+ call Function222a
+ ret
+; 1180b8
+
+INCBIN "baserom.gbc", $1180b8, $11811a - $1180b8
+
+Function11811a: ; 11811a
+ ld a, 1
+ ld [$cd38], a
+ jr Function118125
+
+Function118121: ; 118121
+ xor a
+ ld [$cd38], a
+
+Function118125: ; 118125
+ call Function1183cb
+ ld a, $3
+ ld [$cd33], a
+ ld a, $d
+ ld [$cd34], a
+ ld a, $4
+ ld [$c3f0], a
+ ld a, [rSVBK]
+ push af
+ ld a, $3
+ ld [rSVBK], a
+.asm_11813e
+ call Functiona57
+ call Function118473
+ ld a, [$cf66]
+ cp $f
+ jr c, .asm_118151
+ ld a, [$cd34]
+ ld [$cf66], a
+
+.asm_118151
+ call Function11854d
+ call Function11a8fa
+ callba Function115dd3
+ callba Function11619d
+ call DelayFrame
+ ld a, [$cf66]
+ ld hl, $cd33
+ cp [hl]
+ jr nz, .asm_11813e
+ xor a
+ ld [Unkn1Pals], a
+ pop af
+ ld [rSVBK], a
+ call Function118452
+ call Function118180
+ call Function222a
+ ret
+; 118180
+
+Function118180: ; 118180
+ ld a, [ScriptVar]
+ and a
+ ret nz
+ ld a, [$cd38]
+ and a
+ ret z
+ ld a, $5
+ call GetSRAMBank
+ ld hl, $cd69
+ ld de, $a89c
+ ld bc, $0016
+ call CopyBytes
+ ld a, [rSVBK]
+ push af
+ ld a, $3
+ ld [rSVBK], a
+ ld de, $d202
+ ld c, $96
+ callba Function17d0b3
+ jr c, .asm_1181d0
+ ld de, $d202
+ ld bc, $0196
+ callba Function17d1e1
+ jr c, .asm_1181d0
+ ld hl, $d202
+ ld de, $a8b2
+ ld bc, $0096
+ call CopyBytes
+.asm_1181c9
+ pop af
+ ld [rSVBK], a
+ call CloseSRAM
+ ret
+
+.asm_1181d0
+ ld a, $d3
+ ld [$c300], a
+ ld [ScriptVar], a
+ jr .asm_1181c9
+; 1181da
+
+Function1181da: ; 1181da
+ call Function1183cb
+ ld a, $2
+ ld [$cd38], a
+ ld a, $21
+ ld [$cd33], a
+ ld a, $22
+ ld [$cd34], a
+ ld a, $4
+ ld [$c3f0], a
+ ld a, [rSVBK]
+ push af
+ ld a, $3
+ ld [rSVBK], a
+.asm_1181f8
+ call Functiona57
+ call Function118473
+ ld a, [$cf66]
+ cp $28
+ jr c, .asm_11820b
+ ld a, [$cd34]
+ ld [$cf66], a
+
+.asm_11820b
+ call Function1185c3
+ call Function11a8fa
+ callba Function115dd3
+ callba Function11619d
+ call DelayFrame
+ ld a, [$cf66]
+ ld hl, $cd33
+ cp [hl]
+ jr nz, .asm_1181f8
+ pop af
+ ld [rSVBK], a
+ call Function118452
+ call Function222a
+ ret
+; 118233
+
+INCBIN "baserom.gbc", $118233, $1183cb - $118233
+
+Function1183cb: ; 1183cb
+ di
+ ld a, [rIE]
+ ld [$cd32], a
+ call Function2fef
+ xor a
+ ld [rIF], a
+ ld [$c300], a
+ ld [$c301], a
+ ld [$c302], a
+ ld [$cd80], a
+ ld [$cd65], a
+ ld [$cd66], a
+ ld [$cd67], a
+ ld [$cd68], a
+ ld [$c31a], a
+ ld [$cd89], a
+ ld [$cd8a], a
+ ld [$cd8b], a
+ ld [$c3ec], a
+ ld [$c3ed], a
+ ld [$c3ee], a
+ ld [$c3ef], a
+ ld hl, VramState
+ ld a, [hl]
+ ld [$cd7f], a
+ set 1, [hl]
+ ld a, $f
+ ld [rIE], a
+ ld a, $1
+ ld [$ffc9], a
+ ld [$ffe9], a
+ ei
+ callba Function106462
+ callba Function106464
+ callba Function115d99
+ callba Function11615a
+ ld a, $5
+ call GetSRAMBank
+ xor a
+ ld [$bfff], a
+ call CloseSRAM
+ ret
+; 118440
+
+INCBIN "baserom.gbc", $118440, $118452 - $118440
+
+Function118452: ; 118452
+ di
+ xor a
+ ld [$ffc9], a
+ ld [$ffe9], a
+ ld [$ff9e], a
+ call Function2ff7
+ xor a
+ ld [rIF], a
+ ld a, [$cd32]
+ ld [rIE], a
+ ei
+ ld a, [$cd7f]
+ ld [VramState], a
+ ld a, [$c300]
+ ld [ScriptVar], a
+ ret
+; 118473
+
+Function118473: ; 118473
+ ld a, [$cd65]
+ and a
+ ret z
+ ld a, [$cd66]
+ inc a
+ ld [$cd66], a
+ cp $3c
+ ret nz
+ xor a
+ ld [$cd66], a
+ ld a, [$cd67]
+ inc a
+ ld [$cd67], a
+ cp $3c
+ ret nz
+ ld a, [$cd68]
+ inc a
+ ld [$cd68], a
+ cp $63
+ jr z, .asm_1184a0
+ xor a
+ ld [$cd67], a
+ ret
+
+.asm_1184a0
+ xor a
+ ld [$cd65], a
+ ret
+; 1184a5
+
+Function1184a5: ; 1184a5
+ ld a, [$cf66]
+ ld e, a
+ ld d, $0
+ ld hl, $44b4
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 1184b4
+
+INCBIN "baserom.gbc", $1184b4, $11854d - $1184b4
+
+Function11854d: ; 11854d
+ ld a, [$cf66]
+ ld e, a
+ ld d, $0
+ ld hl, $455c
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 11855c
+
+INCBIN "baserom.gbc", $11855c, $11857c - $11855c
+
+Function11857c: ; 11857c
+ ld a, [$cf66]
+ ld e, a
+ ld d, $0
+ ld hl, $458b
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 11858b
+
+INCBIN "baserom.gbc", $11858b, $1185c3 - $11858b
+
+Function1185c3: ; 1185c3
+ ld a, [$cf66]
+ ld e, a
+ ld d, $0
+ ld hl, $45d2
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 1185d2
+
+INCBIN "baserom.gbc", $1185d2, $118ba5 - $1185d2
+
ExchangeDownloadURL: ; 0x118ba5
ascii "http://gameboy.datacenter.ne.jp/cgb/download?name=/01/CGB-BXTJ/exchange/index.txt"
@@ -70578,8 +81808,23 @@
db $0
-INCBIN "baserom.gbc", $118d35, $11aa13 - $118d35
+INCBIN "baserom.gbc", $118d35, $11a8fa - $118d35
+Function11a8fa: ; 11a8fa
+ ld a, [$c31a]
+ ld e, a
+ ld d, $0
+ ld hl, $6909
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 11a909
+
+INCBIN "baserom.gbc", $11a909, $11aa13 - $11a909
+
UnknownText_0x11aa13: ; 0x11aa13
db $0, "SAVE FILE will be", $4f
db "sent.", $57
@@ -70670,16 +81915,629 @@
; 0x11ac1f
UnknownText_0x11ac1f: ; 0x11ac1f
- text_from_ram $d099
+ text_from_ram StringBuffer3
db $0, "'s ROOM", $4f
db "@"
- text_from_ram $d0ac
+ text_from_ram StringBuffer4
db $0, "?", $55
db "Please wait…", $57
; 0x11ac3e
-INCBIN "baserom.gbc", $11ac3e, $11b98f - $11ac3e
+Function11ac3e: ; 11ac3e
+ call SpeechTextBox
+ call FadeToMenu
+ callab Function8e814
+ call Function11ac51
+ call Function2b3c
+ ret
+; 11ac51
+Function11ac51: ; 11ac51
+ xor a
+ ld [hBGMapMode], a
+ ld hl, Options
+ ld a, [hl]
+ push af
+ set 4, [hl]
+ ld a, [VramState]
+ push af
+ xor a
+ ld [VramState], a
+ ld a, [$ffaa]
+ push af
+ ld a, $1
+ ld [$ffaa], a
+ xor a
+ ld [$ffde], a
+ ld [$cd49], a
+ ld [$cd4a], a
+ ld [$cd4c], a
+ ld [$cd4d], a
+ ld [$cd4e], a
+ call Function11ad1b
+ call DelayFrame
+.asm_11ac82
+ call Functiona57
+ ld a, [$cf63]
+ bit 7, a
+ jr nz, .asm_11aca8
+ call Function11b314
+ call Function11acb7
+ call Function11ad6e
+ ld a, $78
+ ld [$c3b5], a
+ callba Function8cf7a
+ callba Function104061
+ jr .asm_11ac82
+
+.asm_11aca8
+ call ClearSprites
+ pop af
+ ld [$ffaa], a
+ pop af
+ ld [VramState], a
+ pop af
+ ld [Options], a
+ ret
+; 11acb7
+
+Function11acb7: ; 11acb7
+ ld hl, $7a44
+ ld a, [$cd49]
+ ld c, a
+ ld b, $0
+ sla c
+ rl b
+ sla c
+ rl b
+ sla c
+ rl b
+ add hl, bc
+ ld de, $c51e
+ ld a, [hli]
+ ld [de], a
+ ld de, $c52c
+ ld bc, $0007
+ call CopyBytes
+ ld a, [$cd49]
+ inc a
+ ld [$cd49], a
+ ld a, [hl]
+ cp $ff
+ jr nz, .asm_11aceb
+ xor a
+ ld [$cd49], a
+
+.asm_11aceb
+ ld hl, $7b7d
+ ld a, [$cd4a]
+ ld c, a
+ ld b, $0
+ sla c
+ rl b
+ sla c
+ rl b
+ sla c
+ rl b
+ add hl, bc
+ ld de, $c557
+ ld bc, $0007
+ call CopyBytes
+ ld a, [$cd4a]
+ inc a
+ ld [$cd4a], a
+ inc hl
+ ld a, [hl]
+ cp $ff
+ ret nz
+ xor a
+ ld [$cd4a], a
+ ret
+; 11ad1b
+
+Function11ad1b: ; 11ad1b
+ call WhiteBGMap
+ call ClearSprites
+ call ClearTileMap
+ callba Function17c000
+ ld a, [$cfa9]
+ ld [$cd82], a
+ dec a
+ ld [hConnectedMapWidth], a
+ ld a, $10
+ ld [$c3b7], a
+ ld hl, $683f
+ ld a, $23
+ ld e, $4
+ rst FarCall
+ ld hl, $683f
+ ld a, $23
+ ld e, $5
+ rst FarCall
+ ld hl, PlayerSDefLevel
+ ld bc, $0115
+ xor a
+ call ByteFill
+ xor a
+ ld [$cf63], a
+ ld [$cf64], a
+ ld [$cf65], a
+ ld [$cf66], a
+ ld [$cd30], a
+ ld a, $2
+ ld [$c7d4], a
+ callba Function40bdc
+ ret
+; 11ad6e
+
+Function11ad6e: ; 11ad6e
+ ld a, [$cf63]
+ ld hl, $6d78
+ call Function11b239
+ jp [hl]
+; 11ad78
+
+INCBIN "baserom.gbc", $11ad78, $11b239 - $11ad78
+
+Function11b239: ; 11b239
+ ld e, a
+ ld d, $0
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ret
+; 11b242
+
+INCBIN "baserom.gbc", $11b242, $11b314 - $11b242
+
+Function11b314: ; 11b314
+ call Function11b31b
+ call Function11b3d9
+ ret
+; 11b31b
+
+Function11b31b: ; 11b31b
+ ld hl, $7350
+ ld a, [$cf63]
+ cp $2
+ jr c, .asm_11b349
+ ld a, [$c7d1]
+ cp $4
+ jr nc, .asm_11b344
+ cp $3
+ jr c, .asm_11b349
+ ld a, [$cf63]
+ cp $2
+ jr z, .asm_11b349
+ cp $3
+ jr z, .asm_11b349
+ cp $6
+ jr z, .asm_11b349
+ ld bc, $737b
+ jr .asm_11b34c
+
+.asm_11b344
+ ld bc, $7389
+ jr .asm_11b34c
+
+.asm_11b349
+ ld bc, $736d
+
+.asm_11b34c
+ call Function11b397
+ ret
+; 11b350
+
+INCBIN "baserom.gbc", $11b350, $11b397 - $11b350
+
+Function11b397: ; 11b397
+ ld de, Sprites
+.asm_11b39a
+ ld a, [hl]
+ cp $ff
+ ret z
+ ld a, [$c7d1]
+ and $7
+ swap a
+ add [hl]
+ inc hl
+ ld [de], a
+ inc de
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [bc]
+ inc bc
+ ld [de], a
+ inc de
+ ld a, $5
+ ld [de], a
+ inc de
+ jr .asm_11b39a
+; 11b3b6
+
+INCBIN "baserom.gbc", $11b3b6, $11b3d9 - $11b3b6
+
+Function11b3d9: ; 11b3d9
+ ld de, $c470
+ push de
+ ld a, [$c7d2]
+ dec a
+ ld e, a
+ ld a, [$c7d1]
+ ld hl, $c7d0
+ add [hl]
+ cp e
+ jr z, .asm_11b40d
+ ld hl, $0000
+ ld bc, $0070
+ call AddNTimes
+ ld e, l
+ ld d, h
+ ld b, $0
+ ld a, d
+ or e
+ jr z, .asm_11b40f
+ ld a, [$c7d2]
+ ld c, a
+.asm_11b401
+ ld a, e
+ sub c
+ ld e, a
+ ld a, d
+ sbc $0
+ ld d, a
+ jr c, .asm_11b40f
+ inc b
+ jr .asm_11b401
+
+.asm_11b40d
+ ld b, $70
+
+.asm_11b40f
+ ld a, $15
+ add b
+ pop hl
+ ld [hli], a
+ cp $41
+ jr c, .asm_11b42b
+ ld a, [$cf63]
+ cp $4
+ jr z, .asm_11b43b
+ cp $5
+ jr z, .asm_11b43b
+ cp $7
+ jr z, .asm_11b43b
+ cp $8
+ jr z, .asm_11b43b
+
+.asm_11b42b
+ ld a, $9b
+ ld [hli], a
+ ld a, [$cd4c]
+ add $3c
+ ld [hli], a
+ ld a, [$cd4c]
+ add $1
+ ld [hl], a
+ ret
+
+.asm_11b43b
+ ld a, $9b
+ ld [hli], a
+ ld a, $39
+ ld [hli], a
+ xor a
+ ld [hl], a
+ ret
+; 11b444
+
+Function11b444: ; 11b444
+ call Function11b44b
+ call Function11b45c
+ ret
+; 11b44b
+
+Function11b44b: ; 11b44b
+ xor a
+ ld [$cf63], a
+ ld [$cf64], a
+ ld [$cf65], a
+ ld [$cf66], a
+ call UpdateTime
+ ret
+; 11b45c
+
+Function11b45c: ; 11b45c
+.asm_11b45c
+ call Function11b46a
+ call DelayFrame
+ ld a, [$cf63]
+ cp $4
+ jr nz, .asm_11b45c
+ ret
+; 11b46a
+
+Function11b46a: ; 11b46a
+ ld a, [$cf63]
+ ld e, a
+ ld d, $0
+ ld hl, $7479
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 11b479
+
+INCBIN "baserom.gbc", $11b479, $11b5e8 - $11b479
+
+Function11b5e8: ; 11b5e8
+ ld a, $0
+ call GetSRAMBank
+ ld hl, $d4ba
+ ld de, EnemyMoveAnimation
+ ld bc, $0004
+ call CopyBytes
+ call CloseSRAM
+ ld a, $5
+ call GetSRAMBank
+ ld hl, EnemyMoveAnimation
+ ld de, $b08c
+ ld bc, $0004
+ call CopyBytes
+ ld a, $2
+ ld [$a800], a
+ ld a, [$a81f]
+ ld [$cd2a], a
+ ld a, [$a820]
+ ld [$cd2b], a
+ ld a, [$a821]
+ ld [$cd2c], a
+ ld a, [$a822]
+ ld [$cd2d], a
+ ld a, [$a823]
+ ld [$cd2e], a
+ ld a, [$a824]
+ ld [$cd2f], a
+ ld a, [$a825]
+ ld [$cd30], a
+ ld a, [$a826]
+ ld [$cd31], a
+ call CloseSRAM
+ call Function11b44b
+ call Function11b64c
+ ret
+; 11b64c
+
+Function11b64c: ; 11b64c
+.asm_11b64c
+ call Function11b65a
+ call DelayFrame
+ ld a, [$cf63]
+ cp $1
+ jr nz, .asm_11b64c
+ ret
+; 11b65a
+
+Function11b65a: ; 11b65a
+ ld a, [$cf63]
+ ld e, a
+ ld d, $0
+ ld hl, $7669
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 11b669
+
+INCBIN "baserom.gbc", $11b669, $11b7e5 - $11b669
+
+Function11b7e5: ; 11b7e5
+ ld a, [EnemyMovePP]
+ ld [PlayerLightScreenCount], a
+ ld [CurPartySpecies], a
+ ld a, [$cd81]
+ ld [$c74e], a
+ ld hl, $c63d
+ ld de, $c724
+ ld bc, $0005
+ call CopyBytes
+ ld a, $50
+ ld [de], a
+ ld a, [PlayerMoveAccuracy]
+ ld [$c731], a
+ ld a, [PlayerMovePP]
+ ld [$c732], a
+ ld hl, $c622
+ ld a, [hli]
+ ld [$c72f], a
+ ld a, [hl]
+ ld [$c730], a
+ ld bc, EnemyMovePP
+ callba Function4f301
+ ld a, c
+ ld [$c733], a
+ call SpeechTextBox
+ call FadeToMenu
+ callba Function108016
+ callba Function17d1f1
+ ld a, $1
+ ld [$d1e9], a
+ ld a, $2
+ ld [InLinkBattle], a
+ callba Function421d8
+ xor a
+ ld [InLinkBattle], a
+ callba Function14a58
+ ld a, $5
+ call GetSRAMBank
+ ld a, $5
+ ld [$a800], a
+ call CloseSRAM
+ ld a, [MapGroup]
+ ld b, a
+ ld a, [MapNumber]
+ ld c, a
+ call Function2147
+ ld a, d
+ or e
+ jr z, .asm_11b872
+ ld a, $1
+ ld [de], a
+
+.asm_11b872
+ call Function2b3c
+ call Function3d47
+ ret
+; 11b879
+
+Function11b879: ; 11b879
+ callba Function17089a
+ ld a, [ScriptVar]
+ and a
+ ret z
+ ld a, $5
+ call GetSRAMBank
+ ld a, [$a800]
+ ld [ScriptVar], a
+ ld a, [$a890]
+ ld [$cd49], a
+ ld a, [$a891]
+ ld [$cd4a], a
+ ld a, [$a892]
+ ld [$cd4b], a
+ ld a, [$a893]
+ ld [$cd4c], a
+ call CloseSRAM
+ ld a, [ScriptVar]
+ and a
+ ret z
+ ld hl, $cd4c
+ ld a, [hRTCDayHi]
+ cp [hl]
+ ret nz
+ dec hl
+ ld a, [hRTCDayLo]
+ cp [hl]
+ ret nz
+ ld hl, $cd4a
+ ld a, [hRTCHours]
+ cp [hl]
+ jr nc, .asm_11b8d8
+ ld a, $18
+ sub [hl]
+ ld hl, hRTCHours
+ add [hl]
+ ld [$cd4c], a
+ ld a, [hRTCMinutes]
+ ld [$cd4b], a
+ xor a
+ ld [$cd4a], a
+ jr .asm_11b8e2
+
+.asm_11b8d8
+ ld a, [hRTCMinutes]
+ ld [$cd4b], a
+ ld a, [hRTCHours]
+ ld [$cd4c], a
+
+.asm_11b8e2
+ xor a
+ ld l, a
+ ld h, a
+ ld b, a
+ ld d, a
+ ld a, [$cd4b]
+ ld e, a
+ ld a, [$cd4c]
+ ld c, $3c
+ call AddNTimes
+ add hl, de
+ push hl
+ xor a
+ ld l, a
+ ld h, a
+ ld b, a
+ ld d, a
+ ld a, [$cd49]
+ ld e, a
+ ld a, [$cd4a]
+ ld c, $3c
+ call AddNTimes
+ add hl, de
+ ld a, l
+ cpl
+ add $1
+ ld e, a
+ ld a, h
+ cpl
+ adc $0
+ ld d, a
+ pop hl
+ add hl, de
+ ld de, $ff88
+ add hl, de
+ bit 7, h
+ ret z
+ ld a, $2
+ ld [ScriptVar], a
+ ret
+; 11b920
+
+Function11b920: ; 11b920
+ call Function11b44b
+ ld a, $5
+ call GetSRAMBank
+ ld hl, $a81f
+ ld de, $c626
+ ld bc, $0008
+ call CopyBytes
+ call CloseSRAM
+ call Function118000
+ ret
+; 11b93b
+
+Function11b93b: ; 11b93b
+ ld a, $5
+ call GetSRAMBank
+ xor a
+ ld [$a800], a
+ ld hl, $a823
+ ld de, EnemyMoveAnimation
+ ld bc, $008f
+ call CopyBytes
+ call CloseSRAM
+ ld a, $8
+ ld [BGMapBuffer], a
+ ld a, $c6
+ ld [$cd21], a
+ ld a, $11
+ ld [CreditsTimer], a
+ ld a, $c6
+ ld [$cd23], a
+ ld a, $41
+ ld [$cd24], a
+ ld a, $c6
+ ld [$cd25], a
+ ld a, $46
+ ld [$cd26], a
+ ld a, $c6
+ ld [$cd27], a
+ ld a, $4b
+ ld [$cd28], a
+ ld a, $c6
+ ld [$cd29], a
+ call Function11b98f
+ callba Function14a58
+ ret
+; 11b98f
+
Function11b98f: ; 11b98f
ld hl, PartyCount
ld a, [hl]
@@ -70778,9 +82636,17 @@
ret
; 11ba38
-INCBIN "baserom.gbc", $11ba38, $11bc9e - $11ba38
+Function11ba38: ; 11ba38
+ callba Functione538
+ ret c
+ xor a
+ ld [ScriptVar], a
+ ret
+; 11ba44
+INCBIN "baserom.gbc", $11ba44, $11bc9e - $11ba44
+
SECTION "bank47",ROMX,BANK[$47]
Function11c000: ; 11c000
@@ -70854,9 +82720,93 @@
ret
; 11c05d
-INCBIN "baserom.gbc", $11c05d, $11c0c6 - $11c05d
+Function11c05d: ; 11c05d
+ ld a, e
+ or d
+ jr z, .asm_11c071
+ ld a, e
+ and d
+ cp $ff
+ jr z, .asm_11c071
+ push hl
+ call Function11c156
+ pop hl
+ call PlaceString
+ and a
+ ret
+.asm_11c071
+ ld c, l
+ ld b, h
+ scf
+ ret
+; 11c075
+Function11c075: ; 11c075
+ push de
+ ld a, c
+ call Function11c254
+ pop de
+ ld bc, $cd36
+ call Function11c08f
+ ret
+; 11c082
+
+INCBIN "baserom.gbc", $11c082, $11c08f - $11c082
+
+Function11c08f: ; 11c08f
+ ld l, e
+ ld h, d
+ push hl
+ ld a, $3
+.asm_11c094
+ push af
+ ld a, [bc]
+ ld e, a
+ inc bc
+ ld a, [bc]
+ ld d, a
+ inc bc
+ push bc
+ call Function11c05d
+ jr c, .asm_11c0a2
+ inc bc
+
+.asm_11c0a2
+ ld l, c
+ ld h, b
+ pop bc
+ pop af
+ dec a
+ jr nz, .asm_11c094
+ pop hl
+ ld de, $0028
+ add hl, de
+ ld a, $3
+.asm_11c0b0
+ push af
+ ld a, [bc]
+ ld e, a
+ inc bc
+ ld a, [bc]
+ ld d, a
+ inc bc
+ push bc
+ call Function11c05d
+ jr c, .asm_11c0be
+ inc bc
+
+.asm_11c0be
+ ld l, c
+ ld h, b
+ pop bc
+ pop af
+ dec a
+ jr nz, .asm_11c0b0
+ ret
+; 11c0c6
+
+
Function11c0c6: ; 11c0c6
ld a, [$cf63]
ld l, a
@@ -71012,9 +82962,377 @@
jr .asm_11c18f
; 11c1ab
-INCBIN "baserom.gbc", $11c1ab, $11f686 - $11c1ab
+Function11c1ab: ; 11c1ab
+ ld a, [$ffaa]
+ push af
+ ld a, $1
+ ld [$ffaa], a
+ call Function11c1b9
+ pop af
+ ld [$ffaa], a
+ ret
+; 11c1b9
+Function11c1b9: ; 11c1b9
+ call Function11c1ca
+ ld a, [rSVBK]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ call Function11c283
+ pop af
+ ld [rSVBK], a
+ ret
+; 11c1ca
+Function11c1ca: ; 11c1ca
+ xor a
+ ld [$cf63], a
+ ld [$cf64], a
+ ld [$cf65], a
+ ld [$cf66], a
+ ld [$cd23], a
+ ld [BGMapBuffer], a
+ ld [$cd21], a
+ ld [CreditsTimer], a
+ ld [$cd35], a
+ ld [$cd2b], a
+ ld a, $ff
+ ld [$cd24], a
+ ld a, [$cfa9]
+ dec a
+ call Function11c254
+ call WhiteBGMap
+ call ClearSprites
+ call Functionfdb
+ call Function11d323
+ call Function32f9
+ call DisableLCD
+ ld hl, $567e
+ ld de, VTiles2
+ ld bc, $0060
+ call CopyBytes
+ ld hl, $56de
+ ld de, VTiles0
+ call Decompress
+ call EnableLCD
+ callba Function104061
+ callba Function8cf53
+ callba Function1500c
+ callba Function40c30
+ ld a, [rSVBK]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ ld hl, PlayerSDefLevel
+ ld de, LYOverrides
+ ld bc, Start
+ call CopyBytes
+ pop af
+ ld [rSVBK], a
+ call Function11d4aa
+ call Function11d3ba
+ ret
+; 11c254
+
+Function11c254: ; 11c254
+ push af
+ ld a, $4
+ call GetSRAMBank
+ ld hl, $a007
+ pop af
+ sla a
+ sla a
+ ld c, a
+ sla a
+ add c
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld de, $cd36
+ ld bc, $000c
+ call CopyBytes
+ call CloseSRAM
+ ret
+; 11c277
+
+INCBIN "baserom.gbc", $11c277, $11c283 - $11c277
+
+Function11c283: ; 11c283
+.asm_11c283
+ call Functiona57
+ ld a, [hJoyPressed]
+ ld [hJoypadPressed], a
+ ld a, [$cf63]
+ bit 7, a
+ jr nz, .asm_11c2a2
+ call Function11c2ac
+ callba Function8cf69
+ callba Function104061
+ jr .asm_11c283
+
+.asm_11c2a2
+ callba Function8cf53
+ call ClearSprites
+ ret
+; 11c2ac
+
+Function11c2ac: ; 11c2ac
+ ld a, [$cf63]
+ ld e, a
+ ld d, $0
+ ld hl, $42bb
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 11c2bb
+
+INCBIN "baserom.gbc", $11c2bb, $11d323 - $11c2bb
+
+Function11d323: ; 11d323
+ ld a, [rSVBK]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ ld hl, $533a
+ ld de, Unkn1Pals
+ ld bc, $0080
+ call CopyBytes
+ pop af
+ ld [rSVBK], a
+ ret
+; 11d33a
+
+INCBIN "baserom.gbc", $11d33a, $11d3ba - $11d33a
+
+Function11d3ba: ; 11d3ba
+ ld a, [rSVBK]
+ push af
+ ld hl, BattleMonSpclDef
+ ld a, $0
+ ld [$cd2d], a
+ ld [hli], a
+ ld a, $d8
+ ld [$cd2e], a
+ ld [hl], a
+ ld a, $fe
+ ld [$cd2f], a
+ ld a, $54
+ ld [$cd30], a
+ ld a, $a8
+ ld [$cd31], a
+ ld a, $c6
+ ld [$cd32], a
+ ld a, $4a
+ ld [$cd33], a
+ ld a, $c6
+ ld [$cd34], a
+ ld hl, $723c
+ ld a, $2d
+
+Function11d3ef: ; 11d3ef
+ push af
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ ld a, [hli]
+ ld c, a
+ ld a, [hli]
+ ld b, a
+ push hl
+ ld hl, Unkn1Pals
+ add hl, de
+ ld a, [$cd2d]
+ ld e, a
+ ld a, [$cd2e]
+ ld d, a
+ push bc
+.asm_11d406
+ ld a, $3
+ ld [rSVBK], a
+ ld a, [hli]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ pop af
+ ld [de], a
+ inc de
+ ld a, $3
+ ld [rSVBK], a
+ ld a, [hli]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+ pop af
+ ld [de], a
+ inc de
+ dec bc
+ ld a, c
+ or b
+ jr nz, .asm_11d406
+ ld a, [$cd2f]
+ ld l, a
+ ld a, [$cd30]
+ ld h, a
+ ld a, [hli]
+ ld c, a
+ ld a, [hli]
+ ld b, a
+ ld a, l
+ ld [$cd2f], a
+ ld a, h
+ ld [$cd30], a
+ push bc
+ pop hl
+ ld c, $0
+.asm_11d43d
+ ld a, [hl]
+ cp $ff
+ jr z, .asm_11d453
+ call Function11d493
+ jr nz, .asm_11d44a
+ inc hl
+ jr .asm_11d43d
+
+.asm_11d44a
+ ld a, [hli]
+ ld [de], a
+ inc de
+ xor a
+ ld [de], a
+ inc de
+ inc c
+ jr .asm_11d43d
+
+.asm_11d453
+ pop hl
+ ld b, $0
+ add hl, bc
+ push hl
+ pop bc
+ ld a, [$cd31]
+ ld l, a
+ ld a, [$cd32]
+ ld h, a
+ ld a, c
+ ld [hli], a
+ ld a, b
+ ld [hli], a
+ ld a, l
+ ld [$cd31], a
+ ld a, h
+ ld [$cd32], a
+ ld a, [$cd33]
+ ld l, a
+ ld a, [$cd34]
+ ld h, a
+ ld a, e
+ ld [$cd2d], a
+ ld [hli], a
+ ld a, d
+ ld [$cd2e], a
+ ld [hli], a
+ ld a, l
+ ld [$cd33], a
+ ld a, h
+ ld [$cd34], a
+ pop hl
+ pop af
+ dec a
+ jr z, .asm_11d48f
+ jp Function11d3ef
+
+.asm_11d48f
+ pop af
+ ld [rSVBK], a
+ ret
+; 11d493
+
+Function11d493: ; 11d493
+ push hl
+ push bc
+ push de
+ dec a
+ ld hl, rSVBK
+ ld e, $1
+ ld [hl], e
+ call CheckCaughtMon
+ ld hl, rSVBK
+ ld e, $5
+ ld [hl], e
+ pop de
+ pop bc
+ pop hl
+ ret
+; 11d4aa
+
+Function11d4aa: ; 11d4aa
+ ld a, [rSVBK]
+ push af
+ ld a, $3
+ ld [rSVBK], a
+ ld hl, $5aac
+ ld bc, $7220
+ xor a
+ ld [$cd2d], a
+ inc a
+ ld [$cd2e], a
+ ld a, $e
+.asm_11d4c1
+ push af
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ push hl
+ ld hl, $0005
+ add hl, de
+ ld a, [bc]
+ inc bc
+ inc bc
+ push bc
+.asm_11d4cf
+ push af
+ push hl
+ ld a, [hli]
+ ld e, a
+ ld a, [hl]
+ ld d, a
+ ld hl, Unkn1Pals
+ add hl, de
+ ld a, [$cd2d]
+ ld [hli], a
+ inc a
+ ld [$cd2d], a
+ ld a, [$cd2e]
+ ld [hl], a
+ pop hl
+ ld de, $0008
+ add hl, de
+ pop af
+ dec a
+ jr nz, .asm_11d4cf
+ ld hl, $cd2d
+ xor a
+ ld [hli], a
+ inc [hl]
+ pop bc
+ pop hl
+ pop af
+ dec a
+ jr nz, .asm_11d4c1
+ pop af
+ ld [rSVBK], a
+ ret
+; 11d4fe
+
+INCBIN "baserom.gbc", $11d4fe, $11f686 - $11d4fe
+
+
SECTION "bank48",ROMX,BANK[$48]
PicPointers:
@@ -71839,9 +84157,116 @@
SECTION "bank5B",ROMX,BANK[$5B]
-INCBIN "baserom.gbc", $16c000, $16d69a - $16c000
+INCBIN "baserom.gbc", $16c000, $16d421 - $16c000
+Function16d421: ; 16d421
+ ld de, $4fc1
+ ld hl, VTiles2
+ ld bc, $5b46
+ call Get2bpp
+ ret
+; 16d42e
+Function16d42e: ; 16d42e
+ ld hl, $5465
+ ld de, TileMap
+ ld bc, $0168
+ call CopyBytes
+ ret
+; 16d43b
+
+INCBIN "baserom.gbc", $16d43b, $16d61d - $16d43b
+
+Function16d61d: ; 16d61d
+ ld h, d
+ ld l, e
+ push bc
+ push hl
+ call Function16d640
+ pop hl
+ pop bc
+ ld de, $0939
+ add hl, de
+ inc b
+ inc b
+ inc c
+ inc c
+ ld a, $7
+.asm_16d630
+ push bc
+ push hl
+.asm_16d632
+ ld [hli], a
+ dec c
+ jr nz, .asm_16d632
+ pop hl
+ ld de, $0014
+ add hl, de
+ pop bc
+ dec b
+ jr nz, .asm_16d630
+ ret
+; 16d640
+
+Function16d640: ; 16d640
+ push hl
+ ld a, $30
+ ld [hli], a
+ inc a
+ call Function16d66d
+ inc a
+ ld [hl], a
+ pop hl
+ ld de, $0014
+ add hl, de
+.asm_16d64f
+ push hl
+ ld a, $33
+ ld [hli], a
+ ld a, $7f
+ call Function16d66d
+ ld [hl], $34
+ pop hl
+ ld de, $0014
+ add hl, de
+ dec b
+ jr nz, .asm_16d64f
+ ld a, $35
+ ld [hli], a
+ ld a, $36
+ call Function16d66d
+ ld [hl], $37
+ ret
+; 16d66d
+
+Function16d66d: ; 16d66d
+ ld d, c
+.asm_16d66e
+ ld [hli], a
+ dec d
+ jr nz, .asm_16d66e
+ ret
+; 16d673
+
+Function16d673: ; 16d673
+ call Function16d696
+ call Function16d6ae
+ callba Function49856
+ callba Functionfb60d
+ ld hl, $c5fe
+ ld de, $568f
+ call PlaceString
+ ret
+; 16d68f
+
+INCBIN "baserom.gbc", $16d68f, $16d696 - $16d68f
+
+Function16d696: ; 16d696
+ call Function16d421
+ ret
+; 16d69a
+
+
Function16d69a: ; 16d69a
ld de, $52c1
ld hl, $9760
@@ -71850,14 +84275,389 @@
ret
; 16d6a7
-INCBIN "baserom.gbc", $16d6a7, $16d7fe - $16d6a7
+Function16d6a7: ; 16d6a7
+ callba Function49811
+ ret
+; 16d6ae
+Function16d6ae: ; 16d6ae
+ call Function16d42e
+ ld hl, $55cd
+ ld de, TileMap
+ ld bc, $0028
+ call CopyBytes
+ ld hl, $55f5
+ ld de, $c5e0
+ ld bc, $0028
+ call CopyBytes
+ ret
+; 16d6ca
+Function16d6ca: ; 16d6ca
+ call Function16d61d
+ ret
+; 16d6ce
+
+Function16d6ce: ; 16d6ce
+ call Function1d6e
+ call Function16d6e1
+ callba Function87d
+ call Function1d7d
+ call Function3200
+ ret
+; 16d6e1
+
+Function16d6e1: ; 16d6e1
+ ld hl, $c56c
+ ld b, $1
+ ld c, $a
+ ld a, $10
+ call Predef
+ ld hl, $c581
+ ld de, $5701
+ call PlaceString
+ call WaitBGMap
+ call Function3200
+ ld c, $32
+ jp DelayFrames
+; 16d701
+
+INCBIN "baserom.gbc", $16d701, $16d70c - $16d701
+
+Function16d70c: ; 16d70c
+ call Function16d725
+ call Function16d713
+ ret
+; 16d713
+
+Function16d713: ; 16d713
+ push bc
+ push af
+ ld a, [$ffa9]
+ and $f0
+ ld b, a
+ ld a, [hJoyPressed]
+ and $f
+ or b
+ ld b, a
+ pop af
+ ld a, b
+ pop bc
+ ld d, a
+ ret
+; 16d725
+
+Function16d725: ; 16d725
+ ld hl, $cfa6
+ res 7, [hl]
+ ld a, [hBGMapMode]
+ push af
+ call Function16d734
+ pop af
+ ld [hBGMapMode], a
+ ret
+; 16d734
+
+Function16d734: ; 16d734
+.asm_16d734
+ call Function16d77a
+ call Function16d759
+ call Function16d76a
+ jr nc, .asm_16d758
+ callba Function24270
+ jr c, .asm_16d758
+ ld a, [$cfa5]
+ bit 7, a
+ jr nz, .asm_16d758
+ call Function16d713
+ ld b, a
+ ld a, [$cfa8]
+ and b
+ jr z, .asm_16d734
+
+.asm_16d758
+ ret
+; 16d759
+
+Function16d759: ; 16d759
+ ld a, [hOAMUpdate]
+ push af
+ ld a, $1
+ ld [hOAMUpdate], a
+ call WaitBGMap
+ pop af
+ ld [hOAMUpdate], a
+ xor a
+ ld [hBGMapMode], a
+ ret
+; 16d76a
+
+Function16d76a: ; 16d76a
+.asm_16d76a
+ call RTC
+ call Function16d7e7
+ ret c
+ ld a, [$cfa5]
+ bit 7, a
+ jr z, .asm_16d76a
+ and a
+ ret
+; 16d77a
+
+Function16d77a: ; 16d77a
+ ld hl, $cfac
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, [hl]
+ cp $1f
+ jr nz, .asm_16d792
+ ld a, [$cfab]
+ ld [hl], a
+ push hl
+ push bc
+ ld bc, $000b
+ add hl, bc
+ ld [hl], a
+ pop bc
+ pop hl
+
+.asm_16d792
+ ld a, [$cfa1]
+ ld b, a
+ ld a, [$cfa2]
+ ld c, a
+ call Function1d05
+ ld a, [$cfa7]
+ swap a
+ and $f
+ ld c, a
+ ld a, [$cfa9]
+ ld b, a
+ xor a
+ dec b
+ jr z, .asm_16d7b1
+.asm_16d7ad
+ add c
+ dec b
+ jr nz, .asm_16d7ad
+
+.asm_16d7b1
+ ld c, $14
+ call AddNTimes
+ ld a, [$cfa7]
+ and $f
+ ld c, a
+ ld a, [$cfaa]
+ ld b, a
+ xor a
+ dec b
+ jr z, .asm_16d7c8
+.asm_16d7c4
+ add c
+ dec b
+ jr nz, .asm_16d7c4
+
+.asm_16d7c8
+ ld c, a
+ add hl, bc
+ ld a, [hl]
+ cp $1f
+ jr z, .asm_16d7de
+ ld [$cfab], a
+ ld [hl], $1f
+ push hl
+ push bc
+ ld bc, $000b
+ add hl, bc
+ ld [hl], $1f
+ pop bc
+ pop hl
+
+.asm_16d7de
+ ld a, l
+ ld [$cfac], a
+ ld a, h
+ ld [$cfad], a
+ ret
+; 16d7e7
+
+Function16d7e7: ; 16d7e7
+ ld a, [$cfa5]
+ bit 6, a
+ jr z, .asm_16d7f4
+ callba Function8cf62
+
+.asm_16d7f4
+ call Functiona57
+ call Function16d713
+ and a
+ ret z
+ scf
+ ret
+; 16d7fe
+
+
SECTION "bank5C",ROMX,BANK[$5C]
-INCBIN "baserom.gbc", $170000, $170923 - $170000
+INCBIN "baserom.gbc", $170000, $1700b0 - $170000
+Function1700b0: ; 1700b0
+ call Function17021e
+ callba Function118121
+ ret
+; 1700ba
+Function1700ba: ; 1700ba
+ call Function17021e
+ callba Function11811a
+ ret
+; 1700c4
+
+INCBIN "baserom.gbc", $1700c4, $170114 - $1700c4
+
+Function170114: ; 170114
+ call Function17021e
+ call Function170121
+ callba Function11805f
+ ret
+; 170121
+
+Function170121: ; 170121
+ ld a, $5
+ call GetSRAMBank
+ ld hl, $a948
+ ld de, EnemyMoveAnimation
+ ld bc, $00f6
+ call CopyBytes
+ call CloseSRAM
+ call Function170c8b
+ ret
+; 170139
+
+INCBIN "baserom.gbc", $170139, $170215 - $170139
+
+Function170215: ; 170215
+ xor a
+ ld [$cf63], a
+ call Function17022c
+ ret
+; 17021d
+
+Function17021d: ; 17021d
+ ret
+; 17021e
+
+Function17021e: ; 17021e
+ xor a
+ ld [$cf63], a
+ ld [$cf64], a
+ ld [$cf65], a
+ ld [$cf66], a
+ ret
+; 17022c
+
+Function17022c: ; 17022c
+.asm_17022c
+ call Function17023a
+ call DelayFrame
+ ld a, [$cf63]
+ cp $1
+ jr nz, .asm_17022c
+ ret
+; 17023a
+
+Function17023a: ; 17023a
+ ld a, [$cf63]
+ ld e, a
+ ld d, $0
+ ld hl, $4249
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 170249
+
+INCBIN "baserom.gbc", $170249, $1704e1 - $170249
+
+Function1704e1: ; 1704e1
+ call SpeechTextBox
+ call FadeToMenu
+ call Function17021e
+ call Function1704f1
+ call Function2b3c
+ ret
+; 1704f1
+
+Function1704f1: ; 1704f1
+ call WhiteBGMap
+ call ClearSprites
+ call Functionfdb
+.asm_1704fa
+ call Functiona57
+ ld a, [$cf63]
+ bit 7, a
+ jr nz, .asm_17050f
+ call Function170510
+ callba Function104061
+ jr .asm_1704fa
+
+.asm_17050f
+ ret
+; 170510
+
+Function170510: ; 170510
+ ld a, [$cf63]
+ ld e, a
+ ld d, $0
+ ld hl, $451f
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 17051f
+
+INCBIN "baserom.gbc", $17051f, $170687 - $17051f
+
+Function170687: ; 170687
+ ld a, [ScriptVar]
+ ld e, a
+ ld d, $0
+ ld hl, $4696
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 170696
+
+INCBIN "baserom.gbc", $170696, $17089a - $170696
+
+Function17089a: ; 17089a
+ ld a, [$cfcd]
+ and a
+ jr z, .asm_1708ad
+ callba Function14bcb
+ jr z, .asm_1708ab
+ xor a
+ jr .asm_1708ad
+
+.asm_1708ab
+ ld a, $1
+
+.asm_1708ad
+ ld [ScriptVar], a
+ ret
+; 1708b1
+
+INCBIN "baserom.gbc", $1708b1, $170923 - $1708b1
+
+
Function170923: ; 170923
ld a, $5
call GetSRAMBank
@@ -71871,9 +84671,87 @@
ret
; 17093c
-INCBIN "baserom.gbc", $17093c, $17367f - $17093c
+INCBIN "baserom.gbc", $17093c, $170b44 - $17093c
+Function170b44: ; 170b44
+ callba Function1f8000
+ ld a, [rSVBK]
+ push af
+ ld a, $3
+ ld [rSVBK], a
+ ld hl, $d10a
+ ld a, [hl]
+ dec a
+ ld c, a
+ ld b, $0
+ pop af
+ ld [rSVBK], a
+ ld hl, $4b90
+ add hl, bc
+ ld a, [hl]
+ ld [$cd49], a
+ ld a, [ScriptVar]
+ dec a
+ sla a
+ ld e, a
+ sla a
+ sla a
+ sla a
+ ld c, a
+ ld b, $0
+ ld d, $0
+ ld hl, MapObjects
+ add hl, bc
+ inc hl
+ ld a, [$cd49]
+ ld [hl], a
+ ld hl, UsedSprites
+ add hl, de
+ ld [hli], a
+ ld [$ffbd], a
+ ld a, [hl]
+ ld [$ffbe], a
+ callba Function143c8
+ ret
+; 170b90
+INCBIN "baserom.gbc", $170b90, $170bd2 - $170b90
+
+Function170bd2: ; 170bd2
+ ret
+; 170bd3
+
+Function170bd3: ; 170bd3
+ callba Function8b201
+ jr c, .asm_170bde
+ xor a
+ jr .asm_170be0
+
+.asm_170bde
+ ld a, $1
+
+.asm_170be0
+ ld [ScriptVar], a
+ ret
+; 170be4
+
+INCBIN "baserom.gbc", $170be4, $170c8b - $170be4
+
+Function170c8b: ; 170c8b
+ ld hl, LastPlayerCounterMove
+ ld b, $5
+.asm_170c90
+ ld a, [hl]
+ xor $ff
+ ld [hli], a
+ dec b
+ jr nz, .asm_170c90
+ ret
+; 170c98
+
+INCBIN "baserom.gbc", $170c98, $17367f - $170c98
+
+
SECTION "bank5D",ROMX,BANK[$5D]
INCLUDE "text/phone/extra3.asm"
@@ -71972,9 +84850,429 @@
ret
; 17c083
-INCBIN "baserom.gbc", $17c083, $17f036 - $17c083
+INCBIN "baserom.gbc", $17c083, $17d0b3 - $17c083
+Function17d0b3: ; 17d0b3
+.asm_17d0b3
+ ld a, [de]
+ inc de
+ and a
+ jr z, .asm_17d0ee
+ cp $60
+ jr nc, .asm_17d0ee
+ cp $4e
+ jr z, .asm_17d0ee
+ cp $50
+ jr z, .asm_17d0ee
+ cp $5
+ jr c, .asm_17d0ec
+ cp $14
+ jr c, .asm_17d0ee
+ cp $19
+ jr c, .asm_17d0ec
+ cp $1d
+ jr c, .asm_17d0ee
+ cp $26
+ jr c, .asm_17d0ec
+ cp $35
+ jr c, .asm_17d0ee
+ cp $3a
+ jr c, .asm_17d0ec
+ cp $3f
+ jr c, .asm_17d0ee
+ cp $40
+ jr c, .asm_17d0ec
+ cp $49
+ jr c, .asm_17d0ee
+.asm_17d0ec
+ scf
+ ret
+
+.asm_17d0ee
+ dec c
+ jr nz, .asm_17d0b3
+ and a
+ ret
+; 17d0f3
+
+INCBIN "baserom.gbc", $17d0f3, $17d1e1 - $17d0f3
+
+Function17d1e1: ; 17d1e1
+.asm_17d1e1
+ ld a, [de]
+ inc de
+ cp $4e
+ jr nz, .asm_17d1ea
+ dec b
+ jr z, .asm_17d1ef
+
+.asm_17d1ea
+ dec c
+ jr nz, .asm_17d1e1
+ and a
+ ret
+
+.asm_17d1ef
+ scf
+ ret
+; 17d1f1
+
+Function17d1f1: ; 17d1f1
+ ld a, [CurPartySpecies]
+ dec a
+ call SetSeenAndCaughtMon
+ ld a, [CurPartySpecies]
+ cp $c9
+ jr nz, .asm_17d223
+ ld hl, PartyMon1DVs
+ ld a, [PartyCount]
+ dec a
+ ld bc, $0030
+ call AddNTimes
+ ld a, $2d
+ call Predef
+ callab Functionfba18
+ ld a, [$def4]
+ and a
+ jr nz, .asm_17d223
+ ld a, [UnownLetter]
+ ld [$def4], a
+
+.asm_17d223
+ ret
+; 17d224
+
+Function17d224: ; 17d224
+ ld a, [ScriptVar]
+ and a
+ jr nz, .asm_17d234
+ ld a, $4
+ ld [ScriptVar], a
+ ld hl, $526a
+ jr .asm_17d23c
+
+.asm_17d234
+ ld a, $4
+ ld [ScriptVar], a
+ ld hl, $528f
+
+.asm_17d23c
+ call LoadMenuDataHeader
+ call Function17d246
+ call Function1c17
+ ret
+; 17d246
+
+Function17d246: ; 17d246
+ call Function1d81
+ jr c, .asm_17d264
+ ld a, [ScriptVar]
+ cp $5
+ jr nz, .asm_17d25d
+ ld a, [$cfa9]
+ cp $3
+ ret z
+ jr c, .asm_17d25d
+ dec a
+ jr .asm_17d260
+
+.asm_17d25d
+ ld a, [$cfa9]
+
+.asm_17d260
+ ld [ScriptVar], a
+ ret
+
+.asm_17d264
+ ld a, $4
+ ld [ScriptVar], a
+ ret
+; 17d26a
+
+INCBIN "baserom.gbc", $17d26a, $17d2b6 - $17d26a
+
+Function17d2b6: ; 17d2b6
+ call Function17d2c0
+ callba Function1181da
+ ret
+; 17d2c0
+
+Function17d2c0: ; 17d2c0
+ xor a
+ ld [$cf63], a
+ ld [$cf64], a
+ ld [$cf65], a
+ ld [$cf66], a
+ ret
+; 17d2ce
+
+Function17d2ce: ; 17d2ce
+ ld a, $5
+ call GetSRAMBank
+ ld a, [$aa72]
+ call CloseSRAM
+ and a
+ jr nz, .asm_17d2e2
+ ld a, $1
+ ld [ScriptVar], a
+ ret
+
+.asm_17d2e2
+ call Function17d314
+ ret c
+ call SpeechTextBox
+ call FadeToMenu
+ ld a, [rSVBK]
+ push af
+ ld a, $4
+ ld [rSVBK], a
+ call Function17d370
+ call Function17d45a
+ pop af
+ ld [rSVBK], a
+ ld de, $0066
+ ld a, e
+ ld [CurMusic], a
+ ld [MusicFadeIDLo], a
+ ld a, d
+ ld [MusicFadeIDHi], a
+ call StartMusic
+ call Function222a
+ call Function2b3c
+ ret
+; 17d314
+
+Function17d314: ; 17d314
+ ld a, $5
+ call GetSRAMBank
+ ld a, [$b1b1]
+ call CloseSRAM
+ cp $21
+ jr nc, .asm_17d354
+ ld a, $6
+ call GetSRAMBank
+ ld l, $0
+ ld h, l
+ ld de, $a006
+ ld a, [$a004]
+ ld c, a
+ ld a, [$a005]
+ ld b, a
+.asm_17d336
+ push bc
+ ld a, [de]
+ inc de
+ ld c, a
+ ld b, $0
+ add hl, bc
+ pop bc
+ dec bc
+ ld a, b
+ or c
+ jr nz, .asm_17d336
+ ld a, [$a002]
+ cp l
+ jr nz, .asm_17d354
+ ld a, [$a003]
+ cp h
+ jr nz, .asm_17d354
+ call CloseSRAM
+ and a
+ ret
+
+.asm_17d354
+ call CloseSRAM
+ ld a, $5
+ call GetSRAMBank
+ xor a
+ ld hl, $aa73
+ ld bc, $000c
+ call ByteFill
+ call CloseSRAM
+ ld a, $2
+ ld [ScriptVar], a
+ scf
+ ret
+; 17d370
+
+Function17d370: ; 17d370
+ xor a
+ ld [$cd77], a
+ ld [$cd78], a
+ ld [$cd79], a
+ dec a
+ ld [$cd6c], a
+ call WhiteBGMap
+ call ClearSprites
+ call Functionfdb
+ callba Function104061
+ call DisableLCD
+ ld hl, $8ee0
+ ld de, EnemyMoveAnimation
+ ld bc, $0010
+ call CopyBytes
+ ld a, $1
+ ld [rVBK], a
+ ld hl, $66fe
+ ld de, VTiles1
+ ld bc, $0480
+ call CopyBytes
+ xor a
+ ld hl, $97f0
+ ld bc, $0010
+ call ByteFill
+ ld hl, EnemyMoveAnimation
+ ld de, $8ee0
+ ld bc, $0010
+ call CopyBytes
+ xor a
+ ld [rVBK], a
+ ld hl, $6b7e
+ ld de, $9600
+ ld bc, $0010
+ call CopyBytes
+ call EnableLCD
+ call Function17d60b
+ ld a, $0
+ ld [BGMapBuffer], a
+ ld a, $d0
+ ld [$cd21], a
+ ld a, $6
+ call GetSRAMBank
+ ld hl, $a006
+ ld de, Unkn1Pals
+ ld bc, $1000
+ call CopyBytes
+ call CloseSRAM
+ ret
+; 17d3f6
+
+INCBIN "baserom.gbc", $17d3f6, $17d45a - $17d3f6
+
+Function17d45a: ; 17d45a
+.asm_17d45a
+ call Functiona57
+ ld a, [$cd77]
+ bit 7, a
+ jr nz, .asm_17d46f
+ call Function17d474
+ callba Function104061
+ jr .asm_17d45a
+
+.asm_17d46f
+ xor a
+ ld [ScriptVar], a
+ ret
+; 17d474
+
+Function17d474: ; 17d474
+ ld a, [$cd77]
+ ld e, a
+ ld d, $0
+ ld hl, $5483
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 17d483
+
+INCBIN "baserom.gbc", $17d483, $17d60b - $17d483
+
+Function17d60b: ; 17d60b
+ ld a, $5
+ call GetSRAMBank
+ ld hl, $b1d3
+ ld de, EnemyMoveAnimation
+ ld bc, $0020
+ call CopyBytes
+ ld a, [$b1b1]
+ ld c, a
+ ld a, [$b1b2]
+ ld b, a
+ ld a, [$b1b3]
+ ld l, a
+ ld a, [$b1b4]
+ ld h, a
+ call CloseSRAM
+ ld a, $6
+ call GetSRAMBank
+ ld de, $c708
+ ld a, c
+ and a
+ jr z, .asm_17d684
+.asm_17d63b
+ push bc
+ ld a, l
+ ld [de], a
+ inc de
+ ld a, h
+ ld [de], a
+ inc de
+ ld bc, $000a
+ add hl, bc
+ pop bc
+ ld a, [hli]
+ ld [$cd4a], a
+ ld a, [hli]
+ ld [$cd49], a
+ push hl
+ push de
+ ld hl, EnemyMoveAnimation
+ ld e, b
+ ld d, $0
+ add hl, de
+ ld a, [hli]
+ ld [$cd4b], a
+ ld a, [hl]
+ ld [$cd4c], a
+ pop de
+ pop hl
+ inc b
+ inc b
+ dec c
+ dec c
+ jr z, .asm_17d684
+ push bc
+ push de
+ ld a, [$cd49]
+ ld c, a
+ ld a, [$cd4a]
+ ld b, a
+ ld a, [$cd4b]
+ ld e, a
+ ld a, [$cd4c]
+ ld d, a
+.asm_17d67a
+ add hl, de
+ dec bc
+ ld a, c
+ or b
+ jr nz, .asm_17d67a
+ pop de
+ pop bc
+ jr .asm_17d63b
+
+.asm_17d684
+ call CloseSRAM
+ ld a, $5
+ call GetSRAMBank
+ ld hl, $c708
+ ld de, $b1b3
+ ld a, [$b1b1]
+ ld c, a
+ ld a, [$b1b2]
+ ld b, a
+ call CopyBytes
+ call CloseSRAM
+ ret
+; 17d6a1
+
+INCBIN "baserom.gbc", $17d6a1, $17f036 - $17d6a1
+
+
Function17f036: ; 17f036
ld a, $6
call GetSRAMBank
@@ -71999,8 +85297,8 @@
dec a
push de
ld e, a
- ld d, $0
- ld hl, $7061
+ ld d, 0
+ ld hl, Table17f061
add hl, de
add hl, de
ld a, [hli]
@@ -72013,9 +85311,1166 @@
ret
; 17f061
-INCBIN "baserom.gbc", $17f061, $17ff6c - $17f061
+Table17f061: ; 17f061
+ dw Function17f081
+ dw Function17f0f8
+ dw Function17f154
+ dw Function17f181
+ dw Function17f1d0
+ dw Function17f220
+ dw Function17f27b
+ dw Function17f2cb
+ dw Function17f2ff
+ dw Function17f334
+ dw Function17f382
+ dw Function17f3c9
+ dw Function17f3f0
+ dw Function17f41d
+ dw Function17f44f
+ dw Function17f44f
+; 17f081
+Function17f081: ; 17f081
+ pop hl
+ call Function17f524
+ jr c, .asm_17f09f
+ ld de, $0004
+ add hl, de
+ ld a, [hli]
+ inc hl
+ inc hl
+ ld e, l
+ ld d, h
+ ld l, c
+ ld h, b
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [de]
+ cp $50
+ jr z, .asm_17f09d
+ and a
+ ret
+.asm_17f09d
+ scf
+ ret
+
+.asm_17f09f
+ push bc
+ ld de, $cd54
+ ld bc, $0007
+ call CopyBytes
+ pop bc
+ push hl
+ push bc
+ call Function17f4f6
+ pop bc
+ ld a, [$cd54]
+ ld e, a
+ ld a, [$cd55]
+ ld d, a
+ add hl, de
+ ld e, l
+ ld d, h
+ ld l, c
+ ld h, b
+ push hl
+ ld a, [$cd56]
+ ld b, a
+ ld a, [$cd57]
+ ld c, a
+ call Function31a4
+ ld a, l
+ ld [$cd52], a
+ ld a, h
+ ld [$cd53], a
+ ld a, [$cd59]
+ and a
+ jr z, .asm_17f0ee
+ ld c, a
+ ld a, [$cd57]
+ inc a
+ ld b, a
+ ld e, l
+ ld d, h
+ dec de
+.asm_17f0e0
+ ld a, c
+ cp b
+ jr z, .asm_17f0ea
+ ld a, [de]
+ dec de
+ ld [hld], a
+ dec b
+ jr .asm_17f0e0
+
+.asm_17f0ea
+ ld a, [$cd5a]
+ ld [hl], a
+
+.asm_17f0ee
+ pop hl
+ ld a, [$cd58]
+ call Function17f50f
+ pop de
+ and a
+ ret
+; 17f0f8
+
+Function17f0f8: ; 17f0f8
+ pop hl
+ call Function17f524
+ jr c, .asm_17f114
+ ld de, $0003
+ add hl, de
+ ld a, [hli]
+ ld e, l
+ ld d, h
+ ld l, c
+ ld h, b
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [de]
+ cp $50
+ jr z, .asm_17f112
+ and a
+ ret
+
+.asm_17f112
+ scf
+ ret
+
+.asm_17f114
+ push bc
+ ld de, $cd54
+ ld bc, $0004
+ call CopyBytes
+ pop bc
+ push hl
+ push bc
+ call Function17f4f6
+ ld a, [$cd54]
+ ld e, a
+ ld a, [$cd55]
+ ld d, a
+ add hl, de
+ ld de, EnemyMoveAnimation
+ ld a, [$cd56]
+ ld c, a
+ ld b, $0
+ call CopyBytes
+ ld a, $50
+ ld [de], a
+ pop hl
+ ld de, EnemyMoveAnimation
+ call PlaceString
+ ld a, c
+ ld [$cd52], a
+ ld a, b
+ ld [$cd53], a
+ ld a, [$cd57]
+ call Function17f50f
+ pop de
+ and a
+ ret
+; 17f154
+
+Function17f154: ; 17f154
+ pop hl
+ call Function17f524
+ jr c, .asm_17f167
+ inc hl
+ inc hl
+ ld e, l
+ ld d, h
+ ld a, [de]
+ cp $50
+ jr z, .asm_17f165
+ and a
+ ret
+
+.asm_17f165
+ scf
+ ret
+
+.asm_17f167
+ push bc
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ pop bc
+ push hl
+ push bc
+ call Function17f4f6
+ add hl, de
+ ld c, l
+ ld b, h
+ pop de
+ callba Function11c08f
+ ld c, l
+ ld b, h
+ pop de
+ and a
+ ret
+; 17f181
+
+Function17f181: ; 17f181
+ pop hl
+ call Function17f524
+ jr c, .asm_17f19d
+ ld de, $0002
+ add hl, de
+ ld a, [hli]
+ ld e, l
+ ld d, h
+ ld l, c
+ ld h, b
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [de]
+ cp $50
+ jr z, .asm_17f19b
+ and a
+ ret
+
+.asm_17f19b
+ scf
+ ret
+
+.asm_17f19d
+ push bc
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ ld a, [hli]
+ ld [$cd54], a
+ pop bc
+ push hl
+ push bc
+ call Function17f4f6
+ add hl, de
+ ld a, [hl]
+ ld c, a
+ ld de, EnemyMoveAnimation
+ callba Function48c63
+ pop hl
+ ld de, EnemyMoveAnimation
+ call PlaceString
+ ld a, c
+ ld [$cd52], a
+ ld a, b
+ ld [$cd53], a
+ ld a, [$cd54]
+ call Function17f50f
+ pop de
+ and a
+ ret
+; 17f1d0
+
+Function17f1d0: ; 17f1d0
+ pop hl
+ call Function17f524
+ jr c, .asm_17f1ec
+ ld de, $0002
+ add hl, de
+ ld a, [hli]
+ ld e, l
+ ld d, h
+ ld l, c
+ ld h, b
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [de]
+ cp $50
+ jr z, .asm_17f1ea
+ and a
+ ret
+
+.asm_17f1ea
+ scf
+ ret
+
+.asm_17f1ec
+ push bc
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ ld a, [hli]
+ ld [$cd54], a
+ pop bc
+ push hl
+ push bc
+ call Function17f4f6
+ add hl, de
+ ld a, [hl]
+ ld a, $1
+ ld [rSVBK], a
+ ld [$d265], a
+ call GetPokemonName
+ pop hl
+ call PlaceString
+ ld a, c
+ ld [$cd52], a
+ ld a, b
+ ld [$cd53], a
+ ld a, $4
+ ld [rSVBK], a
+ ld a, [$cd54]
+ call Function17f50f
+ pop de
+ and a
+ ret
+; 17f220
+
+Function17f220: ; 17f220
+ pop hl
+ call Function17f524
+ jr c, .asm_17f23c
+ ld de, $0002
+ add hl, de
+ ld a, [hli]
+ ld e, l
+ ld d, h
+ ld l, c
+ ld h, b
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [de]
+ cp $50
+ jr z, .asm_17f23a
+ and a
+ ret
+
+.asm_17f23a
+ scf
+ ret
+
+.asm_17f23c
+ push bc
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ ld a, [hli]
+ ld [$cd54], a
+ pop bc
+ push hl
+ push bc
+ call Function17f4f6
+ add hl, de
+ ld a, [hl]
+ ld e, a
+ ld d, $0
+ ld hl, $726e
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld e, a
+ ld a, [hl]
+ ld d, a
+ pop hl
+ call PlaceString
+ ld a, c
+ ld [$cd52], a
+ ld a, b
+ ld [$cd53], a
+ ld a, [$cd54]
+ call Function17f50f
+ pop de
+ and a
+ ret
+; 17f26e
+
+INCBIN "baserom.gbc", $17f26e, $17f27b - $17f26e
+
+Function17f27b: ; 17f27b
+ pop hl
+ call Function17f524
+ jr c, .asm_17f297
+ ld de, $0002
+ add hl, de
+ ld a, [hli]
+ ld e, l
+ ld d, h
+ ld l, c
+ ld h, b
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [de]
+ cp $50
+ jr z, .asm_17f295
+ and a
+ ret
+
+.asm_17f295
+ scf
+ ret
+
+.asm_17f297
+ push bc
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ ld a, [hli]
+ ld [$cd54], a
+ pop bc
+ push hl
+ push bc
+ call Function17f4f6
+ add hl, de
+ ld a, [hl]
+ ld a, $1
+ ld [rSVBK], a
+ ld [$d265], a
+ call GetItemName
+ pop hl
+ call PlaceString
+ ld a, c
+ ld [$cd52], a
+ ld a, b
+ ld [$cd53], a
+ ld a, $4
+ ld [rSVBK], a
+ ld a, [$cd54]
+ call Function17f50f
+ pop de
+ and a
+ ret
+; 17f2cb
+
+Function17f2cb: ; 17f2cb
+ pop hl
+ push bc
+ ld a, [hli]
+ ld [$cd54], a
+ ld a, [hli]
+ ld [$cd55], a
+ ld a, [$cd2e]
+ inc a
+ ld [$cd56], a
+ pop bc
+ push hl
+ ld l, c
+ ld h, b
+ push hl
+ ld de, $cd56
+ ld b, $1
+ ld a, [$cd54]
+ ld c, a
+ call Function31a4
+ ld a, l
+ ld [$cd52], a
+ ld a, h
+ ld [$cd53], a
+ pop hl
+ ld a, [$cd55]
+ call Function17f50f
+ pop de
+ and a
+ ret
+; 17f2ff
+
+Function17f2ff: ; 17f2ff
+ pop hl
+ push bc
+ ld a, [hli]
+ ld [$cd54], a
+ pop bc
+ push hl
+ push bc
+ ld a, $1
+ ld [rSVBK], a
+ ld hl, PlayerName
+ ld de, EnemyMoveAnimation
+ ld bc, $0006
+ call CopyBytes
+ ld a, $4
+ ld [rSVBK], a
+ pop hl
+ ld de, EnemyMoveAnimation
+ call PlaceString
+ ld a, c
+ ld [$cd52], a
+ ld a, b
+ ld [$cd53], a
+ ld a, [$cd54]
+ call Function17f50f
+ pop de
+ and a
+ ret
+; 17f334
+
+Function17f334: ; 17f334
+ pop hl
+ push bc
+ ld a, [hli]
+ ld [$cd55], a
+ and $f
+ ld [$cd54], a
+ pop bc
+ push hl
+ ld l, c
+ ld h, b
+ push hl
+ ld a, [$cd55]
+ bit 7, a
+ jr nz, .asm_17f355
+ ld a, $1
+ call GetSRAMBank
+ ld a, [$be3f]
+ jr .asm_17f35d
+
+.asm_17f355
+ ld a, $5
+ call GetSRAMBank
+ ld a, [$b2f3]
+
+.asm_17f35d
+ ld c, a
+ call CloseSRAM
+ ld de, EnemyMoveAnimation
+ callba Function48c63
+ pop hl
+ ld de, EnemyMoveAnimation
+ call PlaceString
+ ld a, c
+ ld [$cd52], a
+ ld a, b
+ ld [$cd53], a
+ ld a, [$cd54]
+ call Function17f50f
+ pop de
+ and a
+ ret
+; 17f382
+
+Function17f382: ; 17f382
+ pop hl
+ push bc
+ ld a, [hli]
+ ld [$cd55], a
+ and $f
+ ld [$cd54], a
+ pop bc
+ push hl
+ push bc
+ ld l, c
+ ld h, b
+ ld a, [$cd55]
+ bit 7, a
+ jr nz, .asm_17f3a3
+ ld a, $1
+ call GetSRAMBank
+ ld de, $be40
+ jr .asm_17f3ab
+
+.asm_17f3a3
+ ld a, $5
+ call GetSRAMBank
+ ld de, $b2f4
+
+.asm_17f3ab
+ ld a, $82
+ ld b, a
+ ld a, $3
+ ld c, a
+ call PrintNum
+ call CloseSRAM
+ ld a, l
+ ld [$cd52], a
+ ld a, h
+ ld [$cd53], a
+ pop hl
+ ld a, [$cd54]
+ call Function17f50f
+ pop de
+ and a
+ ret
+; 17f3c9
+
+Function17f3c9: ; 17f3c9
+ push bc
+ ld hl, $cd36
+ ld de, $c708
+ ld bc, $000c
+ call CopyBytes
+ pop de
+ ld c, $0
+ callba Function11c075
+ push hl
+ ld hl, $c708
+ ld de, $cd36
+ ld bc, $000c
+ call CopyBytes
+ pop bc
+ pop de
+ and a
+ ret
+; 17f3f0
+
+Function17f3f0: ; 17f3f0
+ pop hl
+ push hl
+ ld a, [hli]
+ push af
+ push bc
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ ld a, [de]
+ ld c, a
+ ld b, $0
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ ld hl, Unkn1Pals
+ add hl, de
+ ld e, l
+ ld d, h
+ pop hl
+ call PlaceString
+ pop af
+ ld e, a
+ ld d, $0
+ pop hl
+ add hl, de
+ add hl, de
+ inc hl
+ inc hl
+ inc hl
+ ld e, l
+ ld d, h
+ ld l, c
+ ld h, b
+ scf
+ ret
+; 17f41d
+
+Function17f41d: ; 17f41d
+ pop hl
+ ld a, [hli]
+ push hl
+ push af
+ ld l, c
+ ld h, b
+ ld bc, $3b60
+ add hl, bc
+ ld de, $ffec
+ ld c, $1
+.asm_17f42c
+ ld a, h
+ and a
+ jr nz, .asm_17f435
+ ld a, l
+ cp $14
+ jr c, .asm_17f439
+
+.asm_17f435
+ add hl, de
+ inc c
+ jr .asm_17f42c
+
+.asm_17f439
+ ld hl, TileMap
+ ld de, $0014
+ ld a, c
+.asm_17f440
+ and a
+ jr z, .asm_17f447
+ add hl, de
+ dec a
+ jr .asm_17f440
+
+.asm_17f447
+ pop af
+ ld e, a
+ ld d, $0
+ add hl, de
+ pop de
+ and a
+ ret
+; 17f44f
+
+Function17f44f: ; 17f44f
+ pop hl
+ call Function17f524
+ jr c, .asm_17f46d
+ ld de, $0005
+ add hl, de
+ ld a, [hli]
+ inc hl
+ inc hl
+ ld e, l
+ ld d, h
+ ld l, c
+ ld h, b
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld a, [de]
+ cp $50
+ jr z, .asm_17f46b
+ and a
+ ret
+
+.asm_17f46b
+ scf
+ ret
+
+.asm_17f46d
+ push bc
+ ld de, $cd54
+ ld bc, $0008
+ call CopyBytes
+ pop bc
+ push hl
+ push bc
+ ld a, [$cd56]
+ cp $c0
+ jr c, .asm_17f488
+ ld a, [$cd54]
+ ld [rSVBK], a
+ jr .asm_17f48e
+
+.asm_17f488
+ ld a, [$cd54]
+ call GetSRAMBank
+
+.asm_17f48e
+ ld a, [$cd55]
+ ld l, a
+ ld a, [$cd56]
+ ld h, a
+ ld de, EnemyMoveAnimation
+ ld a, [$cd57]
+ ld c, a
+ ld b, $0
+ call CopyBytes
+ ld a, [$cd56]
+ cp $c0
+ jr c, .asm_17f4af
+ ld a, $4
+ ld [rSVBK], a
+ jr .asm_17f4b7
+
+.asm_17f4af
+ call CloseSRAM
+ ld a, $6
+ call GetSRAMBank
+
+.asm_17f4b7
+ ld de, EnemyMoveAnimation
+ pop hl
+ push hl
+ ld a, [$cd57]
+ ld b, a
+ ld a, [$cd58]
+ ld c, a
+ call Function31a4
+ ld a, l
+ ld [$cd52], a
+ ld a, h
+ ld [$cd53], a
+ ld a, [$cd5a]
+ and a
+ jr z, .asm_17f4ec
+ ld c, a
+ ld a, [$cd58]
+ inc a
+ ld b, a
+ ld e, l
+ ld d, h
+ dec de
+.asm_17f4de
+ ld a, c
+ cp b
+ jr z, .asm_17f4e8
+ ld a, [de]
+ dec de
+ ld [hld], a
+ dec b
+ jr .asm_17f4de
+
+.asm_17f4e8
+ ld a, [$cd5b]
+ ld [hl], a
+
+.asm_17f4ec
+ pop hl
+ ld a, [$cd59]
+ call Function17f50f
+ pop de
+ and a
+ ret
+; 17f4f6
+
+Function17f4f6: ; 17f4f6
+ ld a, [$cd6a]
+ ld l, a
+ ld a, [$cd6b]
+ ld h, a
+ ld a, [$cd47]
+ ld c, a
+ ld a, [BGMapPalBuffer]
+ ld b, a
+ ld a, [$cd2e]
+.asm_17f509
+ and a
+ ret z
+ dec a
+ add hl, bc
+ jr .asm_17f509
+; 17f50f
+
+Function17f50f: ; 17f50f
+ and a
+ jr z, .asm_17f519
+ ld c, a
+ ld b, $0
+ add hl, bc
+ ld c, l
+ ld b, h
+ ret
+
+.asm_17f519
+ ld a, [$cd52]
+ ld c, a
+ ld l, a
+ ld a, [$cd53]
+ ld b, a
+ ld h, a
+ ret
+; 17f524
+
+Function17f524: ; 17f524
+ push hl
+ push bc
+ push de
+ ld a, [$cd42]
+ dec a
+ ld b, a
+ ld a, [$cd2e]
+ cp b
+ jr z, .asm_17f53a
+ ld hl, $cd68
+ cp [hl]
+.asm_17f536
+ pop de
+ pop bc
+ pop hl
+ ret
+
+.asm_17f53a
+ scf
+ jr .asm_17f536
+; 17f53d
+
+Function17f53d: ; 17f53d
+ call FadeToMenu
+ xor a
+ ld [$c303], a
+ ld a, [rSVBK]
+ push af
+ ld a, $1
+ ld [rSVBK], a
+ call Function17f555
+ pop af
+ ld [rSVBK], a
+ call Function2b4d
+ ret
+; 17f555
+
+Function17f555: ; 17f555
+.asm_17f555
+ call Functiona57
+ call Function17f5ae
+ ld a, [$c303]
+ bit 7, a
+ jr nz, .asm_17f56a
+ callba Function104000
+ jr .asm_17f555
+
+.asm_17f56a
+ call Function17f56e
+ ret
+; 17f56e
+
+Function17f56e: ; 17f56e
+ ld a, [$c300]
+ cp $22
+ jr z, .asm_17f597
+ cp $31
+ jr z, .asm_17f58a
+ cp $33
+ ret nz
+ ld a, [$c301]
+ cp $1
+ ret nz
+ ld a, [$c302]
+ cp $2
+ ret nz
+ jr .asm_17f5a1
+
+.asm_17f58a
+ ld a, [$c301]
+ cp $3
+ ret nz
+ ld a, [$c302]
+ and a
+ ret nz
+ jr .asm_17f5a1
+
+.asm_17f597
+ ld a, [$c301]
+ and a
+ ret nz
+ ld a, [$c302]
+ and a
+ ret nz
+
+.asm_17f5a1
+ ld a, $5
+ call GetSRAMBank
+ xor a
+ ld [$aa4b], a
+ call CloseSRAM
+ ret
+; 17f5ae
+
+Function17f5ae: ; 17f5ae
+ ld a, [$c303]
+ ld e, a
+ ld d, 0
+ ld hl, Table17f5bd
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 17f5bd
+
+Table17f5bd: ; 17f5bd
+ dw Function17f5c3
+ dw Function17ff23
+ dw Function17f5d2
+; 17f5c3
+
+Function17f5c3: ; 17f5c3
+ call Function17f5e4
+ callba Function2b5c
+ ld a, $1
+ ld [$c303], a
+ ret
+; 17f5d2
+
+Function17f5d2: ; 17f5d2
+ call Function17f5e4
+ callba Function104000
+ call Function32f9
+ ld a, $1
+ ld [$c303], a
+ ret
+; 17f5e4
+
+Function17f5e4: ; 17f5e4
+ ld a, $8
+ ld [MusicFade], a
+ ld de, MUSIC_NONE
+ ld a, e
+ ld [MusicFadeIDLo], a
+ ld a, d
+ ld [MusicFadeIDHi], a
+ ld a, " "
+ ld hl, TileMap
+ ld bc, $0168
+ call ByteFill
+ ld a, $6
+ ld hl, AttrMap
+ ld bc, $0168
+ call ByteFill
+ ld hl, $c4b6
+ ld b, $1
+ ld c, $e
+ call Function3eea
+ ld hl, $c4f1
+ ld b, $c
+ ld c, $10
+ call Function3eea
+ ld hl, $c4cb
+ ld de, $76dc
+ call PlaceString
+ call Function17ff3c
+ jr nc, .asm_17f632
+ ld hl, $c4d3
+ call Function17f6b7
+
+.asm_17f632
+ ld a, [$c300]
+ cp $d0
+ jr nc, .asm_17f684
+ cp $10
+ jr c, .asm_17f679
+ sub $10
+ cp $24
+ jr nc, .asm_17f679
+ ld e, a
+ ld d, $0
+ ld hl, $7706
+ add hl, de
+ add hl, de
+ ld a, [$c301]
+ ld e, a
+ ld a, [$c302]
+ ld d, a
+ ld a, [hli]
+ ld c, a
+ ld a, [hl]
+ ld h, a
+ ld l, c
+ ld a, [hli]
+ and a
+ jr z, .asm_17f679
+ ld c, a
+.asm_17f65d
+ ld a, [hli]
+ ld b, a
+ ld a, [hli]
+ cp $ff
+ jr nz, .asm_17f667
+ cp b
+ jr z, .asm_17f66e
+
+.asm_17f667
+ xor d
+ jr nz, .asm_17f674
+ ld a, b
+ xor e
+ jr nz, .asm_17f674
+
+.asm_17f66e
+ ld a, [hli]
+ ld e, a
+ ld a, [hl]
+ ld d, a
+ jr .asm_17f67d
+
+.asm_17f674
+ inc hl
+ inc hl
+ dec c
+ jr nz, .asm_17f65d
+
+.asm_17f679
+ ld a, $d9
+ jr .asm_17f684
+
+.asm_17f67d
+ ld hl, $c51a
+ call PlaceString
+ ret
+
+.asm_17f684
+ sub $d0
+ ld e, a
+ ld d, $0
+ ld hl, $7699
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld e, a
+ ld a, [hl]
+ ld d, a
+ ld hl, $c51a
+ call PlaceString
+ ret
+; 17f699
+
+INCBIN "baserom.gbc", $17f699, $17f6b7 - $17f699
+
+Function17f6b7: ; 17f6b7
+ ld a, [$c300]
+ call Function17f6cd
+ inc hl
+ ld a, [$c302]
+ and $f
+ call Function17f6d8
+ ld a, [$c301]
+ call Function17f6cd
+ ret
+; 17f6cd
+
+Function17f6cd: ; 17f6cd
+ ld c, a
+ and $f0
+ swap a
+ call Function17f6d8
+ ld a, c
+ and $f
+
+Function17f6d8: ; 17f6d8
+ add $f6
+ ld [hli], a
+ ret
+; 17f6dc
+
+INCBIN "baserom.gbc", $17f6dc, $17ff23 - $17f6dc
+
+Function17ff23: ; 17ff23
+ ld a, [hJoyPressed]
+ and a
+ ret z
+ ld a, $8
+ ld [MusicFade], a
+ ld a, [CurMusic]
+ ld [MusicFadeIDLo], a
+ xor a
+ ld [MusicFadeIDHi], a
+ ld hl, $c303
+ set 7, [hl]
+ ret
+; 17ff3c
+
+Function17ff3c: ; 17ff3c
+ nop
+ ld a, [$c300]
+ cp $d0
+ ret c
+ ld hl, $c4d2
+ ld de, $7f68
+ call PlaceString
+ ld a, [$c300]
+ push af
+ sub $d0
+ inc a
+ ld [$c300], a
+ ld hl, $c4d6
+ ld de, $c300
+ ld bc, $8103
+ call PrintNum
+ pop af
+ ld [$c300], a
+ and a
+ ret
+; 17ff68
+
+INCBIN "baserom.gbc", $17ff68, $17ff6c - $17ff68
+
+
SECTION "bank60",ROMX,BANK[$60]
; Map Scripts XIII
@@ -72388,7 +86843,7 @@
SECTION "bank73",ROMX,BANK[$73]
- ; Pokedex entries III
+; Pokedex entries III
; 129-192
PokedexEntries3:
INCLUDE "stats/pokedex/entries_3.asm"
@@ -72414,30 +86869,283 @@
INCBIN "gfx/misc/unown_font.2bpp"
; 1dc1b0
-INCBIN "baserom.gbc", $1dc1b0, $1dc5a1 - $1dc1b0
+INCBIN "baserom.gbc", $1dc1b0, $1dc381 - $1dc1b0
-Tileset26GFX: ; 0x1dc5a1
-Tileset32GFX: ; 0x1dc5a1
-Tileset33GFX: ; 0x1dc5a1
-Tileset34GFX: ; 0x1dc5a1
-Tileset35GFX: ; 0x1dc5a1
-Tileset36GFX: ; 0x1dc5a1
-INCBIN "gfx/tilesets/36.lz"
-; 0x1dd1a8
+Function1dc381: ; 1dc381
+ call WhiteBGMap
+ call ClearTileMap
+ call ClearSprites
+ xor a
+ ld [hBGMapMode], a
+ call Functione58
+ ld de, $4591
+ ld hl, $9710
+ ld bc, $7701
+ call Request1bpp
+ ld de, $4599
+ ld hl, $96e0
+ ld bc, $7701
+ call Request1bpp
+ ld de, $4a90
+ ld hl, $93f0
+ ld bc, $3e01
+ call Get2bpp
+ xor a
+ ld [MonType], a
+ callba Function5084a
+ ld hl, $c52c
+ ld b, $9
+ ld c, $12
+ call TextBox
+ ld hl, $c4d0
+ ld a, [TempMonLevel]
+ call Function383d
+ ld hl, $c4d4
+ ld [hl], $71
+ inc hl
+ ld de, TempMonMaxHP
+ ld bc, $0203
+ call PrintNum
+ ld a, [CurPartySpecies]
+ ld [$d265], a
+ ld [CurSpecies], a
+ ld hl, PartyMon1Nickname
+ call Function1dc50e
+ ld hl, $c4f8
+ call PlaceString
+ ld hl, $c521
+ ld [hl], $f3
+ call GetPokemonName
+ ld hl, $c522
+ call PlaceString
+ ld hl, $c4a8
+ ld [hl], $74
+ inc hl
+ ld [hl], $e8
+ inc hl
+ ld de, $d265
+ ld bc, $8103
+ call PrintNum
+ ld hl, $c555
+ ld de, $4550
+ call PlaceString
+ ld hl, PartyMon1OT
+ call Function1dc50e
+ ld hl, $c558
+ call PlaceString
+ ld hl, $c57d
+ ld de, $4559
+ call PlaceString
+ ld hl, $c580
+ ld de, TempMonID
+ ld bc, $8205
+ call PrintNum
+ ld hl, $c5b9
+ ld de, $4554
+ call PlaceString
+ ld hl, $c5bf
+ ld a, [TempMonMove1]
+ call Function1dc51a
+ call Function1dc52c
+ ld hl, TempMonDVs
+ ld a, $2d
+ call Predef
+ ld hl, $c2c6
+ xor a
+ ld [hl], a
+ ld a, [CurPartySpecies]
+ cp $c9
+ jr z, .asm_1dc469
+ inc [hl]
+
+.asm_1dc469
+ ld hl, TileMap
+ call Function378b
+ call WaitBGMap
+ ld b, $3
+ call GetSGBLayout
+ call Function32f9
+ ret
+; 1dc47b
+
+Function1dc47b: ; 1dc47b
+ call WhiteBGMap
+ call ClearTileMap
+ call ClearSprites
+ xor a
+ ld [hBGMapMode], a
+ call Functione58
+ xor a
+ ld [MonType], a
+ callba Function5084a
+ ld hl, TileMap
+ ld b, $f
+ ld c, $12
+ call TextBox
+ ld bc, $0014
+ ld de, TileMap
+ ld hl, $c4b4
+ call CopyBytes
+ ld hl, $c4a7
+ ld a, [TempMonMove2]
+ call Function1dc51a
+ ld hl, $c4cf
+ ld a, [TempMonMove3]
+ call Function1dc51a
+ ld hl, $c4f7
+ ld a, [TempMonMove4]
+ call Function1dc51a
+ ld hl, $c533
+ ld de, $455d
+ call PlaceString
+ ld hl, $c53c
+ ld de, TempMonAtk
+ call Function1dc507
+ ld hl, $c564
+ ld de, TempMonDef
+ call Function1dc507
+ ld hl, $c58c
+ ld de, TempMonSpclAtk
+ call Function1dc507
+ ld hl, $c5b4
+ ld de, TempMonSpclDef
+ call Function1dc507
+ ld hl, $c5dc
+ ld de, TempMonSpd
+ call Function1dc507
+ call WaitBGMap
+ ld b, $3
+ call GetSGBLayout
+ call Function32f9
+ ret
+; 1dc507
- db $00
+Function1dc507: ; 1dc507
+ ld bc, $0203
+ call PrintNum
+ ret
+; 1dc50e
-Tileset26Meta: ; 0x1dd1a9
-INCBIN "tilesets/26_metatiles.bin"
-; 0x1dd5a9
+Function1dc50e: ; 1dc50e
+ ld bc, $000b
+ ld a, [CurPartyMon]
+ call AddNTimes
+ ld e, l
+ ld d, h
+ ret
+; 1dc51a
-Tileset26Coll: ; 0x1dd5a9
-INCBIN "tilesets/26_collision.bin"
-; 0x1dd6a9
+Function1dc51a: ; 1dc51a
+ and a
+ jr z, .asm_1dc525
+ ld [$d265], a
+ call GetMoveName
+ jr .asm_1dc528
-INCBIN "baserom.gbc", $1dd6a9, $1ddf1c - $1dd6a9
+.asm_1dc525
+ ld de, $4584
+.asm_1dc528
+ call PlaceString
+ ret
+; 1dc52c
+Function1dc52c: ; 1dc52c
+ callba GetGender
+ ld a, $7f
+ jr c, .asm_1dc53c
+ ld a, $ef
+ jr nz, .asm_1dc53c
+ ld a, $f5
+
+.asm_1dc53c
+ ld hl, $c4d9
+ ld [hl], a
+ ld bc, TempMonDVs
+ callba CheckShininess
+ ret nc
+ ld hl, $c4da
+ ld [hl], $3f
+ ret
+; 1dc550
+
+INCBIN "baserom.gbc", $1dc550, $1dc5a1 - $1dc550
+
+INCLUDE "tilesets/data_7.asm"
+
+INCBIN "baserom.gbc", $1dd6a9, $1dd702 - $1dd6a9
+
+Function1dd702: ; 1dd702
+ call Function1dd709
+ call Functiona80
+ ret
+; 1dd709
+
+Function1dd709: ; 1dd709
+ call WhiteBGMap
+ call ClearTileMap
+ call ClearSprites
+ call DisableLCD
+ ld hl, $5805
+ ld de, VTiles2
+ call Decompress
+ ld hl, $5c4b
+ ld de, TileMap
+ ld bc, $0168
+ call CopyBytes
+ ld de, $5760
+ ld hl, $c506
+ call PlaceString
+ ld de, $5767
+ ld hl, $c513
+ call PlaceString
+ ld de, PlayerName
+ ld hl, $c50d
+ call PlaceString
+ ld de, $5768
+ ld hl, $c542
+ call PlaceString
+ call EnableLCD
+ call WaitBGMap
+ ld b, $8
+ call GetSGBLayout
+ call Function32f9
+ call DelayFrame
+ ret
+; 1dd760
+
+INCBIN "baserom.gbc", $1dd760, $1dd7ae - $1dd760
+
+Function1dd7ae: ; 1dd7ae
+ ld hl, TileMap
+ ld bc, $0168
+ ld a, $7f
+ call ByteFill
+ ld hl, $5db3
+ ld de, TileMap
+ ld bc, $0168
+ call CopyBytes
+ ld de, $57fa
+ ld hl, $c4a8
+ call PlaceString
+ ld de, $57f0
+ ld hl, $c5cf
+ call PlaceString
+ ld hl, $c5d8
+ ld de, GameTimeHours
+ ld bc, $0204
+ call PrintNum
+ ld [hl], $67
+ inc hl
+ ld de, GameTimeMinutes
+ ld bc, $8102
+ call PrintNum
+ ret
+; 1dd7f0
+
+INCBIN "baserom.gbc", $1dd7f0, $1ddf1c - $1dd7f0
+
+
Function1ddf1c: ; 1ddf1c
ld hl, $5f33
ld de, $9310
@@ -72556,8 +87264,29 @@
; 1de2c5
-INCBIN "baserom.gbc", $1de2c5, $1de2e4 - $1de2c5
+Function1de2c5: ; 1de2c5
+ ld hl, StringBuffer1
+.asm_1de2c8
+ ld a, [hl]
+ cp $50
+ jr z, .asm_1de2da
+ cp $25
+ jr z, .asm_1de2d8
+ cp $1f
+ jr z, .asm_1de2d8
+ inc hl
+ jr .asm_1de2c8
+.asm_1de2d8
+ ld [hl], $22
+
+.asm_1de2da
+ ld de, StringBuffer1
+ ld hl, $c4a9
+ call PlaceString
+ ret
+; 1de2e4
+
PokegearGFX: ; 1de2e4
INCBIN "gfx/misc/pokegear.lz"
; 1de5c7
@@ -72588,26 +87317,90 @@
ret
; 1de5e6
-INCBIN "baserom.gbc", $1de5e6, $1df238 - $1de5e6
+INCBIN "baserom.gbc", $1de5e6, $1df1e6 - $1de5e6
+Function1df1e6: ; 1df1e6
+ ld b, $21
+ ld h, d
+ ld l, e
+.asm_1df1ea
+ ld a, [hl]
+ cp $dc
+ jr nz, .asm_1df1f3
+ ld a, $d4
+ jr .asm_1df1fd
-SECTION "bank78",ROMX,BANK[$78]
+.asm_1df1f3
+ sub $d4
+ jr c, .asm_1df1fe
+ cp $3
+ jr nc, .asm_1df1fe
+ add $cd
-Tileset33Meta: ; 0x1e0000
-INCBIN "tilesets/33_metatiles.bin"
-; 0x1e0400
+.asm_1df1fd
+ ld [hl], a
-Tileset34Meta: ; 0x1e0400
-INCBIN "tilesets/34_metatiles.bin"
-; 0x1e0800
+.asm_1df1fe
+ inc hl
+ dec b
+ jr nz, .asm_1df1ea
+ ret
+; 1df203
-Tileset35Meta: ; 0x1e0800
-INCBIN "tilesets/35_metatiles.bin"
-; 0x1e0c00
+Function1df203: ; 1df203
+ ld b, $21
+ ld h, d
+ ld l, e
+.asm_1df207
+ ld a, [hl]
+ cp $d4
+ jr nz, .asm_1df210
+ ld a, $dc
+ jr .asm_1df21a
-Tileset36Meta: ; 0x1e0c00
-INCBIN "tilesets/36_metatiles.bin"
-; 0x1e1000
+.asm_1df210
+ sub $cd
+ jr c, .asm_1df21b
+ cp $3
+ jr nc, .asm_1df21b
+ add $d4
+
+.asm_1df21a
+ ld [hl], a
+
+.asm_1df21b
+ inc hl
+ dec b
+ jr nz, .asm_1df207
+ ret
+; 1df220
+
+Function1df220: ; 1df220
+ ld b, $21
+ ld h, d
+ ld l, e
+.asm_1df224
+ ld a, [hl]
+ and $f0
+ cp $d0
+ jr nz, .asm_1df233
+ ld a, [hl]
+ add $8
+ and $f
+ or $d0
+ ld [hl], a
+
+.asm_1df233
+ inc hl
+ dec b
+ jr nz, .asm_1df224
+ ret
+; 1df238
+
+
+SECTION "bank78",ROMX,BANK[$78]
+
+INCLUDE "tilesets/data_8.asm"
SECTION "bank79",ROMX,BANK[$79]
--- a/maps/AzaleaGym.asm
+++ b/maps/AzaleaGym.asm
@@ -9,7 +9,7 @@
BugsyScript_0x18ec1e: ; 0x18ec1e
faceplayer
loadfont
- checkbit1 $04be
+ checkbit1 EVENT_BEAT_BUGSY
iftrue UnknownScript_0x18ec48
2writetext UnknownText_0x18ed0b
closetext
@@ -18,7 +18,7 @@
loadtrainer BUGSY, 1
startbattle
returnafterbattle
- setbit1 $04be
+ setbit1 EVENT_BEAT_BUGSY
loadfont
2writetext UnknownText_0x18ee14
playsound $009c
@@ -27,17 +27,17 @@
checkcode $7
2call UnknownScript_0x18ec73
UnknownScript_0x18ec48: ; 0x18ec48
- checkbit1 $0009
+ checkbit1 EVENT_GOT_TM49_FURY_CUTTER
iftrue UnknownScript_0x18ec6d
- setbit1 $0464
- setbit1 $053c
- setbit1 $053d
- setbit1 $053e
+ setbit1 EVENT_BEAT_TWINS_AMY_AND_MAY
+ setbit1 EVENT_BEAT_BUG_CATCHER_BENNY
+ setbit1 EVENT_BEAT_BUG_CATCHER_AL
+ setbit1 EVENT_BEAT_BUG_CATCHER_JOSH
2writetext UnknownText_0x18ee2b
keeptextopen
verbosegiveitem TM_49, 1
iffalse UnknownScript_0x18ec71
- setbit1 $0009
+ setbit1 EVENT_GOT_TM49_FURY_CUTTER
2writetext UnknownText_0x18eefa
closetext
loadmovesprites
@@ -213,7 +213,7 @@
AzaleaGymGuyScript: ; 0x18ece6
faceplayer
- checkbit1 $04be
+ checkbit1 EVENT_BEAT_BUGSY
iftrue .AzaleaGymGuyWinScript
loadfont
2writetext AzaleaGymGuyText
--- a/maps/AzaleaTown.asm
+++ b/maps/AzaleaTown.asm
@@ -59,9 +59,9 @@
closetext
loadmovesprites
setbit1 $06bf
- checkbit1 $001c
+ checkbit1 EVENT_GOT_TOTODILE_FROM_ELM
iftrue UnknownScript_0x198071
- checkbit1 $001d
+ checkbit1 EVENT_GOT_CHIKORITA_FROM_ELM
iftrue UnknownScript_0x198081
winlosstext UnknownText_0x1981e6, UnknownText_0x19835b
setlasttalked $b
@@ -119,7 +119,7 @@
GrampsScript_0x1980b1: ; 0x1980b1
faceplayer
loadfont
- checkbit1 $002b
+ checkbit1 EVENT_CLEARED_SLOWPOKE_WELL
iftrue UnknownScript_0x1980bf
2writetext UnknownText_0x19841b
closetext
--- a/maps/BillsHouse.asm
+++ b/maps/BillsHouse.asm
@@ -11,23 +11,23 @@
loadfont
checkbit1 $0000
iftrue UnknownScript_0x1896ba
- checkbit1 $0324
+ checkbit1 EVENT_GOT_THUNDERSTONE_FROM_BILLS_GRANDPA
iftrue UnknownScript_0x1896c0
- checkbit1 $031a
+ checkbit1 EVENT_MET_BILLS_GRANDPA
iftrue UnknownScript_0x189553
2writetext UnknownText_0x1896ce
keeptextopen
- setbit1 $031a
+ setbit1 EVENT_MET_BILLS_GRANDPA
UnknownScript_0x189553: ; 0x189553
- checkbit1 $031f
+ checkbit1 EVENT_SHOWED_PICHU_TO_BILLS_GRANDPA
iftrue UnknownScript_0x189697
- checkbit1 $031e
+ checkbit1 EVENT_SHOWED_GROWLITHE_VULPIX_TO_BILLS_GRANDPA
iftrue UnknownScript_0x189680
- checkbit1 $031d
+ checkbit1 EVENT_SHOWED_STARYU_TO_BILLS_GRANDPA
iftrue UnknownScript_0x189669
- checkbit1 $031c
+ checkbit1 EVENT_SHOWED_ODDISH_TO_BILLS_GRANDPA
iftrue UnknownScript_0x189652
- checkbit1 $031b
+ checkbit1 EVENT_SHOWED_LICKITUNG_TO_BILLS_GRANDPA
iftrue UnknownScript_0x18963b
2writetext UnknownText_0x1898c0
keeptextopen
@@ -39,7 +39,7 @@
iffalse UnknownScript_0x1896aa
if_not_equal LICKITUNG, UnknownScript_0x1896c6
2call UnknownScript_0x1896b0
- setbit1 $031b
+ setbit1 EVENT_SHOWED_LICKITUNG_TO_BILLS_GRANDPA
2jump UnknownScript_0x18963b
; 0x189592
@@ -54,7 +54,7 @@
iffalse UnknownScript_0x1896aa
if_not_equal ODDISH, UnknownScript_0x1896c6
2call UnknownScript_0x1896b0
- setbit1 $031c
+ setbit1 EVENT_SHOWED_ODDISH_TO_BILLS_GRANDPA
2jump UnknownScript_0x189652
; 0x1895b3
@@ -69,7 +69,7 @@
iffalse UnknownScript_0x1896aa
if_not_equal STARYU, UnknownScript_0x1896c6
2call UnknownScript_0x1896b0
- setbit1 $031d
+ setbit1 EVENT_SHOWED_STARYU_TO_BILLS_GRANDPA
2jump UnknownScript_0x189669
; 0x1895d4
@@ -86,7 +86,7 @@
iffalse UnknownScript_0x1896aa
if_not_equal GROWLITHE, UnknownScript_0x1896c6
2call UnknownScript_0x1896b0
- setbit1 $031e
+ setbit1 EVENT_SHOWED_GROWLITHE_VULPIX_TO_BILLS_GRANDPA
2jump UnknownScript_0x189680
; 0x1895f9
@@ -101,7 +101,7 @@
iffalse UnknownScript_0x1896aa
if_not_equal VULPIX, UnknownScript_0x1896c6
2call UnknownScript_0x1896b0
- setbit1 $031e
+ setbit1 EVENT_SHOWED_GROWLITHE_VULPIX_TO_BILLS_GRANDPA
2jump UnknownScript_0x189680
; 0x18961a
@@ -116,17 +116,17 @@
iffalse UnknownScript_0x1896aa
if_not_equal PICHU, UnknownScript_0x1896c6
2call UnknownScript_0x1896b0
- setbit1 $031f
+ setbit1 EVENT_SHOWED_PICHU_TO_BILLS_GRANDPA
2jump UnknownScript_0x189697
; 0x18963b
UnknownScript_0x18963b: ; 0x18963b
- checkbit1 $0320
+ checkbit1 EVENT_GOT_EVERSTONE_FROM_BILLS_GRANDPA
iftrue UnknownScript_0x189592
2call UnknownScript_0x1896b5
verbosegiveitem EVERSTONE, 1
iffalse UnknownScript_0x1896cc
- setbit1 $0320
+ setbit1 EVENT_GOT_EVERSTONE_FROM_BILLS_GRANDPA
setbit1 $0000
loadmovesprites
end
@@ -133,12 +133,12 @@
; 0x189652
UnknownScript_0x189652: ; 0x189652
- checkbit1 $0321
+ checkbit1 EVENT_GOT_LEAF_STONE_FROM_BILLS_GRANDPA
iftrue UnknownScript_0x1895b3
2call UnknownScript_0x1896b5
verbosegiveitem LEAF_STONE, 1
iffalse UnknownScript_0x1896cc
- setbit1 $0321
+ setbit1 EVENT_GOT_LEAF_STONE_FROM_BILLS_GRANDPA
setbit1 $0000
loadmovesprites
end
@@ -145,12 +145,12 @@
; 0x189669
UnknownScript_0x189669: ; 0x189669
- checkbit1 $0322
+ checkbit1 EVENT_GOT_WATER_STONE_FROM_BILLS_GRANDPA
iftrue UnknownScript_0x1895d4
2call UnknownScript_0x1896b5
verbosegiveitem WATER_STONE, 1
iffalse UnknownScript_0x1896cc
- setbit1 $0322
+ setbit1 EVENT_GOT_WATER_STONE_FROM_BILLS_GRANDPA
setbit1 $0000
loadmovesprites
end
@@ -157,12 +157,12 @@
; 0x189680
UnknownScript_0x189680: ; 0x189680
- checkbit1 $0323
+ checkbit1 EVENT_GOT_FIRE_STONE_FROM_BILLS_GRANDPA
iftrue UnknownScript_0x18961a
2call UnknownScript_0x1896b5
verbosegiveitem FIRE_STONE, 1
iffalse UnknownScript_0x1896cc
- setbit1 $0323
+ setbit1 EVENT_GOT_FIRE_STONE_FROM_BILLS_GRANDPA
setbit1 $0000
loadmovesprites
end
@@ -172,7 +172,7 @@
2call UnknownScript_0x1896b5
verbosegiveitem THUNDERSTONE, 1
iffalse UnknownScript_0x1896cc
- setbit1 $0324
+ setbit1 EVENT_GOT_THUNDERSTONE_FROM_BILLS_GRANDPA
loadmovesprites
end
; 0x1896a5
--- a/maps/BlackthornCity.asm
+++ b/maps/BlackthornCity.asm
@@ -32,9 +32,9 @@
SuperNerdScript_0x1a46e8: ; 0x1a46e8
faceplayer
loadfont
- checkbit1 $04c4
+ checkbit1 EVENT_BEAT_CLAIR
iftrue UnknownScript_0x1a4702
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x1a46fc
2writetext UnknownText_0x1a477a
closetext
@@ -67,7 +67,7 @@
BlackBeltScript_0x1a470e: ; 0x1a470e
faceplayer
loadfont
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x1a471c
2writetext UnknownText_0x1a494a
closetext
@@ -97,21 +97,21 @@
YoungsterScript_0x1a472b: ; 0x1a472b
faceplayer
loadfont
- checkbit1 $006d
+ checkbit1 EVENT_GOT_SPELL_TAG_FROM_SANTOS
iftrue UnknownScript_0x1a4759
checkcode $b
if_not_equal SATURDAY, UnknownScript_0x1a475f
- checkbit1 $006c
+ checkbit1 EVENT_MET_SANTOS_OF_SATURDAY
iftrue UnknownScript_0x1a4746
2writetext UnknownText_0x1a4a27
keeptextopen
- setbit1 $006c
+ setbit1 EVENT_MET_SANTOS_OF_SATURDAY
UnknownScript_0x1a4746: ; 0x1a4746
2writetext UnknownText_0x1a4a57
keeptextopen
verbosegiveitem SPELL_TAG, 1
iffalse UnknownScript_0x1a475d
- setbit1 $006d
+ setbit1 EVENT_GOT_SPELL_TAG_FROM_SANTOS
2writetext UnknownText_0x1a4a6b
closetext
loadmovesprites
--- a/maps/BlackthornGym1F.asm
+++ b/maps/BlackthornGym1F.asm
@@ -31,7 +31,7 @@
loadfont
checkbit2 $0022
iftrue UnknownScript_0x194e69
- checkbit1 $04c4
+ checkbit1 EVENT_BEAT_CLAIR
iftrue UnknownScript_0x194e63
2writetext UnknownText_0x194efa
closetext
@@ -40,16 +40,16 @@
loadtrainer CLAIR, 1
startbattle
returnafterbattle
- setbit1 $04c4
+ setbit1 EVENT_BEAT_CLAIR
loadfont
2writetext UnknownText_0x19500e
closetext
loadmovesprites
- setbit1 $054a
- setbit1 $054b
- setbit1 $054c
- setbit1 $055d
- setbit1 $055e
+ setbit1 EVENT_BEAT_COOLTRAINERM_PAUL
+ setbit1 EVENT_BEAT_COOLTRAINERM_CODY
+ setbit1 EVENT_BEAT_COOLTRAINERM_MIKE
+ setbit1 EVENT_BEAT_COOLTRAINERF_FRAN
+ setbit1 EVENT_BEAT_COOLTRAINERF_LOLA
clearbit1 $0736
setbit1 $074c
clearbit1 $074d
@@ -64,7 +64,7 @@
; 0x194e69
UnknownScript_0x194e69: ; 0x194e69
- checkbit1 $000f
+ checkbit1 EVENT_GOT_TM24_DRAGONBREATH
iftrue UnknownScript_0x194e94
2writetext UnknownText_0x195196
keeptextopen
@@ -75,7 +75,7 @@
playsound $0001
waitbutton
itemnotify
- setbit1 $000f
+ setbit1 EVENT_GOT_TM24_DRAGONBREATH
2writetext UnknownText_0x1951d1
keeptextopen
2jump UnknownScript_0x194e94
@@ -185,7 +185,7 @@
BlackthornGymGuyScript: ; 0x194ed6
faceplayer
loadfont
- checkbit1 $04c4
+ checkbit1 EVENT_BEAT_CLAIR
iftrue .BlackthornGymGuyWinScript
2writetext BlackthornGymGuyText
closetext
--- a/maps/BrunosRoom.asm
+++ b/maps/BrunosRoom.asm
@@ -24,11 +24,11 @@
; 0x180998
UnknownScript_0x180998: ; 0x180998
- checkbit1 $030d
+ checkbit1 EVENT_KOGAS_ROOM_ENTRANCE_CLOSED
iffalse UnknownScript_0x1809a2
changeblock $4, $e, $2a
UnknownScript_0x1809a2: ; 0x1809a2
- checkbit1 $030e
+ checkbit1 EVENT_BRUNOS_ROOM_EXIT_OPEN
iffalse UnknownScript_0x1809ac
changeblock $4, $2, $16
UnknownScript_0x1809ac: ; 0x1809ac
@@ -44,7 +44,7 @@
reloadmappart
loadmovesprites
dotrigger $1
- setbit1 $030d
+ setbit1 EVENT_KOGAS_ROOM_ENTRANCE_CLOSED
waitbutton
end
; 0x1809c5
@@ -70,7 +70,7 @@
changeblock $4, $2, $16
reloadmappart
loadmovesprites
- setbit1 $030e
+ setbit1 EVENT_BRUNOS_ROOM_EXIT_OPEN
waitbutton
end
; 0x1809f3
--- a/maps/BurnedTower1F.asm
+++ b/maps/BurnedTower1F.asm
@@ -33,7 +33,7 @@
iftrue UnknownScript_0x185c02
changeblock $a, $8, $32
UnknownScript_0x185c02: ; 0x185c02
- checkbit1 $007b
+ checkbit1 EVENT_RELEASED_THE_BEASTS
iftrue UnknownScript_0x185c0c
changeblock $6, $e, $9
UnknownScript_0x185c0c: ; 0x185c0c
@@ -66,9 +66,9 @@
2writetext UnknownText_0x185cd9
closetext
loadmovesprites
- checkbit1 $001c
+ checkbit1 EVENT_GOT_TOTODILE_FROM_ELM
iftrue UnknownScript_0x185c60
- checkbit1 $001d
+ checkbit1 EVENT_GOT_CHIKORITA_FROM_ELM
iftrue UnknownScript_0x185c70
winlosstext UnknownText_0x185d9b, UnknownText_0x185e2c
setlasttalked $4
--- a/maps/BurnedTowerB1F.asm
+++ b/maps/BurnedTowerB1F.asm
@@ -23,7 +23,7 @@
; 0x186160
UnknownScript_0x186160: ; 0x186160
- checkbit1 $007b
+ checkbit1 EVENT_RELEASED_THE_BEASTS
iftrue UnknownScript_0x18616a
changeblock $6, $e, $2
UnknownScript_0x18616a: ; 0x18616a
@@ -80,11 +80,11 @@
waitbutton
special $003d
dotrigger $1
- setbit1 $007b
+ setbit1 EVENT_RELEASED_THE_BEASTS
special $0069
domaptrigger GROUP_ECRUTEAK_GYM, MAP_ECRUTEAK_GYM, $1
domaptrigger GROUP_CIANWOOD_CITY, MAP_CIANWOOD_CITY, $1
- clearbit1 $07ae
+ clearbit1 EVENT_SAW_SUICUNE_AT_CIANWOOD_CITY
setbit1 $07a8
clearbit1 $07a9
setbit1 $0764
--- a/maps/CeladonCafe.asm
+++ b/maps/CeladonCafe.asm
@@ -92,7 +92,7 @@
; 0x730b0
MapCeladonCafeSignpost1Script: ; 0x730b0
- checkbit1 $00f9
+ checkbit1 EVENT_FOUND_LEFTOVERS_IN_CELADON_CAFE
iftrue UnknownScript_0x730db
giveitem LEFTOVERS, $1
iffalse UnknownScript_0x730cd
@@ -103,7 +103,7 @@
waitbutton
itemnotify
loadmovesprites
- setbit1 $00f9
+ setbit1 EVENT_FOUND_LEFTOVERS_IN_CELADON_CAFE
end
; 0x730cd
--- a/maps/CeladonGameCorner.asm
+++ b/maps/CeladonGameCorner.asm
@@ -47,7 +47,7 @@
FisherScript_0x72144: ; 0x72144
faceplayer
loadfont
- checkbit1 $00ce
+ checkbit1 EVENT_GOT_COINS_FROM_GAMBLER_AT_CELADON
iftrue .UnknownScript_0x72169
2writetext UnknownText_0x722dc
keeptextopen
@@ -58,7 +58,7 @@
stringtotext .coinname, $1
2call .UnknownScript_0x72172
givecoins 18
- setbit1 $00ce
+ setbit1 EVENT_GOT_COINS_FROM_GAMBLER_AT_CELADON
.UnknownScript_0x72169 ; 0x72169
2writetext UnknownText_0x72345
closetext
--- a/maps/CeladonGym.asm
+++ b/maps/CeladonGym.asm
@@ -19,10 +19,10 @@
startbattle
returnafterbattle
setbit1 $04c8
- setbit1 $051d
- setbit1 $0490
- setbit1 $04ba
- setbit1 $0468
+ setbit1 EVENT_BEAT_LASS_MICHELLE
+ setbit1 EVENT_BEAT_PICNICKER_TANYA
+ setbit1 EVENT_BEAT_BEAUTY_JULIA
+ setbit1 EVENT_BEAT_TWINS_JO_AND_ZOE
loadfont
2writetext UnknownText_0x72c96
playsound $009c
@@ -29,13 +29,13 @@
waitbutton
setbit2 $0026
UnknownScript_0x72a9b: ; 0x72a9b
- checkbit1 $00dc
+ checkbit1 EVENT_GOT_TM19_GIGA_DRAIN
iftrue UnknownScript_0x72aae
2writetext UnknownText_0x72cb0
keeptextopen
verbosegiveitem TM_19, 1
iffalse UnknownScript_0x72aae
- setbit1 $00dc
+ setbit1 EVENT_GOT_TM19_GIGA_DRAIN
UnknownScript_0x72aae: ; 0x72aae
2writetext UnknownText_0x72d8f
closetext
--- a/maps/CeladonMansion3F.asm
+++ b/maps/CeladonMansion3F.asm
@@ -28,7 +28,7 @@
2writetext UnknownText_0x71763
closetext
loadmovesprites
- setbit1 $00d6
+ setbit1 EVENT_ENABLE_DIPLOMA_PRINTING
end
; 0x71696
@@ -35,7 +35,7 @@
GymGuyScript_0x71696: ; 0x71696
faceplayer
loadfont
- checkbit1 $00d6
+ checkbit1 EVENT_ENABLE_DIPLOMA_PRINTING
iftrue UnknownScript_0x716a4
2writetext UnknownText_0x717b4
closetext
--- a/maps/CeladonMansionRoofHouse.asm
+++ b/maps/CeladonMansionRoofHouse.asm
@@ -9,7 +9,7 @@
PharmacistScript_0x71afd: ; 0x71afd
faceplayer
loadfont
- checkbit1 $00da
+ checkbit1 EVENT_GOT_TM03_CURSE
iftrue UnknownScript_0x71b21
2writetext UnknownText_0x71b27
keeptextopen
@@ -26,7 +26,7 @@
keeptextopen
verbosegiveitem TM_03, 1
iffalse UnknownScript_0x71b25
- setbit1 $00da
+ setbit1 EVENT_GOT_TM03_CURSE
UnknownScript_0x71b21: ; 0x71b21
2writetext UnknownText_0x71db3
closetext
--- a/maps/CeruleanCity.asm
+++ b/maps/CeruleanCity.asm
@@ -18,7 +18,7 @@
CooltrainerMScript_0x184009: ; 0x184009
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x184017
2writetext UnknownText_0x1840bc
closetext
@@ -72,9 +72,9 @@
FisherScript_0x18404a: ; 0x18404a
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x184058
- checkbit1 $00cb
+ checkbit1 EVENT_MET_ROCKET_GRUNT_AT_CERULEAN_GYM
iftrue UnknownScript_0x18405e
UnknownScript_0x184058: ; 0x184058
2writetext UnknownText_0x18424e
--- a/maps/CeruleanGym.asm
+++ b/maps/CeruleanGym.asm
@@ -42,7 +42,7 @@
applymovement $2, MovementData_0x1884e8
playsound $0023
disappear $2
- setbit1 $00cb
+ setbit1 EVENT_MET_ROCKET_GRUNT_AT_CERULEAN_GYM
clearbit1 $076c
clearbit1 $076e
dotrigger $0
@@ -68,10 +68,10 @@
loadtrainer MISTY, 1
startbattle
returnafterbattle
- setbit1 $04c6
- setbit1 $03f9
- setbit1 $03fa
- setbit1 $05a8
+ setbit1 EVENT_BEAT_MISTY
+ setbit1 EVENT_BEAT_SWIMMERF_DIANA
+ setbit1 EVENT_BEAT_SWIMMERF_BRIANA
+ setbit1 EVENT_BEAT_SWIMMERM_PARKER
loadfont
2writetext UnknownText_0x188768
playsound $009c
@@ -174,7 +174,7 @@
CeruleanGymGuyScript: ; 0x1884a2
faceplayer
loadfont
- checkbit1 $04c6
+ checkbit1 EVENT_BEAT_MISTY
iftrue .CeruleanGymGuyWinScript
2writetext CeruleanGymGuyText
closetext
--- a/maps/CharcoalKiln.asm
+++ b/maps/CharcoalKiln.asm
@@ -9,9 +9,9 @@
BlackBeltScript_0x18dd1a: ; 0x18dd1a
faceplayer
loadfont
- checkbit1 $0010
+ checkbit1 EVENT_GOT_HM01_CUT
iftrue UnknownScript_0x18dd34
- checkbit1 $002b
+ checkbit1 EVENT_CLEARED_SLOWPOKE_WELL
iftrue UnknownScript_0x18dd2e
2writetext UnknownText_0x18dd74
closetext
@@ -36,9 +36,9 @@
YoungsterScript_0x18dd3a: ; 0x18dd3a
faceplayer
loadfont
- checkbit1 $005e
+ checkbit1 EVENT_GOT_CHARCOAL_IN_CHARCOAL_KILN
iftrue UnknownScript_0x18dd5d
- checkbit1 $0010
+ checkbit1 EVENT_GOT_HM01_CUT
iftrue UnknownScript_0x18dd4e
2writetext UnknownText_0x18dee0
closetext
@@ -51,7 +51,7 @@
keeptextopen
verbosegiveitem CHARCOAL, 1
iffalse UnknownScript_0x18dd61
- setbit1 $005e
+ setbit1 EVENT_GOT_CHARCOAL_IN_CHARCOAL_KILN
loadmovesprites
end
; 0x18dd5d
--- a/maps/CherrygroveCity.asm
+++ b/maps/CherrygroveCity.asm
@@ -87,7 +87,7 @@
applymovement $2, MovementData_0x19c1cb
playsound $001f
disappear $2
- clearbit1 $06ff
+ clearbit1 EVENT_GUIDE_GENT_VISIBLE_IN_CHERRYGROVE
waitbutton
end
@@ -123,9 +123,9 @@
2writetext UnknownText_0x19c4e2
closetext
loadmovesprites
- checkbit1 $001c
+ checkbit1 EVENT_GOT_TOTODILE_FROM_ELM
iftrue UnknownScript_0x19c0ee
- checkbit1 $001d
+ checkbit1 EVENT_GOT_CHIKORITA_FROM_ELM
iftrue UnknownScript_0x19c104
winlosstext UnknownText_0x19c57f, UnknownText_0x19c5e6
setlasttalked $3
@@ -228,13 +228,13 @@
FisherScript_0x19c16e: ; 0x19c16e
faceplayer
loadfont
- checkbit1 $004d
+ checkbit1 EVENT_GOT_MYSTIC_WATER_IN_CHERRYGROVE
iftrue UnknownScript_0x19c183
2writetext UnknownText_0x19c766
keeptextopen
verbosegiveitem MYSTIC_WATER, 1
iffalse UnknownScript_0x19c187
- setbit1 $004d
+ setbit1 EVENT_GOT_MYSTIC_WATER_IN_CHERRYGROVE
UnknownScript_0x19c183: ; 0x19c183
2writetext UnknownText_0x19c7c1
closetext
--- a/maps/CherrygroveMart.asm
+++ b/maps/CherrygroveMart.asm
@@ -8,7 +8,7 @@
ClerkScript_0x19680a: ; 0x19680a
loadfont
- checkbit1 $001f
+ checkbit1 EVENT_GAVE_MYSTERY_EGG_TO_ELM
iftrue UnknownScript_0x196817
pokemart $0, $0000
loadmovesprites
@@ -24,7 +24,7 @@
CooltrainerMScript_0x19681d: ; 0x19681d
faceplayer
loadfont
- checkbit1 $001f
+ checkbit1 EVENT_GAVE_MYSTERY_EGG_TO_ELM
iftrue UnknownScript_0x19682b
2writetext UnknownText_0x196834
closetext
--- a/maps/CherrygrovePokeCenter1F.asm
+++ b/maps/CherrygrovePokeCenter1F.asm
@@ -21,7 +21,7 @@
TeacherScript_0x196976: ; 0x196976
faceplayer
loadfont
- checkbit1 $001f
+ checkbit1 EVENT_GAVE_MYSTERY_EGG_TO_ELM
iftrue UnknownScript_0x196984
2writetext UnknownText_0x1969f1
closetext
--- a/maps/CianwoodCity.asm
+++ b/maps/CianwoodCity.asm
@@ -45,7 +45,7 @@
disappear $d
pause 10
dotrigger $0
- clearbit1 $07af
+ clearbit1 EVENT_SAW_SUICUNE_ON_ROUTE_42
domaptrigger GROUP_ROUTE_42, MAP_ROUTE_42, $1
checkbit1 $0333
iftrue UnknownScript_0x1a0083
@@ -81,11 +81,11 @@
PokefanFScript_0x1a0084: ; 0x1a0084
faceplayer
loadfont
- checkbit1 $0011
+ checkbit1 EVENT_GOT_HM02_FLY
iftrue UnknownScript_0x1a00ad
2writetext UnknownText_0x1a00f1
keeptextopen
- checkbit1 $04c2
+ checkbit1 EVENT_BEAT_CHUCK
iftrue UnknownScript_0x1a009c
2writetext UnknownText_0x1a0163
closetext
@@ -98,7 +98,7 @@
keeptextopen
verbosegiveitem HM_02, 1
iffalse UnknownScript_0x1a00b1
- setbit1 $0011
+ setbit1 EVENT_GOT_HM02_FLY
2writetext UnknownText_0x1a021d
keeptextopen
UnknownScript_0x1a00ad: ; 0x1a00ad
--- a/maps/CianwoodGym.asm
+++ b/maps/CianwoodGym.asm
@@ -9,7 +9,7 @@
ChuckScript_0x9d60f: ; 0x9d60f
faceplayer
loadfont
- checkbit1 $04c2
+ checkbit1 EVENT_BEAT_CHUCK
iftrue UnknownScript_0x9d656
2writetext UnknownText_0x9d6f9
closetext
@@ -33,7 +33,7 @@
loadtrainer CHUCK, 1
startbattle
returnafterbattle
- setbit1 $04c2
+ setbit1 EVENT_BEAT_CHUCK
loadfont
2writetext UnknownText_0x9d835
playsound $009c
@@ -42,17 +42,17 @@
checkcode $7
2call UnknownScript_0x9d681
UnknownScript_0x9d656: ; 0x9d656
- checkbit1 $000a
+ checkbit1 EVENT_GOT_TM01_DYNAMICPUNCH
iftrue UnknownScript_0x9d67b
- setbit1 $04a5
- setbit1 $04a7
- setbit1 $04a8
- setbit1 $04aa
+ setbit1 EVENT_BEAT_BLACKBELT_YOSHI
+ setbit1 EVENT_BEAT_BLACKBELT_LAO
+ setbit1 EVENT_BEAT_BLACKBELT_NOB
+ setbit1 EVENT_BEAT_BLACKBELT_LUNG
2writetext UnknownText_0x9d84d
keeptextopen
verbosegiveitem TM_01, 1
iffalse UnknownScript_0x9d67f
- setbit1 $000a
+ setbit1 EVENT_GOT_TM01_DYNAMICPUNCH
2writetext UnknownText_0x9d8da
closetext
loadmovesprites
--- a/maps/CianwoodPharmacy.asm
+++ b/maps/CianwoodPharmacy.asm
@@ -16,7 +16,7 @@
PharmacistScript_0x9df9e: ; 0x9df9e
faceplayer
loadfont
- checkbit1 $0023
+ checkbit1 EVENT_GOT_SECRETPOTION_FROM_PHARMACY
iftrue UnknownScript_0x9dfc4
checkbit1 $0037
iffalse UnknownScript_0x9dfc4
@@ -27,7 +27,7 @@
playsound $0091
waitbutton
itemnotify
- setbit1 $0023
+ setbit1 EVENT_GOT_SECRETPOTION_FROM_PHARMACY
2writetext UnknownText_0x9e070
closetext
loadmovesprites
--- a/maps/CianwoodPokeCenter1F.asm
+++ b/maps/CianwoodPokeCenter1F.asm
@@ -16,7 +16,7 @@
CianwoodGymGuyScript: ; 0x9dbd5
faceplayer
- checkbit1 $04c2
+ checkbit1 EVENT_BEAT_CHUCK
iftrue .CianwoodGymGuyWinScript
loadfont
2writetext CianwoodGymGuyText
--- a/maps/CopycatsHouse1F.asm
+++ b/maps/CopycatsHouse1F.asm
@@ -13,7 +13,7 @@
PokefanFScript_0x18ad16: ; 0x18ad16
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x18ad24
2writetext UnknownText_0x18ad95
closetext
--- a/maps/CopycatsHouse2F.asm
+++ b/maps/CopycatsHouse2F.asm
@@ -27,9 +27,9 @@
CopycatScript_0x18aeb1: ; 0x18aeb1
faceplayer
- checkbit1 $00d1
+ checkbit1 EVENT_GOT_PASS_FROM_COPYCAT
iftrue UnknownScript_0x18af6f
- checkbit1 $00d0
+ checkbit1 EVENT_RETURNED_LOST_ITEM_TO_COPYCAT
iftrue UnknownScript_0x18af5b
checkitem LOST_ITEM
iftrue UnknownScript_0x18af4a
@@ -47,7 +47,7 @@
variablesprite $b, $60
UnknownScript_0x18aedc: ; 0x18aedc
special $005e
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x18af16
loadfont
checkbit2 $0063
@@ -109,7 +109,7 @@
2writetext UnknownText_0x18b116
closetext
loadmovesprites
- setbit1 $00cf
+ setbit1 EVENT_MET_COPYCAT_FOUND_OUT_ABOUT_LOST_ITEM
end
; 0x18af4a
@@ -118,7 +118,7 @@
2writetext UnknownText_0x18b17f
keeptextopen
takeitem LOST_ITEM, 1
- setbit1 $00d0
+ setbit1 EVENT_RETURNED_LOST_ITEM_TO_COPYCAT
clearbit1 $0773
2jump UnknownScript_0x18af5c
; 0x18af5b
@@ -130,7 +130,7 @@
keeptextopen
verbosegiveitem PASS, 1
iffalse UnknownScript_0x18afba
- setbit1 $00d1
+ setbit1 EVENT_GOT_PASS_FROM_COPYCAT
2writetext UnknownText_0x18b214
closetext
loadmovesprites
--- a/maps/DanceTheatre.asm
+++ b/maps/DanceTheatre.asm
@@ -156,17 +156,17 @@
loadfont
2writetext UnknownText_0x9980a
keeptextopen
- checkbit1 $0012
+ checkbit1 EVENT_GOT_HM03_SURF
iftrue UnknownScript_0x99515
- checkbit1 $04df
+ checkbit1 EVENT_BEAT_KIMONO_GIRL_NAOKO
iffalse UnknownScript_0x994f3
- checkbit1 $04e0
+ checkbit1 EVENT_BEAT_KIMONO_GIRL_SAYO
iffalse UnknownScript_0x994f3
- checkbit1 $04e1
+ checkbit1 EVENT_BEAT_KIMONO_GIRL_ZUKI
iffalse UnknownScript_0x994f3
- checkbit1 $04e2
+ checkbit1 EVENT_BEAT_KIMONO_GIRL_KUNI
iffalse UnknownScript_0x994f3
- checkbit1 $04e3
+ checkbit1 EVENT_BEAT_KIMONO_GIRL_MIKI
iffalse UnknownScript_0x994f3
2jump UnknownScript_0x99505
; 0x994f3
@@ -191,7 +191,7 @@
2writetext UnknownText_0x9991a
keeptextopen
verbosegiveitem HM_03, 1
- setbit1 $0012
+ setbit1 EVENT_GOT_HM03_SURF
2writetext UnknownText_0x9999b
closetext
loadmovesprites
--- a/maps/DarkCaveBlackthornEntrance.asm
+++ b/maps/DarkCaveBlackthornEntrance.asm
@@ -9,13 +9,13 @@
PharmacistScript_0x18c720: ; 0x18c720
faceplayer
loadfont
- checkbit1 $0072
+ checkbit1 EVENT_GOT_BLACKGLASSES_IN_DARK_CAVE
iftrue UnknownScript_0x18c735
2writetext UnknownText_0x18c73f
keeptextopen
verbosegiveitem BLACKGLASSES, 1
iffalse UnknownScript_0x18c739
- setbit1 $0072
+ setbit1 EVENT_GOT_BLACKGLASSES_IN_DARK_CAVE
UnknownScript_0x18c735: ; 0x18c735
2writetext UnknownText_0x18c80c
closetext
--- a/maps/DayCare.asm
+++ b/maps/DayCare.asm
@@ -27,7 +27,7 @@
GrampsScript_0x62f8f: ; 0x62f8f
faceplayer
loadfont
- checkbit1 $033e
+ checkbit1 EVENT_GOT_ODD_EGG
iftrue UnknownScript_0x62fbd
2writetext UnknownText_0x630ce
keeptextopen
@@ -42,7 +42,7 @@
2writetext UnknownText_0x631c3
closetext
loadmovesprites
- setbit1 $033e
+ setbit1 EVENT_GOT_ODD_EGG
end
; 0x62fb6
--- a/maps/DragonShrine.asm
+++ b/maps/DragonShrine.asm
@@ -201,7 +201,7 @@
iftrue UnknownScript_0x18d1ff
checkbit1 $00bd
iffalse UnknownScript_0x18d1c5
- checkbit1 $0319
+ checkbit1 EVENT_BEAT_RIVAL_IN_MT_MOON
iftrue UnknownScript_0x18d1f3
2writetext UnknownText_0x18d724
closetext
--- a/maps/DragonsDenB1F.asm
+++ b/maps/DragonsDenB1F.asm
@@ -23,7 +23,7 @@
; 0x18c89f
UnknownScript_0x18c89f: ; 0x18c89f
- checkbit1 $0319
+ checkbit1 EVENT_BEAT_RIVAL_IN_MT_MOON
iftrue UnknownScript_0x18c8a8
disappear $4
return
@@ -62,7 +62,7 @@
playsound $0001
waitbutton
itemnotify
- setbit1 $000f
+ setbit1 EVENT_GOT_TM24_DRAGONBREATH
2writetext UnknownText_0x18ca0d
keeptextopen
2writetext UnknownText_0x18caf1
--- a/maps/EcruteakCity.asm
+++ b/maps/EcruteakCity.asm
@@ -34,7 +34,7 @@
LassScript_0x1a4015: ; 0x1a4015
faceplayer
loadfont
- checkbit1 $007b
+ checkbit1 EVENT_RELEASED_THE_BEASTS
iftrue UnknownScript_0x1a4023
2writetext UnknownText_0x1a421a
closetext
@@ -52,7 +52,7 @@
FisherScript_0x1a4029: ; 0x1a4029
faceplayer
loadfont
- checkbit1 $0020
+ checkbit1 EVENT_JASMINE_RETURNED_TO_GYM
iftrue UnknownScript_0x1a4037
2writetext UnknownText_0x1a42ac
closetext
--- a/maps/EcruteakGym.asm
+++ b/maps/EcruteakGym.asm
@@ -22,7 +22,7 @@
MortyScript_0x99d58: ; 0x99d58
faceplayer
loadfont
- checkbit1 $04c0
+ checkbit1 EVENT_BEAT_MORTY
iftrue UnknownScript_0x99d8c
2writetext UnknownText_0x99e65
closetext
@@ -31,7 +31,7 @@
loadtrainer MORTY, 1
startbattle
returnafterbattle
- setbit1 $04c0
+ setbit1 EVENT_BEAT_MORTY
loadfont
2writetext UnknownText_0x9a043
playsound $009c
@@ -43,17 +43,17 @@
setbit1 $0766
setbit1 $0767
UnknownScript_0x99d8c: ; 0x99d8c
- checkbit1 $000c
+ checkbit1 EVENT_GOT_TM30_SHADOW_BALL
iftrue UnknownScript_0x99db1
- setbit1 $0415
- setbit1 $0416
- setbit1 $058b
- setbit1 $058c
+ setbit1 EVENT_BEAT_SAGE_JEFFREY
+ setbit1 EVENT_BEAT_SAGE_PING
+ setbit1 EVENT_BEAT_MEDIUM_MARTHA
+ setbit1 EVENT_BEAT_MEDIUM_GRACE
2writetext UnknownText_0x9a059
keeptextopen
verbosegiveitem TM_30, 1
iffalse UnknownScript_0x99db5
- setbit1 $000c
+ setbit1 EVENT_GOT_TM30_SHADOW_BALL
2writetext UnknownText_0x9a0ec
closetext
loadmovesprites
@@ -218,7 +218,7 @@
EcruteakGymGuyScript: ; 0x99e39
faceplayer
loadfont
- checkbit1 $04c0
+ checkbit1 EVENT_BEAT_MORTY
iftrue .EcruteakGymGuyWinScript
2writetext EcruteakGymGuyText
closetext
--- a/maps/EcruteakHouse.asm
+++ b/maps/EcruteakHouse.asm
@@ -23,11 +23,11 @@
; 0x9800f
UnknownScript_0x9800f: ; 0x9800f
- checkbit1 $0335
+ checkbit1 EVENT_FOUGHT_SUICUNE
iftrue UnknownScript_0x98033
- checkbit1 $0334
+ checkbit1 EVENT_KOJI_ALLOWS_YOU_PASSAGE_TO_TIN_TOWER
iftrue UnknownScript_0x98033
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x98022
return
; 0x98022
@@ -77,7 +77,7 @@
SageScript_0x98062: ; 0x98062
faceplayer
loadfont
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x9807c
checkbit2 $001e
iftrue UnknownScript_0x98076
@@ -95,7 +95,7 @@
; 0x9807c
UnknownScript_0x9807c: ; 0x9807c
- checkbit1 $0334
+ checkbit1 EVENT_KOJI_ALLOWS_YOU_PASSAGE_TO_TIN_TOWER
iftrue UnknownScript_0x980a4
checkbit1 $0000
iftrue UnknownScript_0x980aa
@@ -135,7 +135,7 @@
SageScript_0x980b0: ; 0x980b0
faceplayer
loadfont
- checkbit1 $0078
+ checkbit1 EVENT_GOT_CLEAR_BELL
iftrue UnknownScript_0x980be
2writetext UnknownText_0x9840b
closetext
--- a/maps/EcruteakItemfinderHouse.asm
+++ b/maps/EcruteakItemfinderHouse.asm
@@ -9,7 +9,7 @@
CooltrainerMScript_0x9a5fb: ; 0x9a5fb
faceplayer
loadfont
- checkbit1 $005a
+ checkbit1 EVENT_GOT_ITEMFINDER
iftrue UnknownScript_0x9a614
2writetext UnknownText_0x9a63c
yesorno
@@ -17,7 +17,7 @@
2writetext UnknownText_0x9a6b5
keeptextopen
verbosegiveitem ITEMFINDER, 1
- setbit1 $005a
+ setbit1 EVENT_GOT_ITEMFINDER
UnknownScript_0x9a614: ; 0x9a614
2writetext UnknownText_0x9a70e
closetext
--- a/maps/ElmsLab.asm
+++ b/maps/ElmsLab.asm
@@ -98,21 +98,21 @@
ProfElmScript: ; 0x78be0
faceplayer
loadfont
- checkbit1 $0024
+ checkbit1 EVENT_GOT_SS_TICKET_FROM_ELM
iftrue UnknownScript_0x78bee
checkbit1 $0044
iftrue ElmGiveTicketScript
UnknownScript_0x78bee: ; 0x78bee
- checkbit1 $007c
+ checkbit1 EVENT_GOT_MASTER_BALL_FROM_ELM
iftrue UnknownScript_0x78bfa
checkbit2 $0022
iftrue ElmGiveMasterBallScript
UnknownScript_0x78bfa: ; 0x78bfa
- checkbit1 $0056
+ checkbit1 EVENT_GOT_EVERSTONE_FROM_ELM
iftrue UnknownScript_0x78e16
- checkbit1 $0055
+ checkbit1 EVENT_SHOWED_TOGEPI_TO_ELM
iftrue UnknownScript_0x78e03
- checkbit1 $0077
+ checkbit1 EVENT_TOLD_ELM_ABOUT_TOGEPI_OVER_THE_PHONE
iffalse UnknownScript_0x78c35
writebyte TOGEPI
special $0043
@@ -137,20 +137,20 @@
; 0x78c35
UnknownScript_0x78c35: ; 0x78c35
- checkbit1 $002d
+ checkbit1 EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE
iffalse UnknownScript_0x78c41
- checkbit1 $0054
+ checkbit1 EVENT_TOGEPI_HATCHED
iftrue UnknownScript_0x78c22
UnknownScript_0x78c41: ; 0x78c41
- checkbit1 $002d ; why are we checking it again?
+ checkbit1 EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE ; why are we checking it again?
iftrue ElmWaitingEggHatchScript
checkbit2 $001b
iftrue ElmAideHasEggScript
- checkbit1 $001f
+ checkbit1 EVENT_GAVE_MYSTERY_EGG_TO_ELM
iftrue ElmStudyingEggScript
- checkbit1 $001e
+ checkbit1 EVENT_GOT_MYSTERY_EGG_FROM_MR_POKEMON
iftrue ElmAfterTheftScript
- checkbit1 $001a
+ checkbit1 EVENT_GOT_A_POKEMON_FROM_ELM
iftrue ElmDescribesMrPokemonScript
2writetext UnknownText_0x79375
closetext
@@ -169,7 +169,7 @@
; 0x78c73
CyndaquilPokeBallScript: ; 0x78c73
- checkbit1 $001a
+ checkbit1 EVENT_GOT_A_POKEMON_FROM_ELM
iftrue LookAtElmPokeBallScript
spriteface $2, $0
refreshscreen $0
@@ -182,7 +182,7 @@
yesorno
iffalse DidntChooseStarterScript
disappear $4
- setbit1 $001b
+ setbit1 EVENT_GOT_CYNDAQUIL_FROM_ELM
2writetext ChoseStarterText
keeptextopen
waitbutton
@@ -200,7 +200,7 @@
; 0x78cb5
TotodilePokeBallScript: ; 0x78cb5
- checkbit1 $001a
+ checkbit1 EVENT_GOT_A_POKEMON_FROM_ELM
iftrue LookAtElmPokeBallScript
spriteface $2, $0
refreshscreen $0
@@ -213,7 +213,7 @@
yesorno
iffalse DidntChooseStarterScript
disappear $5
- setbit1 $001c
+ setbit1 EVENT_GOT_TOTODILE_FROM_ELM
2writetext ChoseStarterText
keeptextopen
waitbutton
@@ -229,7 +229,7 @@
; 0x78cf1
ChikoritaPokeBallScript: ; 0x78cf1
- checkbit1 $001a
+ checkbit1 EVENT_GOT_A_POKEMON_FROM_ELM
iftrue LookAtElmPokeBallScript
spriteface $2, $0
refreshscreen $0
@@ -242,7 +242,7 @@
yesorno
iffalse DidntChooseStarterScript
disappear $6
- setbit1 $001d
+ setbit1 EVENT_GOT_CHIKORITA_FROM_ELM
2writetext ChoseStarterText
keeptextopen
waitbutton
@@ -287,7 +287,7 @@
2writetext ElmDirectionsText3
closetext
loadmovesprites
- setbit1 $001a
+ setbit1 EVENT_GOT_A_POKEMON_FROM_ELM
setbit1 $06be
dotrigger $5
domaptrigger GROUP_NEW_BARK_TOWN, MAP_NEW_BARK_TOWN, $1
@@ -311,7 +311,7 @@
MapElmsLabSignpost0Script: ; 0x78d74
loadfont
- checkbit1 $001a
+ checkbit1 EVENT_GOT_A_POKEMON_FROM_ELM
iftrue UnknownScript_0x78d81
2writetext UnknownText_0x79690
closetext
@@ -361,7 +361,7 @@
keeptextopen
2writetext ElmAfterTheftText5
keeptextopen
- setbit1 $001f
+ setbit1 EVENT_GAVE_MYSTERY_EGG_TO_ELM
setbit2 $0010
domaptrigger GROUP_ROUTE_29, MAP_ROUTE_29, $1
clearbit1 $0715
@@ -399,7 +399,7 @@
closetext
loadmovesprites
showemote $0, $2, 15
- setbit1 $0055
+ setbit1 EVENT_SHOWED_TOGEPI_TO_ELM
loadfont
2writetext ShowElmTogepiText2
keeptextopen
@@ -413,7 +413,7 @@
2writetext ElmGiveEverstoneText2
closetext
loadmovesprites
- setbit1 $0056
+ setbit1 EVENT_GOT_EVERSTONE_FROM_ELM
end
; 0x78e16
@@ -430,7 +430,7 @@
keeptextopen
verbosegiveitem MASTER_BALL, 1
iffalse .notdone
- setbit1 $007c
+ setbit1 EVENT_GOT_MASTER_BALL_FROM_ELM
2writetext ElmGiveMasterBallText2
closetext
.notdone
@@ -442,7 +442,7 @@
2writetext ElmGiveTicketText1
keeptextopen
verbosegiveitem S_S_TICKET, 1
- setbit1 $0024
+ setbit1 EVENT_GOT_SS_TICKET_FROM_ELM
2writetext ElmGiveTicketText2
closetext
loadmovesprites
@@ -560,11 +560,11 @@
ElmsAideScript: ; 0x78ee6
faceplayer
loadfont
- checkbit1 $002d
+ checkbit1 EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE
iftrue UnknownScript_0x78f0c
- checkbit1 $001f
+ checkbit1 EVENT_GAVE_MYSTERY_EGG_TO_ELM
iftrue UnknownScript_0x78f06
- checkbit1 $001e
+ checkbit1 EVENT_GOT_MYSTERY_EGG_FROM_MR_POKEMON
iftrue UnknownScript_0x78f00
2writetext UnknownText_0x79f65
closetext
@@ -617,7 +617,7 @@
loadfont
checkbit2 $0043
iftrue UnknownScript_0x78f49
- checkbit1 $0043
+ checkbit1 EVENT_ELM_CALLED_ABOUT_STOLEN_POKEMON
iftrue UnknownScript_0x78f43
2jump UnknownScript_0x78f49
; 0x78f43
--- a/maps/FastShipCabins.asm
+++ b/maps/FastShipCabins.asm
@@ -80,7 +80,7 @@
GentlemanScript_0x75f1f: ; 0x75f1f
faceplayer
loadfont
- checkbit1 $0071
+ checkbit1 EVENT_GOT_METAL_COAT_FROM_GRANDPA_ON_SS_AQUA
iftrue UnknownScript_0x75f67
checkbit1 $0732
iftrue UnknownScript_0x75f58
@@ -96,7 +96,7 @@
keeptextopen
verbosegiveitem METAL_COAT, 1
iffalse UnknownScript_0x75f44
- setbit1 $0071
+ setbit1 EVENT_GOT_METAL_COAT_FROM_GRANDPA_ON_SS_AQUA
UnknownScript_0x75f44: ; 0x75f44
loadmovesprites
waitbutton
@@ -116,7 +116,7 @@
keeptextopen
verbosegiveitem METAL_COAT, 1
iffalse UnknownScript_0x75f65
- setbit1 $0071
+ setbit1 EVENT_GOT_METAL_COAT_FROM_GRANDPA_ON_SS_AQUA
UnknownScript_0x75f65: ; 0x75f65
loadmovesprites
end
--- a/maps/FastShipCabins_SE_SSE_CaptainsCabin.asm
+++ b/maps/FastShipCabins_SE_SSE_CaptainsCabin.asm
@@ -80,7 +80,7 @@
GentlemanScript_0x75f1f: ; 0x75f1f
faceplayer
loadfont
- checkbit1 $0071
+ checkbit1 EVENT_GOT_METAL_COAT_FROM_GRANDPA_ON_SS_AQUA
iftrue UnknownScript_0x75f67
checkbit1 $0732
iftrue UnknownScript_0x75f58
@@ -96,7 +96,7 @@
keeptextopen
verbosegiveitem METAL_COAT, 1
iffalse UnknownScript_0x75f44
- setbit1 $0071
+ setbit1 EVENT_GOT_METAL_COAT_FROM_GRANDPA_ON_SS_AQUA
UnknownScript_0x75f44: ; 0x75f44
loadmovesprites
waitbutton
@@ -116,7 +116,7 @@
keeptextopen
verbosegiveitem METAL_COAT, 1
iffalse UnknownScript_0x75f65
- setbit1 $0071
+ setbit1 EVENT_GOT_METAL_COAT_FROM_GRANDPA_ON_SS_AQUA
UnknownScript_0x75f65: ; 0x75f65
loadmovesprites
end
--- a/maps/FuchsiaGym.asm
+++ b/maps/FuchsiaGym.asm
@@ -19,7 +19,7 @@
loadtrainer JANINE, 1
startbattle
returnafterbattle
- setbit1 $04c9
+ setbit1 EVENT_BEAT_JANINE
setbit1 $0517
setbit1 $051a
setbit1 $0482
@@ -41,13 +41,13 @@
faceplayer
loadfont
UnknownScript_0x195e02: ; 0x195e02
- checkbit1 $00dd
+ checkbit1 EVENT_GOT_TM06_TOXIC
iftrue UnknownScript_0x195e15
2writetext UnknownText_0x196002
keeptextopen
verbosegiveitem TM_06, 1
iffalse UnknownScript_0x195e15
- setbit1 $00dd
+ setbit1 EVENT_GOT_TM06_TOXIC
UnknownScript_0x195e15: ; 0x195e15
2writetext UnknownText_0x196074
closetext
@@ -206,7 +206,7 @@
FuchsiaGymGuyScript: ; 0x195f03
faceplayer
loadfont
- checkbit1 $04c9
+ checkbit1 EVENT_BEAT_JANINE
iftrue .FuchsiaGymGuyWinScript
2writetext FuchsiaGymGuyText
closetext
--- a/maps/GoldenrodBikeShop.asm
+++ b/maps/GoldenrodBikeShop.asm
@@ -13,7 +13,7 @@
ClerkScript_0x54750: ; 0x54750
faceplayer
loadfont
- checkbit1 $005b
+ checkbit1 EVENT_GOT_BICYCLE
iftrue UnknownScript_0x54775
2writetext UnknownText_0x54787
yesorno
@@ -27,7 +27,7 @@
waitbutton
itemnotify
setbit2 $0014
- setbit1 $005b
+ setbit1 EVENT_GOT_BICYCLE
UnknownScript_0x54775: ; 0x54775
2writetext UnknownText_0x5485f
closetext
--- a/maps/GoldenrodBillsHouse.asm
+++ b/maps/GoldenrodBillsHouse.asm
@@ -9,7 +9,7 @@
BillScript_0x54be4: ; 0x54be4
faceplayer
loadfont
- checkbit1 $004f
+ checkbit1 EVENT_GOT_EEVEE
iftrue UnknownScript_0x54c1f
2writetext UnknownText_0x54c74
yesorno
@@ -23,7 +23,7 @@
playsound $0002
waitbutton
givepoke EEVEE, 20, 0, 0
- setbit1 $004f
+ setbit1 EVENT_GOT_EEVEE
2writetext UnknownText_0x54dc1
closetext
loadmovesprites
--- a/maps/GoldenrodCity.asm
+++ b/maps/GoldenrodCity.asm
@@ -174,7 +174,7 @@
CooltrainerFScript_0x1989e9: ; 0x1989e9
faceplayer
loadfont
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x1989f7
2writetext UnknownText_0x198ae6
closetext
--- a/maps/GoldenrodDeptStore5F.asm
+++ b/maps/GoldenrodDeptStore5F.asm
@@ -25,15 +25,15 @@
ClerkScript_0x5609c: ; 0x5609c
faceplayer
loadfont
- checkbit1 $005f
+ checkbit1 EVENT_GOT_TM02_HEADBUTT
iftrue UnknownScript_0x560ad
- checkbit1 $004b
+ checkbit1 EVENT_GOT_TM08_ROCK_SMASH
iftrue UnknownScript_0x560c2
2jump UnknownScript_0x560b6
; 0x560ad
UnknownScript_0x560ad: ; 0x560ad
- checkbit1 $004b
+ checkbit1 EVENT_GOT_TM08_ROCK_SMASH
iftrue UnknownScript_0x560c8
2jump UnknownScript_0x560bc
; 0x560b6
--- a/maps/GoldenrodFlowerShop.asm
+++ b/maps/GoldenrodFlowerShop.asm
@@ -7,9 +7,9 @@
; 0x5535d
TeacherScript_0x5535d: ; 0x5535d
- checkbit1 $002a
+ checkbit1 EVENT_FOUGHT_SUDOWOODO
iftrue UnknownScript_0x5538f
- checkbit1 $005c
+ checkbit1 EVENT_GOT_SQUIRTBOTTLE
iftrue UnknownScript_0x55399
checkbit1 $00b9
iffalse UnknownScript_0x5539f
@@ -22,7 +22,7 @@
2writetext UnknownText_0x554c2
keeptextopen
verbosegiveitem SQUIRTBOTTLE, 1
- setbit1 $005c
+ setbit1 EVENT_GOT_SQUIRTBOTTLE
loadmovesprites
setbit1 $0769
clearbit1 $0768
@@ -53,9 +53,9 @@
LassScript_0x553a2: ; 0x553a2
faceplayer
loadfont
- checkbit1 $002a
+ checkbit1 EVENT_FOUGHT_SUDOWOODO
iftrue UnknownScript_0x553c5
- checkbit1 $005c
+ checkbit1 EVENT_GOT_SQUIRTBOTTLE
iftrue UnknownScript_0x553bf
2writetext UnknownText_0x55561
closetext
--- a/maps/GoldenrodGym.asm
+++ b/maps/GoldenrodGym.asm
@@ -20,7 +20,7 @@
WhitneyScript_0x5400c: ; 0x5400c
faceplayer
- checkbit1 $04bf
+ checkbit1 EVENT_BEAT_WHITNEY
iftrue UnknownScript_0x54037
loadfont
2writetext UnknownText_0x54122
@@ -30,16 +30,16 @@
loadtrainer WHITNEY, 1
startbattle
returnafterbattle
- setbit1 $04bf
- setbit1 $0028
+ setbit1 EVENT_BEAT_WHITNEY
+ setbit1 EVENT_MADE_WHITNEY_CRY
dotrigger $1
- setbit1 $04ad
- setbit1 $04ae
- setbit1 $0515
- setbit1 $0516
+ setbit1 EVENT_BEAT_BEAUTY_VICTORIA
+ setbit1 EVENT_BEAT_BEAUTY_SAMANTHA
+ setbit1 EVENT_BEAT_LASS_CARRIE
+ setbit1 EVENT_BEAT_LASS_BRIDGET
UnknownScript_0x54037: ; 0x54037
loadfont
- checkbit1 $0028
+ checkbit1 EVENT_MADE_WHITNEY_CRY
iffalse UnknownScript_0x54044
2writetext UnknownText_0x541f4
closetext
@@ -48,7 +48,7 @@
; 0x54044
UnknownScript_0x54044: ; 0x54044
- checkbit1 $000b
+ checkbit1 EVENT_GOT_TM45_ATTRACT
iftrue UnknownScript_0x54077
checkbit2 $001d
iftrue UnknownScript_0x54064
@@ -66,7 +66,7 @@
keeptextopen
verbosegiveitem TM_45, 1
iffalse UnknownScript_0x5407b
- setbit1 $000b
+ setbit1 EVENT_GOT_TM45_ATTRACT
2writetext UnknownText_0x54302
closetext
loadmovesprites
@@ -134,7 +134,7 @@
loadmovesprites
applymovement $4, BridgetWalksAwayMovement
dotrigger $0
- clearbit1 $0028
+ clearbit1 EVENT_MADE_WHITNEY_CRY
end
; 0x540bb
@@ -227,7 +227,7 @@
GoldenrodGymGuyScript: ; 0x540f7
faceplayer
- checkbit1 $04bf
+ checkbit1 EVENT_BEAT_WHITNEY
iftrue .GoldenrodGymGuyWinScript
loadfont
2writetext GoldenrodGymGuyText
--- a/maps/GoldenrodMagnetTrainStation.asm
+++ b/maps/GoldenrodMagnetTrainStation.asm
@@ -16,7 +16,7 @@
OfficerScript_0x550ec: ; 0x550ec
faceplayer
loadfont
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x550fa
2writetext UnknownText_0x55160
closetext
--- a/maps/GoldenrodPokeCenter1F.asm
+++ b/maps/GoldenrodPokeCenter1F.asm
@@ -18,7 +18,7 @@
; 0x60f9e
UnknownScript_0x60f9e: ; 0x60f9e
- checkbit1 $0340
+ checkbit1 EVENT_GOT_GS_BALL_FROM_POKECOM_CENTER
iftrue UnknownScript_0x60fd8
playsound $0023
moveperson $3, $0, $7
@@ -31,8 +31,8 @@
2writetext UnknownText_0x622f0
closetext
verbosegiveitem GS_BALL, 1
- setbit1 $0340
- setbit1 $00be
+ setbit1 EVENT_GOT_GS_BALL_FROM_POKECOM_CENTER
+ setbit1 EVENT_CAN_GIVE_GS_BALL_TO_KURT
2writetext UnknownText_0x62359
closetext
loadmovesprites
@@ -52,7 +52,7 @@
; 0x60fe3
UnknownScript_0x60fe3: ; 0x60fe3
- checkbit1 $0340
+ checkbit1 EVENT_GOT_GS_BALL_FROM_POKECOM_CENTER
iftrue UnknownScript_0x6101d
playsound $0023
moveperson $3, $0, $7
@@ -65,8 +65,8 @@
2writetext UnknownText_0x622f0
closetext
verbosegiveitem GS_BALL, 1
- setbit1 $0340
- setbit1 $00be
+ setbit1 EVENT_GOT_GS_BALL_FROM_POKECOM_CENTER
+ setbit1 EVENT_CAN_GIVE_GS_BALL_TO_KURT
2writetext UnknownText_0x62359
closetext
loadmovesprites
--- a/maps/HallOfFame.asm
+++ b/maps/HallOfFame.asm
@@ -42,7 +42,7 @@
clearbit1 $0738
domaptrigger GROUP_SPROUT_TOWER_3F, MAP_SPROUT_TOWER_3F, $1
special $001b
- checkbit1 $0024
+ checkbit1 EVENT_GOT_SS_TICKET_FROM_ELM
iftrue UnknownScript_0x181497
specialphonecall $5
UnknownScript_0x181497: ; 0x181497
--- a/maps/IcePathB1F.asm
+++ b/maps/IcePathB1F.asm
@@ -38,25 +38,25 @@
UnknownScript_0x7e4d8: ; 0x7e4d8
disappear 2
- clearbit1 $070d
+ clearbit1 EVENT_BOULDER_IN_ICE_PATH_1
2jump UnknownScript_0x7e4f8
; 0x7e4e0
UnknownScript_0x7e4e0: ; 0x7e4e0
disappear 3
- clearbit1 $070e
+ clearbit1 EVENT_BOULDER_IN_ICE_PATH_2
2jump UnknownScript_0x7e4f8
; 0x7e4e8
UnknownScript_0x7e4e8: ; 0x7e4e8
disappear 4
- clearbit1 $070f
+ clearbit1 EVENT_BOULDER_IN_ICE_PATH_3
2jump UnknownScript_0x7e4f8
; 0x7e4f0
UnknownScript_0x7e4f0: ; 0x7e4f0
disappear 5
- clearbit1 $0710
+ clearbit1 EVENT_BOULDER_IN_ICE_PATH_4
2jump UnknownScript_0x7e4f8
; 0x7e4f8
--- a/maps/IlexForest.asm
+++ b/maps/IlexForest.asm
@@ -11,7 +11,7 @@
; 0x6eb03
UnknownScript_0x6eb03: ; 0x6eb03
- checkbit1 $0010
+ checkbit1 EVENT_GOT_HM01_CUT
iftrue UnknownScript_0x6eb34
copybytetovar FarfetchdPosition
if_equal $1, UnknownScript_0x6eb35
@@ -373,12 +373,12 @@
BlackBeltScript_0x6edae: ; 0x6edae
faceplayer
loadfont
- checkbit1 $0010
+ checkbit1 EVENT_GOT_HM01_CUT
iftrue UnknownScript_0x6edd8
2writetext UnknownText_0x6f099
keeptextopen
verbosegiveitem HM_01, 1
- setbit1 $0010
+ setbit1 EVENT_GOT_HM01_CUT
2writetext UnknownText_0x6f141
closetext
loadmovesprites
@@ -401,13 +401,13 @@
RockerScript_0x6edde: ; 0x6edde
faceplayer
loadfont
- checkbit1 $005f
+ checkbit1 EVENT_GOT_TM02_HEADBUTT
iftrue UnknownScript_0x6edf3
2writetext UnknownText_0x6f21b
keeptextopen
verbosegiveitem TM_02, 1
iffalse UnknownScript_0x6edf7
- setbit1 $005f
+ setbit1 EVENT_GOT_TM02_HEADBUTT
UnknownScript_0x6edf3: ; 0x6edf3
2writetext UnknownText_0x6f26d
closetext
--- a/maps/IndigoPlateauPokeCenter1F.asm
+++ b/maps/IndigoPlateauPokeCenter1F.asm
@@ -25,26 +25,26 @@
domaptrigger GROUP_LANCES_ROOM, MAP_LANCES_ROOM, $0
domaptrigger GROUP_HALL_OF_FAME, MAP_HALL_OF_FAME, $0
clearbit1 $0309
- clearbit1 $030a
- clearbit1 $030b
- clearbit1 $030c
- clearbit1 $030d
- clearbit1 $030e
- clearbit1 $030f
- clearbit1 $0310
- clearbit1 $0311
+ clearbit1 EVENT_WILLS_ROOM_EXIT_OPEN
+ clearbit1 EVENT_WILLS_ROOM_ENTRANCE_CLOSED
+ clearbit1 EVENT_KOGAS_ROOM_EXIT_OPEN
+ clearbit1 EVENT_KOGAS_ROOM_ENTRANCE_CLOSED
+ clearbit1 EVENT_BRUNOS_ROOM_EXIT_OPEN
+ clearbit1 EVENT_KARENS_ROOM_ENTRANCE_CLOSED
+ clearbit1 EVENT_KARENS_ROOM_EXIT_OPEN
+ clearbit1 EVENT_LANCES_ROOM_ENTRANCE_CLOSED
clearbit1 $0312
clearbit1 $05b8
clearbit1 $05b9
clearbit1 $05ba
- clearbit1 $05bb
- clearbit1 $05bc
+ clearbit1 EVENT_BEAT_ELITE_4_KAREN
+ clearbit1 EVENT_BEAT_CHAMPION_LANCE
setbit1 $075f
return
; 0x180053
UnknownScript_0x180053: ; 0x180053
- checkbit1 $0319
+ checkbit1 EVENT_BEAT_RIVAL_IN_MT_MOON
iffalse UnknownScript_0x18012b
checkbit2 $005d
iftrue UnknownScript_0x18012b
@@ -67,7 +67,7 @@
; 0x180094
UnknownScript_0x180094: ; 0x180094
- checkbit1 $0319
+ checkbit1 EVENT_BEAT_RIVAL_IN_MT_MOON
iffalse UnknownScript_0x18012b
checkbit2 $005d
iftrue UnknownScript_0x18012b
@@ -91,9 +91,9 @@
closetext
loadmovesprites
setbit1 $077b
- checkbit1 $001c
+ checkbit1 EVENT_GOT_TOTODILE_FROM_ELM
iftrue UnknownScript_0x1800f3
- checkbit1 $001d
+ checkbit1 EVENT_GOT_CHIKORITA_FROM_ELM
iftrue UnknownScript_0x180103
winlosstext UnknownText_0x180295, UnknownText_0x1802fd
setlasttalked $5
--- a/maps/KarensRoom.asm
+++ b/maps/KarensRoom.asm
@@ -24,11 +24,11 @@
; 0x180bc1
UnknownScript_0x180bc1: ; 0x180bc1
- checkbit1 $030f
+ checkbit1 EVENT_KARENS_ROOM_ENTRANCE_CLOSED
iffalse UnknownScript_0x180bcb
changeblock $4, $e, $2a
UnknownScript_0x180bcb: ; 0x180bcb
- checkbit1 $0310
+ checkbit1 EVENT_KARENS_ROOM_EXIT_OPEN
iffalse UnknownScript_0x180bd5
changeblock $4, $2, $16
UnknownScript_0x180bd5: ; 0x180bd5
@@ -44,7 +44,7 @@
reloadmappart
loadmovesprites
dotrigger $1
- setbit1 $030f
+ setbit1 EVENT_KARENS_ROOM_ENTRANCE_CLOSED
waitbutton
end
; 0x180bee
@@ -52,7 +52,7 @@
KarenScript_0x180bee: ; 0x180bee
faceplayer
loadfont
- checkbit1 $05bb
+ checkbit1 EVENT_BEAT_ELITE_4_KAREN
iftrue UnknownScript_0x180c1c
2writetext UnknownText_0x180c27
closetext
@@ -61,7 +61,7 @@
loadtrainer KAREN, 1
startbattle
returnafterbattle
- setbit1 $05bb
+ setbit1 EVENT_BEAT_ELITE_4_KAREN
loadfont
2writetext UnknownText_0x180d29
closetext
@@ -70,7 +70,7 @@
changeblock $4, $2, $16
reloadmappart
loadmovesprites
- setbit1 $0310
+ setbit1 EVENT_KARENS_ROOM_EXIT_OPEN
waitbutton
end
; 0x180c1c
--- a/maps/KogasRoom.asm
+++ b/maps/KogasRoom.asm
@@ -24,11 +24,11 @@
; 0x18072d
UnknownScript_0x18072d: ; 0x18072d
- checkbit1 $030b
+ checkbit1 EVENT_WILLS_ROOM_ENTRANCE_CLOSED
iffalse UnknownScript_0x180737
changeblock $4, $e, $2a
UnknownScript_0x180737: ; 0x180737
- checkbit1 $030c
+ checkbit1 EVENT_KOGAS_ROOM_EXIT_OPEN
iffalse UnknownScript_0x180741
changeblock $4, $2, $16
UnknownScript_0x180741: ; 0x180741
@@ -44,7 +44,7 @@
reloadmappart
loadmovesprites
dotrigger $1
- setbit1 $030b
+ setbit1 EVENT_WILLS_ROOM_ENTRANCE_CLOSED
waitbutton
end
; 0x18075a
@@ -70,7 +70,7 @@
changeblock $4, $2, $16
reloadmappart
loadmovesprites
- setbit1 $030c
+ setbit1 EVENT_KOGAS_ROOM_EXIT_OPEN
waitbutton
end
; 0x180788
--- a/maps/KrissHouse1F.asm
+++ b/maps/KrissHouse1F.asm
@@ -131,11 +131,11 @@
loadfont
checkbit1 $0076
iftrue UnknownScript_0x7a5af
- checkbit1 $0040
+ checkbit1 EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
iftrue UnknownScript_0x7a5b8
- checkbit1 $001f
+ checkbit1 EVENT_GAVE_MYSTERY_EGG_TO_ELM
iftrue UnknownScript_0x7a5b5
- checkbit1 $001a
+ checkbit1 EVENT_GOT_A_POKEMON_FROM_ELM
iftrue UnknownScript_0x7a5a9
2writetext UnknownText_0x7a8b5
closetext
@@ -160,7 +160,7 @@
UnknownScript_0x7a5b5: ; 0x7a5b5
setbit1 $0076
UnknownScript_0x7a5b8: ; 0x7a5b8
- setbit1 $0040
+ setbit1 EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
special $0022
closetext
loadmovesprites
--- a/maps/KrissHouse2F.asm
+++ b/maps/KrissHouse2F.asm
@@ -64,9 +64,9 @@
; 0x7abda
MapKrissHouse2FSignpost2Script: ; 0x7abda
- checkbit1 $001a
+ checkbit1 EVENT_GOT_A_POKEMON_FROM_ELM
iftrue UnknownScript_0x7ac07
- checkbit1 $0325
+ checkbit1 EVENT_LISTENED_TO_RADIO_IN_NEIGHBORS_HOUSE
iftrue UnknownScript_0x7ac0a
playmusic $001d
loadfont
@@ -80,7 +80,7 @@
2writetext UnknownText_0x7ac84
pause 45
loadmovesprites
- setbit1 $0325
+ setbit1 EVENT_LISTENED_TO_RADIO_IN_NEIGHBORS_HOUSE
end
; 0x7ac07
--- a/maps/KrissNeighborsHouse.asm
+++ b/maps/KrissNeighborsHouse.asm
@@ -19,9 +19,9 @@
; 0x7acf7
MapKrissNeighborsHouseSignpost2Script: ; 0x7acf7
- checkbit1 $001a
+ checkbit1 EVENT_GOT_A_POKEMON_FROM_ELM
iftrue UnknownScript_0x7ad24
- checkbit1 $0325
+ checkbit1 EVENT_LISTENED_TO_RADIO_IN_NEIGHBORS_HOUSE
iftrue UnknownScript_0x7ad27
playmusic $001d
loadfont
@@ -35,7 +35,7 @@
2writetext UnknownText_0x7ae9b
pause 45
loadmovesprites
- setbit1 $0325
+ setbit1 EVENT_LISTENED_TO_RADIO_IN_NEIGHBORS_HOUSE
end
; 0x7ad24
--- a/maps/KurtsHouse.asm
+++ b/maps/KurtsHouse.asm
@@ -11,7 +11,7 @@
; 0x18e154
UnknownScript_0x18e154: ; 0x18e154
- checkbit1 $002b
+ checkbit1 EVENT_CLEARED_SLOWPOKE_WELL
iffalse UnknownScript_0x18e177
checkbit1 $00c0
iftrue UnknownScript_0x18e177
@@ -38,7 +38,7 @@
loadfont
checkbit1 $0035
iftrue UnknownScript_0x18e1cc
- checkbit1 $002b
+ checkbit1 EVENT_CLEARED_SLOWPOKE_WELL
iftrue UnknownScript_0x18e1bf
2writetext UnknownText_0x18e473
closetext
@@ -91,7 +91,7 @@
iftrue UnknownScript_0x18e322
checkbit1 $025e
iftrue UnknownScript_0x18e338
- checkbit1 $00be
+ checkbit1 EVENT_CAN_GIVE_GS_BALL_TO_KURT
iftrue UnknownScript_0x18e34e
UnknownScript_0x18e202: ; 0x18e202
checkbit1 $0001
@@ -317,7 +317,7 @@
closetext
loadmovesprites
setbit1 $00c0
- clearbit1 $00be
+ clearbit1 EVENT_CAN_GIVE_GS_BALL_TO_KURT
clearbit1 $00bf
special $006a
pause 20
@@ -388,7 +388,7 @@
iftrue UnknownScript_0x18e420
checkbit1 $0030
iftrue UnknownScript_0x18e427
- checkbit1 $002b
+ checkbit1 EVENT_CLEARED_SLOWPOKE_WELL
iftrue UnknownScript_0x18e419
checkbit1 $06fa
iftrue UnknownScript_0x18e420
--- a/maps/LakeofRage.asm
+++ b/maps/LakeofRage.asm
@@ -42,7 +42,7 @@
; 0x70022
LanceScript_0x70022: ; 0x70022
- checkbit1 $0026
+ checkbit1 EVENT_REFUSED_TO_HELP_LANCE_AT_LAKE_OF_RAGE
iftrue UnknownScript_0x70057
loadfont
2writetext UnknownText_0x70157
@@ -59,7 +59,7 @@
applymovement $2, MovementData_0x70155
disappear $2
clearbit1 $06d5
- setbit1 $0060
+ setbit1 EVENT_DECIDED_TO_HELP_LANCE
domaptrigger GROUP_MAHOGANY_MART_1F, MAP_MAHOGANY_MART_1F, $1
end
; 0x7004e
@@ -68,7 +68,7 @@
2writetext UnknownText_0x70371
closetext
loadmovesprites
- setbit1 $0026
+ setbit1 EVENT_REFUSED_TO_HELP_LANCE_AT_LAKE_OF_RAGE
end
; 0x70057
@@ -110,7 +110,7 @@
GrampsScript_0x7008e: ; 0x7008e
faceplayer
loadfont
- checkbit1 $0022
+ checkbit1 EVENT_CLEARED_ROCKET_HIDEOUT
iftrue UnknownScript_0x7009c
2writetext UnknownText_0x703f8
closetext
@@ -140,7 +140,7 @@
MapLakeofRageSignpost1Script: ; 0x700ab
loadfont
2writetext UnknownText_0x70903
- checkbit1 $0022
+ checkbit1 EVENT_CLEARED_ROCKET_HIDEOUT
iftrue UnknownScript_0x700b8
closetext
loadmovesprites
@@ -273,21 +273,21 @@
SuperNerdScript_0x7010e: ; 0x7010e
faceplayer
loadfont
- checkbit1 $006b
+ checkbit1 EVENT_GOT_BLACKBELT_FROM_WESLEY
iftrue UnknownScript_0x7013c
checkcode $b
if_not_equal WEDNESDAY, UnknownScript_0x70142
- checkbit1 $006a
+ checkbit1 EVENT_MET_WESLEY_OF_WEDNESDAY
iftrue UnknownScript_0x70129
2writetext UnknownText_0x70784
keeptextopen
- setbit1 $006a
+ setbit1 EVENT_MET_WESLEY_OF_WEDNESDAY
UnknownScript_0x70129: ; 0x70129
2writetext UnknownText_0x707dd
keeptextopen
verbosegiveitem BLACKBELT, 1
iffalse UnknownScript_0x70140
- setbit1 $006b
+ setbit1 EVENT_GOT_BLACKBELT_FROM_WESLEY
2writetext UnknownText_0x7080b
closetext
loadmovesprites
--- a/maps/LakeofRageHiddenPowerHouse.asm
+++ b/maps/LakeofRageHiddenPowerHouse.asm
@@ -9,13 +9,13 @@
FisherScript_0x19a527: ; 0x19a527
faceplayer
loadfont
- checkbit1 $0058
+ checkbit1 EVENT_GOT_TM10_HIDDEN_POWER
iftrue UnknownScript_0x19a542
2writetext UnknownText_0x19a54b
keeptextopen
verbosegiveitem TM_10, 1
iffalse UnknownScript_0x19a546
- setbit1 $0058
+ setbit1 EVENT_GOT_TM10_HIDDEN_POWER
2writetext UnknownText_0x19a5de
closetext
loadmovesprites
--- a/maps/LakeofRageMagikarpHouse.asm
+++ b/maps/LakeofRageMagikarpHouse.asm
@@ -13,7 +13,7 @@
iftrue UnknownScript_0x19a6fe
checkbit1 $0039
iftrue UnknownScript_0x19a6e0
- checkbit1 $0022
+ checkbit1 EVENT_CLEARED_ROCKET_HIDEOUT
iftrue UnknownScript_0x19a6d7
checkbit1 $0038
iftrue UnknownScript_0x19a6d1
--- a/maps/LancesRoom.asm
+++ b/maps/LancesRoom.asm
@@ -24,7 +24,7 @@
; 0x180e3e
UnknownScript_0x180e3e: ; 0x180e3e
- checkbit1 $0311
+ checkbit1 EVENT_LANCES_ROOM_ENTRANCE_CLOSED
iffalse UnknownScript_0x180e48
changeblock $4, $16, $34
UnknownScript_0x180e48: ; 0x180e48
@@ -44,7 +44,7 @@
reloadmappart
loadmovesprites
dotrigger $1
- setbit1 $0311
+ setbit1 EVENT_LANCES_ROOM_ENTRANCE_CLOSED
end
; 0x180e6a
@@ -69,7 +69,7 @@
startbattle
reloadmapmusic
returnafterbattle
- setbit1 $05bc
+ setbit1 EVENT_BEAT_CHAMPION_LANCE
loadfont
2writetext UnknownText_0x181132
closetext
@@ -78,7 +78,7 @@
changeblock $4, $0, $b
reloadmappart
loadmovesprites
- setbit1 $0311
+ setbit1 EVENT_LANCES_ROOM_ENTRANCE_CLOSED
musicfadeout $0038, $10
pause 30
showemote $0, $2, 15
--- a/maps/LavRadioTower1F.asm
+++ b/maps/LavRadioTower1F.asm
@@ -23,7 +23,7 @@
loadfont
checkbit2 $0003
iftrue .UnknownScript_0x7ee8e
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue .UnknownScript_0x7ee80
2writetext UnknownText_0x7effb
closetext
--- a/maps/LavenderPokeCenter1F.asm
+++ b/maps/LavenderPokeCenter1F.asm
@@ -21,7 +21,7 @@
YoungsterScript_0x7e6a9: ; 0x7e6a9
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x7e6b7
2writetext UnknownText_0x7e779
closetext
--- a/maps/MahoganyGym.asm
+++ b/maps/MahoganyGym.asm
@@ -9,7 +9,7 @@
PryceScript_0x199a9e: ; 0x199a9e
faceplayer
loadfont
- checkbit1 $04c3
+ checkbit1 EVENT_BEAT_PRYCE
iftrue UnknownScript_0x199ac8
2writetext UnknownText_0x199b8d
closetext
@@ -18,7 +18,7 @@
loadtrainer PRYCE, 1
startbattle
returnafterbattle
- setbit1 $04c3
+ setbit1 EVENT_BEAT_PRYCE
loadfont
2writetext UnknownText_0x199d3b
playsound $009c
@@ -27,18 +27,18 @@
checkcode $7
2call UnknownScript_0x199af6
UnknownScript_0x199ac8: ; 0x199ac8
- checkbit1 $000e
+ checkbit1 EVENT_GOT_TM16_ICY_WIND
iftrue UnknownScript_0x199af0
- setbit1 $0592
- setbit1 $0593
- setbit1 $040e
- setbit1 $040f
- setbit1 $0410
+ setbit1 EVENT_BEAT_SKIER_ROXANNE
+ setbit1 EVENT_BEAT_SKIER_CLARISSA
+ setbit1 EVENT_BEAT_BOARDER_RONALD
+ setbit1 EVENT_BEAT_BOARDER_BRAD
+ setbit1 EVENT_BEAT_BOARDER_DOUGLAS
2writetext UnknownText_0x199d55
keeptextopen
verbosegiveitem TM_16, 1
iffalse UnknownScript_0x199af4
- setbit1 $000e
+ setbit1 EVENT_GOT_TM16_ICY_WIND
2writetext UnknownText_0x199def
closetext
loadmovesprites
@@ -215,7 +215,7 @@
MahoganyGymGuyScript: ; 0x199b69
faceplayer
loadfont
- checkbit1 $04c3
+ checkbit1 EVENT_BEAT_PRYCE
iftrue .MahoganyGymGuyWinScript
2writetext MahoganyGymGuyText
closetext
--- a/maps/MahoganyMart1F.asm
+++ b/maps/MahoganyMart1F.asm
@@ -24,7 +24,7 @@
; 0x6c35b
UnknownScript_0x6c35b: ; 0x6c35b
- checkbit1 $02e2
+ checkbit1 EVENT_UNCOVERED_STAIRCASE_IN_MAHOGANY_MART
iftrue UnknownScript_0x6c362
return
; 0x6c362
@@ -37,7 +37,7 @@
PharmacistScript_0x6c367: ; 0x6c367
faceplayer
loadfont
- checkbit1 $0060
+ checkbit1 EVENT_DECIDED_TO_HELP_LANCE
iftrue UnknownScript_0x6c375
pokemart $0, $000f
loadmovesprites
@@ -54,7 +54,7 @@
BlackBeltScript_0x6c37b: ; 0x6c37b
faceplayer
loadfont
- checkbit1 $0060
+ checkbit1 EVENT_DECIDED_TO_HELP_LANCE
iftrue UnknownScript_0x6c389
2writetext UnknownText_0x6c494
closetext
@@ -99,7 +99,7 @@
changeblock $6, $2, $1e
reloadmappart
loadmovesprites
- setbit1 $02e2
+ setbit1 EVENT_UNCOVERED_STAIRCASE_IN_MAHOGANY_MART
spriteface $4, $2
loadfont
2writetext UnknownText_0x6c5ba
--- a/maps/MahoganyTown.asm
+++ b/maps/MahoganyTown.asm
@@ -42,7 +42,7 @@
PokefanMScript_0x19002e: ; 0x19002e
faceplayer
UnknownScript_0x19002f: ; 0x19002f
- checkbit1 $0022
+ checkbit1 EVENT_CLEARED_ROCKET_HIDEOUT
iftrue UnknownScript_0x190039
2call UnknownScript_0x190040
end
@@ -100,7 +100,7 @@
GrampsScript_0x19007e: ; 0x19007e
faceplayer
loadfont
- checkbit1 $0022
+ checkbit1 EVENT_CLEARED_ROCKET_HIDEOUT
iftrue UnknownScript_0x19008c
2writetext UnknownText_0x1901e5
closetext
--- a/maps/ManiasHouse.asm
+++ b/maps/ManiasHouse.asm
@@ -9,9 +9,9 @@
RockerScript_0x9d278: ; 0x9d278
faceplayer
loadfont
- checkbit1 $0046
+ checkbit1 EVENT_MANIA_TOOK_SHUCKIE_OR_LET_YOU_KEEP_HIM
iftrue UnknownScript_0x9d2fa
- checkbit1 $0045
+ checkbit1 EVENT_GOT_SHUCKIE
iftrue UnknownScript_0x9d2a4
2writetext UnknownText_0x9d303
yesorno
@@ -25,7 +25,7 @@
playsound $0091
waitbutton
loadmovesprites
- setbit1 $0045
+ setbit1 EVENT_GOT_SHUCKIE
end
; 0x9d2a4
@@ -64,7 +64,7 @@
2writetext UnknownText_0x9d4b1
closetext
loadmovesprites
- setbit1 $0046
+ setbit1 EVENT_MANIA_TOOK_SHUCKIE_OR_LET_YOU_KEEP_HIM
end
; 0x9d2df
@@ -79,7 +79,7 @@
2writetext UnknownText_0x9d4e3
closetext
loadmovesprites
- setbit1 $0046
+ setbit1 EVENT_MANIA_TOOK_SHUCKIE_OR_LET_YOU_KEEP_HIM
end
; 0x9d2ee
--- a/maps/MountMoon.asm
+++ b/maps/MountMoon.asm
@@ -30,9 +30,9 @@
2writetext UnknownText_0x74105
closetext
loadmovesprites
- checkbit1 $001c
+ checkbit1 EVENT_GOT_TOTODILE_FROM_ELM
iftrue UnknownScript_0x740c3
- checkbit1 $001d
+ checkbit1 EVENT_GOT_CHIKORITA_FROM_ELM
iftrue UnknownScript_0x740d3
winlosstext UnknownText_0x7419d, UnknownText_0x742e0
setlasttalked $2
@@ -72,7 +72,7 @@
applymovement $2, MovementData_0x740fd
disappear $2
dotrigger $1
- setbit1 $0319
+ setbit1 EVENT_BEAT_RIVAL_IN_MT_MOON
playmapmusic
end
; 0x740f9
--- a/maps/MountMortarB1F.asm
+++ b/maps/MountMortarB1F.asm
@@ -9,7 +9,7 @@
BlackBeltScript_0x7e1f6: ; 0x7e1f6
faceplayer
loadfont
- checkbit1 $0061
+ checkbit1 EVENT_GOT_TYROGUE_FROM_KIYO
iftrue UnknownScript_0x7e231
checkbit1 $04a9
iftrue UnknownScript_0x7e217
@@ -32,7 +32,7 @@
playsound $0002
waitbutton
givepoke TYROGUE, 10, 0, 0
- setbit1 $0061
+ setbit1 EVENT_GOT_TYROGUE_FROM_KIYO
UnknownScript_0x7e231: ; 0x7e231
2writetext UnknownText_0x7e36a
closetext
--- a/maps/MrPokemonsHouse.asm
+++ b/maps/MrPokemonsHouse.asm
@@ -36,7 +36,7 @@
playsound $0091
waitbutton
itemnotify
- setbit1 $001e
+ setbit1 EVENT_GOT_MYSTERY_EGG_FROM_MR_POKEMON
blackoutmod GROUP_CHERRYGROVE_CITY, MAP_CHERRYGROVE_CITY
2writetext UnknownText_0x196feb
keeptextopen
@@ -56,7 +56,7 @@
loadfont
checkitem RED_SCALE
iftrue UnknownScript_0x196eb0
- checkbit1 $001f
+ checkbit1 EVENT_GAVE_MYSTERY_EGG_TO_ELM
iftrue UnknownScript_0x196eaa
2writetext UnknownText_0x197134
closetext
@@ -136,9 +136,9 @@
domaptrigger GROUP_ELMS_LAB, MAP_ELMS_LAB, $3
specialphonecall $2
clearbit1 $0702
- checkbit1 $001c
+ checkbit1 EVENT_GOT_TOTODILE_FROM_ELM
iftrue UnknownScript_0x196f49
- checkbit1 $001d
+ checkbit1 EVENT_GOT_CHIKORITA_FROM_ELM
iftrue UnknownScript_0x196f4d
setbit1 $0641
end
--- a/maps/MrPsychicsHouse.asm
+++ b/maps/MrPsychicsHouse.asm
@@ -9,13 +9,13 @@
FishingGuruScript_0x18a77a: ; 0x18a77a
faceplayer
loadfont
- checkbit1 $00e3
+ checkbit1 EVENT_GOT_TM29_PSYCHIC
iftrue UnknownScript_0x18a78f
2writetext UnknownText_0x18a798
keeptextopen
verbosegiveitem TM_29, 1
iffalse UnknownScript_0x18a793
- setbit1 $00e3
+ setbit1 EVENT_GOT_TM29_PSYCHIC
UnknownScript_0x18a78f: ; 0x18a78f
2writetext UnknownText_0x18a7bb
closetext
--- a/maps/NationalPark.asm
+++ b/maps/NationalPark.asm
@@ -17,13 +17,13 @@
TeacherScript_0x5c008: ; 0x5c008
faceplayer
loadfont
- checkbit1 $0057
+ checkbit1 EVENT_GOT_QUICK_CLAW
iftrue UnknownScript_0x5c01d
2writetext UnknownText_0x5c265
keeptextopen
verbosegiveitem QUICK_CLAW, 1
iffalse UnknownScript_0x5c021
- setbit1 $0057
+ setbit1 EVENT_GOT_QUICK_CLAW
UnknownScript_0x5c01d: ; 0x5c01d
2writetext UnknownText_0x5c30d
closetext
@@ -122,13 +122,13 @@
if_equal $1, UnknownScript_0x5c0b9
if_equal $0, UnknownScript_0x5c0bf
UnknownScript_0x5c0a7: ; 0x5c0a7
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x5c0f3
UnknownScript_0x5c0ad: ; 0x5c0ad
checkbit1 $0044
iftrue UnknownScript_0x5c0e6
UnknownScript_0x5c0b3: ; 0x5c0b3
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x5c0d9
UnknownScript_0x5c0b9: ; 0x5c0b9
checkbit2 $0047
@@ -271,11 +271,11 @@
iftrue UnknownScript_0x5c19b
checkpoke MARILL
iffalse UnknownScript_0x5c189
- checkbit1 $0261
+ checkbit1 EVENT_SHOWED_BEVERLY_MARILL
iftrue UnknownScript_0x5c160
2writetext UnknownText_0x5c5bd
keeptextopen
- setbit1 $0261
+ setbit1 EVENT_SHOWED_BEVERLY_MARILL
2call UnknownScript_0x5c18f
2jump UnknownScript_0x5c163
; 0x5c160
--- a/maps/NewBarkTown.asm
+++ b/maps/NewBarkTown.asm
@@ -80,11 +80,11 @@
TeacherScript_0x1a806f: ; 0x1a806f
faceplayer
loadfont
- checkbit1 $0040
+ checkbit1 EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
iftrue UnknownScript_0x1a8095
- checkbit1 $001f
+ checkbit1 EVENT_GAVE_MYSTERY_EGG_TO_ELM
iftrue UnknownScript_0x1a808f
- checkbit1 $001a
+ checkbit1 EVENT_GOT_A_POKEMON_FROM_ELM
iftrue UnknownScript_0x1a8089
2writetext UnknownText_0x1a80f7
closetext
--- a/maps/OlivineCafe.asm
+++ b/maps/OlivineCafe.asm
@@ -9,12 +9,12 @@
SailorScript_0x9c8c1: ; 0x9c8c1
faceplayer
loadfont
- checkbit1 $0013
+ checkbit1 EVENT_GOT_HM04_STRENGTH
iftrue UnknownScript_0x9c8d3
2writetext UnknownText_0x9c8df
keeptextopen
verbosegiveitem HM_04, 1
- setbit1 $0013
+ setbit1 EVENT_GOT_HM04_STRENGTH
UnknownScript_0x9c8d3: ; 0x9c8d3
2writetext UnknownText_0x9c965
closetext
--- a/maps/OlivineGoodRodHouse.asm
+++ b/maps/OlivineGoodRodHouse.asm
@@ -9,7 +9,7 @@
FishingGuruScript_0x9c71b: ; 0x9c71b
faceplayer
loadfont
- checkbit1 $0018
+ checkbit1 EVENT_GOT_GOOD_ROD
iftrue UnknownScript_0x9c740
2writetext UnknownText_0x9c749
yesorno
@@ -20,7 +20,7 @@
2writetext UnknownText_0x9c807
closetext
loadmovesprites
- setbit1 $0018
+ setbit1 EVENT_GOT_GOOD_ROD
end
; 0x9c73a
--- a/maps/OlivineGym.asm
+++ b/maps/OlivineGym.asm
@@ -9,7 +9,7 @@
JasmineScript_0x9c12f: ; 0x9c12f
faceplayer
loadfont
- checkbit1 $04c1
+ checkbit1 EVENT_BEAT_JASMINE
iftrue UnknownScript_0x9c159
2writetext UnknownText_0x9c1b9
closetext
@@ -18,7 +18,7 @@
loadtrainer JASMINE, 1
startbattle
returnafterbattle
- setbit1 $04c1
+ setbit1 EVENT_BEAT_JASMINE
loadfont
2writetext UnknownText_0x9c33a
playsound $009c
@@ -27,13 +27,13 @@
checkcode $7
2call UnknownScript_0x9c178
UnknownScript_0x9c159: ; 0x9c159
- checkbit1 $000d
+ checkbit1 EVENT_GOT_TM23_IRON_TAIL
iftrue UnknownScript_0x9c172
2writetext UnknownText_0x9c354
keeptextopen
verbosegiveitem TM_23, 1
iffalse UnknownScript_0x9c176
- setbit1 $000d
+ setbit1 EVENT_GOT_TM23_IRON_TAIL
2writetext UnknownText_0x9c3a5
closetext
loadmovesprites
@@ -64,9 +64,9 @@
OlivineGymGuyScript: ; 0x9c187
faceplayer
- checkbit1 $04c1
+ checkbit1 EVENT_BEAT_JASMINE
iftrue .OlivineGymGuyWinScript
- checkbit1 $0020
+ checkbit1 EVENT_JASMINE_RETURNED_TO_GYM
iffalse .OlivineGymGuyPreScript
loadfont
2writetext OlivineGymGuyText
--- a/maps/OlivineLighthouse2F.asm
+++ b/maps/OlivineLighthouse2F.asm
@@ -90,13 +90,13 @@
if_equal $1, UnknownScript_0x5afee
if_equal $0, UnknownScript_0x5aff4
UnknownScript_0x5afe2: ; 0x5afe2
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x5b01b
UnknownScript_0x5afe8: ; 0x5afe8
checkbit1 $0044
iftrue UnknownScript_0x5b00e
UnknownScript_0x5afee: ; 0x5afee
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x5b001
UnknownScript_0x5aff4: ; 0x5aff4
loadtrainer SAILOR, HUEY1
@@ -130,7 +130,7 @@
startbattle
returnafterbattle
clearbit2 $0066
- checkbit1 $0337
+ checkbit1 EVENT_HUEY_PROTEIN
iftrue UnknownScript_0x5b03f
checkbit1 $0265
iftrue UnknownScript_0x5b03e
@@ -151,7 +151,7 @@
closetext
verbosegiveitem PROTEIN, 1
iffalse UnknownScript_0x5b06f
- clearbit1 $0337
+ clearbit1 EVENT_HUEY_PROTEIN
setbit1 $0265
2jump UnknownScript_0x5b05f
; 0x5b053
@@ -192,7 +192,7 @@
; 0x5b06f
UnknownScript_0x5b06f: ; 0x5b06f
- setbit1 $0337
+ setbit1 EVENT_HUEY_PROTEIN
jumpstd $0021
end
; 0x5b076
--- a/maps/OlivineLighthouse6F.asm
+++ b/maps/OlivineLighthouse6F.asm
@@ -64,7 +64,7 @@
2writetext UnknownText_0x60e6c
closetext
loadmovesprites
- setbit1 $0020
+ setbit1 EVENT_JASMINE_RETURNED_TO_GYM
clearbit1 $06d3
checkcode $9
if_equal $0, UnknownScript_0x60c17
@@ -107,7 +107,7 @@
MonsterScript_0x60c3a: ; 0x60c3a
faceplayer
loadfont
- checkbit1 $0020
+ checkbit1 EVENT_JASMINE_RETURNED_TO_GYM
iftrue UnknownScript_0x60c51
2writetext UnknownText_0x60f03
writebyte AMPHAROS
--- a/maps/OlivinePort.asm
+++ b/maps/OlivinePort.asm
@@ -49,15 +49,15 @@
iffalse UnknownScript_0x7490a
clearbit1 $073a
setbit1 $073b
- clearbit1 $0557
- clearbit1 $0567
- clearbit1 $049b
- clearbit1 $04b2
- clearbit1 $0445
- clearbit1 $0589
- clearbit1 $057b
- clearbit1 $0459
- clearbit1 $04ac
+ clearbit1 EVENT_BEAT_COOLTRAINERM_SEAN
+ clearbit1 EVENT_BEAT_COOLTRAINERF_CAROL
+ clearbit1 EVENT_BEAT_GENTLEMAN_EDWARD
+ clearbit1 EVENT_BEAT_BEAUTY_CASSIE
+ clearbit1 EVENT_BEAT_PSYCHIC_RODNEY
+ clearbit1 EVENT_BEAT_SUPER_NERD_SHAWN
+ clearbit1 EVENT_BEAT_SAILOR_GARRETT
+ clearbit1 EVENT_BEAT_FISHER_JONAH
+ clearbit1 EVENT_BEAT_BLACKBELT_WAI
UnknownScript_0x7490a: ; 0x7490a
clearbit1 $002f
appear $2
--- a/maps/PewterCity.asm
+++ b/maps/PewterCity.asm
@@ -26,12 +26,12 @@
GrampsScript_0x18c00f: ; 0x18c00f
faceplayer
loadfont
- checkbit1 $0079
+ checkbit1 EVENT_GOT_SILVER_WING
iftrue UnknownScript_0x18c023
2writetext UnknownText_0x18c0c6
keeptextopen
verbosegiveitem SILVER_WING, 1
- setbit1 $0079
+ setbit1 EVENT_GOT_SILVER_WING
loadmovesprites
end
; 0x18c023
--- a/maps/PewterGym.asm
+++ b/maps/PewterGym.asm
@@ -18,8 +18,8 @@
loadtrainer BROCK, 1
startbattle
returnafterbattle
- setbit1 $04c5
- setbit1 $042b
+ setbit1 EVENT_BEAT_BROCK
+ setbit1 EVENT_BEAT_CAMPER_JERRY
loadfont
2writetext UnknownText_0x1a2a3d
playsound $009c
@@ -70,7 +70,7 @@
PewterGymGuyScript: ; 0x1a28ac
faceplayer
loadfont
- checkbit1 $04c5
+ checkbit1 EVENT_BEAT_BROCK
iftrue .PewterGymGuyWinScript
2writetext PewterGymGuyText
closetext
--- a/maps/PokeCenter2F.asm
+++ b/maps/PokeCenter2F.asm
@@ -77,7 +77,7 @@
; 0x19289d
LinkReceptionistScript_0x19289d: ; 0x19289d
- checkbit1 $001f
+ checkbit1 EVENT_GAVE_MYSTERY_EGG_TO_ELM
iffalse UnknownScript_0x19288d
loadfont
2writetext UnknownText_0x192e3a
@@ -190,7 +190,7 @@
; 0x192952
LinkReceptionistScript_0x192952: ; 0x192952
- checkbit1 $001f
+ checkbit1 EVENT_GAVE_MYSTERY_EGG_TO_ELM
iffalse UnknownScript_0x192895
loadfont
2writetext UnknownText_0x192de0
--- a/maps/PokemonFanClub.asm
+++ b/maps/PokemonFanClub.asm
@@ -9,9 +9,9 @@
GentlemanScript_0x1917e9: ; 0x1917e9
faceplayer
loadfont
- checkbit1 $00d4
+ checkbit1 EVENT_LISTENED_TO_FAN_CLUB_PRESIDENT
iftrue UnknownScript_0x191815
- checkbit1 $00d3
+ checkbit1 EVENT_LISTENED_TO_FAN_CLUB_PRESIDENT_BUT_BAG_WAS_FULL
iftrue UnknownScript_0x191802
2writetext UnknownText_0x191881
yesorno
@@ -23,7 +23,7 @@
keeptextopen
verbosegiveitem RARE_CANDY, 1
iffalse UnknownScript_0x19181f
- setbit1 $00d4
+ setbit1 EVENT_LISTENED_TO_FAN_CLUB_PRESIDENT
2writetext UnknownText_0x191a72
closetext
loadmovesprites
@@ -52,9 +52,9 @@
FisherScript_0x191824: ; 0x191824
faceplayer
loadfont
- checkbit1 $00d2
+ checkbit1 EVENT_GOT_LOST_ITEM_FROM_FAN_CLUB
iftrue UnknownScript_0x19185f
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x191838
2writetext UnknownText_0x191ba0
closetext
@@ -64,7 +64,7 @@
UnknownScript_0x191838: ; 0x191838
2writetext UnknownText_0x191bff
- checkbit1 $00cf
+ checkbit1 EVENT_MET_COPYCAT_FOUND_OUT_ABOUT_LOST_ITEM
iftrue UnknownScript_0x191844
closetext
loadmovesprites
@@ -83,7 +83,7 @@
playsound $0091
waitbutton
itemnotify
- setbit1 $00d2
+ setbit1 EVENT_GOT_LOST_ITEM_FROM_FAN_CLUB
loadmovesprites
end
; 0x19185f
--- a/maps/PowerPlant.asm
+++ b/maps/PowerPlant.asm
@@ -45,9 +45,9 @@
OfficerScript_0x188df5: ; 0x188df5
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x188e0f
- checkbit1 $00ca
+ checkbit1 EVENT_MET_MANAGER_AT_POWER_PLANT
iftrue UnknownScript_0x188e09
2writetext UnknownText_0x188ee0
closetext
@@ -72,7 +72,7 @@
GymGuyScript_0x188e15: ; 0x188e15
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x188e23
2writetext UnknownText_0x188fcf
closetext
@@ -90,7 +90,7 @@
GymGuyScript_0x188e29: ; 0x188e29
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x188e37
2writetext UnknownText_0x189079
closetext
@@ -108,7 +108,7 @@
OfficerScript_0x188e3d: ; 0x188e3d
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x188e4b
2writetext UnknownText_0x18910e
closetext
@@ -126,7 +126,7 @@
GymGuyScript_0x188e51: ; 0x188e51
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x188e5f
2writetext UnknownText_0x1891c2
closetext
@@ -144,18 +144,18 @@
FisherScript_0x188e65: ; 0x188e65
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x188eac
checkitem MACHINE_PART
iftrue UnknownScript_0x188e93
- checkbit1 $00ca
+ checkbit1 EVENT_MET_MANAGER_AT_POWER_PLANT
iftrue UnknownScript_0x188e8d
2writetext UnknownText_0x189264
closetext
loadmovesprites
- setbit1 $00ca
+ setbit1 EVENT_MET_MANAGER_AT_POWER_PLANT
clearbit1 $076d
- clearbit1 $00fb
+ clearbit1 EVENT_FOUND_MACHINE_PART_IN_CERULEAN_GYM
domaptrigger GROUP_CERULEAN_GYM, MAP_CERULEAN_GYM, $1
dotrigger $1
end
@@ -172,20 +172,20 @@
2writetext UnknownText_0x18936e
keeptextopen
takeitem MACHINE_PART, 1
- setbit1 $00c9
+ setbit1 EVENT_RETURNED_MACHINE_PART
clearbit1 $0772
setbit1 $0771
setbit1 $076c
- setbit1 $00cd
+ setbit1 EVENT_RESTORED_POWER_TO_KANTO
clearbit1 $0749
UnknownScript_0x188eac: ; 0x188eac
- checkbit1 $00df
+ checkbit1 EVENT_GOT_TM07_ZAP_CANNON
iftrue UnknownScript_0x188ec5
2writetext UnknownText_0x1893c4
keeptextopen
verbosegiveitem TM_07, 1
iffalse UnknownScript_0x188ec3
- setbit1 $00df
+ setbit1 EVENT_GOT_TM07_ZAP_CANNON
2writetext UnknownText_0x1893f4
closetext
UnknownScript_0x188ec3: ; 0x188ec3
--- a/maps/RadioTower2F.asm
+++ b/maps/RadioTower2F.asm
@@ -170,7 +170,7 @@
loadfont
checkbit2 $0013
iftrue UnknownScript_0x5d865
- checkbit1 $033d
+ checkbit1 EVENT_MET_BUENA
iffalse UnknownScript_0x5d800
checkbit2 $0060
iftrue UnknownScript_0x5d82f
@@ -231,7 +231,7 @@
UnknownScript_0x5d800: ; 0x5d800
2writetext UnknownText_0x5dcf4
keeptextopen
- setbit1 $033d
+ setbit1 EVENT_MET_BUENA
verbosegiveitem BLUE_CARD, 1
UnknownScript_0x5d80a: ; 0x5d80a
2writetext UnknownText_0x5de10
@@ -239,7 +239,7 @@
loadmovesprites
checkcellnum $25
iftrue UnknownScript_0x5d81a
- checkbit1 $033c
+ checkbit1 EVENT_BUENA_OFFERED_HER_PHONE_NUMBER
iftrue UnknownScript_0x5d8cc
UnknownScript_0x5d81a: ; 0x5d81a
spriteface $b, $3
@@ -263,7 +263,7 @@
loadmovesprites
checkcellnum $25
iftrue UnknownScript_0x5d83f
- checkbit1 $033c
+ checkbit1 EVENT_BUENA_OFFERED_HER_PHONE_NUMBER
iftrue UnknownScript_0x5d8cc
UnknownScript_0x5d83f: ; 0x5d83f
spriteface $b, $3
@@ -303,7 +303,7 @@
loadmovesprites
checkcellnum $25
iftrue UnknownScript_0x5d87b
- checkbit1 $029e
+ checkbit1 EVENT_BUENA_OFFERED_HER_PHONE_NUMBER_NO_BLUE_CARD
iftrue UnknownScript_0x5d8cc
UnknownScript_0x5d87b: ; 0x5d87b
spriteface $b, $3
@@ -316,7 +316,7 @@
loadmovesprites
checkcellnum $25
iftrue UnknownScript_0x5d88f
- checkbit1 $029e
+ checkbit1 EVENT_BUENA_OFFERED_HER_PHONE_NUMBER_NO_BLUE_CARD
iftrue UnknownScript_0x5d8cc
UnknownScript_0x5d88f: ; 0x5d88f
spriteface $b, $3
@@ -329,7 +329,7 @@
loadmovesprites
checkcellnum $25
iftrue UnknownScript_0x5d8a3
- checkbit1 $033c
+ checkbit1 EVENT_BUENA_OFFERED_HER_PHONE_NUMBER
iftrue UnknownScript_0x5d8cc
UnknownScript_0x5d8a3: ; 0x5d8a3
end
@@ -343,11 +343,11 @@
pause 15
spriteface $0, $1
pause 15
- checkbit1 $029e
+ checkbit1 EVENT_BUENA_OFFERED_HER_PHONE_NUMBER_NO_BLUE_CARD
iftrue UnknownScript_0x5d8cc
showemote $0, $b, 15
- setbit1 $029e
- setbit1 $033c
+ setbit1 EVENT_BUENA_OFFERED_HER_PHONE_NUMBER_NO_BLUE_CARD
+ setbit1 EVENT_BUENA_OFFERED_HER_PHONE_NUMBER
loadfont
2writetext UnknownText_0x5e1ee
2jump UnknownScript_0x5d8d0
--- a/maps/RadioTower3F.asm
+++ b/maps/RadioTower3F.asm
@@ -11,7 +11,7 @@
; 0x5e543
UnknownScript_0x5e543: ; 0x5e543
- checkbit1 $0025
+ checkbit1 EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER
iftrue UnknownScript_0x5e54a
return
; 0x5e54a
@@ -29,7 +29,7 @@
GymGuyScript_0x5e556: ; 0x5e556
faceplayer
loadfont
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x5e564
2writetext UnknownText_0x5e682
closetext
@@ -47,11 +47,11 @@
CooltrainerFScript_0x5e56a: ; 0x5e56a
faceplayer
loadfont
- checkbit1 $0047
+ checkbit1 EVENT_GOT_SUNNY_DAY_FROM_RADIO_TOWER
iftrue UnknownScript_0x5e59d
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x5e58a
- checkbit1 $0025
+ checkbit1 EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER
iftrue UnknownScript_0x5e584
2writetext UnknownText_0x5e754
closetext
@@ -74,7 +74,7 @@
2writetext UnknownText_0x5e821
closetext
loadmovesprites
- setbit1 $0047
+ setbit1 EVENT_GOT_SUNNY_DAY_FROM_RADIO_TOWER
end
; 0x5e59d
@@ -206,7 +206,7 @@
loadfont
2writetext UnknownText_0x5eaa4
closetext
- checkbit1 $0025
+ checkbit1 EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER
iftrue UnknownScript_0x5e603
checkitem CARD_KEY
iftrue UnknownScript_0x5e605
@@ -218,7 +218,7 @@
UnknownScript_0x5e605: ; 0x5e605
2writetext UnknownText_0x5eabc
closetext
- setbit1 $0025
+ setbit1 EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER
playsound $001f
changeblock $e, $2, $2a
changeblock $e, $4, $1
--- a/maps/RadioTower4F.asm
+++ b/maps/RadioTower4F.asm
@@ -13,9 +13,9 @@
TeacherScript_0x5eb85: ; 0x5eb85
faceplayer
loadfont
- checkbit1 $0048
+ checkbit1 EVENT_GOT_PINK_BOW_FROM_MARY
iftrue UnknownScript_0x5ebac
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x5eb99
2writetext UnknownText_0x5ec68
closetext
@@ -31,7 +31,7 @@
2writetext UnknownText_0x5ecef
closetext
loadmovesprites
- setbit1 $0048
+ setbit1 EVENT_GOT_PINK_BOW_FROM_MARY
end
; 0x5ebac
--- a/maps/RadioTower5F.asm
+++ b/maps/RadioTower5F.asm
@@ -54,7 +54,7 @@
GentlemanScript_0x60046: ; 0x60046
faceplayer
loadfont
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x60054
2writetext UnknownText_0x60246
closetext
@@ -122,7 +122,7 @@
pause 15
special $0032
setbit1 $0571
- setbit1 $0021
+ setbit1 EVENT_CLEARED_RADIO_TOWER
clearbit2 $0013
setbit1 $06cc
setbit1 $06cd
@@ -148,7 +148,7 @@
loadmovesprites
dotrigger $2
domaptrigger GROUP_ECRUTEAK_HOUSE, MAP_ECRUTEAK_HOUSE, $0
- setbit1 $0078
+ setbit1 EVENT_GOT_CLEAR_BELL
setbit1 $0761
2jump UnknownScript_0x600f1
; 0x600f1
--- a/maps/RedsHouse1F.asm
+++ b/maps/RedsHouse1F.asm
@@ -16,12 +16,12 @@
RedsMomScript_0x19aea3: ; 0x19aea3
faceplayer
loadfont
- checkbit1 $00cc
+ checkbit1 EVENT_MET_REDS_MOM
iftrue UnknownScript_0x19aeb4
2writetext UnknownText_0x19aec0
closetext
loadmovesprites
- setbit1 $00cc
+ setbit1 EVENT_MET_REDS_MOM
end
; 0x19aeb4
--- a/maps/Route10PokeCenter1F.asm
+++ b/maps/Route10PokeCenter1F.asm
@@ -17,7 +17,7 @@
GymGuyScript_0x188bda: ; 0x188bda
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x188be8
2writetext UnknownText_0x188c26
closetext
--- a/maps/Route12SuperRodHouse.asm
+++ b/maps/Route12SuperRodHouse.asm
@@ -9,7 +9,7 @@
FishingGuruScript_0x7f484: ; 0x7f484
faceplayer
loadfont
- checkbit1 $0019
+ checkbit1 EVENT_GOT_SUPER_ROD
iftrue UnknownScript_0x7f4a0
2writetext UnknownText_0x7f4af
yesorno
@@ -18,7 +18,7 @@
keeptextopen
verbosegiveitem SUPER_ROD, 1
iffalse UnknownScript_0x7f4aa
- setbit1 $0019
+ setbit1 EVENT_GOT_SUPER_ROD
UnknownScript_0x7f4a0: ; 0x7f4a0
2writetext UnknownText_0x7f57c
closetext
--- a/maps/Route25.asm
+++ b/maps/Route25.asm
@@ -280,13 +280,13 @@
loadfont
checkbit1 $0558
iftrue UnknownScript_0x19efda
- checkbit1 $00d8
+ checkbit1 EVENT_CLEARED_NUGGET_BRIDGE
iftrue UnknownScript_0x19efc7
2writetext UnknownText_0x19f43b
keeptextopen
verbosegiveitem NUGGET, 1
iffalse UnknownScript_0x19efde
- setbit1 $00d8
+ setbit1 EVENT_CLEARED_NUGGET_BRIDGE
UnknownScript_0x19efc7: ; 0x19efc7
2writetext UnknownText_0x19f49d
closetext
--- a/maps/Route26.asm
+++ b/maps/Route26.asm
@@ -91,7 +91,7 @@
if_equal $1, UnknownScript_0x1a4d96
if_equal $0, UnknownScript_0x1a4d9c
UnknownScript_0x1a4d90: ; 0x1a4d90
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x1a4db6
UnknownScript_0x1a4d96: ; 0x1a4d96
checkbit1 $0044
@@ -242,7 +242,7 @@
if_equal $1, UnknownScript_0x1a4e52
if_equal $0, UnknownScript_0x1a4e58
UnknownScript_0x1a4e4c: ; 0x1a4e4c
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x1a4e72
UnknownScript_0x1a4e52: ; 0x1a4e52
checkbit1 $0044
--- a/maps/Route27.asm
+++ b/maps/Route27.asm
@@ -132,7 +132,7 @@
if_equal $1, UnknownScript_0x1a091c
if_equal $0, UnknownScript_0x1a0922
UnknownScript_0x1a0916: ; 0x1a0916
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x1a093c
UnknownScript_0x1a091c: ; 0x1a091c
checkbit1 $0044
@@ -334,7 +334,7 @@
if_equal $1, UnknownScript_0x1a0a06
if_equal $0, UnknownScript_0x1a0a0c
UnknownScript_0x1a0a00: ; 0x1a0a00
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x1a0a26
UnknownScript_0x1a0a06: ; 0x1a0a06
checkbit1 $0044
--- a/maps/Route27SandstormHouse.asm
+++ b/maps/Route27SandstormHouse.asm
@@ -9,7 +9,7 @@
GrannyScript_0x7b394: ; 0x7b394
faceplayer
loadfont
- checkbit1 $0075
+ checkbit1 EVENT_GOT_TM37_SANDSTORM
iftrue UnknownScript_0x7b3b7
special $0059
2writetext UnknownText_0x7b3c6
@@ -23,7 +23,7 @@
keeptextopen
verbosegiveitem TM_37, 1
iffalse UnknownScript_0x7b3bb
- setbit1 $0075
+ setbit1 EVENT_GOT_TM37_SANDSTORM
UnknownScript_0x7b3b7: ; 0x7b3b7
2writetext UnknownText_0x7b48f
closetext
--- a/maps/Route28FamousSpeechHouse.asm
+++ b/maps/Route28FamousSpeechHouse.asm
@@ -16,13 +16,13 @@
CooltrainerFScript_0x1ae658: ; 0x1ae658
faceplayer
loadfont
- checkbit1 $0074
+ checkbit1 EVENT_GOT_TM47_STEEL_WING
iftrue UnknownScript_0x1ae66f
2writetext UnknownText_0x1ae682
keeptextopen
verbosegiveitem TM_47, 1
iffalse UnknownScript_0x1ae66d
- setbit1 $0074
+ setbit1 EVENT_GOT_TM47_STEEL_WING
UnknownScript_0x1ae66d: ; 0x1ae66d
loadmovesprites
end
--- a/maps/Route29.asm
+++ b/maps/Route29.asm
@@ -42,7 +42,7 @@
showemote $0, $2, 15
applymovement $2, MovementData_0x1a108d
spriteface $0, $2
- setbit1 $0041
+ setbit1 EVENT_DUDE_TALKED_TO_YOU
loadfont
2writetext UnknownText_0x1a10df
yesorno
@@ -59,7 +59,7 @@
closetext
loadmovesprites
dotrigger $0
- setbit1 $0042
+ setbit1 EVENT_LEARNED_TO_CATCH_POKEMON
end
; 0x1a0fa3
@@ -68,7 +68,7 @@
showemote $0, $2, 15
applymovement $2, MovementData_0x1a1094
spriteface $0, $2
- setbit1 $0041
+ setbit1 EVENT_DUDE_TALKED_TO_YOU
loadfont
2writetext UnknownText_0x1a10df
yesorno
@@ -85,7 +85,7 @@
closetext
loadmovesprites
dotrigger $0
- setbit1 $0042
+ setbit1 EVENT_LEARNED_TO_CATCH_POKEMON
end
; 0x1a0fd9
@@ -112,9 +112,9 @@
loadfont
checkcode $10
if_equal $0, UnknownScript_0x1a101c
- checkbit1 $0042
+ checkbit1 EVENT_LEARNED_TO_CATCH_POKEMON
iftrue UnknownScript_0x1a101c
- checkbit1 $001f
+ checkbit1 EVENT_GAVE_MYSTERY_EGG_TO_ELM
iffalse UnknownScript_0x1a101c
2writetext UnknownText_0x1a11e3
yesorno
@@ -126,7 +126,7 @@
2writetext UnknownText_0x1a114d
closetext
loadmovesprites
- setbit1 $0042
+ setbit1 EVENT_LEARNED_TO_CATCH_POKEMON
end
; 0x1a101c
@@ -180,21 +180,21 @@
TeacherScript_0x1a1049: ; 0x1a1049
faceplayer
loadfont
- checkbit1 $0065
+ checkbit1 EVENT_GOT_PINK_BOW_FROM_TUSCANY
iftrue UnknownScript_0x1a1077
checkcode $b
if_not_equal TUESDAY, UnknownScript_0x1a107d
- checkbit1 $0064
+ checkbit1 EVENT_MET_TUSCANY_OF_TUESDAY
iftrue UnknownScript_0x1a1064
2writetext UnknownText_0x1a13b2
keeptextopen
- setbit1 $0064
+ setbit1 EVENT_MET_TUSCANY_OF_TUESDAY
UnknownScript_0x1a1064: ; 0x1a1064
2writetext UnknownText_0x1a142f
keeptextopen
verbosegiveitem PINK_BOW, 1
iffalse UnknownScript_0x1a107b
- setbit1 $0065
+ setbit1 EVENT_GOT_PINK_BOW_FROM_TUSCANY
2writetext UnknownText_0x1a146f
closetext
loadmovesprites
--- a/maps/Route30.asm
+++ b/maps/Route30.asm
@@ -88,7 +88,7 @@
checkbit1 $0044
iftrue UnknownScript_0x1a174b
UnknownScript_0x1a1705: ; 0x1a1705
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x1a173e
UnknownScript_0x1a170b: ; 0x1a170b
checkbit2 $0047
@@ -137,7 +137,7 @@
startbattle
returnafterbattle
clearbit2 $006b
- checkbit1 $0338
+ checkbit1 EVENT_JOEY_HP_UP
iftrue UnknownScript_0x1a176f
checkbit1 $0266
iftrue UnknownScript_0x1a176e
@@ -158,7 +158,7 @@
closetext
verbosegiveitem HP_UP, 1
iffalse UnknownScript_0x1a179f
- clearbit1 $0338
+ clearbit1 EVENT_JOEY_HP_UP
setbit1 $0266
2jump UnknownScript_0x1a178f
; 0x1a1783
@@ -199,7 +199,7 @@
; 0x1a179f
UnknownScript_0x1a179f: ; 0x1a179f
- setbit1 $0338
+ setbit1 EVENT_JOEY_HP_UP
jumpstd $0021
end
; 0x1a17a6
@@ -270,7 +270,7 @@
YoungsterScript_0x1a17d2: ; 0x1a17d2
faceplayer
loadfont
- checkbit1 $001f
+ checkbit1 EVENT_GAVE_MYSTERY_EGG_TO_ELM
iftrue UnknownScript_0x1a17e0
2writetext UnknownText_0x1a1a6a
closetext
--- a/maps/Route30BerrySpeechHouse.asm
+++ b/maps/Route30BerrySpeechHouse.asm
@@ -9,13 +9,13 @@
PokefanMScript_0x196d64: ; 0x196d64
faceplayer
loadfont
- checkbit1 $0027
+ checkbit1 EVENT_GOT_BERRY_FROM_ROUTE_30_HOUSE
iftrue UnknownScript_0x196d79
2writetext UnknownText_0x196d82
keeptextopen
verbosegiveitem BERRY, 1
iffalse UnknownScript_0x196d7d
- setbit1 $0027
+ setbit1 EVENT_GOT_BERRY_FROM_ROUTE_30_HOUSE
UnknownScript_0x196d79: ; 0x196d79
2writetext UnknownText_0x196dec
closetext
--- a/maps/Route31.asm
+++ b/maps/Route31.asm
@@ -11,7 +11,7 @@
; 0x1a543c
UnknownScript_0x1a543c: ; 0x1a543c
- checkbit1 $0040
+ checkbit1 EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
iffalse UnknownScript_0x1a5443
return
; 0x1a5443
@@ -84,7 +84,7 @@
checkbit1 $0044
iftrue UnknownScript_0x1a54fe
UnknownScript_0x1a54b8: ; 0x1a54b8
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x1a54f1
UnknownScript_0x1a54be: ; 0x1a54be
checkbit2 $0049
@@ -138,13 +138,13 @@
UnknownScript_0x1a5507: ; 0x1a5507
2call UnknownScript_0x1a5568
- checkbit1 $032b
+ checkbit1 EVENT_WADE_HAS_BERRY
iftrue UnknownScript_0x1a5522
- checkbit1 $032c
+ checkbit1 EVENT_WADE_HAS_PSNCUREBERRY
iftrue UnknownScript_0x1a552b
- checkbit1 $032d
+ checkbit1 EVENT_WADE_HAS_PRZCUREBERRY
iftrue UnknownScript_0x1a5534
- checkbit1 $032e
+ checkbit1 EVENT_WADE_HAS_BITTER_BERRY
iftrue UnknownScript_0x1a553d
UnknownScript_0x1a5522: ; 0x1a5522
verbosegiveitem BERRY, 1
@@ -224,9 +224,9 @@
FisherScript_0x1a5570: ; 0x1a5570
faceplayer
loadfont
- checkbit1 $0053
+ checkbit1 EVENT_GOT_TM50_NIGHTMARE
iftrue UnknownScript_0x1a55af
- checkbit1 $0050
+ checkbit1 EVENT_GOT_KENYA
iftrue UnknownScript_0x1a5584
2writetext UnknownText_0x1a56d9
closetext
@@ -246,10 +246,10 @@
keeptextopen
2writetext UnknownText_0x1a57ba
keeptextopen
- setbit1 $0051
+ setbit1 EVENT_GAVE_KENYA
verbosegiveitem TM_50, 1
iffalse UnknownScript_0x1a55b3
- setbit1 $0053
+ setbit1 EVENT_GOT_TM50_NIGHTMARE
UnknownScript_0x1a55af: ; 0x1a55af
2writetext UnknownText_0x1a5896
closetext
--- a/maps/Route32.asm
+++ b/maps/Route32.asm
@@ -43,11 +43,11 @@
faceplayer
UnknownScript_0x190470: ; 0x190470
loadfont
- checkbit1 $005d
+ checkbit1 EVENT_GOT_MIRACLE_SEED_IN_ROUTE_32
iftrue UnknownScript_0x1904a5
checkbit2 $001b
iffalse UnknownScript_0x19049f
- checkbit1 $002d
+ checkbit1 EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE
iftrue UnknownScript_0x19048f
2writetext UnknownText_0x1907ab
closetext
@@ -67,7 +67,7 @@
keeptextopen
verbosegiveitem MIRACLE_SEED, 1
iffalse UnknownScript_0x1904a9
- setbit1 $005d
+ setbit1 EVENT_GOT_MIRACLE_SEED_IN_ROUTE_32
2jump UnknownScript_0x1904a5
; 0x19049f
@@ -106,13 +106,13 @@
FisherScript_0x1904ce: ; 0x1904ce
faceplayer
loadfont
- checkbit1 $004e
+ checkbit1 EVENT_GOT_TM05_ROAR
iftrue UnknownScript_0x1904e3
2writetext UnknownText_0x191133
keeptextopen
verbosegiveitem TM_05, 1
iffalse UnknownScript_0x1904e7
- setbit1 $004e
+ setbit1 EVENT_GOT_TM05_ROAR
UnknownScript_0x1904e3: ; 0x1904e3
2writetext UnknownText_0x19118c
closetext
@@ -266,7 +266,7 @@
if_equal $1, UnknownScript_0x1905ae
if_equal $0, UnknownScript_0x1905b4
UnknownScript_0x19059c: ; 0x19059c
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x1905e8
UnknownScript_0x1905a2: ; 0x1905a2
checkbit1 $0044
@@ -453,10 +453,10 @@
checkbit1 $0044
iftrue UnknownScript_0x1906d8
UnknownScript_0x190692: ; 0x190692
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x1906cb
UnknownScript_0x190698: ; 0x190698
- checkbit1 $0022
+ checkbit1 EVENT_CLEARED_ROCKET_HIDEOUT
iftrue UnknownScript_0x1906be
UnknownScript_0x19069e: ; 0x19069e
checkbit2 $0048
@@ -630,21 +630,21 @@
LassScript_0x190739: ; 0x190739
faceplayer
loadfont
- checkbit1 $0063
+ checkbit1 EVENT_GOT_POISON_BARB_FROM_FRIEDA
iftrue UnknownScript_0x190767
checkcode $b
if_not_equal FRIDAY, UnknownScript_0x19076d
- checkbit1 $0062
+ checkbit1 EVENT_MET_FRIEDA_OF_FRIDAY
iftrue UnknownScript_0x190754
2writetext UnknownText_0x1911c1
keeptextopen
- setbit1 $0062
+ setbit1 EVENT_MET_FRIEDA_OF_FRIDAY
UnknownScript_0x190754: ; 0x190754
2writetext UnknownText_0x191204
keeptextopen
verbosegiveitem POISON_BARB, 1
iffalse UnknownScript_0x19076b
- setbit1 $0063
+ setbit1 EVENT_GOT_POISON_BARB_FROM_FRIEDA
2writetext UnknownText_0x191222
closetext
loadmovesprites
--- a/maps/Route32PokeCenter1F.asm
+++ b/maps/Route32PokeCenter1F.asm
@@ -13,7 +13,7 @@
FishingGuruScript_0x69b55: ; 0x69b55
faceplayer
loadfont
- checkbit1 $0017
+ checkbit1 EVENT_GOT_OLD_ROD
iftrue UnknownScript_0x69b7a
2writetext UnknownText_0x69b83
yesorno
@@ -24,7 +24,7 @@
2writetext UnknownText_0x69c1b
closetext
loadmovesprites
- setbit1 $0017
+ setbit1 EVENT_GOT_OLD_ROD
end
; 0x69b74
--- a/maps/Route33.asm
+++ b/maps/Route33.asm
@@ -70,13 +70,13 @@
if_equal $1, UnknownScript_0x1ac082
if_equal $0, UnknownScript_0x1ac088
UnknownScript_0x1ac070: ; 0x1ac070
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x1ac0bc
UnknownScript_0x1ac076: ; 0x1ac076
checkbit1 $0044
iftrue UnknownScript_0x1ac0af
UnknownScript_0x1ac07c: ; 0x1ac07c
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x1ac0a2
UnknownScript_0x1ac082: ; 0x1ac082
checkbit2 $0047
--- a/maps/Route34.asm
+++ b/maps/Route34.asm
@@ -146,7 +146,7 @@
if_equal $1, UnknownScript_0x780ee
if_equal $0, UnknownScript_0x780f4
UnknownScript_0x780dc: ; 0x780dc
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x78128
UnknownScript_0x780e2: ; 0x780e2
checkbit1 $0044
@@ -303,13 +303,13 @@
if_equal $1, UnknownScript_0x781d0
if_equal $0, UnknownScript_0x781d6
UnknownScript_0x781be: ; 0x781be
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x7820a
UnknownScript_0x781c4: ; 0x781c4
checkbit1 $0044
iftrue UnknownScript_0x781fd
UnknownScript_0x781ca: ; 0x781ca
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x781f0
UnknownScript_0x781d0: ; 0x781d0
checkbit2 $0049
@@ -560,7 +560,7 @@
CooltrainerfIreneScript: ; 0x782c4
talkaftercancel
loadfont
- checkbit1 $0070
+ checkbit1 EVENT_GOT_SOFT_SAND_FROM_KATE
iftrue UnknownScript_0x782d2
2writetext UnknownText_0x7877f
closetext
@@ -598,7 +598,7 @@
CooltrainerfJennScript: ; 0x782e4
talkaftercancel
loadfont
- checkbit1 $0070
+ checkbit1 EVENT_GOT_SOFT_SAND_FROM_KATE
iftrue UnknownScript_0x782f2
2writetext UnknownText_0x78836
closetext
@@ -636,13 +636,13 @@
CooltrainerfKateScript: ; 0x78304
talkaftercancel
loadfont
- checkbit1 $0070
+ checkbit1 EVENT_GOT_SOFT_SAND_FROM_KATE
iftrue UnknownScript_0x78319
2writetext UnknownText_0x788e2
keeptextopen
verbosegiveitem SOFT_SAND, 1
iffalse UnknownScript_0x7831d
- setbit1 $0070
+ setbit1 EVENT_GOT_SOFT_SAND_FROM_KATE
UnknownScript_0x78319: ; 0x78319
2writetext UnknownText_0x7892b
closetext
--- a/maps/Route34IlexForestGate.asm
+++ b/maps/Route34IlexForestGate.asm
@@ -48,13 +48,13 @@
loadfont
checkbit1 $00c0
iftrue UnknownScript_0x62d84
- checkbit1 $007a
+ checkbit1 EVENT_GOT_TM12_SWEET_SCENT
iftrue UnknownScript_0x62d7e
2writetext UnknownText_0x62d9d
keeptextopen
verbosegiveitem TM_12, 1
iffalse UnknownScript_0x62d82
- setbit1 $007a
+ setbit1 EVENT_GOT_TM12_SWEET_SCENT
UnknownScript_0x62d7e: ; 0x62d7e
2writetext UnknownText_0x62df6
closetext
--- a/maps/Route35.asm
+++ b/maps/Route35.asm
@@ -292,7 +292,7 @@
if_equal $1, UnknownScript_0x19c9ec
if_equal $0, UnknownScript_0x19c9f2
UnknownScript_0x19c9da: ; 0x19c9da
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x19ca26
UnknownScript_0x19c9e0: ; 0x19c9e0
checkbit1 $0044
--- a/maps/Route35Goldenrodgate.asm
+++ b/maps/Route35Goldenrodgate.asm
@@ -9,11 +9,11 @@
OfficerScript_0x69d37: ; 0x69d37
faceplayer
loadfont
- checkbit1 $0052
+ checkbit1 EVENT_GOT_HP_UP_FROM_RANDY
iftrue UnknownScript_0x69d92
- checkbit1 $0051
+ checkbit1 EVENT_GAVE_KENYA
iftrue UnknownScript_0x69d85
- checkbit1 $0050
+ checkbit1 EVENT_GOT_KENYA
iftrue UnknownScript_0x69d73
2writetext UnknownText_0x69ddd
yesorno
@@ -28,7 +28,7 @@
waitbutton
givepoke SPEAROW, 10, 0, 1, GiftSpearowName, GiftSpearowOTName
givepokeitem GiftSpearowMail
- setbit1 $0050
+ setbit1 EVENT_GOT_KENYA
UnknownScript_0x69d73: ; 0x69d73
2writetext UnknownText_0x69ed6
closetext
@@ -55,7 +55,7 @@
keeptextopen
verbosegiveitem HP_UP, 1
iffalse UnknownScript_0x69d96
- setbit1 $0052
+ setbit1 EVENT_GOT_HP_UP_FROM_RANDY
UnknownScript_0x69d92: ; 0x69d92
2writetext UnknownText_0x69fd9
closetext
@@ -77,7 +77,7 @@
PokefanFScript_0x69dc6: ; 0x69dc6
faceplayer
loadfont
- checkbit1 $002a
+ checkbit1 EVENT_FOUGHT_SUDOWOODO
iftrue UnknownScript_0x69dd4
2writetext UnknownText_0x6a00a
closetext
--- a/maps/Route36.asm
+++ b/maps/Route36.asm
@@ -44,7 +44,7 @@
spriteface $0, $0
pause 10
dotrigger $0
- clearbit1 $07ae
+ clearbit1 EVENT_SAW_SUICUNE_AT_CIANWOOD_CITY
domaptrigger GROUP_CIANWOOD_CITY, MAP_CIANWOOD_CITY, $1
end
; 0x19403c
@@ -81,7 +81,7 @@
loadmovesprites
loadpokedata SUDOWOODO, 20
startbattle
- setbit1 $002a
+ setbit1 EVENT_FOUGHT_SUDOWOODO
if_equal $2, UnknownScript_0x19407b
disappear $4
variablesprite $4, $26
@@ -137,9 +137,9 @@
FisherScript_0x1940b9: ; 0x1940b9
faceplayer
loadfont
- checkbit1 $004b
+ checkbit1 EVENT_GOT_TM08_ROCK_SMASH
iftrue UnknownScript_0x1940da
- checkbit1 $002a
+ checkbit1 EVENT_FOUGHT_SUDOWOODO
iftrue UnknownScript_0x1940cd
2writetext UnknownText_0x19446f
closetext
@@ -152,7 +152,7 @@
keeptextopen
verbosegiveitem TM_08, 1
iffalse UnknownScript_0x1940de
- setbit1 $004b
+ setbit1 EVENT_GOT_TM08_ROCK_SMASH
UnknownScript_0x1940da: ; 0x1940da
2writetext UnknownText_0x19452c
closetext
@@ -164,7 +164,7 @@
LassScript_0x1940e0: ; 0x1940e0
faceplayer
loadfont
- checkbit1 $002a
+ checkbit1 EVENT_FOUGHT_SUDOWOODO
iftrue UnknownScript_0x1940ee
2writetext UnknownText_0x194626
closetext
@@ -239,7 +239,7 @@
if_equal $1, UnknownScript_0x194171
if_equal $0, UnknownScript_0x194177
UnknownScript_0x19415f: ; 0x19415f
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x1941ab
UnknownScript_0x194165: ; 0x194165
checkbit1 $0044
@@ -384,21 +384,21 @@
YoungsterScript_0x194201: ; 0x194201
faceplayer
loadfont
- checkbit1 $0067
+ checkbit1 EVENT_GOT_HARD_STONE_FROM_ARTHUR
iftrue UnknownScript_0x19422f
checkcode $b
if_not_equal THURSDAY, UnknownScript_0x194235
- checkbit1 $0066
+ checkbit1 EVENT_MET_ARTHUR_OF_THURSDAY
iftrue UnknownScript_0x19421c
2writetext UnknownText_0x194800
keeptextopen
- setbit1 $0066
+ setbit1 EVENT_MET_ARTHUR_OF_THURSDAY
UnknownScript_0x19421c: ; 0x19421c
2writetext UnknownText_0x19482d
keeptextopen
verbosegiveitem HARD_STONE, 1
iffalse UnknownScript_0x194233
- setbit1 $0067
+ setbit1 EVENT_GOT_HARD_STONE_FROM_ARTHUR
2writetext UnknownText_0x194847
closetext
loadmovesprites
--- a/maps/Route37.asm
+++ b/maps/Route37.asm
@@ -112,15 +112,15 @@
BugCatcherScript_0x1a8dbf: ; 0x1a8dbf
faceplayer
loadfont
- checkbit1 $0069
+ checkbit1 EVENT_GOT_MAGNET_FROM_SUNNY
iftrue UnknownScript_0x1a8dfa
checkcode $b
if_not_equal SUNDAY, UnknownScript_0x1a8e00
- checkbit1 $0068
+ checkbit1 EVENT_MET_SUNNY_OF_SUNDAY
iftrue UnknownScript_0x1a8dda
2writetext UnknownText_0x1a8fc8
keeptextopen
- setbit1 $0068
+ setbit1 EVENT_MET_SUNNY_OF_SUNDAY
UnknownScript_0x1a8dda: ; 0x1a8dda
checkbit2 $0063
iftrue UnknownScript_0x1a8de7
@@ -135,7 +135,7 @@
UnknownScript_0x1a8deb: ; 0x1a8deb
verbosegiveitem MAGNET, 1
iffalse UnknownScript_0x1a8dfe
- setbit1 $0069
+ setbit1 EVENT_GOT_MAGNET_FROM_SUNNY
2writetext UnknownText_0x1a905a
closetext
loadmovesprites
--- a/maps/Route38.asm
+++ b/maps/Route38.asm
@@ -124,13 +124,13 @@
if_equal $1, UnknownScript_0x1a1db3
if_equal $0, UnknownScript_0x1a1db9
UnknownScript_0x1a1da1: ; 0x1a1da1
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x1a1ded
UnknownScript_0x1a1da7: ; 0x1a1da7
checkbit1 $0044
iftrue UnknownScript_0x1a1de0
UnknownScript_0x1a1dad: ; 0x1a1dad
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x1a1dd3
UnknownScript_0x1a1db3: ; 0x1a1db3
checkbit2 $0045
@@ -295,13 +295,13 @@
if_equal $1, UnknownScript_0x1a1ea6
if_equal $0, UnknownScript_0x1a1eac
UnknownScript_0x1a1e94: ; 0x1a1e94
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x1a1ee0
UnknownScript_0x1a1e9a: ; 0x1a1e9a
checkbit1 $0044
iftrue UnknownScript_0x1a1ed3
UnknownScript_0x1a1ea0: ; 0x1a1ea0
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x1a1ec6
UnknownScript_0x1a1ea6: ; 0x1a1ea6
checkbit2 $0049
--- a/maps/Route39.asm
+++ b/maps/Route39.asm
@@ -45,11 +45,11 @@
iftrue UnknownScript_0x1a5b6e
checkpoke PIKACHU
iffalse UnknownScript_0x1a5b5c
- checkbit1 $028d
+ checkbit1 EVENT_SHOWED_DEREK_PIKACHU
iftrue UnknownScript_0x1a5b33
2writetext UnknownText_0x1a5cf8
keeptextopen
- setbit1 $028d
+ setbit1 EVENT_SHOWED_DEREK_PIKACHU
2call UnknownScript_0x1a5b62
2jump UnknownScript_0x1a5b36
; 0x1a5b33
--- a/maps/Route39Barn.asm
+++ b/maps/Route39Barn.asm
@@ -9,7 +9,7 @@
TwinScript_0x9cc76: ; 0x9cc76
faceplayer
loadfont
- checkbit1 $003d
+ checkbit1 EVENT_HEALED_MOOMOO
iftrue UnknownScript_0x9cc87
2writetext UnknownText_0x9cd2e
closetext
@@ -29,7 +29,7 @@
TwinScript_0x9cc90: ; 0x9cc90
faceplayer
loadfont
- checkbit1 $003d
+ checkbit1 EVENT_HEALED_MOOMOO
iftrue UnknownScript_0x9cca1
2writetext UnknownText_0x9cd2e
closetext
@@ -48,7 +48,7 @@
TaurosScript_0x9ccaa: ; 0x9ccaa
loadfont
- checkbit1 $003d
+ checkbit1 EVENT_HEALED_MOOMOO
iftrue UnknownScript_0x9cd25
2writetext UnknownText_0x9cd70
writebyte MILTANK
@@ -55,7 +55,7 @@
special $005f
keeptextopen
2writetext UnknownText_0x9cd80
- checkbit1 $003f
+ checkbit1 EVENT_TALKED_TO_FARMER_ABOUT_MOOMOO
iftrue UnknownScript_0x9ccc6
closetext
loadmovesprites
@@ -109,7 +109,7 @@
2writetext UnknownText_0x9ce1b
closetext
loadmovesprites
- setbit1 $003d
+ setbit1 EVENT_HEALED_MOOMOO
end
; 0x9cd19
--- a/maps/Route39Farmhouse.asm
+++ b/maps/Route39Farmhouse.asm
@@ -9,12 +9,12 @@
PokefanMScript_0x9ceb4: ; 0x9ceb4
faceplayer
loadfont
- checkbit1 $003d
+ checkbit1 EVENT_HEALED_MOOMOO
iftrue UnknownScript_0x9cec5
2writetext UnknownText_0x9cf38
closetext
loadmovesprites
- setbit1 $003f
+ setbit1 EVENT_TALKED_TO_FARMER_ABOUT_MOOMOO
end
; 0x9cec5
@@ -71,9 +71,9 @@
PokefanFScript_0x9cf0e: ; 0x9cf0e
faceplayer
loadfont
- checkbit1 $003e
+ checkbit1 EVENT_GOT_TM13_SNORE_FROM_MOOMOO_FARM
iftrue UnknownScript_0x9cf2f
- checkbit1 $003d
+ checkbit1 EVENT_HEALED_MOOMOO
iftrue UnknownScript_0x9cf22
2writetext UnknownText_0x9d0f6
closetext
@@ -86,7 +86,7 @@
keeptextopen
verbosegiveitem TM_13, 1
iffalse UnknownScript_0x9cf33
- setbit1 $003e
+ setbit1 EVENT_GOT_TM13_SNORE_FROM_MOOMOO_FARM
UnknownScript_0x9cf2f: ; 0x9cf2f
2writetext UnknownText_0x9d1c7
closetext
--- a/maps/Route40.asm
+++ b/maps/Route40.asm
@@ -164,21 +164,21 @@
BuenaScript_0x1a61d9: ; 0x1a61d9
faceplayer
loadfont
- checkbit1 $006f
+ checkbit1 EVENT_GOT_SHARP_BEAK_FROM_MONICA
iftrue UnknownScript_0x1a6207
checkcode $b
if_not_equal MONDAY, UnknownScript_0x1a620d
- checkbit1 $006e
+ checkbit1 EVENT_MET_MONICA_OF_MONDAY
iftrue UnknownScript_0x1a61f4
2writetext UnknownText_0x1a6606
keeptextopen
- setbit1 $006e
+ setbit1 EVENT_MET_MONICA_OF_MONDAY
UnknownScript_0x1a61f4: ; 0x1a61f4
2writetext UnknownText_0x1a6636
keeptextopen
verbosegiveitem SHARP_BEAK, 1
iffalse UnknownScript_0x1a620b
- setbit1 $006f
+ setbit1 EVENT_GOT_SHARP_BEAK_FROM_MONICA
2writetext UnknownText_0x1a666c
closetext
loadmovesprites
--- a/maps/Route42.asm
+++ b/maps/Route42.asm
@@ -26,7 +26,7 @@
disappear $a
pause 10
dotrigger $0
- clearbit1 $07b0
+ clearbit1 EVENT_SAW_SUICUNE_ON_ROUTE_36
domaptrigger GROUP_ROUTE_36, MAP_ROUTE_36, $1
end
; 0x1a9233
@@ -90,13 +90,13 @@
if_equal $1, UnknownScript_0x1a92a6
if_equal $0, UnknownScript_0x1a92ac
UnknownScript_0x1a929a: ; 0x1a929a
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x1a92d3
UnknownScript_0x1a92a0: ; 0x1a92a0
checkbit1 $0044
iftrue UnknownScript_0x1a92c6
UnknownScript_0x1a92a6: ; 0x1a92a6
- checkbit1 $0022
+ checkbit1 EVENT_CLEARED_ROCKET_HIDEOUT
iftrue UnknownScript_0x1a92b9
UnknownScript_0x1a92ac: ; 0x1a92ac
loadtrainer FISHER, TULLY1
--- a/maps/Route43.asm
+++ b/maps/Route43.asm
@@ -11,7 +11,7 @@
; 0x19d051
UnknownScript_0x19d051: ; 0x19d051
- checkbit1 $0022
+ checkbit1 EVENT_CLEARED_ROCKET_HIDEOUT
iftrue UnknownScript_0x19d05c
domaptrigger GROUP_ROUTE_43_GATE, MAP_ROUTE_43_GATE, $0
return
@@ -137,13 +137,13 @@
if_equal $1, UnknownScript_0x19d0f6
if_equal $0, UnknownScript_0x19d0fc
UnknownScript_0x19d0ea: ; 0x19d0ea
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x19d123
UnknownScript_0x19d0f0: ; 0x19d0f0
checkbit1 $0044
iftrue UnknownScript_0x19d116
UnknownScript_0x19d0f6: ; 0x19d0f6
- checkbit1 $0022
+ checkbit1 EVENT_CLEARED_ROCKET_HIDEOUT
iftrue UnknownScript_0x19d109
UnknownScript_0x19d0fc: ; 0x19d0fc
loadtrainer POKEMANIAC, BRENT1
@@ -305,11 +305,11 @@
iftrue UnknownScript_0x19d245
checkpoke CLEFAIRY
iffalse UnknownScript_0x19d233
- checkbit1 $0293
+ checkbit1 EVENT_SHOWED_TIFFANY_CLEFAIRY
iftrue UnknownScript_0x19d1aa
2writetext UnknownText_0x19d618
keeptextopen
- setbit1 $0293
+ setbit1 EVENT_SHOWED_TIFFANY_CLEFAIRY
2call UnknownScript_0x19d239
2jump UnknownScript_0x19d1ad
; 0x19d1aa
@@ -334,13 +334,13 @@
if_equal $1, UnknownScript_0x19d1e8
if_equal $0, UnknownScript_0x19d1ee
UnknownScript_0x19d1dc: ; 0x19d1dc
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x19d215
UnknownScript_0x19d1e2: ; 0x19d1e2
checkbit1 $0044
iftrue UnknownScript_0x19d208
UnknownScript_0x19d1e8: ; 0x19d1e8
- checkbit1 $0021
+ checkbit1 EVENT_CLEARED_RADIO_TOWER
iftrue UnknownScript_0x19d1fb
UnknownScript_0x19d1ee: ; 0x19d1ee
loadtrainer PICNICKER, TIFFANY3
--- a/maps/Route43Gate.asm
+++ b/maps/Route43Gate.asm
@@ -24,7 +24,7 @@
; 0x19abca
UnknownScript_0x19abca: ; 0x19abca
- checkbit1 $0022
+ checkbit1 EVENT_CLEARED_ROCKET_HIDEOUT
iftrue UnknownScript_0x19abd5
domaptrigger GROUP_ROUTE_43, MAP_ROUTE_43, $0
return
@@ -124,13 +124,13 @@
OfficerScript_0x19ac85: ; 0x19ac85
faceplayer
loadfont
- checkbit1 $0059
+ checkbit1 EVENT_GOT_TM36_SLUDGE_BOMB
iftrue UnknownScript_0x19ac9c
2writetext UnknownText_0x19ad9b
keeptextopen
verbosegiveitem TM_36, 1
iffalse UnknownScript_0x19aca0
- setbit1 $0059
+ setbit1 EVENT_GOT_TM36_SLUDGE_BOMB
loadmovesprites
end
; 0x19ac9c
--- a/maps/Route43MahoganyGate.asm
+++ b/maps/Route43MahoganyGate.asm
@@ -9,7 +9,7 @@
OfficerScript_0x19ab0b: ; 0x19ab0b
faceplayer
loadfont
- checkbit1 $0022
+ checkbit1 EVENT_CLEARED_ROCKET_HIDEOUT
iftrue UnknownScript_0x19ab19
2writetext UnknownText_0x19ab1f
closetext
--- a/maps/Route44.asm
+++ b/maps/Route44.asm
@@ -62,7 +62,7 @@
if_equal $1, UnknownScript_0x19d887
if_equal $0, UnknownScript_0x19d88d
UnknownScript_0x19d881: ; 0x19d881
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x19d8a7
UnknownScript_0x19d887: ; 0x19d887
checkbit1 $0044
@@ -90,7 +90,7 @@
startbattle
returnafterbattle
clearbit2 $0079
- checkbit1 $0339
+ checkbit1 EVENT_VANCE_CARBOS
iftrue UnknownScript_0x19d8cb
checkbit1 $0267
iftrue UnknownScript_0x19d8ca
@@ -111,7 +111,7 @@
closetext
verbosegiveitem CARBOS, 1
iffalse UnknownScript_0x19d903
- clearbit1 $0339
+ clearbit1 EVENT_VANCE_CARBOS
setbit1 $0267
2jump UnknownScript_0x19d8eb
; 0x19d8df
@@ -162,7 +162,7 @@
; 0x19d903
UnknownScript_0x19d903: ; 0x19d903
- setbit1 $0339
+ setbit1 EVENT_VANCE_CARBOS
jumpstd $0021
end
; 0x19d90a
@@ -259,7 +259,7 @@
if_equal $1, UnknownScript_0x19d98b
if_equal $0, UnknownScript_0x19d991
UnknownScript_0x19d985: ; 0x19d985
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x19d9ab
UnknownScript_0x19d98b: ; 0x19d98b
checkbit1 $0044
@@ -292,11 +292,11 @@
UnknownScript_0x19d9b4: ; 0x19d9b4
2call UnknownScript_0x19d8fb
- checkbit1 $032f
+ checkbit1 EVENT_WILTON_HAS_ULTRA_BALL
iftrue UnknownScript_0x19d9c9
- checkbit1 $0330
+ checkbit1 EVENT_WILTON_HAS_GREAT_BALL
iftrue UnknownScript_0x19d9d2
- checkbit1 $0331
+ checkbit1 EVENT_WILTON_HAS_POKE_BALL
iftrue UnknownScript_0x19d9db
UnknownScript_0x19d9c9: ; 0x19d9c9
verbosegiveitem ULTRA_BALL, 1
--- a/maps/Route45.asm
+++ b/maps/Route45.asm
@@ -134,7 +134,7 @@
; 0x19e13f
UnknownScript_0x19e13f: ; 0x19e13f
- setbit1 $033a
+ setbit1 EVENT_PARRY_IRON
jumpstd $0021
end
; 0x19e146
@@ -258,7 +258,7 @@
if_equal $1, UnknownScript_0x19e1d5
if_equal $0, UnknownScript_0x19e1db
UnknownScript_0x19e1cf: ; 0x19e1c
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x19e1f5
UnknownScript_0x19e1d5: ; 0x19e1d5
checkbit1 $0044
@@ -286,7 +286,7 @@
startbattle
returnafterbattle
clearbit2 $007b
- checkbit1 $033a
+ checkbit1 EVENT_PARRY_IRON
iftrue UnknownScript_0x19e219
checkbit1 $0268
iftrue UnknownScript_0x19e218
@@ -307,7 +307,7 @@
closetext
verbosegiveitem IRON, 1
iffalse UnknownScript_0x19e13f
- clearbit1 $033a
+ clearbit1 EVENT_PARRY_IRON
setbit1 $0268
2jump UnknownScript_0x19e127
; 0x19e22d
--- a/maps/Route46.asm
+++ b/maps/Route46.asm
@@ -91,7 +91,7 @@
if_equal $1, UnknownScript_0x1a96f7
if_equal $0, UnknownScript_0x1a96fd
UnknownScript_0x1a96f1: ; 0x1a96f1
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x1a9717
UnknownScript_0x1a96f7: ; 0x1a96f7
checkbit1 $0044
@@ -119,7 +119,7 @@
startbattle
returnafterbattle
clearbit2 $007c
- checkbit1 $033b
+ checkbit1 EVENT_ERIN_CALCIUM
iftrue UnknownScript_0x1a973b
checkbit1 $0269
iftrue UnknownScript_0x1a973a
@@ -140,7 +140,7 @@
closetext
verbosegiveitem CALCIUM, 1
iffalse UnknownScript_0x1a976b
- clearbit1 $033b
+ clearbit1 EVENT_ERIN_CALCIUM
setbit1 $0269
2jump UnknownScript_0x1a975b
; 0x1a974f
@@ -181,7 +181,7 @@
; 0x1a976b
UnknownScript_0x1a976b: ; 0x1a976b
- setbit1 $033b
+ setbit1 EVENT_ERIN_CALCIUM
jumpstd $002b
end
; 0x1a9772
--- a/maps/Route5CleanseTagSpeechHouse.asm
+++ b/maps/Route5CleanseTagSpeechHouse.asm
@@ -9,13 +9,13 @@
GrannyScript_0x18b634: ; 0x18b634
faceplayer
loadfont
- checkbit1 $00db
+ checkbit1 EVENT_GOT_CLEANSE_TAG
iftrue UnknownScript_0x18b649
2writetext UnknownText_0x18b655
keeptextopen
verbosegiveitem CLEANSE_TAG, 1
iffalse UnknownScript_0x18b64d
- setbit1 $00db
+ setbit1 EVENT_GOT_CLEANSE_TAG
UnknownScript_0x18b649: ; 0x18b649
2writetext UnknownText_0x18b6a7
closetext
--- a/maps/Route6SaffronGate.asm
+++ b/maps/Route6SaffronGate.asm
@@ -16,7 +16,7 @@
OfficerScript_0x1926ea: ; 0x1926ea
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x1926f8
2writetext UnknownText_0x1926fe
closetext
--- a/maps/Route7SaffronGate.asm
+++ b/maps/Route7SaffronGate.asm
@@ -9,7 +9,7 @@
OfficerScript_0x73518: ; 0x73518
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x73526
2writetext UnknownText_0x7352c
closetext
--- a/maps/RuinsofAlphAerodactylChamber.asm
+++ b/maps/RuinsofAlphAerodactylChamber.asm
@@ -15,7 +15,7 @@
; 0x58dad
UnknownScript_0x58dad: ; 0x58dad
- checkbit1 $0329
+ checkbit1 EVENT_WALL_OPENED_IN_AERODACTYL_CHAMBER
iftrue UnknownScript_0x58db4
end
; 0x58db4
@@ -30,7 +30,7 @@
; 0x58db9
UnknownScript_0x58db9: ; 0x58db9
- checkbit1 $0329
+ checkbit1 EVENT_WALL_OPENED_IN_AERODACTYL_CHAMBER
iftrue UnknownScript_0x58dc3
changeblock $4, $0, $2e
UnknownScript_0x58dc3: ; 0x58dc3
@@ -106,7 +106,7 @@
; 0x58e35
MapRuinsofAlphAerodactylChamberSignpost5Script: ; 0x58e35
- checkbit1 $0329
+ checkbit1 EVENT_WALL_OPENED_IN_AERODACTYL_CHAMBER
iftrue UnknownScript_0x58e46
loadfont
2writetext UnknownText_0x58e81
--- a/maps/RuinsofAlphHoOhChamber.asm
+++ b/maps/RuinsofAlphHoOhChamber.asm
@@ -16,7 +16,7 @@
UnknownScript_0x5856d: ; 0x5856d
special $008d
- checkbit1 $0326
+ checkbit1 EVENT_WALL_OPENED_IN_HO_OH_CHAMBER
iftrue UnknownScript_0x58577
end
; 0x58577
@@ -31,7 +31,7 @@
; 0x5857c
UnknownScript_0x5857c: ; 0x5857c
- checkbit1 $0326
+ checkbit1 EVENT_WALL_OPENED_IN_HO_OH_CHAMBER
iftrue UnknownScript_0x58586
changeblock $4, $0, $2e
UnknownScript_0x58586: ; 0x58586
@@ -107,7 +107,7 @@
; 0x585f8
MapRuinsofAlphHoOhChamberSignpost5Script: ; 0x585f8
- checkbit1 $0326
+ checkbit1 EVENT_WALL_OPENED_IN_HO_OH_CHAMBER
iftrue UnknownScript_0x58609
loadfont
2writetext UnknownText_0x58644
--- a/maps/RuinsofAlphInnerChamber.asm
+++ b/maps/RuinsofAlphInnerChamber.asm
@@ -28,7 +28,7 @@
closetext
loadmovesprites
dotrigger $0
- setbit1 $002e
+ setbit1 EVENT_MADE_UNOWN_APPEAR_IN_RUINS
clearbit1 $078e
end
; 0x58f7d
--- a/maps/RuinsofAlphKabutoChamber.asm
+++ b/maps/RuinsofAlphKabutoChamber.asm
@@ -15,7 +15,7 @@
; 0x5872b
UnknownScript_0x5872b: ; 0x5872b
- checkbit1 $0327
+ checkbit1 EVENT_WALL_OPENED_IN_KABUTO_CHAMBER
iftrue UnknownScript_0x58732
end
; 0x58732
@@ -33,7 +33,7 @@
; 0x58737
UnknownScript_0x58737: ; 0x58737
- checkbit1 $0327
+ checkbit1 EVENT_WALL_OPENED_IN_KABUTO_CHAMBER
iftrue UnknownScript_0x58741
changeblock $4, $0, $2e
UnknownScript_0x58741: ; 0x58741
@@ -101,7 +101,7 @@
loadfont
checkcode $e
if_equal 26, UnknownScript_0x587cf
- checkbit1 $0327
+ checkbit1 EVENT_WALL_OPENED_IN_KABUTO_CHAMBER
iftrue UnknownScript_0x587c9
checkbit1 $02a1
iffalse UnknownScript_0x587c0
@@ -147,7 +147,7 @@
; 0x587e6
MapRuinsofAlphKabutoChamberSignpost5Script: ; 0x587e6
- checkbit1 $0327
+ checkbit1 EVENT_WALL_OPENED_IN_KABUTO_CHAMBER
iftrue UnknownScript_0x587f7
loadfont
2writetext UnknownText_0x58ad9
--- a/maps/RuinsofAlphOmanyteChamber.asm
+++ b/maps/RuinsofAlphOmanyteChamber.asm
@@ -16,7 +16,7 @@
UnknownScript_0x58be9: ; 0x58be9
special $0084
- checkbit1 $0328
+ checkbit1 EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER
iftrue UnknownScript_0x58bf3
end
; 0x58bf3
@@ -31,7 +31,7 @@
; 0x58bf8
UnknownScript_0x58bf8: ; 0x58bf8
- checkbit1 $0328
+ checkbit1 EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER
iftrue UnknownScript_0x58c02
changeblock $4, $0, $2e
UnknownScript_0x58c02: ; 0x58c02
@@ -107,7 +107,7 @@
; 0x58c74
MapRuinsofAlphOmanyteChamberSignpost5Script: ; 0x58c74
- checkbit1 $0328
+ checkbit1 EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER
iftrue UnknownScript_0x58c85
loadfont
2writetext UnknownText_0x58cc0
--- a/maps/RuinsofAlphOutside.asm
+++ b/maps/RuinsofAlphOutside.asm
@@ -25,7 +25,7 @@
UnknownScript_0x5800f: ; 0x5800f
checkbit2 $000c
iftrue UnknownScript_0x5802c
- checkbit1 $002e
+ checkbit1 EVENT_MADE_UNOWN_APPEAR_IN_RUINS
iftrue UnknownScript_0x5801e
2jump UnknownScript_0x5802c
; 0x5801e
--- a/maps/RuinsofAlphResearchCenter.asm
+++ b/maps/RuinsofAlphResearchCenter.asm
@@ -90,7 +90,7 @@
if_equal 26, UnknownScript_0x5920b
checkbit2 $000c
iftrue UnknownScript_0x59205
- checkbit1 $002e
+ checkbit1 EVENT_MADE_UNOWN_APPEAR_IN_RUINS
iftrue UnknownScript_0x591ff
2writetext UnknownText_0x593ed
closetext
@@ -125,7 +125,7 @@
loadfont
checkcode $e
if_equal 26, UnknownScript_0x5922e
- checkbit1 $002e
+ checkbit1 EVENT_MADE_UNOWN_APPEAR_IN_RUINS
iftrue UnknownScript_0x59228
2writetext UnknownText_0x5954f
closetext
--- a/maps/SafariZoneWardensHome.asm
+++ b/maps/SafariZoneWardensHome.asm
@@ -9,12 +9,12 @@
LassScript_0x1965c6: ; 0x1965c6
faceplayer
loadfont
- checkbit1 $00d9
+ checkbit1 EVENT_TALKED_TO_WARDENS_GRANDDAUGHTER
iftrue UnknownScript_0x1965d7
2writetext UnknownText_0x1965e6
closetext
loadmovesprites
- setbit1 $00d9
+ setbit1 EVENT_TALKED_TO_WARDENS_GRANDDAUGHTER
end
; 0x1965d7
--- a/maps/SaffronCity.asm
+++ b/maps/SaffronCity.asm
@@ -18,7 +18,7 @@
LassScript_0x19932a: ; 0x19932a
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x199338
2writetext UnknownText_0x19938d
closetext
@@ -36,7 +36,7 @@
PokefanMScript_0x19933e: ; 0x19933e
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x19934c
2writetext UnknownText_0x199460
closetext
@@ -62,7 +62,7 @@
FisherScript_0x199358: ; 0x199358
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x199366
2writetext UnknownText_0x1995fc
closetext
--- a/maps/SaffronGym.asm
+++ b/maps/SaffronGym.asm
@@ -18,11 +18,11 @@
loadtrainer SABRINA, 1
startbattle
returnafterbattle
- setbit1 $04ca
- setbit1 $0590
- setbit1 $0591
- setbit1 $043b
- setbit1 $0444
+ setbit1 EVENT_BEAT_SABRINA
+ setbit1 EVENT_BEAT_MEDIUM_REBECCA
+ setbit1 EVENT_BEAT_MEDIUM_DORIS
+ setbit1 EVENT_BEAT_PSYCHIC_FRANKLIN
+ setbit1 EVENT_BEAT_PSYCHIC_JARED
loadfont
2writetext UnknownText_0x189e95
playsound $009c
@@ -160,7 +160,7 @@
SaffronGymGuyScript: ; 0x189cbb
faceplayer
loadfont
- checkbit1 $04ca
+ checkbit1 EVENT_BEAT_SABRINA
iftrue .SaffronGymGuyWinScript
2writetext SaffronGymGuyText
closetext
--- a/maps/SaffronPokeCenter1F.asm
+++ b/maps/SaffronPokeCenter1F.asm
@@ -23,7 +23,7 @@
FisherScript_0x18a48c: ; 0x18a48c
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x18a49a
2writetext UnknownText_0x18a5d3
closetext
--- a/maps/SaffronTrainStation.asm
+++ b/maps/SaffronTrainStation.asm
@@ -16,7 +16,7 @@
OfficerScript_0x18a81e: ; 0x18a81e
faceplayer
loadfont
- checkbit1 $00cd
+ checkbit1 EVENT_RESTORED_POWER_TO_KANTO
iftrue UnknownScript_0x18a82c
2writetext UnknownText_0x18a8a9
closetext
@@ -77,7 +77,7 @@
GymGuyScript_0x18a875: ; 0x18a875
faceplayer
loadfont
- checkbit1 $00c9
+ checkbit1 EVENT_RETURNED_MACHINE_PART
iftrue UnknownScript_0x18a883
2writetext UnknownText_0x18a9ca
closetext
--- a/maps/SeafoamGym.asm
+++ b/maps/SeafoamGym.asm
@@ -50,12 +50,12 @@
SeafoamGymGuyScript: ; 0x1ab531
faceplayer
loadfont
- checkbit1 $00d5
+ checkbit1 EVENT_TALKED_TO_SEAFOAM_GYM_GUY_ONCE
iftrue .TalkedToSeafoamGymGuyScript
2writetext SeafoamGymGuyWinText
closetext
loadmovesprites
- setbit1 $00d5
+ setbit1 EVENT_TALKED_TO_SEAFOAM_GYM_GUY_ONCE
end
.TalkedToSeafoamGymGuyScript
--- a/maps/SilphCo1F.asm
+++ b/maps/SilphCo1F.asm
@@ -13,13 +13,13 @@
OfficerScript_0x18abe8: ; 0x18abe8
faceplayer
loadfont
- checkbit1 $00de
+ checkbit1 EVENT_GOT_UP_GRADE
iftrue UnknownScript_0x18abfd
2writetext UnknownText_0x18ac36
keeptextopen
verbosegiveitem UP_GRADE, 1
iffalse UnknownScript_0x18ac01
- setbit1 $00de
+ setbit1 EVENT_GOT_UP_GRADE
UnknownScript_0x18abfd: ; 0x18abfd
2writetext UnknownText_0x18aca8
closetext
--- a/maps/SlowpokeWellB1F.asm
+++ b/maps/SlowpokeWellB1F.asm
@@ -81,7 +81,7 @@
2writetext KurtLeaveSlowpokeWellText
closetext
loadmovesprites
- setbit1 $002b
+ setbit1 EVENT_CLEARED_SLOWPOKE_WELL
variablesprite $6, $4
domaptrigger GROUP_AZALEA_TOWN, MAP_AZALEA_TOWN, $1
clearbit1 $06f3
--- a/maps/SlowpokeWellB2F.asm
+++ b/maps/SlowpokeWellB2F.asm
@@ -9,13 +9,13 @@
GymGuyScript_0x5ad0b: ; 0x5ad0b
faceplayer
loadfont
- checkbit1 $0073
+ checkbit1 EVENT_GOT_KINGS_ROCK_IN_SLOWPOKE_WELL
iftrue UnknownScript_0x5ad22
2writetext UnknownText_0x5ad2a
keeptextopen
verbosegiveitem KINGS_ROCK, 1
iffalse UnknownScript_0x5ad20
- setbit1 $0073
+ setbit1 EVENT_GOT_KINGS_ROCK_IN_SLOWPOKE_WELL
UnknownScript_0x5ad20: ; 0x5ad20
loadmovesprites
end
--- a/maps/SproutTower3F.asm
+++ b/maps/SproutTower3F.asm
@@ -63,7 +63,7 @@
SageLiScript: ; 0x1849a6
faceplayer
loadfont
- checkbit1 $0014
+ checkbit1 EVENT_GOT_HM05_FLASH
iftrue UnknownScript_0x1849d1
2writetext SageLiSeenText
closetext
@@ -76,8 +76,8 @@
2writetext UnknownText_0x184cc2
keeptextopen
verbosegiveitem HM_05, 1
- setbit1 $0014
- setbit1 $0419
+ setbit1 EVENT_GOT_HM05_FLASH
+ setbit1 EVENT_BEAT_SAGE_LI
2writetext UnknownText_0x184d13
closetext
loadmovesprites
--- a/maps/TeamRocketBaseB1F.asm
+++ b/maps/TeamRocketBaseB1F.asm
@@ -23,7 +23,7 @@
; 0x6c65e
SecurityCamera1a: ; 0x6c65e
- checkbit1 $02e4
+ checkbit1 EVENT_SECURITY_CAMERA_1
iftrue NoSecurityCamera
2call PlaySecurityCameraSounds
checkbit1 $06da
@@ -44,12 +44,12 @@
applymovement $2, SecurityCameraMovement1
2call TrainerCameraGrunt2
if_equal $1, NoSecurityCamera
- setbit1 $02e4
+ setbit1 EVENT_SECURITY_CAMERA_1
end
; 0x6c6a7
SecurityCamera1b: ; 0x6c6a7
- checkbit1 $02e4
+ checkbit1 EVENT_SECURITY_CAMERA_1
iftrue NoSecurityCamera
2call PlaySecurityCameraSounds
checkbit1 $06da
@@ -70,12 +70,12 @@
applymovement $2, SecurityCameraMovement1
2call TrainerCameraGrunt2
if_equal $1, NoSecurityCamera
- setbit1 $02e4
+ setbit1 EVENT_SECURITY_CAMERA_1
end
; 0x6c6f0
SecurityCamera2a: ; 0x6c6f0
- checkbit1 $02e5
+ checkbit1 EVENT_SECURITY_CAMERA_2
iftrue NoSecurityCamera
2call PlaySecurityCameraSounds
checkbit1 $06da
@@ -97,12 +97,12 @@
applymovement $2, SecurityCameraMovement3
2call TrainerCameraGrunt2
if_equal $1, NoSecurityCamera
- setbit1 $02e5
+ setbit1 EVENT_SECURITY_CAMERA_2
end
; 0x6c73c
SecurityCamera2b: ; 0x6c73c
- checkbit1 $02e5
+ checkbit1 EVENT_SECURITY_CAMERA_2
iftrue NoSecurityCamera
2call PlaySecurityCameraSounds
checkbit1 $06da
@@ -124,12 +124,12 @@
applymovement $2, SecurityCameraMovement5
2call TrainerCameraGrunt2
if_equal $1, NoSecurityCamera
- setbit1 $02e5
+ setbit1 EVENT_SECURITY_CAMERA_2
end
; 0x6c788
SecurityCamera3a: ; 0x6c788
- checkbit1 $02e6
+ checkbit1 EVENT_SECURITY_CAMERA_3
iftrue NoSecurityCamera
2call PlaySecurityCameraSounds
checkbit1 $06da
@@ -151,12 +151,12 @@
applymovement $2, SecurityCameraMovement6
2call TrainerCameraGrunt2
if_equal $1, NoSecurityCamera
- setbit1 $02e6
+ setbit1 EVENT_SECURITY_CAMERA_3
end
; 0x6c7d4
SecurityCamera3b: ; 0x6c7d4
- checkbit1 $02e6
+ checkbit1 EVENT_SECURITY_CAMERA_3
iftrue NoSecurityCamera
2call PlaySecurityCameraSounds
checkbit1 $06da
@@ -178,12 +178,12 @@
applymovement $2, SecurityCameraMovement7
2call TrainerCameraGrunt2
if_equal $1, NoSecurityCamera
- setbit1 $02e6
+ setbit1 EVENT_SECURITY_CAMERA_3
end
; 0x6c820
SecurityCamera4: ; 0x6c820
- checkbit1 $02e7
+ checkbit1 EVENT_SECURITY_CAMERA_4
iftrue NoSecurityCamera
2call PlaySecurityCameraSounds
checkbit1 $06da
@@ -205,12 +205,12 @@
applymovement $2, SecurityCameraMovement8
2call TrainerCameraGrunt2
if_equal $1, NoSecurityCamera
- setbit1 $02e7
+ setbit1 EVENT_SECURITY_CAMERA_4
end
; 0x6c86c
SecurityCamera5: ; 0x6c86c
- checkbit1 $02e8
+ checkbit1 EVENT_SECURITY_CAMERA_5
iftrue NoSecurityCamera
2call PlaySecurityCameraSounds
checkbit1 $06da
@@ -232,7 +232,7 @@
applymovement $2, SecurityCameraMovement9
2call TrainerCameraGrunt2
if_equal $1, NoSecurityCamera
- setbit1 $02e8
+ setbit1 EVENT_SECURITY_CAMERA_5
end
; 0x6c8b8
@@ -284,179 +284,179 @@
; 0x6c900
ExplodingTrap1: ; 0x6c900
- checkbit1 $02e9
+ checkbit1 EVENT_EXPLODING_TRAP_1
iftrue NoExplodingTrap
2call KoffingExplodingTrap
returnafterbattle
- setbit1 $02e9
+ setbit1 EVENT_EXPLODING_TRAP_1
end
ExplodingTrap2: ; 0x6c90e
- checkbit1 $02ea
+ checkbit1 EVENT_EXPLODING_TRAP_2
iftrue NoExplodingTrap
2call VoltorbExplodingTrap
returnafterbattle
- setbit1 $02ea
+ setbit1 EVENT_EXPLODING_TRAP_2
end
ExplodingTrap3: ; 0x6c91c
- checkbit1 $02eb
+ checkbit1 EVENT_EXPLODING_TRAP_3
iftrue NoExplodingTrap
2call GeodudeExplodingTrap
returnafterbattle
- setbit1 $02eb
+ setbit1 EVENT_EXPLODING_TRAP_3
end
ExplodingTrap4: ; 0x6c92a
- checkbit1 $02ec
+ checkbit1 EVENT_EXPLODING_TRAP_4
iftrue NoExplodingTrap
2call VoltorbExplodingTrap
returnafterbattle
- setbit1 $02ec
+ setbit1 EVENT_EXPLODING_TRAP_4
end
ExplodingTrap5: ; 0x6c938
- checkbit1 $02ed
+ checkbit1 EVENT_EXPLODING_TRAP_5
iftrue NoExplodingTrap
2call GeodudeExplodingTrap
returnafterbattle
- setbit1 $02ed
+ setbit1 EVENT_EXPLODING_TRAP_5
end
ExplodingTrap6: ; 0x6c946
- checkbit1 $02ee
+ checkbit1 EVENT_EXPLODING_TRAP_6
iftrue NoExplodingTrap
2call KoffingExplodingTrap
returnafterbattle
- setbit1 $02ee
+ setbit1 EVENT_EXPLODING_TRAP_6
end
ExplodingTrap7: ; 0x6c954
- checkbit1 $02ef
+ checkbit1 EVENT_EXPLODING_TRAP_7
iftrue NoExplodingTrap
2call VoltorbExplodingTrap
returnafterbattle
- setbit1 $02ef
+ setbit1 EVENT_EXPLODING_TRAP_7
end
ExplodingTrap8: ; 0x6c962
- checkbit1 $02f0
+ checkbit1 EVENT_EXPLODING_TRAP_8
iftrue NoExplodingTrap
2call KoffingExplodingTrap
returnafterbattle
- setbit1 $02f0
+ setbit1 EVENT_EXPLODING_TRAP_8
end
ExplodingTrap9: ; 0x6c970
- checkbit1 $02f1
+ checkbit1 EVENT_EXPLODING_TRAP_9
iftrue NoExplodingTrap
2call KoffingExplodingTrap
returnafterbattle
- setbit1 $02f1
+ setbit1 EVENT_EXPLODING_TRAP_9
end
ExplodingTrap10: ; 0x6c97e
- checkbit1 $02f2
+ checkbit1 EVENT_EXPLODING_TRAP_10
iftrue NoExplodingTrap
2call VoltorbExplodingTrap
returnafterbattle
- setbit1 $02f2
+ setbit1 EVENT_EXPLODING_TRAP_10
end
ExplodingTrap11: ; 0x6c98c
- checkbit1 $02f3
+ checkbit1 EVENT_EXPLODING_TRAP_11
iftrue NoExplodingTrap
2call GeodudeExplodingTrap
returnafterbattle
- setbit1 $02f3
+ setbit1 EVENT_EXPLODING_TRAP_11
end
ExplodingTrap12: ; 0x6c99a
- checkbit1 $02f4
+ checkbit1 EVENT_EXPLODING_TRAP_12
iftrue NoExplodingTrap
2call GeodudeExplodingTrap
returnafterbattle
- setbit1 $02f4
+ setbit1 EVENT_EXPLODING_TRAP_12
end
ExplodingTrap13: ; 0x6c9a8
- checkbit1 $02f5
+ checkbit1 EVENT_EXPLODING_TRAP_13
iftrue NoExplodingTrap
2call GeodudeExplodingTrap
returnafterbattle
- setbit1 $02f5
+ setbit1 EVENT_EXPLODING_TRAP_13
end
ExplodingTrap14: ; 0x6c9b6
- checkbit1 $02f6
+ checkbit1 EVENT_EXPLODING_TRAP_14
iftrue NoExplodingTrap
2call KoffingExplodingTrap
returnafterbattle
- setbit1 $02f6
+ setbit1 EVENT_EXPLODING_TRAP_14
end
ExplodingTrap15: ; 0x6c9c4
- checkbit1 $02f7
+ checkbit1 EVENT_EXPLODING_TRAP_15
iftrue NoExplodingTrap
2call VoltorbExplodingTrap
returnafterbattle
- setbit1 $02f7
+ setbit1 EVENT_EXPLODING_TRAP_15
end
ExplodingTrap16: ; 0x6c9d2
- checkbit1 $02f8
+ checkbit1 EVENT_EXPLODING_TRAP_16
iftrue NoExplodingTrap
2call KoffingExplodingTrap
returnafterbattle
- setbit1 $02f8
+ setbit1 EVENT_EXPLODING_TRAP_16
end
ExplodingTrap17: ; 0x6c9e0
- checkbit1 $02f9
+ checkbit1 EVENT_EXPLODING_TRAP_17
iftrue NoExplodingTrap
2call VoltorbExplodingTrap
returnafterbattle
- setbit1 $02f9
+ setbit1 EVENT_EXPLODING_TRAP_17
end
ExplodingTrap18: ; 0x6c9ee
- checkbit1 $02fa
+ checkbit1 EVENT_EXPLODING_TRAP_18
iftrue NoExplodingTrap
2call GeodudeExplodingTrap
returnafterbattle
- setbit1 $02fa
+ setbit1 EVENT_EXPLODING_TRAP_18
end
ExplodingTrap19: ; 0x6c9fc
- checkbit1 $02fb
+ checkbit1 EVENT_EXPLODING_TRAP_19
iftrue NoExplodingTrap
2call GeodudeExplodingTrap
returnafterbattle
- setbit1 $02fb
+ setbit1 EVENT_EXPLODING_TRAP_19
end
ExplodingTrap20: ; 0x6ca0a
- checkbit1 $02fc
+ checkbit1 EVENT_EXPLODING_TRAP_20
iftrue NoExplodingTrap
2call VoltorbExplodingTrap
returnafterbattle
- setbit1 $02fc
+ setbit1 EVENT_EXPLODING_TRAP_20
end
ExplodingTrap21: ; 0x6ca18
- checkbit1 $02fd
+ checkbit1 EVENT_EXPLODING_TRAP_21
iftrue NoExplodingTrap
2call KoffingExplodingTrap
returnafterbattle
- setbit1 $02fd
+ setbit1 EVENT_EXPLODING_TRAP_21
end
ExplodingTrap22: ; 0x6ca26
- checkbit1 $02fe
+ checkbit1 EVENT_EXPLODING_TRAP_22
iftrue NoExplodingTrap
2call VoltorbExplodingTrap
returnafterbattle
- setbit1 $02fe
+ setbit1 EVENT_EXPLODING_TRAP_22
end
VoltorbExplodingTrap: ; 0x6ca34
@@ -561,18 +561,18 @@
MapTeamRocketBaseB1FSignpost0Script: ; 0x6ca9c
loadfont
- checkbit1 $02e3
+ checkbit1 EVENT_TURNED_OFF_SECURITY_CAMERAS
iftrue UnknownScript_0x6cabe
2writetext UnknownText_0x6cdad
playsound $0021
closetext
loadmovesprites
- setbit1 $02e3
- setbit1 $02e4
- setbit1 $02e5
- setbit1 $02e6
- setbit1 $02e7
- setbit1 $02e8
+ setbit1 EVENT_TURNED_OFF_SECURITY_CAMERAS
+ setbit1 EVENT_SECURITY_CAMERA_1
+ setbit1 EVENT_SECURITY_CAMERA_2
+ setbit1 EVENT_SECURITY_CAMERA_3
+ setbit1 EVENT_SECURITY_CAMERA_4
+ setbit1 EVENT_SECURITY_CAMERA_5
end
; 0x6cabe
--- a/maps/TeamRocketBaseB2F.asm
+++ b/maps/TeamRocketBaseB2F.asm
@@ -33,7 +33,7 @@
; 0x6cf89
UnknownScript_0x6cf89: ; 0x6cf89
- checkbit1 $0300
+ checkbit1 EVENT_OPENED_DOOR_TO_ROCKET_HIDEOUT_TRANSMITTER
iftrue UnknownScript_0x6cf90
return
; 0x6cf90
@@ -349,7 +349,7 @@
2writetext UnknownText_0x6d809
keeptextopen
verbosegiveitem HM_06, 1
- setbit1 $0015
+ setbit1 EVENT_GOT_HM06_WHIRLPOOL
2writetext UnknownText_0x6d8f8
closetext
loadmovesprites
@@ -361,18 +361,18 @@
spriteface $0, $0
applymovement $4, MovementData_0x6d283
disappear $4
- setbit1 $0022
+ setbit1 EVENT_CLEARED_ROCKET_HIDEOUT
clearbit2 $000e
setbit1 $06dc
setbit1 $0757
dotrigger $3
clearbit1 $0735
- setbit1 $02e3
- setbit1 $02e4
- setbit1 $02e5
- setbit1 $02e6
- setbit1 $02e7
- setbit1 $02e8
+ setbit1 EVENT_TURNED_OFF_SECURITY_CAMERAS
+ setbit1 EVENT_SECURITY_CAMERA_1
+ setbit1 EVENT_SECURITY_CAMERA_2
+ setbit1 EVENT_SECURITY_CAMERA_3
+ setbit1 EVENT_SECURITY_CAMERA_4
+ setbit1 EVENT_SECURITY_CAMERA_5
end
; 0x6d1d7
@@ -384,7 +384,7 @@
MapTeamRocketBaseB2FSignpost1Script: ; 0x6d1db
loadfont
- checkbit1 $02ff
+ checkbit1 EVENT_LEARNED_HAIL_GIOVANNI
iftrue UnknownScript_0x6d1e8
2writetext UnknownText_0x6dd39
closetext
@@ -399,7 +399,7 @@
changeblock $e, $c, $7
reloadmappart
loadmovesprites
- setbit1 $0300
+ setbit1 EVENT_OPENED_DOOR_TO_ROCKET_HIDEOUT_TRANSMITTER
waitbutton
end
; 0x6d1fa
@@ -406,7 +406,7 @@
MapTeamRocketBaseB2FSignpost21Script: ; 0x6d1fa
loadfont
- checkbit1 $0022
+ checkbit1 EVENT_CLEARED_ROCKET_HIDEOUT
iftrue UnknownScript_0x6d207
2writetext UnknownText_0x6dda7
closetext
--- a/maps/TeamRocketBaseB3F.asm
+++ b/maps/TeamRocketBaseB3F.asm
@@ -125,7 +125,7 @@
2writetext UnknownText_0x6e585
closetext
loadmovesprites
- setbit1 $02ff
+ setbit1 EVENT_LEARNED_HAIL_GIOVANNI
end
; 0x6e09b
--- a/maps/TinTower1F.asm
+++ b/maps/TinTower1F.asm
@@ -26,7 +26,7 @@
; 0x18502f
UnknownScript_0x18502f: ; 0x18502f
- checkbit1 $0336
+ checkbit1 EVENT_GOT_RAINBOW_WING
iftrue UnknownScript_0x185047
checkbit1 $0044
iffalse UnknownScript_0x185050
@@ -35,7 +35,7 @@
clearbit1 $07c5
setbit1 $07b6
UnknownScript_0x185047: ; 0x185047
- checkbit1 $0317
+ checkbit1 EVENT_FOUGHT_HO_OH
iffalse UnknownScript_0x18504f
appear $5
UnknownScript_0x18504f: ; 0x18504f
@@ -43,7 +43,7 @@
; 0x185050
UnknownScript_0x185050: ; 0x185050
- checkbit1 $0335
+ checkbit1 EVENT_FOUGHT_SUICUNE
iftrue UnknownScript_0x185077
appear $2
writebyte RAIKOU
@@ -79,7 +79,7 @@
; 0x185084
UnknownScript_0x185084: ; 0x185084
- checkbit1 $0336
+ checkbit1 EVENT_GOT_RAINBOW_WING
iftrue UnknownScript_0x18508e
changeblock $a, $2, $9
UnknownScript_0x18508e: ; 0x18508e
@@ -126,15 +126,15 @@
startbattle
reloadmapmusic
disappear $2
- setbit1 $0335
- setbit1 $07af
+ setbit1 EVENT_FOUGHT_SUICUNE
+ setbit1 EVENT_SAW_SUICUNE_ON_ROUTE_42
domaptrigger GROUP_ROUTE_42, MAP_ROUTE_42, $0
- setbit1 $07b0
+ setbit1 EVENT_SAW_SUICUNE_ON_ROUTE_36
domaptrigger GROUP_ROUTE_36, MAP_ROUTE_36, $0
- setbit1 $07ae
+ setbit1 EVENT_SAW_SUICUNE_AT_CIANWOOD_CITY
domaptrigger GROUP_CIANWOOD_CITY, MAP_CIANWOOD_CITY, $0
dotrigger $1
- clearbit1 $07b7
+ clearbit1 EVENT_SET_WHEN_FOUGHT_HO_OH
returnafterbattle
pause 20
spriteface $0, $0
@@ -186,7 +186,7 @@
; 0x18517c
SageScript_0x18517c: ; 0x18517c
- checkbit1 $0317
+ checkbit1 EVENT_FOUGHT_HO_OH
iftrue UnknownScript_0x185185
jumptextfaceplayer UnknownText_0x1855ee
; 0x185185
@@ -198,9 +198,9 @@
SageScript_0x185188: ; 0x185188
faceplayer
loadfont
- checkbit1 $0317
+ checkbit1 EVENT_FOUGHT_HO_OH
iftrue UnknownScript_0x1851b6
- checkbit1 $0336
+ checkbit1 EVENT_GOT_RAINBOW_WING
iftrue UnknownScript_0x1851b0
2writetext UnknownText_0x185629
keeptextopen
@@ -212,7 +212,7 @@
playsound $001b
changeblock $a, $2, $20
reloadmappart
- setbit1 $0336
+ setbit1 EVENT_GOT_RAINBOW_WING
loadmovesprites
loadfont
UnknownScript_0x1851b0: ; 0x1851b0
@@ -230,7 +230,7 @@
; 0x1851bc
SageScript_0x1851bc: ; 0x1851bc
- checkbit1 $0317
+ checkbit1 EVENT_FOUGHT_HO_OH
iftrue UnknownScript_0x1851c5
jumptextfaceplayer UnknownText_0x185654
; 0x1851c5
--- a/maps/TinTowerRoof.asm
+++ b/maps/TinTowerRoof.asm
@@ -11,7 +11,7 @@
; 0x77230
UnknownScript_0x77230: ; 0x77230
- checkbit1 $0317
+ checkbit1 EVENT_FOUGHT_HO_OH
iftrue UnknownScript_0x77241
checkitem RAINBOW_WING
iftrue UnknownScript_0x7723e
@@ -35,13 +35,13 @@
cry HO_OH
pause 15
loadmovesprites
- setbit1 $0317
+ setbit1 EVENT_FOUGHT_HO_OH
writecode $3, $a
loadpokedata HO_OH, 60
startbattle
disappear $2
returnafterbattle
- setbit1 $07b7
+ setbit1 EVENT_SET_WHEN_FOUGHT_HO_OH
end
; 0x77260
--- a/maps/UndergroundPathSwitchRoomEntrances.asm
+++ b/maps/UndergroundPathSwitchRoomEntrances.asm
@@ -23,51 +23,51 @@
; 0x7c9f7
UnknownScript_0x7c9f7: ; 0x7c9f7
- checkbit1 $02d7
+ checkbit1 EVENT_SWITCH_4
iffalse UnknownScript_0x7ca01
changeblock $10, $6, $2d
UnknownScript_0x7ca01: ; 0x7ca01
- checkbit1 $02d8
+ checkbit1 EVENT_SWITCH_5
iffalse UnknownScript_0x7ca0b
changeblock $a, $6, $2d
UnknownScript_0x7ca0b: ; 0x7ca0b
- checkbit1 $02d9
+ checkbit1 EVENT_SWITCH_6
iffalse UnknownScript_0x7ca15
changeblock $2, $6, $2d
UnknownScript_0x7ca15: ; 0x7ca15
- checkbit1 $02da
+ checkbit1 EVENT_SWITCH_7
iffalse UnknownScript_0x7ca1f
changeblock $2, $a, $2d
UnknownScript_0x7ca1f: ; 0x7ca15
- checkbit1 $02db
+ checkbit1 EVENT_SWITCH_8
iffalse UnknownScript_0x7ca29
changeblock $a, $a, $2d
UnknownScript_0x7ca29: ; 0x7ca29
- checkbit1 $02dc
+ checkbit1 EVENT_SWITCH_9
iffalse UnknownScript_0x7ca33
changeblock $10, $a, $2d
UnknownScript_0x7ca33: ; 0x7ca33
- checkbit1 $02dd
+ checkbit1 EVENT_SWITCH_10
iffalse UnknownScript_0x7ca41
changeblock $c, $6, $2a
changeblock $c, $8, $2d
UnknownScript_0x7ca41: ; 0x7ca41
- checkbit1 $02de
+ checkbit1 EVENT_SWITCH_11
iffalse UnknownScript_0x7ca4f
changeblock $6, $6, $2a
changeblock $6, $8, $2d
UnknownScript_0x7ca4f: ; 0x7ca4f
- checkbit1 $02df
+ checkbit1 EVENT_SWITCH_12
iffalse UnknownScript_0x7ca5d
changeblock $c, $a, $2a
changeblock $c, $c, $2d
UnknownScript_0x7ca5d: ; 0x7ca5d
- checkbit1 $02e0
+ checkbit1 EVENT_SWITCH_13
iffalse UnknownScript_0x7ca6b
changeblock $6, $a, $2a
changeblock $6, $c, $2d
UnknownScript_0x7ca6b: ; 0x7ca6b
- checkbit1 $02e1
+ checkbit1 EVENT_SWITCH_14
iffalse UnknownScript_0x7ca79
changeblock $12, $a, $2a
changeblock $12, $c, $2d
@@ -135,9 +135,9 @@
closetext
loadmovesprites
setbit1 $06c1
- checkbit1 $001c
+ checkbit1 EVENT_GOT_TOTODILE_FROM_ELM
iftrue UnknownScript_0x7cb09
- checkbit1 $001d
+ checkbit1 EVENT_GOT_CHIKORITA_FROM_ELM
iftrue UnknownScript_0x7cb19
winlosstext UnknownText_0x7cf5d, UnknownText_0x7d102
setlasttalked $c
@@ -355,7 +355,7 @@
loadfont
2writetext UnknownText_0x7d554
keeptextopen
- checkbit1 $02d3
+ checkbit1 EVENT_SWITCH_1
iftrue UnknownScript_0x7cbcb
2writetext UnknownText_0x7d617
yesorno
@@ -363,7 +363,7 @@
copybytetovar UndergroundSwitchPositions
addvar $1
copyvartobyte UndergroundSwitchPositions
- setbit1 $02d3
+ setbit1 EVENT_SWITCH_1
2jump UnknownScript_0x7cc8d
; 0x7cbcb
@@ -374,7 +374,7 @@
copybytetovar UndergroundSwitchPositions
addvar -1
copyvartobyte UndergroundSwitchPositions
- clearbit1 $02d3
+ clearbit1 EVENT_SWITCH_1
2jump UnknownScript_0x7cc8d
; 0x7cbe0
@@ -382,7 +382,7 @@
loadfont
2writetext UnknownText_0x7d643
keeptextopen
- checkbit1 $02d4
+ checkbit1 EVENT_SWITCH_2
iftrue UnknownScript_0x7cc00
2writetext UnknownText_0x7d617
yesorno
@@ -390,7 +390,7 @@
copybytetovar UndergroundSwitchPositions
addvar $2
copyvartobyte UndergroundSwitchPositions
- setbit1 $02d4
+ setbit1 EVENT_SWITCH_2
2jump UnknownScript_0x7cc8d
; 0x7cc00
@@ -401,7 +401,7 @@
copybytetovar UndergroundSwitchPositions
addvar -2
copyvartobyte UndergroundSwitchPositions
- clearbit1 $02d4
+ clearbit1 EVENT_SWITCH_2
2jump UnknownScript_0x7cc8d
; 0x7cc15
@@ -409,7 +409,7 @@
loadfont
2writetext UnknownText_0x7d65a
keeptextopen
- checkbit1 $02d5
+ checkbit1 EVENT_SWITCH_3
iftrue UnknownScript_0x7cc35
2writetext UnknownText_0x7d617
yesorno
@@ -417,7 +417,7 @@
copybytetovar UndergroundSwitchPositions
addvar $3
copyvartobyte UndergroundSwitchPositions
- setbit1 $02d5
+ setbit1 EVENT_SWITCH_3
2jump UnknownScript_0x7cc8d
; 0x7cc35
@@ -428,7 +428,7 @@
copybytetovar UndergroundSwitchPositions
addvar -3
copyvartobyte UndergroundSwitchPositions
- clearbit1 $02d5
+ clearbit1 EVENT_SWITCH_3
2jump UnknownScript_0x7cc8d
; 0x7cc4a
@@ -436,7 +436,7 @@
loadfont
2writetext UnknownText_0x7d671
keeptextopen
- checkbit1 $02d6
+ checkbit1 EVENT_EMERGENCY_SWITCH
iftrue UnknownScript_0x7cc70
2writetext UnknownText_0x7d617
yesorno
@@ -443,10 +443,10 @@
iffalse UnknownScript_0x7cc8b
writebyte $7
copyvartobyte UndergroundSwitchPositions
- setbit1 $02d6
- setbit1 $02d3
- setbit1 $02d4
- setbit1 $02d5
+ setbit1 EVENT_EMERGENCY_SWITCH
+ setbit1 EVENT_SWITCH_1
+ setbit1 EVENT_SWITCH_2
+ setbit1 EVENT_SWITCH_3
2jump UnknownScript_0x7cc8d
; 0x7cc70
@@ -456,10 +456,10 @@
iffalse UnknownScript_0x7cc8b
writebyte $0
copyvartobyte UndergroundSwitchPositions
- clearbit1 $02d6
- clearbit1 $02d3
- clearbit1 $02d4
- clearbit1 $02d5
+ clearbit1 EVENT_EMERGENCY_SWITCH
+ clearbit1 EVENT_SWITCH_1
+ clearbit1 EVENT_SWITCH_2
+ clearbit1 EVENT_SWITCH_3
2jump UnknownScript_0x7cc8d
; 0x7cc8b
@@ -602,37 +602,37 @@
UnknownScript_0x7cda5: ; 0x7cda5
changeblock $10, $6, $2d
- setbit1 $02d7
+ setbit1 EVENT_SWITCH_4
end
; 0x7cdad
UnknownScript_0x7cdad: ; 0x7cdad
changeblock $a, $6, $2d
- setbit1 $02d8
+ setbit1 EVENT_SWITCH_5
end
; 0x7cdb5
UnknownScript_0x7cdb5: ; 0x7cdb5
changeblock $2, $6, $2d
- setbit1 $02d9
+ setbit1 EVENT_SWITCH_6
end
; 0x7cdbd
UnknownScript_0x7cdbd: ; 0x7cdbd
changeblock $2, $a, $2d
- setbit1 $02da
+ setbit1 EVENT_SWITCH_7
end
; 0x7cdc5
UnknownScript_0x7cdc5: ; 0x7cdc5
changeblock $a, $a, $2d
- setbit1 $02db
+ setbit1 EVENT_SWITCH_8
end
; 0x7cdcd
UnknownScript_0x7cdcd: ; 0x7cdcd
changeblock $10, $a, $2d
- setbit1 $02dc
+ setbit1 EVENT_SWITCH_9
end
; 0x7cdd5
@@ -639,7 +639,7 @@
UnknownScript_0x7cdd5: ; 0x7cdd5
changeblock $c, $6, $2a
changeblock $c, $8, $2d
- setbit1 $02dd
+ setbit1 EVENT_SWITCH_10
end
; 0x7cde1
@@ -646,7 +646,7 @@
UnknownScript_0x7cde1: ; 0x7cde1
changeblock $6, $6, $2a
changeblock $6, $8, $2d
- setbit1 $02de
+ setbit1 EVENT_SWITCH_11
end
; 0x7cded
@@ -653,7 +653,7 @@
UnknownScript_0x7cded: ; 0x7cded
changeblock $c, $a, $2a
changeblock $c, $c, $2d
- setbit1 $02df
+ setbit1 EVENT_SWITCH_12
end
; 0x7cdf9
@@ -660,7 +660,7 @@
UnknownScript_0x7cdf9: ; 0x7cdf9
changeblock $6, $a, $2a
changeblock $6, $c, $2d
- setbit1 $02e0
+ setbit1 EVENT_SWITCH_13
end
; 0x7ce05
@@ -667,43 +667,43 @@
UnknownScript_0x7ce05: ; 0x7ce05
changeblock $12, $a, $2a
changeblock $12, $c, $2d
- setbit1 $02e1
+ setbit1 EVENT_SWITCH_14
end
; 0x7ce11
UnknownScript_0x7ce11: ; 0x7ce11
changeblock $10, $6, $3e
- clearbit1 $02d7
+ clearbit1 EVENT_SWITCH_4
end
; 0x7ce19
UnknownScript_0x7ce19: ; 0x7ce19
changeblock $a, $6, $3e
- clearbit1 $02d8
+ clearbit1 EVENT_SWITCH_5
end
; 0x7ce21
UnknownScript_0x7ce21: ; 0x7ce21
changeblock $2, $6, $3e
- clearbit1 $02d9
+ clearbit1 EVENT_SWITCH_6
end
; 0x7ce29
UnknownScript_0x7ce29: ; 0x7ce29
changeblock $2, $a, $3e
- clearbit1 $02da
+ clearbit1 EVENT_SWITCH_7
end
; 0x7ce31
UnknownScript_0x7ce31: ; 0x7ce31
changeblock $a, $a, $3e
- clearbit1 $02db
+ clearbit1 EVENT_SWITCH_8
end
; 0x7ce39
UnknownScript_0x7ce39: ; 0x7ce39
changeblock $10, $a, $3e
- clearbit1 $02dc
+ clearbit1 EVENT_SWITCH_9
end
; 0x7ce41
@@ -710,7 +710,7 @@
UnknownScript_0x7ce41: ; 0x7ce41
changeblock $c, $6, $3f
changeblock $c, $8, $3d
- clearbit1 $02dd
+ clearbit1 EVENT_SWITCH_10
end
; 0x7ce4d
@@ -717,7 +717,7 @@
UnknownScript_0x7ce4d: ; 0x7ce4d
changeblock $6, $6, $3f
changeblock $6, $8, $3d
- clearbit1 $02de
+ clearbit1 EVENT_SWITCH_11
end
; 0x7ce59
@@ -724,7 +724,7 @@
UnknownScript_0x7ce59: ; 0x7ce59
changeblock $c, $a, $3f
changeblock $c, $c, $3d
- clearbit1 $02df
+ clearbit1 EVENT_SWITCH_12
end
; 0x7ce65
@@ -731,7 +731,7 @@
UnknownScript_0x7ce65: ; 0x7ce65
changeblock $6, $a, $3f
changeblock $6, $c, $3d
- clearbit1 $02e0
+ clearbit1 EVENT_SWITCH_13
end
; 0x7ce71
@@ -738,7 +738,7 @@
UnknownScript_0x7ce71: ; 0x7ce71
changeblock $12, $a, $3f
changeblock $12, $c, $3d
- clearbit1 $02e1
+ clearbit1 EVENT_SWITCH_14
end
; 0x7ce7d
--- a/maps/UndergroundWarehouse.asm
+++ b/maps/UndergroundWarehouse.asm
@@ -11,21 +11,21 @@
; 0x7d950
UnknownScript_0x7d950: ; 0x7d950
- clearbit1 $02d3
- clearbit1 $02d4
- clearbit1 $02d5
- clearbit1 $02d6
- clearbit1 $02d7
- clearbit1 $02d8
- clearbit1 $02d9
- clearbit1 $02da
- clearbit1 $02db
- clearbit1 $02dc
- clearbit1 $02dd
- clearbit1 $02de
- clearbit1 $02df
- clearbit1 $02e0
- clearbit1 $02e1
+ clearbit1 EVENT_SWITCH_1
+ clearbit1 EVENT_SWITCH_2
+ clearbit1 EVENT_SWITCH_3
+ clearbit1 EVENT_EMERGENCY_SWITCH
+ clearbit1 EVENT_SWITCH_4
+ clearbit1 EVENT_SWITCH_5
+ clearbit1 EVENT_SWITCH_6
+ clearbit1 EVENT_SWITCH_7
+ clearbit1 EVENT_SWITCH_8
+ clearbit1 EVENT_SWITCH_9
+ clearbit1 EVENT_SWITCH_10
+ clearbit1 EVENT_SWITCH_11
+ clearbit1 EVENT_SWITCH_12
+ clearbit1 EVENT_SWITCH_13
+ clearbit1 EVENT_SWITCH_14
writebyte $0
copyvartobyte UndergroundSwitchPositions
return
--- a/maps/VermilionCity.asm
+++ b/maps/VermilionCity.asm
@@ -60,7 +60,7 @@
loadpokedata SNORLAX, 50
startbattle
disappear $6
- setbit1 $0750
+ setbit1 EVENT_FOUGHT_SNORLAX
returnafterbattle
end
; 0x1aa9c2
--- a/maps/VermilionGym.asm
+++ b/maps/VermilionGym.asm
@@ -18,10 +18,10 @@
loadtrainer LT_SURGE, 1
startbattle
returnafterbattle
- setbit1 $04c7
- setbit1 $049c
- setbit1 $0494
- setbit1 $0497
+ setbit1 EVENT_BEAT_LTSURGE
+ setbit1 EVENT_BEAT_GENTLEMAN_GREGORY
+ setbit1 EVENT_BEAT_GUITARIST_VINCENT
+ setbit1 EVENT_BEAT_JUGGLER_HORTON
loadfont
2writetext UnknownText_0x192277
playsound $009c
@@ -130,7 +130,7 @@
VermilionGymGuyScript: ; 0x19211b
faceplayer
loadfont
- checkbit1 $04c7
+ checkbit1 EVENT_BEAT_LTSURGE
iftrue .VermilionGymGuyWinScript
2writetext VermilionGymGuyText
closetext
--- a/maps/VermilionPokeCenter1F.asm
+++ b/maps/VermilionPokeCenter1F.asm
@@ -13,7 +13,7 @@
FishingGuruScript_0x191606: ; 0x191606
faceplayer
loadfont
- checkbit1 $0750
+ checkbit1 EVENT_FOUGHT_SNORLAX
iftrue UnknownScript_0x191614
2writetext UnknownText_0x191620
closetext
--- a/maps/VermilionPort.asm
+++ b/maps/VermilionPort.asm
@@ -61,16 +61,16 @@
waitbutton
setbit1 $073a
clearbit1 $073b
- clearbit1 $04eb
- clearbit1 $042f
- clearbit1 $0540
- clearbit1 $0493
- clearbit1 $04d4
- clearbit1 $04dd
- clearbit1 $057c
- clearbit1 $05b7
- clearbit1 $0476
- clearbit1 $0477
+ clearbit1 EVENT_BEAT_POKEMANIAC_ETHAN
+ clearbit1 EVENT_BEAT_BURGLAR_COREY
+ clearbit1 EVENT_BEAT_BUG_CATCHER_KEN
+ clearbit1 EVENT_BEAT_GUITARIST_CLYDE
+ clearbit1 EVENT_BEAT_POKEFANM_JEREMY
+ clearbit1 EVENT_BEAT_POKEFANF_GEORGIA
+ clearbit1 EVENT_BEAT_SAILOR_KENNETH
+ clearbit1 EVENT_BEAT_TEACHER_SHIRLEY
+ clearbit1 EVENT_BEAT_SCHOOLBOY_NATE
+ clearbit1 EVENT_BEAT_SCHOOLBOY_RICKY
setbit1 $002f
appear $2
domaptrigger GROUP_FAST_SHIP_1F, MAP_FAST_SHIP_1F, $1
--- a/maps/VictoryRoad.asm
+++ b/maps/VictoryRoad.asm
@@ -57,9 +57,9 @@
closetext
loadmovesprites
setbit1 $06c2
- checkbit1 $001c
+ checkbit1 EVENT_GOT_TOTODILE_FROM_ELM
iftrue UnknownScript_0x744ff
- checkbit1 $001d
+ checkbit1 EVENT_GOT_CHIKORITA_FROM_ELM
iftrue UnknownScript_0x7450f
winlosstext UnknownText_0x7463d, UnknownText_0x747aa
setlasttalked $2
--- a/maps/VioletGym.asm
+++ b/maps/VioletGym.asm
@@ -9,7 +9,7 @@
FalknerScript_0x683c2: ; 0x683c2
faceplayer
loadfont
- checkbit1 $04bd
+ checkbit1 EVENT_BEAT_FALKNER
iftrue UnknownScript_0x683ec
2writetext UnknownText_0x68473
closetext
@@ -18,7 +18,7 @@
loadtrainer FALKNER, 1
startbattle
returnafterbattle
- setbit1 $04bd
+ setbit1 EVENT_BEAT_FALKNER
loadfont
2writetext UnknownText_0x685af
playsound $009c
@@ -27,10 +27,10 @@
checkcode $7
2call UnknownScript_0x68418
UnknownScript_0x683ec: ; 0x683ec
- checkbit1 $0008
+ checkbit1 EVENT_GOT_TM31_MUD_SLAP
iftrue UnknownScript_0x68412
- setbit1 $03fb
- setbit1 $03fc
+ setbit1 EVENT_BEAT_BIRD_KEEPER_ROD
+ setbit1 EVENT_BEAT_BIRD_KEEPER_ABE
domaptrigger GROUP_ELMS_LAB, MAP_ELMS_LAB, $2
specialphonecall $3
2writetext UnknownText_0x685c8
@@ -37,7 +37,7 @@
keeptextopen
verbosegiveitem TM_31, 1
iffalse UnknownScript_0x68416
- setbit1 $0008
+ setbit1 EVENT_GOT_TM31_MUD_SLAP
2writetext UnknownText_0x68648
closetext
loadmovesprites
@@ -127,7 +127,7 @@
VioletGymGuyScript: ; 0x6844f
faceplayer
loadfont
- checkbit1 $04bd
+ checkbit1 EVENT_BEAT_FALKNER
iftrue .VioletGymGuyWinScript
2writetext VioletGymGuyText
closetext
--- a/maps/VioletPokeCenter1F.asm
+++ b/maps/VioletPokeCenter1F.asm
@@ -13,7 +13,7 @@
ScientistScript_0x694cc: ; 0x694cc
faceplayer
loadfont
- checkbit1 $002c
+ checkbit1 EVENT_REFUSED_TO_TAKE_EGG_FROM_ELMS_AIDE
iftrue UnknownScript_0x6953a
2writetext UnknownText_0x69555
UnknownScript_0x694d7: ; 0x694d7
@@ -24,9 +24,9 @@
giveegg TOGEPI, 5
stringtotext .eggname, $1
2call UnknownScript_0x69527
- setbit1 $002d
- clearbit1 $0701
- clearbit1 $0054
+ setbit1 EVENT_GOT_TOGEPI_EGG_FROM_ELMS_AIDE
+ clearbit1 EVENT_ELMS_AIDE_IN_LAB
+ clearbit1 EVENT_TOGEPI_HATCHED
domaptrigger GROUP_ROUTE_32, MAP_ROUTE_32, $1
2writetext UnknownText_0x695c5
closetext
@@ -70,7 +70,7 @@
2writetext UnknownText_0x696f2
closetext
loadmovesprites
- setbit1 $002c
+ setbit1 EVENT_REFUSED_TO_TAKE_EGG_FROM_ELMS_AIDE
end
; 0x6953a
--- a/maps/ViridianCity.asm
+++ b/maps/ViridianCity.asm
@@ -55,13 +55,13 @@
FisherScript_0x1a9a75: ; 0x1a9a75
faceplayer
loadfont
- checkbit1 $00e0
+ checkbit1 EVENT_GOT_TM42_DREAM_EATER
iftrue UnknownScript_0x1a9a8a
2writetext UnknownText_0x1a9cc4
keeptextopen
verbosegiveitem TM_42, 1
iffalse UnknownScript_0x1a9a8e
- setbit1 $00e0
+ setbit1 EVENT_GOT_TM42_DREAM_EATER
UnknownScript_0x1a9a8a: ; 0x1a9a8a
2writetext UnknownText_0x1a9d86
closetext
--- a/maps/ViridianGym.asm
+++ b/maps/ViridianGym.asm
@@ -18,7 +18,7 @@
loadtrainer BLUE, 1
startbattle
returnafterbattle
- setbit1 $04cc
+ setbit1 EVENT_BEAT_BLUE
loadfont
2writetext UnknownText_0x9ac0f
playsound $009c
@@ -40,7 +40,7 @@
ViridianGymGuyScript: ; 0x9aa57
faceplayer
loadfont
- checkbit1 $04cc
+ checkbit1 EVENT_BEAT_BLUE
iftrue .ViridianGymGuyWinScript
2writetext ViridianGymGuyText
closetext
--- a/maps/WarehouseEntrance.asm
+++ b/maps/WarehouseEntrance.asm
@@ -15,21 +15,21 @@
; 0x7c043
UnknownScript_0x7c043: ; 0x7c043
- clearbit1 $02d3
- clearbit1 $02d4
- clearbit1 $02d5
- clearbit1 $02d6
- clearbit1 $02d7
- clearbit1 $02d8
- clearbit1 $02d9
- clearbit1 $02da
- clearbit1 $02db
- clearbit1 $02dc
- clearbit1 $02dd
- clearbit1 $02de
- clearbit1 $02df
- clearbit1 $02e0
- clearbit1 $02e1
+ clearbit1 EVENT_SWITCH_1
+ clearbit1 EVENT_SWITCH_2
+ clearbit1 EVENT_SWITCH_3
+ clearbit1 EVENT_EMERGENCY_SWITCH
+ clearbit1 EVENT_SWITCH_4
+ clearbit1 EVENT_SWITCH_5
+ clearbit1 EVENT_SWITCH_6
+ clearbit1 EVENT_SWITCH_7
+ clearbit1 EVENT_SWITCH_8
+ clearbit1 EVENT_SWITCH_9
+ clearbit1 EVENT_SWITCH_10
+ clearbit1 EVENT_SWITCH_11
+ clearbit1 EVENT_SWITCH_12
+ clearbit1 EVENT_SWITCH_13
+ clearbit1 EVENT_SWITCH_14
writebyte $0
copyvartobyte UndergroundSwitchPositions
return
@@ -36,7 +36,7 @@
; 0x7c076
UnknownScript_0x7c076: ; 0x7c076
- checkbit1 $0049
+ checkbit1 EVENT_USED_BASEMENT_KEY
iffalse UnknownScript_0x7c07d
return
; 0x7c07d
@@ -470,7 +470,7 @@
MapWarehouseEntranceSignpost0Script: ; 0x7c2d6
loadfont
- checkbit1 $0049
+ checkbit1 EVENT_USED_BASEMENT_KEY
iftrue UnknownScript_0x7c2fa
checkitem BASEMENT_KEY
iftrue UnknownScript_0x7c2e8
@@ -488,7 +488,7 @@
changeblock $12, $6, $2e
reloadmappart
loadmovesprites
- setbit1 $0049
+ setbit1 EVENT_USED_BASEMENT_KEY
end
; 0x7c2fa
--- a/maps/WhirlIslandLugiaChamber.asm
+++ b/maps/WhirlIslandLugiaChamber.asm
@@ -11,7 +11,7 @@
; 0x18c504
UnknownScript_0x18c504: ; 0x18c504
- checkbit1 $0318
+ checkbit1 EVENT_FOUGHT_LUGIA
iftrue UnknownScript_0x18c515
checkitem SILVER_WING
iftrue UnknownScript_0x18c512
@@ -35,7 +35,7 @@
cry LUGIA
pause 15
loadmovesprites
- setbit1 $0318
+ setbit1 EVENT_FOUGHT_LUGIA
writecode $3, $a
loadpokedata LUGIA, 60
startbattle
--- a/maps/WillsRoom.asm
+++ b/maps/WillsRoom.asm
@@ -28,7 +28,7 @@
iffalse UnknownScript_0x1804d5
changeblock $4, $e, $2a
UnknownScript_0x1804d5: ; 0x1804d5
- checkbit1 $030a
+ checkbit1 EVENT_WILLS_ROOM_EXIT_OPEN
iffalse UnknownScript_0x1804df
changeblock $4, $2, $16
UnknownScript_0x1804df: ; 0x1804df
@@ -70,7 +70,7 @@
changeblock $4, $2, $16
reloadmappart
loadmovesprites
- setbit1 $030a
+ setbit1 EVENT_WILLS_ROOM_EXIT_OPEN
waitbutton
end
; 0x180526
--- a/maps/WiseTriosRoom.asm
+++ b/maps/WiseTriosRoom.asm
@@ -23,9 +23,9 @@
; 0x98574
UnknownScript_0x98574: ; 0x98574
- checkbit1 $0335
+ checkbit1 EVENT_FOUGHT_SUICUNE
iftrue UnknownScript_0x98593
- checkbit1 $0334
+ checkbit1 EVENT_KOJI_ALLOWS_YOU_PASSAGE_TO_TIN_TOWER
iftrue UnknownScript_0x9858c
checkitem CLEAR_BELL
iftrue UnknownScript_0x9858c
@@ -152,7 +152,7 @@
; 0x985f8
SageKojiScript: ; 0x985f8
- checkbit1 $0334
+ checkbit1 EVENT_KOJI_ALLOWS_YOU_PASSAGE_TO_TIN_TOWER
iftrue UnknownScript_0x9861b
pause 10
showemote $0, $7, 20
@@ -164,7 +164,7 @@
loadmovesprites
applymovement $7, MovementData_0x98628
spriteface $7, $1
- setbit1 $0334
+ setbit1 EVENT_KOJI_ALLOWS_YOU_PASSAGE_TO_TIN_TOWER
dotrigger $1
end
; 0x9861b
--- /dev/null
+++ b/maps/blockdata_1.asm
@@ -1,0 +1,308 @@
+Route32_BlockData: ; 0xa8000
+ INCBIN "maps/Route32.blk"
+; 0xa81c2
+
+Route40_BlockData: ; 0xa81c2
+ INCBIN "maps/Route40.blk"
+; 0xa8276
+
+Route36_BlockData: ; 0xa8276
+ INCBIN "maps/Route36.blk"
+; 0xa8384
+
+Route44_BlockData: ; 0xa8384
+ INCBIN "maps/Route44.blk"
+; 0xa8492
+
+Route28_BlockData: ; 0xa8492
+ INCBIN "maps/Route28.blk"
+; 0xa8546
+
+BetaHerosHouse_BlockData: ; 0xa8546
+ INCBIN "maps/BetaHerosHouse.blk"
+; 0xa8552
+
+CeladonCity_BlockData: ; 0xa8552
+ INCBIN "maps/CeladonCity.blk"
+; 0xa86ba
+
+SaffronCity_BlockData: ; 0xa86ba
+ INCBIN "maps/SaffronCity.blk"
+; 0xa8822
+
+Route2_BlockData: ; 0xa8822
+ INCBIN "maps/Route2.blk"
+; 0xa8930
+
+ElmsHouse_BlockData: ; 0xa8930
+ INCBIN "maps/ElmsHouse.blk"
+; 0xa8940
+
+BetaSproutTower1_BlockData: ; 0xa8940
+ INCBIN "maps/BetaSproutTower1.blk"
+; 0xa899a
+
+Route11_BlockData: ; 0xa899a
+ INCBIN "maps/Route11.blk"
+; 0xa8a4e
+
+BetaSproutTower5_BlockData: ; 0xa8a4e
+ INCBIN "maps/BetaSproutTower5.blk"
+; 0xa8aa8
+
+Route15_BlockData: ; 0xa8aa8
+ INCBIN "maps/Route15.blk"
+; 0xa8b5c
+
+BetaSproutTower9_BlockData: ; 0xa8b5c
+ INCBIN "maps/BetaSproutTower9.blk"
+; 0xa8b80
+
+Route19_BlockData: ; 0xa8b80
+ INCBIN "maps/Route19.blk"
+; 0xa8c34
+
+BetaBlackthornCity_BlockData: ; 0xa8c34
+ INCBIN "maps/BetaBlackthornCity.blk"
+; 0xa8d9c
+
+Route10South_BlockData: ; 0xa8d9c
+ INCBIN "maps/Route10South.blk"
+; 0xa8df6
+
+CinnabarPokeCenter2FBeta_BlockData: ; 0xa8df6
+ INCBIN "maps/CinnabarPokeCenter2FBeta.blk"
+; 0xa8e16
+
+Route41_BlockData: ; 0xa8e16
+ INCBIN "maps/Route41.blk"
+; 0xa90b9
+
+Route33_BlockData: ; 0xa90b9
+ INCBIN "maps/Route33.blk"
+; 0xa9113
+
+Route45_BlockData: ; 0xa9113
+ INCBIN "maps/Route45.blk"
+; 0xa92d5
+
+Route29_BlockData: ; 0xa92d5
+ INCBIN "maps/Route29.blk"
+; 0xa93e3
+
+Route37_BlockData: ; 0xa93e3
+ INCBIN "maps/Route37.blk"
+; 0xa943d
+
+LavenderTown_BlockData: ; 0xa943d
+ INCBIN "maps/LavenderTown.blk"
+; 0xa9497
+
+PalletTown_BlockData: ; 0xa9497
+ INCBIN "maps/PalletTown.blk"
+; 0xa94f1
+
+Route25_BlockData: ; 0xa94f1
+ INCBIN "maps/Route25.blk"
+; 0xa95ff
+
+Route24_BlockData: ; 0xa95ff
+ INCBIN "maps/Route24.blk"
+; 0xa9659
+
+BetaVioletCity_BlockData: ; 0xa9659
+ INCBIN "maps/BetaVioletCity.blk"
+; 0xa97c1
+
+Route3_BlockData: ; 0xa97c1
+ INCBIN "maps/Route3.blk"
+; 0xa98cf
+
+PewterCity_BlockData: ; 0xa98cf
+ INCBIN "maps/PewterCity.blk"
+; 0xa9a37
+
+BetaIlexForest_BlockData: ; 0xa9a37
+ INCBIN "maps/BetaIlexForest.blk"
+; 0xa9b9f
+
+BetaSproutTower2_BlockData: ; 0xa9b9f
+ INCBIN "maps/BetaSproutTower2.blk"
+; 0xa9bf9
+
+Route12_BlockData: ; 0xa9bf9
+ INCBIN "maps/Route12.blk"
+; 0xa9d07
+
+BetaGoldenrodCity_BlockData: ; 0xa9d07
+ INCBIN "maps/BetaGoldenrodCity.blk"
+; 0xa9e6f
+
+Route20_BlockData: ; 0xa9e6f
+ INCBIN "maps/Route20.blk"
+; 0xa9f7d
+
+BetaSproutTower6_BlockData: ; 0xa9f7d
+ INCBIN "maps/BetaSproutTower6.blk"
+; 0xa9fd7
+
+BetaPokecenterMainHouse_BlockData: ; 0xa9fd7
+ INCBIN "maps/BetaPokecenterMainHouse.blk"
+; 0xa9ff7
+
+Route30_BlockData: ; 0xa9ff7
+ INCBIN "maps/Route30.blk"
+; 0xaa105
+
+Route26_BlockData: ; 0xaa105
+ INCBIN "maps/Route26.blk"
+; 0xaa321
+
+Route42_BlockData: ; 0xaa321
+ INCBIN "maps/Route42.blk"
+; 0xaa42f
+
+Route34_BlockData: ; 0xaa42f
+ INCBIN "maps/Route34.blk"
+; 0xaa53d
+
+Route46_BlockData: ; 0xaa53d
+ INCBIN "maps/Route46.blk"
+; 0xaa5f1
+
+FuchsiaCity_BlockData: ; 0xaa5f1
+ INCBIN "maps/FuchsiaCity.blk"
+; 0xaa759
+
+Route38_BlockData: ; 0xaa759
+ INCBIN "maps/Route38.blk"
+; 0xaa80d
+
+BetaCianwoodCity_BlockData: ; 0xaa80d
+ INCBIN "maps/BetaCianwoodCity.blk"
+; 0xaa867
+
+OlivineVoltorbHouse_BlockData: ; 0xaa867
+ INCBIN "maps/OlivineVoltorbHouse.blk"
+; 0xaa877
+
+SafariZoneFuchsiaGateBeta_BlockData: ; 0xaa877
+ INCBIN "maps/SafariZoneFuchsiaGateBeta.blk"
+; 0xaa88b
+
+BetaTeakCity_BlockData: ; 0xaa88b
+ INCBIN "maps/BetaTeakCity.blk"
+; 0xaa9f3
+
+BetaCherrygroveCity_BlockData: ; 0xaa9f3
+ INCBIN "maps/BetaCherrygroveCity.blk"
+; 0xaaa4d
+
+CinnabarIsland_BlockData: ; 0xaaa4d
+ INCBIN "maps/CinnabarIsland.blk"
+; 0xaaaa7
+
+Route4_BlockData: ; 0xaaaa7
+ INCBIN "maps/Route4.blk"
+; 0xaab5b
+
+Route8_BlockData: ; 0xaab5b
+ INCBIN "maps/Route8.blk"
+; 0xaac0f
+
+BetaSproutTower3_BlockData: ; 0xaac0f
+ INCBIN "maps/BetaSproutTower3.blk"
+; 0xaac69
+
+ViridianCity_BlockData: ; 0xaac69
+ INCBIN "maps/ViridianCity.blk"
+; 0xaadd1
+
+Route13_BlockData: ; 0xaadd1
+ INCBIN "maps/Route13.blk"
+; 0xaaedf
+
+Route21_BlockData: ; 0xaaedf
+ INCBIN "maps/Route21.blk"
+; 0xaaf93
+
+BetaSproutTower7_BlockData: ; 0xaaf93
+ INCBIN "maps/BetaSproutTower7.blk"
+; 0xaafed
+
+Route17_BlockData: ; 0xaafed
+ INCBIN "maps/Route17.blk"
+; 0xab1af
+
+BetaMahoganyTown_BlockData: ; 0xab1af
+ INCBIN "maps/BetaMahoganyTown.blk"
+; 0xab209
+
+Route31_BlockData: ; 0xab209
+ INCBIN "maps/Route31.blk"
+; 0xab2bd
+
+Route27_BlockData: ; 0xab2bd
+ INCBIN "maps/Route27.blk"
+; 0xab425
+
+Route35_BlockData: ; 0xab425
+ INCBIN "maps/Route35.blk"
+; 0xab4d9
+
+Route43_BlockData: ; 0xab4d9
+ INCBIN "maps/Route43.blk"
+; 0xab5e7
+
+Route39_BlockData: ; 0xab5e7
+ INCBIN "maps/Route39.blk"
+; 0xab69b
+
+KrissHouse1F_BlockData: ; 0xab69b
+ INCBIN "maps/KrissHouse1F.blk"
+; 0xab6af
+
+Route38EcruteakGate_BlockData: ; 0xab6af
+ INCBIN "maps/Route38EcruteakGate.blk"
+; 0xab6c3
+
+BetaAzaleaTown_BlockData: ; 0xab6c3
+ INCBIN "maps/BetaAzaleaTown.blk"
+; 0xab82b
+
+VermilionCity_BlockData: ; 0xab82b
+ INCBIN "maps/VermilionCity.blk"
+; 0xab993
+
+BetaOlivineCity_BlockData: ; 0xab993
+ INCBIN "maps/BetaOlivineCity.blk"
+; 0xabafb
+
+BetaNewBarkTown_BlockData: ; 0xabafb
+ INCBIN "maps/BetaNewBarkTown.blk"
+; 0xabb55
+
+ElmsLab_BlockData: ; 0xabb55
+ INCBIN "maps/ElmsLab.blk"
+; 0xabb73
+
+CeruleanCity_BlockData: ; 0xabb73
+ INCBIN "maps/CeruleanCity.blk"
+; 0xabcdb
+
+Route1_BlockData: ; 0xabcdb
+ INCBIN "maps/Route1.blk"
+; 0xabd8f
+
+Route5_BlockData: ; 0xabd8f
+ INCBIN "maps/Route5.blk"
+; 0xabde9
+
+Route9_BlockData: ; 0xabde9
+ INCBIN "maps/Route9.blk"
+; 0xabef7
+
+Route22_BlockData: ; 0xabef7
+ INCBIN "maps/Route22.blk"
+; 0xabfab
+
--- /dev/null
+++ b/maps/blockdata_2.asm
@@ -1,0 +1,552 @@
+Route14_BlockData: ; 0xac000
+ INCBIN "maps/Route14.blk"
+; 0xac0b4
+
+BetaSproutTower8_BlockData: ; 0xac0b4
+ INCBIN "maps/BetaSproutTower8.blk"
+; 0xac10e
+
+OlivineMart_BlockData: ; 0xac10e
+ INCBIN "maps/OlivineMart.blk"
+; 0xac126
+
+Route10North_BlockData: ; 0xac126
+ INCBIN "maps/Route10North.blk"
+; 0xac180
+
+BetaLakeOfRage_BlockData: ; 0xac180
+ INCBIN "maps/BetaLakeOfRage.blk"
+; 0xac2e8
+
+OlivinePokeCenter1F_BlockData: ; 0xac2e8
+ INCBIN "maps/OlivinePokeCenter1F.blk"
+; 0xac2fc
+
+BetaPewterMuseumOfScience1F_BlockData: ; 0xac2fc
+ INCBIN "maps/BetaPewterMuseumOfScience1F.blk"
+; 0xac324
+
+BetaPewterMuseumOfScience2F_BlockData: ; 0xac324
+ INCBIN "maps/BetaPewterMuseumOfScience2F.blk"
+; 0xac340
+
+EarlsPokemonAcademy_BlockData: ; 0xac340
+ INCBIN "maps/EarlsPokemonAcademy.blk"
+; 0xac360
+
+BetaCinnabarIslandPokemonLabHallway_BlockData: ; 0xac360
+ INCBIN "maps/BetaCinnabarIslandPokemonLabHallway.blk"
+; 0xac384
+
+BetaCinnabarIslandPokemonLabRoom1_BlockData: ; 0xac384
+ INCBIN "maps/BetaCinnabarIslandPokemonLabRoom1.blk"
+; 0xac394
+
+BetaCinnabarIslandPokemonLabRoom2_BlockData: ; 0xac394
+ INCBIN "maps/BetaCinnabarIslandPokemonLabRoom2.blk"
+; 0xac3a4
+
+BetaCinnabarIslandPokemonLabRoom3_BlockData: ; 0xac3a4
+ INCBIN "maps/BetaCinnabarIslandPokemonLabRoom3.blk"
+; 0xac3b4
+
+GoldenrodDeptStore1F_BlockData: ; 0xac3b4
+ INCBIN "maps/GoldenrodDeptStore1F.blk"
+; 0xac3d4
+
+GoldenrodDeptStore2F_BlockData: ; 0xac3d4
+ INCBIN "maps/GoldenrodDeptStore2F.blk"
+; 0xac3f4
+
+GoldenrodDeptStore3F_BlockData: ; 0xac3f4
+ INCBIN "maps/GoldenrodDeptStore3F.blk"
+; 0xac414
+
+GoldenrodDeptStore4F_BlockData: ; 0xac414
+ INCBIN "maps/GoldenrodDeptStore4F.blk"
+; 0xac434
+
+GoldenrodDeptStore5F_BlockData: ; 0xac434
+ INCBIN "maps/GoldenrodDeptStore5F.blk"
+; 0xac454
+
+GoldenrodDeptStore6F_BlockData: ; 0xac454
+ INCBIN "maps/GoldenrodDeptStore6F.blk"
+; 0xac474
+
+GoldenrodDeptStoreElevator_BlockData: ; 0xac474
+ INCBIN "maps/GoldenrodDeptStoreElevator.blk"
+; 0xac478
+
+CeladonMansion1F_BlockData: ; 0xac478
+ INCBIN "maps/CeladonMansion1F.blk"
+; 0xac48c
+
+CeladonMansion2F_BlockData: ; 0xac48c
+ INCBIN "maps/CeladonMansion2F.blk"
+; 0xac4a0
+
+CeladonMansion3F_BlockData: ; 0xac4a0
+ INCBIN "maps/CeladonMansion3F.blk"
+; 0xac4b4
+
+CeladonMansionRoof_BlockData: ; 0xac4b4
+ INCBIN "maps/CeladonMansionRoof.blk"
+; 0xac4c8
+
+BetaHouse_BlockData: ; 0xac4c8
+ INCBIN "maps/BetaHouse.blk"
+; 0xac4d8
+
+CeladonGameCorner_BlockData: ; 0xac4d8
+ INCBIN "maps/CeladonGameCorner.blk"
+; 0xac51e
+
+CeladonGameCornerPrizeRoom_BlockData: ; 0xac51e
+ INCBIN "maps/CeladonGameCornerPrizeRoom.blk"
+; 0xac527
+
+Colosseum_BlockData: ; 0xac527
+ INCBIN "maps/Colosseum.blk"
+; 0xac53b
+
+TradeCenter_BlockData: ; 0xac53b
+ INCBIN "maps/TradeCenter.blk"
+; 0xac54f
+
+EcruteakLugiaSpeechHouse_BlockData: ; 0xac54f
+ INCBIN "maps/EcruteakLugiaSpeechHouse.blk"
+; 0xac55f
+
+BetaCave_BlockData: ; 0xac55f
+ INCBIN "maps/BetaCave.blk"
+; 0xac5b9
+
+UnionCaveB1F_BlockData: ; 0xac5b9
+ INCBIN "maps/UnionCaveB1F.blk"
+; 0xac66d
+
+UnionCaveB2F_BlockData: ; 0xac66d
+ INCBIN "maps/UnionCaveB2F.blk"
+; 0xac721
+
+UnionCave1F_BlockData: ; 0xac721
+ INCBIN "maps/UnionCave1F.blk"
+; 0xac7d5
+
+NationalPark_BlockData: ; 0xac7d5
+ INCBIN "maps/NationalPark.blk"
+; 0xac9f1
+
+Route6UndergroundEntrance_BlockData: ; 0xac9f1
+ INCBIN "maps/Route6UndergroundEntrance.blk"
+; 0xaca01
+
+BetaPokecenterTradeStation_BlockData: ; 0xaca01
+ INCBIN "maps/BetaPokecenterTradeStation.blk"
+; 0xaca11
+
+KurtsHouse_BlockData: ; 0xaca11
+ INCBIN "maps/KurtsHouse.blk"
+; 0xaca31
+
+GoldenrodMagnetTrainStation_BlockData: ; 0xaca31
+ INCBIN "maps/GoldenrodMagnetTrainStation.blk"
+; 0xaca8b
+
+RuinsofAlphOutside_BlockData: ; 0xaca8b
+ INCBIN "maps/RuinsofAlphOutside.blk"
+; 0xacb3f
+
+BetaAlphRuinUnsolvedPuzzleRoom_BlockData: ; 0xacb3f
+ INCBIN "maps/BetaAlphRuinUnsolvedPuzzleRoom.blk"
+; 0xacb53
+
+RuinsofAlphInnerChamber_BlockData: ; 0xacb53
+ INCBIN "maps/RuinsofAlphInnerChamber.blk"
+; 0xacbdf
+
+RuinsofAlphHoOhChamber_BlockData: ; 0xacbdf
+ INCBIN "maps/RuinsofAlphHoOhChamber.blk"
+; 0xacbf3
+
+SproutTower1F_BlockData: ; 0xacbf3
+ INCBIN "maps/SproutTower1F.blk"
+; 0xacc43
+
+BetaSproutTowerCutOut1_BlockData: ; 0xacc43
+ INCBIN "maps/BetaSproutTowerCutOut1.blk"
+; 0xacc4d
+
+SproutTower2F_BlockData: ; 0xacc4d
+ INCBIN "maps/SproutTower2F.blk"
+; 0xacc9d
+
+BetaSproutTowerCutOut2_BlockData: ; 0xacc9d
+ INCBIN "maps/BetaSproutTowerCutOut2.blk"
+; 0xacca7
+
+SproutTower3F_BlockData: ; 0xacca7
+ INCBIN "maps/SproutTower3F.blk"
+; 0xaccf7
+
+BetaSproutTowerCutOut3_BlockData: ; 0xaccf7
+ INCBIN "maps/BetaSproutTowerCutOut3.blk"
+; 0xacd01
+
+RadioTower1F_BlockData: ; 0xacd01
+ INCBIN "maps/RadioTower1F.blk"
+; 0xacd25
+
+RadioTower2F_BlockData: ; 0xacd25
+ INCBIN "maps/RadioTower2F.blk"
+; 0xacd49
+
+RadioTower3F_BlockData: ; 0xacd49
+ INCBIN "maps/RadioTower3F.blk"
+; 0xacd6d
+
+RadioTower4F_BlockData: ; 0xacd6d
+ INCBIN "maps/RadioTower4F.blk"
+; 0xacd91
+
+RadioTower5F_BlockData: ; 0xacd91
+ INCBIN "maps/RadioTower5F.blk"
+; 0xacdb5
+
+NewBarkTown_BlockData: ; 0xacdb5
+ INCBIN "maps/NewBarkTown.blk"
+; 0xace0f
+
+CherrygroveCity_BlockData: ; 0xace0f
+ INCBIN "maps/CherrygroveCity.blk"
+; 0xacec3
+
+VioletCity_BlockData: ; 0xacec3
+ INCBIN "maps/VioletCity.blk"
+; 0xad02b
+
+AzaleaTown_BlockData: ; 0xad02b
+ INCBIN "maps/AzaleaTown.blk"
+; 0xad0df
+
+CianwoodCity_BlockData: ; 0xad0df
+ INCBIN "maps/CianwoodCity.blk"
+; 0xad274
+
+GoldenrodCity_BlockData: ; 0xad274
+ INCBIN "maps/GoldenrodCity.blk"
+; 0xad3dc
+
+OlivineCity_BlockData: ; 0xad3dc
+ INCBIN "maps/OlivineCity.blk"
+; 0xad544
+
+EcruteakCity_BlockData: ; 0xad544
+ INCBIN "maps/EcruteakCity.blk"
+; 0xad6ac
+
+MahoganyTown_BlockData: ; 0xad6ac
+ INCBIN "maps/MahoganyTown.blk"
+; 0xad706
+
+LakeofRage_BlockData: ; 0xad706
+ INCBIN "maps/LakeofRage.blk"
+; 0xad86e
+
+BlackthornCity_BlockData: ; 0xad86e
+ INCBIN "maps/BlackthornCity.blk"
+; 0xad9d6
+
+SilverCaveOutside_BlockData: ; 0xad9d6
+ INCBIN "maps/SilverCaveOutside.blk"
+; 0xadb3e
+
+Route6_BlockData: ; 0xadb3e
+ INCBIN "maps/Route6.blk"
+; 0xadb98
+
+Route7_BlockData: ; 0xadb98
+ INCBIN "maps/Route7.blk"
+; 0xadbf2
+
+Route16_BlockData: ; 0xadbf2
+ INCBIN "maps/Route16.blk"
+; 0xadc4c
+
+Route18_BlockData: ; 0xadc4c
+ INCBIN "maps/Route18.blk"
+; 0xadca6
+
+WarehouseEntrance_BlockData: ; 0xadca6
+ INCBIN "maps/WarehouseEntrance.blk"
+; 0xaddb4
+
+UndergroundPathSwitchRoomEntrances_BlockData: ; 0xaddb4
+ INCBIN "maps/UndergroundPathSwitchRoomEntrances.blk"
+; 0xadec2
+
+GoldenrodDeptStoreB1F_BlockData: ; 0xadec2
+ INCBIN "maps/GoldenrodDeptStoreB1F.blk"
+; 0xadf1c
+
+UndergroundWarehouse_BlockData: ; 0xadf1c
+ INCBIN "maps/UndergroundWarehouse.blk"
+; 0xadf76
+
+BetaElevator_BlockData: ; 0xadf76
+ INCBIN "maps/BetaElevator.blk"
+; 0xadf8f
+
+TinTower1F_BlockData: ; 0xadf8f
+ INCBIN "maps/TinTower1F.blk"
+; 0xadfe9
+
+TinTower2F_BlockData: ; 0xadfe9
+ INCBIN "maps/TinTower2F.blk"
+; 0xae043
+
+TinTower3F_BlockData: ; 0xae043
+ INCBIN "maps/TinTower3F.blk"
+; 0xae09d
+
+TinTower4F_BlockData: ; 0xae09d
+ INCBIN "maps/TinTower4F.blk"
+; 0xae0f7
+
+TinTower5F_BlockData: ; 0xae0f7
+ INCBIN "maps/TinTower5F.blk"
+; 0xae151
+
+TinTower6F_BlockData: ; 0xae151
+ INCBIN "maps/TinTower6F.blk"
+; 0xae1ab
+
+TinTower7F_BlockData: ; 0xae1ab
+ INCBIN "maps/TinTower7F.blk"
+; 0xae205
+
+TinTower8F_BlockData: ; 0xae205
+ INCBIN "maps/TinTower8F.blk"
+; 0xae25f
+
+TinTower9F_BlockData: ; 0xae25f
+ INCBIN "maps/TinTower9F.blk"
+; 0xae2b9
+
+TinTowerRoof_BlockData: ; 0xae2b9
+ INCBIN "maps/TinTowerRoof.blk"
+; 0xae313
+
+BurnedTower1F_BlockData: ; 0xae313
+ INCBIN "maps/BurnedTower1F.blk"
+; 0xae36d
+
+BurnedTowerB1F_BlockData: ; 0xae36d
+ INCBIN "maps/BurnedTowerB1F.blk"
+; 0xae3c7
+
+BetaCaveTestMap_BlockData: ; 0xae3c7
+ INCBIN "maps/BetaCaveTestMap.blk"
+; 0xae4d5
+
+MountMortar1FOutside_BlockData: ; 0xae4d5
+ INCBIN "maps/MountMortar1FOutside.blk"
+; 0xae63d
+
+MountMortar1FInside_BlockData: ; 0xae63d
+ INCBIN "maps/MountMortar1FInside.blk"
+; 0xae859
+
+MountMortar2FInside_BlockData: ; 0xae859
+ INCBIN "maps/MountMortar2FInside.blk"
+; 0xae9c1
+
+MountMortarB1F_BlockData: ; 0xae9c1
+ INCBIN "maps/MountMortarB1F.blk"
+; 0xaeb29
+
+IcePath1F_BlockData: ; 0xaeb29
+ INCBIN "maps/IcePath1F.blk"
+; 0xaec91
+
+IcePathB1F_BlockData: ; 0xaec91
+ INCBIN "maps/IcePathB1F.blk"
+; 0xaed45
+
+IcePathB2FMahoganySide_BlockData: ; 0xaed45
+ INCBIN "maps/IcePathB2FMahoganySide.blk"
+; 0xaed9f
+
+IcePathB2FBlackthornSide_BlockData: ; 0xaed9f
+ INCBIN "maps/IcePathB2FBlackthornSide.blk"
+; 0xaedcc
+
+IcePathB3F_BlockData: ; 0xaedcc
+ INCBIN "maps/IcePathB3F.blk"
+; 0xaee26
+
+WhirlIslandNW_BlockData: ; 0xaee26
+ INCBIN "maps/WhirlIslandNW.blk"
+; 0xaee53
+
+WhirlIslandNE_BlockData: ; 0xaee53
+ INCBIN "maps/WhirlIslandNE.blk"
+; 0xaeead
+
+WhirlIslandSW_BlockData: ; 0xaeead
+ INCBIN "maps/WhirlIslandSW.blk"
+; 0xaef07
+
+WhirlIslandCave_BlockData: ; 0xaef07
+ INCBIN "maps/WhirlIslandCave.blk"
+; 0xaef34
+
+WhirlIslandSE_BlockData: ; 0xaef34
+ INCBIN "maps/WhirlIslandSE.blk"
+; 0xaef61
+
+WhirlIslandB1F_BlockData: ; 0xaef61
+ INCBIN "maps/WhirlIslandB1F.blk"
+; 0xaf0c9
+
+WhirlIslandB2F_BlockData: ; 0xaf0c9
+ INCBIN "maps/WhirlIslandB2F.blk"
+; 0xaf17d
+
+WhirlIslandLugiaChamber_BlockData: ; 0xaf17d
+ INCBIN "maps/WhirlIslandLugiaChamber.blk"
+; 0xaf1d7
+
+SilverCaveRoom1_BlockData: ; 0xaf1d7
+ INCBIN "maps/SilverCaveRoom1.blk"
+; 0xaf28b
+
+SilverCaveRoom2_BlockData: ; 0xaf28b
+ INCBIN "maps/SilverCaveRoom2.blk"
+; 0xaf399
+
+SilverCaveRoom3_BlockData: ; 0xaf399
+ INCBIN "maps/SilverCaveRoom3.blk"
+; 0xaf44d
+
+BetaRocketHideout1_BlockData: ; 0xaf44d
+ INCBIN "maps/BetaRocketHideout1.blk"
+; 0xaf55b
+
+BetaRocketHideout2_BlockData: ; 0xaf55b
+ INCBIN "maps/BetaRocketHideout2.blk"
+; 0xaf669
+
+BetaEmptyHouse_BlockData: ; 0xaf669
+ INCBIN "maps/BetaEmptyHouse.blk"
+; 0xaf777
+
+BetaRocketHideout3_BlockData: ; 0xaf777
+ INCBIN "maps/BetaRocketHideout3.blk"
+; 0xaf885
+
+MahoganyMart1F_BlockData: ; 0xaf885
+ INCBIN "maps/MahoganyMart1F.blk"
+; 0xaf895
+
+TeamRocketBaseB1F_BlockData: ; 0xaf895
+ INCBIN "maps/TeamRocketBaseB1F.blk"
+; 0xaf91c
+
+TeamRocketBaseB2F_BlockData: ; 0xaf91c
+ INCBIN "maps/TeamRocketBaseB2F.blk"
+; 0xaf9a3
+
+TeamRocketBaseB3F_BlockData: ; 0xaf9a3
+ INCBIN "maps/TeamRocketBaseB3F.blk"
+; 0xafa2a
+
+BetaRoute23EarlyVersion_BlockData: ; 0xafa2a
+ INCBIN "maps/BetaRoute23EarlyVersion.blk"
+; 0xafa84
+
+IndigoPlateauPokeCenter1F_BlockData: ; 0xafa84
+ INCBIN "maps/IndigoPlateauPokeCenter1F.blk"
+; 0xafac3
+
+WillsRoom_BlockData: ; 0xafac3
+ INCBIN "maps/WillsRoom.blk"
+; 0xafaf0
+
+KogasRoom_BlockData: ; 0xafaf0
+ INCBIN "maps/KogasRoom.blk"
+; 0xafb1d
+
+BrunosRoom_BlockData: ; 0xafb1d
+ INCBIN "maps/BrunosRoom.blk"
+; 0xafb4a
+
+KarensRoom_BlockData: ; 0xafb4a
+ INCBIN "maps/KarensRoom.blk"
+; 0xafb77
+
+AzaleaGym_BlockData: ; 0xafb77
+ INCBIN "maps/AzaleaGym.blk"
+; 0xafb9f
+
+VioletGym_BlockData: ; 0xafb9f
+ INCBIN "maps/VioletGym.blk"
+; 0xafbc7
+
+GoldenrodGym_BlockData: ; 0xafbc7
+ INCBIN "maps/GoldenrodGym.blk"
+; 0xafc21
+
+EcruteakGym_BlockData: ; 0xafc21
+ INCBIN "maps/EcruteakGym.blk"
+; 0xafc4e
+
+MahoganyGym_BlockData: ; 0xafc4e
+ INCBIN "maps/MahoganyGym.blk"
+; 0xafc7b
+
+OlivineGym_BlockData: ; 0xafc7b
+ INCBIN "maps/OlivineGym.blk"
+; 0xafca3
+
+BetaUnknown_BlockData: ; 0xafca3
+ INCBIN "maps/BetaUnknown.blk"
+; 0xafcb7
+
+CianwoodGym_BlockData: ; 0xafcb7
+ INCBIN "maps/CianwoodGym.blk"
+; 0xafce4
+
+BlackthornGym1F_BlockData: ; 0xafce4
+ INCBIN "maps/BlackthornGym1F.blk"
+; 0xafd11
+
+BlackthornGym2F_BlockData: ; 0xafd11
+ INCBIN "maps/BlackthornGym2F.blk"
+; 0xafd3e
+
+OlivineLighthouse1F_BlockData: ; 0xafd3e
+ INCBIN "maps/OlivineLighthouse1F.blk"
+; 0xafd98
+
+OlivineLighthouse2F_BlockData: ; 0xafd98
+ INCBIN "maps/OlivineLighthouse2F.blk"
+; 0xafdf2
+
+OlivineLighthouse3F_BlockData: ; 0xafdf2
+ INCBIN "maps/OlivineLighthouse3F.blk"
+; 0xafe4c
+
+OlivineLighthouse4F_BlockData: ; 0xafe4c
+ INCBIN "maps/OlivineLighthouse4F.blk"
+; 0xafea6
+
+OlivineLighthouse5F_BlockData: ; 0xafea6
+ INCBIN "maps/OlivineLighthouse5F.blk"
+; 0xaff00
+
+OlivineLighthouse6F_BlockData: ; 0xaff00
+ INCBIN "maps/OlivineLighthouse6F.blk"
+; 0xaff5a
+
--- /dev/null
+++ b/maps/blockdata_3.asm
@@ -1,0 +1,348 @@
+BetaCave2_BlockData: ; 0xb0000
+ INCBIN "maps/BetaCave2.blk"
+; 0xb0023
+
+SlowpokeWellB1F_BlockData: ; 0xb0023
+ INCBIN "maps/SlowpokeWellB1F.blk"
+; 0xb007d
+
+SlowpokeWellB2F_BlockData: ; 0xb007d
+ INCBIN "maps/SlowpokeWellB2F.blk"
+; 0xb00d7
+
+IlexForest_BlockData: ; 0xb00d7
+ INCBIN "maps/IlexForest.blk"
+; 0xb026c
+
+DarkCaveVioletEntrance_BlockData: ; 0xb026c
+ INCBIN "maps/DarkCaveVioletEntrance.blk"
+; 0xb03d4
+
+DarkCaveBlackthornEntrance_BlockData: ; 0xb03d4
+ INCBIN "maps/DarkCaveBlackthornEntrance.blk"
+; 0xb04e2
+
+RuinsofAlphResearchCenter_BlockData: ; 0xb04e2
+ INCBIN "maps/RuinsofAlphResearchCenter.blk"
+; 0xb04f2
+
+GoldenrodBikeShop_BlockData: ; 0xb04f2
+ INCBIN "maps/GoldenrodBikeShop.blk"
+; 0xb0502
+
+DanceTheatre_BlockData: ; 0xb0502
+ INCBIN "maps/DanceTheatre.blk"
+; 0xb052c
+
+EcruteakHouse_BlockData: ; 0xb052c
+ INCBIN "maps/EcruteakHouse.blk"
+; 0xb0586
+
+GoldenrodGameCorner_BlockData: ; 0xb0586
+ INCBIN "maps/GoldenrodGameCorner.blk"
+; 0xb05cc
+
+Route35NationalParkgate_BlockData: ; 0xb05cc
+ INCBIN "maps/Route35NationalParkgate.blk"
+; 0xb05dc
+
+Route36NationalParkgate_BlockData: ; 0xb05dc
+ INCBIN "maps/Route36NationalParkgate.blk"
+; 0xb05f0
+
+FastShip1F_BlockData: ; 0xb05f0
+ INCBIN "maps/FastShip1F.blk"
+; 0xb0680
+
+FastShipB1F_BlockData: ; 0xb0680
+ INCBIN "maps/FastShipB1F.blk"
+; 0xb0700
+
+BetaSsAquaInsideCutOut_BlockData: ; 0xb0700
+ INCBIN "maps/BetaSsAquaInsideCutOut.blk"
+; 0xb0710
+
+FastShipCabins_NNW_NNE_NE_BlockData: ; 0xb0710
+ INCBIN "maps/FastShipCabins_NNW_NNE_NE.blk"
+; 0xb0750
+
+FastShipCabins_SW_SSW_NW_BlockData: ; 0xb0750
+ INCBIN "maps/FastShipCabins_SW_SSW_NW.blk"
+; 0xb0790
+
+FastShipCabins_SE_SSE_CaptainsCabin_BlockData: ; 0xb0790
+ INCBIN "maps/FastShipCabins_SE_SSE_CaptainsCabin.blk"
+; 0xb07e5
+
+OlivinePort_BlockData: ; 0xb07e5
+ INCBIN "maps/OlivinePort.blk"
+; 0xb0899
+
+VermilionPort_BlockData: ; 0xb0899
+ INCBIN "maps/VermilionPort.blk"
+; 0xb094d
+
+OlivineCafe_BlockData: ; 0xb094d
+ INCBIN "maps/OlivineCafe.blk"
+; 0xb095d
+
+KrissHouse2F_BlockData: ; 0xb095d
+ INCBIN "maps/KrissHouse2F.blk"
+; 0xb0969
+
+SaffronTrainStation_BlockData: ; 0xb0969
+ INCBIN "maps/SaffronTrainStation.blk"
+; 0xb09c3
+
+CeruleanGym_BlockData: ; 0xb09c3
+ INCBIN "maps/CeruleanGym.blk"
+; 0xb09eb
+
+VermilionGym_BlockData: ; 0xb09eb
+ INCBIN "maps/VermilionGym.blk"
+; 0xb0a18
+
+SaffronGym_BlockData: ; 0xb0a18
+ INCBIN "maps/SaffronGym.blk"
+; 0xb0a72
+
+PowerPlant_BlockData: ; 0xb0a72
+ INCBIN "maps/PowerPlant.blk"
+; 0xb0acc
+
+PokemonFanClub_BlockData: ; 0xb0acc
+ INCBIN "maps/PokemonFanClub.blk"
+; 0xb0ae0
+
+FightingDojo_BlockData: ; 0xb0ae0
+ INCBIN "maps/FightingDojo.blk"
+; 0xb0afe
+
+SilphCo1F_BlockData: ; 0xb0afe
+ INCBIN "maps/SilphCo1F.blk"
+; 0xb0b1e
+
+ViridianGym_BlockData: ; 0xb0b1e
+ INCBIN "maps/ViridianGym.blk"
+; 0xb0b4b
+
+TrainerHouse1F_BlockData: ; 0xb0b4b
+ INCBIN "maps/TrainerHouse1F.blk"
+; 0xb0b6e
+
+TrainerHouseB1F_BlockData: ; 0xb0b6e
+ INCBIN "maps/TrainerHouseB1F.blk"
+; 0xb0b96
+
+RedsHouse1F_BlockData: ; 0xb0b96
+ INCBIN "maps/RedsHouse1F.blk"
+; 0xb0ba6
+
+RedsHouse2F_BlockData: ; 0xb0ba6
+ INCBIN "maps/RedsHouse2F.blk"
+; 0xb0bb6
+
+OaksLab_BlockData: ; 0xb0bb6
+ INCBIN "maps/OaksLab.blk"
+; 0xb0bd4
+
+MrFujisHouse_BlockData: ; 0xb0bd4
+ INCBIN "maps/MrFujisHouse.blk"
+; 0xb0be8
+
+LavRadioTower1F_BlockData: ; 0xb0be8
+ INCBIN "maps/LavRadioTower1F.blk"
+; 0xb0c10
+
+SilverCaveItemRooms_BlockData: ; 0xb0c10
+ INCBIN "maps/SilverCaveItemRooms.blk"
+; 0xb0c6a
+
+DayCare_BlockData: ; 0xb0c6a
+ INCBIN "maps/DayCare.blk"
+; 0xb0c7e
+
+SoulHouse_BlockData: ; 0xb0c7e
+ INCBIN "maps/SoulHouse.blk"
+; 0xb0c92
+
+PewterGym_BlockData: ; 0xb0c92
+ INCBIN "maps/PewterGym.blk"
+; 0xb0cb5
+
+CeladonGym_BlockData: ; 0xb0cb5
+ INCBIN "maps/CeladonGym.blk"
+; 0xb0ce2
+
+BetaHouse2_BlockData: ; 0xb0ce2
+ INCBIN "maps/BetaHouse2.blk"
+; 0xb0cf6
+
+CeladonCafe_BlockData: ; 0xb0cf6
+ INCBIN "maps/CeladonCafe.blk"
+; 0xb0d0e
+
+BetaCeladonMansion_BlockData: ; 0xb0d0e
+ INCBIN "maps/BetaCeladonMansion.blk"
+; 0xb0d26
+
+RockTunnel1F_BlockData: ; 0xb0d26
+ INCBIN "maps/RockTunnel1F.blk"
+; 0xb0e34
+
+RockTunnelB1F_BlockData: ; 0xb0e34
+ INCBIN "maps/RockTunnelB1F.blk"
+; 0xb0f42
+
+DiglettsCave_BlockData: ; 0xb0f42
+ INCBIN "maps/DiglettsCave.blk"
+; 0xb0ff6
+
+MountMoon_BlockData: ; 0xb0ff6
+ INCBIN "maps/MountMoon.blk"
+; 0xb107d
+
+SeafoamGym_BlockData: ; 0xb107d
+ INCBIN "maps/SeafoamGym.blk"
+; 0xb1091
+
+MrPokemonsHouse_BlockData: ; 0xb1091
+ INCBIN "maps/MrPokemonsHouse.blk"
+; 0xb10a1
+
+VictoryRoadGate_BlockData: ; 0xb10a1
+ INCBIN "maps/VictoryRoadGate.blk"
+; 0xb10fb
+
+OlivinePortPassage_BlockData: ; 0xb10fb
+ INCBIN "maps/OlivinePortPassage.blk"
+; 0xb1155
+
+FuchsiaGym_BlockData: ; 0xb1155
+ INCBIN "maps/FuchsiaGym.blk"
+; 0xb1182
+
+SafariZoneBeta_BlockData: ; 0xb1182
+ INCBIN "maps/SafariZoneBeta.blk"
+; 0xb1236
+
+Underground_BlockData: ; 0xb1236
+ INCBIN "maps/Underground.blk"
+; 0xb1260
+
+Route39Barn_BlockData: ; 0xb1260
+ INCBIN "maps/Route39Barn.blk"
+; 0xb1270
+
+VictoryRoad_BlockData: ; 0xb1270
+ INCBIN "maps/VictoryRoad.blk"
+; 0xb13d8
+
+Route23_BlockData: ; 0xb13d8
+ INCBIN "maps/Route23.blk"
+; 0xb1432
+
+LancesRoom_BlockData: ; 0xb1432
+ INCBIN "maps/LancesRoom.blk"
+; 0xb146e
+
+HallOfFame_BlockData: ; 0xb146e
+ INCBIN "maps/HallOfFame.blk"
+; 0xb1491
+
+CopycatsHouse1F_BlockData: ; 0xb1491
+ INCBIN "maps/CopycatsHouse1F.blk"
+; 0xb14a1
+
+CopycatsHouse2F_BlockData: ; 0xb14a1
+ INCBIN "maps/CopycatsHouse2F.blk"
+; 0xb14b0
+
+GoldenrodFlowerShop_BlockData: ; 0xb14b0
+ INCBIN "maps/GoldenrodFlowerShop.blk"
+; 0xb14c0
+
+MountMoonSquare_BlockData: ; 0xb14c0
+ INCBIN "maps/MountMoonSquare.blk"
+; 0xb1547
+
+WiseTriosRoom_BlockData: ; 0xb1547
+ INCBIN "maps/WiseTriosRoom.blk"
+; 0xb1557
+
+DragonsDen1F_BlockData: ; 0xb1557
+ INCBIN "maps/DragonsDen1F.blk"
+; 0xb1584
+
+DragonsDenB1F_BlockData: ; 0xb1584
+ INCBIN "maps/DragonsDenB1F.blk"
+; 0xb16ec
+
+TohjoFalls_BlockData: ; 0xb16ec
+ INCBIN "maps/TohjoFalls.blk"
+; 0xb1773
+
+RuinsofAlphHoOhItemRoom_BlockData: ; 0xb1773
+ INCBIN "maps/RuinsofAlphHoOhItemRoom.blk"
+; 0xb1787
+
+RuinsofAlphHoOhWordRoom_BlockData: ; 0xb1787
+ INCBIN "maps/RuinsofAlphHoOhWordRoom.blk"
+; 0xb17ff
+
+RuinsofAlphKabutoWordRoom_BlockData: ; 0xb17ff
+ INCBIN "maps/RuinsofAlphKabutoWordRoom.blk"
+; 0xb1845
+
+RuinsofAlphOmanyteWordRoom_BlockData: ; 0xb1845
+ INCBIN "maps/RuinsofAlphOmanyteWordRoom.blk"
+; 0xb1895
+
+RuinsofAlphAerodactylWordRoom_BlockData: ; 0xb1895
+ INCBIN "maps/RuinsofAlphAerodactylWordRoom.blk"
+; 0xb18db
+
+DragonShrine_BlockData: ; 0xb18db
+ INCBIN "maps/DragonShrine.blk"
+; 0xb18f4
+
+BattleTower1F_BlockData: ; 0xb18f4
+ INCBIN "maps/BattleTower1F.blk"
+; 0xb191c
+
+BattleTowerBattleRoom_BlockData: ; 0xb191c
+ INCBIN "maps/BattleTowerBattleRoom.blk"
+; 0xb192c
+
+GoldenrodPokeComCenter2FMobile_BlockData: ; 0xb192c
+ INCBIN "maps/GoldenrodPokeComCenter2FMobile.blk"
+; 0xb1a2c
+
+MobileTradeRoomMobile_BlockData: ; 0xb1a2c
+ INCBIN "maps/MobileTradeRoomMobile.blk"
+; 0xb1a40
+
+MobileBattleRoom_BlockData: ; 0xb1a40
+ INCBIN "maps/MobileBattleRoom.blk"
+; 0xb1a54
+
+BattleTowerHallway_BlockData: ; 0xb1a54
+ INCBIN "maps/BattleTowerHallway.blk"
+; 0xb1a6a
+
+BattleTowerElevator_BlockData: ; 0xb1a6a
+ INCBIN "maps/BattleTowerElevator.blk"
+; 0xb1a6e
+
+BattleTowerOutside_BlockData: ; 0xb1a6e
+ INCBIN "maps/BattleTowerOutside.blk"
+; 0xb1afa
+
+BetaBlank_BlockData: ; 0xb1afa
+ INCBIN "maps/BetaBlank.blk"
+; 0xb1b22
+
+GoldenrodDeptStoreRoof_BlockData: ; 0xb1b22
+ INCBIN "maps/GoldenrodDeptStoreRoof.blk"
+; 0xb1b42
+
--- /dev/null
+++ b/rst.asm
@@ -1,0 +1,38 @@
+; rst vectors
+
+SECTION "rst0",ROM0[0]
+ di
+ jp Start
+
+SECTION "rst8",ROM0[FarCall]
+ jp FarCall_hl
+
+SECTION "rst10",ROM0[Bankswitch]
+ ld [hROMBank], a
+ ld [MBC3RomBank], a
+ ret
+
+SECTION "rst18",ROM0[$18]
+ rst $38
+
+SECTION "rst20",ROM0[$20]
+ rst $38
+
+SECTION "rst28",ROM0[JumpTable]
+ push de
+ ld e, a
+ ld d, 0
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ pop de
+ jp [hl]
+
+; SECTION "rst30",ROM0[$30]
+; rst30 is midst rst28
+
+SECTION "rst38",ROM0[$38]
+ rst $38
+
--- /dev/null
+++ b/tilesets/data_1.asm
@@ -1,0 +1,51 @@
+Tileset03GFX: ; 0x18000
+INCBIN "gfx/tilesets/03.lz"
+; 0x18606
+
+Tileset03Meta: ; 0x18606
+INCBIN "tilesets/03_metatiles.bin"
+; 0x18e06
+
+Tileset03Coll: ; 0x18e06
+INCBIN "tilesets/03_collision.bin"
+; 0x19006
+
+Tileset00GFX: ; 0x19006
+Tileset01GFX: ; 0x19006
+INCBIN "gfx/tilesets/01.lz"
+; 0x19c0e
+
+Tileset00Meta: ; 0x19c0e
+Tileset01Meta: ; 0x19c0e
+INCBIN "tilesets/01_metatiles.bin"
+; 0x1a40e
+
+Tileset00Coll: ; 0x1a40e
+Tileset01Coll: ; 0x1a40e
+INCBIN "tilesets/01_collision.bin"
+; 0x1a60e
+
+Tileset29GFX: ; 0x1a60e
+INCBIN "gfx/tilesets/29.lz"
+; 0x1af3e
+
+Tileset29Meta: ; 0x1af3e
+INCBIN "tilesets/29_metatiles.bin"
+; 0x1b33e
+
+Tileset29Coll: ; 0x1b33e
+INCBIN "tilesets/29_collision.bin"
+; 0x1b43e
+
+Tileset20GFX: ; 0x1b43e
+INCBIN "gfx/tilesets/20.lz"
+; 0x1b8fe
+
+Tileset20Meta: ; 0x1b8fe
+INCBIN "tilesets/20_metatiles.bin"
+; 0x1bcfe
+
+Tileset20Coll: ; 0x1bcfe
+INCBIN "tilesets/20_collision.bin"
+; 0x1bdfe
+
--- /dev/null
+++ b/tilesets/data_2.asm
@@ -1,0 +1,62 @@
+Tileset07GFX: ; 0x1c30c
+INCBIN "gfx/tilesets/07.lz"
+; 0x1c73c
+
+Tileset07Meta: ; 0x1c73c
+INCBIN "tilesets/07_metatiles.bin"
+; 0x1cb3c
+
+Tileset07Coll: ; 0x1cb3c
+INCBIN "tilesets/07_collision.bin"
+; 0x1cc3c
+
+Tileset09GFX: ; 0x1cc3c
+INCBIN "gfx/tilesets/09.lz"
+; 0x1d04c
+
+Tileset09Meta: ; 0x1d04c
+INCBIN "tilesets/09_metatiles.bin"
+; 0x1d44c
+
+Tileset09Coll: ; 0x1d44c
+INCBIN "tilesets/09_collision.bin"
+; 0x1d54c
+
+Tileset06GFX: ; 0x1d54c
+INCBIN "gfx/tilesets/06.lz"
+; 0x1d92c
+
+Tileset06Meta: ; 0x1d92c
+INCBIN "tilesets/06_metatiles.bin"
+; 0x1dd2c
+
+Tileset06Coll: ; 0x1dd2c
+INCBIN "tilesets/06_collision.bin"
+; 0x1de2c
+
+Tileset13GFX: ; 0x1de2c
+INCBIN "gfx/tilesets/13.lz"
+; 0x1e58c
+
+Tileset13Meta: ; 0x1e58c
+INCBIN "tilesets/13_metatiles.bin"
+; 0x1e98c
+
+Tileset13Coll: ; 0x1e98c
+INCBIN "tilesets/13_collision.bin"
+; 0x1ea8c
+
+Tileset24GFX: ; 0x1ea8c
+INCBIN "gfx/tilesets/24.lz"
+; 0x1ee1c
+
+Tileset24Meta: ; 0x1ee1c
+Tileset30Meta: ; 0x1ee1c
+INCBIN "tilesets/30_metatiles.bin"
+; 0x1f21c
+
+Tileset24Coll: ; 0x1f21c
+Tileset30Coll: ; 0x1f21c
+INCBIN "tilesets/30_collision.bin"
+; 0x1f31c
+
--- /dev/null
+++ b/tilesets/data_3.asm
@@ -1,0 +1,65 @@
+Tileset23GFX: ; 0x20181
+INCBIN "gfx/tilesets/23.lz"
+; 0x206e1
+
+Tileset23Meta: ; 0x206e1
+INCBIN "tilesets/23_metatiles.bin"
+; 0x20ae1
+
+Tileset23Coll: ; 0x20ae1
+INCBIN "tilesets/23_collision.bin"
+; 0x20be1
+
+Tileset10GFX: ; 0x20be1
+INCBIN "gfx/tilesets/10.lz"
+; 0x213e1
+
+Tileset10Meta: ; 0x213e1
+INCBIN "tilesets/10_metatiles.bin"
+; 0x217e1
+
+Tileset10Coll: ; 0x217e1
+INCBIN "tilesets/10_collision.bin"
+; 0x218e1
+
+Tileset12GFX: ; 0x218e1
+INCBIN "gfx/tilesets/12.lz"
+; 0x22031
+
+Tileset12Meta: ; 0x22031
+INCBIN "tilesets/12_metatiles.bin"
+; 0x22431
+
+Tileset12Coll: ; 0x22431
+INCBIN "tilesets/12_collision.bin"
+; 0x22531
+
+Tileset14GFX: ; 0x22531
+INCBIN "gfx/tilesets/14.lz"
+; 0x22af1
+
+Tileset14Meta: ; 0x22af1
+INCBIN "tilesets/14_metatiles.bin"
+; 0x22ef1
+
+Tileset14Coll: ; 0x22ef1
+INCBIN "tilesets/14_collision.bin"
+; 0x22ff1
+
+Tileset17GFX: ; 0x22ff1
+INCBIN "gfx/tilesets/17.lz"
+; 0x23391
+
+Tileset17Meta: ; 0x23391
+INCBIN "tilesets/17_metatiles.bin"
+; 0x23791
+
+Tileset17Coll: ; 0x23791
+INCBIN "tilesets/17_collision.bin"
+; 0x23891
+
+; todo
+Tileset31Meta: ; 0x23891
+INCBIN "tilesets/31_metatiles.bin"
+; 0x23b11
+
--- /dev/null
+++ b/tilesets/data_4.asm
@@ -1,0 +1,52 @@
+Tileset15GFX: ; 0x30000
+INCBIN "gfx/tilesets/15.lz"
+; 0x304e0
+
+Tileset15Meta: ; 0x304e0
+INCBIN "tilesets/15_metatiles.bin"
+; 0x308e0
+
+Tileset15Coll: ; 0x308e0
+INCBIN "tilesets/15_collision.bin"
+; 0x309e0
+
+Tileset25GFX: ; 0x309e0
+INCBIN "gfx/tilesets/25.lz"
+; 0x30e80
+
+Tileset25Meta: ; 0x30e80
+INCBIN "tilesets/25_metatiles.bin"
+; 0x31280
+
+Tileset25Coll: ; 0x31280
+INCBIN "tilesets/25_collision.bin"
+; 0x31380
+
+Tileset27GFX: ; 0x31380
+INCBIN "gfx/tilesets/27.lz"
+; 0x318e0
+
+Tileset27Meta: ; 0x318e0
+INCBIN "tilesets/27_metatiles.bin"
+; 0x31ce0
+
+Tileset27Coll: ; 0x31ce0
+INCBIN "tilesets/27_collision.bin"
+; 0x31de0
+
+Tileset28GFX: ; 0x31de0
+INCBIN "gfx/tilesets/28.lz"
+; 0x321b0
+
+Tileset28Meta: ; 0x321b0
+INCBIN "tilesets/28_metatiles.bin"
+; 0x325b0
+
+Tileset28Coll: ; 0x325b0
+INCBIN "tilesets/28_collision.bin"
+; 0x326b0
+
+Tileset30GFX: ; 0x326b0
+INCBIN "gfx/tilesets/30.lz"
+; 0x329f0
+
--- /dev/null
+++ b/tilesets/data_5.asm
@@ -1,0 +1,61 @@
+Tileset21GFX: ; 0xb4000
+INCBIN "gfx/tilesets/21.lz"
+; 0xb48a0
+
+Tileset21Meta: ; 0xb48a0
+INCBIN "tilesets/21_metatiles.bin"
+; 0xb4ca0
+
+Tileset21Coll: ; 0xb4ca0
+INCBIN "tilesets/21_collision.bin"
+; 0xb4da0
+
+Tileset22GFX: ; 0xb4da0
+INCBIN "gfx/tilesets/22.lz"
+; 0xb50e0
+
+Tileset22Meta: ; 0xb50e0
+INCBIN "tilesets/22_metatiles.bin"
+; 0xb54e0
+
+Tileset22Coll: ; 0xb54e0
+INCBIN "tilesets/22_collision.bin"
+; 0xb55e0
+
+Tileset08GFX: ; 0xb55e0
+INCBIN "gfx/tilesets/08.lz"
+; 0xb59e0
+
+Tileset08Meta: ; 0xb59e0
+INCBIN "tilesets/08_metatiles.bin"
+; 0xb5de0
+
+Tileset08Coll: ; 0xb5de0
+INCBIN "tilesets/08_collision.bin"
+; 0xb5ee0
+
+Tileset02GFX: ; 0xb5ee0
+Tileset04GFX: ; 0xb5ee0
+INCBIN "gfx/tilesets/04.lz"
+; 0xb6ae8
+
+Tileset02Meta: ; 0xb6ae8
+INCBIN "tilesets/02_metatiles.bin"
+; 0xb72e8
+
+Tileset02Coll: ; 0xb72e8
+INCBIN "tilesets/02_collision.bin"
+; 0xb74e8
+
+Tileset16GFX: ; 0xb74e8
+INCBIN "gfx/tilesets/16.lz"
+; 0xb79a8
+
+Tileset16Meta: ; 0xb79a8
+INCBIN "tilesets/16_metatiles.bin"
+; 0xb7da8
+
+Tileset16Coll: ; 0xb7da8
+INCBIN "tilesets/16_collision.bin"
+; 0xb7ea8
+
--- /dev/null
+++ b/tilesets/data_6.asm
@@ -1,0 +1,76 @@
+Tileset31GFX: ; 0xdc000
+INCBIN "gfx/tilesets/31.lz"
+; 0xdc3d0
+
+Tileset18GFX: ; 0xdc3d0
+INCBIN "gfx/tilesets/18.lz"
+; 0xdcc50
+
+Tileset18Meta: ; 0xdcc50
+INCBIN "tilesets/18_metatiles.bin"
+; 0xdd050
+
+Tileset18Coll: ; 0xdd050
+INCBIN "tilesets/18_collision.bin"
+; 0xdd150
+
+Tileset05GFX: ; 0xdd150
+INCBIN "gfx/tilesets/05.lz"
+; 0xdd600
+
+Tileset05Meta: ; 0xdd600
+INCBIN "tilesets/05_metatiles.bin"
+; 0xdda00
+
+Tileset05Coll: ; 0xdda00
+INCBIN "tilesets/05_collision.bin"
+; 0xddb00
+
+Tileset19GFX: ; 0xddb00
+INCBIN "gfx/tilesets/19.lz"
+; 0xddf70
+
+Tileset19Meta: ; 0xddf70
+INCBIN "tilesets/19_metatiles.bin"
+; 0xde370
+
+Tileset19Coll: ; 0xde370
+INCBIN "tilesets/19_collision.bin"
+; 0xde470
+
+Tileset31Coll: ; 0xde470
+INCBIN "tilesets/31_collision.bin"
+; 0xde570
+
+Tileset11GFX: ; 0xde570
+INCBIN "gfx/tilesets/11.lz"
+; 0xde990
+
+Tileset11Meta: ; 0xde990
+INCBIN "tilesets/11_metatiles.bin"
+; 0xded90
+
+Tileset11Coll: ; 0xded90
+INCBIN "tilesets/11_collision.bin"
+; 0xdee90
+
+Tileset04Meta: ; 0xdee90
+INCBIN "tilesets/04_metatiles.bin"
+; 0xdf690
+
+Tileset04Coll: ; 0xdf690
+INCBIN "tilesets/04_collision.bin"
+; 0xdf890
+
+Tileset32Meta: ; 0xdf890
+INCBIN "tilesets/32_metatiles.bin"
+; 0xdfc90
+
+Tileset32Coll: ; 0xdfc90
+Tileset33Coll: ; 0xdfc90
+Tileset34Coll: ; 0xdfc90
+Tileset35Coll: ; 0xdfc90
+Tileset36Coll: ; 0xdfc90
+INCBIN "tilesets/36_collision.bin"
+; 0xdfd90
+
--- /dev/null
+++ b/tilesets/data_7.asm
@@ -1,0 +1,17 @@
+Tileset26GFX: ; 0x1dc5a1
+Tileset32GFX: ; 0x1dc5a1
+Tileset33GFX: ; 0x1dc5a1
+Tileset34GFX: ; 0x1dc5a1
+Tileset35GFX: ; 0x1dc5a1
+Tileset36GFX: ; 0x1dc5a1
+INCBIN "gfx/tilesets/36.lz"
+; 0x1dd1a9
+
+Tileset26Meta: ; 0x1dd1a9
+INCBIN "tilesets/26_metatiles.bin"
+; 0x1dd5a9
+
+Tileset26Coll: ; 0x1dd5a9
+INCBIN "tilesets/26_collision.bin"
+; 0x1dd6a9
+
--- /dev/null
+++ b/tilesets/data_8.asm
@@ -1,0 +1,16 @@
+Tileset33Meta: ; 0x1e0000
+INCBIN "tilesets/33_metatiles.bin"
+; 0x1e0400
+
+Tileset34Meta: ; 0x1e0400
+INCBIN "tilesets/34_metatiles.bin"
+; 0x1e0800
+
+Tileset35Meta: ; 0x1e0800
+INCBIN "tilesets/35_metatiles.bin"
+; 0x1e0c00
+
+Tileset36Meta: ; 0x1e0c00
+INCBIN "tilesets/36_metatiles.bin"
+; 0x1e1000
+
--- /dev/null
+++ b/tilesets/palette_maps.asm
@@ -1,0 +1,129 @@
+Tileset03PalMap: ; 0x4c075
+INCBIN "tilesets/03_palette_map.bin"
+; 0x4c0e5
+
+Tileset00PalMap: ; 0x4c0e5
+Tileset01PalMap: ; 0x4c0e5
+INCBIN "tilesets/01_palette_map.bin"
+; 0x4c155
+
+Tileset02PalMap: ; 0x4c155
+INCBIN "tilesets/02_palette_map.bin"
+; 0x4c1c5
+
+Tileset05PalMap: ; 0x4c1c5
+INCBIN "tilesets/05_palette_map.bin"
+; 0x4c235
+
+Tileset06PalMap: ; 0x4c235
+INCBIN "tilesets/06_palette_map.bin"
+; 0x4c2a5
+
+Tileset07PalMap: ; 0x4c2a5
+INCBIN "tilesets/07_palette_map.bin"
+; 0x4c315
+
+Tileset08PalMap: ; 0x4c315
+INCBIN "tilesets/08_palette_map.bin"
+; 0x4c385
+
+Tileset09PalMap: ; 0x4c385
+INCBIN "tilesets/09_palette_map.bin"
+; 0x4c3f5
+
+Tileset10PalMap: ; 0x4c3f5
+INCBIN "tilesets/10_palette_map.bin"
+; 0x4c465
+
+Tileset11PalMap: ; 0x4c465
+INCBIN "tilesets/11_palette_map.bin"
+; 0x4c4d5
+
+Tileset12PalMap: ; 0x4c4d5
+INCBIN "tilesets/12_palette_map.bin"
+; 0x4c545
+
+Tileset13PalMap: ; 0x4c545
+INCBIN "tilesets/13_palette_map.bin"
+; 0x4c5b5
+
+Tileset14PalMap: ; 0x4c5b5
+INCBIN "tilesets/14_palette_map.bin"
+; 0x4c625
+
+Tileset15PalMap: ; 0x4c625
+INCBIN "tilesets/15_palette_map.bin"
+; 0x4c695
+
+Tileset16PalMap: ; 0x4c695
+INCBIN "tilesets/16_palette_map.bin"
+; 0x4c705
+
+Tileset23PalMap: ; 0x4c705
+INCBIN "tilesets/23_palette_map.bin"
+; 0x4c775
+
+Tileset24PalMap: ; 0x4c775
+Tileset30PalMap: ; 0x4c775
+INCBIN "tilesets/30_palette_map.bin"
+; 0x4c7e5
+
+Tileset25PalMap: ; 0x4c7e5
+INCBIN "tilesets/25_palette_map.bin"
+; 0x4c855
+
+Tileset26PalMap: ; 0x4c855
+Tileset32PalMap: ; 0x4c855
+Tileset33PalMap: ; 0x4c855
+Tileset34PalMap: ; 0x4c855
+Tileset35PalMap: ; 0x4c855
+Tileset36PalMap: ; 0x4c855
+INCBIN "tilesets/36_palette_map.bin"
+; 0x4c8c5
+
+Tileset27PalMap: ; 0x4c8c5
+INCBIN "tilesets/27_palette_map.bin"
+; 0x4c935
+
+Tileset17PalMap: ; 0x4c935
+INCBIN "tilesets/17_palette_map.bin"
+; 0x4c9a5
+
+Tileset28PalMap: ; 0x4c9a5
+INCBIN "tilesets/28_palette_map.bin"
+; 0x4ca15
+
+Tileset18PalMap: ; 0x4ca15
+INCBIN "tilesets/18_palette_map.bin"
+; 0x4ca85
+
+Tileset19PalMap: ; 0x4ca85
+INCBIN "tilesets/19_palette_map.bin"
+; 0x4caf5
+
+Tileset20PalMap: ; 0x4caf5
+INCBIN "tilesets/20_palette_map.bin"
+; 0x4cb65
+
+INCBIN "baserom.gbc", $4cb65, $4cbd5-$4cb65
+
+Tileset29PalMap: ; 0x4cbd5
+INCBIN "tilesets/29_palette_map.bin"
+; 0x4cc45
+
+Tileset31PalMap: ; 0x4cc45
+INCBIN "tilesets/31_palette_map.bin"
+; 0x4ccb5
+
+Tileset21PalMap: ; 0x4ccb5
+INCBIN "tilesets/21_palette_map.bin"
+; 0x4cd25
+
+Tileset22PalMap: ; 0x4cd25
+INCBIN "tilesets/22_palette_map.bin"
+; 0x4cd95
+
+Tileset04PalMap: ; 0x4cd95
+INCBIN "tilesets/04_palette_map.bin"
+; 0x4ce05
+
--- /dev/null
+++ b/tilesets/tileset_headers.asm
@@ -1,0 +1,298 @@
+Tileset00: ; 0x4d596
+ dbw BANK(Tileset00GFX), Tileset00GFX
+ dbw BANK(Tileset00Meta), Tileset00Meta
+ dbw BANK(Tileset00Coll), Tileset00Coll
+ dw Tileset00Anim
+ dw $0000
+ dw Tileset00PalMap
+
+Tileset01: ; 0x4d5a5
+ dbw BANK(Tileset01GFX), Tileset01GFX
+ dbw BANK(Tileset01Meta), Tileset01Meta
+ dbw BANK(Tileset01Coll), Tileset01Coll
+ dw Tileset01Anim
+ dw $0000
+ dw Tileset01PalMap
+
+Tileset02: ; 0x4d5b4
+ dbw BANK(Tileset02GFX), Tileset02GFX
+ dbw BANK(Tileset02Meta), Tileset02Meta
+ dbw BANK(Tileset02Coll), Tileset02Coll
+ dw Tileset02Anim
+ dw $0000
+ dw Tileset02PalMap
+
+Tileset03: ; 0x4d5c3
+ dbw BANK(Tileset03GFX), Tileset03GFX
+ dbw BANK(Tileset03Meta), Tileset03Meta
+ dbw BANK(Tileset03Coll), Tileset03Coll
+ dw Tileset03Anim
+ dw $0000
+ dw Tileset03PalMap
+
+Tileset04: ; 0x4d5d2
+ dbw BANK(Tileset04GFX), Tileset04GFX
+ dbw BANK(Tileset04Meta), Tileset04Meta
+ dbw BANK(Tileset04Coll), Tileset04Coll
+ dw Tileset04Anim
+ dw $0000
+ dw Tileset04PalMap
+
+Tileset05: ; 0x4d5e1
+ dbw BANK(Tileset05GFX), Tileset05GFX
+ dbw BANK(Tileset05Meta), Tileset05Meta
+ dbw BANK(Tileset05Coll), Tileset05Coll
+ dw Tileset05Anim
+ dw $0000
+ dw Tileset05PalMap
+
+Tileset06: ; 0x4d5f0
+ dbw BANK(Tileset06GFX), Tileset06GFX
+ dbw BANK(Tileset06Meta), Tileset06Meta
+ dbw BANK(Tileset06Coll), Tileset06Coll
+ dw Tileset06Anim
+ dw $0000
+ dw Tileset06PalMap
+
+Tileset07: ; 0x4d5ff
+ dbw BANK(Tileset07GFX), Tileset07GFX
+ dbw BANK(Tileset07Meta), Tileset07Meta
+ dbw BANK(Tileset07Coll), Tileset07Coll
+ dw Tileset07Anim
+ dw $0000
+ dw Tileset07PalMap
+
+Tileset08: ; 0x4d60e
+ dbw BANK(Tileset08GFX), Tileset08GFX
+ dbw BANK(Tileset08Meta), Tileset08Meta
+ dbw BANK(Tileset08Coll), Tileset08Coll
+ dw Tileset08Anim
+ dw $0000
+ dw Tileset08PalMap
+
+Tileset09: ; 0x4d61d
+ dbw BANK(Tileset09GFX), Tileset09GFX
+ dbw BANK(Tileset09Meta), Tileset09Meta
+ dbw BANK(Tileset09Coll), Tileset09Coll
+ dw Tileset09Anim
+ dw $0000
+ dw Tileset09PalMap
+
+Tileset10: ; 0x4d62c
+ dbw BANK(Tileset10GFX), Tileset10GFX
+ dbw BANK(Tileset10Meta), Tileset10Meta
+ dbw BANK(Tileset10Coll), Tileset10Coll
+ dw Tileset10Anim
+ dw $0000
+ dw Tileset10PalMap
+
+Tileset11: ; 0x4d63b
+ dbw BANK(Tileset11GFX), Tileset11GFX
+ dbw BANK(Tileset11Meta), Tileset11Meta
+ dbw BANK(Tileset11Coll), Tileset11Coll
+ dw Tileset11Anim
+ dw $0000
+ dw Tileset11PalMap
+
+Tileset12: ; 0x4d64a
+ dbw BANK(Tileset12GFX), Tileset12GFX
+ dbw BANK(Tileset12Meta), Tileset12Meta
+ dbw BANK(Tileset12Coll), Tileset12Coll
+ dw Tileset12Anim
+ dw $0000
+ dw Tileset12PalMap
+
+Tileset13: ; 0x4d659
+ dbw BANK(Tileset13GFX), Tileset13GFX
+ dbw BANK(Tileset13Meta), Tileset13Meta
+ dbw BANK(Tileset13Coll), Tileset13Coll
+ dw Tileset13Anim
+ dw $0000
+ dw Tileset13PalMap
+
+Tileset14: ; 0x4d668
+ dbw BANK(Tileset14GFX), Tileset14GFX
+ dbw BANK(Tileset14Meta), Tileset14Meta
+ dbw BANK(Tileset14Coll), Tileset14Coll
+ dw Tileset14Anim
+ dw $0000
+ dw Tileset14PalMap
+
+Tileset15: ; 0x4d677
+ dbw BANK(Tileset15GFX), Tileset15GFX
+ dbw BANK(Tileset15Meta), Tileset15Meta
+ dbw BANK(Tileset15Coll), Tileset15Coll
+ dw Tileset15Anim
+ dw $0000
+ dw Tileset15PalMap
+
+Tileset16: ; 0x4d686
+ dbw BANK(Tileset16GFX), Tileset16GFX
+ dbw BANK(Tileset16Meta), Tileset16Meta
+ dbw BANK(Tileset16Coll), Tileset16Coll
+ dw Tileset16Anim
+ dw $0000
+ dw Tileset16PalMap
+
+Tileset17: ; 0x4d695
+ dbw BANK(Tileset17GFX), Tileset17GFX
+ dbw BANK(Tileset17Meta), Tileset17Meta
+ dbw BANK(Tileset17Coll), Tileset17Coll
+ dw Tileset17Anim
+ dw $0000
+ dw Tileset17PalMap
+
+Tileset18: ; 0x4d6a4
+ dbw BANK(Tileset18GFX), Tileset18GFX
+ dbw BANK(Tileset18Meta), Tileset18Meta
+ dbw BANK(Tileset18Coll), Tileset18Coll
+ dw Tileset18Anim
+ dw $0000
+ dw Tileset18PalMap
+
+Tileset19: ; 0x4d6b3
+ dbw BANK(Tileset19GFX), Tileset19GFX
+ dbw BANK(Tileset19Meta), Tileset19Meta
+ dbw BANK(Tileset19Coll), Tileset19Coll
+ dw Tileset19Anim
+ dw $0000
+ dw Tileset19PalMap
+
+Tileset20: ; 0x4d6c2
+ dbw BANK(Tileset20GFX), Tileset20GFX
+ dbw BANK(Tileset20Meta), Tileset20Meta
+ dbw BANK(Tileset20Coll), Tileset20Coll
+ dw Tileset20Anim
+ dw $0000
+ dw Tileset20PalMap
+
+Tileset21: ; 0x4d6d1
+ dbw BANK(Tileset21GFX), Tileset21GFX
+ dbw BANK(Tileset21Meta), Tileset21Meta
+ dbw BANK(Tileset21Coll), Tileset21Coll
+ dw Tileset21Anim
+ dw $0000
+ dw Tileset21PalMap
+
+Tileset22: ; 0x4d6e0
+ dbw BANK(Tileset22GFX), Tileset22GFX
+ dbw BANK(Tileset22Meta), Tileset22Meta
+ dbw BANK(Tileset22Coll), Tileset22Coll
+ dw Tileset22Anim
+ dw $0000
+ dw Tileset22PalMap
+
+Tileset23: ; 0x4d6ef
+ dbw BANK(Tileset23GFX), Tileset23GFX
+ dbw BANK(Tileset23Meta), Tileset23Meta
+ dbw BANK(Tileset23Coll), Tileset23Coll
+ dw Tileset23Anim
+ dw $0000
+ dw Tileset23PalMap
+
+Tileset24: ; 0x4d6fe
+ dbw BANK(Tileset24GFX), Tileset24GFX
+ dbw BANK(Tileset24Meta), Tileset24Meta
+ dbw BANK(Tileset24Coll), Tileset24Coll
+ dw Tileset24Anim
+ dw $0000
+ dw Tileset24PalMap
+
+Tileset25: ; 0x4d70d
+ dbw BANK(Tileset25GFX), Tileset25GFX
+ dbw BANK(Tileset25Meta), Tileset25Meta
+ dbw BANK(Tileset25Coll), Tileset25Coll
+ dw Tileset25Anim
+ dw $0000
+ dw Tileset25PalMap
+
+Tileset26: ; 0x4d71c
+ dbw BANK(Tileset26GFX), Tileset26GFX
+ dbw BANK(Tileset26Meta), Tileset26Meta
+ dbw BANK(Tileset26Coll), Tileset26Coll
+ dw Tileset26Anim
+ dw $0000
+ dw Tileset26PalMap
+
+Tileset27: ; 0x4d72b
+ dbw BANK(Tileset27GFX), Tileset27GFX
+ dbw BANK(Tileset27Meta), Tileset27Meta
+ dbw BANK(Tileset27Coll), Tileset27Coll
+ dw Tileset27Anim
+ dw $0000
+ dw Tileset27PalMap
+
+Tileset28: ; 0x4d73a
+ dbw BANK(Tileset28GFX), Tileset28GFX
+ dbw BANK(Tileset28Meta), Tileset28Meta
+ dbw BANK(Tileset28Coll), Tileset28Coll
+ dw Tileset28Anim
+ dw $0000
+ dw Tileset28PalMap
+
+Tileset29: ; 0x4d749
+ dbw BANK(Tileset29GFX), Tileset29GFX
+ dbw BANK(Tileset29Meta), Tileset29Meta
+ dbw BANK(Tileset29Coll), Tileset29Coll
+ dw Tileset29Anim
+ dw $0000
+ dw Tileset29PalMap
+
+Tileset30: ; 0x4d758
+ dbw BANK(Tileset30GFX), Tileset30GFX
+ dbw BANK(Tileset30Meta), Tileset30Meta
+ dbw BANK(Tileset30Coll), Tileset30Coll
+ dw Tileset30Anim
+ dw $0000
+ dw Tileset30PalMap
+
+Tileset31: ; 0x4d767
+ dbw BANK(Tileset31GFX), Tileset31GFX
+ dbw BANK(Tileset31Meta), Tileset31Meta
+ dbw BANK(Tileset31Coll), Tileset31Coll
+ dw Tileset31Anim
+ dw $0000
+ dw Tileset31PalMap
+
+Tileset32: ; 0x4d776
+ dbw BANK(Tileset32GFX), Tileset32GFX
+ dbw BANK(Tileset32Meta), Tileset32Meta
+ dbw BANK(Tileset32Coll), Tileset32Coll
+ dw Tileset32Anim
+ dw $0000
+ dw Tileset32PalMap
+
+Tileset33: ; 0x4d785
+ dbw BANK(Tileset33GFX), Tileset33GFX
+ dbw BANK(Tileset33Meta), Tileset33Meta
+ dbw BANK(Tileset33Coll), Tileset33Coll
+ dw Tileset33Anim
+ dw $0000
+ dw Tileset33PalMap
+
+Tileset34: ; 0x4d794
+ dbw BANK(Tileset34GFX), Tileset34GFX
+ dbw BANK(Tileset34Meta), Tileset34Meta
+ dbw BANK(Tileset34Coll), Tileset34Coll
+ dw Tileset34Anim
+ dw $0000
+ dw Tileset34PalMap
+
+Tileset35: ; 0x4d7a3
+ dbw BANK(Tileset35GFX), Tileset35GFX
+ dbw BANK(Tileset35Meta), Tileset35Meta
+ dbw BANK(Tileset35Coll), Tileset35Coll
+ dw Tileset35Anim
+ dw $0000
+ dw Tileset35PalMap
+
+Tileset36: ; 0x4d7b2
+ dbw BANK(Tileset36GFX), Tileset36GFX
+ dbw BANK(Tileset36Meta), Tileset36Meta
+ dbw BANK(Tileset36Coll), Tileset36Coll
+ dw Tileset36Anim
+ dw $0000
+ dw Tileset36PalMap
+
+; 0x4d7c1
+
--- /dev/null
+++ b/trainers/dvs.asm
@@ -1,0 +1,93 @@
+GetTrainerDVs: ; 270c4
+; Return the DVs of OtherTrainerClass in bc
+
+ push hl
+ ld a, [OtherTrainerClass]
+ dec a
+ ld c, a
+ ld b, 0
+
+ ld hl, TrainerClassDVs
+ add hl, bc
+ add hl, bc
+
+ ld a, [hli]
+ ld b, a
+ ld c, [hl]
+
+ pop hl
+ ret
+; 270d6
+
+TrainerClassDVs: ; 270d6
+ ; Atk Spd
+ ; Def Spc
+ db $9A, $77 ; falkner
+ db $88, $88 ; bugsy
+ db $98, $88 ; whitney
+ db $98, $88 ; morty
+ db $98, $88 ; pryce
+ db $98, $88 ; jasmine
+ db $98, $88 ; chuck
+ db $7C, $DD ; clair
+ db $DD, $DD ; rival1
+ db $98, $88 ; pokemon prof
+ db $DC, $DD ; will
+ db $DC, $DD ; cal
+ db $DC, $DD ; bruno
+ db $7F, $DF ; karen
+ db $DC, $DD ; koga
+ db $DC, $DD ; champion
+ db $98, $88 ; brock
+ db $78, $88 ; misty
+ db $98, $88 ; lt surge
+ db $98, $88 ; scientist
+ db $78, $88 ; erika
+ db $98, $88 ; youngster
+ db $98, $88 ; schoolboy
+ db $98, $88 ; bird keeper
+ db $58, $88 ; lass
+ db $98, $88 ; janine
+ db $D8, $C8 ; cooltrainerm
+ db $7C, $C8 ; cooltrainerf
+ db $69, $C8 ; beauty
+ db $98, $88 ; pokemaniac
+ db $D8, $A8 ; gruntm
+ db $98, $88 ; gentleman
+ db $98, $88 ; skier
+ db $68, $88 ; teacher
+ db $7D, $87 ; sabrina
+ db $98, $88 ; bug catcher
+ db $98, $88 ; fisher
+ db $98, $88 ; swimmerm
+ db $78, $88 ; swimmerf
+ db $98, $88 ; sailor
+ db $98, $88 ; super nerd
+ db $98, $88 ; rival2
+ db $98, $88 ; guitarist
+ db $A8, $88 ; hiker
+ db $98, $88 ; biker
+ db $98, $88 ; blaine
+ db $98, $88 ; burglar
+ db $98, $88 ; firebreather
+ db $98, $88 ; juggler
+ db $98, $88 ; blackbelt
+ db $D8, $A8 ; executivem
+ db $98, $88 ; psychic
+ db $6A, $A8 ; picnicker
+ db $98, $88 ; camper
+ db $7E, $A8 ; executivef
+ db $98, $88 ; sage
+ db $78, $88 ; medium
+ db $98, $88 ; boarder
+ db $98, $88 ; pokefanm
+ db $68, $8A ; kimono girl
+ db $68, $A8 ; twins
+ db $6D, $88 ; pokefanf
+ db $FD, $DE ; red
+ db $9D, $DD ; blue
+ db $98, $88 ; officer
+ db $7E, $A8 ; gruntf
+ db $98, $88 ; mysticalman
+; 2715c
+
--- a/wram.asm
+++ b/wram.asm
@@ -829,8 +829,24 @@
CurSpecies: ; cf60
ds 1
- ds $13
+ ds 6
+Requested2bpp: ; cf67
+ ds 1
+Requested2bppSource: ; cf68
+ ds 2
+Requested2bppDest: ; cf6a
+ ds 2
+
+Requested1bpp: ; cf6c
+ ds 1
+Requested1bppSource: ; cf6d
+ ds 2
+Requested1bppDest: ; cf6f
+ ds 2
+
+ ds 3
+
MenuSelection:; cf74
ds 1
@@ -844,8 +860,15 @@
VBlankOccurred: ; cfb3
ds 1
- ds 8
+PredefID: ; cfb4
+ ds 1
+PredefTemp: ; cfb5
+ ds 2
+PredefAddress: ; cfb7
+ ds 2
+ ds 3
+
GameTimerPause: ; cfbc
; bit 0
ds 1
@@ -1176,25 +1199,25 @@
ds 2
-TileSetHeader:
-TileSetBank: ; d1d9
+TilesetHeader:
+TilesetBank: ; d1d9
ds 1
-TileSetAddress: ; d1da
+TilesetAddress: ; d1da
ds 2
-TileSetBlocksBank: ; d1dc
+TilesetBlocksBank: ; d1dc
ds 1
-TileSetBlocksAddress: ; d1dd
+TilesetBlocksAddress: ; d1dd
ds 2
-TileSetCollisionBank: ; d1df
+TilesetCollisionBank: ; d1df
ds 1
-TileSetCollisionAddress: ; d1e0
+TilesetCollisionAddress: ; d1e0
ds 2
-TileSetAnim: ; d1e2
+TilesetAnim: ; d1e2
; bank 3f
ds 2
; unused ; d1e4
ds 2
-TileSetPalettes: ; d1e6
+TilesetPalettes: ; d1e6
; bank 3f
ds 2