diff options
511 files changed, 38354 insertions, 39601 deletions
@@ -50,6 +50,7 @@ Dependencies are downloaded in the installer rather than the command line. Select the following packages: * make * git +* gettext * python * python-setuptools @@ -63,8 +64,7 @@ Then set up the repository. In the **Cygwin terminal**: cd pokered git submodule init git submodule update - sudo easy_install pip - sudo pip install -r extras/requirements.txt + easy_install git://github.com/drj11/pypng.git@master#egg=pypng To build: @@ -1,94 +1,81 @@ PYTHON := python +MD5 := md5sum -c --quiet .SUFFIXES: .SUFFIXES: .asm .tx .o .gbc -.PHONY: all clean red blue compare pngs +.PHONY: all clean red blue yellow compare .PRECIOUS: %.2bpp .SECONDEXPANSION: -POKEMONTOOLS := extras/pokemontools -GFX := $(PYTHON) $(POKEMONTOOLS)/gfx.py -PIC := $(PYTHON) $(POKEMONTOOLS)/pic.py -INCLUDES := $(PYTHON) $(POKEMONTOOLS)/scan_includes.py -PREPROCESS := $(PYTHON) prequeue.py +poketools := extras/pokemontools +gfx := $(PYTHON) $(poketools)/gfx.py +pic := $(PYTHON) $(poketools)/pic.py +includes := $(PYTHON) $(poketools)/scan_includes.py +pre := $(PYTHON) prequeue.py -TEXTQUEUE := -RED_OBJS := \ -pokered.o \ -audio_red.o \ -wram.o \ -text.o +versions := red blue yellow -BLUE_OBJS := \ -pokeblue.o \ -audio_blue.o \ -wram.o \ -text.o +$(foreach ver, $(versions), \ + $(eval $(ver)_asm := $(shell find $(ver) -iname '*.asm')) \ + $(eval $(ver)_obj := $($(ver)_asm:.asm=.o)) \ + $(eval all_obj += $($(ver)_obj)) \ +) +$(foreach obj, $(all_obj), \ + $(eval $(obj:.o=)_dep := $(shell $(includes) $(obj:.o=.asm))) \ +) -OBJS := $(RED_OBJS) $(BLUE_OBJS) -OBJS := $(sort $(OBJS)) -ROMS := pokered.gbc pokeblue.gbc +roms := pokered.gbc pokeblue.gbc -# object dependencies -$(shell $(foreach obj, $(OBJS), $(eval $(obj:.o=)_DEPENDENCIES := $(shell $(INCLUDES) $(obj:.o=.asm))))) +all: $(roms) +red: pokered.gbc +blue: pokeblue.gbc +yellow: pokeyellow.gbc -all: $(ROMS) -red: pokered.gbc -blue: pokeblue.gbc compare: - @md5sum -c --quiet roms.md5 + @$(MD5) roms.md5 clean: - rm -f $(ROMS) - rm -f $(OBJS) - find . -iname '*.tx' -exec rm {} + - find gfx -iname '*.[12]bpp' -exec rm {} + - find pic -iname '*.pic' -exec rm {} + - find pic -iname '*.2bpp' -exec rm {} + - rm -f redrle - - -redrle: extras/redtools/redrle.c - ${CC} -o $@ $< + rm -f $(roms) $(all_obj) + find . \( -iname '*.tx' -o -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -exec rm {} + %.asm: ; -.asm.tx: - $(eval TEXTQUEUE += $<) +%.tx: %.asm + $(eval txq += $<) @rm -f $@ -$(OBJS): $$*.tx $$(patsubst %.asm, %.tx, $$($$*_DEPENDENCIES)) - @$(PREPROCESS) $(TEXTQUEUE) - @$(eval TEXTQUEUE :=) - @$(GFX) 2bpp $(2BPPQUEUE) - @$(eval 2BPPQUEUE :=) - @$(GFX) 1bpp $(1BPPQUEUE) - @$(eval 1BPPQUEUE :=) - @$(PIC) compress $(PICQUEUE) - @$(eval PICQUEUE :=) - rgbasm -o $@ $*.tx +$(all_obj): $$*.tx $$(patsubst %.asm, %.tx, $$($$*_dep)) + @$(pre) $(txq); $(eval txq :=) + @$(gfx) 2bpp $(2bppq); $(eval 2bppq :=) + @$(gfx) 1bpp $(1bppq); $(eval 1bppq :=) + @$(pic) compress $(picq); $(eval picq :=) + rgbasm -h -o $@ $*.tx + +link = rgblink -n $*.sym -m $*.map +dmg_opt := -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 +cgb_opt := -cjsv -k 01 -l 0x33 -m 0x1b -p 0 -r 03 -OPTIONS = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 +pokered.gbc: $(red_obj) + $(link) -o $@ $^ + rgbfix $(dmg_opt) -t "POKEMON RED" $@ -pokered.gbc: $(RED_OBJS) - rgblink -n $*.sym -m $*.map -o $@ $^ - rgbfix $(OPTIONS) -t "POKEMON RED" $@ +pokeblue.gbc: $(blue_obj) + $(link) -o $@ $^ + rgbfix $(dmg_opt) -t "POKEMON BLUE" $@ -pokeblue.gbc: $(BLUE_OBJS) - rgblink -n $*.sym -m $*.map -o $@ $^ - rgbfix $(OPTIONS) -t "POKEMON BLUE" $@ +pokeyellow.gbc: $(yellow_obj) + $(link) -o $@ $^ + rgbfix $(cgb_opt) -t "POKEMON YELLOW" $@ %.2bpp: %.png - $(eval 2BPPQUEUE += $<) + $(eval 2bppq += $<) @rm -f $@ %.1bpp: %.png - $(eval 1BPPQUEUE += $<) + $(eval 1bppq += $<) @rm -f $@ -%.pic: %.2bpp - $(eval PICQUEUE += $<) +%.pic: %.2bpp + $(eval picq += $<) @rm -f $@ - - @@ -50,7 +50,7 @@ INCLUDE "audio/sfx/sfx_02_11.asm" INCLUDE "audio/sfx/sfx_02_12.asm" INCLUDE "audio/sfx/sfx_02_13.asm" -INCLUDE "audio/duty_1.asm" +Music2_WavePointers: INCLUDE "audio/wave_instruments.asm" INCLUDE "audio/sfx/sfx_02_3f.asm" INCLUDE "audio/sfx/sfx_02_5e.asm" @@ -149,7 +149,7 @@ INCLUDE "audio/sfx/sfx_08_11.asm" INCLUDE "audio/sfx/sfx_08_12.asm" INCLUDE "audio/sfx/sfx_08_13.asm" -INCLUDE "audio/duty_2.asm" +Music8_WavePointers: INCLUDE "audio/wave_instruments.asm" INCLUDE "audio/sfx/sfx_08_40.asm" INCLUDE "audio/sfx/sfx_08_3f.asm" @@ -274,7 +274,7 @@ INCLUDE "audio/sfx/sfx_1f_11.asm" INCLUDE "audio/sfx/sfx_1f_12.asm" INCLUDE "audio/sfx/sfx_1f_13.asm" -INCLUDE "audio/duty_3.asm" +Music1f_WavePointers: INCLUDE "audio/wave_instruments.asm" INCLUDE "audio/sfx/sfx_1f_3f.asm" INCLUDE "audio/sfx/sfx_1f_56.asm" @@ -365,9 +365,9 @@ SECTION "Audio Engine 1", ROMX, BANK[AUDIO_1] PlayBattleMusic:: ; 0x90c6 xor a ld [wMusicHeaderPointer], a - ld [$d083], a + ld [wd083], a dec a - ld [$c0ee], a + ld [wc0ee], a call PlaySound ; stop music call DelayFrame ld c, BANK(Music_GymLeaderBattle) @@ -406,7 +406,7 @@ Music_RivalAlternateStart:: ; 0x9b47 ld c, BANK(Music_MeetRival) ld a, MUSIC_MEET_RIVAL call PlayMusic - ld hl, $c006 + ld hl, wc006 ld de, Music_MeetRival_branch_b1a2 call Music2_OverwriteChannelPointer ld de, Music_MeetRival_branch_b21d @@ -425,22 +425,22 @@ Music_RivalAlternateTempo:: ; 0x9b65 ld c, BANK(Music_MeetRival) ld a, MUSIC_MEET_RIVAL call PlayMusic - ld hl, $c006 + ld hl, wc006 ld de, Music_MeetRival_branch_b119 jp Music2_OverwriteChannelPointer ; applies both the alternate start and alternate tempo Music_RivalAlternateStartAndTempo:: ; 0x9b75 call Music_RivalAlternateStart - ld hl, $c006 + ld hl, wc006 ld de, Music_MeetRival_branch_b19b jp Music2_OverwriteChannelPointer ; an alternate tempo for Cities1 which is used for the Hall of Fame room Music_Cities1AlternateTempo:: ; 0x9b81 ld a, $a - ld [$cfc8], a - ld [$cfc9], a + ld [wcfc8], a + ld [wcfc9], a ld a, $ff ld [wMusicHeaderPointer], a ld c, $64 @@ -448,7 +448,7 @@ Music_Cities1AlternateTempo:: ; 0x9b81 ld c, BANK(Music_Cities1) ld a, MUSIC_CITIES1 call PlayMusic - ld hl, $c006 + ld hl, wc006 ld de, Music_Cities1_branch_aa6f jp Music2_OverwriteChannelPointer @@ -456,7 +456,7 @@ Music_Cities1AlternateTempo:: ; 0x9b81 SECTION "Audio Engine 2", ROMX, BANK[AUDIO_2] Func_2136e:: ; 2136e (8:536e) - ld a, [$d083] + ld a, [wd083] cp $ff jr z, .asm_2139b bit 7, a @@ -472,18 +472,18 @@ Func_2136e:: ; 2136e (8:536e) call Func_213ac .asm_2138a ld a, $86 - ld [$c02a], a - ld a, [$d083] + ld [wc02a], a + ld a, [wd083] and $7f dec a .asm_21395 set 7, a - ld [$d083], a + ld [wd083], a ret .asm_2139b xor a - ld [$d083], a - ld [$c02a], a + ld [wd083], a + ld [wc02a], a ld de, Unknown_213c4 ; $53c4 jr asm_213af @@ -523,7 +523,7 @@ INCLUDE "audio/engine_2.asm" Music_PokeFluteInBattle:: ; 22306 (8:6306) ld a, (SFX_08_46 - SFX_Headers_08) / 3 ; PokeFlute outside of battle call PlaySoundWaitForCurrent - ld hl, $c00e + ld hl, wc00e ld de, SFX_08_PokeFlute_Ch1 call Music8_OverwriteChannelPointer ld de, SFX_08_PokeFlute_Ch2 @@ -553,7 +553,7 @@ Func_7d13b:: ; 7d13b (1f:513b) .gotSfxPointer push bc ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySoundWaitForCurrent pop bc ld b, $0 diff --git a/audio/duty_2.asm b/audio/duty_2.asm deleted file mode 100644 index b4561091..00000000 --- a/audio/duty_2.asm +++ /dev/null @@ -1,32 +0,0 @@ -Music8_Channel3DutyPointers: ; 20361 (8:4361) - dw Music8_Channel3Duty0 - dw Music8_Channel3Duty1 - dw Music8_Channel3Duty2 - dw Music8_Channel3Duty3 - dw Music8_Channel3Duty4 - dw Music8_Channel3Duty5 ; unused - dw Music8_Channel3Duty5 ; unused - dw Music8_Channel3Duty5 ; unused - dw Music8_Channel3Duty5 ; unused - -; these are the definitions for the channel 3 instruments -; each instrument definition is made up of 32 points (nibbles) that form -; the graph of the wave -; the current instrument is copied to $FF30 -Music8_Channel3Duty0: ; 20373 (8:4373) - db $02,$46,$8A,$CE,$FF,$FE,$ED,$DC,$CB,$A9,$87,$65,$44,$33,$22,$11 - -Music8_Channel3Duty1: ; 20383 (8:4383) - db $02,$46,$8A,$CE,$EF,$FF,$FE,$EE,$DD,$CB,$A9,$87,$65,$43,$22,$11 - -Music8_Channel3Duty2: ; 20393 (8:4393) - db $13,$69,$BD,$EE,$EE,$FF,$FF,$ED,$DE,$FF,$FF,$EE,$EE,$DB,$96,$31 - -Music8_Channel3Duty3: ; 203a3 (8:43a3) - db $02,$46,$8A,$CD,$EF,$FE,$DE,$FF,$EE,$DC,$BA,$98,$76,$54,$32,$10 - -Music8_Channel3Duty4: ; 203b3 (8:43b3) - db $01,$23,$45,$67,$8A,$CD,$EE,$F7,$7F,$EE,$DC,$A8,$76,$54,$32,$10 - -Music8_Channel3Duty5: - diff --git a/audio/duty_3.asm b/audio/duty_3.asm deleted file mode 100644 index b9702a7f..00000000 --- a/audio/duty_3.asm +++ /dev/null @@ -1,33 +0,0 @@ -Music1f_Channel3DutyPointers: ; 7c361 (1f:4361) - dw Music1f_Channel3Duty0 - dw Music1f_Channel3Duty1 - dw Music1f_Channel3Duty2 - dw Music1f_Channel3Duty3 - dw Music1f_Channel3Duty4 - dw Music1f_Channel3Duty5 ; used in the Pokemon Tower theme - dw Music1f_Channel3Duty5 ; unused - dw Music1f_Channel3Duty5 ; unused - dw Music1f_Channel3Duty5 ; unused - -; these are the definitions for the channel 3 instruments -; each instrument definition is made up of 32 points (nibbles) that form -; the graph of the wave -; the current instrument is copied to $FF30 -Music1f_Channel3Duty0: ; 7c373 (1f:4373) - db $02,$46,$8A,$CE,$FF,$FE,$ED,$DC,$CB,$A9,$87,$65,$44,$33,$22,$11 - -Music1f_Channel3Duty1: ; 7c383 (1f:4383) - db $02,$46,$8A,$CE,$EF,$FF,$FE,$EE,$DD,$CB,$A9,$87,$65,$43,$22,$11 - -Music1f_Channel3Duty2: ; 7c393 (1f:4393) - db $13,$69,$BD,$EE,$EE,$FF,$FF,$ED,$DE,$FF,$FF,$EE,$EE,$DB,$96,$31 - -Music1f_Channel3Duty3: ; 7c3a3 (1f:43a3) - db $02,$46,$8A,$CD,$EF,$FE,$DE,$FF,$EE,$DC,$BA,$98,$76,$54,$32,$10 - -Music1f_Channel3Duty4: ; 7c3b3 (1f:43b3) - db $01,$23,$45,$67,$8A,$CD,$EE,$F7,$7F,$EE,$DC,$A8,$76,$54,$32,$10 - -; duty 5 reads from sfx data -Music1f_Channel3Duty5: ; 7c3c3 (1f:43c3) - diff --git a/audio/engine_1.asm b/audio/engine_1.asm index cf121bcd..8343074a 100644 --- a/audio/engine_1.asm +++ b/audio/engine_1.asm @@ -1,10 +1,10 @@ ; The first of three duplicated sound engines. -Func_9103:: ; 0x9103 +Music2_UpdateMusic:: ; 0x9103 ld c, CH0 .loop ld b, $0 - ld hl, $c026 + ld hl, wc026 add hl, bc ld a, [hl] and a @@ -12,13 +12,13 @@ Func_9103:: ; 0x9103 ld a, c cp CH4 jr nc, .asm_912e ; if sfx channel - ld a, [$c002] + ld a, [wc002] and a jr z, .asm_912e bit 7, a jr nz, .nextChannel set 7, a - ld [$c002], a + ld [wc002], a xor a ld [$ff25], a ld [$ff1a], a @@ -31,19 +31,20 @@ Func_9103:: ; 0x9103 ld a, c inc c ; inc channel number cp CH7 - jr nz, .loop + jr nz, .loop ret ; this routine checks flags for music effects currently applied ; to the channel and calls certain functions based on flags. -; known flags for $c02e: +; known flags for wc02e: +; 0: toggleperfectpitch has been used ; 1: call has been used ; 3: a toggle used only by this routine for vibrato ; 4: pitchbend flag ; 6: dutycycle flag Music2_ApplyMusicAffects: ; 0x9138 ld b, $0 - ld hl, $c0b6 ; delay unitl next note + ld hl, wc0b6 ; delay until next note add hl, bc ld a, [hl] cp $1 ; if the delay is 1, play next note @@ -53,36 +54,36 @@ Music2_ApplyMusicAffects: ; 0x9138 ld a, c cp CH4 jr nc, .startChecks ; if a sfx channel - ld hl, $c02a + ld hl, wc02a add hl, bc ld a, [hl] and a jr z, .startChecks ret .startChecks - ld hl, $c02e + ld hl, wc02e add hl, bc bit 6, [hl] ; dutycycle jr z, .checkForExecuteMusic call Music2_ApplyDutyCycle .checkForExecuteMusic ld b, $0 - ld hl, $c036 + ld hl, wc036 add hl, bc bit 0, [hl] jr nz, .checkForPitchBend - ld hl, $c02e + ld hl, wc02e add hl, bc bit 2, [hl] jr nz, .disablePitchBendVibrato .checkForPitchBend - ld hl, $c02e + ld hl, wc02e add hl, bc bit 4, [hl] ; pitchbend jr z, .checkVibratoDelay jp Music2_ApplyPitchBend .checkVibratoDelay - ld hl, $c04e ; vibrato delay + ld hl, wc04e ; vibrato delay add hl, bc ld a, [hl] and a ; check if delay is over @@ -91,7 +92,7 @@ Music2_ApplyMusicAffects: ; 0x9138 .disablePitchBendVibrato ret .checkForVibrato - ld hl, $c056 ; vibrato rate + ld hl, wc056 ; vibrato rate add hl, bc ld a, [hl] and a @@ -99,7 +100,7 @@ Music2_ApplyMusicAffects: ; 0x9138 ret ; no vibrato .vibrato ld d, a - ld hl, $c05e + ld hl, wc05e add hl, bc ld a, [hl] and $f @@ -112,10 +113,10 @@ Music2_ApplyMusicAffects: ; 0x9138 swap [hl] or [hl] ld [hl], a ; reset the vibrato value and start again - ld hl, $c066 + ld hl, wc066 add hl, bc ld e, [hl] ; get note pitch - ld hl, $c02e + ld hl, wc02e add hl, bc bit 3, [hl] ; this is the only code that sets/resets bit three so jr z, .unset ; it continuously alternates which path it takes @@ -148,13 +149,13 @@ Music2_ApplyMusicAffects: ; 0x9138 ; like tempo changes, duty changes etc. and doesn't return ; until the first note is reached Music2_PlayNextNote ; 0x91d0 - ld hl, $c06e + ld hl, wc06e add hl, bc ld a, [hl] - ld hl, $c04e + ld hl, wc04e add hl, bc ld [hl], a - ld hl, $c02e + ld hl, wc02e add hl, bc res 4, [hl] res 5, [hl] @@ -167,7 +168,7 @@ Music2_endchannel: ; 0x91e6 cp $ff ; is this command an endchannel? jp nz, Music2_callchannel ; no ld b, $0 ; yes - ld hl, $c02e + ld hl, wc02e add hl, bc bit 1, [hl] jr nz, .returnFromCall @@ -177,7 +178,7 @@ Music2_endchannel: ; 0x91e6 jr .asm_923f .noiseOrSfxChannel res 2, [hl] - ld hl, $c036 + ld hl, wc036 add hl, bc res 0, [hl] cp CH6 @@ -188,11 +189,11 @@ Music2_endchannel: ; 0x91e6 ld [$ff1a], a .notSfxChannel3 jr nz, .asm_9222 - ld a, [$c003] + ld a, [wc003] and a jr z, .asm_9222 xor a - ld [$c003], a + ld [wc003], a jr .asm_923f .asm_9222 jr .asm_9248 @@ -202,10 +203,10 @@ Music2_endchannel: ; 0x91e6 ld a, c add a ld e, a - ld hl, $c006 + ld hl, wc006 add hl, de push hl ; store current channel address - ld hl, $c016 + ld hl, wc016 add hl, de ld e, l ld d, h @@ -223,12 +224,12 @@ Music2_endchannel: ; 0x91e6 and [hl] ld [$ff25], a .asm_9248 - ld a, [$c02a] + ld a, [wc02a] cp $14 jr nc, .asm_9251 jr .asm_926e .asm_9251 - ld a, [$c02a] + ld a, [wc02a] cp $86 jr z, .asm_926e jr c, .asm_925c @@ -240,12 +241,12 @@ Music2_endchannel: ; 0x91e6 call Func_96c7 ret c .asm_9265 - ld a, [$c005] + ld a, [wc005] ld [$ff24], a xor a - ld [$c005], a + ld [wc005], a .asm_926e - ld hl, $c026 + ld hl, wc026 add hl, bc ld [hl], b ret @@ -264,10 +265,10 @@ Music2_callchannel: ; 0x9274 ld a, c add a ld e, a - ld hl, $c006 + ld hl, wc006 add hl, de push hl - ld hl, $c016 + ld hl, wc016 add hl, de ld e, l ld d, h @@ -282,7 +283,7 @@ Music2_callchannel: ; 0x9274 inc hl ld [hl], d ; overwrite current address with pointer ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc set 1, [hl] ; set the call flag jp Music2_endchannel @@ -295,7 +296,7 @@ Music2_loopchannel: ; 0x92a9 and a jr z, .infiniteLoop ld b, $0 - ld hl, $c0be + ld hl, wc0be add hl, bc ld a, [hl] cp e @@ -318,7 +319,7 @@ Music2_loopchannel: ; 0x92a9 ld a, c add a ld e, a - ld hl, $c006 + ld hl, wc006 add hl, de pop af ld [hli], a @@ -328,11 +329,11 @@ Music2_loopchannel: ; 0x92a9 Music2_notetype: ; 0x92e4 and $f0 cp $d0 ; is this command a notetype? - jp nz, Music2_togglecall ; no + jp nz, Music2_toggleperfectpitch ; no ld a, d ; yes and $f ld b, $0 - ld hl, $c0c6 + ld hl, wc0c6 add hl, bc ld [hl], a ; store low nibble as speed ld a, c @@ -345,10 +346,10 @@ Music2_notetype: ; 0x92e4 jr z, .musicChannel3 cp CH6 jr nz, .notChannel3 - ld hl, $c0e7 + ld hl, wc0e7 jr .sfxChannel3 .musicChannel3 - ld hl, $c0e6 + ld hl, wc0e6 .sfxChannel3 ld a, d and $f @@ -363,22 +364,22 @@ Music2_notetype: ; 0x92e4 ; else, store volume (high nibble) and fade (low nibble) .notChannel3 ld b, $0 - ld hl, $c0de + ld hl, wc0de add hl, bc ld [hl], d .noiseChannel jp Music2_endchannel -Music2_togglecall: ; 0x9323 +Music2_toggleperfectpitch: ; 0x9323 ld a, d - cp $e8 ; is this command an togglecall? + cp $e8 ; is this command a toggleperfectpitch? jr nz, Music2_vibrato ; no ld b, $0 ; yes - ld hl, $c02e + ld hl, wc02e add hl, bc ld a, [hl] xor $1 - ld [hl], a ; flip bit 0 of $c02e (toggle returning from call) + ld [hl], a ; flip bit 0 of wc02e jp Music2_endchannel Music2_vibrato: ; 0x9335 @@ -386,10 +387,10 @@ Music2_vibrato: ; 0x9335 jr nz, Music2_pitchbend ; no call Music2_GetNextMusicByte ; yes ld b, $0 - ld hl, $c04e + ld hl, wc04e add hl, bc - ld [hl], a ; store delay - ld hl, $c06e + ld [hl], a ; store delay + ld hl, wc06e add hl, bc ld [hl], a ; store delay call Music2_GetNextMusicByte @@ -397,7 +398,7 @@ Music2_vibrato: ; 0x9335 and $f0 swap a ld b, $0 - ld hl, $c056 + ld hl, wc056 add hl, bc srl a ld e, a @@ -408,7 +409,7 @@ Music2_vibrato: ; 0x9335 ld a, d and $f ld d, a - ld hl, $c05e + ld hl, wc05e add hl, bc swap a or d @@ -420,7 +421,7 @@ Music2_pitchbend: ; 0x936d jr nz, Music2_duty ; no call Music2_GetNextMusicByte ; yes ld b, $0 - ld hl, $c076 + ld hl, wc076 add hl, bc ld [hl], a ; store first param call Music2_GetNextMusicByte @@ -432,14 +433,14 @@ Music2_pitchbend: ; 0x936d and $f call Func_9858 ld b, $0 - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc ld [hl], d ; store unknown part of second param - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld [hl], e ; store unknown part of second param ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc set 4, [hl] ; set pitchbend flag call Music2_GetNextMusicByte @@ -454,45 +455,45 @@ Music2_duty: ; 0x93a5 rrca and $c0 ld b, $0 - ld hl, $c03e + ld hl, wc03e add hl, bc ld [hl], a ; store duty jp Music2_endchannel Music2_tempo: ; 0x93ba cp $ed ; is this command a tempo? - jr nz, Music2_unknownmusic0xee ; no + jr nz, Music2_stereopanning ; no ld a, c ; yes cp CH4 jr nc, .sfxChannel call Music2_GetNextMusicByte - ld [$c0e8], a ; store first param + ld [wc0e8], a ; store first param call Music2_GetNextMusicByte - ld [$c0e9], a ; store second param + ld [wc0e9], a ; store second param xor a - ld [$c0ce], a ; clear RAM - ld [$c0cf], a - ld [$c0d0], a - ld [$c0d1], a + ld [wc0ce], a ; clear RAM + ld [wc0cf], a + ld [wc0d0], a + ld [wc0d1], a jr .musicChannelDone .sfxChannel call Music2_GetNextMusicByte - ld [$c0ea], a ; store first param + ld [wc0ea], a ; store first param call Music2_GetNextMusicByte - ld [$c0eb], a ; store second param + ld [wc0eb], a ; store second param xor a - ld [$c0d2], a ; clear RAM - ld [$c0d3], a - ld [$c0d4], a - ld [$c0d5], a + ld [wc0d2], a ; clear RAM + ld [wc0d3], a + ld [wc0d4], a + ld [wc0d5], a .musicChannelDone jp Music2_endchannel -Music2_unknownmusic0xee: ; 0x93fa - cp $ee ; is this command an unknownmusic0xee? +Music2_stereopanning: ; 0x93fa + cp $ee ; is this command a stereopanning? jr nz, Music2_unknownmusic0xef ; no call Music2_GetNextMusicByte ; yes - ld [$c004], a ; store first param + ld [wc004], a ; store panning jp Music2_endchannel ; this appears to never be used @@ -503,45 +504,45 @@ Music2_unknownmusic0xef ; 0x9407 push bc call Func_9876 pop bc - ld a, [$c003] + ld a, [wc003] and a jr nz, .skip - ld a, [$c02d] - ld [$c003], a + ld a, [wc02d] + ld [wc003], a xor a - ld [$c02d], a + ld [wc02d], a .skip jp Music2_endchannel Music2_dutycycle: ; 0x9426 cp $fc ; is this command a dutycycle? - jr nz, Music2_stereopanning ; no + jr nz, Music2_volume ; no call Music2_GetNextMusicByte ; yes ld b, $0 - ld hl, $c046 + ld hl, wc046 add hl, bc ld [hl], a ; store full cycle and $c0 - ld hl, $c03e + ld hl, wc03e add hl, bc ld [hl], a ; store first duty - ld hl, $c02e + ld hl, wc02e add hl, bc set 6, [hl] ; set dutycycle flag jp Music2_endchannel -Music2_stereopanning: ; 0x9444 - cp $f0 ; is this command a stereopanning? +Music2_volume: ; 0x9444 + cp $f0 ; is this command a volume? jr nz, Music2_executemusic ; no call Music2_GetNextMusicByte ; yes - ld [$ff24], a ; store stereopanning + ld [$ff24], a ; store volume jp Music2_endchannel Music2_executemusic: ; 0x9450 cp $f8 ; is this command an executemusic? jr nz, Music2_octave ; no ld b, $0 ; yes - ld hl, $c036 + ld hl, wc036 add hl, bc set 0, [hl] jp Music2_endchannel @@ -550,7 +551,7 @@ Music2_octave: ; 0x945f and $f0 cp $e0 ; is this command an octave? jr nz, Music2_unknownsfx0x20 ; no - ld hl, $c0d6 ; yes + ld hl, wc0d6 ; yes ld b, $0 add hl, bc ld a, d @@ -565,14 +566,14 @@ Music2_unknownsfx0x20: ; 0x9472 cp CH3 ; is this a noise or sfx channel? jr c, Music2_unknownsfx0x10 ; no ld b, $0 - ld hl, $c036 + ld hl, wc036 add hl, bc bit 0, [hl] jr nz, Music2_unknownsfx0x10 ; no call Music2_notelength ; yes ld d, a ld b, $0 - ld hl, $c03e + ld hl, wc03e add hl, bc ld a, [hl] or d @@ -611,7 +612,7 @@ Music2_unknownsfx0x10: cp $10 ; is this command a unknownsfx0x10? jr nz, Music2_note ; no ld b, $0 - ld hl, $c036 + ld hl, wc036 add hl, bc bit 0, [hl] jr nz, Music2_note ; no @@ -646,7 +647,7 @@ Music2_dnote: call Music2_GetNextMusicByte ; get dnote instrument asm_94fd ld d, a - ld a, [$c003] + ld a, [wc003] and a jr nz, .asm_9508 ld a, d @@ -663,7 +664,7 @@ Music2_notelength: ; 0x950a ld b, $0 ld e, a ; store note length (in 16ths) ld d, b - ld hl, $c0c6 + ld hl, wc0c6 add hl, bc ld a, [hl] ld l, b @@ -671,9 +672,9 @@ Music2_notelength: ; 0x950a ld a, c cp CH4 jr nc, .sfxChannel - ld a, [$c0e8] + ld a, [wc0e8] ld d, a - ld a, [$c0e9] + ld a, [wc0e9] ld e, a jr .skip .sfxChannel @@ -682,31 +683,31 @@ Music2_notelength: ; 0x950a cp CH7 jr z, .skip ; if noise channel call Func_9693 - ld a, [$c0ea] + ld a, [wc0ea] ld d, a - ld a, [$c0eb] + ld a, [wc0eb] ld e, a .skip ld a, l ld b, $0 - ld hl, $c0ce + ld hl, wc0ce add hl, bc ld l, [hl] call Func_9847 ld e, l ld d, h - ld hl, $c0ce + ld hl, wc0ce add hl, bc ld [hl], e ld a, d - ld hl, $c0b6 + ld hl, wc0b6 add hl, bc ld [hl], a - ld hl, $c036 + ld hl, wc036 add hl, bc bit 0, [hl] jr nz, Music2_notepitch - ld hl, $c02e + ld hl, wc02e add hl, bc bit 2, [hl] jr z, Music2_notepitch @@ -721,7 +722,7 @@ Music2_notepitch: ; 0x9568 ld a, c cp CH4 jr nc, .sfxChannel - ld hl, $c02a + ld hl, wc02a add hl, bc ld a, [hl] and a @@ -754,12 +755,12 @@ Music2_notepitch: ; 0x9568 .notRest swap a ld b, $0 - ld hl, $c0d6 + ld hl, wc0d6 add hl, bc ld b, [hl] call Func_9858 ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc bit 4, [hl] jr z, .asm_95b8 @@ -769,7 +770,7 @@ Music2_notepitch: ; 0x9568 ld a, c cp CH4 jr nc, .skip ; if sfx channel - ld hl, $c02a + ld hl, wc02a ld d, $0 ld e, a add hl, de @@ -782,7 +783,7 @@ Music2_notepitch: ; 0x9568 ret .skip ld b, $0 - ld hl, $c0de + ld hl, wc0de add hl, bc ld d, [hl] ld b, $2 @@ -792,15 +793,15 @@ Music2_notepitch: ; 0x9568 call Func_95f8 pop de ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc - bit 0, [hl] - jr z, .asm_95ef - inc e - jr nc, .asm_95ef + bit 0, [hl] ; has toggleperfectpitch been used? + jr z, .skip2 + inc e ; if yes, increment the pitch by 1 + jr nc, .skip2 inc d -.asm_95ef - ld hl, $c066 +.skip2 + ld hl, wc066 add hl, bc ld [hl], e call Func_964b @@ -818,13 +819,13 @@ Func_95f8: ; 0x95f8 jr z, .sfxNoiseChannel cp CH4 jr nc, .skip ; if sfx channel - ld hl, $c02a + ld hl, wc02a add hl, bc ld a, [hl] and a jr nz, .skip .sfxNoiseChannel - ld a, [$c004] + ld a, [wc004] ld hl, Unknown_9b27 add hl, bc and [hl] @@ -842,7 +843,7 @@ Func_95f8: ; 0x95f8 Func_9629: ; 0x9629 ld b, $0 - ld hl, $c0b6 + ld hl, wc0b6 add hl, bc ld d, [hl] ld a, c @@ -853,7 +854,7 @@ Func_9629: ; 0x9629 ld a, d and $3f ld d, a - ld hl, $c03e + ld hl, wc03e add hl, bc ld a, [hl] or d @@ -873,16 +874,16 @@ Func_964b: ; 0x964b ; fall through .channel3 push de - ld de, $c0e6 + ld de, wc0e6 cp CH2 jr z, .musicChannel3 - ld de, $c0e7 + ld de, wc0e7 .musicChannel3 ld a, [de] add a ld d, $0 ld e, a - ld hl, Music2_Channel3DutyPointers + ld hl, Music2_WavePointers add hl, de ld e, [hl] inc hl @@ -919,27 +920,27 @@ Func_9693: ; 0x9693 call Func_96e5 jr nc, .asm_96ab ld d, $0 - ld a, [$c0f2] + ld a, [wc0f2] add $80 jr nc, .asm_96a2 inc d .asm_96a2 - ld [$c0eb], a + ld [wc0eb], a ld a, d - ld [$c0ea], a + ld [wc0ea], a jr .asm_96b4 .asm_96ab xor a - ld [$c0eb], a + ld [wc0eb], a ld a, $1 - ld [$c0ea], a + ld [wc0ea], a .asm_96b4 ret Func_96b5: ; 0x96b5 call Func_96e5 jr nc, .asm_96c6 - ld a, [$c0f1] + ld a, [wc0f1] add e jr nc, .asm_96c1 inc d @@ -955,7 +956,7 @@ Func_96b5: ; 0x96b5 Func_96c7: ; 0x96c7 call Func_96e5 jr nc, .asm_96e2 - ld hl, $c006 + ld hl, wc006 ld e, c ld d, $0 sla e @@ -976,7 +977,7 @@ Func_96c7: ; 0x96c7 ret Func_96e5: ; 0x96e5 - ld a, [$c02a] + ld a, [wc02a] cp $14 jr nc, .asm_96ee jr .asm_96f4 @@ -993,27 +994,27 @@ Func_96e5: ; 0x96e5 ret Music2_ApplyPitchBend: ; 0x96f9 - ld hl, $c02e + ld hl, wc02e add hl, bc bit 5, [hl] jp nz, .asm_9740 - ld hl, $c09e + ld hl, wc09e add hl, bc ld e, [hl] - ld hl, $c096 + ld hl, wc096 add hl, bc ld d, [hl] - ld hl, $c07e + ld hl, wc07e add hl, bc ld l, [hl] ld h, b add hl, de ld d, h ld e, l - ld hl, $c08e + ld hl, wc08e add hl, bc push hl - ld hl, $c086 + ld hl, wc086 add hl, bc ld a, [hl] pop hl @@ -1025,26 +1026,26 @@ Music2_ApplyPitchBend: ; 0x96f9 ld a, $0 adc d ld d, a - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc ld a, [hl] cp d jp c, .asm_9786 jr nz, .asm_9773 - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld a, [hl] cp e jp c, .asm_9786 jr .asm_9773 .asm_9740 - ld hl, $c09e + ld hl, wc09e add hl, bc ld a, [hl] - ld hl, $c096 + ld hl, wc096 add hl, bc ld d, [hl] - ld hl, $c07e + ld hl, wc07e add hl, bc ld e, [hl] sub e @@ -1052,7 +1053,7 @@ Music2_ApplyPitchBend: ; 0x96f9 ld a, d sbc b ld d, a - ld hl, $c086 + ld hl, wc086 add hl, bc ld a, [hl] add a @@ -1063,22 +1064,22 @@ Music2_ApplyPitchBend: ; 0x96f9 ld a, d sbc b ld d, a - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc ld a, d cp [hl] jr c, .asm_9786 jr nz, .asm_9773 - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld a, e cp [hl] jr c, .asm_9786 .asm_9773 - ld hl, $c09e + ld hl, wc09e add hl, bc ld [hl], e - ld hl, $c096 + ld hl, wc096 add hl, bc ld [hl], d ld b, $3 @@ -1088,54 +1089,54 @@ Music2_ApplyPitchBend: ; 0x96f9 ld [hl], d ret .asm_9786 - ld hl, $c02e + ld hl, wc02e add hl, bc res 4, [hl] res 5, [hl] ret Func_978f: ; 0x978f - ld hl, $c096 + ld hl, wc096 add hl, bc ld [hl], d - ld hl, $c09e + ld hl, wc09e add hl, bc ld [hl], e - ld hl, $c0b6 + ld hl, wc0b6 add hl, bc ld a, [hl] - ld hl, $c076 + ld hl, wc076 add hl, bc sub [hl] jr nc, .asm_97a7 ld a, $1 .asm_97a7 ld [hl], a - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld a, e sub [hl] ld e, a ld a, d sbc b - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc sub [hl] jr c, .asm_97c3 ld d, a ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc set 5, [hl] jr .asm_97e6 .asm_97c3 - ld hl, $c096 + ld hl, wc096 add hl, bc ld d, [hl] - ld hl, $c09e + ld hl, wc09e add hl, bc ld e, [hl] - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld a, [hl] sub e @@ -1143,17 +1144,17 @@ Func_978f: ; 0x978f ld a, d sbc b ld d, a - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc ld a, [hl] sub d ld d, a ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc res 5, [hl] .asm_97e6 - ld hl, $c076 + ld hl, wc076 add hl, bc .asm_97ea inc b @@ -1172,20 +1173,20 @@ Func_978f: ; 0x978f add [hl] ld d, b ld b, $0 - ld hl, $c07e + ld hl, wc07e add hl, bc ld [hl], d - ld hl, $c086 + ld hl, wc086 add hl, bc ld [hl], a - ld hl, $c08e + ld hl, wc08e add hl, bc ld [hl], a ret Music2_ApplyDutyCycle: ; 0x980d ld b, $0 - ld hl, $c046 + ld hl, wc046 add hl, bc ld a, [hl] rlca @@ -1206,7 +1207,7 @@ Music2_GetNextMusicByte: ; 0x9825 ld a, c add a ld e, a - ld hl, $c006 + ld hl, wc006 add hl, de ld a, [hli] ld e, a @@ -1254,7 +1255,7 @@ Func_9858: ; 0x9858 add hl, hl ld d, h ld e, l - ld hl, Unknown_9b2f + ld hl, Music2_Pitches add hl, de ld e, [hl] inc hl @@ -1274,7 +1275,7 @@ Func_9858: ; 0x9858 ret Func_9876:: ; 0x9876 - ld [$c001], a + ld [wc001], a cp $ff jp z, Func_9a34 cp $b9 @@ -1285,63 +1286,63 @@ Func_9876:: ; 0x9876 jp nc, Func_994e .asm_988d xor a - ld [$c000], a - ld [$c003], a - ld [$c0e9], a - ld [$c0e6], a - ld [$c0e7], a + ld [wc000], a + ld [wc003], a + ld [wc0e9], a + ld [wc0e6], a + ld [wc0e7], a ld d, $8 - ld hl, $c016 + ld hl, wc016 call FillMusicRAM2 - ld hl, $c006 + ld hl, wc006 call FillMusicRAM2 ld d, $4 - ld hl, $c026 + ld hl, wc026 call FillMusicRAM2 - ld hl, $c02e + ld hl, wc02e call FillMusicRAM2 - ld hl, $c03e + ld hl, wc03e call FillMusicRAM2 - ld hl, $c046 + ld hl, wc046 call FillMusicRAM2 - ld hl, $c04e + ld hl, wc04e call FillMusicRAM2 - ld hl, $c056 + ld hl, wc056 call FillMusicRAM2 - ld hl, $c05e + ld hl, wc05e call FillMusicRAM2 - ld hl, $c066 + ld hl, wc066 call FillMusicRAM2 - ld hl, $c06e + ld hl, wc06e call FillMusicRAM2 - ld hl, $c036 + ld hl, wc036 call FillMusicRAM2 - ld hl, $c076 + ld hl, wc076 call FillMusicRAM2 - ld hl, $c07e + ld hl, wc07e call FillMusicRAM2 - ld hl, $c086 + ld hl, wc086 call FillMusicRAM2 - ld hl, $c08e + ld hl, wc08e call FillMusicRAM2 - ld hl, $c096 + ld hl, wc096 call FillMusicRAM2 - ld hl, $c09e + ld hl, wc09e call FillMusicRAM2 - ld hl, $c0a6 + ld hl, wc0a6 call FillMusicRAM2 - ld hl, $c0ae + ld hl, wc0ae call FillMusicRAM2 ld a, $1 - ld hl, $c0be + ld hl, wc0be call FillMusicRAM2 - ld hl, $c0b6 + ld hl, wc0b6 call FillMusicRAM2 - ld hl, $c0c6 + ld hl, wc0c6 call FillMusicRAM2 - ld [$c0e8], a + ld [wc0e8], a ld a, $ff - ld [$c004], a + ld [wc004], a xor a ld [$ff24], a ld a, $8 @@ -1366,9 +1367,9 @@ Func_994e: ; 0x994e ld de, SFX_Headers_02 add hl, de ld a, h - ld [$c0ec], a + ld [wc0ec], a ld a, l - ld [$c0ed], a + ld [wc0ed], a ld a, [hl] and $c0 rlca @@ -1381,9 +1382,9 @@ Func_994e: ; 0x994e add c ld c, a ld b, $0 - ld a, [$c0ec] + ld a, [wc0ec] ld h, a - ld a, [$c0ed] + ld a, [wc0ed] ld l, a add hl, bc ld c, d @@ -1391,7 +1392,7 @@ Func_994e: ; 0x994e and $f ld e, a ld d, $0 - ld hl, $c026 + ld hl, wc026 add hl, de ld a, [hl] and a @@ -1399,7 +1400,7 @@ Func_994e: ; 0x994e ld a, e cp $7 jr nz, .asm_999a - ld a, [$c001] + ld a, [wc001] cp $14 jr nc, .asm_9993 ret @@ -1409,7 +1410,7 @@ Func_994e: ; 0x994e jr z, .asm_99a3 jr c, .asm_99a3 .asm_999a - ld a, [$c001] + ld a, [wc001] cp [hl] jr z, .asm_99a3 jr c, .asm_99a3 @@ -1422,77 +1423,77 @@ Func_994e: ; 0x994e add hl, hl ld d, h ld e, l - ld hl, $c016 + ld hl, wc016 add hl, de ld [hli], a ld [hl], a - ld hl, $c006 + ld hl, wc006 add hl, de ld [hli], a ld [hl], a pop de - ld hl, $c026 + ld hl, wc026 add hl, de ld [hl], a - ld hl, $c02e + ld hl, wc02e add hl, de ld [hl], a - ld hl, $c03e + ld hl, wc03e add hl, de ld [hl], a - ld hl, $c046 + ld hl, wc046 add hl, de ld [hl], a - ld hl, $c04e + ld hl, wc04e add hl, de ld [hl], a - ld hl, $c056 + ld hl, wc056 add hl, de ld [hl], a - ld hl, $c05e + ld hl, wc05e add hl, de ld [hl], a - ld hl, $c066 + ld hl, wc066 add hl, de ld [hl], a - ld hl, $c06e + ld hl, wc06e add hl, de ld [hl], a - ld hl, $c076 + ld hl, wc076 add hl, de ld [hl], a - ld hl, $c07e + ld hl, wc07e add hl, de ld [hl], a - ld hl, $c086 + ld hl, wc086 add hl, de ld [hl], a - ld hl, $c08e + ld hl, wc08e add hl, de ld [hl], a - ld hl, $c096 + ld hl, wc096 add hl, de ld [hl], a - ld hl, $c09e + ld hl, wc09e add hl, de ld [hl], a - ld hl, $c0a6 + ld hl, wc0a6 add hl, de ld [hl], a - ld hl, $c0ae + ld hl, wc0ae add hl, de ld [hl], a - ld hl, $c036 + ld hl, wc036 add hl, de ld [hl], a ld a, $1 - ld hl, $c0be + ld hl, wc0be add hl, de ld [hl], a - ld hl, $c0b6 + ld hl, wc0b6 add hl, de ld [hl], a - ld hl, $c0c6 + ld hl, wc0c6 add hl, de ld [hl], a ld a, e @@ -1526,24 +1527,24 @@ Func_9a34: ; 0x9a34 ld a, $77 ld [$ff24], a xor a - ld [$c000], a - ld [$c003], a - ld [$c002], a - ld [$c0e9], a - ld [$c0eb], a - ld [$c0e6], a - ld [$c0e7], a + ld [wc000], a + ld [wc003], a + ld [wc002], a + ld [wc0e9], a + ld [wc0eb], a + ld [wc0e6], a + ld [wc0e7], a ld d, $a0 - ld hl, $c006 + ld hl, wc006 call FillMusicRAM2 ld a, $1 ld d, $18 - ld hl, $c0b6 + ld hl, wc0b6 call FillMusicRAM2 - ld [$c0e8], a - ld [$c0ea], a + ld [wc0e8], a + ld [wc0ea], a ld a, $ff - ld [$c004], a + ld [wc004], a ret ; fills d bytes at hl with a @@ -1556,7 +1557,7 @@ FillMusicRAM2: ; 0x9a89 ret Func_9a8f: ; 0x9a8f - ld a, [$c001] + ld a, [wc001] ld l, a ld e, a ld h, $0 @@ -1567,7 +1568,7 @@ Func_9a8f: ; 0x9a8f add hl, de ld e, l ld d, h - ld hl, $c006 + ld hl, wc006 ld a, [de] ; get channel number ld b, a rlca @@ -1593,14 +1594,14 @@ Func_9a8f: ; 0x9a8f push af ld b, $0 ld c, a - ld hl, $c026 + ld hl, wc026 add hl, bc - ld a, [$c001] + ld a, [wc001] ld [hl], a pop af cp $3 jr c, .asm_9ad2 - ld hl, $c02e + ld hl, wc02e add hl, bc set 2, [hl] .asm_9ad2 @@ -1619,32 +1620,32 @@ Func_9a8f: ; 0x9a8f ld a, [de] inc de jr nz, .asm_9ab1 - ld a, [$c001] + ld a, [wc001] cp $14 jr nc, .asm_9aeb jr .asm_9b15 .asm_9aeb - ld a, [$c001] + ld a, [wc001] cp $86 jr z, .asm_9b15 jr c, .asm_9af6 jr .asm_9b15 .asm_9af6 - ld hl, $c02a + ld hl, wc02a ld [hli], a ld [hli], a ld [hli], a ld [hl], a - ld hl, $c012 ; sfx noise channel pointer + ld hl, wc012 ; sfx noise channel pointer ld de, Noise2_endchannel ld [hl], e inc hl ld [hl], d ; overwrite pointer to point to endchannel - ld a, [$c005] + ld a, [wc005] and a jr nz, .asm_9b15 ld a, [$ff24] - ld [$c005], a + ld [wc005], a ld a, $77 ld [$ff24], a .asm_9b15 @@ -1665,18 +1666,18 @@ Unknown_9b27: ; 0x9b27 db $11, $22, $44, $88 ; channels 0-3 db $11, $22, $44, $88 ; channels 4-7 -Unknown_9b2f: ; 0x9b2f - dw $F82C - dw $F89D - dw $F907 - dw $F96B - dw $F9CA - dw $FA23 - dw $FA77 - dw $FAC7 - dw $FB12 - dw $FB58 - dw $FB9B - dw $FBDA +Music2_Pitches: ; 0x9b2f + dw $F82C ; C_ + dw $F89D ; C# + dw $F907 ; D_ + dw $F96B ; D# + dw $F9CA ; E_ + dw $FA23 ; F_ + dw $FA77 ; F# + dw $FAC7 ; G_ + dw $FB12 ; G# + dw $FB58 ; A_ + dw $FB9B ; A# + dw $FBDA ; B_ diff --git a/audio/engine_2.asm b/audio/engine_2.asm index 9c64b5c1..b4cb653b 100644 --- a/audio/engine_2.asm +++ b/audio/engine_2.asm @@ -1,10 +1,10 @@ ; The second of three duplicated sound engines. -Func_21879:: ; 21879 (8:5879) +Music8_UpdateMusic:: ; 21879 (8:5879) ld c, CH0 .loop ld b, $0 - ld hl, $c026 + ld hl, wc026 add hl, bc ld a, [hl] and a @@ -12,13 +12,13 @@ Func_21879:: ; 21879 (8:5879) ld a, c cp CH4 jr nc, .applyAffects ; if sfx channel - ld a, [$c002] + ld a, [wc002] and a jr z, .applyAffects bit 7, a jr nz, .nextChannel set 7, a - ld [$c002], a + ld [wc002], a xor a ld [$ff25], a ld [$ff1a], a @@ -36,14 +36,15 @@ Func_21879:: ; 21879 (8:5879) ; this routine checks flags for music effects currently applied ; to the channel and calls certain functions based on flags. -; known flags for $c02e: +; known flags for wc02e: +; 0: toggleperfectpitch has been used ; 1: call has been used ; 3: a toggle used only by this routine for vibrato ; 4: pitchbend flag ; 6: dutycycle flag Music8_ApplyMusicAffects: ; 218ae (8:58ae) ld b, $0 - ld hl, $c0b6 ; delay unitl next note + ld hl, wc0b6 ; delay until next note add hl, bc ld a, [hl] cp $1 ; if the delay is 1, play next note @@ -53,36 +54,36 @@ Music8_ApplyMusicAffects: ; 218ae (8:58ae) ld a, c cp CH4 jr nc, .startChecks ; if a sfx channel - ld hl, $c02a + ld hl, wc02a add hl, bc ld a, [hl] and a jr z, .startChecks ret .startChecks - ld hl, $c02e + ld hl, wc02e add hl, bc bit 6, [hl] ; dutycycle jr z, .checkForExecuteMusic call Music8_ApplyDutyCycle .checkForExecuteMusic ld b, $0 - ld hl, $c036 + ld hl, wc036 add hl, bc bit 0, [hl] jr nz, .checkForPitchBend - ld hl, $c02e + ld hl, wc02e add hl, bc bit 2, [hl] jr nz, .disablePitchBendVibrato .checkForPitchBend - ld hl, $c02e + ld hl, wc02e add hl, bc bit 4, [hl] ; pitchbend jr z, .checkVibratoDelay jp Music8_ApplyPitchBend .checkVibratoDelay - ld hl, $c04e ; vibrato delay + ld hl, wc04e ; vibrato delay add hl, bc ld a, [hl] and a ; check if delay is over @@ -91,7 +92,7 @@ Music8_ApplyMusicAffects: ; 218ae (8:58ae) .disablePitchBendVibrato ret .checkForVibrato - ld hl, $c056 ; vibrato rate + ld hl, wc056 ; vibrato rate add hl, bc ld a, [hl] and a @@ -99,7 +100,7 @@ Music8_ApplyMusicAffects: ; 218ae (8:58ae) ret ; no vibrato .vibrato ld d, a - ld hl, $c05e + ld hl, wc05e add hl, bc ld a, [hl] and $f @@ -112,10 +113,10 @@ Music8_ApplyMusicAffects: ; 218ae (8:58ae) swap [hl] or [hl] ld [hl], a ; reset the vibrato value and start again - ld hl, $c066 + ld hl, wc066 add hl, bc ld e, [hl] ; get note pitch - ld hl, $c02e + ld hl, wc02e add hl, bc bit 3, [hl] ; this is the only code that sets/resets bit three so jr z, .unset ; it continuously alternates which path it takes @@ -148,20 +149,20 @@ Music8_ApplyMusicAffects: ; 218ae (8:58ae) ; like tempo changes, duty changes etc. and doesn't return ; until the first note is reached Music8_PlayNextNote: ; 21946 (8:5946) - ld hl, $c06e + ld hl, wc06e add hl, bc ld a, [hl] - ld hl, $c04e + ld hl, wc04e add hl, bc ld [hl], a - ld hl, $c02e + ld hl, wc02e add hl, bc res 4, [hl] res 5, [hl] ld a, c cp CH4 jr nz, .beginChecks - ld a, [$d083] + ld a, [wd083] bit 7, a ret nz .beginChecks @@ -174,7 +175,7 @@ Music8_endchannel: ; 21967 (8:5967) cp $ff ; is this command an endchannel? jp nz, Music8_callchannel ; no ld b, $0 ; yes - ld hl, $c02e + ld hl, wc02e add hl, bc bit 1, [hl] jr nz, .returnFromCall @@ -184,7 +185,7 @@ Music8_endchannel: ; 21967 (8:5967) jr .asm_219c0 .noiseOrSfxChannel res 2, [hl] - ld hl, $c036 + ld hl, wc036 add hl, bc res 0, [hl] cp CH6 @@ -195,11 +196,11 @@ Music8_endchannel: ; 21967 (8:5967) ld [$ff1a], a .notSfxChannel3 jr nz, .asm_219a3 - ld a, [$c003] + ld a, [wc003] and a jr z, .asm_219a3 xor a - ld [$c003], a + ld [wc003], a jr .asm_219c0 .asm_219a3 jr .asm_219c9 @@ -209,10 +210,10 @@ Music8_endchannel: ; 21967 (8:5967) ld a, c add a ld e, a - ld hl, $c006 + ld hl, wc006 add hl, de push hl ; store current channel address - ld hl, $c016 + ld hl, wc016 add hl, de ld e, l ld d, h @@ -230,12 +231,12 @@ Music8_endchannel: ; 21967 (8:5967) and [hl] ld [$ff25], a .asm_219c9 - ld a, [$c02a] + ld a, [wc02a] cp $14 jr nc, .asm_219d2 jr .asm_219ef .asm_219d2 - ld a, [$c02a] + ld a, [wc02a] cp $86 jr z, .asm_219ef jr c, .asm_219dd @@ -247,12 +248,12 @@ Music8_endchannel: ; 21967 (8:5967) call Func_21e6d ret c .asm_219e6 - ld a, [$c005] + ld a, [wc005] ld [$ff24], a xor a - ld [$c005], a + ld [wc005], a .asm_219ef - ld hl, $c026 + ld hl, wc026 add hl, bc ld [hl], b ret @@ -271,10 +272,10 @@ Music8_callchannel: ; 219f5 (8:59f5) ld a, c add a ld e, a - ld hl, $c006 + ld hl, wc006 add hl, de push hl - ld hl, $c016 + ld hl, wc016 add hl, de ld e, l ld d, h @@ -289,7 +290,7 @@ Music8_callchannel: ; 219f5 (8:59f5) inc hl ld [hl], d ; overwrite current address with pointer ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc set 1, [hl] ; set the call flag jp Music8_endchannel @@ -302,7 +303,7 @@ Music8_loopchannel: ; 21a2a (8:5a2a) and a jr z, .infiniteLoop ld b, $0 - ld hl, $c0be + ld hl, wc0be add hl, bc ld a, [hl] cp e @@ -325,7 +326,7 @@ Music8_loopchannel: ; 21a2a (8:5a2a) ld a, c add a ld e, a - ld hl, $c006 + ld hl, wc006 add hl, de pop af ld [hli], a @@ -335,11 +336,11 @@ Music8_loopchannel: ; 21a2a (8:5a2a) Music8_notetype: ; 21a65 (8:5a65) and $f0 cp $d0 ; is this command a notetype? - jp nz, Music8_togglecall ; no + jp nz, Music8_toggleperfectpitch ; no ld a, d ; yes and $f ld b, $0 - ld hl, $c0c6 + ld hl, wc0c6 add hl, bc ld [hl], a ; store low nibble as speed ld a, c @@ -352,10 +353,10 @@ Music8_notetype: ; 21a65 (8:5a65) jr z, .musicChannel3 cp CH6 jr nz, .notChannel3 - ld hl, $c0e7 + ld hl, wc0e7 jr .sfxChannel3 .musicChannel3 - ld hl, $c0e6 + ld hl, wc0e6 .sfxChannel3 ld a, d and $f @@ -370,22 +371,22 @@ Music8_notetype: ; 21a65 (8:5a65) ; else, store volume (high nibble) and fade (low nibble) .notChannel3 ld b, $0 - ld hl, $c0de + ld hl, wc0de add hl, bc ld [hl], d .noiseChannel jp Music8_endchannel -Music8_togglecall: ; 21aa4 (8:5aa4) +Music8_toggleperfectpitch: ; 21aa4 (8:5aa4) ld a, d - cp $e8 ; is this command an togglecall? + cp $e8 ; is this command a toggleperfectpitch? jr nz, Music8_vibrato ; no ld b, $0 ; yes - ld hl, $c02e + ld hl, wc02e add hl, bc ld a, [hl] xor $1 - ld [hl], a ; flip bit 0 of $c02e (toggle returning from call) + ld [hl], a ; flip bit 0 of wc02e jp Music8_endchannel Music8_vibrato: ; 21ab6 (8:5ab6) @@ -393,18 +394,18 @@ Music8_vibrato: ; 21ab6 (8:5ab6) jr nz, Music8_pitchbend ; no call Music8_GetNextMusicByte ; yes ld b, $0 - ld hl, $c04e + ld hl, wc04e add hl, bc - ld [hl], a ; store delay - ld hl, $c06e + ld [hl], a ; store delay + ld hl, wc06e add hl, bc - ld [hl], a ; store delay + ld [hl], a ; store delay call Music8_GetNextMusicByte ld d, a and $f0 swap a ld b, $0 - ld hl, $c056 + ld hl, wc056 add hl, bc srl a ld e, a @@ -415,7 +416,7 @@ Music8_vibrato: ; 21ab6 (8:5ab6) ld a, d and $f ld d, a - ld hl, $c05e + ld hl, wc05e add hl, bc swap a or d @@ -427,7 +428,7 @@ Music8_pitchbend: ; 21aee (8:5aee) jr nz, Music8_duty ; no call Music8_GetNextMusicByte ; yes ld b, $0 - ld hl, $c076 + ld hl, wc076 add hl, bc ld [hl], a ; store first param call Music8_GetNextMusicByte @@ -439,14 +440,14 @@ Music8_pitchbend: ; 21aee (8:5aee) and $f call Func_22017 ld b, $0 - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc ld [hl], d ; store unknown part of second param - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld [hl], e ; store unknown part of second param ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc set 4, [hl] ; set pitchbend flag call Music8_GetNextMusicByte @@ -461,45 +462,45 @@ Music8_duty: ; 21b26 (8:5b26) rrca and $c0 ld b, $0 - ld hl, $c03e + ld hl, wc03e add hl, bc ld [hl], a ; store duty jp Music8_endchannel Music8_tempo: ; 21b3b (8:5b3b) cp $ed ; is this command a tempo? - jr nz, Music8_unknownmusic0xee ; no + jr nz, Music8_stereopanning ; no ld a, c ; yes cp CH4 jr nc, .sfxChannel call Music8_GetNextMusicByte - ld [$c0e8], a ; store first param + ld [wc0e8], a ; store first param call Music8_GetNextMusicByte - ld [$c0e9], a ; store second param + ld [wc0e9], a ; store second param xor a - ld [$c0ce], a ; clear RAM - ld [$c0cf], a - ld [$c0d0], a - ld [$c0d1], a + ld [wc0ce], a ; clear RAM + ld [wc0cf], a + ld [wc0d0], a + ld [wc0d1], a jr .musicChannelDone .sfxChannel call Music8_GetNextMusicByte - ld [$c0ea], a ; store first param + ld [wc0ea], a ; store first param call Music8_GetNextMusicByte - ld [$c0eb], a ; store second param + ld [wc0eb], a ; store second param xor a - ld [$c0d2], a ; clear RAM - ld [$c0d3], a - ld [$c0d4], a - ld [$c0d5], a + ld [wc0d2], a ; clear RAM + ld [wc0d3], a + ld [wc0d4], a + ld [wc0d5], a .musicChannelDone jp Music8_endchannel -Music8_unknownmusic0xee: ; 21b7b (8:5b7b) - cp $ee ; is this command an unknownmusic0xee? +Music8_stereopanning: ; 21b7b (8:5b7b) + cp $ee ; is this command a stereopanning? jr nz, Music8_unknownmusic0xef ; no call Music8_GetNextMusicByte ; yes - ld [$c004], a ; store first param + ld [wc004], a ; store panning jp Music8_endchannel ; this appears to never be used @@ -510,45 +511,45 @@ Music8_unknownmusic0xef: ; 21b88 (8:5b88) push bc call Func_22035 pop bc - ld a, [$c003] + ld a, [wc003] and a jr nz, .skip - ld a, [$c02d] - ld [$c003], a + ld a, [wc02d] + ld [wc003], a xor a - ld [$c02d], a + ld [wc02d], a .skip jp Music8_endchannel Music8_dutycycle: ; 21ba7 (8:5ba7) cp $fc ; is this command a dutycycle? - jr nz, Music8_stereopanning ; no + jr nz, Music8_volume ; no call Music8_GetNextMusicByte ; yes ld b, $0 - ld hl, $c046 + ld hl, wc046 add hl, bc ld [hl], a ; store full cycle and $c0 - ld hl, $c03e + ld hl, wc03e add hl, bc ld [hl], a ; store first duty - ld hl, $c02e + ld hl, wc02e add hl, bc set 6, [hl] ; set dutycycle flag jp Music8_endchannel -Music8_stereopanning: ; 21bc5 (8:5bc5) - cp $f0 ; is this command a stereopanning? +Music8_volume: ; 21bc5 (8:5bc5) + cp $f0 ; is this command a volume? jr nz, Music8_executemusic ; no call Music8_GetNextMusicByte ; yes - ld [$ff24], a + ld [$ff24], a ; store volume jp Music8_endchannel Music8_executemusic: ; 21bd1 (8:5bd1) cp $f8 ; is this command an executemusic? jr nz, Music8_octave ; no ld b, $0 ; yes - ld hl, $c036 + ld hl, wc036 add hl, bc set 0, [hl] jp Music8_endchannel @@ -557,7 +558,7 @@ Music8_octave: ; 21be0 (8:5be0) and $f0 cp $e0 ; is this command an octave? jr nz, Music8_unknownsfx0x20 ; no - ld hl, $c0d6 ; yes + ld hl, wc0d6 ; yes ld b, $0 add hl, bc ld a, d @@ -572,14 +573,14 @@ Music8_unknownsfx0x20: ; 21bf3 cp CH3 ; is this a noise or sfx channel? jr c, Music8_unknownsfx0x10 ; no ld b, $0 - ld hl, $c036 + ld hl, wc036 add hl, bc bit 0, [hl] jr nz, Music8_unknownsfx0x10 ; no call Music8_notelength ld d, a ld b, $0 - ld hl, $c03e + ld hl, wc03e add hl, bc ld a, [hl] or d @@ -618,7 +619,7 @@ Music8_unknownsfx0x10: ; 21c40 (8:5c40) cp $10 ; is this command a unknownsfx0x10? jr nz, Music8_note ; no ld b, $0 - ld hl, $c036 + ld hl, wc036 add hl, bc bit 0, [hl] jr nz, Music8_note ; no @@ -653,7 +654,7 @@ Music8_dnote: ; 21c76 (8:5c76) call Music8_GetNextMusicByte ; get dnote instrument asm_21c7e ld d, a - ld a, [$c003] + ld a, [wc003] and a jr nz, .asm_21c89 ld a, d @@ -670,7 +671,7 @@ Music8_notelength: ; 21c8b (8:5c8b) ld b, $0 ld e, a ; store note length (in 16ths) ld d, b - ld hl, $c0c6 + ld hl, wc0c6 add hl, bc ld a, [hl] ld l, b @@ -678,9 +679,9 @@ Music8_notelength: ; 21c8b (8:5c8b) ld a, c cp CH4 jr nc, .sfxChannel - ld a, [$c0e8] + ld a, [wc0e8] ld d, a - ld a, [$c0e9] + ld a, [wc0e9] ld e, a jr .skip .sfxChannel @@ -689,31 +690,31 @@ Music8_notelength: ; 21c8b (8:5c8b) cp CH7 jr z, .skip ; if noise channel call Func_21e2f - ld a, [$c0ea] + ld a, [wc0ea] ld d, a - ld a, [$c0eb] + ld a, [wc0eb] ld e, a .skip ld a, l ld b, $0 - ld hl, $c0ce + ld hl, wc0ce add hl, bc ld l, [hl] call Func_22006 ld e, l ld d, h - ld hl, $c0ce + ld hl, wc0ce add hl, bc ld [hl], e ld a, d - ld hl, $c0b6 + ld hl, wc0b6 add hl, bc ld [hl], a - ld hl, $c036 + ld hl, wc036 add hl, bc bit 0, [hl] jr nz, Music8_notepitch - ld hl, $c02e + ld hl, wc02e add hl, bc bit 2, [hl] jr z, Music8_notepitch @@ -728,7 +729,7 @@ Music8_notepitch: ; 21ce9 (8:5ce9) ld a, c cp CH4 jr nc, .sfxChannel - ld hl, $c02a + ld hl, wc02a add hl, bc ld a, [hl] and a @@ -761,12 +762,12 @@ Music8_notepitch: ; 21ce9 (8:5ce9) .notRest swap a ld b, $0 - ld hl, $c0d6 + ld hl, wc0d6 add hl, bc ld b, [hl] call Func_22017 ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc bit 4, [hl] jr z, .asm_21d39 @@ -776,7 +777,7 @@ Music8_notepitch: ; 21ce9 (8:5ce9) ld a, c cp CH4 jr nc, .skip ; if sfx channel - ld hl, $c02a + ld hl, wc02a ld d, $0 ld e, a add hl, de @@ -789,7 +790,7 @@ Music8_notepitch: ; 21ce9 (8:5ce9) ret .skip ld b, $0 - ld hl, $c0de + ld hl, wc0de add hl, bc ld d, [hl] ld b, $2 @@ -799,15 +800,15 @@ Music8_notepitch: ; 21ce9 (8:5ce9) call Func_21d79 pop de ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc - bit 0, [hl] - jr z, .asm_21d70 - inc e - jr nc, .asm_21d70 + bit 0, [hl] ; has toggleperfectpitch been used? + jr z, .skip2 + inc e ; if yes, increment the pitch by 1 + jr nc, .skip2 inc d -.asm_21d70 - ld hl, $c066 +.skip2 + ld hl, wc066 add hl, bc ld [hl], e call Func_21dcc @@ -825,13 +826,13 @@ Func_21d79: ; 21d79 (8:5d79) jr z, .sfxNoiseChannel cp CH4 jr nc, .skip ; if sfx channel - ld hl, $c02a + ld hl, wc02a add hl, bc ld a, [hl] and a jr nz, .skip .sfxNoiseChannel - ld a, [$c004] + ld a, [wc004] ld hl, Unknown_222e6 add hl, bc and [hl] @@ -849,7 +850,7 @@ Func_21d79: ; 21d79 (8:5d79) Func_21daa: ; 21daa (8:5daa) ld b, $0 - ld hl, $c0b6 + ld hl, wc0b6 add hl, bc ld d, [hl] ld a, c @@ -860,7 +861,7 @@ Func_21daa: ; 21daa (8:5daa) ld a, d and $3f ld d, a - ld hl, $c03e + ld hl, wc03e add hl, bc ld a, [hl] or d @@ -880,16 +881,16 @@ Func_21dcc: ; 21dcc (8:5dcc) ; fall through .channel3 push de - ld de, $c0e6 + ld de, wc0e6 cp CH2 jr z, .musicChannel3 - ld de, $c0e7 + ld de, wc0e7 .musicChannel3 ld a, [de] add a ld d, $0 ld e, a - ld hl, Music8_Channel3DutyPointers + ld hl, Music8_WavePointers add hl, de ld e, [hl] inc hl @@ -930,13 +931,13 @@ Func_21e19: ; 21e19 (8:5e19) ld a, c cp CH4 jr nz, .asm_21e2e - ld a, [$d083] + ld a, [wd083] bit 7, a jr z, .asm_21e2e xor a - ld [$c0f1], a + ld [wc0f1], a ld a, $80 - ld [$c0f2], a + ld [wc0f2], a .asm_21e2e ret @@ -947,20 +948,20 @@ Func_21e2f: ; 21e2f (8:5e2f) jr nc, .asm_21e4c .asm_21e39 ld d, $0 - ld a, [$c0f2] + ld a, [wc0f2] add $80 jr nc, .asm_21e43 inc d .asm_21e43 - ld [$c0eb], a + ld [wc0eb], a ld a, d - ld [$c0ea], a + ld [wc0ea], a jr .asm_21e55 .asm_21e4c xor a - ld [$c0eb], a + ld [wc0eb], a ld a, $1 - ld [$c0ea], a + ld [wc0ea], a .asm_21e55 ret @@ -970,7 +971,7 @@ Func_21e56: ; 21e56 (8:5e56) call Func_21e9f jr nc, .asm_21e6c .asm_21e60 - ld a, [$c0f1] + ld a, [wc0f1] add e jr nc, .asm_21e67 inc d @@ -986,7 +987,7 @@ Func_21e56: ; 21e56 (8:5e56) Func_21e6d: ; 21e6d (8:5e6d) call Func_21e8b jr nc, .asm_21e88 - ld hl, $c006 + ld hl, wc006 ld e, c ld d, $0 sla e @@ -1007,7 +1008,7 @@ Func_21e6d: ; 21e6d (8:5e6d) ret Func_21e8b: ; 21e8b (8:5e8b) - ld a, [$c02a] + ld a, [wc02a] cp $14 jr nc, .asm_21e94 jr .asm_21e9a @@ -1024,9 +1025,9 @@ Func_21e8b: ; 21e8b (8:5e8b) ret Func_21e9f: ; 21e9f (8:5e9f) - ld a, [$c02d] + ld a, [wc02d] ld b, a - ld a, [$c02a] + ld a, [wc02a] or b cp $9d jr nc, .asm_21ead @@ -1044,27 +1045,27 @@ Func_21e9f: ; 21e9f (8:5e9f) ret Music8_ApplyPitchBend: ; 21eb8 (8:5eb8) - ld hl, $c02e + ld hl, wc02e add hl, bc bit 5, [hl] jp nz, .asm_21eff - ld hl, $c09e + ld hl, wc09e add hl, bc ld e, [hl] - ld hl, $c096 + ld hl, wc096 add hl, bc ld d, [hl] - ld hl, $c07e + ld hl, wc07e add hl, bc ld l, [hl] ld h, b add hl, de ld d, h ld e, l - ld hl, $c08e + ld hl, wc08e add hl, bc push hl - ld hl, $c086 + ld hl, wc086 add hl, bc ld a, [hl] pop hl @@ -1076,26 +1077,26 @@ Music8_ApplyPitchBend: ; 21eb8 (8:5eb8) ld a, $0 adc d ld d, a - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc ld a, [hl] cp d jp c, .asm_21f45 jr nz, .asm_21f32 - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld a, [hl] cp e jp c, .asm_21f45 jr .asm_21f32 .asm_21eff - ld hl, $c09e + ld hl, wc09e add hl, bc ld a, [hl] - ld hl, $c096 + ld hl, wc096 add hl, bc ld d, [hl] - ld hl, $c07e + ld hl, wc07e add hl, bc ld e, [hl] sub e @@ -1103,7 +1104,7 @@ Music8_ApplyPitchBend: ; 21eb8 (8:5eb8) ld a, d sbc b ld d, a - ld hl, $c086 + ld hl, wc086 add hl, bc ld a, [hl] add a @@ -1114,22 +1115,22 @@ Music8_ApplyPitchBend: ; 21eb8 (8:5eb8) ld a, d sbc b ld d, a - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc ld a, d cp [hl] jr c, .asm_21f45 jr nz, .asm_21f32 - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld a, e cp [hl] jr c, .asm_21f45 .asm_21f32 - ld hl, $c09e + ld hl, wc09e add hl, bc ld [hl], e - ld hl, $c096 + ld hl, wc096 add hl, bc ld [hl], d ld b, $3 @@ -1139,54 +1140,54 @@ Music8_ApplyPitchBend: ; 21eb8 (8:5eb8) ld [hl], d ret .asm_21f45 - ld hl, $c02e + ld hl, wc02e add hl, bc res 4, [hl] res 5, [hl] ret Func_21f4e: ; 21f4e (8:5f4e) - ld hl, $c096 + ld hl, wc096 add hl, bc ld [hl], d - ld hl, $c09e + ld hl, wc09e add hl, bc ld [hl], e - ld hl, $c0b6 + ld hl, wc0b6 add hl, bc ld a, [hl] - ld hl, $c076 + ld hl, wc076 add hl, bc sub [hl] jr nc, .asm_21f66 ld a, $1 .asm_21f66 ld [hl], a - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld a, e sub [hl] ld e, a ld a, d sbc b - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc sub [hl] jr c, .asm_21f82 ld d, a ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc set 5, [hl] jr .asm_21fa5 .asm_21f82 - ld hl, $c096 + ld hl, wc096 add hl, bc ld d, [hl] - ld hl, $c09e + ld hl, wc09e add hl, bc ld e, [hl] - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld a, [hl] sub e @@ -1194,17 +1195,17 @@ Func_21f4e: ; 21f4e (8:5f4e) ld a, d sbc b ld d, a - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc ld a, [hl] sub d ld d, a ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc res 5, [hl] .asm_21fa5 - ld hl, $c076 + ld hl, wc076 add hl, bc .asm_21fa9 inc b @@ -1223,20 +1224,20 @@ Func_21f4e: ; 21f4e (8:5f4e) add [hl] ld d, b ld b, $0 - ld hl, $c07e + ld hl, wc07e add hl, bc ld [hl], d - ld hl, $c086 + ld hl, wc086 add hl, bc ld [hl], a - ld hl, $c08e + ld hl, wc08e add hl, bc ld [hl], a ret Music8_ApplyDutyCycle: ; 21fcc (8:5fcc) ld b, $0 - ld hl, $c046 + ld hl, wc046 add hl, bc ld a, [hl] rlca @@ -1257,7 +1258,7 @@ Music8_GetNextMusicByte: ; 21fe4 (8:5fe4) ld a, c add a ld e, a - ld hl, $c006 + ld hl, wc006 add hl, de ld a, [hli] ld e, a @@ -1305,7 +1306,7 @@ Func_22017: ; 22017 (8:6017) add hl, hl ld d, h ld e, l - ld hl, Unknown_222ee + ld hl, Music8_Pitches add hl, de ld e, [hl] inc hl @@ -1325,7 +1326,7 @@ Func_22017: ; 22017 (8:6017) ret Func_22035:: ; 22035 (8:6035) - ld [$c001], a + ld [wc001], a cp $ff jp z, Func_221f3 cp $e9 @@ -1336,63 +1337,63 @@ Func_22035:: ; 22035 (8:6035) jp nc, Func_2210d .asm_2204c xor a - ld [$c000], a - ld [$c003], a - ld [$c0e9], a - ld [$c0e6], a - ld [$c0e7], a + ld [wc000], a + ld [wc003], a + ld [wc0e9], a + ld [wc0e6], a + ld [wc0e7], a ld d, $8 - ld hl, $c016 + ld hl, wc016 call FillMusicRAM8 - ld hl, $c006 + ld hl, wc006 call FillMusicRAM8 ld d, $4 - ld hl, $c026 + ld hl, wc026 call FillMusicRAM8 - ld hl, $c02e + ld hl, wc02e call FillMusicRAM8 - ld hl, $c03e + ld hl, wc03e call FillMusicRAM8 - ld hl, $c046 + ld hl, wc046 call FillMusicRAM8 - ld hl, $c04e + ld hl, wc04e call FillMusicRAM8 - ld hl, $c056 + ld hl, wc056 call FillMusicRAM8 - ld hl, $c05e + ld hl, wc05e call FillMusicRAM8 - ld hl, $c066 + ld hl, wc066 call FillMusicRAM8 - ld hl, $c06e + ld hl, wc06e call FillMusicRAM8 - ld hl, $c036 + ld hl, wc036 call FillMusicRAM8 - ld hl, $c076 + ld hl, wc076 call FillMusicRAM8 - ld hl, $c07e + ld hl, wc07e call FillMusicRAM8 - ld hl, $c086 + ld hl, wc086 call FillMusicRAM8 - ld hl, $c08e + ld hl, wc08e call FillMusicRAM8 - ld hl, $c096 + ld hl, wc096 call FillMusicRAM8 - ld hl, $c09e + ld hl, wc09e call FillMusicRAM8 - ld hl, $c0a6 + ld hl, wc0a6 call FillMusicRAM8 - ld hl, $c0ae + ld hl, wc0ae call FillMusicRAM8 ld a, $1 - ld hl, $c0be + ld hl, wc0be call FillMusicRAM8 - ld hl, $c0b6 + ld hl, wc0b6 call FillMusicRAM8 - ld hl, $c0c6 + ld hl, wc0c6 call FillMusicRAM8 - ld [$c0e8], a + ld [wc0e8], a ld a, $ff - ld [$c004], a + ld [wc004], a xor a ld [$ff24], a ld a, $8 @@ -1417,9 +1418,9 @@ Func_2210d: ; 2210d (8:610d) ld de, SFX_Headers_08 add hl, de ld a, h - ld [$c0ec], a + ld [wc0ec], a ld a, l - ld [$c0ed], a + ld [wc0ed], a ld a, [hl] and $c0 rlca @@ -1432,9 +1433,9 @@ Func_2210d: ; 2210d (8:610d) add c ld c, a ld b, $0 - ld a, [$c0ec] + ld a, [wc0ec] ld h, a - ld a, [$c0ed] + ld a, [wc0ed] ld l, a add hl, bc ld c, d @@ -1442,7 +1443,7 @@ Func_2210d: ; 2210d (8:610d) and $f ld e, a ld d, $0 - ld hl, $c026 + ld hl, wc026 add hl, de ld a, [hl] and a @@ -1450,7 +1451,7 @@ Func_2210d: ; 2210d (8:610d) ld a, e cp $7 jr nz, .asm_22159 - ld a, [$c001] + ld a, [wc001] cp $14 jr nc, .asm_22152 ret @@ -1460,7 +1461,7 @@ Func_2210d: ; 2210d (8:610d) jr z, .asm_22162 jr c, .asm_22162 .asm_22159 - ld a, [$c001] + ld a, [wc001] cp [hl] jr z, .asm_22162 jr c, .asm_22162 @@ -1473,77 +1474,77 @@ Func_2210d: ; 2210d (8:610d) add hl, hl ld d, h ld e, l - ld hl, $c016 + ld hl, wc016 add hl, de ld [hli], a ld [hl], a - ld hl, $c006 + ld hl, wc006 add hl, de ld [hli], a ld [hl], a pop de - ld hl, $c026 + ld hl, wc026 add hl, de ld [hl], a - ld hl, $c02e + ld hl, wc02e add hl, de ld [hl], a - ld hl, $c03e + ld hl, wc03e add hl, de ld [hl], a - ld hl, $c046 + ld hl, wc046 add hl, de ld [hl], a - ld hl, $c04e + ld hl, wc04e add hl, de ld [hl], a - ld hl, $c056 + ld hl, wc056 add hl, de ld [hl], a - ld hl, $c05e + ld hl, wc05e add hl, de ld [hl], a - ld hl, $c066 + ld hl, wc066 add hl, de ld [hl], a - ld hl, $c06e + ld hl, wc06e add hl, de ld [hl], a - ld hl, $c076 + ld hl, wc076 add hl, de ld [hl], a - ld hl, $c07e + ld hl, wc07e add hl, de ld [hl], a - ld hl, $c086 + ld hl, wc086 add hl, de ld [hl], a - ld hl, $c08e + ld hl, wc08e add hl, de ld [hl], a - ld hl, $c096 + ld hl, wc096 add hl, de ld [hl], a - ld hl, $c09e + ld hl, wc09e add hl, de ld [hl], a - ld hl, $c0a6 + ld hl, wc0a6 add hl, de ld [hl], a - ld hl, $c0ae + ld hl, wc0ae add hl, de ld [hl], a - ld hl, $c036 + ld hl, wc036 add hl, de ld [hl], a ld a, $1 - ld hl, $c0be + ld hl, wc0be add hl, de ld [hl], a - ld hl, $c0b6 + ld hl, wc0b6 add hl, de ld [hl], a - ld hl, $c0c6 + ld hl, wc0c6 add hl, de ld [hl], a ld a, e @@ -1577,24 +1578,24 @@ Func_221f3: ; 221f3 (8:61f3) ld a, $77 ld [$ff24], a xor a - ld [$c000], a - ld [$c003], a - ld [$c002], a - ld [$c0e9], a - ld [$c0eb], a - ld [$c0e6], a - ld [$c0e7], a + ld [wc000], a + ld [wc003], a + ld [wc002], a + ld [wc0e9], a + ld [wc0eb], a + ld [wc0e6], a + ld [wc0e7], a ld d, $a0 - ld hl, $c006 + ld hl, wc006 call FillMusicRAM8 ld a, $1 ld d, $18 - ld hl, $c0b6 + ld hl, wc0b6 call FillMusicRAM8 - ld [$c0e8], a - ld [$c0ea], a + ld [wc0e8], a + ld [wc0ea], a ld a, $ff - ld [$c004], a + ld [wc004], a ret ; fills d bytes at hl with a @@ -1607,7 +1608,7 @@ FillMusicRAM8: ; 22248 (8:6248) ret Func_2224e: ; 2224e (8:624e) - ld a, [$c001] + ld a, [wc001] ld l, a ld e, a ld h, $0 @@ -1618,7 +1619,7 @@ Func_2224e: ; 2224e (8:624e) add hl, de ld e, l ld d, h - ld hl, $c006 + ld hl, wc006 ld a, [de] ; get channel number ld b, a rlca @@ -1644,14 +1645,14 @@ Func_2224e: ; 2224e (8:624e) push af ld b, $0 ld c, a - ld hl, $c026 + ld hl, wc026 add hl, bc - ld a, [$c001] + ld a, [wc001] ld [hl], a pop af cp $3 jr c, .asm_22291 - ld hl, $c02e + ld hl, wc02e add hl, bc set 2, [hl] .asm_22291 @@ -1670,32 +1671,32 @@ Func_2224e: ; 2224e (8:624e) ld a, [de] inc de jr nz, .asm_22270 - ld a, [$c001] + ld a, [wc001] cp $14 jr nc, .asm_222aa jr .asm_222d4 .asm_222aa - ld a, [$c001] + ld a, [wc001] cp $86 jr z, .asm_222d4 jr c, .asm_222b5 jr .asm_222d4 .asm_222b5 - ld hl, $c02a + ld hl, wc02a ld [hli], a ld [hli], a ld [hli], a ld [hl], a - ld hl, $c012 ; sfx noise channel pointer + ld hl, wc012 ; sfx noise channel pointer ld de, Noise8_endchannel ld [hl], e inc hl ld [hl], d ; overwrite pointer to point to endchannel - ld a, [$c005] + ld a, [wc005] and a jr nz, .asm_222d4 ld a, [$ff24] - ld [$c005], a + ld [wc005], a ld a, $77 ld [$ff24], a .asm_222d4 @@ -1716,18 +1717,18 @@ Unknown_222e6: ; 222e6 (8:62e6) db $11, $22, $44, $88 ; channels 0-3 db $11, $22, $44, $88 ; channels 4-7 -Unknown_222ee: ; 222ee (8:62ee) - dw $F82C - dw $F89D - dw $F907 - dw $F96B - dw $F9CA - dw $FA23 - dw $FA77 - dw $FAC7 - dw $FB12 - dw $FB58 - dw $FB9B - dw $FBDA +Music8_Pitches: ; 222ee (8:62ee) + dw $F82C ; C_ + dw $F89D ; C# + dw $F907 ; D_ + dw $F96B ; D# + dw $F9CA ; E_ + dw $FA23 ; F_ + dw $FA77 ; F# + dw $FAC7 ; G_ + dw $FB12 ; G# + dw $FB58 ; A_ + dw $FB9B ; A# + dw $FBDA ; B_ diff --git a/audio/engine_3.asm b/audio/engine_3.asm index 3d5ee66f..fabdecef 100644 --- a/audio/engine_3.asm +++ b/audio/engine_3.asm @@ -1,10 +1,10 @@ ; The third of three duplicated sound engines. -Func_7d177:: ; 7d177 (1f:5177) +Music1f_UpdateMusic:: ; 7d177 (1f:5177) ld c, CH0 .loop ld b, $0 - ld hl, $c026 + ld hl, wc026 add hl, bc ld a, [hl] and a @@ -12,13 +12,13 @@ Func_7d177:: ; 7d177 (1f:5177) ld a, c cp CH4 jr nc, .applyAffects ; if sfx channel - ld a, [$c002] + ld a, [wc002] and a jr z, .applyAffects bit 7, a jr nz, .nextChannel set 7, a - ld [$c002], a + ld [wc002], a xor a ld [$ff25], a ld [$ff1a], a @@ -26,7 +26,7 @@ Func_7d177:: ; 7d177 (1f:5177) ld [$ff1a], a jr .nextChannel .applyAffects - call Music1f_Music2_ApplyMusicAffects + call Music1f_ApplyMusicAffects .nextChannel ld a, c inc c ; inc channel number @@ -36,53 +36,54 @@ Func_7d177:: ; 7d177 (1f:5177) ; this routine checks flags for music effects currently applied ; to the channel and calls certain functions based on flags. -; known flags for $c02e: +; known flags for wc02e: +; 0: toggleperfectpitch has been used ; 1: call has been used ; 3: a toggle used only by this routine for vibrato ; 4: pitchbend flag ; 6: dutycycle flag -Music1f_Music2_ApplyMusicAffects: ; 7d1ac (1f:51ac) +Music1f_ApplyMusicAffects: ; 7d1ac (1f:51ac) ld b, $0 - ld hl, $c0b6 ; delay until next note + ld hl, wc0b6 ; delay until next note add hl, bc ld a, [hl] cp $1 ; if delay is 1, play next note - jp z, Music1f_Music2_PlayNextNote + jp z, Music1f_PlayNextNote dec a ; otherwise, decrease the delay timer ld [hl], a ld a, c cp CH4 jr nc, .startChecks ; if a sfx channel - ld hl, $c02a + ld hl, wc02a add hl, bc ld a, [hl] and a jr z, .startChecks ret .startChecks - ld hl, $c02e + ld hl, wc02e add hl, bc bit 6, [hl] ; dutycycle jr z, .checkForExecuteMusic call Music1f_ApplyDutyCycle .checkForExecuteMusic ld b, $0 - ld hl, $c036 + ld hl, wc036 add hl, bc bit 0, [hl] jr nz, .checkForPitchBend - ld hl, $c02e + ld hl, wc02e add hl, bc bit 2, [hl] jr nz, .disablePitchBendVibrato .checkForPitchBend - ld hl, $c02e + ld hl, wc02e add hl, bc bit 4, [hl] ; pitchbend jr z, .checkVibratoDelay jp Music1f_ApplyPitchBend .checkVibratoDelay - ld hl, $c04e ; vibrato delay + ld hl, wc04e ; vibrato delay add hl, bc ld a, [hl] and a ; check if delay is over @@ -91,7 +92,7 @@ Music1f_Music2_ApplyMusicAffects: ; 7d1ac (1f:51ac) .disablePitchBendVibrato ret .checkForVibrato - ld hl, $c056 ; vibrato rate + ld hl, wc056 ; vibrato rate add hl, bc ld a, [hl] and a @@ -99,7 +100,7 @@ Music1f_Music2_ApplyMusicAffects: ; 7d1ac (1f:51ac) ret ; no vibrato .vibrato ld d, a - ld hl, $c05e + ld hl, wc05e add hl, bc ld a, [hl] and $f @@ -112,10 +113,10 @@ Music1f_Music2_ApplyMusicAffects: ; 7d1ac (1f:51ac) swap [hl] or [hl] ld [hl], a ; reset the vibrato value and start again - ld hl, $c066 + ld hl, wc066 add hl, bc ld e, [hl] ; get note pitch - ld hl, $c02e + ld hl, wc02e add hl, bc bit 3, [hl] ; this is the only code that sets/resets bit three so jr z, .unset ; it continuously alternates which path it takes @@ -147,14 +148,14 @@ Music1f_Music2_ApplyMusicAffects: ; 7d1ac (1f:51ac) ; this routine executes all music commands that take up no time, ; like tempo changes, duty changes etc. and doesn't return ; until the first note is reached -Music1f_Music2_PlayNextNote: ; 7d244 (1f:5244) - ld hl, $c06e +Music1f_PlayNextNote: ; 7d244 (1f:5244) + ld hl, wc06e add hl, bc ld a, [hl] - ld hl, $c04e + ld hl, wc04e add hl, bc ld [hl], a - ld hl, $c02e + ld hl, wc02e add hl, bc res 4, [hl] res 5, [hl] @@ -167,7 +168,7 @@ Music1f_endchannel: ; 7d25a (1f:525a) cp $ff ; is this command an endchannel? jp nz, Music1f_callchannel ; no ld b, $0 ; yes - ld hl, $c02e + ld hl, wc02e add hl, bc bit 1, [hl] jr nz, .returnFromCall @@ -177,7 +178,7 @@ Music1f_endchannel: ; 7d25a (1f:525a) jr .asm_7d2b3 .noiseOrSfxChannel res 2, [hl] - ld hl, $c036 + ld hl, wc036 add hl, bc res 0, [hl] cp CH6 @@ -188,11 +189,11 @@ Music1f_endchannel: ; 7d25a (1f:525a) ld [$ff1a], a .notSfxChannel3 jr nz, .asm_7d296 - ld a, [$c003] + ld a, [wc003] and a jr z, .asm_7d296 xor a - ld [$c003], a + ld [wc003], a jr .asm_7d2b3 .asm_7d296 jr .asm_7d2bc @@ -202,10 +203,10 @@ Music1f_endchannel: ; 7d25a (1f:525a) ld a, c add a ld e, a - ld hl, $c006 + ld hl, wc006 add hl, de push hl ; store current channel address - ld hl, $c016 + ld hl, wc016 add hl, de ld e, l ld d, h @@ -223,12 +224,12 @@ Music1f_endchannel: ; 7d25a (1f:525a) and [hl] ld [$ff25], a .asm_7d2bc - ld a, [$c02a] + ld a, [wc02a] cp $14 jr nc, .asm_7d2c5 jr .asm_7d2e2 .asm_7d2c5 - ld a, [$c02a] + ld a, [wc02a] cp $86 jr z, .asm_7d2e2 jr c, .asm_7d2d0 @@ -240,12 +241,12 @@ Music1f_endchannel: ; 7d25a (1f:525a) call Func_7d73b ret c .asm_7d2d9 - ld a, [$c005] + ld a, [wc005] ld [$ff24], a xor a - ld [$c005], a + ld [wc005], a .asm_7d2e2 - ld hl, $c026 + ld hl, wc026 add hl, bc ld [hl], b ret @@ -264,10 +265,10 @@ Music1f_callchannel: ; 7d2e8 (1f:52e8) ld a, c add a ld e, a - ld hl, $c006 + ld hl, wc006 add hl, de push hl - ld hl, $c016 + ld hl, wc016 add hl, de ld e, l ld d, h @@ -282,7 +283,7 @@ Music1f_callchannel: ; 7d2e8 (1f:52e8) inc hl ld [hl], d ; overwrite current address with pointer ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc set 1, [hl] ; set the call flag jp Music1f_endchannel @@ -295,7 +296,7 @@ Music1f_loopchannel: ; 7d31d (1f:531d) and a jr z, .infiniteLoop ld b, $0 - ld hl, $c0be + ld hl, wc0be add hl, bc ld a, [hl] cp e @@ -318,7 +319,7 @@ Music1f_loopchannel: ; 7d31d (1f:531d) ld a, c add a ld e, a - ld hl, $c006 + ld hl, wc006 add hl, de pop af ld [hli], a @@ -328,11 +329,11 @@ Music1f_loopchannel: ; 7d31d (1f:531d) Music1f_notetype: ; 7d358 (1f:5358) and $f0 cp $d0 ; is this command a notetype? - jp nz, Music1f_togglecall ; no + jp nz, Music1f_toggleperfectpitch ; no ld a, d ; yes and $f ld b, $0 - ld hl, $c0c6 + ld hl, wc0c6 add hl, bc ld [hl], a ; store low nibble as speed ld a, c @@ -345,10 +346,10 @@ Music1f_notetype: ; 7d358 (1f:5358) jr z, .musicChannel3 cp CH6 jr nz, .notChannel3 - ld hl, $c0e7 + ld hl, wc0e7 jr .sfxChannel3 .musicChannel3 - ld hl, $c0e6 + ld hl, wc0e6 .sfxChannel3 ld a, d and $f @@ -363,22 +364,22 @@ Music1f_notetype: ; 7d358 (1f:5358) ; else, store volume (high nibble) and fade (low nibble) .notChannel3 ld b, $0 - ld hl, $c0de + ld hl, wc0de add hl, bc ld [hl], d .noiseChannel jp Music1f_endchannel -Music1f_togglecall: ; 7d397 (1f:5397) +Music1f_toggleperfectpitch: ; 7d397 (1f:5397) ld a, d - cp $e8 ; is this command an togglecall? + cp $e8 ; is this command a toggleperfectpitch? jr nz, Music1f_vibrato ; no ld b, $0 ; yes - ld hl, $c02e + ld hl, wc02e add hl, bc ld a, [hl] xor $1 - ld [hl], a ; flip bit 0 of $c02e (toggle returning from call) + ld [hl], a ; flip bit 0 of wc02e jp Music1f_endchannel Music1f_vibrato: ; 7d3a9 (1f:53a9) @@ -386,10 +387,10 @@ Music1f_vibrato: ; 7d3a9 (1f:53a9) jr nz, Music1f_pitchbend ; no call Music1f_GetNextMusicByte ; yes ld b, $0 - ld hl, $c04e + ld hl, wc04e add hl, bc ld [hl], a ; store delay - ld hl, $c06e + ld hl, wc06e add hl, bc ld [hl], a ; store delay call Music1f_GetNextMusicByte @@ -397,7 +398,7 @@ Music1f_vibrato: ; 7d3a9 (1f:53a9) and $f0 swap a ld b, $0 - ld hl, $c056 + ld hl, wc056 add hl, bc srl a ld e, a @@ -408,7 +409,7 @@ Music1f_vibrato: ; 7d3a9 (1f:53a9) ld a, d and $f ld d, a - ld hl, $c05e + ld hl, wc05e add hl, bc swap a or d @@ -420,7 +421,7 @@ Music1f_pitchbend: ; 7d3e1 (1f:53e1) jr nz, Music1f_duty ; no call Music1f_GetNextMusicByte ; yes ld b, $0 - ld hl, $c076 + ld hl, wc076 add hl, bc ld [hl], a ; store first param call Music1f_GetNextMusicByte @@ -432,14 +433,14 @@ Music1f_pitchbend: ; 7d3e1 (1f:53e1) and $f call Func_7d8cc ld b, $0 - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc ld [hl], d ; store unknown part of second param - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld [hl], e ; store unknown part of second param ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc set 4, [hl] ; set pitchbend flag call Music1f_GetNextMusicByte @@ -454,45 +455,45 @@ Music1f_duty: ; 7d419 (1f:5419) rrca and $c0 ld b, $0 - ld hl, $c03e + ld hl, wc03e add hl, bc ld [hl], a ; store duty jp Music1f_endchannel Music1f_tempo: ; 7d42e (1f:542e) cp $ed ; is this command a tempo? - jr nz, Music1f_unknownmusic0xee ; no + jr nz, Music1f_stereopanning ; no ld a, c ; yes cp CH4 jr nc, .sfxChannel call Music1f_GetNextMusicByte - ld [$c0e8], a ; store first param + ld [wc0e8], a ; store first param call Music1f_GetNextMusicByte - ld [$c0e9], a ; store second param + ld [wc0e9], a ; store second param xor a - ld [$c0ce], a ; clear RAM - ld [$c0cf], a - ld [$c0d0], a - ld [$c0d1], a + ld [wc0ce], a ; clear RAM + ld [wc0cf], a + ld [wc0d0], a + ld [wc0d1], a jr .musicChannelDone .sfxChannel call Music1f_GetNextMusicByte - ld [$c0ea], a ; store first param + ld [wc0ea], a ; store first param call Music1f_GetNextMusicByte - ld [$c0eb], a ; store second param + ld [wc0eb], a ; store second param xor a - ld [$c0d2], a ; clear RAM - ld [$c0d3], a - ld [$c0d4], a - ld [$c0d5], a + ld [wc0d2], a ; clear RAM + ld [wc0d3], a + ld [wc0d4], a + ld [wc0d5], a .musicChannelDone jp Music1f_endchannel -Music1f_unknownmusic0xee: ; 7d46e (1f:546e) - cp $ee ; is this command an unknownmusic0xee? +Music1f_stereopanning: ; 7d46e (1f:546e) + cp $ee ; is this command a stereopanning? jr nz, Music1f_unknownmusic0xef ; no call Music1f_GetNextMusicByte ; yes - ld [$c004], a ; store first param + ld [wc004], a ; store panning jp Music1f_endchannel ; this appears to never be used @@ -503,45 +504,45 @@ Music1f_unknownmusic0xef: ; 7d47b (1f:547b) push bc call Func_7d8ea pop bc - ld a, [$c003] + ld a, [wc003] and a jr nz, .skip - ld a, [$c02d] - ld [$c003], a + ld a, [wc02d] + ld [wc003], a xor a - ld [$c02d], a + ld [wc02d], a .skip jp Music1f_endchannel Music1f_dutycycle: ; 7d49a (1f:549a) cp $fc ; is this command a dutycycle? - jr nz, Music1f_stereopanning ; no + jr nz, Music1f_volume ; no call Music1f_GetNextMusicByte ; yes ld b, $0 - ld hl, $c046 + ld hl, wc046 add hl, bc ld [hl], a ; store full cycle and $c0 - ld hl, $c03e + ld hl, wc03e add hl, bc ld [hl], a ; store first duty - ld hl, $c02e + ld hl, wc02e add hl, bc set 6, [hl] ; set duty flag jp Music1f_endchannel -Music1f_stereopanning: ; 7d4b8 (1f:54b8) - cp $f0 ; is this command a stereopanning? +Music1f_volume: ; 7d4b8 (1f:54b8) + cp $f0 ; is this command a volume? jr nz, Music1f_executemusic ; no call Music1f_GetNextMusicByte ; yes - ld [$ff24], a ; store stereopanning + ld [$ff24], a ; store volume jp Music1f_endchannel Music1f_executemusic: ; 7d4c4 (1f:54c4) cp $f8 ; is this command an executemusic? jr nz, Music1f_octave ; no ld b, $0 ; yes - ld hl, $c036 + ld hl, wc036 add hl, bc set 0, [hl] jp Music1f_endchannel @@ -550,7 +551,7 @@ Music1f_octave: ; 7d4d3 (1f:54d3) and $f0 cp $e0 ; is this command an octave? jr nz, Music1f_unknownsfx0x20 ; no - ld hl, $c0d6 ; yes + ld hl, wc0d6 ; yes ld b, $0 add hl, bc ld a, d @@ -565,14 +566,14 @@ Music1f_unknownsfx0x20: ; 7d4e6 (1f:54e6) cp CH3 ; is this a noise or sfx channel? jr c, Music1f_unknownsfx0x10 ; no ld b, $0 - ld hl, $c036 + ld hl, wc036 add hl, bc bit 0, [hl] jr nz, Music1f_unknownsfx0x10 ; no call Music1f_notelength ; yes ld d, a ld b, $0 - ld hl, $c03e + ld hl, wc03e add hl, bc ld a, [hl] or d @@ -611,7 +612,7 @@ Music1f_unknownsfx0x10 ; 7d533 (1f:5533) cp $10 ; is this command an unknownsfx0x10? jr nz, Music1f_note ; no ld b, $0 - ld hl, $c036 + ld hl, wc036 add hl, bc bit 0, [hl] jr nz, Music1f_note ; no @@ -646,7 +647,7 @@ Music1f_dnote: ; 7d569 (1f:5569) call Music1f_GetNextMusicByte ; get dnote instrument asm_7d571 ld d, a - ld a, [$c003] + ld a, [wc003] and a jr nz, .asm_7d57c ld a, d @@ -663,7 +664,7 @@ Music1f_notelength: ; 7d57e (1f:557e) ld b, $0 ld e, a ; store note length (in 16ths) ld d, b - ld hl, $c0c6 + ld hl, wc0c6 add hl, bc ld a, [hl] ld l, b @@ -671,9 +672,9 @@ Music1f_notelength: ; 7d57e (1f:557e) ld a, c cp CH4 jr nc, .sfxChannel - ld a, [$c0e8] + ld a, [wc0e8] ld d, a - ld a, [$c0e9] + ld a, [wc0e9] ld e, a jr .skip .sfxChannel @@ -682,31 +683,31 @@ Music1f_notelength: ; 7d57e (1f:557e) cp CH7 jr z, .skip ; if noise channel call Func_7d707 - ld a, [$c0ea] + ld a, [wc0ea] ld d, a - ld a, [$c0eb] + ld a, [wc0eb] ld e, a .skip ld a, l ld b, $0 - ld hl, $c0ce + ld hl, wc0ce add hl, bc ld l, [hl] call Func_7d8bb ld e, l ld d, h - ld hl, $c0ce + ld hl, wc0ce add hl, bc ld [hl], e ld a, d - ld hl, $c0b6 + ld hl, wc0b6 add hl, bc ld [hl], a - ld hl, $c036 + ld hl, wc036 add hl, bc bit 0, [hl] jr nz, Music1f_notepitch - ld hl, $c02e + ld hl, wc02e add hl, bc bit 2, [hl] jr z, Music1f_notepitch @@ -721,7 +722,7 @@ Music1f_notepitch: ; 7d5dc (1f:55dc) ld a, c cp CH4 jr nc, .sfxChannel - ld hl, $c02a + ld hl, wc02a add hl, bc ld a, [hl] and a @@ -754,12 +755,12 @@ Music1f_notepitch: ; 7d5dc (1f:55dc) .notRest swap a ld b, $0 - ld hl, $c0d6 + ld hl, wc0d6 add hl, bc ld b, [hl] call Func_7d8cc ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc bit 4, [hl] jr z, .asm_7d62c @@ -769,7 +770,7 @@ Music1f_notepitch: ; 7d5dc (1f:55dc) ld a, c cp CH4 jr nc, .skip ; if sfx Channel - ld hl, $c02a + ld hl, wc02a ld d, $0 ld e, a add hl, de @@ -782,7 +783,7 @@ Music1f_notepitch: ; 7d5dc (1f:55dc) ret .skip ld b, $0 - ld hl, $c0de + ld hl, wc0de add hl, bc ld d, [hl] ld b, $2 @@ -792,15 +793,15 @@ Music1f_notepitch: ; 7d5dc (1f:55dc) call Func_7d66c pop de ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc - bit 0, [hl] - jr z, .asm_7d663 - inc e - jr nc, .asm_7d663 + bit 0, [hl] ; has toggleperfectpitch been used? + jr z, .skip2 + inc e ; if yes, increment the pitch by 1 + jr nc, .skip2 inc d -.asm_7d663 - ld hl, $c066 +.skip2 + ld hl, wc066 add hl, bc ld [hl], e call Func_7d6bf @@ -818,13 +819,13 @@ Func_7d66c: ; 7d66c (1f:566c) jr z, .sfxNoiseChannel cp CH4 jr nc, .skip ; if sfx channel - ld hl, $c02a + ld hl, wc02a add hl, bc ld a, [hl] and a jr nz, .skip .sfxNoiseChannel - ld a, [$c004] + ld a, [wc004] ld hl, Unknown_7db9b add hl, bc and [hl] @@ -842,7 +843,7 @@ Func_7d66c: ; 7d66c (1f:566c) Func_7d69d: ; 7d69d (1f:569d) ld b, $0 - ld hl, $c0b6 + ld hl, wc0b6 add hl, bc ld d, [hl] ld a, c @@ -853,7 +854,7 @@ Func_7d69d: ; 7d69d (1f:569d) ld a, d and $3f ld d, a - ld hl, $c03e + ld hl, wc03e add hl, bc ld a, [hl] or d @@ -873,16 +874,16 @@ Func_7d6bf: ; 7d6bf (1f:56bf) ; fall through .channel3 push de - ld de, $c0e6 + ld de, wc0e6 cp CH2 jr z, .musicChannel3 - ld de, $c0e7 + ld de, wc0e7 .musicChannel3 ld a, [de] add a ld d, $0 ld e, a - ld hl, Music1f_Channel3DutyPointers + ld hl, Music1f_WavePointers add hl, de ld e, [hl] inc hl @@ -919,27 +920,27 @@ Func_7d707: ; 7d707 (1f:5707) call Func_7d759 jr nc, .asm_7d71f ld d, $0 - ld a, [$c0f2] + ld a, [wc0f2] add $80 jr nc, .asm_7d716 inc d .asm_7d716 - ld [$c0eb], a + ld [wc0eb], a ld a, d - ld [$c0ea], a + ld [wc0ea], a jr .asm_7d728 .asm_7d71f xor a - ld [$c0eb], a + ld [wc0eb], a ld a, $1 - ld [$c0ea], a + ld [wc0ea], a .asm_7d728 ret Func_7d729: ; 7d729 (1f:5729) call Func_7d759 jr nc, .asm_7d73a - ld a, [$c0f1] + ld a, [wc0f1] add e jr nc, .asm_7d735 inc d @@ -955,7 +956,7 @@ Func_7d729: ; 7d729 (1f:5729) Func_7d73b: ; 7d73b (1f:573b) call Func_7d759 jr nc, .asm_7d756 - ld hl, $c006 + ld hl, wc006 ld e, c ld d, $0 sla e @@ -976,7 +977,7 @@ Func_7d73b: ; 7d73b (1f:573b) ret Func_7d759: ; 7d759 (1f:5759) - ld a, [$c02a] + ld a, [wc02a] cp $14 jr nc, .asm_7d762 jr .asm_7d768 @@ -993,27 +994,27 @@ Func_7d759: ; 7d759 (1f:5759) ret Music1f_ApplyPitchBend: ; 7d76d (1f:576d) - ld hl, $c02e + ld hl, wc02e add hl, bc bit 5, [hl] jp nz, .asm_7d7b4 - ld hl, $c09e + ld hl, wc09e add hl, bc ld e, [hl] - ld hl, $c096 + ld hl, wc096 add hl, bc ld d, [hl] - ld hl, $c07e + ld hl, wc07e add hl, bc ld l, [hl] ld h, b add hl, de ld d, h ld e, l - ld hl, $c08e + ld hl, wc08e add hl, bc push hl - ld hl, $c086 + ld hl, wc086 add hl, bc ld a, [hl] pop hl @@ -1025,26 +1026,26 @@ Music1f_ApplyPitchBend: ; 7d76d (1f:576d) ld a, $0 adc d ld d, a - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc ld a, [hl] cp d jp c, .asm_7d7fa jr nz, .asm_7d7e7 - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld a, [hl] cp e jp c, .asm_7d7fa jr .asm_7d7e7 .asm_7d7b4 - ld hl, $c09e + ld hl, wc09e add hl, bc ld a, [hl] - ld hl, $c096 + ld hl, wc096 add hl, bc ld d, [hl] - ld hl, $c07e + ld hl, wc07e add hl, bc ld e, [hl] sub e @@ -1052,7 +1053,7 @@ Music1f_ApplyPitchBend: ; 7d76d (1f:576d) ld a, d sbc b ld d, a - ld hl, $c086 + ld hl, wc086 add hl, bc ld a, [hl] add a @@ -1063,22 +1064,22 @@ Music1f_ApplyPitchBend: ; 7d76d (1f:576d) ld a, d sbc b ld d, a - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc ld a, d cp [hl] jr c, .asm_7d7fa jr nz, .asm_7d7e7 - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld a, e cp [hl] jr c, .asm_7d7fa .asm_7d7e7 - ld hl, $c09e + ld hl, wc09e add hl, bc ld [hl], e - ld hl, $c096 + ld hl, wc096 add hl, bc ld [hl], d ld b, $3 @@ -1088,54 +1089,54 @@ Music1f_ApplyPitchBend: ; 7d76d (1f:576d) ld [hl], d ret .asm_7d7fa - ld hl, $c02e + ld hl, wc02e add hl, bc res 4, [hl] res 5, [hl] ret Func_7d803: ; 7d803 (1f:5803) - ld hl, $c096 + ld hl, wc096 add hl, bc ld [hl], d - ld hl, $c09e + ld hl, wc09e add hl, bc ld [hl], e - ld hl, $c0b6 + ld hl, wc0b6 add hl, bc ld a, [hl] - ld hl, $c076 + ld hl, wc076 add hl, bc sub [hl] jr nc, .asm_7d81b ld a, $1 .asm_7d81b ld [hl], a - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld a, e sub [hl] ld e, a ld a, d sbc b - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc sub [hl] jr c, .asm_7d837 ld d, a ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc set 5, [hl] jr .asm_7d85a .asm_7d837 - ld hl, $c096 + ld hl, wc096 add hl, bc ld d, [hl] - ld hl, $c09e + ld hl, wc09e add hl, bc ld e, [hl] - ld hl, $c0ae + ld hl, wc0ae add hl, bc ld a, [hl] sub e @@ -1143,17 +1144,17 @@ Func_7d803: ; 7d803 (1f:5803) ld a, d sbc b ld d, a - ld hl, $c0a6 + ld hl, wc0a6 add hl, bc ld a, [hl] sub d ld d, a ld b, $0 - ld hl, $c02e + ld hl, wc02e add hl, bc res 5, [hl] .asm_7d85a - ld hl, $c076 + ld hl, wc076 add hl, bc .asm_7d85e inc b @@ -1172,20 +1173,20 @@ Func_7d803: ; 7d803 (1f:5803) add [hl] ld d, b ld b, $0 - ld hl, $c07e + ld hl, wc07e add hl, bc ld [hl], d - ld hl, $c086 + ld hl, wc086 add hl, bc ld [hl], a - ld hl, $c08e + ld hl, wc08e add hl, bc ld [hl], a ret Music1f_ApplyDutyCycle: ; 7d881 (1f:5881) ld b, $0 - ld hl, $c046 + ld hl, wc046 add hl, bc ld a, [hl] rlca @@ -1206,7 +1207,7 @@ Music1f_GetNextMusicByte: ; 7d899 (1f:5899) ld a, c add a ld e, a - ld hl, $c006 + ld hl, wc006 add hl, de ld a, [hli] ld e, a @@ -1254,7 +1255,7 @@ Func_7d8cc: ; 7d8cc (1f:58cc) add hl, hl ld d, h ld e, l - ld hl, Unknown_7dba3 + ld hl, Music1f_Pitches add hl, de ld e, [hl] inc hl @@ -1274,7 +1275,7 @@ Func_7d8cc: ; 7d8cc (1f:58cc) ret Func_7d8ea:: ; 7d8ea (1f:58ea) - ld [$c001], a + ld [wc001], a cp $ff jp z, Func_7daa8 cp $c2 @@ -1285,63 +1286,63 @@ Func_7d8ea:: ; 7d8ea (1f:58ea) jp nc, Func_7d9c2 .asm_7d901 xor a - ld [$c000], a - ld [$c003], a - ld [$c0e9], a - ld [$c0e6], a - ld [$c0e7], a + ld [wc000], a + ld [wc003], a + ld [wc0e9], a + ld [wc0e6], a + ld [wc0e7], a ld d, $8 - ld hl, $c016 + ld hl, wc016 call FillMusicRAM1f - ld hl, $c006 + ld hl, wc006 call FillMusicRAM1f ld d, $4 - ld hl, $c026 + ld hl, wc026 call FillMusicRAM1f - ld hl, $c02e + ld hl, wc02e call FillMusicRAM1f - ld hl, $c03e + ld hl, wc03e call FillMusicRAM1f - ld hl, $c046 + ld hl, wc046 call FillMusicRAM1f - ld hl, $c04e + ld hl, wc04e call FillMusicRAM1f - ld hl, $c056 + ld hl, wc056 call FillMusicRAM1f - ld hl, $c05e + ld hl, wc05e call FillMusicRAM1f - ld hl, $c066 + ld hl, wc066 call FillMusicRAM1f - ld hl, $c06e + ld hl, wc06e call FillMusicRAM1f - ld hl, $c036 + ld hl, wc036 call FillMusicRAM1f - ld hl, $c076 + ld hl, wc076 call FillMusicRAM1f - ld hl, $c07e + ld hl, wc07e call FillMusicRAM1f - ld hl, $c086 + ld hl, wc086 call FillMusicRAM1f - ld hl, $c08e + ld hl, wc08e call FillMusicRAM1f - ld hl, $c096 + ld hl, wc096 call FillMusicRAM1f - ld hl, $c09e + ld hl, wc09e call FillMusicRAM1f - ld hl, $c0a6 + ld hl, wc0a6 call FillMusicRAM1f - ld hl, $c0ae + ld hl, wc0ae call FillMusicRAM1f ld a, $1 - ld hl, $c0be + ld hl, wc0be call FillMusicRAM1f - ld hl, $c0b6 + ld hl, wc0b6 call FillMusicRAM1f - ld hl, $c0c6 + ld hl, wc0c6 call FillMusicRAM1f - ld [$c0e8], a + ld [wc0e8], a ld a, $ff - ld [$c004], a + ld [wc004], a xor a ld [$ff24], a ld a, $8 @@ -1366,9 +1367,9 @@ Func_7d9c2: ; 7d9c2 (1f:59c2) ld de, SFX_Headers_1f add hl, de ld a, h - ld [$c0ec], a + ld [wc0ec], a ld a, l - ld [$c0ed], a + ld [wc0ed], a ld a, [hl] and $c0 rlca @@ -1381,9 +1382,9 @@ Func_7d9c2: ; 7d9c2 (1f:59c2) add c ld c, a ld b, $0 - ld a, [$c0ec] + ld a, [wc0ec] ld h, a - ld a, [$c0ed] + ld a, [wc0ed] ld l, a add hl, bc ld c, d @@ -1391,7 +1392,7 @@ Func_7d9c2: ; 7d9c2 (1f:59c2) and $f ld e, a ld d, $0 - ld hl, $c026 + ld hl, wc026 add hl, de ld a, [hl] and a @@ -1399,7 +1400,7 @@ Func_7d9c2: ; 7d9c2 (1f:59c2) ld a, e cp $7 jr nz, .asm_7da0e - ld a, [$c001] + ld a, [wc001] cp $14 jr nc, .asm_7da07 ret @@ -1409,7 +1410,7 @@ Func_7d9c2: ; 7d9c2 (1f:59c2) jr z, .asm_7da17 jr c, .asm_7da17 .asm_7da0e - ld a, [$c001] + ld a, [wc001] cp [hl] jr z, .asm_7da17 jr c, .asm_7da17 @@ -1422,77 +1423,77 @@ Func_7d9c2: ; 7d9c2 (1f:59c2) add hl, hl ld d, h ld e, l - ld hl, $c016 + ld hl, wc016 add hl, de ld [hli], a ld [hl], a - ld hl, $c006 + ld hl, wc006 add hl, de ld [hli], a ld [hl], a pop de - ld hl, $c026 + ld hl, wc026 add hl, de ld [hl], a - ld hl, $c02e + ld hl, wc02e add hl, de ld [hl], a - ld hl, $c03e + ld hl, wc03e add hl, de ld [hl], a - ld hl, $c046 + ld hl, wc046 add hl, de ld [hl], a - ld hl, $c04e + ld hl, wc04e add hl, de ld [hl], a - ld hl, $c056 + ld hl, wc056 add hl, de ld [hl], a - ld hl, $c05e + ld hl, wc05e add hl, de ld [hl], a - ld hl, $c066 + ld hl, wc066 add hl, de ld [hl], a - ld hl, $c06e + ld hl, wc06e add hl, de ld [hl], a - ld hl, $c076 + ld hl, wc076 add hl, de ld [hl], a - ld hl, $c07e + ld hl, wc07e add hl, de ld [hl], a - ld hl, $c086 + ld hl, wc086 add hl, de ld [hl], a - ld hl, $c08e + ld hl, wc08e add hl, de ld [hl], a - ld hl, $c096 + ld hl, wc096 add hl, de ld [hl], a - ld hl, $c09e + ld hl, wc09e add hl, de ld [hl], a - ld hl, $c0a6 + ld hl, wc0a6 add hl, de ld [hl], a - ld hl, $c0ae + ld hl, wc0ae add hl, de ld [hl], a - ld hl, $c036 + ld hl, wc036 add hl, de ld [hl], a ld a, $1 - ld hl, $c0be + ld hl, wc0be add hl, de ld [hl], a - ld hl, $c0b6 + ld hl, wc0b6 add hl, de ld [hl], a - ld hl, $c0c6 + ld hl, wc0c6 add hl, de ld [hl], a ld a, e @@ -1526,24 +1527,24 @@ Func_7daa8: ; 7daa8 (1f:5aa8) ld a, $77 ld [$ff24], a xor a - ld [$c000], a - ld [$c003], a - ld [$c002], a - ld [$c0e9], a - ld [$c0eb], a - ld [$c0e6], a - ld [$c0e7], a + ld [wc000], a + ld [wc003], a + ld [wc002], a + ld [wc0e9], a + ld [wc0eb], a + ld [wc0e6], a + ld [wc0e7], a ld d, $a0 - ld hl, $c006 + ld hl, wc006 call FillMusicRAM1f ld a, $1 ld d, $18 - ld hl, $c0b6 + ld hl, wc0b6 call FillMusicRAM1f - ld [$c0e8], a - ld [$c0ea], a + ld [wc0e8], a + ld [wc0ea], a ld a, $ff - ld [$c004], a + ld [wc004], a ret ; fills d bytes at hl with a @@ -1556,7 +1557,7 @@ FillMusicRAM1f: ; 7dafd (1f:5afd) ret Func_7db03: ; 7db03 (1f:5b03) - ld a, [$c001] + ld a, [wc001] ld l, a ld e, a ld h, $0 @@ -1567,7 +1568,7 @@ Func_7db03: ; 7db03 (1f:5b03) add hl, de ld e, l ld d, h - ld hl, $c006 + ld hl, wc006 ld a, [de] ; get channel number ld b, a rlca @@ -1593,14 +1594,14 @@ Func_7db03: ; 7db03 (1f:5b03) push af ld b, $0 ld c, a - ld hl, $c026 + ld hl, wc026 add hl, bc - ld a, [$c001] + ld a, [wc001] ld [hl], a pop af cp $3 jr c, .asm_7db46 - ld hl, $c02e + ld hl, wc02e add hl, bc set 2, [hl] .asm_7db46 @@ -1619,32 +1620,32 @@ Func_7db03: ; 7db03 (1f:5b03) ld a, [de] inc de jr nz, .asm_7db25 - ld a, [$c001] + ld a, [wc001] cp $14 jr nc, .asm_7db5f jr .asm_7db89 .asm_7db5f - ld a, [$c001] + ld a, [wc001] cp $86 jr z, .asm_7db89 jr c, .asm_7db6a jr .asm_7db89 .asm_7db6a - ld hl, $c02a + ld hl, wc02a ld [hli], a ld [hli], a ld [hli], a ld [hl], a - ld hl, $c012 ; sfx noise channel pointer + ld hl, wc012 ; sfx noise channel pointer ld de, Noise1f_endchannel ld [hl], e inc hl ld [hl], d ; overwrite pointer to point to endchannel - ld a, [$c005] + ld a, [wc005] and a jr nz, .asm_7db89 ld a, [$ff24] - ld [$c005], a + ld [wc005], a ld a, $77 ld [$ff24], a .asm_7db89 @@ -1665,18 +1666,18 @@ Unknown_7db9b: ; 7db9b (1f:5b9b) db $11, $22, $44, $88 ; channels 0-3 db $11, $22, $44, $88 ; channels 4-7 -Unknown_7dba3: ; 7dba3 (1f:5ba3) - dw $F82C - dw $F89D - dw $F907 - dw $F96B - dw $F9CA - dw $FA23 - dw $FA77 - dw $FAC7 - dw $FB12 - dw $FB58 - dw $FB9B - dw $FBDA +Music1f_Pitches: ; 7dba3 (1f:5ba3) + dw $F82C ; C_ + dw $F89D ; C# + dw $F907 ; D_ + dw $F96B ; D# + dw $F9CA ; E_ + dw $FA23 ; F_ + dw $FA77 ; F# + dw $FAC7 ; G_ + dw $FB12 ; G# + dw $FB58 ; A_ + dw $FB9B ; A# + dw $FBDA ; B_ diff --git a/audio/headers/musicheaders02.asm b/audio/headers/musicheaders02.asm index 3adb23c5..dd5b4b5b 100644 --- a/audio/headers/musicheaders02.asm +++ b/audio/headers/musicheaders02.asm @@ -182,5 +182,5 @@ Music_IndigoPlateau:: ; 82f1 (2:42f1) dw Music_IndigoPlateau_Ch3 db CH3 dw Music_IndigoPlateau_Ch4 - + ; 0x82fd
\ No newline at end of file diff --git a/audio/headers/musicheaders08.asm b/audio/headers/musicheaders08.asm index fbc3f9ae..b4ef7375 100644 --- a/audio/headers/musicheaders08.asm +++ b/audio/headers/musicheaders08.asm @@ -53,5 +53,5 @@ Music_DefeatedGymLeader:: ; 202f4 (8:42f4) dw Music_DefeatedGymLeader_Ch2 db CH2 dw Music_DefeatedGymLeader_Ch3 - + ; 202fd
\ No newline at end of file diff --git a/audio/music/bikeriding.asm b/audio/music/bikeriding.asm index 13776fe1..662f2fc8 100644 --- a/audio/music/bikeriding.asm +++ b/audio/music/bikeriding.asm @@ -1,153 +1,153 @@ Music_BikeRiding_Ch1:: ; 7dbbb (1f:5bbb) - tempo 0, 144 - stereopanning 119 + tempo 144 + volume 7, 7 duty 3 vibrato 8, 1, 4 notetype 12, 11, 5 octave 3 - note G_, 2 + G_ 2 Music_BikeRiding_branch_7dbc9:: octave 4 - note C_, 4 - note D_, 4 - note E_, 2 - note C_, 2 - note E_, 2 - note G_, 2 - note G_, 2 - note F_, 2 - note E_, 2 - note F_, 4 - note E_, 2 - note D_, 2 - note F_, 4 - note D_, 4 + C_ 4 + D_ 4 + E_ 2 + C_ 2 + E_ 2 + G_ 2 + G_ 2 + F_ 2 + E_ 2 + F_ 4 + E_ 2 + D_ 2 + F_ 4 + D_ 4 octave 3 - note B_, 2 - octave 4 - note F_, 4 - note D_, 4 - note E_, 2 - note F_, 2 - note G_, 2 - note C_, 2 - note E_, 2 - note C_, 2 - note D_, 2 - note E_, 2 + B_ 2 + octave 4 + F_ 4 + D_ 4 + E_ 2 + F_ 2 + G_ 2 + C_ 2 + E_ 2 + C_ 2 + D_ 2 + E_ 2 notetype 12, 11, 6 - note F_, 10 + F_ 10 notetype 12, 10, 6 - note F_, 2 - note E_, 2 - note F_, 2 - note G_, 10 - note E_, 2 - note D_, 2 - note E_, 2 - note F_, 6 - togglecall + F_ 2 + E_ 2 + F_ 2 + G_ 10 + E_ 2 + D_ 2 + E_ 2 + F_ 6 + toggleperfectpitch notetype 12, 11, 3 - note E_, 2 - note D_, 2 - note D_, 1 - note E_, 1 - note F_, 2 - note E_, 1 - note F_, 1 - togglecall + E_ 2 + D_ 2 + D_ 1 + E_ 1 + F_ 2 + E_ 1 + F_ 1 + toggleperfectpitch notetype 12, 11, 5 - note G_, 6 - note G_, 6 - note A_, 2 - note F_, 2 - note G_, 6 + G_ 6 + G_ 6 + A_ 2 + F_ 2 + G_ 6 notetype 12, 11, 4 - note G_, 2 - note F_, 4 + G_ 2 + F_ 4 notetype 12, 10, 4 - note E_, 2 - note D_, 2 + E_ 2 + D_ 2 notetype 12, 9, 3 octave 3 - note A_, 2 + A_ 2 octave 4 - note C_, 4 - note C_, 2 + C_ 4 + C_ 2 octave 3 - note B_, 2 - note A_, 1 - note B_, 1 - note A_, 2 - note B_, 2 - octave 4 - note C_, 2 - note C_, 4 - note C_, 2 + B_ 2 + A_ 1 + B_ 1 + A_ 2 + B_ 2 + octave 4 + C_ 2 + C_ 4 + C_ 2 octave 3 - note A_, 2 - note B_, 2 - note B_, 2 - note A_, 2 + A_ 2 + B_ 2 + B_ 2 + A_ 2 octave 4 - note C_, 4 + C_ 4 octave 3 - note A_, 2 - note B_, 1 + A_ 2 + B_ 1 octave 4 - note C_, 1 + C_ 1 octave 3 - note B_, 2 + B_ 2 octave 4 - note D_, 4 + D_ 4 octave 3 - note B_, 2 + B_ 2 octave 4 - note C_, 4 + C_ 4 octave 3 - note B_, 1 + B_ 1 octave 4 - note C_, 1 - note D_, 1 + C_ 1 + D_ 1 octave 3 - note B_, 1 + B_ 1 octave 4 - note C_, 4 + C_ 4 notetype 12, 3, 13 - note C_, 4 + C_ 4 notetype 12, 11, 4 - note F_, 6 - note G_, 4 - note F_, 1 - note G_, 1 - note F_, 4 - note E_, 6 - note F_, 2 - note E_, 2 - note D_, 1 - note E_, 1 - note D_, 2 - note C_, 2 + F_ 6 + G_ 4 + F_ 1 + G_ 1 + F_ 4 + E_ 6 + F_ 2 + E_ 2 + D_ 1 + E_ 1 + D_ 2 + C_ 2 notetype 12, 11, 5 octave 3 - note A_, 4 + A_ 4 octave 4 - note D_, 4 + D_ 4 octave 3 - note B_, 4 + B_ 4 octave 4 - note E_, 4 - note C_, 4 - note F_, 4 - note D_, 4 - note F#, 4 + E_ 4 + C_ 4 + F_ 4 + D_ 4 + F# 4 vibrato 10, 2, 6 notetype 12, 8, 0 - note G_, 16 - note G_, 4 + G_ 16 + G_ 4 notetype 12, 8, 7 - note G_, 12 + G_ 12 notetype 12, 11, 5 vibrato 8, 1, 4 loopchannel 0, Music_BikeRiding_branch_7dbc9 @@ -158,146 +158,146 @@ Music_BikeRiding_Ch2:: ; 7dc6c (1f:5c6c) vibrato 6, 1, 5 notetype 12, 12, 3 octave 4 - note C_, 2 + C_ 2 Music_BikeRiding_branch_7dc75:: - note E_, 4 - note F_, 4 - note G_, 4 + E_ 4 + F_ 4 + G_ 4 octave 5 - note C_, 4 - octave 4 - note B_, 6 - note A_, 1 - note B_, 1 - note A_, 10 - note F_, 2 - note G_, 2 - note A_, 2 + C_ 4 + octave 4 + B_ 6 + A_ 1 + B_ 1 + A_ 10 + F_ 2 + G_ 2 + A_ 2 octave 5 - note D_, 2 - note C_, 2 + D_ 2 + C_ 2 octave 4 - note B_, 2 - note A_, 1 - note B_, 1 + B_ 2 + A_ 1 + B_ 1 octave 5 - note C_, 6 + C_ 6 octave 4 - note A_, 2 - note G_, 4 + A_ 2 + G_ 4 duty 3 notetype 12, 8, 4 - note A#, 6 + A# 6 duty 2 notetype 12, 12, 5 octave 5 - note C_, 2 + C_ 2 octave 4 - note B_, 2 + B_ 2 octave 5 - note C_, 2 + C_ 2 octave 4 - note A_, 10 + A_ 10 octave 5 - note C_, 2 + C_ 2 octave 4 - note B_, 2 + B_ 2 octave 5 - note C_, 2 + C_ 2 octave 4 - note G_, 10 + G_ 10 notetype 12, 12, 3 octave 5 - note C_, 4 - note E_, 2 - note D_, 2 - note C_, 2 + C_ 4 + E_ 2 + D_ 2 + C_ 2 octave 4 - note B_, 2 + B_ 2 octave 5 - note C_, 2 + C_ 2 notetype 12, 11, 0 - note D_, 4 + D_ 4 notetype 12, 12, 7 - note D_, 10 - note D_, 1 - note C_, 1 + D_ 10 + D_ 1 + C_ 1 notetype 12, 11, 0 octave 4 - note B_, 4 + B_ 4 notetype 12, 12, 7 - note B_, 12 + B_ 12 notetype 12, 12, 4 - note F_, 6 - note F_, 2 - note G_, 2 - note F_, 2 - note E_, 2 - note D_, 2 - note E_, 6 - note E_, 2 - note F_, 2 - note E_, 2 - note D_, 2 - note C_, 2 - note F_, 2 - note E_, 2 - note D_, 2 - note F_, 2 - note G_, 4 - note A_, 2 - note F_, 2 - note E_, 2 - note G_, 4 - note F_, 2 - note E_, 6 + F_ 6 + F_ 2 + G_ 2 + F_ 2 + E_ 2 + D_ 2 + E_ 6 + E_ 2 + F_ 2 + E_ 2 + D_ 2 + C_ 2 + F_ 2 + E_ 2 + D_ 2 + F_ 2 + G_ 4 + A_ 2 + F_ 2 + E_ 2 + G_ 4 + F_ 2 + E_ 6 notetype 6, 12, 2 - note F_, 1 - note G_, 1 - note A_, 1 - note B_, 1 + F_ 1 + G_ 1 + A_ 1 + B_ 1 notetype 12, 12, 3 octave 5 - note C_, 2 + C_ 2 octave 4 - note B_, 2 - note A_, 2 + B_ 2 + A_ 2 octave 5 - note C_, 2 - octave 4 - note B_, 4 - note A_, 4 - note G_, 2 - note A#, 4 - note A_, 2 - note G_, 4 - note F_, 2 - note E_, 2 + C_ 2 + octave 4 + B_ 4 + A_ 4 + G_ 2 + A# 4 + A_ 2 + G_ 4 + F_ 2 + E_ 2 notetype 8, 12, 4 - note A_, 4 - note G_, 4 - note F_, 4 - note B_, 4 - note A_, 4 - note G_, 4 + A_ 4 + G_ 4 + F_ 4 + B_ 4 + A_ 4 + G_ 4 octave 5 - note C_, 4 + C_ 4 octave 4 - note B_, 4 - note A_, 4 + B_ 4 + A_ 4 octave 5 - note D_, 4 - note E_, 4 - note C_, 4 + D_ 4 + E_ 4 + C_ 4 notetype 12, 12, 7 - note D_, 12 - note C_, 4 + D_ 12 + C_ 4 notetype 12, 11, 0 octave 4 - note B_, 4 + B_ 4 notetype 12, 12, 7 - note B_, 12 + B_ 12 notetype 12, 12, 3 loopchannel 0, Music_BikeRiding_branch_7dc75 @@ -308,337 +308,337 @@ Music_BikeRiding_Ch3:: ; 7dd14 (1f:5d14) Music_BikeRiding_branch_7dd17:: octave 4 - note C_, 1 + C_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 octave 3 - note G_, 1 + G_ 1 rest 1 octave 4 - note E_, 1 + E_ 1 rest 1 - note C_, 1 + C_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note C_, 1 + C_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C_, 1 + C_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 octave 3 - note A_, 1 + A_ 1 rest 1 octave 4 - note F_, 1 + F_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note C_, 1 + C_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C_, 1 + C_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note C_, 1 + C_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 octave 3 - note A_, 1 + A_ 1 rest 1 octave 4 - note F_, 1 + F_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note C_, 1 + C_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note D_, 1 + D_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G_, 1 + G_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 octave 3 - note A_, 1 + A_ 1 rest 1 octave 4 - note F_, 1 + F_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note C_, 1 + C_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 octave 3 - note A_, 1 + A_ 1 rest 1 octave 4 - note F_, 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note C_, 1 + C_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note C_, 1 + C_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C_, 1 + C_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note A#, 1 + A# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note A#, 1 + A# 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note A#, 1 + A# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 5 - note C_, 1 + C_ 1 rest 1 octave 4 - note B_, 1 + B_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 5 - note C_, 1 + C_ 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 octave 5 - note C_, 1 + C_ 1 rest 1 octave 4 - note G_, 1 + G_ 1 rest 1 octave 5 - note C_, 1 + C_ 1 rest 1 octave 4 - note G_, 1 + G_ 1 rest 1 octave 5 - note C_, 1 + C_ 1 rest 1 octave 4 - note G_, 1 + G_ 1 rest 1 octave 5 - note C_, 1 + C_ 1 rest 1 octave 4 - note G_, 1 + G_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F_, 1 + F_ 1 rest 1 loopchannel 0, Music_BikeRiding_branch_7dd17 @@ -671,35 +671,35 @@ Music_BikeRiding_branch_7de6a:: Music_BikeRiding_branch_7dea7:: rest 2 - dnote 2, triangle3 + triangle3 2 rest 2 - dnote 2, triangle3 + triangle3 2 rest 2 - dnote 2, triangle3 + triangle3 2 rest 2 - dnote 2, triangle3 + triangle3 2 endchannel Music_BikeRiding_branch_7deb4:: rest 2 - dnote 2, triangle3 + triangle3 2 rest 2 - dnote 2, triangle3 + triangle3 2 rest 2 - dnote 2, triangle3 - dnote 2, triangle3 - dnote 2, triangle3 + triangle3 2 + triangle3 2 + triangle3 2 endchannel Music_BikeRiding_branch_7dec2:: rest 2 - dnote 2, triangle3 + triangle3 2 rest 2 - dnote 2, triangle3 + triangle3 2 rest 2 - dnote 2, triangle3 + triangle3 2 rest 2 - dnote 1, triangle3 - dnote 1, triangle3 + triangle3 1 + triangle3 1 endchannel -; 0x7ded1
\ No newline at end of file +; 0x7ded1 diff --git a/audio/music/celadon.asm b/audio/music/celadon.asm index a965bc80..77dc2ab8 100644 --- a/audio/music/celadon.asm +++ b/audio/music/celadon.asm @@ -1,109 +1,109 @@ Music_Celadon_Ch1:: ; b6c7 (2:76c7) - tempo 0, 144 - stereopanning 119 + tempo 144 + volume 7, 7 duty 3 - togglecall + toggleperfectpitch notetype 12, 2, 15 rest 8 octave 3 - note D_, 8 + D_ 8 Music_Celadon_branch_b6d4:: duty 2 notetype 12, 11, 2 - note G_, 4 - note B_, 4 - note G_, 2 - note B_, 4 - note G_, 2 - note E_, 1 - note E_, 1 - note G_, 1 - note E_, 1 - note B_, 2 - octave 4 - note C_, 2 + G_ 4 + B_ 4 + G_ 2 + B_ 4 + G_ 2 + E_ 1 + E_ 1 + G_ 1 + E_ 1 + B_ 2 + octave 4 + C_ 2 octave 3 - note A_, 8 - note F#, 4 - note A_, 4 - note F#, 2 - note A_, 6 - note A_, 1 - note B_, 1 - octave 4 - note C_, 1 + A_ 8 + F# 4 + A_ 4 + F# 2 + A_ 6 + A_ 1 + B_ 1 + octave 4 + C_ 1 octave 3 - note B_, 1 - note A_, 2 - note B_, 2 - note G_, 4 + B_ 1 + A_ 2 + B_ 2 + G_ 4 octave 4 - note G_, 4 + G_ 4 octave 3 - note G_, 4 - note B_, 4 - note G_, 2 - note B_, 4 - note G_, 2 - note E_, 1 - note F#, 1 - note G_, 1 - note A_, 1 - note B_, 2 - octave 4 - note C_, 2 + G_ 4 + B_ 4 + G_ 2 + B_ 4 + G_ 2 + E_ 1 + F# 1 + G_ 1 + A_ 1 + B_ 2 + octave 4 + C_ 2 octave 3 - note A_, 8 - note A_, 2 - note B_, 2 + A_ 8 + A_ 2 + B_ 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note B_, 2 - note A_, 2 - note G_, 2 - note F#, 2 - note G_, 2 - note F#, 4 - note D_, 1 - note E_, 1 - note F#, 1 - note G_, 1 - note A_, 8 + B_ 2 + A_ 2 + G_ 2 + F# 2 + G_ 2 + F# 4 + D_ 1 + E_ 1 + F# 1 + G_ 1 + A_ 8 notetype 12, 9, 4 - note B_, 8 - note G_, 4 - note D_, 4 - note G_, 4 - note A_, 2 + B_ 8 + G_ 4 + D_ 4 + G_ 4 + A_ 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note B_, 8 - note A_, 8 - note F#, 4 - note G_, 4 - note A_, 4 - note G_, 4 - note F#, 4 - note A_, 4 - note B_, 8 - note G_, 4 - note D_, 4 - note G_, 4 - note A_, 2 - octave 4 - note C_, 2 + B_ 8 + A_ 8 + F# 4 + G_ 4 + A_ 4 + G_ 4 + F# 4 + A_ 4 + B_ 8 + G_ 4 + D_ 4 + G_ 4 + A_ 2 + octave 4 + C_ 2 octave 3 - note B_, 8 - note A_, 8 - note F#, 4 - note G_, 4 - note A_, 4 - note G_, 4 - note F#, 4 - note A_, 4 + B_ 8 + A_ 8 + F# 4 + G_ 4 + A_ 4 + G_ 4 + F# 4 + A_ 4 loopchannel 0, Music_Celadon_branch_b6d4 @@ -111,118 +111,118 @@ Music_Celadon_Ch2:: ; b73a (2:773a) duty 3 notetype 12, 12, 2 octave 4 - note D_, 1 - note C#, 1 - note D_, 1 - note E_, 1 - note F#, 1 - note E_, 1 - note F#, 1 - note G_, 1 + D_ 1 + C# 1 + D_ 1 + E_ 1 + F# 1 + E_ 1 + F# 1 + G_ 1 notetype 12, 10, 0 - note A_, 8 + A_ 8 Music_Celadon_branch_b74a:: duty 2 notetype 12, 12, 2 octave 4 - note B_, 4 - note G_, 4 - note B_, 2 - note G_, 6 - note B_, 1 - note G_, 1 - note A_, 1 - note B_, 1 + B_ 4 + G_ 4 + B_ 2 + G_ 6 + B_ 1 + G_ 1 + A_ 1 + B_ 1 octave 5 - note C_, 2 - octave 4 - note B_, 2 - note A_, 8 - note A_, 4 - note F#, 4 - note A_, 2 - note F#, 6 - note A_, 1 - note G_, 1 - note F#, 1 - note G_, 1 - note A_, 2 - note B_, 2 - note G_, 4 - note B_, 4 - note B_, 4 - note G_, 4 - note B_, 2 - note G_, 4 + C_ 2 + octave 4 + B_ 2 + A_ 8 + A_ 4 + F# 4 + A_ 2 + F# 6 + A_ 1 + G_ 1 + F# 1 + G_ 1 + A_ 2 + B_ 2 + G_ 4 + B_ 4 + B_ 4 + G_ 4 + B_ 2 + G_ 4 octave 3 - note B_, 2 + B_ 2 octave 4 - note B_, 1 - note G_, 1 - note A_, 1 - note B_, 1 + B_ 1 + G_ 1 + A_ 1 + B_ 1 octave 5 - note C_, 2 - octave 4 - note B_, 2 - note A_, 8 - note A_, 2 - note G_, 2 - note F#, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note D_, 2 - note C#, 2 - note D_, 8 + C_ 2 + octave 4 + B_ 2 + A_ 8 + A_ 2 + G_ 2 + F# 2 + G_ 2 + F# 2 + E_ 2 + D_ 2 + C# 2 + D_ 8 octave 5 - note D_, 8 + D_ 8 notetype 12, 11, 4 octave 4 - note D_, 8 - note C_, 2 + D_ 8 + C_ 2 octave 3 - note B_, 2 - note A_, 2 - note B_, 2 - octave 4 - note E_, 4 - note F#, 4 - note D_, 8 - note C_, 8 + B_ 2 + A_ 2 + B_ 2 + octave 4 + E_ 4 + F# 4 + D_ 8 + C_ 8 octave 3 - note A_, 2 - note B_, 2 - octave 4 - note C_, 2 - note D_, 2 - note E_, 2 - note C_, 2 - note D_, 2 - note E_, 2 - note D_, 8 - note D_, 8 - note C_, 2 + A_ 2 + B_ 2 + octave 4 + C_ 2 + D_ 2 + E_ 2 + C_ 2 + D_ 2 + E_ 2 + D_ 8 + D_ 8 + C_ 2 octave 3 - note B_, 2 - note A_, 2 - note B_, 2 - octave 4 - note E_, 4 - note D_, 2 - note E_, 2 - note D_, 8 - note C_, 8 - note A_, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note F#, 2 - note E_, 2 - note D_, 2 - note E_, 2 - note D_, 8 + B_ 2 + A_ 2 + B_ 2 + octave 4 + E_ 4 + D_ 2 + E_ 2 + D_ 8 + C_ 8 + A_ 2 + G_ 2 + F# 2 + E_ 2 + F# 2 + E_ 2 + D_ 2 + E_ 2 + D_ 8 loopchannel 0, Music_Celadon_branch_b74a @@ -230,183 +230,183 @@ Music_Celadon_Ch3:: ; b7b5 (2:77b5) notetype 12, 1, 3 rest 8 octave 5 - note D_, 1 - note C#, 1 - note D_, 1 - note E_, 1 - note F#, 1 - note E_, 1 - note F#, 1 - note G_, 1 + D_ 1 + C# 1 + D_ 1 + E_ 1 + F# 1 + E_ 1 + F# 1 + G_ 1 Music_Celadon_branch_b7c1:: octave 4 - note D_, 2 - note B_, 2 - note D_, 2 - note B_, 2 - note D_, 2 - note B_, 2 - note D_, 2 - note B_, 2 - note D_, 2 - note B_, 2 - note D_, 2 - note B_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note B_, 2 - note D_, 2 - note B_, 2 - note D_, 2 - note B_, 2 - note D_, 2 - note B_, 2 - note D_, 2 - note B_, 2 - note D_, 2 - note B_, 2 - note D_, 2 - note B_, 2 - note D_, 2 - note B_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note G_, 2 - note A_, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note C#, 2 - note D_, 2 + D_ 2 + B_ 2 + D_ 2 + B_ 2 + D_ 2 + B_ 2 + D_ 2 + B_ 2 + D_ 2 + B_ 2 + D_ 2 + B_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + B_ 2 + D_ 2 + B_ 2 + D_ 2 + B_ 2 + D_ 2 + B_ 2 + D_ 2 + B_ 2 + D_ 2 + B_ 2 + D_ 2 + B_ 2 + D_ 2 + B_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + G_ 2 + A_ 2 + G_ 2 + F# 2 + E_ 2 + C# 2 + D_ 2 rest 6 - note F#, 2 + F# 2 rest 4 - note F#, 2 - note G_, 2 + F# 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 - note B_, 2 - note G_, 2 + G_ 2 + B_ 2 + G_ 2 octave 5 - note E_, 2 - note D_, 2 - note C_, 2 - note D_, 2 + E_ 2 + D_ 2 + C_ 2 + D_ 2 octave 4 - note B_, 2 - note G_, 2 + B_ 2 + G_ 2 octave 5 - note C_, 2 + C_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note E_, 2 - note D_, 2 - note C_, 2 - note D_, 2 + E_ 2 + D_ 2 + C_ 2 + D_ 2 octave 4 - note B_, 2 - note A_, 2 + B_ 2 + A_ 2 octave 5 - note C_, 2 + C_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 - note B_, 2 - note G_, 2 + G_ 2 + B_ 2 + G_ 2 octave 5 - note E_, 2 - note D_, 2 - note C_, 2 - note D_, 2 + E_ 2 + D_ 2 + C_ 2 + D_ 2 octave 4 - note B_, 2 - note G_, 2 + B_ 2 + G_ 2 octave 5 - note C_, 2 + C_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 - note C_, 2 - octave 4 - note B_, 2 - note A_, 2 - note G_, 2 - note F#, 2 - note E_, 2 + D_ 2 + C_ 2 + octave 4 + B_ 2 + A_ 2 + G_ 2 + F# 2 + E_ 2 loopchannel 0, Music_Celadon_branch_b7c1 -; 0xb86d
\ No newline at end of file +; 0xb86d diff --git a/audio/music/cinnabar.asm b/audio/music/cinnabar.asm index db344c64..4fcbe842 100644 --- a/audio/music/cinnabar.asm +++ b/audio/music/cinnabar.asm @@ -1,87 +1,87 @@ Music_Cinnabar_Ch1:: ; b86d (2:786d) - tempo 0, 144 - stereopanning 119 + tempo 144 + volume 7, 7 duty 3 vibrato 12, 3, 4 - togglecall + toggleperfectpitch Music_Cinnabar_branch_b878:: notetype 12, 11, 5 rest 4 octave 3 - note D_, 4 - note E_, 6 - note C#, 2 + D_ 4 + E_ 6 + C# 2 notetype 12, 11, 1 - note D_, 4 + D_ 4 notetype 12, 11, 5 - note B_, 4 + B_ 4 octave 4 - note C_, 6 + C_ 6 octave 3 - note A_, 2 + A_ 2 notetype 12, 11, 1 - note B_, 4 + B_ 4 notetype 12, 11, 5 - note G_, 4 - note F#, 4 - note E_, 2 - note F#, 2 + G_ 4 + F# 4 + E_ 2 + F# 2 notetype 12, 11, 1 - note G_, 4 + G_ 4 notetype 12, 11, 5 - note G_, 4 - note F#, 4 - note E_, 4 - note D_, 4 - note E_, 4 - note F#, 6 - note A_, 2 + G_ 4 + F# 4 + E_ 4 + D_ 4 + E_ 4 + F# 6 + A_ 2 notetype 12, 11, 1 - note G_, 4 + G_ 4 notetype 12, 11, 5 - note B_, 4 + B_ 4 octave 4 - note C_, 6 + C_ 6 octave 3 - note A_, 2 - note B_, 4 - note G_, 4 - note F#, 3 - note E_, 1 - note F#, 2 - note A_, 2 + A_ 2 + B_ 4 + G_ 4 + F# 3 + E_ 1 + F# 2 + A_ 2 notetype 12, 10, 2 - note G_, 4 + G_ 4 octave 4 - note D_, 1 - note E_, 1 - note D_, 4 + D_ 1 + E_ 1 + D_ 4 notetype 12, 7, 2 - note D_, 1 - note E_, 1 - note D_, 4 + D_ 1 + E_ 1 + D_ 4 notetype 12, 10, 7 octave 3 - note B_, 6 - note G_, 2 - note E_, 8 + B_ 6 + G_ 2 + E_ 8 octave 4 - note C_, 6 + C_ 6 octave 3 - note A_, 2 - note F#, 8 + A_ 2 + F# 8 octave 4 - note F#, 6 - note D_, 2 + F# 6 + D_ 2 octave 3 - note B_, 2 - note A_, 2 - note G_, 2 - note F#, 2 - note G_, 8 - note F#, 4 - note E_, 4 + B_ 2 + A_ 2 + G_ 2 + F# 2 + G_ 8 + F# 4 + E_ 4 loopchannel 0, Music_Cinnabar_branch_b878 @@ -92,90 +92,90 @@ Music_Cinnabar_Ch2:: ; b8d4 (2:78d4) Music_Cinnabar_branch_b8d9:: notetype 12, 12, 7 octave 3 - note G_, 6 - note A_, 1 - note B_, 1 + G_ 6 + A_ 1 + B_ 1 octave 4 - note C_, 6 - note D_, 1 - note E_, 1 + C_ 6 + D_ 1 + E_ 1 notetype 12, 12, 1 - note D_, 4 + D_ 4 notetype 12, 12, 7 - note G_, 4 - note A_, 6 - note G_, 1 - note F#, 1 - note E_, 4 - note D_, 4 - note C_, 3 + G_ 4 + A_ 6 + G_ 1 + F# 1 + E_ 4 + D_ 4 + C_ 3 octave 3 - note B_, 1 + B_ 1 octave 4 - note C_, 2 - note D_, 1 - note E_, 1 + C_ 2 + D_ 1 + E_ 1 notetype 12, 12, 1 - note D_, 4 + D_ 4 notetype 12, 12, 7 octave 3 - note B_, 8 - note A_, 4 - note G_, 6 - note A_, 1 - note B_, 1 + B_ 8 + A_ 4 + G_ 6 + A_ 1 + B_ 1 octave 4 - note C_, 6 - note D_, 1 - note E_, 1 + C_ 6 + D_ 1 + E_ 1 notetype 12, 12, 1 - note D_, 4 + D_ 4 notetype 12, 12, 7 - note G_, 4 - note A_, 6 - note G_, 1 - note F#, 1 - note E_, 4 - note D_, 4 - note C_, 3 + G_ 4 + A_ 6 + G_ 1 + F# 1 + E_ 4 + D_ 4 + C_ 3 octave 3 - note B_, 1 + B_ 1 octave 4 - note C_, 2 - note D_, 1 - note E_, 1 + C_ 2 + D_ 1 + E_ 1 notetype 12, 12, 1 - note D_, 4 + D_ 4 notetype 12, 12, 7 octave 3 - note A_, 4 - note G_, 4 - note F#, 4 + A_ 4 + G_ 4 + F# 4 notetype 12, 11, 0 octave 4 - note D_, 6 + D_ 6 octave 3 - note B_, 2 - note G_, 8 + B_ 2 + G_ 8 octave 4 - note E_, 6 - note C_, 2 + E_ 6 + C_ 2 octave 3 - note A_, 8 + A_ 8 octave 4 - note A_, 6 - note F#, 2 - note D_, 2 - note C_, 2 + A_ 6 + F# 2 + D_ 2 + C_ 2 octave 3 - note B_, 2 - note A_, 2 - note B_, 4 + B_ 2 + A_ 2 + B_ 4 octave 4 - note D_, 4 + D_ 4 octave 3 - note B_, 2 - note A_, 6 + B_ 2 + A_ 6 loopchannel 0, Music_Cinnabar_branch_b8d9 @@ -184,172 +184,172 @@ Music_Cinnabar_Ch3:: ; b93d (2:793d) Music_Cinnabar_branch_b93f:: octave 4 - note G_, 1 + G_ 1 rest 3 - note B_, 2 - note G_, 1 - note G_, 1 - note A_, 1 + B_ 2 + G_ 1 + G_ 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 5 - note C_, 2 + C_ 2 octave 4 - note F#, 1 + F# 1 rest 1 - note G_, 1 + G_ 1 rest 3 - note B_, 2 - note G_, 1 - note G_, 1 - note A_, 1 + B_ 2 + G_ 1 + G_ 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 5 - note C_, 2 + C_ 2 octave 4 - note F#, 1 + F# 1 rest 1 - note G_, 1 + G_ 1 rest 3 - note B_, 2 - note G_, 1 - note G_, 1 - note A_, 1 + B_ 2 + G_ 1 + G_ 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 5 - note C_, 2 + C_ 2 octave 4 - note F#, 1 + F# 1 rest 1 - note G_, 1 + G_ 1 rest 3 - note B_, 2 - note G_, 1 - note G_, 1 - note A_, 1 + B_ 2 + G_ 1 + G_ 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 5 - note C_, 2 + C_ 2 octave 4 - note A_, 1 + A_ 1 rest 1 - note G_, 1 + G_ 1 rest 3 - note B_, 2 - note G_, 1 - note G_, 1 - note A_, 1 + B_ 2 + G_ 1 + G_ 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 5 - note C_, 2 + C_ 2 octave 4 - note F#, 1 + F# 1 rest 1 - note G_, 1 + G_ 1 rest 3 - note B_, 2 - note G_, 1 - note G_, 1 - note A_, 1 + B_ 2 + G_ 1 + G_ 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 5 - note C_, 2 + C_ 2 octave 4 - note F#, 1 + F# 1 rest 1 - note G_, 1 + G_ 1 rest 3 - note B_, 2 - note G_, 1 - note G_, 1 - note A_, 1 + B_ 2 + G_ 1 + G_ 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 5 - note C_, 2 + C_ 2 octave 4 - note F#, 1 + F# 1 rest 1 - note G_, 1 + G_ 1 rest 3 - note B_, 4 - note A_, 1 + B_ 4 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 5 - note C_, 4 + C_ 4 octave 4 - note B_, 1 + B_ 1 rest 3 octave 5 - note D_, 2 + D_ 2 octave 4 - note B_, 1 - note B_, 1 - note B_, 1 + B_ 1 + B_ 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 5 - note C_, 2 + C_ 2 octave 4 - note B_, 1 + B_ 1 rest 1 - note G_, 1 + G_ 1 rest 3 octave 5 - note E_, 2 - note C_, 1 - note C_, 1 - note C_, 1 + E_ 2 + C_ 1 + C_ 1 + C_ 1 rest 1 - note C_, 1 + C_ 1 rest 1 - note E_, 2 - note C_, 1 + E_ 2 + C_ 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 3 octave 5 - note A_, 2 - note F#, 1 - note F#, 1 - note D_, 1 + A_ 2 + F# 1 + F# 1 + D_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note D_, 2 - note C_, 1 + D_ 2 + C_ 1 rest 1 octave 4 - note B_, 1 + B_ 1 rest 3 octave 5 - note D_, 2 - note C_, 1 - note C_, 1 + D_ 2 + C_ 1 + C_ 1 octave 4 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note A_, 2 + A_ 2 octave 5 - note C_, 1 + C_ 1 rest 1 loopchannel 0, Music_Cinnabar_branch_b93f -; 0xb9eb
\ No newline at end of file +; 0xb9eb diff --git a/audio/music/cinnabarmansion.asm b/audio/music/cinnabarmansion.asm index 1560e89d..690fb915 100644 --- a/audio/music/cinnabarmansion.asm +++ b/audio/music/cinnabarmansion.asm @@ -1,29 +1,29 @@ Music_CinnabarMansion_Ch1:: ; 7ed0f (1f:6d0f) - tempo 0, 144 - stereopanning 119 + tempo 144 + volume 7, 7 vibrato 11, 2, 5 duty 2 Music_CinnabarMansion_branch_7ed19:: notetype 12, 6, 2 octave 5 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 octave 4 - note B_, 1 - note B_, 1 - note C_, 1 + B_ 1 + B_ 1 + C_ 1 rest 2 octave 5 - note B_, 2 - note E_, 2 + B_ 2 + E_ 2 octave 4 - note C_, 2 - note B_, 2 - note E_, 2 - note C_, 1 + C_ 2 + B_ 2 + E_ 2 + C_ 1 octave 5 - note B_, 1 + B_ 1 rest 2 loopchannel 14, Music_CinnabarMansion_branch_7ed19 notetype 12, 10, 5 @@ -31,16 +31,16 @@ Music_CinnabarMansion_branch_7ed19:: rest 16 rest 15 octave 4 - note C_, 1 + C_ 1 octave 5 - note B_, 1 - note B_, 2 + B_ 1 + B_ 2 loopchannel 0, Music_CinnabarMansion_branch_7ed19 Music_CinnabarMansion_Ch2:: ; 7ed40 (1f:6d40) duty 2 - togglecall + toggleperfectpitch vibrato 10, 2, 4 notetype 12, 12, 2 @@ -56,42 +56,42 @@ Music_CinnabarMansion_branch_7ed50:: callchannel Music_CinnabarMansion_branch_7ed6c loopchannel 3, Music_CinnabarMansion_branch_7ed50 octave 3 - note E_, 4 - note D#, 4 - note B_, 4 - note A#, 4 - note G_, 4 - note G#, 4 + E_ 4 + D# 4 + B_ 4 + A# 4 + G_ 4 + G# 4 rest 4 - note A#, 4 - note E_, 4 - note D#, 4 - note B_, 4 - note A#, 4 - note G_, 4 - note G#, 4 - note G_, 4 - note D#, 4 + A# 4 + E_ 4 + D# 4 + B_ 4 + A# 4 + G_ 4 + G# 4 + G_ 4 + D# 4 loopchannel 0, Music_CinnabarMansion_branch_7ed4e Music_CinnabarMansion_branch_7ed6c:: octave 3 - note E_, 4 - note D#, 4 - note B_, 4 - note A#, 4 - note G_, 4 - note G#, 4 - note A_, 4 - note A#, 4 - note E_, 4 - note D#, 4 - note B_, 4 - note A#, 4 - note G_, 4 - note G#, 4 + E_ 4 + D# 4 + B_ 4 + A# 4 + G_ 4 + G# 4 + A_ 4 + A# 4 + E_ 4 + D# 4 + B_ 4 + A# 4 + G_ 4 + G# 4 rest 4 - note A#, 4 + A# 4 endchannel @@ -100,46 +100,46 @@ Music_CinnabarMansion_Ch3:: ; 7ed7e (1f:6d7e) Music_CinnabarMansion_branch_7ed80:: octave 2 - note B_, 2 + B_ 2 rest 2 octave 3 - note E_, 2 + E_ 2 rest 2 - note E_, 2 + E_ 2 rest 2 - note E_, 2 + E_ 2 rest 2 - note E_, 2 + E_ 2 rest 2 - note E_, 2 + E_ 2 rest 2 - note E_, 2 + E_ 2 rest 2 - note E_, 2 + E_ 2 rest 2 - note C_, 2 + C_ 2 rest 2 octave 3 - note D#, 2 + D# 2 rest 2 - note D#, 2 + D# 2 rest 2 - note D#, 2 + D# 2 rest 2 - note D#, 2 + D# 2 rest 2 - note D#, 2 + D# 2 rest 2 - note D#, 2 + D# 2 rest 2 - note D#, 2 + D# 2 rest 2 loopchannel 8, Music_CinnabarMansion_branch_7ed80 - note E_, 16 - note D#, 16 - note G_, 16 - note G#, 8 - note D#, 8 + E_ 16 + D# 16 + G_ 16 + G# 8 + D# 8 loopchannel 0, Music_CinnabarMansion_branch_7ed80 @@ -151,23 +151,23 @@ Music_CinnabarMansion_Ch4:: ; 7edb0 (1f:6db0) rest 16 Music_CinnabarMansion_branch_7edb5:: - dnote 2, cymbal1 - dnote 2, cymbal1 - dnote 4, cymbal2 - dnote 2, cymbal1 - dnote 2, cymbal1 - dnote 4, cymbal2 - dnote 2, cymbal1 - dnote 2, cymbal1 - dnote 4, cymbal2 - dnote 2, cymbal1 - dnote 2, cymbal1 - dnote 4, cymbal3 - dnote 2, cymbal1 - dnote 2, cymbal1 + cymbal1 2 + cymbal1 2 + cymbal2 4 + cymbal1 2 + cymbal1 2 + cymbal2 4 + cymbal1 2 + cymbal1 2 + cymbal2 4 + cymbal1 2 + cymbal1 2 + cymbal3 4 + cymbal1 2 + cymbal1 2 rest 2 rest 10 rest 8 - dnote 8, cymbal3 + cymbal3 8 loopchannel 0, Music_CinnabarMansion_branch_7edb5 -; 0x7edda
\ No newline at end of file +; 0x7edda diff --git a/audio/music/cities1.asm b/audio/music/cities1.asm index f7b9cc81..82754e0e 100644 --- a/audio/music/cities1.asm +++ b/audio/music/cities1.asm @@ -1,270 +1,270 @@ Music_Cities1_branch_aa6f:: - tempo 0, 232 + tempo 232 loopchannel 0, Music_Cities1_branch_aa79 Music_Cities1_Ch1:: ; aa76 (2:6a76) - tempo 0, 144 + tempo 144 Music_Cities1_branch_aa79:: - stereopanning 119 + volume 7, 7 vibrato 8, 2, 4 duty 3 Music_Cities1_branch_aa80:: notetype 12, 12, 5 octave 3 - note G#, 4 - note F#, 4 - note E_, 2 - note E_, 2 - note F#, 2 - note D#, 2 - note E_, 2 - note E_, 2 - note D#, 2 - note C#, 4 - note D#, 4 - note E_, 2 - note D#, 4 - note C#, 2 - note E_, 2 - note E_, 4 + G# 4 + F# 4 + E_ 2 + E_ 2 + F# 2 + D# 2 + E_ 2 + E_ 2 + D# 2 + C# 4 + D# 4 + E_ 2 + D# 4 + C# 2 + E_ 2 + E_ 4 notetype 12, 10, 5 - note C#, 4 + C# 4 octave 2 - note B_, 6 + B_ 6 octave 3 - note C#, 2 - note C#, 4 + C# 2 + C# 4 octave 2 - note B_, 4 + B_ 4 notetype 12, 12, 5 callchannel Music_Cities1_branch_ab7d octave 3 - note D#, 6 - note E_, 2 + D# 6 + E_ 2 octave 2 - note B_, 4 + B_ 4 notetype 12, 10, 5 octave 3 - note C#, 2 + C# 2 octave 2 - note B_, 2 - note A_, 4 - note B_, 4 - note B_, 2 + B_ 2 + A_ 4 + B_ 4 + B_ 2 octave 3 - note C#, 2 - note D#, 2 - note E_, 2 - note D#, 2 - note C#, 2 - note D#, 2 + C# 2 + D# 2 + E_ 2 + D# 2 + C# 2 + D# 2 notetype 12, 12, 5 - note G#, 2 - note E_, 2 - note F#, 2 - note E_, 2 - note E_, 4 - note F#, 2 - note D#, 2 - note E_, 4 - note D#, 2 - note C#, 4 - note D#, 4 - note E_, 2 - note D#, 2 - note C#, 2 - note C#, 2 - note E_, 2 - note E_, 4 + G# 2 + E_ 2 + F# 2 + E_ 2 + E_ 4 + F# 2 + D# 2 + E_ 4 + D# 2 + C# 4 + D# 4 + E_ 2 + D# 2 + C# 2 + C# 2 + E_ 2 + E_ 4 notetype 12, 10, 5 - note C#, 2 + C# 2 octave 2 - note A_, 2 - note B_, 6 + A_ 2 + B_ 6 octave 3 - note C#, 2 - note C#, 2 + C# 2 + C# 2 octave 2 - note B_, 2 - note B_, 4 + B_ 2 + B_ 4 notetype 12, 12, 5 callchannel Music_Cities1_branch_ab7d octave 3 - note D#, 4 - note D#, 2 - note E_, 2 + D# 4 + D# 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note C#, 2 - note G#, 2 - note E_, 4 + C# 2 + G# 2 + E_ 4 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 + E_ 2 notetype 12, 10, 5 - note C#, 4 + C# 4 octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 4 - note C#, 2 - note E_, 4 + D# 4 + C# 2 + E_ 4 notetype 12, 11, 3 callchannel Music_Cities1_branch_ab8a - note A_, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 4 - note F#, 4 - note G#, 2 - note E_, 2 + A_ 2 + B_ 2 + A_ 2 + G# 2 + A_ 4 + F# 4 + G# 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 4 - note G#, 2 + E_ 4 + G# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 - note E_, 2 - note F#, 2 - note E_, 2 - note D#, 2 - note E_, 2 - note D#, 2 - note C#, 2 + E_ 2 + E_ 2 + F# 2 + E_ 2 + D# 2 + E_ 2 + D# 2 + C# 2 octave 2 - note B_, 2 + B_ 2 octave 3 Music_Cities1_branch_ab12:: - note C#, 2 - note D#, 2 - note C#, 2 + C# 2 + D# 2 + C# 2 octave 2 - note B_, 4 - note B_, 2 + B_ 4 + B_ 2 octave 3 - note C#, 2 - note D#, 2 + C# 2 + D# 2 loopchannel 2, Music_Cities1_branch_ab12 - note E_, 2 + E_ 2 octave 2 - note B_, 4 + B_ 4 octave 3 - note E_, 4 + E_ 4 octave 2 - note B_, 2 + B_ 2 octave 3 - note C#, 2 - note G#, 2 - note G#, 2 + C# 2 + G# 2 + G# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 2 + D# 2 octave 2 - note B_, 2 + B_ 2 octave 3 callchannel Music_Cities1_branch_ab8a - note A_, 2 - note E_, 2 - note A_, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 2 - note F#, 2 - note G#, 2 - note E_, 2 + A_ 2 + E_ 2 + A_ 2 + B_ 2 + A_ 2 + G# 2 + A_ 2 + F# 2 + G# 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note D#, 2 - note B_, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note F#, 2 - note E_, 4 - note G#, 2 - note F#, 2 - note D#, 2 + E_ 2 + C# 2 + G# 2 + C# 2 + D# 2 + B_ 2 + E_ 2 + G# 2 + E_ 2 + F# 2 + E_ 4 + G# 2 + F# 2 + D# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 4 - note F#, 2 - note D#, 2 - note D#, 2 - note F#, 2 + D# 4 + F# 2 + D# 2 + D# 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 2 + D# 2 octave 2 - note B_, 2 - note B_, 2 + B_ 2 + B_ 2 octave 3 - note D#, 2 + D# 2 notetype 12, 11, 6 - note F#, 8 - note F#, 4 - note D#, 4 - note E_, 8 + F# 8 + F# 4 + D# 4 + E_ 8 notetype 12, 8, 4 octave 2 - note B_, 4 + B_ 4 octave 3 - note E_, 2 - note F#, 2 + E_ 2 + F# 2 loopchannel 0, Music_Cities1_branch_aa80 Music_Cities1_branch_ab7d:: octave 3 - note F#, 2 - note D#, 4 - note E_, 2 - note D#, 4 - note C#, 4 + F# 2 + D# 4 + E_ 2 + D# 4 + C# 4 octave 2 - note B_, 4 + B_ 4 octave 3 - note C#, 2 - note D#, 2 - note C#, 2 + C# 2 + D# 2 + C# 2 endchannel Music_Cities1_branch_ab8a:: - note A_, 2 - note E_, 2 - note C#, 2 - note E_, 4 - note A_, 2 - note C#, 2 - note E_, 2 + A_ 2 + E_ 2 + C# 2 + E_ 4 + A_ 2 + C# 2 + E_ 2 endchannel @@ -272,138 +272,138 @@ Music_Cities1_Ch2:: ; ab92 (2:6b92) vibrato 5, 1, 5 callchannel Music_Cities1_branch_ac00 octave 4 - note G#, 2 + G# 2 notetype 12, 12, 4 - note E_, 6 + E_ 6 notetype 12, 12, 5 duty 3 octave 3 - note C#, 4 - note D#, 4 - note E_, 6 - note F#, 6 - note G#, 4 + C# 4 + D# 4 + E_ 6 + F# 6 + G# 4 callchannel Music_Cities1_branch_ac00 octave 4 - note G#, 2 + G# 2 notetype 12, 12, 4 - note E_, 14 + E_ 14 duty 3 octave 3 - note E_, 6 - note F#, 6 - note G#, 4 + E_ 6 + F# 6 + G# 4 notetype 12, 11, 7 duty 2 vibrato 8, 1, 7 octave 5 - note C#, 12 + C# 12 octave 4 - note A_, 4 + A_ 4 octave 5 - note E_, 8 - note F#, 2 - note E_, 2 - note D#, 2 - note C#, 2 + E_ 8 + F# 2 + E_ 2 + D# 2 + C# 2 octave 4 - note B_, 12 - note G#, 4 - note B_, 16 - note F#, 12 - note G#, 2 - note A_, 2 - note B_, 4 - note A_, 4 - note G#, 4 - note F#, 4 - note G#, 12 - note E_, 4 - note B_, 16 + B_ 12 + G# 4 + B_ 16 + F# 12 + G# 2 + A_ 2 + B_ 4 + A_ 4 + G# 4 + F# 4 + G# 12 + E_ 4 + B_ 16 octave 5 - note C#, 12 - note D#, 2 - note E_, 2 - note F#, 4 - note E_, 4 - note D#, 4 - note C#, 4 + C# 12 + D# 2 + E_ 2 + F# 4 + E_ 4 + D# 4 + C# 4 octave 4 - note B_, 12 + B_ 12 octave 5 - note C#, 2 - note D#, 2 - note C#, 4 + C# 2 + D# 2 + C# 4 octave 4 - note B_, 4 - note A_, 4 - note G#, 4 - note A_, 12 - note B_, 2 + B_ 4 + A_ 4 + G# 4 + A_ 12 + B_ 2 octave 5 - note C_, 2 - note C_, 4 + C_ 2 + C_ 4 octave 4 - note B_, 4 - note A_, 4 - note F#, 4 + B_ 4 + A_ 4 + F# 4 notetype 12, 11, 7 - note A_, 8 + A_ 8 octave 5 - note C_, 8 + C_ 8 octave 4 - note B_, 14 + B_ 14 notetype 12, 8, 4 - note G#, 1 + G# 1 notetype 12, 10, 4 - note A_, 1 + A_ 1 loopchannel 0, Music_Cities1_Ch2 Music_Cities1_branch_ac00:: duty 2 notetype 12, 12, 3 octave 4 - note B_, 4 - note A_, 4 + B_ 4 + A_ 4 notetype 12, 12, 4 - note G#, 10 + G# 10 notetype 12, 12, 3 - note G#, 2 - note A_, 2 - note B_, 4 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 2 + G# 2 + A_ 2 + B_ 4 + B_ 2 + A_ 2 + G# 2 + A_ 2 notetype 12, 12, 4 - note F#, 10 + F# 10 notetype 12, 12, 5 duty 3 octave 3 - note E_, 4 - note D#, 8 - note E_, 4 - note F#, 4 + E_ 4 + D# 8 + E_ 4 + F# 4 notetype 12, 12, 3 duty 2 octave 4 - note A_, 4 - note G#, 4 + A_ 4 + G# 4 notetype 12, 12, 4 - note F#, 10 + F# 10 notetype 12, 12, 3 - note F#, 2 - note G#, 2 - note A_, 4 - note A_, 2 - note G#, 2 - note F#, 2 + F# 2 + G# 2 + A_ 4 + A_ 2 + G# 2 + F# 2 endchannel Music_Cities1_Ch3:: ; ac32 (2:6c32) notetype 12, 1, 1 - togglecall + toggleperfectpitch Music_Cities1_branch_ac35:: vibrato 0, 0, 0 @@ -411,171 +411,171 @@ Music_Cities1_branch_ac35:: callchannel Music_Cities1_branch_acc5 callchannel Music_Cities1_branch_acc5 callchannel Music_Cities1_branch_acce - note G#, 2 - note E_, 2 - note F#, 2 - note G#, 2 + G# 2 + E_ 2 + F# 2 + G# 2 rest 2 - note E_, 2 - note F#, 2 - note G#, 2 + E_ 2 + F# 2 + G# 2 callchannel Music_Cities1_branch_acc5 - note B_, 2 - note E_, 2 - note F#, 2 - note G#, 2 + B_ 2 + E_ 2 + F# 2 + G# 2 rest 2 - note E_, 2 - note F#, 2 - note G#, 2 + E_ 2 + F# 2 + G# 2 callchannel Music_Cities1_branch_acc5 callchannel Music_Cities1_branch_acce - note G#, 2 - note E_, 2 - note F#, 2 - note G#, 2 + G# 2 + E_ 2 + F# 2 + G# 2 rest 2 - note G#, 2 - note E_, 2 - note B_, 2 + G# 2 + E_ 2 + B_ 2 rest 2 - note E_, 2 - note F#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note B_, 2 - note E_, 2 + E_ 2 + F# 2 + E_ 2 + G# 2 + E_ 2 + B_ 2 + E_ 2 vibrato 8, 2, 5 - note A_, 8 - note E_, 8 - note A_, 8 - note F#, 8 - note G#, 8 - note E_, 8 - note G#, 12 - note E_, 4 - note F#, 2 - note F#, 2 - note D#, 2 - note E_, 4 - note F#, 2 - note D#, 2 - note E_, 2 - note F#, 2 - note F#, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note G#, 2 - note G#, 2 - note E_, 2 - note G#, 2 + A_ 8 + E_ 8 + A_ 8 + F# 8 + G# 8 + E_ 8 + G# 12 + E_ 4 + F# 2 + F# 2 + D# 2 + E_ 4 + F# 2 + D# 2 + E_ 2 + F# 2 + F# 2 + B_ 2 + A_ 2 + G# 2 + A_ 2 + G# 2 + F# 2 + G# 2 + G# 2 + E_ 2 + G# 2 rest 2 - note E_, 2 - note F#, 2 - note G#, 2 + E_ 2 + F# 2 + G# 2 rest 2 - note E_, 2 - note F#, 2 - note G#, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note A_, 8 - note E_, 8 - note A_, 8 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note G#, 8 - note E_, 8 - note B_, 4 - note E_, 4 - note F#, 4 - note G#, 4 + E_ 2 + F# 2 + G# 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + A_ 8 + E_ 8 + A_ 8 + B_ 2 + A_ 2 + G# 2 + F# 2 + G# 8 + E_ 8 + B_ 4 + E_ 4 + F# 4 + G# 4 rest 2 - note D#, 2 - note E_, 2 - note F#, 2 + D# 2 + E_ 2 + F# 2 rest 2 - note F#, 2 - note B_, 2 - note A_, 2 - note A_, 4 - note G#, 4 - note F#, 2 - note D#, 2 - note A_, 2 - note F#, 2 + F# 2 + B_ 2 + A_ 2 + A_ 4 + G# 4 + F# 2 + D# 2 + A_ 2 + F# 2 rest 2 - note E_, 2 - note F#, 2 - note G#, 2 + E_ 2 + F# 2 + G# 2 rest 2 - note E_, 2 - note F#, 1 - note G#, 1 - note E_, 1 - note F#, 1 - note G#, 4 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 2 - note G#, 2 - note F#, 2 + E_ 2 + F# 1 + G# 1 + E_ 1 + F# 1 + G# 4 + B_ 2 + A_ 2 + G# 2 + A_ 2 + G# 2 + F# 2 loopchannel 0, Music_Cities1_branch_ac35 Music_Cities1_branch_acc5:: rest 2 - note E_, 2 - note F#, 2 - note G#, 2 + E_ 2 + F# 2 + G# 2 rest 2 - note E_, 2 - note F#, 2 - note G#, 2 + E_ 2 + F# 2 + G# 2 endchannel Music_Cities1_branch_acce:: - note A_, 2 - note F#, 2 - note G#, 2 - note A_, 2 + A_ 2 + F# 2 + G# 2 + A_ 2 rest 2 - note A_, 2 - note G#, 2 - note F#, 2 + A_ 2 + G# 2 + F# 2 rest 2 - note F#, 2 - note G#, 2 - note A_, 2 + F# 2 + G# 2 + A_ 2 rest 2 - note A_, 2 - note G#, 2 - note F#, 2 - note D#, 2 - note D#, 2 - note E_, 2 - note F#, 2 + A_ 2 + G# 2 + F# 2 + D# 2 + D# 2 + E_ 2 + F# 2 rest 2 - note D#, 2 - note E_, 2 - note F#, 2 + D# 2 + E_ 2 + F# 2 rest 2 - note D#, 2 - note E_, 2 - note F#, 2 + D# 2 + E_ 2 + F# 2 rest 2 - note D#, 2 - note E_, 2 - note F#, 2 + D# 2 + E_ 2 + F# 2 endchannel @@ -591,68 +591,68 @@ Music_Cities1_branch_acf3:: callchannel Music_Cities1_branch_ad36 callchannel Music_Cities1_branch_ad5f callchannel Music_Cities1_branch_ad52 - dnote 6, triangle1 - dnote 6, triangle1 - dnote 4, triangle2 + triangle1 6 + triangle1 6 + triangle2 4 callchannel Music_Cities1_branch_ad6e callchannel Music_Cities1_branch_ad5f callchannel Music_Cities1_branch_ad52 callchannel Music_Cities1_branch_ad6e callchannel Music_Cities1_branch_ad52 - dnote 6, triangle1 - dnote 6, triangle1 - dnote 2, triangle2 - dnote 2, triangle1 - dnote 6, triangle1 - dnote 6, triangle1 - dnote 4, triangle1 - dnote 6, triangle1 - dnote 6, snare6 - dnote 4, snare6 + triangle1 6 + triangle1 6 + triangle2 2 + triangle1 2 + triangle1 6 + triangle1 6 + triangle1 4 + triangle1 6 + snare6 6 + snare6 4 loopchannel 0, Music_Cities1_Ch4 Music_Cities1_branch_ad36:: - dnote 6, snare6 - dnote 6, snare6 - dnote 4, snare6 - dnote 6, snare6 - dnote 6, snare6 - dnote 2, snare6 - dnote 2, snare6 + snare6 6 + snare6 6 + snare6 4 + snare6 6 + snare6 6 + snare6 2 + snare6 2 endchannel Music_Cities1_branch_ad45:: - dnote 6, snare6 - dnote 6, snare6 - dnote 4, snare6 - dnote 6, snare6 - dnote 6, snare6 - dnote 4, snare6 + snare6 6 + snare6 6 + snare6 4 + snare6 6 + snare6 6 + snare6 4 endchannel Music_Cities1_branch_ad52:: - dnote 6, triangle1 - dnote 6, triangle1 - dnote 4, triangle2 - dnote 6, triangle1 - dnote 6, triangle1 - dnote 4, triangle2 + triangle1 6 + triangle1 6 + triangle2 4 + triangle1 6 + triangle1 6 + triangle2 4 endchannel Music_Cities1_branch_ad5f:: - dnote 6, triangle1 - dnote 6, triangle1 - dnote 4, triangle2 - dnote 6, triangle1 - dnote 6, triangle1 - dnote 2, triangle2 - dnote 2, triangle1 + triangle1 6 + triangle1 6 + triangle2 4 + triangle1 6 + triangle1 6 + triangle2 2 + triangle1 2 endchannel Music_Cities1_branch_ad6e:: - dnote 6, triangle1 - dnote 6, triangle1 - dnote 2, triangle2 - dnote 2, triangle2 + triangle1 6 + triangle1 6 + triangle2 2 + triangle2 2 endchannel -; 0xad77
\ No newline at end of file +; 0xad77 diff --git a/audio/music/cities2.asm b/audio/music/cities2.asm index 97eadde8..34297e68 100644 --- a/audio/music/cities2.asm +++ b/audio/music/cities2.asm @@ -1,95 +1,95 @@ Music_Cities2_Ch1:: ; b504 (2:7504) - tempo 0, 148 - stereopanning 119 + tempo 148 + volume 7, 7 duty 3 vibrato 8, 3, 2 - togglecall + toggleperfectpitch notetype 12, 11, 6 rest 8 octave 3 - note E_, 2 - note D#, 2 - note C#, 2 - note C_, 2 + E_ 2 + D# 2 + C# 2 + C_ 2 octave 2 - note B_, 2 + B_ 2 rest 14 Music_Cities2_branch_b51a:: octave 3 - note B_, 4 + B_ 4 octave 4 - note C#, 2 - note D#, 1 - note D_, 1 - note C#, 4 + C# 2 + D# 1 + D_ 1 + C# 4 octave 3 - note B_, 4 - note G#, 8 - note E_, 8 - note A_, 4 - note G#, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note B_, 2 + B_ 4 + G# 8 + E_ 8 + A_ 4 + G# 2 + F# 2 + G# 2 + A_ 2 + B_ 2 octave 4 - note C#, 2 + C# 2 rest 16 - note C#, 4 + C# 4 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 1 - note D#, 1 - note C#, 4 + C# 1 + D# 1 + C# 4 octave 3 - note B_, 4 - note E_, 1 - note E_, 1 - note E_, 1 - note E_, 1 - note E_, 1 + B_ 4 + E_ 1 + E_ 1 + E_ 1 + E_ 1 + E_ 1 rest 3 - note G#, 8 - note B_, 4 - note A_, 2 - note G#, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note B_, 2 - note E_, 2 - note F#, 2 - note G#, 2 + G# 8 + B_ 4 + A_ 2 + G# 2 + F# 2 + G# 2 + A_ 2 + B_ 2 + E_ 2 + F# 2 + G# 2 rest 2 octave 4 - note E_, 4 + E_ 4 octave 3 - note B_, 4 - note F#, 2 - note G#, 2 - note A_, 2 + B_ 4 + F# 2 + G# 2 + A_ 2 rest 2 octave 4 - note F#, 4 - note D#, 4 + F# 4 + D# 4 octave 3 - note E_, 2 + E_ 2 rest 4 - note F#, 2 + F# 2 rest 4 - note A_, 2 + A_ 2 rest 2 - note B_, 2 + B_ 2 rest 16 rest 16 rest 14 - note E_, 16 - note F#, 8 - note G#, 4 - note F#, 4 - note E_, 2 + E_ 16 + F# 8 + G# 4 + F# 4 + E_ 2 rest 14 loopchannel 0, Music_Cities2_branch_b51a @@ -99,184 +99,184 @@ Music_Cities2_Ch2:: ; b569 (2:7569) vibrato 8, 2, 3 notetype 12, 12, 2 octave 4 - note E_, 2 - note D#, 2 - note C#, 2 + E_ 2 + D# 2 + C# 2 octave 3 - note B_, 2 - note A_, 2 - note B_, 2 + B_ 2 + A_ 2 + B_ 2 octave 4 - note C#, 2 - note D#, 2 - note E_, 6 + C# 2 + D# 2 + E_ 6 notetype 12, 12, 2 duty 2 octave 4 - note E_, 1 + E_ 1 octave 3 - note B_, 1 + B_ 1 octave 4 - note C#, 2 - note D#, 2 - note E_, 1 - note F#, 1 - note G#, 1 - note A_, 1 + C# 2 + D# 2 + E_ 1 + F# 1 + G# 1 + A_ 1 Music_Cities2_branch_b58b:: notetype 12, 10, 6 - note G#, 6 + G# 6 notetype 12, 12, 2 - note A_, 1 - note G#, 1 + A_ 1 + G# 1 notetype 12, 12, 4 - note F#, 14 + F# 14 notetype 12, 12, 2 - note E_, 1 + E_ 1 octave 3 - note B_, 1 + B_ 1 octave 4 - note C#, 2 - note D#, 2 - note E_, 1 - note F#, 1 - note G#, 1 - note A_, 1 + C# 2 + D# 2 + E_ 1 + F# 1 + G# 1 + A_ 1 notetype 12, 12, 4 - note G#, 6 + G# 6 notetype 12, 12, 2 - note E_, 1 - note G#, 1 + E_ 1 + G# 1 notetype 12, 12, 5 - note B_, 14 + B_ 14 notetype 12, 12, 2 - note E_, 1 + E_ 1 octave 3 - note B_, 1 + B_ 1 octave 4 - note C#, 2 - note D#, 2 - note E_, 1 - note F#, 1 - note G#, 1 - note A_, 1 + C# 2 + D# 2 + E_ 1 + F# 1 + G# 1 + A_ 1 notetype 12, 10, 6 - note G#, 6 + G# 6 notetype 12, 12, 2 - note A_, 1 - note G#, 1 + A_ 1 + G# 1 notetype 12, 12, 4 - note F#, 8 + F# 8 notetype 12, 10, 1 duty 1 octave 3 - note G#, 1 - note G#, 1 - note G#, 1 - note G#, 1 - note G#, 1 + G# 1 + G# 1 + G# 1 + G# 1 + G# 1 rest 1 notetype 12, 12, 2 duty 2 octave 4 - note E_, 1 + E_ 1 octave 3 - note B_, 1 + B_ 1 octave 4 - note C#, 2 - note D#, 2 - note E_, 1 - note F#, 1 - note G#, 1 - note A_, 1 + C# 2 + D# 2 + E_ 1 + F# 1 + G# 1 + A_ 1 notetype 12, 12, 4 - note G#, 6 - note E_, 1 - note G#, 1 + G# 6 + E_ 1 + G# 1 notetype 12, 12, 6 - note B_, 8 + B_ 8 notetype 12, 12, 2 - note C#, 1 + C# 1 octave 3 - note B_, 1 + B_ 1 octave 4 - note C#, 1 - note D#, 1 - note E_, 4 + C# 1 + D# 1 + E_ 4 notetype 12, 12, 7 - note G#, 4 - note E_, 4 + G# 4 + E_ 4 notetype 12, 12, 2 - note D#, 1 - note C#, 1 - note D#, 1 - note E_, 1 - note F#, 4 + D# 1 + C# 1 + D# 1 + E_ 1 + F# 4 notetype 12, 12, 7 - note B_, 4 - note F#, 4 + B_ 4 + F# 4 notetype 12, 12, 2 - note C#, 1 + C# 1 octave 3 - note B_, 1 + B_ 1 octave 4 - note C#, 1 - note D#, 1 - note E_, 2 - note E_, 1 - note D#, 1 - note E_, 1 - note F#, 1 - note G#, 2 - note G#, 1 - note A_, 1 - note G#, 1 - note A_, 1 - note B_, 1 - note F#, 1 - note D#, 1 - note C#, 1 + C# 1 + D# 1 + E_ 2 + E_ 1 + D# 1 + E_ 1 + F# 1 + G# 2 + G# 1 + A_ 1 + G# 1 + A_ 1 + B_ 1 + F# 1 + D# 1 + C# 1 octave 3 - note B_, 1 + B_ 1 octave 4 - note C#, 1 - note D#, 1 - note F#, 1 + C# 1 + D# 1 + F# 1 notetype 12, 12, 2 - note B_, 8 + B_ 8 notetype 12, 11, 7 octave 3 - note E_, 8 + E_ 8 octave 2 - note B_, 4 + B_ 4 octave 3 - note F#, 4 - note G#, 4 - note A_, 4 - note B_, 8 - note B_, 8 - note G#, 4 + F# 4 + G# 4 + A_ 4 + B_ 8 + B_ 8 + G# 4 octave 4 - note D#, 4 - note C#, 4 - note D#, 4 - note E_, 2 - note D#, 2 - note C#, 2 - note D#, 2 + D# 4 + C# 4 + D# 4 + E_ 2 + D# 2 + C# 2 + D# 2 notetype 12, 12, 2 - note E_, 6 - note E_, 1 + E_ 6 + E_ 1 octave 3 - note B_, 1 + B_ 1 octave 4 - note C#, 2 - note D#, 2 - note E_, 1 - note F#, 1 - note G#, 1 - note A_, 1 + C# 2 + D# 2 + E_ 1 + F# 1 + G# 1 + A_ 1 loopchannel 0, Music_Cities2_branch_b58b @@ -284,134 +284,134 @@ Music_Cities2_Ch3:: ; b640 (2:7640) notetype 12, 1, 1 rest 16 octave 4 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 Music_Cities2_branch_b64c:: - note F#, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note F#, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note F#, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note F#, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note G#, 2 - note E_, 2 + F# 2 + A_ 2 + F# 2 + A_ 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + F# 2 + A_ 2 + F# 2 + A_ 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + F# 2 + A_ 2 + F# 2 + A_ 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + F# 2 + A_ 2 + F# 2 + A_ 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + G# 2 + E_ 2 rest 2 - note E_, 4 - note G#, 4 - note F#, 2 - note A_, 2 - note F#, 2 + E_ 4 + G# 4 + F# 2 + A_ 2 + F# 2 rest 2 - note F#, 4 - note A_, 4 - note C#, 2 + F# 4 + A_ 4 + C# 2 rest 4 - note E_, 2 + E_ 2 rest 4 - note G#, 2 - note A_, 2 - note B_, 2 + G# 2 + A_ 2 + B_ 2 rest 8 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note F#, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note F#, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + F# 2 + A_ 2 + F# 2 + A_ 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + F# 2 + A_ 2 + F# 2 + A_ 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 loopchannel 0, Music_Cities2_branch_b64c -; 0xb6c7
\ No newline at end of file +; 0xb6c7 diff --git a/audio/music/credits.asm b/audio/music/credits.asm index cdedef62..4c3fa487 100644 --- a/audio/music/credits.asm +++ b/audio/music/credits.asm @@ -1,286 +1,286 @@ Music_Credits_Ch1:: ; 7fc1f (1f:7c1f) - tempo 0, 140 - stereopanning 119 + tempo 140 + volume 7, 7 duty 3 vibrato 8, 3, 4 - togglecall + toggleperfectpitch notetype 12, 11, 5 octave 4 - note E_, 6 + E_ 6 octave 3 - note A_, 1 + A_ 1 octave 4 - note E_, 1 - note D_, 6 + E_ 1 + D_ 6 octave 3 - note G_, 1 + G_ 1 octave 4 - note D_, 1 - note C#, 6 + D_ 1 + C# 6 octave 3 - note F#, 1 - octave 4 - note C#, 1 - note D_, 4 - note E_, 2 - note C#, 1 - note E_, 1 - note C#, 1 + F# 1 + octave 4 + C# 1 + D_ 4 + E_ 2 + C# 1 + E_ 1 + C# 1 rest 1 octave 3 - note E_, 1 + E_ 1 rest 3 - note E_, 1 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 3 - note E_, 1 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note E_, 1 - note E_, 1 - note F#, 1 - note G_, 1 + E_ 1 + E_ 1 + F# 1 + G_ 1 notetype 12, 11, 6 - note A_, 4 - note E_, 2 - note A_, 2 - note G_, 4 - note A_, 2 - note G_, 2 - note B_, 4 - note A_, 4 - note G_, 2 - note F#, 2 - note E_, 2 - note D_, 2 - note C#, 6 - note E_, 2 - note A_, 4 - note C#, 4 - note E_, 4 - note D_, 2 - note C#, 2 - note E_, 2 - note F#, 2 - note G_, 2 - note F#, 2 - note A_, 4 - note E_, 2 - note A_, 2 - note G_, 4 - note A_, 2 - note G_, 2 - note B_, 4 - note A_, 4 - note G_, 2 - note A_, 2 - note F#, 2 - note D_, 2 - note E_, 6 - note C#, 2 - note A_, 4 - note C#, 4 - note E_, 4 - note D_, 2 - note C#, 2 - note E_, 2 - note F#, 2 - note G_, 2 - note F#, 2 - note G_, 4 - note D_, 2 - note G_, 2 - note B_, 2 - note A_, 2 - note G_, 2 - note A_, 2 - note D_, 4 - note E_, 2 - note F#, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note D_, 2 - note E_, 6 - note A_, 2 - note G_, 4 - note F#, 4 - note G_, 4 - note F#, 4 - note E_, 4 - note D_, 4 - note G_, 4 - note D_, 2 - note G_, 2 - note B_, 2 - octave 4 - note C#, 2 + A_ 4 + E_ 2 + A_ 2 + G_ 4 + A_ 2 + G_ 2 + B_ 4 + A_ 4 + G_ 2 + F# 2 + E_ 2 + D_ 2 + C# 6 + E_ 2 + A_ 4 + C# 4 + E_ 4 + D_ 2 + C# 2 + E_ 2 + F# 2 + G_ 2 + F# 2 + A_ 4 + E_ 2 + A_ 2 + G_ 4 + A_ 2 + G_ 2 + B_ 4 + A_ 4 + G_ 2 + A_ 2 + F# 2 + D_ 2 + E_ 6 + C# 2 + A_ 4 + C# 4 + E_ 4 + D_ 2 + C# 2 + E_ 2 + F# 2 + G_ 2 + F# 2 + G_ 4 + D_ 2 + G_ 2 + B_ 2 + A_ 2 + G_ 2 + A_ 2 + D_ 4 + E_ 2 + F# 2 + G_ 2 + F# 2 + E_ 2 + D_ 2 + E_ 6 + A_ 2 + G_ 4 + F# 4 + G_ 4 + F# 4 + E_ 4 + D_ 4 + G_ 4 + D_ 2 + G_ 2 + B_ 2 + octave 4 + C# 2 octave 3 - note B_, 2 - note A_, 2 - note D_, 4 - note E_, 2 - note F#, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note D_, 2 + B_ 2 + A_ 2 + D_ 4 + E_ 2 + F# 2 + G_ 2 + F# 2 + E_ 2 + D_ 2 notetype 12, 11, 7 - note E_, 6 - note A_, 2 - note G_, 4 - note F#, 4 + E_ 6 + A_ 2 + G_ 4 + F# 4 notetype 12, 12, 7 - note A_, 4 - note B_, 4 + A_ 4 + B_ 4 octave 4 - note C#, 4 - note D_, 4 + C# 4 + D_ 4 octave 3 - note B_, 2 - note A_, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note F#, 2 - note G_, 2 - note A_, 2 + B_ 2 + A_ 2 + G_ 2 + F# 2 + E_ 2 + F# 2 + G_ 2 + A_ 2 notetype 12, 9, 0 - note G_, 8 - note F#, 8 - note E_, 8 - note D_, 8 + G_ 8 + F# 8 + E_ 8 + D_ 8 rest 16 rest 16 rest 8 notetype 12, 11, 6 - note E_, 6 - note D#, 1 - note D_, 1 + E_ 6 + D# 1 + D_ 1 notetype 12, 10, 0 - note C#, 8 + C# 8 notetype 12, 10, 7 - note C#, 8 + C# 8 rest 16 rest 16 rest 8 - note E_, 6 - note C#, 1 - note E_, 1 + E_ 6 + C# 1 + E_ 1 notetype 12, 10, 0 - note A_, 8 + A_ 8 notetype 12, 10, 7 - note A_, 8 + A_ 8 notetype 12, 11, 6 - note G_, 6 - note D_, 4 - note G_, 2 - note B_, 4 + G_ 6 + D_ 4 + G_ 2 + B_ 4 notetype 12, 11, 7 - note G_, 8 - note F#, 4 - note G#, 4 + G_ 8 + F# 4 + G# 4 notetype 12, 9, 0 - note A_, 8 - note F#, 8 - note E_, 8 - note C#, 8 + A_ 8 + F# 8 + E_ 8 + C# 8 notetype 12, 11, 7 - note D_, 8 - note C#, 8 + D_ 8 + C# 8 octave 2 - note B_, 8 + B_ 8 octave 3 - note D_, 8 + D_ 8 notetype 12, 9, 0 - note E_, 8 - note D_, 8 - note F#, 8 - note E_, 8 + E_ 8 + D_ 8 + F# 8 + E_ 8 notetype 12, 10, 0 - note D_, 8 - note E_, 8 - note D_, 8 - note C_, 8 - note G_, 8 - note F_, 8 - note E_, 8 - note D_, 8 + D_ 8 + E_ 8 + D_ 8 + C_ 8 + G_ 8 + F_ 8 + E_ 8 + D_ 8 notetype 12, 10, 0 - note C#, 6 + C# 6 notetype 12, 10, 7 - note C#, 6 + C# 6 notetype 12, 11, 7 - note D_, 4 - note E_, 8 - note G_, 6 - note F#, 1 - note F_, 1 + D_ 4 + E_ 8 + G_ 6 + F# 1 + F_ 1 notetype 12, 10, 0 - note E_, 6 + E_ 6 notetype 12, 10, 7 - note E_, 6 + E_ 6 notetype 12, 11, 7 - note D_, 4 + D_ 4 notetype 12, 10, 0 - note C#, 8 + C# 8 notetype 12, 10, 7 - note C#, 8 + C# 8 notetype 12, 11, 7 - note E_, 6 - note D_, 2 - note G_, 4 - note F#, 4 - note E_, 4 - note F#, 4 - note E_, 4 - note D_, 4 - note E_, 4 - note D_, 4 - note C#, 4 - note D_, 4 - note C#, 4 - note C#, 4 - note E_, 4 - note F#, 4 + E_ 6 + D_ 2 + G_ 4 + F# 4 + E_ 4 + F# 4 + E_ 4 + D_ 4 + E_ 4 + D_ 4 + C# 4 + D_ 4 + C# 4 + C# 4 + E_ 4 + F# 4 notetype 12, 10, 0 - note E_, 6 + E_ 6 notetype 12, 11, 7 - note D_, 2 - note G_, 4 - note F#, 4 - note E_, 4 - note F#, 4 - note A_, 4 - note B_, 4 + D_ 2 + G_ 4 + F# 4 + E_ 4 + F# 4 + A_ 4 + B_ 4 notetype 12, 10, 0 octave 4 - note C#, 16 - note C#, 8 + C# 16 + C# 8 notetype 12, 10, 7 - note C#, 8 + C# 8 notetype 12, 11, 5 octave 3 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 3 - note A_, 1 - note A_, 1 + A_ 1 + A_ 1 notetype 12, 11, 1 - note A_, 8 + A_ 8 endchannel @@ -289,326 +289,326 @@ Music_Credits_Ch2:: ; 7fd5f (1f:7d5f) vibrato 10, 2, 5 notetype 12, 12, 5 octave 4 - note A_, 6 - note E_, 1 - note A_, 1 - note G_, 6 - note D_, 1 - note G_, 1 + A_ 6 + E_ 1 + A_ 1 + G_ 6 + D_ 1 + G_ 1 notetype 12, 12, 7 - note F#, 12 - note G#, 2 - note E_, 1 - note G#, 1 + F# 12 + G# 2 + E_ 1 + G# 1 notetype 12, 12, 2 - note A_, 2 + A_ 2 notetype 12, 12, 1 octave 3 - note A_, 4 - note A_, 1 - note A_, 1 - note A_, 2 - note A_, 2 - note A_, 4 - note A_, 2 - note A_, 4 - note A_, 1 - note A_, 1 - note A_, 2 - note A_, 2 + A_ 4 + A_ 1 + A_ 1 + A_ 2 + A_ 2 + A_ 4 + A_ 2 + A_ 4 + A_ 1 + A_ 1 + A_ 2 + A_ 2 notetype 12, 12, 4 - note A_, 1 - note F#, 1 - note A_, 1 - note B_, 1 + A_ 1 + F# 1 + A_ 1 + B_ 1 notetype 12, 12, 7 octave 4 - note C#, 6 - note C#, 1 - note D_, 1 - note E_, 4 - note C#, 4 - note G_, 4 - note F#, 4 - note E_, 4 - note D_, 4 - note C#, 6 + C# 6 + C# 1 + D_ 1 + E_ 4 + C# 4 + G_ 4 + F# 4 + E_ 4 + D_ 4 + C# 6 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 8 + E_ 8 octave 3 - note A_, 6 - note E_, 2 - octave 4 - note C#, 8 - note C#, 6 - note C#, 1 - note D_, 1 - note E_, 4 - note C#, 4 - note G_, 4 - note F#, 4 - note E_, 4 - note D_, 4 - note C#, 6 + A_ 6 + E_ 2 + octave 4 + C# 8 + C# 6 + C# 1 + D_ 1 + E_ 4 + C# 4 + G_ 4 + F# 4 + E_ 4 + D_ 4 + C# 6 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 8 + E_ 8 octave 3 - note A_, 6 - note E_, 2 + A_ 6 + E_ 2 notetype 12, 11, 0 octave 4 - note C#, 8 + C# 8 notetype 12, 12, 7 - note D_, 6 + D_ 6 octave 3 - note B_, 2 + B_ 2 octave 4 - note G_, 8 + G_ 8 octave 3 - note G_, 6 - note D_, 2 - note B_, 8 + G_ 6 + D_ 2 + B_ 8 notetype 12, 11, 0 octave 4 - note C#, 6 + C# 6 notetype 12, 11, 7 - note C#, 6 - note D_, 4 + C# 6 + D_ 4 notetype 12, 10, 0 - note E_, 8 + E_ 8 notetype 12, 10, 7 - note E_, 8 + E_ 8 notetype 12, 12, 7 - note D_, 6 + D_ 6 octave 3 - note B_, 2 + B_ 2 octave 4 - note G_, 8 + G_ 8 octave 3 - note G_, 6 - note D_, 2 - note B_, 8 + G_ 6 + D_ 2 + B_ 8 notetype 12, 11, 0 octave 4 - note E_, 7 + E_ 7 notetype 12, 11, 7 - note E_, 7 + E_ 7 notetype 12, 12, 3 - note E_, 1 - note G#, 1 + E_ 1 + G# 1 notetype 12, 11, 0 - note A_, 8 + A_ 8 notetype 12, 11, 7 - note A_, 8 + A_ 8 notetype 12, 12, 6 - note G_, 4 - note F#, 4 - note E_, 4 - note D_, 4 + G_ 4 + F# 4 + E_ 4 + D_ 4 notetype 12, 10, 0 - note C#, 8 + C# 8 notetype 12, 10, 7 - note C#, 8 + C# 8 notetype 12, 9, 0 octave 3 - note A_, 8 + A_ 8 notetype 12, 9, 7 - note A_, 8 + A_ 8 notetype 12, 11, 0 - note E_, 8 + E_ 8 notetype 12, 11, 7 - note E_, 8 + E_ 8 notetype 12, 12, 7 - note D_, 8 - note G_, 6 - note F#, 1 - note F_, 1 - note E_, 8 + D_ 8 + G_ 6 + F# 1 + F_ 1 + E_ 8 notetype 12, 11, 7 - note G_, 6 - note F#, 1 - note F_, 1 + G_ 6 + F# 1 + F_ 1 notetype 12, 11, 0 - note E_, 8 + E_ 8 notetype 12, 11, 7 - note E_, 8 + E_ 8 notetype 12, 11, 0 - note D_, 8 + D_ 8 notetype 12, 11, 7 - note D_, 8 + D_ 8 notetype 12, 12, 7 octave 2 - note B_, 8 + B_ 8 octave 3 - note F#, 6 - note D_, 1 - note F#, 1 - note E_, 8 - note B_, 6 - note G_, 1 - note B_, 1 + F# 6 + D_ 1 + F# 1 + E_ 8 + B_ 6 + G_ 1 + B_ 1 notetype 12, 11, 0 octave 4 - note C#, 8 + C# 8 notetype 12, 11, 7 - note C#, 8 + C# 8 notetype 12, 11, 0 - note D_, 8 + D_ 8 notetype 12, 11, 7 - note D_, 8 + D_ 8 notetype 12, 12, 7 octave 3 - note B_, 8 + B_ 8 octave 4 - note D_, 6 + D_ 6 octave 3 - note B_, 1 + B_ 1 octave 4 - note D_, 1 + D_ 1 notetype 12, 11, 0 - note C#, 6 + C# 6 notetype 12, 11, 7 - note C#, 6 + C# 6 notetype 12, 12, 7 octave 3 - note B_, 4 + B_ 4 notetype 12, 11, 0 - note A_, 8 + A_ 8 notetype 12, 11, 7 - note A_, 8 + A_ 8 notetype 12, 11, 0 - note F#, 6 + F# 6 notetype 12, 11, 7 - note F#, 6 + F# 6 notetype 12, 12, 7 - note G#, 4 - note A_, 8 - note F#, 8 + G# 4 + A_ 8 + F# 8 notetype 12, 11, 0 - note G#, 6 + G# 6 notetype 12, 11, 7 - note G#, 6 + G# 6 notetype 12, 12, 7 - note A_, 4 - note B_, 8 - note G#, 8 + A_ 4 + B_ 8 + G# 8 notetype 12, 11, 0 - note A_, 6 + A_ 6 notetype 12, 11, 7 - note A_, 6 + A_ 6 notetype 12, 12, 7 - note B_, 4 + B_ 4 octave 4 - note C_, 8 + C_ 8 octave 3 - note A_, 8 + A_ 8 notetype 12, 11, 0 - note B_, 6 + B_ 6 notetype 12, 11, 7 - note B_, 6 + B_ 6 notetype 12, 12, 7 octave 4 - note C_, 4 + C_ 4 notetype 12, 11, 0 - note D_, 8 + D_ 8 octave 3 - note B_, 8 + B_ 8 notetype 12, 11, 0 octave 4 - note C#, 16 - note C#, 8 + C# 16 + C# 8 notetype 12, 11, 7 - note C#, 8 + C# 8 notetype 12, 11, 0 octave 3 - note A_, 16 - note A_, 8 + A_ 16 + A_ 8 notetype 12, 11, 7 - note A_, 8 + A_ 8 notetype 12, 12, 7 - note G_, 6 - note B_, 2 + G_ 6 + B_ 2 octave 4 - note D_, 8 + D_ 8 octave 3 - note B_, 6 + B_ 6 octave 4 - note D_, 2 - note G_, 6 - note F#, 1 - note F_, 1 - note E_, 8 + D_ 2 + G_ 6 + F# 1 + F_ 1 + E_ 8 octave 3 - note G_, 6 - note F#, 1 - note F_, 1 - note E_, 8 - note C#, 4 - note D_, 4 - note G_, 6 - note B_, 2 - octave 4 - note D_, 8 + G_ 6 + F# 1 + F_ 1 + E_ 8 + C# 4 + D_ 4 + G_ 6 + B_ 2 + octave 4 + D_ 8 octave 3 - note B_, 6 + B_ 6 octave 4 - note D_, 2 - note G_, 8 + D_ 2 + G_ 8 notetype 12, 11, 0 - note A_, 16 + A_ 16 notetype 12, 10, 0 - note A_, 8 + A_ 8 notetype 12, 10, 7 - note A_, 8 + A_ 8 notetype 12, 12, 1 - note A_, 2 - note A_, 4 - note A_, 1 - note A_, 1 + A_ 2 + A_ 4 + A_ 1 + A_ 1 notetype 12, 12, 1 - note A_, 8 + A_ 8 endchannel Music_Credits_Ch3:: ; 7fec2 (1f:7ec2) notetype 12, 1, 0 octave 5 - note C#, 6 + C# 6 octave 4 - note A_, 1 + A_ 1 octave 5 - note C#, 1 - note D_, 6 + C# 1 + D_ 6 octave 4 - note B_, 1 + B_ 1 octave 5 - note D_, 1 - note F#, 6 - note D_, 1 - note F#, 1 - note A_, 4 - note G#, 2 - note E_, 1 - note G#, 1 - note A_, 1 + D_ 1 + F# 6 + D_ 1 + F# 1 + A_ 4 + G# 2 + E_ 1 + G# 1 + A_ 1 rest 15 rest 16 callchannel Music_Credits_branch_7ffa4 callchannel Music_Credits_branch_7ffae callchannel Music_Credits_branch_7ffa4 octave 4 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note F#, 2 - note G_, 2 - note A_, 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + F# 2 + G_ 2 + A_ 2 callchannel Music_Credits_branch_7ffa4 callchannel Music_Credits_branch_7ffae callchannel Music_Credits_branch_7ffa4 @@ -617,30 +617,30 @@ Music_Credits_Ch3:: ; 7fec2 (1f:7ec2) callchannel Music_Credits_branch_7ffb8 callchannel Music_Credits_branch_7ffc1 octave 4 - note A_, 2 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note A_, 2 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note A_, 2 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note B_, 2 - note A_, 2 + B_ 2 + A_ 2 callchannel Music_Credits_branch_7ffb8 callchannel Music_Credits_branch_7ffb8 callchannel Music_Credits_branch_7ffc1 callchannel Music_Credits_branch_7ffc1 octave 4 - note G_, 4 - note A_, 4 - note B_, 4 + G_ 4 + A_ 4 + B_ 4 octave 5 - note D_, 4 + D_ 4 callchannel Music_Credits_branch_7ffa4 callchannel Music_Credits_branch_7ffa4 callchannel Music_Credits_branch_7ffa4 @@ -650,53 +650,53 @@ Music_Credits_Ch3:: ; 7fec2 (1f:7ec2) callchannel Music_Credits_branch_7ffae callchannel Music_Credits_branch_7ffae callchannel Music_Credits_branch_7ffa4 - note E_, 4 - note A_, 2 - note E_, 4 - note A_, 2 - note E_, 2 - note A_, 2 + E_ 4 + A_ 2 + E_ 4 + A_ 2 + E_ 2 + A_ 2 callchannel Music_Credits_branch_7ffae callchannel Music_Credits_branch_7ffae callchannel Music_Credits_branch_7ffa4 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note G#, 2 - note A_, 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + G# 2 + A_ 2 callchannel Music_Credits_branch_7ffd2 callchannel Music_Credits_branch_7ffd2 callchannel Music_Credits_branch_7ffdb callchannel Music_Credits_branch_7ffdb - note F_, 2 - note A_, 2 - note F_, 2 - note A_, 2 - note F_, 2 - note A_, 2 - note F_, 2 - note A_, 2 - note F_, 2 - note A_, 2 - note G_, 2 - note F_, 2 - note E_, 2 - note D_, 2 - note E_, 2 - note F_, 2 + F_ 2 + A_ 2 + F_ 2 + A_ 2 + F_ 2 + A_ 2 + F_ 2 + A_ 2 + F_ 2 + A_ 2 + G_ 2 + F_ 2 + E_ 2 + D_ 2 + E_ 2 + F_ 2 callchannel Music_Credits_branch_7ffb8 callchannel Music_Credits_branch_7ffb8 - note E_, 4 - note A_, 4 - note E_, 4 - note A_, 4 - note E_, 4 - note A_, 4 - note E_, 4 - note A_, 4 + E_ 4 + A_ 4 + E_ 4 + A_ 4 + E_ 4 + A_ 4 + E_ 4 + A_ 4 callchannel Music_Credits_branch_7ffa4 callchannel Music_Credits_branch_7ffa4 callchannel Music_Credits_branch_7ffe4 @@ -707,115 +707,115 @@ Music_Credits_Ch3:: ; 7fec2 (1f:7ec2) callchannel Music_Credits_branch_7ffb8 callchannel Music_Credits_branch_7ffed callchannel Music_Credits_branch_7ffed - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 3 - note A_, 1 - note A_, 1 - note A_, 1 + A_ 1 + A_ 1 + A_ 1 rest 7 endchannel Music_Credits_branch_7ffa4:: octave 4 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 endchannel Music_Credits_branch_7ffae:: octave 4 - note D_, 2 - note G_, 2 - note D_, 2 - note G_, 2 - note D_, 2 - note G_, 2 - note D_, 2 - note G_, 2 + D_ 2 + G_ 2 + D_ 2 + G_ 2 + D_ 2 + G_ 2 + D_ 2 + G_ 2 endchannel Music_Credits_branch_7ffb8:: - note G_, 2 - note B_, 2 - note G_, 2 - note B_, 2 - note G_, 2 - note B_, 2 - note G_, 2 - note B_, 2 + G_ 2 + B_ 2 + G_ 2 + B_ 2 + G_ 2 + B_ 2 + G_ 2 + B_ 2 endchannel Music_Credits_branch_7ffc1:: octave 4 - note A_, 2 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note A_, 2 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note A_, 2 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note A_, 2 + A_ 2 octave 5 - note C#, 2 + C# 2 endchannel Music_Credits_branch_7ffd2:: - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 endchannel Music_Credits_branch_7ffdb:: - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 endchannel Music_Credits_branch_7ffe4:: - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 endchannel Music_Credits_branch_7ffed:: - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 3 - note A_, 1 - note A_, 1 - note A_, 1 + A_ 1 + A_ 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 3 endchannel -; 0x7fffa
\ No newline at end of file +; 0x7fffa diff --git a/audio/music/defeatedgymleader.asm b/audio/music/defeatedgymleader.asm index 0e24d904..96c2b9fc 100644 --- a/audio/music/defeatedgymleader.asm +++ b/audio/music/defeatedgymleader.asm @@ -1,164 +1,164 @@ Music_DefeatedGymLeader_Ch1:: ; 23cad (8:7cad) - tempo 0, 112 - stereopanning 119 + tempo 112 + volume 7, 7 duty 3 vibrato 18, 3, 1 - togglecall - tempo 0, 112 + toggleperfectpitch + tempo 112 notetype 12, 10, 6 octave 4 - note D_, 6 + D_ 6 octave 3 - note A_, 1 + A_ 1 octave 4 - note D_, 1 - note F#, 6 - note D_, 1 - note F#, 1 + D_ 1 + F# 6 + D_ 1 + F# 1 notetype 12, 10, 0 - note A_, 8 + A_ 8 notetype 12, 10, 7 - note A_, 8 + A_ 8 Music_DefeatedGymLeader_branch_23ccc:: notetype 12, 11, 2 octave 3 - note A_, 2 - note A_, 2 - note F#, 4 - note G_, 2 - note G_, 2 - note E_, 4 - note D_, 2 - note E_, 2 - note D_, 2 - note E_, 2 - note D_, 4 - note D_, 4 - note A_, 2 - note A_, 2 - note F#, 4 - note G_, 2 - note G_, 2 - note E_, 4 - note D_, 2 - note E_, 2 - note D_, 2 - note C#, 2 + A_ 2 + A_ 2 + F# 4 + G_ 2 + G_ 2 + E_ 4 + D_ 2 + E_ 2 + D_ 2 + E_ 2 + D_ 4 + D_ 4 + A_ 2 + A_ 2 + F# 4 + G_ 2 + G_ 2 + E_ 4 + D_ 2 + E_ 2 + D_ 2 + C# 2 notetype 12, 11, 1 octave 2 - note B_, 8 + B_ 8 notetype 12, 11, 2 octave 3 - note A_, 2 - note A_, 2 - note F#, 4 - note G_, 2 - note G_, 2 - note E_, 4 - note D_, 2 - note E_, 2 - note D_, 2 - note E_, 2 - note D_, 4 - note D_, 4 - note A_, 2 - note A_, 2 - note F#, 4 - note G_, 2 - note G_, 2 - note E_, 4 - note D_, 2 - note E_, 2 - note D_, 2 - note C#, 2 + A_ 2 + A_ 2 + F# 4 + G_ 2 + G_ 2 + E_ 4 + D_ 2 + E_ 2 + D_ 2 + E_ 2 + D_ 4 + D_ 4 + A_ 2 + A_ 2 + F# 4 + G_ 2 + G_ 2 + E_ 4 + D_ 2 + E_ 2 + D_ 2 + C# 2 notetype 12, 11, 1 octave 2 - note B_, 8 + B_ 8 notetype 12, 9, 7 octave 3 - note D_, 6 + D_ 6 octave 2 - note A_, 1 + A_ 1 octave 3 - note D_, 1 - note F#, 8 + D_ 1 + F# 8 notetype 12, 11, 0 - note F#, 6 - note E_, 1 - note F#, 1 - note A_, 8 + F# 6 + E_ 1 + F# 1 + A_ 8 notetype 12, 9, 7 - note E_, 6 - note C#, 1 - note E_, 1 - note G#, 8 + E_ 6 + C# 1 + E_ 1 + G# 8 notetype 12, 11, 0 - note G#, 6 - note E_, 1 - note G#, 1 - note B_, 8 + G# 6 + E_ 1 + G# 1 + B_ 8 notetype 12, 9, 7 - note C#, 6 + C# 6 octave 2 - note A_, 1 + A_ 1 octave 3 - note C#, 1 - note E_, 8 + C# 1 + E_ 8 notetype 12, 11, 0 - note E_, 6 - note C#, 1 - note E_, 1 - note E_, 4 - note G_, 4 + E_ 6 + C# 1 + E_ 1 + E_ 4 + G_ 4 notetype 12, 9, 0 - note F#, 8 - note E_, 8 - note D_, 8 - note C#, 8 + F# 8 + E_ 8 + D_ 8 + C# 8 notetype 12, 9, 7 - note D_, 6 + D_ 6 octave 2 - note A_, 1 + A_ 1 octave 3 - note D_, 1 - note F#, 8 + D_ 1 + F# 8 notetype 12, 11, 0 - note F#, 6 - note E_, 1 - note F#, 1 - note A_, 8 + F# 6 + E_ 1 + F# 1 + A_ 8 notetype 12, 9, 7 - note E_, 6 - note C#, 1 - note E_, 1 - note G#, 8 + E_ 6 + C# 1 + E_ 1 + G# 8 notetype 12, 11, 0 - note G#, 6 - note E_, 1 - note G#, 1 - note B_, 8 + G# 6 + E_ 1 + G# 1 + B_ 8 notetype 12, 9, 7 - note C#, 6 + C# 6 octave 2 - note A_, 1 + A_ 1 octave 3 - note C#, 1 - note E_, 8 + C# 1 + E_ 8 notetype 12, 11, 0 - note E_, 6 - note C#, 1 - note E_, 1 - note E_, 4 - note G_, 4 + E_ 6 + C# 1 + E_ 1 + E_ 4 + G_ 4 notetype 12, 9, 7 - note F#, 6 - note E_, 1 - note F#, 1 - note A_, 8 + F# 6 + E_ 1 + F# 1 + A_ 8 notetype 12, 10, 7 - note G_, 8 - note E_, 8 + G_ 8 + E_ 8 loopchannel 0, Music_DefeatedGymLeader_branch_23ccc @@ -167,188 +167,188 @@ Music_DefeatedGymLeader_Ch2:: ; 23d6d (8:7d6d) vibrato 24, 2, 4 notetype 12, 12, 4 octave 4 - note A_, 6 - note F#, 1 - note A_, 1 + A_ 6 + F# 1 + A_ 1 octave 5 - note D_, 6 + D_ 6 octave 4 - note A_, 1 + A_ 1 octave 5 - note D_, 1 + D_ 1 notetype 12, 11, 0 - note F#, 8 + F# 8 notetype 12, 11, 7 - note F#, 8 + F# 8 Music_DefeatedGymLeader_branch_23d84:: notetype 12, 12, 2 octave 4 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 3 - note B_, 4 + B_ 4 octave 4 - note C#, 2 + C# 2 octave 3 - note B_, 2 - note A_, 4 - note B_, 2 - note A_, 2 - note G_, 2 - note F#, 2 + B_ 2 + A_ 4 + B_ 2 + A_ 2 + G_ 2 + F# 2 notetype 12, 12, 4 - note A_, 4 - note A_, 4 + A_ 4 + A_ 4 notetype 12, 12, 2 octave 4 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 3 - note B_, 4 + B_ 4 octave 4 - note C#, 2 + C# 2 octave 3 - note B_, 2 - note A_, 4 - note B_, 2 - note A_, 2 - note G_, 2 - note F#, 2 + B_ 2 + A_ 4 + B_ 2 + A_ 2 + G_ 2 + F# 2 notetype 12, 12, 1 - note D_, 6 + D_ 6 notetype 6, 12, 2 - note G_, 1 - note A_, 1 - note B_, 1 + G_ 1 + A_ 1 + B_ 1 octave 4 - note C#, 1 + C# 1 notetype 12, 12, 2 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 3 - note B_, 4 + B_ 4 octave 4 - note C#, 2 + C# 2 octave 3 - note B_, 2 - note A_, 4 - note B_, 2 - note A_, 2 - note G_, 2 - note F#, 2 + B_ 2 + A_ 4 + B_ 2 + A_ 2 + G_ 2 + F# 2 notetype 12, 12, 4 - note A_, 4 - note A_, 3 + A_ 4 + A_ 3 notetype 6, 12, 2 - note B_, 1 + B_ 1 octave 4 - note C#, 1 + C# 1 notetype 12, 12, 2 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 3 - note B_, 4 + B_ 4 octave 4 - note C#, 2 + C# 2 octave 3 - note B_, 2 - note A_, 4 - note B_, 2 - note A_, 2 - note G_, 2 - note F#, 2 + B_ 2 + A_ 4 + B_ 2 + A_ 2 + G_ 2 + F# 2 notetype 12, 12, 1 - note D_, 8 + D_ 8 notetype 12, 12, 7 - note A_, 6 - note F#, 1 - note A_, 1 + A_ 6 + F# 1 + A_ 1 notetype 12, 11, 0 octave 4 - note D_, 8 + D_ 8 notetype 12, 10, 0 - note D_, 8 + D_ 8 notetype 12, 9, 7 - note D_, 8 + D_ 8 notetype 12, 12, 7 octave 3 - note B_, 6 - note G#, 1 - note B_, 1 + B_ 6 + G# 1 + B_ 1 notetype 12, 8, 0 octave 4 - note E_, 8 + E_ 8 notetype 12, 10, 0 - note E_, 8 + E_ 8 notetype 12, 12, 7 - note E_, 8 + E_ 8 octave 3 - note G_, 6 - note E_, 1 - note G_, 1 + G_ 6 + E_ 1 + G_ 1 notetype 12, 6, 15 octave 4 - note C#, 8 + C# 8 notetype 12, 12, 7 - note C#, 8 - note F#, 4 - note E_, 4 + C# 8 + F# 4 + E_ 4 notetype 12, 11, 0 - note D_, 14 + D_ 14 octave 3 - note B_, 2 + B_ 2 notetype 12, 10, 0 - note A_, 8 + A_ 8 notetype 12, 11, 7 - note A_, 8 + A_ 8 notetype 12, 12, 7 - note A_, 6 - note F#, 1 - note A_, 1 + A_ 6 + F# 1 + A_ 1 notetype 12, 11, 0 octave 4 - note D_, 8 + D_ 8 notetype 12, 10, 0 - note D_, 8 + D_ 8 notetype 12, 9, 7 - note D_, 8 + D_ 8 notetype 12, 12, 7 octave 3 - note B_, 6 - note G#, 1 - note B_, 1 + B_ 6 + G# 1 + B_ 1 notetype 12, 4, 15 octave 4 - note E_, 8 + E_ 8 notetype 12, 11, 0 - note E_, 8 + E_ 8 notetype 12, 12, 7 - note E_, 8 + E_ 8 octave 3 - note G_, 6 - note E_, 1 - note G_, 1 + G_ 6 + E_ 1 + G_ 1 notetype 12, 11, 0 octave 4 - note C#, 8 + C# 8 notetype 12, 11, 7 - note C#, 8 + C# 8 octave 3 - note A_, 4 + A_ 4 octave 4 - note C#, 4 + C# 4 notetype 12, 11, 0 - note D_, 14 - note E_, 2 - note D_, 12 + D_ 14 + E_ 2 + D_ 12 notetype 12, 12, 2 octave 3 - note G_, 1 - note A_, 1 - note B_, 1 + G_ 1 + A_ 1 + B_ 1 octave 4 - note C#, 1 + C# 1 loopchannel 0, Music_DefeatedGymLeader_branch_23d84 @@ -356,253 +356,253 @@ Music_DefeatedGymLeader_Ch3:: ; 23e52 (8:7e52) notetype 12, 1, 0 vibrato 16, 1, 2 octave 4 - note F#, 6 - note D_, 1 - note F#, 1 - note A_, 6 - note F#, 1 - note A_, 1 + F# 6 + D_ 1 + F# 1 + A_ 6 + F# 1 + A_ 1 octave 5 - note D_, 6 + D_ 6 octave 4 - note A_, 1 + A_ 1 octave 5 - note D_, 1 - note F#, 8 + D_ 1 + F# 8 Music_DefeatedGymLeader_branch_23e65:: octave 4 - note F#, 1 + F# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note F#, 1 + F# 1 rest 3 - note G_, 1 + G_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note G_, 1 + G_ 1 rest 3 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note F#, 3 + F# 3 rest 1 - note F#, 3 + F# 3 rest 1 - note F#, 1 + F# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note F#, 1 + F# 1 rest 3 - note G_, 1 + G_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note D_, 1 + D_ 1 rest 5 - note D_, 1 + D_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note G_, 3 + G_ 3 rest 1 - note D_, 3 + D_ 3 rest 1 - note F#, 1 + F# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F#, 1 + F# 1 rest 7 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note D#, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note C#, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note C#, 2 - note D_, 2 - note E_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note D#, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note C#, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note G_, 2 - note A_, 2 - note G_, 2 - note E_, 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + D# 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + C# 2 + A_ 2 + C# 2 + A_ 2 + C# 2 + A_ 2 + C# 2 + A_ 2 + C# 2 + A_ 2 + C# 2 + A_ 2 + C# 2 + A_ 2 + C# 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + C# 2 + D_ 2 + E_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + D# 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + C# 2 + A_ 2 + C# 2 + A_ 2 + C# 2 + A_ 2 + C# 2 + A_ 2 + C# 2 + A_ 2 + C# 2 + A_ 2 + C# 2 + A_ 2 + C# 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + G_ 2 + A_ 2 + G_ 2 + E_ 2 loopchannel 0, Music_DefeatedGymLeader_branch_23e65 -; 0x23f52
\ No newline at end of file +; 0x23f52 diff --git a/audio/music/defeatedtrainer.asm b/audio/music/defeatedtrainer.asm index 5585066a..624190f6 100644 --- a/audio/music/defeatedtrainer.asm +++ b/audio/music/defeatedtrainer.asm @@ -1,97 +1,97 @@ Music_DefeatedTrainer_Ch1:: ; 23a53 (8:7a53) - tempo 0, 224 - stereopanning 119 + tempo 224 + volume 7, 7 duty 2 - togglecall - tempo 0, 224 + toggleperfectpitch + tempo 224 notetype 4, 10, 2 octave 4 - note D_, 2 - tempo 0, 224 + D_ 2 + tempo 224 notetype 4, 10, 2 - note D_, 2 - note D_, 2 - note D_, 2 + D_ 2 + D_ 2 + D_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note D_, 2 + D_ 2 notetype 4, 11, 3 - note F#, 12 + F# 12 duty 1 - tempo 0, 224 + tempo 224 Music_DefeatedTrainer_branch_23a76:: notetype 4, 6, 3 octave 3 - note A_, 6 - note F#, 3 - note A_, 3 - note B_, 6 - note G#, 3 - note B_, 3 + A_ 6 + F# 3 + A_ 3 + B_ 6 + G# 3 + B_ 3 octave 4 - note C#, 3 + C# 3 octave 3 - note B_, 3 - note A_, 3 - note G_, 3 - note A_, 3 - note B_, 3 - note A_, 3 - note G_, 3 - note A_, 6 - note F#, 3 - note A_, 3 - note B_, 6 - note G#, 3 - note B_, 3 + B_ 3 + A_ 3 + G_ 3 + A_ 3 + B_ 3 + A_ 3 + G_ 3 + A_ 6 + F# 3 + A_ 3 + B_ 6 + G# 3 + B_ 3 octave 4 - note C#, 3 - note D_, 3 - note E_, 3 - note F#, 3 - note C#, 3 + C# 3 + D_ 3 + E_ 3 + F# 3 + C# 3 octave 3 - note B_, 3 - note A_, 3 + B_ 3 + A_ 3 octave 4 - note C#, 3 + C# 3 octave 3 - note A_, 6 - note F#, 3 - note A_, 3 - note B_, 6 - note G#, 3 - note B_, 3 + A_ 6 + F# 3 + A_ 3 + B_ 6 + G# 3 + B_ 3 octave 4 - note C_, 6 + C_ 6 octave 3 - note A_, 3 + A_ 3 octave 4 - note C_, 3 - note D_, 3 + C_ 3 + D_ 3 octave 3 - note B_, 3 + B_ 3 octave 4 - note D_, 6 - note C#, 3 + D_ 6 + C# 3 octave 3 - note B_, 3 - note A_, 3 - note G_, 3 - note F#, 3 - note G_, 3 - note A_, 3 - note B_, 3 - note A_, 3 - note G_, 3 - note F#, 3 - note E_, 3 - note F#, 3 - note G_, 3 - note A_, 3 - note B_, 3 + B_ 3 + A_ 3 + G_ 3 + F# 3 + G_ 3 + A_ 3 + B_ 3 + A_ 3 + G_ 3 + F# 3 + E_ 3 + F# 3 + G_ 3 + A_ 3 + B_ 3 loopchannel 0, Music_DefeatedTrainer_branch_23a76 @@ -99,169 +99,169 @@ Music_DefeatedTrainer_Ch2:: ; 23ac1 (8:7ac1) duty 2 notetype 4, 12, 3 octave 4 - note A_, 2 + A_ 2 notetype 4, 12, 3 - note A_, 2 - note A_, 2 - note A_, 2 - note B_, 2 + A_ 2 + A_ 2 + A_ 2 + B_ 2 octave 5 - note C#, 2 + C# 2 notetype 4, 12, 4 - note D_, 12 + D_ 12 Music_DefeatedTrainer_branch_23ad2:: notetype 4, 8, 5 octave 4 - note D_, 6 + D_ 6 octave 3 - note A_, 3 + A_ 3 octave 4 - note D_, 3 - note E_, 6 + D_ 3 + E_ 6 octave 3 - note B_, 3 + B_ 3 octave 4 - note E_, 3 - note F#, 3 - note G_, 3 - note A_, 6 - note E_, 3 - note F#, 3 - note G_, 6 - note D_, 6 + E_ 3 + F# 3 + G_ 3 + A_ 6 + E_ 3 + F# 3 + G_ 6 + D_ 6 octave 3 - note A_, 3 + A_ 3 octave 4 - note D_, 3 - note E_, 6 + D_ 3 + E_ 6 octave 3 - note B_, 3 + B_ 3 octave 4 - note E_, 3 - note F#, 3 - note G_, 3 - note A_, 6 - note F#, 3 - note G_, 3 - note A_, 6 - note D_, 6 + E_ 3 + F# 3 + G_ 3 + A_ 6 + F# 3 + G_ 3 + A_ 6 + D_ 6 octave 3 - note A_, 3 + A_ 3 octave 4 - note D_, 3 - note E_, 6 + D_ 3 + E_ 6 octave 3 - note B_, 3 + B_ 3 octave 4 - note E_, 3 - note F_, 6 - note C_, 3 - note F_, 3 - note G_, 3 - note D_, 3 - note G_, 6 + E_ 3 + F_ 6 + C_ 3 + F_ 3 + G_ 3 + D_ 3 + G_ 6 notetype 4, 7, 0 - note F#, 12 + F# 12 notetype 4, 7, 7 - note F#, 12 + F# 12 notetype 4, 6, 0 - note E_, 12 + E_ 12 notetype 4, 6, 7 - note E_, 12 + E_ 12 loopchannel 0, Music_DefeatedTrainer_branch_23ad2 Music_DefeatedTrainer_Ch3:: ; 23b15 (8:7b15) notetype 4, 1, 0 octave 5 - note D_, 2 + D_ 2 notetype 4, 1, 0 - note D_, 2 - note D_, 2 + D_ 2 + D_ 2 octave 4 - note B_, 2 - note A_, 2 - note G_, 2 - note A_, 12 + B_ 2 + A_ 2 + G_ 2 + A_ 12 notetype 4, 2, 1 Music_DefeatedTrainer_branch_23b24:: - note F#, 3 + F# 3 rest 3 - note F#, 3 + F# 3 rest 3 - note G#, 3 + G# 3 rest 3 - note G#, 3 + G# 3 rest 3 - note A_, 3 + A_ 3 rest 3 - note A_, 3 + A_ 3 rest 3 - note B_, 3 + B_ 3 rest 3 - note B_, 3 + B_ 3 rest 3 - note F#, 3 + F# 3 rest 3 - note F#, 3 + F# 3 rest 3 - note G#, 3 + G# 3 rest 3 - note G#, 3 + G# 3 rest 3 - note A_, 3 + A_ 3 rest 3 - note A_, 3 + A_ 3 rest 3 octave 5 - note C#, 3 + C# 3 rest 3 - note C#, 3 + C# 3 octave 4 - note A_, 3 - note F#, 3 + A_ 3 + F# 3 octave 5 - note D_, 3 + D_ 3 octave 4 - note F#, 3 + F# 3 rest 3 - note G#, 3 + G# 3 octave 5 - note E_, 3 + E_ 3 octave 4 - note G#, 3 + G# 3 rest 3 - note A_, 3 + A_ 3 octave 5 - note F_, 3 + F_ 3 octave 4 - note A_, 3 + A_ 3 rest 3 - note B_, 3 + B_ 3 octave 5 - note G_, 3 + G_ 3 octave 4 - note B_, 3 - note A#, 3 - note A_, 3 + B_ 3 + A# 3 + A_ 3 rest 3 - note A_, 3 + A_ 3 rest 3 - note A_, 3 + A_ 3 rest 3 - note A_, 3 + A_ 3 octave 5 - note C_, 3 - note C#, 3 + C_ 3 + C# 3 rest 3 - note C#, 3 + C# 3 rest 3 - note C#, 3 + C# 3 rest 3 - note C#, 3 + C# 3 octave 4 - note A_, 3 + A_ 3 loopchannel 0, Music_DefeatedTrainer_branch_23b24 -; 0x23b74
\ No newline at end of file +; 0x23b74 diff --git a/audio/music/defeatedwildmon.asm b/audio/music/defeatedwildmon.asm index c56c6471..93b4d3ff 100644 --- a/audio/music/defeatedwildmon.asm +++ b/audio/music/defeatedwildmon.asm @@ -1,69 +1,69 @@ Music_DefeatedWildMon_Ch1:: ; 23b74 (8:7b74) - tempo 0, 112 - stereopanning 119 + tempo 112 + volume 7, 7 executemusic duty 3 vibrato 6, 3, 4 - togglecall - tempo 0, 112 + toggleperfectpitch + tempo 112 notetype 12, 11, 7 octave 3 - note B_, 1 - note A_, 1 - note G#, 1 - note F#, 1 - note E_, 12 + B_ 1 + A_ 1 + G# 1 + F# 1 + E_ 12 Music_DefeatedWildMon_branch_23b8b:: notetype 12, 6, 2 - note E_, 2 - note F#, 2 - note E_, 2 - note F#, 2 - note G#, 2 - note G#, 2 - note G#, 4 - note A_, 2 - note A_, 2 - note A_, 4 - note G#, 2 - note G#, 2 - note G#, 4 - note E_, 2 - note F#, 2 - note E_, 2 - note F#, 2 - note G#, 2 - note G#, 2 - note G#, 4 - note A_, 2 - note A_, 2 - note A_, 4 - note G#, 8 - note F_, 2 - note G_, 2 - note F_, 2 - note G_, 2 - note A_, 2 - note A_, 2 - note A_, 4 - note A#, 2 - note A#, 2 - note A#, 4 - note A_, 2 - note A_, 2 - note A_, 4 - note F_, 2 - note G_, 2 - note F_, 2 - note G_, 2 - note A_, 2 - note A_, 2 - note A_, 4 - note A#, 2 - note A#, 2 - note A#, 4 - note A_, 8 + E_ 2 + F# 2 + E_ 2 + F# 2 + G# 2 + G# 2 + G# 4 + A_ 2 + A_ 2 + A_ 4 + G# 2 + G# 2 + G# 4 + E_ 2 + F# 2 + E_ 2 + F# 2 + G# 2 + G# 2 + G# 4 + A_ 2 + A_ 2 + A_ 4 + G# 8 + F_ 2 + G_ 2 + F_ 2 + G_ 2 + A_ 2 + A_ 2 + A_ 4 + A# 2 + A# 2 + A# 4 + A_ 2 + A_ 2 + A_ 4 + F_ 2 + G_ 2 + F_ 2 + G_ 2 + A_ 2 + A_ 2 + A_ 4 + A# 2 + A# 2 + A# 4 + A_ 8 loopchannel 0, Music_DefeatedWildMon_branch_23b8b @@ -72,73 +72,73 @@ Music_DefeatedWildMon_Ch2:: ; 23bc1 (8:7bc1) duty 2 notetype 12, 12, 3 octave 4 - note E_, 1 - note F#, 1 - note G#, 1 - note A_, 1 + E_ 1 + F# 1 + G# 1 + A_ 1 notetype 12, 12, 7 - note B_, 12 + B_ 12 Music_DefeatedWildMon_branch_23bce:: notetype 12, 8, 2 octave 3 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 2 - note B_, 2 - note B_, 2 - note B_, 4 + B_ 2 + A_ 2 + G# 2 + A_ 2 + B_ 2 + B_ 2 + B_ 4 octave 4 - note C#, 2 - note C#, 2 - note C#, 4 + C# 2 + C# 2 + C# 4 octave 3 - note B_, 2 - note B_, 2 - note B_, 4 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 2 - note B_, 2 - note B_, 2 - note B_, 4 + B_ 2 + B_ 2 + B_ 4 + B_ 2 + A_ 2 + G# 2 + A_ 2 + B_ 2 + B_ 2 + B_ 4 octave 4 - note C#, 2 - note C#, 2 - note C#, 4 + C# 2 + C# 2 + C# 4 octave 3 - note B_, 8 + B_ 8 octave 4 - note C_, 2 + C_ 2 octave 3 - note A#, 2 - note A_, 2 - note A#, 2 + A# 2 + A_ 2 + A# 2 octave 4 - note C_, 2 - note C_, 2 - note C_, 4 - note D_, 2 - note D_, 2 - note D_, 4 - note C_, 2 - note C_, 2 - note C_, 4 - note C_, 2 + C_ 2 + C_ 2 + C_ 4 + D_ 2 + D_ 2 + D_ 4 + C_ 2 + C_ 2 + C_ 4 + C_ 2 octave 3 - note A#, 2 - note A_, 2 - note A#, 2 + A# 2 + A_ 2 + A# 2 octave 4 - note C_, 2 - note C_, 2 - note C_, 4 - note D_, 2 - note D_, 2 - note D_, 4 - note C_, 8 + C_ 2 + C_ 2 + C_ 4 + D_ 2 + D_ 2 + D_ 4 + C_ 8 loopchannel 0, Music_DefeatedWildMon_branch_23bce @@ -146,158 +146,158 @@ Music_DefeatedWildMon_Ch3:: ; 23c0e (8:7c0e) executemusic notetype 12, 2, 0 octave 5 - note E_, 1 + E_ 1 rest 1 octave 6 - note C#, 1 + C# 1 rest 1 octave 5 - note B_, 1 + B_ 1 rest 1 octave 6 - note D#, 1 + D# 1 rest 1 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 3 Music_DefeatedWildMon_branch_23c21:: octave 4 - note E_, 1 + E_ 1 rest 1 octave 5 - note E_, 1 + E_ 1 rest 1 octave 4 - note E_, 1 + E_ 1 rest 1 octave 5 - note E_, 1 + E_ 1 rest 1 octave 4 - note E_, 1 + E_ 1 rest 3 octave 5 - note E_, 1 + E_ 1 rest 3 octave 4 - note F#, 1 + F# 1 rest 1 octave 5 - note F#, 1 + F# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 1 octave 5 - note D#, 1 + D# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 octave 5 - note E_, 1 + E_ 1 rest 1 octave 4 - note E_, 1 + E_ 1 rest 1 octave 5 - note E_, 1 + E_ 1 rest 1 octave 4 - note E_, 1 + E_ 1 rest 3 octave 5 - note E_, 1 + E_ 1 rest 3 octave 4 - note F#, 1 + F# 1 rest 1 octave 5 - note F#, 1 + F# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 3 octave 5 - note E_, 1 + E_ 1 rest 3 octave 4 - note D#, 4 + D# 4 octave 4 - note F_, 1 + F_ 1 rest 1 octave 5 - note F_, 1 + F_ 1 rest 1 octave 4 - note F_, 1 + F_ 1 rest 1 octave 5 - note F_, 1 + F_ 1 rest 1 octave 4 - note F_, 1 + F_ 1 rest 3 octave 5 - note F_, 1 + F_ 1 rest 3 octave 4 - note G_, 1 + G_ 1 rest 1 octave 5 - note G_, 1 + G_ 1 rest 1 octave 4 - note G_, 1 + G_ 1 rest 3 - note F_, 1 + F_ 1 rest 1 octave 5 - note F_, 1 + F_ 1 rest 1 octave 4 - note F_, 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 octave 5 - note F_, 1 + F_ 1 rest 1 octave 4 - note F_, 1 + F_ 1 rest 1 octave 5 - note F_, 1 + F_ 1 rest 1 octave 4 - note F_, 1 + F_ 1 rest 3 octave 5 - note F_, 1 + F_ 1 rest 3 octave 4 - note G_, 1 + G_ 1 rest 1 octave 5 - note G_, 1 + G_ 1 rest 1 octave 4 - note G_, 1 + G_ 1 rest 3 octave 5 - note F_, 1 + F_ 1 rest 3 octave 4 - note D#, 4 + D# 4 loopchannel 0, Music_DefeatedWildMon_branch_23c21 -; 0x23cad
\ No newline at end of file +; 0x23cad diff --git a/audio/music/dungeon1.asm b/audio/music/dungeon1.asm index c9bf6dba..e73eb707 100644 --- a/audio/music/dungeon1.asm +++ b/audio/music/dungeon1.asm @@ -1,15 +1,15 @@ Music_Dungeon1_Ch1:: ; 7ded1 (1f:5ed1) - tempo 0, 144 - stereopanning 119 + tempo 144 + volume 7, 7 duty 3 - togglecall + toggleperfectpitch vibrato 10, 1, 4 notetype 12, 4, 13 rest 8 - unknownmusic0xee 237 + stereopanning 237 octave 4 - note F#, 8 - unknownmusic0xee 255 + F# 8 + stereopanning 255 Music_Dungeon1_branch_7dee5:: notetype 12, 11, 2 @@ -18,210 +18,210 @@ Music_Dungeon1_branch_7dee5:: Music_Dungeon1_branch_7dee8:: callchannel Music_Dungeon1_branch_7dfaa loopchannel 3, Music_Dungeon1_branch_7dee8 - note E_, 1 - note D#, 1 - note B_, 1 - note A#, 1 - note G_, 1 - note G#, 1 + E_ 1 + D# 1 + B_ 1 + A# 1 + G_ 1 + G# 1 rest 1 - note A#, 1 - note E_, 1 - note D#, 1 - note B_, 1 - note A#, 1 - note G_, 1 - note G#, 1 - note A_, 1 - note A#, 1 + A# 1 + E_ 1 + D# 1 + B_ 1 + A# 1 + G_ 1 + G# 1 + A_ 1 + A# 1 Music_Dungeon1_branch_7deff:: callchannel Music_Dungeon1_branch_7dfaa loopchannel 4, Music_Dungeon1_branch_7deff callchannel Music_Dungeon1_branch_7dfd5 octave 3 - note G_, 1 - note F#, 1 - note E_, 1 - note G_, 1 + G_ 1 + F# 1 + E_ 1 + G_ 1 callchannel Music_Dungeon1_branch_7dfd5 octave 3 - note A_, 1 - note G_, 1 - note E_, 1 - note A_, 1 + A_ 1 + G_ 1 + E_ 1 + A_ 1 callchannel Music_Dungeon1_branch_7dfd5 octave 3 - note B_, 1 - note A_, 1 - note G_, 1 - note F#, 1 + B_ 1 + A_ 1 + G_ 1 + F# 1 notetype 12, 12, 3 - note G_, 4 - note F#, 4 - note E_, 4 - note D#, 4 + G_ 4 + F# 4 + E_ 4 + D# 4 notetype 12, 12, 2 callchannel Music_Dungeon1_branch_7dfc5 octave 3 - note B_, 3 + B_ 3 callchannel Music_Dungeon1_branch_7dfc5 - note C_, 3 + C_ 3 callchannel Music_Dungeon1_branch_7dfc5 - note C#, 3 + C# 3 notetype 12, 12, 3 octave 3 - note G_, 4 - note F#, 4 - note E_, 4 - note D#, 4 - note E_, 4 - note D#, 4 - note C_, 4 + G_ 4 + F# 4 + E_ 4 + D# 4 + E_ 4 + D# 4 + C_ 4 octave 2 - note B_, 4 + B_ 4 notetype 12, 12, 2 - note B_, 1 - note A#, 1 - note G_, 1 - note A#, 1 - note B_, 1 - note A#, 1 - note G_, 1 - note A#, 1 - octave 3 - note C_, 1 + B_ 1 + A# 1 + G_ 1 + A# 1 + B_ 1 + A# 1 + G_ 1 + A# 1 + octave 3 + C_ 1 octave 2 - note B_, 1 - note G#, 1 - note B_, 1 + B_ 1 + G# 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note G#, 1 - note B_, 1 + B_ 1 + G# 1 + B_ 1 octave 3 - note C#, 1 - note C_, 1 + C# 1 + C_ 1 octave 2 - note A_, 1 + A_ 1 octave 3 - note C_, 1 - note C#, 1 - note C_, 1 + C_ 1 + C# 1 + C_ 1 octave 2 - note A_, 1 + A_ 1 octave 3 - note C_, 1 - note D_, 1 - note C#, 1 + C_ 1 + D_ 1 + C# 1 octave 2 - note A#, 1 + A# 1 octave 3 - note C#, 1 - note D_, 1 - note C#, 1 + C# 1 + D_ 1 + C# 1 octave 2 - note A#, 1 + A# 1 octave 3 - note C#, 1 + C# 1 Music_Dungeon1_branch_7df6e:: rest 16 loopchannel 8, Music_Dungeon1_branch_7df6e notetype 12, 12, 3 callchannel Music_Dungeon1_branch_7dfbb - note B_, 2 - note G_, 2 + B_ 2 + G_ 2 octave 3 - note C#, 4 + C# 4 octave 2 - note G_, 2 - note A_, 4 - note F#, 2 + G_ 2 + A_ 4 + F# 2 callchannel Music_Dungeon1_branch_7dfbb - note A#, 2 - note G_, 2 - note B_, 4 - note G_, 2 - note F#, 2 - note G_, 2 - note D#, 2 + A# 2 + G_ 2 + B_ 4 + G_ 2 + F# 2 + G_ 2 + D# 2 notetype 12, 12, 2 callchannel Music_Dungeon1_branch_7dfc5 octave 3 - note B_, 3 + B_ 3 callchannel Music_Dungeon1_branch_7dfc5 - note C_, 3 + C_ 3 callchannel Music_Dungeon1_branch_7dfc5 - note C#, 3 + C# 3 notetype 12, 12, 7 octave 3 - note F#, 8 - note D#, 8 + F# 8 + D# 8 notetype 12, 12, 2 callchannel Music_Dungeon1_branch_7dfaa callchannel Music_Dungeon1_branch_7dfaa loopchannel 0, Music_Dungeon1_branch_7dee5 Music_Dungeon1_branch_7dfaa:: - note E_, 1 - note D#, 1 - note B_, 1 - note A#, 1 - note G_, 1 - note G#, 1 + E_ 1 + D# 1 + B_ 1 + A# 1 + G_ 1 + G# 1 rest 1 - note A#, 1 - note E_, 1 - note D#, 1 - note B_, 1 - note A#, 1 - note G_, 1 - note G#, 1 + A# 1 + E_ 1 + D# 1 + B_ 1 + A# 1 + G_ 1 + G# 1 rest 1 - note A#, 1 + A# 1 endchannel Music_Dungeon1_branch_7dfbb:: octave 2 - note G_, 2 - note A#, 4 - note G_, 2 + G_ 2 + A# 4 + G_ 2 octave 3 - note C#, 4 + C# 4 octave 2 - note G_, 2 - note A#, 2 + G_ 2 + A# 2 endchannel Music_Dungeon1_branch_7dfc5:: octave 3 - note E_, 1 - note E_, 1 - note F_, 1 - note E_, 1 - note G_, 1 - note E_, 1 - note A_, 1 - note E_, 1 - note A#, 1 - note E_, 1 - note B_, 1 - note E_, 1 + E_ 1 + E_ 1 + F_ 1 + E_ 1 + G_ 1 + E_ 1 + A_ 1 + E_ 1 + A# 1 + E_ 1 + B_ 1 + E_ 1 octave 4 - note C_, 1 + C_ 1 endchannel Music_Dungeon1_branch_7dfd5:: - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 rest 4 octave 1 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 1 endchannel @@ -231,10 +231,10 @@ Music_Dungeon1_Ch2:: ; 7dfde (1f:5fde) duty 3 notetype 12, 0, 15 octave 4 - note G#, 8 + G# 8 notetype 12, 4, 13 octave 5 - note D_, 8 + D_ 8 Music_Dungeon1_branch_7dfeb:: notetype 12, 12, 2 @@ -243,23 +243,23 @@ Music_Dungeon1_branch_7dfed:: callchannel Music_Dungeon1_branch_7e097 loopchannel 3, Music_Dungeon1_branch_7dfed octave 2 - note E_, 1 - note E_, 1 - note B_, 1 + E_ 1 + E_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 rest 2 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note E_, 1 - note E_, 1 - note A_, 1 - note G_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note D#, 1 + B_ 1 + E_ 1 + E_ 1 + A_ 1 + G_ 1 + F_ 1 + F# 1 + G_ 1 + D# 1 Music_Dungeon1_branch_7e006:: callchannel Music_Dungeon1_branch_7e097 @@ -267,52 +267,52 @@ Music_Dungeon1_branch_7e006:: rest 2 callchannel Music_Dungeon1_branch_7e0ab octave 3 - note C_, 4 + C_ 4 callchannel Music_Dungeon1_branch_7e0ab octave 3 - note C#, 4 + C# 4 callchannel Music_Dungeon1_branch_7e0ab octave 3 - note D#, 4 + D# 4 notetype 12, 13, 3 octave 4 - note E_, 4 - note D#, 4 - note C_, 4 + E_ 4 + D# 4 + C_ 4 octave 3 - note B_, 4 + B_ 4 notetype 12, 13, 2 callchannel Music_Dungeon1_branch_7e0b5 octave 3 - note F#, 4 + F# 4 callchannel Music_Dungeon1_branch_7e0b5 octave 3 - note G_, 4 + G_ 4 callchannel Music_Dungeon1_branch_7e0b5 octave 3 - note A#, 4 + A# 4 notetype 12, 13, 3 octave 4 - note E_, 4 - note D#, 4 - note C_, 4 + E_ 4 + D# 4 + C_ 4 octave 3 - note B_, 4 + B_ 4 octave 4 - note C_, 4 + C_ 4 octave 3 - note B_, 4 - note G_, 4 - note F#, 2 + B_ 4 + G_ 4 + F# 2 notetype 12, 13, 6 - note E_, 8 - note F_, 8 - note F#, 8 - note G_, 8 + E_ 8 + F_ 8 + F# 8 + G_ 8 notetype 12, 13, 2 callchannel Music_Dungeon1_branch_7e0ba rest 10 - note E_, 1 + E_ 1 rest 1 callchannel Music_Dungeon1_branch_7e0ba rest 12 @@ -322,38 +322,38 @@ Music_Dungeon1_branch_7e006:: rest 14 notetype 12, 13, 3 callchannel Music_Dungeon1_branch_7e0cd - note D#, 4 + D# 4 callchannel Music_Dungeon1_branch_7e0cd - note D#, 2 + D# 2 rest 2 notetype 12, 13, 2 callchannel Music_Dungeon1_branch_7e0c0 rest 2 octave 3 - note F#, 4 + F# 4 octave 2 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note C_, 1 + C_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note D_, 1 - note C#, 1 + D_ 1 + C# 1 rest 2 octave 3 - note G_, 4 + G_ 4 callchannel Music_Dungeon1_branch_7e0c0 octave 3 - note A#, 4 + A# 4 notetype 12, 13, 6 - note B_, 8 + B_ 8 octave 4 - note D#, 8 + D# 8 notetype 12, 13, 2 callchannel Music_Dungeon1_branch_7e097 callchannel Music_Dungeon1_branch_7e097 @@ -361,83 +361,83 @@ Music_Dungeon1_branch_7e006:: Music_Dungeon1_branch_7e097:: octave 2 - note E_, 1 - note E_, 1 - note B_, 1 + E_ 1 + E_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 rest 2 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note E_, 1 - note E_, 1 - note B_, 1 + B_ 1 + E_ 1 + E_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 rest 2 - note C_, 1 + C_ 1 octave 2 - note B_, 1 + B_ 1 endchannel Music_Dungeon1_branch_7e0ab:: octave 2 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 rest 2 octave 1 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 3 endchannel Music_Dungeon1_branch_7e0b5:: octave 2 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 rest 10 endchannel Music_Dungeon1_branch_7e0ba:: octave 1 - note E_, 1 - note G_, 1 - note E_, 1 - note D#, 1 + E_ 1 + G_ 1 + E_ 1 + D# 1 endchannel Music_Dungeon1_branch_7e0c0:: octave 2 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 octave 4 - note E_, 1 + E_ 1 rest 1 - note D#, 1 + D# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note C#, 1 - note C_, 1 + C# 1 + C_ 1 endchannel Music_Dungeon1_branch_7e0cd:: octave 3 - note E_, 6 - note G_, 6 - note E_, 4 - note A_, 6 + E_ 6 + G_ 6 + E_ 4 + A_ 6 octave 4 - note C_, 6 - octave 3 - note B_, 4 - note G_, 6 - note A#, 6 - note F#, 4 - note E_, 6 - note F#, 6 + C_ 6 + octave 3 + B_ 4 + G_ 6 + A# 6 + F# 4 + E_ 6 + F# 6 endchannel @@ -446,49 +446,49 @@ Music_Dungeon1_Ch3:: ; 7e0dc (1f:60dc) vibrato 8, 2, 6 rest 14 octave 4 - note D_, 1 - note D#, 1 + D_ 1 + D# 1 Music_Dungeon1_branch_7e0e5:: callchannel Music_Dungeon1_branch_7e140 callchannel Music_Dungeon1_branch_7e140 octave 5 - note E_, 2 + E_ 2 rest 4 octave 3 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 1 octave 4 - note F#, 4 + F# 4 callchannel Music_Dungeon1_branch_7e154 octave 4 - note G_, 4 + G_ 4 callchannel Music_Dungeon1_branch_7e154 octave 4 - note A_, 4 - note B_, 4 - note A#, 4 - note G_, 4 - note F#, 4 + A_ 4 + B_ 4 + A# 4 + G_ 4 + F# 4 rest 6 callchannel Music_Dungeon1_branch_7e177 - note B_, 4 - note A#, 4 - note G_, 4 - note F#, 4 - note G_, 4 - note F#, 4 - note E_, 4 - note D#, 4 + B_ 4 + A# 4 + G_ 4 + F# 4 + G_ 4 + F# 4 + E_ 4 + D# 4 callchannel Music_Dungeon1_branch_7e15e rest 12 callchannel Music_Dungeon1_branch_7e15e rest 12 callchannel Music_Dungeon1_branch_7e15e rest 10 - note E_, 1 + E_ 1 rest 1 callchannel Music_Dungeon1_branch_7e15e rest 12 @@ -496,128 +496,128 @@ Music_Dungeon1_branch_7e0e5:: rest 12 callchannel Music_Dungeon1_branch_7e15e rest 10 - note D_, 1 - note D#, 1 + D_ 1 + D# 1 callchannel Music_Dungeon1_branch_7e164 callchannel Music_Dungeon1_branch_7e164 - note E_, 2 + E_ 2 rest 4 callchannel Music_Dungeon1_branch_7e177 - note B_, 8 - note F#, 6 - note D_, 1 - note D#, 1 + B_ 8 + F# 6 + D_ 1 + D# 1 rest 16 rest 16 loopchannel 0, Music_Dungeon1_branch_7e0e5 Music_Dungeon1_branch_7e140:: octave 5 - note E_, 4 - note B_, 4 - note A#, 4 + E_ 4 + B_ 4 + A# 4 octave 6 - note D_, 4 - note C#, 4 + D_ 4 + C# 4 octave 5 - note G#, 4 - note G_, 4 - note B_, 4 - note A#, 4 - note E_, 4 - note D#, 4 - note A_, 4 - note G#, 4 - note E_, 4 - note F#, 4 - note D#, 4 + G# 4 + G_ 4 + B_ 4 + A# 4 + E_ 4 + D# 4 + A_ 4 + G# 4 + E_ 4 + F# 4 + D# 4 endchannel Music_Dungeon1_branch_7e154:: octave 6 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 rest 4 octave 3 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 1 endchannel Music_Dungeon1_branch_7e15e:: octave 3 - note E_, 1 - note G_, 1 - note E_, 1 - note D#, 1 + E_ 1 + G_ 1 + E_ 1 + D# 1 endchannel Music_Dungeon1_branch_7e164:: - note E_, 4 - note B_, 4 - note A#, 4 + E_ 4 + B_ 4 + A# 4 octave 4 - note D_, 4 - note C#, 4 - octave 3 - note G#, 4 - note G_, 4 - note B_, 4 - note A#, 4 - note E_, 4 - note D#, 4 - note A_, 4 - note G#, 4 - note E_, 4 - note F#, 4 - note D#, 4 + D_ 4 + C# 4 + octave 3 + G# 4 + G_ 4 + B_ 4 + A# 4 + E_ 4 + D# 4 + A_ 4 + G# 4 + E_ 4 + F# 4 + D# 4 endchannel Music_Dungeon1_branch_7e177:: octave 4 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 1 - note F#, 4 + F# 4 rest 6 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 1 - note G_, 4 + G_ 4 rest 6 - note E_, 1 + E_ 1 rest 3 - note E_, 1 - note E_, 1 - note A#, 4 + E_ 1 + E_ 1 + A# 4 endchannel Music_Dungeon1_Ch4:: ; 7e18a (1f:618a) dspeed 12 rest 14 - dnote 1, cymbal1 - dnote 1, cymbal1 + cymbal1 1 + cymbal1 1 Music_Dungeon1_branch_7e190:: callchannel Music_Dungeon1_branch_7e1f1 loopchannel 3, Music_Dungeon1_branch_7e190 - dnote 4, cymbal2 - dnote 4, cymbal1 - dnote 4, cymbal2 - dnote 2, cymbal1 - dnote 2, cymbal1 + cymbal2 4 + cymbal1 4 + cymbal2 4 + cymbal1 2 + cymbal1 2 Music_Dungeon1_branch_7e1a1:: callchannel Music_Dungeon1_branch_7e1f1 loopchannel 3, Music_Dungeon1_branch_7e1a1 - dnote 4, cymbal2 - dnote 4, cymbal1 - dnote 4, cymbal2 - dnote 4, cymbal2 + cymbal2 4 + cymbal1 4 + cymbal2 4 + cymbal2 4 Music_Dungeon1_branch_7e1b0:: callchannel Music_Dungeon1_branch_7e1fa @@ -628,12 +628,12 @@ Music_Dungeon1_branch_7e1ba:: callchannel Music_Dungeon1_branch_7e1fa loopchannel 3, Music_Dungeon1_branch_7e1ba callchannel Music_Dungeon1_branch_7e202 - dnote 4, snare7 - dnote 4, snare8 - dnote 4, snare8 + snare7 4 + snare8 4 + snare8 4 rest 2 - dnote 2, snare7 - dnote 4, cymbal2 + snare7 2 + cymbal2 4 Music_Dungeon1_branch_7e1cf:: rest 16 @@ -643,34 +643,34 @@ Music_Dungeon1_branch_7e1cf:: Music_Dungeon1_branch_7e1d5:: callchannel Music_Dungeon1_branch_7e1fa loopchannel 3, Music_Dungeon1_branch_7e1d5 - dnote 4, cymbal1 - dnote 4, cymbal1 - dnote 4, cymbal1 + cymbal1 4 + cymbal1 4 + cymbal1 4 rest 2 - dnote 1, cymbal1 - dnote 1, cymbal1 + cymbal1 1 + cymbal1 1 callchannel Music_Dungeon1_branch_7e1f1 callchannel Music_Dungeon1_branch_7e1f1 loopchannel 0, Music_Dungeon1_branch_7e190 Music_Dungeon1_branch_7e1f1:: - dnote 4, cymbal2 - dnote 4, cymbal1 - dnote 4, cymbal2 - dnote 4, cymbal1 + cymbal2 4 + cymbal1 4 + cymbal2 4 + cymbal1 4 endchannel Music_Dungeon1_branch_7e1fa:: - dnote 1, cymbal1 - dnote 1, cymbal1 + cymbal1 1 + cymbal1 1 rest 10 - dnote 4, cymbal3 + cymbal3 4 endchannel Music_Dungeon1_branch_7e202:: - dnote 4, snare7 - dnote 4, snare8 - dnote 4, snare8 - dnote 4, snare9 + snare7 4 + snare8 4 + snare8 4 + snare9 4 endchannel -; 0x7e20b
\ No newline at end of file +; 0x7e20b diff --git a/audio/music/dungeon2.asm b/audio/music/dungeon2.asm index 028d6785..e65de5be 100644 --- a/audio/music/dungeon2.asm +++ b/audio/music/dungeon2.asm @@ -1,64 +1,64 @@ Music_Dungeon2_Ch1:: ; 7e887 (1f:6887) - tempo 0, 144 - stereopanning 119 + tempo 144 + volume 7, 7 duty 3 - togglecall + toggleperfectpitch vibrato 10, 1, 4 Music_Dungeon2_branch_7e892:: notetype 12, 11, 2 octave 4 - note E_, 4 - note E_, 4 - note E_, 4 - note E_, 4 - note A#, 4 - note A#, 4 - note A#, 4 - note A#, 4 - note E_, 4 - note E_, 4 - note E_, 4 - note E_, 4 + E_ 4 + E_ 4 + E_ 4 + E_ 4 + A# 4 + A# 4 + A# 4 + A# 4 + E_ 4 + E_ 4 + E_ 4 + E_ 4 octave 5 - note C#, 4 - note C#, 4 - note C#, 4 - note C#, 4 + C# 4 + C# 4 + C# 4 + C# 4 octave 3 - note E_, 4 - note E_, 4 - note E_, 4 - note E_, 4 - note A#, 4 - note A#, 4 - note A#, 4 - note A#, 4 + E_ 4 + E_ 4 + E_ 4 + E_ 4 + A# 4 + A# 4 + A# 4 + A# 4 octave 2 - note G_, 2 - note A#, 4 - note G_, 2 + G_ 2 + A# 4 + G_ 2 octave 3 - note C#, 4 + C# 4 octave 2 - note G_, 2 - note A#, 2 - note B_, 2 - note G_, 2 + G_ 2 + A# 2 + B_ 2 + G_ 2 octave 3 - note C#, 4 + C# 4 octave 2 - note G_, 2 - note A_, 4 - note F#, 2 + G_ 2 + A_ 4 + F# 2 loopchannel 2, Music_Dungeon2_branch_7e892 notetype 12, 1, 15 octave 3 - note E_, 16 - note C_, 16 - note D_, 16 + E_ 16 + C_ 16 + D_ 16 octave 2 - note A#, 16 + A# 16 rest 16 rest 16 rest 16 @@ -77,77 +77,77 @@ Music_Dungeon2_branch_7e8db:: duty 3 notetype 12, 12, 2 octave 3 - note E_, 4 - note E_, 4 - note E_, 4 - note E_, 4 - note C_, 4 - note C_, 4 - note C_, 4 - note C_, 4 - note E_, 4 - note E_, 4 - note E_, 4 - note E_, 4 - note C_, 4 - note C_, 4 - note C_, 4 - note C_, 4 - note B_, 4 - note B_, 4 - note B_, 4 - note B_, 4 + E_ 4 + E_ 4 + E_ 4 + E_ 4 + C_ 4 + C_ 4 + C_ 4 + C_ 4 + E_ 4 + E_ 4 + E_ 4 + E_ 4 + C_ 4 + C_ 4 + C_ 4 + C_ 4 + B_ 4 + B_ 4 + B_ 4 + B_ 4 octave 4 - note F#, 4 - note F#, 4 - note F#, 4 - note F#, 4 - note D_, 4 - note D_, 4 - note D_, 4 - note D_, 4 - note G_, 4 - note G_, 4 - note G_, 4 - note F#, 4 + F# 4 + F# 4 + F# 4 + F# 4 + D_ 4 + D_ 4 + D_ 4 + D_ 4 + G_ 4 + G_ 4 + G_ 4 + F# 4 loopchannel 2, Music_Dungeon2_branch_7e8db octave 3 - note E_, 2 - note G_, 2 - note E_, 2 - note D#, 2 - note E_, 2 - note E_, 2 + E_ 2 + G_ 2 + E_ 2 + D# 2 + E_ 2 + E_ 2 octave 5 - note E_, 2 + E_ 2 rest 2 - note D#, 2 + D# 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note C#, 2 - note C_, 2 + C# 2 + C_ 2 octave 4 - note E_, 2 - note G_, 2 + E_ 2 + G_ 2 octave 3 - note A#, 2 - note C#, 2 - note A#, 2 - note A_, 2 - note A#, 2 - note G_, 2 + A# 2 + C# 2 + A# 2 + A_ 2 + A# 2 + G_ 2 octave 5 - note G_, 2 + G_ 2 rest 2 - note F#, 2 + F# 2 rest 2 - note F_, 2 + F_ 2 rest 2 - note E_, 2 - note D#, 2 - note D_, 2 - note C#, 2 + E_ 2 + D# 2 + D_ 2 + C# 2 rest 16 rest 16 rest 16 @@ -155,10 +155,10 @@ Music_Dungeon2_branch_7e8db:: notetype 12, 12, 7 duty 1 octave 4 - note E_, 16 - note D_, 16 - note C_, 16 - note D_, 16 + E_ 16 + D_ 16 + C_ 16 + D_ 16 loopchannel 0, Music_Dungeon2_branch_7e8db @@ -169,92 +169,92 @@ Music_Dungeon2_Ch3:: ; 7e93b (1f:693b) Music_Dungeon2_branch_7e940:: callchannel Music_Dungeon2_branch_7e9d1 loopchannel 16, Music_Dungeon2_branch_7e940 - note E_, 4 + E_ 4 rest 4 rest 4 - note E_, 4 - note C_, 4 + E_ 4 + C_ 4 rest 4 rest 4 - note C_, 4 - note D_, 4 + C_ 4 + D_ 4 rest 4 rest 4 - note D_, 4 + D_ 4 octave 3 - note A#, 4 + A# 4 rest 4 rest 4 - note A#, 4 + A# 4 Music_Dungeon2_branch_7e958:: octave 5 - note E_, 2 + E_ 2 rest 2 - note B_, 2 + B_ 2 rest 2 - note A#, 2 + A# 2 rest 2 octave 6 - note D_, 2 + D_ 2 rest 2 - note C#, 2 + C# 2 rest 2 octave 5 - note G#, 2 + G# 2 rest 2 - note G_, 2 + G_ 2 rest 2 - note B_, 2 + B_ 2 rest 2 - note A#, 2 + A# 2 rest 2 - note E_, 2 + E_ 2 rest 2 - note D#, 2 + D# 2 rest 2 - note A_, 2 + A_ 2 rest 2 - note G#, 2 + G# 2 rest 2 - note E_, 2 + E_ 2 rest 2 - note F#, 2 + F# 2 rest 2 - note D#, 2 + D# 2 rest 2 loopchannel 3, Music_Dungeon2_branch_7e958 octave 4 - note E_, 4 - note B_, 4 - note A#, 4 + E_ 4 + B_ 4 + A# 4 octave 5 - note D_, 4 - note C#, 4 + D_ 4 + C# 4 octave 4 - note G#, 4 - note G_, 4 - note B_, 4 - note A#, 4 - note E_, 4 - note D#, 4 - note A_, 4 - note G#, 4 - note E_, 4 - note F#, 4 - note D#, 4 + G# 4 + G_ 4 + B_ 4 + A# 4 + E_ 4 + D# 4 + A_ 4 + G# 4 + E_ 4 + F# 4 + D# 4 octave 3 - note E_, 16 - note C_, 16 - note D_, 16 + E_ 16 + C_ 16 + D_ 16 octave 2 - note A#, 16 + A# 16 octave 3 - note E_, 16 - note F_, 16 - note G_, 16 + E_ 16 + F_ 16 + G_ 16 octave 3 - note B_, 16 + B_ 16 rest 16 rest 16 rest 16 @@ -269,36 +269,36 @@ Music_Dungeon2_branch_7e958:: callchannel Music_Dungeon2_branch_7e9d1 loopchannel 0, Music_Dungeon2_branch_7e940 octave 2 - note G_, 2 - note A#, 4 - note G_, 2 + G_ 2 + A# 4 + G_ 2 octave 3 - note C#, 4 + C# 4 octave 2 - note G_, 2 - note A_, 2 - note A#, 2 - note G_, 2 + G_ 2 + A_ 2 + A# 2 + G_ 2 octave 3 - note C#, 4 + C# 4 octave 2 - note G_, 2 - note A#, 2 - note G_, 2 + G_ 2 + A# 2 + G_ 2 rest 2 endchannel Music_Dungeon2_branch_7e9d1:: octave 4 - note E_, 2 + E_ 2 rest 4 octave 3 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 1 octave 4 - note F#, 4 + F# 4 endchannel @@ -306,13 +306,13 @@ Music_Dungeon2_Ch4:: ; 7e9dc (1f:69dc) dspeed 12 Music_Dungeon2_branch_7e9dd:: - dnote 4, cymbal1 - dnote 4, cymbal2 - dnote 4, cymbal1 - dnote 4, snare8 - dnote 4, cymbal1 - dnote 4, cymbal2 - dnote 4, snare9 - dnote 4, snare7 + cymbal1 4 + cymbal2 4 + cymbal1 4 + snare8 4 + cymbal1 4 + cymbal2 4 + snare9 4 + snare7 4 loopchannel 0, Music_Dungeon2_branch_7e9dd -; 0x7e9f1
\ No newline at end of file +; 0x7e9f1 diff --git a/audio/music/dungeon3.asm b/audio/music/dungeon3.asm index dd4acc4c..1bfdb682 100644 --- a/audio/music/dungeon3.asm +++ b/audio/music/dungeon3.asm @@ -1,8 +1,8 @@ Music_Dungeon3_Ch1:: ; 7e9f1 (1f:69f1) - tempo 0, 160 - stereopanning 119 + tempo 160 + volume 7, 7 duty 3 - togglecall + toggleperfectpitch vibrato 8, 1, 4 Music_Dungeon3_branch_7e9fc:: @@ -12,17 +12,17 @@ Music_Dungeon3_branch_7e9fe:: callchannel Music_Dungeon3_branch_7eab2 loopchannel 3, Music_Dungeon3_branch_7e9fe octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 2 - note G_, 2 + D# 2 + G_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 2 - note G_, 2 - note D#, 2 - note E_, 2 + D# 2 + G_ 2 + D# 2 + E_ 2 Music_Dungeon3_branch_7ea11:: callchannel Music_Dungeon3_branch_7eac1 @@ -32,32 +32,32 @@ Music_Dungeon3_branch_7ea18:: callchannel Music_Dungeon3_branch_7eab2 loopchannel 4, Music_Dungeon3_branch_7ea18 octave 4 - note F_, 2 - note F_, 2 + F_ 2 + F_ 2 rest 2 - note F_, 2 - note E_, 2 - note E_, 2 - note D#, 2 - note D#, 2 + F_ 2 + E_ 2 + E_ 2 + D# 2 + D# 2 rest 2 - note D#, 2 - note D_, 2 - note D_, 2 + D# 2 + D_ 2 + D_ 2 callchannel Music_Dungeon3_branch_7eafc octave 4 - note D_, 2 - note D_, 2 + D_ 2 + D_ 2 rest 2 - note D_, 2 - note D#, 2 - note D#, 2 - note E_, 2 - note E_, 2 + D_ 2 + D# 2 + D# 2 + E_ 2 + E_ 2 rest 2 - note E_, 2 - note F_, 2 - note F_, 2 + E_ 2 + F_ 2 + F_ 2 Music_Dungeon3_branch_7ea3c:: callchannel Music_Dungeon3_branch_7eace @@ -67,271 +67,271 @@ Music_Dungeon3_branch_7ea43:: callchannel Music_Dungeon3_branch_7eadd loopchannel 3, Music_Dungeon3_branch_7ea43 octave 3 - note C#, 2 + C# 2 octave 2 - note A_, 2 - note F_, 2 + A_ 2 + F_ 2 octave 3 - note C#, 2 + C# 2 octave 2 - note A_, 2 - note F_, 2 + A_ 2 + F_ 2 octave 3 - note A_, 2 - note F_, 2 + A_ 2 + F_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note A_, 2 - note F_, 2 + A_ 2 + F_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note A_, 2 - note F_, 2 - note A_, 2 - note F_, 2 + A_ 2 + F_ 2 + A_ 2 + F_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note A_, 2 - note F_, 2 + A_ 2 + F_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note A_, 2 - note F_, 2 + A_ 2 + F_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note A_, 2 - note F_, 2 + A_ 2 + F_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note A_, 2 - note F_, 2 + A_ 2 + F_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note A_, 2 - note F_, 2 + A_ 2 + F_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note A_, 2 - note F_, 2 - note G#, 2 - note E_, 2 + A_ 2 + F_ 2 + G# 2 + E_ 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note G#, 2 - note E_, 2 + G# 2 + E_ 2 octave 4 - note C_, 2 + C_ 2 callchannel Music_Dungeon3_branch_7eaea callchannel Music_Dungeon3_branch_7eaea octave 3 - note G#, 2 - note E_, 2 + G# 2 + E_ 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note G#, 2 - note E_, 2 + G# 2 + E_ 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note G#, 2 - note E_, 2 + G# 2 + E_ 2 rest 16 rest 8 callchannel Music_Dungeon3_branch_7eaf7 callchannel Music_Dungeon3_branch_7eaf7 callchannel Music_Dungeon3_branch_7eaf7 callchannel Music_Dungeon3_branch_7eaf7 - note D#, 2 + D# 2 rest 16 rest 16 loopchannel 0, Music_Dungeon3_branch_7e9fc Music_Dungeon3_branch_7eab2:: octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 2 - note G_, 2 + D# 2 + G_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 2 - note G_, 2 + D# 2 + G_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 2 + D# 2 endchannel Music_Dungeon3_branch_7eac1:: - note E_, 2 - note G#, 2 + E_ 2 + G# 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note E_, 2 - note G#, 2 + E_ 2 + G# 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note E_, 2 - note G#, 2 + E_ 2 + G# 2 endchannel Music_Dungeon3_branch_7eace:: octave 3 - note D#, 2 + D# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note G_, 2 - note D#, 2 + G_ 2 + D# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note G_, 2 - note D#, 2 + G_ 2 + D# 2 octave 2 - note B_, 2 + B_ 2 endchannel Music_Dungeon3_branch_7eadd:: - note A_, 2 - note F_, 2 + A_ 2 + F_ 2 octave 3 - note C#, 2 + C# 2 octave 2 - note A_, 2 - note F_, 2 + A_ 2 + F_ 2 octave 3 - note C#, 2 + C# 2 octave 2 - note A_, 2 - note F_, 2 + A_ 2 + F_ 2 endchannel Music_Dungeon3_branch_7eaea:: octave 3 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 + G# 2 + E_ 2 + G# 2 + E_ 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note G#, 2 - note E_, 2 + G# 2 + E_ 2 octave 4 - note C_, 2 + C_ 2 endchannel Music_Dungeon3_branch_7eaf7:: - note D#, 2 - note G_, 2 - note D#, 2 - note C#, 6 + D# 2 + G_ 2 + D# 2 + C# 6 endchannel Music_Dungeon3_branch_7eafc:: - tempo 0, 168 + tempo 168 octave 1 - note A#, 1 - note B_, 1 + A# 1 + B_ 1 octave 2 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - tempo 0, 176 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + tempo 176 octave 1 - note A#, 1 - note B_, 1 + A# 1 + B_ 1 octave 2 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - tempo 0, 184 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + tempo 184 octave 1 - note A#, 1 - note B_, 1 + A# 1 + B_ 1 octave 2 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - tempo 0, 192 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + tempo 192 octave 1 - note A_, 1 - note A#, 1 - note B_, 1 + A_ 1 + A# 1 + B_ 1 octave 2 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - tempo 0, 200 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + tempo 200 octave 1 - note G#, 1 - note A_, 1 - note A#, 1 - note B_, 1 + G# 1 + A_ 1 + A# 1 + B_ 1 octave 2 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - tempo 0, 208 + C_ 1 + C# 1 + D_ 1 + D# 1 + tempo 208 octave 1 - note G_, 1 - note G#, 1 - note A_, 1 - note A#, 1 - note B_, 1 + G_ 1 + G# 1 + A_ 1 + A# 1 + B_ 1 octave 2 - note C_, 1 - note C#, 1 - note D_, 1 - tempo 0, 216 + C_ 1 + C# 1 + D_ 1 + tempo 216 octave 1 - note F#, 1 - note G_, 1 - note G#, 1 - note A_, 1 - note A#, 1 - note B_, 1 + F# 1 + G_ 1 + G# 1 + A_ 1 + A# 1 + B_ 1 octave 2 - note C_, 1 - note C#, 1 - tempo 0, 224 + C_ 1 + C# 1 + tempo 224 octave 1 - note F_, 1 - note F#, 1 - note G_, 1 - note G#, 1 - note A_, 1 - note A#, 1 - note B_, 1 + F_ 1 + F# 1 + G_ 1 + G# 1 + A_ 1 + A# 1 + B_ 1 octave 2 - note C_, 1 - tempo 0, 160 + C_ 1 + tempo 160 endchannel @@ -342,91 +342,91 @@ Music_Dungeon3_Ch2:: ; 7eb68 (1f:6b68) Music_Dungeon3_branch_7eb6d:: notetype 12, 13, 3 octave 4 - note D#, 6 - note C#, 6 + D# 6 + C# 6 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D#, 2 - note G_, 2 - note D#, 2 - note C#, 6 + C# 2 + D# 2 + G_ 2 + D# 2 + C# 6 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D#, 2 - note G_, 2 - note D#, 2 - note C#, 6 + C# 2 + D# 2 + G_ 2 + D# 2 + C# 6 octave 3 - note B_, 2 - note A#, 2 - note B_, 6 + B_ 2 + A# 2 + B_ 6 octave 4 - note C#, 8 + C# 8 rest 2 - note G#, 6 - note F#, 6 - note E_, 2 - note F#, 2 - note G#, 2 + G# 6 + F# 6 + E_ 2 + F# 2 + G# 2 octave 5 - note C_, 2 + C_ 2 octave 4 - note G#, 2 - note F#, 6 - note E_, 2 - note F#, 2 - note G#, 2 + G# 2 + F# 6 + E_ 2 + F# 2 + G# 2 octave 5 - note C_, 2 - octave 4 - note G#, 2 - note F#, 6 - note E_, 2 - note D#, 2 - note E_, 6 - note F#, 6 - note E_, 4 - note D#, 6 - note C#, 6 - octave 3 - note B_, 2 - octave 4 - note C#, 2 - note D#, 2 - note G_, 2 - note D#, 2 - note C#, 6 - octave 3 - note B_, 2 - octave 4 - note C#, 2 - note D#, 2 - note G_, 2 - note D#, 2 - note C#, 6 - octave 3 - note B_, 2 - note A#, 2 - note B_, 6 - octave 4 - note C#, 8 + C_ 2 + octave 4 + G# 2 + F# 6 + E_ 2 + D# 2 + E_ 6 + F# 6 + E_ 4 + D# 6 + C# 6 + octave 3 + B_ 2 + octave 4 + C# 2 + D# 2 + G_ 2 + D# 2 + C# 6 + octave 3 + B_ 2 + octave 4 + C# 2 + D# 2 + G_ 2 + D# 2 + C# 6 + octave 3 + B_ 2 + A# 2 + B_ 6 + octave 4 + C# 8 rest 2 - note G#, 2 - note G#, 2 + G# 2 + G# 2 rest 2 - note G#, 2 - note A_, 2 - note A_, 2 - note A#, 2 - note A#, 2 + G# 2 + A_ 2 + A_ 2 + A# 2 + A# 2 rest 2 - note A#, 2 - note B_, 2 - note B_, 2 + A# 2 + B_ 2 + B_ 2 rest 8 rest 8 rest 8 @@ -436,174 +436,174 @@ Music_Dungeon3_branch_7eb6d:: rest 8 rest 8 octave 4 - note B_, 2 - note B_, 2 + B_ 2 + B_ 2 rest 2 - note B_, 2 - note A#, 2 - note A#, 2 - note A_, 2 - note A_, 2 + B_ 2 + A# 2 + A# 2 + A_ 2 + A_ 2 rest 2 - note A_, 2 - note G#, 2 - note G#, 2 - note C#, 8 + A_ 2 + G# 2 + G# 2 + C# 8 rest 2 octave 3 - note B_, 6 - note A#, 2 - note B_, 2 + B_ 6 + A# 2 + B_ 2 octave 4 - note D#, 2 - note G_, 2 - note D#, 2 - note C#, 6 + D# 2 + G_ 2 + D# 2 + C# 6 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D#, 2 - note G_, 2 - note D#, 2 - note C#, 6 + C# 2 + D# 2 + G_ 2 + D# 2 + C# 6 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D#, 6 - note G_, 6 + C# 2 + D# 6 + G_ 6 octave 3 - note G_, 8 + G_ 8 rest 2 - note F_, 6 - note E_, 2 - note F_, 2 - note A_, 2 + F_ 6 + E_ 2 + F_ 2 + A_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note A_, 2 - note G_, 6 - note F_, 2 - note G_, 2 - note A_, 2 + A_ 2 + G_ 6 + F_ 2 + G_ 2 + A_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note A_, 2 - note G_, 6 - note A_, 6 + A_ 2 + G_ 6 + A_ 6 octave 4 - note C#, 6 - note G_, 8 + C# 6 + G_ 8 rest 2 - note F_, 6 - note E_, 2 - note F_, 2 - note A_, 2 + F_ 6 + E_ 2 + F_ 2 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note A_, 2 - note G_, 6 - note A_, 2 + A_ 2 + G_ 6 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note A_, 2 - note G_, 6 - note A_, 6 + A_ 2 + G_ 6 + A_ 6 octave 5 - note C#, 6 + C# 6 octave 4 - note F#, 8 + F# 8 rest 2 - note E_, 6 - note D#, 2 - note E_, 2 - note G#, 2 + E_ 6 + D# 2 + E_ 2 + G# 2 octave 5 - note C_, 2 + C_ 2 octave 4 - note G#, 2 - note F#, 6 - note E_, 2 - note F#, 2 - note G#, 2 + G# 2 + F# 6 + E_ 2 + F# 2 + G# 2 octave 5 - note C_, 2 + C_ 2 octave 4 - note G#, 2 - note F#, 6 - note G#, 6 + G# 2 + F# 6 + G# 6 octave 5 - note C_, 6 - octave 3 - note D#, 2 - note G_, 2 - note D#, 2 - note C#, 6 - note D#, 2 - note G_, 2 - note D#, 2 - note C#, 6 + C_ 6 + octave 3 + D# 2 + G_ 2 + D# 2 + C# 6 + D# 2 + G_ 2 + D# 2 + C# 6 octave 2 - note E_, 2 - note G#, 2 - octave 3 - note C_, 2 - note E_, 2 - note G#, 2 - octave 4 - note C_, 2 - note E_, 2 - note G#, 2 - note C_, 2 - note E_, 2 - note G#, 2 - note C_, 2 - note E_, 2 - note G#, 2 - note C_, 2 - note E_, 2 - note G#, 2 - note C_, 2 - note E_, 2 - note G#, 2 - note C_, 2 - note E_, 2 - note G#, 2 - note C_, 2 - note D#, 2 + E_ 2 + G# 2 + octave 3 + C_ 2 + E_ 2 + G# 2 + octave 4 + C_ 2 + E_ 2 + G# 2 + C_ 2 + E_ 2 + G# 2 + C_ 2 + E_ 2 + G# 2 + C_ 2 + E_ 2 + G# 2 + C_ 2 + E_ 2 + G# 2 + C_ 2 + E_ 2 + G# 2 + C_ 2 + D# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 2 - note G_, 2 + D# 2 + G_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 2 - note G_, 2 + D# 2 + G_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 2 + D# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 2 - note G_, 2 + D# 2 + G_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 2 - note G_, 2 + D# 2 + G_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D#, 2 + D# 2 loopchannel 0, Music_Dungeon3_branch_7eb6d @@ -623,66 +623,66 @@ Music_Dungeon3_Ch3:: ; 7ec7a (1f:6c7a) rest 12 notetype 6, 1, 0 octave 3 - note B_, 1 + B_ 1 octave 4 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 rest 2 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 rest 16 rest 16 rest 10 octave 5 - note E_, 8 + E_ 8 octave 4 - note B_, 8 + B_ 8 octave 5 - note D#, 8 + D# 8 octave 4 - note A#, 8 + A# 8 octave 5 - note D_, 8 + D_ 8 octave 4 - note A_, 8 + A_ 8 octave 5 - note C#, 8 + C# 8 octave 4 - note G#, 8 + G# 8 octave 5 - note C_, 8 + C_ 8 octave 4 - note G_, 8 - note B_, 8 - note F#, 8 - note A#, 8 - note F_, 8 - note A_, 8 - note E_, 8 + G_ 8 + B_ 8 + F# 8 + A# 8 + F_ 8 + A_ 8 + E_ 8 rest 16 rest 16 rest 8 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note C_, 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + C_ 1 rest 2 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note C_, 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + C_ 1 octave 3 - note B_, 1 + B_ 1 rest 10 rest 16 notetype 12, 1, 0 @@ -754,4 +754,4 @@ Music_Dungeon3_Ch4:: ; 7ece4 (1f:6ce4) rest 16 rest 10 endchannel -; 0x7ed0f
\ No newline at end of file +; 0x7ed0f diff --git a/audio/music/finalbattle.asm b/audio/music/finalbattle.asm index c0b7e144..eabc06ec 100644 --- a/audio/music/finalbattle.asm +++ b/audio/music/finalbattle.asm @@ -1,383 +1,383 @@ Music_FinalBattle_Ch1:: ; 233a6 (8:73a6) - tempo 0, 112 - stereopanning 119 + tempo 112 + volume 7, 7 duty 3 vibrato 6, 3, 4 - togglecall + toggleperfectpitch notetype 12, 11, 2 octave 3 - note F#, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note F#, 1 - note G_, 1 - note G#, 1 - note G_, 1 + F# 1 + F_ 1 + F# 1 + G_ 1 + F# 1 + G_ 1 + G# 1 + G_ 1 notetype 12, 10, 2 - note G#, 1 - note A_, 1 - note G#, 1 - note A_, 1 - note A#, 1 - note A_, 1 - note A#, 1 - note B_, 1 + G# 1 + A_ 1 + G# 1 + A_ 1 + A# 1 + A_ 1 + A# 1 + B_ 1 notetype 12, 9, 2 - note A#, 1 - note B_, 1 + A# 1 + B_ 1 octave 4 - note C_, 1 + C_ 1 octave 3 - note B_, 1 + B_ 1 octave 4 - note C_, 1 - note C#, 1 - note C_, 1 - note C#, 1 + C_ 1 + C# 1 + C_ 1 + C# 1 notetype 12, 8, 2 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note D#, 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + D_ 1 + D# 1 + E_ 1 + D# 1 notetype 12, 12, 1 octave 3 - note E_, 1 - note E_, 7 - note F_, 1 - note F_, 7 - note G_, 1 - note G_, 7 - note F_, 1 - note F_, 7 - note E_, 1 - note E_, 7 - note F_, 1 - note F_, 7 - note G_, 1 - note G_, 7 - note G#, 1 - note G#, 3 - note D#, 4 + E_ 1 + E_ 7 + F_ 1 + F_ 7 + G_ 1 + G_ 7 + F_ 1 + F_ 7 + E_ 1 + E_ 7 + F_ 1 + F_ 7 + G_ 1 + G_ 7 + G# 1 + G# 3 + D# 4 notetype 12, 12, 1 - note E_, 1 - note E_, 3 + E_ 1 + E_ 3 notetype 12, 11, 3 - note E_, 4 + E_ 4 notetype 12, 12, 1 - note F_, 1 - note F_, 3 + F_ 1 + F_ 3 notetype 12, 11, 3 - note F_, 4 + F_ 4 notetype 12, 12, 1 - note G_, 1 - note G_, 3 + G_ 1 + G_ 3 notetype 12, 11, 3 - note G_, 4 + G_ 4 notetype 12, 12, 1 - note F_, 1 - note F_, 3 + F_ 1 + F_ 3 notetype 12, 11, 3 - note F_, 4 + F_ 4 notetype 12, 12, 1 - note E_, 1 - note E_, 3 + E_ 1 + E_ 3 notetype 12, 11, 3 - note E_, 4 + E_ 4 notetype 12, 12, 1 - note F_, 1 - note F_, 3 + F_ 1 + F_ 3 notetype 12, 11, 3 - note F_, 4 + F_ 4 notetype 12, 12, 1 - note G_, 1 - note G_, 3 + G_ 1 + G_ 3 notetype 12, 11, 3 - note G_, 4 + G_ 4 notetype 12, 12, 1 - note G#, 1 - note G#, 3 + G# 1 + G# 3 notetype 12, 11, 7 - note D#, 4 + D# 4 Music_FinalBattle_branch_23429:: notetype 12, 11, 7 octave 3 - note E_, 4 - note B_, 4 - note D#, 4 - note A#, 4 - note D_, 4 - note A_, 4 + E_ 4 + B_ 4 + D# 4 + A# 4 + D_ 4 + A_ 4 octave 2 - note B_, 4 + B_ 4 octave 3 - note F#, 4 - note F_, 4 - note F#, 4 + F# 4 + F_ 4 + F# 4 notetype 12, 11, 1 - note F#, 2 - note F_, 1 - note F#, 1 - note A_, 1 - note F#, 2 - note F#, 1 + F# 2 + F_ 1 + F# 1 + A_ 1 + F# 2 + F# 1 notetype 12, 11, 7 octave 2 - note B_, 6 + B_ 6 notetype 12, 10, 0 octave 3 - note D_, 6 + D_ 6 notetype 12, 11, 7 - note F#, 4 - note E_, 4 - note B_, 4 - note D#, 4 - note A#, 4 - note D_, 4 - note A_, 4 + F# 4 + E_ 4 + B_ 4 + D# 4 + A# 4 + D_ 4 + A_ 4 octave 2 - note B_, 4 + B_ 4 octave 3 - note F#, 4 - note F_, 4 - note F#, 12 - note A#, 4 + F# 4 + F_ 4 + F# 12 + A# 4 notetype 12, 5, 14 - note B_, 12 + B_ 12 notetype 12, 11, 2 - note E_, 3 - note E_, 3 - note E_, 2 - note E_, 1 - note F#, 1 - note E_, 1 - note B_, 1 - note F#, 1 - note E_, 1 - note F#, 1 - note B_, 1 - note F#, 1 - note E_, 1 - note F#, 1 - note B_, 1 - note F#, 1 - note E_, 1 - note F#, 1 - note B_, 1 - note F#, 1 + E_ 3 + E_ 3 + E_ 2 + E_ 1 + F# 1 + E_ 1 + B_ 1 + F# 1 + E_ 1 + F# 1 + B_ 1 + F# 1 + E_ 1 + F# 1 + B_ 1 + F# 1 + E_ 1 + F# 1 + B_ 1 + F# 1 notetype 12, 12, 2 - note E_, 1 - note F#, 1 - note B_, 1 - note F#, 1 + E_ 1 + F# 1 + B_ 1 + F# 1 notetype 12, 13, 2 - note E_, 1 - note F#, 1 - note B_, 1 + E_ 1 + F# 1 + B_ 1 notetype 12, 12, 1 - note E_, 1 - note E_, 7 - note E_, 1 - note E_, 7 - note E_, 1 - note E_, 7 - note E_, 1 - note E_, 7 - note E_, 1 - note E_, 3 + E_ 1 + E_ 7 + E_ 1 + E_ 7 + E_ 1 + E_ 7 + E_ 1 + E_ 7 + E_ 1 + E_ 3 notetype 12, 11, 5 - note D_, 4 + D_ 4 notetype 12, 12, 1 - note E_, 1 - note E_, 3 + E_ 1 + E_ 3 notetype 12, 11, 5 - note F_, 4 + F_ 4 notetype 12, 12, 1 - note E_, 1 - note E_, 3 + E_ 1 + E_ 3 notetype 12, 11, 5 - note D_, 4 + D_ 4 notetype 12, 12, 1 - note E_, 1 + E_ 1 notetype 12, 11, 7 - note E_, 7 + E_ 7 notetype 12, 12, 1 - note E_, 2 - note B_, 1 - note A_, 1 - note E_, 2 - note B_, 1 - note A_, 1 - note E_, 2 - note B_, 1 - note A_, 1 - note E_, 2 - note B_, 1 - note A_, 3 - note E_, 1 - note D_, 3 - note E_, 1 - note D_, 3 - note E_, 1 - note D_, 3 - note E_, 1 - note D_, 1 - note F_, 2 - octave 4 - note C_, 1 + E_ 2 + B_ 1 + A_ 1 + E_ 2 + B_ 1 + A_ 1 + E_ 2 + B_ 1 + A_ 1 + E_ 2 + B_ 1 + A_ 3 + E_ 1 + D_ 3 + E_ 1 + D_ 3 + E_ 1 + D_ 3 + E_ 1 + D_ 1 + F_ 2 + octave 4 + C_ 1 octave 3 - note B_, 1 - note F_, 2 + B_ 1 + F_ 2 octave 4 - note C_, 1 + C_ 1 octave 3 - note B_, 1 - note F_, 2 + B_ 1 + F_ 2 octave 4 - note C_, 1 + C_ 1 octave 3 - note B_, 1 - note F_, 2 + B_ 1 + F_ 2 octave 4 - note C_, 1 + C_ 1 octave 3 - note B_, 3 - note F_, 1 - note E_, 3 - note F_, 1 - note E_, 3 - note F_, 1 - note E_, 3 - note F_, 1 - note E_, 1 - note F#, 2 - octave 4 - note C#, 1 - note C_, 1 + B_ 3 + F_ 1 + E_ 3 + F_ 1 + E_ 3 + F_ 1 + E_ 3 + F_ 1 + E_ 1 + F# 2 + octave 4 + C# 1 + C_ 1 octave 3 - note F#, 2 + F# 2 octave 4 - note C#, 1 - note C_, 1 + C# 1 + C_ 1 octave 3 - note F#, 2 + F# 2 octave 4 - note C#, 1 - note C_, 1 + C# 1 + C_ 1 octave 3 - note F#, 2 + F# 2 octave 4 - note C#, 1 - note C_, 3 + C# 1 + C_ 3 octave 3 - note F#, 1 - note F_, 3 - note F#, 1 - note F_, 3 - note F#, 1 - note F_, 3 - note F#, 1 - note F_, 3 - note F#, 1 - note F_, 3 - note F#, 1 - note F_, 3 - note F#, 1 - note F_, 3 + F# 1 + F_ 3 + F# 1 + F_ 3 + F# 1 + F_ 3 + F# 1 + F_ 3 + F# 1 + F_ 3 + F# 1 + F_ 3 + F# 1 + F_ 3 notetype 12, 11, 7 octave 4 - note C_, 2 + C_ 2 notetype 12, 11, 0 - note C#, 8 + C# 8 notetype 12, 11, 7 - note C#, 8 + C# 8 notetype 12, 10, 0 octave 3 - note F#, 8 - note F#, 8 + F# 8 + F# 8 notetype 12, 11, 0 octave 3 - note A_, 8 + A_ 8 notetype 12, 11, 7 - note A_, 8 - note G_, 4 - note B_, 12 + A_ 8 + G_ 4 + B_ 12 notetype 12, 11, 0 - note A_, 8 + A_ 8 notetype 12, 11, 7 - note A_, 8 + A_ 8 notetype 12, 11, 0 - note E_, 8 + E_ 8 notetype 12, 11, 7 - note E_, 8 + E_ 8 notetype 12, 11, 0 - note A#, 8 + A# 8 notetype 12, 11, 7 - note A#, 8 + A# 8 octave 4 - note F_, 8 + F_ 8 octave 3 - note A#, 8 + A# 8 octave 4 - note C#, 4 - note E_, 12 + C# 4 + E_ 12 octave 3 - note A_, 4 + A_ 4 octave 4 - note C#, 12 + C# 12 notetype 12, 4, 0 callchannel Music_FinalBattle_branch_23710 callchannel Music_FinalBattle_branch_23710 notetype 12, 11, 7 octave 3 - note E_, 4 - note B_, 4 - note D#, 4 - note A#, 4 - note D_, 4 - note A_, 4 + E_ 4 + B_ 4 + D# 4 + A# 4 + D_ 4 + A_ 4 octave 2 - note B_, 4 + B_ 4 octave 3 - note F#, 4 - note F_, 4 - note F#, 12 + F# 4 + F_ 4 + F# 12 notetype 12, 11, 0 - note A_, 8 - note G_, 8 + A_ 8 + G_ 8 notetype 12, 11, 7 - note E_, 4 - note B_, 4 - note D#, 4 - note A#, 4 - note D_, 4 - note A_, 4 + E_ 4 + B_ 4 + D# 4 + A# 4 + D_ 4 + A_ 4 octave 2 - note B_, 4 + B_ 4 octave 3 - note F#, 4 - note F_, 4 - note F#, 12 + F# 4 + F_ 4 + F# 12 notetype 12, 11, 0 - note A_, 8 + A_ 8 notetype 12, 11, 7 octave 4 - note C_, 8 + C_ 8 notetype 12, 11, 0 octave 3 - note B_, 8 + B_ 8 notetype 12, 11, 7 - note B_, 8 + B_ 8 notetype 12, 11, 0 octave 4 - note E_, 8 + E_ 8 notetype 12, 11, 7 - note E_, 8 + E_ 8 loopchannel 0, Music_FinalBattle_branch_23429 @@ -386,84 +386,84 @@ Music_FinalBattle_Ch2:: ; 2356a (8:756a) vibrato 8, 2, 5 notetype 12, 12, 2 octave 5 - note C_, 1 + C_ 1 octave 4 - note G#, 1 - note B_, 1 - note F#, 1 - note A_, 1 - note E_, 1 - note G_, 1 + G# 1 + B_ 1 + F# 1 + A_ 1 + E_ 1 + G_ 1 octave 5 - note C_, 1 + C_ 1 octave 4 - note F_, 1 - note C#, 1 - note E_, 1 - note C_, 1 - note D#, 1 + F_ 1 + C# 1 + E_ 1 + C_ 1 + D# 1 octave 3 - note B_, 1 + B_ 1 octave 4 - note D_, 1 + D_ 1 octave 5 - note C_, 1 + C_ 1 octave 4 - note C_, 1 + C_ 1 octave 3 - note G#, 1 - note B_, 1 - note F#, 1 - note A#, 1 - note F_, 1 - note A_, 1 - octave 5 - note C_, 1 + G# 1 + B_ 1 + F# 1 + A# 1 + F_ 1 + A_ 1 + octave 5 + C_ 1 octave 3 - note G#, 1 - note D#, 1 - note G_, 1 - note D_, 1 - note F_, 1 - note C#, 1 - note E_, 1 - octave 5 - note C_, 1 + G# 1 + D# 1 + G_ 1 + D_ 1 + F_ 1 + C# 1 + E_ 1 + octave 5 + C_ 1 notetype 12, 12, 1 octave 4 - note E_, 1 - note E_, 7 - note E_, 1 - note E_, 7 - note E_, 1 - note E_, 7 - note E_, 1 - note E_, 7 - note E_, 1 - note E_, 3 + E_ 1 + E_ 7 + E_ 1 + E_ 7 + E_ 1 + E_ 7 + E_ 1 + E_ 7 + E_ 1 + E_ 3 notetype 12, 12, 2 octave 5 - note E_, 4 + E_ 4 notetype 12, 12, 1 octave 4 - note E_, 1 - note E_, 3 + E_ 1 + E_ 3 notetype 12, 12, 2 octave 5 - note E_, 4 + E_ 4 notetype 12, 12, 1 octave 4 - note E_, 1 - note E_, 3 + E_ 1 + E_ 3 notetype 12, 12, 2 octave 5 - note E_, 4 + E_ 4 notetype 12, 12, 1 octave 4 - note E_, 1 - note E_, 3 + E_ 1 + E_ 3 notetype 12, 12, 2 - note D#, 4 + D# 4 callchannel Music_FinalBattle_branch_23704 callchannel Music_FinalBattle_branch_23704 callchannel Music_FinalBattle_branch_23704 @@ -473,873 +473,873 @@ Music_FinalBattle_Ch2:: ; 2356a (8:756a) callchannel Music_FinalBattle_branch_23704 notetype 12, 12, 1 octave 4 - note E_, 1 - note E_, 3 + E_ 1 + E_ 3 notetype 12, 4, 10 octave 3 - note G#, 4 + G# 4 Music_FinalBattle_branch_235e6:: notetype 12, 13, 7 octave 4 - note E_, 8 - note D#, 8 - note D_, 8 + E_ 8 + D# 8 + D_ 8 octave 3 - note B_, 8 + B_ 8 notetype 12, 13, 7 - note A#, 4 - note B_, 12 + A# 4 + B_ 12 notetype 12, 11, 1 - note F_, 2 - note F#, 3 - note A_, 1 - note B_, 1 - note A_, 1 + F_ 2 + F# 3 + A_ 1 + B_ 1 + A_ 1 octave 4 - note C_, 1 + C_ 1 octave 3 - note B_, 2 - note A_, 1 - note B_, 1 - note B_, 1 - note A_, 1 - note A#, 1 + B_ 2 + A_ 1 + B_ 1 + B_ 1 + A_ 1 + A# 1 notetype 12, 13, 7 octave 4 - note E_, 8 - note D#, 8 - note D_, 8 + E_ 8 + D# 8 + D_ 8 octave 3 - note B_, 8 + B_ 8 notetype 12, 13, 7 - note A#, 4 - note B_, 12 + A# 4 + B_ 12 octave 4 - note D#, 4 - note E_, 12 + D# 4 + E_ 12 notetype 12, 10, 0 octave 3 - note B_, 8 + B_ 8 octave 4 - note D_, 8 - note F_, 8 - note D_, 8 + D_ 8 + F_ 8 + D_ 8 notetype 12, 13, 1 - note E_, 1 - note E_, 3 + E_ 1 + E_ 3 notetype 12, 12, 4 octave 3 - note D_, 4 + D_ 4 notetype 12, 13, 1 octave 4 - note E_, 1 - note E_, 3 + E_ 1 + E_ 3 notetype 12, 12, 4 octave 3 - note F_, 4 + F_ 4 notetype 12, 13, 1 octave 4 - note E_, 1 - note E_, 3 + E_ 1 + E_ 3 notetype 12, 12, 4 octave 3 - note D_, 4 + D_ 4 notetype 12, 13, 1 octave 4 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 notetype 12, 12, 4 octave 2 - note B_, 4 + B_ 4 octave 3 - note D_, 2 + D_ 2 notetype 12, 12, 2 octave 4 - note E_, 1 - note E_, 1 - note D_, 1 - note E_, 1 - note F_, 1 - note E_, 1 - note D_, 1 - note F_, 1 - note E_, 1 - note E_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note E_, 1 - note F#, 1 - note E_, 1 - note E_, 1 - note F_, 1 - note E_, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 + D_ 1 + E_ 1 + F_ 1 + E_ 1 + D_ 1 + F_ 1 + E_ 1 + E_ 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + E_ 1 + F# 1 + E_ 1 + E_ 1 + F_ 1 + E_ 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + E_ 1 notetype 12, 12, 4 octave 2 - note B_, 4 + B_ 4 octave 3 - note D_, 2 + D_ 2 notetype 12, 13, 7 octave 4 - note E_, 4 - note F_, 2 - note F#, 12 + E_ 4 + F_ 2 + F# 12 notetype 12, 12, 2 octave 3 - note B_, 2 - note B_, 4 - note B_, 2 - note B_, 4 - note B_, 2 + B_ 2 + B_ 4 + B_ 2 + B_ 4 + B_ 2 notetype 12, 13, 7 octave 4 - note F_, 4 - note F#, 2 - note G_, 12 + F_ 4 + F# 2 + G_ 12 notetype 12, 12, 2 - note C_, 2 - note C_, 4 - note C_, 2 - note C_, 4 - note C_, 2 + C_ 2 + C_ 4 + C_ 2 + C_ 4 + C_ 2 notetype 12, 13, 7 - note F#, 4 - note G_, 2 - note G#, 12 + F# 4 + G_ 2 + G# 12 notetype 12, 8, 2 - note C#, 2 - note C#, 4 + C# 2 + C# 4 notetype 12, 10, 2 - note C#, 2 - note C#, 4 - note C#, 4 + C# 2 + C# 4 + C# 4 notetype 12, 13, 2 - note C#, 2 - note C#, 4 + C# 2 + C# 4 notetype 12, 15, 2 - note C#, 2 - note C#, 4 + C# 2 + C# 4 notetype 12, 12, 4 - note E_, 1 - note F_, 1 + E_ 1 + F_ 1 notetype 12, 12, 0 - note F#, 12 + F# 12 notetype 12, 12, 7 - note F#, 4 + F# 4 notetype 12, 1, 15 octave 3 - note F#, 8 + F# 8 notetype 12, 9, 0 - note F#, 8 + F# 8 notetype 12, 12, 7 octave 4 - note C#, 4 + C# 4 notetype 12, 12, 0 - note D_, 12 - note D_, 8 + D_ 12 + D_ 8 notetype 12, 12, 7 - note D_, 8 + D_ 8 notetype 12, 12, 0 - note E_, 8 + E_ 8 notetype 12, 12, 7 - note E_, 8 + E_ 8 notetype 12, 12, 0 octave 3 - note A_, 8 + A_ 8 notetype 12, 12, 7 - note A_, 8 + A_ 8 notetype 12, 12, 0 octave 4 - note F_, 8 + F_ 8 notetype 12, 12, 7 - note F_, 8 + F_ 8 octave 5 - note C_, 8 + C_ 8 octave 4 - note A#, 8 + A# 8 notetype 12, 12, 0 - note A_, 16 - note A_, 8 + A_ 16 + A_ 8 notetype 12, 12, 7 - note A_, 8 + A_ 8 notetype 12, 12, 5 callchannel Music_FinalBattle_branch_23710 notetype 12, 11, 1 callchannel Music_FinalBattle_branch_23710 notetype 12, 13, 7 octave 4 - note E_, 8 - note D#, 8 - note D_, 8 + E_ 8 + D# 8 + D_ 8 octave 3 - note B_, 8 - note A#, 4 - note B_, 12 + B_ 8 + A# 4 + B_ 12 notetype 12, 12, 7 octave 4 - note D_, 8 + D_ 8 notetype 12, 4, 12 - note C_, 8 + C_ 8 notetype 12, 13, 7 - note E_, 8 - note D#, 8 - note D_, 8 + E_ 8 + D# 8 + D_ 8 octave 3 - note B_, 8 - note A#, 4 - note B_, 12 + B_ 8 + A# 4 + B_ 12 notetype 12, 5, 13 octave 4 - note D_, 8 + D_ 8 notetype 12, 12, 0 - note F_, 8 + F_ 8 notetype 12, 12, 0 - note E_, 8 + E_ 8 notetype 12, 12, 7 - note E_, 8 - note A#, 4 - note B_, 12 + E_ 8 + A# 4 + B_ 12 loopchannel 0, Music_FinalBattle_branch_235e6 Music_FinalBattle_branch_23704:: octave 4 - note E_, 1 - note E_, 1 - note G_, 1 + E_ 1 + E_ 1 + G_ 1 octave 5 - note C_, 1 - note E_, 1 - note C_, 1 + C_ 1 + E_ 1 + C_ 1 octave 4 - note G_, 1 - note F_, 1 + G_ 1 + F_ 1 endchannel Music_FinalBattle_branch_23710:: octave 4 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D_, 2 - note C#, 2 - note F#, 2 - note D_, 2 + C# 2 + D_ 2 + C# 2 + F# 2 + D_ 2 endchannel Music_FinalBattle_Ch3:: ; 2371c (8:771c) notetype 12, 1, 1 octave 4 - note E_, 4 + E_ 4 octave 5 - note E_, 4 + E_ 4 octave 4 - note F_, 4 + F_ 4 octave 5 - note D#, 4 + D# 4 octave 4 - note G_, 4 + G_ 4 octave 5 - note D_, 4 + D_ 4 octave 4 - note G#, 4 - note B_, 4 - note E_, 1 - note E_, 1 + G# 4 + B_ 4 + E_ 1 + E_ 1 rest 6 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 rest 6 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 rest 6 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 rest 2 - note D#, 4 - note E_, 1 - note E_, 1 + D# 4 + E_ 1 + E_ 1 rest 2 - note B_, 4 - note E_, 1 - note E_, 1 + B_ 4 + E_ 1 + E_ 1 rest 2 octave 5 - note C_, 4 + C_ 4 octave 4 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 rest 2 octave 5 - note D_, 4 + D_ 4 octave 4 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 octave 5 - note C_, 4 + C_ 4 octave 4 - note A#, 2 - note E_, 1 - note E_, 1 + A# 2 + E_ 1 + E_ 1 rest 2 - note B_, 4 - note E_, 1 - note E_, 1 + B_ 4 + E_ 1 + E_ 1 rest 2 octave 5 - note C_, 4 + C_ 4 octave 4 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 rest 2 octave 5 - note D_, 4 + D_ 4 octave 4 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 octave 5 - note C_, 4 - note D_, 2 + C_ 4 + D_ 2 octave 4 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 rest 2 - note B_, 4 - note E_, 1 - note E_, 1 + B_ 4 + E_ 1 + E_ 1 rest 2 octave 5 - note C_, 4 + C_ 4 octave 4 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 rest 2 octave 5 - note D_, 4 + D_ 4 octave 4 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 rest 2 - note E_, 1 - note D#, 1 - note E_, 1 - note G_, 1 + E_ 1 + D# 1 + E_ 1 + G_ 1 Music_FinalBattle_branch_2377d:: octave 4 - note E_, 1 + E_ 1 octave 3 - note E_, 1 + E_ 1 rest 2 octave 4 - note F#, 4 - note D#, 1 + F# 4 + D# 1 octave 3 - note D#, 1 + D# 1 rest 2 octave 4 - note F_, 4 - note D_, 1 + F_ 4 + D_ 1 octave 3 - note D_, 1 + D_ 1 rest 2 octave 4 - note E_, 4 - note F#, 1 + E_ 4 + F# 1 octave 3 - note F#, 1 + F# 1 rest 2 octave 4 - note F#, 4 - note F_, 4 + F# 4 + F_ 4 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 - note E_, 1 + F# 2 + E_ 1 octave 3 - note E_, 1 + E_ 1 rest 2 octave 4 - note F#, 4 - note D#, 1 + F# 4 + D# 1 octave 3 - note D#, 1 + D# 1 rest 2 octave 4 - note F_, 4 - note D_, 1 + F_ 4 + D_ 1 octave 3 - note D_, 1 + D_ 1 rest 2 octave 4 - note E_, 4 - note F#, 1 + E_ 4 + F# 1 octave 3 - note F#, 1 + F# 1 rest 2 octave 4 - note F#, 4 - note F_, 4 + F# 4 + F_ 4 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 - octave 4 - note F#, 2 - note E_, 1 - note D#, 1 - note E_, 1 - note F#, 1 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 1 - note E_, 1 + B_ 2 + octave 4 + F# 2 + E_ 1 + D# 1 + E_ 1 + F# 1 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 1 + E_ 1 rest 2 - note D_, 4 - note E_, 1 - note E_, 1 + D_ 4 + E_ 1 + E_ 1 rest 2 - note F_, 4 - note E_, 1 - note E_, 1 + F_ 4 + E_ 1 + E_ 1 rest 2 - note D_, 4 - note E_, 1 - note E_, 1 + D_ 4 + E_ 1 + E_ 1 octave 3 - note B_, 6 + B_ 6 octave 4 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 rest 2 - note D_, 4 - note E_, 1 - note E_, 1 + D_ 4 + E_ 1 + E_ 1 rest 2 - note F_, 4 - note E_, 1 - note E_, 1 + F_ 4 + E_ 1 + E_ 1 rest 2 - note D_, 4 - note E_, 1 - note E_, 1 + D_ 4 + E_ 1 + E_ 1 octave 3 - note B_, 6 + B_ 6 octave 4 - note E_, 2 + E_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note E_, 2 + E_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note E_, 2 + E_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note E_, 2 + E_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note E_, 2 - note B_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note B_, 2 + E_ 2 + B_ 2 + B_ 2 + E_ 2 + B_ 2 + B_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note B_, 2 - note F_, 2 + B_ 2 + F_ 2 octave 5 - note D#, 2 + D# 2 octave 4 - note F_, 2 + F_ 2 octave 5 - note D#, 2 + D# 2 octave 4 - note F_, 2 + F_ 2 octave 5 - note D#, 2 + D# 2 octave 4 - note F_, 2 + F_ 2 octave 5 - note D#, 2 + D# 2 octave 4 - note F_, 2 + F_ 2 octave 5 - note C_, 2 - note C_, 2 + C_ 2 + C_ 2 octave 4 - note F_, 2 + F_ 2 octave 5 - note C_, 2 - note C_, 2 - note D_, 2 - note C_, 2 + C_ 2 + C_ 2 + D_ 2 + C_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note E_, 2 + E_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note E_, 2 + E_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note E_, 2 + E_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note E_, 2 + E_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note C#, 2 - note C#, 2 + C# 2 + C# 2 octave 4 - note F#, 2 + F# 2 octave 5 - note C#, 2 - note C#, 2 - note E_, 2 - note C#, 2 + C# 2 + C# 2 + E_ 2 + C# 2 octave 4 - note F#, 2 + F# 2 octave 5 - note C#, 2 - note C#, 2 + C# 2 + C# 2 octave 4 - note F#, 2 + F# 2 octave 5 - note C#, 2 - note C#, 2 - note E_, 2 - note C#, 2 + C# 2 + C# 2 + E_ 2 + C# 2 callchannel Music_FinalBattle_branch_2395b callchannel Music_FinalBattle_branch_2395b octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 1 - note F#, 1 - note G_, 1 - note G#, 1 + G_ 1 + F# 1 + G_ 1 + G# 1 callchannel Music_FinalBattle_branch_2396c callchannel Music_FinalBattle_branch_2396c octave 4 - note A#, 2 + A# 2 octave 5 - note F_, 2 + F_ 2 octave 4 - note A#, 2 + A# 2 octave 5 - note F_, 2 + F_ 2 octave 4 - note A#, 2 + A# 2 octave 5 - note F_, 2 + F_ 2 octave 4 - note A#, 2 + A# 2 octave 5 - note F_, 2 + F_ 2 octave 4 - note A#, 2 + A# 2 octave 5 - note F_, 2 - note G_, 2 - note F_, 2 - note E_, 2 - note D_, 2 - note C#, 2 + F_ 2 + G_ 2 + F_ 2 + E_ 2 + D_ 2 + C# 2 octave 4 - note A#, 2 - note A_, 2 + A# 2 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note A_, 2 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note A_, 2 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note A_, 2 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note A_, 2 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note A_, 2 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note A_, 2 + A_ 2 octave 5 - note C#, 2 + C# 2 octave 4 - note A_, 2 - note G#, 2 - note G_, 2 + A_ 2 + G# 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 1 - note F#, 1 - note G_, 1 - note G#, 1 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note F_, 2 - note F#, 2 - note G_, 2 - note F#, 2 - note B_, 2 - note F#, 2 - note B_, 2 - note F#, 2 - note B_, 2 - note F#, 2 - note B_, 2 - note F#, 2 - note B_, 2 - note F#, 2 - note B_, 2 - note F#, 2 - note B_, 2 - note F#, 2 - note D#, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note F_, 2 - note F#, 2 - note G_, 2 - note F#, 2 + G_ 1 + F# 1 + G_ 1 + G# 1 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + F_ 2 + F# 2 + G_ 2 + F# 2 + B_ 2 + F# 2 + B_ 2 + F# 2 + B_ 2 + F# 2 + B_ 2 + F# 2 + B_ 2 + F# 2 + B_ 2 + F# 2 + B_ 2 + F# 2 + D# 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + F_ 2 + F# 2 + G_ 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note F#, 2 - note F_, 2 - note E_, 2 - note B_, 2 - octave 5 - note E_, 4 - octave 4 - note E_, 2 - note B_, 2 - octave 5 - note D#, 4 - octave 4 - note E_, 2 - note B_, 2 - octave 5 - note D_, 4 - octave 4 - note E_, 2 - note A_, 2 - note B_, 4 + F# 2 + F_ 2 + E_ 2 + B_ 2 + octave 5 + E_ 4 + octave 4 + E_ 2 + B_ 2 + octave 5 + D# 4 + octave 4 + E_ 2 + B_ 2 + octave 5 + D_ 4 + octave 4 + E_ 2 + A_ 2 + B_ 4 loopchannel 0, Music_FinalBattle_branch_2377d Music_FinalBattle_branch_2395b:: octave 4 - note F#, 2 + F# 2 octave 5 - note C#, 2 + C# 2 octave 4 - note F#, 2 + F# 2 octave 5 - note C#, 2 + C# 2 octave 4 - note F#, 2 + F# 2 octave 5 - note C#, 2 + C# 2 octave 4 - note F#, 2 + F# 2 octave 5 - note C#, 2 + C# 2 endchannel Music_FinalBattle_branch_2396c:: octave 4 - note A_, 2 + A_ 2 octave 5 - note E_, 2 + E_ 2 octave 4 - note A_, 2 + A_ 2 octave 5 - note E_, 2 + E_ 2 octave 4 - note A_, 2 + A_ 2 octave 5 - note E_, 2 + E_ 2 octave 4 - note A_, 2 + A_ 2 octave 5 - note E_, 2 + E_ 2 endchannel -; 0x2397d
\ No newline at end of file +; 0x2397d diff --git a/audio/music/gamecorner.asm b/audio/music/gamecorner.asm index ea89ff2f..a80652e3 100644 --- a/audio/music/gamecorner.asm +++ b/audio/music/gamecorner.asm @@ -1,185 +1,185 @@ Music_GameCorner_Ch1:: ; 7e20b (1f:620b) - tempo 0, 120 - stereopanning 119 + tempo 120 + volume 7, 7 duty 3 vibrato 12, 3, 4 - togglecall + toggleperfectpitch notetype 12, 11, 5 octave 3 - note A_, 6 + A_ 6 notetype 12, 11, 1 - note G#, 2 - note F#, 2 - note E_, 2 - note D#, 2 - note C#, 2 - note D#, 16 + G# 2 + F# 2 + E_ 2 + D# 2 + C# 2 + D# 16 Music_GameCorner_branch_7e222:: notetype 12, 11, 5 octave 3 - note C#, 4 + C# 4 octave 2 - note G#, 4 + G# 4 octave 3 - note E_, 4 + E_ 4 octave 2 - note B_, 4 + B_ 4 octave 3 - note A_, 2 - note G#, 8 + A_ 2 + G# 8 notetype 12, 10, 7 - note G#, 2 - note A_, 2 - note B_, 2 + G# 2 + A_ 2 + B_ 2 notetype 12, 11, 5 - note G#, 6 - note E_, 2 - note F#, 2 - note E_, 2 - note D#, 2 - note E_, 2 + G# 6 + E_ 2 + F# 2 + E_ 2 + D# 2 + E_ 2 notetype 12, 10, 7 - note F#, 8 - note D#, 8 + F# 8 + D# 8 notetype 12, 11, 5 - note D#, 4 + D# 4 octave 2 - note B_, 4 + B_ 4 octave 3 - note F#, 4 - note D#, 4 - note B_, 2 - note A_, 8 + F# 4 + D# 4 + B_ 2 + A_ 8 notetype 12, 11, 7 octave 4 - note E_, 2 - note D#, 2 - note E_, 2 - note D#, 6 - note C#, 2 - octave 3 - note D#, 2 - note E_, 2 - note F#, 2 - note G_, 2 - note G#, 2 + E_ 2 + D# 2 + E_ 2 + D# 6 + C# 2 + octave 3 + D# 2 + E_ 2 + F# 2 + G_ 2 + G# 2 notetype 12, 9, 7 - note G#, 1 - note G_, 1 - note G#, 1 - note G_, 1 - note G#, 2 + G# 1 + G_ 1 + G# 1 + G_ 1 + G# 2 notetype 12, 11, 7 - note F#, 8 + F# 8 notetype 12, 11, 5 - note C#, 4 + C# 4 octave 2 - note G#, 4 + G# 4 octave 3 - note E_, 4 + E_ 4 octave 2 - note B_, 4 + B_ 4 octave 3 - note A_, 2 - note G#, 8 + A_ 2 + G# 8 notetype 12, 11, 7 - note G#, 2 - note A_, 2 - note B_, 2 - note G#, 6 - note E_, 2 - note F#, 2 - note E_, 2 - note D#, 2 - note E_, 2 - note F#, 8 + G# 2 + A_ 2 + B_ 2 + G# 6 + E_ 2 + F# 2 + E_ 2 + D# 2 + E_ 2 + F# 8 notetype 12, 9, 7 - note D#, 4 - note C#, 4 + D# 4 + C# 4 notetype 12, 11, 5 - note D#, 4 + D# 4 octave 2 - note B_, 4 + B_ 4 octave 3 - note F#, 4 - note D#, 4 - note B_, 2 - note A_, 8 + F# 4 + D# 4 + B_ 2 + A_ 8 notetype 12, 11, 7 - note F#, 2 - note G#, 2 - note A_, 2 - note B_, 4 - note A_, 4 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 + F# 2 + G# 2 + A_ 2 + B_ 4 + A_ 4 + B_ 2 + A_ 2 + G# 2 + F# 2 notetype 12, 12, 2 - note E_, 4 + E_ 4 octave 2 - note B_, 4 + B_ 4 octave 3 - note E_, 2 - note E_, 4 - note E_, 4 + E_ 2 + E_ 4 + E_ 4 notetype 12, 11, 7 octave 2 - note B_, 2 + B_ 2 octave 3 - note C#, 2 - note D_, 2 - note D#, 10 + C# 2 + D_ 2 + D# 10 octave 2 - note B_, 2 + B_ 2 octave 3 - note C#, 2 - note D#, 2 - note E_, 8 + C# 2 + D# 2 + E_ 8 notetype 12, 11, 5 octave 4 - note D#, 4 + D# 4 octave 3 - note B_, 4 - note F#, 4 - note D#, 4 + B_ 4 + F# 4 + D# 4 notetype 12, 11, 7 - note E_, 3 - note D#, 1 + E_ 3 + D# 1 notetype 12, 11, 2 - note C#, 2 - note D#, 2 - note E_, 10 + C# 2 + D# 2 + E_ 10 notetype 12, 11, 7 octave 2 - note B_, 2 + B_ 2 octave 3 - note C#, 2 - note D_, 2 - note D#, 10 + C# 2 + D_ 2 + D# 10 octave 2 - note B_, 2 + B_ 2 octave 3 - note C#, 2 - note D#, 2 - note E_, 8 + C# 2 + D# 2 + E_ 8 notetype 12, 11, 5 octave 4 - note D#, 4 + D# 4 octave 3 - note B_, 4 - note F#, 4 - note A_, 4 + B_ 4 + F# 4 + A_ 4 notetype 12, 11, 7 - note G#, 2 - note G#, 1 - note G_, 1 - note G#, 1 - note G_, 1 - note G#, 1 - note G_, 1 - note G#, 8 + G# 2 + G# 1 + G_ 1 + G# 1 + G_ 1 + G# 1 + G_ 1 + G# 8 loopchannel 0, Music_GameCorner_branch_7e222 @@ -188,186 +188,186 @@ Music_GameCorner_Ch2:: ; 7e2df (1f:62df) vibrato 10, 2, 3 notetype 12, 12, 6 octave 4 - note C#, 6 + C# 6 notetype 12, 12, 1 octave 3 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note F#, 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + F# 2 duty 3 - note B_, 1 - note A#, 1 - note B_, 1 - note A#, 1 - note B_, 1 - note A#, 1 - note B_, 8 + B_ 1 + A# 1 + B_ 1 + A# 1 + B_ 1 + A# 1 + B_ 8 Music_GameCorner_branch_7e2fa:: duty 2 notetype 12, 12, 7 octave 3 - note E_, 4 + E_ 4 octave 2 - note B_, 4 - octave 3 - note G#, 4 - note E_, 4 - octave 4 - note C#, 2 - octave 3 - note B_, 14 - octave 4 - note E_, 6 - note D#, 2 - note C#, 2 - octave 3 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 16 - note F#, 4 - note D#, 4 - note A_, 4 - note F#, 4 - octave 4 - note D#, 2 - note C#, 14 - note F#, 6 - note E_, 2 - note D#, 2 - note C#, 2 - octave 3 - note B_, 2 - note A#, 2 - note B_, 16 - note E_, 4 + B_ 4 + octave 3 + G# 4 + E_ 4 + octave 4 + C# 2 + octave 3 + B_ 14 + octave 4 + E_ 6 + D# 2 + C# 2 + octave 3 + B_ 2 + A_ 2 + G# 2 + A_ 16 + F# 4 + D# 4 + A_ 4 + F# 4 + octave 4 + D# 2 + C# 14 + F# 6 + E_ 2 + D# 2 + C# 2 + octave 3 + B_ 2 + A# 2 + B_ 16 + E_ 4 octave 2 - note B_, 4 - octave 3 - note G#, 4 - note E_, 4 - octave 4 - note C#, 2 - octave 3 - note B_, 14 - octave 4 - note E_, 6 - note D#, 2 - note C#, 2 - octave 3 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 16 - note F#, 4 - note D#, 4 - note A_, 4 - note F#, 4 - octave 4 - note D#, 2 - note C#, 14 - note F#, 6 - note E_, 2 - note D#, 2 - note E_, 2 - note F#, 2 - note G#, 2 + B_ 4 + octave 3 + G# 4 + E_ 4 + octave 4 + C# 2 + octave 3 + B_ 14 + octave 4 + E_ 6 + D# 2 + C# 2 + octave 3 + B_ 2 + A_ 2 + G# 2 + A_ 16 + F# 4 + D# 4 + A_ 4 + F# 4 + octave 4 + D# 2 + C# 14 + F# 6 + E_ 2 + D# 2 + E_ 2 + F# 2 + G# 2 notetype 12, 12, 1 - note E_, 2 + E_ 2 notetype 12, 10, 1 - note E_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note E_, 2 + E_ 1 + D# 1 + E_ 1 + D# 1 + E_ 1 + D# 1 + E_ 2 notetype 12, 12, 7 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D_, 2 - note D#, 10 + C# 2 + D_ 2 + D# 10 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D#, 2 - note E_, 10 + C# 2 + D# 2 + E_ 10 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D#, 2 + C# 2 + D# 2 notetype 12, 12, 5 - note F#, 4 - note D#, 4 + F# 4 + D# 4 octave 3 - note B_, 4 + B_ 4 octave 4 - note A_, 4 - note G#, 3 - note A_, 1 + A_ 4 + G# 3 + A_ 1 notetype 12, 12, 2 - note G#, 2 - note F#, 2 - note E_, 2 + G# 2 + F# 2 + E_ 2 notetype 12, 12, 7 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D_, 2 - note D#, 10 + C# 2 + D_ 2 + D# 10 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D#, 2 - note E_, 10 + C# 2 + D# 2 + E_ 10 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D#, 2 - note F#, 4 - note D#, 4 - note A_, 4 - note F#, 4 - note B_, 16 + C# 2 + D# 2 + F# 4 + D# 4 + A_ 4 + F# 4 + B_ 16 loopchannel 0, Music_GameCorner_branch_7e2fa Music_GameCorner_Ch3:: ; 7e38b (1f:638b) notetype 12, 1, 3 octave 5 - note C#, 1 + C# 1 rest 5 octave 4 - note F#, 1 + F# 1 rest 1 - note G#, 1 + G# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note A#, 1 + A# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note B_, 1 + B_ 1 rest 9 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 Music_GameCorner_branch_7e3a5:: @@ -378,23 +378,23 @@ Music_GameCorner_branch_7e3a5:: callchannel Music_GameCorner_branch_7e46c callchannel Music_GameCorner_branch_7e481 callchannel Music_GameCorner_branch_7e496 - note D#, 1 + D# 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 - note D#, 1 + D# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note F#, 1 + F# 1 rest 1 callchannel Music_GameCorner_branch_7e418 callchannel Music_GameCorner_branch_7e42d @@ -403,38 +403,38 @@ Music_GameCorner_branch_7e3a5:: callchannel Music_GameCorner_branch_7e46c callchannel Music_GameCorner_branch_7e481 callchannel Music_GameCorner_branch_7e496 - note E_, 1 + E_ 1 rest 3 octave 3 - note B_, 1 + B_ 1 rest 3 octave 4 - note E_, 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 3 - note B_, 1 + B_ 1 rest 1 callchannel Music_GameCorner_branch_7e46c callchannel Music_GameCorner_branch_7e418 callchannel Music_GameCorner_branch_7e4ab - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 1 callchannel Music_GameCorner_branch_7e46c callchannel Music_GameCorner_branch_7e418 @@ -443,186 +443,186 @@ Music_GameCorner_branch_7e3a5:: loopchannel 0, Music_GameCorner_branch_7e3a5 Music_GameCorner_branch_7e418:: - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 endchannel Music_GameCorner_branch_7e42d:: - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 endchannel Music_GameCorner_branch_7e442:: - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note B_, 1 + B_ 1 rest 1 endchannel Music_GameCorner_branch_7e457:: - note D#, 1 + D# 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 - note D#, 1 + D# 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 endchannel Music_GameCorner_branch_7e46c:: - note D#, 1 + D# 1 rest 1 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 endchannel Music_GameCorner_branch_7e481:: - note D#, 1 + D# 1 rest 1 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 - note D#, 1 + D# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 endchannel Music_GameCorner_branch_7e496:: - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note B_, 1 + B_ 1 rest 1 endchannel Music_GameCorner_branch_7e4ab:: - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 endchannel -; 0x7e4c0
\ No newline at end of file +; 0x7e4c0 diff --git a/audio/music/gym.asm b/audio/music/gym.asm index b846ca73..b4cb2a8d 100644 --- a/audio/music/gym.asm +++ b/audio/music/gym.asm @@ -1,167 +1,167 @@ Music_Gym_Ch1:: ; bcbb (2:7cbb) - tempo 0, 138 - stereopanning 119 + tempo 138 + volume 7, 7 duty 3 vibrato 8, 2, 2 - togglecall + toggleperfectpitch notetype 12, 11, 5 octave 3 - note G_, 6 - note C_, 1 - note G_, 1 - note F_, 6 + G_ 6 + C_ 1 + G_ 1 + F_ 6 octave 2 - note A#, 1 + A# 1 octave 3 - note F_, 1 - note E_, 6 + F_ 1 + E_ 6 octave 2 - note A_, 1 + A_ 1 octave 3 - note E_, 1 - note F_, 4 - note G_, 4 + E_ 1 + F_ 4 + G_ 4 Music_Gym_branch_bcd8:: - note E_, 4 - note F_, 2 - note G_, 2 - note F_, 2 - note E_, 2 - note D_, 2 - note C_, 2 + E_ 4 + F_ 2 + G_ 2 + F_ 2 + E_ 2 + D_ 2 + C_ 2 notetype 12, 11, 1 - note D_, 3 + D_ 3 notetype 12, 11, 5 - note E_, 1 - note F_, 4 - note E_, 2 - note D_, 2 - note E_, 2 - note F_, 2 - note E_, 4 - note F_, 2 - note G_, 2 - note F_, 2 - note E_, 2 - note D_, 2 - note C_, 2 - note D_, 2 - note D_, 1 - note E_, 1 - note F_, 4 - note E_, 2 - note D_, 2 - note E_, 2 - note F_, 2 + E_ 1 + F_ 4 + E_ 2 + D_ 2 + E_ 2 + F_ 2 + E_ 4 + F_ 2 + G_ 2 + F_ 2 + E_ 2 + D_ 2 + C_ 2 + D_ 2 + D_ 1 + E_ 1 + F_ 4 + E_ 2 + D_ 2 + E_ 2 + F_ 2 octave 4 - note C_, 4 + C_ 4 octave 3 - note A#, 2 + A# 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note A#, 2 - note A_, 2 - note G_, 2 - note F_, 2 + A# 2 + A_ 2 + G_ 2 + F_ 2 notetype 12, 11, 1 - note A#, 3 + A# 3 notetype 12, 11, 5 - note F_, 1 - note F_, 4 - note E_, 2 - note D_, 2 - note E_, 2 - note F_, 2 + F_ 1 + F_ 4 + E_ 2 + D_ 2 + E_ 2 + F_ 2 octave 4 - note C_, 4 + C_ 4 octave 3 - note A#, 2 + A# 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note A#, 2 - note A_, 2 - note G_, 2 - note F_, 2 - note D_, 2 - note D_, 1 - note E_, 1 - note F_, 4 - note A#, 2 - note F_, 1 - note A#, 1 + A# 2 + A_ 2 + G_ 2 + F_ 2 + D_ 2 + D_ 1 + E_ 1 + F_ 4 + A# 2 + F_ 1 + A# 1 octave 4 - note D_, 4 + D_ 4 octave 3 - note E_, 2 - note C_, 2 - note E_, 2 - note G_, 2 - note F_, 2 - note E_, 2 - note D_, 2 - note E_, 2 - note F_, 2 - note D_, 2 - note E_, 2 - note C_, 2 - note D_, 2 - note E_, 2 - note C_, 2 - note D_, 2 - note C_, 2 - note C_, 1 - note D_, 1 - note E_, 4 - note C_, 2 - note E_, 2 - note D_, 2 - note C_, 2 - note E_, 2 - note C_, 1 - note E_, 1 - note F_, 4 - note E_, 2 - note D_, 2 - note E_, 2 - note F_, 2 - note E_, 2 - note C_, 2 - note E_, 2 - note G_, 2 - note F_, 2 - note E_, 2 - note D_, 2 - note E_, 2 - note D_, 2 - note F_, 2 - note D_, 2 - note E_, 2 - note C_, 2 - note D_, 2 - note C_, 2 - note D_, 2 - note C_, 2 - note C_, 1 - note D_, 1 - note E_, 4 - note D_, 2 - note E_, 2 - note F_, 2 - note F_, 2 - note G_, 2 - note E_, 1 - note G_, 1 - note A#, 2 + E_ 2 + C_ 2 + E_ 2 + G_ 2 + F_ 2 + E_ 2 + D_ 2 + E_ 2 + F_ 2 + D_ 2 + E_ 2 + C_ 2 + D_ 2 + E_ 2 + C_ 2 + D_ 2 + C_ 2 + C_ 1 + D_ 1 + E_ 4 + C_ 2 + E_ 2 + D_ 2 + C_ 2 + E_ 2 + C_ 1 + E_ 1 + F_ 4 + E_ 2 + D_ 2 + E_ 2 + F_ 2 + E_ 2 + C_ 2 + E_ 2 + G_ 2 + F_ 2 + E_ 2 + D_ 2 + E_ 2 + D_ 2 + F_ 2 + D_ 2 + E_ 2 + C_ 2 + D_ 2 + C_ 2 + D_ 2 + C_ 2 + C_ 1 + D_ 1 + E_ 4 + D_ 2 + E_ 2 + F_ 2 + F_ 2 + G_ 2 + E_ 1 + G_ 1 + A# 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note A#, 2 - note A_, 2 - note G_, 2 - note A_, 2 + A# 2 + A_ 2 + G_ 2 + A_ 2 loopchannel 0, Music_Gym_branch_bcd8 @@ -170,121 +170,121 @@ Music_Gym_Ch2:: ; bd6b (2:7d6b) vibrato 10, 2, 5 notetype 12, 12, 7 octave 4 - note C_, 6 + C_ 6 octave 3 - note G_, 1 + G_ 1 octave 4 - note C_, 1 + C_ 1 octave 3 - note A#, 6 - note F_, 1 - note A#, 1 + A# 6 + F_ 1 + A# 1 notetype 12, 10, 0 - note A_, 12 + A_ 12 notetype 12, 12, 7 - note B_, 4 + B_ 4 Music_Gym_branch_bd82:: octave 4 - note C_, 12 + C_ 12 octave 3 - note G_, 2 + G_ 2 octave 4 - note C_, 2 + C_ 2 notetype 12, 12, 2 - note D_, 3 + D_ 3 octave 3 - note A#, 1 + A# 1 notetype 12, 12, 7 - note A#, 12 + A# 12 octave 4 - note C_, 12 + C_ 12 octave 3 - note G_, 2 + G_ 2 octave 4 - note C_, 2 + C_ 2 notetype 12, 12, 4 octave 3 - note A#, 2 + A# 2 notetype 12, 12, 7 - note A#, 1 + A# 1 octave 4 - note C_, 1 - note D_, 12 - note E_, 12 - note D_, 2 - note E_, 2 + C_ 1 + D_ 12 + E_ 12 + D_ 2 + E_ 2 notetype 12, 12, 2 - note F_, 3 - note D_, 1 + F_ 3 + D_ 1 notetype 12, 12, 7 - note D_, 4 + D_ 4 notetype 12, 12, 2 - note A#, 3 - note F_, 1 + A# 3 + F_ 1 notetype 12, 12, 7 - note F_, 4 - note E_, 12 - note D_, 2 - note E_, 2 - note F_, 2 - note D_, 1 - note F_, 1 - note A#, 12 + F_ 4 + E_ 12 + D_ 2 + E_ 2 + F_ 2 + D_ 1 + F_ 1 + A# 12 octave 3 - note G_, 6 + G_ 6 octave 4 - note C_, 6 + C_ 6 octave 3 - note G_, 4 - note A#, 4 - note A_, 4 - note G_, 4 - note F_, 4 + G_ 4 + A# 4 + A_ 4 + G_ 4 + F_ 4 notetype 12, 12, 3 - note E_, 2 + E_ 2 notetype 12, 12, 7 - note E_, 1 - note F_, 1 - note G_, 6 - note G_, 2 + E_ 1 + F_ 1 + G_ 6 + G_ 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note G_, 2 - note A#, 4 - note A_, 4 - note G_, 4 - note C_, 2 - note D_, 2 - note G_, 6 + G_ 2 + A# 4 + A_ 4 + G_ 4 + C_ 2 + D_ 2 + G_ 6 octave 4 - note C_, 6 + C_ 6 octave 3 - note G_, 4 - note A#, 4 - note A_, 4 - note G_, 4 - note F_, 4 + G_ 4 + A# 4 + A_ 4 + G_ 4 + F_ 4 notetype 12, 12, 3 - note E_, 2 + E_ 2 notetype 12, 12, 7 - note E_, 1 - note F_, 1 - note G_, 4 + E_ 1 + F_ 1 + G_ 4 notetype 12, 12, 3 - note G_, 2 + G_ 2 notetype 12, 12, 7 - note G_, 1 - note A_, 1 - note A#, 4 + G_ 1 + A_ 1 + A# 4 notetype 12, 12, 4 octave 4 - note C_, 2 + C_ 2 notetype 12, 12, 7 - note C_, 1 - note D_, 1 - note E_, 12 + C_ 1 + D_ 1 + E_ 12 loopchannel 0, Music_Gym_branch_bd82 @@ -293,9 +293,9 @@ Music_Gym_Ch3:: ; bdfa (2:7dfa) rest 16 rest 10 octave 4 - note G_, 2 - note F_, 2 - note D_, 2 + G_ 2 + F_ 2 + D_ 2 Music_Gym_branch_be02:: callchannel Music_Gym_branch_be3b @@ -313,46 +313,46 @@ Music_Gym_branch_be02:: callchannel Music_Gym_branch_be3b callchannel Music_Gym_branch_be4d callchannel Music_Gym_branch_be3b - note F_, 2 - note A#, 2 - note F_, 2 - note A#, 2 - note F_, 2 - note A#, 2 - note A_, 2 - note F_, 2 + F_ 2 + A# 2 + F_ 2 + A# 2 + F_ 2 + A# 2 + A_ 2 + F_ 2 loopchannel 0, Music_Gym_branch_be02 Music_Gym_branch_be3b:: - note E_, 2 - note G_, 2 - note E_, 2 - note G_, 2 - note E_, 2 - note G_, 2 - note E_, 2 - note G_, 2 + E_ 2 + G_ 2 + E_ 2 + G_ 2 + E_ 2 + G_ 2 + E_ 2 + G_ 2 endchannel Music_Gym_branch_be44:: - note D_, 2 - note F_, 2 - note D_, 2 - note F_, 2 - note D_, 2 - note F_, 2 - note D_, 2 - note F_, 2 + D_ 2 + F_ 2 + D_ 2 + F_ 2 + D_ 2 + F_ 2 + D_ 2 + F_ 2 endchannel Music_Gym_branch_be4d:: - note F_, 2 - note A#, 2 - note F_, 2 - note A#, 2 - note F_, 2 - note A#, 2 - note F_, 2 - note A#, 2 + F_ 2 + A# 2 + F_ 2 + A# 2 + F_ 2 + A# 2 + F_ 2 + A# 2 endchannel -; 0xbe56
\ No newline at end of file +; 0xbe56 diff --git a/audio/music/gymleaderbattle.asm b/audio/music/gymleaderbattle.asm index 97162408..c4e7907e 100644 --- a/audio/music/gymleaderbattle.asm +++ b/audio/music/gymleaderbattle.asm @@ -1,549 +1,549 @@ Music_GymLeaderBattle_Ch1:: ; 22370 (8:6370) - tempo 0, 104 - stereopanning 119 + tempo 104 + volume 7, 7 duty 3 vibrato 8, 3, 4 - togglecall + toggleperfectpitch notetype 12, 11, 3 rest 6 octave 3 - note F#, 1 - note F_, 1 - note E_, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note C#, 1 - note C_, 1 - note C#, 1 - note C_, 1 - octave 2 - note B_, 1 + F# 1 + F_ 1 + E_ 1 + F_ 1 + E_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + C# 1 + C_ 1 + C# 1 + C_ 1 + octave 2 + B_ 1 octave 1 - note G#, 1 - note A_, 1 - note A#, 1 - note A_, 1 - note A#, 1 - note B_, 1 - note A#, 1 - note B_, 1 - octave 2 - note F#, 1 + G# 1 + A_ 1 + A# 1 + A_ 1 + A# 1 + B_ 1 + A# 1 + B_ 1 + octave 2 + F# 1 rest 15 - note F#, 1 + F# 1 rest 9 - note G_, 6 - note F#, 1 + G_ 6 + F# 1 rest 15 - note F#, 1 + F# 1 rest 9 - note F_, 6 - note F#, 1 + F_ 6 + F# 1 rest 15 - note F#, 1 + F# 1 rest 9 - note G_, 6 - note F#, 1 + G_ 6 + F# 1 rest 15 - note F#, 1 + F# 1 rest 9 - note A_, 6 + A_ 6 Music_GymLeaderBattle_branch_223b0:: - note F#, 1 - octave 3 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - octave 2 - note E_, 1 - note A_, 1 - octave 3 - note C#, 1 - octave 2 - note B_, 1 - note A_, 1 - octave 3 - note C#, 1 - octave 2 - note B_, 1 - note A_, 1 - octave 3 - note C#, 1 - octave 2 - note B_, 1 - note A_, 1 - octave 3 - note C#, 1 - octave 2 - note B_, 1 - note A_, 1 - octave 3 - note C#, 1 + F# 1 + octave 3 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + octave 2 + E_ 1 + A_ 1 + octave 3 + C# 1 + octave 2 + B_ 1 + A_ 1 + octave 3 + C# 1 + octave 2 + B_ 1 + A_ 1 + octave 3 + C# 1 + octave 2 + B_ 1 + A_ 1 + octave 3 + C# 1 + octave 2 + B_ 1 + A_ 1 + octave 3 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 - note F#, 1 + B_ 1 + A_ 1 + F# 1 octave 3 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 - note C#, 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 + C# 1 octave 2 - note E_, 1 - note A_, 1 + E_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 3 - note C#, 1 + C# 1 octave 2 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 rest 2 octave 1 - note B_, 1 + B_ 1 rest 1 octave 2 - note D_, 4 + D_ 4 octave 1 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 2 - note E_, 4 + E_ 4 octave 1 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 2 - note D_, 4 + D_ 4 octave 1 - note B_, 1 + B_ 1 rest 1 octave 2 - note C#, 2 + C# 2 octave 1 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 2 - note D_, 4 + D_ 4 octave 1 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 2 - note E_, 4 + E_ 4 octave 1 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 2 - note D_, 4 + D_ 4 octave 1 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 2 - note C#, 2 + C# 2 octave 1 - note B_, 2 - note A_, 2 + B_ 2 + A_ 2 octave 2 - note C#, 2 + C# 2 octave 1 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 rest 16 octave 1 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note B_, 1 + B_ 1 + A_ 1 + B_ 1 octave 1 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 notetype 12, 11, 5 octave 3 - note C#, 12 + C# 12 notetype 12, 11, 3 octave 1 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 notetype 12, 11, 5 octave 3 - note A_, 12 + A_ 12 notetype 12, 11, 3 - note D#, 4 - note C#, 4 - note D#, 4 - note E_, 2 - note F#, 4 - octave 2 - note B_, 2 - octave 3 - note C#, 2 - note F#, 2 - note B_, 2 - note F#, 2 - note D#, 2 - note F#, 2 + D# 4 + C# 4 + D# 4 + E_ 2 + F# 4 + octave 2 + B_ 2 + octave 3 + C# 2 + F# 2 + B_ 2 + F# 2 + D# 2 + F# 2 octave 1 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 notetype 12, 11, 5 octave 3 - note A_, 12 + A_ 12 notetype 12, 11, 3 - note C#, 1 - octave 2 - note B_, 1 - octave 3 - note C#, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note E_, 1 - note F#, 1 - note A_, 1 - note G#, 1 - note F#, 1 - note E_, 1 - note F#, 1 - note E_, 1 - note D#, 1 - note C#, 1 + C# 1 + octave 2 + B_ 1 + octave 3 + C# 1 + D# 1 + E_ 1 + D# 1 + E_ 1 + F# 1 + A_ 1 + G# 1 + F# 1 + E_ 1 + F# 1 + E_ 1 + D# 1 + C# 1 notetype 12, 11, 5 - note D#, 4 - note E_, 4 - note C#, 2 - note D#, 6 - note F#, 4 - note E_, 2 - note D#, 4 - note C#, 6 + D# 4 + E_ 4 + C# 2 + D# 6 + F# 4 + E_ 2 + D# 4 + C# 6 rest 16 rest 10 - note E_, 6 - note D#, 4 - note E_, 4 - note C#, 2 - note D#, 6 - note E_, 4 - note D#, 2 - note C#, 4 - octave 2 - note B_, 6 - octave 3 - note D#, 4 - note E_, 4 - note C#, 2 - note D#, 6 - note F#, 4 - note A_, 2 - note G#, 4 - note E_, 6 + E_ 6 + D# 4 + E_ 4 + C# 2 + D# 6 + E_ 4 + D# 2 + C# 4 + octave 2 + B_ 6 + octave 3 + D# 4 + E_ 4 + C# 2 + D# 6 + F# 4 + A_ 2 + G# 4 + E_ 6 loopchannel 0, Music_GymLeaderBattle_branch_223b0 @@ -552,299 +552,299 @@ Music_GymLeaderBattle_Ch2:: ; 225a1 (8:65a1) vibrato 8, 2, 5 notetype 12, 12, 3 octave 4 - note F_, 1 - note E_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note C#, 1 - note C_, 1 - octave 3 - note B_, 1 + F_ 1 + E_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + C# 1 + C_ 1 + octave 3 + B_ 1 rest 5 - note F#, 1 - note F_, 1 - note E_, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note C#, 1 - note B_, 1 + F# 1 + F_ 1 + E_ 1 + F_ 1 + E_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + C# 1 + B_ 1 rest 15 - note B_, 1 + B_ 1 rest 9 octave 4 - note C_, 6 + C_ 6 octave 3 - note B_, 1 + B_ 1 rest 15 - note B_, 1 + B_ 1 rest 9 - note A#, 6 + A# 6 octave 3 - note B_, 1 + B_ 1 rest 15 - note B_, 1 + B_ 1 rest 9 octave 4 - note C_, 6 + C_ 6 octave 3 - note B_, 1 + B_ 1 rest 15 - note B_, 1 + B_ 1 rest 9 octave 4 - note C#, 6 + C# 6 Music_GymLeaderBattle_branch_225e0:: notetype 12, 12, 5 - note D#, 4 - note C#, 4 - note D#, 4 - note E_, 2 - note F#, 4 - note E_, 4 - note D#, 2 - note C#, 2 - octave 3 - note B_, 2 - octave 4 - note C#, 2 - note D#, 2 + D# 4 + C# 4 + D# 4 + E_ 2 + F# 4 + E_ 4 + D# 2 + C# 2 + octave 3 + B_ 2 + octave 4 + C# 2 + D# 2 notetype 12, 11, 7 duty 2 octave 3 - note A_, 8 + A_ 8 octave 4 - note C#, 8 - note E_, 8 - note C#, 8 + C# 8 + E_ 8 + C# 8 notetype 12, 12, 5 duty 3 - note D#, 4 - note C#, 4 - note D#, 4 - note E_, 2 - note F#, 4 - note E_, 4 - note D#, 2 - note C#, 2 - octave 3 - note B_, 2 - octave 4 - note C#, 2 - note D#, 2 + D# 4 + C# 4 + D# 4 + E_ 2 + F# 4 + E_ 4 + D# 2 + C# 2 + octave 3 + B_ 2 + octave 4 + C# 2 + D# 2 notetype 12, 11, 7 duty 2 - note C#, 8 + C# 8 octave 3 - note B_, 8 - note A_, 8 + B_ 8 + A_ 8 notetype 12, 12, 3 octave 4 - note E_, 4 - note E_, 2 - note C#, 2 + E_ 4 + E_ 2 + C# 2 notetype 12, 12, 5 duty 3 octave 1 - note B_, 1 + B_ 1 rest 3 octave 3 - note D_, 1 - note C#, 1 + D_ 1 + C# 1 octave 2 - note B_, 1 + B_ 1 octave 3 - note D_, 1 + D_ 1 rest 4 - note E_, 1 - note D_, 1 + E_ 1 + D_ 1 octave 2 - note B_, 1 + B_ 1 octave 3 - note E_, 1 + E_ 1 rest 4 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 + F# 1 + E_ 1 + C# 1 + F# 1 rest 2 - note E_, 1 - note C#, 1 - note E_, 1 + E_ 1 + C# 1 + E_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note D_, 1 - note C#, 1 + D_ 1 + C# 1 octave 2 - note B_, 1 + B_ 1 octave 3 - note D_, 1 + D_ 1 rest 4 - note E_, 1 - note D_, 1 + E_ 1 + D_ 1 octave 2 - note B_, 1 + B_ 1 octave 3 - note E_, 1 + E_ 1 rest 4 - note F#, 1 - note E_, 1 - note C#, 1 - note F#, 1 - note E_, 1 + F# 1 + E_ 1 + C# 1 + F# 1 + E_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 1 octave 1 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 notetype 12, 11, 0 octave 3 - note B_, 4 + B_ 4 octave 4 - note C_, 4 + C_ 4 octave 3 - note A_, 4 - note B_, 4 + A_ 4 + B_ 4 octave 4 - note C_, 4 + C_ 4 octave 3 - note A_, 4 - note G_, 4 + A_ 4 + G_ 4 notetype 12, 11, 0 - note F#, 8 + F# 8 notetype 12, 11, 7 - note F#, 8 + F# 8 notetype 12, 12, 3 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note C_, 1 - octave 2 - note B_, 1 - note A_, 1 - note G_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note A_, 1 - note B_, 1 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + C_ 1 + octave 2 + B_ 1 + A_ 1 + G_ 1 + F# 1 + F_ 1 + E_ 1 + F_ 1 + F# 1 + G_ 1 + A_ 1 + B_ 1 notetype 12, 11, 0 octave 3 - note B_, 4 + B_ 4 octave 4 - note C_, 4 + C_ 4 octave 3 - note A_, 4 - note B_, 4 + A_ 4 + B_ 4 octave 4 - note C_, 4 + C_ 4 octave 3 - note A_, 4 + A_ 4 octave 4 - note C_, 4 + C_ 4 notetype 12, 11, 0 octave 3 - note B_, 16 + B_ 16 notetype 12, 3, 15 octave 4 - note F#, 16 + F# 16 notetype 12, 12, 3 duty 3 octave 1 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 notetype 12, 12, 7 octave 3 - note A_, 12 + A_ 12 notetype 12, 12, 3 octave 1 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 notetype 12, 12, 7 octave 4 - note C#, 12 + C# 12 notetype 12, 11, 0 - note D#, 16 + D# 16 notetype 12, 11, 7 - note D#, 16 + D# 16 notetype 12, 12, 3 octave 1 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 notetype 12, 12, 7 octave 4 - note C#, 12 + C# 12 notetype 12, 12, 0 - note A_, 8 - note E_, 8 - note B_, 16 + A_ 8 + E_ 8 + B_ 16 notetype 12, 12, 7 - note B_, 16 + B_ 16 notetype 12, 12, 4 octave 3 - note D#, 4 - note E_, 4 - note C#, 2 - note D#, 6 - note F#, 4 - note A_, 2 - note G#, 4 + D# 4 + E_ 4 + C# 2 + D# 6 + F# 4 + A_ 2 + G# 4 rest 2 - note B_, 1 + B_ 1 octave 4 - note D#, 1 - note F#, 1 - note A#, 1 + D# 1 + F# 1 + A# 1 notetype 12, 12, 0 - note B_, 16 - note F#, 16 - note A_, 16 + B_ 16 + F# 16 + A_ 16 octave 5 - note C#, 8 + C# 8 rest 2 notetype 12, 12, 3 octave 4 - note A_, 6 + A_ 6 loopchannel 0, Music_GymLeaderBattle_branch_225e0 @@ -853,549 +853,549 @@ Music_GymLeaderBattle_Ch3:: ; 226ef (8:66ef) notetype 12, 1, 3 rest 12 octave 3 - note B_, 1 + B_ 1 octave 4 - note C_, 1 - note C#, 1 - note C_, 1 - note C#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note F_, 1 - note F#, 1 + C_ 1 + C# 1 + C_ 1 + C# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + D_ 1 + D# 1 + E_ 1 + D# 1 + E_ 1 + F_ 1 + E_ 1 + F_ 1 + F# 1 + F_ 1 + F# 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note C_, 6 + C_ 6 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F_, 6 + F_ 6 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note C_, 6 + C_ 6 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note C#, 6 + C# 6 notetype 12, 1, 4 Music_GymLeaderBattle_branch_227b1:: octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 4 - note D_, 4 + D_ 4 octave 3 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 4 - note E_, 4 + E_ 4 octave 3 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 4 - note D_, 4 + D_ 4 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note C#, 2 + C# 2 octave 3 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 4 - note D_, 4 + D_ 4 octave 3 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 4 - note E_, 4 + E_ 4 octave 3 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 4 - note D_, 4 + D_ 4 octave 3 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 4 - note C#, 2 + C# 2 octave 3 - note B_, 2 - note A_, 2 + B_ 2 + A_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 13 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 13 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 13 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 13 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 13 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 13 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 13 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 13 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 4 - note C#, 12 + C# 12 octave 3 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 4 - note E_, 12 - note D#, 16 + E_ 12 + D# 16 octave 3 - note B_, 16 - note A_, 1 + B_ 16 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 4 - note E_, 12 - note C#, 8 - note E_, 8 + E_ 12 + C# 8 + E_ 8 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note E_, 6 + E_ 6 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note G_, 6 + G_ 6 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note C_, 6 + C_ 6 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note F#, 2 + F# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note G_, 6 + G_ 6 loopchannel 0, Music_GymLeaderBattle_branch_227b1 -; 0x22919
\ No newline at end of file +; 0x22919 diff --git a/audio/music/halloffame.asm b/audio/music/halloffame.asm index 2900cec7..d2347aa6 100644 --- a/audio/music/halloffame.asm +++ b/audio/music/halloffame.asm @@ -1,28 +1,28 @@ Music_HallOfFame_Ch1:: ; 7fbaf (1f:7baf) - tempo 0, 112 - stereopanning 119 + tempo 112 + volume 7, 7 duty 3 vibrato 12, 2, 2 - togglecall + toggleperfectpitch notetype 12, 11, 3 rest 16 rest 16 rest 16 rest 12 octave 3 - note D_, 1 - note E_, 1 - note F_, 1 - note F#, 1 + D_ 1 + E_ 1 + F_ 1 + F# 1 Music_HallOfFame_branch_7fbc5:: notetype 12, 8, 0 octave 4 - note C_, 16 - note E_, 16 - note F#, 16 + C_ 16 + E_ 16 + F# 16 notetype 12, 6, 0 - note F_, 16 + F_ 16 loopchannel 3, Music_HallOfFame_branch_7fbc5 rest 16 rest 16 @@ -38,28 +38,28 @@ Music_HallOfFame_Ch2:: ; 7fbda (1f:7bda) Music_HallOfFame_branch_7fbdf:: notetype 12, 12, 4 octave 3 - note G_, 2 - note D_, 2 - note G_, 2 - note A_, 10 - note G_, 2 - note D_, 2 - note G_, 2 + G_ 2 + D_ 2 + G_ 2 + A_ 10 + G_ 2 + D_ 2 + G_ 2 octave 4 - note C_, 4 + C_ 4 octave 3 - note B_, 4 - note A_, 2 - note G_, 2 - note D_, 2 - note G_, 2 - note A_, 10 - note F_, 2 - note C_, 2 - note F_, 2 - note A#, 4 - note A_, 4 - note F_, 2 + B_ 4 + A_ 2 + G_ 2 + D_ 2 + G_ 2 + A_ 10 + F_ 2 + C_ 2 + F_ 2 + A# 4 + A_ 4 + F_ 2 loopchannel 0, Music_HallOfFame_branch_7fbdf @@ -68,30 +68,30 @@ Music_HallOfFame_Ch3:: ; 7fbfc (1f:7bfc) Music_HallOfFame_branch_7fbfe:: octave 4 - note D_, 2 - note G_, 2 - note D_, 2 - note G_, 2 - note D_, 2 - note G_, 2 - note D_, 2 - note G_, 2 + D_ 2 + G_ 2 + D_ 2 + G_ 2 + D_ 2 + G_ 2 + D_ 2 + G_ 2 loopchannel 12, Music_HallOfFame_branch_7fbfe - note D_, 4 - note G_, 4 - note D_, 4 - note G_, 4 - note E_, 4 - note G_, 4 - note E_, 4 - note G_, 4 - note F#, 4 - note A_, 4 - note F#, 4 - note A_, 4 - note E_, 4 - note G_, 4 - note E_, 4 - note G_, 4 + D_ 4 + G_ 4 + D_ 4 + G_ 4 + E_ 4 + G_ 4 + E_ 4 + G_ 4 + F# 4 + A_ 4 + F# 4 + A_ 4 + E_ 4 + G_ 4 + E_ 4 + G_ 4 loopchannel 0, Music_HallOfFame_Ch3 -; 0x7fc1f
\ No newline at end of file +; 0x7fc1f diff --git a/audio/music/indigoplateau.asm b/audio/music/indigoplateau.asm index e0ea6ff3..32ce02c2 100644 --- a/audio/music/indigoplateau.asm +++ b/audio/music/indigoplateau.asm @@ -1,88 +1,88 @@ Music_IndigoPlateau_Ch1:: ; a5f0 (2:65f0) - tempo 0, 132 - stereopanning 119 + tempo 132 + volume 7, 7 duty 3 vibrato 6, 3, 4 - togglecall + toggleperfectpitch notetype 12, 11, 2 octave 2 - note A_, 8 - note A_, 8 - note A_, 8 - note A_, 4 + A_ 8 + A_ 8 + A_ 8 + A_ 4 notetype 12, 10, 4 - note A#, 4 + A# 4 Music_IndigoPlateau_branch_a605:: callchannel Music_IndigoPlateau_branch_a659 notetype 12, 11, 4 octave 3 - note D_, 4 + D_ 4 callchannel Music_IndigoPlateau_branch_a659 notetype 12, 11, 4 octave 3 - note D#, 4 + D# 4 callchannel Music_IndigoPlateau_branch_a659 notetype 12, 11, 4 octave 3 - note D_, 4 + D_ 4 callchannel Music_IndigoPlateau_branch_a659 notetype 12, 10, 0 octave 2 - note A#, 4 + A# 4 callchannel Music_IndigoPlateau_branch_a659 notetype 12, 11, 4 octave 3 - note D_, 4 + D_ 4 notetype 12, 13, 4 octave 3 - note A_, 4 - note A_, 4 - note A_, 4 - note A_, 4 - note A_, 4 - note A_, 4 - note A_, 4 + A_ 4 + A_ 4 + A_ 4 + A_ 4 + A_ 4 + A_ 4 + A_ 4 notetype 12, 11, 4 octave 3 - note D#, 4 + D# 4 notetype 12, 13, 4 octave 3 - note A#, 4 - note A#, 4 - note A#, 4 - note A#, 4 - note A#, 4 - note A#, 4 - note A#, 4 + A# 4 + A# 4 + A# 4 + A# 4 + A# 4 + A# 4 + A# 4 notetype 12, 11, 4 octave 3 - note F_, 2 + F_ 2 notetype 12, 11, 4 octave 3 - note G_, 2 + G_ 2 notetype 12, 11, 0 - note A_, 8 + A_ 8 octave 2 - note A_, 8 + A_ 8 notetype 12, 11, 7 octave 3 - note F_, 8 + F_ 8 notetype 12, 4, 14 octave 2 - note A#, 8 + A# 8 loopchannel 0, Music_IndigoPlateau_branch_a605 Music_IndigoPlateau_branch_a659:: notetype 12, 11, 2 octave 2 - note A_, 4 - note A_, 4 - note A_, 4 - note A_, 4 - note A_, 4 - note A_, 4 - note A_, 4 + A_ 4 + A_ 4 + A_ 4 + A_ 4 + A_ 4 + A_ 4 + A_ 4 endchannel @@ -91,154 +91,154 @@ Music_IndigoPlateau_Ch2:: ; a664 (2:6664) vibrato 8, 2, 5 notetype 12, 12, 2 octave 3 - note D_, 8 - note D_, 8 - note D_, 8 - note D_, 4 + D_ 8 + D_ 8 + D_ 8 + D_ 4 notetype 12, 5, 10 - note D#, 4 + D# 4 Music_IndigoPlateau_branch_a673:: callchannel Music_IndigoPlateau_branch_a6af notetype 12, 12, 5 - note A_, 4 + A_ 4 callchannel Music_IndigoPlateau_branch_a6af notetype 12, 12, 5 - note A#, 4 + A# 4 callchannel Music_IndigoPlateau_branch_a6af notetype 12, 12, 5 - note A_, 4 + A_ 4 callchannel Music_IndigoPlateau_branch_a6af notetype 12, 12, 7 - note C#, 4 + C# 4 callchannel Music_IndigoPlateau_branch_a6af notetype 12, 12, 5 - note A_, 4 + A_ 4 callchannel Music_IndigoPlateau_branch_a6af notetype 12, 12, 5 - note A#, 4 + A# 4 callchannel Music_IndigoPlateau_branch_a6af notetype 12, 12, 5 octave 4 - note C_, 2 + C_ 2 notetype 12, 12, 7 octave 4 - note C#, 2 - note D_, 8 + C# 2 + D_ 8 octave 3 - note D_, 8 + D_ 8 octave 4 - note C_, 8 + C_ 8 notetype 12, 4, 13 octave 4 - note D#, 8 + D# 8 loopchannel 0, Music_IndigoPlateau_branch_a673 Music_IndigoPlateau_branch_a6af:: notetype 12, 12, 2 octave 3 - note D_, 4 - note D_, 4 - note D_, 4 - note D_, 4 - note D_, 4 - note D_, 4 - note D_, 4 + D_ 4 + D_ 4 + D_ 4 + D_ 4 + D_ 4 + D_ 4 + D_ 4 endchannel Music_IndigoPlateau_Ch3:: ; a6ba (2:66ba) notetype 12, 1, 0 octave 4 - note D_, 2 + D_ 2 rest 6 - note D_, 2 + D_ 2 rest 6 - note D_, 2 + D_ 2 rest 6 - note D_, 2 + D_ 2 rest 2 - note D#, 4 + D# 4 Music_IndigoPlateau_branch_a6c6:: callchannel Music_IndigoPlateau_branch_a6fe callchannel Music_IndigoPlateau_branch_a6fe callchannel Music_IndigoPlateau_branch_a6fe - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note F#, 4 + F# 4 callchannel Music_IndigoPlateau_branch_a6fe callchannel Music_IndigoPlateau_branch_a6fe - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note A#, 1 + A# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note A_, 8 - note D_, 8 - note A#, 8 - note D#, 8 + A_ 8 + D_ 8 + A# 8 + D# 8 loopchannel 0, Music_IndigoPlateau_branch_a6c6 Music_IndigoPlateau_branch_a6fe:: octave 4 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note D_, 2 + D_ 2 rest 2 - note A_, 4 + A_ 4 endchannel Music_IndigoPlateau_Ch4:: ; a70f (2:670f) dspeed 6 - dnote 16, mutedsnare2 - dnote 16, mutedsnare2 - dnote 16, mutedsnare2 - dnote 8, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 + mutedsnare2 16 + mutedsnare2 16 + mutedsnare2 16 + mutedsnare2 8 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 Music_IndigoPlateau_branch_a728:: callchannel Music_IndigoPlateau_branch_a791 @@ -255,68 +255,68 @@ Music_IndigoPlateau_branch_a728:: callchannel Music_IndigoPlateau_branch_a7a8 callchannel Music_IndigoPlateau_branch_a77e callchannel Music_IndigoPlateau_branch_a7a8 - dnote 16, mutedsnare2 - dnote 8, mutedsnare2 - dnote 8, mutedsnare3 - dnote 16, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare2 - dnote 1, mutedsnare2 - dnote 1, mutedsnare2 - dnote 1, mutedsnare2 + mutedsnare2 16 + mutedsnare2 8 + mutedsnare3 8 + mutedsnare2 16 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 1 + mutedsnare2 1 + mutedsnare2 1 + mutedsnare2 1 loopchannel 0, Music_IndigoPlateau_branch_a728 Music_IndigoPlateau_branch_a77e:: - dnote 4, mutedsnare2 - dnote 4, mutedsnare3 - dnote 4, mutedsnare4 - dnote 4, mutedsnare3 - dnote 4, mutedsnare2 - dnote 4, mutedsnare3 - dnote 4, mutedsnare4 - dnote 2, mutedsnare4 - dnote 2, mutedsnare3 + mutedsnare2 4 + mutedsnare3 4 + mutedsnare4 4 + mutedsnare3 4 + mutedsnare2 4 + mutedsnare3 4 + mutedsnare4 4 + mutedsnare4 2 + mutedsnare3 2 endchannel Music_IndigoPlateau_branch_a791:: - dnote 4, mutedsnare2 - dnote 4, mutedsnare3 - dnote 4, mutedsnare4 - dnote 4, mutedsnare3 - dnote 4, mutedsnare2 - dnote 4, mutedsnare3 - dnote 4, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 + mutedsnare2 4 + mutedsnare3 4 + mutedsnare4 4 + mutedsnare3 4 + mutedsnare2 4 + mutedsnare3 4 + mutedsnare4 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 endchannel Music_IndigoPlateau_branch_a7a8:: - dnote 4, mutedsnare2 - dnote 4, mutedsnare3 - dnote 4, mutedsnare2 - dnote 4, mutedsnare3 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 + mutedsnare2 4 + mutedsnare3 4 + mutedsnare2 4 + mutedsnare3 4 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 endchannel -; 0xa7c5
\ No newline at end of file +; 0xa7c5 diff --git a/audio/music/introbattle.asm b/audio/music/introbattle.asm index 81730736..d3464680 100644 --- a/audio/music/introbattle.asm +++ b/audio/music/introbattle.asm @@ -1,92 +1,92 @@ Music_IntroBattle_Ch1:: ; 7f844 (1f:7844) - tempo 0, 98 - stereopanning 119 + tempo 98 + volume 7, 7 duty 3 vibrato 6, 3, 4 - togglecall + toggleperfectpitch notetype 12, 11, 1 rest 8 octave 2 - note A_, 2 - note A_, 2 + A_ 2 + A_ 2 notetype 12, 11, 4 octave 3 - note D_, 4 + D_ 4 notetype 12, 11, 1 octave 2 - note A_, 2 - note A_, 2 + A_ 2 + A_ 2 notetype 12, 11, 4 octave 3 - note D#, 4 + D# 4 notetype 12, 11, 1 octave 2 - note A_, 2 - note A_, 2 + A_ 2 + A_ 2 notetype 12, 11, 4 octave 3 - note D_, 4 + D_ 4 notetype 12, 11, 1 octave 2 - note A_, 2 - note A_, 2 + A_ 2 + A_ 2 notetype 12, 10, 0 - note A#, 4 + A# 4 notetype 12, 11, 1 - note A_, 2 - note A_, 2 + A_ 2 + A_ 2 notetype 12, 11, 4 octave 3 - note D_, 4 + D_ 4 notetype 12, 11, 1 octave 2 - note A_, 2 - note A_, 2 + A_ 2 + A_ 2 notetype 12, 2, 9 octave 3 - note G_, 4 + G_ 4 notetype 12, 11, 0 - note A_, 8 + A_ 8 octave 2 - note A_, 8 + A_ 8 notetype 12, 11, 7 octave 3 - note F_, 8 + F_ 8 notetype 12, 4, 15 octave 2 - note F_, 8 + F_ 8 notetype 12, 11, 1 - note A_, 2 - note A_, 2 + A_ 2 + A_ 2 notetype 12, 11, 4 octave 3 - note D_, 4 + D_ 4 notetype 12, 11, 1 octave 2 - note A_, 2 - note A_, 2 + A_ 2 + A_ 2 notetype 12, 11, 4 octave 3 - note D#, 4 + D# 4 notetype 12, 11, 1 octave 2 - note A_, 2 - note A_, 2 + A_ 2 + A_ 2 notetype 12, 11, 4 octave 3 - note F_, 4 + F_ 4 notetype 12, 11, 1 octave 2 - note A_, 2 - note A_, 2 + A_ 2 + A_ 2 notetype 12, 11, 4 octave 3 - note G_, 4 + G_ 4 notetype 12, 11, 0 - note F#, 16 + F# 16 notetype 12, 11, 1 octave 4 - note D_, 16 + D_ 16 endchannel @@ -96,72 +96,72 @@ Music_IntroBattle_Ch2:: ; 7f8bc (1f:78bc) notetype 12, 12, 2 rest 8 octave 3 - note D_, 2 - note D_, 2 + D_ 2 + D_ 2 notetype 12, 12, 5 - note A_, 4 + A_ 4 notetype 12, 12, 2 - note D_, 2 - note D_, 2 + D_ 2 + D_ 2 notetype 12, 12, 5 - note A#, 4 + A# 4 notetype 12, 12, 2 - note D_, 2 - note D_, 2 + D_ 2 + D_ 2 notetype 12, 12, 5 - note A_, 4 + A_ 4 notetype 12, 12, 2 - note D_, 2 - note D_, 2 + D_ 2 + D_ 2 notetype 12, 11, 7 - note C#, 4 + C# 4 notetype 12, 12, 2 - note D_, 2 - note D_, 2 + D_ 2 + D_ 2 notetype 12, 12, 5 - note A_, 4 + A_ 4 notetype 12, 12, 2 octave 3 - note D_, 2 - note D_, 2 + D_ 2 + D_ 2 notetype 12, 12, 7 octave 4 - note C#, 4 - note D_, 8 + C# 4 + D_ 8 octave 3 - note D_, 8 + D_ 8 octave 4 - note C_, 8 + C_ 8 octave 3 - note C_, 8 + C_ 8 notetype 12, 12, 2 - note D_, 2 - note D_, 2 + D_ 2 + D_ 2 notetype 12, 12, 5 - note A_, 4 + A_ 4 notetype 12, 12, 2 - note D_, 2 - note D_, 2 + D_ 2 + D_ 2 notetype 12, 12, 5 - note A#, 4 + A# 4 notetype 12, 12, 2 - note D_, 2 - note D_, 2 + D_ 2 + D_ 2 notetype 12, 12, 5 octave 4 - note C_, 4 + C_ 4 notetype 12, 12, 2 octave 3 - note D_, 2 - note D_, 2 + D_ 2 + D_ 2 notetype 12, 12, 5 octave 4 - note C#, 4 + C# 4 notetype 12, 2, 15 - note D_, 16 + D_ 16 notetype 12, 12, 1 octave 5 - note D_, 16 + D_ 16 endchannel @@ -169,162 +169,162 @@ Music_IntroBattle_Ch3:: ; 7f91d (1f:791d) notetype 12, 1, 0 rest 8 octave 4 - note D_, 1 + D_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 4 - note D_, 1 + A_ 4 + D_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 4 - note D_, 1 + A_ 4 + D_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 4 - note D_, 1 + A_ 4 + D_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F#, 4 - note D_, 1 + F# 4 + D_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 4 - note D_, 1 + A_ 4 + D_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A#, 4 - note A_, 8 - note D_, 8 - note A#, 8 - note D_, 8 - note D_, 1 + A# 4 + A_ 8 + D_ 8 + A# 8 + D_ 8 + D_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 4 - note D_, 1 + A_ 4 + D_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 4 - note D_, 1 + A_ 4 + D_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A#, 4 - note D_, 1 + A# 4 + D_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A#, 4 - note A_, 16 - note D_, 1 + A# 4 + A_ 16 + D_ 1 rest 15 endchannel Music_IntroBattle_Ch4:: ; 7f95b (1f:795b) dspeed 6 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare2 - dnote 1, mutedsnare2 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 8, mutedsnare2 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 8, mutedsnare2 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 8, mutedsnare2 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 16, mutedsnare2 - dnote 16, mutedsnare2 - dnote 16, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare2 - dnote 1, mutedsnare2 - dnote 1, mutedsnare2 - dnote 1, mutedsnare2 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 8, mutedsnare2 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 8, mutedsnare2 - dnote 4, mutedsnare2 - dnote 8, mutedsnare2 - dnote 4, mutedsnare2 - dnote 16, mutedsnare2 - dnote 16, mutedsnare2 - dnote 2, mutedsnare2 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 1 + mutedsnare2 1 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare2 8 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare2 8 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare2 8 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 16 + mutedsnare2 16 + mutedsnare2 16 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 1 + mutedsnare2 1 + mutedsnare2 1 + mutedsnare2 1 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare2 8 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare2 8 + mutedsnare2 4 + mutedsnare2 8 + mutedsnare2 4 + mutedsnare2 16 + mutedsnare2 16 + mutedsnare2 2 rest 16 rest 14 endchannel -; 0x7fa19
\ No newline at end of file +; 0x7fa19 diff --git a/audio/music/jigglypuffsong.asm b/audio/music/jigglypuffsong.asm index b3c6fb4b..8d676150 100644 --- a/audio/music/jigglypuffsong.asm +++ b/audio/music/jigglypuffsong.asm @@ -1,23 +1,23 @@ Music_JigglypuffSong_Ch1:: ; 7fb7d (1f:7b7d) - tempo 0, 144 - stereopanning 119 + tempo 144 + volume 7, 7 vibrato 8, 2, 4 duty 2 dutycycle 165 - togglecall + toggleperfectpitch notetype 13, 6, 7 octave 4 - note E_, 8 + E_ 8 notetype 12, 6, 7 - note B_, 2 - note G#, 6 - note F#, 8 - note G#, 2 - note A_, 6 - note G#, 8 - note F#, 4 - note G#, 4 - note E_, 10 + B_ 2 + G# 6 + F# 8 + G# 2 + A_ 6 + G# 8 + F# 4 + G# 4 + E_ 10 endchannel @@ -27,15 +27,15 @@ Music_JigglypuffSong_Ch2:: ; 7fb9a (1f:7b9a) dutycycle 10 notetype 12, 10, 7 octave 4 - note E_, 8 - note B_, 2 - note G#, 6 - note F#, 8 - note G#, 2 - note A_, 6 - note G#, 8 - note F#, 4 - note G#, 4 - note E_, 10 + E_ 8 + B_ 2 + G# 6 + F# 8 + G# 2 + A_ 6 + G# 8 + F# 4 + G# 4 + E_ 10 endchannel -; 0x7fbaf
\ No newline at end of file +; 0x7fbaf diff --git a/audio/music/lavender.asm b/audio/music/lavender.asm index 318da8a8..b2d36593 100644 --- a/audio/music/lavender.asm +++ b/audio/music/lavender.asm @@ -1,8 +1,8 @@ Music_Lavender_Ch1:: ; bb58 (2:7b58) - tempo 0, 152 - stereopanning 119 + tempo 152 + volume 7, 7 duty 1 - togglecall + toggleperfectpitch vibrato 0, 8, 8 notetype 12, 8, 7 rest 16 @@ -13,48 +13,48 @@ Music_Lavender_Ch1:: ; bb58 (2:7b58) Music_Lavender_branch_bb6b:: octave 3 - note G_, 8 - note G_, 8 - note E_, 8 - note E_, 8 - note G_, 4 - note F#, 4 - note E_, 4 - note B_, 4 - note C#, 8 - note C#, 8 - note G_, 8 - note G_, 8 - note F#, 8 - note F#, 8 - note B_, 4 - note G_, 4 - note F#, 4 - note B_, 4 + G_ 8 + G_ 8 + E_ 8 + E_ 8 + G_ 4 + F# 4 + E_ 4 + B_ 4 + C# 8 + C# 8 + G_ 8 + G_ 8 + F# 8 + F# 8 + B_ 4 + G_ 4 + F# 4 + B_ 4 octave 4 - note C_, 8 - note C_, 8 + C_ 8 + C_ 8 octave 3 - note G_, 8 - note G_, 8 - note E_, 8 - note E_, 8 - note G_, 4 - note F#, 4 - note E_, 4 - note B_, 4 - note C#, 8 - note C#, 8 - note G_, 8 - note G_, 8 - note F#, 8 - note F#, 8 - note B_, 4 - note G_, 4 - note F#, 4 - note B_, 4 - note C_, 8 - note C_, 8 + G_ 8 + G_ 8 + E_ 8 + E_ 8 + G_ 4 + F# 4 + E_ 4 + B_ 4 + C# 8 + C# 8 + G_ 8 + G_ 8 + F# 8 + F# 8 + B_ 4 + G_ 4 + F# 4 + B_ 4 + C_ 8 + C_ 8 rest 16 rest 16 rest 16 @@ -69,10 +69,10 @@ Music_Lavender_Ch2:: ; bb9e (2:7b9e) Music_Lavender_branch_bba5:: octave 5 - note C_, 4 - note G_, 4 - note B_, 4 - note F#, 4 + C_ 4 + G_ 4 + B_ 4 + F# 4 loopchannel 0, Music_Lavender_branch_bba5 @@ -87,102 +87,102 @@ Music_Lavender_Ch3:: ; bbae (2:7bae) Music_Lavender_branch_bbb9:: octave 4 - note E_, 16 - note D_, 16 - note C_, 16 - note E_, 4 - note C_, 4 + E_ 16 + D_ 16 + C_ 16 + E_ 4 + C_ 4 octave 3 - note B_, 4 + B_ 4 octave 4 - note E_, 4 - note E_, 16 - note D_, 16 - note C_, 16 - note E_, 4 - note C_, 4 + E_ 4 + E_ 16 + D_ 16 + C_ 16 + E_ 4 + C_ 4 octave 3 - note B_, 4 + B_ 4 octave 4 - note E_, 4 - note E_, 16 - note D_, 16 - note C_, 16 - note E_, 4 - note C_, 4 + E_ 4 + E_ 16 + D_ 16 + C_ 16 + E_ 4 + C_ 4 octave 3 - note B_, 4 + B_ 4 octave 4 - note E_, 4 + E_ 4 notetype 12, 3, 5 octave 6 - note B_, 4 - note G_, 4 - note F#, 4 - note B_, 4 + B_ 4 + G_ 4 + F# 4 + B_ 4 notetype 12, 2, 5 - note B_, 4 - note G_, 4 - note F#, 4 - note B_, 4 + B_ 4 + G_ 4 + F# 4 + B_ 4 octave 7 - note B_, 4 - note G_, 4 - note F#, 4 - note B_, 4 + B_ 4 + G_ 4 + F# 4 + B_ 4 octave 4 - note E_, 4 - note G_, 4 - note F#, 4 - note B_, 4 - note E_, 16 - note D_, 16 - note C_, 16 - note E_, 4 - note C_, 4 + E_ 4 + G_ 4 + F# 4 + B_ 4 + E_ 16 + D_ 16 + C_ 16 + E_ 4 + C_ 4 octave 3 - note B_, 4 + B_ 4 octave 4 - note E_, 4 - note E_, 16 - note D_, 16 - note C_, 16 - note E_, 4 - note C_, 4 + E_ 4 + E_ 16 + D_ 16 + C_ 16 + E_ 4 + C_ 4 octave 3 - note B_, 4 + B_ 4 octave 4 - note E_, 4 - note E_, 16 - note D_, 16 - note C_, 16 - note E_, 4 - note C_, 4 + E_ 4 + E_ 16 + D_ 16 + C_ 16 + E_ 4 + C_ 4 octave 3 - note B_, 4 + B_ 4 octave 4 - note E_, 4 + E_ 4 notetype 12, 2, 5 octave 6 - note B_, 4 - note G_, 4 - note F#, 4 - note B_, 4 + B_ 4 + G_ 4 + F# 4 + B_ 4 octave 7 - note B_, 4 - note G_, 4 - note F#, 4 - note B_, 4 + B_ 4 + G_ 4 + F# 4 + B_ 4 octave 8 - note B_, 4 - note G_, 4 - note F#, 4 - note B_, 4 + B_ 4 + G_ 4 + F# 4 + B_ 4 octave 4 - note E_, 4 - note G_, 4 - note F#, 4 - note B_, 4 + E_ 4 + G_ 4 + F# 4 + B_ 4 loopchannel 0, Music_Lavender_branch_bbb9 @@ -194,7 +194,7 @@ Music_Lavender_Ch4:: ; bc21 (2:7c21) rest 16 Music_Lavender_branch_bc26:: - dnote 8, triangle2 - dnote 8, triangle2 + triangle2 8 + triangle2 8 loopchannel 0, Music_Lavender_branch_bc26 -; 0xbc2e
\ No newline at end of file +; 0xbc2e diff --git a/audio/music/meeteviltrainer.asm b/audio/music/meeteviltrainer.asm index 46385127..af4245ba 100644 --- a/audio/music/meeteviltrainer.asm +++ b/audio/music/meeteviltrainer.asm @@ -1,23 +1,23 @@ Music_MeetEvilTrainer_Ch1:: ; 7f69d (1f:769d) - tempo 0, 124 - stereopanning 119 + tempo 124 + volume 7, 7 duty 2 - togglecall + toggleperfectpitch notetype 12, 11, 1 rest 4 octave 3 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 notetype 12, 4, 15 - note D_, 4 + D_ 4 Music_MeetEvilTrainer_branch_7f6ae:: notetype 12, 10, 1 - note D_, 4 - note D_, 4 - note D_, 4 + D_ 4 + D_ 4 + D_ 4 notetype 12, 7, 0 - note D_, 4 + D_ 4 loopchannel 0, Music_MeetEvilTrainer_branch_7f6ae @@ -25,37 +25,37 @@ Music_MeetEvilTrainer_Ch2:: ; 7f6ba (1f:76ba) duty 1 notetype 12, 11, 6 octave 3 - note B_, 2 - note A#, 2 - note B_, 8 + B_ 2 + A# 2 + B_ 8 Music_MeetEvilTrainer_branch_7f6c2:: notetype 12, 12, 2 octave 4 - note D#, 2 - note D_, 2 - note C#, 2 - note C_, 2 + D# 2 + D_ 2 + C# 2 + C_ 2 octave 3 - note B_, 4 - note B_, 4 - note B_, 4 - note B_, 4 - note B_, 4 + B_ 4 + B_ 4 + B_ 4 + B_ 4 + B_ 4 notetype 12, 4, 15 - note A#, 4 + A# 4 notetype 12, 12, 2 - note G_, 2 - note G#, 2 - note A_, 2 - note A#, 2 - note B_, 4 - note B_, 4 - note B_, 4 - note B_, 4 - note B_, 4 + G_ 2 + G# 2 + A_ 2 + A# 2 + B_ 4 + B_ 4 + B_ 4 + B_ 4 + B_ 4 notetype 12, 3, 15 - note A#, 4 + A# 4 notetype 12, 12, 2 loopchannel 0, Music_MeetEvilTrainer_branch_7f6c2 @@ -64,18 +64,18 @@ Music_MeetEvilTrainer_Ch3:: ; 7f6e6 (1f:76e6) notetype 12, 1, 0 rest 8 octave 4 - note F#, 1 + F# 1 rest 1 - note F_, 1 + F_ 1 rest 1 Music_MeetEvilTrainer_branch_7f6ee:: - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 3 - note A#, 4 + A# 4 loopchannel 0, Music_MeetEvilTrainer_branch_7f6ee -; 0x7f6f9
\ No newline at end of file +; 0x7f6f9 diff --git a/audio/music/meetfemaletrainer.asm b/audio/music/meetfemaletrainer.asm index 1b097f58..35c6ec16 100644 --- a/audio/music/meetfemaletrainer.asm +++ b/audio/music/meetfemaletrainer.asm @@ -1,28 +1,28 @@ Music_MeetFemaleTrainer_Ch1:: ; 7f6f9 (1f:76f9) - tempo 0, 124 - stereopanning 119 + tempo 124 + volume 7, 7 duty 1 - togglecall + toggleperfectpitch notetype 12, 11, 2 octave 3 - note G#, 6 + G# 6 octave 4 - note E_, 2 - note D#, 2 - note C#, 2 - note C_, 2 + E_ 2 + D# 2 + C# 2 + C_ 2 notetype 12, 8, 1 Music_MeetFemaleTrainer_branch_7f70c:: octave 3 - note E_, 4 + E_ 4 loopchannel 12, Music_MeetFemaleTrainer_branch_7f70c - note E_, 4 + E_ 4 octave 2 - note B_, 4 - note B_, 4 + B_ 4 + B_ 4 octave 3 - note E_, 4 + E_ 4 loopchannel 0, Music_MeetFemaleTrainer_branch_7f70c @@ -30,44 +30,44 @@ Music_MeetFemaleTrainer_Ch2:: ; 7f71c (1f:771c) duty 2 notetype 12, 12, 2 octave 3 - note B_, 2 + B_ 2 notetype 12, 12, 7 octave 4 - note B_, 12 + B_ 12 Music_MeetFemaleTrainer_branch_7f726:: notetype 12, 12, 2 octave 3 - note B_, 4 + B_ 4 octave 4 - note D#, 4 - note E_, 4 - note D#, 4 - note C#, 2 - note C_, 2 + D# 4 + E_ 4 + D# 4 + C# 2 + C_ 2 octave 3 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 2 - note A#, 2 + B_ 2 + A_ 2 + G# 2 + A_ 2 + A# 2 octave 4 - note C#, 2 + C# 2 octave 3 - note B_, 4 + B_ 4 octave 4 - note C#, 4 + C# 4 octave 3 - note B_, 4 - note A_, 4 - note G#, 2 - note F#, 2 - note E_, 2 - note D#, 2 - note E_, 2 - note F#, 2 - note G#, 2 - note A_, 2 + B_ 4 + A_ 4 + G# 2 + F# 2 + E_ 2 + D# 2 + E_ 2 + F# 2 + G# 2 + A_ 2 loopchannel 0, Music_MeetFemaleTrainer_branch_7f726 @@ -75,45 +75,45 @@ Music_MeetFemaleTrainer_Ch3:: ; 7f74b (1f:774b) notetype 12, 1, 0 rest 8 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note B_, 1 + B_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 Music_MeetFemaleTrainer_branch_7f756:: callchannel Music_MeetFemaleTrainer_branch_7f770 - note G#, 1 + G# 1 rest 3 - note E_, 1 + E_ 1 rest 3 - note G#, 1 + G# 1 rest 3 - note E_, 1 + E_ 1 rest 3 callchannel Music_MeetFemaleTrainer_branch_7f770 - note G#, 1 + G# 1 rest 3 - note E_, 1 + E_ 1 rest 3 - note G#, 1 + G# 1 rest 3 - note B_, 1 + B_ 1 rest 3 loopchannel 0, Music_MeetFemaleTrainer_branch_7f756 Music_MeetFemaleTrainer_branch_7f770:: - note G#, 1 + G# 1 rest 3 - note E_, 1 + E_ 1 rest 3 - note G#, 1 + G# 1 rest 3 - note E_, 1 + E_ 1 rest 1 - note F#, 1 + F# 1 rest 1 endchannel -; 0x7f77b
\ No newline at end of file +; 0x7f77b diff --git a/audio/music/meetmaletrainer.asm b/audio/music/meetmaletrainer.asm index 3c56aca6..8a937fc3 100644 --- a/audio/music/meetmaletrainer.asm +++ b/audio/music/meetmaletrainer.asm @@ -1,34 +1,34 @@ Music_MeetMaleTrainer_Ch1:: ; 7f77b (1f:777b) - tempo 0, 112 - stereopanning 119 + tempo 112 + volume 7, 7 duty 3 vibrato 20, 3, 3 - togglecall + toggleperfectpitch notetype 12, 11, 4 octave 3 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 12 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 12 rest 16 Music_MeetMaleTrainer_branch_7f78f:: octave 3 - note B_, 4 - note A_, 4 - note G#, 2 - note F#, 2 - note E_, 2 - note D#, 2 - note F#, 4 - note E_, 6 - note F_, 2 - note F#, 4 - note G_, 8 - octave 4 - note D_, 8 - note E_, 16 + B_ 4 + A_ 4 + G# 2 + F# 2 + E_ 2 + D# 2 + F# 4 + E_ 6 + F_ 2 + F# 4 + G_ 8 + octave 4 + D_ 8 + E_ 16 loopchannel 0, Music_MeetMaleTrainer_branch_7f78f @@ -37,41 +37,41 @@ Music_MeetMaleTrainer_Ch2:: ; 7f7a2 (1f:77a2) vibrato 24, 2, 2 notetype 12, 12, 4 octave 4 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 + E_ 1 + D# 1 + D_ 1 + C# 1 octave 3 - note B_, 12 + B_ 12 rest 2 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 9 Music_MeetMaleTrainer_branch_7f7b5:: notetype 12, 12, 4 octave 4 - note E_, 6 - note D#, 6 - note C#, 4 + E_ 6 + D# 6 + C# 4 octave 3 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note B_, 2 - octave 4 - note C#, 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + G# 2 + A_ 2 + B_ 2 + octave 4 + C# 2 notetype 12, 12, 7 - note F_, 16 + F_ 16 notetype 12, 12, 5 octave 3 - note F#, 8 + F# 8 octave 4 - note C#, 8 + C# 8 loopchannel 0, Music_MeetMaleTrainer_branch_7f7b5 @@ -79,113 +79,113 @@ Music_MeetMaleTrainer_Ch3:: ; 7f7d2 (1f:77d2) notetype 12, 1, 0 rest 6 octave 4 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 3 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 3 - note B_, 1 + B_ 1 rest 3 - note E_, 1 + E_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note F#, 1 + F# 1 rest 1 Music_MeetMaleTrainer_branch_7f7ea:: - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note G_, 1 + G_ 1 rest 1 octave 5 - note D_, 1 + D_ 1 rest 1 octave 4 - note G_, 1 + G_ 1 rest 1 octave 5 - note D_, 1 + D_ 1 rest 1 octave 4 - note G_, 1 + G_ 1 rest 1 octave 5 - note D_, 1 + D_ 1 rest 1 octave 4 - note G_, 1 + G_ 1 rest 1 octave 5 - note D_, 1 + D_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 - note D#, 1 + D# 1 rest 1 loopchannel 0, Music_MeetMaleTrainer_branch_7f7ea -; 0x7f844
\ No newline at end of file +; 0x7f844 diff --git a/audio/music/meetprofoak.asm b/audio/music/meetprofoak.asm index 303dd2f7..e095557d 100644 --- a/audio/music/meetprofoak.asm +++ b/audio/music/meetprofoak.asm @@ -1,76 +1,76 @@ Music_MeetProfOak_Ch1:: ; af59 (2:6f59) - tempo 0, 112 - stereopanning 119 + tempo 112 + volume 7, 7 duty 3 - togglecall + toggleperfectpitch notetype 12, 11, 4 octave 3 - note F#, 1 - note B_, 1 + F# 1 + B_ 1 octave 4 - note D#, 1 - note E_, 1 - note F#, 12 + D# 1 + E_ 1 + F# 12 notetype 12, 10, 2 octave 3 - note E_, 6 - note B_, 10 - note E_, 6 - note B_, 10 - note E_, 6 - note D#, 4 - note F#, 2 - note F#, 4 - note E_, 6 - note D#, 4 - note F#, 2 - note F#, 4 - note E_, 6 - note B_, 10 - note E_, 6 - note B_, 10 - note E_, 6 - note D#, 4 - note F#, 2 - note F#, 4 - note E_, 6 - note D#, 4 - note F#, 2 - note F#, 4 + E_ 6 + B_ 10 + E_ 6 + B_ 10 + E_ 6 + D# 4 + F# 2 + F# 4 + E_ 6 + D# 4 + F# 2 + F# 4 + E_ 6 + B_ 10 + E_ 6 + B_ 10 + E_ 6 + D# 4 + F# 2 + F# 4 + E_ 6 + D# 4 + F# 2 + F# 4 Music_MeetProfOak_branch_af85:: - note F#, 6 - note E_, 4 - note A_, 2 - note A_, 4 - note F#, 6 - note E_, 4 - note A_, 2 - note A_, 4 - note F#, 6 - note E_, 4 - note G#, 2 - note G#, 4 - note F#, 6 - note E_, 4 - note G#, 2 - note G#, 4 - note E_, 6 - note D#, 4 - note F#, 2 - note F#, 4 - note E_, 6 - note D#, 4 - note F#, 2 - note F#, 4 - note F#, 6 - note E_, 4 - note G#, 2 - note G#, 4 - note F#, 6 - note E_, 4 - note G#, 2 - note G#, 4 + F# 6 + E_ 4 + A_ 2 + A_ 4 + F# 6 + E_ 4 + A_ 2 + A_ 4 + F# 6 + E_ 4 + G# 2 + G# 4 + F# 6 + E_ 4 + G# 2 + G# 4 + E_ 6 + D# 4 + F# 2 + F# 4 + E_ 6 + D# 4 + F# 2 + F# 4 + F# 6 + E_ 4 + G# 2 + G# 4 + F# 6 + E_ 4 + G# 2 + G# 4 loopchannel 0, Music_MeetProfOak_branch_af85 @@ -79,132 +79,132 @@ Music_MeetProfOak_Ch2:: ; afa9 (2:6fa9) duty 2 notetype 12, 12, 4 octave 3 - note B_, 1 + B_ 1 octave 4 - note D#, 1 - note F#, 1 - note A#, 1 - note B_, 12 + D# 1 + F# 1 + A# 1 + B_ 12 notetype 12, 11, 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D#, 2 - note E_, 4 - note D#, 2 - note C#, 4 + C# 2 + D# 2 + E_ 4 + D# 2 + C# 4 notetype 12, 6, 4 octave 4 - note B_, 2 + B_ 2 octave 5 - note C#, 2 - note D#, 2 - note E_, 4 - note D#, 2 - note C#, 4 + C# 2 + D# 2 + E_ 4 + D# 2 + C# 4 notetype 12, 11, 2 octave 3 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 4 - note B_, 2 - note B_, 4 + B_ 2 + A_ 2 + G# 2 + A_ 4 + B_ 2 + B_ 4 notetype 12, 8, 1 octave 4 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 4 - note B_, 2 - note B_, 4 + B_ 2 + A_ 2 + G# 2 + A_ 4 + B_ 2 + B_ 4 notetype 12, 11, 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D#, 2 - note E_, 4 - note D#, 2 - note C#, 4 + C# 2 + D# 2 + E_ 4 + D# 2 + C# 4 notetype 12, 6, 4 octave 4 - note B_, 2 + B_ 2 octave 5 - note C#, 2 - note D#, 2 - note E_, 4 - note D#, 2 - note C#, 4 + C# 2 + D# 2 + E_ 4 + D# 2 + C# 4 notetype 12, 11, 2 octave 3 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 4 - note B_, 2 - note B_, 4 + B_ 2 + A_ 2 + G# 2 + A_ 4 + B_ 2 + B_ 4 notetype 12, 8, 1 octave 4 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 4 - note B_, 2 - note B_, 4 + B_ 2 + A_ 2 + G# 2 + A_ 4 + B_ 2 + B_ 4 notetype 12, 11, 5 Music_MeetProfOak_branch_b005:: octave 4 - note C#, 6 + C# 6 octave 3 - note A_, 1 + A_ 1 octave 4 - note C#, 1 - note E_, 6 - note C#, 1 - note E_, 1 - note F#, 4 - note E_, 4 - note D#, 4 - note C#, 4 + C# 1 + E_ 6 + C# 1 + E_ 1 + F# 4 + E_ 4 + D# 4 + C# 4 octave 3 - note B_, 6 - note G#, 1 - note B_, 1 + B_ 6 + G# 1 + B_ 1 octave 4 - note E_, 8 + E_ 8 notetype 12, 6, 5 octave 4 - note B_, 6 - note G#, 1 - note B_, 1 + B_ 6 + G# 1 + B_ 1 octave 5 - note E_, 8 + E_ 8 notetype 12, 11, 5 octave 3 - note A_, 6 - note F#, 1 - note A_, 1 + A_ 6 + F# 1 + A_ 1 octave 4 - note D#, 8 - note E_, 4 - note D#, 4 - note C#, 4 - note C_, 4 + D# 8 + E_ 4 + D# 4 + C# 4 + C_ 4 octave 3 - note B_, 6 - note G#, 1 - note B_, 1 + B_ 6 + G# 1 + B_ 1 octave 4 - note E_, 6 + E_ 6 octave 3 - note B_, 1 + B_ 1 octave 4 - note E_, 1 + E_ 1 notetype 12, 11, 7 - note G#, 16 + G# 16 loopchannel 0, Music_MeetProfOak_branch_b005 @@ -212,213 +212,213 @@ Music_MeetProfOak_Ch3:: ; b03d (2:703d) notetype 12, 1, 2 rest 10 octave 4 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note B_, 1 + B_ 1 rest 5 octave 5 - note E_, 4 + E_ 4 rest 6 octave 4 - note B_, 1 + B_ 1 rest 5 octave 5 - note E_, 4 + E_ 4 octave 4 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note G#, 1 + G# 1 rest 1 Music_MeetProfOak_branch_b0bc:: octave 4 - note A_, 1 + A_ 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 loopchannel 2, Music_MeetProfOak_branch_b0bc Music_MeetProfOak_branch_b0d8:: octave 4 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 loopchannel 2, Music_MeetProfOak_branch_b0d8 Music_MeetProfOak_branch_b0ed:: - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 loopchannel 2, Music_MeetProfOak_branch_b0ed Music_MeetProfOak_branch_b101:: - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 loopchannel 2, Music_MeetProfOak_branch_b101 loopchannel 0, Music_MeetProfOak_branch_b0bc -; 0xb119
\ No newline at end of file +; 0xb119 diff --git a/audio/music/meetrival.asm b/audio/music/meetrival.asm index 1e45ba42..fb138e61 100644 --- a/audio/music/meetrival.asm +++ b/audio/music/meetrival.asm @@ -1,145 +1,145 @@ Music_MeetRival_branch_b119:: - tempo 0, 100 + tempo 100 loopchannel 0, Music_MeetRival_branch_b123 Music_MeetRival_Ch1:: ; b120 (2:7120) - tempo 0, 112 + tempo 112 Music_MeetRival_branch_b123:: - stereopanning 119 + volume 7, 7 duty 3 vibrato 6, 3, 4 - togglecall + toggleperfectpitch notetype 12, 11, 3 octave 4 - note D_, 1 - note C#, 1 - note C_, 1 + D_ 1 + C# 1 + C_ 1 octave 3 - note B_, 1 - note A#, 2 - note A_, 1 - note G#, 1 - note G_, 1 - note F#, 1 - note F_, 6 - note D_, 1 + B_ 1 + A# 2 + A_ 1 + G# 1 + G_ 1 + F# 1 + F_ 6 + D_ 1 rest 3 - note D_, 1 + D_ 1 rest 5 - note A_, 2 - note G_, 2 - note A_, 2 + A_ 2 + G_ 2 + A_ 2 Music_MeetRival_branch_b140:: - note B_, 4 - note A#, 2 - note A_, 4 - note G_, 2 + B_ 4 + A# 2 + A_ 4 + G_ 2 octave 4 - note C_, 4 - note D_, 2 + C_ 4 + D_ 2 rest 4 - note D_, 4 - note C#, 2 - note C_, 2 + D_ 4 + C# 2 + C_ 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note C_, 4 - note E_, 2 - note D_, 4 - note C_, 2 + C_ 4 + E_ 2 + D_ 4 + C_ 2 octave 3 - note B_, 4 + B_ 4 octave 4 - note C_, 2 + C_ 2 rest 4 - note G_, 4 - note G_, 2 - note F#, 2 - note E_, 2 - note D_, 2 - note F#, 2 + G_ 4 + G_ 2 + F# 2 + E_ 2 + D_ 2 + F# 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note D_, 2 - note F#, 2 + D_ 2 + F# 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note D_, 2 + D_ 2 octave 3 - note D_, 2 + D_ 2 octave 4 - note D_, 2 + D_ 2 rest 2 octave 3 - note D_, 2 + D_ 2 octave 4 - note C_, 4 + C_ 4 octave 3 - note B_, 2 - note A#, 2 - note B_, 2 + B_ 2 + A# 2 + B_ 2 octave 4 - note C_, 2 - note F_, 2 + C_ 2 + F_ 2 octave 3 - note G_, 2 + G_ 2 octave 4 - note C_, 2 - note F_, 2 - note D#, 2 - note C_, 2 + C_ 2 + F_ 2 + D# 2 + C_ 2 octave 3 - note A#, 2 - note G_, 2 + A# 2 + G_ 2 rest 4 - note A#, 4 + A# 4 octave 4 - note C_, 2 + C_ 2 octave 3 - note A#, 2 + A# 2 octave 4 - note C_, 2 + C_ 2 notetype 12, 11, 7 octave 3 - note G_, 4 - note D_, 2 - note F_, 6 - note F#, 4 - note D_, 2 + G_ 4 + D_ 2 + F_ 6 + F# 4 + D_ 2 rest 4 - note D_, 4 + D_ 4 notetype 12, 11, 3 - note A_, 2 - note G_, 2 - note A_, 2 + A_ 2 + G_ 2 + A_ 2 loopchannel 0, Music_MeetRival_branch_b140 Music_MeetRival_branch_b19b:: - tempo 0, 100 + tempo 100 loopchannel 0, Music_MeetRival_branch_b1a5 Music_MeetRival_branch_b1a2:: - tempo 0, 112 + tempo 112 Music_MeetRival_branch_b1a5:: - stereopanning 119 + volume 7, 7 duty 3 vibrato 6, 3, 4 - togglecall + toggleperfectpitch notetype 12, 11, 3 octave 3 - note D_, 1 + D_ 1 rest 3 - note D_, 1 + D_ 1 rest 5 - note A_, 2 - note G_, 2 - note A_, 2 + A_ 2 + G_ 2 + A_ 2 loopchannel 0, Music_MeetRival_branch_b140 @@ -148,86 +148,86 @@ Music_MeetRival_Ch2:: ; b1bb (2:71bb) vibrato 10, 2, 6 notetype 12, 12, 7 octave 4 - note B_, 1 - note A#, 1 - note A_, 1 - note G#, 1 - note G_, 2 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 6 + B_ 1 + A# 1 + A_ 1 + G# 1 + G_ 2 + F# 1 + F_ 1 + E_ 1 + D# 1 + D_ 6 octave 3 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note D_, 1 + D_ 1 rest 1 octave 4 - note D_, 2 - note F_, 2 - note F#, 2 + D_ 2 + F_ 2 + F# 2 Music_MeetRival_branch_b1d8:: notetype 12, 12, 7 - note G_, 4 - note D_, 2 - note F_, 6 - note F#, 4 - note G_, 2 + G_ 4 + D_ 2 + F_ 6 + F# 4 + G_ 2 rest 4 - note G_, 4 - note G_, 2 - note A#, 2 - note B_, 2 + G_ 4 + G_ 2 + A# 2 + B_ 2 octave 5 - note C_, 4 + C_ 4 octave 4 - note G_, 2 - note A#, 6 - note B_, 4 + G_ 2 + A# 6 + B_ 4 octave 5 - note C_, 2 + C_ 2 rest 4 - note C_, 4 - note C_, 2 + C_ 4 + C_ 2 octave 4 - note B_, 2 + B_ 2 octave 5 - note C_, 2 + C_ 2 notetype 12, 11, 0 - note D_, 16 + D_ 16 notetype 12, 11, 5 - note D_, 6 + D_ 6 notetype 12, 12, 7 - note F_, 4 - note D_, 2 - note C_, 2 - note D_, 2 + F_ 4 + D_ 2 + C_ 2 + D_ 2 notetype 12, 11, 0 - note C_, 8 + C_ 8 notetype 12, 12, 7 - note C_, 8 + C_ 8 octave 4 - note C_, 2 + C_ 2 rest 4 - note A#, 4 - note G_, 2 - note F_, 2 + A# 4 + G_ 2 + F_ 2 notetype 12, 11, 0 - note G_, 16 + G_ 16 notetype 12, 11, 3 - note G_, 2 + G_ 2 octave 3 - note G_, 2 + G_ 2 rest 4 - note G_, 4 + G_ 4 octave 4 - note D_, 2 - note F_, 2 - note F#, 2 + D_ 2 + F_ 2 + F# 2 loopchannel 0, Music_MeetRival_branch_b1d8 Music_MeetRival_branch_b21d:: @@ -235,163 +235,163 @@ Music_MeetRival_branch_b21d:: vibrato 10, 2, 6 notetype 12, 12, 7 octave 3 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note D_, 1 + D_ 1 rest 1 octave 4 - note D_, 2 - note F_, 2 - note F#, 2 + D_ 2 + F_ 2 + F# 2 loopchannel 0, Music_MeetRival_branch_b1d8 Music_MeetRival_Ch3:: ; b233 (2:7233) notetype 12, 1, 4 octave 5 - note D_, 2 + D_ 2 rest 2 - note C#, 2 + C# 2 rest 2 - note C_, 2 + C_ 2 rest 2 octave 4 - note B_, 2 + B_ 2 rest 2 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 Music_MeetRival_branch_b24b:: - note G_, 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 rest 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 rest 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 rest 4 octave 5 - note D_, 4 + D_ 4 octave 4 - note G_, 2 - note A#, 2 - note B_, 2 - note G_, 2 + G_ 2 + A# 2 + B_ 2 + G_ 2 octave 5 - note C_, 2 + C_ 2 octave 4 - note G_, 2 + G_ 2 rest 2 octave 5 - note C_, 2 + C_ 2 octave 4 - note G_, 2 + G_ 2 rest 2 - note B_, 2 + B_ 2 octave 5 - note C_, 2 + C_ 2 rest 4 - note C_, 4 - note C_, 2 + C_ 4 + C_ 2 octave 4 - note B_, 2 - note A_, 2 - note F#, 2 - note A_, 2 + B_ 2 + A_ 2 + F# 2 + A_ 2 rest 2 - note F#, 2 - note A_, 2 - note F#, 2 + F# 2 + A_ 2 + F# 2 rest 2 - note A_, 2 - note F#, 2 - note A_, 2 + A_ 2 + F# 2 + A_ 2 rest 2 - note F#, 2 - note A_, 2 - note F#, 2 + F# 2 + A_ 2 + F# 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note A_, 2 - note E_, 2 + A_ 2 + E_ 2 octave 5 - note C_, 2 + C_ 2 rest 2 octave 4 - note E_, 2 + E_ 2 octave 5 - note C_, 2 + C_ 2 octave 4 - note E_, 2 - note F_, 2 - note G_, 2 - note E_, 2 + E_ 2 + F_ 2 + G_ 2 + E_ 2 rest 4 - note E_, 2 + E_ 2 octave 5 - note C_, 2 + C_ 2 octave 4 - note B_, 2 - note A#, 2 - note A_, 2 - note G_, 2 - note A#, 2 + B_ 2 + A# 2 + A_ 2 + G_ 2 + A# 2 rest 2 - note G_, 2 - note A#, 2 - note G_, 2 + G_ 2 + A# 2 + G_ 2 rest 2 - note A#, 2 - note G_, 2 + A# 2 + G_ 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 rest 2 octave 5 - note D_, 2 + D_ 2 octave 4 - note G_, 2 + G_ 2 rest 2 octave 5 - note D_, 2 + D_ 2 loopchannel 0, Music_MeetRival_branch_b24b Music_MeetRival_branch_b2b5:: notetype 12, 1, 4 octave 4 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 loopchannel 0, Music_MeetRival_branch_b24b -; 0xb2c8
\ No newline at end of file +; 0xb2c8 diff --git a/audio/music/museumguy.asm b/audio/music/museumguy.asm index 0f3b266f..533ac343 100644 --- a/audio/music/museumguy.asm +++ b/audio/music/museumguy.asm @@ -1,56 +1,56 @@ Music_MuseumGuy_Ch1:: ; adae (2:6dae) - tempo 0, 128 - stereopanning 119 + tempo 128 + volume 7, 7 duty 2 - togglecall + toggleperfectpitch notetype 12, 11, 1 octave 3 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note D#, 2 + B_ 2 + A_ 2 + G# 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + D# 2 octave 2 - note B_, 4 - note B_, 1 + B_ 4 + B_ 1 octave 3 - note D#, 1 - note E_, 1 - note G#, 1 - note B_, 10 + D# 1 + E_ 1 + G# 1 + B_ 10 callchannel Music_MuseumGuy_branch_ade7 callchannel Music_MuseumGuy_branch_adec callchannel Music_MuseumGuy_branch_ade7 - note E_, 4 - note E_, 4 - note E_, 2 - note E_, 6 + E_ 4 + E_ 4 + E_ 2 + E_ 6 Music_MuseumGuy_branch_add6:: callchannel Music_MuseumGuy_branch_ade7 callchannel Music_MuseumGuy_branch_adec callchannel Music_MuseumGuy_branch_ade7 - note E_, 4 - note E_, 4 - note E_, 2 - note E_, 6 + E_ 4 + E_ 4 + E_ 2 + E_ 6 loopchannel 0, Music_MuseumGuy_branch_add6 Music_MuseumGuy_branch_ade7:: - note E_, 2 - note E_, 6 - note F#, 2 - note F#, 6 + E_ 2 + E_ 6 + F# 2 + F# 6 endchannel Music_MuseumGuy_branch_adec:: - note E_, 2 - note E_, 6 - note D_, 2 - note D_, 6 + E_ 2 + E_ 6 + D_ 2 + D_ 6 endchannel @@ -58,110 +58,110 @@ Music_MuseumGuy_Ch2:: ; adf1 (2:6df1) duty 2 notetype 12, 12, 1 octave 4 - note E_, 2 - note D_, 2 - note C#, 2 - note D_, 2 - note C#, 2 + E_ 2 + D_ 2 + C# 2 + D_ 2 + C# 2 octave 3 - note B_, 2 - note A_, 2 - note G#, 2 - note E_, 4 - note E_, 1 - note G#, 1 - note B_, 1 + B_ 2 + A_ 2 + G# 2 + E_ 4 + E_ 1 + G# 1 + B_ 1 octave 4 - note D#, 1 - note E_, 8 + D# 1 + E_ 8 octave 3 - note A_, 2 + A_ 2 octave 4 - note C#, 2 - note E_, 4 - note D_, 2 - note F#, 2 - note A_, 4 + C# 2 + E_ 4 + D_ 2 + F# 2 + A_ 4 octave 3 - note A_, 2 + A_ 2 octave 4 - note C#, 2 - note E_, 4 - note D_, 2 - note C#, 2 + C# 2 + E_ 4 + D_ 2 + C# 2 octave 3 - note B_, 4 - note A_, 2 + B_ 4 + A_ 2 octave 4 - note C#, 2 - note E_, 4 - note D_, 2 - note F#, 2 - note A_, 2 - note A_, 2 - note G#, 2 - note E_, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note A_, 2 - note A_, 4 + C# 2 + E_ 4 + D_ 2 + F# 2 + A_ 2 + A_ 2 + G# 2 + E_ 2 + F# 2 + G# 2 + A_ 2 + A_ 2 + A_ 4 Music_MuseumGuy_branch_ae26:: octave 3 - note A_, 2 + A_ 2 octave 4 - note C#, 2 - note E_, 3 + C# 2 + E_ 3 notetype 12, 8, 1 - note E_, 1 + E_ 1 notetype 12, 12, 1 - note D_, 2 - note F#, 2 - note A_, 3 + D_ 2 + F# 2 + A_ 3 notetype 12, 9, 1 - note A_, 1 + A_ 1 notetype 12, 12, 1 octave 3 - note A_, 2 + A_ 2 octave 4 - note C#, 2 - note E_, 4 - note D_, 1 - note C#, 1 - note C_, 1 + C# 2 + E_ 4 + D_ 1 + C# 1 + C_ 1 octave 3 - note B_, 1 - note B_, 3 + B_ 1 + B_ 3 notetype 12, 10, 1 - note G#, 1 + G# 1 notetype 12, 12, 1 - note A_, 2 + A_ 2 octave 4 - note C#, 2 - note E_, 3 + C# 2 + E_ 3 notetype 12, 9, 1 - note E_, 1 + E_ 1 notetype 12, 12, 1 - note D_, 2 - note F#, 2 - note A_, 3 + D_ 2 + F# 2 + A_ 3 notetype 12, 8, 1 - note A_, 1 + A_ 1 notetype 12, 12, 1 - note G#, 2 - note E_, 1 + G# 2 + E_ 1 notetype 12, 8, 1 - note E_, 1 + E_ 1 notetype 12, 12, 1 - note F#, 2 + F# 2 notetype 12, 8, 1 - note F#, 1 + F# 1 notetype 12, 12, 1 - note G#, 1 - note A_, 2 - note A_, 2 - note A_, 4 + G# 1 + A_ 2 + A_ 2 + A_ 4 loopchannel 0, Music_MuseumGuy_branch_ae26 @@ -169,95 +169,95 @@ Music_MuseumGuy_Ch3:: ; ae6e (2:6e6e) notetype 12, 1, 0 rest 16 octave 4 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 9 callchannel Music_MuseumGuy_branch_aeb8 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 5 - note G#, 1 + G# 1 rest 1 - note G#, 1 + G# 1 rest 5 callchannel Music_MuseumGuy_branch_aeb8 - note B_, 1 + B_ 1 rest 3 - note G#, 1 + G# 1 rest 3 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 3 Music_MuseumGuy_branch_ae8e:: callchannel Music_MuseumGuy_branch_aec1 rest 3 octave 6 - note E_, 1 + E_ 1 rest 1 octave 5 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 3 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note G#, 1 + G# 1 rest 3 callchannel Music_MuseumGuy_branch_aec1 rest 1 octave 6 - note E_, 1 + E_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 octave 5 - note B_, 1 + B_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note G#, 1 + G# 1 rest 3 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 3 loopchannel 0, Music_MuseumGuy_branch_ae8e Music_MuseumGuy_branch_aeb8:: - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 5 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 5 endchannel Music_MuseumGuy_branch_aec1:: octave 6 - note C#, 1 + C# 1 rest 1 octave 5 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 3 octave 6 - note F#, 1 + F# 1 rest 1 octave 5 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 endchannel @@ -270,69 +270,69 @@ Music_MuseumGuy_Ch4:: ; aed1 (2:6ed1) rest 16 rest 14 dspeed 6 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 Music_MuseumGuy_branch_aee1:: - dnote 4, mutedsnare2 - dnote 6, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 6, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 4, mutedsnare2 - dnote 6, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 6, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 2, mutedsnare2 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 6, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 + mutedsnare2 4 + mutedsnare2 6 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare2 2 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare2 6 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare2 4 + mutedsnare2 6 + mutedsnare2 2 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 6 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare2 2 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare2 2 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare2 2 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 6 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 loopchannel 0, Music_MuseumGuy_branch_aee1 -; 0xaf59
\ No newline at end of file +; 0xaf59 diff --git a/audio/music/oakslab.asm b/audio/music/oakslab.asm index f7302471..51c6cbf6 100644 --- a/audio/music/oakslab.asm +++ b/audio/music/oakslab.asm @@ -1,71 +1,71 @@ Music_OaksLab_Ch1:: ; 7eeb9 (1f:6eb9) - tempo 0, 140 - stereopanning 119 + tempo 140 + volume 7, 7 duty 3 vibrato 16, 1, 2 - togglecall + toggleperfectpitch notetype 12, 11, 3 octave 2 - note B_, 1 + B_ 1 octave 3 - note C#, 1 - note D_, 1 - note E_, 1 - note F#, 1 - note G#, 1 - note A_, 1 - note B_, 1 + C# 1 + D_ 1 + E_ 1 + F# 1 + G# 1 + A_ 1 + B_ 1 Music_OaksLab_branch_7eed0:: octave 4 - note C#, 4 + C# 4 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note A_, 4 - note G#, 2 - note A_, 2 - note B_, 1 + A_ 4 + G# 2 + A_ 2 + B_ 1 rest 3 - note A_, 6 - note G#, 1 - note B_, 1 + A_ 6 + G# 1 + B_ 1 octave 4 - note C#, 4 + C# 4 octave 3 - note A_, 4 - note G#, 2 - note A_, 2 - note F#, 4 - note E_, 2 - note F#, 2 - note G#, 1 + A_ 4 + G# 2 + A_ 2 + F# 4 + E_ 2 + F# 2 + G# 1 rest 3 - note F#, 8 - note E_, 4 - note A_, 6 - note E_, 1 - note A_, 1 + F# 8 + E_ 4 + A_ 6 + E_ 1 + A_ 1 octave 4 - note D_, 8 - note C#, 6 + D_ 8 + C# 6 octave 3 - note A_, 1 + A_ 1 octave 4 - note C#, 1 - note E_, 8 - note D_, 4 - note C#, 4 + C# 1 + E_ 8 + D_ 4 + C# 4 octave 3 - note B_, 4 - note A_, 4 - note G#, 1 + B_ 4 + A_ 4 + G# 1 rest 3 - note E_, 4 - note F#, 4 - note G#, 4 + E_ 4 + F# 4 + G# 4 loopchannel 0, Music_OaksLab_branch_7eed0 @@ -74,72 +74,72 @@ Music_OaksLab_Ch2:: ; 7ef05 (1f:6f05) vibrato 10, 2, 5 notetype 12, 12, 4 octave 3 - note G#, 1 - note A_, 1 - note B_, 1 + G# 1 + A_ 1 + B_ 1 octave 4 - note C#, 1 - note D_, 1 - note E_, 1 - note F#, 1 - note G#, 1 + C# 1 + D_ 1 + E_ 1 + F# 1 + G# 1 Music_OaksLab_branch_7ef16:: - note A_, 6 - note G#, 1 - note F#, 1 - note E_, 6 - note D#, 1 - note E_, 1 - note F#, 1 + A_ 6 + G# 1 + F# 1 + E_ 6 + D# 1 + E_ 1 + F# 1 rest 3 - note E_, 8 - note E_, 4 - note F#, 6 - note E_, 1 - note D_, 1 - note C#, 6 + E_ 8 + E_ 4 + F# 6 + E_ 1 + D_ 1 + C# 6 octave 3 - note B_, 1 + B_ 1 octave 4 - note C#, 1 - note D_, 1 + C# 1 + D_ 1 rest 3 - note C#, 8 - note C#, 4 - note D_, 6 + C# 8 + C# 4 + D_ 6 octave 3 - note A_, 1 + A_ 1 octave 4 - note D_, 1 - note F#, 8 - note E_, 6 - note C#, 1 - note E_, 1 - note A_, 8 - note G#, 4 - note A_, 2 - note G#, 2 - note F#, 4 - note G#, 2 - note F#, 2 - note E_, 1 + D_ 1 + F# 8 + E_ 6 + C# 1 + E_ 1 + A_ 8 + G# 4 + A_ 2 + G# 2 + F# 4 + G# 2 + F# 2 + E_ 1 rest 1 octave 3 - note G#, 1 + G# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 4 - note C#, 1 + C# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note F#, 1 + F# 1 rest 1 loopchannel 0, Music_OaksLab_branch_7ef16 @@ -148,247 +148,247 @@ Music_OaksLab_Ch3:: ; 7ef52 (1f:6f52) notetype 12, 1, 1 rest 2 octave 4 - note G#, 1 + G# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 1 Music_OaksLab_branch_7ef5c:: - note C#, 1 + C# 1 rest 1 - note A_, 1 + A_ 1 rest 3 - note A_, 1 + A_ 1 rest 3 - note A_, 1 + A_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note A_, 1 + A_ 1 rest 3 - note A_, 1 + A_ 1 rest 3 - note A_, 1 + A_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 3 - note A_, 1 + A_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 1 - note C#, 1 + C# 1 rest 1 - note F#, 1 + F# 1 rest 1 octave 3 - note A_, 1 + A_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 1 - note C#, 1 + C# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note A_, 1 + A_ 1 rest 3 - note A_, 1 + A_ 1 rest 3 - note A_, 1 + A_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 3 - note G#, 1 + G# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 5 - note G#, 1 + G# 1 rest 3 - note F#, 1 + F# 1 rest 3 - note E_, 1 + E_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 3 - note A_, 1 + A_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note A_, 1 + A_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note A_, 1 + A_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 - note C#, 1 + C# 1 rest 1 - note F#, 1 + F# 1 rest 1 octave 3 - note A_, 1 + A_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note A_, 1 + A_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 3 - note A_, 1 + A_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 - note C#, 1 + C# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 3 - note G#, 1 + G# 1 rest 3 - note F#, 1 + F# 1 rest 3 - note E_, 1 + E_ 1 rest 3 loopchannel 0, Music_OaksLab_branch_7ef5c -; 0x7f04a
\ No newline at end of file +; 0x7f04a diff --git a/audio/music/pallettown.asm b/audio/music/pallettown.asm index 15162c3a..71be9eb1 100644 --- a/audio/music/pallettown.asm +++ b/audio/music/pallettown.asm @@ -1,149 +1,149 @@ Music_PalletTown_Ch1:: ; a7c5 (2:67c5) - tempo 0, 160 - stereopanning 119 + tempo 160 + volume 7, 7 duty 2 notetype 12, 12, 3 Music_PalletTown_branch_a7ce:: octave 3 - note B_, 4 + B_ 4 octave 4 - note C_, 2 - note D_, 4 - note G_, 2 - note D_, 2 - note C_, 2 + C_ 2 + D_ 4 + G_ 2 + D_ 2 + C_ 2 octave 3 - note B_, 4 - note G_, 2 + B_ 4 + G_ 2 octave 4 - note D_, 4 - note D_, 2 - note C_, 2 + D_ 4 + D_ 2 + C_ 2 octave 3 - note B_, 2 + B_ 2 rest 2 - note B_, 2 + B_ 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note C_, 8 + C_ 8 rest 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note A_, 2 - note B_, 2 - note G_, 2 - note A_, 2 - note F#, 2 - note B_, 4 + A_ 2 + B_ 2 + G_ 2 + A_ 2 + F# 2 + B_ 4 octave 4 - note C_, 2 - note D_, 4 - note G_, 2 - note D_, 2 - note C_, 2 + C_ 2 + D_ 4 + G_ 2 + D_ 2 + C_ 2 octave 3 - note B_, 4 - note G_, 2 + B_ 4 + G_ 2 octave 4 - note D_, 4 - note D_, 2 - note G_, 2 - note F#, 2 - note E_, 4 - note D_, 2 - note C_, 4 + D_ 4 + D_ 2 + G_ 2 + F# 2 + E_ 4 + D_ 2 + C_ 4 octave 3 - note A_, 2 - note B_, 2 + A_ 2 + B_ 2 octave 4 - note C_, 2 - note D_, 2 - note C_, 2 + C_ 2 + D_ 2 + C_ 2 octave 3 - note B_, 2 - note A_, 2 - note G_, 4 - note F#, 4 + B_ 2 + A_ 2 + G_ 4 + F# 4 octave 4 - note C_, 2 + C_ 2 octave 3 - note G_, 2 - note E_, 2 - note G_, 2 + G_ 2 + E_ 2 + G_ 2 octave 4 - note D_, 2 + D_ 2 octave 3 - note A_, 2 - note F#, 2 - note A_, 2 + A_ 2 + F# 2 + A_ 2 notetype 12, 11, 3 - note B_, 2 - note G_, 2 - note D_, 2 - note G_, 2 - note B_, 2 - note G_, 2 - note D_, 2 - note G_, 2 + B_ 2 + G_ 2 + D_ 2 + G_ 2 + B_ 2 + G_ 2 + D_ 2 + G_ 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note G_, 2 - note E_, 2 - note G_, 2 + G_ 2 + E_ 2 + G_ 2 octave 4 - note D_, 2 + D_ 2 octave 3 - note A_, 2 - note F#, 2 - note A_, 2 - note B_, 2 - note G_, 2 - note D_, 2 - note G_, 2 - note B_, 2 - note G_, 2 - note D_, 2 - note G_, 2 - note A_, 2 - note E_, 2 - note C_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note C_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note C_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note C_, 2 - note E_, 2 - note F#, 2 - note D_, 2 - note C_, 2 - note D_, 2 - note G_, 2 - note E_, 2 - note C_, 2 - note E_, 2 - note G_, 2 - note E_, 2 - note C_, 2 - note E_, 2 - note F#, 2 - note D_, 2 - note C_, 2 - note D_, 2 + A_ 2 + F# 2 + A_ 2 + B_ 2 + G_ 2 + D_ 2 + G_ 2 + B_ 2 + G_ 2 + D_ 2 + G_ 2 + A_ 2 + E_ 2 + C_ 2 + E_ 2 + A_ 2 + E_ 2 + C_ 2 + E_ 2 + A_ 2 + E_ 2 + C_ 2 + E_ 2 + A_ 2 + E_ 2 + C_ 2 + E_ 2 + F# 2 + D_ 2 + C_ 2 + D_ 2 + G_ 2 + E_ 2 + C_ 2 + E_ 2 + G_ 2 + E_ 2 + C_ 2 + E_ 2 + F# 2 + D_ 2 + C_ 2 + D_ 2 loopchannel 0, Music_PalletTown_branch_a7ce endchannel @@ -154,110 +154,110 @@ Music_PalletTown_Ch2:: ; a85f (2:685f) Music_PalletTown_branch_a861:: notetype 12, 13, 3 octave 5 - note D_, 2 + D_ 2 notetype 12, 10, 3 - note C_, 2 + C_ 2 notetype 12, 13, 3 octave 4 - note B_, 2 + B_ 2 notetype 12, 11, 3 - note A_, 2 + A_ 2 notetype 12, 13, 3 octave 5 - note G_, 2 + G_ 2 notetype 12, 11, 3 - note E_, 2 + E_ 2 notetype 12, 13, 3 - note F#, 2 - note E_, 2 - note D_, 6 + F# 2 + E_ 2 + D_ 6 octave 4 - note B_, 2 - note G_, 2 - note G_, 2 - note A_, 2 - note B_, 2 + B_ 2 + G_ 2 + G_ 2 + A_ 2 + B_ 2 octave 5 - note C_, 10 + C_ 10 octave 4 - note F#, 2 - note G_, 2 - note A_, 2 - note B_, 6 + F# 2 + G_ 2 + A_ 2 + B_ 6 octave 5 - note C_, 1 + C_ 1 octave 4 - note B_, 1 - note A_, 8 + B_ 1 + A_ 8 octave 5 - note D_, 2 + D_ 2 notetype 12, 10, 3 - note C_, 2 + C_ 2 notetype 12, 13, 3 octave 4 - note B_, 2 + B_ 2 notetype 12, 11, 3 octave 5 - note D_, 2 + D_ 2 notetype 12, 13, 3 - note G_, 2 + G_ 2 notetype 12, 10, 3 - note F#, 2 + F# 2 notetype 12, 11, 3 - note F#, 2 + F# 2 notetype 12, 13, 3 - note G_, 2 - note E_, 6 - note D_, 2 - note D_, 8 - note C_, 2 + G_ 2 + E_ 6 + D_ 2 + D_ 8 + C_ 2 octave 4 - note B_, 2 - note A_, 2 - note G_, 2 + B_ 2 + A_ 2 + G_ 2 octave 5 - note D_, 2 - note C_, 2 + D_ 2 + C_ 2 octave 4 - note B_, 2 - note A_, 2 - note G_, 10 - note G_, 2 - note A_, 2 - note B_, 2 + B_ 2 + A_ 2 + G_ 10 + G_ 2 + A_ 2 + B_ 2 octave 5 - note C_, 8 - note D_, 6 - note C_, 2 + C_ 8 + D_ 6 + C_ 2 octave 4 - note B_, 8 + B_ 8 rest 2 - note G_, 2 - note A_, 2 - note B_, 2 + G_ 2 + A_ 2 + B_ 2 octave 5 - note C_, 4 - note C_, 4 - note D_, 6 - note C_, 1 - note D_, 1 + C_ 4 + C_ 4 + D_ 6 + C_ 1 + D_ 1 octave 4 - note B_, 8 + B_ 8 rest 2 - note B_, 2 - note A_, 2 - note G_, 2 - note A_, 8 - note E_, 4 - note B_, 4 - note A_, 8 - note G_, 4 - note E_, 4 - note F#, 8 - note G_, 4 - note B_, 4 - note B_, 8 - note A_, 8 + B_ 2 + A_ 2 + G_ 2 + A_ 8 + E_ 4 + B_ 4 + A_ 8 + G_ 4 + E_ 4 + F# 8 + G_ 4 + B_ 4 + B_ 8 + A_ 8 loopchannel 0, Music_PalletTown_branch_a861 endchannel @@ -268,48 +268,48 @@ Music_PalletTown_Ch3:: ; a8de (2:68de) Music_PalletTown_branch_a8e3:: octave 4 - note G_, 6 - note E_, 6 - note F#, 4 - note G_, 6 - note A_, 6 - note G_, 4 - note E_, 6 - note F#, 6 - note E_, 4 - note G_, 6 - note E_, 6 - note D_, 4 - note G_, 6 - note E_, 6 - note F#, 4 - note G_, 6 - note A_, 6 - note G_, 4 - note E_, 6 - note F#, 6 - note A_, 4 - note G_, 6 - note E_, 6 - note D_, 4 - note C_, 8 - note D_, 8 - note G_, 8 - note E_, 4 - note D_, 4 - note C_, 8 - note D_, 8 - note G_, 8 - note A_, 4 - note G_, 4 - note E_, 8 - note A_, 8 - note E_, 8 - note G_, 8 - note F#, 8 - note E_, 8 - note E_, 8 - note F#, 8 + G_ 6 + E_ 6 + F# 4 + G_ 6 + A_ 6 + G_ 4 + E_ 6 + F# 6 + E_ 4 + G_ 6 + E_ 6 + D_ 4 + G_ 6 + E_ 6 + F# 4 + G_ 6 + A_ 6 + G_ 4 + E_ 6 + F# 6 + A_ 4 + G_ 6 + E_ 6 + D_ 4 + C_ 8 + D_ 8 + G_ 8 + E_ 4 + D_ 4 + C_ 8 + D_ 8 + G_ 8 + A_ 4 + G_ 4 + E_ 8 + A_ 8 + E_ 8 + G_ 8 + F# 8 + E_ 8 + E_ 8 + F# 8 loopchannel 0, Music_PalletTown_branch_a8e3 endchannel -; 0xa913
\ No newline at end of file +; 0xa913 diff --git a/audio/music/pkmnhealed.asm b/audio/music/pkmnhealed.asm index 9a16b435..24247326 100644 --- a/audio/music/pkmnhealed.asm +++ b/audio/music/pkmnhealed.asm @@ -1,21 +1,21 @@ Music_PkmnHealed_Ch1:: ; 9ba3 (2:5ba3) - tempo 0, 144 - stereopanning 119 + tempo 144 + volume 7, 7 duty 2 - togglecall + toggleperfectpitch notetype 12, 8, 1 rest 2 pitchbend 0, 75 - note B_, 2 + B_ 2 pitchbend 0, 84 - note B_, 2 + B_ 2 pitchbend 0, 68 - note E_, 2 + E_ 2 rest 4 pitchbend 0, 59 - note E_, 4 + E_ 4 pitchbend 0, 75 - note B_, 4 + B_ 4 endchannel @@ -23,26 +23,26 @@ Music_PkmnHealed_Ch2:: ; 9bc4 (2:5bc4) duty 2 notetype 12, 12, 3 octave 4 - note B_, 4 - note B_, 4 - note B_, 2 - note G#, 2 + B_ 4 + B_ 4 + B_ 2 + G# 2 notetype 12, 12, 4 octave 5 - note E_, 8 + E_ 8 endchannel Music_PkmnHealed_Ch3:: ; 9bd2 (2:5bd2) notetype 12, 1, 0 octave 4 - note E_, 2 + E_ 2 rest 2 - note E_, 2 + E_ 2 rest 2 - note E_, 2 - note G#, 2 - note E_, 6 + E_ 2 + G# 2 + E_ 6 rest 2 endchannel -; 0x9bde
\ No newline at end of file +; 0x9bde diff --git a/audio/music/pokecenter.asm b/audio/music/pokecenter.asm index 4e139b9a..de6e0873 100644 --- a/audio/music/pokecenter.asm +++ b/audio/music/pokecenter.asm @@ -1,151 +1,151 @@ Music_Pokecenter_Ch1:: ; be56 (2:7e56) - tempo 0, 144 - stereopanning 119 + tempo 144 + volume 7, 7 duty 3 vibrato 10, 2, 2 - togglecall + toggleperfectpitch Music_Pokecenter_branch_be61:: notetype 12, 10, 3 octave 3 - note F#, 2 - note F_, 2 - note F#, 2 + F# 2 + F_ 2 + F# 2 notetype 12, 11, 5 octave 4 - note D_, 4 - note C#, 2 + D_ 4 + C# 2 octave 3 - note B_, 2 - note A_, 2 - note B_, 2 - note A_, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note F#, 2 - note G_, 2 - note A_, 2 + B_ 2 + A_ 2 + B_ 2 + A_ 2 + G_ 2 + F# 2 + E_ 2 + F# 2 + G_ 2 + A_ 2 notetype 12, 10, 3 - note A_, 2 - note E_, 2 - note A_, 2 + A_ 2 + E_ 2 + A_ 2 notetype 12, 11, 5 octave 4 - note C#, 4 + C# 4 octave 3 - note B_, 2 - note A_, 2 - note G_, 2 - note F#, 2 - note A_, 2 - note B_, 2 + B_ 2 + A_ 2 + G_ 2 + F# 2 + A_ 2 + B_ 2 octave 4 - note C#, 2 - note D_, 2 - note C#, 2 + C# 2 + D_ 2 + C# 2 octave 3 - note B_, 2 - note A_, 2 + B_ 2 + A_ 2 notetype 12, 10, 3 - note F#, 2 - note F_, 2 - note F#, 2 + F# 2 + F_ 2 + F# 2 notetype 12, 11, 5 octave 4 - note D_, 4 - note C#, 2 + D_ 4 + C# 2 octave 3 - note B_, 2 - note A_, 2 - note B_, 2 - note A_, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note F#, 2 - note G_, 2 - note A_, 2 + B_ 2 + A_ 2 + B_ 2 + A_ 2 + G_ 2 + F# 2 + E_ 2 + F# 2 + G_ 2 + A_ 2 notetype 12, 10, 3 - note A_, 2 - note E_, 2 - note A_, 2 + A_ 2 + E_ 2 + A_ 2 notetype 12, 11, 5 octave 4 - note C#, 4 + C# 4 octave 3 - note B_, 2 - note A_, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note D_, 2 - note E_, 2 - note F#, 2 - note G_, 2 - note A_, 2 - note B_, 2 - note F#, 2 - note E_, 2 - note D_, 4 - note E_, 2 - note F#, 2 - note G_, 2 - note A_, 2 - note B_, 2 - note A_, 2 - note G_, 4 - note E_, 2 - note F#, 2 - note G_, 2 - note A_, 2 - note G_, 2 - note F#, 2 - note E_, 4 - note C#, 2 - note D_, 2 - note E_, 2 - note G_, 2 - note F#, 2 - note G_, 2 - note A_, 2 - note B_, 2 - note A_, 8 + B_ 2 + A_ 2 + G_ 2 + F# 2 + E_ 2 + D_ 2 + E_ 2 + F# 2 + G_ 2 + A_ 2 + B_ 2 + F# 2 + E_ 2 + D_ 4 + E_ 2 + F# 2 + G_ 2 + A_ 2 + B_ 2 + A_ 2 + G_ 4 + E_ 2 + F# 2 + G_ 2 + A_ 2 + G_ 2 + F# 2 + E_ 4 + C# 2 + D_ 2 + E_ 2 + G_ 2 + F# 2 + G_ 2 + A_ 2 + B_ 2 + A_ 8 octave 4 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 3 - note B_, 4 - note A_, 2 - note B_, 2 + B_ 4 + A_ 2 + B_ 2 octave 4 - note C#, 2 - note D_, 2 - note E_, 2 - note D_, 2 - note C#, 4 + C# 2 + D_ 2 + E_ 2 + D_ 2 + C# 4 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D_, 2 - note E_, 2 - note C#, 2 + C# 2 + D_ 2 + E_ 2 + C# 2 octave 3 - note B_, 2 - note A_, 4 - note G_, 2 - note A_, 2 - note B_, 2 - note G_, 2 - note A_, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note D_, 2 - note E_, 2 - note F#, 2 - note G_, 2 + B_ 2 + A_ 4 + G_ 2 + A_ 2 + B_ 2 + G_ 2 + A_ 2 + G_ 2 + F# 2 + E_ 2 + D_ 2 + E_ 2 + F# 2 + G_ 2 loopchannel 0, Music_Pokecenter_branch_be61 @@ -157,94 +157,94 @@ Music_Pokecenter_branch_befc:: duty 3 notetype 12, 10, 5 octave 3 - note A_, 4 - note E_, 4 + A_ 4 + E_ 4 callchannel Music_Pokecenter_branch_bf60 - note D_, 2 - note F#, 6 + D_ 2 + F# 6 duty 3 notetype 12, 10, 5 octave 3 - note A_, 4 - note E_, 4 + A_ 4 + E_ 4 callchannel Music_Pokecenter_branch_bf4e duty 3 notetype 12, 10, 5 octave 3 - note A_, 4 - note E_, 4 + A_ 4 + E_ 4 callchannel Music_Pokecenter_branch_bf60 - note D_, 8 + D_ 8 duty 3 notetype 12, 10, 5 octave 3 - note D_, 4 - note E_, 4 + D_ 4 + E_ 4 duty 2 notetype 12, 12, 6 octave 4 - note F#, 8 - note A_, 8 - note G_, 2 - note A_, 2 - note G_, 2 - note F#, 2 - note E_, 8 - note C#, 8 - note E_, 8 - note F#, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note D_, 8 - note F#, 8 - note A_, 8 - note G_, 2 - note F#, 2 - note G_, 2 - note A_, 2 - note B_, 8 - note A_, 4 - note G_, 2 - note F#, 2 - note G_, 8 - note F#, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note D_, 8 + F# 8 + A_ 8 + G_ 2 + A_ 2 + G_ 2 + F# 2 + E_ 8 + C# 8 + E_ 8 + F# 2 + G_ 2 + F# 2 + E_ 2 + D_ 8 + F# 8 + A_ 8 + G_ 2 + F# 2 + G_ 2 + A_ 2 + B_ 8 + A_ 4 + G_ 2 + F# 2 + G_ 8 + F# 2 + G_ 2 + F# 2 + E_ 2 + D_ 8 loopchannel 0, Music_Pokecenter_branch_befc Music_Pokecenter_branch_bf4e:: duty 2 notetype 12, 12, 2 octave 4 - note D_, 2 + D_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note D_, 2 + D_ 2 notetype 12, 12, 3 - note A_, 4 - note G_, 4 - note F#, 2 - note E_, 2 - note C#, 6 + A_ 4 + G_ 4 + F# 2 + E_ 2 + C# 6 endchannel Music_Pokecenter_branch_bf60:: duty 2 notetype 12, 12, 2 octave 4 - note C#, 2 + C# 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note C#, 2 + C# 2 notetype 12, 12, 3 - note F#, 4 - note E_, 4 - note C#, 2 + F# 4 + E_ 4 + C# 2 endchannel @@ -253,124 +253,124 @@ Music_Pokecenter_Ch3:: ; bf70 (2:7f70) Music_Pokecenter_branch_bf72:: octave 4 - note D_, 2 - note F#, 2 - note D_, 2 - note F#, 2 - note D_, 2 - note F#, 2 - note G_, 2 - note F#, 2 + D_ 2 + F# 2 + D_ 2 + F# 2 + D_ 2 + F# 2 + G_ 2 + F# 2 callchannel Music_Pokecenter_branch_bfd9 callchannel Music_Pokecenter_branch_bfe2 - note F#, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note G_, 2 - note A_, 2 - note D_, 2 - note F#, 2 - note D_, 2 - note F#, 2 - note D_, 2 - note F#, 2 - note G_, 2 - note F#, 2 + F# 2 + A_ 2 + F# 2 + A_ 2 + F# 2 + A_ 2 + G_ 2 + A_ 2 + D_ 2 + F# 2 + D_ 2 + F# 2 + D_ 2 + F# 2 + G_ 2 + F# 2 callchannel Music_Pokecenter_branch_bfd9 callchannel Music_Pokecenter_branch_bfe2 - note D_, 2 - note F#, 2 - note D_, 2 - note F#, 2 - note D_, 2 - note B_, 2 - note A_, 2 - note G_, 2 + D_ 2 + F# 2 + D_ 2 + F# 2 + D_ 2 + B_ 2 + A_ 2 + G_ 2 callchannel Music_Pokecenter_branch_bfeb - note G_, 2 - note B_, 2 - note G_, 2 - note B_, 2 - note G_, 2 - note B_, 2 - note G_, 2 - note B_, 2 - note E_, 2 - note G_, 2 - note E_, 2 - note G_, 2 - note E_, 2 - note G_, 2 - note E_, 2 - note G_, 2 - note F#, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note G#, 2 - note A_, 2 + G_ 2 + B_ 2 + G_ 2 + B_ 2 + G_ 2 + B_ 2 + G_ 2 + B_ 2 + E_ 2 + G_ 2 + E_ 2 + G_ 2 + E_ 2 + G_ 2 + E_ 2 + G_ 2 + F# 2 + A_ 2 + F# 2 + A_ 2 + F# 2 + A_ 2 + G# 2 + A_ 2 callchannel Music_Pokecenter_branch_bfeb - note G_, 2 - note B_, 2 - note G_, 2 - note B_, 2 - note G_, 2 - note B_, 2 - note G_, 2 - note B_, 2 - note E_, 2 - note G_, 2 - note E_, 2 - note G_, 2 - note E_, 2 - note G_, 2 - note E_, 2 - note G_, 2 - note F#, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note F#, 2 - note G_, 2 - note F#, 2 - note E_, 2 + G_ 2 + B_ 2 + G_ 2 + B_ 2 + G_ 2 + B_ 2 + G_ 2 + B_ 2 + E_ 2 + G_ 2 + E_ 2 + G_ 2 + E_ 2 + G_ 2 + E_ 2 + G_ 2 + F# 2 + A_ 2 + F# 2 + A_ 2 + F# 2 + G_ 2 + F# 2 + E_ 2 loopchannel 0, Music_Pokecenter_branch_bf72 Music_Pokecenter_branch_bfd9:: - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 endchannel Music_Pokecenter_branch_bfe2:: - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note G_, 2 - note A_, 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + G_ 2 + A_ 2 endchannel Music_Pokecenter_branch_bfeb:: - note F#, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note F#, 2 - note A_, 2 + F# 2 + A_ 2 + F# 2 + A_ 2 + F# 2 + A_ 2 + F# 2 + A_ 2 endchannel -; 0xbff4
\ No newline at end of file +; 0xbff4 diff --git a/audio/music/pokemontower.asm b/audio/music/pokemontower.asm index 915c656d..e04dcb30 100644 --- a/audio/music/pokemontower.asm +++ b/audio/music/pokemontower.asm @@ -1,142 +1,142 @@ Music_PokemonTower_Ch1:: ; 7f04a (1f:704a) - tempo 0, 152 - stereopanning 119 + tempo 152 + volume 7, 7 duty 3 - togglecall + toggleperfectpitch vibrato 12, 2, 3 notetype 12, 8, 0 rest 4 octave 4 - note B_, 12 + B_ 12 Music_PokemonTower_branch_7f05a:: notetype 12, 11, 4 octave 4 - note G_, 1 + G_ 1 rest 7 - note G_, 1 + G_ 1 rest 7 octave 3 - note B_, 1 + B_ 1 rest 7 - note B_, 1 + B_ 1 rest 3 - note B_, 1 + B_ 1 rest 3 - note B_, 1 + B_ 1 rest 7 - note B_, 1 + B_ 1 rest 7 - note B_, 1 + B_ 1 rest 7 octave 4 - note F#, 1 + F# 1 rest 7 - note C_, 1 + C_ 1 octave 3 - note B_, 1 - note G_, 1 + B_ 1 + G_ 1 rest 5 - note E_, 1 + E_ 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note F#, 1 + F# 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note G_, 1 + G_ 1 rest 7 - note G_, 1 + G_ 1 rest 7 - note F#, 1 + F# 1 rest 7 - note F#, 1 + F# 1 rest 7 - note G_, 1 + G_ 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note D_, 1 + D_ 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note G_, 1 + G_ 1 rest 7 - note G_, 1 + G_ 1 rest 7 - note F#, 1 + F# 1 rest 7 - note B_, 1 + B_ 1 rest 7 - note B_, 1 + B_ 1 rest 7 octave 4 - note C_, 1 + C_ 1 rest 7 - note C_, 1 + C_ 1 rest 7 - note C#, 1 + C# 1 rest 7 - note C#, 1 + C# 1 rest 7 - note C_, 1 + C_ 1 rest 7 - note C_, 1 + C_ 1 rest 3 notetype 12, 8, 4 - note C_, 1 + C_ 1 rest 3 notetype 12, 11, 4 - note D_, 1 + D_ 1 rest 7 - note D_, 1 + D_ 1 rest 7 octave 3 - note A_, 1 + A_ 1 rest 7 - note A_, 1 + A_ 1 rest 7 notetype 12, 10, 7 - note B_, 8 - note B_, 8 + B_ 8 + B_ 8 octave 4 - note C_, 8 - note C_, 8 - note C#, 8 - note C#, 8 + C_ 8 + C_ 8 + C# 8 + C# 8 notetype 12, 10, 6 - note D_, 16 + D_ 16 rest 16 rest 16 rest 16 rest 16 notetype 12, 9, 2 - note B_, 4 + B_ 4 octave 5 - note E_, 4 - note D_, 4 - note C_, 4 + E_ 4 + D_ 4 + C_ 4 octave 4 - note B_, 4 + B_ 4 octave 5 - note E_, 4 - note D_, 4 - note C_, 4 + E_ 4 + D_ 4 + C_ 4 octave 4 - note B_, 4 + B_ 4 octave 5 - note E_, 4 - note D_, 4 - note C_, 4 + E_ 4 + D_ 4 + C_ 4 octave 4 - note B_, 4 - note G_, 4 - note F#, 4 - note E_, 4 + B_ 4 + G_ 4 + F# 4 + E_ 4 octave 5 - note C_, 16 - note C_, 16 + C_ 16 + C_ 16 loopchannel 0, Music_PokemonTower_branch_7f05a @@ -145,150 +145,150 @@ Music_PokemonTower_Ch2:: ; 7f0e3 (1f:70e3) duty 3 notetype 12, 10, 0 octave 5 - note C_, 12 + C_ 12 octave 4 - note E_, 4 + E_ 4 Music_PokemonTower_branch_7f0ee:: notetype 12, 12, 1 octave 5 - note C_, 8 + C_ 8 octave 4 - note B_, 4 + B_ 4 notetype 12, 12, 4 - note G_, 1 - note F#, 1 - note E_, 1 - note D#, 1 + G_ 1 + F# 1 + E_ 1 + D# 1 notetype 12, 11, 0 - note G_, 8 + G_ 8 octave 5 - note C_, 8 + C_ 8 octave 4 - note B_, 4 - note G_, 4 - note E_, 4 - note G_, 4 + B_ 4 + G_ 4 + E_ 4 + G_ 4 octave 5 - note C_, 8 + C_ 8 notetype 12, 11, 7 - note C_, 8 + C_ 8 notetype 12, 12, 2 octave 4 - note G_, 1 - note F#, 1 - note E_, 1 + G_ 1 + F# 1 + E_ 1 rest 1 notetype 12, 9, 6 octave 3 - note G_, 4 + G_ 4 notetype 12, 12, 7 - note G_, 4 - note B_, 4 - note G_, 4 - note B_, 4 + G_ 4 + B_ 4 + G_ 4 + B_ 4 octave 4 - note C_, 4 + C_ 4 octave 3 - note B_, 4 + B_ 4 notetype 12, 11, 0 octave 4 - note C_, 16 - note E_, 8 + C_ 16 + E_ 8 notetype 12, 11, 7 - note E_, 12 + E_ 12 notetype 12, 12, 5 octave 5 - note C_, 4 + C_ 4 octave 4 - note B_, 4 - note G_, 4 - note B_, 4 - note G_, 4 - note F#, 4 - note E_, 4 + B_ 4 + G_ 4 + B_ 4 + G_ 4 + F# 4 + E_ 4 notetype 12, 11, 0 - note F#, 12 - note G_, 4 + F# 12 + G_ 4 notetype 12, 11, 0 - note F#, 8 + F# 8 notetype 12, 11, 7 - note F#, 8 + F# 8 notetype 12, 11, 0 - note B_, 4 - note G_, 4 - note F#, 4 - note E_, 4 - note B_, 16 + B_ 4 + G_ 4 + F# 4 + E_ 4 + B_ 16 notetype 12, 11, 0 octave 5 - note C_, 4 + C_ 4 octave 4 - note G_, 4 - note F#, 4 - note E_, 4 + G_ 4 + F# 4 + E_ 4 notetype 12, 9, 0 octave 5 - note C_, 16 + C_ 16 notetype 12, 11, 0 - note D_, 4 + D_ 4 octave 4 - note A_, 4 - note G#, 4 - note F#, 4 + A_ 4 + G# 4 + F# 4 notetype 12, 2, 15 octave 5 - note D_, 16 + D_ 16 notetype 12, 12, 0 - note E_, 4 + E_ 4 octave 4 - note B_, 4 - note A_, 4 - note G_, 4 + B_ 4 + A_ 4 + G_ 4 octave 5 - note F_, 4 - note C_, 4 + F_ 4 + C_ 4 octave 4 - note A#, 4 - note G#, 4 + A# 4 + G# 4 octave 5 - note F#, 4 - note D_, 4 - note C_, 4 + F# 4 + D_ 4 + C_ 4 octave 4 - note A#, 4 - note G#, 4 - note F#, 4 - note E_, 4 - note D_, 4 + A# 4 + G# 4 + F# 4 + E_ 4 + D_ 4 notetype 12, 11, 0 - note C_, 8 + C_ 8 notetype 12, 9, 0 - note C_, 8 + C_ 8 notetype 12, 8, 0 - note C_, 8 + C_ 8 notetype 12, 7, 0 - note C_, 8 + C_ 8 notetype 12, 6, 0 - note C_, 8 + C_ 8 notetype 12, 6, 7 - note C_, 8 + C_ 8 rest 16 notetype 12, 10, 0 octave 5 - note G_, 16 + G_ 16 octave 6 - note C_, 16 + C_ 16 octave 5 - note B_, 8 - note G_, 8 - note E_, 8 - note G_, 8 + B_ 8 + G_ 8 + E_ 8 + G_ 8 octave 6 - note C_, 16 + C_ 16 vibrato 0, 3, 4 notetype 12, 10, 7 - note C_, 16 + C_ 16 loopchannel 0, Music_PokemonTower_branch_7f0ee @@ -297,163 +297,163 @@ Music_PokemonTower_Ch3:: ; 7f19a (1f:719a) notetype 12, 1, 3 rest 8 octave 5 - note G_, 8 + G_ 8 Music_PokemonTower_branch_7f1a2:: - note E_, 1 + E_ 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note E_, 1 + E_ 1 rest 3 - note E_, 1 - note D#, 1 - note F#, 1 - note D#, 1 - note E_, 1 + E_ 1 + D# 1 + F# 1 + D# 1 + E_ 1 rest 7 - note G_, 1 + G_ 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note B_, 1 + B_ 1 rest 7 - note E_, 1 - note D#, 1 + E_ 1 + D# 1 octave 4 - note B_, 1 + B_ 1 rest 5 - note B_, 1 + B_ 1 rest 7 - note B_, 1 + B_ 1 rest 7 - note B_, 1 + B_ 1 rest 7 octave 5 - note C_, 1 + C_ 1 rest 7 - note C_, 1 + C_ 1 rest 7 - note C_, 1 + C_ 1 rest 7 - note C_, 1 + C_ 1 rest 7 octave 4 - note B_, 1 + B_ 1 rest 7 - note B_, 1 + B_ 1 rest 7 - note B_, 1 + B_ 1 rest 7 - note B_, 1 + B_ 1 rest 7 octave 5 - note C_, 1 + C_ 1 rest 7 - note C_, 1 + C_ 1 rest 7 - note C_, 1 + C_ 1 rest 7 - note C_, 1 + C_ 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note E_, 1 + E_ 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note F#, 1 + F# 1 rest 7 - note F#, 1 + F# 1 rest 7 - note D_, 1 + D_ 1 rest 7 - note D_, 1 + D_ 1 rest 3 - note D_, 1 + D_ 1 rest 1 - note D#, 1 + D# 1 rest 1 - note E_, 1 + E_ 1 rest 7 - note E_, 1 + E_ 1 rest 7 - note F_, 1 + F_ 1 rest 7 - note F_, 1 + F_ 1 rest 7 - note F#, 1 + F# 1 rest 7 - note F#, 1 + F# 1 rest 7 - note G_, 1 + G_ 1 rest 15 notetype 12, 1, 5 octave 4 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 15 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 7 notetype 12, 1, 3 octave 6 - note E_, 1 + E_ 1 rest 1 - note D#, 1 + D# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note E_, 1 + E_ 1 rest 15 - note E_, 1 + E_ 1 rest 15 - note E_, 1 + E_ 1 rest 15 - note E_, 1 + E_ 1 rest 15 - note E_, 1 + E_ 1 rest 15 - note E_, 1 + E_ 1 rest 7 octave 5 - note E_, 1 + E_ 1 rest 1 - note D#, 1 + D# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note D#, 1 + D# 1 rest 1 loopchannel 0, Music_PokemonTower_branch_7f1a2 -; 0x7f243
\ No newline at end of file +; 0x7f243 diff --git a/audio/music/routes1.asm b/audio/music/routes1.asm index a5c1b40d..9876b0ea 100644 --- a/audio/music/routes1.asm +++ b/audio/music/routes1.asm @@ -1,107 +1,107 @@ Music_Routes1_Ch1:: ; 9bde (2:5bde) - tempo 0, 152 - stereopanning 119 + tempo 152 + volume 7, 7 vibrato 4, 2, 3 duty 2 - togglecall + toggleperfectpitch Music_Routes1_branch_9be9:: notetype 12, 10, 1 rest 4 octave 4 - note D_, 2 - note D_, 6 - note D_, 2 - note D_, 6 - note D_, 2 - note D_, 1 - note C#, 1 + D_ 2 + D_ 6 + D_ 2 + D_ 6 + D_ 2 + D_ 1 + C# 1 octave 3 - note B_, 1 + B_ 1 octave 4 - note C#, 1 + C# 1 octave 3 - note A_, 2 - note A_, 2 - note A_, 6 - octave 4 - note C#, 2 - note C#, 6 - note C#, 2 - note C#, 4 + A_ 2 + A_ 2 + A_ 6 + octave 4 + C# 2 + C# 6 + C# 2 + C# 4 octave 3 - note A_, 2 + A_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 4 + C# 4 octave 3 - note A_, 2 - note A_, 6 - octave 4 - note D_, 2 - note D_, 6 - note D_, 2 - note D_, 6 - note D_, 2 - note D_, 1 - note E_, 1 - note D_, 1 - note C#, 1 + A_ 2 + A_ 6 + octave 4 + D_ 2 + D_ 6 + D_ 2 + D_ 6 + D_ 2 + D_ 1 + E_ 1 + D_ 1 + C# 1 octave 3 - note B_, 2 - note A_, 2 - note A_, 6 + B_ 2 + A_ 2 + A_ 6 octave 4 - note C#, 2 - note C#, 6 + C# 2 + C# 6 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 notetype 12, 10, 2 octave 4 - note G_, 4 - note E_, 4 - note F#, 2 + G_ 4 + E_ 4 + F# 2 notetype 12, 10, 1 octave 3 - note A_, 2 - note A_, 6 - note A_, 2 - note F#, 2 - note A_, 4 - note B_, 2 - octave 4 - note C#, 2 + A_ 2 + A_ 6 + A_ 2 + F# 2 + A_ 4 + B_ 2 + octave 4 + C# 2 octave 3 - note B_, 4 - note A_, 2 - note F#, 2 - note A_, 4 - note G_, 2 - note E_, 2 - note C#, 4 - note A_, 2 - octave 4 - note D_, 2 + B_ 4 + A_ 2 + F# 2 + A_ 4 + G_ 2 + E_ 2 + C# 4 + A_ 2 + octave 4 + D_ 2 octave 3 - note A_, 4 - note B_, 2 - note G_, 2 - note B_, 4 - octave 4 - note D_, 2 - note E_, 2 - note C#, 2 - note D_, 2 + A_ 4 + B_ 2 + G_ 2 + B_ 4 + octave 4 + D_ 2 + E_ 2 + C# 2 + D_ 2 octave 3 - note A_, 2 - note A_, 2 + A_ 2 + A_ 2 loopchannel 0, Music_Routes1_branch_9be9 endchannel @@ -119,117 +119,117 @@ Music_Routes1_branch_9c53:: Music_Routes1_branch_9c65:: octave 4 - note D_, 1 - note E_, 1 - note F#, 2 - note F#, 2 - note F#, 2 - note D_, 1 - note E_, 1 - note F#, 2 - note F#, 2 - note F#, 2 - note D_, 1 - note E_, 1 - note F#, 2 - note F#, 2 - note G_, 3 - note F#, 1 - note E_, 6 + D_ 1 + E_ 1 + F# 2 + F# 2 + F# 2 + D_ 1 + E_ 1 + F# 2 + F# 2 + F# 2 + D_ 1 + E_ 1 + F# 2 + F# 2 + G_ 3 + F# 1 + E_ 6 endchannel Music_Routes1_branch_9c78:: - note C#, 1 - note D_, 1 - note E_, 2 - note E_, 2 - note E_, 2 - note C#, 1 - note D_, 1 - note E_, 2 - note E_, 2 - note E_, 2 - note C#, 1 - note D_, 1 - note E_, 2 - note E_, 2 - note F#, 1 - note E_, 1 - note E_, 1 - note F#, 1 - note D_, 4 - note F#, 2 + C# 1 + D_ 1 + E_ 2 + E_ 2 + E_ 2 + C# 1 + D_ 1 + E_ 2 + E_ 2 + E_ 2 + C# 1 + D_ 1 + E_ 2 + E_ 2 + F# 1 + E_ 1 + E_ 1 + F# 1 + D_ 4 + F# 2 endchannel Music_Routes1_branch_9c8d:: - note C#, 1 - note D_, 1 - note E_, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note D_, 2 - note C#, 2 + C# 1 + D_ 1 + E_ 2 + G_ 2 + F# 2 + E_ 2 + D_ 2 + C# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 + C# 2 notetype 12, 13, 2 - note B_, 4 + B_ 4 notetype 6, 13, 1 octave 3 - note B_, 1 + B_ 1 octave 4 - note C#, 1 + C# 1 notetype 12, 13, 1 octave 3 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 octave 4 - note C#, 1 - note D_, 6 + C# 1 + D_ 6 notetype 12, 13, 2 - note F#, 1 - note G_, 1 - note A_, 2 - note A_, 2 - note F#, 2 - note D_, 2 + F# 1 + G_ 1 + A_ 2 + A_ 2 + F# 2 + D_ 2 octave 5 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 4 - note B_, 2 + B_ 2 octave 5 - note C#, 2 - octave 4 - note A_, 2 - note F#, 2 - note D_, 3 - note F#, 1 - note E_, 6 - note F#, 1 - note G_, 1 - note A_, 2 - note A_, 2 - note F#, 2 - note A_, 2 + C# 2 + octave 4 + A_ 2 + F# 2 + D_ 3 + F# 1 + E_ 6 + F# 1 + G_ 1 + A_ 2 + A_ 2 + F# 2 + A_ 2 octave 5 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 4 - note B_, 3 - note G_, 1 - note A_, 2 + B_ 3 + G_ 1 + A_ 2 octave 5 - note D_, 2 - note C#, 2 - note E_, 2 - note D_, 2 + D_ 2 + C# 2 + E_ 2 + D_ 2 notetype 12, 13, 1 octave 4 - note D_, 2 - note D_, 2 + D_ 2 + D_ 2 endchannel endchannel @@ -241,70 +241,70 @@ Music_Routes1_Ch3:: ; 9cd8 (2:5cd8) Music_Routes1_branch_9cdd:: rest 2 octave 4 - note D_, 4 - note C#, 4 + D_ 4 + C# 4 octave 3 - note B_, 4 - note A_, 4 + B_ 4 + A_ 4 octave 4 - note D_, 4 + D_ 4 octave 3 - note A_, 4 - note B_, 4 - note A_, 4 + A_ 4 + B_ 4 + A_ 4 octave 4 - note C#, 4 + C# 4 octave 3 - note A_, 4 - note B_, 4 + A_ 4 + B_ 4 octave 4 - note C_, 4 - note C#, 4 + C_ 4 + C# 4 octave 3 - note A_, 4 + A_ 4 octave 4 - note D_, 4 + D_ 4 octave 3 - note A_, 4 + A_ 4 octave 4 - note D_, 4 - note C#, 4 + D_ 4 + C# 4 octave 3 - note B_, 4 - note A_, 4 + B_ 4 + A_ 4 octave 4 - note D_, 4 + D_ 4 octave 3 - note A_, 4 - note B_, 4 - note A_, 4 + A_ 4 + B_ 4 + A_ 4 octave 4 - note C#, 4 + C# 4 octave 3 - note B_, 4 - note A_, 4 - note B_, 4 + B_ 4 + A_ 4 + B_ 4 octave 4 - note C#, 4 + C# 4 octave 3 - note A_, 4 + A_ 4 octave 4 - note D_, 4 + D_ 4 octave 3 - note A_, 4 + A_ 4 octave 4 - note D_, 8 + D_ 8 octave 3 - note G_, 8 - note A_, 8 + G_ 8 + A_ 8 octave 4 - note C#, 8 - note D_, 8 + C# 8 + D_ 8 octave 3 - note G_, 8 - note A_, 8 + G_ 8 + A_ 8 octave 4 - note D_, 6 + D_ 6 loopchannel 0, Music_Routes1_branch_9cdd endchannel @@ -312,94 +312,94 @@ Music_Routes1_branch_9cdd:: Music_Routes1_Ch4:: ; 9d24 (2:5d24) dspeed 12 rest 4 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 + mutedsnare1 2 + mutedsnare1 2 rest 4 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 + mutedsnare1 2 + mutedsnare1 2 + mutedsnare1 2 + mutedsnare1 2 rest 4 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 + mutedsnare1 2 + mutedsnare1 2 rest 4 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 + mutedsnare1 2 + mutedsnare1 2 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 + mutedsnare1 2 + mutedsnare1 2 rest 4 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 + mutedsnare1 2 + mutedsnare1 2 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 + mutedsnare1 2 + mutedsnare1 2 rest 4 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 + mutedsnare1 2 + mutedsnare1 2 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 + mutedsnare1 2 + mutedsnare1 2 rest 4 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 + mutedsnare1 2 + mutedsnare1 2 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 + mutedsnare1 2 + mutedsnare1 2 + mutedsnare1 2 rest 2 - dnote 2, mutedsnare1 - dnote 2, mutedsnare1 + mutedsnare1 2 + mutedsnare1 2 loopchannel 0, Music_Routes1_Ch4 endchannel -; 0x9db9
\ No newline at end of file +; 0x9db9 diff --git a/audio/music/routes2.asm b/audio/music/routes2.asm index a1362569..9ba376ce 100644 --- a/audio/music/routes2.asm +++ b/audio/music/routes2.asm @@ -1,143 +1,143 @@ Music_Routes2_Ch1:: ; 9db9 (2:5db9) - tempo 0, 152 - stereopanning 119 + tempo 152 + volume 7, 7 vibrato 9, 2, 5 duty 1 Music_Routes2_branch_9dc3:: notetype 12, 11, 2 octave 2 - note B_, 4 - octave 3 - note G#, 6 - note F#, 2 - note E_, 2 - note D#, 1 - note F#, 1 - note E_, 2 + B_ 4 + octave 3 + G# 6 + F# 2 + E_ 2 + D# 1 + F# 1 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 - note A_, 2 - note G#, 4 - note F#, 4 + E_ 2 + A_ 2 + G# 4 + F# 4 octave 2 - note B_, 4 - octave 3 - note G#, 6 - note F#, 2 - note E_, 2 - note D#, 1 - note F#, 1 - note B_, 2 + B_ 4 + octave 3 + G# 6 + F# 2 + E_ 2 + D# 1 + F# 1 + B_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 - note A_, 2 - note G#, 4 - note B_, 4 + E_ 2 + A_ 2 + G# 4 + B_ 4 notetype 8, 11, 2 octave 4 - note E_, 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note E_, 2 - note D#, 2 + E_ 2 + D# 2 octave 3 - note G#, 2 + G# 2 octave 4 - note D#, 2 - note D#, 2 + D# 2 + D# 2 octave 3 - note G#, 2 + G# 2 octave 4 - note D#, 2 - note C#, 2 + D# 2 + C# 2 octave 3 - note F#, 2 + F# 2 octave 4 - note C#, 2 - note C#, 2 + C# 2 + C# 2 octave 3 - note F#, 2 + F# 2 octave 4 - note C#, 2 - octave 3 - note B_, 2 - note E_, 2 - note B_, 2 - note B_, 2 - note E_, 2 - note G#, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note A_, 2 - note F#, 2 - note A_, 2 - note G#, 2 - note E_, 2 - note B_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note A_, 2 - note B_, 2 - note A_, 2 + C# 2 + octave 3 + B_ 2 + E_ 2 + B_ 2 + B_ 2 + E_ 2 + G# 2 + F# 2 + G# 2 + A_ 2 + A_ 2 + F# 2 + A_ 2 + F# 2 + G# 2 + A_ 2 + A_ 2 + F# 2 + A_ 2 + G# 2 + E_ 2 + B_ 2 + B_ 2 + E_ 2 + B_ 2 + B_ 2 + E_ 2 + B_ 2 + B_ 2 + E_ 2 + B_ 2 + A_ 2 + B_ 2 + A_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D_, 2 + C# 2 + D_ 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note D_, 2 - note F#, 2 - note E_, 2 - note D#, 2 - note E_, 2 + D_ 2 + F# 2 + E_ 2 + D# 2 + E_ 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note E_, 2 + E_ 2 loopchannel 0, Music_Routes2_branch_9dc3 endchannel @@ -149,68 +149,68 @@ Music_Routes2_Ch2:: ; 9e4f (2:5e4f) Music_Routes2_branch_9e54:: notetype 12, 13, 4 octave 4 - note E_, 6 + E_ 6 octave 3 - note B_, 1 + B_ 1 octave 4 - note E_, 1 - note F#, 6 - note A_, 2 - note G#, 3 - note E_, 1 - note F#, 8 - octave 3 - note D#, 4 + E_ 1 + F# 6 + A_ 2 + G# 3 + E_ 1 + F# 8 + octave 3 + D# 4 octave 4 - note E_, 6 + E_ 6 octave 3 - note B_, 1 + B_ 1 octave 4 - note E_, 1 - note F#, 6 - note A_, 2 - note G#, 3 - note E_, 1 - note B_, 8 - octave 3 - note G#, 4 + E_ 1 + F# 6 + A_ 2 + G# 3 + E_ 1 + B_ 8 + octave 3 + G# 4 octave 5 - note C#, 6 + C# 6 octave 4 - note B_, 1 - note A_, 1 - note B_, 6 - note A_, 1 - note G#, 1 - note A_, 6 - note G#, 1 - note F#, 1 - note G#, 4 - note F#, 2 - note E_, 2 - note D_, 2 - note D_, 1 - note E_, 1 - note F#, 8 - note A_, 4 - note G#, 3 - note F#, 1 - note E_, 8 - note F#, 2 - note E_, 2 - note D_, 2 - note D_, 1 - note E_, 1 - note F#, 2 - note F#, 1 - note G#, 1 - note A_, 4 + B_ 1 + A_ 1 + B_ 6 + A_ 1 + G# 1 + A_ 6 + G# 1 + F# 1 + G# 4 + F# 2 + E_ 2 + D_ 2 + D_ 1 + E_ 1 + F# 8 + A_ 4 + G# 3 + F# 1 + E_ 8 + F# 2 + E_ 2 + D_ 2 + D_ 1 + E_ 1 + F# 2 + F# 1 + G# 1 + A_ 4 octave 5 - note C#, 4 + C# 4 octave 4 - note B_, 3 - note A_, 1 - note G#, 8 + B_ 3 + A_ 1 + G# 8 rest 4 loopchannel 0, Music_Routes2_branch_9e54 endchannel @@ -222,103 +222,103 @@ Music_Routes2_Ch3:: ; 9e9b (2:5e9b) Music_Routes2_branch_9e9e:: notetype 12, 1, 1 octave 3 - note E_, 2 + E_ 2 rest 2 octave 2 - note B_, 6 + B_ 6 octave 3 - note D_, 1 - note C#, 1 - note D_, 2 - note D#, 2 - note E_, 2 + D_ 1 + C# 1 + D_ 2 + D# 2 + E_ 2 rest 2 octave 2 - note B_, 6 + B_ 6 octave 3 - note D_, 1 - note C#, 1 + D_ 1 + C# 1 octave 2 - note A_, 2 + A_ 2 octave 3 - note C#, 2 - note E_, 2 + C# 2 + E_ 2 rest 2 octave 2 - note B_, 6 + B_ 6 octave 3 - note D_, 1 - note C#, 1 - note D_, 2 - note D#, 2 - note E_, 2 + D_ 1 + C# 1 + D_ 2 + D# 2 + E_ 2 rest 2 octave 2 - note B_, 4 + B_ 4 octave 3 - note C#, 2 + C# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D_, 2 - note F#, 2 - note E_, 2 + D_ 2 + F# 2 + E_ 2 rest 2 octave 2 - note A_, 2 + A_ 2 rest 2 octave 3 - note D#, 2 + D# 2 rest 2 octave 2 - note G#, 2 + G# 2 rest 2 octave 3 - note C#, 2 + C# 2 rest 2 octave 2 - note F#, 2 + F# 2 rest 2 - note B_, 2 + B_ 2 rest 2 - note E_, 2 - note G#, 2 - note F#, 2 + E_ 2 + G# 2 + F# 2 rest 2 - note A_, 2 + A_ 2 rest 2 - note F#, 2 + F# 2 rest 2 - note A_, 2 + A_ 2 rest 2 - note G#, 2 + G# 2 rest 2 - note B_, 2 + B_ 2 rest 2 - note G#, 2 + G# 2 rest 2 - note B_, 2 + B_ 2 rest 2 - note F#, 2 + F# 2 rest 2 - note A_, 2 + A_ 2 rest 2 octave 3 - note C#, 2 + C# 2 rest 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note C#, 2 + C# 2 octave 2 - note B_, 2 + B_ 2 rest 2 octave 3 - note E_, 2 + E_ 2 rest 2 - note G#, 2 + G# 2 rest 2 - note E_, 2 + E_ 2 rest 2 loopchannel 0, Music_Routes2_branch_9e9e endchannel @@ -326,101 +326,101 @@ Music_Routes2_branch_9e9e:: Music_Routes2_Ch4:: ; 9f08 (2:5f08) dspeed 12 - dnote 2, snare3 + snare3 2 rest 2 - dnote 1, snare3 + snare3 1 rest 5 - dnote 1, snare3 - dnote 1, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 + snare3 1 + snare3 1 + snare3 2 + snare3 2 + snare3 2 rest 2 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 3, snare3 - dnote 3, snare3 + snare3 2 + snare3 2 + snare3 2 + snare3 3 + snare3 3 dspeed 12 - dnote 1, snare3 + snare3 1 rest 3 - dnote 2, snare3 + snare3 2 rest 2 - dnote 2, snare3 + snare3 2 rest 4 - dnote 1, snare3 - dnote 1, snare3 - dnote 2, snare3 + snare3 1 + snare3 1 + snare3 2 rest 2 - dnote 2, snare3 + snare3 2 rest 2 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 3, snare3 - dnote 3, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 3, snare3 + snare3 2 + snare3 2 + snare3 2 + snare3 3 + snare3 3 + snare3 2 + snare3 2 + snare3 2 + snare3 3 rest 3 dspeed 12 - dnote 1, snare3 + snare3 1 rest 5 - dnote 1, snare3 - dnote 1, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 + snare3 1 + snare3 1 + snare3 2 + snare3 2 + snare3 2 rest 2 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 3, snare3 + snare3 2 + snare3 2 + snare3 2 + snare3 3 rest 3 dspeed 12 - dnote 1, snare3 + snare3 1 rest 3 - dnote 2, snare3 + snare3 2 rest 2 - dnote 2, snare3 + snare3 2 rest 4 - dnote 1, snare3 - dnote 1, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 + snare3 1 + snare3 1 + snare3 2 + snare3 2 + snare3 2 rest 2 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 3, snare3 + snare3 2 + snare3 2 + snare3 2 + snare3 3 rest 3 - dnote 3, snare3 - dnote 3, snare3 - dnote 3, snare3 + snare3 3 + snare3 3 + snare3 3 rest 3 dspeed 12 - dnote 1, snare3 + snare3 1 rest 5 - dnote 1, snare3 - dnote 1, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 + snare3 1 + snare3 1 + snare3 2 + snare3 2 + snare3 2 rest 2 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 3, snare3 + snare3 2 + snare3 2 + snare3 2 + snare3 3 rest 3 - dnote 3, snare3 + snare3 3 rest 3 loopchannel 0, Music_Routes2_Ch4 endchannel -; 0x9fad
\ No newline at end of file +; 0x9fad diff --git a/audio/music/routes3.asm b/audio/music/routes3.asm index 781d5c32..e62ca9bd 100644 --- a/audio/music/routes3.asm +++ b/audio/music/routes3.asm @@ -1,79 +1,79 @@ Music_Routes3_Ch1:: ; 9fad (2:5fad) - tempo 0, 148 - stereopanning 119 + tempo 148 + volume 7, 7 duty 3 vibrato 6, 3, 4 - togglecall + toggleperfectpitch notetype 12, 11, 5 octave 3 - note E_, 1 - note F#, 1 - note G_, 6 - note F_, 1 - note G_, 1 - note E_, 1 + E_ 1 + F# 1 + G_ 6 + F_ 1 + G_ 1 + E_ 1 rest 16 rest 15 Music_Routes3_branch_9fc3:: notetype 12, 11, 5 - note E_, 6 - note D_, 1 - note E_, 1 - note C_, 4 - note E_, 4 - note C_, 6 - note D_, 1 - note E_, 1 - note F_, 2 - note G_, 2 - note G_, 2 - note A_, 2 + E_ 6 + D_ 1 + E_ 1 + C_ 4 + E_ 4 + C_ 6 + D_ 1 + E_ 1 + F_ 2 + G_ 2 + G_ 2 + A_ 2 notetype 12, 10, 7 - note A#, 8 - note F_, 8 - note D_, 8 - note F_, 8 + A# 8 + F_ 8 + D_ 8 + F_ 8 notetype 12, 11, 5 - note E_, 6 - note D_, 1 - note E_, 1 - note C_, 4 - note E_, 4 - note C_, 6 - note D_, 1 - note E_, 1 - note F_, 2 - note G_, 2 - note G_, 2 - note A_, 2 + E_ 6 + D_ 1 + E_ 1 + C_ 4 + E_ 4 + C_ 6 + D_ 1 + E_ 1 + F_ 2 + G_ 2 + G_ 2 + A_ 2 notetype 12, 10, 7 - note A#, 8 - note A#, 8 - note D_, 8 - note F_, 8 + A# 8 + A# 8 + D_ 8 + F_ 8 notetype 12, 11, 5 - note E_, 4 - note E_, 2 - note F_, 2 - note G_, 4 - note F_, 2 - note E_, 2 - note B_, 2 + E_ 4 + E_ 2 + F_ 2 + G_ 4 + F_ 2 + E_ 2 + B_ 2 octave 2 - note G_, 4 + G_ 4 octave 3 - note B_, 8 - note A_, 2 + B_ 8 + A_ 2 notetype 8, 12, 3 - note A_, 4 - note F_, 4 - note A_, 4 + A_ 4 + F_ 4 + A_ 4 notetype 8, 4, 15 - note A_, 12 + A_ 12 notetype 8, 9, 0 - note F_, 12 - note G_, 12 + F_ 12 + G_ 12 loopchannel 0, Music_Routes3_branch_9fc3 @@ -82,13 +82,13 @@ Music_Routes3_Ch2:: ; a009 (2:6009) duty 2 notetype 12, 12, 7 octave 3 - note G_, 1 - note A#, 1 - note B_, 6 - note A_, 1 - note B_, 1 + G_ 1 + A# 1 + B_ 6 + A_ 1 + B_ 1 octave 4 - note C_, 1 + C_ 1 rest 15 rest 16 @@ -96,85 +96,85 @@ Music_Routes3_branch_a01a:: notetype 12, 12, 7 duty 2 octave 4 - note C_, 6 + C_ 6 octave 3 - note G_, 1 + G_ 1 octave 4 - note C_, 1 - note E_, 10 + C_ 1 + E_ 10 octave 3 - note G_, 2 + G_ 2 octave 4 - note C_, 2 - note G_, 2 - note F_, 2 - note E_, 2 - note D_, 2 - note C_, 2 - note D_, 8 - note F_, 8 + C_ 2 + G_ 2 + F_ 2 + E_ 2 + D_ 2 + C_ 2 + D_ 8 + F_ 8 notetype 12, 12, 5 duty 3 octave 3 - note A#, 8 - note A_, 8 + A# 8 + A_ 8 notetype 12, 12, 7 duty 2 octave 4 - note C_, 6 + C_ 6 octave 3 - note G_, 1 + G_ 1 octave 4 - note C_, 1 - note E_, 10 + C_ 1 + E_ 10 octave 3 - note G_, 2 + G_ 2 octave 4 - note C_, 2 - note G_, 2 - note F_, 2 - note E_, 2 - note D_, 2 - note C_, 2 - note D_, 8 - note F_, 8 + C_ 2 + G_ 2 + F_ 2 + E_ 2 + D_ 2 + C_ 2 + D_ 8 + F_ 8 notetype 12, 12, 5 duty 3 octave 3 - note A#, 8 + A# 8 octave 4 - note D_, 6 + D_ 6 notetype 12, 12, 7 duty 2 - note C_, 1 - note D_, 1 - note E_, 2 - note D_, 2 - note E_, 2 - note C_, 8 + C_ 1 + D_ 1 + E_ 2 + D_ 2 + E_ 2 + C_ 8 octave 3 - note B_, 1 + B_ 1 octave 4 - note C_, 1 - note D_, 2 + C_ 1 + D_ 2 octave 3 - note G_, 4 + G_ 4 octave 4 - note G_, 8 - note F_, 1 - note E_, 1 + G_ 8 + F_ 1 + E_ 1 notetype 8, 13, 3 - note F_, 4 - note E_, 4 + F_ 4 + E_ 4 notetype 8, 12, 4 - note C_, 4 + C_ 4 notetype 8, 12, 5 - note C_, 12 + C_ 12 notetype 12, 10, 0 duty 3 octave 3 - note A_, 8 - note B_, 8 + A_ 8 + B_ 8 loopchannel 0, Music_Routes3_branch_a01a @@ -182,335 +182,335 @@ Music_Routes3_Ch3:: ; a07f (2:607f) vibrato 4, 1, 0 notetype 6, 1, 2 octave 4 - note G_, 2 - note A#, 2 - note B_, 8 - note A_, 8 - note G_, 2 + G_ 2 + A# 2 + B_ 8 + A_ 8 + G_ 2 rest 2 - note G_, 7 + G_ 7 rest 1 - note G_, 1 + G_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note G_, 2 + G_ 2 rest 2 - note G_, 2 + G_ 2 rest 2 - note G_, 8 - note G_, 2 + G_ 8 + G_ 2 rest 2 - note G_, 7 + G_ 7 rest 1 - note G_, 1 + G_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note G_, 2 + G_ 2 rest 2 - note G_, 2 + G_ 2 rest 2 - note G_, 8 + G_ 8 Music_Routes3_branch_a0a3:: notetype 12, 1, 2 - note E_, 1 + E_ 1 rest 1 - note G_, 4 - note E_, 1 - note E_, 1 - note E_, 1 + G_ 4 + E_ 1 + E_ 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 4 - note E_, 1 + G_ 4 + E_ 1 rest 1 - note G_, 4 - note E_, 1 - note E_, 1 - note E_, 1 + G_ 4 + E_ 1 + E_ 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 2 - note A_, 2 - note F_, 1 + G_ 2 + A_ 2 + F_ 1 rest 1 - note A#, 4 - note F_, 1 - note F_, 1 - note F_, 1 + A# 4 + F_ 1 + F_ 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note A#, 4 - note F_, 1 + A# 4 + F_ 1 rest 1 - note A#, 4 - note F_, 1 - note F_, 1 - note F_, 1 + A# 4 + F_ 1 + F_ 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note A#, 2 - note F_, 2 - note E_, 1 + A# 2 + F_ 2 + E_ 1 rest 1 - note G_, 4 - note E_, 1 - note E_, 1 - note E_, 1 + G_ 4 + E_ 1 + E_ 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 4 - note E_, 1 + G_ 4 + E_ 1 rest 1 - note G_, 4 - note E_, 1 - note E_, 1 - note E_, 1 + G_ 4 + E_ 1 + E_ 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 2 - note A_, 2 - note F_, 1 + G_ 2 + A_ 2 + F_ 1 rest 1 - note A#, 4 - note F_, 1 - note F_, 1 - note F_, 1 + A# 4 + F_ 1 + F_ 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note A#, 4 - note F_, 1 + A# 4 + F_ 1 rest 1 - note A#, 4 - note F_, 1 - note F_, 1 - note F_, 1 + A# 4 + F_ 1 + F_ 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note A#, 2 - note A_, 2 - note G_, 1 + A# 2 + A_ 2 + G_ 1 rest 1 octave 5 - note C_, 4 + C_ 4 octave 4 - note G_, 1 - note G_, 1 - note G_, 1 + G_ 1 + G_ 1 + G_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 octave 5 - note C_, 4 + C_ 4 octave 4 - note G_, 1 + G_ 1 rest 1 octave 5 - note D_, 4 + D_ 4 octave 4 - note G_, 1 - note G_, 1 - note G_, 1 + G_ 1 + G_ 1 + G_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 octave 5 - note D_, 4 + D_ 4 octave 4 - note F_, 1 + F_ 1 rest 1 octave 5 - note C_, 4 + C_ 4 octave 4 - note F_, 1 - note F_, 1 - note F_, 1 + F_ 1 + F_ 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 octave 5 - note C_, 4 + C_ 4 octave 4 - note F_, 1 + F_ 1 rest 1 - note A_, 4 - note F_, 1 - note F_, 1 - note F_, 1 + A_ 4 + F_ 1 + F_ 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note A_, 4 + A_ 4 loopchannel 0, Music_Routes3_branch_a0a3 Music_Routes3_Ch4:: ; a131 (2:6131) dspeed 6 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 8, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 12, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare3 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 12, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare3 - dnote 4, mutedsnare2 - dnote 4, mutedsnare3 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 8 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 12 + mutedsnare2 2 + mutedsnare3 2 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 12 + mutedsnare2 2 + mutedsnare3 2 + mutedsnare2 4 + mutedsnare3 4 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 Music_Routes3_branch_a17a:: - dnote 12, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare3 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 12, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 8, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 12, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare3 - dnote 4, mutedsnare2 - dnote 10, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 12, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare4 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 12, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 8, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 12, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 10, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 12, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 8, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 12, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 12, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 10, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 12, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 8, mutedsnare2 - dnote 1, mutedsnare3 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare4 - dnote 12, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 8, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 12, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 + mutedsnare2 12 + mutedsnare2 2 + mutedsnare3 2 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 12 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare2 8 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 12 + mutedsnare2 2 + mutedsnare3 2 + mutedsnare2 4 + mutedsnare2 10 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare2 12 + mutedsnare2 2 + mutedsnare4 2 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 12 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare2 8 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 12 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare2 10 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare2 12 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare2 8 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 12 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 12 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare2 10 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare2 12 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare2 8 + mutedsnare3 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare4 1 + mutedsnare2 12 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare2 8 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 12 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 loopchannel 0, Music_Routes3_branch_a17a -; 0xa26a
\ No newline at end of file +; 0xa26a diff --git a/audio/music/routes4.asm b/audio/music/routes4.asm index 3f0858be..742244bc 100644 --- a/audio/music/routes4.asm +++ b/audio/music/routes4.asm @@ -1,140 +1,140 @@ Music_Routes4_Ch1:: ; a26a (2:626a) - tempo 0, 148 - stereopanning 119 + tempo 148 + volume 7, 7 duty 3 vibrato 10, 3, 4 - togglecall + toggleperfectpitch notetype 12, 10, 2 octave 2 - note G#, 4 - note G#, 4 - note G#, 4 + G# 4 + G# 4 + G# 4 notetype 12, 7, 15 - note G#, 4 + G# 4 notetype 12, 10, 2 - note G#, 4 - note G#, 4 - note G#, 4 + G# 4 + G# 4 + G# 4 notetype 12, 11, 7 - note B_, 1 + B_ 1 octave 3 - note E_, 1 - note F#, 1 - note B_, 1 + E_ 1 + F# 1 + B_ 1 Music_Routes4_branch_a28a:: notetype 12, 11, 7 - note B_, 6 - note E_, 2 - note E_, 4 + B_ 6 + E_ 2 + E_ 4 octave 4 - note E_, 4 - note D_, 4 - note C#, 4 + E_ 4 + D_ 4 + C# 4 octave 3 - note B_, 4 - note A_, 4 + B_ 4 + A_ 4 notetype 12, 11, 1 - note G#, 3 + G# 3 notetype 12, 11, 7 - note E_, 1 - note F#, 12 - note E_, 8 - note D#, 4 - note F#, 4 - note B_, 6 - note E_, 2 - note E_, 4 + E_ 1 + F# 12 + E_ 8 + D# 4 + F# 4 + B_ 6 + E_ 2 + E_ 4 octave 4 - note E_, 4 - note D_, 4 - note C#, 4 + E_ 4 + D_ 4 + C# 4 octave 3 - note B_, 4 + B_ 4 octave 4 - note C#, 4 + C# 4 notetype 12, 11, 1 - note E_, 3 + E_ 3 notetype 12, 11, 7 - note D#, 1 - note E_, 12 + D# 1 + E_ 12 octave 3 - note B_, 3 - note A_, 1 - note G#, 8 + B_ 3 + A_ 1 + G# 8 octave 4 - note E_, 4 + E_ 4 octave 3 - note D_, 2 - note E_, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note B_, 2 + D_ 2 + E_ 2 + F# 2 + G# 2 + A_ 2 + B_ 2 octave 4 - note C#, 2 - note D_, 2 - note D_, 2 + C# 2 + D_ 2 + D_ 2 octave 3 - note A_, 2 - note F#, 2 - note E_, 2 - note D_, 2 - note E_, 2 - note F#, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note B_, 2 + A_ 2 + F# 2 + E_ 2 + D_ 2 + E_ 2 + F# 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + F# 2 + G# 2 + A_ 2 + B_ 2 octave 4 - note D#, 2 - note E_, 2 + D# 2 + E_ 2 octave 3 - note B_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note F#, 2 - note G#, 2 - note B_, 2 + B_ 2 + G# 2 + F# 2 + E_ 2 + F# 2 + G# 2 + B_ 2 notetype 8, 11, 5 - note A_, 4 - note G#, 4 - note F#, 4 + A_ 4 + G# 4 + F# 4 octave 4 - note E_, 4 - note D#, 4 - note C#, 4 - note C#, 4 + E_ 4 + D# 4 + C# 4 + C# 4 octave 3 - note B_, 4 - note A_, 4 - note B_, 4 + B_ 4 + A_ 4 + B_ 4 octave 4 - note C#, 4 - note D#, 4 + C# 4 + D# 4 octave 3 - note E_, 3 - note F#, 3 - note G#, 3 - note A_, 3 - note B_, 4 + E_ 3 + F# 3 + G# 3 + A_ 3 + B_ 4 octave 4 - note C#, 4 - note D#, 4 - note E_, 3 + C# 4 + D# 4 + E_ 3 octave 3 - note B_, 3 - note G#, 3 - note F#, 3 - note E_, 3 - note F#, 3 - note G#, 3 - note A_, 3 + B_ 3 + G# 3 + F# 3 + E_ 3 + F# 3 + G# 3 + A_ 3 loopchannel 0, Music_Routes4_branch_a28a @@ -143,365 +143,365 @@ Music_Routes4_Ch2:: ; a304 (2:6304) duty 1 notetype 12, 9, 2 octave 3 - note E_, 3 - note F#, 1 + E_ 3 + F# 1 notetype 12, 9, 0 - note E_, 12 + E_ 12 notetype 12, 9, 2 octave 2 - note B_, 3 + B_ 3 octave 3 - note C_, 1 + C_ 1 notetype 12, 9, 0 octave 2 - note B_, 8 + B_ 8 duty 3 notetype 12, 12, 7 octave 3 - note E_, 1 - note F#, 1 - note B_, 1 + E_ 1 + F# 1 + B_ 1 octave 4 - note D#, 1 + D# 1 Music_Routes4_branch_a325:: notetype 12, 12, 7 - note E_, 6 + E_ 6 octave 3 - note B_, 2 - note B_, 4 + B_ 2 + B_ 4 octave 4 - note B_, 4 - note A_, 4 - note G#, 4 - note F#, 4 - note F#, 1 - note A_, 1 - note G#, 1 - note F#, 1 + B_ 4 + A_ 4 + G# 4 + F# 4 + F# 1 + A_ 1 + G# 1 + F# 1 notetype 12, 12, 2 - note G#, 3 - note E_, 1 + G# 3 + E_ 1 notetype 12, 10, 0 octave 3 - note B_, 12 + B_ 12 duty 0 notetype 12, 12, 2 octave 2 - note B_, 3 + B_ 3 notetype 12, 12, 7 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 8 + B_ 8 octave 3 - note D#, 4 + D# 4 duty 3 octave 4 - note E_, 6 + E_ 6 octave 3 - note B_, 2 - note B_, 4 + B_ 2 + B_ 4 octave 4 - note B_, 4 - note A_, 4 - note G#, 4 - note F#, 4 - note A_, 1 + B_ 4 + A_ 4 + G# 4 + F# 4 + A_ 1 octave 5 - note C#, 1 + C# 1 octave 4 - note B_, 1 - note A_, 1 + B_ 1 + A_ 1 notetype 12, 12, 2 - note B_, 3 + B_ 3 notetype 12, 12, 7 - note A_, 1 + A_ 1 notetype 12, 11, 0 - note G#, 6 + G# 6 notetype 12, 9, 0 - note G#, 6 + G# 6 notetype 12, 7, 0 - note G#, 6 + G# 6 notetype 12, 6, 15 - note G#, 6 + G# 6 notetype 12, 12, 7 - note G#, 4 + G# 4 notetype 8, 12, 3 - note A_, 4 - note G#, 4 - note F#, 4 + A_ 4 + G# 4 + F# 4 notetype 8, 9, 0 - note F#, 6 + F# 6 notetype 8, 7, 15 - note F#, 6 + F# 6 duty 0 notetype 8, 9, 0 octave 3 - note F#, 4 - note E_, 4 - note F#, 4 - note A_, 6 + F# 4 + E_ 4 + F# 4 + A_ 6 duty 3 notetype 8, 12, 7 octave 4 - note F#, 6 - note G#, 4 - note F#, 4 + F# 6 + G# 4 + F# 4 notetype 8, 12, 4 - note E_, 4 + E_ 4 notetype 8, 10, 0 - note E_, 12 + E_ 12 duty 0 notetype 8, 9, 0 octave 3 - note E_, 4 - note D#, 4 - note E_, 4 - note G#, 6 + E_ 4 + D# 4 + E_ 4 + G# 6 duty 3 notetype 8, 12, 7 octave 4 - note E_, 6 - note F#, 4 - note D#, 4 + E_ 6 + F# 4 + D# 4 octave 3 - note B_, 4 + B_ 4 notetype 8, 10, 0 octave 4 - note B_, 16 + B_ 16 notetype 8, 10, 7 - note B_, 8 + B_ 8 notetype 8, 11, 0 - note A_, 6 + A_ 6 notetype 8, 11, 7 - note A_, 6 + A_ 6 notetype 12, 10, 7 - note G#, 1 - note F#, 1 + G# 1 + F# 1 notetype 12, 11, 0 - note E_, 12 + E_ 12 notetype 12, 10, 0 - note E_, 8 + E_ 8 notetype 12, 10, 7 - note E_, 10 + E_ 10 loopchannel 0, Music_Routes4_branch_a325 Music_Routes4_Ch3:: ; a3c4 (2:63c4) notetype 12, 1, 0 octave 4 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 3 - note D#, 1 + D# 1 rest 3 Music_Routes4_branch_a3d7:: - note E_, 1 + E_ 1 rest 3 - note E_, 1 - note E_, 1 - note E_, 1 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 + E_ 1 + E_ 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 1 - note F#, 1 + F# 1 rest 3 - note F#, 1 - note F#, 1 - note F#, 1 - note F#, 1 - note F#, 1 + F# 1 + F# 1 + F# 1 + F# 1 + F# 1 rest 1 - note F#, 1 + F# 1 rest 3 - note A_, 1 + A_ 1 rest 1 - note G#, 1 + G# 1 rest 3 - note G#, 1 - note G#, 1 - note G#, 1 - note G#, 1 - note G#, 1 + G# 1 + G# 1 + G# 1 + G# 1 + G# 1 rest 1 - note G#, 1 + G# 1 rest 3 - note G#, 1 + G# 1 rest 1 - note G#, 1 + G# 1 rest 3 - note G#, 1 - note G#, 1 - note G#, 1 - note G#, 1 - note G#, 1 + G# 1 + G# 1 + G# 1 + G# 1 + G# 1 rest 1 - note G#, 1 + G# 1 rest 3 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 3 - note E_, 1 - note E_, 1 - note E_, 1 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 + E_ 1 + E_ 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 1 - note F#, 1 + F# 1 rest 3 - note F#, 1 - note F#, 1 - note F#, 1 - note F#, 1 - note F#, 1 + F# 1 + F# 1 + F# 1 + F# 1 + F# 1 rest 1 - note F#, 1 + F# 1 rest 3 - note A_, 1 + A_ 1 rest 1 - note B_, 1 + B_ 1 rest 3 - note B_, 1 - note B_, 1 - note B_, 1 - note B_, 1 - note B_, 1 + B_ 1 + B_ 1 + B_ 1 + B_ 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 3 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 3 - note E_, 1 - note E_, 1 - note E_, 1 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 + E_ 1 + E_ 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F#, 1 + F# 1 rest 3 - note F#, 1 - note F#, 1 - note F#, 1 - note F#, 1 - note F#, 1 + F# 1 + F# 1 + F# 1 + F# 1 + F# 1 rest 1 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 1 - note D_, 1 + D_ 1 rest 3 - note D_, 1 - note D_, 1 - note D_, 1 - note D_, 1 - note D_, 1 + D_ 1 + D_ 1 + D_ 1 + D_ 1 + D_ 1 rest 1 - note D_, 1 + D_ 1 rest 3 - note D_, 1 + D_ 1 rest 1 - note E_, 1 + E_ 1 rest 3 - note E_, 1 - note E_, 1 - note E_, 1 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 + E_ 1 + E_ 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 3 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 3 - note G#, 1 - note G#, 1 - note G#, 1 - note G#, 1 - note G#, 1 + G# 1 + G# 1 + G# 1 + G# 1 + G# 1 rest 1 - note G#, 1 + G# 1 rest 3 - note G#, 1 + G# 1 rest 1 - note F#, 1 + F# 1 rest 3 - note F#, 1 - note F#, 1 - note F#, 1 - note F#, 1 - note F#, 1 + F# 1 + F# 1 + F# 1 + F# 1 + F# 1 rest 1 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 1 - note B_, 1 + B_ 1 rest 3 - note B_, 1 - note B_, 1 - note B_, 1 - note B_, 1 - note B_, 1 + B_ 1 + B_ 1 + B_ 1 + B_ 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 3 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 3 - note G#, 1 - note G#, 1 - note G#, 1 - note G#, 1 - note G#, 1 + G# 1 + G# 1 + G# 1 + G# 1 + G# 1 rest 1 - note G#, 1 + G# 1 rest 3 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 3 - note E_, 1 - note E_, 1 - note E_, 1 - note E_, 1 - note E_, 1 + E_ 1 + E_ 1 + E_ 1 + E_ 1 + E_ 1 rest 1 - note E_, 1 + E_ 1 rest 3 - note D#, 1 + D# 1 rest 1 loopchannel 0, Music_Routes4_branch_a3d7 @@ -510,173 +510,173 @@ Music_Routes4_Ch4:: ; a49d (2:649d) dspeed 12 rest 16 rest 12 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 Music_Routes4_branch_a4a8:: - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 2, mutedsnare3 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 2, mutedsnare2 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 4, mutedsnare2 - dnote 1, mutedsnare4 - dnote 1, mutedsnare4 - dnote 1, mutedsnare3 - dnote 1, mutedsnare3 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 - dnote 2, mutedsnare2 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare3 2 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare2 2 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare2 4 + mutedsnare4 1 + mutedsnare4 1 + mutedsnare3 1 + mutedsnare3 1 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 2 + mutedsnare2 2 loopchannel 0, Music_Routes4_branch_a4a8 -; 0xa5f0
\ No newline at end of file +; 0xa5f0 diff --git a/audio/music/safarizone.asm b/audio/music/safarizone.asm index 679ba0bd..3e0657fd 100644 --- a/audio/music/safarizone.asm +++ b/audio/music/safarizone.asm @@ -1,41 +1,41 @@ Music_SafariZone_Ch1:: ; bc2e (2:7c2e) - tempo 0, 132 - stereopanning 119 + tempo 132 + volume 7, 7 vibrato 6, 3, 4 - togglecall + toggleperfectpitch duty 2 notetype 12, 9, 2 octave 3 pitchbend 0, 73 - note C_, 1 + C_ 1 pitchbend 0, 73 - note G_, 1 + G_ 1 pitchbend 0, 73 - note C_, 1 + C_ 1 pitchbend 0, 73 - note G_, 1 + G_ 1 rest 4 duty 3 Music_SafariZone_branch_bc4f:: callchannel Music_SafariZone_branch_bc5f notetype 12, 10, 4 - note F#, 4 + F# 4 callchannel Music_SafariZone_branch_bc5f notetype 12, 10, 4 - note F#, 4 + F# 4 loopchannel 0, Music_SafariZone_branch_bc4f Music_SafariZone_branch_bc5f:: notetype 12, 10, 2 octave 3 - note C_, 4 - note G_, 4 - note C_, 4 - note G_, 4 - note C_, 4 - note G_, 4 - note C_, 4 + C_ 4 + G_ 4 + C_ 4 + G_ 4 + C_ 4 + G_ 4 + C_ 4 endchannel @@ -44,32 +44,32 @@ Music_SafariZone_Ch2:: ; bc6a (2:7c6a) vibrato 8, 2, 5 notetype 12, 10, 2 octave 4 - note G_, 1 - note D_, 1 - note G_, 1 - note D_, 1 + G_ 1 + D_ 1 + G_ 1 + D_ 1 rest 4 duty 3 Music_SafariZone_branch_bc79:: callchannel Music_SafariZone_branch_bc89 notetype 12, 11, 5 - note A_, 4 + A_ 4 callchannel Music_SafariZone_branch_bc89 notetype 12, 11, 5 - note B_, 4 + B_ 4 loopchannel 0, Music_SafariZone_branch_bc79 Music_SafariZone_branch_bc89:: notetype 12, 11, 2 octave 3 - note G_, 4 - note D_, 4 - note G_, 4 - note D_, 4 - note G_, 4 - note D_, 4 - note G_, 4 + G_ 4 + D_ 4 + G_ 4 + D_ 4 + G_ 4 + D_ 4 + G_ 4 endchannel @@ -80,33 +80,33 @@ Music_SafariZone_Ch3:: ; bc94 (2:7c94) Music_SafariZone_branch_bc97:: callchannel Music_SafariZone_branch_bca5 octave 4 - note A_, 4 + A_ 4 callchannel Music_SafariZone_branch_bca5 octave 4 - note B_, 4 + B_ 4 loopchannel 0, Music_SafariZone_branch_bc97 Music_SafariZone_branch_bca5:: octave 3 - note A_, 2 + A_ 2 rest 2 octave 4 - note D_, 2 + D_ 2 rest 2 octave 3 - note A_, 2 + A_ 2 rest 2 octave 4 - note D_, 2 + D_ 2 rest 2 octave 3 - note A_, 2 + A_ 2 rest 2 octave 4 - note D_, 2 + D_ 2 rest 2 octave 3 - note A_, 2 + A_ 2 rest 2 endchannel -; 0xbcbb
\ No newline at end of file +; 0xbcbb diff --git a/audio/music/silphco.asm b/audio/music/silphco.asm index b6c70ec7..c5cb1675 100644 --- a/audio/music/silphco.asm +++ b/audio/music/silphco.asm @@ -1,397 +1,397 @@ Music_SilphCo_Ch1:: ; 7f243 (1f:7243) - tempo 0, 160 - stereopanning 119 + tempo 160 + volume 7, 7 duty 3 - togglecall + toggleperfectpitch vibrato 8, 2, 2 notetype 6, 11, 3 octave 2 - note E_, 1 - note F#, 1 - note G#, 1 - note A#, 1 + E_ 1 + F# 1 + G# 1 + A# 1 octave 3 - note C_, 1 + C_ 1 notetype 6, 10, 0 - note C_, 12 + C_ 12 notetype 6, 11, 3 - note C_, 2 + C_ 2 octave 2 - note B_, 1 - note A#, 1 - note G#, 1 - note F#, 1 - note E_, 1 - note E_, 2 + B_ 1 + A# 1 + G# 1 + F# 1 + E_ 1 + E_ 2 rest 2 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 2 Music_SilphCo_branch_7f26d:: - note G_, 2 + G_ 2 rest 2 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note A#, 2 + A# 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 2 octave 3 - note C_, 2 + C_ 2 rest 2 - note C_, 2 + C_ 2 rest 6 - note C_, 2 + C_ 2 rest 6 - note C_, 2 + C_ 2 rest 6 - note C_, 2 + C_ 2 rest 6 octave 2 - note A#, 2 + A# 2 rest 6 - note B_, 2 + B_ 2 rest 2 - note G_, 2 + G_ 2 rest 10 - note E_, 1 - note F#, 1 - note G#, 1 - note A_, 1 + E_ 1 + F# 1 + G# 1 + A_ 1 notetype 6, 10, 0 - note B_, 12 + B_ 12 notetype 6, 11, 3 - note B_, 1 - note A_, 1 - note G_, 1 - note F_, 1 - note E_, 1 + B_ 1 + A_ 1 + G_ 1 + F_ 1 + E_ 1 rest 11 - note F_, 1 - note G#, 1 - note A#, 1 - note B_, 1 + F_ 1 + G# 1 + A# 1 + B_ 1 notetype 6, 10, 0 octave 3 - note C_, 12 + C_ 12 notetype 6, 11, 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A_, 1 - note G_, 1 - note F_, 1 + B_ 1 + A_ 1 + G_ 1 + F_ 1 rest 11 - note F#, 1 - note B_, 1 + F# 1 + B_ 1 octave 3 - note C_, 1 - note C#, 1 + C_ 1 + C# 1 notetype 6, 10, 0 - note D_, 12 + D_ 12 notetype 6, 11, 3 - note D_, 1 - note C_, 1 + D_ 1 + C_ 1 octave 2 - note A#, 1 - note G_, 1 - note F_, 1 + A# 1 + G_ 1 + F_ 1 rest 11 - note F_, 1 - note G#, 1 - note A#, 1 - note B_, 1 + F_ 1 + G# 1 + A# 1 + B_ 1 notetype 6, 10, 0 octave 3 - note C_, 12 + C_ 12 notetype 6, 11, 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note G#, 1 - note F_, 1 - note E_, 1 + B_ 1 + G# 1 + F_ 1 + E_ 1 rest 7 notetype 6, 8, 0 - note B_, 16 + B_ 16 notetype 6, 11, 0 octave 3 - note E_, 8 - tempo 0, 124 + E_ 8 + tempo 124 notetype 6, 11, 3 octave 2 - note B_, 2 + B_ 2 rest 10 - note B_, 2 + B_ 2 rest 10 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 16 rest 6 - note A_, 2 + A_ 2 rest 6 - note B_, 2 - note A#, 2 - note B_, 2 + B_ 2 + A# 2 + B_ 2 octave 3 - note C_, 2 + C_ 2 octave 2 - note B_, 2 - note A#, 2 - note B_, 2 - note A#, 2 - note B_, 2 + B_ 2 + A# 2 + B_ 2 + A# 2 + B_ 2 octave 3 - note C_, 2 + C_ 2 octave 2 - note B_, 2 - note A#, 2 - note B_, 2 - note A#, 2 - note B_, 2 + B_ 2 + A# 2 + B_ 2 + A# 2 + B_ 2 octave 3 - note C_, 2 + C_ 2 octave 2 - note B_, 2 - note A#, 2 - note B_, 2 + B_ 2 + A# 2 + B_ 2 octave 3 - note C_, 2 + C_ 2 octave 2 - note B_, 2 - note A#, 2 - note B_, 2 + B_ 2 + A# 2 + B_ 2 octave 3 - note C_, 2 + C_ 2 octave 2 - note B_, 2 - note A#, 2 - note B_, 2 - note A#, 2 - note A_, 2 - note A#, 2 - note B_, 2 - note A#, 2 + B_ 2 + A# 2 + B_ 2 + A# 2 + A_ 2 + A# 2 + B_ 2 + A# 2 callchannel Music_SilphCo_branch_7f3f0 callchannel Music_SilphCo_branch_7f3f0 callchannel Music_SilphCo_branch_7f3f0 rest 4 - note C_, 2 + C_ 2 rest 6 - note C_, 2 + C_ 2 rest 6 - note C_, 2 + C_ 2 rest 6 octave 2 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note A#, 2 + A# 2 rest 6 - note A_, 2 + A_ 2 rest 6 - note A_, 2 + A_ 2 rest 6 - note A_, 2 + A_ 2 rest 6 - note A_, 2 + A_ 2 rest 6 - note A_, 2 + A_ 2 rest 6 - note A_, 2 + A_ 2 rest 6 - note A#, 2 + A# 2 rest 6 - note A#, 2 + A# 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 octave 3 - note C_, 2 + C_ 2 rest 6 - note C_, 2 + C_ 2 rest 6 octave 2 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 octave 3 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 octave 4 - note C_, 2 + C_ 2 rest 6 - note C_, 2 + C_ 2 rest 6 octave 2 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 octave 4 - note E_, 2 + E_ 2 rest 6 - note E_, 2 + E_ 2 rest 6 - note D#, 2 + D# 2 rest 6 - note D#, 2 + D# 2 rest 2 octave 2 - note B_, 1 - note A#, 1 - note G#, 1 - note F#, 1 - note E_, 1 + B_ 1 + A# 1 + G# 1 + F# 1 + E_ 1 notetype 6, 6, 0 - note E_, 16 - note E_, 11 + E_ 16 + E_ 11 notetype 6, 11, 3 - note E_, 1 - note F#, 1 - note G#, 1 - note A#, 1 + E_ 1 + F# 1 + G# 1 + A# 1 octave 3 - note C_, 1 + C_ 1 notetype 6, 3, 15 - note C_, 16 + C_ 16 notetype 6, 10, 0 - note C_, 11 + C_ 11 notetype 6, 9, 3 octave 2 - note B_, 1 - note A#, 1 - note G#, 1 - note F#, 1 - note E_, 1 + B_ 1 + A# 1 + G# 1 + F# 1 + E_ 1 notetype 6, 3, 15 - note E_, 16 + E_ 16 notetype 6, 9, 0 - note E_, 11 + E_ 11 notetype 6, 11, 3 - note F_, 1 - note G_, 1 - note A#, 1 + F_ 1 + G_ 1 + A# 1 octave 3 - note C_, 1 - note D_, 1 + C_ 1 + D_ 1 notetype 6, 3, 15 - note D_, 16 + D_ 16 notetype 6, 10, 7 - note D_, 11 + D_ 11 rest 4 rest 4 - tempo 0, 128 + tempo 128 rest 4 rest 4 - tempo 0, 136 + tempo 136 rest 4 rest 4 - tempo 0, 144 + tempo 144 rest 4 rest 4 - tempo 0, 160 + tempo 160 rest 4 rest 4 - tempo 0, 192 + tempo 192 rest 4 rest 4 - tempo 1, 32 + tempo 288 rest 4 rest 4 - tempo 1, 160 + tempo 416 rest 4 - tempo 4, 0 + tempo 1024 rest 4 - tempo 0, 160 + tempo 160 rest 4 notetype 6, 4, 3 octave 2 - note B_, 2 + B_ 2 rest 6 notetype 6, 6, 3 - note B_, 2 + B_ 2 rest 6 notetype 6, 8, 3 - note B_, 2 + B_ 2 rest 6 notetype 6, 5, 0 - note B_, 8 + B_ 8 notetype 6, 11, 3 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 2 loopchannel 0, Music_SilphCo_branch_7f26d Music_SilphCo_branch_7f3f0:: octave 2 - note B_, 2 - note A#, 2 - note B_, 2 + B_ 2 + A# 2 + B_ 2 octave 3 - note C_, 2 + C_ 2 octave 2 - note B_, 2 - note A#, 2 - note B_, 2 + B_ 2 + A# 2 + B_ 2 octave 3 - note C_, 2 + C_ 2 octave 2 - note B_, 2 - note A#, 2 - note B_, 2 + B_ 2 + A# 2 + B_ 2 octave 3 - note C_, 2 + C_ 2 octave 2 - note B_, 2 - note A#, 2 - note B_, 2 + B_ 2 + A# 2 + B_ 2 octave 3 - note C_, 2 + C_ 2 endchannel @@ -400,382 +400,382 @@ Music_SilphCo_Ch2:: ; 7f409 (1f:7409) duty 3 notetype 6, 12, 3 octave 3 - note E_, 1 - note F#, 1 - note G#, 1 - note A#, 1 + E_ 1 + F# 1 + G# 1 + A# 1 octave 4 - note C_, 1 + C_ 1 notetype 6, 11, 0 - note C_, 12 + C_ 12 notetype 6, 12, 3 - note C_, 2 + C_ 2 octave 3 - note B_, 1 - note A#, 1 - note G#, 1 - note F#, 1 - note E_, 1 - note E_, 2 + B_ 1 + A# 1 + G# 1 + F# 1 + E_ 1 + E_ 2 rest 2 octave 2 - note G_, 2 + G_ 2 rest 6 - note F#, 2 + F# 2 rest 6 - note G_, 2 + G_ 2 rest 6 - note G#, 2 + G# 2 rest 2 Music_SilphCo_branch_7f42e:: - note E_, 2 + E_ 2 rest 2 - note G_, 2 + G_ 2 rest 6 - note G_, 2 + G_ 2 rest 6 - note G_, 2 + G_ 2 rest 6 - note F#, 2 + F# 2 rest 6 - note G_, 2 + G_ 2 rest 6 - note G#, 2 + G# 2 rest 2 - note E_, 2 + E_ 2 rest 2 - note G#, 2 + G# 2 rest 6 - note G#, 2 + G# 2 rest 6 - note G#, 2 + G# 2 rest 6 - note G#, 2 + G# 2 rest 6 - note G#, 2 + G# 2 rest 6 - note G#, 2 + G# 2 rest 2 notetype 6, 11, 7 duty 2 octave 4 - note E_, 8 - note D#, 8 - note E_, 8 - note F_, 8 - note E_, 8 - note D#, 8 - note D_, 8 - note D#, 8 - note E_, 8 - note F_, 8 - note F#, 8 - note G_, 8 - note G#, 8 - note D#, 8 - note D_, 8 - note D#, 8 + E_ 8 + D# 8 + E_ 8 + F_ 8 + E_ 8 + D# 8 + D_ 8 + D# 8 + E_ 8 + F_ 8 + F# 8 + G_ 8 + G# 8 + D# 8 + D_ 8 + D# 8 duty 3 notetype 6, 6, 15 - note E_, 16 + E_ 16 notetype 6, 12, 0 - note B_, 16 + B_ 16 notetype 6, 12, 4 octave 3 - note E_, 4 - note D#, 4 - note E_, 4 - note F_, 4 - note E_, 4 - note D#, 4 - note D_, 4 - note D#, 4 - note E_, 4 - note F_, 4 - note F#, 4 - note G_, 4 - note G#, 4 - note D#, 4 - note D_, 4 - note D#, 4 + E_ 4 + D# 4 + E_ 4 + F_ 4 + E_ 4 + D# 4 + D_ 4 + D# 4 + E_ 4 + F_ 4 + F# 4 + G_ 4 + G# 4 + D# 4 + D_ 4 + D# 4 notetype 6, 12, 2 duty 1 octave 4 - note E_, 4 - note D#, 4 - note E_, 4 - note F_, 4 - note E_, 4 - note D#, 4 - note D_, 4 - note D#, 4 - note E_, 4 + E_ 4 + D# 4 + E_ 4 + F_ 4 + E_ 4 + D# 4 + D_ 4 + D# 4 + E_ 4 notetype 6, 12, 4 duty 3 octave 3 - note F_, 4 - note F#, 4 - note G_, 4 - note G#, 4 - note D#, 4 - note D_, 4 - note D#, 4 - note E_, 4 - note D#, 4 - note E_, 4 + F_ 4 + F# 4 + G_ 4 + G# 4 + D# 4 + D_ 4 + D# 4 + E_ 4 + D# 4 + E_ 4 notetype 6, 12, 0 - note F_, 8 + F_ 8 notetype 6, 11, 7 - note F_, 8 + F_ 8 notetype 6, 8, 10 - note F_, 4 + F_ 4 notetype 6, 12, 4 duty 3 - note F_, 4 - note E_, 4 - note F_, 4 + F_ 4 + E_ 4 + F_ 4 notetype 6, 10, 0 - note F#, 8 + F# 8 notetype 6, 11, 0 - note F#, 8 + F# 8 notetype 6, 9, 9 - note F#, 4 + F# 4 notetype 6, 12, 4 - note F#, 4 - note F_, 4 - note F#, 4 + F# 4 + F_ 4 + F# 4 notetype 6, 9, 0 - note G_, 12 + G_ 12 notetype 6, 5, 9 - note G_, 8 + G_ 8 notetype 6, 12, 4 - note G_, 4 - note F#, 4 - note G_, 4 - note F#, 4 - note F_, 4 - note F#, 4 - note F_, 4 - note E_, 4 - note F_, 4 - note E_, 4 - note D#, 4 - note D_, 4 - note C#, 4 - note D_, 4 - note D#, 4 - note D_, 4 + G_ 4 + F# 4 + G_ 4 + F# 4 + F_ 4 + F# 4 + F_ 4 + E_ 4 + F_ 4 + E_ 4 + D# 4 + D_ 4 + C# 4 + D_ 4 + D# 4 + D_ 4 notetype 6, 12, 2 duty 1 - note F_, 4 - note F#, 4 - note G_, 4 - note G#, 4 - note A_, 4 + F_ 4 + F# 4 + G_ 4 + G# 4 + A_ 4 notetype 6, 11, 4 duty 3 - note D#, 4 - note D_, 4 - note D#, 4 + D# 4 + D_ 4 + D# 4 notetype 6, 12, 2 duty 1 - note F_, 4 - note F#, 4 - note G_, 4 - note G#, 4 - note A#, 4 + F_ 4 + F# 4 + G_ 4 + G# 4 + A# 4 notetype 6, 11, 4 duty 3 - note D#, 4 - note D_, 4 - note D#, 4 + D# 4 + D_ 4 + D# 4 notetype 6, 12, 2 duty 1 - note F_, 4 - note F#, 4 - note G_, 4 - note G#, 4 - note B_, 4 + F_ 4 + F# 4 + G_ 4 + G# 4 + B_ 4 notetype 6, 11, 4 duty 3 - note D#, 4 - note D_, 4 - note D#, 4 + D# 4 + D_ 4 + D# 4 notetype 6, 12, 2 duty 1 - note F_, 4 - note F#, 4 - note G_, 4 - note G#, 4 + F_ 4 + F# 4 + G_ 4 + G# 4 octave 4 - note C_, 4 + C_ 4 notetype 6, 11, 4 duty 3 octave 3 - note D#, 4 - note D_, 4 - note D#, 4 + D# 4 + D_ 4 + D# 4 rest 4 - note G_, 2 + G_ 2 rest 6 - note G_, 2 + G_ 2 rest 6 - note G_, 2 + G_ 2 rest 6 - note G_, 2 + G_ 2 rest 2 duty 0 octave 4 - note E_, 2 + E_ 2 rest 2 - note G#, 2 + G# 2 rest 6 - note G#, 2 + G# 2 rest 6 - note G#, 2 + G# 2 rest 6 - note G#, 2 + G# 2 rest 6 duty 3 octave 3 - note G_, 2 + G_ 2 rest 6 - note G_, 2 + G_ 2 rest 6 - note G_, 2 + G_ 2 rest 6 - note G_, 2 + G_ 2 rest 2 duty 0 octave 4 - note E_, 2 + E_ 2 rest 2 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 2 duty 3 octave 3 - note G_, 2 + G_ 2 rest 2 - note G_, 2 + G_ 2 rest 2 - note B_, 2 + B_ 2 rest 2 - note G_, 2 + G_ 2 rest 2 - note B_, 2 + B_ 2 rest 2 - note G_, 2 + G_ 2 rest 2 - note B_, 2 + B_ 2 rest 2 - note G_, 2 + G_ 2 rest 2 octave 4 - note C_, 2 + C_ 2 rest 2 octave 3 - note G_, 2 + G_ 2 rest 2 octave 4 - note C_, 2 + C_ 2 rest 2 octave 3 - note G_, 2 + G_ 2 rest 2 octave 4 - note C_, 2 + C_ 2 rest 2 octave 3 - note G_, 2 + G_ 2 rest 2 octave 4 - note C_, 2 + C_ 2 rest 2 octave 3 - note G_, 2 + G_ 2 rest 2 - note B_, 2 + B_ 2 rest 2 - note G_, 2 + G_ 2 rest 2 - note B_, 2 + B_ 2 rest 2 - note G_, 2 + G_ 2 rest 2 - note B_, 2 + B_ 2 rest 2 - note G_, 2 + G_ 2 rest 2 - note E_, 2 + E_ 2 rest 2 - note G_, 2 + G_ 2 rest 2 octave 4 - note C_, 2 + C_ 2 rest 2 octave 3 - note G_, 2 + G_ 2 rest 2 - note E_, 2 + E_ 2 rest 2 - note G_, 2 + G_ 2 rest 2 - note B_, 2 + B_ 2 rest 2 - note G_, 2 + G_ 2 rest 2 octave 4 - note C_, 2 + C_ 2 rest 2 octave 3 - note G_, 2 + G_ 2 rest 2 notetype 6, 8, 7 octave 5 - note E_, 4 - note D#, 4 - note E_, 4 - note F_, 4 - note E_, 4 - note D#, 4 - note D_, 4 - note D#, 4 - note E_, 4 - note F_, 4 - note F#, 4 - note G_, 4 - note G#, 4 - note D#, 4 - note D_, 4 - note D#, 4 + E_ 4 + D# 4 + E_ 4 + F_ 4 + E_ 4 + D# 4 + D_ 4 + D# 4 + E_ 4 + F_ 4 + F# 4 + G_ 4 + G# 4 + D# 4 + D_ 4 + D# 4 rest 4 notetype 6, 4, 3 octave 2 - note G_, 2 + G_ 2 rest 6 notetype 6, 6, 3 - note F#, 2 + F# 2 rest 6 notetype 6, 8, 3 - note G_, 2 + G_ 2 rest 6 notetype 6, 4, 15 - note G#, 8 + G# 8 notetype 6, 11, 4 - note G_, 2 + G_ 2 rest 6 - note F#, 2 + F# 2 rest 6 - note G_, 2 + G_ 2 rest 6 - note G#, 2 + G# 2 rest 2 loopchannel 0, Music_SilphCo_branch_7f42e @@ -785,191 +785,191 @@ Music_SilphCo_Ch3:: ; 7f5be (1f:75be) notetype 12, 1, 1 rest 12 octave 5 - note E_, 4 - note D#, 4 - note E_, 4 - note F_, 4 + E_ 4 + D# 4 + E_ 4 + F_ 4 Music_SilphCo_branch_7f5c9:: - note E_, 4 - note D#, 4 - note D_, 4 - note D#, 4 - note E_, 4 - note F_, 4 - note F#, 4 - note G_, 4 - note G#, 4 - note D#, 4 - note D_, 4 - note D#, 4 - note E_, 1 + E_ 4 + D# 4 + D_ 4 + D# 4 + E_ 4 + F_ 4 + F# 4 + G_ 4 + G# 4 + D# 4 + D_ 4 + D# 4 + E_ 1 rest 1 - note G_, 1 + G_ 1 rest 3 - note F#, 1 + F# 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G_, 1 + G_ 1 rest 3 - note G#, 1 + G# 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note F#, 1 + F# 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note G#, 1 + G# 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note G#, 1 + G# 1 rest 3 - note G#, 1 + G# 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 1 octave 4 - note E_, 1 + E_ 1 rest 5 - note F_, 1 + F_ 1 rest 5 - note F_, 1 + F_ 1 rest 3 - note E_, 1 + E_ 1 rest 11 - note D#, 1 + D# 1 rest 3 - note E_, 1 + E_ 1 rest 5 - note F_, 1 + F_ 1 rest 5 - note F_, 1 + F_ 1 rest 3 - note E_, 1 + E_ 1 rest 11 - note D#, 1 + D# 1 rest 3 - note E_, 1 + E_ 1 rest 1 - note F_, 1 + F_ 1 rest 3 - note F_, 1 + F_ 1 rest 3 - note F_, 1 + F_ 1 rest 3 - note F_, 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 3 - note F#, 1 + F# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note F#, 1 + F# 1 rest 3 - note F_, 1 + F_ 1 rest 3 - note E_, 1 + E_ 1 rest 3 - note F_, 1 + F_ 1 rest 3 - note E_, 1 + E_ 1 rest 3 - note D#, 1 + D# 1 rest 3 - note D_, 1 + D_ 1 rest 1 - note D_, 8 - note F_, 8 - note D_, 8 - note F#, 8 - note D_, 8 - note G_, 8 - note D_, 8 - note A_, 8 - note E_, 4 - note D#, 4 - note E_, 4 - note F_, 4 + D_ 8 + F_ 8 + D_ 8 + F# 8 + D_ 8 + G_ 8 + D_ 8 + A_ 8 + E_ 4 + D# 4 + E_ 4 + F_ 4 octave 5 - note E_, 2 - note D#, 2 - note E_, 2 - note F_, 2 - note E_, 2 - note D#, 2 - note D_, 2 - note D#, 2 + E_ 2 + D# 2 + E_ 2 + F_ 2 + E_ 2 + D# 2 + D_ 2 + D# 2 octave 4 - note E_, 4 - note D#, 4 - note E_, 4 - note F_, 4 + E_ 4 + D# 4 + E_ 4 + F_ 4 octave 5 - note E_, 2 - note F_, 2 - note F#, 2 - note G_, 2 - note G#, 2 - note D#, 2 - note D_, 2 - note D#, 2 + E_ 2 + F_ 2 + F# 2 + G_ 2 + G# 2 + D# 2 + D_ 2 + D# 2 octave 6 - note E_, 4 - note D#, 4 - note E_, 4 - note F_, 4 - note E_, 4 - note D#, 4 - note D_, 4 - note D#, 4 - note E_, 4 - note F_, 4 - note F#, 4 - note G_, 4 - note G#, 4 - note D#, 4 - note D_, 4 - note D#, 4 + E_ 4 + D# 4 + E_ 4 + F_ 4 + E_ 4 + D# 4 + D_ 4 + D# 4 + E_ 4 + F_ 4 + F# 4 + G_ 4 + G# 4 + D# 4 + D_ 4 + D# 4 notetype 6, 1, 1 rest 4 rest 4 @@ -993,9 +993,9 @@ Music_SilphCo_branch_7f5c9:: rest 4 rest 4 octave 5 - note E_, 4 - note D#, 4 - note E_, 4 - note F_, 4 + E_ 4 + D# 4 + E_ 4 + F_ 4 loopchannel 0, Music_SilphCo_branch_7f5c9 -; 0x7f69d
\ No newline at end of file +; 0x7f69d diff --git a/audio/music/ssanne.asm b/audio/music/ssanne.asm index 675b67d1..db55e3b6 100644 --- a/audio/music/ssanne.asm +++ b/audio/music/ssanne.asm @@ -1,109 +1,109 @@ Music_SSAnne_Ch1:: ; b3a7 (2:73a7) - tempo 0, 128 - stereopanning 119 + tempo 128 + volume 7, 7 duty 1 vibrato 8, 3, 4 - togglecall + toggleperfectpitch Music_SSAnne_branch_b3b2:: notetype 12, 10, 4 rest 12 octave 3 - note E_, 2 - note F#, 2 - note E_, 4 - note D_, 4 - note C#, 2 - note D_, 2 - note E_, 2 + E_ 2 + F# 2 + E_ 4 + D_ 4 + C# 2 + D_ 2 + E_ 2 rest 2 - note E_, 4 - note F#, 2 - note D_, 2 - note E_, 4 - note F#, 4 - note G#, 4 + E_ 4 + F# 2 + D_ 2 + E_ 4 + F# 4 + G# 4 rest 4 - note E_, 4 - note G#, 4 + E_ 4 + G# 4 rest 4 - note C#, 2 - note E_, 2 - note F#, 4 - note D_, 4 - note E_, 4 - note D_, 4 - note C#, 2 - note D_, 2 - note E_, 2 + C# 2 + E_ 2 + F# 4 + D_ 4 + E_ 4 + D_ 4 + C# 2 + D_ 2 + E_ 2 rest 2 - note E_, 4 - note F#, 2 - note D_, 2 - note E_, 4 - note F#, 4 - note G#, 4 - note F#, 4 - note E_, 4 - note F#, 4 + E_ 4 + F# 2 + D_ 2 + E_ 4 + F# 4 + G# 4 + F# 4 + E_ 4 + F# 4 rest 4 - note C#, 2 - note E_, 2 - note F#, 4 - note D_, 4 - note E_, 4 - note D_, 4 - note C#, 2 - note D_, 2 - note E_, 2 + C# 2 + E_ 2 + F# 4 + D_ 4 + E_ 4 + D_ 4 + C# 2 + D_ 2 + E_ 2 rest 2 - note E_, 4 - note F#, 2 - note D_, 2 - note E_, 4 - note F#, 4 - note G#, 4 - note F#, 8 - note G#, 4 - note E_, 4 + E_ 4 + F# 2 + D_ 2 + E_ 4 + F# 4 + G# 4 + F# 8 + G# 4 + E_ 4 rest 4 - note E_, 4 - note F#, 2 - note E_, 2 - note D_, 4 + E_ 4 + F# 2 + E_ 2 + D_ 4 rest 4 - note D_, 4 - note E_, 4 - note C#, 4 + D_ 4 + E_ 4 + C# 4 rest 4 - note C#, 4 - note D_, 2 - note C#, 2 + C# 4 + D_ 2 + C# 2 octave 2 - note B_, 4 - note E_, 4 - note B_, 4 + B_ 4 + E_ 4 + B_ 4 octave 3 - note D_, 2 + D_ 2 octave 2 - note B_, 2 - note A_, 4 + B_ 2 + A_ 4 rest 4 - note A_, 4 - note B_, 2 - note A_, 2 - note G#, 4 + A_ 4 + B_ 2 + A_ 2 + G# 4 rest 4 - note C#, 4 - note G#, 4 - note A_, 4 + C# 4 + G# 4 + A_ 4 rest 4 - note A_, 4 - note B_, 4 - note B_, 4 + A_ 4 + B_ 4 + B_ 4 rest 4 octave 3 - note D_, 8 + D_ 8 loopchannel 0, Music_SSAnne_branch_b3b2 @@ -114,171 +114,171 @@ Music_SSAnne_Ch2:: ; b419 (2:7419) Music_SSAnne_branch_b41e:: notetype 12, 12, 5 octave 3 - note A_, 2 - note E_, 2 - note A_, 4 - note B_, 4 + A_ 2 + E_ 2 + A_ 4 + B_ 4 octave 4 - note D_, 4 + D_ 4 notetype 8, 12, 5 - note C#, 2 - note D_, 2 - note C#, 2 + C# 2 + D_ 2 + C# 2 octave 3 - note B_, 3 - note A_, 3 - note B_, 6 - note G#, 6 - note A_, 3 - note B_, 3 + B_ 3 + A_ 3 + B_ 6 + G# 6 + A_ 3 + B_ 3 octave 4 - note C#, 6 - note D_, 6 - note C#, 3 + C# 6 + D_ 6 + C# 3 octave 3 - note B_, 3 + B_ 3 octave 4 - note E_, 6 - note D_, 3 - note C#, 3 + E_ 6 + D_ 3 + C# 3 octave 3 - note B_, 6 + B_ 6 octave 4 - note C#, 3 + C# 3 octave 3 - note B_, 3 - note A_, 3 - note E_, 3 - note A_, 6 - note B_, 6 + B_ 3 + A_ 3 + E_ 3 + A_ 6 + B_ 6 octave 4 - note D_, 6 - note C#, 2 - note D_, 2 - note C#, 2 + D_ 6 + C# 2 + D_ 2 + C# 2 octave 3 - note B_, 3 - note A_, 3 - note B_, 6 - note G#, 6 - note A_, 3 - note B_, 3 + B_ 3 + A_ 3 + B_ 6 + G# 6 + A_ 3 + B_ 3 octave 4 - note C#, 6 - note D_, 6 - note C#, 3 + C# 6 + D_ 6 + C# 3 octave 3 - note B_, 3 + B_ 3 octave 4 - note E_, 6 - note D_, 3 - note C#, 3 + E_ 6 + D_ 3 + C# 3 octave 3 - note B_, 12 - note A_, 3 - note E_, 3 - note A_, 6 - note B_, 6 + B_ 12 + A_ 3 + E_ 3 + A_ 6 + B_ 6 octave 4 - note D_, 6 - note C#, 2 - note D_, 2 - note C#, 2 + D_ 6 + C# 2 + D_ 2 + C# 2 octave 3 - note B_, 3 - note A_, 3 - note B_, 6 - note G#, 6 - note A_, 3 - note B_, 3 + B_ 3 + A_ 3 + B_ 6 + G# 6 + A_ 3 + B_ 3 octave 4 - note C#, 6 - note D_, 6 - note C#, 3 + C# 6 + D_ 6 + C# 3 octave 3 - note B_, 3 + B_ 3 octave 4 - note E_, 6 - note D_, 3 - note C#, 3 + E_ 6 + D_ 3 + C# 3 octave 3 - note B_, 12 + B_ 12 rest 3 octave 4 - note C#, 3 + C# 3 octave 3 - note B_, 3 + B_ 3 octave 4 - note C#, 3 - note C#, 3 - note D_, 3 - note C#, 3 - note D_, 3 - note E_, 3 + C# 3 + C# 3 + D_ 3 + C# 3 + D_ 3 + E_ 3 octave 3 - note B_, 3 - note G#, 3 - note F#, 3 - note E_, 3 - note F#, 3 - note G#, 3 - note B_, 3 + B_ 3 + G# 3 + F# 3 + E_ 3 + F# 3 + G# 3 + B_ 3 rest 3 - note A_, 3 - note G#, 3 - note A_, 3 - note A_, 3 - note B_, 3 - note A_, 3 - note B_, 3 + A_ 3 + G# 3 + A_ 3 + A_ 3 + B_ 3 + A_ 3 + B_ 3 octave 4 - note C#, 3 + C# 3 octave 3 - note G#, 3 - note F#, 3 - note E_, 3 - note E_, 3 - note F#, 3 - note G#, 3 - note B_, 3 + G# 3 + F# 3 + E_ 3 + E_ 3 + F# 3 + G# 3 + B_ 3 rest 3 - note F#, 3 - note E_, 3 - note F#, 3 - note F#, 3 - note G#, 3 - note F#, 3 - note G#, 3 - note A_, 3 - note E_, 3 - note C#, 3 + F# 3 + E_ 3 + F# 3 + F# 3 + G# 3 + F# 3 + G# 3 + A_ 3 + E_ 3 + C# 3 octave 2 - note B_, 3 - note A_, 3 - note B_, 3 + B_ 3 + A_ 3 + B_ 3 octave 3 - note C#, 3 - note E_, 3 + C# 3 + E_ 3 rest 3 - note F#, 3 - note E_, 3 - note F#, 3 - note F#, 3 - note G#, 3 - note A_, 3 - note B_, 3 + F# 3 + E_ 3 + F# 3 + F# 3 + G# 3 + A_ 3 + B_ 3 octave 4 - note C#, 3 - note D_, 3 - note C#, 3 + C# 3 + D_ 3 + C# 3 octave 3 - note B_, 3 + B_ 3 octave 4 - note E_, 3 - note D_, 3 - note C#, 3 + E_ 3 + D_ 3 + C# 3 octave 3 - note B_, 3 + B_ 3 loopchannel 0, Music_SSAnne_branch_b41e @@ -287,53 +287,53 @@ Music_SSAnne_Ch3:: ; b4cb (2:74cb) rest 16 rest 12 octave 4 - note B_, 2 - note G#, 2 - note A_, 8 - note F#, 8 - note G#, 4 + B_ 2 + G# 2 + A_ 8 + F# 8 + G# 4 rest 4 - note B_, 8 - note A_, 8 - note B_, 8 - note A_, 8 - note G#, 8 - note A_, 8 - note F#, 8 - note G#, 8 - note B_, 8 - note A_, 4 - note E_, 4 - note B_, 4 - note E_, 4 - note A_, 4 - note E_, 4 - note G#, 4 - note E_, 4 - note A_, 4 - note E_, 4 - note F#, 4 - note G_, 4 - note G#, 4 - note A_, 4 + B_ 8 + A_ 8 + B_ 8 + A_ 8 + G# 8 + A_ 8 + F# 8 + G# 8 + B_ 8 + A_ 4 + E_ 4 + B_ 4 + E_ 4 + A_ 4 + E_ 4 + G# 4 + E_ 4 + A_ 4 + E_ 4 + F# 4 + G_ 4 + G# 4 + A_ 4 octave 5 - note D_, 8 - note C#, 8 - note C#, 8 + D_ 8 + C# 8 + C# 8 octave 4 - note B_, 8 - note B_, 8 - note A_, 8 - note A_, 8 - note G#, 8 - note G#, 8 - note F#, 8 - note F#, 8 - note E_, 8 - note E_, 8 - note F#, 8 - note F#, 8 - note G#, 8 - note B_, 8 + B_ 8 + B_ 8 + A_ 8 + A_ 8 + G# 8 + G# 8 + F# 8 + F# 8 + E_ 8 + E_ 8 + F# 8 + F# 8 + G# 8 + B_ 8 loopchannel 0, Music_SSAnne_Ch3 -; 0xb504
\ No newline at end of file +; 0xb504 diff --git a/audio/music/surfing.asm b/audio/music/surfing.asm index c96e796a..2b829caf 100644 --- a/audio/music/surfing.asm +++ b/audio/music/surfing.asm @@ -1,118 +1,118 @@ Music_Surfing_Ch1:: ; 7fa19 (1f:7a19) - tempo 0, 160 - stereopanning 119 + tempo 160 + volume 7, 7 duty 3 vibrato 12, 3, 4 - togglecall + toggleperfectpitch notetype 12, 11, 5 rest 6 octave 2 - note A_, 2 - note G#, 3 - note F#, 1 - note E_, 6 + A_ 2 + G# 3 + F# 1 + E_ 6 octave 3 - note G#, 2 - note F#, 2 - note G#, 4 + G# 2 + F# 2 + G# 4 Music_Surfing_branch_7fa30:: notetype 12, 11, 2 - note E_, 2 - note E_, 4 - note E_, 2 - note E_, 4 - note D_, 2 - note D_, 4 - note D_, 2 - note D_, 4 - note D_, 2 - note D_, 4 + E_ 2 + E_ 4 + E_ 2 + E_ 4 + D_ 2 + D_ 4 + D_ 2 + D_ 4 + D_ 2 + D_ 4 notetype 12, 11, 1 - note F#, 3 + F# 3 notetype 12, 11, 2 - note D_, 3 - note E_, 2 - note E_, 4 - note E_, 2 - note E_, 4 - note A_, 2 - note A_, 4 - note G#, 2 - note G#, 4 - note F#, 2 - note F#, 4 - note E_, 2 - note E_, 4 - note G#, 2 - note G#, 4 + D_ 3 + E_ 2 + E_ 4 + E_ 2 + E_ 4 + A_ 2 + A_ 4 + G# 2 + G# 4 + F# 2 + F# 4 + E_ 2 + E_ 4 + G# 2 + G# 4 notetype 12, 11, 1 - note F#, 3 + F# 3 notetype 12, 11, 2 - note G#, 1 + G# 1 notetype 12, 11, 4 - note A_, 2 - note B_, 2 + A_ 2 + B_ 2 octave 4 - note C_, 2 + C_ 2 notetype 12, 11, 7 - note C#, 6 + C# 6 notetype 12, 11, 3 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 3 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note G#, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note B_, 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + F# 2 + G# 2 + A_ 2 + G# 2 + F# 2 + G# 2 + F# 2 + E_ 2 + G# 2 + F# 2 + G# 2 + A_ 2 + G# 2 + F# 2 + G# 2 + A_ 2 + B_ 2 octave 4 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 3 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note G#, 2 - note A_, 2 - note E_, 2 - note G#, 2 - note B_, 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + F# 2 + G# 2 + A_ 2 + G# 2 + A_ 2 + E_ 2 + G# 2 + B_ 2 octave 4 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 + C# 2 octave 3 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 4 + B_ 2 + A_ 2 + G# 2 + F# 2 + E_ 4 loopchannel 0, Music_Surfing_branch_7fa30 @@ -121,85 +121,85 @@ Music_Surfing_Ch2:: ; 7fa9c (1f:7a9c) vibrato 16, 2, 5 notetype 12, 12, 6 octave 3 - note A_, 2 - note G#, 3 - note F#, 1 - note E_, 6 - note G#, 6 + A_ 2 + G# 3 + F# 1 + E_ 6 + G# 6 octave 4 - note E_, 2 - note D_, 2 + E_ 2 + D_ 2 octave 3 - note B_, 2 + B_ 2 Music_Surfing_branch_7faae:: notetype 12, 12, 6 octave 4 - note E_, 6 - note C#, 5 - note E_, 1 - note D_, 6 + E_ 6 + C# 5 + E_ 1 + D_ 6 octave 3 - note B_, 6 + B_ 6 octave 4 - note D_, 6 + D_ 6 octave 3 - note B_, 2 + B_ 2 notetype 12, 12, 1 octave 4 - note F#, 3 + F# 3 notetype 12, 12, 6 - note D_, 1 - note E_, 6 - note C#, 6 - note E_, 6 - note C#, 5 - note E_, 1 - note F#, 6 - note D_, 6 - note F#, 6 - note E_, 2 + D_ 1 + E_ 6 + C# 6 + E_ 6 + C# 5 + E_ 1 + F# 6 + D_ 6 + F# 6 + E_ 2 notetype 12, 12, 1 - note F#, 3 + F# 3 notetype 12, 12, 6 - note E_, 1 - note A_, 6 - note A_, 6 - note B_, 2 - note A_, 3 - note D_, 1 - note F#, 6 - note E_, 2 - note F#, 3 - note E_, 1 - note C#, 6 - note D_, 2 - note C#, 3 + E_ 1 + A_ 6 + A_ 6 + B_ 2 + A_ 3 + D_ 1 + F# 6 + E_ 2 + F# 3 + E_ 1 + C# 6 + D_ 2 + C# 3 octave 3 - note B_, 1 + B_ 1 octave 4 - note F#, 6 - note E_, 2 - note D#, 3 - note E_, 1 - note A_, 6 - note B_, 2 - note A_, 3 - note D_, 1 - note F#, 6 - note E_, 2 - note F#, 3 - note G#, 1 - note A_, 6 - note G#, 2 - note F#, 3 - note E_, 1 - note G#, 6 - note A_, 2 - note G#, 3 - note A_, 1 + F# 6 + E_ 2 + D# 3 + E_ 1 + A_ 6 + B_ 2 + A_ 3 + D_ 1 + F# 6 + E_ 2 + F# 3 + G# 1 + A_ 6 + G# 2 + F# 3 + E_ 1 + G# 6 + A_ 2 + G# 3 + A_ 1 octave 5 - note C#, 6 + C# 6 loopchannel 0, Music_Surfing_branch_7faae @@ -207,130 +207,130 @@ Music_Surfing_Ch3:: ; 7fafa (1f:7afa) notetype 12, 1, 0 rest 12 octave 5 - note E_, 6 + E_ 6 octave 4 - note E_, 2 - note F#, 2 - note G#, 2 + E_ 2 + F# 2 + G# 2 Music_Surfing_branch_7fb03:: octave 3 - note A_, 2 + A_ 2 octave 4 - note A_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note A_, 2 + A_ 2 + A_ 2 + E_ 2 + A_ 2 + A_ 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note G#, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note G#, 2 + G# 2 + G# 2 + E_ 2 + G# 2 + G# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note G#, 2 - note G#, 2 - note E_, 2 - note G#, 1 + G# 2 + G# 2 + E_ 2 + G# 1 rest 2 - note E_, 1 - note C#, 2 - note A_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note A_, 2 + E_ 1 + C# 2 + A_ 2 + A_ 2 + E_ 2 + A_ 2 + A_ 2 + C# 2 + A_ 2 + A_ 2 + E_ 2 + A_ 2 + A_ 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note G#, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note G#, 2 + G# 2 + G# 2 + E_ 2 + G# 2 + G# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note G#, 2 - note G#, 2 - note E_, 2 - note G#, 1 + G# 2 + G# 2 + E_ 2 + G# 1 rest 2 - note E_, 1 - note C#, 2 - note A_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note A_, 2 - note D_, 2 - note F#, 2 - note F#, 2 + E_ 1 + C# 2 + A_ 2 + A_ 2 + E_ 2 + A_ 2 + A_ 2 + D_ 2 + F# 2 + F# 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note F#, 2 - note F#, 2 - note E_, 2 - note A_, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note A_, 2 - note E_, 2 - note G#, 2 - note G#, 2 + F# 2 + F# 2 + E_ 2 + A_ 2 + A_ 2 + C# 2 + A_ 2 + A_ 2 + E_ 2 + G# 2 + G# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note G#, 2 - note G#, 2 - note E_, 2 - note A_, 2 - note A_, 2 + G# 2 + G# 2 + E_ 2 + A_ 2 + A_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note A_, 2 - note A_, 2 - note D_, 2 - note F#, 2 - note F#, 2 + A_ 2 + A_ 2 + D_ 2 + F# 2 + F# 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note F#, 2 - note F#, 2 - note E_, 2 - note A_, 2 - note A_, 2 - note C#, 2 - note A_, 2 - note A_, 2 - note E_, 2 - note G#, 2 - note G#, 2 + F# 2 + F# 2 + E_ 2 + A_ 2 + A_ 2 + C# 2 + A_ 2 + A_ 2 + E_ 2 + G# 2 + G# 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note G#, 2 - note G#, 2 - note E_, 2 - note A_, 2 - note A_, 2 - note C#, 2 - note D_, 2 - note E_, 2 + G# 2 + G# 2 + E_ 2 + A_ 2 + A_ 2 + C# 2 + D_ 2 + E_ 2 loopchannel 0, Music_Surfing_branch_7fb03 -; 0x7fb7d
\ No newline at end of file +; 0x7fb7d diff --git a/audio/music/titlescreen.asm b/audio/music/titlescreen.asm index a3ab8031..359ff877 100644 --- a/audio/music/titlescreen.asm +++ b/audio/music/titlescreen.asm @@ -1,156 +1,156 @@ Music_TitleScreen_Ch1:: ; 7e4c0 (1f:64c0) - tempo 0, 144 - stereopanning 119 + tempo 144 + volume 7, 7 vibrato 9, 3, 4 duty 3 notetype 12, 12, 1 octave 2 - note E_, 1 - note G_, 1 - note B_, 1 + E_ 1 + G_ 1 + B_ 1 octave 3 - note D_, 1 + D_ 1 octave 2 - note G_, 4 - note G_, 6 - note G_, 1 - note G_, 1 - note G_, 4 - note G_, 4 - note G_, 4 + G_ 4 + G_ 6 + G_ 1 + G_ 1 + G_ 4 + G_ 4 + G_ 4 notetype 8, 12, 1 - note A_, 2 - note A_, 2 - note A_, 2 - note A_, 2 - note A_, 2 - note F#, 2 + A_ 2 + A_ 2 + A_ 2 + A_ 2 + A_ 2 + F# 2 Music_TitleScreen_branch_7e4e2:: callchannel Music_TitleScreen_branch_7e541 callchannel Music_TitleScreen_branch_7e54a callchannel Music_TitleScreen_branch_7e541 octave 3 - note C_, 8 + C_ 8 notetype 8, 12, 6 - note E_, 4 - note E_, 4 - note C_, 4 + E_ 4 + E_ 4 + C_ 4 notetype 12, 12, 6 octave 2 - note B_, 8 + B_ 8 notetype 8, 14, 7 octave 3 - note F_, 4 - note E_, 4 - note C_, 4 + F_ 4 + E_ 4 + C_ 4 notetype 12, 14, 7 - note D_, 10 + D_ 10 notetype 12, 12, 6 octave 2 - note B_, 2 + B_ 2 octave 3 - note C_, 2 - note D_, 2 + C_ 2 + D_ 2 callchannel Music_TitleScreen_branch_7e541 callchannel Music_TitleScreen_branch_7e54a callchannel Music_TitleScreen_branch_7e541 - note C_, 6 - note C_, 6 - note E_, 4 - note D_, 6 - note F_, 2 - note G_, 2 - note D_, 4 - note G_, 2 - note G_, 6 - note A_, 4 - note F_, 2 - note A_, 2 + C_ 6 + C_ 6 + E_ 4 + D_ 6 + F_ 2 + G_ 2 + D_ 4 + G_ 2 + G_ 6 + A_ 4 + F_ 2 + A_ 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note D_, 12 - note E_, 4 - note F_, 8 - note G_, 4 - note F_, 4 - note E_, 12 - note F_, 4 - note G_, 8 + D_ 12 + E_ 4 + F_ 8 + G_ 4 + F_ 4 + E_ 12 + F_ 4 + G_ 8 notetype 12, 11, 6 octave 4 - note C_, 4 - note C#, 4 + C_ 4 + C# 4 callchannel Music_TitleScreen_branch_7e55c notetype 8, 11, 4 octave 4 - note C_, 4 - note C_, 4 - note C#, 4 + C_ 4 + C_ 4 + C# 4 callchannel Music_TitleScreen_branch_7e55c notetype 8, 11, 2 octave 3 - note E_, 4 - note E_, 4 - note C#, 4 + E_ 4 + E_ 4 + C# 4 loopchannel 0, Music_TitleScreen_branch_7e4e2 Music_TitleScreen_branch_7e541:: notetype 12, 12, 6 octave 3 - note D_, 6 + D_ 6 octave 2 - note B_, 2 + B_ 2 octave 3 - note D_, 8 + D_ 8 endchannel Music_TitleScreen_branch_7e54a:: - note C_, 6 - note F_, 6 - note C_, 4 - note D_, 8 + C_ 6 + F_ 6 + C_ 4 + D_ 8 notetype 12, 14, 7 - note F_, 6 - note E_, 1 - note D#, 1 - note D_, 8 + F_ 6 + E_ 1 + D# 1 + D_ 8 notetype 8, 12, 6 - note C_, 4 + C_ 4 octave 2 - note B_, 4 + B_ 4 octave 3 - note C_, 4 + C_ 4 endchannel Music_TitleScreen_branch_7e55c:: notetype 12, 12, 1 - note D_, 1 + D_ 1 rest 1 octave 2 - note D_, 1 - note D_, 1 - note D_, 1 + D_ 1 + D_ 1 + D_ 1 rest 1 - note D_, 1 - note D_, 1 - note D_, 1 + D_ 1 + D_ 1 + D_ 1 rest 1 - note D_, 1 - note D_, 1 - note D_, 1 + D_ 1 + D_ 1 + D_ 1 rest 1 - note D_, 1 - note D_, 1 - note D_, 1 + D_ 1 + D_ 1 + D_ 1 rest 1 - note D_, 1 - note D_, 1 - note D_, 1 + D_ 1 + D_ 1 + D_ 1 rest 1 - note D_, 1 - note D_, 1 + D_ 1 + D_ 1 endchannel @@ -159,194 +159,194 @@ Music_TitleScreen_Ch2:: ; 7e578 (1f:6578) duty 1 notetype 12, 14, 1 octave 2 - note G_, 1 - note B_, 1 + G_ 1 + B_ 1 octave 3 - note D_, 1 - note F#, 1 - note G_, 4 - note G_, 6 - note G_, 1 - note G_, 1 - note G_, 4 - note G_, 4 - note G_, 4 + D_ 1 + F# 1 + G_ 4 + G_ 6 + G_ 1 + G_ 1 + G_ 4 + G_ 4 + G_ 4 notetype 8, 14, 1 - note F_, 2 - note F_, 2 - note F_, 2 - note F_, 2 - note F_, 2 - note F#, 2 + F_ 2 + F_ 2 + F_ 2 + F_ 2 + F_ 2 + F# 2 Music_TitleScreen_branch_7e594:: vibrato 16, 4, 6 callchannel Music_TitleScreen_branch_7e622 octave 2 - note A_, 4 - note F_, 4 + A_ 4 + F_ 4 callchannel Music_TitleScreen_branch_7e62c octave 2 - note A_, 8 - note B_, 16 + A_ 8 + B_ 16 callchannel Music_TitleScreen_branch_7e622 octave 2 - note A_, 6 - note F_, 2 + A_ 6 + F_ 2 notetype 8, 14, 7 octave 4 - note C_, 4 + C_ 4 octave 3 - note B_, 4 + B_ 4 octave 4 - note C_, 4 + C_ 4 notetype 12, 14, 7 - note D_, 8 + D_ 8 notetype 12, 9, 5 octave 2 - note D_, 6 - note D_, 1 - note F#, 1 - note G_, 16 + D_ 6 + D_ 1 + F# 1 + G_ 16 callchannel Music_TitleScreen_branch_7e622 octave 2 - note A_, 2 - note F_, 6 + A_ 2 + F_ 6 callchannel Music_TitleScreen_branch_7e62c octave 3 - note C_, 2 + C_ 2 octave 2 - note A_, 6 - note B_, 6 - note G_, 2 - note F_, 8 + A_ 6 + B_ 6 + G_ 2 + F_ 8 callchannel Music_TitleScreen_branch_7e622 notetype 8, 9, 5 octave 2 - note G_, 4 - note F_, 5 - note A_, 3 + G_ 4 + F_ 5 + A_ 3 notetype 8, 14, 6 octave 4 - note F_, 4 - note E_, 4 - note F_, 4 + F_ 4 + E_ 4 + F_ 4 notetype 12, 14, 7 - note G_, 6 - note A#, 2 - note G_, 8 + G_ 6 + A# 2 + G_ 8 vibrato 16, 2, 6 duty 3 notetype 12, 0, 11 - note G_, 8 + G_ 8 notetype 12, 14, 7 - note A_, 8 + A_ 8 duty 1 notetype 12, 14, 7 - note A#, 6 - note F_, 2 - note F_, 8 + A# 6 + F_ 2 + F_ 8 octave 3 - note D_, 8 + D_ 8 octave 4 - note A#, 4 - note B_, 4 + A# 4 + B_ 4 octave 5 - note C_, 6 + C_ 6 octave 4 - note G_, 2 - note G_, 8 + G_ 2 + G_ 8 octave 3 - note E_, 8 + E_ 8 notetype 12, 13, 7 octave 5 - note C_, 4 - note C#, 4 + C_ 4 + C# 4 callchannel Music_TitleScreen_branch_7e636 rest 3 - note D_, 1 + D_ 1 rest 3 - note D_, 1 + D_ 1 notetype 8, 14, 5 octave 5 - note C_, 4 - note C_, 4 - note C#, 4 + C_ 4 + C_ 4 + C# 4 callchannel Music_TitleScreen_branch_7e636 - note D_, 1 + D_ 1 rest 2 - note D_, 1 + D_ 1 rest 3 - note D_, 1 + D_ 1 notetype 8, 14, 3 octave 5 - note C_, 4 - note C_, 4 + C_ 4 + C_ 4 octave 4 - note B_, 4 + B_ 4 loopchannel 0, Music_TitleScreen_branch_7e594 Music_TitleScreen_branch_7e622:: notetype 12, 14, 7 octave 3 - note G_, 6 - note B_, 2 + G_ 6 + B_ 2 octave 4 - note D_, 8 + D_ 8 notetype 12, 9, 5 endchannel Music_TitleScreen_branch_7e62c:: notetype 12, 14, 7 octave 4 - note F_, 6 - note E_, 1 - note D#, 1 - note D_, 8 + F_ 6 + E_ 1 + D# 1 + D_ 8 notetype 12, 9, 5 endchannel Music_TitleScreen_branch_7e636:: notetype 12, 14, 1 - note D_, 1 + D_ 1 rest 2 octave 4 - note D_, 1 + D_ 1 rest 3 - note D_, 1 + D_ 1 rest 3 - note D_, 1 + D_ 1 rest 3 - note D_, 1 + D_ 1 endchannel Music_TitleScreen_Ch3:: ; 7e643 (1f:6643) notetype 12, 1, 0 octave 3 - note G_, 1 + G_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 5 - note G_, 1 - note G_, 1 - note G_, 1 + G_ 1 + G_ 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 3 - note G_, 1 + G_ 1 rest 3 notetype 8, 1, 0 - note F_, 2 - note F_, 2 - note F_, 2 - note F_, 2 - note F_, 2 - note A_, 2 + F_ 2 + F_ 2 + F_ 2 + F_ 2 + F_ 2 + A_ 2 Music_TitleScreen_branch_7e65e:: callchannel Music_TitleScreen_branch_7e6c9 @@ -359,102 +359,102 @@ Music_TitleScreen_branch_7e664:: callchannel Music_TitleScreen_branch_7e6d0 loopchannel 3, Music_TitleScreen_branch_7e664 callchannel Music_TitleScreen_branch_7e6c9 - note G_, 6 - note D_, 3 - note A_, 6 - note F_, 3 - note A_, 3 - note F_, 3 + G_ 6 + D_ 3 + A_ 6 + F_ 3 + A_ 3 + F_ 3 callchannel Music_TitleScreen_branch_7e6d7 - note A#, 3 - note F_, 3 + A# 3 + F_ 3 callchannel Music_TitleScreen_branch_7e6d7 - note B_, 3 - note G_, 3 + B_ 3 + G_ 3 callchannel Music_TitleScreen_branch_7e6dc octave 4 - note C_, 3 + C_ 3 octave 3 - note G_, 3 + G_ 3 callchannel Music_TitleScreen_branch_7e6dc octave 4 - note C#, 3 + C# 3 octave 3 - note A_, 3 + A_ 3 callchannel Music_TitleScreen_branch_7e6e5 octave 5 pitchbend 0, 66 - note D_, 4 + D_ 4 rest 4 octave 6 pitchbend 0, 50 - note D_, 4 + D_ 4 octave 5 pitchbend 0, 66 - note D_, 4 + D_ 4 rest 2 notetype 8, 1, 0 octave 4 - note C_, 4 - note C_, 4 - note C#, 4 + C_ 4 + C_ 4 + C# 4 callchannel Music_TitleScreen_branch_7e6e5 octave 6 pitchbend 0, 50 - note D_, 4 + D_ 4 rest 4 octave 5 pitchbend 0, 66 - note D_, 4 + D_ 4 rest 6 notetype 8, 1, 0 octave 4 - note C_, 4 - note C_, 4 + C_ 4 + C_ 4 octave 3 - note B_, 4 + B_ 4 loopchannel 0, Music_TitleScreen_branch_7e65e Music_TitleScreen_branch_7e6c9:: - note G_, 6 - note D_, 3 - note G_, 6 - note D_, 3 - note G_, 3 - note D_, 3 + G_ 6 + D_ 3 + G_ 6 + D_ 3 + G_ 3 + D_ 3 endchannel Music_TitleScreen_branch_7e6d0:: - note F_, 6 - note C_, 3 - note F_, 6 - note C_, 3 - note F_, 3 - note C_, 3 + F_ 6 + C_ 3 + F_ 6 + C_ 3 + F_ 3 + C_ 3 endchannel Music_TitleScreen_branch_7e6d7:: - note A#, 6 - note F_, 3 - note A#, 6 - note F_, 3 + A# 6 + F_ 3 + A# 6 + F_ 3 endchannel Music_TitleScreen_branch_7e6dc:: octave 4 - note C_, 6 + C_ 6 octave 3 - note G_, 3 + G_ 3 octave 4 - note C_, 6 + C_ 6 octave 3 - note G_, 3 + G_ 3 endchannel Music_TitleScreen_branch_7e6e5:: notetype 12, 1, 0 octave 4 - note D_, 1 + D_ 1 rest 5 endchannel @@ -462,217 +462,217 @@ Music_TitleScreen_branch_7e6e5:: Music_TitleScreen_Ch4:: ; 7e6eb (1f:66eb) dspeed 6 rest 4 - dnote 1, snare3 - dnote 1, snare3 - dnote 1, snare4 - dnote 1, snare4 + snare3 1 + snare3 1 + snare4 1 + snare4 1 dspeed 12 - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare2 + snare2 1 rest 5 - dnote 1, snare2 - dnote 1, snare2 - dnote 1, snare2 + snare2 1 + snare2 1 + snare2 1 rest 3 - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare2 + snare2 1 rest 3 dspeed 8 - dnote 2, snare3 - dnote 2, snare4 - dnote 2, snare2 - dnote 2, snare3 - dnote 2, snare2 - dnote 2, snare1 + snare3 2 + snare4 2 + snare2 2 + snare3 2 + snare2 2 + snare1 2 Music_TitleScreen_branch_7e716:: dspeed 12 - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare2 + snare2 1 rest 5 - dnote 1, snare2 - dnote 1, snare2 - dnote 1, snare3 + snare2 1 + snare2 1 + snare3 1 rest 3 callchannel Music_TitleScreen_branch_7e834 callchannel Music_TitleScreen_branch_7e834 - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare2 + snare2 1 rest 5 - dnote 1, snare2 - dnote 1, snare2 - dnote 1, snare3 + snare2 1 + snare2 1 + snare3 1 rest 1 - dnote 1, snare3 - dnote 1, snare2 + snare3 1 + snare2 1 callchannel Music_TitleScreen_branch_7e842 - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare2 + snare2 1 rest 5 - dnote 1, snare2 - dnote 1, snare3 - dnote 1, snare2 + snare2 1 + snare3 1 + snare2 1 rest 1 - dnote 1, snare2 + snare2 1 rest 1 callchannel Music_TitleScreen_branch_7e842 - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare2 + snare2 1 rest 5 - dnote 1, snare2 - dnote 1, snare3 - dnote 1, snare2 + snare2 1 + snare3 1 + snare2 1 rest 1 dspeed 6 - dnote 1, snare3 - dnote 1, snare3 - dnote 1, snare4 - dnote 1, snare4 + snare3 1 + snare3 1 + snare4 1 + snare4 1 dspeed 12 callchannel Music_TitleScreen_branch_7e834 callchannel Music_TitleScreen_branch_7e842 - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare2 + snare2 1 rest 5 - dnote 1, snare2 - dnote 1, snare3 - dnote 1, snare2 + snare2 1 + snare3 1 + snare2 1 rest 3 - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare2 + snare2 1 rest 5 - dnote 1, snare3 - dnote 1, snare2 - dnote 1, snare2 + snare3 1 + snare2 1 + snare2 1 rest 1 - dnote 1, snare3 - dnote 1, snare2 + snare3 1 + snare2 1 callchannel Music_TitleScreen_branch_7e834 callchannel Music_TitleScreen_branch_7e842 - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare2 + snare2 1 rest 5 - dnote 1, snare3 - dnote 1, snare2 - dnote 1, snare2 + snare3 1 + snare2 1 + snare2 1 rest 1 - dnote 1, snare4 - dnote 1, snare3 - dnote 1, snare2 + snare4 1 + snare3 1 + snare2 1 rest 3 - dnote 1, snare3 + snare3 1 rest 5 - dnote 1, snare2 - dnote 1, snare4 - dnote 1, snare2 + snare2 1 + snare4 1 + snare2 1 rest 1 dspeed 6 - dnote 1, snare3 - dnote 1, snare3 - dnote 1, snare4 - dnote 1, snare4 + snare3 1 + snare3 1 + snare4 1 + snare4 1 dspeed 12 - dnote 1, snare1 + snare1 1 rest 3 - dnote 1, snare2 + snare2 1 rest 5 - dnote 1, snare3 - dnote 1, snare2 - dnote 1, snare1 + snare3 1 + snare2 1 + snare1 1 rest 3 - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare3 + snare3 1 rest 5 - dnote 1, snare3 - dnote 1, snare2 - dnote 1, snare3 + snare3 1 + snare2 1 + snare3 1 rest 3 - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare3 + snare3 1 rest 5 - dnote 1, snare2 - dnote 1, snare3 - dnote 1, snare4 + snare2 1 + snare3 1 + snare4 1 rest 1 - dnote 1, snare3 - dnote 1, snare2 - dnote 1, snare2 + snare3 1 + snare2 1 + snare2 1 rest 3 - dnote 1, snare3 + snare3 1 rest 5 - dnote 1, snare2 - dnote 1, snare3 - dnote 1, snare2 + snare2 1 + snare3 1 + snare2 1 rest 3 - dnote 1, snare5 + snare5 1 rest 5 - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare3 - dnote 1, snare2 - dnote 1, snare1 + snare3 1 + snare2 1 + snare1 1 rest 5 - dnote 1, snare2 - dnote 1, snare3 - dnote 1, snare2 + snare2 1 + snare3 1 + snare2 1 rest 1 - dnote 1, snare1 + snare1 1 rest 1 dspeed 8 - dnote 4, snare2 - dnote 4, snare3 - dnote 4, snare1 + snare2 4 + snare3 4 + snare1 4 dspeed 12 - dnote 1, snare5 + snare5 1 rest 5 - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare3 - dnote 1, snare2 - dnote 1, snare3 + snare3 1 + snare2 1 + snare3 1 rest 5 - dnote 1, snare2 - dnote 1, snare3 - dnote 1, snare1 + snare2 1 + snare3 1 + snare1 1 rest 1 - dnote 1, snare3 - dnote 1, snare2 + snare3 1 + snare2 1 dspeed 8 - dnote 4, snare2 - dnote 4, snare3 - dnote 4, snare2 + snare2 4 + snare3 4 + snare2 4 loopchannel 0, Music_TitleScreen_branch_7e716 Music_TitleScreen_branch_7e834:: - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare2 + snare2 1 rest 5 - dnote 1, snare2 - dnote 1, snare3 - dnote 1, snare2 + snare2 1 + snare3 1 + snare2 1 rest 3 endchannel Music_TitleScreen_branch_7e842:: - dnote 1, snare2 + snare2 1 rest 3 - dnote 1, snare2 + snare2 1 rest 5 - dnote 1, snare3 - dnote 1, snare2 - dnote 1, snare2 + snare3 1 + snare2 1 + snare2 1 rest 3 endchannel -; 0x7e850
\ No newline at end of file +; 0x7e850 diff --git a/audio/music/trainerbattle.asm b/audio/music/trainerbattle.asm index 2e4bcdaf..52642fdc 100644 --- a/audio/music/trainerbattle.asm +++ b/audio/music/trainerbattle.asm @@ -1,651 +1,651 @@ Music_TrainerBattle_Ch1:: ; 22919 (8:6919) - tempo 0, 112 - stereopanning 119 + tempo 112 + volume 7, 7 duty 3 vibrato 6, 3, 4 - togglecall + toggleperfectpitch notetype 12, 11, 2 rest 8 octave 3 - note F_, 1 - note E_, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note C#, 1 - note C_, 1 - note C#, 1 - note C_, 1 - octave 2 - note B_, 1 - octave 3 - note C_, 1 - octave 2 - note B_, 1 - note A#, 1 - note B_, 1 - note A#, 1 - note A_, 1 - note A#, 1 - octave 3 - note D_, 6 - note E_, 6 - note F_, 4 - note D_, 2 - note E_, 4 - note F_, 6 - note C_, 4 - note D_, 6 - note E_, 6 - note F_, 4 - note D_, 2 - note E_, 4 - note F_, 6 - note C_, 2 - note C#, 2 - note D_, 6 - note E_, 6 - note F_, 4 - note D_, 2 - note E_, 4 - note F_, 6 - note C_, 4 - note D_, 6 - note E_, 6 - note F_, 4 - note D_, 2 - note E_, 4 - note F_, 6 - note C_, 2 - note C#, 2 + F_ 1 + E_ 1 + F_ 1 + E_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + C# 1 + C_ 1 + C# 1 + C_ 1 + octave 2 + B_ 1 + octave 3 + C_ 1 + octave 2 + B_ 1 + A# 1 + B_ 1 + A# 1 + A_ 1 + A# 1 + octave 3 + D_ 6 + E_ 6 + F_ 4 + D_ 2 + E_ 4 + F_ 6 + C_ 4 + D_ 6 + E_ 6 + F_ 4 + D_ 2 + E_ 4 + F_ 6 + C_ 2 + C# 2 + D_ 6 + E_ 6 + F_ 4 + D_ 2 + E_ 4 + F_ 6 + C_ 4 + D_ 6 + E_ 6 + F_ 4 + D_ 2 + E_ 4 + F_ 6 + C_ 2 + C# 2 Music_TrainerBattle_branch_22962:: notetype 12, 11, 5 - note D_, 2 - note E_, 4 - note C#, 2 - note D_, 4 - octave 2 - note B_, 4 - note F#, 4 - octave 3 - note E_, 2 - note D_, 4 - note C#, 2 - note D_, 2 - note E_, 2 - note F_, 8 + D_ 2 + E_ 4 + C# 2 + D_ 4 + octave 2 + B_ 4 + F# 4 + octave 3 + E_ 2 + D_ 4 + C# 2 + D_ 2 + E_ 2 + F_ 8 notetype 12, 11, 2 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C_, 1 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note G#, 1 - note G_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C_, 1 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + C_ 1 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + G_ 1 + G# 1 + G_ 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + C_ 1 notetype 12, 11, 5 - note D_, 2 - note E_, 4 - note C#, 2 - note D_, 4 + D_ 2 + E_ 4 + C# 2 + D_ 4 octave 2 - note B_, 4 - note F#, 4 + B_ 4 + F# 4 octave 3 - note E_, 2 - note D_, 4 - note C#, 2 + E_ 2 + D_ 4 + C# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note C#, 2 + C# 2 notetype 12, 10, 7 - note D_, 8 - note C#, 8 + D_ 8 + C# 8 octave 2 - note B_, 8 + B_ 8 octave 3 - note C#, 8 + C# 8 notetype 12, 11, 5 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 2 - note B_, 2 - note A_, 2 - note G_, 2 + B_ 2 + A_ 2 + G_ 2 rest 2 octave 3 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 2 - note B_, 2 - note A_, 2 - note G_, 2 + B_ 2 + A_ 2 + G_ 2 rest 2 octave 3 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note C#, 2 - note E_, 4 + C# 2 + E_ 4 octave 2 - note G_, 1 - note A_, 1 - note B_, 1 + G_ 1 + A_ 1 + B_ 1 octave 3 - note C#, 1 - note D_, 4 + C# 1 + D_ 4 octave 2 - note F#, 1 - note G_, 1 - note A_, 1 - note B_, 1 + F# 1 + G_ 1 + A_ 1 + B_ 1 octave 3 - note C#, 4 + C# 4 octave 2 - note G_, 1 - note A_, 1 - note B_, 1 + G_ 1 + A_ 1 + B_ 1 octave 3 - note C#, 1 - note D_, 4 + C# 1 + D_ 4 octave 2 - note F#, 1 - note G_, 1 - note A_, 1 - note B_, 1 + F# 1 + G_ 1 + A_ 1 + B_ 1 octave 3 - note D_, 2 - note C#, 2 + D_ 2 + C# 2 octave 2 - note B_, 2 - note A_, 2 - note G_, 2 + B_ 2 + A_ 2 + G_ 2 rest 2 octave 3 - note D_, 2 - note C#, 2 - octave 2 - note B_, 2 - note A_, 2 - note B_, 2 - note G_, 2 - octave 3 - note D_, 2 - note E_, 2 - note F#, 2 - note G_, 2 - note A_, 2 - note B_, 2 - note A_, 2 - note G_, 2 - note A_, 2 + D_ 2 + C# 2 + octave 2 + B_ 2 + A_ 2 + B_ 2 + G_ 2 + octave 3 + D_ 2 + E_ 2 + F# 2 + G_ 2 + A_ 2 + B_ 2 + A_ 2 + G_ 2 + A_ 2 rest 2 - note A_, 2 - note B_, 2 - note A_, 2 - note G_, 2 - note F#, 2 - note G_, 2 - note A_, 2 - note E_, 2 - note G_, 2 - note F#, 2 - octave 2 - note B_, 1 - octave 3 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note G#, 1 - note A_, 1 - note A#, 1 - note B_, 1 + A_ 2 + B_ 2 + A_ 2 + G_ 2 + F# 2 + G_ 2 + A_ 2 + E_ 2 + G_ 2 + F# 2 + octave 2 + B_ 1 + octave 3 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + G_ 1 + G# 1 + A_ 1 + A# 1 + B_ 1 octave 4 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note C_, 1 - octave 3 - note B_, 1 - note A#, 1 - note A_, 1 - note G#, 1 - note G_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note C_, 1 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note G#, 1 - note A_, 1 - note A#, 1 - note B_, 1 + C_ 1 + C# 1 + D_ 1 + D# 1 + D_ 1 + C# 1 + C_ 1 + octave 3 + B_ 1 + A# 1 + A_ 1 + G# 1 + G_ 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + C_ 1 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + G_ 1 + G# 1 + A_ 1 + A# 1 + B_ 1 octave 4 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note C_, 1 - octave 3 - note B_, 1 - note A#, 1 - note A_, 1 - note G#, 1 - note G_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note G#, 1 - note A_, 1 - note A#, 1 - note B_, 1 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + C_ 1 + octave 3 + B_ 1 + A# 1 + A_ 1 + G# 1 + G_ 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + G_ 1 + G# 1 + A_ 1 + A# 1 + B_ 1 octave 4 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note C_, 1 - octave 3 - note B_, 1 - note A#, 1 - note A_, 1 - note G#, 1 - note G_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note G#, 1 - note A_, 1 - note A#, 1 - note B_, 1 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + C_ 1 + octave 3 + B_ 1 + A# 1 + A_ 1 + G# 1 + G_ 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + G_ 1 + G# 1 + A_ 1 + A# 1 + B_ 1 octave 4 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note C_, 1 - octave 3 - note B_, 1 - note A#, 1 - note B_, 1 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + C_ 1 + octave 3 + B_ 1 + A# 1 + B_ 1 octave 4 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - octave 3 - note A_, 4 + C_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + octave 3 + A_ 4 octave 4 - note D_, 4 - octave 3 - note A_, 2 - note D_, 1 - note E_, 1 - note F#, 1 - note G_, 1 - note G#, 1 - note A#, 1 - note B_, 2 + D_ 4 + octave 3 + A_ 2 + D_ 1 + E_ 1 + F# 1 + G_ 1 + G# 1 + A# 1 + B_ 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note C_, 2 + C_ 2 octave 3 - note G_, 2 - note B_, 2 - note F_, 2 - note G_, 2 - note A_, 2 + G_ 2 + B_ 2 + F_ 2 + G_ 2 + A_ 2 octave 4 - note C_, 2 - note D_, 2 + C_ 2 + D_ 2 rest 2 octave 3 - note A_, 4 + A_ 4 octave 4 - note C_, 4 - note D_, 2 + C_ 4 + D_ 2 octave 3 - note F_, 1 - note G_, 1 - note A_, 1 - note B_, 1 + F_ 1 + G_ 1 + A_ 1 + B_ 1 octave 4 - note C_, 1 - note D_, 1 - note E_, 2 - note F_, 2 - note D_, 2 - note F_, 2 - note D_, 2 - note F_, 2 - note D_, 2 - note F_, 2 - note D_, 2 - note F_, 2 - note D_, 2 - note F_, 2 - note E_, 2 - note F_, 2 - note E_, 2 - note F_, 2 - note E_, 2 - note F_, 2 - note E_, 2 - note F_, 2 - note E_, 2 - note F_, 2 - note E_, 2 - note F_, 2 - note E_, 2 - note F_, 2 - note E_, 2 + C_ 1 + D_ 1 + E_ 2 + F_ 2 + D_ 2 + F_ 2 + D_ 2 + F_ 2 + D_ 2 + F_ 2 + D_ 2 + F_ 2 + D_ 2 + F_ 2 + E_ 2 + F_ 2 + E_ 2 + F_ 2 + E_ 2 + F_ 2 + E_ 2 + F_ 2 + E_ 2 + F_ 2 + E_ 2 + F_ 2 + E_ 2 + F_ 2 + E_ 2 octave 3 - note B_, 2 - note C_, 2 + B_ 2 + C_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note C_, 2 + E_ 2 + C_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note C_, 2 + E_ 2 + C_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note C_, 2 + E_ 2 + C_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note C_, 2 + E_ 2 + C_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note C_, 2 - note E_, 2 - note D_, 2 + C_ 2 + E_ 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 - note D_, 2 + F_ 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 - note D_, 2 + F_ 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 - note D_, 2 + F_ 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 - note D_, 2 + F_ 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note D_, 2 - note F_, 2 - note C_, 2 + D_ 2 + F_ 2 + C_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note C_, 2 + E_ 2 + C_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note C_, 2 + E_ 2 + C_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note C_, 2 + E_ 2 + C_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note C_, 2 + E_ 2 + C_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note C_, 2 - note E_, 2 - note D_, 2 + C_ 2 + E_ 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 - note D_, 2 + F_ 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 - note D_, 2 + F_ 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 - note D_, 2 + F_ 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 - note D_, 2 + F_ 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note D_, 2 - note F_, 2 - note D_, 16 - note C_, 16 + D_ 2 + F_ 2 + D_ 16 + C_ 16 octave 2 - note A#, 16 - note G_, 12 + A# 16 + G_ 12 octave 3 - note D_, 1 - note E_, 1 - note G_, 1 + D_ 1 + E_ 1 + G_ 1 octave 4 - note C_, 1 - note D_, 8 - note F_, 8 + C_ 1 + D_ 8 + F_ 8 octave 3 - note A#, 8 + A# 8 octave 4 - note C_, 8 - note D_, 8 - note E_, 8 - note F_, 8 - note G_, 8 - note E_, 2 + C_ 8 + D_ 8 + E_ 8 + F_ 8 + G_ 8 + E_ 2 rest 4 - note E_, 2 + E_ 2 rest 4 - note E_, 2 + E_ 2 rest 2 - note E_, 2 + E_ 2 rest 4 - note E_, 2 + E_ 2 rest 4 - note E_, 2 + E_ 2 rest 2 - note E_, 2 + E_ 2 rest 4 - note E_, 2 + E_ 2 rest 4 - note E_, 2 + E_ 2 rest 2 - note E_, 2 + E_ 2 rest 4 - note E_, 2 + E_ 2 rest 4 - note E_, 2 + E_ 2 rest 2 octave 3 - note C_, 2 - note D_, 4 + C_ 2 + D_ 4 octave 2 - note B_, 2 + B_ 2 octave 3 - note C#, 4 + C# 4 rest 2 - note C#, 1 - note D_, 1 - note E_, 1 + C# 1 + D_ 1 + E_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 octave 2 - note B_, 1 + B_ 1 rest 1 octave 3 - note C#, 1 + C# 1 rest 9 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + C# 1 rest 5 - note C#, 1 - note D_, 1 - note E_, 1 + C# 1 + D_ 1 + E_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note D_, 2 - note E_, 2 - note F_, 2 - note G_, 2 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 + D_ 2 + E_ 2 + F_ 2 + G_ 2 + D# 1 + E_ 1 + F_ 1 + F# 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 rest 9 - note F#, 2 - note E_, 4 - note D#, 2 - note E_, 2 - note F#, 2 - note G#, 2 - note E_, 8 - note F#, 8 - note G_, 8 + F# 2 + E_ 4 + D# 2 + E_ 2 + F# 2 + G# 2 + E_ 8 + F# 8 + G_ 8 octave 4 - note C_, 4 + C_ 4 octave 3 - note G_, 1 - note G#, 1 - note A_, 1 - note A#, 1 + G_ 1 + G# 1 + A_ 1 + A# 1 loopchannel 0, Music_TrainerBattle_branch_22962 @@ -654,302 +654,302 @@ Music_TrainerBattle_Ch2:: ; 22bae (8:6bae) vibrato 10, 2, 5 notetype 12, 12, 2 octave 4 - note A_, 1 - note G#, 1 - note G_, 1 - note F#, 1 - note A_, 1 - note F_, 1 - note F#, 1 - note F_, 1 - note A_, 1 - note E_, 1 - note F_, 1 - note E_, 1 - note A_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note A_, 1 - note D_, 1 - note D#, 1 - note D_, 1 - note A_, 1 - note C#, 1 - note D_, 1 - note C#, 1 - note A_, 1 - note C_, 1 - note C#, 1 - note C_, 1 - note A_, 1 - octave 3 - note B_, 1 + A_ 1 + G# 1 + G_ 1 + F# 1 + A_ 1 + F_ 1 + F# 1 + F_ 1 + A_ 1 + E_ 1 + F_ 1 + E_ 1 + A_ 1 + D# 1 + E_ 1 + D# 1 + A_ 1 + D_ 1 + D# 1 + D_ 1 + A_ 1 + C# 1 + D_ 1 + C# 1 + A_ 1 + C_ 1 + C# 1 + C_ 1 + A_ 1 + octave 3 + B_ 1 octave 4 - note C_, 1 + C_ 1 octave 3 - note B_, 1 + B_ 1 notetype 12, 14, 1 octave 4 - note B_, 16 + B_ 16 rest 16 notetype 12, 13, 1 - note B_, 16 + B_ 16 rest 12 - note A_, 4 + A_ 4 notetype 12, 12, 2 octave 3 - note B_, 6 + B_ 6 octave 4 - note C#, 6 - note D_, 4 + C# 6 + D_ 4 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 4 - note D_, 6 - note A_, 2 - note A#, 2 - note B_, 6 + C# 4 + D_ 6 + A_ 2 + A# 2 + B_ 6 octave 5 - note C#, 6 - note D_, 4 + C# 6 + D_ 4 octave 4 - note B_, 2 + B_ 2 octave 5 - note C#, 4 - note D_, 6 + C# 4 + D_ 6 octave 4 - note A_, 4 + A_ 4 Music_TrainerBattle_branch_22bfc:: notetype 12, 12, 7 octave 3 - note B_, 6 - note F#, 14 - note B_, 4 - note F#, 4 - note B_, 4 + B_ 6 + F# 14 + B_ 4 + F# 4 + B_ 4 notetype 12, 5, 0 octave 4 - note C_, 8 + C_ 8 notetype 12, 3, 0 - note C_, 8 + C_ 8 notetype 12, 4, 14 - note C_, 8 + C_ 8 notetype 12, 12, 7 - note C_, 8 + C_ 8 octave 3 - note B_, 6 - note F#, 14 - note B_, 4 - note F#, 4 - note B_, 4 + B_ 6 + F# 14 + B_ 4 + F# 4 + B_ 4 notetype 12, 9, 0 - note A_, 8 + A_ 8 notetype 12, 5, 0 - note A_, 8 + A_ 8 notetype 12, 4, 0 - note A_, 8 + A_ 8 notetype 12, 3, 0 - note A_, 8 + A_ 8 notetype 12, 12, 7 - note G_, 16 + G_ 16 octave 4 - note D_, 8 + D_ 8 octave 3 - note G_, 8 + G_ 8 notetype 12, 8, 0 - note A_, 8 + A_ 8 notetype 12, 5, 0 - note A_, 8 + A_ 8 notetype 12, 4, 0 - note A_, 8 + A_ 8 notetype 12, 6, 0 - note A_, 8 + A_ 8 notetype 12, 12, 7 - note G_, 16 + G_ 16 octave 4 - note E_, 8 - note F#, 8 - note E_, 16 + E_ 8 + F# 8 + E_ 16 notetype 12, 12, 5 - note G_, 4 - note A_, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note D_, 2 - note E_, 2 + G_ 4 + A_ 2 + G_ 2 + F# 2 + E_ 2 + D_ 2 + E_ 2 notetype 12, 11, 7 - note F#, 8 + F# 8 notetype 12, 5, 0 - note F#, 8 + F# 8 notetype 12, 6, 0 - note F#, 8 + F# 8 notetype 12, 7, 0 - note F#, 8 + F# 8 notetype 12, 10, 0 - note G_, 8 + G_ 8 notetype 12, 10, 7 - note G_, 8 + G_ 8 notetype 12, 11, 7 - note G_, 4 + G_ 4 notetype 12, 12, 5 - note A_, 2 - note G_, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note F#, 2 + A_ 2 + G_ 2 + G_ 2 + F# 2 + E_ 2 + F# 2 notetype 12, 10, 0 - note G#, 8 + G# 8 notetype 12, 7, 0 - note G#, 8 + G# 8 notetype 12, 8, 0 - note G#, 8 + G# 8 notetype 12, 6, 0 - note G#, 8 + G# 8 notetype 12, 10, 0 - note A_, 16 + A_ 16 notetype 12, 11, 0 octave 5 - note C#, 8 - note E_, 8 + C# 8 + E_ 8 notetype 12, 12, 0 - note D_, 4 + D_ 4 octave 4 - note A_, 4 + A_ 4 octave 5 - note C_, 2 + C_ 2 notetype 12, 12, 7 octave 4 - note B_, 8 + B_ 8 notetype 12, 6, 0 - note B_, 8 + B_ 8 notetype 12, 6, 9 - note B_, 6 + B_ 6 notetype 12, 9, 6 - note B_, 6 + B_ 6 rest 2 notetype 12, 12, 0 octave 5 - note D_, 4 + D_ 4 octave 4 - note A_, 4 - note A#, 2 + A_ 4 + A# 2 notetype 12, 11, 0 octave 5 - note F_, 14 + F_ 14 notetype 12, 6, 0 - note G_, 16 + G_ 16 notetype 12, 5, 0 - note E_, 16 + E_ 16 notetype 12, 4, 0 - note E_, 16 + E_ 16 notetype 12, 12, 7 octave 4 - note C_, 6 + C_ 6 octave 3 - note A_, 14 + A_ 14 octave 4 - note C_, 4 + C_ 4 octave 3 - note A_, 4 + A_ 4 octave 4 - note C_, 4 + C_ 4 octave 3 - note A#, 6 + A# 6 octave 4 - note F_, 14 + F_ 14 octave 3 - note A#, 4 + A# 4 octave 4 - note F_, 4 - note D_, 4 - note C_, 6 + F_ 4 + D_ 4 + C_ 6 octave 3 - note A_, 14 + A_ 14 octave 4 - note C_, 4 - note E_, 2 - note D_, 2 - note C_, 2 - note E_, 2 - note D_, 2 - octave 3 - note A#, 4 + C_ 4 + E_ 2 + D_ 2 + C_ 2 + E_ 2 + D_ 2 + octave 3 + A# 4 octave 4 - note F_, 10 - note G_, 6 - note F_, 6 - note D_, 4 + F_ 10 + G_ 6 + F_ 6 + D_ 4 notetype 12, 11, 0 - note F_, 16 - note E_, 16 - note D_, 16 - note E_, 16 + F_ 16 + E_ 16 + D_ 16 + E_ 16 notetype 12, 10, 0 octave 5 - note F_, 16 - note E_, 16 - note G_, 16 - note F_, 16 + F_ 16 + E_ 16 + G_ 16 + F_ 16 notetype 12, 13, 1 octave 3 - note A#, 6 - note A#, 6 - note A#, 4 - note A_, 6 - note A_, 6 - note A_, 4 + A# 6 + A# 6 + A# 4 + A_ 6 + A_ 6 + A_ 4 octave 4 - note C_, 6 - note C_, 6 - note C_, 4 + C_ 6 + C_ 6 + C_ 4 octave 3 - note A#, 6 - note A#, 6 - note A_, 4 + A# 6 + A# 6 + A_ 4 notetype 12, 12, 7 - note A_, 4 - note B_, 4 - note G_, 2 - note A_, 10 - note B_, 2 + A_ 4 + B_ 4 + G_ 2 + A_ 10 + B_ 2 octave 4 - note C#, 2 - note E_, 2 - note D_, 2 - note C#, 2 + C# 2 + E_ 2 + D_ 2 + C# 2 octave 3 - note B_, 2 - note A#, 16 + B_ 2 + A# 16 rest 2 - note A#, 2 + A# 2 octave 4 - note C_, 2 - note F_, 2 - note E_, 2 - note D_, 2 - note C_, 2 - octave 3 - note A#, 2 - note B_, 16 + C_ 2 + F_ 2 + E_ 2 + D_ 2 + C_ 2 + octave 3 + A# 2 + B_ 16 rest 2 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note D_, 2 + C# 2 + G_ 2 + F# 2 + E_ 2 + D_ 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note C_, 16 - note E_, 8 - note G_, 8 + C_ 16 + E_ 8 + G_ 8 loopchannel 0, Music_TrainerBattle_branch_22bfc @@ -957,902 +957,902 @@ Music_TrainerBattle_Ch3:: ; 22d10 (8:6d10) vibrato 0, 2, 0 notetype 12, 1, 4 octave 3 - note B_, 1 - note A#, 1 - note A_, 1 - note G#, 1 - note A_, 1 - note G#, 1 - note G_, 1 - note F#, 1 - note G_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note C_, 1 - note C#, 1 - note C_, 1 + B_ 1 + A# 1 + A_ 1 + G# 1 + A_ 1 + G# 1 + G_ 1 + F# 1 + G_ 1 + F# 1 + F_ 1 + E_ 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + D# 1 + D_ 1 + C# 1 + C_ 1 + C# 1 + C_ 1 octave 2 - note B_, 1 - note A#, 1 - note B_, 1 - note A#, 1 - note A_, 1 - note G#, 1 - note A_, 2 - note A#, 2 - note B_, 2 - note B_, 2 + B_ 1 + A# 1 + B_ 1 + A# 1 + A_ 1 + G# 1 + A_ 2 + A# 2 + B_ 2 + B_ 2 octave 3 - note D_, 2 - note E_, 2 + D_ 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F_, 2 - note E_, 2 - note D_, 2 + F_ 2 + E_ 2 + D_ 2 octave 2 - note B_, 2 - note B_, 2 + B_ 2 + B_ 2 octave 3 - note D_, 2 - note E_, 2 + D_ 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note C_, 2 + C_ 2 octave 2 - note B_, 2 - note B_, 2 + B_ 2 + B_ 2 octave 3 - note D_, 2 - note E_, 2 + D_ 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F_, 2 - note E_, 2 - note D_, 2 + F_ 2 + E_ 2 + D_ 2 octave 2 - note B_, 2 - note B_, 2 + B_ 2 + B_ 2 octave 3 - note D_, 2 - note E_, 2 + D_ 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note C_, 2 + C_ 2 octave 2 - note B_, 2 - note B_, 2 + B_ 2 + B_ 2 octave 3 - note D_, 2 - note E_, 2 + D_ 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F_, 2 - note E_, 2 - note D_, 2 + F_ 2 + E_ 2 + D_ 2 octave 2 - note B_, 2 - note B_, 2 + B_ 2 + B_ 2 octave 3 - note D_, 2 - note E_, 2 + D_ 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note C_, 2 + C_ 2 octave 2 - note B_, 2 - note B_, 2 + B_ 2 + B_ 2 octave 3 - note D_, 2 - note E_, 2 + D_ 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F_, 2 - note E_, 2 - note D_, 2 + F_ 2 + E_ 2 + D_ 2 octave 2 - note B_, 2 - note B_, 2 + B_ 2 + B_ 2 octave 3 - note D_, 2 - note E_, 2 + D_ 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note C_, 2 + C_ 2 Music_TrainerBattle_branch_22d9c:: octave 2 - note A#, 1 - note B_, 1 + A# 1 + B_ 1 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note A_, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note D_, 2 - note C_, 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + A_ 2 + G_ 2 + F# 2 + E_ 2 + D_ 2 + C_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note D_, 2 - note C#, 2 - note D_, 2 - note C#, 2 + E_ 2 + D_ 2 + C# 2 + D_ 2 + C# 2 octave 2 - note A_, 2 - note G#, 2 - note G_, 2 + A_ 2 + G# 2 + G_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note G_, 2 + G_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note G_, 2 + G_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note G_, 2 + G_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note G_, 2 + G_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note G_, 2 + G_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note G_, 2 + G_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note G_, 2 - note G#, 2 - note A_, 2 + G_ 2 + G# 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note G_, 2 + G_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note G_, 2 + G_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note G_, 2 + G_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note G_, 2 + G_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note G_, 2 + G_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note G_, 2 + G_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note G_, 2 + G_ 2 octave 3 - note D_, 2 + D_ 2 octave 2 - note G_, 2 - note G#, 2 - note A_, 2 + G_ 2 + G# 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note D_, 2 - note C#, 2 + E_ 2 + D_ 2 + C# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 - note D_, 2 - note E_, 2 - note F#, 2 - note E_, 2 - note D_, 2 - note F#, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note D#, 2 - note F_, 2 - note G_, 2 - note F_, 2 - note D#, 2 - note G_, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note E_, 2 - note F#, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note G#, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note D_, 2 - note A_, 2 - note F_, 2 - note G_, 2 - note A_, 2 - note G_, 2 - note F_, 2 - note E_, 2 - note D_, 4 + F# 2 + D_ 2 + E_ 2 + F# 2 + E_ 2 + D_ 2 + F# 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + D# 2 + F_ 2 + G_ 2 + F_ 2 + D# 2 + G_ 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 + E_ 2 + F# 2 + G# 2 + F# 2 + E_ 2 + G# 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + D_ 2 + A_ 2 + F_ 2 + G_ 2 + A_ 2 + G_ 2 + F_ 2 + E_ 2 + D_ 4 octave 2 - note A_, 4 + A_ 4 octave 3 - note C_, 2 - note G_, 2 + C_ 2 + G_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note G_, 2 + G_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note G_, 2 + G_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note G_, 2 + G_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note G_, 2 + G_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note G_, 2 + G_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note G_, 2 + G_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note G_, 2 - note D_, 4 + G_ 2 + D_ 4 octave 2 - note A_, 4 - note A#, 2 + A_ 4 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 4 + A# 4 octave 3 - note F_, 4 + F_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note F_, 4 + F_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note E_, 4 + E_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note E_, 4 + E_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note D_, 4 + D_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note D_, 4 + D_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note E_, 4 + E_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note E_, 4 + E_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note F_, 4 + F_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note F_, 4 + F_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note E_, 4 + E_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note E_, 4 + E_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note D_, 4 + D_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note D_, 4 + D_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note E_, 4 + E_ 4 octave 2 - note A#, 4 + A# 4 octave 3 - note E_, 4 + E_ 4 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 octave 2 - note B_, 2 - note A_, 2 + B_ 2 + A_ 2 octave 3 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 octave 2 - note B_, 2 - note A_, 2 + B_ 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note E_, 2 + E_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note F_, 2 + F_ 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 + F# 2 octave 2 - note B_, 2 + B_ 2 octave 3 - note F#, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note F#, 2 - note E_, 2 - note F#, 2 - note E_, 2 - note D_, 2 - note C_, 2 + F# 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + F# 2 + E_ 2 + F# 2 + E_ 2 + D_ 2 + C_ 2 loopchannel 0, Music_TrainerBattle_branch_22d9c -; 0x23099
\ No newline at end of file +; 0x23099 diff --git a/audio/music/unusedsong.asm b/audio/music/unusedsong.asm index ee73de3f..fb51fd15 100644 --- a/audio/music/unusedsong.asm +++ b/audio/music/unusedsong.asm @@ -1,339 +1,339 @@ Music_UnusedSong_Ch1:: ; a913 (2:6913) - tempo 0, 144 - stereopanning 119 + tempo 144 + volume 7, 7 vibrato 5, 1, 6 Music_UnusedSong_branch_a91b:: notetype 12, 1, 0 octave 6 - note E_, 1 + E_ 1 rest 1 octave 5 - note B_, 1 + B_ 1 rest 1 octave 6 - note C#, 1 + C# 1 rest 1 octave 5 - note B_, 1 + B_ 1 octave 6 - note E_, 1 + E_ 1 rest 4 - note E_, 2 + E_ 2 rest 2 - note D#, 1 + D# 1 rest 1 octave 5 - note B_, 1 + B_ 1 rest 1 octave 6 - note C#, 1 + C# 1 rest 1 octave 5 - note B_, 1 + B_ 1 octave 6 - note D#, 1 + D# 1 rest 8 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note C#, 1 + C# 1 octave 5 - note B_, 1 + B_ 1 rest 2 octave 6 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note C#, 1 + C# 1 octave 5 - note B_, 1 + B_ 1 rest 2 octave 6 - note D#, 4 - note C#, 4 - note D#, 1 - note E_, 1 + D# 4 + C# 4 + D# 1 + E_ 1 rest 1 - note F#, 1 + F# 1 rest 1 octave 5 - note B_, 2 + B_ 2 rest 1 octave 6 - note E_, 1 + E_ 1 rest 1 octave 5 - note B_, 1 + B_ 1 rest 1 octave 6 - note C#, 1 + C# 1 rest 1 octave 5 - note B_, 1 + B_ 1 octave 6 - note E_, 1 + E_ 1 rest 8 - note D#, 1 + D# 1 rest 1 octave 5 - note B_, 1 + B_ 1 rest 1 octave 6 - note C#, 1 + C# 1 rest 1 octave 5 - note B_, 1 + B_ 1 octave 6 - note D#, 1 + D# 1 rest 4 octave 5 - note B_, 2 + B_ 2 rest 2 octave 6 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note C#, 1 + C# 1 octave 5 - note B_, 1 + B_ 1 rest 2 octave 6 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note E_, 1 - note F#, 1 + E_ 1 + F# 1 rest 2 - note F#, 4 - note E_, 4 - note F#, 1 - note G#, 1 + F# 4 + E_ 4 + F# 1 + G# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note D#, 2 + D# 2 rest 3 octave 5 - note A_, 2 + A_ 2 rest 2 - note B_, 2 + B_ 2 rest 2 octave 6 - note C#, 2 + C# 2 rest 2 - note E_, 2 - note F#, 8 + E_ 2 + F# 8 rest 2 - note E_, 2 - note D#, 2 - note C#, 2 + E_ 2 + D# 2 + C# 2 rest 2 octave 5 - note G#, 2 + G# 2 rest 2 - note A_, 2 + A_ 2 rest 2 - note B_, 2 + B_ 2 rest 2 octave 6 - note D#, 2 - note E_, 8 + D# 2 + E_ 8 rest 2 - note D#, 2 - note C#, 2 - note D#, 2 + D# 2 + C# 2 + D# 2 octave 5 - note A_, 2 - note G#, 2 - note A_, 2 - note A#, 1 - note B_, 1 + A_ 2 + G# 2 + A_ 2 + A# 1 + B_ 1 rest 4 - note F#, 2 + F# 2 rest 2 - note B_, 2 - note A#, 2 - note B_, 2 + B_ 2 + A# 2 + B_ 2 octave 6 - note C_, 1 - note C#, 1 + C_ 1 + C# 1 rest 8 octave 5 - note F#, 2 - note F_, 2 - note F#, 2 - note G#, 2 - note A_, 2 + F# 2 + F_ 2 + F# 2 + G# 2 + A_ 2 octave 6 - note E_, 2 - note D#, 2 - note C#, 2 + E_ 2 + D# 2 + C# 2 octave 5 - note B_, 2 + B_ 2 rest 6 - note B_, 2 + B_ 2 rest 6 loopchannel 0, Music_UnusedSong_branch_a91b endchannel Music_UnusedSong_Ch2:: ; a9cf (2:69cf) - tempo 0, 144 - stereopanning 119 - togglecall + tempo 144 + volume 7, 7 + toggleperfectpitch vibrato 6, 1, 5 Music_UnusedSong_branch_a9d8:: notetype 12, 1, 0 octave 6 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 - note G#, 1 + A_ 1 + G# 1 rest 8 - note D#, 1 + D# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 - note F#, 1 + G# 1 + F# 1 rest 4 octave 5 - note B_, 2 + B_ 2 rest 2 octave 6 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note E_, 1 - note F#, 1 + E_ 1 + F# 1 rest 2 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note E_, 1 - note F#, 1 + E_ 1 + F# 1 rest 2 - note F#, 4 - note E_, 4 - note F#, 1 - note G#, 1 + F# 4 + E_ 4 + F# 1 + G# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note D#, 2 + D# 2 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 - note G#, 1 + A_ 1 + G# 1 rest 4 - note E_, 2 + E_ 2 rest 2 - note D#, 1 + D# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 - note F#, 1 + G# 1 + F# 1 rest 8 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note E_, 1 - note F#, 1 + E_ 1 + F# 1 rest 2 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note E_, 1 - note F#, 1 + E_ 1 + F# 1 rest 2 - note F#, 4 - note E_, 4 - note F#, 1 - note G#, 1 + F# 4 + E_ 4 + F# 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 2 + F# 2 rest 1 - note C#, 2 + C# 2 rest 2 - note D#, 2 + D# 2 rest 2 - note E_, 2 + E_ 2 rest 2 - note G#, 2 + G# 2 rest 2 - note D#, 8 + D# 8 rest 2 - note E_, 2 - note D#, 2 - note C#, 2 + E_ 2 + D# 2 + C# 2 octave 5 - note B_, 2 + B_ 2 rest 2 octave 6 - note C#, 2 + C# 2 rest 2 - note D#, 2 + D# 2 rest 2 - note F#, 2 + F# 2 rest 2 - note C#, 8 + C# 8 rest 2 - note D#, 2 - note C#, 2 + D# 2 + C# 2 octave 5 - note B_, 2 - note A_, 2 - note G#, 2 - note A_, 2 - note G#, 1 - note F#, 1 + B_ 2 + A_ 2 + G# 2 + A_ 2 + G# 1 + F# 1 rest 8 - note B_, 2 - note A#, 2 - note B_, 2 - note A_, 1 - note G#, 1 + B_ 2 + A# 2 + B_ 2 + A_ 1 + G# 1 rest 4 - note G#, 2 - rest 2 - note F#, 2 - note F_, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note E_, 2 - note C#, 2 - note E_, 2 - note F#, 2 + G# 2 + rest 2 + F# 2 + F_ 2 + F# 2 + G# 2 + A_ 2 + E_ 2 + C# 2 + E_ 2 + F# 2 rest 6 - note D#, 2 + D# 2 rest 6 loopchannel 0, Music_UnusedSong_branch_a9d8 endchannel -; 0xaa6f
\ No newline at end of file +; 0xaa6f diff --git a/audio/music/vermilion.asm b/audio/music/vermilion.asm index 4d358528..5dfd5702 100644 --- a/audio/music/vermilion.asm +++ b/audio/music/vermilion.asm @@ -1,113 +1,113 @@ Music_Vermilion_Ch1:: ; b9eb (2:79eb) - tempo 0, 156 - stereopanning 119 + tempo 156 + volume 7, 7 duty 3 vibrato 12, 3, 4 - togglecall + toggleperfectpitch Music_Vermilion_branch_b9f6:: notetype 12, 11, 5 octave 3 - note E_, 4 - note C#, 1 - note D_, 1 - note E_, 2 - note A_, 4 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note F#, 2 - note A_, 4 - note F#, 1 - note G#, 1 - note A_, 2 - note E_, 4 - note C#, 2 - note E_, 2 - note A_, 2 - note G#, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note E_, 2 - note F#, 2 - note G#, 2 - note C#, 2 - note D_, 2 - note E_, 2 - note F#, 2 - note E_, 4 - note C#, 1 - note D_, 1 - note E_, 2 - note A_, 4 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note F#, 2 - note A_, 4 - note F#, 1 - note G#, 1 - note A_, 2 - note E_, 4 - note C#, 1 - note D_, 1 - note E_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note A_, 2 - note G#, 2 - note E_, 2 - note F#, 2 - note G#, 2 - note F#, 4 - note E_, 4 - note F#, 2 - note G#, 2 - note F#, 2 - note A_, 2 - note G#, 2 - note B_, 2 - note A_, 2 + E_ 4 + C# 1 + D_ 1 + E_ 2 + A_ 4 + B_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + F# 2 + A_ 4 + F# 1 + G# 1 + A_ 2 + E_ 4 + C# 2 + E_ 2 + A_ 2 + G# 2 + B_ 2 + A_ 2 + G# 2 + E_ 2 + F# 2 + G# 2 + C# 2 + D_ 2 + E_ 2 + F# 2 + E_ 4 + C# 1 + D_ 1 + E_ 2 + A_ 4 + B_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + F# 2 + A_ 4 + F# 1 + G# 1 + A_ 2 + E_ 4 + C# 1 + D_ 1 + E_ 2 + A_ 2 + G# 2 + F# 2 + A_ 2 + G# 2 + E_ 2 + F# 2 + G# 2 + F# 4 + E_ 4 + F# 2 + G# 2 + F# 2 + A_ 2 + G# 2 + B_ 2 + A_ 2 octave 4 - note C#, 2 - note D_, 2 - note C#, 2 + C# 2 + D_ 2 + C# 2 octave 3 - note B_, 2 - note A_, 2 - note G#, 1 - note A_, 1 - note B_, 2 + B_ 2 + A_ 2 + G# 1 + A_ 1 + B_ 2 octave 4 - note C#, 2 - note E_, 2 + C# 2 + E_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note D_, 2 + D_ 2 octave 3 - note G#, 2 + G# 2 octave 4 - note C#, 2 + C# 2 octave 3 - note F#, 2 - note B_, 2 - note G#, 2 - note A_, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note F#, 2 - note G#, 2 - note B_, 2 + F# 2 + B_ 2 + G# 2 + A_ 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + F# 2 + G# 2 + B_ 2 loopchannel 0, Music_Vermilion_branch_b9f6 @@ -118,63 +118,63 @@ Music_Vermilion_Ch2:: ; ba61 (2:7a61) Music_Vermilion_branch_ba66:: notetype 12, 12, 7 octave 3 - note A_, 8 + A_ 8 octave 4 - note D_, 4 - note C#, 4 + D_ 4 + C# 4 octave 3 - note B_, 6 - note A_, 1 - note B_, 1 + B_ 6 + A_ 1 + B_ 1 octave 4 - note C#, 8 + C# 8 octave 3 - note A_, 8 + A_ 8 octave 4 - note D_, 4 - note C#, 4 + D_ 4 + C# 4 octave 3 - note B_, 6 + B_ 6 octave 4 - note C#, 1 + C# 1 octave 3 - note B_, 1 - note A_, 8 - note A_, 8 + B_ 1 + A_ 8 + A_ 8 octave 4 - note D_, 4 - note C#, 4 + D_ 4 + C# 4 octave 3 - note B_, 6 - note A_, 1 - note B_, 1 + B_ 6 + A_ 1 + B_ 1 octave 4 - note C#, 8 + C# 8 octave 3 - note A_, 8 + A_ 8 octave 4 - note D_, 4 - note C#, 4 + D_ 4 + C# 4 octave 3 - note B_, 6 + B_ 6 octave 4 - note C#, 1 + C# 1 octave 3 - note B_, 1 - note A_, 8 - note B_, 4 + B_ 1 + A_ 8 + B_ 4 octave 4 - note C#, 4 - note D_, 4 - note E_, 4 - note F#, 8 - note B_, 8 - note A_, 4 - note G#, 4 - note F#, 4 - note E_, 4 - note F#, 8 - note E_, 8 + C# 4 + D_ 4 + E_ 4 + F# 8 + B_ 8 + A_ 4 + G# 4 + F# 4 + E_ 4 + F# 8 + E_ 8 loopchannel 0, Music_Vermilion_branch_ba66 @@ -183,102 +183,102 @@ Music_Vermilion_Ch3:: ; baa6 (2:7aa6) Music_Vermilion_branch_baa8:: octave 4 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note F#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note F#, 2 - note E_, 2 - note G#, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note B_, 2 - note E_, 2 - note A_, 2 - note E_, 2 - note G#, 2 - note E_, 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + A_ 2 + G# 2 + F# 2 + G# 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + A_ 2 + E_ 2 + A_ 2 + E_ 2 + B_ 2 + E_ 2 + A_ 2 + E_ 2 + G# 2 + E_ 2 + F# 2 + E_ 2 + G# 2 + E_ 2 + G# 2 + E_ 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + F# 2 + E_ 2 + G# 2 + E_ 2 + A_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + B_ 2 + E_ 2 + A_ 2 + E_ 2 + G# 2 + E_ 2 loopchannel 0, Music_Vermilion_branch_baa8 @@ -287,19 +287,19 @@ Music_Vermilion_Ch4:: ; bb0d (2:7b0d) Music_Vermilion_branch_bb0e:: callchannel Music_Vermilion_branch_bb3f - dnote 2, triangle1 - dnote 1, triangle1 - dnote 1, triangle1 - dnote 2, triangle1 - dnote 1, triangle1 - dnote 1, triangle1 - dnote 2, triangle1 - dnote 1, triangle1 - dnote 1, triangle1 - dnote 1, triangle1 - dnote 1, triangle1 - dnote 1, triangle1 - dnote 1, triangle1 + triangle1 2 + triangle1 1 + triangle1 1 + triangle1 2 + triangle1 1 + triangle1 1 + triangle1 2 + triangle1 1 + triangle1 1 + triangle1 1 + triangle1 1 + triangle1 1 + triangle1 1 loopchannel 4, Music_Vermilion_branch_bb0e callchannel Music_Vermilion_branch_bb3f callchannel Music_Vermilion_branch_bb3f @@ -308,17 +308,17 @@ Music_Vermilion_branch_bb0e:: loopchannel 0, Music_Vermilion_branch_bb0e Music_Vermilion_branch_bb3f:: - dnote 2, triangle1 - dnote 1, triangle1 - dnote 1, triangle1 - dnote 2, triangle1 - dnote 1, triangle1 - dnote 1, triangle1 - dnote 2, triangle1 - dnote 1, triangle1 - dnote 1, triangle1 - dnote 2, triangle1 - dnote 1, triangle1 - dnote 1, triangle1 + triangle1 2 + triangle1 1 + triangle1 1 + triangle1 2 + triangle1 1 + triangle1 1 + triangle1 2 + triangle1 1 + triangle1 1 + triangle1 2 + triangle1 1 + triangle1 1 endchannel -; 0xbb58
\ No newline at end of file +; 0xbb58 diff --git a/audio/music/wildbattle.asm b/audio/music/wildbattle.asm index b2b80e6e..70ce7d3f 100644 --- a/audio/music/wildbattle.asm +++ b/audio/music/wildbattle.asm @@ -1,302 +1,302 @@ Music_WildBattle_Ch1:: ; 23099 (8:7099) - tempo 0, 104 - stereopanning 119 + tempo 104 + volume 7, 7 duty 3 vibrato 6, 3, 4 - togglecall + toggleperfectpitch notetype 12, 11, 3 octave 4 - note C_, 1 + C_ 1 octave 3 - note B_, 1 - note A#, 1 - note A_, 1 - note A#, 1 - note A_, 1 - note G#, 1 - note G_, 1 - note G#, 1 - note G_, 1 - note F#, 1 - note F_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note C#, 1 - note C_, 1 + B_ 1 + A# 1 + A_ 1 + A# 1 + A_ 1 + G# 1 + G_ 1 + G# 1 + G_ 1 + F# 1 + F_ 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + C# 1 + C_ 1 octave 2 - note B_, 1 + B_ 1 octave 3 - note C_, 1 + C_ 1 octave 2 - note B_, 1 - note A#, 1 - note A_, 1 - note A#, 1 - note B_, 1 + B_ 1 + A# 1 + A_ 1 + A# 1 + B_ 1 octave 3 - note C_, 1 - note C#, 1 + C_ 1 + C# 1 notetype 12, 11, 1 - note G_, 6 - note E_, 6 - note D#, 12 - note C#, 14 - note E_, 6 - note D#, 10 + G_ 6 + E_ 6 + D# 12 + C# 14 + E_ 6 + D# 10 notetype 12, 4, 15 - note C#, 10 + C# 10 notetype 12, 11, 1 - note G_, 6 - note E_, 6 - note D#, 12 - note C#, 14 - note E_, 6 - note D#, 10 - note C#, 10 + G_ 6 + E_ 6 + D# 12 + C# 14 + E_ 6 + D# 10 + C# 10 Music_WildBattle_branch_230e0:: notetype 12, 11, 3 - note C#, 1 - note D_, 1 - note C#, 1 - note C_, 1 - note C#, 1 - note D_, 1 - note C#, 1 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note C_, 1 + C# 1 + D_ 1 + C# 1 + C_ 1 + C# 1 + D_ 1 + C# 1 + C_ 1 + C# 1 + D_ 1 + D# 1 + D_ 1 + C# 1 + C_ 1 octave 2 - note B_, 1 + B_ 1 octave 3 - note C_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note G#, 1 - note A_, 1 - note G#, 1 - note G_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note G#, 1 - note A_, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note G#, 1 - note A_, 1 - note G#, 1 - note G_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note G#, 1 - note A_, 1 - note G#, 1 - note G_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note G#, 1 - note A_, 1 - note G#, 1 - note G_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note D_, 1 - note C#, 1 - note D_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note F#, 1 - note F_, 1 - note E_, 1 - note D#, 1 - note E_, 1 - note F_, 1 - note F#, 1 - note G_, 1 - note G#, 1 + C_ 1 + C# 1 + D_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + G_ 1 + G# 1 + A_ 1 + G# 1 + G_ 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + G_ 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + G_ 1 + G# 1 + A_ 1 + D_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + F_ 1 + E_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + G_ 1 + G# 1 + A_ 1 + G# 1 + G_ 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + G_ 1 + G# 1 + A_ 1 + G# 1 + G_ 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + G_ 1 + G# 1 + A_ 1 + G# 1 + G_ 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + D_ 1 + C# 1 + D_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + G_ 1 + F# 1 + F_ 1 + E_ 1 + D# 1 + E_ 1 + F_ 1 + F# 1 + G_ 1 + G# 1 notetype 12, 11, 5 - note D_, 4 - note C_, 4 - note D_, 4 - note F_, 4 - note E_, 6 - note D_, 6 - note F_, 4 + D_ 4 + C_ 4 + D_ 4 + F_ 4 + E_ 6 + D_ 6 + F_ 4 notetype 12, 11, 7 - note A_, 16 - note G_, 16 + A_ 16 + G_ 16 notetype 12, 11, 5 - note D_, 4 - note C_, 4 - note D_, 4 - note F_, 4 - note G_, 6 - note A_, 6 - note B_, 4 + D_ 4 + C_ 4 + D_ 4 + F_ 4 + G_ 6 + A_ 6 + B_ 4 notetype 12, 11, 7 octave 4 - note C_, 16 + C_ 16 notetype 12, 3, 15 - note G_, 16 + G_ 16 notetype 12, 11, 5 octave 3 - note C_, 12 - note C_, 2 + C_ 12 + C_ 2 rest 2 - note D_, 2 - note C_, 2 + D_ 2 + C_ 2 rest 12 - note C#, 12 - note C#, 2 + C# 12 + C# 2 rest 2 - note F_, 2 + F_ 2 notetype 12, 10, 3 - note D#, 6 + D# 6 notetype 12, 10, 7 - note C#, 8 + C# 8 loopchannel 0, Music_WildBattle_branch_230e0 @@ -305,160 +305,160 @@ Music_WildBattle_Ch2:: ; 231d8 (8:71d8) vibrato 8, 2, 5 notetype 12, 12, 3 octave 4 - note G_, 1 - note F#, 1 - note F_, 1 + G_ 1 + F# 1 + F_ 1 octave 5 - note G_, 1 + G_ 1 octave 4 - note G_, 1 - note F#, 1 - note F_, 1 + G_ 1 + F# 1 + F_ 1 octave 5 - note G_, 1 + G_ 1 octave 4 - note G_, 1 - note F#, 1 - note F_, 1 + G_ 1 + F# 1 + F_ 1 octave 5 - note G_, 1 + G_ 1 octave 4 - note G_, 1 - note F#, 1 - note F_, 1 + G_ 1 + F# 1 + F_ 1 octave 5 - note G_, 1 + G_ 1 octave 4 - note G_, 1 - note F#, 1 - note F_, 1 + G_ 1 + F# 1 + F_ 1 octave 5 - note G_, 1 + G_ 1 octave 4 - note G_, 1 - note F#, 1 - note F_, 1 + G_ 1 + F# 1 + F_ 1 octave 5 - note G_, 1 + G_ 1 octave 4 - note G_, 1 - note F#, 1 - note F_, 1 + G_ 1 + F# 1 + F_ 1 octave 5 - note G_, 1 + G_ 1 octave 4 - note G_, 1 - note F#, 1 - note F_, 1 + G_ 1 + F# 1 + F_ 1 octave 5 - note G_, 1 + G_ 1 notetype 12, 12, 2 octave 4 - note G_, 6 + G_ 6 octave 3 - note G_, 6 - note G_, 12 - note G_, 14 - note G_, 6 - note G_, 10 + G_ 6 + G_ 12 + G_ 14 + G_ 6 + G_ 10 notetype 12, 9, 0 - note F#, 10 + F# 10 notetype 12, 12, 2 - note G_, 6 - note G_, 6 - note G_, 12 - note G_, 14 - note G_, 6 - note G_, 10 - note G_, 10 + G_ 6 + G_ 6 + G_ 12 + G_ 14 + G_ 6 + G_ 10 + G_ 10 Music_WildBattle_branch_23225:: notetype 12, 12, 5 - note G_, 6 - note F#, 6 - note E_, 4 - note G_, 6 - note A_, 6 - note G_, 4 + G_ 6 + F# 6 + E_ 4 + G_ 6 + A_ 6 + G_ 4 octave 4 - note G#, 12 - note G_, 2 + G# 12 + G_ 2 rest 2 - note G#, 2 - note G_, 2 + G# 2 + G_ 2 rest 4 notetype 12, 11, 7 octave 5 - note C#, 8 + C# 8 notetype 12, 12, 5 octave 4 - note C_, 6 + C_ 6 octave 3 - note A#, 6 - note G#, 4 + A# 6 + G# 4 octave 4 - note C#, 6 - note C_, 6 + C# 6 + C_ 6 octave 3 - note A#, 4 + A# 4 octave 4 - note F_, 6 - note E_, 6 - note D_, 4 + F_ 6 + E_ 6 + D_ 4 notetype 12, 12, 7 octave 3 - note A#, 4 + A# 4 octave 4 - note C_, 4 - note D_, 4 - note F_, 4 + C_ 4 + D_ 4 + F_ 4 notetype 12, 12, 0 - note G#, 16 + G# 16 notetype 12, 11, 0 - note G#, 16 + G# 16 notetype 12, 4, 14 - note G_, 16 + G_ 16 notetype 12, 12, 7 - note G_, 16 + G_ 16 octave 3 - note F_, 8 - note A#, 8 + F_ 8 + A# 8 octave 4 - note D_, 8 - note F_, 8 + D_ 8 + F_ 8 notetype 12, 12, 0 - note E_, 16 + E_ 16 notetype 12, 12, 7 - note E_, 16 + E_ 16 octave 3 - note F_, 8 - note A#, 8 + F_ 8 + A# 8 octave 4 - note D_, 8 - note F_, 8 + D_ 8 + F_ 8 notetype 12, 12, 0 - note G_, 16 + G_ 16 notetype 12, 3, 15 octave 5 - note C_, 16 + C_ 16 notetype 12, 12, 5 octave 4 - note E_, 12 - note E_, 2 + E_ 12 + E_ 2 rest 2 - note F_, 2 + F_ 2 notetype 12, 12, 1 - note E_, 4 + E_ 4 notetype 12, 12, 5 rest 10 - note F_, 12 - note F_, 2 + F_ 12 + F_ 2 rest 2 - note G#, 2 + G# 2 notetype 12, 10, 3 - note G_, 6 + G_ 6 notetype 12, 12, 7 - note F_, 8 + F_ 8 loopchannel 0, Music_WildBattle_branch_23225 @@ -466,274 +466,274 @@ Music_WildBattle_Ch3:: ; 23290 (8:7290) vibrato 0, 2, 0 notetype 12, 1, 1 octave 4 - note C#, 1 + C# 1 rest 1 - note C#, 1 - note C_, 1 - note D_, 1 + C# 1 + C_ 1 + D_ 1 rest 1 - note D_, 1 - note C_, 1 - note D#, 1 + D_ 1 + C_ 1 + D# 1 rest 1 - note D#, 1 - note C_, 1 - note E_, 1 + D# 1 + C_ 1 + E_ 1 rest 1 - note E_, 1 - note C_, 1 - note F_, 1 + E_ 1 + C_ 1 + F_ 1 rest 1 - note F_, 1 - note C_, 1 - note F#, 1 + F_ 1 + C_ 1 + F# 1 rest 1 - note F#, 1 - note C_, 1 - note G_, 1 + F# 1 + C_ 1 + G_ 1 rest 1 - note G_, 1 - note C_, 1 + G_ 1 + C_ 1 octave 3 - note A#, 2 - note B_, 2 + A# 2 + B_ 2 Music_WildBattle_branch_232b5:: octave 4 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C#, 2 - note G#, 2 - note C#, 4 - note G#, 2 - note A#, 2 - note G#, 2 - note G_, 2 - note C#, 2 - note G#, 2 - note C#, 4 - note G#, 2 - note A#, 2 - note G#, 2 - note F_, 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C# 2 + G# 2 + C# 4 + G# 2 + A# 2 + G# 2 + G_ 2 + C# 2 + G# 2 + C# 4 + G# 2 + A# 2 + G# 2 + F_ 2 loopchannel 2, Music_WildBattle_branch_232b5 Music_WildBattle_branch_232d8:: - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note G#, 12 - note G_, 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + G# 12 + G_ 2 rest 2 - note G#, 2 - note G_, 2 + G# 2 + G_ 2 rest 4 - note F_, 2 - note E_, 2 - note D_, 2 - note C#, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 + F_ 2 + E_ 2 + D_ 2 + C# 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 octave 3 - note A#, 2 + A# 2 octave 4 - note F_, 2 + F_ 2 octave 3 - note A#, 2 + A# 2 octave 4 - note F_, 2 + F_ 2 octave 3 - note A#, 2 + A# 2 octave 4 - note F_, 2 + F_ 2 octave 3 - note A#, 2 + A# 2 octave 4 - note F_, 2 + F_ 2 octave 3 - note A#, 2 + A# 2 octave 4 - note F_, 2 + F_ 2 octave 3 - note A#, 2 + A# 2 octave 4 - note F_, 2 + F_ 2 octave 3 - note A#, 2 + A# 2 octave 4 - note F_, 2 + F_ 2 octave 3 - note A#, 2 + A# 2 octave 4 - note F_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note F_, 2 - note C_, 2 - note F_, 2 - note C_, 2 - note F_, 2 - note C_, 2 - note F_, 2 - note C_, 2 - note F_, 2 - note C_, 2 - note F_, 2 - note C_, 2 - note F_, 2 - note C_, 2 - note F_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C_, 2 - note G_, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 - note C#, 2 - note G#, 2 + F_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + F_ 2 + C_ 2 + F_ 2 + C_ 2 + F_ 2 + C_ 2 + F_ 2 + C_ 2 + F_ 2 + C_ 2 + F_ 2 + C_ 2 + F_ 2 + C_ 2 + F_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C_ 2 + G_ 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 + C# 2 + G# 2 loopchannel 0, Music_WildBattle_branch_232d8 -; 0x233a6
\ No newline at end of file +; 0x233a6 diff --git a/audio/music/yellow/meetjessiejames.asm b/audio/music/yellow/meetjessiejames.asm index eeff798b..5ef52491 100644 --- a/audio/music/yellow/meetjessiejames.asm +++ b/audio/music/yellow/meetjessiejames.asm @@ -1,310 +1,310 @@ -Music_MeetJessieJames_Ch1: ; 8316d (20:716d) - tempo 0, 144 - stereopanning 119 +Music_MeetJessieJames_Ch1:: ; 8316d (20:716d) + tempo 144 + volume 7, 7 duty 3 vibrato 8, 1, 4 notetype 12, 11, 2 octave 3 - note G#, 1 - note G_, 1 - note F#, 2 - note F_, 2 - note E_, 2 - note D#, 2 - note D_, 2 - note C#, 2 - note C_, 2 + G# 1 + G_ 1 + F# 2 + F_ 2 + E_ 2 + D# 2 + D_ 2 + C# 2 + C_ 2 notetype 12, 11, 6 - note D#, 12 - note C_, 4 + D# 12 + C_ 4 -Music_MeetJessieJames_branch_83187: +Music_MeetJessieJames_branch_83187:: notetype 12, 11, 2 octave 4 - note D_, 16 + D_ 16 rest 12 notetype 12, 11, 4 octave 3 - note A#, 4 + A# 4 rest 16 rest 8 notetype 12, 11, 2 octave 2 - note A_, 2 + A_ 2 octave 3 - note A#, 2 - note A_, 4 - note D_, 1 - note D#, 1 - note D#, 2 - note D#, 2 - note D_, 2 - note D#, 2 - note D_, 2 - note D#, 2 - note F_, 2 - note D_, 1 - note D#, 1 - note D#, 2 - note D#, 2 - note D_, 2 + A# 2 + A_ 4 + D_ 1 + D# 1 + D# 2 + D# 2 + D_ 2 + D# 2 + D_ 2 + D# 2 + F_ 2 + D_ 1 + D# 1 + D# 2 + D# 2 + D_ 2 octave 2 - note A#, 4 + A# 4 notetype 12, 11, 4 octave 3 - note B_, 4 + B_ 4 notetype 12, 11, 2 - note D_, 1 - note D#, 1 - note D#, 2 - note D#, 2 - note D_, 2 - note D#, 2 - note D_, 2 - note D#, 2 - note F_, 2 - note D_, 1 - note D#, 1 - note D#, 2 - note D#, 2 - note D_, 2 + D_ 1 + D# 1 + D# 2 + D# 2 + D_ 2 + D# 2 + D_ 2 + D# 2 + F_ 2 + D_ 1 + D# 1 + D# 2 + D# 2 + D_ 2 octave 2 - note A#, 2 + A# 2 octave 3 - note B_, 2 + B_ 2 notetype 12, 11, 4 - note A#, 4 + A# 4 loopchannel 0, Music_MeetJessieJames_branch_83187 -Music_MeetJessieJames_Ch2: ; 831c8 (20:71c8) +Music_MeetJessieJames_Ch2:: ; 831c8 (20:71c8) duty 3 vibrato 6, 1, 5 notetype 12, 12, 2 octave 4 - note D_, 1 - note C#, 1 - note C_, 2 + D_ 1 + C# 1 + C_ 2 octave 3 - note B_, 2 - note A#, 2 - note A_, 2 - note G#, 2 - note G_, 2 - note F#, 2 + B_ 2 + A# 2 + A_ 2 + G# 2 + G_ 2 + F# 2 notetype 12, 12, 7 - note A_, 12 + A_ 12 octave 4 - note C#, 4 + C# 4 -Music_MeetJessieJames_branch_831df: +Music_MeetJessieJames_branch_831df:: notetype 12, 12, 2 octave 3 - note C#, 1 - note D_, 1 - note D_, 2 - note D_, 2 - note C#, 2 - note D_, 2 - note C#, 2 - note D_, 2 - note E_, 2 - note C#, 1 - note D_, 1 - note D_, 2 - note D_, 2 - note C#, 2 + C# 1 + D_ 1 + D_ 2 + D_ 2 + C# 2 + D_ 2 + C# 2 + D_ 2 + E_ 2 + C# 1 + D_ 1 + D_ 2 + D_ 2 + C# 2 octave 2 - note A_, 4 + A_ 4 notetype 12, 12, 5 octave 4 - note C#, 4 + C# 4 notetype 12, 12, 2 - note D_, 1 + D_ 1 octave 3 - note D_, 1 - note D_, 2 - note D_, 2 - note C#, 2 - note D_, 2 - note C#, 2 - note D_, 2 - note E_, 2 - note C#, 1 - note D_, 1 - note D_, 2 - note D_, 2 - note C#, 2 + D_ 1 + D_ 2 + D_ 2 + C# 2 + D_ 2 + C# 2 + D_ 2 + E_ 2 + C# 1 + D_ 1 + D_ 2 + D_ 2 + C# 2 notetype 12, 12, 6 octave 4 - note D_, 8 + D_ 8 notetype 12, 12, 2 - note D#, 6 - note F_, 4 - note D#, 4 + D# 6 + F_ 4 + D# 4 octave 3 - note A#, 2 + A# 2 octave 4 - note D#, 6 - note F_, 4 - note D#, 2 + D# 6 + F_ 4 + D# 2 notetype 12, 12, 5 - note D_, 4 + D_ 4 notetype 12, 12, 2 - note D#, 6 - note F_, 4 - note D#, 4 + D# 6 + F_ 4 + D# 4 octave 3 - note A#, 2 + A# 2 octave 4 - note D#, 4 - note F_, 4 + D# 4 + F_ 4 notetype 12, 12, 5 - note D#, 8 + D# 8 loopchannel 0, Music_MeetJessieJames_branch_831df -Music_MeetJessieJames_Ch3: ; 8322a (20:722a) +Music_MeetJessieJames_Ch3:: ; 8322a (20:722a) notetype 12, 1, 0 rest 16 rest 8 octave 4 - note D_, 2 + D_ 2 octave 3 - note A_, 2 + A_ 2 octave 4 - note C_, 2 - note D#, 2 + C_ 2 + D# 2 -Music_MeetJessieJames_branch_83235: - note D_, 1 +Music_MeetJessieJames_branch_83235:: + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A#, 2 - note A_, 2 - note D#, 2 - note D_, 1 + A# 2 + A_ 2 + D# 2 + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note D_, 1 + D_ 1 rest 1 octave 3 - note A_, 2 + A_ 2 octave 4 - note C_, 2 - note D_, 2 - note D#, 1 + C_ 2 + D_ 2 + D# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note D#, 1 + D# 1 rest 1 octave 3 - note A#, 1 + A# 1 rest 1 octave 4 - note C#, 1 + C# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note D#, 1 + D# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note A#, 1 + A# 1 rest 1 - note D#, 1 + D# 1 rest 1 octave 3 - note A#, 1 + A# 1 rest 1 octave 4 - note C#, 1 + C# 1 rest 1 - note E_, 1 + E_ 1 rest 1 loopchannel 0, Music_MeetJessieJames_branch_83235 endchannel -; 0x832ba
\ No newline at end of file +; 0x832ba diff --git a/audio/music/yellow/surfingpikachu.asm b/audio/music/yellow/surfingpikachu.asm index 46bec7c3..1832bb03 100644 --- a/audio/music/yellow/surfingpikachu.asm +++ b/audio/music/yellow/surfingpikachu.asm @@ -1,691 +1,691 @@ -Music_SurfingPikachu_Ch1: ; 82ce8 (20:6ce8) - tempo 0, 117 - stereopanning 119 +Music_SurfingPikachu_Ch1:: ; 82ce8 (20:6ce8) + tempo 117 + volume 7, 7 duty 3 vibrato 8, 1, 4 notetype 12, 11, 3 octave 3 - note E_, 6 + E_ 6 notetype 12, 11, 2 - note F#, 2 + F# 2 notetype 12, 11, 3 - note E_, 6 + E_ 6 notetype 12, 11, 2 - note F#, 16 + F# 16 rest 2 notetype 12, 11, 3 - note E_, 6 + E_ 6 notetype 12, 11, 2 - note A_, 2 + A_ 2 notetype 12, 11, 3 - note E_, 6 + E_ 6 notetype 12, 11, 2 - note A_, 14 + A_ 14 notetype 12, 11, 2 - note D#, 2 - note C#, 1 - note D#, 1 + D# 2 + C# 1 + D# 1 octave 2 - note B_, 6 - octave 3 - note E_, 4 - note E_, 4 - note E_, 8 - note G#, 4 - note G#, 4 - note G#, 2 + B_ 6 + octave 3 + E_ 4 + E_ 4 + E_ 8 + G# 4 + G# 4 + G# 2 -Music_SurfingPikachu_branch_82d1a: +Music_SurfingPikachu_branch_82d1a:: notetype 12, 11, 3 octave 3 - note G#, 4 - note E_, 4 - note F#, 4 - note E_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note D#, 2 - note E_, 2 - note D#, 2 - note C#, 6 - note F#, 2 - note A_, 8 + G# 4 + E_ 4 + F# 4 + E_ 2 + A_ 2 + G# 2 + F# 2 + G# 2 + F# 2 + E_ 2 + D# 2 + E_ 2 + D# 2 + C# 6 + F# 2 + A_ 8 octave 2 - note B_, 6 - octave 3 - note E_, 2 - note G#, 8 - note G#, 4 - note E_, 4 - note F#, 4 - note E_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note G#, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note G#, 2 - note F#, 6 - note E_, 2 - note F#, 1 + B_ 6 + octave 3 + E_ 2 + G# 8 + G# 4 + E_ 4 + F# 4 + E_ 2 + A_ 2 + G# 2 + F# 2 + G# 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + G# 2 + F# 6 + E_ 2 + F# 1 rest 3 - note A_, 4 + A_ 4 duty 0 notetype 12, 11, 2 - note G#, 1 - note F#, 1 - note G#, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note E_, 2 - note D#, 2 - note F#, 2 - note F#, 2 - note D#, 2 - note F#, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note B_, 1 - note A#, 1 - note B_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note G_, 2 - note G#, 2 - note A_, 2 - octave 4 - note C#, 2 - note C_, 2 - note C#, 3 - octave 3 - note F#, 1 - note A_, 2 - note G#, 2 - note F#, 2 - note A_, 2 - note E_, 3 - note E_, 1 - note B_, 2 - note A_, 2 - note G#, 6 - note E_, 1 - note F_, 1 - note F#, 2 - note F#, 2 - note D#, 2 - note F#, 2 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 - note B_, 1 - note A#, 1 - note B_, 2 - note G#, 2 - note E_, 2 - note G#, 2 - note G_, 2 - note G#, 2 - note A_, 2 - octave 4 - note C#, 2 - note C_, 2 - note C#, 3 - octave 3 - note F#, 1 - note A_, 2 - note G#, 2 - note A_, 2 - octave 4 - note D#, 2 - note E_, 2 - note E_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note E_, 1 - note D#, 1 - note E_, 8 + G# 1 + F# 1 + G# 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + E_ 2 + D# 2 + F# 2 + F# 2 + D# 2 + F# 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + B_ 1 + A# 1 + B_ 2 + G# 2 + E_ 2 + G# 2 + G_ 2 + G# 2 + A_ 2 + octave 4 + C# 2 + C_ 2 + C# 3 + octave 3 + F# 1 + A_ 2 + G# 2 + F# 2 + A_ 2 + E_ 3 + E_ 1 + B_ 2 + A_ 2 + G# 6 + E_ 1 + F_ 1 + F# 2 + F# 2 + D# 2 + F# 2 + B_ 2 + A_ 2 + G# 2 + F# 2 + B_ 1 + A# 1 + B_ 2 + G# 2 + E_ 2 + G# 2 + G_ 2 + G# 2 + A_ 2 + octave 4 + C# 2 + C_ 2 + C# 3 + octave 3 + F# 1 + A_ 2 + G# 2 + A_ 2 + octave 4 + D# 2 + E_ 2 + E_ 1 + D# 1 + E_ 1 + D# 1 + E_ 1 + D# 1 + E_ 8 duty 3 loopchannel 0, Music_SurfingPikachu_branch_82d1a -Music_SurfingPikachu_Ch2: ; 82d9d (20:6d9d) +Music_SurfingPikachu_Ch2:: ; 82d9d (20:6d9d) duty 3 vibrato 6, 1, 5 notetype 12, 12, 4 octave 3 - note B_, 6 + B_ 6 notetype 12, 12, 2 octave 4 - note E_, 2 + E_ 2 notetype 12, 12, 4 octave 3 - note B_, 6 + B_ 6 notetype 12, 12, 2 octave 4 - note E_, 2 + E_ 2 notetype 12, 11, 2 octave 3 - note B_, 2 + B_ 2 octave 4 - note C#, 2 - note D#, 2 - note C#, 2 + C# 2 + D# 2 + C# 2 octave 3 - note B_, 2 - note A_, 2 - note G#, 2 - note F#, 2 + B_ 2 + A_ 2 + G# 2 + F# 2 notetype 12, 12, 4 octave 4 - note C#, 6 + C# 6 notetype 12, 12, 2 - note F#, 2 + F# 2 notetype 12, 12, 4 - note C#, 6 + C# 6 notetype 12, 12, 2 - note F#, 2 + F# 2 notetype 12, 11, 2 - note C#, 2 - note D#, 2 - note E_, 2 - note D#, 2 - note C#, 2 - octave 3 - note B_, 2 - note A_, 2 - note G#, 2 + C# 2 + D# 2 + E_ 2 + D# 2 + C# 2 + octave 3 + B_ 2 + A_ 2 + G# 2 notetype 12, 12, 2 - note E_, 6 - note B_, 4 - note B_, 4 - note B_, 8 - note B_, 4 - note B_, 4 - note B_, 2 + E_ 6 + B_ 4 + B_ 4 + B_ 8 + B_ 4 + B_ 4 + B_ 2 -Music_SurfingPikachu_branch_82de0: +Music_SurfingPikachu_branch_82de0:: notetype 12, 12, 6 octave 4 - note E_, 4 + E_ 4 octave 3 - note B_, 4 - note A_, 4 + B_ 4 + A_ 4 octave 4 - note C#, 4 + C# 4 octave 3 - note B_, 6 - note A_, 2 - note G#, 8 - note F#, 6 - note A_, 2 + B_ 6 + A_ 2 + G# 8 + F# 6 + A_ 2 octave 4 - note C#, 8 + C# 8 octave 3 - note E_, 6 - note G#, 2 - note B_, 8 + E_ 6 + G# 2 + B_ 8 octave 4 - note E_, 4 + E_ 4 octave 3 - note B_, 4 - note A_, 4 + B_ 4 + A_ 4 octave 4 - note C#, 4 + C# 4 octave 3 - note B_, 6 + B_ 6 octave 4 - note D#, 2 - note E_, 8 - note D#, 6 - note C#, 2 - note D#, 1 + D# 2 + E_ 8 + D# 6 + C# 2 + D# 1 rest 3 - note F#, 4 - note E_, 10 + F# 4 + E_ 10 notetype 12, 12, 6 duty 2 - note E_, 2 - note D#, 2 - note C#, 2 - octave 3 - note B_, 6 - octave 4 - note C#, 2 - note D#, 4 - octave 3 - note B_, 4 - octave 4 - note E_, 6 - note F#, 2 - note G#, 8 - note A_, 6 - note G#, 2 - note A_, 4 - note F#, 4 - note G#, 10 - note E_, 2 - note D#, 2 - note C#, 2 - octave 3 - note B_, 6 - octave 4 - note C#, 2 - note D#, 4 - octave 3 - note B_, 4 - octave 4 - note E_, 6 - note F#, 2 - note G#, 8 - note A_, 4 - note F#, 4 - note D#, 4 + E_ 2 + D# 2 + C# 2 + octave 3 + B_ 6 + octave 4 + C# 2 + D# 4 + octave 3 + B_ 4 + octave 4 + E_ 6 + F# 2 + G# 8 + A_ 6 + G# 2 + A_ 4 + F# 4 + G# 10 + E_ 2 + D# 2 + C# 2 + octave 3 + B_ 6 + octave 4 + C# 2 + D# 4 + octave 3 + B_ 4 + octave 4 + E_ 6 + F# 2 + G# 8 + A_ 4 + F# 4 + D# 4 octave 5 - note C#, 4 + C# 4 octave 4 - note B_, 8 + B_ 8 notetype 12, 12, 2 octave 5 - note E_, 4 + E_ 4 notetype 12, 12, 6 duty 3 octave 3 - note B_, 1 - note A#, 1 - note B_, 1 + B_ 1 + A# 1 + B_ 1 octave 4 - note C#, 1 + C# 1 loopchannel 0, Music_SurfingPikachu_branch_82de0 -Music_SurfingPikachu_Ch3: ; 82e45 (20:6e45) +Music_SurfingPikachu_Ch3:: ; 82e45 (20:6e45) notetype 12, 1, 0 octave 4 - note B_, 6 + B_ 6 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note B_, 6 + B_ 6 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note B_, 1 + B_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note C#, 1 + C# 1 rest 1 octave 4 - note A_, 6 + A_ 6 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note A_, 6 + A_ 6 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note G#, 1 + G# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 -Music_SurfingPikachu_branch_82ea0: - note E_, 1 +Music_SurfingPikachu_branch_82ea0:: + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F#, 1 + F# 1 rest 1 octave 5 - note C#, 1 - note C_, 1 - note C#, 1 + C# 1 + C_ 1 + C# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 1 octave 5 - note E_, 1 - note D#, 1 - note E_, 1 + E_ 1 + D# 1 + E_ 1 rest 1 octave 4 - note D#, 1 + D# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note C#, 1 + C# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note D#, 1 + D# 1 rest 1 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note B_, 1 - note A#, 1 - note B_, 1 + B_ 1 + A# 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note G#, 1 + G# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note C#, 1 + C# 1 rest 1 - note D_, 1 + D_ 1 rest 1 - note D#, 1 + D# 1 rest 1 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note F#, 1 + F# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note G#, 1 + G# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 loopchannel 0, Music_SurfingPikachu_branch_82ea0 -; 0x82fbe
\ No newline at end of file +; 0x82fbe diff --git a/audio/music/yellow/yellowintro.asm b/audio/music/yellow/yellowintro.asm index ee716901..4d9cf938 100644 --- a/audio/music/yellow/yellowintro.asm +++ b/audio/music/yellow/yellowintro.asm @@ -1,485 +1,485 @@ -Music_YellowIntro_Ch1: ; 7f65c (1f:765c) - tempo 0, 116 - stereopanning 119 +Music_YellowIntro_Ch1:: ; 7f65c (1f:765c) + tempo 116 + volume 7, 7 duty 3 vibrato 8, 1, 4 notetype 12, 11, 2 octave 3 - note G#, 2 - note B_, 4 - note B_, 4 - note B_, 4 - note B_, 4 - note B_, 4 - note B_, 3 - note A#, 1 - note B_, 2 - note B_, 10 + G# 2 + B_ 4 + B_ 4 + B_ 4 + B_ 4 + B_ 4 + B_ 3 + A# 1 + B_ 2 + B_ 10 notetype 12, 11, 6 octave 4 - note C#, 1 - note C_, 1 - note C#, 10 + C# 1 + C_ 1 + C# 10 octave 3 - note G#, 1 - note G_, 1 - note G#, 4 - note B_, 4 - octave 4 - note E_, 4 - note F#, 8 - note E_, 8 + G# 1 + G_ 1 + G# 4 + B_ 4 + octave 4 + E_ 4 + F# 8 + E_ 8 octave 3 - note A_, 4 - note B_, 4 + A_ 4 + B_ 4 octave 4 - note C#, 4 + C# 4 octave 3 - note B_, 4 - note G#, 6 + B_ 4 + G# 6 notetype 12, 11, 2 - note B_, 2 + B_ 2 notetype 12, 11, 6 - note G#, 6 + G# 6 notetype 12, 11, 2 - note B_, 2 + B_ 2 notetype 12, 11, 6 octave 4 - note E_, 6 + E_ 6 notetype 12, 11, 2 - note G#, 2 + G# 2 notetype 12, 11, 6 - note E_, 6 + E_ 6 notetype 12, 11, 2 - note G#, 2 + G# 2 notetype 12, 11, 6 octave 3 - note A_, 4 - note F#, 4 - note A_, 4 - note B_, 4 - note F#, 4 - note G#, 4 - note A_, 2 - note G#, 2 - note F#, 2 - note D#, 2 + A_ 4 + F# 4 + A_ 4 + B_ 4 + F# 4 + G# 4 + A_ 2 + G# 2 + F# 2 + D# 2 notetype 12, 11, 3 - note B_, 2 - octave 4 - note E_, 4 - note E_, 4 - note E_, 4 - note E_, 2 - note C#, 2 - note F#, 4 - note F#, 3 - note D#, 1 - note F#, 2 - note F#, 8 + B_ 2 + octave 4 + E_ 4 + E_ 4 + E_ 4 + E_ 2 + C# 2 + F# 4 + F# 3 + D# 1 + F# 2 + F# 8 notetype 12, 11, 6 - note F#, 1 - note F_, 1 - note F#, 8 + F# 1 + F_ 1 + F# 8 octave 3 - note B_, 1 - note A#, 1 - note B_, 8 + B_ 1 + A# 1 + B_ 8 octave 4 - note F#, 1 - note F_, 1 - note F#, 2 + F# 1 + F_ 1 + F# 2 notetype 12, 11, 3 - note F#, 1 - note E_, 1 - note D#, 1 - note C#, 1 + F# 1 + E_ 1 + D# 1 + C# 1 notetype 12, 11, 2 octave 3 - note B_, 16 + B_ 16 endchannel -Music_YellowIntro_Ch2: ; 7f6d3 (1f:76d3) +Music_YellowIntro_Ch2:: ; 7f6d3 (1f:76d3) duty 2 vibrato 6, 1, 5 notetype 12, 12, 2 octave 3 - note B_, 2 - octave 4 - note E_, 4 - note E_, 4 - note E_, 4 - note E_, 4 - note E_, 4 - note E_, 3 - note D#, 1 - note E_, 2 - note E_, 4 + B_ 2 + octave 4 + E_ 4 + E_ 4 + E_ 4 + E_ 4 + E_ 4 + E_ 3 + D# 1 + E_ 2 + E_ 4 notetype 12, 12, 5 - note G#, 1 - note G_, 1 - note G#, 10 + G# 1 + G_ 1 + G# 10 octave 3 - note B_, 1 - note A#, 1 - note B_, 6 + B_ 1 + A# 1 + B_ 6 notetype 12, 12, 7 octave 4 - note E_, 4 - note G#, 4 - note B_, 4 + E_ 4 + G# 4 + B_ 4 octave 5 - note C#, 16 + C# 16 octave 4 - note A_, 4 - note G#, 4 - note F#, 4 - note E_, 4 + A_ 4 + G# 4 + F# 4 + E_ 4 octave 3 - note B_, 6 + B_ 6 notetype 12, 12, 2 octave 4 - note E_, 2 + E_ 2 notetype 12, 12, 7 octave 3 - note B_, 6 + B_ 6 notetype 12, 12, 2 octave 4 - note E_, 2 + E_ 2 notetype 12, 12, 7 - note G#, 6 + G# 6 notetype 12, 12, 2 - note B_, 2 + B_ 2 notetype 12, 12, 7 - note G#, 6 + G# 6 notetype 12, 12, 2 - note B_, 2 + B_ 2 notetype 12, 12, 7 - note C#, 4 + C# 4 octave 3 - note A_, 4 - octave 4 - note C#, 4 - note D#, 4 - note E_, 2 - note D#, 2 - note C#, 2 - note D#, 4 - note D#, 2 - note C#, 2 + A_ 4 + octave 4 + C# 4 + D# 4 + E_ 2 + D# 2 + C# 2 + D# 4 + D# 2 + C# 2 octave 3 - note B_, 2 + B_ 2 notetype 12, 12, 3 octave 4 - note E_, 2 - note G#, 4 - note G#, 4 - note G#, 4 - note G#, 2 - note F#, 2 - note A_, 4 - note A_, 3 - note F#, 1 - note A_, 2 - note A_, 4 + E_ 2 + G# 4 + G# 4 + G# 4 + G# 2 + F# 2 + A_ 4 + A_ 3 + F# 1 + A_ 2 + A_ 4 notetype 12, 12, 7 - note B_, 1 - note A#, 1 - note B_, 8 - note B_, 1 - note A#, 1 - note B_, 8 - note B_, 1 - note A#, 1 - note B_, 6 + B_ 1 + A# 1 + B_ 8 + B_ 1 + A# 1 + B_ 8 + B_ 1 + A# 1 + B_ 6 notetype 12, 12, 3 - note B_, 1 - note A_, 1 - note G#, 1 - note F#, 1 + B_ 1 + A_ 1 + G# 1 + F# 1 notetype 12, 12, 2 - note E_, 16 + E_ 16 endchannel -Music_YellowIntro_Ch3: ; 7f749 (1f:7749) +Music_YellowIntro_Ch3:: ; 7f749 (1f:7749) notetype 12, 1, 0 octave 4 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 1 octave 3 - note B_, 1 + B_ 1 rest 1 octave 4 - note C#, 1 + C# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note F#, 1 + F# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note C#, 1 + C# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note B_, 1 + B_ 1 rest 1 octave 5 - note E_, 1 + E_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 octave 5 - note E_, 1 + E_ 1 rest 1 octave 4 - note B_, 1 + B_ 1 rest 1 octave 5 - note E_, 1 + E_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 octave 5 - note E_, 1 + E_ 1 rest 1 octave 4 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 1 octave 4 - note B_, 1 + B_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note G#, 1 + G# 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note A_, 1 + A_ 1 rest 1 octave 5 - note E_, 1 + E_ 1 rest 1 octave 4 - note E_, 1 + E_ 1 rest 1 octave 5 - note E_, 1 + E_ 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 octave 5 - note E_, 1 + E_ 1 rest 1 octave 4 - note E_, 1 + E_ 1 rest 1 octave 5 - note E_, 1 + E_ 1 rest 1 octave 4 - note A_, 1 + A_ 1 rest 1 octave 5 - note F#, 1 + F# 1 rest 1 octave 4 - note F#, 1 + F# 1 rest 1 octave 5 - note C#, 1 + C# 1 rest 3 - note F#, 1 + F# 1 rest 1 octave 4 - note F#, 1 - note G#, 1 - note A_, 1 + F# 1 + G# 1 + A_ 1 octave 5 - note C#, 1 - note E_, 1 + C# 1 + E_ 1 rest 15 endchannel -; 0x7f860
\ No newline at end of file +; 0x7f860 diff --git a/audio/music/yellow/yellowunusedsong.asm b/audio/music/yellow/yellowunusedsong.asm index 9c5c0aa6..e8c2a7ba 100644 --- a/audio/music/yellow/yellowunusedsong.asm +++ b/audio/music/yellow/yellowunusedsong.asm @@ -1,51 +1,51 @@ -Music_YellowUnusedSong_Ch1: ; 82fbe (20:6fbe) - tempo 0, 140 - stereopanning 119 +Music_YellowUnusedSong_Ch1:: ; 82fbe (20:6fbe) + tempo 140 + volume 7, 7 duty 3 vibrato 8, 1, 4 notetype 8, 11, 2 octave 3 - note A_, 6 - note A_, 2 - note A_, 2 - note A_, 2 - note A#, 6 - note A#, 6 - note G_, 6 - note G_, 6 - note A_, 6 - note E_, 6 - note A_, 6 - note A_, 2 - note A_, 2 - note A_, 2 - note A#, 6 - note A#, 6 - note A_, 6 - note G_, 6 - note A_, 12 + A_ 6 + A_ 2 + A_ 2 + A_ 2 + A# 6 + A# 6 + G_ 6 + G_ 6 + A_ 6 + E_ 6 + A_ 6 + A_ 2 + A_ 2 + A_ 2 + A# 6 + A# 6 + A_ 6 + G_ 6 + A_ 12 -Music_YellowUnusedSong_branch_82fde: - note A_, 6 - note A_, 2 - note A_, 2 - note A_, 2 - note A#, 6 - note A#, 6 - note G_, 6 - note G_, 6 - note A_, 6 - note E_, 6 - note A_, 6 - note A_, 2 - note A_, 2 - note A_, 2 - note A#, 6 - note A#, 6 - note G_, 6 +Music_YellowUnusedSong_branch_82fde:: + A_ 6 + A_ 2 + A_ 2 + A_ 2 + A# 6 + A# 6 + G_ 6 + G_ 6 + A_ 6 + E_ 6 + A_ 6 + A_ 2 + A_ 2 + A_ 2 + A# 6 + A# 6 + G_ 6 octave 4 - note D#, 6 - note D_, 12 + D# 6 + D_ 12 rest 16 rest 16 rest 16 @@ -53,275 +53,275 @@ Music_YellowUnusedSong_branch_82fde: rest 16 rest 16 octave 3 - note A_, 6 - note A_, 2 - note A_, 2 - note A_, 2 - note A#, 6 - note A#, 6 - note G_, 6 - note G_, 6 - note A_, 6 - note E_, 6 - note A_, 6 - note A_, 2 - note A_, 2 - note A_, 2 - note A#, 6 - note A#, 6 - note A_, 6 - note G_, 6 - note A_, 12 + A_ 6 + A_ 2 + A_ 2 + A_ 2 + A# 6 + A# 6 + G_ 6 + G_ 6 + A_ 6 + E_ 6 + A_ 6 + A_ 2 + A_ 2 + A_ 2 + A# 6 + A# 6 + A_ 6 + G_ 6 + A_ 12 loopchannel 0, Music_YellowUnusedSong_branch_82fde -Music_YellowUnusedSong_Ch2: ; 83010 (20:7010) +Music_YellowUnusedSong_Ch2:: ; 83010 (20:7010) duty 2 notetype 8, 12, 2 octave 4 - note D_, 6 - note D_, 2 - note D_, 2 - note D_, 2 - note D#, 6 - note D#, 6 - note C_, 6 - note C_, 6 - note D_, 6 + D_ 6 + D_ 2 + D_ 2 + D_ 2 + D# 6 + D# 6 + C_ 6 + C_ 6 + D_ 6 octave 3 - note A_, 6 + A_ 6 octave 4 - note D_, 6 - note D_, 2 - note D_, 2 - note D_, 2 - note D#, 6 - note D#, 6 - note D_, 6 - note A#, 6 - note A_, 12 + D_ 6 + D_ 2 + D_ 2 + D_ 2 + D# 6 + D# 6 + D_ 6 + A# 6 + A_ 12 -Music_YellowUnusedSong_branch_8302a: - note D_, 6 - note D_, 2 - note D_, 2 - note D_, 2 - note D#, 6 - note D#, 6 - note C_, 6 - note C_, 6 - note D_, 6 +Music_YellowUnusedSong_branch_8302a:: + D_ 6 + D_ 2 + D_ 2 + D_ 2 + D# 6 + D# 6 + C_ 6 + C_ 6 + D_ 6 octave 3 - note A_, 6 + A_ 6 octave 4 - note D_, 6 - note D_, 2 - note D_, 2 - note D_, 2 - note D#, 6 - note D#, 6 - note C_, 6 - note G#, 6 - note G_, 12 + D_ 6 + D_ 2 + D_ 2 + D_ 2 + D# 6 + D# 6 + C_ 6 + G# 6 + G_ 12 notetype 8, 9, 0 octave 3 - note D#, 16 - note D#, 8 - note D#, 16 - note D#, 8 + D# 16 + D# 8 + D# 16 + D# 8 octave 2 - note A#, 16 - note A#, 8 + A# 16 + A# 8 octave 3 - note D#, 12 - note F_, 12 + D# 12 + F_ 12 notetype 8, 12, 2 octave 4 - note D_, 6 - note D_, 2 - note D_, 2 - note D_, 2 - note D#, 6 - note D#, 6 - note C_, 6 - note C_, 6 - note D_, 6 + D_ 6 + D_ 2 + D_ 2 + D_ 2 + D# 6 + D# 6 + C_ 6 + C_ 6 + D_ 6 octave 3 - note A_, 6 + A_ 6 octave 4 - note D_, 6 - note D_, 2 - note D_, 2 - note D_, 2 - note D#, 6 - note D#, 6 - note D_, 6 - note A#, 6 - note A_, 12 + D_ 6 + D_ 2 + D_ 2 + D_ 2 + D# 6 + D# 6 + D_ 6 + A# 6 + A_ 12 loopchannel 0, Music_YellowUnusedSong_branch_8302a -Music_YellowUnusedSong_Ch3: ; 83068 (20:7068) +Music_YellowUnusedSong_Ch3:: ; 83068 (20:7068) notetype 12, 1, 0 vibrato 2, 1, 5 rest 16 rest 12 octave 4 - note C_, 4 - note D_, 8 - note D#, 8 - note G_, 8 - note A#, 8 + C_ 4 + D_ 8 + D# 8 + G_ 8 + A# 8 -Music_YellowUnusedSong_branch_83075: - note A_, 8 - note A#, 8 - note G_, 8 - note A_, 4 - note D_, 4 - note A_, 8 - note A#, 8 +Music_YellowUnusedSong_branch_83075:: + A_ 8 + A# 8 + G_ 8 + A_ 4 + D_ 4 + A_ 8 + A# 8 octave 5 - note C#, 8 - note D_, 8 - note D#, 16 - note D#, 16 + C# 8 + D_ 8 + D# 16 + D# 16 octave 4 - note A#, 16 + A# 16 octave 5 - note D#, 8 - note F_, 8 + D# 8 + F_ 8 octave 4 - note D_, 16 - note D_, 16 + D_ 16 + D_ 16 octave 4 - note D_, 8 - note D#, 8 - note G_, 8 - note A#, 8 + D_ 8 + D# 8 + G_ 8 + A# 8 loopchannel 0, Music_YellowUnusedSong_branch_83075 -Music_YellowUnusedSong_Ch4: ; 83092 (20:7092) +Music_YellowUnusedSong_Ch4:: ; 83092 (20:7092) dspeed 12 - dnote 4, snare3 + snare3 4 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 + snare3 2 + snare3 2 + snare3 2 dspeed 12 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 + snare3 4 + snare3 4 + snare3 4 + snare3 4 + snare3 4 + snare3 4 + snare3 4 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 + snare3 2 + snare3 2 + snare3 2 dspeed 12 - dnote 4, snare3 - dnote 4, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 4, snare3 - dnote 4, snare3 + snare3 4 + snare3 4 + snare3 2 + snare3 2 + snare3 2 + snare3 2 + snare3 4 + snare3 4 -Music_YellowUnusedSong_branch_830c3: - dnote 4, snare3 +Music_YellowUnusedSong_branch_830c3:: + snare3 4 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 + snare3 2 + snare3 2 + snare3 2 dspeed 12 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 + snare3 4 + snare3 4 + snare3 4 + snare3 4 + snare3 4 + snare3 4 + snare3 4 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 + snare3 2 + snare3 2 + snare3 2 dspeed 12 - dnote 4, snare3 - dnote 4, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 + snare3 4 + snare3 4 + snare3 2 + snare3 2 + snare3 2 + snare3 2 + snare3 4 + snare3 4 + snare3 4 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 + snare3 2 + snare3 2 + snare3 2 dspeed 12 - dnote 4, snare3 + snare3 4 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 + snare3 2 + snare3 2 + snare3 2 dspeed 12 - dnote 4, snare3 + snare3 4 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 + snare3 2 + snare3 2 + snare3 2 + snare3 2 + snare3 2 + snare3 2 + snare3 2 + snare3 2 + snare3 2 dspeed 12 - dnote 4, snare3 + snare3 4 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 + snare3 2 + snare3 2 + snare3 2 dspeed 12 - dnote 4, snare3 - dnote 4, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 4, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 4, snare3 + snare3 4 + snare3 4 + snare3 2 + snare3 2 + snare3 2 + snare3 2 + snare3 4 + snare3 2 + snare3 2 + snare3 4 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 + snare3 2 + snare3 2 + snare3 2 dspeed 12 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 - dnote 4, snare3 + snare3 4 + snare3 4 + snare3 4 + snare3 4 + snare3 4 + snare3 4 + snare3 4 dspeed 8 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 + snare3 2 + snare3 2 + snare3 2 dspeed 12 - dnote 4, snare3 - dnote 4, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 2, snare3 - dnote 4, snare3 - dnote 4, snare3 + snare3 4 + snare3 4 + snare3 2 + snare3 2 + snare3 2 + snare3 2 + snare3 4 + snare3 4 loopchannel 0, Music_YellowUnusedSong_branch_830c3 -; 0x8316d
\ No newline at end of file +; 0x8316d diff --git a/audio/sfx/sfx_02_3a.asm b/audio/sfx/sfx_02_3a.asm index 35808c35..1844b2ab 100644 --- a/audio/sfx/sfx_02_3a.asm +++ b/audio/sfx/sfx_02_3a.asm @@ -1,18 +1,18 @@ SFX_02_3a_Ch1: ; ad77 (2:6d77) executemusic - tempo 1, 0 - stereopanning 119 + tempo 256 + volume 7, 7 vibrato 6, 2, 6 duty 2 - togglecall + toggleperfectpitch notetype 4, 11, 1 octave 3 - note G#, 2 - note G#, 2 - note G#, 2 + G# 2 + G# 2 + G# 2 notetype 12, 11, 3 octave 4 - note E_, 4 + E_ 4 endchannel @@ -22,11 +22,11 @@ SFX_02_3a_Ch2: ; ad8e (2:6d8e) duty 2 notetype 4, 12, 1 octave 4 - note E_, 2 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 + E_ 2 notetype 12, 12, 3 - note B_, 4 + B_ 4 endchannel @@ -34,15 +34,15 @@ SFX_02_3a_Ch3: ; ad9e (2:6d9e) executemusic notetype 4, 1, 0 octave 4 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 notetype 12, 1, 0 octave 4 - note B_, 2 + B_ 2 rest 2 endchannel ; 0xadae
\ No newline at end of file diff --git a/audio/sfx/sfx_02_3b.asm b/audio/sfx/sfx_02_3b.asm index 538f2462..9c59d670 100644 --- a/audio/sfx/sfx_02_3b.asm +++ b/audio/sfx/sfx_02_3b.asm @@ -1,27 +1,27 @@ SFX_02_3b_Ch1: ; b316 (2:7316) executemusic - tempo 1, 0 - stereopanning 119 + tempo 256 + volume 7, 7 duty 2 - togglecall + toggleperfectpitch notetype 5, 11, 4 octave 4 - note D_, 4 - note C_, 4 + D_ 4 + C_ 4 octave 3 - note A_, 8 + A_ 8 notetype 5, 11, 2 octave 4 - note D#, 2 - note D#, 2 - note D_, 2 - note C_, 2 - note C_, 2 + D# 2 + D# 2 + D_ 2 + C_ 2 + C_ 2 octave 3 - note A#, 2 + A# 2 notetype 5, 11, 4 octave 4 - note C_, 8 + C_ 8 endchannel @@ -31,18 +31,18 @@ SFX_02_3b_Ch2: ; b335 (2:7335) duty 2 notetype 5, 12, 5 octave 4 - note A_, 4 - note F_, 4 - note C_, 8 + A_ 4 + F_ 4 + C_ 8 notetype 5, 12, 2 - note A#, 2 - note A#, 2 - note A#, 2 - note G_, 2 - note G_, 2 - note A#, 2 + A# 2 + A# 2 + A# 2 + G_ 2 + G_ 2 + A# 2 notetype 5, 12, 4 - note A_, 8 + A_ 8 endchannel @@ -50,21 +50,21 @@ SFX_02_3b_Ch3: ; b34d (2:734d) executemusic notetype 5, 1, 0 octave 5 - note F_, 4 - note D#, 4 - note C_, 8 - note D#, 1 + F_ 4 + D# 4 + C_ 8 + D# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note A_, 8 + A_ 8 endchannel ; 0xb362
\ No newline at end of file diff --git a/audio/sfx/sfx_02_41.asm b/audio/sfx/sfx_02_41.asm index 4ba0eb14..de5be1c7 100644 --- a/audio/sfx/sfx_02_41.asm +++ b/audio/sfx/sfx_02_41.asm @@ -1,23 +1,23 @@ SFX_02_41_Ch1: ; b2c8 (2:72c8) executemusic - tempo 1, 0 - stereopanning 119 + tempo 256 + volume 7, 7 duty 2 notetype 5, 11, 1 octave 3 - note A_, 2 - note A_, 2 - note G_, 2 - note G_, 2 - note F_, 2 - note E_, 2 - note F_, 2 - note A_, 2 + A_ 2 + A_ 2 + G_ 2 + G_ 2 + F_ 2 + E_ 2 + F_ 2 + A_ 2 octave 4 - note C_, 4 - note E_, 4 + C_ 4 + E_ 4 octave 3 - note F_, 4 + F_ 4 endchannel @@ -26,21 +26,21 @@ SFX_02_41_Ch2: ; b2e1 (2:72e1) duty 2 notetype 5, 12, 2 octave 5 - note F_, 2 - note E_, 1 + F_ 2 + E_ 1 rest 1 - note D_, 2 - note C_, 1 + D_ 2 + C_ 1 rest 1 octave 4 - note A#, 2 + A# 2 octave 5 - note C_, 2 - note D_, 2 - note E_, 2 - note F_, 4 - note G_, 4 - note F_, 4 + C_ 2 + D_ 2 + E_ 2 + F_ 4 + G_ 4 + F_ 4 endchannel @@ -48,31 +48,31 @@ SFX_02_41_Ch3: ; b2f7 (2:72f7) executemusic notetype 5, 1, 0 octave 5 - note C_, 1 + C_ 1 rest 1 octave 4 - note F_, 2 + F_ 2 octave 5 - note C_, 1 + C_ 1 rest 1 octave 4 - note A#, 1 + A# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 octave 5 - note F_, 1 + F_ 1 rest 3 - note C_, 1 + C_ 1 rest 3 octave 4 - note F_, 2 + F_ 2 rest 2 endchannel ; 0xb316
\ No newline at end of file diff --git a/audio/sfx/sfx_02_42.asm b/audio/sfx/sfx_02_42.asm index e9112a02..5dfcb574 100644 --- a/audio/sfx/sfx_02_42.asm +++ b/audio/sfx/sfx_02_42.asm @@ -1,25 +1,25 @@ SFX_02_42_Ch1: ; b362 (2:7362) executemusic - tempo 1, 0 - stereopanning 119 + tempo 256 + volume 7, 7 duty 2 - togglecall + toggleperfectpitch notetype 5, 10, 4 octave 3 - note A#, 4 + A# 4 notetype 5, 11, 1 octave 4 - note C_, 2 - note C_, 1 - note C_, 1 + C_ 2 + C_ 1 + C_ 1 notetype 5, 10, 4 - note D#, 4 + D# 4 notetype 5, 11, 1 - note F_, 2 - note F_, 1 - note F_, 1 + F_ 2 + F_ 1 + F_ 1 notetype 5, 11, 4 - note A#, 8 + A# 8 endchannel @@ -29,21 +29,21 @@ SFX_02_42_Ch2: ; b381 (2:7381) duty 2 notetype 5, 13, 1 octave 4 - note G_, 2 - note G_, 1 - note G_, 1 + G_ 2 + G_ 1 + G_ 1 notetype 5, 12, 4 - note D#, 4 + D# 4 notetype 5, 13, 1 - note G#, 2 - note G#, 1 - note G#, 1 - note A#, 2 - note A#, 1 - note A#, 1 + G# 2 + G# 1 + G# 1 + A# 2 + A# 1 + A# 1 notetype 5, 12, 4 octave 5 - note D#, 8 + D# 8 endchannel @@ -51,10 +51,10 @@ SFX_02_42_Ch3: ; b39d (2:739d) executemusic notetype 5, 1, 0 octave 4 - note D#, 4 - note G#, 4 - note G_, 4 - note F_, 4 - note D#, 8 + D# 4 + G# 4 + G_ 4 + F_ 4 + D# 8 endchannel ; 0xb3a7
\ No newline at end of file diff --git a/audio/sfx/sfx_02_5e.asm b/audio/sfx/sfx_02_5e.asm index ad47ebf0..ade4d200 100644 --- a/audio/sfx/sfx_02_5e.asm +++ b/audio/sfx/sfx_02_5e.asm @@ -2,21 +2,21 @@ SFX_02_5e_Ch1: ; 83ca (2:43ca) vibrato 16, 1, 4 notetype 12, 1, 0 octave 5 - note E_, 2 - note F_, 2 - note G_, 4 - note A_, 2 - note G_, 2 + E_ 2 + F_ 2 + G_ 4 + A_ 2 + G_ 2 octave 6 - note C_, 4 - note C_, 2 - note D_, 2 - note C_, 2 + C_ 4 + C_ 2 + D_ 2 + C_ 2 octave 5 - note G_, 2 - note A_, 2 - note F_, 2 - note G_, 8 + G_ 2 + A_ 2 + F_ 2 + G_ 8 rest 12 endchannel ; 0x83e1
\ No newline at end of file diff --git a/audio/sfx/sfx_08_3a.asm b/audio/sfx/sfx_08_3a.asm index b7791942..24cb206c 100644 --- a/audio/sfx/sfx_08_3a.asm +++ b/audio/sfx/sfx_08_3a.asm @@ -1,22 +1,22 @@ SFX_08_3a_Ch1: ; 2397d (8:797d) executemusic - tempo 1, 0 - stereopanning 119 + tempo 256 + volume 7, 7 duty 2 - togglecall + toggleperfectpitch notetype 6, 11, 4 octave 4 - note F_, 4 + F_ 4 notetype 4, 11, 2 - note C_, 2 - note F_, 2 - note C_, 2 + C_ 2 + F_ 2 + C_ 2 notetype 6, 11, 3 - note D#, 2 - note D#, 2 - note E_, 2 + D# 2 + D# 2 + E_ 2 notetype 6, 11, 4 - note F_, 8 + F_ 8 endchannel @@ -26,17 +26,17 @@ SFX_08_3a_Ch2: ; 23998 (8:7998) duty 2 notetype 6, 12, 4 octave 4 - note A_, 4 + A_ 4 notetype 4, 12, 2 - note A_, 2 - note A_, 2 - note A_, 2 + A_ 2 + A_ 2 + A_ 2 notetype 6, 12, 4 - note A#, 2 - note A#, 2 - note A#, 2 + A# 2 + A# 2 + A# 2 notetype 6, 12, 4 - note A_, 8 + A_ 8 endchannel @@ -44,21 +44,21 @@ SFX_08_3a_Ch3: ; 239b0 (8:79b0) executemusic notetype 6, 1, 0 octave 5 - note A_, 4 + A_ 4 notetype 4, 1, 0 - note F_, 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 notetype 6, 1, 0 - note G_, 1 + G_ 1 rest 1 - note D#, 1 + D# 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note A_, 8 + A_ 8 endchannel ; 0x239c7
\ No newline at end of file diff --git a/audio/sfx/sfx_08_3b.asm b/audio/sfx/sfx_08_3b.asm index cd123b01..910cf9dc 100644 --- a/audio/sfx/sfx_08_3b.asm +++ b/audio/sfx/sfx_08_3b.asm @@ -1,27 +1,27 @@ SFX_08_3b_Ch1: ; 239c7 (8:79c7) executemusic - tempo 1, 0 - stereopanning 119 + tempo 256 + volume 7, 7 duty 2 - togglecall + toggleperfectpitch notetype 5, 11, 4 octave 4 - note D_, 4 - note C_, 4 + D_ 4 + C_ 4 octave 3 - note A_, 8 + A_ 8 notetype 5, 11, 2 octave 4 - note D#, 2 - note D#, 2 - note D_, 2 - note C_, 2 - note C_, 2 + D# 2 + D# 2 + D_ 2 + C_ 2 + C_ 2 octave 3 - note A#, 2 + A# 2 notetype 5, 11, 4 octave 4 - note C_, 8 + C_ 8 endchannel @@ -31,18 +31,18 @@ SFX_08_3b_Ch2: ; 239e6 (8:79e6) duty 2 notetype 5, 12, 5 octave 4 - note A_, 4 - note F_, 4 - note C_, 8 + A_ 4 + F_ 4 + C_ 8 notetype 5, 12, 2 - note A#, 2 - note A#, 2 - note A#, 2 - note G_, 2 - note G_, 2 - note A#, 2 + A# 2 + A# 2 + A# 2 + G_ 2 + G_ 2 + A# 2 notetype 5, 12, 4 - note A_, 8 + A_ 8 endchannel @@ -50,21 +50,21 @@ SFX_08_3b_Ch3: ; 239fe (8:79fe) executemusic notetype 5, 1, 0 octave 5 - note F_, 4 - note D#, 4 - note C_, 8 - note D#, 1 + F_ 4 + D# 4 + C_ 8 + D# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note A_, 8 + A_ 8 endchannel ; 0x23a13
\ No newline at end of file diff --git a/audio/sfx/sfx_08_46.asm b/audio/sfx/sfx_08_46.asm index 5f2b9d33..b1d35eb1 100644 --- a/audio/sfx/sfx_08_46.asm +++ b/audio/sfx/sfx_08_46.asm @@ -1,24 +1,24 @@ SFX_08_46_Ch1: ; 23a13 (8:7a13) executemusic - tempo 1, 0 - stereopanning 119 + tempo 256 + volume 7, 7 duty 3 - togglecall + toggleperfectpitch notetype 6, 11, 2 octave 3 - note E_, 2 - note F#, 2 - note G#, 2 - note G#, 1 - note G#, 1 - note B_, 2 + E_ 2 + F# 2 + G# 2 + G# 1 + G# 1 + B_ 2 octave 4 - note C#, 2 - note D#, 2 - note D#, 1 - note D#, 1 + C# 2 + D# 2 + D# 1 + D# 1 notetype 6, 11, 5 - note E_, 8 + E_ 8 endchannel @@ -27,20 +27,20 @@ SFX_08_46_Ch2: ; 23a2e (8:7a2e) duty 2 notetype 6, 12, 2 octave 4 - note G#, 2 - note G#, 1 - note G#, 1 - note E_, 2 - note E_, 1 - note E_, 1 - note B_, 2 - note B_, 1 - note B_, 1 - note A_, 2 - note A_, 1 - note A_, 1 + G# 2 + G# 1 + G# 1 + E_ 2 + E_ 1 + E_ 1 + B_ 2 + B_ 1 + B_ 1 + A_ 2 + A_ 1 + A_ 1 notetype 6, 12, 5 - note G#, 8 + G# 8 endchannel @@ -48,15 +48,15 @@ SFX_08_46_Ch3: ; 23a44 (8:7a44) executemusic notetype 6, 1, 0 octave 4 - note B_, 2 + B_ 2 rest 2 octave 5 - note C#, 2 + C# 2 rest 2 - note D#, 2 + D# 2 rest 2 - note F#, 2 - note G_, 2 - note G#, 4 + F# 2 + G_ 2 + G# 4 endchannel ; 0x23a53
\ No newline at end of file diff --git a/audio/sfx/sfx_08_75.asm b/audio/sfx/sfx_08_75.asm index 39990ae3..0a25cb45 100644 --- a/audio/sfx/sfx_08_75.asm +++ b/audio/sfx/sfx_08_75.asm @@ -4,12 +4,12 @@ SFX_08_75_Ch1: ; 208e0 (8:48e0) duty 2 notetype 10, 8, 7 octave 5 - note G#, 8 + G# 8 octave 6 - note F#, 4 - note E_, 4 + F# 4 + E_ 4 octave 5 - note G#, 8 + G# 8 endchannel @@ -19,12 +19,12 @@ SFX_08_75_Ch2: ; 208f0 (8:48f0) duty 2 notetype 11, 6, 7 octave 5 - note G#, 8 + G# 8 notetype 10, 6, 7 octave 6 - note F#, 4 - note E_, 4 + F# 4 + E_ 4 octave 5 - note G#, 8 + G# 8 endchannel ; 0x20902
\ No newline at end of file diff --git a/audio/sfx/sfx_08_pokeflute.asm b/audio/sfx/sfx_08_pokeflute.asm index 3160f87c..103e2d56 100755 --- a/audio/sfx/sfx_08_pokeflute.asm +++ b/audio/sfx/sfx_08_pokeflute.asm @@ -1,5 +1,5 @@ SFX_08_PokeFlute_Ch1: ; 22322 (8:6322) - tempo 1, 0 + tempo 256 SFX_08_PokeFlute_Ch2: ; 22325 (8:6325) diff --git a/audio/sfx/sfx_08_pokeflute_ch3.asm b/audio/sfx/sfx_08_pokeflute_ch3.asm index 28f1dfd7..cf3f32a7 100755 --- a/audio/sfx/sfx_08_pokeflute_ch3.asm +++ b/audio/sfx/sfx_08_pokeflute_ch3.asm @@ -3,12 +3,12 @@ SFX_08_PokeFlute_Ch3: ; 2049b (8:449b) vibrato 16, 1, 4 notetype 8, 1, 0 octave 5 - note E_, 3 - note F_, 3 - note G_, 7 - note A_, 3 - note G_, 3 + E_ 3 + F_ 3 + G_ 7 + A_ 3 + G_ 3 octave 6 - note C_, 13 + C_ 13 endchannel ; 0x204aa
\ No newline at end of file diff --git a/audio/sfx/sfx_08_unused2.asm b/audio/sfx/sfx_08_unused2.asm index be887476..0bfe4dd3 100755 --- a/audio/sfx/sfx_08_unused2.asm +++ b/audio/sfx/sfx_08_unused2.asm @@ -1,19 +1,19 @@ SFX_08_unused2_Ch1: ; 2232f (8:632f) executemusic - tempo 1, 0 - stereopanning 119 + tempo 256 + volume 7, 7 vibrato 6, 2, 6 duty 2 - togglecall + toggleperfectpitch notetype 6, 11, 1 octave 3 - note G#, 2 - note G#, 2 + G# 2 + G# 2 notetype 6, 11, 3 - note G#, 2 - note B_, 2 + G# 2 + B_ 2 octave 4 - note E_, 8 + E_ 8 endchannel @@ -23,13 +23,13 @@ SFX_08_unused2_Ch2: ; 22347 (8:6347) duty 2 notetype 6, 12, 1 octave 4 - note E_, 2 - note E_, 1 - note E_, 1 + E_ 2 + E_ 1 + E_ 1 notetype 6, 12, 3 - note E_, 2 - note G#, 2 - note B_, 8 + E_ 2 + G# 2 + B_ 8 endchannel @@ -37,21 +37,21 @@ SFX_08_unused2_Ch3: ; 22359 (8:6359) executemusic notetype 6, 1, 0 octave 4 - note B_, 1 + B_ 1 rest 1 notetype 3, 1, 0 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 notetype 6, 1, 0 - note B_, 1 + B_ 1 rest 1 octave 5 - note E_, 1 + E_ 1 rest 1 octave 4 - note B_, 4 + B_ 4 rest 4 endchannel ; 0x22370
\ No newline at end of file diff --git a/audio/sfx/sfx_1f_3a.asm b/audio/sfx/sfx_1f_3a.asm index 2f7f3045..1d92127e 100644 --- a/audio/sfx/sfx_1f_3a.asm +++ b/audio/sfx/sfx_1f_3a.asm @@ -1,18 +1,18 @@ SFX_1f_3a_Ch1: ; 7e850 (1f:6850) executemusic - tempo 1, 0 - stereopanning 119 + tempo 256 + volume 7, 7 vibrato 6, 2, 6 duty 2 - togglecall + toggleperfectpitch notetype 4, 11, 1 octave 3 - note G#, 2 - note G#, 2 - note G#, 2 + G# 2 + G# 2 + G# 2 notetype 12, 11, 3 octave 4 - note E_, 4 + E_ 4 endchannel @@ -22,11 +22,11 @@ SFX_1f_3a_Ch2: ; 7e867 (1f:6867) duty 2 notetype 4, 12, 1 octave 4 - note E_, 2 - note E_, 2 - note E_, 2 + E_ 2 + E_ 2 + E_ 2 notetype 12, 12, 3 - note B_, 4 + B_ 4 endchannel @@ -34,15 +34,15 @@ SFX_1f_3a_Ch3: ; 7e877 (1f:6877) executemusic notetype 4, 1, 0 octave 4 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 - note B_, 1 + B_ 1 rest 1 notetype 12, 1, 0 octave 4 - note B_, 2 + B_ 2 rest 2 endchannel ; 0x7e887
\ No newline at end of file diff --git a/audio/sfx/sfx_1f_3b.asm b/audio/sfx/sfx_1f_3b.asm index a167d4cf..3ce00c8a 100644 --- a/audio/sfx/sfx_1f_3b.asm +++ b/audio/sfx/sfx_1f_3b.asm @@ -1,27 +1,27 @@ SFX_1f_3b_Ch1: ; 7ee28 (1f:6e28) executemusic - tempo 1, 0 - stereopanning 119 + tempo 256 + volume 7, 7 duty 2 - togglecall + toggleperfectpitch notetype 5, 11, 4 octave 4 - note D_, 4 - note C_, 4 + D_ 4 + C_ 4 octave 3 - note A_, 8 + A_ 8 notetype 5, 11, 2 octave 4 - note D#, 2 - note D#, 2 - note D_, 2 - note C_, 2 - note C_, 2 + D# 2 + D# 2 + D_ 2 + C_ 2 + C_ 2 octave 3 - note A#, 2 + A# 2 notetype 5, 11, 4 octave 4 - note C_, 8 + C_ 8 endchannel @@ -31,18 +31,18 @@ SFX_1f_3b_Ch2: ; 7ee47 (1f:6e47) duty 2 notetype 5, 12, 5 octave 4 - note A_, 4 - note F_, 4 - note C_, 8 + A_ 4 + F_ 4 + C_ 8 notetype 5, 12, 2 - note A#, 2 - note A#, 2 - note A#, 2 - note G_, 2 - note G_, 2 - note A#, 2 + A# 2 + A# 2 + A# 2 + G_ 2 + G_ 2 + A# 2 notetype 5, 12, 4 - note A_, 8 + A_ 8 endchannel @@ -50,21 +50,21 @@ SFX_1f_3b_Ch3: ; 7ee5f (1f:6e5f) executemusic notetype 5, 1, 0 octave 5 - note F_, 4 - note D#, 4 - note C_, 8 - note D#, 1 + F_ 4 + D# 4 + C_ 8 + D# 1 rest 1 - note D#, 1 + D# 1 rest 1 - note E_, 1 + E_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note A_, 8 + A_ 8 endchannel ; 0x7ee74
\ No newline at end of file diff --git a/audio/sfx/sfx_1f_41.asm b/audio/sfx/sfx_1f_41.asm index 62153990..6f854c74 100644 --- a/audio/sfx/sfx_1f_41.asm +++ b/audio/sfx/sfx_1f_41.asm @@ -1,23 +1,23 @@ SFX_1f_41_Ch1: ; 7edda (1f:6dda) executemusic - tempo 1, 0 - stereopanning 119 + tempo 256 + volume 7, 7 duty 2 notetype 5, 11, 1 octave 3 - note A_, 2 - note A_, 2 - note G_, 2 - note G_, 2 - note F_, 2 - note E_, 2 - note F_, 2 - note A_, 2 + A_ 2 + A_ 2 + G_ 2 + G_ 2 + F_ 2 + E_ 2 + F_ 2 + A_ 2 octave 4 - note C_, 4 - note E_, 4 + C_ 4 + E_ 4 octave 3 - note F_, 4 + F_ 4 endchannel @@ -26,21 +26,21 @@ SFX_1f_41_Ch2: ; 7edf3 (1f:6df3) duty 2 notetype 5, 12, 2 octave 5 - note F_, 2 - note E_, 1 + F_ 2 + E_ 1 rest 1 - note D_, 2 - note C_, 1 + D_ 2 + C_ 1 rest 1 octave 4 - note A#, 2 + A# 2 octave 5 - note C_, 2 - note D_, 2 - note E_, 2 - note F_, 4 - note G_, 4 - note F_, 4 + C_ 2 + D_ 2 + E_ 2 + F_ 4 + G_ 4 + F_ 4 endchannel @@ -48,31 +48,31 @@ SFX_1f_41_Ch3: ; 7ee09 (1f:6e09) executemusic notetype 5, 1, 0 octave 5 - note C_, 1 + C_ 1 rest 1 octave 4 - note F_, 2 + F_ 2 octave 5 - note C_, 1 + C_ 1 rest 1 octave 4 - note A#, 1 + A# 1 rest 1 - note A_, 1 + A_ 1 rest 1 - note G_, 1 + G_ 1 rest 1 - note F_, 1 + F_ 1 rest 1 - note E_, 1 + E_ 1 rest 1 octave 5 - note F_, 1 + F_ 1 rest 3 - note C_, 1 + C_ 1 rest 3 octave 4 - note F_, 2 + F_ 2 rest 2 endchannel ; 0x7ee28
\ No newline at end of file diff --git a/audio/sfx/sfx_1f_42.asm b/audio/sfx/sfx_1f_42.asm index c0805196..6c8c388a 100644 --- a/audio/sfx/sfx_1f_42.asm +++ b/audio/sfx/sfx_1f_42.asm @@ -1,25 +1,25 @@ SFX_1f_42_Ch1: ; 7ee74 (1f:6e74) executemusic - tempo 1, 0 - stereopanning 119 + tempo 256 + volume 7, 7 duty 2 - togglecall + toggleperfectpitch notetype 5, 10, 4 octave 3 - note A#, 4 + A# 4 notetype 5, 11, 1 octave 4 - note C_, 2 - note C_, 1 - note C_, 1 + C_ 2 + C_ 1 + C_ 1 notetype 5, 10, 4 - note D#, 4 + D# 4 notetype 5, 11, 1 - note F_, 2 - note F_, 1 - note F_, 1 + F_ 2 + F_ 1 + F_ 1 notetype 5, 11, 4 - note A#, 8 + A# 8 endchannel @@ -29,21 +29,21 @@ SFX_1f_42_Ch2: ; 7ee93 (1f:6e93) duty 2 notetype 5, 13, 1 octave 4 - note G_, 2 - note G_, 1 - note G_, 1 + G_ 2 + G_ 1 + G_ 1 notetype 5, 12, 4 - note D#, 4 + D# 4 notetype 5, 13, 1 - note G#, 2 - note G#, 1 - note G#, 1 - note A#, 2 - note A#, 1 - note A#, 1 + G# 2 + G# 1 + G# 1 + A# 2 + A# 1 + A# 1 notetype 5, 12, 4 octave 5 - note D#, 8 + D# 8 endchannel @@ -51,10 +51,10 @@ SFX_1f_42_Ch3: ; 7eeaf (1f:6eaf) executemusic notetype 5, 1, 0 octave 4 - note D#, 4 - note G#, 4 - note G_, 4 - note F_, 4 - note D#, 8 + D# 4 + G# 4 + G_ 4 + F_ 4 + D# 8 endchannel ; 0x7eeb9
\ No newline at end of file diff --git a/audio/duty_1.asm b/audio/wave_instruments.asm index 2c650ac1..fede06af 100644 --- a/audio/duty_1.asm +++ b/audio/wave_instruments.asm @@ -1,33 +1,32 @@ -Music2_Channel3DutyPointers: ; 0x8361 - dw Music2_Channel3Duty0 - dw Music2_Channel3Duty1 - dw Music2_Channel3Duty2 - dw Music2_Channel3Duty3 - dw Music2_Channel3Duty4 - dw Music2_Channel3Duty5 ; used in the Lavender Town theme - dw Music2_Channel3Duty5 ; unused - dw Music2_Channel3Duty5 ; unused - dw Music2_Channel3Duty5 ; unused + dw .wave0 + dw .wave1 + dw .wave2 + dw .wave3 + dw .wave4 + dw .wave5 ; used in the Lavender Town and Pokemon Tower themes + dw .wave5 ; unused + dw .wave5 ; unused + dw .wave5 ; unused ; these are the definitions for the channel 3 instruments ; each instrument definition is made up of 32 points (nibbles) that form ; the graph of the wave ; the current instrument is copied to $FF30 -Music2_Channel3Duty0: ; 0x8373 +.wave0 db $02,$46,$8A,$CE,$FF,$FE,$ED,$DC,$CB,$A9,$87,$65,$44,$33,$22,$11 -Music2_Channel3Duty1: ; 0x8383 +.wave1 db $02,$46,$8A,$CE,$EF,$FF,$FE,$EE,$DD,$CB,$A9,$87,$65,$43,$22,$11 -Music2_Channel3Duty2: ; 0x8393 +.wave2 db $13,$69,$BD,$EE,$EE,$FF,$FF,$ED,$DE,$FF,$FF,$EE,$EE,$DB,$96,$31 -Music2_Channel3Duty3: ; 0x83a3 +.wave3 db $02,$46,$8A,$CD,$EF,$FE,$DE,$FF,$EE,$DC,$BA,$98,$76,$54,$32,$10 -Music2_Channel3Duty4: ; 0x83b3 +.wave4 db $01,$23,$45,$67,$8A,$CD,$EE,$F7,$7F,$EE,$DC,$A8,$76,$54,$32,$10 ; duty 5 reads from sfx data -Music2_Channel3Duty5: ; 0x83c3 +.wave5 diff --git a/audio_blue.asm b/blue/audio.asm index 53e37a2d..53e37a2d 100644 --- a/audio_blue.asm +++ b/blue/audio.asm diff --git a/pokeblue.asm b/blue/main.asm index 3fcef980..3fcef980 100644 --- a/pokeblue.asm +++ b/blue/main.asm diff --git a/blue/text.asm b/blue/text.asm new file mode 100644 index 00000000..ec6d7203 --- /dev/null +++ b/blue/text.asm @@ -0,0 +1,2 @@ +INCLUDE "blue.asm" +INCLUDE "text.asm" diff --git a/blue/wram.asm b/blue/wram.asm new file mode 100644 index 00000000..70292177 --- /dev/null +++ b/blue/wram.asm @@ -0,0 +1,2 @@ +INCLUDE "blue.asm" +INCLUDE "wram.asm" diff --git a/constants.asm b/constants.asm index 7c51afcf..b427e3c7 100644 --- a/constants.asm +++ b/constants.asm @@ -3,9 +3,11 @@ INCLUDE "version.asm" INCLUDE "macros.asm" INCLUDE "hram.asm" +INCLUDE "vram.asm" INCLUDE "constants/hardware_constants.asm" INCLUDE "constants/oam_constants.asm" +INCLUDE "constants/misc_constants.asm" INCLUDE "constants/wram_constants.asm" diff --git a/constants/hardware_constants.asm b/constants/hardware_constants.asm index de9d2311..8e926a11 100755..100644 --- a/constants/hardware_constants.asm +++ b/constants/hardware_constants.asm @@ -1,21 +1,117 @@ -; hardware registers, from the pandocs http://nocash.emubase.de/pandocs.htm
-rJOYP EQU $FF00
-rDIV EQU $FF04
-rLCDC EQU $FF40
-rSCY EQU $FF42
-rSCX EQU $FF43
-rBGP EQU $FF47
-rOBP0 EQU $FF48
-rOBP1 EQU $FF49
-rWY EQU $FF4A
-rWX EQU $FF4B
-rIE EQU $FFFF
-
-BTN_A EQU %00000001
-BTN_B EQU %00000010
-BTN_SELECT EQU %00000100
-BTN_START EQU %00001000
-BTN_RIGHT EQU %00010000
-BTN_LEFT EQU %00100000
-BTN_UP EQU %01000000
-BTN_DOWN EQU %10000000
\ No newline at end of file +; From http://nocash.emubase.de/pandocs.htm. + +GBC EQU $11 + +; MBC3 +MBC3SRamEnable EQU $0000 +MBC3RomBank EQU $2000 +MBC3SRamBank EQU $4000 +MBC3LatchClock EQU $6000 +MBC3RTC EQU $a000 + +SRAM_DISABLE EQU $00 +SRAM_ENABLE EQU $0a + +NUM_SRAM_BANKS EQU 4 + +RTC_S EQU $08 ; Seconds 0-59 (0-3Bh) +RTC_M EQU $09 ; Minutes 0-59 (0-3Bh) +RTC_H EQU $0a ; Hours 0-23 (0-17h) +RTC_DL EQU $0b ; Lower 8 bits of Day Counter (0-FFh) +RTC_DH EQU $0c ; Upper 1 bit of Day Counter, Carry Bit, Halt Flag + ; Bit 0 Most significant bit of Day Counter (Bit 8) + ; Bit 6 Halt (0=Active, 1=Stop Timer) + ; Bit 7 Day Counter Carry Bit (1=Counter Overflow) + +; interrupt flags +VBLANK EQU 0 +LCD_STAT EQU 1 +TIMER EQU 2 +SERIAL EQU 3 +JOYPAD EQU 4 + +LY_VBLANK EQU 145 + +; OAM attribute flags +OAM_PALETTE EQU %111 +OAM_TILE_BANK EQU 3 +OAM_OBP_NUM EQU 4 ; Non CGB Mode Only +OAM_X_FLIP EQU 5 +OAM_Y_FLIP EQU 6 +OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3) + + +; Hardware registers +rJOYP EQU $ff00 ; Joypad (R/W) +rSB EQU $ff01 ; Serial transfer data (R/W) +rSC EQU $ff02 ; Serial Transfer Control (R/W) +rSC_ON EQU 7 +rSC_CGB EQU 1 +rSC_CLOCK EQU 0 +rDIV EQU $ff04 ; Divider Register (R/W) +rTIMA EQU $ff05 ; Timer counter (R/W) +rTMA EQU $ff06 ; Timer Modulo (R/W) +rTAC EQU $ff07 ; Timer Control (R/W) +rTAC_ON EQU 2 +rTAC_4096_HZ EQU 0 +rTAC_262144_HZ EQU 1 +rTAC_65536_HZ EQU 2 +rTAC_16384_HZ EQU 3 +rIF EQU $ff0f ; Interrupt Flag (R/W) +rNR10 EQU $ff10 ; Channel 1 Sweep register (R/W) +rNR11 EQU $ff11 ; Channel 1 Sound length/Wave pattern duty (R/W) +rNR12 EQU $ff12 ; Channel 1 Volume Envelope (R/W) +rNR13 EQU $ff13 ; Channel 1 Frequency lo (Write Only) +rNR14 EQU $ff14 ; Channel 1 Frequency hi (R/W) +rNR21 EQU $ff16 ; Channel 2 Sound Length/Wave Pattern Duty (R/W) +rNR22 EQU $ff17 ; Channel 2 Volume Envelope (R/W) +rNR23 EQU $ff18 ; Channel 2 Frequency lo data (W) +rNR24 EQU $ff19 ; Channel 2 Frequency hi data (R/W) +rNR30 EQU $ff1a ; Channel 3 Sound on/off (R/W) +rNR31 EQU $ff1b ; Channel 3 Sound Length +rNR32 EQU $ff1c ; Channel 3 Select output level (R/W) +rNR33 EQU $ff1d ; Channel 3 Frequency's lower data (W) +rNR34 EQU $ff1e ; Channel 3 Frequency's higher data (R/W) +rNR41 EQU $ff20 ; Channel 4 Sound Length (R/W) +rNR42 EQU $ff21 ; Channel 4 Volume Envelope (R/W) +rNR43 EQU $ff22 ; Channel 4 Polynomial Counter (R/W) +rNR44 EQU $ff23 ; Channel 4 Counter/consecutive; Inital (R/W) +rNR50 EQU $ff24 ; Channel control / ON-OFF / Volume (R/W) +rNR51 EQU $ff25 ; Selection of Sound output terminal (R/W) +rNR52 EQU $ff26 ; Sound on/off +rLCDC EQU $ff40 ; LCD Control (R/W) +rLCDC_ENABLE EQU 7 +rLCDC_ENABLE_MASK EQU 1 << rLCDC_ENABLE +rSTAT EQU $ff41 ; LCDC Status (R/W) +rSCY EQU $ff42 ; Scroll Y (R/W) +rSCX EQU $ff43 ; Scroll X (R/W) +rLY EQU $ff44 ; LCDC Y-Coordinate (R) +rLYC EQU $ff45 ; LY Compare (R/W) +rDMA EQU $ff46 ; DMA Transfer and Start Address (W) +rBGP EQU $ff47 ; BG Palette Data (R/W) - Non CGB Mode Only +rOBP0 EQU $ff48 ; Object Palette 0 Data (R/W) - Non CGB Mode Only +rOBP1 EQU $ff49 ; Object Palette 1 Data (R/W) - Non CGB Mode Only +rWY EQU $ff4a ; Window Y Position (R/W) +rWX EQU $ff4b ; Window X Position minus 7 (R/W) +rKEY1 EQU $ff4d ; CGB Mode Only - Prepare Speed Switch +rVBK EQU $ff4f ; CGB Mode Only - VRAM Bank +rHDMA1 EQU $ff51 ; CGB Mode Only - New DMA Source, High +rHDMA2 EQU $ff52 ; CGB Mode Only - New DMA Source, Low +rHDMA3 EQU $ff53 ; CGB Mode Only - New DMA Destination, High +rHDMA4 EQU $ff54 ; CGB Mode Only - New DMA Destination, Low +rHDMA5 EQU $ff55 ; CGB Mode Only - New DMA Length/Mode/Start +rRP EQU $ff56 ; CGB Mode Only - Infrared Communications Port +rBGPI EQU $ff68 ; CGB Mode Only - Background Palette Index +rBGPD EQU $ff69 ; CGB Mode Only - Background Palette Data +rOBPI EQU $ff6a ; CGB Mode Only - Sprite Palette Index +rOBPD EQU $ff6b ; CGB Mode Only - Sprite Palette Data +rUNKNOWN1 EQU $ff6c ; (FEh) Bit 0 (Read/Write) - CGB Mode Only +rSVBK EQU $ff70 ; CGB Mode Only - WRAM Bank +rUNKNOWN2 EQU $ff72 ; (00h) - Bit 0-7 (Read/Write) +rUNKNOWN3 EQU $ff73 ; (00h) - Bit 0-7 (Read/Write) +rUNKNOWN4 EQU $ff74 ; (00h) - Bit 0-7 (Read/Write) - CGB Mode Only +rUNKNOWN5 EQU $ff75 ; (8Fh) - Bit 4-6 (Read/Write) +rUNKNOWN6 EQU $ff76 ; (00h) - Always 00h (Read Only) +rUNKNOWN7 EQU $ff77 ; (00h) - Always 00h (Read Only) +rIE EQU $ffff ; Interrupt Enable (R/W) + diff --git a/constants/misc_constants.asm b/constants/misc_constants.asm new file mode 100644 index 00000000..29f15035 --- /dev/null +++ b/constants/misc_constants.asm @@ -0,0 +1,20 @@ +A_BUTTON EQU %00000001 +B_BUTTON EQU %00000010 +SELECT EQU %00000100 +START EQU %00001000 +D_RIGHT EQU %00010000 +D_LEFT EQU %00100000 +D_UP EQU %01000000 +D_DOWN EQU %10000000 + +MAX_LEVEL EQU 100 +NUM_MOVES EQU 4 + +PARTY_LENGTH EQU 6 + +MONS_PER_BOX EQU 20 +NUM_BOXES EQU 12 + +HOF_MON EQU $10 +HOF_TEAM EQU PARTY_LENGTH * HOF_MON +NUM_HOF_TEAMS EQU 50 diff --git a/constants/move_animation_constants.asm b/constants/move_animation_constants.asm index 71051541..018c094b 100644 --- a/constants/move_animation_constants.asm +++ b/constants/move_animation_constants.asm @@ -1,4 +1,4 @@ -; subanimations +; subanimations ; special effects, prefaced with "SE" for "Special Effect" diff --git a/constants/move_constants.asm b/constants/move_constants.asm index 9fdb1ce7..816bd115 100644 --- a/constants/move_constants.asm +++ b/constants/move_constants.asm @@ -1,4 +1,4 @@ -NUM_MOVES EQU $A4 +NUM_ATTACKS EQU $A4 POUND EQU $01 KARATE_CHOP EQU $02 diff --git a/constants/pokedex_constants.asm b/constants/pokedex_constants.asm index c9ba6ae8..c8fa56e3 100644 --- a/constants/pokedex_constants.asm +++ b/constants/pokedex_constants.asm @@ -148,4 +148,6 @@ DEX_DRATINI EQU 147 DEX_DRAGONAIR EQU 148 DEX_DRAGONITE EQU 149 DEX_MEWTWO EQU 150 -DEX_MEW EQU 151
\ No newline at end of file +DEX_MEW EQU 151 + +NUM_POKEMON EQU 151 diff --git a/constants/pokemon_constants.asm b/constants/pokemon_constants.asm index af74e8f4..2ed03338 100644 --- a/constants/pokemon_constants.asm +++ b/constants/pokemon_constants.asm @@ -28,6 +28,8 @@ STARYU EQU $1B BLASTOISE EQU $1C PINSIR EQU $1D TANGELA EQU $1E + + GROWLITHE EQU $21 ONIX EQU $22 FEAROW EQU $23 @@ -45,17 +47,26 @@ PARASECT EQU $2E PSYDUCK EQU $2F DROWZEE EQU $30 GOLEM EQU $31 + MAGMAR EQU $33 + ELECTABUZZ EQU $35 MAGNETON EQU $36 KOFFING EQU $37 + MANKEY EQU $39 SEEL EQU $3A DIGLETT EQU $3B TAUROS EQU $3C + + + FARFETCH_D EQU $40 VENONAT EQU $41 DRAGONITE EQU $42 + + + DODUO EQU $46 POLIWAG EQU $47 JYNX EQU $48 @@ -65,16 +76,23 @@ ZAPDOS EQU $4B DITTO EQU $4C MEOWTH EQU $4D KRABBY EQU $4E + + + VULPIX EQU $52 NINETALES EQU $53 PIKACHU EQU $54 RAICHU EQU $55 + + DRATINI EQU $58 DRAGONAIR EQU $59 KABUTO EQU $5A KABUTOPS EQU $5B HORSEA EQU $5C SEADRA EQU $5D + + SANDSHREW EQU $60 SANDSLASH EQU $61 OMANYTE EQU $62 @@ -94,29 +112,38 @@ POLIWRATH EQU $6F WEEDLE EQU $70 KAKUNA EQU $71 BEEDRILL EQU $72 + DODRIO EQU $74 PRIMEAPE EQU $75 DUGTRIO EQU $76 VENOMOTH EQU $77 DEWGONG EQU $78 + + CATERPIE EQU $7B METAPOD EQU $7C BUTTERFREE EQU $7D MACHAMP EQU $7E + GOLDUCK EQU $80 HYPNO EQU $81 GOLBAT EQU $82 MEWTWO EQU $83 SNORLAX EQU $84 MAGIKARP EQU $85 + + MUK EQU $88 + KINGLER EQU $8A CLOYSTER EQU $8B + ELECTRODE EQU $8D CLEFABLE EQU $8E WEEZING EQU $8F PERSIAN EQU $90 MAROWAK EQU $91 + HAUNTER EQU $93 ABRA EQU $94 ALAKAZAM EQU $95 @@ -126,8 +153,13 @@ STARMIE EQU $98 BULBASAUR EQU $99 VENUSAUR EQU $9A TENTACRUEL EQU $9B + GOLDEEN EQU $9D SEAKING EQU $9E + + + + PONYTA EQU $A3 RAPIDASH EQU $A4 RATTATA EQU $A5 @@ -137,12 +169,16 @@ NIDORINA EQU $A8 GEODUDE EQU $A9 PORYGON EQU $AA AERODACTYL EQU $AB + MAGNEMITE EQU $AD + + CHARMANDER EQU $B0 SQUIRTLE EQU $B1 CHARMELEON EQU $B2 WARTORTLE EQU $B3 CHARIZARD EQU $B4 + FOSSIL_KABUTOPS EQU $B6 FOSSIL_AERODACTYL EQU $B7 MON_GHOST EQU $B8 @@ -151,4 +187,4 @@ GLOOM EQU $BA VILEPLUME EQU $BB BELLSPROUT EQU $BC WEEPINBELL EQU $BD -VICTREEBEL EQU $BE
\ No newline at end of file +VICTREEBEL EQU $BE diff --git a/constants/wram_constants.asm b/constants/wram_constants.asm index 51c5c604..e06ca2ce 100644 --- a/constants/wram_constants.asm +++ b/constants/wram_constants.asm @@ -1,10 +1,14 @@ SPRITEBUFFERSIZE EQU 7*7 * 8 ; 7 * 7 (tiles) * 8 (bytes per tile) +; Overload W_GRASSMONS +wd893 EQU $d893 ; W_GRASSMONS + 11 +wd896 EQU $d896 ; W_GRASSMONS + 14 + ; Overload enemy party data -W_WATERRATE EQU $d8a4 -W_WATERMONS EQU $d8a5 +W_WATERRATE EQU $d8a4 ; wEnemyMon1Species +W_WATERMONS EQU $d8a5 ; wEnemyMon1Species + 1 ; Overload enemy stat modifiers -wTradeMonNick EQU $cd1e +wTradeMonNick EQU $cd1e ; wPlayerMonAccuracyMod diff --git a/data/collision.asm b/data/collision.asm new file mode 100644 index 00000000..78579242 --- /dev/null +++ b/data/collision.asm @@ -0,0 +1,24 @@ +Underground_Coll:: INCBIN "gfx/tilesets/underground.tilecoll" +Overworld_Coll:: INCBIN "gfx/tilesets/overworld.tilecoll" +RedsHouse1_Coll:: +RedsHouse2_Coll:: INCBIN "gfx/tilesets/reds_house.tilecoll" +Mart_Coll:: +Pokecenter_Coll:: INCBIN "gfx/tilesets/pokecenter.tilecoll" +Dojo_Coll:: +Gym_Coll:: INCBIN "gfx/tilesets/gym.tilecoll" +Forest_Coll:: INCBIN "gfx/tilesets/forest.tilecoll" +House_Coll:: INCBIN "gfx/tilesets/house.tilecoll" +ForestGate_Coll:: +Museum_Coll:: +Gate_Coll:: INCBIN "gfx/tilesets/gate.tilecoll" +Ship_Coll:: INCBIN "gfx/tilesets/ship.tilecoll" +ShipPort_Coll:: INCBIN "gfx/tilesets/ship_port.tilecoll" +Cemetery_Coll:: INCBIN "gfx/tilesets/cemetery.tilecoll" +Interior_Coll:: INCBIN "gfx/tilesets/interior.tilecoll" +Cavern_Coll:: INCBIN "gfx/tilesets/cavern.tilecoll" +Lobby_Coll:: INCBIN "gfx/tilesets/lobby.tilecoll" +Mansion_Coll:: INCBIN "gfx/tilesets/mansion.tilecoll" +Lab_Coll:: INCBIN "gfx/tilesets/lab.tilecoll" +Club_Coll:: INCBIN "gfx/tilesets/club.tilecoll" +Facility_Coll:: INCBIN "gfx/tilesets/facility.tilecoll" +Plateau_Coll:: INCBIN "gfx/tilesets/plateau.tilecoll" diff --git a/data/facing.asm b/data/facing.asm new file mode 100644 index 00000000..6906002e --- /dev/null +++ b/data/facing.asm @@ -0,0 +1,57 @@ +SpriteFacingAndAnimationTable: ; 4000 (1:4000) + dw SpriteFacingDownAndStanding, SpriteOAMParameters ; facing down, walk animation frame 0 + dw SpriteFacingDownAndWalking, SpriteOAMParameters ; facing down, walk animation frame 1 + dw SpriteFacingDownAndStanding, SpriteOAMParameters ; facing down, walk animation frame 2 + dw SpriteFacingDownAndWalking, SpriteOAMParametersFlipped ; facing down, walk animation frame 3 + dw SpriteFacingUpAndStanding, SpriteOAMParameters ; facing up, walk animation frame 0 + dw SpriteFacingUpAndWalking, SpriteOAMParameters ; facing up, walk animation frame 1 + dw SpriteFacingUpAndStanding, SpriteOAMParameters ; facing up, walk animation frame 2 + dw SpriteFacingUpAndWalking, SpriteOAMParametersFlipped ; facing up, walk animation frame 3 + dw SpriteFacingLeftAndStanding, SpriteOAMParameters ; facing left, walk animation frame 0 + dw SpriteFacingLeftAndWalking, SpriteOAMParameters ; facing left, walk animation frame 1 + dw SpriteFacingLeftAndStanding, SpriteOAMParameters ; facing left, walk animation frame 2 + dw SpriteFacingLeftAndWalking, SpriteOAMParameters ; facing left, walk animation frame 3 + dw SpriteFacingLeftAndStanding, SpriteOAMParametersFlipped ; facing right, walk animation frame 0 + dw SpriteFacingLeftAndWalking, SpriteOAMParametersFlipped ; facing right, walk animation frame 1 + dw SpriteFacingLeftAndStanding, SpriteOAMParametersFlipped ; facing right, walk animation frame 2 + dw SpriteFacingLeftAndWalking, SpriteOAMParametersFlipped ; facing right, walk animation frame 3 + dw SpriteFacingDownAndStanding, SpriteOAMParameters ; --- + dw SpriteFacingDownAndStanding, SpriteOAMParameters ; This table is used for sprites $a and $b. + dw SpriteFacingDownAndStanding, SpriteOAMParameters ; All orientation and animation parameters + dw SpriteFacingDownAndStanding, SpriteOAMParameters ; lead to the same result. Used for immobile + dw SpriteFacingDownAndStanding, SpriteOAMParameters ; sprites like items on the ground + dw SpriteFacingDownAndStanding, SpriteOAMParameters ; --- + dw SpriteFacingDownAndStanding, SpriteOAMParameters + dw SpriteFacingDownAndStanding, SpriteOAMParameters + dw SpriteFacingDownAndStanding, SpriteOAMParameters + dw SpriteFacingDownAndStanding, SpriteOAMParameters + dw SpriteFacingDownAndStanding, SpriteOAMParameters + dw SpriteFacingDownAndStanding, SpriteOAMParameters + dw SpriteFacingDownAndStanding, SpriteOAMParameters + dw SpriteFacingDownAndStanding, SpriteOAMParameters + dw SpriteFacingDownAndStanding, SpriteOAMParameters + dw SpriteFacingDownAndStanding, SpriteOAMParameters + +SpriteFacingDownAndStanding: ; 4080 (1:4080) + db $00,$01,$02,$03 +SpriteFacingDownAndWalking: ; 4084 (1:4084) + db $80,$81,$82,$83 +SpriteFacingUpAndStanding: ; 4088 (1:4088) + db $04,$05,$06,$07 +SpriteFacingUpAndWalking: ; 408c (1:408c) + db $84,$85,$86,$87 +SpriteFacingLeftAndStanding: ; 4090 (1:4090) + db $08,$09,$0a,$0b +SpriteFacingLeftAndWalking: ; 4094 (1:4094) + db $88,$89,$8a,$8b + +SpriteOAMParameters: ; 4098 (1:4098) + db $00,$00, $00 ; top left + db $00,$08, $00 ; top right + db $08,$00, OAMFLAG_CANBEMASKED ; bottom left + db $08,$08, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right +SpriteOAMParametersFlipped: ; 40a4 (1:40a4) + db $00,$08, OAMFLAG_VFLIPPED + db $00,$00, OAMFLAG_VFLIPPED + db $08,$08, OAMFLAG_VFLIPPED | OAMFLAG_CANBEMASKED + db $08,$00, OAMFLAG_VFLIPPED | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA diff --git a/data/hide_show_data.asm b/data/hide_show_data.asm index 11a5cf5a..c8d89102 100755 --- a/data/hide_show_data.asm +++ b/data/hide_show_data.asm @@ -263,7 +263,7 @@ MapHSPointers: ; c8f5 (3:48f5) ; a) Map_ID = $FF ; b) Map_ID ≠ currentMapID ; -; This Data is loaded into RAM at $D5CE-$D5F?. (W_MISSABLEOBJECTLIST) +; This Data is loaded into RAM at wd5ce-$D5F?. (W_MISSABLEOBJECTLIST) ; These constants come from the bytes for Predef functions: Hide equ $11 diff --git a/data/sgb_border.asm b/data/sgb_border.asm index 716a991e..5a0bbb2d 100755 --- a/data/sgb_border.asm +++ b/data/sgb_border.asm @@ -55,8 +55,8 @@ ENDC SGBBorderGraphics: ; 72fe8 (1c:6fe8) IF _RED - INCBIN "gfx/red/sgbborder.w128.2bpp" + INCBIN "gfx/red/sgbborder.2bpp" ENDC IF _BLUE - INCBIN "gfx/blue/sgbborder.w128.2bpp" + INCBIN "gfx/blue/sgbborder.2bpp" ENDC diff --git a/data/sgb_packets.asm b/data/sgb_packets.asm index 92bea812..3e5e3f0b 100755 --- a/data/sgb_packets.asm +++ b/data/sgb_packets.asm @@ -1,142 +1,298 @@ +ATTR_BLK: MACRO +; This is a command macro. +; Use ATTR_BLK_DATA for data sets. + db ($4 << 3) + ((\1 * 6) / 16 + 1) + db \1 +ENDM +ATTR_BLK_DATA: MACRO + db \1 ; which regions are affected + db \2 + (\3 << 2) + (\4 << 4) ; palette for each region + db \5, \6, \7, \8 ; x1, y1, x2, y2 +ENDM + +PAL_SET: MACRO + db ($a << 3) + 1 + dw \1, \2, \3, \4 + ds 7 +ENDM + +PAL_TRN: MACRO + db ($b<< 3) + 1 + ds 15 +ENDM + +MLT_REQ: MACRO + db ($11 << 3) + 1 + db \1 - 1 + ds 14 +ENDM + +CHR_TRN: MACRO + db ($13 << 3) + 1 + db \1 + (\2 << 1) + ds 14 +ENDM + +PCT_TRN: MACRO + db ($14 << 3) + 1 + ds 15 +ENDM + +MASK_EN: MACRO + db ($17 << 3) + 1 + db \1 + ds 14 +ENDM + +DATA_SND: MACRO + db ($f << 3) + 1 + dw \1 ; address + db \2 ; bank + db \3 ; length (1-11) +ENDM + BlkPacket_WholeScreen: ; 7219e (1c:619e) - db $21,$01,$03,$00,$00,$00,$13,$11,$00,$00,$00,$00,$00,$00,$00,$00 + ATTR_BLK 1 + ATTR_BLK_DATA %011, 0,0,0, 00,00, 19,17 + ds 8 + db $03,$00,$00,$13,$11,$00,$00 BlkPacket_Battle: ; 721b5 (1c:61b5) - db $22,$05,$07,$0a,$00,$0c,$13,$11,$03,$05,$01,$00,$0a,$03,$03,$00 - db $0a,$07,$13,$0a,$03,$0a,$00,$04,$08,$0b,$03,$0f,$0b,$00,$13,$06 - db $03,$00,$00,$13,$0b,$00,$03,$00,$0c,$13,$11,$02,$03,$01,$00,$0a - db $03,$01,$03,$0a,$08,$13,$0a,$00,$03,$00,$04,$08,$0b,$02,$03,$0b - db $00,$13,$07,$03,$00 + ATTR_BLK 5 + ATTR_BLK_DATA %111, 2,2,0, 00,12, 19,17 + ATTR_BLK_DATA %011, 1,1,0, 01,00, 10,03 + ATTR_BLK_DATA %011, 0,0,0, 10,07, 19,10 + ATTR_BLK_DATA %011, 2,2,0, 00,04, 08,11 + ATTR_BLK_DATA %011, 3,3,0, 11,00, 19,06 + + db $03,$00,$00,$13,$0b,$00 + db $03,$00,$0c,$13,$11,$02 + db $03,$01,$00,$0a,$03,$01 + db $03,$0a,$08,$13,$0a,$00 + db $03,$00,$04,$08,$0b,$02 + db $03,$0b,$00,$13,$07,$03 + db $00 BlkPacket_StatusScreen: ; 721fa (1c:61fa) - db $21,$01,$07,$05,$01,$00,$07,$06,$00,$00,$00,$00,$00,$00,$00,$00 - db $02,$00,$00,$11,$00,$03,$01,$00,$07,$06,$01,$03,$01,$07,$13,$11 - db $00,$03,$08,$00,$13,$06,$00,$00 + ATTR_BLK 1 + ATTR_BLK_DATA %111, 1,1,0, 01,00, 07,06 + ds 8 + + db $02,$00,$00,$11,$00,$03 + db $01,$00,$07,$06,$01,$03 + db $01,$07,$13,$11,$00,$03 + db $08,$00,$13,$06,$00,$00 BlkPacket_Pokedex: ; 72222 (1c:6222) - db $21,$01,$07,$05,$01,$01,$08,$08,$00,$00,$00,$00,$00,$00,$00,$00 - db $02,$00,$00,$11,$00,$01,$00,$01,$13,$00,$03,$01,$01,$08,$08,$01 - db $03,$01,$09,$08,$11,$00,$03,$09,$01,$13,$11,$00,$00 + ATTR_BLK 1 + ATTR_BLK_DATA %111, 1,1,0, 01,01, 08,08 + ds 8 + + db $02,$00,$00,$11,$00,$01 + db $00,$01,$13,$00,$03,$01 + db $01,$08,$08,$01,$03,$01 + db $09,$08,$11,$00,$03,$09 + db $01,$13,$11,$00,$00 BlkPacket_Slots: ; 7224f (1c:624f) - db $22,$05,$03,$05,$00,$00,$13,$0b,$03,$0a,$00,$04,$13,$09,$02,$0f - db $00,$06,$13,$07,$03,$00,$04,$04,$0f,$09,$03,$00,$00,$0c,$13,$11 - db $03,$00,$00,$13,$0b,$01,$03,$00,$04,$13,$09,$02,$03,$00,$06,$13 - db $07,$03,$03,$04,$04,$0f,$09,$00,$03,$00,$0c,$13,$11,$00,$00 + ATTR_BLK 5 + ATTR_BLK_DATA %011, 1,1,0, 00,00, 19,11 + ATTR_BLK_DATA %011, 2,2,0, 00,04, 19,09 + ATTR_BLK_DATA %010, 3,3,0, 00,06, 19,07 + ATTR_BLK_DATA %011, 0,0,0, 04,04, 15,09 + ATTR_BLK_DATA %011, 0,0,0, 00,12, 19,17 + + db $03,$00,$00,$13,$0b,$01 + db $03,$00,$04,$13,$09,$02 + db $03,$00,$06,$13,$07,$03 + db $03,$04,$04,$0f,$09,$00 + db $03,$00,$0c,$13,$11,$00 + db $00 BlkPacket_Titlescreen: ; 7228e (1c:628e) - db $22,$03,$03,$00,$00,$00,$13,$07,$02,$05,$00,$08,$13,$09,$03,$0a - db $00,$0a,$13,$11,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - db $03,$00,$00,$13,$07,$00,$03,$00,$08,$13,$09,$01,$03,$00,$0a,$13 - db $11,$02,$00 + ATTR_BLK 3 + ATTR_BLK_DATA %011, 0,0,0, 00,00, 19,07 + ATTR_BLK_DATA %010, 1,1,0, 00,08, 19,09 + ATTR_BLK_DATA %011, 2,2,0, 00,10, 19,17 + ds 12 + + db $03,$00,$00,$13,$07,$00 + db $03,$00,$08,$13,$09,$01 + db $03,$00,$0a,$13,$11,$02 + db $00 BlkPacket_NidorinoIntro: ; 722c1 (1c:62c1) - db $22,$03,$03,$05,$00,$00,$13,$03,$03,$00,$00,$04,$13,$0d,$03,$05 - db $00,$0e,$13,$11,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - db $03,$00,$00,$13,$03,$01,$03,$00,$04,$13,$0d,$00,$03,$00,$0e,$13 - db $11,$01,$00 + ATTR_BLK 3 + ATTR_BLK_DATA %011, 1,1,0, 00,00, 19,03 + ATTR_BLK_DATA %011, 0,0,0, 00,04, 19,13 + ATTR_BLK_DATA %011, 1,1,0, 00,14, 19,17 + ds 12 + + db $03,$00,$00,$13,$03,$01 + db $03,$00,$04,$13,$0d,$00 + db $03,$00,$0e,$13,$11,$01 + db $00 BlkPacket_PartyMenu: ; 722f4 (1c:62f4) - db $23,$07,$06,$10,$01,$00,$02,$0c,$02,$00,$05,$01,$0b,$01,$02,$00 - db $05,$03,$0b,$03,$02,$00,$05,$05,$0b,$05,$02,$00,$05,$07,$0b,$07 - db $02,$00,$05,$09,$0b,$09,$02,$00,$05,$0b,$0b,$0b,$00,$00,$00,$00 - db $02,$00,$00,$11,$01,$03,$01,$00,$02,$0c,$00,$03,$01,$0d,$02,$11 - db $01,$03,$03,$00,$13,$11,$01,$03,$0c,$00,$12,$01,$00,$03,$0c,$02 - db $12,$03,$00,$03,$0c,$04,$12,$05,$00,$03,$0c,$06,$12,$07,$00,$03 - db $0c,$08,$12,$09,$00,$03,$0c,$0a,$12,$0b,$00,$00 + ATTR_BLK 7 + ATTR_BLK_DATA %110, 0,0,1, 01,00, 02,12 + ATTR_BLK_DATA %010, 0,0,0, 05,01, 11,01 + ATTR_BLK_DATA %010, 0,0,0, 05,03, 11,03 + ATTR_BLK_DATA %010, 0,0,0, 05,05, 11,05 + ATTR_BLK_DATA %010, 0,0,0, 05,07, 11,07 + ATTR_BLK_DATA %010, 0,0,0, 05,09, 11,09 + ATTR_BLK_DATA %010, 0,0,0, 05,11, 11,11 + ds 4 + + db $02,$00,$00,$11,$01,$03 + db $01,$00,$02,$0c,$00,$03 + db $01,$0d,$02,$11,$01,$03 + db $03,$00,$13,$11,$01,$03 + db $0c,$00,$12,$01,$00,$03 + db $0c,$02,$12,$03,$00,$03 + db $0c,$04,$12,$05,$00,$03 + db $0c,$06,$12,$07,$00,$03 + db $0c,$08,$12,$09,$00,$03 + db $0c,$0a,$12,$0b,$00,$00 BlkPacket_TrainerCard: ; 72360 (1c:6360) - db $24,$0a,$02,$00,$03,$0c,$04,$0d,$02,$05,$07,$0c,$08,$0d,$02,$0f - db $0b,$0c,$0c,$0d,$02,$0a,$10,$0b,$11,$0c,$02,$05,$0e,$0d,$0f,$0e - db $02,$0f,$10,$0d,$11,$0e,$02,$0a,$03,$0f,$04,$10,$02,$0f,$07,$0f - db $08,$10,$02,$0a,$0b,$0f,$0c,$10,$02,$05,$0f,$0f,$10,$10,$00,$00 - db $03,$03,$0c,$04,$0d,$00,$03,$07,$0c,$08,$0d,$01,$03,$0b,$0c,$0c - db $0d,$03,$03,$10,$0b,$11,$0c,$02,$03,$0e,$0d,$0f,$0e,$01,$03,$10 - db $0d,$11,$0e,$03,$03,$03,$0f,$04,$10,$02,$03,$07,$0f,$08,$10,$03 - db $03,$0b,$0f,$0c,$10,$02,$03,$0f,$0f,$10,$10,$01,$00 + ATTR_BLK 10 + ATTR_BLK_DATA %010, 0,0,0, 03,12, 04,13 + ATTR_BLK_DATA %010, 1,1,0, 07,12, 08,13 + ATTR_BLK_DATA %010, 3,3,0, 11,12, 12,13 + ATTR_BLK_DATA %010, 2,2,0, 16,11, 17,12 + ATTR_BLK_DATA %010, 1,1,0, 14,13, 15,14 + ATTR_BLK_DATA %010, 3,3,0, 16,13, 17,14 + ATTR_BLK_DATA %010, 2,2,0, 03,15, 04,16 + ATTR_BLK_DATA %010, 3,3,0, 07,15, 08,16 + ATTR_BLK_DATA %010, 2,2,0, 11,15, 12,16 + ATTR_BLK_DATA %010, 1,1,0, 15,15, 16,16 + ds 2 + + db $03,$03,$0c,$04,$0d,$00 + db $03,$07,$0c,$08,$0d,$01 + db $03,$0b,$0c,$0c,$0d,$03 + db $03,$10,$0b,$11,$0c,$02 + db $03,$0e,$0d,$0f,$0e,$01 + db $03,$10,$0d,$11,$0e,$03 + db $03,$03,$0f,$04,$10,$02 + db $03,$07,$0f,$08,$10,$03 + db $03,$0b,$0f,$0c,$10,$02 + db $03,$0f,$0f,$10,$10,$01 + db $00 BlkPacket_GameFreakIntro: ; 723dd (1c:63dd) - db $22,$03,$07,$05,$05,$0b,$07,$0d,$02,$0a,$08,$0b,$09,$0d,$03,$0f - db $0c,$0b,$0e,$0d,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - db $03,$00,$00,$13,$0a,$00,$03,$00,$0b,$04,$0d,$00,$03,$05,$0b,$07 - db $0d,$01,$03,$08,$0b,$13,$0d,$00,$03,$00,$0e,$13,$11,$00,$03,$08 - db $0b,$09,$0d,$02,$03,$0c,$0b,$0e,$0d,$03,$00 - -PalPacket_Empty: ; 72428 (1c:6428) - db $51,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_PartyMenu: ; 72438 (1c:6438) - db $51,PAL_MEWMON,$00,PAL_GREENBAR,$00,PAL_YELLOWBAR,$00,PAL_REDBAR,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_Black: ; 72448 (1c:6448) - db $51,PAL_BLACK,$00,PAL_BLACK,$00,PAL_BLACK,$00,PAL_BLACK,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_TownMap: ; 72458 (1c:6458) - db $51,PAL_TOWNMAP,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_Pokedex: ; 72468 (1c:6468) - db $51,PAL_BROWNMON,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_Slots: ; 72478 (1c:6478) - db $51,PAL_SLOTS1,$00,PAL_SLOTS2,$00,PAL_SLOTS3,$00,PAL_SLOTS4,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_Titlescreen: ; 72488 (1c:6488) - db $51,PAL_LOGO2,$00,PAL_LOGO1,$00,PAL_MEWMON,$00,PAL_PURPLEMON,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_TrainerCard: ; 72498 (1c:6498) - db $51,PAL_MEWMON,$00,PAL_BADGE,$00,PAL_REDMON,$00,PAL_YELLOWMON,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_Generic: ; 724a8 (1c:64a8) - db $51,PAL_MEWMON,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_NidorinoIntro: ; 724b8 (1c:64b8) - db $51,PAL_PURPLEMON,$00,PAL_BLACK,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_GameFreakIntro: ; 724c8 (1c:64c8) - db $51,PAL_GAMEFREAK,$00,PAL_REDMON,$00,PAL_VIRIDIAN,$00,PAL_BLUEMON,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_724d8: ; 724d8 (1c:64d8) - db $59,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_724e8: ; 724e8 (1c:64e8) - db $89,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_724f8: ; 724f8 (1c:64f8) - db $89,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_72508: ; 72508 (1c:6508) - db $99,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_72518: ; 72518 (1c:6518) - db $A1,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_72528: ; 72528 (1c:6528) - db $B9,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_72538: ; 72538 (1c:6538) - db $B9,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_72548: ; 72548 (1c:6548) - db $79,$5D,$08,$00,$0B,$8C,$D0,$F4,$60,$00,$00,$00,$00,$00,$00,$00 - -PalPacket_72558: ; 72558 (1c:6558) - db $79,$52,$08,$00,$0B,$A9,$E7,$9F,$01,$C0,$7E,$E8,$E8,$E8,$E8,$E0 - -PalPacket_72568: ; 72568 (1c:6568) - db $79,$47,$08,$00,$0B,$C4,$D0,$16,$A5,$CB,$C9,$05,$D0,$10,$A2,$28 - -PalPacket_72578: ; 72578 (1c:6578) - db $79,$3C,$08,$00,$0B,$F0,$12,$A5,$C9,$C9,$C8,$D0,$1C,$A5,$CA,$C9 - -PalPacket_72588: ; 72588 (1c:6588) - db $79,$31,$08,$00,$0B,$0C,$A5,$CA,$C9,$7E,$D0,$06,$A5,$CB,$C9,$7E - -PalPacket_72598: ; 72598 (1c:6598) - db $79,$26,$08,$00,$0B,$39,$CD,$48,$0C,$D0,$34,$A5,$C9,$C9,$80,$D0 - -PalPacket_725a8: ; 725a8 (1c:65a8) - db $79,$1B,$08,$00,$0B,$EA,$EA,$EA,$EA,$EA,$A9,$01,$CD,$4F,$0C,$D0 - -PalPacket_725b8: ; 725b8 (1c:65b8) - db $79,$10,$08,$00,$0B,$4C,$20,$08,$EA,$EA,$EA,$EA,$EA,$60,$EA,$EA + ATTR_BLK 3 + ATTR_BLK_DATA %111, 1,1,0, 05,11, 07,13 + ATTR_BLK_DATA %010, 2,2,0, 08,11, 09,13 + ATTR_BLK_DATA %011, 3,3,0, 12,11, 14,13 + ds 12 + + db $03,$00,$00,$13,$0a,$00 + db $03,$00,$0b,$04,$0d,$00 + db $03,$05,$0b,$07,$0d,$01 + db $03,$08,$0b,$13,$0d,$00 + db $03,$00,$0e,$13,$11,$00 + db $03,$08,$0b,$09,$0d,$02 + db $03,$0c,$0b,$0e,$0d,$03 + db $00 + + +PalPacket_Empty: PAL_SET 0, 0, 0, 0 +PalPacket_PartyMenu: PAL_SET PAL_MEWMON, PAL_GREENBAR, PAL_YELLOWBAR, PAL_REDBAR +PalPacket_Black: PAL_SET PAL_BLACK, PAL_BLACK, PAL_BLACK, PAL_BLACK +PalPacket_TownMap: PAL_SET PAL_TOWNMAP, 0, 0, 0 +PalPacket_Pokedex: PAL_SET PAL_BROWNMON, 0, 0, 0 +PalPacket_Slots: PAL_SET PAL_SLOTS1, PAL_SLOTS2, PAL_SLOTS3, PAL_SLOTS4 +PalPacket_Titlescreen: PAL_SET PAL_LOGO2, PAL_LOGO1, PAL_MEWMON, PAL_PURPLEMON +PalPacket_TrainerCard: PAL_SET PAL_MEWMON, PAL_BADGE, PAL_REDMON, PAL_YELLOWMON +PalPacket_Generic: PAL_SET PAL_MEWMON, 0, 0, 0 +PalPacket_NidorinoIntro: PAL_SET PAL_PURPLEMON, PAL_BLACK, 0, 0 +PalPacket_GameFreakIntro: PAL_SET PAL_GAMEFREAK, PAL_REDMON, PAL_VIRIDIAN, PAL_BLUEMON + +PalTrnPacket: PAL_TRN +MltReq1Packet: MLT_REQ 1 +MltReq2Packet: MLT_REQ 2 +ChrTrnPacket: CHR_TRN 0, 0 +PctTrnPacket: PCT_TRN + +MaskEnFreezePacket: MASK_EN 1 +MaskEnCancelPacket: MASK_EN 0 + + +; These are DATA_SND packets containing SNES code. +; This set of packets is found in several Japanese SGB-compatible titles. +; It appears to be part of NCL's SGB devkit. + +DataSnd_72548: DATA_SND $85d, $0, 11 + db $8C ; cpx #$8c (2) + db $D0, $F4 ; bne -$0c + db $60 ; rts + ds 7 + +DataSnd_72558: DATA_SND $852, $0, 11 + db $A9, $E7 ; lda #$e7 + db $9F, $01, $C0, $7E ; sta $7ec001, x + db $E8 ; inx + db $E8 ; inx + db $E8 ; inx + db $E8 ; inx + db $E0 ; cpx #$8c (1) + +DataSnd_72568: DATA_SND $847, $0, 11 + db $C4 ; cmp #$c4 (2) + db $D0, $16 ; bne +$16 + db $A5 ; lda dp + db $CB ; wai + db $C9, $05 ; cmp #$05 + db $D0, $10 ; bne +$10 + db $A2, $28 ; ldx #$28 + +DataSnd_72578: DATA_SND $83c, $0, 11 + db $F0, $12 ; beq +$12 + db $A5 ; lda dp + db $C9, $C9 ; cmp #$c9 + db $C8 ; iny + db $D0, $1C ; bne +$1c + db $A5 ; lda dp + db $CA ; dex + db $C9 ; cmp #$c4 (1) + +DataSnd_72588: DATA_SND $831, $0, 11 + dbw $0C, $CAA5 ; tsb $caa5 + db $C9, $7E ; cmp #$7e + db $D0, $06 ; bne +$06 + db $A5 ; lda dp + db $CB ; wai + db $C9, $7E ; cmp #$7e + +DataSnd_72598: DATA_SND $826, $0, 11 + db $39 ; bne +$39 (2) + dbw $CD, $C48 ; cmp $c48 + db $D0, $34 ; bne +$34 + db $A5 ; lda dp + db $C9, $C9 ; cmp #$c9 + db $80, $D0 ; bra -$30 + +DataSnd_725a8: DATA_SND $81b, $0, 11 + db $EA ; nop + db $EA ; nop + db $EA ; nop + db $EA ; nop + db $EA ; nop + ; $820: + db $A9,$01 ; lda #01 + dbw $CD,$C4F ; cmp $c4f + db $D0 ; bne +$39 (1) + +DataSnd_725b8: DATA_SND $810, $0, 11 + dbw $4C, $820 ; jmp $820 + db $EA ; nop + db $EA ; nop + db $EA ; nop + db $EA ; nop + db $EA ; nop + db $60 ; rts + db $EA ; nop + db $EA ; nop diff --git a/data/wildPokemon/fishinggroup1.asm b/data/wildPokemon/fishinggroup1.asm deleted file mode 100755 index 32dacef7..00000000 --- a/data/wildPokemon/fishinggroup1.asm +++ /dev/null @@ -1,4 +0,0 @@ -FishingGroup1: ; e97d (3:697d) - db 2 - db 15,TENTACOOL - db 15,POLIWAG diff --git a/data/wildPokemon/fishinggroup10.asm b/data/wildPokemon/fishinggroup10.asm deleted file mode 100755 index 5b815af4..00000000 --- a/data/wildPokemon/fishinggroup10.asm +++ /dev/null @@ -1,6 +0,0 @@ -FishingGroup10: ; e9bc (3:69bc) - db 4 - db 23,SEAKING - db 15,KRABBY - db 15,GOLDEEN - db 15,MAGIKARP diff --git a/data/wildPokemon/fishinggroup2.asm b/data/wildPokemon/fishinggroup2.asm deleted file mode 100755 index 758db30a..00000000 --- a/data/wildPokemon/fishinggroup2.asm +++ /dev/null @@ -1,4 +0,0 @@ -FishingGroup2: ; e982 (3:6982) - db 2 - db 15,GOLDEEN - db 15,POLIWAG diff --git a/data/wildPokemon/fishinggroup3.asm b/data/wildPokemon/fishinggroup3.asm deleted file mode 100755 index 2c1911fa..00000000 --- a/data/wildPokemon/fishinggroup3.asm +++ /dev/null @@ -1,5 +0,0 @@ -FishingGroup3: ; e987 (3:6987) - db 3 - db 15,PSYDUCK - db 15,GOLDEEN - db 15,KRABBY diff --git a/data/wildPokemon/fishinggroup4.asm b/data/wildPokemon/fishinggroup4.asm deleted file mode 100755 index ae9a73ed..00000000 --- a/data/wildPokemon/fishinggroup4.asm +++ /dev/null @@ -1,4 +0,0 @@ -FishingGroup4: ; e98e (3:698e) - db 2 - db 15,KRABBY - db 15,SHELLDER diff --git a/data/wildPokemon/fishinggroup5.asm b/data/wildPokemon/fishinggroup5.asm deleted file mode 100755 index ad856b27..00000000 --- a/data/wildPokemon/fishinggroup5.asm +++ /dev/null @@ -1,4 +0,0 @@ -FishingGroup5: ; e993 (3:6993) - db 2 - db 23,POLIWHIRL - db 15,SLOWPOKE diff --git a/data/wildPokemon/fishinggroup6.asm b/data/wildPokemon/fishinggroup6.asm deleted file mode 100755 index 581060d4..00000000 --- a/data/wildPokemon/fishinggroup6.asm +++ /dev/null @@ -1,6 +0,0 @@ -FishingGroup6: ; e998 (3:6998) - db 4 - db 15,DRATINI - db 15,KRABBY - db 15,PSYDUCK - db 15,SLOWPOKE diff --git a/data/wildPokemon/fishinggroup7.asm b/data/wildPokemon/fishinggroup7.asm deleted file mode 100755 index 69c3fc25..00000000 --- a/data/wildPokemon/fishinggroup7.asm +++ /dev/null @@ -1,6 +0,0 @@ -FishingGroup7: ; e9a1 (3:69a1) - db 4 - db 5,TENTACOOL - db 15,KRABBY - db 15,GOLDEEN - db 15,MAGIKARP diff --git a/data/wildPokemon/fishinggroup8.asm b/data/wildPokemon/fishinggroup8.asm deleted file mode 100755 index 04cc1632..00000000 --- a/data/wildPokemon/fishinggroup8.asm +++ /dev/null @@ -1,6 +0,0 @@ -FishingGroup8: ; e9aa (3:69aa) - db 4 - db 15,STARYU - db 15,HORSEA - db 15,SHELLDER - db 15,GOLDEEN diff --git a/data/wildPokemon/fishinggroup9.asm b/data/wildPokemon/fishinggroup9.asm deleted file mode 100755 index 8c02cd00..00000000 --- a/data/wildPokemon/fishinggroup9.asm +++ /dev/null @@ -1,6 +0,0 @@ -FishingGroup9: ; e9b3 (3:69b3) - db 4 - db 23,SLOWBRO - db 23,SEAKING - db 23,KINGLER - db 23,SEADRA diff --git a/data/wildPokemon/mansion1.asm b/data/wildPokemon/mansion1.asm index 0a333398..82547896 100755 --- a/data/wildPokemon/mansion1.asm +++ b/data/wildPokemon/mansion1.asm @@ -1,4 +1,4 @@ -MansionMons1: +MansionMons1: db $0A IF _RED db 32,KOFFING @@ -12,7 +12,7 @@ MansionMons1: db 37,WEEZING db 39,MUK ENDC - + IF _GREEN || _BLUE db 32,GRIMER db 30,GRIMER @@ -25,7 +25,7 @@ MansionMons1: db 37,MUK db 39,WEEZING ENDC - + IF _YELLOW db 34,RATTATA db 34,RATICATE @@ -38,6 +38,6 @@ MansionMons1: db 34,GROWLITHE db 38,GROWLITHE ENDC - + db $00 diff --git a/data/wildPokemon/mansion2.asm b/data/wildPokemon/mansion2.asm index 07ddc947..8ebbb414 100755 --- a/data/wildPokemon/mansion2.asm +++ b/data/wildPokemon/mansion2.asm @@ -1,4 +1,4 @@ -MansionMons2: +MansionMons2: db $0A IF _RED db 32,GROWLITHE @@ -12,7 +12,7 @@ MansionMons2: db 39,WEEZING db 37,MUK ENDC - + IF _GREEN || !_JAPAN && _BLUE db 32,VULPIX db 34,GRIMER @@ -25,7 +25,7 @@ MansionMons2: db 39,MUK db 37,WEEZING ENDC - + IF _JAPAN && _BLUE db 32,GROWLITHE db 34,GRIMER @@ -38,7 +38,7 @@ MansionMons2: db 39,MUK db 37,WEEZING ENDC - + IF _YELLOW db 37,RATTATA db 37,RATICATE @@ -51,6 +51,6 @@ MansionMons2: db 35,MUK db 38,MUK ENDC - + db $00 diff --git a/data/wildPokemon/mansion3.asm b/data/wildPokemon/mansion3.asm index c0df4020..a1b126ac 100755 --- a/data/wildPokemon/mansion3.asm +++ b/data/wildPokemon/mansion3.asm @@ -1,4 +1,4 @@ -MansionMons3: +MansionMons3: db $0A IF _RED db 31,KOFFING @@ -12,7 +12,7 @@ MansionMons3: db 36,PONYTA db 42,MUK ENDC - + IF _GREEN || !_JAPAN && _BLUE db 31,GRIMER db 33,VULPIX @@ -25,7 +25,7 @@ MansionMons3: db 36,PONYTA db 42,WEEZING ENDC - + IF _JAPAN && _BLUE db 31,GRIMER db 33,GROWLITHE @@ -38,7 +38,7 @@ MansionMons3: db 36,PONYTA db 42,WEEZING ENDC - + IF _YELLOW db 40,RATTATA db 40,RATICATE @@ -51,6 +51,6 @@ MansionMons3: db 38,MUK db 41,MUK ENDC - + db $00 diff --git a/data/wildPokemon/mansionb1.asm b/data/wildPokemon/mansionb1.asm index 9b90d211..23831eeb 100755 --- a/data/wildPokemon/mansionb1.asm +++ b/data/wildPokemon/mansionb1.asm @@ -1,4 +1,4 @@ -MansionMonsB1: +MansionMonsB1: db $0A IF _RED db 33,KOFFING @@ -12,7 +12,7 @@ MansionMonsB1: db 42,WEEZING db 42,MUK ENDC - + IF _GREEN || !_JAPAN && _BLUE db 33,GRIMER db 31,GRIMER @@ -25,7 +25,7 @@ MansionMonsB1: db 38,MAGMAR db 42,WEEZING ENDC - + IF _JAPAN && _BLUE db 33,GRIMER db 31,GRIMER @@ -38,7 +38,7 @@ MansionMonsB1: db 38,MUK db 42,WEEZING ENDC - + IF _YELLOW db 35,GRIMER db 38,GRIMER @@ -51,6 +51,6 @@ MansionMonsB1: db 18,DITTO db 12,DITTO ENDC - + db $00 diff --git a/data/wildPokemon/mtmoon1.asm b/data/wildPokemon/mtmoon1.asm index 3f69ae3f..5ba1d030 100755 --- a/data/wildPokemon/mtmoon1.asm +++ b/data/wildPokemon/mtmoon1.asm @@ -1,4 +1,4 @@ -MoonMons1: +MoonMons1: db $0A IF !_YELLOW db 8,ZUBAT diff --git a/data/wildPokemon/mtmoonb1.asm b/data/wildPokemon/mtmoonb1.asm index 30d9a4ce..0f3639c1 100755 --- a/data/wildPokemon/mtmoonb1.asm +++ b/data/wildPokemon/mtmoonb1.asm @@ -1,4 +1,4 @@ -MoonMonsB1: +MoonMonsB1: db $0A IF !_YELLOW db 8,ZUBAT diff --git a/data/wildPokemon/mtmoonb2.asm b/data/wildPokemon/mtmoonb2.asm index 36266724..34966cd8 100755 --- a/data/wildPokemon/mtmoonb2.asm +++ b/data/wildPokemon/mtmoonb2.asm @@ -1,4 +1,4 @@ -MoonMonsB2: +MoonMonsB2: db $0A IF !_YELLOW db 9,ZUBAT diff --git a/data/wildPokemon/pokemontower1.asm b/data/wildPokemon/pokemontower1.asm index bdf0abc1..4911c790 100755 --- a/data/wildPokemon/pokemontower1.asm +++ b/data/wildPokemon/pokemontower1.asm @@ -1,4 +1,4 @@ -TowerMons1: +TowerMons1: db $00 db $00 diff --git a/data/wildPokemon/pokemontower2.asm b/data/wildPokemon/pokemontower2.asm index 1d0eddaf..a849668d 100755 --- a/data/wildPokemon/pokemontower2.asm +++ b/data/wildPokemon/pokemontower2.asm @@ -1,4 +1,4 @@ -TowerMons2: +TowerMons2: db $00 db $00 diff --git a/data/wildPokemon/pokemontower3.asm b/data/wildPokemon/pokemontower3.asm index 7d1abf59..e2b39398 100755 --- a/data/wildPokemon/pokemontower3.asm +++ b/data/wildPokemon/pokemontower3.asm @@ -1,6 +1,6 @@ -TowerMons3: +TowerMons3: db $0A - + IF !_YELLOW db 20,GASTLY db 21,GASTLY @@ -13,7 +13,7 @@ TowerMons3: db 22,CUBONE db 25,HAUNTER ENDC - + IF _YELLOW db 20,GASTLY db 21,GASTLY @@ -26,6 +26,6 @@ TowerMons3: db 20,HAUNTER db 25,HAUNTER ENDC - + db $00 diff --git a/data/wildPokemon/pokemontower4.asm b/data/wildPokemon/pokemontower4.asm index 462e5034..3f38af20 100755 --- a/data/wildPokemon/pokemontower4.asm +++ b/data/wildPokemon/pokemontower4.asm @@ -1,6 +1,6 @@ -TowerMons4: +TowerMons4: db $0A - + IF !_YELLOW db 20,GASTLY db 21,GASTLY @@ -13,7 +13,7 @@ TowerMons4: db 22,CUBONE db 24,GASTLY ENDC - + IF _YELLOW db 20,GASTLY db 21,GASTLY @@ -26,6 +26,6 @@ TowerMons4: db 20,HAUNTER db 25,HAUNTER ENDC - + db $00 diff --git a/data/wildPokemon/pokemontower5.asm b/data/wildPokemon/pokemontower5.asm index 6976937a..97098448 100755 --- a/data/wildPokemon/pokemontower5.asm +++ b/data/wildPokemon/pokemontower5.asm @@ -1,6 +1,6 @@ -TowerMons5: +TowerMons5: db $0A - + IF !_YELLOW db 20,GASTLY db 21,GASTLY @@ -13,7 +13,7 @@ TowerMons5: db 22,CUBONE db 24,GASTLY ENDC - + IF _YELLOW db 22,GASTLY db 23,GASTLY @@ -26,6 +26,6 @@ TowerMons5: db 22,HAUNTER db 27,HAUNTER ENDC - + db $00 diff --git a/data/wildPokemon/pokemontower6.asm b/data/wildPokemon/pokemontower6.asm index 4f2d9594..abd2969a 100755 --- a/data/wildPokemon/pokemontower6.asm +++ b/data/wildPokemon/pokemontower6.asm @@ -1,6 +1,6 @@ -TowerMons6: +TowerMons6: db $0F - + IF !_YELLOW db 21,GASTLY db 22,GASTLY @@ -13,7 +13,7 @@ TowerMons6: db 24,CUBONE db 28,HAUNTER ENDC - + IF _YELLOW db 22,GASTLY db 23,GASTLY @@ -26,6 +26,6 @@ TowerMons6: db 22,HAUNTER db 27,HAUNTER ENDC - + db $00 diff --git a/data/wildPokemon/pokemontower7.asm b/data/wildPokemon/pokemontower7.asm index 6c9afbd4..2daf3a2d 100755 --- a/data/wildPokemon/pokemontower7.asm +++ b/data/wildPokemon/pokemontower7.asm @@ -1,6 +1,6 @@ -TowerMons7: +TowerMons7: db $0F - + IF !_YELLOW db 21,GASTLY db 22,GASTLY @@ -14,7 +14,7 @@ TowerMons7: db 30,HAUNTER ENDC - + IF _YELLOW db 24,GASTLY db 25,GASTLY @@ -27,6 +27,6 @@ TowerMons7: db 24,HAUNTER db 29,HAUNTER ENDC - + db $00 diff --git a/data/wildPokemon/powerplant.asm b/data/wildPokemon/powerplant.asm index 741232c3..a67ab2e9 100755 --- a/data/wildPokemon/powerplant.asm +++ b/data/wildPokemon/powerplant.asm @@ -1,7 +1,7 @@ -PowerPlantMons: +PowerPlantMons: db $0A IF !_YELLOW - + db 21,VOLTORB db 21,MAGNEMITE db 20,PIKACHU @@ -19,7 +19,7 @@ PowerPlantMons: db 36,RAICHU ENDC ENDC - + IF _YELLOW db 30,MAGNEMITE db 35,MAGNEMITE @@ -32,6 +32,6 @@ PowerPlantMons: db 33,MUK db 37,MUK ENDC - + db $00 diff --git a/data/wildPokemon/rocktunnel1.asm b/data/wildPokemon/rocktunnel1.asm index 20416c5f..e8904043 100755 --- a/data/wildPokemon/rocktunnel1.asm +++ b/data/wildPokemon/rocktunnel1.asm @@ -1,6 +1,6 @@ -TunnelMonsB1: +TunnelMonsB1: db $0F - + IF !_YELLOW db 16,ZUBAT db 17,ZUBAT @@ -18,7 +18,7 @@ TunnelMonsB1: db 13,ONIX db 15,ONIX ENDC - + IF _YELLOW db 15,ZUBAT db 16,GEODUDE @@ -31,6 +31,6 @@ TunnelMonsB1: db 19,MACHOP db 21,MACHOP ENDC - + db $00 diff --git a/data/wildPokemon/rocktunnel2.asm b/data/wildPokemon/rocktunnel2.asm index b1ca24fd..f158453e 100755 --- a/data/wildPokemon/rocktunnel2.asm +++ b/data/wildPokemon/rocktunnel2.asm @@ -1,4 +1,4 @@ -TunnelMonsB2: +TunnelMonsB2: db $0F IF !_YELLOW db 16,ZUBAT @@ -17,7 +17,7 @@ TunnelMonsB2: db 13,ONIX db 18,GEODUDE ENDC - + IF _YELLOW db 20,ZUBAT db 17,GEODUDE @@ -30,6 +30,6 @@ TunnelMonsB2: db 18,ONIX db 22,ONIX ENDC - + db $00 diff --git a/data/wildPokemon/route1.asm b/data/wildPokemon/route1.asm index 94469880..bbad3c9e 100755 --- a/data/wildPokemon/route1.asm +++ b/data/wildPokemon/route1.asm @@ -1,4 +1,4 @@ -Route1Mons: +Route1Mons: db $19 IF !_YELLOW db 3,PIDGEY diff --git a/data/wildPokemon/route10.asm b/data/wildPokemon/route10.asm index 69651380..185e41fe 100755 --- a/data/wildPokemon/route10.asm +++ b/data/wildPokemon/route10.asm @@ -1,6 +1,6 @@ -Route10Mons: +Route10Mons: db $0F - + IF _RED db 16,VOLTORB db 16,SPEAROW @@ -13,7 +13,7 @@ Route10Mons: db 13,EKANS db 17,EKANS ENDC - + IF !_RED db 16,VOLTORB db 16,SPEAROW @@ -26,7 +26,7 @@ Route10Mons: db 13,SANDSHREW db 17,SANDSHREW ENDC - + IF _YELLOW db 16,MAGNEMITE db 18,RATTATA @@ -39,6 +39,6 @@ Route10Mons: db 16,MACHOP db 18,MACHOP ENDC - + db $00 diff --git a/data/wildPokemon/route11.asm b/data/wildPokemon/route11.asm index afe72dd2..6f724e80 100755 --- a/data/wildPokemon/route11.asm +++ b/data/wildPokemon/route11.asm @@ -1,6 +1,6 @@ -Route11Mons: +Route11Mons: db $0F - + IF _RED db 14,EKANS db 15,SPEAROW @@ -13,7 +13,7 @@ Route11Mons: db 11,DROWZEE db 15,DROWZEE ENDC - + IF _GREEN || _BLUE db 14,SANDSHREW db 15,SPEAROW @@ -26,7 +26,7 @@ Route11Mons: db 11,DROWZEE db 15,DROWZEE ENDC - + IF _YELLOW db 16,PIDGEY db 15,RATTATA @@ -39,6 +39,6 @@ Route11Mons: db 19,DROWZEE db 17,RATICATE ENDC - + db $00 diff --git a/data/wildPokemon/route12.asm b/data/wildPokemon/route12.asm index e16b407b..b15a2223 100755 --- a/data/wildPokemon/route12.asm +++ b/data/wildPokemon/route12.asm @@ -1,6 +1,6 @@ -Route12Mons: +Route12Mons: db $0F - + IF _RED || (_JAPAN && _BLUE) db 24,ODDISH db 25,PIDGEY @@ -14,7 +14,7 @@ Route12Mons: db 30,GLOOM db $00 ENDC - + IF _GREEN || (!_JAPAN && _BLUE) db 24,BELLSPROUT db 25,PIDGEY @@ -28,7 +28,7 @@ Route12Mons: db 30,WEEPINBELL db $00 ENDC - + IF _YELLOW db 25,ODDISH db 25,BELLSPROUT diff --git a/data/wildPokemon/route13.asm b/data/wildPokemon/route13.asm index 96e53229..5293bf21 100755 --- a/data/wildPokemon/route13.asm +++ b/data/wildPokemon/route13.asm @@ -1,4 +1,4 @@ -Route13Mons: +Route13Mons: IF _RED || (_JAPAN && _BLUE) db $14 db 24,ODDISH @@ -13,7 +13,7 @@ Route13Mons: db 30,GLOOM db $00 ENDC - + IF _GREEN || (!_JAPAN && _BLUE) db $14 db 24,BELLSPROUT @@ -28,7 +28,7 @@ Route13Mons: db 30,WEEPINBELL db $00 ENDC - + IF _YELLOW db $0F db 25,ODDISH diff --git a/data/wildPokemon/route14.asm b/data/wildPokemon/route14.asm index c3e0743b..76d9118f 100755 --- a/data/wildPokemon/route14.asm +++ b/data/wildPokemon/route14.asm @@ -1,4 +1,4 @@ -Route14Mons: +Route14Mons: db $0F IF _RED || (_JAPAN && _BLUE) db 24,ODDISH @@ -12,7 +12,7 @@ Route14Mons: db 28,PIDGEOTTO db 30,PIDGEOTTO ENDC - + IF _GREEN || (!_JAPAN && _BLUE) db 24,BELLSPROUT db 26,PIDGEY @@ -25,7 +25,7 @@ Route14Mons: db 28,PIDGEOTTO db 30,PIDGEOTTO ENDC - + IF _YELLOW db 26,ODDISH db 26,BELLSPROUT @@ -38,6 +38,6 @@ Route14Mons: db 27,VENONAT db 30,VENOMOTH ENDC - + db $00 diff --git a/data/wildPokemon/route15.asm b/data/wildPokemon/route15.asm index a8215cd3..4a0d3fc3 100755 --- a/data/wildPokemon/route15.asm +++ b/data/wildPokemon/route15.asm @@ -1,4 +1,4 @@ -Route15Mons: +Route15Mons: db $0F IF _RED || (_JAPAN && _BLUE) db 24,ODDISH @@ -12,7 +12,7 @@ Route15Mons: db 28,PIDGEOTTO db 30,PIDGEOTTO ENDC - + IF _GREEN || (!_JAPAN && _BLUE) db 24,BELLSPROUT db 26,DITTO @@ -25,7 +25,7 @@ Route15Mons: db 28,PIDGEOTTO db 30,PIDGEOTTO ENDC - + IF _YELLOW db 26,ODDISH db 26,BELLSPROUT @@ -38,6 +38,6 @@ Route15Mons: db 27,VENONAT db 30,VENOMOTH ENDC - + db $00 diff --git a/data/wildPokemon/route16.asm b/data/wildPokemon/route16.asm index 23aadb6c..34408164 100755 --- a/data/wildPokemon/route16.asm +++ b/data/wildPokemon/route16.asm @@ -1,4 +1,4 @@ -Route16Mons: +Route16Mons: db $19 IF !_YELLOW db 20,SPEAROW @@ -12,7 +12,7 @@ Route16Mons: db 23,RATICATE db 25,RATICATE ENDC - + IF _YELLOW db 22,SPEAROW db 22,DODUO @@ -25,6 +25,6 @@ Route16Mons: db 25,RATICATE db 26,RATICATE ENDC - + db $00 diff --git a/data/wildPokemon/route17.asm b/data/wildPokemon/route17.asm index 9cdb18b3..75882ec5 100755 --- a/data/wildPokemon/route17.asm +++ b/data/wildPokemon/route17.asm @@ -1,4 +1,4 @@ -Route17Mons: +Route17Mons: db $19 IF !_YELLOW db 20,SPEAROW @@ -12,7 +12,7 @@ Route17Mons: db 25,FEAROW db 27,FEAROW ENDC - + IF _YELLOW db 26,DODUO db 27,FEAROW @@ -25,6 +25,6 @@ Route17Mons: db 32,PONYTA db 29,DODRIO ENDC - + db $00 diff --git a/data/wildPokemon/route18.asm b/data/wildPokemon/route18.asm index 9d2b08cf..8820f045 100755 --- a/data/wildPokemon/route18.asm +++ b/data/wildPokemon/route18.asm @@ -1,4 +1,4 @@ -Route18Mons: +Route18Mons: db $19 IF !_YELLOW db 20,SPEAROW @@ -12,7 +12,7 @@ Route18Mons: db 27,FEAROW db 29,FEAROW ENDC - + IF _YELLOW db 22,SPEAROW db 22,DODUO @@ -25,6 +25,6 @@ Route18Mons: db 25,RATICATE db 26,RATICATE ENDC - + db $00 diff --git a/data/wildPokemon/route2.asm b/data/wildPokemon/route2.asm index e63f5028..57d7f87f 100755 --- a/data/wildPokemon/route2.asm +++ b/data/wildPokemon/route2.asm @@ -1,6 +1,6 @@ -Route2Mons: +Route2Mons: db $19 - + IF !_YELLOW db 3,RATTATA db 3,PIDGEY diff --git a/data/wildPokemon/route21.asm b/data/wildPokemon/route21.asm index 26a590da..a29753eb 100755 --- a/data/wildPokemon/route21.asm +++ b/data/wildPokemon/route21.asm @@ -1,4 +1,4 @@ -Route21Mons: +Route21Mons: db $19 IF !_YELLOW db 21,RATTATA @@ -12,7 +12,7 @@ Route21Mons: db 30,TANGELA db 32,TANGELA ENDC - + IF _YELLOW db 15,PIDGEY db 13,RATTATA @@ -25,7 +25,7 @@ Route21Mons: db 19,PIDGEOTTO db 15,PIDGEOTTO ENDC - + db $05 db 5,TENTACOOL db 10,TENTACOOL diff --git a/data/wildPokemon/route22.asm b/data/wildPokemon/route22.asm index e78c02c9..36ff9a57 100755 --- a/data/wildPokemon/route22.asm +++ b/data/wildPokemon/route22.asm @@ -1,4 +1,4 @@ -Route22Mons: +Route22Mons: db $19 IF _RED || (_JAPAN && _BLUE) db 3,RATTATA diff --git a/data/wildPokemon/route23.asm b/data/wildPokemon/route23.asm index 3cd2ca9d..cfdd8eff 100755 --- a/data/wildPokemon/route23.asm +++ b/data/wildPokemon/route23.asm @@ -1,4 +1,4 @@ -Route23Mons: +Route23Mons: db $0A IF !_YELLOW IF _RED @@ -22,7 +22,7 @@ Route23Mons: db 41,FEAROW db 43,FEAROW ENDC - + IF _YELLOW db 41,NIDORINO db 41,NIDORINA @@ -35,6 +35,6 @@ Route23Mons: db 41,PRIMEAPE db 46,PRIMEAPE ENDC - + db $00 diff --git a/data/wildPokemon/route24.asm b/data/wildPokemon/route24.asm index 28af9916..e4ff986a 100755 --- a/data/wildPokemon/route24.asm +++ b/data/wildPokemon/route24.asm @@ -1,6 +1,6 @@ -Route24Mons: +Route24Mons: db $19 - + IF _RED db 7,WEEDLE db 8,KAKUNA @@ -13,7 +13,7 @@ Route24Mons: db 8,ABRA db 12,ABRA ENDC - + IF _GREEN || !_JAPAN && _BLUE db 7,CATERPIE db 8,METAPOD @@ -26,7 +26,7 @@ Route24Mons: db 8,ABRA db 12,ABRA ENDC - + IF _JAPAN && _BLUE db 7,CATERPIE db 8,METAPOD @@ -39,7 +39,7 @@ Route24Mons: db 8,ABRA db 12,ABRA ENDC - + IF _YELLOW db 12,ODDISH db 12,BELLSPROUT @@ -52,6 +52,6 @@ Route24Mons: db 17,PIDGEY db 17,PIDGEOTTO ENDC - + db $00 diff --git a/data/wildPokemon/route25.asm b/data/wildPokemon/route25.asm index 1aac115f..3d225473 100755 --- a/data/wildPokemon/route25.asm +++ b/data/wildPokemon/route25.asm @@ -1,6 +1,6 @@ -Route25Mons: +Route25Mons: db $0F - + IF _RED db 8,WEEDLE db 9,KAKUNA @@ -13,7 +13,7 @@ Route25Mons: db 7,METAPOD db 8,CATERPIE ENDC - + IF _GREEN || !_JAPAN && _BLUE db 8,CATERPIE db 9,METAPOD @@ -26,7 +26,7 @@ Route25Mons: db 7,KAKUNA db 8,WEEDLE ENDC - + IF _JAPAN && _BLUE db 8,CATERPIE db 9,METAPOD @@ -39,7 +39,7 @@ Route25Mons: db 7,KAKUNA db 8,WEEDLE ENDC - + IF _YELLOW db 12,ODDISH db 12,BELLSPROUT @@ -52,6 +52,6 @@ Route25Mons: db 17,PIDGEY db 17,PIDGEOTTO ENDC - + db $00 diff --git a/data/wildPokemon/route3.asm b/data/wildPokemon/route3.asm index 1b555138..21230f42 100755 --- a/data/wildPokemon/route3.asm +++ b/data/wildPokemon/route3.asm @@ -1,4 +1,4 @@ -Route3Mons: +Route3Mons: db $14 IF !_YELLOW db 6,PIDGEY diff --git a/data/wildPokemon/route4.asm b/data/wildPokemon/route4.asm index 22610dc6..f7eb80ee 100755 --- a/data/wildPokemon/route4.asm +++ b/data/wildPokemon/route4.asm @@ -1,6 +1,6 @@ -Route4Mons: +Route4Mons: db $14 - + IF _RED db 10,RATTATA db 10,SPEAROW @@ -13,7 +13,7 @@ Route4Mons: db 8,EKANS db 12,EKANS ENDC - + IF !_RED db 10,RATTATA db 10,SPEAROW @@ -26,7 +26,7 @@ Route4Mons: db 8,SANDSHREW db 12,SANDSHREW ENDC - + IF _YELLOW db 8,SPEAROW db 9,SPEAROW diff --git a/data/wildPokemon/route5.asm b/data/wildPokemon/route5.asm index c08b51a4..4b018cd6 100755 --- a/data/wildPokemon/route5.asm +++ b/data/wildPokemon/route5.asm @@ -1,6 +1,6 @@ -Route5Mons: +Route5Mons: db $0F - + IF _RED db 13,ODDISH db 13,PIDGEY @@ -13,7 +13,7 @@ Route5Mons: db 14,MANKEY db 16,MANKEY ENDC - + IF _GREEN || !_JAPAN && _BLUE db 13,BELLSPROUT db 13,PIDGEY @@ -26,7 +26,7 @@ Route5Mons: db 14,MEOWTH db 16,MEOWTH ENDC - + IF _JAPAN && _BLUE db 13,ODDISH db 13,PIDGEY @@ -39,7 +39,7 @@ Route5Mons: db 14,MEOWTH db 16,MEOWTH ENDC - + IF _YELLOW db 15,PIDGEY db 14,RATTATA @@ -52,6 +52,6 @@ Route5Mons: db 5,JIGGLYPUFF db 7,JIGGLYPUFF ENDC - + db $00 diff --git a/data/wildPokemon/route6.asm b/data/wildPokemon/route6.asm index a2e0f4d0..253a5943 100755 --- a/data/wildPokemon/route6.asm +++ b/data/wildPokemon/route6.asm @@ -1,6 +1,6 @@ -Route6Mons: +Route6Mons: db $0F - + IF _RED db 13,ODDISH db 13,PIDGEY @@ -14,7 +14,7 @@ Route6Mons: db 16,MANKEY db $00 ENDC - + IF _GREEN || !_JAPAN && _BLUE db 13,BELLSPROUT db 13,PIDGEY @@ -28,7 +28,7 @@ Route6Mons: db 16,MEOWTH db $00 ENDC - + IF _JAPAN && _BLUE db 13,ODDISH db 13,PIDGEY @@ -42,7 +42,7 @@ Route6Mons: db 16,MEOWTH db $00 ENDC - + IF _YELLOW db 15,PIDGEY db 14,RATTATA diff --git a/data/wildPokemon/route7.asm b/data/wildPokemon/route7.asm index ecda56aa..42073d11 100755 --- a/data/wildPokemon/route7.asm +++ b/data/wildPokemon/route7.asm @@ -1,6 +1,6 @@ -Route7Mons: +Route7Mons: db $0F - + IF _RED db 19,PIDGEY db 19,ODDISH @@ -13,7 +13,7 @@ Route7Mons: db 19,MANKEY db 20,MANKEY ENDC - + IF _GREEN || !_JAPAN && _BLUE db 19,PIDGEY db 19,BELLSPROUT @@ -26,7 +26,7 @@ Route7Mons: db 19,MEOWTH db 20,MEOWTH ENDC - + IF _JAPAN && _BLUE db 19,PIDGEY db 19,ODDISH @@ -39,7 +39,7 @@ Route7Mons: db 19,MEOWTH db 20,MEOWTH ENDC - + IF _YELLOW db 20,PIDGEY db 22,PIDGEY @@ -52,6 +52,6 @@ Route7Mons: db 24,JIGGLYPUFF db 24,JIGGLYPUFF ENDC - + db $00 diff --git a/data/wildPokemon/route8.asm b/data/wildPokemon/route8.asm index 97260649..59c3082d 100755 --- a/data/wildPokemon/route8.asm +++ b/data/wildPokemon/route8.asm @@ -1,6 +1,6 @@ -Route8Mons: +Route8Mons: db $0F - + IF _RED db 18,PIDGEY db 18,MANKEY @@ -13,7 +13,7 @@ Route8Mons: db 15,GROWLITHE db 18,GROWLITHE ENDC - + IF _GREEN || !_JAPAN && _BLUE db 18,PIDGEY db 18,MEOWTH @@ -26,7 +26,7 @@ Route8Mons: db 15,VULPIX db 18,VULPIX ENDC - + IF _JAPAN && _BLUE db 18,PIDGEY db 18,MEOWTH @@ -39,7 +39,7 @@ Route8Mons: db 15,GROWLITHE db 18,GROWLITHE ENDC - + IF _YELLOW db 20,PIDGEY db 22,PIDGEY @@ -52,6 +52,6 @@ Route8Mons: db 20,KADABRA db 27,KADABRA ENDC - + db $00 diff --git a/data/wildPokemon/route9.asm b/data/wildPokemon/route9.asm index c7c65186..03523e4f 100755 --- a/data/wildPokemon/route9.asm +++ b/data/wildPokemon/route9.asm @@ -1,6 +1,6 @@ -Route9Mons: +Route9Mons: db $0F - + IF _RED db 16,RATTATA db 16,SPEAROW @@ -13,7 +13,7 @@ Route9Mons: db 13,EKANS db 17,EKANS ENDC - + IF !_RED && !_YELLOW db 16,RATTATA db 16,SPEAROW @@ -26,7 +26,7 @@ Route9Mons: db 13,SANDSHREW db 17,SANDSHREW ENDC - + IF _YELLOW db 16,NIDORAN_M db 16,NIDORAN_F @@ -39,6 +39,6 @@ Route9Mons: db 20,RATICATE db 19,FEAROW ENDC - + db $00 diff --git a/data/wildPokemon/safarizone1.asm b/data/wildPokemon/safarizone1.asm index 1e2f463c..29e3f29b 100755 --- a/data/wildPokemon/safarizone1.asm +++ b/data/wildPokemon/safarizone1.asm @@ -1,4 +1,4 @@ -ZoneMons1: +ZoneMons1: db $1E IF _RED || (_JAPAN && _BLUE) db 24,NIDORAN_M @@ -17,7 +17,7 @@ ZoneMons1: ENDC db 28,SCYTHER ENDC - + IF _GREEN || (!_JAPAN && _BLUE) db 24,NIDORAN_F db 26,DODUO @@ -30,7 +30,7 @@ ZoneMons1: db 25,KANGASKHAN db 28,PINSIR ENDC - + IF _YELLOW db 21,NIDORAN_M db 29,NIDORAN_F @@ -43,6 +43,6 @@ ZoneMons1: db 21,CHANSEY db 15,SCYTHER ENDC - + db $00 diff --git a/data/wildPokemon/safarizone2.asm b/data/wildPokemon/safarizone2.asm index ac35d4e4..2adb18ed 100755 --- a/data/wildPokemon/safarizone2.asm +++ b/data/wildPokemon/safarizone2.asm @@ -1,4 +1,4 @@ -ZoneMons2: +ZoneMons2: db $1E IF !_YELLOW IF _RED || (_JAPAN && _BLUE) @@ -32,7 +32,7 @@ ZoneMons2: db 28,PINSIR ENDC ENDC - + IF _YELLOW db 36,NIDORAN_M db 14,NIDORAN_F @@ -45,6 +45,6 @@ ZoneMons2: db 25,SCYTHER db 15,PINSIR ENDC - + db $00 diff --git a/data/wildPokemon/safarizone3.asm b/data/wildPokemon/safarizone3.asm index 497efd24..436ab937 100755 --- a/data/wildPokemon/safarizone3.asm +++ b/data/wildPokemon/safarizone3.asm @@ -1,4 +1,4 @@ -ZoneMons3: +ZoneMons3: db $1E IF _RED db 25,NIDORAN_M @@ -12,7 +12,7 @@ ZoneMons3: db 26,TAUROS db 28,KANGASKHAN ENDC - + IF _GREEN || (!_JAPAN && _BLUE) db 25,NIDORAN_F db 26,DODUO @@ -25,7 +25,7 @@ ZoneMons3: db 26,TAUROS db 28,KANGASKHAN ENDC - + IF _JAPAN && _BLUE db 25,NIDORAN_M db 26,DODUO @@ -38,7 +38,7 @@ ZoneMons3: db 26,PINSIR db 28,LICKITUNG ENDC - + IF _YELLOW db 29,NIDORAN_M db 21,NIDORAN_F @@ -51,6 +51,6 @@ ZoneMons3: db 25,PINSIR db 27,TANGELA ENDC - + db $00 diff --git a/data/wildPokemon/safarizonecenter.asm b/data/wildPokemon/safarizonecenter.asm index d8c74a76..35eb7fd4 100755 --- a/data/wildPokemon/safarizonecenter.asm +++ b/data/wildPokemon/safarizonecenter.asm @@ -1,4 +1,4 @@ -ZoneMonsCenter: +ZoneMonsCenter: db $1E IF _RED db 22,NIDORAN_M @@ -12,7 +12,7 @@ ZoneMonsCenter: db 23,SCYTHER db 23,CHANSEY ENDC - + IF _GREEN || (!_JAPAN && _BLUE) db 22,NIDORAN_F db 25,RHYHORN @@ -25,7 +25,7 @@ ZoneMonsCenter: db 23,PINSIR db 23,CHANSEY ENDC - + IF _JAPAN && _BLUE db 22,NIDORAN_M db 25,RHYHORN @@ -38,7 +38,7 @@ ZoneMonsCenter: db 23,SCYTHER db 23,CHANSEY ENDC - + IF _YELLOW db 14,NIDORAN_M db 36,NIDORAN_F @@ -51,6 +51,6 @@ ZoneMonsCenter: db 22,TANGELA db 7,CHANSEY ENDC - + db $00 diff --git a/data/wildPokemon/seafoamisland1.asm b/data/wildPokemon/seafoamisland1.asm index 472af2e1..506dd98e 100755 --- a/data/wildPokemon/seafoamisland1.asm +++ b/data/wildPokemon/seafoamisland1.asm @@ -1,4 +1,4 @@ -IslandMons1: +IslandMons1: db $0F IF _RED db 30,SEEL @@ -12,7 +12,7 @@ IslandMons1: db 28,SHELLDER db 38,GOLDUCK ENDC - + IF _GREEN || !_JAPAN && _BLUE db 30,SEEL db 30,PSYDUCK @@ -25,7 +25,7 @@ IslandMons1: db 28,STARYU db 38,SLOWBRO ENDC - + IF _JAPAN && _BLUE db 30,SEEL db 30,HORSEA @@ -38,7 +38,7 @@ IslandMons1: db 28,STARYU db 38,SLOWBRO ENDC - + IF _YELLOW db 18,ZUBAT db 25,KRABBY @@ -51,6 +51,6 @@ IslandMons1: db 27,GOLBAT db 36,GOLBAT ENDC - + db $00 diff --git a/data/wildPokemon/seafoamislandb1.asm b/data/wildPokemon/seafoamislandb1.asm index 9b49bc46..044753b4 100755 --- a/data/wildPokemon/seafoamislandb1.asm +++ b/data/wildPokemon/seafoamislandb1.asm @@ -1,4 +1,4 @@ -IslandMonsB1: +IslandMonsB1: db $0A IF _RED db 30,STARYU @@ -12,7 +12,7 @@ IslandMonsB1: db 38,DEWGONG db 37,SEADRA ENDC - + IF _GREEN || !_JAPAN && _BLUE db 30,SHELLDER db 30,KRABBY @@ -25,7 +25,7 @@ IslandMonsB1: db 38,DEWGONG db 37,KINGLER ENDC - + IF _JAPAN && _BLUE db 30,SHELLDER db 30,KRABBY @@ -38,7 +38,7 @@ IslandMonsB1: db 38,DEWGONG db 37,KINGLER ENDC - + IF _YELLOW db 27,ZUBAT db 26,KRABBY @@ -51,6 +51,6 @@ IslandMonsB1: db 22,SEEL db 26,SEEL ENDC - + db $00 diff --git a/data/wildPokemon/seafoamislandb2.asm b/data/wildPokemon/seafoamislandb2.asm index 4cad1012..2b7a3ef8 100755 --- a/data/wildPokemon/seafoamislandb2.asm +++ b/data/wildPokemon/seafoamislandb2.asm @@ -1,4 +1,4 @@ -IslandMonsB2: +IslandMonsB2: db $0A IF _RED db 30,SEEL @@ -12,7 +12,7 @@ IslandMonsB2: db 30,GOLBAT db 37,SLOWBRO ENDC - + IF _GREEN || !_JAPAN && _BLUE db 30,SEEL db 30,PSYDUCK @@ -25,7 +25,7 @@ IslandMonsB2: db 30,GOLBAT db 37,GOLDUCK ENDC - + IF _JAPAN && _BLUE db 30,SEEL db 30,HORSEA @@ -38,7 +38,7 @@ IslandMonsB2: db 30,GOLBAT db 37,JYNX ENDC - + IF _YELLOW db 27,ZUBAT db 27,KRABBY @@ -51,6 +51,6 @@ IslandMonsB2: db 31,SLOWPOKE db 31,SLOWBRO ENDC - + db $00 diff --git a/data/wildPokemon/seafoamislandb3.asm b/data/wildPokemon/seafoamislandb3.asm index 55d806a9..ac9769b4 100755 --- a/data/wildPokemon/seafoamislandb3.asm +++ b/data/wildPokemon/seafoamislandb3.asm @@ -1,4 +1,4 @@ -IslandMonsB3: +IslandMonsB3: db $0A IF _RED db 31,SLOWPOKE @@ -12,7 +12,7 @@ IslandMonsB3: db 39,SEADRA db 37,DEWGONG ENDC - + IF _GREEN || !_JAPAN && _BLUE db 31,PSYDUCK db 31,SEEL @@ -25,7 +25,7 @@ IslandMonsB3: db 39,KINGLER db 37,DEWGONG ENDC - + IF _JAPAN && _BLUE db 31,HORSEA db 31,SEEL @@ -38,7 +38,7 @@ IslandMonsB3: db 39,KINGLER db 37,DEWGONG ENDC - + IF _YELLOW db 27,GOLBAT db 36,ZUBAT @@ -63,6 +63,6 @@ IslandMonsB3: db 30,STARYU db 30,STARYU ENDC - + db $00 diff --git a/data/wildPokemon/seafoamislandb4.asm b/data/wildPokemon/seafoamislandb4.asm index 9596ab5b..af5c7e02 100755 --- a/data/wildPokemon/seafoamislandb4.asm +++ b/data/wildPokemon/seafoamislandb4.asm @@ -1,4 +1,4 @@ -IslandMonsB4: +IslandMonsB4: db $0A IF _RED db 31,HORSEA @@ -12,7 +12,7 @@ IslandMonsB4: db 39,SLOWBRO db 32,GOLBAT ENDC - + IF _GREEN || !_JAPAN && _BLUE db 31,KRABBY db 31,STARYU @@ -25,7 +25,7 @@ IslandMonsB4: db 39,GOLDUCK db 32,GOLBAT ENDC - + IF _JAPAN && _BLUE db 31,KRABBY db 31,STARYU @@ -38,7 +38,7 @@ IslandMonsB4: db 39,JYNX db 32,GOLBAT ENDC - + IF _YELLOW db 36,GOLBAT db 36,ZUBAT @@ -63,6 +63,6 @@ IslandMonsB4: db 30,STARYU db 30,STARYU ENDC - + db $00 diff --git a/data/wildPokemon/unknowndungeon1.asm b/data/wildPokemon/unknowndungeon1.asm index 2c23dcc8..4feb568c 100755 --- a/data/wildPokemon/unknowndungeon1.asm +++ b/data/wildPokemon/unknowndungeon1.asm @@ -1,4 +1,4 @@ -DungeonMons1: +DungeonMons1: db $0A IF !_YELLOW db 46,GOLBAT @@ -22,7 +22,7 @@ DungeonMons1: db 53,RAICHU db 53,DITTO ENDC - + IF _YELLOW db 50,GOLBAT db 55,GOLBAT @@ -35,6 +35,6 @@ DungeonMons1: db 55,DITTO db 60,DITTO ENDC - + db $00 diff --git a/data/wildPokemon/unknowndungeon2.asm b/data/wildPokemon/unknowndungeon2.asm index c3971b86..a09c985c 100755 --- a/data/wildPokemon/unknowndungeon2.asm +++ b/data/wildPokemon/unknowndungeon2.asm @@ -1,4 +1,4 @@ -DungeonMons2: +DungeonMons2: db $0F IF !_YELLOW db 51,DODRIO @@ -17,7 +17,7 @@ DungeonMons2: db 55,DITTO db 60,DITTO ENDC - + IF _YELLOW db 52,GOLBAT db 57,GOLBAT @@ -30,6 +30,6 @@ DungeonMons2: db 60,RHYDON db 58,RHYDON ENDC - + db $00 diff --git a/data/wildPokemon/unknowndungeonb1.asm b/data/wildPokemon/unknowndungeonb1.asm index 8a66d2a9..7ab1c964 100755 --- a/data/wildPokemon/unknowndungeonb1.asm +++ b/data/wildPokemon/unknowndungeonb1.asm @@ -1,4 +1,4 @@ -DungeonMonsB1: +DungeonMonsB1: db $19 IF !_YELLOW db 55,RHYDON @@ -17,7 +17,7 @@ DungeonMonsB1: db 63,DITTO db 67,DITTO ENDC - + IF _YELLOW db 54,GOLBAT db 59,GOLBAT @@ -30,6 +30,6 @@ DungeonMonsB1: db 55,LICKITUNG db 50,LICKITUNG ENDC - + db $00 diff --git a/data/wildPokemon/victoryroad1.asm b/data/wildPokemon/victoryroad1.asm index c39d1ff5..1ec65cf5 100755 --- a/data/wildPokemon/victoryroad1.asm +++ b/data/wildPokemon/victoryroad1.asm @@ -1,4 +1,4 @@ -PlateauMons1: +PlateauMons1: db $0F IF !_YELLOW db 24,MACHOP @@ -25,6 +25,6 @@ PlateauMons1: db 41,GRAVELER db 47,GRAVELER ENDC - + db $00 diff --git a/data/wildPokemon/victoryroad2.asm b/data/wildPokemon/victoryroad2.asm index 1832b83b..87159e96 100755 --- a/data/wildPokemon/victoryroad2.asm +++ b/data/wildPokemon/victoryroad2.asm @@ -1,4 +1,4 @@ -PlateauMons2: +PlateauMons2: db $0A IF !_YELLOW db 22,MACHOP @@ -12,7 +12,7 @@ PlateauMons2: db 40,MAROWAK db 43,GRAVELER ENDC - + IF _YELLOW db 31,GEODUDE db 36,GEODUDE @@ -25,6 +25,6 @@ PlateauMons2: db 39,MACHOKE db 42,MACHOKE ENDC - + db $00 diff --git a/data/wildPokemon/victoryroad3.asm b/data/wildPokemon/victoryroad3.asm index e2ebf0db..ae52eeb6 100755 --- a/data/wildPokemon/victoryroad3.asm +++ b/data/wildPokemon/victoryroad3.asm @@ -1,4 +1,4 @@ -PlateauMons3: +PlateauMons3: db $0F IF !_YELLOW db 24,MACHOP @@ -12,7 +12,7 @@ PlateauMons3: db 42,MACHOKE db 45,MACHOKE ENDC - + IF _YELLOW db 36,GEODUDE db 44,GOLBAT @@ -25,6 +25,6 @@ PlateauMons3: db 47,GRAVELER db 47,GRAVELER ENDC - + db $00 diff --git a/data/wildPokemon/viridianforest.asm b/data/wildPokemon/viridianforest.asm index e80ba681..2ca828eb 100755 --- a/data/wildPokemon/viridianforest.asm +++ b/data/wildPokemon/viridianforest.asm @@ -1,4 +1,4 @@ -ForestMons: ; +ForestMons: IF !_YELLOW db $08 IF _RED @@ -21,11 +21,11 @@ ForestMons: ; db 4,KAKUNA db 3,WEEDLE ENDC - + db 3,PIKACHU db 5,PIKACHU ENDC - + IF _YELLOW db $19 db 3,CATERPIE diff --git a/data/wildPokemon/waterpokemon.asm b/data/wildPokemon/waterpokemon.asm index b45a94d6..ef2d39ea 100755 --- a/data/wildPokemon/waterpokemon.asm +++ b/data/wildPokemon/waterpokemon.asm @@ -1,4 +1,4 @@ -WaterMons: ; +WaterMons: db $00 db $05 diff --git a/engine/HoF_room_pc.asm b/engine/HoF_room_pc.asm index aa9a9882..16a3c3f9 100755 --- a/engine/HoF_room_pc.asm +++ b/engine/HoF_room_pc.asm @@ -1,23 +1,22 @@ -HallOfFameComputer: ; 7405c (1d:405c) +HallOfFamePC: ; 7405c (1d:405c) callba AnimateHallOfFame call ClearScreen ld c, $64 call DelayFrames call DisableLCD - ld hl, $8800 - ld bc, $400 + ld hl, vFont + ld bc, $800 / 2 call Func_74171 - ld hl, $9600 - ld bc, $100 + ld hl, vChars2 + $600 + ld bc, $200 / 2 call Func_74171 - ld hl, $97e0 + ld hl, vChars2 + $7e0 ld bc, $10 ld a, $ff call FillMemory ld hl, wTileMap call Func_7417b - FuncCoord 0, 14 ; $c4b8 - ld hl, Coord + hlCoord 0, 14 call Func_7417b ld a, $c0 ld [rBGP], a ; $ff47 @@ -30,8 +29,8 @@ HallOfFameComputer: ; 7405c (1d:405c) ld c, $80 call DelayFrames xor a - ld [wWhichTrade], a ; $cd3d - ld [$cd3e], a + ld [wWhichTrade], a ; wWhichTrade + ld [wTrainerEngageDistance], a jp Credits Func_740ba: ; 740ba (1d:40ba) @@ -53,29 +52,28 @@ DisplayCreditsMon: ; 740cb (1d:40cb) call FillMiddleOfScreenWithWhite ; display the next monster from CreditsMons - ld hl,$CD3E + ld hl,wTrainerEngageDistance ld c,[hl] ; how many monsters have we displayed so far? inc [hl] ld b,0 ld hl,CreditsMons add hl,bc ; go that far in the list of monsters and get the next one ld a,[hl] - ld [$CF91],a - ld [$D0B5],a - FuncCoord 8, 6 ; $c420 - ld hl,Coord + ld [wcf91],a + ld [wd0b5],a + hlCoord 8, 6 call GetMonHeader call LoadFrontSpriteByMonIndex - ld hl,$980C + ld hl,vBGMap0 + $c call Func_74164 xor a ld [H_AUTOBGTRANSFERENABLED],a call LoadScreenTilesFromBuffer1 - ld hl,$9800 + ld hl,vBGMap0 call Func_74164 ld a,$A7 ld [$FF4B],a - ld hl,$9C00 + ld hl,vBGMap1 call Func_74164 call FillMiddleOfScreenWithWhite ld a,$FC @@ -153,8 +151,7 @@ Func_7417b: ; 7417b (1d:417b) jp FillMemory FillMiddleOfScreenWithWhite: ; 74183 (1d:4183) - FuncCoord 0, 4 ; $c3f0 - ld hl, Coord + hlCoord 0, 4 ld bc, $c8 ; 10 rows of 20 tiles each ld a, $7f ; blank white tile jp FillMemory @@ -164,8 +161,7 @@ Credits: ; 7418e (1d:418e) push de .asm_74192 pop de - FuncCoord 9, 6 ; $c421 - ld hl, Coord + hlCoord 9, 6 push hl call FillMiddleOfScreenWithWhite pop hl @@ -238,20 +234,19 @@ Credits: ; 7418e (1d:418e) call FillMiddleOfScreenWithWhite pop de ld de, TheEndGfx - ld hl, $9600 + ld hl, vChars2 + $600 ld bc, (BANK(TheEndGfx) << 8) + $0a call CopyVideoData - FuncCoord 4, 8 ; $c444 - ld hl, Coord - ld de, UnnamedText_74229 ; $4229 + hlCoord 4, 8 + ld de, TheEndTextString call PlaceString - FuncCoord 4, 9 ; $c458 - ld hl, Coord + hlCoord 4, 9 inc de call PlaceString jp Func_740ba -UnnamedText_74229: ; 74229 (1d:4229) +TheEndTextString: ; 74229 (1d:4229) +; "T H E E N D" db $60," ",$62," ",$64," ",$64," ",$66," ",$68,"@" db $61," ",$63," ",$65," ",$65," ",$67," ",$69,"@" @@ -260,4 +255,4 @@ INCLUDE "data/credits_order.asm" INCLUDE "text/credits_text.asm" TheEndGfx: ; 7473e (1d:473e) ; 473E (473F on blue) - INCBIN "gfx/theend.w40.interleave.2bpp" + INCBIN "gfx/theend.interleave.2bpp" diff --git a/engine/battle/1.asm b/engine/battle/1.asm index 91f7d3b1..04546313 100755 --- a/engine/battle/1.asm +++ b/engine/battle/1.asm @@ -1,5 +1,5 @@ DrainHPEffect_: ; 783f (1:783f) - ld hl, W_DAMAGE ; $d0d7 + ld hl, W_DAMAGE ; W_DAMAGE ld a, [hl] srl a ; divide damage by 2 ld [hli], a @@ -11,13 +11,13 @@ DrainHPEffect_: ; 783f (1:783f) inc hl inc [hl] .asm_784f - ld hl, W_PLAYERMONCURHP ; $d015 - ld de, W_PLAYERMONMAXHP ; $d023 + ld hl, wBattleMonHP ; wd015 + ld de, wBattleMonMaxHP ; wd023 ld a, [H_WHOSETURN] ; $fff3 and a jp z, Func_7861 - ld hl, W_ENEMYMONCURHP ; $cfe6 - ld de, W_ENEMYMONMAXHP ; $cff4 + ld hl, wEnemyMonHP ; wEnemyMonHP + ld de, wEnemyMonMaxHP ; wEnemyMonMaxHP Func_7861: ; 7861 (1:7861) ld bc, wHPBarOldHP+1 @@ -33,12 +33,12 @@ Func_7861: ; 7861 (1:7861) ld a, [de] dec bc ld [bc], a - ld a, [$d0d8] + ld a, [wd0d8] ld b, [hl] add b ld [hld], a ld [wHPBarNewHP], a - ld a, [W_DAMAGE] ; $d0d7 + ld a, [W_DAMAGE] ; W_DAMAGE ld b, [hl] adc b ld [hli], a @@ -67,28 +67,23 @@ Func_7861: ; 7861 (1:7861) .asm_789c ld a, [H_WHOSETURN] ; $fff3 and a - FuncCoord 10, 9 ; $c45e - ld hl, Coord + hlCoord 10, 9 ld a, $1 jr z, .asm_78aa - FuncCoord 2, 2 ; $c3ca - ld hl, Coord + hlCoord 2, 2 xor a .asm_78aa - ld [wListMenuID], a ; $cf94 - ld a, $48 - call Predef ; indirect jump to UpdateHPBar (fa1d (3:7a1d)) - ld a, $0 - call Predef ; indirect jump to Func_3cd60 (3cd60 (f:4d60)) - ld a, $49 - call Predef ; indirect jump to Func_3cdec (3cdec (f:4dec)) + ld [wListMenuID], a ; wListMenuID + predef UpdateHPBar2 + predef Func_3cd60 + predef Func_3cdec callab ReadPlayerMonCurHPAndStatus ld hl, SuckedHealthText ; $78dc ld a, [H_WHOSETURN] ; $fff3 and a - ld a, [W_PLAYERMOVEEFFECT] ; $cfd3 + ld a, [W_PLAYERMOVEEFFECT] ; wcfd3 jr z, .asm_78d2 - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT .asm_78d2 cp DREAM_EATER_EFFECT jr nz, .asm_78d9 diff --git a/engine/battle/14.asm b/engine/battle/14.asm index 209135af..01d115a6 100755 --- a/engine/battle/14.asm +++ b/engine/battle/14.asm @@ -1,52 +1,52 @@ Func_525af: ; 525af (14:65af) ld a, [$ffd7] - ld [$d0d4], a + ld [wd0d4], a xor a - ld [$cd6a], a - ld [$cf0b], a - ld hl, $cc2b + ld [wcd6a], a + ld [wcf0b], a + ld hl, wcc2b ld [hli], a ld [hli], a ld [hli], a ld [hl], a - ld [wListScrollOffset], a ; $cc36 - ld [$d05e], a - ld [W_PLAYERMONID], a - ld [W_PLAYERMONSALIVEFLAGS], a - ld [wPlayerMonNumber], a ; $cc2f - ld [$d078], a - ld [$d35d], a - ld hl, $cf1d + ld [wListScrollOffset], a ; wcc36 + ld [wd05e], a + ld [wBattleMonSpecies], a + ld [wPartyAliveFlags], a + ld [wPlayerMonNumber], a ; wPlayerMonNumber + ld [wd078], a + ld [wd35d], a + ld hl, wcf1d ld [hli], a ld [hl], a - ld hl, $ccd3 + ld hl, wccd3 ld b, $3c .asm_525e1 ld [hli], a dec b jr nz, .asm_525e1 inc a - ld [$ccd9], a - ld a, [W_CURMAP] ; $d35e + ld [wccd9], a + ld a, [W_CURMAP] ; W_CURMAP cp SAFARI_ZONE_EAST jr c, .asm_525f9 cp SAFARI_ZONE_REST_HOUSE_1 jr nc, .asm_525f9 ld a, $2 - ld [W_BATTLETYPE], a ; $d05a + ld [W_BATTLETYPE], a ; wd05a .asm_525f9 ld hl, PlayBattleMusic ld b, BANK(PlayBattleMusic) jp Bankswitch ParalyzeEffect_: ; 52601 (14:6601) - ld hl, W_ENEMYMONSTATUS ; $cfe9 - ld de, W_PLAYERMOVETYPE ; $cfd5 + ld hl, wEnemyMonStatus ; wcfe9 + ld de, W_PLAYERMOVETYPE ; wcfd5 ld a, [H_WHOSETURN] ; $fff3 and a jp z, .asm_52613 - ld hl, W_PLAYERMONSTATUS ; $d018 - ld de, W_ENEMYMOVETYPE ; $cfcf + ld hl, wBattleMonStatus ; wBattleMonStatus + ld de, W_ENEMYMOVETYPE ; wcfcf .asm_52613 ld a, [hl] @@ -69,7 +69,7 @@ ParalyzeEffect_: ; 52601 (14:6601) push hl callab MoveHitTest pop hl - ld a, [W_MOVEMISSED] ; $d05f + ld a, [W_MOVEMISSED] ; W_MOVEMISSED and a jr nz, .asm_52659 set 6, [hl] diff --git a/engine/battle/15.asm b/engine/battle/15.asm index d2e93ab1..69d8ff3f 100755 --- a/engine/battle/15.asm +++ b/engine/battle/15.asm @@ -1,11 +1,11 @@ GainExperience: ; 5524f (15:524f) - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] cp $4 ret z call Func_5546c - ld hl, W_PARTYMON1_NUM ; $d16b (aliases: W_PARTYMON1DATA) + ld hl, wPartyMons xor a - ld [wWhichPokemon], a ; $cf92 + ld [wWhichPokemon], a Func_5525f: ; 5525f (15:525f) inc hl @@ -13,12 +13,11 @@ Func_5525f: ; 5525f (15:525f) or [hl] jp z, Func_55436 push hl - ld hl, W_PLAYERMONSALIVEFLAGS - ld a, [wWhichPokemon] ; $cf92 + ld hl, wPartyAliveFlags + ld a, [wWhichPokemon] ld c, a ld b, $2 - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + predef FlagActionPredef ld a, c and a pop hl @@ -27,7 +26,7 @@ Func_5525f: ; 5525f (15:525f) add hl, de ld d, h ld e, l - ld hl, $d002 + ld hl, wd002 ld c, $5 .asm_55285 ld a, [hli] @@ -56,26 +55,26 @@ Func_5525f: ; 5525f (15:525f) jr .asm_55285 .asm_552a1 xor a - ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND) - ld [$ff97], a - ld a, [$d008] - ld [$ff98], a - ld a, [W_ENEMYMONLEVEL] ; $cff3 - ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN) + ld [H_MULTIPLICAND], a + ld [H_MULTIPLICAND + 1], a + ld a, [wd008] + ld [H_MULTIPLICAND + 2], a + ld a, [wEnemyMonLevel] + ld [H_MULTIPLIER], a call Multiply - ld a, $7 - ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN) - ld b, $4 + ld a, 7 + ld [H_DIVISOR], a + ld b, 4 call Divide ld hl, $fff2 add hl, de ld b, [hl] inc hl - ld a, [wPlayerID] ; $d359 + ld a, [wPlayerID] cp b jr nz, .asm_552d1 ld b, [hl] - ld a, [wPlayerID + 1] ; $d35a + ld a, [wPlayerID + 1] cp b ld a, $0 jr z, .asm_552d6 @@ -83,8 +82,8 @@ Func_5525f: ; 5525f (15:525f) call Func_5549f ld a, $1 .asm_552d6 - ld [$cf4d], a - ld a, [W_ISINBATTLE] ; $d057 + ld [wcf4d], a + ld a, [W_ISINBATTLE] dec a call nz, Func_5549f inc hl @@ -92,12 +91,12 @@ Func_5525f: ; 5525f (15:525f) inc hl ld b, [hl] ld a, [$ff98] - ld [$cf4c], a + ld [wcf4c], a add b ld [hld], a ld b, [hl] ld a, [$ff97] - ld [$cf4b], a + ld [wcf4b], a adc b ld [hl], a jr nc, .asm_552f8 @@ -107,17 +106,17 @@ Func_5525f: ; 5525f (15:525f) .asm_552f8 inc hl push hl - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ld c, a - ld b, $0 - ld hl, W_PARTYMON1 ; $d164 + ld b, 0 + ld hl, wPartySpecies add hl, bc ld a, [hl] - ld [$d0b5], a + ld [wd0b5], a call GetMonHeader - ld d, $64 + ld d, MAX_LEVEL callab CalcExperience - ld a, [H_NUMTOPRINT] ; $ff96 (aliases: H_MULTIPLICAND) + ld a, [$ff96] ld b, a ld a, [$ff97] ld c, a @@ -140,13 +139,13 @@ Func_5525f: ; 5525f (15:525f) dec hl .asm_5532e push hl - ld a, [wWhichPokemon] ; $cf92 - ld hl, W_PARTYMON1NAME ; $d2b5 + ld a, [wWhichPokemon] + ld hl, wPartyMonNicks call GetPartyMonName ld hl, GainedText call PrintText xor a - ld [$cc49], a + ld [wcc49], a call LoadMonData pop hl ld bc, $13 @@ -157,17 +156,17 @@ Func_5525f: ; 5525f (15:525f) ld a, [hl] cp d jp z, Func_55436 - ld a, [W_CURENEMYLVL] ; $d127 + ld a, [W_CURENEMYLVL] push af push hl ld a, d - ld [W_CURENEMYLVL], a ; $d127 + ld [W_CURENEMYLVL], a ld [hl], a ld bc, $ffdf add hl, bc ld a, [hl] - ld [$d0b5], a - ld [$d11e], a + ld [wd0b5], a + ld [wd11e], a call GetMonHeader ld bc, $23 add hl, bc @@ -198,12 +197,12 @@ Func_5525f: ; 5525f (15:525f) ld a, [hl] adc b ld [hl], a - ld a, [wPlayerMonNumber] ; $cc2f + ld a, [wPlayerMonNumber] ld b, a - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] cp b jr nz, .asm_553f7 - ld de, W_PLAYERMONCURHP ; $d015 + ld de, wBattleMonHP ld a, [hli] ld [de], a inc de @@ -212,19 +211,19 @@ Func_5525f: ; 5525f (15:525f) ld bc, $1f add hl, bc push hl - ld de, W_PLAYERMONLEVEL ; $d022 + ld de, wBattleMonLevel ; wBattleMonLevel ld bc, $b call CopyData pop hl - ld a, [W_PLAYERBATTSTATUS3] ; $d064 + ld a, [W_PLAYERBATTSTATUS3] ; W_PLAYERBATTSTATUS3 bit 3, a jr nz, .asm_553c8 - ld de, $cd0f + ld de, wcd0f ld bc, $b call CopyData .asm_553c8 xor a - ld [$d11e], a + ld [wd11e], a callab Func_3ed99 callab Func_3ed1a callab Func_3ee19 @@ -235,59 +234,55 @@ Func_5525f: ; 5525f (15:525f) ld hl, GrewLevelText call PrintText xor a - ld [$cc49], a + ld [wcc49], a call LoadMonData ld d, $1 callab PrintStatsBox call WaitForTextScrollButtonPress call LoadScreenTilesFromBuffer1 xor a - ld [$cc49], a - ld a, [$d0b5] - ld [$d11e], a - ld a, $1a - call Predef ; indirect jump to Func_3af5b (3af5b (e:6f5b)) - ld hl, $ccd3 - ld a, [wWhichPokemon] ; $cf92 + ld [wcc49], a + ld a, [wd0b5] + ld [wd11e], a + predef Func_3af5b + ld hl, wccd3 + ld a, [wWhichPokemon] ; wWhichPokemon ld c, a ld b, $1 - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + predef FlagActionPredef pop hl pop af - ld [W_CURENEMYLVL], a ; $d127 + ld [W_CURENEMYLVL], a ; W_CURENEMYLVL Func_55436: ; 55436 (15:5436) - ld a, [W_NUMINPARTY] ; $d163 + ld a, [wPartyCount] ; wPartyCount ld b, a - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon inc a cp b jr z, .asm_55450 - ld [wWhichPokemon], a ; $cf92 + ld [wWhichPokemon], a ; wWhichPokemon ld bc, $2c - ld hl, W_PARTYMON1_NUM ; $d16b (aliases: W_PARTYMON1DATA) + ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1) call AddNTimes jp Func_5525f .asm_55450 - ld hl, W_PLAYERMONSALIVEFLAGS + ld hl, wPartyAliveFlags xor a ld [hl], a - ld a, [wPlayerMonNumber] ; $cc2f + ld a, [wPlayerMonNumber] ; wPlayerMonNumber ld c, a ld b, $1 push bc - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) - ld hl, $ccf5 + predef FlagActionPredef + ld hl, wccf5 xor a ld [hl], a pop bc - ld a, $10 - jp Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + predef_jump FlagActionPredef Func_5546c: ; 5546c (15:546c) - ld a, [W_PLAYERMONSALIVEFLAGS] + ld a, [wPartyAliveFlags] ld b, a xor a ld c, $8 @@ -301,15 +296,15 @@ Func_5546c: ; 5546c (15:546c) jr nz, .asm_55475 cp $2 ret c - ld [$d11e], a - ld hl, $d002 + ld [wd11e], a + ld hl, wd002 ld c, $7 .asm_55488 xor a ld [H_DIVIDEND], a ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT) ld a, [hl] ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND) - ld a, [$d11e] + ld a, [wd11e] ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN) ld b, $2 call Divide @@ -336,12 +331,12 @@ Func_5549f: ; 5549f (15:549f) GainedText: ; 554b2 (15:54b2) TX_FAR _GainedText db $08 ; asm - ld a, [$cc5b] + ld a, [wcc5b] ld hl, WithExpAllText and a ret nz ld hl, ExpPointsText - ld a, [$cf4d] + ld a, [wcf4d] and a ret z ld hl, BoostedText diff --git a/engine/battle/16.asm b/engine/battle/16.asm index f2f4ada9..1500d003 100755 --- a/engine/battle/16.asm +++ b/engine/battle/16.asm @@ -1,17 +1,17 @@ PrintBeginningBattleText: ; 58d99 (16:4d99) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE dec a jr nz, .trainerBattle - ld a, [W_CURMAP] ; $d35e + ld a, [W_CURMAP] ; W_CURMAP cp POKEMONTOWER_3 jr c, .notPokemonTower cp LAVENDER_HOUSE_1 jr c, .pokemonTower .notPokemonTower - ld a, [W_ENEMYMONID] + ld a, [wEnemyMonSpecies2] call PlayCry ld hl, WildMonAppearedText - ld a, [W_MOVEMISSED] ; $d05f + ld a, [W_MOVEMISSED] ; W_MOVEMISSED and a jr z, .notFishing ld hl, HookedMonAttackedText @@ -31,8 +31,8 @@ PrintBeginningBattleText: ; 58d99 (16:4d99) .pokemonTower ld b, SILPH_SCOPE call IsItemInBag - ld a, [W_ENEMYMONID] - ld [$cf91], a + ld a, [wEnemyMonSpecies2] + ld [wcf91], a cp MAROWAK jr z, .isMarowak ld a, b @@ -61,9 +61,9 @@ PrintBeginningBattleText: ; 58d99 (16:4d99) .playSFX xor a - ld [$c0f1], a + ld [wc0f1], a ld a, $80 - ld [$c0f2], a + ld [wc0f2], a ld a, (SFX_08_77 - SFX_Headers_08) / 3 call PlaySound jp WaitForSoundToFinish @@ -95,24 +95,24 @@ GhostCantBeIDdText: ; 58e54 (16:4e54) db "@" SendOutMon: ; 58e59 (16:4e59) - ld hl, W_ENEMYMONCURHP ; $cfe6 + ld hl, wEnemyMonHP ; wEnemyMonHP ld a, [hli] or [hl] ld hl, GoText jr z, .printText xor a ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND) - ld hl, W_ENEMYMONCURHP ; $cfe6 + ld hl, wEnemyMonHP ; wEnemyMonHP ld a, [hli] - ld [$cce3], a + ld [wcce3], a ld [$ff97], a ld a, [hl] - ld [$cce4], a + ld [wcce4], a ld [$ff98], a ld a, $19 ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN) call Multiply - ld hl, W_ENEMYMONMAXHP ; $cff4 + ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP ld a, [hli] ld b, [hl] srl a @@ -173,8 +173,8 @@ PlayerMon2Text: ; 58ed7 (16:4ed7) db $08 ; asm push de push bc - ld hl, $cfe7 - ld de, $cce4 + ld hl, wEnemyMonHP + 1 + ld de, wcce4 ld b, [hl] dec hl ld a, [de] @@ -188,7 +188,7 @@ PlayerMon2Text: ; 58ed7 (16:4ed7) ld a, $19 ld [H_POWEROFTEN], a call Multiply - ld hl, W_ENEMYMONMAXHP + ld hl, wEnemyMonMaxHP ld a, [hli] ld b, [hl] srl a diff --git a/engine/battle/1a.asm b/engine/battle/1a.asm index 2770a459..6b502a31 100755 --- a/engine/battle/1a.asm +++ b/engine/battle/1a.asm @@ -11,10 +11,10 @@ DecrementPP: ; 68000 (1a:4000) ret nz ; if any of these statuses are true, don't decrement PP bit 6, [hl] ; check 6th bit status flag on W_PLAYERBATTSTATUS2 ret nz ; and return if it is set - ld hl, $D02D ; PP of first move (in battle) + ld hl, wBattleMonPP ; PP of first move (in battle) call .DecrementPP - ld a, [$D064] ; load pokemon status bits? + ld a, [W_PLAYERBATTSTATUS3] ; load pokemon status bits? bit 3, a ; XXX transform status? ret nz ; If it is, return. Pokemon Red stores the "current pokemon's" PP ; separately from the "Pokemon in your party's" PP. This is @@ -26,12 +26,12 @@ DecrementPP: ; 68000 (1a:4000) ; its opponent, which is *not* the same as its real PP as part of your ; party. So we return, and don't do that part. - ld hl, $D188 ; PP of first move (in party) - ld a, [$CC2F] ; which mon in party is active + ld hl, wPartyMon1PP ; PP of first move (in party) + ld a, [wPlayerMonNumber] ; which mon in party is active ld bc, $2C ; XXX probably size of party pokemon's data structure call AddNTimes ; calculate address of the mon to modify .DecrementPP - ld a, [$CC2E] ; which move (0, 1, 2, 3) did we use? + ld a, [wPlayerMoveListIndex] ; which move (0, 1, 2, 3) did we use? ld c, a ld b, 0 add hl ,bc ; calculate the address in memory of the PP we need to decrement diff --git a/engine/battle/1c.asm b/engine/battle/1c.asm index 1f07807a..b3b24007 100755 --- a/engine/battle/1c.asm +++ b/engine/battle/1c.asm @@ -2,15 +2,14 @@ Func_708ca: ; 708ca (1c:48ca) ld a, $e4 ld [rOBP1], a ; $ff49 call Func_7092a - FuncCoord 12, 0 ; $c3ac - ld hl, Coord + hlCoord 12, 0 ld bc, $707 call ClearScreenArea call Delay3 xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld a, $91 - ld [$cee9], a + ld [wHPBarMaxHP], a ld a, $1 ld [H_WHOSETURN], a ; $fff3 callab Func_79793 @@ -24,7 +23,7 @@ Func_708ca: ; 708ca (1c:48ca) sla a ld [rOBP1], a ; $ff49 jr nz, .asm_708f6 - call CleanLCD_OAM + call ClearSprites call Func_7092a ld b, $e4 .asm_7090d @@ -42,30 +41,30 @@ Func_708ca: ; 708ca (1c:48ca) ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba call Delay3 - jp CleanLCD_OAM + jp ClearSprites Func_7092a: ; 7092a (1c:492a) - ld de, $9000 - ld hl, $8000 - ld bc, $31 + ld de, vFrontPic + ld hl, vSprites + ld bc, 7 * 7 call CopyVideoData ld a, $10 - ld [W_BASECOORDY], a ; $d082 + ld [W_BASECOORDY], a ; wd082 ld a, $70 - ld [W_BASECOORDX], a ; $d081 + ld [W_BASECOORDX], a ; wd081 ld hl, wOAMBuffer ld bc, $606 ld d, $8 .asm_70948 push bc - ld a, [W_BASECOORDY] ; $d082 + ld a, [W_BASECOORDY] ; wd082 ld e, a .asm_7094d ld a, e add $8 ld e, a ld [hli], a - ld a, [W_BASECOORDX] ; $d081 + ld a, [W_BASECOORDX] ; wd081 ld [hli], a ld a, d ld [hli], a @@ -75,44 +74,44 @@ Func_7092a: ; 7092a (1c:492a) dec c jr nz, .asm_7094d inc d - ld a, [W_BASECOORDX] ; $d081 + ld a, [W_BASECOORDX] ; wd081 add $8 - ld [W_BASECOORDX], a ; $d081 + ld [W_BASECOORDX], a ; wd081 pop bc dec b jr nz, .asm_70948 ret -Func_7096d: ; 7096d (1c:496d) +BattleTransition: ; 7096d (1c:496d) ld a, $1 - ld [H_AUTOBGTRANSFERENABLED], a ; $ffba + ld [H_AUTOBGTRANSFERENABLED], a call Delay3 xor a ld [$ffb0], a dec a - ld [$cfcb], a + ld [wcfcb], a call DelayFrame - ld hl, $c102 - ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c + ld hl, wSpriteStateData1 + 2 + ld a, [H_DOWNARROWBLINKCNT2] ld c, a ld b, $0 ld de, $10 -.asm_70989 +.loop1 ld a, [hl] cp $ff - jr z, .asm_7098f + jr z, .skip1 inc b -.asm_7098f +.skip1 add hl, de dec c - jr nz, .asm_70989 - ld hl, $c310 + jr nz, .loop1 + ld hl, wOAMBuffer + $10 ld c, $9 -.asm_70998 +.loop2 ld a, b swap a cp l - jr z, .asm_709a9 + jr z, .skip2 push hl push bc ld bc, $10 @@ -120,22 +119,22 @@ Func_7096d: ; 7096d (1c:496d) call FillMemory pop bc pop hl -.asm_709a9 +.skip2 ld de, $10 add hl, de dec c - jr nz, .asm_70998 + jr nz, .loop2 call Delay3 call LoadBattleTransitionTile ld bc, $0 - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] cp $4 - jr z, .asm_709c9 - call Func_709e2 - call Func_709ef - call Func_70a19 -.asm_709c9 - ld hl, PointerTable_709d2 ; $49d2 + jr z, .linkBattle + call GetBattleTransitionID_WildOrTrainer + call GetBattleTransitionID_CompareLevels + call GetBattleTransitionID_IsDungeonMap +.linkBattle + ld hl, BattleTransitions add hl, bc add hl, bc ld a, [hli] @@ -143,94 +142,105 @@ Func_7096d: ; 7096d (1c:496d) ld l, a jp [hl] -PointerTable_709d2: ; 709d2 (1c:49d2) - dw Func_70d24 - dw Func_70a72 - dw Func_70ce4 - dw Func_70a72 - dw Func_70cb4 - dw Func_70b7f - dw Func_70c7e - dw Func_70bca - -Func_709e2: ; 709e2 (1c:49e2) - ld a, [W_CUROPPONENT] ; $d059 +; the three GetBattleTransitionID functions set the first +; three bits of c, which determines what transition animation +; to play at the beginning of a battle +; bit 0: set if trainer battle +; bit 1: set if enemy is at least 3 levels higher than player +; bit 2: set if dungeon map +BattleTransitions: ; 709d2 (1c:49d2) + dw BattleTransition_DoubleCircle ; %000 + dw BattleTransition_Spiral ; %001 + dw BattleTransition_Circle ; %010 + dw BattleTransition_Spiral ; %011 + dw BattleTransition_HorizontalStripes ; %100 + dw BattleTransition_Shrink ; %101 + dw BattleTransition_VerticalStripes ; %110 + dw BattleTransition_Split ; %111 + +GetBattleTransitionID_WildOrTrainer: ; 709e2 (1c:49e2) + ld a, [W_CUROPPONENT] cp $c8 - jr nc, .asm_709ec + jr nc, .trainer res 0, c ret -.asm_709ec +.trainer set 0, c ret -Func_709ef: ; 709ef (1c:49ef) - ld hl, W_PARTYMON1_HP ; $d16c -.asm_709f2 +GetBattleTransitionID_CompareLevels: ; 709ef (1c:49ef) + ld hl, wPartyMon1HP +.faintedLoop ld a, [hli] or [hl] - jr nz, .asm_709fc - ld de, $2b + jr nz, .notFainted + ld de, wPartyMon2 - (wPartyMon1 + 1) add hl, de - jr .asm_709f2 -.asm_709fc - ld de, $1f + jr .faintedLoop +.notFainted + ld de, wPartyMon1Level - (wPartyMon1HP + 1) add hl, de ld a, [hl] add $3 ld e, a - ld a, [W_CURENEMYLVL] ; $d127 + ld a, [W_CURENEMYLVL] sub e - jr nc, .asm_70a12 + jr nc, .highLevelEnemy res 1, c ld a, $1 - ld [$cd47], a + ld [wcd47], a ret -.asm_70a12 +.highLevelEnemy set 1, c xor a - ld [$cd47], a + ld [wcd47], a ret -Func_70a19: ; 70a19 (1c:4a19) - ld a, [W_CURMAP] ; $d35e +; fails to recognize VICTORY_ROAD_2, VICTORY_ROAD_3, all ROCKET_HIDEOUT maps, +; MANSION_1, SEAFOAM_ISLANDS_[2-5], POWER_PLANT, DIGLETTS_CAVE +; and SILPH_CO_[9-11]F as dungeon maps +GetBattleTransitionID_IsDungeonMap: ; 70a19 (1c:4a19) + ld a, [W_CURMAP] ld e, a - ld hl, MapIDList_70a3f ; $4a3f -.asm_70a20 + ld hl, DungeonMaps1 +.loop1 ld a, [hli] cp $ff - jr z, .asm_70a2b + jr z, .noMatch1 cp e - jr nz, .asm_70a20 -.asm_70a28 + jr nz, .loop1 +.match set 2, c ret -.asm_70a2b - ld hl, MapIDList_70a44 ; $4a44 -.asm_70a2e +.noMatch1 + ld hl, DungeonMaps2 +.loop2 ld a, [hli] cp $ff - jr z, .asm_70a3c + jr z, .noMatch2 ld d, a ld a, [hli] cp e - jr c, .asm_70a2e + jr c, .loop2 ld a, e cp d - jr nc, .asm_70a28 -.asm_70a3c + jr nc, .match +.noMatch2 res 2, c ret -; Func_70a19 checks if W_CURMAP is equal to one of these maps -MapIDList_70a3f: ; 70a3f (1c:4a3f) +; GetBattleTransitionID_IsDungeonMap checks if W_CURMAP +; is equal to one of these maps +DungeonMaps1: ; 70a3f (1c:4a3f) db VIRIDIAN_FOREST db ROCK_TUNNEL_1 db SEAFOAM_ISLANDS_1 db ROCK_TUNNEL_2 db $FF -; Func_70a19 checks if W_CURMAP is in between or equal to each pair of maps -MapIDList_70a44: ; 70a44 (1c:4a44) +; GetBattleTransitionID_IsDungeonMap checks if W_CURMAP +; is in between or equal to each pair of maps +DungeonMaps2: ; 70a44 (1c:4a44) ; all MT_MOON maps db MT_MOON_1 db MT_MOON_3 @@ -243,282 +253,274 @@ MapIDList_70a44: ; 70a44 (1c:4a44) db LAVENDER_POKECENTER db LAVENDER_HOUSE_2 - ; all SILPH_CO, MANSION, SAFARI_ZONE, and UNKNOWN_DUNGEON maps, + ; SILPH_CO_[2-8]F, MANSION[2-4], SAFARI_ZONE, and UNKNOWN_DUNGEON maps, ; except for SILPH_CO_1F db SILPH_CO_2F db UNKNOWN_DUNGEON_1 db $FF LoadBattleTransitionTile: ; 70a4d (1c:4a4d) - ld hl, $8ff0 - ld de, BattleTransitionTile ; $4a59 + ld hl, vChars1 + $7f0 + ld de, BattleTransitionTile ld bc, (BANK(BattleTransitionTile) << 8) + $01 jp CopyVideoData BattleTransitionTile: ; 70a59 (1c:4a59) INCBIN "gfx/battle_transition.2bpp" -Func_70a69: ; 70a69 (1c:4a69) +BattleTransition_BlackScreen: ; 70a69 (1c:4a69) ld a, $ff ld [rBGP], a ; $ff47 ld [rOBP0], a ; $ff48 ld [rOBP1], a ; $ff49 ret -Func_70a72: ; 70a72 (1c:4a72) - ld a, [$cd47] +; for non-dungeon trainer battles +; called regardless of mon levels, but does an +; outward spiral if enemy is at least 3 levels +; higher than player and does an inward spiral otherwise +BattleTransition_Spiral: ; 70a72 (1c:4a72) + ld a, [wcd47] and a - jr z, .asm_70a7d - call Func_70aaa - jr .asm_70a9f -.asm_70a7d - FuncCoord 10, 10 ; $c472 - ld hl, Coord + jr z, .outwardSpiral + call BattleTransition_InwardSpiral + jr .done +.outwardSpiral + hlCoord 10, 10 ld a, $3 - ld [$d09f], a + ld [wd09f], a ld a, l - ld [$d09b], a + ld [wd09b], a ld a, h - ld [$d09a], a + ld [wd09a], a ld b, $78 -.asm_70a8f +.loop1 ld c, $3 -.asm_70a91 +.loop2 push bc - call Func_70af9 + call BattleTransition_OutwardSpiral_ pop bc dec c - jr nz, .asm_70a91 + jr nz, .loop2 call DelayFrame dec b - jr nz, .asm_70a8f -.asm_70a9f - call Func_70a69 + jr nz, .loop1 +.done + call BattleTransition_BlackScreen xor a - ld [$d09b], a - ld [$d09a], a + ld [wd09b], a + ld [wd09a], a ret -Func_70aaa: ; 70aaa (1c:4aaa) +BattleTransition_InwardSpiral: ; 70aaa (1c:4aaa) ld a, $7 - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ld hl, wTileMap ld c, $11 ld de, $14 - call Func_70ae0 + call BattleTransition_InwardSpiral_ inc c - jr .asm_70ac3 -.asm_70abd + jr .skip +.loop ld de, $14 - call Func_70ae0 -.asm_70ac3 + call BattleTransition_InwardSpiral_ +.skip inc c ld de, $1 - call Func_70ae0 + call BattleTransition_InwardSpiral_ dec c dec c ld de, $ffec - call Func_70ae0 + call BattleTransition_InwardSpiral_ inc c - ld de, rIE ; $ffff - call Func_70ae0 + ld de, rIE + call BattleTransition_InwardSpiral_ dec c dec c ld a, c and a - jr nz, .asm_70abd + jr nz, .loop ret -Func_70ae0: ; 70ae0 (1c:4ae0) +BattleTransition_InwardSpiral_: ; 70ae0 (1c:4ae0) push bc -.asm_70ae1 +.loop ld [hl], $ff add hl, de push bc - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] dec a - jr nz, .asm_70af0 - call Func_70d19 + jr nz, .skip + call BattleTransition_TransferDelay3 ld a, $7 -.asm_70af0 - ld [wWhichTrade], a ; $cd3d +.skip + ld [wWhichTrade], a pop bc dec c - jr nz, .asm_70ae1 + jr nz, .loop pop bc ret -Func_70af9: ; 70af9 (1c:4af9) +BattleTransition_OutwardSpiral_: ; 70af9 (1c:4af9) ld bc, $ffec ld de, $14 - ld a, [$d09b] + ld a, [wd09b] ld l, a - ld a, [$d09a] + ld a, [wd09a] ld h, a - ld a, [$d09f] + ld a, [wd09f] cp $0 - jr z, .asm_70b25 + jr z, .zero cp $1 - jr z, .asm_70b2f + jr z, .one cp $2 - jr z, .asm_70b39 + jr z, .two cp $3 - jr z, .asm_70b43 -.asm_70b1a + jr z, .three +.done1 ld [hl], $ff -.asm_70b1c +.done2_ ld a, l - ld [$d09b], a + ld [wd09b], a ld a, h - ld [$d09a], a + ld [wd09a], a ret -.asm_70b25 +.zero dec hl ld a, [hl] cp $ff - jr nz, .asm_70b4d + jr nz, .done2 inc hl add hl, bc - jr .asm_70b1a -.asm_70b2f + jr .done1 +.one add hl, de ld a, [hl] cp $ff - jr nz, .asm_70b4d + jr nz, .done2 add hl, bc dec hl - jr .asm_70b1a -.asm_70b39 + jr .done1 +.two inc hl ld a, [hl] cp $ff - jr nz, .asm_70b4d + jr nz, .done2 dec hl add hl, de - jr .asm_70b1a -.asm_70b43 + jr .done1 +.three add hl, bc ld a, [hl] cp $ff - jr nz, .asm_70b4d + jr nz, .done2 add hl, de inc hl - jr .asm_70b1a -.asm_70b4d + jr .done1 +.done2 ld [hl], $ff - ld a, [$d09f] + ld a, [wd09f] inc a cp $4 - jr nz, .asm_70b58 + jr nz, .skip xor a -.asm_70b58 - ld [$d09f], a - jr .asm_70b1c - -Func_70b5d: ; 70b5d (1c:4b5d) - ld hl, DataTable_70b72 ; $4b72 -.asm_70b60 +.skip + ld [wd09f], a + jr .done2_ + +FlashScreen: +BattleTransition_FlashScreen_: ; 70b5d (1c:4b5d) + ld hl, BattleTransition_FlashScreenPalettes +.loop ld a, [hli] cp $1 - jr z, .asm_70b6e - ld [rBGP], a ; $ff47 + jr z, .done + ld [rBGP], a ld c, $2 call DelayFrames - jr .asm_70b60 -.asm_70b6e + jr .loop +.done dec b - jr nz, Func_70b5d + jr nz, BattleTransition_FlashScreen_ ret -DataTable_70b72: ; 70b72 (1c:4b72) +BattleTransition_FlashScreenPalettes: ; 70b72 (1c:4b72) db $F9,$FE,$FF,$FE,$F9,$E4,$90,$40,$00,$40,$90,$E4 db $01 ; terminator -Func_70b7f: ; 70b7f (1c:4b7f) +; used for low level trainer dungeon battles +BattleTransition_Shrink: ; 70b7f (1c:4b7f) ld c, $9 -.asm_70b81 +.loop push bc xor a - ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - FuncCoord 0, 7 ; $c42c - ld hl, Coord - FuncCoord 0, 8 ; $c440 - ld de, Coord + ld [H_AUTOBGTRANSFERENABLED], a + hlCoord 0, 7 + deCoord 0, 8 ld bc, $ffd8 - call Func_70c12 - FuncCoord 0, 10 ; $c468 - ld hl, Coord - FuncCoord 0, 9 ; $c454 - ld de, Coord + call BattleTransition_CopyTiles1 + hlCoord 0, 10 + deCoord 0, 9 ld bc, $28 - call Func_70c12 - FuncCoord 8, 0 ; $c3a8 - ld hl, Coord - FuncCoord 9, 0 ; $c3a9 - ld de, Coord + call BattleTransition_CopyTiles1 + hlCoord 8, 0 + deCoord 9, 0 ld bc, $fffe - call Func_70c3f - FuncCoord 11, 0 ; $c3ab - ld hl, Coord - FuncCoord 10, 0 ; $c3aa - ld de, Coord + call BattleTransition_CopyTiles2 + hlCoord 11, 0 + deCoord 10, 0 ld bc, $2 - call Func_70c3f + call BattleTransition_CopyTiles2 ld a, $1 - ld [H_AUTOBGTRANSFERENABLED], a ; $ffba + ld [H_AUTOBGTRANSFERENABLED], a ld c, $6 call DelayFrames pop bc dec c - jr nz, .asm_70b81 - call Func_70a69 + jr nz, .loop + call BattleTransition_BlackScreen ld c, $a jp DelayFrames -Func_70bca: ; 70bca (1c:4bca) +; used for high level trainer dungeon battles +BattleTransition_Split: ; 70bca (1c:4bca) ld c, $9 xor a - ld [H_AUTOBGTRANSFERENABLED], a ; $ffba -.asm_70bcf + ld [H_AUTOBGTRANSFERENABLED], a +.loop push bc - FuncCoord 0, 16 ; $c4e0 - ld hl, Coord - FuncCoord 0, 17 ; $c4f4 - ld de, Coord + hlCoord 0, 16 + deCoord 0, 17 ld bc, $ffd8 - call Func_70c12 - FuncCoord 0, 1 ; $c3b4 - ld hl, Coord + call BattleTransition_CopyTiles1 + hlCoord 0, 1 ld de, wTileMap ld bc, $28 - call Func_70c12 - FuncCoord 18, 0 ; $c3b2 - ld hl, Coord - FuncCoord 19, 0 ; $c3b3 - ld de, Coord + call BattleTransition_CopyTiles1 + hlCoord 18, 0 + deCoord 19, 0 ld bc, $fffe - call Func_70c3f - FuncCoord 1, 0 ; $c3a1 - ld hl, Coord + call BattleTransition_CopyTiles2 + hlCoord 1, 0 ld de, wTileMap ld bc, $2 - call Func_70c3f - call Func_70d19 + call BattleTransition_CopyTiles2 + call BattleTransition_TransferDelay3 call Delay3 pop bc dec c - jr nz, .asm_70bcf - call Func_70a69 + jr nz, .loop + call BattleTransition_BlackScreen ld c, $a jp DelayFrames -Func_70c12: ; 70c12 (1c:4c12) +BattleTransition_CopyTiles1: ; 70c12 (1c:4c12) ld a, c - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ld a, b - ld [$cd3e], a + ld [wTrainerEngageDistance], a ld c, $8 -.asm_70c1c +.loop1 push bc push hl push de @@ -526,89 +528,89 @@ Func_70c12: ; 70c12 (1c:4c12) call CopyData pop hl pop de - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ld c, a - ld a, [$cd3e] + ld a, [wTrainerEngageDistance] ld b, a add hl, bc pop bc dec c - jr nz, .asm_70c1c + jr nz, .loop1 ld l, e ld h, d ld a, $ff ld c, $14 -.asm_70c3a +.loop2 ld [hli], a dec c - jr nz, .asm_70c3a + jr nz, .loop2 ret -Func_70c3f: ; 70c3f (1c:4c3f) +BattleTransition_CopyTiles2: ; 70c3f (1c:4c3f) ld a, c - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ld a, b - ld [$cd3e], a + ld [wTrainerEngageDistance], a ld c, $9 -.asm_70c49 +.loop1 push bc push hl push de ld c, $12 -.asm_70c4e +.loop2 ld a, [hl] ld [de], a ld a, e add $14 - jr nc, .asm_70c56 + jr nc, .noCarry1 inc d -.asm_70c56 +.noCarry1 ld e, a ld a, l add $14 - jr nc, .asm_70c5d + jr nc, .noCarry2 inc h -.asm_70c5d +.noCarry2 ld l, a dec c - jr nz, .asm_70c4e + jr nz, .loop2 pop hl pop de - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ld c, a - ld a, [$cd3e] + ld a, [wTrainerEngageDistance] ld b, a add hl, bc pop bc dec c - jr nz, .asm_70c49 + jr nz, .loop1 ld l, e ld h, d ld de, $14 ld c, $12 -.asm_70c77 +.loop3 ld [hl], $ff add hl, de dec c - jr nz, .asm_70c77 + jr nz, .loop3 ret -Func_70c7e: ; 70c7e (1c:4c7e) +; used for high level wild dungeon battles +BattleTransition_VerticalStripes: ; 70c7e (1c:4c7e) ld c, $12 ld hl, wTileMap - FuncCoord 1, 17 ; $c4f5 - ld de, Coord + deCoord 1, 17 xor a - ld [H_AUTOBGTRANSFERENABLED], a ; $ffba -.asm_70c89 + ld [H_AUTOBGTRANSFERENABLED], a +.loop push bc push hl push de push de - call Func_70caa + call BattleTransition_VerticalStripes_ pop hl - call Func_70caa - call Func_70d19 + call BattleTransition_VerticalStripes_ + call BattleTransition_TransferDelay3 pop hl ld bc, $ffec add hl, bc @@ -619,109 +621,115 @@ Func_70c7e: ; 70c7e (1c:4c7e) add hl, bc pop bc dec c - jr nz, .asm_70c89 - jp Func_70a69 + jr nz, .loop + jp BattleTransition_BlackScreen -Func_70caa: ; 70caa (1c:4caa) +BattleTransition_VerticalStripes_: ; 70caa (1c:4caa) ld c, $a -.asm_70cac +.loop ld [hl], $ff inc hl inc hl dec c - jr nz, .asm_70cac + jr nz, .loop ret -Func_70cb4: ; 70cb4 (1c:4cb4) +; used for low level wild dungeon battles +BattleTransition_HorizontalStripes: ; 70cb4 (1c:4cb4) ld c, $14 ld hl, wTileMap - FuncCoord 19, 1 ; $c3c7 - ld de, Coord + deCoord 19, 1 xor a - ld [H_AUTOBGTRANSFERENABLED], a ; $ffba -.asm_70cbf + ld [H_AUTOBGTRANSFERENABLED], a +.loop push bc push hl push de push de - call Func_70cd8 + call BattleTransition_HorizontalStripes_ pop hl - call Func_70cd8 - call Func_70d19 + call BattleTransition_HorizontalStripes_ + call BattleTransition_TransferDelay3 pop de pop hl pop bc inc hl dec de dec c - jr nz, .asm_70cbf - jp Func_70a69 + jr nz, .loop + jp BattleTransition_BlackScreen -Func_70cd8: ; 70cd8 (1c:4cd8) +BattleTransition_HorizontalStripes_: ; 70cd8 (1c:4cd8) ld c, $9 ld de, $28 -.asm_70cdd +.loop ld [hl], $ff add hl, de dec c - jr nz, .asm_70cdd + jr nz, .loop ret -Func_70ce4: ; 70ce4 (1c:4ce4) - call Func_70cfd +; used for high level wild non-dungeon battles +; makes one full circle around the screen +; by animating each half circle one at a time +BattleTransition_Circle: ; 70ce4 (1c:4ce4) + call BattleTransition_FlashScreen ld bc, $000a - ld hl, Unknown_70d61 - call Func_70d06 + ld hl, BattleTransition_HalfCircle1 + call BattleTransition_Circle_Sub1 ld c, $a ld b, $1 - ld hl, Unknown_70d93 - call Func_70d06 - jp Func_70a69 + ld hl, BattleTransition_HalfCircle2 + call BattleTransition_Circle_Sub1 + jp BattleTransition_BlackScreen -Func_70cfd: ; 70cfd (1c:4cfd) +BattleTransition_FlashScreen: ; 70cfd (1c:4cfd) ld b, $3 - call Func_70b5d + call BattleTransition_FlashScreen_ xor a - ld [H_AUTOBGTRANSFERENABLED], a ; $ffba + ld [H_AUTOBGTRANSFERENABLED], a ret -Func_70d06: ; 70d06 (1c:4d06) +BattleTransition_Circle_Sub1: ; 70d06 (1c:4d06) push bc push hl ld a, b - call Func_70d50 + call BattleTransition_Circle_Sub2 pop hl ld bc, $0005 add hl, bc - call Func_70d19 + call BattleTransition_TransferDelay3 pop bc dec c - jr nz, Func_70d06 + jr nz, BattleTransition_Circle_Sub1 ret -Func_70d19: ; 70d19 (1c:4d19) +BattleTransition_TransferDelay3: ; 70d19 (1c:4d19) ld a, $1 - ld [H_AUTOBGTRANSFERENABLED], a ; $ffba + ld [H_AUTOBGTRANSFERENABLED], a call Delay3 xor a - ld [H_AUTOBGTRANSFERENABLED], a ; $ffba + ld [H_AUTOBGTRANSFERENABLED], a ret -Func_70d24: ; 70d24 (1c:4d24) - call Func_70cfd +; used for low level wild non-dungeon battles +; makes two half circles around the screen +; by animating both half circles at the same time +BattleTransition_DoubleCircle: ; 70d24 (1c:4d24) + call BattleTransition_FlashScreen ld c, $a - ld hl, Unknown_70d61 ; $4d61 - ld de, Unknown_70d93 ; $4d93 -.asm_70d2f + ld hl, BattleTransition_HalfCircle1 + ld de, BattleTransition_HalfCircle2 +.loop push bc push hl push de push de xor a - call Func_70d50 + call BattleTransition_Circle_Sub2 pop hl ld a, $1 - call Func_70d50 + call BattleTransition_Circle_Sub2 pop hl ld bc, $5 add hl, bc @@ -729,16 +737,16 @@ Func_70d24: ; 70d24 (1c:4d24) ld d, h pop hl add hl, bc - call Func_70d19 + call BattleTransition_TransferDelay3 pop bc dec c - jr nz, .asm_70d2f - jp Func_70a69 + jr nz, .loop + jp BattleTransition_BlackScreen -Func_70d50: ; 70d50 (1c:4d50) - ld [wWhichTrade], a ; $cd3d +BattleTransition_Circle_Sub2: ; 70d50 (1c:4d50) + ld [wWhichTrade], a ld a, [hli] - ld [$cd3e], a + ld [wTrainerEngageDistance], a ld a, [hli] ld e, a ld a, [hli] @@ -746,166 +754,146 @@ Func_70d50: ; 70d50 (1c:4d50) ld a, [hli] ld h, [hl] ld l, a - jp Func_70dc5 + jp BattleTransition_Circle_Sub3 -Unknown_70d61: ; 70d61 (1c:4d61) +BattleTransition_HalfCircle1: ; 70d61 (1c:4d61) db $01 - dw Unknown_70dfe - FuncCoord 18, 6 - dw Coord + dw BattleTransition_CircleData1 + dwCoord 18, 6 db $01 - dw Unknown_70e04 - FuncCoord 19, 3 - dw Coord + dw BattleTransition_CircleData2 + dwCoord 19, 3 db $01 - dw Unknown_70e0e - FuncCoord 18, 0 - dw Coord + dw BattleTransition_CircleData3 + dwCoord 18, 0 db $01 - dw Unknown_70e20 - FuncCoord 14, 0 - dw Coord + dw BattleTransition_CircleData4 + dwCoord 14, 0 db $01 - dw Unknown_70e2e - FuncCoord 10, 0 - dw Coord + dw BattleTransition_CircleData5 + dwCoord 10, 0 db $00 - dw Unknown_70e2e - FuncCoord 9, 0 - dw Coord + dw BattleTransition_CircleData5 + dwCoord 9, 0 db $00 - dw Unknown_70e20 - FuncCoord 5, 0 - dw Coord + dw BattleTransition_CircleData4 + dwCoord 5, 0 db $00 - dw Unknown_70e0e - FuncCoord 1, 0 - dw Coord + dw BattleTransition_CircleData3 + dwCoord 1, 0 db $00 - dw Unknown_70e04 - FuncCoord 0, 3 - dw Coord + dw BattleTransition_CircleData2 + dwCoord 0, 3 db $00 - dw Unknown_70dfe - FuncCoord 1, 6 - dw Coord + dw BattleTransition_CircleData1 + dwCoord 1, 6 -Unknown_70d93: ; 70d93 (1c:4d93) +BattleTransition_HalfCircle2: ; 70d93 (1c:4d93) db $00 - dw Unknown_70dfe - FuncCoord 1, 11 - dw Coord + dw BattleTransition_CircleData1 + dwCoord 1, 11 db $00 - dw Unknown_70e04 - FuncCoord 0, 14 - dw Coord + dw BattleTransition_CircleData2 + dwCoord 0, 14 db $00 - dw Unknown_70e0e - FuncCoord 1, 17 - dw Coord + dw BattleTransition_CircleData3 + dwCoord 1, 17 db $00 - dw Unknown_70e20 - FuncCoord 5, 17 - dw Coord + dw BattleTransition_CircleData4 + dwCoord 5, 17 db $00 - dw Unknown_70e2e - FuncCoord 9, 17 - dw Coord + dw BattleTransition_CircleData5 + dwCoord 9, 17 db $01 - dw Unknown_70e2e - FuncCoord 10, 17 - dw Coord + dw BattleTransition_CircleData5 + dwCoord 10, 17 db $01 - dw Unknown_70e20 - FuncCoord 14, 17 - dw Coord + dw BattleTransition_CircleData4 + dwCoord 14, 17 db $01 - dw Unknown_70e0e - FuncCoord 18, 17 - dw Coord + dw BattleTransition_CircleData3 + dwCoord 18, 17 db $01 - dw Unknown_70e04 - FuncCoord 19, 14 - dw Coord + dw BattleTransition_CircleData2 + dwCoord 19, 14 db $01 - dw Unknown_70dfe - FuncCoord 18, 11 - dw Coord + dw BattleTransition_CircleData1 + dwCoord 18, 11 -Func_70dc5: ; 70dc5 (1c:4dc5) +BattleTransition_Circle_Sub3: ; 70dc5 (1c:4dc5) push hl ld a, [de] ld c, a inc de -.asm_70dc9 +.loop1 ld [hl], $ff - ld a, [$cd3e] + ld a, [wTrainerEngageDistance] and a - jr z, .asm_70dd4 + jr z, .skip1 inc hl - jr .asm_70dd5 -.asm_70dd4 + jr .skip2 +.skip1 dec hl -.asm_70dd5 +.skip2 dec c - jr nz, .asm_70dc9 + jr nz, .loop1 pop hl - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] and a ld bc, $14 - jr z, .asm_70de5 + jr z, .skip3 ld bc, $ffec -.asm_70de5 +.skip3 add hl, bc ld a, [de] inc de cp $ff ret z and a - jr z, Func_70dc5 + jr z, BattleTransition_Circle_Sub3 ld c, a -.asm_70def - ld a, [$cd3e] +.loop2 + ld a, [wTrainerEngageDistance] and a - jr z, .asm_70df8 + jr z, .skip4 dec hl - jr .asm_70df9 -.asm_70df8 + jr .skip5 +.skip4 inc hl -.asm_70df9 +.skip5 dec c - jr nz, .asm_70def - jr Func_70dc5 + jr nz, .loop2 + jr BattleTransition_Circle_Sub3 -Unknown_70dfe: ; 70dfe (1c:4dfe) +BattleTransition_CircleData1: ; 70dfe (1c:4dfe) db $02,$03,$05,$04,$09,$FF -Unknown_70e04: ; 70e04 (1c:4e04) +BattleTransition_CircleData2: ; 70e04 (1c:4e04) db $01,$01,$02,$02,$04,$02,$04,$02,$03,$FF -Unknown_70e0e: ; 70e0e (1c:4e0e) +BattleTransition_CircleData3: ; 70e0e (1c:4e0e) db $02,$01,$03,$01,$04,$01,$04,$01,$04,$01,$03,$01,$02,$01,$01,$01,$01,$FF -Unknown_70e20: ; 70e20 (1c:4e20) +BattleTransition_CircleData4: ; 70e20 (1c:4e20) db $04,$01,$04,$00,$03,$01,$03,$00,$02,$01,$02,$00,$01,$FF -Unknown_70e2e: ; 70e2e (1c:4e2e) +BattleTransition_CircleData5: ; 70e2e (1c:4e2e) db $04,$00,$03,$00,$03,$00,$02,$00,$02,$00,$01,$00,$01,$00,$01,$FF diff --git a/engine/battle/4.asm b/engine/battle/4.asm index b19b3b49..db6614cc 100755 --- a/engine/battle/4.asm +++ b/engine/battle/4.asm @@ -1,12 +1,12 @@ Func_128d8: ; 128d8 (4:68d8) - ld a, [W_YCOORD] ; $d361 + ld a, [W_YCOORD] ; wd361 ld b, a - ld a, [W_CURMAPHEIGHT] ; $d368 + ld a, [W_CURMAPHEIGHT] ; wd368 call Func_128ea ret z - ld a, [W_XCOORD] ; $d362 + ld a, [W_XCOORD] ; wd362 ld b, a - ld a, [W_CURMAPWIDTH] ; $d369 + ld a, [W_CURMAPWIDTH] ; wd369 Func_128ea: ; 128ea (4:68ea) add a @@ -15,20 +15,20 @@ Func_128ea: ; 128ea (4:68ea) inc b ret -Func_128ef: ; 128ef (4:68ef) - call Load16BitRegisters +DrawHP: ; 128ef (4:68ef) + call GetPredefRegisters ld a, $1 jr asm_128fb Func_128f6: ; 128f6 (4:68f6) - call Load16BitRegisters + call GetPredefRegisters ld a, $2 asm_128fb: ; 128fb (4:68fb) - ld [wListMenuID], a ; $cf94 + ld [wListMenuID], a ; wListMenuID push hl - ld a, [$cf99] + ld a, [wcf99] ld b, a - ld a, [$cf9a] + ld a, [wcf9a] ld c, a or b jr nz, .asm_12913 @@ -39,12 +39,11 @@ asm_128fb: ; 128fb (4:68fb) ld d, a jp Func_12924 .asm_12913 - ld a, [$cfba] + ld a, [wcfba] ld d, a - ld a, [$cfbb] + ld a, [wcfbb] ld e, a - ld a, $26 - call Predef ; indirect jump to UpdateHPBar_LoadRegisters (f9dc (3:79dc)) + predef HPBarLength ld a, $6 ld d, a ld c, a @@ -65,12 +64,12 @@ Func_12924: ; 12924 (4:6924) ld bc, $15 .asm_1293a add hl, bc - ld de, $cf99 + ld de, wcf99 ld bc, $203 call PrintNumber ld a, "/" ld [hli], a - ld de, $cfba + ld de, wcfba ld bc, $203 call PrintNumber pop hl diff --git a/engine/battle/4_2.asm b/engine/battle/4_2.asm index de9aa7be..c5c62796 100755 --- a/engine/battle/4_2.asm +++ b/engine/battle/4_2.asm @@ -1,16 +1,16 @@ Func_137aa: ; 137aa (4:77aa) - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 jr nz, .asm_137eb - ld a, [W_ENEMYMONNUMBER] ; $cfe8 - ld hl, $d8a8 - ld bc, $2c + ld a, [wEnemyMonPartyPos] + ld hl, wEnemyMon1Status + ld bc, wEnemyMon2 - wEnemyMon1 call AddNTimes - ld a, [W_ENEMYMONSTATUS] ; $cfe9 + ld a, [wEnemyMonStatus] ; wcfe9 ld [hl], a call ClearScreen callab Func_372d6 - ld a, [$cf0b] + ld a, [wcf0b] cp $1 ld de, YouWinText jr c, .asm_137de @@ -18,62 +18,59 @@ Func_137aa: ; 137aa (4:77aa) jr z, .asm_137de ld de, DrawText .asm_137de - FuncCoord 6, 8 ; $c446 - ld hl, Coord + hlCoord 6, 8 call PlaceString ld c, $c8 call DelayFrames jr .asm_1380a .asm_137eb - ld a, [$cf0b] + ld a, [wcf0b] and a jr nz, .asm_13813 - ld hl, $cce5 + ld hl, wcce5 ld a, [hli] or [hl] inc hl or [hl] jr z, .asm_1380a - ld de, wPlayerMoney + 2 ; $d349 + ld de, wPlayerMoney + 2 ; wd349 ld c, $3 - ld a, $b - call Predef ; indirect jump to Func_f81d (f81d (3:781d)) + predef AddBCDPredef ld hl, PickUpPayDayMoneyText call PrintText .asm_1380a xor a - ld [$ccd4], a - ld a, $2a - call Predef ; indirect jump to Func_3ad1c (3ad1c (e:6d1c)) + ld [wccd4], a + predef Func_3ad1c .asm_13813 xor a - ld [$d083], a - ld [$c02a], a - ld [W_ISINBATTLE], a ; $d057 - ld [W_BATTLETYPE], a ; $d05a - ld [W_MOVEMISSED], a ; $d05f - ld [W_CUROPPONENT], a ; $d059 - ld [$d11f], a - ld [$d120], a - ld [$d078], a - ld hl, $cc2b + ld [wd083], a + ld [wc02a], a + ld [W_ISINBATTLE], a ; W_ISINBATTLE + ld [W_BATTLETYPE], a ; wd05a + ld [W_MOVEMISSED], a ; W_MOVEMISSED + ld [W_CUROPPONENT], a ; wd059 + ld [wd11f], a + ld [wd120], a + ld [wd078], a + ld hl, wcc2b ld [hli], a ld [hli], a ld [hli], a ld [hl], a - ld [wListScrollOffset], a ; $cc36 - ld hl, $d060 + ld [wListScrollOffset], a ; wcc36 + ld hl, wd060 ld b, $18 .asm_1383e ld [hli], a dec b jr nz, .asm_1383e - ld hl, $d72c + ld hl, wd72c set 0, [hl] call WaitForSoundToFinish call GBPalWhiteOut ld a, $ff - ld [$d42f], a + ld [wd42f], a ret YouWinText: ; 13853 (4:7853) @@ -90,10 +87,10 @@ PickUpPayDayMoneyText: ; 1386b (4:786b) db "@" Func_13870: ; 13870 (4:7870) - ld a, [$cc57] + ld a, [wcc57] and a ret nz - ld a, [$d736] + ld a, [wd736] and a ret nz callab Func_c49d @@ -105,37 +102,36 @@ Func_13870: ; 13870 (4:7870) .asm_13888 callab Func_128d8 jr z, .asm_13884 - ld a, [$d0db] + ld a, [wd0db] and a jr z, .asm_1389e dec a jr z, .asm_13905 - ld [$d0db], a + ld [wd0db], a .asm_1389e - FuncCoord 9, 9 ; $c45d - ld hl, Coord + hlCoord 9, 9 ld c, [hl] ld a, [W_GRASSTILE] cp c - ld a, [W_GRASSRATE] ; $d887 + ld a, [W_GRASSRATE] ; W_GRASSRATE jr z, .asm_138c4 ld a, $14 cp c - ld a, [W_WATERRATE] ; $d8a4 + ld a, [W_WATERRATE] ; wEnemyMon1Species jr z, .asm_138c4 - ld a, [W_CURMAP] ; $d35e + ld a, [W_CURMAP] ; W_CURMAP cp REDS_HOUSE_1F jr c, .asm_13912 - ld a, [W_CURMAPTILESET] ; $d367 + ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET cp FOREST ; Viridian Forest/Safari Zone jr z, .asm_13912 - ld a, [W_GRASSRATE] ; $d887 + ld a, [W_GRASSRATE] ; W_GRASSRATE .asm_138c4 ld b, a - ld a, [H_RAND1] ; $ffd3 + ld a, [hRandomAdd] cp b jr nc, .asm_13912 - ld a, [H_RAND2] ; $ffd4 + ld a, [hRandomSub] ld b, a ld hl, WildMonEncounterSlotChances ; $7918 .asm_138d0 @@ -146,31 +142,30 @@ Func_13870: ; 13870 (4:7870) jr .asm_138d0 .asm_138d7 ld c, [hl] - ld hl, W_GRASSMONS ; $d888 - FuncCoord 8, 9 ; $c45c - ld a, [Coord] + ld hl, W_GRASSMONS ; wd888 + aCoord 8, 9 cp $14 jr nz, .asm_138e5 - ld hl, W_WATERMONS ; $d8a5 (aliases: W_ENEMYMON1HP) + ld hl, W_WATERMONS ; wd8a5 (aliases: wEnemyMon1HP) .asm_138e5 ld b, $0 add hl, bc ld a, [hli] - ld [W_CURENEMYLVL], a ; $d127 + ld [W_CURENEMYLVL], a ; W_CURENEMYLVL ld a, [hl] - ld [$cf91], a - ld [W_ENEMYMONID], a - ld a, [$d0db] + ld [wcf91], a + ld [wEnemyMonSpecies2], a + ld a, [wd0db] and a jr z, .asm_13916 - ld a, [W_PARTYMON1_LEVEL] ; $d18c + ld a, [wPartyMon1Level] ; wPartyMon1Level ld b, a - ld a, [W_CURENEMYLVL] ; $d127 + ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL cp b jr c, .asm_13912 jr .asm_13916 .asm_13905 - ld [$d0db], a + ld [wd0db], a ld a, $d2 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call EnableAutoTextBoxDrawing @@ -202,14 +197,14 @@ WildMonEncounterSlotChances: ; 13918 (4:7918) RecoilEffect_: ; 1392c (4:792c) ld a, [H_WHOSETURN] ; $fff3 and a - ld a, [W_PLAYERMOVENUM] ; $cfd2 - ld hl, W_PLAYERMONMAXHP ; $d023 + ld a, [W_PLAYERMOVENUM] ; wcfd2 + ld hl, wBattleMonMaxHP ; wd023 jr z, .asm_1393d - ld a, [W_ENEMYMOVENUM] ; $cfcc - ld hl, W_ENEMYMONMAXHP ; $cff4 + ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM + ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP .asm_1393d ld d, a - ld a, [W_DAMAGE] ; $d0d7 + ld a, [W_DAMAGE] ; W_DAMAGE ld b, a ld a, [W_DAMAGE + 1] ld c, a @@ -252,19 +247,16 @@ RecoilEffect_: ; 1392c (4:792c) ld [hli], a ld [hl], a .asm_13982 - FuncCoord 10, 9 ; $c45e - ld hl, Coord + hlCoord 10, 9 ld a, [H_WHOSETURN] ; $fff3 and a ld a, $1 jr z, .asm_13990 - FuncCoord 2, 2 ; $c3ca - ld hl, Coord + hlCoord 2, 2 xor a .asm_13990 - ld [wListMenuID], a ; $cf94 - ld a, $48 - call Predef ; indirect jump to UpdateHPBar (fa1d (3:7a1d)) + ld [wListMenuID], a ; wListMenuID + predef UpdateHPBar2 ld hl, HitWithRecoilText ; $799e jp PrintText HitWithRecoilText: ; 1399e (4:799e) @@ -272,8 +264,8 @@ HitWithRecoilText: ; 1399e (4:799e) db "@" ConversionEffect_: ; 139a3 (4:79a3) - ld hl, W_ENEMYMONTYPE1 - ld de, W_PLAYERMONTYPE1 + ld hl, wEnemyMonType1 + ld de, wBattleMonType1 ld a, [H_WHOSETURN] and a ld a, [W_ENEMYBATTSTATUS1] @@ -312,18 +304,18 @@ HazeEffect_: ; 139da (4:79da) call Func_13a43 ld hl, wEnemyMonAttackMod call Func_13a43 - ld hl, $cd12 - ld de, W_PLAYERMONATK + ld hl, wcd12 + ld de, wBattleMonAttack call Func_13a4a - ld hl, $cd26 - ld de, W_ENEMYMONATTACK + ld hl, wcd26 + ld de, wEnemyMonAttack call Func_13a4a - ld hl, W_ENEMYMONSTATUS + ld hl, wEnemyMonStatus ld de, wEnemySelectedMove ld a, [H_WHOSETURN] and a jr z, .asm_13a09 - ld hl, W_PLAYERMONSTATUS + ld hl, wBattleMonStatus dec de .asm_13a09 @@ -338,7 +330,7 @@ HazeEffect_: ; 139da (4:79da) xor a ld [W_PLAYERDISABLEDMOVE], a ld [W_ENEMYDISABLEDMOVE], a - ld hl, $ccee + ld hl, wccee ld [hli], a ld [hl], a ld hl, W_PLAYERBATTSTATUS1 @@ -384,25 +376,25 @@ StatusChangesEliminatedText: ; 13a53 (4:7a53) db "@" GetTrainerName_: ; 13a58 (4:7a58) - ld hl, W_GRASSRATE ; $d887 - ld a, [W_ISLINKBATTLE] ; $d12b + ld hl, W_GRASSRATE ; W_GRASSRATE + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE and a jr nz, .rival - ld hl, W_RIVALNAME ; $d34a - ld a, [W_TRAINERCLASS] ; $d031 + ld hl, W_RIVALNAME ; wd34a + ld a, [W_TRAINERCLASS] ; wd031 cp SONY1 jr z, .rival cp SONY2 jr z, .rival cp SONY3 jr z, .rival - ld [$d0b5], a + ld [wd0b5], a ld a, TRAINER_NAME ld [W_LISTTYPE], a ld a, $e - ld [$d0b7], a + ld [wPredefBank], a call GetName - ld hl, $cd6d + ld hl, wcd6d .rival ld de, W_TRAINERNAME ld bc, $d diff --git a/engine/battle/5.asm b/engine/battle/5.asm index 4dbfb4df..6c7a642e 100755 --- a/engine/battle/5.asm +++ b/engine/battle/5.asm @@ -1,13 +1,13 @@ SubstituteEffectHandler: ; 17dad (5:7dad) ld c, 50 call DelayFrames - ld hl, W_PLAYERMONMAXHP + ld hl, wBattleMonMaxHP ld de, wPlayerSubstituteHP ld bc, W_PLAYERBATTSTATUS2 ld a, [$fff3] ;whose turn? and a jr z, .notEnemy - ld hl, W_ENEMYMONMAXHP + ld hl, wEnemyMonMaxHP ld de, wEnemySubstituteHP ld bc, W_ENEMYBATTSTATUS2 .notEnemy @@ -42,7 +42,7 @@ SubstituteEffectHandler: ; 17dad (5:7dad) ld h, b ld l, c set 4, [hl] ;set bit 4 of flags, user now has substitute - ld a, [$d355] ;load options + ld a, [W_OPTIONS] ;load options bit 7, a ;battle animation is enabled? ld hl, Func_3fba8 ; $7ba8 ;animation enabled: 0F:7BA8 ld b, BANK(Func_3fba8) diff --git a/engine/battle/9.asm b/engine/battle/9.asm index 79624d34..dc72825c 100755 --- a/engine/battle/9.asm +++ b/engine/battle/9.asm @@ -1,5 +1,5 @@ Func_27d6b: ; 27d6b (9:7d6b) - call Load16BitRegisters + call GetPredefRegisters push hl call GetMonHeader pop hl @@ -26,9 +26,9 @@ asm_27d8c: ; 27d8c (9:7d8c) jp FillMemory Func_27d98: ; 27d98 (9:7d98) - call Load16BitRegisters + call GetPredefRegisters push hl - ld a, [W_PLAYERMOVETYPE] ; $cfd5 + ld a, [W_PLAYERMOVETYPE] ; wcfd5 asm_27d9f: ; 27d9f (9:7d9f) add a ld hl, TypeNamePointers ; $7dae @@ -54,7 +54,7 @@ SaveTrainerName: ; 27e4a (9:7e4a) ld a,[hli] ld h,[hl] ld l,a - ld de,$CD6D + ld de,wcd6d .CopyCharacter ld a,[hli] ld [de],a @@ -157,11 +157,11 @@ CooltrainerFName: ; 27f79 (9:7f79) db "COOLTRAINER♀@" FocusEnergyEffect_: ; 27f86 (9:7f86) - ld hl, W_PLAYERBATTSTATUS2 ; $d063 + ld hl, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_27f91 - ld hl, W_ENEMYBATTSTATUS2 ; $d068 + ld hl, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2 .asm_27f91 bit 2, [hl] ; is mon already using focus energy? jr nz, .asm_27fa5 diff --git a/engine/battle/a.asm b/engine/battle/a.asm index 2e409b57..fd3ef40b 100755 --- a/engine/battle/a.asm +++ b/engine/battle/a.asm @@ -1,15 +1,15 @@ LeechSeedEffect_: ; 2bea9 (a:7ea9) callab MoveHitTest - ld a, [W_MOVEMISSED] ; $d05f + ld a, [W_MOVEMISSED] ; W_MOVEMISSED and a jr nz, .asm_2bee7 - ld hl, W_ENEMYBATTSTATUS2 ; $d068 - ld de, W_ENEMYMONTYPE1 ; $cfea (aliases: W_ENEMYMONTYPES) + ld hl, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2 + ld de, wEnemyMonType1 ; wcfea (aliases: wEnemyMonType) ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_2bec8 - ld hl, W_PLAYERBATTSTATUS2 ; $d063 - ld de, W_PLAYERMONTYPE1 ; $d019 (aliases: W_PLAYERMONTYPES) + ld hl, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2 + ld de, wBattleMonType1 ; wd019 (aliases: wBattleMonType) .asm_2bec8 ld a, [de] cp GRASS diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index aaa65bbb..cc598de4 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -223,7 +223,7 @@ PlayAnimation: ; 780f1 (1e:40f1) rla sla c rla - ld [$D09F],a ; tile select + ld [wd09f],a ; tile select ld a,[hli] ; sound ld [wAnimSoundID],a ; store sound ld a,[hli] ; subanimation ID @@ -243,7 +243,7 @@ PlayAnimation: ; 780f1 (1e:40f1) push hl ld a,[rOBP0] push af - ld a,[$CC79] + ld a,[wcc79] ld [rOBP0],a call LoadAnimationTileset call LoadSubanimation @@ -328,7 +328,7 @@ GetSubanimationTransform2: ; 781ca (1e:41ca) ; loads tile patterns for battle animations LoadAnimationTileset: ; 781d2 (1e:41d2) - ld a,[$D09F] ; tileset select + ld a,[wd09f] ; tileset select add a add a ld hl,AnimationTilesetPointers @@ -336,14 +336,14 @@ LoadAnimationTileset: ; 781d2 (1e:41d2) ld d,0 add hl,de ld a,[hli] - ld [$D07D],a ; number of tiles + ld [wd07d],a ; number of tiles ld a,[hli] ld e,a ld a,[hl] ld d,a ; de = address of tileset - ld hl,$8310 ; destination address in VRAM + ld hl,vSprites + $310 ld b, BANK(AnimationTileset1) ; ROM bank - ld a,[$D07D] + ld a,[wd07d] ld c,a ; number of tiles jp CopyVideoData ; load tileset @@ -394,7 +394,7 @@ MoveAnimation: ; 78d5e (1e:4d5e) .MoveAnimation ; check if battle animations are disabled in the options - ld a,[$D355] + ld a,[W_OPTIONS] bit 7,a jr nz,.AnimationsDisabled call ShareMoveAnimations @@ -408,11 +408,11 @@ MoveAnimation: ; 78d5e (1e:4d5e) .AnimationFinished call WaitForSoundToFinish xor a - ld [$D096],a - ld [$D09B],a - ld [$D08B],a + ld [W_SUBANIMSUBENTRYADDR],a + ld [wd09b],a + ld [W_SUBANIMTRANSFORM],a dec a - ld [$CF07],a + ld [wAnimSoundID],a pop af pop bc pop de @@ -443,7 +443,7 @@ ShareMoveAnimations: ; 78da6 (1e:4da6) ret Func_78dbd: ; 78dbd (1e:4dbd) - ld a,[$CC5B] + ld a,[wcc5b] and a ret z dec a @@ -517,14 +517,14 @@ Func_78e01: ; 78e01 (1e:4e01) ret Func_78e23: ; 78e23 (1e:4e23) - ld a, [$cf1b] + ld a, [wcf1b] and a ld a, $e4 jr z, .asm_78e47 ld a, $f0 - ld [$cc79], a + ld [wcc79], a ld b, $e4 - ld a, [W_ANIMATIONID] ; $d07c + ld a, [W_ANIMATIONID] ; W_ANIMATIONID cp $aa jr c, .asm_78e3f cp $ae @@ -538,7 +538,7 @@ Func_78e23: ; 78e23 (1e:4e23) ret .asm_78e47 ld a, $e4 - ld [$cc79], a + ld [wcc79], a ld [rOBP0], a ; $ff48 ld a, $6c ld [rOBP1], a ; $ff49 @@ -616,7 +616,7 @@ AnimationCleanOAM: ; 78ec8 (1e:4ec8) push bc push af call DelayFrame - call CleanLCD_OAM + call ClearSprites pop af pop bc pop de @@ -724,7 +724,7 @@ AnimationIdSpecialEffects: ; 78ef5 (1e:4ef5) db $FF ; terminator DoBallTossSpecialEffects: ; 78f3e (1e:4f3e) - ld a,[$CF91] + ld a,[wcf91] cp a,3 ; is it a Master Ball or Ultra Ball? jr nc,.skipFlashingEffect .flashingEffect ; do a flashing effect if it's Master Ball or Ultra Ball @@ -742,7 +742,7 @@ DoBallTossSpecialEffects: ; 78f3e (1e:4f3e) ld a,[W_ISINBATTLE] cp a,02 ; is it a trainer battle? jr z,.isTrainerBattle - ld a,[$d11e] + ld a,[wd11e] cp a,$10 ; is the enemy pokemon the Ghost Marowak? ret nz ; if the enemy pokemon is the Ghost Marowak, make it dodge during the last 3 frames @@ -754,8 +754,7 @@ DoBallTossSpecialEffects: ; 78f3e (1e:4f3e) cp a,1 ret nz .moveGhostMarowakLeft - FuncCoord 17,0 - ld hl,Coord + hlCoord 17, 0 ld de,20 ld bc,$0707 ; 7 rows and 7 columns .loop @@ -792,9 +791,9 @@ DoBallShakeSpecialEffects: ; 78f96 (1e:4f96) dec a ret nz ; if it's the end of the ball shaking subanimation, check if more shakes are left and restart the subanimation - ld a,[$cd3d] ; number of shakes + ld a,[wWhichTrade] ; number of shakes dec a ; decrement number of shakes - ld [$cd3d],a + ld [wWhichTrade],a ret z ; if there are shakes left, restart the subanimation ld a,[W_SUBANIMSUBENTRYADDR] @@ -831,11 +830,9 @@ DoRockSlideSpecialEffects: ; 78fd9 (1e:4fd9) ; if the subaninmation counter is between 8 and 11, shake the screen horizontally and vertically .shakeScreen ld b,1 - ld a,$24 - call Predef ; shake horizontally + predef Func_48125 ; shake horizontally ld b,1 - ld a,$21 - jp Predef ; shake vertically + predef_jump Func_480ff ; shake vertically FlashScreenEveryEightFrameBlocks: ; 78ff7 (1e:4ff7) ld a,[W_SUBANIMCOUNTER] @@ -856,8 +853,7 @@ DoExplodeSpecialEffects: ; 79009 (1e:5009) cp a,1 ; is it the end of the subanimation? jr nz,FlashScreenEveryFourFrameBlocks ; if it's the end of the subanimation, make the attacking pokemon disappear - FuncCoord 1, 5 ; $c405 - ld hl,Coord + hlCoord 1, 5 jp AnimationHideMonPic ; make pokemon disappear ; flashes the screen when subanimation counter is 1 modulo 4 @@ -975,7 +971,7 @@ BallMoveDistances2: ; 790b3 (1e:50b3) ; so that there are two musical notes flying towards the defending pokemon DoGrowlSpecialEffects: ; 790bc (1e:50bc) ld hl,wOAMBuffer ; OAM buffer - ld de,$c310 + ld de,wOAMBuffer + $10 ld bc,$10 call CopyData ; copy the musical note graphic ld a,[W_SUBANIMCOUNTER] @@ -1094,8 +1090,8 @@ CallWithTurnFlipped: ; 79155 (1e:5155) ; flashes the screen for an extended period (48 frames) AnimationFlashScreenLong: ; 79165 (1e:5165) ld a,3 ; cycle through the palettes 3 times - ld [$D08A],a - ld a,[$cf1b] ; running on SGB? + ld [wd08a],a + ld a,[wcf1b] ; running on SGB? and a ld hl,FlashScreenLongMonochrome jr z,.loop @@ -1110,9 +1106,9 @@ AnimationFlashScreenLong: ; 79165 (1e:5165) call FlashScreenLongDelay jr .innerLoop .endOfPalettes - ld a,[$D08A] + ld a,[wd08a] dec a - ld [$D08A],a + ld [wd08a],a pop hl jr nz,.loop ret @@ -1152,8 +1148,8 @@ FlashScreenLongSGB: ; 7919b (1e:519b) ; causes a delay of 2 frames for the first cycle ; causes a delay of 1 frame for the second and third cycles FlashScreenLongDelay: ; 791a8 (1e:51a8) - ld a,[$D08A] - cp a,4 ; never true since [$D08A] starts at 3 + ld a,[wd08a] + cp a,4 ; never true since [wd08a] starts at 3 ld c,4 jr z,.delayFrames cp a,3 @@ -1215,7 +1211,7 @@ Func_791f9: ; 791f9 (1e:51f9) ld bc, $4040 Func_791fc: ; 791fc (1e:51fc) - ld a, [$cf1b] + ld a, [wcf1b] and a ld a, b jr z, .asm_79204 @@ -1227,39 +1223,37 @@ Func_791fc: ; 791fc (1e:51fc) ld b, $5 Func_79209: ; 79209 (1e:5209) - ld a, $21 - jp Predef ; indirect jump to Func_480ff (480ff (12:40ff)) + predef_jump Func_480ff AnimationShakeScreen: ; 7920e (1e:520e) ; Shakes the screen for a while. Used in Earthquake/Fissure/etc. animations. ld b, $8 Func_79210: ; 79210 (1e:5210) - ld a, $24 - jp Predef ; indirect jump to Func_48125 (48125 (12:4125)) + predef_jump Func_48125 AnimationWaterDropletsEverywhere: ; 79215 (1e:5215) ; Draws water droplets all over the screen and makes them ; scroll. It's hard to describe, but it's the main animation ; in Surf/Mist/Toxic. xor a - ld [$d09f], a + ld [wd09f], a call LoadAnimationTileset ld d, $20 ld a, $f0 - ld [W_BASECOORDX], a ; $d081 + ld [W_BASECOORDX], a ; wd081 ld a, $71 - ld [$d09f], a + ld [wd09f], a .asm_79228 ld a, $10 - ld [W_BASECOORDY], a ; $d082 + ld [W_BASECOORDY], a ; wd082 ld a, $0 - ld [$d08a], a + ld [wd08a], a call Func_79246 ld a, $18 - ld [W_BASECOORDY], a ; $d082 + ld [W_BASECOORDY], a ; wd082 ld a, $20 - ld [$d08a], a + ld [wd08a], a call Func_79246 dec d jr nz, .asm_79228 @@ -1268,24 +1262,24 @@ AnimationWaterDropletsEverywhere: ; 79215 (1e:5215) Func_79246: ; 79246 (1e:5246) ld hl, wOAMBuffer .asm_79249 - ld a, [W_BASECOORDY] ; $d082 + ld a, [W_BASECOORDY] ; wd082 ld [hli], a - ld a, [W_BASECOORDX] ; $d081 + ld a, [W_BASECOORDX] ; wd081 add $1b - ld [W_BASECOORDX], a ; $d081 + ld [W_BASECOORDX], a ; wd081 ld [hli], a - ld a, [$d09f] + ld a, [wd09f] ld [hli], a xor a ld [hli], a - ld a, [W_BASECOORDX] ; $d081 + ld a, [W_BASECOORDX] ; wd081 cp $90 jr c, .asm_79249 sub $a8 - ld [W_BASECOORDX], a ; $d081 - ld a, [W_BASECOORDY] ; $d082 + ld [W_BASECOORDX], a ; wd081 + ld a, [W_BASECOORDY] ; wd082 add $10 - ld [W_BASECOORDY], a ; $d082 + ld [W_BASECOORDY], a ; wd082 cp $70 jr c, .asm_79249 call AnimationCleanOAM @@ -1296,15 +1290,15 @@ AnimationSlideMonUp: ; 7927a (1e:527a) ld c, $7 ld a, [H_WHOSETURN] and a - ld hl, $c419 - ld de, $c405 + ld hl, wTileMap + $79 + ld de, wTileMap + $65 ld a, $30 jr z, .asm_79291 - ld hl, $c3c0 - ld de, $c3ac + ld hl, wTileMap + $20 + ld de, wTileMap + $c ld a, $ff .asm_79291 - ld [$d09f], a + ld [wd09f], a jp Func_792bf AnimationSlideMonDown: ; 79297 (1e:5297) @@ -1328,7 +1322,7 @@ AnimationSlideMonOut: ; 792af (1e:52af) ; Slides the mon's sprite out of the screen horizontally. ld e, $8 ld a, $3 - ld [W_SUBANIMTRANSFORM], a ; $d08b + ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM jp Func_795f8 AnimationSlideEnemyMonOut: ; 792b9 (1e:52b9) @@ -1356,13 +1350,13 @@ Func_792bf: ; 792bf (1e:52bf) jr nz, .asm_792c4 ld a, [H_WHOSETURN] and a - ld hl, $c47d + ld hl, wTileMap + $dd jr z, .asm_792e2 - ld hl, $c424 + ld hl, wTileMap + $84 .asm_792e2 - ld a, [$d09f] + ld a, [wd09f] inc a - ld [$d09f], a + ld [wd09f], a ld c, $7 .asm_792eb ld [hli], a @@ -1409,7 +1403,7 @@ Func_79329: ; 79329 (1e:5329) add $8 ld e, a ld [hli], a - ld a, [W_BASECOORDX] ; $d081 + ld a, [W_BASECOORDX] ; wd081 ld [hli], a ld a, d ld [hli], a @@ -1424,7 +1418,7 @@ Func_79337: ; 79337 (1e:5337) Func_79339: ; 79339 (1e:5339) ld de, $4 .asm_7933c - ld a, [$d08a] + ld a, [wd08a] ld b, a ld a, [hl] add b @@ -1447,7 +1441,7 @@ Func_79350: ; 79350 (1e:5350) Func_79352: ; 79352 (1e:5352) ld de, $4 .asm_79355 - ld a, [$d08a] + ld a, [wd08a] ld b, a ld a, [hl] add b @@ -1488,10 +1482,10 @@ AnimationBlinkMon: ; 7936f (1e:536f) AnimationFlashMonPic: ; 79389 (1e:5389) ; Flashes the mon's sprite on and off - ld a, [W_PLAYERMONID] - ld [$ceea], a - ld a, [$cfe5] - ld [$cee9], a + ld a, [wBattleMonSpecies] + ld [wHPBarMaxHP + 1], a + ld a, [wEnemyMonSpecies] + ld [wHPBarMaxHP], a jp Func_79793 AnimationFlashEnemyMonPic: ; 79398 (1e:5398) @@ -1517,11 +1511,11 @@ AnimationShakeBackAndForth: ; 793b1 (1e:53b1) ; The mon's sprite disappears after this animation. ld a, [H_WHOSETURN] and a - ld hl, $c404 - ld de, $c406 + ld hl, wTileMap + $64 + ld de, wTileMap + $66 jr z, .asm_793c2 - ld hl, $c3ab - ld de, $c3ad + ld hl, wTileMap + $b + ld de, wTileMap + $d .asm_793c2 xor a @@ -1565,11 +1559,9 @@ AnimationMoveMonHorizontally: ; 793f9 (1e:53f9) call AnimationHideMonPic ld a, [H_WHOSETURN] ; $fff3 and a - FuncCoord 2, 5 ; $c406 - ld hl, Coord + hlCoord 2, 5 jr z, .asm_79407 - FuncCoord 11, 0 ; $c3ab - ld hl, Coord + hlCoord 11, 0 .asm_79407 xor a push hl @@ -1597,14 +1589,14 @@ AnimationSpiralBallsInward: ; 79424 (1e:5424) and a jr z, .asm_79435 ld a, $d8 - ld [$d08a], a + ld [wd08a], a ld a, $50 - ld [W_SUBANIMTRANSFORM], a ; $d08b + ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM jr .asm_7943c .asm_79435 xor a - ld [$d08a], a - ld [W_SUBANIMTRANSFORM], a ; $d08b + ld [wd08a], a + ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM .asm_7943c ld d, $7a ld c, $3 @@ -1619,12 +1611,12 @@ AnimationSpiralBallsInward: ; 79424 (1e:5424) ld a, [hl] cp $ff jr z, .asm_7946f - ld a, [$d08a] + ld a, [wd08a] add [hl] ld [de], a inc de inc hl - ld a, [W_SUBANIMTRANSFORM] ; $d08b + ld a, [W_SUBANIMTRANSFORM] ; W_SUBANIMTRANSFORM add [hl] ld [de], a inc hl @@ -1680,24 +1672,20 @@ AnimationSquishMonPic: ; 794a1 (1e:54a1) ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_794b1 - FuncCoord 16, 0 ; $c3b0 - ld hl, Coord - FuncCoord 14, 0 ; $c3ae - ld de, Coord + hlCoord 16, 0 + deCoord 14, 0 jr .asm_794b7 .asm_794b1 - FuncCoord 5, 5 ; $c409 - ld hl, Coord - FuncCoord 3, 5 ; $c407 - ld de, Coord + hlCoord 5, 5 + deCoord 3, 5 .asm_794b7 push de xor a - ld [$d09f], a + ld [wd09f], a call Func_794d4 pop hl ld a, $1 - ld [$d09f], a + ld [wd09f], a call Func_794d4 pop bc dec c @@ -1712,7 +1700,7 @@ Func_794d4: ; 794d4 (1e:54d4) push bc push hl ld c, $3 - ld a, [$d09f] + ld a, [wd09f] cp $0 jr nz, .asm_794e7 call Func_7985b @@ -1743,9 +1731,9 @@ AnimationShootBallsUpward: ; 794f9 (1e:54f9) ld bc, $3028 .asm_79506 ld a, b - ld [W_BASECOORDY], a ; $d082 + ld [W_BASECOORDY], a ; wd082 ld a, c - ld [W_BASECOORDX], a ; $d081 + ld [W_BASECOORDX], a ; wd081 ld bc, $501 call Func_79517 jp AnimationCleanOAM @@ -1753,13 +1741,13 @@ AnimationShootBallsUpward: ; 794f9 (1e:54f9) Func_79517: ; 79517 (1e:5517) push bc xor a - ld [$d09f], a + ld [wd09f], a call LoadAnimationTileset pop bc ld d, $7a ld hl, wOAMBuffer push bc - ld a, [W_BASECOORDY] ; $d082 + ld a, [W_BASECOORDY] ; wd082 ld e, a .asm_7952a call Func_79329 @@ -1768,12 +1756,12 @@ Func_79517: ; 79517 (1e:5517) call DelayFrame pop bc ld a, b - ld [$d08a], a + ld [wd08a], a .asm_79538 push bc ld hl, wOAMBuffer .asm_7953c - ld a, [W_BASECOORDY] ; $d082 + ld a, [W_BASECOORDY] ; wd082 add $8 ld e, a ld a, [hl] @@ -1784,9 +1772,9 @@ Func_79517: ; 79517 (1e:5517) jr .asm_79554 .asm_7954b ld [hl], $0 - ld a, [$d08a] + ld a, [wd08a] dec a - ld [$d08a], a + ld [wd08a], a .asm_79554 ld de, $4 add hl, de @@ -1794,7 +1782,7 @@ Func_79517: ; 79517 (1e:5517) jr nz, .asm_7953c call DelayFrames pop bc - ld a, [$d08a] + ld a, [wd08a] and a jr nz, .asm_79538 ret @@ -1838,7 +1826,7 @@ UpwardBallsAnimXCoordinatesEnemyTurn: ; 79598 (1e:5598) AnimationMinimizeMon: ; 7959f (1e:559f) ; Changes the mon's sprite to a mini black sprite. Used by the ; Minimize animation. - ld hl, $c6e8 + ld hl, wTempPic push hl xor a ld bc, $310 @@ -1883,7 +1871,7 @@ AnimationSlideMonDownAndHide: ; 795c9 (1e:55c9) dec c jr nz, .asm_795cd call AnimationHideMonPic - ld hl, $c6e8 + ld hl, wTempPic ld bc, $0310 xor a call FillMemory @@ -1893,12 +1881,10 @@ Func_795f8: ; 795f8 (1e:55f8) ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_79602 - FuncCoord 12, 0 ; $c3ac - ld hl, Coord + hlCoord 12, 0 jr .asm_79605 .asm_79602 - FuncCoord 0, 5 ; $c404 - ld hl, Coord + hlCoord 0, 5 .asm_79605 ld d, $8 .asm_79607 @@ -1924,7 +1910,7 @@ Func_795f8: ; 795f8 (1e:55f8) pop de dec b jr nz, .asm_7960a - ld a, [W_SUBANIMTRANSFORM] ; $d08b + ld a, [W_SUBANIMTRANSFORM] ; W_SUBANIMTRANSFORM ld c, a call DelayFrames pop hl @@ -1960,17 +1946,17 @@ AnimationSlideMonHalfLeft: ; 79645 (1e:5645) Func_79652: ; 79652 (1e:5652) ld a, [H_WHOSETURN] ; $fff3 and a - ld hl, $9310 + ld hl, vBackPic jr z, .asm_7965d - ld hl, $9000 + ld hl, vFrontPic .asm_7965d - ld de, $c6e8 - ld bc, $31 + ld de, wTempPic + ld bc, 7 * 7 jp CopyVideoData AnimationWavyScreen: ; 79666 (1e:5666) ; used in Psywave/Psychic etc. - ld hl, $9800 + ld hl, vBGMap0 call Func_79e0d call Delay3 xor a @@ -2005,7 +1991,7 @@ AnimationWavyScreen: ; 79666 (1e:5666) ld [H_AUTOBGTRANSFERENABLED], a call Delay3 call LoadScreenTilesFromBuffer2 - ld hl, $9c00 + ld hl, vBGMap1 call Func_79e0d ret @@ -2031,38 +2017,38 @@ WavyScreenLineOffsets: ; 796bf (1e:56bf) AnimationSubstitute: ; 796e0 (1e:56e0) ; Changes the pokemon's sprite to the mini sprite - ld hl, $c6e8 + ld hl, wTempPic xor a ld bc, $0310 call FillMemory ld a, [$fff3] and a jr z, .asm_79715 ; 0x796ed $26 - ld hl, SlowbroSprite ; $4780 ; facing down sprite - ld de, $c808 + ld hl, SlowbroSprite ; facing down sprite + ld de, wTempPic + $120 call CopySlowbroSpriteData - ld hl, SlowbroSprite + $10 ; $4790 - ld de, $c878 + ld hl, SlowbroSprite + $10 + ld de, wTempPic + $120 + $70 call CopySlowbroSpriteData - ld hl, SlowbroSprite + $20 ; $47a0 - ld de, $c818 + ld hl, SlowbroSprite + $20 + ld de, wTempPic + $120 + $10 call CopySlowbroSpriteData - ld hl, SlowbroSprite + $30 ; $47b0 - ld de, $c888 + ld hl, SlowbroSprite + $30 + ld de, wTempPic + $120 + $10 + $70 call CopySlowbroSpriteData - jr .asm_79739 ; 0x79713 $24 + jr .asm_79739 .asm_79715 - ld hl, SlowbroSprite + $40 ; $47c0 ; facing up sprite - ld de, $c878 + ld hl, SlowbroSprite + $40 ; facing up sprite + ld de, wTempPic + $120 + $70 call CopySlowbroSpriteData - ld hl, SlowbroSprite + $50 ; $47d0 - ld de, $c8e8 + ld hl, SlowbroSprite + $50 + ld de, wTempPic + $120 + $e0 call CopySlowbroSpriteData - ld hl, SlowbroSprite + $60 ; $47e0 - ld de, $c888 + ld hl, SlowbroSprite + $60 + ld de, wTempPic + $120 + $80 call CopySlowbroSpriteData - ld hl, SlowbroSprite + $70 ; $47f0 - ld de, $c8f8 + ld hl, SlowbroSprite + $70 + ld de, wTempPic + $120 + $f0 call CopySlowbroSpriteData .asm_79739 call Func_79652 @@ -2076,11 +2062,11 @@ CopySlowbroSpriteData: ; 7973f (1e:573f) Func_79747: ; 79747 (1e:5747) ld a, [H_WHOSETURN] ; $fff3 and a - ld hl, $ccf7 - ld a, [W_PLAYERBATTSTATUS2] ; $d063 + ld hl, wccf7 + ld a, [W_PLAYERBATTSTATUS2] ; W_PLAYERBATTSTATUS2 jr z, .asm_79758 - ld hl, $ccf3 - ld a, [W_ENEMYBATTSTATUS2] ; $d068 + ld hl, wccf3 + ld a, [W_ENEMYBATTSTATUS2] ; W_ENEMYBATTSTATUS2 .asm_79758 push hl bit 4, a @@ -2117,40 +2103,38 @@ AnimationBoundUpAndDown: ; 7977a (1e:577a) AnimationTransformMon: ; 79787 (1e:5787) ; Redraws this mon's sprite as the back/front sprite of the opposing mon. ; Used in Transform. - ld a, [$cfe5] - ld [$ceea], a - ld a, [W_PLAYERMONID] - ld [$cee9], a + ld a, [wEnemyMonSpecies] + ld [wHPBarMaxHP + 1], a + ld a, [wBattleMonSpecies] + ld [wHPBarMaxHP], a Func_79793: ; 79793 (1e:5793) ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_797b0 - ld a, [$cee9] - ld [$cf91], a - ld [$d0b5], a + ld a, [wHPBarMaxHP] + ld [wcf91], a + ld [wd0b5], a xor a ld [W_SPRITEFLIPPED], a call GetMonHeader - FuncCoord 12, 0 ; $c3ac - ld hl, Coord + hlCoord 12, 0 call LoadFrontSpriteByMonIndex jr .asm_797d3 .asm_797b0 - ld a, [$cfd9] + ld a, [wBattleMonSpecies2] push af - ld a, [$ceea] - ld [$cfd9], a - ld [$d0b5], a + ld a, [wHPBarMaxHP + 1] + ld [wBattleMonSpecies2], a + ld [wd0b5], a call GetMonHeader - ld a, $4 - call Predef ; indirect jump to LoadMonBackSprite (3f103 (f:7103)) + predef LoadMonBackPic xor a call Func_79842 call Func_79820 call Func_79aae pop af - ld [$cfd9], a + ld [wBattleMonSpecies2], a .asm_797d3 ld b, $1 jp GoPAL_SET @@ -2168,13 +2152,13 @@ AnimationHideEnemyMonPic: ; 797d8 (1e:57d8) Func_797e8: ; 797e8 (1e:57e8) push bc push de - ld [$d09f], a + ld [wd09f], a call LoadAnimationTileset pop de pop bc xor a ld e, a - ld [W_BASECOORDX], a ; $d081 + ld [W_BASECOORDX], a ; wd081 ld hl, wOAMBuffer .asm_797fa call Func_79329 @@ -2291,28 +2275,28 @@ Func_7986f: ; 7986f (1e:586f) ld a,[H_WHOSETURN] and a jr nz,.next - ld a,[W_PLAYERMONID] ; get number of current monster + ld a,[wBattleMonSpecies] ; get number of current monster jr .Continue .next - ld a,[$CFE5] + ld a,[wEnemyMonSpecies] .Continue push hl call GetCryData ld b,a pop hl - ld a,[$C0F1] + ld a,[wc0f1] add [hl] - ld [$C0F1],a + ld [wc0f1],a inc hl - ld a,[$C0F2] + ld a,[wc0f2] add [hl] - ld [$C0F2],a + ld [wc0f2],a jr .done .NotCryMove ld a,[hli] - ld [$C0F1],a + ld [wc0f1],a ld a,[hli] - ld [$C0F2],a + ld [wc0f2],a .done ld a,b ret @@ -2509,8 +2493,8 @@ Func_79aae: ; 79aae (1e:5aae) jr asm_79acb Func_79aba: ; 79aba (1e:5aba) - call Load16BitRegisters - ld a, [$cd6c] + call GetPredefRegisters + ld a, [wcd6c] and a jr nz, .asm_79ac8 ld de, Unknown_79b02 ; $5b02 @@ -2599,7 +2583,7 @@ AnimationLeavesFalling: ; 79c74 (1e:5c74) ; in Razor Leaf's animation. ld a, [$ff48] push af - ld a, [$cc79] + ld a, [wcc79] ld [$ff48], a ld d, $37 ld a, $3 @@ -2616,7 +2600,7 @@ AnimationPetalsFalling: ; 79c8a (1e:5c8a) ld a, $14 ld [W_SUBANIMTRANSFORM], a call Func_79c97 - jp CleanLCD_OAM + jp ClearSprites Func_79c97: ; 79c97 (1e:5c97) ld c, a @@ -2636,7 +2620,7 @@ Func_79c97: ; 79c97 (1e:5c97) push hl push de ld a, [hl] - ld [$d08a], a + ld [wd08a], a call Func_79d16 call Func_79cdb pop de @@ -2645,7 +2629,7 @@ Func_79c97: ; 79c97 (1e:5c97) ld e, l ld d, h pop hl - ld a, [$d08a] + ld a, [wd08a] ld [hli], a pop bc dec c @@ -2668,7 +2652,7 @@ Func_79cdb: ; 79cdb (1e:5cdb) ld a, $a0 .asm_79ce8 ld [hli], a - ld a, [$d08a] + ld a, [wd08a] ld b, a ld de, Unknown_79d0d and $7f @@ -2702,7 +2686,7 @@ Unknown_79d0d: ; 79d0d (1e:5d0d) db $00,$01,$03,$05,$07,$09,$0B,$0D,$0F Func_79d16: ; 79d16 (1e:5d16) - ld a, [$d08a] + ld a, [wd08a] inc a ld b, a and $7f @@ -2712,11 +2696,11 @@ Func_79d16: ; 79d16 (1e:5d16) and $80 xor $80 .asm_79d26 - ld [$d08a], a + ld [wd08a], a ret Func_79d2a: ; 79d2a (1e:5d2a) - ld hl, $c301 + ld hl, wOAMBuffer + $01 ld de, Unknown_79d3e ld a, [W_SUBANIMTRANSFORM] ld c, a @@ -2751,46 +2735,46 @@ Unknown_79d63: ; 79d63 (1e:5d63) db $00,$84,$06,$81,$02,$88,$01,$83,$05,$89,$09,$80,$07,$87,$03,$82,$04,$85,$08,$86 AnimationShakeEnemyHUD: ; 79d77 (1e:5d77) - ld de, $9310 - ld hl, $8000 - ld bc, $0031 + ld de, vBackPic + ld hl, vSprites + ld bc, 7 * 7 call CopyVideoData xor a ld [$ffae], a - ld hl, $9800 + ld hl, vBGMap0 call Func_79e0d ld a, $90 ld [$ffb0], a - ld hl, $9b20 + ld hl, vBGMap0 + $320 call Func_79e0d ld a, $38 ld [$ffb0], a call Func_792fd - ld hl, $9800 + ld hl, vBGMap0 call Func_79e0d call AnimationHideMonPic call Delay3 ld de, $0208 call Func_79de9 call AnimationShowMonPic - call CleanLCD_OAM + call ClearSprites ld a, $90 ld [$ffb0], a - ld hl, $9c00 + ld hl, vBGMap1 call Func_79e0d xor a ld [$ffb0], a call SaveScreenTilesToBuffer1 - ld hl, $9800 + ld hl, vBGMap0 call Func_79e0d call ClearScreen call Delay3 call LoadScreenTilesFromBuffer1 - ld hl, $9c00 + ld hl, vBGMap1 jp Func_79e0d Func_79dda: ; 79dda (1e:5dda) - call Load16BitRegisters + call GetPredefRegisters ld a, c ld [H_DOWNARROWBLINKCNT1], a ; $ff8b ld a, b @@ -2830,7 +2814,7 @@ TossBallAnimation: ; 79e16 (1e:5e16) ld a,[W_ISINBATTLE] cp a,2 jr z,.BlockBall ; if in trainer battle, play different animation - ld a,[$D11E] + ld a,[wd11e] ld b,a ; upper nybble: how many animations (from PokeBallAnimations) to play @@ -2843,11 +2827,11 @@ TossBallAnimation: ; 79e16 (1e:5e16) ; store these for later ld a,b and a,$F - ld [$CD3D],a + ld [wWhichTrade],a ld hl,.PokeBallAnimations ; choose which toss animation to use - ld a,[$CF91] + ld a,[wcf91] cp a,POKE_BALL ld b,TOSS_ANIM jr z,.done @@ -2885,7 +2869,7 @@ TossBallAnimation: ; 79e16 (1e:5e16) Func_79e6a: ; 79e6a (1e:5e6a) call WaitForSoundToFinish - ld a, [$d05b] + ld a, [wd05b] and $7f ret z cp $a @@ -2901,8 +2885,8 @@ Func_79e6a: ; 79e6a (1e:5e6a) ld b, $1 ld c, (SFX_08_51 - SFX_Headers_08) / 3 .asm_79e8b - ld [$c0f1], a + ld [wc0f1], a ld a, b - ld [$c0f2], a + ld [wc0f2], a ld a, c jp PlaySound diff --git a/engine/battle/b.asm b/engine/battle/b.asm index 7269e48c..24a75af4 100755 --- a/engine/battle/b.asm +++ b/engine/battle/b.asm @@ -1,5 +1,5 @@ DisplayEffectiveness: ; 2fb7b (b:7b7b) - ld a, [$D05B] + ld a, [wd05b] and a, $7F cp a, $0A ret z diff --git a/engine/battle/b_2.asm b/engine/battle/b_2.asm index b71ca40d..e343f1aa 100755 --- a/engine/battle/b_2.asm +++ b/engine/battle/b_2.asm @@ -86,13 +86,13 @@ DuplicateBitsTable: ; 2fea8 (b:7ea8) PayDayEffect_ ; 2feb8 (b:7eb8) xor a - ld hl, $cd6d + ld hl, wcd6d ld [hli], a ld a, [$fff3] and a - ld a, [$d022] + ld a, [wBattleMonLevel] jr z, .asm_2fec8 ; 0x2fec3 $3 - ld a, [$cff3] + ld a, [wEnemyMonLevel] .asm_2fec8 add a ld [$ff98], a @@ -118,10 +118,9 @@ PayDayEffect_ ; 2feb8 (b:7eb8) ld a, [$ff99] add b ld [hl], a - ld de, $cce7 + ld de, wcce7 ld c, $3 - ld a, $b - call Predef + predef AddBCDPredef ld hl, CoinsScatteredText ; $7f04 jp PrintText diff --git a/engine/battle/c.asm b/engine/battle/c.asm index b93cc273..c1347d24 100755 --- a/engine/battle/c.asm +++ b/engine/battle/c.asm @@ -21,19 +21,19 @@ ShroudedInMistText: ; 33f52 (c:7f52) db "@" OneHitKOEffect_: ; 33f57 (c:7f57) - ld hl, W_DAMAGE ; $d0d7 + ld hl, W_DAMAGE ; W_DAMAGE xor a ld [hli], a ld [hl], a ; set the damage output to zero dec a - ld [$d05e], a - ld hl, $d02a - ld de, $cffb + ld [wd05e], a + ld hl, wBattleMonSpeed + 1 + ld de, wEnemyMonSpeed + 1 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_33f72 - ld hl, $cffb - ld de, $d02a + ld hl, wEnemyMonSpeed + 1 + ld de, wBattleMonSpeed + 1 .asm_33f72 ld a, [de] dec de @@ -45,14 +45,14 @@ OneHitKOEffect_: ; 33f57 (c:7f57) ld a, [hl] sbc b jr c, .asm_33f8a - ld hl, W_DAMAGE ; $d0d7 + ld hl, W_DAMAGE ; W_DAMAGE ld a, $ff ld [hli], a ld [hl], a ld a, $2 - ld [$d05e], a + ld [wd05e], a ret .asm_33f8a ld a, $1 - ld [W_MOVEMISSED], a ; $d05f + ld [W_MOVEMISSED], a ; W_MOVEMISSED ret diff --git a/engine/battle/core.asm b/engine/battle/core.asm index a19919f4..b3495a29 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -94,16 +94,15 @@ EffectsArray5B: ; 3c049 (f:4049) Func_3c04c: ; 3c04c (f:404c) call Func_3ec92 ld a, $1 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID - FuncCoord 1, 5 ; $c405 - ld hl, Coord + hlCoord 1, 5 ld bc, $307 call ClearScreenArea call DisableLCD call LoadFontTilePatterns call Func_3ee58 - ld hl, $9800 + ld hl, vBGMap0 ld bc, $400 .asm_3c06f ld a, $7f @@ -113,7 +112,7 @@ Func_3c04c: ; 3c04c (f:404c) or c jr nz, .asm_3c06f ld hl, wTileMap - ld de, $9800 + ld de, vBGMap0 ld b, $12 .asm_3c07f ld c, $14 @@ -139,7 +138,7 @@ Func_3c04c: ; 3c04c (f:404c) ld [$ffd7], a ld [$ffaf], a dec a - ld [$cfcb], a + ld [wcfcb], a call Delay3 xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba @@ -171,10 +170,8 @@ Func_3c04c: ; 3c04c (f:404c) ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld a, $31 ld [$ffe1], a - FuncCoord 1, 5 ; $c405 - ld hl, Coord - ld a, $1 - call Predef ; indirect jump to Func_3f0c6 (3f0c6 (f:70c6)) + hlCoord 1, 5 + predef Func_3f0c6 xor a ld [$ffb0], a ld [rWY], a ; $ff4a @@ -183,14 +180,14 @@ Func_3c04c: ; 3c04c (f:404c) call Delay3 ld b, $1 call GoPAL_SET - call ResetLCD_OAM + call HideSprites ld hl, PrintBeginningBattleText ld b, BANK(PrintBeginningBattleText) jp Bankswitch Func_3c0ff: ; 3c0ff (f:40ff) push bc - ld hl, $c301 + ld hl, wOAMBuffer + $01 ld c, $15 ld de, $4 .asm_3c108 @@ -216,12 +213,12 @@ Func_3c110: ; 3c110 (f:4110) Func_3c11e: ; 3c11e (f:411e) xor a - ld [W_PLAYERMONSALIVEFLAGS], a - ld [$ccf5], a - ld [$cd6a], a + ld [wPartyAliveFlags], a + ld [wccf5], a + ld [wcd6a], a inc a - ld [$d11d], a - ld hl, W_ENEMYMON1HP ; $d8a5 + ld [wd11d], a + ld hl, wEnemyMon1HP ; wd8a5 ld bc, $2b ld d, $3 .asm_3c134 @@ -233,29 +230,29 @@ Func_3c11e: ; 3c11e (f:411e) jr .asm_3c134 .asm_3c13c ld a, d - ld [$cc3e], a - ld a, [W_ISINBATTLE] ; $d057 + ld [wcc3e], a + ld a, [W_ISINBATTLE] ; W_ISINBATTLE dec a call nz, Func_3c92a ld c, $28 call DelayFrames call SaveScreenTilesToBuffer1 .asm_3c14f - call AnyPlayerPokemonAliveCheck + call AnyPartyAlive ld a, d and a jp z, HandlePlayerBlackOut call LoadScreenTilesFromBuffer1 - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a and a jp z, Func_3c1ad .asm_3c161 call InitBattleMenu ret c - ld a, [$cd6a] + ld a, [wcd6a] and a jr z, .asm_3c161 - ld a, [W_NUMSAFARIBALLS] ; $da47 + ld a, [W_NUMSAFARIBALLS] ; W_NUMSAFARIBALLS and a jr nz, .asm_3c17a call LoadScreenTilesFromBuffer1 @@ -263,24 +260,24 @@ Func_3c11e: ; 3c11e (f:411e) jp PrintText .asm_3c17a callab PrintSafariZoneBattleText - ld a, [$cffb] + ld a, [wEnemyMonSpeed + 1] add a ld b, a jp c, asm_3c202 - ld a, [$cce9] + ld a, [wcce9] and a jr z, .asm_3c194 srl b srl b .asm_3c194 - ld a, [$cce8] + ld a, [wcce8] and a jr z, .asm_3c1a0 sla b jr nc, .asm_3c1a0 ld b, $ff .asm_3c1a0 - call GenRandom + call Random cp b jr nc, .asm_3c14f jr asm_3c202 @@ -291,53 +288,50 @@ OutOfSafariBallsText: ; 3c1a8 (f:41a8) Func_3c1ad: ; 3c1ad (f:41ad) xor a - ld [wWhichPokemon], a ; $cf92 + ld [wWhichPokemon], a ; wWhichPokemon .asm_3c1b1 call Func_3ca97 jr nz, .asm_3c1bc - ld hl, wWhichPokemon ; $cf92 + ld hl, wWhichPokemon ; wWhichPokemon inc [hl] jr .asm_3c1b1 .asm_3c1bc - ld a, [wWhichPokemon] ; $cf92 - ld [wPlayerMonNumber], a ; $cc2f + ld a, [wWhichPokemon] ; wWhichPokemon + ld [wPlayerMonNumber], a ; wPlayerMonNumber inc a - ld hl, W_NUMINPARTY ; $d163 + ld hl, wPartyCount ; wPartyCount ld c, a ld b, $0 add hl, bc ld a, [hl] - ld [$cf91], a - ld [$cfd9], a + ld [wcf91], a + ld [wBattleMonSpecies2], a call LoadScreenTilesFromBuffer1 - FuncCoord 1, 5 ; $c405 - ld hl, Coord + hlCoord 1, 5 ld a, $9 call Func_3c8df call SaveScreenTilesToBuffer1 - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon ld c, a ld b, $1 push bc - ld hl, W_PLAYERMONSALIVEFLAGS - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) - ld hl, $ccf5 + ld hl, wPartyAliveFlags + predef FlagActionPredef + ld hl, wccf5 pop bc - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + predef FlagActionPredef call Func_3cba6 call LoadScreenTilesFromBuffer1 call Func_3cc91 jr MainInBattleLoop asm_3c202: ; 3c202 (f:4202) call LoadScreenTilesFromBuffer1 - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 ld hl, WildRanText jr nz, .asm_3c216 xor a - ld [$cf0b], a + ld [wcf0b], a ld hl, EnemyRanText .asm_3c216 call PrintText @@ -359,53 +353,53 @@ EnemyRanText: ; 3c22e (f:422e) MainInBattleLoop: ; 3c233 (f:4233) call ReadPlayerMonCurHPAndStatus - ld hl, W_PLAYERMONCURHP + ld hl, wBattleMonHP ld a, [hli] or [hl] jp z, HandlePlayerMonFainted ; test if current player mon is fainted - ld hl, $cfe6 + ld hl, wEnemyMonHP ld a, [hli] or [hl] jp z, HandleEnemyMonFainted call SaveScreenTilesToBuffer1 xor a - ld [$d11d], a - ld a, [$d063] + ld [wd11d], a + ld a, [W_PLAYERBATTSTATUS2] and $60 jr nz, .asm_3c2a6 ; 0x3c252 $52 - ld hl, $d067 + ld hl, W_ENEMYBATTSTATUS1 res 3, [hl] - ld hl, $d062 + ld hl, W_PLAYERBATTSTATUS1 res 3, [hl] ld a, [hl] and $12 jr nz, .asm_3c2a6 ; 0x3c261 $43 call InitBattleMenu ; show battle menu ret c - ld a, [$d078] + ld a, [wd078] and a ret nz - ld a, [$d018] + ld a, [wBattleMonStatus] and $27 jr nz, .asm_3c2a6 ; 0x3c271 $33 - ld a, [$d062] + ld a, [W_PLAYERBATTSTATUS1] and $21 jr nz, .asm_3c2a6 ; 0x3c278 $2c - ld a, [$d067] + ld a, [W_ENEMYBATTSTATUS1] bit 5, a jr z, .asm_3c288 ; 0x3c27f $7 ld a, $ff - ld [$ccdc], a + ld [wPlayerSelectedMove], a jr .asm_3c2a6 ; 0x3c286 $1e .asm_3c288 - ld a, [$cd6a] + ld a, [wcd6a] and a jr nz, .asm_3c2a6 ; 0x3c28c $18 - ld [$ccdb], a + ld [wMoveMenuType], a inc a - ld [$d07c], a + ld [W_ANIMATIONID], a xor a - ld [$cc35], a + ld [wcc35], a call MoveSelectionMenu push af call LoadScreenTilesFromBuffer1 @@ -417,7 +411,7 @@ MainInBattleLoop: ; 3c233 (f:4233) ld a, [W_ISLINKBATTLE] cp $4 jr nz, .noLinkBattle - ld a, [$cc3e] + ld a, [wcc3e] cp $f jp z, asm_3c202 cp $e @@ -426,11 +420,11 @@ MainInBattleLoop: ; 3c233 (f:4233) jr z, .noLinkBattle sub $4 jr c, .noLinkBattle - ld a, [$d062] + ld a, [W_PLAYERBATTSTATUS1] bit 5, a jr z, .asm_3c2dd ; 0x3c2c9 $12 - ld a, [$cc2e] - ld hl, W_PLAYERMONMOVES + ld a, [wPlayerMoveListIndex] + ld hl, wBattleMonMoves ld c, a ld b, $0 add hl, bc @@ -464,8 +458,8 @@ MainInBattleLoop: ; 3c233 (f:4233) cp COUNTER jr z, .playerMovesFirst .compareSpeed - ld de, W_PLAYERMONSPEED ; player speed value - ld hl, W_ENEMYMONSPEED ; enemy speed value + ld de, wBattleMonSpeed ; player speed value + ld hl, wEnemyMonSpeed ; enemy speed value ld c, $2 call StringCmp ; compare speed values jr z, .speedEqual @@ -475,12 +469,12 @@ MainInBattleLoop: ; 3c233 (f:4233) ld a, [$ffaa] cp $2 jr z, .invertOutcome - call GenRandomInBattle + call BattleRandom cp $80 jr c, .playerMovesFirst jr .enemyMovesFirst .invertOutcome - call GenRandomInBattle + call BattleRandom cp $80 jr c, .enemyMovesFirst jr .playerMovesFirst @@ -490,7 +484,7 @@ MainInBattleLoop: ; 3c233 (f:4233) callab TrainerAI jr c, .AIActionUsedEnemyFirst call Func_3e6bc ; execute enemy move - ld a, [$d078] + ld a, [wd078] and a ret nz ld a, b @@ -501,7 +495,7 @@ MainInBattleLoop: ; 3c233 (f:4233) jp z, HandleEnemyMonFainted call Func_3cd5a call Func_3d65e ; execute player move - ld a, [$d078] + ld a, [wd078] and a ret nz ld a, b @@ -514,7 +508,7 @@ MainInBattleLoop: ; 3c233 (f:4233) jp MainInBattleLoop .playerMovesFirst call Func_3d65e ; execute player move - ld a, [$d078] + ld a, [wd078] and a ret nz ld a, b @@ -528,7 +522,7 @@ MainInBattleLoop: ; 3c233 (f:4233) callab TrainerAI jr c, .AIActionUsedPlayerFirst call Func_3e6bc ; execute enemy move - ld a, [$d078] + ld a, [wd078] and a ret nz ld a, b @@ -542,13 +536,13 @@ MainInBattleLoop: ; 3c233 (f:4233) jp MainInBattleLoop HandlePoisonBurnLeechSeed: ; 3c3bd (f:43bd) - ld hl, W_PLAYERMONCURHP ; $d015 - ld de, W_PLAYERMONSTATUS ; $d018 + ld hl, wBattleMonHP ; wd015 + ld de, wBattleMonStatus ; wBattleMonStatus ld a, [H_WHOSETURN] ; $fff3 and a jr z, .playersTurn - ld hl, W_ENEMYMONCURHP ; $cfe6 - ld de, W_ENEMYMONSTATUS ; $cfe9 + ld hl, wEnemyMonHP ; wEnemyMonHP + ld de, wEnemyMonStatus ; wcfe9 .playersTurn ld a, [de] and (1 << BRN) | (1 << PSN) @@ -562,17 +556,17 @@ HandlePoisonBurnLeechSeed: ; 3c3bd (f:43bd) .poisoned call PrintText xor a - ld [$cc5b], a + ld [wcc5b], a ld a,BURN_PSN_ANIM call PlayMoveAnimation ; play burn/poison animation pop hl call HandlePoisonBurnLeechSeed_DecreaseOwnHP .notBurnedOrPoisoned - ld de, W_PLAYERBATTSTATUS2 ; $d063 + ld de, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .playersTurn2 - ld de, W_ENEMYBATTSTATUS2 ; $d068 + ld de, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2 .playersTurn2 ld a, [de] add a @@ -583,7 +577,7 @@ HandlePoisonBurnLeechSeed: ; 3c3bd (f:43bd) xor $1 ld [H_WHOSETURN], a ; $fff3 xor a - ld [$cc5b], a + ld [wcc5b], a ld a,ABSORB call PlayMoveAnimation ; play leech seed animation (from opposing mon) pop af @@ -643,13 +637,13 @@ HandlePoisonBurnLeechSeed_DecreaseOwnHP: ; 3c43d (f:443d) jr nz, .nonZeroDamage inc c ; damage is at least 1 .nonZeroDamage - ld hl, W_PLAYERBATTSTATUS3 ; $d064 - ld de, W_PLAYERTOXICCOUNTER ; $d06c + ld hl, W_PLAYERBATTSTATUS3 ; W_PLAYERBATTSTATUS3 + ld de, W_PLAYERTOXICCOUNTER ; wd06c ld a, [H_WHOSETURN] ; $fff3 and a jr z, .playersTurn - ld hl, W_ENEMYBATTSTATUS3 ; $d069 - ld de, W_ENEMYTOXICCOUNTER ; $d071 + ld hl, W_ENEMYBATTSTATUS3 ; W_ENEMYBATTSTATUS3 + ld de, W_ENEMYTOXICCOUNTER ; wd071 .playersTurn bit 0, [hl] jr z, .noToxic @@ -690,11 +684,11 @@ HandlePoisonBurnLeechSeed_DecreaseOwnHP: ; 3c43d (f:443d) ; adds bc to enemy HP HandlePoisonBurnLeechSeed_IncreaseEnemyHP: ; 3c4a3 (f:44a3) push hl - ld hl, W_ENEMYMONMAXHP ; $cff4 + ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP ld a, [H_WHOSETURN] ; $fff3 and a jr z, .playersTurn - ld hl, W_PLAYERMONMAXHP ; $d023 + ld hl, wBattleMonMaxHP ; wd023 .playersTurn ld a, [hli] ld [wHPBarMaxHP+1], a @@ -739,55 +733,52 @@ HandlePoisonBurnLeechSeed_IncreaseEnemyHP: ; 3c4a3 (f:44a3) ret UpdateCurMonHPBar: ; 3c4f6 (f:44f6) - FuncCoord 10, 9 ; $c45e - ld hl, Coord ; tile pointer to player HP bar + hlCoord 10, 9 ; tile pointer to player HP bar ld a, [H_WHOSETURN] ; $fff3 and a ld a, $1 jr z, .playersTurn - FuncCoord 2, 2 ; $c3ca - ld hl, Coord ; tile pointer to enemy HP bar + hlCoord 2, 2 ; tile pointer to enemy HP bar xor a .playersTurn push bc - ld [wListMenuID], a ; $cf94 - ld a, $48 - call Predef ; indirect jump to UpdateHPBar (fa1d (3:7a1d)) + ld [wListMenuID], a ; wListMenuID + predef UpdateHPBar2 pop bc ret Func_3c50f: ; 3c50f (f:450f) - ld a, [$d06a] + ld a, [wd06a] and a jr nz, .asm_3c51a - ld hl, W_PLAYERBATTSTATUS1 ; $d062 + ld hl, W_PLAYERBATTSTATUS1 ; W_PLAYERBATTSTATUS1 res 5, [hl] .asm_3c51a - ld a, [$d06f] + ld a, [wd06f] and a ret nz - ld hl, W_ENEMYBATTSTATUS1 ; $d067 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 res 5, [hl] ret HandleEnemyMonFainted: ; 3c525 (f:4525) xor a - ld [$ccf0], a + ld [wccf0], a call FaintEnemyPokemon - call AnyPlayerPokemonAliveCheck + call AnyPartyAlive ld a, d and a jp z, HandlePlayerBlackOut - ld hl, W_PLAYERMONCURHP ; $d015 + ld hl, wBattleMonHP ; wd015 ld a, [hli] or [hl] call nz, Func_3cd60 - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE dec a ret z call AnyEnemyPokemonAliveCheck jp z, TrainerBattleVictory - ld hl, W_PLAYERMONCURHP ; $d015 + ld hl, wBattleMonHP ; wd015 ld a, [hli] or [hl] jr nz, .asm_3c555 @@ -796,60 +787,58 @@ HandleEnemyMonFainted: ; 3c525 (f:4525) call Func_3c7d8 .asm_3c555 ld a, $1 - ld [$cd6a], a + ld [wcd6a], a call Func_3c664 jp z, asm_3c202 xor a - ld [$cd6a], a + ld [wcd6a], a jp MainInBattleLoop FaintEnemyPokemon ; 0x3c567 call ReadPlayerMonCurHPAndStatus - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE dec a jr z, .wild - ld a, [W_ENEMYMONNUMBER] ; $cfe8 - ld hl, W_ENEMYMON1HP + ld a, [wEnemyMonPartyPos] + ld hl, wEnemyMon1HP ld bc, $2c ; mon struct len call AddNTimes xor a ld [hli], a ld [hl], a .wild - ld hl, W_PLAYERBATTSTATUS1 ; $d062 + ld hl, W_PLAYERBATTSTATUS1 ; W_PLAYERBATTSTATUS1 res 2, [hl] xor a - ld [W_NUMHITS], a ; $d074 - ld hl, $d065 ; enemy statuses + ld [W_NUMHITS], a ; wd074 + ld hl, wd065 ; enemy statuses ld [hli], a ld [hli], a ld [hli], a ld [hli], a ld [hl], a - ld [W_ENEMYDISABLEDMOVE], a ; $d072 - ld [$ccef], a - ld [$ccf3], a - ld hl, $ccf1 + ld [W_ENEMYDISABLEDMOVE], a ; W_ENEMYDISABLEDMOVE + ld [wccef], a + ld [wccf3], a + ld hl, wccf1 ld [hli], a ld [hl], a - FuncCoord 12, 5 ; $c410 - ld hl, Coord - FuncCoord 12, 6 ; $c424 - ld de, Coord + hlCoord 12, 5 + deCoord 12, 6 call Func_3c893 ld hl, wTileMap ld bc, $40b call ClearScreenArea - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE dec a jr z, .wild_win xor a - ld [$c0f1], a - ld [$c0f2], a + ld [wc0f1], a + ld [wc0f2], a ld a, (SFX_08_48 - SFX_Headers_08) / 3 ; SFX_FALL? call PlaySoundWaitForCurrent .sfxwait - ld a, [$c02a] + ld a, [wc02a] cp (SFX_08_48 - SFX_Headers_08) / 3 jr z, .sfxwait ld a, (SFX_08_43 - SFX_Headers_08) / 3 ; SFX_DROP @@ -861,16 +850,16 @@ FaintEnemyPokemon ; 0x3c567 ld a, MUSIC_DEFEATED_WILD_MON call PlayBattleVictoryMusic .sfxplayed - ld hl, W_PLAYERMONCURHP ; $d015 + ld hl, wBattleMonHP ; wd015 ld a, [hli] or [hl] jr nz, .playermonnotfaint - ld a, [$ccf0] + ld a, [wccf0] and a jr nz, .playermonnotfaint call Func_3c741 .playermonnotfaint - call AnyPlayerPokemonAliveCheck + call AnyPartyAlive ld a, d and a ret z @@ -879,12 +868,12 @@ FaintEnemyPokemon ; 0x3c567 call Func_3ee94 call SaveScreenTilesToBuffer1 xor a - ld [$cf0b], a + ld [wcf0b], a ld b, EXP__ALL call IsItemInBag push af jr z, .no_exp_all - ld hl, $d002 + ld hl, wd002 ld b, $7 .exp_all_loop srl [hl] @@ -893,13 +882,13 @@ FaintEnemyPokemon ; 0x3c567 jr nz, .exp_all_loop .no_exp_all xor a - ld [$cc5b], a + ld [wcc5b], a callab GainExperience pop af ret z ld a, $1 - ld [$cc5b], a - ld a, [W_NUMINPARTY] ; $d163 + ld [wcc5b], a + ld a, [wPartyCount] ; wPartyCount ld b, $0 .asm_3c62c scf @@ -907,7 +896,7 @@ FaintEnemyPokemon ; 0x3c567 dec a jr nz, .asm_3c62c ld a, b - ld [W_PLAYERMONSALIVEFLAGS], a + ld [wPartyAliveFlags], a ld hl, GainExperience ld b, BANK(GainExperience) jp Bankswitch @@ -918,17 +907,17 @@ EnemyMonFaintedText: ; 0x3c63e Func_3c643: ; 3c643 (f:4643) xor a - ld [$d083], a - ld [$c02a], a + ld [wd083], a + ld [wc02a], a inc a - ld [$ccf6], a + ld [wccf6], a ret AnyEnemyPokemonAliveCheck: ; 3c64f (f:464f) - ld a, [wEnemyPartyCount] ; $d89c + ld a, [wEnemyPartyCount] ; wEnemyPartyCount ld b, a xor a - ld hl, W_ENEMYMON1HP ; $d8a5 + ld hl, wEnemyMon1HP ; wd8a5 ld de, $2c .asm_3c65a or [hl] @@ -942,49 +931,49 @@ AnyEnemyPokemonAliveCheck: ; 3c64f (f:464f) ret Func_3c664: ; 3c664 (f:4664) - ld hl, $cf1e + ld hl, wcf1e ld e, $30 call GetBattleHealthBarColor callab DrawEnemyPokeballs - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 jr nz, .asm_3c687 call Func_3d605 - ld a, [$cc3e] + ld a, [wcc3e] cp $f ret z call LoadScreenTilesFromBuffer1 .asm_3c687 call EnemySendOut xor a - ld [W_ENEMYMOVENUM], a ; $cfcc - ld [$cd6a], a - ld [$ccd5], a + ld [W_ENEMYMOVENUM], a ; W_ENEMYMOVENUM + ld [wcd6a], a + ld [wccd5], a inc a ret TrainerBattleVictory: ; 3c696 (f:4696) call Func_3c643 ld b, MUSIC_DEFEATED_GYM_LEADER - ld a, [W_GYMLEADERNO] ; $d05c + ld a, [W_GYMLEADERNO] ; W_GYMLEADERNO and a jr nz, .gymleader ld b, MUSIC_DEFEATED_TRAINER .gymleader - ld a, [W_TRAINERCLASS] ; $d031 + ld a, [W_TRAINERCLASS] ; wd031 cp SONY3 ; final battle against rival jr nz, .notrival ld b, MUSIC_DEFEATED_GYM_LEADER ld hl, W_FLAGS_D733 set 1, [hl] .notrival - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 ld a, b call nz, PlayBattleVictoryMusic ld hl, TrainerDefeatedText call PrintText - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 ret z call ScrollTrainerPicAfterBattle @@ -993,11 +982,10 @@ TrainerBattleVictory: ; 3c696 (f:4696) call Func_3381 ld hl, MoneyForWinningText call PrintText - ld de, wPlayerMoney + 2 ; $d349 - ld hl, $d07b + ld de, wPlayerMoney + 2 ; wd349 + ld hl, wd07b ld c, $3 - ld a, $b - jp Predef ; indirect jump to Func_f81d (f81d (3:781d)) + predef_jump AddBCDPredef MoneyForWinningText: ; 3c6e4 (f:46e4) TX_FAR _MoneyForWinningText @@ -1010,7 +998,7 @@ TrainerDefeatedText: ; 3c6e9 (f:46e9) PlayBattleVictoryMusic: ; 3c6ee (f:46ee) push af ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySoundWaitForCurrent ld c, BANK(Music_DefeatedTrainer) pop af @@ -1019,18 +1007,18 @@ PlayBattleVictoryMusic: ; 3c6ee (f:46ee) HandlePlayerMonFainted: ; 3c700 (f:4700) ld a, $1 - ld [$ccf0], a + ld [wccf0], a call Func_3c741 - call AnyPlayerPokemonAliveCheck ; test if any more mons are alive + call AnyPartyAlive ; test if any more mons are alive ld a, d and a jp z, HandlePlayerBlackOut - ld hl, W_ENEMYMONCURHP ; $cfe6 + ld hl, wEnemyMonHP ; wEnemyMonHP ld a, [hli] or [hl] jr nz, .enemyMonNotFainted call FaintEnemyPokemon - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE dec a ret z ; if wild encounter, battle is over call AnyEnemyPokemonAliveCheck @@ -1041,49 +1029,45 @@ HandlePlayerMonFainted: ; 3c700 (f:4700) call Func_3c7d8 jp nz, MainInBattleLoop ld a, $1 - ld [$cd6a], a + ld [wcd6a], a call Func_3c664 jp z, asm_3c202 xor a - ld [$cd6a], a + ld [wcd6a], a jp MainInBattleLoop Func_3c741: ; 3c741 (f:4741) - ld a, [wPlayerMonNumber] ; $cc2f + ld a, [wPlayerMonNumber] ; wPlayerMonNumber ld c, a - ld hl, W_PLAYERMONSALIVEFLAGS ; clear fainted mon's alive flag + ld hl, wPartyAliveFlags ; clear fainted mon's alive flag ld b, $0 - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) - ld hl, W_ENEMYBATTSTATUS1 ; $d067 + predef FlagActionPredef + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 res 2, [hl] ; reset "attacking multiple times" flag - ld a, [$d083] + ld a, [wd083] bit 7, a ; skip sound flag (red bar (?)) jr z, .skipWaitForSound ld a, $ff - ld [$d083], a + ld [wd083], a call WaitForSoundToFinish .skipWaitForSound - ld hl, $cd05 + ld hl, wcd05 ld [hli], a ld [hl], a - ld [W_PLAYERMONSTATUS], a ; $d018 + ld [wBattleMonStatus], a ; wBattleMonStatus call ReadPlayerMonCurHPAndStatus - FuncCoord 9, 7 ; $c435 - ld hl, Coord + hlCoord 9, 7 ld bc, $50b call ClearScreenArea - FuncCoord 1, 10 ; $c469 - ld hl, Coord - FuncCoord 1, 11 ; $c47d - ld de, Coord + hlCoord 1, 10 + deCoord 1, 11 call Func_3c893 ld a, $1 - ld [$cf0b], a - ld a, [$ccf0] + ld [wcf0b], a + ld a, [wccf0] and a ret z - ld a, [W_PLAYERMONID] + ld a, [wBattleMonSpecies] call PlayCry ld hl, PlayerMonFaintedText jp PrintText @@ -1095,30 +1079,29 @@ PlayerMonFaintedText: ; 3c796 (f:4796) Func_3c79b: ; 3c79b (f:479b) call Func_3ee94 call SaveScreenTilesToBuffer1 - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE and a dec a ret nz ld hl, UseNextMonText call PrintText .asm_3c7ad - FuncCoord 13, 9 ; $c461 - ld hl, Coord + hlCoord 13, 9 ld bc, $a0e ld a, $14 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID - ld a, [$d12e] + ld a, [wd12e] cp $2 jr z, .asm_3c7c4 and a ret .asm_3c7c4 - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem and a jr z, .asm_3c7ad - ld hl, W_PARTYMON1_SPEED ; $d193 - ld de, W_ENEMYMONSPEED + ld hl, wPartyMon1Speed + ld de, wEnemyMonSpeed jp Func_3cab9 UseNextMonText: ; 3c7d3 (f:47d3) @@ -1127,7 +1110,7 @@ UseNextMonText: ; 3c7d3 (f:47d3) Func_3c7d8: ; 3c7d8 (f:47d8) ld a, $2 - ld [$d07d], a + ld [wd07d], a call DisplayPartyMenu .asm_3c7e0 jr nc, .asm_3c7e7 @@ -1137,28 +1120,26 @@ Func_3c7d8: ; 3c7d8 (f:47d8) .asm_3c7e7 call Func_3ca97 jr z, .asm_3c7e2 - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 jr nz, .asm_3c7fa inc a - ld [$cd6a], a + ld [wcd6a], a call Func_3d605 .asm_3c7fa xor a - ld [$cd6a], a - call CleanLCD_OAM - ld a, [wWhichPokemon] ; $cf92 - ld [wPlayerMonNumber], a ; $cc2f + ld [wcd6a], a + call ClearSprites + ld a, [wWhichPokemon] ; wWhichPokemon + ld [wPlayerMonNumber], a ; wPlayerMonNumber ld c, a - ld hl, W_PLAYERMONSALIVEFLAGS + ld hl, wPartyAliveFlags ld b, $1 push bc - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + predef FlagActionPredef pop bc - ld hl, $ccf5 - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + ld hl, wccf5 + predef FlagActionPredef call Func_3cba6 call GBPalWhiteOut call Func_3ee5b @@ -1166,7 +1147,7 @@ Func_3c7d8: ; 3c7d8 (f:47d8) call GoPAL_SET_CF1C call GBPalNormal call Func_3cc91 - ld hl, W_ENEMYMONCURHP ; $cfe6 + ld hl, wEnemyMonHP ; wEnemyMonHP ld a, [hli] or [hl] ret @@ -1174,10 +1155,10 @@ Func_3c7d8: ; 3c7d8 (f:47d8) ; called when player is out of usable mons. ; prints approriate lose message, sets carry flag if player blacked out (special case for initial rival fight) HandlePlayerBlackOut: ; 3c837 (f:4837) - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 jr z, .notSony1Battle - ld a, [W_CUROPPONENT] ; $d059 + ld a, [W_CUROPPONENT] ; wd059 cp $c8 + SONY1 jr nz, .notSony1Battle ld hl, wTileMap ; sony 1 battle @@ -1195,15 +1176,15 @@ HandlePlayerBlackOut: ; 3c837 (f:4837) ld b, $0 call GoPAL_SET ld hl, PlayerBlackedOutText2 - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 jr nz, .noLinkBattle ld hl, LinkBattleLostText .noLinkBattle call PrintText - ld a, [$d732] + ld a, [wd732] res 5, a - ld [$d732], a + ld [wd732], a call ClearScreen scf ret @@ -1221,10 +1202,10 @@ LinkBattleLostText: ; 3c88e (f:488e) db "@" Func_3c893: ; 3c893 (f:4893) - ld a, [$d730] + ld a, [wd730] push af set 6, a - ld [$d730], a + ld [wd730], a ld b, $7 .asm_3c89e push bc @@ -1263,7 +1244,7 @@ Func_3c893: ; 3c893 (f:4893) dec b jr nz, .asm_3c89e pop af - ld [$d730], a + ld [wd730], a ret SevenSpacesText: ; 3c8d7 (f:48d7) @@ -1310,49 +1291,46 @@ Func_3c8df: ; 3c8df (f:48df) ; XXX this needs cleaning up. it's what runs when a juggler switches pokemon EnemySendOut: ; 3c90e (f:490e) - ld hl,W_PLAYERMONSALIVEFLAGS + ld hl,wPartyAliveFlags xor a ld [hl],a - ld a,[$CC2F] + ld a,[wPlayerMonNumber] ld c,a ld b,1 push bc - ld a,$10 - call Predef - ld hl,$CCF5 + predef FlagActionPredef + ld hl,wccf5 xor a ld [hl],a pop bc - ld a,$10 - call Predef + predef FlagActionPredef Func_3c92a: ; 3c92a (f:492a) xor a - ld hl,$D065 + ld hl,wd065 ld [hli],a ld [hli],a ld [hli],a ld [hli],a ld [hl],a - ld [$D072],a - ld [$CCEF],a - ld [$CCF3],a - ld hl,$CCF1 + ld [W_ENEMYDISABLEDMOVE],a + ld [wccef],a + ld [wccf3],a + ld hl,wccf1 ld [hli],a ld [hl],a dec a ld [wAICount],a ld hl,W_PLAYERBATTSTATUS1 res 5,[hl] - FuncCoord 18, 0 ; $c3b2 - ld hl,Coord + hlCoord 18, 0 ld a,8 call Func_3c8df call Func_3ee94 call SaveScreenTilesToBuffer1 - ld a,[$D12B] + ld a,[W_ISLINKBATTLE] cp 4 jr nz,.next - ld a,[$CC3E] + ld a,[wcc3e] sub 4 ld [wWhichPokemon],a jr .next3 @@ -1360,14 +1338,14 @@ Func_3c92a: ; 3c92a (f:492a) ld b,$FF .next2 inc b - ld a,[$CFE8] + ld a,[wEnemyMonPartyPos] cp b jr z,.next2 - ld hl,$D8A4 + ld hl,wEnemyMon1 ld a,b ld [wWhichPokemon],a push bc - ld bc,$2C + ld bc,wEnemyMon2 - wEnemyMon1 call AddNTimes pop bc inc hl @@ -1378,59 +1356,58 @@ Func_3c92a: ; 3c92a (f:492a) jr z,.next2 .next3 ld a,[wWhichPokemon] - ld hl,$D8C5 - ld bc,$2C + ld hl,wEnemyMon1Level + ld bc,wEnemyMon2 - wEnemyMon1 call AddNTimes ld a,[hl] - ld [$D127],a + ld [W_CURENEMYLVL],a ld a,[wWhichPokemon] inc a - ld hl,$D89C + ld hl,wEnemyPartyCount ld c,a ld b,0 add hl,bc ld a,[hl] - ld [W_ENEMYMONID],a - ld [$CF91],a + ld [wEnemyMonSpecies2],a + ld [wcf91],a call Func_3eb01 - ld hl,$CFE6 + ld hl,wEnemyMonHP ld a,[hli] - ld [$CCE3],a + ld [wcce3],a ld a,[hl] - ld [$CCE4],a + ld [wcce4],a ld a,1 - ld [$CC26],a - ld a,[$D11D] + ld [wCurrentMenuItem],a + ld a,[wd11d] dec a jr z,.next4 - ld a,[W_NUMINPARTY] + ld a,[wPartyCount] dec a jr z,.next4 - ld a,[$D12B] + ld a,[W_ISLINKBATTLE] cp 4 jr z,.next4 - ld a,[$D355] + ld a,[W_OPTIONS] bit 6,a jr nz,.next4 ld hl, TrainerAboutToUseText call PrintText - FuncCoord 0, 7 ; $c42c - ld hl,Coord + hlCoord 0, 7 ld bc,$0801 ld a,$14 - ld [$D125],a + ld [wd125],a call DisplayTextBoxID - ld a,[$CC26] + ld a,[wCurrentMenuItem] and a jr nz,.next4 ld a,2 - ld [$D07D],a + ld [wd07d],a call DisplayPartyMenu .next9 ld a,1 - ld [$CC26],a + ld [wCurrentMenuItem],a jr c,.next7 - ld hl,$CC2F + ld hl,wPlayerMonNumber ld a,[wWhichPokemon] cp [hl] jr nz,.next6 @@ -1443,13 +1420,13 @@ Func_3c92a: ; 3c92a (f:492a) call Func_3ca97 jr z,.next8 xor a - ld [$CC26],a + ld [wCurrentMenuItem],a .next7 call GBPalWhiteOut call Func_3ee5b call LoadScreenTilesFromBuffer1 .next4 - call CleanLCD_OAM + call ClearSprites ld hl,wTileMap ld bc,$040B call ClearScreenArea @@ -1458,27 +1435,25 @@ Func_3c92a: ; 3c92a (f:492a) call GBPalNormal ld hl,TrainerSentOutText call PrintText - ld a,[W_ENEMYMONID] - ld [$CF91],a - ld [$D0B5],a + ld a,[wEnemyMonSpecies2] + ld [wcf91],a + ld [wd0b5],a call GetMonHeader - ld de,$9000 + ld de,vFrontPic call LoadMonFrontSprite ld a,$CF ld [$FFE1],a - FuncCoord 15, 6 ; $c427 - ld hl,Coord - ld a,2 - call Predef - ld a,[W_ENEMYMONID] + hlCoord 15, 6 + predef Func_3f073 + ld a,[wEnemyMonSpecies2] call PlayCry call Func_3cdec - ld a,[$CC26] + ld a,[wCurrentMenuItem] and a ret nz xor a - ld [W_PLAYERMONSALIVEFLAGS],a - ld [$CCF5],a + ld [wPartyAliveFlags],a + ld [wccf5],a call SaveScreenTilesToBuffer1 jp Func_3d1ba @@ -1492,12 +1467,12 @@ TrainerSentOutText: ; 3ca7e (f:4a7e) ; tests if the player has any pokemon that are not fainted ; sets d = 0 if all fainted, d != 0 if some mons are still alive -AnyPlayerPokemonAliveCheck: ; 3ca83 (f:4a83) - ld a, [W_NUMINPARTY] ; $d163 +AnyPartyAlive: ; 3ca83 (f:4a83) + ld a, [wPartyCount] ; wPartyCount ld e, a xor a - ld hl, W_PARTYMON1_HP ; $d16c - ld bc, W_PARTYMON2DATA - W_PARTYMON1DATA - 1 + ld hl, wPartyMon1HP ; wd16c + ld bc, wPartyMon2 - wPartyMon1 - 1 .partyMonsLoop or [hl] inc hl @@ -1509,14 +1484,14 @@ AnyPlayerPokemonAliveCheck: ; 3ca83 (f:4a83) ret Func_3ca97: ; 3ca97 (f:4a97) - ld a, [wWhichPokemon] ; $cf92 - ld hl, W_PARTYMON1_HP ; $d16c + ld a, [wWhichPokemon] ; wWhichPokemon + ld hl, wPartyMon1HP ; wd16c ld bc, $2c call AddNTimes ld a, [hli] or [hl] ret nz - ld a, [$d11d] + ld a, [wd11d] and a jr nz, .asm_3cab2 ld hl, NoWillText @@ -1532,18 +1507,18 @@ NoWillText: ; 3cab4 (f:4ab4) Func_3cab9: ; 3cab9 (f:4ab9) call IsGhostBattle jp z, .asm_3cb5c - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a cp $2 jp z, .asm_3cb5c - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 jp z, .asm_3cb5c - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE dec a jr nz, .asm_3cb4c - ld a, [$d120] + ld a, [wd120] inc a - ld [$d120], a + ld [wd120], a ld a, [hli] ld [$ff97], a ld a, [hl] @@ -1583,7 +1558,7 @@ Func_3cab9: ; 3cab9 (f:4ab9) ld a, [$ff97] and a jr nz, .asm_3cb5c - ld a, [$d120] + ld a, [wd120] ld c, a .asm_3cb2b dec c @@ -1595,13 +1570,13 @@ Func_3cab9: ; 3cab9 (f:4ab9) jr c, .asm_3cb5c jr .asm_3cb2b .asm_3cb39 - call GenRandomInBattle + call BattleRandom ld b, a ld a, [$ff98] cp b jr nc, .asm_3cb5c ld a, $1 - ld [$cd6a], a + ld [wcd6a], a ld hl, CantEscapeText jr .asm_3cb4f .asm_3cb4c @@ -1609,29 +1584,29 @@ Func_3cab9: ; 3cab9 (f:4ab9) .asm_3cb4f call PrintText ld a, $1 - ld [$d11f], a + ld [wd11f], a call SaveScreenTilesToBuffer1 and a ret .asm_3cb5c - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 ld a, $2 jr nz, .asm_3cb81 call SaveScreenTilesToBuffer1 xor a - ld [$cd6a], a + ld [wcd6a], a ld a, $f - ld [wPlayerMoveListIndex], a ; $cc2e + ld [wPlayerMoveListIndex], a ; wPlayerMoveListIndex call Func_3d605 call LoadScreenTilesFromBuffer1 - ld a, [$cc3e] + ld a, [wcc3e] cp $f ld a, $2 jr z, .asm_3cb81 dec a .asm_3cb81 - ld [$cf0b], a + ld [wcf0b], a ld a, (SFX_08_44 - SFX_Headers_08) / 3 call PlaySoundWaitForCurrent ld hl, GotAwayText @@ -1654,42 +1629,42 @@ GotAwayText: ; 3cba1 (f:4ba1) db "@" Func_3cba6: ; 3cba6 (f:4ba6) - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon ld bc, $2c - ld hl, W_PARTYMON1_NUM ; $d16b (aliases: W_PARTYMON1DATA) + ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1) call AddNTimes - ld de, W_PLAYERMONID + ld de, wBattleMonSpecies ld bc, $c call CopyData ld bc, $f add hl, bc - ld de, W_PLAYERMONIVS + ld de, wBattleMonDVs ld bc, $2 call CopyData - ld de, W_PLAYERMONPP ; $d02d + ld de, wBattleMonPP ; wBattleMonPP ld bc, $4 call CopyData - ld de, W_PLAYERMONLEVEL ; $d022 + ld de, wBattleMonLevel ; wBattleMonLevel ld bc, $b call CopyData - ld a, [$cfd9] - ld [$d0b5], a + ld a, [wBattleMonSpecies2] + ld [wd0b5], a call GetMonHeader - ld hl, W_PARTYMON1NAME ; $d2b5 - ld a, [wPlayerMonNumber] ; $cc2f + ld hl, wPartyMonNicks ; wPartyMonNicks + ld a, [wPlayerMonNumber] ; wPlayerMonNumber call SkipFixedLengthTextEntries - ld de, W_PLAYERMONNAME + ld de, wBattleMonNick ld bc, $b call CopyData - ld hl, W_PLAYERMONLEVEL ; $d022 - ld de, $cd0f + ld hl, wBattleMonLevel ; wBattleMonLevel + ld de, wcd0f ld bc, $b call CopyData call Func_3ed1a call Func_3ee19 ld a, $7 ld b, $8 - ld hl, wPlayerMonAttackMod ; $cd1a + ld hl, wPlayerMonAttackMod ; wcd1a .asm_3cc0e ld [hli], a dec b @@ -1697,40 +1672,40 @@ Func_3cba6: ; 3cba6 (f:4ba6) ret Func_3cc13: ; 3cc13 (f:4c13) - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon ld bc, $2c - ld hl, wEnemyMons ; $d8a4 + ld hl, wEnemyMons ; wEnemyMon1Species call AddNTimes - ld de, $cfe5 + ld de, wEnemyMonSpecies ld bc, $c call CopyData ld bc, $f add hl, bc - ld de, $cff1 + ld de, wEnemyMonDVs ld bc, $2 call CopyData - ld de, W_ENEMYMONPP ; $cffe + ld de, wEnemyMonPP ; wcffe ld bc, $4 call CopyData - ld de, W_ENEMYMONLEVEL ; $cff3 + ld de, wEnemyMonLevel ; wEnemyMonLevel ld bc, $b call CopyData - ld a, [$cfe5] - ld [$d0b5], a + ld a, [wEnemyMonSpecies] + ld [wd0b5], a call GetMonHeader - ld hl, $d9ee - ld a, [wWhichPokemon] ; $cf92 + ld hl, wEnemyMonNicks + ld a, [wWhichPokemon] ; wWhichPokemon call SkipFixedLengthTextEntries - ld de, W_ENEMYMONNAME + ld de, wEnemyMonNick ld bc, $b call CopyData - ld hl, W_ENEMYMONLEVEL ; $cff3 - ld de, $cd23 + ld hl, wEnemyMonLevel ; wEnemyMonLevel + ld de, wcd23 ld bc, $b call CopyData call Func_3ed1e ld hl, W_MONHBASESTATS - ld de, $d002 + ld de, wd002 ld b, $5 .asm_3cc79 ld a, [hli] @@ -1740,18 +1715,18 @@ Func_3cc13: ; 3cc13 (f:4c13) jr nz, .asm_3cc79 ld a, $7 ld b, $8 - ld hl, wEnemyMonStatMods ; $cd2e + ld hl, wEnemyMonStatMods ; wcd2e .asm_3cc86 ld [hli], a dec b jr nz, .asm_3cc86 - ld a, [wWhichPokemon] ; $cf92 - ld [W_ENEMYMONNUMBER], a ; $cfe8 + ld a, [wWhichPokemon] ; wWhichPokemon + ld [wEnemyMonPartyPos], a ret Func_3cc91: ; 3cc91 (f:4c91) callab SendOutMon - ld hl, W_ENEMYMONCURHP ; $cfe6 + ld hl, wEnemyMonHP ; wEnemyMonHP ld a, [hli] or [hl] jp z, Func_3cca4 @@ -1759,91 +1734,81 @@ Func_3cc91: ; 3cc91 (f:4c91) Func_3cca4: ; 3cca4 (f:4ca4) call Func_3cd60 - ld a, $4 - call Predef ; indirect jump to LoadMonBackSprite (3f103 (f:7103)) + predef LoadMonBackPic xor a ld [$ffe1], a - ld hl, $cc2d + ld hl, wcc2d ld [hli], a ld [hl], a - ld [$cc5b], a - ld [$d05b], a - ld [W_PLAYERMOVENUM], a ; $cfd2 - ld hl, $ccf1 + ld [wcc5b], a + ld [wd05b], a + ld [W_PLAYERMOVENUM], a ; wcfd2 + ld hl, wccf1 ld [hli], a ld [hl], a - ld hl, $d060 + ld hl, wd060 ld [hli], a ld [hli], a ld [hli], a ld [hli], a ld [hl], a - ld [W_PLAYERDISABLEDMOVE], a ; $d06d - ld [$ccee], a - ld [$ccf7], a + ld [W_PLAYERDISABLEDMOVE], a ; W_PLAYERDISABLEDMOVE + ld [wccee], a + ld [wccf7], a ld b, $1 call GoPAL_SET - ld hl, W_ENEMYBATTSTATUS1 ; $d067 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 res 5, [hl] ld a, $1 ld [H_WHOSETURN], a ; $fff3 ld a, POOF_ANIM call PlayMoveAnimation - FuncCoord 4, 11 ; $c480 - ld hl, Coord - ld a, $2 - call Predef ; indirect jump to Func_3f073 (3f073 (f:7073)) - ld a, [$cf91] + hlCoord 4, 11 + predef Func_3f073 + ld a, [wcf91] call PlayCry call Func_3ee94 jp SaveScreenTilesToBuffer1 Func_3ccfa: ; 3ccfa (f:4cfa) - FuncCoord 1, 5 ; $c405 - ld hl, Coord + hlCoord 1, 5 ld bc, $707 call ClearScreenArea - FuncCoord 3, 7 ; $c42f - ld hl, Coord + hlCoord 3, 7 ld bc, $505 xor a - ld [$cd6c], a + ld [wcd6c], a ld [H_DOWNARROWBLINKCNT1], a ; $ff8b - ld a, $5 - call Predef ; indirect jump to Func_79aba (79aba (1e:5aba)) + predef Func_79aba ld c, $4 call DelayFrames call Func_3cd3a - FuncCoord 4, 9 ; $c458 - ld hl, Coord + hlCoord 4, 9 ld bc, $303 ld a, $1 - ld [$cd6c], a + ld [wcd6c], a xor a ld [H_DOWNARROWBLINKCNT1], a ; $ff8b - ld a, $5 - call Predef ; indirect jump to Func_79aba (79aba (1e:5aba)) + predef Func_79aba call Delay3 call Func_3cd3a ld a, $4c - FuncCoord 5, 11 ; $c481 - ld [Coord], a + Coorda 5, 11 Func_3cd3a: ; 3cd3a (f:4d3a) - FuncCoord 1, 5 ; $c405 - ld hl, Coord + hlCoord 1, 5 ld bc, $707 jp ClearScreenArea -; reads player's current mon's HP into W_PLAYERMONCURHP +; reads player's current mon's HP into wBattleMonHP ReadPlayerMonCurHPAndStatus: ; 3cd43 (f:4d43) - ld a, [wPlayerMonNumber] ; $cc2f - ld hl, W_PARTYMON1_HP ; $d16c - ld bc, W_PARTYMON2DATA - W_PARTYMON1DATA + ld a, [wPlayerMonNumber] ; wPlayerMonNumber + ld hl, wPartyMon1HP ; wd16c + ld bc, wPartyMon2 - wPartyMon1 call AddNTimes ld d, h ld e, l - ld hl, W_PLAYERMONCURHP ; $d015 + ld hl, wBattleMonHP ; wd015 ld bc, $4 ; 2 bytes HP, 1 byte unknown (unused?), 1 byte status jp CopyData @@ -1854,67 +1819,61 @@ Func_3cd5a: ; 3cd5a (f:4d5a) Func_3cd60: ; 3cd60 (f:4d60) xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - FuncCoord 9, 7 ; $c435 - ld hl, Coord + hlCoord 9, 7 ld bc, $50b call ClearScreenArea callab PlacePlayerHUDTiles - FuncCoord 18, 9 ; $c466 - ld hl, Coord + hlCoord 18, 9 ld [hl], $73 - ld de, W_PLAYERMONNAME - FuncCoord 10, 7 ; $c436 - ld hl, Coord + ld de, wBattleMonNick + hlCoord 10, 7 call Func_3ce9c call PlaceString - ld hl, W_PLAYERMONID - ld de, $cf98 + ld hl, wBattleMonSpecies + ld de, wcf98 ld bc, $c call CopyData - ld hl, W_PLAYERMONLEVEL ; $d022 - ld de, $cfb9 + ld hl, wBattleMonLevel ; wBattleMonLevel + ld de, wcfb9 ld bc, $b call CopyData - FuncCoord 14, 8 ; $c44e - ld hl, Coord + hlCoord 14, 8 push hl inc hl - ld de, $cf9c + ld de, wcf9c call PrintStatusConditionNotFainted pop hl jr nz, .asm_3cdae call PrintLevel .asm_3cdae - ld a, [$cf98] - ld [$cf91], a - FuncCoord 10, 9 ; $c45e - ld hl, Coord - ld a, $5f - call Predef ; indirect jump to Func_128ef (128ef (4:68ef)) + ld a, [wcf98] + ld [wcf91], a + hlCoord 10, 9 + predef DrawHP ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - ld hl, $cf1d + ld hl, wcf1d call GetBattleHealthBarColor - ld hl, W_PLAYERMONCURHP ; $d015 + ld hl, wBattleMonHP ; wd015 ld a, [hli] or [hl] jr z, .asm_3cdd9 - ld a, [$ccf6] + ld a, [wccf6] and a ret nz - ld a, [$cf1d] + ld a, [wcf1d] cp $2 jr z, .asm_3cde6 .asm_3cdd9 - ld hl, $d083 + ld hl, wd083 bit 7, [hl] ld [hl], $0 ret z xor a - ld [$c02a], a + ld [wc02a], a ret .asm_3cde6 - ld hl, $d083 + ld hl, wd083 set 7, [hl] ret @@ -1925,24 +1884,22 @@ Func_3cdec: ; 3cdec (f:4dec) ld bc, $40c call ClearScreenArea callab PlaceEnemyHUDTiles - ld de, W_ENEMYMONNAME - FuncCoord 1, 0 ; $c3a1 - ld hl, Coord + ld de, wEnemyMonNick + hlCoord 1, 0 call Func_3ce9c call PlaceString - FuncCoord 4, 1 ; $c3b8 - ld hl, Coord + hlCoord 4, 1 push hl inc hl - ld de, W_ENEMYMONSTATUS ; $cfe9 + ld de, wEnemyMonStatus ; wcfe9 call PrintStatusConditionNotFainted pop hl jr nz, .asm_3ce23 - ld a, [W_ENEMYMONLEVEL] ; $cff3 - ld [$cfb9], a + ld a, [wEnemyMonLevel] ; wEnemyMonLevel + ld [wcfb9], a call PrintLevel .asm_3ce23 - ld hl, W_ENEMYMONCURHP ; $cfe6 + ld hl, wEnemyMonHP ; wEnemyMonHP ld a, [hli] ld [$ff97], a ld a, [hld] @@ -1959,7 +1916,7 @@ Func_3cdec: ; 3cdec (f:4dec) ld a, $30 ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN) call Multiply - ld hl, W_ENEMYMONMAXHP ; $cff4 + ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP ld a, [hli] ld b, a ld a, [hl] @@ -1999,13 +1956,12 @@ Func_3cdec: ; 3cdec (f:4dec) Func_3ce7f: ; 3ce7f (f:4e7f) xor a - ld [wListMenuID], a ; $cf94 - FuncCoord 2, 2 ; $c3ca - ld hl, Coord + ld [wListMenuID], a ; wListMenuID + hlCoord 2, 2 call DrawHPBar ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - ld hl, $cf1e + ld hl, wcf1e GetBattleHealthBarColor: ; 3ce90 (f:4e90) ld b, [hl] @@ -2039,27 +1995,27 @@ Func_3ce9c: ; 3ce9c (f:4e9c) InitBattleMenu: ; 3ceb3 (f:4eb3) call LoadScreenTilesFromBuffer1 ; restore saved screen - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a and a jr nz, .nonstandardbattle call Func_3cd5a ; redraw names and HP bars? call Func_3ee94 call SaveScreenTilesToBuffer1 .nonstandardbattle - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a cp $2 ; safari ld a, $b ; safari menu id jr nz, .menuselected ld a, $1b ; regular menu id .menuselected - ld [$d125], a + ld [wd125], a call DisplayTextBoxID - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a dec a jp nz, RegularBattleMenu ; regular battle ; the following happens for the old man tutorial - ld hl, W_PLAYERNAME ; $d158 - ld de, W_GRASSRATE ; $d887 + ld hl, wPlayerName ; wd158 + ld de, W_GRASSRATE ; W_GRASSRATE ld bc, $b call CopyData ; temporarily save the player name in unused space, ; which is supposed to get overwritten when entering a @@ -2067,18 +2023,16 @@ InitBattleMenu: ; 3ceb3 (f:4eb3) ; may not get overwritten (cinnabar) and the infamous ; missingno. glitch can show up. ld hl, OldManName ; $4f12 - ld de, W_PLAYERNAME ; $d158 + ld de, wPlayerName ; wd158 ld bc, $b call CopyData ; the following simulates the keystrokes by drawing menus on screen - FuncCoord 9, 14 ; $c4c1 - ld hl, Coord + hlCoord 9, 14 ld [hl], "▶" ld c, $50 call DelayFrames ld [hl], $7f - FuncCoord 9, 16 ; $c4e9 - ld hl, Coord + hlCoord 9, 16 ld [hl], "▶" ld c, $32 call DelayFrames @@ -2090,38 +2044,33 @@ OldManName: ; 3cf12 (f:4f12) db "OLD MAN@" RegularBattleMenu: ; 3cf1a (f:4f1a) - ld a, [$cc2d] - ld [wCurrentMenuItem], a ; $cc26 - ld [wLastMenuItem], a ; $cc2a + ld a, [wcc2d] + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wLastMenuItem], a ; wLastMenuItem sub $2 jr c, .leftcolumn - ld [wCurrentMenuItem], a ; $cc26 - ld [wLastMenuItem], a ; $cc2a + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wLastMenuItem], a ; wLastMenuItem jr .rightcolumn .leftcolumn - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a cp $2 ld a, " " jr z, .safaribattle - FuncCoord 15, 14 ; $c4c7 - ld [Coord], a - FuncCoord 15, 16 ; $c4ef - ld [Coord], a + Coorda 15, 14 + Coorda 15, 16 ld b, $9 jr .notsafari .safaribattle - FuncCoord 13, 14 ; $c4c5 - ld [Coord], a - FuncCoord 13, 16 ; $c4ed - ld [Coord], a - FuncCoord 7, 14 ; $c4bf - ld hl, Coord - ld de, W_NUMSAFARIBALLS ; $da47 + Coorda 13, 14 + Coorda 13, 16 + hlCoord 7, 14 + ld de, W_NUMSAFARIBALLS ; W_NUMSAFARIBALLS ld bc, $102 call PrintNumber ld b, $1 .notsafari - ld hl, wTopMenuItemY ; $cc24 + ld hl, wTopMenuItemY ; wTopMenuItemY ld a, $e ld [hli], a ld a, b @@ -2136,29 +2085,24 @@ RegularBattleMenu: ; 3cf1a (f:4f1a) jr nz, .rightcolumn jr .selection .rightcolumn - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a cp $2 ld a, " " jr z, .safarirightcolumn - FuncCoord 9, 14 ; $c4c1 - ld [Coord], a - FuncCoord 9, 16 ; $c4e9 - ld [Coord], a + Coorda 9, 14 + Coorda 9, 16 ld b, $f jr .notsafarirightcolumn .safarirightcolumn - FuncCoord 1, 14 ; $c4b9 - ld [Coord], a - FuncCoord 1, 16 ; $c4e1 - ld [Coord], a - FuncCoord 7, 14 ; $c4bf - ld hl, Coord - ld de, W_NUMSAFARIBALLS ; $da47 + Coorda 1, 14 + Coorda 1, 16 + hlCoord 7, 14 + ld de, W_NUMSAFARIBALLS ; W_NUMSAFARIBALLS ld bc, $102 call PrintNumber ld b, $d .notsafarirightcolumn - ld hl, wTopMenuItemY ; $cc24 + ld hl, wTopMenuItemY ; wTopMenuItemY ld a, $e ld [hli], a ld a, b @@ -2172,15 +2116,15 @@ RegularBattleMenu: ; 3cf1a (f:4f1a) call HandleMenuInput bit 5, a jr nz, .leftcolumn - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem add $2 ; if we're in the right column, the actual id is +2 - ld [wCurrentMenuItem], a ; $cc26 + ld [wCurrentMenuItem], a ; wCurrentMenuItem .selection call PlaceUnfilledArrowMenuCursor - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a cp $2 - ld a, [wCurrentMenuItem] ; $cc26 - ld [$cc2d], a + ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld [wcc2d], a jr z, .asm_3cfd0 cp $1 jr nz, .asm_3cfcb @@ -2194,21 +2138,21 @@ RegularBattleMenu: ; 3cf1a (f:4f1a) and a jr nz, Func_3cfe8 ; first option was selected... - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a cp $2 jr z, .safari1 xor a - ld [$d120], a + ld [wd120], a jp LoadScreenTilesFromBuffer1 ; restore saved screen and return?? .safari1 ; safari first option?? ld a, SAFARI_BALL - ld [$cf91], a + ld [wcf91], a jr asm_3d05f Func_3cfe8: ; 3cfe8 (f:4fe8) cp $2 jp nz, Func_3d0ca - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 jr nz, .asm_3cffd ld hl, ItemsCantBeUsedHereText @@ -2216,83 +2160,83 @@ Func_3cfe8: ; 3cfe8 (f:4fe8) jp InitBattleMenu .asm_3cffd ; bag? call SaveScreenTilesToBuffer2 ; copy bg? - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a cp $2 jr nz, asm_3d00e ld a, SAFARI_BAIT - ld [$cf91], a + ld [wcf91], a jr asm_3d05f asm_3d00e: ; 3d00e (f:500e) call LoadScreenTilesFromBuffer1 - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a and a jr nz, .asm_3d01a call Func_3cd5a .asm_3d01a - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a dec a jr nz, Func_3d031 ld hl, OldManItemList ld a, l - ld [$cf8b], a + ld [wcf8b], a ld a, h - ld [$cf8c], a + ld [wcf8c], a jr Func_3d03c OldManItemList: ; 3d02d (f:502d) db $01, POKE_BALL, 50, $ff Func_3d031 - ld hl, wNumBagItems ; $d31d + ld hl, wNumBagItems ; wNumBagItems ld a, l - ld [$cf8b], a + ld [wcf8b], a ld a, h - ld [$cf8c], a + ld [wcf8c], a Func_3d03c xor a - ld [$cf93], a + ld [wcf93], a ld a, $3 - ld [wListMenuID], a ; $cf94 - ld a, [$cc2c] - ld [wCurrentMenuItem], a ; $cc26 + ld [wListMenuID], a ; wListMenuID + ld a, [wcc2c] + ld [wCurrentMenuItem], a ; wCurrentMenuItem call DisplayListMenuID - ld a, [wCurrentMenuItem] ; $cc26 - ld [$cc2c], a + ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld [wcc2c], a ld a, $0 - ld [$cc37], a - ld [$cc35], a + ld [wcc37], a + ld [wcc35], a jp c, InitBattleMenu asm_3d05f: ; 3d05f (f:505f) - ld a, [$cf91] - ld [$d11e], a + ld a, [wcf91] + ld [wd11e], a call GetItemName call CopyStringToCF4B ; copy name xor a - ld [$d152], a + ld [wd152], a call UseItem call Func_3ee5b - call CleanLCD_OAM + call ClearSprites xor a - ld [wCurrentMenuItem], a ; $cc26 - ld a, [W_BATTLETYPE] ; $d05a + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld a, [W_BATTLETYPE] ; wd05a cp $2 jr z, .asm_3d09c - ld a, [$cd6a] + ld a, [wcd6a] and a jp z, asm_3d00e - ld a, [W_PLAYERBATTSTATUS1] ; $d062 + ld a, [W_PLAYERBATTSTATUS1] ; W_PLAYERBATTSTATUS1 bit 5, a jr z, .asm_3d09c - ld hl, $d06a + ld hl, wd06a dec [hl] jr nz, .asm_3d09c - ld hl, W_PLAYERBATTSTATUS1 ; $d062 + ld hl, W_PLAYERBATTSTATUS1 ; W_PLAYERBATTSTATUS1 res 5, [hl] .asm_3d09c - ld a, [$d11c] + ld a, [wd11c] and a jr nz, .asm_3d0b7 - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a cp $2 jr z, .asm_3d0b2 call LoadScreenTilesFromBuffer1 @@ -2305,9 +2249,9 @@ asm_3d05f: ; 3d05f (f:505f) .asm_3d0b7 call GBPalNormal xor a - ld [$d11c], a + ld [wd11c], a ld a, $2 - ld [$cf0b], a + ld [wcf0b], a scf ret @@ -2319,23 +2263,23 @@ Func_3d0ca: ; 3d0ca (f:50ca) dec a jp nz, Func_3d1fa call SaveScreenTilesToBuffer2 - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a cp $2 jr nz, Func_3d0e0 ld a, SAFARI_ROCK - ld [$cf91], a + ld [wcf91], a jp asm_3d05f Func_3d0e0: ; 3d0e0 (f:50e0) call LoadScreenTilesFromBuffer1 xor a - ld [$d07d], a - ld [$cc35], a + ld [wd07d], a + ld [wcc35], a call DisplayPartyMenu asm_3d0ed: ; 3d0ed (f:50ed) jp nc, Func_3d119 asm_3d0f0: ; 3d0f0 (f:50f0) - call CleanLCD_OAM + call ClearSprites call GBPalWhiteOut call Func_3ee5b call LoadScreenTilesFromBuffer2 @@ -2344,21 +2288,20 @@ asm_3d0f0: ; 3d0f0 (f:50f0) jp InitBattleMenu Func_3d105: ; 3d105 (f:5105) - FuncCoord 11, 11 ; $c487 - ld hl, Coord + hlCoord 11, 11 ld bc, $81 ld a, $7f call FillMemory xor a - ld [$d07d], a + ld [wd07d], a call GoBackToPartyMenu jr asm_3d0ed Func_3d119: ; 3d119 (f:5119) ld a, $c - ld [$d125], a + ld [wd125], a call DisplayTextBoxID - ld hl, wTopMenuItemY ; $cc24 + ld hl, wTopMenuItemY ; wTopMenuItemY ld a, $c ld [hli], a ld [hli], a @@ -2375,32 +2318,30 @@ Func_3d119: ; 3d119 (f:5119) bit 1, a jr nz, Func_3d105 call PlaceUnfilledArrowMenuCursor - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem cp $2 jr z, asm_3d0f0 and a jr z, .asm_3d18a xor a - ld [$cc49], a - ld hl, W_PARTYMON1_NUM ; $d16b (aliases: W_PARTYMON1DATA) - call CleanLCD_OAM - ld a, $36 - call Predef ; indirect jump to StatusScreen (12953 (4:6953)) - ld a, $37 - call Predef ; indirect jump to StatusScreen2 (12b57 (4:6b57)) - ld a, [W_ENEMYBATTSTATUS2] ; $d068 + ld [wcc49], a + ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1) + call ClearSprites + predef StatusScreen + predef StatusScreen2 + ld a, [W_ENEMYBATTSTATUS2] ; W_ENEMYBATTSTATUS2 bit 4, a ld hl, AnimationSubstitute jr nz, .asm_3d182 - ld a, [$ccf3] + ld a, [wccf3] and a ld hl, AnimationMinimizeMon jr nz, .asm_3d182 - ld a, [$cfe5] - ld [$cf91], a - ld [$d0b5], a + ld a, [wEnemyMonSpecies] + ld [wcf91], a + ld [wd0b5], a call GetMonHeader - ld de, $9000 + ld de, vFrontPic call LoadMonFrontSprite jr .asm_3d187 .asm_3d182 @@ -2409,9 +2350,9 @@ Func_3d119: ; 3d119 (f:5119) .asm_3d187 jp Func_3d0e0 .asm_3d18a - ld a, [wPlayerMonNumber] ; $cc2f + ld a, [wPlayerMonNumber] ; wPlayerMonNumber ld d, a - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon cp d jr nz, .asm_3d19d ld hl, AlreadyOutText @@ -2421,9 +2362,9 @@ Func_3d119: ; 3d119 (f:5119) call Func_3ca97 jp z, Func_3d105 ld a, $1 - ld [$cd6a], a + ld [wcd6a], a call GBPalWhiteOut - call CleanLCD_OAM + call ClearSprites call Func_3ee5b call LoadScreenTilesFromBuffer1 call GoPAL_SET_CF1C @@ -2434,23 +2375,21 @@ Func_3d1ba: ; 3d1ba (f:51ba) ld c, $32 call DelayFrames call Func_3ccfa - ld a, [wWhichPokemon] ; $cf92 - ld [wPlayerMonNumber], a ; $cc2f + ld a, [wWhichPokemon] ; wWhichPokemon + ld [wPlayerMonNumber], a ; wPlayerMonNumber ld c, a ld b, $1 push bc - ld hl, W_PLAYERMONSALIVEFLAGS - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + ld hl, wPartyAliveFlags + predef FlagActionPredef pop bc - ld hl, $ccf5 - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + ld hl, wccf5 + predef FlagActionPredef call Func_3cba6 call Func_3cc91 call SaveScreenTilesToBuffer1 ld a, $2 - ld [wCurrentMenuItem], a ; $cc26 + ld [wCurrentMenuItem], a ; wCurrentMenuItem and a ret @@ -2461,14 +2400,14 @@ AlreadyOutText: ; 3d1f5 (f:51f5) Func_3d1fa: ; 3d1fa (f:51fa) call LoadScreenTilesFromBuffer1 ld a, $3 - ld [wCurrentMenuItem], a ; $cc26 - ld hl, W_PLAYERMONSPEED - ld de, W_ENEMYMONSPEED + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld hl, wBattleMonSpeed + ld de, wEnemyMonSpeed call Func_3cab9 ld a, $0 - ld [$d11f], a + ld [wd11f], a ret c - ld a, [$cd6a] + ld a, [wcd6a] and a ret nz jp InitBattleMenu @@ -2482,14 +2421,14 @@ MoveSelectionMenu: ; 3d219 (f:5219) jr .regularmenu .loadmoves - ld de, $d0dc + ld de, wd0dc ld bc, $4 call CopyData callab Func_39b87 ret .writemoves - ld de, $d0e1 + ld de, wd0e1 ld a, [$fff6] set 2, a ld [$fff6], a @@ -2502,59 +2441,51 @@ MoveSelectionMenu: ; 3d219 (f:5219) .regularmenu call Func_3d3f5 ret z - ld hl, W_PLAYERMONMOVES + ld hl, wBattleMonMoves call .loadmoves - FuncCoord 4, 12 ; $c494 - ld hl, Coord + hlCoord 4, 12 ld b, $4 ld c, $e di call TextBoxBorder - FuncCoord 4, 12 ; $c494 - ld hl, Coord + hlCoord 4, 12 ld [hl], $7a - FuncCoord 10, 12 ; $c49a - ld hl, Coord + hlCoord 10, 12 ld [hl], $7e ei - FuncCoord 6, 13 ; $c4aa - ld hl, Coord + hlCoord 6, 13 call .writemoves ld b, $5 ld a, $c jr .menuset .mimicmenu - ld hl, W_ENEMYMONMOVES + ld hl, wEnemyMonMoves call .loadmoves - FuncCoord 0, 7 ; $c42c - ld hl, Coord + hlCoord 0, 7 ld b, $4 ld c, $e call TextBoxBorder - FuncCoord 2, 8 ; $c442 - ld hl, Coord + hlCoord 2, 8 call .writemoves ld b, $1 ld a, $7 jr .menuset .relearnmenu - ld a, [wWhichPokemon] ; $cf92 - ld hl, W_PARTYMON1_MOVE1 ; $d173 + ld a, [wWhichPokemon] ; wWhichPokemon + ld hl, wPartyMon1Moves ; wPartyMon1Moves ld bc, $2c call AddNTimes call .loadmoves - FuncCoord 4, 7 ; $c430 - ld hl, Coord + hlCoord 4, 7 ld b, $4 ld c, $e call TextBoxBorder - FuncCoord 6, 8 ; $c446 - ld hl, Coord + hlCoord 6, 8 call .writemoves ld b, $5 ld a, $7 .menuset - ld hl, wTopMenuItemY ; $cc24 + ld hl, wTopMenuItemY ; wTopMenuItemY ld [hli], a ld a, b ld [hli], a ; wTopMenuItemX @@ -2563,12 +2494,12 @@ MoveSelectionMenu: ; 3d219 (f:5219) jr z, .selectedmoveknown ld a, $1 jr nc, .selectedmoveknown - ld a, [wPlayerMoveListIndex] ; $cc2e + ld a, [wPlayerMoveListIndex] ; wPlayerMoveListIndex inc a .selectedmoveknown ld [hli], a ; wCurrentMenuItem inc hl ; wTileBehindCursor untouched - ld a, [$cd6c] + ld a, [wcd6c] inc a inc a ld [hli], a ; wMaxMenuItem @@ -2579,7 +2510,7 @@ MoveSelectionMenu: ; 3d219 (f:5219) dec a ld b, $c3 jr z, .matchedkeyspicked - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 jr z, .matchedkeyspicked ld a, [W_FLAGS_D733] @@ -2593,7 +2524,7 @@ MoveSelectionMenu: ; 3d219 (f:5219) ld a, [wMoveMenuType] cp $1 jr z, .movelistindex1 - ld a, [wPlayerMoveListIndex] ; $cc2e + ld a, [wPlayerMoveListIndex] ; wPlayerMoveListIndex inc a .movelistindex1 ld [hl], a ; wLastMenuItem @@ -2604,8 +2535,7 @@ Func_3d2fe: ; 3d2fe (f:52fe) jr z, .battleselect dec a jr nz, .select - FuncCoord 1, 14 ; $c4b9 - ld hl, Coord + hlCoord 1, 14 ld de, WhichTechniqueString ; $53b8 call PlaceString jr .select @@ -2614,11 +2544,10 @@ Func_3d2fe: ; 3d2fe (f:52fe) bit 0, a jr nz, .select call Func_3d4b6 - ld a, [$cc35] + ld a, [wcc35] and a jr z, .select - FuncCoord 5, 13 ; $c4a9 - ld hl, Coord + hlCoord 5, 13 dec a ld bc, $14 call AddNTimes @@ -2638,10 +2567,10 @@ Func_3d2fe: ; 3d2fe (f:52fe) bit 1, a ; B, but was it reset above? push af xor a - ld [$cc35], a - ld a, [wCurrentMenuItem] ; $cc26 + ld [wcc35], a + ld a, [wCurrentMenuItem] ; wCurrentMenuItem dec a - ld [wCurrentMenuItem], a ; $cc26 + ld [wCurrentMenuItem], a ; wCurrentMenuItem ld b, a ld a, [wMoveMenuType] dec a ; if not mimic @@ -2651,38 +2580,38 @@ Func_3d2fe: ; 3d2fe (f:52fe) .nob dec a ld a, b - ld [wPlayerMoveListIndex], a ; $cc2e + ld [wPlayerMoveListIndex], a ; wPlayerMoveListIndex jr nz, .moveselected pop af ret .moveselected pop af ret nz - ld hl, W_PLAYERMONPP ; $d02d - ld a, [wCurrentMenuItem] ; $cc26 + ld hl, wBattleMonPP ; wBattleMonPP + ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld c, a ld b, $0 add hl, bc ld a, [hl] and $3f jr z, .nopp - ld a, [W_PLAYERDISABLEDMOVE] ; $d06d + ld a, [W_PLAYERDISABLEDMOVE] ; W_PLAYERDISABLEDMOVE swap a and $f dec a cp c jr z, .disabled - ld a, [W_PLAYERBATTSTATUS3] ; $d064 + ld a, [W_PLAYERBATTSTATUS3] ; W_PLAYERBATTSTATUS3 bit 3, a ; transformed jr nz, .dummy ; game freak derp .dummy - ld a, [wCurrentMenuItem] ; $cc26 - ld hl, W_PLAYERMONMOVES + ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld hl, wBattleMonMoves ld c, a ld b, $0 add hl, bc ld a, [hl] - ld [wPlayerSelectedMove], a ; $ccdc + ld [wPlayerSelectedMove], a ; wPlayerSelectedMove xor a ret .disabled @@ -2707,34 +2636,34 @@ WhichTechniqueString: ; 3d3b8 (f:53b8) db "WHICH TECHNIQUE?@" Func_3d3c9: ; 3d3c9 (f:53c9) - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem and a jp nz, Func_3d2fe call EraseMenuCursor - ld a, [$cd6c] + ld a, [wcd6c] inc a - ld [wCurrentMenuItem], a ; $cc26 + ld [wCurrentMenuItem], a ; wCurrentMenuItem jp Func_3d2fe Func_3d3dd: ; 3d3dd (f:53dd) - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld b, a - ld a, [$cd6c] + ld a, [wcd6c] inc a inc a cp b jp nz, Func_3d2fe call EraseMenuCursor ld a, $1 - ld [wCurrentMenuItem], a ; $cc26 + ld [wCurrentMenuItem], a ; wCurrentMenuItem jp Func_3d2fe Func_3d3f5: ; 3d3f5 (f:53f5) ld a, $a5 - ld [wPlayerSelectedMove], a ; $ccdc - ld a, [W_PLAYERDISABLEDMOVE] ; $d06d + ld [wPlayerSelectedMove], a ; wPlayerSelectedMove + ld a, [W_PLAYERDISABLEDMOVE] ; W_PLAYERDISABLEDMOVE and a - ld hl, W_PLAYERMONPP ; $d02d + ld hl, wBattleMonPP ; wBattleMonPP jr nz, .asm_3d40e ld a, [hli] or [hl] @@ -2776,43 +2705,43 @@ NoMovesLeftText: ; 3d430 (f:5430) db "@" Func_3d435: ; 3d435 (f:5435) - ld a, [$cc35] + ld a, [wcc35] and a jr z, asm_3d4ad - ld hl, W_PLAYERMONMOVES + ld hl, wBattleMonMoves call Func_3d493 - ld hl, W_PLAYERMONPP ; $d02d + ld hl, wBattleMonPP ; wBattleMonPP call Func_3d493 - ld hl, W_PLAYERDISABLEDMOVE ; $d06d + ld hl, W_PLAYERDISABLEDMOVE ; W_PLAYERDISABLEDMOVE ld a, [hl] swap a and $f ld b, a - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem cp b jr nz, .asm_3d463 ld a, [hl] and $f ld b, a - ld a, [$cc35] + ld a, [wcc35] swap a add b ld [hl], a jr .asm_3d474 .asm_3d463 - ld a, [$cc35] + ld a, [wcc35] cp b jr nz, .asm_3d474 ld a, [hl] and $f ld b, a - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem swap a add b ld [hl], a .asm_3d474 - ld hl, W_PARTYMON1_MOVE1 ; $d173 - ld a, [wPlayerMonNumber] ; $cc2f + ld hl, wPartyMon1Moves ; wPartyMon1Moves + ld a, [wPlayerMonNumber] ; wPlayerMonNumber ld bc, $2c call AddNTimes push hl @@ -2822,12 +2751,12 @@ Func_3d435: ; 3d435 (f:5435) add hl, bc call Func_3d493 xor a - ld [$cc35], a + ld [wcc35], a jp MoveSelectionMenu Func_3d493: ; 3d493 (f:5493) push hl - ld a, [$cc35] + ld a, [wcc35] dec a ld c, a ld b, $0 @@ -2835,7 +2764,7 @@ Func_3d493: ; 3d493 (f:5493) ld d, h ld e, l pop hl - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem dec a ld c, a ld b, $0 @@ -2847,83 +2776,74 @@ Func_3d493: ; 3d493 (f:5493) ld [de], a ret asm_3d4ad: ; 3d4ad (f:54ad) - ld a, [wCurrentMenuItem] ; $cc26 - ld [$cc35], a + ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld [wcc35], a jp MoveSelectionMenu Func_3d4b6: ; 3d4b6 (f:54b6) xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - FuncCoord 0, 8 ; $c440 - ld hl, Coord + hlCoord 0, 8 ld b, $3 ld c, $9 call TextBoxBorder - ld a, [W_PLAYERDISABLEDMOVE] ; $d06d + ld a, [W_PLAYERDISABLEDMOVE] ; W_PLAYERDISABLEDMOVE and a jr z, .asm_3d4df swap a and $f ld b, a - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem cp b jr nz, .asm_3d4df - FuncCoord 1, 10 ; $c469 - ld hl, Coord + hlCoord 1, 10 ld de, DisabledText call PlaceString jr .asm_3d54e .asm_3d4df - ld hl, wCurrentMenuItem ; $cc26 + ld hl, wCurrentMenuItem ; wCurrentMenuItem dec [hl] xor a ld [H_WHOSETURN], a ; $fff3 - ld hl, W_PLAYERMONMOVES - ld a, [wCurrentMenuItem] ; $cc26 + ld hl, wBattleMonMoves + ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld c, a ld b, $0 add hl, bc ld a, [hl] - ld [wPlayerSelectedMove], a ; $ccdc - ld a, [wPlayerMonNumber] ; $cc2f - ld [wWhichPokemon], a ; $cf92 + ld [wPlayerSelectedMove], a ; wPlayerSelectedMove + ld a, [wPlayerMonNumber] ; wPlayerMonNumber + ld [wWhichPokemon], a ; wWhichPokemon ld a, $4 - ld [$cc49], a + ld [wcc49], a callab GetMaxPP - ld hl, wCurrentMenuItem ; $cc26 + ld hl, wCurrentMenuItem ; wCurrentMenuItem ld c, [hl] inc [hl] ld b, $0 - ld hl, W_PLAYERMONPP ; $d02d + ld hl, wBattleMonPP ; wBattleMonPP add hl, bc ld a, [hl] and $3f - ld [$cd6d], a - FuncCoord 1, 9 ; $c455 - ld hl, Coord + ld [wcd6d], a + hlCoord 1, 9 ld de, TypeText call PlaceString - FuncCoord 7, 11 ; $c483 - ld hl, Coord + hlCoord 7, 11 ld [hl], "/" - FuncCoord 5, 9 ; $c459 - ld hl, Coord + hlCoord 5, 9 ld [hl], "/" - FuncCoord 5, 11 ; $c481 - ld hl, Coord - ld de, $cd6d + hlCoord 5, 11 + ld de, wcd6d ld bc, $102 call PrintNumber - FuncCoord 8, 11 ; $c484 - ld hl, Coord - ld de, $d11e + hlCoord 8, 11 + ld de, wd11e ld bc, $102 call PrintNumber call GetCurrentMove - FuncCoord 2, 10 ; $c46a - ld hl, Coord - ld a, $5d - call Predef ; indirect jump to Func_27d98 (27d98 (9:7d98)) + hlCoord 2, 10 + predef Func_27d98 .asm_3d54e ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba @@ -2942,16 +2862,16 @@ SelectEnemyMove: ; 3d564 (f:5564) call SaveScreenTilesToBuffer1 call Func_3d605 call LoadScreenTilesFromBuffer1 - ld a, [$cc3e] + ld a, [wcc3e] cp $e jp z, .asm_3d601 cp $d jr z, .unableToMove cp $4 ret nc - ld [$cce2], a + ld [wEnemyMoveListIndex], a ld c, a - ld hl, W_ENEMYMONMOVES + ld hl, wEnemyMonMoves ld b, $0 add hl, bc ld a, [hl] @@ -2964,7 +2884,7 @@ SelectEnemyMove: ; 3d564 (f:5564) ld a, [hl] and $12 ; using multi-turn move or bide ret nz - ld a, [W_ENEMYMONSTATUS] + ld a, [wEnemyMonStatus] and SLP | 1 << FRZ ; sleeping or frozen ret nz ld a, [W_ENEMYBATTSTATUS1] @@ -2977,7 +2897,7 @@ SelectEnemyMove: ; 3d564 (f:5564) ld a, $ff jr .done .notCaughtInWrap - ld hl, W_ENEMYMONMOVES+1 ; 2nd enemy move + ld hl, wEnemyMonMoves+1 ; 2nd enemy move ld a, [hld] and a jr nz, .atLeastTwoMovesAvailable @@ -2992,7 +2912,7 @@ SelectEnemyMove: ; 3d564 (f:5564) callab AIEnemyTrainerChooseMoves .chooseRandomMove push hl - call GenRandomInBattle ; get random + call BattleRandom ld b, $1 cp $3f ; select move 1 in [0,3e] (63/256 chance) jr c, .moveChosen @@ -3028,35 +2948,35 @@ SelectEnemyMove: ; 3d564 (f:5564) Func_3d605: ; 3d605 (f:5605) ld a, $ff - ld [$cc3e], a - ld a, [wPlayerMoveListIndex] ; $cc2e + ld [wcc3e], a + ld a, [wPlayerMoveListIndex] ; wPlayerMoveListIndex cp $f jr z, .asm_3d630 - ld a, [$cd6a] + ld a, [wcd6a] and a jr nz, .asm_3d629 - ld a, [wPlayerSelectedMove] ; $ccdc + ld a, [wPlayerSelectedMove] ; wPlayerSelectedMove cp $a5 ld b, $e jr z, .asm_3d62f dec b inc a jr z, .asm_3d62f - ld a, [wPlayerMoveListIndex] ; $cc2e + ld a, [wPlayerMoveListIndex] ; wPlayerMoveListIndex jr .asm_3d630 .asm_3d629 - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon add $4 ld b, a .asm_3d62f ld a, b .asm_3d630 - ld [$cc42], a + ld [wcc42], a callab PrintWaitingText .asm_3d63b call Func_22c3 call DelayFrame - ld a, [$cc3e] + ld a, [wcc3e] inc a jr z, .asm_3d63b ld b, $a @@ -3076,16 +2996,16 @@ Func_3d605: ; 3d605 (f:5605) Func_3d65e: ; 3d65e (f:565e) xor a ld [H_WHOSETURN], a ; $fff3 - ld a, [wPlayerSelectedMove] ; $ccdc + ld a, [wPlayerSelectedMove] ; wPlayerSelectedMove inc a jp z, Func_3d80a xor a - ld [W_MOVEMISSED], a ; $d05f - ld [$cced], a - ld [$ccf4], a + ld [W_MOVEMISSED], a ; W_MOVEMISSED + ld [wcced], a + ld [wccf4], a ld a, $a - ld [$d05b], a - ld a, [$cd6a] + ld [wd05b], a + ld a, [wcd6a] and a jp nz, Func_3d80a call PrintGhostText @@ -3095,14 +3015,14 @@ Func_3d65e: ; 3d65e (f:565e) jp [hl] .asm_3d68a call GetCurrentMove - ld hl, W_PLAYERBATTSTATUS1 ; $d062 + ld hl, W_PLAYERBATTSTATUS1 ; W_PLAYERBATTSTATUS1 bit 4, [hl] jr nz, asm_3d6a9 call Func_3dc88 jp z, Func_3d80a Func_3d69a: ; 3d69a (f:569a) - ld a, [W_PLAYERMOVEEFFECT] ; $cfd3 + ld a, [W_PLAYERMOVEEFFECT] ; wcfd3 cp CHARGE_EFFECT jp z, Func_3f132 cp FLY_EFFECT @@ -3117,7 +3037,7 @@ asm_3d6a9: ; 3d6a9 (f:56a9) asm_3d6b0: ; 3d6b0 (f:56b0) call PrintMonName1Text ld hl,DecrementPP - ld de,$CCDC ; pointer to the move just used + ld de,wPlayerSelectedMove ; pointer to the move just used ld b,BANK(DecrementPP) call Bankswitch ld a,[W_PLAYERMOVEEFFECT] ; effect of the move just used @@ -3168,7 +3088,7 @@ asm_3d71e ld b,BANK(Func_79747) call nz,Bankswitch pop af - ld [$CC5B],a + ld [wcc5b],a ld a,[W_PLAYERMOVENUM] call PlayMoveAnimation call Func_3eed3 @@ -3190,7 +3110,7 @@ asm_3d74b jr asm_3d766 .next5 xor a - ld [$CC5B],a + ld [wcc5b],a ld a,STATUS_AFFECTED_ANIM call PlayMoveAnimation asm_3d766 @@ -3200,7 +3120,7 @@ asm_3d766 call MirrorMoveCopyMove jp z,Func_3d80a xor a - ld [$CCED],a + ld [wcced],a jp Func_3d69a .next6 cp a,METRONOME_EFFECT @@ -3226,14 +3146,14 @@ asm_3d766 call Func_3dc5c callab DisplayEffectiveness ld a,1 - ld [$CCF4],a + ld [wccf4],a .next9 ld a,[W_PLAYERMOVEEFFECT] ld hl,EffectsArray4 ld de,1 call IsInArray call c,Func_3f132 - ld hl,$CFE6 + ld hl,wEnemyMonHP ld a,[hli] ld b,[hl] or b @@ -3243,9 +3163,9 @@ asm_3d766 ld hl,W_PLAYERBATTSTATUS1 bit 2,[hl] jr z,.next10 ; 57EF - ld a,[$D06A] + ld a,[wd06a] dec a - ld [$D06A],a + ld [wd06a],a jp nz,asm_3d714 res 2,[hl] @@ -3269,7 +3189,7 @@ MultiHitText: ; 3d805 (f:5805) Func_3d80a: ; 3d80a (f:580a) xor a - ld [$CD6A],a + ld [wcd6a],a ld b,1 ret @@ -3280,7 +3200,7 @@ PrintGhostText: ; 3d811 (f:5811) ld a,[H_WHOSETURN] and a jr nz,.Ghost - ld a,[W_PLAYERMONSTATUS] ; player’s turn + ld a,[wBattleMonStatus] ; player’s turn and a,SLP | (1 << FRZ) ret nz ld hl,ScaredText @@ -3319,18 +3239,18 @@ IsGhostBattle: ; 3d83a (f:583a) ret Func_3d854: ; 3d854 (f:5854) - ld hl,W_PLAYERMONSTATUS + ld hl,wBattleMonStatus ld a,[hl] and a,SLP jr z,.FrozenCheck ; to 5884 dec a - ld [W_PLAYERMONSTATUS],a ; decrement sleep count + ld [wBattleMonStatus],a ; decrement sleep count and a jr z,.WakeUp ; to 5874 xor a - ld [$CC5B],a + ld [wcc5b],a ld a,SLP_ANIM - 1 call PlayMoveAnimation ld hl,FastAsleepText @@ -3341,7 +3261,7 @@ Func_3d854: ; 3d854 (f:5854) call PrintText .sleepDone xor a - ld [$CCF1],a + ld [wccf1],a ld hl,Func_3d80a jp Func_3da37 @@ -3351,7 +3271,7 @@ Func_3d854: ; 3d854 (f:5854) ld hl,IsFrozenText call PrintText xor a - ld [$CCF1],a + ld [wccf1],a ld hl,Func_3d80a jp Func_3da37 @@ -3384,7 +3304,7 @@ HyperBeamCheck: ; 3d8c2 (f:58c2) ld hl,Func_3d80a ; $580a jp Func_3da37 .next - ld hl,$D06D + ld hl,W_PLAYERDISABLEDMOVE ld a,[hl] and a jr z,.next2 ; 58EE @@ -3393,14 +3313,14 @@ HyperBeamCheck: ; 3d8c2 (f:58c2) and a,$F jr nz,.next2 ld [hl],a - ld [$CCEE],a + ld [wccee],a ld hl,DisabledNoMoreText call PrintText .next2 ld a,[W_PLAYERBATTSTATUS1] add a jr nc,.next3 ; 5929 - ld hl,$D06B + ld hl,wd06b dec [hl] jr nz,.next4 ; 5907 ld hl,W_PLAYERBATTSTATUS1 @@ -3412,10 +3332,10 @@ HyperBeamCheck: ; 3d8c2 (f:58c2) ld hl,IsConfusedText call PrintText xor a - ld [$CC5B],a + ld [wcc5b],a ld a,CONF_ANIM - 1 call PlayMoveAnimation - call GenRandomInBattle + call BattleRandom cp a,$80 jr c,.next3 ld hl,W_PLAYERBATTSTATUS1 @@ -3425,20 +3345,20 @@ HyperBeamCheck: ; 3d8c2 (f:58c2) call PrintHurtItselfText jr .next5 ; 5952 .next3 - ld a,[$CCEE] + ld a,[wccee] and a jr z,.ParalysisCheck ; 593E - ld hl,$CCDC + ld hl,wPlayerSelectedMove cp [hl] jr nz,.ParalysisCheck call PrintMoveIsDisabledText ld hl,Func_3d80a ; $580a jp Func_3da37 .ParalysisCheck - ld hl,W_PLAYERMONSTATUS + ld hl,wBattleMonStatus bit PAR,[hl] jr z,.next7 ; 5975 - call GenRandomInBattle ; random number + call BattleRandom cp a,$3F jr nc,.next7 ld hl,FullyParalyzedText @@ -3456,7 +3376,7 @@ HyperBeamCheck: ; 3d8c2 (f:58c2) jr .next9 ; 596F .next8 xor a - ld [$CC5B],a + ld [wcc5b],a ld a,STATUS_AFFECTED_ANIM call PlayMoveAnimation .next9 @@ -3468,18 +3388,18 @@ HyperBeamCheck: ; 3d8c2 (f:58c2) jr z,.next10 ; 59D0 xor a ld [W_PLAYERMOVENUM],a - ld hl,$D0D7 + ld hl,W_DAMAGE ld a,[hli] ld b,a ld c,[hl] - ld hl,$D075 + ld hl,wd075 ld a,[hl] add c ld [hld],a ld a,[hl] adc b ld [hl],a - ld hl,$D06A + ld hl,wd06a dec [hl] jr z,.next11 ; 599B ld hl,Func_3d80a ; $580a @@ -3490,15 +3410,15 @@ HyperBeamCheck: ; 3d8c2 (f:58c2) ld hl,UnleashedEnergyText call PrintText ld a,1 - ld [$CFD4],a - ld hl,$D075 + ld [W_PLAYERMOVEPOWER],a + ld hl,wd075 ld a,[hld] add a ld b,a - ld [$D0D8],a + ld [wd0d8],a ld a,[hl] rl a - ld [$D0D7],a + ld [W_DAMAGE],a or b jr nz,.next12 ; 59C2 ld a,1 @@ -3518,7 +3438,7 @@ HyperBeamCheck: ; 3d8c2 (f:58c2) ld [W_PLAYERMOVENUM],a ld hl,ThrashingAboutText call PrintText - ld hl,$D06A + ld hl,wd06a dec [hl] ld hl,asm_3d6dc ; $56dc jp nz,Func_3da37 @@ -3526,11 +3446,11 @@ HyperBeamCheck: ; 3d8c2 (f:58c2) ld hl,W_PLAYERBATTSTATUS1 res 1,[hl] set 7,[hl] - call GenRandomInBattle ; random number + call BattleRandom and a,3 inc a inc a - ld [$D06B],a + ld [wd06b],a pop hl jp Func_3da37 .next13 @@ -3538,23 +3458,23 @@ HyperBeamCheck: ; 3d8c2 (f:58c2) jp z,Func_3da1a ld hl,AttackContinuesText call PrintText - ld a,[$D06A] + ld a,[wd06a] dec a - ld [$D06A],a + ld [wd06a],a ld hl,asm_3d714 ; $5714 jp nz,Func_3da37 jp Func_3da37 Func_3da1a: ; 3da1a (f:5a1a) - ld a, [W_PLAYERBATTSTATUS2] ; $d063 + ld a, [W_PLAYERBATTSTATUS2] ; W_PLAYERBATTSTATUS2 bit 6, a jp z, Func_3da39 ld a, RAGE - ld [$d11e], a + ld [wd11e], a call GetMoveName call CopyStringToCF4B xor a - ld [W_PLAYERMOVEEFFECT], a ; $cfd3 + ld [W_PLAYERMOVEEFFECT], a ; wcfd3 ld hl, asm_3d6b0 ; $56b0 jp Func_3da37 @@ -3628,19 +3548,19 @@ CantMoveText: ; 3da83 (f:5a83) db "@" PrintMoveIsDisabledText: ; 3da88 (f:5a88) - ld hl, wPlayerSelectedMove ; $ccdc - ld de, W_PLAYERBATTSTATUS1 ; $d062 + ld hl, wPlayerSelectedMove ; wPlayerSelectedMove + ld de, W_PLAYERBATTSTATUS1 ; W_PLAYERBATTSTATUS1 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3da97 inc hl - ld de, W_ENEMYBATTSTATUS1 ; $d067 + ld de, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 .asm_3da97 ld a, [de] res 4, a ld [de], a ld a, [hl] - ld [$d11e], a + ld [wd11e], a call GetMoveName ld hl, MoveIsDisabledText jp PrintText @@ -3652,22 +3572,22 @@ MoveIsDisabledText: ; 3daa8 (f:5aa8) PrintHurtItselfText: ; 3daad (f:5aad) ld hl, HurtItselfText call PrintText - ld hl, W_ENEMYMONDEFENSE ; $cff8 + ld hl, wEnemyMonDefense ; wcff8 ld a, [hli] push af ld a, [hld] push af - ld a, [W_PLAYERMONDEF] + ld a, [wBattleMonDefense] ld [hli], a - ld a, [$d028] + ld a, [wBattleMonDefense + 1] ld [hl], a - ld hl, W_PLAYERMOVEEFFECT ; $cfd3 + ld hl, W_PLAYERMOVEEFFECT ; wcfd3 push hl ld a, [hl] push af xor a ld [hli], a - ld [$d05e], a + ld [wd05e], a ld a, $28 ld [hli], a xor a @@ -3677,13 +3597,13 @@ PrintHurtItselfText: ; 3daad (f:5aad) pop af pop hl ld [hl], a - ld hl, $cff9 + ld hl, wEnemyMonDefense + 1 pop af ld [hld], a pop af ld [hl], a xor a - ld [$cc5b], a + ld [wcc5b], a inc a ld [H_WHOSETURN], a ; $fff3 call PlayMoveAnimation @@ -3701,20 +3621,20 @@ MonName1Text: ; 3dafb (f:5afb) db $08 ; asm ld a, [H_WHOSETURN] ; $fff3 and a - ld a, [W_PLAYERMOVENUM] ; $cfd2 - ld hl, $ccf1 + ld a, [W_PLAYERMOVENUM] ; wcfd2 + ld hl, wccf1 jr z, .asm_3db11 - ld a, [W_ENEMYMOVENUM] ; $cfcc - ld hl, $ccf2 + ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM + ld hl, wccf2 .asm_3db11 ld [hl], a - ld [$d11e], a + ld [wd11e], a call Func_3db85 - ld a, [$cced] + ld a, [wcced] and a ld hl, Used2Text ret nz - ld a, [$d11e] + ld a, [wd11e] cp DOUBLESLAP ld hl, Used2Text ret c @@ -3731,7 +3651,7 @@ Used2Text: ; 3db34 (f:5b34) db $08 ; asm PrintInsteadText: ; 3db39 (f:5b39) - ld a, [$cced] + ld a, [wcced] and a jr z, PrintCF4BText ld hl, InsteadText @@ -3749,7 +3669,7 @@ CF4BText: ; 3db4c (f:5b4c) TX_FAR _CF4BText db $08 ; asm ld hl, ExclamationPointPointerTable - ld a, [$d11e] + ld a, [wd11e] add a push bc ld b, $0 @@ -3790,7 +3710,7 @@ ExclamationPoint5Text: ; 3db80 (f:5b80) Func_3db85: ; 3db85 (f:5b85) push bc - ld a, [$d11e] ; move number + ld a, [wd11e] ; move number ld c, a ld b, $0 ld hl, UnknownMovesList_3dba3 ; $5ba3 @@ -3806,7 +3726,7 @@ Func_3db85: ; 3db85 (f:5b85) jr .asm_3db8f .asm_3db9d ld a, b - ld [$d11e], a + ld [wd11e], a pop bc ret @@ -3826,18 +3746,18 @@ UnknownMovesList_3dba3: ; 3dba3 (f:5ba3) db $FF ; terminator PrintMoveFailureText: ; 3dbe2 (f:5be2) - ld de, W_PLAYERMOVEEFFECT ; $cfd3 + ld de, W_PLAYERMOVEEFFECT ; wcfd3 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3dbed - ld de, W_ENEMYMOVEEFFECT ; $cfcd + ld de, W_ENEMYMOVEEFFECT ; W_ENEMYMOVEEFFECT .asm_3dbed ld hl, DoesntAffectMonText ; $5c57 - ld a, [$d05b] + ld a, [wd05b] and $7f jr z, .asm_3dc04 ld hl, AttackMissedText ; $5c42 - ld a, [$d05e] + ld a, [wd05e] cp $ff jr nz, .asm_3dc04 ld hl, UnaffectedText ; $5c4c @@ -3845,14 +3765,14 @@ PrintMoveFailureText: ; 3dbe2 (f:5be2) push de call PrintText xor a - ld [$d05e], a + ld [wd05e], a pop de ld a, [de] cp JUMP_KICK_EFFECT ret nz ; if you get here, the mon used hi jump kick and missed - ld hl, W_DAMAGE ; $d0d7 + ld hl, W_DAMAGE ; W_DAMAGE ld a, [hli] ld b, [hl] srl a @@ -3872,8 +3792,7 @@ PrintMoveFailureText: ; 3dbe2 (f:5be2) ld hl, KeptGoingAndCrashedText ; $5c47 call PrintText ld b, $4 - ld a, $24 - call Predef ; indirect jump to Func_48125 (48125 (12:4125)) + predef Func_48125 ld a, [H_WHOSETURN] ; $fff3 and a jr nz, .asm_3dc3f @@ -3902,7 +3821,7 @@ DoesntAffectMonText: ; 3dc57 (f:5c57) db "@" Func_3dc5c: ; 3dc5c (f:5c5c) - ld a, [$d05e] + ld a, [wd05e] and a jr z, .asm_3dc75 dec a @@ -3916,7 +3835,7 @@ Func_3dc5c: ; 3dc5c (f:5c5c) ld l, a call PrintText xor a - ld [$d05e], a + ld [wd05e], a .asm_3dc75 ld c, $14 jp DelayFrames @@ -3935,23 +3854,23 @@ OHKOText: ; 3dc83 (f:5c83) Func_3dc88: ; 3dc88 (f:5c88) xor a - ld [$cced], a - ld a, [W_ISLINKBATTLE] ; $d12b + ld [wcced], a + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 jr nz, .asm_3dc97 ld a, $1 and a ret .asm_3dc97 - ld hl, W_PARTYMON1_OTID ; $d177 + ld hl, wPartyMon1OTID ; wPartyMon1OTID ld bc, $2c - ld a, [wPlayerMonNumber] ; $cc2f + ld a, [wPlayerMonNumber] ; wPlayerMonNumber call AddNTimes - ld a, [wPlayerID] ; $d359 + ld a, [wPlayerID] ; wPlayerID cp [hl] jr nz, .asm_3dcb1 inc hl - ld a, [wPlayerID + 1] ; $d35a + ld a, [wPlayerID + 1] ; wd35a cp [hl] jp z, Func_3ddb0 .asm_3dcb1 @@ -3973,7 +3892,7 @@ Func_3dc88: ; 3dc88 (f:5c88) .asm_3dcce ld b, a ld c, a - ld a, [W_PLAYERMONLEVEL] ; $d022 + ld a, [wBattleMonLevel] ; wBattleMonLevel ld d, a add b ld b, a @@ -3984,14 +3903,14 @@ Func_3dc88: ; 3dc88 (f:5c88) cp d jp nc, Func_3ddb0 .asm_3dcdf - call GenRandomInBattle + call BattleRandom swap a cp b jr nc, .asm_3dcdf cp c jp c, Func_3ddb0 .asm_3dceb - call GenRandomInBattle + call BattleRandom cp b jr nc, .asm_3dceb cp c @@ -3999,7 +3918,7 @@ Func_3dc88: ; 3dc88 (f:5c88) ld a, d sub c ld b, a - call GenRandomInBattle + call BattleRandom swap a sub b jr c, .asm_3dd0e @@ -4010,16 +3929,16 @@ Func_3dc88: ; 3dc88 (f:5c88) call PrintHurtItselfText jp Func_3ddb4 .asm_3dd0e - call GenRandomInBattle + call BattleRandom add a swap a and $7 jr z, .asm_3dd0e - ld [W_PLAYERMONSTATUS], a ; $d018 + ld [wBattleMonStatus], a ; wBattleMonStatus ld hl, BeganToNapText jr .asm_3dd3a .asm_3dd20 - call GenRandomInBattle + call BattleRandom and $3 ld hl, LoafingAroundText and a @@ -4035,16 +3954,16 @@ Func_3dc88: ; 3dc88 (f:5c88) call PrintText jr Func_3ddb4 .asm_3dd3f - ld a, [$d01d] + ld a, [wBattleMonMoves + 1] and a jr z, .asm_3dd20 - ld a, [$ccee] + ld a, [wccee] and a jr nz, .asm_3dd20 - ld a, [wPlayerSelectedMove] ; $ccdc + ld a, [wPlayerSelectedMove] ; wPlayerSelectedMove cp $a5 jr z, .asm_3dd20 - ld hl, W_PLAYERMONPP ; $d02d + ld hl, wBattleMonPP ; wBattleMonPP push hl ld a, [hli] and $3f @@ -4062,7 +3981,7 @@ Func_3dc88: ; 3dc88 (f:5c88) add b pop hl push af - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld c, a ld b, $0 add hl, bc @@ -4073,33 +3992,33 @@ Func_3dc88: ; 3dc88 (f:5c88) cp b jr z, .asm_3dd20 ld a, $1 - ld [$cced], a - ld a, [wMaxMenuItem] ; $cc28 + ld [wcced], a + ld a, [wMaxMenuItem] ; wMaxMenuItem ld b, a - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld c, a .asm_3dd86 - call GenRandomInBattle + call BattleRandom and $3 cp b jr nc, .asm_3dd86 cp c jr z, .asm_3dd86 - ld [wCurrentMenuItem], a ; $cc26 - ld hl, W_PLAYERMONPP ; $d02d + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld hl, wBattleMonPP ; wBattleMonPP ld e, a ld d, $0 add hl, de ld a, [hl] and a jr z, .asm_3dd86 - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld c, a ld b, $0 - ld hl, W_PLAYERMONMOVES + ld hl, wBattleMonMoves add hl, bc ld a, [hl] - ld [wPlayerSelectedMove], a ; $ccdc + ld [wPlayerSelectedMove], a ; wPlayerSelectedMove call GetCurrentMove Func_3ddb0: ; 3ddb0 (f:5db0) @@ -4145,7 +4064,7 @@ CalculateDamage: ; 3ddcf (f:5dcf) cp a, $14 ;types >= $14 are all special jr nc, .specialAttack .physicalAttack - ld hl, W_ENEMYMONDEFENSE ;opponent defense + ld hl, wEnemyMonDefense ;opponent defense ld a, [hli] ;*BC = opponent defense used later ld b, a ld c, [hl] @@ -4156,8 +4075,8 @@ CalculateDamage: ; 3ddcf (f:5dcf) sla c ;x2 defense if bit2 of D069 is set rl b .next - ld hl, W_PLAYERMONATK ;attack pointer - ld a, [$d05e] + ld hl, wBattleMonAttack ;attack pointer + ld a, [wd05e] and a jr z, .next3 ld c, 3 @@ -4167,14 +4086,14 @@ CalculateDamage: ; 3ddcf (f:5dcf) ld a, [$ff98] ld c, a push bc - ld hl, $d18f + ld hl, wPartyMon1Attack ld a, [wPlayerMonNumber] - ld bc, $002c + ld bc, wPartyMon2 - wPartyMon1 call AddNTimes pop bc jr .next3 .specialAttack - ld hl, W_ENEMYMONSPECIAL ;opponent special + ld hl, wEnemyMonSpecial ;opponent special ld a, [hli] ;*BC = opponent special defense used later ld b, a ld c, [hl] @@ -4185,8 +4104,8 @@ CalculateDamage: ; 3ddcf (f:5dcf) sla c ;x2 special defense if bit1 of D069 set rl b .next2 - ld hl, W_PLAYERMONSPECIAL - ld a, [$d05e] ;XXX + ld hl, wBattleMonSpecial + ld a, [wd05e] ;XXX and a jr z, .next3 ;skip portion of code that pulls up inactive pokemon .loadOtherPoke @@ -4197,9 +4116,9 @@ CalculateDamage: ; 3ddcf (f:5dcf) ld a, [$ff98] ld c, a push bc - ld hl, $d195 + ld hl, wPartyMon1Special ld a, [wPlayerMonNumber] - ld bc, $002c + ld bc, wPartyMon2 - wPartyMon1 call AddNTimes pop bc .next3 @@ -4222,9 +4141,9 @@ CalculateDamage: ; 3ddcf (f:5dcf) inc l ;minimum HL = 1 .next4 ld b, l ;*B = attack [possibly scaled] [C contains defense] - ld a, [$d022] ;*E = level + ld a, [wBattleMonLevel] ;*E = level ld e, a - ld a, [$d05e] ;critical hit? + ld a, [wd05e] ;critical hit? and a jr z, .next5 sla e ;double level if it was a critical hit @@ -4234,11 +4153,11 @@ CalculateDamage: ; 3ddcf (f:5dcf) ret Func_3de75: ; 3de75 (f:5e75) - ld hl, W_DAMAGE ; $d0d7 + ld hl, W_DAMAGE ; W_DAMAGE xor a ld [hli], a ld [hl], a - ld hl, W_ENEMYMOVEPOWER ; $cfce + ld hl, W_ENEMYMOVEPOWER ; wcfce ld a, [hli] ld d, a and a @@ -4246,22 +4165,22 @@ Func_3de75: ; 3de75 (f:5e75) ld a, [hl] cp $14 jr nc, .asm_3debc - ld hl, W_PLAYERMONDEF + ld hl, wBattleMonDefense ld a, [hli] ld b, a ld c, [hl] - ld a, [W_PLAYERBATTSTATUS3] ; $d064 + ld a, [W_PLAYERBATTSTATUS3] ; W_PLAYERBATTSTATUS3 bit 2, a jr z, .asm_3de98 sla c rl b .asm_3de98 - ld hl, W_ENEMYMONATTACK - ld a, [$d05e] + ld hl, wEnemyMonAttack + ld a, [wd05e] and a jr z, .asm_3deef - ld hl, W_PARTYMON1_DEFENSE ; $d191 - ld a, [wPlayerMonNumber] ; $cc2f + ld hl, wPartyMon1Defense + ld a, [wPlayerMonNumber] ; wPlayerMonNumber ld bc, $2c call AddNTimes ld a, [hli] @@ -4274,22 +4193,22 @@ Func_3de75: ; 3de75 (f:5e75) pop bc jr .asm_3deef .asm_3debc - ld hl, W_PLAYERMONSPECIAL + ld hl, wBattleMonSpecial ld a, [hli] ld b, a ld c, [hl] - ld a, [W_PLAYERBATTSTATUS3] ; $d064 + ld a, [W_PLAYERBATTSTATUS3] ; W_PLAYERBATTSTATUS3 bit 1, a jr z, .asm_3decd sla c rl b .asm_3decd - ld hl, W_ENEMYMONSPECIAL ; $cffc - ld a, [$d05e] + ld hl, wEnemyMonSpecial ; wcffc + ld a, [wd05e] and a jr z, .asm_3deef - ld hl, W_PARTYMON1_SPECIAL ; $d195 - ld a, [wPlayerMonNumber] ; $cc2f + ld hl, wPartyMon1Special ; wPartyMon1Special + ld a, [wPlayerMonNumber] ; wPlayerMonNumber ld bc, $2c call AddNTimes ld a, [hli] @@ -4320,9 +4239,9 @@ Func_3de75: ; 3de75 (f:5e75) inc l .asm_3df0a ld b, l - ld a, [W_ENEMYMONLEVEL] ; $cff3 + ld a, [wEnemyMonLevel] ; wEnemyMonLevel ld e, a - ld a, [$d05e] + ld a, [wd05e] and a jr z, .asm_3df17 sla e @@ -4335,16 +4254,16 @@ Func_3de75: ; 3de75 (f:5e75) Func_3df1c: ; 3df1c (f:5f1c) push de push bc - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 jr nz, .asm_3df40 - ld hl, $d8c6 + ld hl, wEnemyMon1Stats dec c sla c ld b, $0 add hl, bc - ld a, [W_ENEMYMONNUMBER] ; $cfe8 - ld bc, $2c + ld a, [wEnemyMonPartyPos] + ld bc, wEnemyMon2 - wEnemyMon1 call AddNTimes ld a, [hli] ld [$ff97], a @@ -4354,13 +4273,13 @@ Func_3df1c: ; 3df1c (f:5f1c) pop de ret .asm_3df40 - ld a, [W_ENEMYMONLEVEL] ; $cff3 - ld [W_CURENEMYLVL], a ; $d127 - ld a, [$cfe5] - ld [$d0b5], a + ld a, [wEnemyMonLevel] ; wEnemyMonLevel + ld [W_CURENEMYLVL], a ; W_CURENEMYLVL + ld a, [wEnemyMonSpecies] + ld [wd0b5], a call GetMonHeader - ld hl, $cff1 - ld de, $cfaf + ld hl, wEnemyMonDVs + ld de, wcfaf ld a, [hli] ld [de], a inc de @@ -4368,7 +4287,7 @@ Func_3df1c: ; 3df1c (f:5f1c) ld [de], a pop bc ld b, $0 - ld hl, $cfa4 + ld hl, wcfa4 call CalcStat pop de ret @@ -4384,7 +4303,7 @@ MoreCalculateDamage: ; 3df65 (f:5f65) and a ld a, [W_PLAYERMOVEEFFECT] jr z, .effect - ld a, [$cfcd] + ld a, [W_ENEMYMOVEEFFECT] .effect ; EXPLODE_EFFECT halves defense. @@ -4534,7 +4453,7 @@ MoreCalculateDamage: ; 3df65 (f:5f65) Func_3e016: ; 3e016 (f:6016) call Func_3f132 - ld a, [W_MOVEMISSED] ; $d05f + ld a, [W_MOVEMISSED] ; W_MOVEMISSED dec a ret @@ -4552,25 +4471,25 @@ UnusedHighCriticalMoves: ; 3e01e (f:601e) ; among the most popular) tend to CH about 20 to 25% of the time." CriticalHitTest: ; 3e023 (f:6023) xor a - ld [$d05e], a + ld [wd05e], a ld a, [H_WHOSETURN] ; $fff3 and a - ld a, [$cfe5] + ld a, [wEnemyMonSpecies] jr nz, .asm_3e032 - ld a, [W_PLAYERMONID] + ld a, [wBattleMonSpecies] .asm_3e032 - ld [$d0b5], a + ld [wd0b5], a call GetMonHeader ld a, [W_MONHBASESPEED] ld b, a srl b ; (effective (base speed/2)) ld a, [H_WHOSETURN] ; $fff3 and a - ld hl, W_PLAYERMOVEPOWER ; $cfd4 - ld de, W_PLAYERBATTSTATUS2 ; $d063 + ld hl, W_PLAYERMOVEPOWER ; W_PLAYERMOVEPOWER + ld de, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2 jr z, .calcCriticalHitProbability - ld hl, W_ENEMYMOVEPOWER ; $cfce - ld de, W_ENEMYBATTSTATUS2 ; $d068 + ld hl, W_ENEMYMOVEPOWER ; wcfce + ld de, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2 .calcCriticalHitProbability ; 0x3e04f ld a, [hld] ; read base power from RAM and a @@ -4606,14 +4525,14 @@ CriticalHitTest: ; 3e023 (f:6023) jr nc, .SkipHighCritical ld b, $ff .SkipHighCritical - call GenRandomInBattle ; generates a random value, in "a" + call BattleRandom ; generates a random value, in "a" rlc a rlc a rlc a cp b ; check a against calculated crit rate ret nc ; no critical hit if no borrow ld a, $1 - ld [$d05e], a ; set critical hit flag + ld [wd05e], a ; set critical hit flag ret ; high critical hit moves @@ -4697,7 +4616,7 @@ ApplyAttackToEnemyPokemon: ; 3e0df (f:60df) jr ApplyDamageToEnemyPokemon .superFangEffect ; set the damage to half the target's HP - ld hl,W_ENEMYMONCURHP + ld hl,wEnemyMonHP ld de,W_DAMAGE ld a,[hli] srl a @@ -4714,7 +4633,7 @@ ApplyAttackToEnemyPokemon: ; 3e0df (f:60df) ld [de],a jr ApplyDamageToEnemyPokemon .specialDamage - ld hl,W_PLAYERMONLEVEL + ld hl,wBattleMonLevel ld a,[hl] ld b,a ld a,[W_PLAYERMOVENUM] @@ -4736,7 +4655,7 @@ ApplyAttackToEnemyPokemon: ; 3e0df (f:60df) ld b,a ; b = level * 1.5 ; loop until a random number in the range [1, b) is found .loop - call GenRandomInBattle ; random number + call BattleRandom and a jr z,.loop cp b @@ -4763,16 +4682,16 @@ ApplyDamageToEnemyPokemon: ; 3e142 (f:6142) ; also, save the current HP at wHPBarOldHP ld a,[hld] ld b,a - ld a,[W_ENEMYMONCURHP + 1] + ld a,[wEnemyMonHP + 1] ld [wHPBarOldHP],a sub b - ld [W_ENEMYMONCURHP + 1],a + ld [wEnemyMonHP + 1],a ld a,[hl] ld b,a - ld a,[W_ENEMYMONCURHP] + ld a,[wEnemyMonHP] ld [wHPBarOldHP+1],a sbc b - ld [W_ENEMYMONCURHP],a + ld [wEnemyMonHP],a jr nc,.animateHpBar ; if more damage was done than the current HP, zero the HP and set the damage ; equal to how much HP the pokemon had before the attack @@ -4781,26 +4700,24 @@ ApplyDamageToEnemyPokemon: ; 3e142 (f:6142) ld a,[wHPBarOldHP] ld [hl],a xor a - ld hl,W_ENEMYMONCURHP + ld hl,wEnemyMonHP ld [hli],a ld [hl],a .animateHpBar - ld hl,W_ENEMYMONMAXHP + ld hl,wEnemyMonMaxHP ld a,[hli] ld [wHPBarMaxHP+1],a ld a,[hl] ld [wHPBarMaxHP],a - ld hl,W_ENEMYMONCURHP + ld hl,wEnemyMonHP ld a,[hli] ld [wHPBarNewHP+1],a ld a,[hl] ld [wHPBarNewHP],a - FuncCoord 2, 2 ; $c3ca - ld hl,Coord + hlCoord 2, 2 xor a - ld [$cf94],a - ld a,$48 - call Predef ; animate the HP bar shortening + ld [wListMenuID],a + predef UpdateHPBar2 ; animate the HP bar shortening ApplyAttackToEnemyPokemonDone: ; 3e19d (f:619d) jp Func_3cd5a ; redraw pokemon names and HP bars @@ -4818,7 +4735,7 @@ ApplyAttackToPlayerPokemon: ; 3e1a0 (f:61a0) jr ApplyDamageToPlayerPokemon .superFangEffect ; set the damage to half the target's HP - ld hl,W_PLAYERMONCURHP + ld hl,wBattleMonHP ld de,W_DAMAGE ld a,[hli] srl a @@ -4835,7 +4752,7 @@ ApplyAttackToPlayerPokemon: ; 3e1a0 (f:61a0) ld [de],a jr ApplyDamageToPlayerPokemon .specialDamage - ld hl,W_ENEMYMONLEVEL + ld hl,wEnemyMonLevel ld a,[hl] ld b,a ld a,[W_ENEMYMOVENUM] @@ -4859,7 +4776,7 @@ ApplyAttackToPlayerPokemon: ; 3e1a0 (f:61a0) ; this differs from the range when the player attacks, which is [1, b) ; it's possible for the enemy to do 0 damage with Psywave, but the player always does at least 1 damage .loop - call GenRandomInBattle ; random number + call BattleRandom cp b jr nc,.loop ld b,a @@ -4884,16 +4801,16 @@ ApplyDamageToPlayerPokemon: ; 3e200 (f:6200) ; also, save the current HP at wHPBarOldHP and the new HP at wHPBarNewHP ld a,[hld] ld b,a - ld a,[W_PLAYERMONCURHP + 1] + ld a,[wBattleMonHP + 1] ld [wHPBarOldHP],a sub b - ld [W_PLAYERMONCURHP + 1],a + ld [wBattleMonHP + 1],a ld [wHPBarNewHP],a ld b,[hl] - ld a,[W_PLAYERMONCURHP] + ld a,[wBattleMonHP] ld [wHPBarOldHP+1],a sbc b - ld [W_PLAYERMONCURHP],a + ld [wBattleMonHP],a ld [wHPBarNewHP+1],a jr nc,.animateHpBar ; if more damage was done than the current HP, zero the HP and set the damage @@ -4903,24 +4820,22 @@ ApplyDamageToPlayerPokemon: ; 3e200 (f:6200) ld a,[wHPBarOldHP] ld [hl],a xor a - ld hl,W_PLAYERMONCURHP + ld hl,wBattleMonHP ld [hli],a ld [hl],a ld hl,wHPBarNewHP ld [hli],a ld [hl],a .animateHpBar - ld hl,W_PLAYERMONMAXHP + ld hl,wBattleMonMaxHP ld a,[hli] ld [wHPBarMaxHP+1],a ld a,[hl] ld [wHPBarMaxHP],a - FuncCoord 10, 9 ; $c45e - ld hl,Coord + hlCoord 10, 9 ld a,$01 - ld [$cf94],a - ld a,$48 - call Predef ; animate the HP bar shortening + ld [wListMenuID],a + predef UpdateHPBar2 ; animate the HP bar shortening ApplyAttackToPlayerPokemonDone jp Func_3cd5a ; redraw pokemon names and HP bars @@ -5031,12 +4946,12 @@ MirrorMoveCopyMove: ; 3e2fd (f:62fd) ld a,[H_WHOSETURN] and a ; values for player turn - ld a,[$ccf2] + ld a,[wccf2] ld hl,wPlayerSelectedMove ld de,W_PLAYERMOVENUM jr z,.next ; values for enemy turn - ld a,[$ccf1] + ld a,[wccf1] ld de,W_ENEMYMOVENUM ld hl,wEnemySelectedMove .next @@ -5058,7 +4973,7 @@ MirrorMoveFailedText: ; 3e324 (f:6324) ; function used to reload move data for moves like Mirror Move and Metronome ReloadMoveData: ; 3e329 (f:6329) - ld [$d11e],a + ld [wd11e],a dec a ld hl,Moves ld bc,$0006 @@ -5076,7 +4991,7 @@ ReloadMoveData: ; 3e329 (f:6329) ; function that picks a random move for metronome MetronomePickMove: ; 3e348 (f:6348) xor a - ld [$cc5b],a + ld [wcc5b],a ld a,METRONOME call PlayMoveAnimation ; play Metronome's animation ; values for player turn @@ -5090,10 +5005,10 @@ MetronomePickMove: ; 3e348 (f:6348) ld hl,wEnemySelectedMove ; loop to pick a random number in the range [1, $a5) to be the move used by Metronome .pickMoveLoop - call GenRandomInBattle ; random number + call BattleRandom and a jr z,.pickMoveLoop - cp a,NUM_MOVES + 1 ; max normal move number + 1 (this is Struggle's move number) + cp a,NUM_ATTACKS + 1 ; max normal move number + 1 (this is Struggle's move number) jr nc,.pickMoveLoop cp a,METRONOME jr z,.pickMoveLoop @@ -5107,13 +5022,13 @@ IncrementMovePP: ; 3e373 (f:6373) ld a,[H_WHOSETURN] and a ; values for player turn - ld hl,W_PLAYERMONPP - ld de,W_PARTYMON1_MOVE1PP + ld hl,wBattleMonPP + ld de,wPartyMon1PP ld a,[wPlayerMoveListIndex] jr z,.next ; values for enemy turn - ld hl,W_ENEMYMONPP - ld de,$d8c1 ; enemy party pokemon 1 PP + ld hl,wEnemyMonPP + ld de,wEnemyMon1PP ld a,[wEnemyMoveListIndex] .next ld b,$00 @@ -5127,9 +5042,9 @@ IncrementMovePP: ; 3e373 (f:6373) and a ld a,[wPlayerMonNumber] ; value for player turn jr z,.next2 - ld a,[W_ENEMYMONNUMBER] ; value for enemy turn + ld a,[wEnemyMonPartyPos] ; value for enemy turn .next2 - ld bc,$002c + ld bc,wEnemyMon2 - wEnemyMon1 call AddNTimes inc [hl] ; increment PP in the party memory location ret @@ -5137,32 +5052,32 @@ IncrementMovePP: ; 3e373 (f:6373) ; function to adjust the base damage of an attack to account for type effectiveness AdjustDamageForMoveType: ; 3e3a5 (f:63a5) ; values for player turn - ld hl,W_PLAYERMONTYPES + ld hl,wBattleMonType ld a,[hli] ld b,a ; b = type 1 of attacker ld c,[hl] ; c = type 2 of attacker - ld hl,W_ENEMYMONTYPES + ld hl,wEnemyMonType ld a,[hli] ld d,a ; d = type 1 of defender ld e,[hl] ; e = type 2 of defender ld a,[W_PLAYERMOVETYPE] - ld [$d11e],a + ld [wd11e],a ld a,[H_WHOSETURN] and a jr z,.next ; values for enemy turn - ld hl,W_ENEMYMONTYPES + ld hl,wEnemyMonType ld a,[hli] ld b,a ; b = type 1 of attacker ld c,[hl] ; c = type 2 of attacker - ld hl,W_PLAYERMONTYPES + ld hl,wBattleMonType ld a,[hli] ld d,a ; d = type 1 of defender ld e,[hl] ; e = type 2 of defender ld a,[W_ENEMYMOVETYPE] - ld [$d11e],a + ld [wd11e],a .next - ld a,[$d11e] ; move type + ld a,[wd11e] ; move type cp b ; does the move type match type 1 of the attacker? jr z,.sameTypeAttackBonus cp c ; does the move type match type 2 of the attacker? @@ -5184,10 +5099,10 @@ AdjustDamageForMoveType: ; 3e3a5 (f:63a5) ld [W_DAMAGE],a ld a,l ld [W_DAMAGE + 1],a - ld hl,$d05b + ld hl,wd05b set 7,[hl] .skipSameTypeAttackBonus - ld a,[$d11e] + ld a,[wd11e] ld b,a ; b = move type ld hl,TypeEffects .loop @@ -5207,13 +5122,13 @@ AdjustDamageForMoveType: ; 3e3a5 (f:63a5) push hl push bc inc hl - ld a,[$d05b] + ld a,[wd05b] and a,$80 ld b,a ld a,[hl] ; a = damage multiplier ld [H_MULTIPLIER],a add b - ld [$d05b],a + ld [wd05b],a xor a ld [H_MULTIPLICAND],a ld hl,W_DAMAGE @@ -5250,18 +5165,18 @@ AdjustDamageForMoveType: ; 3e3a5 (f:63a5) ; function to tell how effective the type of an enemy attack is on the player's current pokemon ; this doesn't take into account the effects that dual types can have ; (e.g. 4x weakness / resistance, weaknesses and resistances canceling) -; the result is stored in [$D11E] +; the result is stored in [wd11e] ; ($05 is not very effective, $10 is neutral, $14 is super effective) ; as far is can tell, this is only used once in some AI code to help decide which move to use AIGetTypeEffectiveness: ; 3e449 (f:6449) ld a,[W_ENEMYMOVETYPE] ld d,a ; d = type of enemy move - ld hl,W_PLAYERMONTYPES + ld hl,wBattleMonType ld b,[hl] ; b = type 1 of player's pokemon inc hl ld c,[hl] ; c = type 2 of player's pokemon ld a,$10 - ld [$d11e],a ; initialize [$D11E] to neutral effectiveness + ld [wd11e],a ; initialize [wd11e] to neutral effectiveness ld hl,TypeEffects .loop ld a,[hli] @@ -5282,7 +5197,7 @@ AIGetTypeEffectiveness: ; 3e449 (f:6449) jr .loop .done ld a,[hl] - ld [$d11e],a ; store damage multiplier + ld [wd11e],a ; store damage multiplier ret INCLUDE "data/type_effects.asm" @@ -5292,14 +5207,14 @@ MoveHitTest: ; 3e56b (f:656b) ; player's turn ld hl,W_ENEMYBATTSTATUS1 ld de,W_PLAYERMOVEEFFECT - ld bc,W_ENEMYMONSTATUS + ld bc,wEnemyMonStatus ld a,[H_WHOSETURN] and a jr z,.dreamEaterCheck ; enemy's turn ld hl,W_PLAYERBATTSTATUS1 ld de,W_ENEMYMOVEEFFECT - ld bc,W_PLAYERMONSTATUS + ld bc,wBattleMonStatus .dreamEaterCheck ld a,[de] cp a,DREAM_EATER_EFFECT @@ -5385,7 +5300,7 @@ MoveHitTest: ; 3e56b (f:656b) .doAccuracyCheck ; if the random number generated is greater than or equal to the scaled accuracy, the move misses ; note that this means that even the highest accuracy is still just a 255/256 chance, not 100% - call GenRandomInBattle ; random number + call BattleRandom cp b jr nc,.moveMissed ret @@ -5478,7 +5393,7 @@ CalcHitChance: ; 3e624 (f:6624) ret Func_3e687: ; 3e687 (f:6687) - ld hl, W_DAMAGE ; $d0d7 + ld hl, W_DAMAGE ; W_DAMAGE ld a, [hli] and a jr nz, .asm_3e692 @@ -5494,7 +5409,7 @@ Func_3e687: ; 3e687 (f:6687) ld a, [hl] ld [$ff98], a .asm_3e69c - call GenRandomInBattle + call BattleRandom rrca cp $d9 jr c, .asm_3e69c @@ -5505,81 +5420,81 @@ Func_3e687: ; 3e687 (f:6687) ld b, $4 call Divide ld a, [$ff97] - ld hl, W_DAMAGE ; $d0d7 + ld hl, W_DAMAGE ; W_DAMAGE ld [hli], a ld a, [$ff98] ld [hl], a ret Func_3e6bc: ; 3e6bc (f:66bc) - ld a, [wEnemySelectedMove] ; $ccdd + ld a, [wEnemySelectedMove] ; wccdd inc a jp z, Func_3e88c call PrintGhostText jp z, Func_3e88c - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 jr nz, .asm_3e6dc ld b, $1 - ld a, [$cc3e] + ld a, [wcc3e] cp $e jr z, .asm_3e6dc cp $4 ret nc .asm_3e6dc - ld hl, $ccd5 + ld hl, wccd5 inc [hl] xor a - ld [W_MOVEMISSED], a ; $d05f - ld [$ccf4], a + ld [W_MOVEMISSED], a ; W_MOVEMISSED + ld [wccf4], a ld a, $a - ld [$d05b], a + ld [wd05b], a call Func_3e88f jr nz, .asm_3e6f2 jp [hl] .asm_3e6f2 - ld hl, W_ENEMYBATTSTATUS1 ; $d067 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 bit 4, [hl] jr nz, asm_3e70b call GetCurrentMove Func_3e6fc: ; 3e6fc (f:66fc) - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT cp CHARGE_EFFECT jp z, Func_3f132 cp FLY_EFFECT jp z, Func_3f132 jr asm_3e72b asm_3e70b: ; 3e70b (f:670b) - ld hl, W_ENEMYBATTSTATUS1 ; $d067 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 res 4, [hl] ; no longer charging up for attack res 6, [hl] ; no longer invulnerable to typcial attacks - ld a, [W_ENEMYMOVENUM] ; $cfcc - ld [$d0b5], a + ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM + ld [wd0b5], a ld a, $2c - ld [$d0b7], a + ld [wPredefBank], a ld a, MOVE_NAME ld [W_LISTTYPE], a call GetName - ld de, $cd6d + ld de, wcd6d call CopyStringToCF4B asm_3e72b: ; 3e72b (f:672b) xor a - ld [$cced], a + ld [wcced], a call PrintMonName1Text - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT ld hl, EffectsArray1 ; $4000 ld de, $1 call IsInArray jp c, Func_3f132 - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT ld hl, EffectsArray5B ; $4049 ld de, $1 call IsInArray call c, Func_3f132 asm_3e750: ; 3e750 (f:6750) call Func_3ec81 - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT ld hl, EffectsArray2 ; $4011 ld de, $1 call IsInArray @@ -5598,10 +5513,10 @@ asm_3e750: ; 3e750 (f:6750) Func_3e77f: ; 3e77f (f:677f) call MoveHitTest asm_3e782: ; 3e782 (f:6782) - ld a, [W_MOVEMISSED] ; $d05f + ld a, [W_MOVEMISSED] ; W_MOVEMISSED and a jr z, .asm_3e791 - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT cp EXPLODE_EFFECT jr z, asm_3e7a0 jr Func_3e7d1 @@ -5609,7 +5524,7 @@ asm_3e782: ; 3e782 (f:6782) call Func_3ec81 Func_3e794: ; 3e794 (f:6794) - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT and a ld a, $1 jr z, asm_3e7a4 @@ -5620,18 +5535,18 @@ asm_3e7a0: ; 3e7a0 (f:67a0) xor a asm_3e7a4: ; 3e7a4 (f:67a4) push af - ld a, [W_ENEMYBATTSTATUS2] ; $d068 + ld a, [W_ENEMYBATTSTATUS2] ; W_ENEMYBATTSTATUS2 bit 4, a ; does mon have a substitute? ld hl, Func_79747 ld b, BANK(Func_79747) call nz, Bankswitch pop af - ld [$cc5b], a - ld a, [W_ENEMYMOVENUM] ; $cfcc + ld [wcc5b], a + ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM call PlayMoveAnimation call Func_3eed3 call Func_3cdec - ld a, [W_ENEMYBATTSTATUS2] ; $d068 + ld a, [W_ENEMYBATTSTATUS2] ; W_ENEMYBATTSTATUS2 bit 4, a ; does mon have a substitute? ld hl, Func_79771 ld b, BANK(Func_79771) @@ -5642,7 +5557,7 @@ Func_3e7d1: ; 3e7d1 (f:67d1) call Func_3ec81 ld c, $1e call DelayFrames - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT cp FLY_EFFECT jr z, .asm_3e7e6 cp CHARGE_EFFECT @@ -5650,11 +5565,11 @@ Func_3e7d1: ; 3e7d1 (f:67d1) jr asm_3e7ef .asm_3e7e6 xor a - ld [$cc5b], a + ld [wcc5b], a ld a,STATUS_AFFECTED_ANIM call PlayMoveAnimation asm_3e7ef: ; 3e7ef (f:67ef) - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT cp MIRROR_MOVE_EFFECT jr nz, .notMirrorMoveEffect call MirrorMoveCopyMove @@ -5666,16 +5581,16 @@ asm_3e7ef: ; 3e7ef (f:67ef) call MetronomePickMove jp Func_3e6fc .notMetronomeEffect - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT ld hl, EffectsArray3 ; $4014 ld de, $1 call IsInArray jp c, Func_3f132 - ld a, [W_MOVEMISSED] ; $d05f + ld a, [W_MOVEMISSED] ; W_MOVEMISSED and a jr z, .asm_3e82b call PrintMoveFailureText - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT cp EXPLODE_EFFECT jr z, .asm_3e83e jp Func_3e88c @@ -5684,24 +5599,24 @@ asm_3e7ef: ; 3e7ef (f:67ef) call Func_3dc5c callab DisplayEffectiveness ld a, $1 - ld [$ccf4], a + ld [wccf4], a .asm_3e83e - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT ld hl, EffectsArray4 ; $4030 ld de, $1 call IsInArray call c, Func_3f132 - ld hl, W_PLAYERMONCURHP ; $d015 + ld hl, wBattleMonHP ; wd015 ld a, [hli] ld b, [hl] or b ret z call HandleBuildingRage - ld hl, W_ENEMYBATTSTATUS1 ; $d067 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 bit 2, [hl] ; is mon hitting multiple times? (example: double kick) jr z, .asm_3e873 push hl - ld hl, $d06f + ld hl, wd06f dec [hl] pop hl jp nz, Func_3e794 @@ -5709,9 +5624,9 @@ asm_3e7ef: ; 3e7ef (f:67ef) ld hl, HitXTimesText ; $6887 call PrintText xor a - ld [$cd05], a + ld [wcd05], a .asm_3e873 - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT and a jr z, Func_3e88c ld hl, EffectsArray5 ; $403b @@ -5729,18 +5644,18 @@ Func_3e88c: ; 3e88c (f:688c) ret Func_3e88f: ; 3e88f (f:688f) - ld hl, W_ENEMYMONSTATUS ; $cfe9 + ld hl, wEnemyMonStatus ; wcfe9 ld a, [hl] and $7 jr z, .asm_3e8bf dec a - ld [W_ENEMYMONSTATUS], a ; $cfe9 + ld [wEnemyMonStatus], a ; wcfe9 and a jr z, .asm_3e8af ld hl, FastAsleepText call PrintText xor a - ld [$cc5b], a + ld [wcc5b], a ld a,SLP_ANIM call PlayMoveAnimation jr .asm_3e8b5 @@ -5749,7 +5664,7 @@ Func_3e88f: ; 3e88f (f:688f) call PrintText .asm_3e8b5 xor a - ld [$ccf2], a + ld [wccf2], a ld hl, Func_3e88c ; $688c jp Func_3eab8 .asm_3e8bf @@ -5758,11 +5673,11 @@ Func_3e88f: ; 3e88f (f:688f) ld hl, IsFrozenText call PrintText xor a - ld [$ccf2], a + ld [wccf2], a ld hl, Func_3e88c ; $688c jp Func_3eab8 .asm_3e8d3 - ld a, [W_PLAYERBATTSTATUS1] ; $d062 + ld a, [W_PLAYERBATTSTATUS1] ; W_PLAYERBATTSTATUS1 bit 5, a jp z, Func_3e8e7 ld hl, CantMoveText @@ -5771,7 +5686,7 @@ Func_3e88f: ; 3e88f (f:688f) jp Func_3eab8 Func_3e8e7: ; 3e8e7 (f:68e7) - ld hl, W_ENEMYBATTSTATUS1 ; $d067 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 bit 3, [hl] jp z, Func_3e8fd res 3, [hl] @@ -5781,7 +5696,7 @@ Func_3e8e7: ; 3e8e7 (f:68e7) jp Func_3eab8 Func_3e8fd: ; 3e8fd (f:68fd) - ld hl, W_ENEMYBATTSTATUS2 ; $d068 + ld hl, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2 bit 5, [hl] jr z, .asm_3e912 res 5, [hl] @@ -5790,7 +5705,7 @@ Func_3e8fd: ; 3e8fd (f:68fd) ld hl, Func_3e88c ; $688c jp Func_3eab8 .asm_3e912 - ld hl, W_ENEMYDISABLEDMOVE ; $d072 + ld hl, W_ENEMYDISABLEDMOVE ; W_ENEMYDISABLEDMOVE ld a, [hl] and a jr z, .asm_3e929 @@ -5799,17 +5714,17 @@ Func_3e8fd: ; 3e8fd (f:68fd) and $f jr nz, .asm_3e929 ld [hl], a - ld [$ccef], a + ld [wccef], a ld hl, DisabledNoMoreText call PrintText .asm_3e929 - ld a, [W_ENEMYBATTSTATUS1] ; $d067 + ld a, [W_ENEMYBATTSTATUS1] ; W_ENEMYBATTSTATUS1 add a jp nc, Func_3e9aa - ld hl, $d070 + ld hl, wd070 dec [hl] jr nz, .asm_3e944 - ld hl, W_ENEMYBATTSTATUS1 ; $d067 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 res 7, [hl] ld hl, ConfusedNoMoreText call PrintText @@ -5818,34 +5733,34 @@ Func_3e8fd: ; 3e8fd (f:68fd) ld hl, IsConfusedText call PrintText xor a - ld [$cc5b], a + ld [wcc5b], a ld a,CONF_ANIM call PlayMoveAnimation - call GenRandomInBattle + call BattleRandom cp $80 jr c, Func_3e9aa - ld hl, W_ENEMYBATTSTATUS1 ; $d067 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 ld a, [hl] and $80 ld [hl], a ld hl, HurtItselfText call PrintText - ld hl, W_PLAYERMONDEF + ld hl, wBattleMonDefense ld a, [hli] push af ld a, [hld] push af - ld a, [W_ENEMYMONDEFENSE] ; $cff8 + ld a, [wEnemyMonDefense] ; wcff8 ld [hli], a - ld a, [$cff9] + ld a, [wEnemyMonDefense + 1] ld [hl], a - ld hl, W_ENEMYMOVEEFFECT ; $cfcd + ld hl, W_ENEMYMOVEEFFECT ; W_ENEMYMOVEEFFECT push hl ld a, [hl] push af xor a ld [hli], a - ld [$d05e], a + ld [wd05e], a ld a, $28 ld [hli], a xor a @@ -5855,13 +5770,13 @@ Func_3e8fd: ; 3e8fd (f:68fd) pop af pop hl ld [hl], a - ld hl, $d028 + ld hl, wBattleMonDefense + 1 pop af ld [hld], a pop af ld [hl], a xor a - ld [$cc5b], a + ld [wcc5b], a ld [H_WHOSETURN], a ; $fff3 ld a, POUND call PlayMoveAnimation @@ -5871,30 +5786,30 @@ Func_3e8fd: ; 3e8fd (f:68fd) jr asm_3e9d3 Func_3e9aa: ; 3e9aa (f:69aa) - ld a, [$ccef] + ld a, [wccef] and a jr z, .asm_3e9bf - ld hl, wEnemySelectedMove ; $ccdd + ld hl, wEnemySelectedMove ; wccdd cp [hl] jr nz, .asm_3e9bf call PrintMoveIsDisabledText ld hl, Func_3e88c ; $688c jp Func_3eab8 .asm_3e9bf - ld hl, W_ENEMYMONSTATUS ; $cfe9 + ld hl, wEnemyMonStatus ; wcfe9 bit 6, [hl] jr z, asm_3e9f6 - call GenRandomInBattle + call BattleRandom cp $3f jr nc, asm_3e9f6 ld hl, FullyParalyzedText call PrintText asm_3e9d3: ; 3e9d3 (f:69d3) - ld hl, W_ENEMYBATTSTATUS1 ; $d067 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 ld a, [hl] and $cc ld [hl], a - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT cp FLY_EFFECT jr z, .asm_3e9e7 cp CHARGE_EFFECT @@ -5902,59 +5817,59 @@ asm_3e9d3: ; 3e9d3 (f:69d3) jr .asm_3e9f0 .asm_3e9e7 xor a - ld [$cc5b], a + ld [wcc5b], a ld a, STATUS_AFFECTED_ANIM call PlayMoveAnimation .asm_3e9f0 ld hl, Func_3e88c ; $688c jp Func_3eab8 asm_3e9f6: ; 3e9f6 (f:69f6) - ld hl, W_ENEMYBATTSTATUS1 ; $d067 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 bit 0, [hl] ; is mon using bide? jr z, .asm_3ea54 xor a - ld [W_ENEMYMOVENUM], a ; $cfcc - ld hl, W_DAMAGE ; $d0d7 + ld [W_ENEMYMOVENUM], a ; W_ENEMYMOVENUM + ld hl, W_DAMAGE ; W_DAMAGE ld a, [hli] ld b, a ld c, [hl] - ld hl, $cd06 + ld hl, wcd06 ld a, [hl] add c ld [hld], a ld a, [hl] adc b ld [hl], a - ld hl, $d06f + ld hl, wd06f dec [hl] jr z, .asm_3ea1c ld hl, Func_3e88c ; $688c jp Func_3eab8 .asm_3ea1c - ld hl, W_ENEMYBATTSTATUS1 ; $d067 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 res 0, [hl] ld hl, UnleashedEnergyText call PrintText ld a, $1 - ld [W_ENEMYMOVEPOWER], a ; $cfce - ld hl, $cd06 + ld [W_ENEMYMOVEPOWER], a ; wcfce + ld hl, wcd06 ld a, [hld] add a ld b, a - ld [$d0d8], a + ld [wd0d8], a ld a, [hl] rl a - ld [W_DAMAGE], a ; $d0d7 + ld [W_DAMAGE], a ; W_DAMAGE or b jr nz, .asm_3ea43 ld a, $1 - ld [W_MOVEMISSED], a ; $d05f + ld [W_MOVEMISSED], a ; W_MOVEMISSED .asm_3ea43 xor a ld [hli], a ld [hl], a ld a, BIDE - ld [W_ENEMYMOVENUM], a ; $cfcc + ld [W_ENEMYMOVENUM], a ; W_ENEMYMOVENUM call Func_3ec81 ld hl, asm_3e782 ; $6782 jp Func_3eab8 @@ -5962,22 +5877,22 @@ asm_3e9f6: ; 3e9f6 (f:69f6) bit 1, [hl] ; is mon using thrash or petal dance? jr z, .asm_3ea83 ld a, THRASH - ld [W_ENEMYMOVENUM], a ; $cfcc + ld [W_ENEMYMOVENUM], a ; W_ENEMYMOVENUM ld hl, ThrashingAboutText call PrintText - ld hl, $d06f + ld hl, wd06f dec [hl] ld hl, asm_3e750 ; $6750 jp nz, Func_3eab8 push hl - ld hl, W_ENEMYBATTSTATUS1 ; $d067 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 res 1, [hl] ; mon is no longer using thrash or petal dance set 7, [hl] ; mon is now confused - call GenRandomInBattle + call BattleRandom and $3 inc a inc a - ld [$d070], a + ld [wd070], a pop hl jp Func_3eab8 .asm_3ea83 @@ -5985,22 +5900,22 @@ asm_3e9f6: ; 3e9f6 (f:69f6) jp z, Func_3ea9b ld hl, AttackContinuesText call PrintText - ld hl, $d06f + ld hl, wd06f dec [hl] ld hl, Func_3e794 ; $6794 jp nz, Func_3eab8 jp Func_3eab8 Func_3ea9b: ; 3ea9b (f:6a9b) - ld a, [W_ENEMYBATTSTATUS2] ; $d068 + ld a, [W_ENEMYBATTSTATUS2] ; W_ENEMYBATTSTATUS2 bit 6, a ; is mon using rage? jp z, Func_3eaba ld a, RAGE - ld [$d11e], a + ld [wd11e], a call GetMoveName call CopyStringToCF4B xor a - ld [W_ENEMYMOVEEFFECT], a ; $cfcd + ld [W_ENEMYMOVEEFFECT], a ; W_ENEMYMOVEEFFECT ld hl, asm_3e72b ; $672b jp Func_3eab8 @@ -6017,18 +5932,18 @@ GetCurrentMove: ; 3eabe (f:6abe) ld a, [H_WHOSETURN] ; $fff3 and a jp z, .player - ld de, W_ENEMYMOVENUM ; $cfcc - ld a, [wEnemySelectedMove] ; $ccdd + ld de, W_ENEMYMOVENUM ; W_ENEMYMOVENUM + ld a, [wEnemySelectedMove] ; wccdd jr .selected .player - ld de, W_PLAYERMOVENUM ; $cfd2 + ld de, W_PLAYERMOVENUM ; wcfd2 ld a, [W_FLAGS_D733] bit 0, a - ld a, [$ccd9] + ld a, [wccd9] jr nz, .selected - ld a, [wPlayerSelectedMove] ; $ccdc + ld a, [wPlayerSelectedMove] ; wPlayerSelectedMove .selected - ld [$d0b5], a + ld [wd0b5], a dec a ld hl, Moves ; $4000 ld bc, $6 @@ -6036,80 +5951,80 @@ GetCurrentMove: ; 3eabe (f:6abe) ld a, BANK(Moves) call FarCopyData ld a, $2c - ld [$d0b7], a + ld [wPredefBank], a ld a, $2 ld [W_LISTTYPE], a ; list type 2 = move name call GetName - ld de, $cd6d + ld de, wcd6d jp CopyStringToCF4B Func_3eb01: ; 3eb01 (f:6b01) - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 jp z, Func_3cc13 - ld a, [W_ENEMYMONID] - ld [$cfe5], a - ld [$d0b5], a + ld a, [wEnemyMonSpecies2] + ld [wEnemyMonSpecies], a + ld [wd0b5], a call GetMonHeader - ld a, [W_ENEMYBATTSTATUS3] ; $d069 + ld a, [W_ENEMYBATTSTATUS3] ; W_ENEMYBATTSTATUS3 bit 3, a - ld hl, $cceb + ld hl, wcceb ld a, [hli] ld b, [hl] jr nz, .asm_3eb33 - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $2 ld a, $98 ld b, $88 jr z, .asm_3eb33 - call GenRandomInBattle + call BattleRandom ld b, a - call GenRandomInBattle + call BattleRandom .asm_3eb33 - ld hl, $cff1 + ld hl, wEnemyMonDVs ld [hli], a ld [hl], b - ld de, W_ENEMYMONLEVEL ; $cff3 - ld a, [W_CURENEMYLVL] ; $d127 + ld de, wEnemyMonLevel ; wEnemyMonLevel + ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL ld [de], a inc de ld b, $0 - ld hl, W_ENEMYMONCURHP ; $cfe6 + ld hl, wEnemyMonHP ; wEnemyMonHP push hl call CalcStats pop hl - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $2 jr z, .asm_3eb65 - ld a, [W_ENEMYBATTSTATUS3] ; $d069 + ld a, [W_ENEMYBATTSTATUS3] ; W_ENEMYBATTSTATUS3 bit 3, a jr nz, .asm_3eb86 - ld a, [W_ENEMYMONMAXHP] ; $cff4 + ld a, [wEnemyMonMaxHP] ; wEnemyMonMaxHP ld [hli], a - ld a, [W_ENEMYMONMAXHP+1] + ld a, [wEnemyMonMaxHP+1] ld [hli], a xor a inc hl ld [hl], a jr .asm_3eb86 .asm_3eb65 - ld hl, W_ENEMYMON1HP ; $d8a5 (aliases: W_WATERMONS) - ld a, [wWhichPokemon] ; $cf92 - ld bc, $2c + ld hl, wEnemyMon1HP ; wd8a5 (aliases: W_WATERMONS) + ld a, [wWhichPokemon] ; wWhichPokemon + ld bc, wEnemyMon2 - wEnemyMon1 call AddNTimes ld a, [hli] - ld [W_ENEMYMONCURHP], a ; $cfe6 + ld [wEnemyMonHP], a ; wEnemyMonHP ld a, [hli] - ld [$cfe7], a - ld a, [wWhichPokemon] ; $cf92 - ld [W_ENEMYMONNUMBER], a ; $cfe8 + ld [wEnemyMonHP + 1], a + ld a, [wWhichPokemon] ; wWhichPokemon + ld [wEnemyMonPartyPos], a inc hl ld a, [hl] - ld [W_ENEMYMONSTATUS], a ; $cfe9 + ld [wEnemyMonStatus], a ; wcfe9 jr .asm_3eb86 .asm_3eb86 ld hl, W_MONHTYPES - ld de, W_ENEMYMONTYPES ; $cfea + ld de, wEnemyMonType ; wcfea ld a, [hli] ; copy type 1 ld [de], a inc de @@ -6119,14 +6034,14 @@ Func_3eb01: ; 3eb01 (f:6b01) ld a, [hli] ; copy catch rate ld [de], a inc de - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $2 jr nz, .asm_3ebb0 - ld hl, $d8ac - ld a, [wWhichPokemon] ; $cf92 - ld bc, $2c + ld hl, wEnemyMon1Moves + ld a, [wWhichPokemon] ; wWhichPokemon + ld bc, wEnemyMon2 - wEnemyMon1 call AddNTimes - ld bc, $4 + ld bc, NUM_MOVES call CopyData jr .asm_3ebca .asm_3ebb0 @@ -6146,16 +6061,14 @@ Func_3eb01: ; 3eb01 (f:6b01) dec de dec de xor a - ld [$cee9], a - ld a, $3e - call Predef ; indirect jump to WriteMonMoves (3afb8 (e:6fb8)) + ld [wHPBarMaxHP], a + predef WriteMonMoves .asm_3ebca - ld hl, W_ENEMYMONMOVES - ld de, $cffd - ld a, $5e - call Predef ; indirect jump to LoadMovePPs (f473 (3:7473)) + ld hl, wEnemyMonMoves + ld de, wEnemyMonSpecial + 1 + predef LoadMovePPs ld hl, W_MONHBASESTATS - ld de, $d002 + ld de, wd002 ld b, $5 .asm_3ebdd ld a, [hli] @@ -6169,31 +6082,29 @@ Func_3eb01: ; 3eb01 (f:6b01) inc de ld a, [hl] ; base exp ld [de], a - ld a, [W_ENEMYMONID] - ld [$d11e], a + ld a, [wEnemyMonSpecies2] + ld [wd11e], a call GetMonName - ld hl, $cd6d - ld de, W_ENEMYMONNAME + ld hl, wcd6d + ld de, wEnemyMonNick ld bc, $b call CopyData - ld a, [W_ENEMYMONID] - ld [$d11e], a - ld a, $3a - call Predef ; indirect jump to IndexToPokedex (41010 (10:5010)) - ld a, [$d11e] + ld a, [wEnemyMonSpecies2] + ld [wd11e], a + predef IndexToPokedex + ld a, [wd11e] dec a ld c, a ld b, $1 - ld hl, wPokedexSeen ; $d30a - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) - ld hl, W_ENEMYMONLEVEL ; $cff3 - ld de, $cd23 + ld hl, wPokedexSeen ; wd30a + predef FlagActionPredef + ld hl, wEnemyMonLevel ; wEnemyMonLevel + ld de, wcd23 ld bc, $b call CopyData ld a, $7 ld b, $8 - ld hl, wEnemyMonStatMods ; $cd2e + ld hl, wEnemyMonStatMods ; wcd2e .asm_3ec2d ld [hli], a dec b @@ -6201,53 +6112,52 @@ Func_3eb01: ; 3eb01 (f:6b01) ret Func_3ec32: ; 3ec32 (f:6c32) - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 jr nz, .asm_3ec4d xor a - ld [wMenuJoypadPollCount], a ; $cc34 + ld [wMenuJoypadPollCount], a ; wMenuJoypadPollCount callab Func_372d6 ld a, $1 - ld [$cfcb], a + ld [wcfcb], a call ClearScreen .asm_3ec4d call DelayFrame - ld a, $30 - call Predef ; indirect jump to Func_7096d (7096d (1c:496d)) + predef BattleTransition callab Func_3ee58 ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld a, $ff - ld [$cfcb], a - call CleanLCD_OAM + ld [wcfcb], a + call ClearSprites call ClearScreen xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [$ffb0], a ld [rWY], a ; $ff4a ld [$ffd7], a - ld hl, $d060 + ld hl, wd060 ld [hli], a ld [hli], a ld [hli], a ld [hli], a ld [hl], a - ld [W_PLAYERDISABLEDMOVE], a ; $d06d + ld [W_PLAYERDISABLEDMOVE], a ; W_PLAYERDISABLEDMOVE ret Func_3ec81: ; 3ec81 (f:6c81) push bc - ld a, [W_PLAYERMONLEVEL] ; $d022 + ld a, [wBattleMonLevel] ; wBattleMonLevel ld b, a - ld a, [W_ENEMYMONLEVEL] ; $cff3 - ld [W_PLAYERMONLEVEL], a ; $d022 + ld a, [wEnemyMonLevel] ; wEnemyMonLevel + ld [wBattleMonLevel], a ; wBattleMonLevel ld a, b - ld [W_ENEMYMONLEVEL], a ; $cff3 + ld [wEnemyMonLevel], a ; wEnemyMonLevel pop bc ret Func_3ec92: ; 3ec92 (f:6c92) - ld a, [W_BATTLETYPE] ; $d05a + ld a, [W_BATTLETYPE] ; wd05a dec a ld de, RedPicBack ; $7e0a jr nz, .asm_3ec9e @@ -6255,8 +6165,7 @@ Func_3ec92: ; 3ec92 (f:6c92) .asm_3ec9e ld a, BANK(RedPicBack) call UncompressSpriteFromDE - ld a, $3 - call Predef ; indirect jump to ScaleSpriteByTwo (2fe40 (b:7e40)) + predef ScaleSpriteByTwo ld hl, wOAMBuffer xor a ld [H_DOWNARROWBLINKCNT1], a ; $ff8b @@ -6288,26 +6197,24 @@ Func_3ec92: ; 3ec92 (f:6c92) ld e, a dec b jr nz, .asm_3ecb2 - ld de, $9310 + ld de, vBackPic call InterlaceMergeSpriteBuffers ld a, $a ld [$0], a xor a ld [$4000], a - ld hl, $8000 + ld hl, vSprites ld de, S_SPRITEBUFFER1 ld a, [H_LOADEDROMBANK] ld b, a - ld c, $31 + ld c, 7 * 7 call CopyVideoData xor a ld [$0], a ld a, $31 ld [$ffe1], a - FuncCoord 1, 5 ; $c405 - ld hl, Coord - ld a, $1 - jp Predef ; indirect jump to Func_3f0c6 (3f0c6 (f:70c6)) + hlCoord 1, 5 + predef_jump Func_3f0c6 Func_3ed02: ; 3ed02 (f:6d02) callab Func_39680 @@ -6335,10 +6242,10 @@ Func_3ed27: ; 3ed27 (f:6d27) ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3ed48 - ld a, [W_PLAYERMONSTATUS] ; $d018 + ld a, [wBattleMonStatus] ; wBattleMonStatus and $40 ret z - ld hl, $d02a + ld hl, wBattleMonSpeed + 1 ld a, [hld] ld b, a ld a, [hl] @@ -6354,10 +6261,10 @@ Func_3ed27: ; 3ed27 (f:6d27) ld [hl], b ret .asm_3ed48 - ld a, [W_ENEMYMONSTATUS] ; $cfe9 + ld a, [wEnemyMonStatus] ; wcfe9 and $40 ret z - ld hl, $cffb + ld hl, wEnemyMonSpeed + 1 ld a, [hld] ld b, a ld a, [hl] @@ -6377,10 +6284,10 @@ Func_3ed64: ; 3ed64 (f:6d64) ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3ed81 - ld a, [W_PLAYERMONSTATUS] ; $d018 + ld a, [wBattleMonStatus] ; wBattleMonStatus and $10 ret z - ld hl, $d026 + ld hl, wBattleMonAttack + 1 ld a, [hld] ld b, a ld a, [hl] @@ -6394,10 +6301,10 @@ Func_3ed64: ; 3ed64 (f:6d64) ld [hl], b ret .asm_3ed81 - ld a, [W_ENEMYMONSTATUS] ; $cfe9 + ld a, [wEnemyMonStatus] ; wcfe9 and $10 ret z - ld hl, $cff7 + ld hl, wEnemyMonAttack + 1 ld a, [hld] ld b, a ld a, [hl] @@ -6424,16 +6331,16 @@ Func_3ed99: ; 3ed99 (f:6d99) Func_3eda5: ; 3eda5 (f:6da5) push bc push bc - ld a, [$d11e] + ld a, [wd11e] and a ld a, c - ld hl, W_PLAYERMONATK - ld de, $cd12 - ld bc, wPlayerMonAttackMod ; $cd1a + ld hl, wBattleMonAttack + ld de, wcd12 + ld bc, wPlayerMonAttackMod ; wcd1a jr z, .asm_3edc0 - ld hl, W_ENEMYMONATTACK - ld de, $cd26 - ld bc, wEnemyMonStatMods ; $cd2e + ld hl, wEnemyMonAttack + ld de, wcd26 + ld bc, wEnemyMonStatMods ; wcd2e .asm_3edc0 add c ld c, a @@ -6505,7 +6412,7 @@ Func_3ee19: ; 3ee19 (f:6e19) ret z ld a, [W_OBTAINEDBADGES] ld b, a - ld hl, W_PLAYERMONATK + ld hl, wBattleMonAttack ld c, $4 .asm_3ee28 srl b @@ -6552,22 +6459,22 @@ Func_3ee5b: ; 3ee5b (f:6e5b) add a jr c, .asm_3ee7c ld hl, BattleHudTiles1 ; $6080 - ld de, $96d0 + ld de, vChars2 + $6d0 ld bc, $18 ld a, BANK(BattleHudTiles1) call FarCopyDataDouble ld hl, BattleHudTiles2 ; $6098 - ld de, $9730 + ld de, vChars2 + $730 ld bc, $30 ld a, BANK(BattleHudTiles2) jp FarCopyDataDouble .asm_3ee7c ld de, BattleHudTiles1 ; $6080 - ld hl, $96d0 + ld hl, vChars2 + $6d0 ld bc, (BANK(BattleHudTiles1) << 8) + $03 call CopyVideoDataDouble ld de, BattleHudTiles2 ; $6098 - ld hl, $9730 + ld hl, vChars2 + $730 ld bc, (BANK(BattleHudTiles2) << 8) + $06 jp CopyVideoDataDouble @@ -6578,34 +6485,39 @@ Func_3ee94: ; 3ee94 (f:6e94) TerminatorText_3ee9a: ; 3ee9a (f:6e9a) db "@" -; generates a random number unless in link battle -; stores random number in A -GenRandomInBattle: ; 3ee9b (f:6e9b) + +BattleRandom: +; Link battles use a shared PRNG. + ld a, [W_ISLINKBATTLE] cp $4 - jp nz, GenRandom + jp nz, Random + push hl push bc - ld a, [$ccde] + ld a, [wccde] ld c, a - ld b, $0 - ld hl, $d148 + ld b, 0 + ld hl, wd148 add hl, bc inc a - ld [$ccde], a - cp $9 + ld [wccde], a + cp 9 ld a, [hl] pop bc pop hl ret c + push hl push bc push af + xor a - ld [$ccde], a - ld hl, $d148 - ld b, $9 -.asm_3eec5 + ld [wccde], a + + ld hl, wd148 + ld b, 9 +.loop ld a, [hl] ld c, a add a @@ -6614,22 +6526,24 @@ GenRandomInBattle: ; 3ee9b (f:6e9b) inc a ld [hli], a dec b - jr nz, .asm_3eec5 ; 0x3eecd $f6 + jr nz, .loop + pop af pop bc pop hl ret + Func_3eed3: ; 3eed3 (f:6ed3) ld a, [H_WHOSETURN] ; $fff3 and a - ld hl, W_ENEMYMONTYPE1 ; $cfea (aliases: W_ENEMYMONTYPES) - ld de, W_ENEMYBATTSTATUS1 ; $d067 - ld a, [W_PLAYERMOVENUM] ; $cfd2 + ld hl, wEnemyMonType1 ; wcfea (aliases: wEnemyMonType) + ld de, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 + ld a, [W_PLAYERMOVENUM] ; wcfd2 jr z, .asm_3eeea - ld hl, W_PLAYERMONTYPE1 ; $d019 (aliases: W_PLAYERMONTYPES) - ld de, W_ENEMYBATTSTATUS1 ; $d067 - ld a, [W_ENEMYMOVENUM] ; $cfcc + ld hl, wBattleMonType1 ; wd019 (aliases: wBattleMonType) + ld de, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 + ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM .asm_3eeea cp SELFDESTRUCT jr z, .asm_3eef1 @@ -6645,77 +6559,75 @@ Func_3eed3: ; 3eed3 (f:6ed3) ld a, [hl] cp GHOST ret z - ld a, [W_MOVEMISSED] ; $d05f + ld a, [W_MOVEMISSED] ; W_MOVEMISSED and a ret nz ld a, MEGA_PUNCH - ld [$cc5b], a + ld [wcc5b], a PlayMoveAnimation: ; 3ef07 (f:6f07) - ld [$D07C],a + ld [W_ANIMATIONID],a call Delay3 - PREDEF_JUMP MoveAnimationPredef ; predef 8 + predef_jump MoveAnimation InitBattle: ; 3ef12 (f:6f12) - ld a, [W_CUROPPONENT] ; $d059 + ld a, [W_CUROPPONENT] ; wd059 and a jr z, asm_3ef23 InitOpponent: ; 3ef18 (f:6f18) - ld a, [W_CUROPPONENT] ; $d059 - ld [$cf91], a - ld [W_ENEMYMONID], a + ld a, [W_CUROPPONENT] ; wd059 + ld [wcf91], a + ld [wEnemyMonSpecies2], a jr asm_3ef3d asm_3ef23: ; 3ef23 (f:6f23) - ld a, [$d732] + ld a, [wd732] bit 1, a jr z, .asm_3ef2f - ld a, [H_CURRENTPRESSEDBUTTONS] + ld a, [hJoyHeld] bit 1, a ret nz .asm_3ef2f - ld a, [$d13c] + ld a, [wd13c] and a ret nz callab Func_13870 ret nz asm_3ef3d: ; 3ef3d (f:6f3d) - ld a, [$d35d] + ld a, [wd35d] push af - ld hl, $d358 + ld hl, wd358 ld a, [hl] push af res 1, [hl] callab Func_525af - ld a, [W_ENEMYMONID] + ld a, [wEnemyMonSpecies2] sub $c8 jp c, InitWildBattle - ld [W_TRAINERCLASS], a ; $d031 + ld [W_TRAINERCLASS], a ; wd031 call GetTrainerInformation callab ReadTrainer call Func_3ec32 call _LoadTrainerPic xor a - ld [W_ENEMYMONID], a + ld [wEnemyMonSpecies2], a ld [$ffe1], a dec a - ld [wAICount], a ; $ccdf - FuncCoord 12, 0 ; $c3ac - ld hl, Coord - ld a, $1 - call Predef ; indirect jump to Func_3f0c6 (3f0c6 (f:70c6)) + ld [wAICount], a ; wccdf + hlCoord 12, 0 + predef Func_3f0c6 ld a, $ff - ld [W_ENEMYMONNUMBER], a ; $cfe8 + ld [wEnemyMonPartyPos], a ld a, $2 - ld [W_ISINBATTLE], a ; $d057 + ld [W_ISINBATTLE], a ; W_ISINBATTLE jp Func_3efeb InitWildBattle: ; 3ef8b (f:6f8b) ld a, $1 - ld [W_ISINBATTLE], a ; $d057 + ld [W_ISINBATTLE], a ; W_ISINBATTLE call Func_3eb01 call Func_3ec32 - ld a, [W_CUROPPONENT] ; $d059 + ld a, [W_CUROPPONENT] ; wd059 cp MAROWAK jr z, .isGhost call IsGhostBattle @@ -6728,7 +6640,7 @@ InitWildBattle: ; 3ef8b (f:6f8b) ld a, c ld [hli], a ; write front sprite pointer ld [hl], b - ld hl, W_ENEMYMONNAME ; set name to "GHOST" + ld hl, wEnemyMonNick ; set name to "GHOST" ld a, "G" ld [hli], a ld a, "H" @@ -6740,26 +6652,24 @@ InitWildBattle: ; 3ef8b (f:6f8b) ld a, "T" ld [hli], a ld [hl], "@" - ld a, [$cf91] + ld a, [wcf91] push af ld a, MON_GHOST - ld [$cf91], a - ld de, $9000 + ld [wcf91], a + ld de, vFrontPic call LoadMonFrontSprite ; load ghost sprite pop af - ld [$cf91], a + ld [wcf91], a jr .spriteLoaded .isNoGhost - ld de, $9000 + ld de, vFrontPic call LoadMonFrontSprite ; load mon sprite .spriteLoaded xor a - ld [W_TRAINERCLASS], a ; $d031 + ld [W_TRAINERCLASS], a ; wd031 ld [$ffe1], a - FuncCoord 12, 0 ; $c3ac - ld hl, Coord - ld a, $1 - call Predef ; indirect jump to Func_3f0c6 (3f0c6 (f:70c6)) + hlCoord 12, 0 + predef Func_3f0c6 Func_3efeb: ; 3efeb (f:6feb) ld b, $0 @@ -6779,25 +6689,23 @@ Func_3efeb: ; 3efeb (f:6feb) ld a, $9c ld [$ffbd], a call LoadScreenTilesFromBuffer1 - FuncCoord 9, 7 ; $c435 - ld hl, Coord + hlCoord 9, 7 ld bc, $50a call ClearScreenArea - FuncCoord 1, 0 ; $c3a1 - ld hl, Coord + hlCoord 1, 0 ld bc, $40a call ClearScreenArea - call CleanLCD_OAM - ld a, [W_ISINBATTLE] ; $d057 + call ClearSprites + ld a, [W_ISINBATTLE] ; W_ISINBATTLE dec a call z, Func_3cdec call Func_3c11e callab Func_137aa pop af - ld [$d358], a + ld [wd358], a pop af - ld [$d35d], a - ld a, [$d0d4] + ld [wd35d], a + ld a, [wd0d4] ld [$ffd7], a scf ret @@ -6806,38 +6714,38 @@ TerminatorText_3f04a: ; 3f04a (f:704a) db "@" _LoadTrainerPic: ; 3f04b (f:704b) -; $d033-$d034 contain pointer to pic - ld a, [$d033] +; wd033-wd034 contain pointer to pic + ld a, [wd033] ld e, a - ld a, [$d034] + ld a, [wd034] ld d, a ; de contains pointer to trainer pic - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE and a ld a, Bank(TrainerPics) ; this is where all the trainer pics are (not counting Red's) jr z, .loadSprite ld a, Bank(RedPicFront) .loadSprite call UncompressSpriteFromDE - ld de, $9000 + ld de, vFrontPic ld a, $77 ld c, a jp LoadUncompressedSpriteData Func_3f069: ; 3f069 (f:7069) xor a - ld [$c0f1], a - ld [$c0f2], a + ld [wc0f1], a + ld [wc0f2], a jp PlaySound Func_3f073: ; 3f073 (f:7073) - ld a, [$cc4f] + ld a, [wPredefRegisters] ld h, a - ld a, [$cc50] + ld a, [wPredefRegisters + 1] ld l, a ld a, [$ffe1] ld [H_DOWNARROWBLINKCNT1], a ; $ff8b ld b, $4c - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE and a jr z, .asm_3f0bc add b @@ -6846,19 +6754,17 @@ Func_3f073: ; 3f073 (f:7073) ld bc, $ffd7 add hl, bc ld a, $1 - ld [$cd6c], a + ld [wcd6c], a ld bc, $303 - ld a, $5 - call Predef ; indirect jump to Func_79aba (79aba (1e:5aba)) + predef Func_79aba ld c, $4 call DelayFrames ld bc, $ffd7 add hl, bc xor a - ld [$cd6c], a + ld [wcd6c], a ld bc, $505 - ld a, $5 - call Predef ; indirect jump to Func_79aba (79aba (1e:5aba)) + predef Func_79aba ld c, $5 call DelayFrames ld bc, $ffd7 @@ -6872,9 +6778,9 @@ Func_3f073: ; 3f073 (f:7073) jr asm_3f0d0 Func_3f0c6: ; 3f0c6 (f:70c6) - ld a, [$cc4f] + ld a, [wPredefRegisters] ld h, a - ld a, [$cc50] + ld a, [wPredefRegisters + 1] ld l, a ld a, [$ffe1] asm_3f0d0: ; 3f0d0 (f:70d0) @@ -6923,24 +6829,22 @@ asm_3f0d0: ; 3f0d0 (f:70d0) jr nz, .asm_3f0f4 ret -; loads back sprite of mon to $8000 -; assumes the corresponding mon header is already loaded -LoadMonBackSprite: ; 3f103 (f:7103) - ld a, [$cfd9] - ld [$cf91], a - FuncCoord 1, 5 ; $c405 - ld hl, Coord +LoadMonBackPic: +; Assumes the monster's attributes have +; been loaded with GetMonHeader. + ld a, [wBattleMonSpecies2] + ld [wcf91], a + hlCoord 1, 5 ld b, $7 ld c, $8 call ClearScreenArea ld hl, W_MONHBACKSPRITE - W_MONHEADER call UncompressMonSprite - ld a, $3 - call Predef ; indirect jump to ScaleSpriteByTwo (2fe40 (b:7e40)) - ld de, $9310 + predef ScaleSpriteByTwo + ld de, vBackPic call InterlaceMergeSpriteBuffers ; combine the two buffers to a single 2bpp sprite - ld hl, $8000 - ld de, $9310 + ld hl, vSprites + ld de, vBackPic ld c, (2*SPRITEBUFFERSIZE)/16 ; count of 16-byte chunks to be copied ld a, [H_LOADEDROMBANK] ld b, a @@ -7058,13 +6962,13 @@ MoveEffectPointerTable: ; 3f150 (f:7150) dw DisableEffect ; DISABLE_EFFECT SleepEffect: ; 3f1fc (f:71fc) - ld de, W_ENEMYMONSTATUS ; $cfe9 - ld bc, W_ENEMYBATTSTATUS2 ; $d068 + ld de, wEnemyMonStatus ; wcfe9 + ld bc, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2 ld a, [H_WHOSETURN] ; $fff3 and a jp z, .asm_3f20e - ld de, W_PLAYERMONSTATUS ; $d018 - ld bc, W_PLAYERBATTSTATUS2 ; $d063 + ld de, wBattleMonStatus ; wBattleMonStatus + ld bc, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2 .asm_3f20e ld a, [bc] @@ -7085,11 +6989,11 @@ SleepEffect: ; 3f1fc (f:71fc) push de call MoveHitTest pop de - ld a, [W_MOVEMISSED] ; $d05f + ld a, [W_MOVEMISSED] ; W_MOVEMISSED and a jr nz, .asm_3f242 .asm_3f231 - call GenRandomInBattle + call BattleRandom and $7 jr z, .asm_3f231 ld [de], a @@ -7108,13 +7012,13 @@ AlreadyAsleepText: ; 3f24a (f:724a) db "@" PoisonEffect: ; 3f24f (f:724f) - ld hl, W_ENEMYMONSTATUS ; $cfe9 - ld de, W_PLAYERMOVEEFFECT ; $cfd3 + ld hl, wEnemyMonStatus ; wcfe9 + ld de, W_PLAYERMOVEEFFECT ; wcfd3 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3f260 - ld hl, W_PLAYERMONSTATUS ; $d018 - ld de, W_ENEMYMOVEEFFECT ; $cfcd + ld hl, wBattleMonStatus ; wBattleMonStatus + ld de, W_ENEMYMOVEEFFECT ; W_ENEMYMOVEEFFECT .asm_3f260 call CheckTargetSubstitute jr nz, .asm_3f2d3 @@ -7140,12 +7044,12 @@ PoisonEffect: ; 3f24f (f:724f) call MoveHitTest pop de pop hl - ld a, [W_MOVEMISSED] ; $d05f + ld a, [W_MOVEMISSED] ; W_MOVEMISSED and a jr nz, .asm_3f2d7 jr .asm_3f295 .asm_3f290 - call GenRandomInBattle + call BattleRandom cp b ret nc .asm_3f295 @@ -7156,13 +7060,13 @@ PoisonEffect: ; 3f24f (f:724f) ld a, [H_WHOSETURN] ; $fff3 and a ld b, $c7 - ld hl, W_PLAYERBATTSTATUS3 ; $d064 + ld hl, W_PLAYERBATTSTATUS3 ; W_PLAYERBATTSTATUS3 ld a, [de] - ld de, W_PLAYERTOXICCOUNTER ; $d06c + ld de, W_PLAYERTOXICCOUNTER ; wd06c jr nz, .asm_3f2b0 ld b, $a9 - ld hl, W_ENEMYBATTSTATUS3 ; $d069 - ld de, W_ENEMYTOXICCOUNTER ; $d071 + ld hl, W_ENEMYBATTSTATUS3 ; W_ENEMYBATTSTATUS3 + ld de, W_ENEMYTOXICCOUNTER ; wd071 .asm_3f2b0 cp $5c jr nz, .asm_3f2bd @@ -7207,13 +7111,13 @@ DrainHPEffect: ; 3f2e9 (f:72e9) jp Bankswitch ExplodeEffect: ; 3f2f1 (f:72f1) - ld hl, W_PLAYERMONCURHP ; $d015 - ld de, W_PLAYERBATTSTATUS2 ; $d063 + ld hl, wBattleMonHP ; wd015 + ld de, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3f302 - ld hl, W_ENEMYMONCURHP ; $cfe6 - ld de, W_ENEMYBATTSTATUS2 ; $d068 + ld hl, wEnemyMonHP ; wEnemyMonHP + ld de, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2 .asm_3f302 xor a ld [hli], a ; set the mon's HP to 0 @@ -7227,22 +7131,22 @@ ExplodeEffect: ; 3f2f1 (f:72f1) FreezeBurnParalyzeEffect: ; 3f30c (f:730c) xor a - ld [$cc5b], a + ld [wcc5b], a call CheckTargetSubstitute ;test bit 4 of d063/d068 flags [target has substitute flag] ret nz ;return if they have a substitute, can't effect them ld a, [$fff3] ;whose turn? and a jp nz, opponentAttacker - ld a, [W_ENEMYMONSTATUS] + ld a, [wEnemyMonStatus] and a jp nz, CheckDefrost ;opponent has no existing status ld a, [W_PLAYERMOVETYPE] ld b, a - ld a, [W_ENEMYMONTYPE1] + ld a, [wEnemyMonType1] cp b ret z ;return if they match [can't freeze an ice type etc.] - ld a, [W_ENEMYMONTYPE2] + ld a, [wEnemyMonType2] cp b ret z ;return.. ld a, [W_PLAYERMOVEEFFECT] @@ -7253,7 +7157,7 @@ FreezeBurnParalyzeEffect: ; 3f30c (f:730c) sub a, $1e ;subtract $1E to map to equivalent 10% chance effects .next1 push af ;push effect... - call GenRandomInBattle ;get random 8bit value for probability test + call BattleRandom ;get random 8bit value for probability test cp b ;success? pop bc ;...pop effect into C ret nc ;do nothing if random value is >= 1A or 4D [no status applied] @@ -7264,14 +7168,14 @@ FreezeBurnParalyzeEffect: ; 3f30c (f:730c) cp a, FREEZE_SIDE_EFFECT jr z, .freeze ld a, 1 << PAR - ld [W_ENEMYMONSTATUS], a + ld [wEnemyMonStatus], a call Func_3ed27 ;quarter speed of affected monster ld a, $a9 call Func_3fbb9 ;animation jp PrintMayNotAttackText ;print paralysis text .burn ld a, 1 << BRN - ld [W_ENEMYMONSTATUS], a + ld [wEnemyMonStatus], a call Func_3ed64 ld a, $a9 call Func_3fbb9 ;animation @@ -7280,21 +7184,21 @@ FreezeBurnParalyzeEffect: ; 3f30c (f:730c) .freeze call Func_3f9cf ;resets bit 5 of the D063/D068 flags ld a, 1 << FRZ - ld [W_ENEMYMONSTATUS], a + ld [wEnemyMonStatus], a ld a, $a9 call Func_3fbb9 ;animation ld hl, FrozenText jp PrintText opponentAttacker: ; 3f382 (f:7382) - ld a, [W_PLAYERMONSTATUS] ;this appears to the same as above with addresses swapped for opponent + ld a, [wBattleMonStatus] ;this appears to the same as above with addresses swapped for opponent and a jp nz, CheckDefrost ld a, [W_ENEMYMOVETYPE] ld b, a - ld a, [W_PLAYERMONTYPE1] + ld a, [wBattleMonType1] cp b ret z - ld a, [W_PLAYERMONTYPE2] + ld a, [wBattleMonType2] cp b ret z ld a, [W_ENEMYMOVEEFFECT] @@ -7305,7 +7209,7 @@ opponentAttacker: ; 3f382 (f:7382) sub a, $1e .next1 push af - call GenRandomInBattle + call BattleRandom cp b pop bc ret nc @@ -7315,18 +7219,18 @@ opponentAttacker: ; 3f382 (f:7382) cp a, FREEZE_SIDE_EFFECT jr z, .freeze ld a, 1 << PAR - ld [W_PLAYERMONSTATUS], a + ld [wBattleMonStatus], a call Func_3ed27 jp PrintMayNotAttackText .burn ld a, 1 << BRN - ld [W_PLAYERMONSTATUS], a + ld [wBattleMonStatus], a call Func_3ed64 ld hl, BurnedText jp PrintText .freeze ld a, 1 << FRZ - ld [W_PLAYERMONSTATUS], a + ld [wBattleMonStatus], a ld hl, FrozenText jp PrintText @@ -7350,10 +7254,10 @@ CheckDefrost: ; 3f3e2 (f:73e2) sub a, FIRE ret nz ;return if it isn't fire ;type is fire - ld [W_ENEMYMONSTATUS], a ;set opponent status to 00 ["defrost" a frozen monster] - ld hl, $d8a8 ;status of first opponent monster in their roster - ld a, [W_ENEMYMONNUMBER] - ld bc, $002c ;$2C bytes per roster entry + ld [wEnemyMonStatus], a ;set opponent status to 00 ["defrost" a frozen monster] + ld hl, wEnemyMon1Status + ld a, [wEnemyMonPartyPos] + ld bc, wEnemyMon2 - wEnemyMon1 call AddNTimes xor a ld [hl], a ;clear status in roster @@ -7363,10 +7267,10 @@ CheckDefrost: ; 3f3e2 (f:73e2) ld a, [W_ENEMYMOVETYPE] ;same as above with addresses swapped sub a, FIRE ret nz - ld [W_PLAYERMONSTATUS], a - ld hl, $d16f + ld [wBattleMonStatus], a + ld hl, wPartyMon1Status ld a, [wPlayerMonNumber] - ld bc, $002c + ld bc, wPartyMon2 - wPartyMon1 call AddNTimes xor a ld [hl], a @@ -7379,13 +7283,13 @@ FireDefrostedText: ; 3f423 (f:7423) db "@" StatModifierUpEffect: ; 3f428 (f:7428) - ld hl, wPlayerMonStatMods ; $cd1a - ld de, W_PLAYERMOVEEFFECT ; $cfd3 + ld hl, wPlayerMonStatMods ; wcd1a + ld de, W_PLAYERMOVEEFFECT ; wcfd3 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3f439 - ld hl, wEnemyMonStatMods ; $cd2e - ld de, W_ENEMYMOVEEFFECT ; $cfcd + ld hl, wEnemyMonStatMods ; wcd2e + ld de, W_ENEMYMOVEEFFECT ; W_ENEMYMOVEEFFECT .asm_3f439 ld a, [de] sub $a @@ -7415,13 +7319,13 @@ StatModifierUpEffect: ; 3f428 (f:7428) cp $4 jr nc, asm_3f4ca push hl - ld hl, $d026 - ld de, $cd12 + ld hl, wBattleMonAttack + 1 + ld de, wcd12 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3f472 - ld hl, $cff7 - ld de, $cd26 + ld hl, wEnemyMonAttack + 1 + ld de, wcd26 .asm_3f472 push bc sla c @@ -7485,15 +7389,15 @@ asm_3f4ca: ; 3f4ca (f:74ca) ld b, c inc b call Func_3f688 - ld hl, W_PLAYERBATTSTATUS2 ; $d063 - ld de, W_PLAYERMOVENUM ; $cfd2 - ld bc, $ccf7 + ld hl, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2 + ld de, W_PLAYERMOVENUM ; wcfd2 + ld bc, wccf7 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3f4e6 - ld hl, W_ENEMYBATTSTATUS2 ; $d068 - ld de, W_ENEMYMOVENUM ; $cfcc - ld bc, $ccf3 + ld hl, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2 + ld de, W_ENEMYMOVENUM ; W_ENEMYMOVENUM + ld bc, wccf3 .asm_3f4e6 ld a, [de] cp MINIMIZE @@ -7541,9 +7445,9 @@ MonsStatsRoseText: ; 3f528 (f:7528) ld hl, GreatlyRoseText ld a, [H_WHOSETURN] ; $fff3 and a - ld a, [W_PLAYERMOVEEFFECT] ; $cfd3 + ld a, [W_PLAYERMOVEEFFECT] ; wcfd3 jr z, .asm_3f53b - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT .asm_3f53b cp ATTACK_DOWN1_EFFECT ret nc @@ -7559,19 +7463,19 @@ RoseText: ; 3f547 (f:7547) db "@" StatModifierDownEffect: ; 3f54c (f:754c) - ld hl, wEnemyMonStatMods ; $cd2e - ld de, W_PLAYERMOVEEFFECT ; $cfd3 - ld bc, W_ENEMYBATTSTATUS1 ; $d067 + ld hl, wEnemyMonStatMods ; wcd2e + ld de, W_PLAYERMOVEEFFECT ; wcfd3 + ld bc, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3f572 - ld hl, wPlayerMonStatMods ; $cd1a - ld de, W_ENEMYMOVEEFFECT ; $cfcd - ld bc, W_PLAYERBATTSTATUS1 ; $d062 - ld a, [W_ISLINKBATTLE] ; $d12b + ld hl, wPlayerMonStatMods ; wcd1a + ld de, W_ENEMYMOVEEFFECT ; W_ENEMYMOVEEFFECT + ld bc, W_PLAYERBATTSTATUS1 ; W_PLAYERBATTSTATUS1 + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 jr z, .asm_3f572 - call GenRandomInBattle + call BattleRandom cp $40 jp c, Func_3f65a .asm_3f572 @@ -7580,7 +7484,7 @@ StatModifierDownEffect: ; 3f54c (f:754c) ld a, [de] cp ATTACK_DOWN_SIDE_EFFECT jr c, .asm_3f58a - call GenRandomInBattle + call BattleRandom cp SPLASH_EFFECT jp nc, Func_3f650 ld a, [de] @@ -7594,7 +7498,7 @@ StatModifierDownEffect: ; 3f54c (f:754c) pop bc pop de pop hl - ld a, [W_MOVEMISSED] ; $d05f + ld a, [W_MOVEMISSED] ; W_MOVEMISSED and a jp nz, Func_3f65a ld a, [bc] @@ -7627,13 +7531,13 @@ StatModifierDownEffect: ; 3f54c (f:754c) jr nc, asm_3f62c push hl push de - ld hl, $cff7 - ld de, $cd26 + ld hl, wEnemyMonAttack + 1 + ld de, wcd26 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3f5d8 - ld hl, $d026 - ld de, $cd12 + ld hl, wBattleMonAttack + 1 + ld de, wcd12 .asm_3f5d8 push bc sla c @@ -7736,9 +7640,9 @@ MonsStatsFellText: ; 3f661 (f:7661) ld hl, FellText ld a, [H_WHOSETURN] ; $fff3 and a - ld a, [W_PLAYERMOVEEFFECT] ; $cfd3 + ld a, [W_PLAYERMOVEEFFECT] ; wcfd3 jr z, .asm_3f674 - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT .asm_3f674 cp $1a ret c @@ -7767,7 +7671,7 @@ Func_3f688: ; 3f688 (f:7688) jr z, .asm_3f68d jr .asm_3f690 .asm_3f696 - ld de, $cf4b + ld de, wcf4b ld bc, $a jp CopyData @@ -7798,13 +7702,13 @@ StatModifierRatios: ; 3f6cb (f:76cb) BideEffect: ; 3f6e5 (f:76e5) ld hl, W_PLAYERBATTSTATUS1 ld de, W_NUMHITS - ld bc, $d06a + ld bc, wd06a ld a, [H_WHOSETURN] and a jr z, .asm_3f6fc ld hl, W_ENEMYBATTSTATUS1 - ld de, $cd05 - ld bc, $d06f + ld de, wcd05 + ld bc, wd06f .asm_3f6fc set 0, [hl] ; mon is now using bide xor a @@ -7813,7 +7717,7 @@ BideEffect: ; 3f6e5 (f:76e5) ld [de], a ld [W_PLAYERMOVEEFFECT], a ld [W_ENEMYMOVEEFFECT], a - call GenRandomInBattle + call BattleRandom and $1 inc a inc a @@ -7823,16 +7727,16 @@ BideEffect: ; 3f6e5 (f:76e5) jp Func_3fb96 ThrashPetalDanceEffect: ; 3f717 (f:7717) - ld hl, W_PLAYERBATTSTATUS1 ; $d062 - ld de, $d06a + ld hl, W_PLAYERBATTSTATUS1 ; W_PLAYERBATTSTATUS1 + ld de, wd06a ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3f728 - ld hl, W_ENEMYBATTSTATUS1 ; $d067 - ld de, $d06f + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 + ld de, wd06f .asm_3f728 set 1, [hl] ; mon is now using thrash/petal dance - call GenRandomInBattle + call BattleRandom and $1 inc a inc a @@ -7845,19 +7749,19 @@ SwitchAndTeleportEffect: ; 3f739 (f:7739) ld a, [H_WHOSETURN] ; $fff3 and a jr nz, .asm_3f791 - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE dec a jr nz, .asm_3f77e - ld a, [W_CURENEMYLVL] ; $d127 + ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL ld b, a - ld a, [W_PLAYERMONLEVEL] ; $d022 + ld a, [wBattleMonLevel] ; wBattleMonLevel cp b jr nc, .asm_3f76e add b ld c, a inc c .asm_3f751 - call GenRandomInBattle + call BattleRandom cp c jr nc, .asm_3f751 srl b @@ -7866,40 +7770,40 @@ SwitchAndTeleportEffect: ; 3f739 (f:7739) jr nc, .asm_3f76e ld c, $32 call DelayFrames - ld a, [W_PLAYERMOVENUM] ; $cfd2 + ld a, [W_PLAYERMOVENUM] ; wcfd2 cp TELEPORT jp nz, PrintDidntAffectText jp PrintButItFailedText_ .asm_3f76e call ReadPlayerMonCurHPAndStatus xor a - ld [$cc5b], a + ld [wcc5b], a inc a - ld [$d078], a - ld a, [W_PLAYERMOVENUM] ; $cfd2 + ld [wd078], a + ld a, [W_PLAYERMOVENUM] ; wcfd2 jr .asm_3f7e4 .asm_3f77e ld c, $32 call DelayFrames ld hl, IsUnaffectedText - ld a, [W_PLAYERMOVENUM] ; $cfd2 + ld a, [W_PLAYERMOVENUM] ; wcfd2 cp TELEPORT jp nz, PrintText jp PrintButItFailedText_ .asm_3f791 - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE dec a jr nz, .asm_3f7d1 - ld a, [W_PLAYERMONLEVEL] ; $d022 + ld a, [wBattleMonLevel] ; wBattleMonLevel ld b, a - ld a, [W_CURENEMYLVL] ; $d127 + ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL cp b jr nc, .asm_3f7c1 add b ld c, a inc c .asm_3f7a4 - call GenRandomInBattle + call BattleRandom cp c jr nc, .asm_3f7a4 srl b @@ -7908,23 +7812,23 @@ SwitchAndTeleportEffect: ; 3f739 (f:7739) jr nc, .asm_3f7c1 ld c, $32 call DelayFrames - ld a, [W_ENEMYMOVENUM] ; $cfcc + ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM cp TELEPORT jp nz, PrintDidntAffectText jp PrintButItFailedText_ .asm_3f7c1 call ReadPlayerMonCurHPAndStatus xor a - ld [$cc5b], a + ld [wcc5b], a inc a - ld [$d078], a - ld a, [W_ENEMYMOVENUM] ; $cfcc + ld [wd078], a + ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM jr .asm_3f7e4 .asm_3f7d1 ld c, $32 call DelayFrames ld hl, IsUnaffectedText - ld a, [W_ENEMYMOVENUM] ; $cfcc + ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM cp TELEPORT jp nz, PrintText jp Func_3fb4e @@ -7957,24 +7861,24 @@ WasBlownAwayText: ; 3f80c (f:780c) db "@" TwoToFiveAttacksEffect: ; 3f811 (f:7811) - ld hl, W_PLAYERBATTSTATUS1 ; $d062 - ld de, $d06a - ld bc, W_NUMHITS ; $d074 + ld hl, W_PLAYERBATTSTATUS1 ; W_PLAYERBATTSTATUS1 + ld de, wd06a + ld bc, W_NUMHITS ; wd074 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3f828 - ld hl, W_ENEMYBATTSTATUS1 ; $d067 - ld de, $d06f - ld bc, $cd05 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 + ld de, wd06f + ld bc, wcd05 .asm_3f828 bit 2, [hl] ; is mon attacking multiple times? ret nz set 2, [hl] ; mon is now attacking multiple times - ld hl, W_PLAYERMOVEEFFECT ; $cfd3 + ld hl, W_PLAYERMOVEEFFECT ; wcfd3 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3f838 - ld hl, W_ENEMYMOVEEFFECT ; $cfcd + ld hl, W_ENEMYMOVEEFFECT ; W_ENEMYMOVEEFFECT .asm_3f838 ld a, [hl] cp TWINEEDLE_EFFECT @@ -7982,11 +7886,11 @@ TwoToFiveAttacksEffect: ; 3f811 (f:7811) cp ATTACK_TWICE_EFFECT ld a, $2 jr z, .asm_3f853 - call GenRandomInBattle + call BattleRandom and $3 cp $2 jr c, .asm_3f851 - call GenRandomInBattle + call BattleRandom and $3 .asm_3f851 inc a @@ -8003,13 +7907,13 @@ TwoToFiveAttacksEffect: ; 3f811 (f:7811) FlichSideEffect: ; 3f85b (f:785b) call CheckTargetSubstitute ret nz - ld hl, W_ENEMYBATTSTATUS1 ; $d067 - ld de, W_PLAYERMOVEEFFECT ; $cfd3 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 + ld de, W_PLAYERMOVEEFFECT ; wcfd3 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3f870 - ld hl, W_PLAYERBATTSTATUS1 ; $d062 - ld de, W_ENEMYMOVEEFFECT ; $cfcd + ld hl, W_PLAYERBATTSTATUS1 ; W_PLAYERBATTSTATUS1 + ld de, W_ENEMYMOVEEFFECT ; W_ENEMYMOVEEFFECT .asm_3f870 ld a, [de] cp FLINCH_SIDE_EFFECT1 @@ -8017,7 +7921,7 @@ FlichSideEffect: ; 3f85b (f:785b) jr z, .asm_3f879 ld b, $4d ; ~30% chance of flinch .asm_3f879 - call GenRandomInBattle + call BattleRandom cp b ret nc set 3, [hl] ; set mon's status to flinching @@ -8030,14 +7934,14 @@ OneHitKOEffect: ; 3f884 (f:7884) jp Bankswitch ChargeEffect: ; 3f88c (f:788c) - ld hl, W_PLAYERBATTSTATUS1 ; $d062 - ld de, W_PLAYERMOVEEFFECT ; $cfd3 + ld hl, W_PLAYERBATTSTATUS1 ; W_PLAYERBATTSTATUS1 + ld de, W_PLAYERMOVEEFFECT ; wcfd3 ld a, [H_WHOSETURN] ; $fff3 and a ld b, $ae jr z, .asm_3f8a1 - ld hl, W_ENEMYBATTSTATUS1 ; $d067 - ld de, W_ENEMYMOVEEFFECT ; $cfcd + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 + ld de, W_ENEMYMOVEEFFECT ; W_ENEMYMOVEEFFECT ld b, $af .asm_3f8a1 set 4, [hl] @@ -8055,18 +7959,18 @@ ChargeEffect: ; 3f88c (f:788c) ld b, $c0 .asm_3f8b6 xor a - ld [$cc5b], a + ld [wcc5b], a ld a, b call Func_3fbb9 ld a, [de] - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ; wWhichTrade ld hl, ChargeMoveEffectText ; $78c8 jp PrintText ChargeMoveEffectText: ; 3f8c8 (f:78c8) TX_FAR _ChargeMoveEffectText db $08 ; asm - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade cp RAZOR_WIND ld hl, MadeWhirlwindText ; $78f9 jr z, .asm_3f8f8 @@ -8112,23 +8016,23 @@ DugAHoleText: ; 3f912 (f:7912) db "@" TrappingEffect: ; 3f917 (f:7917) - ld hl, W_PLAYERBATTSTATUS1 ; $d062 - ld de, $d06a + ld hl, W_PLAYERBATTSTATUS1 ; W_PLAYERBATTSTATUS1 + ld de, wd06a ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3f928 - ld hl, W_ENEMYBATTSTATUS1 ; $d067 - ld de, $d06f + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 + ld de, wd06f .asm_3f928 bit 5, [hl] ret nz call Func_3f9cf set 5, [hl] - call GenRandomInBattle + call BattleRandom and $3 cp $2 jr c, .asm_3f93e - call GenRandomInBattle + call BattleRandom and $3 .asm_3f93e inc a @@ -8151,7 +8055,7 @@ RecoilEffect: ; 3f951 (f:7951) jp Bankswitch ConfusionSideEffect: ; 3f959 (f:7959) - call GenRandomInBattle + call BattleRandom cp $19 ret nc jr Func_3f96f @@ -8160,26 +8064,26 @@ ConfusionEffect: ; 3f961 (f:7961) call CheckTargetSubstitute jr nz, Func_3f9a6 call MoveHitTest - ld a, [W_MOVEMISSED] ; $d05f + ld a, [W_MOVEMISSED] ; W_MOVEMISSED and a jr nz, Func_3f9a6 Func_3f96f: ; 3f96f (f:796f) ld a, [H_WHOSETURN] ; $fff3 and a - ld hl, W_ENEMYBATTSTATUS1 ; $d067 - ld bc, $d070 - ld a, [W_PLAYERMOVEEFFECT] ; $cfd3 + ld hl, W_ENEMYBATTSTATUS1 ; W_ENEMYBATTSTATUS1 + ld bc, wd070 + ld a, [W_PLAYERMOVEEFFECT] ; wcfd3 jr z, .asm_3f986 - ld hl, W_PLAYERBATTSTATUS1 ; $d062 - ld bc, $d06b - ld a, [W_ENEMYMOVEEFFECT] ; $cfcd + ld hl, W_PLAYERBATTSTATUS1 ; W_PLAYERBATTSTATUS1 + ld bc, wd06b + ld a, [W_ENEMYMOVEEFFECT] ; W_ENEMYMOVEEFFECT .asm_3f986 bit 7, [hl] ; is mon confused? jr nz, Func_3f9a6 set 7, [hl] ; mon is now confused push af - call GenRandomInBattle + call BattleRandom and $3 inc a inc a @@ -8212,22 +8116,22 @@ SubstituteEffect: ; 3f9b9 (f:79b9) jp Bankswitch HyperBeamEffect: ; 3f9c1 (f:79c1) - ld hl, W_PLAYERBATTSTATUS2 ; $d063 + ld hl, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3f9cc - ld hl, W_ENEMYBATTSTATUS2 ; $d068 + ld hl, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2 .asm_3f9cc set 5, [hl] ; mon now needs to recharge ret Func_3f9cf: ; 3f9cf (f:79cf) push hl - ld hl, W_ENEMYBATTSTATUS2 ; $d068 + ld hl, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3f9db - ld hl, W_PLAYERBATTSTATUS2 ; $d063 + ld hl, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2 .asm_3f9db res 5, [hl] ; mon no longer needs to recharge pop hl @@ -8252,20 +8156,20 @@ MimicEffect: ; 3f9ed (f:79ed) jr nz, .asm_3fa74 ld a, [H_WHOSETURN] and a - ld hl, W_PLAYERMONMOVES + ld hl, wBattleMonMoves ld a, [W_PLAYERBATTSTATUS1] jr nz, .asm_3fa13 ld a, [W_ISLINKBATTLE] cp $4 jr nz, .asm_3fa3a - ld hl, W_ENEMYMONMOVES + ld hl, wEnemyMonMoves ld a, [W_ENEMYBATTSTATUS1] .asm_3fa13 bit 6, a jr nz, .asm_3fa74 .asm_3fa17 push hl - call GenRandomInBattle + call BattleRandom and $3 ld c, a ld b, $0 @@ -8277,10 +8181,10 @@ MimicEffect: ; 3f9ed (f:79ed) ld d, a ld a, [H_WHOSETURN] and a - ld hl, W_PLAYERMONMOVES + ld hl, wBattleMonMoves ld a, [wPlayerMoveListIndex] jr z, .asm_3fa5f - ld hl, W_ENEMYMONMOVES + ld hl, wEnemyMonMoves ld a, [wEnemyMoveListIndex] jr .asm_3fa5f .asm_3fa3a @@ -8293,21 +8197,21 @@ MimicEffect: ; 3f9ed (f:79ed) ld [wMoveMenuType], a call MoveSelectionMenu call LoadScreenTilesFromBuffer1 - ld hl, W_ENEMYMONMOVES + ld hl, wEnemyMonMoves ld a, [wCurrentMenuItem] ld c, a ld b, $0 add hl, bc ld d, [hl] pop af - ld hl, W_PLAYERMONMOVES + ld hl, wBattleMonMoves .asm_3fa5f ld c, a ld b, $0 add hl, bc ld a, d ld [hl], a - ld [$d11e], a + ld [wd11e], a call GetMoveName call Func_3fba8 ld hl, MimicLearnedMoveText @@ -8330,23 +8234,23 @@ SplashEffect: ; 3fa84 (f:7a84) DisableEffect: ; 3fa8a (f:7a8a) call MoveHitTest - ld a, [W_MOVEMISSED] ; $d05f + ld a, [W_MOVEMISSED] ; W_MOVEMISSED and a jr nz, .asm_3fb06 - ld de, W_ENEMYDISABLEDMOVE ; $d072 - ld hl, W_ENEMYMONMOVES + ld de, W_ENEMYDISABLEDMOVE ; W_ENEMYDISABLEDMOVE + ld hl, wEnemyMonMoves ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3faa4 - ld de, W_PLAYERDISABLEDMOVE ; $d06d - ld hl, W_PLAYERMONMOVES + ld de, W_PLAYERDISABLEDMOVE ; W_PLAYERDISABLEDMOVE + ld hl, wBattleMonMoves .asm_3faa4 ld a, [de] and a jr nz, .asm_3fb06 .asm_3faa8 push hl - call GenRandomInBattle + call BattleRandom and $3 ld c, a ld b, $0 @@ -8355,18 +8259,18 @@ DisableEffect: ; 3fa8a (f:7a8a) pop hl and a jr z, .asm_3faa8 - ld [$d11e], a + ld [wd11e], a push hl ld a, [H_WHOSETURN] ; $fff3 and a - ld hl, W_PLAYERMONPP ; $d02d + ld hl, wBattleMonPP ; wBattleMonPP jr nz, .asm_3facf - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $4 pop hl jr nz, .asm_3fae1 push hl - ld hl, W_ENEMYMONPP ; $cffe + ld hl, wEnemyMonPP ; wcffe .asm_3facf push hl ld a, [hli] @@ -8384,7 +8288,7 @@ DisableEffect: ; 3fa8a (f:7a8a) and a jr z, .asm_3faa8 .asm_3fae1 - call GenRandomInBattle + call BattleRandom and $7 inc a inc c @@ -8392,13 +8296,13 @@ DisableEffect: ; 3fa8a (f:7a8a) add c ld [de], a call Func_3fb89 - ld hl, $ccee + ld hl, wccee ld a, [H_WHOSETURN] ; $fff3 and a jr nz, .asm_3faf8 inc hl .asm_3faf8 - ld a, [$d11e] + ld a, [wd11e] ld [hl], a call GetMoveName ld hl, MoveWasDisabledText ; $7b09 @@ -8455,7 +8359,7 @@ NoEffectText: ; 3fb49 (f:7b49) db "@" Func_3fb4e: ; 3fb4e (f:7b4e) - ld a, [$ccf4] + ld a, [wccf4] and a ret nz @@ -8489,11 +8393,11 @@ ParalyzedMayNotAttackText: ; 3fb74 (f:7b74) CheckTargetSubstitute: ; 3fb79 (f:7b79) push hl - ld hl, $d068 + ld hl, W_ENEMYBATTSTATUS2 ld a, [$fff3] ;whose turn? and a jr z, .next1 - ld hl, $d063 + ld hl, W_PLAYERBATTSTATUS2 .next1 bit 4, [hl] ;test bit 4 in d063/d068 flags pop hl @@ -8502,45 +8406,44 @@ CheckTargetSubstitute: ; 3fb79 (f:7b79) Func_3fb89: ; 3fb89 (f:7b89) ld a, [H_WHOSETURN] ; $fff3 and a - ld a, [W_PLAYERMOVENUM] ; $cfd2 + ld a, [W_PLAYERMOVENUM] ; wcfd2 jr z, .asm_3fb94 - ld a, [W_ENEMYMOVENUM] ; $cfcc + ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM .asm_3fb94 and a ret z Func_3fb96: ; 3fb96 (f:7b96) - ld [W_ANIMATIONID], a ; $d07c + ld [W_ANIMATIONID], a ; W_ANIMATIONID ld a, [H_WHOSETURN] ; $fff3 and a ld a, $6 jr z, .asm_3fba2 ld a, $3 .asm_3fba2 - ld [$cc5b], a + ld [wcc5b], a jp Func_3fbbc Func_3fba8: ; 3fba8 (f:7ba8) xor a - ld [$cc5b], a + ld [wcc5b], a ld a, [H_WHOSETURN] ; $fff3 and a - ld a, [W_PLAYERMOVENUM] ; $cfd2 + ld a, [W_PLAYERMOVENUM] ; wcfd2 jr z, .asm_3fbb7 - ld a, [W_ENEMYMOVENUM] ; $cfcc + ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM .asm_3fbb7 and a ret z Func_3fbb9: ; 3fbb9 (f:7bb9) - ld [W_ANIMATIONID], a ; $d07c + ld [W_ANIMATIONID], a ; W_ANIMATIONID Func_3fbbc: ; 3fbbc (f:7bbc) push hl push de push bc - ld a, $8 - call Predef ; indirect jump to MoveAnimation (78d5e (1e:4d5e)) + predef MoveAnimation pop bc pop de pop hl diff --git a/engine/battle/d.asm b/engine/battle/d.asm index a6ad21ea..d23c9114 100755 --- a/engine/battle/d.asm +++ b/engine/battle/d.asm @@ -1,25 +1,21 @@ Func_372d6: ; 372d6 (d:72d6) call LoadTextBoxTilePatterns - FuncCoord 3, 4 ; $c3f3 - ld hl, Coord + hlCoord 3, 4 ld b, $7 ld c, $c call TextBoxBorder - FuncCoord 4, 5 ; $c408 - ld hl, Coord - ld de, W_PLAYERNAME ; $d158 + hlCoord 4, 5 + ld de, wPlayerName ; wd158 call PlaceString - FuncCoord 4, 10 ; $c46c - ld hl, Coord - ld de, W_GRASSRATE ; $d887 + hlCoord 4, 10 + ld de, W_GRASSRATE ; W_GRASSRATE call PlaceString - FuncCoord 9, 8 ; $c449 - ld hl, Coord + hlCoord 9, 8 ld a, $69 ld [hli], a ld [hl], $6a xor a - ld [$cfcb], a + ld [wcfcb], a callab SetupPlayerAndEnemyPokeballs ld c, $96 jp DelayFrames diff --git a/engine/battle/e.asm b/engine/battle/e.asm index ada3071e..8b0476ca 100755 --- a/engine/battle/e.asm +++ b/engine/battle/e.asm @@ -1,11 +1,11 @@ Func_39680: ; 39680 (e:5680) ld a, [H_WHOSETURN] ; $fff3 and a - ld a, [$d060] - ld hl, $d026 + ld a, [wd060] + ld hl, wBattleMonAttack + 1 jr z, .asm_39691 - ld a, [$d065] - ld hl, $cff7 + ld a, [wd065] + ld hl, wEnemyMonAttack + 1 .asm_39691 ld c, $4 ld b, a @@ -30,11 +30,11 @@ Func_3969f: ; 3969f (e:569f) Func_396a7: ; 396a7 (e:56a7) ld a, [H_WHOSETURN] ; $fff3 and a - ld a, [$d061] - ld hl, W_PLAYERMONATK + ld a, [wd061] + ld hl, wBattleMonAttack jr z, .asm_396b8 - ld a, [$d066] - ld hl, W_ENEMYMONATTACK + ld a, [wd066] + ld hl, wEnemyMonAttack .asm_396b8 ld c, $4 ld b, a @@ -63,12 +63,11 @@ _ScrollTrainerPicAfterBattle: ; 396d3 (e:56d3) ; Load the enemy trainer's pic and scrolls it into ; the screen from the right. xor a - ld [W_ENEMYMONID], a + ld [wEnemyMonSpecies2], a ld b, $1 call GoPAL_SET callab _LoadTrainerPic - FuncCoord 19, 0 ; $c3b3 - ld hl, Coord + hlCoord 19, 0 ld c, $0 .asm_396e9 inc c @@ -114,7 +113,7 @@ Func_39707: ; 39707 (e:5707) ; unused slots are filled with 0, all used slots may be chosen with equal probability AIEnemyTrainerChooseMoves: ; 39719 (e:5719) ld a, $a - ld hl, $cee9 ; init temporary move selection array. Only the moves with the lowest numbers are chosen in the end + ld hl, wHPBarMaxHP ; init temporary move selection array. Only the moves with the lowest numbers are chosen in the end ld [hli], a ; move 1 ld [hli], a ; move 2 ld [hli], a ; move 3 @@ -123,7 +122,7 @@ AIEnemyTrainerChooseMoves: ; 39719 (e:5719) swap a and $f jr z, .noMoveDisabled - ld hl, $cee9 + ld hl, wHPBarMaxHP dec a ld c, a ld b, $0 @@ -165,8 +164,8 @@ AIEnemyTrainerChooseMoves: ; 39719 (e:5719) push de jp [hl] ; execute modification function .loopFindMinimumEntries ; all entries will be decremented sequentially until one of them is zero - ld hl, $cee9 ; temp move selection array - ld de, W_ENEMYMONMOVES ; enemy moves + ld hl, wHPBarMaxHP ; temp move selection array + ld de, wEnemyMonMoves ; enemy moves ld c, $4 .loopDecrementEntries ld a, [de] @@ -187,8 +186,8 @@ AIEnemyTrainerChooseMoves: ; 39719 (e:5719) inc a cp $5 jr nz, .loopUndoPartialIteration - ld hl, $cee9 ; temp move selection array - ld de, W_ENEMYMONMOVES ; enemy moves + ld hl, wHPBarMaxHP ; temp move selection array + ld de, wEnemyMonMoves ; enemy moves ld c, $4 .filterMinimalEntries ; all minimal entries now have value 1. All other slots will be disabled (move set to 0) ld a, [de] @@ -209,10 +208,10 @@ AIEnemyTrainerChooseMoves: ; 39719 (e:5719) inc de dec c jr nz, .filterMinimalEntries - ld hl, $cee9 ; use created temporary array as move set + ld hl, wHPBarMaxHP ; use created temporary array as move set ret .useOriginalMoveSet - ld hl, W_ENEMYMONMOVES ; use original move set + ld hl, wEnemyMonMoves ; use original move set ret AIMoveChoiceModificationFunctionPointers: ; 397a3 (e:57a3) @@ -223,11 +222,11 @@ AIMoveChoiceModificationFunctionPointers: ; 397a3 (e:57a3) ; discourages moves that cause no damage but only a status ailment if player's mon already has one AIMoveChoiceModification1: ; 397ab (e:57ab) - ld a, [W_PLAYERMONSTATUS] + ld a, [wBattleMonStatus] and a ret z ; return if no status ailment on player's mon - ld hl, $cee8 ; temp move selection array (-1 byte offest) - ld de, W_ENEMYMONMOVES ; enemy moves + ld hl, wBuffer - 1 ; temp move selection array (-1 byte offest) + ld de, wEnemyMonMoves ; enemy moves ld b, $5 .nextMove dec b @@ -266,11 +265,11 @@ StatusAilmentMoveEffects ; 57e2 ; slightly encourage moves with specific effects AIMoveChoiceModification2: ; 397e7 (e:57e7) - ld a, [$ccd5] + ld a, [wccd5] cp $1 ret nz - ld hl, $cee8 ; temp move selection array (-1 byte offest) - ld de, W_ENEMYMONMOVES ; enemy moves + ld hl, wBuffer - 1 ; temp move selection array (-1 byte offest) + ld de, wEnemyMonMoves ; enemy moves ld b, $5 .nextMove dec b @@ -297,8 +296,8 @@ AIMoveChoiceModification2: ; 397e7 (e:57e7) ; encourages moves that are effective against the player's mon AIMoveChoiceModification3: ; 39817 (e:5817) - ld hl, $cee8 ; temp move selection array (-1 byte offest) - ld de, W_ENEMYMONMOVES ; enemy moves + ld hl, wBuffer - 1 ; temp move selection array (-1 byte offest) + ld de, wEnemyMonMoves ; enemy moves ld b, $5 .nextMove dec b @@ -316,7 +315,7 @@ AIMoveChoiceModification3: ; 39817 (e:5817) pop de pop bc pop hl - ld a, [$d11e] + ld a, [wd11e] cp $10 jr z, .nextMove jr c, .notEffectiveMove @@ -328,7 +327,7 @@ AIMoveChoiceModification3: ; 39817 (e:5817) push bc ld a, [W_ENEMYMOVETYPE] ld d, a - ld hl, W_ENEMYMONMOVES ; enemy moves + ld hl, wEnemyMonMoves ; enemy moves ld b, $5 ld c, $0 .loopMoves @@ -374,7 +373,7 @@ ReadMove: ; 39884 (e:5884) ld hl,Moves ld bc,6 call AddNTimes - ld de,$CFCC + ld de,W_ENEMYMOVENUM call CopyData pop bc pop de @@ -579,21 +578,21 @@ TrainerPicAndMoneyPointers: ; 39914 (e:5914) INCLUDE "text/trainer_names.asm" Func_39b87: ; 39b87 (e:5b87) - ld hl, $d0dc - ld de, $d0e1 + ld hl, wd0dc + ld de, wd0e1 ld b, $0 .asm_39b8f ld a, [hli] and a jr z, .asm_39bc1 push hl - ld [$d0b5], a + ld [wd0b5], a ld a, $2c - ld [$d0b7], a + ld [wPredefBank], a ld a, MOVE_NAME ld [W_LISTTYPE], a call GetName - ld hl, $cd6d + ld hl, wcd6d .asm_39ba7 ld a, [hli] cp $50 @@ -603,7 +602,7 @@ Func_39b87: ; 39b87 (e:5b87) jr .asm_39ba7 .asm_39bb0 ld a, b - ld [$cd6c], a + ld [wcd6c], a inc b ld a, $4e ld [de], a @@ -631,71 +630,71 @@ Func_39b87: ; 39b87 (e:5b87) ret Func_39bd5: ; 39bd5 (e:5bd5) - ld a, [$d11b] + ld a, [wd11b] cp $1 jr nz, .asm_39be6 - ld hl, wEnemyPartyCount ; $d89c - ld de, W_ENEMYMON1OT ; $d9ac OT names of other player + ld hl, wEnemyPartyCount ; wEnemyPartyCount + ld de, wEnemyMonOT ; wd9ac OT names of other player ld a, $6 jr .asm_39c18 .asm_39be6 cp $4 jr nz, .calcAttackStat4 - ld hl, W_NUMINPARTY ; $d163 - ld de, W_PARTYMON1OT ; $d273 + ld hl, wPartyCount ; wPartyCount + ld de, wPartyMonOT ; wd273 ld a, $5 jr .asm_39c18 .calcAttackStat4 cp $5 jr nz, .asm_39c02 - ld hl, $cf7b + ld hl, wStringBuffer2 + 11 ld de, MonsterNames ; $421e ld a, $1 jr .asm_39c18 .asm_39c02 cp $2 jr nz, .asm_39c10 - ld hl, wNumBagItems ; $d31d + ld hl, wNumBagItems ; wNumBagItems ld de, ItemNames ; $472b ld a, $4 jr .asm_39c18 .asm_39c10 - ld hl, $cf7b + ld hl, wStringBuffer2 + 11 ld de, ItemNames ; $472b ld a, ITEM_NAME .asm_39c18 ld [W_LISTTYPE], a ld a, l - ld [$cf8b], a + ld [wcf8b], a ld a, h - ld [$cf8c], a + ld [wcf8c], a ld a, e - ld [$cf8d], a + ld [wcf8d], a ld a, d - ld [$cf8e], a + ld [wcf8e], a ld bc, ItemPrices ; $4608 ld a, c - ld [$cf8f], a + ld [wcf8f], a ld a, b - ld [$cf90], a + ld [wcf90], a ret Func_39c37: ; 39c37 (e:5c37) - ld hl, W_PARTYMON1 ; $d164 - ld a, [$cc49] + ld hl, wPartySpecies + ld a, [wcc49] and a jr z, .asm_39c4b dec a jr z, .asm_39c48 - ld hl, $da81 + ld hl, wBoxSpecies jr .asm_39c4b .asm_39c48 - ld hl, $d89d + ld hl, wEnemyPartyMons .asm_39c4b ld d, $0 add hl, de ld a, [hl] - ld [$cf91], a + ld [wcf91], a ret ReadTrainer: ; 39c53 (e:5c53) @@ -705,7 +704,7 @@ ReadTrainer: ; 39c53 (e:5c53) and a ret nz -; set [wEnemyPartyCount] to 0, [$D89D] to FF +; set [wEnemyPartyCount] to 0, [wEnemyPartyMons] to FF ; XXX first is total enemy pokemon? ; XXX second is species of first pokemon? ld hl,wEnemyPartyCount @@ -754,11 +753,11 @@ ReadTrainer: ; 39c53 (e:5c53) ld a,[hli] and a ; have we reached the end of the trainer data? jr z,.FinishUp - ld [$CF91],a ; write species somewhere (XXX why?) + ld [wcf91],a ; write species somewhere (XXX why?) ld a,1 - ld [$CC49],a + ld [wcc49],a push hl - call AddPokemonToParty + call AddPartyMon pop hl jr .LoopTrainerData .SpecialTrainer @@ -771,11 +770,11 @@ ReadTrainer: ; 39c53 (e:5c53) jr z,.AddLoneMove ld [W_CURENEMYLVL],a ld a,[hli] - ld [$CF91],a + ld [wcf91],a ld a,1 - ld [$CC49],a + ld [wcc49],a push hl - call AddPokemonToParty + call AddPartyMon pop hl jr .SpecialTrainer .AddLoneMove @@ -791,8 +790,8 @@ ReadTrainer: ; 39c53 (e:5c53) add hl,bc ld a,[hli] ld d,[hl] - ld hl,W_ENEMYMON1MOVE3 - ld bc,W_ENEMYMON2MOVE3 - W_ENEMYMON1MOVE3 + ld hl,wEnemyMon1Moves + 2 + ld bc,wEnemyMon2 - wEnemyMon1 call AddNTimes ld [hl],d jr .FinishUp @@ -821,13 +820,13 @@ ReadTrainer: ; 39c53 (e:5c53) jr .FinishUp ; nope .GiveTeamMoves ld a,[hl] - ld [$D95E],a + ld [wEnemyMon5Moves + 2],a jr .FinishUp .ChampionRival ; give moves to his team ; pidgeot ld a,SKY_ATTACK - ld [W_ENEMYMON1MOVE3],a + ld [wEnemyMon1Moves + 2],a ; starter ld a,[W_RIVALSTARTER] @@ -840,10 +839,10 @@ ReadTrainer: ; 39c53 (e:5c53) ld b,BLIZZARD ; must be squirtle .GiveStarterMove ld a,b - ld [W_ENEMYMON6MOVE3],a + ld [wEnemyMon6Moves + 2],a .FinishUp ; XXX this needs documenting xor a ; clear D079-D07B - ld de,$D079 + ld de,wd079 ld [de],a inc de ld [de],a @@ -852,11 +851,10 @@ ReadTrainer: ; 39c53 (e:5c53) ld a,[W_CURENEMYLVL] ld b,a .LastLoop - ld hl,$D047 + ld hl,wd047 ld c,2 push bc - ld a,$B - call Predef + predef AddBCDPredef pop bc inc de inc de @@ -898,7 +896,7 @@ TrainerAI: ; 3a52e (e:652e) ld a,[hli] ld h,[hl] ld l,a - call GenRandom + call Random jp [hl] TrainerAIPointers: ; 3a55c (e:655c) @@ -985,7 +983,7 @@ CooltrainerFAI: ; 3a601 (e:6601) BrockAI: ; 3a614 (e:6614) ; if his active monster has a status condition, use a full heal - ld a,[W_ENEMYMONSTATUS] + ld a,[wEnemyMonStatus] and a ret z jp AIUseFullHeal @@ -1092,25 +1090,25 @@ Func_3a69b: ; 3a69b (e:669b) AIUseFullRestore: ; 3a6a0 (e:66a0) call AICureStatus ld a,FULL_RESTORE - ld [$CF05],a + ld [wcf05],a ld de,wHPBarOldHP - ld hl,$CFE7 + ld hl,wEnemyMonHP + 1 ld a,[hld] ld [de],a inc de ld a,[hl] ld [de],a inc de - ld hl,$CFF5 + ld hl,wEnemyMonMaxHP + 1 ld a,[hld] ld [de],a inc de ld [wHPBarMaxHP],a - ld [$CFE7],a + ld [wEnemyMonHP + 1],a ld a,[hl] ld [de],a ld [wHPBarMaxHP+1],a - ld [W_ENEMYMONCURHP],a + ld [wEnemyMonHP],a jr Func_3a718 AIUsePotion: ; 3a6ca (e:66ca) @@ -1133,8 +1131,8 @@ AIUseHyperPotion: ; 3a6d6 (e:66d6) AIRecoverHP: ; 3a6da (e:66da) ; heal b HP and print "trainer used $(a) on pokemon!" - ld [$CF05],a - ld hl,$CFE7 + ld [wcf05],a + ld hl,wEnemyMonHP + 1 ld a,[hl] ld [wHPBarOldHP],a add b @@ -1151,7 +1149,7 @@ AIRecoverHP: ; 3a6da (e:66da) inc hl ld a,[hld] ld b,a - ld de,$CFF5 + ld de,wEnemyMonMaxHP + 1 ld a,[de] dec de ld [wHPBarMaxHP],a @@ -1174,18 +1172,16 @@ AIRecoverHP: ; 3a6da (e:66da) Func_3a718: ; 3a718 (e:6718) call AIPrintItemUse_ - FuncCoord 2, 2 ; $c3ca - ld hl,Coord + hlCoord 2, 2 xor a - ld [$CF94],a - ld a,$48 - call Predef + ld [wListMenuID],a + predef UpdateHPBar2 jp DecrementAICount Func_3a72a: ; 3a72a (e:672a) ld a,[wEnemyPartyCount] ld c,a - ld hl,W_ENEMYMON1HP + ld hl,wEnemyMon1HP ld d,0 ; keep count of unfainted monsters @@ -1215,13 +1211,13 @@ Func_3a74b: ; 3a74b (e:674b) ; prepare to withdraw the active monster: copy hp, number, and status to roster - ld a,[W_ENEMYMONNUMBER] - ld hl,W_ENEMYMON1HP - ld bc,$2C + ld a,[wEnemyMonPartyPos] + ld hl,wEnemyMon1HP + ld bc,wEnemyMon2 - wEnemyMon1 call AddNTimes ld d,h ld e,l - ld hl,W_ENEMYMONCURHP + ld hl,wEnemyMonHP ld bc,4 call CopyData @@ -1229,10 +1225,10 @@ Func_3a74b: ; 3a74b (e:674b) call PrintText ld a,1 - ld [$D11D],a + ld [wd11d],a callab EnemySendOut xor a - ld [$D11D],a + ld [wd11d],a ld a,[W_ISLINKBATTLE] cp 4 @@ -1252,41 +1248,41 @@ AIUseFullHeal: ; 3a786 (e:6786) AICureStatus: ; 3a791 (e:6791) ; cures the status of enemy's active pokemon - ld a,[W_ENEMYMONNUMBER] - ld hl,$D8A8 - ld bc,$2C + ld a,[wEnemyMonPartyPos] + ld hl,wEnemyMon1Status + ld bc,wEnemyMon2 - wEnemyMon1 call AddNTimes xor a ld [hl],a ; clear status in enemy team roster - ld [W_ENEMYMONSTATUS],a ; clear status of active enemy - ld hl,$D069 + ld [wEnemyMonStatus],a ; clear status of active enemy + ld hl,W_ENEMYBATTSTATUS3 res 0,[hl] ret AIUseXAccuracy: ; 0x3a7a8 unused call Func_3a69b - ld hl,$D068 + ld hl,W_ENEMYBATTSTATUS2 set 0,[hl] ld a,X_ACCURACY jp AIPrintItemUse AIUseGuardSpec: ; 3a7b5 (e:67b5) call Func_3a69b - ld hl,$D068 + ld hl,W_ENEMYBATTSTATUS2 set 1,[hl] ld a,GUARD_SPEC_ jp AIPrintItemUse AIUseDireHit: ; 0x3a7c2 unused call Func_3a69b - ld hl,$D068 + ld hl,W_ENEMYBATTSTATUS2 set 2,[hl] ld a,DIRE_HIT jp AIPrintItemUse Func_3a7cf: ; 3a7cf (e:67cf) ld [H_DIVISOR],a - ld hl,$CFF4 + ld hl,wEnemyMonMaxHP ld a,[hli] ld [H_DIVIDEND],a ld a,[hl] @@ -1297,7 +1293,7 @@ Func_3a7cf: ; 3a7cf (e:67cf) ld c,a ld a,[H_QUOTIENT + 2] ld b,a - ld hl,$CFE7 + ld hl,wEnemyMonHP + 1 ld a,[hld] ld e,a ld a,[hl] @@ -1330,11 +1326,11 @@ AIUseXSpecial: ; 3a804 (e:6804) ; fallthrough AIIncreaseStat: ; 3a808 (e:6808) - ld [$CF05],a + ld [wcf05],a push bc call AIPrintItemUse_ pop bc - ld hl,$CFCD + ld hl,W_ENEMYMOVEEFFECT ld a,[hld] push af ld a,[hl] @@ -1352,14 +1348,14 @@ AIIncreaseStat: ; 3a808 (e:6808) jp DecrementAICount AIPrintItemUse: ; 3a82c (e:682c) - ld [$CF05],a + ld [wcf05],a call AIPrintItemUse_ jp DecrementAICount AIPrintItemUse_: ; 3a835 (e:6835) -; print "x used [$CF05] on z!" - ld a,[$CF05] - ld [$D11E],a +; print "x used [wcf05] on z!" + ld a,[wcf05] + ld [wd11e],a call GetItemName ld hl, AIBattleUseItemText jp PrintText @@ -1371,7 +1367,7 @@ AIBattleUseItemText: ; 3a844 (e:6844) DrawAllPokeballs: ; 3a849 (e:6849) call LoadPartyPokeballGfx call SetupOwnPartyPokeballs - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE dec a ret z ; return if wild pokémon jp SetupEnemyPartyPokeballs @@ -1382,36 +1378,36 @@ DrawEnemyPokeballs: ; 0x3a857 LoadPartyPokeballGfx: ; 3a85d (e:685d) ld de, PokeballTileGraphics ; $697e - ld hl, $8310 + ld hl, vSprites + $310 ld bc, (BANK(PokeballTileGraphics) << 8) + $04 jp CopyVideoData SetupOwnPartyPokeballs: ; 3a869 (e:6869) call PlacePlayerHUDTiles - ld hl, W_PARTYMON1DATA - ld de, W_NUMINPARTY ; $d163 + ld hl, wPartyMon1 + ld de, wPartyCount ; wPartyCount call SetupPokeballs ld a, $60 - ld hl, W_BASECOORDX ; $d081 + ld hl, W_BASECOORDX ; wd081 ld [hli], a ld [hl], a ld a, $8 - ld [$cd3e], a + ld [wTrainerEngageDistance], a ld hl, wOAMBuffer jp Func_3a8e1 SetupEnemyPartyPokeballs: ; 3a887 (e:6887) call PlaceEnemyHUDTiles ld hl, wEnemyMons - ld de, wEnemyPartyCount ; $d89c + ld de, wEnemyPartyCount ; wEnemyPartyCount call SetupPokeballs - ld hl, W_BASECOORDX ; $d081 + ld hl, W_BASECOORDX ; wd081 ld a, $48 ld [hli], a ld [hl], $20 ld a, $f8 - ld [$cd3e], a - ld hl, $c318 + ld [wTrainerEngageDistance], a + ld hl, wOAMBuffer + $18 jp Func_3a8e1 SetupPokeballs: ; 0x3a8a6 @@ -1465,22 +1461,22 @@ PickPokeball: ; 3a8c2 (e:68c2) ret Func_3a8e1: ; 3a8e1 (e:68e1) - ld de, $cee9 + ld de, wHPBarMaxHP ld c, $6 .asm_3a8e6 - ld a, [W_BASECOORDY] ; $d082 + ld a, [W_BASECOORDY] ; wd082 ld [hli], a - ld a, [W_BASECOORDX] ; $d081 + ld a, [W_BASECOORDX] ; wd081 ld [hli], a ld a, [de] ld [hli], a xor a ld [hli], a - ld a, [W_BASECOORDX] ; $d081 + ld a, [W_BASECOORDX] ; wd081 ld b, a - ld a, [$cd3e] + ld a, [wTrainerEngageDistance] add b - ld [W_BASECOORDX], a ; $d081 + ld [W_BASECOORDX], a ; wd081 inc de dec c jr nz, .asm_3a8e6 @@ -1488,11 +1484,10 @@ Func_3a8e1: ; 3a8e1 (e:68e1) PlacePlayerHUDTiles: ; 3a902 (e:6902) ld hl, PlayerBattleHUDGraphicsTiles ; $6916 - ld de, $cd3f + ld de, wTrainerFacingDirection ld bc, $3 call CopyData - FuncCoord 18, 10 ; $c47a - ld hl, Coord + hlCoord 18, 10 ld de, rIE ; $ffff jr PlaceHUDTiles @@ -1504,11 +1499,10 @@ PlayerBattleHUDGraphicsTiles: ; 3a916 (e:6916) PlaceEnemyHUDTiles: ; 3a919 (e:6919) ld hl, EnemyBattleHUDGraphicsTiles ; $692d - ld de, $cd3f + ld de, wTrainerFacingDirection ld bc, $3 call CopyData - FuncCoord 1, 2 ; $c3c9 - ld hl, Coord + hlCoord 1, 2 ld de, $1 jr PlaceHUDTiles @@ -1522,7 +1516,7 @@ PlaceHUDTiles: ; 3a930 (e:6930) ld [hl], $73 ld bc, $14 add hl, bc - ld a, [$cd40] + ld a, [wTrainerScreenY] ld [hl], a ld a, $8 .asm_3a93c @@ -1531,33 +1525,33 @@ PlaceHUDTiles: ; 3a930 (e:6930) dec a jr nz, .asm_3a93c add hl, de - ld a, [$cd41] + ld a, [wTrainerScreenX] ld [hl], a ret SetupPlayerAndEnemyPokeballs: ; 3a948 (e:6948) call LoadPartyPokeballGfx - ld hl, W_PARTYMON1_NUM ; $d16b (aliases: W_PARTYMON1DATA) - ld de, W_NUMINPARTY ; $d163 + ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1) + ld de, wPartyCount ; wPartyCount call SetupPokeballs - ld hl, W_BASECOORDX ; $d081 + ld hl, W_BASECOORDX ; wd081 ld a, $50 ld [hli], a ld [hl], $40 ld a, $8 - ld [$cd3e], a + ld [wTrainerEngageDistance], a ld hl, wOAMBuffer call Func_3a8e1 - ld hl, wEnemyMons ; $d8a4 - ld de, wEnemyPartyCount ; $d89c + ld hl, wEnemyMons ; wEnemyMon1Species + ld de, wEnemyPartyCount ; wEnemyPartyCount call SetupPokeballs - ld hl, W_BASECOORDX ; $d081 + ld hl, W_BASECOORDX ; wd081 ld a, $50 ld [hli], a ld [hl], $68 - ld hl, $c318 + ld hl, wOAMBuffer + $18 jp Func_3a8e1 ; four tiles: pokeball, black pokeball (status ailment), crossed out pokeball (faited) and pokeball slot (no mon) PokeballTileGraphics:: ; 3a97e (e:697e) - INCBIN "gfx/pokeball.2bpp"
\ No newline at end of file + INCBIN "gfx/pokeball.2bpp" diff --git a/engine/battle/e_2.asm b/engine/battle/e_2.asm index e6d6eddc..665807fe 100755 --- a/engine/battle/e_2.asm +++ b/engine/battle/e_2.asm @@ -1,13 +1,13 @@ HealEffect_: ; 3b9ec (e:79ec) ld a, [H_WHOSETURN] ; $fff3 and a - ld de, W_PLAYERMONCURHP ; $d015 - ld hl, W_PLAYERMONMAXHP ; $d023 - ld a, [W_PLAYERMOVENUM] ; $cfd2 + ld de, wBattleMonHP ; wd015 + ld hl, wBattleMonMaxHP ; wd023 + ld a, [W_PLAYERMOVENUM] ; wcfd2 jr z, .asm_3ba03 - ld de, W_ENEMYMONCURHP ; $cfe6 - ld hl, W_ENEMYMONMAXHP ; $cff4 - ld a, [W_ENEMYMOVENUM] ; $cfcc + ld de, wEnemyMonHP ; wEnemyMonHP + ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP + ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM .asm_3ba03 ld b, a ld a, [de] @@ -25,11 +25,11 @@ HealEffect_: ; 3b9ec (e:79ec) push af ld c, $32 call DelayFrames - ld hl, W_PLAYERMONSTATUS ; $d018 + ld hl, wBattleMonStatus ; wBattleMonStatus ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3ba25 - ld hl, W_ENEMYMONSTATUS ; $cfe9 + ld hl, wEnemyMonStatus ; wcfe9 .asm_3ba25 ld a, [hl] and a @@ -85,17 +85,14 @@ HealEffect_: ; 3b9ec (e:79ec) call BankswitchEtoF ld a, [H_WHOSETURN] ; $fff3 and a - FuncCoord 10, 9 ; $c45e - ld hl, Coord + hlCoord 10, 9 ld a, $1 jr z, .asm_3ba83 - FuncCoord 2, 2 ; $c3ca - ld hl, Coord + hlCoord 2, 2 xor a .asm_3ba83 - ld [wListMenuID], a ; $cf94 - ld a, $48 - call Predef ; indirect jump to UpdateHPBar (fa1d (3:7a1d)) + ld [wListMenuID], a ; wListMenuID + predef UpdateHPBar2 ld hl, Func_3cd5a ; $4d5a call BankswitchEtoF ld hl, RegainedHealthText ; $7aac @@ -120,36 +117,36 @@ RegainedHealthText: ; 3baac (e:7aac) db "@" TransformEffect_: ; 3bab1 (e:7ab1) - ld hl, W_PLAYERMONID - ld de, $cfe5 - ld bc, W_ENEMYBATTSTATUS3 ; $d069 - ld a, [W_ENEMYBATTSTATUS1] ; $d067 + ld hl, wBattleMonSpecies + ld de, wEnemyMonSpecies + ld bc, W_ENEMYBATTSTATUS3 ; W_ENEMYBATTSTATUS3 + ld a, [W_ENEMYBATTSTATUS1] ; W_ENEMYBATTSTATUS1 ld a, [H_WHOSETURN] ; $fff3 and a jr nz, .asm_3bad1 - ld hl, $cfe5 - ld de, W_PLAYERMONID - ld bc, W_PLAYERBATTSTATUS3 ; $d064 - ld [wPlayerMoveListIndex], a ; $cc2e - ld a, [W_PLAYERBATTSTATUS1] ; $d062 + ld hl, wEnemyMonSpecies + ld de, wBattleMonSpecies + ld bc, W_PLAYERBATTSTATUS3 ; W_PLAYERBATTSTATUS3 + ld [wPlayerMoveListIndex], a ; wPlayerMoveListIndex + ld a, [W_PLAYERBATTSTATUS1] ; W_PLAYERBATTSTATUS1 .asm_3bad1 bit 6, a ; is mon invulnerable to typical attacks? (fly/dig) jp nz, Func_3bb8c push hl push de push bc - ld hl, W_PLAYERBATTSTATUS2 ; $d063 + ld hl, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3bae4 - ld hl, W_ENEMYBATTSTATUS2 ; $d068 + ld hl, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2 .asm_3bae4 bit 4, [hl] push af ld hl, Func_79747 ld b, BANK(Func_79747) call nz, Bankswitch - ld a, [W_OPTIONS] ; $d355 + ld a, [W_OPTIONS] ; W_OPTIONS add a ld hl, Func_3fba8 ; $7ba8 ld b, BANK(Func_3fba8) @@ -185,10 +182,10 @@ TransformEffect_: ; 3bab1 (e:7ab1) and a jr z, .asm_3bb32 ld a, [de] - ld [$cceb], a + ld [wcceb], a inc de ld a, [de] - ld [$ccec], a + ld [wccec], a dec de .asm_3bb32 ld a, [hli] @@ -227,13 +224,13 @@ TransformEffect_: ; 3bab1 (e:7ab1) .asm_3bb5d pop hl ld a, [hl] - ld [$d11e], a + ld [wd11e], a call GetMonName - ld hl, $cd26 - ld de, $cd12 + ld hl, wcd26 + ld de, wcd12 call Func_3bb7d - ld hl, wEnemyMonStatMods ; $cd2e - ld de, wPlayerMonStatMods ; $cd1a + ld hl, wEnemyMonStatMods ; wcd2e + ld de, wPlayerMonStatMods ; wcd1a call Func_3bb7d ld hl, TransformedText ; $7b92 jp PrintText @@ -259,13 +256,13 @@ TransformedText: ; 3bb92 (e:7b92) db "@" ReflectLightScreenEffect_: ; 3bb97 (e:7b97) - ld hl, W_PLAYERBATTSTATUS3 ; $d064 - ld de, W_PLAYERMOVEEFFECT ; $cfd3 + ld hl, W_PLAYERBATTSTATUS3 ; W_PLAYERBATTSTATUS3 + ld de, W_PLAYERMOVEEFFECT ; wcfd3 ld a, [H_WHOSETURN] ; $fff3 and a jr z, .asm_3bba8 - ld hl, W_ENEMYBATTSTATUS3 ; $d069 - ld de, W_ENEMYMOVEEFFECT ; $cfcd + ld hl, W_ENEMYBATTSTATUS3 ; W_ENEMYBATTSTATUS3 + ld de, W_ENEMYMOVEEFFECT ; W_ENEMYMOVEEFFECT .asm_3bba8 ld a, [de] cp LIGHT_SCREEN_EFFECT diff --git a/engine/battle/safari_zone.asm b/engine/battle/safari_zone.asm index 426e391e..99e1492d 100755 --- a/engine/battle/safari_zone.asm +++ b/engine/battle/safari_zone.asm @@ -1,5 +1,5 @@ PrintSafariZoneBattleText: ; 4277 (1:4277) - ld hl, $cce9 + ld hl, wcce9 ld a, [hl] and a jr z, .asm_4284 @@ -15,11 +15,11 @@ PrintSafariZoneBattleText: ; 4277 (1:4277) ld hl, SafariZoneAngryText jr nz, .asm_429f push hl - ld a, [$cfe5] - ld [$d0b5], a + ld a, [wEnemyMonSpecies] + ld [wd0b5], a call GetMonHeader ld a, [W_MONHCATCHRATE] - ld [$d007], a + ld [wd007], a pop hl .asm_429f push hl diff --git a/engine/cable_club.asm b/engine/cable_club.asm index 3b1cbedd..fc049ceb 100755 --- a/engine/cable_club.asm +++ b/engine/cable_club.asm @@ -6,29 +6,27 @@ Func_5317: ; 5317 (1:5317) call LoadFontTilePatterns call LoadHpBarAndStatusTilePatterns call LoadTrainerInfoTextBoxTiles - FuncCoord 3, 8 ; $c443 - ld hl, Coord + hlCoord 3, 8 ld b, $2 ld c, $c call Func_5ab3 - FuncCoord 4, 10 ; $c46c - ld hl, Coord + hlCoord 4, 10 ld de, PleaseWaitString ; $550f call PlaceString - ld hl, W_NUMHITS ; $d074 + ld hl, W_NUMHITS ; wd074 xor a ld [hli], a ld [hl], $50 Func_5345: ; 5345 - ld hl, $d152 + ld hl, wd152 ld a, $fd ld b, $6 .asm_534c ld [hli], a dec b jr nz, .asm_534c - ld hl, $d141 + ld hl, wd141 ld a, $fd ld b, $7 .asm_5357 @@ -37,7 +35,7 @@ Func_5345: ; 5345 jr nz, .asm_5357 ld b, $a .asm_535d - call GenRandom + call Random cp $fd jr nc, .asm_535d ld [hli], a @@ -54,7 +52,7 @@ Func_5345: ; 5345 ld [hli], a dec b jr nz, .asm_5373 - ld hl, W_GRASSRATE ; $d887 + ld hl, W_GRASSRATE ; W_GRASSRATE ld bc, $1a9 .asm_537d xor a @@ -63,8 +61,8 @@ Func_5345: ; 5345 ld a, b or c jr nz, .asm_537d - ld hl, W_PARTYMONEND ; $d16a - ld de, $c512 + ld hl, wPartyMons - 1 + ld de, wTileMapBackup + 10 ld bc, $0 .asm_538d inc c @@ -114,20 +112,20 @@ Func_5345: ; 5345 call Delay3 ld a, $8 ld [rIE], a ; $ffff - ld hl, $d141 + ld hl, wd141 ld de, wTileMapBackup2 ld bc, $11 call Func_216f ld a, $fe ld [de], a - ld hl, $d152 - ld de, $d893 + ld hl, wd152 + ld de, wd893 ld bc, $1a8 call Func_216f ld a, $fe ld [de], a ld hl, wTileMapBackup - ld de, $c5d0 + ld de, wTileMapBackup + 200 ld bc, $c8 call Func_216f ld a, $d @@ -147,7 +145,7 @@ Func_5345: ; 5345 cp $fe jr z, .asm_5415 dec hl - ld de, $d148 + ld de, wd148 ld c, $a .asm_5427 ld a, [hli] @@ -158,7 +156,7 @@ Func_5345: ; 5345 dec c jr nz, .asm_5427 .asm_5431 - ld hl, $d896 + ld hl, wd896 .asm_5434 ld a, [hli] and a @@ -168,7 +166,7 @@ Func_5345: ; 5345 cp $fe jr z, .asm_5434 dec hl - ld de, W_GRASSRATE ; $d887 + ld de, W_GRASSRATE ; W_GRASSRATE ld c, $b .asm_5446 ld a, [hli] @@ -178,7 +176,7 @@ Func_5345: ; 5345 inc de dec c jr nz, .asm_5446 - ld de, wEnemyPartyCount ; $d89c + ld de, wEnemyPartyCount ; wEnemyPartyCount ld bc, $194 .asm_5456 ld a, [hli] @@ -191,7 +189,7 @@ Func_5345: ; 5345 or c jr nz, .asm_5456 ld de, wTileMapBackup - ld hl, W_PARTYMON1_NUM ; $d16b (aliases: W_PARTYMON1DATA) + ld hl, wPartyMons ld c, $2 .asm_546a ld a, [de] @@ -206,7 +204,7 @@ Func_5345: ; 5345 jr z, .asm_5489 push hl push bc - ld b, $0 + ld b, 0 dec a ld c, a add hl, bc @@ -216,11 +214,11 @@ Func_5345: ; 5345 pop hl jr .asm_546a .asm_5489 - ld hl, W_PARTYMON6DATA + W_PARTYMON1_MOVE4PP - W_PARTYMON1DATA ; $d267 + ld hl, wPartyMons + $fc ; wd267 dec c jr nz, .asm_546a - ld de, $c5d0 - ld hl, W_WATERRATE ; $d8a4 + ld de, wTileMapBackup + 200 + ld hl, wEnemyMons ld c, $2 .asm_5497 ld a, [de] @@ -245,38 +243,36 @@ Func_5345: ; 5345 pop hl jr .asm_5497 .asm_54b6 - ld hl, $d9a0 + ld hl, wEnemyMons + $fc dec c jr nz, .asm_5497 ld a, $ac - ld [$cf8d], a + ld [wcf8d], a ld a, $d9 - ld [$cf8e], a + ld [wcf8e], a xor a - ld [$cc38], a + ld [wcc38], a ld a, $ff call PlaySound ld a, [$ffaa] cp $2 ld c, $42 call z, DelayFrames - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $3 ld a, $32 - ld [W_ISLINKBATTLE], a ; $d12b + ld [W_ISLINKBATTLE], a ; W_ISLINKBATTLE jr nz, .asm_5506 ld a, $4 - ld [W_ISLINKBATTLE], a ; $d12b + ld [W_ISLINKBATTLE], a ; W_ISLINKBATTLE ld a, SONY1 + $c8 - ld [W_CUROPPONENT], a ; $d059 + ld [W_CUROPPONENT], a ; wd059 call ClearScreen call Delay3 - ld hl, W_OPTIONS ; $d355 + ld hl, W_OPTIONS ; W_OPTIONS res 7, [hl] - ld a, $2c - call Predef ; indirect jump to InitOpponent (3ef18 (f:6f18)) - ld a, $7 - call Predef ; indirect jump to HealParty (f6a5 (3:76a5)) + predef InitOpponent + predef HealParty jp Func_577d .asm_5506 ld c, BANK(Music_GameCorner) @@ -290,7 +286,7 @@ PleaseWaitString: ; 550f (1:550f) Func_551c: ld hl, PointerTable_5a5b ; $5a5b ld b, $0 - ld a, [$cc38] + ld a, [wcc38] cp $ff jp z, LoadTitlescreenGraphics add a @@ -307,31 +303,31 @@ TradeCenter_SelectMon: call Func_57f2 call Func_57a2 xor a - ld hl, $cc3d + ld hl, wcc3d ld [hli], a ld [hli], a ld [hli], a ld [hl], a - ld [$cc37], a - ld [$cc26], a - ld [$cc2a], a - ld [$cc34], a + ld [wcc37], a + ld [wCurrentMenuItem], a + ld [wLastMenuItem], a + ld [wMenuJoypadPollCount], a inc a - ld [$cc42], a + ld [wcc42], a jp .asm_55dc .asm_5557 xor a - ld [$cc37], a + ld [wcc37], a inc a - ld [$cc49], a + ld [wcc49], a ld a, $a1 - ld [$cc29], a - ld a, [$d89c] - ld [$cc28], a + ld [wMenuWatchedKeys], a + ld a, [wEnemyPartyCount] + ld [wMaxMenuItem], a ld a, $9 - ld [$cc24], a + ld [wTopMenuItemY], a ld a, $1 - ld [$cc25], a + ld [wTopMenuItemX], a .asm_5574 ld hl, $fff6 set 1, [hl] @@ -342,17 +338,17 @@ TradeCenter_SelectMon: jp z, .asm_565b bit 0, a jr z, .asm_55b0 ; 0x5587 $27 - ld a, [$cc28] + ld a, [wMaxMenuItem] ld c, a - ld a, [$cc26] + ld a, [wCurrentMenuItem] cp c jr c, .asm_559a ; 0x5591 $7 - ld a, [$cc28] + ld a, [wMaxMenuItem] dec a - ld [$cc26], a + ld [wCurrentMenuItem], a .asm_559a ld a, $1 - ld [$d11b], a + ld [wd11b], a callab Func_39bd5 ld hl, wEnemyMons call Func_57d6 @@ -361,20 +357,20 @@ TradeCenter_SelectMon: bit 5, a jr z, .asm_55d4 ; 0x55b2 $20 xor a - ld [$cc49], a - ld a, [$cc30] + ld [wcc49], a + ld a, [wMenuCursorLocation] ld l, a - ld a, [$cc31] + ld a, [wMenuCursorLocation + 1] ld h, a - ld a, [$cc27] + ld a, [wTileBehindCursor] ld [hl], a - ld a, [$cc26] + ld a, [wCurrentMenuItem] ld b, a - ld a, [$d163] + ld a, [wPartyCount] dec a cp b jr nc, .asm_55dc ; 0x55cd $d - ld [$cc26], a + ld [wCurrentMenuItem], a jr .asm_55dc ; 0x55d2 $8 .asm_55d4 bit 7, a @@ -382,17 +378,17 @@ TradeCenter_SelectMon: jp .asm_572f .asm_55dc xor a - ld [$cc49], a - ld [$cc37], a + ld [wcc49], a + ld [wcc37], a ld a, $91 - ld [$cc29], a - ld a, [$d163] - ld [$cc28], a + ld [wMenuWatchedKeys], a + ld a, [wPartyCount] + ld [wMaxMenuItem], a ld a, $1 - ld [$cc24], a + ld [wTopMenuItemY], a ld a, $1 - ld [$cc25], a - ld hl, $c3b5 + ld [wTopMenuItemX], a + ld hl, wTileMap + $15 ld bc, $0601 call ClearScreenArea .asm_5601 @@ -409,7 +405,7 @@ TradeCenter_SelectMon: jr z, .asm_562e ; 0x5616 $16 jp .asm_5665 ld a, $4 - ld [$d11b], a + ld [wd11b], a callab Func_39bd5 call Func_57d6 jp .asm_565b @@ -417,20 +413,20 @@ TradeCenter_SelectMon: bit 4, a jr z, .asm_5654 ; 0x5630 $22 ld a, $1 - ld [$cc49], a - ld a, [$cc30] + ld [wcc49], a + ld a, [wMenuCursorLocation] ld l, a - ld a, [$cc31] + ld a, [wMenuCursorLocation + 1] ld h, a - ld a, [$cc27] + ld a, [wTileBehindCursor] ld [hl], a - ld a, [$cc26] + ld a, [wCurrentMenuItem] ld b, a - ld a, [$d89c] + ld a, [wEnemyPartyCount] dec a cp b jr nc, .asm_5651 ; 0x564c $3 - ld [$cc26], a + ld [wCurrentMenuItem], a .asm_5651 jp .asm_5557 .asm_5654 @@ -438,43 +434,43 @@ TradeCenter_SelectMon: jr z, .asm_565b ; 0x5656 $3 jp .asm_572f .asm_565b - ld a, [$cc49] + ld a, [wcc49] and a jp z, .asm_5601 jp .asm_5574 .asm_5665 call SaveScreenTilesToBuffer1 call PlaceUnfilledArrowMenuCursor - ld a, [$cc28] + ld a, [wMaxMenuItem] ld c, a - ld a, [$cc26] + ld a, [wCurrentMenuItem] cp c jr c, .asm_5679 ; 0x5673 $4 - ld a, [$cc28] + ld a, [wMaxMenuItem] dec a .asm_5679 push af - ld hl, $c4b8 + ld hl, wTileMap + $118 ld b, $2 ld c, $12 call Func_5ab3 - ld hl, $c4e2 + ld hl, wTileMap + $142 ld de, .statsTrade call PlaceString xor a - ld [$cc26], a - ld [$cc2a], a - ld [$cc34], a - ld [$cc28], a + ld [wCurrentMenuItem], a + ld [wLastMenuItem], a + ld [wMenuJoypadPollCount], a + ld [wMaxMenuItem], a ld a, $10 - ld [$cc24], a + ld [wTopMenuItemY], a .asm_569f ld a, $7f - ld [$c4eb], a + ld [wTileMap + $14b], a ld a, $13 - ld [$cc29], a + ld [wMenuWatchedKeys], a ld a, $1 - ld [$cc25], a + ld [wTopMenuItemX], a call HandleMenuInput bit 4, a jr nz, .asm_56c3 ; 0x56b3 $e @@ -482,16 +478,16 @@ TradeCenter_SelectMon: jr z, .asm_56df ; 0x56b7 $26 .asm_56b9 pop af - ld [$cc26], a + ld [wCurrentMenuItem], a call LoadScreenTilesFromBuffer1 jp .asm_55dc .asm_56c3 ld a, $7f - ld [$c4e1], a + ld [wTileMap + $141], a ld a, $23 - ld [$cc29], a + ld [wMenuWatchedKeys], a ld a, $b - ld [$cc25], a + ld [wTopMenuItemX], a call HandleMenuInput bit 5, a jr nz, .asm_569f ; 0x56d7 $c6 @@ -500,9 +496,9 @@ TradeCenter_SelectMon: jr .asm_56f9 ; 0x56dd $1a .asm_56df pop af - ld [$cc26], a + ld [wCurrentMenuItem], a ld a, $4 - ld [$d11b], a + ld [wd11b], a callab Func_39bd5 call Func_57d6 call LoadScreenTilesFromBuffer1 @@ -510,37 +506,37 @@ TradeCenter_SelectMon: .asm_56f9 call PlaceUnfilledArrowMenuCursor pop af - ld [$cc26], a - ld [$cd3d], a - ld [$cc42], a + ld [wCurrentMenuItem], a + ld [wWhichTrade], a + ld [wcc42], a call Func_226e - ld a, [$cc3d] + ld a, [wcc3d] cp $f jp z, Func_551c - ld [$cd3e], a + ld [wTrainerEngageDistance], a call Func_57c7 ld a, $1 - ld [$cc38], a + ld [wcc38], a jp Func_551c .statsTrade db "STATS TRADE@" .asm_572f - ld a, [$cc26] + ld a, [wCurrentMenuItem] ld b, a - ld a, [$cc28] + ld a, [wMaxMenuItem] cp b jp nz, .asm_565b - ld a, [$cc30] + ld a, [wMenuCursorLocation] ld l, a - ld a, [$cc31] + ld a, [wMenuCursorLocation + 1] ld h, a ld a, $7f ld [hl], a .asm_5745 ld a, $ed - ld [$c4e1], a + ld [wTileMap + $141], a .asm_574a - call GetJoypadStateLowSensitivity + call JoypadLowSensitivity ld a, [$ffb5] and a jr z, .asm_574a ; 0x5750 $f8 @@ -549,32 +545,32 @@ TradeCenter_SelectMon: bit 6, a jr z, .asm_574a ; 0x5758 $f0 ld a, $7f - ld [$c4e1], a - ld a, [$d163] + ld [wTileMap + $141], a + ld a, [wPartyCount] dec a - ld [$cc26], a + ld [wCurrentMenuItem], a jp .asm_55dc .asm_5769 ld a, $ec - ld [$c4e1], a + ld [wTileMap + $141], a ld a, $f - ld [$cc42], a + ld [wcc42], a call Func_226e - ld a, [$cc3d] + ld a, [wcc3d] cp $f jr nz, .asm_5745 ; 0x577b $c8 Func_577d: ; 577d (1:577d) call GBPalWhiteOutWithDelay3 - ld hl, $cfc4 + ld hl, wcfc4 ld a, [hl] push af push hl res 0, [hl] xor a - ld [$d72d], a + ld [wd72d], a dec a - ld [$d42f], a + ld [wd42f], a call LoadMapData callba Func_c335 pop hl @@ -584,15 +580,15 @@ Func_577d: ; 577d (1:577d) ret Func_57a2: - ld hl, $c4d7 + ld hl, wTileMap + $137 ld a, $7e ld bc, $0031 call FillMemory - ld hl, $c4cc + ld hl, wTileMap + $12c ld b, $1 ld c, $9 call Func_5ab3 - ld hl, $c4e2 + ld hl, wTileMap + $142 ld de, CancelTextString jp PlaceString @@ -600,20 +596,18 @@ CancelTextString: db "CANCEL@" Func_57c7: - ld a, [$cc3d] - ld hl, $c455 + ld a, [wcc3d] + ld hl, wTileMap + $b5 ld bc, $0014 call AddNTimes ld [hl], $ec ret Func_57d6: - ld a, [$cc26] + ld a, [wCurrentMenuItem] ld [wWhichPokemon], a - ld a, $36 - call Predef - ld a, $37 - call Predef + predef StatusScreen + predef StatusScreen2 call GBPalNormal call LoadTrainerInfoTextBoxTiles call Func_57f2 @@ -624,21 +618,21 @@ Func_57f2: ld b, $6 ld c, $12 call Func_5ab3 - ld hl, $c440 + ld hl, wTileMap + $a0 ld b, $6 ld c, $12 call Func_5ab3 - ld hl, $c3a5 - ld de, W_PLAYERNAME + ld hl, wTileMap + $5 + ld de, wPlayerName call PlaceString - ld hl, $c445 - ld de, $d887 + ld hl, wTileMap + $a5 + ld de, W_GRASSRATE call PlaceString - ld hl, $c3b6 - ld de, $d164 + ld hl, wTileMap + $16 + ld de, wPartySpecies call Func_5827 - ld hl, $c456 - ld de, $d89d + ld hl, wTileMap + $b6 + ld de, wEnemyPartyMons Func_5827: ld c, $0 @@ -646,7 +640,7 @@ Func_5827: ld a, [de] cp $ff ret z - ld [$d11e], a + ld [wd11e], a push bc push hl push de @@ -669,170 +663,168 @@ TradeCenter_Trade: ld c, $64 call DelayFrames xor a - ld [$cc43], a - ld [$cc3e], a - ld [$cc37], a - ld [$cc34], a - ld hl, $c490 + ld [wcc43], a + ld [wcc3e], a + ld [wcc37], a + ld [wMenuJoypadPollCount], a + ld hl, wTileMap + $f0 ld b, $4 ld c, $12 call Func_5ab3 - ld a, [$cd3d] - ld hl, $d164 + ld a, [wWhichTrade] + ld hl, wPartySpecies ld c, a ld b, $0 add hl, bc ld a, [hl] - ld [$d11e], a + ld [wd11e], a call GetMonName - ld hl, $cd6d - ld de, $cd3f + ld hl, wcd6d + ld de, wTrainerFacingDirection ld bc, $000b call CopyData - ld a, [$cd3e] - ld hl, $d89d + ld a, [wTrainerEngageDistance] + ld hl, wEnemyPartyMons ld c, a ld b, $0 add hl, bc ld a, [hl] - ld [$d11e], a + ld [wd11e], a call GetMonName ld hl, WillBeTradedText - ld bc, $c4b9 + ld bc, wTileMap + $119 call TextCommandProcessor call SaveScreenTilesToBuffer1 - ld hl, $c436 + ld hl, wTileMap + $96 ld bc, $080b ld a, $5 - ld [$d12c], a + ld [wd12c], a ld a, $14 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID call LoadScreenTilesFromBuffer1 - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr z, .asm_58d9 ; 0x58b9 $1e ld a, $1 - ld [$cc42], a - ld hl, $c490 + ld [wcc42], a + ld hl, wTileMap + $f0 ld b, $4 ld c, $12 call Func_5ab3 - ld hl, $c4b9 + ld hl, wTileMap + $119 ld de, TradeCanceled call PlaceString call Func_226e jp Func_5a18 .asm_58d9 ld a, $2 - ld [$cc42], a + ld [wcc42], a call Func_226e - ld a, [$cc3d] + ld a, [wcc3d] dec a jr nz, .asm_58fd ; 0x58e5 $16 - ld hl, $c490 + ld hl, wTileMap + $f0 ld b, $4 ld c, $12 call Func_5ab3 - ld hl, $c4b9 + ld hl, wTileMap + $119 ld de, TradeCanceled call PlaceString jp Func_5a18 .asm_58fd - ld a, [$cd3d] - ld hl, W_PARTYMON1OT ; OT names of player + ld a, [wWhichTrade] + ld hl, wPartyMonOT ; OT names of player call SkipFixedLengthTextEntries - ld de, $cd41 + ld de, wTrainerScreenX ld bc, $000b call CopyData - ld hl, $d16b - ld a, [$cd3d] + ld hl, wPartyMon1Species + ld a, [wWhichTrade] ld bc, $002c call AddNTimes ld bc, $000c add hl, bc ld a, [hli] - ld [$cd4c], a + ld [wcd4c], a ld a, [hl] - ld [$cd4d], a - ld a, [$cd3e] - ld hl, W_ENEMYMON1OT ; OT names of other player + ld [wcd4d], a + ld a, [wTrainerEngageDistance] + ld hl, wEnemyMonOT ; OT names of other player call SkipFixedLengthTextEntries - ld de, $cd4e + ld de, wcd4e ld bc, $000b call CopyData ld hl, wEnemyMons - ld a, [$cd3e] + ld a, [wTrainerEngageDistance] ld bc, $002c call AddNTimes ld bc, $000c add hl, bc ld a, [hli] - ld [$cd59], a + ld [wcd59], a ld a, [hl] - ld [$cd5a], a - ld a, [$cd3d] + ld [wcd5a], a + ld a, [wWhichTrade] ld [wWhichPokemon], a - ld hl, $d164 + ld hl, wPartySpecies ld b, $0 ld c, a add hl, bc ld a, [hl] - ld [$cd3d], a + ld [wWhichTrade], a xor a - ld [$cf95], a + ld [wcf95], a call RemovePokemon - ld a, [$cd3e] + ld a, [wTrainerEngageDistance] ld c, a ld [wWhichPokemon], a - ld hl, $d89d + ld hl, wEnemyPartyMons ld d, $0 ld e, a add hl, de ld a, [hl] - ld [$cf91], a + ld [wcf91], a ld hl, wEnemyMons ld a, c ld bc, $002c call AddNTimes - ld de, $cf98 + ld de, wcf98 ld bc, $002c call CopyData call AddEnemyMonToPlayerParty - ld a, [$d163] + ld a, [wPartyCount] dec a ld [wWhichPokemon], a ld a, $1 - ld [$ccd4], a - ld a, [$cd3e] - ld hl, $d89d + ld [wccd4], a + ld a, [wTrainerEngageDistance] + ld hl, wEnemyPartyMons ld b, $0 ld c, a add hl, bc ld a, [hl] - ld [$cd3e], a + ld [wTrainerEngageDistance], a ld a, $a ld [wMusicHeaderPointer], a ld a, $2 - ld [$c0f0], a + ld [wc0f0], a ld a, MUSIC_SAFARI_ZONE - ld [$c0ee], a + ld [wc0ee], a call PlaySound ld c, $64 call DelayFrames call ClearScreen call LoadHpBarAndStatusTilePatterns xor a - ld [$cc5b], a + ld [wcc5b], a ld a, [$ffaa] cp $1 jr z, .asm_59d9 ; 0x59d0 $7 - ld a, $38 - call Predef + predef Func_410e2 jr .asm_59de ; 0x59d7 $5 .asm_59d9 - ld a, $2f - call Predef + predef Func_410f3 .asm_59de callab Func_3ad0e call ClearScreen @@ -840,26 +832,25 @@ TradeCenter_Trade: call Func_226e ld c, $28 call DelayFrames - ld hl, $c490 + ld hl, wTileMap + $f0 ld b, $4 ld c, $12 call Func_5ab3 - ld hl, $c4b9 + ld hl, wTileMap + $119 ld de, TradeCompleted call PlaceString - ld a, $50 - call Predef + predef SaveSAVtoSRAM2 ld c, $32 call DelayFrames xor a - ld [$cc38], a + ld [wcc38], a jp Func_5345 Func_5a18: ld c, $64 call DelayFrames xor a - ld [$cc38], a + ld [wcc38], a jp Func_551c WillBeTradedText: ; 5a24 (1:5a24) @@ -878,48 +869,47 @@ PointerTable_5a5b: ; 5a5b (1:5a5b) dw TradeCenter_Trade Func_5a5f: ; 5a5f (1:5a5f) - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $2 jr z, .asm_5a75 cp $3 jr z, .asm_5a75 cp $5 ret nz - ld a, $4d - call Predef ; indirect jump to Func_5aaf (5aaf (1:5aaf)) - jp InitGame + predef Func_5aaf + jp Init .asm_5a75 call Func_5317 ld hl, Club_GFX ld a, h - ld [$d52f], a + ld [W_TILESETGFXPTR + 1], a ld a, l - ld [$d52e], a + ld [W_TILESETGFXPTR], a ld a, Bank(Club_GFX) - ld [$d52b], a + ld [W_TILESETBANK], a ld hl, Club_Coll ld a, h - ld [$d531], a + ld [W_TILESETCOLLISIONPTR + 1], a ld a, l - ld [$d530], a + ld [W_TILESETCOLLISIONPTR], a xor a - ld [W_GRASSRATE], a ; $d887 + ld [W_GRASSRATE], a ; W_GRASSRATE inc a - ld [W_ISLINKBATTLE], a ; $d12b + ld [W_ISLINKBATTLE], a ; W_ISLINKBATTLE ld [$ffb5], a ld a, $a ld [wMusicHeaderPointer], a ld a, BANK(Music_Celadon) - ld [$c0f0], a + ld [wc0f0], a ld a, MUSIC_CELADON - ld [$c0ee], a + ld [wc0ee], a jp PlaySound Func_5aaf: ; 5aaf (1:5aaf) ret Func_5ab0: - call Load16BitRegisters + call GetPredefRegisters Func_5ab3: ; 5ab3 (1:5ab3) push hl diff --git a/engine/clear_save.asm b/engine/clear_save.asm index dbb3d3a6..5ef0d475 100755 --- a/engine/clear_save.asm +++ b/engine/clear_save.asm @@ -5,19 +5,18 @@ Func_1c98a: ; 1c98a (7:498a) call LoadTextBoxTilePatterns ld hl, ClearSaveDataText call PrintText - FuncCoord 14, 7 ; $c43a - ld hl, Coord + hlCoord 14, 7 ld bc, $80f ld a, $7 - ld [$d12c], a + ld [wd12c], a ld a, $14 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem and a - jp z, InitGame + jp z, Init callba Func_73b6a - jp InitGame + jp Init ClearSaveDataText: ; 1c9c1 (7:49c1) TX_FAR _ClearSaveDataText diff --git a/engine/evolution.asm b/engine/evolution.asm index 664aaa5e..07ccdbda 100755 --- a/engine/evolution.asm +++ b/engine/evolution.asm @@ -2,15 +2,15 @@ Func_7bde9: ; 7bde9 (1e:7de9) push hl push de push bc - ld a, [$cf91] + ld a, [wcf91] push af - ld a, [$d0b5] + ld a, [wd0b5] push af xor a - ld [$d083], a - ld [$c02a], a + ld [wd083], a + ld [wc02a], a dec a - ld [$c0ee], a + ld [wc0ee], a call PlaySound ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba @@ -20,25 +20,25 @@ Func_7bde9: ; 7bde9 (1e:7de9) xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld [$ffd7], a - ld a, [$cee9] - ld [$cf1d], a + ld a, [wHPBarMaxHP] + ld [wcf1d], a ld c, $0 call Func_7beb4 - ld a, [$ceea] - ld [$cf91], a - ld [$d0b5], a + ld a, [wHPBarMaxHP + 1] + ld [wcf91], a + ld [wd0b5], a call Func_7beb9 - ld de, $9000 - ld hl, $9310 - ld bc, $31 + ld de, vFrontPic + ld hl, vBackPic + ld bc, 7 * 7 call CopyVideoData - ld a, [$cee9] - ld [$cf91], a - ld [$d0b5], a + ld a, [wHPBarMaxHP] + ld [wcf91], a + ld [wd0b5], a call Func_7beb9 ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - ld a, [$cee9] + ld a, [wHPBarMaxHP] call PlayCry call WaitForSoundToFinish ld c, BANK(Music_SafariZone) @@ -60,28 +60,28 @@ Func_7bde9: ; 7bde9 (1e:7de9) dec c jr nz, .asm_7be63 xor a - ld [$ceec], a + ld [wHPBarOldHP + 1], a ld a, $31 - ld [$ceeb], a + ld [wHPBarOldHP], a call Func_7bed6 - ld a, [$ceea] + ld a, [wHPBarMaxHP + 1] .asm_7be81 - ld [$cf1d], a + ld [wcf1d], a ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound - ld a, [$cf1d] + ld a, [wcf1d] call PlayCry ld c, $0 call Func_7beb4 pop af - ld [$d0b5], a + ld [wd0b5], a pop af - ld [$cf91], a + ld [wcf91], a pop bc pop de pop hl - ld a, [$ceec] + ld a, [wHPBarOldHP + 1] and a ret z scf @@ -89,8 +89,8 @@ Func_7bde9: ; 7bde9 (1e:7de9) .asm_7bea9 pop bc ld a, $1 - ld [$ceec], a - ld a, [$cee9] + ld [wHPBarOldHP + 1], a + ld a, [wHPBarMaxHP] jr .asm_7be81 Func_7beb4: ; 7beb4 (1e:7eb4) @@ -99,15 +99,14 @@ Func_7beb4: ; 7beb4 (1e:7eb4) Func_7beb9: ; 7beb9 (1e:7eb9) call GetMonHeader - FuncCoord 7, 2 ; $c3cf - ld hl, Coord + hlCoord 7, 2 jp LoadFlippedFrontSpriteByMonIndex asm_7bec2: ; 7bec2 (1e:7ec2) ld a, $31 - ld [$ceeb], a + ld [wHPBarOldHP], a call Func_7bed6 ld a, $cf - ld [$ceeb], a + ld [wHPBarOldHP], a call Func_7bed6 dec b jr nz, asm_7bec2 @@ -117,14 +116,13 @@ Func_7bed6: ; 7bed6 (1e:7ed6) push bc xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - FuncCoord 7, 2 ; $c3cf - ld hl, Coord + hlCoord 7, 2 ld bc, $707 ld de, $d .asm_7bee3 push bc .asm_7bee4 - ld a, [$ceeb] + ld a, [wHPBarOldHP] add [hl] ld [hli], a dec c @@ -141,7 +139,7 @@ Func_7bed6: ; 7bed6 (1e:7ed6) asm_7befa: ; 7befa (1e:7efa) call DelayFrame push bc - call GetJoypadStateLowSensitivity + call JoypadLowSensitivity ld a, [$ffb5] pop bc and $2 @@ -152,7 +150,7 @@ asm_7befa: ; 7befa (1e:7efa) and a ret .asm_7bf0d - ld a, [$ccd4] + ld a, [wccd4] and a jr nz, .asm_7bf08 scf diff --git a/engine/evolve_trade.asm b/engine/evolve_trade.asm index 9758b99f..ffb8a778 100755 --- a/engine/evolve_trade.asm +++ b/engine/evolve_trade.asm @@ -31,14 +31,14 @@ EvolveTradeMon: ; 17d7d (5:7d7d) ret nz .ok - ld a, [W_NUMINPARTY] ; $d163 + ld a, [wPartyCount] ; wPartyCount dec a - ld [wWhichPokemon], a ; $cf92 + ld [wWhichPokemon], a ; wWhichPokemon ld a, $1 - ld [$ccd4], a + ld [wccd4], a ld a, $32 - ld [W_ISLINKBATTLE], a ; $d12b + ld [W_ISLINKBATTLE], a ; W_ISLINKBATTLE callab Func_3ad0e xor a - ld [W_ISLINKBATTLE], a ; $d12b + ld [W_ISLINKBATTLE], a ; W_ISLINKBATTLE jp Func_2307 diff --git a/engine/evos_moves.asm b/engine/evos_moves.asm index 0892d8de..fd93fa14 100755 --- a/engine/evos_moves.asm +++ b/engine/evos_moves.asm @@ -1,8 +1,8 @@ Func_3ad0e: ; 3ad0e (e:6d0e) - ld hl, $ccd3 + ld hl, wccd3 xor a ld [hl], a - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon ld c, a ld b, $1 call Func_3b057 @@ -11,33 +11,33 @@ Func_3ad1c: ; 3ad1c (e:6d1c) ld a, [$ffd7] push af xor a - ld [$d121], a + ld [wd121], a dec a - ld [wWhichPokemon], a ; $cf92 + ld [wWhichPokemon], a ; wWhichPokemon push hl push bc push de - ld hl, W_NUMINPARTY ; $d163 + ld hl, wPartyCount ; wPartyCount push hl asm_3ad2e: ; 3ad2e (e:6d2e) - ld hl, wWhichPokemon ; $cf92 + ld hl, wWhichPokemon ; wWhichPokemon inc [hl] pop hl inc hl ld a, [hl] cp $ff jp z, Func_3aede - ld [$cee9], a + ld [wHPBarMaxHP], a push hl - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon ld c, a - ld hl, $ccd3 + ld hl, wccd3 ld b, $2 call Func_3b057 ld a, c and a jp z, asm_3ad2e - ld a, [$cee9] + ld a, [wHPBarMaxHP] dec a ld b, $0 ld hl, EvosMovesPointerTable @@ -49,13 +49,13 @@ asm_3ad2e: ; 3ad2e (e:6d2e) ld h, [hl] ld l, a push hl - ld a, [$cf91] + ld a, [wcf91] push af xor a - ld [$cc49], a + ld [wcc49], a call LoadMonData pop af - ld [$cf91], a + ld [wcf91], a pop hl Func_3ad71: ; 3ad71 (e:6d71) @@ -65,49 +65,49 @@ Func_3ad71: ; 3ad71 (e:6d71) ld b, a cp $3 jr z, .asm_3ad91 - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $32 jr z, asm_3ad2e ld a, b cp $2 jr z, .asm_3ada4 - ld a, [$ccd4] + ld a, [wccd4] and a jr nz, asm_3ad2e ld a, b cp $1 jr z, .asm_3adad .asm_3ad91 - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $32 jp nz, Func_3aed9 ld a, [hli] ld b, a - ld a, [$cfb9] + ld a, [wcfb9] cp b jp c, asm_3ad2e jr .asm_3adb6 .asm_3ada4 ld a, [hli] ld b, a - ld a, [$cf91] + ld a, [wcf91] cp b jp nz, Func_3aed9 .asm_3adad ld a, [hli] ld b, a - ld a, [$cfb9] + ld a, [wcfb9] cp b jp c, Func_3aeda .asm_3adb6 - ld [W_CURENEMYLVL], a ; $d127 + ld [W_CURENEMYLVL], a ; W_CURENEMYLVL ld a, $1 - ld [$d121], a + ld [wd121], a push hl ld a, [hl] - ld [$ceea], a - ld a, [wWhichPokemon] ; $cf92 - ld hl, W_PARTYMON1NAME ; $d2b5 + ld [wHPBarMaxHP + 1], a + ld a, [wWhichPokemon] ; wWhichPokemon + ld hl, wPartyMonNicks ; wPartyMonNicks call GetPartyMonName call CopyStringToCF4B ld hl, IsEvolvingText @@ -122,21 +122,21 @@ Func_3ad71: ; 3ad71 (e:6d71) ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld a, $ff - ld [$cfcb], a - call CleanLCD_OAM + ld [wcfcb], a + call ClearSprites callab Func_7bde9 jp c, Func_3af2e ld hl, EvolvedText call PrintText pop hl ld a, [hl] - ld [$d0b5], a - ld [$cf98], a - ld [$ceea], a + ld [wd0b5], a + ld [wcf98], a + ld [wHPBarMaxHP + 1], a ld a, MONSTER_NAME ld [W_LISTTYPE], a ld a, $e - ld [$d0b7], a + ld [wPredefBank], a call GetName push hl ld hl, IntoText @@ -148,29 +148,28 @@ Func_3ad71: ; 3ad71 (e:6d71) call DelayFrames call ClearScreen call Func_3aef7 - ld a, [$d11e] + ld a, [wd11e] push af - ld a, [$d0b5] - ld [$d11e], a - ld a, $3a - call Predef ; indirect jump to IndexToPokedex (41010 (10:5010)) - ld a, [$d11e] + ld a, [wd0b5] + ld [wd11e], a + predef IndexToPokedex + ld a, [wd11e] dec a - ld hl, BulbasaurBaseStats ; $43de + ld hl, BaseStats ld bc, $1c call AddNTimes ld de, W_MONHEADER call CopyData - ld a, [$d0b5] - ld [$d0b8], a + ld a, [wd0b5] + ld [W_MONHDEXNUM], a pop af - ld [$d11e], a - ld hl, $cfa8 - ld de, $cfba + ld [wd11e], a + ld hl, wcfa8 + ld de, wcfba ld b, $1 call CalcStats - ld a, [wWhichPokemon] ; $cf92 - ld hl, W_PARTYMON1_NUM ; $d16b (aliases: W_PARTYMON1DATA) + ld a, [wWhichPokemon] ; wWhichPokemon + ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1) ld bc, $2c call AddNTimes ld e, l @@ -182,14 +181,14 @@ Func_3ad71: ; 3ad71 (e:6d71) ld a, [hli] ld b, a ld c, [hl] - ld hl, $cfbb + ld hl, wcfbb ld a, [hld] sub c ld c, a ld a, [hl] sbc b ld b, a - ld hl, $cf9a + ld hl, wcf9a ld a, [hl] add c ld [hld], a @@ -199,32 +198,30 @@ Func_3ad71: ; 3ad71 (e:6d71) dec hl pop bc call CopyData - ld a, [$d0b5] - ld [$d11e], a + ld a, [wd0b5] + ld [wd11e], a xor a - ld [$cc49], a + ld [wcc49], a call Func_3af5b pop hl - ld a, $42 - call Predef ; indirect jump to SetPartyMonTypes (5db5e (17:5b5e)) - ld a, [W_ISINBATTLE] ; $d057 + predef SetPartyMonTypes + ld a, [W_ISINBATTLE] ; W_ISINBATTLE and a call z, Func_3af52 - ld a, $3a - call Predef ; indirect jump to IndexToPokedex (41010 (10:5010)) - ld a, [$d11e] + predef IndexToPokedex + ld a, [wd11e] dec a ld c, a ld b, $1 - ld hl, wPokedexOwned ; $d2f7 + ld hl, wPokedexOwned ; wPokedexOwned push bc call Func_3b057 pop bc - ld hl, wPokedexSeen ; $d30a + ld hl, wPokedexSeen ; wd30a call Func_3b057 pop de pop hl - ld a, [$cf98] + ld a, [wcf98] ld [hl], a push hl ld l, e @@ -244,27 +241,27 @@ Func_3aede: ; 3aede (e:6ede) pop hl pop af ld [$ffd7], a - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $32 ret z - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE and a ret nz - ld a, [$d121] + ld a, [wd121] and a call nz, Func_2307 ret Func_3aef7: ; 3aef7 (e:6ef7) - ld a, [$d0b5] + ld a, [wd0b5] push af - ld a, [$d0b8] - ld [$d0b5], a + ld a, [W_MONHDEXNUM] + ld [wd0b5], a call GetName pop af - ld [$d0b5], a - ld hl, $cd6d - ld de, $cf4b + ld [wd0b5], a + ld hl, wcd6d + ld de, wcf4b .asm_3af0e ld a, [de] inc de @@ -273,13 +270,13 @@ Func_3aef7: ; 3aef7 (e:6ef7) ret nz cp $50 jr nz, .asm_3af0e - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon ld bc, $b - ld hl, W_PARTYMON1NAME ; $d2b5 + ld hl, wPartyMonNicks ; wPartyMonNicks call AddNTimes push hl call GetName - ld hl, $cd6d + ld hl, wcd6d pop de jp CopyData @@ -308,15 +305,15 @@ IsEvolvingText: ; 3af4d (e:6f4d) db "@" Func_3af52: ; 3af52 (e:6f52) - ld a, [W_ISLINKBATTLE] ; $d12b + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE cp $32 ret z jp ReloadTilesetTilePatterns Func_3af5b: ; 3af5b (e:6f5b) ld hl, EvosMovesPointerTable - ld a, [$d11e] - ld [$cf91], a + ld a, [wd11e] + ld [wcf91], a dec a ld bc, $0 ld hl, EvosMovesPointerTable @@ -336,16 +333,16 @@ Func_3af5b: ; 3af5b (e:6f5b) and a jr z, .asm_3afb1 ld b, a - ld a, [W_CURENEMYLVL] ; $d127 + ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL cp b ld a, [hli] jr nz, .asm_3af77 ld d, a - ld a, [$cc49] + ld a, [wcc49] and a jr nz, .asm_3af96 - ld hl, W_PARTYMON1_MOVE1 ; $d173 - ld a, [wWhichPokemon] ; $cf92 + ld hl, wPartyMon1Moves ; wPartyMon1Moves + ld a, [wWhichPokemon] ; wWhichPokemon ld bc, $2c call AddNTimes .asm_3af96 @@ -357,28 +354,27 @@ Func_3af5b: ; 3af5b (e:6f5b) dec b jr nz, .asm_3af98 ld a, d - ld [$d0e0], a - ld [$d11e], a + ld [wd0e0], a + ld [wd11e], a call GetMoveName call CopyStringToCF4B - ld a, $1b - call Predef ; indirect jump to LearnMove (6e43 (1:6e43)) + predef LearnMove .asm_3afb1 - ld a, [$cf91] - ld [$d11e], a + ld a, [wcf91] + ld [wd11e], a ret ; writes the moves a mon has at level [W_CURENEMYLVL] to [de] ; move slots are being filled up sequentially and shifted if all slots are full -; [$cee9]: (?) +; [wHPBarMaxHP]: (?) WriteMonMoves: ; 3afb8 (e:6fb8) - call Load16BitRegisters + call GetPredefRegisters push hl push de push bc ld hl, EvosMovesPointerTable ld b, $0 - ld a, [$cf91] ; cur mon ID + ld a, [wcf91] ; cur mon ID dec a add a rl b @@ -401,13 +397,13 @@ WriteMonMoves: ; 3afb8 (e:6fb8) and a jp z, .done ; end of list ld b, a - ld a, [W_CURENEMYLVL] ; $d127 + ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL cp b jp c, .done ; mon level < move level (assumption: learnset is sorted by level) - ld a, [$cee9] + ld a, [wHPBarMaxHP] and a jr z, .skipMinLevelCheck - ld a, [wWhichTrade] ; $cd3d (min move level) + ld a, [wWhichTrade] ; wWhichTrade (min move level) cp b jr nc, .nextMove2 ; min level >= move level .skipMinLevelCheck @@ -436,7 +432,7 @@ WriteMonMoves: ; 3afb8 (e:6fb8) ld h, d ld l, e call WriteMonMoves_ShiftMoveData ; shift all moves one up (deleting move 1) - ld a, [$cee9] + ld a, [wHPBarMaxHP] and a jr z, .writeMoveToSlot push de @@ -451,7 +447,7 @@ WriteMonMoves: ; 3afb8 (e:6fb8) .writeMoveToSlot2 ld a, [hl] ld [de], a - ld a, [$cee9] + ld a, [wHPBarMaxHP] and a jr z, .nextMove push hl ; write move PP value @@ -463,10 +459,10 @@ WriteMonMoves: ; 3afb8 (e:6fb8) ld hl, Moves ld bc, $6 call AddNTimes - ld de, $cee9 + ld de, wHPBarMaxHP ld a, BANK(Moves) call FarCopyData - ld a, [$ceee] + ld a, [wHPBarNewHP + 1] pop hl ld [hl], a pop hl @@ -489,7 +485,6 @@ WriteMonMoves_ShiftMoveData: ; 3b04e (e:704e) ret Func_3b057: ; 3b057 (e:7057) - ld a, $10 - jp Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + predef_jump FlagActionPredef INCLUDE "data/evos_moves.asm" diff --git a/engine/experience.asm b/engine/experience.asm index 80177b50..07726821 100755 --- a/engine/experience.asm +++ b/engine/experience.asm @@ -1,13 +1,13 @@ Func_58f43: ; 58f43 (16:4f43) - ld a, [$cf98] - ld [$d0b5], a + ld a, [wcf98] + ld [wd0b5], a call GetMonHeader ld d, $1 .asm_58f4e inc d call CalcExperience push hl - ld hl, $cfa8 + ld hl, wcfa8 ld a, [$ff98] ld c, a ld a, [hld] diff --git a/engine/game_corner_slots.asm b/engine/game_corner_slots.asm index f3009b35..0ab74927 100755 --- a/engine/game_corner_slots.asm +++ b/engine/game_corner_slots.asm @@ -10,7 +10,7 @@ StartSlotMachine: ; 37e2d (d:7e2d) ld a, [wTrainerSpriteOffset] and a ret z - ld a, [$cd05] + ld a, [wcd05] ld b, a ld a, [wTrainerFacingDirection] inc a @@ -21,9 +21,9 @@ StartSlotMachine: ; 37e2d (d:7e2d) .asm_37e58 ld a, $fa .asm_37e5a - ld [$cc5b], a + ld [wcc5b], a ld a, [H_LOADEDROMBANK] - ld [$cc5e], a + ld [wcc5e], a call PromptUserToPlaySlots ret .printOutOfOrder diff --git a/engine/game_corner_slots2.asm b/engine/game_corner_slots2.asm index 719c50e7..66e51237 100755 --- a/engine/game_corner_slots2.asm +++ b/engine/game_corner_slots2.asm @@ -1,10 +1,9 @@ AbleToPlaySlotsCheck ; 2ff09 (b:7f09) - ld a, [$c102] + ld a, [wSpriteStateData1 + 2] and $8 jr z, .done ; not able ld b, COIN_CASE - ld a, $1c - call Predef ; IsItemInBag_ + predef IsItemInBag_ ; IsItemInBag_ ld a, b and a ld b, $33 ; GameCornerCoinCaseText @@ -20,7 +19,7 @@ AbleToPlaySlotsCheck ; 2ff09 (b:7f09) call PrintPredefTextID xor a .done - ld [$cd3d], a + ld [wWhichTrade], a ret GameCornerCoinCaseText: ; 2ff32 (b:7f32) diff --git a/engine/gamefreak.asm b/engine/gamefreak.asm index 4837bc18..d0f1bbac 100755 --- a/engine/gamefreak.asm +++ b/engine/gamefreak.asm @@ -4,15 +4,15 @@ LoadShootingStarGraphics: ; 70000 (1c:4000) ld a, $a4 ld [rOBP1], a ; $ff49 ld de, AnimationTileset2 + $30 ; $471e ; star tile (top left quadrant) - ld hl, $8a00 + ld hl, vChars1 + $200 ld bc, (BANK(AnimationTileset2) << 8) + $01 call CopyVideoData ld de, AnimationTileset2 + $130 ; $481e ; star tile (bottom left quadrant) - ld hl, $8a10 + ld hl, vChars1 + $210 ld bc, (BANK(AnimationTileset2) << 8) + $01 call CopyVideoData ld de, FallingStar ; $4190 - ld hl, $8a20 + ld hl, vChars1 + $220 ld bc, (BANK(FallingStar) << 8) + $01 call CopyVideoData ld hl, GameFreakLogoOAMData ; $4140 @@ -85,7 +85,7 @@ AnimateShootingStar: ; 70044 (1c:4044) dec a jr nz, .asm_70098 xor a - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ; wWhichTrade ld hl, PointerTable_700f2 ; $40f2 ld c, $6 .asm_700af @@ -110,15 +110,15 @@ AnimateShootingStar: ; 70044 (1c:4044) inc hl dec c jr nz, .asm_700ba - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade cp $18 jr z, .asm_700d5 add $6 - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ; wWhichTrade .asm_700d5 call Func_7011f push af - ld hl, $c310 + ld hl, wOAMBuffer + $10 ld de, wOAMBuffer ld bc, $50 call CopyData @@ -173,8 +173,8 @@ OAMData_7011e: ; 7011e (1c:411e) Func_7011f: ; 7011f (1c:411f) ld b, $8 .asm_70121 - ld hl, $c35c - ld a, [wWhichTrade] ; $cd3d + ld hl, wOAMBuffer + $5c + ld a, [wWhichTrade] ; wWhichTrade ld de, $fffc ld c, a .asm_7012b diff --git a/engine/give_pokemon.asm b/engine/give_pokemon.asm index ba1461c3..9399fb05 100755 --- a/engine/give_pokemon.asm +++ b/engine/give_pokemon.asm @@ -1,22 +1,22 @@ _GivePokemon: ; 4fda5 (13:7da5) call EnableAutoTextBoxDrawing xor a - ld [$ccd3], a - ld a, [W_NUMINPARTY] ; $d163 + ld [wccd3], a + ld a, [wPartyCount] ; wPartyCount cp $6 jr c, .asm_4fe01 - ld a, [W_NUMINBOX] ; $da80 + ld a, [W_NUMINBOX] ; wda80 cp $14 jr nc, .asm_4fdf9 xor a - ld [W_ENEMYBATTSTATUS3], a ; $d069 - ld a, [$cf91] - ld [W_ENEMYMONID], a + ld [W_ENEMYBATTSTATUS3], a ; W_ENEMYBATTSTATUS3 + ld a, [wcf91] + ld [wEnemyMonSpecies2], a callab Func_3eb01 call SetPokedexOwnedFlag callab Func_e7a4 - ld hl, $cf4b - ld a, [$d5a0] + ld hl, wcf4b + ld a, [wd5a0] and $7f cp $9 jr c, .asm_4fdec @@ -41,28 +41,26 @@ _GivePokemon: ; 4fda5 (13:7da5) ret .asm_4fe01 call SetPokedexOwnedFlag - call AddPokemonToParty + call AddPartyMon ld a, $1 - ld [$cc3c], a - ld [$ccd3], a + ld [wcc3c], a + ld [wccd3], a scf ret SetPokedexOwnedFlag: ; 4fe11 (13:7e11) - ld a, [$cf91] + ld a, [wcf91] push af - ld [$d11e], a - ld a, $3a - call Predef ; indirect jump to IndexToPokedex (41010 (10:5010)) - ld a, [$d11e] + ld [wd11e], a + predef IndexToPokedex + ld a, [wd11e] dec a ld c, a - ld hl, wPokedexOwned ; $d2f7 + ld hl, wPokedexOwned ; wPokedexOwned ld b, $1 - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + predef FlagActionPredef pop af - ld [$d11e], a + ld [wd11e], a call GetMonName ld hl, GotMonText jp PrintText diff --git a/engine/hall_of_fame.asm b/engine/hall_of_fame.asm index f84053e3..f4384b91 100755 --- a/engine/hall_of_fame.asm +++ b/engine/hall_of_fame.asm @@ -1,12 +1,12 @@ AnimateHallOfFame: ; 701a0 (1c:41a0) call Func_70423 call ClearScreen - ld c, $64 + ld c, 100 call DelayFrames call LoadFontTilePatterns call LoadTextBoxTilePatterns call DisableLCD - ld hl, $9800 + ld hl,vBGMap0 ld bc, $800 ld a, $7f call FillMemory @@ -14,18 +14,18 @@ AnimateHallOfFame: ; 701a0 (1c:41a0) ld hl, rLCDC ; $ff40 set 3, [hl] xor a - ld hl, $cc5b - ld bc, $60 + ld hl, wHallOfFame + ld bc, HOF_TEAM call FillMemory xor a - ld [$cfcb], a + ld [wcfcb], a ld [$ffd7], a ld [W_SPRITEFLIPPED], a - ld [$d358], a - ld [$cd40], a + ld [wd358], a + ld [wTrainerScreenY], a inc a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - ld hl, $d5a2 + ld hl, wd5a2 ld a, [hl] inc a jr z, .asm_701eb @@ -36,7 +36,7 @@ AnimateHallOfFame: ; 701a0 (1c:41a0) ld c, BANK(Music_HallOfFame) ld a, MUSIC_HALL_OF_FAME call PlayMusic - ld hl, W_PARTYMON1 ; $d164 + ld hl, wPartySpecies ld c, $ff .asm_701fb ld a, [hli] @@ -45,28 +45,26 @@ AnimateHallOfFame: ; 701a0 (1c:41a0) inc c push hl push bc - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ; wWhichTrade ld a, c - ld [$cd3e], a - ld hl, W_PARTYMON1_LEVEL ; $d18c - ld bc, $2c + ld [wTrainerEngageDistance], a + ld hl, wPartyMon1Level ; wPartyMon1Level + ld bc, wPartyMon2 - wPartyMon1 call AddNTimes ld a, [hl] - ld [$cd3f], a + ld [wTrainerFacingDirection], a call Func_70278 call Func_702e1 ld c, $50 call DelayFrames - FuncCoord 2, 13 ; $c4a6 - ld hl, Coord + hlCoord 2, 13 ld b, $3 ld c, $e call TextBoxBorder - FuncCoord 4, 15 ; $c4d0 - ld hl, Coord + hlCoord 4, 15 ld de, HallOfFameText call PlaceString - ld c, $b4 + ld c, 180 call DelayFrames call GBFadeOut2 pop bc @@ -75,15 +73,15 @@ AnimateHallOfFame: ; 701a0 (1c:41a0) .asm_70241 ld a, c inc a - ld hl, $cc5b - ld bc, $10 + ld hl, wHallOfFame + ld bc, HOF_MON call AddNTimes ld [hl], $ff - call Func_73b0d + call SaveHallOfFameTeams xor a - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ; wWhichTrade inc a - ld [$cd40], a + ld [wTrainerScreenY], a call Func_70278 call Func_70377 call Func_70423 @@ -102,23 +100,21 @@ Func_70278: ; 70278 (1c:4278) ld [$ffaf], a ld a, $c0 ld [$ffae], a - ld a, [wWhichTrade] ; $cd3d - ld [$cf91], a - ld [$d0b5], a - ld [$cfd9], a - ld [$cf1d], a - ld a, [$cd40] + ld a, [wWhichTrade] ; wWhichTrade + ld [wcf91], a + ld [wd0b5], a + ld [wBattleMonSpecies2], a + ld [wcf1d], a + ld a, [wTrainerScreenY] and a jr z, .asm_7029d call Func_7033e jr .asm_702ab .asm_7029d - FuncCoord 12, 5 ; $c410 - ld hl, Coord + hlCoord 12, 5 call GetMonHeader call LoadFrontSpriteByMonIndex - ld a, $4 - call Predef ; indirect jump to LoadMonBackSprite (3f103 (f:7103)) + predef LoadMonBackPic .asm_702ab ld b, $b ld c, $0 @@ -129,7 +125,7 @@ Func_70278: ; 70278 (1c:4278) call Func_7036d ld d, $a0 ld e, $4 - ld a, [$cf1b] + ld a, [wcf1b] and a jr z, .asm_702c7 sla e @@ -151,37 +147,31 @@ Func_70278: ; 70278 (1c:4278) ret Func_702e1: ; 702e1 (1c:42e1) - ld a, [$cd3e] - ld hl, W_PARTYMON1NAME ; $d2b5 + ld a, [wTrainerEngageDistance] + ld hl, wPartyMonNicks ; wPartyMonNicks call GetPartyMonName call Func_702f0 jp Func_70404 Func_702f0: ; 702f0 (1c:42f0) - FuncCoord 0, 2 ; $c3c8 - ld hl, Coord + hlCoord 0, 2 ld b, $9 ld c, $a call TextBoxBorder - FuncCoord 2, 6 ; $c41a - ld hl, Coord + hlCoord 2, 6 ld de, HoFMonInfoText call PlaceString - FuncCoord 1, 4 ; $c3f1 - ld hl, Coord - ld de, $cd6d + hlCoord 1, 4 + ld de, wcd6d call PlaceString - ld a, [$cd3f] - FuncCoord 8, 7 ; $c434 - ld hl, Coord + ld a, [wTrainerFacingDirection] + hlCoord 8, 7 call PrintLevelCommon - ld a, [wWhichTrade] ; $cd3d - ld [$d0b5], a - FuncCoord 3, 9 ; $c457 - ld hl, Coord - ld a, $4b - call Predef ; indirect jump to Func_27d6b (27d6b (9:7d6b)) - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade + ld [wd0b5], a + hlCoord 3, 9 + predef Func_27d6b + ld a, [wWhichTrade] ; wWhichTrade jp PlayCry HoFMonInfoText: ; 70329 (1c:4329) @@ -197,71 +187,60 @@ Func_7033e: ; 7033e (1c:433e) ld de, $a000 ld bc, $310 call CopyData - ld de, $9000 + ld de, vFrontPic call InterlaceMergeSpriteBuffers ld de, RedPicBack ; $7e0a ld a, BANK(RedPicBack) call UncompressSpriteFromDE - ld a, $3 - call Predef ; indirect jump to ScaleSpriteByTwo (2fe40 (b:7e40)) - ld de, $9310 + predef ScaleSpriteByTwo + ld de, vBackPic call InterlaceMergeSpriteBuffers ld c, $1 Func_7036d: ; 7036d (1c:436d) ld b, $0 - FuncCoord 12, 5 ; $c410 - ld hl, Coord - ld a, $31 - jp Predef ; indirect jump to Func_79dda (79dda (1e:5dda)) + hlCoord 12, 5 + predef_jump Func_79dda Func_70377: ; 70377 (1c:4377) - ld hl, $d747 + ld hl, wd747 set 3, [hl] - ld a, $56 - call Predef ; indirect jump to DisplayDexRating (44169 (11:4169)) - FuncCoord 0, 4 ; $c3f0 - ld hl, Coord + predef DisplayDexRating + hlCoord 0, 4 ld b, $6 ld c, $a call TextBoxBorder - FuncCoord 5, 0 ; $c3a5 - ld hl, Coord + hlCoord 5, 0 ld b, $2 ld c, $9 call TextBoxBorder - FuncCoord 7, 2 ; $c3cf - ld hl, Coord - ld de, W_PLAYERNAME ; $d158 + hlCoord 7, 2 + ld de, wPlayerName ; wd158 call PlaceString - FuncCoord 1, 6 ; $c419 - ld hl, Coord + hlCoord 1, 6 ld de, HoFPlayTimeText call PlaceString - FuncCoord 5, 7 ; $c431 - ld hl, Coord - ld de, $da41 + hlCoord 5, 7 + ld de, W_PLAYTIMEHOURS + 1 ld bc, $103 call PrintNumber ld [hl], $6d inc hl - ld de, $da43 + ld de, W_PLAYTIMEMINUTES + 1 ld bc, $8102 call PrintNumber - FuncCoord 1, 9 ; $c455 - ld hl, Coord + hlCoord 1, 9 ld de, HoFMoneyText call PlaceString - FuncCoord 4, 10 ; $c46c - ld hl, Coord - ld de, wPlayerMoney ; $d347 + hlCoord 4, 10 + ld de, wPlayerMoney ; wPlayerMoney ld c, $a3 call PrintBCDNumber ld hl, DexSeenOwnedText call Func_703e2 ld hl, DexRatingText call Func_703e2 - ld hl, $cc5d + ld hl, wcc5d Func_703e2: ; 703e2 (1c:43e2) call PrintText @@ -283,24 +262,24 @@ DexRatingText: ; 703ff (1c:43ff) db "@" Func_70404: ; 70404 (1c:4404) - ld hl, $cc5b - ld bc, $10 - ld a, [$cd3e] + ld hl, wHallOfFame + ld bc, HOF_MON + ld a, [wTrainerEngageDistance] call AddNTimes - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade ld [hli], a - ld a, [$cd3f] + ld a, [wTrainerFacingDirection] ld [hli], a ld e, l ld d, h - ld hl, $cd6d + ld hl, wcd6d ld bc, $b jp CopyData Func_70423: ; 70423 (1c:4423) ld a, $a - ld [$cfc8], a - ld [$cfc9], a + ld [wcfc8], a + ld [wcfc9], a ld a, $ff ld [wMusicHeaderPointer], a jp GBFadeOut2 diff --git a/engine/hidden_object_functions14.asm b/engine/hidden_object_functions14.asm index b71ffd05..0d3598f2 100755 --- a/engine/hidden_object_functions14.asm +++ b/engine/hidden_object_functions14.asm @@ -1,7 +1,7 @@ PrintNotebookText: ; 52996 (14:6996) call EnableAutoTextBoxDrawing ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ld a, [wTrainerSpriteOffset] jp PrintPredefTextID @@ -92,7 +92,7 @@ FightingDojoText: ; 52a2a (14:6a2a) db "@" PrintIndigoPlateauHQText: ; 52a2f (14:6a2f) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 ret nz call EnableAutoTextBoxDrawing diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index d0c6699e..f0126b65 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -16,14 +16,14 @@ RedBedroomPC: ; 5db8e (17:5b8e) db $fc ; FuncTX_ItemStoragePC Route15GateLeftBinoculars: ; 5db8f (17:5b8f) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 ; i ret nz call EnableAutoTextBoxDrawing ld a, $a ; text id Route15UpstairsBinocularsText call PrintPredefTextID ld a, ARTICUNO - ld [$cf91], a + ld [wcf91], a call PlayCry jp DisplayMonFrontSpriteInBox @@ -33,7 +33,7 @@ Route15UpstairsBinocularsText: ; 5dba8 (17:5ba8) AerodactylFossil: ; 5dbad (17:5bad) ld a, FOSSIL_AERODACTYL - ld [$cf91], a + ld [wcf91], a call DisplayMonFrontSpriteInBox call EnableAutoTextBoxDrawing ld a, $9 @@ -46,7 +46,7 @@ AerodactylFossilText: ; 5dbbe (17:5bbe) KabutopsFossil: ; 5bdc3 (17:5bc3) ld a, FOSSIL_KABUTOPS - ld [$cf91], a + ld [wcf91], a call DisplayMonFrontSpriteInBox call EnableAutoTextBoxDrawing ld a, $b @@ -59,7 +59,7 @@ KabutopsFossilText: ; 5dbd4 (17:5bd4) DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9) ; Displays a pokemon's front sprite in a pop-up window. -; [$cf91] = pokemon interal id number +; [wcf91] = pokemon interal id number ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba call Delay3 @@ -67,20 +67,18 @@ DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9) ld [$ffb0], a call SaveScreenTilesToBuffer1 ld a, $11 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID call UpdateSprites - ld a, [$cf91] - ld [$d0b5], a + ld a, [wcf91] + ld [wd0b5], a call GetMonHeader - ld de, $8b10 + ld de, vChars1 + $310 call LoadMonFrontSprite ld a, $80 ld [$ffe1], a - FuncCoord 10, 11 ; $c486 - ld hl, Coord - ld a, $2 - call Predef ; indirect jump to Func_3f073 (3f073 (f:7073)) + hlCoord 10, 11 + predef Func_3f073 call WaitForTextScrollButtonPress call LoadScreenTilesFromBuffer1 call Delay3 @@ -91,8 +89,8 @@ DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9) PrintBlackboardLinkCableText: ; 5dc1a (17:5c1a) call EnableAutoTextBoxDrawing ld a, $1 - ld [$cc3c], a - ld a, [$cd3d] + ld [wcc3c], a + ld a, [wWhichTrade] call PrintPredefTextID ret @@ -114,13 +112,13 @@ LinkCableHelp: ; 5dc29 (17:5c29) ld a, $1 ld [wTopMenuItemX], a .asm_5c51 - ld hl, $d730 + ld hl, wd730 set 6, [hl] ld hl, wTileMap ld b, $8 ld c, $d call TextBoxBorder - ld hl, $c3ca + ld hl, wTileMap + $2a ld de, HowToLinkText call PlaceString ld hl, LinkCableHelpText2 @@ -131,7 +129,7 @@ LinkCableHelp: ; 5dc29 (17:5c29) ld a, [wCurrentMenuItem] cp $3 jr z, .asm_5dc93 ; 0x5dc7b $16 - ld hl, $d730 + ld hl, wd730 res 6, [hl] ld hl, LinkCableInfoTexts add a @@ -144,7 +142,7 @@ LinkCableHelp: ; 5dc29 (17:5c29) call PrintText jp .asm_5c51 .asm_5dc93 - ld hl, $d730 + ld hl, wd730 res 6, [hl] call LoadScreenTilesFromBuffer1 jp TextScriptEnd @@ -198,15 +196,15 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) ld a, $1 ld [wTopMenuItemX], a .asm_5dd15 - ld hl, $d730 + ld hl, wd730 set 6, [hl] ld hl, wTileMap ld bc, $060a call TextBoxBorder - ld hl, $c3c9 + ld hl, wTileMap + $29 ld de, StatusAilmentText1 call PlaceString - ld hl, $c3ce + ld hl, wTileMap + $2e ld de, StatusAilmentText2 call PlaceString ld hl, ViridianSchoolBlackboardText2 @@ -244,7 +242,7 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) add b cp $5 jr z, .exitBlackboard - ld hl, $d730 + ld hl, wd730 res 6, [hl] ld hl, ViridianBlackboardStatusPointers add a @@ -257,7 +255,7 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) call PrintText jp .asm_5dd15 .exitBlackboard - ld hl, $d730 + ld hl, wd730 res 6, [hl] call LoadScreenTilesFromBuffer1 jp TextScriptEnd @@ -318,11 +316,11 @@ VermilionGymTrashText: ; 5ddf7 (17:5df7) GymTrashScript: ; 5ddfc (17:5dfc) call EnableAutoTextBoxDrawing - ld a, [wWhichTrade] ; $cd3d - ld [$cd5b], a + ld a, [wWhichTrade] ; wWhichTrade + ld [wcd5b], a ; Don't do the trash can puzzle if it's already been done. - ld a, [$d773] + ld a, [wd773] bit 0, a jr z, .ok @@ -333,9 +331,9 @@ GymTrashScript: ; 5ddfc (17:5dfc) bit 1, a jr nz, .trySecondLock - ld a, [$d743] + ld a, [wd743] ld b, a - ld a, [$cd5b] + ld a, [wcd5b] cp b jr z, .openFirstLock @@ -344,11 +342,11 @@ GymTrashScript: ; 5ddfc (17:5dfc) .openFirstLock ; Next can is trying for the second switch. - ld hl, $d773 + ld hl, wd773 set 1, [hl] ld hl, GymTrashCans ; $5e7d - ld a, [$cd5b] + ld a, [wcd5b] ; * 5 ld b, a add a @@ -362,7 +360,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) ld [$ffdb], a push hl - call GenRandom + call Random swap a ld b, a ld a, [$ffdb] @@ -375,34 +373,34 @@ GymTrashScript: ; 5ddfc (17:5dfc) add hl, de ld a, [hl] and $f - ld [$d744], a + ld [wd744], a ld a, $3b ; DisplayTextID $3b = VermilionGymTrashSuccesText1 (first lock opened!) jr .done .trySecondLock - ld a, [$d744] + ld a, [wd744] ld b, a - ld a, [$cd5b] + ld a, [wcd5b] cp b jr z, .openSecondLock ; Reset the cans. - ld hl, $d773 + ld hl, wd773 res 1, [hl] - call GenRandom + call Random and $e - ld [$d743], a + ld [wd743], a ld a, $3e ; DisplayTextID $3e = VermilionGymTrashFailText (locks reset!) jr .done .openSecondLock ; Completed the trash can puzzle. - ld hl, $d773 + ld hl, wd773 set 0, [hl] - ld hl, $d126 + ld hl, wd126 set 6, [hl] ld a, $3d ; DisplayTextID $3d = VermilionGymTrashSuccesText3 (2nd lock opened!) diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm index 4bbaaa8a..5ccb43c2 100755 --- a/engine/hidden_object_functions18.asm +++ b/engine/hidden_object_functions18.asm @@ -3,7 +3,7 @@ GymStatues: ; 62419 (18:6419) ; if in a gym and don’t have the corresponding badge, a = $C and jp PrintPredefTextID ; else ret call EnableAutoTextBoxDrawing - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 ret nz ld hl, .BadgeFlags @@ -19,7 +19,7 @@ GymStatues: ; 62419 (18:6419) jr .asm_62429 ; 0x62431 $f6 .asm_62433 ld b, [hl] - ld a, [$d72a] + ld a, [wd72a] and b cp b ld a, $d @@ -64,7 +64,7 @@ PrintBenchGuyText: ; 6245d (18:645d) .asm_62472 ld a, [hli] ld b, a - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp b jr nz, .asm_62467 ld a, [hl] @@ -140,7 +140,7 @@ CinnabarIslandPokecenterBenchGuyText: ; 624df (18:64df) SaffronCityPokecenterBenchGuyText: ; 624e4 (18:64e4) db $8 ; asm - ld a, [$d838] + ld a, [wd838] bit 7, a ld hl, SaffronCityPokecenterBenchGuyText2 jr nz, .asm_624f2 ; 0x624ed $3 @@ -176,12 +176,12 @@ BookcaseText: ; 62511 (18:6511) db "@" OpenPokemonCenterPC: ; 62516 (18:6516) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 ; check to see if player is facing up ret nz call EnableAutoTextBoxDrawing ld a, $1 - ld [$cf0c], a + ld [wcf0c], a ld a, $1f ; PredefText1f jp PrintPredefTextID diff --git a/engine/hidden_object_functions3.asm b/engine/hidden_object_functions3.asm index d7f80d3d..e613df2e 100755 --- a/engine/hidden_object_functions3.asm +++ b/engine/hidden_object_functions3.asm @@ -1,12 +1,11 @@ ; prints text for bookshelves in buildings without sign events PrintBookshelfText: ; fb50 (3:7b50) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 jr nz, .asm_fb7f - ld a, [W_CURMAPTILESET] ; $d367 + ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET ld b, a - FuncCoord 8, 7 ; $c434 - ld a, [Coord] + aCoord 8, 7 ld c, a ld hl, BookshelfTileIDs ; $7b8b .asm_fb62 @@ -90,7 +89,7 @@ BookOrSculptureText: ; fbe8 (3:7be8) ld a, [W_CURMAPTILESET] cp MANSION ; Celadon Mansion tileset jr nz, .asm_fbfd - ld a, [$c420] + ld a, [wTileMap + $80] cp $38 jr nz, .asm_fbfd ld hl, DiglettSculptureText @@ -115,8 +114,8 @@ TownMapText: ; fc12 (3:7c12) db $06 db $08 ; asm ld a, $1 - ld [$cc3c], a - ld hl, $d730 + ld [wcc3c], a + ld hl, wd730 set 6, [hl] call GBPalWhiteOutWithDelay3 xor a @@ -125,7 +124,7 @@ TownMapText: ; fc12 (3:7c12) ld [H_AUTOBGTRANSFERENABLED], a call LoadFontTilePatterns callba DisplayTownMap - ld hl, $d730 + ld hl, wd730 res 6, [hl] ld de, TextScriptEnd push de diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 858d664f..848f6f3d 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -21,7 +21,7 @@ DisplayOakLabRightPoster: ; 1e965 (7:6965) ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits - ld a, [$d11e] + ld a, [wd11e] cp $2 ld a, $6 ; SaveOptionText jr c, .asm_1e97b @@ -38,29 +38,29 @@ StrengthsAndWeaknessesText: ; 1e983 (7:6983) db "@" SafariZoneCheck: ; 1e988 (7:6988) - ld hl, $d790 + ld hl, wd790 bit 7, [hl] jr z, asm_1e9ab - ld a, [W_NUMSAFARIBALLS] ; $da47 + ld a, [W_NUMSAFARIBALLS] ; W_NUMSAFARIBALLS and a jr z, asm_1e9b0 jr asm_1e9ab SafariZoneCheckSteps: ; 1e997 (7:6997) - ld a, [wSafariSteps] ; $d70d + ld a, [wSafariSteps] ; wd70d ld b, a - ld a, [wSafariSteps + 1] ; $d70e + ld a, [wSafariSteps + 1] ; wd70e ld c, a or b jr z, asm_1e9b0 dec bc ld a, b - ld [wSafariSteps], a ; $d70d + ld [wSafariSteps], a ; wd70d ld a, c - ld [wSafariSteps + 1], a ; $d70e + ld [wSafariSteps + 1], a ; wd70e asm_1e9ab: ; 1e9ab (7:69ab) xor a - ld [$da46], a + ld [wda46], a ret asm_1e9b0: ; 1e9b0 (7:69b0) call EnableAutoTextBoxDrawing @@ -72,35 +72,35 @@ asm_1e9b0: ; 1e9b0 (7:69b0) ld a, (SFX_02_5f - SFX_Headers_02) / 3 call PlayMusic .asm_1e9c2 - ld a, [$c02a] + ld a, [wc02a] cp $b9 jr nz, .asm_1e9c2 ld a, $d3 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID xor a - ld [$d528], a + ld [wd528], a ld a, $9c ld [H_DOWNARROWBLINKCNT1], a ; $ff8b ld a, $3 - ld [$d42f], a + ld [wd42f], a ld a, $5 ld [W_SAFARIZONEENTRANCECURSCRIPT], a - ld hl, $d790 + ld hl, wd790 set 6, [hl] ld a, $1 - ld [$da46], a + ld [wda46], a ret PrintSafariGameOverText: ; 1e9ed (7:69ed) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld hl, SafariGameOverText jp PrintText SafariGameOverText: ; 1e9f7 (7:69f7) db $08 ; asm - ld a, [W_NUMSAFARIBALLS] ; $da47 + ld a, [W_NUMSAFARIBALLS] ; W_NUMSAFARIBALLS and a jr z, .asm_1ea04 ld hl, TimesUpText @@ -119,7 +119,7 @@ GameOverText: ; 1ea12 (7:6a12) db "@" PrintCinnabarQuiz: ; 1ea17 (7:6a17) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 ret nz call EnableAutoTextBoxDrawing @@ -129,8 +129,8 @@ PrintCinnabarQuiz: ; 1ea17 (7:6a17) CinnabarGymQuiz: ; 1ea25 (7:6a25) db $08 ; asm xor a - ld [$da38], a - ld a, [wWhichTrade] ; $cd3d + ld [wda38], a + ld a, [wWhichTrade] ; wWhichTrade push af and $f ld [$ffdb], a @@ -152,7 +152,7 @@ CinnabarGymQuiz: ; 1ea25 (7:6a25) ld l, a call PrintText ld a, $1 - ld [$cc3c], a + ld [wcc3c], a call CinnabarGymQuiz_1ea92 jp TextScriptEnd @@ -193,18 +193,17 @@ CinnabarQuizQuestionsText6: ; 1ea85 (7:6a85) db "@" CinnabarGymQuiz_1ea8a: ; 1ea8a (7:6a8a) - ld hl, $d79c - ld a, $10 - jp Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + ld hl, wd79c + predef_jump FlagActionPredef CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) call YesNoChoice ld a, [$ffdc] ld c, a - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem cp c jr nz, .asm_1eab8 - ld hl, $d126 + ld hl, wd126 set 5, [hl] ld a, [$ffdb] ld [$ffe0], a @@ -226,15 +225,14 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) add $2 ld c, a ld b, $2 - ld hl, $d79a - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + ld hl, wd79a + predef FlagActionPredef ld a, c and a ret nz ld a, [$ffdb] add $2 - ld [$da38], a + ld [wda38], a ret CinnabarGymQuizCorrectText: ; 1eae3 (7:6ae3) @@ -276,7 +274,7 @@ CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a) ld c, a inc hl ld a, [hl] - ld [$d12f], a + ld [wd12f], a push bc ld a, [$ffdb] ld [$ffe0], a @@ -286,15 +284,14 @@ CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a) ld a, c and a jr nz, .asm_1eb36 - ld a, [$d12f] + ld a, [wd12f] jr .asm_1eb38 .asm_1eb36 ld a, $e .asm_1eb38 pop bc - ld [$d09f], a - ld a, $17 - call Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + ld [wd09f], a + predef Func_ee9e ld hl, $ffdb dec [hl] jr nz, .asm_1eb0e @@ -322,10 +319,10 @@ MagazinesText: ; 1eb69 (7:6b69) BillsHousePC: ; 1eb6e (7:6b6e) call EnableAutoTextBoxDrawing - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 ret nz - ld a, [$d7f2] + ld a, [wd7f2] bit 7, a jr nz, .asm_1ebd2 bit 3, a @@ -337,7 +334,7 @@ BillsHousePC: ; 1eb6e (7:6b6e) jp PrintPredefTextID .asm_1eb8b ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ld a, $2e call PrintPredefTextID ld c, $20 @@ -361,12 +358,12 @@ BillsHousePC: ; 1eb6e (7:6b6e) call PlaySound call WaitForSoundToFinish call Func_2307 - ld hl, $d7f2 + ld hl, wd7f2 set 3, [hl] ret .asm_1ebd2 ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ld a, $2f call PrintPredefTextID ret @@ -380,7 +377,7 @@ BillsHouseInitiatedText: ; 1ebe2 (7:6be2) db $06 db $08 ; asm ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound ld c, $10 call DelayFrames @@ -397,25 +394,25 @@ BillsHousePokemonList: ; 1ec05 (7:6c05) ld hl, BillsHousePokemonListText1 call PrintText xor a - ld [$d07c], a - ld [$cc26], a - ld [$cc2a], a + ld [W_ANIMATIONID], a + ld [wCurrentMenuItem], a + ld [wLastMenuItem], a ld a, $3 - ld [$cc29], a + ld [wMenuWatchedKeys], a ld a, $4 - ld [$cc28], a + ld [wMaxMenuItem], a ld a, $2 - ld [$cc24], a + ld [wTopMenuItemY], a ld a, $1 - ld [$cc25], a + ld [wTopMenuItemX], a .asm_1ec2d - ld hl, $d730 + ld hl, wd730 set 6, [hl] ld hl, wTileMap ld b, $a ld c, $9 call TextBoxBorder - ld hl, $c3ca + ld hl, wTileMap + $2a ld de, BillsMonListText call PlaceString ld hl, BillsHousePokemonListText2 @@ -424,7 +421,7 @@ BillsHousePokemonList: ; 1ec05 (7:6c05) call HandleMenuInput bit 1, a jr nz, .asm_1ec74 - ld a, [$cc26] + ld a, [wCurrentMenuItem] add EEVEE cp EEVEE jr z, .asm_1ec6c @@ -440,7 +437,7 @@ BillsHousePokemonList: ; 1ec05 (7:6c05) call LoadScreenTilesFromBuffer2 jr .asm_1ec2d .asm_1ec74 - ld hl, $d730 + ld hl, wd730 res 6, [hl] call LoadScreenTilesFromBuffer2 jp TextScriptEnd @@ -461,7 +458,7 @@ BillsHousePokemonListText2: ; 1ecaa (7:6caa) db "@" DisplayOakLabEmailText: ; 1ecaf (7:6caf) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 ret nz call EnableAutoTextBoxDrawing diff --git a/engine/hp_bar.asm b/engine/hp_bar.asm index 8ba52247..9ff9e3cf 100755 --- a/engine/hp_bar.asm +++ b/engine/hp_bar.asm @@ -1,9 +1,9 @@ -UpdateHPBar_LoadRegisters: ; f9dc (3:79dc) - call Load16BitRegisters +HPBarLength: ; f9dc (3:79dc) + call GetPredefRegisters ; calculates bc * 48 / de, the number of pixels the HP bar has ; the result is always at least 1 -UpdateHPBar_CalcNumberOfHPBarPixels: ; f9df (3:79df) +GetHPBarLength: ; f9df (3:79df) push hl xor a ld hl, H_MULTIPLICAND @@ -46,6 +46,7 @@ UpdateHPBar_CalcNumberOfHPBarPixels: ; f9df (3:79df) ; predef $48 UpdateHPBar: ; fa1d (3:7a1d) +UpdateHPBar2: push hl ld hl, wHPBarOldHP ld a, [hli] @@ -72,7 +73,7 @@ UpdateHPBar: ; fa1d (3:7a1d) ld a, $1 .HPdecrease ld [wHPBarDelta], a - call Load16BitRegisters + call GetPredefRegisters ld a, [wHPBarNewHP] ld e, a ld a, [wHPBarNewHP+1] @@ -202,13 +203,13 @@ UpdateHPBar_CalcHPDifference: ; fad7 (3:7ad7) UpdateHPBar_PrintHPNumber: ; faf5 (3:7af5) push af push de - ld a, [wListMenuID] ; $cf94 + ld a, [wListMenuID] ; wListMenuID and a jr z, .asm_fb2d ld a, [wHPBarOldHP] - ld [$cef1], a + ld [wcef1], a ld a, [wHPBarOldHP+1] - ld [$cef0], a + ld [wcef0], a push hl ld a, [$fff6] bit 0, a @@ -225,7 +226,7 @@ UpdateHPBar_PrintHPNumber: ; faf5 (3:7af5) ld [hli], a ld [hli], a pop hl - ld de, $cef0 + ld de, wcef0 ld bc, $203 call PrintNumber call DelayFrame @@ -254,12 +255,12 @@ UpdateHPBar_CalcOldNewHPBarPixels: ; fb30 (3:7b30) ld l, a push hl push de - call UpdateHPBar_CalcNumberOfHPBarPixels ; calc num pixels for old HP + call GetHPBarLength ; calc num pixels for old HP ld a, e pop de pop bc push af - call UpdateHPBar_CalcNumberOfHPBarPixels ; calc num pixels for new HP + call GetHPBarLength ; calc num pixels for new HP pop af ld d, e ld e, a diff --git a/engine/in_game_trades.asm b/engine/in_game_trades.asm index ebde5855..7f0b21c1 100755 --- a/engine/in_game_trades.asm +++ b/engine/in_game_trades.asm @@ -11,12 +11,12 @@ Predef54: ; 71ad9 (1c:5ad9) ld b,$0 add hl,bc ld a,[hli] - ld [$cd0f],a + ld [wcd0f],a ld a,[hli] - ld [$cd34],a + ld [wcd34],a ld a,[hli] push af - ld de,$cd29 + ld de,wcd29 ld bc,$000b call CopyData pop af @@ -26,33 +26,32 @@ Predef54: ; 71ad9 (1c:5ad9) add hl,hl add hl,de ld a,[hli] - ld [$cd10],a + ld [wcd10],a ld a,[hl] - ld [$cd11],a - ld a,[$cd0f] - ld de,$cd13 + ld [wcd11],a + ld a,[wcd0f] + ld de,wcd13 call Func_71b6a - ld a,[$cd34] - ld de,$cd1e + ld a,[wcd34] + ld de,wPlayerMonAccuracyMod call Func_71b6a - ld hl,$d737 + ld hl,wd737 ld a,[wWhichTrade] ld c,a ld b,$2 - ld a,$10 - call Predef + predef FlagActionPredef ld a,c and a ld a,$4 - ld [$cd12],a + ld [wcd12],a jr nz,.asm_99bca ; 0x71b36 $20 xor a - ld [$cd12],a + ld [wcd12],a call .asm_99bca ld a,$1 - ld [$cd12],a + ld [wcd12],a call YesNoChoice - ld a,[$cc26] + ld a,[wCurrentMenuItem] and a jr nz,.asm_99bca ; 0x71b4b $b call Func_71c07 @@ -60,7 +59,7 @@ Predef54: ; 71ad9 (1c:5ad9) ld hl, TradedForText call PrintText .asm_99bca ; 0x71b58 - ld hl,$cd12 + ld hl,wcd12 ld a,[hld] ld e,a ld d,$0 @@ -76,9 +75,9 @@ Predef54: ; 71ad9 (1c:5ad9) Func_71b6a: ; 71b6a (1c:5b6a) push de - ld [$d11e],a + ld [wd11e],a call GetMonName - ld hl,$cd6d + ld hl,wcd6d pop de ld bc,$b jp CopyData @@ -87,56 +86,54 @@ INCLUDE "data/trades.asm" Func_71c07: ; 71c07 (1c:5c07) xor a - ld [$d07d],a + ld [wd07d],a dec a - ld [$cfcb],a + ld [wcfcb],a call DisplayPartyMenu push af call Func_71ca2 pop af ld a,$1 jp c,.asm_c4bc2 - ld a,[$cd0f] + ld a,[wcd0f] ld b,a - ld a,[$cf91] + ld a,[wcf91] cp b ld a,$2 jr nz,.asm_c4bc2 ; 0x71c26 $75 ld a,[wWhichPokemon] - ld hl,$d18c + ld hl,wPartyMon1Level ld bc,$002c call AddNTimes ld a,[hl] - ld [$d127],a - ld hl,$d737 + ld [W_CURENEMYLVL],a + ld hl,wd737 ld a,[wWhichTrade] ld c,a ld b,$1 - ld a,$10 - call Predef + predef FlagActionPredef ld hl, ConnectCableText call PrintText ld a,[wWhichPokemon] push af - ld a,[$d127] + ld a,[W_CURENEMYLVL] push af call LoadHpBarAndStatusTilePatterns call Func_71cc1 - ld a,$38 - call Predef + predef Func_410e2 pop af - ld [$d127],a + ld [W_CURENEMYLVL],a pop af ld [wWhichPokemon],a - ld a,[$cd34] - ld [$cf91],a + ld a,[wcd34] + ld [wcf91],a xor a - ld [$cc49],a - ld [$cf95],a + ld [wcc49],a + ld [wcf95],a call RemovePokemon ld a,$80 - ld [$cc49],a - call AddPokemonToParty + ld [wcc49],a + call AddPartyMon call Func_71d19 callab EvolveTradeMon call ClearScreen @@ -148,7 +145,7 @@ Func_71c07: ; 71c07 (1c:5c07) .asm_c4bc2 ; 0x71c9d scf .asm_ee803 ; 0x71c9e - ld [$cd12],a + ld [wcd12],a ret Func_71ca2: ; 71ca2 (1c:5ca2) @@ -165,33 +162,33 @@ Func_71ca2: ; 71ca2 (1c:5ca2) jp Bankswitch Func_71cc1: ; 71cc1 (1c:5cc1) - ld hl, wWhichTrade ; $cd3d - ld a, [$cd0f] + ld hl, wWhichTrade ; wWhichTrade + ld a, [wcd0f] ld [hli], a - ld a, [$cd34] + ld a, [wcd34] ld [hl], a - ld hl, W_PARTYMON1OT ; $d273 + ld hl, wPartyMonOT ; wd273 ld bc, $b - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon call AddNTimes - ld de, $cd41 + ld de, wTrainerScreenX ld bc, $b call Func_71d11 ld hl, String_71d59 ; $5d59 - ld de, $cd4e + ld de, wcd4e call Func_71d11 - ld de, W_GRASSRATE ; $d887 + ld de, W_GRASSRATE ; W_GRASSRATE call Func_71d11 - ld hl, W_PARTYMON1_OTID ; $d177 + ld hl, wPartyMon1OTID ; wPartyMon1OTID ld bc, $2c - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon call AddNTimes - ld de, $cd4c + ld de, wcd4c ld bc, $2 call Func_71d11 - call GenRandom - ld hl, H_RAND1 ; $ffd3 - ld de, $cd59 + call Random + ld hl, hRandomAdd + ld de, wcd59 jp CopyData Func_71d11: ; 71d11 (1c:5d11) @@ -203,27 +200,27 @@ Func_71d11: ; 71d11 (1c:5d11) ret Func_71d19: ; 71d19 (1c:5d19) - ld hl, W_PARTYMON1NAME ; $d2b5 + ld hl, wPartyMonNicks ; wPartyMonNicks ld bc, $b call Func_71d4f - ld hl, $cd29 + ld hl, wcd29 ld bc, $b call CopyData - ld hl, W_PARTYMON1OT ; $d273 + ld hl, wPartyMonOT ; wd273 ld bc, $b call Func_71d4f ld hl, String_71d59 ; $5d59 ld bc, $b call CopyData - ld hl, W_PARTYMON1_OTID ; $d177 + ld hl, wPartyMon1OTID ; wPartyMon1OTID ld bc, $2c call Func_71d4f - ld hl, $cd59 + ld hl, wcd59 ld bc, $2 jp CopyData Func_71d4f: ; 71d4f (1c:5d4f) - ld a, [W_NUMINPARTY] ; $d163 + ld a, [wPartyCount] ; wPartyCount dec a call AddNTimes ld e, l diff --git a/engine/intro.asm b/engine/intro.asm index 89c344db..801324a5 100755 --- a/engine/intro.asm +++ b/engine/intro.asm @@ -1,6 +1,6 @@ PlayIntro: ; 41682 (10:5682) xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a inc a ld [H_AUTOBGTRANSFERENABLED], a call PlayShootingStar @@ -9,7 +9,7 @@ PlayIntro: ; 41682 (10:5682) xor a ld [$ffae], a ld [H_AUTOBGTRANSFERENABLED], a - call CleanLCD_OAM + call ClearSprites call DelayFrame ret @@ -38,7 +38,7 @@ PlayIntroScene: ; 4169d (10:569d) ld a, (SFX_1f_5f - SFX_Headers_1f) / 3 call PlaySound xor a - ld [$d09f], a + ld [wd09f], a ld de, IntroNidorinoAnimation1 call AnimateIntroNidorino ; hop @@ -86,7 +86,7 @@ PlayIntroScene: ; 4169d (10:569d) ld a, (SFX_1f_5f - SFX_Headers_1f) / 3 call PlaySound ld a, $24 - ld [$d09f], a + ld [wd09f], a ld de, IntroNidorinoAnimation3 call AnimateIntroNidorino ld c, $1e @@ -105,7 +105,7 @@ PlayIntroScene: ; 4169d (10:569d) ld a, (SFX_1f_5f - SFX_Headers_1f) / 3 call PlaySound xor a - ld [$d09f], a + ld [wd09f], a ld de, IntroNidorinoAnimation4 ; $5931 call AnimateIntroNidorino ; hop @@ -118,7 +118,7 @@ PlayIntroScene: ; 4169d (10:569d) ret c ld a, $24 - ld [$d09f], a + ld [wd09f], a ld de, IntroNidorinoAnimation6 ; $5947 call AnimateIntroNidorino ld c, $1e @@ -129,7 +129,7 @@ PlayIntroScene: ; 4169d (10:569d) ld a, (SFX_1f_5e - SFX_Headers_1f) / 3 call PlaySound ld a, $48 - ld [$d09f], a + ld [wd09f], a ld de, IntroNidorinoAnimation7 ; $5950 jp AnimateIntroNidorino @@ -137,10 +137,10 @@ AnimateIntroNidorino: ; 41793 (10:5793) ld a, [de] cp $50 ret z - ld [W_BASECOORDY], a ; $d082 + ld [W_BASECOORDY], a ; wd082 inc de ld a, [de] - ld [W_BASECOORDX], a ; $d081 + ld [W_BASECOORDX], a ; wd081 push de ld c, $24 call Func_417ae @@ -152,13 +152,13 @@ AnimateIntroNidorino: ; 41793 (10:5793) Func_417ae: ; 417ae (10:57ae) ld hl, wOAMBuffer - ld a, [$d09f] + ld a, [wd09f] ld d, a .asm_417b5 - ld a, [W_BASECOORDY] ; $d082 + ld a, [W_BASECOORDY] ; wd082 add [hl] ld [hli], a - ld a, [W_BASECOORDX] ; $d081 + ld a, [W_BASECOORDX] ; wd081 add [hl] ld [hli], a ld a, d @@ -174,14 +174,14 @@ Func_417c7: ; 417c7 (10:57c7) ld d, $0 .asm_417cc push bc - ld a, [W_BASECOORDY] ; $d082 + ld a, [W_BASECOORDY] ; wd082 ld e, a .asm_417d1 ld a, e add $8 ld e, a ld [hli], a - ld a, [W_BASECOORDX] ; $d081 + ld a, [W_BASECOORDX] ; wd081 ld [hli], a ld a, d ld [hli], a @@ -190,22 +190,21 @@ Func_417c7: ; 417c7 (10:57c7) inc d dec c jr nz, .asm_417d1 - ld a, [W_BASECOORDX] ; $d081 + ld a, [W_BASECOORDX] ; wd081 add $8 - ld [W_BASECOORDX], a ; $d081 + ld [W_BASECOORDX], a ; wd081 pop bc dec b jr nz, .asm_417cc ret Func_417f0: ; 417f0 (10:57f0) - ld hl, $9c00 + ld hl, vBGMap1 ld bc, $240 jr asm_417fe Func_417f8: ; 417f8 (10:57f8) - FuncCoord 0, 4 ; $c3f0 - ld hl, Coord + hlCoord 0, 4 ld bc, $c8 asm_417fe: ; 417fe (10:57fe) ld [hl], $0 @@ -237,9 +236,9 @@ Func_4180e: ; 4180e (10:580e) .asm_4181d push de ld a, $2 - ld [W_BASECOORDX], a ; $d081 + ld [W_BASECOORDX], a ; wd081 xor a - ld [W_BASECOORDY], a ; $d082 + ld [W_BASECOORDY], a ; wd082 ld c, $24 call Func_417ae pop de @@ -259,38 +258,35 @@ Func_4180e: ; 4180e (10:580e) ret Func_4183f: ; 4183f (10:583f) - FuncCoord 13, 7 ; $c439 - ld hl, Coord + hlCoord 13, 7 Func_41842: ; 41842 (10:5842) ld c, $0 - ld a, $31 - jp Predef ; indirect jump to Func_79dda + predef_jump Func_79dda Func_41849: ; 41849 (10:5849) - ld a, $33 - call Predef ; indirect jump to Func_79869 + predef Func_79869 ld a, b jp PlaySound LoadIntroGraphics: ; 41852 (10:5852) ld hl, FightIntroBackMon ; $5a99 - ld de, $9000 + ld de, vChars2 ld bc, $600 ld a, BANK(FightIntroBackMon) call FarCopyData2 ld hl, GameFreakIntro ; $5959 - ld de, $9600 + ld de, vChars2 + $600 ld bc, $140 ld a, BANK(GameFreakIntro) call FarCopyData2 ld hl, GameFreakIntro ; $5959 - ld de, $8800 + ld de, vChars1 ld bc, $140 ld a, BANK(GameFreakIntro) call FarCopyData2 ld hl, FightIntroFrontMon ; $6099 - ld de, $8000 + ld de, vChars0 ld bc, $6c0 ld a, BANK(FightIntroFrontMon) jp FarCopyData2 @@ -306,7 +302,7 @@ PlayShootingStar: ; 4188a (10:588a) call ClearScreen call DisableLCD xor a - ld [W_CUROPPONENT], a ; $d059 + ld [W_CUROPPONENT], a ; wd059 call Func_418e9 call LoadIntroGraphics call EnableLCD @@ -322,14 +318,14 @@ PlayShootingStar: ; 4188a (10:588a) ld c, $28 call DelayFrames .asm_418d0 - ld a, Bank(Func_7d8ea) - ld [$c0ef], a - ld [$c0f0], a + ld a, BANK(Music_IntroBattle) + ld [wc0ef], a + ld [wc0f0], a ld a, MUSIC_INTRO_BATTLE - ld [$c0ee], a + ld [wc0ee], a call PlaySound call Func_417f8 - call CleanLCD_OAM + call ClearSprites jp Delay3 Func_418e9: ; 418e9 (10:58e9) @@ -337,14 +333,13 @@ Func_418e9: ; 418e9 (10:58e9) ld hl, wTileMap ld c, $50 call Func_41807 - FuncCoord 0, 14 ; $c4b8 - ld hl, Coord + hlCoord 0, 14 ld c, $50 call Func_41807 - ld hl, $9c00 + ld hl, vBGMap1 ld c, $80 call Func_41807 - ld hl, $9dc0 + ld hl, vBGMap1 + $1c0 ld c, $80 jp Func_41807 @@ -425,7 +420,7 @@ IntroNidorinoAnimation7: ; 41950 (10:5950) db $50 ; list terminator GameFreakIntro: ; 41959 (10:5959) - INCBIN "gfx/gamefreak_intro.h8.2bpp" + INCBIN "gfx/gamefreak_intro.2bpp" INCBIN "gfx/gamefreak_logo.2bpp" ds $10 ; blank tile diff --git a/engine/items/itemfinder.asm b/engine/items/itemfinder.asm index 4ec2a23f..d7e5b3ce 100755 --- a/engine/items/itemfinder.asm +++ b/engine/items/itemfinder.asm @@ -4,15 +4,14 @@ HiddenItemNear: ; 7481f (1d:481f) .asm_74824 ld de, $0003 ld a, [W_CURMAP] - call IsInArrayCummulativeCount + call IsInRestOfArray ret nc ; return if current map has no hidden items push bc push hl - ld hl, $d6f0 + ld hl, wd6f0 ld c, b ld b, $2 - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + predef FlagActionPredef ld a, c pop hl pop bc diff --git a/engine/items/items.asm b/engine/items/items.asm index e7f9cbe6..830f0dfc 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -1,7 +1,7 @@ UseItem_: ; d5c7 (3:55c7) ld a,1 - ld [$cd6a],a - ld a,[$cf91] ;contains item_ID + ld [wcd6a],a + ld a,[wcf91] ;contains item_ID cp a,HM_01 jp nc,ItemUseTMHM ld hl,ItemUsePtrTable @@ -109,7 +109,7 @@ ItemUseBall: ; d687 (3:5687) ld a,[W_BATTLETYPE] dec a jr z,.UseBall - ld a,[W_NUMINPARTY] ;is Party full? + ld a,[wPartyCount] ;is Party full? cp a,6 jr nz,.UseBall ld a,[W_NUMINBOX] ;is Box full? @@ -118,7 +118,7 @@ ItemUseBall: ; d687 (3:5687) .UseBall ;$56a7 ;ok, you can use a ball xor a - ld [$d11c],a + ld [wd11c],a ld a,[W_BATTLETYPE] cp a,2 ;SafariBattle jr nz,.skipSafariZoneCode @@ -129,7 +129,7 @@ ItemUseBall: ; d687 (3:5687) .skipSafariZoneCode ;$56b6 call GoPAL_SET_CF1C ld a,$43 - ld [$d11e],a + ld [wd11e],a call LoadScreenTilesFromBuffer1 ;restore screenBuffer from Backup ld hl,ItemUseText00 call PrintText @@ -141,7 +141,7 @@ ItemUseBall: ; d687 (3:5687) jr nz,.notOldManBattle .oldManBattle ld hl,W_GRASSRATE - ld de,W_PLAYERNAME + ld de,wPlayerName ld bc,11 call CopyData ; save the player's name in the Wild Monster data (part of the Cinnabar Island Missingno glitch) jp .BallSuccess ;$578b @@ -149,16 +149,16 @@ ItemUseBall: ; d687 (3:5687) ld a,[W_CURMAP] cp a,POKEMONTOWER_6 jr nz,.loop - ld a,[W_ENEMYMONID] + ld a,[wEnemyMonSpecies2] cp a,MAROWAK ld b,$10 jp z,.next12 ; if not fighting ghost Marowak, loop until a random number in the current ; pokeball's allowed range is found .loop ;$56fa - call GenRandom + call Random ld b,a - ld hl,$cf91 + ld hl,wcf91 ld a,[hl] cp a,MASTER_BALL jp z,.BallSuccess ;$578b @@ -178,7 +178,7 @@ ItemUseBall: ; d687 (3:5687) ; Frozen/Asleep pokemon are relatively even easier to catch ; for Frozen/Asleep pokemon, any random number from 0-24 ensures a catch. ; for the others, a random number from 0-11 ensures a catch. - ld a,[W_ENEMYMONSTATUS] ;status ailments + ld a,[wEnemyMonStatus] ;status ailments and a jr z,.noAilments and a, 1 << FRZ | SLP ;is frozen and/or asleep? @@ -194,7 +194,7 @@ ItemUseBall: ; d687 (3:5687) push bc ;save RANDOM number xor a ld [H_MULTIPLICAND],a - ld hl,W_ENEMYMONMAXHP + ld hl,wEnemyMonMaxHP ld a,[hli] ld [H_MULTIPLICAND + 1],a ld a,[hl] @@ -202,7 +202,7 @@ ItemUseBall: ; d687 (3:5687) ld a,255 ld [H_MULTIPLIER],a call Multiply ; MaxHP * 255 - ld a,[$cf91] + ld a,[wcf91] cp a,GREAT_BALL ld a,12 ;any other BallFactor jr nz,.next7 @@ -211,7 +211,7 @@ ItemUseBall: ; d687 (3:5687) ld [H_DIVISOR],a ld b,4 ; number of bytes in dividend call Divide - ld hl,W_ENEMYMONCURHP + ld hl,wEnemyMonHP ld a,[hli] ld b,a ld a,[hl] @@ -237,13 +237,13 @@ ItemUseBall: ; d687 (3:5687) ld [H_QUOTIENT + 3],a .next9 ;$5776 pop bc - ld a,[$d007] ;enemy: Catch Rate + ld a,[wd007] ;enemy: Catch Rate cp b jr c,.next10 ld a,[H_QUOTIENT + 2] and a jr nz,.BallSuccess ; if ((MaxHP * 255) / BallFactor) / (CurHP / 4) > 0x255, automatic success - call GenRandom + call Random ld b,a ld a,[H_QUOTIENT + 3] cp b @@ -252,16 +252,16 @@ ItemUseBall: ; d687 (3:5687) jr .BallSuccess2 .next10 ;$578d ld a,[H_QUOTIENT + 3] - ld [$d11e],a + ld [wd11e],a xor a ld [H_MULTIPLICAND],a ld [H_MULTIPLICAND + 1],a - ld a,[$d007] ;enemy: Catch Rate + ld a,[wd007] ;enemy: Catch Rate ld [H_MULTIPLICAND + 2],a ld a,100 ld [H_MULTIPLIER],a call Multiply ; CatchRate * 100 - ld a,[$cf91] + ld a,[wcf91] ld b,255 cp a,POKE_BALL jr z,.next11 @@ -280,14 +280,14 @@ ItemUseBall: ; d687 (3:5687) and a ld b,$63 jr nz,.next12 - ld a,[$d11e] + ld a,[wd11e] ld [H_MULTIPLIER],a call Multiply ld a,255 ld [H_DIVISOR],a ld b,4 call Divide - ld a,[W_ENEMYMONSTATUS] ;status ailments + ld a,[wEnemyMonStatus] ;status ailments and a jr z,.next13 and a, 1 << FRZ | SLP @@ -312,7 +312,7 @@ ItemUseBall: ; d687 (3:5687) ld b,$63 .next12 ;$5801 ld a,b - ld [$d11e],a + ld [wd11e],a .BallSuccess2 ;$5805 ld c,20 call DelayFrames @@ -320,19 +320,18 @@ ItemUseBall: ; d687 (3:5687) ld [W_ANIMATIONID],a xor a ld [$fff3],a - ld [$cc5b],a - ld [$d05b],a + ld [wcc5b],a + ld [wd05b],a ld a,[wWhichPokemon] push af - ld a,[$cf91] + ld a,[wcf91] push af - ld a,$08 ;probably animations - call Predef + predef MoveAnimation pop af - ld [$cf91],a + ld [wcf91],a pop af ld [wWhichPokemon],a - ld a,[$d11e] + ld a,[wd11e] cp a,$10 ld hl,ItemUseBallText00 jp z,.printText0 @@ -348,7 +347,7 @@ ItemUseBall: ; d687 (3:5687) cp a,$63 ld hl,ItemUseBallText04 jp z,.printText0 - ld hl,$cfe6 ;current HP + ld hl,wEnemyMonHP ;current HP ld a,[hli] push af ld a,[hli] @@ -357,29 +356,29 @@ ItemUseBall: ; d687 (3:5687) ld a,[hl] push af ;...and status ailments push hl - ld hl,$d069 + ld hl,W_ENEMYBATTSTATUS3 bit 3,[hl] jr z,.next15 ld a,$4c - ld [W_ENEMYMONID],a + ld [wEnemyMonSpecies2],a jr .next16 .next15 ;$5871 set 3,[hl] - ld hl,$cceb - ld a,[$cff1] + ld hl,wcceb + ld a,[wEnemyMonDVs] ld [hli],a - ld a,[$cff2] + ld a,[wEnemyMonDVs + 1] ld [hl],a .next16 ;$587e - ld a,[$cf91] + ld a,[wcf91] push af - ld a,[W_ENEMYMONID] - ld [$cf91],a - ld a,[$cff3] - ld [$d127],a + ld a,[wEnemyMonSpecies2] + ld [wcf91],a + ld a,[wEnemyMonLevel] + ld [W_CURENEMYLVL],a callab Func_3eb01 pop af - ld [$cf91],a + ld [wcf91],a pop hl pop af ld [hld],a @@ -388,56 +387,52 @@ ItemUseBall: ; d687 (3:5687) ld [hld],a pop af ld [hl],a - ld a,[$cfe5] ;enemy - ld [$d11c],a - ld [$cf91],a - ld [$d11e],a + ld a,[wEnemyMonSpecies] ;enemy + ld [wd11c],a + ld [wcf91],a + ld [wd11e],a ld a,[W_BATTLETYPE] dec a jr z,.printText1 ld hl,ItemUseBallText05 call PrintText - ld a,$3a ;convert order: Internal->Dex - call Predef - ld a,[$d11e] + predef IndexToPokedex + ld a,[wd11e] dec a ld c,a ld b,2 ld hl,wPokedexOwned ;Dex_own_flags (pokemon) - ld a,$10 - call Predef ;check Dex flag (own already or not) + predef FlagActionPredef ld a,c push af - ld a,[$d11e] + ld a,[wd11e] dec a ld c,a ld b,1 - ld a,$10 ;set Dex_own_flag? - call Predef + predef FlagActionPredef pop af and a jr nz,.checkParty ld hl,ItemUseBallText06 call PrintText - call CleanLCD_OAM - ld a,[$cfe5] ;caught mon_ID - ld [$d11e],a - ld a,$3d - call Predef + call ClearSprites + ld a,[wEnemyMonSpecies] ;caught mon_ID + ld [wd11e],a + predef ShowPokedexData .checkParty ;$58f4 - ld a,[W_NUMINPARTY] + ld a,[wPartyCount] cp a,6 ;is party full? jr z,.sendToBox xor a - ld [$cc49],a - call CleanLCD_OAM - call AddPokemonToParty ;add mon to Party + ld [wcc49],a + call ClearSprites + call AddPartyMon ;add mon to Party jr .End .sendToBox ;$5907 - call CleanLCD_OAM + call ClearSprites call Func_e7a4 ld hl,ItemUseBallText07 - ld a,[$d7f1] + ld a,[wd7f1] bit 0,a ;already met Bill? jr nz,.sendToBox2 ld hl,ItemUseBallText08 @@ -448,14 +443,14 @@ ItemUseBall: ; d687 (3:5687) ld hl,ItemUseBallText05 .printText0 ;$5922 call PrintText - call CleanLCD_OAM + call ClearSprites .End ;$5928 ld a,[W_BATTLETYPE] and a ret nz - ld hl,$d31d + ld hl,wNumBagItems inc a - ld [$cf96],a + ld [wcf96],a jp RemoveItemFromInventory ;remove ITEM (XXX) ItemUseBallText00: ; d937 (3:5937) ;"It dodged the thrown ball!" @@ -512,8 +507,8 @@ ItemUseBicycle: ; d977 (3:5977) ld a,[W_ISINBATTLE] and a jp nz,ItemUseNotTime - ld a,[$d700] - ld [$d11a],a + ld a,[wd700] + ld [wd11a],a cp a,2 ; is the player surfing? jp z,ItemUseNotTime dec a ; is player already bicycling? @@ -521,7 +516,7 @@ ItemUseBicycle: ; d977 (3:5977) .getOffBike call ItemUseReloadOverworldData xor a - ld [$d700],a ; change player state to walking + ld [wd700],a ; change player state to walking call Func_2307 ; play walking music ld hl,GotOffBicycleText jr .printText @@ -530,9 +525,9 @@ ItemUseBicycle: ; d977 (3:5977) jp nc,NoCyclingAllowedHere call ItemUseReloadOverworldData xor a ; no keys pressed - ld [H_CURRENTPRESSEDBUTTONS],a ; current joypad state + ld [hJoyHeld],a ; current joypad state inc a - ld [$d700],a ; change player state to bicycling + ld [wd700],a ; change player state to bicycling ld hl,GotOnBicycleText call Func_2307 ; play bike riding music .printText @@ -540,8 +535,8 @@ ItemUseBicycle: ; d977 (3:5977) ; used for Surf out-of-battle effect ItemUseSurfboard: ; d9b4 (3:59b4) - ld a,[$d700] - ld [$d11a],a + ld a,[wd700] + ld [wd11a],a cp a,2 ; is the player already surfing? jr z,.tryToStopSurfing .tryToSurf @@ -552,10 +547,10 @@ ItemUseSurfboard: ; d9b4 (3:59b4) jp c,SurfingAttemptFailed .surf call .makePlayerMoveForward - ld hl,$d730 + ld hl,wd730 set 7,[hl] ld a,2 - ld [$d700],a ; change player state to surfing + ld [wd700],a ; change player state to surfing call Func_2307 ; play surfing music ld hl,SurfingGotOnText jp PrintText @@ -571,11 +566,11 @@ ItemUseSurfboard: ; d9b4 (3:59b4) ld hl,TilePairCollisionsWater call CheckForTilePairCollisions jr c,.cannotStopSurfing - ld hl,$d530 ; pointer to list of passable tiles + ld hl,W_TILESETCOLLISIONPTR ; pointer to list of passable tiles ld a,[hli] ld h,[hl] ld l,a ; hl now points to passable tiles - ld a,[$cfc6] ; tile in front of the player + ld a,[wcfc6] ; tile in front of the player ld b,a .passableTileLoop ld a,[hli] @@ -588,17 +583,17 @@ ItemUseSurfboard: ; d9b4 (3:59b4) jp PrintText .stopSurfing call .makePlayerMoveForward - ld hl,$d730 + ld hl,wd730 set 7,[hl] xor a - ld [$d700],a ; change player state to walking + ld [wd700],a ; change player state to walking dec a - ld [wJoypadForbiddenButtonsMask],a + ld [wJoyIgnore],a call Func_2307 ; play walking music jp LoadWalkingPlayerSpriteGraphics ; uses a simulated button press to make the player move forward .makePlayerMoveForward - ld a,[$d52a] ; direction the player is going + ld a,[wd52a] ; direction the player is going bit 3,a ld b,%01000000 ; Up key jr nz,.storeSimulatedButtonPress @@ -611,11 +606,11 @@ ItemUseSurfboard: ; d9b4 (3:59b4) ld b,%00010000 ; Right key .storeSimulatedButtonPress ld a,b - ld [$ccd3],a ; base address of simulated button presses + ld [wccd3],a ; base address of simulated button presses xor a - ld [$cd39],a + ld [wcd39],a inc a - ld [$cd38],a ; index of current simulated button press + ld [wcd38],a ; index of current simulated button press ret SurfingGotOnText: ; da4c (3:5a4c) @@ -627,8 +622,7 @@ SurfingNoPlaceToGetOffText: ; da51 (3:5a51) db "@" ItemUsePokedex: ; da56 (3:5a56) - ld a,$29 - jp Predef + predef_jump ShowPokedexMenu ItemUseEvoStone: ; da5b (3:5a5b) ld a,[W_ISINBATTLE] @@ -636,38 +630,38 @@ ItemUseEvoStone: ; da5b (3:5a5b) jp nz,ItemUseNotTime ld a,[wWhichPokemon] push af - ld a,[$cf91] - ld [$d156],a + ld a,[wcf91] + ld [wd156],a push af ld a,$05 ; evolution stone party menu - ld [$d07d],a + ld [wd07d],a ld a,$ff - ld [$cfcb],a + ld [wcfcb],a call DisplayPartyMenu pop bc jr c,.canceledItemUse ld a,b - ld [$cf91],a + ld [wcf91],a ld a,$01 - ld [$ccd4],a + ld [wccd4],a ld a,(SFX_02_3e - SFX_Headers_02) / 3 call PlaySoundWaitForCurrent ; play sound call WaitForSoundToFinish ; wait for sound to end callab Func_3ad0e ; try to evolve pokemon - ld a,[$d121] + ld a,[wd121] and a jr z,.noEffect pop af ld [wWhichPokemon],a ld hl,wNumBagItems ld a,1 ; remove 1 stone - ld [$cf96],a + ld [wcf96],a jp RemoveItemFromInventory .noEffect call ItemUseNoEffect .canceledItemUse xor a - ld [$cd6a],a + ld [wcd6a],a pop af ret @@ -677,18 +671,18 @@ ItemUseVitamin: ; dab4 (3:5ab4) jp nz,ItemUseNotTime ItemUseMedicine: ; dabb (3:5abb) - ld a,[W_NUMINPARTY] + ld a,[wPartyCount] and a jp z,.emptyParty ld a,[wWhichPokemon] push af - ld a,[$cf91] + ld a,[wcf91] push af ld a,$01 - ld [$d07d],a ; item use party menu + ld [wd07d],a ; item use party menu ld a,$ff - ld [$cfcb],a - ld a,[$d152] + ld [wcfcb],a + ld a,[wd152] and a ; using Softboiled? jr z,.notUsingSoftboiled ; if using softboiled @@ -697,7 +691,7 @@ ItemUseMedicine: ; dabb (3:5abb) .emptyParty ld hl,.emptyPartyText xor a - ld [$cd6a],a ; item use failed + ld [wcd6a],a ; item use failed jp PrintText .emptyPartyText text "You don't have" @@ -707,21 +701,21 @@ ItemUseMedicine: ; dabb (3:5abb) call DisplayPartyMenu .getPartyMonDataAddress jp c,.canceledItemUse - ld hl,W_PARTYMON1DATA - ld bc,44 + ld hl,wPartyMons + ld bc,wPartyMon2 - wPartyMon1 ld a,[wWhichPokemon] call AddNTimes ld a,[wWhichPokemon] - ld [$cf06],a + ld [wcf06],a ld d,a - ld a,[$cf91] + ld a,[wcf91] ld e,a - ld [$d0b5],a + ld [wd0b5],a pop af - ld [$cf91],a + ld [wcf91],a pop af ld [wWhichPokemon],a - ld a,[$d152] + ld a,[wd152] and a ; using Softboiled? jr z,.checkItemType ; if using softboiled @@ -729,7 +723,7 @@ ItemUseMedicine: ; dabb (3:5abb) cp d ; is the pokemon trying to use softboiled on itself? jr z,ItemUseMedicine ; if so, force another choice .checkItemType - ld a,[$cf91] + ld a,[wcf91] cp a,REVIVE jr nc,.healHP ; if it's a Revive or Max Revive cp a,FULL_HEAL @@ -742,7 +736,7 @@ ItemUseMedicine: ; dabb (3:5abb) .cureStatusAilment ld bc,4 add hl,bc ; hl now points to status - ld a,[$cf91] + ld a,[wcf91] ld bc,$f008 cp a,ANTIDOTE jr z,.checkMonStatus @@ -767,24 +761,23 @@ ItemUseMedicine: ; dabb (3:5abb) xor a ld [hl],a ; remove the status ailment in the party data ld a,b - ld [$d07d],a ; the message to display for the item used + ld [wd07d],a ; the message to display for the item used ld a,[wPlayerMonNumber] cp d ; is pokemon the item was used on active in battle? jp nz,.doneHealing ; if it is active in battle xor a - ld [W_PLAYERMONSTATUS],a ; remove the status ailment in the in-battle pokemon data + ld [wBattleMonStatus],a ; remove the status ailment in the in-battle pokemon data push hl ld hl,W_PLAYERBATTSTATUS3 res 0,[hl] ; heal Toxic status pop hl ld bc,30 add hl,bc ; hl now points to party stats - ld de,W_PLAYERMONMAXHP + ld de,wBattleMonMaxHP ld bc,10 call CopyData ; copy party stats to in-battle stat data - ld a,$28 - call Predef + predef Func_3ed02 jp .doneHealing .healHP inc hl ; hl = address of current HP @@ -793,11 +786,11 @@ ItemUseMedicine: ; dabb (3:5abb) ld [wHPBarOldHP+1],a ld a,[hl] ld c,a - ld [wHPBarOldHP],a ; current HP stored at $ceeb (2 bytes, big-endian) + ld [wHPBarOldHP],a ; current HP stored at wHPBarOldHP (2 bytes, big-endian) or b jr nz,.notFainted .fainted - ld a,[$cf91] + ld a,[wcf91] cp a,REVIVE jr z,.updateInBattleFaintedData cp a,MAX_REVIVE @@ -810,28 +803,26 @@ ItemUseMedicine: ; dabb (3:5abb) push hl push de push bc - ld a,[$cf06] + ld a,[wcf06] ld c,a - ld hl,$ccf5 + ld hl,wccf5 ld b,$02 - ld a,$10 - call Predef + predef FlagActionPredef ld a,c and a jr z,.next - ld a,[$cf06] + ld a,[wcf06] ld c,a - ld hl,W_PLAYERMONSALIVEFLAGS + ld hl,wPartyAliveFlags ld b,$01 - ld a,$10 - call Predef + predef FlagActionPredef .next pop bc pop de pop hl jr .compareCurrentHPToMaxHP .notFainted - ld a,[$cf91] + ld a,[wcf91] cp a,REVIVE jp z,.healingItemNoEffect cp a,MAX_REVIVE @@ -851,7 +842,7 @@ ItemUseMedicine: ; dabb (3:5abb) pop hl jr nz,.notFullHP .fullHP ; if the pokemon's current HP equals its max HP - ld a,[$cf91] + ld a,[wcf91] cp a,FULL_RESTORE jp nz,.healingItemNoEffect inc hl @@ -860,15 +851,15 @@ ItemUseMedicine: ; dabb (3:5abb) and a ; does the pokemon have a status ailment? jp z,.healingItemNoEffect ld a,FULL_HEAL - ld [$cf91],a + ld [wcf91],a dec hl dec hl dec hl jp .cureStatusAilment .notFullHP ; if the pokemon's current HP doesn't equal its max HP xor a - ld [$d083],a - ld [$c02a],a + ld [wd083],a + ld [wc02a],a push hl push de ld bc,32 @@ -876,8 +867,8 @@ ItemUseMedicine: ; dabb (3:5abb) ld a,[hli] ld [wHPBarMaxHP+1],a ld a,[hl] - ld [wHPBarMaxHP],a ; max HP stored at $cee9 (2 bytes, big-endian) - ld a,[$d152] + ld [wHPBarMaxHP],a ; max HP stored at wHPBarMaxHP (2 bytes, big-endian) + ld a,[wd152] and a ; using Softboiled? jp z,.notUsingSoftboiled2 ; if using softboiled @@ -890,12 +881,12 @@ ItemUseMedicine: ; dabb (3:5abb) push af ld a,[hl] push af - ld hl,W_PARTYMON1_MAXHP + ld hl,wPartyMon1MaxHP ld a,[wWhichPokemon] - ld bc,44 + ld bc,wPartyMon2 - wPartyMon1 call AddNTimes ld a,[hli] - ld [$ceea],a + ld [wHPBarMaxHP + 1],a ld [H_DIVIDEND],a ld a,[hl] ld [wHPBarMaxHP],a @@ -904,7 +895,7 @@ ItemUseMedicine: ; dabb (3:5abb) ld [H_DIVISOR],a ld b,2 ; number of bytes call Divide ; get 1/5 of max HP of pokemon that used Softboiled - ld bc,-33 + ld bc,wPartyMon1HP - wPartyMon1MaxHP add hl,bc ; hl now points to LSB of current HP of pokemon that used Softboiled ; subtract 1/5 of max HP from current HP of pokemon that used Softboiled ld a,[H_QUOTIENT + 3] @@ -922,8 +913,7 @@ ItemUseMedicine: ; dabb (3:5abb) sbc b ld [hl],a ld [wHPBarNewHP+1],a - FuncCoord 4, 1 ; $c3b8 - ld hl,Coord + hlCoord 4, 1 ld a,[wWhichPokemon] ld bc,2 * 20 call AddNTimes ; calculate coordinates of HP bar of pokemon that used Softboiled @@ -933,15 +923,14 @@ ItemUseMedicine: ; dabb (3:5abb) set 0,a ld [$fff6],a ld a,$02 - ld [$cf94],a - ld a,$48 - call Predef ; animate HP bar decrease of pokemon that used Softboiled + ld [wListMenuID],a + predef UpdateHPBar2 ; animate HP bar decrease of pokemon that used Softboiled ld a,[$fff6] res 0,a ld [$fff6],a pop af ld b,a ; store heal amount (1/5 of max HP) - ld hl,$ceec + ld hl,wHPBarOldHP + 1 pop af ld [hld],a pop af @@ -952,7 +941,7 @@ ItemUseMedicine: ; dabb (3:5abb) ld [hl],a jr .addHealAmount .notUsingSoftboiled2 - ld a,[$cf91] + ld a,[wcf91] cp a,SODA_POP ld b,60 ; Soda Pop heal amount jr z,.addHealAmount @@ -979,7 +968,7 @@ ItemUseMedicine: ; dabb (3:5abb) jr nc,.noCarry inc [hl] ld a,[hl] - ld [$ceee],a + ld [wHPBarNewHP + 1],a .noCarry push de inc hl @@ -987,7 +976,7 @@ ItemUseMedicine: ; dabb (3:5abb) ld e,l ; de now points to current HP ld hl,33 add hl,de ; hl now points to max HP - ld a,[$cf91] + ld a,[wcf91] cp a,REVIVE jr z,.setCurrentHPToHalfMaxHP ld a,[hld] @@ -999,7 +988,7 @@ ItemUseMedicine: ; dabb (3:5abb) ld a,[de] sbc b jr nc,.setCurrentHPToMaxHp ; if current HP exceeds max HP after healing - ld a,[$cf91] + ld a,[wcf91] cp a,HYPER_POTION jr c,.setCurrentHPToMaxHp ; if using a Full Restore or Max Potion cp a,MAX_REVIVE @@ -1029,7 +1018,7 @@ ItemUseMedicine: ; dabb (3:5abb) ld [wHPBarNewHP],a dec de .doneHealingPartyHP ; done updating the pokemon's current HP in the party data structure - ld a,[$cf91] + ld a,[wcf91] cp a,FULL_RESTORE jr nz,.updateInBattleData ld bc,-31 @@ -1045,16 +1034,16 @@ ItemUseMedicine: ; dabb (3:5abb) jr nz,.calculateHPBarCoords ; copy party HP to in-battle HP ld a,[hli] - ld [W_PLAYERMONCURHP],a + ld [wBattleMonHP],a ld a,[hld] - ld [W_PLAYERMONCURHP + 1],a - ld a,[$cf91] + ld [wBattleMonHP + 1],a + ld a,[wcf91] cp a,FULL_RESTORE jr nz,.calculateHPBarCoords xor a - ld [W_PLAYERMONSTATUS],a ; remove the status ailment in the in-battle pokemon data + ld [wBattleMonStatus],a ; remove the status ailment in the in-battle pokemon data .calculateHPBarCoords - ld hl,$c390 + ld hl,wOAMBuffer + $90 ld bc,2 * 20 inc d .calculateHPBarCoordsLoop @@ -1066,14 +1055,14 @@ ItemUseMedicine: ; dabb (3:5abb) call ItemUseNoEffect jp .done .doneHealing - ld a,[$d152] + ld a,[wd152] and a ; using Softboiled? jr nz,.skipRemovingItem ; no item to remove if using Softboiled push hl call RemoveUsedItem pop hl .skipRemovingItem - ld a,[$cf91] + ld a,[wcf91] cp a,FULL_RESTORE jr c,.playStatusAilmentCuringSound cp a,FULL_HEAL @@ -1084,21 +1073,20 @@ ItemUseMedicine: ; dabb (3:5abb) set 0,a ld [$fff6],a ld a,$02 - ld [$cf94],a - ld a,$48 - call Predef ; animate the HP bar lengthening + ld [wListMenuID],a + predef UpdateHPBar2 ; animate the HP bar lengthening ld a,[$fff6] res 0,a ld [$fff6],a ld a,$f7 ; revived message - ld [$d07d],a - ld a,[$cf91] + ld [wd07d],a + ld a,[wcf91] cp a,REVIVE jr z,.showHealingItemMessage cp a,MAX_REVIVE jr z,.showHealingItemMessage ld a,$f5 ; standard HP healed message - ld [$d07d],a + ld [wd07d],a jr .showHealingItemMessage .playStatusAilmentCuringSound ld a,(SFX_02_3e - SFX_Headers_02) / 3 ; status ailment curing sound @@ -1108,7 +1096,7 @@ ItemUseMedicine: ; dabb (3:5abb) ld [H_AUTOBGTRANSFERENABLED],a call ClearScreen dec a - ld [$cfcb],a + ld [wcfcb],a call RedrawPartyMenu ; redraws the party menu and displays the message ld a,1 ld [H_AUTOBGTRANSFERENABLED],a @@ -1118,11 +1106,11 @@ ItemUseMedicine: ; dabb (3:5abb) jr .done .canceledItemUse xor a - ld [$cd6a],a ; item use failed + ld [wcd6a],a ; item use failed pop af pop af .done - ld a,[$d152] + ld a,[wd152] and a ; using Softboiled? ret nz ; if so, return call GBPalWhiteOut @@ -1134,20 +1122,20 @@ ItemUseMedicine: ; dabb (3:5abb) .useVitamin push hl ld a,[hl] - ld [$d0b5],a - ld [$d11e],a + ld [wd0b5],a + ld [wd11e],a ld bc,33 add hl,bc ; hl now points to level ld a,[hl] ; a = level - ld [$d127],a ; store level + ld [W_CURENEMYLVL],a ; store level call GetMonHeader push de ld a,d - ld hl,W_PARTYMON1NAME + ld hl,wPartyMonNicks call GetPartyMonName pop de pop hl - ld a,[$cf91] + ld a,[wcf91] cp a,RARE_CANDY jp z,.useRareCandy push hl @@ -1173,7 +1161,7 @@ ItemUseMedicine: ; dabb (3:5abb) pop hl call .recalculateStats ld hl,VitaminText - ld a,[$cf91] + ld a,[wcf91] sub a,HP_UP - 1 ld c,a .statNameLoop ; loop to get the address of the name of the stat the vitamin increases @@ -1187,9 +1175,9 @@ ItemUseMedicine: ; dabb (3:5abb) jr nz,.statNameInnerLoop jr .statNameLoop .gotStatName - ld de,$cf4b + ld de,wcf4b ld bc,10 - call CopyData ; copy the stat's name to $cf4b + call CopyData ; copy the stat's name to wcf4b ld a,(SFX_02_3e - SFX_Headers_02) / 3 call PlaySound ; play sound ld hl,VitaminStatRoseText @@ -1214,11 +1202,11 @@ ItemUseMedicine: ; dabb (3:5abb) ld bc,33 add hl,bc ; hl now points to level ld a,[hl] ; a = level - cp a,100 + cp a, MAX_LEVEL jr z,.vitaminNoEffect ; can't raise level above 100 inc a ld [hl],a ; store incremented level - ld [$d127],a + ld [W_CURENEMYLVL],a push hl push de ld d,a @@ -1237,7 +1225,7 @@ ItemUseMedicine: ; dabb (3:5abb) pop hl ld a,[wWhichPokemon] push af - ld a,[$cf91] + ld a,[wcf91] push af push de push hl @@ -1270,30 +1258,29 @@ ItemUseMedicine: ; dabb (3:5abb) adc b ld [hl],a ld a,$f8 ; level up message - ld [$d07d],a + ld [wd07d],a call RedrawPartyMenu pop de ld a,d ld [wWhichPokemon],a ld a,e - ld [$d11e],a + ld [wd11e],a xor a - ld [$cc49],a ; load from player's party + ld [wcc49],a ; load from player's party call LoadMonData ld d,$01 callab PrintStatsBox ; display new stats text box call WaitForTextScrollButtonPress ; wait for button press xor a - ld [$cc49],a - ld a,$1a - call Predef ; learn level up move, if any + ld [wcc49],a + predef Func_3af5b ; learn level up move, if any xor a - ld [$ccd4],a + ld [wccd4],a callab Func_3ad0e ; evolve pokemon, if appropriate ld a,$01 - ld [$cfcb],a + ld [wcfcb],a pop af - ld [$cf91],a + ld [wcf91],a pop af ld [wWhichPokemon],a jp RemoveUsedItem @@ -1316,17 +1303,17 @@ VitaminText: ; df2e (3:5f2e) ItemUseBait: ; df52 (3:5f52) ld hl,ThrewBaitText call PrintText - ld hl,$d007 ; catch rate + ld hl,wd007 ; catch rate srl [hl] ; halve catch rate ld a,BAIT_ANIM - ld hl,$cce9 ; bait factor - ld de,$cce8 ; escape factor + ld hl,wcce9 ; bait factor + ld de,wcce8 ; escape factor jr BaitRockCommon ItemUseRock: ; df67 (3:5f67) ld hl,ThrewRockText call PrintText - ld hl,$d007 ; catch rate + ld hl,wd007 ; catch rate ld a,[hl] add a ; double catch rate jr nc,.noCarry @@ -1334,17 +1321,17 @@ ItemUseRock: ; df67 (3:5f67) .noCarry ld [hl],a ld a,ROCK_ANIM - ld hl,$cce8 ; escape factor - ld de,$cce9 ; bait factor + ld hl,wcce8 ; escape factor + ld de,wcce9 ; bait factor BaitRockCommon: ; df7f (3:5f7f) ld [W_ANIMATIONID],a xor a - ld [$cc5b],a + ld [wcc5b],a ld [H_WHOSETURN],a ld [de],a ; zero escape factor (for bait), zero bait factor (for rock) .randomLoop ; loop until a random number less than 5 is generated - call GenRandom + call Random and a,7 cp a,5 jr nc,.randomLoop @@ -1356,8 +1343,7 @@ BaitRockCommon: ; df7f (3:5f7f) ld a,$ff .noCarry ld [hl],a - ld a,$08 - call Predef ; do animation + predef MoveAnimation ; do animation ld c,70 jp DelayFrames @@ -1386,20 +1372,20 @@ ItemUseEscapeRope: ; dfaf (3:5faf) jr z,.notUsable cp b jr nz,.loop - ld hl,$d732 + ld hl,wd732 set 3,[hl] set 6,[hl] - ld hl,$d72e + ld hl,wd72e res 4,[hl] - ld hl,$d790 + ld hl,wd790 res 7,[hl] ; unset Safari Zone bit xor a - ld [$da47],a + ld [W_NUMSAFARIBALLS],a ld [W_SAFARIZONEENTRANCECURSCRIPT],a inc a - ld [$d078],a - ld [$cd6a],a ; item used - ld a,[$d152] + ld [wd078],a + ld [wcd6a],a ; item used + ld a,[wd152] and a ; using Dig? ret nz ; if so, return call ItemUseReloadOverworldData @@ -1421,7 +1407,7 @@ ItemUseRepelCommon: ; e005 (3:6005) and a jp nz,ItemUseNotTime ld a,b - ld [$d0db],a + ld [wd0db],a jp PrintItemUseTextAndRemoveItem ; handles X Accuracy item @@ -1437,7 +1423,7 @@ ItemUseXAccuracy: ; e013 (3:6013) ; The Card Key is handled in a different way. ItemUseCardKey: ; e022 (3:6022) xor a - ld [$d71f],a + ld [wd71f],a call Func_c586 ld a,[Func_c586] ; $4586 cp a,$18 @@ -1469,7 +1455,7 @@ ItemUseCardKey: ; e022 (3:6022) cp e jr nz,.nextEntry3 ld a,[hl] - ld [$d71f],a + ld [wd71f],a jr .done .nextEntry1 inc hl @@ -1481,7 +1467,7 @@ ItemUseCardKey: ; e022 (3:6022) .done ld hl,ItemUseText00 call PrintText - ld hl,$d728 + ld hl,wd728 set 7,[hl] ret @@ -1531,7 +1517,7 @@ ItemUsePokedoll: ; e0cd (3:60cd) dec a jp nz,ItemUseNotTime ld a,$01 - ld [$d078],a + ld [wd078],a jp PrintItemUseTextAndRemoveItem ItemUseGuardSpec: ; e0dc (3:60dc) @@ -1564,7 +1550,7 @@ ItemUseXStat: ; e104 (3:6104) jr nz,.inBattle call ItemUseNotTime ld a,2 - ld [$cd6a],a ; item not used + ld [wcd6a],a ; item not used ret .inBattle ld hl,W_PLAYERMOVENUM @@ -1573,7 +1559,7 @@ ItemUseXStat: ; e104 (3:6104) ld a,[hl] push af ; save [W_PLAYERMOVEEFFECT] push hl - ld a,[$cf91] + ld a,[wcf91] sub a,X_ATTACK - ATTACK_UP1_EFFECT ld [hl],a ; store player move effect call PrintItemUseTextAndRemoveItem @@ -1600,7 +1586,7 @@ ItemUsePokeflute: ; e140 (3:6140) ld a,[W_CURMAP] cp a,ROUTE_12 jr nz,.notRoute12 - ld a,[$d7d8] + ld a,[wd7d8] bit 7,a ; has the player beaten Route 12 Snorlax yet? jr nz,.noSnorlaxToWakeUp ; if the player hasn't beaten Route 12 Snorlax @@ -1609,13 +1595,13 @@ ItemUsePokeflute: ; e140 (3:6140) jr nc,.noSnorlaxToWakeUp ld hl,PlayedFluteHadEffectText call PrintText - ld hl,$d7d8 + ld hl,wd7d8 set 6,[hl] ; trigger Snorlax fight (handled by map script) ret .notRoute12 cp a,ROUTE_16 jr nz,.noSnorlaxToWakeUp - ld a,[$d7e0] + ld a,[wd7e0] bit 1,a ; has the player beaten Route 16 Snorlax yet? jr nz,.noSnorlaxToWakeUp ; if the player hasn't beaten Route 16 Snorlax @@ -1624,7 +1610,7 @@ ItemUsePokeflute: ; e140 (3:6140) jr nc,.noSnorlaxToWakeUp ld hl,PlayedFluteHadEffectText call PrintText - ld hl,$d7e0 + ld hl,wd7e0 set 0,[hl] ; trigger Snorlax fight (handled by map script) ret .noSnorlaxToWakeUp @@ -1632,40 +1618,40 @@ ItemUsePokeflute: ; e140 (3:6140) jp PrintText .inBattle xor a - ld [$cd3d],a ; initialize variable that indicates if any pokemon were woken up to zero + ld [wWhichTrade],a ; initialize variable that indicates if any pokemon were woken up to zero ld b,~SLP & $FF - ld hl,W_PARTYMON1_STATUS + ld hl,wPartyMon1Status call WakeUpEntireParty ld a,[W_ISINBATTLE] dec a ; is it a trainer battle? jr z,.skipWakingUpEnemyParty ; if it's a trainer battle - ld hl,$d8a8 ; enemy party pokemon 1 status + ld hl,wEnemyMon1Status call WakeUpEntireParty .skipWakingUpEnemyParty - ld hl,W_PLAYERMONSTATUS + ld hl,wBattleMonStatus ld a,[hl] and b ; remove Sleep status ld [hl],a - ld hl,W_ENEMYMONSTATUS + ld hl,wEnemyMonStatus ld a,[hl] and b ; remove Sleep status ld [hl],a call LoadScreenTilesFromBuffer2 ; restore saved screen - ld a,[$cd3d] + ld a,[wWhichTrade] and a ; were any pokemon asleep before playing the flute? ld hl,PlayedFluteNoEffectText jp z,PrintText ; if no pokemon were asleep ; if some pokemon were asleep ld hl,PlayedFluteHadEffectText call PrintText - ld a,[$d083] + ld a,[wd083] and a,$80 jr nz,.skipMusic call WaitForSoundToFinish ; wait for sound to end callba Music_PokeFluteInBattle ; play in-battle pokeflute music .musicWaitLoop ; wait for music to finish playing - ld a,[$c02c] + ld a,[wc02c] and a ; music off? jr nz,.musicWaitLoop .skipMusic @@ -1676,9 +1662,9 @@ ItemUsePokeflute: ; e140 (3:6140) ; INPUT: ; hl must point to status of first pokemon in party (player's or enemy's) ; b must equal ~SLP -; [$cd3d] should be initialized to 0 +; [wWhichTrade] should be initialized to 0 ; OUTPUT: -; [$cd3d]: set to 1 if any pokemon were asleep +; [wWhichTrade]: set to 1 if any pokemon were asleep WakeUpEntireParty: ; e1e5 (3:61e5) ld de,44 ld c,6 @@ -1688,7 +1674,7 @@ WakeUpEntireParty: ; e1e5 (3:61e5) and a,SLP ; is pokemon asleep? jr z,.notAsleep ld a,1 - ld [$cd3d],a ; indicate that a pokemon had to be woken up + ld [wWhichTrade],a ; indicate that a pokemon had to be woken up .notAsleep pop af and b ; remove Sleep status @@ -1738,7 +1724,7 @@ PlayedFluteHadEffectText: ; e215 (3:6215) ld c, BANK(SFX_02_5e) call PlayMusic ; play music .musicWaitLoop ; wait for music to finish playing - ld a,[$c028] + ld a,[wc028] cp a,$b8 jr z,.musicWaitLoop call Func_2307 ; start playing normal music again @@ -1767,7 +1753,7 @@ GoodRodCode: ; e259 (3:6259) call FishingInit jp c,ItemUseNotTime .RandomLoop - call GenRandom + call Random srl a jr c, .SetBite and %11 @@ -1797,20 +1783,20 @@ SuperRodCode: ; e283 (3:6283) call ReadSuperRodData ; 0xe8ea ld a, e RodResponse: ; e28d (3:628d) - ld [$CD3D], a + ld [wWhichTrade], a dec a ; is there a bite? jr nz, .next ; if yes, store level and species data ld a, 1 - ld [$D05F], a + ld [W_MOVEMISSED], a ld a, b ; level ld [W_CURENEMYLVL], a ld a, c ; species ld [W_CUROPPONENT], a .next - ld hl, $D700 + ld hl, wd700 ld a, [hl] ; store the value in a push af push hl @@ -1832,7 +1818,7 @@ FishingInit: ; e2b4 (3:62b4) .notInBattle call IsNextTileShoreOrWater ret c - ld a,[$d700] + ld a,[wd700] cp a,2 ; Surfing? jr z,.surfing call ItemUseReloadOverworldData @@ -1887,45 +1873,45 @@ ItemUsePPUp: ; e317 (3:6317) ItemUsePPRestore: ; e31e (3:631e) ld a,[wWhichPokemon] push af - ld a,[$cf91] - ld [$cd3d],a + ld a,[wcf91] + ld [wWhichTrade],a .chooseMon xor a - ld [$cfcb],a + ld [wcfcb],a ld a,$01 ; item use party menu - ld [$d07d],a + ld [wd07d],a call DisplayPartyMenu jr nc,.chooseMove jp .itemNotUsed .chooseMove - ld a,[$cd3d] + ld a,[wWhichTrade] cp a,ELIXER jp nc,.useElixir ; if Elixir or Max Elixir ld a,$02 ld [wMoveMenuType],a ld hl,RaisePPWhichTechniqueText - ld a,[$cd3d] + ld a,[wWhichTrade] cp a,ETHER ; is it a PP Up? jr c,.printWhichTechniqueMessage ; if so, print the raise PP message ld hl,RestorePPWhichTechniqueText ; otherwise, print the restore PP message .printWhichTechniqueMessage call PrintText xor a - ld [$cc2e],a + ld [wPlayerMoveListIndex],a callab MoveSelectionMenu ; move selection menu ld a,0 - ld [$cc2e],a + ld [wPlayerMoveListIndex],a jr nz,.chooseMon - ld hl,W_PARTYMON1_MOVE1 + ld hl,wPartyMon1Moves ld bc,44 call GetSelectedMoveOffset push hl ld a,[hl] - ld [$d11e],a + ld [wd11e],a call GetMoveName - call CopyStringToCF4B ; copy name to $cf4b + call CopyStringToCF4B ; copy name to wcf4b pop hl - ld a,[$cd3d] + ld a,[wWhichTrade] cp a,ETHER jr nc,.useEther ; if Ether or Max Ether .usePPUp @@ -1942,7 +1928,7 @@ ItemUsePPRestore: ; e31e (3:631e) add a,1 << 6 ; increase PP Up count by 1 ld [hl],a ld a,1 ; 1 PP Up used - ld [$d11e],a + ld [wd11e],a call RestoreBonusPP ; add the bonus PP to current PP ld hl,PPIncreasedText call PrintText @@ -1958,10 +1944,10 @@ ItemUsePPRestore: ; e31e (3:631e) ld a,[wPlayerMonNumber] cp b ; is the pokemon whose PP was restored active in battle? jr nz,.skipUpdatingInBattleData - ld hl,W_PARTYMON1_MOVE1PP + ld hl,wPartyMon1PP ld bc,44 call AddNTimes - ld de,W_PLAYERMONPP + ld de,wBattleMonPP ld bc,4 call CopyData ; copy party data to in-battle data .skipUpdatingInBattleData @@ -1978,16 +1964,16 @@ ItemUsePPRestore: ; e31e (3:631e) ; however, this is bugged for Max Ethers and Max Elixirs (see below) .restorePP xor a - ld [$cc49],a ; party pokemon + ld [wcc49],a ; party pokemon call GetMaxPP - ld hl,W_PARTYMON1_MOVE1 + ld hl,wPartyMon1Moves ld bc,44 call GetSelectedMoveOffset ld bc,21 add hl,bc ; hl now points to move's PP - ld a,[$d11e] + ld a,[wd11e] ld b,a ; b = max PP - ld a,[$cd3d] + ld a,[wWhichTrade] cp a,MAX_ETHER jr z,.fullyRestorePP ld a,[hl] ; move PP @@ -2019,7 +2005,7 @@ ItemUsePPRestore: ; e31e (3:631e) jr .storeNewAmount .useElixir ; decrement the item ID so that ELIXER becomes ETHER and MAX_ELIXER becomes MAX_ETHER - ld hl,$cd3d + ld hl,wWhichTrade dec [hl] dec [hl] xor a @@ -2030,7 +2016,7 @@ ItemUsePPRestore: ; e31e (3:631e) ; loop through each move and restore PP .elixirLoop push bc - ld hl,W_PARTYMON1_MOVE1 + ld hl,wPartyMon1Moves ld bc,44 call GetSelectedMoveOffset ld a,[hl] @@ -2039,7 +2025,7 @@ ItemUsePPRestore: ; e31e (3:631e) call .restorePP jr z,.nextMove ; if some PP was restored - ld hl,$cc27 ; counter for number of moves that had their PP restored + ld hl,wTileBehindCursor ; counter for number of moves that had their PP restored inc [hl] .nextMove ld hl,wCurrentMenuItem @@ -2047,7 +2033,7 @@ ItemUsePPRestore: ; e31e (3:631e) pop bc dec b jr nz,.elixirLoop - ld a,[$cc27] + ld a,[wTileBehindCursor] and a ; did any moves have their PP restored? jp nz,.afterRestoringPP .noEffect @@ -2057,7 +2043,7 @@ ItemUsePPRestore: ; e31e (3:631e) call GoPAL_SET_CF1C pop af xor a - ld [$cd6a],a ; item use failed + ld [wcd6a],a ; item use failed ret RaisePPWhichTechniqueText: ; e45d (3:645d) @@ -2088,20 +2074,19 @@ ItemUseTMHM: ; e479 (3:6479) ld a,[W_ISINBATTLE] and a jp nz,ItemUseNotTime - ld a,[$cf91] + ld a,[wcf91] sub a,TM_01 push af jr nc,.skipAdding add a,55 ; if item is an HM, add 55 .skipAdding inc a - ld [$d11e],a - ld a,$44 - call Predef ; get move ID from TM/HM ID - ld a,[$d11e] - ld [$d0e0],a + ld [wd11e],a + predef TMToMove ; get move ID from TM/HM ID + ld a,[wd11e] + ld [wd0e0],a call GetMoveName - call CopyStringToCF4B ; copy name to $cf4b + call CopyStringToCF4B ; copy name to wcf4b pop af ld hl,BootedUpTMText jr nc,.printBootedUpMachineText @@ -2110,36 +2095,35 @@ ItemUseTMHM: ; e479 (3:6479) call PrintText ld hl,TeachMachineMoveText call PrintText - FuncCoord 14,7 - ld hl,Coord + hlCoord 14, 7 ld bc,$080f ld a,$14 - ld [$d125],a + ld [wd125],a call DisplayTextBoxID ; yes/no menu ld a,[wCurrentMenuItem] and a jr z,.useMachine ld a,2 - ld [$cd6a],a ; item not used + ld [wcd6a],a ; item not used ret .useMachine ld a,[wWhichPokemon] push af - ld a,[$cf91] + ld a,[wcf91] push af .chooseMon - ld hl,$cf4b - ld de,$d036 + ld hl,wcf4b + ld de,wd036 ld bc,14 call CopyData ld a,$ff - ld [$cfcb],a + ld [wcfcb],a ld a,$03 ; teach TM/HM party menu - ld [$d07d],a + ld [wd07d],a call DisplayPartyMenu push af - ld hl,$d036 - ld de,$cf4b + ld hl,wd036 + ld de,wcf4b ld bc,14 call CopyData pop af @@ -2148,15 +2132,14 @@ ItemUseTMHM: ; e479 (3:6479) pop af pop af call GBPalWhiteOutWithDelay3 - call CleanLCD_OAM + call ClearSprites call GoPAL_SET_CF1C jp LoadScreenTilesFromBuffer1 ; restore saved screen .checkIfAbleToLearnMove - ld a,$43 - call Predef ; check if the pokemon can learn the move + predef CanLearnTM ; check if the pokemon can learn the move push bc ld a,[wWhichPokemon] - ld hl,W_PARTYMON1NAME + ld hl,wPartyMonNicks call GetPartyMonName pop bc ld a,c @@ -2171,16 +2154,15 @@ ItemUseTMHM: ; e479 (3:6479) .checkIfAlreadyLearnedMove callab CheckIfMoveIsKnown ; check if the pokemon already knows the move jr c,.chooseMon - ld a,$1b - call Predef ; teach move + predef LearnMove ; teach move pop af - ld [$cf91],a + ld [wcf91],a pop af ld [wWhichPokemon],a ld a,b and a ret z - ld a,[$cf91] + ld a,[wcf91] call IsItemHM ret c jp RemoveUsedItem @@ -2211,7 +2193,7 @@ PrintItemUseTextAndRemoveItem: ; e563 (3:6563) RemoveUsedItem: ; e571 (3:6571) ld hl,wNumBagItems ld a,1 ; one item - ld [$cf96],a ; store quantity + ld [wcf96],a ; store quantity jp RemoveItemFromInventory ItemUseNoEffect: ; e57c (3:657c) @@ -2232,8 +2214,7 @@ ThrowBallAtTrainerMon: ; e58b (3:658b) call Delay3 ld a,TOSS_ANIM ld [W_ANIMATIONID],a - ld a,$08 - call Predef ; do animation + predef MoveAnimation ; do animation ld hl,ThrowBallAtTrainerMonText1 call PrintText ld hl,ThrowBallAtTrainerMonText2 @@ -2253,7 +2234,7 @@ SurfingAttemptFailed: ; e5b6 (3:65b6) ItemUseFailed: ; e5b9 (3:65b9) xor a - ld [$cd6a],a ; item use failed + ld [wcd6a],a ; item use failed jp PrintText ItemUseNotTimeText: ; e5c0 (3:65c0) @@ -2310,24 +2291,23 @@ GotOffBicycleText: ; e5fc (3:65fc) ; also, when a PP Up is used, it increases the current PP by one PP Up bonus ; INPUT: ; [wWhichPokemon] = index of pokemon in party -; [$d11e] = mode +; [wd11e] = mode ; 0: Pokemon Center healing ; 1: using a PP Up ; [wCurrentMenuItem] = index of move (when using a PP Up) RestoreBonusPP: ; e606 (3:6606) - ld hl,W_PARTYMON1_MOVE1 + ld hl,wPartyMon1Moves ld bc,44 ld a,[wWhichPokemon] call AddNTimes push hl - ld de,$cd78 - 1 - ld a,$5e - call Predef ; loads the normal max PP of each of the pokemon's moves to $cd78 + ld de,wcd78 - 1 + predef LoadMovePPs ; loads the normal max PP of each of the pokemon's moves to wcd78 pop hl ld c,21 ld b,0 add hl,bc ; hl now points to move 1 PP - ld de,$cd78 + ld de,wcd78 ld b,0 ; initialize move counter to zero ; loop through the pokemon's moves .loop @@ -2335,7 +2315,7 @@ RestoreBonusPP: ; e606 (3:6606) ld a,b cp a,5 ; reached the end of the pokemon's moves? ret z ; if so, return - ld a,[$d11e] + ld a,[wd11e] dec a ; using a PP Up? jr nz,.skipMenuItemIDCheck ; if using a PP Up, check if this is the move it's being used on @@ -2357,7 +2337,7 @@ RestoreBonusPP: ; e606 (3:6606) ; INPUT: ; [de] = normal max PP ; [hl] = move PP -; [$d11e] = max number of times to add bonus +; [wd11e] = max number of times to add bonus ; set to 1 when using a PP Up, set to 255 otherwise AddBonusPP: ; e642 (3:6642) push bc @@ -2386,7 +2366,7 @@ AddBonusPP: ; e642 (3:6642) .addAmount add b ld b,a - ld a,[$d11e] + ld a,[wd11e] dec a jr z,.done dec c @@ -2399,7 +2379,7 @@ AddBonusPP: ; e642 (3:6642) ; gets max PP of a pokemon's move (including PP from PP Ups) ; INPUT: ; [wWhichPokemon] = index of pokemon within party/box -; [$cc49] = pokemon source +; [wcc49] = pokemon source ; 00: player's party ; 01: enemy's party ; 02: current box @@ -2407,24 +2387,24 @@ AddBonusPP: ; e642 (3:6642) ; 04: player's in-battle pokemon ; [wCurrentMenuItem] = move index ; OUTPUT: -; [$d11e] = max PP +; [wd11e] = max PP GetMaxPP: ; e677 (3:6677) - ld a,[$cc49] + ld a,[wcc49] and a - ld hl,W_PARTYMON1_MOVE1 - ld bc,44 + ld hl,wPartyMon1Moves + ld bc,wPartyMon2 - wPartyMon1 jr z,.sourceWithMultipleMon - ld hl,$d8ac ; enemy party + ld hl,wEnemyMon1Moves dec a jr z,.sourceWithMultipleMon - ld hl,$da9e ; current box - ld bc,33 + ld hl,wBoxMon1Moves + ld bc,wBoxMon2 - wBoxMon1 dec a jr z,.sourceWithMultipleMon - ld hl,$da67 ; daycare + ld hl,wDayCareMonMoves dec a jr z,.sourceWithOneMon - ld hl,W_PLAYERMONMOVES ; player's in-battle pokemon + ld hl,wBattleMonMoves ; player's in-battle pokemon .sourceWithOneMon call GetSelectedMoveOffset2 jr .next @@ -2437,16 +2417,16 @@ GetMaxPP: ; e677 (3:6677) ld hl,Moves ld bc,6 call AddNTimes - ld de,$cd6d + ld de,wcd6d ld a,BANK(Moves) call FarCopyData - ld de,$cd72 + ld de,wcd72 ld a,[de] ld b,a ; b = normal max PP pop hl push bc ld bc,21 ; PP offset if not player's in-battle pokemon data - ld a,[$cc49] + ld a,[wcc49] cp a,4 ; player's in-battle pokemon? jr nz,.addPPOffset ld bc,17 ; PP offset if player's in-battle pokemon data @@ -2458,14 +2438,14 @@ GetMaxPP: ; e677 (3:6677) or b ; place normal max PP in 6 lower bits of a ld h,d ld l,e - inc hl ; hl = $cd73 + inc hl ; hl = wcd73 ld [hl],a xor a - ld [$d11e],a ; no limit on PP Up amount + ld [wd11e],a ; no limit on PP Up amount call AddBonusPP ; add bonus PP from PP Ups ld a,[hl] and a,%00111111 ; mask out the PP Up count - ld [$d11e],a ; store max PP + ld [wd11e],a ; store max PP ret GetSelectedMoveOffset: ; e6e3 (3:66e3) @@ -2482,37 +2462,36 @@ GetSelectedMoveOffset2: ; e6e9 (3:66e9) ; confirms the item toss and then tosses the item ; INPUT: ; hl = address of inventory (either wNumBagItems or wNumBoxItems) -; [$cf91] = item ID +; [wcf91] = item ID ; [wWhichPokemon] = index of item within inventory -; [$cf96] = quantity to toss +; [wcf96] = quantity to toss ; OUTPUT: ; clears carry flag if the item is tossed, sets carry flag if not TossItem_: ; e6f1 (3:66f1) push hl - ld a,[$cf91] + ld a,[wcf91] call IsItemHM pop hl jr c,.tooImportantToToss push hl call IsKeyItem_ - ld a,[$d124] + ld a,[wd124] pop hl and a jr nz,.tooImportantToToss push hl - ld a,[$cf91] - ld [$d11e],a + ld a,[wcf91] + ld [wd11e],a call GetItemName - call CopyStringToCF4B ; copy name to $cf4b + call CopyStringToCF4B ; copy name to wcf4b ld hl,IsItOKToTossItemText call PrintText - FuncCoord 14,7 - ld hl,Coord + hlCoord 14, 7 ld bc,$080f ld a,$14 - ld [$d125],a + ld [wd125],a call DisplayTextBoxID ; yes/no menu - ld a,[$d12e] + ld a,[wd12e] cp a,2 pop hl scf @@ -2521,10 +2500,10 @@ TossItem_: ; e6f1 (3:66f1) push hl ld a,[wWhichPokemon] call RemoveItemFromInventory - ld a,[$cf91] - ld [$d11e],a + ld a,[wcf91] + ld [wd11e],a call GetItemName - call CopyStringToCF4B ; copy name to $cf4b + call CopyStringToCF4B ; copy name to wcf4b ld hl,ThrewAwayItemText call PrintText pop hl @@ -2552,50 +2531,49 @@ TooImportantToTossText: ; e75f (3:675f) ; checks if an item is a key item ; INPUT: -; [$cf91] = item ID +; [wcf91] = item ID ; OUTPUT: -; [$d124] = result +; [wd124] = result ; 00: item is not key item ; 01: item is key item IsKeyItem_: ; e764 (3:6764) ld a,$01 - ld [$d124],a - ld a,[$cf91] + ld [wd124],a + ld a,[wcf91] cp a,HM_01 ; is the item an HM or TM? jr nc,.checkIfItemIsHM ; if the item is not an HM or TM push af ld hl,KeyItemBitfield - ld de,$cee9 + ld de,wHPBarMaxHP ld bc,15 ; only 11 bytes are actually used call CopyData pop af dec a ld c,a - ld hl,$cee9 + ld hl,wHPBarMaxHP ld b,$02 ; test bit - ld a,$10 - call Predef ; bitfield operation function + predef FlagActionPredef ; bitfield operation function ld a,c and a ret nz .checkIfItemIsHM - ld a,[$cf91] + ld a,[wcf91] call IsItemHM ret c xor a - ld [$d124],a + ld [wd124],a ret INCLUDE "data/key_items.asm" Func_e7a4: ; e7a4 (3:67a4) - ld de, W_NUMINBOX ; $da80 + ld de, W_NUMINBOX ; wda80 ld a, [de] inc a ld [de], a - ld a, [$cf91] - ld [$d0b5], a + ld a, [wcf91] + ld [wd0b5], a ld c, a .asm_e7b1 inc de @@ -2607,9 +2585,9 @@ Func_e7a4: ; e7a4 (3:67a4) cp $ff jr nz, .asm_e7b1 call GetMonHeader - ld hl, W_BOXMON1OT + ld hl, wBoxMonOT ld bc, $b - ld a, [W_NUMINBOX] ; $da80 + ld a, [W_NUMINBOX] ; wda80 dec a jr z, .asm_e7ee dec a @@ -2620,7 +2598,7 @@ Func_e7a4: ; e7a4 (3:67a4) ld d, h ld e, l pop hl - ld a, [W_NUMINBOX] ; $da80 + ld a, [W_NUMINBOX] ; wda80 dec a ld b, a .asm_e7db @@ -2637,14 +2615,14 @@ Func_e7a4: ; e7a4 (3:67a4) dec b jr nz, .asm_e7db .asm_e7ee - ld hl, W_PLAYERNAME ; $d158 - ld de, W_BOXMON1OT + ld hl, wPlayerName ; wd158 + ld de, wBoxMonOT ld bc, $b call CopyData - ld a, [W_NUMINBOX] ; $da80 + ld a, [W_NUMINBOX] ; wda80 dec a jr z, .asm_e82a - ld hl, W_BOXMON1NAME + ld hl, wBoxMonNicks ld bc, $b dec a call AddNTimes @@ -2654,7 +2632,7 @@ Func_e7a4: ; e7a4 (3:67a4) ld d, h ld e, l pop hl - ld a, [W_NUMINBOX] ; $da80 + ld a, [W_NUMINBOX] ; wda80 dec a ld b, a .asm_e817 @@ -2671,31 +2649,30 @@ Func_e7a4: ; e7a4 (3:67a4) dec b jr nz, .asm_e817 .asm_e82a - ld hl, W_BOXMON1NAME + ld hl, wBoxMonNicks ld a, $2 - ld [$d07d], a - ld a, $4e - call Predef ; indirect jump to Func_64eb (64eb (1:64eb)) - ld a, [W_NUMINBOX] ; $da80 + ld [wd07d], a + predef AskName + ld a, [W_NUMINBOX] ; wda80 dec a jr z, .asm_e867 - ld hl, W_BOXMON1DATA - ld bc, $21 + ld hl, wBoxMons + ld bc, wBoxMon2 - wBoxMon1 dec a call AddNTimes push hl - ld bc, $21 + ld bc, wBoxMon2 - wBoxMon1 add hl, bc ld d, h ld e, l pop hl - ld a, [W_NUMINBOX] ; $da80 + ld a, [W_NUMINBOX] ; wda80 dec a ld b, a .asm_e854 push bc push hl - ld bc, $21 + ld bc, wBoxMon2 - wBoxMon1 call CopyData pop hl ld d, h @@ -2706,13 +2683,13 @@ Func_e7a4: ; e7a4 (3:67a4) dec b jr nz, .asm_e854 .asm_e867 - ld a, [W_ENEMYMONLEVEL] ; $cff3 - ld [W_ENEMYMONNUMBER], a ; $cfe8 - ld hl, $cfe5 - ld de, W_BOXMON1DATA + ld a, [wEnemyMonLevel] ; wEnemyMonLevel + ld [wEnemyMonBoxLevel], a + ld hl, wEnemyMon + ld de, wBoxMon1 ld bc, $c call CopyData - ld hl, wPlayerID ; $d359 + ld hl, wPlayerID ; wPlayerID ld a, [hli] ld [de], a inc de @@ -2720,7 +2697,7 @@ Func_e7a4: ; e7a4 (3:67a4) ld [de], a inc de push de - ld a, [W_CURENEMYLVL] ; $d127 + ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL ld d, a callab CalcExperience pop de @@ -2740,13 +2717,13 @@ Func_e7a4: ; e7a4 (3:67a4) inc de dec b jr nz, .asm_e89f - ld hl, $cff1 + ld hl, wEnemyMonDVs ld a, [hli] ld [de], a inc de ld a, [hli] ld [de], a - ld hl, W_ENEMYMONPP ; $cffe + ld hl, wEnemyMonPP ; wcffe ld b, $4 .asm_e8b1 ld a, [hli] @@ -2767,7 +2744,7 @@ IsNextTileShoreOrWater: ; e8b8 (3:68b8) jr nc, .notShoreOrWater ld a, [W_CURMAPTILESET] cp SHIP_PORT ; Vermilion Dock tileset - ld a, [$cfc6] ; tile in front of player + ld a, [wcfc6] ; tile in front of player jr z, .skipShoreTiles ; if it's the Vermilion Dock tileset cp $48 ; eastern shore tile in Safari Zone jr z, .shoreOrWater @@ -2814,7 +2791,7 @@ ReadSuperRodData: ; e8ea (3:68ea) ld e, $0 ; no bite yet .RandomLoop ; 0xe90c - call GenRandom + call Random srl a ret c ; 50% chance of no battle @@ -2843,7 +2820,7 @@ ItemUseReloadOverworldData: ; e9c5 (3:69c5) Func_e9cb: ; e9cb (3:69cb) ld hl, WildDataPointers ; $4eeb - ld de, $cee9 + ld de, wHPBarMaxHP ld c, $0 .asm_e9d3 inc hl @@ -2874,7 +2851,7 @@ Func_e9f0: ; e9f0 (3:69f0) inc hl ld b, $a .asm_e9f3 - ld a, [$d11e] + ld a, [wd11e] cp [hl] jr nz, .asm_e9fc ld a, c diff --git a/engine/items/tm_prices.asm b/engine/items/tm_prices.asm index cf74ade2..c55a25b4 100755 --- a/engine/items/tm_prices.asm +++ b/engine/items/tm_prices.asm @@ -1,5 +1,5 @@ GetMachinePrice: ; 7bf86 (1e:7f86) - ld a, [$cf91] + ld a, [wcf91] sub TM_01 ret c ld d, a diff --git a/engine/items/tmhm.asm b/engine/items/tmhm.asm index 5b7b4e8e..01a48ebb 100755 --- a/engine/items/tmhm.asm +++ b/engine/items/tmhm.asm @@ -1,10 +1,10 @@ -; checks if the mon in wWhichPokemon already knows the move in $d0e0 +; checks if the mon in wWhichPokemon already knows the move in wd0e0 CheckIfMoveIsKnown: ; 2fe18 (b:7e18) ld a, [wWhichPokemon] - ld hl, W_PARTYMON1_MOVE1 + ld hl, wPartyMon1Moves ld bc, $2c call AddNTimes - ld a, [$d0e0] + ld a, [wd0e0] ld b, a ld c, $4 ; nubmer of moves .loop diff --git a/engine/items/tms.asm b/engine/items/tms.asm index b0cfd29c..ef427860 100755 --- a/engine/items/tms.asm +++ b/engine/items/tms.asm @@ -1,11 +1,11 @@ -; tests if mon [$cf91] can learn move [$d0e0] -TestMonMoveCompatibility: ; 1373e (4:773e) - ld a, [$cf91] - ld [$d0b5], a +; tests if mon [wcf91] can learn move [wd0e0] +CanLearnTM: ; 1373e (4:773e) + ld a, [wcf91] + ld [wd0b5], a call GetMonHeader ld hl, W_MONHLEARNSET push hl - ld a, [$d0e0] + ld a, [wd0e0] ld b, a ld c, $0 ld hl, TechnicalMachines @@ -18,20 +18,19 @@ TestMonMoveCompatibility: ; 1373e (4:773e) .TMfoundLoop pop hl ld b, $2 ; read corresponding bit from TM compatibility array - ld a, $10 - jp Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + predef_jump FlagActionPredef -; converts TM/HM number in $d11e into move number +; converts TM/HM number in wd11e into move number ; HMs start at 51 TMToMove: ; 13763 (4:7763) - ld a, [$d11e] + ld a, [wd11e] dec a ld hl, TechnicalMachines ld b, $0 ld c, a add hl, bc ld a, [hl] - ld [$d11e], a + ld [wd11e], a ret INCLUDE "data/tms.asm" diff --git a/engine/joypad.asm b/engine/joypad.asm new file mode 100644 index 00000000..d2ad1c31 --- /dev/null +++ b/engine/joypad.asm @@ -0,0 +1,51 @@ +_Joypad:: + ld a, [hJoyInput] + cp A_BUTTON + B_BUTTON + SELECT + START ; soft reset + jp z, TrySoftReset + ld b, a + ld a, [hJoyHeldLast] + ld e, a + xor b + ld d, a + and e + ld [hJoyReleased], a + ld a, d + and b + ld [hJoyPressed], a + ld a, b + ld [hJoyHeldLast], a + ld a, [wd730] + bit 5, a + jr nz, DiscardButtonPresses + ld a, [hJoyHeldLast] + ld [hJoyHeld], a + ld a, [wJoyIgnore] + and a + ret z + cpl + ld b, a + ld a, [hJoyHeld] + and b + ld [hJoyHeld], a + ld a, [hJoyPressed] + and b + ld [hJoyPressed], a + ret + +DiscardButtonPresses: + xor a + ld [hJoyHeld], a + ld [hJoyPressed], a + ld [hJoyReleased], a + ret + +TrySoftReset: + call DelayFrame + ; reset joypad (to make sure the + ; player is really trying to reset) + ld a, $30 + ld [rJOYP], a + ld hl, hSoftReset + dec [hl] + jp z, SoftReset + jp Joypad diff --git a/engine/learn_move.asm b/engine/learn_move.asm index c1f5dee1..bbfb41a3 100755 --- a/engine/learn_move.asm +++ b/engine/learn_move.asm @@ -1,17 +1,17 @@ LearnMove: ; 6e43 (1:6e43) call SaveScreenTilesToBuffer1 - ld a, [wWhichPokemon] ; $cf92 - ld hl, W_PARTYMON1NAME ; $d2b5 + ld a, [wWhichPokemon] ; wWhichPokemon + ld hl, wPartyMonNicks ; wPartyMonNicks call GetPartyMonName - ld hl, $cd6d - ld de, $d036 + ld hl, wcd6d + ld de, wd036 ld bc, $b call CopyData DontAbandonLearning: ; 6e5b (1:6e5b) - ld hl, W_PARTYMON1_MOVE1 ; $d173 + ld hl, wPartyMon1Moves ; wPartyMon1Moves ld bc, $2c - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon call AddNTimes ld d, h ld e, l @@ -29,14 +29,14 @@ DontAbandonLearning: ; 6e5b (1:6e5b) jp c, AbandonLearning push hl push de - ld [$d11e], a + ld [wd11e], a call GetMoveName ld hl, OneTwoAndText call PrintText pop de pop hl .asm_6e8b - ld a, [$d0e0] + ld a, [wd0e0] ld [hl], a ld bc, $15 add hl, bc @@ -46,29 +46,29 @@ DontAbandonLearning: ; 6e5b (1:6e5b) ld hl, Moves ; $4000 ld bc, $6 call AddNTimes - ld de, $cee9 + ld de, wHPBarMaxHP ld a, BANK(Moves) call FarCopyData - ld a, [$ceee] + ld a, [wHPBarNewHP + 1] pop de pop hl ld [hl], a - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE and a jp z, PrintLearnedMove - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon ld b, a - ld a, [wPlayerMonNumber] ; $cc2f + ld a, [wPlayerMonNumber] ; wPlayerMonNumber cp b jp nz, PrintLearnedMove ld h, d ld l, e - ld de, W_PLAYERMONMOVES + ld de, wBattleMonMoves ld bc, $4 call CopyData ld bc, $11 add hl, bc - ld de, W_PLAYERMONPP ; $d02d + ld de, wBattleMonPP ; wBattleMonPP ld bc, $4 call CopyData jp PrintLearnedMove @@ -76,13 +76,12 @@ DontAbandonLearning: ; 6e5b (1:6e5b) AbandonLearning: ; 6eda (1:6eda) ld hl, AbandonLearningText call PrintText - FuncCoord 14, 7 ; $c43a - ld hl, Coord + hlCoord 14, 7 ld bc, $80f ld a, $14 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem and a jp nz, DontAbandonLearning ld hl, DidNotLearnText @@ -100,20 +99,19 @@ TryingToLearn: ; 6f07 (1:6f07) push hl ld hl, TryingToLearnText call PrintText - FuncCoord 14, 7 ; $c43a - ld hl, Coord + hlCoord 14, 7 ld bc, $80f ld a, $14 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID pop hl - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem rra ret c ld bc, $fffc add hl, bc push hl - ld de, $d0dc + ld de, wd0dc ld bc, $4 call CopyData callab Func_39b87 @@ -122,14 +120,12 @@ TryingToLearn: ; 6f07 (1:6f07) push hl ld hl, WhichMoveToForgetText call PrintText - FuncCoord 4, 7 ; $c430 - ld hl, Coord + hlCoord 4, 7 ld b, $4 ld c, $e call TextBoxBorder - FuncCoord 6, 8 ; $c446 - ld hl, Coord - ld de, $d0e1 + hlCoord 6, 8 + ld de, wd0e1 ld a, [$fff6] set 2, a ld [$fff6], a @@ -137,7 +133,7 @@ TryingToLearn: ; 6f07 (1:6f07) ld a, [$fff6] res 2, a ld [$fff6], a - ld hl, wTopMenuItemY ; $cc24 + ld hl, wTopMenuItemY ; wTopMenuItemY ld a, $8 ld [hli], a ld a, $5 @@ -145,7 +141,7 @@ TryingToLearn: ; 6f07 (1:6f07) xor a ld [hli], a inc hl - ld a, [$cd6c] + ld a, [wcd6c] ld [hli], a ld a, $3 ld [hli], a @@ -162,7 +158,7 @@ TryingToLearn: ; 6f07 (1:6f07) bit 1, a jr nz, .asm_6fab push hl - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld c, a ld b, $0 add hl, bc diff --git a/engine/load_pokedex_tiles.asm b/engine/load_pokedex_tiles.asm index 7a49adaa..e8205ef8 100755 --- a/engine/load_pokedex_tiles.asm +++ b/engine/load_pokedex_tiles.asm @@ -2,10 +2,10 @@ LoadPokedexTilePatterns: ; 17840 (5:7840) call LoadHpBarAndStatusTilePatterns ld de,PokedexTileGraphics ; $6488 - ld hl,$9600 + ld hl,vChars2 + $600 ld bc,(BANK(PokedexTileGraphics) << 8) + $12 call CopyVideoData ld de,PokeballTileGraphics ; $697e - ld hl,$9720 + ld hl,vChars2 + $720 ld bc,(BANK(PokeballTileGraphics) << 8) + $01 jp CopyVideoData ; load pokeball tile for marking caught mons diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm index 0c468a2b..3edaadd8 100644 --- a/engine/menu/bills_pc.asm +++ b/engine/menu/bills_pc.asm @@ -2,13 +2,13 @@ Func_213c8:: ; 213c8 (8:53c8) xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba call SaveScreenTilesToBuffer2 - ld a, [$d5a2] + ld a, [wd5a2] and a jr nz, .asm_213f3 - ld a, [$d74b] + ld a, [wd74b] bit 5, a jr z, .asm_213ea - ld a, [$d5a2] + ld a, [wd5a2] and a jr nz, .asm_213f3 ld hl, wTileMap @@ -28,70 +28,62 @@ Func_213c8:: ; 213c8 (8:53c8) call TextBoxBorder call UpdateSprites ld a, $3 - ld [wMaxMenuItem], a ; $cc28 - ld a, [$d7f1] + ld [wMaxMenuItem], a ; wMaxMenuItem + ld a, [wd7f1] bit 0, a jr nz, .asm_21414 - FuncCoord 2, 2 ; $c3ca - ld hl, Coord + hlCoord 2, 2 ld de, SomeonesPCText ; $548b jr .asm_2141a .asm_21414 - FuncCoord 2, 2 ; $c3ca - ld hl, Coord + hlCoord 2, 2 ld de, BillsPCText ; $5497 .asm_2141a call PlaceString - FuncCoord 2, 4 ; $c3f2 - ld hl, Coord - ld de, W_PLAYERNAME ; $d158 + hlCoord 2, 4 + ld de, wPlayerName ; wd158 call PlaceString ld l, c ld h, b ld de, PlayersPCText ; $54a0 call PlaceString - ld a, [$d74b] + ld a, [wd74b] bit 5, a jr z, .asm_21462 - FuncCoord 2, 6 ; $c41a - ld hl, Coord + hlCoord 2, 6 ld de, OaksPCText ; $54a5 call PlaceString - ld a, [$d5a2] + ld a, [wd5a2] and a jr z, .asm_2145a ld a, $4 - ld [wMaxMenuItem], a ; $cc28 - FuncCoord 2, 8 ; $c442 - ld hl, Coord + ld [wMaxMenuItem], a ; wMaxMenuItem + hlCoord 2, 8 ld de, PKMNLeaguePCText ; $54b2 call PlaceString - FuncCoord 2, 10 ; $c46a - ld hl, Coord + hlCoord 2, 10 ld de, LogOffPCText ; $54ba jr .asm_2146d .asm_2145a - FuncCoord 2, 8 ; $c442 - ld hl, Coord + hlCoord 2, 8 ld de, LogOffPCText ; $54ba jr .asm_2146d .asm_21462 ld a, $2 - ld [wMaxMenuItem], a ; $cc28 - FuncCoord 2, 6 ; $c41a - ld hl, Coord + ld [wMaxMenuItem], a ; wMaxMenuItem + hlCoord 2, 6 ld de, LogOffPCText ; $54ba .asm_2146d call PlaceString ld a, $3 - ld [wMenuWatchedKeys], a ; $cc29 + ld [wMenuWatchedKeys], a ; wMenuWatchedKeys ld a, $2 - ld [wTopMenuItemY], a ; $cc24 + ld [wTopMenuItemY], a ; wTopMenuItemY ld a, $1 - ld [wTopMenuItemX], a ; $cc25 + ld [wTopMenuItemX], a ; wTopMenuItemX xor a - ld [wCurrentMenuItem], a ; $cc26 - ld [wLastMenuItem], a ; $cc2a + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wLastMenuItem], a ; wLastMenuItem ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ret @@ -116,14 +108,14 @@ LogOffPCText: ; 214ba (8:54ba) Func_214c2:: ; 214c2 (8:54c2) BillsPC_:: ; 0x214c2 - ld hl, $d730 + ld hl, wd730 set 6, [hl] xor a - ld [$ccd3], a + ld [wccd3], a inc a ; MONSTER_NAME ld [W_LISTTYPE], a call LoadHpBarAndStatusTilePatterns - ld a, [wListScrollOffset] ; $cc36 + ld a, [wListScrollOffset] ; wcc36 push af ld a, [wFlags_0xcd60] bit 3, a @@ -135,9 +127,9 @@ BillsPC_:: ; 0x214c2 Func_214e8: ; 214e8 (8:54e8) BillsPCMenu: - ld a, [$ccd3] - ld [wCurrentMenuItem], a ; $cc26 - ld hl, $9780 + ld a, [wccd3] + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld hl, vChars2 + $780 ld de, PokeballTileGraphics ; $697e ld bc, (BANK(PokeballTileGraphics) << 8) + $01 call CopyVideoData @@ -146,11 +138,10 @@ BillsPCMenu: ld b, $a ld c, $c call TextBoxBorder - FuncCoord 2, 2 ; $c3ca - ld hl, Coord + hlCoord 2, 2 ld de, BillsPCMenuText ; $56e1 call PlaceString - ld hl, wTopMenuItemY ; $cc24 + ld hl, wTopMenuItemY ; wTopMenuItemY ld a, $2 ld [hli], a dec a @@ -164,34 +155,30 @@ BillsPCMenu: xor a ld [hli], a ld [hli], a - ld hl, wListScrollOffset ; $cc36 + ld hl, wListScrollOffset ; wcc36 ld [hli], a ld [hl], a - ld [wPlayerMonNumber], a ; $cc2f + ld [wPlayerMonNumber], a ; wPlayerMonNumber ld hl, WhatText call PrintText - FuncCoord 9, 14 ; $c4c1 - ld hl, Coord + hlCoord 9, 14 ld b, $2 ld c, $9 call TextBoxBorder - ld a, [$d5a0] + ld a, [wd5a0] and $7f cp $9 jr c, .asm_2154f sub $9 - FuncCoord 17, 16 ; $c4f1 - ld hl, Coord + hlCoord 17, 16 ld [hl], $f7 add $f6 jr .asm_21551 .asm_2154f add $f7 .asm_21551 - FuncCoord 18, 16 ; $c4f2 - ld [Coord], a - FuncCoord 10, 16 ; $c4ea - ld hl, Coord + Coorda 18, 16 + hlCoord 10, 16 ld de, BoxNoPCText ; $5713 call PlaceString ld a, $1 @@ -201,8 +188,8 @@ BillsPCMenu: bit 1, a jp nz, Func_21588 ; b button call PlaceUnfilledArrowMenuCursor - ld a, [wCurrentMenuItem] ; $cc26 - ld [$ccd3], a + ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld [wccd3], a and a jp z, Func_21618 ; withdraw cp $1 @@ -225,44 +212,44 @@ Func_21588: ; 21588 (8:5588) res 5, [hl] call LoadScreenTilesFromBuffer2 pop af - ld [wListScrollOffset], a ; $cc36 - ld hl, $d730 + ld [wListScrollOffset], a ; wcc36 + ld hl, wd730 res 6, [hl] ret Func_215ac: ; 215ac (8:55ac) BillsPCDeposit: - ld a, [W_NUMINPARTY] ; $d163 + ld a, [wPartyCount] ; wPartyCount dec a jr nz, .asm_215bb ld hl, CantDepositLastMonText call PrintText jp BillsPCMenu .asm_215bb - ld a, [W_NUMINBOX] ; $da80 + ld a, [W_NUMINBOX] ; wda80 cp $14 jr nz, .asm_215cb ld hl, BoxFullText ; $5802 call PrintText jp BillsPCMenu .asm_215cb - ld hl, W_NUMINPARTY ; $d163 + ld hl, wPartyCount ; wPartyCount call Func_216be jp c, BillsPCMenu call Func_2174b jp nc, BillsPCMenu - ld a, [$cf91] + ld a, [wcf91] call GetCryData call PlaySoundWaitForCurrent ld a, $1 - ld [$cf95], a + ld [wcf95], a call Func_3a68 xor a - ld [$cf95], a + ld [wcf95], a call RemovePokemon call WaitForSoundToFinish - ld hl, wWhichTrade ; $cd3d - ld a, [$d5a0] + ld hl, wWhichTrade ; wWhichTrade + ld a, [wd5a0] and $7f cp $9 jr c, .asm_2160a @@ -281,36 +268,36 @@ BillsPCDeposit: jp BillsPCMenu Func_21618: ; 21618 (8:5618) - ld a, [W_NUMINBOX] ; $da80 + ld a, [W_NUMINBOX] ; wda80 and a jr nz, .asm_21627 ld hl, NoMonText ; $580c call PrintText jp Func_214e8 .asm_21627 - ld a, [W_NUMINPARTY] ; $d163 + ld a, [wPartyCount] ; wPartyCount cp $6 jr nz, .asm_21637 ld hl, CantTakeMonText ; $5811 call PrintText jp Func_214e8 .asm_21637 - ld hl, W_NUMINBOX ; $da80 + ld hl, W_NUMINBOX ; wda80 call Func_216be jp c, Func_214e8 call Func_2174b jp nc, Func_214e8 - ld a, [wWhichPokemon] ; $cf92 - ld hl, $de06 + ld a, [wWhichPokemon] ; wWhichPokemon + ld hl, wBoxMonNicks call GetPartyMonName - ld a, [$cf91] + ld a, [wcf91] call GetCryData call PlaySoundWaitForCurrent xor a - ld [$cf95], a + ld [wcf95], a call Func_3a68 ld a, $1 - ld [$cf95], a + ld [wcf95], a call RemovePokemon call WaitForSoundToFinish ld hl, MonIsTakenOutText ; $5807 @@ -318,27 +305,27 @@ Func_21618: ; 21618 (8:5618) jp Func_214e8 Func_21673: ; 21673 (8:5673) - ld a, [W_NUMINBOX] ; $da80 + ld a, [W_NUMINBOX] ; wda80 and a jr nz, .asm_21682 ld hl, NoMonText ; $580c call PrintText jp Func_214e8 .asm_21682 - ld hl, W_NUMINBOX ; $da80 + ld hl, W_NUMINBOX ; wda80 call Func_216be jp c, Func_214e8 ld hl, OnceReleasedText ; $581b call PrintText call YesNoChoice - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem and a jr nz, .asm_21682 inc a - ld [$cf95], a + ld [wcf95], a call RemovePokemon call WaitForSoundToFinish - ld a, [$cf91] + ld a, [wcf91] call PlayCry ld hl, MonWasReleasedText ; $5820 call PrintText @@ -350,19 +337,19 @@ Func_216b3: ; 216b3 (8:56b3) Func_216be: ; 216be (8:56be) ld a, l - ld [$cf8b], a + ld [wcf8b], a ld a, h - ld [$cf8c], a + ld [wcf8c], a xor a - ld [$cf93], a - ld [wListMenuID], a ; $cf94 + ld [wcf93], a + ld [wListMenuID], a ; wListMenuID inc a ; MONSTER_NAME ld [W_LISTTYPE], a - ld a, [$cc2b] - ld [wCurrentMenuItem], a ; $cc26 + ld a, [wcc2b] + ld [wCurrentMenuItem], a ; wCurrentMenuItem call DisplayListMenuID - ld a, [wCurrentMenuItem] ; $cc26 - ld [$cc2b], a + ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld [wcc2b], a ret BillsPCMenuText: ; 216e1 (8:56e1) @@ -372,21 +359,21 @@ BoxNoPCText: ; 21713 (8:5713) db "BOX No.@" Func_2171b:: ; 2171b (8:571b) - ld hl, $d173 - ld bc, $002c + ld hl, wPartyMon1Moves + ld bc, wPartyMon2 - wPartyMon1 jr .asm_21729 ; 0x21721 $6 - ld hl, $da9e - ld bc, $0021 + ld hl, wBoxMon1Moves + ld bc, wBoxMon2 - wBoxMon1 .asm_21729 - ld a, [$cf92] + ld a, [wWhichPokemon] call AddNTimes - ld b, $4 + ld b, NUM_MOVES .asm_21731 ld a, [hli] push hl push bc ld hl, HMMoveArray ; $5745 - ld de, $0001 + ld de, 1 call IsInArray pop bc pop hl @@ -405,25 +392,22 @@ HMMoveArray: ; 21745 (8:5745) db $ff Func_2174b: ; 2174b (8:574b) - FuncCoord 9, 10 ; $c471 - ld hl, Coord + hlCoord 9, 10 ld b, $6 ld c, $9 call TextBoxBorder - ld a, [$ccd3] + ld a, [wccd3] and a ld de, DepositPCText ; $57cb jr nz, .asm_21761 ld de, WithdrawPCText ; $57d3 .asm_21761 - FuncCoord 11, 12 ; $c49b - ld hl, Coord + hlCoord 11, 12 call PlaceString - FuncCoord 11, 14 ; $c4c3 - ld hl, Coord + hlCoord 11, 14 ld de, StatsCancelPCText ; $57dc call PlaceString - ld hl, wTopMenuItemY ; $cc24 + ld hl, wTopMenuItemY ; wTopMenuItemY ld a, $c ld [hli], a ld a, $a @@ -437,16 +421,16 @@ Func_2174b: ; 2174b (8:574b) ld [hli], a xor a ld [hl], a - ld hl, wListScrollOffset ; $cc36 + ld hl, wListScrollOffset ; wcc36 ld [hli], a ld [hl], a - ld [wPlayerMonNumber], a ; $cc2f - ld [$cc2b], a + ld [wPlayerMonNumber], a ; wPlayerMonNumber + ld [wcc2b], a .asm_2178f call HandleMenuInput bit 1, a jr nz, .asm_2179f - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem and a jr z, .asm_217a1 dec a @@ -459,17 +443,15 @@ Func_2174b: ; 2174b (8:574b) ret .asm_217a3 call SaveScreenTilesToBuffer1 - ld a, [$ccd3] + ld a, [wccd3] and a ld a, $0 jr nz, .asm_217b0 ld a, $2 .asm_217b0 - ld [$cc49], a - ld a, $36 - call Predef ; indirect jump to StatusScreen (12953 (4:6953)) - ld a, $37 - call Predef ; indirect jump to StatusScreen2 (12b57 (4:6b57)) + ld [wcc49], a + predef StatusScreen + predef StatusScreen2 call LoadScreenTilesFromBuffer1 call ReloadTilesetTilePatterns call GoPAL_SET_CF1C @@ -537,16 +519,16 @@ PrintJustAMomentText1:: ; 5824 (8:5825) ld a, [$ffaa] cp $1 ret z - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $c ret nz - ld a, [$d35e] + ld a, [W_CURMAP] cp $ef ld a, $2 jr z, .asm_2183a inc a .asm_2183a - ld [$d12b], a + ld [W_ISLINKBATTLE], a call EnableAutoTextBoxDrawing ld a, $22 jp PrintPredefTextID @@ -555,16 +537,16 @@ PrintJustAMomentText2:: ; 5845 (8:5845) ld a, [$ffaa] cp $2 ret z - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $8 ret nz - ld a, [$d35e] + ld a, [W_CURMAP] cp $ef ld a, $2 jr z, .asm_2185a inc a .asm_2185a - ld [$d12b], a + ld [W_ISLINKBATTLE], a call EnableAutoTextBoxDrawing ld a, $22 jp PrintPredefTextID @@ -573,7 +555,7 @@ JustAMomentText:: ; 21865 (8:5865) TX_FAR _JustAMomentText db "@" - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 ret nz call EnableAutoTextBoxDrawing diff --git a/engine/menu/diploma.asm b/engine/menu/diploma.asm index 3b9413a2..023c6177 100755 --- a/engine/menu/diploma.asm +++ b/engine/menu/diploma.asm @@ -3,19 +3,18 @@ DisplayDiploma: ; 566e2 (15:66e2) call GBPalWhiteOutWithDelay3 call ClearScreen xor a - ld [$cfcb], a - ld hl, $d730 + ld [wcfcb], a + ld hl, wd730 set 6, [hl] call DisableLCD ld hl, CircleTile ; $7d88 - ld de, $9700 + ld de, vChars2 + $700 ld bc, $0010 ld a, BANK(CircleTile) call FarCopyData2 ld hl, wTileMap ld bc, $1012 - ld a, $27 - call Predef + predef Func_5ab0 ld hl, DiplomaTextPointersAndCoords ; $6784 ld c, $5 .asm_56715 @@ -34,12 +33,11 @@ DisplayDiploma: ; 566e2 (15:66e2) pop bc dec c jr nz, .asm_56715 ; 0x56725 $ee - FuncCoord 10, 4 ; $c3fa - ld hl, Coord - ld de, W_PLAYERNAME + hlCoord 10, 4 + ld de, wPlayerName call PlaceString callba Func_44dd - ld hl, $c301 + ld hl, wOAMBuffer + $01 ld bc, $8028 .asm_5673e ld a, [hl] @@ -60,7 +58,7 @@ DisplayDiploma: ; 566e2 (15:66e2) ld a, $90 ld [$ff48], a call WaitForTextScrollButtonPress - ld hl, $d730 + ld hl, wd730 res 6, [hl] call GBPalWhiteOutWithDelay3 call Func_3dbe @@ -68,7 +66,7 @@ DisplayDiploma: ; 566e2 (15:66e2) jp GBPalNormal Func_56777: ; 56777 (15:6777) - ld hl, W_PLAYERNAME + ld hl, wPlayerName ld bc, $ff00 .asm_5677d ld a, [hli] @@ -79,15 +77,15 @@ Func_56777: ; 56777 (15:6777) DiplomaTextPointersAndCoords: ; 56784 (15:6784) dw DiplomaText - dw $c3cd + dw wTileMap + $2d dw DiplomaPlayer - dw $c3f3 + dw wTileMap + $53 dw DiplomaEmptyText - dw $c3ff + dw wTileMap + $5f dw DiplomaCongrats - dw $c41a + dw wTileMap + $7a dw DiplomaGameFreak - dw $c4e9 + dw wTileMap + $149 DiplomaText: db $70,"Diploma",$70,"@" diff --git a/engine/menu/league_pc.asm b/engine/menu/league_pc.asm index 5e4e3436..4833e57d 100755 --- a/engine/menu/league_pc.asm +++ b/engine/menu/league_pc.asm @@ -1,37 +1,37 @@ PKMNLeaguePC: ; 0x7657e ld hl, AccessedHoFPCText call PrintText - ld hl, $D730 + ld hl, wd730 set 6, [hl] push hl - ld a, [$CFCB] + ld a, [wcfcb] push af ld a, [$ffD7] push af xor a ld [$ffD7], a ld [W_SPRITEFLIPPED], a - ld [$CFCB], a - ld [$CD41], a - ld [$CD42], a - ld a, [$D5A2] + ld [wcfcb], a + ld [wTrainerScreenX], a + ld [wcd42], a + ld a, [wd5a2] ld b, a - cp a, $33 + cp NUM_HOF_TEAMS + 1 jr c, .first - ld b, $32 + ld b, NUM_HOF_TEAMS sub b - ld [$CD42], a + ld [wcd42], a .first - ld hl, $CD42 + ld hl, wcd42 inc [hl] push bc - ld a, [$CD41] - ld [$CD3D], a - callba Func_73b3f + ld a, [wTrainerScreenX] + ld [wWhichTrade], a + callba LoadHallOfFameTeams call Func_765e5 pop bc jr c, .second - ld hl, $CD41 + ld hl, wTrainerScreenX inc [hl] ld a, [hl] cp b @@ -40,7 +40,7 @@ PKMNLeaguePC: ; 0x7657e pop af ld [$ffD7], a pop af - ld [$CFCB], a + ld [wcfcb], a pop hl res 6, [hl] call GBPalWhiteOutWithDelay3 @@ -49,28 +49,28 @@ PKMNLeaguePC: ; 0x7657e jp GBPalNormal Func_765e5: ; 765e5 (1d:65e5) - ld c, 6 -.third + ld c, PARTY_LENGTH +.loop push bc call Func_76610 call WaitForTextScrollButtonPress - ld a, [H_CURRENTPRESSEDBUTTONS] + ld a, [hJoyHeld] bit 1, a - jr nz, .fifth - ld hl, $CC6B - ld de, $CC5B - ld bc, $0050 + jr nz, .exit + ld hl, wHallOfFame + HOF_MON + ld de, wHallOfFame + ld bc, HOF_TEAM - HOF_MON call CopyData pop bc - ld a, [$CC5B] - cp a, $FF - jr z, .fourth + ld a, [wHallOfFame + 0] + cp $ff + jr z, .done dec c - jr nz, .third -.fourth + jr nz, .loop +.done and a ret -.fifth +.exit pop bc scf ret @@ -78,38 +78,34 @@ Func_765e5: ; 765e5 (1d:65e5) Func_76610: ; 76610 (1d:6610) call GBPalWhiteOutWithDelay3 call ClearScreen - ld hl, $CC5B + ld hl, wHallOfFame ld a, [hli] - ld [$CD3D], a - ld [$CF91], a - ld [$D0B5], a - ld [$CFD9], a - ld [$CF1D], a + ld [wWhichTrade], a + ld [wcf91], a + ld [wd0b5], a + ld [wBattleMonSpecies2], a + ld [wcf1d], a ld a, [hli] - ld [$CD3F], a - ld de, $CD6D + ld [wTrainerFacingDirection], a + ld de, wcd6d ld bc, $000B call CopyData ld b, $0B ld c, 0 call GoPAL_SET - FuncCoord 12, 5 ; $c410 - ld hl, Coord + hlCoord 12, 5 call GetMonHeader call LoadFrontSpriteByMonIndex call GBPalNormal - FuncCoord 0, 13 ; $c4a4 - ld hl, Coord + hlCoord 0, 13 ld b, 2 ld c, $12 call TextBoxBorder - FuncCoord 1, 15 ; $c4cd - ld hl, Coord + hlCoord 1, 15 ld de, HallOfFameNoText call PlaceString - FuncCoord 16, 15 ; $c4dc - ld hl, Coord - ld de, $CD42 + hlCoord 16, 15 + ld de, wcd42 ld bc, $0103 call PrintNumber ld b, BANK(Func_702f0) diff --git a/engine/menu/main_menu.asm b/engine/menu/main_menu.asm index 7e34feca..4044da43 100755 --- a/engine/menu/main_menu.asm +++ b/engine/menu/main_menu.asm @@ -2,82 +2,77 @@ MainMenu: ; 5af2 (1:5af2) ; Check save file call Func_5bff xor a - ld [$D08A],a + ld [wd08a],a inc a - ld [$D088],a + ld [wd088],a call Func_609e jr nc,.next0 ; Predef 52 loads the save from SRAM to RAM - ld a,$52 - call Predef + predef LoadSAV .next0 ld c,20 call DelayFrames xor a - ld [$D12B],a - ld hl,$CC2B + ld [W_ISLINKBATTLE],a + ld hl,wcc2b ld [hli],a ld [hli],a ld [hli],a ld [hl],a - ld [$D07C],a - ld hl,$D72E + ld [W_ANIMATIONID],a + ld hl,wd72e res 6,[hl] call ClearScreen call GoPAL_SET_CF1C call LoadTextBoxTilePatterns call LoadFontTilePatterns - ld hl,$D730 + ld hl,wd730 set 6,[hl] - ld a,[$D088] + ld a,[wd088] cp a,1 jr z,.next1 - FuncCoord 0,0 - ld hl,Coord + hlCoord 0, 0 ld b,6 ld c,13 call TextBoxBorder - FuncCoord 2,2 - ld hl,Coord + hlCoord 2, 2 ld de,ContinueText call PlaceString jr .next2 .next1 - FuncCoord 0,0 - ld hl,Coord + hlCoord 0, 0 ld b,4 ld c,13 call TextBoxBorder - FuncCoord 2,2 - ld hl,Coord + hlCoord 2, 2 ld de,NewGameText call PlaceString .next2 - ld hl,$D730 + ld hl,wd730 res 6,[hl] call UpdateSprites ; OAM? xor a - ld [$CC26],a - ld [$CC2A],a - ld [$CC34],a + ld [wCurrentMenuItem],a + ld [wLastMenuItem],a + ld [wMenuJoypadPollCount],a inc a - ld [$CC25],a + ld [wTopMenuItemX],a inc a - ld [$CC24],a + ld [wTopMenuItemY],a ld a,$B - ld [$CC29],a - ld a,[$D088] - ld [$CC28],a + ld [wMenuWatchedKeys],a + ld a,[wd088] + ld [wMaxMenuItem],a call HandleMenuInput bit 1,a jp nz,LoadTitlescreenGraphics ; load title screen (gfx and arrangement) ld c,20 call DelayFrames - ld a,[$CC26] + ld a,[wCurrentMenuItem] ld b,a - ld a,[$D088] + ld a,[wd088] cp a,2 jp z,.next3 inc b ; adjust MenuArrow_Counter @@ -89,19 +84,19 @@ MainMenu: ; 5af2 (1:5af2) jp z,Func_5d52 ; if press_A on NewGame call DisplayOptionMenu ; if press_a on Options ld a,1 - ld [$D08A],a + ld [wd08a],a jp .next0 .next4 call ContinueGame - ld hl,$D126 + ld hl,wd126 set 5,[hl] .next6 xor a - ld [H_NEWLYPRESSEDBUTTONS],a - ld [H_NEWLYRELEASEDBUTTONS],a - ld [H_CURRENTPRESSEDBUTTONS],a - call GetJoypadState - ld a,[H_CURRENTPRESSEDBUTTONS] + ld [hJoyPressed],a + ld [hJoyReleased],a + ld [hJoyHeld],a + call Joypad + ld a,[hJoyHeld] bit 0,a jr nz,.next5 bit 1,a @@ -111,52 +106,50 @@ MainMenu: ; 5af2 (1:5af2) call GBPalWhiteOutWithDelay3 call ClearScreen ld a,4 - ld [$D52A],a + ld [wd52a],a ld c,10 call DelayFrames - ld a,[$D5A2] + ld a,[wd5a2] and a jp z,Func_5d5f ld a,[W_CURMAP] ; map ID cp a,HALL_OF_FAME jp nz,Func_5d5f xor a - ld [$D71A],a - ld hl,$D732 + ld [wd71a],a + ld hl,wd732 set 2,[hl] call Func_62ce jp Func_5d5f Func_5bff: ; 5bff (1:5bff) ld a,1 - ld [$D358],a + ld [wd358],a ld a,3 - ld [$D355],a + ld [W_OPTIONS],a ret LinkMenu: ; 5c0a (1:5c0a) xor a - ld [$d358], a - ld hl, $d72e + ld [wd358], a + ld hl, wd72e set 6, [hl] ld hl, TextTerminator_6b20 ; $6b20 call PrintText call SaveScreenTilesToBuffer1 ld hl, WhereWouldYouLikeText call PrintText - FuncCoord 5, 5 ; $c409 - ld hl, Coord + hlCoord 5, 5 ld b, $6 ld c, $d call TextBoxBorder call UpdateSprites - FuncCoord 7, 7 ; $c433 - ld hl, Coord + hlCoord 7, 7 ld de, TradeCenterText call PlaceString xor a - ld [$cd37], a - ld [$d72d], a - ld hl, wTopMenuItemY ; $cc24 + ld [wcd37], a + ld [wd72d], a + ld hl, wTopMenuItemY ; wTopMenuItemY ld a, $7 ld [hli], a ld a, $6 @@ -176,19 +169,19 @@ LinkMenu: ; 5c0a (1:5c0a) add a add a ld b, a - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem add b add $d0 - ld [$cc42], a - ld [$cc43], a + ld [wcc42], a + ld [wcc43], a .asm_5c66 call Func_2247 - ld a, [$cc3d] + ld a, [wcc3d] ld b, a and $f0 cp $d0 jr z, .asm_5c7d - ld a, [$cc3e] + ld a, [wcc3e] ld b, a and $f0 cp $d0 @@ -197,12 +190,12 @@ LinkMenu: ; 5c0a (1:5c0a) ld a, b and $c jr nz, .asm_5c8b - ld a, [$cc42] + ld a, [wcc42] and $c jr z, .asm_5c52 jr .asm_5ca1 .asm_5c8b - ld a, [$cc42] + ld a, [wcc42] and $c jr z, .asm_5c98 ld a, [$ffaa] @@ -210,9 +203,9 @@ LinkMenu: ; 5c0a (1:5c0a) jr z, .asm_5ca1 .asm_5c98 ld a, b - ld [$cc42], a + ld [wcc42], a and $3 - ld [wCurrentMenuItem], a ; $cc26 + ld [wCurrentMenuItem], a ; wCurrentMenuItem .asm_5ca1 ld a, [$ffaa] cp $2 @@ -225,10 +218,10 @@ LinkMenu: ; 5c0a (1:5c0a) ld b, $7f ld c, $7f ld d, $ec - ld a, [$cc42] + ld a, [wcc42] and $8 jr nz, .asm_5ccc - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem cp $2 jr z, .asm_5ccc ld c, d @@ -239,58 +232,55 @@ LinkMenu: ; 5c0a (1:5c0a) ld c, d .asm_5ccc ld a, b - FuncCoord 6, 7 ; $c432 - ld [Coord], a + Coorda 6, 7 ld a, c - FuncCoord 6, 9 ; $c45a - ld [Coord], a + Coorda 6, 9 ld a, d - FuncCoord 6, 11 ; $c482 - ld [Coord], a + Coorda 6, 11 ld c, $28 call DelayFrames call LoadScreenTilesFromBuffer1 - ld a, [$cc42] + ld a, [wcc42] and $8 jr nz, .asm_5d2d - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem cp $2 jr z, .asm_5d2d xor a - ld [$d700], a - ld a, [wCurrentMenuItem] ; $cc26 + ld [wd700], a + ld a, [wCurrentMenuItem] ; wCurrentMenuItem and a ld a, TRADE_CENTER jr nz, .asm_5cfc ld a, BATTLE_CENTER .asm_5cfc - ld [$d72d], a + ld [wd72d], a ld hl, PleaseWaitText call PrintText ld c, $32 call DelayFrames - ld hl, $d732 + ld hl, wd732 res 1, [hl] - ld a, [W_ANIMATIONID] ; $d07c - ld [$d71a], a + ld a, [W_ANIMATIONID] ; W_ANIMATIONID + ld [wd71a], a call Func_62ce ld c, $14 call DelayFrames xor a - ld [wMenuJoypadPollCount], a ; $cc34 - ld [$cc42], a + ld [wMenuJoypadPollCount], a ; wMenuJoypadPollCount + ld [wcc42], a inc a - ld [W_ISLINKBATTLE], a ; $d12b - ld [$cc47], a + ld [W_ISLINKBATTLE], a ; W_ISLINKBATTLE + ld [wcc47], a jr Func_5d5f .asm_5d2d xor a - ld [wMenuJoypadPollCount], a ; $cc34 + ld [wMenuJoypadPollCount], a ; wMenuJoypadPollCount call Delay3 call Func_72d7 ld hl, LinkCanceledText call PrintText - ld hl, $d72e + ld hl, wd72e res 6, [hl] ret @@ -307,7 +297,7 @@ LinkCanceledText: ; 5d4d (1:5d4d) db "@" Func_5d52: ; 5d52 (1:5d52) - ld hl, $d732 + ld hl, wd732 res 1, [hl] call OakSpeech ld c, $14 @@ -315,16 +305,16 @@ Func_5d52: ; 5d52 (1:5d52) Func_5d5f: ; 5d5f (1:5d5f) xor a - ld [H_NEWLYPRESSEDBUTTONS], a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyPressed], a + ld [hJoyHeld], a ld [$ffb5], a - ld [$d72d], a - ld hl, $d732 + ld [wd72d], a + ld hl, wd732 set 0, [hl] call ResetPlayerSpriteData ld c, $14 call DelayFrames - ld a, [$cc47] + ld a, [wcc47] and a ret nz jp EnterMap @@ -344,27 +334,21 @@ TradeCenterText: ; 5d97 (1:5d97) ContinueGame: ; 5db5 (1:5db5) xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - FuncCoord 4, 7 ; $c430 - ld hl, Coord + hlCoord 4, 7 ld b, $8 ld c, $e call TextBoxBorder - FuncCoord 5, 9 ; $c459 - ld hl, Coord + hlCoord 5, 9 ld de, SaveScreenInfoText call PlaceString - FuncCoord 12, 9 ; $c460 - ld hl, Coord - ld de, W_PLAYERNAME ; $d158 + hlCoord 12, 9 + ld de, wPlayerName ; wd158 call PlaceString - FuncCoord 17, 11 ; $c48d - ld hl, Coord + hlCoord 17, 11 call Func_5e2f - FuncCoord 16, 13 ; $c4b4 - ld hl, Coord + hlCoord 16, 13 call Func_5e42 - FuncCoord 13, 15 ; $c4d9 - ld hl, Coord + hlCoord 13, 15 call Func_5e55 ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba @@ -374,23 +358,23 @@ ContinueGame: ; 5db5 (1:5db5) PrintSaveScreenText: ; 5def (1:5def) xor a ld [H_AUTOBGTRANSFERENABLED], a - ld hl, $c3a4 + ld hl, wTileMap + $4 ld b, $8 ld c, $e call TextBoxBorder call LoadTextBoxTilePatterns call UpdateSprites - ld hl, $c3cd + ld hl, wTileMap + $2d ld de, SaveScreenInfoText call PlaceString - ld hl, $c3d4 - ld de, W_PLAYERNAME + ld hl, wTileMap + $34 + ld de, wPlayerName call PlaceString - ld hl, $c401 + ld hl, wTileMap + $61 call Func_5e2f - ld hl, $c428 + ld hl, wTileMap + $88 call Func_5e42 - ld hl, $c44d + ld hl, wTileMap + $ad call Func_5e55 ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a @@ -403,27 +387,27 @@ Func_5e2f: ; 5e2f (1:5e2f) ld b, $1 call CountSetBits pop hl - ld de, $d11e + ld de, wd11e ld bc, $102 jp PrintNumber Func_5e42: ; 5e42 (1:5e42) push hl - ld hl, wPokedexOwned ; $d2f7 + ld hl, wPokedexOwned ; wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits pop hl - ld de, $d11e + ld de, wd11e ld bc, $103 jp PrintNumber Func_5e55: ; 5e55 (1:5e55) - ld de, $da41 + ld de, W_PLAYTIMEHOURS + 1 ld bc, $103 call PrintNumber ld [hl], $6d inc hl - ld de, $da43 + ld de, W_PLAYTIMEMINUTES + 1 ld bc, $8102 jp PrintNumber @@ -434,47 +418,40 @@ SaveScreenInfoText: ; 5e6a (1:5e6a) next "TIME@" DisplayOptionMenu: ; 5e8a (1:5e8a) - FuncCoord 0,0 - ld hl,Coord + hlCoord 0, 0 ld b,3 ld c,18 call TextBoxBorder - FuncCoord 0,5 - ld hl,Coord + hlCoord 0, 5 ld b,3 ld c,18 call TextBoxBorder - FuncCoord 0,10 - ld hl,Coord + hlCoord 0, 10 ld b,3 ld c,18 call TextBoxBorder - FuncCoord 1,1 - ld hl,Coord + hlCoord 1, 1 ld de,TextSpeedOptionText call PlaceString - FuncCoord 1,6 - ld hl,Coord + hlCoord 1, 6 ld de,BattleAnimationOptionText call PlaceString - FuncCoord 1,11 - ld hl,Coord + hlCoord 1, 11 ld de,BattleStyleOptionText call PlaceString - FuncCoord 2,16 - ld hl,Coord + hlCoord 2, 16 ld de,OptionMenuCancelText call PlaceString xor a ld [wCurrentMenuItem],a ld [wLastMenuItem],a inc a - ld [$d358],a - ld [$cd40],a + ld [wd358],a + ld [wTrainerScreenY],a ld a,3 ; text speed cursor Y coordinate ld [wTopMenuItemY],a call SetCursorPositionsFromOptions - ld a,[$cd3d] ; text speed cursor X coordinate + ld a,[wWhichTrade] ; text speed cursor X coordinate ld [wTopMenuItemX],a ld a,$01 ld [H_AUTOBGTRANSFERENABLED],a ; enable auto background transfer @@ -483,7 +460,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a) call PlaceMenuCursor call SetOptionsFromCursorPositions .getJoypadStateLoop - call GetJoypadStateLowSensitivity + call JoypadLowSensitivity ld a,[$ffb5] ld b,a and a,%11111011 ; any key besides select pressed? @@ -524,7 +501,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a) .downPressed cp a,16 ld b,-13 - ld hl,$cd3d + ld hl,wWhichTrade jr z,.updateMenuVariables ld b,5 cp a,3 @@ -539,7 +516,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a) .upPressed cp a,8 ld b,-5 - ld hl,$cd3d + ld hl,wWhichTrade jr z,.updateMenuVariables cp a,13 inc hl @@ -558,17 +535,17 @@ DisplayOptionMenu: ; 5e8a (1:5e8a) call PlaceUnfilledArrowMenuCursor jp .loop .cursorInBattleAnimation - ld a,[$cd3e] ; battle animation cursor X coordinate + ld a,[wTrainerEngageDistance] ; battle animation cursor X coordinate xor a,$0b ; toggle between 1 and 10 - ld [$cd3e],a + ld [wTrainerEngageDistance],a jp .eraseOldMenuCursor .cursorInBattleStyle - ld a,[$cd3f] ; battle style cursor X coordinate + ld a,[wTrainerFacingDirection] ; battle style cursor X coordinate xor a,$0b ; toggle between 1 and 10 - ld [$cd3f],a + ld [wTrainerFacingDirection],a jp .eraseOldMenuCursor .pressedLeftInTextSpeed - ld a,[$cd3d] ; text speed cursor X coordinate + ld a,[wWhichTrade] ; text speed cursor X coordinate cp a,1 jr z,.updateTextSpeedXCoord cp a,7 @@ -579,7 +556,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a) sub a,7 jr .updateTextSpeedXCoord .pressedRightInTextSpeed - ld a,[$cd3d] ; text speed cursor X coordinate + ld a,[wWhichTrade] ; text speed cursor X coordinate cp a,14 jr z,.updateTextSpeedXCoord cp a,7 @@ -589,7 +566,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a) .fromFastToMedium add a,6 .updateTextSpeedXCoord - ld [$cd3d],a ; text speed cursor X coordinate + ld [wWhichTrade],a ; text speed cursor X coordinate jp .eraseOldMenuCursor TextSpeedOptionText: ; 5fc0 (1:5fc0) @@ -610,7 +587,7 @@ OptionMenuCancelText: ; 6018 (1:6018) ; sets the options variable according to the current placement of the menu cursors in the options menu SetOptionsFromCursorPositions: ; 601f (1:601f) ld hl,TextSpeedOptionData - ld a,[$cd3d] ; text speed cursor X coordinate + ld a,[wWhichTrade] ; text speed cursor X coordinate ld c,a .loop ld a,[hli] @@ -621,7 +598,7 @@ SetOptionsFromCursorPositions: ; 601f (1:601f) .textSpeedMatchFound ld a,[hl] ld d,a - ld a,[$cd3e] ; battle animation cursor X coordinate + ld a,[wTrainerEngageDistance] ; battle animation cursor X coordinate dec a jr z,.battleAnimationOn .battleAnimationOff @@ -630,7 +607,7 @@ SetOptionsFromCursorPositions: ; 601f (1:601f) .battleAnimationOn res 7,d .checkBattleStyle - ld a,[$cd3f] ; battle style cursor X coordinate + ld a,[wTrainerFacingDirection] ; battle style cursor X coordinate dec a jr z,.battleStyleShift .battleStyleSet @@ -655,31 +632,27 @@ SetCursorPositionsFromOptions: ; 604c (1:604c) pop bc dec hl ld a,[hl] - ld [$cd3d],a ; text speed cursor X coordinate - FuncCoord 0,3 - ld hl,Coord + ld [wWhichTrade],a ; text speed cursor X coordinate + hlCoord 0, 3 call .placeUnfilledRightArrow sla c ld a,1 ; On jr nc,.storeBattleAnimationCursorX ld a,10 ; Off .storeBattleAnimationCursorX - ld [$cd3e],a ; battle animation cursor X coordinate - FuncCoord 0,8 - ld hl,Coord + ld [wTrainerEngageDistance],a ; battle animation cursor X coordinate + hlCoord 0, 8 call .placeUnfilledRightArrow sla c ld a,1 jr nc,.storeBattleStyleCursorX ld a,10 .storeBattleStyleCursorX - ld [$cd3f],a ; battle style cursor X coordinate - FuncCoord 0,13 - ld hl,Coord + ld [wTrainerFacingDirection],a ; battle style cursor X coordinate + hlCoord 0, 13 call .placeUnfilledRightArrow ; cursor in front of Cancel - FuncCoord 0,16 - ld hl,Coord + hlCoord 0, 16 ld a,1 .placeUnfilledRightArrow ld e,a diff --git a/engine/menu/naming_screen.asm b/engine/menu/naming_screen.asm index ea6f7de7..17aa96e6 100755 --- a/engine/menu/naming_screen.asm +++ b/engine/menu/naming_screen.asm @@ -1,37 +1,36 @@ -AskForMonNickname: ; 64eb (1:64eb) +AskName: ; 64eb (1:64eb) call SaveScreenTilesToBuffer1 - call Load16BitRegisters + call GetPredefRegisters push hl - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE dec a ld hl, wTileMap ld b, $4 ld c, $b call z, ClearScreenArea ; only if in wild batle - ld a, [$cf91] - ld [$d11e], a + ld a, [wcf91] + ld [wd11e], a call GetMonName ld hl, DoYouWantToNicknameText call PrintText - FuncCoord 14, 7 ; $c43a - ld hl, Coord + hlCoord 14, 7 ld bc, $80f ld a, $14 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID pop hl - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem and a jr nz, .asm_654c - ld a, [$cfcb] + ld a, [wcfcb] push af xor a - ld [$cfcb], a + ld [wcfcb], a push hl ld a, $2 - ld [$d07d], a + ld [wd07d], a call DisplayNamingScreen - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE and a jr nz, .asm_653e call Func_3e08 @@ -39,14 +38,14 @@ AskForMonNickname: ; 64eb (1:64eb) call LoadScreenTilesFromBuffer1 pop hl pop af - ld [$cfcb], a - ld a, [$cf4b] + ld [wcfcb], a + ld a, [wcf4b] cp $50 ret nz .asm_654c ld d, h ld e, l - ld hl, $cd6d + ld hl, wcd6d ld bc, $000b jp CopyData @@ -55,25 +54,25 @@ DoYouWantToNicknameText: ; 0x6557 db "@" Func_655c: ; 655c (1:655c) - ld hl, $cee9 + ld hl, wHPBarMaxHP xor a - ld [$cfcb], a + ld [wcfcb], a ld a, $2 - ld [$d07d], a + ld [wd07d], a call DisplayNamingScreen call GBPalWhiteOutWithDelay3 call Func_3dbe call LoadGBPal - ld a, [$cf4b] + ld a, [wcf4b] cp $50 jr z, .asm_6594 - ld hl, W_PARTYMON1NAME ; $d2b5 + ld hl, wPartyMonNicks ; wPartyMonNicks ld bc, $b - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon call AddNTimes ld e, l ld d, h - ld hl, $cee9 + ld hl, wHPBarMaxHP ld bc, $b call CopyData and a @@ -84,7 +83,7 @@ Func_655c: ; 655c (1:655c) DisplayNamingScreen: ; 6596 (1:6596) push hl - ld hl, $d730 + ld hl, wd730 set 6, [hl] call GBPalWhiteOutWithDelay3 call ClearScreen @@ -94,47 +93,46 @@ DisplayNamingScreen: ; 6596 (1:6596) call LoadHpBarAndStatusTilePatterns call LoadEDTile callba Func_7176c - FuncCoord 0, 4 ; $c3f0 - ld hl, Coord + hlCoord 0, 4 ld b, $9 ld c, $12 call TextBoxBorder call PrintNamingText ld a, $3 - ld [wTopMenuItemY], a ; $cc24 + ld [wTopMenuItemY], a ; wTopMenuItemY ld a, $1 - ld [wTopMenuItemX], a ; $cc25 - ld [wLastMenuItem], a ; $cc2a - ld [wCurrentMenuItem], a ; $cc26 + ld [wTopMenuItemX], a ; wTopMenuItemX + ld [wLastMenuItem], a ; wLastMenuItem + ld [wCurrentMenuItem], a ; wCurrentMenuItem ld a, $ff - ld [wMenuWatchedKeys], a ; $cc29 + ld [wMenuWatchedKeys], a ; wMenuWatchedKeys ld a, $7 - ld [wMaxMenuItem], a ; $cc28 + ld [wMaxMenuItem], a ; wMaxMenuItem ld a, $50 - ld [$cf4b], a + ld [wcf4b], a xor a - ld hl, $ceea + ld hl, wHPBarMaxHP + 1 ld [hli], a ld [hli], a - ld [W_SUBANIMTRANSFORM], a ; $d08b + ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM .asm_65ed call PrintAlphabet call GBPalNormal .asm_65f3 - ld a, [$ceea] + ld a, [wHPBarMaxHP + 1] and a jr nz, .asm_662d call Func_680e .asm_65fc call PlaceMenuCursor .asm_65ff - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem push af callba AnimatePartyMon_ForceSpeed1 pop af - ld [wCurrentMenuItem], a ; $cc26 - call GetJoypadStateLowSensitivity - ld a, [H_NEWLYPRESSEDBUTTONS] + ld [wCurrentMenuItem], a ; wCurrentMenuItem + call JoypadLowSensitivity + ld a, [hJoyPressed] and a jr z, .asm_65ff ld hl, .unknownPointerTable_665e ; $665e @@ -158,19 +156,19 @@ DisplayNamingScreen: ; 6596 (1:6596) jp [hl] .asm_662d pop de - ld hl, $cf4b + ld hl, wcf4b ld bc, $b call CopyData call GBPalWhiteOutWithDelay3 call ClearScreen - call CleanLCD_OAM + call ClearSprites call GoPAL_SET_CF1C call GBPalNormal xor a - ld [W_SUBANIMTRANSFORM], a ; $d08b - ld hl, $d730 + ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM + ld hl, wd730 res 6, [hl] - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE and a jp z, LoadTextBoxTilePatterns ld hl, Func_3ee5b @@ -200,52 +198,52 @@ DisplayNamingScreen: ; 6596 (1:6596) ld de, .asm_65ed ; $65ed push de .asm_6683 - ld a, [$ceeb] + ld a, [wHPBarOldHP] xor $1 - ld [$ceeb], a + ld [wHPBarOldHP], a ret .asm_668c ld a, $1 - ld [$ceea], a + ld [wHPBarMaxHP + 1], a ret .asm_6692 - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem cp $5 jr nz, .asm_66a0 - ld a, [wTopMenuItemX] ; $cc25 + ld a, [wTopMenuItemX] ; wTopMenuItemX cp $11 jr z, .asm_668c .asm_66a0 - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem cp $6 jr nz, .asm_66ae - ld a, [wTopMenuItemX] ; $cc25 + ld a, [wTopMenuItemX] ; wTopMenuItemX cp $1 jr z, .asm_667e .asm_66ae - ld hl, wMenuCursorLocation ; $cc30 + ld hl, wMenuCursorLocation ; wMenuCursorLocation ld a, [hli] ld h, [hl] ld l, a inc hl ld a, [hl] - ld [$ceed], a + ld [wHPBarNewHP], a call CalcStringLength - ld a, [$ceed] + ld a, [wHPBarNewHP] cp $e5 ld de, Dakutens ; $6885 jr z, .asm_66e3 cp $e4 ld de, Handakutens ; $68d6 jr z, .asm_66e3 - ld a, [$d07d] + ld a, [wd07d] cp $2 jr nc, .checkMonNameLength - ld a, [$cee9] + ld a, [wHPBarMaxHP] cp $7 ; max length of player/rival names jr .checkNameLength .checkMonNameLength - ld a, [$cee9] + ld a, [wHPBarMaxHP] cp $a ; max length of pokemon nicknames .checkNameLength jr c, .addLetter @@ -257,14 +255,14 @@ DisplayNamingScreen: ; 6596 (1:6596) ret nc dec hl .addLetter - ld a, [$ceed] + ld a, [wHPBarNewHP] ld [hli], a ld [hl], $50 ld a, (SFX_02_40 - SFX_Headers_02) / 3 call PlaySound ret .deleteLetter - ld a, [$cee9] + ld a, [wHPBarMaxHP] and a ret z call CalcStringLength @@ -272,10 +270,10 @@ DisplayNamingScreen: ; 6596 (1:6596) ld [hl], $50 ret .asm_6702 - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem cp $6 ret z - ld a, [wTopMenuItemX] ; $cc25 + ld a, [wTopMenuItemX] ; wTopMenuItemX cp $11 jp z, .asm_6714 inc a @@ -285,10 +283,10 @@ DisplayNamingScreen: ; 6596 (1:6596) ld a, $1 jr .asm_6755 .asm_6718 - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem cp $6 ret z - ld a, [wTopMenuItemX] ; $cc25 + ld a, [wTopMenuItemX] ; wTopMenuItemX dec a jp z, .asm_6728 dec a @@ -297,35 +295,35 @@ DisplayNamingScreen: ; 6596 (1:6596) ld a, $11 jr .asm_6755 .asm_672c - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem dec a - ld [wCurrentMenuItem], a ; $cc26 + ld [wCurrentMenuItem], a ; wCurrentMenuItem and a ret nz ld a, $6 - ld [wCurrentMenuItem], a ; $cc26 + ld [wCurrentMenuItem], a ; wCurrentMenuItem ld a, $1 jr .asm_6755 .asm_673e - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem inc a - ld [wCurrentMenuItem], a ; $cc26 + ld [wCurrentMenuItem], a ; wCurrentMenuItem cp $7 jr nz, .asm_6750 ld a, $1 - ld [wCurrentMenuItem], a ; $cc26 + ld [wCurrentMenuItem], a ; wCurrentMenuItem jr .asm_6755 .asm_6750 cp $6 ret nz ld a, $1 .asm_6755 - ld [wTopMenuItemX], a ; $cc25 + ld [wTopMenuItemX], a ; wTopMenuItemX jp EraseMenuCursor LoadEDTile: ; 675b (1:675b) ld de, ED_Tile - ld hl, $8f00 + ld hl, vFont + $700 ld bc, $1 jp CopyVideoDataDouble @@ -335,14 +333,13 @@ ED_Tile: ; 6767 (1:6767) PrintAlphabet: ; 676f (1:676f) xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - ld a, [$ceeb] + ld a, [wHPBarOldHP] and a ld de, LowerCaseAlphabet ; $679e jr nz, .asm_677e ld de, UpperCaseAlphabet ; $67d6 .asm_677e - FuncCoord 2, 5 ; $c406 - ld hl, Coord + hlCoord 2, 5 ld bc, $509 .asm_6784 push bc @@ -372,18 +369,15 @@ UpperCaseAlphabet: ; 67d6 (1:67d6) Func_680e: ; 680e (1:680e) call CalcStringLength ld a, c - ld [$cee9], a - FuncCoord 10, 2 ; $c3d2 - ld hl, Coord + ld [wHPBarMaxHP], a + hlCoord 10, 2 ld bc, $10a call ClearScreenArea - FuncCoord 10, 2 ; $c3d2 - ld hl, Coord - ld de, $cf4b + hlCoord 10, 2 + ld de, wcf4b call PlaceString - FuncCoord 10, 3 ; $c3e6 - ld hl, Coord - ld a, [$d07d] + hlCoord 10, 3 + ld a, [wd07d] cp $2 jr nc, .asm_6835 ld b, $7 @@ -396,9 +390,9 @@ Func_680e: ; 680e (1:680e) ld [hli], a dec b jr nz, .asm_6839 - ld a, [$d07d] + ld a, [wd07d] cp $2 - ld a, [$cee9] + ld a, [wHPBarMaxHP] jr nc, .asm_684b cp $7 jr .asm_684d @@ -408,10 +402,10 @@ Func_680e: ; 680e (1:680e) jr nz, .asm_6867 call EraseMenuCursor ld a, $11 - ld [wTopMenuItemX], a ; $cc25 + ld [wTopMenuItemX], a ; wTopMenuItemX ld a, $5 - ld [wCurrentMenuItem], a ; $cc26 - ld a, [$d07d] + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld a, [wd07d] cp $2 ld a, $9 jr nc, .asm_6867 @@ -419,8 +413,7 @@ Func_680e: ; 680e (1:680e) .asm_6867 ld c, a ld b, $0 - FuncCoord 10, 3 ; $c3e6 - ld hl, Coord + hlCoord 10, 3 add hl, bc ld [hl], $77 ret @@ -436,7 +429,7 @@ Func_6871: ; 6871 (1:6871) ret nc inc hl ld a, [hl] - ld [$ceed], a + ld [wHPBarNewHP], a ret Dakutens: ; 6885 (1:6885) @@ -455,9 +448,9 @@ Handakutens: ; 68d6 (1:68d6) db "ハパ", "ヒピ", "フプ", "へぺ", "ホポ" db $ff -; calculates the length of the string at $cf4b and stores it in c +; calculates the length of the string at wcf4b and stores it in c CalcStringLength: ; 68eb (1:68eb) - ld hl, $cf4b + ld hl, wcf4b ld c, $0 .asm_68f0 ld a, [hl] @@ -468,30 +461,27 @@ CalcStringLength: ; 68eb (1:68eb) jr .asm_68f0 PrintNamingText: ; 68f8 (1:68f8) - FuncCoord 0, 1 ; $c3b4 - ld hl, Coord - ld a, [$d07d] + hlCoord 0, 1 + ld a, [wd07d] ld de, YourTextString ; $693f and a jr z, .notNickname ld de, RivalsTextString ; $6945 dec a jr z, .notNickname - ld a, [$cf91] - ld [$cd5d], a + ld a, [wcf91] + ld [wcd5d], a push af callba Func_71882 pop af - ld [$d11e], a + ld [wd11e], a call GetMonName - FuncCoord 4, 1 ; $c3b8 - ld hl, Coord + hlCoord 4, 1 call PlaceString ld hl, $1 add hl, bc ld [hl], $c9 - FuncCoord 1, 3 ; $c3dd - ld hl, Coord + hlCoord 1, 3 ld de, NicknameTextString ; $6953 jr .placeString .notNickname diff --git a/engine/menu/oaks_pc.asm b/engine/menu/oaks_pc.asm index 937786c1..6e7edda2 100755 --- a/engine/menu/oaks_pc.asm +++ b/engine/menu/oaks_pc.asm @@ -5,11 +5,10 @@ OpenOaksPC: ; 1e915 (7:6915) ld hl, GetDexRatedText call PrintText call YesNoChoice - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem and a jr nz, .asm_1e932 - ld a, $56 - call Predef ; indirect jump to DisplayDexRating (44169 (11:4169)) + predef DisplayDexRating .asm_1e932 ld hl, ClosedOaksPCText call PrintText diff --git a/engine/menu/party_menu.asm b/engine/menu/party_menu.asm index dbb6a40e..4e47361b 100755 --- a/engine/menu/party_menu.asm +++ b/engine/menu/party_menu.asm @@ -1,4 +1,4 @@ -; [$D07D] = menu type / message ID +; [wd07d] = menu type / message ID ; if less than $F0, it is a menu type ; menu types: ; 00: normal pokemon menu (e.g. Start menu) @@ -25,18 +25,17 @@ DrawPartyMenu_: ; 12cd2 (4:6cd2) callba Func_71791 ; load pokemon icon graphics RedrawPartyMenu_: ; 12ce3 (4:6ce3) - ld a,[$D07D] + ld a,[wd07d] cp a,$04 jp z,.printMessage call ErasePartyMenuCursors - callba SendBlkPacket_PartyMenu ; loads some data to $cf2e - FuncCoord 3,0 - ld hl,Coord - ld de,W_PARTYMON1 + callba SendBlkPacket_PartyMenu ; loads some data to wcf2e + hlCoord 3, 0 + ld de,wPartySpecies xor a ld c,a ld [$FF8C],a ; loop counter - ld [$CF2D],a + ld [wcf2d],a .loop ld a,[de] cp a,$FF ; reached the terminator? @@ -46,7 +45,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) push hl ld a,c push hl - ld hl,W_PARTYMON1NAME + ld hl,wPartyMonNicks call GetPartyMonName pop hl call PlaceString ; print the pokemon's name @@ -58,7 +57,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) call LoadMonData pop hl push hl - ld a,[$CC35] + ld a,[wcc35] and a ; is the player swapping pokemon positions? jr z,.skipUnfilledRightArrow ; if the player is swapping pokemon positions @@ -76,7 +75,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) inc hl inc hl .skipUnfilledRightArrow - ld a,[$D07D] ; menu type + ld a,[wd07d] ; menu type cp a,$03 jr z,.teachMoveMenu cp a,$05 @@ -84,7 +83,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) push hl ld bc,14 ; 14 columns to the right add hl,bc - ld de,$CF9C + ld de,wcf9c call PrintStatusCondition pop hl push hl @@ -93,8 +92,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) set 0,a ld [$FFF6],a add hl,bc - ld a,$60 - call Predef ; draw HP bar and prints current / max HP + predef Func_128f6 ; draw HP bar and prints current / max HP ld a,[$FFF6] res 0,a ld [$FFF6],a @@ -103,8 +101,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) jr .printLevel .teachMoveMenu push hl - ld a,$43 - call Predef ; check if the pokemon can learn the move + predef CanLearnTM ; check if the pokemon can learn the move pop hl ld de,.ableToLearnMoveText ld a,c @@ -137,25 +134,25 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) push hl ld hl,EvosMovesPointerTable ld b,0 - ld a,[$CF98] ; pokemon ID + ld a,[wcf98] ; pokemon ID dec a add a rl b ld c,a add hl,bc - ld de,$CD6D + ld de,wcd6d ld a,BANK(EvosMovesPointerTable) ld bc,2 call FarCopyData - ld hl,$CD6D + ld hl,wcd6d ld a,[hli] ld h,[hl] ld l,a - ld de,$CD6D + ld de,wcd6d ld a,BANK(EvosMovesPointerTable) ld bc,13 call FarCopyData - ld hl,$CD6D + ld hl,wcd6d ld de,.notAbleToEvolveText ; loop through the pokemon's evolution entries .checkEvolutionsLoop @@ -170,7 +167,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) dec hl dec hl ld b,[hl] - ld a,[$D156] ; evolution stone item ID + ld a,[wd156] ; evolution stone item ID inc hl inc hl inc hl @@ -194,12 +191,12 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) ld b,$0A call GoPAL_SET .printMessage - ld hl,$D730 + ld hl,wd730 ld a,[hl] push af push hl set 6,[hl] ; turn off letter printing delay - ld a,[$D07D] ; message ID + ld a,[wd07d] ; message ID cp a,$F0 jr nc,.printItemUseMessage add a @@ -230,8 +227,8 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) ld h,[hl] ld l,a push hl - ld a,[$CF06] - ld hl,W_PARTYMON1NAME + ld a,[wcf06] + ld hl,wPartyMonNicks call GetPartyMonName pop hl call PrintText @@ -315,14 +312,14 @@ RareCandyText: ; 12ec0 (4:6ec0) db "@" SetPartyMenuHealthBarColor: ; 12ec7 (4:6ec7) - ld hl, $cf1f - ld a, [$cf2d] + ld hl, wcf1f + ld a, [wcf2d] ld c, a ld b, $0 add hl, bc call GetHealthBarColor ld b, $fc call GoPAL_SET - ld hl, $cf2d + ld hl, wcf2d inc [hl] ret diff --git a/engine/menu/pc.asm b/engine/menu/pc.asm index a860c4b3..4df6c826 100755 --- a/engine/menu/pc.asm +++ b/engine/menu/pc.asm @@ -74,7 +74,7 @@ BillsPC: ; 17ee4 (5:7ee4) ld a, (SFX_02_47 - SFX_Headers_02) / 3 call PlaySound ;XXX: play sound or stop music call WaitForSoundToFinish ;XXX: wait for sound to be done - ld a, [$D7F1] ;has to do with having met Bill + ld a, [wd7f1] ;has to do with having met Bill bit 0, a jr nz, .billsPC ;if you've met bill, use that bill's instead of someone's ld hl, AccessedSomeonesPCText @@ -86,7 +86,7 @@ BillsPC: ; 17ee4 (5:7ee4) callba BillsPC_ ReloadMainMenu: ; 17f06 (5:7f06) xor a - ld [$CC3C], a + ld [wcc3c], a call ReloadMapData call UpdateSprites ;XXX: moves sprites jp PCMainMenu @@ -117,7 +117,7 @@ AccessedMyPCText: ; 17f32 (5:7f32) ; removes one of the specified item ID [$FFdb] from bag (if existent) RemoveItemByID: ; 17f37 (5:7f37) - ld hl, wBagItems ; $d31e + ld hl, wBagItems ; wd31e ld a, [$ffdb] ld b, a xor a @@ -135,8 +135,8 @@ RemoveItemByID: ; 17f37 (5:7f37) jr .asm_17f40 .asm_17f4f ld a, $1 - ld [$cf96], a + ld [wcf96], a ld a, [$ffdc] - ld [wWhichPokemon], a ; $cf92 - ld hl, wNumBagItems ; $d31d + ld [wWhichPokemon], a ; wWhichPokemon + ld hl, wNumBagItems ; wNumBagItems jp RemoveItemFromInventory diff --git a/engine/menu/players_pc.asm b/engine/menu/players_pc.asm index a89b745d..4ff1b16f 100755 --- a/engine/menu/players_pc.asm +++ b/engine/menu/players_pc.asm @@ -1,12 +1,12 @@ PlayerPC: ; 78e6 (1:78e6) - ld hl, $d730 + ld hl, wd730 set 6, [hl] ld a, ITEM_NAME ld [W_LISTTYPE], a call SaveScreenTilesToBuffer1 xor a - ld [$cc2c], a - ld [$ccd3], a + ld [wcc2c], a + ld [wccd3], a ld a, [wFlags_0xcd60] bit 3, a jr nz, Func_790c @@ -16,8 +16,8 @@ PlayerPC: ; 78e6 (1:78e6) call PrintText Func_790c: ; 790c (1:790c) - ld a, [$ccd3] - ld [wCurrentMenuItem], a ; $cc26 + ld a, [wccd3] + ld [wCurrentMenuItem], a ; wCurrentMenuItem ld hl, wFlags_0xcd60 set 5, [hl] call LoadScreenTilesFromBuffer2 @@ -26,11 +26,10 @@ Func_790c: ; 790c (1:790c) ld c, $e call TextBoxBorder call UpdateSprites - FuncCoord 2, 2 ; $c3ca - ld hl, Coord + hlCoord 2, 2 ld de, PlayersPCMenuEntries ; $7af5 call PlaceString - ld hl, wTopMenuItemY ; $cc24 + ld hl, wTopMenuItemY ; wTopMenuItemY ld a, $2 ld [hli], a dec a @@ -43,18 +42,18 @@ Func_790c: ; 790c (1:790c) ld [hli], a xor a ld [hl], a - ld hl, wListScrollOffset ; $cc36 + ld hl, wListScrollOffset ; wcc36 ld [hli], a ld [hl], a - ld [wPlayerMonNumber], a ; $cc2f + ld [wPlayerMonNumber], a ; wPlayerMonNumber ld hl, WhatDoYouWantText call PrintText call HandleMenuInput bit 1, a jp nz, Func_796d call PlaceUnfilledArrowMenuCursor - ld a, [wCurrentMenuItem] ; $cc26 - ld [$ccd3], a + ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld [wccd3], a and a jp z, Func_7a12 dec a @@ -74,19 +73,19 @@ Func_796d: ; 796d (1:796d) res 5, [hl] call LoadScreenTilesFromBuffer2 xor a - ld [wListScrollOffset], a ; $cc36 - ld [$cc2c], a - ld hl, $d730 + ld [wListScrollOffset], a ; wcc36 + ld [wcc2c], a + ld hl, wd730 res 6, [hl] xor a - ld [$cc3c], a + ld [wcc3c], a ret Func_7995: ; 7995 (1:7995) xor a - ld [wCurrentMenuItem], a ; $cc26 - ld [wListScrollOffset], a ; $cc36 - ld a, [wNumBagItems] ; $d31d + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wListScrollOffset], a ; wcc36 + ld a, [wNumBagItems] ; wNumBagItems and a jr nz, Func_79ab ld hl, NothingToDepositText @@ -96,21 +95,21 @@ Func_7995: ; 7995 (1:7995) Func_79ab: ; 79ab (1:79ab) ld hl, WhatToDepositText call PrintText - ld hl, wNumBagItems ; $d31d + ld hl, wNumBagItems ; wNumBagItems ld a, l - ld [$cf8b], a + ld [wcf8b], a ld a, h - ld [$cf8c], a + ld [wcf8c], a xor a - ld [$cf93], a + ld [wcf93], a ld a, $3 - ld [wListMenuID], a ; $cf94 + ld [wListMenuID], a ; wListMenuID call DisplayListMenuID jp c, Func_790c call IsKeyItem ld a, $1 - ld [$cf96], a - ld a, [$d124] + ld [wcf96], a + ld a, [wd124] and a jr nz, .asm_79e7 ld hl, DepositHowManyText @@ -119,14 +118,14 @@ Func_79ab: ; 79ab (1:79ab) cp $ff jp z, Func_79ab .asm_79e7 - ld hl, wNumBoxItems ; $d53a + ld hl, wNumBoxItems ; wNumBoxItems call AddItemToInventory jr c, .asm_79f8 ld hl, NoRoomToStoreText call PrintText jp Func_79ab .asm_79f8 - ld hl, wNumBagItems ; $d31d + ld hl, wNumBagItems ; wNumBagItems call RemoveItemFromInventory call WaitForSoundToFinish ld a, (SFX_02_55 - SFX_Headers_02) / 3 @@ -138,9 +137,9 @@ Func_79ab: ; 79ab (1:79ab) Func_7a12: ; 7a12 (1:7a12) xor a - ld [wCurrentMenuItem], a ; $cc26 - ld [wListScrollOffset], a ; $cc36 - ld a, [wNumBoxItems] ; $d53a + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wListScrollOffset], a ; wcc36 + ld a, [wNumBoxItems] ; wNumBoxItems and a jr nz, Func_7a28 ld hl, NothingStoredText @@ -150,21 +149,21 @@ Func_7a12: ; 7a12 (1:7a12) Func_7a28: ; 7a28 (1:7a28) ld hl, WhatToWithdrawText call PrintText - ld hl, wNumBoxItems ; $d53a + ld hl, wNumBoxItems ; wNumBoxItems ld a, l - ld [$cf8b], a + ld [wcf8b], a ld a, h - ld [$cf8c], a + ld [wcf8c], a xor a - ld [$cf93], a + ld [wcf93], a ld a, $3 - ld [wListMenuID], a ; $cf94 + ld [wListMenuID], a ; wListMenuID call DisplayListMenuID jp c, Func_790c call IsKeyItem ld a, $1 - ld [$cf96], a - ld a, [$d124] + ld [wcf96], a + ld a, [wd124] and a jr nz, .asm_7a64 ld hl, WithdrawHowManyText @@ -173,14 +172,14 @@ Func_7a28: ; 7a28 (1:7a28) cp $ff jp z, Func_7a28 .asm_7a64 - ld hl, wNumBagItems ; $d31d + ld hl, wNumBagItems ; wNumBagItems call AddItemToInventory jr c, .asm_7a75 ld hl, CantCarryMoreText call PrintText jp Func_7a28 .asm_7a75 - ld hl, wNumBoxItems ; $d53a + ld hl, wNumBoxItems ; wNumBoxItems call RemoveItemFromInventory call WaitForSoundToFinish ld a, (SFX_02_55 - SFX_Headers_02) / 3 @@ -192,9 +191,9 @@ Func_7a28: ; 7a28 (1:7a28) Func_7a8f: ; 7a8f (1:7a8f) xor a - ld [wCurrentMenuItem], a ; $cc26 - ld [wListScrollOffset], a ; $cc36 - ld a, [wNumBoxItems] ; $d53a + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wListScrollOffset], a ; wcc36 + ld a, [wNumBoxItems] ; wNumBoxItems and a jr nz, Func_7aa5 ld hl, NothingStoredText @@ -204,15 +203,15 @@ Func_7a8f: ; 7a8f (1:7a8f) Func_7aa5: ; 7aa5 (1:7aa5) ld hl, WhatToTossText call PrintText - ld hl, wNumBoxItems ; $d53a + ld hl, wNumBoxItems ; wNumBoxItems ld a, l - ld [$cf8b], a + ld [wcf8b], a ld a, h - ld [$cf8c], a + ld [wcf8c], a xor a - ld [$cf93], a + ld [wcf93], a ld a, $3 - ld [wListMenuID], a ; $cf94 + ld [wListMenuID], a ; wListMenuID push hl call DisplayListMenuID pop hl @@ -221,11 +220,11 @@ Func_7aa5: ; 7aa5 (1:7aa5) call IsKeyItem pop hl ld a, $1 - ld [$cf96], a - ld a, [$d124] + ld [wcf96], a + ld a, [wd124] and a jr nz, .asm_7aef - ld a, [$cf91] + ld a, [wcf91] call IsItemHM jr c, .asm_7aef push hl diff --git a/engine/menu/pokedex.asm b/engine/menu/pokedex.asm index dbb9f57f..63e440f8 100755 --- a/engine/menu/pokedex.asm +++ b/engine/menu/pokedex.asm @@ -1,4 +1,4 @@ -DisplayPokedexMenu_: ; 40000 (10:4000) +ShowPokedexMenu: ; 40000 (10:4000) call GBPalWhiteOut call ClearScreen call UpdateSprites ; move sprites @@ -9,7 +9,7 @@ DisplayPokedexMenu_: ; 40000 (10:4000) ld [wListScrollOffset],a ld [wLastMenuItem],a inc a - ld [$d11e],a + ld [wd11e],a ld [$ffb7],a .setUpGraphics ld b,$08 @@ -22,7 +22,7 @@ DisplayPokedexMenu_: ; 40000 (10:4000) xor a ld [hli],a ; top menu item X inc a - ld [$cc37],a + ld [wcc37],a inc hl inc hl ld a,6 @@ -32,12 +32,12 @@ DisplayPokedexMenu_: ; 40000 (10:4000) jr c,.goToSideMenu ; if the player chose a pokemon from the list .exitPokedex xor a - ld [$cc37],a + ld [wcc37],a ld [wCurrentMenuItem],a ld [wLastMenuItem],a ld [$ffb7],a - ld [$cd3a],a - ld [$cd3b],a + ld [wcd3a],a + ld [wcd3b],a pop af ld [wListScrollOffset],a call GBPalWhiteOutWithDelay3 @@ -68,10 +68,10 @@ HandlePokedexSideMenu: ; 4006d (10:406d) push af add b inc a - ld [$d11e],a - ld a,[$d11e] + ld [wd11e],a + ld a,[wd11e] push af - ld a,[$cd3d] + ld a,[wWhichTrade] push af ld hl,wPokedexSeen call IsPokemonBitSet @@ -91,7 +91,7 @@ HandlePokedexSideMenu: ; 4006d (10:406d) ld [hli],a ; menu watched keys (A button and B button) xor a ld [hli],a ; old menu item ID - ld [$cc37],a + ld [wcc37],a .handleMenuInput call HandleMenuInput bit 1,a ; was the B button pressed? @@ -108,9 +108,9 @@ HandlePokedexSideMenu: ; 4006d (10:406d) ld b,1 .exitSideMenu pop af - ld [$cd3d],a + ld [wWhichTrade],a pop af - ld [$d11e],a + ld [wd11e],a pop af ld [wListScrollOffset],a pop af @@ -118,8 +118,7 @@ HandlePokedexSideMenu: ; 4006d (10:406d) pop af ld [wCurrentMenuItem],a push bc - FuncCoord 0,3 - ld hl,Coord + hlCoord 0, 3 ld de,20 ld bc,$7f0d ; 13 blank tiles call DrawTileLine ; cover up the menu cursor in the pokemon list @@ -127,8 +126,7 @@ HandlePokedexSideMenu: ; 4006d (10:406d) ret .buttonBPressed push bc - FuncCoord 15,10 - ld hl,Coord + hlCoord 15, 10 ld de,20 ld bc,$7f07 ; 7 blank tiles call DrawTileLine ; cover up the menu cursor in the side menu @@ -140,13 +138,12 @@ HandlePokedexSideMenu: ; 4006d (10:406d) jr .exitSideMenu ; play pokemon cry .choseCry - ld a,[$d11e] + ld a,[wd11e] call GetCryData ; get cry data call PlaySound ; play sound jr .handleMenuInput .choseArea - ld a,$4a - call Predef ; display pokemon areas + predef LoadTownMap_Nest ; display pokemon areas ld b,0 jr .exitSideMenu @@ -156,53 +153,43 @@ HandlePokedexListMenu: ; 40111 (10:4111) xor a ld [H_AUTOBGTRANSFERENABLED],a ; draw the horizontal line separating the seen and owned amounts from the menu - FuncCoord 15,8 - ld hl,Coord + hlCoord 15, 8 ld a,$7a ; horizontal line tile ld [hli],a ld [hli],a ld [hli],a ld [hli],a ld [hli],a - FuncCoord 14,0 - ld hl,Coord + hlCoord 14, 0 ld [hl],$71 ; vertical line tile - FuncCoord 14,1 - ld hl,Coord + hlCoord 14, 1 call DrawPokedexVerticalLine - FuncCoord 14,9 - ld hl,Coord + hlCoord 14, 9 call DrawPokedexVerticalLine ld hl,wPokedexSeen ld b,wPokedexSeenEnd - wPokedexSeen call CountSetBits - ld de,$d11e - FuncCoord 16,3 - ld hl,Coord + ld de,wd11e + hlCoord 16, 3 ld bc,$0103 call PrintNumber ; print number of seen pokemon ld hl,wPokedexOwned ld b,wPokedexOwnedEnd - wPokedexOwned call CountSetBits - ld de,$d11e - FuncCoord 16,6 - ld hl,Coord + ld de,wd11e + hlCoord 16, 6 ld bc,$0103 call PrintNumber ; print number of owned pokemon - FuncCoord 16,2 - ld hl,Coord + hlCoord 16, 2 ld de,PokedexSeenText call PlaceString - FuncCoord 16,5 - ld hl,Coord + hlCoord 16, 5 ld de,PokedexOwnText call PlaceString - FuncCoord 1,1 - ld hl,Coord + hlCoord 1, 1 ld de,PokedexContentsText call PlaceString - FuncCoord 16,10 - ld hl,Coord + hlCoord 16, 10 ld de,PokedexMenuItemsText call PlaceString ; find the highest pokedex number among the pokemon the player has seen @@ -220,20 +207,18 @@ HandlePokedexListMenu: ; 40111 (10:4111) jr .maxSeenPokemonLoop .storeMaxSeenPokemon ld a,b - ld [$cd3d],a ; max seen pokemon + ld [wWhichTrade],a ; max seen pokemon .loop xor a ld [H_AUTOBGTRANSFERENABLED],a - FuncCoord 4,2 - ld hl,Coord + hlCoord 4, 2 ld bc,$0e0a call ClearScreenArea - FuncCoord 1,3 - ld hl,Coord + hlCoord 1, 3 ld a,[wListScrollOffset] - ld [$d11e],a + ld [wd11e],a ld d,7 - ld a,[$cd3d] + ld a,[wWhichTrade] cp a,7 jr nc,.printPokemonLoop ld d,a @@ -242,15 +227,15 @@ HandlePokedexListMenu: ; 40111 (10:4111) ; loop to print pokemon pokedex numbers and names ; if the player has owned the pokemon, it puts a pokeball beside the name .printPokemonLoop - ld a,[$d11e] + ld a,[wd11e] inc a - ld [$d11e],a + ld [wd11e],a push af push de push hl ld de,-20 add hl,de - ld de,$d11e + ld de,wd11e ld bc,$8103 call PrintNumber ; print the pokedex number ld de,20 @@ -285,7 +270,7 @@ HandlePokedexListMenu: ; 40111 (10:4111) add hl,bc pop de pop af - ld [$d11e],a + ld [wd11e],a dec d jr nz,.printPokemonLoop ld a,01 @@ -309,7 +294,7 @@ HandlePokedexListMenu: ; 40111 (10:4111) bit 7,a ; was Down pressed? jr z,.checkIfRightPressed .downPressed ; scroll down one row - ld a,[$cd3d] + ld a,[wWhichTrade] cp a,7 jp c,.loop sub a,7 @@ -324,7 +309,7 @@ HandlePokedexListMenu: ; 40111 (10:4111) bit 4,a ; was Right pressed? jr z,.checkIfLeftPressed .rightPressed ; scroll down 7 rows - ld a,[$cd3d] + ld a,[wWhichTrade] cp a,7 jp c,.loop sub a,6 @@ -385,15 +370,14 @@ PokedexMenuItemsText: ; 402af (10:42af) ; tests if a pokemon's bit is set in the seen or owned pokemon bit fields ; INPUT: -; [$d11e] = pokedex number +; [wd11e] = pokedex number ; hl = address of bit field IsPokemonBitSet: ; 402c2 (10:42c2) - ld a,[$d11e] + ld a,[wd11e] dec a ld c,a ld b,2 - ld a,$10 - call Predef + predef FlagActionPredef ld a,c and a ret @@ -407,67 +391,56 @@ ShowPokedexData: ; 402d1 (10:42d1) ; function to display pokedex data from inside the pokedex ShowPokedexDataInternal: ; 402e2 (10:42e2) - ld hl,$d72c + ld hl,wd72c set 1,[hl] ld a,$33 ; 3/7 volume ld [$ff24],a call GBPalWhiteOut ; zero all palettes call ClearScreen - ld a,[$d11e] ; pokemon ID - ld [$cf91],a + ld a,[wd11e] ; pokemon ID + ld [wcf91],a push af ld b,04 call GoPAL_SET pop af - ld [$d11e],a + ld [wd11e],a ld a,[$ffd7] push af xor a ld [$ffd7],a - FuncCoord 0,0 - ld hl,Coord + hlCoord 0, 0 ld de,1 ld bc,$6414 call DrawTileLine ; draw top border - FuncCoord 0,17 - ld hl,Coord + hlCoord 0, 17 ld b,$6f call DrawTileLine ; draw bottom border - FuncCoord 0,1 - ld hl,Coord + hlCoord 0, 1 ld de,20 ld bc,$6610 call DrawTileLine ; draw left border - FuncCoord 19,1 - ld hl,Coord + hlCoord 19, 1 ld b,$67 call DrawTileLine ; draw right border - FuncCoord 0,0 ld a,$63 ; upper left corner tile - ld [Coord],a - FuncCoord 19,0 + Coorda 0, 0 ld a,$65 ; upper right corner tile - ld [Coord],a - FuncCoord 0,17 + Coorda 19, 0 ld a,$6c ; lower left corner tile - ld [Coord],a - FuncCoord 19,17 + Coorda 0, 17 ld a,$6e ; lower right corner tile - ld [Coord],a - FuncCoord 0,9 - ld hl,Coord + Coorda 19, 17 + hlCoord 0, 9 ld de,PokedexDataDividerLine call PlaceString ; draw horizontal divider line - FuncCoord 9,6 - ld hl,Coord + hlCoord 9, 6 ld de,HeightWeightText call PlaceString call GetMonName - FuncCoord 9,2 - ld hl,Coord + hlCoord 9, 2 call PlaceString ld hl,PokedexEntryPointers - ld a,[$d11e] + ld a,[wd11e] dec a ld e,a ld d,0 @@ -476,30 +449,28 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) ld a,[hli] ld e,a ld d,[hl] ; de = address of pokedex entry - FuncCoord 9,4 - ld hl,Coord + hlCoord 9, 4 call PlaceString ; print species name ld h,b ld l,c push de - ld a,[$d11e] + ld a,[wd11e] push af call IndexToPokedex - FuncCoord 2,8 - ld hl,Coord + hlCoord 2, 8 ld a, "№" ld [hli],a ld a,$f2 ld [hli],a - ld de,$d11e + ld de,wd11e ld bc,$8103 call PrintNumber ; print pokedex number ld hl,wPokedexOwned call IsPokemonBitSet pop af - ld [$d11e],a - ld a,[$cf91] - ld [$d0b5],a + ld [wd11e],a + ld a,[wcf91] + ld [wd0b5],a pop de push af push bc @@ -508,10 +479,9 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) call Delay3 call GBPalNormal call GetMonHeader ; load pokemon picture location - FuncCoord 1,1 - ld hl,Coord + hlCoord 1, 1 call LoadFlippedFrontSpriteByMonIndex ; draw pokemon picture - ld a,[$cf91] + ld a,[wcf91] call PlayCry ; play pokemon cry pop hl pop de @@ -522,16 +492,14 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) jp z,.waitForButtonPress ; if the pokemon has not been owned, don't print the height, weight, or description inc de ; de = address of feet (height) ld a,[de] ; reads feet, but a is overwritten without being used - FuncCoord 12,6 - ld hl,Coord + hlCoord 12, 6 ld bc,$0102 call PrintNumber ; print feet (height) ld a,$60 ; feet symbol tile (one tick) ld [hl],a inc de inc de ; de = address of inches (height) - FuncCoord 15,6 - ld hl,Coord + hlCoord 15, 6 ld bc,$8102 call PrintNumber ; print inches (height) ld a,$61 ; inches symbol tile (two ticks) @@ -552,13 +520,11 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) dec de ld a,[de] ; a = lower byte of weight ld [hl],a ; store lower byte of weight in [$ff8c] - FuncCoord 11,8 ld de,$ff8b - ld hl,Coord + hlCoord 11, 8 ld bc,$0205 ; no leading zeroes, right-aligned, 2 bytes, 5 digits call PrintNumber ; print weight - FuncCoord 14,8 - ld hl,Coord + hlCoord 14, 8 ld a,[$ff8c] sub a,10 ld a,[$ff8b] @@ -576,15 +542,14 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) ld [$ff8b],a ; restore original value of [$ff8b] pop hl inc hl ; hl = address of pokedex description text - FuncCoord 1,11 - ld bc,Coord + bcCoord 1, 11 ld a,2 ld [$fff4],a call TextCommandProcessor ; print pokedex description text xor a ld [$fff4],a .waitForButtonPress - call GetJoypadStateLowSensitivity + call JoypadLowSensitivity ld a,[$ffb5] and a,%00000011 ; A button and B button jr z,.waitForButtonPress @@ -595,7 +560,7 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) call GoPAL_SET_CF1C call LoadTextBoxTilePatterns call GBPalNormal - ld hl,$d72c + ld hl,wd72c res 1,[hl] ld a,$77 ; max volume ld [$ff24],a @@ -637,10 +602,10 @@ DrawTileLine: ; 40474 (10:4474) INCLUDE "data/pokedex_entries.asm" PokedexToIndex: ; 40ff9 (10:4ff9) - ; converts the Pokédex number at $D11E to an index + ; converts the Pokédex number at wd11e to an index push bc push hl - ld a,[$D11E] + ld a,[wd11e] ld b,a ld c,0 ld hl,PokedexOrder @@ -652,23 +617,23 @@ PokedexToIndex: ; 40ff9 (10:4ff9) jr nz,.loop ld a,c - ld [$D11E],a + ld [wd11e],a pop hl pop bc ret IndexToPokedex: ; 41010 (10:5010) - ; converts the indexédex number at $D11E to a Pokédex number + ; converts the indexédex number at wd11e to a Pokédex number push bc push hl - ld a,[$D11E] + ld a,[wd11e] dec a ld hl,PokedexOrder ld b,0 ld c,a add hl,bc ld a,[hl] - ld [$D11E],a + ld [wd11e],a pop hl pop bc ret diff --git a/engine/menu/prize_menu.asm b/engine/menu/prize_menu.asm index 79de7029..141b9beb 100755 --- a/engine/menu/prize_menu.asm +++ b/engine/menu/prize_menu.asm @@ -5,25 +5,24 @@ CeladonPrizeMenu: ; 5271b (14:671b) ld hl,RequireCoinCaseTextPtr jp PrintText .havingCoinCase - ld hl,$D730 + ld hl,wd730 set 6,[hl] ld hl,ExchangeCoinsForPrizesTextPtr call PrintText ; the following are the menu settings xor a - ld [$CC26],a - ld [$CC2A],a + ld [wCurrentMenuItem],a + ld [wLastMenuItem],a ld a,$03 - ld [$CC29],a + ld [wMenuWatchedKeys],a ld a,$03 - ld [$CC28],a + ld [wMaxMenuItem],a ld a,$04 - ld [$CC24],a + ld [wTopMenuItemY],a ld a,$01 - ld [$CC25],a + ld [wTopMenuItemX],a call PrintPrizePrice ; 687A - FuncCoord 0,2 - ld hl,Coord + hlCoord 0, 2 ld b,$08 ld c,$10 call TextBoxBorder @@ -34,12 +33,12 @@ CeladonPrizeMenu: ; 5271b (14:671b) call HandleMenuInput ; menu choice handler bit 1,a ; keypress = B (Cancel) jr nz,.NoChoice - ld a,[$CC26] + ld a,[wCurrentMenuItem] cp a,$03 ; "NO,THANKS" choice jr z,.NoChoice call HandlePrizeChoice ; 14:68C6 .NoChoice - ld hl,$D730 + ld hl,wd730 res 6,[hl] ret @@ -60,14 +59,14 @@ GetPrizeMenuId: ; 5278e (14:678e) ; determine which one among the three ; prize-texts has been selected ; using the text ID (stored in [$FF8C]) -; load the three prizes at $D13D-$D13F -; load the three prices at $D141-$D146 +; load the three prizes at wd13d-wd13f +; load the three prices at wd141-wd146 ; display the three prizes' names ; (distinguishing between Pokemon names ; and Items (specifically TMs) names) ld a,[$FF8C] sub a,$03 ; prize-texts' id are 3, 4 and 5 - ld [$D12F],a ; prize-texts' id (relative, i.e. 0, 1 or 2) + ld [wd12f],a ; prize-texts' id (relative, i.e. 0, 1 or 2) add a add a ld d,$00 @@ -85,59 +84,51 @@ GetPrizeMenuId: ; 5278e (14:678e) ld a,[hli] ld h,[hl] ld l,a - ld de,$D141 + ld de,wd141 ld bc,$0006 call CopyData - ld a,[$D12F] + ld a,[wd12f] cp a,$02 ;is TM_menu? jr nz,.putMonName ld a,[W_PRIZE1] - ld [$D11E],a + ld [wd11e],a call GetItemName - FuncCoord 2,4 - ld hl,Coord + hlCoord 2, 4 call PlaceString ld a,[W_PRIZE2] - ld [$D11E],a + ld [wd11e],a call GetItemName - FuncCoord 2,6 - ld hl,Coord + hlCoord 2, 6 call PlaceString ld a,[W_PRIZE3] - ld [$D11E],a + ld [wd11e],a call GetItemName - FuncCoord 2,8 - ld hl,Coord + hlCoord 2, 8 call PlaceString jr .putNoThanksText .putMonName ; 14:67EC ld a,[W_PRIZE1] - ld [$D11E],a + ld [wd11e],a call GetMonName - FuncCoord 2,4 - ld hl,Coord + hlCoord 2, 4 call PlaceString ld a,[W_PRIZE2] - ld [$D11E],a + ld [wd11e],a call GetMonName - FuncCoord 2,6 - ld hl,Coord + hlCoord 2, 6 call PlaceString ld a,[W_PRIZE3] - ld [$D11E],a + ld [wd11e],a call GetMonName - FuncCoord 2,8 - ld hl,Coord + hlCoord 2, 8 call PlaceString .putNoThanksText ; 14:6819 - FuncCoord 2,10 - ld hl,Coord + hlCoord 2, 10 ld de,NoThanksText call PlaceString ; put prices on the right side of the textbox - ld de,$D141 - FuncCoord 13,5 - ld hl,Coord + ld de,wd141 + hlCoord 13, 5 ; reg. c: ; [low nybble] number of bytes ; [bit 765 = %100] space-padding (not zero-padding) @@ -145,36 +136,30 @@ GetPrizeMenuId: ; 5278e (14:678e) ; Function $15CD displays BCD value (same routine ; used by text-command $02) call PrintBCDNumber ; Print_BCD - ld de,$D143 - FuncCoord 13,7 - ld hl,Coord + ld de,wd143 + hlCoord 13, 7 ld c,(%1 << 7 | 2) call PrintBCDNumber - ld de,$D145 - FuncCoord 13,9 - ld hl,Coord + ld de,wd145 + hlCoord 13, 9 ld c,(1 << 7 | 2) jp PrintBCDNumber INCLUDE "data/prizes.asm" PrintPrizePrice: ; 5287a (14:687a) - FuncCoord 11,0 - ld hl,Coord + hlCoord 11, 0 ld b,$01 ld c,$07 call TextBoxBorder call UpdateSprites ; XXX save OAM? - FuncCoord 12,0 - ld hl,Coord + hlCoord 12, 0 ld de,.CoinText call PlaceString - FuncCoord 13,1 - ld hl,Coord + hlCoord 13, 1 ld de,.SixSpacesText call PlaceString - FuncCoord 13,1 - ld hl,Coord + hlCoord 13, 1 ld de,wPlayerCoins ld c,%10000010 call PrintBCDNumber @@ -187,11 +172,11 @@ PrintPrizePrice: ; 5287a (14:687a) db " @" LoadCoinsToSubtract: ; 528b1 (14:68b1) - ld a,[$D139] ; backup of selected menu_entry + ld a,[wd139] ; backup of selected menu_entry add a ld d,$00 ld e,a - ld hl,$D141 ; first prize's price + ld hl,wd141 ; first prize's price add hl,de ; get selected prize's price xor a ld [$FF9F],a @@ -202,15 +187,15 @@ LoadCoinsToSubtract: ; 528b1 (14:68b1) ret HandlePrizeChoice: ; 528c6 (14:68c6) - ld a,[$CC26] ; selected menu_entry - ld [$D139],a + ld a,[wCurrentMenuItem] ; selected menu_entry + ld [wd139],a ld d,$00 ld e,a ld hl,W_PRIZE1 add hl,de ld a,[hl] - ld [$D11E],a - ld a,[$D12F] + ld [wd11e],a + ld a,[wd12f] cp a,$02 ; is prize a TM? jr nz,.GetMonName call GetItemName @@ -221,16 +206,16 @@ HandlePrizeChoice: ; 528c6 (14:68c6) ld hl,SoYouWantPrizeTextPtr call PrintText call YesNoChoice ; yes/no textbox - ld a,[$CC26] ; yes/no answer (Y=0, N=1) + ld a,[wCurrentMenuItem] ; yes/no answer (Y=0, N=1) and a jr nz,.PrintOhFineThen call LoadCoinsToSubtract call HasEnoughCoins jr c,.NotEnoughCoins - ld a,[$D12F] + ld a,[wd12f] cp a,$02 jr nz,.GiveMon - ld a,[$D11E] + ld a,[wd11e] ld b,a ld a,1 ld c,a @@ -238,8 +223,8 @@ HandlePrizeChoice: ; 528c6 (14:68c6) jr nc,.BagFull jr .SubtractCoins .GiveMon ; 14:6912 - ld a,[$D11E] - ld [$CF91],a + ld a,[wd11e] + ld [wcf91],a push af call GetPrizeMonLevel ; 14:6977 ld c,a @@ -247,7 +232,7 @@ HandlePrizeChoice: ; 528c6 (14:68c6) ld b,a call GivePokemon push af - ld a,[$CCD3] ; XXX is there room? + ld a,[wccd3] ; XXX is there room? and a call z,WaitForTextScrollButtonPress pop af @@ -257,8 +242,7 @@ HandlePrizeChoice: ; 528c6 (14:68c6) ld hl,$FFA1 ld de,wPlayerCoins + 1 ld c,$02 ; how many bytes - ld a,$0C - call Predef ; subtract coins (BCD daa operations) + predef SubBCDPredef ; subtract coins (BCD daa operations) jp PrintPrizePrice .BagFull ld hl,PrizeRoomBagIsFullTextPtr @@ -299,7 +283,7 @@ OhFineThenTextPtr: ; 52971 (14:6971) db "@" GetPrizeMonLevel: ; 52977 (14:6977) - ld a,[$CF91] + ld a,[wcf91] ld b,a ld hl,PrizeMonLevelDictionary .loop ; 14:697E @@ -310,7 +294,7 @@ GetPrizeMonLevel: ; 52977 (14:6977) jr .loop .matchFound ; 14:6985 ld a,[hl] - ld [$D127],a + ld [W_CURENEMYLVL],a ret INCLUDE "data/prize_mon_levels.asm" diff --git a/engine/menu/start_menu.asm b/engine/menu/start_menu.asm index 774f604d..be172a67 100755 --- a/engine/menu/start_menu.asm +++ b/engine/menu/start_menu.asm @@ -2,8 +2,8 @@ DisplayStartMenu:: ; 2acd (0:2acd) ld a,$04 ; hardcoded Bank, not sure what's it refers to ld [H_LOADEDROMBANK],a ld [$2000],a ; ROM bank 4 - ld a,[$d700] ; walking/biking/surfing - ld [$d11a],a + ld a,[wd700] ; walking/biking/surfing + ld [wd11a],a ld a, (SFX_02_3f - SFX_Headers_02) / 3 ; Start menu sound call PlaySound @@ -24,7 +24,7 @@ RedisplayStartMenu:: ; 2adf (0:2adf) and a jr nz,.loop ; if the player pressed tried to go past the top item, wrap around to the bottom - ld a,[$d74b] + ld a,[wd74b] bit 5,a ; does the player have the pokedex? ld a,6 ; there are 7 menu items with the pokedex, so the max index is 6 jr nz,.wrapMenuItemId @@ -37,7 +37,7 @@ RedisplayStartMenu:: ; 2adf (0:2adf) bit 7,a jr z,.buttonPressed ; if the player pressed tried to go past the bottom item, wrap around to the top - ld a,[$d74b] + ld a,[wd74b] bit 5,a ; does the player have the pokedex? ld a,[wCurrentMenuItem] ld c,7 ; there are 7 menu items with the pokedex @@ -54,12 +54,12 @@ RedisplayStartMenu:: ; 2adf (0:2adf) .buttonPressed ; A, B, or Start button pressed call PlaceUnfilledArrowMenuCursor ld a,[wCurrentMenuItem] - ld [$cc2d],a ; save current menu item ID + ld [wcc2d],a ; save current menu item ID ld a,b and a,%00001010 ; was the Start button or B button pressed? jp nz,CloseStartMenu call SaveScreenTilesToBuffer2 ; copy background from wTileMap to wTileMapBackup2 - ld a,[$d74b] + ld a,[wd74b] bit 5,a ; does the player have the pokedex? ld a,[wCurrentMenuItem] jr nz,.displayMenuItem @@ -80,8 +80,8 @@ RedisplayStartMenu:: ; 2adf (0:2adf) ; EXIT falls through to here CloseStartMenu:: ; 2b70 (0:2b70) - call GetJoypadState - ld a,[H_NEWLYPRESSEDBUTTONS] + call Joypad + ld a,[hJoyPressed] bit 0,a ; was A button newly pressed? jr nz,CloseStartMenu call LoadTextBoxTilePatterns diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm index 60893d81..7c6fe4d6 100755 --- a/engine/menu/start_sub_menus.asm +++ b/engine/menu/start_sub_menus.asm @@ -1,6 +1,5 @@ StartMenu_Pokedex: ; 13095 (4:7095) - ld a,$29 - call Predef + predef ShowPokedexMenu call LoadScreenTilesFromBuffer2 ; restore saved screen call Delay3 call LoadGBPal @@ -8,19 +7,19 @@ StartMenu_Pokedex: ; 13095 (4:7095) jp RedisplayStartMenu StartMenu_Pokemon: ; 130a9 (4:70a9) - ld a,[W_NUMINPARTY] + ld a,[wPartyCount] and a jp z,RedisplayStartMenu xor a - ld [$cc35],a - ld [$d07d],a - ld [$cfcb],a + ld [wcc35],a + ld [wd07d],a + ld [wcfcb],a call DisplayPartyMenu jr .checkIfPokemonChosen .loop xor a - ld [$cc35],a - ld [$d07d],a + ld [wcc35],a + ld [wd07d],a call GoBackToPartyMenu .checkIfPokemonChosen jr nc,.chosePokemon @@ -32,9 +31,9 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) .chosePokemon call SaveScreenTilesToBuffer1 ; save screen ld a,$04 - ld [$d125],a + ld [wd125],a call DisplayTextBoxID ; display pokemon menu options - ld hl,$cd3d + ld hl,wWhichTrade ld bc,$020c ; max menu item ID, top menu item Y ld e,5 .adjustMenuVariablesLoop @@ -82,32 +81,30 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) jp z,.choseStats ld c,a ld b,0 - ld hl,$cd3d + ld hl,wWhichTrade add hl,bc jp .choseOutOfBattleMove .choseSwitch - ld a,[W_NUMINPARTY] + ld a,[wPartyCount] cp a,2 ; is there more than one pokemon in the party? jp c,StartMenu_Pokemon ; if not, no switching call SwitchPartyMon_Stats ld a,$04 ; swap pokemon positions menu - ld [$d07d],a + ld [wd07d],a call GoBackToPartyMenu jp .checkIfPokemonChosen .choseStats - call CleanLCD_OAM + call ClearSprites xor a - ld [$cc49],a - ld a,$36 - call Predef - ld a,$37 - call Predef + ld [wcc49],a + predef StatusScreen + predef StatusScreen2 call ReloadMapData jp StartMenu_Pokemon .choseOutOfBattleMove push hl ld a,[wWhichPokemon] - ld hl,W_PARTYMON1NAME + ld hl,wPartyMonNicks call GetPartyMonName pop hl ld a,[hl] @@ -138,26 +135,25 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) call CheckIfInOutsideMap jr z,.canFly ld a,[wWhichPokemon] - ld hl,W_PARTYMON1NAME + ld hl,wPartyMonNicks call GetPartyMonName ld hl,.cannotFlyHereText call PrintText jp .loop .canFly call ChooseFlyDestination - ld a,[$d732] + ld a,[wd732] bit 3,a ; did the player decide to fly? jp nz,.goBackToMap call LoadFontTilePatterns - ld hl,$d72e + ld hl,wd72e set 1,[hl] jp StartMenu_Pokemon .cut bit 1,a ; does the player have the Cascade Badge? jp z,.newBadgeRequired - ld a,$3c - call Predef - ld a,[$cd6a] + predef UsedCut + ld a,[wcd6a] and a jp z,.loop jp CloseTextDisplay @@ -165,15 +161,15 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) bit 4,a ; does the player have the Soul Badge? jp z,.newBadgeRequired callba CheckForForcedBikeSurf - ld hl,$d728 + ld hl,wd728 bit 1,[hl] res 1,[hl] jp z,.loop ld a,SURFBOARD - ld [$cf91],a - ld [$d152],a + ld [wcf91],a + ld [wd152],a call UseItem - ld a,[$cd6a] + ld a,[wcd6a] and a jp z,.loop call GBPalWhiteOutWithDelay3 @@ -181,15 +177,14 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) .strength bit 3,a ; does the player have the Rainbow Badge? jp z,.newBadgeRequired - ld a,$5b - call Predef + predef PrintStrengthTxt call GBPalWhiteOutWithDelay3 jp .goBackToMap .flash bit 0,a ; does the player have the Boulder Badge? jp z,.newBadgeRequired xor a - ld [$d35d],a + ld [wd35d],a ld hl,.flashLightsAreaText call PrintText call GBPalWhiteOutWithDelay3 @@ -199,10 +194,10 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) db "@" .dig ld a,ESCAPE_ROPE - ld [$cf91],a - ld [$d152],a + ld [wcf91],a + ld [wd152],a call UseItem - ld a,[$cd6a] + ld a,[wcd6a] and a jp z,.loop call GBPalWhiteOutWithDelay3 @@ -211,7 +206,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) call CheckIfInOutsideMap jr z,.canTeleport ld a,[wWhichPokemon] - ld hl,W_PARTYMON1NAME + ld hl,wPartyMonNicks call GetPartyMonName ld hl,.cannotUseTeleportNowText call PrintText @@ -219,10 +214,10 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) .canTeleport ld hl,.warpToLastPokemonCenterText call PrintText - ld hl,$d732 + ld hl,wd732 set 3,[hl] set 6,[hl] - ld hl,$d72e + ld hl,wd72e set 1,[hl] res 4,[hl] ld c,60 @@ -239,9 +234,9 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) TX_FAR _CannotFlyHereText db "@" .softboiled - ld hl,W_PARTYMON1_MAXHP + ld hl,wPartyMon1MaxHP ld a,[wWhichPokemon] - ld bc,44 + ld bc,wPartyMon2 - wPartyMon1 call AddNTimes ld a,[hli] ld [H_DIVIDEND],a @@ -251,7 +246,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) ld [H_DIVISOR],a ld b,2 ; number of bytes call Divide - ld bc,-33 + ld bc,wPartyMon1HP - wPartyMon1MaxHP add hl,bc ld a,[hld] ld b,a @@ -261,14 +256,14 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) ld a,[H_QUOTIENT + 2] sbc b jp nc,.notHealthyEnough - ld a,[$cc2b] + ld a,[wcc2b] push af ld a,POTION - ld [$cf91],a - ld [$d152],a + ld [wcf91],a + ld [wd152],a call UseItem pop af - ld [$cc2b],a + ld [wcc2b],a jp .loop .notHealthyEnough ; if current HP is less than 1/5 of max HP ld hl,.notHealthyEnoughText @@ -290,8 +285,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) ; writes a blank tile to all possible menu cursor positions on the party menu ErasePartyMenuCursors: ; 132ed (4:72ed) - FuncCoord 0,1 - ld hl,Coord + hlCoord 0, 1 ld bc,2 * 20 ; menu cursor positions are 2 rows apart ld a,6 ; 6 menu cursor positions .loop @@ -314,19 +308,19 @@ StartMenu_Item: ; 13302 (4:7302) jr .exitMenu .notInLinkBattle ld bc,wNumBagItems - ld hl,$cf8b + ld hl,wcf8b ld a,c ld [hli],a - ld [hl],b ; store item bag pointer at $cf8b (for DisplayListMenuID) + ld [hl],b ; store item bag pointer at wcf8b (for DisplayListMenuID) xor a - ld [$cf93],a + ld [wcf93],a ld a,ITEMLISTMENU ld [wListMenuID],a - ld a,[$cc2c] + ld a,[wcc2c] ld [wCurrentMenuItem],a call DisplayListMenuID ld a,[wCurrentMenuItem] - ld [$cc2c],a + ld [wcc2c],a jr nc,.choseItem .exitMenu call LoadScreenTilesFromBuffer2 ; restore saved screen @@ -336,23 +330,19 @@ StartMenu_Item: ; 13302 (4:7302) .choseItem ; erase menu cursor (blank each tile in front of an item name) ld a," " - FuncCoord 5,4 - ld [Coord],a - FuncCoord 5,6 - ld [Coord],a - FuncCoord 5,8 - ld [Coord],a - FuncCoord 5,10 - ld [Coord],a + Coorda 5, 4 + Coorda 5, 6 + Coorda 5, 8 + Coorda 5, 10 call PlaceUnfilledArrowMenuCursor xor a - ld [$cc35],a - ld a,[$cf91] + ld [wcc35],a + ld a,[wcf91] cp a,BICYCLE jp z,.useOrTossItem .notBicycle1 ld a,$06 ; use/toss menu - ld [$d125],a + ld [wd125],a call DisplayTextBoxID ld hl,wTopMenuItemY ld a,11 @@ -374,14 +364,14 @@ StartMenu_Item: ; 13302 (4:7302) jr z,.useOrTossItem jp ItemMenuLoop .useOrTossItem ; if the player made the choice to use or toss the item - ld a,[$cf91] - ld [$d11e],a + ld a,[wcf91] + ld [wd11e],a call GetItemName - call CopyStringToCF4B ; copy name to $cf4b - ld a,[$cf91] + call CopyStringToCF4B ; copy name to wcf4b + ld a,[wcf91] cp a,BICYCLE jr nz,.notBicycle2 - ld a,[$d732] + ld a,[wd732] bit 5,a jr z,.useItem_closeMenu ld hl,CannotGetOffHereText @@ -392,15 +382,15 @@ StartMenu_Item: ; 13302 (4:7302) and a jr nz,.tossItem .useItem - ld [$d152],a - ld a,[$cf91] + ld [wd152],a + ld a,[wcf91] cp a,HM_01 jr nc,.useItem_partyMenu ld hl,UsableItems_CloseMenu ld de,1 call IsInArray jr c,.useItem_closeMenu - ld a,[$cf91] + ld a,[wcf91] ld hl,UsableItems_PartyMenu ld de,1 call IsInArray @@ -409,34 +399,34 @@ StartMenu_Item: ; 13302 (4:7302) jp ItemMenuLoop .useItem_closeMenu xor a - ld [$d152],a + ld [wd152],a call UseItem - ld a,[$cd6a] + ld a,[wcd6a] and a jp z,ItemMenuLoop jp CloseStartMenu .useItem_partyMenu - ld a,[$cfcb] + ld a,[wcfcb] push af call UseItem - ld a,[$cd6a] + ld a,[wcd6a] cp a,$02 jp z,.partyMenuNotDisplayed call GBPalWhiteOutWithDelay3 call Func_3dbe pop af - ld [$cfcb],a + ld [wcfcb],a jp StartMenu_Item .partyMenuNotDisplayed pop af - ld [$cfcb],a + ld [wcfcb],a jp ItemMenuLoop .tossItem call IsKeyItem - ld a,[$d124] + ld a,[wd124] and a jr nz,.skipAskingQuantity - ld a,[$cf91] + ld a,[wcf91] call IsItemHM jr c,.skipAskingQuantity call DisplayChooseQuantityMenu @@ -515,8 +505,7 @@ StartMenu_TrainerInfo: ; 13460 (4:7460) xor a ld [$ffd7],a call DrawTrainerInfo - ld a,$2e - call Predef ; draw badges + predef DrawBadges ; draw badges ld b,$0d call GoPAL_SET call GBPalNormal @@ -535,101 +524,89 @@ StartMenu_TrainerInfo: ; 13460 (4:7460) DrawTrainerInfo: ; 1349a (4:749a) ld de,RedPicFront ld bc,(BANK(RedPicFront) << 8) | $01 - ld a,$3b - call Predef + predef Predef3B call DisableLCD - FuncCoord 0,2 - ld hl,Coord + hlCoord 0, 2 ld a," " call TrainerInfo_DrawVerticalLine - FuncCoord 1,2 - ld hl,Coord + hlCoord 1, 2 call TrainerInfo_DrawVerticalLine - ld hl,$9070 - ld de,$9000 - ld bc,$01c0 + ld hl,vChars2 + $70 + ld de,vChars2 + ld bc,$70 * 4 call CopyData ld hl,TrainerInfoTextBoxTileGraphics ; $7b98 ; trainer info text box tile patterns - ld de,$9770 + ld de,vChars2 + $770 ld bc,$0080 push bc call TrainerInfo_FarCopyData ld hl,BlankLeaderNames ; $7c28 - ld de,$9600 + ld de,vChars2 + $600 ld bc,$0170 call TrainerInfo_FarCopyData pop bc ld hl,BadgeNumbersTileGraphics ; $7d98 ; badge number tile patterns - ld de,$8d80 + ld de,vChars1 + $580 call TrainerInfo_FarCopyData ld hl,GymLeaderFaceAndBadgeTileGraphics ; $6a9e ; gym leader face and badge tile patterns - ld de,$9200 + ld de,vChars2 + $200 ld bc,$0400 ld a,$03 call FarCopyData2 ld hl,TextBoxGraphics ; $6288 ld de,$00d0 add hl,de ; hl = colon tile pattern - ld de,$8d60 + ld de,vChars1 + $560 ld bc,$0010 ld a,$04 push bc call FarCopyData2 pop bc ld hl,TrainerInfoTextBoxTileGraphics + $80 ; $7c18 ; background tile pattern - ld de,$8d70 + ld de,vChars1 + $570 call TrainerInfo_FarCopyData call EnableLCD - ld hl,$cd3d + ld hl,wWhichTrade ld a,18 + 1 ld [hli],a dec a ld [hli],a ld [hl],1 - FuncCoord 0,0 - ld hl,Coord + hlCoord 0, 0 call TrainerInfo_DrawTextBox - ld hl,$cd3d + ld hl,wWhichTrade ld a,16 + 1 ld [hli],a dec a ld [hli],a ld [hl],3 - FuncCoord 1,10 - ld hl,Coord + hlCoord 1, 10 call TrainerInfo_DrawTextBox - FuncCoord 0,10 - ld hl,Coord + hlCoord 0, 10 ld a,$d7 call TrainerInfo_DrawVerticalLine - FuncCoord 19,10 - ld hl,Coord + hlCoord 19, 10 call TrainerInfo_DrawVerticalLine - FuncCoord 6,9 - ld hl,Coord + hlCoord 6, 9 ld de,TrainerInfo_BadgesText call PlaceString - FuncCoord 2,2 - ld hl,Coord + hlCoord 2, 2 ld de,TrainerInfo_NameMoneyTimeText call PlaceString - FuncCoord 7,2 - ld hl,Coord - ld de,W_PLAYERNAME + hlCoord 7, 2 + ld de,wPlayerName call PlaceString - FuncCoord 8,4 - ld hl,Coord + hlCoord 8, 4 ld de,wPlayerMoney ld c,$e3 call PrintBCDNumber - FuncCoord 9,6 - ld hl,Coord - ld de,$da41 ; hours + hlCoord 9, 6 + ld de,W_PLAYTIMEHOURS + 1 ; hours ld bc,$4103 call PrintNumber ld [hl],$d6 ; colon tile ID inc hl - ld de,$da43 ; minutes + ld de,W_PLAYTIMEMINUTES + 1 ; minutes ld bc,$8102 jp PrintNumber @@ -650,15 +627,15 @@ TrainerInfo_BadgesText: ; 13597 (4:7597) ; height is always 6 ; INPUT: ; hl = destination address -; [$cd3d] = width + 1 -; [$cd3e] = width -; [$cd3f] = distance from the end of a text box row to the start of the next +; [wWhichTrade] = width + 1 +; [wTrainerEngageDistance] = width +; [wTrainerFacingDirection] = distance from the end of a text box row to the start of the next TrainerInfo_DrawTextBox: ; 135a0 (4:75a0) ld a,$79 ; upper left corner tile ID ld de,$7a7b ; top edge and upper right corner tile ID's call TrainerInfo_DrawHorizontalEdge ; draw top edge call TrainerInfo_NextTextBoxRow - ld a,[$cd3d] ; width of the text box plus one + ld a,[wWhichTrade] ; width of the text box plus one ld e,a ld d,0 ld c,6 ; height of the text box @@ -674,7 +651,7 @@ TrainerInfo_DrawTextBox: ; 135a0 (4:75a0) TrainerInfo_DrawHorizontalEdge: ; 135c3 (4:75c3) ld [hli],a ; place left corner tile - ld a,[$cd3e] ; width of the text box + ld a,[wTrainerEngageDistance] ; width of the text box ld c,a ld a,d .loop @@ -686,7 +663,7 @@ TrainerInfo_DrawHorizontalEdge: ; 135c3 (4:75c3) ret TrainerInfo_NextTextBoxRow: ; 135d0 (4:75d0) - ld a,[$cd3f] ; distance to the start of the next row + ld a,[wTrainerFacingDirection] ; distance to the start of the next row .loop inc hl dec a @@ -708,11 +685,10 @@ TrainerInfo_DrawVerticalLine: ; 135d8 (4:75d8) ret StartMenu_SaveReset: ; 135e3 (4:75e3) - ld a,[$d72e] + ld a,[wd72e] bit 6,a ; is the player using the link feature? - jp nz,InitGame - ld a,$3f - call Predef ; save the game + jp nz,Init + predef SaveSAV ; save the game call LoadScreenTilesFromBuffer2 ; restore saved screen jp HoldTextDisplayOpen @@ -729,9 +705,9 @@ StartMenu_Option: ; 135f6 (4:75f6) SwitchPartyMon: ; 13613 (4:7613) call SwitchPartyMon_Stats - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade call SwitchPartyMon_OAM - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem call SwitchPartyMon_OAM jp RedrawPartyMenu_ @@ -762,42 +738,42 @@ SwitchPartyMon_OAM: ; 13625 (4:7625) jp PlaySound SwitchPartyMon_Stats: ; 13653 (4:7653) - ld a, [$cc35] + ld a, [wcc35] and a jr nz, .asm_13661 - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon inc a - ld [$cc35], a + ld [wcc35], a ret .asm_13661 xor a - ld [$d07d], a - ld a, [$cc35] + ld [wd07d], a + ld a, [wcc35] dec a ld b, a - ld a, [wCurrentMenuItem] ; $cc26 - ld [wWhichTrade], a ; $cd3d + ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld [wWhichTrade], a ; wWhichTrade cp b jr nz, .asm_1367b xor a - ld [$cc35], a - ld [$d07d], a + ld [wcc35], a + ld [wd07d], a ret .asm_1367b ld a, b - ld [$cc35], a + ld [wcc35], a push hl push de - ld hl, W_PARTYMON1 ; $d164 + ld hl, wPartySpecies ld d, h ld e, l - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem add l ld l, a jr nc, .asm_1368e inc h .asm_1368e - ld a, [$cc35] + ld a, [wcc35] add e ld e, a jr nc, .asm_13696 @@ -809,67 +785,67 @@ SwitchPartyMon_Stats: ; 13653 (4:7653) ld [hl], a ld a, [H_DIVIDEND] ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT) ld [de], a - ld hl, W_PARTYMON1_NUM ; $d16b (aliases: W_PARTYMON1DATA) - ld bc, $2c - ld a, [wCurrentMenuItem] ; $cc26 + ld hl, wPartyMons + ld bc, wPartyMon2 - wPartyMon1 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem call AddNTimes push hl - ld de, $cc97 + ld de, wcc97 ld bc, $2c call CopyData - ld hl, W_PARTYMON1_NUM ; $d16b (aliases: W_PARTYMON1DATA) + ld hl, wPartyMons ld bc, $2c - ld a, [$cc35] + ld a, [wcc35] call AddNTimes pop de push hl ld bc, $2c call CopyData pop de - ld hl, $cc97 + ld hl, wcc97 ld bc, $2c call CopyData - ld hl, W_PARTYMON1OT ; $d273 - ld a, [wCurrentMenuItem] ; $cc26 + ld hl, wPartyMonOT ; wd273 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem call SkipFixedLengthTextEntries push hl - ld de, $cc97 + ld de, wcc97 ld bc, $b call CopyData - ld hl, W_PARTYMON1OT ; $d273 - ld a, [$cc35] + ld hl, wPartyMonOT ; wd273 + ld a, [wcc35] call SkipFixedLengthTextEntries pop de push hl ld bc, $b call CopyData pop de - ld hl, $cc97 + ld hl, wcc97 ld bc, $b call CopyData - ld hl, W_PARTYMON1NAME ; $d2b5 - ld a, [wCurrentMenuItem] ; $cc26 + ld hl, wPartyMonNicks ; wPartyMonNicks + ld a, [wCurrentMenuItem] ; wCurrentMenuItem call SkipFixedLengthTextEntries push hl - ld de, $cc97 + ld de, wcc97 ld bc, $b call CopyData - ld hl, W_PARTYMON1NAME ; $d2b5 - ld a, [$cc35] + ld hl, wPartyMonNicks ; wPartyMonNicks + ld a, [wcc35] call SkipFixedLengthTextEntries pop de push hl ld bc, $b call CopyData pop de - ld hl, $cc97 + ld hl, wcc97 ld bc, $b call CopyData - ld a, [$cc35] - ld [wWhichTrade], a ; $cd3d + ld a, [wcc35] + ld [wWhichTrade], a ; wWhichTrade xor a - ld [$cc35], a - ld [$d07d], a + ld [wcc35], a + ld [wd07d], a pop de pop hl ret diff --git a/engine/menu/status_screen.asm b/engine/menu/status_screen.asm index cfce493e..65b06e9d 100755 --- a/engine/menu/status_screen.asm +++ b/engine/menu/status_screen.asm @@ -1,18 +1,18 @@ ; Predef 0x37 StatusScreen: ; 12953 (4:6953) call LoadMonData - ld a, [$cc49] + ld a, [wcc49] cp $2 ; 2 means we're in a PC box jr c, .DontRecalculate ; 0x1295b $14 - ld a, [$cf9b] - ld [$cfb9], a - ld [$d127], a - ld hl, $cfa8 - ld de, $cfba + ld a, [wcf9b] + ld [wcfb9], a + ld [W_CURENEMYLVL], a + ld hl, wcfa8 + ld de, wcfba ld b, $1 call CalcStats ; Recalculate stats .DontRecalculate - ld hl, $d72c + ld hl, wd72c set 1, [hl] ld a, $33 ld [$ff24], a ; Reduce the volume @@ -21,27 +21,26 @@ StatusScreen: ; 12953 (4:6953) call UpdateSprites ; move sprites (?) call LoadHpBarAndStatusTilePatterns ld de, BattleHudTiles1 ; $6080 ; source - ld hl, $96d0 ; dest + ld hl, vChars2 + $6d0 ; dest ld bc, (BANK(BattleHudTiles1) << 8) + $03 ; bank bytes/8 call CopyVideoDataDouble ; ·│ :L and halfarrow line end ld de, BattleHudTiles2 ; $6098 - ld hl, $9780 + ld hl, vChars2 + $780 ld bc, (BANK(BattleHudTiles2) << 8) + $01 call CopyVideoDataDouble ; │ ld de, BattleHudTiles3 ; $60b0 - ld hl, $9760 + ld hl, vChars2 + $760 ld bc, (BANK(BattleHudTiles3) << 8) + $02 call CopyVideoDataDouble ; ─┘ ld de, PTile - ld hl, $9720 + ld hl, vChars2 + $720 ld bc,(BANK(PTile) << 8 | $01) call CopyVideoDataDouble ; P (for PP), inline ld a, [$ffd7] push af xor a ld [$ffd7], a - FuncCoord 19,1 - ld hl, Coord + hlCoord 19, 1 ld bc, $060a call DrawLineBox ; Draws the box around name, HP and status ld de, $fffa @@ -49,86 +48,71 @@ StatusScreen: ; 12953 (4:6953) ld [hl], $f2 ; . after No ("." is a different one) dec hl ld [hl], "№" - FuncCoord 19,9 - ld hl, Coord + hlCoord 19, 9 ld bc, $0806 call DrawLineBox ; Draws the box around types, ID No. and OT - FuncCoord 10,9 - ld hl, Coord + hlCoord 10, 9 ld de, Type1Text call PlaceString ; "TYPE1/" - FuncCoord 11,3 - ld hl, Coord - PREDEF DrawHPBarPredef ; predef $5f - ld hl, $cf25 + hlCoord 11, 3 + predef DrawHP ; predef $5f + ld hl, wcf25 call GetHealthBarColor ld b, $3 call GoPAL_SET ; SGB palette - FuncCoord 16,6 - ld hl, Coord - ld de, $cf9c + hlCoord 16, 6 + ld de, wcf9c call PrintStatusCondition jr nz, .StatusWritten ; 0x129fc $9 - FuncCoord 16,6 - ld hl, Coord + hlCoord 16, 6 ld de, OKText call PlaceString ; "OK" .StatusWritten - FuncCoord 9,6 - ld hl, Coord + hlCoord 9, 6 ld de, StatusText call PlaceString ; "STATUS/" - FuncCoord 14,2 - ld hl, Coord + hlCoord 14, 2 call PrintLevel ; Pokémon level - ld a, [$d0b8] - ld [$d11e], a - ld [$d0b5], a - ld a, $3a - call Predef - FuncCoord 3,7 - ld hl, Coord - ld de, $d11e + ld a, [W_MONHDEXNUM] + ld [wd11e], a + ld [wd0b5], a + predef IndexToPokedex + hlCoord 3, 7 + ld de, wd11e ld bc, $8103 ; Zero-padded, 3 call PrintNumber ; Pokémon no. - FuncCoord 11,10 - ld hl, Coord - ld a, $4b - call Predef ; Prints the type (?) + hlCoord 11, 10 + predef Func_27d6b ; Prints the type (?) ld hl, NamePointers2 ; $6a9d call .unk_12a7e ld d, h ld e, l - FuncCoord 9,1 - ld hl, Coord + hlCoord 9, 1 call PlaceString ; Pokémon name ld hl, OTPointers ; $6a95 call .unk_12a7e ld d, h ld e, l - FuncCoord 12,16 - ld hl, Coord + hlCoord 12, 16 call PlaceString ; OT - FuncCoord 12,14 - ld hl, Coord - ld de, $cfa4 + hlCoord 12, 14 + ld de, wcfa4 ld bc, $8205 ; 5 call PrintNumber ; ID Number ld d, $0 call PrintStatsBox call Delay3 call GBPalNormal - FuncCoord 1, 0 ; $c3a1 - ld hl, Coord + hlCoord 1, 0 call LoadFlippedFrontSpriteByMonIndex ; draw Pokémon picture - ld a, [$cf91] + ld a, [wcf91] call PlayCry ; play Pokémon cry call WaitForTextScrollButtonPress ; wait for button pop af ld [$ffd7], a ret .unk_12a7e ; 0x12a7e ; I don't know what this does, iterates over pointers? - ld a, [$cc49] + ld a, [wcc49] add a ld c, a ld b, $0 @@ -136,22 +120,22 @@ StatusScreen: ; 12953 (4:6953) ld a, [hli] ld h, [hl] ld l, a - ld a, [$cc49] + ld a, [wcc49] cp $3 ret z ld a, [wWhichPokemon] jp SkipFixedLengthTextEntries OTPointers: ; 12a95 (4:6a95) - dw W_PARTYMON1OT - dw W_ENEMYMON1OT - dw W_BOXMON1OT + dw wPartyMonOT + dw wEnemyMonOT + dw wBoxMonOT dw W_DAYCAREMONOT NamePointers2: ; 12a9d (4:6a9d) - dw W_PARTYMON1NAME - dw W_ENEMYMON1NAME - dw W_BOXMON1NAME + dw wPartyMonNicks + dw wEnemyMonNicks + dw wBoxMonNicks dw W_DAYCAREMONNAME Type1Text: ; 12aa5 (4:6aa5) @@ -197,23 +181,19 @@ PrintStatsBox: ; 12ae4 (4:6ae4) ld a, d and a ; a is 0 from the status screen jr nz, .DifferentBox ; 0x12ae6 $12 - FuncCoord 0,8 - ld hl, Coord + hlCoord 0, 8 ld b, $8 ld c, $8 call TextBoxBorder ; Draws the box - FuncCoord 1,9 ; Start printing stats from here - ld hl, Coord + hlCoord 1, 9 ; Start printing stats from here ld bc, $0019 ; Number offset jr .PrintStats ; 0x12af8 $10 .DifferentBox - FuncCoord 9,2 - ld hl, Coord + hlCoord 9, 2 ld b, $8 ld c, $9 call TextBoxBorder - FuncCoord 11, 3 ; $c3e7 - ld hl, Coord + hlCoord 11, 3 ld bc, $0018 .PrintStats push bc @@ -223,14 +203,14 @@ PrintStatsBox: ; 12ae4 (4:6ae4) pop hl pop bc add hl, bc - ld de, $cfbc + ld de, wcfbc ld bc, $0203 ; three digits call PrintStat - ld de, $cfbe + ld de, wcfbe call PrintStat - ld de, $cfc0 + ld de, wcfc0 call PrintStat - ld de, $cfc2 + ld de, wcfc2 jp PrintNumber PrintStat push hl @@ -253,37 +233,32 @@ StatusScreen2: ; 12b57 (4:6b57) ld [$ffd7], a ld [$ffba], a ld bc, $0005 - ld hl, $d0dc + ld hl, wd0dc call FillMemory - ld hl, $cfa0 - ld de, $d0dc + ld hl, wcfa0 + ld de, wd0dc ld bc, $0004 call CopyData callab Func_39b87 - FuncCoord 9,2 - ld hl, Coord + hlCoord 9, 2 ld bc, $050a call ClearScreenArea ; Clear under name - FuncCoord 19, 3 ; $c3ef - ld hl, Coord + hlCoord 19, 3 ld [hl], $78 - FuncCoord 0,8 - ld hl, Coord + hlCoord 0, 8 ld b, $8 ld c, $12 call TextBoxBorder ; Draw move container - FuncCoord 2,9 - ld hl, Coord - ld de, $d0e1 + hlCoord 2, 9 + ld de, wd0e1 call PlaceString ; Print moves - ld a, [$cd6c] + ld a, [wcd6c] inc a ld c, a ld a, $4 sub c ld b, a ; Number of moves ? - FuncCoord 11,10 - ld hl, Coord + hlCoord 11, 10 ld de, $0028 ld a, $72 call Func_12ccb ; Print "PP" @@ -294,9 +269,8 @@ StatusScreen2: ; 12b57 (4:6b57) ld a, "-" call Func_12ccb ; Fill the rest with -- .InitPP ; 12bbb - ld hl, $cfa0 - FuncCoord 14,10 - ld de, Coord + ld hl, wcfa0 + deCoord 14, 10 ld b, $0 .PrintPP ; 12bc3 ld a, [hli] @@ -322,16 +296,16 @@ StatusScreen2: ; 12b57 (4:6b57) add hl, bc ld a, [hl] and $3f - ld [$cd71], a + ld [wcd71], a ld h, d ld l, e push hl - ld de, $cd71 + ld de, wcd71 ld bc, $0102 call PrintNumber ld a, "/" ld [hli], a - ld de, $d11e + ld de, wd11e ld bc, $0102 call PrintNumber pop hl @@ -346,47 +320,40 @@ StatusScreen2: ; 12b57 (4:6b57) cp $4 jr nz, .PrintPP ; 0x12c0f $b2 .PPDone - FuncCoord 9,3 - ld hl, Coord + hlCoord 9, 3 ld de, EXPPointsText call PlaceString - ld a, [$cfb9] ; level + ld a, [wcfb9] ; level push af - cp 100 + cp MAX_LEVEL jr z, .Level100 ; 0x12c20 $4 inc a - ld [$cfb9], a ; Increase temporarily if not 100 + ld [wcfb9], a ; Increase temporarily if not 100 .Level100 - FuncCoord 14,6 - ld hl, Coord + hlCoord 14, 6 ld [hl], $70 ; 1-tile "to" inc hl inc hl call PrintLevel pop af - ld [$cfb9], a - ld de, $cfa6 - FuncCoord 12,4 - ld hl, Coord + ld [wcfb9], a + ld de, wcfa6 + hlCoord 12, 4 ld bc, $0307 call PrintNumber ; exp call .asm_12c86 - ld de, $cfa6 - FuncCoord 7,6 - ld hl, Coord + ld de, wcfa6 + hlCoord 7, 6 ld bc, $0307 call PrintNumber - FuncCoord 9,0 - ld hl, Coord + hlCoord 9, 0 call Func_12cc3 - FuncCoord 9,1 - ld hl, Coord + hlCoord 9, 1 call Func_12cc3 - ld a, [$d0b8] - ld [$d11e], a + ld a, [W_MONHDEXNUM] + ld [wd11e], a call GetMonName - FuncCoord 9,1 - ld hl, Coord + hlCoord 9, 1 call PlaceString ld a, $1 ld [$ffba], a @@ -394,20 +361,20 @@ StatusScreen2: ; 12b57 (4:6b57) call WaitForTextScrollButtonPress ; wait for button pop af ld [$ffd7], a - ld hl, $d72c + ld hl, wd72c res 1, [hl] ld a, $77 ld [$ff24], a call GBPalWhiteOut jp ClearScreen .asm_12c86 ; This does some magic with lvl/exp? - ld a, [$cfb9] ; Load level - cp $64 + ld a, [wcfb9] ; Load level + cp MAX_LEVEL jr z, .asm_12ca7 ; 0x12c8b $1a ; If 100 inc a ld d, a callab CalcExperience - ld hl, $cfa8 + ld hl, wcfa8 ld a, [$ff98] sub [hl] ld [hld], a @@ -419,7 +386,7 @@ StatusScreen2: ; 12b57 (4:6b57) ld [hld], a ret .asm_12ca7 - ld hl, $cfa6 + ld hl, wcfa6 xor a ld [hli], a ld [hli], a diff --git a/engine/menu/vending_machine.asm b/engine/menu/vending_machine.asm index 1f0ed084..c2968e2f 100755 --- a/engine/menu/vending_machine.asm +++ b/engine/menu/vending_machine.asm @@ -2,41 +2,38 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0) ld hl, VendingMachineText1 call PrintText ld a, $13 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID xor a - ld [wCurrentMenuItem], a ; $cc26 - ld [wLastMenuItem], a ; $cc2a + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wLastMenuItem], a ; wLastMenuItem ld a, $3 - ld [wMenuWatchedKeys], a ; $cc29 + ld [wMenuWatchedKeys], a ; wMenuWatchedKeys ld a, $3 - ld [wMaxMenuItem], a ; $cc28 + ld [wMaxMenuItem], a ; wMaxMenuItem ld a, $5 - ld [wTopMenuItemY], a ; $cc24 + ld [wTopMenuItemY], a ; wTopMenuItemY ld a, $1 - ld [wTopMenuItemX], a ; $cc25 - ld hl, $d730 + ld [wTopMenuItemX], a ; wTopMenuItemX + ld hl, wd730 set 6, [hl] - FuncCoord 0, 3 ; $c3dc - ld hl, Coord + hlCoord 0, 3 ld b, $8 ld c, $c call TextBoxBorder call UpdateSprites - FuncCoord 2, 5 ; $c406 - ld hl, Coord + hlCoord 2, 5 ld de, DrinkText call PlaceString - FuncCoord 9, 6 ; $c421 - ld hl, Coord + hlCoord 9, 6 ld de, DrinkPriceText call PlaceString - ld hl, $d730 + ld hl, wd730 res 6, [hl] call HandleMenuInput bit 1, a jr nz, .asm_74f93 - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem cp $3 jr z, .asm_74f93 xor a @@ -69,12 +66,11 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0) ld hl, VendingMachineText5 call PrintText ld hl, $ffde - ld de, wPlayerMoney + 2 ; $d349 + ld de, wPlayerMoney + 2 ; wd349 ld c, $3 - ld a, $c - call Predef ; indirect jump to Func_f836 (f836 (3:7836)) + predef SubBCDPredef ld a, $13 - ld [$d125], a + ld [wd125], a jp DisplayTextBoxID .BagFull ld hl, VendingMachineText6 @@ -116,7 +112,7 @@ VendingMachineText7: ; 74fe2 (1d:4fe2) Func_74fe7: ; 74fe7 (1d:4fe7) ld hl, VendingPrices - ld a, [$cc26] + ld a, [wCurrentMenuItem] add a add a ld d, $0 diff --git a/engine/mon_party_sprites.asm b/engine/mon_party_sprites.asm index eb95d9bd..e05bdd55 100755 --- a/engine/mon_party_sprites.asm +++ b/engine/mon_party_sprites.asm @@ -1,16 +1,16 @@ AnimatePartyMon_ForceSpeed1: ; 716f7 (1c:56f7) xor a - ld [wCurrentMenuItem], a ; $cc26 + ld [wCurrentMenuItem], a ; wCurrentMenuItem ld b, a inc a jr GetAnimationSpeed -; $cf1f contains the party mon's health bar colors +; wcf1f contains the party mon's health bar colors ; 0: green ; 1: yellow ; 2: red AnimatePartyMon: ; 716ff (1c:56ff) - ld hl, $cf1f + ld hl, wcf1f ld a, [wCurrentMenuItem] ld c, a ld b, $0 @@ -21,13 +21,13 @@ GetAnimationSpeed: ; 7170a (1c:570a) ld c, a ld hl, PartyMonSpeeds add hl, bc - ld a, [$cf1b] + ld a, [wcf1b] xor $1 add [hl] ld c, a add a ld b, a - ld a, [W_SUBANIMTRANSFORM] ; $d08b + ld a, [W_SUBANIMTRANSFORM] ; W_SUBANIMTRANSFORM and a jr z, .resetSprites cp c @@ -38,11 +38,11 @@ GetAnimationSpeed: ; 7170a (1c:570a) jr nz, .resetTimer xor a .resetTimer - ld [W_SUBANIMTRANSFORM], a ; $d08b + ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM jp DelayFrame .resetSprites push bc - ld hl, $cc5b + ld hl, wcc5b ld de, wOAMBuffer ld bc, $60 call CopyData @@ -51,7 +51,7 @@ GetAnimationSpeed: ; 7170a (1c:570a) jr .incTimer .animateSprite push bc - ld hl, $c302 ; OAM tile id + ld hl, wOAMBuffer + $02 ; OAM tile id ld bc, $10 ld a, [wCurrentMenuItem] call AddNTimes @@ -156,155 +156,155 @@ MonPartySpritePointers: ; 717c0 (1c:57c0) dw SlowbroSprite + $c0 db $40 / $10 ; 40 bytes db BANK(SlowbroSprite) - dw $8000 + dw vSprites dw BallSprite db $80 / $10 ; $80 bytes db BANK(BallSprite) - dw $8040 + dw vSprites + $40 dw ClefairySprite + $c0 db $40 / $10 ; $40 bytes db BANK(ClefairySprite) - dw $80C0 + dw vSprites + $c0 dw BirdSprite + $c0 db $40 / $10 ; $40 bytes db BANK(BirdSprite) - dw $8100 + dw vSprites + $100 dw SeelSprite db $40 / $10 ; $40 bytes db BANK(SeelSprite) - dw $8140 + dw vSprites + $140 dw MonPartySprites + $40 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $8180 + dw vSprites + $180 dw MonPartySprites + $50 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $81A0 + dw vSprites + $1a0 dw MonPartySprites + $60 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $81C0 + dw vSprites + $1c0 dw MonPartySprites + $70 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $81E0 + dw vSprites + $1e0 dw MonPartySprites + $80 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $8200 + dw vSprites + $200 dw MonPartySprites + $90 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $8220 + dw vSprites + $220 dw MonPartySprites + $A0 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $8240 + dw vSprites + $240 dw MonPartySprites + $B0 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $8260 + dw vSprites + $260 dw MonPartySprites + $100 db $40 / $10 ; $40 bytes db BANK(MonPartySprites) - dw $8380 + dw vSprites + $380 dw SlowbroSprite db $40 / $10 ; $40 bytes db BANK(SlowbroSprite) - dw $8400 + dw vSprites + $400 dw BallSprite db $80 / $10 ; $80 bytes db BANK(BallSprite) - dw $8440 + dw vSprites + $440 dw ClefairySprite db $40 / $10 ; $40 bytes db BANK(ClefairySprite) - dw $84C0 + dw vSprites + $4c0 dw BirdSprite db $40 / $10 ; $40 bytes db BANK(BirdSprite) - dw $8500 + dw vSprites + $500 dw SeelSprite + $C0 db $40 / $10 ; $40 bytes db BANK(SeelSprite) - dw $8540 + dw vSprites + $540 dw MonPartySprites db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $8580 + dw vSprites + $580 dw MonPartySprites + $10 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $85A0 + dw vSprites + $5a0 dw MonPartySprites + $20 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $85C0 + dw vSprites + $5c0 dw MonPartySprites + $30 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $85E0 + dw vSprites + $5E0 dw MonPartySprites + $C0 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $8600 + dw vSprites + $600 dw MonPartySprites + $D0 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $8620 + dw vSprites + $620 dw MonPartySprites + $E0 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $8640 + dw vSprites + $640 dw MonPartySprites + $F0 db $10 / $10 ; $10 bytes db BANK(MonPartySprites) - dw $8660 + dw vSprites + $660 dw MonPartySprites + $140 db $40 / $10 ; $40 bytes db BANK(MonPartySprites) - dw $8780 + dw vSprites + $780 Func_71868: ; 71868 (1c:5868) push hl push de push bc ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c - ld hl, W_PARTYMON1 ; $d164 + ld hl, wPartySpecies ld e, a ld d, $0 add hl, de ld a, [hl] call GetPartyMonSpriteID - ld [$cd5b], a + ld [wcd5b], a call Func_718c3 pop bc pop de @@ -314,23 +314,23 @@ Func_71868: ; 71868 (1c:5868) Func_71882: ; 71882 (1c:5882) xor a ld [H_DOWNARROWBLINKCNT2], a ; $ff8c - ld a, [$cd5d] + ld a, [wcd5d] call GetPartyMonSpriteID - ld [$cd5b], a + ld [wcd5b], a jr Func_718c3 Func_71890: ; 71890 (1c:5890) - ld a, [$cf91] + ld a, [wcf91] call GetPartyMonSpriteID push af - ld hl, $8000 + ld hl, vSprites call Func_718ac pop af add $54 - ld hl, $8040 + ld hl, vSprites + $40 call Func_718ac xor a - ld [$cd5d], a + ld [wcd5d], a jr Func_71882 Func_718ac: ; 718ac (1c:58ac) @@ -356,7 +356,7 @@ Func_718ac: ; 718ac (1c:58ac) Func_718c3: ; 718c3 (1c:58c3) push af ld c, $10 - ld h, $c3 + ld h, wOAMBuffer / $100 ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c swap a ld l, a @@ -371,15 +371,14 @@ Func_718c3: ; 718c3 (1c:58c3) call Func_71281 .asm_718dd ld hl, wOAMBuffer - ld de, $cc5b + ld de, wcc5b ld bc, $60 jp CopyData GetPartyMonSpriteID: ; 718e9 (1c:58e9) - ld [$d11e], a - ld a, $3a - call Predef ; indirect jump to IndexToPokedex (41010 (10:5010)) - ld a, [$d11e] + ld [wd11e], a + predef IndexToPokedex + ld a, [wd11e] ld c, a dec a srl a diff --git a/engine/oak_speech.asm b/engine/oak_speech.asm index a671c553..e54741f2 100755 --- a/engine/oak_speech.asm +++ b/engine/oak_speech.asm @@ -1,11 +1,11 @@ SetDefaultNames: ; 60ca (1:60ca) - ld a, [$d358] + ld a, [wd358] push af - ld a, [W_OPTIONS] ; $d355 + ld a, [W_OPTIONS] ; W_OPTIONS push af - ld a, [$d732] + ld a, [wd732] push af - ld hl, W_PLAYERNAME ; $d158 + ld hl, wPlayerName ; wd158 ld bc, $d8a xor a call FillMemory @@ -14,20 +14,20 @@ SetDefaultNames: ; 60ca (1:60ca) xor a call FillMemory pop af - ld [$d732], a + ld [wd732], a pop af - ld [W_OPTIONS], a ; $d355 + ld [W_OPTIONS], a ; W_OPTIONS pop af - ld [$d358], a - ld a, [$d08a] + ld [wd358], a + ld a, [wd08a] and a call z, Func_5bff ld hl, NintenText - ld de, W_PLAYERNAME ; $d158 + ld de, wPlayerName ; wd158 ld bc, $b call CopyData ld hl, SonyText - ld de, W_RIVALNAME ; $d34a + ld de, W_RIVALNAME ; wd34a ld bc, $b jp CopyData @@ -41,20 +41,19 @@ OakSpeech: ; 6115 (1:6115) call ClearScreen call LoadTextBoxTilePatterns call SetDefaultNames - ld a,$18 - call Predef ; indirect jump to InitializePlayerData - ld hl,$D53A + predef InitPlayerData2 + ld hl,wNumBoxItems ld a,POTION - ld [$CF91],a + ld [wcf91],a ld a,1 - ld [$CF96],a + ld [wcf96],a call AddItemToInventory ; give one potion - ld a,[$D07C] - ld [$D71A],a + ld a,[W_ANIMATIONID] + ld [wd71a],a call Func_62ce xor a ld [$FFD7],a - ld a,[$D732] + ld a,[wd732] bit 1,a ; XXX when is bit 1 set? jp nz,Func_61bc ; easter egg: skip the intro ld de,ProfOakPic @@ -66,11 +65,10 @@ OakSpeech: ; 6115 (1:6115) call GBFadeOut2 call ClearScreen ld a,NIDORINO - ld [$D0B5],a ; pic displayed is stored at this location - ld [$CF91],a + ld [wd0b5],a ; pic displayed is stored at this location + ld [wcf91],a call GetMonHeader ; this is also related to the pic - FuncCoord 6, 4 ; $c3f6 - ld hl,Coord ; position on tilemap the pic is displayed + hlCoord 6, 4 ; position on tilemap the pic is displayed call LoadFlippedFrontSpriteByMonIndex ; displays pic? call MovePicLeft ld hl,OakSpeechText2 @@ -101,7 +99,7 @@ Func_61bc: ; 61bc (1:61bc) ld bc,(Bank(RedPicFront) << 8) | $00 call IntroPredef3B call GBFadeIn2 - ld a,[$D72D] + ld a,[wd72d] and a jr nz,.next ld hl,OakSpeechText3 @@ -117,7 +115,7 @@ Func_61bc: ; 61bc (1:61bc) ld c,4 call DelayFrames ld de,RedSprite ; $4180 - ld hl,$8000 + ld hl,vSprites ld bc,(BANK(RedSprite) << 8) | $0C call CopyVideoData ld de,ShrinkPic1 @@ -131,27 +129,26 @@ Func_61bc: ; 61bc (1:61bc) call ResetPlayerSpriteData ld a,[H_LOADEDROMBANK] push af - ld a,2 - ld [$C0EF],a - ld [$C0F0],a + ld a, BANK(Music_PalletTown) + ld [wc0ef],a + ld [wc0f0],a ld a,$A ld [wMusicHeaderPointer],a ld a,$FF - ld [$C0EE],a + ld [wc0ee],a call PlaySound ; stop music pop af ld [H_LOADEDROMBANK],a ld [$2000],a ld c,$14 call DelayFrames - FuncCoord 6, 5 ; $c40a - ld hl,Coord + hlCoord 6, 5 ld b,7 ld c,7 call ClearScreenArea call LoadTextBoxTilePatterns ld a,1 - ld [$CFCB],a + ld [wcfcb],a ld c,$32 call DelayFrames call GBFadeOut2 @@ -211,28 +208,25 @@ MovePicLeft: ; 6288 (1:6288) jr .next Predef3B: ; 62a1 (1:62a1) - call Load16BitRegisters + call GetPredefRegisters IntroPredef3B: ; 62a4 (1:62a4) ; bank of sprite given in b push bc ld a,b call UncompressSpriteFromDE ld hl,S_SPRITEBUFFER1 - ld de,$A000 - ld bc,$0310 + ld de,S_SPRITEBUFFER0 + ld bc,$310 call CopyData - ld de,$9000 + ld de,vFrontPic call InterlaceMergeSpriteBuffers pop bc ld a,c and a - FuncCoord 15, 1 ; $c3c3 - ld hl,Coord + hlCoord 15, 1 jr nz,.next - FuncCoord 6, 4 ; $c3f6 - ld hl,Coord + hlCoord 6, 4 .next xor a ld [$FFE1],a - ld a,1 - jp Predef + predef_jump Func_3f0c6 diff --git a/engine/oak_speech2.asm b/engine/oak_speech2.asm index 697a268d..9d994047 100755 --- a/engine/oak_speech2.asm +++ b/engine/oak_speech2.asm @@ -2,20 +2,20 @@ LoadDefaultNamesPlayer: ; 695d (1:695d) call Func_6a12 ld de, DefaultNamesPlayer ; $6aa8 call DisplayIntroNameTextBox - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem and a jr z, .asm_697a ld hl, DefaultNamesPlayerList ; $6af2 call Func_6ad6 - ld de, W_PLAYERNAME ; $d158 + ld de, wPlayerName ; wd158 call Func_69ec jr .asm_6999 .asm_697a - ld hl, W_PLAYERNAME ; $d158 + ld hl, wPlayerName ; wd158 xor a - ld [$d07d], a + ld [wd07d], a call DisplayNamingScreen - ld a, [$cf4b] + ld a, [wcf4b] cp $50 jr z, .asm_697a call ClearScreen @@ -35,20 +35,20 @@ LoadDefaultNamesRival: ; 69a4 (1:69a4) call Func_6a12 ; 0x69a4 call 0x6a12 ld de, DefaultNamesRival call DisplayIntroNameTextBox - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem and a jr z, .asm_69c1 ld hl, DefaultNamesRivalList call Func_6ad6 - ld de, W_RIVALNAME ; $d34a + ld de, W_RIVALNAME ; wd34a call Func_69ec jr .asm_69e1 .asm_69c1 - ld hl, W_RIVALNAME ; $d34a + ld hl, W_RIVALNAME ; wd34a ld a, $1 - ld [$d07d], a + ld [wd07d], a call DisplayNamingScreen - ld a, [$cf4b] + ld a, [wcf4b] cp $50 jr z, .asm_69c1 call ClearScreen @@ -72,19 +72,17 @@ Func_69ec: ; 69ec (1:69ec) ld c, $a call DelayFrames pop de - ld hl, $cd6d + ld hl, wcd6d ld bc, $b call CopyData call Delay3 - FuncCoord 12, 4 ; $c3fc - ld hl, Coord + hlCoord 12, 4 ld de, $67d ld a, $ff jr asm_6a19 Func_6a12: ; 6a12 (1:6a12) - FuncCoord 5, 4 ; $c3f5 - ld hl, Coord + hlCoord 5, 4 ld de, $67d xor a asm_6a19: ; 6a19 (1:6a19) @@ -161,25 +159,23 @@ DisplayIntroNameTextBox: ; 6a6c (1:6a6c) ld b, $a ld c, $9 call TextBoxBorder - FuncCoord 3, 0 ; $c3a3 - ld hl, Coord + hlCoord 3, 0 ld de, .namestring ; $6aa3 call PlaceString pop de - FuncCoord 2, 2 ; $c3ca - ld hl, Coord + hlCoord 2, 2 call PlaceString call UpdateSprites xor a - ld [wCurrentMenuItem], a ; $cc26 - ld [wLastMenuItem], a ; $cc2a + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wLastMenuItem], a ; wLastMenuItem inc a - ld [wTopMenuItemX], a ; $cc25 - ld [wMenuWatchedKeys], a ; $cc29 + ld [wTopMenuItemX], a ; wTopMenuItemX + ld [wMenuWatchedKeys], a ; wMenuWatchedKeys inc a - ld [wTopMenuItemY], a ; $cc24 + ld [wTopMenuItemY], a ; wTopMenuItemY inc a - ld [wMaxMenuItem], a ; $cc28 + ld [wMaxMenuItem], a ; wMaxMenuItem jp HandleMenuInput .namestring ; 6aa3 (1:6aa3) @@ -235,7 +231,7 @@ Func_6ad6: ; 6ad6 (1:6ad6) .asm_6ae7 ld h, d ld l, e - ld de, $cd6d + ld de, wcd6d ld bc, $14 jp CopyData IF _RED diff --git a/engine/oam_dma.asm b/engine/oam_dma.asm new file mode 100644 index 00000000..3de4d773 --- /dev/null +++ b/engine/oam_dma.asm @@ -0,0 +1,25 @@ +WriteDMACodeToHRAM: +; Since no other memory is available during OAM DMA, +; DMARoutine is copied to HRAM and executed there. + ld c, $ff80 % $100 + ld b, DMARoutineEnd - DMARoutine + ld hl, DMARoutine +.copy + ld a, [hli] + ld [$ff00+c], a + inc c + dec b + jr nz, .copy + ret + +DMARoutine: + ; initiate DMA + ld a, wOAMBuffer / $100 + ld [$ff46], a + + ; wait for DMA to finish + ld a, $28 +.wait dec a + jr nz, .wait + ret +DMARoutineEnd: diff --git a/engine/overworld/cable_club_npc.asm b/engine/overworld/cable_club_npc.asm index 88bf177f..9ae5b508 100755 --- a/engine/overworld/cable_club_npc.asm +++ b/engine/overworld/cable_club_npc.asm @@ -1,7 +1,7 @@ CableClubNPC: ; 71c5 (1:71c5) ld hl, CableClubNPCText1 call PrintText - ld a, [$d74b] + ld a, [wd74b] bit 5, a jp nz, Func_71e1 ld c, $3c @@ -12,9 +12,9 @@ CableClubNPC: ; 71c5 (1:71c5) Func_71e1: ; 71e1 (1:71e1) ld a, $1 - ld [$cc34], a + ld [wMenuJoypadPollCount], a ld a, $5a - ld [$cc47], a + ld [wcc47], a .asm_71eb ld a, [$ffaa] cp $2 @@ -29,9 +29,9 @@ Func_71e1: ; 71e1 (1:71e1) ld [$ffad], a ld a, $80 ld [$ff02], a - ld a, [$cc47] + ld a, [wcc47] dec a - ld [$cc47], a + ld [wcc47], a jr z, .asm_7287 ; 0x720b $7a ld a, $1 ld [$ff01], a @@ -48,11 +48,11 @@ Func_71e1: ; 71e1 (1:71e1) ld hl, CableClubNPCText2 call PrintText xor a - ld [$cc34], a + ld [wMenuJoypadPollCount], a call YesNoChoice ld a, $1 - ld [$cc34], a - ld a, [$cc26] + ld [wMenuJoypadPollCount], a + ld a, [wCurrentMenuItem] and a jr nz, .asm_728f ; 0x723e $4f callab SaveSAVtoSRAM @@ -61,15 +61,15 @@ Func_71e1: ; 71e1 (1:71e1) call PlaySoundWaitForCurrent ld hl, CableClubNPCText3 call PrintText - ld hl, $cc47 + ld hl, wcc47 ld a, $3 ld [hli], a xor a ld [hl], a ld [$ffa9], a - ld [$cc42], a + ld [wcc42], a call Func_227f - ld hl, $cc47 + ld hl, wcc47 ld a, [hli] inc a jr nz, Func_72a8 ; 0x726b $3b @@ -98,13 +98,13 @@ Func_71e1: ; 71e1 (1:71e1) Func_7298: ; 7298 (1:7298) xor a - ld hl, $cc47 + ld hl, wcc47 ld [hli], a ld [hl], a - ld hl, $d72e + ld hl, wd72e res 6, [hl] xor a - ld [$cc34], a + ld [wMenuJoypadPollCount], a ret Func_72a8: ; 72a8 (1:72a8) diff --git a/engine/overworld/card_key.asm b/engine/overworld/card_key.asm index 658f4712..f48c26f4 100755 --- a/engine/overworld/card_key.asm +++ b/engine/overworld/card_key.asm @@ -8,9 +8,8 @@ PrintCardKeyText: ; 52673 (14:6673) ret z cp b jr nz, .asm_5267a - ld a, $35 - call Predef ; indirect jump to Func_c586 (c586 (3:4586)) - ld a, [$cfc6] + predef Func_c586 + ld a, [wcfc6] cp $18 jr z, .asm_5269c cp $24 @@ -35,12 +34,12 @@ PrintCardKeyText: ; 52673 (14:6673) srl d ld a, d ld b, a - ld [$d73f], a + ld [wd73f], a srl e ld a, e ld c, a - ld [$d740], a - ld a, [W_CURMAP] ; $d35e + ld [wd740], a + ld a, [W_CURMAP] ; W_CURMAP cp SILPH_CO_11F jr nz, .asm_526c8 ld a, $3 @@ -48,10 +47,9 @@ PrintCardKeyText: ; 52673 (14:6673) .asm_526c8 ld a, $e .asm_526ca - ld [$d09f], a - ld a, $17 - call Predef ; indirect jump to Func_ee9e - ld hl, $d126 + ld [wd09f], a + predef Func_ee9e + ld hl, wd126 set 5, [hl] ld a, (SFX_1f_57 - SFX_Headers_1f) / 3 jp PlaySound @@ -84,11 +82,11 @@ CardKeyFailText: ; 526f8 (14:66f8) db "@" Func_526fd: ; 526fd (14:66fd) - ld a, [W_YCOORD] ; $d361 + ld a, [W_YCOORD] ; wd361 ld d, a - ld a, [W_XCOORD] ; $d362 + ld a, [W_XCOORD] ; wd362 ld e, a - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] and a jr nz, .asm_5270d inc d diff --git a/engine/overworld/cinnabar_lab.asm b/engine/overworld/cinnabar_lab.asm index 4087b334..eefa2176 100755 --- a/engine/overworld/cinnabar_lab.asm +++ b/engine/overworld/cinnabar_lab.asm @@ -1,18 +1,18 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006) - ld hl, $d730 + ld hl, wd730 set 6, [hl] xor a - ld [wCurrentMenuItem], a ; $cc26 + ld [wCurrentMenuItem], a ; wCurrentMenuItem ld a, $3 - ld [wMenuWatchedKeys], a ; $cc29 - ld a, [$cd37] + ld [wMenuWatchedKeys], a ; wMenuWatchedKeys + ld a, [wcd37] dec a - ld [wMaxMenuItem], a ; $cc28 + ld [wMaxMenuItem], a ; wMaxMenuItem ld a, $2 - ld [wTopMenuItemY], a ; $cc24 + ld [wTopMenuItemY], a ; wTopMenuItemY ld a, $1 - ld [wTopMenuItemX], a ; $cc25 - ld a, [$cd37] + ld [wTopMenuItemX], a ; wTopMenuItemX + ld a, [wcd37] dec a ld bc, $2 ld hl, $3 @@ -24,13 +24,13 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006) call TextBoxBorder call UpdateSprites call Func_610c2 - ld hl, $d730 + ld hl, wd730 res 6, [hl] call HandleMenuInput bit 1, a jr nz, .asm_610a7 - ld hl, $cc5b - ld a, [wCurrentMenuItem] ; $cc26 + ld hl, wcc5b + ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld d, $0 ld e, a add hl, de @@ -55,7 +55,7 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006) ld hl, LabFossil_610ae call PrintText call YesNoChoice - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem and a jr nz, .asm_610a7 ld hl, LabFossil_610b3 @@ -65,7 +65,7 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006) callba RemoveItemByID ld hl, LabFossil_610b8 call PrintText - ld hl, $d7a3 + ld hl, wd7a3 set 0, [hl] set 1, [hl] ret @@ -91,7 +91,7 @@ LabFossil_610bd: ; 610bd (18:50bd) db "@" Func_610c2: ; 610c2 (18:50c2) - ld hl, $cc5b + ld hl, wcc5b xor a ld [$ffdb], a .asm_610c8 @@ -99,14 +99,13 @@ Func_610c2: ; 610c2 (18:50c2) cp $ff ret z push hl - ld [$d11e], a + ld [wd11e], a call GetItemName - FuncCoord 2, 2 ; $c3ca - ld hl, Coord + hlCoord 2, 2 ld a, [$ffdb] ld bc, $28 call AddNTimes - ld de, $cd6d + ld de, wcd6d call PlaceString ld hl, $ffdb inc [hl] @@ -116,10 +115,10 @@ Func_610c2: ; 610c2 (18:50c2) ; loads the names of the fossil item and the resulting mon LoadFossilItemAndMonName: ; 610eb (18:50eb) ld a, [W_FOSSILMON] - ld [$d11e], a + ld [wd11e], a call GetMonName call CopyStringToCF4B ld a, [W_FOSSILITEM] - ld [$d11e], a + ld [wd11e], a call GetItemName ret diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index 6c888e7f..29b52eb9 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -1,18 +1,18 @@ UsedCut: ; ef54 (3:6f54) xor a - ld [$cd6a], a - ld a, [W_CURMAPTILESET] ; $d367 + ld [wcd6a], a + ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET and a ; OVERWORLD jr z, .asm_ef6b cp GYM jr nz, .asm_ef77 - ld a, [$cfc6] + ld a, [wcfc6] cp $50 ; gym cut tree jr nz, .asm_ef77 jr asm_ef82 .asm_ef6b dec a - ld a, [$cfc6] + ld a, [wcfc6] cp $3d ; cut tree jr z, asm_ef82 cp $52 ; grass @@ -26,16 +26,16 @@ NothingToCutText: ; ef7d (3:6f7d) db "@" asm_ef82: ; ef82 (3:6f82) - ld [$cd4d], a + ld [wcd4d], a ld a, $1 - ld [$cd6a], a - ld a, [wWhichPokemon] ; $cf92 - ld hl, W_PARTYMON1NAME ; $d2b5 + ld [wcd6a], a + ld a, [wWhichPokemon] ; wWhichPokemon + ld hl, wPartyMonNicks ; wPartyMonNicks call GetPartyMonName - ld hl, $d730 + ld hl, wd730 set 6, [hl] call GBPalWhiteOutWithDelay3 - call CleanLCD_OAM + call ClearSprites call Func_3dbe ld a, $90 ld [$ffb0], a @@ -49,17 +49,17 @@ asm_ef82: ; ef82 (3:6f82) ld hl, UsedCutText call PrintText call LoadScreenTilesFromBuffer2 - ld hl, $d730 + ld hl, wd730 res 6, [hl] ld a, $ff - ld [$cfcb], a + ld [wcfcb], a call AnimateCutTree ld de, CutTreeBlockSwaps ; $7100 call Func_f09f call Func_eedc callba Func_79e96 ld a, $1 - ld [$cfcb], a + ld [wcfcb], a ld a, (SFX_02_56 - SFX_Headers_02) / 3 call PlaySound ld a, $90 @@ -73,32 +73,32 @@ UsedCutText: ; eff2 (3:6ff2) AnimateCutTree: ; eff7 (3:6ff7) xor a - ld [$cd50], a + ld [wcd50], a ld a, $e4 ld [rOBP1], a ; $ff49 - ld a, [$cd4d] + ld a, [wcd4d] cp $52 jr z, .asm_f020 ld de, Overworld_GFX + $2d0 ; $42d0 ; cuttable tree sprite top row - ld hl, $8fc0 + ld hl, vChars1 + $7c0 ld bc, (BANK(Overworld_GFX) << 8) + $02 call CopyVideoData ld de, Overworld_GFX + $3d0 ; $43d0 ; cuttable tree sprite bottom row - ld hl, $8fe0 + ld hl, vChars1 + $7e0 ld bc, (BANK(Overworld_GFX) << 8) + $02 call CopyVideoData jr asm_f055 .asm_f020 - ld hl, $8fc0 + ld hl, vChars1 + $7c0 call LoadCutTreeOAM - ld hl, $8fd0 + ld hl, vChars1 + $7d0 call LoadCutTreeOAM - ld hl, $8fe0 + ld hl, vChars1 + $7e0 call LoadCutTreeOAM - ld hl, $8ff0 + ld hl, vChars1 + $7f0 call LoadCutTreeOAM call asm_f055 - ld hl, $c393 + ld hl, wOAMBuffer + $93 ld de, $4 ld a, $30 ld c, e @@ -125,7 +125,7 @@ CutTreeOAM: ; f060 (3:7060) db $FE,$10,$FF,$10 Func_f068: ; f068 (3:7068) - ld hl, $c104 + ld hl, wSpriteStateData1 + 4 ld a, [hli] ld b, a inc hl @@ -137,7 +137,7 @@ Func_f068: ; f068 (3:7068) srl a ld e, a ld d, $0 ; de holds direction (00: down, 02: up, 04: left, 06: right) - ld a, [$cd50] + ld a, [wcd50] and a ld hl, CutTreeAnimationOffsets ; $708f jr z, .asm_f084 @@ -173,39 +173,39 @@ CutTreeAnimationOffsets2: ; f097 (3:7097) Func_f09f: ; f09f (3:709f) push de - ld a, [W_CURMAPWIDTH] ; $d369 + ld a, [W_CURMAPWIDTH] ; wd369 add $6 ld c, a ld b, $0 ld d, $0 - ld hl, $d35f + ld hl, wd35f ld a, [hli] ld h, [hl] ld l, a add hl, bc - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] and a jr z, .asm_f0c7 cp $4 jr z, .asm_f0cf cp $8 jr z, .asm_f0d7 - ld a, [W_XBLOCKCOORD] ; $d364 + ld a, [W_XBLOCKCOORD] ; wd364 and a jr z, .asm_f0e0 jr .asm_f0ec .asm_f0c7 - ld a, [W_YBLOCKCOORD] ; $d363 + ld a, [W_YBLOCKCOORD] ; wd363 and a jr z, .asm_f0e0 jr .asm_f0df .asm_f0cf - ld a, [W_YBLOCKCOORD] ; $d363 + ld a, [W_YBLOCKCOORD] ; wd363 and a jr z, .asm_f0e1 jr .asm_f0e0 .asm_f0d7 - ld a, [W_XBLOCKCOORD] ; $d364 + ld a, [W_XBLOCKCOORD] ; wd364 and a jr z, .asm_f0e6 jr .asm_f0e0 diff --git a/engine/overworld/cut2.asm b/engine/overworld/cut2.asm index c83e571b..08f6d651 100755 --- a/engine/overworld/cut2.asm +++ b/engine/overworld/cut2.asm @@ -1,18 +1,18 @@ Func_79e96: ; 79e96 (1e:5e96) - ld a, [$cd4d] + ld a, [wcd4d] cp $52 jr z, .asm_79ec8 ld c, $8 .asm_79e9f push bc - ld hl, $c391 + ld hl, wOAMBuffer + $91 ld a, $1 - ld [$d08a], a + ld [wd08a], a ld c, $2 call Func_79339 - ld hl, $c399 + ld hl, wOAMBuffer + $99 ld a, $ff - ld [$d08a], a + ld [wd08a], a ld c, $2 call Func_79339 ld a, [rOBP1] ; $ff49 @@ -33,9 +33,9 @@ Func_79e96: ; 79e96 (1e:5e96) ld c, $8 call Func_79eed call Func_79f30 - ld hl, $c390 + ld hl, wOAMBuffer + $90 ld a, $2 - ld [$d08a], a + ld [wd08a], a ld c, $4 call Func_79352 pop bc @@ -45,24 +45,24 @@ Func_79e96: ; 79e96 (1e:5e96) Func_79eed: ; 79eed (1e:5eed) push bc - ld hl, $c391 + ld hl, wOAMBuffer + $91 ld a, $1 - ld [$d08a], a + ld [wd08a], a ld c, $1 call Func_79339 - ld hl, $c395 + ld hl, wOAMBuffer + $95 ld a, $2 - ld [$d08a], a + ld [wd08a], a ld c, $1 call Func_79339 - ld hl, $c399 + ld hl, wOAMBuffer + $99 ld a, $fe - ld [$d08a], a + ld [wd08a], a ld c, $1 call Func_79339 - ld hl, $c39d + ld hl, wOAMBuffer + $9d ld a, $ff - ld [$d08a], a + ld [wd08a], a ld c, $1 call Func_79339 ld a, [rOBP1] ; $ff49 @@ -75,15 +75,15 @@ Func_79eed: ; 79eed (1e:5eed) ret Func_79f30: ; 79f30 (1e:5f30) - ld hl, $c390 - ld de, $cee9 + ld hl, wOAMBuffer + $90 + ld de, wHPBarMaxHP ld bc, $8 call CopyData - ld hl, $c398 - ld de, $c390 + ld hl, wOAMBuffer + $98 + ld de, wOAMBuffer + $90 ld bc, $8 call CopyData - ld hl, $cee9 - ld de, $c398 + ld hl, wHPBarMaxHP + ld de, wOAMBuffer + $98 ld bc, $8 jp CopyData diff --git a/engine/overworld/doors.asm b/engine/overworld/doors.asm index ff58b752..42ebb174 100755 --- a/engine/overworld/doors.asm +++ b/engine/overworld/doors.asm @@ -1,7 +1,7 @@ HandleDoors: ; 1a609 (6:6609) push de ld hl, DoorTileIDPointers ; $662c - ld a, [W_CURMAPTILESET] ; $d367 + ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET ld de, $3 call IsInArray pop de @@ -10,8 +10,7 @@ HandleDoors: ; 1a609 (6:6609) ld a, [hli] ld h, [hl] ld l, a - FuncCoord 8, 9 ; $c45c - ld a, [Coord] + aCoord 8, 9 ld b, a .asm_1a621 ld a, [hli] diff --git a/engine/overworld/elevator.asm b/engine/overworld/elevator.asm index e483e0c3..10b3b003 100755 --- a/engine/overworld/elevator.asm +++ b/engine/overworld/elevator.asm @@ -34,14 +34,14 @@ ShakeElevator: ; 7bf15 (1e:7f15) ld a, (SFX_02_5f - SFX_Headers_02) / 3 call PlayMusic .asm_7bf57 - ld a, [$c02a] + ld a, [wc02a] cp $b9 jr z, .asm_7bf57 call UpdateSprites jp Func_2307 Func_7bf64: ; 7bf64 (1e:7f64) - ld hl, $d527 + ld hl, wd527 ld a, [hld] push af ld a, [hl] diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm index b480c06d..ae7702b4 100755 --- a/engine/overworld/emotion_bubbles.asm +++ b/engine/overworld/emotion_bubbles.asm @@ -1,5 +1,5 @@ -PrintEmotionBubble: ; 17c47 (5:7c47) - ld a, [$cd50] +EmotionBubble: ; 17c47 (5:7c47) + ld a, [wcd50] ld c, a ld b, $0 ld hl, EmotionBubblesPointerTable ; $7caf @@ -8,20 +8,20 @@ PrintEmotionBubble: ; 17c47 (5:7c47) ld e, [hl] inc hl ld d, [hl] - ld hl, $8f80 + ld hl, vChars1 + $780 ld bc, (BANK(EmotionBubblesPointerTable) << 8) + $04 call CopyVideoData - ld a, [$cfcb] + ld a, [wcfcb] push af ld a, $ff - ld [$cfcb], a - ld a, [$d736] + ld [wcfcb], a + ld a, [wd736] bit 6, a - ld hl, $c38f - ld de, $c39f + ld hl, wOAMBuffer + $8f + ld de, wOAMBuffer + $9f jr z, .asm_17c7a - ld hl, $c37f - ld de, $c38f + ld hl, wOAMBuffer + $7f + ld de, wOAMBuffer + $8f .asm_17c7a ld bc, $90 .asm_17c7d @@ -33,8 +33,8 @@ PrintEmotionBubble: ; 17c47 (5:7c47) ld a, c or b jr nz, .asm_17c7d - ld hl, $c104 - ld a, [$cd4f] + ld hl, wSpriteStateData1 + 4 + ld a, [wcd4f] swap a ld c, a ld b, $0 @@ -51,7 +51,7 @@ PrintEmotionBubble: ; 17c47 (5:7c47) ld c, $3c call DelayFrames pop af - ld [$cfcb], a + ld [wcfcb], a call DelayFrame jp UpdateSprites @@ -65,4 +65,4 @@ EmotionBubblesOAM: ; 17cb5 (5:7cb5) db $FA,$00,$FB,$00 EmotionBubbles: ; 17cbd (5:7cbd) - INCBIN "gfx/emotion_bubbles.w16.2bpp" + INCBIN "gfx/emotion_bubbles.2bpp" diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm index 77ff4ccc..9c93583d 100755 --- a/engine/overworld/healing_machine.asm +++ b/engine/overworld/healing_machine.asm @@ -1,9 +1,9 @@ AnimateHealingMachine: ; 70433 (1c:4433) ld de, PokeCenterFlashingMonitorAndHealBall ; $44b7 - ld hl, $87c0 + ld hl, vChars0 + $7c0 ld bc, (BANK(PokeCenterFlashingMonitorAndHealBall) << 8) + $03 call CopyVideoData - ld hl, $cfcb + ld hl, wcfcb ld a, [hl] push af ld [hl], $ff @@ -12,19 +12,19 @@ AnimateHealingMachine: ; 70433 (1c:4433) push af ld a, $e0 ld [rOBP1], a ; $ff49 - ld hl, $c384 + ld hl, wOAMBuffer + $84 ld de, PokeCenterOAMData ; $44d7 call Func_70503 ld a, $4 ld [wMusicHeaderPointer], a ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound .asm_70464 ld a, [wMusicHeaderPointer] and a jr nz, .asm_70464 - ld a, [W_NUMINPARTY] ; $d163 + ld a, [wPartyCount] ; wPartyCount ld b, a .asm_7046e call Func_70503 @@ -34,23 +34,23 @@ AnimateHealingMachine: ; 70433 (1c:4433) call DelayFrames dec b jr nz, .asm_7046e - ld a, [$c0ef] + ld a, [wc0ef] cp $1f - ld [$c0f0], a + ld [wc0f0], a jr nz, .asm_70495 ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound - ld a, Bank(Func_9876) - ld [$c0ef], a + ld a, BANK(Music_PkmnHealed) + ld [wc0ef], a .asm_70495 ld a, MUSIC_PKMN_HEALED - ld [$c0ee], a + ld [wc0ee], a call PlaySound ld d, $28 call Func_704f3 .asm_704a2 - ld a, [$c026] + ld a, [wc026] cp MUSIC_PKMN_HEALED jr z, .asm_704a2 ld c, $20 diff --git a/engine/overworld/hidden_items.asm b/engine/overworld/hidden_items.asm index db6bf1cd..77bd8fe6 100755 --- a/engine/overworld/hidden_items.asm +++ b/engine/overworld/hidden_items.asm @@ -1,21 +1,20 @@ HiddenItems: ; 76688 (1d:6688) ld hl, HiddenItemCoords call Func_76857 - ld [$cd41], a - ld hl, $d6f0 - ld a, [$cd41] + ld [wTrainerScreenX], a + ld hl, wd6f0 + ld a, [wTrainerScreenX] ld c, a ld b, $2 - ld a, $10 - call Predef + predef FlagActionPredef ld a, c and a ret nz call EnableAutoTextBoxDrawing ld a, $1 - ld [$cc3c], a - ld a, [$cd3d] ; item ID - ld [$d11e], a + ld [wcc3c], a + ld a, [wWhichTrade] ; item ID + ld [wd11e], a call GetItemName ld a, $24 jp PrintPredefTextID @@ -26,17 +25,16 @@ FoundHiddenItemText: ; 7675b (1d:675b) ; XXX where is the pointer to this? TX_FAR _FoundHiddenItemText db $8 - ld a, [$cd3d] ; item ID + ld a, [wWhichTrade] ; item ID ld b, a ld c, 1 call GiveItem jr nc, .BagFull - ld hl, $d6f0 - ld a, [$cd41] + ld hl, wd6f0 + ld a, [wTrainerScreenX] ld c, a ld b, $1 - ld a, $10 - call Predef + predef FlagActionPredef ld a, (SFX_02_3b - SFX_Headers_02) / 3 call PlaySoundWaitForCurrent ; play sound call WaitForSoundToFinish ; wait for sound to finish playing @@ -44,7 +42,7 @@ FoundHiddenItemText: ; 7675b (1d:675b) .BagFull call WaitForTextScrollButtonPress ; wait for button press xor a - ld [$cc3c], a + ld [wcc3c], a ld hl, HiddenItemBagFullText call PrintText jp TextScriptEnd @@ -55,20 +53,18 @@ HiddenItemBagFullText: ; 76794 (1d:6794) HiddenCoins: ; 76799 (1d:6799) ld b, COIN_CASE - ld a, $1c - call Predef + predef IsItemInBag_ ld a, b and a ret z ld hl, HiddenCoinCoords call Func_76857 - ld [$cd41], a - ld hl, $d6fe - ld a, [$cd41] + ld [wTrainerScreenX], a + ld hl, wd6fe + ld a, [wTrainerScreenX] ld c, a ld b, $2 - ld a, $10 - call Predef + predef FlagActionPredef ld a, c and a ret nz @@ -76,7 +72,7 @@ HiddenCoins: ; 76799 (1d:6799) ld [$ff9f], a ld [$ffa0], a ld [$ffa1], a - ld a, [$cd3d] + ld a, [wWhichTrade] sub COIN cp 10 jr z, .bcd10 @@ -101,17 +97,15 @@ HiddenCoins: ; 76799 (1d:6799) ld a, $1 ld [$ffa0], a .bcddone - ld de, $d5a5 + ld de, wPlayerCoins + 1 ld hl, $ffa1 ld c, $2 - ld a, $b - call Predef - ld hl, $d6fe - ld a, [$cd41] + predef AddBCDPredef + ld hl, wd6fe + ld a, [wTrainerScreenX] ld c, a ld b, $1 - ld a, $10 - call Predef + predef FlagActionPredef call EnableAutoTextBoxDrawing ld a, [wPlayerCoins] cp $99 @@ -139,9 +133,9 @@ DroppedHiddenCoinsText: ; 7684d (1d:684d) db "@" Func_76857: ; 76857 (1d:6857) - ld a, [$cd40] + ld a, [wTrainerScreenY] ld d, a - ld a, [$cd41] + ld a, [wTrainerScreenX] ld e, a ld a, [W_CURMAP] ld b, a diff --git a/engine/overworld/hidden_objects.asm b/engine/overworld/hidden_objects.asm index e4777a84..d2114293 100755 --- a/engine/overworld/hidden_objects.asm +++ b/engine/overworld/hidden_objects.asm @@ -1,16 +1,16 @@ Func_46981: ; 46981 (11:6981) xor a - ld [$d71e], a - ld a, [$d72d] + ld [wd71e], a + ld a, [wd72d] bit 4, a ret nz call ArePlayerCoordsInArray ret nc - ld a, [wWhichTrade] ; $cd3d - ld [$d71e], a - ld hl, $d72d + ld a, [wWhichTrade] ; wWhichTrade + ld [wd71e], a + ld hl, wd72d set 4, [hl] - ld hl, $d732 + ld hl, wd732 set 4, [hl] ret @@ -28,7 +28,7 @@ Func_469a0: ; 469a0 (11:69a0) ld b, a cp $ff jr z, .asm_469fc - ld a, [W_CURMAP] ; $d35e + ld a, [W_CURMAP] ; W_CURMAP cp b jr z, .asm_469be inc de @@ -41,7 +41,7 @@ Func_469a0: ; 469a0 (11:69a0) ld h, [hl] ld l, a push hl - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade xor a ld [hli], a ld [hli], a @@ -51,10 +51,10 @@ Func_469a0: ; 469a0 (11:69a0) ld a, [hli] cp $ff jr z, .asm_469fc - ld [$cd40], a + ld [wTrainerScreenY], a ld b, a ld a, [hli] - ld [$cd41], a + ld [wTrainerScreenX], a ld c, a call Func_46a01 ld a, [$ffea] @@ -65,15 +65,15 @@ Func_469a0: ; 469a0 (11:69a0) inc hl inc hl push hl - ld hl, $cd3f + ld hl, wTrainerFacingDirection inc [hl] pop hl jr .asm_469ce .asm_469f0 ld a, [hli] - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ; wWhichTrade ld a, [hli] - ld [$cd3e], a + ld [wTrainerEngageDistance], a ld a, [hli] ld h, [hl] ld l, a @@ -84,37 +84,37 @@ Func_469a0: ; 469a0 (11:69a0) ret Func_46a01: ; 46a01 (11:6a01) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 jr z, .asm_46a16 cp $8 jr z, .asm_46a25 cp $c jr z, .asm_46a2b - ld a, [W_YCOORD] ; $d361 + ld a, [W_YCOORD] ; wd361 inc a jr .asm_46a1a .asm_46a16 - ld a, [W_YCOORD] ; $d361 + ld a, [W_YCOORD] ; wd361 dec a .asm_46a1a cp b jr nz, .asm_46a3b - ld a, [W_XCOORD] ; $d362 + ld a, [W_XCOORD] ; wd362 cp c jr nz, .asm_46a3b jr .asm_46a38 .asm_46a25 - ld a, [W_XCOORD] ; $d362 + ld a, [W_XCOORD] ; wd362 dec a jr .asm_46a2f .asm_46a2b - ld a, [W_XCOORD] ; $d362 + ld a, [W_XCOORD] ; wd362 inc a .asm_46a2f cp c jr nz, .asm_46a3b - ld a, [W_YCOORD] ; $d361 + ld a, [W_YCOORD] ; wd361 cp b jr nz, .asm_46a3b .asm_46a38 diff --git a/engine/overworld/item.asm b/engine/overworld/item.asm new file mode 100644 index 00000000..a69ec106 --- /dev/null +++ b/engine/overworld/item.asm @@ -0,0 +1,54 @@ +PickupItem: + call EnableAutoTextBoxDrawing + + ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c + ld b, a + ld hl, W_MISSABLEOBJECTLIST +.missableObjectsListLoop + ld a, [hli] + cp $ff + ret z + cp b + jr z, .isMissable + inc hl + jr .missableObjectsListLoop + +.isMissable + ld a, [hl] + ld [$ffdb], a + + ld hl, W_MAPSPRITEEXTRADATA + ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c + dec a + add a + ld d, 0 + ld e, a + add hl, de + ld a, [hl] + ld b, a ; item + ld c, 1 ; quantity + call GiveItem + jr nc, .BagFull + + ld a, [$ffdb] + ld [wcc4d], a + predef HideObject + ld a, 1 + ld [wcc3c], a + ld hl, FoundItemText + jr .print + +.BagFull + ld hl, NoMoreRoomForItemText +.print + call PrintText + ret + +FoundItemText: + TX_FAR _FoundItemText + db $0B + db "@" + +NoMoreRoomForItemText: + TX_FAR _NoMoreRoomForItemText + db "@" diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index d2f248cd..43df82e2 100755 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -1,18 +1,16 @@ HandleLedges: ; 1a672 (6:6672) - ld a, [$d736] + ld a, [wd736] bit 6, a ret nz - ld a, [W_CURMAPTILESET] ; $d367 + ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET and a ; OVERWORLD ret nz - ld a, $35 - call Predef ; indirect jump to Func_c586 (c586 (3:4586)) - ld a, [$c109] + predef Func_c586 + ld a, [wSpriteStateData1 + 9] ld b, a - FuncCoord 8, 9 ; $c45c - ld a, [Coord] + aCoord 8, 9 ld c, a - ld a, [$cfc6] + ld a, [wcfc6] ld d, a ld hl, LedgeTiles ; $66cf .asm_1a691 @@ -38,19 +36,19 @@ HandleLedges: ; 1a672 (6:6672) inc hl jr .asm_1a691 .asm_1a6a9 - ld a, [H_CURRENTPRESSEDBUTTONS] + ld a, [hJoyHeld] and e ret z ld a, $ff - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d736 + ld [wJoyIgnore], a + ld hl, wd736 set 6, [hl] call Func_3486 ld a, e - ld [$ccd3], a - ld [$ccd4], a + ld [wccd3], a + ld [wccd4], a ld a, $2 - ld [$cd38], a + ld [wcd38], a call LoadHoppingShadowOAM ld a, (SFX_02_4e - SFX_Headers_02) / 3 call PlaySound @@ -69,7 +67,7 @@ LedgeTiles: ; 1a6cf (6:66cf) db $FF LoadHoppingShadowOAM: ; 1a6f0 (6:66f0) - ld hl, $8ff0 + ld hl, vChars1 + $7f0 ld de, LedgeHoppingShadow ; $6708 ld bc, (BANK(LedgeHoppingShadow) << 8) + $01 call CopyVideoDataDouble diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm index a734319d..81443c9f 100755 --- a/engine/overworld/map_sprites.asm +++ b/engine/overworld/map_sprites.asm @@ -4,7 +4,7 @@ ; This is also called after displaying text because loading ; text tile patterns overwrites half of the sprite tile pattern data. ; Note on notation: -; $C1X* and $C2X* are used to denote $C100-$C1FF and $C200-$C2FF sprite slot +; $C1X* and $C2X* are used to denote wSpriteStateData1-wSpriteStateData1 + $ff and wSpriteStateData2 + $00-wSpriteStateData2 + $ff sprite slot ; fields, respectively, within loops. The X is the loop index. ; If there is an inner loop, Y is the inner loop index, i.e. $C1Y* and $C2Y* ; denote fields of the sprite slots interated over in the inner loop. @@ -13,7 +13,7 @@ InitMapSprites: ; 1785b (5:785b) ret c ; return if the map is an outside map (already handled by above call) ; if the map is an inside map (i.e. mapID >= $25) ld hl,wSpriteStateData1 - ld de,$c20d + ld de,wSpriteStateData2 + $0d ; Loop to copy picture ID's from $C1X0 to $C2XD for LoadMapSpriteTilePatterns. .copyPictureIDLoop ld a,[hl] ; $C1X0 (picture ID) @@ -37,7 +37,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) .spritesExist ld c,a ; c = [W_NUMSPRITES] ld b,$10 ; number of sprite slots - ld hl,$c20d + ld hl,wSpriteStateData2 + $0d xor a ld [$ff8e],a ; 4-tile sprite counter .copyPictureIDLoop ; loop to copy picture ID from $C2XD to $C2XE @@ -48,9 +48,9 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) ld l,a dec b jr nz,.copyPictureIDLoop - ld hl,$c21e + ld hl,wSpriteStateData2 + $1e .loadTilePatternLoop - ld de,$c21d + ld de,wSpriteStateData2 + $1d ; Check if the current picture ID has already had its tile patterns loaded. ; This done by looping through the previous sprite slots and seeing if any of ; their picture ID's match that of the current sprite slot. @@ -70,7 +70,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) ld e,a jr .checkIfAlreadyLoadedLoop .notAlreadyLoaded - ld de,$c20e + ld de,wSpriteStateData2 + $0e ld b,$01 ; loop to find the highest tile pattern VRAM slot (among the first 10 slots) used by a previous sprite slot ; this is done in order to find the first free VRAM slot available @@ -126,7 +126,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) push af push de push bc - ld hl,$8000 ; VRAM base address + ld hl,vNPCSprites ; VRAM base address ld bc,$c0 ; number of bytes per VRAM slot ld a,[$ff8d] cp a,11 ; is it a 4-tile sprite? @@ -141,12 +141,12 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) jr nz,.calculateVRAMAddrLoop jr .loadStillTilePattern .fourTileSpriteVRAMAddr - ld hl,$87c0 ; address for second 4-tile sprite + ld hl,vSprites + $7c0 ; address for second 4-tile sprite ld a,[$ff8e] ; 4-tile sprite counter and a ; is it the first 4-tile sprite? jr nz,.loadStillTilePattern ; if it's the first 4-tile sprite - ld hl,$8780 ; address for first 4-tile sprite + ld hl,vSprites + $780 ; address for first 4-tile sprite inc a ld [$ff8e],a ; 4-tile sprite counter .loadStillTilePattern @@ -159,7 +159,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) ld l,e pop de ld b,a - ld a,[$cfc4] + ld a,[wcfc4] bit 0,a ; reloading upper half of tile patterns after displaying text? jr nz,.skipFirstLoad ; if so, skip loading data into the lower half ld a,b @@ -180,7 +180,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) jr nc,.noCarry3 inc d .noCarry3 - ld a,[$cfc4] + ld a,[wcfc4] bit 0,a ; reloading upper half of tile patterns after displaying text? jr nz,.loadWhileLCDOn pop af @@ -216,7 +216,7 @@ LoadMapSpriteTilePatterns: ; 17871 (5:7871) ld l,a dec c jp nz,.loadTilePatternLoop - ld hl,$c20d + ld hl,wSpriteStateData2 + $0d ld b,$10 ; the pictures ID's stored at $C2XD are no longer needed, so zero them .zeroStoredPictureIDLoop @@ -264,7 +264,7 @@ InitOutsideMapSprites: ; 1797b (5:797b) cp a,$f0 ; does the map have 2 sprite sets? call nc,GetSplitMapSpriteSetID ; if so, choose the appropriate one ld b,a ; b = spriteSetID - ld a,[$cfc4] + ld a,[wcfc4] bit 0,a ; reloading upper half of tile patterns after displaying text? jr nz,.loadSpriteSet ; if so, forcibly reload the sprite set ld a,[W_SPRITESETID] @@ -288,7 +288,7 @@ InitOutsideMapSprites: ; 1797b (5:797b) jr nc,.noCarry2 inc d .noCarry2 - ld hl,$c20d + ld hl,wSpriteStateData2 + $0d ld a,SPRITE_RED ld [hl],a ld bc,W_SPRITESET @@ -324,7 +324,7 @@ InitOutsideMapSprites: ; 1797b (5:797b) call LoadMapSpriteTilePatterns pop af ld [W_NUMSPRITES],a ; restore number of sprites - ld hl,$c21e + ld hl,wSpriteStateData2 + $1e ld b,$0f ; The VRAM tile pattern slots that LoadMapSpriteTilePatterns set are in the ; order of the map's sprite set, not the order of the actual sprites loaded @@ -338,7 +338,7 @@ InitOutsideMapSprites: ; 1797b (5:797b) dec b jr nz,.zeroVRAMSlotsLoop .skipLoadingSpriteSet - ld hl,$c110 + ld hl,wSpriteStateData1 + $10 ; This loop stores the correct VRAM tile pattern slots according the sprite ; data from the map's header. Since the VRAM tile pattern slots are filled in ; the order of the sprite set, in order to find the VRAM tile pattern slot diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm new file mode 100644 index 00000000..f08a20cb --- /dev/null +++ b/engine/overworld/movement.asm @@ -0,0 +1,856 @@ +UpdatePlayerSprite: ; 4e31 (1:4e31) + ld a, [wSpriteStateData2] + and a + jr z, .asm_4e41 + cp $ff + jr z, .asm_4e4a + dec a + ld [wSpriteStateData2], a + jr .asm_4e4a +.asm_4e41 + aCoord 8, 9 + ld [$ff93], a + cp $60 + jr c, .asm_4e50 +.asm_4e4a + ld a, $ff + ld [wSpriteStateData1 + 2], a + ret +.asm_4e50 + call Func_4c70 + ld h, $c1 + ld a, [wWalkCounter] ; wcfc5 + and a + jr nz, .asm_4e90 + ld a, [wd528] + bit 2, a + jr z, .asm_4e65 + xor a + jr .asm_4e86 +.asm_4e65 + bit 3, a + jr z, .asm_4e6d + ld a, $4 + jr .asm_4e86 +.asm_4e6d + bit 1, a + jr z, .asm_4e75 + ld a, $8 + jr .asm_4e86 +.asm_4e75 + bit 0, a + jr z, .asm_4e7d + ld a, $c + jr .asm_4e86 +.asm_4e7d + xor a + ld [wSpriteStateData1 + 7], a + ld [wSpriteStateData1 + 8], a + jr .asm_4eab +.asm_4e86 + ld [wSpriteStateData1 + 9], a + ld a, [wcfc4] + bit 0, a + jr nz, .asm_4e7d +.asm_4e90 + ld a, [wd736] + bit 7, a + jr nz, .asm_4eb6 + ld a, [H_CURRENTSPRITEOFFSET] + add $7 + ld l, a + ld a, [hl] + inc a + ld [hl], a + cp $4 + jr nz, .asm_4eab + xor a + ld [hl], a + inc hl + ld a, [hl] + inc a + and $3 + ld [hl], a +.asm_4eab + ld a, [wSpriteStateData1 + 8] + ld b, a + ld a, [wSpriteStateData1 + 9] + add b + ld [wSpriteStateData1 + 2], a +.asm_4eb6 + ld a, [$ff93] + ld c, a + ld a, [W_GRASSTILE] + cp c + ld a, $0 + jr nz, .asm_4ec3 + ld a, $80 +.asm_4ec3 + ld [wSpriteStateData2 + $07], a + ret + +Func_4ec7: ; 4ec7 (1:4ec7) + push bc + push af + ld a, [$ffda] + ld c, a + pop af + add c + ld l, a + pop bc + ret + +Func_4ed1: ; 4ed1 (1:4ed1) + ld a, [H_CURRENTSPRITEOFFSET] + swap a + dec a + add a + ld hl, W_MAPSPRITEDATA ; wd4e4 + add l + ld l, a + ld a, [hl] ; read movement byte 2 + ld [wCurSpriteMovement2], a + ld h, $c1 + ld a, [H_CURRENTSPRITEOFFSET] + ld l, a + inc l + ld a, [hl] ; c1x1 + and a + jp z, InitializeSpriteStatus + call CheckSpriteAvailability + ret c ; if sprite is invisible, on tile >=$60, in grass or player is currently walking + ld h, $c1 + ld a, [H_CURRENTSPRITEOFFSET] + ld l, a + inc l + ld a, [hl] ; c1x1 + bit 7, a + jp nz, InitializeSpriteFacingDirection ; c1x1 >= $80 + ld b, a + ld a, [wcfc4] + bit 0, a + jp nz, notYetMoving + ld a, b + cp $2 + jp z, UpdateSpriteMovementDelay ; c1x1 == 2 + cp $3 + jp z, UpdateSpriteInWalkingAnimation ; c1x1 == 3 + ld a, [wWalkCounter] ; wcfc5 + and a + ret nz ; don't do anything yet if player is currently moving (redundant, already tested in CheckSpriteAvailability) + call InitializeSpriteScreenPosition + ld h, $c2 + ld a, [H_CURRENTSPRITEOFFSET] + add $6 + ld l, a + ld a, [hl] ; c2x6: movement byte 1 + inc a + jr z, .asm_4f59 ; value $FF + inc a + jr z, .asm_4f59 ; value $FE + dec a + ld [hl], a ; (temporarily) increment movement byte 1 + dec a + push hl + ld hl, wcf0f + dec [hl] ; decrement wcf0f + pop hl + ld de, wcc5b + call LoadDEPlusA ; a = [wcc5b + movement byte 1] + cp $e0 + jp z, ChangeFacingDirection + cp $ff + jr nz, .asm_4f4b + ld [hl], a ; reset movement byte 1 to initial value + ld hl, wd730 + res 0, [hl] + xor a + ld [wcd38], a + ld [wcd3a], a + ret +.asm_4f4b + cp $fe + jr nz, .asm_4f5f + ld [hl], $1 ; set movement byte 1 to $1 + ld de, wcc5b + call LoadDEPlusA ; a = [wcc5b + $fe] (?) + jr .asm_4f5f +.asm_4f59 + call getTileSpriteStandsOn + call Random +.asm_4f5f + ld b, a + ld a, [wCurSpriteMovement2] + cp $d0 + jr z, .moveDown ; movement byte 2 = $d0 forces down + cp $d1 + jr z, .moveUp ; movement byte 2 = $d1 forces up + cp $d2 + jr z, .moveLeft ; movement byte 2 = $d2 forces left + cp $d3 + jr z, .moveRight ; movement byte 2 = $d3 forces right + ld a, b + cp $40 ; a < $40: down (or left) + jr nc, .notDown + ld a, [wCurSpriteMovement2] + cp $2 + jr z, .moveLeft ; movement byte 2 = $2 only allows left or right +.moveDown + ld de, 2*20 + add hl, de ; move tile pointer two rows down + ld de, $100 + + ld bc, $400 + jr TryWalking +.notDown + cp $80 ; $40 <= a < $80: up (or right) + jr nc, .notUp + ld a, [wCurSpriteMovement2] + cp $2 + jr z, .moveRight ; movement byte 2 = $2 only allows left or right +.moveUp + ld de, -2*20 ; $ffd8 + add hl, de ; move tile pointer two rows up + ld de, $ff00 + ld bc, $804 + jr TryWalking +.notUp + cp $c0 ; $80 <= a < $c0: left (or up) + jr nc, .notLeft + ld a, [wCurSpriteMovement2] + cp $1 + jr z, .moveUp ; movement byte 2 = $1 only allows up or down +.moveLeft + dec hl + dec hl ; move tile pointer two columns left + ld de, $ff + ld bc, $208 + jr TryWalking +.notLeft ; $c0 <= a: right (or down) + ld a, [wCurSpriteMovement2] + cp $1 + jr z, .moveDown ; movement byte 2 = $1 only allows up or down +.moveRight + inc hl + inc hl ; move tile pointer two columns right + ld de, $1 + ld bc, $10c + jr TryWalking + +; changes facing direction by zeroing the movement delta and calling TryWalking +ChangeFacingDirection: ; 4fc8 (1:4fc8) + ld de, $0 + ; fall through + +; b: direction (1,2,4 or 8) +; c: new facing direction (0,4,8 or $c) +; d: Y movement delta (-1, 0 or 1) +; e: X movement delta (-1, 0 or 1) +; hl: pointer to tile the sprite would wlak onto +; set carry on failure, clears carry on success +TryWalking: ; 4fcb (1:4fcb) + push hl + ld h, $c1 + ld a, [H_CURRENTSPRITEOFFSET] + add $9 + ld l, a + ld [hl], c ; c1x9 (update facing direction) + ld a, [H_CURRENTSPRITEOFFSET] + add $3 + ld l, a + ld [hl], d ; c1x3 (update Y movement delta) + inc l + inc l + ld [hl], e ; c1x5 (update X movement delta) + pop hl + push de + ld c, [hl] ; read tile to walk onto + call CanWalkOntoTile + pop de + ret c ; cannot walk there (reinitialization of delay values already done) + ld h, $c2 + ld a, [H_CURRENTSPRITEOFFSET] + add $4 + ld l, a + ld a, [hl] ; c2x4: Y position + add d + ld [hli], a ; update Y position + ld a, [hl] ; c2x5: X position + add e + ld [hl], a ; update X position + ld a, [H_CURRENTSPRITEOFFSET] + ld l, a + ld [hl], $10 ; c2x0=16: walk animation counter + dec h + inc l + ld [hl], $3 ; c1x1: set movement status to walking + jp UpdateSpriteImage + +; update the walking animation parameters for a sprite that is currently walking +UpdateSpriteInWalkingAnimation: ; 4ffe (1:4ffe) + ld a, [H_CURRENTSPRITEOFFSET] + add $7 + ld l, a + ld a, [hl] ; c1x7 (counter until next walk animation frame) + inc a + ld [hl], a ; c1x7 += 1 + cp $4 + jr nz, .noNextAnimationFrame + xor a + ld [hl], a ; c1x7 = 0 + inc l + ld a, [hl] ; c1x8 (walk animation frame) + inc a + and $3 + ld [hl], a ; advance to next animation frame every 4 ticks (16 ticks total for one step) +.noNextAnimationFrame + ld a, [H_CURRENTSPRITEOFFSET] + add $3 + ld l, a + ld a, [hli] ; c1x3 (movement Y delta) + ld b, a + ld a, [hl] ; c1x4 (screen Y position) + add b + ld [hli], a ; update screen Y position + ld a, [hli] ; c1x5 (movement X delta) + ld b, a + ld a, [hl] ; c1x6 (screen X position) + add b + ld [hl], a ; update screen X position + ld a, [H_CURRENTSPRITEOFFSET] + ld l, a + inc h + ld a, [hl] ; c2x0 (walk animantion counter) + dec a + ld [hl], a ; update walk animantion counter + ret nz + ld a, $6 ; walking finished, update state + add l + ld l, a + ld a, [hl] ; c2x6 (movement byte 1) + cp $fe + jr nc, .initNextMovementCounter ; values $fe and $ff + ld a, [H_CURRENTSPRITEOFFSET] + inc a + ld l, a + dec h + ld [hl], $1 ; c1x1 = 1 (movement status ready) + ret +.initNextMovementCounter + call Random + ld a, [H_CURRENTSPRITEOFFSET] + add $8 + ld l, a + ld a, [hRandomAdd] + and $7f + ld [hl], a ; c2x8: set next movement delay to a random value in [0,$7f] + dec h ; note that value 0 actually makes the delay $100 (bug?) + ld a, [H_CURRENTSPRITEOFFSET] + inc a + ld l, a + ld [hl], $2 ; c1x1 = 2 (movement status) + inc l + inc l + xor a + ld b, [hl] ; c1x3 (movement Y delta) + ld [hli], a ; reset movement Y delta + inc l + ld c, [hl] ; c1x5 (movement X delta) + ld [hl], a ; reset movement X delta + ret + +; update delay value (c2x8) for sprites in the delayed state (c1x1) +UpdateSpriteMovementDelay: ; 5057 (1:5057) + ld h, $c2 + ld a, [H_CURRENTSPRITEOFFSET] + add $6 + ld l, a + ld a, [hl] ; c2x6: movement byte 1 + inc l + inc l + cp $fe + jr nc, .tickMoveCounter ; values $fe or $ff + ld [hl], $0 + jr .moving +.tickMoveCounter + dec [hl] ; c2x8: frame counter until next movement + jr nz, notYetMoving +.moving + dec h + ld a, [H_CURRENTSPRITEOFFSET] + inc a + ld l, a + ld [hl], $1 ; c1x1 = 1 (mark as ready to move) +notYetMoving: ; 5073 (1:5073) + ld h, $c1 + ld a, [H_CURRENTSPRITEOFFSET] + add $8 + ld l, a + ld [hl], $0 ; c1x8 = 0 (walk animation frame) + jp UpdateSpriteImage + +InitializeSpriteFacingDirection: ; 507f (1:507f) + ld a, [wd72d] + bit 5, a + jr nz, notYetMoving + res 7, [hl] + ld a, [wd52a] + bit 3, a + jr z, .notFacingDown + ld c, $0 ; make sprite face down + jr .facingDirectionDetermined +.notFacingDown + bit 2, a + jr z, .notFacingUp + ld c, $4 ; make sprite face up + jr .facingDirectionDetermined +.notFacingUp + bit 1, a + jr z, .notFacingRight + ld c, $c ; make sprite face right + jr .facingDirectionDetermined +.notFacingRight + ld c, $8 ; make sprite face left +.facingDirectionDetermined + ld a, [H_CURRENTSPRITEOFFSET] + add $9 + ld l, a + ld [hl], c ; c1x9: set facing direction + jr notYetMoving + +InitializeSpriteStatus: ; 50ad (1:50ad) + ld [hl], $1 ; $c1x1: set movement status to ready + inc l + ld [hl], $ff ; $c1x2: set sprite image to $ff (invisible/off screen) + inc h + ld a, [H_CURRENTSPRITEOFFSET] + add $2 + ld l, a + ld a, $8 + ld [hli], a ; $c2x2: set Y displacement to 8 + ld [hl], a ; $c2x3: set X displacement to 8 + ret + +; calculates the spprite's scrren position form its map position and the player position +InitializeSpriteScreenPosition: ; 50bd (1:50bd) + ld h, $c2 + ld a, [H_CURRENTSPRITEOFFSET] + add $4 + ld l, a + ld a, [W_YCOORD] ; wd361 + ld b, a + ld a, [hl] ; c2x4 (Y position + 4) + sub b ; relative to player position + swap a ; * 16 + sub $4 ; - 4 + dec h + ld [hli], a ; c1x4 (screen Y position) + inc h + ld a, [W_XCOORD] ; wd362 + ld b, a + ld a, [hli] ; c2x6 (X position + 4) + sub b ; relative to player position + swap a ; * 16 + dec h + ld [hl], a ; c1x6 (screen X position) + ret + +; tests if sprite is off screen or otherwise unable to do anything +CheckSpriteAvailability: ; 50dc (1:50dc) + predef IsObjectHidden + ld a, [$ffe5] + and a + jp nz, .spriteInvisible + ld h, $c2 + ld a, [H_CURRENTSPRITEOFFSET] + add $6 + ld l, a + ld a, [hl] ; c2x6: movement byte 1 + cp $fe + jr c, .skipXVisibilityTest ; movement byte 1 < $fe + ld a, [H_CURRENTSPRITEOFFSET] + add $4 + ld l, a + ld b, [hl] ; c2x4: Y pos (+4) + ld a, [W_YCOORD] ; wd361 + cp b + jr z, .skipYVisibilityTest + jr nc, .spriteInvisible ; above screen region + add $8 ; screen is 9 tiles high + cp b + jr c, .spriteInvisible ; below screen region +.skipYVisibilityTest + inc l + ld b, [hl] ; c2x5: X pos (+4) + ld a, [W_XCOORD] ; wd362 + cp b + jr z, .skipXVisibilityTest + jr nc, .spriteInvisible ; left of screen region + add $9 ; screen is 10 tiles wide + cp b + jr c, .spriteInvisible ; right of screen region +.skipXVisibilityTest + call getTileSpriteStandsOn + ld d, $60 + ld a, [hli] + cp d + jr nc, .spriteInvisible ; standing on tile with ID >=$60 (bottom left tile) + ld a, [hld] + cp d + jr nc, .spriteInvisible ; standing on tile with ID >=$60 (bottom right tile) + ld bc, -20 ; $ffec + add hl, bc ; go back one row of tiles + ld a, [hli] + cp d + jr nc, .spriteInvisible ; standing on tile with ID >=$60 (top left tile) + ld a, [hl] + cp d + jr c, .spriteVisible ; standing on tile with ID >=$60 (top right tile) +.spriteInvisible + ld h, $c1 + ld a, [H_CURRENTSPRITEOFFSET] + add $2 + ld l, a + ld [hl], $ff ; c1x2 + scf + jr .done +.spriteVisible + ld c, a + ld a, [wWalkCounter] ; wcfc5 + and a + jr nz, .done ; if player is currently walking, we're done + call UpdateSpriteImage + inc h + ld a, [H_CURRENTSPRITEOFFSET] + add $7 + ld l, a + ld a, [W_GRASSTILE] + cp c + ld a, $0 + jr nz, .notInGrass + ld a, $80 +.notInGrass + ld [hl], a ; c2x7 + and a +.done + ret + +UpdateSpriteImage: ; 5157 (1:5157) + ld h, $c1 + ld a, [H_CURRENTSPRITEOFFSET] + add $8 + ld l, a + ld a, [hli] ; c1x8: walk animation frame + ld b, a + ld a, [hl] ; c1x9: facing direction + add b + ld b, a + ld a, [$ff93] ; current sprite offset + add b + ld b, a + ld a, [H_CURRENTSPRITEOFFSET] + add $2 + ld l, a + ld [hl], b ; c1x2: sprite to display + ret + +; tests if sprite can walk the specified direction +; b: direction (1,2,4 or 8) +; c: ID of tile the sprite would walk onto +; d: Y movement delta (-1, 0 or 1) +; e: X movement delta (-1, 0 or 1) +; set carry on failure, clears carry on success +CanWalkOntoTile: ; 516e (1:516e) + ld h, $c2 + ld a, [H_CURRENTSPRITEOFFSET] + add $6 + ld l, a + ld a, [hl] ; c2x6 (movement byte 1) + cp $fe + jr nc, .canMove ; values $fe and $ff + and a + ret +.canMove + ld a, [W_TILESETCOLLISIONPTR] + ld l, a + ld a, [W_TILESETCOLLISIONPTR+1] + ld h, a +.tilePassableLoop + ld a, [hli] + cp $ff + jr z, .impassable + cp c + jr nz, .tilePassableLoop + ld h, $c2 + ld a, [H_CURRENTSPRITEOFFSET] + add $6 + ld l, a + ld a, [hl] ; $c2x6 (movement byte 1) + inc a + jr z, .impassable ; if $ff, no movement allowed (however, changing direction is) + ld h, $c1 + ld a, [H_CURRENTSPRITEOFFSET] + add $4 + ld l, a + ld a, [hli] ; c1x4 (screen Y pos) + add $4 ; align to blocks (Y pos is always 4 pixels off) + add d ; add Y delta + cp $80 ; if value is >$80, the destination is off screen (either $81 or $FF underflow) + jr nc, .impassable ; don't walk off screen + inc l + ld a, [hl] ; c1x6 (screen X pos) + add e ; add X delta + cp $90 ; if value is >$90, the destination is off screen (either $91 or $FF underflow) + jr nc, .impassable ; don't walk off screen + push de + push bc + call Func_4c70 + pop bc + pop de + ld h, $c1 + ld a, [H_CURRENTSPRITEOFFSET] + add $c + ld l, a + ld a, [hl] ; c1xc (forbidden directions flags(?)) + and b ; check against chosen direction (1,2,4 or 8) + jr nz, .impassable ; direction forbidden, don't go there + ld h, $c2 + ld a, [H_CURRENTSPRITEOFFSET] + add $2 + ld l, a + ld a, [hli] ; c2x2 (sprite Y displacement, initialized at $8, keep track of where a sprite did go) + bit 7, d ; check if going upwards (d=$ff) + jr nz, .upwards + add d + cp $5 + jr c, .impassable ; if c2x2+d < 5, don't go ;bug: this tests probably were supposed to prevent sprites + jr .checkHorizontal ; from walking out too far, but this line makes sprites get stuck +.upwards ; whenever they walked upwards 5 steps + sub $1 ; on the other hand, the amount a sprite can walk out to the + jr c, .impassable ; if d2x2 == 0, don't go ; right of bottom is not limited (until the counter overflows) +.checkHorizontal + ld d, a + ld a, [hl] ; c2x3 (sprite X displacement, initialized at $8, keep track of where a sprite did go) + bit 7, e ; check if going left (e=$ff) + jr nz, .left + add e + cp $5 ; compare, but no conditional jump like in the vertical check above (bug?) + jr .passable +.left + sub $1 + jr c, .impassable ; if d2x3 == 0, don't go +.passable + ld [hld], a ; update c2x3 + ld [hl], d ; update c2x2 + and a ; clear carry (marking success) + ret +.impassable + ld h, $c1 + ld a, [H_CURRENTSPRITEOFFSET] + inc a + ld l, a + ld [hl], $2 ; c1x1 = 2 (set movement status to delayed) + inc l + inc l + xor a + ld [hli], a ; c1x3 = 0 (clear Y movement delta) + inc l + ld [hl], a ; c1x5 = 0 (clear X movement delta) + inc h + ld a, [H_CURRENTSPRITEOFFSET] + add $8 + ld l, a + call Random + ld a, [hRandomAdd] + and $7f + ld [hl], a ; c2x8: set next movement delay to a random value in [0,$7f] (again with delay $100 if value is 0) + scf ; set carry (marking failure to walk) + ret + +; calculates the tile pointer pointing to the tile the current sprite stancs on +; this is always the lower left tile of the 2x2 tile blocks all sprites are snapped to +; hl: output pointer +getTileSpriteStandsOn: ; 5207 (1:5207) + ld h, $c1 + ld a, [H_CURRENTSPRITEOFFSET] + add $4 + ld l, a + ld a, [hli] ; c1x4: screen Y position + add $4 ; align to 2*2 tile blocks (Y position is always off 4 pixels to the top) + and $f0 ; in case object is currently moving + srl a ; screen Y tile * 4 + ld c, a + ld b, $0 + inc l + ld a, [hl] ; c1x6: screen Y position + srl a + srl a + srl a ; screen X tile + add $14 ; screen X tile + 20 + ld d, $0 + ld e, a + ld hl, wTileMap + add hl, bc + add hl, bc + add hl, bc + add hl, bc + add hl, bc + add hl, de ; wTileMap + 20*(screen Y tile + 1) + screen X tile + ret + +; loads [de+a] into a +LoadDEPlusA: ; 522f (1:522f) + add e + ld e, a + jr nc, .noCarry + inc d +.noCarry + ld a, [de] + ret + +Func_5236: ; 5236 (1:5236) + ld a, [wd730] + bit 7, a + ret z + ld hl, wd72e + bit 7, [hl] + set 7, [hl] + jp z, Func_52a6 + ld hl, wcc97 + ld a, [wcd37] + add l + ld l, a + jr nc, .asm_5251 + inc h +.asm_5251 + ld a, [hl] + cp $40 + jr nz, .asm_525f + call Func_52b2 + ld c, $4 + ld a, $fe + jr .asm_5289 +.asm_525f + cp $0 + jr nz, .asm_526c + call Func_52b2 + ld c, $0 + ld a, $2 + jr .asm_5289 +.asm_526c + cp $80 + jr nz, .asm_5279 + call Func_52b7 + ld c, $8 + ld a, $fe + jr .asm_5289 +.asm_5279 + cp $c0 + jr nz, .asm_5286 + call Func_52b7 + ld c, $c + ld a, $2 + jr .asm_5289 +.asm_5286 + cp $ff + ret +.asm_5289 + ld b, a + ld a, [hl] + add b + ld [hl], a + ld a, [H_CURRENTSPRITEOFFSET] + add $9 + ld l, a + ld a, c + ld [hl], a + call Func_52c3 + ld hl, wcf18 + dec [hl] + ret nz + ld a, $8 + ld [wcf18], a + ld hl, wcd37 + inc [hl] + ret + +Func_52a6: ; 52a6 (1:52a6) + xor a + ld [wcd37], a + ld a, $8 + ld [wcf18], a + jp Func_52c3 + +Func_52b2: ; 52b2 (1:52b2) + ld a, $4 + ld b, a + jr asm_52ba + +Func_52b7: ; 52b7 (1:52b7) + ld a, $6 + ld b, a +asm_52ba: ; 52ba (1:52ba) + ld hl, wSpriteStateData1 + ld a, [H_CURRENTSPRITEOFFSET] + add l + add b + ld l, a + ret + +Func_52c3: ; 52c3 (1:52c3) + ld hl, wSpriteStateData2 + ld a, [H_CURRENTSPRITEOFFSET] + add $e + ld l, a + ld a, [hl] + dec a + swap a + ld b, a + ld hl, wSpriteStateData1 + ld a, [H_CURRENTSPRITEOFFSET] + add $9 + ld l, a + ld a, [hl] + cp $0 + jr z, .asm_52ea + cp $4 + jr z, .asm_52ea + cp $8 + jr z, .asm_52ea + cp $c + jr z, .asm_52ea + ret +.asm_52ea + add b + ld b, a + ld [$ffe9], a + call Func_5301 + ld hl, wSpriteStateData1 + ld a, [H_CURRENTSPRITEOFFSET] + add $2 + ld l, a + ld a, [$ffe9] + ld b, a + ld a, [$ffea] + add b + ld [hl], a + ret + +Func_5301: ; 5301 (1:5301) + ld a, [H_CURRENTSPRITEOFFSET] + add $7 + ld l, a + ld a, [hl] + inc a + ld [hl], a + cp $4 + ret nz + xor a + ld [hl], a + inc l + ld a, [hl] + inc a + and $3 + ld [hl], a + ld [$ffea], a + ret diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm index 54d7321b..2cf6fea9 100755 --- a/engine/overworld/npc_movement.asm +++ b/engine/overworld/npc_movement.asm @@ -1,47 +1,47 @@ Func_1a3e0: ; 1a3e0 (6:63e0) - ld hl, $d730 + ld hl, wd730 res 1, [hl] call HandleDoors jr nc, .asm_1a406 ld a, $fc - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d736 + ld [wJoyIgnore], a + ld hl, wd736 set 1, [hl] ld a, $1 - ld [$cd38], a + ld [wcd38], a ld a, $80 - ld [$ccd3], a + ld [wccd3], a xor a - ld [$c102], a + ld [wSpriteStateData1 + 2], a call Func_3486 ret .asm_1a406 xor a - ld [$cd3a], a - ld [$cd38], a - ld [$ccd3], a - ld hl, $d736 + ld [wcd3a], a + ld [wcd38], a + ld [wccd3], a + ld hl, wd736 res 0, [hl] res 1, [hl] - ld hl, $d730 + ld hl, wd730 res 7, [hl] ret Func_1a41d: ; 1a41d (6:641d) - ld hl, $d730 + ld hl, wd730 res 7, [hl] - ld hl, $d72e + ld hl, wd72e res 7, [hl] - ld hl, $d736 + ld hl, wd736 res 0, [hl] res 1, [hl] xor a - ld [$cf17], a - ld [$cc57], a - ld [$cf10], a - ld [$cd3a], a - ld [$cd38], a - ld [$ccd3], a + ld [wcf17], a + ld [wcc57], a + ld [wcf10], a + ld [wcd3a], a + ld [wcd38], a + ld [wccd3], a ret PointerTable_1a442: ; 1a442 (6:6442) @@ -52,74 +52,73 @@ PointerTable_1a442: ; 1a442 (6:6442) dw Func_1a4f4 Func_1a44c: ; 1a44c (6:644c) - ld a, [W_XCOORD] ; $d362 + ld a, [W_XCOORD] ; wd362 sub $a - ld [$cca1], a + ld [wcca1], a jr z, .asm_1a475 ld b, $0 ld c, a - ld hl, $cc97 + ld hl, wcc97 ld a, $80 call FillMemory ld [hl], $ff - ld a, [$cf13] + ld a, [wcf13] ld [H_DOWNARROWBLINKCNT2], a ; $ff8c - ld de, $cc97 + ld de, wcc97 call MoveSprite ld a, $1 - ld [$cf10], a + ld [wcf10], a jr .asm_1a47a .asm_1a475 ld a, $3 - ld [$cf10], a + ld [wcf10], a .asm_1a47a ld hl, W_FLAGS_D733 set 1, [hl] ld a, $fc - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ret Func_1a485: ; 1a485 (6:6485) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz - ld a, [$cca1] - ld [$cd38], a + ld a, [wcca1] + ld [wcd38], a ld [$ff95], a - ld a, $23 - call Predef + predef Func_f9a0 call Func_3486 ld a, $2 - ld [$cf10], a + ld [wcf10], a ret Func_1a4a1: ; 1a4a1 (6:64a1) - ld a, [$cd38] + ld a, [wcd38] and a ret nz Func_1a4a6: ; 1a4a6 (6:64a6) xor a - ld [$cd3b], a - ld a, [$cf13] + ld [wcd3b], a + ld a, [wcf13] swap a - ld [$cf17], a + ld [wcf17], a xor a - ld [$c206], a - ld hl, $ccd3 + ld [wSpriteStateData2 + $06], a + ld hl, wccd3 ld de, RLEList_1a4e9 call DecodeRLEList dec a - ld [$cd38], a - ld hl, $cc97 + ld [wcd38], a + ld hl, wcc97 ld de, RLEList_1a4dc call DecodeRLEList - ld hl, $d72e + ld hl, wd72e res 7, [hl] - ld hl, $d730 + ld hl, wd730 set 7, [hl] ld a, $4 - ld [$cf10], a + ld [wcf10], a ret RLEList_1a4dc: ; 1a4dc (6:64dc) @@ -140,16 +139,15 @@ RLEList_1a4e9: ; 1a4e9 (6:64e9) db $FF Func_1a4f4: ; 1a4f4 (6:64f4) - ld a, [$cd38] + ld a, [wcd38] and a ret nz ld a, $0 - ld [$cc4d], a - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) - ld hl, $d730 + ld [wcc4d], a + predef HideObject + ld hl, wd730 res 7, [hl] - ld hl, $d72e + ld hl, wd72e res 7, [hl] jp Func_314e @@ -158,32 +156,31 @@ PointerTable_1a510: ; 1a510 (6:6510) dw Func_1a56b Func_1a514: ; 1a514 (6:6514) - ld a, Bank(Func_9876) - ld [$c0ef], a - ld [$c0f0], a + ld a, BANK(Music_MuseumGuy) + ld [wc0ef], a + ld [wc0f0], a ld a, MUSIC_MUSEUM_GUY - ld [$c0ee], a + ld [wc0ee], a call PlaySound - ld a, [$cf13] + ld a, [wcf13] swap a - ld [$cf17], a + ld [wcf17], a call Func_3486 - ld hl, $ccd3 + ld hl, wccd3 ld de, RLEList_PewterMuseumPlayer call DecodeRLEList dec a - ld [$cd38], a + ld [wcd38], a xor a - ld [$d12f], a - ld a, $4f - call Predef - ld hl, $cc97 + ld [wd12f], a + predef PewterGuys + ld hl, wcc97 ld de, RLEList_PewterMuseumGuy call DecodeRLEList - ld hl, $d72e + ld hl, wd72e res 7, [hl] ld a, $1 - ld [$cf10], a + ld [wcf10], a ret RLEList_PewterMuseumPlayer: ; 1a559 (6:6559) @@ -201,12 +198,12 @@ RLEList_PewterMuseumGuy: ; 1a562 (6:6562) db $FF Func_1a56b: ; 1a56b (6:656b) - ld a, [$cd38] + ld a, [wcd38] and a ret nz - ld hl, $d730 + ld hl, wd730 res 7, [hl] - ld hl, $d72e + ld hl, wd72e res 7, [hl] jp Func_314e @@ -215,35 +212,34 @@ PointerTable_1a57d: ; 1a57d (6:657d) dw Func_1a56b Func_1a581: ; 1a581 (6:6581) - ld a, Bank(Func_9876) - ld [$c0ef], a - ld [$c0f0], a + ld a, BANK(Music_MuseumGuy) + ld [wc0ef], a + ld [wc0f0], a ld a, MUSIC_MUSEUM_GUY - ld [$c0ee], a + ld [wc0ee], a call PlaySound - ld a, [$cf13] + ld a, [wcf13] swap a - ld [$cf17], a + ld [wcf17], a xor a - ld [$c206], a - ld hl, $ccd3 + ld [wSpriteStateData2 + $06], a + ld hl, wccd3 ld de, RLEList_PewterGymPlayer call DecodeRLEList dec a - ld [$cd38], a + ld [wcd38], a ld a, $1 - ld [$d12f], a - ld a, $4f - call Predef - ld hl, $cc97 + ld [wd12f], a + predef PewterGuys + ld hl, wcc97 ld de, RLEList_PewterGymGuy call DecodeRLEList - ld hl, $d72e + ld hl, wd72e res 7, [hl] - ld hl, $d730 + ld hl, wd730 set 7, [hl] ld a, $1 - ld [$cf10], a + ld [wcf10], a ret RLEList_PewterGymPlayer: ; 1a5cd (6:65cd) @@ -266,7 +262,7 @@ RLEList_PewterGymGuy: ; 1a5da (6:65da) ; XXX why would this function want to return on POKEMONTOWER_7? Func_1a5e7: ; 1a5e7 (6:65e7) - ld a, [W_CURMAP] ; $d35e + ld a, [W_CURMAP] ; W_CURMAP cp POKEMONTOWER_7 ret z ld hl, RivalIDs ; $6605 @@ -280,7 +276,7 @@ Func_1a5e7: ; 1a5e7 (6:65e7) ret z jr .loop .notRival - ld a, [$cf13] + ld a, [wcf13] ld [H_DOWNARROWBLINKCNT2], a ; $ff8c jp SetSpriteMovementBytesToFF diff --git a/engine/overworld/oaks_aide.asm b/engine/overworld/oaks_aide.asm index ca2c6726..68135287 100755 --- a/engine/overworld/oaks_aide.asm +++ b/engine/overworld/oaks_aide.asm @@ -2,13 +2,13 @@ OaksAideScript ; 0x59035 ld hl, OaksAideHiText call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_59086 ; 0x59042 $42 ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits - ld a, [$d11e] + ld a, [wd11e] ld [$ffdd], a ld b, a ld a, [$ffdb] diff --git a/engine/overworld/oam.asm b/engine/overworld/oam.asm new file mode 100644 index 00000000..63495d22 --- /dev/null +++ b/engine/overworld/oam.asm @@ -0,0 +1,178 @@ +PrepareOAMData: +; Determine OAM data for currently visible +; sprites and write it to wOAMBuffer. + + ld a, [wcfcb] + dec a + jr z, .asm_4b1e + + cp 0 - 1 + ret nz + ld [wcfcb], a + jp HideSprites + +.asm_4b1e + xor a + ld [$ff90], a +.asm_4b21 + ld [$ff8f], a + + ld d, wSpriteStateData1 / $100 + ld a, [$ff8f] + ld e, a + ld a, [de] ; c1x0 + and a + jp z, .asm_4bad + + inc e + inc e + ld a, [de] ; c1x2 (facing/anim) + ld [wd5cd], a + cp $ff ; off-screen (don't draw) + jr nz, .visible + + call Func_4bd1 + jr .asm_4bad + +.visible + cp $a0 + jr c, .usefacing + and $f + add $10 + jr .asm_4b48 + +.usefacing + and $f +.asm_4b48 + ld l, a + + push de + inc d + ld a, e + add $5 + ld e, a + ld a, [de] ; c2x7 + and $80 + ld [$ff94], a ; temp store sprite priority + pop de + + ld h, 0 + ld bc, SpriteFacingAndAnimationTable + add hl, hl + add hl, hl + add hl, bc + + ld a, [hli] + ld c, a + ld a, [hli] + ld b, a + ld a, [hli] + ld h, [hl] + ld l, a + + call Func_4bd1 + + ld a, [$ff90] + ld e, a + ld d, wOAMBuffer / $100 +.tile + ld a, [$ff92] ; temp for sprite Y position + add $10 ; Y=16 is top of screen (Y=0 is invisible) + add [hl] ; add Y offset from table + ld [de], a ; write new sprite OAM Y position + inc hl + ld a, [$ff91] ; temp for sprite X position + add $8 ; X=8 is left of screen (X=0 is invisible) + add [hl] ; add X offset from table + inc e + ld [de], a ; write new sprite OAM X position + inc e + ld a, [bc] ; read pattern number offset (accomodates orientation (offset 0,4 or 8) and animation (offset 0 or $80)) + inc bc + push bc + ld b, a + + ld a, [wd5cd] ; temp copy of c1x2 + swap a ; high nybble determines sprite used (0 is always player sprite, next are some npcs) + and $f + + ; Sprites $a and $b have one face (and therefore 4 tiles instead of 12). + ; As a result, sprite $b's tile offset is less than normal. + cp $b + jr nz, .offset + ld a, $a * 12 + 4 + jr .gotoffset + +.offset + ; a *= 12 + sla a + sla a + ld c, a + sla a + add c +.gotoffset + add b ; which frame + pop bc + ld [de], a ; tile id + inc hl + inc e + ld a, [hl] + bit 1, a ; sprite priority + jr z, .fg + ld a, [$ff94] ; facing priority + or [hl] +.fg + inc hl + ld [de], a + inc e + bit 0, a ; OAMFLAG_ENDOFDATA + jr z, .tile + + ld a, e + ld [$ff90], a + +.asm_4bad + ld a, [$ff8f] + add $10 + cp $100 % $100 + jp nz, .asm_4b21 + + ; Clear unused OAM. + ld a, [$ff90] + ld l, a + ld h, wOAMBuffer / $100 + ld de, $4 + ld b, $a0 + ld a, [wd736] + bit 6, a + ld a, $a0 + jr z, .clear + ld a, $90 +.clear + cp l + ret z + ld [hl], b + add hl, de + jr .clear + +Func_4bd1: ; 4bd1 (1:4bd1) + inc e + inc e + ld a, [de] ; c1x4 + ld [$ff92], a + inc e + inc e + ld a, [de] ; c1x6 + ld [$ff91], a + ld a, $4 + add e + ld e, a + ld a, [$ff92] + add $4 + and $f0 + ld [de], a ; c1xa (y) + inc e + ld a, [$ff91] + and $f0 + ld [de], a ; c1xb (x) + ret diff --git a/engine/overworld/pewter_guys.asm b/engine/overworld/pewter_guys.asm index 7c5779a2..2f3001fb 100755 --- a/engine/overworld/pewter_guys.asm +++ b/engine/overworld/pewter_guys.asm @@ -1,15 +1,15 @@ PewterGuys: ; 37ca1 (d:7ca1) - ld hl, $ccd3 - ld a, [$cd38] + ld hl, wccd3 + ld a, [wcd38] dec a - ld [$cd38], a + ld [wcd38], a ld d, 0 ld e, a add hl, de ld d, h ld e, l ld hl, PointerTable_37ce6 - ld a, [$d12f] + ld a, [wd12f] add a ld b, 0 ld c, a @@ -37,9 +37,9 @@ PewterGuys: ; 37ca1 (d:7ca1) ret z ld [de], a inc de - ld a, [$cd38] + ld a, [wcd38] inc a - ld [$cd38], a + ld [wcd38], a jr .asm_37cd2 .asm_37ce1 inc hl diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index 1af178c7..a0d8175f 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -1,7 +1,7 @@ Func_70510: ; 70510 (1c:4510) call Func_706ef ld a, $ec - ld [$c104], a + ld [wSpriteStateData1 + 4], a call Delay3 push hl call GBFadeIn2 @@ -11,7 +11,7 @@ Func_70510: ; 70510 (1c:4510) jr nz, .asm_70568 ld a, (SFX_02_4c - SFX_Headers_02) / 3 call PlaySound - ld hl, $d732 + ld hl, wd732 bit 4, [hl] res 4, [hl] pop hl @@ -23,7 +23,7 @@ Func_70510: ; 70510 (1c:4510) ld a, b and a jr nz, .asm_7055b - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade xor a ld [hli], a inc a @@ -31,7 +31,7 @@ Func_70510: ; 70510 (1c:4510) ld a, $8 ld [hli], a ld [hl], $ff - ld hl, $cd48 + ld hl, wcd48 call Func_70730 .asm_70558 call Func_2307 @@ -45,13 +45,13 @@ Func_70510: ; 70510 (1c:4510) .asm_70568 pop hl ld de, BirdSprite ; $4d80 - ld hl, $8000 + ld hl, vNPCSprites ld bc, (BANK(BirdSprite) << 8) + $0c call CopyVideoData call Func_706d7 ld a, (SFX_02_50 - SFX_Headers_02) / 3 call PlaySound - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade xor a ld [hli], a ld a, $c @@ -80,7 +80,7 @@ FlyAnimationEnterScreenCoords: ; 70592 (1c:4592) db $3C, $40 Func_705aa: ; 705aa (1c:45aa) - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade ld a, $10 ld [hli], a ld a, $3c @@ -89,7 +89,7 @@ Func_705aa: ; 705aa (1c:45aa) ld [hl], a jp Func_70755 -_DoFlyOrTeleportAwayGraphics: ; 705ba (1c:45ba) +_LeaveMapAnim: ; 705ba (1c:45ba) call Func_706ef call Func_70787 ld a, b @@ -100,7 +100,7 @@ _DoFlyOrTeleportAwayGraphics: ; 705ba (1c:45ba) .asm_705c8 ld a, (SFX_02_4b - SFX_Headers_02) / 3 call PlaySound - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade ld a, $f0 ld [hli], a ld a, $ec @@ -120,10 +120,10 @@ _DoFlyOrTeleportAwayGraphics: ; 705ba (1c:45ba) .asm_705ef ld a, $4 call StopMusic - ld a, [$d732] + ld a, [wd732] bit 6, a jr z, .asm_70610 - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade ld a, $10 ld [hli], a ld a, $ff @@ -131,12 +131,12 @@ _DoFlyOrTeleportAwayGraphics: ; 705ba (1c:45ba) xor a ld [hli], a ld [hl], $a1 - ld hl, $cd48 + ld hl, wcd48 call Func_70730 jr .asm_705c8 .asm_70610 call Func_706d7 - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade ld a, $ff ld [hli], a ld a, $8 @@ -145,7 +145,7 @@ _DoFlyOrTeleportAwayGraphics: ; 705ba (1c:45ba) call Func_706ae ld a, (SFX_02_50 - SFX_Headers_02) / 3 call PlaySound - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade xor a ld [hli], a ld a, $c @@ -155,7 +155,7 @@ _DoFlyOrTeleportAwayGraphics: ; 705ba (1c:45ba) call Func_706ae ld c, $28 call DelayFrames - ld hl, $cd3e + ld hl, wTrainerEngageDistance ld a, $b ld [hli], a ld [hl], $8 @@ -200,34 +200,34 @@ FlyAnimationScreenCoords2: ; 70667 (1c:4667) Func_7067d: ; 7067d (1c:467d) ld a, $ff - ld [$cfcb], a - ld a, [$c302] - ld [$c30a], a - ld a, [$c306] - ld [$c30e], a + ld [wcfcb], a + ld a, [wOAMBuffer + $02] + ld [wOAMBuffer + $0a], a + ld a, [wOAMBuffer + $06] + ld [wOAMBuffer + $0e], a ld a, $a0 ld [wOAMBuffer], a - ld [$c304], a + ld [wOAMBuffer + $04], a ld c, $2 call DelayFrames ld a, $a0 - ld [$c308], a - ld [$c30c], a + ld [wOAMBuffer + $08], a + ld [wOAMBuffer + $0c], a call GBFadeOut2 ld a, $1 - ld [$cfcb], a + ld [wcfcb], a jp Func_70772 Func_706ae: ; 706ae (1c:46ae) - ld a, [$cd3f] + ld a, [wTrainerFacingDirection] xor $1 - ld [$cd3f], a - ld [$c102], a + ld [wTrainerFacingDirection], a + ld [wSpriteStateData1 + 2], a call Delay3 - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade cp $ff jr z, .asm_706cd - ld hl, $c104 + ld hl, wSpriteStateData1 + 4 ld a, [de] inc de ld [hli], a @@ -236,33 +236,33 @@ Func_706ae: ; 706ae (1c:46ae) inc de ld [hl], a .asm_706cd - ld a, [$cd3e] + ld a, [wTrainerEngageDistance] dec a - ld [$cd3e], a + ld [wTrainerEngageDistance], a jr nz, Func_706ae ret Func_706d7: ; 706d7 (1c:46d7) ld de, BirdSprite ; $4d80 - ld hl, $8000 + ld hl, vNPCSprites ld bc, (BANK(BirdSprite) << 8) + $0c call CopyVideoData ld de, BirdSprite + $c0 ; $4e40 ; moving amination sprite - ld hl, $8800 + ld hl, vNPCSprites2 ld bc, (BANK(BirdSprite) << 8) + $0c jp CopyVideoData Func_706ef: ; 706ef (1c:46ef) - ld a, [$c102] - ld [$cd50], a - ld a, [$c104] - ld [$cd4f], a + ld a, [wSpriteStateData1 + 2] + ld [wcd50], a + ld a, [wSpriteStateData1 + 4] + ld [wcd4f], a ld hl, PlayerSpinningFacingOrder ; $4713 - ld de, $cd48 + ld de, wcd48 ld bc, $4 call CopyData - ld a, [$c102] - ld hl, $cd48 + ld a, [wSpriteStateData1 + 2] + ld hl, wcd48 .asm_7070d cp [hl] inc hl @@ -277,32 +277,32 @@ PlayerSpinningFacingOrder: ; 70713 (1c:4713) Func_70717: ; 70717 (1c:4717) ld a, [hl] - ld [$c102], a + ld [wSpriteStateData1 + 2], a push hl - ld hl, $cd48 - ld de, $cd47 + ld hl, wcd48 + ld de, wcd47 ld bc, $4 call CopyData - ld a, [$cd47] - ld [$cd4b], a + ld a, [wcd47] + ld [wcd4b], a pop hl ret Func_70730: ; 70730 (1c:4730) call Func_70717 - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade ld c, a and $3 jr nz, .asm_70743 - ld a, [$cd40] + ld a, [wTrainerScreenY] cp $ff call nz, PlaySound .asm_70743 - ld a, [$cd3e] + ld a, [wTrainerEngageDistance] add c - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ; wWhichTrade ld c, a - ld a, [$cd3f] + ld a, [wTrainerFacingDirection] cp c ret z call DelayFrames @@ -310,29 +310,29 @@ Func_70730: ; 70730 (1c:4730) Func_70755: ; 70755 (1c:4755) call Func_70717 - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade ld c, a - ld a, [$c104] + ld a, [wSpriteStateData1 + 4] add c - ld [$c104], a + ld [wSpriteStateData1 + 4], a ld c, a - ld a, [$cd3e] + ld a, [wTrainerEngageDistance] cp c ret z - ld a, [$cd3f] + ld a, [wTrainerFacingDirection] ld c, a call DelayFrames jr Func_70755 Func_70772: ; 70772 (1c:4772) - ld a, [$cd4f] - ld [$c104], a - ld a, [$cd50] - ld [$c102], a + ld a, [wcd4f] + ld [wSpriteStateData1 + 4], a + ld a, [wcd50] + ld [wSpriteStateData1 + 2], a ret Func_7077f: ; 7077f (1c:477f) - ld a, [$cf1b] + ld a, [wcf1b] xor $1 inc a inc a @@ -341,7 +341,7 @@ Func_7077f: ; 7077f (1c:477f) Func_70787: ; 70787 (1c:4787) ld b, 0 ld hl, DataTable_707a9 ; $47a9 - ld a, [W_CURMAPTILESET] ; $d367 + ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET ld c, a .asm_70790 ld a, [hli] @@ -349,8 +349,7 @@ Func_70787: ; 70787 (1c:4787) jr z, .asm_707a4 cp c jr nz, .asm_7079e - FuncCoord 8, 9 ; $c45c - ld a, [Coord] + aCoord 8, 9 cp [hl] jr z, .asm_707a2 .asm_7079e @@ -362,10 +361,10 @@ Func_70787: ; 70787 (1c:4787) ld b, [hl] .asm_707a4 ld a, b - ld [$cd5b], a + ld [wcd5b], a ret -; format: db tileset id, tile id, value to be put in $cd5b +; format: db tileset id, tile id, value to be put in wcd5b DataTable_707a9: ; 707a9 (1c:47a9) db FACILITY, $20, 1 ; warp pad db FACILITY, $11, 2 ; hole @@ -376,26 +375,26 @@ DataTable_707a9: ; 707a9 (1c:47a9) Func_707b6: ; 707b6 (1c:47b6) ld c, $a call DelayFrames - ld hl, $d736 + ld hl, wd736 set 6, [hl] ld de, RedSprite ; $4180 - ld hl, $8000 + ld hl, vNPCSprites ld bc, (BANK(RedSprite) << 8) + $0c call CopyVideoData ld a, $4 ld hl, RedFishingTiles ; $4866 call Func_71771 - ld a, [$c102] + ld a, [wSpriteStateData1 + 2] ld c, a ld b, $0 ld hl, FishingRodGfxProperties ; $4856 add hl, bc - ld de, $c39c + ld de, wOAMBuffer + $9c ld bc, $4 call CopyData ld c, $64 call DelayFrames - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade and a ld hl, NoNibbleText jr z, .asm_70836 @@ -404,35 +403,34 @@ Func_707b6: ; 707b6 (1c:47b6) jr z, .asm_70836 ld b, $a .asm_707fe - ld hl, $c104 + ld hl, wSpriteStateData1 + 4 call Func_70842 - ld hl, $c39c + ld hl, wOAMBuffer + $9c call Func_70842 call Delay3 dec b jr nz, .asm_707fe - ld a, [$c102] + ld a, [wSpriteStateData1 + 2] cp $4 jr nz, .asm_7081c ld a, $a0 - ld [$c39c], a + ld [wOAMBuffer + $9c], a .asm_7081c - ld hl, $cd4f + ld hl, wcd4f xor a ld [hli], a ld [hl], a - ld a, $4c - call Predef ; indirect jump to PrintEmotionBubble (17c47 (5:7c47)) - ld a, [$c102] + predef EmotionBubble + ld a, [wSpriteStateData1 + 2] cp $4 jr nz, .asm_70833 ld a, $44 - ld [$c39c], a + ld [wOAMBuffer + $9c], a .asm_70833 ld hl, ItsABiteText .asm_70836 call PrintText - ld hl, $d736 + ld hl, wd736 res 6, [hl] call LoadFontTilePatterns ret @@ -468,51 +466,51 @@ FishingRodGfxProperties: ; 70856 (1c:4856) RedFishingTiles: ; 70866 (1c:4866) dw RedFishingTilesFront - db $02, $1E - dw $8020 + db 2, BANK(RedFishingTilesFront) + dw vNPCSprites + $20 dw RedFishingTilesBack - db $02, $1E - dw $8060 + db 2, BANK(RedFishingTilesBack) + dw vNPCSprites + $60 dw RedFishingTilesSide - db $02, $1E - dw $80A0 + db 2, BANK(RedFishingTilesSide) + dw vNPCSprites + $a0 dw RedFishingRodTiles - db $03, $1E - dw $8FD0 + db 3, BANK(RedFishingRodTiles) + dw vNPCSprites2 + $7d0 _HandleMidJump: ; 7087e (1c:487e) - ld a, [$d714] + ld a, [wd714] ld c, a inc a cp $10 jr nc, .asm_70895 - ld [$d714], a + ld [wd714], a ld b, $0 ld hl, PlayerJumpingYScreenCoords ; $48ba add hl, bc ld a, [hl] - ld [$c104], a ; player's sprite y coordinate + ld [wSpriteStateData1 + 4], a ; player's sprite y coordinate ret .asm_70895 - ld a, [wWalkCounter] ; $cfc5 + ld a, [wWalkCounter] ; wcfc5 cp $0 ret nz call UpdateSprites call Delay3 xor a - ld [H_CURRENTPRESSEDBUTTONS], a - ld [H_NEWLYPRESSEDBUTTONS], a - ld [H_NEWLYRELEASEDBUTTONS], a - ld [$d714], a - ld hl, $d736 + ld [hJoyHeld], a + ld [hJoyPressed], a + ld [hJoyReleased], a + ld [wd714], a + ld hl, wd736 res 6, [hl] - ld hl, $d730 + ld hl, wd730 res 7, [hl] xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ret PlayerJumpingYScreenCoords: ; 708ba (1c:48ba) diff --git a/engine/overworld/pokecenter.asm b/engine/overworld/pokecenter.asm index 45599498..3c640d8e 100755 --- a/engine/overworld/pokecenter.asm +++ b/engine/overworld/pokecenter.asm @@ -2,7 +2,7 @@ DisplayPokemonCenterDialogue_: ; 6fe6 (1:6fe6) call SaveScreenTilesToBuffer1 ; save screen ld hl, PokemonCenterWelcomeText call PrintText - ld hl, $d72e + ld hl, wd72e bit 2, [hl] set 1, [hl] set 2, [hl] @@ -19,22 +19,22 @@ DisplayPokemonCenterDialogue_: ; 6fe6 (1:6fe6) ld hl, NeedYourPokemonText call PrintText ld a, $18 - ld [$c112], a ; make the nurse turn to face the machine + ld [wSpriteStateData1 + $12], a ; make the nurse turn to face the machine call Delay3 - PREDEF HealPartyPredef + predef HealParty callba AnimateHealingMachine ; do the healing machine animation xor a ld [wMusicHeaderPointer], a - ld a, [$c0f0] - ld [$c0ef], a - ld a, [$d35b] - ld [$cfca], a - ld [$c0ee], a + ld a, [wc0f0] + ld [wc0ef], a + ld a, [wd35b] + ld [wcfca], a + ld [wc0ee], a call PlaySound ld hl, PokemonFightingFitText call PrintText ld a, $14 - ld [$c112], a ; make the nurse bow + ld [wSpriteStateData1 + $12], a ; make the nurse bow ld c, a call DelayFrames jr .done diff --git a/engine/overworld/pokemart.asm b/engine/overworld/pokemart.asm index 6e6f5ee2..3b06bd2c 100755 --- a/engine/overworld/pokemart.asm +++ b/engine/overworld/pokemart.asm @@ -1,30 +1,30 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) ld a,[wListScrollOffset] - ld [$d07e],a + ld [wd07e],a call UpdateSprites ; move sprites xor a - ld [$cf0a],a ; flag that is set if something is sold or bought + ld [wcf0a],a ; flag that is set if something is sold or bought .loop xor a ld [wListScrollOffset],a ld [wCurrentMenuItem],a - ld [$cc2f],a + ld [wPlayerMonNumber],a inc a - ld [$cf93],a + ld [wcf93],a ld a,$13 - ld [$d125],a + ld [wd125],a call DisplayTextBoxID ; draw money text box ld a,$15 - ld [$d125],a + ld [wd125],a call DisplayTextBoxID ; do buy/sell/quit menu - ld hl,$d128 ; pointer to this pokemart's inventory + ld hl,wd128 ; pointer to this pokemart's inventory ld a,[hli] ld l,[hl] ld h,a ; hl = address of inventory - ld a,[$d12e] + ld a,[wd12e] cp a,$02 jp z,.done - ld a,[$d12d] ; ID of the chosen menu item + ld a,[wd12d] ; ID of the chosen menu item and a ; buying? jp z,.buyMenu dec a ; selling? @@ -33,9 +33,9 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) jp z,.done .sellMenu xor a - ld [$cf93],a + ld [wcf93],a ld a,$02 - ld [$d11b],a + ld [wd11b],a callab Func_39bd5 ld a,[wNumBagItems] and a @@ -46,15 +46,15 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) .sellMenuLoop call LoadScreenTilesFromBuffer1 ; restore saved screen ld a,$13 - ld [$d125],a + ld [wd125],a call DisplayTextBoxID ; draw money text box ld hl,wNumBagItems ld a,l - ld [$cf8b],a + ld [wcf8b],a ld a,h - ld [$cf8c],a + ld [wcf8c],a xor a - ld [$cf93],a + ld [wcf93],a ld [wCurrentMenuItem],a ld a,ITEMLISTMENU ld [wListMenuID],a @@ -62,10 +62,10 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) jp c,.returnToMainPokemartMenu ; if the player closed the menu .confirmItemSale ; if the player is trying to sell a specific item call IsKeyItem ; check if item is unsellable - ld a,[$d124] + ld a,[wd124] and a jr nz,.unsellableItem - ld a,[$cf91] + ld a,[wcf91] call IsItemHM jr c,.unsellableItem ld a,PRICEDITEMLISTMENU @@ -77,24 +77,23 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) ld hl,PokemartTellSellPriceText ld bc,$0e01 call PrintText - FuncCoord 14,7 - ld hl,Coord + hlCoord 14, 7 ld bc,$080f ld a,$14 - ld [$d125],a + ld [wd125],a call DisplayTextBoxID ; yes/no menu - ld a,[$d12e] + ld a,[wd12e] cp a,$02 jr z,.sellMenuLoop ; if the player pressed the B button - ld a,[$d12d] ; ID of the chosen menu item + ld a,[wd12d] ; ID of the chosen menu item dec a jr z,.sellMenuLoop ; if the player chose No .sellItem - ld a,[$cf0a] ; flag that is set if something is sold or bought + ld a,[wcf0a] ; flag that is set if something is sold or bought and a jr nz,.skipSettingFlag1 inc a - ld [$cf0a],a + ld [wcf0a],a .skipSettingFlag1 call AddAmountSoldToMoney ld hl,wNumBagItems @@ -111,9 +110,9 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) jp .returnToMainPokemartMenu .buyMenu ld a,$01 - ld [$cf93],a + ld [wcf93],a ld a,$03 - ld [$d11b],a + ld [wd11b],a callab Func_39bd5 ld hl,PokemartBuyingGreetingText call PrintText @@ -121,44 +120,43 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) .buyMenuLoop call LoadScreenTilesFromBuffer1 ; restore saved screen ld a,$13 - ld [$d125],a + ld [wd125],a call DisplayTextBoxID ; draw money text box - ld hl,$cf7b + ld hl,wStringBuffer2 + 11 ld a,l - ld [$cf8b],a + ld [wcf8b],a ld a,h - ld [$cf8c],a + ld [wcf8c],a xor a ld [wCurrentMenuItem],a inc a - ld [$cf93],a + ld [wcf93],a inc a ; a = 2 (PRICEDITEMLISTMENU) ld [wListMenuID],a call DisplayListMenuID jr c,.returnToMainPokemartMenu ; if the player closed the menu ld a,$63 - ld [$cf97],a + ld [wcf97],a xor a ld [$ff8e],a call DisplayChooseQuantityMenu inc a jr z,.buyMenuLoop ; if the player closed the choose quantity menu with the B button - ld a,[$cf91] ; item ID - ld [$d11e],a ; store item ID for GetItemName + ld a,[wcf91] ; item ID + ld [wd11e],a ; store item ID for GetItemName call GetItemName - call CopyStringToCF4B ; copy name to $cf4b + call CopyStringToCF4B ; copy name to wcf4b ld hl,PokemartTellBuyPriceText call PrintText - FuncCoord 14,7 - ld hl,Coord + hlCoord 14, 7 ld bc,$080f ld a,$14 - ld [$d125],a + ld [wd125],a call DisplayTextBoxID ; yes/no menu - ld a,[$d12e] + ld a,[wd12e] cp a,$02 jp z,.buyMenuLoop ; if the player pressed the B button - ld a,[$d12d] ; ID of the chosen menu item + ld a,[wd12d] ; ID of the chosen menu item dec a jr z,.buyMenuLoop ; if the player chose No .buyItem @@ -168,11 +166,11 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) call AddItemToInventory jr nc,.bagFull call SubtractAmountPaidFromMoney - ld a,[$cf0a] ; flag that is set if something is sold or bought + ld a,[wcf0a] ; flag that is set if something is sold or bought and a jr nz,.skipSettingFlag2 ld a,$01 - ld [$cf0a],a + ld [wcf0a],a .skipSettingFlag2 ld a,(SFX_02_5a - SFX_Headers_02) / 3 call PlaySoundWaitForCurrent ; play sound @@ -183,7 +181,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) .returnToMainPokemartMenu call LoadScreenTilesFromBuffer1 ; restore save screen ld a,$13 - ld [$d125],a + ld [wd125],a call DisplayTextBoxID ; draw money text box ld hl,PokemartAnythingElseText call PrintText @@ -205,9 +203,9 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) ld hl,PokemartThankYouText call PrintText ld a,$01 - ld [$cfcb],a + ld [wcfcb],a call UpdateSprites ; move sprites - ld a,[$d07e] + ld a,[wd07e] ld [wListScrollOffset],a ret diff --git a/engine/overworld/ssanne.asm b/engine/overworld/ssanne.asm index e8060810..8fd8f99a 100755 --- a/engine/overworld/ssanne.asm +++ b/engine/overworld/ssanne.asm @@ -1,10 +1,10 @@ Func_79f54: ; 79f54 (1e:5f54) ld a, $1 - ld [$cd50], a - ld a, [$cfcb] + ld [wcd50], a + ld a, [wcfcb] push af ld a, $ff - ld [$cfcb], a + ld [wcfcb], a ld a, $e4 ld [rOBP1], a ; $ff49 call LoadSmokeTileFourTimes @@ -26,24 +26,24 @@ Func_79f54: ; 79f54 (1e:5f54) dec c jr nz, .asm_79f73 pop af - ld [$cfcb], a + ld [wcfcb], a jp LoadPlayerSpriteGraphics Func_79f92: ; 79f92 (1e:5f92) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] ld hl, PointerTable_79fb0 ; $5fb0 ld c, a ld b, $0 add hl, bc ld a, [hli] - ld [$d08a], a + ld [wd08a], a ld a, [hli] ld e, a ld a, [hli] ld h, [hl] ld l, a push hl - ld hl, $c390 + ld hl, wOAMBuffer + $90 ld d, $0 add hl, de ld e, l @@ -65,7 +65,7 @@ PointerTable_79fb0: ; 79fb0 (1e:5fb0) dw Func_79337 LoadSmokeTileFourTimes: ; 79fc0 (1e:5fc0) - ld hl, $8fc0 + ld hl, vChars1 + $7c0 ld c, $4 .loop push bc diff --git a/engine/overworld/trainers.asm b/engine/overworld/trainers.asm index 8968332a..b05ddbf1 100755 --- a/engine/overworld/trainers.asm +++ b/engine/overworld/trainers.asm @@ -1,7 +1,7 @@ Func_567f9: ; 567f9 (15:67f9) ld hl, wSpriteStateData1 ld de, $4 - ld a, [$cf13] + ld a, [wcf13] ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call Func_56903 ld a, [hli] @@ -20,26 +20,26 @@ Func_567f9: ; 567f9 (15:67f9) Func_56819: ; 56819 (15:6819) ld hl, wSpriteStateData1 ld de, $0004 - ld a, [$cf13] + ld a, [wcf13] ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call Func_56903 ld a, [hli] - ld [$d130], a + ld [wd130], a inc hl ld a, [hl] - ld [$d131], a + ld [wd131], a ld de, $00fe add hl, de ld a, [hli] - ld [$d132], a + ld [wd132], a ld a, [hl] - ld [$d133], a + ld [wd133], a ret Func_5683d: ; 5683d (15:683d) ld hl, wSpriteStateData1 ld de, $4 - ld a, [$cf13] + ld a, [wcf13] ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call Func_56903 ld a, [$ffeb] @@ -58,26 +58,26 @@ Func_5683d: ; 5683d (15:683d) Func_5685d: ; 5685d (15:685d) ld hl, wSpriteStateData1 ld de, $0004 - ld a, [$cf13] + ld a, [wcf13] ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call Func_56903 - ld a, [$d130] + ld a, [wd130] ld [hli], a inc hl - ld a, [$d131] + ld a, [wd131] ld [hl], a ld de, $00fe add hl, de - ld a, [$d132] + ld a, [wd132] ld [hli], a - ld a, [$d133] + ld a, [wd133] ld [hl], a ret TrainerWalkUpToPlayer: ; 56881 (15:6881) - ld a, [$cf13] + ld a, [wcf13] swap a - ld [wTrainerSpriteOffset], a ; $cd3d + ld [wTrainerSpriteOffset], a ; wWhichTrade call ReadTrainerScreenPosition ld a, [wTrainerFacingDirection] and a @@ -127,7 +127,7 @@ TrainerWalkUpToPlayer: ; 56881 (15:6881) ld a, $c0 ; a = direction to go to jr .writeWalkScript .facingLeft - ld a, [$cd41] + ld a, [wTrainerScreenX] ld b, a ld a, $40 ; (fixed) player screen X pos call CalcDifference @@ -139,11 +139,11 @@ TrainerWalkUpToPlayer: ; 56881 (15:6881) ld b, $0 ld a, $80 ; a = direction to go to .writeWalkScript - ld hl, $cc97 - ld de, $cc97 + ld hl, wcc97 + ld de, wcc97 call FillMemory ; write the necessary steps to reach player ld [hl], $ff ; write end of list sentinel - ld a, [$cf13] + ld a, [wcf13] ld [H_DOWNARROWBLINKCNT2], a ; $ff8c jp MoveSprite_ @@ -159,10 +159,10 @@ Func_56903: ; 56903 (15:6903) ret ; tests if this trainer is in the right position to engage the player and do so if she is. -CheckEngagePlayer: ; 5690f (15:690f) +TrainerEngage: ; 5690f (15:690f) push hl push de - ld a, [wTrainerSpriteOffset] ; $cd3d + ld a, [wTrainerSpriteOffset] ; wWhichTrade add $2 ld d, $0 ld e, a @@ -173,21 +173,21 @@ CheckEngagePlayer: ; 5690f (15:690f) jr nz, .spriteOnScreen ; test if sprite is on screen jp .noEngage .spriteOnScreen - ld a, [wTrainerSpriteOffset] ; $cd3d + ld a, [wTrainerSpriteOffset] ; wWhichTrade add $9 ld d, $0 ld e, a ld hl, wSpriteStateData1 add hl, de ld a, [hl] ; c1x9: facing direction - ld [$cd3f], a + ld [wTrainerFacingDirection], a call ReadTrainerScreenPosition - ld a, [$cd40] ; sprite screen Y pos + ld a, [wTrainerScreenY] ; sprite screen Y pos ld b, a ld a, $3c cp b jr z, .linedUpY - ld a, [$cd41] ; sprite screen X pos + ld a, [wTrainerScreenX] ; sprite screen X pos ld b, a ld a, $40 cp b @@ -195,7 +195,7 @@ CheckEngagePlayer: ; 5690f (15:690f) xor a jp .noEngage .linedUpY - ld a, [$cd41] ; sprite screen X pos + ld a, [wTrainerScreenX] ; sprite screen X pos ld b, a ld a, $40 ; (fixed) player X position call CalcDifference ; calc distance @@ -205,7 +205,7 @@ CheckEngagePlayer: ; 5690f (15:690f) xor a jr .noEngage .linedUpX - ld a, [$cd40] ; sprite screen Y pos + ld a, [wTrainerScreenY] ; sprite screen Y pos ld b, a ld a, $3c ; (fixed) player Y position call CalcDifference ; calc distance @@ -216,7 +216,7 @@ CheckEngagePlayer: ; 5690f (15:690f) jp .noEngage .engage call CheckPlayerIsInFrontOfSprite - ld a, [wTrainerSpriteOffset] ; $cd3d + ld a, [wTrainerSpriteOffset] ; wWhichTrade and a jr z, .noEngage ld hl, wFlags_0xcd60 @@ -224,29 +224,29 @@ CheckEngagePlayer: ; 5690f (15:690f) call EngageMapTrainer ld a, $ff .noEngage: ; 56988 (15:6988) - ld [wTrainerSpriteOffset], a ; $cd3d + ld [wTrainerSpriteOffset], a ; wWhichTrade pop de pop hl ret -; reads trainer's Y position to $cd40 and X position to $cd41 +; reads trainer's Y position to wTrainerScreenY and X position to wTrainerScreenX ReadTrainerScreenPosition: ; 5698e (15:698e) - ld a, [wTrainerSpriteOffset] ; $cd3d + ld a, [wTrainerSpriteOffset] ; wWhichTrade add $4 ld d, $0 ld e, a ld hl, wSpriteStateData1 add hl, de ld a, [hl] - ld [$cd40], a - ld a, [wTrainerSpriteOffset] ; $cd3d + ld [wTrainerScreenY], a + ld a, [wTrainerSpriteOffset] ; wWhichTrade add $6 ld d, $0 ld e, a ld hl, wSpriteStateData1 add hl, de ld a, [hl] - ld [$cd41], a + ld [wTrainerScreenX], a ret ; checks if the sprite is properly lined up with the player with respect to the direction it's looking. Also checks the distance between player and sprite @@ -259,7 +259,7 @@ CheckSpriteCanSeePlayer: ; 569af (15:69af) jr nc, .checkIfLinedUp jr .notInLine ; player too far away .checkIfLinedUp - ld a, [$cd3f] ; sprite facing direction + ld a, [wTrainerFacingDirection] ; sprite facing direction cp $0 ; down jr z, .checkXCoord cp $4 ; up @@ -270,13 +270,13 @@ CheckSpriteCanSeePlayer: ; 569af (15:69af) jr z, .checkYCoord jr .notInLine .checkXCoord - ld a, [$cd41] ; sprite screen X position + ld a, [wTrainerScreenX] ; sprite screen X position ld b, a cp $40 jr z, .inLine jr .notInLine .checkYCoord - ld a, [$cd40] ; sprite screen Y position + ld a, [wTrainerScreenY] ; sprite screen Y position ld b, a cp $3c jr nz, .notInLine @@ -289,10 +289,10 @@ CheckSpriteCanSeePlayer: ; 569af (15:69af) ; tests if the player is in front of the sprite (rather than behind it) CheckPlayerIsInFrontOfSprite: ; 569e3 (15:69e3) - ld a, [W_CURMAP] ; $d35e + ld a, [W_CURMAP] ; W_CURMAP cp POWER_PLANT jp z, .engage ; XXX not sure why bypass this for power plant (maybe to get voltorb fake items to work?) - ld a, [wTrainerSpriteOffset] ; $cd3d + ld a, [wTrainerSpriteOffset] ; wWhichTrade add $4 ld d, $0 ld e, a @@ -303,38 +303,38 @@ CheckPlayerIsInFrontOfSprite: ; 569e3 (15:69e3) jr nz, .notOnTopmostTile ; special case if sprite is on topmost tile (Y = $fc (-4)), make it come down a block ld a, $c .notOnTopmostTile - ld [$cd40], a - ld a, [wTrainerSpriteOffset] ; $cd3d + ld [wTrainerScreenY], a + ld a, [wTrainerSpriteOffset] ; wWhichTrade add $6 ld d, $0 ld e, a ld hl, wSpriteStateData1 add hl, de ld a, [hl] ; c1x6 (sprite screen X pos) - ld [$cd41], a - ld a, [$cd3f] ; facing direction + ld [wTrainerScreenX], a + ld a, [wTrainerFacingDirection] ; facing direction cp $0 jr nz, .notFacingDown - ld a, [$cd40] ; sprite screen Y pos + ld a, [wTrainerScreenY] ; sprite screen Y pos cp $3c jr c, .engage ; sprite above player jr .noEngage ; sprite below player .notFacingDown cp $4 jr nz, .notFacingUp - ld a, [$cd40] ; sprite screen Y pos + ld a, [wTrainerScreenY] ; sprite screen Y pos cp $3c jr nc, .engage ; sprite below player jr .noEngage ; sprite above player .notFacingUp cp $8 jr nz, .notFacingLeft - ld a, [$cd41] ; sprite screen X pos + ld a, [wTrainerScreenX] ; sprite screen X pos cp $40 jr nc, .engage ; sprite right of player jr .noEngage ; sprite left of player .notFacingLeft - ld a, [$cd41] ; sprite screen X pos + ld a, [wTrainerScreenX] ; sprite screen X pos cp $40 jr nc, .noEngage ; sprite right of player .engage @@ -343,5 +343,5 @@ CheckPlayerIsInFrontOfSprite: ; 569e3 (15:69e3) .noEngage xor a .done - ld [wTrainerSpriteOffset], a ; $cd3d + ld [wTrainerSpriteOffset], a ; wWhichTrade ret diff --git a/engine/palettes.asm b/engine/palettes.asm index 71f01a97..eafd8ef6 100755 --- a/engine/palettes.asm +++ b/engine/palettes.asm @@ -1,9 +1,9 @@ Func_71ddf: ; 71ddf (1c:5ddf) - call Load16BitRegisters + call GetPredefRegisters ld a, b cp $ff jr nz, .asm_71dea - ld a, [$cf1c] + ld a, [wcf1c] .asm_71dea cp $fc jp z, Func_71fc2 @@ -27,23 +27,23 @@ SendPalPacket_Black: ; 71dff (1c:5dff) ; uses PalPacket_Empty to build a packet based on mon IDs and health color BuildBattlePalPacket: ; 71e06 (1c:5e06) ld hl, PalPacket_Empty - ld de, $cf2d + ld de, wcf2d ld bc, $10 call CopyData ld a, [W_PLAYERBATTSTATUS3] - ld hl, W_PLAYERMONID + ld hl, wBattleMonSpecies call DeterminePaletteID ld b, a ld a, [W_ENEMYBATTSTATUS3] - ld hl, W_ENEMYMONID + ld hl, wEnemyMonSpecies2 call DeterminePaletteID ld c, a - ld hl, $cf2e - ld a, [$cf1d] + ld hl, wcf2e + ld a, [wcf1d] add PAL_GREENBAR ld [hli], a inc hl - ld a, [$cf1e] + ld a, [wcf1e] add PAL_GREENBAR ld [hli], a inc hl @@ -52,10 +52,10 @@ BuildBattlePalPacket: ; 71e06 (1c:5e06) inc hl ld a, c ld [hl], a - ld hl, $cf2d + ld hl, wcf2d ld de, BlkPacket_Battle ld a, $1 - ld [$cf1c], a + ld [wcf1c], a ret SendPalPacket_TownMap: ; 71e48 (1c:5e48) @@ -66,42 +66,42 @@ SendPalPacket_TownMap: ; 71e48 (1c:5e48) ; uses PalPacket_Empty to build a packet based the mon ID BuildStatusScreenPalPacket: ; 71e4f (1c:5e4f) ld hl, PalPacket_Empty - ld de, $cf2d + ld de, wcf2d ld bc, $10 call CopyData - ld a, [$cf91] + ld a, [wcf91] cp VICTREEBEL + 1 jr c, .pokemon ld a, $1 ; not pokemon .pokemon call DeterminePaletteIDOutOfBattle push af - ld hl, $cf2e - ld a, [$cf25] + ld hl, wcf2e + ld a, [wcf25] add $1f ld [hli], a inc hl pop af ld [hl], a - ld hl, $cf2d + ld hl, wcf2d ld de, BlkPacket_StatusScreen ret SendPalPacket_PartyMenu: ; 71e7b (1c:5e7b) ld hl, PalPacket_PartyMenu - ld de, $cf2e + ld de, wcf2e ret SendPalPacket_Pokedex: ; 71e82 (1c:5e82) ld hl, PalPacket_Pokedex - ld de, $cf2d + ld de, wcf2d ld bc, $10 call CopyData - ld a, [$cf91] + ld a, [wcf91] call DeterminePaletteIDOutOfBattle - ld hl, $cf30 + ld hl, wcf30 ld [hl], a - ld hl, $cf2d + ld hl, wcf2d ld de, BlkPacket_Pokedex ret @@ -130,13 +130,13 @@ SendPalPacket_GameFreakIntro: ; 71ebb (1c:5ebb) ld hl, PalPacket_GameFreakIntro ld de, BlkPacket_GameFreakIntro ld a, $8 - ld [$cf1c], a + ld [wcf1c], a ret ; uses PalPacket_Empty to build a packet based on the current map BuildOverworldPalPacket: ; 71ec7 (1c:5ec7) ld hl, PalPacket_Empty - ld de, $cf2d + ld de, wcf2d ld bc, $10 call CopyData ld a, [W_CURMAPTILESET] @@ -163,11 +163,11 @@ BuildOverworldPalPacket: ; 71ec7 (1c:5ec7) ld a, PAL_ROUTE - 1 .town inc a ; a town's pallete ID is its map ID + 1 - ld hl, $cf2e + ld hl, wcf2e ld [hld], a ld de, BlkPacket_WholeScreen ld a, $9 - ld [$cf1c], a + ld [wcf1c], a ret .PokemonTowerOrAgatha ld a, PAL_GREYMON - 1 @@ -184,7 +184,7 @@ BuildOverworldPalPacket: ; 71ec7 (1c:5ec7) SendPokemonPalette_WholeScreen: ; 71f17 (1c:5f17) push bc ld hl, PalPacket_Empty - ld de, $cf2d + ld de, wcf2d ld bc, $10 call CopyData pop bc @@ -192,21 +192,21 @@ SendPokemonPalette_WholeScreen: ; 71f17 (1c:5f17) and a ld a, $1e jr nz, .asm_71f31 - ld a, [$cf1d] + ld a, [wcf1d] call DeterminePaletteIDOutOfBattle .asm_71f31 - ld [$cf2e], a - ld hl, $cf2d + ld [wcf2e], a + ld hl, wcf2d ld de, BlkPacket_WholeScreen ret BuildTrainerCardPalPacket: ; 71f3b (1c:5f3b) ld hl, BlkPacket_TrainerCard - ld de, $cc5b + ld de, wcc5b ld bc, $40 call CopyData ld de, LoopCounts_71f8f - ld hl, $cc5d + ld hl, wcc5d ld a, [W_OBTAINEDBADGES] ld c, $8 .asm_71f52 @@ -235,7 +235,7 @@ BuildTrainerCardPalPacket: ; 71f3b (1c:5f3b) dec c jr nz, .asm_71f52 ld hl, PalPacket_TrainerCard - ld de, $cc5b + ld de, wcc5b ret PointerTable_71f73: ; 71f73 (1c:5f73) @@ -264,14 +264,13 @@ DeterminePaletteID: ; 71f97 (1c:5f97) ret nz ld a, [hl] DeterminePaletteIDOutOfBattle: ; 71f9d (1c:5f9d) - ld [$D11E], a + ld [wd11e], a and a jr z, .idZero push bc - ld a, $3A - call Predef ; turn Pokemon ID number into Pokedex number + predef IndexToPokedex ; turn Pokemon ID number into Pokedex number pop bc - ld a, [$D11E] + ld a, [wd11e] .idZero ld e, a ld d, $00 @@ -282,13 +281,13 @@ DeterminePaletteIDOutOfBattle: ; 71f9d (1c:5f9d) SendBlkPacket_PartyMenu: ; 71fb6 (1c:5fb6) ld hl, BlkPacket_PartyMenu ; $62f4 - ld de, $cf2e + ld de, wcf2e ld bc, $30 jp CopyData Func_71fc2: ; 71fc2 (1c:5fc2) - ld hl, $cf1f - ld a, [$cf2d] + ld hl, wcf1f + ld a, [wcf2d] ld e, a ld d, $0 add hl, de @@ -304,9 +303,9 @@ Func_71fc2: ; 71fc2 (1c:5fc2) ld e, $f .asm_71fdb push de - ld hl, $cf37 + ld hl, wcf37 ld bc, $6 - ld a, [$cf2d] + ld a, [wcf2d] call AddNTimes pop de ld [hl], e @@ -379,14 +378,14 @@ SendSGBPacket: ; 71feb (1c:5feb) ; else send 16 more bytes jr .loop2 -LoadSGBBorderAndPalettes: ; 7202b (1c:602b) +LoadSGB: ; 7202b (1c:602b) xor a - ld [$cf1b], a + ld [wcf1b], a call Func_7209b ret nc ld a, $1 - ld [$cf1b], a - ld a, [$cf1a] + ld [wcf1b], a + ld a, [wGBC] and a jr z, .asm_7203f ret @@ -395,22 +394,22 @@ LoadSGBBorderAndPalettes: ; 7202b (1c:602b) call Func_72075 ei ld a, $1 - ld [$cf2d], a - ld de, PalPacket_72508 + ld [wcf2d], a + ld de, ChrTrnPacket ld hl, SGBBorderGraphics call Func_7210b xor a - ld [$cf2d], a - ld de, PalPacket_72518 + ld [wcf2d], a + ld de, PctTrnPacket ld hl, BorderPalettes call Func_7210b xor a - ld [$cf2d], a - ld de, PalPacket_724d8 + ld [wcf2d], a + ld de, PalTrnPacket ld hl, SuperPalettes call Func_7210b - call ZeroVram - ld hl, PalPacket_72538 + call ClearVram + ld hl, MaskEnCancelPacket jp SendSGBPacket Func_72075: ; 72075 (1c:6075) @@ -431,18 +430,18 @@ Func_72075: ; 72075 (1c:6075) ret PointerTable_72089: ; 72089 (1c:6089) - dw PalPacket_72528 - dw PalPacket_72548 - dw PalPacket_72558 - dw PalPacket_72568 - dw PalPacket_72578 - dw PalPacket_72588 - dw PalPacket_72598 - dw PalPacket_725a8 - dw PalPacket_725b8 + dw MaskEnFreezePacket + dw DataSnd_72548 + dw DataSnd_72558 + dw DataSnd_72568 + dw DataSnd_72578 + dw DataSnd_72588 + dw DataSnd_72598 + dw DataSnd_725a8 + dw DataSnd_725b8 Func_7209b: ; 7209b (1c:609b) - ld hl, PalPacket_724f8 + ld hl, MltReq2Packet di call SendSGBPacket ld a, $1 @@ -493,7 +492,7 @@ Func_7209b: ; 7209b (1c:609b) ret Func_72102: ; 72102 (1c:6102) - ld hl, PalPacket_724e8 + ld hl, MltReq1Packet call SendSGBPacket jp Wait7000 @@ -503,8 +502,8 @@ Func_7210b: ; 7210b (1c:610b) call DisableLCD ld a, $e4 ld [rBGP], a ; $ff47 - ld de, $8800 - ld a, [$cf2d] + ld de, vChars1 + ld a, [wcf2d] and a jr z, .asm_72122 call Func_72188 @@ -513,7 +512,7 @@ Func_7210b: ; 7210b (1c:610b) ld bc, $1000 call CopyData .asm_72128 - ld hl, $9800 + ld hl, vBGMap0 ld de, $c ld a, $80 ld c, $d @@ -551,7 +550,7 @@ Wait7000: ; 7214a (1c:614a) ret Func_72156: ; 72156 (1c:6156) - ld a, [$cf1a] + ld a, [wGBC] and a jr z, .asm_72165 push de diff --git a/engine/play_time.asm b/engine/play_time.asm index 6eb8bc17..db7d6f67 100755 --- a/engine/play_time.asm +++ b/engine/play_time.asm @@ -1,43 +1,43 @@ Func_18dee: ; 18dee (6:4dee) call Func_18e36 - ld a, [$d732] + ld a, [wd732] bit 0, a ret z - ld a, [W_PLAYTIMEMINUTES] ; $da42 + ld a, [W_PLAYTIMEMINUTES] ; wda42 and a ret nz - ld a, [W_PLAYTIMEFRAMES] ; $da45 + ld a, [W_PLAYTIMEFRAMES] ; wda45 inc a - ld [W_PLAYTIMEFRAMES], a ; $da45 + ld [W_PLAYTIMEFRAMES], a ; wda45 cp 60 ret nz xor a - ld [W_PLAYTIMEFRAMES], a ; $da45 - ld a, [W_PLAYTIMESECONDS] ; $da44 + ld [W_PLAYTIMEFRAMES], a ; wda45 + ld a, [W_PLAYTIMESECONDS] ; wda44 inc a - ld [W_PLAYTIMESECONDS], a ; $da44 + ld [W_PLAYTIMESECONDS], a ; wda44 cp 60 ret nz xor a - ld [W_PLAYTIMESECONDS], a ; $da44 - ld a, [$da43] + ld [W_PLAYTIMESECONDS], a ; wda44 + ld a, [W_PLAYTIMEMINUTES + 1] inc a - ld [$da43], a + ld [W_PLAYTIMEMINUTES + 1], a cp 60 ret nz xor a - ld [$da43], a - ld a, [$da41] + ld [W_PLAYTIMEMINUTES + 1], a + ld a, [W_PLAYTIMEHOURS + 1] inc a - ld [$da41], a + ld [W_PLAYTIMEHOURS + 1], a cp $ff ret nz ld a, $ff - ld [W_PLAYTIMEMINUTES], a ; $da42 + ld [W_PLAYTIMEMINUTES], a ; wda42 ret Func_18e36: ; 18e36 (6:4e36) - ld a, [$d13a] + ld a, [wd13a] and a jr nz, .asm_18e40 ld a, $ff @@ -45,17 +45,17 @@ Func_18e36: ; 18e36 (6:4e36) .asm_18e40 dec a .asm_18e41 - ld [$d13a], a + ld [wd13a], a and a ret nz - ld a, [$d730] + ld a, [wd730] res 1, a res 2, a bit 5, a res 5, a - ld [$d730], a + ld [wd730], a ret z xor a - ld [H_NEWLYPRESSEDBUTTONS], a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyPressed], a + ld [hJoyHeld], a ret diff --git a/engine/pokedex_rating.asm b/engine/pokedex_rating.asm index f3aeeb42..080025c6 100755 --- a/engine/pokedex_rating.asm +++ b/engine/pokedex_rating.asm @@ -2,12 +2,12 @@ DisplayDexRating: ; 44169 (11:4169) ld hl, wPokedexSeen ld b, wPokedexSeenEnd - wPokedexSeen call CountSetBits - ld a, [$D11E] ; result of CountSetBits (seen count) + ld a, [wd11e] ; result of CountSetBits (seen count) ld [$FFDB], a ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits - ld a, [$D11E] ; result of CountSetBits (own count) + ld a, [wd11e] ; result of CountSetBits (own count) ld [$FFDC], a ld hl, DexRatingsTable .findRating @@ -23,10 +23,10 @@ DisplayDexRating: ; 44169 (11:4169) ld a, [hli] ld h, [hl] ld l, a ; load text pointer into hl - ld a, [$D747] + ld a, [wd747] bit 3, a res 3, a - ld [$D747], a + ld [wd747], a jr nz, .label3 push hl ld hl, PokedexRatingText_441cc @@ -36,7 +36,7 @@ DisplayDexRating: ; 44169 (11:4169) callba Func_7d13b jp WaitForTextScrollButtonPress ; wait for button press .label3 - ld de, $CC5B + ld de, wcc5b ld a, [$FFDB] ld [de], a inc de diff --git a/engine/predefs.asm b/engine/predefs.asm index 4550a562..3ac99585 100755 --- a/engine/predefs.asm +++ b/engine/predefs.asm @@ -1,25 +1,20 @@ -GetPredefPointer: ; 4fe49 (13:7e49) -; stores hl in $CC4F,$CC50 -; stores de in $CC51,$CC52 -; stores bc in $CC53,$CC54 -; grabs a byte "n" from $CC4E, -; and gets the nth (3-byte) pointer in PredefPointers -; stores the bank of said pointer in [$D0B7] -; stores the pointer in hl and returns - ; ld $CC4F,hl +GetPredefPointer: +; Store the contents of the register +; pairs (hl, de, bc) at wPredefRegisters. +; Then put the bank and address of predef +; wPredefID in [wPredefBank] and hl. + ld a,h - ld [$CC4F],a + ld [wPredefRegisters],a ld a,l - ld [$CC50],a + ld [wPredefRegisters + 1],a - ; ld $CC51,de - ld hl,$CC51 + ld hl,wPredefRegisters + 2 ld a,d ld [hli],a ld a,e ld [hli],a - ; ld $CC53,bc ld a,b ld [hli],a ld [hl],c @@ -27,11 +22,10 @@ GetPredefPointer: ; 4fe49 (13:7e49) ld hl,PredefPointers ld de,0 - ; de = 3 * [$CC4E] - ld a,[$CC4E] + ld a,[wPredefID] ld e,a - add a,a - add a,e + add a + add e ld e,a jr nc,.next inc d @@ -43,7 +37,7 @@ GetPredefPointer: ; 4fe49 (13:7e49) ; get bank of predef routine ld a,[de] - ld [$D0B7],a + ld [wPredefBank],a ; get pointer inc de @@ -55,129 +49,105 @@ GetPredefPointer: ; 4fe49 (13:7e49) ret -PredefPointers: ; 4fe79 (13:7e79) +PredefPointers:: ; 4fe79 (13:7e79) ; these are pointers to ASM routines. ; they appear to be used in overworld map scripts. - dbw BANK(Func_3cd60),Func_3cd60 - dbw BANK(Func_3f0c6),Func_3f0c6 - dbw BANK(Func_3f073),Func_3f073 - dbw BANK(ScaleSpriteByTwo), ScaleSpriteByTwo - db BANK(LoadMonBackSprite) ; dbw macro gives an error for some reason - dw LoadMonBackSprite - dbw BANK(Func_79aba),Func_79aba - dbw BANK(Func_f132),Func_f132 -HealPartyPredef: ; 4fe8e (13:7e8e) - dbw BANK(HealParty),HealParty -MoveAnimationPredef: ; 4fe91 (13:7e91) - dbw BANK(MoveAnimation),MoveAnimation; 08 play move animation - dbw BANK(Func_f71e),Func_f71e - dbw BANK(Func_f71e),Func_f71e - dbw BANK(Func_f81d),Func_f81d - dbw BANK(Func_f836),Func_f836 - dbw BANK(Func_f71e),Func_f71e - dbw BANK(Func_f71e),Func_f71e - db BANK(InitializePlayerData) - dw InitializePlayerData - dbw BANK(HandleBitArray),HandleBitArray - db BANK(RemoveMissableObject) - dw RemoveMissableObject - db BANK(IsMissableObjectHidden) - dw IsMissableObjectHidden - dbw BANK(Func_c69c),Func_c69c - db BANK(AnyPlayerPokemonAliveCheck) - dw AnyPlayerPokemonAliveCheck - db BANK(AddMissableObject) - dw AddMissableObject - db BANK(AddMissableObject) - dw AddMissableObject - dbw BANK(Func_ee9e),Func_ee9e - db BANK(InitializePlayerData) - dw InitializePlayerData - dbw BANK(Func_c754),Func_c754 - dbw BANK(Func_3af5b),Func_3af5b - dbw BANK(LearnMove),LearnMove - dbw BANK(IsItemInBag_),IsItemInBag_; 1C, used in Pokémon Tower + add_predef Func_3cd60 + add_predef Func_3f0c6 + add_predef Func_3f073 + add_predef ScaleSpriteByTwo + add_predef LoadMonBackPic + add_predef Func_79aba + add_predef Func_f132 + add_predef HealParty + add_predef MoveAnimation; 08 play move animation + add_predef DivideBCDPredef + add_predef DivideBCDPredef2 + add_predef AddBCDPredef + add_predef SubBCDPredef + add_predef DivideBCDPredef3 + add_predef DivideBCDPredef4 + add_predef InitPlayerData + add_predef FlagActionPredef + add_predef HideObject + add_predef IsObjectHidden + add_predef Func_c69c + add_predef AnyPartyAlive + add_predef ShowObject + add_predef ShowObject2 + add_predef Func_ee9e + add_predef InitPlayerData2 + add_predef Func_c754 + add_predef Func_3af5b + add_predef LearnMove + add_predef IsItemInBag_ ; 1C, used in Pokémon Tower dbw $03,Func_3eb5 ; for these two, the bank number is actually 0 dbw $03,GiveItem - dbw BANK(Func_480eb),Func_480eb - dbw BANK(Func_f8ba),Func_f8ba - dbw BANK(Func_480ff),Func_480ff - dbw BANK(Func_f929),Func_f929 - dbw BANK(Func_f9a0),Func_f9a0 - dbw BANK(Func_48125),Func_48125 - dbw BANK(UpdateHPBar),UpdateHPBar - db BANK(UpdateHPBar_LoadRegisters) - dw UpdateHPBar_LoadRegisters - dbw BANK(Func_5ab0),Func_5ab0 - dbw BANK(Func_3ed02),Func_3ed02 - db BANK(DisplayPokedexMenu_) - dw DisplayPokedexMenu_ - dbw BANK(Func_3ad1c),Func_3ad1c - dbw BANK(SaveSAVtoSRAM0),SaveSAVtoSRAM0 - dbw BANK(InitOpponent),InitOpponent - dbw BANK(Func_5a5f),Func_5a5f - dbw BANK(DrawBadges), DrawBadges - dbw BANK(Func_410f3),Func_410f3 - dbw BANK(Func_7096d),Func_7096d - dbw BANK(Func_79dda),Func_79dda - dbw BANK(PlayIntro),PlayIntro - dbw BANK(Func_79869),Func_79869 - dbw BANK(Func_70b5d),Func_70b5d - dbw BANK(Func_c586),Func_c586 - dbw BANK(StatusScreen),StatusScreen ; 37 0x12953 - dbw BANK(StatusScreen2),StatusScreen2 ; 38 - dbw BANK(Func_410e2),Func_410e2 - db BANK(CheckEngagePlayer) - dw CheckEngagePlayer - dbw BANK(IndexToPokedex),IndexToPokedex - dbw BANK(Predef3B),Predef3B; 3B display pic? - dbw BANK(UsedCut),UsedCut - dbw BANK(ShowPokedexData),ShowPokedexData - dbw BANK(WriteMonMoves),WriteMonMoves - dbw BANK(SaveSAV),SaveSAV - db BANK(LoadSGBBorderAndPalettes) - dw LoadSGBBorderAndPalettes - dbw BANK(Func_f113),Func_f113 - dbw BANK(SetPartyMonTypes),SetPartyMonTypes - db BANK(TestMonMoveCompatibility) - dw TestMonMoveCompatibility - dbw BANK(TMToMove),TMToMove - dbw BANK(Func_71ddf),Func_71ddf - db BANK(DisplayStarterMonDex) - dw DisplayStarterMonDex; 46 load dex screen - db BANK(_AddPokemonToParty) - dw _AddPokemonToParty - dbw BANK(UpdateHPBar),UpdateHPBar - dbw BANK(Func_3cdec),Func_3cdec - dbw BANK(LoadTownMap_Nest),LoadTownMap_Nest - dbw BANK(Func_27d6b),Func_27d6b - db BANK(PrintEmotionBubble) - dw PrintEmotionBubble; 4C player exclamation - dbw BANK(Func_5aaf),Func_5aaf; return immediately - db BANK(AskForMonNickname) - dw AskForMonNickname - dbw BANK(PewterGuys),PewterGuys - dbw BANK(SaveSAVtoSRAM2),SaveSAVtoSRAM2 - dbw BANK(LoadSAVCheckSum2),LoadSAVCheckSum2 - dbw BANK(LoadSAV),LoadSAV - dbw BANK(SaveSAVtoSRAM1),SaveSAVtoSRAM1 - dbw BANK(Predef54),Predef54 ; 54 initiate trade - db BANK(HallOfFameComputer) - dw HallOfFameComputer - dbw BANK(DisplayDexRating),DisplayDexRating - db $1E ; uses wrong bank number - dw _DoFlyOrTeleportAwayGraphics - db $1E ; uses wrong bank number - dw Func_70510 - dbw BANK(Func_c5be),Func_c5be - dbw BANK(Func_c60b),Func_c60b - db BANK(PrintUsedStrengthText) - dw PrintUsedStrengthText - dbw BANK(PickupItem),PickupItem - dbw BANK(Func_27d98),Func_27d98 - dbw BANK(LoadMovePPs),LoadMovePPs -DrawHPBarPredef: ; 4ff96 (13:7f96) - dbw BANK(Func_128ef),Func_128ef ; 5F draw HP bar - dbw BANK(Func_128f6),Func_128f6 - dbw BANK(Func_1c9c6),Func_1c9c6 - dbw BANK(OaksAideScript),OaksAideScript + add_predef Func_480eb + add_predef Func_f8ba + add_predef Func_480ff + add_predef Func_f929 + add_predef Func_f9a0 + add_predef Func_48125 + add_predef UpdateHPBar + add_predef HPBarLength + add_predef Func_5ab0 + add_predef Func_3ed02 + add_predef ShowPokedexMenu + add_predef Func_3ad1c + add_predef SaveSAVtoSRAM0 + add_predef InitOpponent + add_predef Func_5a5f + add_predef DrawBadges + add_predef Func_410f3 + add_predef BattleTransition + add_predef Func_79dda + add_predef PlayIntro + add_predef Func_79869 + add_predef FlashScreen + add_predef Func_c586 + add_predef StatusScreen + add_predef StatusScreen2 + add_predef Func_410e2 + add_predef TrainerEngage + add_predef IndexToPokedex + add_predef Predef3B; 3B display pic? + add_predef UsedCut + add_predef ShowPokedexData + add_predef WriteMonMoves + add_predef SaveSAV + add_predef LoadSGB + add_predef Func_f113 + add_predef SetPartyMonTypes + add_predef CanLearnTM + add_predef TMToMove + add_predef Func_71ddf + add_predef StarterDex ; 46 + add_predef _AddPartyMon + add_predef UpdateHPBar2 + add_predef Func_3cdec + add_predef LoadTownMap_Nest + add_predef Func_27d6b + add_predef EmotionBubble; 4C player exclamation + add_predef Func_5aaf; return immediately + add_predef AskName + add_predef PewterGuys + add_predef SaveSAVtoSRAM2 + add_predef LoadSAVCheckSum2 + add_predef LoadSAV + add_predef SaveSAVtoSRAM1 + add_predef Predef54 ; 54 initiate trade + add_predef HallOfFamePC + add_predef DisplayDexRating + dbw $1E, _LeaveMapAnim ; wrong bank + dbw $1E, Func_70510 ; wrong bank + add_predef Func_c5be + add_predef Func_c60b + add_predef PrintStrengthTxt + add_predef PickupItem + add_predef Func_27d98 + add_predef LoadMovePPs + add_predef DrawHP ; 5F + add_predef Func_128f6 + add_predef Func_1c9c6 + add_predef OaksAideScript diff --git a/engine/predefs12.asm b/engine/predefs12.asm index ac305c04..380cfc1c 100755 --- a/engine/predefs12.asm +++ b/engine/predefs12.asm @@ -1,5 +1,5 @@ Func_480eb: ; 480eb (12:40eb) - call Load16BitRegisters + call GetPredefRegisters ld a, [rBGP] ; $ff47 or b ld [rBGP], a ; $ff47 @@ -11,9 +11,9 @@ Func_480eb: ; 480eb (12:40eb) ret Func_480ff: ; 480ff (12:40ff) - call Load16BitRegisters + call GetPredefRegisters ld a, $1 - ld [$d0a0], a + ld [wd0a0], a xor a .asm_48108 ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND) @@ -23,7 +23,7 @@ Func_480ff: ; 480ff (12:40ff) ld a, b jr nz, .asm_48108 xor a - ld [$d0a0], a + ld [wd0a0], a ret Func_48119: ; 48119 (12:4119) @@ -35,7 +35,7 @@ Func_48119: ; 48119 (12:4119) jp DelayFrames Func_48125: ; 48125 (12:4125) - call Load16BitRegisters + call GetPredefRegisters xor a .asm_48129 ld [$ff97], a diff --git a/engine/predefs17.asm b/engine/predefs17.asm index d261804a..74977ee8 100755 --- a/engine/predefs17.asm +++ b/engine/predefs17.asm @@ -1,10 +1,9 @@ ; this function temporarily makes the starters (and Ivysaur) seen ; so that the full Pokedex information gets displayed in Oak's lab -DisplayStarterMonDex: ; 5c0dc (17:40dc) +StarterDex: ; 5c0dc (17:40dc) ld a, %01001011 ; set starter flags - ld [wPokedexOwned], a ; $d2f7 - ld a, $3d - call Predef ; indirect jump to ShowPokedexData (402d1 (10:42d1)) + ld [wPokedexOwned], a ; wPokedexOwned + predef ShowPokedexData xor a ; unset starter flags - ld [wPokedexOwned], a ; $d2f7 + ld [wPokedexOwned], a ; wPokedexOwned ret diff --git a/engine/predefs17_2.asm b/engine/predefs17_2.asm index a1c4ff30..a2dac120 100755 --- a/engine/predefs17_2.asm +++ b/engine/predefs17_2.asm @@ -1,10 +1,10 @@ -; updates the types of a party mon (pointed to in hl) to the ones of the mon specified in $d11e +; updates the types of a party mon (pointed to in hl) to the ones of the mon specified in wd11e SetPartyMonTypes: ; 5db5e (17:5b5e) - call Load16BitRegisters - ld bc, W_PARTYMON1_TYPE1 - W_PARTYMON1DATA ; $5 + call GetPredefRegisters + ld bc, wPartyMon1Type - wPartyMon1 ; $5 add hl, bc - ld a, [$d11e] - ld [$d0b5], a + ld a, [wd11e] + ld [wd0b5], a push hl call GetMonHeader pop hl diff --git a/engine/predefs7.asm b/engine/predefs7.asm index a52a71cc..469fe0c4 100755 --- a/engine/predefs7.asm +++ b/engine/predefs7.asm @@ -1,28 +1,28 @@ Func_1c9c6: ; 1c9c6 (7:49c6) ld hl, WhichFloorText call PrintText - ld hl, $cf7b + ld hl, wStringBuffer2 + 11 ld a, l - ld [$cf8b], a + ld [wcf8b], a ld a, h - ld [$cf8c], a - ld a, [wListScrollOffset] ; $cc36 + ld [wcf8c], a + ld a, [wListScrollOffset] ; wcc36 push af xor a - ld [wCurrentMenuItem], a ; $cc26 - ld [wListScrollOffset], a ; $cc36 - ld [$cf93], a + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wListScrollOffset], a ; wcc36 + ld [wcf93], a ld a, $4 - ld [wListMenuID], a ; $cf94 + ld [wListMenuID], a ; wListMenuID call DisplayListMenuID pop bc ld a, b - ld [wListScrollOffset], a ; $cc36 + ld [wListScrollOffset], a ; wcc36 ret c - ld hl, $d126 + ld hl, wd126 set 7, [hl] - ld hl, $cc5b - ld a, [wWhichPokemon] ; $cf92 + ld hl, wcc5b + ld a, [wWhichPokemon] ; wWhichPokemon add a ld d, $0 ld e, a @@ -31,7 +31,7 @@ Func_1c9c6: ; 1c9c6 (7:49c6) ld b, a ld a, [hl] ld c, a - ld hl, $d3af + ld hl, wd3af call Func_1ca0d Func_1ca0d: ; 1ca0d (7:4a0d) diff --git a/engine/random.asm b/engine/random.asm new file mode 100755 index 00000000..2fc83f6f --- /dev/null +++ b/engine/random.asm @@ -0,0 +1,13 @@ +Random_:: +; Generate a random 16-bit value. + ld a, [rDIV] + ld b, a + ld a, [hRandomAdd] + adc b + ld [hRandomAdd], a + ld a, [rDIV] + ld b, a + ld a, [hRandomSub] + sbc b + ld [hRandomSub], a + ret diff --git a/engine/rng.asm b/engine/rng.asm deleted file mode 100755 index a0e0daa7..00000000 --- a/engine/rng.asm +++ /dev/null @@ -1,13 +0,0 @@ -GenRandom_: ; 13a8f (4:7a8f) -; generate a random 16-bit integer and store it at $FFD3,$FFD4 - ld a,[rDIV] - ld b,a - ld a,[H_RAND1] - adc b - ld [H_RAND1],a - ld a,[rDIV] - ld b,a - ld a,[H_RAND2] - sbc b - ld [H_RAND2],a - ret diff --git a/engine/save.asm b/engine/save.asm index bf2ec037..fcfbd133 100755 --- a/engine/save.asm +++ b/engine/save.asm @@ -13,7 +13,7 @@ LoadSAV: ; 735e8 (1c:75e8) ld a, $2 ; good checksum jr .goodsum .badsum - ld hl, $d730 + ld hl, wd730 push hl set 6, [hl] ld hl, FileDataDestroyedText @@ -24,7 +24,7 @@ LoadSAV: ; 735e8 (1c:75e8) res 6, [hl] ld a, $1 ; bad checksum .goodsum - ld [$d088], a ; checksum flag + ld [wd088], a ; checksum flag ret FileDataDestroyedText: ; 7361e (1c:761e) @@ -54,14 +54,14 @@ LoadSAVCheckSum: ; 73623 (1c:7623) .Func_73652 ; 73652 (1c:7652) ld hl, $a598 - ld de, W_PLAYERNAME ; $d158 + ld de, wPlayerName ; wd158 ld bc, $b call CopyData ld hl, $a5a3 - ld de, wPokedexOwned ; $d2f7 + ld de, wPokedexOwned ; wPokedexOwned ld bc, $789 call CopyData - ld hl, W_CURMAPTILESET ; $d367 + ld hl, W_CURMAPTILESET ; W_CURMAPTILESET set 7, [hl] ld hl, $ad2c ld de, wSpriteStateData1 @@ -70,7 +70,7 @@ LoadSAVCheckSum: ; 73623 (1c:7623) ld a, [$b522] ld [$ffd7], a ld hl, $b0c0 - ld de, W_NUMINBOX ; $da80 + ld de, W_NUMINBOX ; wda80 ld bc, $462 call CopyData and a @@ -90,7 +90,7 @@ LoadSAVCheckSum1: ; 73690 (1c:7690) cp c jr nz, SAVBadCheckSum ld hl, $b0c0 - ld de, W_NUMINBOX ; $da80 + ld de, W_NUMINBOX ; wda80 ld bc, $462 call CopyData and a @@ -110,11 +110,11 @@ LoadSAVCheckSum2: ; 736bd (1c:76bd) cp c jp nz, SAVBadCheckSum ld hl, $af2c - ld de, W_NUMINPARTY ; $d163 + ld de, wPartyCount ; wPartyCount ld bc, $194 call CopyData ld hl, $a5a3 - ld de, wPokedexOwned ; $d2f7 + ld de, wPokedexOwned ; wPokedexOwned ld bc, wPokedexSeenEnd - wPokedexOwned call CopyData and a @@ -140,7 +140,7 @@ SaveSAV: ;$770a call SaveSAVConfirm and a ;|0 = Yes|1 = No| ret nz - ld a,[$d088] + ld a,[wd088] dec a jr z,.save call SAVCheckRandomID @@ -151,12 +151,10 @@ SaveSAV: ;$770a ret nz .save ;$772d call SaveSAVtoSRAM ;$7848 - FuncCoord 1,13 - ld hl,Coord + hlCoord 1, 13 ld bc,$0412 call ClearScreenArea ; clear area 4x12 starting at 13,1 - FuncCoord 1,14 - ld hl,Coord + hlCoord 1, 14 ld de,NowSavingString call PlaceString ld c,$78 @@ -174,13 +172,12 @@ NowSavingString: SaveSAVConfirm: ; 73768 (1c:7768) call PrintText - FuncCoord 0, 7 - ld hl,Coord + hlCoord 0, 7 ld bc,$0801 ;arrow's coordinates |b = Y|c = X| ld a,$14 ;one line shifting ($28 = 2 lines) - ld [$d125],a + ld [wd125],a call DisplayTextBoxID ;handle Yes/No KeyPress - ld a,[$cc26] + ld a,[wCurrentMenuItem] ret WouldYouLikeToSaveText: ; 0x7377d @@ -201,11 +198,11 @@ SaveSAVtoSRAM0: ; 7378c (1c:778c) ld a, $1 ld [$6000], a ld [$4000], a - ld hl, W_PLAYERNAME ; $d158 + ld hl, wPlayerName ; wd158 ld de, $a598 ld bc, $b call CopyData - ld hl, wPokedexOwned ; $d2f7 + ld hl, wPokedexOwned ; wPokedexOwned ld de, $a5a3 ld bc, $789 call CopyData @@ -213,7 +210,7 @@ SaveSAVtoSRAM0: ; 7378c (1c:778c) ld de, $ad2c ld bc, $200 call CopyData - ld hl, W_NUMINBOX ; $da80 + ld hl, W_NUMINBOX ; wda80 ld de, $b0c0 ld bc, $462 call CopyData @@ -235,7 +232,7 @@ SaveSAVtoSRAM1: ; 737e2 (1c:77e2) ld a, $1 ld [$6000], a ld [$4000], a - ld hl, W_NUMINBOX ; $da80 + ld hl, W_NUMINBOX ; wda80 ld de, $b0c0 ld bc, $462 call CopyData @@ -254,7 +251,7 @@ SaveSAVtoSRAM2: ; 7380f (1c:780f) ld a, $1 ld [$6000], a ld [$4000], a - ld hl, W_NUMINPARTY ; $d163 + ld hl, wPartyCount ; wPartyCount ld de, $af2c ld bc, $194 call CopyData @@ -273,7 +270,7 @@ SaveSAVtoSRAM2: ; 7380f (1c:780f) SaveSAVtoSRAM: ; 73848 (1c:7848) ld a, $2 - ld [$d088], a + ld [wd088], a call SaveSAVtoSRAM0 call SaveSAVtoSRAM1 jp SaveSAVtoSRAM2 @@ -312,7 +309,7 @@ Func_73863: ; 73863 (1c:7863) Func_7387b: ; 7387b (1c:787b) ld hl, PointerTable_73895 ; $7895 - ld a, [$d5a0] + ld a, [wd5a0] and $7f cp $6 ld b, $2 @@ -341,10 +338,10 @@ Func_738a1:: ; 738a1 (1c:78a1) ld hl, WhenYouChangeBoxText call PrintText call YesNoChoice - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem and a ret nz - ld hl, $d5a0 + ld hl, wd5a0 bit 7, [hl] call z, Func_73a29 call Func_7393f @@ -359,16 +356,16 @@ Func_738a1:: ; 738a1 (1c:78a1) call Func_7387b ld e, l ld d, h - ld hl, W_NUMINBOX ; $da80 + ld hl, W_NUMINBOX ; wda80 call Func_7390e - ld a, [wCurrentMenuItem] ; $cc26 + ld a, [wCurrentMenuItem] ; wCurrentMenuItem set 7, a - ld [$d5a0], a + ld [wd5a0], a call Func_7387b - ld de, W_NUMINBOX ; $da80 + ld de, W_NUMINBOX ; wda80 call Func_7390e - ld hl, W_MAPTEXTPTR ; $d36c - ld de, wWhichTrade ; $cd3d + ld hl, W_MAPTEXTPTR ; wd36c + ld de, wWhichTrade ; wWhichTrade ld a, [hli] ld [de], a inc de @@ -376,7 +373,7 @@ Func_738a1:: ; 738a1 (1c:78a1) ld [de], a call Func_3f05 call SaveSAVtoSRAM - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade call Func_3f0f ld a, (SFX_02_5d - SFX_Headers_02) / 3 call PlaySoundWaitForCurrent @@ -416,61 +413,55 @@ Func_7393f: ; 7393f (1c:793f) xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba ld a, $3 - ld [wMenuWatchedKeys], a ; $cc29 + ld [wMenuWatchedKeys], a ; wMenuWatchedKeys ld a, $b - ld [wMaxMenuItem], a ; $cc28 + ld [wMaxMenuItem], a ; wMaxMenuItem ld a, $1 - ld [wTopMenuItemY], a ; $cc24 + ld [wTopMenuItemY], a ; wTopMenuItemY ld a, $c - ld [wTopMenuItemX], a ; $cc25 + ld [wTopMenuItemX], a ; wTopMenuItemX xor a - ld [$cc37], a - ld a, [$d5a0] + ld [wcc37], a + ld a, [wd5a0] and $7f - ld [wCurrentMenuItem], a ; $cc26 - ld [wLastMenuItem], a ; $cc2a + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wLastMenuItem], a ; wLastMenuItem ld hl, wTileMap ld b, $2 ld c, $9 call TextBoxBorder ld hl, ChooseABoxText call PrintText - FuncCoord 11, 0 ; $c3ab - ld hl, Coord + hlCoord 11, 0 ld b, $c ld c, $7 call TextBoxBorder ld hl, $fff6 set 2, [hl] ld de, BoxNames ; $79d9 - FuncCoord 13, 1 ; $c3c1 - ld hl, Coord + hlCoord 13, 1 call PlaceString ld hl, $fff6 res 2, [hl] - ld a, [$d5a0] + ld a, [wd5a0] and $7f cp $9 jr c, .asm_739a6 sub $9 - FuncCoord 8, 2 ; $c3d0 - ld hl, Coord + hlCoord 8, 2 ld [hl], $f7 add $f6 jr .asm_739a8 .asm_739a6 add $f7 .asm_739a8 - FuncCoord 9, 2 ; $c3d1 - ld [Coord], a - FuncCoord 1, 2 ; $c3c9 - ld hl, Coord + Coorda 9, 2 + hlCoord 1, 2 ld de, BoxNoText call PlaceString call Func_73a84 - FuncCoord 18, 1 ; $c3c6 - ld hl, Coord - ld de, wWhichTrade ; $cd3d + hlCoord 18, 1 + ld de, wWhichTrade ; wWhichTrade ld bc, $14 ld a, $c .asm_739c2 @@ -554,7 +545,7 @@ Func_73a7f: ; 73a7f (1c:7a7f) ret Func_73a84: ; 73a84 (1c:7a84) - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade push hl ld a, $a ld [$0], a @@ -570,12 +561,12 @@ Func_73a84: ; 73a84 (1c:7a84) ld [$6000], a ld [$0], a pop hl - ld a, [$d5a0] + ld a, [wd5a0] and $7f ld c, a ld b, $0 add hl, bc - ld a, [W_NUMINBOX] ; $da80 + ld a, [W_NUMINBOX] ; wda80 ld [hl], a ret @@ -597,7 +588,7 @@ Func_73ab8: ; 73ab8 (1c:7ab8) SAVCheckRandomID: ;$7ad1 ;checks if Sav file is the same by checking player's name 1st letter ($a598) ; and the two random numbers generated at game beginning -;(which are stored at $d359-d35a) +;(which are stored at wPlayerID) ld a,$0a ld [$0000],a ld a,$01 @@ -617,10 +608,10 @@ SAVCheckRandomID: ;$7ad1 ld a,[hli] ld h,[hl] ld l,a - ld a,[$d359] + ld a,[wPlayerID] cp l jr nz,.next - ld a,[$d35a] + ld a,[wPlayerID + 1] cp h .next ld a,$00 @@ -628,38 +619,40 @@ SAVCheckRandomID: ;$7ad1 ld [$0000],a ret -Func_73b0d: ; 73b0d (1c:7b0d) - ld a, [$d5a2] +SaveHallOfFameTeams: ; 73b0d (1c:7b0d) + ld a, [wd5a2] dec a - cp $32 + cp NUM_HOF_TEAMS jr nc, .asm_73b28 - ld hl, $a598 - ld bc, $60 + ld hl, sHallOfFame + ld bc, HOF_TEAM call AddNTimes ld e, l ld d, h - ld hl, $cc5b - ld bc, $60 - jr CopyToSRAM0 + ld hl, wcc5b + ld bc, HOF_TEAM + jr HallOfFame_Copy + .asm_73b28 - ld hl, $a5f8 - ld de, $a598 - ld bc, $1260 - call CopyToSRAM0 - ld hl, $cc5b - ld de, $b7f8 - ld bc, $60 - jr CopyToSRAM0 - -Func_73b3f: ; 73b3f (1c:7b3f) - ld hl, $a598 - ld bc, $60 - ld a, [wWhichTrade] ; $cd3d + ld hl, sHallOfFame + HOF_TEAM + ld de, sHallOfFame + ld bc, HOF_TEAM * (NUM_HOF_TEAMS - 1) + call HallOfFame_Copy + ld hl, wcc5b + ld de, sHallOfFame + HOF_TEAM * (NUM_HOF_TEAMS - 1) + ld bc, HOF_TEAM + jr HallOfFame_Copy + +LoadHallOfFameTeams: ; 73b3f (1c:7b3f) + ld hl, sHallOfFame + ld bc, HOF_TEAM + ld a, [wWhichTrade] ; wWhichTrade call AddNTimes - ld de, $cc5b - ld bc, $60 + ld de, wcc5b + ld bc, HOF_TEAM ; fallthrough -CopyToSRAM0: ; 73b51 (1c:7b51) + +HallOfFame_Copy: ; 73b51 (1c:7b51) ld a, $a ld [$0], a ld a, $1 diff --git a/engine/slot_machine.asm b/engine/slot_machine.asm index a3c83e64..e43cc9ab 100755 --- a/engine/slot_machine.asm +++ b/engine/slot_machine.asm @@ -1,7 +1,7 @@ PromptUserToPlaySlots: ; 3730e (d:730e) call SaveScreenTilesToBuffer2 ld a, BANK(DisplayTextIDInit) - ld [$cf0c], a + ld [wcf0c], a ld b, a ld hl, DisplayTextIDInit call Bankswitch @@ -12,13 +12,12 @@ PromptUserToPlaySlots: ; 3730e (d:730e) and a jr nz, .skip dec a - ld [$cfcb], a - ld hl, $cd4f + ld [wcfcb], a + ld hl, wcd4f xor a ld [hli], a ld [hl], $2 - ld a, $4c - call Predef + predef EmotionBubble call GBPalWhiteOutWithDelay3 call LoadSlotMachineTiles call LoadFontTilePatterns @@ -27,7 +26,7 @@ PromptUserToPlaySlots: ; 3730e (d:730e) call GBPalNormal ld a, $e4 ld [$ff48], a - ld hl, $d730 + ld hl, wd730 set 6, [hl] xor a ld [W_SUBANIMSUBENTRYADDR], a @@ -35,13 +34,13 @@ PromptUserToPlaySlots: ; 3730e (d:730e) ld bc, $0014 call FillMemory call MainSlotMachineLoop - ld hl, $d730 + ld hl, wd730 res 6, [hl] xor a ld [W_SUBANIMSUBENTRYADDR], a call GBPalWhiteOutWithDelay3 ld a, $1 - ld [$cfcb], a + ld [wcfcb], a call GoPAL_SET_CF1C call Func_3e08 call ReloadTilesetTilePatterns @@ -49,7 +48,7 @@ PromptUserToPlaySlots: ; 3730e (d:730e) call LoadScreenTilesFromBuffer2 call Delay3 call GBPalNormal - ld a, [$cc5e] + ld a, [wcc5e] push af jp CloseTextDisplay @@ -60,7 +59,7 @@ PlaySlotMachineText: ; 37390 (d:7390) MainSlotMachineLoop: ; 37395 (d:7395) call SlotMachine_37754 xor a - ld hl, $cd4a + ld hl, wcd4a ld [hli], a ld [hl], a call SlotMachine_3775f @@ -79,12 +78,12 @@ MainSlotMachineLoop: ; 37395 (d:7395) xor a ld [wCurrentMenuItem], a ld [wLastMenuItem], a - ld [$cc37], a - ld hl, $c48a + ld [wcc37], a + ld hl, wTileMap + $ea ld b, $5 ld c, $4 call TextBoxBorder - ld hl, $c4a0 + ld hl, wTileMap + $100 ld de, CoinMultiplierSlotMachineText call PlaceString call HandleMenuInput @@ -94,7 +93,7 @@ MainSlotMachineLoop: ; 37395 (d:7395) ld b, a ld a, $3 sub b - ld [$cd50], a + ld [wcd50], a ld hl, wPlayerCoins ld c, a ld a, [hli] @@ -112,7 +111,7 @@ MainSlotMachineLoop: ; 37395 (d:7395) call SlotMachine_377d5 call SlotMachine_37480 ld a, $4 - ld hl, $cd4d + ld hl, wcd4d ld [hli], a ld [hli], a ld [hl], a @@ -134,12 +133,12 @@ MainSlotMachineLoop: ; 37395 (d:7395) .skip2 ld hl, OneMoreGoSlotMachineText call PrintText - ld hl, $c49e + ld hl, wTileMap + $fe ld bc, $0d0f xor a - ld [$d12c], a + ld [wd12c], a ld a, $14 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID ld a, [wCurrentMenuItem] and a @@ -173,17 +172,17 @@ OneMoreGoSlotMachineText: ; 3747b (d:747b) db "@" SlotMachine_37480: ; 37480 (d:7480) - ld hl, $cd4c + ld hl, wcd4c bit 7, [hl] ret nz ld a, [W_SUBANIMSUBENTRYADDR] and a jr nz, .skip1 - call GenRandom + call Random and a jr z, .skip2 ld b, a - ld a, [$cc5b] + ld a, [wcc5b] cp b jr c, .skip3 ld a, $d2 @@ -222,7 +221,7 @@ SlotMachine_374ad: ; 374ad (d:74ad) call SlotMachine_374fb call SlotMachine_37517 ret c - ld a, [$cf1b] + ld a, [wcf1b] xor $1 inc a ld c, a @@ -237,7 +236,7 @@ SlotMachine_374df: ; 374df (d:74df) ld a, [de] rra jr nc, .skip - ld hl, $cd4d + ld hl, wcd4d ld a, [hl] and a ret z @@ -255,7 +254,7 @@ SlotMachine_374fb: ; 374fb (d:74fb) ld a, [de] rra jr nc, .skip - ld hl, $cd4e + ld hl, wcd4e ld a, [hl] and a ret z @@ -283,7 +282,7 @@ SlotMachine_37517: ; 37517 (d:7517) SlotMachine_3752c: ; 3752c (d:752c) call SlotMachine_GetWheelOneTile ld hl, wTrainerScreenX - ld a, [$cd4c] + ld a, [wcd4c] and $80 jr nz, .skip1 inc hl @@ -302,13 +301,13 @@ SlotMachine_3752c: ; 3752c (d:752c) ret .skip2 inc a - ld hl, $cd4d + ld hl, wcd4d ld [hl], $0 ret SlotMachine_37552: ; 37552 (d:7552) call SlotMachine_GetWheelTwoTile - ld a, [$cd4c] + ld a, [wcd4c] and $80 jr nz, .skip1 call SlotMachine_3756e @@ -321,12 +320,12 @@ SlotMachine_37552: ; 37552 (d:7552) ret nc .skip2 xor a - ld [$cd4e], a + ld [wcd4e], a ret SlotMachine_3756e: ; 3756e (d:756e) ld hl, wTrainerScreenX - ld de, $cd44 + ld de, wcd44 ld a, [de] cp [hl] ret z @@ -350,42 +349,42 @@ SlotMachine_3756e: ; 3756e (d:756e) SlotMachine_37588: ; 37588 (d:7588) call SlotMachine_GetWheelThreeTile - ld a, [$cd50] + ld a, [wcd50] cp $2 jr z, .skip1 cp $1 jr z, .skip2 ld hl, wTrainerScreenX - ld de, $cd45 - ld bc, $cd49 + ld de, wcd45 + ld bc, wcd49 call SlotMachine_CheckForMatch jp z, .skip5 - ld hl, $cd43 - ld de, $cd45 - ld bc, $cd47 + ld hl, wcd43 + ld de, wcd45 + ld bc, wcd47 call SlotMachine_CheckForMatch jr z, .skip5 .skip1 - ld hl, $cd43 - ld de, $cd46 - ld bc, $cd49 + ld hl, wcd43 + ld de, wcd46 + ld bc, wcd49 call SlotMachine_CheckForMatch jr z, .skip5 ld hl, wTrainerScreenX - ld de, $cd44 - ld bc, $cd47 + ld de, wcd44 + ld bc, wcd47 call SlotMachine_CheckForMatch jr z, .skip5 .skip2 - ld hl, $cd42 - ld de, $cd45 - ld bc, $cd48 + ld hl, wcd42 + ld de, wcd45 + ld bc, wcd48 call SlotMachine_CheckForMatch jr z, .skip5 - ld a, [$cd4c] + ld a, [wcd4c] and $c0 jr z, .skip3 - ld hl, $cd4f + ld hl, wcd4f dec [hl] jr nz, .skip4 .skip3 @@ -393,7 +392,7 @@ SlotMachine_37588: ; 37588 (d:7588) call PrintText .loop xor a - ld [$c002], a + ld [wc002], a ret .skip4 call SlotMachine_37833 @@ -402,7 +401,7 @@ SlotMachine_37588: ; 37588 (d:7588) call DelayFrame jp SlotMachine_37588 .skip5 - ld a, [$cd4c] + ld a, [wcd4c] and $c0 jr z, .skip4 and $80 @@ -426,7 +425,7 @@ SlotMachine_37588: ; 37588 (d:7588) ld a, [hli] ld h, [hl] ld l, a - ld de, $cf4b + ld de, wcf4b ld bc, $0004 call CopyData pop hl @@ -442,7 +441,7 @@ SlotMachine_37588: ; 37588 (d:7588) call DelayFrames dec b jr nz, .asm_37638 - ld hl, $cd4a + ld hl, wcd4a ld [hl], d inc hl ld [hl], e @@ -512,13 +511,13 @@ SlotMachine_CheckForMatch: ; 376a2 (d:76a2) ret SlotMachine_GetWheelThreeTile: ; 376a8 (d:76a8) - ld de, $cd47 + ld de, wcd47 ld hl, SlotMachineWheel3 ld a, [wTrainerScreenY] call SlotMachine_GetWheelTile SlotMachine_GetWheelTwoTile: ; 376b4 (d:76b4) - ld de, $cd44 + ld de, wcd44 ld hl, SlotMachineWheel2 ld a, [wTrainerFacingDirection] call SlotMachine_GetWheelTile @@ -568,7 +567,7 @@ SlotReward100Func: ; 376f3 (d:76f3) ld a, (SFX_1f_42 - SFX_Headers_1f) / 3 call PlaySound xor a - ld [$cd4c], a + ld [wcd4c], a ld b, $8 ld de, 100 ret @@ -578,11 +577,11 @@ SlotReward300Func: ; 37702 (d:7702) call PrintText ld a, (SFX_1f_3b - SFX_Headers_1f) / 3 call PlaySound - call GenRandom + call Random cp $80 ld a, $0 jr c, .skip - ld [$cd4c], a + ld [wcd4c], a .skip ld [W_SUBANIMSUBENTRYADDR], a ld b, $14 @@ -594,7 +593,7 @@ YeahText: ; 37722 (d:7722) db $0a, "@" SlotMachine_37728: ; 37728 (d:7728) - ld hl, $c4ba + ld hl, wTileMap + $11a ld a, [wTrainerScreenX] add $25 ld [hli], a @@ -606,38 +605,37 @@ SlotMachine_37728: ; 37728 (d:7728) ld [hli], a inc a ld [hl], a - ld hl, $c4f2 + ld hl, wTileMap + $152 ld [hl], $ee ret SlotMachine_37741: ; 37741 (d:7741) - ld hl, $cd4b - ld a, [$cd50] + ld hl, wcd4b + ld a, [wcd50] ld [hld], a xor a ld [hli], a - ld de, $d5a5 + ld de, wPlayerCoins + 1 ld c, $2 - ld a, $c - call Predef + predef SubBCDPredef SlotMachine_37754: ; 37754 (d:7754) - ld hl, $c3b9 + ld hl, wTileMap + $19 ld de, wPlayerCoins ld c, $2 jp PrintBCDNumber SlotMachine_3775f: ; 3775f (d:775f) - ld hl, $c3bf - ld de, $cd4a + ld hl, wTileMap + $1f + ld de, wcd4a ld bc, $8204 jp PrintNumber SlotMachine_3776b: ; 3776b (d:776b) ld a, $1 - ld [$c002], a + ld [wc002], a call WaitForSoundToFinish - ld hl, $cd46 + ld hl, wcd46 xor a ld [hli], a inc a @@ -645,23 +643,22 @@ SlotMachine_3776b: ; 3776b (d:776b) ld a, $5 ld [W_SUBANIMTRANSFORM], a .loop - ld a, [$cd4b] + ld a, [wcd4b] ld l, a - ld a, [$cd4a] + ld a, [wcd4a] ld h, a or l ret z ld de, $ffff add hl, de ld a, l - ld [$cd4b], a + ld [wcd4b], a ld a, h - ld [$cd4a], a - ld hl, $cd47 - ld de, $d5a5 + ld [wcd4a], a + ld hl, wcd47 + ld de, wPlayerCoins + 1 ld c, $2 - ld a, $b - call Predef + predef AddBCDPredef call SlotMachine_37754 call SlotMachine_3775f ld a, (SFX_1f_65 - SFX_Headers_1f) / 3 @@ -686,35 +683,35 @@ SlotMachine_3776b: ; 3776b (d:776b) SlotMachine_377ce: ; 377ce (d:77ce) ld a, $23 - ld [$d08a], a + ld [wd08a], a jr SlotMachine_377e3 SlotMachine_377d5: ; 377d5 (d:77d5) ld a, $14 - ld [$d08a], a - ld a, [$cd50] + ld [wd08a], a + ld a, [wcd50] dec a jr z, SlotMachine_377fb dec a jr z, SlotMachine_377ef SlotMachine_377e3: ; 377e3 (d:77e3) - ld hl, $c3cb + ld hl, wTileMap + $2b call SlotMachine_377fe - ld hl, $c46b + ld hl, wTileMap + $cb call SlotMachine_377fe SlotMachine_377ef: ; 377ef (d:77ef) - ld hl, $c3f3 + ld hl, wTileMap + $53 call SlotMachine_377fe - ld hl, $c443 + ld hl, wTileMap + $a3 call SlotMachine_377fe SlotMachine_377fb: ; 377fb (d:77fb) - ld hl, $c41b + ld hl, wTileMap + $7b SlotMachine_377fe: ; 377fe (d:77fe) - ld a, [$d08a] + ld a, [wd08a] ld [hl], a ld bc, $000d add hl, bc @@ -739,7 +736,7 @@ SlotMachine_37813: ; 37813 (d:7813) SlotMachine_37823: ; 37823 (d:7823) ld bc, SlotMachineWheel2 ld de, wTrainerFacingDirection - ld hl, $c330 + ld hl, wOAMBuffer + $30 ld a, $50 ld [W_BASECOORDX], a jr SlotMachine_37841 @@ -747,7 +744,7 @@ SlotMachine_37823: ; 37823 (d:7823) SlotMachine_37833: ; 37833 (d:7833) ld bc, SlotMachineWheel3 ld de, wTrainerScreenY - ld hl, $c360 + ld hl, wOAMBuffer + $60 ld a, $70 ld [W_BASECOORDX], a @@ -799,17 +796,17 @@ SlotMachine_3784e: ; 3784e (d:784e) SlotMachine_37882: ; 37882 (d:7882) call DelayFrame - call GetJoypadStateLowSensitivity + call JoypadLowSensitivity ld a, [$ffb5] and $1 ret z ld hl, wTrainerSpriteOffset ld a, [hl] dec a - ld de, $cd4d + ld de, wcd4d jr z, .skip dec a - ld de, $cd4e + ld de, wcd4e jr z, .skip .loop inc [hl] @@ -824,18 +821,18 @@ SlotMachine_37882: ; 37882 (d:7882) LoadSlotMachineTiles: ; 378a8 (d:78a8) call DisableLCD ld hl, SlotMachineTiles2 - ld de, $8000 - ld bc, $01c0 + ld de, vChars0 + ld bc, $1c0 ld a, BANK(SlotMachineTiles2) call FarCopyData2 ld hl, SlotMachineTiles1 - ld de, $9000 - ld bc, $0250 + ld de, vChars2 + ld bc, $250 ld a, BANK(SlotMachineTiles1) call FarCopyData2 ld hl, SlotMachineTiles2 - ld de, $9250 - ld bc, $01c0 + ld de, vChars2 + $250 + ld bc, $1c0 ld a, BANK(SlotMachineTiles2) call FarCopyData2 ld hl, SlotMachineMap diff --git a/engine/titlescreen.asm b/engine/titlescreen.asm index 113a55a8..10c5fad4 100755 --- a/engine/titlescreen.asm +++ b/engine/titlescreen.asm @@ -5,21 +5,21 @@ CopyFixedLengthText: ; 42b1 (1:42b1) SetDefaultNamesBeforeTitlescreen: ; 42b7 (1:42b7) ld hl, NintenText - ld de, W_PLAYERNAME ; $d158 + ld de, wPlayerName ; wd158 call CopyFixedLengthText ld hl, SonyText - ld de, W_RIVALNAME ; $d34a + ld de, W_RIVALNAME ; wd34a call CopyFixedLengthText xor a ld [$ffb0], a - ld [$d358], a - ld hl, $d732 + ld [wd358], a + ld hl, wd732 ld [hli], a ld [hli], a ld [hl], a - ld a, Bank(Func_7d8ea) - ld [$c0ef], a - ld [$c0f0], a + ld a, BANK(Music_TitleScreen) + ld [wc0ef], a + ld [wc0f0], a LoadTitlescreenGraphics: ; 42dd (1:42dd) call GBPalWhiteOut @@ -36,40 +36,39 @@ LoadTitlescreenGraphics: ; 42dd (1:42dd) call DisableLCD call LoadFontTilePatterns ld hl, NintendoCopyrightLogoGraphics ; $60c8 - ld de, $9410 + ld de, vTitleLogo2 + $100 ld bc, $50 ld a, BANK(NintendoCopyrightLogoGraphics) call FarCopyData2 ld hl, GamefreakLogoGraphics ; $61f8 - ld de, $9460 + ld de, vTitleLogo2 + $100 + $50 ld bc, $90 ld a, BANK(GamefreakLogoGraphics) call FarCopyData2 ld hl, PokemonLogoGraphics ; $5380 - ld de, $8800 + ld de, vTitleLogo ld bc, $600 ld a, BANK(PokemonLogoGraphics) call FarCopyData2 ; first chunk ld hl, PokemonLogoGraphics+$600 ; $5980 - ld de, $9310 + ld de, vTitleLogo2 ld bc, $100 ld a, BANK(PokemonLogoGraphics) call FarCopyData2 ; second chunk ld hl, Version_GFX ; $402f IF _RED - ld de,$9600 ; where to put redgreenversion.2bpp in the VRAM - ld bc,$50 ; how big that file is + ld de,vChars2 + $600 + ld bc,$50 ENDC IF _BLUE - ld de,$9610 ; where to put blueversion.2bpp in the VRAM - ld bc,$40 ; how big that file is + ld de,vChars2 + $600 + $10 + ld bc,$50 - $10 ENDC ld a, BANK(Version_GFX) call FarCopyDataDouble call Func_4519 - FuncCoord 2, 1 ; $c3b6 - ld hl, Coord + hlCoord 2, 1 ld a, $80 ld de, $14 ld c, $6 @@ -85,8 +84,7 @@ ENDC add hl, de dec c jr nz, .asm_434d - FuncCoord 2, 7 ; $c42e - ld hl, Coord + hlCoord 2, 7 ld a, $31 ld b, $10 .asm_4361 @@ -95,11 +93,10 @@ ENDC dec b jr nz, .asm_4361 call Func_44dd - ld hl, $c328 + ld hl, wOAMBuffer + $28 ld a, $74 ld [hl], a - FuncCoord 2, 17 ; $c4f6 - ld hl, Coord + hlCoord 2, 17 ld de, .titlescreenTilemap ; $437f ld b, $10 .asm_4377 @@ -124,7 +121,7 @@ IF _BLUE ld a,SQUIRTLE ; which Pokemon to show first on the title screen ENDC - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ; wWhichTrade call Func_4524 ld a, $9b call Func_4533 @@ -206,10 +203,10 @@ ENDC call Delay3 call WaitForSoundToFinish ld a, MUSIC_TITLE_SCREEN - ld [$c0ee], a + ld [wc0ee], a call PlaySound xor a - ld [$cc5b], a + ld [wcc5b], a .asm_443b ld c, $c8 call CheckForUserInterruption @@ -222,11 +219,11 @@ ENDC call Func_4496 jr .asm_443b .asm_4459 - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade call PlayCry call WaitForSoundToFinish call GBPalWhiteOutWithDelay3 - call CleanLCD_OAM + call ClearSprites xor a ld [$ffb0], a inc a @@ -238,7 +235,7 @@ ENDC call Func_4533 call Delay3 call LoadGBPal - ld a, [H_CURRENTPRESSEDBUTTONS] + ld a, [hJoyHeld] ld b, a and $46 cp $46 @@ -256,14 +253,14 @@ Func_4496: ; 4496 (1:4496) .new ; Generate a new TitleMon. - call GenRandom + call Random and $f ld c, a ld b, 0 ld hl, TitleMons add hl, bc ld a, [hl] - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade ; Can't be the same as before. cp [hl] @@ -275,12 +272,12 @@ Func_4496: ; 4496 (1:4496) ld a, $90 ld [$ffb0], a ld d, 1 ; scroll out - callba TitleScroll ; indirect jump to TitleScroll (37258 (d:7258)) + callba TitleScroll ret Func_44c1: ; 44c1 (1:44c1) ld d, 0 ; scroll in - callba TitleScroll ; indirect jump to TitleScroll (37258 (d:7258)) + callba TitleScroll xor a ld [$ffb0], a ret @@ -302,13 +299,13 @@ Func_44cf: ; 44cf (1:44cf) Func_44dd: ; 44dd (1:44dd) ld hl, PlayerCharacterTitleGraphics ; $66a8 - ld de, $8000 + ld de, vSprites ld bc, $230 ld a, BANK(PlayerCharacterTitleGraphics) call FarCopyData2 - call CleanLCD_OAM + call ClearSprites xor a - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ; wWhichTrade ld hl, wOAMBuffer ld de, $605a ld b, $7 @@ -322,10 +319,10 @@ Func_44dd: ; 44dd (1:44dd) ld [hli], a add $8 ld e, a - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade ld [hli], a inc a - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ; wWhichTrade inc hl dec c jr nz, .asm_44fd @@ -338,16 +335,15 @@ Func_44dd: ; 44dd (1:44dd) ret Func_4519: ; 4519 (1:4519) - ld hl, $9800 + ld hl, vBGMap0 ld bc, $800 ld a, $7f jp FillMemory Func_4524: ; 4524 (1:4524) - ld [$cf91], a - ld [$d0b5], a - FuncCoord 5, 10 ; $c46d - ld hl, Coord + ld [wcf91], a + ld [wd0b5], a + hlCoord 5, 10 call GetMonHeader jp LoadFrontSpriteByMonIndex @@ -363,11 +359,10 @@ LoadCopyrightAndTextBoxTiles: ; 4538 (1:4538) LoadCopyrightTiles: ; 4541 (1:4541) ld de, NintendoCopyrightLogoGraphics ; $60c8 - ld hl, $9600 + ld hl, vChars2 + $600 ld bc, (BANK(NintendoCopyrightLogoGraphics) << 8) + $1c call CopyVideoData - FuncCoord 2, 7 ; $c42e - ld hl, Coord + hlCoord 2, 7 ld de, CopyrightTextString ; $4556 jp PlaceString @@ -381,8 +376,7 @@ INCLUDE "data/title_mons.asm" ; prints version text (red, blue) PrintGameVersionOnTitleScreen: ; 4598 (1:4598) - FuncCoord 7, 8 ; $c447 - ld hl, Coord + hlCoord 7, 8 ld de, VersionOnTitleScreenText jp PlaceString diff --git a/engine/titlescreen2.asm b/engine/titlescreen2.asm index f81d8bb8..dc1c633a 100755 --- a/engine/titlescreen2.asm +++ b/engine/titlescreen2.asm @@ -89,7 +89,7 @@ TitleBallYTable: ; 372a0 (d:72a0) Func_372ac: ; 372ac (d:72ac) ; Animate the TitleBall if a starter just got scrolled out. - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade cp STARTER1 jr z, .ok cp STARTER2 @@ -115,6 +115,6 @@ GetTitleBallY: ; 372c4 (d:72c4) pop de and a ret z - ld [$c328], a + ld [wOAMBuffer + $28], a inc e ret diff --git a/engine/town_map.asm b/engine/town_map.asm index db12c18f..2cd37284 100755 --- a/engine/town_map.asm +++ b/engine/town_map.asm @@ -1,30 +1,29 @@ DisplayTownMap: ; 70e3e (1c:4e3e) call LoadTownMap - ld hl, $cfcb + ld hl, wcfcb ld a, [hl] push af ld [hl], $ff push hl ld a, $1 ld [$ffb7], a - ld a, [W_CURMAP] ; $d35e + ld a, [W_CURMAP] ; W_CURMAP push af ld b, $0 call Func_711c4 - FuncCoord 1, 0 ; $c3a1 - ld hl, Coord - ld de, $cd6d + hlCoord 1, 0 + ld de, wcd6d call PlaceString ld hl, wOAMBuffer ld de, wTileMapBackup ld bc, $10 call CopyData - ld hl, $8040 + ld hl, vSprites + $40 ld de, TownMapCursor ; $4f40 ld bc, (BANK(TownMapCursor) << 8) + $04 call CopyVideoDataDouble xor a - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ; wWhichTrade pop af jr Func_70e92 @@ -33,41 +32,40 @@ Func_70e7e: ; 70e7e (1c:4e7e) ld bc, $114 call ClearScreenArea ld hl, TownMapOrder ; $4f11 - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade ld c, a ld b, $0 add hl, bc ld a, [hl] Func_70e92: ; 70e92 (1c:4e92) - ld de, $cee9 + ld de, wHPBarMaxHP call Func_712f1 ld a, [de] push hl call Func_71258 ld a, $4 - ld [$cd5b], a - ld hl, $c310 + ld [wcd5b], a + ld hl, wOAMBuffer + $10 call Func_71279 pop hl - ld de, $cd6d + ld de, wcd6d .asm_70eac ld a, [hli] ld [de], a inc de cp $50 jr nz, .asm_70eac - FuncCoord 1, 0 ; $c3a1 - ld hl, Coord - ld de, $cd6d + hlCoord 1, 0 + ld de, wcd6d call PlaceString - ld hl, $c310 - ld de, $c518 + ld hl, wOAMBuffer + $10 + ld de, wTileMapBackup + 16 ld bc, $10 call CopyData .asm_70ec8 call Func_716c6 - call GetJoypadStateLowSensitivity + call JoypadLowSensitivity ld a, [$ffb5] ld b, a and $c3 @@ -79,31 +77,31 @@ Func_70e92: ; 70e92 (1c:4e92) bit 7, b jr nz, .asm_70f01 xor a - ld [$d09b], a + ld [wd09b], a ld [$ffb7], a - ld [W_SUBANIMTRANSFORM], a ; $d08b + ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM call Func_711ab pop hl pop af ld [hl], a ret .asm_70ef2 - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade inc a cp $2f jr nz, .asm_70efb xor a .asm_70efb - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ; wWhichTrade jp Func_70e7e .asm_70f01 - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade dec a cp $ff jr nz, .asm_70f0b ld a, $2e .asm_70f0b - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ; wWhichTrade jp Func_70e7e INCLUDE "data/town_map_order.asm" @@ -113,15 +111,14 @@ TownMapCursor: ; 70f40 (1c:4f40) LoadTownMap_Nest: ; 70f60 (1c:4f60) call LoadTownMap - ld hl, $cfcb + ld hl, wcfcb ld a, [hl] push af ld [hl], $ff push hl call Func_711ef call GetMonName - FuncCoord 1, 0 ; $c3a1 - ld hl, Coord + hlCoord 1, 0 call PlaceString ld h, b ld l, c @@ -138,20 +135,20 @@ MonsNestText: ; 70f89 (1c:4f89) db "'s NEST@" LoadTownMap_Fly: ; 70f90 (1c:4f90) - call CleanLCD_OAM + call ClearSprites call LoadTownMap call LoadPlayerSpriteGraphics call LoadFontTilePatterns ld de, BirdSprite ; $4d80 - ld hl, $8040 + ld hl, vSprites + $40 ld bc, (BANK(BirdSprite) << 8) + $0c call CopyVideoData ld de, TownMapUpArrow ; $5093 - ld hl, $8ed0 + ld hl, vChars1 + $6d0 ld bc, (BANK(TownMapUpArrow) << 8) + $01 call CopyVideoDataDouble call Func_71070 - ld hl, $cfcb + ld hl, wcfcb ld a, [hl] push af ld [hl], $ff @@ -159,43 +156,38 @@ LoadTownMap_Fly: ; 70f90 (1c:4f90) ld hl, wTileMap ld de, ToText call PlaceString - ld a, [W_CURMAP] ; $d35e + ld a, [W_CURMAP] ; W_CURMAP ld b, $0 call Func_711c4 - ld hl, $cd3e - FuncCoord 18, 0 ; $c3b2 - ld de, Coord + ld hl, wTrainerEngageDistance + deCoord 18, 0 .townMapFlyLoop ld a, $7f ld [de], a push hl push hl - FuncCoord 3, 0 ; $c3a3 - ld hl, Coord + hlCoord 3, 0 ld bc, $10f call ClearScreenArea pop hl ld a, [hl] ld b, $4 call Func_711c4 - FuncCoord 3, 0 ; $c3a3 - ld hl, Coord - ld de, $cd6d + hlCoord 3, 0 + ld de, wcd6d call PlaceString ld c, $f call DelayFrames - FuncCoord 18, 0 ; $c3b2 - ld hl, Coord + hlCoord 18, 0 ld [hl], $ed - FuncCoord 19, 0 ; $c3b3 - ld hl, Coord + hlCoord 19, 0 ld [hl], $ee pop hl .asm_71004 push hl call DelayFrame - call GetJoypadStateLowSensitivity + call JoypadLowSensitivity ld a, [$ffb5] ld b, a pop hl @@ -214,22 +206,21 @@ LoadTownMap_Fly: ; 70f90 (1c:4f90) ld a, (SFX_02_3e - SFX_Headers_02) / 3 call PlaySound ld a, [hl] - ld [$d71a], a - ld hl, $d732 + ld [wd71a], a + ld hl, wd732 set 3, [hl] inc hl set 7, [hl] .asm_71037 xor a - ld [$d09b], a + ld [wd09b], a call GBPalWhiteOutWithDelay3 pop hl pop af ld [hl], a ret .asm_71042 - FuncCoord 18, 0 ; $c3b2 - ld de, Coord + deCoord 18, 0 inc hl ld a, [hl] cp $ff @@ -238,11 +229,10 @@ LoadTownMap_Fly: ; 70f90 (1c:4f90) jr z, .asm_71042 jp .townMapFlyLoop .asm_71052 - ld hl, $cd3e + ld hl, wTrainerEngageDistance jp .townMapFlyLoop .asm_71058 - FuncCoord 19, 0 ; $c3b3 - ld de, Coord + deCoord 19, 0 dec hl ld a, [hl] cp $ff @@ -251,19 +241,19 @@ LoadTownMap_Fly: ; 70f90 (1c:4f90) jr z, .asm_71058 jp .townMapFlyLoop .asm_71068 - ld hl, $cd49 + ld hl, wcd49 jr .asm_71058 ToText: ; 7106d (1c:506d) db "To@" Func_71070: ; 71070 (1c:5070) - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade ld [hl], $ff inc hl - ld a, [$d70b] + ld a, [W_TOWNVISITEDFLAG] ld e, a - ld a, [$d70c] + ld a, [W_TOWNVISITEDFLAG + 1] ld d, a ld bc, $b .asm_71081 @@ -294,12 +284,12 @@ LoadTownMap: ; 7109b (1c:509b) call TextBoxBorder call DisableLCD ld hl, WorldMapTileGraphics ; $65a8 - ld de, $9600 + ld de, vChars2 + $600 ld bc, $100 ld a, BANK(WorldMapTileGraphics) call FarCopyData2 ld hl, MonNestIcon ; $56be - ld de, $8040 + ld de, vSprites + $40 ld bc, $8 ld a, BANK(MonNestIcon) call FarCopyDataDouble @@ -329,9 +319,9 @@ LoadTownMap: ; 7109b (1c:509b) call Delay3 call GBPalNormal xor a - ld [W_SUBANIMTRANSFORM], a ; $d08b + ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM inc a - ld [$d09b], a + ld [wd09b], a ret CompressedMap: ; 71100 (1c:5100) @@ -340,10 +330,10 @@ CompressedMap: ; 71100 (1c:5100) Func_711ab: ; 711ab (1c:51ab) xor a - ld [$d09b], a + ld [wd09b], a call GBPalWhiteOut call ClearScreen - call CleanLCD_OAM + call ClearSprites call LoadPlayerSpriteGraphics call LoadFontTilePatterns call UpdateSprites @@ -352,16 +342,16 @@ Func_711ab: ; 711ab (1c:51ab) Func_711c4: ; 711c4 (1c:51c4) push af ld a, b - ld [$cd5b], a + ld [wcd5b], a pop af - ld de, $cee9 + ld de, wHPBarMaxHP call Func_712f1 ld a, [de] push hl call Func_71258 call Func_7126d pop hl - ld de, $cd6d + ld de, wcd6d .asm_711dc ld a, [hli] ld [de], a @@ -377,7 +367,7 @@ Func_711ef: ; 711ef (1c:51ef) callba Func_e9cb call Func_712d9 ld hl, wOAMBuffer - ld de, $cee9 + ld de, wHPBarMaxHP .asm_71200 ld a, [de] cp $ff @@ -402,18 +392,16 @@ Func_711ef: ; 711ef (1c:51ef) ld a, l and a jr nz, .asm_71236 - FuncCoord 1, 7 ; $c42d - ld hl, Coord + hlCoord 1, 7 ld b, $2 ld c, $f call TextBoxBorder - FuncCoord 2, 9 ; $c456 - ld hl, Coord + hlCoord 2, 9 ld de, AreaUnknownText call PlaceString jr .asm_7123e .asm_71236 - ld a, [W_CURMAP] ; $d35e + ld a, [W_CURMAP] ; W_CURMAP ld b, $0 call Func_711c4 .asm_7123e @@ -442,11 +430,11 @@ Func_71258: ; 71258 (1c:5258) ret Func_7126d: ; 7126d (1c:526d) - ld a, [$cd5b] + ld a, [wcd5b] and a - ld hl, $c390 + ld hl, wOAMBuffer + $90 jr z, Func_71279 - ld hl, $c380 + ld hl, wOAMBuffer + $80 Func_71279: ; 71279 (1c:5279) push hl @@ -466,10 +454,10 @@ Func_71281: ; 71281 (1c:5281) ld [hli], a ld a, c ld [hli], a - ld a, [$cd5b] + ld a, [wcd5b] ld [hli], a inc a - ld [$cd5b], a + ld [wcd5b], a xor a ld [hli], a inc d @@ -489,7 +477,7 @@ Func_71281: ; 71281 (1c:5281) Func_712a6: ; 712a6 (1c:52a6) xor a - ld [$cd5c], a + ld [wcd5c], a ld de, $202 .asm_712ad push de @@ -499,12 +487,12 @@ Func_712a6: ; 712a6 (1c:52a6) ld [hli], a ld a, c ld [hli], a - ld a, [$cd5b] + ld a, [wcd5b] ld [hli], a - ld a, [$cd5c] + ld a, [wcd5c] ld [hli], a xor $20 - ld [$cd5c], a + ld [wcd5c], a inc d ld a, $8 add c @@ -514,7 +502,7 @@ Func_712a6: ; 712a6 (1c:52a6) pop bc pop de push hl - ld hl, $cd5b + ld hl, wcd5b inc [hl] inc [hl] pop hl @@ -526,7 +514,7 @@ Func_712a6: ; 712a6 (1c:52a6) ret Func_712d9: ; 712d9 (1c:52d9) - ld de, $cee9 + ld de, wHPBarMaxHP .asm_712dc ld a, [de] inc de @@ -583,7 +571,7 @@ MonNestIcon: ; 716be (1c:56be) INCBIN "gfx/mon_nest_icon.1bpp" Func_716c6: ; 716c6 (1c:56c6) - ld a, [W_SUBANIMTRANSFORM] ; $d08b + ld a, [W_SUBANIMTRANSFORM] ; W_SUBANIMTRANSFORM inc a cp $19 jr z, .asm_716e1 @@ -606,5 +594,5 @@ Func_716c6: ; 716c6 (1c:56c6) jr nz, .asm_716e9 ld a, $19 .asm_716f1 - ld [W_SUBANIMTRANSFORM], a ; $d08b + ld [W_SUBANIMTRANSFORM], a ; W_SUBANIMTRANSFORM jp DelayFrame diff --git a/engine/trade.asm b/engine/trade.asm index fa579cc7..54abdab6 100755 --- a/engine/trade.asm +++ b/engine/trade.asm @@ -1,27 +1,27 @@ Func_410e2: ; 410e2 (10:50e2) - ld a, [wWhichTrade] ; $cd3d - ld [$cd5e], a + ld a, [wWhichTrade] ; wWhichTrade + ld [wcd5e], a ld a, [wTrainerEngageDistance] - ld [$cd5f], a + ld [wcd5f], a ld de, PointerIDs_41138 ; $5138 jr Func_41102 Func_410f3: ; 410f3 (10:50f3) ld a, [wTrainerEngageDistance] - ld [$cd5e], a + ld [wcd5e], a ld a, [wTrainerSpriteOffset] - ld [$cd5f], a + ld [wcd5f], a ld de, PointerIDs_41149 Func_41102: ; 41102 (10:5102) - ld a, [W_OPTIONS] ; $d355 + ld a, [W_OPTIONS] ; W_OPTIONS push af ld a, [$ffaf] push af ld a, [$ffae] push af xor a - ld [W_OPTIONS], a ; $d355 + ld [W_OPTIONS], a ; W_OPTIONS ld [$ffaf], a ld [$ffae], a push de @@ -49,7 +49,7 @@ Func_41102: ; 41102 (10:5102) pop af ld [$ffaf], a pop af - ld [W_OPTIONS], a ; $d355 + ld [W_OPTIONS], a ; W_OPTIONS ret ; these bytes refer to the $00th through $10th pointer of PointerTable_4115f @@ -104,25 +104,25 @@ LoadTradingGFXAndMonNames: ; 411a1 (10:51a1) call Func_41196 call DisableLCD ld hl, TradingAnimationGraphics ; $69be - ld de, $9310 + ld de, vChars2 + $310 ld bc, $310 ld a, BANK(TradingAnimationGraphics) call FarCopyData2 ld hl, TradingAnimationGraphics2 ; $6cce - ld de, $87c0 + ld de, vSprites + $7c0 ld bc, $40 ld a, BANK(TradingAnimationGraphics2) call FarCopyData2 - ld hl, $9800 + ld hl, vBGMap0 ld bc, $800 ld a, $7f call FillMemory - call CleanLCD_OAM + call ClearSprites ld a, $ff - ld [$cfcb], a - ld hl, $d730 + ld [wcfcb], a + ld hl, wd730 set 6, [hl] - ld a, [$cf1b] + ld a, [wcf1b] and a ld a, $e4 jr z, .asm_411e5 @@ -132,15 +132,15 @@ LoadTradingGFXAndMonNames: ; 411a1 (10:51a1) call EnableLCD xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - ld a, [wWhichTrade] ; $cd3d - ld [$d11e], a + ld a, [wWhichTrade] ; wWhichTrade + ld [wd11e], a call GetMonName - ld hl, $cd6d - ld de, $cf4b + ld hl, wcd6d + ld de, wcf4b ld bc, $b call CopyData - ld a, [$cd3e] - ld [$d11e], a + ld a, [wTrainerEngageDistance] + ld [wd11e], a jp GetMonName Func_4120b: ; 4120b (10:520b) @@ -151,12 +151,12 @@ Func_4120b: ; 4120b (10:520b) jp Bankswitch Func_41217: ; 41217 (10:5217) - ld hl, W_PLAYERNAME + ld hl, wPlayerName ld de, wHPBarMaxHP ld bc, $000b call CopyData ld hl, W_GRASSRATE - ld de, W_PLAYERNAME + ld de, wPlayerName ld bc, $000b call CopyData ld hl, wHPBarMaxHP @@ -167,7 +167,7 @@ Func_41217: ; 41217 (10:5217) Func_4123b: ; 4123b (10:523b) xor a call LoadGBPal - ld hl, $d730 + ld hl, wd730 res 6, [hl] ret @@ -181,8 +181,7 @@ Func_41245: ; 41245 (10:5245) ld [$ffae], a xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - FuncCoord 4, 0 ; $c3a4 - ld hl, Coord + hlCoord 4, 0 ld b, $6 ld c, $a call TextBoxBorder @@ -190,7 +189,7 @@ Func_41245: ; 41245 (10:5245) ld b, $98 call CopyScreenTileBufferToVRAM call ClearScreen - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade call Func_415a4 ld a, $7e .asm_41273 @@ -208,7 +207,7 @@ Func_41245: ; 41245 (10:5245) call Func_41676 ld a, $aa call Func_41676 - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade call PlayCry xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba @@ -220,15 +219,14 @@ Func_41298: ; 41298 (10:5298) call CopyScreenTileBufferToVRAM ld b, $8 call GoPAL_SET - ld hl, $9c8c + ld hl, vBGMap1 + $8c call Func_414ae ld a, $a0 ld [$ffae], a call DelayFrame ld a, $8b ld [rLCDC], a ; $ff40 - FuncCoord 6, 2 ; $c3ce - ld hl, Coord + hlCoord 6, 2 ld b, $7 call Func_41842 call Func_41186 @@ -251,18 +249,18 @@ Func_412d2: ; 412d2 (10:52d2) ld a, $e4 ld [rOBP0], a ; $ff48 xor a - ld [$d09f], a + ld [wd09f], a ld bc, $2060 .asm_412e7 push bc xor a ld de, UnknownOAM_4132e ; $532e call WriteOAMBlock - ld a, [$d09f] + ld a, [wd09f] xor $1 - ld [$d09f], a + ld [wd09f], a add $7e - ld hl, $c302 + ld hl, wOAMBuffer + $02 ld de, $4 ld c, e .asm_41300 @@ -281,7 +279,7 @@ Func_412d2: ; 412d2 (10:52d2) call PlaySound jr .asm_412e7 .asm_41318 - call CleanLCD_OAM + call ClearSprites ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba call ClearScreen @@ -300,8 +298,7 @@ Func_41336: ; 41336 (10:5336) ld a, $ac call Func_41676 call Func_415c8 - FuncCoord 4, 10 ; $c46c - ld hl, Coord + hlCoord 4, 10 ld b, $6 ld c, $a call TextBoxBorder @@ -309,17 +306,16 @@ Func_41336: ; 41336 (10:5336) call Func_41186 ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - ld a, [$cd3e] + ld a, [wTrainerEngageDistance] call Func_415a4 ld a, $ad call Func_41676 ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - ld a, [$cd3e] + ld a, [wTrainerEngageDistance] call PlayCry call Func_41181 - FuncCoord 4, 10 ; $c46c - ld hl, Coord + hlCoord 4, 10 ld bc, $80c call ClearScreenArea jp PrintTradeTakeCareText @@ -327,20 +323,20 @@ Func_41336: ; 41336 (10:5336) Func_41376: ; 41376 (10:5376) call Func_41411 ld a, $1 - ld [$d08a], a + ld [wd08a], a ld a, $e4 ld [rOBP0], a ; $ff48 ld a, $54 - ld [W_BASECOORDX], a ; $d081 + ld [W_BASECOORDX], a ; wd081 ld a, $1c - ld [W_BASECOORDY], a ; $d082 - ld a, [$cd5e] - ld [$cd5d], a + ld [W_BASECOORDY], a ; wd082 + ld a, [wcd5e] + ld [wcd5d], a call Func_41505 call Func_4142d call Func_41186 call Func_4149f - ld hl, $9c8c + ld hl, vBGMap1 + $8c call Func_414ae ld b, $6 call Func_414c5 @@ -355,23 +351,23 @@ Func_41376: ; 41376 (10:5376) xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba call Func_41525 - jp CleanLCD_OAM + jp ClearSprites Func_413c6: ; 413c6 (10:53c6) call Func_41411 xor a - ld [$d08a], a + ld [wd08a], a ld a, $64 - ld [W_BASECOORDX], a ; $d081 + ld [W_BASECOORDX], a ; wd081 ld a, $44 - ld [W_BASECOORDY], a ; $d082 - ld a, [$cd5f] - ld [$cd5d], a + ld [W_BASECOORDY], a ; wd082 + ld a, [wcd5f] + ld [wcd5d], a call Func_41505 call Func_4145c call Func_41186 call Func_4149f - ld hl, $9c94 + ld hl, vBGMap1 + $94 call Func_414ae call Func_41525 ld b, $6 @@ -386,7 +382,7 @@ Func_413c6: ; 413c6 (10:53c6) call Func_414c5 xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - jp CleanLCD_OAM + jp ClearSprites Func_41411: ; 41411 (10:5411) ld a, $1 @@ -406,8 +402,7 @@ Func_41411: ; 41411 (10:5411) Func_4142d: ; 4142d (10:542d) call Func_41196 - FuncCoord 11, 4 ; $c3fb - ld hl, Coord + hlCoord 11, 4 ld a, $5d ld [hli], a ld a, $5e @@ -416,25 +411,21 @@ Func_4142d: ; 4142d (10:542d) ld [hli], a dec c jr nz, .asm_4143a - FuncCoord 5, 3 ; $c3e1 - ld hl, Coord + hlCoord 5, 3 ld b, $6 call Func_41842 - FuncCoord 4, 12 ; $c494 - ld hl, Coord + hlCoord 4, 12 ld b, $2 ld c, $7 call TextBoxBorder - FuncCoord 5, 14 ; $c4bd - ld hl, Coord - ld de, W_PLAYERNAME ; $d158 + hlCoord 5, 14 + ld de, wPlayerName ; wd158 call PlaceString jp DelayFrame Func_4145c: ; 4145c (10:545c) call Func_41196 - FuncCoord 0, 4 ; $c3f0 - ld hl, Coord + hlCoord 0, 4 ld a, $5e ld c, $e .asm_41466 @@ -458,25 +449,21 @@ Func_4145c: ; 4145c (10:545c) ld [hld], a ld a, $5d ld [hl], a - FuncCoord 7, 8 ; $c447 - ld hl, Coord + hlCoord 7, 8 ld b, $6 call Func_41842 - FuncCoord 6, 0 ; $c3a6 - ld hl, Coord + hlCoord 6, 0 ld b, $2 ld c, $7 call TextBoxBorder - FuncCoord 7, 2 ; $c3cf - ld hl, Coord - ld de, W_GRASSRATE ; $d887 + hlCoord 7, 2 + ld de, W_GRASSRATE ; W_GRASSRATE call PlaceString jp DelayFrame Func_4149f: ; 4149f (10:549f) call Func_41196 - FuncCoord 0, 4 ; $c3f0 - ld hl, Coord + hlCoord 0, 4 ld a, $5e ld c, $14 .asm_414a9 @@ -487,12 +474,11 @@ Func_4149f: ; 4149f (10:549f) Func_414ae: ; 414ae (10:54ae) push hl - FuncCoord 0, 4 ; $c3f0 - ld hl, Coord + hlCoord 0, 4 call ScheduleRowRedrawHelper pop hl ld a, h - ld [$ffd2], a + ld [H_SCREENEDGEREDRAWADDR + 1], a ld a, l ld [H_SCREENEDGEREDRAWADDR], a ; $ffd1 ld a, $2 @@ -501,7 +487,7 @@ Func_414ae: ; 414ae (10:54ae) jp DelayFrames Func_414c5: ; 414c5 (10:54c5) - ld a, [$d08a] + ld a, [wd08a] ld e, a ld d, $8 .asm_414cb @@ -531,7 +517,7 @@ Func_414e8: ; 414e8 (10:54e8) ld a, [rBGP] ; $ff47 xor $3c ld [rBGP], a ; $ff47 - ld hl, $c302 + ld hl, wOAMBuffer + $02 ld de, $4 ld c, $14 .asm_414f9 @@ -554,10 +540,10 @@ Func_41510: ; 41510 (10:5510) ld hl, wOAMBuffer ld c, $14 .asm_41515 - ld a, [W_BASECOORDY] ; $d082 + ld a, [W_BASECOORDY] ; wd082 add [hl] ld [hli], a - ld a, [W_BASECOORDX] ; $d081 + ld a, [W_BASECOORDX] ; wd081 add [hl] ld [hli], a inc hl @@ -567,7 +553,7 @@ Func_41510: ; 41510 (10:5510) ret Func_41525: ; 41525 (10:5525) - ld a, [$d08a] + ld a, [wd08a] and a jr z, .asm_41536 ld bc, $400 @@ -580,9 +566,9 @@ Func_41525: ; 41525 (10:5525) ld bc, $fc00 .asm_4153f ld a, b - ld [W_BASECOORDX], a ; $d081 + ld [W_BASECOORDX], a ; wd081 ld a, c - ld [W_BASECOORDY], a ; $d082 + ld [W_BASECOORDY], a ; wd082 ld d, $4 .asm_41549 call Func_41510 @@ -645,9 +631,9 @@ UnknownOAM_4159c: ; 4159c (10:559c) db $39,$70,$38,$70 Func_415a4: ; 415a4 (10:55a4) - ld [$cf91], a - ld [$d0b5], a - ld [$cf1d], a + ld [wcf91], a + ld [wd0b5], a + ld [wcf1d], a ld b, $b ld c, $0 call GoPAL_SET @@ -655,8 +641,7 @@ Func_415a4: ; 415a4 (10:55a4) xor $1 ld [H_AUTOBGTRANSFERENABLED], a ; $ffba call GetMonHeader - FuncCoord 7, 2 ; $c3cf - ld hl, Coord + hlCoord 7, 2 call LoadFlippedFrontSpriteByMonIndex ld c, $a jp DelayFrames @@ -763,8 +748,7 @@ TradeforText: ; 41671 (10:5671) db "@" Func_41676: ; 41676 (10:5676) - ld [W_ANIMATIONID], a ; $d07c + ld [W_ANIMATIONID], a ; W_ANIMATIONID xor a - ld [$cc5b], a - ld a, $8 - jp Predef ; indirect jump to MoveAnimation (78d5e (1e:4d5e)) + ld [wcc5b], a + predef_jump MoveAnimation diff --git a/engine/trade2.asm b/engine/trade2.asm index 9f793fac..b13a18b6 100755 --- a/engine/trade2.asm +++ b/engine/trade2.asm @@ -1,56 +1,44 @@ Func_42769: ; 42769 (10:6769) - FuncCoord 5,0 - ld hl,Coord + hlCoord 5, 0 ld de,OTString67E5 call PlaceString - ld a,[$CD3D] - ld [$D11E],a - ld a,$3A - call Predef - FuncCoord 9, 0 ; $c3a9 - ld hl,Coord - ld de,$D11E + ld a,[wWhichTrade] + ld [wd11e],a + predef IndexToPokedex + hlCoord 9, 0 + ld de,wd11e ld bc,$8103 call PrintNumber - FuncCoord 5,2 - ld hl,Coord - ld de,$CF4B + hlCoord 5, 2 + ld de,wcf4b call PlaceString - FuncCoord 8,4 - ld hl,Coord - ld de,$CD41 + hlCoord 8, 4 + ld de,wTrainerScreenX call PlaceString - FuncCoord 8, 6 ; $c420 - ld hl,Coord - ld de,$CD4C + hlCoord 8, 6 + ld de,wcd4c ld bc,$8205 jp PrintNumber Func_427a7: ; 427a7 (10:67a7) - FuncCoord 5,10 - ld hl,Coord + hlCoord 5, 10 ld de,OTString67E5 call PlaceString - ld a,[$CD3E] - ld [$D11E],a - ld a,$3A - call Predef - FuncCoord 9, 10 ; $c471 - ld hl,Coord - ld de,$D11E + ld a,[wTrainerEngageDistance] + ld [wd11e],a + predef IndexToPokedex + hlCoord 9, 10 + ld de,wd11e ld bc,$8103 call PrintNumber - FuncCoord 5,12 - ld hl,Coord - ld de,$CD6D + hlCoord 5, 12 + ld de,wcd6d call PlaceString - FuncCoord 8,14 - ld hl,Coord - ld de,$CD4E + hlCoord 8, 14 + ld de,wcd4e call PlaceString - FuncCoord 8, 16 ; $c4e8 - ld hl,Coord - ld de,$CD59 + hlCoord 8, 16 + ld de,wcd59 ld bc,$8205 jp PrintNumber diff --git a/gfx/badges.w16.png b/gfx/badges.png Binary files differindex 8b0fc516..8b0fc516 100644 --- a/gfx/badges.w16.png +++ b/gfx/badges.png diff --git a/gfx/blue/blueversion.h8.png b/gfx/blue/blueversion.png Binary files differindex dd7e2b6f..dd7e2b6f 100644 --- a/gfx/blue/blueversion.h8.png +++ b/gfx/blue/blueversion.png diff --git a/gfx/blue/sgbborder.w128.png b/gfx/blue/sgbborder.png Binary files differindex 098df2b6..098df2b6 100644 --- a/gfx/blue/sgbborder.w128.png +++ b/gfx/blue/sgbborder.png diff --git a/gfx/copyright.h8.png b/gfx/copyright.png Binary files differindex 49174349..49174349 100644 --- a/gfx/copyright.h8.png +++ b/gfx/copyright.png diff --git a/gfx/emotion_bubbles.w16.png b/gfx/emotion_bubbles.png Binary files differindex 31deacf4..31deacf4 100644 --- a/gfx/emotion_bubbles.w16.png +++ b/gfx/emotion_bubbles.png diff --git a/gfx/font.w128.png b/gfx/font.png Binary files differindex d5548c09..d5548c09 100644 --- a/gfx/font.w128.png +++ b/gfx/font.png diff --git a/gfx/gamefreak.h8.png b/gfx/gamefreak.png Binary files differindex 509232bd..509232bd 100644 --- a/gfx/gamefreak.h8.png +++ b/gfx/gamefreak.png diff --git a/gfx/gamefreak_intro.h8.png b/gfx/gamefreak_intro.png Binary files differindex 0fa6832c..0fa6832c 100644 --- a/gfx/gamefreak_intro.h8.png +++ b/gfx/gamefreak_intro.png diff --git a/gfx/hp_bar_and_status.w80.png b/gfx/hp_bar_and_status.w80.png Binary files differdeleted file mode 100644 index 79830885..00000000 --- a/gfx/hp_bar_and_status.w80.png +++ /dev/null diff --git a/gfx/pokemon_logo.w128.png b/gfx/pokemon_logo.png Binary files differindex cc7582c5..cc7582c5 100644 --- a/gfx/pokemon_logo.w128.png +++ b/gfx/pokemon_logo.png diff --git a/gfx/red/redgreenversion.h8.png b/gfx/red/redgreenversion.png Binary files differindex 8b34ec09..8b34ec09 100644 --- a/gfx/red/redgreenversion.h8.png +++ b/gfx/red/redgreenversion.png diff --git a/gfx/red/sgbborder.w128.png b/gfx/red/sgbborder.png Binary files differindex 7549bb47..7549bb47 100644 --- a/gfx/red/sgbborder.w128.png +++ b/gfx/red/sgbborder.png diff --git a/gfx/theend.w40.interleave.png b/gfx/theend.interleave.png Binary files differindex 025ebb61..025ebb61 100644 --- a/gfx/theend.w40.interleave.png +++ b/gfx/theend.interleave.png diff --git a/gfx/tilesets/cavern.w128.t14.png b/gfx/tilesets/cavern.t14.png Binary files differindex 5397fd65..5397fd65 100644 --- a/gfx/tilesets/cavern.w128.t14.png +++ b/gfx/tilesets/cavern.t14.png diff --git a/gfx/tilesets/cemetery.w128.t4.png b/gfx/tilesets/cemetery.t4.png Binary files differindex b1df015a..b1df015a 100644 --- a/gfx/tilesets/cemetery.w128.t4.png +++ b/gfx/tilesets/cemetery.t4.png diff --git a/gfx/tilesets/club.w128.t5.png b/gfx/tilesets/club.t5.png Binary files differindex 05a55879..05a55879 100644 --- a/gfx/tilesets/club.w128.t5.png +++ b/gfx/tilesets/club.t5.png diff --git a/gfx/tilesets/facility.w128.png b/gfx/tilesets/facility.png Binary files differindex 3654900e..3654900e 100644 --- a/gfx/tilesets/facility.w128.png +++ b/gfx/tilesets/facility.png diff --git a/gfx/tilesets/forest.w128.png b/gfx/tilesets/forest.png Binary files differindex fd534d48..fd534d48 100644 --- a/gfx/tilesets/forest.w128.png +++ b/gfx/tilesets/forest.png diff --git a/gfx/tilesets/gate.w128.t1.png b/gfx/tilesets/gate.t1.png Binary files differindex 372e6751..372e6751 100644 --- a/gfx/tilesets/gate.w128.t1.png +++ b/gfx/tilesets/gate.t1.png diff --git a/gfx/tilesets/gym.w128.png b/gfx/tilesets/gym.png Binary files differindex bffb472b..bffb472b 100644 --- a/gfx/tilesets/gym.w128.png +++ b/gfx/tilesets/gym.png diff --git a/gfx/tilesets/house.w128.t2.png b/gfx/tilesets/house.t2.png Binary files differindex b5d67c95..b5d67c95 100644 --- a/gfx/tilesets/house.w128.t2.png +++ b/gfx/tilesets/house.t2.png diff --git a/gfx/tilesets/interior.w128.t1.png b/gfx/tilesets/interior.t1.png Binary files differindex 3123d81c..3123d81c 100644 --- a/gfx/tilesets/interior.w128.t1.png +++ b/gfx/tilesets/interior.t1.png diff --git a/gfx/tilesets/lab.w128.t4.png b/gfx/tilesets/lab.t4.png Binary files differindex 4a114337..4a114337 100644 --- a/gfx/tilesets/lab.w128.t4.png +++ b/gfx/tilesets/lab.t4.png diff --git a/gfx/tilesets/lobby.w128.t2.png b/gfx/tilesets/lobby.t2.png Binary files differindex f2a1c180..f2a1c180 100644 --- a/gfx/tilesets/lobby.w128.t2.png +++ b/gfx/tilesets/lobby.t2.png diff --git a/gfx/tilesets/mansion.w128.t2.png b/gfx/tilesets/mansion.t2.png Binary files differindex 557c23b4..557c23b4 100644 --- a/gfx/tilesets/mansion.w128.t2.png +++ b/gfx/tilesets/mansion.t2.png diff --git a/gfx/tilesets/overworld.w128.t2.png b/gfx/tilesets/overworld.t2.png Binary files differindex c7533e40..c7533e40 100644 --- a/gfx/tilesets/overworld.w128.t2.png +++ b/gfx/tilesets/overworld.t2.png diff --git a/gfx/tilesets/plateau.w128.t10.png b/gfx/tilesets/plateau.t10.png Binary files differindex b87162d8..b87162d8 100644 --- a/gfx/tilesets/plateau.w128.t10.png +++ b/gfx/tilesets/plateau.t10.png diff --git a/gfx/tilesets/pokecenter.w128.png b/gfx/tilesets/pokecenter.png Binary files differindex ab4821d9..ab4821d9 100644 --- a/gfx/tilesets/pokecenter.w128.png +++ b/gfx/tilesets/pokecenter.png diff --git a/gfx/tilesets/reds_house.w128.t7.png b/gfx/tilesets/reds_house.t7.png Binary files differindex 5f210d04..5f210d04 100644 --- a/gfx/tilesets/reds_house.w128.t7.png +++ b/gfx/tilesets/reds_house.t7.png diff --git a/gfx/tilesets/ship.w128.t6.png b/gfx/tilesets/ship.t6.png Binary files differindex cf5b6b95..cf5b6b95 100644 --- a/gfx/tilesets/ship.w128.t6.png +++ b/gfx/tilesets/ship.t6.png diff --git a/gfx/tilesets/ship_port.w128.t2.png b/gfx/tilesets/ship_port.t2.png Binary files differindex fa5bbb27..fa5bbb27 100644 --- a/gfx/tilesets/ship_port.w128.t2.png +++ b/gfx/tilesets/ship_port.t2.png diff --git a/gfx/tilesets/underground.w128.t7.png b/gfx/tilesets/underground.t7.png Binary files differindex baa86c17..baa86c17 100644 --- a/gfx/tilesets/underground.w128.t7.png +++ b/gfx/tilesets/underground.t7.png diff --git a/home.asm b/home.asm new file mode 100644 index 00000000..dc0b0889 --- /dev/null +++ b/home.asm @@ -0,0 +1,5270 @@ +; The rst vectors are unused. +SECTION "rst00", ROM0[$00] + rst $38 +SECTION "rst08", ROM0[$08] + rst $38 +SECTION "rst10", ROM0[$10] + rst $38 +SECTION "rst18", ROM0[$18] + rst $38 +SECTION "rst20", ROM0[$20] + rst $38 +SECTION "rst28", ROM0[$28] + rst $38 +SECTION "rst30", ROM0[$30] + rst $38 +SECTION "rst38", ROM0[$38] + rst $38 + +; interrupts +SECTION "vblank", ROM0[$40] + jp VBlank +SECTION "lcdc", ROM0[$48] + rst $38 +SECTION "timer", ROM0[$50] + jp Timer +SECTION "serial", ROM0[$58] + jp Serial +SECTION "joypad", ROM0[$60] + reti + + +SECTION "bank0",ROM0[$61] + +DisableLCD:: + xor a + ld [rIF], a + ld a, [rIE] + ld b, a + res 0, a + ld [rIE], a + +.wait + ld a, [rLY] + cp LY_VBLANK + jr nz, .wait + + ld a, [rLCDC] + and $ff ^ rLCDC_ENABLE_MASK + ld [rLCDC], a + ld a, b + ld [rIE], a + ret + +EnableLCD:: + ld a, [rLCDC] + set rLCDC_ENABLE, a + ld [rLCDC], a + ret + +ClearSprites:: + xor a + ld hl, wOAMBuffer + ld b, 40 * 4 +.loop + ld [hli], a + dec b + jr nz, .loop + ret + +HideSprites:: + ld a, 160 + ld hl, wOAMBuffer + ld de, 4 + ld b, 40 +.loop + ld [hl], a + add hl, de + dec b + jr nz, .loop + ret + +FarCopyData:: +; Copy bc bytes from a:hl to de. + ld [wBuffer], a + ld a, [H_LOADEDROMBANK] + push af + ld a, [wBuffer] + ld [H_LOADEDROMBANK], a + ld [MBC3RomBank], a + call CopyData + pop af + ld [H_LOADEDROMBANK], a + ld [MBC3RomBank], a + ret + +CopyData:: +; Copy bc bytes from hl to de. + ld a, [hli] + ld [de], a + inc de + dec bc + ld a, c + or b + jr nz, CopyData + ret + + +SECTION "Entry", ROM0[$100] + nop + jp Start + + +SECTION "Start", ROM0[$150] + +Start:: + cp GBC + jr z, .gbc + xor a + jr .ok +.gbc + ld a, 0 +.ok + ld [wGBC], a + jp Init + + +INCLUDE "home/joypad.asm" + +INCLUDE "data/map_header_pointers.asm" + +INCLUDE "home/overworld.asm" + +; this is used to check if the player wants to interrupt the opening sequence at several points +; XXX is this used anywhere else? +; INPUT: +; c = number of frames to wait +; sets carry if Up+Select+B, Start, or A is pressed within c frames +; unsets carry otherwise +CheckForUserInterruption:: ; 12f8 (0:12f8) + call DelayFrame + push bc + call JoypadLowSensitivity + pop bc + ld a,[hJoyHeld] ; currently pressed buttons + cp a,%01000110 ; Up, Select button, B button + jr z,.setCarry ; if all three keys are pressed + ld a,[$ffb5] ; either newly pressed buttons or currently pressed buttons at low sampling rate + and a,%00001001 ; Start button, A button + jr nz,.setCarry ; if either key is pressed + dec c + jr nz,CheckForUserInterruption +.unsetCarry + and a + ret +.setCarry + scf + ret + +; function to load position data for destination warp when switching maps +; INPUT: +; a = ID of destination warp within destination map +LoadDestinationWarpPosition:: ; 1313 (0:1313) + ld b,a + ld a,[H_LOADEDROMBANK] + push af + ld a,[wPredefParentBank] + ld [H_LOADEDROMBANK],a + ld [$2000],a + ld a,b + add a + add a + ld c,a + ld b,0 + add hl,bc + ld bc,4 + ld de,wd35f + call CopyData + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a + ret + +; INPUT: +; c: if nonzero, show at least a sliver of health +; d = number of HP bar sections (normally 6) +; e = health (in eighths of bar sections) (normally out of 48) +DrawHPBar:: ; 1336 (0:1336) + push hl + push de + push bc + ld a,$71 ; left of HP bar tile 1 + ld [hli],a + ld a,$62 ; left of HP bar tile 2 + ld [hli],a + push hl + ld a,$63 ; empty bar section tile +.drawEmptyBarLoop + ld [hli],a + dec d + jr nz,.drawEmptyBarLoop + ld a,[wListMenuID] + dec a ; what should the right of HP bar tile be? + ld a,$6d ; right of HP bar tile, in status screen and battles + jr z,.writeTile + dec a ; right of HP bar tile, in pokemon menu +.writeTile + ld [hl],a + pop hl + ld a,e + and a ; is there enough health to show up on the HP bar? + jr nz,.loop ; if so, draw the HP bar + ld a,c + and a ; should a sliver of health be shown no matter what? + jr z,.done + ld e,1 ; if so, fill one eighth of a bar section +; loop to draw every full bar section +.loop + ld a,e + sub a,8 + jr c,.drawPartialBarSection + ld e,a + ld a,$6b ; filled bar section tile + ld [hli],a + ld a,e + and a + jr z,.done + jr .loop +; draws a partial bar section at the end (if necessary) +; there are 7 possible partial bar sections from 1/8 to 7/8 full +.drawPartialBarSection + ld a,$63 ; empty bar section tile + add e ; add e to get the appropriate partial bar section tile + ld [hl],a ; write the tile +.done + pop bc + pop de + pop hl + ret + +; loads pokemon data from one of multiple sources to wcf98 +; loads base stats to W_MONHDEXNUM +; INPUT: +; [wWhichPokemon] = index of pokemon within party/box +; [wcc49] = source +; 00: player's party +; 01: enemy's party +; 02: current box +; 03: daycare +; OUTPUT: +; [wcf91] = pokemon ID +; wcf98 = base address of pokemon data +; W_MONHDEXNUM = base address of base stats +LoadMonData:: ; 1372 (0:1372) + ld hl,LoadMonData_ + ld b,BANK(LoadMonData_) + jp Bankswitch + +; writes c to wd0dc+b +Func_137a:: ; 137a (0:137a) + ld hl, wd0dc + ld e, b + ld d, $0 + add hl, de + ld a, c + ld [hl], a + ret + +LoadFlippedFrontSpriteByMonIndex:: ; 1384 (0:1384) + ld a, $1 + ld [W_SPRITEFLIPPED], a + +LoadFrontSpriteByMonIndex:: ; 1389 (0:1389) + push hl + ld a, [wd11e] + push af + ld a, [wcf91] + ld [wd11e], a + predef IndexToPokedex + ld hl, wd11e + ld a, [hl] + pop bc + ld [hl], b + and a + pop hl + jr z, .invalidDexNumber ; dex #0 invalid + cp NUM_POKEMON + 1 + jr c, .validDexNumber ; dex >#151 invalid +.invalidDexNumber + ld a, RHYDON ; $1 + ld [wcf91], a + ret +.validDexNumber + push hl + ld de, vFrontPic + call LoadMonFrontSprite + pop hl + ld a, [H_LOADEDROMBANK] + push af + ld a, Bank(asm_3f0d0) + ld [H_LOADEDROMBANK], a + ld [$2000], a + xor a + ld [$ffe1], a + call asm_3f0d0 + xor a + ld [W_SPRITEFLIPPED], a + pop af + ld [H_LOADEDROMBANK], a + ld [$2000], a + ret + +; plays the cry of a pokemon +; INPUT: +; a = pokemon ID +PlayCry:: ; 13d0 (0:13d0) + call GetCryData + call PlaySound ; play cry + jp WaitForSoundToFinish ; wait for sound to be done playing + +; gets a pokemon's cry data +; INPUT: +; a = pokemon ID +GetCryData:: ; 13d9 (0:13d9) + dec a + ld c,a + ld b,0 + ld hl,CryData + add hl,bc + add hl,bc + add hl,bc + ld a,Bank(CryData) + call BankswitchHome + ld a,[hli] + ld b,a + ld a,[hli] + ld [wc0f1],a + ld a,[hl] + ld [wc0f2],a + call BankswitchBack + ld a,b ; a = cryID + ld c,$14 ; base sound ID for pokemon cries + rlca + add b ; a = cryID * 3 + add c ; a = $14 + cryID * 3 + ret + +DisplayPartyMenu:: ; 13fc (0:13fc) + ld a,[$ffd7] + push af + xor a + ld [$ffd7],a + call GBPalWhiteOutWithDelay3 + call ClearSprites + call PartyMenuInit + call DrawPartyMenu + jp HandlePartyMenuInput + +GoBackToPartyMenu:: ; 1411 (0:1411) + ld a,[$ffd7] + push af + xor a + ld [$ffd7],a + call PartyMenuInit + call RedrawPartyMenu + jp HandlePartyMenuInput + +PartyMenuInit:: ; 1420 (0:1420) + ld a,$01 + call BankswitchHome + call LoadHpBarAndStatusTilePatterns + ld hl,wd730 + set 6,[hl] ; turn off letter printing delay + xor a + ld [wcc49],a + ld [wcc37],a + ld hl,wTopMenuItemY + inc a + ld [hli],a ; top menu item Y + xor a + ld [hli],a ; top menu item X + ld a,[wcc2b] + push af + ld [hli],a ; current menu item ID + inc hl + ld a,[wPartyCount] + and a ; are there more than 0 pokemon in the party? + jr z,.storeMaxMenuItemID + dec a +; if party is not empty, the max menu item ID is ([wPartyCount] - 1) +; otherwise, it is 0 +.storeMaxMenuItemID + ld [hli],a ; max menu item ID + ld a,[wd11f] + and a + ld a,%00000011 ; A button and B button + jr z,.next + xor a + ld [wd11f],a + inc a +.next + ld [hli],a ; menu watched keys + pop af + ld [hl],a ; old menu item ID + ret + +HandlePartyMenuInput:: ; 145a (0:145a) + ld a,1 + ld [wMenuWrappingEnabled],a + ld a,$40 + ld [wd09b],a + call HandleMenuInputPokemonSelection + call PlaceUnfilledArrowMenuCursor + ld b,a + xor a + ld [wd09b],a + ld a,[wCurrentMenuItem] + ld [wcc2b],a + ld hl,wd730 + res 6,[hl] ; turn on letter printing delay + ld a,[wcc35] + and a + jp nz,.swappingPokemon + pop af + ld [$ffd7],a + bit 1,b + jr nz,.noPokemonChosen + ld a,[wPartyCount] + and a + jr z,.noPokemonChosen + ld a,[wCurrentMenuItem] + ld [wWhichPokemon],a + ld hl,wPartySpecies + ld b,0 + ld c,a + add hl,bc + ld a,[hl] + ld [wcf91],a + ld [wBattleMonSpecies2],a + call BankswitchBack + and a + ret +.noPokemonChosen + call BankswitchBack + scf + ret +.swappingPokemon + bit 1,b ; was the B button pressed? + jr z,.handleSwap ; if not, handle swapping the pokemon +.cancelSwap ; if the B button was pressed + callba ErasePartyMenuCursors + xor a + ld [wcc35],a + ld [wd07d],a + call RedrawPartyMenu + jr HandlePartyMenuInput +.handleSwap + ld a,[wCurrentMenuItem] + ld [wWhichPokemon],a + callba SwitchPartyMon + jr HandlePartyMenuInput + +DrawPartyMenu:: ; 14d4 (0:14d4) + ld hl, DrawPartyMenu_ + jr DrawPartyMenuCommon + +RedrawPartyMenu:: ; 14d9 (0:14d9) + ld hl, RedrawPartyMenu_ + +DrawPartyMenuCommon:: ; 14dc (0:14dc) + ld b, BANK(RedrawPartyMenu_) + jp Bankswitch + +; prints a pokemon's status condition +; INPUT: +; de = address of status condition +; hl = destination address +PrintStatusCondition:: ; 14e1 (0:14e1) + push de + dec de + dec de ; de = address of current HP + ld a,[de] + ld b,a + dec de + ld a,[de] + or b ; is the pokemon's HP zero? + pop de + jr nz,PrintStatusConditionNotFainted +; if the pokemon's HP is 0, print "FNT" + ld a,"F" + ld [hli],a + ld a,"N" + ld [hli],a + ld [hl],"T" + and a + ret +PrintStatusConditionNotFainted ; 14f6 + ld a,[H_LOADEDROMBANK] + push af + ld a,BANK(PrintStatusAilment) + ld [H_LOADEDROMBANK],a + ld [$2000],a + call PrintStatusAilment ; print status condition + pop bc + ld a,b + ld [H_LOADEDROMBANK],a + ld [$2000],a + ret + +; function to print pokemon level, leaving off the ":L" if the level is at least 100 +; INPUT: +; hl = destination address +; [wcfb9] = level +PrintLevel:: ; 150b (0:150b) + ld a,$6e ; ":L" tile ID + ld [hli],a + ld c,2 ; number of digits + ld a,[wcfb9] ; level + cp a,100 + jr c,PrintLevelCommon +; if level at least 100, write over the ":L" tile + dec hl + inc c ; increment number of digits to 3 + jr PrintLevelCommon + +; prints the level without leaving off ":L" regardless of level +; INPUT: +; hl = destination address +; [wcfb9] = level +PrintLevelFull:: ; 151b (0:151b) + ld a,$6e ; ":L" tile ID + ld [hli],a + ld c,3 ; number of digits + ld a,[wcfb9] ; level + +PrintLevelCommon:: ; 1523 (0:1523) + ld [wd11e],a + ld de,wd11e + ld b,$41 ; no leading zeroes, left-aligned, one byte + jp PrintNumber + +Func_152e:: ; 152e (0:152e) + ld hl,wd0dc + ld c,a + ld b,0 + add hl,bc + ld a,[hl] + ret + +; copies the base stat data of a pokemon to W_MONHDEXNUM (W_MONHEADER) +; INPUT: +; [wd0b5] = pokemon ID +GetMonHeader:: ; 1537 (0:1537) + ld a,[H_LOADEDROMBANK] + push af + ld a,BANK(BaseStats) + ld [H_LOADEDROMBANK],a + ld [$2000],a + push bc + push de + push hl + ld a,[wd11e] + push af + ld a,[wd0b5] + ld [wd11e],a + ld de,FossilKabutopsPic + ld b,$66 ; size of Kabutops fossil and Ghost sprites + cp a,FOSSIL_KABUTOPS ; Kabutops fossil + jr z,.specialID + ld de,GhostPic + cp a,MON_GHOST ; Ghost + jr z,.specialID + ld de,FossilAerodactylPic + ld b,$77 ; size of Aerodactyl fossil sprite + cp a,FOSSIL_AERODACTYL ; Aerodactyl fossil + jr z,.specialID + cp a,MEW + jr z,.mew + predef IndexToPokedex ; convert pokemon ID in [wd11e] to pokedex number + ld a,[wd11e] + dec a + ld bc,28 + ld hl,BaseStats + call AddNTimes + ld de,W_MONHEADER + ld bc,28 + call CopyData + jr .done +.specialID + ld hl,W_MONHSPRITEDIM + ld [hl],b ; write sprite dimensions + inc hl + ld [hl],e ; write front sprite pointer + inc hl + ld [hl],d + jr .done +.mew + ld hl,MewBaseStats + ld de,W_MONHEADER + ld bc,28 + ld a,BANK(MewBaseStats) + call FarCopyData +.done + ld a,[wd0b5] + ld [W_MONHDEXNUM],a + pop af + ld [wd11e],a + pop hl + pop de + pop bc + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a + ret + +; copy party pokemon's name to wcd6d +GetPartyMonName2:: ; 15b4 (0:15b4) + ld a,[wWhichPokemon] ; index within party + ld hl,wPartyMonNicks + +; this is called more often +GetPartyMonName:: ; 15ba (0:15ba) + push hl + push bc + call SkipFixedLengthTextEntries ; add 11 to hl, a times + ld de,wcd6d + push de + ld bc,11 + call CopyData + pop de + pop bc + pop hl + ret + +; function to print a BCD (Binary-coded decimal) number +; de = address of BCD number +; hl = destination address +; c = flags and length +; bit 7: if set, do not print leading zeroes +; if unset, print leading zeroes +; bit 6: if set, left-align the string (do not pad empty digits with spaces) +; if unset, right-align the string +; bit 5: if set, print currency symbol at the beginning of the string +; if unset, do not print the currency symbol +; bits 0-4: length of BCD number in bytes +; Note that bits 5 and 7 are modified during execution. The above reflects +; their meaning at the beginning of the functions's execution. +PrintBCDNumber:: ; 15cd (0:15cd) + ld b,c ; save flags in b + res 7,c + res 6,c + res 5,c ; c now holds the length + bit 5,b + jr z,.loop + bit 7,b + jr nz,.loop + ld [hl],"¥" + inc hl +.loop + ld a,[de] + swap a + call PrintBCDDigit ; print upper digit + ld a,[de] + call PrintBCDDigit ; print lower digit + inc de + dec c + jr nz,.loop + bit 7,b ; were any non-zero digits printed? + jr z,.done ; if so, we are done +.numberEqualsZero ; if every digit of the BCD number is zero + bit 6,b ; left or right alignment? + jr nz,.skipRightAlignmentAdjustment + dec hl ; if the string is right-aligned, it needs to be moved back one space +.skipRightAlignmentAdjustment + bit 5,b + jr z,.skipCurrencySymbol + ld [hl],"¥" + inc hl +.skipCurrencySymbol + ld [hl],"0" + call PrintLetterDelay + inc hl +.done + ret + +PrintBCDDigit:: ; 1604 (0:1604) + and a,%00001111 + and a + jr z,.zeroDigit +.nonzeroDigit + bit 7,b ; have any non-space characters been printed? + jr z,.outputDigit +; if bit 7 is set, then no numbers have been printed yet + bit 5,b ; print the currency symbol? + jr z,.skipCurrencySymbol + ld [hl],"¥" + inc hl + res 5,b +.skipCurrencySymbol + res 7,b ; unset 7 to indicate that a nonzero digit has been reached +.outputDigit + add a,"0" + ld [hli],a + jp PrintLetterDelay +.zeroDigit + bit 7,b ; either printing leading zeroes or already reached a nonzero digit? + jr z,.outputDigit ; if so, print a zero digit + bit 6,b ; left or right alignment? + ret nz + inc hl ; if right-aligned, "print" a space by advancing the pointer + ret + +; uncompresses the front or back sprite of the specified mon +; assumes the corresponding mon header is already loaded +; hl contains offset to sprite pointer ($b for front or $d for back) +UncompressMonSprite:: ; 1627 (0:1627) + ld bc,W_MONHEADER + add hl,bc + ld a,[hli] + ld [W_SPRITEINPUTPTR],a ; fetch sprite input pointer + ld a,[hl] + ld [W_SPRITEINPUTPTR+1],a +; define (by index number) the bank that a pokemon's image is in +; index = Mew, bank 1 +; index = Kabutops fossil, bank $B +; index < $1F, bank 9 +; $1F ≤ index < $4A, bank $A +; $4A ≤ index < $74, bank $B +; $74 ≤ index < $99, bank $C +; $99 ≤ index, bank $D + ld a,[wcf91] ; XXX name for this ram location + ld b,a + cp MEW + ld a,BANK(MewPicFront) + jr z,.GotBank + ld a,b + cp FOSSIL_KABUTOPS + ld a,BANK(FossilKabutopsPic) + jr z,.GotBank + ld a,b + cp TANGELA + 1 + ld a,BANK(TangelaPicFront) + jr c,.GotBank + ld a,b + cp MOLTRES + 1 + ld a,BANK(MoltresPicFront) + jr c,.GotBank + ld a,b + cp BEEDRILL + 2 + ld a,BANK(BeedrillPicFront) + jr c,.GotBank + ld a,b + cp STARMIE + 1 + ld a,BANK(StarmiePicFront) + jr c,.GotBank + ld a,BANK(VictreebelPicFront) +.GotBank + jp UncompressSpriteData + +; de: destination location +LoadMonFrontSprite:: ; 1665 (0:1665) + push de + ld hl, W_MONHFRONTSPRITE - W_MONHEADER + call UncompressMonSprite + ld hl, W_MONHSPRITEDIM + ld a, [hli] + ld c, a + pop de + ; fall through + +; postprocesses uncompressed sprite chunks to a 2bpp sprite and loads it into video ram +; calculates alignment parameters to place both sprite chunks in the center of the 7*7 tile sprite buffers +; de: destination location +; a,c: sprite dimensions (in tiles of 8x8 each) +LoadUncompressedSpriteData:: ; 1672 (0:1672) + push de + and $f + ld [H_SPRITEWIDTH], a ; each byte contains 8 pixels (in 1bpp), so tiles=bytes for width + ld b, a + ld a, $7 + sub b ; 7-w + inc a ; 8-w + srl a ; (8-w)/2 ; horizontal center (in tiles, rounded up) + ld b, a + add a + add a + add a + sub b ; 7*((8-w)/2) ; skip for horizontal center (in tiles) + ld [H_SPRITEOFFSET], a + ld a, c + swap a + and $f + ld b, a + add a + add a + add a ; 8*tiles is height in bytes + ld [H_SPRITEHEIGHT], a ; $ff8c + ld a, $7 + sub b ; 7-h ; skip for vertical center (in tiles, relative to current column) + ld b, a + ld a, [H_SPRITEOFFSET] + add b ; 7*((8-w)/2) + 7-h ; combined overall offset (in tiles) + add a + add a + add a ; 8*(7*((8-w)/2) + 7-h) ; combined overall offset (in bytes) + ld [H_SPRITEOFFSET], a + xor a + ld [$4000], a + ld hl, S_SPRITEBUFFER0 + call ZeroSpriteBuffer ; zero buffer 0 + ld de, S_SPRITEBUFFER1 + ld hl, S_SPRITEBUFFER0 + call AlignSpriteDataCentered ; copy and align buffer 1 to 0 (containing the MSB of the 2bpp sprite) + ld hl, S_SPRITEBUFFER1 + call ZeroSpriteBuffer ; zero buffer 1 + ld de, S_SPRITEBUFFER2 + ld hl, S_SPRITEBUFFER1 + call AlignSpriteDataCentered ; copy and align buffer 2 to 1 (containing the LSB of the 2bpp sprite) + pop de + jp InterlaceMergeSpriteBuffers + +; copies and aligns the sprite data properly inside the sprite buffer +; sprite buffers are 7*7 tiles in size, the loaded sprite is centered within this area +AlignSpriteDataCentered:: ; 16c2 (0:16c2) + ld a, [H_SPRITEOFFSET] + ld b, $0 + ld c, a + add hl, bc + ld a, [H_SPRITEWIDTH] ; $ff8b +.columnLoop + push af + push hl + ld a, [H_SPRITEHEIGHT] ; $ff8c + ld c, a +.columnInnerLoop + ld a, [de] + inc de + ld [hli], a + dec c + jr nz, .columnInnerLoop + pop hl + ld bc, 7*8 ; 7 tiles + add hl, bc ; advance one full column + pop af + dec a + jr nz, .columnLoop + ret + +; fills the sprite buffer (pointed to in hl) with zeros +ZeroSpriteBuffer:: ; 16df (0:16df) + ld bc, SPRITEBUFFERSIZE +.nextByteLoop + xor a + ld [hli], a + dec bc + ld a, b + or c + jr nz, .nextByteLoop + ret + +; combines the (7*7 tiles, 1bpp) sprite chunks in buffer 0 and 1 into a 2bpp sprite located in buffer 1 through 2 +; in the resulting sprite, the rows of the two source sprites are interlaced +; de: output address +InterlaceMergeSpriteBuffers:: ; 16ea (0:16ea) + xor a + ld [$4000], a + push de + ld hl, S_SPRITEBUFFER2 + (SPRITEBUFFERSIZE - 1) ; destination: end of buffer 2 + ld de, S_SPRITEBUFFER1 + (SPRITEBUFFERSIZE - 1) ; source 2: end of buffer 1 + ld bc, S_SPRITEBUFFER0 + (SPRITEBUFFERSIZE - 1) ; source 1: end of buffer 0 + ld a, SPRITEBUFFERSIZE/2 ; $c4 + ld [H_SPRITEINTERLACECOUNTER], a ; $ff8b +.interlaceLoop + ld a, [de] + dec de + ld [hld], a ; write byte of source 2 + ld a, [bc] + dec bc + ld [hld], a ; write byte of source 1 + ld a, [de] + dec de + ld [hld], a ; write byte of source 2 + ld a, [bc] + dec bc + ld [hld], a ; write byte of source 1 + ld a, [H_SPRITEINTERLACECOUNTER] ; $ff8b + dec a + ld [H_SPRITEINTERLACECOUNTER], a ; $ff8b + jr nz, .interlaceLoop + ld a, [W_SPRITEFLIPPED] + and a + jr z, .notFlipped + ld bc, 2*SPRITEBUFFERSIZE + ld hl, S_SPRITEBUFFER1 +.swapLoop + swap [hl] ; if flipped swap nybbles in all bytes + inc hl + dec bc + ld a, b + or c + jr nz, .swapLoop +.notFlipped + pop hl + ld de, S_SPRITEBUFFER1 + ld c, (2*SPRITEBUFFERSIZE)/16 ; $31, number of 16 byte chunks to be copied + ld a, [H_LOADEDROMBANK] + ld b, a + jp CopyVideoData + + +INCLUDE "data/collision.asm" + + +FarCopyData2:: +; Identical to FarCopyData, but uses $ff8b +; as temp space instead of wBuffer. + ld [$ff8b],a + ld a,[H_LOADEDROMBANK] + push af + ld a,[$ff8b] + ld [H_LOADEDROMBANK],a + ld [MBC3RomBank],a + call CopyData + pop af + ld [H_LOADEDROMBANK],a + ld [MBC3RomBank],a + ret + +FarCopyData3:: +; Copy bc bytes from a:de to hl. + ld [$ff8b],a + ld a,[H_LOADEDROMBANK] + push af + ld a,[$ff8b] + ld [H_LOADEDROMBANK],a + ld [MBC3RomBank],a + push hl + push de + push de + ld d,h + ld e,l + pop hl + call CopyData + pop de + pop hl + pop af + ld [H_LOADEDROMBANK],a + ld [MBC3RomBank],a + ret + +FarCopyDataDouble:: +; Expand bc bytes of 1bpp image data +; from a:hl to 2bpp data at de. + ld [$ff8b],a + ld a,[H_LOADEDROMBANK] + push af + ld a,[$ff8b] + ld [H_LOADEDROMBANK],a + ld [MBC3RomBank],a +.loop + ld a,[hli] + ld [de],a + inc de + ld [de],a + inc de + dec bc + ld a,c + or b + jr nz,.loop + pop af + ld [H_LOADEDROMBANK],a + ld [MBC3RomBank],a + ret + +CopyVideoData:: +; Wait for the next VBlank, then copy c 2bpp +; tiles from b:de to hl, 8 tiles at a time. +; This takes c/8 frames. + + ld a, [H_AUTOBGTRANSFERENABLED] + push af + xor a ; disable auto-transfer while copying + ld [H_AUTOBGTRANSFERENABLED], a + + ld a, [H_LOADEDROMBANK] + ld [$ff8b], a + + ld a, b + ld [H_LOADEDROMBANK], a + ld [MBC3RomBank], a + + ld a, e + ld [H_VBCOPYSRC], a + ld a, d + ld [H_VBCOPYSRC + 1], a + + ld a, l + ld [H_VBCOPYDEST], a + ld a, h + ld [H_VBCOPYDEST + 1], a + +.loop + ld a, c + cp 8 + jr nc, .keepgoing + +.done + ld [H_VBCOPYSIZE], a + call DelayFrame + ld a, [$ff8b] + ld [H_LOADEDROMBANK], a + ld [MBC3RomBank], a + pop af + ld [H_AUTOBGTRANSFERENABLED], a + ret + +.keepgoing + ld a, 8 + ld [H_VBCOPYSIZE], a + call DelayFrame + ld a, c + sub 8 + ld c, a + jr .loop + +CopyVideoDataDouble:: +; Wait for the next VBlank, then copy c 1bpp +; tiles from b:de to hl, 8 tiles at a time. +; This takes c/8 frames. + ld a, [H_AUTOBGTRANSFERENABLED] + push af + xor a ; disable auto-transfer while copying + ld [H_AUTOBGTRANSFERENABLED], a + ld a, [H_LOADEDROMBANK] + ld [$ff8b], a + + ld a, b + ld [H_LOADEDROMBANK], a + ld [MBC3RomBank], a + + ld a, e + ld [H_VBCOPYDOUBLESRC], a + ld a, d + ld [H_VBCOPYDOUBLESRC + 1], a + + ld a, l + ld [H_VBCOPYDOUBLEDEST], a + ld a, h + ld [H_VBCOPYDOUBLEDEST + 1], a + +.loop + ld a, c + cp 8 + jr nc, .keepgoing + +.done + ld [H_VBCOPYDOUBLESIZE], a + call DelayFrame + ld a, [$ff8b] + ld [H_LOADEDROMBANK], a + ld [MBC3RomBank], a + pop af + ld [H_AUTOBGTRANSFERENABLED], a + ret + +.keepgoing + ld a, 8 + ld [H_VBCOPYDOUBLESIZE], a + call DelayFrame + ld a, c + sub 8 + ld c, a + jr .loop + +ClearScreenArea:: +; Clear tilemap area cxb at hl. + ld a, $7f ; blank tile + ld de, 20 ; screen width +.y + push hl + push bc +.x + ld [hli], a + dec c + jr nz, .x + pop bc + pop hl + add hl, de + dec b + jr nz, .y + ret + +CopyScreenTileBufferToVRAM:: +; Copy wTileMap to the BG Map starting at b * $100. +; This is done in thirds of 6 rows, so it takes 3 frames. + + ld c, 6 + + ld hl, $600 * 0 + ld de, wTileMap + 20 * 6 * 0 + call .setup + call DelayFrame + + ld hl, $600 * 1 + ld de, wTileMap + 20 * 6 * 1 + call .setup + call DelayFrame + + ld hl, $600 * 2 + ld de, wTileMap + 20 * 6 * 2 + call .setup + jp DelayFrame + +.setup + ld a, d + ld [H_VBCOPYBGSRC+1], a + call GetRowColAddressBgMap + ld a, l + ld [H_VBCOPYBGDEST], a + ld a, h + ld [H_VBCOPYBGDEST+1], a + ld a, c + ld [H_VBCOPYBGNUMROWS], a + ld a, e + ld [H_VBCOPYBGSRC], a + ret + +ClearScreen:: +; Clear wTileMap, then wait +; for the bg map to update. + ld bc, 20 * 18 + inc b + ld hl, wTileMap + ld a, $7f +.loop + ld [hli], a + dec c + jr nz, .loop + dec b + jr nz, .loop + jp Delay3 + + +INCLUDE "home/text.asm" +INCLUDE "home/vcopy.asm" +INCLUDE "home/init.asm" +INCLUDE "home/vblank.asm" +INCLUDE "home/fade.asm" + + +Serial:: ; 2125 (0:2125) + push af + push bc + push de + push hl + ld a, [$ffaa] + inc a + jr z, .asm_2142 + ld a, [$ff01] + ld [$ffad], a + ld a, [$ffac] + ld [$ff01], a + ld a, [$ffaa] + cp $2 + jr z, .asm_2162 + ld a, $80 + ld [$ff02], a + jr .asm_2162 +.asm_2142 + ld a, [$ff01] + ld [$ffad], a + ld [$ffaa], a + cp $2 + jr z, .asm_215f + xor a + ld [$ff01], a + ld a, $3 + ld [rDIV], a ; $ff04 +.asm_2153 + ld a, [rDIV] ; $ff04 + bit 7, a + jr nz, .asm_2153 + ld a, $80 + ld [$ff02], a + jr .asm_2162 +.asm_215f + xor a + ld [$ff01], a +.asm_2162 + ld a, $1 + ld [$ffa9], a + ld a, $fe + ld [$ffac], a + pop hl + pop de + pop bc + pop af + reti + +Func_216f:: ; 216f (0:216f) + ld a, $1 + ld [$ffab], a +.asm_2173 + ld a, [hl] + ld [$ffac], a + call Func_219a + push bc + ld b, a + inc hl + ld a, $30 +.asm_217e + dec a + jr nz, .asm_217e + ld a, [$ffab] + and a + ld a, b + pop bc + jr z, .asm_2192 + dec hl + cp $fd + jr nz, .asm_2173 + xor a + ld [$ffab], a + jr .asm_2173 +.asm_2192 + ld [de], a + inc de + dec bc + ld a, b + or c + jr nz, .asm_2173 + ret + +Func_219a:: ; 219a (0:219a) + xor a + ld [$ffa9], a + ld a, [$ffaa] + cp $2 + jr nz, .asm_21a7 + ld a, $81 + ld [$ff02], a +.asm_21a7 + ld a, [$ffa9] + and a + jr nz, .asm_21f1 + ld a, [$ffaa] + cp $1 + jr nz, .asm_21cc + call Func_2237 + jr z, .asm_21cc + call Func_2231 + push hl + ld hl, wcc48 + inc [hl] + jr nz, .asm_21c3 + dec hl + inc [hl] +.asm_21c3 + pop hl + call Func_2237 + jr nz, .asm_21a7 + jp Func_223f +.asm_21cc + ld a, [rIE] ; $ffff + and $f + cp $8 + jr nz, .asm_21a7 + ld a, [W_NUMHITS] ; wd074 + dec a + ld [W_NUMHITS], a ; wd074 + jr nz, .asm_21a7 + ld a, [wd075] + dec a + ld [wd075], a + jr nz, .asm_21a7 + ld a, [$ffaa] + cp $1 + jr z, .asm_21f1 + ld a, $ff +.asm_21ee + dec a + jr nz, .asm_21ee +.asm_21f1 + xor a + ld [$ffa9], a + ld a, [rIE] ; $ffff + and $f + sub $8 + jr nz, .asm_2204 + ld [W_NUMHITS], a ; wd074 + ld a, $50 + ld [wd075], a +.asm_2204 + ld a, [$ffad] + cp $fe + ret nz + call Func_2237 + jr z, .asm_221f + push hl + ld hl, wcc48 + ld a, [hl] + dec a + ld [hld], a + inc a + jr nz, .asm_2219 + dec [hl] +.asm_2219 + pop hl + call Func_2237 + jr z, Func_223f +.asm_221f + ld a, [rIE] ; $ffff + and $f + cp $8 + ld a, $fe + ret z + ld a, [hl] + ld [$ffac], a + call DelayFrame + jp Func_219a + +Func_2231:: ; 2231 (0:2231) + ld a, $f +.asm_2233 + dec a + jr nz, .asm_2233 + ret + +Func_2237:: ; 2237 (0:2237) + push hl + ld hl, wcc47 + ld a, [hli] + or [hl] + pop hl + ret + +Func_223f:: ; 223f (0:223f) + dec a + ld [wcc47], a + ld [wcc48], a + ret + +Func_2247:: ; 2247 (0:2247) + ld hl, wcc42 + ld de, wcc3d + ld c, $2 + ld a, $1 + ld [$ffab], a +.asm_2253 + call DelayFrame + ld a, [hl] + ld [$ffac], a + call Func_219a + ld b, a + inc hl + ld a, [$ffab] + and a + ld a, $0 + ld [$ffab], a + jr nz, .asm_2253 + ld a, b + ld [de], a + inc de + dec c + jr nz, .asm_2253 + ret + +Func_226e:: ; 226e (0:226e) + call SaveScreenTilesToBuffer1 + callab PrintWaitingText + call Func_227f + jp LoadScreenTilesFromBuffer1 + +Func_227f:: ; 227f (0:227f) + ld a, $ff + ld [wcc3e], a +.asm_2284 + call Func_22c3 + call DelayFrame + call Func_2237 + jr z, .asm_22a0 + push hl + ld hl, wcc48 + dec [hl] + jr nz, .asm_229f + dec hl + dec [hl] + jr nz, .asm_229f + pop hl + xor a + jp Func_223f +.asm_229f + pop hl +.asm_22a0 + ld a, [wcc3e] + inc a + jr z, .asm_2284 + ld b, $a +.asm_22a8 + call DelayFrame + call Func_22c3 + dec b + jr nz, .asm_22a8 + ld b, $a +.asm_22b3 + call DelayFrame + call Func_22ed + dec b + jr nz, .asm_22b3 + ld a, [wcc3e] + ld [wcc3d], a + ret + +Func_22c3:: ; 22c3 (0:22c3) + call asm_22d7 + ld a, [wcc42] + add $60 + ld [$ffac], a + ld a, [$ffaa] + cp $2 + jr nz, asm_22d7 + ld a, $81 + ld [$ff02], a +asm_22d7:: ; 22d7 (0:22d7) + ld a, [$ffad] + ld [wcc3d], a + and $f0 + cp $60 + ret nz + xor a + ld [$ffad], a + ld a, [wcc3d] + and $f + ld [wcc3e], a + ret + +Func_22ed:: ; 22ed (0:22ed) + xor a + ld [$ffac], a + ld a, [$ffaa] + cp $2 + ret nz + ld a, $81 + ld [$ff02], a + ret + +Func_22fa:: ; 22fa (0:22fa) + ld a, $2 + ld [$ff01], a + xor a + ld [$ffad], a + ld a, $80 + ld [$ff02], a + ret + + +; timer interrupt is apparently not invoked anyway +Timer:: ; 2306 (0:2306) + reti + + +INCLUDE "home/audio.asm" + + +UpdateSprites:: ; 2429 (0:2429) + ld a, [wcfcb] + dec a + ret nz + ld a, [H_LOADEDROMBANK] + push af + ld a, Bank(_UpdateSprites) + ld [H_LOADEDROMBANK], a + ld [$2000], a + call _UpdateSprites + pop af + ld [H_LOADEDROMBANK], a + ld [$2000], a + ret + +INCLUDE "data/mart_inventories.asm" + +TextScriptEndingChar:: ; 24d6 (0:24d6) + db "@" +TextScriptEnd:: ; 24d7 (0:24d7) + ld hl,TextScriptEndingChar + ret + +ExclamationText:: ; 24db (0:24db) + TX_FAR _ExclamationText + db "@" + +GroundRoseText:: ; 24e0 (0:24e0) + TX_FAR _GroundRoseText + db "@" + +BoulderText:: ; 24e5 (0:24e5) + TX_FAR _BoulderText + db "@" + +MartSignText:: ; 24ea (0:24ea) + TX_FAR _MartSignText + db "@" + +PokeCenterSignText:: ; 24ef (0:24ef) + TX_FAR _PokeCenterSignText + db "@" + +Predef5CText:: ; 24f4 (0:24f4) +; XXX better label (what does predef $5C do?) + db $08 ; asm + predef PickupItem + jp TextScriptEnd + + +INCLUDE "home/pic.asm" + + +ResetPlayerSpriteData:: ; 28a6 (0:28a6) + ld hl, wSpriteStateData1 + call ResetPlayerSpriteData_ClearSpriteData + ld hl, wSpriteStateData2 + call ResetPlayerSpriteData_ClearSpriteData + ld a, $1 + ld [wSpriteStateData1], a + ld [wSpriteStateData2 + $0e], a + ld hl, wSpriteStateData1 + 4 + ld [hl], $3c ; set Y screen pos + inc hl + inc hl + ld [hl], $40 ; set X screen pos + ret + +; overwrites sprite data with zeroes +ResetPlayerSpriteData_ClearSpriteData:: ; 28c4 (0:28c4) + ld bc, $10 + xor a + jp FillMemory + +Func_28cb:: ; 28cb (0:28cb) + ld a, [wMusicHeaderPointer] + and a + jr nz, .asm_28dc + ld a, [wd72c] + bit 1, a + ret nz + ld a, $77 + ld [$ff24], a + ret +.asm_28dc + ld a, [wcfc9] + and a + jr z, .asm_28e7 + dec a + ld [wcfc9], a + ret +.asm_28e7 + ld a, [wcfc8] + ld [wcfc9], a + ld a, [$ff24] + and a + jr z, .asm_2903 + ld b, a + and $f + dec a + ld c, a + ld a, b + and $f0 + swap a + dec a + swap a + or c + ld [$ff24], a + ret +.asm_2903 + ld a, [wMusicHeaderPointer] + ld b, a + xor a + ld [wMusicHeaderPointer], a + ld a, $ff + ld [wc0ee], a + call PlaySound + ld a, [wc0f0] + ld [wc0ef], a + ld a, b + ld [wc0ee], a + jp PlaySound + +; this function is used to display sign messages, sprite dialog, etc. +; INPUT: [$ff8c] = sprite ID or text ID +DisplayTextID:: ; 2920 (0:2920) + ld a,[H_LOADEDROMBANK] + push af + callba DisplayTextIDInit ; initialization + ld hl,wcf11 + bit 0,[hl] + res 0,[hl] + jr nz,.skipSwitchToMapBank + ld a,[W_CURMAP] + call SwitchToMapRomBank +.skipSwitchToMapBank + ld a,30 ; half a second + ld [H_FRAMECOUNTER],a ; used as joypad poll timer + ld hl,W_MAPTEXTPTR + ld a,[hli] + ld h,[hl] + ld l,a ; hl = map text pointer + ld d,$00 + ld a,[$ff8c] ; text ID + ld [wcf13],a + and a + jp z,DisplayStartMenu + cp a,$d3 ; safari game over + jp z,DisplaySafariGameOverText + cp a,$d0 ; fainted + jp z,DisplayPokemonFaintedText + cp a,$d1 ; blacked out + jp z,DisplayPlayerBlackedOutText + cp a,$d2 ; repel wore off + jp z,DisplayRepelWoreOffText + ld a,[W_NUMSPRITES] ; number of sprites + ld e,a + ld a,[$ff8c] ; sprite ID + cp e + jr z,.spriteHandling + jr nc,.skipSpriteHandling +.spriteHandling +; get the text ID of the sprite + push hl + push de + push bc + callba Func_13074 ; update the graphics of the sprite the player is talking to (to face the right direction) + pop bc + pop de + ld hl,W_MAPSPRITEDATA ; NPC text entries + ld a,[$ff8c] + dec a + add a + add l + ld l,a + jr nc,.noCarry + inc h +.noCarry + inc hl + ld a,[hl] ; a = text ID of the sprite + pop hl +.skipSpriteHandling +; look up the address of the text in the map's text entries + dec a + ld e,a + sla e + add hl,de + ld a,[hli] + ld h,[hl] + ld l,a ; hl = address of the text + ld a,[hl] ; a = first byte of text +; check first byte of text for special cases + cp a,$fe ; Pokemart NPC + jp z,DisplayPokemartDialogue + cp a,$ff ; Pokemon Center NPC + jp z,DisplayPokemonCenterDialogue + cp a,$fc ; Item Storage PC + jp z,FuncTX_ItemStoragePC + cp a,$fd ; Bill's PC + jp z,FuncTX_BillsPC + cp a,$f9 ; Pokemon Center PC + jp z,FuncTX_PokemonCenterPC + cp a,$f5 ; Vending Machine + jr nz,.notVendingMachine + callba VendingMachineMenu ; jump banks to vending machine routine + jr AfterDisplayingTextID +.notVendingMachine + cp a,$f7 ; slot machine + jp z,FuncTX_SlotMachine + cp a,$f6 ; cable connection NPC in Pokemon Center + jr nz,.notSpecialCase + callab CableClubNPC + jr AfterDisplayingTextID +.notSpecialCase + call Func_3c59 ; display the text + ld a,[wcc3c] + and a + jr nz,HoldTextDisplayOpen + +AfterDisplayingTextID:: ; 29d6 (0:29d6) + ld a,[wcc47] + and a + jr nz,HoldTextDisplayOpen + call WaitForTextScrollButtonPress ; wait for a button press after displaying all the text + +; loop to hold the dialogue box open as long as the player keeps holding down the A button +HoldTextDisplayOpen:: ; 29df (0:29df) + call Joypad + ld a,[hJoyHeld] + bit 0,a ; is the A button being pressed? + jr nz,HoldTextDisplayOpen + +CloseTextDisplay:: ; 29e8 (0:29e8) + ld a,[W_CURMAP] + call SwitchToMapRomBank + ld a,$90 + ld [$ffb0],a ; move the window off the screen + call DelayFrame + call LoadGBPal + xor a + ld [H_AUTOBGTRANSFERENABLED],a ; disable continuous WRAM to VRAM transfer each V-blank +; loop to make sprites face the directions they originally faced before the dialogue + ld hl,wSpriteStateData2 + $19 + ld c,$0f + ld de,$0010 +.restoreSpriteFacingDirectionLoop + ld a,[hl] + dec h + ld [hl],a + inc h + add hl,de + dec c + jr nz,.restoreSpriteFacingDirectionLoop + ld a,BANK(InitMapSprites) + ld [H_LOADEDROMBANK],a + ld [$2000],a + call InitMapSprites ; reload sprite tile pattern data (since it was partially overwritten by text tile patterns) + ld hl,wcfc4 + res 0,[hl] + ld a,[wd732] + bit 3,a + call z,LoadPlayerSpriteGraphics + call LoadCurrentMapView + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a + jp UpdateSprites ; move sprites + +DisplayPokemartDialogue:: ; 2a2e (0:2a2e) + push hl + ld hl,PokemartGreetingText + call PrintText + pop hl + inc hl + call LoadItemList + ld a,$02 + ld [wListMenuID],a ; selects between subtypes of menus + ld a,[H_LOADEDROMBANK] + push af + ld a,Bank(DisplayPokemartDialogue_) + ld [H_LOADEDROMBANK],a + ld [$2000],a + call DisplayPokemartDialogue_ + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a + jp AfterDisplayingTextID + +PokemartGreetingText:: ; 2a55 (0:2a55) + TX_FAR _PokemartGreetingText + db "@" + +LoadItemList:: ; 2a5a (0:2a5a) + ld a,$01 + ld [wcfcb],a + ld a,h + ld [wd128],a + ld a,l + ld [wd129],a + ld de,wStringBuffer2 + 11 +.loop + ld a,[hli] + ld [de],a + inc de + cp a,$ff + jr nz,.loop + ret + +DisplayPokemonCenterDialogue:: ; 2a72 (0:2a72) + xor a + ld [$ff8b],a + ld [$ff8c],a + ld [$ff8d],a + inc hl + ld a,[H_LOADEDROMBANK] + push af + ld a,Bank(DisplayPokemonCenterDialogue_) + ld [H_LOADEDROMBANK],a + ld [$2000],a + call DisplayPokemonCenterDialogue_ + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a + jp AfterDisplayingTextID + +DisplaySafariGameOverText:: ; 2a90 (0:2a90) + callab PrintSafariGameOverText + jp AfterDisplayingTextID + +DisplayPokemonFaintedText:: ; 2a9b (0:2a9b) + ld hl,PokemonFaintedText + call PrintText + jp AfterDisplayingTextID + +PokemonFaintedText:: ; 2aa4 (0:2aa4) + TX_FAR _PokemonFaintedText + db "@" + +DisplayPlayerBlackedOutText:: ; 2aa9 (0:2aa9) + ld hl,PlayerBlackedOutText + call PrintText + ld a,[wd732] + res 5,a + ld [wd732],a + jp HoldTextDisplayOpen + +PlayerBlackedOutText:: ; 2aba (0:2aba) + TX_FAR _PlayerBlackedOutText + db "@" + +DisplayRepelWoreOffText:: ; 2abf (0:2abf) + ld hl,RepelWoreOffText + call PrintText + jp AfterDisplayingTextID + +RepelWoreOffText:: ; 2ac8 (0:2ac8) + TX_FAR _RepelWoreOffText + db "@" + +INCLUDE "engine/menu/start_menu.asm" + +; function to count how many bits are set in a string of bytes +; INPUT: +; hl = address of string of bytes +; b = length of string of bytes +; OUTPUT: +; [wd11e] = number of set bits +CountSetBits:: ; 2b7f (0:2b7f) + ld c,0 +.loop + ld a,[hli] + ld e,a + ld d,8 +.innerLoop ; count how many bits are set in the current byte + srl e + ld a,0 + adc c + ld c,a + dec d + jr nz,.innerLoop + dec b + jr nz,.loop + ld a,c + ld [wd11e],a ; store number of set bits + ret + +; subtracts the amount the player paid from their money +; sets carry flag if there is enough money and unsets carry flag if not +SubtractAmountPaidFromMoney:: ; 2b96 (0:2b96) + ld b,BANK(SubtractAmountPaidFromMoney_) + ld hl,SubtractAmountPaidFromMoney_ + jp Bankswitch + +; adds the amount the player sold to their money +AddAmountSoldToMoney:: ; 2b9e (0:2b9e) + ld de,wPlayerMoney + 2 + ld hl,$ffa1 ; total price of items + ld c,3 ; length of money in bytes + predef AddBCDPredef ; add total price to money + ld a,$13 + ld [wd125],a + call DisplayTextBoxID ; redraw money text box + ld a, (SFX_02_5a - SFX_Headers_02) / 3 + call PlaySoundWaitForCurrent ; play sound + jp WaitForSoundToFinish ; wait until sound is done playing + +; function to remove an item (in varying quantities) from the player's bag or PC box +; INPUT: +; HL = address of inventory (either wNumBagItems or wNumBoxItems) +; [wWhichPokemon] = index (within the inventory) of the item to remove +; [wcf96] = quantity to remove +RemoveItemFromInventory:: ; 2bbb (0:2bbb) + ld a,[H_LOADEDROMBANK] + push af + ld a,BANK(RemoveItemFromInventory_) + ld [H_LOADEDROMBANK],a + ld [$2000],a + call RemoveItemFromInventory_ + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a + ret + +; function to add an item (in varying quantities) to the player's bag or PC box +; INPUT: +; HL = address of inventory (either wNumBagItems or wNumBoxItems) +; [wcf91] = item ID +; [wcf96] = item quantity +; sets carry flag if successful, unsets carry flag if unsuccessful +AddItemToInventory:: ; 2bcf (0:2bcf) + push bc + ld a,[H_LOADEDROMBANK] + push af + ld a,BANK(AddItemToInventory_) + ld [H_LOADEDROMBANK],a + ld [$2000],a + call AddItemToInventory_ + pop bc + ld a,b + ld [H_LOADEDROMBANK],a + ld [$2000],a + pop bc + ret + +; INPUT: +; [wListMenuID] = list menu ID +; [wcf8b] = address of the list (2 bytes) +DisplayListMenuID:: ; 2be6 (0:2be6) + xor a + ld [H_AUTOBGTRANSFERENABLED],a ; disable auto-transfer + ld a,1 + ld [$ffb7],a ; joypad state update flag + ld a,[W_BATTLETYPE] + and a ; is it the Old Man battle? + jr nz,.specialBattleType + ld a,$01 ; hardcoded bank + jr .bankswitch +.specialBattleType ; Old Man battle + ld a, Bank(OldManItemList) +.bankswitch + call BankswitchHome + ld hl,wd730 + set 6,[hl] ; turn off letter printing delay + xor a + ld [wcc35],a ; 0 means no item is currently being swapped + ld [wd12a],a + ld a,[wcf8b] + ld l,a + ld a,[wcf8c] + ld h,a ; hl = address of the list + ld a,[hl] + ld [wd12a],a ; [wd12a] = number of list entries + ld a,$0d ; list menu text box ID + ld [wd125],a + call DisplayTextBoxID ; draw the menu text box + call UpdateSprites ; move sprites + hlCoord 4, 2 ; coordinates of upper left corner of menu text box + ld de,$090e ; height and width of menu text box + ld a,[wListMenuID] + and a ; is it a PC pokemon list? + jr nz,.skipMovingSprites + call UpdateSprites ; move sprites +.skipMovingSprites + ld a,1 ; max menu item ID is 1 if the list has less than 2 entries + ld [wcc37],a + ld a,[wd12a] + cp a,2 ; does the list have less than 2 entries? + jr c,.setMenuVariables + ld a,2 ; max menu item ID is 2 if the list has at least 2 entries +.setMenuVariables + ld [wMaxMenuItem],a + ld a,4 + ld [wTopMenuItemY],a + ld a,5 + ld [wTopMenuItemX],a + ld a,%00000111 ; A button, B button, Select button + ld [wMenuWatchedKeys],a + ld c,10 + call DelayFrames + +DisplayListMenuIDLoop:: ; 2c53 (0:2c53) + xor a + ld [H_AUTOBGTRANSFERENABLED],a ; disable transfer + call PrintListMenuEntries + ld a,1 + ld [H_AUTOBGTRANSFERENABLED],a ; enable transfer + call Delay3 + ld a,[W_BATTLETYPE] + and a ; is it the Old Man battle? + jr z,.notOldManBattle +.oldManBattle + ld a,"▶" + Coorda 5, 4 ; place menu cursor in front of first menu entry + ld c,80 + call DelayFrames + xor a + ld [wCurrentMenuItem],a + hlCoord 5, 4 + ld a,l + ld [wMenuCursorLocation],a + ld a,h + ld [wMenuCursorLocation + 1],a + jr .buttonAPressed +.notOldManBattle + call LoadGBPal + call HandleMenuInput + push af + call PlaceMenuCursor + pop af + bit 0,a ; was the A button pressed? + jp z,.checkOtherKeys +.buttonAPressed + ld a,[wCurrentMenuItem] + call PlaceUnfilledArrowMenuCursor + ld a,$01 + ld [wd12e],a + ld [wd12d],a + xor a + ld [wcc37],a + ld a,[wCurrentMenuItem] + ld c,a + ld a,[wListScrollOffset] + add c + ld c,a + ld a,[wd12a] ; number of list entries + and a ; is the list empty? + jp z,ExitListMenu ; if so, exit the menu + dec a + cp c ; did the player select Cancel? + jp c,ExitListMenu ; if so, exit the menu + ld a,c + ld [wWhichPokemon],a + ld a,[wListMenuID] + cp a,ITEMLISTMENU + jr nz,.skipMultiplying +; if it's an item menu + sla c ; item entries are 2 bytes long, so multiply by 2 +.skipMultiplying + ld a,[wcf8b] + ld l,a + ld a,[wcf8c] + ld h,a + inc hl ; hl = beginning of list entries + ld b,0 + add hl,bc + ld a,[hl] + ld [wcf91],a + ld a,[wListMenuID] + and a ; is it a PC pokemon list? + jr z,.pokemonList + push hl + call GetItemPrice + pop hl + ld a,[wListMenuID] + cp a,ITEMLISTMENU + jr nz,.skipGettingQuantity +; if it's an item menu + inc hl + ld a,[hl] ; a = item quantity + ld [wcf97],a +.skipGettingQuantity + ld a,[wcf91] + ld [wd0b5],a + ld a,$01 + ld [wPredefBank],a + call GetName + jr .storeChosenEntry +.pokemonList + ld hl,wPartyCount + ld a,[wcf8b] + cp l ; is it a list of party pokemon or box pokemon? + ld hl,wPartyMonNicks + jr z,.getPokemonName + ld hl, wBoxMonNicks ; box pokemon names +.getPokemonName + ld a,[wWhichPokemon] + call GetPartyMonName +.storeChosenEntry ; store the menu entry that the player chose and return + ld de,wcd6d + call CopyStringToCF4B ; copy name to wcf4b + ld a,$01 + ld [wd12e],a + ld a,[wCurrentMenuItem] + ld [wd12d],a + xor a + ld [$ffb7],a ; joypad state update flag + ld hl,wd730 + res 6,[hl] ; turn on letter printing delay + jp BankswitchBack +.checkOtherKeys ; check B, SELECT, Up, and Down keys + bit 1,a ; was the B button pressed? + jp nz,ExitListMenu ; if so, exit the menu + bit 2,a ; was the select button pressed? + jp nz,HandleItemListSwapping ; if so, allow the player to swap menu entries + ld b,a + bit 7,b ; was Down pressed? + ld hl,wListScrollOffset + jr z,.upPressed +.downPressed + ld a,[hl] + add a,3 + ld b,a + ld a,[wd12a] ; number of list entries + cp b ; will going down scroll past the Cancel button? + jp c,DisplayListMenuIDLoop + inc [hl] ; if not, go down + jp DisplayListMenuIDLoop +.upPressed + ld a,[hl] + and a + jp z,DisplayListMenuIDLoop + dec [hl] + jp DisplayListMenuIDLoop + +DisplayChooseQuantityMenu:: ; 2d57 (0:2d57) +; text box dimensions/coordinates for just quantity + hlCoord 15, 9 + ld b,1 ; height + ld c,3 ; width + ld a,[wListMenuID] + cp a,PRICEDITEMLISTMENU + jr nz,.drawTextBox +; text box dimensions/coordinates for quantity and price + hlCoord 7, 9 + ld b,1 ; height + ld c,11 ; width +.drawTextBox + call TextBoxBorder + hlCoord 16, 10 + ld a,[wListMenuID] + cp a,PRICEDITEMLISTMENU + jr nz,.printInitialQuantity + hlCoord 8, 10 +.printInitialQuantity + ld de,InitialQuantityText + call PlaceString + xor a + ld [wcf96],a ; initialize current quantity to 0 + jp .incrementQuantity +.waitForKeyPressLoop + call JoypadLowSensitivity + ld a,[hJoyPressed] ; newly pressed buttons + bit 0,a ; was the A button pressed? + jp nz,.buttonAPressed + bit 1,a ; was the B button pressed? + jp nz,.buttonBPressed + bit 6,a ; was Up pressed? + jr nz,.incrementQuantity + bit 7,a ; was Down pressed? + jr nz,.decrementQuantity + jr .waitForKeyPressLoop +.incrementQuantity + ld a,[wcf97] ; max quantity + inc a + ld b,a + ld hl,wcf96 ; current quantity + inc [hl] + ld a,[hl] + cp b + jr nz,.handleNewQuantity +; wrap to 1 if the player goes above the max quantity + ld a,1 + ld [hl],a + jr .handleNewQuantity +.decrementQuantity + ld hl,wcf96 ; current quantity + dec [hl] + jr nz,.handleNewQuantity +; wrap to the max quantity if the player goes below 1 + ld a,[wcf97] ; max quantity + ld [hl],a +.handleNewQuantity + hlCoord 17, 10 + ld a,[wListMenuID] + cp a,PRICEDITEMLISTMENU + jr nz,.printQuantity +.printPrice + ld c,$03 + ld a,[wcf96] + ld b,a + ld hl,$ff9f ; total price +; initialize total price to 0 + xor a + ld [hli],a + ld [hli],a + ld [hl],a +.addLoop ; loop to multiply the individual price by the quantity to get the total price + ld de,$ffa1 + ld hl,$ff8d + push bc + predef AddBCDPredef ; add the individual price to the current sum + pop bc + dec b + jr nz,.addLoop + ld a,[$ff8e] + and a ; should the price be halved (for selling items)? + jr z,.skipHalvingPrice + xor a + ld [$ffa2],a + ld [$ffa3],a + ld a,$02 + ld [$ffa4],a + predef DivideBCDPredef3 ; halves the price +; store the halved price + ld a,[$ffa2] + ld [$ff9f],a + ld a,[$ffa3] + ld [$ffa0],a + ld a,[$ffa4] + ld [$ffa1],a +.skipHalvingPrice + hlCoord 12, 10 + ld de,SpacesBetweenQuantityAndPriceText + call PlaceString + ld de,$ff9f ; total price + ld c,$a3 + call PrintBCDNumber + hlCoord 9, 10 +.printQuantity + ld de,wcf96 ; current quantity + ld bc,$8102 ; print leading zeroes, 1 byte, 2 digits + call PrintNumber + jp .waitForKeyPressLoop +.buttonAPressed ; the player chose to make the transaction + xor a + ld [wcc35],a ; 0 means no item is currently being swapped + ret +.buttonBPressed ; the player chose to cancel the transaction + xor a + ld [wcc35],a ; 0 means no item is currently being swapped + ld a,$ff + ret + +InitialQuantityText:: ; 2e30 (0:2e30) + db "×01@" + +SpacesBetweenQuantityAndPriceText:: ; 2e34 (0:2e34) + db " @" + +ExitListMenu:: ; 2e3b (0:2e3b) + ld a,[wCurrentMenuItem] + ld [wd12d],a + ld a,$02 + ld [wd12e],a + ld [wcc37],a + xor a + ld [$ffb7],a + ld hl,wd730 + res 6,[hl] + call BankswitchBack + xor a + ld [wcc35],a ; 0 means no item is currently being swapped + scf + ret + +PrintListMenuEntries:: ; 2e5a (0:2e5a) + hlCoord 5, 3 + ld b,$09 + ld c,$0e + call ClearScreenArea + ld a,[wcf8b] + ld e,a + ld a,[wcf8c] + ld d,a + inc de ; de = beginning of list entries + ld a,[wListScrollOffset] + ld c,a + ld a,[wListMenuID] + cp a,ITEMLISTMENU + ld a,c + jr nz,.skipMultiplying +; if it's an item menu +; item entries are 2 bytes long, so multiply by 2 + sla a + sla c +.skipMultiplying + add e + ld e,a + jr nc,.noCarry + inc d +.noCarry + hlCoord 6, 4 ; coordinates of first list entry name + ld b,4 ; print 4 names +.loop + ld a,b + ld [wWhichPokemon],a + ld a,[de] + ld [wd11e],a + cp a,$ff + jp z,.printCancelMenuItem + push bc + push de + push hl + push hl + push de + ld a,[wListMenuID] + and a + jr z,.pokemonPCMenu + cp a,$01 + jr z,.movesMenu +.itemMenu + call GetItemName + jr .placeNameString +.pokemonPCMenu + push hl + ld hl,wPartyCount + ld a,[wcf8b] + cp l ; is it a list of party pokemon or box pokemon? + ld hl,wPartyMonNicks + jr z,.getPokemonName + ld hl, wBoxMonNicks ; box pokemon names +.getPokemonName + ld a,[wWhichPokemon] + ld b,a + ld a,4 + sub b + ld b,a + ld a,[wListScrollOffset] + add b + call GetPartyMonName + pop hl + jr .placeNameString +.movesMenu + call GetMoveName +.placeNameString + call PlaceString + pop de + pop hl + ld a,[wcf93] + and a ; should prices be printed? + jr z,.skipPrintingItemPrice +.printItemPrice + push hl + ld a,[de] + ld de,ItemPrices + ld [wcf91],a + call GetItemPrice ; get price + pop hl + ld bc,20 + 5 ; 1 row down and 5 columns right + add hl,bc + ld c,$a3 ; no leading zeroes, right-aligned, print currency symbol, 3 bytes + call PrintBCDNumber +.skipPrintingItemPrice + ld a,[wListMenuID] + and a + jr nz,.skipPrintingPokemonLevel +.printPokemonLevel + ld a,[wd11e] + push af + push hl + ld hl,wPartyCount + ld a,[wcf8b] + cp l ; is it a list of party pokemon or box pokemon? + ld a,$00 + jr z,.next + ld a,$02 +.next + ld [wcc49],a + ld hl,wWhichPokemon + ld a,[hl] + ld b,a + ld a,$04 + sub b + ld b,a + ld a,[wListScrollOffset] + add b + ld [hl],a + call LoadMonData ; load pokemon info + ld a,[wcc49] + and a ; is it a list of party pokemon or box pokemon? + jr z,.skipCopyingLevel +.copyLevel + ld a,[wcf9b] + ld [wcfb9],a +.skipCopyingLevel + pop hl + ld bc,$001c + add hl,bc + call PrintLevel ; print level + pop af + ld [wd11e],a +.skipPrintingPokemonLevel + pop hl + pop de + inc de + ld a,[wListMenuID] + cp a,ITEMLISTMENU + jr nz,.nextListEntry +.printItemQuantity + ld a,[wd11e] + ld [wcf91],a + call IsKeyItem ; check if item is unsellable + ld a,[wd124] + and a ; is the item unsellable? + jr nz,.skipPrintingItemQuantity ; if so, don't print the quantity + push hl + ld bc,20 + 8 ; 1 row down and 8 columns right + add hl,bc + ld a,"×" + ldi [hl],a + ld a,[wd11e] + push af + ld a,[de] + ld [wcf97],a + push de + ld de,wd11e + ld [de],a + ld bc,$0102 + call PrintNumber + pop de + pop af + ld [wd11e],a + pop hl +.skipPrintingItemQuantity + inc de + pop bc + inc c + push bc + inc c + ld a,[wcc35] ; ID of item chosen for swapping (counts from 1) + and a ; is an item being swapped? + jr z,.nextListEntry + sla a + cp c ; is it this item? + jr nz,.nextListEntry + dec hl + ld a,$ec ; unfilled right arrow menu cursor to indicate an item being swapped + ld [hli],a +.nextListEntry + ld bc,2 * 20 ; 2 rows + add hl,bc + pop bc + inc c + dec b + jp nz,.loop + ld bc,-8 + add hl,bc + ld a,$ee ; down arrow + ld [hl],a + ret +.printCancelMenuItem + ld de,ListMenuCancelText + jp PlaceString + +ListMenuCancelText:: ; 2f97 (0:2f97) + db "CANCEL@" + +GetMonName:: ; 2f9e (0:2f9e) + push hl + ld a,[H_LOADEDROMBANK] + push af + ld a,BANK(MonsterNames) ; 07 + ld [H_LOADEDROMBANK],a + ld [$2000],a + ld a,[wd11e] + dec a + ld hl,MonsterNames ; 421E + ld c,10 + ld b,0 + call AddNTimes + ld de,wcd6d + push de + ld bc,10 + call CopyData + ld hl,wcd77 + ld [hl], "@" + pop de + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a + pop hl + ret + +GetItemName:: ; 2fcf (0:2fcf) +; given an item ID at [wd11e], store the name of the item into a string +; starting at wcd6d + push hl + push bc + ld a,[wd11e] + cp HM_01 ; is this a TM/HM? + jr nc,.Machine + + ld [wd0b5],a + ld a,ITEM_NAME + ld [W_LISTTYPE],a + ld a,BANK(ItemNames) + ld [wPredefBank],a + call GetName + jr .Finish + +.Machine + call GetMachineName +.Finish + ld de,wcd6d ; pointer to where item name is stored in RAM + pop bc + pop hl + ret + +GetMachineName:: ; 2ff3 (0:2ff3) +; copies the name of the TM/HM in [wd11e] to wcd6d + push hl + push de + push bc + ld a,[wd11e] + push af + cp TM_01 ; is this a TM? [not HM] + jr nc,.WriteTM +; if HM, then write "HM" and add 5 to the item ID, so we can reuse the +; TM printing code + add 5 + ld [wd11e],a + ld hl,HiddenPrefix ; points to "HM" + ld bc,2 + jr .WriteMachinePrefix +.WriteTM + ld hl,TechnicalPrefix ; points to "TM" + ld bc,2 +.WriteMachinePrefix + ld de,wcd6d + call CopyData + +; now get the machine number and convert it to text + ld a,[wd11e] + sub TM_01 - 1 + ld b,$F6 ; "0" +.FirstDigit + sub 10 + jr c,.SecondDigit + inc b + jr .FirstDigit +.SecondDigit + add 10 + push af + ld a,b + ld [de],a + inc de + pop af + ld b,$F6 ; "0" + add b + ld [de],a + inc de + ld a,"@" + ld [de],a + + pop af + ld [wd11e],a + pop bc + pop de + pop hl + ret + +TechnicalPrefix:: ; 303c (0:303c) + db "TM" +HiddenPrefix:: ; 303e (0:303e) + db "HM" + +; sets carry if item is HM, clears carry if item is not HM +; Input: a = item ID +IsItemHM:: ; 3040 (0:3040) + cp a,HM_01 + jr c,.notHM + cp a,TM_01 + ret +.notHM + and a + ret + +; sets carry if move is an HM, clears carry if move is not an HM +; Input: a = move ID +IsMoveHM:: ; 3049 (0:3049) + ld hl,HMMoves + ld de,1 + jp IsInArray + +HMMoves:: ; 3052 (0:3052) + db CUT,FLY,SURF,STRENGTH,FLASH + db $ff ; terminator + +GetMoveName:: ; 3058 (0:3058) + push hl + ld a,MOVE_NAME + ld [W_LISTTYPE],a + ld a,[wd11e] + ld [wd0b5],a + ld a,BANK(MoveNames) + ld [wPredefBank],a + call GetName + ld de,wcd6d ; pointer to where move name is stored in RAM + pop hl + ret + +; reloads text box tile patterns, current map view, and tileset tile patterns +ReloadMapData:: ; 3071 (0:3071) + ld a,[H_LOADEDROMBANK] + push af + ld a,[W_CURMAP] + call SwitchToMapRomBank + call DisableLCD + call LoadTextBoxTilePatterns + call LoadCurrentMapView + call LoadTilesetTilePatternData + call EnableLCD + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a + ret + +; reloads tileset tile patterns +ReloadTilesetTilePatterns:: ; 3090 (0:3090) + ld a,[H_LOADEDROMBANK] + push af + ld a,[W_CURMAP] + call SwitchToMapRomBank + call DisableLCD + call LoadTilesetTilePatternData + call EnableLCD + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a + ret + +; shows the town map and lets the player choose a destination to fly to +ChooseFlyDestination:: ; 30a9 (0:30a9) + ld hl,wd72e + res 4,[hl] + ld b, BANK(LoadTownMap_Fly) + ld hl, LoadTownMap_Fly + jp Bankswitch + +; causes the text box to close waithout waiting for a button press after displaying text +DisableWaitingAfterTextDisplay:: ; 30b6 (0:30b6) + ld a,$01 + ld [wcc3c],a + ret + +; uses an item +; UseItem is used with dummy items to perform certain other functions as well +; INPUT: +; [wcf91] = item ID +; OUTPUT: +; [wcd6a] = success +; 00: unsucessful +; 01: successful +; 02: not able to be used right now, no extra menu displayed (only certain items use this) +UseItem:: ; 30bc (0:30bc) + ld b,BANK(UseItem_) + ld hl,UseItem_ + jp Bankswitch + +; confirms the item toss and then tosses the item +; INPUT: +; hl = address of inventory (either wNumBagItems or wNumBoxItems) +; [wcf91] = item ID +; [wWhichPokemon] = index of item within inventory +; [wcf96] = quantity to toss +; OUTPUT: +; clears carry flag if the item is tossed, sets carry flag if not +TossItem:: ; 30c4 (0:30c4) + ld a,[H_LOADEDROMBANK] + push af + ld a,BANK(TossItem_) + ld [H_LOADEDROMBANK],a + ld [$2000],a + call TossItem_ + pop de + ld a,d + ld [H_LOADEDROMBANK],a + ld [$2000],a + ret + +; checks if an item is a key item +; INPUT: +; [wcf91] = item ID +; OUTPUT: +; [wd124] = result +; 00: item is not key item +; 01: item is key item +IsKeyItem:: ; 30d9 (0:30d9) + push hl + push de + push bc + callba IsKeyItem_ + pop bc + pop de + pop hl + ret + +; function to draw various text boxes +; INPUT: +; [wd125] = text box ID +DisplayTextBoxID:: ; 30e8 (0:30e8) + ld a,[H_LOADEDROMBANK] + push af + ld a,BANK(DisplayTextBoxID_) + ld [H_LOADEDROMBANK],a + ld [$2000],a + call DisplayTextBoxID_ + pop bc + ld a,b + ld [H_LOADEDROMBANK],a + ld [$2000],a + ret + +Func_30fd:: ; 30fd (0:30fd) + ld a, [wcc57] + and a + ret nz + ld a, [wd736] + bit 1, a + ret nz + ld a, [wd730] + and $80 + ret + +Func_310e:: ; 310e (0:310e) + ld hl, wd736 + bit 0, [hl] + res 0, [hl] + jr nz, .asm_3146 + ld a, [wcc57] + and a + ret z + dec a + add a + ld d, $0 + ld e, a + ld hl, .pointerTable_3140 + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + ld a, [H_LOADEDROMBANK] + push af + ld a, [wcc58] + ld [H_LOADEDROMBANK], a + ld [$2000], a + ld a, [wcf10] + call CallFunctionInTable + pop af + ld [H_LOADEDROMBANK], a + ld [$2000], a + ret +.pointerTable_3140 + dw PointerTable_1a442 + dw PointerTable_1a510 + dw PointerTable_1a57d +.asm_3146 + ld b, BANK(Func_1a3e0) + ld hl, Func_1a3e0 + jp Bankswitch + +Func_314e:: ; 314e (0:314e) + ld b, BANK(Func_1a41d) + ld hl, Func_1a41d + jp Bankswitch + +Func_3156:: ; 3156 (0:3156) + ret + +; stores hl in [W_TRAINERHEADERPTR] +StoreTrainerHeaderPointer:: ; 3157 (0:3157) + ld a, h + ld [W_TRAINERHEADERPTR], a + ld a, l + ld [W_TRAINERHEADERPTR+1], a + ret + +; executes the current map script from the function pointer array provided in hl. +; a: map script index to execute (unless overridden by [wd733] bit 4) +ExecuteCurMapScriptInTable:: ; 3160 (0:3160) + push af + push de + call StoreTrainerHeaderPointer + pop hl + pop af + push hl + ld hl, W_FLAGS_D733 + bit 4, [hl] + res 4, [hl] + jr z, .useProvidedIndex ; test if map script index was overridden manually + ld a, [W_CURMAPSCRIPT] +.useProvidedIndex + pop hl + ld [W_CURMAPSCRIPT], a + call CallFunctionInTable + ld a, [W_CURMAPSCRIPT] + ret + +LoadGymLeaderAndCityName:: ; 317f (0:317f) + push de + ld de, wGymCityName + ld bc, $11 + call CopyData ; load city name + pop hl + ld de, wGymLeaderName + ld bc, $b + jp CopyData ; load gym leader name + +; reads specific information from trainer header (pointed to at W_TRAINERHEADERPTR) +; a: offset in header data +; 0 -> flag's bit (into wTrainerHeaderFlagBit) +; 2 -> flag's byte ptr (into hl) +; 4 -> before battle text (into hl) +; 6 -> after battle text (into hl) +; 8 -> end battle text (into hl) +ReadTrainerHeaderInfo:: ; 3193 (0:3193) + push de + push af + ld d, $0 + ld e, a + ld hl, W_TRAINERHEADERPTR + ld a, [hli] + ld l, [hl] + ld h, a + add hl, de + pop af + and a + jr nz, .nonZeroOffset + ld a, [hl] + ld [wTrainerHeaderFlagBit], a ; store flag's bit + jr .done +.nonZeroOffset + cp $2 + jr z, .readPointer ; read flag's byte ptr + cp $4 + jr z, .readPointer ; read before battle text + cp $6 + jr z, .readPointer ; read after battle text + cp $8 + jr z, .readPointer ; read end battle text + cp $a + jr nz, .done + ld a, [hli] ; read end battle text (2) but override the result afterwards (XXX why, bug?) + ld d, [hl] + ld e, a + jr .done +.readPointer + ld a, [hli] + ld h, [hl] + ld l, a +.done + pop de + ret + +TrainerFlagAction:: + predef_jump FlagActionPredef + +; direct talking to a trainer (rather than getting seen by one) +TalkToTrainer:: ; 31cc (0:31cc) + call StoreTrainerHeaderPointer + xor a + call ReadTrainerHeaderInfo ; read flag's bit + ld a, $2 + call ReadTrainerHeaderInfo ; read flag's byte ptr + ld a, [wTrainerHeaderFlagBit] + ld c, a + ld b, $2 + call TrainerFlagAction ; read trainer's flag + ld a, c + and a + jr z, .trainerNotYetFought ; test trainer's flag + ld a, $6 + call ReadTrainerHeaderInfo ; print after battle text + jp PrintText +.trainerNotYetFought ; 0x31ed + ld a, $4 + call ReadTrainerHeaderInfo ; print before battle text + call PrintText + ld a, $a + call ReadTrainerHeaderInfo ; (?) does nothing apparently (maybe bug in ReadTrainerHeaderInfo) + push de + ld a, $8 + call ReadTrainerHeaderInfo ; read end battle text + pop de + call PreBattleSaveRegisters + ld hl, W_FLAGS_D733 + set 4, [hl] ; activate map script index override (index is set below) + ld hl, wFlags_0xcd60 + bit 0, [hl] ; test if player is already being engaged by another trainer + ret nz + call EngageMapTrainer + ld hl, W_CURMAPSCRIPT + inc [hl] ; progress map script index (assuming it was 0 before) to start pre-battle routines + jp Func_325d + +; checks if any trainers are seeing the player and wanting to fight +CheckFightingMapTrainers:: ; 3219 (0:3219) + call CheckForEngagingTrainers + ld a, [wcf13] + cp $ff + jr nz, .trainerEngaging + xor a + ld [wcf13], a + ld [wTrainerHeaderFlagBit], a + ret +.trainerEngaging + ld hl, W_FLAGS_D733 + set 3, [hl] + ld [wcd4f], a + xor a + ld [wcd50], a + predef EmotionBubble + ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN + ld [wJoyIgnore], a + xor a + ldh [$b4], a + call TrainerWalkUpToPlayer_Bank0 + ld hl, W_CURMAPSCRIPT + inc [hl] ; progress to battle phase 1 (engaging) + ret + +Func_324c:: ; 324c (0:324c) + ld a, [wd730] + and $1 + ret nz + ld [wJoyIgnore], a + ld a, [wcf13] + ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + call DisplayTextID + +Func_325d:: ; 325d (0:325d) + xor a + ld [wJoyIgnore], a + call InitBattleEnemyParameters + ld hl, wd72d + set 6, [hl] + set 7, [hl] + ld hl, wd72e + set 1, [hl] + ld hl, W_CURMAPSCRIPT + inc [hl] ; progress to battle phase 2 (battling) + ret + +EndTrainerBattle:: ; 3275 (0:3275) + ld hl, wd126 + set 5, [hl] + set 6, [hl] + ld hl, wd72d + res 7, [hl] + ld hl, wFlags_0xcd60 + res 0, [hl] ; player is no longer engaged by any trainer + ld a, [W_ISINBATTLE] ; W_ISINBATTLE + cp $ff + jp z, ResetButtonPressedAndMapScript + ld a, $2 + call ReadTrainerHeaderInfo + ld a, [wTrainerHeaderFlagBit] + ld c, a + ld b, $1 + call TrainerFlagAction ; flag trainer as fought + ld a, [W_ENEMYMONORTRAINERCLASS] + cp $c8 + jr nc, .skipRemoveSprite ; test if trainer was fought (in that case skip removing the corresponding sprite) + ld hl, W_MISSABLEOBJECTLIST + ld de, $2 + ld a, [wcf13] + call IsInArray ; search for sprite ID + inc hl + ld a, [hl] + ld [wcc4d], a ; load corresponding missable object index and remove it + predef HideObject +.skipRemoveSprite + ld hl, wd730 + bit 4, [hl] + res 4, [hl] + ret nz + +ResetButtonPressedAndMapScript:: ; 32c1 (0:32c1) + xor a + ld [wJoyIgnore], a + ld [hJoyHeld], a + ld [hJoyPressed], a + ld [hJoyReleased], a + ld [W_CURMAPSCRIPT], a ; reset battle status + ret + +; calls TrainerWalkUpToPlayer +TrainerWalkUpToPlayer_Bank0:: ; 32cf (0:32cf) + ld b, BANK(TrainerWalkUpToPlayer) + ld hl, TrainerWalkUpToPlayer + jp Bankswitch + +; sets opponent type and mon set/lvl based on the engaging trainer data +InitBattleEnemyParameters:: ; 32d7 (0:32d7) + ld a, [wEngagedTrainerClass] + ld [W_CUROPPONENT], a ; wd059 + ld [W_ENEMYMONORTRAINERCLASS], a + cp $c8 + ld a, [wEngagedTrainerSet] ; wcd2e + jr c, .noTrainer + ld [W_TRAINERNO], a ; wd05d + ret +.noTrainer + ld [W_CURENEMYLVL], a ; W_CURENEMYLVL + ret + +Func_32ef:: ; 32ef (0:32ef) + ld hl, Func_567f9 + jr asm_3301 + +Func_32f4:: ; 32f4 (0:32f4) + ld hl, Func_56819 + jr asm_3301 ; 0x32f7 $8 + +Func_32f9:: ; 32f9 (0:32f9) + ld hl, Func_5683d + jr asm_3301 + +Func_32fe:: ; 32fe (0:32fe) + ld hl, Func_5685d +asm_3301:: ; 3301 (0:3301) + ld b, BANK(Func_567f9) ; BANK(Func_56819), BANK(Func_5683d), BANK(Func_5685d) + jp Bankswitch ; indirect jump to one of the four functions + +CheckForEngagingTrainers:: ; 3306 (0:3306) + xor a + call ReadTrainerHeaderInfo ; read trainer flag's bit (unused) + ld d, h ; store trainer header address in de + ld e, l +.trainerLoop + call StoreTrainerHeaderPointer ; set trainer header pointer to current trainer + ld a, [de] + ld [wcf13], a ; store trainer flag's bit + ld [wTrainerHeaderFlagBit], a + cp $ff + ret z + ld a, $2 + call ReadTrainerHeaderInfo ; read trainer flag's byte ptr + ld b, $2 + ld a, [wTrainerHeaderFlagBit] + ld c, a + call TrainerFlagAction ; read trainer flag + ld a, c + and a + jr nz, .trainerAlreadyFought + push hl + push de + push hl + xor a + call ReadTrainerHeaderInfo ; get trainer header pointer + inc hl + ld a, [hl] ; read trainer engage distance + pop hl + ld [wTrainerEngageDistance], a + ld a, [wcf13] + swap a + ld [wTrainerSpriteOffset], a ; wWhichTrade + predef TrainerEngage + pop de + pop hl + ld a, [wTrainerSpriteOffset] ; wWhichTrade + and a + ret nz ; break if the trainer is engaging +.trainerAlreadyFought + ld hl, $c + add hl, de + ld d, h + ld e, l + jr .trainerLoop + +; saves loaded rom bank and hl as well as de registers +PreBattleSaveRegisters:: ; 3354 (0:3354) + ld a, [H_LOADEDROMBANK] + ld [W_PBSTOREDROMBANK], a + ld a, h + ld [W_PBSTOREDREGISTERH], a + ld a, l + ld [W_PBSTOREDREGISTERL], a + ld a, d + ld [W_PBSTOREDREGISTERD], a + ld a, e + ld [W_PBSTOREDREGISTERE], a + ret + +; loads data of some trainer on the current map and plays pre-battle music +; [wcf13]: sprite ID of trainer who is engaged +EngageMapTrainer:: ; 336a (0:336a) + ld hl, W_MAPSPRITEEXTRADATA + ld d, $0 + ld a, [wcf13] + dec a + add a + ld e, a + add hl, de ; seek to engaged trainer data + ld a, [hli] ; load trainer class + ld [wEngagedTrainerClass], a + ld a, [hl] ; load trainer mon set + ld [wEnemyMonAttackMod], a ; wcd2e + jp PlayTrainerMusic + +Func_3381:: ; 3381 (0:3381) + push hl + ld hl, wd72d + bit 7, [hl] + res 7, [hl] + pop hl + ret z + ld a, [H_LOADEDROMBANK] + push af + ld a, [W_PBSTOREDROMBANK] + ld [H_LOADEDROMBANK], a + ld [$2000], a + push hl + callba SaveTrainerName + ld hl, TrainerNameText + call PrintText + pop hl + pop af + ld [H_LOADEDROMBANK], a + ld [$2000], a + callba Func_1a5e7 + jp WaitForSoundToFinish + +Func_33b7:: ; 33b7 (0:33b7) + ld a, [wcf0b] + and a + jr nz, .asm_33c6 + ld a, [W_PBSTOREDREGISTERH] + ld h, a + ld a, [W_PBSTOREDREGISTERL] + ld l, a + ret +.asm_33c6 + ld a, [W_PBSTOREDREGISTERD] + ld h, a + ld a, [W_PBSTOREDREGISTERE] + ld l, a + ret + +TrainerNameText:: ; 33cf (0:33cf) + TX_FAR _TrainerNameText + db $08 + +Func_33d4:: ; 33d4 (0:33d4) + call Func_33b7 + call TextCommandProcessor + jp TextScriptEnd + +Func_33dd:: ; 33dd (0:33dd) + ld a, [wFlags_0xcd60] + bit 0, a + ret nz + call EngageMapTrainer + xor a + ret + +PlayTrainerMusic:: ; 33e8 (0:33e8) + ld a, [wEngagedTrainerClass] + cp $c8 + SONY1 + ret z + cp $c8 + SONY2 + ret z + cp $c8 + SONY3 + ret z + ld a, [W_GYMLEADERNO] ; W_GYMLEADERNO + and a + ret nz + xor a + ld [wMusicHeaderPointer], a + ld a, $ff + call PlaySound ; stop music + ld a, BANK(Music_MeetEvilTrainer) + ld [wc0ef], a + ld [wc0f0], a + ld a, [wEngagedTrainerClass] + ld b, a + ld hl, EvilTrainerList +.evilTrainerListLoop + ld a, [hli] + cp $ff + jr z, .noEvilTrainer + cp b + jr nz, .evilTrainerListLoop + ld a, MUSIC_MEET_EVIL_TRAINER + jr .PlaySound +.noEvilTrainer + ld hl, FemaleTrainerList +.femaleTrainerListLoop + ld a, [hli] + cp $ff + jr z, .maleTrainer + cp b + jr nz, .femaleTrainerListLoop + ld a, MUSIC_MEET_FEMALE_TRAINER + jr .PlaySound +.maleTrainer + ld a, MUSIC_MEET_MALE_TRAINER +.PlaySound + ld [wc0ee], a + jp PlaySound + +INCLUDE "data/trainer_types.asm" + +Func_3442:: ; 3442 (0:3442) + ld a, [hli] + cp $ff + ret z + cp b + jr nz, .asm_345b + ld a, [hli] + cp c + jr nz, .asm_345c + ld a, [hli] + ld d, [hl] + ld e, a + ld hl, wccd3 + call DecodeRLEList + dec a + ld [wcd38], a + ret +.asm_345b + inc hl +.asm_345c + inc hl + inc hl + jr Func_3442 + +FuncTX_ItemStoragePC:: ; 3460 (0:3460) + call SaveScreenTilesToBuffer2 + ld b, BANK(PlayerPC) + ld hl, PlayerPC + jr bankswitchAndContinue + +FuncTX_BillsPC:: ; 346a (0:346a) + call SaveScreenTilesToBuffer2 + ld b, BANK(Func_214c2) + ld hl, Func_214c2 + jr bankswitchAndContinue + +FuncTX_SlotMachine:: ; 3474 (0:3474) +; XXX find a better name for this function +; special_F7 + ld b,BANK(CeladonPrizeMenu) + ld hl,CeladonPrizeMenu +bankswitchAndContinue:: ; 3479 (0:3479) + call Bankswitch + jp HoldTextDisplayOpen ; continue to main text-engine function + +FuncTX_PokemonCenterPC:: ; 347f (0:347f) + ld b, BANK(ActivatePC) + ld hl, ActivatePC + jr bankswitchAndContinue + +Func_3486:: ; 3486 (0:3486) + xor a + ld [wcd3b], a + ld [wSpriteStateData2 + $06], a + ld hl, wd730 + set 7, [hl] + ret + +IsItemInBag:: ; 3493 (0:3493) +; given an item_id in b +; set zero flag if item isn't in player's bag +; else reset zero flag +; related to Pokémon Tower and ghosts + predef IsItemInBag_ + ld a,b + and a + ret + +DisplayPokedex:: ; 349b (0:349b) + ld [wd11e], a + ld b, BANK(Func_7c18) + ld hl, Func_7c18 + jp Bankswitch + +Func_34a6:: ; 34a6 (0:34a6) + call Func_34ae + ld c, $6 + jp DelayFrames + +Func_34ae:: ; 34ae (0:34ae) + ld a, $9 + ld [H_DOWNARROWBLINKCNT1], a ; $ff8b + call Func_34fc + ld a, [$ff8d] + ld [hl], a + ret + +Func_34b9:: ; 34b9 (0:34b9) + ld de, $fff9 + add hl, de + ld [hl], a + ret + +; tests if the player's coordinates are in a specified array +; INPUT: +; hl = address of array +; OUTPUT: +; [wWhichTrade] = if there is match, the matching array index +; sets carry if the coordinates are in the array, clears carry if not +ArePlayerCoordsInArray:: ; 34bf (0:34bf) + ld a,[W_YCOORD] + ld b,a + ld a,[W_XCOORD] + ld c,a + ; fallthrough + +CheckCoords:: ; 34c7 (0:34c7) + xor a + ld [wWhichTrade],a +.loop + ld a,[hli] + cp a,$ff ; reached terminator? + jr z,.notInArray + push hl + ld hl,wWhichTrade + inc [hl] + pop hl +.compareYCoord + cp b + jr z,.compareXCoord + inc hl + jr .loop +.compareXCoord + ld a,[hli] + cp c + jr nz,.loop +.inArray + scf + ret +.notInArray + and a + ret + +; tests if a boulder's coordinates are in a specified array +; INPUT: +; hl = address of array +; ff8c = which boulder to check? XXX +; OUTPUT: +; [wWhichTrade] = if there is match, the matching array index +; sets carry if the coordinates are in the array, clears carry if not +CheckBoulderCoords:: ; 34e4 (0:34e4) + push hl + ld hl, wSpriteStateData2 + $04 + ld a, [$ff8c] + swap a + ld d, $0 + ld e, a + add hl, de + ld a, [hli] + sub $4 ; because sprite coordinates are offset by 4 + ld b, a + ld a, [hl] + sub $4 ; because sprite coordinates are offset by 4 + ld c, a + pop hl + jp CheckCoords + +Func_34fc:: ; 34fc (0:34fc) + ld h, $c1 + jr asm_3502 + +Func_3500:: ; 3500 (0:3500) + ld h, $c2 +asm_3502:: ; 3502 (0:3502) + ld a, [H_DOWNARROWBLINKCNT1] ; $ff8b + ld b, a + ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c + swap a + add b + ld l, a + ret + +; decodes a $ff-terminated RLEncoded list +; each entry is a pair of bytes <byte value> <repetitions> +; the final $ff will be replicated in the output list and a contains the number of bytes written +; de: input list +; hl: output list +DecodeRLEList:: ; 350c (0:350c) + xor a + ld [wRLEByteCount], a ; count written bytes here +.listLoop + ld a, [de] + cp $ff + jr z, .endOfList + ld [H_DOWNARROWBLINKCNT1], a ; store byte value to be written + inc de + ld a, [de] + ld b, $0 + ld c, a ; number of bytes to be written + ld a, [wRLEByteCount] + add c + ld [wRLEByteCount], a ; update total number of written bytes + ld a, [H_DOWNARROWBLINKCNT1] ; $ff8b + call FillMemory ; write a c-times to output + inc de + jr .listLoop +.endOfList + ld a, $ff + ld [hl], a ; write final $ff + ld a, [wRLEByteCount] + inc a ; include sentinel in counting + ret + +; sets movement byte 1 for sprite [$FF8C] to $FE and byte 2 to [$FF8D] +SetSpriteMovementBytesToFE:: ; 3533 (0:3533) + push hl + call GetSpriteMovementByte1Pointer + ld [hl], $fe + call GetSpriteMovementByte2Pointer + ld a, [$ff8d] + ld [hl], a + pop hl + ret + +; sets both movement bytes for sprite [$FF8C] to $FF +SetSpriteMovementBytesToFF:: ; 3541 (0:3541) + push hl + call GetSpriteMovementByte1Pointer + ld [hl],$FF + call GetSpriteMovementByte2Pointer + ld [hl],$FF ; prevent person from walking? + pop hl + ret + +; returns the sprite movement byte 1 pointer for sprite [$FF8C] in hl +GetSpriteMovementByte1Pointer:: ; 354e (0:354e) + ld h,$C2 + ld a,[$FF8C] ; the sprite to move + swap a + add a,6 + ld l,a + ret + +; returns the sprite movement byte 2 pointer for sprite [$FF8C] in hl +GetSpriteMovementByte2Pointer:: ; 3558 (0:3558) + push de + ld hl,W_MAPSPRITEDATA + ld a,[$FF8C] ; the sprite to move + dec a + add a + ld d,0 + ld e,a + add hl,de + pop de + ret + +GetTrainerInformation:: ; 3566 (0:3566) + call GetTrainerName + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE + and a + jr nz, .linkBattle + ld a, Bank(TrainerPicAndMoneyPointers) + call BankswitchHome + ld a, [W_TRAINERCLASS] ; wd031 + dec a + ld hl, TrainerPicAndMoneyPointers + ld bc, $5 + call AddNTimes + ld de, wd033 + ld a, [hli] + ld [de], a + inc de + ld a, [hli] + ld [de], a + ld de, wd046 + ld a, [hli] + ld [de], a + inc de + ld a, [hli] + ld [de], a + jp BankswitchBack +.linkBattle + ld hl, wd033 + ld de, RedPicFront + ld [hl], e + inc hl + ld [hl], d + ret + +GetTrainerName:: ; 359e (0:359e) + ld b, BANK(GetTrainerName_) + ld hl, GetTrainerName_ + jp Bankswitch + + +HasEnoughMoney:: +; Check if the player has at least as much +; money as the 3-byte BCD value at $ff9f. + ld de, wPlayerMoney + ld hl, $ff9f + ld c, 3 + jp StringCmp + +HasEnoughCoins:: +; Check if the player has at least as many +; coins as the 2-byte BCD value at $ffa0. + ld de, wPlayerCoins + ld hl, $ffa0 + ld c, 2 + jp StringCmp + + +BankswitchHome:: ; 35bc (0:35bc) +; switches to bank # in a +; Only use this when in the home bank! + ld [wcf09],a + ld a,[H_LOADEDROMBANK] + ld [wcf08],a + ld a,[wcf09] + ld [H_LOADEDROMBANK],a + ld [$2000],a + ret + +BankswitchBack:: ; 35cd (0:35cd) +; returns from BankswitchHome + ld a,[wcf08] + ld [H_LOADEDROMBANK],a + ld [$2000],a + ret + +Bankswitch:: ; 35d6 (0:35d6) +; self-contained bankswitch, use this when not in the home bank +; switches to the bank in b + ld a,[H_LOADEDROMBANK] + push af + ld a,b + ld [H_LOADEDROMBANK],a + ld [$2000],a + ld bc,.Return + push bc + jp [hl] +.Return + pop bc + ld a,b + ld [H_LOADEDROMBANK],a + ld [$2000],a + ret + +; displays yes/no choice +; yes -> set carry +YesNoChoice:: ; 35ec (0:35ec) + call SaveScreenTilesToBuffer1 + call InitYesNoTextBoxParameters + jr DisplayYesNoChoice + +Func_35f4:: ; 35f4 (0:35f4) + ld a, $14 + ld [wd125], a + call InitYesNoTextBoxParameters + jp DisplayTextBoxID + +InitYesNoTextBoxParameters:: ; 35ff (0:35ff) + xor a + ld [wd12c], a + hlCoord 14, 7 + ld bc, $80f + ret + +YesNoChoicePokeCenter:: ; 360a (0:360a) + call SaveScreenTilesToBuffer1 + ld a, $6 + ld [wd12c], a + hlCoord 11, 6 + ld bc, $80c + jr DisplayYesNoChoice + +Func_361a:: ; 361a (0:361a) + call SaveScreenTilesToBuffer1 + ld a, $3 + ld [wd12c], a + hlCoord 12, 7 + ld bc, $080d +DisplayYesNoChoice:: ; 3628 (0:3628) + ld a, $14 + ld [wd125], a + call DisplayTextBoxID + jp LoadScreenTilesFromBuffer1 + +; calculates the difference |a-b|, setting carry flag if a<b +CalcDifference:: ; 3633 (0:3633) + sub b + ret nc + cpl + add $1 + scf + ret + +MoveSprite:: ; 363a (0:363a) +; move the sprite [$FF8C] with the movement pointed to by de +; actually only copies the movement data to wcc5b for later + call SetSpriteMovementBytesToFF +MoveSprite_:: ; 363d (0:363d) + push hl + push bc + call GetSpriteMovementByte1Pointer + xor a + ld [hl],a + ld hl,wcc5b + ld c,0 + +.loop + ld a,[de] + ld [hli],a + inc de + inc c + cp a,$FF ; have we reached the end of the movement data? + jr nz,.loop + + ld a,c + ld [wcf0f],a ; number of steps taken + + pop bc + ld hl,wd730 + set 0,[hl] + pop hl + xor a + ld [wcd3b],a + ld [wccd3],a + dec a + ld [wJoyIgnore],a + ld [wcd3a],a + ret + +Func_366b:: ; 366b (0:366b) + push hl + ld hl, $ffe7 + xor a + ld [hld], a + ld a, [hld] + and a + jr z, .asm_367e + ld a, [hli] +.asm_3676 + sub [hl] + jr c, .asm_367e + inc hl + inc [hl] + dec hl + jr .asm_3676 +.asm_367e + pop hl + ret + +; copies the tile patterns for letters and numbers into VRAM +LoadFontTilePatterns:: ; 3680 (0:3680) + ld a,[rLCDC] + bit 7,a ; is the LCD enabled? + jr nz,.lcdEnabled +.lcdDisabled + ld hl,FontGraphics + ld de,vFont + ld bc,$400 + ld a,BANK(FontGraphics) + jp FarCopyDataDouble ; if LCD is off, transfer all at once +.lcdEnabled + ld de,FontGraphics + ld hl,vFont + ld bc,(BANK(FontGraphics) << 8 | $80) + jp CopyVideoDataDouble ; if LCD is on, transfer during V-blank + +; copies the text box tile patterns into VRAM +LoadTextBoxTilePatterns:: ; 36a0 (0:36a0) + ld a,[rLCDC] + bit 7,a ; is the LCD enabled? + jr nz,.lcdEnabled +.lcdDisabled + ld hl,TextBoxGraphics + ld de,vChars2 + $600 + ld bc,$200 + ld a,BANK(TextBoxGraphics) + jp FarCopyData2 ; if LCD is off, transfer all at once +.lcdEnabled + ld de,TextBoxGraphics + ld hl,vChars2 + $600 + ld bc,(BANK(TextBoxGraphics) << 8 | $20) + jp CopyVideoData ; if LCD is on, transfer during V-blank + +; copies HP bar and status display tile patterns into VRAM +LoadHpBarAndStatusTilePatterns:: ; 36c0 (0:36c0) + ld a,[rLCDC] + bit 7,a ; is the LCD enabled? + jr nz,.lcdEnabled +.lcdDisabled + ld hl,HpBarAndStatusGraphics + ld de,vChars2 + $620 + ld bc,$1e0 + ld a,BANK(HpBarAndStatusGraphics) + jp FarCopyData2 ; if LCD is off, transfer all at once +.lcdEnabled + ld de,HpBarAndStatusGraphics + ld hl,vChars2 + $620 + ld bc,(BANK(HpBarAndStatusGraphics) << 8 | $1e) + jp CopyVideoData ; if LCD is on, transfer during V-blank + +;Fills memory range with the specified byte. +;input registers a = fill_byte, bc = length, hl = address +FillMemory:: ; 36e0 (0:36e0) + push de + ld d, a +.loop + ld a, d + ldi [hl], a + dec bc + ld a, b + or c + jr nz, .loop + pop de + ret + +; loads sprite that de points to +; bank of sprite is given in a +UncompressSpriteFromDE:: ; 36eb (0:36eb) + ld hl, W_SPRITEINPUTPTR + ld [hl], e + inc hl + ld [hl], d + jp UncompressSpriteData + +SaveScreenTilesToBuffer2:: ; 36f4 (0:36f4) + ld hl, wTileMap + ld de, wTileMapBackup2 + ld bc, $168 + call CopyData + ret + +LoadScreenTilesFromBuffer2:: ; 3701 (0:3701) + call LoadScreenTilesFromBuffer2DisableBGTransfer + ld a, $1 + ld [H_AUTOBGTRANSFERENABLED], a ; $ffba + ret + +; loads screen tiles stored in wTileMapBackup2 but leaves H_AUTOBGTRANSFERENABLED disabled +LoadScreenTilesFromBuffer2DisableBGTransfer:: ; 3709 (0:3709) + xor a + ld [H_AUTOBGTRANSFERENABLED], a ; $ffba + ld hl, wTileMapBackup2 + ld de, wTileMap + ld bc, $168 + call CopyData + ret + +SaveScreenTilesToBuffer1:: ; 3719 (0:3719) + ld hl, wTileMap + ld de, wTileMapBackup + ld bc, $168 + jp CopyData + +LoadScreenTilesFromBuffer1:: ; 3725 (0:3725) + xor a + ld [H_AUTOBGTRANSFERENABLED], a ; $ffba + ld hl, wTileMapBackup + ld de, wTileMap + ld bc, $168 + call CopyData + ld a, $1 + ld [H_AUTOBGTRANSFERENABLED], a ; $ffba + ret + +DelayFrames:: ; 3739 (0:3739) +; wait n frames, where n is the value in c + call DelayFrame + dec c + jr nz,DelayFrames + ret + +PlaySoundWaitForCurrent:: ; 3740 (0:3740) + push af + call WaitForSoundToFinish + pop af + jp PlaySound + +; Wait for sound to finish playing +WaitForSoundToFinish:: ; 3748 (0:3748) + ld a, [wd083] + and $80 + ret nz + push hl +.asm_374f + ld hl, wc02a + xor a + or [hl] + inc hl + or [hl] + inc hl + inc hl + or [hl] + jr nz, .asm_374f + pop hl + ret + +NamePointers:: ; 375d (0:375d) + dw MonsterNames + dw MoveNames + dw UnusedNames + dw ItemNames + dw wPartyMonOT ; player's OT names list + dw wEnemyMonOT ; enemy's OT names list + dw TrainerNames + +GetName:: ; 376b (0:376b) +; arguments: +; [wd0b5] = which name +; [wd0b6] = which list (W_LISTTYPE) +; [wPredefBank] = bank of list +; +; returns pointer to name in de + ld a,[wd0b5] + ld [wd11e],a + cp a,$C4 ;it's TM/HM + jp nc,GetMachineName + ld a,[H_LOADEDROMBANK] + push af + push hl + push bc + push de + ld a,[W_LISTTYPE] ;List3759_entrySelector + dec a + jr nz,.otherEntries + ;1 = MON_NAMES + call GetMonName + ld hl,11 + add hl,de + ld e,l + ld d,h + jr .gotPtr +.otherEntries ; $378d + ;2-7 = OTHER ENTRIES + ld a,[wPredefBank] + ld [H_LOADEDROMBANK],a + ld [$2000],a + ld a,[W_LISTTYPE] ;VariousNames' entryID + dec a + add a + ld d,0 + ld e,a + jr nc,.skip + inc d +.skip ; $37a0 + ld hl,NamePointers + add hl,de + ld a,[hli] + ld [$ff96],a + ld a,[hl] + ld [$ff95],a + ld a,[$ff95] + ld h,a + ld a,[$ff96] + ld l,a + ld a,[wd0b5] + ld b,a + ld c,0 +.nextName + ld d,h + ld e,l +.nextChar + ld a,[hli] + cp a, "@" + jr nz,.nextChar + inc c ;entry counter + ld a,b ;wanted entry + cp c + jr nz,.nextName + ld h,d + ld l,e + ld de,wcd6d + ld bc,$0014 + call CopyData +.gotPtr ; $37cd + ld a,e + ld [wcf8d],a + ld a,d + ld [wcf8e],a + pop de + pop bc + pop hl + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a + ret + +GetItemPrice:: ; 37df (0:37df) + ld a, [H_LOADEDROMBANK] + push af + ld a, [wListMenuID] ; wListMenuID + cp $1 + ld a, $1 ; hardcoded Bank + jr nz, .asm_37ed + ld a, $f ; hardcoded Bank +.asm_37ed + ld [H_LOADEDROMBANK], a + ld [$2000], a + ld hl, wcf8f + ld a, [hli] + ld h, [hl] + ld l, a + ld a, [wcf91] + cp HM_01 + jr nc, .asm_3812 + ld bc, $3 +.asm_3802 + add hl, bc + dec a + jr nz, .asm_3802 + dec hl + ld a, [hld] + ld [$ff8d], a + ld a, [hld] + ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld a, [hl] + ld [H_DOWNARROWBLINKCNT1], a ; $ff8b + jr .asm_381c +.asm_3812 + ld a, Bank(GetMachinePrice) + ld [H_LOADEDROMBANK], a + ld [$2000], a + call GetMachinePrice +.asm_381c + ld de, H_DOWNARROWBLINKCNT1 ; $ff8b + pop af + ld [H_LOADEDROMBANK], a + ld [$2000], a + ret + +; copies a string from [de] to [wcf4b] +CopyStringToCF4B:: ; 3826 (0:3826) + ld hl, wcf4b + ; fall through + +; copies a string from [de] to [hl] +CopyString:: ; 3829 (0:3829) + ld a, [de] + inc de + ld [hli], a + cp "@" + jr nz, CopyString + ret + +; this function is used when lower button sensitivity is wanted (e.g. menus) +; OUTPUT: [$ffb5] = pressed buttons in usual format +; there are two flags that control its functionality, [$ffb6] and [$ffb7] +; there are esentially three modes of operation +; 1. Get newly pressed buttons only +; ([$ffb7] == 0, [$ffb6] == any) +; Just copies [hJoyPressed] to [$ffb5]. +; 2. Get currently pressed buttons at low sample rate with delay +; ([$ffb7] == 1, [$ffb6] != 0) +; If the user holds down buttons for more than half a second, +; report buttons as being pressed up to 12 times per second thereafter. +; If the user holds down buttons for less than half a second, +; report only one button press. +; 3. Same as 2, but report no buttons as pressed if A or B is held down. +; ([$ffb7] == 1, [$ffb6] == 0) +JoypadLowSensitivity:: ; 3831 (0:3831) + call Joypad + ld a,[$ffb7] ; flag + and a ; get all currently pressed buttons or only newly pressed buttons? + ld a,[hJoyPressed] ; newly pressed buttons + jr z,.storeButtonState + ld a,[hJoyHeld] ; all currently pressed buttons +.storeButtonState + ld [$ffb5],a + ld a,[hJoyPressed] ; newly pressed buttons + and a ; have any buttons been newly pressed since last check? + jr z,.noNewlyPressedButtons +.newlyPressedButtons + ld a,30 ; half a second delay + ld [H_FRAMECOUNTER],a + ret +.noNewlyPressedButtons + ld a,[H_FRAMECOUNTER] + and a ; is the delay over? + jr z,.delayOver +.delayNotOver + xor a + ld [$ffb5],a ; report no buttons as pressed + ret +.delayOver +; if [$ffb6] = 0 and A or B is pressed, report no buttons as pressed + ld a,[hJoyHeld] + and a,%00000011 ; A and B buttons + jr z,.setShortDelay + ld a,[$ffb6] ; flag + and a + jr nz,.setShortDelay + xor a + ld [$ffb5],a +.setShortDelay + ld a,5 ; 1/12 of a second delay + ld [H_FRAMECOUNTER],a + ret + +WaitForTextScrollButtonPress:: ; 3865 (0:3865) + ld a, [H_DOWNARROWBLINKCNT1] ; $ff8b + push af + ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c + push af + xor a + ld [H_DOWNARROWBLINKCNT1], a ; $ff8b + ld a, $6 + ld [H_DOWNARROWBLINKCNT2], a ; $ff8c +.asm_3872 + push hl + ld a, [wd09b] + and a + jr z, .asm_387c + call Func_716c6 +.asm_387c + hlCoord 18, 16 + call HandleDownArrowBlinkTiming + pop hl + call JoypadLowSensitivity + predef Func_5a5f + ld a, [$ffb5] + and A_BUTTON | B_BUTTON + jr z, .asm_3872 + pop af + ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + pop af + ld [H_DOWNARROWBLINKCNT1], a ; $ff8b + ret + +; (unlass in link battle) waits for A or B being pressed and outputs the scrolling sound effect +ManualTextScroll:: ; 3898 (0:3898) + ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE + cp $4 + jr z, .inLinkBattle + call WaitForTextScrollButtonPress + ld a, (SFX_02_40 - SFX_Headers_02) / 3 + jp PlaySound +.inLinkBattle + ld c, $41 + jp DelayFrames + +; function to do multiplication +; all values are big endian +; INPUT +; FF96-FF98 = multiplicand +; FF99 = multiplier +; OUTPUT +; FF95-FF98 = product +Multiply:: ; 38ac (0:38ac) + push hl + push bc + callab _Multiply + pop bc + pop hl + ret + +; function to do division +; all values are big endian +; INPUT +; FF95-FF98 = dividend +; FF99 = divisor +; b = number of bytes in the dividend (starting from FF95) +; OUTPUT +; FF95-FF98 = quotient +; FF99 = remainder +Divide:: ; 38b9 (0:38b9) + push hl + push de + push bc + ld a,[H_LOADEDROMBANK] + push af + ld a,Bank(_Divide) + ld [H_LOADEDROMBANK],a + ld [$2000],a + call _Divide + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a + pop bc + pop de + pop hl + ret + +; This function is used to wait a short period after printing a letter to the +; screen unless the player presses the A/B button or the delay is turned off +; through the [wd730] or [wd358] flags. +PrintLetterDelay:: ; 38d3 (0:38d3) + ld a,[wd730] + bit 6,a + ret nz + ld a,[wd358] + bit 1,a + ret z + push hl + push de + push bc + ld a,[wd358] + bit 0,a + jr z,.waitOneFrame + ld a,[W_OPTIONS] + and a,$0f + ld [H_FRAMECOUNTER],a + jr .checkButtons +.waitOneFrame + ld a,1 + ld [H_FRAMECOUNTER],a +.checkButtons + call Joypad + ld a,[hJoyHeld] +.checkAButton + bit 0,a ; is the A button pressed? + jr z,.checkBButton + jr .endWait +.checkBButton + bit 1,a ; is the B button pressed? + jr z,.buttonsNotPressed +.endWait + call DelayFrame + jr .done +.buttonsNotPressed ; if neither A nor B is pressed + ld a,[H_FRAMECOUNTER] + and a + jr nz,.checkButtons +.done + pop bc + pop de + pop hl + ret + +; Copies [hl, bc) to [de, bc - hl). +; In other words, the source data is from hl up to but not including bc, +; and the destination is de. +CopyDataUntil:: ; 3913 (0:3913) + ld a,[hli] + ld [de],a + inc de + ld a,h + cp b + jr nz,CopyDataUntil + ld a,l + cp c + jr nz,CopyDataUntil + ret + +; Function to remove a pokemon from the party or the current box. +; wWhichPokemon determines the pokemon. +; [wcf95] == 0 specifies the party. +; [wcf95] != 0 specifies the current box. +RemovePokemon:: ; 391f (0:391f) + ld hl, _RemovePokemon + ld b, BANK(_RemovePokemon) + jp Bankswitch + +AddPartyMon:: ; 3927 (0:3927) + push hl + push de + push bc + callba _AddPartyMon + pop bc + pop de + pop hl + ret + +; calculates all 5 stats of current mon and writes them to [de] +CalcStats:: ; 3936 (0:3936) + ld c, $0 +.statsLoop + inc c + call CalcStat + ld a, [H_MULTIPLICAND+1] + ld [de], a + inc de + ld a, [H_MULTIPLICAND+2] + ld [de], a + inc de + ld a, c + cp $5 + jr nz, .statsLoop + ret + +; calculates stat c of current mon +; c: stat to calc (HP=1,Atk=2,Def=3,Spd=4,Spc=5) +; b: consider stat exp? +; hl: base ptr to stat exp values ([hl + 2*c - 1] and [hl + 2*c]) +CalcStat:: ; 394a (0:394a) + push hl + push de + push bc + ld a, b + ld d, a + push hl + ld hl, W_MONHEADER + ld b, $0 + add hl, bc + ld a, [hl] ; read base value of stat + ld e, a + pop hl + push hl + sla c + ld a, d + and a + jr z, .statExpDone ; consider stat exp? + add hl, bc ; skip to corresponding stat exp value +.statExpLoop ; calculates ceil(Sqrt(stat exp)) in b + xor a + ld [H_MULTIPLICAND], a + ld [H_MULTIPLICAND+1], a + inc b ; increment current stat exp bonus + ld a, b + cp $ff + jr z, .statExpDone + ld [H_MULTIPLICAND+2], a + ld [H_MULTIPLIER], a + call Multiply + ld a, [hld] + ld d, a + ld a, [$ff98] + sub d + ld a, [hli] + ld d, a + ld a, [$ff97] + sbc d ; test if (current stat exp bonus)^2 < stat exp + jr c, .statExpLoop +.statExpDone + srl c + pop hl + push bc + ld bc, $b ; skip to stat IV values + add hl, bc + pop bc + ld a, c + cp $2 + jr z, .getAttackIV + cp $3 + jr z, .getDefenseIV + cp $4 + jr z, .getSpeedIV + cp $5 + jr z, .getSpecialIV +.getHpIV + push bc + ld a, [hl] ; Atk IV + swap a + and $1 + sla a + sla a + sla a + ld b, a + ld a, [hli] ; Def IV + and $1 + sla a + sla a + add b + ld b, a + ld a, [hl] ; Spd IV + swap a + and $1 + sla a + add b + ld b, a + ld a, [hl] ; Spc IV + and $1 + add b ; HP IV: LSB of the other 4 IVs + pop bc + jr .calcStatFromIV +.getAttackIV + ld a, [hl] + swap a + and $f + jr .calcStatFromIV +.getDefenseIV + ld a, [hl] + and $f + jr .calcStatFromIV +.getSpeedIV + inc hl + ld a, [hl] + swap a + and $f + jr .calcStatFromIV +.getSpecialIV + inc hl + ld a, [hl] + and $f +.calcStatFromIV + ld d, $0 + add e + ld e, a + jr nc, .noCarry + inc d ; de = Base + IV +.noCarry + sla e + rl d ; de = (Base + IV) * 2 + srl b + srl b ; b = ceil(Sqrt(stat exp)) / 4 + ld a, b + add e + jr nc, .noCarry2 + inc d ; da = (Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4 +.noCarry2 + ld [H_MULTIPLICAND+2], a + ld a, d + ld [H_MULTIPLICAND+1], a + xor a + ld [H_MULTIPLICAND], a + ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL + ld [H_MULTIPLIER], a + call Multiply ; ((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level + ld a, [H_MULTIPLICAND] + ld [H_DIVIDEND], a + ld a, [H_MULTIPLICAND+1] + ld [H_DIVIDEND+1], a + ld a, [H_MULTIPLICAND+2] + ld [H_DIVIDEND+2], a + ld a, $64 + ld [H_DIVISOR], a + ld a, $3 + ld b, a + call Divide ; (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + ld a, c + cp $1 + ld a, $5 + jr nz, .notHPStat + ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL + ld b, a + ld a, [H_MULTIPLICAND+2] + add b + ld [H_MULTIPLICAND+2], a + jr nc, .noCarry3 + ld a, [H_MULTIPLICAND+1] + inc a + ld [H_MULTIPLICAND+1], a ; HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + Level +.noCarry3 + ld a, $a +.notHPStat + ld b, a + ld a, [H_MULTIPLICAND+2] + add b + ld [H_MULTIPLICAND+2], a + jr nc, .noCarry4 + ld a, [H_MULTIPLICAND+1] + inc a ; non-HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + 5 + ld [H_MULTIPLICAND+1], a ; HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + Level + 10 +.noCarry4 + ld a, [H_MULTIPLICAND+1] ; check for overflow (>999) + cp $4 + jr nc, .overflow + cp $3 + jr c, .noOverflow + ld a, [H_MULTIPLICAND+2] + cp $e8 + jr c, .noOverflow +.overflow + ld a, $3 ; overflow: cap at 999 + ld [H_MULTIPLICAND+1], a + ld a, $e7 + ld [H_MULTIPLICAND+2], a +.noOverflow + pop bc + pop de + pop hl + ret + +AddEnemyMonToPlayerParty:: ; 3a53 (0:3a53) + ld a, [H_LOADEDROMBANK] + push af + ld a, BANK(_AddEnemyMonToPlayerParty) + ld [H_LOADEDROMBANK], a + ld [$2000], a + call _AddEnemyMonToPlayerParty + pop bc + ld a, b + ld [H_LOADEDROMBANK], a + ld [$2000], a + ret + +Func_3a68:: ; 3a68 (0:3a68) + ld a, [H_LOADEDROMBANK] + push af + ld a, BANK(Func_f51e) + ld [H_LOADEDROMBANK], a + ld [$2000], a + call Func_f51e + pop bc + ld a, b + ld [H_LOADEDROMBANK], a + ld [$2000], a + ret + +; skips a text entries, each of size $b (like trainer name, OT name, rival name, ...) +; hl: base pointer, will be incremented by $b * a +SkipFixedLengthTextEntries:: ; 3a7d (0:3a7d) + and a + ret z + ld bc, $b +.skipLoop + add hl, bc + dec a + jr nz, .skipLoop + ret + +AddNTimes:: ; 3a87 (0:3a87) +; add bc to hl a times + and a + ret z +.loop + add hl,bc + dec a + jr nz,.loop + ret + +; Compare strings, c bytes in length, at de and hl. +; Often used to compare big endian numbers in battle calculations. +StringCmp:: ; 3a8e (0:3a8e) + ld a,[de] + cp [hl] + ret nz + inc de + inc hl + dec c + jr nz,StringCmp + ret + +; INPUT: +; a = oam block index (each block is 4 oam entries) +; b = Y coordinate of upper left corner of sprite +; c = X coordinate of upper left corner of sprite +; de = base address of 4 tile number and attribute pairs +WriteOAMBlock:: ; 3a97 (0:3a97) + ld h,wOAMBuffer / $100 + swap a ; multiply by 16 + ld l,a + call .writeOneEntry ; upper left + push bc + ld a,8 + add c + ld c,a + call .writeOneEntry ; upper right + pop bc + ld a,8 + add b + ld b,a + call .writeOneEntry ; lower left + ld a,8 + add c + ld c,a + ; lower right +.writeOneEntry + ld [hl],b ; Y coordinate + inc hl + ld [hl],c ; X coordinate + inc hl + ld a,[de] ; tile number + inc de + ld [hli],a + ld a,[de] ; attribute + inc de + ld [hli],a + ret + +HandleMenuInput:: ; 3abe (0:3abe) + xor a + ld [wd09b],a + +HandleMenuInputPokemonSelection:: ; 3ac2 (0:3ac2) + ld a,[H_DOWNARROWBLINKCNT1] + push af + ld a,[H_DOWNARROWBLINKCNT2] + push af ; save existing values on stack + xor a + ld [H_DOWNARROWBLINKCNT1],a ; blinking down arrow timing value 1 + ld a,$06 + ld [H_DOWNARROWBLINKCNT2],a ; blinking down arrow timing value 2 +.loop1 + xor a + ld [W_SUBANIMTRANSFORM],a ; counter for pokemon shaking animation + call PlaceMenuCursor + call Delay3 +.loop2 + push hl + ld a,[wd09b] + and a ; is it a pokemon selection menu? + jr z,.getJoypadState + callba AnimatePartyMon ; shake mini sprite of selected pokemon +.getJoypadState + pop hl + call JoypadLowSensitivity + ld a,[$ffb5] + and a ; was a key pressed? + jr nz,.keyPressed + push hl + hlCoord 18, 11 ; coordinates of blinking down arrow in some menus + call HandleDownArrowBlinkTiming ; blink down arrow (if any) + pop hl + ld a,[wMenuJoypadPollCount] + dec a + jr z,.giveUpWaiting + jr .loop2 +.giveUpWaiting +; if a key wasn't pressed within the specified number of checks + pop af + ld [H_DOWNARROWBLINKCNT2],a + pop af + ld [H_DOWNARROWBLINKCNT1],a ; restore previous values + xor a + ld [wMenuWrappingEnabled],a ; disable menu wrapping + ret +.keyPressed + xor a + ld [wcc4b],a + ld a,[$ffb5] + ld b,a + bit 6,a ; pressed Up key? + jr z,.checkIfDownPressed +.upPressed + ld a,[wCurrentMenuItem] ; selected menu item + and a ; already at the top of the menu? + jr z,.alreadyAtTop +.notAtTop + dec a + ld [wCurrentMenuItem],a ; move selected menu item up one space + jr .checkOtherKeys +.alreadyAtTop + ld a,[wMenuWrappingEnabled] + and a ; is wrapping around enabled? + jr z,.noWrappingAround + ld a,[wMaxMenuItem] + ld [wCurrentMenuItem],a ; wrap to the bottom of the menu + jr .checkOtherKeys +.checkIfDownPressed + bit 7,a + jr z,.checkOtherKeys +.downPressed + ld a,[wCurrentMenuItem] + inc a + ld c,a + ld a,[wMaxMenuItem] + cp c + jr nc,.notAtBottom +.alreadyAtBottom + ld a,[wMenuWrappingEnabled] + and a ; is wrapping around enabled? + jr z,.noWrappingAround + ld c,$00 ; wrap from bottom to top +.notAtBottom + ld a,c + ld [wCurrentMenuItem],a +.checkOtherKeys + ld a,[wMenuWatchedKeys] + and b ; does the menu care about any of the pressed keys? + jp z,.loop1 +.checkIfAButtonOrBButtonPressed + ld a,[$ffb5] + and a,%00000011 ; pressed A button or B button? + jr z,.skipPlayingSound +.AButtonOrBButtonPressed + push hl + ld hl,wFlags_0xcd60 + bit 5,[hl] + pop hl + jr nz,.skipPlayingSound + ld a,(SFX_02_40 - SFX_Headers_02) / 3 + call PlaySound ; play sound +.skipPlayingSound + pop af + ld [H_DOWNARROWBLINKCNT2],a + pop af + ld [H_DOWNARROWBLINKCNT1],a ; restore previous values + xor a + ld [wMenuWrappingEnabled],a ; disable menu wrapping + ld a,[$ffb5] + ret +.noWrappingAround + ld a,[wcc37] + and a ; should we return if the user tried to go past the top or bottom? + jr z,.checkOtherKeys + jr .checkIfAButtonOrBButtonPressed + +PlaceMenuCursor:: ; 3b7c (0:3b7c) + ld a,[wTopMenuItemY] + and a ; is the y coordinate 0? + jr z,.adjustForXCoord + ld hl,wTileMap + ld bc,20 ; screen width +.topMenuItemLoop + add hl,bc + dec a + jr nz,.topMenuItemLoop +.adjustForXCoord + ld a,[wTopMenuItemX] + ld b,$00 + ld c,a + add hl,bc + push hl + ld a,[wLastMenuItem] + and a ; was the previous menu id 0? + jr z,.checkForArrow1 + push af + ld a,[$fff6] + bit 1,a ; is the menu double spaced? + jr z,.doubleSpaced1 + ld bc,20 + jr .getOldMenuItemScreenPosition +.doubleSpaced1 + ld bc,40 +.getOldMenuItemScreenPosition + pop af +.oldMenuItemLoop + add hl,bc + dec a + jr nz,.oldMenuItemLoop +.checkForArrow1 + ld a,[hl] + cp a,"▶" ; was an arrow next to the previously selected menu item? + jr nz,.skipClearingArrow +.clearArrow + ld a,[wTileBehindCursor] + ld [hl],a +.skipClearingArrow + pop hl + ld a,[wCurrentMenuItem] + and a + jr z,.checkForArrow2 + push af + ld a,[$fff6] + bit 1,a ; is the menu double spaced? + jr z,.doubleSpaced2 + ld bc,20 + jr .getCurrentMenuItemScreenPosition +.doubleSpaced2 + ld bc,40 +.getCurrentMenuItemScreenPosition + pop af +.currentMenuItemLoop + add hl,bc + dec a + jr nz,.currentMenuItemLoop +.checkForArrow2 + ld a,[hl] + cp a,"▶" ; has the right arrow already been placed? + jr z,.skipSavingTile ; if so, don't lose the saved tile + ld [wTileBehindCursor],a ; save tile before overwriting with right arrow +.skipSavingTile + ld a,"▶" ; place right arrow + ld [hl],a + ld a,l + ld [wMenuCursorLocation],a + ld a,h + ld [wMenuCursorLocation + 1],a + ld a,[wCurrentMenuItem] + ld [wLastMenuItem],a + ret + +; This is used to mark a menu cursor other than the one currently being +; manipulated. In the case of submenus, this is used to show the location of +; the menu cursor in the parent menu. In the case of swapping items in list, +; this is used to mark the item that was first chosen to be swapped. +PlaceUnfilledArrowMenuCursor:: ; 3bec (0:3bec) + ld b,a + ld a,[wMenuCursorLocation] + ld l,a + ld a,[wMenuCursorLocation + 1] + ld h,a + ld [hl],$ec ; outline of right arrow + ld a,b + ret + +; Replaces the menu cursor with a blank space. +EraseMenuCursor:: ; 3bf9 (0:3bf9) + ld a,[wMenuCursorLocation] + ld l,a + ld a,[wMenuCursorLocation + 1] + ld h,a + ld [hl]," " + ret + +; This toggles a blinking down arrow at hl on and off after a delay has passed. +; This is often called even when no blinking is occurring. +; The reason is that most functions that call this initialize H_DOWNARROWBLINKCNT1 to 0. +; The effect is that if the tile at hl is initialized with a down arrow, +; this function will toggle that down arrow on and off, but if the tile isn't +; initliazed with a down arrow, this function does nothing. +; That allows this to be called without worrying about if a down arrow should +; be blinking. +HandleDownArrowBlinkTiming:: ; 3c04 (0:3c04) + ld a,[hl] + ld b,a + ld a,$ee ; down arrow + cp b + jr nz,.downArrowOff +.downArrowOn + ld a,[H_DOWNARROWBLINKCNT1] + dec a + ld [H_DOWNARROWBLINKCNT1],a + ret nz + ld a,[H_DOWNARROWBLINKCNT2] + dec a + ld [H_DOWNARROWBLINKCNT2],a + ret nz + ld a," " + ld [hl],a + ld a,$ff + ld [H_DOWNARROWBLINKCNT1],a + ld a,$06 + ld [H_DOWNARROWBLINKCNT2],a + ret +.downArrowOff + ld a,[H_DOWNARROWBLINKCNT1] + and a + ret z + dec a + ld [H_DOWNARROWBLINKCNT1],a + ret nz + dec a + ld [H_DOWNARROWBLINKCNT1],a + ld a,[H_DOWNARROWBLINKCNT2] + dec a + ld [H_DOWNARROWBLINKCNT2],a + ret nz + ld a,$06 + ld [H_DOWNARROWBLINKCNT2],a + ld a,$ee ; down arrow + ld [hl],a + ret + +; The following code either enables or disables the automatic drawing of +; text boxes by DisplayTextID. Both functions cause DisplayTextID to wait +; for a button press after displaying text (unless [wcc47] is set). + +EnableAutoTextBoxDrawing:: ; 3c3c (0:3c3c) + xor a + jr AutoTextBoxDrawingCommon + +DisableAutoTextBoxDrawing:: ; 3c3f (0:3c3f) + ld a,$01 + +AutoTextBoxDrawingCommon:: ; 3c41 (0:3c41) + ld [wcf0c],a ; control text box drawing + xor a + ld [wcc3c],a ; make DisplayTextID wait for button press + ret + +PrintText:: ; 3c49 (0:3c49) +; given a pointer in hl, print the text there + push hl + ld a,1 + ld [wd125],a + call DisplayTextBoxID + call UpdateSprites + call Delay3 + pop hl +Func_3c59:: ; 3c59 (0:3c59) + bcCoord 1, 14 + jp TextCommandProcessor + +; converts a big-endian binary number into decimal and prints it +; INPUT: +; b = flags and number of bytes +; bit 7: if set, print leading zeroes +; if unset, do not print leading zeroes +; bit 6: if set, left-align the string (do not pad empty digits with spaces) +; if unset, right-align the string +; bits 4-5: unused +; bits 0-3: number of bytes (only 1 - 3 bytes supported) +; c = number of decimal digits +; de = address of the number (big-endian) +PrintNumber:: ; 3c5f (0:3c5f) + push bc + xor a + ld [H_PASTLEADINGZEROES],a + ld [H_NUMTOPRINT],a + ld [H_NUMTOPRINT + 1],a + ld a,b + and a,%00001111 + cp a,1 + jr z,.oneByte + cp a,2 + jr z,.twoBytes +.threeBytes + ld a,[de] + ld [H_NUMTOPRINT],a + inc de + ld a,[de] + ld [H_NUMTOPRINT + 1],a + inc de + ld a,[de] + ld [H_NUMTOPRINT + 2],a + jr .checkNumDigits +.twoBytes + ld a,[de] + ld [H_NUMTOPRINT + 1],a + inc de + ld a,[de] + ld [H_NUMTOPRINT + 2],a + jr .checkNumDigits +.oneByte + ld a,[de] + ld [H_NUMTOPRINT + 2],a +.checkNumDigits + push de + ld d,b + ld a,c + ld b,a + xor a + ld c,a + ld a,b ; a = number of decimal digits + cp a,2 + jr z,.tensPlace + cp a,3 + jr z,.hundredsPlace + cp a,4 + jr z,.thousandsPlace + cp a,5 + jr z,.tenThousandsPlace + cp a,6 + jr z,.hundredThousandsPlace +.millionsPlace + ld a,1000000 >> 16 + ld [H_POWEROFTEN],a + ld a,(1000000 >> 8) & $FF + ld [H_POWEROFTEN + 1],a + ld a,1000000 & $FF + ld [H_POWEROFTEN + 2],a + call PrintNumber_PrintDigit + call PrintNumber_AdvancePointer +.hundredThousandsPlace + ld a,100000 >> 16 + ld [H_POWEROFTEN],a + ld a,(100000 >> 8) & $FF + ld [H_POWEROFTEN + 1],a + ld a,100000 & $FF + ld [H_POWEROFTEN + 2],a + call PrintNumber_PrintDigit + call PrintNumber_AdvancePointer +.tenThousandsPlace + xor a + ld [H_POWEROFTEN],a + ld a,10000 >> 8 + ld [H_POWEROFTEN + 1],a + ld a,10000 & $FF + ld [H_POWEROFTEN + 2],a + call PrintNumber_PrintDigit + call PrintNumber_AdvancePointer +.thousandsPlace + xor a + ld [H_POWEROFTEN],a + ld a,1000 >> 8 + ld [H_POWEROFTEN + 1],a + ld a,1000 & $FF + ld [H_POWEROFTEN + 2],a + call PrintNumber_PrintDigit + call PrintNumber_AdvancePointer +.hundredsPlace + xor a + ld [H_POWEROFTEN],a + xor a + ld [H_POWEROFTEN + 1],a + ld a,100 + ld [H_POWEROFTEN + 2],a + call PrintNumber_PrintDigit + call PrintNumber_AdvancePointer +.tensPlace + ld c,00 + ld a,[H_NUMTOPRINT + 2] +.loop + cp a,10 + jr c,.underflow + sub a,10 + inc c + jr .loop +.underflow + ld b,a + ld a,[H_PASTLEADINGZEROES] + or c + ld [H_PASTLEADINGZEROES],a + jr nz,.pastLeadingZeroes + call PrintNumber_PrintLeadingZero + jr .advancePointer +.pastLeadingZeroes + ld a,"0" + add c + ld [hl],a +.advancePointer + call PrintNumber_AdvancePointer +.onesPlace + ld a,"0" + add b + ld [hli],a + pop de + dec de + pop bc + ret + +; prints a decimal digit +; This works by repeatedely subtracting a power of ten until the number becomes negative. +; The number of subtractions it took in order to make the number negative is the digit for the current number place. +; The last value that the number had before becoming negative is kept as the new value of the number. +; A more succinct description is that the number is divided by a power of ten +; and the quotient becomes the digit while the remainder is stored as the new value of the number. +PrintNumber_PrintDigit:: ; 3d25 (0:3d25) + ld c,0 ; counts number of loop iterations to determine the decimal digit +.loop + ld a,[H_POWEROFTEN] + ld b,a + ld a,[H_NUMTOPRINT] + ld [H_SAVEDNUMTOPRINT],a + cp b + jr c,.underflow0 + sub b + ld [H_NUMTOPRINT],a + ld a,[H_POWEROFTEN + 1] + ld b,a + ld a,[H_NUMTOPRINT + 1] + ld [H_SAVEDNUMTOPRINT + 1],a + cp b + jr nc,.noBorrowForByte1 +.byte1BorrowFromByte0 + ld a,[H_NUMTOPRINT] + or a,0 + jr z,.underflow1 + dec a + ld [H_NUMTOPRINT],a + ld a,[H_NUMTOPRINT + 1] +.noBorrowForByte1 + sub b + ld [H_NUMTOPRINT + 1],a + ld a,[H_POWEROFTEN + 2] + ld b,a + ld a,[H_NUMTOPRINT + 2] + ld [H_SAVEDNUMTOPRINT + 2],a + cp b + jr nc,.noBorrowForByte2 +.byte2BorrowFromByte1 + ld a,[H_NUMTOPRINT + 1] + and a + jr nz,.finishByte2BorrowFromByte1 +.byte2BorrowFromByte0 + ld a,[H_NUMTOPRINT] + and a + jr z,.underflow2 + dec a + ld [H_NUMTOPRINT],a + xor a +.finishByte2BorrowFromByte1 + dec a + ld [H_NUMTOPRINT + 1],a + ld a,[H_NUMTOPRINT + 2] +.noBorrowForByte2 + sub b + ld [H_NUMTOPRINT + 2],a + inc c + jr .loop +.underflow2 + ld a,[H_SAVEDNUMTOPRINT + 1] + ld [H_NUMTOPRINT + 1],a +.underflow1 + ld a,[H_SAVEDNUMTOPRINT] + ld [H_NUMTOPRINT],a +.underflow0 + ld a,[H_PASTLEADINGZEROES] + or c + jr z,PrintNumber_PrintLeadingZero + ld a,"0" + add c + ld [hl],a + ld [H_PASTLEADINGZEROES],a + ret + +; prints a leading zero unless they are turned off in the flags +PrintNumber_PrintLeadingZero:: ; 3d83 (0:3d83) + bit 7,d ; print leading zeroes? + ret z + ld [hl],"0" + ret + +; increments the pointer unless leading zeroes are not being printed, +; the number is left-aligned, and no nonzero digits have been printed yet +PrintNumber_AdvancePointer:: ; 3d89 (0:3d89) + bit 7,d ; print leading zeroes? + jr nz,.incrementPointer + bit 6,d ; left alignment or right alignment? + jr z,.incrementPointer + ld a,[H_PASTLEADINGZEROES] + and a + ret z +.incrementPointer + inc hl + ret + +; calls a function from a table of function pointers +; INPUT: +; a = index within table +; hl = address of function pointer table +CallFunctionInTable:: ; 3d97 (0:3d97) + push hl + push de + push bc + add a + ld d,0 + ld e,a + add hl,de + ld a,[hli] + ld h,[hl] + ld l,a + ld de,.returnAddress + push de + jp [hl] +.returnAddress + pop bc + pop de + pop hl + ret + + +IsInArray:: +; Search an array at hl for the value in a. +; Entry size is de bytes. +; Return count b and carry if found. + ld b, 0 + +IsInRestOfArray:: + ld c, a +.loop + ld a, [hl] + cp -1 + jr z, .notfound + cp c + jr z, .found + inc b + add hl, de + jr .loop + +.notfound + and a + ret + +.found + scf + ret + + +Func_3dbe:: ; 3dbe (0:3dbe) + call ClearSprites + ld a, $1 + ld [wcfcb], a + call Func_3e08 + call LoadScreenTilesFromBuffer2 + call LoadTextBoxTilePatterns + call GoPAL_SET_CF1C + jr Delay3 + + +GBPalWhiteOutWithDelay3:: + call GBPalWhiteOut + +Delay3:: +; The bg map is updated each frame in thirds. +; Wait three frames to let the bg map fully update. + ld c, 3 + jp DelayFrames + +GBPalNormal:: +; Reset BGP and OBP0. + ld a, %11100100 ; 3210 + ld [rBGP], a + ld a, %11010000 ; 3100 + ld [rOBP0], a + ret + +GBPalWhiteOut:: +; White out all palettes. + xor a + ld [rBGP],a + ld [rOBP0],a + ld [rOBP1],a + ret + + +GoPAL_SET_CF1C:: ; 3ded (0:3ded) + ld b,$ff +GoPAL_SET:: ; 3def (0:3def) + ld a,[wcf1b] + and a + ret z + predef_jump Func_71ddf + +GetHealthBarColor:: +; Return at hl the palette of +; an HP bar e pixels long. + ld a, e + cp 27 + ld d, 0 ; green + jr nc, .gotColor + cp 10 + inc d ; yellow + jr nc, .gotColor + inc d ; red +.gotColor + ld [hl], d + ret + +Func_3e08:: ; 3e08 (0:3e08) + ld hl, wcfc4 + ld a, [hl] + push af + res 0, [hl] + push hl + xor a + ld [W_SPRITESETID], a ; W_SPRITESETID + call DisableLCD + callba InitMapSprites + call EnableLCD + pop hl + pop af + ld [hl], a + call LoadPlayerSpriteGraphics + call LoadFontTilePatterns + jp UpdateSprites + + +GiveItem:: +; Give player quantity c of item b, +; and copy the item's name to wcf4b. +; Return carry on success. + ld a, b + ld [wd11e], a + ld [wcf91], a + ld a, c + ld [wcf96], a + ld hl,wNumBagItems + call AddItemToInventory + ret nc + call GetItemName + call CopyStringToCF4B + scf + ret + +GivePokemon:: +; Give the player monster b at level c. + ld a, b + ld [wcf91], a + ld a, c + ld [W_CURENEMYLVL], a + xor a + ld [wcc49], a + ld b, BANK(_GivePokemon) + ld hl, _GivePokemon + jp Bankswitch + + +Random:: +; Return a random number in a. +; For battles, use BattleRandom. + push hl + push de + push bc + callba Random_ + ld a,[hRandomAdd] + pop bc + pop de + pop hl + ret + + +INCLUDE "home/predef.asm" + + +Func_3ead:: ; 3ead (0:3ead) + ld b, BANK(CinnabarGymQuiz_1eb0a) + ld hl, CinnabarGymQuiz_1eb0a + jp Bankswitch + +Func_3eb5:: ; 3eb5 (0:3eb5) + ld a, [H_LOADEDROMBANK] + push af + ld a, [hJoyHeld] + bit 0, a + jr z, .asm_3eea + ld a, Bank(Func_469a0) + ld [$2000], a + ld [H_LOADEDROMBANK], a + call Func_469a0 + ld a, [$ffee] + and a + jr nz, .asm_3edd + ld a, [wTrainerEngageDistance] + ld [$2000], a + ld [H_LOADEDROMBANK], a + ld de, .asm_3eda + push de + jp [hl] +.asm_3eda + xor a + jr .asm_3eec +.asm_3edd + callba PrintBookshelfText + ld a, [$ffdb] + and a + jr z, .asm_3eec +.asm_3eea + ld a, $ff +.asm_3eec + ld [$ffeb], a + pop af + ld [$2000], a + ld [H_LOADEDROMBANK], a + ret + +PrintPredefTextID:: ; 3ef5 (0:3ef5) + ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld hl, PointerTable_3f22 + call Func_3f0f + ld hl, wcf11 + set 0, [hl] + call DisplayTextID + +Func_3f05:: ; 3f05 (0:3f05) + ld hl, W_MAPTEXTPTR ; wd36c + ld a, [$ffec] + ld [hli], a + ld a, [$ffed] + ld [hl], a + ret + +Func_3f0f:: ; 3f0f (0:3f0f) + ld a, [W_MAPTEXTPTR] ; wd36c + ld [$ffec], a + ld a, [W_MAPTEXTPTR + 1] + ld [$ffed], a + ld a, l + ld [W_MAPTEXTPTR], a ; wd36c + ld a, h + ld [W_MAPTEXTPTR + 1], a + ret + +PointerTable_3f22:: ; 3f22 (0:3f22) + dw CardKeySuccessText ; id = 01 + dw CardKeyFailText ; id = 02 + dw RedBedroomPC ; id = 03 + dw RedBedroomSNESText ; id = 04 + dw PushStartText ; id = 05 + dw SaveOptionText ; id = 06 + dw StrengthsAndWeaknessesText ; id = 07 + dw OakLabEmailText ; id = 08 + dw AerodactylFossilText ; id = 09 + dw Route15UpstairsBinocularsText ; id = 0A + dw KabutopsFossilText ; id = 0B + dw GymStatueText1 ; id = 0C + dw GymStatueText2 ; id = 0D + dw BookcaseText ; id = 0E + dw ViridianCityPokecenterBenchGuyText ; id = 0F + dw PewterCityPokecenterBenchGuyText ; id = 10 + dw CeruleanCityPokecenterBenchGuyText ; id = 11 + dw LavenderCityPokecenterBenchGuyText ; id = 12 + dw VermilionCityPokecenterBenchGuyText ; id = 13 + dw CeladonCityPokecenterBenchGuyText ; id = 14 + dw CeladonCityHotelText ; id = 15 + dw FuchsiaCityPokecenterBenchGuyText ; id = 16 + dw CinnabarIslandPokecenterBenchGuyText ; id = 17 + dw SaffronCityPokecenterBenchGuyText ; id = 18 + dw MtMoonPokecenterBenchGuyText ; id = 19 + dw RockTunnelPokecenterBenchGuyText ; id = 1A + dw UnusedBenchGuyText1 ; id = 1B + dw UnusedBenchGuyText2 ; id = 1C + dw UnusedBenchGuyText3 ; id = 1D + dw TerminatorText_62508 ; id = 1E + dw PredefText1f ; id = 1F + dw ViridianSchoolNotebook ; id = 20 + dw ViridianSchoolBlackboard ; id = 21 + dw JustAMomentText ; id = 22 + dw PredefText23 ; id = 23 + dw FoundHiddenItemText ; id = 24 + dw HiddenItemBagFullText ; id = 25 + dw VermilionGymTrashText ; id = 26 + dw IndigoPlateauHQText ; id = 27 + dw GameCornerOutOfOrderText ; id = 28 + dw GameCornerOutToLunchText ; id = 29 + dw GameCornerSomeonesKeysText ; id = 2A + dw FoundHiddenCoinsText ; id = 2B + dw DroppedHiddenCoinsText ; id = 2C + dw BillsHouseMonitorText ; id = 2D + dw BillsHouseInitiatedText ; id = 2E + dw BillsHousePokemonList ; id = 2F + dw MagazinesText ; id = 30 + dw CinnabarGymQuiz ; id = 31 + dw GameCornerNoCoinsText ; id = 32 + dw GameCornerCoinCaseText ; id = 33 + dw LinkCableHelp ; id = 34 + dw TMNotebook ; id = 35 + dw FightingDojoText ; id = 36 + dw FightingDojoText_52a10 ; id = 37 + dw FightingDojoText_52a1d ; id = 38 + dw NewBicycleText ; id = 39 + dw IndigoPlateauStatues ; id = 3A + dw VermilionGymTrashSuccesText1 ; id = 3B + dw VermilionGymTrashSuccesText2 ; id = 3C + dw VermilionGymTrashSuccesText3 ; id = 3D + dw VermilionGymTrashFailText ; id = 3E + dw TownMapText ; id = 3F + dw BookOrSculptureText ; id = 40 + dw ElevatorText ; id = 41 + dw PokemonStuffText ; id = 42 diff --git a/home/audio.asm b/home/audio.asm new file mode 100644 index 00000000..fa62cc8a --- /dev/null +++ b/home/audio.asm @@ -0,0 +1,183 @@ +Func_2307:: ; 2307 (0:2307) + call WaitForSoundToFinish + xor a + ld c, a + ld d, a + ld [wcfca], a + jr asm_2324 + +Func_2312:: ; 2312 (0:2312) + ld c, $a + ld d, $0 + ld a, [wd72e] + bit 5, a + jr z, asm_2324 + xor a + ld [wcfca], a + ld c, $8 + ld d, c +asm_2324:: ; 2324 (0:2324) + ld a, [wd700] + and a + jr z, .asm_2343 + cp $2 + jr z, .asm_2332 + ld a, MUSIC_BIKE_RIDING + jr .asm_2334 +.asm_2332 + ld a, MUSIC_SURFING +.asm_2334 + ld b, a + ld a, d + and a + ld a, BANK(Music_BikeRiding) + jr nz, .asm_233e + ld [wc0ef], a +.asm_233e + ld [wc0f0], a + jr .asm_234c +.asm_2343 + ld a, [wd35b] + ld b, a + call Func_2385 + jr c, .asm_2351 +.asm_234c + ld a, [wcfca] + cp b + ret z +.asm_2351 + ld a, c + ld [wMusicHeaderPointer], a + ld a, b + ld [wcfca], a + ld [wc0ee], a + jp PlaySound + +Func_235f:: ; 235f (0:235f) + ld a, [wc0ef] + ld b, a + cp BANK(Music2_UpdateMusic) + jr nz, .checkForBank08 +.bank02 + ld hl, Music2_UpdateMusic + jr .asm_2378 +.checkForBank08 + cp BANK(Music8_UpdateMusic) + jr nz, .bank1F +.bank08 + ld hl, Music8_UpdateMusic + jr .asm_2378 +.bank1F + ld hl, Music1f_UpdateMusic +.asm_2378 + ld c, $6 +.asm_237a + push bc + push hl + call Bankswitch + pop hl + pop bc + dec c + jr nz, .asm_237a + ret + +Func_2385:: ; 2385 (0:2385) + ld a, [wd35c] + ld e, a + ld a, [wc0ef] + cp e + jr nz, .asm_2394 + ld [wc0f0], a + and a + ret +.asm_2394 + ld a, c + and a + ld a, e + jr nz, .asm_239c + ld [wc0ef], a +.asm_239c + ld [wc0f0], a + scf + ret + +PlayMusic:: ; 23a1 (0:23a1) + ld b, a + ld [wc0ee], a + xor a + ld [wMusicHeaderPointer], a + ld a, c + ld [wc0ef], a + ld [wc0f0], a + ld a, b + +; plays music specified by a. If value is $ff, music is stopped +PlaySound:: ; 23b1 (0:23b1) + push hl + push de + push bc + ld b, a + ld a, [wc0ee] + and a + jr z, .asm_23c8 + xor a + ld [wc02a], a + ld [wc02b], a + ld [wc02c], a + ld [wc02d], a +.asm_23c8 + ld a, [wMusicHeaderPointer] + and a + jr z, .asm_23e3 + ld a, [wc0ee] + and a + jr z, .asm_2425 + xor a + ld [wc0ee], a + ld a, [wcfca] + cp $ff + jr nz, .asm_2414 + xor a + ld [wMusicHeaderPointer], a +.asm_23e3 + xor a + ld [wc0ee], a + ld a, [H_LOADEDROMBANK] + ld [$ffb9], a + ld a, [wc0ef] + ld [H_LOADEDROMBANK], a + ld [$2000], a + cp BANK(Func_9876) + jr nz, .checkForBank08 +.bank02 + ld a, b + call Func_9876 + jr .asm_240b +.checkForBank08 + cp BANK(Func_22035) + jr nz, .bank1F +.bank08 + ld a, b + call Func_22035 + jr .asm_240b +.bank1F + ld a, b + call Func_7d8ea +.asm_240b + ld a, [$ffb9] + ld [H_LOADEDROMBANK], a + ld [$2000], a + jr .asm_2425 +.asm_2414 + ld a, b + ld [wcfca], a + ld a, [wMusicHeaderPointer] + ld [wcfc8], a + ld [wcfc9], a + ld a, b + ld [wMusicHeaderPointer], a +.asm_2425 + pop bc + pop de + pop hl + ret diff --git a/home/fade.asm b/home/fade.asm new file mode 100644 index 00000000..9b55eaf2 --- /dev/null +++ b/home/fade.asm @@ -0,0 +1,73 @@ +; These routines manage gradual fading +; (e.g., entering a doorway) +LoadGBPal:: + ld a, [wd35d] ;tells if cur.map is dark (requires HM5_FLASH?) + ld b, a + ld hl, FadePal4 + ld a, l + sub b + ld l, a + jr nc, .ok + dec h +.ok + ld a, [hli] + ld [rBGP], a + ld a, [hli] + ld [rOBP0], a + ld a, [hli] + ld [rOBP1], a + ret + +GBFadeOut1:: + ld hl, FadePal1 + ld b, 4 + jr GBFadeOutCommon + +GBFadeOut2:: + ld hl, FadePal6 + ld b, 3 + +GBFadeOutCommon:: + ld a, [hli] + ld [rBGP], a + ld a, [hli] + ld [rOBP0], a + ld a, [hli] + ld [rOBP1], a + ld c, 8 + call DelayFrames + dec b + jr nz, GBFadeOutCommon + ret + +GBFadeIn1:: + ld hl, FadePal4 + 2 + ld b, 4 + jr GBFadeInCommon + +GBFadeIn2:: + ld hl, FadePal7 + 2 + ld b, 3 + +GBFadeInCommon:: + ld a, [hld] + ld [rOBP1], a + ld a, [hld] + ld [rOBP0], a + ld a, [hld] + ld [rBGP], a + ld c, 8 + call DelayFrames + dec b + jr nz, GBFadeInCommon + ret + +FadePal1:: db %11111111, %11111111, %11111111 +FadePal2:: db %11111110, %11111110, %11111000 +FadePal3:: db %11111001, %11100100, %11100100 +FadePal4:: db %11100100, %11010000, %11100000 +; rBGP rOBP0 rOBP1 +FadePal5:: db %11100100, %11010000, %11100000 +FadePal6:: db %10010000, %10000000, %10010000 +FadePal7:: db %01000000, %01000000, %01000000 +FadePal8:: db %00000000, %00000000, %00000000 diff --git a/home/init.asm b/home/init.asm new file mode 100644 index 00000000..b79b19d9 --- /dev/null +++ b/home/init.asm @@ -0,0 +1,137 @@ +SoftReset:: + call StopAllSounds + call GBPalWhiteOut + ld c, $20 + call DelayFrames + ; fallthrough + +Init:: +; Program init. + +rLCDC_DEFAULT EQU %11100011 +; * LCD enabled +; * Window tile map at $9C00 +; * Window display enabled +; * BG and window tile data at $8800 +; * BG tile map at $9800 +; * 8x8 OBJ size +; * OBJ display enabled +; * BG display enabled + + di + + xor a + ld [rIF], a + ld [rIE], a + ld [$ff43], a + ld [$ff42], a + ld [$ff01], a + ld [$ff02], a + ld [$ff4b], a + ld [$ff4a], a + ld [$ff06], a + ld [$ff07], a + ld [$ff47], a + ld [$ff48], a + ld [$ff49], a + + ld a, rLCDC_ENABLE_MASK + ld [rLCDC], a + call DisableLCD + + ld sp, wStack + + ld hl, $c000 ; start of WRAM + ld bc, $2000 ; size of WRAM +.loop + ld [hl], 0 + inc hl + dec bc + ld a, b + or c + jr nz, .loop + + call ClearVram + + ld hl, $ff80 + ld bc, $ffff - $ff80 + call FillMemory + + call ClearSprites + + ld a, Bank(WriteDMACodeToHRAM) + ld [H_LOADEDROMBANK], a + ld [MBC3RomBank], a + call WriteDMACodeToHRAM + + xor a + ld [$ffd7], a + ld [$ff41], a + ld [$ffae], a + ld [$ffaf], a + ld [$ff0f], a + ld a, 1 << VBLANK + 1 << TIMER + 1 << SERIAL + ld [rIE], a + + ld a, 144 ; move the window off-screen + ld [$ffb0], a + ld [rWY], a + ld a, 7 + ld [rWX], a + + ld a, $ff + ld [$ffaa], a + + ld h, vBGMap0 / $100 + call ClearBgMap + ld h, vBGMap1 / $100 + call ClearBgMap + + ld a, rLCDC_DEFAULT + ld [rLCDC], a + ld a, 16 + ld [hSoftReset], a + call StopAllSounds + + ei + + predef LoadSGB + + ld a, BANK(SFX_1f_67) + ld [wc0ef], a + ld [wc0f0], a + ld a, $9c + ld [$ffbd], a + xor a + ld [$ffbc], a + dec a + ld [wcfcb], a + + predef PlayIntro + + call DisableLCD + call ClearVram + call GBPalNormal + call ClearSprites + ld a, rLCDC_DEFAULT + ld [rLCDC], a + + jp SetDefaultNamesBeforeTitlescreen + +ClearVram: + ld hl, $8000 + ld bc, $2000 + xor a + jp FillMemory + + +StopAllSounds:: + ld a, BANK(Music2_UpdateMusic) + ld [wc0ef], a + ld [wc0f0], a + xor a + ld [wMusicHeaderPointer], a + ld [wc0ee], a + ld [wcfca], a + dec a + jp PlaySound diff --git a/home/joypad.asm b/home/joypad.asm new file mode 100644 index 00000000..2002bb29 --- /dev/null +++ b/home/joypad.asm @@ -0,0 +1,39 @@ +ReadJoypad:: +; Poll joypad input. +; Unlike the hardware register, button +; presses are indicated by a set bit. + + ld a, 1 << 5 ; select direction keys + ld c, 0 + + ld [rJOYP], a + rept 6 + ld a, [rJOYP] + endr + cpl + and %1111 + swap a + ld b, a + + ld a, 1 << 4 ; select button keys + ld [rJOYP], a + rept 10 + ld a, [rJOYP] + endr + cpl + and %1111 + or b + + ld [hJoyInput], a + + ld a, 1 << 4 + 1 << 5 ; deselect keys + ld [rJOYP], a + ret + +Joypad:: +; Update the joypad state variables: +; [hJoyReleased] keys released since last time +; [hJoyPressed] keys pressed since last time +; [hJoyHeld] currently pressed keys + homecall _Joypad + ret diff --git a/home/overworld.asm b/home/overworld.asm new file mode 100644 index 00000000..cf36aba8 --- /dev/null +++ b/home/overworld.asm @@ -0,0 +1,2403 @@ +HandleMidJump:: +; Handle the player jumping down +; a ledge in the overworld. + ld b, BANK(_HandleMidJump) + ld hl, _HandleMidJump + jp Bankswitch + +EnterMap:: +; Load a new map. + ld a, $ff + ld [wJoyIgnore], a + call LoadMapData + callba Func_c335 ; initialize map variables + ld hl, wd72c + bit 0, [hl] + jr z, .doNotCountSteps + ld a, 3 + ld [wd13c], a ; some kind of step counter (counts up to 3 steps?) +.doNotCountSteps + ld hl, wd72e + bit 5, [hl] ; did a battle happen immediately before this? + res 5, [hl] ; unset the "battle just happened" flag + call z, Func_12e7 + call nz, MapEntryAfterBattle + ld hl, wd732 + ld a, [hl] + and 1 << 4 | 1 << 3 + jr z, .didNotFlyOrTeleportIn + res 3, [hl] + callba Func_70510 ; display fly/teleport in graphical effect + call UpdateSprites +.didNotFlyOrTeleportIn + callba CheckForceBikeOrSurf ; handle currents in SF islands and forced bike riding in cycling road + ld hl, wd72d + res 5, [hl] + call UpdateSprites + ld hl, wd126 + set 5, [hl] + set 6, [hl] + xor a + ld [wJoyIgnore], a + +OverworldLoop:: + call DelayFrame +OverworldLoopLessDelay:: + call DelayFrame + call LoadGBPal + ld a,[wd736] + bit 6,a ; jumping down a ledge? + call nz, HandleMidJump + ld a,[wWalkCounter] + and a + jp nz,.moveAhead ; if the player sprite has not yet completed the walking animation + call JoypadOverworld ; get joypad state (which is possibly simulated) + callba SafariZoneCheck + ld a,[wda46] + and a + jp nz,WarpFound2 + ld hl,wd72d + bit 3,[hl] + res 3,[hl] + jp nz,WarpFound2 + ld a,[wd732] + and a,$18 + jp nz,HandleFlyOrTeleportAway + ld a,[W_CUROPPONENT] + and a + jp nz,.newBattle + ld a,[wd730] + bit 7,a ; are we simulating button presses? + jr z,.notSimulating + ld a,[hJoyHeld] + jr .checkIfStartIsPressed +.notSimulating + ld a,[hJoyPressed] +.checkIfStartIsPressed + bit 3,a ; start button + jr z,.startButtonNotPressed +; if START is pressed + xor a + ld [$ff8c],a ; the $2920 ID for the start menu is 0 + jp .displayDialogue +.startButtonNotPressed + bit 0,a ; A button + jp z,.checkIfDownButtonIsPressed +; if A is pressed + ld a,[wd730] + bit 2,a + jp nz,.noDirectionButtonsPressed + call Func_30fd + jr nz,.checkForOpponent + call Func_3eb5 ; check for hidden items, PC's, etc. + ld a,[$ffeb] + and a + jp z,OverworldLoop + call IsSpriteOrSignInFrontOfPlayer ; check for sign or sprite in front of the player + ld a,[$ff8c] ; $2920 ID for NPC/sign text, if any + and a + jp z,OverworldLoop +.displayDialogue + predef Func_c586 ; check what is in front of the player + call UpdateSprites ; move sprites + ld a,[wFlags_0xcd60] + bit 2,a + jr nz,.checkForOpponent + bit 0,a + jr nz,.checkForOpponent + aCoord 8, 9 + ld [wcf0e],a + call DisplayTextID ; display either the start menu or the NPC/sign text + ld a,[wcc47] + and a + jr z,.checkForOpponent + dec a + ld a,$00 + ld [wcc47],a + jr z,.changeMap + predef LoadSAV + ld a,[W_CURMAP] + ld [wd71a],a + call Func_62ce + ld a,[W_CURMAP] + call SwitchToMapRomBank ; switch to the ROM bank of the current map + ld hl,W_CURMAPTILESET + set 7,[hl] +.changeMap + jp EnterMap +.checkForOpponent + ld a,[W_CUROPPONENT] + and a + jp nz,.newBattle + jp OverworldLoop +.noDirectionButtonsPressed + ld hl,wFlags_0xcd60 + res 2,[hl] + call UpdateSprites ; move sprites + ld a,$01 + ld [wcc4b],a + ld a,[wd528] ; the direction that was pressed last time + and a + jp z,OverworldLoop +; if a direction was pressed last time + ld [wd529],a ; save the last direction + xor a + ld [wd528],a ; zero the direction + jp OverworldLoop +.checkIfDownButtonIsPressed + ld a,[hJoyHeld] ; current joypad state + bit 7,a ; down button + jr z,.checkIfUpButtonIsPressed + ld a,$01 + ld [wSpriteStateData1 + 3],a + ld a,$04 + jr .handleDirectionButtonPress +.checkIfUpButtonIsPressed + bit 6,a ; up button + jr z,.checkIfLeftButtonIsPressed + ld a,$ff + ld [wSpriteStateData1 + 3],a + ld a,$08 + jr .handleDirectionButtonPress +.checkIfLeftButtonIsPressed + bit 5,a ; left button + jr z,.checkIfRightButtonIsPressed + ld a,$ff + ld [wSpriteStateData1 + 5],a + ld a,$02 + jr .handleDirectionButtonPress +.checkIfRightButtonIsPressed + bit 4,a ; right button + jr z,.noDirectionButtonsPressed + ld a,$01 + ld [wSpriteStateData1 + 5],a +.handleDirectionButtonPress + ld [wd52a],a ; new direction + ld a,[wd730] + bit 7,a ; are we simulating button presses? + jr nz,.noDirectionChange ; ignore direction changes if we are + ld a,[wcc4b] + and a + jr z,.noDirectionChange + ld a,[wd52a] ; new direction + ld b,a + ld a,[wd529] ; old direction + cp b + jr z,.noDirectionChange +; the code below is strange +; it computes whether or not the player did a 180 degree turn, but then overwrites the result +; also, it does a seemingly pointless loop afterwards + swap a ; put old direction in upper half + or b ; put new direction in lower half + cp a,$48 ; change dir from down to up + jr nz,.notDownToUp + ld a,$02 + ld [wd528],a + jr .oddLoop +.notDownToUp + cp a,$84 ; change dir from up to down + jr nz,.notUpToDown + ld a,$01 + ld [wd528],a + jr .oddLoop +.notUpToDown + cp a,$12 ; change dir from right to left + jr nz,.notRightToLeft + ld a,$04 + ld [wd528],a + jr .oddLoop +.notRightToLeft + cp a,$21 ; change dir from left to right + jr nz,.oddLoop + ld a,$08 + ld [wd528],a +.oddLoop + ld hl,wFlags_0xcd60 + set 2,[hl] + ld hl,wcc4b + dec [hl] + jr nz,.oddLoop + ld a,[wd52a] + ld [wd528],a + call NewBattle + jp c,.battleOccurred + jp OverworldLoop +.noDirectionChange + ld a,[wd52a] ; current direction + ld [wd528],a ; save direction + call UpdateSprites ; move sprites + ld a,[wd700] + cp a,$02 ; surfing + jr z,.surfing +; not surfing + call CollisionCheckOnLand + jr nc,.noCollision + push hl + ld hl,wd736 + bit 2,[hl] + pop hl + jp z,OverworldLoop + push hl + call ExtraWarpCheck ; sets carry if there is a potential to warp + pop hl + jp c,CheckWarpsCollision + jp OverworldLoop +.surfing + call CollisionCheckOnWater + jp c,OverworldLoop +.noCollision + ld a,$08 + ld [wWalkCounter],a + jr .moveAhead2 +.moveAhead + ld a,[wd736] + bit 7,a + jr z,.noSpinning + callba LoadSpinnerArrowTiles ; spin while moving +.noSpinning + call UpdateSprites ; move sprites +.moveAhead2 + ld hl,wFlags_0xcd60 + res 2,[hl] + ld a,[wd700] + dec a ; riding a bike? + jr nz,.normalPlayerSpriteAdvancement + ld a,[wd736] + bit 6,a ; jumping a ledge? + jr nz,.normalPlayerSpriteAdvancement + call BikeSpeedup ; if riding a bike and not jumping a ledge +.normalPlayerSpriteAdvancement + call AdvancePlayerSprite + ld a,[wWalkCounter] + and a + jp nz,CheckMapConnections ; it seems like this check will never succeed (the other place where CheckMapConnections is run works) +; walking animation finished + ld a,[wd730] + bit 7,a + jr nz,.doneStepCounting ; if button presses are being simulated, don't count steps +; step counting + ld hl,wd13b ; step counter + dec [hl] + ld a,[wd72c] + bit 0,a + jr z,.doneStepCounting + ld hl,wd13c + dec [hl] + jr nz,.doneStepCounting + ld hl,wd72c + res 0,[hl] +.doneStepCounting + ld a,[wd790] + bit 7,a ; in the safari zone? + jr z,.notSafariZone + callba SafariZoneCheckSteps + ld a,[wda46] + and a + jp nz,WarpFound2 +.notSafariZone + ld a,[W_ISINBATTLE] + and a + jp nz,CheckWarpsNoCollision + predef Func_c69c ; decrement HP of poisoned pokemon + ld a,[wd12d] + and a + jp nz,HandleBlackOut ; if all pokemon fainted +.newBattle + call NewBattle + ld hl,wd736 + res 2,[hl] + jp nc,CheckWarpsNoCollision ; check for warps if there was no battle +.battleOccurred + ld hl,wd72d + res 6,[hl] + ld hl,W_FLAGS_D733 + res 3,[hl] + ld hl,wd126 + set 5,[hl] + set 6,[hl] + xor a + ld [hJoyHeld],a ; clear joypad state + ld a,[W_CURMAP] + cp a,CINNABAR_GYM + jr nz,.notCinnabarGym + ld hl,wd79b + set 7,[hl] +.notCinnabarGym + ld hl,wd72e + set 5,[hl] + ld a,[W_CURMAP] + cp a,OAKS_LAB + jp z,.noFaintCheck + callab AnyPartyAlive ; check if all the player's pokemon fainted + ld a,d + and a + jr z,.allPokemonFainted +.noFaintCheck + ld c,$0a + call DelayFrames + jp EnterMap +.allPokemonFainted + ld a,$ff + ld [W_ISINBATTLE],a + call RunMapScript + jp HandleBlackOut + +; function to determine if there will be a battle and execute it (either a trainer battle or wild battle) +; sets carry if a battle occurred and unsets carry if not +NewBattle:: ; 0683 (0:0683) + ld a,[wd72d] + bit 4,a + jr nz,.noBattle + call Func_30fd + jr nz,.noBattle + ld a,[wd72e] + bit 4,a + jr nz,.noBattle + ld b, BANK(InitBattle) + ld hl, InitBattle + jp Bankswitch ; determines if a battle will occur and runs the battle if so +.noBattle + and a + ret + +; function to make bikes twice as fast as walking +BikeSpeedup:: ; 06a0 (0:06a0) + ld a,[wcc57] + and a + ret nz + ld a,[W_CURMAP] + cp a,ROUTE_17 ; Cycling Road + jr nz,.goFaster + ld a,[hJoyHeld] ; current joypad state + and a,%01110000 ; bit mask for up, left, right buttons + ret nz +.goFaster + jp AdvancePlayerSprite + +; check if the player has stepped onto a warp after having not collided +CheckWarpsNoCollision:: ; 06b4 (0:06b4) + ld a,[wd3ae] ; number of warps + and a + jp z,CheckMapConnections + ld a,[wd3ae] ; number of warps + ld b,$00 + ld c,a + ld a,[W_YCOORD] + ld d,a + ld a,[W_XCOORD] + ld e,a + ld hl,wd3af ; start of warp entries +CheckWarpsNoCollisionLoop:: ; 06cc (0:06cc) + ld a,[hli] ; check if the warp's Y position matches + cp d + jr nz,CheckWarpsNoCollisionRetry1 + ld a,[hli] ; check if the warp's X position matches + cp e + jr nz,CheckWarpsNoCollisionRetry2 +; if a match was found + push hl + push bc + ld hl,wd736 + set 2,[hl] + callba Func_c49d ; check if the player sprite is standing on a "door" tile + pop bc + pop hl + jr c,WarpFound1 ; if it is, go to 0735 + push hl + push bc + call ExtraWarpCheck ; sets carry if the warp is confirmed + pop bc + pop hl + jr nc,CheckWarpsNoCollisionRetry2 +; if the extra check passed + ld a,[W_FLAGS_D733] + bit 2,a + jr nz,WarpFound1 + push de + push bc + call Joypad + pop bc + pop de + ld a,[hJoyHeld] ; current joypad state + and a,%11110000 ; bit mask for directional buttons + jr z,CheckWarpsNoCollisionRetry2 ; if directional buttons aren't being pressed, do not pass through the warp + jr WarpFound1 + +; check if the player has stepped onto a warp after having collided +CheckWarpsCollision:: ; 0706 (0:0706) + ld a,[wd3ae] ; number of warps + ld c,a + ld hl,wd3af ; start of warp entries +.loop + ld a,[hli] ; Y coordinate of warp + ld b,a + ld a,[W_YCOORD] + cp b + jr nz,.retry1 + ld a,[hli] ; X coordinate of warp + ld b,a + ld a,[W_XCOORD] + cp b + jr nz,.retry2 + ld a,[hli] + ld [wd42f],a ; save target warp ID + ld a,[hl] + ld [$ff8b],a ; save target map + jr WarpFound2 +.retry1 + inc hl +.retry2 + inc hl + inc hl + dec c + jr nz,.loop + jp OverworldLoop + +CheckWarpsNoCollisionRetry1:: ; 072f (0:072f) + inc hl +CheckWarpsNoCollisionRetry2:: ; 0730 (0:0730) + inc hl + inc hl + jp ContinueCheckWarpsNoCollisionLoop + +WarpFound1:: ; 0735 (0:0735) + ld a,[hli] + ld [wd42f],a ; save target warp ID + ld a,[hli] + ld [$ff8b],a ; save target map + +WarpFound2:: ; 073c (0:073c) + ld a,[wd3ae] ; number of warps + sub c + ld [wd73b],a ; save ID of used warp + ld a,[W_CURMAP] + ld [wd73c],a + call CheckIfInOutsideMap + jr nz,.indoorMaps +; this is for handling "outside" maps that can't have the 0xFF destination map + ld a,[W_CURMAP] + ld [wLastMap],a + ld a,[W_CURMAPWIDTH] + ld [wd366],a + ld a,[$ff8b] ; destination map number + ld [W_CURMAP],a ; change current map to destination map + cp a,ROCK_TUNNEL_1 + jr nz,.notRockTunnel + ld a,$06 + ld [wd35d],a + call GBFadeIn1 +.notRockTunnel + call PlayMapChangeSound + jr .done +; for maps that can have the 0xFF destination map, which means to return to the outside map; not all these maps are necessarily indoors, though +.indoorMaps + ld a,[$ff8b] ; destination map + cp a,$ff + jr z,.goBackOutside +; if not going back to the previous map + ld [W_CURMAP],a ; current map number + callba Func_70787 ; check if the warp was a Silph Co. teleporter + ld a,[wcd5b] + dec a + jr nz,.notTeleporter +; if it's a Silph Co. teleporter + ld hl,wd732 + set 3,[hl] + call LeaveMapAnim + jr .skipMapChangeSound +.notTeleporter + call PlayMapChangeSound +.skipMapChangeSound + ld hl,wd736 + res 0,[hl] + res 1,[hl] + jr .done +.goBackOutside + ld a,[wLastMap] + ld [W_CURMAP],a + call PlayMapChangeSound + xor a + ld [wd35d],a +.done + ld hl,wd736 + set 0,[hl] + call Func_12da + jp EnterMap + +ContinueCheckWarpsNoCollisionLoop:: ; 07b5 (0:07b5) + inc b ; increment warp number + dec c ; decrement number of warps + jp nz,CheckWarpsNoCollisionLoop + +; if no matching warp was found +CheckMapConnections:: ; 07ba (0:07ba) +.checkWestMap + ld a,[W_XCOORD] + cp a,$ff + jr nz,.checkEastMap + ld a,[W_MAPCONN3PTR] + ld [W_CURMAP],a + ld a,[wd38f] ; new X coordinate upon entering west map + ld [W_XCOORD],a + ld a,[W_YCOORD] + ld c,a + ld a,[wd38e] ; Y adjustment upon entering west map + add c + ld c,a + ld [W_YCOORD],a + ld a,[wd390] ; pointer to upper left corner of map without adjustment for Y position + ld l,a + ld a,[wd391] + ld h,a + srl c + jr z,.savePointer1 +.pointerAdjustmentLoop1 + ld a,[wd38d] ; width of connected map + add a,$06 + ld e,a + ld d,$00 + ld b,$00 + add hl,de + dec c + jr nz,.pointerAdjustmentLoop1 +.savePointer1 + ld a,l + ld [wd35f],a ; pointer to upper left corner of current tile block map section + ld a,h + ld [wd360],a + jp .loadNewMap +.checkEastMap + ld b,a + ld a,[wd525] ; map width + cp b + jr nz,.checkNorthMap + ld a,[W_MAPCONN4PTR] + ld [W_CURMAP],a + ld a,[wd39a] ; new X coordinate upon entering east map + ld [W_XCOORD],a + ld a,[W_YCOORD] + ld c,a + ld a,[wd399] ; Y adjustment upon entering east map + add c + ld c,a + ld [W_YCOORD],a + ld a,[wd39b] ; pointer to upper left corner of map without adjustment for Y position + ld l,a + ld a,[wd39c] + ld h,a + srl c + jr z,.savePointer2 +.pointerAdjustmentLoop2 + ld a,[wd398] + add a,$06 + ld e,a + ld d,$00 + ld b,$00 + add hl,de + dec c + jr nz,.pointerAdjustmentLoop2 +.savePointer2 + ld a,l + ld [wd35f],a ; pointer to upper left corner of current tile block map section + ld a,h + ld [wd360],a + jp .loadNewMap +.checkNorthMap + ld a,[W_YCOORD] + cp a,$ff + jr nz,.checkSouthMap + ld a,[W_MAPCONN1PTR] + ld [W_CURMAP],a + ld a,[wd378] ; new Y coordinate upon entering north map + ld [W_YCOORD],a + ld a,[W_XCOORD] + ld c,a + ld a,[wd379] ; X adjustment upon entering north map + add c + ld c,a + ld [W_XCOORD],a + ld a,[wd37a] ; pointer to upper left corner of map without adjustment for X position + ld l,a + ld a,[wd37b] + ld h,a + ld b,$00 + srl c + add hl,bc + ld a,l + ld [wd35f],a ; pointer to upper left corner of current tile block map section + ld a,h + ld [wd360],a + jp .loadNewMap +.checkSouthMap + ld b,a + ld a,[wd524] + cp b + jr nz,.didNotEnterConnectedMap + ld a,[W_MAPCONN2PTR] + ld [W_CURMAP],a + ld a,[wd383] ; new Y coordinate upon entering south map + ld [W_YCOORD],a + ld a,[W_XCOORD] + ld c,a + ld a,[wd384] ; X adjustment upon entering south map + add c + ld c,a + ld [W_XCOORD],a + ld a,[wd385] ; pointer to upper left corner of map without adjustment for X position + ld l,a + ld a,[wd386] + ld h,a + ld b,$00 + srl c + add hl,bc + ld a,l + ld [wd35f],a ; pointer to upper left corner of current tile block map section + ld a,h + ld [wd360],a +.loadNewMap ; load the connected map that was entered + call LoadMapHeader + call Func_2312 ; music + ld b,$09 + call GoPAL_SET +; Since the sprite set shouldn't change, this will just update VRAM slots at +; $C2XE without loading any tile patterns. + callba InitMapSprites + call LoadTileBlockMap + jp OverworldLoopLessDelay +.didNotEnterConnectedMap + jp OverworldLoop + +; function to play a sound when changing maps +PlayMapChangeSound:: ; 08c9 (0:08c9) + aCoord 8, 8 ; upper left tile of the 4x4 square the player's sprite is standing on + cp a,$0b ; door tile in tileset 0 + jr nz,.didNotGoThroughDoor + ld a,(SFX_02_57 - SFX_Headers_02) / 3 + jr .playSound +.didNotGoThroughDoor + ld a,(SFX_02_5c - SFX_Headers_02) / 3 +.playSound + call PlaySound + ld a,[wd35d] + and a + ret nz + jp GBFadeIn1 + +CheckIfInOutsideMap:: ; 08e1 (0:08e1) +; If the player is in an outside map (a town or route), set the z flag + ld a, [W_CURMAPTILESET] + and a ; most towns/routes have tileset 0 (OVERWORLD) + ret z + cp PLATEAU ; Route 23 / Indigo Plateau + ret + +; this function is an extra check that sometimes has to pass in order to warp, beyond just standing on a warp +; the "sometimes" qualification is necessary because of CheckWarpsNoCollision's behavior +; depending on the map, either "function 1" or "function 2" is used for the check +; "function 1" passes when the player is at the edge of the map and is facing towards the outside of the map +; "function 2" passes when the the tile in front of the player is among a certain set +; sets carry if the check passes, otherwise clears carry +ExtraWarpCheck:: ; 08e9 (0:08e9) + ld a, [W_CURMAP] + cp SS_ANNE_3 + jr z, .useFunction1 + cp ROCKET_HIDEOUT_1 + jr z, .useFunction2 + cp ROCKET_HIDEOUT_2 + jr z, .useFunction2 + cp ROCKET_HIDEOUT_4 + jr z, .useFunction2 + cp ROCK_TUNNEL_1 + jr z, .useFunction2 + ld a, [W_CURMAPTILESET] + and a ; outside tileset (OVERWORLD) + jr z, .useFunction2 + cp SHIP ; S.S. Anne tileset + jr z, .useFunction2 + cp SHIP_PORT ; Vermilion Port tileset + jr z, .useFunction2 + cp PLATEAU ; Indigo Plateau tileset + jr z, .useFunction2 +.useFunction1 + ld hl, Func_c3ff + jr .doBankswitch +.useFunction2 + ld hl, Func_c44e +.doBankswitch + ld b, BANK(Func_c44e) + jp Bankswitch + +MapEntryAfterBattle:: ; 091f (0:091f) + callba Func_c35f ; function that appears to disable warp testing after collisions if the player is standing on a warp + ld a,[wd35d] + and a + jp z,GBFadeIn2 + jp LoadGBPal + +HandleBlackOut:: +; For when all the player's pokemon faint. +; Does not print the "blacked out" message. + + call GBFadeIn1 + ld a, $08 + call StopMusic + ld hl, wd72e + res 5, [hl] + ld a, Bank(Func_40b0) ; also Bank(Func_62ce) and Bank(Func_5d5f) + ld [H_LOADEDROMBANK], a + ld [MBC3RomBank], a + call Func_40b0 + call Func_62ce + call Func_2312 + jp Func_5d5f + +StopMusic:: + ld [wMusicHeaderPointer], a + ld a, $ff + ld [wc0ee], a + call PlaySound +.wait + ld a, [wMusicHeaderPointer] + and a + jr nz, .wait + jp StopAllSounds + +HandleFlyOrTeleportAway:: + call UpdateSprites + call Delay3 + xor a + ld [wcf0b], a + ld [wd700], a + ld [W_ISINBATTLE], a + ld [wd35d], a + ld hl, wd732 + set 2, [hl] + res 5, [hl] + call LeaveMapAnim + ld a, Bank(Func_62ce) + ld [H_LOADEDROMBANK], a + ld [$2000], a + call Func_62ce + jp Func_5d5f + +LeaveMapAnim:: + ld b, BANK(_LeaveMapAnim) + ld hl, _LeaveMapAnim + jp Bankswitch + +LoadPlayerSpriteGraphics:: +; Load sprite graphics based on whether the player is standing, biking, or surfing. + + ; 0: standing + ; 1: biking + ; 2: surfing + + ld a, [wd700] + dec a + jr z, .ridingBike + + ld a, [$ffd7] + and a + jr nz, .determineGraphics + jr .startWalking + +.ridingBike + ; If the bike can't be used, + ; start walking instead. + call IsBikeRidingAllowed + jr c, .determineGraphics + +.startWalking + xor a + ld [wd700], a + ld [wd11a], a + jp LoadWalkingPlayerSpriteGraphics + +.determineGraphics + ld a, [wd700] + and a + jp z, LoadWalkingPlayerSpriteGraphics + dec a + jp z, LoadBikePlayerSpriteGraphics + dec a + jp z, LoadSurfingPlayerSpriteGraphics + jp LoadWalkingPlayerSpriteGraphics + +IsBikeRidingAllowed:: +; The bike can be used on Route 23 and Indigo Plateau, +; or maps with tilesets in BikeRidingTilesets. +; Return carry if biking is allowed. + + ld a, [W_CURMAP] + cp ROUTE_23 + jr z, .allowed + cp INDIGO_PLATEAU + jr z, .allowed + + ld a, [W_CURMAPTILESET] + ld b, a + ld hl, BikeRidingTilesets +.loop + ld a, [hli] + cp b + jr z, .allowed + inc a + jr nz, .loop + and a + ret + +.allowed + scf + ret + +INCLUDE "data/bike_riding_tilesets.asm" + +; load the tile pattern data of the current tileset into VRAM +LoadTilesetTilePatternData:: ; 09e8 (0:09e8) + ld a,[W_TILESETGFXPTR] + ld l,a + ld a,[W_TILESETGFXPTR + 1] + ld h,a + ld de,vTileset + ld bc,$600 + ld a,[W_TILESETBANK] + jp FarCopyData2 + +; this loads the current maps complete tile map (which references blocks, not individual tiles) to C6E8 +; it can also load partial tile maps of connected maps into a border of length 3 around the current map +LoadTileBlockMap:: ; 09fc (0:09fc) +; fill C6E8-CBFB with the background tile + ld hl,wOverworldMap + ld a,[wd3ad] ; background tile number + ld d,a + ld bc,$0514 +.backgroundTileLoop + ld a,d + ld [hli],a + dec bc + ld a,c + or b + jr nz,.backgroundTileLoop +; load tile map of current map (made of tile block IDs) +; a 3-byte border at the edges of the map is kept so that there is space for map connections + ld hl,wOverworldMap + ld a,[W_CURMAPWIDTH] + ld [$ff8c],a + add a,$06 ; border (east and west) + ld [$ff8b],a ; map width + border + ld b,$00 + ld c,a +; make space for north border (next 3 lines) + add hl,bc + add hl,bc + add hl,bc + ld c,$03 + add hl,bc ; this puts us past the (west) border + ld a,[W_MAPDATAPTR] ; tile map pointer + ld e,a + ld a,[W_MAPDATAPTR + 1] + ld d,a ; de = tile map pointer + ld a,[W_CURMAPHEIGHT] + ld b,a +.rowLoop ; copy one row each iteration + push hl + ld a,[$ff8c] ; map width (without border) + ld c,a +.rowInnerLoop + ld a,[de] + inc de + ld [hli],a + dec c + jr nz,.rowInnerLoop +; add the map width plus the border to the base address of the current row to get the next row's address + pop hl + ld a,[$ff8b] ; map width + border + add l + ld l,a + jr nc,.noCarry + inc h +.noCarry + dec b + jr nz,.rowLoop +.northConnection + ld a,[W_MAPCONN1PTR] + cp a,$ff + jr z,.southConnection + call SwitchToMapRomBank + ld a,[wd372] + ld l,a + ld a,[wd373] + ld h,a + ld a,[wd374] + ld e,a + ld a,[wd375] + ld d,a + ld a,[wd376] + ld [$ff8b],a + ld a,[wd377] + ld [$ff8c],a + call LoadNorthSouthConnectionsTileMap +.southConnection + ld a,[W_MAPCONN2PTR] + cp a,$ff + jr z,.westConnection + call SwitchToMapRomBank + ld a,[wd37d] + ld l,a + ld a,[wd37e] + ld h,a + ld a,[wd37f] + ld e,a + ld a,[wd380] + ld d,a + ld a,[wd381] + ld [$ff8b],a + ld a,[wd382] + ld [$ff8c],a + call LoadNorthSouthConnectionsTileMap +.westConnection + ld a,[W_MAPCONN3PTR] + cp a,$ff + jr z,.eastConnection + call SwitchToMapRomBank + ld a,[wd388] + ld l,a + ld a,[wd389] + ld h,a + ld a,[wd38a] + ld e,a + ld a,[wd38b] + ld d,a + ld a,[wd38c] + ld b,a + ld a,[wd38d] + ld [$ff8b],a + call LoadEastWestConnectionsTileMap +.eastConnection + ld a,[W_MAPCONN4PTR] + cp a,$ff + jr z,.done + call SwitchToMapRomBank + ld a,[wd393] + ld l,a + ld a,[wd394] + ld h,a + ld a,[wd395] + ld e,a + ld a,[wd396] + ld d,a + ld a,[wd397] + ld b,a + ld a,[wd398] + ld [$ff8b],a + call LoadEastWestConnectionsTileMap +.done + ret + +LoadNorthSouthConnectionsTileMap:: ; 0ade (0:0ade) + ld c,$03 +.loop + push de + push hl + ld a,[$ff8b] ; width of connection + ld b,a +.innerLoop + ld a,[hli] + ld [de],a + inc de + dec b + jr nz,.innerLoop + pop hl + pop de + ld a,[$ff8c] ; width of connected map + add l + ld l,a + jr nc,.noCarry1 + inc h +.noCarry1 + ld a,[W_CURMAPWIDTH] + add a,$06 + add e + ld e,a + jr nc,.noCarry2 + inc d +.noCarry2 + dec c + jr nz,.loop + ret + +LoadEastWestConnectionsTileMap:: ; 0b02 (0:0b02) + push hl + push de + ld c,$03 +.innerLoop + ld a,[hli] + ld [de],a + inc de + dec c + jr nz,.innerLoop + pop de + pop hl + ld a,[$ff8b] ; width of connected map + add l + ld l,a + jr nc,.noCarry1 + inc h +.noCarry1 + ld a,[W_CURMAPWIDTH] + add a,$06 + add e + ld e,a + jr nc,.noCarry2 + inc d +.noCarry2 + dec b + jr nz,LoadEastWestConnectionsTileMap + ret + +; function to check if there is a sign or sprite in front of the player +; if so, it is stored in [$FF8C] +; if not, [$FF8C] is set to 0 +IsSpriteOrSignInFrontOfPlayer:: ; 0b23 (0:0b23) + xor a + ld [$ff8c],a + ld a,[wd4b0] ; number of signs in the map + and a + jr z,.extendRangeOverCounter +; if there are signs + predef Func_c586 ; get the coordinates in front of the player in de + ld hl,wd4b1 ; start of sign coordinates + ld a,[wd4b0] ; number of signs in the map + ld b,a + ld c,$00 +.signLoop + inc c + ld a,[hli] ; sign Y + cp d + jr z,.yCoordMatched + inc hl + jr .retry +.yCoordMatched + ld a,[hli] ; sign X + cp e + jr nz,.retry +.xCoordMatched +; found sign + push hl + push bc + ld hl,wd4d1 ; start of sign text ID's + ld b,$00 + dec c + add hl,bc + ld a,[hl] + ld [$ff8c],a ; store sign text ID + pop bc + pop hl + ret +.retry + dec b + jr nz,.signLoop +; check if the player is front of a counter in a pokemon center, pokemart, etc. and if so, extend the range at which he can talk to the NPC +.extendRangeOverCounter + predef Func_c586 ; get the tile in front of the player in c + ld hl,W_TILESETTALKINGOVERTILES ; list of tiles that extend talking range (counter tiles) + ld b,$03 + ld d,$20 ; talking range in pixels (long range) +.counterTilesLoop + ld a,[hli] + cp c + jr z,IsSpriteInFrontOfPlayer2 ; jumps if the tile in front of the player is a counter tile + dec b + jr nz,.counterTilesLoop + +; part of the above function, but sometimes its called on its own, when signs are irrelevant +; the caller must zero [$FF8C] +IsSpriteInFrontOfPlayer:: ; 0b6b (0:0b6b) + ld d,$10 ; talking range in pixels (normal range) +IsSpriteInFrontOfPlayer2:: ; 0b6d (0:0b6d) + ld bc,$3c40 ; Y and X position of player sprite + ld a,[wSpriteStateData1 + 9] ; direction the player is facing +.checkIfPlayerFacingUp + cp a,$04 + jr nz,.checkIfPlayerFacingDown +; facing up + ld a,b + sub d + ld b,a + ld a,$08 + jr .doneCheckingDirection +.checkIfPlayerFacingDown + cp a,$00 + jr nz,.checkIfPlayerFacingRight +; facing down + ld a,b + add d + ld b,a + ld a,$04 + jr .doneCheckingDirection +.checkIfPlayerFacingRight + cp a,$0c + jr nz,.playerFacingLeft +; facing right + ld a,c + add d + ld c,a + ld a,$01 + jr .doneCheckingDirection +.playerFacingLeft +; facing left + ld a,c + sub d + ld c,a + ld a,$02 +.doneCheckingDirection + ld [wd52a],a + ld a,[W_NUMSPRITES] ; number of sprites + and a + ret z +; if there are sprites + ld hl,wSpriteStateData1 + $10 + ld d,a + ld e,$01 +.spriteLoop + push hl + ld a,[hli] ; image (0 if no sprite) + and a + jr z,.nextSprite + inc l + ld a,[hli] ; sprite visibility + inc a + jr z,.nextSprite + inc l + ld a,[hli] ; Y location + cp b + jr nz,.nextSprite + inc l + ld a,[hl] ; X location + cp c + jr z,.foundSpriteInFrontOfPlayer +.nextSprite + pop hl + ld a,l + add a,$10 + ld l,a + inc e + dec d + jr nz,.spriteLoop + ret +.foundSpriteInFrontOfPlayer + pop hl + ld a,l + and a,$f0 + inc a + ld l,a + set 7,[hl] + ld a,e + ld [$ff8c],a ; store sprite ID + ret + +; function to check if the player will jump down a ledge and check if the tile ahead is passable (when not surfing) +; sets the carry flag if there is a collision, and unsets it if there isn't a collision +CollisionCheckOnLand:: ; 0bd1 (0:0bd1) + ld a,[wd736] + bit 6,a ; is the player jumping? + jr nz,.noCollision +; if not jumping a ledge + ld a,[wcd38] + and a + jr nz,.noCollision + ld a,[wd52a] ; the direction that the player is trying to go in + ld d,a + ld a,[wSpriteStateData1 + 12] ; the player sprite's collision data (bit field) (set in the sprite movement code) + and d ; check if a sprite is in the direction the player is trying to go + jr nz,.collision + xor a + ld [$ff8c],a + call IsSpriteInFrontOfPlayer ; check for sprite collisions again? when does the above check fail to detect a sprite collision? + ld a,[$ff8c] + and a ; was there a sprite collision? + jr nz,.collision +; if no sprite collision + ld hl,TilePairCollisionsLand + call CheckForJumpingAndTilePairCollisions + jr c,.collision + call CheckTilePassable + jr nc,.noCollision +.collision + ld a,[wc02a] + cp a,(SFX_02_5b - SFX_Headers_02) / 3 ; check if collision sound is already playing + jr z,.setCarry + ld a,(SFX_02_5b - SFX_Headers_02) / 3 + call PlaySound ; play collision sound (if it's not already playing) +.setCarry + scf + ret +.noCollision + and a + ret + +; function that checks if the tile in front of the player is passable +; clears carry if it is, sets carry if not +CheckTilePassable:: ; 0c10 (0:0c10) + predef Func_c586 ; get tile in front of player + ld a,[wcfc6] ; tile in front of player + ld c,a + ld hl,W_TILESETCOLLISIONPTR ; pointer to list of passable tiles + ld a,[hli] + ld h,[hl] + ld l,a ; hl now points to passable tiles +.loop + ld a,[hli] + cp a,$ff + jr z,.tileNotPassable + cp c + ret z + jr .loop +.tileNotPassable + scf + ret + +; check if the player is going to jump down a small ledge +; and check for collisions that only occur between certain pairs of tiles +; Input: hl - address of directional collision data +; sets carry if there is a collision and unsets carry if not +CheckForJumpingAndTilePairCollisions:: ; 0c2a (0:0c2a) + push hl + predef Func_c586 ; get the tile in front of the player + push de + push bc + callba HandleLedges ; check if the player is trying to jump a ledge + pop bc + pop de + pop hl + and a + ld a,[wd736] + bit 6,a ; is the player jumping? + ret nz +; if not jumping + +Func_c44:: ; 0c44 (0:0c44) + aCoord 8, 9 ; tile the player is on + ld [wcf0e],a + +CheckForTilePairCollisions:: ; 0c4a (0:0c4a) + ld a,[wcfc6] ; tile in front of the player + ld c,a +.tilePairCollisionLoop + ld a,[W_CURMAPTILESET] ; tileset number + ld b,a + ld a,[hli] + cp a,$ff + jr z,.noMatch + cp b + jr z,.tilesetMatches + inc hl +.retry + inc hl + jr .tilePairCollisionLoop +.tilesetMatches + ld a,[wcf0e] ; tile the player is on + ld b,a + ld a,[hl] + cp b + jr z,.currentTileMatchesFirstInPair + inc hl + ld a,[hl] + cp b + jr z,.currentTileMatchesSecondInPair + jr .retry +.currentTileMatchesFirstInPair + inc hl + ld a,[hl] + cp c + jr z,.foundMatch + jr .tilePairCollisionLoop +.currentTileMatchesSecondInPair + dec hl + ld a,[hli] + cp c + inc hl + jr nz,.tilePairCollisionLoop +.foundMatch + scf + ret +.noMatch + and a + ret + +; FORMAT: tileset number, tile 1, tile 2 +; terminated by 0xFF +; these entries indicate that the player may not cross between tile 1 and tile 2 +; it's mainly used to simulate differences in elevation + +TilePairCollisionsLand:: ; 0c7e (0:0c7e) + db CAVERN, $20, $05 + db CAVERN, $41, $05 + db FOREST, $30, $2E + db CAVERN, $2A, $05 + db CAVERN, $05, $21 + db FOREST, $52, $2E + db FOREST, $55, $2E + db FOREST, $56, $2E + db FOREST, $20, $2E + db FOREST, $5E, $2E + db FOREST, $5F, $2E + db $FF + +TilePairCollisionsWater:: ; 0ca0 (0:0ca0) + db FOREST, $14, $2E + db FOREST, $48, $2E + db CAVERN, $14, $05 + db $FF + +; this builds a tile map from the tile block map based on the current X/Y coordinates of the player's character +LoadCurrentMapView:: ; 0caa (0:0caa) + ld a,[H_LOADEDROMBANK] + push af + ld a,[W_TILESETBANK] ; tile data ROM bank + ld [H_LOADEDROMBANK],a + ld [$2000],a ; switch to ROM bank that contains tile data + ld a,[wd35f] ; address of upper left corner of current map view + ld e,a + ld a,[wd360] + ld d,a + ld hl,wTileMapBackup + ld b,$05 +.rowLoop ; each loop iteration fills in one row of tile blocks + push hl + push de + ld c,$06 +.rowInnerLoop ; loop to draw each tile block of the current row + push bc + push de + push hl + ld a,[de] + ld c,a ; tile block number + call DrawTileBlock + pop hl + pop de + pop bc + inc hl + inc hl + inc hl + inc hl + inc de + dec c + jr nz,.rowInnerLoop +; update tile block map pointer to next row's address + pop de + ld a,[W_CURMAPWIDTH] + add a,$06 + add e + ld e,a + jr nc,.noCarry + inc d +.noCarry +; update tile map pointer to next row's address + pop hl + ld a,$60 + add l + ld l,a + jr nc,.noCarry2 + inc h +.noCarry2 + dec b + jr nz,.rowLoop + ld hl,wTileMapBackup + ld bc,$0000 +.adjustForYCoordWithinTileBlock + ld a,[W_YBLOCKCOORD] + and a + jr z,.adjustForXCoordWithinTileBlock + ld bc,$0030 + add hl,bc +.adjustForXCoordWithinTileBlock + ld a,[W_XBLOCKCOORD] + and a + jr z,.copyToVisibleAreaBuffer + ld bc,$0002 + add hl,bc +.copyToVisibleAreaBuffer + ld de,wTileMap ; base address for the tiles that are directly transfered to VRAM during V-blank + ld b,$12 +.rowLoop2 + ld c,$14 +.rowInnerLoop2 + ld a,[hli] + ld [de],a + inc de + dec c + jr nz,.rowInnerLoop2 + ld a,$04 + add l + ld l,a + jr nc,.noCarry3 + inc h +.noCarry3 + dec b + jr nz,.rowLoop2 + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a ; restore previous ROM bank + ret + +AdvancePlayerSprite:: ; 0d27 (0:0d27) + ld a,[wSpriteStateData1 + 3] ; delta Y + ld b,a + ld a,[wSpriteStateData1 + 5] ; delta X + ld c,a + ld hl,wWalkCounter ; walking animation counter + dec [hl] + jr nz,.afterUpdateMapCoords +; if it's the end of the animation, update the player's map coordinates + ld a,[W_YCOORD] + add b + ld [W_YCOORD],a + ld a,[W_XCOORD] + add c + ld [W_XCOORD],a +.afterUpdateMapCoords + ld a,[wWalkCounter] ; walking animation counter + cp a,$07 + jp nz,.scrollBackgroundAndSprites +; if this is the first iteration of the animation + ld a,c + cp a,$01 + jr nz,.checkIfMovingWest +; moving east + ld a,[wd526] + ld e,a + and a,$e0 + ld d,a + ld a,e + add a,$02 + and a,$1f + or d + ld [wd526],a + jr .adjustXCoordWithinBlock +.checkIfMovingWest + cp a,$ff + jr nz,.checkIfMovingSouth +; moving west + ld a,[wd526] + ld e,a + and a,$e0 + ld d,a + ld a,e + sub a,$02 + and a,$1f + or d + ld [wd526],a + jr .adjustXCoordWithinBlock +.checkIfMovingSouth + ld a,b + cp a,$01 + jr nz,.checkIfMovingNorth +; moving south + ld a,[wd526] + add a,$40 + ld [wd526],a + jr nc,.adjustXCoordWithinBlock + ld a,[wd527] + inc a + and a,$03 + or a,$98 + ld [wd527],a + jr .adjustXCoordWithinBlock +.checkIfMovingNorth + cp a,$ff + jr nz,.adjustXCoordWithinBlock +; moving north + ld a,[wd526] + sub a,$40 + ld [wd526],a + jr nc,.adjustXCoordWithinBlock + ld a,[wd527] + dec a + and a,$03 + or a,$98 + ld [wd527],a +.adjustXCoordWithinBlock + ld a,c + and a + jr z,.pointlessJump ; mistake? +.pointlessJump + ld hl,W_XBLOCKCOORD + ld a,[hl] + add c + ld [hl],a + cp a,$02 + jr nz,.checkForMoveToWestBlock +; moved into the tile block to the east + xor a + ld [hl],a + ld hl,wd4e3 + inc [hl] + ld de,wd35f + call MoveTileBlockMapPointerEast + jr .updateMapView +.checkForMoveToWestBlock + cp a,$ff + jr nz,.adjustYCoordWithinBlock +; moved into the tile block to the west + ld a,$01 + ld [hl],a + ld hl,wd4e3 + dec [hl] + ld de,wd35f + call MoveTileBlockMapPointerWest + jr .updateMapView +.adjustYCoordWithinBlock + ld hl,W_YBLOCKCOORD + ld a,[hl] + add b + ld [hl],a + cp a,$02 + jr nz,.checkForMoveToNorthBlock +; moved into the tile block to the south + xor a + ld [hl],a + ld hl,wd4e2 + inc [hl] + ld de,wd35f + ld a,[W_CURMAPWIDTH] + call MoveTileBlockMapPointerSouth + jr .updateMapView +.checkForMoveToNorthBlock + cp a,$ff + jr nz,.updateMapView +; moved into the tile block to the north + ld a,$01 + ld [hl],a + ld hl,wd4e2 + dec [hl] + ld de,wd35f + ld a,[W_CURMAPWIDTH] + call MoveTileBlockMapPointerNorth +.updateMapView + call LoadCurrentMapView + ld a,[wSpriteStateData1 + 3] ; delta Y + cp a,$01 + jr nz,.checkIfMovingNorth2 +; if moving south + call ScheduleSouthRowRedraw + jr .scrollBackgroundAndSprites +.checkIfMovingNorth2 + cp a,$ff + jr nz,.checkIfMovingEast2 +; if moving north + call ScheduleNorthRowRedraw + jr .scrollBackgroundAndSprites +.checkIfMovingEast2 + ld a,[wSpriteStateData1 + 5] ; delta X + cp a,$01 + jr nz,.checkIfMovingWest2 +; if moving east + call ScheduleEastColumnRedraw + jr .scrollBackgroundAndSprites +.checkIfMovingWest2 + cp a,$ff + jr nz,.scrollBackgroundAndSprites +; if moving west + call ScheduleWestColumnRedraw +.scrollBackgroundAndSprites + ld a,[wSpriteStateData1 + 3] ; delta Y + ld b,a + ld a,[wSpriteStateData1 + 5] ; delta X + ld c,a + sla b + sla c + ld a,[$ffaf] + add b + ld [$ffaf],a ; update background scroll Y + ld a,[$ffae] + add c + ld [$ffae],a ; update background scroll X +; shift all the sprites in the direction opposite of the player's motion +; so that the player appears to move relative to them + ld hl,wSpriteStateData1 + $14 + ld a,[W_NUMSPRITES] ; number of sprites + and a ; are there any sprites? + jr z,.done + ld e,a +.spriteShiftLoop + ld a,[hl] + sub b + ld [hli],a + inc l + ld a,[hl] + sub c + ld [hl],a + ld a,$0e + add l + ld l,a + dec e + jr nz,.spriteShiftLoop +.done + ret + +; the following four functions are used to move the pointer to the upper left +; corner of the tile block map in the direction of motion + +MoveTileBlockMapPointerEast:: ; 0e65 (0:0e65) + ld a,[de] + add a,$01 + ld [de],a + ret nc + inc de + ld a,[de] + inc a + ld [de],a + ret + +MoveTileBlockMapPointerWest:: ; 0e6f (0:0e6f) + ld a,[de] + sub a,$01 + ld [de],a + ret nc + inc de + ld a,[de] + dec a + ld [de],a + ret + +MoveTileBlockMapPointerSouth:: ; 0e79 (0:0e79) + add a,$06 + ld b,a + ld a,[de] + add b + ld [de],a + ret nc + inc de + ld a,[de] + inc a + ld [de],a + ret + +MoveTileBlockMapPointerNorth:: ; 0e85 (0:0e85) + add a,$06 + ld b,a + ld a,[de] + sub b + ld [de],a + ret nc + inc de + ld a,[de] + dec a + ld [de],a + ret + +; the following 6 functions are used to tell the V-blank handler to redraw +; the portion of the map that was newly exposed due to the player's movement + +ScheduleNorthRowRedraw:: ; 0e91 (0:0e91) + hlCoord 0, 0 + call ScheduleRowRedrawHelper + ld a,[wd526] + ld [H_SCREENEDGEREDRAWADDR],a + ld a,[wd527] + ld [H_SCREENEDGEREDRAWADDR + 1],a + ld a,REDRAWROW + ld [H_SCREENEDGEREDRAW],a + ret + +ScheduleRowRedrawHelper:: ; 0ea6 (0:0ea6) + ld de,wScreenEdgeTiles + ld c,$28 +.loop + ld a,[hli] + ld [de],a + inc de + dec c + jr nz,.loop + ret + +ScheduleSouthRowRedraw:: ; 0eb2 (0:0eb2) + hlCoord 0, 16 + call ScheduleRowRedrawHelper + ld a,[wd526] + ld l,a + ld a,[wd527] + ld h,a + ld bc,$0200 + add hl,bc + ld a,h + and a,$03 + or a,$98 + ld [H_SCREENEDGEREDRAWADDR + 1],a + ld a,l + ld [H_SCREENEDGEREDRAWADDR],a + ld a,REDRAWROW + ld [H_SCREENEDGEREDRAW],a + ret + +ScheduleEastColumnRedraw:: ; 0ed3 (0:0ed3) + hlCoord 18, 0 + call ScheduleColumnRedrawHelper + ld a,[wd526] + ld c,a + and a,$e0 + ld b,a + ld a,c + add a,18 + and a,$1f + or b + ld [H_SCREENEDGEREDRAWADDR],a + ld a,[wd527] + ld [H_SCREENEDGEREDRAWADDR + 1],a + ld a,REDRAWCOL + ld [H_SCREENEDGEREDRAW],a + ret + +ScheduleColumnRedrawHelper:: ; 0ef2 (0:0ef2) + ld de,wScreenEdgeTiles + ld c,$12 +.loop + ld a,[hli] + ld [de],a + inc de + ld a,[hl] + ld [de],a + inc de + ld a,19 + add l + ld l,a + jr nc,.noCarry + inc h +.noCarry + dec c + jr nz,.loop + ret + +ScheduleWestColumnRedraw:: ; 0f08 (0:0f08) + hlCoord 0, 0 + call ScheduleColumnRedrawHelper + ld a,[wd526] + ld [H_SCREENEDGEREDRAWADDR],a + ld a,[wd527] + ld [H_SCREENEDGEREDRAWADDR + 1],a + ld a,REDRAWCOL + ld [H_SCREENEDGEREDRAW],a + ret + +; function to write the tiles that make up a tile block to memory +; Input: c = tile block ID, hl = destination address +DrawTileBlock:: ; 0f1d (0:0f1d) + push hl + ld a,[W_TILESETBLOCKSPTR] ; pointer to tiles + ld l,a + ld a,[W_TILESETBLOCKSPTR + 1] + ld h,a + ld a,c + swap a + ld b,a + and a,$f0 + ld c,a + ld a,b + and a,$0f + ld b,a ; bc = tile block ID * 0x10 + add hl,bc + ld d,h + ld e,l ; de = address of the tile block's tiles + pop hl + ld c,$04 ; 4 loop iterations +.loop ; each loop iteration, write 4 tile numbers + push bc + ld a,[de] + ld [hli],a + inc de + ld a,[de] + ld [hli],a + inc de + ld a,[de] + ld [hli],a + inc de + ld a,[de] + ld [hl],a + inc de + ld bc,$0015 + add hl,bc + pop bc + dec c + jr nz,.loop + ret + +; function to update joypad state and simulate button presses +JoypadOverworld:: ; 0f4d (0:0f4d) + xor a + ld [wSpriteStateData1 + 3],a + ld [wSpriteStateData1 + 5],a + call RunMapScript + call Joypad + ld a,[W_FLAGS_D733] + bit 3,a ; check if a trainer wants a challenge + jr nz,.notForcedDownwards + ld a,[W_CURMAP] + cp a,ROUTE_17 ; Cycling Road + jr nz,.notForcedDownwards + ld a,[hJoyHeld] ; current joypad state + and a,%11110011 ; bit mask for all directions and A/B + jr nz,.notForcedDownwards + ld a,%10000000 ; down pressed + ld [hJoyHeld],a ; on the cycling road, if there isn't a trainer and the player isn't pressing buttons, simulate a down press +.notForcedDownwards + ld a,[wd730] + bit 7,a + ret z +; if simulating button presses + ld a,[hJoyHeld] ; current joypad state + ld b,a + ld a,[wcd3b] ; bit mask for button presses that override simulated ones + and b + ret nz ; return if the simulated button presses are overridden + ld hl,wcd38 ; index of current simulated button press + dec [hl] + ld a,[hl] + cp a,$ff + jr z,.doneSimulating ; if the end of the simulated button presses has been reached + ld hl,wccd3 ; base address of simulated button presses +; add offset to base address + add l + ld l,a + jr nc,.noCarry + inc h +.noCarry + ld a,[hl] + ld [hJoyHeld],a ; store simulated button press in joypad state + and a + ret nz + ld [hJoyPressed],a + ld [hJoyReleased],a + ret +; if done simulating button presses +.doneSimulating + xor a + ld [wcd3a],a + ld [wcd38],a + ld [wccd3],a + ld [wJoyIgnore],a + ld [hJoyHeld],a + ld hl,wd736 + ld a,[hl] + and a,$f8 + ld [hl],a + ld hl,wd730 + res 7,[hl] + ret + +; function to check the tile ahead to determine if the character should get on land or keep surfing +; sets carry if there is a collision and clears carry otherwise +; It seems that this function has a bug in it, but due to luck, it doesn't +; show up. After detecting a sprite collision, it jumps to the code that +; checks if the next tile is passable instead of just directly jumping to the +; "collision detected" code. However, it doesn't store the next tile in c, +; so the old value of c is used. 2429 is always called before this function, +; and 2429 always sets c to 0xF0. There is no 0xF0 background tile, so it +; is considered impassable and it is detected as a collision. +CollisionCheckOnWater:: ; 0fb7 (0:0fb7) + ld a,[wd730] + bit 7,a + jp nz,.noCollision ; return and clear carry if button presses are being simulated + ld a,[wd52a] ; the direction that the player is trying to go in + ld d,a + ld a,[wSpriteStateData1 + 12] ; the player sprite's collision data (bit field) (set in the sprite movement code) + and d ; check if a sprite is in the direction the player is trying to go + jr nz,.checkIfNextTileIsPassable ; bug? + ld hl,TilePairCollisionsWater + call CheckForJumpingAndTilePairCollisions + jr c,.collision + predef Func_c586 ; get tile in front of player (puts it in c and [wcfc6]) + ld a,[wcfc6] ; tile in front of player + cp a,$14 ; water tile + jr z,.noCollision ; keep surfing if it's a water tile + cp a,$32 ; either the left tile of the S.S. Anne boarding platform or the tile on eastern coastlines (depending on the current tileset) + jr z,.checkIfVermilionDockTileset + cp a,$48 ; tile on right on coast lines in Safari Zone + jr z,.noCollision ; keep surfing +; check if the [land] tile in front of the player is passable +.checkIfNextTileIsPassable + ld hl,W_TILESETCOLLISIONPTR ; pointer to list of passable tiles + ld a,[hli] + ld h,[hl] + ld l,a +.loop + ld a,[hli] + cp a,$ff + jr z,.collision + cp c + jr z,.stopSurfing ; stop surfing if the tile is passable + jr .loop +.collision + ld a,[wc02a] + cp a,(SFX_02_5b - SFX_Headers_02) / 3 ; check if collision sound is already playing + jr z,.setCarry + ld a,(SFX_02_5b - SFX_Headers_02) / 3 + call PlaySound ; play collision sound (if it's not already playing) +.setCarry + scf + jr .done +.noCollision + and a +.done + ret +.stopSurfing + xor a + ld [wd700],a + call LoadPlayerSpriteGraphics + call Func_2307 + jr .noCollision +.checkIfVermilionDockTileset + ld a, [W_CURMAPTILESET] ; tileset + cp SHIP_PORT ; Vermilion Dock tileset + jr nz, .noCollision ; keep surfing if it's not the boarding platform tile + jr .stopSurfing ; if it is the boarding platform tile, stop surfing + +; function to run the current map's script +RunMapScript:: ; 101b (0:101b) + push hl + push de + push bc + callba Func_f225 ; check if the player is pushing a boulder + ld a,[wFlags_0xcd60] + bit 1,a ; is the player pushing a boulder? + jr z,.afterBoulderEffect + callba Func_f2b5 ; displays dust effect when pushing a boulder +.afterBoulderEffect + pop bc + pop de + pop hl + call Func_310e + ld a,[W_CURMAP] ; current map number + call SwitchToMapRomBank ; change to the ROM bank the map's data is in + ld hl,W_MAPSCRIPTPTR + ld a,[hli] + ld h,[hl] + ld l,a + ld de,.return + push de + jp [hl] ; jump to script +.return + ret + +LoadWalkingPlayerSpriteGraphics:: ; 104d (0:104d) + ld de,RedSprite ; $4180 + ld hl,vNPCSprites + jr LoadPlayerSpriteGraphicsCommon + +LoadSurfingPlayerSpriteGraphics:: ; 1055 (0:1055) + ld de,SeelSprite + ld hl,vNPCSprites + jr LoadPlayerSpriteGraphicsCommon + +LoadBikePlayerSpriteGraphics:: ; 105d (0:105d) + ld de,RedCyclingSprite + ld hl,vNPCSprites + +LoadPlayerSpriteGraphicsCommon:: ; 1063 (0:1063) + push de + push hl + ld bc,(BANK(RedSprite) << 8) + $0c + call CopyVideoData + pop hl + pop de + ld a,$c0 + add e + ld e,a + jr nc,.noCarry + inc d +.noCarry + set 3,h + ld bc,$050c + jp CopyVideoData + +; function to load data from the map header +LoadMapHeader:: ; 107c (0:107c) + callba Func_f113 + ld a,[W_CURMAPTILESET] + ld [wd119],a + ld a,[W_CURMAP] + call SwitchToMapRomBank + ld a,[W_CURMAPTILESET] + ld b,a + res 7,a + ld [W_CURMAPTILESET],a + ld [$ff8b],a + bit 7,b + ret nz + ld hl,MapHeaderPointers + ld a,[W_CURMAP] + sla a + jr nc,.noCarry1 + inc h +.noCarry1 + add l + ld l,a + jr nc,.noCarry2 + inc h +.noCarry2 + ld a,[hli] + ld h,[hl] + ld l,a ; hl = base of map header +; copy the first 10 bytes (the fixed area) of the map data to D367-D370 + ld de,W_CURMAPTILESET + ld c,$0a +.copyFixedHeaderLoop + ld a,[hli] + ld [de],a + inc de + dec c + jr nz,.copyFixedHeaderLoop +; initialize all the connected maps to disabled at first, before loading the actual values + ld a,$ff + ld [W_MAPCONN1PTR],a + ld [W_MAPCONN2PTR],a + ld [W_MAPCONN3PTR],a + ld [W_MAPCONN4PTR],a +; copy connection data (if any) to WRAM + ld a,[W_MAPCONNECTIONS] + ld b,a +.checkNorth + bit 3,b + jr z,.checkSouth + ld de,W_MAPCONN1PTR + call CopyMapConnectionHeader +.checkSouth + bit 2,b + jr z,.checkWest + ld de,W_MAPCONN2PTR + call CopyMapConnectionHeader +.checkWest + bit 1,b + jr z,.checkEast + ld de,W_MAPCONN3PTR + call CopyMapConnectionHeader +.checkEast + bit 0,b + jr z,.getObjectDataPointer + ld de,W_MAPCONN4PTR + call CopyMapConnectionHeader +.getObjectDataPointer + ld a,[hli] + ld [wd3a9],a + ld a,[hli] + ld [wd3aa],a + push hl + ld a,[wd3a9] + ld l,a + ld a,[wd3aa] + ld h,a ; hl = base of object data + ld de,wd3ad ; background tile ID + ld a,[hli] + ld [de],a ; save background tile ID +.loadWarpData + ld a,[hli] ; number of warps + ld [wd3ae],a ; save the number of warps + and a ; are there any warps? + jr z,.loadSignData ; if not, skip this + ld c,a + ld de,wd3af ; base address of warps +.warpLoop ; one warp per loop iteration + ld b,$04 +.warpInnerLoop + ld a,[hli] + ld [de],a + inc de + dec b + jr nz,.warpInnerLoop + dec c + jr nz,.warpLoop +.loadSignData + ld a,[hli] ; number of signs + ld [wd4b0],a ; save the number of signs + and a ; are there any signs? + jr z,.loadSpriteData ; if not, skip this + ld c,a + ld de,wd4d1 ; base address of sign text IDs + ld a,d + ld [$ff95],a + ld a,e + ld [$ff96],a + ld de,wd4b1 ; base address of sign coordinates +.signLoop + ld a,[hli] + ld [de],a + inc de + ld a,[hli] + ld [de],a + inc de + push de + ld a,[$ff95] + ld d,a + ld a,[$ff96] + ld e,a + ld a,[hli] + ld [de],a + inc de + ld a,d + ld [$ff95],a + ld a,e + ld [$ff96],a + pop de + dec c + jr nz,.signLoop +.loadSpriteData + ld a,[wd72e] + bit 5,a ; did a battle happen immediately before this? + jp nz,.finishUp ; if so, skip this because battles don't destroy this data + ld a,[hli] + ld [W_NUMSPRITES],a ; save the number of sprites + push hl +; zero C110-C1FF and C210-C2FF + ld hl,wSpriteStateData1 + $10 + ld de,wSpriteStateData2 + $10 + xor a + ld b,$f0 +.zeroSpriteDataLoop + ld [hli],a + ld [de],a + inc e + dec b + jr nz,.zeroSpriteDataLoop +; initialize all C100-C1FF sprite entries to disabled (other than player's) + ld hl,wSpriteStateData1 + $12 + ld de,$0010 + ld c,$0f +.disableSpriteEntriesLoop + ld [hl],$ff + add hl,de + dec c + jr nz,.disableSpriteEntriesLoop + pop hl + ld de,wSpriteStateData1 + $10 + ld a,[W_NUMSPRITES] ; number of sprites + and a ; are there any sprites? + jp z,.finishUp ; if there are no sprites, skip the rest + ld b,a + ld c,$00 +.loadSpriteLoop + ld a,[hli] + ld [de],a ; store picture ID at C1X0 + inc d + ld a,$04 + add e + ld e,a + ld a,[hli] + ld [de],a ; store Y position at C2X4 + inc e + ld a,[hli] + ld [de],a ; store X position at C2X5 + inc e + ld a,[hli] + ld [de],a ; store movement byte 1 at C2X6 + ld a,[hli] + ld [$ff8d],a ; save movement byte 2 + ld a,[hli] + ld [$ff8e],a ; save text ID and flags byte + push bc + push hl + ld b,$00 + ld hl,W_MAPSPRITEDATA + add hl,bc + ld a,[$ff8d] + ld [hli],a ; store movement byte 2 in byte 0 of sprite entry + ld a,[$ff8e] + ld [hl],a ; this appears pointless, since the value is overwritten immediately after + ld a,[$ff8e] + ld [$ff8d],a + and a,$3f + ld [hl],a ; store text ID in byte 1 of sprite entry + pop hl + ld a,[$ff8d] + bit 6,a + jr nz,.trainerSprite + bit 7,a + jr nz,.itemBallSprite + jr .regularSprite +.trainerSprite + ld a,[hli] + ld [$ff8d],a ; save trainer class + ld a,[hli] + ld [$ff8e],a ; save trainer number (within class) + push hl + ld hl,W_MAPSPRITEEXTRADATA + add hl,bc + ld a,[$ff8d] + ld [hli],a ; store trainer class in byte 0 of the entry + ld a,[$ff8e] + ld [hl],a ; store trainer number in byte 1 of the entry + pop hl + jr .nextSprite +.itemBallSprite + ld a,[hli] + ld [$ff8d],a ; save item number + push hl + ld hl,W_MAPSPRITEEXTRADATA + add hl,bc + ld a,[$ff8d] + ld [hli],a ; store item number in byte 0 of the entry + xor a + ld [hl],a ; zero byte 1, since it is not used + pop hl + jr .nextSprite +.regularSprite + push hl + ld hl,W_MAPSPRITEEXTRADATA + add hl,bc +; zero both bytes, since regular sprites don't use this extra space + xor a + ld [hli],a + ld [hl],a + pop hl +.nextSprite + pop bc + dec d + ld a,$0a + add e + ld e,a + inc c + inc c + dec b + jp nz,.loadSpriteLoop +.finishUp + predef Func_c754 ; load tileset data + callab LoadWildData ; load wild pokemon data + pop hl ; restore hl from before going to the warp/sign/sprite data (this value was saved for seemingly no purpose) + ld a,[W_CURMAPHEIGHT] ; map height in 4x4 tile blocks + add a ; double it + ld [wd524],a ; store map height in 2x2 tile blocks + ld a,[W_CURMAPWIDTH] ; map width in 4x4 tile blocks + add a ; double it + ld [wd525],a ; map width in 2x2 tile blocks + ld a,[W_CURMAP] + ld c,a + ld b,$00 + ld a,[H_LOADEDROMBANK] + push af + ld a, BANK(MapSongBanks) + ld [H_LOADEDROMBANK],a + ld [$2000],a + ld hl, MapSongBanks + add hl,bc + add hl,bc + ld a,[hli] + ld [wd35b],a ; music 1 + ld a,[hl] + ld [wd35c],a ; music 2 + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a + ret + +; function to copy map connection data from ROM to WRAM +; Input: hl = source, de = destination +CopyMapConnectionHeader:: ; 1238 (0:1238) + ld c,$0b +.loop + ld a,[hli] + ld [de],a + inc de + dec c + jr nz,.loop + ret + +; function to load map data +LoadMapData:: ; 1241 (0:1241) + ld a,[H_LOADEDROMBANK] + push af + call DisableLCD + ld a,$98 + ld [wd527],a + xor a + ld [wd526],a + ld [$ffaf],a + ld [$ffae],a + ld [wWalkCounter],a + ld [wd119],a + ld [wd11a],a + ld [W_SPRITESETID],a + call LoadTextBoxTilePatterns + call LoadMapHeader + callba InitMapSprites ; load tile pattern data for sprites + call LoadTileBlockMap + call LoadTilesetTilePatternData + call LoadCurrentMapView +; copy current map view to VRAM + ld hl,wTileMap + ld de,vBGMap0 + ld b,18 +.vramCopyLoop + ld c,20 +.vramCopyInnerLoop + ld a,[hli] + ld [de],a + inc e + dec c + jr nz,.vramCopyInnerLoop + ld a,32 - 20 + add e + ld e,a + jr nc,.noCarry + inc d +.noCarry + dec b + jr nz,.vramCopyLoop + ld a,$01 + ld [wcfcb],a + call EnableLCD + ld b,$09 + call GoPAL_SET + call LoadPlayerSpriteGraphics + ld a,[wd732] + and a,$18 ; did the player fly or teleport in? + jr nz,.restoreRomBank + ld a,[W_FLAGS_D733] + bit 1,a + jr nz,.restoreRomBank + call Func_235f ; music related + call Func_2312 ; music related +.restoreRomBank + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a + ret + +; function to switch to the ROM bank that a map is stored in +; Input: a = map number +SwitchToMapRomBank:: ; 12bc (0:12bc) + push hl + push bc + ld c,a + ld b,$00 + ld a,Bank(MapHeaderBanks) + call BankswitchHome ; switch to ROM bank 3 + ld hl,MapHeaderBanks + add hl,bc + ld a,[hl] + ld [$ffe8],a ; save map ROM bank + call BankswitchBack + ld a,[$ffe8] + ld [H_LOADEDROMBANK],a + ld [$2000],a ; switch to map ROM bank + pop bc + pop hl + ret + +Func_12da:: ; 12da (0:12da) + ld a, $1e + ld [wd13a], a + ld hl, wd730 + ld a, [hl] + or $26 + ld [hl], a + ret + +Func_12e7:: ; 12e7 (0:12e7) + ld hl, wd728 + res 0, [hl] + ret + +ForceBikeOrSurf:: ; 12ed (0:12ed) + ld b, BANK(RedSprite) + ld hl, LoadPlayerSpriteGraphics + call Bankswitch + jp Func_2307 ; update map/player state? diff --git a/home/pic.asm b/home/pic.asm new file mode 100644 index 00000000..6aa2e5c0 --- /dev/null +++ b/home/pic.asm @@ -0,0 +1,591 @@ +; bankswitches and runs _UncompressSpriteData +; bank is given in a, sprite input stream is pointed to in W_SPRITEINPUTPTR +UncompressSpriteData:: ; 24fd (0:24fd) + ld b, a + ld a, [H_LOADEDROMBANK] + push af + ld a, b + ld [H_LOADEDROMBANK], a + ld [$2000], a + ld a, $a + ld [$0], a + xor a + ld [$4000], a + call _UncompressSpriteData + pop af + ld [H_LOADEDROMBANK], a + ld [$2000], a + ret + +; initializes necessary data to load a sprite and runs UncompressSpriteDataLoop +_UncompressSpriteData:: ; 251a (0:251a) + ld hl, S_SPRITEBUFFER1 + ld c, (2*SPRITEBUFFERSIZE) % $100 + ld b, (2*SPRITEBUFFERSIZE) / $100 + xor a + call FillMemory ; clear sprite buffer 1 and 2 + ld a, $1 + ld [W_SPRITEINPUTBITCOUNTER], a + ld a, $3 + ld [W_SPRITEOUTPUTBITOFFSET], a + xor a + ld [W_SPRITECURPOSX], a + ld [W_SPRITECURPOSY], a + ld [W_SPRITELOADFLAGS], a ; wd0a8 + call ReadNextInputByte ; first byte of input determines sprite width (high nybble) and height (low nybble) in tiles (8x8 pixels) + ld b, a + and $f + add a + add a + add a + ld [W_SPRITEHEIGHT], a + ld a, b + swap a + and $f + add a + add a + add a + ld [W_SPRITEWITDH], a + call ReadNextInputBit + ld [W_SPRITELOADFLAGS], a ; initialite bit1 to 0 and bit0 to the first input bit + ; this will load two chunks of data to S_SPRITEBUFFER1 and S_SPRITEBUFFER2 + ; bit 0 decides in which one the first chunk is placed + ; fall through + +; uncompresses a chunk from the sprite input data stream (pointed to at wd0da) into S_SPRITEBUFFER1 or S_SPRITEBUFFER2 +; each chunk is a 1bpp sprite. A 2bpp sprite consist of two chunks which are merged afterwards +; note that this is an endless loop which is terminated during a call to MoveToNextBufferPosition by manipulating the stack +UncompressSpriteDataLoop:: ; 2556 (0:2556) + ld hl, S_SPRITEBUFFER1 + ld a, [W_SPRITELOADFLAGS] ; wd0a8 + bit 0, a + jr z, .useSpriteBuffer1 ; check which buffer to use + ld hl, S_SPRITEBUFFER2 +.useSpriteBuffer1 + call StoreSpriteOutputPointer + ld a, [W_SPRITELOADFLAGS] ; wd0a8 + bit 1, a + jr z, .startDecompression ; check if last iteration + call ReadNextInputBit ; if last chunk, read 1-2 bit unpacking mode + and a + jr z, .unpackingMode0 ; 0 -> mode 0 + call ReadNextInputBit ; 1 0 -> mode 1 + inc a ; 1 1 -> mode 2 +.unpackingMode0 + ld [W_SPRITEUNPACKMODE], a +.startDecompression + call ReadNextInputBit + and a + jr z, .readRLEncodedZeros ; if first bit is 0, the input starts with zeroes, otherwise with (non-zero) input +.readNextInput + call ReadNextInputBit + ld c, a + call ReadNextInputBit + sla c + or c ; read next two bits into c + and a + jr z, .readRLEncodedZeros ; 00 -> RLEncoded zeroes following + call WriteSpriteBitsToBuffer ; otherwise write input to output and repeat + call MoveToNextBufferPosition + jr .readNextInput +.readRLEncodedZeros + ld c, $0 ; number of zeroes it length encoded, the number +.countConsecutiveOnesLoop ; of consecutive ones determines the number of bits the number has + call ReadNextInputBit + and a + jr z, .countConsecutiveOnesFinished + inc c + jr .countConsecutiveOnesLoop +.countConsecutiveOnesFinished + ld a, c + add a + ld hl, LengthEncodingOffsetList + add l + ld l, a + jr nc, .noCarry + inc h +.noCarry + ld a, [hli] ; read offset that is added to the number later on + ld e, a ; adding an offset of 2^length - 1 makes every integer uniquely + ld d, [hl] ; representable in the length encoding and saves bits + push de + inc c + ld e, $0 + ld d, e +.readNumberOfZerosLoop ; reads the next c+1 bits of input + call ReadNextInputBit + or e + ld e, a + dec c + jr z, .readNumberOfZerosDone + sla e + rl d + jr .readNumberOfZerosLoop +.readNumberOfZerosDone + pop hl ; add the offset + add hl, de + ld e, l + ld d, h +.writeZerosLoop + ld b, e + xor a ; write 00 to buffer + call WriteSpriteBitsToBuffer + ld e, b + call MoveToNextBufferPosition + dec de + ld a, d + and a + jr nz, .continueLoop + ld a, e + and a +.continueLoop + jr nz, .writeZerosLoop + jr .readNextInput + +; moves output pointer to next position +; also cancels the calling function if the all output is done (by removing the return pointer from stack) +; and calls postprocessing functions according to the unpack mode +MoveToNextBufferPosition:: ; 25d8 (0:25d8) + ld a, [W_SPRITEHEIGHT] + ld b, a + ld a, [W_SPRITECURPOSY] + inc a + cp b + jr z, .curColumnDone + ld [W_SPRITECURPOSY], a + ld a, [W_SPRITEOUTPUTPTR] + inc a + ld [W_SPRITEOUTPUTPTR], a + ret nz + ld a, [W_SPRITEOUTPUTPTR+1] + inc a + ld [W_SPRITEOUTPUTPTR+1], a + ret +.curColumnDone + xor a + ld [W_SPRITECURPOSY], a + ld a, [W_SPRITEOUTPUTBITOFFSET] + and a + jr z, .bitOffsetsDone + dec a + ld [W_SPRITEOUTPUTBITOFFSET], a + ld hl, W_SPRITEOUTPUTPTRCACHED + ld a, [hli] + ld [W_SPRITEOUTPUTPTR], a + ld a, [hl] + ld [W_SPRITEOUTPUTPTR+1], a + ret +.bitOffsetsDone + ld a, $3 + ld [W_SPRITEOUTPUTBITOFFSET], a + ld a, [W_SPRITECURPOSX] + add $8 + ld [W_SPRITECURPOSX], a + ld b, a + ld a, [W_SPRITEWITDH] + cp b + jr z, .allColumnsDone + ld a, [W_SPRITEOUTPUTPTR] + ld l, a + ld a, [W_SPRITEOUTPUTPTR+1] + ld h, a + inc hl + jp StoreSpriteOutputPointer +.allColumnsDone + pop hl + xor a + ld [W_SPRITECURPOSX], a + ld a, [W_SPRITELOADFLAGS] ; wd0a8 + bit 1, a + jr nz, .done ; test if there is one more sprite to go + xor $1 + set 1, a + ld [W_SPRITELOADFLAGS], a ; wd0a8 + jp UncompressSpriteDataLoop +.done + jp UnpackSprite + +; writes 2 bits (from a) to the output buffer (pointed to from W_SPRITEOUTPUTPTR) +WriteSpriteBitsToBuffer:: ; 2649 (0:2649) + ld e, a + ld a, [W_SPRITEOUTPUTBITOFFSET] + and a + jr z, .offset0 + cp $2 + jr c, .offset1 + jr z, .offset2 + rrc e ; offset 3 + rrc e + jr .offset0 +.offset1 + sla e + sla e + jr .offset0 +.offset2 + swap e +.offset0 + ld a, [W_SPRITEOUTPUTPTR] + ld l, a + ld a, [W_SPRITEOUTPUTPTR+1] + ld h, a + ld a, [hl] + or e + ld [hl], a + ret + +; reads next bit from input stream and returns it in a +ReadNextInputBit:: ; 2670 (0:2670) + ld a, [W_SPRITEINPUTBITCOUNTER] + dec a + jr nz, .curByteHasMoreBitsToRead + call ReadNextInputByte + ld [W_SPRITEINPUTCURBYTE], a + ld a, $8 +.curByteHasMoreBitsToRead + ld [W_SPRITEINPUTBITCOUNTER], a + ld a, [W_SPRITEINPUTCURBYTE] + rlca + ld [W_SPRITEINPUTCURBYTE], a + and $1 + ret + +; reads next byte from input stream and returns it in a +ReadNextInputByte:: ; 268b (0:268b) + ld a, [W_SPRITEINPUTPTR] + ld l, a + ld a, [W_SPRITEINPUTPTR+1] + ld h, a + ld a, [hli] + ld b, a + ld a, l + ld [W_SPRITEINPUTPTR], a + ld a, h + ld [W_SPRITEINPUTPTR+1], a + ld a, b + ret + +; the nth item is 2^n - 1 +LengthEncodingOffsetList:: ; 269f (0:269f) + dw %0000000000000001 + dw %0000000000000011 + dw %0000000000000111 + dw %0000000000001111 + dw %0000000000011111 + dw %0000000000111111 + dw %0000000001111111 + dw %0000000011111111 + dw %0000000111111111 + dw %0000001111111111 + dw %0000011111111111 + dw %0000111111111111 + dw %0001111111111111 + dw %0011111111111111 + dw %0111111111111111 + dw %1111111111111111 + +; unpacks the sprite data depending on the unpack mode +UnpackSprite:: ; 26bf (0:26bf) + ld a, [W_SPRITEUNPACKMODE] + cp $2 + jp z, UnpackSpriteMode2 + and a + jp nz, XorSpriteChunks + ld hl, S_SPRITEBUFFER1 + call SpriteDifferentialDecode + ld hl, S_SPRITEBUFFER2 + ; fall through + +; decodes differential encoded sprite data +; input bit value 0 preserves the current bit value and input bit value 1 toggles it (starting from initial value 0). +SpriteDifferentialDecode:: ; 26d4 (0:26d4) + xor a + ld [W_SPRITECURPOSX], a + ld [W_SPRITECURPOSY], a + call StoreSpriteOutputPointer + ld a, [W_SPRITEFLIPPED] + and a + jr z, .notFlipped + ld hl, DecodeNybble0TableFlipped + ld de, DecodeNybble1TableFlipped + jr .storeDecodeTablesPointers +.notFlipped + ld hl, DecodeNybble0Table + ld de, DecodeNybble1Table +.storeDecodeTablesPointers + ld a, l + ld [W_SPRITEDECODETABLE0PTR], a + ld a, h + ld [W_SPRITEDECODETABLE0PTR+1], a + ld a, e + ld [W_SPRITEDECODETABLE1PTR], a + ld a, d + ld [W_SPRITEDECODETABLE1PTR+1], a + ld e, $0 ; last decoded nybble, initialized to 0 +.decodeNextByteLoop + ld a, [W_SPRITEOUTPUTPTR] + ld l, a + ld a, [W_SPRITEOUTPUTPTR+1] + ld h, a + ld a, [hl] + ld b, a + swap a + and $f + call DifferentialDecodeNybble ; decode high nybble + swap a + ld d, a + ld a, b + and $f + call DifferentialDecodeNybble ; decode low nybble + or d + ld b, a + ld a, [W_SPRITEOUTPUTPTR] + ld l, a + ld a, [W_SPRITEOUTPUTPTR+1] + ld h, a + ld a, b + ld [hl], a ; write back decoded data + ld a, [W_SPRITEHEIGHT] + add l ; move on to next column + jr nc, .noCarry + inc h +.noCarry + ld [W_SPRITEOUTPUTPTR], a + ld a, h + ld [W_SPRITEOUTPUTPTR+1], a + ld a, [W_SPRITECURPOSX] + add $8 + ld [W_SPRITECURPOSX], a + ld b, a + ld a, [W_SPRITEWITDH] + cp b + jr nz, .decodeNextByteLoop ; test if current row is done + xor a + ld e, a + ld [W_SPRITECURPOSX], a + ld a, [W_SPRITECURPOSY] ; move on to next row + inc a + ld [W_SPRITECURPOSY], a + ld b, a + ld a, [W_SPRITEHEIGHT] + cp b + jr z, .done ; test if all rows finished + ld a, [W_SPRITEOUTPUTPTRCACHED] + ld l, a + ld a, [W_SPRITEOUTPUTPTRCACHED+1] + ld h, a + inc hl + call StoreSpriteOutputPointer + jr .decodeNextByteLoop +.done + xor a + ld [W_SPRITECURPOSY], a + ret + +; decodes the nybble stored in a. Last decoded data is assumed to be in e (needed to determine if initial value is 0 or 1) +DifferentialDecodeNybble:: ; 276d (0:276d) + srl a ; c=a%2, a/=2 + ld c, $0 + jr nc, .evenNumber + ld c, $1 +.evenNumber + ld l, a + ld a, [W_SPRITEFLIPPED] + and a + jr z, .notFlipped ; determine if initial value is 0 or one + bit 3, e ; if flipped, consider MSB of last data + jr .selectLookupTable +.notFlipped + bit 0, e ; else consider LSB +.selectLookupTable + ld e, l + jr nz, .initialValue1 ; load the appropriate table + ld a, [W_SPRITEDECODETABLE0PTR] + ld l, a + ld a, [W_SPRITEDECODETABLE0PTR+1] + jr .tableLookup +.initialValue1 + ld a, [W_SPRITEDECODETABLE1PTR] + ld l, a + ld a, [W_SPRITEDECODETABLE1PTR+1] +.tableLookup + ld h, a + ld a, e + add l + ld l, a + jr nc, .noCarry + inc h +.noCarry + ld a, [hl] + bit 0, c + jr nz, .selectLowNybble + swap a ; select high nybble +.selectLowNybble + and $f + ld e, a ; update last decoded data + ret + +DecodeNybble0Table:: ; 27a7 (0:27a7) + dn $0, $1 + dn $3, $2 + dn $7, $6 + dn $4, $5 + dn $f, $e + dn $c, $d + dn $8, $9 + dn $b, $a +DecodeNybble1Table:: ; 27af (0:27af) + dn $f, $e + dn $c, $d + dn $8, $9 + dn $b, $a + dn $0, $1 + dn $3, $2 + dn $7, $6 + dn $4, $5 +DecodeNybble0TableFlipped:: ; 27b7 (0:27b7) + dn $0, $8 + dn $c, $4 + dn $e, $6 + dn $2, $a + dn $f, $7 + dn $3, $b + dn $1, $9 + dn $d, $5 +DecodeNybble1TableFlipped:: ; 27bf (0:27bf) + dn $f, $7 + dn $3, $b + dn $1, $9 + dn $d, $5 + dn $0, $8 + dn $c, $4 + dn $e, $6 + dn $2, $a + +; combines the two loaded chunks with xor (the chunk loaded second is the destination). The source chunk is differeintial decoded beforehand. +XorSpriteChunks:: ; 27c7 (0:27c7) + xor a + ld [W_SPRITECURPOSX], a + ld [W_SPRITECURPOSY], a + call ResetSpriteBufferPointers + ld a, [W_SPRITEOUTPUTPTR] ; points to buffer 1 or 2, depending on flags + ld l, a + ld a, [W_SPRITEOUTPUTPTR+1] + ld h, a + call SpriteDifferentialDecode ; decode buffer 1 or 2, depending on flags + call ResetSpriteBufferPointers + ld a, [W_SPRITEOUTPUTPTR] ; source buffer, points to buffer 1 or 2, depending on flags + ld l, a + ld a, [W_SPRITEOUTPUTPTR+1] + ld h, a + ld a, [W_SPRITEOUTPUTPTRCACHED] ; destination buffer, points to buffer 2 or 1, depending on flags + ld e, a + ld a, [W_SPRITEOUTPUTPTRCACHED+1] + ld d, a +.xorChunksLoop + ld a, [W_SPRITEFLIPPED] + and a + jr z, .notFlipped + push de + ld a, [de] + ld b, a + swap a + and $f + call ReverseNybble ; if flipped reverse the nybbles in the destination buffer + swap a + ld c, a + ld a, b + and $f + call ReverseNybble + or c + pop de + ld [de], a +.notFlipped + ld a, [hli] + ld b, a + ld a, [de] + xor b + ld [de], a + inc de + ld a, [W_SPRITECURPOSY] + inc a + ld [W_SPRITECURPOSY], a ; go to next row + ld b, a + ld a, [W_SPRITEHEIGHT] + cp b + jr nz, .xorChunksLoop ; test if column finished + xor a + ld [W_SPRITECURPOSY], a + ld a, [W_SPRITECURPOSX] + add $8 + ld [W_SPRITECURPOSX], a ; go to next column + ld b, a + ld a, [W_SPRITEWITDH] + cp b + jr nz, .xorChunksLoop ; test if all columns finished + xor a + ld [W_SPRITECURPOSX], a + ret + +; reverses the bits in the nybble given in register a +ReverseNybble:: ; 2837 (0:2837) + ld de, NybbleReverseTable + add e + ld e, a + jr nc, .asm_283f + inc d +.asm_283f + ld a, [de] + ret + +; resets sprite buffer pointers to buffer 1 and 2, depending on W_SPRITELOADFLAGS +ResetSpriteBufferPointers:: ; 2841 (0:2841) + ld a, [W_SPRITELOADFLAGS] ; wd0a8 + bit 0, a + jr nz, .buffer2Selected + ld de, S_SPRITEBUFFER1 + ld hl, S_SPRITEBUFFER2 + jr .storeBufferPointers +.buffer2Selected + ld de, S_SPRITEBUFFER2 + ld hl, S_SPRITEBUFFER1 +.storeBufferPointers + ld a, l + ld [W_SPRITEOUTPUTPTR], a + ld a, h + ld [W_SPRITEOUTPUTPTR+1], a + ld a, e + ld [W_SPRITEOUTPUTPTRCACHED], a + ld a, d + ld [W_SPRITEOUTPUTPTRCACHED+1], a + ret + +; maps each nybble to its reverse +NybbleReverseTable:: ; 2867 (0:2867) + db $0, $8, $4, $c, $2, $a, $6 ,$e, $1, $9, $5, $d, $3, $b, $7 ,$f + +; combines the two loaded chunks with xor (the chunk loaded second is the destination). Both chunks are differeintial decoded beforehand. +UnpackSpriteMode2:: ; 2877 (0:2877) + call ResetSpriteBufferPointers + ld a, [W_SPRITEFLIPPED] + push af + xor a + ld [W_SPRITEFLIPPED], a ; temporarily clear flipped flag for decoding the destination chunk + ld a, [W_SPRITEOUTPUTPTRCACHED] + ld l, a + ld a, [W_SPRITEOUTPUTPTRCACHED+1] + ld h, a + call SpriteDifferentialDecode + call ResetSpriteBufferPointers + pop af + ld [W_SPRITEFLIPPED], a + jp XorSpriteChunks + +; stores hl into the output pointers +StoreSpriteOutputPointer:: ; 2897 (0:2897) + ld a, l + ld [W_SPRITEOUTPUTPTR], a + ld [W_SPRITEOUTPUTPTRCACHED], a + ld a, h + ld [W_SPRITEOUTPUTPTR+1], a + ld [W_SPRITEOUTPUTPTRCACHED+1], a + ret diff --git a/home/predef.asm b/home/predef.asm new file mode 100644 index 00000000..1777d09f --- /dev/null +++ b/home/predef.asm @@ -0,0 +1,50 @@ +Predef:: +; Call predefined function a. +; To preserve other registers, have the +; destination call GetPredefRegisters. + + ; Save the predef id for GetPredefPointer. + ld [wPredefID], a + + ; A hack for LoadDestinationWarpPosition. + ; See Func_c754 (predef $19). + ld a, [H_LOADEDROMBANK] + ld [wPredefParentBank], a + + push af + ld a, BANK(GetPredefPointer) + ld [H_LOADEDROMBANK], a + ld [$2000], a + + call GetPredefPointer + + ld a, [wPredefBank] + ld [H_LOADEDROMBANK], a + ld [$2000], a + + ld de, .done + push de + jp [hl] +.done + + pop af + ld [H_LOADEDROMBANK], a + ld [$2000], a + ret + +GetPredefRegisters:: +; Restore the contents of register pairs +; when GetPredefPointer was called. + ld a, [wPredefRegisters + 0] + ld h, a + ld a, [wPredefRegisters + 1] + ld l, a + ld a, [wPredefRegisters + 2] + ld d, a + ld a, [wPredefRegisters + 3] + ld e, a + ld a, [wPredefRegisters + 4] + ld b, a + ld a, [wPredefRegisters + 5] + ld c, a + ret diff --git a/home/text.asm b/home/text.asm new file mode 100644 index 00000000..abcac9fd --- /dev/null +++ b/home/text.asm @@ -0,0 +1,718 @@ +TextBoxBorder:: +; Draw a cxb text box at hl. + + ; top row + push hl + ld a, "┌" + ld [hli], a + inc a ; ─ + call NPlaceChar + inc a ; ┐ + ld [hl], a + pop hl + + ld de, 20 + add hl, de + + ; middle rows +.next + push hl + ld a, "│" + ld [hli],a + ld a, " " + call NPlaceChar + ld [hl], "│" + pop hl + + ld de, 20 + add hl, de + dec b + jr nz, .next + + ; bottom row + ld a, "└" + ld [hli], a + ld a, "─" + call NPlaceChar + ld [hl], "┘" + ret + +NPlaceChar:: +; Place char a c times. + ld d, c +.loop + ld [hli], a + dec d + jr nz, .loop + ret + +PlaceString:: ; 1955 (0:1955) + push hl +PlaceNextChar:: ; 1956 (0:1956) + ld a,[de] + + cp "@" + jr nz,.PlaceText + ld b,h + ld c,l + pop hl + ret + +.PlaceText + cp $4E + jr nz,.next + ld bc,$0028 + ld a,[$FFF6] + bit 2,a + jr z,.next2 + ld bc,$14 +.next2 + pop hl + add hl,bc + push hl + jp Next19E8 + +.next + cp $4F + jr nz,.next3 + pop hl + hlCoord 1, 16 + push hl + jp Next19E8 + +.next3 ; Check against a dictionary + and a + jp z,Char00 + cp $4C + jp z,Char4C + cp $4B + jp z,Char4B + cp $51 + jp z,Char51 + cp $49 + jp z,Char49 + cp $52 + jp z,Char52 + cp $53 + jp z,Char53 + cp $54 + jp z,Char54 + cp $5B + jp z,Char5B + cp $5E + jp z,Char5E + cp $5C + jp z,Char5C + cp $5D + jp z,Char5D + cp $55 + jp z,Char55 + cp $56 + jp z,Char56 + cp $57 + jp z,Char57 + cp $58 + jp z,Char58 + cp $4A + jp z,Char4A + cp $5F + jp z,Char5F + cp $59 + jp z,Char59 + cp $5A + jp z,Char5A + ld [hli],a + call PrintLetterDelay +Next19E8:: ; 19e8 (0:19e8) + inc de + jp PlaceNextChar + +Char00:: ; 19ec (0:19ec) + ld b,h + ld c,l + pop hl + ld de,Char00Text + dec de + ret + +Char00Text:: ; 0x19f4 “%d ERROR.” + TX_FAR _Char00Text + db "@" + +Char52:: ; 0x19f9 player’s name + push de + ld de,wPlayerName + jr FinishDTE + +Char53:: ; 19ff (0:19ff) ; rival’s name + push de + ld de,W_RIVALNAME + jr FinishDTE + +Char5D:: ; 1a05 (0:1a05) ; TRAINER + push de + ld de,Char5DText + jr FinishDTE + +Char5C:: ; 1a0b (0:1a0b) ; TM + push de + ld de,Char5CText + jr FinishDTE + +Char5B:: ; 1a11 (0:1a11) ; PC + push de + ld de,Char5BText + jr FinishDTE + +Char5E:: ; 1a17 (0:1a17) ; ROCKET + push de + ld de,Char5EText + jr FinishDTE + +Char54:: ; 1a1d (0:1a1d) ; POKé + push de + ld de,Char54Text + jr FinishDTE + +Char56:: ; 1a23 (0:1a23) ; …… + push de + ld de,Char56Text + jr FinishDTE + +Char4A:: ; 1a29 (0:1a29) ; PKMN + push de + ld de,Char4AText + jr FinishDTE + +Char59:: ; 1a2f (0:1a2f) +; depending on whose turn it is, print +; enemy active monster’s name, prefixed with “Enemy ” +; or +; player active monster’s name +; (like Char5A but flipped) + ld a,[H_WHOSETURN] + xor 1 + jr MonsterNameCharsCommon + +Char5A:: ; 1a35 (0:1a35) +; depending on whose turn it is, print +; player active monster’s name +; or +; enemy active monster’s name, prefixed with “Enemy ” + ld a,[H_WHOSETURN] +MonsterNameCharsCommon:: ; 1a37 (0:1a37) + push de + and a + jr nz,.Enemy + ld de,wBattleMonNick ; player active monster name + jr FinishDTE + +.Enemy ; 1A40 + ; print “Enemy ” + ld de,Char5AText + call PlaceString + + ld h,b + ld l,c + ld de,wEnemyMonNick ; enemy active monster name + +FinishDTE:: ; 1a4b (0:1a4b) + call PlaceString + ld h,b + ld l,c + pop de + inc de + jp PlaceNextChar + +Char5CText:: ; 1a55 (0:1a55) + db "TM@" +Char5DText:: ; 1a58 (0:1a58) + db "TRAINER@" +Char5BText:: ; 1a60 (0:1a60) + db "PC@" +Char5EText:: ; 1a63 (0:1a63) + db "ROCKET@" +Char54Text:: ; 1a6a (0:1a6a) + db "POKé@" +Char56Text:: ; 1a6f (0:1a6f) + db "……@" +Char5AText:: ; 1a72 (0:1a72) + db "Enemy @" +Char4AText:: ; 1a79 (0:1a79) + db $E1,$E2,"@" ; PKMN + +Char55:: ; 1a7c (0:1a7c) + push de + ld b,h + ld c,l + ld hl,Char55Text + call TextCommandProcessor + ld h,b + ld l,c + pop de + inc de + jp PlaceNextChar + +Char55Text:: ; 1a8c (0:1a8c) +; equivalent to Char4B + TX_FAR _Char55Text + db "@" + +Char5F:: ; 1a91 (0:1a91) +; ends a Pokédex entry + ld [hl],"." + pop hl + ret + +Char58:: ; 1a95 (0:1a95) + ld a,[W_ISLINKBATTLE] + cp 4 + jp z,Next1AA2 + ld a,$EE + Coorda 18, 16 +Next1AA2:: ; 1aa2 (0:1aa2) + call ProtectedDelay3 + call ManualTextScroll + ld a,$7F + Coorda 18, 16 +Char57:: ; 1aad (0:1aad) + pop hl + ld de,Char58Text + dec de + ret + +Char58Text:: ; 1ab3 (0:1ab3) + db "@" + +Char51:: ; 1ab4 (0:1ab4) + push de + ld a,$EE + Coorda 18, 16 + call ProtectedDelay3 + call ManualTextScroll + hlCoord 1, 13 + ld bc,$0412 + call ClearScreenArea + ld c,$14 + call DelayFrames + pop de + hlCoord 1, 14 + jp Next19E8 + +Char49:: ; 1ad5 (0:1ad5) + push de + ld a,$EE + Coorda 18, 16 + call ProtectedDelay3 + call ManualTextScroll + hlCoord 1, 10 + ld bc,$0712 + call ClearScreenArea + ld c,$14 + call DelayFrames + pop de + pop hl + hlCoord 1, 11 + push hl + jp Next19E8 + +Char4B:: ; 1af8 (0:1af8) + ld a,$EE + Coorda 18, 16 + call ProtectedDelay3 + push de + call ManualTextScroll + pop de + ld a,$7F + Coorda 18, 16 + ;fall through +Char4C:: ; 1b0a (0:1b0a) + push de + call Next1B18 + call Next1B18 + hlCoord 1, 16 + pop de + jp Next19E8 + +Next1B18:: ; 1b18 (0:1b18) + hlCoord 0, 14 + deCoord 0, 13 + ld b,$3C +.next + ld a,[hli] + ld [de],a + inc de + dec b + jr nz,.next + hlCoord 1, 16 + ld a,$7F + ld b,$12 +.next2 + ld [hli],a + dec b + jr nz,.next2 + + ; wait five frames + ld b,5 +.WaitFrame + call DelayFrame + dec b + jr nz,.WaitFrame + + ret + +ProtectedDelay3:: ; 1b3a (0:1b3a) + push bc + call Delay3 + pop bc + ret + +TextCommandProcessor:: ; 1b40 (0:1b40) + ld a,[wd358] + push af + set 1,a + ld e,a + ld a,[$fff4] + xor e + ld [wd358],a + ld a,c + ld [wcc3a],a + ld a,b + ld [wcc3b],a + +NextTextCommand:: ; 1b55 (0:1b55) + ld a,[hli] + cp a, "@" ; terminator + jr nz,.doTextCommand + pop af + ld [wd358],a + ret +.doTextCommand + push hl + cp a,$17 + jp z,TextCommand17 + cp a,$0e + jp nc,TextCommand0B ; if a != 0x17 and a >= 0xE, go to command 0xB +; if a < 0xE, use a jump table + ld hl,TextCommandJumpTable + push bc + add a + ld b,$00 + ld c,a + add hl,bc + pop bc + ld a,[hli] + ld h,[hl] + ld l,a + jp [hl] + +; draw box +; 04AAAABBCC +; AAAA = address of upper left corner +; BB = height +; CC = width +TextCommand04:: ; 1b78 (0:1b78) + pop hl + ld a,[hli] + ld e,a + ld a,[hli] + ld d,a + ld a,[hli] + ld b,a + ld a,[hli] + ld c,a + push hl + ld h,d + ld l,e + call TextBoxBorder + pop hl + jr NextTextCommand + +; place string inline +; 00{string} +TextCommand00:: ; 1b8a (0:1b8a) + pop hl + ld d,h + ld e,l + ld h,b + ld l,c + call PlaceString + ld h,d + ld l,e + inc hl + jr NextTextCommand + +; place string from RAM +; 01AAAA +; AAAA = address of string +TextCommand01:: ; 1b97 (0:1b97) + pop hl + ld a,[hli] + ld e,a + ld a,[hli] + ld d,a + push hl + ld h,b + ld l,c + call PlaceString + pop hl + jr NextTextCommand + +; print BCD number +; 02AAAABB +; AAAA = address of BCD number +; BB +; bits 0-4 = length in bytes +; bits 5-7 = unknown flags +TextCommand02:: ; 1ba5 (0:1ba5) + pop hl + ld a,[hli] + ld e,a + ld a,[hli] + ld d,a + ld a,[hli] + push hl + ld h,b + ld l,c + ld c,a + call PrintBCDNumber + ld b,h + ld c,l + pop hl + jr NextTextCommand + +; repoint destination address +; 03AAAA +; AAAA = new destination address +TextCommand03:: ; 1bb7 (0:1bb7) + pop hl + ld a,[hli] + ld [wcc3a],a + ld c,a + ld a,[hli] + ld [wcc3b],a + ld b,a + jp NextTextCommand + +; repoint destination to second line of dialogue text box +; 05 +; (no arguments) +TextCommand05:: ; 1bc5 (0:1bc5) + pop hl + bcCoord 1, 16 ; address of second line of dialogue text box + jp NextTextCommand + +; blink arrow and wait for A or B to be pressed +; 06 +; (no arguments) +TextCommand06:: ; 1bcc (0:1bcc) + ld a,[W_ISLINKBATTLE] + cp a,$04 + jp z,TextCommand0D + ld a,$ee ; down arrow + Coorda 18, 16 ; place down arrow in lower right corner of dialogue text box + push bc + call ManualTextScroll ; blink arrow and wait for A or B to be pressed + pop bc + ld a," " + Coorda 18, 16 ; overwrite down arrow with blank space + pop hl + jp NextTextCommand + +; scroll text up one line +; 07 +; (no arguments) +TextCommand07:: ; 1be7 (0:1be7) + ld a," " + Coorda 18, 16 ; place blank space in lower right corner of dialogue text box + call Next1B18 ; scroll up text + call Next1B18 + pop hl + bcCoord 1, 16 ; address of second line of dialogue text box + jp NextTextCommand + +; execute asm inline +; 08{code} +TextCommand08:: ; 1bf9 (0:1bf9) + pop hl + ld de,NextTextCommand + push de ; return address + jp [hl] + +; print decimal number (converted from binary number) +; 09AAAABB +; AAAA = address of number +; BB +; bits 0-3 = how many digits to display +; bits 4-7 = how long the number is in bytes +TextCommand09:: ; 1bff (0:1bff) + pop hl + ld a,[hli] + ld e,a + ld a,[hli] + ld d,a + ld a,[hli] + push hl + ld h,b + ld l,c + ld b,a + and a,$0f + ld c,a + ld a,b + and a,$f0 + swap a + set 6,a + ld b,a + call PrintNumber + ld b,h + ld c,l + pop hl + jp NextTextCommand + +; wait half a second if the user doesn't hold A or B +; 0A +; (no arguments) +TextCommand0A:: ; 1c1d (0:1c1d) + push bc + call Joypad + ld a,[hJoyHeld] + and a,%00000011 ; A and B buttons + jr nz,.skipDelay + ld c,30 + call DelayFrames +.skipDelay + pop bc + pop hl + jp NextTextCommand + +; plays sounds +; this actually handles various command ID's, not just 0B +; (no arguments) +TextCommand0B:: ; 1c31 (0:1c31) + pop hl + push bc + dec hl + ld a,[hli] + ld b,a ; b = command number that got us here + push hl + ld hl,TextCommandSounds +.loop + ld a,[hli] + cp b + jr z,.matchFound + inc hl + jr .loop +.matchFound + cp a,$14 + jr z,.pokemonCry + cp a,$15 + jr z,.pokemonCry + cp a,$16 + jr z,.pokemonCry + ld a,[hl] + call PlaySound + call WaitForSoundToFinish + pop hl + pop bc + jp NextTextCommand +.pokemonCry + push de + ld a,[hl] + call PlayCry + pop de + pop hl + pop bc + jp NextTextCommand + +; format: text command ID, sound ID or cry ID +TextCommandSounds:: ; 1c64 (0:1c64) + db $0B,(SFX_02_3a - SFX_Headers_02) / 3 + db $12,(SFX_02_46 - SFX_Headers_02) / 3 + db $0E,(SFX_02_41 - SFX_Headers_02) / 3 + db $0F,(SFX_02_3a - SFX_Headers_02) / 3 + db $10,(SFX_02_3b - SFX_Headers_02) / 3 + db $11,(SFX_02_42 - SFX_Headers_02) / 3 + db $13,(SFX_02_44 - SFX_Headers_02) / 3 + db $14,NIDORINA ; used in OakSpeech + db $15,PIDGEOT ; used in SaffronCityText12 + db $16,DEWGONG ; unused? + +; draw ellipses +; 0CAA +; AA = number of ellipses to draw +TextCommand0C:: ; 1c78 (0:1c78) + pop hl + ld a,[hli] + ld d,a + push hl + ld h,b + ld l,c +.loop + ld a,$75 ; ellipsis + ld [hli],a + push de + call Joypad + pop de + ld a,[hJoyHeld] ; joypad state + and a,%00000011 ; is A or B button pressed? + jr nz,.skipDelay ; if so, skip the delay + ld c,10 + call DelayFrames +.skipDelay + dec d + jr nz,.loop + ld b,h + ld c,l + pop hl + jp NextTextCommand + +; wait for A or B to be pressed +; 0D +; (no arguments) +TextCommand0D:: ; 1c9a (0:1c9a) + push bc + call ManualTextScroll ; wait for A or B to be pressed + pop bc + pop hl + jp NextTextCommand + +; process text commands in another ROM bank +; 17AAAABB +; AAAA = address of text commands +; BB = bank +TextCommand17:: ; 1ca3 (0:1ca3) + pop hl + ld a,[H_LOADEDROMBANK] + push af + ld a,[hli] + ld e,a + ld a,[hli] + ld d,a + ld a,[hli] + ld [H_LOADEDROMBANK],a + ld [$2000],a + push hl + ld l,e + ld h,d + call TextCommandProcessor + pop hl + pop af + ld [H_LOADEDROMBANK],a + ld [$2000],a + jp NextTextCommand + +TextCommandJumpTable:: ; 1cc1 (0:1cc1) + dw TextCommand00 + dw TextCommand01 + dw TextCommand02 + dw TextCommand03 + dw TextCommand04 + dw TextCommand05 + dw TextCommand06 + dw TextCommand07 + dw TextCommand08 + dw TextCommand09 + dw TextCommand0A + dw TextCommand0B + dw TextCommand0C + dw TextCommand0D diff --git a/home/vblank.asm b/home/vblank.asm new file mode 100644 index 00000000..15f91437 --- /dev/null +++ b/home/vblank.asm @@ -0,0 +1,105 @@ +VBlank:: + + push af + push bc + push de + push hl + + ld a, [H_LOADEDROMBANK] + ld [wd122], a + + ld a, [$ffae] + ld [rSCX], a + ld a, [$ffaf] + ld [rSCY], a + + ld a, [wd0a0] + and a + jr nz, .ok + ld a, [$ffb0] + ld [rWY], a +.ok + + call AutoBgMapTransfer + call VBlankCopyBgMap + call RedrawExposedScreenEdge + call VBlankCopy + call VBlankCopyDouble + call UpdateMovingBgTiles + call $ff80 ; hOAMDMA + ld a, Bank(PrepareOAMData) + ld [H_LOADEDROMBANK], a + ld [MBC3RomBank], a + call PrepareOAMData + + ; VBlank-sensitive operations end. + + call Random + + ld a, [H_VBLANKOCCURRED] + and a + jr z, .vblanked + xor a + ld [H_VBLANKOCCURRED], a +.vblanked + + ld a, [H_FRAMECOUNTER] + and a + jr z, .decced + dec a + ld [H_FRAMECOUNTER], a +.decced + + call Func_28cb + + ld a, [wc0ef] ; music ROM bank + ld [H_LOADEDROMBANK], a + ld [MBC3RomBank], a + + cp BANK(Music2_UpdateMusic) + jr nz, .notbank2 +.bank2 + call Music2_UpdateMusic + jr .afterMusic +.notbank2 + cp BANK(Music8_UpdateMusic) + jr nz, .bank1F +.bank8 + call Func_2136e + call Music8_UpdateMusic + jr .afterMusic +.bank1F + call Music1f_UpdateMusic +.afterMusic + + callba Func_18dee ; keep track of time played + + ld a, [$fff9] + and a + call z, ReadJoypad + + ld a, [wd122] + ld [H_LOADEDROMBANK], a + ld [MBC3RomBank], a + + pop hl + pop de + pop bc + pop af + reti + + +DelayFrame:: +; Wait for the next vblank interrupt. +; As a bonus, this saves battery. + +NOT_VBLANKED EQU 1 + + ld a, NOT_VBLANKED + ld [H_VBLANKOCCURRED], a +.halt + halt + ld a, [H_VBLANKOCCURRED] + and a + jr nz, .halt + ret diff --git a/home/vcopy.asm b/home/vcopy.asm new file mode 100644 index 00000000..81fcb991 --- /dev/null +++ b/home/vcopy.asm @@ -0,0 +1,447 @@ +; this function seems to be used only once +; it store the address of a row and column of the VRAM background map in hl +; INPUT: h - row, l - column, b - high byte of background tile map address in VRAM +GetRowColAddressBgMap:: ; 1cdd (0:1cdd) + xor a + srl h + rr a + srl h + rr a + srl h + rr a + or l + ld l,a + ld a,b + or h + ld h,a + ret + +; clears a VRAM background map with blank space tiles +; INPUT: h - high byte of background tile map address in VRAM +ClearBgMap:: ; 1cf0 (0:1cf0) + ld a," " + jr .next + ld a,l +.next + ld de,$400 ; size of VRAM background map + ld l,e +.loop + ld [hli],a + dec e + jr nz,.loop + dec d + jr nz,.loop + ret + +; When the player takes a step, a row or column of 2x2 tile blocks at the edge +; of the screen toward which they moved is exposed and has to be redrawn. +; This function does the redrawing. +RedrawExposedScreenEdge:: ; 1d01 (0:1d01) + ld a,[H_SCREENEDGEREDRAW] + and a + ret z + ld b,a + xor a + ld [H_SCREENEDGEREDRAW],a + dec b + jr nz,.redrawRow +.redrawColumn + ld hl,wScreenEdgeTiles + ld a,[H_SCREENEDGEREDRAWADDR] + ld e,a + ld a,[H_SCREENEDGEREDRAWADDR + 1] + ld d,a + ld c,18 ; screen height +.loop1 + ld a,[hli] + ld [de],a + inc de + ld a,[hli] + ld [de],a + ld a,31 + add e + ld e,a + jr nc,.noCarry + inc d +.noCarry +; the following 4 lines wrap us from bottom to top if necessary + ld a,d + and a,$03 + or a,$98 + ld d,a + dec c + jr nz,.loop1 + xor a + ld [H_SCREENEDGEREDRAW],a + ret +.redrawRow + ld hl,wScreenEdgeTiles + ld a,[H_SCREENEDGEREDRAWADDR] + ld e,a + ld a,[H_SCREENEDGEREDRAWADDR + 1] + ld d,a + push de + call .drawHalf ; draw upper half + pop de + ld a,32 ; width of VRAM background map + add e + ld e,a + ; draw lower half +.drawHalf + ld c,10 +.loop2 + ld a,[hli] + ld [de],a + inc de + ld a,[hli] + ld [de],a + ld a,e + inc a +; the following 6 lines wrap us from the right edge to the left edge if necessary + and a,$1f + ld b,a + ld a,e + and a,$e0 + or b + ld e,a + dec c + jr nz,.loop2 + ret + +; This function automatically transfers tile number data from the tile map at +; wTileMap to VRAM during V-blank. Note that it only transfers one third of the +; background per V-blank. It cycles through which third it draws. +; This transfer is turned off when walking around the map, but is turned +; on when talking to sprites, battling, using menus, etc. This is because +; the above function, RedrawExposedScreenEdge, is used when walking to +; improve efficiency. +AutoBgMapTransfer:: ; 1d57 (0:1d57) + ld a,[H_AUTOBGTRANSFERENABLED] + and a + ret z + ld hl,[sp + 0] + ld a,h + ld [H_SPTEMP],a + ld a,l + ld [H_SPTEMP + 1],a ; save stack pinter + ld a,[H_AUTOBGTRANSFERPORTION] + and a + jr z,.transferTopThird + dec a + jr z,.transferMiddleThird +.transferBottomThird + hlCoord 0, 12 + ld sp,hl + ld a,[H_AUTOBGTRANSFERDEST + 1] + ld h,a + ld a,[H_AUTOBGTRANSFERDEST] + ld l,a + ld de,(12 * 32) + add hl,de + xor a ; TRANSFERTOP + jr .doTransfer +.transferTopThird + hlCoord 0, 0 + ld sp,hl + ld a,[H_AUTOBGTRANSFERDEST + 1] + ld h,a + ld a,[H_AUTOBGTRANSFERDEST] + ld l,a + ld a,TRANSFERMIDDLE + jr .doTransfer +.transferMiddleThird + hlCoord 0, 6 + ld sp,hl + ld a,[H_AUTOBGTRANSFERDEST + 1] + ld h,a + ld a,[H_AUTOBGTRANSFERDEST] + ld l,a + ld de,(6 * 32) + add hl,de + ld a,TRANSFERBOTTOM +.doTransfer + ld [H_AUTOBGTRANSFERPORTION],a ; store next portion + ld b,6 + +TransferBgRows:: ; 1d9e (0:1d9e) +; unrolled loop and using pop for speed + + rept 20 / 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 + + ld a, 32 - (20 - 1) + add l + ld l, a + jr nc, .ok + inc h +.ok + dec b + jr nz, TransferBgRows + + ld a, [H_SPTEMP] + ld h, a + ld a, [H_SPTEMP + 1] + ld l, a + ld sp, hl + ret + +; Copies [H_VBCOPYBGNUMROWS] rows from H_VBCOPYBGSRC to H_VBCOPYBGDEST. +; If H_VBCOPYBGSRC is XX00, the transfer is disabled. +VBlankCopyBgMap:: ; 1de1 (0:1de1) + ld a,[H_VBCOPYBGSRC] ; doubles as enabling byte + and a + ret z + ld hl,[sp + 0] + ld a,h + ld [H_SPTEMP],a + ld a,l + ld [H_SPTEMP + 1],a ; save stack pointer + ld a,[H_VBCOPYBGSRC] + ld l,a + ld a,[H_VBCOPYBGSRC + 1] + ld h,a + ld sp,hl + ld a,[H_VBCOPYBGDEST] + ld l,a + ld a,[H_VBCOPYBGDEST + 1] + ld h,a + ld a,[H_VBCOPYBGNUMROWS] + ld b,a + xor a + ld [H_VBCOPYBGSRC],a ; disable transfer so it doesn't continue next V-blank + jr TransferBgRows + + +VBlankCopyDouble:: +; Copy [H_VBCOPYDOUBLESIZE] 1bpp tiles +; from H_VBCOPYDOUBLESRC to H_VBCOPYDOUBLEDEST. + +; While we're here, convert to 2bpp. +; The process is straightforward: +; copy each byte twice. + + ld a, [H_VBCOPYDOUBLESIZE] + and a + ret z + + ld hl, [sp + 0] + ld a, h + ld [H_SPTEMP], a + ld a, l + ld [H_SPTEMP + 1], a + + ld a, [H_VBCOPYDOUBLESRC] + ld l, a + ld a, [H_VBCOPYDOUBLESRC + 1] + ld h, a + ld sp, hl + + ld a, [H_VBCOPYDOUBLEDEST] + ld l, a + ld a, [H_VBCOPYDOUBLEDEST + 1] + ld h, a + + ld a, [H_VBCOPYDOUBLESIZE] + ld b, a + xor a ; transferred + ld [H_VBCOPYDOUBLESIZE], a + +.loop + 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, .loop + + ld a, l + ld [H_VBCOPYDOUBLEDEST], a + ld a, h + ld [H_VBCOPYDOUBLEDEST + 1], a + + ld hl, [sp + 0] + ld a, l + ld [H_VBCOPYDOUBLESRC], a + ld a, h + ld [H_VBCOPYDOUBLESRC + 1], a + + ld a, [H_SPTEMP] + ld h, a + ld a, [H_SPTEMP + 1] + ld l, a + ld sp, hl + + ret + + +VBlankCopy:: +; Copy [H_VBCOPYSIZE] 2bpp tiles +; from H_VBCOPYSRC to H_VBCOPYDEST. + +; Source and destination addresses +; are updated, so transfer can +; continue in subsequent calls. + + ld a, [H_VBCOPYSIZE] + and a + ret z + + ld hl, [sp + 0] + ld a, h + ld [H_SPTEMP], a + ld a, l + ld [H_SPTEMP + 1], a + + ld a, [H_VBCOPYSRC] + ld l, a + ld a, [H_VBCOPYSRC + 1] + ld h, a + ld sp, hl + + ld a, [H_VBCOPYDEST] + ld l, a + ld a, [H_VBCOPYDEST + 1] + ld h, a + + ld a, [H_VBCOPYSIZE] + ld b, a + xor a ; transferred + ld [H_VBCOPYSIZE], a + +.loop + 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, .loop + + ld a, l + ld [H_VBCOPYDEST], a + ld a, h + ld [H_VBCOPYDEST + 1], a + + ld hl, [sp + 0] + ld a, l + ld [H_VBCOPYSRC], a + ld a, h + ld [H_VBCOPYSRC + 1], a + + ld a, [H_SPTEMP] + ld h, a + ld a, [H_SPTEMP + 1] + ld l, a + ld sp, hl + + ret + + +UpdateMovingBgTiles:: +; Animate water and flower +; tiles in the overworld. + + ld a, [$ffd7] + and a + ret z + + ld a, [$ffd8] + inc a + ld [$ffd8], a + cp $14 + ret c + cp $15 + jr z, .flower + + ld hl, vTileset + $14 * $10 + ld c, $10 + + ld a, [wd085] + inc a + and 7 + ld [wd085], a + + and 4 + jr nz, .left +.right + ld a, [hl] + rrca + ld [hli], a + dec c + jr nz, .right + jr .done +.left + ld a, [hl] + rlca + ld [hli], a + dec c + jr nz, .left +.done + ld a, [$ffd7] + rrca + ret nc + xor a + ld [$ffd8], a + ret + +.flower + xor a + ld [$ffd8], a + + ld a, [wd085] + and 3 + cp 2 + ld hl, FlowerTile1 + jr c, .copy + ld hl, FlowerTile2 + jr z, .copy + ld hl, FlowerTile3 +.copy + ld de, vTileset + $3 * $10 + ld c, $10 +.loop + ld a, [hli] + ld [de], a + inc de + dec c + jr nz, .loop + ret + +FlowerTile1: INCBIN "gfx/tilesets/flower/flower1.2bpp" +FlowerTile2: INCBIN "gfx/tilesets/flower/flower2.2bpp" +FlowerTile3: INCBIN "gfx/tilesets/flower/flower3.2bpp" @@ -4,7 +4,11 @@ H_SPRITEINTERLACECOUNTER EQU $FF8B H_SPRITEHEIGHT EQU $FF8C ; in bytes H_SPRITEOFFSET EQU $FF8D -H_SOFTRESETCOUNTER EQU $FF8A ; initialized to 16, decremented each input iteration if the user presses the reset sequence (A+B+S+s). Soft reset when 0 is reached. +hSoftReset EQU $FF8A +; Initialized to 16. +; Decremented each input iteration if the player +; presses the reset sequence (A+B+SEL+START). +; Soft reset when 0 is reached. ; counters for blinking down arrow H_DOWNARROWBLINKCNT1 EQU $FF8B @@ -28,10 +32,10 @@ H_NUMTOPRINT EQU $FF96 ; 3 bytes, big endian order H_POWEROFTEN EQU $FF99 ; 3 bytes, big endian order H_SAVEDNUMTOPRINT EQU $FF9C ; 3 bytes, big endian order (to back out of a subtraction) -H_OLDPRESSEDBUTTONS EQU $FFB1 -H_NEWLYRELEASEDBUTTONS EQU $FFB2 -H_NEWLYPRESSEDBUTTONS EQU $FFB3 -H_CURRENTPRESSEDBUTTONS EQU $FFB4 +hJoyHeldLast EQU $FFB1 +hJoyReleased EQU $FFB2 +hJoyPressed EQU $FFB3 +hJoyHeld EQU $FFB4 H_LOADEDROMBANK EQU $FFB8 @@ -98,8 +102,8 @@ REDRAWROW EQU 2 H_SCREENEDGEREDRAWADDR EQU $FFD1 -H_RAND1 EQU $FFD3 -H_RAND2 EQU $FFD4 +hRandomAdd EQU $FFD3 +hRandomSub EQU $FFD4 H_FRAMECOUNTER EQU $FFD5 ; decremented every V-blank (used for delays) @@ -112,5 +116,5 @@ H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10 H_WHOSETURN EQU $FFF3 ; 0 on player’s turn, 1 on enemy’s turn -H_JOYPADSTATE EQU $FFF8 +hJoyInput EQU $FFF8 @@ -11,6 +11,18 @@ page EQUS "db $49," ; Start a new Pokedex page. dex EQUS "db $5f, $50" ; End a Pokedex entry. +homecall: MACRO + ld a, [H_LOADEDROMBANK] + push af + ld a, BANK(\1) + ld [H_LOADEDROMBANK], a + ld [MBC3RomBank], a + call \1 + pop af + ld [H_LOADEDROMBANK], a + ld [MBC3RomBank], a + ENDM + callba: MACRO ld b, BANK(\1) ld hl, \1 @@ -25,15 +37,45 @@ callab: MACRO ;\1 = X ;\2 = Y -FuncCoord: MACRO -Coord = $C3A0 + 20 * \2 + \1 +hlCoord: MACRO + ld hl, wTileMap + 20 * \2 + \1 + ENDM + +;\1 = X +;\2 = Y +deCoord: MACRO + ld de, wTileMap + 20 * \2 + \1 + ENDM + +;\1 = X +;\2 = Y +bcCoord: MACRO + ld bc, wTileMap + 20 * \2 + \1 + ENDM + +;\1 = X +;\2 = Y +aCoord: MACRO + ld a, [wTileMap + 20 * \2 + \1] + ENDM + +;\1 = X +;\2 = Y +Coorda: MACRO + ld [wTileMap + 20 * \2 + \1], a + ENDM + +;\1 = X +;\2 = Y +dwCoord: MACRO + dw wTileMap + 20 * \2 + \1 ENDM ;\1 = Map Width ;\2 = Rows above (Y-blocks) ;\3 = X movement (X-blocks) EVENT_DISP: MACRO - dw ($C6EF + (\1) + ((\1) + 6) * ((\2) >> 1) + ((\3) >> 1)) ; Ev.Disp + dw (wOverworldMap + 7 + (\1) + ((\1) + 6) * ((\2) >> 1) + ((\3) >> 1)) ; Ev.Disp db \2,\3 ;Y,X ENDM @@ -77,7 +119,7 @@ tileset: MACRO INDOOR EQU 0 CAVE EQU 1 OUTDOOR EQU 2 - + ; macro for two nibbles dn: MACRO db (\1 << 4 | \2) @@ -119,14 +161,30 @@ TX_RAM: MACRO dw \1 ENDM +TX_BCD: MACRO + db $2 + dw \1 + db \2 + ENDM + ; Predef macro. -PREDEF: MACRO - ld a, (\1 - PredefPointers) / 3 +add_predef: MACRO +\1Predef:: + db BANK(\1) + dw \1 + ENDM + +predef_id: MACRO + ld a, (\1Predef - PredefPointers) / 3 + ENDM + +predef: MACRO + predef_id \1 call Predef ENDM - -PREDEF_JUMP: MACRO - ld a, (\1 - PredefPointers) / 3 + +predef_jump: MACRO + predef_id \1 jp Predef ENDM @@ -146,41 +204,6 @@ CH5 EQU 5 CH6 EQU 6 CH7 EQU 7 -;Note Pitch -C_ EQU $0 -C# EQU $1 -D_ EQU $2 -D# EQU $3 -E_ EQU $4 -F_ EQU $5 -F# EQU $6 -G_ EQU $7 -G# EQU $8 -A_ EQU $9 -A# EQU $A -B_ EQU $B - -;drum instruments -snare1 EQU $01 -snare2 EQU $02 -snare3 EQU $03 -snare4 EQU $04 -snare5 EQU $05 -triangle1 EQU $06 -triangle2 EQU $07 -snare6 EQU $08 -snare7 EQU $09 -snare8 EQU $0a -snare9 EQU $0b -cymbal1 EQU $0c -cymbal2 EQU $0d -cymbal3 EQU $0e -mutedsnare1 EQU $0f -triangle3 EQU $10 -mutedsnare2 EQU $11 -mutedsnare3 EQU $12 -mutedsnare4 EQU $13 - unknownsfx0x10: MACRO db $10 db \1 @@ -199,15 +222,149 @@ unknownnoise0x20: MACRO db \3 ENDM -;format: note pitch, length (in 16ths) -note: MACRO - db (\1 << 4) | (\2 - 1) +;format: pitch length (in 16ths) +C_: MACRO + db $00 | (\1 - 1) +ENDM + +C#: MACRO + db $10 | (\1 - 1) +ENDM + +D_: MACRO + db $20 | (\1 - 1) +ENDM + +D#: MACRO + db $30 | (\1 - 1) +ENDM + +E_: MACRO + db $40 | (\1 - 1) +ENDM + +F_: MACRO + db $50 | (\1 - 1) +ENDM + +F#: MACRO + db $60 | (\1 - 1) +ENDM + +G_: MACRO + db $70 | (\1 - 1) +ENDM + +G#: MACRO + db $80 | (\1 - 1) +ENDM + +A_: MACRO + db $90 | (\1 - 1) ENDM -;format: dnote length (in 16ths), instrument -dnote: MACRO +A#: MACRO + db $A0 | (\1 - 1) +ENDM + +B_: MACRO db $B0 | (\1 - 1) - db \2 +ENDM + +;format: instrument length (in 16ths) +snare1: MACRO + db $B0 | (\1 - 1) + db $01 +ENDM + +snare2: MACRO + db $B0 | (\1 - 1) + db $02 +ENDM + +snare3: MACRO + db $B0 | (\1 - 1) + db $03 +ENDM + +snare4: MACRO + db $B0 | (\1 - 1) + db $04 +ENDM + +snare5: MACRO + db $B0 | (\1 - 1) + db $05 +ENDM + +triangle1: MACRO + db $B0 | (\1 - 1) + db $06 +ENDM + +triangle2: MACRO + db $B0 | (\1 - 1) + db $07 +ENDM + +snare6: MACRO + db $B0 | (\1 - 1) + db $08 +ENDM + +snare7: MACRO + db $B0 | (\1 - 1) + db $09 +ENDM + +snare8: MACRO + db $B0 | (\1 - 1) + db $0A +ENDM + +snare9: MACRO + db $B0 | (\1 - 1) + db $0B +ENDM + +cymbal1: MACRO + db $B0 | (\1 - 1) + db $0C +ENDM + +cymbal2: MACRO + db $B0 | (\1 - 1) + db $0D +ENDM + +cymbal3: MACRO + db $B0 | (\1 - 1) + db $0E +ENDM + +mutedsnare1: MACRO + db $B0 | (\1 - 1) + db $0F +ENDM + +triangle3: MACRO + db $B0 | (\1 - 1) + db $10 +ENDM + +mutedsnare2: MACRO + db $B0 | (\1 - 1) + db $11 +ENDM + +mutedsnare3: MACRO + db $B0 | (\1 - 1) + db $12 +ENDM + +mutedsnare4: MACRO + db $B0 | (\1 - 1) + db $13 ENDM ;format: rest length (in 16ths) @@ -229,7 +386,7 @@ octave: MACRO db $E8 - \1 ENDM -togglecall: MACRO +toggleperfectpitch: MACRO db $E8 ENDM @@ -253,18 +410,18 @@ ENDM tempo: MACRO db $ED - db \1 - db \2 + db \1 / $100 + db \1 % $100 ENDM -unknownmusic0xee: MACRO +stereopanning: MACRO db $EE db \1 ENDM -stereopanning: MACRO +volume: MACRO db $F0 - db \1 + db (\1 << 4) | \2 ENDM executemusic: MACRO @@ -293,6 +450,7 @@ endchannel: MACRO db $FF ENDM + ;\1 (byte) = connected map id ;\2 (byte) = connected map width ;\3 (byte) = connected map height @@ -303,12 +461,12 @@ ENDM NORTH_MAP_CONNECTION: MACRO db \1 ; map id dw \7 + (\2 * (\3 - 3)) + \5; "Connection Strip" location - dw $C6EB + \4 ; current map position + dw wOverworldMap + 3 + \4 ; current map position db \6 ; width of connection strip db \2 ; map width db (\3 * 2) - 1 ; y alignment (y coordinate of player when entering map) db (\4 - \5) * -2 ; x alignment (x coordinate of player when entering map) - dw $C6E9 + (\3 * (\2 + 6)) ; window (position of the upper left block after entering the map) + dw wOverworldMap + 1 + (\3 * (\2 + 6)) ; window (position of the upper left block after entering the map) ENDM ;\1 (byte) = connected map id @@ -322,12 +480,12 @@ ENDM SOUTH_MAP_CONNECTION: MACRO db \1 ; map id dw \6 + \4 ; "Conection Strip" location - dw $C6EB + (\8 + 3) * (\7 + 6) + \3 ; current map positoin + dw wOverworldMap + 3 + (\8 + 3) * (\7 + 6) + \3 ; current map positoin db \5 ; width of connection strip db \2 ; map width db 0 ; y alignment (y coordinate of player when entering map) db (\3 - \4) * -2 ; x alignment (x coordinate of player when entering map) - dw $C6EF + \2 ; window (position of the upper left block after entering the map) + dw wOverworldMap + 7 + \2 ; window (position of the upper left block after entering the map) ENDM ;\1 (byte) = connected map id @@ -340,12 +498,12 @@ ENDM EAST_MAP_CONNECTION: MACRO db \1 ; map id dw \6 + (\2 * \4) ; "Connection Strip" location - dw $C6E5 + (\7 + 6) * (\3 + 4) ; current map position + dw wOverworldMap - 3 + (\7 + 6) * (\3 + 4) ; current map position db \5 ; height of connection strip db \2 ; map width db (\3 - \4) * -2 ; y alignment db 0 ; x alignment - dw $C6EF + \2 ; window (position of the upper left block after entering the map) + dw wOverworldMap + 7 + \2 ; window (position of the upper left block after entering the map) ENDM ;\1 (byte) = connected map id @@ -358,10 +516,10 @@ ENDM WEST_MAP_CONNECTION: MACRO db \1 ; map id dw \6 + (\2 * \4) + \2 - 3 ; "Connection Strip" location - dw $C6E8 + (\7 + 6) * (\3 + 3) ; current map position + dw wOverworldMap + (\7 + 6) * (\3 + 3) ; current map position db \5 ; height of connection strip db \2 ; map width db (\3 - \4) * -2 ; y alignment db (\2 * 2) - 1 ; x alignment - dw $C6EE + (2 * \2) ; window (position of the upper left block after entring the map) + dw wOverworldMap + 6 + (2 * \2) ; window (position of the upper left block after entring the map) ENDM @@ -1,10307 +1,139 @@ INCLUDE "constants.asm" -; The rst vectors are unused. -SECTION "rst00",ROM0[$00] - rst $38 -SECTION "rst08",ROM0[$08] - rst $38 -SECTION "rst10",ROM0[$10] - rst $38 -SECTION "rst18",ROM0[$18] - rst $38 -SECTION "rst20",ROM0[$20] - rst $38 -SECTION "rst28",ROM0[$28] - rst $38 -SECTION "rst30",ROM0[$30] - rst $38 -SECTION "rst38",ROM0[$38] - rst $38 - -; interrupts -SECTION "vblank",ROM0[$40] - jp VBlank -SECTION "lcdc",ROM0[$48] - db $FF -SECTION "timer",ROM0[$50] - jp Timer -SECTION "serial",ROM0[$58] - jp Serial -SECTION "joypad",ROM0[$60] - reti - -SECTION "bank0",ROM0[$61] - -DisableLCD:: ; 0061 (0:0061) - xor a - ld [$ff0f],a - ld a,[$ffff] - ld b,a - res 0,a - ld [$ffff],a -.waitVBlank - ld a,[$ff44] - cp a,$91 - jr nz,.waitVBlank - ld a,[$ff40] - and a,$7f ; res 7,a - ld [$ff40],a - ld a,b - ld [$ffff],a - ret - -EnableLCD:: ; 007b (0:007b) - ld a,[$ff40] - set 7,a - ld [$ff40],a - ret - -CleanLCD_OAM:: ; 0082 (0:0082) - xor a - ld hl,wOAMBuffer - ld b,$a0 -.loop - ld [hli],a - dec b - jr nz,.loop - ret - -ResetLCD_OAM:: ; 008d (0:008d) - ld a,$a0 - ld hl,wOAMBuffer - ld de,$0004 - ld b,$28 -.loop - ld [hl],a - add hl,de - dec b - jr nz,.loop - ret - -FarCopyData:: ; 009d (0:009d) -; copy bc bytes of data from a:hl to de - ld [$CEE9],a ; save future bank # for later - ld a,[H_LOADEDROMBANK] ; get current bank # - push af - ld a,[$CEE9] ; get future bank #, switch - ld [H_LOADEDROMBANK],a - ld [$2000],a - call CopyData - pop af ; okay, done, time to switch back - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret -CopyData:: ; 00b5 (0:00b5) -; copy bc bytes of data from hl to de - ld a,[hli] - ld [de],a - inc de - dec bc - ld a,c - or b - jr nz,CopyData - ret - -SECTION "romheader",ROM0[$100] - nop - jp Start - -SECTION "start",ROM0[$150] -Start:: ; 0150 (0:0150) - cp $11 ; value that indicates Gameboy Color - jr z,.gbcDetected - xor a - jr .storeValue -.gbcDetected - ld a,$00 -.storeValue - ld [$cf1a],a ; same value ($00) either way - jp InitGame - -; this function directly reads the joypad I/O register -; it reads many times in order to give the joypad a chance to stabilize -; it saves a result in [$fff8] in the following format -; (set bit indicates pressed button) -; bit 0 - A button -; bit 1 - B button -; bit 2 - Select button -; bit 3 - Start button -; bit 4 - Right -; bit 5 - Left -; bit 6 - Up -; bit 7 - Down -ReadJoypadRegister:: ; 015f (0:015f) - ld a,%00100000 ; select direction keys - ld c,$00 - ld [rJOYP],a - ld a,[rJOYP] - ld a,[rJOYP] - ld a,[rJOYP] - ld a,[rJOYP] - ld a,[rJOYP] - ld a,[rJOYP] - cpl ; complement the result so that a set bit indicates a pressed key - and a,%00001111 - swap a ; put direction keys in upper nibble - ld b,a - ld a,%00010000 ; select button keys - ld [rJOYP],a - ld a,[rJOYP] - ld a,[rJOYP] - ld a,[rJOYP] - ld a,[rJOYP] - ld a,[rJOYP] - ld a,[rJOYP] - ld a,[rJOYP] - ld a,[rJOYP] - ld a,[rJOYP] - ld a,[rJOYP] - cpl ; complement the result so that a set bit indicates a pressed key - and a,%00001111 - or b ; put button keys in lower nibble - ld [H_JOYPADSTATE],a ; save joypad state - ld a,%00110000 ; unselect all keys - ld [rJOYP],a - ret - -; function to update the joypad state variables -; output: -; [H_NEWLYRELEASEDBUTTONS] = keys released since last time -; [H_NEWLYPRESSEDBUTTONS] = keys pressed since last time -; [H_CURRENTPRESSEDBUTTONS] = currently pressed keys -GetJoypadState:: ; 019a (0:019a) - ld a, [H_LOADEDROMBANK] - push af - ld a,Bank(_GetJoypadState) - ld [H_LOADEDROMBANK],a - ld [$2000],a - call _GetJoypadState - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -INCLUDE "data/map_header_pointers.asm" - -; this function calls a function that takes necessary actions -; at the beginning of each overworld loop iteration as the player jumps -; down a ledge -; it also ends the jump when it's completed -HandleMidJump:: ; 039e (0:039e) - ld b, BANK(_HandleMidJump) - ld hl, _HandleMidJump - jp Bankswitch - -; this is jumped to immediately after loading a save / starting a new game / loading a new map -EnterMap:: ; 03a6 (0:03a6) - ld a,$ff - ld [wJoypadForbiddenButtonsMask],a - call LoadMapData ; load map data - callba Func_c335 ; initialize some variables - ld hl,$d72c - bit 0,[hl] - jr z,.doNotCountSteps - ld a,$03 - ld [$d13c],a ; some kind of step counter (counts up to 3 steps?) -.doNotCountSteps - ld hl,$d72e - bit 5,[hl] ; did a battle happen immediately before this? - res 5,[hl] ; unset the "battle just happened" flag - call z,Func_12e7 - call nz,MapEntryAfterBattle - ld hl,$d732 - ld a,[hl] - and a,$18 - jr z,.didNotFlyOrTeleportIn - res 3,[hl] - callba Func_70510 ; display fly/teleport in graphical effect - call UpdateSprites ; move sprites -.didNotFlyOrTeleportIn - callba CheckForceBikeOrSurf ; handle currents in SF islands and forced bike riding in cycling road - ld hl,$d72d - res 5,[hl] - call UpdateSprites ; move sprites - ld hl,$d126 - set 5,[hl] - set 6,[hl] - xor a - ld [wJoypadForbiddenButtonsMask],a - -OverworldLoop:: ; 03ff (0:03ff) - call DelayFrame -OverworldLoopLessDelay:: ; 0402 (0:0402) - call DelayFrame - call LoadGBPal - ld a,[$d736] - bit 6,a ; jumping down a ledge? - call nz, HandleMidJump - ld a,[wWalkCounter] - and a - jp nz,.moveAhead ; if the player sprite has not yet completed the walking animation - call GetJoypadStateOverworld ; get joypad state (which is possibly simulated) - callba SafariZoneCheck - ld a,[$da46] - and a - jp nz,WarpFound2 - ld hl,$d72d - bit 3,[hl] - res 3,[hl] - jp nz,WarpFound2 - ld a,[$d732] - and a,$18 - jp nz,HandleFlyOrTeleportAway - ld a,[W_CUROPPONENT] - and a - jp nz,.newBattle - ld a,[$d730] - bit 7,a ; are we simulating button presses? - jr z,.notSimulating - ld a,[H_CURRENTPRESSEDBUTTONS] - jr .checkIfStartIsPressed -.notSimulating - ld a,[H_NEWLYPRESSEDBUTTONS] -.checkIfStartIsPressed - bit 3,a ; start button - jr z,.startButtonNotPressed -; if START is pressed - xor a - ld [$ff8c],a ; the $2920 ID for the start menu is 0 - jp .displayDialogue -.startButtonNotPressed - bit 0,a ; A button - jp z,.checkIfDownButtonIsPressed -; if A is pressed - ld a,[$d730] - bit 2,a - jp nz,.noDirectionButtonsPressed - call Func_30fd - jr nz,.checkForOpponent - call Func_3eb5 ; check for hidden items, PC's, etc. - ld a,[$ffeb] - and a - jp z,OverworldLoop - call IsSpriteOrSignInFrontOfPlayer ; check for sign or sprite in front of the player - ld a,[$ff8c] ; $2920 ID for NPC/sign text, if any - and a - jp z,OverworldLoop -.displayDialogue - ld a,$35 - call Predef ; check what is in front of the player - call UpdateSprites ; move sprites - ld a,[wFlags_0xcd60] - bit 2,a - jr nz,.checkForOpponent - bit 0,a - jr nz,.checkForOpponent - FuncCoord 8, 9 ; $c45c - ld a,[Coord] - ld [$cf0e],a - call DisplayTextID ; display either the start menu or the NPC/sign text - ld a,[$cc47] - and a - jr z,.checkForOpponent - dec a - ld a,$00 - ld [$cc47],a - jr z,.changeMap - ld a,$52 - call Predef - ld a,[W_CURMAP] - ld [$d71a],a - call Func_62ce - ld a,[W_CURMAP] - call SwitchToMapRomBank ; switch to the ROM bank of the current map - ld hl,$d367 - set 7,[hl] -.changeMap - jp EnterMap -.checkForOpponent - ld a,[W_CUROPPONENT] - and a - jp nz,.newBattle - jp OverworldLoop -.noDirectionButtonsPressed - ld hl,wFlags_0xcd60 - res 2,[hl] - call UpdateSprites ; move sprites - ld a,$01 - ld [$cc4b],a - ld a,[$d528] ; the direction that was pressed last time - and a - jp z,OverworldLoop -; if a direction was pressed last time - ld [$d529],a ; save the last direction - xor a - ld [$d528],a ; zero the direction - jp OverworldLoop -.checkIfDownButtonIsPressed - ld a,[H_CURRENTPRESSEDBUTTONS] ; current joypad state - bit 7,a ; down button - jr z,.checkIfUpButtonIsPressed - ld a,$01 - ld [$c103],a - ld a,$04 - jr .handleDirectionButtonPress -.checkIfUpButtonIsPressed - bit 6,a ; up button - jr z,.checkIfLeftButtonIsPressed - ld a,$ff - ld [$c103],a - ld a,$08 - jr .handleDirectionButtonPress -.checkIfLeftButtonIsPressed - bit 5,a ; left button - jr z,.checkIfRightButtonIsPressed - ld a,$ff - ld [$c105],a - ld a,$02 - jr .handleDirectionButtonPress -.checkIfRightButtonIsPressed - bit 4,a ; right button - jr z,.noDirectionButtonsPressed - ld a,$01 - ld [$c105],a -.handleDirectionButtonPress - ld [$d52a],a ; new direction - ld a,[$d730] - bit 7,a ; are we simulating button presses? - jr nz,.noDirectionChange ; ignore direction changes if we are - ld a,[$cc4b] - and a - jr z,.noDirectionChange - ld a,[$d52a] ; new direction - ld b,a - ld a,[$d529] ; old direction - cp b - jr z,.noDirectionChange -; the code below is strange -; it computes whether or not the player did a 180 degree turn, but then overwrites the result -; also, it does a seemingly pointless loop afterwards - swap a ; put old direction in upper half - or b ; put new direction in lower half - cp a,$48 ; change dir from down to up - jr nz,.notDownToUp - ld a,$02 - ld [$d528],a - jr .oddLoop -.notDownToUp - cp a,$84 ; change dir from up to down - jr nz,.notUpToDown - ld a,$01 - ld [$d528],a - jr .oddLoop -.notUpToDown - cp a,$12 ; change dir from right to left - jr nz,.notRightToLeft - ld a,$04 - ld [$d528],a - jr .oddLoop -.notRightToLeft - cp a,$21 ; change dir from left to right - jr nz,.oddLoop - ld a,$08 - ld [$d528],a -.oddLoop - ld hl,wFlags_0xcd60 - set 2,[hl] - ld hl,$cc4b - dec [hl] - jr nz,.oddLoop - ld a,[$d52a] - ld [$d528],a - call NewBattle - jp c,.battleOccurred - jp OverworldLoop -.noDirectionChange - ld a,[$d52a] ; current direction - ld [$d528],a ; save direction - call UpdateSprites ; move sprites - ld a,[$d700] - cp a,$02 ; surfing - jr z,.surfing -; not surfing - call CollisionCheckOnLand - jr nc,.noCollision - push hl - ld hl,$d736 - bit 2,[hl] - pop hl - jp z,OverworldLoop - push hl - call ExtraWarpCheck ; sets carry if there is a potential to warp - pop hl - jp c,CheckWarpsCollision - jp OverworldLoop -.surfing - call CollisionCheckOnWater - jp c,OverworldLoop -.noCollision - ld a,$08 - ld [wWalkCounter],a - jr .moveAhead2 -.moveAhead - ld a,[$d736] - bit 7,a - jr z,.noSpinning - callba LoadSpinnerArrowTiles ; spin while moving -.noSpinning - call UpdateSprites ; move sprites -.moveAhead2 - ld hl,wFlags_0xcd60 - res 2,[hl] - ld a,[$d700] - dec a ; riding a bike? - jr nz,.normalPlayerSpriteAdvancement - ld a,[$d736] - bit 6,a ; jumping a ledge? - jr nz,.normalPlayerSpriteAdvancement - call BikeSpeedup ; if riding a bike and not jumping a ledge -.normalPlayerSpriteAdvancement - call AdvancePlayerSprite - ld a,[wWalkCounter] - and a - jp nz,CheckMapConnections ; it seems like this check will never succeed (the other place where CheckMapConnections is run works) -; walking animation finished - ld a,[$d730] - bit 7,a - jr nz,.doneStepCounting ; if button presses are being simulated, don't count steps -; step counting - ld hl,$d13b ; step counter - dec [hl] - ld a,[$d72c] - bit 0,a - jr z,.doneStepCounting - ld hl,$d13c - dec [hl] - jr nz,.doneStepCounting - ld hl,$d72c - res 0,[hl] -.doneStepCounting - ld a,[$d790] - bit 7,a ; in the safari zone? - jr z,.notSafariZone - callba SafariZoneCheckSteps - ld a,[$da46] - and a - jp nz,WarpFound2 -.notSafariZone - ld a,[W_ISINBATTLE] - and a - jp nz,CheckWarpsNoCollision - ld a,$13 - call Predef ; decrement HP of poisoned pokemon - ld a,[$d12d] - and a - jp nz,HandleBlackOut ; if all pokemon fainted -.newBattle - call NewBattle - ld hl,$d736 - res 2,[hl] - jp nc,CheckWarpsNoCollision ; check for warps if there was no battle -.battleOccurred - ld hl,$d72d - res 6,[hl] - ld hl,W_FLAGS_D733 - res 3,[hl] - ld hl,$d126 - set 5,[hl] - set 6,[hl] - xor a - ld [H_CURRENTPRESSEDBUTTONS],a ; clear joypad state - ld a,[W_CURMAP] - cp a,CINNABAR_GYM - jr nz,.notCinnabarGym - ld hl,$d79b - set 7,[hl] -.notCinnabarGym - ld hl,$d72e - set 5,[hl] - ld a,[W_CURMAP] - cp a,OAKS_LAB - jp z,.noFaintCheck - callab AnyPlayerPokemonAliveCheck ; check if all the player's pokemon fainted - ld a,d - and a - jr z,.allPokemonFainted -.noFaintCheck - ld c,$0a - call DelayFrames - jp EnterMap -.allPokemonFainted - ld a,$ff - ld [$d057],a - call RunMapScript - jp HandleBlackOut - -; function to determine if there will be a battle and execute it (either a trainer battle or wild battle) -; sets carry if a battle occurred and unsets carry if not -NewBattle:: ; 0683 (0:0683) - ld a,[$d72d] - bit 4,a - jr nz,.noBattle - call Func_30fd - jr nz,.noBattle - ld a,[$d72e] - bit 4,a - jr nz,.noBattle - ld b, BANK(InitBattle) - ld hl, InitBattle - jp Bankswitch ; determines if a battle will occur and runs the battle if so -.noBattle - and a - ret - -; function to make bikes twice as fast as walking -BikeSpeedup:: ; 06a0 (0:06a0) - ld a,[$cc57] - and a - ret nz - ld a,[W_CURMAP] - cp a,ROUTE_17 ; Cycling Road - jr nz,.goFaster - ld a,[H_CURRENTPRESSEDBUTTONS] ; current joypad state - and a,%01110000 ; bit mask for up, left, right buttons - ret nz -.goFaster - jp AdvancePlayerSprite - -; check if the player has stepped onto a warp after having not collided -CheckWarpsNoCollision:: ; 06b4 (0:06b4) - ld a,[$d3ae] ; number of warps - and a - jp z,CheckMapConnections - ld a,[$d3ae] ; number of warps - ld b,$00 - ld c,a - ld a,[W_YCOORD] - ld d,a - ld a,[W_XCOORD] - ld e,a - ld hl,$d3af ; start of warp entries -CheckWarpsNoCollisionLoop:: ; 06cc (0:06cc) - ld a,[hli] ; check if the warp's Y position matches - cp d - jr nz,CheckWarpsNoCollisionRetry1 - ld a,[hli] ; check if the warp's X position matches - cp e - jr nz,CheckWarpsNoCollisionRetry2 -; if a match was found - push hl - push bc - ld hl,$d736 - set 2,[hl] - callba Func_c49d ; check if the player sprite is standing on a "door" tile - pop bc - pop hl - jr c,WarpFound1 ; if it is, go to 0735 - push hl - push bc - call ExtraWarpCheck ; sets carry if the warp is confirmed - pop bc - pop hl - jr nc,CheckWarpsNoCollisionRetry2 -; if the extra check passed - ld a,[W_FLAGS_D733] - bit 2,a - jr nz,WarpFound1 - push de - push bc - call GetJoypadState - pop bc - pop de - ld a,[H_CURRENTPRESSEDBUTTONS] ; current joypad state - and a,%11110000 ; bit mask for directional buttons - jr z,CheckWarpsNoCollisionRetry2 ; if directional buttons aren't being pressed, do not pass through the warp - jr WarpFound1 - -; check if the player has stepped onto a warp after having collided -CheckWarpsCollision:: ; 0706 (0:0706) - ld a,[$d3ae] ; number of warps - ld c,a - ld hl,$d3af ; start of warp entries -.loop - ld a,[hli] ; Y coordinate of warp - ld b,a - ld a,[W_YCOORD] - cp b - jr nz,.retry1 - ld a,[hli] ; X coordinate of warp - ld b,a - ld a,[W_XCOORD] - cp b - jr nz,.retry2 - ld a,[hli] - ld [$d42f],a ; save target warp ID - ld a,[hl] - ld [$ff8b],a ; save target map - jr WarpFound2 -.retry1 - inc hl -.retry2 - inc hl - inc hl - dec c - jr nz,.loop - jp OverworldLoop - -CheckWarpsNoCollisionRetry1:: ; 072f (0:072f) - inc hl -CheckWarpsNoCollisionRetry2:: ; 0730 (0:0730) - inc hl - inc hl - jp ContinueCheckWarpsNoCollisionLoop - -WarpFound1:: ; 0735 (0:0735) - ld a,[hli] - ld [$d42f],a ; save target warp ID - ld a,[hli] - ld [$ff8b],a ; save target map - -WarpFound2:: ; 073c (0:073c) - ld a,[$d3ae] ; number of warps - sub c - ld [$d73b],a ; save ID of used warp - ld a,[W_CURMAP] - ld [$d73c],a - call CheckIfInOutsideMap - jr nz,.indoorMaps -; this is for handling "outside" maps that can't have the 0xFF destination map - ld a,[W_CURMAP] - ld [wLastMap],a - ld a,[W_CURMAPWIDTH] - ld [$d366],a - ld a,[$ff8b] ; destination map number - ld [W_CURMAP],a ; change current map to destination map - cp a,ROCK_TUNNEL_1 - jr nz,.notRockTunnel - ld a,$06 - ld [$d35d],a - call GBFadeIn1 -.notRockTunnel - call PlayMapChangeSound - jr .done -; for maps that can have the 0xFF destination map, which means to return to the outside map; not all these maps are necessarily indoors, though -.indoorMaps - ld a,[$ff8b] ; destination map - cp a,$ff - jr z,.goBackOutside -; if not going back to the previous map - ld [W_CURMAP],a ; current map number - callba Func_70787 ; check if the warp was a Silph Co. teleporter - ld a,[$cd5b] - dec a - jr nz,.notTeleporter -; if it's a Silph Co. teleporter - ld hl,$d732 - set 3,[hl] - call DoFlyOrTeleportAwayGraphics - jr .skipMapChangeSound -.notTeleporter - call PlayMapChangeSound -.skipMapChangeSound - ld hl,$d736 - res 0,[hl] - res 1,[hl] - jr .done -.goBackOutside - ld a,[wLastMap] - ld [W_CURMAP],a - call PlayMapChangeSound - xor a - ld [$d35d],a -.done - ld hl,$d736 - set 0,[hl] - call Func_12da - jp EnterMap - -ContinueCheckWarpsNoCollisionLoop:: ; 07b5 (0:07b5) - inc b ; increment warp number - dec c ; decrement number of warps - jp nz,CheckWarpsNoCollisionLoop - -; if no matching warp was found -CheckMapConnections:: ; 07ba (0:07ba) -.checkWestMap - ld a,[W_XCOORD] - cp a,$ff - jr nz,.checkEastMap - ld a,[$d387] - ld [W_CURMAP],a - ld a,[$d38f] ; new X coordinate upon entering west map - ld [W_XCOORD],a - ld a,[W_YCOORD] - ld c,a - ld a,[$d38e] ; Y adjustment upon entering west map - add c - ld c,a - ld [W_YCOORD],a - ld a,[$d390] ; pointer to upper left corner of map without adjustment for Y position - ld l,a - ld a,[$d391] - ld h,a - srl c - jr z,.savePointer1 -.pointerAdjustmentLoop1 - ld a,[$d38d] ; width of connected map - add a,$06 - ld e,a - ld d,$00 - ld b,$00 - add hl,de - dec c - jr nz,.pointerAdjustmentLoop1 -.savePointer1 - ld a,l - ld [$d35f],a ; pointer to upper left corner of current tile block map section - ld a,h - ld [$d360],a - jp .loadNewMap -.checkEastMap - ld b,a - ld a,[$d525] ; map width - cp b - jr nz,.checkNorthMap - ld a,[$d392] - ld [W_CURMAP],a - ld a,[$d39a] ; new X coordinate upon entering east map - ld [W_XCOORD],a - ld a,[W_YCOORD] - ld c,a - ld a,[$d399] ; Y adjustment upon entering east map - add c - ld c,a - ld [W_YCOORD],a - ld a,[$d39b] ; pointer to upper left corner of map without adjustment for Y position - ld l,a - ld a,[$d39c] - ld h,a - srl c - jr z,.savePointer2 -.pointerAdjustmentLoop2 - ld a,[$d398] - add a,$06 - ld e,a - ld d,$00 - ld b,$00 - add hl,de - dec c - jr nz,.pointerAdjustmentLoop2 -.savePointer2 - ld a,l - ld [$d35f],a ; pointer to upper left corner of current tile block map section - ld a,h - ld [$d360],a - jp .loadNewMap -.checkNorthMap - ld a,[W_YCOORD] - cp a,$ff - jr nz,.checkSouthMap - ld a,[$d371] - ld [W_CURMAP],a - ld a,[$d378] ; new Y coordinate upon entering north map - ld [W_YCOORD],a - ld a,[W_XCOORD] - ld c,a - ld a,[$d379] ; X adjustment upon entering north map - add c - ld c,a - ld [W_XCOORD],a - ld a,[$d37a] ; pointer to upper left corner of map without adjustment for X position - ld l,a - ld a,[$d37b] - ld h,a - ld b,$00 - srl c - add hl,bc - ld a,l - ld [$d35f],a ; pointer to upper left corner of current tile block map section - ld a,h - ld [$d360],a - jp .loadNewMap -.checkSouthMap - ld b,a - ld a,[$d524] - cp b - jr nz,.didNotEnterConnectedMap - ld a,[$d37c] - ld [W_CURMAP],a - ld a,[$d383] ; new Y coordinate upon entering south map - ld [W_YCOORD],a - ld a,[W_XCOORD] - ld c,a - ld a,[$d384] ; X adjustment upon entering south map - add c - ld c,a - ld [W_XCOORD],a - ld a,[$d385] ; pointer to upper left corner of map without adjustment for X position - ld l,a - ld a,[$d386] - ld h,a - ld b,$00 - srl c - add hl,bc - ld a,l - ld [$d35f],a ; pointer to upper left corner of current tile block map section - ld a,h - ld [$d360],a -.loadNewMap ; load the connected map that was entered - call LoadMapHeader - call Func_2312 ; music - ld b,$09 - call GoPAL_SET -; Since the sprite set shouldn't change, this will just update VRAM slots at -; $C2XE without loading any tile patterns. - callba InitMapSprites - call LoadTileBlockMap - jp OverworldLoopLessDelay -.didNotEnterConnectedMap - jp OverworldLoop - -; function to play a sound when changing maps -PlayMapChangeSound:: ; 08c9 (0:08c9) - FuncCoord 8, 8 ; $c448 - ld a,[Coord] ; upper left tile of the 4x4 square the player's sprite is standing on - cp a,$0b ; door tile in tileset 0 - jr nz,.didNotGoThroughDoor - ld a,(SFX_02_57 - SFX_Headers_02) / 3 - jr .playSound -.didNotGoThroughDoor - ld a,(SFX_02_5c - SFX_Headers_02) / 3 -.playSound - call PlaySound - ld a,[$d35d] - and a - ret nz - jp GBFadeIn1 - -CheckIfInOutsideMap:: ; 08e1 (0:08e1) -; If the player is in an outside map (a town or route), set the z flag - ld a, [W_CURMAPTILESET] - and a ; most towns/routes have tileset 0 (OVERWORLD) - ret z - cp PLATEAU ; Route 23 / Indigo Plateau - ret - -; this function is an extra check that sometimes has to pass in order to warp, beyond just standing on a warp -; the "sometimes" qualification is necessary because of CheckWarpsNoCollision's behavior -; depending on the map, either "function 1" or "function 2" is used for the check -; "function 1" passes when the player is at the edge of the map and is facing towards the outside of the map -; "function 2" passes when the the tile in front of the player is among a certain set -; sets carry if the check passes, otherwise clears carry -ExtraWarpCheck:: ; 08e9 (0:08e9) - ld a, [W_CURMAP] - cp SS_ANNE_3 - jr z, .useFunction1 - cp ROCKET_HIDEOUT_1 - jr z, .useFunction2 - cp ROCKET_HIDEOUT_2 - jr z, .useFunction2 - cp ROCKET_HIDEOUT_4 - jr z, .useFunction2 - cp ROCK_TUNNEL_1 - jr z, .useFunction2 - ld a, [W_CURMAPTILESET] - and a ; outside tileset (OVERWORLD) - jr z, .useFunction2 - cp SHIP ; S.S. Anne tileset - jr z, .useFunction2 - cp SHIP_PORT ; Vermilion Port tileset - jr z, .useFunction2 - cp PLATEAU ; Indigo Plateau tileset - jr z, .useFunction2 -.useFunction1 - ld hl, Func_c3ff - jr .doBankswitch -.useFunction2 - ld hl, Func_c44e -.doBankswitch - ld b, BANK(Func_c44e) - jp Bankswitch - -MapEntryAfterBattle:: ; 091f (0:091f) - callba Func_c35f ; function that appears to disable warp testing after collisions if the player is standing on a warp - ld a,[$d35d] - and a - jp z,GBFadeIn2 - jp LoadGBPal - -; for when all the player's pokemon faint -; other code prints the "you blacked out" message before this is called -HandleBlackOut:: ; 0931 (0:0931) - call GBFadeIn1 - ld a,$08 - call StopMusic - ld hl,$d72e - res 5,[hl] - ld a,Bank(Func_40b0) ; Bank(Func_40b0) and Bank(Func_62ce) need to be equal. - ld [H_LOADEDROMBANK],a - ld [$2000],a - call Func_40b0 - call Func_62ce - call Func_2312 - jp Func_5d5f - -StopMusic:: ; 0951 (0:0951) - ld [wMusicHeaderPointer],a - ld a,$ff - ld [$c0ee],a - call PlaySound -.waitLoop - ld a,[wMusicHeaderPointer] - and a - jr nz,.waitLoop - jp StopAllSounds - -HandleFlyOrTeleportAway:: ; 0965 (0:0965) - call UpdateSprites ; move sprites - call Delay3 - xor a - ld [$cf0b],a - ld [$d700],a - ld [$d057],a - ld [$d35d],a - ld hl,$d732 - set 2,[hl] - res 5,[hl] - call DoFlyOrTeleportAwayGraphics - ld a,Bank(Func_62ce) - ld [H_LOADEDROMBANK],a - ld [$2000],a - call Func_62ce - jp Func_5d5f - -; function that calls a function to do fly away or teleport away graphics -DoFlyOrTeleportAwayGraphics:: ; 098f (0:098f) - ld b, BANK(_DoFlyOrTeleportAwayGraphics) - ld hl, _DoFlyOrTeleportAwayGraphics - jp Bankswitch - -; load sprite graphics based on whether the player is standing, biking, or surfing -LoadPlayerSpriteGraphics:: ; 0997 (0:0997) - ld a,[$d700] - dec a - jr z,.ridingBike - ld a,[$ffd7] - and a - jr nz,.determineGraphics - jr .startWalking -.ridingBike - call IsBikeRidingAllowed - jr c,.determineGraphics ; don't start walking if bike riding is allowed -.startWalking - xor a - ld [$d700],a - ld [$d11a],a - jp LoadWalkingPlayerSpriteGraphics -.determineGraphics - ld a,[$d700] - and a - jp z,LoadWalkingPlayerSpriteGraphics - dec a - jp z,LoadBikePlayerSpriteGraphics - dec a - jp z,LoadSurfingPlayerSpriteGraphics - jp LoadWalkingPlayerSpriteGraphics - -; function to check if bike riding is allowed on the current map -; sets carry if bike is allowed, clears carry otherwise -IsBikeRidingAllowed:: ; 09c5 (0:09c5) - ld a,[W_CURMAP] - cp a,ROUTE_23 - jr z,.allowed - cp a,INDIGO_PLATEAU - jr z,.allowed - ld a,[W_CURMAPTILESET] - ld b,a - ld hl,BikeRidingTilesets -.loop - ld a,[hli] - cp b - jr z,.allowed - inc a - jr nz,.loop - and a - ret -.allowed - scf - ret - -INCLUDE "data/bike_riding_tilesets.asm" - -; load the tile pattern data of the current tileset into VRAM -LoadTilesetTilePatternData:: ; 09e8 (0:09e8) - ld a,[$d52e] - ld l,a - ld a,[$d52f] - ld h,a - ld de,$9000 - ld bc,$0600 - ld a,[$d52b] - jp FarCopyData2 - -; this loads the current maps complete tile map (which references blocks, not individual tiles) to C6E8 -; it can also load partial tile maps of connected maps into a border of length 3 around the current map -LoadTileBlockMap:: ; 09fc (0:09fc) -; fill C6E8-CBFB with the background tile - ld hl,$c6e8 - ld a,[$d3ad] ; background tile number - ld d,a - ld bc,$0514 -.backgroundTileLoop - ld a,d - ld [hli],a - dec bc - ld a,c - or b - jr nz,.backgroundTileLoop -; load tile map of current map (made of tile block IDs) -; a 3-byte border at the edges of the map is kept so that there is space for map connections - ld hl,$c6e8 - ld a,[W_CURMAPWIDTH] - ld [$ff8c],a - add a,$06 ; border (east and west) - ld [$ff8b],a ; map width + border - ld b,$00 - ld c,a -; make space for north border (next 3 lines) - add hl,bc - add hl,bc - add hl,bc - ld c,$03 - add hl,bc ; this puts us past the (west) border - ld a,[$d36a] ; tile map pointer - ld e,a - ld a,[$d36b] - ld d,a ; de = tile map pointer - ld a,[W_CURMAPHEIGHT] - ld b,a -.rowLoop ; copy one row each iteration - push hl - ld a,[$ff8c] ; map width (without border) - ld c,a -.rowInnerLoop - ld a,[de] - inc de - ld [hli],a - dec c - jr nz,.rowInnerLoop -; add the map width plus the border to the base address of the current row to get the next row's address - pop hl - ld a,[$ff8b] ; map width + border - add l - ld l,a - jr nc,.noCarry - inc h -.noCarry - dec b - jr nz,.rowLoop -.northConnection - ld a,[$d371] - cp a,$ff - jr z,.southConnection - call SwitchToMapRomBank - ld a,[$d372] - ld l,a - ld a,[$d373] - ld h,a - ld a,[$d374] - ld e,a - ld a,[$d375] - ld d,a - ld a,[$d376] - ld [$ff8b],a - ld a,[$d377] - ld [$ff8c],a - call LoadNorthSouthConnectionsTileMap -.southConnection - ld a,[$d37c] - cp a,$ff - jr z,.westConnection - call SwitchToMapRomBank - ld a,[$d37d] - ld l,a - ld a,[$d37e] - ld h,a - ld a,[$d37f] - ld e,a - ld a,[$d380] - ld d,a - ld a,[$d381] - ld [$ff8b],a - ld a,[$d382] - ld [$ff8c],a - call LoadNorthSouthConnectionsTileMap -.westConnection - ld a,[$d387] - cp a,$ff - jr z,.eastConnection - call SwitchToMapRomBank - ld a,[$d388] - ld l,a - ld a,[$d389] - ld h,a - ld a,[$d38a] - ld e,a - ld a,[$d38b] - ld d,a - ld a,[$d38c] - ld b,a - ld a,[$d38d] - ld [$ff8b],a - call LoadEastWestConnectionsTileMap -.eastConnection - ld a,[$d392] - cp a,$ff - jr z,.done - call SwitchToMapRomBank - ld a,[$d393] - ld l,a - ld a,[$d394] - ld h,a - ld a,[$d395] - ld e,a - ld a,[$d396] - ld d,a - ld a,[$d397] - ld b,a - ld a,[$d398] - ld [$ff8b],a - call LoadEastWestConnectionsTileMap -.done - ret - -LoadNorthSouthConnectionsTileMap:: ; 0ade (0:0ade) - ld c,$03 -.loop - push de - push hl - ld a,[$ff8b] ; width of connection - ld b,a -.innerLoop - ld a,[hli] - ld [de],a - inc de - dec b - jr nz,.innerLoop - pop hl - pop de - ld a,[$ff8c] ; width of connected map - add l - ld l,a - jr nc,.noCarry1 - inc h -.noCarry1 - ld a,[W_CURMAPWIDTH] - add a,$06 - add e - ld e,a - jr nc,.noCarry2 - inc d -.noCarry2 - dec c - jr nz,.loop - ret - -LoadEastWestConnectionsTileMap:: ; 0b02 (0:0b02) - push hl - push de - ld c,$03 -.innerLoop - ld a,[hli] - ld [de],a - inc de - dec c - jr nz,.innerLoop - pop de - pop hl - ld a,[$ff8b] ; width of connected map - add l - ld l,a - jr nc,.noCarry1 - inc h -.noCarry1 - ld a,[W_CURMAPWIDTH] - add a,$06 - add e - ld e,a - jr nc,.noCarry2 - inc d -.noCarry2 - dec b - jr nz,LoadEastWestConnectionsTileMap - ret - -; function to check if there is a sign or sprite in front of the player -; if so, it is stored in [$FF8C] -; if not, [$FF8C] is set to 0 -IsSpriteOrSignInFrontOfPlayer:: ; 0b23 (0:0b23) - xor a - ld [$ff8c],a - ld a,[$d4b0] ; number of signs in the map - and a - jr z,.extendRangeOverCounter -; if there are signs - ld a,$35 - call Predef ; get the coordinates in front of the player in de - ld hl,$d4b1 ; start of sign coordinates - ld a,[$d4b0] ; number of signs in the map - ld b,a - ld c,$00 -.signLoop - inc c - ld a,[hli] ; sign Y - cp d - jr z,.yCoordMatched - inc hl - jr .retry -.yCoordMatched - ld a,[hli] ; sign X - cp e - jr nz,.retry -.xCoordMatched -; found sign - push hl - push bc - ld hl,$d4d1 ; start of sign text ID's - ld b,$00 - dec c - add hl,bc - ld a,[hl] - ld [$ff8c],a ; store sign text ID - pop bc - pop hl - ret -.retry - dec b - jr nz,.signLoop -; check if the player is front of a counter in a pokemon center, pokemart, etc. and if so, extend the range at which he can talk to the NPC -.extendRangeOverCounter - ld a,$35 - call Predef ; get the tile in front of the player in c - ld hl,$d532 ; list of tiles that extend talking range (counter tiles) - ld b,$03 - ld d,$20 ; talking range in pixels (long range) -.counterTilesLoop - ld a,[hli] - cp c - jr z,IsSpriteInFrontOfPlayer2 ; jumps if the tile in front of the player is a counter tile - dec b - jr nz,.counterTilesLoop - -; part of the above function, but sometimes its called on its own, when signs are irrelevant -; the caller must zero [$FF8C] -IsSpriteInFrontOfPlayer:: ; 0b6b (0:0b6b) - ld d,$10 ; talking range in pixels (normal range) -IsSpriteInFrontOfPlayer2:: ; 0b6d (0:0b6d) - ld bc,$3c40 ; Y and X position of player sprite - ld a,[$c109] ; direction the player is facing -.checkIfPlayerFacingUp - cp a,$04 - jr nz,.checkIfPlayerFacingDown -; facing up - ld a,b - sub d - ld b,a - ld a,$08 - jr .doneCheckingDirection -.checkIfPlayerFacingDown - cp a,$00 - jr nz,.checkIfPlayerFacingRight -; facing down - ld a,b - add d - ld b,a - ld a,$04 - jr .doneCheckingDirection -.checkIfPlayerFacingRight - cp a,$0c - jr nz,.playerFacingLeft -; facing right - ld a,c - add d - ld c,a - ld a,$01 - jr .doneCheckingDirection -.playerFacingLeft -; facing left - ld a,c - sub d - ld c,a - ld a,$02 -.doneCheckingDirection - ld [$d52a],a - ld a,[$d4e1] ; number of sprites - and a - ret z -; if there are sprites - ld hl,$c110 - ld d,a - ld e,$01 -.spriteLoop - push hl - ld a,[hli] ; image (0 if no sprite) - and a - jr z,.nextSprite - inc l - ld a,[hli] ; sprite visibility - inc a - jr z,.nextSprite - inc l - ld a,[hli] ; Y location - cp b - jr nz,.nextSprite - inc l - ld a,[hl] ; X location - cp c - jr z,.foundSpriteInFrontOfPlayer -.nextSprite - pop hl - ld a,l - add a,$10 - ld l,a - inc e - dec d - jr nz,.spriteLoop - ret -.foundSpriteInFrontOfPlayer - pop hl - ld a,l - and a,$f0 - inc a - ld l,a - set 7,[hl] - ld a,e - ld [$ff8c],a ; store sprite ID - ret - -; function to check if the player will jump down a ledge and check if the tile ahead is passable (when not surfing) -; sets the carry flag if there is a collision, and unsets it if there isn't a collision -CollisionCheckOnLand:: ; 0bd1 (0:0bd1) - ld a,[$d736] - bit 6,a ; is the player jumping? - jr nz,.noCollision -; if not jumping a ledge - ld a,[$cd38] - and a - jr nz,.noCollision - ld a,[$d52a] ; the direction that the player is trying to go in - ld d,a - ld a,[$c10c] ; the player sprite's collision data (bit field) (set in the sprite movement code) - and d ; check if a sprite is in the direction the player is trying to go - jr nz,.collision - xor a - ld [$ff8c],a - call IsSpriteInFrontOfPlayer ; check for sprite collisions again? when does the above check fail to detect a sprite collision? - ld a,[$ff8c] - and a ; was there a sprite collision? - jr nz,.collision -; if no sprite collision - ld hl,TilePairCollisionsLand - call CheckForJumpingAndTilePairCollisions - jr c,.collision - call CheckTilePassable - jr nc,.noCollision -.collision - ld a,[$c02a] - cp a,(SFX_02_5b - SFX_Headers_02) / 3 ; check if collision sound is already playing - jr z,.setCarry - ld a,(SFX_02_5b - SFX_Headers_02) / 3 - call PlaySound ; play collision sound (if it's not already playing) -.setCarry - scf - ret -.noCollision - and a - ret - -; function that checks if the tile in front of the player is passable -; clears carry if it is, sets carry if not -CheckTilePassable:: ; 0c10 (0:0c10) - ld a,$35 - call Predef ; get tile in front of player - ld a,[$cfc6] ; tile in front of player - ld c,a - ld hl,$d530 ; pointer to list of passable tiles - ld a,[hli] - ld h,[hl] - ld l,a ; hl now points to passable tiles -.loop - ld a,[hli] - cp a,$ff - jr z,.tileNotPassable - cp c - ret z - jr .loop -.tileNotPassable - scf - ret - -; check if the player is going to jump down a small ledge -; and check for collisions that only occur between certain pairs of tiles -; Input: hl - address of directional collision data -; sets carry if there is a collision and unsets carry if not -CheckForJumpingAndTilePairCollisions:: ; 0c2a (0:0c2a) - push hl - ld a,$35 - call Predef ; get the tile in front of the player - push de - push bc - callba HandleLedges ; check if the player is trying to jump a ledge - pop bc - pop de - pop hl - and a - ld a,[$d736] - bit 6,a ; is the player jumping? - ret nz -; if not jumping - -Func_c44:: ; 0c44 (0:0c44) - FuncCoord 8, 9 ; $c45c - ld a,[Coord] ; tile the player is on - ld [$cf0e],a - -CheckForTilePairCollisions:: ; 0c4a (0:0c4a) - ld a,[$cfc6] ; tile in front of the player - ld c,a -.tilePairCollisionLoop - ld a,[W_CURMAPTILESET] ; tileset number - ld b,a - ld a,[hli] - cp a,$ff - jr z,.noMatch - cp b - jr z,.tilesetMatches - inc hl -.retry - inc hl - jr .tilePairCollisionLoop -.tilesetMatches - ld a,[$cf0e] ; tile the player is on - ld b,a - ld a,[hl] - cp b - jr z,.currentTileMatchesFirstInPair - inc hl - ld a,[hl] - cp b - jr z,.currentTileMatchesSecondInPair - jr .retry -.currentTileMatchesFirstInPair - inc hl - ld a,[hl] - cp c - jr z,.foundMatch - jr .tilePairCollisionLoop -.currentTileMatchesSecondInPair - dec hl - ld a,[hli] - cp c - inc hl - jr nz,.tilePairCollisionLoop -.foundMatch - scf - ret -.noMatch - and a - ret - -; FORMAT: tileset number, tile 1, tile 2 -; terminated by 0xFF -; these entries indicate that the player may not cross between tile 1 and tile 2 -; it's mainly used to simulate differences in elevation - -TilePairCollisionsLand:: ; 0c7e (0:0c7e) - db CAVERN, $20, $05 - db CAVERN, $41, $05 - db FOREST, $30, $2E - db CAVERN, $2A, $05 - db CAVERN, $05, $21 - db FOREST, $52, $2E - db FOREST, $55, $2E - db FOREST, $56, $2E - db FOREST, $20, $2E - db FOREST, $5E, $2E - db FOREST, $5F, $2E - db $FF - -TilePairCollisionsWater:: ; 0ca0 (0:0ca0) - db FOREST, $14, $2E - db FOREST, $48, $2E - db CAVERN, $14, $05 - db $FF - -; this builds a tile map from the tile block map based on the current X/Y coordinates of the player's character -LoadCurrentMapView:: ; 0caa (0:0caa) - ld a,[H_LOADEDROMBANK] - push af - ld a,[$d52b] ; tile data ROM bank - ld [H_LOADEDROMBANK],a - ld [$2000],a ; switch to ROM bank that contains tile data - ld a,[$d35f] ; address of upper left corner of current map view - ld e,a - ld a,[$d360] - ld d,a - ld hl,wTileMapBackup - ld b,$05 -.rowLoop ; each loop iteration fills in one row of tile blocks - push hl - push de - ld c,$06 -.rowInnerLoop ; loop to draw each tile block of the current row - push bc - push de - push hl - ld a,[de] - ld c,a ; tile block number - call DrawTileBlock - pop hl - pop de - pop bc - inc hl - inc hl - inc hl - inc hl - inc de - dec c - jr nz,.rowInnerLoop -; update tile block map pointer to next row's address - pop de - ld a,[W_CURMAPWIDTH] - add a,$06 - add e - ld e,a - jr nc,.noCarry - inc d -.noCarry -; update tile map pointer to next row's address - pop hl - ld a,$60 - add l - ld l,a - jr nc,.noCarry2 - inc h -.noCarry2 - dec b - jr nz,.rowLoop - ld hl,wTileMapBackup - ld bc,$0000 -.adjustForYCoordWithinTileBlock - ld a,[W_YBLOCKCOORD] - and a - jr z,.adjustForXCoordWithinTileBlock - ld bc,$0030 - add hl,bc -.adjustForXCoordWithinTileBlock - ld a,[W_XBLOCKCOORD] - and a - jr z,.copyToVisibleAreaBuffer - ld bc,$0002 - add hl,bc -.copyToVisibleAreaBuffer - ld de,wTileMap ; base address for the tiles that are directly transfered to VRAM during V-blank - ld b,$12 -.rowLoop2 - ld c,$14 -.rowInnerLoop2 - ld a,[hli] - ld [de],a - inc de - dec c - jr nz,.rowInnerLoop2 - ld a,$04 - add l - ld l,a - jr nc,.noCarry3 - inc h -.noCarry3 - dec b - jr nz,.rowLoop2 - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a ; restore previous ROM bank - ret - -AdvancePlayerSprite:: ; 0d27 (0:0d27) - ld a,[$c103] ; delta Y - ld b,a - ld a,[$c105] ; delta X - ld c,a - ld hl,wWalkCounter ; walking animation counter - dec [hl] - jr nz,.afterUpdateMapCoords -; if it's the end of the animation, update the player's map coordinates - ld a,[W_YCOORD] - add b - ld [W_YCOORD],a - ld a,[W_XCOORD] - add c - ld [W_XCOORD],a -.afterUpdateMapCoords - ld a,[wWalkCounter] ; walking animation counter - cp a,$07 - jp nz,.scrollBackgroundAndSprites -; if this is the first iteration of the animation - ld a,c - cp a,$01 - jr nz,.checkIfMovingWest -; moving east - ld a,[$d526] - ld e,a - and a,$e0 - ld d,a - ld a,e - add a,$02 - and a,$1f - or d - ld [$d526],a - jr .adjustXCoordWithinBlock -.checkIfMovingWest - cp a,$ff - jr nz,.checkIfMovingSouth -; moving west - ld a,[$d526] - ld e,a - and a,$e0 - ld d,a - ld a,e - sub a,$02 - and a,$1f - or d - ld [$d526],a - jr .adjustXCoordWithinBlock -.checkIfMovingSouth - ld a,b - cp a,$01 - jr nz,.checkIfMovingNorth -; moving south - ld a,[$d526] - add a,$40 - ld [$d526],a - jr nc,.adjustXCoordWithinBlock - ld a,[$d527] - inc a - and a,$03 - or a,$98 - ld [$d527],a - jr .adjustXCoordWithinBlock -.checkIfMovingNorth - cp a,$ff - jr nz,.adjustXCoordWithinBlock -; moving north - ld a,[$d526] - sub a,$40 - ld [$d526],a - jr nc,.adjustXCoordWithinBlock - ld a,[$d527] - dec a - and a,$03 - or a,$98 - ld [$d527],a -.adjustXCoordWithinBlock - ld a,c - and a - jr z,.pointlessJump ; mistake? -.pointlessJump - ld hl,W_XBLOCKCOORD - ld a,[hl] - add c - ld [hl],a - cp a,$02 - jr nz,.checkForMoveToWestBlock -; moved into the tile block to the east - xor a - ld [hl],a - ld hl,$d4e3 - inc [hl] - ld de,$d35f - call MoveTileBlockMapPointerEast - jr .updateMapView -.checkForMoveToWestBlock - cp a,$ff - jr nz,.adjustYCoordWithinBlock -; moved into the tile block to the west - ld a,$01 - ld [hl],a - ld hl,$d4e3 - dec [hl] - ld de,$d35f - call MoveTileBlockMapPointerWest - jr .updateMapView -.adjustYCoordWithinBlock - ld hl,W_YBLOCKCOORD - ld a,[hl] - add b - ld [hl],a - cp a,$02 - jr nz,.checkForMoveToNorthBlock -; moved into the tile block to the south - xor a - ld [hl],a - ld hl,$d4e2 - inc [hl] - ld de,$d35f - ld a,[W_CURMAPWIDTH] - call MoveTileBlockMapPointerSouth - jr .updateMapView -.checkForMoveToNorthBlock - cp a,$ff - jr nz,.updateMapView -; moved into the tile block to the north - ld a,$01 - ld [hl],a - ld hl,$d4e2 - dec [hl] - ld de,$d35f - ld a,[W_CURMAPWIDTH] - call MoveTileBlockMapPointerNorth -.updateMapView - call LoadCurrentMapView - ld a,[$c103] ; delta Y - cp a,$01 - jr nz,.checkIfMovingNorth2 -; if moving south - call ScheduleSouthRowRedraw - jr .scrollBackgroundAndSprites -.checkIfMovingNorth2 - cp a,$ff - jr nz,.checkIfMovingEast2 -; if moving north - call ScheduleNorthRowRedraw - jr .scrollBackgroundAndSprites -.checkIfMovingEast2 - ld a,[$c105] ; delta X - cp a,$01 - jr nz,.checkIfMovingWest2 -; if moving east - call ScheduleEastColumnRedraw - jr .scrollBackgroundAndSprites -.checkIfMovingWest2 - cp a,$ff - jr nz,.scrollBackgroundAndSprites -; if moving west - call ScheduleWestColumnRedraw -.scrollBackgroundAndSprites - ld a,[$c103] ; delta Y - ld b,a - ld a,[$c105] ; delta X - ld c,a - sla b - sla c - ld a,[$ffaf] - add b - ld [$ffaf],a ; update background scroll Y - ld a,[$ffae] - add c - ld [$ffae],a ; update background scroll X -; shift all the sprites in the direction opposite of the player's motion -; so that the player appears to move relative to them - ld hl,$c114 - ld a,[$d4e1] ; number of sprites - and a ; are there any sprites? - jr z,.done - ld e,a -.spriteShiftLoop - ld a,[hl] - sub b - ld [hli],a - inc l - ld a,[hl] - sub c - ld [hl],a - ld a,$0e - add l - ld l,a - dec e - jr nz,.spriteShiftLoop -.done - ret - -; the following four functions are used to move the pointer to the upper left -; corner of the tile block map in the direction of motion - -MoveTileBlockMapPointerEast:: ; 0e65 (0:0e65) - ld a,[de] - add a,$01 - ld [de],a - ret nc - inc de - ld a,[de] - inc a - ld [de],a - ret - -MoveTileBlockMapPointerWest:: ; 0e6f (0:0e6f) - ld a,[de] - sub a,$01 - ld [de],a - ret nc - inc de - ld a,[de] - dec a - ld [de],a - ret - -MoveTileBlockMapPointerSouth:: ; 0e79 (0:0e79) - add a,$06 - ld b,a - ld a,[de] - add b - ld [de],a - ret nc - inc de - ld a,[de] - inc a - ld [de],a - ret - -MoveTileBlockMapPointerNorth:: ; 0e85 (0:0e85) - add a,$06 - ld b,a - ld a,[de] - sub b - ld [de],a - ret nc - inc de - ld a,[de] - dec a - ld [de],a - ret - -; the following 6 functions are used to tell the V-blank handler to redraw -; the portion of the map that was newly exposed due to the player's movement - -ScheduleNorthRowRedraw:: ; 0e91 (0:0e91) - FuncCoord 0, 0 - ld hl,Coord - call ScheduleRowRedrawHelper - ld a,[$d526] - ld [H_SCREENEDGEREDRAWADDR],a - ld a,[$d527] - ld [H_SCREENEDGEREDRAWADDR + 1],a - ld a,REDRAWROW - ld [H_SCREENEDGEREDRAW],a - ret - -ScheduleRowRedrawHelper:: ; 0ea6 (0:0ea6) - ld de,wScreenEdgeTiles - ld c,$28 -.loop - ld a,[hli] - ld [de],a - inc de - dec c - jr nz,.loop - ret - -ScheduleSouthRowRedraw:: ; 0eb2 (0:0eb2) - FuncCoord 0,16 - ld hl,Coord - call ScheduleRowRedrawHelper - ld a,[$d526] - ld l,a - ld a,[$d527] - ld h,a - ld bc,$0200 - add hl,bc - ld a,h - and a,$03 - or a,$98 - ld [H_SCREENEDGEREDRAWADDR + 1],a - ld a,l - ld [H_SCREENEDGEREDRAWADDR],a - ld a,REDRAWROW - ld [H_SCREENEDGEREDRAW],a - ret - -ScheduleEastColumnRedraw:: ; 0ed3 (0:0ed3) - FuncCoord 18,0 - ld hl,Coord - call ScheduleColumnRedrawHelper - ld a,[$d526] - ld c,a - and a,$e0 - ld b,a - ld a,c - add a,18 - and a,$1f - or b - ld [H_SCREENEDGEREDRAWADDR],a - ld a,[$d527] - ld [H_SCREENEDGEREDRAWADDR + 1],a - ld a,REDRAWCOL - ld [H_SCREENEDGEREDRAW],a - ret - -ScheduleColumnRedrawHelper:: ; 0ef2 (0:0ef2) - ld de,wScreenEdgeTiles - ld c,$12 -.loop - ld a,[hli] - ld [de],a - inc de - ld a,[hl] - ld [de],a - inc de - ld a,19 - add l - ld l,a - jr nc,.noCarry - inc h -.noCarry - dec c - jr nz,.loop - ret - -ScheduleWestColumnRedraw:: ; 0f08 (0:0f08) - FuncCoord 0,0 - ld hl,Coord - call ScheduleColumnRedrawHelper - ld a,[$d526] - ld [H_SCREENEDGEREDRAWADDR],a - ld a,[$d527] - ld [H_SCREENEDGEREDRAWADDR + 1],a - ld a,REDRAWCOL - ld [H_SCREENEDGEREDRAW],a - ret - -; function to write the tiles that make up a tile block to memory -; Input: c = tile block ID, hl = destination address -DrawTileBlock:: ; 0f1d (0:0f1d) - push hl - ld a,[$d52c] ; pointer to tiles - ld l,a - ld a,[$d52d] - ld h,a - ld a,c - swap a - ld b,a - and a,$f0 - ld c,a - ld a,b - and a,$0f - ld b,a ; bc = tile block ID * 0x10 - add hl,bc - ld d,h - ld e,l ; de = address of the tile block's tiles - pop hl - ld c,$04 ; 4 loop iterations -.loop ; each loop iteration, write 4 tile numbers - push bc - ld a,[de] - ld [hli],a - inc de - ld a,[de] - ld [hli],a - inc de - ld a,[de] - ld [hli],a - inc de - ld a,[de] - ld [hl],a - inc de - ld bc,$0015 - add hl,bc - pop bc - dec c - jr nz,.loop - ret - -; function to update joypad state and simulate button presses -GetJoypadStateOverworld:: ; 0f4d (0:0f4d) - xor a - ld [$c103],a - ld [$c105],a - call RunMapScript - call GetJoypadState - ld a,[W_FLAGS_D733] - bit 3,a ; check if a trainer wants a challenge - jr nz,.notForcedDownwards - ld a,[W_CURMAP] - cp a,ROUTE_17 ; Cycling Road - jr nz,.notForcedDownwards - ld a,[H_CURRENTPRESSEDBUTTONS] ; current joypad state - and a,%11110011 ; bit mask for all directions and A/B - jr nz,.notForcedDownwards - ld a,%10000000 ; down pressed - ld [H_CURRENTPRESSEDBUTTONS],a ; on the cycling road, if there isn't a trainer and the player isn't pressing buttons, simulate a down press -.notForcedDownwards - ld a,[$d730] - bit 7,a - ret z -; if simulating button presses - ld a,[H_CURRENTPRESSEDBUTTONS] ; current joypad state - ld b,a - ld a,[$cd3b] ; bit mask for button presses that override simulated ones - and b - ret nz ; return if the simulated button presses are overridden - ld hl,$cd38 ; index of current simulated button press - dec [hl] - ld a,[hl] - cp a,$ff - jr z,.doneSimulating ; if the end of the simulated button presses has been reached - ld hl,$ccd3 ; base address of simulated button presses -; add offset to base address - add l - ld l,a - jr nc,.noCarry - inc h -.noCarry - ld a,[hl] - ld [H_CURRENTPRESSEDBUTTONS],a ; store simulated button press in joypad state - and a - ret nz - ld [H_NEWLYPRESSEDBUTTONS],a - ld [H_NEWLYRELEASEDBUTTONS],a - ret -; if done simulating button presses -.doneSimulating - xor a - ld [$cd3a],a - ld [$cd38],a - ld [$ccd3],a - ld [wJoypadForbiddenButtonsMask],a - ld [H_CURRENTPRESSEDBUTTONS],a - ld hl,$d736 - ld a,[hl] - and a,$f8 - ld [hl],a - ld hl,$d730 - res 7,[hl] - ret - -; function to check the tile ahead to determine if the character should get on land or keep surfing -; sets carry if there is a collision and clears carry otherwise -; It seems that this function has a bug in it, but due to luck, it doesn't -; show up. After detecting a sprite collision, it jumps to the code that -; checks if the next tile is passable instead of just directly jumping to the -; "collision detected" code. However, it doesn't store the next tile in c, -; so the old value of c is used. 2429 is always called before this function, -; and 2429 always sets c to 0xF0. There is no 0xF0 background tile, so it -; is considered impassable and it is detected as a collision. -CollisionCheckOnWater:: ; 0fb7 (0:0fb7) - ld a,[$d730] - bit 7,a - jp nz,.noCollision ; return and clear carry if button presses are being simulated - ld a,[$d52a] ; the direction that the player is trying to go in - ld d,a - ld a,[$c10c] ; the player sprite's collision data (bit field) (set in the sprite movement code) - and d ; check if a sprite is in the direction the player is trying to go - jr nz,.checkIfNextTileIsPassable ; bug? - ld hl,TilePairCollisionsWater - call CheckForJumpingAndTilePairCollisions - jr c,.collision - ld a,$35 - call Predef ; get tile in front of player (puts it in c and [$CFC6]) - ld a,[$cfc6] ; tile in front of player - cp a,$14 ; water tile - jr z,.noCollision ; keep surfing if it's a water tile - cp a,$32 ; either the left tile of the S.S. Anne boarding platform or the tile on eastern coastlines (depending on the current tileset) - jr z,.checkIfVermilionDockTileset - cp a,$48 ; tile on right on coast lines in Safari Zone - jr z,.noCollision ; keep surfing -; check if the [land] tile in front of the player is passable -.checkIfNextTileIsPassable - ld hl,$d530 ; pointer to list of passable tiles - ld a,[hli] - ld h,[hl] - ld l,a -.loop - ld a,[hli] - cp a,$ff - jr z,.collision - cp c - jr z,.stopSurfing ; stop surfing if the tile is passable - jr .loop -.collision - ld a,[$c02a] - cp a,(SFX_02_5b - SFX_Headers_02) / 3 ; check if collision sound is already playing - jr z,.setCarry - ld a,(SFX_02_5b - SFX_Headers_02) / 3 - call PlaySound ; play collision sound (if it's not already playing) -.setCarry - scf - jr .done -.noCollision - and a -.done - ret -.stopSurfing - xor a - ld [$d700],a - call LoadPlayerSpriteGraphics - call Func_2307 - jr .noCollision -.checkIfVermilionDockTileset - ld a, [W_CURMAPTILESET] ; tileset - cp SHIP_PORT ; Vermilion Dock tileset - jr nz, .noCollision ; keep surfing if it's not the boarding platform tile - jr .stopSurfing ; if it is the boarding platform tile, stop surfing - -; function to run the current map's script -RunMapScript:: ; 101b (0:101b) - push hl - push de - push bc - callba Func_f225 ; check if the player is pushing a boulder - ld a,[wFlags_0xcd60] - bit 1,a ; is the player pushing a boulder? - jr z,.afterBoulderEffect - callba Func_f2b5 ; displays dust effect when pushing a boulder -.afterBoulderEffect - pop bc - pop de - pop hl - call Func_310e - ld a,[W_CURMAP] ; current map number - call SwitchToMapRomBank ; change to the ROM bank the map's data is in - ld hl,W_MAPSCRIPTPTR - ld a,[hli] - ld h,[hl] - ld l,a - ld de,.return - push de - jp [hl] ; jump to script -.return - ret - -LoadWalkingPlayerSpriteGraphics:: ; 104d (0:104d) - ld de,RedSprite ; $4180 - ld hl,$8000 - jr LoadPlayerSpriteGraphicsCommon - -LoadSurfingPlayerSpriteGraphics:: ; 1055 (0:1055) - ld de,SeelSprite - ld hl,$8000 - jr LoadPlayerSpriteGraphicsCommon - -LoadBikePlayerSpriteGraphics:: ; 105d (0:105d) - ld de,RedCyclingSprite - ld hl,$8000 - -LoadPlayerSpriteGraphicsCommon:: ; 1063 (0:1063) - push de - push hl - ld bc,(BANK(RedSprite) << 8) + $0c - call CopyVideoData - pop hl - pop de - ld a,$c0 - add e - ld e,a - jr nc,.noCarry - inc d -.noCarry - set 3,h - ld bc,$050c - jp CopyVideoData - -; function to load data from the map header -LoadMapHeader:: ; 107c (0:107c) - callba Func_f113 - ld a,[W_CURMAPTILESET] - ld [$d119],a - ld a,[W_CURMAP] - call SwitchToMapRomBank - ld a,[W_CURMAPTILESET] - ld b,a - res 7,a - ld [W_CURMAPTILESET],a - ld [$ff8b],a - bit 7,b - ret nz - ld hl,MapHeaderPointers - ld a,[W_CURMAP] - sla a - jr nc,.noCarry1 - inc h -.noCarry1 - add l - ld l,a - jr nc,.noCarry2 - inc h -.noCarry2 - ld a,[hli] - ld h,[hl] - ld l,a ; hl = base of map header -; copy the first 10 bytes (the fixed area) of the map data to D367-D370 - ld de,$d367 - ld c,$0a -.copyFixedHeaderLoop - ld a,[hli] - ld [de],a - inc de - dec c - jr nz,.copyFixedHeaderLoop -; initialize all the connected maps to disabled at first, before loading the actual values - ld a,$ff - ld [$d371],a - ld [$d37c],a - ld [$d387],a - ld [$d392],a -; copy connection data (if any) to WRAM - ld a,[W_MAPCONNECTIONS] - ld b,a -.checkNorth - bit 3,b - jr z,.checkSouth - ld de,W_MAPCONN1PTR - call CopyMapConnectionHeader -.checkSouth - bit 2,b - jr z,.checkWest - ld de,W_MAPCONN2PTR - call CopyMapConnectionHeader -.checkWest - bit 1,b - jr z,.checkEast - ld de,W_MAPCONN3PTR - call CopyMapConnectionHeader -.checkEast - bit 0,b - jr z,.getObjectDataPointer - ld de,W_MAPCONN4PTR - call CopyMapConnectionHeader -.getObjectDataPointer - ld a,[hli] - ld [$d3a9],a - ld a,[hli] - ld [$d3aa],a - push hl - ld a,[$d3a9] - ld l,a - ld a,[$d3aa] - ld h,a ; hl = base of object data - ld de,$d3ad ; background tile ID - ld a,[hli] - ld [de],a ; save background tile ID -.loadWarpData - ld a,[hli] ; number of warps - ld [$d3ae],a ; save the number of warps - and a ; are there any warps? - jr z,.loadSignData ; if not, skip this - ld c,a - ld de,$d3af ; base address of warps -.warpLoop ; one warp per loop iteration - ld b,$04 -.warpInnerLoop - ld a,[hli] - ld [de],a - inc de - dec b - jr nz,.warpInnerLoop - dec c - jr nz,.warpLoop -.loadSignData - ld a,[hli] ; number of signs - ld [$d4b0],a ; save the number of signs - and a ; are there any signs? - jr z,.loadSpriteData ; if not, skip this - ld c,a - ld de,$d4d1 ; base address of sign text IDs - ld a,d - ld [$ff95],a - ld a,e - ld [$ff96],a - ld de,$d4b1 ; base address of sign coordinates -.signLoop - ld a,[hli] - ld [de],a - inc de - ld a,[hli] - ld [de],a - inc de - push de - ld a,[$ff95] - ld d,a - ld a,[$ff96] - ld e,a - ld a,[hli] - ld [de],a - inc de - ld a,d - ld [$ff95],a - ld a,e - ld [$ff96],a - pop de - dec c - jr nz,.signLoop -.loadSpriteData - ld a,[$d72e] - bit 5,a ; did a battle happen immediately before this? - jp nz,.finishUp ; if so, skip this because battles don't destroy this data - ld a,[hli] - ld [$d4e1],a ; save the number of sprites - push hl -; zero C110-C1FF and C210-C2FF - ld hl,$c110 - ld de,$c210 - xor a - ld b,$f0 -.zeroSpriteDataLoop - ld [hli],a - ld [de],a - inc e - dec b - jr nz,.zeroSpriteDataLoop -; initialize all C100-C1FF sprite entries to disabled (other than player's) - ld hl,$c112 - ld de,$0010 - ld c,$0f -.disableSpriteEntriesLoop - ld [hl],$ff - add hl,de - dec c - jr nz,.disableSpriteEntriesLoop - pop hl - ld de,$c110 - ld a,[$d4e1] ; number of sprites - and a ; are there any sprites? - jp z,.finishUp ; if there are no sprites, skip the rest - ld b,a - ld c,$00 -.loadSpriteLoop - ld a,[hli] - ld [de],a ; store picture ID at C1X0 - inc d - ld a,$04 - add e - ld e,a - ld a,[hli] - ld [de],a ; store Y position at C2X4 - inc e - ld a,[hli] - ld [de],a ; store X position at C2X5 - inc e - ld a,[hli] - ld [de],a ; store movement byte 1 at C2X6 - ld a,[hli] - ld [$ff8d],a ; save movement byte 2 - ld a,[hli] - ld [$ff8e],a ; save text ID and flags byte - push bc - push hl - ld b,$00 - ld hl,W_MAPSPRITEDATA - add hl,bc - ld a,[$ff8d] - ld [hli],a ; store movement byte 2 in byte 0 of sprite entry - ld a,[$ff8e] - ld [hl],a ; this appears pointless, since the value is overwritten immediately after - ld a,[$ff8e] - ld [$ff8d],a - and a,$3f - ld [hl],a ; store text ID in byte 1 of sprite entry - pop hl - ld a,[$ff8d] - bit 6,a - jr nz,.trainerSprite - bit 7,a - jr nz,.itemBallSprite - jr .regularSprite -.trainerSprite - ld a,[hli] - ld [$ff8d],a ; save trainer class - ld a,[hli] - ld [$ff8e],a ; save trainer number (within class) - push hl - ld hl,W_MAPSPRITEEXTRADATA - add hl,bc - ld a,[$ff8d] - ld [hli],a ; store trainer class in byte 0 of the entry - ld a,[$ff8e] - ld [hl],a ; store trainer number in byte 1 of the entry - pop hl - jr .nextSprite -.itemBallSprite - ld a,[hli] - ld [$ff8d],a ; save item number - push hl - ld hl,W_MAPSPRITEEXTRADATA - add hl,bc - ld a,[$ff8d] - ld [hli],a ; store item number in byte 0 of the entry - xor a - ld [hl],a ; zero byte 1, since it is not used - pop hl - jr .nextSprite -.regularSprite - push hl - ld hl,W_MAPSPRITEEXTRADATA - add hl,bc -; zero both bytes, since regular sprites don't use this extra space - xor a - ld [hli],a - ld [hl],a - pop hl -.nextSprite - pop bc - dec d - ld a,$0a - add e - ld e,a - inc c - inc c - dec b - jp nz,.loadSpriteLoop -.finishUp - ld a,$19 - call Predef ; load tileset data - callab LoadWildData ; load wild pokemon data - pop hl ; restore hl from before going to the warp/sign/sprite data (this value was saved for seemingly no purpose) - ld a,[W_CURMAPHEIGHT] ; map height in 4x4 tile blocks - add a ; double it - ld [$d524],a ; store map height in 2x2 tile blocks - ld a,[W_CURMAPWIDTH] ; map width in 4x4 tile blocks - add a ; double it - ld [$d525],a ; map width in 2x2 tile blocks - ld a,[W_CURMAP] - ld c,a - ld b,$00 - ld a,[H_LOADEDROMBANK] - push af - ld a, BANK(MapSongBanks) - ld [H_LOADEDROMBANK],a - ld [$2000],a - ld hl, MapSongBanks - add hl,bc - add hl,bc - ld a,[hli] - ld [$d35b],a ; music 1 - ld a,[hl] - ld [$d35c],a ; music 2 - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -; function to copy map connection data from ROM to WRAM -; Input: hl = source, de = destination -CopyMapConnectionHeader:: ; 1238 (0:1238) - ld c,$0b -.loop - ld a,[hli] - ld [de],a - inc de - dec c - jr nz,.loop - ret - -; function to load map data -LoadMapData:: ; 1241 (0:1241) - ld a,[H_LOADEDROMBANK] - push af - call DisableLCD - ld a,$98 - ld [$d527],a - xor a - ld [$d526],a - ld [$ffaf],a - ld [$ffae],a - ld [wWalkCounter],a - ld [$d119],a - ld [$d11a],a - ld [$d3a8],a - call LoadTextBoxTilePatterns - call LoadMapHeader - callba InitMapSprites ; load tile pattern data for sprites - call LoadTileBlockMap - call LoadTilesetTilePatternData - call LoadCurrentMapView -; copy current map view to VRAM - ld hl,wTileMap - ld de,$9800 - ld b,$12 -.vramCopyLoop - ld c,$14 -.vramCopyInnerLoop - ld a,[hli] - ld [de],a - inc e - dec c - jr nz,.vramCopyInnerLoop - ld a,$0c - add e - ld e,a - jr nc,.noCarry - inc d -.noCarry - dec b - jr nz,.vramCopyLoop - ld a,$01 - ld [$cfcb],a - call EnableLCD - ld b,$09 - call GoPAL_SET - call LoadPlayerSpriteGraphics - ld a,[$d732] - and a,$18 ; did the player fly or teleport in? - jr nz,.restoreRomBank - ld a,[W_FLAGS_D733] - bit 1,a - jr nz,.restoreRomBank - call Func_235f ; music related - call Func_2312 ; music related -.restoreRomBank - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -; function to switch to the ROM bank that a map is stored in -; Input: a = map number -SwitchToMapRomBank:: ; 12bc (0:12bc) - push hl - push bc - ld c,a - ld b,$00 - ld a,Bank(MapHeaderBanks) - call BankswitchHome ; switch to ROM bank 3 - ld hl,MapHeaderBanks - add hl,bc - ld a,[hl] - ld [$ffe8],a ; save map ROM bank - call BankswitchBack - ld a,[$ffe8] - ld [H_LOADEDROMBANK],a - ld [$2000],a ; switch to map ROM bank - pop bc - pop hl - ret - -Func_12da:: ; 12da (0:12da) - ld a, $1e - ld [$d13a], a - ld hl, $d730 - ld a, [hl] - or $26 - ld [hl], a - ret - -Func_12e7:: ; 12e7 (0:12e7) - ld hl, $d728 - res 0, [hl] - ret - -;appears to be called twice inside function $C38B -;if $d700,$d11a == $1 then biking -;if $d700,$d11a == $2 then surfing -ForceBikeOrSurf:: ; 12ed (0:12ed) - ld b,5 ;graphics bank 5 - ld hl,LoadPlayerSpriteGraphics ;load player sprite graphics - call Bankswitch ;loads bank 5 and then calls LoadPlayerSpriteGraphics - jp Func_2307 ;update map/player state? - -; this is used to check if the player wants to interrupt the opening sequence at several points -; XXX is this used anywhere else? -; INPUT: -; c = number of frames to wait -; sets carry if Up+Select+B, Start, or A is pressed within c frames -; unsets carry otherwise -CheckForUserInterruption:: ; 12f8 (0:12f8) - call DelayFrame - push bc - call GetJoypadStateLowSensitivity - pop bc - ld a,[H_CURRENTPRESSEDBUTTONS] ; currently pressed buttons - cp a,%01000110 ; Up, Select button, B button - jr z,.setCarry ; if all three keys are pressed - ld a,[$ffb5] ; either newly pressed buttons or currently pressed buttons at low sampling rate - and a,%00001001 ; Start button, A button - jr nz,.setCarry ; if either key is pressed - dec c - jr nz,CheckForUserInterruption -.unsetCarry - and a - ret -.setCarry - scf - ret - -; function to load position data for destination warp when switching maps -; INPUT: -; a = ID of destination warp within destination map -LoadDestinationWarpPosition:: ; 1313 (0:1313) - ld b,a - ld a,[H_LOADEDROMBANK] - push af - ld a,[$cf12] - ld [H_LOADEDROMBANK],a - ld [$2000],a - ld a,b - add a - add a - ld c,a - ld b,0 - add hl,bc - ld bc,4 - ld de,$d35f - call CopyData - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -; INPUT: -; c: if nonzero, show at least a sliver of health -; d = number of HP bar sections (normally 6) -; e = health (in eighths of bar sections) (normally out of 48) -DrawHPBar:: ; 1336 (0:1336) - push hl - push de - push bc - ld a,$71 ; left of HP bar tile 1 - ld [hli],a - ld a,$62 ; left of HP bar tile 2 - ld [hli],a - push hl - ld a,$63 ; empty bar section tile -.drawEmptyBarLoop - ld [hli],a - dec d - jr nz,.drawEmptyBarLoop - ld a,[$cf94] - dec a ; what should the right of HP bar tile be? - ld a,$6d ; right of HP bar tile, in status screen and battles - jr z,.writeTile - dec a ; right of HP bar tile, in pokemon menu -.writeTile - ld [hl],a - pop hl - ld a,e - and a ; is there enough health to show up on the HP bar? - jr nz,.loop ; if so, draw the HP bar - ld a,c - and a ; should a sliver of health be shown no matter what? - jr z,.done - ld e,1 ; if so, fill one eighth of a bar section -; loop to draw every full bar section -.loop - ld a,e - sub a,8 - jr c,.drawPartialBarSection - ld e,a - ld a,$6b ; filled bar section tile - ld [hli],a - ld a,e - and a - jr z,.done - jr .loop -; draws a partial bar section at the end (if necessary) -; there are 7 possible partial bar sections from 1/8 to 7/8 full -.drawPartialBarSection - ld a,$63 ; empty bar section tile - add e ; add e to get the appropriate partial bar section tile - ld [hl],a ; write the tile -.done - pop bc - pop de - pop hl - ret - -; loads pokemon data from one of multiple sources to $cf98 -; loads base stats to $d0b8 -; INPUT: -; [$cf92] = index of pokemon within party/box -; [$cc49] = source -; 00: player's party -; 01: enemy's party -; 02: current box -; 03: daycare -; OUTPUT: -; [$cf91] = pokemon ID -; $cf98 = base address of pokemon data -; $d0b8 = base address of base stats -LoadMonData:: ; 1372 (0:1372) - ld hl,LoadMonData_ - ld b,BANK(LoadMonData_) - jp Bankswitch - -; writes c to $d0dc+b -Func_137a:: ; 137a (0:137a) - ld hl, $d0dc - ld e, b - ld d, $0 - add hl, de - ld a, c - ld [hl], a - ret - -LoadFlippedFrontSpriteByMonIndex:: ; 1384 (0:1384) - ld a, $1 - ld [W_SPRITEFLIPPED], a - -LoadFrontSpriteByMonIndex:: ; 1389 (0:1389) - push hl - ld a, [$d11e] - push af - ld a, [$cf91] - ld [$d11e], a - ld a, $3a - call Predef ; indirect jump to IndexToPokedex (41010 (10:5010)) - ld hl, $d11e - ld a, [hl] - pop bc - ld [hl], b - and a - pop hl - jr z, .invalidDexNumber ; dex #0 invalid - cp 151 + 1 - jr c, .validDexNumber ; dex >#151 invalid -.invalidDexNumber - ld a, RHYDON ; $1 - ld [$cf91], a - ret -.validDexNumber - push hl - ld de, $9000 - call LoadMonFrontSprite - pop hl - ld a, [H_LOADEDROMBANK] - push af - ld a, Bank(asm_3f0d0) - ld [H_LOADEDROMBANK], a - ld [$2000], a - xor a - ld [$ffe1], a - call asm_3f0d0 - xor a - ld [W_SPRITEFLIPPED], a - pop af - ld [H_LOADEDROMBANK], a - ld [$2000], a - ret - -; plays the cry of a pokemon -; INPUT: -; a = pokemon ID -PlayCry:: ; 13d0 (0:13d0) - call GetCryData - call PlaySound ; play cry - jp WaitForSoundToFinish ; wait for sound to be done playing - -; gets a pokemon's cry data -; INPUT: -; a = pokemon ID -GetCryData:: ; 13d9 (0:13d9) - dec a - ld c,a - ld b,0 - ld hl,CryData - add hl,bc - add hl,bc - add hl,bc - ld a,Bank(CryData) - call BankswitchHome - ld a,[hli] - ld b,a - ld a,[hli] - ld [$c0f1],a - ld a,[hl] - ld [$c0f2],a - call BankswitchBack - ld a,b ; a = cryID - ld c,$14 ; base sound ID for pokemon cries - rlca - add b ; a = cryID * 3 - add c ; a = $14 + cryID * 3 - ret - -DisplayPartyMenu:: ; 13fc (0:13fc) - ld a,[$ffd7] - push af - xor a - ld [$ffd7],a - call GBPalWhiteOutWithDelay3 - call CleanLCD_OAM - call PartyMenuInit - call DrawPartyMenu - jp HandlePartyMenuInput - -GoBackToPartyMenu:: ; 1411 (0:1411) - ld a,[$ffd7] - push af - xor a - ld [$ffd7],a - call PartyMenuInit - call RedrawPartyMenu - jp HandlePartyMenuInput - -PartyMenuInit:: ; 1420 (0:1420) - ld a,$01 - call BankswitchHome - call LoadHpBarAndStatusTilePatterns - ld hl,$d730 - set 6,[hl] ; turn off letter printing delay - xor a - ld [$cc49],a - ld [$cc37],a - ld hl,wTopMenuItemY - inc a - ld [hli],a ; top menu item Y - xor a - ld [hli],a ; top menu item X - ld a,[$cc2b] - push af - ld [hli],a ; current menu item ID - inc hl - ld a,[W_NUMINPARTY] - and a ; are there more than 0 pokemon in the party? - jr z,.storeMaxMenuItemID - dec a -; if party is not empty, the max menu item ID is ([W_NUMINPARTY] - 1) -; otherwise, it is 0 -.storeMaxMenuItemID - ld [hli],a ; max menu item ID - ld a,[$d11f] - and a - ld a,%00000011 ; A button and B button - jr z,.next - xor a - ld [$d11f],a - inc a -.next - ld [hli],a ; menu watched keys - pop af - ld [hl],a ; old menu item ID - ret - -HandlePartyMenuInput:: ; 145a (0:145a) - ld a,1 - ld [$cc4a],a - ld a,$40 - ld [$d09b],a - call HandleMenuInputPokemonSelection - call PlaceUnfilledArrowMenuCursor - ld b,a - xor a - ld [$d09b],a - ld a,[wCurrentMenuItem] - ld [$cc2b],a - ld hl,$d730 - res 6,[hl] ; turn on letter printing delay - ld a,[$cc35] - and a - jp nz,.swappingPokemon - pop af - ld [$ffd7],a - bit 1,b - jr nz,.noPokemonChosen - ld a,[W_NUMINPARTY] - and a - jr z,.noPokemonChosen - ld a,[wCurrentMenuItem] - ld [wWhichPokemon],a - ld hl,W_PARTYMON1 - ld b,0 - ld c,a - add hl,bc - ld a,[hl] - ld [$cf91],a - ld [$cfd9],a - call BankswitchBack - and a - ret -.noPokemonChosen - call BankswitchBack - scf - ret -.swappingPokemon - bit 1,b ; was the B button pressed? - jr z,.handleSwap ; if not, handle swapping the pokemon -.cancelSwap ; if the B button was pressed - callba ErasePartyMenuCursors - xor a - ld [$cc35],a - ld [$d07d],a - call RedrawPartyMenu - jr HandlePartyMenuInput -.handleSwap - ld a,[wCurrentMenuItem] - ld [wWhichPokemon],a - callba SwitchPartyMon - jr HandlePartyMenuInput - -DrawPartyMenu:: ; 14d4 (0:14d4) - ld hl, DrawPartyMenu_ - jr DrawPartyMenuCommon - -RedrawPartyMenu:: ; 14d9 (0:14d9) - ld hl, RedrawPartyMenu_ - -DrawPartyMenuCommon:: ; 14dc (0:14dc) - ld b, BANK(RedrawPartyMenu_) - jp Bankswitch - -; prints a pokemon's status condition -; INPUT: -; de = address of status condition -; hl = destination address -PrintStatusCondition:: ; 14e1 (0:14e1) - push de - dec de - dec de ; de = address of current HP - ld a,[de] - ld b,a - dec de - ld a,[de] - or b ; is the pokemon's HP zero? - pop de - jr nz,PrintStatusConditionNotFainted -; if the pokemon's HP is 0, print "FNT" - ld a,"F" - ld [hli],a - ld a,"N" - ld [hli],a - ld [hl],"T" - and a - ret -PrintStatusConditionNotFainted ; 14f6 - ld a,[H_LOADEDROMBANK] - push af - ld a,BANK(PrintStatusAilment) - ld [H_LOADEDROMBANK],a - ld [$2000],a - call PrintStatusAilment ; print status condition - pop bc - ld a,b - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -; function to print pokemon level, leaving off the ":L" if the level is at least 100 -; INPUT: -; hl = destination address -; [$cfb9] = level -PrintLevel:: ; 150b (0:150b) - ld a,$6e ; ":L" tile ID - ld [hli],a - ld c,2 ; number of digits - ld a,[$cfb9] ; level - cp a,100 - jr c,PrintLevelCommon -; if level at least 100, write over the ":L" tile - dec hl - inc c ; increment number of digits to 3 - jr PrintLevelCommon - -; prints the level without leaving off ":L" regardless of level -; INPUT: -; hl = destination address -; [$cfb9] = level -PrintLevelFull:: ; 151b (0:151b) - ld a,$6e ; ":L" tile ID - ld [hli],a - ld c,3 ; number of digits - ld a,[$cfb9] ; level - -PrintLevelCommon:: ; 1523 (0:1523) - ld [$d11e],a - ld de,$d11e - ld b,$41 ; no leading zeroes, left-aligned, one byte - jp PrintNumber - -Func_152e:: ; 152e (0:152e) - ld hl,$d0dc - ld c,a - ld b,0 - add hl,bc - ld a,[hl] - ret - -; copies the base stat data of a pokemon to $D0B8 (W_MONHEADER) -; INPUT: -; [$D0B5] = pokemon ID -GetMonHeader:: ; 1537 (0:1537) - ld a,[H_LOADEDROMBANK] - push af - ld a,BANK(BulbasaurBaseStats) - ld [H_LOADEDROMBANK],a - ld [$2000],a - push bc - push de - push hl - ld a,[$d11e] - push af - ld a,[$d0b5] - ld [$d11e],a - ld de,FossilKabutopsPic - ld b,$66 ; size of Kabutops fossil and Ghost sprites - cp a,FOSSIL_KABUTOPS ; Kabutops fossil - jr z,.specialID - ld de,GhostPic - cp a,MON_GHOST ; Ghost - jr z,.specialID - ld de,FossilAerodactylPic - ld b,$77 ; size of Aerodactyl fossil sprite - cp a,FOSSIL_AERODACTYL ; Aerodactyl fossil - jr z,.specialID - cp a,MEW - jr z,.mew - ld a,$3a - call Predef ; convert pokemon ID in [$D11E] to pokedex number - ld a,[$d11e] - dec a - ld bc,28 - ld hl,BulbasaurBaseStats - call AddNTimes - ld de,W_MONHEADER - ld bc,28 - call CopyData - jr .done -.specialID - ld hl,W_MONHSPRITEDIM - ld [hl],b ; write sprite dimensions - inc hl - ld [hl],e ; write front sprite pointer - inc hl - ld [hl],d - jr .done -.mew - ld hl,MewBaseStats - ld de,W_MONHEADER - ld bc,28 - ld a,BANK(MewBaseStats) - call FarCopyData -.done - ld a,[$d0b5] - ld [$d0b8],a - pop af - ld [$d11e],a - pop hl - pop de - pop bc - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -; copy party pokemon's name to $CD6D -GetPartyMonName2:: ; 15b4 (0:15b4) - ld a,[wWhichPokemon] ; index within party - ld hl,W_PARTYMON1NAME - -; this is called more often -GetPartyMonName:: ; 15ba (0:15ba) - push hl - push bc - call SkipFixedLengthTextEntries ; add 11 to hl, a times - ld de,$cd6d - push de - ld bc,11 - call CopyData - pop de - pop bc - pop hl - ret - -; function to print a BCD (Binary-coded decimal) number -; de = address of BCD number -; hl = destination address -; c = flags and length -; bit 7: if set, do not print leading zeroes -; if unset, print leading zeroes -; bit 6: if set, left-align the string (do not pad empty digits with spaces) -; if unset, right-align the string -; bit 5: if set, print currency symbol at the beginning of the string -; if unset, do not print the currency symbol -; bits 0-4: length of BCD number in bytes -; Note that bits 5 and 7 are modified during execution. The above reflects -; their meaning at the beginning of the functions's execution. -PrintBCDNumber:: ; 15cd (0:15cd) - ld b,c ; save flags in b - res 7,c - res 6,c - res 5,c ; c now holds the length - bit 5,b - jr z,.loop - bit 7,b - jr nz,.loop - ld [hl],"¥" - inc hl -.loop - ld a,[de] - swap a - call PrintBCDDigit ; print upper digit - ld a,[de] - call PrintBCDDigit ; print lower digit - inc de - dec c - jr nz,.loop - bit 7,b ; were any non-zero digits printed? - jr z,.done ; if so, we are done -.numberEqualsZero ; if every digit of the BCD number is zero - bit 6,b ; left or right alignment? - jr nz,.skipRightAlignmentAdjustment - dec hl ; if the string is right-aligned, it needs to be moved back one space -.skipRightAlignmentAdjustment - bit 5,b - jr z,.skipCurrencySymbol - ld [hl],"¥" - inc hl -.skipCurrencySymbol - ld [hl],"0" - call PrintLetterDelay - inc hl -.done - ret - -PrintBCDDigit:: ; 1604 (0:1604) - and a,%00001111 - and a - jr z,.zeroDigit -.nonzeroDigit - bit 7,b ; have any non-space characters been printed? - jr z,.outputDigit -; if bit 7 is set, then no numbers have been printed yet - bit 5,b ; print the currency symbol? - jr z,.skipCurrencySymbol - ld [hl],"¥" - inc hl - res 5,b -.skipCurrencySymbol - res 7,b ; unset 7 to indicate that a nonzero digit has been reached -.outputDigit - add a,"0" - ld [hli],a - jp PrintLetterDelay -.zeroDigit - bit 7,b ; either printing leading zeroes or already reached a nonzero digit? - jr z,.outputDigit ; if so, print a zero digit - bit 6,b ; left or right alignment? - ret nz - inc hl ; if right-aligned, "print" a space by advancing the pointer - ret - -; uncompresses the front or back sprite of the specified mon -; assumes the corresponding mon header is already loaded -; hl contains offset to sprite pointer ($b for front or $d for back) -UncompressMonSprite:: ; 1627 (0:1627) - ld bc,W_MONHEADER - add hl,bc - ld a,[hli] - ld [W_SPRITEINPUTPTR],a ; fetch sprite input pointer - ld a,[hl] - ld [W_SPRITEINPUTPTR+1],a -; define (by index number) the bank that a pokemon's image is in -; index = Mew, bank 1 -; index = Kabutops fossil, bank $B -; index < $1F, bank 9 -; $1F ≤ index < $4A, bank $A -; $4A ≤ index < $74, bank $B -; $74 ≤ index < $99, bank $C -; $99 ≤ index, bank $D - ld a,[$CF91] ; XXX name for this ram location - ld b,a - cp MEW - ld a,BANK(MewPicFront) - jr z,.GotBank - ld a,b - cp FOSSIL_KABUTOPS - ld a,BANK(FossilKabutopsPic) - jr z,.GotBank - ld a,b - cp TANGELA + 1 - ld a,BANK(TangelaPicFront) - jr c,.GotBank - ld a,b - cp MOLTRES + 1 - ld a,BANK(MoltresPicFront) - jr c,.GotBank - ld a,b - cp BEEDRILL + 2 - ld a,BANK(BeedrillPicFront) - jr c,.GotBank - ld a,b - cp STARMIE + 1 - ld a,BANK(StarmiePicFront) - jr c,.GotBank - ld a,BANK(VictreebelPicFront) -.GotBank - jp UncompressSpriteData - -; de: destination location -LoadMonFrontSprite:: ; 1665 (0:1665) - push de - ld hl, W_MONHFRONTSPRITE - W_MONHEADER - call UncompressMonSprite - ld hl, W_MONHSPRITEDIM - ld a, [hli] - ld c, a - pop de - ; fall through - -; postprocesses uncompressed sprite chunks to a 2bpp sprite and loads it into video ram -; calculates alignment parameters to place both sprite chunks in the center of the 7*7 tile sprite buffers -; de: destination location -; a,c: sprite dimensions (in tiles of 8x8 each) -LoadUncompressedSpriteData:: ; 1672 (0:1672) - push de - and $f - ld [H_SPRITEWIDTH], a ; each byte contains 8 pixels (in 1bpp), so tiles=bytes for width - ld b, a - ld a, $7 - sub b ; 7-w - inc a ; 8-w - srl a ; (8-w)/2 ; horizontal center (in tiles, rounded up) - ld b, a - add a - add a - add a - sub b ; 7*((8-w)/2) ; skip for horizontal center (in tiles) - ld [H_SPRITEOFFSET], a - ld a, c - swap a - and $f - ld b, a - add a - add a - add a ; 8*tiles is height in bytes - ld [H_SPRITEHEIGHT], a ; $ff8c - ld a, $7 - sub b ; 7-h ; skip for vertical center (in tiles, relative to current column) - ld b, a - ld a, [H_SPRITEOFFSET] - add b ; 7*((8-w)/2) + 7-h ; combined overall offset (in tiles) - add a - add a - add a ; 8*(7*((8-w)/2) + 7-h) ; combined overall offset (in bytes) - ld [H_SPRITEOFFSET], a - xor a - ld [$4000], a - ld hl, S_SPRITEBUFFER0 - call ZeroSpriteBuffer ; zero buffer 0 - ld de, S_SPRITEBUFFER1 - ld hl, S_SPRITEBUFFER0 - call AlignSpriteDataCentered ; copy and align buffer 1 to 0 (containing the MSB of the 2bpp sprite) - ld hl, S_SPRITEBUFFER1 - call ZeroSpriteBuffer ; zero buffer 1 - ld de, S_SPRITEBUFFER2 - ld hl, S_SPRITEBUFFER1 - call AlignSpriteDataCentered ; copy and align buffer 2 to 1 (containing the LSB of the 2bpp sprite) - pop de - jp InterlaceMergeSpriteBuffers - -; copies and aligns the sprite data properly inside the sprite buffer -; sprite buffers are 7*7 tiles in size, the loaded sprite is centered within this area -AlignSpriteDataCentered:: ; 16c2 (0:16c2) - ld a, [H_SPRITEOFFSET] - ld b, $0 - ld c, a - add hl, bc - ld a, [H_SPRITEWIDTH] ; $ff8b -.columnLoop - push af - push hl - ld a, [H_SPRITEHEIGHT] ; $ff8c - ld c, a -.columnInnerLoop - ld a, [de] - inc de - ld [hli], a - dec c - jr nz, .columnInnerLoop - pop hl - ld bc, 7*8 ; 7 tiles - add hl, bc ; advance one full column - pop af - dec a - jr nz, .columnLoop - ret - -; fills the sprite buffer (pointed to in hl) with zeros -ZeroSpriteBuffer:: ; 16df (0:16df) - ld bc, SPRITEBUFFERSIZE -.nextByteLoop - xor a - ld [hli], a - dec bc - ld a, b - or c - jr nz, .nextByteLoop - ret - -; combines the (7*7 tiles, 1bpp) sprite chunks in buffer 0 and 1 into a 2bpp sprite located in buffer 1 through 2 -; in the resulting sprite, the rows of the two source sprites are interlaced -; de: output address -InterlaceMergeSpriteBuffers:: ; 16ea (0:16ea) - xor a - ld [$4000], a - push de - ld hl, S_SPRITEBUFFER2 + (SPRITEBUFFERSIZE - 1) ; destination: end of buffer 2 - ld de, S_SPRITEBUFFER1 + (SPRITEBUFFERSIZE - 1) ; source 2: end of buffer 1 - ld bc, S_SPRITEBUFFER0 + (SPRITEBUFFERSIZE - 1) ; source 1: end of buffer 0 - ld a, SPRITEBUFFERSIZE/2 ; $c4 - ld [H_SPRITEINTERLACECOUNTER], a ; $ff8b -.interlaceLoop - ld a, [de] - dec de - ld [hld], a ; write byte of source 2 - ld a, [bc] - dec bc - ld [hld], a ; write byte of source 1 - ld a, [de] - dec de - ld [hld], a ; write byte of source 2 - ld a, [bc] - dec bc - ld [hld], a ; write byte of source 1 - ld a, [H_SPRITEINTERLACECOUNTER] ; $ff8b - dec a - ld [H_SPRITEINTERLACECOUNTER], a ; $ff8b - jr nz, .interlaceLoop - ld a, [W_SPRITEFLIPPED] - and a - jr z, .notFlipped - ld bc, 2*SPRITEBUFFERSIZE - ld hl, S_SPRITEBUFFER1 -.swapLoop - swap [hl] ; if flipped swap nybbles in all bytes - inc hl - dec bc - ld a, b - or c - jr nz, .swapLoop -.notFlipped - pop hl - ld de, S_SPRITEBUFFER1 - ld c, (2*SPRITEBUFFERSIZE)/16 ; $31, number of 16 byte chunks to be copied - ld a, [H_LOADEDROMBANK] - ld b, a - jp CopyVideoData - -Underground_Coll:: ; 172f (0:172f) - INCBIN "gfx/tilesets/underground.tilecoll" -Overworld_Coll:: ; 1735 (0:1735) - INCBIN "gfx/tilesets/overworld.tilecoll" -RedsHouse1_Coll:: -RedsHouse2_Coll:: ; 1749 (0:1749) - INCBIN "gfx/tilesets/reds_house.tilecoll" -Mart_Coll -Pokecenter_Coll:: ; 1753 (0:1753) - INCBIN "gfx/tilesets/pokecenter.tilecoll" -Dojo_Coll:: -Gym_Coll:: ; 1759 (0:1759) - INCBIN "gfx/tilesets/gym.tilecoll" -Forest_Coll:: ; 1765 (0:1765) - INCBIN "gfx/tilesets/forest.tilecoll" -House_Coll:: ; 1775 (0:1775) - INCBIN "gfx/tilesets/house.tilecoll" -ForestGate_Coll:: -Museum_Coll:: -Gate_Coll:: ; 177f (0:177f) - INCBIN "gfx/tilesets/gate.tilecoll" -Ship_Coll:: ; 178a (0:178a) - INCBIN "gfx/tilesets/ship.tilecoll" -ShipPort_Coll:: ; 1795 (0:1795) - INCBIN "gfx/tilesets/ship_port.tilecoll" -Cemetery_Coll:: ; 179a (0:179a) - INCBIN "gfx/tilesets/cemetery.tilecoll" -Interior_Coll:: ; 17a2 (0:17a2) - INCBIN "gfx/tilesets/interior.tilecoll" -Cavern_Coll:: ; 17ac (0:17ac) - INCBIN "gfx/tilesets/cavern.tilecoll" -Lobby_Coll:: ; 17b8 (0:17b8) - INCBIN "gfx/tilesets/lobby.tilecoll" -Mansion_Coll:: ; 17c0 (0:17c0) - INCBIN "gfx/tilesets/mansion.tilecoll" -Lab_Coll:: ; 17ca (0:17ca) - INCBIN "gfx/tilesets/lab.tilecoll" -Club_Coll:: ; 17d1 (0:17d1) - INCBIN "gfx/tilesets/club.tilecoll" -Facility_Coll:: ; 17dd (0:17dd) - INCBIN "gfx/tilesets/facility.tilecoll" -Plateau_Coll:: ; 17f0 (0:17f0) - INCBIN "gfx/tilesets/plateau.tilecoll" - -; does the same thing as FarCopyData at 009D -; only difference is that it uses [$ff8b] instead of [$cee9] for a temp value -; copy bc bytes of data from a:hl to de -FarCopyData2:: ; 17f7 (0:17f7) - ld [$ff8b],a - ld a,[H_LOADEDROMBANK] - push af - ld a,[$ff8b] - ld [H_LOADEDROMBANK],a - ld [$2000],a - call CopyData - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -; does a far copy but the source is de and the destination is hl -; copy bc bytes of data from a:de to hl -FarCopyData3:: ; 180d (0:180d) - ld [$ff8b],a - ld a,[H_LOADEDROMBANK] - push af - ld a,[$ff8b] - ld [H_LOADEDROMBANK],a - ld [$2000],a - push hl - push de - push de - ld d,h - ld e,l - pop hl - call CopyData - pop de - pop hl - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -; copies each source byte to the destination twice (next to each other) -; copy bc source bytes from a:hl to de -FarCopyDataDouble:: ; 182b (0:182b) - ld [$ff8b],a - ld a,[H_LOADEDROMBANK] - push af - ld a,[$ff8b] - ld [H_LOADEDROMBANK],a - ld [$2000],a -.loop - ld a,[hli] - ld [de],a - inc de - ld [de],a - inc de - dec bc - ld a,c - or b - jr nz,.loop - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -; copy (c * 16) bytes from b:de to hl during V-blank -; transfers up to 128 bytes per V-blank -CopyVideoData:: ; 1848 (0:1848) - ld a,[H_AUTOBGTRANSFERENABLED] ; save auto-transfer enabled flag - push af - xor a - ld [H_AUTOBGTRANSFERENABLED],a ; disable auto-transfer while copying - ld a,[H_LOADEDROMBANK] - ld [$ff8b],a - ld a,b - ld [H_LOADEDROMBANK],a - ld [$2000],a - ld a,e - ld [H_VBCOPYSRC],a - ld a,d - ld [H_VBCOPYSRC + 1],a - ld a,l - ld [H_VBCOPYDEST],a - ld a,h - ld [H_VBCOPYDEST + 1],a -.loop - ld a,c - cp a,8 ; are there more than 128 bytes left to copy? - jr nc,.copyMaxSize ; only copy up to 128 bytes at a time -.copyRemainder - ld [H_VBCOPYSIZE],a - call DelayFrame ; wait for V-blank handler to perform the copy - ld a,[$ff8b] - ld [H_LOADEDROMBANK],a - ld [$2000],a - pop af - ld [H_AUTOBGTRANSFERENABLED],a ; restore original auto-transfer enabled flag - ret -.copyMaxSize - ld a,8 ; 128 bytes - ld [H_VBCOPYSIZE],a - call DelayFrame ; wait for V-blank handler to perform the copy - ld a,c - sub a,8 - ld c,a - jr .loop - -; copy (c * 8) source bytes from b:de to hl during V-blank -; copies each source byte to the destination twice (next to each other) -; transfers up to 64 source bytes per V-blank -CopyVideoDataDouble:: ; 1886 (0:1886) - ld a,[H_AUTOBGTRANSFERENABLED] ; save auto-transfer enabled flag - push af - xor a - ld [H_AUTOBGTRANSFERENABLED],a ; disable auto-transfer while copying - ld a,[H_LOADEDROMBANK] - ld [$ff8b],a - ld a,b - ld [H_LOADEDROMBANK],a - ld [$2000],a - ld a,e - ld [H_VBCOPYDOUBLESRC],a - ld a,d - ld [H_VBCOPYDOUBLESRC + 1],a - ld a,l - ld [H_VBCOPYDOUBLEDEST],a - ld a,h - ld [H_VBCOPYDOUBLEDEST + 1],a -.loop - ld a,c - cp a,8 ; are there more than 64 source bytes left to copy? - jr nc,.copyMaxSize ; only copy up to 64 source bytes at a time -.copyRemainder - ld [H_VBCOPYDOUBLESIZE],a - call DelayFrame ; wait for V-blank handler to perform the copy - ld a,[$ff8b] - ld [H_LOADEDROMBANK],a - ld [$2000],a - pop af - ld [H_AUTOBGTRANSFERENABLED],a ; restore original auto-transfer enabled flag - ret -.copyMaxSize - ld a,8 ; 64 source bytes - ld [H_VBCOPYDOUBLESIZE],a - call DelayFrame ; wait for V-blank handler to perform the copy - ld a,c - sub a,8 - ld c,a - jr .loop - -; clears an area of the screen -; INPUT: -; hl = address of upper left corner of the area -; b = height -; c = width -ClearScreenArea:: ; 18c4 (0:18c4) - ld a,$7F ; blank tile - ld de,20 ; screen width -.loop - push hl - push bc -.innerLoop - ld [hli],a - dec c - jr nz,.innerLoop - pop bc - pop hl - add hl,de - dec b - jr nz,.loop - ret - -; copies the screen tile buffer from WRAM to VRAM -; copying is done in 3 chunks of 6 rows each -; b: high byte of VRAM destination address ($98 or $9c for window tile map 0 or 1 resp.) -CopyScreenTileBufferToVRAM:: ; 18d6 (0:18d6) - ld c, $6 - ld hl, $0000 - ld de, wTileMap - call InitScreenTileBufferTransferParameters - call DelayFrame - ld hl, $600 - ld de, wTileMap + 20 * 6 ; $c418 - call InitScreenTileBufferTransferParameters - call DelayFrame - ld hl, $c00 - ld de, wTileMap + 20 * 12 ; $c490 - call InitScreenTileBufferTransferParameters - jp DelayFrame - -InitScreenTileBufferTransferParameters:: ; 18fc (0:18fc) - ld a, d - ld [H_VBCOPYBGSRC+1], a - call GetRowColAddressBgMap - ld a, l - ld [H_VBCOPYBGDEST], a ; $ffc3 - ld a, h - ld [H_VBCOPYBGDEST+1], a - ld a, c - ld [H_VBCOPYBGNUMROWS], a ; $ffc5 - ld a, e - ld [H_VBCOPYBGSRC], a ; $ffc1 - ret - -ClearScreen:: ; 190f (0:190f) -; clears all tiles in the tilemap, -; then wait three frames - ld bc,$0168 ; tilemap size - inc b - ld hl,wTileMap ; TILEMAP_START - ld a,$7F ; $7F is blank tile -.loop - ld [hli],a - dec c - jr nz,.loop - dec b - jr nz,.loop - jp Delay3 - -TextBoxBorder:: ; 1922 (0:1922) -; draw a text box -; upper-left corner at coordinates hl -; height b -; width c - - ; first row - push hl - ld a,"┌" - ld [hli],a - inc a ; horizontal border ─ - call NPlaceChar - inc a ; upper-right border ┐ - ld [hl],a - - ; middle rows - pop hl - ld de,20 - add hl,de ; skip the top row - -.PlaceRow - push hl - ld a,"│" - ld [hli],a - ld a," " - call NPlaceChar - ld [hl],"│" - - pop hl - ld de,20 - add hl,de ; move to next row - dec b - jr nz,.PlaceRow - - ; bottom row - ld a,"└" - ld [hli],a - ld a,"─" - call NPlaceChar - ld [hl],"┘" - ret -; -NPlaceChar:: ; 194f (0:194f) -; place a row of width c of identical characters - ld d,c -.loop - ld [hli],a - dec d - jr nz,.loop - ret - -PlaceString:: ; 1955 (0:1955) - push hl -PlaceNextChar:: ; 1956 (0:1956) - ld a,[de] - - cp "@" - jr nz,.PlaceText - ld b,h - ld c,l - pop hl - ret - -.PlaceText - cp $4E - jr nz,.next - ld bc,$0028 - ld a,[$FFF6] - bit 2,a - jr z,.next2 - ld bc,$14 -.next2 - pop hl - add hl,bc - push hl - jp Next19E8 - -.next - cp $4F - jr nz,.next3 - pop hl - FuncCoord 1, 16 ; $c4e1 - ld hl,Coord - push hl - jp Next19E8 - -.next3 ; Check against a dictionary - and a - jp z,Char00 - cp $4C - jp z,Char4C - cp $4B - jp z,Char4B - cp $51 - jp z,Char51 - cp $49 - jp z,Char49 - cp $52 - jp z,Char52 - cp $53 - jp z,Char53 - cp $54 - jp z,Char54 - cp $5B - jp z,Char5B - cp $5E - jp z,Char5E - cp $5C - jp z,Char5C - cp $5D - jp z,Char5D - cp $55 - jp z,Char55 - cp $56 - jp z,Char56 - cp $57 - jp z,Char57 - cp $58 - jp z,Char58 - cp $4A - jp z,Char4A - cp $5F - jp z,Char5F - cp $59 - jp z,Char59 - cp $5A - jp z,Char5A - ld [hli],a - call PrintLetterDelay -Next19E8:: ; 19e8 (0:19e8) - inc de - jp PlaceNextChar - -Char00:: ; 19ec (0:19ec) - ld b,h - ld c,l - pop hl - ld de,Char00Text - dec de - ret - -Char00Text:: ; 0x19f4 “%d ERROR.” - TX_FAR _Char00Text - db "@" - -Char52:: ; 0x19f9 player’s name - push de - ld de,W_PLAYERNAME - jr FinishDTE - -Char53:: ; 19ff (0:19ff) ; rival’s name - push de - ld de,W_RIVALNAME - jr FinishDTE - -Char5D:: ; 1a05 (0:1a05) ; TRAINER - push de - ld de,Char5DText - jr FinishDTE - -Char5C:: ; 1a0b (0:1a0b) ; TM - push de - ld de,Char5CText - jr FinishDTE - -Char5B:: ; 1a11 (0:1a11) ; PC - push de - ld de,Char5BText - jr FinishDTE - -Char5E:: ; 1a17 (0:1a17) ; ROCKET - push de - ld de,Char5EText - jr FinishDTE - -Char54:: ; 1a1d (0:1a1d) ; POKé - push de - ld de,Char54Text - jr FinishDTE - -Char56:: ; 1a23 (0:1a23) ; …… - push de - ld de,Char56Text - jr FinishDTE - -Char4A:: ; 1a29 (0:1a29) ; PKMN - push de - ld de,Char4AText - jr FinishDTE - -Char59:: ; 1a2f (0:1a2f) -; depending on whose turn it is, print -; enemy active monster’s name, prefixed with “Enemy ” -; or -; player active monster’s name -; (like Char5A but flipped) - ld a,[H_WHOSETURN] - xor 1 - jr MonsterNameCharsCommon - -Char5A:: ; 1a35 (0:1a35) -; depending on whose turn it is, print -; player active monster’s name -; or -; enemy active monster’s name, prefixed with “Enemy ” - ld a,[H_WHOSETURN] -MonsterNameCharsCommon:: ; 1a37 (0:1a37) - push de - and a - jr nz,.Enemy - ld de,W_PLAYERMONNAME ; player active monster name - jr FinishDTE - -.Enemy ; 1A40 - ; print “Enemy ” - ld de,Char5AText - call PlaceString - - ld h,b - ld l,c - ld de,W_ENEMYMONNAME ; enemy active monster name - -FinishDTE:: ; 1a4b (0:1a4b) - call PlaceString - ld h,b - ld l,c - pop de - inc de - jp PlaceNextChar - -Char5CText:: ; 1a55 (0:1a55) - db "TM@" -Char5DText:: ; 1a58 (0:1a58) - db "TRAINER@" -Char5BText:: ; 1a60 (0:1a60) - db "PC@" -Char5EText:: ; 1a63 (0:1a63) - db "ROCKET@" -Char54Text:: ; 1a6a (0:1a6a) - db "POKé@" -Char56Text:: ; 1a6f (0:1a6f) - db "……@" -Char5AText:: ; 1a72 (0:1a72) - db "Enemy @" -Char4AText:: ; 1a79 (0:1a79) - db $E1,$E2,"@" ; PKMN - -Char55:: ; 1a7c (0:1a7c) - push de - ld b,h - ld c,l - ld hl,Char55Text - call TextCommandProcessor - ld h,b - ld l,c - pop de - inc de - jp PlaceNextChar - -Char55Text:: ; 1a8c (0:1a8c) -; equivalent to Char4B - TX_FAR _Char55Text - db "@" - -Char5F:: ; 1a91 (0:1a91) -; ends a Pokédex entry - ld [hl],"." - pop hl - ret - -Char58:: ; 1a95 (0:1a95) - ld a,[$D12B] - cp 4 - jp z,Next1AA2 - ld a,$EE - FuncCoord 18, 16 ; $c4f2 - ld [Coord],a -Next1AA2:: ; 1aa2 (0:1aa2) - call ProtectedDelay3 - call ManualTextScroll - ld a,$7F - FuncCoord 18, 16 ; $c4f2 - ld [Coord],a -Char57:: ; 1aad (0:1aad) - pop hl - ld de,Char58Text - dec de - ret - -Char58Text:: ; 1ab3 (0:1ab3) - db "@" - -Char51:: ; 1ab4 (0:1ab4) - push de - ld a,$EE - FuncCoord 18, 16 ; $c4f2 - ld [Coord],a - call ProtectedDelay3 - call ManualTextScroll - FuncCoord 1, 13 ; $c4a5 - ld hl,Coord - ld bc,$0412 - call ClearScreenArea - ld c,$14 - call DelayFrames - pop de - FuncCoord 1, 14 ; $c4b9 - ld hl,Coord - jp Next19E8 - -Char49:: ; 1ad5 (0:1ad5) - push de - ld a,$EE - FuncCoord 18, 16 ; $c4f2 - ld [Coord],a - call ProtectedDelay3 - call ManualTextScroll - FuncCoord 1, 10 ; $c469 - ld hl,Coord - ld bc,$0712 - call ClearScreenArea - ld c,$14 - call DelayFrames - pop de - pop hl - FuncCoord 1, 11 ; $c47d - ld hl,Coord - push hl - jp Next19E8 - -Char4B:: ; 1af8 (0:1af8) - ld a,$EE - FuncCoord 18, 16 ; $c4f2 - ld [Coord],a - call ProtectedDelay3 - push de - call ManualTextScroll - pop de - ld a,$7F - FuncCoord 18, 16 ; $c4f2 - ld [Coord],a - ;fall through -Char4C:: ; 1b0a (0:1b0a) - push de - call Next1B18 - call Next1B18 - FuncCoord 1, 16 ; $c4e1 - ld hl,Coord - pop de - jp Next19E8 - -Next1B18:: ; 1b18 (0:1b18) - FuncCoord 0, 14 ; $c4b8 - ld hl,Coord - FuncCoord 0, 13 ; $c4a4 - ld de,Coord - ld b,$3C -.next - ld a,[hli] - ld [de],a - inc de - dec b - jr nz,.next - FuncCoord 1, 16 ; $c4e1 - ld hl,Coord - ld a,$7F - ld b,$12 -.next2 - ld [hli],a - dec b - jr nz,.next2 - - ; wait five frames - ld b,5 -.WaitFrame - call DelayFrame - dec b - jr nz,.WaitFrame - - ret - -ProtectedDelay3:: ; 1b3a (0:1b3a) - push bc - call Delay3 - pop bc - ret - -TextCommandProcessor:: ; 1b40 (0:1b40) - ld a,[$d358] - push af - set 1,a - ld e,a - ld a,[$fff4] - xor e - ld [$d358],a - ld a,c - ld [$cc3a],a - ld a,b - ld [$cc3b],a - -NextTextCommand:: ; 1b55 (0:1b55) - ld a,[hli] - cp a, "@" ; terminator - jr nz,.doTextCommand - pop af - ld [$d358],a - ret -.doTextCommand - push hl - cp a,$17 - jp z,TextCommand17 - cp a,$0e - jp nc,TextCommand0B ; if a != 0x17 and a >= 0xE, go to command 0xB -; if a < 0xE, use a jump table - ld hl,TextCommandJumpTable - push bc - add a - ld b,$00 - ld c,a - add hl,bc - pop bc - ld a,[hli] - ld h,[hl] - ld l,a - jp [hl] - -; draw box -; 04AAAABBCC -; AAAA = address of upper left corner -; BB = height -; CC = width -TextCommand04:: ; 1b78 (0:1b78) - pop hl - ld a,[hli] - ld e,a - ld a,[hli] - ld d,a - ld a,[hli] - ld b,a - ld a,[hli] - ld c,a - push hl - ld h,d - ld l,e - call TextBoxBorder - pop hl - jr NextTextCommand - -; place string inline -; 00{string} -TextCommand00:: ; 1b8a (0:1b8a) - pop hl - ld d,h - ld e,l - ld h,b - ld l,c - call PlaceString - ld h,d - ld l,e - inc hl - jr NextTextCommand - -; place string from RAM -; 01AAAA -; AAAA = address of string -TextCommand01:: ; 1b97 (0:1b97) - pop hl - ld a,[hli] - ld e,a - ld a,[hli] - ld d,a - push hl - ld h,b - ld l,c - call PlaceString - pop hl - jr NextTextCommand - -; print BCD number -; 02AAAABB -; AAAA = address of BCD number -; BB -; bits 0-4 = length in bytes -; bits 5-7 = unknown flags -TextCommand02:: ; 1ba5 (0:1ba5) - pop hl - ld a,[hli] - ld e,a - ld a,[hli] - ld d,a - ld a,[hli] - push hl - ld h,b - ld l,c - ld c,a - call PrintBCDNumber - ld b,h - ld c,l - pop hl - jr NextTextCommand - -; repoint destination address -; 03AAAA -; AAAA = new destination address -TextCommand03:: ; 1bb7 (0:1bb7) - pop hl - ld a,[hli] - ld [$cc3a],a - ld c,a - ld a,[hli] - ld [$cc3b],a - ld b,a - jp NextTextCommand - -; repoint destination to second line of dialogue text box -; 05 -; (no arguments) -TextCommand05:: ; 1bc5 (0:1bc5) - pop hl - FuncCoord 1, 16 ; $c4e1 - ld bc,Coord ; address of second line of dialogue text box - jp NextTextCommand - -; blink arrow and wait for A or B to be pressed -; 06 -; (no arguments) -TextCommand06:: ; 1bcc (0:1bcc) - ld a,[W_ISLINKBATTLE] - cp a,$04 - jp z,TextCommand0D - ld a,$ee ; down arrow - FuncCoord 18, 16 ; $c4f2 - ld [Coord],a ; place down arrow in lower right corner of dialogue text box - push bc - call ManualTextScroll ; blink arrow and wait for A or B to be pressed - pop bc - ld a," " - FuncCoord 18, 16 ; $c4f2 - ld [Coord],a ; overwrite down arrow with blank space - pop hl - jp NextTextCommand - -; scroll text up one line -; 07 -; (no arguments) -TextCommand07:: ; 1be7 (0:1be7) - ld a," " - FuncCoord 18, 16 ; $c4f2 - ld [Coord],a ; place blank space in lower right corner of dialogue text box - call Next1B18 ; scroll up text - call Next1B18 - pop hl - FuncCoord 1, 16 ; $c4e1 - ld bc,Coord ; address of second line of dialogue text box - jp NextTextCommand - -; execute asm inline -; 08{code} -TextCommand08:: ; 1bf9 (0:1bf9) - pop hl - ld de,NextTextCommand - push de ; return address - jp [hl] - -; print decimal number (converted from binary number) -; 09AAAABB -; AAAA = address of number -; BB -; bits 0-3 = how many digits to display -; bits 4-7 = how long the number is in bytes -TextCommand09:: ; 1bff (0:1bff) - pop hl - ld a,[hli] - ld e,a - ld a,[hli] - ld d,a - ld a,[hli] - push hl - ld h,b - ld l,c - ld b,a - and a,$0f - ld c,a - ld a,b - and a,$f0 - swap a - set 6,a - ld b,a - call PrintNumber - ld b,h - ld c,l - pop hl - jp NextTextCommand - -; wait half a second if the user doesn't hold A or B -; 0A -; (no arguments) -TextCommand0A:: ; 1c1d (0:1c1d) - push bc - call GetJoypadState - ld a,[H_CURRENTPRESSEDBUTTONS] - and a,%00000011 ; A and B buttons - jr nz,.skipDelay - ld c,30 - call DelayFrames -.skipDelay - pop bc - pop hl - jp NextTextCommand - -; plays sounds -; this actually handles various command ID's, not just 0B -; (no arguments) -TextCommand0B:: ; 1c31 (0:1c31) - pop hl - push bc - dec hl - ld a,[hli] - ld b,a ; b = command number that got us here - push hl - ld hl,TextCommandSounds -.loop - ld a,[hli] - cp b - jr z,.matchFound - inc hl - jr .loop -.matchFound - cp a,$14 - jr z,.pokemonCry - cp a,$15 - jr z,.pokemonCry - cp a,$16 - jr z,.pokemonCry - ld a,[hl] - call PlaySound - call WaitForSoundToFinish - pop hl - pop bc - jp NextTextCommand -.pokemonCry - push de - ld a,[hl] - call PlayCry - pop de - pop hl - pop bc - jp NextTextCommand - -; format: text command ID, sound ID or cry ID -TextCommandSounds:: ; 1c64 (0:1c64) - db $0B,(SFX_02_3a - SFX_Headers_02) / 3 - db $12,(SFX_02_46 - SFX_Headers_02) / 3 - db $0E,(SFX_02_41 - SFX_Headers_02) / 3 - db $0F,(SFX_02_3a - SFX_Headers_02) / 3 - db $10,(SFX_02_3b - SFX_Headers_02) / 3 - db $11,(SFX_02_42 - SFX_Headers_02) / 3 - db $13,(SFX_02_44 - SFX_Headers_02) / 3 - db $14,NIDORINA ; used in OakSpeech - db $15,PIDGEOT ; used in SaffronCityText12 - db $16,DEWGONG ; unused? - -; draw ellipses -; 0CAA -; AA = number of ellipses to draw -TextCommand0C:: ; 1c78 (0:1c78) - pop hl - ld a,[hli] - ld d,a - push hl - ld h,b - ld l,c -.loop - ld a,$75 ; ellipsis - ld [hli],a - push de - call GetJoypadState - pop de - ld a,[H_CURRENTPRESSEDBUTTONS] ; joypad state - and a,%00000011 ; is A or B button pressed? - jr nz,.skipDelay ; if so, skip the delay - ld c,10 - call DelayFrames -.skipDelay - dec d - jr nz,.loop - ld b,h - ld c,l - pop hl - jp NextTextCommand - -; wait for A or B to be pressed -; 0D -; (no arguments) -TextCommand0D:: ; 1c9a (0:1c9a) - push bc - call ManualTextScroll ; wait for A or B to be pressed - pop bc - pop hl - jp NextTextCommand - -; process text commands in another ROM bank -; 17AAAABB -; AAAA = address of text commands -; BB = bank -TextCommand17:: ; 1ca3 (0:1ca3) - pop hl - ld a,[H_LOADEDROMBANK] - push af - ld a,[hli] - ld e,a - ld a,[hli] - ld d,a - ld a,[hli] - ld [H_LOADEDROMBANK],a - ld [$2000],a - push hl - ld l,e - ld h,d - call TextCommandProcessor - pop hl - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - jp NextTextCommand - -TextCommandJumpTable:: ; 1cc1 (0:1cc1) - dw TextCommand00 - dw TextCommand01 - dw TextCommand02 - dw TextCommand03 - dw TextCommand04 - dw TextCommand05 - dw TextCommand06 - dw TextCommand07 - dw TextCommand08 - dw TextCommand09 - dw TextCommand0A - dw TextCommand0B - dw TextCommand0C - dw TextCommand0D - -; this function seems to be used only once -; it store the address of a row and column of the VRAM background map in hl -; INPUT: h - row, l - column, b - high byte of background tile map address in VRAM -GetRowColAddressBgMap:: ; 1cdd (0:1cdd) - xor a - srl h - rr a - srl h - rr a - srl h - rr a - or l - ld l,a - ld a,b - or h - ld h,a - ret - -; clears a VRAM background map with blank space tiles -; INPUT: h - high byte of background tile map address in VRAM -ClearBgMap:: ; 1cf0 (0:1cf0) - ld a," " - jr .next - ld a,l -.next - ld de,$400 ; size of VRAM background map - ld l,e -.loop - ld [hli],a - dec e - jr nz,.loop - dec d - jr nz,.loop - ret - -; When the player takes a step, a row or column of 2x2 tile blocks at the edge -; of the screen toward which they moved is exposed and has to be redrawn. -; This function does the redrawing. -RedrawExposedScreenEdge:: ; 1d01 (0:1d01) - ld a,[H_SCREENEDGEREDRAW] - and a - ret z - ld b,a - xor a - ld [H_SCREENEDGEREDRAW],a - dec b - jr nz,.redrawRow -.redrawColumn - ld hl,wScreenEdgeTiles - ld a,[H_SCREENEDGEREDRAWADDR] - ld e,a - ld a,[H_SCREENEDGEREDRAWADDR + 1] - ld d,a - ld c,18 ; screen height -.loop1 - ld a,[hli] - ld [de],a - inc de - ld a,[hli] - ld [de],a - ld a,31 - add e - ld e,a - jr nc,.noCarry - inc d -.noCarry -; the following 4 lines wrap us from bottom to top if necessary - ld a,d - and a,$03 - or a,$98 - ld d,a - dec c - jr nz,.loop1 - xor a - ld [H_SCREENEDGEREDRAW],a - ret -.redrawRow - ld hl,wScreenEdgeTiles - ld a,[H_SCREENEDGEREDRAWADDR] - ld e,a - ld a,[H_SCREENEDGEREDRAWADDR + 1] - ld d,a - push de - call .drawHalf ; draw upper half - pop de - ld a,32 ; width of VRAM background map - add e - ld e,a - ; draw lower half -.drawHalf - ld c,10 -.loop2 - ld a,[hli] - ld [de],a - inc de - ld a,[hli] - ld [de],a - ld a,e - inc a -; the following 6 lines wrap us from the right edge to the left edge if necessary - and a,$1f - ld b,a - ld a,e - and a,$e0 - or b - ld e,a - dec c - jr nz,.loop2 - ret - -; This function automatically transfers tile number data from the tile map at -; wTileMap to VRAM during V-blank. Note that it only transfers one third of the -; background per V-blank. It cycles through which third it draws. -; This transfer is turned off when walking around the map, but is turned -; on when talking to sprites, battling, using menus, etc. This is because -; the above function, RedrawExposedScreenEdge, is used when walking to -; improve efficiency. -AutoBgMapTransfer:: ; 1d57 (0:1d57) - ld a,[H_AUTOBGTRANSFERENABLED] - and a - ret z - ld hl,[sp + 0] - ld a,h - ld [H_SPTEMP],a - ld a,l - ld [H_SPTEMP + 1],a ; save stack pinter - ld a,[H_AUTOBGTRANSFERPORTION] - and a - jr z,.transferTopThird - dec a - jr z,.transferMiddleThird -.transferBottomThird - FuncCoord 0,12 - ld hl,Coord - ld sp,hl - ld a,[H_AUTOBGTRANSFERDEST + 1] - ld h,a - ld a,[H_AUTOBGTRANSFERDEST] - ld l,a - ld de,(12 * 32) - add hl,de - xor a ; TRANSFERTOP - jr .doTransfer -.transferTopThird - FuncCoord 0,0 - ld hl,Coord - ld sp,hl - ld a,[H_AUTOBGTRANSFERDEST + 1] - ld h,a - ld a,[H_AUTOBGTRANSFERDEST] - ld l,a - ld a,TRANSFERMIDDLE - jr .doTransfer -.transferMiddleThird - FuncCoord 0,6 - ld hl,Coord - ld sp,hl - ld a,[H_AUTOBGTRANSFERDEST + 1] - ld h,a - ld a,[H_AUTOBGTRANSFERDEST] - ld l,a - ld de,(6 * 32) - add hl,de - ld a,TRANSFERBOTTOM -.doTransfer - ld [H_AUTOBGTRANSFERPORTION],a ; store next portion - ld b,6 - -; unrolled loop and using pop for speed -TransferBgRows:: ; 1d9e (0:1d9e) - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - ld a,13 - add l - ld l,a - jr nc,.noCarry - inc h -.noCarry - dec b - jr nz,TransferBgRows - ld a,[H_SPTEMP] - ld h,a - ld a,[H_SPTEMP + 1] - ld l,a - ld sp,hl ; restore stack pointer - ret - -; Copies [H_VBCOPYBGNUMROWS] rows from H_VBCOPYBGSRC to H_VBCOPYBGDEST. -; If H_VBCOPYBGSRC is XX00, the transfer is disabled. -VBlankCopyBgMap:: ; 1de1 (0:1de1) - ld a,[H_VBCOPYBGSRC] ; doubles as enabling byte - and a - ret z - ld hl,[sp + 0] - ld a,h - ld [H_SPTEMP],a - ld a,l - ld [H_SPTEMP + 1],a ; save stack pointer - ld a,[H_VBCOPYBGSRC] - ld l,a - ld a,[H_VBCOPYBGSRC + 1] - ld h,a - ld sp,hl - ld a,[H_VBCOPYBGDEST] - ld l,a - ld a,[H_VBCOPYBGDEST + 1] - ld h,a - ld a,[H_VBCOPYBGNUMROWS] - ld b,a - xor a - ld [H_VBCOPYBGSRC],a ; disable transfer so it doesn't continue next V-blank - jr TransferBgRows - -; This function copies ([H_VBCOPYDOUBLESIZE] * 8) source bytes -; from H_VBCOPYDOUBLESRC to H_VBCOPYDOUBLEDEST. -; It copies each source byte to the destination twice (next to each other). -; The function updates the source and destination addresses, so the transfer -; can be continued easily by repeatingly calling this function. -VBlankCopyDouble:: ; 1e02 (0:1e02) - ld a,[H_VBCOPYDOUBLESIZE] - and a ; are there any bytes to copy? - ret z - ld hl,[sp + 0] - ld a,h - ld [H_SPTEMP],a - ld a,l - ld [H_SPTEMP + 1],a ; save stack pointer - ld a,[H_VBCOPYDOUBLESRC] - ld l,a - ld a,[H_VBCOPYDOUBLESRC + 1] - ld h,a - ld sp,hl - ld a,[H_VBCOPYDOUBLEDEST] - ld l,a - ld a,[H_VBCOPYDOUBLEDEST + 1] - ld h,a - ld a,[H_VBCOPYDOUBLESIZE] - ld b,a - xor a - ld [H_VBCOPYDOUBLESIZE],a ; disable transfer so it doesn't continue next V-blank -.loop - pop de - ld [hl],e - inc l - ld [hl],e - inc l - ld [hl],d - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],e - inc l - ld [hl],d - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],e - inc l - ld [hl],d - inc l - ld [hl],d - inc l - 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,.loop - ld a,l - ld [H_VBCOPYDOUBLEDEST],a - ld a,h - ld [H_VBCOPYDOUBLEDEST + 1],a ; update destination address - ld hl,[sp + 0] - ld a,l - ld [H_VBCOPYDOUBLESRC],a - ld a,h - ld [H_VBCOPYDOUBLESRC + 1],a ; update source address - ld a,[H_SPTEMP] - ld h,a - ld a,[H_SPTEMP + 1] - ld l,a - ld sp,hl ; restore stack pointer - ret - -; Copies ([H_VBCOPYSIZE] * 16) bytes from H_VBCOPYSRC to H_VBCOPYDEST. -; The function updates the source and destination addresses, so the transfer -; can be continued easily by repeatingly calling this function. -VBlankCopy:: ; 1e5e (0:1e5e) - ld a,[H_VBCOPYSIZE] - and a ; are there any bytes to copy? - ret z - ld hl,[sp + 0] - ld a,h - ld [H_SPTEMP],a - ld a,l - ld [H_SPTEMP + 1],a ; save stack pointer - ld a,[H_VBCOPYSRC] - ld l,a - ld a,[H_VBCOPYSRC + 1] - ld h,a - ld sp,hl - ld a,[H_VBCOPYDEST] - ld l,a - ld a,[H_VBCOPYDEST + 1] - ld h,a - ld a,[H_VBCOPYSIZE] - ld b,a - xor a - ld [H_VBCOPYSIZE],a ; disable transfer so it doesn't continue next V-blank -.loop - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc l - pop de - ld [hl],e - inc l - ld [hl],d - inc hl - dec b - jr nz,.loop - ld a,l - ld [H_VBCOPYDEST],a - ld a,h - ld [H_VBCOPYDEST + 1],a - ld hl,[sp + 0] - ld a,l - ld [H_VBCOPYSRC],a - ld a,h - ld [H_VBCOPYSRC + 1],a - ld a,[H_SPTEMP] - ld h,a - ld a,[H_SPTEMP + 1] - ld l,a - ld sp,hl ; restore stack pointer - ret - -; This function updates the moving water and flower background tiles. -UpdateMovingBgTiles:: ; 1ebe (0:1ebe) - ld a,[$ffd7] - and a - ret z - ld a,[$ffd8] - inc a - ld [$ffd8],a - cp a,20 - ret c - cp a,21 - jr z,.updateFlowerTile - ld hl,$9140 ; water tile pattern VRAM location - ld c,16 ; number of bytes in a tile pattern - ld a,[$d085] - inc a - and a,$07 - ld [$d085],a - and a,$04 - jr nz,.rotateWaterLeftLoop -.rotateWaterRightloop - ld a,[hl] - rrca - ld [hli],a - dec c - jr nz,.rotateWaterRightloop - jr .done -.rotateWaterLeftLoop - ld a,[hl] - rlca - ld [hli],a - dec c - jr nz,.rotateWaterLeftLoop -.done - ld a,[$ffd7] - rrca - ret nc - xor a - ld [$ffd8],a - ret -.updateFlowerTile - xor a - ld [$ffd8],a - ld a,[$d085] - and a,$03 - cp a,2 - ld hl,FlowerTilePattern1 - jr c,.writeTilePatternToVram - ld hl,FlowerTilePattern2 - jr z,.writeTilePatternToVram - ld hl,FlowerTilePattern3 -.writeTilePatternToVram - ld de,$9030 ; flower tile pattern VRAM location - ld c,16 ; number of bytes in a tile pattern -.flowerTileLoop - ld a,[hli] - ld [de],a - inc de - dec c - jr nz,.flowerTileLoop - ret - -FlowerTilePattern1:: ; 1f19 (0:1f19) - INCBIN "gfx/tilesets/flower/flower1.2bpp" - -FlowerTilePattern2:: ; 1f29 (0:1f29) - INCBIN "gfx/tilesets/flower/flower2.2bpp" - -FlowerTilePattern3:: ; 1f39 (0:1f39) - INCBIN "gfx/tilesets/flower/flower3.2bpp" - -SoftReset:: ; 1f49 (0:1f49) - call StopAllSounds - call GBPalWhiteOut - ld c, $20 - call DelayFrames - ;fall through - -; initialization code -; explanation for %11100011 (value stored in rLCDC) -; * LCD enabled -; * Window tile map at $9C00 -; * Window display enabled -; * BG and window tile data at $8800 -; * BG tile map at $9800 -; * 8x8 OBJ size -; * OBJ display enabled -; * BG display enabled -InitGame:: ; 1f54 (0:1f54) - di -; zero I/O registers - xor a - ld [$ff0f],a - ld [$ffff],a - ld [$ff43],a - ld [$ff42],a - ld [$ff01],a - ld [$ff02],a - ld [$ff4b],a - ld [$ff4a],a - ld [$ff06],a - ld [$ff07],a - ld [$ff47],a - ld [$ff48],a - ld [$ff49],a - ld a,%10000000 ; enable LCD - ld [rLCDC],a - call DisableLCD ; why enable then disable? - ld sp,$dfff ; initialize stack pointer - ld hl,$c000 ; start of WRAM - ld bc,$2000 ; size of WRAM -.zeroWramLoop - ld [hl],0 - inc hl - dec bc - ld a,b - or c - jr nz,.zeroWramLoop - call ZeroVram - ld hl,$ff80 - ld bc,$007f - call FillMemory ; zero HRAM - call CleanLCD_OAM ; this is unnecessary since it was already cleared above - ld a,Bank(WriteDMACodeToHRAM) - ld [H_LOADEDROMBANK],a - ld [$2000],a - call WriteDMACodeToHRAM ; copy DMA code to HRAM - xor a - ld [$ffd7],a - ld [$ff41],a - ld [$ffae],a - ld [$ffaf],a - ld [$ff0f],a - ld a,%00001101 ; enable V-blank, timer, and serial interrupts - ld [rIE],a - ld a,$90 ; put the window off the screen - ld [$ffb0],a - ld [rWY],a - ld a,$07 - ld [rWX],a - ld a,$ff - ld [$ffaa],a - ld h,$98 - call ClearBgMap ; fill $9800-$9BFF (BG tile map) with $7F tiles - ld h,$9c - call ClearBgMap ; fill $9C00-$9FFF (Window tile map) with $7F tiles - ld a,%11100011 - ld [rLCDC],a ; enabled LCD - ld a,$10 - ld [H_SOFTRESETCOUNTER],a - call StopAllSounds - ei - ld a,$40 - call Predef ; SGB border - ld a,$1f - ld [$c0ef],a - ld [$c0f0],a - ld a,$9c - ld [$ffbd],a - xor a - ld [$ffbc],a - dec a - ld [$cfcb],a - ld a,$32 - call Predef ; display the copyrights, GameFreak logo, and battle animation - call DisableLCD - call ZeroVram - call GBPalNormal - call CleanLCD_OAM - ld a,%11100011 - ld [rLCDC],a ; enable LCD - jp SetDefaultNamesBeforeTitlescreen - -; zeroes all VRAM -ZeroVram:: ; 2004 (0:2004) - ld hl,$8000 - ld bc,$2000 - xor a - jp FillMemory - -; immediately stops all sounds -StopAllSounds:: ; 200e (0:200e) - ld a, Bank(Func_9876) - ld [$c0ef], a - ld [$c0f0], a - xor a - ld [wMusicHeaderPointer], a - ld [$c0ee], a - ld [$cfca], a - dec a - jp PlaySound - -VBlank:: ; 2024 (0:2024) - push af - push bc - push de - push hl - ld a,[H_LOADEDROMBANK] ; current ROM bank - ld [$d122],a - ld a,[$ffae] - ld [rSCX],a - ld a,[$ffaf] - ld [rSCY],a - ld a,[$d0a0] - and a - jr nz,.doVramTransfers - ld a,[$ffb0] - ld [rWY],a -.doVramTransfers - call AutoBgMapTransfer - call VBlankCopyBgMap - call RedrawExposedScreenEdge - call VBlankCopy - call VBlankCopyDouble - call UpdateMovingBgTiles - call $ff80 ; OAM DMA - ld a,Bank(PrepareOAMData) - ld [H_LOADEDROMBANK],a - ld [$2000],a - call PrepareOAMData ; update OAM buffer with current sprite data - call GenRandom - ld a,[H_VBLANKOCCURRED] - and a - jr z,.next - xor a - ld [H_VBLANKOCCURRED],a -.next - ld a,[H_FRAMECOUNTER] - and a - jr z,.handleMusic - dec a - ld [H_FRAMECOUNTER],a -.handleMusic - call Func_28cb - ld a,[$c0ef] ; music ROM bank - ld [H_LOADEDROMBANK],a - ld [$2000],a - cp a,$02 - jr nz,.checkIfBank08 -.bank02 - call Func_9103 - jr .afterMusic -.checkIfBank08 - cp a,$08 - jr nz,.bank1F -.bank08 - call Func_2136e - call Func_21879 - jr .afterMusic -.bank1F - call Func_7d177 -.afterMusic - callba Func_18dee ; keep track of time played - ld a,[$fff9] - and a - call z,ReadJoypadRegister - ld a,[$d122] - ld [H_LOADEDROMBANK],a - ld [$2000],a - pop hl - pop de - pop bc - pop af - reti - -DelayFrame:: ; 20af (0:20af) -; delay for one frame - ld a,1 - ld [H_VBLANKOCCURRED],a +NPC_SPRITES_1 EQU $4 +NPC_SPRITES_2 EQU $5 -; wait for the next Vblank, halting to conserve battery -.halt - db $76 ; XXX this is a hack--rgbasm adds a nop after this instr even when ints are enabled - ld a,[H_VBLANKOCCURRED] - and a - jr nz,.halt - ret - -; These routines manage gradual fading -; (e.g., entering a doorway) -LoadGBPal:: ; 20ba (0:20ba) - ld a,[$d35d] ;tells if cur.map is dark (requires HM5_FLASH?) - ld b,a - ld hl,GBPalTable_00 ;16 - ld a,l - sub b - ld l,a - jr nc,.jr0 - dec h -.jr0 - ld a,[hli] - ld [rBGP],a - ld a,[hli] - ld [rOBP0],a - ld a,[hli] - ld [rOBP1],a - ret - -GBFadeOut1:: ; 20d1 (0:20d1) - ld hl,IncGradGBPalTable_01 ;0d - ld b,$04 - jr GBFadeOutCommon - -GBFadeOut2:: ; 20d8 (0:20d8) - ld hl,IncGradGBPalTable_02 ;1c - ld b,$03 - -GBFadeOutCommon:: ; 20dd (0:20dd) - ld a,[hli] - ld [rBGP],a - ld a,[hli] - ld [rOBP0],a - ld a,[hli] - ld [rOBP1],a - ld c,8 - call DelayFrames - dec b - jr nz,GBFadeOutCommon - ret - -GBFadeIn1:: ; 20ef (0:20ef) - ld hl,DecGradGBPalTable_01 ;18 - ld b,$04 - jr GBFadeInCommon - -GBFadeIn2:: ; 20f6 (0:20f6) - ld hl,DecGradGBPalTable_02 ;21 - ld b,$03 - -GBFadeInCommon:: ; 20fb (0:20fb) - ld a,[hld] - ld [rOBP1],a - ld a,[hld] - ld [rOBP0],a - ld a,[hld] - ld [rBGP],a - ld c,8 - call DelayFrames - dec b - jr nz,GBFadeInCommon - ret - -IncGradGBPalTable_01:: ; 210d (0:210d) - db %11111111 ;BG Pal - db %11111111 ;OBJ Pal 1 - db %11111111 ;OBJ Pal 2 - ;and so on... - db %11111110 - db %11111110 - db %11111000 - - db %11111001 - db %11100100 - db %11100100 -GBPalTable_00:: ; 2116 (0:2116) - db %11100100 - db %11010000 -DecGradGBPalTable_01:: ; 2118 (0:2118) - db %11100000 - ;19 - db %11100100 - db %11010000 - db %11100000 -IncGradGBPalTable_02:: ; 211c (0:211c) - db %10010000 - db %10000000 - db %10010000 - - db %01000000 - db %01000000 -DecGradGBPalTable_02:: ; 2121 (0:2121) - db %01000000 - - db %00000000 - db %00000000 - db %00000000 - -Serial:: ; 2125 (0:2125) - push af - push bc - push de - push hl - ld a, [$ffaa] - inc a - jr z, .asm_2142 - ld a, [$ff01] - ld [$ffad], a - ld a, [$ffac] - ld [$ff01], a - ld a, [$ffaa] - cp $2 - jr z, .asm_2162 - ld a, $80 - ld [$ff02], a - jr .asm_2162 -.asm_2142 - ld a, [$ff01] - ld [$ffad], a - ld [$ffaa], a - cp $2 - jr z, .asm_215f - xor a - ld [$ff01], a - ld a, $3 - ld [rDIV], a ; $ff04 -.asm_2153 - ld a, [rDIV] ; $ff04 - bit 7, a - jr nz, .asm_2153 - ld a, $80 - ld [$ff02], a - jr .asm_2162 -.asm_215f - xor a - ld [$ff01], a -.asm_2162 - ld a, $1 - ld [$ffa9], a - ld a, $fe - ld [$ffac], a - pop hl - pop de - pop bc - pop af - reti - -Func_216f:: ; 216f (0:216f) - ld a, $1 - ld [$ffab], a -.asm_2173 - ld a, [hl] - ld [$ffac], a - call Func_219a - push bc - ld b, a - inc hl - ld a, $30 -.asm_217e - dec a - jr nz, .asm_217e - ld a, [$ffab] - and a - ld a, b - pop bc - jr z, .asm_2192 - dec hl - cp $fd - jr nz, .asm_2173 - xor a - ld [$ffab], a - jr .asm_2173 -.asm_2192 - ld [de], a - inc de - dec bc - ld a, b - or c - jr nz, .asm_2173 - ret - -Func_219a:: ; 219a (0:219a) - xor a - ld [$ffa9], a - ld a, [$ffaa] - cp $2 - jr nz, .asm_21a7 - ld a, $81 - ld [$ff02], a -.asm_21a7 - ld a, [$ffa9] - and a - jr nz, .asm_21f1 - ld a, [$ffaa] - cp $1 - jr nz, .asm_21cc - call Func_2237 - jr z, .asm_21cc - call Func_2231 - push hl - ld hl, $cc48 - inc [hl] - jr nz, .asm_21c3 - dec hl - inc [hl] -.asm_21c3 - pop hl - call Func_2237 - jr nz, .asm_21a7 - jp Func_223f -.asm_21cc - ld a, [rIE] ; $ffff - and $f - cp $8 - jr nz, .asm_21a7 - ld a, [W_NUMHITS] ; $d074 - dec a - ld [W_NUMHITS], a ; $d074 - jr nz, .asm_21a7 - ld a, [$d075] - dec a - ld [$d075], a - jr nz, .asm_21a7 - ld a, [$ffaa] - cp $1 - jr z, .asm_21f1 - ld a, $ff -.asm_21ee - dec a - jr nz, .asm_21ee -.asm_21f1 - xor a - ld [$ffa9], a - ld a, [rIE] ; $ffff - and $f - sub $8 - jr nz, .asm_2204 - ld [W_NUMHITS], a ; $d074 - ld a, $50 - ld [$d075], a -.asm_2204 - ld a, [$ffad] - cp $fe - ret nz - call Func_2237 - jr z, .asm_221f - push hl - ld hl, $cc48 - ld a, [hl] - dec a - ld [hld], a - inc a - jr nz, .asm_2219 - dec [hl] -.asm_2219 - pop hl - call Func_2237 - jr z, Func_223f -.asm_221f - ld a, [rIE] ; $ffff - and $f - cp $8 - ld a, $fe - ret z - ld a, [hl] - ld [$ffac], a - call DelayFrame - jp Func_219a - -Func_2231:: ; 2231 (0:2231) - ld a, $f -.asm_2233 - dec a - jr nz, .asm_2233 - ret - -Func_2237:: ; 2237 (0:2237) - push hl - ld hl, $cc47 - ld a, [hli] - or [hl] - pop hl - ret - -Func_223f:: ; 223f (0:223f) - dec a - ld [$cc47], a - ld [$cc48], a - ret - -Func_2247:: ; 2247 (0:2247) - ld hl, $cc42 - ld de, $cc3d - ld c, $2 - ld a, $1 - ld [$ffab], a -.asm_2253 - call DelayFrame - ld a, [hl] - ld [$ffac], a - call Func_219a - ld b, a - inc hl - ld a, [$ffab] - and a - ld a, $0 - ld [$ffab], a - jr nz, .asm_2253 - ld a, b - ld [de], a - inc de - dec c - jr nz, .asm_2253 - ret +GFX EQU $4 -Func_226e:: ; 226e (0:226e) - call SaveScreenTilesToBuffer1 - callab PrintWaitingText - call Func_227f - jp LoadScreenTilesFromBuffer1 +PICS_1 EQU $9 +PICS_2 EQU $A +PICS_3 EQU $B +PICS_4 EQU $C +PICS_5 EQU $D -Func_227f:: ; 227f (0:227f) - ld a, $ff - ld [$cc3e], a -.asm_2284 - call Func_22c3 - call DelayFrame - call Func_2237 - jr z, .asm_22a0 - push hl - ld hl, $cc48 - dec [hl] - jr nz, .asm_229f - dec hl - dec [hl] - jr nz, .asm_229f - pop hl - xor a - jp Func_223f -.asm_229f - pop hl -.asm_22a0 - ld a, [$cc3e] - inc a - jr z, .asm_2284 - ld b, $a -.asm_22a8 - call DelayFrame - call Func_22c3 - dec b - jr nz, .asm_22a8 - ld b, $a -.asm_22b3 - call DelayFrame - call Func_22ed - dec b - jr nz, .asm_22b3 - ld a, [$cc3e] - ld [$cc3d], a - ret -Func_22c3:: ; 22c3 (0:22c3) - call asm_22d7 - ld a, [$cc42] - add $60 - ld [$ffac], a - ld a, [$ffaa] - cp $2 - jr nz, asm_22d7 - ld a, $81 - ld [$ff02], a -asm_22d7:: ; 22d7 (0:22d7) - ld a, [$ffad] - ld [$cc3d], a - and $f0 - cp $60 - ret nz - xor a - ld [$ffad], a - ld a, [$cc3d] - and $f - ld [$cc3e], a - ret +INCLUDE "home.asm" -Func_22ed:: ; 22ed (0:22ed) - xor a - ld [$ffac], a - ld a, [$ffaa] - cp $2 - ret nz - ld a, $81 - ld [$ff02], a - ret - -Func_22fa:: ; 22fa (0:22fa) - ld a, $2 - ld [$ff01], a - xor a - ld [$ffad], a - ld a, $80 - ld [$ff02], a - ret - -; timer interrupt is apparently not invoked anyway -Timer:: ; 2306 (0:2306) - reti - -Func_2307:: ; 2307 (0:2307) - call WaitForSoundToFinish - xor a - ld c, a - ld d, a - ld [$cfca], a - jr asm_2324 - -Func_2312:: ; 2312 (0:2312) - ld c, $a - ld d, $0 - ld a, [$d72e] - bit 5, a - jr z, asm_2324 - xor a - ld [$cfca], a - ld c, $8 - ld d, c -asm_2324:: ; 2324 (0:2324) - ld a, [$d700] - and a - jr z, .asm_2343 - cp $2 - jr z, .asm_2332 - ld a, MUSIC_BIKE_RIDING - jr .asm_2334 -.asm_2332 - ld a, MUSIC_SURFING -.asm_2334 - ld b, a - ld a, d - and a - ld a, Bank(Func_7d8ea) - jr nz, .asm_233e - ld [$c0ef], a -.asm_233e - ld [$c0f0], a - jr .asm_234c -.asm_2343 - ld a, [$d35b] - ld b, a - call Func_2385 - jr c, .asm_2351 -.asm_234c - ld a, [$cfca] - cp b - ret z -.asm_2351 - ld a, c - ld [wMusicHeaderPointer], a - ld a, b - ld [$cfca], a - ld [$c0ee], a - jp PlaySound - -Func_235f:: ; 235f (0:235f) - ld a, [$c0ef] - ld b, a - cp $2 - jr nz, .checkForBank08 -.bank02 - ld hl, Func_9103 - jr .asm_2378 -.checkForBank08 - cp $8 - jr nz, .bank1F -.bank08 - ld hl, Func_21879 - jr .asm_2378 -.bank1F - ld hl, Func_7d177 -.asm_2378 - ld c, $6 -.asm_237a - push bc - push hl - call Bankswitch - pop hl - pop bc - dec c - jr nz, .asm_237a - ret - -Func_2385:: ; 2385 (0:2385) - ld a, [$d35c] - ld e, a - ld a, [$c0ef] - cp e - jr nz, .asm_2394 - ld [$c0f0], a - and a - ret -.asm_2394 - ld a, c - and a - ld a, e - jr nz, .asm_239c - ld [$c0ef], a -.asm_239c - ld [$c0f0], a - scf - ret - -PlayMusic:: ; 23a1 (0:23a1) - ld b, a - ld [$c0ee], a - xor a - ld [wMusicHeaderPointer], a - ld a, c - ld [$c0ef], a - ld [$c0f0], a - ld a, b - -; plays music specified by a. If value is $ff, music is stopped -PlaySound:: ; 23b1 (0:23b1) - push hl - push de - push bc - ld b, a - ld a, [$c0ee] - and a - jr z, .asm_23c8 - xor a - ld [$c02a], a - ld [$c02b], a - ld [$c02c], a - ld [$c02d], a -.asm_23c8 - ld a, [wMusicHeaderPointer] - and a - jr z, .asm_23e3 - ld a, [$c0ee] - and a - jr z, .asm_2425 - xor a - ld [$c0ee], a - ld a, [$cfca] - cp $ff - jr nz, .asm_2414 - xor a - ld [wMusicHeaderPointer], a -.asm_23e3 - xor a - ld [$c0ee], a - ld a, [H_LOADEDROMBANK] - ld [$ffb9], a - ld a, [$c0ef] - ld [H_LOADEDROMBANK], a - ld [$2000], a - cp $2 - jr nz, .checkForBank08 -.bank02 - ld a, b - call Func_9876 - jr .asm_240b -.checkForBank08 - cp $8 - jr nz, .bank1F -.bank08 - ld a, b - call Func_22035 - jr .asm_240b -.bank1F - ld a, b - call Func_7d8ea -.asm_240b - ld a, [$ffb9] - ld [H_LOADEDROMBANK], a - ld [$2000], a - jr .asm_2425 -.asm_2414 - ld a, b - ld [$cfca], a - ld a, [wMusicHeaderPointer] - ld [$cfc8], a - ld [$cfc9], a - ld a, b - ld [wMusicHeaderPointer], a -.asm_2425 - pop bc - pop de - pop hl - ret - -UpdateSprites:: ; 2429 (0:2429) - ld a, [$cfcb] - dec a - ret nz - ld a, [H_LOADEDROMBANK] - push af - ld a, Bank(_UpdateSprites) - ld [H_LOADEDROMBANK], a - ld [$2000], a - call _UpdateSprites - pop af - ld [H_LOADEDROMBANK], a - ld [$2000], a - ret - -INCLUDE "data/mart_inventories.asm" - -TextScriptEndingChar:: ; 24d6 (0:24d6) - db "@" -TextScriptEnd:: ; 24d7 (0:24d7) - ld hl,TextScriptEndingChar - ret - -ExclamationText:: ; 24db (0:24db) - TX_FAR _ExclamationText - db "@" - -GroundRoseText:: ; 24e0 (0:24e0) - TX_FAR _GroundRoseText - db "@" - -BoulderText:: ; 24e5 (0:24e5) - TX_FAR _BoulderText - db "@" - -MartSignText:: ; 24ea (0:24ea) - TX_FAR _MartSignText - db "@" - -PokeCenterSignText:: ; 24ef (0:24ef) - TX_FAR _PokeCenterSignText - db "@" - -Predef5CText:: ; 24f4 (0:24f4) -; XXX better label (what does predef $5C do?) - db $08 ; asm - ld a, $5c - call Predef - jp TextScriptEnd - -; bankswitches and runs _UncompressSpriteData -; bank is given in a, sprite input stream is pointed to in W_SPRITEINPUTPTR -UncompressSpriteData:: ; 24fd (0:24fd) - ld b, a - ld a, [H_LOADEDROMBANK] - push af - ld a, b - ld [H_LOADEDROMBANK], a - ld [$2000], a - ld a, $a - ld [$0], a - xor a - ld [$4000], a - call _UncompressSpriteData - pop af - ld [H_LOADEDROMBANK], a - ld [$2000], a - ret - -; initializes necessary data to load a sprite and runs UncompressSpriteDataLoop -_UncompressSpriteData:: ; 251a (0:251a) - ld hl, S_SPRITEBUFFER1 - ld c, (2*SPRITEBUFFERSIZE) % $100 - ld b, (2*SPRITEBUFFERSIZE) / $100 - xor a - call FillMemory ; clear sprite buffer 1 and 2 - ld a, $1 - ld [W_SPRITEINPUTBITCOUNTER], a - ld a, $3 - ld [W_SPRITEOUTPUTBITOFFSET], a - xor a - ld [W_SPRITECURPOSX], a - ld [W_SPRITECURPOSY], a - ld [W_SPRITELOADFLAGS], a ; $d0a8 - call ReadNextInputByte ; first byte of input determines sprite width (high nybble) and height (low nybble) in tiles (8x8 pixels) - ld b, a - and $f - add a - add a - add a - ld [W_SPRITEHEIGHT], a - ld a, b - swap a - and $f - add a - add a - add a - ld [W_SPRITEWITDH], a - call ReadNextInputBit - ld [W_SPRITELOADFLAGS], a ; initialite bit1 to 0 and bit0 to the first input bit - ; this will load two chunks of data to S_SPRITEBUFFER1 and S_SPRITEBUFFER2 - ; bit 0 decides in which one the first chunk is placed - ; fall through - -; uncompresses a chunk from the sprite input data stream (pointed to at $d0da) into S_SPRITEBUFFER1 or S_SPRITEBUFFER2 -; each chunk is a 1bpp sprite. A 2bpp sprite consist of two chunks which are merged afterwards -; note that this is an endless loop which is terminated during a call to MoveToNextBufferPosition by manipulating the stack -UncompressSpriteDataLoop:: ; 2556 (0:2556) - ld hl, S_SPRITEBUFFER1 - ld a, [W_SPRITELOADFLAGS] ; $d0a8 - bit 0, a - jr z, .useSpriteBuffer1 ; check which buffer to use - ld hl, S_SPRITEBUFFER2 -.useSpriteBuffer1 - call StoreSpriteOutputPointer - ld a, [W_SPRITELOADFLAGS] ; $d0a8 - bit 1, a - jr z, .startDecompression ; check if last iteration - call ReadNextInputBit ; if last chunk, read 1-2 bit unpacking mode - and a - jr z, .unpackingMode0 ; 0 -> mode 0 - call ReadNextInputBit ; 1 0 -> mode 1 - inc a ; 1 1 -> mode 2 -.unpackingMode0 - ld [W_SPRITEUNPACKMODE], a -.startDecompression - call ReadNextInputBit - and a - jr z, .readRLEncodedZeros ; if first bit is 0, the input starts with zeroes, otherwise with (non-zero) input -.readNextInput - call ReadNextInputBit - ld c, a - call ReadNextInputBit - sla c - or c ; read next two bits into c - and a - jr z, .readRLEncodedZeros ; 00 -> RLEncoded zeroes following - call WriteSpriteBitsToBuffer ; otherwise write input to output and repeat - call MoveToNextBufferPosition - jr .readNextInput -.readRLEncodedZeros - ld c, $0 ; number of zeroes it length encoded, the number -.countConsecutiveOnesLoop ; of consecutive ones determines the number of bits the number has - call ReadNextInputBit - and a - jr z, .countConsecutiveOnesFinished - inc c - jr .countConsecutiveOnesLoop -.countConsecutiveOnesFinished - ld a, c - add a - ld hl, LengthEncodingOffsetList - add l - ld l, a - jr nc, .noCarry - inc h -.noCarry - ld a, [hli] ; read offset that is added to the number later on - ld e, a ; adding an offset of 2^length - 1 makes every integer uniquely - ld d, [hl] ; representable in the length encoding and saves bits - push de - inc c - ld e, $0 - ld d, e -.readNumberOfZerosLoop ; reads the next c+1 bits of input - call ReadNextInputBit - or e - ld e, a - dec c - jr z, .readNumberOfZerosDone - sla e - rl d - jr .readNumberOfZerosLoop -.readNumberOfZerosDone - pop hl ; add the offset - add hl, de - ld e, l - ld d, h -.writeZerosLoop - ld b, e - xor a ; write 00 to buffer - call WriteSpriteBitsToBuffer - ld e, b - call MoveToNextBufferPosition - dec de - ld a, d - and a - jr nz, .continueLoop - ld a, e - and a -.continueLoop - jr nz, .writeZerosLoop - jr .readNextInput - -; moves output pointer to next position -; also cancels the calling function if the all output is done (by removing the return pointer from stack) -; and calls postprocessing functions according to the unpack mode -MoveToNextBufferPosition:: ; 25d8 (0:25d8) - ld a, [W_SPRITEHEIGHT] - ld b, a - ld a, [W_SPRITECURPOSY] - inc a - cp b - jr z, .curColumnDone - ld [W_SPRITECURPOSY], a - ld a, [W_SPRITEOUTPUTPTR] - inc a - ld [W_SPRITEOUTPUTPTR], a - ret nz - ld a, [W_SPRITEOUTPUTPTR+1] - inc a - ld [W_SPRITEOUTPUTPTR+1], a - ret -.curColumnDone - xor a - ld [W_SPRITECURPOSY], a - ld a, [W_SPRITEOUTPUTBITOFFSET] - and a - jr z, .bitOffsetsDone - dec a - ld [W_SPRITEOUTPUTBITOFFSET], a - ld hl, W_SPRITEOUTPUTPTRCACHED - ld a, [hli] - ld [W_SPRITEOUTPUTPTR], a - ld a, [hl] - ld [W_SPRITEOUTPUTPTR+1], a - ret -.bitOffsetsDone - ld a, $3 - ld [W_SPRITEOUTPUTBITOFFSET], a - ld a, [W_SPRITECURPOSX] - add $8 - ld [W_SPRITECURPOSX], a - ld b, a - ld a, [W_SPRITEWITDH] - cp b - jr z, .allColumnsDone - ld a, [W_SPRITEOUTPUTPTR] - ld l, a - ld a, [W_SPRITEOUTPUTPTR+1] - ld h, a - inc hl - jp StoreSpriteOutputPointer -.allColumnsDone - pop hl - xor a - ld [W_SPRITECURPOSX], a - ld a, [W_SPRITELOADFLAGS] ; $d0a8 - bit 1, a - jr nz, .done ; test if there is one more sprite to go - xor $1 - set 1, a - ld [W_SPRITELOADFLAGS], a ; $d0a8 - jp UncompressSpriteDataLoop -.done - jp UnpackSprite - -; writes 2 bits (from a) to the output buffer (pointed to from W_SPRITEOUTPUTPTR) -WriteSpriteBitsToBuffer:: ; 2649 (0:2649) - ld e, a - ld a, [W_SPRITEOUTPUTBITOFFSET] - and a - jr z, .offset0 - cp $2 - jr c, .offset1 - jr z, .offset2 - rrc e ; offset 3 - rrc e - jr .offset0 -.offset1 - sla e - sla e - jr .offset0 -.offset2 - swap e -.offset0 - ld a, [W_SPRITEOUTPUTPTR] - ld l, a - ld a, [W_SPRITEOUTPUTPTR+1] - ld h, a - ld a, [hl] - or e - ld [hl], a - ret - -; reads next bit from input stream and returns it in a -ReadNextInputBit:: ; 2670 (0:2670) - ld a, [W_SPRITEINPUTBITCOUNTER] - dec a - jr nz, .curByteHasMoreBitsToRead - call ReadNextInputByte - ld [W_SPRITEINPUTCURBYTE], a - ld a, $8 -.curByteHasMoreBitsToRead - ld [W_SPRITEINPUTBITCOUNTER], a - ld a, [W_SPRITEINPUTCURBYTE] - rlca - ld [W_SPRITEINPUTCURBYTE], a - and $1 - ret - -; reads next byte from input stream and returns it in a -ReadNextInputByte:: ; 268b (0:268b) - ld a, [W_SPRITEINPUTPTR] - ld l, a - ld a, [W_SPRITEINPUTPTR+1] - ld h, a - ld a, [hli] - ld b, a - ld a, l - ld [W_SPRITEINPUTPTR], a - ld a, h - ld [W_SPRITEINPUTPTR+1], a - ld a, b - ret - -; the nth item is 2^n - 1 -LengthEncodingOffsetList:: ; 269f (0:269f) - dw %0000000000000001 - dw %0000000000000011 - dw %0000000000000111 - dw %0000000000001111 - dw %0000000000011111 - dw %0000000000111111 - dw %0000000001111111 - dw %0000000011111111 - dw %0000000111111111 - dw %0000001111111111 - dw %0000011111111111 - dw %0000111111111111 - dw %0001111111111111 - dw %0011111111111111 - dw %0111111111111111 - dw %1111111111111111 - -; unpacks the sprite data depending on the unpack mode -UnpackSprite:: ; 26bf (0:26bf) - ld a, [W_SPRITEUNPACKMODE] - cp $2 - jp z, UnpackSpriteMode2 - and a - jp nz, XorSpriteChunks - ld hl, S_SPRITEBUFFER1 - call SpriteDifferentialDecode - ld hl, S_SPRITEBUFFER2 - ; fall through - -; decodes differential encoded sprite data -; input bit value 0 preserves the current bit value and input bit value 1 toggles it (starting from initial value 0). -SpriteDifferentialDecode:: ; 26d4 (0:26d4) - xor a - ld [W_SPRITECURPOSX], a - ld [W_SPRITECURPOSY], a - call StoreSpriteOutputPointer - ld a, [W_SPRITEFLIPPED] - and a - jr z, .notFlipped - ld hl, DecodeNybble0TableFlipped - ld de, DecodeNybble1TableFlipped - jr .storeDecodeTablesPointers -.notFlipped - ld hl, DecodeNybble0Table - ld de, DecodeNybble1Table -.storeDecodeTablesPointers - ld a, l - ld [W_SPRITEDECODETABLE0PTR], a - ld a, h - ld [W_SPRITEDECODETABLE0PTR+1], a - ld a, e - ld [W_SPRITEDECODETABLE1PTR], a - ld a, d - ld [W_SPRITEDECODETABLE1PTR+1], a - ld e, $0 ; last decoded nybble, initialized to 0 -.decodeNextByteLoop - ld a, [W_SPRITEOUTPUTPTR] - ld l, a - ld a, [W_SPRITEOUTPUTPTR+1] - ld h, a - ld a, [hl] - ld b, a - swap a - and $f - call DifferentialDecodeNybble ; decode high nybble - swap a - ld d, a - ld a, b - and $f - call DifferentialDecodeNybble ; decode low nybble - or d - ld b, a - ld a, [W_SPRITEOUTPUTPTR] - ld l, a - ld a, [W_SPRITEOUTPUTPTR+1] - ld h, a - ld a, b - ld [hl], a ; write back decoded data - ld a, [W_SPRITEHEIGHT] - add l ; move on to next column - jr nc, .noCarry - inc h -.noCarry - ld [W_SPRITEOUTPUTPTR], a - ld a, h - ld [W_SPRITEOUTPUTPTR+1], a - ld a, [W_SPRITECURPOSX] - add $8 - ld [W_SPRITECURPOSX], a - ld b, a - ld a, [W_SPRITEWITDH] - cp b - jr nz, .decodeNextByteLoop ; test if current row is done - xor a - ld e, a - ld [W_SPRITECURPOSX], a - ld a, [W_SPRITECURPOSY] ; move on to next row - inc a - ld [W_SPRITECURPOSY], a - ld b, a - ld a, [W_SPRITEHEIGHT] - cp b - jr z, .done ; test if all rows finished - ld a, [W_SPRITEOUTPUTPTRCACHED] - ld l, a - ld a, [W_SPRITEOUTPUTPTRCACHED+1] - ld h, a - inc hl - call StoreSpriteOutputPointer - jr .decodeNextByteLoop -.done - xor a - ld [W_SPRITECURPOSY], a - ret - -; decodes the nybble stored in a. Last decoded data is assumed to be in e (needed to determine if initial value is 0 or 1) -DifferentialDecodeNybble:: ; 276d (0:276d) - srl a ; c=a%2, a/=2 - ld c, $0 - jr nc, .evenNumber - ld c, $1 -.evenNumber - ld l, a - ld a, [W_SPRITEFLIPPED] - and a - jr z, .notFlipped ; determine if initial value is 0 or one - bit 3, e ; if flipped, consider MSB of last data - jr .selectLookupTable -.notFlipped - bit 0, e ; else consider LSB -.selectLookupTable - ld e, l - jr nz, .initialValue1 ; load the appropriate table - ld a, [W_SPRITEDECODETABLE0PTR] - ld l, a - ld a, [W_SPRITEDECODETABLE0PTR+1] - jr .tableLookup -.initialValue1 - ld a, [W_SPRITEDECODETABLE1PTR] - ld l, a - ld a, [W_SPRITEDECODETABLE1PTR+1] -.tableLookup - ld h, a - ld a, e - add l - ld l, a - jr nc, .noCarry - inc h -.noCarry - ld a, [hl] - bit 0, c - jr nz, .selectLowNybble - swap a ; select high nybble -.selectLowNybble - and $f - ld e, a ; update last decoded data - ret - -DecodeNybble0Table:: ; 27a7 (0:27a7) - dn $0, $1 - dn $3, $2 - dn $7, $6 - dn $4, $5 - dn $f, $e - dn $c, $d - dn $8, $9 - dn $b, $a -DecodeNybble1Table:: ; 27af (0:27af) - dn $f, $e - dn $c, $d - dn $8, $9 - dn $b, $a - dn $0, $1 - dn $3, $2 - dn $7, $6 - dn $4, $5 -DecodeNybble0TableFlipped:: ; 27b7 (0:27b7) - dn $0, $8 - dn $c, $4 - dn $e, $6 - dn $2, $a - dn $f, $7 - dn $3, $b - dn $1, $9 - dn $d, $5 -DecodeNybble1TableFlipped:: ; 27bf (0:27bf) - dn $f, $7 - dn $3, $b - dn $1, $9 - dn $d, $5 - dn $0, $8 - dn $c, $4 - dn $e, $6 - dn $2, $a - -; combines the two loaded chunks with xor (the chunk loaded second is the destination). The source chunk is differeintial decoded beforehand. -XorSpriteChunks:: ; 27c7 (0:27c7) - xor a - ld [W_SPRITECURPOSX], a - ld [W_SPRITECURPOSY], a - call ResetSpriteBufferPointers - ld a, [W_SPRITEOUTPUTPTR] ; points to buffer 1 or 2, depending on flags - ld l, a - ld a, [W_SPRITEOUTPUTPTR+1] - ld h, a - call SpriteDifferentialDecode ; decode buffer 1 or 2, depending on flags - call ResetSpriteBufferPointers - ld a, [W_SPRITEOUTPUTPTR] ; source buffer, points to buffer 1 or 2, depending on flags - ld l, a - ld a, [W_SPRITEOUTPUTPTR+1] - ld h, a - ld a, [W_SPRITEOUTPUTPTRCACHED] ; destination buffer, points to buffer 2 or 1, depending on flags - ld e, a - ld a, [W_SPRITEOUTPUTPTRCACHED+1] - ld d, a -.xorChunksLoop - ld a, [W_SPRITEFLIPPED] - and a - jr z, .notFlipped - push de - ld a, [de] - ld b, a - swap a - and $f - call ReverseNybble ; if flipped reverse the nybbles in the destination buffer - swap a - ld c, a - ld a, b - and $f - call ReverseNybble - or c - pop de - ld [de], a -.notFlipped - ld a, [hli] - ld b, a - ld a, [de] - xor b - ld [de], a - inc de - ld a, [W_SPRITECURPOSY] - inc a - ld [W_SPRITECURPOSY], a ; go to next row - ld b, a - ld a, [W_SPRITEHEIGHT] - cp b - jr nz, .xorChunksLoop ; test if column finished - xor a - ld [W_SPRITECURPOSY], a - ld a, [W_SPRITECURPOSX] - add $8 - ld [W_SPRITECURPOSX], a ; go to next column - ld b, a - ld a, [W_SPRITEWITDH] - cp b - jr nz, .xorChunksLoop ; test if all columns finished - xor a - ld [W_SPRITECURPOSX], a - ret - -; reverses the bits in the nybble given in register a -ReverseNybble:: ; 2837 (0:2837) - ld de, NybbleReverseTable - add e - ld e, a - jr nc, .asm_283f - inc d -.asm_283f - ld a, [de] - ret - -; resets sprite buffer pointers to buffer 1 and 2, depending on W_SPRITELOADFLAGS -ResetSpriteBufferPointers:: ; 2841 (0:2841) - ld a, [W_SPRITELOADFLAGS] ; $d0a8 - bit 0, a - jr nz, .buffer2Selected - ld de, S_SPRITEBUFFER1 - ld hl, S_SPRITEBUFFER2 - jr .storeBufferPointers -.buffer2Selected - ld de, S_SPRITEBUFFER2 - ld hl, S_SPRITEBUFFER1 -.storeBufferPointers - ld a, l - ld [W_SPRITEOUTPUTPTR], a - ld a, h - ld [W_SPRITEOUTPUTPTR+1], a - ld a, e - ld [W_SPRITEOUTPUTPTRCACHED], a - ld a, d - ld [W_SPRITEOUTPUTPTRCACHED+1], a - ret - -; maps each nybble to its reverse -NybbleReverseTable:: ; 2867 (0:2867) - db $0, $8, $4, $c, $2, $a, $6 ,$e, $1, $9, $5, $d, $3, $b, $7 ,$f - -; combines the two loaded chunks with xor (the chunk loaded second is the destination). Both chunks are differeintial decoded beforehand. -UnpackSpriteMode2:: ; 2877 (0:2877) - call ResetSpriteBufferPointers - ld a, [W_SPRITEFLIPPED] - push af - xor a - ld [W_SPRITEFLIPPED], a ; temporarily clear flipped flag for decoding the destination chunk - ld a, [W_SPRITEOUTPUTPTRCACHED] - ld l, a - ld a, [W_SPRITEOUTPUTPTRCACHED+1] - ld h, a - call SpriteDifferentialDecode - call ResetSpriteBufferPointers - pop af - ld [W_SPRITEFLIPPED], a - jp XorSpriteChunks - -; stores hl into the output pointers -StoreSpriteOutputPointer:: ; 2897 (0:2897) - ld a, l - ld [W_SPRITEOUTPUTPTR], a - ld [W_SPRITEOUTPUTPTRCACHED], a - ld a, h - ld [W_SPRITEOUTPUTPTR+1], a - ld [W_SPRITEOUTPUTPTRCACHED+1], a - ret - -ResetPlayerSpriteData:: ; 28a6 (0:28a6) - ld hl, wSpriteStateData1 - call ResetPlayerSpriteData_ClearSpriteData - ld hl, wSpriteStateData2 - call ResetPlayerSpriteData_ClearSpriteData - ld a, $1 - ld [wSpriteStateData1], a - ld [$c20e], a - ld hl, $c104 - ld [hl], $3c ; set Y screen pos - inc hl - inc hl - ld [hl], $40 ; set X screen pos - ret - -; overwrites sprite data with zeroes -ResetPlayerSpriteData_ClearSpriteData:: ; 28c4 (0:28c4) - ld bc, $10 - xor a - jp FillMemory - -Func_28cb:: ; 28cb (0:28cb) - ld a, [wMusicHeaderPointer] - and a - jr nz, .asm_28dc - ld a, [$d72c] - bit 1, a - ret nz - ld a, $77 - ld [$ff24], a - ret -.asm_28dc - ld a, [$cfc9] - and a - jr z, .asm_28e7 - dec a - ld [$cfc9], a - ret -.asm_28e7 - ld a, [$cfc8] - ld [$cfc9], a - ld a, [$ff24] - and a - jr z, .asm_2903 - ld b, a - and $f - dec a - ld c, a - ld a, b - and $f0 - swap a - dec a - swap a - or c - ld [$ff24], a - ret -.asm_2903 - ld a, [wMusicHeaderPointer] - ld b, a - xor a - ld [wMusicHeaderPointer], a - ld a, $ff - ld [$c0ee], a - call PlaySound - ld a, [$c0f0] - ld [$c0ef], a - ld a, b - ld [$c0ee], a - jp PlaySound - -; this function is used to display sign messages, sprite dialog, etc. -; INPUT: [$ff8c] = sprite ID or text ID -DisplayTextID:: ; 2920 (0:2920) - ld a,[H_LOADEDROMBANK] - push af - callba DisplayTextIDInit ; initialization - ld hl,$cf11 - bit 0,[hl] - res 0,[hl] - jr nz,.skipSwitchToMapBank - ld a,[W_CURMAP] - call SwitchToMapRomBank -.skipSwitchToMapBank - ld a,30 ; half a second - ld [H_FRAMECOUNTER],a ; used as joypad poll timer - ld hl,W_MAPTEXTPTR - ld a,[hli] - ld h,[hl] - ld l,a ; hl = map text pointer - ld d,$00 - ld a,[$ff8c] ; text ID - ld [$cf13],a - and a - jp z,DisplayStartMenu - cp a,$d3 ; safari game over - jp z,DisplaySafariGameOverText - cp a,$d0 ; fainted - jp z,DisplayPokemonFaintedText - cp a,$d1 ; blacked out - jp z,DisplayPlayerBlackedOutText - cp a,$d2 ; repel wore off - jp z,DisplayRepelWoreOffText - ld a,[$d4e1] ; number of sprites - ld e,a - ld a,[$ff8c] ; sprite ID - cp e - jr z,.spriteHandling - jr nc,.skipSpriteHandling -.spriteHandling -; get the text ID of the sprite - push hl - push de - push bc - callba Func_13074 ; update the graphics of the sprite the player is talking to (to face the right direction) - pop bc - pop de - ld hl,W_MAPSPRITEDATA ; NPC text entries - ld a,[$ff8c] - dec a - add a - add l - ld l,a - jr nc,.noCarry - inc h -.noCarry - inc hl - ld a,[hl] ; a = text ID of the sprite - pop hl -.skipSpriteHandling -; look up the address of the text in the map's text entries - dec a - ld e,a - sla e - add hl,de - ld a,[hli] - ld h,[hl] - ld l,a ; hl = address of the text - ld a,[hl] ; a = first byte of text -; check first byte of text for special cases - cp a,$fe ; Pokemart NPC - jp z,DisplayPokemartDialogue - cp a,$ff ; Pokemon Center NPC - jp z,DisplayPokemonCenterDialogue - cp a,$fc ; Item Storage PC - jp z,FuncTX_ItemStoragePC - cp a,$fd ; Bill's PC - jp z,FuncTX_BillsPC - cp a,$f9 ; Pokemon Center PC - jp z,FuncTX_PokemonCenterPC - cp a,$f5 ; Vending Machine - jr nz,.notVendingMachine - callba VendingMachineMenu ; jump banks to vending machine routine - jr AfterDisplayingTextID -.notVendingMachine - cp a,$f7 ; slot machine - jp z,FuncTX_SlotMachine - cp a,$f6 ; cable connection NPC in Pokemon Center - jr nz,.notSpecialCase - callab CableClubNPC - jr AfterDisplayingTextID -.notSpecialCase - call Func_3c59 ; display the text - ld a,[$cc3c] - and a - jr nz,HoldTextDisplayOpen - -AfterDisplayingTextID:: ; 29d6 (0:29d6) - ld a,[$cc47] - and a - jr nz,HoldTextDisplayOpen - call WaitForTextScrollButtonPress ; wait for a button press after displaying all the text - -; loop to hold the dialogue box open as long as the player keeps holding down the A button -HoldTextDisplayOpen:: ; 29df (0:29df) - call GetJoypadState - ld a,[H_CURRENTPRESSEDBUTTONS] - bit 0,a ; is the A button being pressed? - jr nz,HoldTextDisplayOpen - -CloseTextDisplay:: ; 29e8 (0:29e8) - ld a,[W_CURMAP] - call SwitchToMapRomBank - ld a,$90 - ld [$ffb0],a ; move the window off the screen - call DelayFrame - call LoadGBPal - xor a - ld [H_AUTOBGTRANSFERENABLED],a ; disable continuous WRAM to VRAM transfer each V-blank -; loop to make sprites face the directions they originally faced before the dialogue - ld hl,$c219 - ld c,$0f - ld de,$0010 -.restoreSpriteFacingDirectionLoop - ld a,[hl] - dec h - ld [hl],a - inc h - add hl,de - dec c - jr nz,.restoreSpriteFacingDirectionLoop - ld a,BANK(InitMapSprites) - ld [H_LOADEDROMBANK],a - ld [$2000],a - call InitMapSprites ; reload sprite tile pattern data (since it was partially overwritten by text tile patterns) - ld hl,$cfc4 - res 0,[hl] - ld a,[$d732] - bit 3,a - call z,LoadPlayerSpriteGraphics - call LoadCurrentMapView - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - jp UpdateSprites ; move sprites - -DisplayPokemartDialogue:: ; 2a2e (0:2a2e) - push hl - ld hl,PokemartGreetingText - call PrintText - pop hl - inc hl - call LoadItemList - ld a,$02 - ld [$cf94],a ; selects between subtypes of menus - ld a,[H_LOADEDROMBANK] - push af - ld a,Bank(DisplayPokemartDialogue_) - ld [H_LOADEDROMBANK],a - ld [$2000],a - call DisplayPokemartDialogue_ - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - jp AfterDisplayingTextID - -PokemartGreetingText:: ; 2a55 (0:2a55) - TX_FAR _PokemartGreetingText - db "@" - -LoadItemList:: ; 2a5a (0:2a5a) - ld a,$01 - ld [$cfcb],a - ld a,h - ld [$d128],a - ld a,l - ld [$d129],a - ld de,$cf7b -.loop - ld a,[hli] - ld [de],a - inc de - cp a,$ff - jr nz,.loop - ret - -DisplayPokemonCenterDialogue:: ; 2a72 (0:2a72) - xor a - ld [$ff8b],a - ld [$ff8c],a - ld [$ff8d],a - inc hl - ld a,[H_LOADEDROMBANK] - push af - ld a,Bank(DisplayPokemonCenterDialogue_) - ld [H_LOADEDROMBANK],a - ld [$2000],a - call DisplayPokemonCenterDialogue_ - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - jp AfterDisplayingTextID - -DisplaySafariGameOverText:: ; 2a90 (0:2a90) - callab PrintSafariGameOverText - jp AfterDisplayingTextID - -DisplayPokemonFaintedText:: ; 2a9b (0:2a9b) - ld hl,PokemonFaintedText - call PrintText - jp AfterDisplayingTextID - -PokemonFaintedText:: ; 2aa4 (0:2aa4) - TX_FAR _PokemonFaintedText - db "@" - -DisplayPlayerBlackedOutText:: ; 2aa9 (0:2aa9) - ld hl,PlayerBlackedOutText - call PrintText - ld a,[$d732] - res 5,a - ld [$d732],a - jp HoldTextDisplayOpen - -PlayerBlackedOutText:: ; 2aba (0:2aba) - TX_FAR _PlayerBlackedOutText - db "@" - -DisplayRepelWoreOffText:: ; 2abf (0:2abf) - ld hl,RepelWoreOffText - call PrintText - jp AfterDisplayingTextID - -RepelWoreOffText:: ; 2ac8 (0:2ac8) - TX_FAR _RepelWoreOffText - db "@" - -INCLUDE "engine/menu/start_menu.asm" - -; function to count how many bits are set in a string of bytes -; INPUT: -; hl = address of string of bytes -; b = length of string of bytes -; OUTPUT: -; [$D11E] = number of set bits -CountSetBits:: ; 2b7f (0:2b7f) - ld c,0 -.loop - ld a,[hli] - ld e,a - ld d,8 -.innerLoop ; count how many bits are set in the current byte - srl e - ld a,0 - adc c - ld c,a - dec d - jr nz,.innerLoop - dec b - jr nz,.loop - ld a,c - ld [$d11e],a ; store number of set bits - ret - -; subtracts the amount the player paid from their money -; sets carry flag if there is enough money and unsets carry flag if not -SubtractAmountPaidFromMoney:: ; 2b96 (0:2b96) - ld b,BANK(SubtractAmountPaidFromMoney_) - ld hl,SubtractAmountPaidFromMoney_ - jp Bankswitch - -; adds the amount the player sold to their money -AddAmountSoldToMoney:: ; 2b9e (0:2b9e) - ld de,wPlayerMoney + 2 - ld hl,$ffa1 ; total price of items - ld c,3 ; length of money in bytes - ld a,$0b - call Predef ; add total price to money - ld a,$13 - ld [$d125],a - call DisplayTextBoxID ; redraw money text box - ld a, (SFX_02_5a - SFX_Headers_02) / 3 - call PlaySoundWaitForCurrent ; play sound - jp WaitForSoundToFinish ; wait until sound is done playing - -; function to remove an item (in varying quantities) from the player's bag or PC box -; INPUT: -; HL = address of inventory (either wNumBagItems or wNumBoxItems) -; [$CF92] = index (within the inventory) of the item to remove -; [$CF96] = quantity to remove -RemoveItemFromInventory:: ; 2bbb (0:2bbb) - ld a,[H_LOADEDROMBANK] - push af - ld a,BANK(RemoveItemFromInventory_) - ld [H_LOADEDROMBANK],a - ld [$2000],a - call RemoveItemFromInventory_ - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -; function to add an item (in varying quantities) to the player's bag or PC box -; INPUT: -; HL = address of inventory (either wNumBagItems or wNumBoxItems) -; [$CF91] = item ID -; [$CF96] = item quantity -; sets carry flag if successful, unsets carry flag if unsuccessful -AddItemToInventory:: ; 2bcf (0:2bcf) - push bc - ld a,[H_LOADEDROMBANK] - push af - ld a,BANK(AddItemToInventory_) - ld [H_LOADEDROMBANK],a - ld [$2000],a - call AddItemToInventory_ - pop bc - ld a,b - ld [H_LOADEDROMBANK],a - ld [$2000],a - pop bc - ret - -; INPUT: -; [wListMenuID] = list menu ID -; [$cf8b] = address of the list (2 bytes) -DisplayListMenuID:: ; 2be6 (0:2be6) - xor a - ld [H_AUTOBGTRANSFERENABLED],a ; disable auto-transfer - ld a,1 - ld [$ffb7],a ; joypad state update flag - ld a,[W_BATTLETYPE] - and a ; is it the Old Man battle? - jr nz,.specialBattleType - ld a,$01 ; hardcoded bank - jr .bankswitch -.specialBattleType ; Old Man battle - ld a, Bank(OldManItemList) -.bankswitch - call BankswitchHome - ld hl,$d730 - set 6,[hl] ; turn off letter printing delay - xor a - ld [$cc35],a ; 0 means no item is currently being swapped - ld [$d12a],a - ld a,[$cf8b] - ld l,a - ld a,[$cf8c] - ld h,a ; hl = address of the list - ld a,[hl] - ld [$d12a],a ; [$d12a] = number of list entries - ld a,$0d ; list menu text box ID - ld [$d125],a - call DisplayTextBoxID ; draw the menu text box - call UpdateSprites ; move sprites - FuncCoord 4,2 ; coordinates of upper left corner of menu text box - ld hl,Coord - ld de,$090e ; height and width of menu text box - ld a,[wListMenuID] - and a ; is it a PC pokemon list? - jr nz,.skipMovingSprites - call UpdateSprites ; move sprites -.skipMovingSprites - ld a,1 ; max menu item ID is 1 if the list has less than 2 entries - ld [$cc37],a - ld a,[$d12a] - cp a,2 ; does the list have less than 2 entries? - jr c,.setMenuVariables - ld a,2 ; max menu item ID is 2 if the list has at least 2 entries -.setMenuVariables - ld [wMaxMenuItem],a - ld a,4 - ld [wTopMenuItemY],a - ld a,5 - ld [wTopMenuItemX],a - ld a,%00000111 ; A button, B button, Select button - ld [wMenuWatchedKeys],a - ld c,10 - call DelayFrames - -DisplayListMenuIDLoop:: ; 2c53 (0:2c53) - xor a - ld [H_AUTOBGTRANSFERENABLED],a ; disable transfer - call PrintListMenuEntries - ld a,1 - ld [H_AUTOBGTRANSFERENABLED],a ; enable transfer - call Delay3 - ld a,[W_BATTLETYPE] - and a ; is it the Old Man battle? - jr z,.notOldManBattle -.oldManBattle - ld a,"▶" - FuncCoord 5,4 - ld [Coord],a ; place menu cursor in front of first menu entry - ld c,80 - call DelayFrames - xor a - ld [wCurrentMenuItem],a - ld hl,Coord - ld a,l - ld [wMenuCursorLocation],a - ld a,h - ld [wMenuCursorLocation + 1],a - jr .buttonAPressed -.notOldManBattle - call LoadGBPal - call HandleMenuInput - push af - call PlaceMenuCursor - pop af - bit 0,a ; was the A button pressed? - jp z,.checkOtherKeys -.buttonAPressed - ld a,[wCurrentMenuItem] - call PlaceUnfilledArrowMenuCursor - ld a,$01 - ld [$d12e],a - ld [$d12d],a - xor a - ld [$cc37],a - ld a,[wCurrentMenuItem] - ld c,a - ld a,[wListScrollOffset] - add c - ld c,a - ld a,[$d12a] ; number of list entries - and a ; is the list empty? - jp z,ExitListMenu ; if so, exit the menu - dec a - cp c ; did the player select Cancel? - jp c,ExitListMenu ; if so, exit the menu - ld a,c - ld [wWhichPokemon],a - ld a,[wListMenuID] - cp a,ITEMLISTMENU - jr nz,.skipMultiplying -; if it's an item menu - sla c ; item entries are 2 bytes long, so multiply by 2 -.skipMultiplying - ld a,[$cf8b] - ld l,a - ld a,[$cf8c] - ld h,a - inc hl ; hl = beginning of list entries - ld b,0 - add hl,bc - ld a,[hl] - ld [$cf91],a - ld a,[wListMenuID] - and a ; is it a PC pokemon list? - jr z,.pokemonList - push hl - call GetItemPrice - pop hl - ld a,[wListMenuID] - cp a,ITEMLISTMENU - jr nz,.skipGettingQuantity -; if it's an item menu - inc hl - ld a,[hl] ; a = item quantity - ld [$cf97],a -.skipGettingQuantity - ld a,[$cf91] - ld [$d0b5],a - ld a,$01 - ld [$d0b7],a - call GetName - jr .storeChosenEntry -.pokemonList - ld hl,W_NUMINPARTY - ld a,[$cf8b] - cp l ; is it a list of party pokemon or box pokemon? - ld hl,W_PARTYMON1NAME - jr z,.getPokemonName - ld hl, W_BOXMON1NAME ; box pokemon names -.getPokemonName - ld a,[wWhichPokemon] - call GetPartyMonName -.storeChosenEntry ; store the menu entry that the player chose and return - ld de,$cd6d - call CopyStringToCF4B ; copy name to $cf4b - ld a,$01 - ld [$d12e],a - ld a,[wCurrentMenuItem] - ld [$d12d],a - xor a - ld [$ffb7],a ; joypad state update flag - ld hl,$d730 - res 6,[hl] ; turn on letter printing delay - jp BankswitchBack -.checkOtherKeys ; check B, SELECT, Up, and Down keys - bit 1,a ; was the B button pressed? - jp nz,ExitListMenu ; if so, exit the menu - bit 2,a ; was the select button pressed? - jp nz,HandleItemListSwapping ; if so, allow the player to swap menu entries - ld b,a - bit 7,b ; was Down pressed? - ld hl,wListScrollOffset - jr z,.upPressed -.downPressed - ld a,[hl] - add a,3 - ld b,a - ld a,[$d12a] ; number of list entries - cp b ; will going down scroll past the Cancel button? - jp c,DisplayListMenuIDLoop - inc [hl] ; if not, go down - jp DisplayListMenuIDLoop -.upPressed - ld a,[hl] - and a - jp z,DisplayListMenuIDLoop - dec [hl] - jp DisplayListMenuIDLoop - -DisplayChooseQuantityMenu:: ; 2d57 (0:2d57) -; text box dimensions/coordinates for just quantity - FuncCoord 15,9 - ld hl,Coord - ld b,1 ; height - ld c,3 ; width - ld a,[wListMenuID] - cp a,PRICEDITEMLISTMENU - jr nz,.drawTextBox -; text box dimensions/coordinates for quantity and price - FuncCoord 7,9 - ld hl,Coord - ld b,1 ; height - ld c,11 ; width -.drawTextBox - call TextBoxBorder - FuncCoord 16,10 - ld hl,Coord - ld a,[wListMenuID] - cp a,PRICEDITEMLISTMENU - jr nz,.printInitialQuantity - FuncCoord 8,10 - ld hl,Coord -.printInitialQuantity - ld de,InitialQuantityText - call PlaceString - xor a - ld [$cf96],a ; initialize current quantity to 0 - jp .incrementQuantity -.waitForKeyPressLoop - call GetJoypadStateLowSensitivity - ld a,[H_NEWLYPRESSEDBUTTONS] ; newly pressed buttons - bit 0,a ; was the A button pressed? - jp nz,.buttonAPressed - bit 1,a ; was the B button pressed? - jp nz,.buttonBPressed - bit 6,a ; was Up pressed? - jr nz,.incrementQuantity - bit 7,a ; was Down pressed? - jr nz,.decrementQuantity - jr .waitForKeyPressLoop -.incrementQuantity - ld a,[$cf97] ; max quantity - inc a - ld b,a - ld hl,$cf96 ; current quantity - inc [hl] - ld a,[hl] - cp b - jr nz,.handleNewQuantity -; wrap to 1 if the player goes above the max quantity - ld a,1 - ld [hl],a - jr .handleNewQuantity -.decrementQuantity - ld hl,$cf96 ; current quantity - dec [hl] - jr nz,.handleNewQuantity -; wrap to the max quantity if the player goes below 1 - ld a,[$cf97] ; max quantity - ld [hl],a -.handleNewQuantity - FuncCoord 17,10 - ld hl,Coord - ld a,[wListMenuID] - cp a,PRICEDITEMLISTMENU - jr nz,.printQuantity -.printPrice - ld c,$03 - ld a,[$cf96] - ld b,a - ld hl,$ff9f ; total price -; initialize total price to 0 - xor a - ld [hli],a - ld [hli],a - ld [hl],a -.addLoop ; loop to multiply the individual price by the quantity to get the total price - ld de,$ffa1 - ld hl,$ff8d - push bc - ld a,$0b - call Predef ; add the individual price to the current sum - pop bc - dec b - jr nz,.addLoop - ld a,[$ff8e] - and a ; should the price be halved (for selling items)? - jr z,.skipHalvingPrice - xor a - ld [$ffa2],a - ld [$ffa3],a - ld a,$02 - ld [$ffa4],a - ld a,$0d - call Predef ; halves the price -; store the halved price - ld a,[$ffa2] - ld [$ff9f],a - ld a,[$ffa3] - ld [$ffa0],a - ld a,[$ffa4] - ld [$ffa1],a -.skipHalvingPrice - FuncCoord 12,10 - ld hl,Coord - ld de,SpacesBetweenQuantityAndPriceText - call PlaceString - ld de,$ff9f ; total price - ld c,$a3 - call PrintBCDNumber - FuncCoord 9,10 - ld hl,Coord -.printQuantity - ld de,$cf96 ; current quantity - ld bc,$8102 ; print leading zeroes, 1 byte, 2 digits - call PrintNumber - jp .waitForKeyPressLoop -.buttonAPressed ; the player chose to make the transaction - xor a - ld [$cc35],a ; 0 means no item is currently being swapped - ret -.buttonBPressed ; the player chose to cancel the transaction - xor a - ld [$cc35],a ; 0 means no item is currently being swapped - ld a,$ff - ret - -InitialQuantityText:: ; 2e30 (0:2e30) - db "×01@" - -SpacesBetweenQuantityAndPriceText:: ; 2e34 (0:2e34) - db " @" - -ExitListMenu:: ; 2e3b (0:2e3b) - ld a,[wCurrentMenuItem] - ld [$d12d],a - ld a,$02 - ld [$d12e],a - ld [$cc37],a - xor a - ld [$ffb7],a - ld hl,$d730 - res 6,[hl] - call BankswitchBack - xor a - ld [$cc35],a ; 0 means no item is currently being swapped - scf - ret - -PrintListMenuEntries:: ; 2e5a (0:2e5a) - FuncCoord 5, 3 ; $c3e1 - ld hl,Coord - ld b,$09 - ld c,$0e - call ClearScreenArea - ld a,[$cf8b] - ld e,a - ld a,[$cf8c] - ld d,a - inc de ; de = beginning of list entries - ld a,[wListScrollOffset] - ld c,a - ld a,[wListMenuID] - cp a,ITEMLISTMENU - ld a,c - jr nz,.skipMultiplying -; if it's an item menu -; item entries are 2 bytes long, so multiply by 2 - sla a - sla c -.skipMultiplying - add e - ld e,a - jr nc,.noCarry - inc d -.noCarry - FuncCoord 6,4 ; coordinates of first list entry name - ld hl,Coord - ld b,4 ; print 4 names -.loop - ld a,b - ld [wWhichPokemon],a - ld a,[de] - ld [$d11e],a - cp a,$ff - jp z,.printCancelMenuItem - push bc - push de - push hl - push hl - push de - ld a,[wListMenuID] - and a - jr z,.pokemonPCMenu - cp a,$01 - jr z,.movesMenu -.itemMenu - call GetItemName - jr .placeNameString -.pokemonPCMenu - push hl - ld hl,W_NUMINPARTY - ld a,[$cf8b] - cp l ; is it a list of party pokemon or box pokemon? - ld hl,W_PARTYMON1NAME - jr z,.getPokemonName - ld hl, W_BOXMON1NAME ; box pokemon names -.getPokemonName - ld a,[wWhichPokemon] - ld b,a - ld a,4 - sub b - ld b,a - ld a,[wListScrollOffset] - add b - call GetPartyMonName - pop hl - jr .placeNameString -.movesMenu - call GetMoveName -.placeNameString - call PlaceString - pop de - pop hl - ld a,[$cf93] - and a ; should prices be printed? - jr z,.skipPrintingItemPrice -.printItemPrice - push hl - ld a,[de] - ld de,ItemPrices - ld [$cf91],a - call GetItemPrice ; get price - pop hl - ld bc,20 + 5 ; 1 row down and 5 columns right - add hl,bc - ld c,$a3 ; no leading zeroes, right-aligned, print currency symbol, 3 bytes - call PrintBCDNumber -.skipPrintingItemPrice - ld a,[wListMenuID] - and a - jr nz,.skipPrintingPokemonLevel -.printPokemonLevel - ld a,[$d11e] - push af - push hl - ld hl,W_NUMINPARTY - ld a,[$cf8b] - cp l ; is it a list of party pokemon or box pokemon? - ld a,$00 - jr z,.next - ld a,$02 -.next - ld [$cc49],a - ld hl,wWhichPokemon - ld a,[hl] - ld b,a - ld a,$04 - sub b - ld b,a - ld a,[wListScrollOffset] - add b - ld [hl],a - call LoadMonData ; load pokemon info - ld a,[$cc49] - and a ; is it a list of party pokemon or box pokemon? - jr z,.skipCopyingLevel -.copyLevel - ld a,[$cf9b] - ld [$cfb9],a -.skipCopyingLevel - pop hl - ld bc,$001c - add hl,bc - call PrintLevel ; print level - pop af - ld [$d11e],a -.skipPrintingPokemonLevel - pop hl - pop de - inc de - ld a,[wListMenuID] - cp a,ITEMLISTMENU - jr nz,.nextListEntry -.printItemQuantity - ld a,[$d11e] - ld [$cf91],a - call IsKeyItem ; check if item is unsellable - ld a,[$d124] - and a ; is the item unsellable? - jr nz,.skipPrintingItemQuantity ; if so, don't print the quantity - push hl - ld bc,20 + 8 ; 1 row down and 8 columns right - add hl,bc - ld a,"×" - ldi [hl],a - ld a,[$d11e] - push af - ld a,[de] - ld [$cf97],a - push de - ld de,$d11e - ld [de],a - ld bc,$0102 - call PrintNumber - pop de - pop af - ld [$d11e],a - pop hl -.skipPrintingItemQuantity - inc de - pop bc - inc c - push bc - inc c - ld a,[$cc35] ; ID of item chosen for swapping (counts from 1) - and a ; is an item being swapped? - jr z,.nextListEntry - sla a - cp c ; is it this item? - jr nz,.nextListEntry - dec hl - ld a,$ec ; unfilled right arrow menu cursor to indicate an item being swapped - ld [hli],a -.nextListEntry - ld bc,2 * 20 ; 2 rows - add hl,bc - pop bc - inc c - dec b - jp nz,.loop - ld bc,-8 - add hl,bc - ld a,$ee ; down arrow - ld [hl],a - ret -.printCancelMenuItem - ld de,ListMenuCancelText - jp PlaceString - -ListMenuCancelText:: ; 2f97 (0:2f97) - db "CANCEL@" - -GetMonName:: ; 2f9e (0:2f9e) - push hl - ld a,[H_LOADEDROMBANK] - push af - ld a,BANK(MonsterNames) ; 07 - ld [H_LOADEDROMBANK],a - ld [$2000],a - ld a,[$d11e] - dec a - ld hl,MonsterNames ; 421E - ld c,10 - ld b,0 - call AddNTimes - ld de,$cd6d - push de - ld bc,10 - call CopyData - ld hl,$cd77 - ld [hl], "@" - pop de - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - pop hl - ret - -GetItemName:: ; 2fcf (0:2fcf) -; given an item ID at [$D11E], store the name of the item into a string -; starting at $CD6D - push hl - push bc - ld a,[$D11E] - cp HM_01 ; is this a TM/HM? - jr nc,.Machine - - ld [$D0B5],a - ld a,ITEM_NAME - ld [W_LISTTYPE],a - ld a,BANK(ItemNames) - ld [$D0B7],a - call GetName - jr .Finish - -.Machine - call GetMachineName -.Finish - ld de,$CD6D ; pointer to where item name is stored in RAM - pop bc - pop hl - ret - -GetMachineName:: ; 2ff3 (0:2ff3) -; copies the name of the TM/HM in [$D11E] to $CD6D - push hl - push de - push bc - ld a,[$D11E] - push af - cp TM_01 ; is this a TM? [not HM] - jr nc,.WriteTM -; if HM, then write "HM" and add 5 to the item ID, so we can reuse the -; TM printing code - add 5 - ld [$D11E],a - ld hl,HiddenPrefix ; points to "HM" - ld bc,2 - jr .WriteMachinePrefix -.WriteTM - ld hl,TechnicalPrefix ; points to "TM" - ld bc,2 -.WriteMachinePrefix - ld de,$CD6D - call CopyData - -; now get the machine number and convert it to text - ld a,[$D11E] - sub TM_01 - 1 - ld b,$F6 ; "0" -.FirstDigit - sub 10 - jr c,.SecondDigit - inc b - jr .FirstDigit -.SecondDigit - add 10 - push af - ld a,b - ld [de],a - inc de - pop af - ld b,$F6 ; "0" - add b - ld [de],a - inc de - ld a,"@" - ld [de],a - - pop af - ld [$D11E],a - pop bc - pop de - pop hl - ret - -TechnicalPrefix:: ; 303c (0:303c) - db "TM" -HiddenPrefix:: ; 303e (0:303e) - db "HM" - -; sets carry if item is HM, clears carry if item is not HM -; Input: a = item ID -IsItemHM:: ; 3040 (0:3040) - cp a,HM_01 - jr c,.notHM - cp a,TM_01 - ret -.notHM - and a - ret - -; sets carry if move is an HM, clears carry if move is not an HM -; Input: a = move ID -IsMoveHM:: ; 3049 (0:3049) - ld hl,HMMoves - ld de,1 - jp IsInArray - -HMMoves:: ; 3052 (0:3052) - db CUT,FLY,SURF,STRENGTH,FLASH - db $ff ; terminator - -GetMoveName:: ; 3058 (0:3058) - push hl - ld a,MOVE_NAME - ld [W_LISTTYPE],a - ld a,[$d11e] - ld [$d0b5],a - ld a,BANK(MoveNames) - ld [$d0b7],a - call GetName - ld de,$cd6d ; pointer to where move name is stored in RAM - pop hl - ret - -; reloads text box tile patterns, current map view, and tileset tile patterns -ReloadMapData:: ; 3071 (0:3071) - ld a,[H_LOADEDROMBANK] - push af - ld a,[W_CURMAP] - call SwitchToMapRomBank - call DisableLCD - call LoadTextBoxTilePatterns - call LoadCurrentMapView - call LoadTilesetTilePatternData - call EnableLCD - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -; reloads tileset tile patterns -ReloadTilesetTilePatterns:: ; 3090 (0:3090) - ld a,[H_LOADEDROMBANK] - push af - ld a,[W_CURMAP] - call SwitchToMapRomBank - call DisableLCD - call LoadTilesetTilePatternData - call EnableLCD - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -; shows the town map and lets the player choose a destination to fly to -ChooseFlyDestination:: ; 30a9 (0:30a9) - ld hl,$d72e - res 4,[hl] - ld b, BANK(LoadTownMap_Fly) - ld hl, LoadTownMap_Fly - jp Bankswitch - -; causes the text box to close waithout waiting for a button press after displaying text -DisableWaitingAfterTextDisplay:: ; 30b6 (0:30b6) - ld a,$01 - ld [$cc3c],a - ret - -; uses an item -; UseItem is used with dummy items to perform certain other functions as well -; INPUT: -; [$cf91] = item ID -; OUTPUT: -; [$cd6a] = success -; 00: unsucessful -; 01: successful -; 02: not able to be used right now, no extra menu displayed (only certain items use this) -UseItem:: ; 30bc (0:30bc) - ld b,BANK(UseItem_) - ld hl,UseItem_ - jp Bankswitch - -; confirms the item toss and then tosses the item -; INPUT: -; hl = address of inventory (either wNumBagItems or wNumBoxItems) -; [$cf91] = item ID -; [$cf92] = index of item within inventory -; [$cf96] = quantity to toss -; OUTPUT: -; clears carry flag if the item is tossed, sets carry flag if not -TossItem:: ; 30c4 (0:30c4) - ld a,[H_LOADEDROMBANK] - push af - ld a,BANK(TossItem_) - ld [H_LOADEDROMBANK],a - ld [$2000],a - call TossItem_ - pop de - ld a,d - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -; checks if an item is a key item -; INPUT: -; [$cf91] = item ID -; OUTPUT: -; [$d124] = result -; 00: item is not key item -; 01: item is key item -IsKeyItem:: ; 30d9 (0:30d9) - push hl - push de - push bc - callba IsKeyItem_ - pop bc - pop de - pop hl - ret - -; function to draw various text boxes -; INPUT: -; [$D125] = text box ID -DisplayTextBoxID:: ; 30e8 (0:30e8) - ld a,[H_LOADEDROMBANK] - push af - ld a,BANK(DisplayTextBoxID_) - ld [H_LOADEDROMBANK],a - ld [$2000],a - call DisplayTextBoxID_ - pop bc - ld a,b - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -Func_30fd:: ; 30fd (0:30fd) - ld a, [$cc57] - and a - ret nz - ld a, [$d736] - bit 1, a - ret nz - ld a, [$d730] - and $80 - ret - -Func_310e:: ; 310e (0:310e) - ld hl, $d736 - bit 0, [hl] - res 0, [hl] - jr nz, .asm_3146 - ld a, [$cc57] - and a - ret z - dec a - add a - ld d, $0 - ld e, a - ld hl, .pointerTable_3140 - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - ld a, [H_LOADEDROMBANK] - push af - ld a, [$cc58] - ld [H_LOADEDROMBANK], a - ld [$2000], a - ld a, [$cf10] - call CallFunctionInTable - pop af - ld [H_LOADEDROMBANK], a - ld [$2000], a - ret -.pointerTable_3140 - dw PointerTable_1a442 - dw PointerTable_1a510 - dw PointerTable_1a57d -.asm_3146 - ld b, BANK(Func_1a3e0) - ld hl, Func_1a3e0 - jp Bankswitch - -Func_314e:: ; 314e (0:314e) - ld b, BANK(Func_1a41d) - ld hl, Func_1a41d - jp Bankswitch - -Func_3156:: ; 3156 (0:3156) - ret - -; stores hl in [W_TRAINERHEADERPTR] -StoreTrainerHeaderPointer:: ; 3157 (0:3157) - ld a, h - ld [W_TRAINERHEADERPTR], a - ld a, l - ld [W_TRAINERHEADERPTR+1], a - ret - -; executes the current map script from the function pointer array provided in hl. -; a: map script index to execute (unless overridden by [$d733] bit 4) -ExecuteCurMapScriptInTable:: ; 3160 (0:3160) - push af - push de - call StoreTrainerHeaderPointer - pop hl - pop af - push hl - ld hl, W_FLAGS_D733 - bit 4, [hl] - res 4, [hl] - jr z, .useProvidedIndex ; test if map script index was overridden manually - ld a, [W_CURMAPSCRIPT] -.useProvidedIndex - pop hl - ld [W_CURMAPSCRIPT], a - call CallFunctionInTable - ld a, [W_CURMAPSCRIPT] - ret - -LoadGymLeaderAndCityName:: ; 317f (0:317f) - push de - ld de, wGymCityName - ld bc, $11 - call CopyData ; load city name - pop hl - ld de, wGymLeaderName - ld bc, $b - jp CopyData ; load gym leader name - -; reads specific information from trainer header (pointed to at W_TRAINERHEADERPTR) -; a: offset in header data -; 0 -> flag's bit (into wTrainerHeaderFlagBit) -; 2 -> flag's byte ptr (into hl) -; 4 -> before battle text (into hl) -; 6 -> after battle text (into hl) -; 8 -> end battle text (into hl) -ReadTrainerHeaderInfo:: ; 3193 (0:3193) - push de - push af - ld d, $0 - ld e, a - ld hl, W_TRAINERHEADERPTR - ld a, [hli] - ld l, [hl] - ld h, a - add hl, de - pop af - and a - jr nz, .nonZeroOffset - ld a, [hl] - ld [wTrainerHeaderFlagBit], a ; store flag's bit - jr .done -.nonZeroOffset - cp $2 - jr z, .readPointer ; read flag's byte ptr - cp $4 - jr z, .readPointer ; read before battle text - cp $6 - jr z, .readPointer ; read after battle text - cp $8 - jr z, .readPointer ; read end battle text - cp $a - jr nz, .done - ld a, [hli] ; read end battle text (2) but override the result afterwards (XXX why, bug?) - ld d, [hl] - ld e, a - jr .done -.readPointer - ld a, [hli] - ld h, [hl] - ld l, a -.done - pop de - ret - -; calls HandleBitArray -HandleBitArray_Bank0:: ; 31c7 (0:31c7) - ld a, $10 - jp Predef ; indirect jump to HandleBitArray (f666 (3:7666)) - -; direct talking to a trainer (rather than getting seen by one) -TalkToTrainer:: ; 31cc (0:31cc) - call StoreTrainerHeaderPointer - xor a - call ReadTrainerHeaderInfo ; read flag's bit - ld a, $2 - call ReadTrainerHeaderInfo ; read flag's byte ptr - ld a, [wTrainerHeaderFlagBit] - ld c, a - ld b, $2 - call HandleBitArray_Bank0 ; read trainer's flag - ld a, c - and a - jr z, .trainerNotYetFought ; test trainer's flag - ld a, $6 - call ReadTrainerHeaderInfo ; print after battle text - jp PrintText -.trainerNotYetFought ; 0x31ed - ld a, $4 - call ReadTrainerHeaderInfo ; print before battle text - call PrintText - ld a, $a - call ReadTrainerHeaderInfo ; (?) does nothing apparently (maybe bug in ReadTrainerHeaderInfo) - push de - ld a, $8 - call ReadTrainerHeaderInfo ; read end battle text - pop de - call PreBattleSaveRegisters - ld hl, W_FLAGS_D733 - set 4, [hl] ; activate map script index override (index is set below) - ld hl, wFlags_0xcd60 - bit 0, [hl] ; test if player is already being engaged by another trainer - ret nz - call EngageMapTrainer - ld hl, W_CURMAPSCRIPT - inc [hl] ; progress map script index (assuming it was 0 before) to start pre-battle routines - jp Func_325d - -; checks if any trainers are seeing the player and wanting to fight -CheckFightingMapTrainers:: ; 3219 (0:3219) - call CheckForEngagingTrainers - ld a, [$cf13] - cp $ff - jr nz, .trainerEngaging - xor a - ld [$cf13], a - ld [wTrainerHeaderFlagBit], a - ret -.trainerEngaging - ld hl, W_FLAGS_D733 - set 3, [hl] - ld [$cd4f], a - xor a - ld [$cd50], a - ld a, $4c - call Predef - ld a, BTN_RIGHT | BTN_LEFT | BTN_UP | BTN_DOWN - ld [wJoypadForbiddenButtonsMask], a - xor a - ldh [$b4], a - call TrainerWalkUpToPlayer_Bank0 - ld hl, W_CURMAPSCRIPT - inc [hl] ; progress to battle phase 1 (engaging) - ret - -Func_324c:: ; 324c (0:324c) - ld a, [$d730] - and $1 - ret nz - ld [wJoypadForbiddenButtonsMask], a - ld a, [$cf13] - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c - call DisplayTextID - -Func_325d:: ; 325d (0:325d) - xor a - ld [wJoypadForbiddenButtonsMask], a - call InitBattleEnemyParameters - ld hl, $d72d - set 6, [hl] - set 7, [hl] - ld hl, $d72e - set 1, [hl] - ld hl, W_CURMAPSCRIPT - inc [hl] ; progress to battle phase 2 (battling) - ret - -EndTrainerBattle:: ; 3275 (0:3275) - ld hl, $d126 - set 5, [hl] - set 6, [hl] - ld hl, $d72d - res 7, [hl] - ld hl, wFlags_0xcd60 - res 0, [hl] ; player is no longer engaged by any trainer - ld a, [W_ISINBATTLE] ; $d057 - cp $ff - jp z, ResetButtonPressedAndMapScript - ld a, $2 - call ReadTrainerHeaderInfo - ld a, [wTrainerHeaderFlagBit] - ld c, a - ld b, $1 - call HandleBitArray_Bank0 ; flag trainer as fought - ld a, [W_ENEMYMONORTRAINERCLASS] - cp $c8 - jr nc, .skipRemoveSprite ; test if trainer was fought (in that case skip removing the corresponding sprite) - ld hl, W_MISSABLEOBJECTLIST - ld de, $2 - ld a, [$cf13] - call IsInArray ; search for sprite ID - inc hl - ld a, [hl] - ld [$cc4d], a ; load corresponding missable object index and remove it - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) -.skipRemoveSprite - ld hl, $d730 - bit 4, [hl] - res 4, [hl] - ret nz - -ResetButtonPressedAndMapScript:: ; 32c1 (0:32c1) - xor a - ld [wJoypadForbiddenButtonsMask], a - ld [H_CURRENTPRESSEDBUTTONS], a - ld [H_NEWLYPRESSEDBUTTONS], a - ld [H_NEWLYRELEASEDBUTTONS], a - ld [W_CURMAPSCRIPT], a ; reset battle status - ret - -; calls TrainerWalkUpToPlayer -TrainerWalkUpToPlayer_Bank0:: ; 32cf (0:32cf) - ld b, BANK(TrainerWalkUpToPlayer) - ld hl, TrainerWalkUpToPlayer - jp Bankswitch - -; sets opponent type and mon set/lvl based on the engaging trainer data -InitBattleEnemyParameters:: ; 32d7 (0:32d7) - ld a, [wEngagedTrainerClass] - ld [W_CUROPPONENT], a ; $d059 - ld [W_ENEMYMONORTRAINERCLASS], a - cp $c8 - ld a, [wEngagedTrainerSet] ; $cd2e - jr c, .noTrainer - ld [W_TRAINERNO], a ; $d05d - ret -.noTrainer - ld [W_CURENEMYLVL], a ; $d127 - ret - -Func_32ef:: ; 32ef (0:32ef) - ld hl, Func_567f9 - jr asm_3301 - -Func_32f4:: ; 32f4 (0:32f4) - ld hl, Func_56819 - jr asm_3301 ; 0x32f7 $8 - -Func_32f9:: ; 32f9 (0:32f9) - ld hl, Func_5683d - jr asm_3301 - -Func_32fe:: ; 32fe (0:32fe) - ld hl, Func_5685d -asm_3301:: ; 3301 (0:3301) - ld b, BANK(Func_567f9) ; BANK(Func_56819), BANK(Func_5683d), BANK(Func_5685d) - jp Bankswitch ; indirect jump to one of the four functions - -CheckForEngagingTrainers:: ; 3306 (0:3306) - xor a - call ReadTrainerHeaderInfo ; read trainer flag's bit (unused) - ld d, h ; store trainer header address in de - ld e, l -.trainerLoop - call StoreTrainerHeaderPointer ; set trainer header pointer to current trainer - ld a, [de] - ld [$cf13], a ; store trainer flag's bit - ld [wTrainerHeaderFlagBit], a - cp $ff - ret z - ld a, $2 - call ReadTrainerHeaderInfo ; read trainer flag's byte ptr - ld b, $2 - ld a, [wTrainerHeaderFlagBit] - ld c, a - call HandleBitArray_Bank0 ; read trainer flag - ld a, c - and a - jr nz, .trainerAlreadyFought - push hl - push de - push hl - xor a - call ReadTrainerHeaderInfo ; get trainer header pointer - inc hl - ld a, [hl] ; read trainer engage distance - pop hl - ld [wTrainerEngageDistance], a - ld a, [$cf13] - swap a - ld [wTrainerSpriteOffset], a ; $cd3d - ld a, $39 - call Predef ; indirect jump to CheckEngagePlayer (5690f (15:690f)) - pop de - pop hl - ld a, [wTrainerSpriteOffset] ; $cd3d - and a - ret nz ; break if the trainer is engaging -.trainerAlreadyFought - ld hl, $c - add hl, de - ld d, h - ld e, l - jr .trainerLoop - -; saves loaded rom bank and hl as well as de registers -PreBattleSaveRegisters:: ; 3354 (0:3354) - ld a, [H_LOADEDROMBANK] - ld [W_PBSTOREDROMBANK], a - ld a, h - ld [W_PBSTOREDREGISTERH], a - ld a, l - ld [W_PBSTOREDREGISTERL], a - ld a, d - ld [W_PBSTOREDREGISTERD], a - ld a, e - ld [W_PBSTOREDREGISTERE], a - ret - -; loads data of some trainer on the current map and plays pre-battle music -; [$cf13]: sprite ID of trainer who is engaged -EngageMapTrainer:: ; 336a (0:336a) - ld hl, W_MAPSPRITEEXTRADATA - ld d, $0 - ld a, [$cf13] - dec a - add a - ld e, a - add hl, de ; seek to engaged trainer data - ld a, [hli] ; load trainer class - ld [wEngagedTrainerClass], a - ld a, [hl] ; load trainer mon set - ld [wEnemyMonAttackMod], a ; $cd2e - jp PlayTrainerMusic - -Func_3381:: ; 3381 (0:3381) - push hl - ld hl, $d72d - bit 7, [hl] - res 7, [hl] - pop hl - ret z - ld a, [H_LOADEDROMBANK] - push af - ld a, [W_PBSTOREDROMBANK] - ld [H_LOADEDROMBANK], a - ld [$2000], a - push hl - callba SaveTrainerName - ld hl, TrainerNameText - call PrintText - pop hl - pop af - ld [H_LOADEDROMBANK], a - ld [$2000], a - callba Func_1a5e7 - jp WaitForSoundToFinish - -Func_33b7:: ; 33b7 (0:33b7) - ld a, [$cf0b] - and a - jr nz, .asm_33c6 - ld a, [W_PBSTOREDREGISTERH] - ld h, a - ld a, [W_PBSTOREDREGISTERL] - ld l, a - ret -.asm_33c6 - ld a, [W_PBSTOREDREGISTERD] - ld h, a - ld a, [W_PBSTOREDREGISTERE] - ld l, a - ret - -TrainerNameText:: ; 33cf (0:33cf) - TX_FAR _TrainerNameText - db $08 - -Func_33d4:: ; 33d4 (0:33d4) - call Func_33b7 - call TextCommandProcessor - jp TextScriptEnd - -Func_33dd:: ; 33dd (0:33dd) - ld a, [wFlags_0xcd60] - bit 0, a - ret nz - call EngageMapTrainer - xor a - ret - -PlayTrainerMusic:: ; 33e8 (0:33e8) - ld a, [wEngagedTrainerClass] - cp $c8 + SONY1 - ret z - cp $c8 + SONY2 - ret z - cp $c8 + SONY3 - ret z - ld a, [W_GYMLEADERNO] ; $d05c - and a - ret nz - xor a - ld [wMusicHeaderPointer], a - ld a, $ff - call PlaySound ; stop music - ld a, BANK(Music_MeetEvilTrainer) - ld [$c0ef], a - ld [$c0f0], a - ld a, [wEngagedTrainerClass] - ld b, a - ld hl, EvilTrainerList -.evilTrainerListLoop - ld a, [hli] - cp $ff - jr z, .noEvilTrainer - cp b - jr nz, .evilTrainerListLoop - ld a, MUSIC_MEET_EVIL_TRAINER - jr .PlaySound -.noEvilTrainer - ld hl, FemaleTrainerList -.femaleTrainerListLoop - ld a, [hli] - cp $ff - jr z, .maleTrainer - cp b - jr nz, .femaleTrainerListLoop - ld a, MUSIC_MEET_FEMALE_TRAINER - jr .PlaySound -.maleTrainer - ld a, MUSIC_MEET_MALE_TRAINER -.PlaySound - ld [$c0ee], a - jp PlaySound - -INCLUDE "data/trainer_types.asm" - -Func_3442:: ; 3442 (0:3442) - ld a, [hli] - cp $ff - ret z - cp b - jr nz, .asm_345b - ld a, [hli] - cp c - jr nz, .asm_345c - ld a, [hli] - ld d, [hl] - ld e, a - ld hl, $ccd3 - call DecodeRLEList - dec a - ld [$cd38], a - ret -.asm_345b - inc hl -.asm_345c - inc hl - inc hl - jr Func_3442 - -FuncTX_ItemStoragePC:: ; 3460 (0:3460) - call SaveScreenTilesToBuffer2 - ld b, BANK(PlayerPC) - ld hl, PlayerPC - jr bankswitchAndContinue - -FuncTX_BillsPC:: ; 346a (0:346a) - call SaveScreenTilesToBuffer2 - ld b, BANK(Func_214c2) - ld hl, Func_214c2 - jr bankswitchAndContinue - -FuncTX_SlotMachine:: ; 3474 (0:3474) -; XXX find a better name for this function -; special_F7 - ld b,BANK(CeladonPrizeMenu) - ld hl,CeladonPrizeMenu -bankswitchAndContinue:: ; 3479 (0:3479) - call Bankswitch - jp HoldTextDisplayOpen ; continue to main text-engine function - -FuncTX_PokemonCenterPC:: ; 347f (0:347f) - ld b, BANK(ActivatePC) - ld hl, ActivatePC - jr bankswitchAndContinue - -Func_3486:: ; 3486 (0:3486) - xor a - ld [$cd3b], a - ld [$c206], a - ld hl, $d730 - set 7, [hl] - ret - -IsItemInBag:: ; 3493 (0:3493) -; given an item_id in b -; set zero flag if item isn't in player's bag -; else reset zero flag -; related to Pokémon Tower and ghosts - ld a,$1C - call Predef - ld a,b - and a - ret - -DisplayPokedex:: ; 349b (0:349b) - ld [$d11e], a - ld b, BANK(Func_7c18) - ld hl, Func_7c18 - jp Bankswitch - -Func_34a6:: ; 34a6 (0:34a6) - call Func_34ae - ld c, $6 - jp DelayFrames - -Func_34ae:: ; 34ae (0:34ae) - ld a, $9 - ld [H_DOWNARROWBLINKCNT1], a ; $ff8b - call Func_34fc - ld a, [$ff8d] - ld [hl], a - ret - -Func_34b9:: ; 34b9 (0:34b9) - ld de, $fff9 - add hl, de - ld [hl], a - ret - -; tests if the player's coordinates are in a specified array -; INPUT: -; hl = address of array -; OUTPUT: -; [$cd3d] = if there is match, the matching array index -; sets carry if the coordinates are in the array, clears carry if not -ArePlayerCoordsInArray:: ; 34bf (0:34bf) - ld a,[W_YCOORD] - ld b,a - ld a,[W_XCOORD] - ld c,a - ; fallthrough - -CheckCoords:: ; 34c7 (0:34c7) - xor a - ld [$cd3d],a -.loop - ld a,[hli] - cp a,$ff ; reached terminator? - jr z,.notInArray - push hl - ld hl,$cd3d - inc [hl] - pop hl -.compareYCoord - cp b - jr z,.compareXCoord - inc hl - jr .loop -.compareXCoord - ld a,[hli] - cp c - jr nz,.loop -.inArray - scf - ret -.notInArray - and a - ret - -; tests if a boulder's coordinates are in a specified array -; INPUT: -; hl = address of array -; ff8c = which boulder to check? XXX -; OUTPUT: -; [$cd3d] = if there is match, the matching array index -; sets carry if the coordinates are in the array, clears carry if not -CheckBoulderCoords:: ; 34e4 (0:34e4) - push hl - ld hl, $c204 - ld a, [$ff8c] - swap a - ld d, $0 - ld e, a - add hl, de - ld a, [hli] - sub $4 ; because sprite coordinates are offset by 4 - ld b, a - ld a, [hl] - sub $4 ; because sprite coordinates are offset by 4 - ld c, a - pop hl - jp CheckCoords - -Func_34fc:: ; 34fc (0:34fc) - ld h, $c1 - jr asm_3502 - -Func_3500:: ; 3500 (0:3500) - ld h, $c2 -asm_3502:: ; 3502 (0:3502) - ld a, [H_DOWNARROWBLINKCNT1] ; $ff8b - ld b, a - ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c - swap a - add b - ld l, a - ret - -; decodes a $ff-terminated RLEncoded list -; each entry is a pair of bytes <byte value> <repetitions> -; the final $ff will be replicated in the output list and a contains the number of bytes written -; de: input list -; hl: output list -DecodeRLEList:: ; 350c (0:350c) - xor a - ld [wRLEByteCount], a ; count written bytes here -.listLoop - ld a, [de] - cp $ff - jr z, .endOfList - ld [H_DOWNARROWBLINKCNT1], a ; store byte value to be written - inc de - ld a, [de] - ld b, $0 - ld c, a ; number of bytes to be written - ld a, [wRLEByteCount] - add c - ld [wRLEByteCount], a ; update total number of written bytes - ld a, [H_DOWNARROWBLINKCNT1] ; $ff8b - call FillMemory ; write a c-times to output - inc de - jr .listLoop -.endOfList - ld a, $ff - ld [hl], a ; write final $ff - ld a, [wRLEByteCount] - inc a ; include sentinel in counting - ret - -; sets movement byte 1 for sprite [$FF8C] to $FE and byte 2 to [$FF8D] -SetSpriteMovementBytesToFE:: ; 3533 (0:3533) - push hl - call GetSpriteMovementByte1Pointer - ld [hl], $fe - call GetSpriteMovementByte2Pointer - ld a, [$ff8d] - ld [hl], a - pop hl - ret - -; sets both movement bytes for sprite [$FF8C] to $FF -SetSpriteMovementBytesToFF:: ; 3541 (0:3541) - push hl - call GetSpriteMovementByte1Pointer - ld [hl],$FF - call GetSpriteMovementByte2Pointer - ld [hl],$FF ; prevent person from walking? - pop hl - ret - -; returns the sprite movement byte 1 pointer for sprite [$FF8C] in hl -GetSpriteMovementByte1Pointer:: ; 354e (0:354e) - ld h,$C2 - ld a,[$FF8C] ; the sprite to move - swap a - add a,6 - ld l,a - ret - -; returns the sprite movement byte 2 pointer for sprite [$FF8C] in hl -GetSpriteMovementByte2Pointer:: ; 3558 (0:3558) - push de - ld hl,W_MAPSPRITEDATA - ld a,[$FF8C] ; the sprite to move - dec a - add a - ld d,0 - ld e,a - add hl,de - pop de - ret - -GetTrainerInformation:: ; 3566 (0:3566) - call GetTrainerName - ld a, [W_ISLINKBATTLE] ; $d12b - and a - jr nz, .linkBattle - ld a, Bank(TrainerPicAndMoneyPointers) - call BankswitchHome - ld a, [W_TRAINERCLASS] ; $d031 - dec a - ld hl, TrainerPicAndMoneyPointers - ld bc, $5 - call AddNTimes - ld de, $d033 - ld a, [hli] - ld [de], a - inc de - ld a, [hli] - ld [de], a - ld de, $d046 - ld a, [hli] - ld [de], a - inc de - ld a, [hli] - ld [de], a - jp BankswitchBack -.linkBattle - ld hl, $d033 - ld de, RedPicFront - ld [hl], e - inc hl - ld [hl], d - ret - -GetTrainerName:: ; 359e (0:359e) - ld b, BANK(GetTrainerName_) - ld hl, GetTrainerName_ - jp Bankswitch - -; tests if player's money are at least as much as [$ff9f] -; sets carry flag if not enough money -; sets zero flag if amounts match exactly -HasEnoughMoney:: ; 35a6 (0:35a6) - ld de, wPlayerMoney ; $d347 - ld hl, $ff9f - ld c, $3 - jp StringCmp - -; tests if player's game corner coins are at least as many as [$ffa0] -; sets carry flag if not enough coins -; sets zero flag if amounts match exactly -HasEnoughCoins:: ; 35b1 (0:35b1) - ld de, wPlayerCoins - ld hl, $ffa0 - ld c, $2 - jp StringCmp - -BankswitchHome:: ; 35bc (0:35bc) -; switches to bank # in a -; Only use this when in the home bank! - ld [$CF09],a - ld a,[H_LOADEDROMBANK] - ld [$CF08],a - ld a,[$CF09] - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -BankswitchBack:: ; 35cd (0:35cd) -; returns from BankswitchHome - ld a,[$CF08] - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -Bankswitch:: ; 35d6 (0:35d6) -; self-contained bankswitch, use this when not in the home bank -; switches to the bank in b - ld a,[H_LOADEDROMBANK] - push af - ld a,b - ld [H_LOADEDROMBANK],a - ld [$2000],a - ld bc,.Return - push bc - jp [hl] -.Return - pop bc - ld a,b - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -; displays yes/no choice -; yes -> set carry -YesNoChoice:: ; 35ec (0:35ec) - call SaveScreenTilesToBuffer1 - call InitYesNoTextBoxParameters - jr DisplayYesNoChoice - -Func_35f4:: ; 35f4 (0:35f4) - ld a, $14 - ld [$d125], a - call InitYesNoTextBoxParameters - jp DisplayTextBoxID - -InitYesNoTextBoxParameters:: ; 35ff (0:35ff) - xor a - ld [$d12c], a - FuncCoord 14, 7 ; $c43a - ld hl, Coord - ld bc, $80f - ret - -YesNoChoicePokeCenter:: ; 360a (0:360a) - call SaveScreenTilesToBuffer1 - ld a, $6 - ld [$d12c], a - FuncCoord 11, 6 ; $c423 - ld hl, Coord - ld bc, $80c - jr DisplayYesNoChoice - -Func_361a:: ; 361a (0:361a) - call SaveScreenTilesToBuffer1 - ld a, $3 - ld [$d12c], a - FuncCoord 12, 7 ; $c438 - ld hl, Coord - ld bc, $080d -DisplayYesNoChoice:: ; 3628 (0:3628) - ld a, $14 - ld [$d125], a - call DisplayTextBoxID - jp LoadScreenTilesFromBuffer1 - -; calculates the difference |a-b|, setting carry flag if a<b -CalcDifference:: ; 3633 (0:3633) - sub b - ret nc - cpl - add $1 - scf - ret - -MoveSprite:: ; 363a (0:363a) -; move the sprite [$FF8C] with the movement pointed to by de -; actually only copies the movement data to $CC5B for later - call SetSpriteMovementBytesToFF -MoveSprite_:: ; 363d (0:363d) - push hl - push bc - call GetSpriteMovementByte1Pointer - xor a - ld [hl],a - ld hl,$CC5B - ld c,0 - -.loop - ld a,[de] - ld [hli],a - inc de - inc c - cp a,$FF ; have we reached the end of the movement data? - jr nz,.loop - - ld a,c - ld [$CF0F],a ; number of steps taken - - pop bc - ld hl,$D730 - set 0,[hl] - pop hl - xor a - ld [$CD3B],a - ld [$CCD3],a - dec a - ld [wJoypadForbiddenButtonsMask],a - ld [$CD3A],a - ret - -Func_366b:: ; 366b (0:366b) - push hl - ld hl, $ffe7 - xor a - ld [hld], a - ld a, [hld] - and a - jr z, .asm_367e - ld a, [hli] -.asm_3676 - sub [hl] - jr c, .asm_367e - inc hl - inc [hl] - dec hl - jr .asm_3676 -.asm_367e - pop hl - ret - -; copies the tile patterns for letters and numbers into VRAM -LoadFontTilePatterns:: ; 3680 (0:3680) - ld a,[rLCDC] - bit 7,a ; is the LCD enabled? - jr nz,.lcdEnabled -.lcdDisabled - ld hl,FontGraphics - ld de,$8800 - ld bc,$400 - ld a,BANK(FontGraphics) - jp FarCopyDataDouble ; if LCD is off, transfer all at once -.lcdEnabled - ld de,FontGraphics - ld hl,$8800 - ld bc,(BANK(FontGraphics) << 8 | $80) - jp CopyVideoDataDouble ; if LCD is on, transfer during V-blank - -; copies the text box tile patterns into VRAM -LoadTextBoxTilePatterns:: ; 36a0 (0:36a0) - ld a,[rLCDC] - bit 7,a ; is the LCD enabled? - jr nz,.lcdEnabled -.lcdDisabled - ld hl,TextBoxGraphics - ld de,$9600 - ld bc,$0200 - ld a,BANK(TextBoxGraphics) - jp FarCopyData2 ; if LCD is off, transfer all at once -.lcdEnabled - ld de,TextBoxGraphics - ld hl,$9600 - ld bc,(BANK(TextBoxGraphics) << 8 | $20) - jp CopyVideoData ; if LCD is on, transfer during V-blank - -; copies HP bar and status display tile patterns into VRAM -LoadHpBarAndStatusTilePatterns:: ; 36c0 (0:36c0) - ld a,[rLCDC] - bit 7,a ; is the LCD enabled? - jr nz,.lcdEnabled -.lcdDisabled - ld hl,HpBarAndStatusGraphics - ld de,$9620 - ld bc,$01e0 - ld a,BANK(HpBarAndStatusGraphics) - jp FarCopyData2 ; if LCD is off, transfer all at once -.lcdEnabled - ld de,HpBarAndStatusGraphics - ld hl,$9620 - ld bc,(BANK(HpBarAndStatusGraphics) << 8 | $1e) - jp CopyVideoData ; if LCD is on, transfer during V-blank - -;Fills memory range with the specified byte. -;input registers a = fill_byte, bc = length, hl = address -FillMemory:: ; 36e0 (0:36e0) - push de - ld d, a -.loop - ld a, d - ldi [hl], a - dec bc - ld a, b - or c - jr nz, .loop - pop de - ret - -; loads sprite that de points to -; bank of sprite is given in a -UncompressSpriteFromDE:: ; 36eb (0:36eb) - ld hl, W_SPRITEINPUTPTR - ld [hl], e - inc hl - ld [hl], d - jp UncompressSpriteData - -SaveScreenTilesToBuffer2:: ; 36f4 (0:36f4) - ld hl, wTileMap - ld de, wTileMapBackup2 - ld bc, $168 - call CopyData - ret - -LoadScreenTilesFromBuffer2:: ; 3701 (0:3701) - call LoadScreenTilesFromBuffer2DisableBGTransfer - ld a, $1 - ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - ret - -; loads screen tiles stored in wTileMapBackup2 but leaves H_AUTOBGTRANSFERENABLED disabled -LoadScreenTilesFromBuffer2DisableBGTransfer:: ; 3709 (0:3709) - xor a - ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - ld hl, wTileMapBackup2 - ld de, wTileMap - ld bc, $168 - call CopyData - ret - -SaveScreenTilesToBuffer1:: ; 3719 (0:3719) - ld hl, wTileMap - ld de, wTileMapBackup - ld bc, $168 - jp CopyData - -LoadScreenTilesFromBuffer1:: ; 3725 (0:3725) - xor a - ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - ld hl, wTileMapBackup - ld de, wTileMap - ld bc, $168 - call CopyData - ld a, $1 - ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - ret - -DelayFrames:: ; 3739 (0:3739) -; wait n frames, where n is the value in c - call DelayFrame - dec c - jr nz,DelayFrames - ret - -PlaySoundWaitForCurrent:: ; 3740 (0:3740) - push af - call WaitForSoundToFinish - pop af - jp PlaySound - -; Wait for sound to finish playing -WaitForSoundToFinish:: ; 3748 (0:3748) - ld a, [$d083] - and $80 - ret nz - push hl -.asm_374f - ld hl, $c02a - xor a - or [hl] - inc hl - or [hl] - inc hl - inc hl - or [hl] - jr nz, .asm_374f - pop hl - ret - -NamePointers:: ; 375d (0:375d) - dw MonsterNames - dw MoveNames - dw UnusedNames - dw ItemNames - dw W_PARTYMON1OT ; player's OT names list - dw W_ENEMYMON1OT ; enemy's OT names list - dw TrainerNames - -GetName:: ; 376b (0:376b) -; arguments: -; [$D0B5] = which name -; [$D0B6] = which list (W_LISTTYPE) -; [$D0B7] = bank of list -; -; returns pointer to name in de - ld a,[$d0b5] - ld [$d11e],a - cp a,$C4 ;it's TM/HM - jp nc,GetMachineName - ld a,[H_LOADEDROMBANK] - push af - push hl - push bc - push de - ld a,[W_LISTTYPE] ;List3759_entrySelector - dec a - jr nz,.otherEntries - ;1 = MON_NAMES - call GetMonName - ld hl,11 - add hl,de - ld e,l - ld d,h - jr .gotPtr -.otherEntries ; $378d - ;2-7 = OTHER ENTRIES - ld a,[$d0b7] - ld [H_LOADEDROMBANK],a - ld [$2000],a - ld a,[W_LISTTYPE] ;VariousNames' entryID - dec a - add a - ld d,0 - ld e,a - jr nc,.skip - inc d -.skip ; $37a0 - ld hl,NamePointers - add hl,de - ld a,[hli] - ld [$ff96],a - ld a,[hl] - ld [$ff95],a - ld a,[$ff95] - ld h,a - ld a,[$ff96] - ld l,a - ld a,[$d0b5] - ld b,a - ld c,0 -.nextName - ld d,h - ld e,l -.nextChar - ld a,[hli] - cp a, "@" - jr nz,.nextChar - inc c ;entry counter - ld a,b ;wanted entry - cp c - jr nz,.nextName - ld h,d - ld l,e - ld de,$cd6d - ld bc,$0014 - call CopyData -.gotPtr ; $37cd - ld a,e - ld [$cf8d],a - ld a,d - ld [$cf8e],a - pop de - pop bc - pop hl - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -GetItemPrice:: ; 37df (0:37df) - ld a, [H_LOADEDROMBANK] - push af - ld a, [wListMenuID] ; $cf94 - cp $1 - ld a, $1 ; hardcoded Bank - jr nz, .asm_37ed - ld a, $f ; hardcoded Bank -.asm_37ed - ld [H_LOADEDROMBANK], a - ld [$2000], a - ld hl, $cf8f - ld a, [hli] - ld h, [hl] - ld l, a - ld a, [$cf91] - cp HM_01 - jr nc, .asm_3812 - ld bc, $3 -.asm_3802 - add hl, bc - dec a - jr nz, .asm_3802 - dec hl - ld a, [hld] - ld [$ff8d], a - ld a, [hld] - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c - ld a, [hl] - ld [H_DOWNARROWBLINKCNT1], a ; $ff8b - jr .asm_381c -.asm_3812 - ld a, Bank(GetMachinePrice) - ld [H_LOADEDROMBANK], a - ld [$2000], a - call GetMachinePrice -.asm_381c - ld de, H_DOWNARROWBLINKCNT1 ; $ff8b - pop af - ld [H_LOADEDROMBANK], a - ld [$2000], a - ret - -; copies a string from [de] to [$cf4b] -CopyStringToCF4B:: ; 3826 (0:3826) - ld hl, $cf4b - ; fall through - -; copies a string from [de] to [hl] -CopyString:: ; 3829 (0:3829) - ld a, [de] - inc de - ld [hli], a - cp "@" - jr nz, CopyString - ret - -; this function is used when lower button sensitivity is wanted (e.g. menus) -; OUTPUT: [$ffb5] = pressed buttons in usual format -; there are two flags that control its functionality, [$ffb6] and [$ffb7] -; there are esentially three modes of operation -; 1. Get newly pressed buttons only -; ([$ffb7] == 0, [$ffb6] == any) -; Just copies [H_NEWLYPRESSEDBUTTONS] to [$ffb5]. -; 2. Get currently pressed buttons at low sample rate with delay -; ([$ffb7] == 1, [$ffb6] != 0) -; If the user holds down buttons for more than half a second, -; report buttons as being pressed up to 12 times per second thereafter. -; If the user holds down buttons for less than half a second, -; report only one button press. -; 3. Same as 2, but report no buttons as pressed if A or B is held down. -; ([$ffb7] == 1, [$ffb6] == 0) -GetJoypadStateLowSensitivity:: ; 3831 (0:3831) - call GetJoypadState - ld a,[$ffb7] ; flag - and a ; get all currently pressed buttons or only newly pressed buttons? - ld a,[H_NEWLYPRESSEDBUTTONS] ; newly pressed buttons - jr z,.storeButtonState - ld a,[H_CURRENTPRESSEDBUTTONS] ; all currently pressed buttons -.storeButtonState - ld [$ffb5],a - ld a,[H_NEWLYPRESSEDBUTTONS] ; newly pressed buttons - and a ; have any buttons been newly pressed since last check? - jr z,.noNewlyPressedButtons -.newlyPressedButtons - ld a,30 ; half a second delay - ld [H_FRAMECOUNTER],a - ret -.noNewlyPressedButtons - ld a,[H_FRAMECOUNTER] - and a ; is the delay over? - jr z,.delayOver -.delayNotOver - xor a - ld [$ffb5],a ; report no buttons as pressed - ret -.delayOver -; if [$ffb6] = 0 and A or B is pressed, report no buttons as pressed - ld a,[H_CURRENTPRESSEDBUTTONS] - and a,%00000011 ; A and B buttons - jr z,.setShortDelay - ld a,[$ffb6] ; flag - and a - jr nz,.setShortDelay - xor a - ld [$ffb5],a -.setShortDelay - ld a,5 ; 1/12 of a second delay - ld [H_FRAMECOUNTER],a - ret - -WaitForTextScrollButtonPress:: ; 3865 (0:3865) - ld a, [H_DOWNARROWBLINKCNT1] ; $ff8b - push af - ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c - push af - xor a - ld [H_DOWNARROWBLINKCNT1], a ; $ff8b - ld a, $6 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c -.asm_3872 - push hl - ld a, [$d09b] - and a - jr z, .asm_387c - call Func_716c6 -.asm_387c - FuncCoord 18, 16 ; $c4f2 - ld hl, Coord - call HandleDownArrowBlinkTiming - pop hl - call GetJoypadStateLowSensitivity - ld a, $2d - call Predef ; indirect jump to Func_5a5f (5a5f (1:5a5f)) - ld a, [$ffb5] - and BTN_A | BTN_B ; $3 - jr z, .asm_3872 - pop af - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c - pop af - ld [H_DOWNARROWBLINKCNT1], a ; $ff8b - ret - -; (unlass in link battle) waits for A or B being pressed and outputs the scrolling sound effect -ManualTextScroll:: ; 3898 (0:3898) - ld a, [W_ISLINKBATTLE] ; $d12b - cp $4 - jr z, .inLinkBattle - call WaitForTextScrollButtonPress - ld a, (SFX_02_40 - SFX_Headers_02) / 3 - jp PlaySound -.inLinkBattle - ld c, $41 - jp DelayFrames - -; function to do multiplication -; all values are big endian -; INPUT -; FF96-FF98 = multiplicand -; FF99 = multiplier -; OUTPUT -; FF95-FF98 = product -Multiply:: ; 38ac (0:38ac) - push hl - push bc - callab _Multiply - pop bc - pop hl - ret - -; function to do division -; all values are big endian -; INPUT -; FF95-FF98 = dividend -; FF99 = divisor -; b = number of bytes in the dividend (starting from FF95) -; OUTPUT -; FF95-FF98 = quotient -; FF99 = remainder -Divide:: ; 38b9 (0:38b9) - push hl - push de - push bc - ld a,[H_LOADEDROMBANK] - push af - ld a,Bank(_Divide) - ld [H_LOADEDROMBANK],a - ld [$2000],a - call _Divide - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - pop bc - pop de - pop hl - ret - -; This function is used to wait a short period after printing a letter to the -; screen unless the player presses the A/B button or the delay is turned off -; through the [$d730] or [$d358] flags. -PrintLetterDelay:: ; 38d3 (0:38d3) - ld a,[$d730] - bit 6,a - ret nz - ld a,[$d358] - bit 1,a - ret z - push hl - push de - push bc - ld a,[$d358] - bit 0,a - jr z,.waitOneFrame - ld a,[$d355] - and a,$0f - ld [H_FRAMECOUNTER],a - jr .checkButtons -.waitOneFrame - ld a,1 - ld [H_FRAMECOUNTER],a -.checkButtons - call GetJoypadState - ld a,[H_CURRENTPRESSEDBUTTONS] -.checkAButton - bit 0,a ; is the A button pressed? - jr z,.checkBButton - jr .endWait -.checkBButton - bit 1,a ; is the B button pressed? - jr z,.buttonsNotPressed -.endWait - call DelayFrame - jr .done -.buttonsNotPressed ; if neither A nor B is pressed - ld a,[H_FRAMECOUNTER] - and a - jr nz,.checkButtons -.done - pop bc - pop de - pop hl - ret - -; Copies [hl, bc) to [de, bc - hl). -; In other words, the source data is from hl up to but not including bc, -; and the destination is de. -CopyDataUntil:: ; 3913 (0:3913) - ld a,[hli] - ld [de],a - inc de - ld a,h - cp b - jr nz,CopyDataUntil - ld a,l - cp c - jr nz,CopyDataUntil - ret - -; Function to remove a pokemon from the party or the current box. -; wWhichPokemon determines the pokemon. -; [$cf95] == 0 specifies the party. -; [$cf95] != 0 specifies the current box. -RemovePokemon:: ; 391f (0:391f) - ld hl, _RemovePokemon - ld b, BANK(_RemovePokemon) - jp Bankswitch - -AddPokemonToParty:: ; 3927 (0:3927) - push hl - push de - push bc - callba _AddPokemonToParty - pop bc - pop de - pop hl - ret - -; calculates all 5 stats of current mon and writes them to [de] -CalcStats:: ; 3936 (0:3936) - ld c, $0 -.statsLoop - inc c - call CalcStat - ld a, [H_MULTIPLICAND+1] - ld [de], a - inc de - ld a, [H_MULTIPLICAND+2] - ld [de], a - inc de - ld a, c - cp $5 - jr nz, .statsLoop - ret - -; calculates stat c of current mon -; c: stat to calc (HP=1,Atk=2,Def=3,Spd=4,Spc=5) -; b: consider stat exp? -; hl: base ptr to stat exp values ([hl + 2*c - 1] and [hl + 2*c]) -CalcStat:: ; 394a (0:394a) - push hl - push de - push bc - ld a, b - ld d, a - push hl - ld hl, W_MONHEADER - ld b, $0 - add hl, bc - ld a, [hl] ; read base value of stat - ld e, a - pop hl - push hl - sla c - ld a, d - and a - jr z, .statExpDone ; consider stat exp? - add hl, bc ; skip to corresponding stat exp value -.statExpLoop ; calculates ceil(Sqrt(stat exp)) in b - xor a - ld [H_MULTIPLICAND], a - ld [H_MULTIPLICAND+1], a - inc b ; increment current stat exp bonus - ld a, b - cp $ff - jr z, .statExpDone - ld [H_MULTIPLICAND+2], a - ld [H_MULTIPLIER], a - call Multiply - ld a, [hld] - ld d, a - ld a, [$ff98] - sub d - ld a, [hli] - ld d, a - ld a, [$ff97] - sbc d ; test if (current stat exp bonus)^2 < stat exp - jr c, .statExpLoop -.statExpDone - srl c - pop hl - push bc - ld bc, $b ; skip to stat IV values - add hl, bc - pop bc - ld a, c - cp $2 - jr z, .getAttackIV - cp $3 - jr z, .getDefenseIV - cp $4 - jr z, .getSpeedIV - cp $5 - jr z, .getSpecialIV -.getHpIV - push bc - ld a, [hl] ; Atk IV - swap a - and $1 - sla a - sla a - sla a - ld b, a - ld a, [hli] ; Def IV - and $1 - sla a - sla a - add b - ld b, a - ld a, [hl] ; Spd IV - swap a - and $1 - sla a - add b - ld b, a - ld a, [hl] ; Spc IV - and $1 - add b ; HP IV: LSB of the other 4 IVs - pop bc - jr .calcStatFromIV -.getAttackIV - ld a, [hl] - swap a - and $f - jr .calcStatFromIV -.getDefenseIV - ld a, [hl] - and $f - jr .calcStatFromIV -.getSpeedIV - inc hl - ld a, [hl] - swap a - and $f - jr .calcStatFromIV -.getSpecialIV - inc hl - ld a, [hl] - and $f -.calcStatFromIV - ld d, $0 - add e - ld e, a - jr nc, .noCarry - inc d ; de = Base + IV -.noCarry - sla e - rl d ; de = (Base + IV) * 2 - srl b - srl b ; b = ceil(Sqrt(stat exp)) / 4 - ld a, b - add e - jr nc, .noCarry2 - inc d ; da = (Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4 -.noCarry2 - ld [H_MULTIPLICAND+2], a - ld a, d - ld [H_MULTIPLICAND+1], a - xor a - ld [H_MULTIPLICAND], a - ld a, [W_CURENEMYLVL] ; $d127 - ld [H_MULTIPLIER], a - call Multiply ; ((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level - ld a, [H_MULTIPLICAND] - ld [H_DIVIDEND], a - ld a, [H_MULTIPLICAND+1] - ld [H_DIVIDEND+1], a - ld a, [H_MULTIPLICAND+2] - ld [H_DIVIDEND+2], a - ld a, $64 - ld [H_DIVISOR], a - ld a, $3 - ld b, a - call Divide ; (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 - ld a, c - cp $1 - ld a, $5 - jr nz, .notHPStat - ld a, [W_CURENEMYLVL] ; $d127 - ld b, a - ld a, [H_MULTIPLICAND+2] - add b - ld [H_MULTIPLICAND+2], a - jr nc, .noCarry3 - ld a, [H_MULTIPLICAND+1] - inc a - ld [H_MULTIPLICAND+1], a ; HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + Level -.noCarry3 - ld a, $a -.notHPStat - ld b, a - ld a, [H_MULTIPLICAND+2] - add b - ld [H_MULTIPLICAND+2], a - jr nc, .noCarry4 - ld a, [H_MULTIPLICAND+1] - inc a ; non-HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + 5 - ld [H_MULTIPLICAND+1], a ; HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + Level + 10 -.noCarry4 - ld a, [H_MULTIPLICAND+1] ; check for overflow (>999) - cp $4 - jr nc, .overflow - cp $3 - jr c, .noOverflow - ld a, [H_MULTIPLICAND+2] - cp $e8 - jr c, .noOverflow -.overflow - ld a, $3 ; overflow: cap at 999 - ld [H_MULTIPLICAND+1], a - ld a, $e7 - ld [H_MULTIPLICAND+2], a -.noOverflow - pop bc - pop de - pop hl - ret - -AddEnemyMonToPlayerParty:: ; 3a53 (0:3a53) - ld a, [H_LOADEDROMBANK] - push af - ld a, BANK(_AddEnemyMonToPlayerParty) - ld [H_LOADEDROMBANK], a - ld [$2000], a - call _AddEnemyMonToPlayerParty - pop bc - ld a, b - ld [H_LOADEDROMBANK], a - ld [$2000], a - ret - -Func_3a68:: ; 3a68 (0:3a68) - ld a, [H_LOADEDROMBANK] - push af - ld a, BANK(Func_f51e) - ld [H_LOADEDROMBANK], a - ld [$2000], a - call Func_f51e - pop bc - ld a, b - ld [H_LOADEDROMBANK], a - ld [$2000], a - ret - -; skips a text entries, each of size $b (like trainer name, OT name, rival name, ...) -; hl: base pointer, will be incremented by $b * a -SkipFixedLengthTextEntries:: ; 3a7d (0:3a7d) - and a - ret z - ld bc, $b -.skipLoop - add hl, bc - dec a - jr nz, .skipLoop - ret - -AddNTimes:: ; 3a87 (0:3a87) -; add bc to hl a times - and a - ret z -.loop - add hl,bc - dec a - jr nz,.loop - ret - -; Compare strings, c bytes in length, at de and hl. -; Often used to compare big endian numbers in battle calculations. -StringCmp:: ; 3a8e (0:3a8e) - ld a,[de] - cp [hl] - ret nz - inc de - inc hl - dec c - jr nz,StringCmp - ret - -; INPUT: -; a = oam block index (each block is 4 oam entries) -; b = Y coordinate of upper left corner of sprite -; c = X coordinate of upper left corner of sprite -; de = base address of 4 tile number and attribute pairs -WriteOAMBlock:: ; 3a97 (0:3a97) - ld h,$c3 - swap a ; multiply by 16 - ld l,a - call .writeOneEntry ; upper left - push bc - ld a,8 - add c - ld c,a - call .writeOneEntry ; upper right - pop bc - ld a,8 - add b - ld b,a - call .writeOneEntry ; lower left - ld a,8 - add c - ld c,a - ; lower right -.writeOneEntry - ld [hl],b ; Y coordinate - inc hl - ld [hl],c ; X coordinate - inc hl - ld a,[de] ; tile number - inc de - ld [hli],a - ld a,[de] ; attribute - inc de - ld [hli],a - ret - -HandleMenuInput:: ; 3abe (0:3abe) - xor a - ld [$d09b],a - -HandleMenuInputPokemonSelection:: ; 3ac2 (0:3ac2) - ld a,[H_DOWNARROWBLINKCNT1] - push af - ld a,[H_DOWNARROWBLINKCNT2] - push af ; save existing values on stack - xor a - ld [H_DOWNARROWBLINKCNT1],a ; blinking down arrow timing value 1 - ld a,$06 - ld [H_DOWNARROWBLINKCNT2],a ; blinking down arrow timing value 2 -.loop1 - xor a - ld [$d08b],a ; counter for pokemon shaking animation - call PlaceMenuCursor - call Delay3 -.loop2 - push hl - ld a,[$d09b] - and a ; is it a pokemon selection menu? - jr z,.getJoypadState - callba AnimatePartyMon ; shake mini sprite of selected pokemon -.getJoypadState - pop hl - call GetJoypadStateLowSensitivity - ld a,[$ffb5] - and a ; was a key pressed? - jr nz,.keyPressed - push hl - FuncCoord 18,11 ; coordinates of blinking down arrow in some menus - ld hl,Coord - call HandleDownArrowBlinkTiming ; blink down arrow (if any) - pop hl - ld a,[wMenuJoypadPollCount] - dec a - jr z,.giveUpWaiting - jr .loop2 -.giveUpWaiting -; if a key wasn't pressed within the specified number of checks - pop af - ld [H_DOWNARROWBLINKCNT2],a - pop af - ld [H_DOWNARROWBLINKCNT1],a ; restore previous values - xor a - ld [wMenuWrappingEnabled],a ; disable menu wrapping - ret -.keyPressed - xor a - ld [$cc4b],a - ld a,[$ffb5] - ld b,a - bit 6,a ; pressed Up key? - jr z,.checkIfDownPressed -.upPressed - ld a,[wCurrentMenuItem] ; selected menu item - and a ; already at the top of the menu? - jr z,.alreadyAtTop -.notAtTop - dec a - ld [wCurrentMenuItem],a ; move selected menu item up one space - jr .checkOtherKeys -.alreadyAtTop - ld a,[wMenuWrappingEnabled] - and a ; is wrapping around enabled? - jr z,.noWrappingAround - ld a,[wMaxMenuItem] - ld [wCurrentMenuItem],a ; wrap to the bottom of the menu - jr .checkOtherKeys -.checkIfDownPressed - bit 7,a - jr z,.checkOtherKeys -.downPressed - ld a,[wCurrentMenuItem] - inc a - ld c,a - ld a,[wMaxMenuItem] - cp c - jr nc,.notAtBottom -.alreadyAtBottom - ld a,[wMenuWrappingEnabled] - and a ; is wrapping around enabled? - jr z,.noWrappingAround - ld c,$00 ; wrap from bottom to top -.notAtBottom - ld a,c - ld [wCurrentMenuItem],a -.checkOtherKeys - ld a,[wMenuWatchedKeys] - and b ; does the menu care about any of the pressed keys? - jp z,.loop1 -.checkIfAButtonOrBButtonPressed - ld a,[$ffb5] - and a,%00000011 ; pressed A button or B button? - jr z,.skipPlayingSound -.AButtonOrBButtonPressed - push hl - ld hl,wFlags_0xcd60 - bit 5,[hl] - pop hl - jr nz,.skipPlayingSound - ld a,(SFX_02_40 - SFX_Headers_02) / 3 - call PlaySound ; play sound -.skipPlayingSound - pop af - ld [H_DOWNARROWBLINKCNT2],a - pop af - ld [H_DOWNARROWBLINKCNT1],a ; restore previous values - xor a - ld [wMenuWrappingEnabled],a ; disable menu wrapping - ld a,[$ffb5] - ret -.noWrappingAround - ld a,[$cc37] - and a ; should we return if the user tried to go past the top or bottom? - jr z,.checkOtherKeys - jr .checkIfAButtonOrBButtonPressed - -PlaceMenuCursor:: ; 3b7c (0:3b7c) - ld a,[wTopMenuItemY] - and a ; is the y coordinate 0? - jr z,.adjustForXCoord - ld hl,wTileMap - ld bc,20 ; screen width -.topMenuItemLoop - add hl,bc - dec a - jr nz,.topMenuItemLoop -.adjustForXCoord - ld a,[wTopMenuItemX] - ld b,$00 - ld c,a - add hl,bc - push hl - ld a,[wLastMenuItem] - and a ; was the previous menu id 0? - jr z,.checkForArrow1 - push af - ld a,[$fff6] - bit 1,a ; is the menu double spaced? - jr z,.doubleSpaced1 - ld bc,20 - jr .getOldMenuItemScreenPosition -.doubleSpaced1 - ld bc,40 -.getOldMenuItemScreenPosition - pop af -.oldMenuItemLoop - add hl,bc - dec a - jr nz,.oldMenuItemLoop -.checkForArrow1 - ld a,[hl] - cp a,"▶" ; was an arrow next to the previously selected menu item? - jr nz,.skipClearingArrow -.clearArrow - ld a,[wTileBehindCursor] - ld [hl],a -.skipClearingArrow - pop hl - ld a,[wCurrentMenuItem] - and a - jr z,.checkForArrow2 - push af - ld a,[$fff6] - bit 1,a ; is the menu double spaced? - jr z,.doubleSpaced2 - ld bc,20 - jr .getCurrentMenuItemScreenPosition -.doubleSpaced2 - ld bc,40 -.getCurrentMenuItemScreenPosition - pop af -.currentMenuItemLoop - add hl,bc - dec a - jr nz,.currentMenuItemLoop -.checkForArrow2 - ld a,[hl] - cp a,"▶" ; has the right arrow already been placed? - jr z,.skipSavingTile ; if so, don't lose the saved tile - ld [wTileBehindCursor],a ; save tile before overwriting with right arrow -.skipSavingTile - ld a,"▶" ; place right arrow - ld [hl],a - ld a,l - ld [wMenuCursorLocation],a - ld a,h - ld [wMenuCursorLocation + 1],a - ld a,[wCurrentMenuItem] - ld [wLastMenuItem],a - ret - -; This is used to mark a menu cursor other than the one currently being -; manipulated. In the case of submenus, this is used to show the location of -; the menu cursor in the parent menu. In the case of swapping items in list, -; this is used to mark the item that was first chosen to be swapped. -PlaceUnfilledArrowMenuCursor:: ; 3bec (0:3bec) - ld b,a - ld a,[wMenuCursorLocation] - ld l,a - ld a,[wMenuCursorLocation + 1] - ld h,a - ld [hl],$ec ; outline of right arrow - ld a,b - ret - -; Replaces the menu cursor with a blank space. -EraseMenuCursor:: ; 3bf9 (0:3bf9) - ld a,[wMenuCursorLocation] - ld l,a - ld a,[wMenuCursorLocation + 1] - ld h,a - ld [hl]," " - ret - -; This toggles a blinking down arrow at hl on and off after a delay has passed. -; This is often called even when no blinking is occurring. -; The reason is that most functions that call this initialize H_DOWNARROWBLINKCNT1 to 0. -; The effect is that if the tile at hl is initialized with a down arrow, -; this function will toggle that down arrow on and off, but if the tile isn't -; initliazed with a down arrow, this function does nothing. -; That allows this to be called without worrying about if a down arrow should -; be blinking. -HandleDownArrowBlinkTiming:: ; 3c04 (0:3c04) - ld a,[hl] - ld b,a - ld a,$ee ; down arrow - cp b - jr nz,.downArrowOff -.downArrowOn - ld a,[H_DOWNARROWBLINKCNT1] - dec a - ld [H_DOWNARROWBLINKCNT1],a - ret nz - ld a,[H_DOWNARROWBLINKCNT2] - dec a - ld [H_DOWNARROWBLINKCNT2],a - ret nz - ld a," " - ld [hl],a - ld a,$ff - ld [H_DOWNARROWBLINKCNT1],a - ld a,$06 - ld [H_DOWNARROWBLINKCNT2],a - ret -.downArrowOff - ld a,[H_DOWNARROWBLINKCNT1] - and a - ret z - dec a - ld [H_DOWNARROWBLINKCNT1],a - ret nz - dec a - ld [H_DOWNARROWBLINKCNT1],a - ld a,[H_DOWNARROWBLINKCNT2] - dec a - ld [H_DOWNARROWBLINKCNT2],a - ret nz - ld a,$06 - ld [H_DOWNARROWBLINKCNT2],a - ld a,$ee ; down arrow - ld [hl],a - ret - -; The following code either enables or disables the automatic drawing of -; text boxes by DisplayTextID. Both functions cause DisplayTextID to wait -; for a button press after displaying text (unless [$cc47] is set). - -EnableAutoTextBoxDrawing:: ; 3c3c (0:3c3c) - xor a - jr AutoTextBoxDrawingCommon - -DisableAutoTextBoxDrawing:: ; 3c3f (0:3c3f) - ld a,$01 - -AutoTextBoxDrawingCommon:: ; 3c41 (0:3c41) - ld [$cf0c],a ; control text box drawing - xor a - ld [$cc3c],a ; make DisplayTextID wait for button press - ret - -PrintText:: ; 3c49 (0:3c49) -; given a pointer in hl, print the text there - push hl - ld a,1 - ld [$D125],a - call DisplayTextBoxID - call UpdateSprites - call Delay3 - pop hl -Func_3c59:: ; 3c59 (0:3c59) - FuncCoord 1,14 - ld bc,Coord ;$C4B9 - jp TextCommandProcessor - -; converts a big-endian binary number into decimal and prints it -; INPUT: -; b = flags and number of bytes -; bit 7: if set, print leading zeroes -; if unset, do not print leading zeroes -; bit 6: if set, left-align the string (do not pad empty digits with spaces) -; if unset, right-align the string -; bits 4-5: unused -; bits 0-3: number of bytes (only 1 - 3 bytes supported) -; c = number of decimal digits -; de = address of the number (big-endian) -PrintNumber:: ; 3c5f (0:3c5f) - push bc - xor a - ld [H_PASTLEADINGZEROES],a - ld [H_NUMTOPRINT],a - ld [H_NUMTOPRINT + 1],a - ld a,b - and a,%00001111 - cp a,1 - jr z,.oneByte - cp a,2 - jr z,.twoBytes -.threeBytes - ld a,[de] - ld [H_NUMTOPRINT],a - inc de - ld a,[de] - ld [H_NUMTOPRINT + 1],a - inc de - ld a,[de] - ld [H_NUMTOPRINT + 2],a - jr .checkNumDigits -.twoBytes - ld a,[de] - ld [H_NUMTOPRINT + 1],a - inc de - ld a,[de] - ld [H_NUMTOPRINT + 2],a - jr .checkNumDigits -.oneByte - ld a,[de] - ld [H_NUMTOPRINT + 2],a -.checkNumDigits - push de - ld d,b - ld a,c - ld b,a - xor a - ld c,a - ld a,b ; a = number of decimal digits - cp a,2 - jr z,.tensPlace - cp a,3 - jr z,.hundredsPlace - cp a,4 - jr z,.thousandsPlace - cp a,5 - jr z,.tenThousandsPlace - cp a,6 - jr z,.hundredThousandsPlace -.millionsPlace - ld a,1000000 >> 16 - ld [H_POWEROFTEN],a - ld a,(1000000 >> 8) & $FF - ld [H_POWEROFTEN + 1],a - ld a,1000000 & $FF - ld [H_POWEROFTEN + 2],a - call PrintNumber_PrintDigit - call PrintNumber_AdvancePointer -.hundredThousandsPlace - ld a,100000 >> 16 - ld [H_POWEROFTEN],a - ld a,(100000 >> 8) & $FF - ld [H_POWEROFTEN + 1],a - ld a,100000 & $FF - ld [H_POWEROFTEN + 2],a - call PrintNumber_PrintDigit - call PrintNumber_AdvancePointer -.tenThousandsPlace - xor a - ld [H_POWEROFTEN],a - ld a,10000 >> 8 - ld [H_POWEROFTEN + 1],a - ld a,10000 & $FF - ld [H_POWEROFTEN + 2],a - call PrintNumber_PrintDigit - call PrintNumber_AdvancePointer -.thousandsPlace - xor a - ld [H_POWEROFTEN],a - ld a,1000 >> 8 - ld [H_POWEROFTEN + 1],a - ld a,1000 & $FF - ld [H_POWEROFTEN + 2],a - call PrintNumber_PrintDigit - call PrintNumber_AdvancePointer -.hundredsPlace - xor a - ld [H_POWEROFTEN],a - xor a - ld [H_POWEROFTEN + 1],a - ld a,100 - ld [H_POWEROFTEN + 2],a - call PrintNumber_PrintDigit - call PrintNumber_AdvancePointer -.tensPlace - ld c,00 - ld a,[H_NUMTOPRINT + 2] -.loop - cp a,10 - jr c,.underflow - sub a,10 - inc c - jr .loop -.underflow - ld b,a - ld a,[H_PASTLEADINGZEROES] - or c - ld [H_PASTLEADINGZEROES],a - jr nz,.pastLeadingZeroes - call PrintNumber_PrintLeadingZero - jr .advancePointer -.pastLeadingZeroes - ld a,"0" - add c - ld [hl],a -.advancePointer - call PrintNumber_AdvancePointer -.onesPlace - ld a,"0" - add b - ld [hli],a - pop de - dec de - pop bc - ret - -; prints a decimal digit -; This works by repeatedely subtracting a power of ten until the number becomes negative. -; The number of subtractions it took in order to make the number negative is the digit for the current number place. -; The last value that the number had before becoming negative is kept as the new value of the number. -; A more succinct description is that the number is divided by a power of ten -; and the quotient becomes the digit while the remainder is stored as the new value of the number. -PrintNumber_PrintDigit:: ; 3d25 (0:3d25) - ld c,0 ; counts number of loop iterations to determine the decimal digit -.loop - ld a,[H_POWEROFTEN] - ld b,a - ld a,[H_NUMTOPRINT] - ld [H_SAVEDNUMTOPRINT],a - cp b - jr c,.underflow0 - sub b - ld [H_NUMTOPRINT],a - ld a,[H_POWEROFTEN + 1] - ld b,a - ld a,[H_NUMTOPRINT + 1] - ld [H_SAVEDNUMTOPRINT + 1],a - cp b - jr nc,.noBorrowForByte1 -.byte1BorrowFromByte0 - ld a,[H_NUMTOPRINT] - or a,0 - jr z,.underflow1 - dec a - ld [H_NUMTOPRINT],a - ld a,[H_NUMTOPRINT + 1] -.noBorrowForByte1 - sub b - ld [H_NUMTOPRINT + 1],a - ld a,[H_POWEROFTEN + 2] - ld b,a - ld a,[H_NUMTOPRINT + 2] - ld [H_SAVEDNUMTOPRINT + 2],a - cp b - jr nc,.noBorrowForByte2 -.byte2BorrowFromByte1 - ld a,[H_NUMTOPRINT + 1] - and a - jr nz,.finishByte2BorrowFromByte1 -.byte2BorrowFromByte0 - ld a,[H_NUMTOPRINT] - and a - jr z,.underflow2 - dec a - ld [H_NUMTOPRINT],a - xor a -.finishByte2BorrowFromByte1 - dec a - ld [H_NUMTOPRINT + 1],a - ld a,[H_NUMTOPRINT + 2] -.noBorrowForByte2 - sub b - ld [H_NUMTOPRINT + 2],a - inc c - jr .loop -.underflow2 - ld a,[H_SAVEDNUMTOPRINT + 1] - ld [H_NUMTOPRINT + 1],a -.underflow1 - ld a,[H_SAVEDNUMTOPRINT] - ld [H_NUMTOPRINT],a -.underflow0 - ld a,[H_PASTLEADINGZEROES] - or c - jr z,PrintNumber_PrintLeadingZero - ld a,"0" - add c - ld [hl],a - ld [H_PASTLEADINGZEROES],a - ret - -; prints a leading zero unless they are turned off in the flags -PrintNumber_PrintLeadingZero:: ; 3d83 (0:3d83) - bit 7,d ; print leading zeroes? - ret z - ld [hl],"0" - ret - -; increments the pointer unless leading zeroes are not being printed, -; the number is left-aligned, and no nonzero digits have been printed yet -PrintNumber_AdvancePointer:: ; 3d89 (0:3d89) - bit 7,d ; print leading zeroes? - jr nz,.incrementPointer - bit 6,d ; left alignment or right alignment? - jr z,.incrementPointer - ld a,[H_PASTLEADINGZEROES] - and a - ret z -.incrementPointer - inc hl - ret - -; calls a function from a table of function pointers -; INPUT: -; a = index within table -; hl = address of function pointer table -CallFunctionInTable:: ; 3d97 (0:3d97) - push hl - push de - push bc - add a - ld d,0 - ld e,a - add hl,de - ld a,[hli] - ld h,[hl] - ld l,a - ld de,.returnAddress - push de - jp [hl] -.returnAddress - pop bc - pop de - pop hl - ret - -; searches an array at hl for the value in a. -; skips (de − 1) bytes between reads, so to check every byte, de should be 1. -; if found, returns count in b and sets carry. -IsInArray:: ; 3dab (0:3dab) - ld b,0 - ; fall through - -IsInArrayCummulativeCount:: ; 3dad (0:3dad) - ld c,a -.loop - ld a,[hl] - cp a,$FF - jr z,.NotInArray - cp c - jr z,.InArray - inc b - add hl,de - jr .loop -.NotInArray - and a - ret -.InArray - scf - ret - -Func_3dbe:: ; 3dbe (0:3dbe) - call CleanLCD_OAM - ld a, $1 - ld [$cfcb], a - call Func_3e08 - call LoadScreenTilesFromBuffer2 - call LoadTextBoxTilePatterns - call GoPAL_SET_CF1C - jr Delay3 - -; calls GBPalWhiteOut and then Delay3 -GBPalWhiteOutWithDelay3:: ; 3dd4 (0:3dd4) - call GBPalWhiteOut - -Delay3:: ; 3dd7 (0:3dd7) -; call Delay with a parameter of 3 - ld c,3 - jp DelayFrames - -; resets BGP and OBP0 to their usual colors -GBPalNormal:: ; 3ddc (0:3ddc) - ld a,%11100100 - ld [rBGP],a - ld a,%11010000 - ld [rOBP0],a - ret - -; makes all palette colors white -GBPalWhiteOut:: ; 3de5 (0:3de5) - xor a - ld [rBGP],a - ld [rOBP0],a - ld [rOBP1],a - ret - -GoPAL_SET_CF1C:: ; 3ded (0:3ded) - ld b,$ff -GoPAL_SET:: ; 3def (0:3def) - ld a,[$cf1b] - and a - ret z - ld a,$45 - jp Predef - -; hl points to where the color gets stored -; e contains the number of pixels filled in the health bar (out of 48) -GetHealthBarColor:: ; 3df9 (0:3df9) - ld a, e - cp 27 - ld d, $0 ; green - jr nc, .gotColor - cp 10 - inc d ; yellow - jr nc, .gotColor - inc d ; red -.gotColor - ld [hl], d - ret - -Func_3e08:: ; 3e08 (0:3e08) - ld hl, $cfc4 - ld a, [hl] - push af - res 0, [hl] - push hl - xor a - ld [W_SPRITESETID], a ; $d3a8 - call DisableLCD - callba InitMapSprites - call EnableLCD - pop hl - pop af - ld [hl], a - call LoadPlayerSpriteGraphics - call LoadFontTilePatterns - jp UpdateSprites - -GiveItem:: ; 3e2e (0:3e2e) -; Give player quantity c of item b, and copy item name to $cf4b. -; Set carry on success. If no room in bag, reset carry. - ld a, b - ld [$d11e], a - ld [$cf91], a - ld a, c - ld [$cf96], a - ld hl,wNumBagItems - call AddItemToInventory - ret nc - call GetItemName ; $2fcf - call CopyStringToCF4B - scf - ret - -GivePokemon:: ; 3e48 (0:3e48) - ld a, b - ld [$cf91], a - ld a, c - ld [$d127], a - xor a - ld [$cc49], a - ld b, BANK(_GivePokemon) - ld hl, _GivePokemon - jp Bankswitch - -GenRandom:: ; 3e5c (0:3e5c) -; store a random 8-bit value in a - push hl - push de - push bc - callba GenRandom_ - ld a,[H_RAND1] - pop bc - pop de - pop hl - ret - -Predef:: ; 3e6d (0:3e6d) -; runs a predefined ASM command, where the command ID is read from $D0B7 -; $3E6D grabs the ath pointer from PredefPointers and executes it - - ld [$CC4E],a ; save the predef routine's ID for later - - ld a,[H_LOADEDROMBANK] - ld [$CF12],a - - ; save bank and call 13:7E49 - push af - ld a,BANK(GetPredefPointer) - ld [H_LOADEDROMBANK],a - ld [$2000],a - call GetPredefPointer - - ; call the predef function - ; ($D0B7 has the bank of the predef routine) - ld a,[$D0B7] - ld [H_LOADEDROMBANK],a - ld [$2000],a - ld de,.Return - push de - jp [hl] - ; after the predefined function finishes it returns here -.Return - pop af - ld [H_LOADEDROMBANK],a - ld [$2000],a - ret - -;loads hl from cc4f, de from cc51, and bc from cc53 - -Load16BitRegisters:: ; 3e94 (0:3e94) - ld a, [$cc4f] - ld h, a - ld a, [$cc50] - ld l, a - ld a, [$cc51] - ld d, a - ld a, [$cc52] - ld e, a - ld a, [$cc53] - ld b, a - ld a, [$cc54] - ld c, a - ret - -Func_3ead:: ; 3ead (0:3ead) - ld b, BANK(CinnabarGymQuiz_1eb0a) - ld hl, CinnabarGymQuiz_1eb0a - jp Bankswitch - -Func_3eb5:: ; 3eb5 (0:3eb5) - ld a, [H_LOADEDROMBANK] - push af - ld a, [H_CURRENTPRESSEDBUTTONS] - bit 0, a - jr z, .asm_3eea - ld a, Bank(Func_469a0) - ld [$2000], a - ld [H_LOADEDROMBANK], a - call Func_469a0 - ld a, [$ffee] - and a - jr nz, .asm_3edd - ld a, [$cd3e] - ld [$2000], a - ld [H_LOADEDROMBANK], a - ld de, .asm_3eda - push de - jp [hl] -.asm_3eda - xor a - jr .asm_3eec -.asm_3edd - callba PrintBookshelfText - ld a, [$ffdb] - and a - jr z, .asm_3eec -.asm_3eea - ld a, $ff -.asm_3eec - ld [$ffeb], a - pop af - ld [$2000], a - ld [H_LOADEDROMBANK], a - ret - -PrintPredefTextID:: ; 3ef5 (0:3ef5) - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c - ld hl, PointerTable_3f22 - call Func_3f0f - ld hl, $cf11 - set 0, [hl] - call DisplayTextID - -Func_3f05:: ; 3f05 (0:3f05) - ld hl, W_MAPTEXTPTR ; $d36c - ld a, [$ffec] - ld [hli], a - ld a, [$ffed] - ld [hl], a - ret - -Func_3f0f:: ; 3f0f (0:3f0f) - ld a, [W_MAPTEXTPTR] ; $d36c - ld [$ffec], a - ld a, [$d36d] - ld [$ffed], a - ld a, l - ld [W_MAPTEXTPTR], a ; $d36c - ld a, h - ld [$d36d], a - ret - -PointerTable_3f22:: ; 3f22 (0:3f22) - dw CardKeySuccessText ; id = 01 - dw CardKeyFailText ; id = 02 - dw RedBedroomPC ; id = 03 - dw RedBedroomSNESText ; id = 04 - dw PushStartText ; id = 05 - dw SaveOptionText ; id = 06 - dw StrengthsAndWeaknessesText ; id = 07 - dw OakLabEmailText ; id = 08 - dw AerodactylFossilText ; id = 09 - dw Route15UpstairsBinocularsText ; id = 0A - dw KabutopsFossilText ; id = 0B - dw GymStatueText1 ; id = 0C - dw GymStatueText2 ; id = 0D - dw BookcaseText ; id = 0E - dw ViridianCityPokecenterBenchGuyText ; id = 0F - dw PewterCityPokecenterBenchGuyText ; id = 10 - dw CeruleanCityPokecenterBenchGuyText ; id = 11 - dw LavenderCityPokecenterBenchGuyText ; id = 12 - dw VermilionCityPokecenterBenchGuyText ; id = 13 - dw CeladonCityPokecenterBenchGuyText ; id = 14 - dw CeladonCityHotelText ; id = 15 - dw FuchsiaCityPokecenterBenchGuyText ; id = 16 - dw CinnabarIslandPokecenterBenchGuyText ; id = 17 - dw SaffronCityPokecenterBenchGuyText ; id = 18 - dw MtMoonPokecenterBenchGuyText ; id = 19 - dw RockTunnelPokecenterBenchGuyText ; id = 1A - dw UnusedBenchGuyText1 ; id = 1B - dw UnusedBenchGuyText2 ; id = 1C - dw UnusedBenchGuyText3 ; id = 1D - dw TerminatorText_62508 ; id = 1E - dw PredefText1f ; id = 1F - dw ViridianSchoolNotebook ; id = 20 - dw ViridianSchoolBlackboard ; id = 21 - dw JustAMomentText ; id = 22 - dw PredefText23 ; id = 23 - dw FoundHiddenItemText ; id = 24 - dw HiddenItemBagFullText ; id = 25 - dw VermilionGymTrashText ; id = 26 - dw IndigoPlateauHQText ; id = 27 - dw GameCornerOutOfOrderText ; id = 28 - dw GameCornerOutToLunchText ; id = 29 - dw GameCornerSomeonesKeysText ; id = 2A - dw FoundHiddenCoinsText ; id = 2B - dw DroppedHiddenCoinsText ; id = 2C - dw BillsHouseMonitorText ; id = 2D - dw BillsHouseInitiatedText ; id = 2E - dw BillsHousePokemonList ; id = 2F - dw MagazinesText ; id = 30 - dw CinnabarGymQuiz ; id = 31 - dw GameCornerNoCoinsText ; id = 32 - dw GameCornerCoinCaseText ; id = 33 - dw LinkCableHelp ; id = 34 - dw TMNotebook ; id = 35 - dw FightingDojoText ; id = 36 - dw FightingDojoText_52a10 ; id = 37 - dw FightingDojoText_52a1d ; id = 38 - dw NewBicycleText ; id = 39 - dw IndigoPlateauStatues ; id = 3A - dw VermilionGymTrashSuccesText1 ; id = 3B - dw VermilionGymTrashSuccesText2 ; id = 3C - dw VermilionGymTrashSuccesText3 ; id = 3D - dw VermilionGymTrashFailText ; id = 3E - dw TownMapText ; id = 3F - dw BookOrSculptureText ; id = 40 - dw ElevatorText ; id = 41 - dw PokemonStuffText ; id = 42 SECTION "bank1",ROMX,BANK[$1] -SpriteFacingAndAnimationTable: ; 4000 (1:4000) - dw SpriteFacingDownAndStanding, SpriteOAMParameters ; facing down, walk animation frame 0 - dw SpriteFacingDownAndWalking, SpriteOAMParameters ; facing down, walk animation frame 1 - dw SpriteFacingDownAndStanding, SpriteOAMParameters ; facing down, walk animation frame 2 - dw SpriteFacingDownAndWalking, SpriteOAMParametersFlipped ; facing down, walk animation frame 3 - dw SpriteFacingUpAndStanding, SpriteOAMParameters ; facing up, walk animation frame 0 - dw SpriteFacingUpAndWalking, SpriteOAMParameters ; facing up, walk animation frame 1 - dw SpriteFacingUpAndStanding, SpriteOAMParameters ; facing up, walk animation frame 2 - dw SpriteFacingUpAndWalking, SpriteOAMParametersFlipped ; facing up, walk animation frame 3 - dw SpriteFacingLeftAndStanding, SpriteOAMParameters ; facing left, walk animation frame 0 - dw SpriteFacingLeftAndWalking, SpriteOAMParameters ; facing left, walk animation frame 1 - dw SpriteFacingLeftAndStanding, SpriteOAMParameters ; facing left, walk animation frame 2 - dw SpriteFacingLeftAndWalking, SpriteOAMParameters ; facing left, walk animation frame 3 - dw SpriteFacingLeftAndStanding, SpriteOAMParametersFlipped ; facing right, walk animation frame 0 - dw SpriteFacingLeftAndWalking, SpriteOAMParametersFlipped ; facing right, walk animation frame 1 - dw SpriteFacingLeftAndStanding, SpriteOAMParametersFlipped ; facing right, walk animation frame 2 - dw SpriteFacingLeftAndWalking, SpriteOAMParametersFlipped ; facing right, walk animation frame 3 - dw SpriteFacingDownAndStanding, SpriteOAMParameters ; --- - dw SpriteFacingDownAndStanding, SpriteOAMParameters ; This table is used for sprites $a and $b. - dw SpriteFacingDownAndStanding, SpriteOAMParameters ; All orientation and animation parameters - dw SpriteFacingDownAndStanding, SpriteOAMParameters ; lead to the same result. Used for immobile - dw SpriteFacingDownAndStanding, SpriteOAMParameters ; sprites like items on the ground - dw SpriteFacingDownAndStanding, SpriteOAMParameters ; --- - dw SpriteFacingDownAndStanding, SpriteOAMParameters - dw SpriteFacingDownAndStanding, SpriteOAMParameters - dw SpriteFacingDownAndStanding, SpriteOAMParameters - dw SpriteFacingDownAndStanding, SpriteOAMParameters - dw SpriteFacingDownAndStanding, SpriteOAMParameters - dw SpriteFacingDownAndStanding, SpriteOAMParameters - dw SpriteFacingDownAndStanding, SpriteOAMParameters - dw SpriteFacingDownAndStanding, SpriteOAMParameters - dw SpriteFacingDownAndStanding, SpriteOAMParameters - dw SpriteFacingDownAndStanding, SpriteOAMParameters - -SpriteFacingDownAndStanding: ; 4080 (1:4080) - db $00,$01,$02,$03 -SpriteFacingDownAndWalking: ; 4084 (1:4084) - db $80,$81,$82,$83 -SpriteFacingUpAndStanding: ; 4088 (1:4088) - db $04,$05,$06,$07 -SpriteFacingUpAndWalking: ; 408c (1:408c) - db $84,$85,$86,$87 -SpriteFacingLeftAndStanding: ; 4090 (1:4090) - db $08,$09,$0a,$0b -SpriteFacingLeftAndWalking: ; 4094 (1:4094) - db $88,$89,$8a,$8b - -SpriteOAMParameters: ; 4098 (1:4098) - db $00,$00, $00 ; top left - db $00,$08, $00 ; top right - db $08,$00, OAMFLAG_CANBEMASKED ; bottom left - db $08,$08, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right -SpriteOAMParametersFlipped: ; 40a4 (1:40a4) - db $00,$08, OAMFLAG_VFLIPPED - db $00,$00, OAMFLAG_VFLIPPED - db $08,$08, OAMFLAG_VFLIPPED | OAMFLAG_CANBEMASKED - db $08,$00, OAMFLAG_VFLIPPED | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA - -Func_40b0: ; 40b0 (1:40b0) +INCLUDE "data/facing.asm" + +Func_40b0:: +; Reset player status on blackout. xor a - ld [$cf0b], a - ld [$d700], a - ld [W_ISINBATTLE], a ; $d057 - ld [$d35d], a - ld [$cf10], a - ld [H_CURRENTPRESSEDBUTTONS], a - ld [$cc57], a + ld [wcf0b], a + ld [wd700], a + ld [W_ISINBATTLE], a + ld [wd35d], a + ld [wcf10], a + ld [hJoyHeld], a + ld [wcc57], a ld [wFlags_0xcd60], a + ld [$ff9f], a - ld [$ffa0], a - ld [$ffa1], a + ld [$ff9f + 1], a + ld [$ff9f + 2], a call HasEnoughMoney - jr c, .asm_40ff - ld a, [wPlayerMoney] ; $d347 + jr c, .lostmoney ; never happens + + ; Halve the player's money. + ld a, [wPlayerMoney] ld [$ff9f], a - ld a, [wPlayerMoney + 1] ; $d348 - ld [$ffa0], a - ld a, [wPlayerMoney + 2] ; $d349 - ld [$ffa1], a + ld a, [wPlayerMoney + 1] + ld [$ff9f + 1], a + ld a, [wPlayerMoney + 2] + ld [$ff9f + 2], a xor a ld [$ffa2], a ld [$ffa3], a - ld a, $2 + ld a, 2 ld [$ffa4], a - ld a, $d - call Predef ; indirect jump to Func_f71e (f71e (3:771e)) + predef DivideBCDPredef3 ld a, [$ffa2] - ld [wPlayerMoney], a ; $d347 - ld a, [$ffa3] - ld [wPlayerMoney + 1], a ; $d348 - ld a, [$ffa4] - ld [wPlayerMoney + 2], a ; $d349 -.asm_40ff - ld hl, $d732 + ld [wPlayerMoney], a + ld a, [$ffa2 + 1] + ld [wPlayerMoney + 1], a + ld a, [$ffa2 + 2] + ld [wPlayerMoney + 2], a + +.lostmoney + ld hl, wd732 set 2, [hl] res 3, [hl] set 6, [hl] - ld a, $ff - ld [wJoypadForbiddenButtonsMask], a - ld a, $7 - jp Predef ; indirect jump to HealParty (f6a5 (3:76a5)) + ld a, %11111111 + ld [wJoyIgnore], a + predef_jump HealParty -MewPicFront: ; 4112 (1:4112) - INCBIN "pic/bmon/mew.pic" -MewPicBack: ; 4205 (1:4205) - INCBIN "pic/monback/mewb.pic" +MewPicFront:: INCBIN "pic/bmon/mew.pic" +MewPicBack:: INCBIN "pic/monback/mewb.pic" INCLUDE "data/baseStats/mew.asm" INCLUDE "engine/battle/safari_zone.asm" INCLUDE "engine/titlescreen.asm" -NintenText: ; 45aa (1:45aa) - db "NINTEN@" +NintenText: db "NINTEN@" +SonyText: db "SONY@" -SonyText: ; 45b1 (1:45b1) - db "SONY@" -; loads pokemon data from one of multiple sources to $cf98 -; loads base stats to $d0b8 -; INPUT: -; [$cf92] = index of pokemon within party/box -; [$cc49] = source -; 00: player's party -; 01: enemy's party -; 02: current box -; 03: daycare -; OUTPUT: -; [$cf91] = pokemon ID -; $cf98 = base address of pokemon data -; $d0b8 = base address of base stats -LoadMonData_: ; 45b6 (1:45b6) - ld a,[W_DAYCAREMONDATA] ; daycare pokemon ID - ld [$cf91],a - ld a,[$cc49] - cp a,$03 - jr z,.GetMonHeader - ld a,[wWhichPokemon] - ld e,a +LoadMonData_: +; Load monster [wWhichPokemon] from list [wcc49]: +; 0: partymon +; 1: enemymon +; 2: boxmon +; 3: daycaremon +; Return monster id at wcf91 and its data at wcf98. +; Also load base stats at W_MONHDEXNUM for convenience. + + ld a, [wDayCareMonSpecies] + ld [wcf91], a + ld a, [wcc49] + cp 3 + jr z, .GetMonHeader + + ld a, [wWhichPokemon] + ld e, a callab Func_39c37 ; get pokemon ID + .GetMonHeader - ld a,[$cf91] - ld [$d0b5],a ; input for GetMonHeader - call GetMonHeader ; load base stats to $d0b8 - ld hl,W_PARTYMON1DATA - ld bc,44 - ld a,[$cc49] - cp a,$01 - jr c,.getMonEntry - ld hl,wEnemyMons ; enemy pokemon 1 data - jr z,.getMonEntry - cp a,$02 - ld hl,W_BOXMON1DATA ; box pokemon 1 data - ld bc,33 - jr z,.getMonEntry - ld hl, W_DAYCAREMONDATA ; daycare pokemon data + ld a, [wcf91] + ld [wd0b5], a ; input for GetMonHeader + call GetMonHeader + + ld hl, wPartyMons + ld bc, wPartyMon2 - wPartyMon1 + ld a, [wcc49] + cp 1 + jr c, .getMonEntry + + ld hl, wEnemyMons + jr z, .getMonEntry + + cp 2 + ld hl, wBoxMons + ld bc, wBoxMon2 - wBoxMon1 + jr z, .getMonEntry + + ld hl, wDayCareMon jr .copyMonData -.getMonEntry ; add the product of the index and the size of each entry - ld a,[wWhichPokemon] + +.getMonEntry + ld a, [wWhichPokemon] call AddNTimes + .copyMonData - ld de,$cf98 - ld bc,44 + ld de, wcf98 + ld bc, 44 jp CopyData -INCLUDE "data/item_prices.asm" +INCLUDE "data/item_prices.asm" INCLUDE "text/item_names.asm" -UnusedNames: ; 4a92 (1:4a92) +UnusedNames: db "かみなりバッヂ@" db "かいがらバッヂ@" db "おじぞうバッヂ@" @@ -10322,190 +154,14 @@ UnusedNames: ; 4a92 (1:4a92) db "マスター@" db "エクセレント" -; calculates the OAM data for all currently visible sprites and writes it to wOAMBuffer -PrepareOAMData: ; 4b0f (1:4b0f) - ld a, [$cfcb] - dec a - jr z, .asm_4b1e - cp $ff - ret nz - ld [$cfcb], a - jp ResetLCD_OAM -.asm_4b1e - xor a - ld [$ff90], a -.asm_4b21 - ld [$ff8f], a - ld d, $c1 - ld a, [$ff8f] - ld e, a - ld a, [de] ; c1x0 - and a - jp z, .asm_4bad - inc e - inc e - ld a, [de] ; c1x2 read combined orientation and animation info - ld [$d5cd], a - cp $ff - jr nz, .spriteVisible ; $ff -> offscreen, don't draw - call Func_4bd1 - jr .asm_4bad -.spriteVisible - cp $a0 - jr c, .considerOrientation ; if >= $a0, ignore the sprite orientation and animation (by using a different conversion table) - and $f - add $10 - jr .asm_4b48 -.considerOrientation - and $f ; the lower nybble contains orientation and animation info -.asm_4b48 - ld l, a - push de - inc d - ld a, e - add $5 - ld e, a - ld a, [de] ; c2x7 - and $80 - ld [$ff94], a ; temp store bit 7 for later use in OAM flags (draws sprite behind background (used for grass)) - pop de - ld h, $0 - ld bc, SpriteFacingAndAnimationTable - add hl, hl - add hl, hl - add hl, bc ; skip to the table location determined by orientation and animation - ld a, [hli] - ld c, a - ld a, [hli] - ld b, a - ld a, [hli] - ld h, [hl] - ld l, a - call Func_4bd1 - ld a, [$ff90] - ld e, a - ld d, $c3 ; wOAMBuffer+x is buffer for OAM data -.spriteTilesLoop ; loops 4 times for the 4 tiles a sprite consists of - ld a, [$ff92] ; temp for sprite Y position - add $10 ; Y=16 is top of screen (Y=0 is invisible) - add [hl] ; add Y offset from table - ld [de], a ; write new sprite OAM Y position - inc hl - ld a, [$ff91] ; temp for sprite X position - add $8 ; X=8 is left of screen (X=0 is invisible) - add [hl] ; add X offset from table - inc e - ld [de], a ; write new sprite OAM X position - inc e - ld a, [bc] ; read pattern number offset (accomodates orientation (offset 0,4 or 8) and animation (offset 0 or $80)) - inc bc - push bc - ld b, a - ld a, [$d5cd] ; temp copy of c1x2 - swap a ; high nybble determines sprite used (0 is always player sprite, next are some npcs) - and $f - cp $b ; sprites $a and $b have no orientation or animation and therefore only 4 tiles - jr nz, .calcTileOffset ; (instead of 12), so tile b's offset is a special case - ld a, $7c ; = $a * 12 + 4 - jr .doneCalcTileOffset -.calcTileOffset - sla a - sla a - ld c, a - sla a - add c ; a *= 12 (each sprite consists of 12 tiles) -.doneCalcTileOffset - add b ; add orientation and animation offset - pop bc - ld [de], a ; write OAM sprite pattern number - inc hl - inc e - ld a, [hl] - bit 1, a ; bit 1 is ignored for OAM, it's used here as an "always in foregroud" flag. - jr z, .alwaysInForeground - ld a, [$ff94] ; load bit 7 (set to $80 if sprite is in grass and should be drawn behind it) - or [hl] -.alwaysInForeground - inc hl - ld [de], a ; write OAM sprite flags - inc e - bit 0, a ; test for OAMFLAG_ENDOFDATA - jr z, .spriteTilesLoop - ld a, e - ld [$ff90], a -.asm_4bad - ld a, [$ff8f] - add $10 - cp $0 - jp nz, .asm_4b21 - ld a, [$ff90] - ld l, a - ld h, $c3 - ld de, $4 - ld b, $a0 - ld a, [$d736] - bit 6, a - ld a, $a0 - jr z, .clearUnusedOAMEntriesLoop - ld a, $90 -.clearUnusedOAMEntriesLoop - cp l - ret z - ld [hl], b - add hl, de - jr .clearUnusedOAMEntriesLoop +INCLUDE "engine/overworld/oam.asm" +INCLUDE "engine/oam_dma.asm" -Func_4bd1: ; 4bd1 (1:4bd1) - inc e - inc e - ld a, [de] ; c1x4 - ld [$ff92], a - inc e - inc e - ld a, [de] ; c1x6 - ld [$ff91], a - ld a, $4 - add e - ld e, a - ld a, [$ff92] - add $4 - and $f0 - ld [de], a ; c1xa (sprite Y pos (snapped to whole steps (?)) - inc e - ld a, [$ff91] - and $f0 - ld [de], a ; c1xb (sprite X pos (snapped to whole steps (?)) - ret - -; copies DMA routine to HRAM. By GB specifications, all DMA needs to be done in HRAM (no other memory section is available during DMA) -WriteDMACodeToHRAM: ; 4bed (1:4bed) - ld c, $80 - ld b, $a - ld hl, DMARoutine -.copyLoop - ld a, [hli] - ld [$ff00+c], a - inc c - dec b - jr nz, .copyLoop - ret - -; this routine is copied to HRAM and executed there on every VBlank -DMARoutine: ; 4bfb (1:4bfb) - ld a, $c3 - ld [$ff46], a ; start DMA - ld a, $28 -.waitLoop ; wait for DMA to finish - dec a - jr nz, .waitLoop - ret - -PrintWaitingText: ; 4c05 (1:4c05) - FuncCoord 3, 10 ; $c46b - ld hl, Coord +PrintWaitingText: + hlCoord 3, 10 ld b, $1 ld c, $b - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] and a jr z, .asm_4c17 call TextBoxBorder @@ -10513,20 +169,20 @@ PrintWaitingText: ; 4c05 (1:4c05) .asm_4c17 call Func_5ab3 .asm_4c1a - FuncCoord 4, 11 ; $c480 - ld hl, Coord + hlCoord 4, 11 ld de, WaitingText call PlaceString - ld c, $32 + ld c, 50 jp DelayFrames -WaitingText: ; 4c28 (1:4c28) +WaitingText: db "Waiting...!@" + _UpdateSprites: ; 4c34 (1:4c34) ld h, $c1 inc h - ld a, $e ; $c20e + ld a, $e ; wSpriteStateData2 + $0e .spriteLoop ld l, a sub $e @@ -10553,11 +209,11 @@ _UpdateSprites: ; 4c34 (1:4c34) jp nz, UpdateNonPlayerSprite jp UpdatePlayerSprite -UpdateNonPlayerSprite: ; 4c5c (1:4c5c) +UpdateNonPlayerSprite: dec a swap a ld [$ff93], a ; $10 * sprite# - ld a, [$cf17] ; some sprite offset? + ld a, [wcf17] ; some sprite offset? ld b, a ld a, [H_CURRENTSPRITEOFFSET] cp b @@ -10566,36 +222,46 @@ UpdateNonPlayerSprite: ; 4c5c (1:4c5c) .unequal jp Func_4ed1 -Func_4c70: ; 4c70 (1:4c70) + +Func_4c70: nop - ld h, $c1 + + ld h, wSpriteStateData1 / $100 ld a, [H_CURRENTSPRITEOFFSET] - add $0 + add wSpriteStateData1 % $100 ld l, a + ld a, [hl] and a ret z + ld a, l - add $3 + add 3 ld l, a + ld a, [hli] call Func_4d72 + ld a, [hli] - add $4 + add 4 add b and $f0 or c ld [$ff90], a + ld a, [hli] call Func_4d72 + ld a, [hl] add b and $f0 or c ld [$ff91], a + ld a, l - add $7 + add 7 ld l, a + xor a ld [hld], a ld [hld], a @@ -10605,31 +271,36 @@ Func_4c70: ; 4c70 (1:4c70) ld [hl], a xor a -Func_4ca5: ; 4ca5 (1:4ca5) +.loop ld [$ff8f], a swap a ld e, a ld a, [H_CURRENTSPRITEOFFSET] cp e - jp z, .asm_4d69 + jp z, .next + ld d, h ld a, [de] and a - jp z, .asm_4d69 + jp z, .next + inc e inc e ld a, [de] inc a - jp z, .asm_4d69 + jp z, .next + ld a, [H_CURRENTSPRITEOFFSET] - add $a + add 10 ld l, a inc e + ld a, [de] call Func_4d72 inc e + ld a, [de] - add $4 + add 4 add b and $f0 or c @@ -10639,16 +310,17 @@ Func_4ca5: ; 4ca5 (1:4ca5) inc a .asm_4cd4 ld [$ff90], a + push af rl c pop af ccf rl c - ld b, $7 + ld b, 7 ld a, [hl] and $f jr z, .asm_4ce6 - ld b, $9 + ld b, 9 .asm_4ce6 ld a, [$ff90] sub b @@ -10656,22 +328,25 @@ Func_4ca5: ; 4ca5 (1:4ca5) ld a, b ld [$ff90], a jr c, .asm_4d01 - ld b, $7 + + ld b, 7 dec e ld a, [de] inc e and a jr z, .asm_4cfa - ld b, $9 + ld b, 9 .asm_4cfa ld a, [$ff92] sub b jr z, .asm_4d01 - jr nc, .asm_4d69 + jr nc, .next + .asm_4d01 inc e inc l ld a, [de] + push bc call Func_4d72 inc e @@ -10680,22 +355,24 @@ Func_4ca5: ; 4ca5 (1:4ca5) and $f0 or c pop bc + sub [hl] jr nc, .asm_4d14 cpl inc a .asm_4d14 ld [$ff91], a + push af rl c pop af ccf rl c - ld b, $7 + ld b, 7 ld a, [hl] and $f jr z, .asm_4d26 - ld b, $9 + ld b, 9 .asm_4d26 ld a, [$ff91] sub b @@ -10703,18 +380,19 @@ Func_4ca5: ; 4ca5 (1:4ca5) ld a, b ld [$ff91], a jr c, .asm_4d41 - ld b, $7 + ld b, 7 dec e ld a, [de] inc e and a jr z, .asm_4d3a - ld b, $9 + ld b, 9 .asm_4d3a ld a, [$ff92] sub b jr z, .asm_4d41 - jr nc, .asm_4d69 + jr nc, .next + .asm_4d41 ld a, [$ff91] ld b, a @@ -10722,10 +400,10 @@ Func_4ca5: ; 4ca5 (1:4ca5) inc l cp b jr c, .asm_4d4e - ld b, $c + ld b, 12 jr .asm_4d50 .asm_4d4e - ld b, $3 + ld b, 3 .asm_4d50 ld a, c and b @@ -10735,7 +413,7 @@ Func_4ca5: ; 4ca5 (1:4ca5) inc l inc l ld a, [$ff8f] - ld de, DiagonalLines ; $4d85 + ld de, DiagonalLines add a add e ld e, a @@ -10749,977 +427,86 @@ Func_4ca5: ; 4ca5 (1:4ca5) ld a, [de] or [hl] ld [hl], a -.asm_4d69 + +.next ld a, [$ff8f] inc a cp $10 - jp nz, Func_4ca5 + jp nz, .loop ret -Func_4d72: ; 4d72 (1:4d72) +Func_4d72: and a - ld b, $0 - ld c, $0 - jr z, .asm_4d84 - ld c, $9 - cp $ff - jr z, .asm_4d83 - ld c, $7 - ld a, $0 -.asm_4d83 + ld b, 0 + ld c, 0 + jr z, .done + ld c, 9 + cp -1 + jr z, .ok + ld c, 7 + ld a, 0 +.ok ld b, a -.asm_4d84 +.done ret -DiagonalLines: ; 4d85 (1:4d85) - INCBIN "gfx/diagonal_lines.2bpp" +DiagonalLines: INCBIN "gfx/diagonal_lines.2bpp" + -Func_4da5: ; 4da5 (1:4da5) +TestBattle: ret -Func_4da6: ; 4da6 (1:4da6) +.loop call GBPalNormal - ld a, $80 + + ; Don't mess around + ; with obedience. + ld a, %10000000 ; EARTHBADGE ld [W_OBTAINEDBADGES], a + ld hl, W_FLAGS_D733 set 0, [hl] - ld hl, W_NUMINPARTY + + ; Reset the party. + ld hl, wPartyCount xor a ld [hli], a dec a ld [hl], a - ld a, $1 - ld [$cf91], a + + ; Give the player a + ; level 20 Rhydon. + ld a, RHYDON + ld [wcf91], a ld a, 20 ld [W_CURENEMYLVL], a xor a - ld [$cc49], a + ld [wcc49], a ld [W_CURMAP], a - call AddPokemonToParty + call AddPartyMon + + ; Fight against a + ; level 20 Rhydon. ld a, RHYDON ld [W_CUROPPONENT], a - ld a, $2c - call Predef - ld a, $1 - ld [$cfcb], a - ld [H_AUTOBGTRANSFERENABLED], a - jr Func_4da6 - -PickupItem: ; 4de1 (1:4de1) - call EnableAutoTextBoxDrawing - ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c - ld b, a - ld hl, W_MISSABLEOBJECTLIST -.missableObjectsListLoop - ld a, [hli] - cp $ff - ret z - cp b - jr z, .isMissable - inc hl - jr .missableObjectsListLoop -.isMissable - ld a, [hl] - ld [$ffdb], a - ld hl, W_MAPSPRITEEXTRADATA - ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c - dec a - add a - ld d, $0 - ld e, a - add hl, de ; seek to item data of found item - ld a, [hl] ; read Item type - ld b, a - ld c, 1 ; quantity is 1 - call GiveItem - jr nc, .BagFull - ld a, [$ffdb] - ld [$cc4d], a - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) - ld a, $1 - ld [$cc3c], a - ld hl, FoundItemText - jr .printText -.BagFull - ld hl, NoMoreRoomForItemText -.printText - call PrintText - ret - -FoundItemText: ; 4e26 (1:4e26) - TX_FAR _FoundItemText - db $0B - db "@" - -NoMoreRoomForItemText: ; 4e2c (1:4e2c) - TX_FAR _NoMoreRoomForItemText - db "@" - -UpdatePlayerSprite: ; 4e31 (1:4e31) - ld a, [wSpriteStateData2] - and a - jr z, .asm_4e41 - cp $ff - jr z, .asm_4e4a - dec a - ld [wSpriteStateData2], a - jr .asm_4e4a -.asm_4e41 - FuncCoord 8, 9 ; $c45c - ld a, [Coord] - ld [$ff93], a - cp $60 - jr c, .asm_4e50 -.asm_4e4a - ld a, $ff - ld [$c102], a - ret -.asm_4e50 - call Func_4c70 - ld h, $c1 - ld a, [wWalkCounter] ; $cfc5 - and a - jr nz, .asm_4e90 - ld a, [$d528] - bit 2, a - jr z, .asm_4e65 - xor a - jr .asm_4e86 -.asm_4e65 - bit 3, a - jr z, .asm_4e6d - ld a, $4 - jr .asm_4e86 -.asm_4e6d - bit 1, a - jr z, .asm_4e75 - ld a, $8 - jr .asm_4e86 -.asm_4e75 - bit 0, a - jr z, .asm_4e7d - ld a, $c - jr .asm_4e86 -.asm_4e7d - xor a - ld [$c107], a - ld [$c108], a - jr .asm_4eab -.asm_4e86 - ld [$c109], a - ld a, [$cfc4] - bit 0, a - jr nz, .asm_4e7d -.asm_4e90 - ld a, [$d736] - bit 7, a - jr nz, .asm_4eb6 - ld a, [H_CURRENTSPRITEOFFSET] - add $7 - ld l, a - ld a, [hl] - inc a - ld [hl], a - cp $4 - jr nz, .asm_4eab - xor a - ld [hl], a - inc hl - ld a, [hl] - inc a - and $3 - ld [hl], a -.asm_4eab - ld a, [$c108] - ld b, a - ld a, [$c109] - add b - ld [$c102], a -.asm_4eb6 - ld a, [$ff93] - ld c, a - ld a, [W_GRASSTILE] - cp c - ld a, $0 - jr nz, .asm_4ec3 - ld a, $80 -.asm_4ec3 - ld [$c207], a - ret - -Func_4ec7: ; 4ec7 (1:4ec7) - push bc - push af - ld a, [$ffda] - ld c, a - pop af - add c - ld l, a - pop bc - ret - -Func_4ed1: ; 4ed1 (1:4ed1) - ld a, [H_CURRENTSPRITEOFFSET] - swap a - dec a - add a - ld hl, W_MAPSPRITEDATA ; $d4e4 - add l - ld l, a - ld a, [hl] ; read movement byte 2 - ld [wCurSpriteMovement2], a - ld h, $c1 - ld a, [H_CURRENTSPRITEOFFSET] - ld l, a - inc l - ld a, [hl] ; c1x1 - and a - jp z, InitializeSpriteStatus - call CheckSpriteAvailability - ret c ; if sprite is invisible, on tile >=$60, in grass or player is currently walking - ld h, $c1 - ld a, [H_CURRENTSPRITEOFFSET] - ld l, a - inc l - ld a, [hl] ; c1x1 - bit 7, a - jp nz, InitializeSpriteFacingDirection ; c1x1 >= $80 - ld b, a - ld a, [$cfc4] - bit 0, a - jp nz, notYetMoving - ld a, b - cp $2 - jp z, UpdateSpriteMovementDelay ; c1x1 == 2 - cp $3 - jp z, UpdateSpriteInWalkingAnimation ; c1x1 == 3 - ld a, [wWalkCounter] ; $cfc5 - and a - ret nz ; don't do anything yet if player is currently moving (redundant, already tested in CheckSpriteAvailability) - call InitializeSpriteScreenPosition - ld h, $c2 - ld a, [H_CURRENTSPRITEOFFSET] - add $6 - ld l, a - ld a, [hl] ; c2x6: movement byte 1 - inc a - jr z, .asm_4f59 ; value $FF - inc a - jr z, .asm_4f59 ; value $FE - dec a - ld [hl], a ; (temporarily) increment movement byte 1 - dec a - push hl - ld hl, $cf0f - dec [hl] ; decrement $cf0f - pop hl - ld de, $cc5b - call LoadDEPlusA ; a = [$cc5b + movement byte 1] - cp $e0 - jp z, ChangeFacingDirection - cp $ff - jr nz, .asm_4f4b - ld [hl], a ; reset movement byte 1 to initial value - ld hl, $d730 - res 0, [hl] - xor a - ld [$cd38], a - ld [$cd3a], a - ret -.asm_4f4b - cp $fe - jr nz, .asm_4f5f - ld [hl], $1 ; set movement byte 1 to $1 - ld de, $cc5b - call LoadDEPlusA ; a = [$cc5b + $fe] (?) - jr .asm_4f5f -.asm_4f59 - call getTileSpriteStandsOn - call GenRandom -.asm_4f5f - ld b, a - ld a, [wCurSpriteMovement2] - cp $d0 - jr z, .moveDown ; movement byte 2 = $d0 forces down - cp $d1 - jr z, .moveUp ; movement byte 2 = $d1 forces up - cp $d2 - jr z, .moveLeft ; movement byte 2 = $d2 forces left - cp $d3 - jr z, .moveRight ; movement byte 2 = $d3 forces right - ld a, b - cp $40 ; a < $40: down (or left) - jr nc, .notDown - ld a, [wCurSpriteMovement2] - cp $2 - jr z, .moveLeft ; movement byte 2 = $2 only allows left or right -.moveDown - ld de, 2*20 - add hl, de ; move tile pointer two rows down - ld de, $100 - - ld bc, $400 - jr TryWalking -.notDown - cp $80 ; $40 <= a < $80: up (or right) - jr nc, .notUp - ld a, [wCurSpriteMovement2] - cp $2 - jr z, .moveRight ; movement byte 2 = $2 only allows left or right -.moveUp - ld de, -2*20 ; $ffd8 - add hl, de ; move tile pointer two rows up - ld de, $ff00 - ld bc, $804 - jr TryWalking -.notUp - cp $c0 ; $80 <= a < $c0: left (or up) - jr nc, .notLeft - ld a, [wCurSpriteMovement2] - cp $1 - jr z, .moveUp ; movement byte 2 = $1 only allows up or down -.moveLeft - dec hl - dec hl ; move tile pointer two columns left - ld de, $ff - ld bc, $208 - jr TryWalking -.notLeft ; $c0 <= a: right (or down) - ld a, [wCurSpriteMovement2] - cp $1 - jr z, .moveDown ; movement byte 2 = $1 only allows up or down -.moveRight - inc hl - inc hl ; move tile pointer two columns right - ld de, $1 - ld bc, $10c - jr TryWalking - -; changes facing direction by zeroing the movement delta and calling TryWalking -ChangeFacingDirection: ; 4fc8 (1:4fc8) - ld de, $0 - ; fall through - -; b: direction (1,2,4 or 8) -; c: new facing direction (0,4,8 or $c) -; d: Y movement delta (-1, 0 or 1) -; e: X movement delta (-1, 0 or 1) -; hl: pointer to tile the sprite would wlak onto -; set carry on failure, clears carry on success -TryWalking: ; 4fcb (1:4fcb) - push hl - ld h, $c1 - ld a, [H_CURRENTSPRITEOFFSET] - add $9 - ld l, a - ld [hl], c ; c1x9 (update facing direction) - ld a, [H_CURRENTSPRITEOFFSET] - add $3 - ld l, a - ld [hl], d ; c1x3 (update Y movement delta) - inc l - inc l - ld [hl], e ; c1x5 (update X movement delta) - pop hl - push de - ld c, [hl] ; read tile to walk onto - call CanWalkOntoTile - pop de - ret c ; cannot walk there (reinitialization of delay values already done) - ld h, $c2 - ld a, [H_CURRENTSPRITEOFFSET] - add $4 - ld l, a - ld a, [hl] ; c2x4: Y position - add d - ld [hli], a ; update Y position - ld a, [hl] ; c2x5: X position - add e - ld [hl], a ; update X position - ld a, [H_CURRENTSPRITEOFFSET] - ld l, a - ld [hl], $10 ; c2x0=16: walk animation counter - dec h - inc l - ld [hl], $3 ; c1x1: set movement status to walking - jp UpdateSpriteImage - -; update the walking animation parameters for a sprite that is currently walking -UpdateSpriteInWalkingAnimation: ; 4ffe (1:4ffe) - ld a, [H_CURRENTSPRITEOFFSET] - add $7 - ld l, a - ld a, [hl] ; c1x7 (counter until next walk animation frame) - inc a - ld [hl], a ; c1x7 += 1 - cp $4 - jr nz, .noNextAnimationFrame - xor a - ld [hl], a ; c1x7 = 0 - inc l - ld a, [hl] ; c1x8 (walk animation frame) - inc a - and $3 - ld [hl], a ; advance to next animation frame every 4 ticks (16 ticks total for one step) -.noNextAnimationFrame - ld a, [H_CURRENTSPRITEOFFSET] - add $3 - ld l, a - ld a, [hli] ; c1x3 (movement Y delta) - ld b, a - ld a, [hl] ; c1x4 (screen Y position) - add b - ld [hli], a ; update screen Y position - ld a, [hli] ; c1x5 (movement X delta) - ld b, a - ld a, [hl] ; c1x6 (screen X position) - add b - ld [hl], a ; update screen X position - ld a, [H_CURRENTSPRITEOFFSET] - ld l, a - inc h - ld a, [hl] ; c2x0 (walk animantion counter) - dec a - ld [hl], a ; update walk animantion counter - ret nz - ld a, $6 ; walking finished, update state - add l - ld l, a - ld a, [hl] ; c2x6 (movement byte 1) - cp $fe - jr nc, .initNextMovementCounter ; values $fe and $ff - ld a, [H_CURRENTSPRITEOFFSET] - inc a - ld l, a - dec h - ld [hl], $1 ; c1x1 = 1 (movement status ready) - ret -.initNextMovementCounter - call GenRandom - ld a, [H_CURRENTSPRITEOFFSET] - add $8 - ld l, a - ld a, [H_RAND1] ; $ffd3 - and $7f - ld [hl], a ; c2x8: set next movement delay to a random value in [0,$7f] - dec h ; note that value 0 actually makes the delay $100 (bug?) - ld a, [H_CURRENTSPRITEOFFSET] - inc a - ld l, a - ld [hl], $2 ; c1x1 = 2 (movement status) - inc l - inc l - xor a - ld b, [hl] ; c1x3 (movement Y delta) - ld [hli], a ; reset movement Y delta - inc l - ld c, [hl] ; c1x5 (movement X delta) - ld [hl], a ; reset movement X delta - ret - -; update delay value (c2x8) for sprites in the delayed state (c1x1) -UpdateSpriteMovementDelay: ; 5057 (1:5057) - ld h, $c2 - ld a, [H_CURRENTSPRITEOFFSET] - add $6 - ld l, a - ld a, [hl] ; c2x6: movement byte 1 - inc l - inc l - cp $fe - jr nc, .tickMoveCounter ; values $fe or $ff - ld [hl], $0 - jr .moving -.tickMoveCounter - dec [hl] ; c2x8: frame counter until next movement - jr nz, notYetMoving -.moving - dec h - ld a, [H_CURRENTSPRITEOFFSET] - inc a - ld l, a - ld [hl], $1 ; c1x1 = 1 (mark as ready to move) -notYetMoving: ; 5073 (1:5073) - ld h, $c1 - ld a, [H_CURRENTSPRITEOFFSET] - add $8 - ld l, a - ld [hl], $0 ; c1x8 = 0 (walk animation frame) - jp UpdateSpriteImage -InitializeSpriteFacingDirection: ; 507f (1:507f) - ld a, [$d72d] - bit 5, a - jr nz, notYetMoving - res 7, [hl] - ld a, [$d52a] - bit 3, a - jr z, .notFacingDown - ld c, $0 ; make sprite face down - jr .facingDirectionDetermined -.notFacingDown - bit 2, a - jr z, .notFacingUp - ld c, $4 ; make sprite face up - jr .facingDirectionDetermined -.notFacingUp - bit 1, a - jr z, .notFacingRight - ld c, $c ; make sprite face right - jr .facingDirectionDetermined -.notFacingRight - ld c, $8 ; make sprite face left -.facingDirectionDetermined - ld a, [H_CURRENTSPRITEOFFSET] - add $9 - ld l, a - ld [hl], c ; c1x9: set facing direction - jr notYetMoving - -InitializeSpriteStatus: ; 50ad (1:50ad) - ld [hl], $1 ; $c1x1: set movement status to ready - inc l - ld [hl], $ff ; $c1x2: set sprite image to $ff (invisible/off screen) - inc h - ld a, [H_CURRENTSPRITEOFFSET] - add $2 - ld l, a - ld a, $8 - ld [hli], a ; $c2x2: set Y displacement to 8 - ld [hl], a ; $c2x3: set X displacement to 8 - ret - -; calculates the spprite's scrren position form its map position and the player position -InitializeSpriteScreenPosition: ; 50bd (1:50bd) - ld h, $c2 - ld a, [H_CURRENTSPRITEOFFSET] - add $4 - ld l, a - ld a, [W_YCOORD] ; $d361 - ld b, a - ld a, [hl] ; c2x4 (Y position + 4) - sub b ; relative to player position - swap a ; * 16 - sub $4 ; - 4 - dec h - ld [hli], a ; c1x4 (screen Y position) - inc h - ld a, [W_XCOORD] ; $d362 - ld b, a - ld a, [hli] ; c2x6 (X position + 4) - sub b ; relative to player position - swap a ; * 16 - dec h - ld [hl], a ; c1x6 (screen X position) - ret + predef InitOpponent -; tests if sprite is off screen or otherwise unable to do anything -CheckSpriteAvailability: ; 50dc (1:50dc) - ld a, $12 - call Predef ; indirect jump to IsMissableObjectHidden (f1a6 (3:71a6)) - ld a, [$ffe5] - and a - jp nz, .spriteInvisible - ld h, $c2 - ld a, [H_CURRENTSPRITEOFFSET] - add $6 - ld l, a - ld a, [hl] ; c2x6: movement byte 1 - cp $fe - jr c, .skipXVisibilityTest ; movement byte 1 < $fe - ld a, [H_CURRENTSPRITEOFFSET] - add $4 - ld l, a - ld b, [hl] ; c2x4: Y pos (+4) - ld a, [W_YCOORD] ; $d361 - cp b - jr z, .skipYVisibilityTest - jr nc, .spriteInvisible ; above screen region - add $8 ; screen is 9 tiles high - cp b - jr c, .spriteInvisible ; below screen region -.skipYVisibilityTest - inc l - ld b, [hl] ; c2x5: X pos (+4) - ld a, [W_XCOORD] ; $d362 - cp b - jr z, .skipXVisibilityTest - jr nc, .spriteInvisible ; left of screen region - add $9 ; screen is 10 tiles wide - cp b - jr c, .spriteInvisible ; right of screen region -.skipXVisibilityTest - call getTileSpriteStandsOn - ld d, $60 - ld a, [hli] - cp d - jr nc, .spriteInvisible ; standing on tile with ID >=$60 (bottom left tile) - ld a, [hld] - cp d - jr nc, .spriteInvisible ; standing on tile with ID >=$60 (bottom right tile) - ld bc, -20 ; $ffec - add hl, bc ; go back one row of tiles - ld a, [hli] - cp d - jr nc, .spriteInvisible ; standing on tile with ID >=$60 (top left tile) - ld a, [hl] - cp d - jr c, .spriteVisible ; standing on tile with ID >=$60 (top right tile) -.spriteInvisible - ld h, $c1 - ld a, [H_CURRENTSPRITEOFFSET] - add $2 - ld l, a - ld [hl], $ff ; c1x2 - scf - jr .done -.spriteVisible - ld c, a - ld a, [wWalkCounter] ; $cfc5 - and a - jr nz, .done ; if player is currently walking, we're done - call UpdateSpriteImage - inc h - ld a, [H_CURRENTSPRITEOFFSET] - add $7 - ld l, a - ld a, [W_GRASSTILE] - cp c - ld a, $0 - jr nz, .notInGrass - ld a, $80 -.notInGrass - ld [hl], a ; c2x7 - and a -.done - ret - -UpdateSpriteImage: ; 5157 (1:5157) - ld h, $c1 - ld a, [H_CURRENTSPRITEOFFSET] - add $8 - ld l, a - ld a, [hli] ; c1x8: walk animation frame - ld b, a - ld a, [hl] ; c1x9: facing direction - add b - ld b, a - ld a, [$ff93] ; current sprite offset - add b - ld b, a - ld a, [H_CURRENTSPRITEOFFSET] - add $2 - ld l, a - ld [hl], b ; c1x2: sprite to display - ret - -; tests if sprite can walk the specified direction -; b: direction (1,2,4 or 8) -; c: ID of tile the sprite would walk onto -; d: Y movement delta (-1, 0 or 1) -; e: X movement delta (-1, 0 or 1) -; set carry on failure, clears carry on success -CanWalkOntoTile: ; 516e (1:516e) - ld h, $c2 - ld a, [H_CURRENTSPRITEOFFSET] - add $6 - ld l, a - ld a, [hl] ; c2x6 (movement byte 1) - cp $fe - jr nc, .canMove ; values $fe and $ff - and a - ret -.canMove - ld a, [W_TILESETCOLLISIONPTR] - ld l, a - ld a, [W_TILESETCOLLISIONPTR+1] - ld h, a -.tilePassableLoop - ld a, [hli] - cp $ff - jr z, .impassable - cp c - jr nz, .tilePassableLoop - ld h, $c2 - ld a, [H_CURRENTSPRITEOFFSET] - add $6 - ld l, a - ld a, [hl] ; $c2x6 (movement byte 1) - inc a - jr z, .impassable ; if $ff, no movement allowed (however, changing direction is) - ld h, $c1 - ld a, [H_CURRENTSPRITEOFFSET] - add $4 - ld l, a - ld a, [hli] ; c1x4 (screen Y pos) - add $4 ; align to blocks (Y pos is always 4 pixels off) - add d ; add Y delta - cp $80 ; if value is >$80, the destination is off screen (either $81 or $FF underflow) - jr nc, .impassable ; don't walk off screen - inc l - ld a, [hl] ; c1x6 (screen X pos) - add e ; add X delta - cp $90 ; if value is >$90, the destination is off screen (either $91 or $FF underflow) - jr nc, .impassable ; don't walk off screen - push de - push bc - call Func_4c70 - pop bc - pop de - ld h, $c1 - ld a, [H_CURRENTSPRITEOFFSET] - add $c - ld l, a - ld a, [hl] ; c1xc (forbidden directions flags(?)) - and b ; check against chosen direction (1,2,4 or 8) - jr nz, .impassable ; direction forbidden, don't go there - ld h, $c2 - ld a, [H_CURRENTSPRITEOFFSET] - add $2 - ld l, a - ld a, [hli] ; c2x2 (sprite Y displacement, initialized at $8, keep track of where a sprite did go) - bit 7, d ; check if going upwards (d=$ff) - jr nz, .upwards - add d - cp $5 - jr c, .impassable ; if c2x2+d < 5, don't go ;bug: this tests probably were supposed to prevent sprites - jr .checkHorizontal ; from walking out too far, but this line makes sprites get stuck -.upwards ; whenever they walked upwards 5 steps - sub $1 ; on the other hand, the amount a sprite can walk out to the - jr c, .impassable ; if d2x2 == 0, don't go ; right of bottom is not limited (until the counter overflows) -.checkHorizontal - ld d, a - ld a, [hl] ; c2x3 (sprite X displacement, initialized at $8, keep track of where a sprite did go) - bit 7, e ; check if going left (e=$ff) - jr nz, .left - add e - cp $5 ; compare, but no conditional jump like in the vertical check above (bug?) - jr .passable -.left - sub $1 - jr c, .impassable ; if d2x3 == 0, don't go -.passable - ld [hld], a ; update c2x3 - ld [hl], d ; update c2x2 - and a ; clear carry (marking success) - ret -.impassable - ld h, $c1 - ld a, [H_CURRENTSPRITEOFFSET] - inc a - ld l, a - ld [hl], $2 ; c1x1 = 2 (set movement status to delayed) - inc l - inc l - xor a - ld [hli], a ; c1x3 = 0 (clear Y movement delta) - inc l - ld [hl], a ; c1x5 = 0 (clear X movement delta) - inc h - ld a, [H_CURRENTSPRITEOFFSET] - add $8 - ld l, a - call GenRandom - ld a, [H_RAND1] ; $ffd3 - and $7f - ld [hl], a ; c2x8: set next movement delay to a random value in [0,$7f] (again with delay $100 if value is 0) - scf ; set carry (marking failure to walk) - ret - -; calculates the tile pointer pointing to the tile the current sprite stancs on -; this is always the lower left tile of the 2x2 tile blocks all sprites are snapped to -; hl: output pointer -getTileSpriteStandsOn: ; 5207 (1:5207) - ld h, $c1 - ld a, [H_CURRENTSPRITEOFFSET] - add $4 - ld l, a - ld a, [hli] ; c1x4: screen Y position - add $4 ; align to 2*2 tile blocks (Y position is always off 4 pixels to the top) - and $f0 ; in case object is currently moving - srl a ; screen Y tile * 4 - ld c, a - ld b, $0 - inc l - ld a, [hl] ; c1x6: screen Y position - srl a - srl a - srl a ; screen X tile - add $14 ; screen X tile + 20 - ld d, $0 - ld e, a - ld hl, wTileMap - add hl, bc - add hl, bc - add hl, bc - add hl, bc - add hl, bc - add hl, de ; wTileMap + 20*(screen Y tile + 1) + screen X tile - ret - -; loads [de+a] into a -LoadDEPlusA: ; 522f (1:522f) - add e - ld e, a - jr nc, .noCarry - inc d -.noCarry - ld a, [de] - ret - -Func_5236: ; 5236 (1:5236) - ld a, [$d730] - bit 7, a - ret z - ld hl, $d72e - bit 7, [hl] - set 7, [hl] - jp z, Func_52a6 - ld hl, $cc97 - ld a, [$cd37] - add l - ld l, a - jr nc, .asm_5251 - inc h -.asm_5251 - ld a, [hl] - cp $40 - jr nz, .asm_525f - call Func_52b2 - ld c, $4 - ld a, $fe - jr .asm_5289 -.asm_525f - cp $0 - jr nz, .asm_526c - call Func_52b2 - ld c, $0 - ld a, $2 - jr .asm_5289 -.asm_526c - cp $80 - jr nz, .asm_5279 - call Func_52b7 - ld c, $8 - ld a, $fe - jr .asm_5289 -.asm_5279 - cp $c0 - jr nz, .asm_5286 - call Func_52b7 - ld c, $c - ld a, $2 - jr .asm_5289 -.asm_5286 - cp $ff - ret -.asm_5289 - ld b, a - ld a, [hl] - add b - ld [hl], a - ld a, [H_CURRENTSPRITEOFFSET] - add $9 - ld l, a - ld a, c - ld [hl], a - call Func_52c3 - ld hl, $cf18 - dec [hl] - ret nz - ld a, $8 - ld [$cf18], a - ld hl, $cd37 - inc [hl] - ret - -Func_52a6: ; 52a6 (1:52a6) - xor a - ld [$cd37], a - ld a, $8 - ld [$cf18], a - jp Func_52c3 - -Func_52b2: ; 52b2 (1:52b2) - ld a, $4 - ld b, a - jr asm_52ba - -Func_52b7: ; 52b7 (1:52b7) - ld a, $6 - ld b, a -asm_52ba: ; 52ba (1:52ba) - ld hl, wSpriteStateData1 - ld a, [H_CURRENTSPRITEOFFSET] - add l - add b - ld l, a - ret + ; When the battle ends, + ; do it all again. + ld a, 1 + ld [wcfcb], a + ld [H_AUTOBGTRANSFERENABLED], a + jr .loop -Func_52c3: ; 52c3 (1:52c3) - ld hl, wSpriteStateData2 - ld a, [H_CURRENTSPRITEOFFSET] - add $e - ld l, a - ld a, [hl] - dec a - swap a - ld b, a - ld hl, wSpriteStateData1 - ld a, [H_CURRENTSPRITEOFFSET] - add $9 - ld l, a - ld a, [hl] - cp $0 - jr z, .asm_52ea - cp $4 - jr z, .asm_52ea - cp $8 - jr z, .asm_52ea - cp $c - jr z, .asm_52ea - ret -.asm_52ea - add b - ld b, a - ld [$ffe9], a - call Func_5301 - ld hl, wSpriteStateData1 - ld a, [H_CURRENTSPRITEOFFSET] - add $2 - ld l, a - ld a, [$ffe9] - ld b, a - ld a, [$ffea] - add b - ld [hl], a - ret - -Func_5301: ; 5301 (1:5301) - ld a, [H_CURRENTSPRITEOFFSET] - add $7 - ld l, a - ld a, [hl] - inc a - ld [hl], a - cp $4 - ret nz - xor a - ld [hl], a - inc l - ld a, [hl] - inc a - and $3 - ld [hl], a - ld [$ffea], a - ret +INCLUDE "engine/overworld/item.asm" +INCLUDE "engine/overworld/movement.asm" INCLUDE "engine/cable_club.asm" LoadTrainerInfoTextBoxTiles: ; 5ae6 (1:5ae6) ld de, TrainerInfoTextBoxTileGraphics ; $7b98 - ld hl, $9760 + ld hl, vChars2 + $760 ld bc, (BANK(TrainerInfoTextBoxTileGraphics) << 8) +$09 jp CopyVideoData @@ -11729,13 +516,12 @@ INCLUDE "engine/oak_speech.asm" Func_62ce: ; 62ce (1:62ce) call Func_62ff - ld a,$19 - call Predef - ld hl,$D732 + predef Func_c754 + ld hl,wd732 bit 2,[hl] res 2,[hl] jr z,.next - ld a,[$D71A] + ld a,[wd71a] jr .next2 .next bit 1,[hl] @@ -11745,19 +531,19 @@ Func_62ce: ; 62ce (1:62ce) ld a,0 .next2 ld b,a - ld a,[$D72D] + ld a,[wd72d] and a jr nz,.next4 ld a,b .next4 - ld hl,$D732 + ld hl,wd732 bit 4,[hl] ret nz ld [wLastMap],a ret Func_62ff: ; 62ff (1:62ff) - ld a, [$d72d] + ld a, [wd72d] cp BATTLE_CENTER jr nz, .asm_6314 ld hl, BattleCenterSpec1 ; $6428 @@ -11776,14 +562,14 @@ Func_62ff: ; 62ff (1:62ff) ld hl, TradeCenterSpec2 ; $6440 jr .asm_6334 .asm_6326 - ld a, [$d732] + ld a, [wd732] bit 1, a jr nz, .asm_6346 bit 2, a jr nz, .asm_6346 ld hl, FirstMapSpec ; $6420 .asm_6334 - ld de, W_CURMAP ; $d35e + ld de, W_CURMAP ; W_CURMAP ld c, $7 .asm_6339 ld a, [hli] @@ -11792,12 +578,12 @@ Func_62ff: ; 62ff (1:62ff) dec c jr nz, .asm_6339 ld a, [hli] - ld [W_CURMAPTILESET], a ; $d367 + ld [W_CURMAPTILESET], a ; W_CURMAPTILESET xor a jr .asm_63b3 .asm_6346 ld a, [wLastMap] - ld hl, $d732 + ld hl, wd732 bit 4, [hl] jr nz, .asm_635b bit 6, [hl] @@ -11806,17 +592,17 @@ Func_62ff: ; 62ff (1:62ff) ld a, [wLastBlackoutMap] jr .asm_6391 .asm_635b - ld hl, $d72d + ld hl, wd72d res 4, [hl] - ld a, [$d71d] + ld a, [wd71d] ld b, a - ld [W_CURMAP], a ; $d35e - ld a, [$d71e] + ld [W_CURMAP], a ; W_CURMAP + ld a, [wd71e] ld c, a ld hl, DungeonWarpList ; $63bf ld de, $0 ld a, $6 - ld [$d12f], a + ld [wd12f], a .asm_6376 ld a, [hli] cp b @@ -11828,7 +614,7 @@ Func_62ff: ; 62ff (1:62ff) cp c jr z, .asm_6388 .asm_6381 - ld a, [$d12f] + ld a, [wd12f] add e ld e, a jr .asm_6376 @@ -11837,10 +623,10 @@ Func_62ff: ; 62ff (1:62ff) add hl, de jr .asm_63a4 .asm_638e - ld a, [$d71a] + ld a, [wd71a] .asm_6391 ld b, a - ld [W_CURMAP], a ; $d35e + ld [W_CURMAP], a ; W_CURMAP ld hl, FlyWarpDataPtr ; $6448 .asm_6398 ld a, [hli] @@ -11855,7 +641,7 @@ Func_62ff: ; 62ff (1:62ff) ld h, [hl] ld l, a .asm_63a4 - ld de, $d35f + ld de, wd35f ld c, $6 .asm_63a9 ld a, [hli] @@ -11864,12 +650,12 @@ Func_62ff: ; 62ff (1:62ff) dec c jr nz, .asm_63a9 xor a - ld [W_CURMAPTILESET], a ; $d367 + ld [W_CURMAPTILESET], a ; W_CURMAPTILESET .asm_63b3 - ld [$d4e2], a - ld [$d4e3], a + ld [wd4e2], a + ld [wd4e3], a ld a, $ff - ld [$d42f], a + ld [wd42f], a ret INCLUDE "data/special_warps.asm" @@ -11889,12 +675,12 @@ SetIshiharaTeam: ; 64ca (1:64ca) ld a, [de] cp $ff ret z - ld [$cf91], a + ld [wcf91], a inc de ld a, [de] ld [W_CURENEMYLVL], a inc de - call AddPokemonToParty + call AddPartyMon jr .loop IshiharaTeam: ; 64df (1:64df) @@ -11923,10 +709,9 @@ SubtractAmountPaidFromMoney_: ; 6b21 (1:6b21) ld de,wPlayerMoney + 2 ld hl,$ffa1 ; total price of items ld c,3 ; length of money in bytes - ld a,$0c - call Predef ; subtract total price from money + predef SubBCDPredef ; subtract total price from money ld a,$13 - ld [$d125],a + ld [wd125],a call DisplayTextBoxID ; redraw money text box and a ret @@ -11936,7 +721,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44) cp a,ITEMLISTMENU jp nz,DisplayListMenuIDLoop ; only rearrange item list menus push hl - ld hl,$cf8b + ld hl,wcf8b ld a,[hli] ld h,[hl] ld l,a @@ -11953,7 +738,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44) pop hl inc a jp z,DisplayListMenuIDLoop ; ignore attempts to swap the Cancel menu item - ld a,[$cc35] ; ID of item chosen for swapping (counts from 1) + ld a,[wcc35] ; ID of item chosen for swapping (counts from 1) and a ; has the first item to swap already been chosen? jr nz,.swapItems ; if not, set the currently selected item as the first item @@ -11962,7 +747,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44) ld b,a ld a,[wListScrollOffset] ; index of top (visible) menu item within the list add b - ld [$cc35],a ; ID of item chosen for swapping (counts from 1) + ld [wcc35],a ; ID of item chosen for swapping (counts from 1) ld c,20 call DelayFrames jp DisplayListMenuIDLoop @@ -11973,16 +758,16 @@ HandleItemListSwapping: ; 6b44 (1:6b44) ld a,[wListScrollOffset] add b ld b,a - ld a,[$cc35] ; ID of item chosen for swapping (counts from 1) + ld a,[wcc35] ; ID of item chosen for swapping (counts from 1) cp b ; is the currently selected item the same as the first item to swap? jp z,DisplayListMenuIDLoop ; ignore attempts to swap an item with itself dec a - ld [$cc35],a ; ID of item chosen for swapping (counts from 1) + ld [wcc35],a ; ID of item chosen for swapping (counts from 1) ld c,20 call DelayFrames push hl push de - ld hl,$cf8b + ld hl,wcf8b ld a,[hli] ld h,[hl] ld l,a @@ -11997,7 +782,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44) ld c,a ld b,0 add hl,bc ; hl = address of currently selected item entry - ld a,[$cc35] ; ID of item chosen for swapping (counts from 1) + ld a,[wcc35] ; ID of item chosen for swapping (counts from 1) add a add e ld e,a @@ -12024,7 +809,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44) ld a,[$ff95] ld [de],a ; put second item ID in first item slot xor a - ld [$cc35],a ; 0 means no item is currently being swapped + ld [wcc35],a ; 0 means no item is currently being swapped pop de pop hl jp DisplayListMenuIDLoop @@ -12044,13 +829,13 @@ HandleItemListSwapping: ; 6b44 (1:6b44) jr .done .combineItemSlots ld [hl],a ; put the sum in the second item slot - ld hl,$cf8b + ld hl,wcf8b ld a,[hli] ld h,[hl] ld l,a dec [hl] ; decrease the number of items ld a,[hl] - ld [$d12a],a ; update number of items variable + ld [wd12a],a ; update number of items variable cp a,1 jr nz,.skipSettingMaxMenuItemID ld [wMaxMenuItem],a ; if the number of items is only one now, update the max menu item ID @@ -12076,7 +861,7 @@ HandleItemListSwapping: ; 6b44 (1:6b44) ld [wCurrentMenuItem],a .done xor a - ld [$cc35],a ; 0 means no item is currently being swapped + ld [wcc35],a ; 0 means no item is currently being swapped pop de pop hl jp DisplayListMenuIDLoop @@ -12120,8 +905,8 @@ SafariZoneRestHouses: ; function that performs initialization for DisplayTextID DisplayTextIDInit: ; 7096 (1:7096) xor a - ld [$cf94],a - ld a,[$cf0c] + ld [wListMenuID],a + ld a,[wcf0c] bit 0,a jr nz,.skipDrawingTextBoxBorder ld a,[$ff8c] ; text ID (or sprite ID) @@ -12130,30 +915,27 @@ DisplayTextIDInit: ; 7096 (1:7096) ; if text ID is 0 (i.e. the start menu) ; Note that the start menu text border is also drawn in the function directly ; below this, so this seems unnecessary. - ld a,[$d74b] + ld a,[wd74b] bit 5,a ; does the player have the pokedex? ; start menu with pokedex - FuncCoord 10, 0 ; $c3aa - ld hl,Coord + hlCoord 10, 0 ld b,$0e ld c,$08 jr nz,.drawTextBoxBorder ; start menu without pokedex - FuncCoord 10, 0 ; $c3aa - ld hl,Coord + hlCoord 10, 0 ld b,$0c ld c,$08 jr .drawTextBoxBorder ; if text ID is not 0 (i.e. not the start menu) then do a standard dialogue text box .notStartMenu - FuncCoord 0, 12 ; $c490 - ld hl,Coord + hlCoord 0, 12 ld b,$04 ld c,$12 .drawTextBoxBorder call TextBoxBorder .skipDrawingTextBoxBorder - ld hl,$cfc4 + ld hl,wcfc4 set 0,[hl] ld hl,wFlags_0xcd60 bit 4,[hl] @@ -12164,7 +946,7 @@ DisplayTextIDInit: ; 7096 (1:7096) ; loop to copy C1X9 (direction the sprite is facing) to C2X9 for each sprite ; this is done because when you talk to an NPC, they turn to look your way ; the original direction they were facing must be restored after the dialogue is over - ld hl,$c119 + ld hl,wSpriteStateData1 + $19 ld c,$0f ld de,$0010 .spriteFacingDirectionCopyLoop @@ -12177,7 +959,7 @@ DisplayTextIDInit: ; 7096 (1:7096) jr nz,.spriteFacingDirectionCopyLoop ; loop to force all the sprites in the middle of animation to stand still ; (so that they don't like they're frozen mid-step during the dialogue) - ld hl,$c102 + ld hl,wSpriteStateData1 + 2 ld de,$0010 ld c,e .spriteStandStillLoop @@ -12202,37 +984,34 @@ DisplayTextIDInit: ; 7096 (1:7096) ; function that displays the start menu DrawStartMenu: ; 710b (1:710b) - ld a,[$d74b] + ld a,[wd74b] bit 5,a ; does the player have the pokedex? ; menu with pokedex - FuncCoord 10, 0 ; $c3aa - ld hl,Coord + hlCoord 10, 0 ld b,$0e ld c,$08 jr nz,.drawTextBoxBorder ; shorter menu if the player doesn't have the pokedex - FuncCoord 10, 0 ; $c3aa - ld hl,Coord + hlCoord 10, 0 ld b,$0c ld c,$08 .drawTextBoxBorder call TextBoxBorder ld a,%11001011 ; bit mask for down, up, start, B, and A buttons - ld [$cc29],a + ld [wMenuWatchedKeys],a ld a,$02 - ld [$cc24],a ; Y position of first menu choice + ld [wTopMenuItemY],a ; Y position of first menu choice ld a,$0b - ld [$cc25],a ; X position of first menu choice - ld a,[$cc2d] ; remembered menu selection from last time - ld [$cc26],a - ld [$cc2a],a + ld [wTopMenuItemX],a ; X position of first menu choice + ld a,[wcc2d] ; remembered menu selection from last time + ld [wCurrentMenuItem],a + ld [wLastMenuItem],a xor a - ld [$cc37],a - ld hl,$d730 + ld [wcc37],a + ld hl,wd730 set 6,[hl] ; no pauses between printing each letter - FuncCoord 12, 2 ; $c3d4 - ld hl,Coord - ld a,[$d74b] + hlCoord 12, 2 + ld a,[wd74b] bit 5,a ; does the player have the pokedex? ; case for not having pokdex ld a,$06 @@ -12242,14 +1021,14 @@ DrawStartMenu: ; 710b (1:710b) call PrintStartMenuItem ld a,$07 .storeMenuItemCount - ld [$cc28],a ; number of menu items + ld [wMaxMenuItem],a ; number of menu items ld de,StartMenuPokemonText call PrintStartMenuItem ld de,StartMenuItemText call PrintStartMenuItem - ld de,W_PLAYERNAME ; player's name + ld de,wPlayerName ; player's name call PrintStartMenuItem - ld a,[$d72e] + ld a,[wd72e] bit 6,a ; is the player using the link feature? ; case for not using link feature ld de,StartMenuSaveText @@ -12262,7 +1041,7 @@ DrawStartMenu: ; 710b (1:710b) call PrintStartMenuItem ld de,StartMenuExitText call PlaceString - ld hl,$d730 + ld hl,wd730 res 6,[hl] ; turn pauses between printing letters back on ret @@ -12299,9 +1078,9 @@ INCLUDE "engine/overworld/cable_club_npc.asm" ; function to draw various text boxes ; INPUT: -; [$D125] = text box ID +; [wd125] = text box ID DisplayTextBoxID_: ; 72ea (1:72ea) - ld a,[$d125] ; a = text box ID + ld a,[wd125] ; a = text box ID cp a,$14 jp z,DisplayYesNoTextBox ld c,a @@ -12338,14 +1117,14 @@ DisplayTextBoxID_: ; 72ea (1:72ea) call TextBoxBorder pop hl call GetTextBoxIDText - ld a,[$d730] + ld a,[wd730] push af - ld a,[$d730] + ld a,[wd730] set 6,a ; no pauses between printing each letter - ld [$d730],a + ld [wd730],a call PlaceString pop af - ld [$d730],a + ld [wd730],a call UpdateSprites ; move sprites ret @@ -12568,22 +1347,20 @@ JapanesePokedexMenu: ; 74a1 (1:74a1) next "キャンセル@" Func_74ba: ; 74ba (1:74ba) - ld hl, $d730 + ld hl, wd730 set 6, [hl] ld a, $f - ld [$d125], a + ld [wd125], a call DisplayTextBoxID - FuncCoord 13, 1 ; $c3c1 - ld hl, Coord + hlCoord 13, 1 ld b, $1 ld c, $6 call ClearScreenArea - FuncCoord 12, 1 ; $c3c0 - ld hl, Coord - ld de, wPlayerMoney ; $d347 + hlCoord 12, 1 + ld de, wPlayerMoney ; wPlayerMoney ld c, $a3 call PrintBCDNumber - ld hl, $d730 + ld hl, wd730 res 6, [hl] ret @@ -12591,29 +1368,29 @@ CurrencyString: ; 74e2 (1:74e2) db " ¥@" Func_74ea: ; 74ea (1:74ea) - ld a, [$d730] + ld a, [wd730] set 6, a - ld [$d730], a + ld [wd730], a xor a - ld [$d12d], a + ld [wd12d], a ld a, $e - ld [$d125], a + ld [wd125], a call DisplayTextBoxID ld a, $3 - ld [wMenuWatchedKeys], a ; $cc29 + ld [wMenuWatchedKeys], a ; wMenuWatchedKeys ld a, $2 - ld [wMaxMenuItem], a ; $cc28 + ld [wMaxMenuItem], a ; wMaxMenuItem ld a, $1 - ld [wTopMenuItemY], a ; $cc24 + ld [wTopMenuItemY], a ; wTopMenuItemY ld a, $1 - ld [wTopMenuItemX], a ; $cc25 + ld [wTopMenuItemX], a ; wTopMenuItemX xor a - ld [wCurrentMenuItem], a ; $cc26 - ld [wLastMenuItem], a ; $cc2a - ld [$cc37], a - ld a, [$d730] + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wLastMenuItem], a ; wLastMenuItem + ld [wcc37], a + ld a, [wd730] res 6, a - ld [$d730], a + ld [wd730], a call HandleMenuInput call PlaceUnfilledArrowMenuCursor bit 0, a @@ -12621,58 +1398,58 @@ Func_74ea: ; 74ea (1:74ea) bit 1, a jr z, .asm_7539 ld a, $2 - ld [$d12e], a + ld [wd12e], a jr .asm_754c .asm_7539 ld a, $1 - ld [$d12e], a - ld a, [wCurrentMenuItem] ; $cc26 - ld [$d12d], a + ld [wd12e], a + ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld [wd12d], a ld b, a - ld a, [wMaxMenuItem] ; $cc28 + ld a, [wMaxMenuItem] ; wMaxMenuItem cp b jr z, .asm_754c ret .asm_754c ld a, $2 - ld [$d12e], a - ld a, [wCurrentMenuItem] ; $cc26 - ld [$d12d], a + ld [wd12e], a + ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld [wd12d], a scf ret DisplayYesNoTextBox: ; 7559 (1:7559) push hl - ld a, [$d730] + ld a, [wd730] set 6, a - ld [$d730], a + ld [wd730], a xor a - ld [$d12d], a - ld [$d12e], a + ld [wd12d], a + ld [wd12e], a ld a, $3 - ld [wMenuWatchedKeys], a ; $cc29 + ld [wMenuWatchedKeys], a ; wMenuWatchedKeys ld a, $1 - ld [wMaxMenuItem], a ; $cc28 + ld [wMaxMenuItem], a ; wMaxMenuItem ld a, b - ld [wTopMenuItemY], a ; $cc24 + ld [wTopMenuItemY], a ; wTopMenuItemY ld a, c - ld [wTopMenuItemX], a ; $cc25 + ld [wTopMenuItemX], a ; wTopMenuItemX xor a - ld [wLastMenuItem], a ; $cc2a - ld [$cc37], a + ld [wLastMenuItem], a ; wLastMenuItem + ld [wcc37], a push hl - ld hl, $d12c + ld hl, wd12c bit 7, [hl] res 7, [hl] jr z, .asm_758d inc a .asm_758d - ld [wCurrentMenuItem], a ; $cc26 + ld [wCurrentMenuItem], a ; wCurrentMenuItem pop hl push hl push hl call Func_763e - ld a, [$d12c] + ld a, [wd12c] ld hl, MenuStrings ; $7671 ld e, a ld d, $0 @@ -12689,7 +1466,7 @@ DisplayYesNoTextBox: ; 7559 (1:7559) ld d, h pop hl push de - ld a, [$d12c] + ld a, [wd12c] cp $5 jr nz, .asm_75b9 call Func_5ab3 @@ -12712,13 +1489,13 @@ DisplayYesNoTextBox: ; 7559 (1:7559) pop hl add hl, bc call PlaceString - ld hl, $d730 + ld hl, wd730 res 6, [hl] - ld a, [$d12c] + ld a, [wd12c] cp $7 jr nz, .asm_7603 xor a - ld [$d12c], a + ld [wd12c], a ld a, [wFlags_0xcd60] push af push hl @@ -12738,18 +1515,18 @@ DisplayYesNoTextBox: ; 7559 (1:7559) jr .asm_760f .asm_7603 xor a - ld [$d12c], a + ld [wd12c], a call HandleMenuInput pop hl bit 1, a jr nz, .asm_7627 .asm_760f - ld a, [wCurrentMenuItem] ; $cc26 - ld [$d12d], a + ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld [wd12d], a and a jr nz, .asm_7627 ld a, $1 - ld [$d12e], a + ld [wd12e], a ld c, $f call DelayFrames call Func_7656 @@ -12757,10 +1534,10 @@ DisplayYesNoTextBox: ; 7559 (1:7559) ret .asm_7627 ld a, $1 - ld [wCurrentMenuItem], a ; $cc26 - ld [$d12d], a + ld [wCurrentMenuItem], a ; wCurrentMenuItem + ld [wd12d], a ld a, $2 - ld [$d12e], a + ld [wd12e], a ld c, $f call DelayFrames call Func_7656 @@ -12768,7 +1545,7 @@ DisplayYesNoTextBox: ; 7559 (1:7559) ret Func_763e: ; 763e (1:763e) - ld de, $cee9 + ld de, wHPBarMaxHP ld bc, $506 .asm_7644 ld a, [hli] @@ -12786,7 +1563,7 @@ Func_763e: ; 763e (1:763e) ret Func_7656: ; 7656 (1:7656) - ld de, $cee9 + ld de, wHPBarMaxHP ld bc, $506 .asm_765c ld a, [de] @@ -12839,7 +1616,7 @@ MenuStrings: ; 7671 (1:7671) Func_76e1: ; 76e1 (1:36e1) xor a - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade ld [hli], a ld [hli], a ld [hli], a @@ -12847,26 +1624,23 @@ Func_76e1: ; 76e1 (1:36e1) ld [hli], a ld [hl], $c call GetMonFieldMoves - ld a, [$cd41] + ld a, [wTrainerScreenX] and a jr nz, .asm_770f - FuncCoord 11, 11 ; $c487 - ld hl, Coord + hlCoord 11, 11 ld b, $5 ld c, $7 call TextBoxBorder call UpdateSprites ld a, $c ld [$fff7], a - FuncCoord 13, 12 ; $c49d - ld hl, Coord + hlCoord 13, 12 ld de, PokemonMenuEntries ; $77c2 jp PlaceString .asm_770f push af - FuncCoord 0, 11 ; $c47c - ld hl, Coord - ld a, [$cd42] + hlCoord 0, 11 + ld a, [wcd42] dec a ld e, a ld d, $0 @@ -12888,22 +1662,21 @@ Func_76e1: ; 76e1 (1:36e1) inc b call TextBoxBorder call UpdateSprites - FuncCoord 0, 12 ; $c490 - ld hl, Coord - ld a, [$cd42] + hlCoord 0, 12 + ld a, [wcd42] inc a ld e, a ld d, $0 add hl, de ld de, $ffd8 - ld a, [$cd41] + ld a, [wTrainerScreenX] .asm_7747 add hl, de dec a jr nz, .asm_7747 xor a - ld [$cd41], a - ld de, wWhichTrade ; $cd3d + ld [wTrainerScreenX], a + ld de, wWhichTrade ; wWhichTrade .asm_7752 push hl ld hl, FieldMoveNames ; $778d @@ -12934,11 +1707,10 @@ Func_76e1: ; 76e1 (1:36e1) jr .asm_7752 .asm_7776 pop hl - ld a, [$cd42] + ld a, [wcd42] ld [$fff7], a - FuncCoord 0, 12 ; $c490 - ld hl, Coord - ld a, [$cd42] + hlCoord 0, 12 + ld a, [wcd42] inc a ld e, a ld d, $0 @@ -12963,14 +1735,14 @@ PokemonMenuEntries: ; 77c2 (1:77c2) next "CANCEL@" GetMonFieldMoves: ; 77d6 (1:77d6) - ld a, [wWhichPokemon] ; $cf92 - ld hl, W_PARTYMON1_MOVE1 ; $d173 + ld a, [wWhichPokemon] ; wWhichPokemon + ld hl, wPartyMon1Moves ; wPartyMon1Moves ld bc, $2c call AddNTimes ld d, h ld e, l ld c, $5 - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade .asm_77e9 push hl .asm_77ea @@ -12993,21 +1765,21 @@ GetMonFieldMoves: ; 77d6 (1:77d6) jr .asm_77f6 .asm_7802 ld a, b - ld [$cd43], a + ld [wcd43], a ld a, [hli] ld b, [hl] pop hl ld [hli], a - ld a, [$cd41] + ld a, [wTrainerScreenX] inc a - ld [$cd41], a - ld a, [$cd42] + ld [wTrainerScreenX], a + ld a, [wcd42] cp b jr c, .asm_781b ld a, b - ld [$cd42], a + ld [wcd42], a .asm_781b - ld a, [$cd43] + ld a, [wcd43] ld b, a jr .asm_77e9 .asm_7821 @@ -13038,16 +1810,16 @@ INCLUDE "engine/battle/1.asm" INCLUDE "engine/menu/players_pc.asm" _RemovePokemon: ; 7b68 (1:7b68) - ld hl, W_NUMINPARTY ; $d163 - ld a, [$cf95] + ld hl, wPartyCount ; wPartyCount + ld a, [wcf95] and a jr z, .asm_7b74 - ld hl, W_NUMINBOX ; $da80 + ld hl, W_NUMINBOX ; wda80 .asm_7b74 ld a, [hl] dec a ld [hli], a - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon ld c, a ld b, $0 add hl, bc @@ -13060,17 +1832,17 @@ _RemovePokemon: ; 7b68 (1:7b68) ld [hli], a inc a jr nz, .asm_7b81 - ld hl, W_PARTYMON1OT ; $d273 + ld hl, wPartyMonOT ; wd273 ld d, $5 - ld a, [$cf95] + ld a, [wcf95] and a jr z, .asm_7b97 - ld hl, W_BOXMON1OT + ld hl, wBoxMonOT ld d, $13 .asm_7b97 - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon call SkipFixedLengthTextEntries - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon cp d jr nz, .asm_7ba6 ld [hl], $ff @@ -13080,135 +1852,83 @@ _RemovePokemon: ; 7b68 (1:7b68) ld e, l ld bc, $b add hl, bc - ld bc, W_PARTYMON1NAME ; $d2b5 - ld a, [$cf95] + ld bc, wPartyMonNicks ; wPartyMonNicks + ld a, [wcf95] and a jr z, .asm_7bb8 - ld bc, W_BOXMON1NAME + ld bc, wBoxMonNicks .asm_7bb8 call CopyDataUntil - ld hl, W_PARTYMON1_NUM ; $d16b (aliases: W_PARTYMON1DATA) - ld bc, $2c - ld a, [$cf95] + ld hl, wPartyMons + ld bc, wPartyMon2 - wPartyMon1 + ld a, [wcf95] and a jr z, .asm_7bcd - ld hl, W_BOXMON1DATA - ld bc, $21 + ld hl, wBoxMons + ld bc, wBoxMon2 - wBoxMon1 .asm_7bcd - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon call AddNTimes ld d, h ld e, l - ld a, [$cf95] + ld a, [wcf95] and a jr z, .asm_7be4 - ld bc, $21 + ld bc, wBoxMon2 - wBoxMon1 add hl, bc - ld bc, W_BOXMON1OT + ld bc, wBoxMonOT jr .asm_7beb .asm_7be4 - ld bc, $2c + ld bc, wPartyMon2 - wPartyMon1 add hl, bc - ld bc, W_PARTYMON1OT ; $d273 + ld bc, wPartyMonOT ; wd273 .asm_7beb call CopyDataUntil - ld hl, W_PARTYMON1NAME ; $d2b5 - ld a, [$cf95] + ld hl, wPartyMonNicks ; wPartyMonNicks + ld a, [wcf95] and a jr z, .asm_7bfa - ld hl, W_BOXMON1NAME + ld hl, wBoxMonNicks .asm_7bfa ld bc, $b - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon call AddNTimes ld d, h ld e, l ld bc, $b add hl, bc - ld bc, wPokedexOwned ; $d2f7 - ld a, [$cf95] + ld bc, wPokedexOwned ; wPokedexOwned + ld a, [wcf95] and a jr z, .asm_7c15 - ld bc, $dee2 + ld bc, wBoxMonNicksEnd .asm_7c15 jp CopyDataUntil Func_7c18: ; 7c18 (1:7c18) - ld hl, $d730 + ld hl, wd730 set 6, [hl] - ld a, $3d - call Predef - ld hl, $d730 + predef ShowPokedexData + ld hl, wd730 res 6, [hl] call ReloadMapData ld c, $a call DelayFrames - ld a, $3a - call Predef - ld a, [$d11e] + predef IndexToPokedex + ld a, [wd11e] dec a ld c, a ld b, $1 ld hl, wPokedexSeen - ld a, $10 - call Predef + predef FlagActionPredef ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ret SECTION "bank3",ROMX,BANK[$3] -_GetJoypadState: ; c000 (3:4000) - ld a, [H_JOYPADSTATE] - cp BTN_A | BTN_B | BTN_SELECT | BTN_START ; soft reset sequence - jp z, HandleJoypadResetButtons - ld b, a - ld a, [H_OLDPRESSEDBUTTONS] - ld e, a - xor b - ld d, a - and e - ld [H_NEWLYRELEASEDBUTTONS], a - ld a, d - and b - ld [H_NEWLYPRESSEDBUTTONS], a - ld a, b - ld [H_OLDPRESSEDBUTTONS], a - ld a, [$d730] - bit 5, a - jr nz, DiscardButtonPresses - ld a, [H_OLDPRESSEDBUTTONS] - ld [H_CURRENTPRESSEDBUTTONS], a - ld a, [wJoypadForbiddenButtonsMask] - and a - ret z - cpl - ld b, a - ld a, [H_CURRENTPRESSEDBUTTONS] - and b - ld [H_CURRENTPRESSEDBUTTONS], a - ld a, [H_NEWLYPRESSEDBUTTONS] - and b - ld [H_NEWLYPRESSEDBUTTONS], a - ret - -; clears all button presses -DiscardButtonPresses: ; c034 (3:4034) - xor a - ld [H_CURRENTPRESSEDBUTTONS], a - ld [H_NEWLYPRESSEDBUTTONS], a - ld [H_NEWLYRELEASEDBUTTONS], a - ret - -HandleJoypadResetButtons: ; c03c (3:403c) - call DelayFrame - ld a, $30 - ld [rJOYP], a ; reset joypad state (to enusre the user really intends to reset) - ld hl, H_SOFTRESETCOUNTER - dec [hl] - jp z, SoftReset - jp GetJoypadState +INCLUDE "engine/joypad.asm" INCLUDE "data/map_songs.asm" @@ -13220,41 +1940,41 @@ Func_c335: ; c335 (3:4335) ld [rWY], a ; $ff4a xor a ld [H_AUTOBGTRANSFERENABLED], a ; $ffba - ld [$d13b], a - ld [W_LONEATTACKNO], a ; $d05c - ld [H_NEWLYPRESSEDBUTTONS], a - ld [H_NEWLYRELEASEDBUTTONS], a - ld [H_CURRENTPRESSEDBUTTONS], a - ld [$cd6a], a - ld [$d5a3], a - ld hl, $d73f + ld [wd13b], a + ld [W_LONEATTACKNO], a ; W_GYMLEADERNO + ld [hJoyPressed], a + ld [hJoyReleased], a + ld [hJoyHeld], a + ld [wcd6a], a + ld [wd5a3], a + ld hl, wd73f ld [hli], a ld [hl], a - ld hl, wWhichTrade ; $cd3d + ld hl, wWhichTrade ; wWhichTrade ld bc, $1e call FillMemory ret Func_c35f: ; c35f (3:435f) - ld a, [$d3ae] + ld a, [wd3ae] and a ret z ld c, a - ld hl, $d3af + ld hl, wd3af .asm_c368 - ld a, [W_YCOORD] ; $d361 + ld a, [W_YCOORD] ; wd361 cp [hl] jr nz, .asm_c383 inc hl - ld a, [W_XCOORD] ; $d362 + ld a, [W_XCOORD] ; wd362 cp [hl] jr nz, .asm_c384 inc hl ld a, [hli] - ld [$d42f], a + ld [wd42f], a ld a, [hl] ld [H_DOWNARROWBLINKCNT1], a ; $ff8b - ld hl, $d736 + ld hl, wd736 set 2, [hl] ret .asm_c383 @@ -13268,7 +1988,7 @@ Func_c35f: ; c35f (3:435f) ret CheckForceBikeOrSurf: ; c38b (3:438b) - ld hl, $D732 + ld hl, wd732 bit 5, [hl] ret nz ld hl, ForcedBikeOrSurfMaps @@ -13301,11 +2021,11 @@ CheckForceBikeOrSurf: ; c38b (3:438b) ld [W_SEAFOAMISLANDS5CURSCRIPT], a jr z, .forceSurfing ;force bike riding - ld hl, $d732 + ld hl, wd732 set 5, [hl] ld a, $1 - ld [$d700], a - ld [$d11a], a + ld [wd700], a + ld [wd11a], a jp ForceBikeOrSurf .incorrectMap inc hl @@ -13314,8 +2034,8 @@ CheckForceBikeOrSurf: ; c38b (3:438b) jr .loop .forceSurfing ld a, $2 - ld [$d700], a - ld [$d11a], a + ld [wd700], a + ld [wd11a], a jp ForceBikeOrSurf INCLUDE "data/force_bike_surf.asm" @@ -13324,7 +2044,7 @@ Func_c3ff: ; c3ff (3:43ff) push hl push de push bc - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] srl a ld c, a ld b, $0 @@ -13333,9 +2053,9 @@ Func_c3ff: ; c3ff (3:43ff) ld a, [hli] ld h, [hl] ld l, a - ld a, [W_YCOORD] ; $d361 + ld a, [W_YCOORD] ; wd361 ld b, a - ld a, [W_XCOORD] ; $d362 + ld a, [W_XCOORD] ; wd362 ld c, a ld de, .asm_c41e ; $441e push de @@ -13353,7 +2073,7 @@ PointerTable_c422: ; c422 (3:4422) dw .asm_4440 .asm_c42a - ld a, [W_CURMAPHEIGHT] ; $d368 + ld a, [W_CURMAPHEIGHT] ; wd368 add a dec a cp b @@ -13373,7 +2093,7 @@ PointerTable_c422: ; c422 (3:4422) jr .resetCarry .asm_4440 - ld a, [W_CURMAPWIDTH] ; $d369 + ld a, [W_CURMAPWIDTH] ; wd369 add a dec a cp c @@ -13391,10 +2111,10 @@ Func_c44e: ; c44e (3:444e) push de push bc call Func_c589 - ld a, [W_CURMAP] ; $d35e + ld a, [W_CURMAP] ; W_CURMAP cp SS_ANNE_5 jr z, .ssAnne5 - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] srl a ld c, a ld b, $0 @@ -13403,7 +2123,7 @@ Func_c44e: ; c44e (3:444e) ld a, [hli] ld h, [hl] ld l, a - ld a, [$cfc6] + ld a, [wcfc6] ld de, $1 call IsInArray .asm_c473 @@ -13431,7 +2151,7 @@ Func_c44e: ; c44e (3:444e) db $0F,$4E,$FF .ssAnne5 - ld a, [$cfc6] + ld a, [wcfc6] cp $15 jr nz, .asm_c49a scf @@ -13446,7 +2166,7 @@ Func_c49d: ; c49d (3:449d) push bc callba HandleDoors jr c, .asm_c4c8 - ld a, [W_CURMAPTILESET] ; $d367 + ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET add a ld c, a ld b, $0 @@ -13456,11 +2176,10 @@ Func_c49d: ; c49d (3:449d) ld h, [hl] ld l, a ld de, $1 - FuncCoord 8, 9 ; $c45c - ld a, [Coord] + aCoord 8, 9 call IsInArray jr nc, .asm_c4c8 - ld hl, $d736 + ld hl, wd736 res 2, [hl] .asm_c4c8 pop bc @@ -13471,7 +2190,7 @@ Func_c49d: ; c49d (3:449d) INCLUDE "data/warp_tile_ids.asm" PrintSafariZoneSteps: ; c52f (3:452f) - ld a, [W_CURMAP] ; $d35e + ld a, [W_CURMAP] ; W_CURMAP cp SAFARI_ZONE_EAST ret c cp UNKNOWN_DUNGEON_2 @@ -13480,30 +2199,25 @@ PrintSafariZoneSteps: ; c52f (3:452f) ld b, $3 ld c, $7 call TextBoxBorder - FuncCoord 1, 1 ; $c3b5 - ld hl, Coord - ld de, wSafariSteps ; $d70d + hlCoord 1, 1 + ld de, wSafariSteps ; wd70d ld bc, $203 call PrintNumber - FuncCoord 4, 1 ; $c3b8 - ld hl, Coord + hlCoord 4, 1 ld de, SafariSteps ; $4579 call PlaceString - FuncCoord 1, 3 ; $c3dd - ld hl, Coord + hlCoord 1, 3 ld de, SafariBallText call PlaceString - ld a, [W_NUMSAFARIBALLS] ; $da47 + ld a, [W_NUMSAFARIBALLS] ; W_NUMSAFARIBALLS cp $a jr nc, .asm_c56d - FuncCoord 5, 3 ; $c3e1 - ld hl, Coord + hlCoord 5, 3 ld a, $7f ld [hl], a .asm_c56d - FuncCoord 6, 3 ; $c3e2 - ld hl, Coord - ld de, W_NUMSAFARIBALLS ; $da47 + hlCoord 6, 3 + ld de, W_NUMSAFARIBALLS ; W_NUMSAFARIBALLS ld bc, $102 jp PrintNumber @@ -13514,59 +2228,54 @@ SafariBallText: ; c57e (3:457e) db "BALL×× @" Func_c586: ; c586 (3:4586) - call Load16BitRegisters + call GetPredefRegisters Func_c589: ; c589 (3:4589) - ld a, [W_YCOORD] ; $d361 + ld a, [W_YCOORD] ; wd361 ld d, a - ld a, [W_XCOORD] ; $d362 + ld a, [W_XCOORD] ; wd362 ld e, a - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] and a jr nz, .asm_c59d - FuncCoord 8, 11 ; $c484 - ld a, [Coord] + aCoord 8, 11 inc d jr .asm_c5b9 .asm_c59d cp $4 jr nz, .asm_c5a7 - FuncCoord 8, 7 ; $c434 - ld a, [Coord] + aCoord 8, 7 dec d jr .asm_c5b9 .asm_c5a7 cp $8 jr nz, .asm_c5b1 - FuncCoord 6, 9 ; $c45a - ld a, [Coord] + aCoord 6, 9 dec e jr .asm_c5b9 .asm_c5b1 cp $c jr nz, .asm_c5b9 - FuncCoord 10, 9 ; $c45e - ld a, [Coord] + aCoord 10, 9 inc e .asm_c5b9 ld c, a - ld [$cfc6], a + ld [wcfc6], a ret Func_c5be: ; c5be (3:45be) xor a ld [$ffdb], a - ld hl, W_YCOORD ; $d361 + ld hl, W_YCOORD ; wd361 ld a, [hli] ld d, a ld e, [hl] - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] and a jr nz, .asm_c5d8 ld hl, $ffdb set 0, [hl] - FuncCoord 8, 13 ; $c4ac - ld a, [Coord] + aCoord 8, 13 inc d jr .asm_c603 .asm_c5d8 @@ -13574,8 +2283,7 @@ Func_c5be: ; c5be (3:45be) jr nz, .asm_c5e7 ld hl, $ffdb set 1, [hl] - FuncCoord 8, 5 ; $c40c - ld a, [Coord] + aCoord 8, 5 dec d jr .asm_c603 .asm_c5e7 @@ -13583,8 +2291,7 @@ Func_c5be: ; c5be (3:45be) jr nz, .asm_c5f6 ld hl, $ffdb set 2, [hl] - FuncCoord 4, 9 ; $c458 - ld a, [Coord] + aCoord 4, 9 dec e jr .asm_c603 .asm_c5f6 @@ -13592,18 +2299,17 @@ Func_c5be: ; c5be (3:45be) jr nz, .asm_c603 ld hl, $ffdb set 3, [hl] - FuncCoord 12, 9 ; $c460 - ld a, [Coord] + aCoord 12, 9 inc e .asm_c603 ld c, a - ld [$d71c], a - ld [$cfc6], a + ld [wd71c], a + ld [wcfc6], a ret Func_c60b: ; c60b (3:460b) call Func_c5be - ld hl, $d530 + ld hl, W_TILESETCOLLISIONPTR ld a, [hli] ld h, [hl] ld l, a @@ -13617,31 +2323,31 @@ Func_c60b: ; c60b (3:460b) call Func_c44 ld a, $ff jr c, .asm_c632 - ld a, [$d71c] + ld a, [wd71c] cp $15 ld a, $ff jr z, .asm_c632 call Func_c636 .asm_c632 - ld [$d71c], a + ld [wd71c], a ret Func_c636: ; c636 (3:4636) - ld a, [$d718] + ld a, [wd718] dec a swap a ld d, $0 ld e, a - ld hl, $c214 + ld hl, wSpriteStateData2 + $14 add hl, de ld a, [hli] ld [$ffdc], a ld a, [hl] ld [$ffdd], a - ld a, [W_NUMSPRITES] ; $d4e1 + ld a, [W_NUMSPRITES] ; W_NUMSPRITES ld c, a ld de, $f - ld hl, $c214 + ld hl, wSpriteStateData2 + $14 ld a, [$ffdb] and $3 jr z, .asm_c678 @@ -13702,19 +2408,19 @@ Func_c636: ; c636 (3:4636) ret Func_c69c: ; c69c (3:469c) - ld a, [$d730] + ld a, [wd730] add a jp c, .asm_c74f - ld a, [W_NUMINPARTY] ; $d163 + ld a, [wPartyCount] ; wPartyCount and a jp z, .asm_c74f call Func_c8de - ld a, [$d13b] + ld a, [wd13b] and $3 jp nz, .asm_c74f - ld [wWhichPokemon], a ; $cf92 - ld hl, W_PARTYMON1_STATUS ; $d16f - ld de, W_PARTYMON1 ; $d164 + ld [wWhichPokemon], a ; wWhichPokemon + ld hl, wPartyMon1Status ; wPartyMon1Status + ld de, wPartySpecies ; wPartySpecies .asm_c6be ld a, [hl] and $8 @@ -13743,13 +2449,13 @@ Func_c69c: ; c69c (3:469c) inc hl ld [hl], a ld a, [de] - ld [$d11e], a + ld [wd11e], a push de - ld a, [wWhichPokemon] ; $cf92 - ld hl, W_PARTYMON1NAME ; $d2b5 + ld a, [wWhichPokemon] ; wWhichPokemon + ld hl, wPartyMonNicks ; wPartyMonNicks call GetPartyMonName xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a call EnableAutoTextBoxDrawing ld a, $d0 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c @@ -13767,13 +2473,13 @@ Func_c69c: ; c69c (3:469c) ld bc, $2c add hl, bc push hl - ld hl, wWhichPokemon ; $cf92 + ld hl, wWhichPokemon ; wWhichPokemon inc [hl] pop hl jr .asm_c6be .asm_c70e - ld hl, W_PARTYMON1_STATUS ; $d16f - ld a, [W_NUMINPARTY] ; $d163 + ld hl, wPartyMon1Status ; wPartyMon1Status + ld a, [wPartyCount] ; wPartyCount ld d, a ld e, $0 .asm_c717 @@ -13789,13 +2495,11 @@ Func_c69c: ; c69c (3:469c) and a jr z, .asm_c733 ld b, $2 - ld a, $1f - call Predef ; indirect jump to Func_480eb (480eb (12:40eb)) + predef Func_480eb ld a, (SFX_02_43 - SFX_Headers_02) / 3 call PlaySound .asm_c733 - ld a, $14 - call Predef ; indirect jump to AnyPlayerPokemonAliveCheck (3ca83 (f:4a83)) + predef AnyPartyAlive ld a, d and a jr nz, .asm_c74f @@ -13803,21 +2507,21 @@ Func_c69c: ; c69c (3:469c) ld a, $d1 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d72e + ld hl, wd72e set 5, [hl] ld a, $ff jr .asm_c750 .asm_c74f xor a .asm_c750 - ld [$d12d], a + ld [wd12d], a ret Func_c754: ; c754 (3:4754) - call Load16BitRegisters + call GetPredefRegisters push hl ld d, $0 - ld a, [W_CURMAPTILESET] ; $d367 + ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET add a add a ld b, a @@ -13829,7 +2533,7 @@ Func_c754: ; c754 (3:4754) ld e, a ld hl, Tilesets add hl, de - ld de, $d52b + ld de, W_TILESETBANK ld c, $b .asm_c76f ld a, [hli] @@ -13842,7 +2546,7 @@ Func_c754: ; c754 (3:4754) xor a ld [$ffd8], a pop hl - ld a, [W_CURMAPTILESET] ; $d367 + ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET push hl push de ld hl, DungeonTilesets ; $47b2 @@ -13851,22 +2555,22 @@ Func_c754: ; c754 (3:4754) pop de pop hl jr c, .asm_c797 - ld a, [W_CURMAPTILESET] ; $d367 + ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET ld b, a ld a, [H_DOWNARROWBLINKCNT1] ; $ff8b cp b jr z, .asm_c7b1 .asm_c797 - ld a, [$d42f] + ld a, [wd42f] cp $ff jr z, .asm_c7b1 call LoadDestinationWarpPosition - ld a, [W_YCOORD] ; $d361 + ld a, [W_YCOORD] ; wd361 and $1 - ld [W_YBLOCKCOORD], a ; $d363 - ld a, [W_XCOORD] ; $d362 + ld [W_YBLOCKCOORD], a ; wd363 + ld a, [W_XCOORD] ; wd362 and $1 - ld [W_XBLOCKCOORD], a ; $d364 + ld [W_XBLOCKCOORD], a ; wd364 .asm_c7b1 ret @@ -13878,7 +2582,7 @@ Func_c8de: ; c8de (3:48de) ld a, [W_DAYCARE_IN_USE] and a ret z - ld hl, $da6f + ld hl, wDayCareMonExp + 2 inc [hl] ret nz dec hl @@ -13895,8 +2599,8 @@ Func_c8de: ; c8de (3:48de) INCLUDE "data/hide_show_data.asm" -PrintUsedStrengthText: ; cd99 (3:4d99) - ld hl, $d728 +PrintStrengthTxt: ; cd99 (3:4d99) + ld hl, wd728 set 0, [hl] ld hl, UsedStrengthText call PrintText @@ -13906,7 +2610,7 @@ PrintUsedStrengthText: ; cd99 (3:4d99) UsedStrengthText: ; cdaa (3:4daa) TX_FAR _UsedStrengthText db $08 ; asm - ld a, [$cf91] + ld a, [wcf91] call PlayCry call Delay3 jp TextScriptEnd @@ -13916,27 +2620,27 @@ CanMoveBouldersText: ; cdbb (3:4dbb) db "@" CheckForForcedBikeSurf: ; cdc0 (3:4dc0) - ld hl, $d728 + ld hl, wd728 set 1, [hl] - ld a, [$d732] + ld a, [wd732] bit 5, a jr nz, .asm_cdec - ld a, [W_CURMAP] ; $d35e + ld a, [W_CURMAP] ; W_CURMAP cp SEAFOAM_ISLANDS_5 ret nz - ld a, [$d881] + ld a, [wd881] and $3 cp $3 ret z ld hl, CoordsData_cdf7 ; $4df7 call ArePlayerCoordsInArray ret nc - ld hl, $d728 + ld hl, wd728 res 1, [hl] ld hl, CurrentTooFastText jp PrintText .asm_cdec - ld hl, $d728 + ld hl, wd728 res 1, [hl] ld hl, CyclingIsFunText jp PrintText @@ -13955,11 +2659,11 @@ CyclingIsFunText: ; cdff (3:4dff) ; function to add an item (in varying quantities) to the player's bag or PC box ; INPUT: ; hl = address of inventory (either wNumBagItems or wNumBoxItems) -; [$CF91] = item ID -; [$CF96] = item quantity +; [wcf91] = item ID +; [wcf96] = item quantity ; sets carry flag if successful, unsets carry flag if unsuccessful AddItemToInventory_: ; ce04 (3:4e04) - ld a,[$cf96] ; a = item quantity + ld a,[wcf96] ; a = item quantity push af push bc push de @@ -13984,7 +2688,7 @@ AddItemToInventory_: ; ce04 (3:4e04) .loop ld a,[hli] ld b,a ; b = ID of current item in table - ld a,[$cf91] ; a = ID of item being added + ld a,[wcf91] ; a = ID of item being added cp b ; does the current item in the table match the item being added? jp z,.increaseItemQuantity ; if so, increase the item's quantity inc hl @@ -14004,14 +2708,14 @@ AddItemToInventory_: ; ce04 (3:4e04) ld c,a ld b,0 add hl,bc ; hl = address to store the item - ld a,[$cf91] + ld a,[wcf91] ld [hli],a ; store item ID - ld a,[$cf96] + ld a,[wcf96] ld [hli],a ; store item quantity ld [hl],$ff ; store terminator jp .success .increaseItemQuantity ; increase the quantity of an item already in the inventory - ld a,[$cf96] + ld a,[wcf96] ld b,a ; b = quantity to add ld a,[hl] ; a = existing item quantity add b ; a = new item quantity @@ -14020,7 +2724,7 @@ AddItemToInventory_: ; ce04 (3:4e04) ; if the new quantity is greater than or equal to 100, ; try to max out the current slot and add the rest in a new slot sub a,99 - ld [$cf96],a ; a = amount left over (to put in the new slot) + ld [wcf96],a ; a = amount left over (to put in the new slot) ld a,d and a ; is there room for a new item slot? jr z,.increaseItemQuantityFailed @@ -14043,14 +2747,14 @@ AddItemToInventory_: ; ce04 (3:4e04) pop bc pop bc ld a,b - ld [$cf96],a ; restore the initial value from when the function was called + ld [wcf96],a ; restore the initial value from when the function was called ret ; function to remove an item (in varying quantities) from the player's bag or PC box ; INPUT: ; hl = address of inventory (either wNumBagItems or wNumBoxItems) -; [$CF92] = index (within the inventory) of the item to remove -; [$CF96] = quantity to remove +; [wWhichPokemon] = index (within the inventory) of the item to remove +; [wcf96] = quantity to remove RemoveItemFromInventory_: ; ce74 (3:4e74) push hl inc hl @@ -14062,12 +2766,12 @@ RemoveItemFromInventory_: ; ce74 (3:4e74) inc h .noCarry inc hl - ld a,[$cf96] ; quantity being removed + ld a,[wcf96] ; quantity being removed ld e,a ld a,[hl] ; a = current quantity sub e ld [hld],a ; store new quantity - ld [$cf97],a + ld [wcf97],a and a jr nz,.skipMovingUpSlots ; if the remaining quantity is 0, @@ -14087,13 +2791,13 @@ RemoveItemFromInventory_: ; ce74 (3:4e74) xor a ld [wListScrollOffset],a ld [wCurrentMenuItem],a - ld [$cc2c],a - ld [$d07e],a + ld [wcc2c],a + ld [wd07e],a pop hl ld a,[hl] ; a = number of items in inventory dec a ; decrement the number of items ld [hl],a ; store new number of items - ld [$d12a],a + ld [wd12a],a cp a,2 jr c,.done ld [wMaxMenuItem],a @@ -14149,20 +2853,20 @@ DrawBadges: ; ea03 (3:6a03) ; Instead of removing relevant code, the name graphics were erased. ; Tile ids for face/badge graphics. - ld de, $cd3f + ld de, wTrainerFacingDirection ld hl, .FaceBadgeTiles ld bc, 8 call CopyData ; Booleans for each badge. - ld hl, $cd49 + ld hl, wcd49 ld bc, 8 xor a call FillMemory ; Alter these based on owned badges. - ld de, $cd49 - ld hl, $cd3f + ld de, wcd49 + ld hl, wTrainerFacingDirection ld a, [W_OBTAINEDBADGES] ld b, a ld c, 8 @@ -14181,19 +2885,17 @@ DrawBadges: ; ea03 (3:6a03) jr nz, .CheckBadge ; Draw two rows of badges. - ld hl, $cd3d + ld hl, wWhichTrade ld a, $d8 ; [1] ld [hli], a ld [hl], $60 ; First name - FuncCoord 2, 11 - ld hl, Coord - ld de, $cd49 + hlCoord 2, 11 + ld de, wcd49 call .DrawBadgeRow - FuncCoord 2, 14 - ld hl, Coord - ld de, $cd49 + 4 + hlCoord 2, 14 + ld de, wcd49 + 4 ; call .DrawBadgeRow ; ret @@ -14206,15 +2908,15 @@ DrawBadges: ; ea03 (3:6a03) push hl ; Badge no. - ld a, [$cd3d] + ld a, [wWhichTrade] ld [hli], a inc a - ld [$cd3d], a + ld [wWhichTrade], a ; Names aren't printed if the badge is owned. ld a, [de] and a - ld a, [$cd3e] + ld a, [wTrainerEngageDistance] jr nz, .SkipName call .PlaceTiles jr .PlaceBadge @@ -14225,18 +2927,18 @@ DrawBadges: ; ea03 (3:6a03) inc hl .PlaceBadge - ld [$cd3e], a + ld [wTrainerEngageDistance], a ld de, 20 - 1 add hl, de - ld a, [$cd3f] + ld a, [wTrainerFacingDirection] call .PlaceTiles add hl, de call .PlaceTiles ; Shift badge array back one byte. push bc - ld hl, $cd3f + 1 - ld de, $cd3f + ld hl, wTrainerFacingDirection + 1 + ld de, wTrainerFacingDirection ld bc, 8 call CopyData pop bc @@ -14262,12 +2964,12 @@ DrawBadges: ; ea03 (3:6a03) db $20, $28, $30, $38, $40, $48, $50, $58 GymLeaderFaceAndBadgeTileGraphics: ; ea9e (3:6a9e) - INCBIN "gfx/badges.w16.2bpp" + INCBIN "gfx/badges.2bpp" Func_ee9e: ; ee9e (3:6e9e) - call Load16BitRegisters - ld hl, $c6e8 - ld a, [W_CURMAPWIDTH] ; $d369 + call GetPredefRegisters + ld hl, wOverworldMap + ld a, [W_CURMAPWIDTH] ; wd369 add $6 ld e, a ld d, $0 @@ -14286,11 +2988,11 @@ Func_ee9e: ; ee9e (3:6e9e) jr nz, .asm_eeb7 .asm_eebb add hl, bc - ld a, [$d09f] + ld a, [wd09f] ld [hl], a - ld a, [$d35f] + ld a, [wd35f] ld c, a - ld a, [$d360] + ld a, [wd360] ld b, a call Func_ef4e ret c @@ -14308,7 +3010,7 @@ Func_ee9e: ; ee9e (3:6e9e) ret c Func_eedc: ; eedc (3:6edc) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE inc a ret z ld a, [H_AUTOBGTRANSFERENABLED] ; $ffba @@ -14320,7 +3022,7 @@ Func_eedc: ; eedc (3:6edc) ld [$ffd7], a call LoadCurrentMapView call GoPAL_SET_CF1C - ld hl, $d526 + ld hl, wd526 ld a, [hli] ld h, [hl] ld l, a @@ -14330,9 +3032,9 @@ Func_eedc: ; eedc (3:6edc) and $3 or $98 ld a, l - ld [$cee9], a + ld [wHPBarMaxHP], a ld a, h - ld [$ceea], a + ld [wHPBarMaxHP + 1], a ld a, $2 ld [$ffbe], a ld c, $9 @@ -14340,7 +3042,7 @@ Func_eedc: ; eedc (3:6edc) push bc push hl push hl - ld hl, $c378 + ld hl, wOAMBuffer + $78 ld de, $14 ld a, [$ffbe] .asm_ef1a @@ -14389,17 +3091,16 @@ Func_ef4e: ; ef4e (3:6f4e) INCLUDE "engine/overworld/cut.asm" Func_f113: ; f113 (3:7113) - ld a, [W_CURMAP] ; $d35e + ld a, [W_CURMAP] ; W_CURMAP cp ROUTE_1 jr nc, .notInTown ld c, a ld b, $1 ld hl, W_TOWNVISITEDFLAG ; mark town as visited (for flying) - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + predef FlagActionPredef .notInTown ld hl, MapHSPointers - ld a, [W_CURMAP] ; $d35e + ld a, [W_CURMAP] ; W_CURMAP ld b, $0 ld c, a add hl, bc @@ -14431,7 +3132,7 @@ Func_f132: ; f132 (3:7132) ld [H_DIVISOR], a ld b, $2 call Divide ; divide difference by 3, resulting in the global offset (number of missable items before ours) - ld a, [W_CURMAP] ; $d35e + ld a, [W_CURMAP] ; W_CURMAP ld b, a ld a, [H_DIVIDEND+3] ld c, a ; store global offset in c @@ -14464,7 +3165,7 @@ InitializeMissableObjectsFlags: ; f175 (3:7175) call FillMemory ; clear missable objects flags ld hl, MapHS00 xor a - ld [$d048], a + ld [wd048], a .missableObjectsLoop ld a, [hli] cp $ff ; end of list @@ -14475,12 +3176,12 @@ InitializeMissableObjectsFlags: ; f175 (3:7175) cp Hide jr nz, .asm_f19d ld hl, W_MISSABLEOBJECTFLAGS - ld a, [$d048] + ld a, [wd048] ld c, a ld b, $1 - call HandleBitArray2 ; set flag iff Item is hidden + call MissableObjectFlagAction ; set flag iff Item is hidden .asm_f19d - ld hl, $d048 + ld hl, wd048 inc [hl] pop hl inc hl @@ -14488,7 +3189,7 @@ InitializeMissableObjectsFlags: ; f175 (3:7175) jr .missableObjectsLoop ; tests if current sprite is a missable object that is hidden/has been removed -IsMissableObjectHidden: ; f1a6 (3:71a6) +IsObjectHidden: ; f1a6 (3:71a6) ld a, [H_CURRENTSPRITEOFFSET] swap a ld b, a @@ -14503,7 +3204,7 @@ IsMissableObjectHidden: ; f1a6 (3:71a6) ld c, a ld b, $2 ld hl, W_MISSABLEOBJECTFLAGS - call HandleBitArray2 + call MissableObjectFlagAction ld a, c and a jr nz, .hidden @@ -14514,69 +3215,75 @@ IsMissableObjectHidden: ; f1a6 (3:71a6) ret ; adds missable object (items, leg. pokemon, etc.) to the map -; [$cc4d]: index of the missable object to be added (global index) -AddMissableObject: ; f1c8 (3:71c8) +; [wcc4d]: index of the missable object to be added (global index) +ShowObject: ; f1c8 (3:71c8) +ShowObject2: ld hl, W_MISSABLEOBJECTFLAGS - ld a, [$cc4d] + ld a, [wcc4d] ld c, a ld b, $0 - call HandleBitArray2 ; reset "removed" flag + call MissableObjectFlagAction ; reset "removed" flag jp UpdateSprites ; removes missable object (items, leg. pokemon, etc.) from the map -; [$cc4d]: index of the missable object to be removed (global index) -RemoveMissableObject: ; f1d7 (3:71d7) +; [wcc4d]: index of the missable object to be removed (global index) +HideObject: ; f1d7 (3:71d7) ld hl, W_MISSABLEOBJECTFLAGS - ld a, [$cc4d] + ld a, [wcc4d] ld c, a ld b, $1 - call HandleBitArray2 ; set "removed" flag + call MissableObjectFlagAction ; set "removed" flag jp UpdateSprites -; functionally identical to _HandleBitArray, but with less optimized instructions -; executes operations on a field of bits -; b = 0 -> reset bit -; b = 1 -> set bit -; b = 2 -> read bit (into c and z-flag) -; hl: base address -; c: bit index -HandleBitArray2: ; f1e6 (3:71e6) +MissableObjectFlagAction: +; identical to FlagAction + push hl push de push bc + + ; bit ld a, c ld d, a - and $7 - ld e, a ; store bit offset in e + and 7 + ld e, a + + ; byte ld a, d srl a srl a - srl a ; calc byte offset + srl a add l ld l, a - jr nc, .noCarry + jr nc, .ok inc h -.noCarry +.ok + + ; d = 1 << e (bitmask) inc e - ld d, $1 -.shiftLeftLoop ; d = 1 << e, bitmask for the used bit + ld d, 1 +.shift dec e - jr z, .operationSelect + jr z, .shifted sla d - jr .shiftLeftLoop -.operationSelect + jr .shift +.shifted + ld a, b and a - jr z, .resetBit - cp $2 - jr z, .readBit - ld a, [hl] ; set bit + jr z, .reset + cp 2 + jr z, .read + +.set + ld a, [hl] ld b, a ld a, d or b ld [hl], a jr .done -.resetBit + +.reset ld a, [hl] ld b, a ld a, d @@ -14584,11 +3291,13 @@ HandleBitArray2: ; f1e6 (3:71e6) and b ld [hl], a jr .done -.readBit + +.read ld a, [hl] ld b, a ld a, d and b + .done pop bc pop de @@ -14597,7 +3306,7 @@ HandleBitArray2: ; f1e6 (3:71e6) ret Func_f225: ; f225 (3:7225) - ld a, [$d728] + ld a, [wd728] bit 0, a ret z ld a, [wFlags_0xcd60] @@ -14607,10 +3316,10 @@ Func_f225: ; f225 (3:7225) ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call IsSpriteInFrontOfPlayer ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c - ld [$d718], a + ld [wd718], a and a jp z, Func_f2dd - ld hl, $c101 + ld hl, wSpriteStateData1 + 1 ld d, $0 ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c swap a @@ -14625,17 +3334,16 @@ Func_f225: ; f225 (3:7225) bit 6, [hl] set 6, [hl] ret z - ld a, [H_CURRENTPRESSEDBUTTONS] + ld a, [hJoyHeld] and $f0 ret z - ld a, $5a - call Predef ; indirect jump to Func_c60b (c60b (3:460b)) - ld a, [$d71c] + predef Func_c60b + ld a, [wd71c] and a jp nz, Func_f2dd - ld a, [H_CURRENTPRESSEDBUTTONS] + ld a, [hJoyHeld] ld b, a - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 jr z, .asm_f289 cp $8 @@ -14681,15 +3389,15 @@ MovementData_f2b3: ; f2b3 (3:72b3) db $C0,$FF Func_f2b5: ; f2b5 (3:72b5) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz callab Func_79f54 call DiscardButtonPresses - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a call Func_f2dd set 7, [hl] - ld a, [$d718] + ld a, [wd718] ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call GetSpriteMovementByte2Pointer ld [hl], $10 @@ -14702,12 +3410,12 @@ Func_f2dd: ; f2dd (3:72dd) res 6, [hl] ret -_AddPokemonToParty: ; f2e5 (3:72e5) - ld de, W_NUMINPARTY ; $d163 - ld a, [$cc49] +_AddPartyMon: ; f2e5 (3:72e5) + ld de, wPartyCount ; wPartyCount + ld a, [wcc49] and $f jr z, .asm_f2f2 - ld de, wEnemyPartyCount ; $d89c + ld de, wEnemyPartyCount ; wEnemyPartyCount .asm_f2f2 ld a, [de] inc a @@ -14721,52 +3429,51 @@ _AddPokemonToParty: ; f2e5 (3:72e5) jr nc, .asm_f300 inc d .asm_f300 - ld a, [$cf91] + ld a, [wcf91] ld [de], a inc de ld a, $ff ld [de], a - ld hl, W_PARTYMON1OT ; $d273 - ld a, [$cc49] + ld hl, wPartyMonOT ; wd273 + ld a, [wcc49] and $f jr z, .asm_f315 - ld hl, W_ENEMYMON1OT + ld hl, wEnemyMonOT .asm_f315 ld a, [$ffe4] dec a call SkipFixedLengthTextEntries ld d, h ld e, l - ld hl, W_PLAYERNAME ; $d158 + ld hl, wPlayerName ; wd158 ld bc, $b call CopyData - ld a, [$cc49] + ld a, [wcc49] and a jr nz, .asm_f33f - ld hl, W_PARTYMON1NAME ; $d2b5 + ld hl, wPartyMonNicks ; wPartyMonNicks ld a, [$ffe4] dec a call SkipFixedLengthTextEntries ld a, $2 - ld [$d07d], a - ld a, $4e - call Predef ; indirect jump to Func_64eb (64eb (1:64eb)) + ld [wd07d], a + predef AskName .asm_f33f - ld hl, W_PARTYMON1_NUM ; $d16b (aliases: W_PARTYMON1DATA) - ld a, [$cc49] + ld hl, wPartyMons + ld a, [wcc49] and $f jr z, .asm_f34c - ld hl, wEnemyMons ; $d8a4 + ld hl, wEnemyMons .asm_f34c ld a, [$ffe4] dec a - ld bc, $2c + ld bc, wPartyMon2 - wPartyMon1 call AddNTimes ld e, l ld d, h push hl - ld a, [$cf91] - ld [$d0b5], a + ld a, [wcf91] + ld [wd0b5], a call GetMonHeader ld hl, W_MONHEADER ld a, [hli] @@ -14774,42 +3481,41 @@ _AddPokemonToParty: ; f2e5 (3:72e5) inc de pop hl push hl - ld a, [$cc49] + ld a, [wcc49] and $f ld a, $98 ; set enemy trainer mon IVs to fixed average values ld b, $88 jr nz, .writeFreshMonData - ld a, [$cf91] - ld [$d11e], a + ld a, [wcf91] + ld [wd11e], a push de - ld a, $3a - call Predef ; indirect jump to IndexToPokedex (41010 (10:5010)) + predef IndexToPokedex pop de - ld a, [$d11e] + ld a, [wd11e] dec a ld c, a ld b, $2 - ld hl, wPokedexOwned ; $d2f7 - call _HandleBitArray + ld hl, wPokedexOwned ; wPokedexOwned + call FlagAction ld a, c - ld [$d153], a - ld a, [$d11e] + ld [wd153], a + ld a, [wd11e] dec a ld c, a ld b, $1 push bc - call _HandleBitArray + call FlagAction pop bc - ld hl, wPokedexSeen ; $d30a - call _HandleBitArray + ld hl, wPokedexSeen ; wd30a + call FlagAction pop hl push hl - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE and a jr nz, .copyEnemyMonData - call GenRandom ; generate random IVs + call Random ; generate random IVs ld b, a - call GenRandom + call Random .writeFreshMonData ; f3b3 push bc ld bc, $1b @@ -14839,20 +3545,20 @@ _AddPokemonToParty: ; f2e5 (3:72e5) .copyEnemyMonData ld bc, $1b add hl, bc - ld a, [W_ENEMYMONATKDEFIV] ; copy IVs from cur enemy mon + ld a, [wEnemyMonDVs] ; copy IVs from cur enemy mon ld [hli], a - ld a, [W_ENEMYMONSPDSPCIV] + ld a, [wEnemyMonDVs + 1] ld [hl], a - ld a, [W_ENEMYMONCURHP] ; copy HP from cur enemy mon + ld a, [wEnemyMonHP] ; copy HP from cur enemy mon ld [de], a inc de - ld a, [W_ENEMYMONCURHP+1] + ld a, [wEnemyMonHP+1] ld [de], a inc de xor a ld [de], a ; level (?) inc de - ld a, [W_ENEMYMONSTATUS] ; copy status ailments from cur enemy mon + ld a, [wEnemyMonStatus] ; copy status ailments from cur enemy mon ld [de], a inc de .copyMonTypesAndMoves @@ -14884,9 +3590,8 @@ _AddPokemonToParty: ; f2e5 (3:72e5) dec de dec de xor a - ld [$cee9], a - ld a, $3e - call Predef ; indirect jump to WriteMonMoves (3afb8 (e:6fb8)) + ld [wHPBarMaxHP], a + predef WriteMonMoves pop de ld a, [wPlayerID] ; set trainer ID to player ID inc de @@ -14918,15 +3623,15 @@ _AddPokemonToParty: ; f2e5 (3:72e5) inc de inc de pop hl - call AddPokemonToParty_WriteMovePP + call AddPartyMon_WriteMovePP inc de - ld a, [W_CURENEMYLVL] ; $d127 + ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL ld [de], a inc de - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE dec a jr nz, .calcFreshStats - ld hl, W_ENEMYMONMAXHP ; $cff4 + ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP ld bc, $a call CopyData ; copy stats of cur enemy mon pop hl @@ -14942,9 +3647,9 @@ _AddPokemonToParty: ; f2e5 (3:72e5) ret LoadMovePPs: ; f473 (3:7473) - call Load16BitRegisters + call GetPredefRegisters ; fallthrough -AddPokemonToParty_WriteMovePP: ; f476 (3:7476) +AddPartyMon_WriteMovePP: ; f476 (3:7476) ld b, $4 .pploop ld a, [hli] ; read move ID @@ -14957,13 +3662,13 @@ AddPokemonToParty_WriteMovePP: ; f476 (3:7476) ld hl, Moves ld bc, $6 call AddNTimes - ld de, $cd6d + ld de, wcd6d ld a, BANK(Moves) call FarCopyData pop bc pop de pop hl - ld a, [$cd72] ; sixth move byte = pp + ld a, [wcd72] ; sixth move byte = pp .empty inc de ld [de], a @@ -14971,10 +3676,10 @@ AddPokemonToParty_WriteMovePP: ; f476 (3:7476) jr nz, .pploop ; there are still moves to read ret -; adds enemy mon [$cf91] (at position [$cf92] in enemy list) to own party +; adds enemy mon [wcf91] (at position [wWhichPokemon] in enemy list) to own party ; used in the cable club trade center _AddEnemyMonToPlayerParty: ; f49d (3:749d) - ld hl, W_NUMINPARTY + ld hl, wPartyCount ld a, [hl] cp $6 scf @@ -14984,73 +3689,72 @@ _AddEnemyMonToPlayerParty: ; f49d (3:749d) ld c, a ld b, $0 add hl, bc - ld a, [$cf91] + ld a, [wcf91] ld [hli], a ; add mon as last list entry ld [hl], $ff ; write new sentinel - ld hl, W_PARTYMON1DATA - ld a, [W_NUMINPARTY] + ld hl, wPartyMons + ld a, [wPartyCount] dec a - ld bc, W_PARTYMON2DATA - W_PARTYMON1DATA + ld bc, wPartyMon2 - wPartyMon1 call AddNTimes ld e, l ld d, h - ld hl, $cf98 - call CopyData ; write new mon's data (from $cf98) - ld hl, W_PARTYMON1OT - ld a, [W_NUMINPARTY] + ld hl, wcf98 + call CopyData ; write new mon's data (from wcf98) + ld hl, wPartyMonOT + ld a, [wPartyCount] dec a call SkipFixedLengthTextEntries ld d, h ld e, l - ld hl, W_ENEMYMON1OT + ld hl, wEnemyMonOT ld a, [wWhichPokemon] call SkipFixedLengthTextEntries ld bc, $000b call CopyData ; write new mon's OT name (from an enemy mon) - ld hl, W_PARTYMON1NAME - ld a, [W_NUMINPARTY] + ld hl, wPartyMonNicks + ld a, [wPartyCount] dec a call SkipFixedLengthTextEntries ld d, h ld e, l - ld hl, W_ENEMYMON1NAME + ld hl, wEnemyMonNicks ld a, [wWhichPokemon] call SkipFixedLengthTextEntries ld bc, $000b call CopyData ; write new mon's nickname (from an enemy mon) - ld a, [$cf91] - ld [$d11e], a - ld a, $3a - call Predef - ld a, [$d11e] + ld a, [wcf91] + ld [wd11e], a + predef IndexToPokedex + ld a, [wd11e] dec a ld c, a ld b, $1 ld hl, wPokedexOwned push bc - call _HandleBitArray ; add to owned pokemon + call FlagAction ; add to owned pokemon pop bc ld hl, wPokedexSeen - call _HandleBitArray ; add to seen pokemon + call FlagAction ; add to seen pokemon and a ret ; return success Func_f51e: ; f51e (3:751e) - ld a, [$cf95] + ld a, [wcf95] and a jr z, .checkPartyMonSlots cp $2 jr z, .checkPartyMonSlots cp $3 - ld hl, W_DAYCAREMONDATA + ld hl, wDayCareMon jr z, .asm_f575 - ld hl, W_NUMINBOX ; $da80 + ld hl, W_NUMINBOX ; wda80 ld a, [hl] cp $14 jr nz, .partyOrBoxNotFull jr .boxFull .checkPartyMonSlots - ld hl, W_NUMINPARTY ; $d163 + ld hl, wPartyCount ; wPartyCount ld a, [hl] cp $6 jr nz, .partyOrBoxNotFull @@ -15063,23 +3767,23 @@ Func_f51e: ; f51e (3:751e) ld c, a ld b, $0 add hl, bc - ld a, [$cf95] + ld a, [wcf95] cp $2 - ld a, [W_DAYCAREMONDATA] + ld a, [wDayCareMon] jr z, .asm_f556 - ld a, [$cf91] + ld a, [wcf91] .asm_f556 ld [hli], a ; write new mon ID ld [hl], $ff ; write new sentinel - ld a, [$cf95] + ld a, [wcf95] dec a - ld hl, W_PARTYMON1DATA ; $d16b - ld bc, W_PARTYMON2DATA - W_PARTYMON1DATA ; $2c - ld a, [W_NUMINPARTY] ; $d163 + ld hl, wPartyMons + ld bc, wPartyMon2 - wPartyMon1 ; $2c + ld a, [wPartyCount] ; wPartyCount jr nz, .skipToNewMonEntry - ld hl, W_BOXMON1DATA - ld bc, W_BOXMON2DATA - W_BOXMON1DATA ; $21 - ld a, [W_NUMINBOX] ; $da80 + ld hl, wBoxMons + ld bc, wBoxMon2 - wBoxMon1 ; $21 + ld a, [W_NUMINBOX] ; wda80 .skipToNewMonEntry dec a call AddNTimes @@ -15087,32 +3791,32 @@ Func_f51e: ; f51e (3:751e) push hl ld e, l ld d, h - ld a, [$cf95] + ld a, [wcf95] and a - ld hl, W_BOXMON1DATA - ld bc, W_BOXMON2DATA - W_BOXMON1DATA ; $21 + ld hl, wBoxMons + ld bc, wBoxMon2 - wBoxMon1 ; $21 jr z, .asm_f591 cp $2 - ld hl, W_DAYCAREMONDATA + ld hl, wDayCareMon jr z, .asm_f597 - ld hl, W_PARTYMON1DATA ; $d16b - ld bc, W_PARTYMON2DATA - W_PARTYMON1DATA ; $2c + ld hl, wPartyMons + ld bc, wPartyMon2 - wPartyMon1 ; $2c .asm_f591 - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon call AddNTimes .asm_f597 push hl push de - ld bc, $21 + ld bc, wBoxMon2 - wBoxMon1 call CopyData pop de pop hl - ld a, [$cf95] + ld a, [wcf95] and a jr z, .asm_f5b4 cp $2 jr z, .asm_f5b4 - ld bc, $21 + ld bc, wBoxMon2 - wBoxMon1 add hl, bc ld a, [hl] inc de @@ -15120,68 +3824,68 @@ Func_f51e: ; f51e (3:751e) inc de ld [de], a .asm_f5b4 - ld a, [$cf95] + ld a, [wcf95] cp $3 ld de, W_DAYCAREMONOT jr z, .asm_f5d3 dec a - ld hl, W_PARTYMON1OT ; $d273 - ld a, [W_NUMINPARTY] ; $d163 + ld hl, wPartyMonOT ; wd273 + ld a, [wPartyCount] ; wPartyCount jr nz, .asm_f5cd - ld hl, W_BOXMON1OT - ld a, [W_NUMINBOX] ; $da80 + ld hl, wBoxMonOT + ld a, [W_NUMINBOX] ; wda80 .asm_f5cd dec a call SkipFixedLengthTextEntries ld d, h ld e, l .asm_f5d3 - ld hl, W_BOXMON1OT - ld a, [$cf95] + ld hl, wBoxMonOT + ld a, [wcf95] and a jr z, .asm_f5e6 ld hl, W_DAYCAREMONOT cp $2 jr z, .asm_f5ec - ld hl, W_PARTYMON1OT ; $d273 + ld hl, wPartyMonOT ; wd273 .asm_f5e6 - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon call SkipFixedLengthTextEntries .asm_f5ec ld bc, $b call CopyData - ld a, [$cf95] + ld a, [wcf95] cp $3 ld de, W_DAYCAREMONNAME jr z, .asm_f611 dec a - ld hl, W_PARTYMON1NAME ; $d2b5 - ld a, [W_NUMINPARTY] ; $d163 + ld hl, wPartyMonNicks ; wPartyMonNicks + ld a, [wPartyCount] ; wPartyCount jr nz, .asm_f60b - ld hl, W_BOXMON1NAME - ld a, [W_NUMINBOX] ; $da80 + ld hl, wBoxMonNicks + ld a, [W_NUMINBOX] ; wda80 .asm_f60b dec a call SkipFixedLengthTextEntries ld d, h ld e, l .asm_f611 - ld hl, W_BOXMON1NAME - ld a, [$cf95] + ld hl, wBoxMonNicks + ld a, [wcf95] and a jr z, .asm_f624 ld hl, W_DAYCAREMONNAME cp $2 jr z, .asm_f62a - ld hl, W_PARTYMON1NAME ; $d2b5 + ld hl, wPartyMonNicks ; wPartyMonNicks .asm_f624 - ld a, [wWhichPokemon] ; $cf92 + ld a, [wWhichPokemon] ; wWhichPokemon call SkipFixedLengthTextEntries .asm_f62a ld bc, $b call CopyData pop hl - ld a, [$cf95] + ld a, [wcf95] cp $1 jr z, .asm_f664 cp $3 @@ -15189,11 +3893,11 @@ Func_f51e: ; f51e (3:751e) push hl srl a add $2 - ld [$cc49], a + ld [wcc49], a call LoadMonData callba Func_58f43 ld a, d - ld [W_CURENEMYLVL], a ; $d127 + ld [W_CURENEMYLVL], a ; W_CURENEMYLVL pop hl ld bc, $21 add hl, bc @@ -15208,59 +3912,71 @@ Func_f51e: ; f51e (3:751e) and a ret -; predef $10 -; executes operations on a field of bits -; b = 0 -> reset bit -; b = 1 -> set bit -; b = 2 -> read bit (into c and z-flag) -; hl: base address -; c: bit index -HandleBitArray: ; f666 (3:7666) - call Load16BitRegisters - -_HandleBitArray: ; f669 (3:7669) + +FlagActionPredef: + call GetPredefRegisters + +FlagAction: +; Perform action b on bit c +; in the bitfield at hl. +; 0: reset +; 1: set +; 2: read +; Return the result in c. + push hl push de push bc + + ; bit ld a, c ld d, a - and $7 - ld e, a ; store bit offset in e + and 7 + ld e, a + + ; byte ld a, d srl a srl a - srl a ; calc byte offset + srl a add l ld l, a - jr nc, .noCarry + jr nc, .ok inc h -.noCarry +.ok + + ; d = 1 << e (bitmask) inc e - ld d, $1 -.shiftLeftLoop ; d = 1 << e, bitmask for the used bit + ld d, 1 +.shift dec e - jr z, .operationSelect + jr z, .shifted sla d - jr .shiftLeftLoop -.operationSelect + jr .shift +.shifted + ld a, b and a - jr z, .resetBit - cp $2 - jr z, .readBit - ld b, [hl] ; set bit + jr z, .reset + cp 2 + jr z, .read + +.set + ld b, [hl] ld a, d or b ld [hl], a jr .done -.resetBit + +.reset ld b, [hl] ld a, d xor $ff and b ld [hl], a jr .done -.readBit + +.read ld b, [hl] ld a, d and b @@ -15271,43 +3987,55 @@ _HandleBitArray: ; f669 (3:7669) ld c, a ret -HealParty: ; f6a5 (3:76a5) - ld hl, W_PARTYMON1 - ld de, W_PARTYMON1_HP -.HealPokemon: ; f6ab (3:76ab) + +HealParty: +; Restore HP and PP. + + ld hl, wPartySpecies + ld de, wPartyMon1HP +.healmon ld a, [hli] cp $ff - jr z, .DoneHealing ; End if there's no Pokémon + jr z, .done + push hl push de - ld hl, $0003 ; Status offset + + ld hl, wPartyMon1Status - wPartyMon1HP add hl, de xor a - ld [hl], a ; Clean status conditions + ld [hl], a + push de - ld b, $4 ; A Pokémon has 4 moves -.RestorePP: ; f6bb (3:76bb) - ld hl, $0007 ; Move offset + ld b, NUM_MOVES ; A Pokémon has 4 moves +.pp + ld hl, wPartyMon1Moves - wPartyMon1HP add hl, de + ld a, [hl] and a - jr z, .HealNext ; Skip if there's no move here + jr z, .nextmove + dec a - ld hl, $001c ; PP offset + ld hl, wPartyMon1PP - wPartyMon1HP add hl, de + push hl push de push bc + ld hl, Moves ld bc, $0006 call AddNTimes - ld de, $cd6d + ld de, wcd6d ld a, BANK(Moves) - call FarCopyData ; copy move header to memory - ld a, [$cd72] ; get default PP + call FarCopyData + ld a, [wcd72] ; default pp + pop bc pop de pop hl + inc de push bc ld b, a @@ -15316,50 +4044,58 @@ HealParty: ; f6a5 (3:76a5) add b ld [hl], a pop bc -.HealNext: ; f6eb (3:76eb) + +.nextmove dec b - jr nz, .RestorePP ; Continue if there's still moves + jr nz, .pp pop de - ld hl, $0021 ; Max HP offset + + ld hl, wPartyMon1MaxHP - wPartyMon1HP add hl, de ld a, [hli] ld [de], a inc de ld a, [hl] - ld [de], a ; Restore full HP + ld [de], a + pop de pop hl + push hl - ld bc, $002c + ld bc, wPartyMon2 - wPartyMon1 ld h, d ld l, e add hl, bc ld d, h ld e, l pop hl - jr .HealPokemon ; Next Pokémon -.DoneHealing + jr .healmon + +.done xor a ld [wWhichPokemon], a - ld [$d11e], a - ld a, [W_NUMINPARTY] + ld [wd11e], a + + ld a, [wPartyCount] ld b, a -.restoreBonusPPLoop ; loop to restore bonus PP from PP Ups +.ppup push bc call RestoreBonusPP pop bc ld hl, wWhichPokemon inc [hl] dec b - jr nz,.restoreBonusPPLoop + jr nz, .ppup ret -; predef $9 -; predef $a -; predef $d -; predef $e -Func_f71e: ; f71e (3:771e) - call Load16BitRegisters + +DivideBCDPredef:: +DivideBCDPredef2:: +DivideBCDPredef3:: +DivideBCDPredef4:: + call GetPredefRegisters + +DivideBCD:: xor a ld [$ffa5], a ld [$ffa6], a @@ -15507,15 +4243,18 @@ Func_f800: ; f800 (3:7800) ld de, $ffa1 ld hl, $ffa4 push bc - call Func_f839 + call SubBCD pop bc jr .asm_f803 -Func_f81d: ; f81d (3:781d) - call Load16BitRegisters + +AddBCDPredef:: + call GetPredefRegisters + +AddBCD:: and a ld b, c -.asm_f822 +.add ld a, [de] adc [hl] daa @@ -15523,25 +4262,26 @@ Func_f81d: ; f81d (3:781d) dec de dec hl dec c - jr nz, .asm_f822 - jr nc, .asm_f835 + jr nz, .add + jr nc, .done ld a, $99 inc de -.asm_f830 +.fill ld [de], a inc de dec b - jr nz, .asm_f830 -.asm_f835 + jr nz, .fill +.done ret -Func_f836: ; f836 (3:7836) - call Load16BitRegisters -Func_f839: ; f839 (3:7839) +SubBCDPredef:: + call GetPredefRegisters + +SubBCD:: and a ld b, c -.asm_f83b +.sub ld a, [de] sbc [hl] daa @@ -15549,66 +4289,80 @@ Func_f839: ; f839 (3:7839) dec de dec hl dec c - jr nz, .asm_f83b - jr nc, .asm_f84f - ld a, $0 + jr nz, .sub + jr nc, .done + ld a, $00 inc de -.asm_f849 +.fill ld [de], a inc de dec b - jr nz, .asm_f849 + jr nz, .fill scf -.asm_f84f +.done ret -InitializePlayerData: ; f850 (3:7850) - call GenRandom - ld a, [H_RAND2] - ld [wPlayerID], a ; set player trainer id - call GenRandom - ld a, [H_RAND1] + +InitPlayerData: +InitPlayerData2: + + call Random + ld a, [hRandomSub] + ld [wPlayerID], a + + call Random + ld a, [hRandomAdd] ld [wPlayerID + 1], a + ld a, $ff - ld [$d71b], a ; XXX what's this? - ld hl, W_NUMINPARTY ; $d163 - call InitializeEmptyList ; no party mons - ld hl, W_NUMINBOX ; $da80 - call InitializeEmptyList ; no boxed mons - ld hl, wNumBagItems ; $d31d - call InitializeEmptyList ; no items - ld hl, wNumBoxItems ; $d53a - call InitializeEmptyList ; no boxed items - ld hl, wPlayerMoney + 1 ; $d348 - ld a, $30 - ld [hld], a ; set money to 00 30 00 (3000) + ld [wd71b], a ; XXX what's this? + + ld hl, wPartyCount + call InitializeEmptyList + ld hl, W_NUMINBOX + call InitializeEmptyList + ld hl, wNumBagItems + call InitializeEmptyList + ld hl, wNumBoxItems + call InitializeEmptyList + +START_MONEY EQU $3000 + ld hl, wPlayerMoney + 1 + ld a, START_MONEY / $100 + ld [hld], a xor a ld [hli], a inc hl ld [hl], a - ld [$cc49], a ; XXX what's this? + + ld [wcc49], a + ld hl, W_OBTAINEDBADGES - ld [hli], a ; no badges obtained - ld [hl], a ; XXX what's this? - ld hl, wPlayerCoins ; $d5a4 - ld [hli], a ; no coins + ld [hli], a + + ld [hl], a + + ld hl, wPlayerCoins + ld [hli], a ld [hl], a - ld hl, W_GAMEPROGRESSFLAGS ; $d5f0 + + ld hl, W_GAMEPROGRESSFLAGS ld bc, $c8 - call FillMemory ; clear all game progress flags + call FillMemory ; clear all game progress flags + jp InitializeMissableObjectsFlags -; writes two bytes $00 $ff to hl -InitializeEmptyList: ; f8a0 (3:78a0) - xor a +InitializeEmptyList: + xor a ; count ld [hli], a - dec a + dec a ; terminator ld [hl], a ret + IsItemInBag_: ; f8a5 (3:78a5) - call Load16BitRegisters - ld hl, wNumBagItems ; $d31d + call GetPredefRegisters + ld hl, wNumBagItems ; wNumBagItems .asm_f8ab inc hl ld a, [hli] @@ -15630,7 +4384,7 @@ Func_f8ba: ; f8ba (3:78ba) ld [hli], a ld [hli], a ld [hl], a - ld hl, $cc97 + ld hl, wcc97 ld de, $0 Func_f8c8: ; f8c8 (3:78c8) @@ -15700,9 +4454,9 @@ Func_f8c8: ; f8c8 (3:78c8) Func_f929: ; f929 (3:7929) xor a ld [$ff9d], a - ld a, [$c104] + ld a, [wSpriteStateData1 + 4] ld d, a - ld a, [$c106] + ld a, [wSpriteStateData1 + 6] ld e, a ld hl, wSpriteStateData1 ld a, [H_DIVIDEND] ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT) @@ -15774,10 +4528,10 @@ Func_f929: ; f929 (3:7929) Func_f9a0: ; f9a0 (3:79a0) ld a, [$ff95] - ld [$cd37], a + ld [wcd37], a dec a - ld de, $ccd3 - ld hl, $cc97 + ld de, wccd3 + ld hl, wcc97 add l ld l, a jr nc, .asm_f9b1 @@ -15821,393 +4575,235 @@ INCLUDE "engine/hp_bar.asm" INCLUDE "engine/hidden_object_functions3.asm" -SECTION "bank4",ROMX,BANK[$4] - -OakAideSprite: ; 10000 (4:4000) - INCBIN "gfx/sprites/oak_aide.2bpp" -RockerSprite: ; 10180 (4:4180) - INCBIN "gfx/sprites/rocker.2bpp" -SwimmerSprite: ; 10300 (4:4300) - INCBIN "gfx/sprites/swimmer.2bpp" -WhitePlayerSprite: ; 10480 (4:4480) - INCBIN "gfx/sprites/white_player.2bpp" -GymHelperSprite: ; 10540 (4:4540) - INCBIN "gfx/sprites/gym_helper.2bpp" -OldPersonSprite: ; 10600 (4:4600) - INCBIN "gfx/sprites/old_person.2bpp" -MartGuySprite: ; 106c0 (4:46c0) - INCBIN "gfx/sprites/mart_guy.2bpp" -FisherSprite: ; 10780 (4:4780) - INCBIN "gfx/sprites/fisher.2bpp" -OldMediumWomanSprite: ; 10840 (4:4840) - INCBIN "gfx/sprites/old_medium_woman.2bpp" -NurseSprite: ; 10900 (4:4900) - INCBIN "gfx/sprites/nurse.2bpp" -CableClubWomanSprite: ; 109c0 (4:49c0) - INCBIN "gfx/sprites/cable_club_woman.2bpp" -MrMasterballSprite: ; 10a80 (4:4a80) - INCBIN "gfx/sprites/mr_masterball.2bpp" -LaprasGiverSprite: ; 10b40 (4:4b40) - INCBIN "gfx/sprites/lapras_giver.2bpp" -WardenSprite: ; 10c00 (4:4c00) - INCBIN "gfx/sprites/warden.2bpp" -SsCaptainSprite: ; 10cc0 (4:4cc0) - INCBIN "gfx/sprites/ss_captain.2bpp" -Fisher2Sprite: ; 10d80 (4:4d80) - INCBIN "gfx/sprites/fisher2.2bpp" -BlackbeltSprite: ; 10f00 (4:4f00) - INCBIN "gfx/sprites/blackbelt.2bpp" -GuardSprite: ; 11080 (4:5080) - INCBIN "gfx/sprites/guard.2bpp" -BallSprite: ; 11140 (4:5140) - INCBIN "gfx/sprites/ball.2bpp" -OmanyteSprite: ; 11180 (4:5180) - INCBIN "gfx/sprites/omanyte.2bpp" -BoulderSprite: ; 111c0 (4:51c0) - INCBIN "gfx/sprites/boulder.2bpp" -PaperSheetSprite: ; 11200 (4:5200) - INCBIN "gfx/sprites/paper_sheet.2bpp" -BookMapDexSprite: ; 11240 (4:5240) - INCBIN "gfx/sprites/book_map_dex.2bpp" -ClipboardSprite: ; 11280 (4:5280) - INCBIN "gfx/sprites/clipboard.2bpp" -SnorlaxSprite: ; 112c0 (4:52c0) - INCBIN "gfx/sprites/snorlax.2bpp" -OldAmberSprite: ; 11300 (4:5300) - INCBIN "gfx/sprites/old_amber.2bpp" -LyingOldManSprite: ; 11340 (4:5340) - INCBIN "gfx/sprites/lying_old_man.2bpp" - -PokemonLogoGraphics: ; 11380 (4:5380) - INCBIN "gfx/pokemon_logo.w128.2bpp" - -FontGraphics: ; 11a80 (4:5a80) - INCBIN "gfx/font.w128.1bpp" - -ABTiles: ; 11e80 (4:5e80) - INCBIN "gfx/AB.2bpp" - -HpBarAndStatusGraphics: ; 11ea0 (4:5ea0) - INCBIN "gfx/hp_bar_and_status.2bpp" - -BattleHudTiles1: ; 12080 (4:6080) - INCBIN "gfx/battle_hud1.1bpp" - -BattleHudTiles2: ; 12098 (4:6098) - INCBIN "gfx/battle_hud2.1bpp" - -BattleHudTiles3: ; 120b0 (4:60b0) - INCBIN "gfx/battle_hud3.1bpp" - -NintendoCopyrightLogoGraphics: ; 120c8 (4:60c8) - INCBIN "gfx/copyright.h8.2bpp" - -GamefreakLogoGraphics: ; 121f8 (4:61f8) - INCBIN "gfx/gamefreak.h8.2bpp" - -TextBoxGraphics: ; 12288 (4:6288) - INCBIN "gfx/text_box.2bpp" - -PokedexTileGraphics: ; 12488 (4:6488) - INCBIN "gfx/pokedex.2bpp" - -WorldMapTileGraphics: ; 125a8 (4:65a8) - INCBIN "gfx/town_map.2bpp" - -PlayerCharacterTitleGraphics: ; 126a8 (4:66a8) - INCBIN "gfx/player_title.2bpp" -INCLUDE "engine/battle/4.asm" +SECTION "NPC Sprites 1", ROMX, BANK[NPC_SPRITES_1] + +OakAideSprite: INCBIN "gfx/sprites/oak_aide.2bpp" +RockerSprite: INCBIN "gfx/sprites/rocker.2bpp" +SwimmerSprite: INCBIN "gfx/sprites/swimmer.2bpp" +WhitePlayerSprite: INCBIN "gfx/sprites/white_player.2bpp" +GymHelperSprite: INCBIN "gfx/sprites/gym_helper.2bpp" +OldPersonSprite: INCBIN "gfx/sprites/old_person.2bpp" +MartGuySprite: INCBIN "gfx/sprites/mart_guy.2bpp" +FisherSprite: INCBIN "gfx/sprites/fisher.2bpp" +OldMediumWomanSprite: INCBIN "gfx/sprites/old_medium_woman.2bpp" +NurseSprite: INCBIN "gfx/sprites/nurse.2bpp" +CableClubWomanSprite: INCBIN "gfx/sprites/cable_club_woman.2bpp" +MrMasterballSprite: INCBIN "gfx/sprites/mr_masterball.2bpp" +LaprasGiverSprite: INCBIN "gfx/sprites/lapras_giver.2bpp" +WardenSprite: INCBIN "gfx/sprites/warden.2bpp" +SsCaptainSprite: INCBIN "gfx/sprites/ss_captain.2bpp" +Fisher2Sprite: INCBIN "gfx/sprites/fisher2.2bpp" +BlackbeltSprite: INCBIN "gfx/sprites/blackbelt.2bpp" +GuardSprite: INCBIN "gfx/sprites/guard.2bpp" +BallSprite: INCBIN "gfx/sprites/ball.2bpp" +OmanyteSprite: INCBIN "gfx/sprites/omanyte.2bpp" +BoulderSprite: INCBIN "gfx/sprites/boulder.2bpp" +PaperSheetSprite: INCBIN "gfx/sprites/paper_sheet.2bpp" +BookMapDexSprite: INCBIN "gfx/sprites/book_map_dex.2bpp" +ClipboardSprite: INCBIN "gfx/sprites/clipboard.2bpp" +SnorlaxSprite: INCBIN "gfx/sprites/snorlax.2bpp" +OldAmberSprite: INCBIN "gfx/sprites/old_amber.2bpp" +LyingOldManSprite: INCBIN "gfx/sprites/lying_old_man.2bpp" + + +SECTION "Graphics", ROMX, BANK[GFX] + +PokemonLogoGraphics: INCBIN "gfx/pokemon_logo.2bpp" +FontGraphics: INCBIN "gfx/font.1bpp" +ABTiles: INCBIN "gfx/AB.2bpp" +HpBarAndStatusGraphics: INCBIN "gfx/hp_bar_and_status.2bpp" +BattleHudTiles1: INCBIN "gfx/battle_hud1.1bpp" +BattleHudTiles2: INCBIN "gfx/battle_hud2.1bpp" +BattleHudTiles3: INCBIN "gfx/battle_hud3.1bpp" +NintendoCopyrightLogoGraphics: INCBIN "gfx/copyright.2bpp" +GamefreakLogoGraphics: INCBIN "gfx/gamefreak.2bpp" +TextBoxGraphics: INCBIN "gfx/text_box.2bpp" +PokedexTileGraphics: INCBIN "gfx/pokedex.2bpp" +WorldMapTileGraphics: INCBIN "gfx/town_map.2bpp" +PlayerCharacterTitleGraphics: INCBIN "gfx/player_title.2bpp" + + +SECTION "Battle (bank 4)", ROMX, BANK[$4] +INCLUDE "engine/battle/4.asm" INCLUDE "engine/menu/status_screen.asm" - INCLUDE "engine/menu/party_menu.asm" -RedPicFront: ; 12ede (4:6ede) - INCBIN "pic/trainer/red.pic" -ShrinkPic1: ; 12fe8 (4:6fe8) - INCBIN "pic/trainer/shrink1.pic" -ShrinkPic2: ; 13042 (4:7042) - INCBIN "pic/trainer/shrink2.pic" +RedPicFront:: INCBIN "pic/trainer/red.pic" +ShrinkPic1:: INCBIN "pic/trainer/shrink1.pic" +ShrinkPic2:: INCBIN "pic/trainer/shrink2.pic" INCLUDE "engine/turn_sprite.asm" - INCLUDE "engine/menu/start_sub_menus.asm" - INCLUDE "engine/items/tms.asm" - INCLUDE "engine/battle/4_2.asm" - -INCLUDE "engine/rng.asm" - -SECTION "bank5",ROMX,BANK[$5] - -RedCyclingSprite: ; 14000 (5:4000) - INCBIN "gfx/sprites/cycling.2bpp" -RedSprite: ; 14180 (5:4180) - INCBIN "gfx/sprites/red.2bpp" -BlueSprite: ; 14300 (5:4300) - INCBIN "gfx/sprites/blue.2bpp" -OakSprite: ; 14480 (5:4480) - INCBIN "gfx/sprites/oak.2bpp" -BugCatcherSprite: ; 14600 (5:4600) - INCBIN "gfx/sprites/bug_catcher.2bpp" -SlowbroSprite: ; 14780 (5:4780) - INCBIN "gfx/sprites/slowbro.2bpp" -LassSprite: ; 14900 (5:4900) - INCBIN "gfx/sprites/lass.2bpp" -BlackHairBoy1Sprite: ; 14a80 (5:4a80) - INCBIN "gfx/sprites/black_hair_boy_1.2bpp" -LittleGirlSprite: ; 14c00 (5:4c00) - INCBIN "gfx/sprites/little_girl.2bpp" -BirdSprite: ; 14d80 (5:4d80) - INCBIN "gfx/sprites/bird.2bpp" -FatBaldGuySprite: ; 14f00 (5:4f00) - INCBIN "gfx/sprites/fat_bald_guy.2bpp" -GamblerSprite: ; 15080 (5:5080) - INCBIN "gfx/sprites/gambler.2bpp" -BlackHairBoy2Sprite: ; 15200 (5:5200) - INCBIN "gfx/sprites/black_hair_boy_2.2bpp" -GirlSprite: ; 15380 (5:5380) - INCBIN "gfx/sprites/girl.2bpp" -HikerSprite: ; 15500 (5:5500) - INCBIN "gfx/sprites/hiker.2bpp" -FoulardWomanSprite: ; 15680 (5:5680) - INCBIN "gfx/sprites/foulard_woman.2bpp" -GentlemanSprite: ; 15800 (5:5800) - INCBIN "gfx/sprites/gentleman.2bpp" -DaisySprite: ; 15980 (5:5980) - INCBIN "gfx/sprites/daisy.2bpp" -BikerSprite: ; 15b00 (5:5b00) - INCBIN "gfx/sprites/biker.2bpp" -SailorSprite: ; 15c80 (5:5c80) - INCBIN "gfx/sprites/sailor.2bpp" -CookSprite: ; 15e00 (5:5e00) - INCBIN "gfx/sprites/cook.2bpp" -BikeShopGuySprite: ; 15f80 (5:5f80) - INCBIN "gfx/sprites/bike_shop_guy.2bpp" -MrFujiSprite: ; 16040 (5:6040) - INCBIN "gfx/sprites/mr_fuji.2bpp" -GiovanniSprite: ; 161c0 (5:61c0) - INCBIN "gfx/sprites/giovanni.2bpp" -RocketSprite: ; 16340 (5:6340) - INCBIN "gfx/sprites/rocket.2bpp" -MediumSprite: ; 164c0 (5:64c0) - INCBIN "gfx/sprites/medium.2bpp" -WaiterSprite: ; 16640 (5:6640) - INCBIN "gfx/sprites/waiter.2bpp" -ErikaSprite: ; 167c0 (5:67c0) - INCBIN "gfx/sprites/erika.2bpp" -MomGeishaSprite: ; 16940 (5:6940) - INCBIN "gfx/sprites/mom_geisha.2bpp" -BrunetteGirlSprite: ; 16ac0 (5:6ac0) - INCBIN "gfx/sprites/brunette_girl.2bpp" -LanceSprite: ; 16c40 (5:6c40) - INCBIN "gfx/sprites/lance.2bpp" -MomSprite: ; 16dc0 (5:6dc0) - INCBIN "gfx/sprites/mom.2bpp" -BaldingGuySprite: ; 16e80 (5:6e80) - INCBIN "gfx/sprites/balding_guy.2bpp" -YoungBoySprite: ; 16f40 (5:6f40) - INCBIN "gfx/sprites/young_boy.2bpp" -GameboyKidSprite: ; 17000 (5:7000) - INCBIN "gfx/sprites/gameboy_kid.2bpp" -ClefairySprite: ; 170c0 (5:70c0) - INCBIN "gfx/sprites/clefairy.2bpp" -AgathaSprite: ; 17240 (5:7240) - INCBIN "gfx/sprites/agatha.2bpp" -BrunoSprite: ; 173c0 (5:73c0) - INCBIN "gfx/sprites/bruno.2bpp" -LoreleiSprite: ; 17540 (5:7540) - INCBIN "gfx/sprites/lorelei.2bpp" -SeelSprite: ; 176c0 (5:76c0) - INCBIN "gfx/sprites/seel.2bpp" +INCLUDE "engine/random.asm" + + +SECTION "NPC Sprites 2", ROMX, BANK[NPC_SPRITES_2] + +RedCyclingSprite: INCBIN "gfx/sprites/cycling.2bpp" +RedSprite: INCBIN "gfx/sprites/red.2bpp" +BlueSprite: INCBIN "gfx/sprites/blue.2bpp" +OakSprite: INCBIN "gfx/sprites/oak.2bpp" +BugCatcherSprite: INCBIN "gfx/sprites/bug_catcher.2bpp" +SlowbroSprite: INCBIN "gfx/sprites/slowbro.2bpp" +LassSprite: INCBIN "gfx/sprites/lass.2bpp" +BlackHairBoy1Sprite: INCBIN "gfx/sprites/black_hair_boy_1.2bpp" +LittleGirlSprite: INCBIN "gfx/sprites/little_girl.2bpp" +BirdSprite: INCBIN "gfx/sprites/bird.2bpp" +FatBaldGuySprite: INCBIN "gfx/sprites/fat_bald_guy.2bpp" +GamblerSprite: INCBIN "gfx/sprites/gambler.2bpp" +BlackHairBoy2Sprite: INCBIN "gfx/sprites/black_hair_boy_2.2bpp" +GirlSprite: INCBIN "gfx/sprites/girl.2bpp" +HikerSprite: INCBIN "gfx/sprites/hiker.2bpp" +FoulardWomanSprite: INCBIN "gfx/sprites/foulard_woman.2bpp" +GentlemanSprite: INCBIN "gfx/sprites/gentleman.2bpp" +DaisySprite: INCBIN "gfx/sprites/daisy.2bpp" +BikerSprite: INCBIN "gfx/sprites/biker.2bpp" +SailorSprite: INCBIN "gfx/sprites/sailor.2bpp" +CookSprite: INCBIN "gfx/sprites/cook.2bpp" +BikeShopGuySprite: INCBIN "gfx/sprites/bike_shop_guy.2bpp" +MrFujiSprite: INCBIN "gfx/sprites/mr_fuji.2bpp" +GiovanniSprite: INCBIN "gfx/sprites/giovanni.2bpp" +RocketSprite: INCBIN "gfx/sprites/rocket.2bpp" +MediumSprite: INCBIN "gfx/sprites/medium.2bpp" +WaiterSprite: INCBIN "gfx/sprites/waiter.2bpp" +ErikaSprite: INCBIN "gfx/sprites/erika.2bpp" +MomGeishaSprite: INCBIN "gfx/sprites/mom_geisha.2bpp" +BrunetteGirlSprite: INCBIN "gfx/sprites/brunette_girl.2bpp" +LanceSprite: INCBIN "gfx/sprites/lance.2bpp" +MomSprite: INCBIN "gfx/sprites/mom.2bpp" +BaldingGuySprite: INCBIN "gfx/sprites/balding_guy.2bpp" +YoungBoySprite: INCBIN "gfx/sprites/young_boy.2bpp" +GameboyKidSprite: INCBIN "gfx/sprites/gameboy_kid.2bpp" +ClefairySprite: INCBIN "gfx/sprites/clefairy.2bpp" +AgathaSprite: INCBIN "gfx/sprites/agatha.2bpp" +BrunoSprite: INCBIN "gfx/sprites/bruno.2bpp" +LoreleiSprite: INCBIN "gfx/sprites/lorelei.2bpp" +SeelSprite: INCBIN "gfx/sprites/seel.2bpp" + + +SECTION "Battle (bank 5)", ROMX, BANK[$5] INCLUDE "engine/load_pokedex_tiles.asm" - INCLUDE "engine/overworld/map_sprites.asm" - INCLUDE "engine/overworld/emotion_bubbles.asm" - INCLUDE "engine/evolve_trade.asm" - INCLUDE "engine/battle/5.asm" - INCLUDE "engine/menu/pc.asm" + SECTION "bank6",ROMX,BANK[$6] INCLUDE "data/mapHeaders/celadoncity.asm" - INCLUDE "data/mapObjects/celadoncity.asm" - -CeladonCityBlocks: ; 180df (6:40df) - INCBIN "maps/celadoncity.blk" +CeladonCityBlocks: INCBIN "maps/celadoncity.blk" INCLUDE "data/mapHeaders/pallettown.asm" - INCLUDE "data/mapObjects/pallettown.asm" - -PalletTownBlocks: ; 182fd (6:42fd) - INCBIN "maps/pallettown.blk" +PalletTownBlocks: INCBIN "maps/pallettown.blk" INCLUDE "data/mapHeaders/viridiancity.asm" - INCLUDE "data/mapObjects/viridiancity.asm" - -ViridianCityBlocks: ; 183ec (6:43ec) - INCBIN "maps/viridiancity.blk" +ViridianCityBlocks: INCBIN "maps/viridiancity.blk" INCLUDE "data/mapHeaders/pewtercity.asm" - INCLUDE "data/mapObjects/pewtercity.asm" - -PewterCityBlocks: ; 185e6 (6:45e6) - INCBIN "maps/pewtercity.blk" +PewterCityBlocks: INCBIN "maps/pewtercity.blk" INCLUDE "data/mapHeaders/ceruleancity.asm" - INCLUDE "data/mapObjects/ceruleancity.asm" - -CeruleanCityBlocks: ; 18830 (6:4830) - INCBIN "maps/ceruleancity.blk" +CeruleanCityBlocks: INCBIN "maps/ceruleancity.blk" INCLUDE "data/mapHeaders/vermilioncity.asm" - INCLUDE "data/mapObjects/vermilioncity.asm" - -VermilionCityBlocks: ; 18a3f (6:4a3f) - INCBIN "maps/vermilioncity.blk" +VermilionCityBlocks: INCBIN "maps/vermilioncity.blk" INCLUDE "data/mapHeaders/fuchsiacity.asm" - INCLUDE "data/mapObjects/fuchsiacity.asm" - -FuchsiaCityBlocks: ; 18c86 (6:4c86) - INCBIN "maps/fuchsiacity.blk" +FuchsiaCityBlocks: INCBIN "maps/fuchsiacity.blk" INCLUDE "engine/play_time.asm" INCLUDE "scripts/pallettown.asm" - INCLUDE "scripts/viridiancity.asm" - INCLUDE "scripts/pewtercity.asm" - INCLUDE "scripts/ceruleancity.asm" - INCLUDE "scripts/vermilioncity.asm" - INCLUDE "scripts/celadoncity.asm" - INCLUDE "scripts/fuchsiacity.asm" INCLUDE "data/mapHeaders/blueshouse.asm" - INCLUDE "scripts/blueshouse.asm" - INCLUDE "data/mapObjects/blueshouse.asm" - -BluesHouseBlocks: ; 19bf6 (6:5bf6) - INCBIN "maps/blueshouse.blk" +BluesHouseBlocks: INCBIN "maps/blueshouse.blk" INCLUDE "data/mapHeaders/vermilionhouse3.asm" - INCLUDE "scripts/vermilionhouse3.asm" - INCLUDE "data/mapObjects/vermilionhouse3.asm" - -VermilionHouse3Blocks: ; 19c3f (6:5c3f) - INCBIN "maps/vermilionhouse3.blk" +VermilionHouse3Blocks: INCBIN "maps/vermilionhouse3.blk" INCLUDE "data/mapHeaders/indigoplateaulobby.asm" - INCLUDE "scripts/indigoplateaulobby.asm" - INCLUDE "data/mapObjects/indigoplateaulobby.asm" - -IndigoPlateauLobbyBlocks: ; 19ccf (6:5ccf) - INCBIN "maps/indigoplateaulobby.blk" +IndigoPlateauLobbyBlocks: INCBIN "maps/indigoplateaulobby.blk" INCLUDE "data/mapHeaders/silphco4.asm" - INCLUDE "scripts/silphco4.asm" - INCLUDE "data/mapObjects/silphco4.asm" - -SilphCo4Blocks: ; 19ea4 (6:5ea4) - INCBIN "maps/silphco4.blk" +SilphCo4Blocks: INCBIN "maps/silphco4.blk" INCLUDE "data/mapHeaders/silphco5.asm" - INCLUDE "scripts/silphco5.asm" - INCLUDE "data/mapObjects/silphco5.asm" - -SilphCo5Blocks: ; 1a116 (6:6116) - INCBIN "maps/silphco5.blk" +SilphCo5Blocks: INCBIN "maps/silphco5.blk" INCLUDE "data/mapHeaders/silphco6.asm" - INCLUDE "scripts/silphco6.asm" - INCLUDE "data/mapObjects/silphco6.asm" - -SilphCo6Blocks: ; 1a36b (6:636b) - INCBIN "maps/silphco6.blk" +SilphCo6Blocks: INCBIN "maps/silphco6.blk" INCLUDE "engine/overworld/npc_movement.asm" - INCLUDE "engine/overworld/doors.asm" - INCLUDE "engine/overworld/ledges.asm" + SECTION "bank7",ROMX,BANK[$7] INCLUDE "data/mapHeaders/cinnabarisland.asm" - INCLUDE "data/mapObjects/cinnabarisland.asm" - -CinnabarIslandBlocks: ; 1c069 (7:4069) - INCBIN "maps/cinnabarisland.blk" +CinnabarIslandBlocks: INCBIN "maps/cinnabarisland.blk" INCLUDE "data/mapHeaders/route1.asm" - INCLUDE "data/mapObjects/route1.asm" +Route1Blocks: INCBIN "maps/route1.blk" -Route1Blocks: ; 1c0fc (7:40fc) - INCBIN "maps/route1.blk" +UndergroundPathEntranceRoute8Blocks: INCBIN "maps/undergroundpathentranceroute8.blk" -UndergroundPathEntranceRoute8Blocks: ; 1c1b0 (7:41b0) - INCBIN "maps/undergroundpathentranceroute8.blk" +OaksLabBlocks: INCBIN "maps/oakslab.blk" -OaksLabBlocks: ; 1c1c0 (7:41c0) - INCBIN "maps/oakslab.blk" +Route16HouseBlocks: +Route2HouseBlocks: +SaffronHouse1Blocks: +SaffronHouse2Blocks: +VermilionHouse1Blocks: +NameRaterBlocks: +LavenderHouse1Blocks: +LavenderHouse2Blocks: +CeruleanHouse1Blocks: +PewterHouse1Blocks: +PewterHouse2Blocks: +ViridianHouseBlocks: INCBIN "maps/viridianhouse.blk" -Route16HouseBlocks: ; 1c1de (7:41de) -Route2HouseBlocks: ; 1c1de (7:41de) -SaffronHouse1Blocks: ; 1c1de (7:41de) -SaffronHouse2Blocks: ; 1c1de (7:41de) -VermilionHouse1Blocks: ; 1c1de (7:41de) -NameRaterBlocks: ; 1c1de (7:41de) -LavenderHouse1Blocks: ; 1c1de (7:41de) -LavenderHouse2Blocks: ; 1c1de (7:41de) -CeruleanHouse1Blocks: ; 1c1de (7:41de) -PewterHouse1Blocks: ; 1c1de (7:41de) -PewterHouse2Blocks: ; 1c1de (7:41de) -ViridianHouseBlocks: ; 0x1c1de 41DE size=16 - INCBIN "maps/viridianhouse.blk" +CeladonMansion5Blocks: +SchoolBlocks: INCBIN "maps/school.blk" -CeladonMansion5Blocks: ; 1c1ee (7:41ee) -SchoolBlocks: ; 0x1c1ee 41EE size=16 - INCBIN "maps/school.blk" +CeruleanHouseTrashedBlocks: INCBIN "maps/ceruleanhousetrashed.blk" -CeruleanHouseTrashedBlocks: ; 0x1c1fe size=16 - INCBIN "maps/ceruleanhousetrashed.blk" - -DiglettsCaveEntranceRoute11Blocks: ; 1c20e (7:420e) -DiglettsCaveRoute2Blocks: ; 0x1c20e size=16 - INCBIN "maps/diglettscaveroute2.blk" +DiglettsCaveEntranceRoute11Blocks: +DiglettsCaveRoute2Blocks: INCBIN "maps/diglettscaveroute2.blk" INCLUDE "text/monster_names.asm" @@ -16220,1691 +4816,992 @@ INCLUDE "scripts/cinnabarisland.asm" INCLUDE "scripts/route1.asm" INCLUDE "data/mapHeaders/oakslab.asm" - INCLUDE "scripts/oakslab.asm" - INCLUDE "data/mapObjects/oakslab.asm" INCLUDE "data/mapHeaders/viridianmart.asm" - INCLUDE "scripts/viridianmart.asm" - INCLUDE "data/mapObjects/viridianmart.asm" - -ViridianMartBlocks: ; 1d530 (7:5530) - INCBIN "maps/viridianmart.blk" +ViridianMartBlocks: INCBIN "maps/viridianmart.blk" INCLUDE "data/mapHeaders/school.asm" - INCLUDE "scripts/school.asm" - INCLUDE "data/mapObjects/school.asm" INCLUDE "data/mapHeaders/viridianhouse.asm" - INCLUDE "scripts/viridianhouse.asm" - INCLUDE "data/mapObjects/viridianhouse.asm" INCLUDE "data/mapHeaders/pewterhouse1.asm" - INCLUDE "scripts/pewterhouse1.asm" - INCLUDE "data/mapObjects/pewterhouse1.asm" INCLUDE "data/mapHeaders/pewterhouse2.asm" - INCLUDE "scripts/pewterhouse2.asm" - INCLUDE "data/mapObjects/pewterhouse2.asm" INCLUDE "data/mapHeaders/ceruleanhousetrashed.asm" - INCLUDE "scripts/ceruleanhousetrashed.asm" - INCLUDE "data/mapObjects/ceruleanhousetrashed.asm" INCLUDE "data/mapHeaders/ceruleanhouse1.asm" - INCLUDE "scripts/ceruleanhouse1.asm" - INCLUDE "data/mapObjects/ceruleanhouse1.asm" INCLUDE "data/mapHeaders/bikeshop.asm" - INCLUDE "scripts/bikeshop.asm" - INCLUDE "data/mapObjects/bikeshop.asm" - -BikeShopBlocks: ; 1d88c (7:588c) - INCBIN "maps/bikeshop.blk" +BikeShopBlocks: INCBIN "maps/bikeshop.blk" INCLUDE "data/mapHeaders/lavenderhouse1.asm" - INCLUDE "scripts/lavenderhouse1.asm" - INCLUDE "data/mapObjects/lavenderhouse1.asm" INCLUDE "data/mapHeaders/lavenderhouse2.asm" - INCLUDE "scripts/lavenderhouse2.asm" - INCLUDE "data/mapObjects/lavenderhouse2.asm" INCLUDE "data/mapHeaders/namerater.asm" - INCLUDE "scripts/namerater.asm" - INCLUDE "data/mapObjects/namerater.asm" INCLUDE "data/mapHeaders/vermilionhouse1.asm" - INCLUDE "scripts/vermilionhouse1.asm" - INCLUDE "data/mapObjects/vermilionhouse1.asm" INCLUDE "data/mapHeaders/vermiliondock.asm" - INCLUDE "scripts/vermiliondock.asm" - INCLUDE "data/mapObjects/vermiliondock.asm" - -VermilionDockBlocks: ; 1dcda (7:5cda) - INCBIN "maps/vermiliondock.blk" +VermilionDockBlocks: INCBIN "maps/vermiliondock.blk" INCLUDE "data/mapHeaders/celadonmansion5.asm" - INCLUDE "scripts/celadonmansion5.asm" - INCLUDE "data/mapObjects/celadonmansion5.asm" INCLUDE "data/mapHeaders/fuchsiamart.asm" - INCLUDE "scripts/fuchsiamart.asm" - INCLUDE "data/mapObjects/fuchsiamart.asm" - -FuchsiaMartBlocks: ; 1ddc1 (7:5dc1) - INCBIN "maps/fuchsiamart.blk" +FuchsiaMartBlocks: INCBIN "maps/fuchsiamart.blk" INCLUDE "data/mapHeaders/saffronhouse1.asm" - INCLUDE "scripts/saffronhouse1.asm" - INCLUDE "data/mapObjects/saffronhouse1.asm" INCLUDE "data/mapHeaders/saffronhouse2.asm" - INCLUDE "scripts/saffronhouse2.asm" - INCLUDE "data/mapObjects/saffronhouse2.asm" INCLUDE "data/mapHeaders/diglettscaveroute2.asm" - INCLUDE "scripts/diglettscaveroute2.asm" - INCLUDE "data/mapObjects/diglettscaveroute2.asm" INCLUDE "data/mapHeaders/route2house.asm" - INCLUDE "scripts/route2house.asm" - INCLUDE "data/mapObjects/route2house.asm" INCLUDE "data/mapHeaders/route5gate.asm" - INCLUDE "scripts/route5gate.asm" - INCLUDE "data/mapObjects/route5gate.asm" - -Route5GateBlocks: ; 1e025 (7:6025) - INCBIN "maps/route5gate.blk" +Route5GateBlocks: INCBIN "maps/route5gate.blk" INCLUDE "data/mapHeaders/route6gate.asm" - INCLUDE "scripts/route6gate.asm" - INCLUDE "data/mapObjects/route6gate.asm" - -Route6GateBlocks: ; 1e0e8 (7:60e8) - INCBIN "maps/route6gate.blk" +Route6GateBlocks: INCBIN "maps/route6gate.blk" INCLUDE "data/mapHeaders/route7gate.asm" - INCLUDE "scripts/route7gate.asm" - INCLUDE "data/mapObjects/route7gate.asm" - -Route7GateBlocks: ; 1e1af (7:61af) - INCBIN "maps/route7gate.blk" +Route7GateBlocks: INCBIN "maps/route7gate.blk" INCLUDE "data/mapHeaders/route8gate.asm" - INCLUDE "scripts/route8gate.asm" - INCLUDE "data/mapObjects/route8gate.asm" - -Route8GateBlocks: ; 1e271 (7:6271) - INCBIN "maps/route8gate.blk" +Route8GateBlocks: INCBIN "maps/route8gate.blk" INCLUDE "data/mapHeaders/undergroundpathentranceroute8.asm" - INCLUDE "scripts/undergroundpathentranceroute8.asm" - INCLUDE "data/mapObjects/undergroundpathentranceroute8.asm" INCLUDE "data/mapHeaders/powerplant.asm" - INCLUDE "scripts/powerplant.asm" - INCLUDE "data/mapObjects/powerplant.asm" - -PowerPlantBlocks: ; 1e446 (7:6446) - INCBIN "maps/powerplant.blk" +PowerPlantBlocks: INCBIN "maps/powerplant.blk" INCLUDE "data/mapHeaders/diglettscaveroute11.asm" - INCLUDE "scripts/diglettscaveroute11.asm" - INCLUDE "data/mapObjects/diglettscaveroute11.asm" INCLUDE "data/mapHeaders/route16house.asm" - INCLUDE "scripts/route16house.asm" - INCLUDE "data/mapObjects/route16house.asm" INCLUDE "data/mapHeaders/route22gate.asm" - INCLUDE "scripts/route22gate.asm" - INCLUDE "data/mapObjects/route22gate.asm" - -Route22GateBlocks: ; 1e74a (7:674a) - INCBIN "maps/route22gate.blk" +Route22GateBlocks: INCBIN "maps/route22gate.blk" INCLUDE "data/mapHeaders/billshouse.asm" - INCLUDE "scripts/billshouse.asm" - INCLUDE "data/mapObjects/billshouse.asm" - -BillsHouseBlocks: ; 1e905 (7:6905) - INCBIN "maps/billshouse.blk" +BillsHouseBlocks: INCBIN "maps/billshouse.blk" INCLUDE "engine/menu/oaks_pc.asm" INCLUDE "engine/hidden_object_functions7.asm" -SECTION "bank9",ROMX,BANK[$9] - -RhydonPicFront: ; 24000 (9:4000) - INCBIN "pic/bmon/rhydon.pic" -RhydonPicBack: ; 24202 (9:4202) - INCBIN "pic/monback/rhydonb.pic" -KangaskhanPicFront: ; 2429a (9:429a) - INCBIN "pic/bmon/kangaskhan.pic" -KangaskhanPicBack: ; 244a6 (9:44a6) - INCBIN "pic/monback/kangaskhanb.pic" -NidoranMPicFront: ; 2453c (9:453c) - INCBIN "pic/bmon/nidoranm.pic" -NidoranMPicBack: ; 24623 (9:4623) - INCBIN "pic/monback/nidoranmb.pic" -ClefairyPicFront: ; 24682 (9:4682) - INCBIN "pic/bmon/clefairy.pic" -ClefairyPicBack: ; 24785 (9:4785) - INCBIN "pic/monback/clefairyb.pic" -SpearowPicFront: ; 247df (9:47df) - INCBIN "pic/bmon/spearow.pic" -SpearowPicBack: ; 248c2 (9:48c2) - INCBIN "pic/monback/spearowb.pic" -VoltorbPicFront: ; 24911 (9:4911) - INCBIN "pic/bmon/voltorb.pic" -VoltorbPicBack: ; 2499a (9:499a) - INCBIN "pic/monback/voltorbb.pic" -NidokingPicFront: ; 249f8 (9:49f8) - INCBIN "pic/bmon/nidoking.pic" -NidokingPicBack: ; 24c60 (9:4c60) - INCBIN "pic/monback/nidokingb.pic" -SlowbroPicFront: ; 24d0a (9:4d0a) - INCBIN "pic/bmon/slowbro.pic" -SlowbroPicBack: ; 24f87 (9:4f87) - INCBIN "pic/monback/slowbrob.pic" -IvysaurPicFront: ; 2502b (9:502b) - INCBIN "pic/bmon/ivysaur.pic" -IvysaurPicBack: ; 25157 (9:5157) - INCBIN "pic/monback/ivysaurb.pic" -ExeggutorPicFront: ; 251d6 (9:51d6) - INCBIN "pic/bmon/exeggutor.pic" -ExeggutorPicBack: ; 253f8 (9:53f8) - INCBIN "pic/monback/exeggutorb.pic" -LickitungPicFront: ; 254a7 (9:54a7) - INCBIN "pic/bmon/lickitung.pic" -LickitungPicBack: ; 2563e (9:563e) - INCBIN "pic/monback/lickitungb.pic" -ExeggcutePicFront: ; 256d7 (9:56d7) - INCBIN "pic/bmon/exeggcute.pic" -ExeggcutePicBack: ; 258f0 (9:58f0) - INCBIN "pic/monback/exeggcuteb.pic" -GrimerPicFront: ; 25973 (9:5973) - INCBIN "pic/bmon/grimer.pic" -GrimerPicBack: ; 25ab0 (9:5ab0) - INCBIN "pic/monback/grimerb.pic" -GengarPicFront: ; 25b76 (9:5b76) - INCBIN "pic/bmon/gengar.pic" -GengarPicBack: ; 25cc6 (9:5cc6) - INCBIN "pic/monback/gengarb.pic" -NidoranFPicFront: ; 25d28 (9:5d28) - INCBIN "pic/bmon/nidoranf.pic" -NidoranFPicBack: ; 25dc2 (9:5dc2) - INCBIN "pic/monback/nidoranfb.pic" -NidoqueenPicFront: ; 25e09 (9:5e09) - INCBIN "pic/bmon/nidoqueen.pic" -NidoqueenPicBack: ; 25fef (9:5fef) - INCBIN "pic/monback/nidoqueenb.pic" -CubonePicFront: ; 260a8 (9:60a8) - INCBIN "pic/bmon/cubone.pic" -CubonePicBack: ; 26196 (9:6196) - INCBIN "pic/monback/cuboneb.pic" -RhyhornPicFront: ; 26208 (9:6208) - INCBIN "pic/bmon/rhyhorn.pic" -RhyhornPicBack: ; 2640f (9:640f) - INCBIN "pic/monback/rhyhornb.pic" -LaprasPicFront: ; 264c1 (9:64c1) - INCBIN "pic/bmon/lapras.pic" -LaprasPicBack: ; 2667c (9:667c) - INCBIN "pic/monback/laprasb.pic" -ArcaninePicFront: ; 266ff (9:66ff) - INCBIN "pic/bmon/arcanine.pic" -ArcaninePicBack: ; 2693d (9:693d) - INCBIN "pic/monback/arcanineb.pic" -GyaradosPicFront: ; 269d4 (9:69d4) - INCBIN "pic/bmon/gyarados.pic" -GyaradosPicBack: ; 26c25 (9:6c25) - INCBIN "pic/monback/gyaradosb.pic" -ShellderPicFront: ; 26cb6 (9:6cb6) - INCBIN "pic/bmon/shellder.pic" -ShellderPicBack: ; 26dc3 (9:6dc3) - INCBIN "pic/monback/shellderb.pic" -TentacoolPicFront: ; 26e2a (9:6e2a) - INCBIN "pic/bmon/tentacool.pic" -TentacoolPicBack: ; 26f1c (9:6f1c) - INCBIN "pic/monback/tentacoolb.pic" -GastlyPicFront: ; 26f77 (9:6f77) - INCBIN "pic/bmon/gastly.pic" -GastlyPicBack: ; 27190 (9:7190) - INCBIN "pic/monback/gastlyb.pic" -ScytherPicFront: ; 2721c (9:721c) - INCBIN "pic/bmon/scyther.pic" -ScytherPicBack: ; 2743c (9:743c) - INCBIN "pic/monback/scytherb.pic" -StaryuPicFront: ; 274e0 (9:74e0) - INCBIN "pic/bmon/staryu.pic" -StaryuPicBack: ; 275ec (9:75ec) - INCBIN "pic/monback/staryub.pic" -BlastoisePicFront: ; 27637 (9:7637) - INCBIN "pic/bmon/blastoise.pic" -BlastoisePicBack: ; 27851 (9:7851) - INCBIN "pic/monback/blastoiseb.pic" -PinsirPicFront: ; 278da (9:78da) - INCBIN "pic/bmon/pinsir.pic" -PinsirPicBack: ; 27aaa (9:7aaa) - INCBIN "pic/monback/pinsirb.pic" -TangelaPicFront: ; 27b39 (9:7b39) - INCBIN "pic/bmon/tangela.pic" -TangelaPicBack: ; 27ce7 (9:7ce7) - INCBIN "pic/monback/tangelab.pic" +SECTION "Pics 1", ROMX, BANK[PICS_1] + +RhydonPicFront:: INCBIN "pic/bmon/rhydon.pic" +RhydonPicBack:: INCBIN "pic/monback/rhydonb.pic" +KangaskhanPicFront:: INCBIN "pic/bmon/kangaskhan.pic" +KangaskhanPicBack:: INCBIN "pic/monback/kangaskhanb.pic" +NidoranMPicFront:: INCBIN "pic/bmon/nidoranm.pic" +NidoranMPicBack:: INCBIN "pic/monback/nidoranmb.pic" +ClefairyPicFront:: INCBIN "pic/bmon/clefairy.pic" +ClefairyPicBack:: INCBIN "pic/monback/clefairyb.pic" +SpearowPicFront:: INCBIN "pic/bmon/spearow.pic" +SpearowPicBack:: INCBIN "pic/monback/spearowb.pic" +VoltorbPicFront:: INCBIN "pic/bmon/voltorb.pic" +VoltorbPicBack:: INCBIN "pic/monback/voltorbb.pic" +NidokingPicFront:: INCBIN "pic/bmon/nidoking.pic" +NidokingPicBack:: INCBIN "pic/monback/nidokingb.pic" +SlowbroPicFront:: INCBIN "pic/bmon/slowbro.pic" +SlowbroPicBack:: INCBIN "pic/monback/slowbrob.pic" +IvysaurPicFront:: INCBIN "pic/bmon/ivysaur.pic" +IvysaurPicBack:: INCBIN "pic/monback/ivysaurb.pic" +ExeggutorPicFront:: INCBIN "pic/bmon/exeggutor.pic" +ExeggutorPicBack:: INCBIN "pic/monback/exeggutorb.pic" +LickitungPicFront:: INCBIN "pic/bmon/lickitung.pic" +LickitungPicBack:: INCBIN "pic/monback/lickitungb.pic" +ExeggcutePicFront:: INCBIN "pic/bmon/exeggcute.pic" +ExeggcutePicBack:: INCBIN "pic/monback/exeggcuteb.pic" +GrimerPicFront:: INCBIN "pic/bmon/grimer.pic" +GrimerPicBack:: INCBIN "pic/monback/grimerb.pic" +GengarPicFront:: INCBIN "pic/bmon/gengar.pic" +GengarPicBack:: INCBIN "pic/monback/gengarb.pic" +NidoranFPicFront:: INCBIN "pic/bmon/nidoranf.pic" +NidoranFPicBack:: INCBIN "pic/monback/nidoranfb.pic" +NidoqueenPicFront:: INCBIN "pic/bmon/nidoqueen.pic" +NidoqueenPicBack:: INCBIN "pic/monback/nidoqueenb.pic" +CubonePicFront:: INCBIN "pic/bmon/cubone.pic" +CubonePicBack:: INCBIN "pic/monback/cuboneb.pic" +RhyhornPicFront:: INCBIN "pic/bmon/rhyhorn.pic" +RhyhornPicBack:: INCBIN "pic/monback/rhyhornb.pic" +LaprasPicFront:: INCBIN "pic/bmon/lapras.pic" +LaprasPicBack:: INCBIN "pic/monback/laprasb.pic" +ArcaninePicFront:: INCBIN "pic/bmon/arcanine.pic" +ArcaninePicBack:: INCBIN "pic/monback/arcanineb.pic" +GyaradosPicFront:: INCBIN "pic/bmon/gyarados.pic" +GyaradosPicBack:: INCBIN "pic/monback/gyaradosb.pic" +ShellderPicFront:: INCBIN "pic/bmon/shellder.pic" +ShellderPicBack:: INCBIN "pic/monback/shellderb.pic" +TentacoolPicFront:: INCBIN "pic/bmon/tentacool.pic" +TentacoolPicBack:: INCBIN "pic/monback/tentacoolb.pic" +GastlyPicFront:: INCBIN "pic/bmon/gastly.pic" +GastlyPicBack:: INCBIN "pic/monback/gastlyb.pic" +ScytherPicFront:: INCBIN "pic/bmon/scyther.pic" +ScytherPicBack:: INCBIN "pic/monback/scytherb.pic" +StaryuPicFront:: INCBIN "pic/bmon/staryu.pic" +StaryuPicBack:: INCBIN "pic/monback/staryub.pic" +BlastoisePicFront:: INCBIN "pic/bmon/blastoise.pic" +BlastoisePicBack:: INCBIN "pic/monback/blastoiseb.pic" +PinsirPicFront:: INCBIN "pic/bmon/pinsir.pic" +PinsirPicBack:: INCBIN "pic/monback/pinsirb.pic" +TangelaPicFront:: INCBIN "pic/bmon/tangela.pic" +TangelaPicBack:: INCBIN "pic/monback/tangelab.pic" + + +SECTION "Battle (bank 9)", ROMX, BANK[$9] INCLUDE "engine/battle/9.asm" -SECTION "bankA",ROMX,BANK[$A] -GrowlithePicFront: ; 28000 (a:4000) - INCBIN "pic/bmon/growlithe.pic" -GrowlithePicBack: ; 28101 (a:4101) - INCBIN "pic/monback/growlitheb.pic" -OnixPicFront: ; 28164 (a:4164) - INCBIN "pic/bmon/onix.pic" -OnixPicBack: ; 28300 (a:4300) - INCBIN "pic/monback/onixb.pic" -FearowPicFront: ; 28383 (a:4383) - INCBIN "pic/bmon/fearow.pic" -FearowPicBack: ; 28529 (a:4529) - INCBIN "pic/monback/fearowb.pic" -PidgeyPicFront: ; 285a7 (a:45a7) - INCBIN "pic/bmon/pidgey.pic" -PidgeyPicBack: ; 2865b (a:465b) - INCBIN "pic/monback/pidgeyb.pic" -SlowpokePicFront: ; 286a0 (a:46a0) - INCBIN "pic/bmon/slowpoke.pic" -SlowpokePicBack: ; 287c2 (a:47c2) - INCBIN "pic/monback/slowpokeb.pic" -KadabraPicFront: ; 28830 (a:4830) - INCBIN "pic/bmon/kadabra.pic" -KadabraPicBack: ; 289b9 (a:49b9) - INCBIN "pic/monback/kadabrab.pic" -GravelerPicFront: ; 28a4c (a:4a4c) - INCBIN "pic/bmon/graveler.pic" -GravelerPicBack: ; 28c00 (a:4c00) - INCBIN "pic/monback/gravelerb.pic" -ChanseyPicFront: ; 28cae (a:4cae) - INCBIN "pic/bmon/chansey.pic" -ChanseyPicBack: ; 28e21 (a:4e21) - INCBIN "pic/monback/chanseyb.pic" -MachokePicFront: ; 28e85 (a:4e85) - INCBIN "pic/bmon/machoke.pic" -MachokePicBack: ; 29063 (a:5063) - INCBIN "pic/monback/machokeb.pic" -MrMimePicFront: ; 290f3 (a:50f3) - INCBIN "pic/bmon/mr.mime.pic" -MrMimePicBack: ; 29247 (a:5247) - INCBIN "pic/monback/mr.mimeb.pic" -HitmonleePicFront: ; 292bf (a:52bf) - INCBIN "pic/bmon/hitmonlee.pic" -HitmonleePicBack: ; 2945e (a:545e) - INCBIN "pic/monback/hitmonleeb.pic" -HitmonchanPicFront: ; 294bc (a:54bc) - INCBIN "pic/bmon/hitmonchan.pic" -HitmonchanPicBack: ; 29643 (a:5643) - INCBIN "pic/monback/hitmonchanb.pic" -ArbokPicFront: ; 296b4 (a:56b4) - INCBIN "pic/bmon/arbok.pic" -ArbokPicBack: ; 29911 (a:5911) - INCBIN "pic/monback/arbokb.pic" -ParasectPicFront: ; 299a8 (a:59a8) - INCBIN "pic/bmon/parasect.pic" -ParasectPicBack: ; 29b8c (a:5b8c) - INCBIN "pic/monback/parasectb.pic" -PsyduckPicFront: ; 29c0a (a:5c0a) - INCBIN "pic/bmon/psyduck.pic" -PsyduckPicBack: ; 29d3e (a:5d3e) - INCBIN "pic/monback/psyduckb.pic" -DrowzeePicFront: ; 29da9 (a:5da9) - INCBIN "pic/bmon/drowzee.pic" -DrowzeePicBack: ; 29f05 (a:5f05) - INCBIN "pic/monback/drowzeeb.pic" -GolemPicFront: ; 29f74 (a:5f74) - INCBIN "pic/bmon/golem.pic" -GolemPicBack: ; 2a0f2 (a:60f2) - INCBIN "pic/monback/golemb.pic" -MagmarPicFront: ; 2a161 (a:6161) - INCBIN "pic/bmon/magmar.pic" -MagmarPicBack: ; 2a2bf (a:62bf) - INCBIN "pic/monback/magmarb.pic" -ElectabuzzPicFront: ; 2a367 (a:6367) - INCBIN "pic/bmon/electabuzz.pic" -ElectabuzzPicBack: ; 2a4ef (a:64ef) - INCBIN "pic/monback/electabuzzb.pic" -MagnetonPicFront: ; 2a588 (a:6588) - INCBIN "pic/bmon/magneton.pic" -MagnetonPicBack: ; 2a723 (a:6723) - INCBIN "pic/monback/magnetonb.pic" -KoffingPicFront: ; 2a7a6 (a:67a6) - INCBIN "pic/bmon/koffing.pic" -KoffingPicBack: ; 2a974 (a:6974) - INCBIN "pic/monback/koffingb.pic" -MankeyPicFront: ; 2aa11 (a:6a11) - INCBIN "pic/bmon/mankey.pic" -MankeyPicBack: ; 2ab16 (a:6b16) - INCBIN "pic/monback/mankeyb.pic" -SeelPicFront: ; 2ab84 (a:6b84) - INCBIN "pic/bmon/seel.pic" -SeelPicBack: ; 2ace8 (a:6ce8) - INCBIN "pic/monback/seelb.pic" -DiglettPicFront: ; 2ad33 (a:6d33) - INCBIN "pic/bmon/diglett.pic" -DiglettPicBack: ; 2ae10 (a:6e10) - INCBIN "pic/monback/diglettb.pic" -TaurosPicFront: ; 2ae7e (a:6e7e) - INCBIN "pic/bmon/tauros.pic" -TaurosPicBack: ; 2b054 (a:7054) - INCBIN "pic/monback/taurosb.pic" -FarfetchdPicFront: ; 2b0e9 (a:70e9) - INCBIN "pic/bmon/farfetchd.pic" -FarfetchdPicBack: ; 2b2c6 (a:72c6) - INCBIN "pic/monback/farfetchdb.pic" -VenonatPicFront: ; 2b357 (a:7357) - INCBIN "pic/bmon/venonat.pic" -VenonatPicBack: ; 2b45c (a:745c) - INCBIN "pic/monback/venonatb.pic" -DragonitePicFront: ; 2b4aa (a:74aa) - INCBIN "pic/bmon/dragonite.pic" -DragonitePicBack: ; 2b67f (a:767f) - INCBIN "pic/monback/dragoniteb.pic" -DoduoPicFront: ; 2b72c (a:772c) - INCBIN "pic/bmon/doduo.pic" -DoduoPicBack: ; 2b80d (a:780d) - INCBIN "pic/monback/doduob.pic" -PoliwagPicFront: ; 2b875 (a:7875) - INCBIN "pic/bmon/poliwag.pic" -PoliwagPicBack: ; 2b947 (a:7947) - INCBIN "pic/monback/poliwagb.pic" -JynxPicFront: ; 2b98e (a:798e) - INCBIN "pic/bmon/jynx.pic" -JynxPicBack: ; 2bb42 (a:7b42) - INCBIN "pic/monback/jynxb.pic" -MoltresPicFront: ; 2bbac (a:7bac) - INCBIN "pic/bmon/moltres.pic" -MoltresPicBack: ; 2be02 (a:7e02) - INCBIN "pic/monback/moltresb.pic" +SECTION "Pics 2", ROMX, BANK[PICS_2] + +GrowlithePicFront:: INCBIN "pic/bmon/growlithe.pic" +GrowlithePicBack:: INCBIN "pic/monback/growlitheb.pic" +OnixPicFront:: INCBIN "pic/bmon/onix.pic" +OnixPicBack:: INCBIN "pic/monback/onixb.pic" +FearowPicFront:: INCBIN "pic/bmon/fearow.pic" +FearowPicBack:: INCBIN "pic/monback/fearowb.pic" +PidgeyPicFront:: INCBIN "pic/bmon/pidgey.pic" +PidgeyPicBack:: INCBIN "pic/monback/pidgeyb.pic" +SlowpokePicFront:: INCBIN "pic/bmon/slowpoke.pic" +SlowpokePicBack:: INCBIN "pic/monback/slowpokeb.pic" +KadabraPicFront:: INCBIN "pic/bmon/kadabra.pic" +KadabraPicBack:: INCBIN "pic/monback/kadabrab.pic" +GravelerPicFront:: INCBIN "pic/bmon/graveler.pic" +GravelerPicBack:: INCBIN "pic/monback/gravelerb.pic" +ChanseyPicFront:: INCBIN "pic/bmon/chansey.pic" +ChanseyPicBack:: INCBIN "pic/monback/chanseyb.pic" +MachokePicFront:: INCBIN "pic/bmon/machoke.pic" +MachokePicBack:: INCBIN "pic/monback/machokeb.pic" +MrMimePicFront:: INCBIN "pic/bmon/mr.mime.pic" +MrMimePicBack:: INCBIN "pic/monback/mr.mimeb.pic" +HitmonleePicFront:: INCBIN "pic/bmon/hitmonlee.pic" +HitmonleePicBack:: INCBIN "pic/monback/hitmonleeb.pic" +HitmonchanPicFront:: INCBIN "pic/bmon/hitmonchan.pic" +HitmonchanPicBack:: INCBIN "pic/monback/hitmonchanb.pic" +ArbokPicFront:: INCBIN "pic/bmon/arbok.pic" +ArbokPicBack:: INCBIN "pic/monback/arbokb.pic" +ParasectPicFront:: INCBIN "pic/bmon/parasect.pic" +ParasectPicBack:: INCBIN "pic/monback/parasectb.pic" +PsyduckPicFront:: INCBIN "pic/bmon/psyduck.pic" +PsyduckPicBack:: INCBIN "pic/monback/psyduckb.pic" +DrowzeePicFront:: INCBIN "pic/bmon/drowzee.pic" +DrowzeePicBack:: INCBIN "pic/monback/drowzeeb.pic" +GolemPicFront:: INCBIN "pic/bmon/golem.pic" +GolemPicBack:: INCBIN "pic/monback/golemb.pic" +MagmarPicFront:: INCBIN "pic/bmon/magmar.pic" +MagmarPicBack:: INCBIN "pic/monback/magmarb.pic" +ElectabuzzPicFront:: INCBIN "pic/bmon/electabuzz.pic" +ElectabuzzPicBack:: INCBIN "pic/monback/electabuzzb.pic" +MagnetonPicFront:: INCBIN "pic/bmon/magneton.pic" +MagnetonPicBack:: INCBIN "pic/monback/magnetonb.pic" +KoffingPicFront:: INCBIN "pic/bmon/koffing.pic" +KoffingPicBack:: INCBIN "pic/monback/koffingb.pic" +MankeyPicFront:: INCBIN "pic/bmon/mankey.pic" +MankeyPicBack:: INCBIN "pic/monback/mankeyb.pic" +SeelPicFront:: INCBIN "pic/bmon/seel.pic" +SeelPicBack:: INCBIN "pic/monback/seelb.pic" +DiglettPicFront:: INCBIN "pic/bmon/diglett.pic" +DiglettPicBack:: INCBIN "pic/monback/diglettb.pic" +TaurosPicFront:: INCBIN "pic/bmon/tauros.pic" +TaurosPicBack:: INCBIN "pic/monback/taurosb.pic" +FarfetchdPicFront:: INCBIN "pic/bmon/farfetchd.pic" +FarfetchdPicBack:: INCBIN "pic/monback/farfetchdb.pic" +VenonatPicFront:: INCBIN "pic/bmon/venonat.pic" +VenonatPicBack:: INCBIN "pic/monback/venonatb.pic" +DragonitePicFront:: INCBIN "pic/bmon/dragonite.pic" +DragonitePicBack:: INCBIN "pic/monback/dragoniteb.pic" +DoduoPicFront:: INCBIN "pic/bmon/doduo.pic" +DoduoPicBack:: INCBIN "pic/monback/doduob.pic" +PoliwagPicFront:: INCBIN "pic/bmon/poliwag.pic" +PoliwagPicBack:: INCBIN "pic/monback/poliwagb.pic" +JynxPicFront:: INCBIN "pic/bmon/jynx.pic" +JynxPicBack:: INCBIN "pic/monback/jynxb.pic" +MoltresPicFront:: INCBIN "pic/bmon/moltres.pic" +MoltresPicBack:: INCBIN "pic/monback/moltresb.pic" + + +SECTION "Battle (bank A)", ROMX, BANK[$A] INCLUDE "engine/battle/a.asm" -SECTION "bankB",ROMX,BANK[$B] -ArticunoPicFront: ; 2c000 (b:4000) - INCBIN "pic/bmon/articuno.pic" -ArticunoPicBack: ; 2c238 (b:4238) - INCBIN "pic/monback/articunob.pic" -ZapdosPicFront: ; 2c29d (b:429d) - INCBIN "pic/bmon/zapdos.pic" -ZapdosPicBack: ; 2c484 (b:4484) - INCBIN "pic/monback/zapdosb.pic" -DittoPicFront: ; 2c514 (b:4514) - INCBIN "pic/bmon/ditto.pic" -DittoPicBack: ; 2c5bd (b:45bd) - INCBIN "pic/monback/dittob.pic" -MeowthPicFront: ; 2c609 (b:4609) - INCBIN "pic/bmon/meowth.pic" -MeowthPicBack: ; 2c71f (b:471f) - INCBIN "pic/monback/meowthb.pic" -KrabbyPicFront: ; 2c777 (b:4777) - INCBIN "pic/bmon/krabby.pic" -KrabbyPicBack: ; 2c8b0 (b:48b0) - INCBIN "pic/monback/krabbyb.pic" -VulpixPicFront: ; 2c924 (b:4924) - INCBIN "pic/bmon/vulpix.pic" -VulpixPicBack: ; 2ca9a (b:4a9a) - INCBIN "pic/monback/vulpixb.pic" -NinetalesPicFront: ; 2caff (b:4aff) - INCBIN "pic/bmon/ninetales.pic" -NinetalesPicBack: ; 2ccfb (b:4cfb) - INCBIN "pic/monback/ninetalesb.pic" -PikachuPicFront: ; 2cd7d (b:4d7d) - INCBIN "pic/bmon/pikachu.pic" -PikachuPicBack: ; 2ce8b (b:4e8b) - INCBIN "pic/monback/pikachub.pic" -RaichuPicFront: ; 2cf03 (b:4f03) - INCBIN "pic/bmon/raichu.pic" -RaichuPicBack: ; 2d0c3 (b:50c3) - INCBIN "pic/monback/raichub.pic" -DratiniPicFront: ; 2d151 (b:5151) - INCBIN "pic/bmon/dratini.pic" -DratiniPicBack: ; 2d234 (b:5234) - INCBIN "pic/monback/dratinib.pic" -DragonairPicFront: ; 2d297 (b:5297) - INCBIN "pic/bmon/dragonair.pic" -DragonairPicBack: ; 2d3d9 (b:53d9) - INCBIN "pic/monback/dragonairb.pic" -KabutoPicFront: ; 2d464 (b:5464) - INCBIN "pic/bmon/kabuto.pic" -KabutoPicBack: ; 2d529 (b:5529) - INCBIN "pic/monback/kabutob.pic" -KabutopsPicFront: ; 2d583 (b:5583) - INCBIN "pic/bmon/kabutops.pic" -KabutopsPicBack: ; 2d73c (b:573c) - INCBIN "pic/monback/kabutopsb.pic" -HorseaPicFront: ; 2d7c1 (b:57c1) - INCBIN "pic/bmon/horsea.pic" -HorseaPicBack: ; 2d873 (b:5873) - INCBIN "pic/monback/horseab.pic" -SeadraPicFront: ; 2d8c4 (b:58c4) - INCBIN "pic/bmon/seadra.pic" -SeadraPicBack: ; 2da2b (b:5a2b) - INCBIN "pic/monback/seadrab.pic" -SandshrewPicFront: ; 2dac9 (b:5ac9) - INCBIN "pic/bmon/sandshrew.pic" -SandshrewPicBack: ; 2dbe7 (b:5be7) - INCBIN "pic/monback/sandshrewb.pic" -SandslashPicFront: ; 2dc6b (b:5c6b) - INCBIN "pic/bmon/sandslash.pic" -SandslashPicBack: ; 2de04 (b:5e04) - INCBIN "pic/monback/sandslashb.pic" -OmanytePicFront: ; 2de9d (b:5e9d) - INCBIN "pic/bmon/omanyte.pic" -OmanytePicBack: ; 2df76 (b:5f76) - INCBIN "pic/monback/omanyteb.pic" -OmastarPicFront: ; 2dfd3 (b:5fd3) - INCBIN "pic/bmon/omastar.pic" -OmastarPicBack: ; 2e18b (b:618b) - INCBIN "pic/monback/omastarb.pic" -JigglypuffPicFront: ; 2e22f (b:622f) - INCBIN "pic/bmon/jigglypuff.pic" -JigglypuffPicBack: ; 2e30f (b:630f) - INCBIN "pic/monback/jigglypuffb.pic" -WigglytuffPicFront: ; 2e348 (b:6348) - INCBIN "pic/bmon/wigglytuff.pic" -WigglytuffPicBack: ; 2e4bf (b:64bf) - INCBIN "pic/monback/wigglytuffb.pic" -EeveePicFront: ; 2e531 (b:6531) - INCBIN "pic/bmon/eevee.pic" -EeveePicBack: ; 2e625 (b:6625) - INCBIN "pic/monback/eeveeb.pic" -FlareonPicFront: ; 2e68d (b:668d) - INCBIN "pic/bmon/flareon.pic" -FlareonPicBack: ; 2e806 (b:6806) - INCBIN "pic/monback/flareonb.pic" -JolteonPicFront: ; 2e88f (b:688f) - INCBIN "pic/bmon/jolteon.pic" -JolteonPicBack: ; 2ea0a (b:6a0a) - INCBIN "pic/monback/jolteonb.pic" -VaporeonPicFront: ; 2eaae (b:6aae) - INCBIN "pic/bmon/vaporeon.pic" -VaporeonPicBack: ; 2ec02 (b:6c02) - INCBIN "pic/monback/vaporeonb.pic" -MachopPicFront: ; 2ec9f (b:6c9f) - INCBIN "pic/bmon/machop.pic" -MachopPicBack: ; 2eda2 (b:6da2) - INCBIN "pic/monback/machopb.pic" -ZubatPicFront: ; 2ee0c (b:6e0c) - INCBIN "pic/bmon/zubat.pic" -ZubatPicBack: ; 2ef17 (b:6f17) - INCBIN "pic/monback/zubatb.pic" -EkansPicFront: ; 2ef6b (b:6f6b) - INCBIN "pic/bmon/ekans.pic" -EkansPicBack: ; 2f06d (b:706d) - INCBIN "pic/monback/ekansb.pic" -ParasPicFront: ; 2f0b4 (b:70b4) - INCBIN "pic/bmon/paras.pic" -ParasPicBack: ; 2f177 (b:7177) - INCBIN "pic/monback/parasb.pic" -PoliwhirlPicFront: ; 2f1ed (b:71ed) - INCBIN "pic/bmon/poliwhirl.pic" -PoliwhirlPicBack: ; 2f35e (b:735e) - INCBIN "pic/monback/poliwhirlb.pic" -PoliwrathPicFront: ; 2f3c1 (b:73c1) - INCBIN "pic/bmon/poliwrath.pic" -PoliwrathPicBack: ; 2f52c (b:752c) - INCBIN "pic/monback/poliwrathb.pic" -WeedlePicFront: ; 2f57d (b:757d) - INCBIN "pic/bmon/weedle.pic" -WeedlePicBack: ; 2f624 (b:7624) - INCBIN "pic/monback/weedleb.pic" -KakunaPicFront: ; 2f677 (b:7677) - INCBIN "pic/bmon/kakuna.pic" -KakunaPicBack: ; 2f736 (b:7736) - INCBIN "pic/monback/kakunab.pic" -BeedrillPicFront: ; 2f788 (b:7788) - INCBIN "pic/bmon/beedrill.pic" -BeedrillPicBack: ; 2f980 (b:7980) - INCBIN "pic/monback/beedrillb.pic" -FossilKabutopsPic: ; 2f9e8 (b:79e8) - INCBIN "pic/bmon/fossilkabutops.pic" - -INCLUDE "engine/battle/b.asm" - -TrainerInfoTextBoxTileGraphics: ; 2fb98 (b:7b98) - INCBIN "gfx/trainer_info.2bpp" -BlankLeaderNames: ; 2fc28 (b:7c28) - INCBIN "gfx/blank_leader_names.2bpp" +SECTION "Pics 3", ROMX, BANK[PICS_3] + +ArticunoPicFront:: INCBIN "pic/bmon/articuno.pic" +ArticunoPicBack:: INCBIN "pic/monback/articunob.pic" +ZapdosPicFront:: INCBIN "pic/bmon/zapdos.pic" +ZapdosPicBack:: INCBIN "pic/monback/zapdosb.pic" +DittoPicFront:: INCBIN "pic/bmon/ditto.pic" +DittoPicBack:: INCBIN "pic/monback/dittob.pic" +MeowthPicFront:: INCBIN "pic/bmon/meowth.pic" +MeowthPicBack:: INCBIN "pic/monback/meowthb.pic" +KrabbyPicFront:: INCBIN "pic/bmon/krabby.pic" +KrabbyPicBack:: INCBIN "pic/monback/krabbyb.pic" +VulpixPicFront:: INCBIN "pic/bmon/vulpix.pic" +VulpixPicBack:: INCBIN "pic/monback/vulpixb.pic" +NinetalesPicFront:: INCBIN "pic/bmon/ninetales.pic" +NinetalesPicBack:: INCBIN "pic/monback/ninetalesb.pic" +PikachuPicFront:: INCBIN "pic/bmon/pikachu.pic" +PikachuPicBack:: INCBIN "pic/monback/pikachub.pic" +RaichuPicFront:: INCBIN "pic/bmon/raichu.pic" +RaichuPicBack:: INCBIN "pic/monback/raichub.pic" +DratiniPicFront:: INCBIN "pic/bmon/dratini.pic" +DratiniPicBack:: INCBIN "pic/monback/dratinib.pic" +DragonairPicFront:: INCBIN "pic/bmon/dragonair.pic" +DragonairPicBack:: INCBIN "pic/monback/dragonairb.pic" +KabutoPicFront:: INCBIN "pic/bmon/kabuto.pic" +KabutoPicBack:: INCBIN "pic/monback/kabutob.pic" +KabutopsPicFront:: INCBIN "pic/bmon/kabutops.pic" +KabutopsPicBack:: INCBIN "pic/monback/kabutopsb.pic" +HorseaPicFront:: INCBIN "pic/bmon/horsea.pic" +HorseaPicBack:: INCBIN "pic/monback/horseab.pic" +SeadraPicFront:: INCBIN "pic/bmon/seadra.pic" +SeadraPicBack:: INCBIN "pic/monback/seadrab.pic" +SandshrewPicFront:: INCBIN "pic/bmon/sandshrew.pic" +SandshrewPicBack:: INCBIN "pic/monback/sandshrewb.pic" +SandslashPicFront:: INCBIN "pic/bmon/sandslash.pic" +SandslashPicBack:: INCBIN "pic/monback/sandslashb.pic" +OmanytePicFront:: INCBIN "pic/bmon/omanyte.pic" +OmanytePicBack:: INCBIN "pic/monback/omanyteb.pic" +OmastarPicFront:: INCBIN "pic/bmon/omastar.pic" +OmastarPicBack:: INCBIN "pic/monback/omastarb.pic" +JigglypuffPicFront:: INCBIN "pic/bmon/jigglypuff.pic" +JigglypuffPicBack:: INCBIN "pic/monback/jigglypuffb.pic" +WigglytuffPicFront:: INCBIN "pic/bmon/wigglytuff.pic" +WigglytuffPicBack:: INCBIN "pic/monback/wigglytuffb.pic" +EeveePicFront:: INCBIN "pic/bmon/eevee.pic" +EeveePicBack:: INCBIN "pic/monback/eeveeb.pic" +FlareonPicFront:: INCBIN "pic/bmon/flareon.pic" +FlareonPicBack:: INCBIN "pic/monback/flareonb.pic" +JolteonPicFront:: INCBIN "pic/bmon/jolteon.pic" +JolteonPicBack:: INCBIN "pic/monback/jolteonb.pic" +VaporeonPicFront:: INCBIN "pic/bmon/vaporeon.pic" +VaporeonPicBack:: INCBIN "pic/monback/vaporeonb.pic" +MachopPicFront:: INCBIN "pic/bmon/machop.pic" +MachopPicBack:: INCBIN "pic/monback/machopb.pic" +ZubatPicFront:: INCBIN "pic/bmon/zubat.pic" +ZubatPicBack:: INCBIN "pic/monback/zubatb.pic" +EkansPicFront:: INCBIN "pic/bmon/ekans.pic" +EkansPicBack:: INCBIN "pic/monback/ekansb.pic" +ParasPicFront:: INCBIN "pic/bmon/paras.pic" +ParasPicBack:: INCBIN "pic/monback/parasb.pic" +PoliwhirlPicFront:: INCBIN "pic/bmon/poliwhirl.pic" +PoliwhirlPicBack:: INCBIN "pic/monback/poliwhirlb.pic" +PoliwrathPicFront:: INCBIN "pic/bmon/poliwrath.pic" +PoliwrathPicBack:: INCBIN "pic/monback/poliwrathb.pic" +WeedlePicFront:: INCBIN "pic/bmon/weedle.pic" +WeedlePicBack:: INCBIN "pic/monback/weedleb.pic" +KakunaPicFront:: INCBIN "pic/bmon/kakuna.pic" +KakunaPicBack:: INCBIN "pic/monback/kakunab.pic" +BeedrillPicFront:: INCBIN "pic/bmon/beedrill.pic" +BeedrillPicBack:: INCBIN "pic/monback/beedrillb.pic" + +FossilKabutopsPic:: INCBIN "pic/bmon/fossilkabutops.pic" + + +SECTION "Battle (bank B)", ROMX, BANK[$B] -CircleTile: ; 2fd88 (b:7d88) - INCBIN "gfx/circle_tile.2bpp" +INCLUDE "engine/battle/b.asm" -BadgeNumbersTileGraphics: ; 2fd98 (b:7d98) - INCBIN "gfx/badge_numbers.2bpp" +TrainerInfoTextBoxTileGraphics: INCBIN "gfx/trainer_info.2bpp" +BlankLeaderNames: INCBIN "gfx/blank_leader_names.2bpp" +CircleTile: INCBIN "gfx/circle_tile.2bpp" +BadgeNumbersTileGraphics: INCBIN "gfx/badge_numbers.2bpp" INCLUDE "engine/items/tmhm.asm" - INCLUDE "engine/battle/b_2.asm" - INCLUDE "engine/game_corner_slots2.asm" -SECTION "bankC",ROMX,BANK[$C] -DodrioPicFront: ; 30000 (c:4000) - INCBIN "pic/bmon/dodrio.pic" -DodrioPicBack: ; 301a2 (c:41a2) - INCBIN "pic/monback/dodriob.pic" -PrimeapePicFront: ; 30247 (c:4247) - INCBIN "pic/bmon/primeape.pic" -PrimeapePicBack: ; 30408 (c:4408) - INCBIN "pic/monback/primeapeb.pic" -DugtrioPicFront: ; 30480 (c:4480) - INCBIN "pic/bmon/dugtrio.pic" -DugtrioPicBack: ; 3062a (c:462a) - INCBIN "pic/monback/dugtriob.pic" -VenomothPicFront: ; 306a9 (c:46a9) - INCBIN "pic/bmon/venomoth.pic" -VenomothPicBack: ; 30841 (c:4841) - INCBIN "pic/monback/venomothb.pic" -DewgongPicFront: ; 30899 (c:4899) - INCBIN "pic/bmon/dewgong.pic" -DewgongPicBack: ; 309e2 (c:49e2) - INCBIN "pic/monback/dewgongb.pic" -CaterpiePicFront: ; 30a49 (c:4a49) - INCBIN "pic/bmon/caterpie.pic" -CaterpiePicBack: ; 30ae1 (c:4ae1) - INCBIN "pic/monback/caterpieb.pic" -MetapodPicFront: ; 30b3a (c:4b3a) - INCBIN "pic/bmon/metapod.pic" -MetapodPicBack: ; 30bc8 (c:4bc8) - INCBIN "pic/monback/metapodb.pic" -ButterfreePicFront: ; 30c37 (c:4c37) - INCBIN "pic/bmon/butterfree.pic" -ButterfreePicBack: ; 30e0e (c:4e0e) - INCBIN "pic/monback/butterfreeb.pic" -MachampPicFront: ; 30e93 (c:4e93) - INCBIN "pic/bmon/machamp.pic" -MachampPicBack: ; 3108c (c:508c) - INCBIN "pic/monback/machampb.pic" -GolduckPicFront: ; 31108 (c:5108) - INCBIN "pic/bmon/golduck.pic" -GolduckPicBack: ; 312c2 (c:52c2) - INCBIN "pic/monback/golduckb.pic" -HypnoPicFront: ; 3135d (c:535d) - INCBIN "pic/bmon/hypno.pic" -HypnoPicBack: ; 31552 (c:5552) - INCBIN "pic/monback/hypnob.pic" -GolbatPicFront: ; 315e0 (c:55e0) - INCBIN "pic/bmon/golbat.pic" -GolbatPicBack: ; 3180a (c:580a) - INCBIN "pic/monback/golbatb.pic" -MewtwoPicFront: ; 3187f (c:587f) - INCBIN "pic/bmon/mewtwo.pic" -MewtwoPicBack: ; 31a85 (c:5a85) - INCBIN "pic/monback/mewtwob.pic" -SnorlaxPicFront: ; 31b19 (c:5b19) - INCBIN "pic/bmon/snorlax.pic" -SnorlaxPicBack: ; 31ce5 (c:5ce5) - INCBIN "pic/monback/snorlaxb.pic" -MagikarpPicFront: ; 31d31 (c:5d31) - INCBIN "pic/bmon/magikarp.pic" -MagikarpPicBack: ; 31ec3 (c:5ec3) - INCBIN "pic/monback/magikarpb.pic" -MukPicFront: ; 31f56 (c:5f56) - INCBIN "pic/bmon/muk.pic" -MukPicBack: ; 3215f (c:615f) - INCBIN "pic/monback/mukb.pic" -KinglerPicFront: ; 321ec (c:61ec) - INCBIN "pic/bmon/kingler.pic" -KinglerPicBack: ; 323de (c:63de) - INCBIN "pic/monback/kinglerb.pic" -CloysterPicFront: ; 3247f (c:647f) - INCBIN "pic/bmon/cloyster.pic" -CloysterPicBack: ; 326ab (c:66ab) - INCBIN "pic/monback/cloysterb.pic" -ElectrodePicFront: ; 32760 (c:6760) - INCBIN "pic/bmon/electrode.pic" -ElectrodePicBack: ; 32827 (c:6827) - INCBIN "pic/monback/electrodeb.pic" -ClefablePicFront: ; 3288c (c:688c) - INCBIN "pic/bmon/clefable.pic" -ClefablePicBack: ; 329b8 (c:69b8) - INCBIN "pic/monback/clefableb.pic" -WeezingPicFront: ; 32a44 (c:6a44) - INCBIN "pic/bmon/weezing.pic" -WeezingPicBack: ; 32c76 (c:6c76) - INCBIN "pic/monback/weezingb.pic" -PersianPicFront: ; 32d1e (c:6d1e) - INCBIN "pic/bmon/persian.pic" -PersianPicBack: ; 32f04 (c:6f04) - INCBIN "pic/monback/persianb.pic" -MarowakPicFront: ; 32f8f (c:6f8f) - INCBIN "pic/bmon/marowak.pic" -MarowakPicBack: ; 33101 (c:7101) - INCBIN "pic/monback/marowakb.pic" -HaunterPicFront: ; 3318a (c:718a) - INCBIN "pic/bmon/haunter.pic" -HaunterPicBack: ; 33345 (c:7345) - INCBIN "pic/monback/haunterb.pic" -AbraPicFront: ; 333cc (c:73cc) - INCBIN "pic/bmon/abra.pic" -AbraPicBack: ; 334cf (c:74cf) - INCBIN "pic/monback/abrab.pic" -AlakazamPicFront: ; 3355a (c:755a) - INCBIN "pic/bmon/alakazam.pic" -AlakazamPicBack: ; 33779 (c:7779) - INCBIN "pic/monback/alakazamb.pic" -PidgeottoPicFront: ; 3380a (c:780a) - INCBIN "pic/bmon/pidgeotto.pic" -PidgeottoPicBack: ; 3395b (c:795b) - INCBIN "pic/monback/pidgeottob.pic" -PidgeotPicFront: ; 339c2 (c:79c2) - INCBIN "pic/bmon/pidgeot.pic" -PidgeotPicBack: ; 33b79 (c:7b79) - INCBIN "pic/monback/pidgeotb.pic" -StarmiePicFront: ; 33c1c (c:7c1c) - INCBIN "pic/bmon/starmie.pic" -StarmiePicBack: ; 33dac (c:7dac) - INCBIN "pic/monback/starmieb.pic" -RedPicBack: ; 33e0a (c:7e0a) - INCBIN "pic/trainer/redb.pic" -OldManPic: ; 33e9a (c:7e9a) - INCBIN "pic/trainer/oldman.pic" +SECTION "Pics 4", ROMX, BANK[PICS_4] + +DodrioPicFront:: INCBIN "pic/bmon/dodrio.pic" +DodrioPicBack:: INCBIN "pic/monback/dodriob.pic" +PrimeapePicFront:: INCBIN "pic/bmon/primeape.pic" +PrimeapePicBack:: INCBIN "pic/monback/primeapeb.pic" +DugtrioPicFront:: INCBIN "pic/bmon/dugtrio.pic" +DugtrioPicBack:: INCBIN "pic/monback/dugtriob.pic" +VenomothPicFront:: INCBIN "pic/bmon/venomoth.pic" +VenomothPicBack:: INCBIN "pic/monback/venomothb.pic" +DewgongPicFront:: INCBIN "pic/bmon/dewgong.pic" +DewgongPicBack:: INCBIN "pic/monback/dewgongb.pic" +CaterpiePicFront:: INCBIN "pic/bmon/caterpie.pic" +CaterpiePicBack:: INCBIN "pic/monback/caterpieb.pic" +MetapodPicFront:: INCBIN "pic/bmon/metapod.pic" +MetapodPicBack:: INCBIN "pic/monback/metapodb.pic" +ButterfreePicFront:: INCBIN "pic/bmon/butterfree.pic" +ButterfreePicBack:: INCBIN "pic/monback/butterfreeb.pic" +MachampPicFront:: INCBIN "pic/bmon/machamp.pic" +MachampPicBack:: INCBIN "pic/monback/machampb.pic" +GolduckPicFront:: INCBIN "pic/bmon/golduck.pic" +GolduckPicBack:: INCBIN "pic/monback/golduckb.pic" +HypnoPicFront:: INCBIN "pic/bmon/hypno.pic" +HypnoPicBack:: INCBIN "pic/monback/hypnob.pic" +GolbatPicFront:: INCBIN "pic/bmon/golbat.pic" +GolbatPicBack:: INCBIN "pic/monback/golbatb.pic" +MewtwoPicFront:: INCBIN "pic/bmon/mewtwo.pic" +MewtwoPicBack:: INCBIN "pic/monback/mewtwob.pic" +SnorlaxPicFront:: INCBIN "pic/bmon/snorlax.pic" +SnorlaxPicBack:: INCBIN "pic/monback/snorlaxb.pic" +MagikarpPicFront:: INCBIN "pic/bmon/magikarp.pic" +MagikarpPicBack:: INCBIN "pic/monback/magikarpb.pic" +MukPicFront:: INCBIN "pic/bmon/muk.pic" +MukPicBack:: INCBIN "pic/monback/mukb.pic" +KinglerPicFront:: INCBIN "pic/bmon/kingler.pic" +KinglerPicBack:: INCBIN "pic/monback/kinglerb.pic" +CloysterPicFront:: INCBIN "pic/bmon/cloyster.pic" +CloysterPicBack:: INCBIN "pic/monback/cloysterb.pic" +ElectrodePicFront:: INCBIN "pic/bmon/electrode.pic" +ElectrodePicBack:: INCBIN "pic/monback/electrodeb.pic" +ClefablePicFront:: INCBIN "pic/bmon/clefable.pic" +ClefablePicBack:: INCBIN "pic/monback/clefableb.pic" +WeezingPicFront:: INCBIN "pic/bmon/weezing.pic" +WeezingPicBack:: INCBIN "pic/monback/weezingb.pic" +PersianPicFront:: INCBIN "pic/bmon/persian.pic" +PersianPicBack:: INCBIN "pic/monback/persianb.pic" +MarowakPicFront:: INCBIN "pic/bmon/marowak.pic" +MarowakPicBack:: INCBIN "pic/monback/marowakb.pic" +HaunterPicFront:: INCBIN "pic/bmon/haunter.pic" +HaunterPicBack:: INCBIN "pic/monback/haunterb.pic" +AbraPicFront:: INCBIN "pic/bmon/abra.pic" +AbraPicBack:: INCBIN "pic/monback/abrab.pic" +AlakazamPicFront:: INCBIN "pic/bmon/alakazam.pic" +AlakazamPicBack:: INCBIN "pic/monback/alakazamb.pic" +PidgeottoPicFront:: INCBIN "pic/bmon/pidgeotto.pic" +PidgeottoPicBack:: INCBIN "pic/monback/pidgeottob.pic" +PidgeotPicFront:: INCBIN "pic/bmon/pidgeot.pic" +PidgeotPicBack:: INCBIN "pic/monback/pidgeotb.pic" +StarmiePicFront:: INCBIN "pic/bmon/starmie.pic" +StarmiePicBack:: INCBIN "pic/monback/starmieb.pic" + +RedPicBack:: INCBIN "pic/trainer/redb.pic" +OldManPic:: INCBIN "pic/trainer/oldman.pic" + + +SECTION "Battle (bank C)", ROMX, BANK[$C] INCLUDE "engine/battle/c.asm" -SECTION "bankD",ROMX,BANK[$D] -BulbasaurPicFront: ; 34000 (d:4000) - INCBIN "pic/bmon/bulbasaur.pic" -BulbasaurPicBack: ; 340e5 (d:40e5) - INCBIN "pic/monback/bulbasaurb.pic" -VenusaurPicFront: ; 34162 (d:4162) - INCBIN "pic/bmon/venusaur.pic" -VenusaurPicBack: ; 34397 (d:4397) - INCBIN "pic/monback/venusaurb.pic" -TentacruelPicFront: ; 34455 (d:4455) - INCBIN "pic/bmon/tentacruel.pic" -TentacruelPicBack: ; 345c3 (d:45c3) - INCBIN "pic/monback/tentacruelb.pic" -GoldeenPicFront: ; 3466f (d:466f) - INCBIN "pic/bmon/goldeen.pic" -GoldeenPicBack: ; 34796 (d:4796) - INCBIN "pic/monback/goldeenb.pic" -SeakingPicFront: ; 34803 (d:4803) - INCBIN "pic/bmon/seaking.pic" -SeakingPicBack: ; 34a03 (d:4a03) - INCBIN "pic/monback/seakingb.pic" -PonytaPicFront: ; 34ab1 (d:4ab1) - INCBIN "pic/bmon/ponyta.pic" -RapidashPicFront: ; 34c10 (d:4c10) - INCBIN "pic/bmon/rapidash.pic" -PonytaPicBack: ; 34e32 (d:4e32) - INCBIN "pic/monback/ponytab.pic" -RapidashPicBack: ; 34eba (d:4eba) - INCBIN "pic/monback/rapidashb.pic" -RattataPicFront: ; 34f6a (d:4f6a) - INCBIN "pic/bmon/rattata.pic" -RattataPicBack: ; 35041 (d:5041) - INCBIN "pic/monback/rattatab.pic" -RaticatePicFront: ; 3507a (d:507a) - INCBIN "pic/bmon/raticate.pic" -RaticatePicBack: ; 3520d (d:520d) - INCBIN "pic/monback/raticateb.pic" -NidorinoPicFront: ; 35282 (d:5282) - INCBIN "pic/bmon/nidorino.pic" -NidorinoPicBack: ; 353f0 (d:53f0) - INCBIN "pic/monback/nidorinob.pic" -NidorinaPicFront: ; 3548b (d:548b) - INCBIN "pic/bmon/nidorina.pic" -NidorinaPicBack: ; 355c8 (d:55c8) - INCBIN "pic/monback/nidorinab.pic" -GeodudePicFront: ; 3564f (d:564f) - INCBIN "pic/bmon/geodude.pic" -GeodudePicBack: ; 35729 (d:5729) - INCBIN "pic/monback/geodudeb.pic" -PorygonPicFront: ; 35784 (d:5784) - INCBIN "pic/bmon/porygon.pic" -PorygonPicBack: ; 358d1 (d:58d1) - INCBIN "pic/monback/porygonb.pic" -AerodactylPicFront: ; 35931 (d:5931) - INCBIN "pic/bmon/aerodactyl.pic" -AerodactylPicBack: ; 35aec (d:5aec) - INCBIN "pic/monback/aerodactylb.pic" -MagnemitePicFront: ; 35b87 (d:5b87) - INCBIN "pic/bmon/magnemite.pic" -MagnemitePicBack: ; 35c0d (d:5c0d) - INCBIN "pic/monback/magnemiteb.pic" -CharmanderPicFront: ; 35c5c (d:5c5c) - INCBIN "pic/bmon/charmander.pic" -CharmanderPicBack: ; 35d5c (d:5d5c) - INCBIN "pic/monback/charmanderb.pic" -SquirtlePicFront: ; 35db8 (d:5db8) - INCBIN "pic/bmon/squirtle.pic" -SquirtlePicBack: ; 35e8f (d:5e8f) - INCBIN "pic/monback/squirtleb.pic" -CharmeleonPicFront: ; 35f0c (d:5f0c) - INCBIN "pic/bmon/charmeleon.pic" -CharmeleonPicBack: ; 36048 (d:6048) - INCBIN "pic/monback/charmeleonb.pic" -WartortlePicFront: ; 360b1 (d:60b1) - INCBIN "pic/bmon/wartortle.pic" -WartortlePicBack: ; 361f1 (d:61f1) - INCBIN "pic/monback/wartortleb.pic" -CharizardPicFront: ; 36286 (d:6286) - INCBIN "pic/bmon/charizard.pic" -CharizardPicBack: ; 36495 (d:6495) - INCBIN "pic/monback/charizardb.pic" -FossilAerodactylPic: ; 36536 (d:6536) - INCBIN "pic/bmon/fossilaerodactyl.pic" -GhostPic: ; 366b5 (d:66b5) - INCBIN "pic/other/ghost.pic" -OddishPicFront: ; 3680b (d:680b) - INCBIN "pic/bmon/oddish.pic" -OddishPicBack: ; 368a9 (d:68a9) - INCBIN "pic/monback/oddishb.pic" -GloomPicFront: ; 36941 (d:6941) - INCBIN "pic/bmon/gloom.pic" -GloomPicBack: ; 36a78 (d:6a78) - INCBIN "pic/monback/gloomb.pic" -VileplumePicFront: ; 36b21 (d:6b21) - INCBIN "pic/bmon/vileplume.pic" -VileplumePicBack: ; 36c82 (d:6c82) - INCBIN "pic/monback/vileplumeb.pic" -BellsproutPicFront: ; 36d00 (d:6d00) - INCBIN "pic/bmon/bellsprout.pic" -BellsproutPicBack: ; 36dba (d:6dba) - INCBIN "pic/monback/bellsproutb.pic" -WeepinbellPicFront: ; 36e30 (d:6e30) - INCBIN "pic/bmon/weepinbell.pic" -WeepinbellPicBack: ; 36f6f (d:6f6f) - INCBIN "pic/monback/weepinbellb.pic" -VictreebelPicFront: ; 36fea (d:6fea) - INCBIN "pic/bmon/victreebel.pic" -VictreebelPicBack: ; 371b2 (d:71b2) - INCBIN "pic/monback/victreebelb.pic" -INCLUDE "engine/titlescreen2.asm" +SECTION "Pics 5", ROMX, BANK[PICS_5] + +BulbasaurPicFront:: INCBIN "pic/bmon/bulbasaur.pic" +BulbasaurPicBack:: INCBIN "pic/monback/bulbasaurb.pic" +VenusaurPicFront:: INCBIN "pic/bmon/venusaur.pic" +VenusaurPicBack:: INCBIN "pic/monback/venusaurb.pic" +TentacruelPicFront:: INCBIN "pic/bmon/tentacruel.pic" +TentacruelPicBack:: INCBIN "pic/monback/tentacruelb.pic" +GoldeenPicFront:: INCBIN "pic/bmon/goldeen.pic" +GoldeenPicBack:: INCBIN "pic/monback/goldeenb.pic" +SeakingPicFront:: INCBIN "pic/bmon/seaking.pic" +SeakingPicBack:: INCBIN "pic/monback/seakingb.pic" +PonytaPicFront:: INCBIN "pic/bmon/ponyta.pic" +RapidashPicFront:: INCBIN "pic/bmon/rapidash.pic" +PonytaPicBack:: INCBIN "pic/monback/ponytab.pic" +RapidashPicBack:: INCBIN "pic/monback/rapidashb.pic" +RattataPicFront:: INCBIN "pic/bmon/rattata.pic" +RattataPicBack:: INCBIN "pic/monback/rattatab.pic" +RaticatePicFront:: INCBIN "pic/bmon/raticate.pic" +RaticatePicBack:: INCBIN "pic/monback/raticateb.pic" +NidorinoPicFront:: INCBIN "pic/bmon/nidorino.pic" +NidorinoPicBack:: INCBIN "pic/monback/nidorinob.pic" +NidorinaPicFront:: INCBIN "pic/bmon/nidorina.pic" +NidorinaPicBack:: INCBIN "pic/monback/nidorinab.pic" +GeodudePicFront:: INCBIN "pic/bmon/geodude.pic" +GeodudePicBack:: INCBIN "pic/monback/geodudeb.pic" +PorygonPicFront:: INCBIN "pic/bmon/porygon.pic" +PorygonPicBack:: INCBIN "pic/monback/porygonb.pic" +AerodactylPicFront:: INCBIN "pic/bmon/aerodactyl.pic" +AerodactylPicBack:: INCBIN "pic/monback/aerodactylb.pic" +MagnemitePicFront:: INCBIN "pic/bmon/magnemite.pic" +MagnemitePicBack:: INCBIN "pic/monback/magnemiteb.pic" +CharmanderPicFront:: INCBIN "pic/bmon/charmander.pic" +CharmanderPicBack:: INCBIN "pic/monback/charmanderb.pic" +SquirtlePicFront:: INCBIN "pic/bmon/squirtle.pic" +SquirtlePicBack:: INCBIN "pic/monback/squirtleb.pic" +CharmeleonPicFront:: INCBIN "pic/bmon/charmeleon.pic" +CharmeleonPicBack:: INCBIN "pic/monback/charmeleonb.pic" +WartortlePicFront:: INCBIN "pic/bmon/wartortle.pic" +WartortlePicBack:: INCBIN "pic/monback/wartortleb.pic" +CharizardPicFront:: INCBIN "pic/bmon/charizard.pic" +CharizardPicBack:: INCBIN "pic/monback/charizardb.pic" +FossilAerodactylPic:: INCBIN "pic/bmon/fossilaerodactyl.pic" +GhostPic:: INCBIN "pic/other/ghost.pic" +OddishPicFront:: INCBIN "pic/bmon/oddish.pic" +OddishPicBack:: INCBIN "pic/monback/oddishb.pic" +GloomPicFront:: INCBIN "pic/bmon/gloom.pic" +GloomPicBack:: INCBIN "pic/monback/gloomb.pic" +VileplumePicFront:: INCBIN "pic/bmon/vileplume.pic" +VileplumePicBack:: INCBIN "pic/monback/vileplumeb.pic" +BellsproutPicFront:: INCBIN "pic/bmon/bellsprout.pic" +BellsproutPicBack:: INCBIN "pic/monback/bellsproutb.pic" +WeepinbellPicFront:: INCBIN "pic/bmon/weepinbell.pic" +WeepinbellPicBack:: INCBIN "pic/monback/weepinbellb.pic" +VictreebelPicFront:: INCBIN "pic/bmon/victreebel.pic" +VictreebelPicBack:: INCBIN "pic/monback/victreebelb.pic" + + +SECTION "Battle (bank D)", ROMX, BANK[$D] +INCLUDE "engine/titlescreen2.asm" INCLUDE "engine/battle/d.asm" - INCLUDE "engine/slot_machine.asm" - INCLUDE "engine/overworld/pewter_guys.asm" - INCLUDE "engine/multiply_divide.asm" - INCLUDE "engine/game_corner_slots.asm" + SECTION "bankE",ROMX,BANK[$E] INCLUDE "data/moves.asm" - -INCLUDE "data/base_stats.asm" - +BaseStats: INCLUDE "data/base_stats.asm" INCLUDE "data/cries.asm" - INCLUDE "engine/battle/e.asm" -; tiles for gameboy and link cable graphics used for trading sequence animation -TradingAnimationGraphics: ; 3a9be (e:69be) +TradingAnimationGraphics: INCBIN "gfx/game_boy.norepeat.2bpp" INCBIN "gfx/link_cable.2bpp" -; 4 tiles for actual wire transfer animation (pokeball wandering inside wire) -TradingAnimationGraphics2: ; 3acce (e:6cce) +TradingAnimationGraphics2: +; Pokeball traveling through the link cable. INCBIN "gfx/trade2.2bpp" INCLUDE "engine/evos_moves.asm" - INCLUDE "engine/battle/e_2.asm" + SECTION "bankF",ROMX,BANK[$F] INCLUDE "engine/battle/core.asm" + SECTION "bank10",ROMX,BANK[$10] INCLUDE "engine/menu/pokedex.asm" - INCLUDE "engine/trade.asm" - INCLUDE "engine/intro.asm" - INCLUDE "engine/trade2.asm" + SECTION "bank11",ROMX,BANK[$11] INCLUDE "data/mapHeaders/lavendertown.asm" - INCLUDE "data/mapObjects/lavendertown.asm" +LavenderTownBlocks: INCBIN "maps/lavendertown.blk" -LavenderTownBlocks: ; 44085 (11:4085) - INCBIN "maps/lavendertown.blk" - -ViridianPokecenterBlocks: ; 440df (11:40df) - INCBIN "maps/viridianpokecenter.blk" +ViridianPokecenterBlocks: INCBIN "maps/viridianpokecenter.blk" -SafariZoneRestHouse1Blocks: ; 440fb (11:40fb) -SafariZoneRestHouse2Blocks: ; 440fb (11:40fb) -SafariZoneRestHouse3Blocks: ; 440fb (11:40fb) -SafariZoneRestHouse4Blocks: ; 440fb (11:40fb) - INCBIN "maps/safarizoneresthouse1.blk" +SafariZoneRestHouse1Blocks: +SafariZoneRestHouse2Blocks: +SafariZoneRestHouse3Blocks: +SafariZoneRestHouse4Blocks: INCBIN "maps/safarizoneresthouse1.blk" INCLUDE "scripts/lavendertown.asm" INCLUDE "engine/pokedex_rating.asm" INCLUDE "data/mapHeaders/viridianpokecenter.asm" - INCLUDE "scripts/viridianpokecenter.asm" - INCLUDE "data/mapObjects/viridianpokecenter.asm" INCLUDE "data/mapHeaders/mansion1.asm" - INCLUDE "scripts/mansion1.asm" - INCLUDE "data/mapObjects/mansion1.asm" - -Mansion1Blocks: ; 443fe (11:43fe) - INCBIN "maps/mansion1.blk" +Mansion1Blocks: INCBIN "maps/mansion1.blk" INCLUDE "data/mapHeaders/rocktunnel1.asm" - INCLUDE "scripts/rocktunnel1.asm" - INCLUDE "data/mapObjects/rocktunnel1.asm" - -RockTunnel1Blocks: ; 44675 (11:4675) - INCBIN "maps/rocktunnel1.blk" +RockTunnel1Blocks: INCBIN "maps/rocktunnel1.blk" INCLUDE "data/mapHeaders/seafoamislands1.asm" - INCLUDE "scripts/seafoamislands1.asm" - INCLUDE "data/mapObjects/seafoamislands1.asm" - -SeafoamIslands1Blocks: ; 4489f (11:489f) - INCBIN "maps/seafoamislands1.blk" +SeafoamIslands1Blocks: INCBIN "maps/seafoamislands1.blk" INCLUDE "data/mapHeaders/ssanne3.asm" - INCLUDE "scripts/ssanne3.asm" - INCLUDE "data/mapObjects/ssanne3.asm" - -SSAnne3Blocks: ; 44956 (11:4956) - INCBIN "maps/ssanne3.blk" +SSAnne3Blocks: INCBIN "maps/ssanne3.blk" INCLUDE "data/mapHeaders/victoryroad3.asm" - INCLUDE "scripts/victoryroad3.asm" - INCLUDE "data/mapObjects/victoryroad3.asm" - -VictoryRoad3Blocks: ; 44b37 (11:4b37) - INCBIN "maps/victoryroad3.blk" +VictoryRoad3Blocks: INCBIN "maps/victoryroad3.blk" INCLUDE "data/mapHeaders/rockethideout1.asm" - INCLUDE "scripts/rockethideout1.asm" - INCLUDE "data/mapObjects/rockethideout1.asm" - -RocketHideout1Blocks: ; 44d49 (11:4d49) - INCBIN "maps/rockethideout1.blk" +RocketHideout1Blocks: INCBIN "maps/rockethideout1.blk" INCLUDE "data/mapHeaders/rockethideout2.asm" - INCLUDE "scripts/rockethideout2.asm" - INCLUDE "data/mapObjects/rockethideout2.asm" - -RocketHideout2Blocks: ; 45147 (11:5147) - INCBIN "maps/rockethideout2.blk" +RocketHideout2Blocks: INCBIN "maps/rockethideout2.blk" INCLUDE "data/mapHeaders/rockethideout3.asm" - INCLUDE "scripts/rockethideout3.asm" - INCLUDE "data/mapObjects/rockethideout3.asm" - -RocketHideout3Blocks: ; 4537f (11:537f) - INCBIN "maps/rockethideout3.blk" +RocketHideout3Blocks: INCBIN "maps/rockethideout3.blk" INCLUDE "data/mapHeaders/rockethideout4.asm" - INCLUDE "scripts/rockethideout4.asm" - INCLUDE "data/mapObjects/rockethideout4.asm" - -RocketHideout4Blocks: ; 45650 (11:5650) - INCBIN "maps/rockethideout4.blk" +RocketHideout4Blocks: INCBIN "maps/rockethideout4.blk" INCLUDE "data/mapHeaders/rockethideoutelevator.asm" - INCLUDE "scripts/rockethideoutelevator.asm" - INCLUDE "data/mapObjects/rockethideoutelevator.asm" - -RocketHideoutElevatorBlocks: ; 457a8 (11:57a8) - INCBIN "maps/rockethideoutelevator.blk" +RocketHideoutElevatorBlocks: INCBIN "maps/rockethideoutelevator.blk" INCLUDE "data/mapHeaders/silphcoelevator.asm" - INCLUDE "scripts/silphcoelevator.asm" - INCLUDE "data/mapObjects/silphcoelevator.asm" - -SilphCoElevatorBlocks: ; 4585b (11:585b) - INCBIN "maps/silphcoelevator.blk" +SilphCoElevatorBlocks: INCBIN "maps/silphcoelevator.blk" INCLUDE "data/mapHeaders/safarizoneeast.asm" - INCLUDE "scripts/safarizoneeast.asm" - INCLUDE "data/mapObjects/safarizoneeast.asm" - -SafariZoneEastBlocks: ; 458dc (11:58dc) - INCBIN "maps/safarizoneeast.blk" +SafariZoneEastBlocks: INCBIN "maps/safarizoneeast.blk" INCLUDE "data/mapHeaders/safarizonenorth.asm" - INCLUDE "scripts/safarizonenorth.asm" - INCLUDE "data/mapObjects/safarizonenorth.asm" - -SafariZoneNorthBlocks: ; 45a3e (11:5a3e) - INCBIN "maps/safarizonenorth.blk" +SafariZoneNorthBlocks: INCBIN "maps/safarizonenorth.blk" INCLUDE "data/mapHeaders/safarizonecenter.asm" - INCLUDE "scripts/safarizonecenter.asm" - INCLUDE "data/mapObjects/safarizonecenter.asm" - -SafariZoneCenterBlocks: ; 45c1e (11:5c1e) - INCBIN "maps/safarizonecenter.blk" +SafariZoneCenterBlocks: INCBIN "maps/safarizonecenter.blk" INCLUDE "data/mapHeaders/safarizoneresthouse1.asm" - INCLUDE "scripts/safarizoneresthouse1.asm" - INCLUDE "data/mapObjects/safarizoneresthouse1.asm" INCLUDE "data/mapHeaders/safarizoneresthouse2.asm" - INCLUDE "scripts/safarizoneresthouse2.asm" - INCLUDE "data/mapObjects/safarizoneresthouse2.asm" INCLUDE "data/mapHeaders/safarizoneresthouse3.asm" - INCLUDE "scripts/safarizoneresthouse3.asm" - INCLUDE "data/mapObjects/safarizoneresthouse3.asm" INCLUDE "data/mapHeaders/safarizoneresthouse4.asm" - INCLUDE "scripts/safarizoneresthouse4.asm" - INCLUDE "data/mapObjects/safarizoneresthouse4.asm" INCLUDE "data/mapHeaders/unknowndungeon2.asm" - INCLUDE "scripts/unknowndungeon2.asm" - INCLUDE "data/mapObjects/unknowndungeon2.asm" - -UnknownDungeon2Blocks: ; 45e5d (11:5e5d) - INCBIN "maps/unknowndungeon2.blk" +UnknownDungeon2Blocks: INCBIN "maps/unknowndungeon2.blk" INCLUDE "data/mapHeaders/unknowndungeon3.asm" - INCLUDE "scripts/unknowndungeon3.asm" - INCLUDE "data/mapObjects/unknowndungeon3.asm" - -UnknownDungeon3Blocks: ; 45f58 (11:5f58) - INCBIN "maps/unknowndungeon3.blk" +UnknownDungeon3Blocks: INCBIN "maps/unknowndungeon3.blk" INCLUDE "data/mapHeaders/rocktunnel2.asm" - INCLUDE "scripts/rocktunnel2.asm" - INCLUDE "data/mapObjects/rocktunnel2.asm" - -RockTunnel2Blocks: ; 461a1 (11:61a1) - INCBIN "maps/rocktunnel2.blk" +RockTunnel2Blocks: INCBIN "maps/rocktunnel2.blk" INCLUDE "data/mapHeaders/seafoamislands2.asm" - INCLUDE "scripts/seafoamislands2.asm" - INCLUDE "data/mapObjects/seafoamislands2.asm" - -SeafoamIslands2Blocks: ; 463be (11:63be) - INCBIN "maps/seafoamislands2.blk" +SeafoamIslands2Blocks: INCBIN "maps/seafoamislands2.blk" INCLUDE "data/mapHeaders/seafoamislands3.asm" - INCLUDE "scripts/seafoamislands3.asm" - INCLUDE "data/mapObjects/seafoamislands3.asm" - -SeafoamIslands3Blocks: ; 464fa (11:64fa) - INCBIN "maps/seafoamislands3.blk" +SeafoamIslands3Blocks: INCBIN "maps/seafoamislands3.blk" INCLUDE "data/mapHeaders/seafoamislands4.asm" - INCLUDE "scripts/seafoamislands4.asm" - INCLUDE "data/mapObjects/seafoamislands4.asm" - -SeafoamIslands4Blocks: ; 46706 (11:6706) - INCBIN "maps/seafoamislands4.blk" +SeafoamIslands4Blocks: INCBIN "maps/seafoamislands4.blk" INCLUDE "data/mapHeaders/seafoamislands5.asm" - INCLUDE "scripts/seafoamislands5.asm" - INCLUDE "data/mapObjects/seafoamislands5.asm" - -SeafoamIslands5Blocks: ; 468fa (11:68fa) - INCBIN "maps/seafoamislands5.blk" +SeafoamIslands5Blocks: INCBIN "maps/seafoamislands5.blk" INCLUDE "engine/overworld/hidden_objects.asm" + SECTION "bank12",ROMX,BANK[$12] INCLUDE "data/mapHeaders/route7.asm" - INCLUDE "data/mapObjects/route7.asm" +Route7Blocks: INCBIN "maps/route7.blk" -Route7Blocks: ; 48051 (12:4051) - INCBIN "maps/route7.blk" - -CeladonPokecenterBlocks: ; 480ab (12:40ab) -RockTunnelPokecenterBlocks: ; 480ab (12:40ab) -MtMoonPokecenterBlocks: ; 480ab (12:40ab) - INCBIN "maps/mtmoonpokecenter.blk" +CeladonPokecenterBlocks: +RockTunnelPokecenterBlocks: +MtMoonPokecenterBlocks: INCBIN "maps/mtmoonpokecenter.blk" -Route18GateBlocks: ; 480c7 (12:40c7) -Route15GateBlocks: ; 480c7 (12:40c7) -Route11GateBlocks: ; 480c7 (12:40c7) - INCBIN "maps/route11gate.blk" +Route18GateBlocks: +Route15GateBlocks: +Route11GateBlocks: INCBIN "maps/route11gate.blk" -Route18GateUpstairsBlocks: ; 480db (12:40db) -Route16GateUpstairsBlocks: ; 480db (12:40db) -Route12GateUpstairsBlocks: ; 480db (12:40db) -Route15GateUpstairsBlocks: ; 480db (12:40db) -Route11GateUpstairsBlocks: ; 480db (12:40db) - INCBIN "maps/route11gateupstairs.blk" +Route18GateUpstairsBlocks: +Route16GateUpstairsBlocks: +Route12GateUpstairsBlocks: +Route15GateUpstairsBlocks: +Route11GateUpstairsBlocks: INCBIN "maps/route11gateupstairs.blk" INCLUDE "engine/predefs12.asm" INCLUDE "scripts/route7.asm" INCLUDE "data/mapHeaders/redshouse1f.asm" - INCLUDE "scripts/redshouse1f.asm" - INCLUDE "data/mapObjects/redshouse1f.asm" - -RedsHouse1FBlocks: ; 48209 (12:4209) - INCBIN "maps/redshouse1f.blk" +RedsHouse1FBlocks: INCBIN "maps/redshouse1f.blk" INCLUDE "data/mapHeaders/celadonmart3.asm" - INCLUDE "scripts/celadonmart3.asm" - INCLUDE "data/mapObjects/celadonmart3.asm" - -CeladonMart3Blocks: ; 48322 (12:4322) - INCBIN "maps/celadonmart3.blk" +CeladonMart3Blocks: INCBIN "maps/celadonmart3.blk" INCLUDE "data/mapHeaders/celadonmart4.asm" - INCLUDE "scripts/celadonmart4.asm" - INCLUDE "data/mapObjects/celadonmart4.asm" - -CeladonMart4Blocks: ; 483a1 (12:43a1) - INCBIN "maps/celadonmart4.blk" +CeladonMart4Blocks: INCBIN "maps/celadonmart4.blk" INCLUDE "data/mapHeaders/celadonmartroof.asm" - INCLUDE "scripts/celadonmartroof.asm" - INCLUDE "data/mapObjects/celadonmartroof.asm" - -CeladonMartRoofBlocks: ; 485cc (12:45cc) - INCBIN "maps/celadonmartroof.blk" +CeladonMartRoofBlocks: INCBIN "maps/celadonmartroof.blk" INCLUDE "data/mapHeaders/celadonmartelevator.asm" - INCLUDE "scripts/celadonmartelevator.asm" - INCLUDE "data/mapObjects/celadonmartelevator.asm" - -CeladonMartElevatorBlocks: ; 48684 (12:4684) - INCBIN "maps/celadonmartelevator.blk" +CeladonMartElevatorBlocks: INCBIN "maps/celadonmartelevator.blk" INCLUDE "data/mapHeaders/celadonmansion1.asm" - INCLUDE "scripts/celadonmansion1.asm" - INCLUDE "data/mapObjects/celadonmansion1.asm" - -CeladonMansion1Blocks: ; 48716 (12:4716) - INCBIN "maps/celadonmansion1.blk" +CeladonMansion1Blocks: INCBIN "maps/celadonmansion1.blk" INCLUDE "data/mapHeaders/celadonmansion2.asm" - INCLUDE "scripts/celadonmansion2.asm" - INCLUDE "data/mapObjects/celadonmansion2.asm" - -CeladonMansion2Blocks: ; 4876c (12:476c) - INCBIN "maps/celadonmansion2.blk" +CeladonMansion2Blocks: INCBIN "maps/celadonmansion2.blk" INCLUDE "data/mapHeaders/celadonmansion3.asm" - INCLUDE "scripts/celadonmansion3.asm" - INCLUDE "data/mapObjects/celadonmansion3.asm" - -CeladonMansion3Blocks: ; 48847 (12:4847) - INCBIN "maps/celadonmansion3.blk" +CeladonMansion3Blocks: INCBIN "maps/celadonmansion3.blk" INCLUDE "data/mapHeaders/celadonmansion4.asm" - INCLUDE "scripts/celadonmansion4.asm" - INCLUDE "data/mapObjects/celadonmansion4.asm" - -CeladonMansion4Blocks: ; 48894 (12:4894) - INCBIN "maps/celadonmansion4.blk" +CeladonMansion4Blocks: INCBIN "maps/celadonmansion4.blk" INCLUDE "data/mapHeaders/celadonpokecenter.asm" - INCLUDE "scripts/celadonpokecenter.asm" - INCLUDE "data/mapObjects/celadonpokecenter.asm" INCLUDE "data/mapHeaders/celadongym.asm" - INCLUDE "scripts/celadongym.asm" - INCLUDE "data/mapObjects/celadongym.asm" - -CeladonGymBlocks: ; 48b84 (12:4b84) - INCBIN "maps/celadongym.blk" +CeladonGymBlocks: INCBIN "maps/celadongym.blk" INCLUDE "data/mapHeaders/celadongamecorner.asm" - INCLUDE "scripts/celadongamecorner.asm" - INCLUDE "data/mapObjects/celadongamecorner.asm" - -CeladonGameCornerBlocks: ; 49003 (12:5003) - INCBIN "maps/celadongamecorner.blk" +CeladonGameCornerBlocks: INCBIN "maps/celadongamecorner.blk" INCLUDE "data/mapHeaders/celadonmart5.asm" - INCLUDE "scripts/celadonmart5.asm" - INCLUDE "data/mapObjects/celadonmart5.asm" - -CeladonMart5Blocks: ; 490bc (12:50bc) - INCBIN "maps/celadonmart5.blk" +CeladonMart5Blocks: INCBIN "maps/celadonmart5.blk" INCLUDE "data/mapHeaders/celadonprizeroom.asm" - INCLUDE "scripts/celadonprizeroom.asm" - INCLUDE "data/mapObjects/celadonprizeroom.asm" - -CeladonPrizeRoomBlocks: ; 49131 (12:5131) - INCBIN "maps/celadonprizeroom.blk" +CeladonPrizeRoomBlocks: INCBIN "maps/celadonprizeroom.blk" INCLUDE "data/mapHeaders/celadondiner.asm" - INCLUDE "scripts/celadondiner.asm" - INCLUDE "data/mapObjects/celadondiner.asm" - -CeladonDinerBlocks: ; 491ee (12:51ee) - INCBIN "maps/celadondiner.blk" +CeladonDinerBlocks: INCBIN "maps/celadondiner.blk" INCLUDE "data/mapHeaders/celadonhouse.asm" - INCLUDE "scripts/celadonhouse.asm" - INCLUDE "data/mapObjects/celadonhouse.asm" - -CeladonHouseBlocks: ; 4924d (12:524d) - INCBIN "maps/celadonhouse.blk" +CeladonHouseBlocks: INCBIN "maps/celadonhouse.blk" INCLUDE "data/mapHeaders/celadonhotel.asm" - INCLUDE "scripts/celadonhotel.asm" - INCLUDE "data/mapObjects/celadonhotel.asm" - -CeladonHotelBlocks: ; 492a7 (12:52a7) - INCBIN "maps/celadonhotel.blk" +CeladonHotelBlocks: INCBIN "maps/celadonhotel.blk" INCLUDE "data/mapHeaders/mtmoonpokecenter.asm" - INCLUDE "scripts/mtmoonpokecenter.asm" - INCLUDE "data/mapObjects/mtmoonpokecenter.asm" INCLUDE "data/mapHeaders/rocktunnelpokecenter.asm" - INCLUDE "scripts/rocktunnelpokecenter.asm" - INCLUDE "data/mapObjects/rocktunnelpokecenter.asm" INCLUDE "data/mapHeaders/route11gate.asm" - INCLUDE "scripts/route11gate.asm" - INCLUDE "data/mapObjects/route11gate.asm" INCLUDE "data/mapHeaders/route11gateupstairs.asm" - INCLUDE "scripts/route11gateupstairs.asm" - INCLUDE "data/mapObjects/route11gateupstairs.asm" INCLUDE "data/mapHeaders/route12gate.asm" - INCLUDE "scripts/route12gate.asm" - INCLUDE "data/mapObjects/route12gate.asm" - -Route12GateBlocks: ; 49540 (12:5540) - INCBIN "maps/route12gate.blk" +Route12GateBlocks: INCBIN "maps/route12gate.blk" INCLUDE "data/mapHeaders/route12gateupstairs.asm" - INCLUDE "scripts/route12gateupstairs.asm" - INCLUDE "data/mapObjects/route12gateupstairs.asm" INCLUDE "data/mapHeaders/route15gate.asm" - INCLUDE "scripts/route15gate.asm" - INCLUDE "data/mapObjects/route15gate.asm" INCLUDE "data/mapHeaders/route15gateupstairs.asm" - INCLUDE "scripts/route15gateupstairs.asm" - INCLUDE "data/mapObjects/route15gateupstairs.asm" INCLUDE "data/mapHeaders/route16gate.asm" - INCLUDE "scripts/route16gate.asm" - INCLUDE "data/mapObjects/route16gate.asm" - -Route16GateBlocks: ; 497e3 (12:57e3) - INCBIN "maps/route16gate.blk" +Route16GateBlocks: INCBIN "maps/route16gate.blk" INCLUDE "data/mapHeaders/route16gateupstairs.asm" - INCLUDE "scripts/route16gateupstairs.asm" - INCLUDE "data/mapObjects/route16gateupstairs.asm" INCLUDE "data/mapHeaders/route18gate.asm" - INCLUDE "scripts/route18gate.asm" - INCLUDE "data/mapObjects/route18gate.asm" INCLUDE "data/mapHeaders/route18gateupstairs.asm" - INCLUDE "scripts/route18gateupstairs.asm" - INCLUDE "data/mapObjects/route18gateupstairs.asm" INCLUDE "data/mapHeaders/mtmoon1.asm" - INCLUDE "scripts/mtmoon1.asm" - INCLUDE "data/mapObjects/mtmoon1.asm" - -MtMoon1Blocks: ; 49b97 (12:5b97) - INCBIN "maps/mtmoon1.blk" +MtMoon1Blocks: INCBIN "maps/mtmoon1.blk" INCLUDE "data/mapHeaders/mtmoon3.asm" - INCLUDE "scripts/mtmoon3.asm" - INCLUDE "data/mapObjects/mtmoon3.asm" - -MtMoon3Blocks: ; 4a041 (12:6041) - INCBIN "maps/mtmoon3.blk" +MtMoon3Blocks: INCBIN "maps/mtmoon3.blk" INCLUDE "data/mapHeaders/safarizonewest.asm" - INCLUDE "scripts/safarizonewest.asm" - INCLUDE "data/mapObjects/safarizonewest.asm" - -SafariZoneWestBlocks: ; 4a248 (12:6248) - INCBIN "maps/safarizonewest.blk" +SafariZoneWestBlocks: INCBIN "maps/safarizonewest.blk" INCLUDE "data/mapHeaders/safarizonesecrethouse.asm" - INCLUDE "scripts/safarizonesecrethouse.asm" - INCLUDE "data/mapObjects/safarizonesecrethouse.asm" +SafariZoneSecretHouseBlocks: INCBIN "maps/safarizonesecrethouse.blk" -SafariZoneSecretHouseBlocks: ; 4a37f (12:637f) - INCBIN "maps/safarizonesecrethouse.blk" SECTION "bank13",ROMX,BANK[$13] -TrainerPics: - -YoungsterPic: ; 4c000 (13:4000) - INCBIN "pic/trainer/youngster.pic" -BugCatcherPic: ; 4c0c6 (13:40c6) - INCBIN "pic/trainer/bugcatcher.pic" -LassPic: ; 4c200 (13:4200) - INCBIN "pic/trainer/lass.pic" -SailorPic: ; 4c2db (13:42db) - INCBIN "pic/trainer/sailor.pic" -JrTrainerMPic: ; 4c450 (13:4450) - INCBIN "pic/trainer/jr.trainerm.pic" -JrTrainerFPic: ; 4c588 (13:4588) - INCBIN "pic/trainer/jr.trainerf.pic" -PokemaniacPic: ; 4c6c9 (13:46c9) - INCBIN "pic/trainer/pokemaniac.pic" -SuperNerdPic: ; 4c7f1 (13:47f1) - INCBIN "pic/trainer/supernerd.pic" -HikerPic: ; 4c8e7 (13:48e7) - INCBIN "pic/trainer/hiker.pic" -BikerPic: ; 4cabe (13:4abe) - INCBIN "pic/trainer/biker.pic" -BurglarPic: ; 4cc91 (13:4c91) - INCBIN "pic/trainer/burglar.pic" -EngineerPic: ; 4ce0a (13:4e0a) - INCBIN "pic/trainer/engineer.pic" -FisherPic: ; 4cf87 (13:4f87) - INCBIN "pic/trainer/fisher.pic" -SwimmerPic: ; 4d133 (13:5133) - INCBIN "pic/trainer/swimmer.pic" -CueBallPic: ; 4d24f (13:524f) - INCBIN "pic/trainer/cueball.pic" -GamblerPic: ; 4d421 (13:5421) - INCBIN "pic/trainer/gambler.pic" -BeautyPic: ; 4d5df (13:55df) - INCBIN "pic/trainer/beauty.pic" -PsychicPic: ; 4d728 (13:5728) - INCBIN "pic/trainer/psychic.pic" -RockerPic: ; 4d843 (13:5843) - INCBIN "pic/trainer/rocker.pic" -JugglerPic: ; 4d97d (13:597d) - INCBIN "pic/trainer/juggler.pic" -TamerPic: ; 4db4e (13:5b4e) - INCBIN "pic/trainer/tamer.pic" -BirdKeeperPic: ; 4dcdb (13:5cdb) - INCBIN "pic/trainer/birdkeeper.pic" -BlackbeltPic: ; 4de76 (13:5e76) - INCBIN "pic/trainer/blackbelt.pic" -Rival1Pic: ; 4e049 (13:6049) - INCBIN "pic/trainer/rival1.pic" -ProfOakPic: ; 4e15f (13:615f) - INCBIN "pic/trainer/prof.oak.pic" -ChiefPic: ; 4e27d (13:627d) -ScientistPic: ; 4e27d (13:627d) - INCBIN "pic/trainer/scientist.pic" -GiovanniPic: ; 4e3be (13:63be) - INCBIN "pic/trainer/giovanni.pic" -RocketPic: ; 4e49f (13:649f) - INCBIN "pic/trainer/rocket.pic" -CooltrainerMPic: ; 4e635 (13:6635) - INCBIN "pic/trainer/cooltrainerm.pic" -CooltrainerFPic: ; 4e7be (13:67be) - INCBIN "pic/trainer/cooltrainerf.pic" -BrunoPic: ; 4e943 (13:6943) - INCBIN "pic/trainer/bruno.pic" -BrockPic: ; 4eb3e (13:6b3e) - INCBIN "pic/trainer/brock.pic" -MistyPic: ; 4ec40 (13:6c40) - INCBIN "pic/trainer/misty.pic" -LtSurgePic: ; 4ed30 (13:6d30) - INCBIN "pic/trainer/lt.surge.pic" -ErikaPic: ; 4eeb5 (13:6eb5) - INCBIN "pic/trainer/erika.pic" -KogaPic: ; 4efd6 (13:6fd6) - INCBIN "pic/trainer/koga.pic" -BlainePic: ; 4f150 (13:7150) - INCBIN "pic/trainer/blaine.pic" -SabrinaPic: ; 4f252 (13:7252) - INCBIN "pic/trainer/sabrina.pic" -GentlemanPic: ; 4f3d0 (13:73d0) - INCBIN "pic/trainer/gentleman.pic" -Rival2Pic: ; 4f4cf (13:74cf) - INCBIN "pic/trainer/rival2.pic" -Rival3Pic: ; 4f623 (13:7623) - INCBIN "pic/trainer/rival3.pic" -LoreleiPic: ; 4f779 (13:7779) - INCBIN "pic/trainer/lorelei.pic" -ChannelerPic: ; 4f8a4 (13:78a4) - INCBIN "pic/trainer/channeler.pic" -AgathaPic: ; 4fa71 (13:7a71) - INCBIN "pic/trainer/agatha.pic" -LancePic: ; 4fba2 (13:7ba2) - INCBIN "pic/trainer/lance.pic" +TrainerPics:: +YoungsterPic:: INCBIN "pic/trainer/youngster.pic" +BugCatcherPic:: INCBIN "pic/trainer/bugcatcher.pic" +LassPic:: INCBIN "pic/trainer/lass.pic" +SailorPic:: INCBIN "pic/trainer/sailor.pic" +JrTrainerMPic:: INCBIN "pic/trainer/jr.trainerm.pic" +JrTrainerFPic:: INCBIN "pic/trainer/jr.trainerf.pic" +PokemaniacPic:: INCBIN "pic/trainer/pokemaniac.pic" +SuperNerdPic:: INCBIN "pic/trainer/supernerd.pic" +HikerPic:: INCBIN "pic/trainer/hiker.pic" +BikerPic:: INCBIN "pic/trainer/biker.pic" +BurglarPic:: INCBIN "pic/trainer/burglar.pic" +EngineerPic:: INCBIN "pic/trainer/engineer.pic" +FisherPic:: INCBIN "pic/trainer/fisher.pic" +SwimmerPic:: INCBIN "pic/trainer/swimmer.pic" +CueBallPic:: INCBIN "pic/trainer/cueball.pic" +GamblerPic:: INCBIN "pic/trainer/gambler.pic" +BeautyPic:: INCBIN "pic/trainer/beauty.pic" +PsychicPic:: INCBIN "pic/trainer/psychic.pic" +RockerPic:: INCBIN "pic/trainer/rocker.pic" +JugglerPic:: INCBIN "pic/trainer/juggler.pic" +TamerPic:: INCBIN "pic/trainer/tamer.pic" +BirdKeeperPic:: INCBIN "pic/trainer/birdkeeper.pic" +BlackbeltPic:: INCBIN "pic/trainer/blackbelt.pic" +Rival1Pic:: INCBIN "pic/trainer/rival1.pic" +ProfOakPic:: INCBIN "pic/trainer/prof.oak.pic" +ChiefPic:: +ScientistPic:: INCBIN "pic/trainer/scientist.pic" +GiovanniPic:: INCBIN "pic/trainer/giovanni.pic" +RocketPic:: INCBIN "pic/trainer/rocket.pic" +CooltrainerMPic:: INCBIN "pic/trainer/cooltrainerm.pic" +CooltrainerFPic:: INCBIN "pic/trainer/cooltrainerf.pic" +BrunoPic:: INCBIN "pic/trainer/bruno.pic" +BrockPic:: INCBIN "pic/trainer/brock.pic" +MistyPic:: INCBIN "pic/trainer/misty.pic" +LtSurgePic:: INCBIN "pic/trainer/lt.surge.pic" +ErikaPic:: INCBIN "pic/trainer/erika.pic" +KogaPic:: INCBIN "pic/trainer/koga.pic" +BlainePic:: INCBIN "pic/trainer/blaine.pic" +SabrinaPic:: INCBIN "pic/trainer/sabrina.pic" +GentlemanPic:: INCBIN "pic/trainer/gentleman.pic" +Rival2Pic:: INCBIN "pic/trainer/rival2.pic" +Rival3Pic:: INCBIN "pic/trainer/rival3.pic" +LoreleiPic:: INCBIN "pic/trainer/lorelei.pic" +ChannelerPic:: INCBIN "pic/trainer/channeler.pic" +AgathaPic:: INCBIN "pic/trainer/agatha.pic" +LancePic:: INCBIN "pic/trainer/lance.pic" INCLUDE "data/mapHeaders/battlecenterm.asm" - INCLUDE "scripts/battlecenterm.asm" - INCLUDE "data/mapObjects/battlecenterm.asm" - -BattleCenterMBlocks: ; 4fd5d (13:7d5d) - INCBIN "maps/battlecenterm.blk" +BattleCenterMBlocks: INCBIN "maps/battlecenterm.blk" INCLUDE "data/mapHeaders/tradecenterm.asm" - INCLUDE "scripts/tradecenterm.asm" - INCLUDE "data/mapObjects/tradecenterm.asm" - -TradeCenterMBlocks: ; 4fd91 (13:7d91) - INCBIN "maps/tradecenterm.blk" +TradeCenterMBlocks: INCBIN "maps/tradecenterm.blk" INCLUDE "engine/give_pokemon.asm" INCLUDE "engine/predefs.asm" + SECTION "bank14",ROMX,BANK[$14] INCLUDE "data/mapHeaders/route22.asm" - INCLUDE "data/mapObjects/route22.asm" - -Route22Blocks: ; 5003d (14:403d) - INCBIN "maps/route22.blk" +Route22Blocks: INCBIN "maps/route22.blk" INCLUDE "data/mapHeaders/route20.asm" - INCLUDE "data/mapObjects/route20.asm" - -Route20Blocks: ; 5017d (14:417d) - INCBIN "maps/route20.blk" +Route20Blocks: INCBIN "maps/route20.blk" INCLUDE "data/mapHeaders/route23.asm" - INCLUDE "data/mapObjects/route23.asm" - -Route23Blocks: ; 503b2 (14:43b2) - INCBIN "maps/route23.blk" +Route23Blocks: INCBIN "maps/route23.blk" INCLUDE "data/mapHeaders/route24.asm" - INCLUDE "data/mapObjects/route24.asm" - -Route24Blocks: ; 506e7 (14:46e7) - INCBIN "maps/route24.blk" +Route24Blocks: INCBIN "maps/route24.blk" INCLUDE "data/mapHeaders/route25.asm" - INCLUDE "data/mapObjects/route25.asm" - -Route25Blocks: ; 50810 (14:4810) - INCBIN "maps/route25.blk" +Route25Blocks: INCBIN "maps/route25.blk" INCLUDE "data/mapHeaders/indigoplateau.asm" - INCLUDE "scripts/indigoplateau.asm" - INCLUDE "data/mapObjects/indigoplateau.asm" - -IndigoPlateauBlocks: ; 5094a (14:494a) - INCBIN "maps/indigoplateau.blk" +IndigoPlateauBlocks: INCBIN "maps/indigoplateau.blk" INCLUDE "data/mapHeaders/saffroncity.asm" - INCLUDE "data/mapObjects/saffroncity.asm" - -SaffronCityBlocks: ; 50a98 (14:4a98) - INCBIN "maps/saffroncity.blk" - +SaffronCityBlocks: INCBIN "maps/saffroncity.blk" INCLUDE "scripts/saffroncity.asm" INCLUDE "scripts/route20.asm" - INCLUDE "scripts/route22.asm" - INCLUDE "scripts/route23.asm" - INCLUDE "scripts/route24.asm" - INCLUDE "scripts/route25.asm" INCLUDE "data/mapHeaders/victoryroad2.asm" - INCLUDE "scripts/victoryroad2.asm" - INCLUDE "data/mapObjects/victoryroad2.asm" - -VictoryRoad2Blocks: ; 519af (14:59af) - INCBIN "maps/victoryroad2.blk" +VictoryRoad2Blocks: INCBIN "maps/victoryroad2.blk" INCLUDE "data/mapHeaders/mtmoon2.asm" - INCLUDE "scripts/mtmoon2.asm" - INCLUDE "data/mapObjects/mtmoon2.asm" - -MtMoon2Blocks: ; 51a91 (14:5a91) - INCBIN "maps/mtmoon2.blk" +MtMoon2Blocks: INCBIN "maps/mtmoon2.blk" INCLUDE "data/mapHeaders/silphco7.asm" - INCLUDE "scripts/silphco7.asm" - INCLUDE "data/mapObjects/silphco7.asm" - -SilphCo7Blocks: ; 51f57 (14:5f57) - INCBIN "maps/silphco7.blk" +SilphCo7Blocks: INCBIN "maps/silphco7.blk" INCLUDE "data/mapHeaders/mansion2.asm" - INCLUDE "scripts/mansion2.asm" - INCLUDE "data/mapObjects/mansion2.asm" - -Mansion2Blocks: ; 52110 (14:6110) - INCBIN "maps/mansion2.blk" +Mansion2Blocks: INCBIN "maps/mansion2.blk" INCLUDE "data/mapHeaders/mansion3.asm" - INCLUDE "scripts/mansion3.asm" - INCLUDE "data/mapObjects/mansion3.asm" - -Mansion3Blocks: ; 52326 (14:6326) - INCBIN "maps/mansion3.blk" +Mansion3Blocks: INCBIN "maps/mansion3.blk" INCLUDE "data/mapHeaders/mansion4.asm" - INCLUDE "scripts/mansion4.asm" - INCLUDE "data/mapObjects/mansion4.asm" - -Mansion4Blocks: ; 524dd (14:64dd) - INCBIN "maps/mansion4.blk" +Mansion4Blocks: INCBIN "maps/mansion4.blk" INCLUDE "engine/battle/14.asm" @@ -17914,211 +5811,132 @@ INCLUDE "engine/menu/prize_menu.asm" INCLUDE "engine/hidden_object_functions14.asm" + SECTION "bank15",ROMX,BANK[$15] INCLUDE "data/mapHeaders/route2.asm" - INCLUDE "data/mapObjects/route2.asm" - -Route2Blocks: ; 5407e (15:407e) - INCBIN "maps/route2.blk" +Route2Blocks: INCBIN "maps/route2.blk" INCLUDE "data/mapHeaders/route3.asm" - INCLUDE "data/mapObjects/route3.asm" - -Route3Blocks: ; 54255 (15:4255) - INCBIN "maps/route3.blk" +Route3Blocks: INCBIN "maps/route3.blk" INCLUDE "data/mapHeaders/route4.asm" - INCLUDE "data/mapObjects/route4.asm" - -Route4Blocks: ; 543ec (15:43ec) - INCBIN "maps/route4.blk" +Route4Blocks: INCBIN "maps/route4.blk" INCLUDE "data/mapHeaders/route5.asm" - INCLUDE "data/mapObjects/route5.asm" - -Route5Blocks: ; 545d2 (15:45d2) - INCBIN "maps/route5.blk" +Route5Blocks: INCBIN "maps/route5.blk" INCLUDE "data/mapHeaders/route9.asm" - INCLUDE "data/mapObjects/route9.asm" - -Route9Blocks: ; 546fe (15:46fe) - INCBIN "maps/route9.blk" +Route9Blocks: INCBIN "maps/route9.blk" INCLUDE "data/mapHeaders/route13.asm" - INCLUDE "data/mapObjects/route13.asm" - -Route13Blocks: ; 5488b (15:488b) - INCBIN "maps/route13.blk" +Route13Blocks: INCBIN "maps/route13.blk" INCLUDE "data/mapHeaders/route14.asm" - INCLUDE "data/mapObjects/route14.asm" - -Route14Blocks: ; 54a12 (15:4a12) - INCBIN "maps/route14.blk" +Route14Blocks: INCBIN "maps/route14.blk" INCLUDE "data/mapHeaders/route17.asm" - INCLUDE "data/mapObjects/route17.asm" - -Route17Blocks: ; 54ba8 (15:4ba8) - INCBIN "maps/route17.blk" +Route17Blocks: INCBIN "maps/route17.blk" INCLUDE "data/mapHeaders/route19.asm" - INCLUDE "data/mapObjects/route19.asm" - -Route19Blocks: ; 54ef1 (15:4ef1) - INCBIN "maps/route19.blk" +Route19Blocks: INCBIN "maps/route19.blk" INCLUDE "data/mapHeaders/route21.asm" - INCLUDE "data/mapObjects/route21.asm" +Route21Blocks: INCBIN "maps/route21.blk" -Route21Blocks: ; 5506d (15:506d) - INCBIN "maps/route21.blk" +VermilionHouse2Blocks: +Route12HouseBlocks: +DayCareMBlocks: INCBIN "maps/daycarem.blk" -VermilionHouse2Blocks: ; 5522f (15:522f) -Route12HouseBlocks: ; 5522f (15:522f) -DayCareMBlocks: ; 5522f (15:522f) - INCBIN "maps/daycarem.blk" - -FuchsiaHouse3Blocks: ; 5523f (15:523f) - INCBIN "maps/fuchsiahouse3.blk" +FuchsiaHouse3Blocks: INCBIN "maps/fuchsiahouse3.blk" INCLUDE "engine/battle/15.asm" INCLUDE "scripts/route2.asm" - INCLUDE "scripts/route3.asm" - INCLUDE "scripts/route4.asm" - INCLUDE "scripts/route5.asm" - INCLUDE "scripts/route9.asm" - INCLUDE "scripts/route13.asm" - INCLUDE "scripts/route14.asm" - INCLUDE "scripts/route17.asm" - INCLUDE "scripts/route19.asm" - INCLUDE "scripts/route21.asm" INCLUDE "data/mapHeaders/vermilionhouse2.asm" - INCLUDE "scripts/vermilionhouse2.asm" - INCLUDE "data/mapObjects/vermilionhouse2.asm" INCLUDE "data/mapHeaders/celadonmart2.asm" - INCLUDE "scripts/celadonmart2.asm" - INCLUDE "data/mapObjects/celadonmart2.asm" - -CeladonMart2Blocks: ; 56148 (15:6148) - INCBIN "maps/celadonmart2.blk" +CeladonMart2Blocks: INCBIN "maps/celadonmart2.blk" INCLUDE "data/mapHeaders/fuchsiahouse3.asm" - INCLUDE "scripts/fuchsiahouse3.asm" - INCLUDE "data/mapObjects/fuchsiahouse3.asm" INCLUDE "data/mapHeaders/daycarem.asm" - INCLUDE "scripts/daycarem.asm" - INCLUDE "data/mapObjects/daycarem.asm" INCLUDE "data/mapHeaders/route12house.asm" - INCLUDE "scripts/route12house.asm" - INCLUDE "data/mapObjects/route12house.asm" INCLUDE "data/mapHeaders/silphco8.asm" - INCLUDE "scripts/silphco8.asm" - INCLUDE "data/mapObjects/silphco8.asm" - -SilphCo8Blocks: ; 5666d (15:666d) - INCBIN "maps/silphco8.blk" +SilphCo8Blocks: INCBIN "maps/silphco8.blk" INCLUDE "engine/menu/diploma.asm" INCLUDE "engine/overworld/trainers.asm" + SECTION "bank16",ROMX,BANK[$16] INCLUDE "data/mapHeaders/route6.asm" - INCLUDE "data/mapObjects/route6.asm" - -Route6Blocks: ; 58079 (16:4079) - INCBIN "maps/route6.blk" +Route6Blocks: INCBIN "maps/route6.blk" INCLUDE "data/mapHeaders/route8.asm" - INCLUDE "data/mapObjects/route8.asm" - -Route8Blocks: ; 581c6 (16:41c6) - INCBIN "maps/route8.blk" +Route8Blocks: INCBIN "maps/route8.blk" INCLUDE "data/mapHeaders/route10.asm" - INCLUDE "data/mapObjects/route10.asm" - -Route10Blocks: ; 58356 (16:4356) - INCBIN "maps/route10.blk" +Route10Blocks: INCBIN "maps/route10.blk" INCLUDE "data/mapHeaders/route11.asm" - INCLUDE "data/mapObjects/route11.asm" - -Route11Blocks: ; 5855f (16:455f) - INCBIN "maps/route11.blk" +Route11Blocks: INCBIN "maps/route11.blk" INCLUDE "data/mapHeaders/route12.asm" - INCLUDE "data/mapObjects/route12.asm" - -Route12Blocks: ; 58710 (16:4710) - INCBIN "maps/route12.blk" +Route12Blocks: INCBIN "maps/route12.blk" INCLUDE "data/mapHeaders/route15.asm" - INCLUDE "data/mapObjects/route15.asm" - -Route15Blocks: ; 589cc (16:49cc) - INCBIN "maps/route15.blk" +Route15Blocks: INCBIN "maps/route15.blk" INCLUDE "data/mapHeaders/route16.asm" - INCLUDE "data/mapObjects/route16.asm" - -Route16Blocks: ; 58b84 (16:4b84) - INCBIN "maps/route16.blk" +Route16Blocks: INCBIN "maps/route16.blk" INCLUDE "data/mapHeaders/route18.asm" - INCLUDE "data/mapObjects/route18.asm" - -Route18Blocks: ; 58c9c (16:4c9c) - INCBIN "maps/route18.blk" +Route18Blocks: INCBIN "maps/route18.blk" INCBIN "maps/unusedblocks58d7d.blk" @@ -18129,666 +5947,434 @@ INCLUDE "engine/experience.asm" INCLUDE "engine/overworld/oaks_aide.asm" INCLUDE "scripts/route6.asm" - INCLUDE "scripts/route8.asm" - INCLUDE "scripts/route10.asm" - INCLUDE "scripts/route11.asm" - INCLUDE "scripts/route12.asm" - INCLUDE "scripts/route15.asm" - INCLUDE "scripts/route16.asm" - INCLUDE "scripts/route18.asm" INCLUDE "data/mapHeaders/fanclub.asm" - INCLUDE "scripts/fanclub.asm" - INCLUDE "data/mapObjects/fanclub.asm" - -FanClubBlocks: ; 59cd5 (16:5cd5) +FanClubBlocks: INCBIN "maps/fanclub.blk" INCLUDE "data/mapHeaders/silphco2.asm" - INCLUDE "scripts/silphco2.asm" - INCLUDE "data/mapObjects/silphco2.asm" - -SilphCo2Blocks: ; 59ec8 (16:5ec8) +SilphCo2Blocks: INCBIN "maps/silphco2.blk" INCLUDE "data/mapHeaders/silphco3.asm" - INCLUDE "scripts/silphco3.asm" - INCLUDE "data/mapObjects/silphco3.asm" - -SilphCo3Blocks: ; 5a0a6 (16:60a6) +SilphCo3Blocks: INCBIN "maps/silphco3.blk" INCLUDE "data/mapHeaders/silphco10.asm" - INCLUDE "scripts/silphco10.asm" - INCLUDE "data/mapObjects/silphco10.asm" - -SilphCo10Blocks: ; 5a25a (16:625a) +SilphCo10Blocks: INCBIN "maps/silphco10.blk" INCLUDE "data/mapHeaders/lance.asm" - INCLUDE "scripts/lance.asm" - INCLUDE "data/mapObjects/lance.asm" - -LanceBlocks: ; 5a3e9 (16:63e9) +LanceBlocks: INCBIN "maps/lance.blk" INCLUDE "data/mapHeaders/halloffameroom.asm" - INCLUDE "scripts/halloffameroom.asm" - INCLUDE "data/mapObjects/halloffameroom.asm" - -HallofFameRoomBlocks: ; 5a58b (16:658b) +HallofFameRoomBlocks: INCBIN "maps/halloffameroom.blk" INCLUDE "engine/overworld/saffron_guards.asm" + SECTION "bank17",ROMX,BANK[$17] -SaffronMartBlocks: ; 5c000 (17:4000) -LavenderMartBlocks: ; 5c000 (17:4000) -CeruleanMartBlocks: ; 5c000 (17:4000) -VermilionMartBlocks: ; 5c000 (17:4000) - INCBIN "maps/vermilionmart.blk" +SaffronMartBlocks: +LavenderMartBlocks: +CeruleanMartBlocks: +VermilionMartBlocks: INCBIN "maps/vermilionmart.blk" -CopycatsHouse2FBlocks: ; 5c010 (17:4010) -RedsHouse2FBlocks: ; 0x5c010 16? - INCBIN "maps/redshouse2f.blk" +CopycatsHouse2FBlocks: +RedsHouse2FBlocks: INCBIN "maps/redshouse2f.blk" -Museum1FBlocks: ; 5c020 (17:4020) - INCBIN "maps/museum1f.blk" +Museum1FBlocks: INCBIN "maps/museum1f.blk" -Museum2FBlocks: ; 5c048 (17:4048) - INCBIN "maps/museum2f.blk" +Museum2FBlocks: INCBIN "maps/museum2f.blk" -SaffronPokecenterBlocks: ; 5c064 (17:4064) -VermilionPokecenterBlocks: ; 5c064 (17:4064) -LavenderPokecenterBlocks: ; 5c064 (17:4064) -PewterPokecenterBlocks: ; 5c064 (17:4064) - INCBIN "maps/pewterpokecenter.blk" +SaffronPokecenterBlocks: +VermilionPokecenterBlocks: +LavenderPokecenterBlocks: +PewterPokecenterBlocks: INCBIN "maps/pewterpokecenter.blk" -UndergroundPathEntranceRoute7Blocks: ; 5c080 (17:4080) -UndergroundPathEntranceRoute7CopyBlocks: ; 5c080 (17:4080) -UndergroundPathEntranceRoute6Blocks: ; 5c080 (17:4080) -UndergroundPathEntranceRoute5Blocks: ; 5c080 (17:4080) - INCBIN "maps/undergroundpathentranceroute5.blk" +UndergroundPathEntranceRoute7Blocks: +UndergroundPathEntranceRoute7CopyBlocks: +UndergroundPathEntranceRoute6Blocks: +UndergroundPathEntranceRoute5Blocks: INCBIN "maps/undergroundpathentranceroute5.blk" -Route2GateBlocks: ; 5c090 (17:4090) -ViridianForestEntranceBlocks: ; 5c090 (17:4090) -ViridianForestExitBlocks: ; 5c090 (17:4090) - INCBIN "maps/viridianforestexit.blk" +Route2GateBlocks: +ViridianForestEntranceBlocks: +ViridianForestExitBlocks: INCBIN "maps/viridianforestexit.blk" INCLUDE "data/mapHeaders/redshouse2f.asm" - INCLUDE "scripts/redshouse2f.asm" - INCLUDE "data/mapObjects/redshouse2f.asm" INCLUDE "engine/predefs17.asm" INCLUDE "data/mapHeaders/museum1f.asm" - INCLUDE "scripts/museum1f.asm" - INCLUDE "data/mapObjects/museum1f.asm" INCLUDE "data/mapHeaders/museum2f.asm" - INCLUDE "scripts/museum2f.asm" - INCLUDE "data/mapObjects/museum2f.asm" INCLUDE "data/mapHeaders/pewtergym.asm" - INCLUDE "scripts/pewtergym.asm" - INCLUDE "data/mapObjects/pewtergym.asm" - -PewterGymBlocks: ; 5c558 (17:4558) - INCBIN "maps/pewtergym.blk" +PewterGymBlocks: INCBIN "maps/pewtergym.blk" INCLUDE "data/mapHeaders/pewterpokecenter.asm" - INCLUDE "scripts/pewterpokecenter.asm" - INCLUDE "data/mapObjects/pewterpokecenter.asm" INCLUDE "data/mapHeaders/ceruleanpokecenter.asm" - INCLUDE "scripts/ceruleanpokecenter.asm" - INCLUDE "data/mapObjects/ceruleanpokecenter.asm" - -CeruleanPokecenterBlocks: ; 5c68b (17:468b) - INCBIN "maps/ceruleanpokecenter.blk" +CeruleanPokecenterBlocks: INCBIN "maps/ceruleanpokecenter.blk" INCLUDE "data/mapHeaders/ceruleangym.asm" - INCLUDE "scripts/ceruleangym.asm" - INCLUDE "data/mapObjects/ceruleangym.asm" - -CeruleanGymBlocks: ; 5c866 (17:4866) - INCBIN "maps/ceruleangym.blk" +CeruleanGymBlocks: INCBIN "maps/ceruleangym.blk" INCLUDE "data/mapHeaders/ceruleanmart.asm" - INCLUDE "scripts/ceruleanmart.asm" - INCLUDE "data/mapObjects/ceruleanmart.asm" INCLUDE "data/mapHeaders/lavenderpokecenter.asm" - INCLUDE "scripts/lavenderpokecenter.asm" - INCLUDE "data/mapObjects/lavenderpokecenter.asm" INCLUDE "data/mapHeaders/lavendermart.asm" - INCLUDE "scripts/lavendermart.asm" - INCLUDE "data/mapObjects/lavendermart.asm" INCLUDE "data/mapHeaders/vermilionpokecenter.asm" - INCLUDE "scripts/vermilionpokecenter.asm" - INCLUDE "data/mapObjects/vermilionpokecenter.asm" INCLUDE "data/mapHeaders/vermilionmart.asm" - INCLUDE "scripts/vermilionmart.asm" - INCLUDE "data/mapObjects/vermilionmart.asm" INCLUDE "data/mapHeaders/vermiliongym.asm" - INCLUDE "scripts/vermiliongym.asm" - INCLUDE "data/mapObjects/vermiliongym.asm" - -VermilionGymBlocks: ; 5cc38 (17:4c38) - INCBIN "maps/vermiliongym.blk" +VermilionGymBlocks: INCBIN "maps/vermiliongym.blk" INCLUDE "data/mapHeaders/copycatshouse2f.asm" - INCLUDE "scripts/copycatshouse2f.asm" - INCLUDE "data/mapObjects/copycatshouse2f.asm" INCLUDE "data/mapHeaders/fightingdojo.asm" - INCLUDE "scripts/fightingdojo.asm" - INCLUDE "data/mapObjects/fightingdojo.asm" - -FightingDojoBlocks: ; 5cfe3 (17:4fe3) - INCBIN "maps/fightingdojo.blk" +FightingDojoBlocks: INCBIN "maps/fightingdojo.blk" INCLUDE "data/mapHeaders/saffrongym.asm" - INCLUDE "scripts/saffrongym.asm" - INCLUDE "data/mapObjects/saffrongym.asm" - -SaffronGymBlocks: ; 5d3a3 (17:53a3) - INCBIN "maps/saffrongym.blk" +SaffronGymBlocks: INCBIN "maps/saffrongym.blk" INCLUDE "data/mapHeaders/saffronmart.asm" - INCLUDE "scripts/saffronmart.asm" - INCLUDE "data/mapObjects/saffronmart.asm" INCLUDE "data/mapHeaders/silphco1.asm" - INCLUDE "scripts/silphco1.asm" - INCLUDE "data/mapObjects/silphco1.asm" - -SilphCo1Blocks: ; 5d4a2 (17:54a2) - INCBIN "maps/silphco1.blk" +SilphCo1Blocks: INCBIN "maps/silphco1.blk" INCLUDE "data/mapHeaders/saffronpokecenter.asm" - INCLUDE "scripts/saffronpokecenter.asm" - INCLUDE "data/mapObjects/saffronpokecenter.asm" INCLUDE "data/mapHeaders/viridianforestexit.asm" - INCLUDE "scripts/viridianforestexit.asm" - INCLUDE "data/mapObjects/viridianforestexit.asm" INCLUDE "data/mapHeaders/route2gate.asm" - INCLUDE "scripts/route2gate.asm" - INCLUDE "data/mapObjects/route2gate.asm" INCLUDE "data/mapHeaders/viridianforestentrance.asm" - INCLUDE "scripts/viridianforestentrance.asm" - INCLUDE "data/mapObjects/viridianforestentrance.asm" INCLUDE "data/mapHeaders/undergroundpathentranceroute5.asm" - INCLUDE "scripts/undergroundpathentranceroute5.asm" - INCLUDE "data/mapObjects/undergroundpathentranceroute5.asm" INCLUDE "data/mapHeaders/undergroundpathentranceroute6.asm" - INCLUDE "scripts/undergroundpathentranceroute6.asm" - INCLUDE "data/mapObjects/undergroundpathentranceroute6.asm" INCLUDE "data/mapHeaders/undergroundpathentranceroute7.asm" - INCLUDE "scripts/undergroundpathentranceroute7.asm" - INCLUDE "data/mapObjects/undergroundpathentranceroute7.asm" INCLUDE "data/mapHeaders/undergroundpathentranceroute7copy.asm" - INCLUDE "scripts/undergroundpathentranceroute7copy.asm" - INCLUDE "data/mapObjects/undergroundpathentranceroute7copy.asm" INCLUDE "data/mapHeaders/silphco9.asm" - INCLUDE "scripts/silphco9.asm" - INCLUDE "data/mapObjects/silphco9.asm" - -SilphCo9Blocks: ; 5d989 (17:5989) - INCBIN "maps/silphco9.blk" +SilphCo9Blocks: INCBIN "maps/silphco9.blk" INCLUDE "data/mapHeaders/victoryroad1.asm" - INCLUDE "scripts/victoryroad1.asm" - INCLUDE "data/mapObjects/victoryroad1.asm" - -VictoryRoad1Blocks: ; 5db04 (17:5b04) - INCBIN "maps/victoryroad1.blk" +VictoryRoad1Blocks: INCBIN "maps/victoryroad1.blk" INCLUDE "engine/predefs17_2.asm" INCLUDE "engine/hidden_object_functions17.asm" -SECTION "bank18",ROMX,BANK[$18] - -ViridianForestBlocks: ; 60000 (18:4000) - INCBIN "maps/viridianforest.blk" -UndergroundPathNSBlocks: ; 60198 (18:4198) - INCBIN "maps/undergroundpathns.blk" +SECTION "bank18",ROMX,BANK[$18] -UndergroundPathWEBlocks: ; 601f4 (18:41f4) - INCBIN "maps/undergroundpathwe.blk" +ViridianForestBlocks: INCBIN "maps/viridianforest.blk" +UndergroundPathNSBlocks: INCBIN "maps/undergroundpathns.blk" +UndergroundPathWEBlocks: INCBIN "maps/undergroundpathwe.blk" INCBIN "maps/unusedblocks60258.blk" -SSAnne10Blocks: ; 603c0 (18:43c0) -SSAnne9Blocks: ; 603c0 (18:43c0) - INCBIN "maps/ssanne9.blk" +SSAnne10Blocks: +SSAnne9Blocks: INCBIN "maps/ssanne9.blk" INCLUDE "data/mapHeaders/pokemontower1.asm" - INCLUDE "scripts/pokemontower1.asm" - INCLUDE "data/mapObjects/pokemontower1.asm" - -PokemonTower1Blocks: ; 6048c (18:448c) - INCBIN "maps/pokemontower1.blk" +PokemonTower1Blocks: INCBIN "maps/pokemontower1.blk" INCLUDE "data/mapHeaders/pokemontower2.asm" - INCLUDE "scripts/pokemontower2.asm" - INCLUDE "data/mapObjects/pokemontower2.asm" - -PokemonTower2Blocks: ; 60666 (18:4666) - INCBIN "maps/pokemontower2.blk" +PokemonTower2Blocks: INCBIN "maps/pokemontower2.blk" INCLUDE "data/mapHeaders/pokemontower3.asm" - INCLUDE "scripts/pokemontower3.asm" - INCLUDE "data/mapObjects/pokemontower3.asm" - -PokemonTower3Blocks: ; 60790 (18:4790) - INCBIN "maps/pokemontower3.blk" +PokemonTower3Blocks: INCBIN "maps/pokemontower3.blk" INCLUDE "data/mapHeaders/pokemontower4.asm" - INCLUDE "scripts/pokemontower4.asm" - INCLUDE "data/mapObjects/pokemontower4.asm" - -PokemonTower4Blocks: ; 608cc (18:48cc) - INCBIN "maps/pokemontower4.blk" +PokemonTower4Blocks: INCBIN "maps/pokemontower4.blk" INCLUDE "data/mapHeaders/pokemontower5.asm" - INCLUDE "scripts/pokemontower5.asm" - INCLUDE "data/mapObjects/pokemontower5.asm" - -PokemonTower5Blocks: ; 60a89 (18:4a89) - INCBIN "maps/pokemontower5.blk" +PokemonTower5Blocks: INCBIN "maps/pokemontower5.blk" INCLUDE "data/mapHeaders/pokemontower6.asm" - INCLUDE "scripts/pokemontower6.asm" - INCLUDE "data/mapObjects/pokemontower6.asm" - -PokemonTower6Blocks: ; 60c95 (18:4c95) - INCBIN "maps/pokemontower6.blk" +PokemonTower6Blocks: INCBIN "maps/pokemontower6.blk" INCBIN "maps/unusedblocks60cef.blk" INCLUDE "data/mapHeaders/pokemontower7.asm" - INCLUDE "scripts/pokemontower7.asm" - INCLUDE "data/mapObjects/pokemontower7.asm" - -PokemonTower7Blocks: ; 60f20 (18:4f20) - INCBIN "maps/pokemontower7.blk" +PokemonTower7Blocks: INCBIN "maps/pokemontower7.blk" INCLUDE "data/mapHeaders/celadonmart1.asm" - INCLUDE "scripts/celadonmart1.asm" - INCLUDE "data/mapObjects/celadonmart1.asm" - -CeladonMart1Blocks: ; 60fde (18:4fde) - INCBIN "maps/celadonmart1.blk" +CeladonMart1Blocks: INCBIN "maps/celadonmart1.blk" INCLUDE "engine/overworld/cinnabar_lab.asm" INCLUDE "data/mapHeaders/viridianforest.asm" - INCLUDE "scripts/viridianforest.asm" - INCLUDE "data/mapObjects/viridianforest.asm" INCLUDE "data/mapHeaders/ssanne1.asm" - INCLUDE "scripts/ssanne1.asm" - INCLUDE "data/mapObjects/ssanne1.asm" - -SSAnne1Blocks: ; 612df (18:52df) - INCBIN "maps/ssanne1.blk" +SSAnne1Blocks: INCBIN "maps/ssanne1.blk" INCLUDE "data/mapHeaders/ssanne2.asm" - INCLUDE "scripts/ssanne2.asm" - INCLUDE "data/mapObjects/ssanne2.asm" - -SSAnne2Blocks: ; 6156e (18:556e) - INCBIN "maps/ssanne2.blk" +SSAnne2Blocks: INCBIN "maps/ssanne2.blk" INCLUDE "data/mapHeaders/ssanne4.asm" - INCLUDE "scripts/ssanne4.asm" - INCLUDE "data/mapObjects/ssanne4.asm" - -SSAnne4Blocks: ; 61666 (18:5666) - INCBIN "maps/ssanne4.blk" +SSAnne4Blocks: INCBIN "maps/ssanne4.blk" INCLUDE "data/mapHeaders/ssanne5.asm" - INCLUDE "scripts/ssanne5.asm" - INCLUDE "data/mapObjects/ssanne5.asm" - -SSAnne5Blocks: ; 61761 (18:5761) - INCBIN "maps/ssanne5.blk" +SSAnne5Blocks: INCBIN "maps/ssanne5.blk" INCLUDE "data/mapHeaders/ssanne6.asm" - INCLUDE "scripts/ssanne6.asm" - INCLUDE "data/mapObjects/ssanne6.asm" - -SSAnne6Blocks: ; 61851 (18:5851) - INCBIN "maps/ssanne6.blk" +SSAnne6Blocks: INCBIN "maps/ssanne6.blk" INCLUDE "data/mapHeaders/ssanne7.asm" - INCLUDE "scripts/ssanne7.asm" - INCLUDE "data/mapObjects/ssanne7.asm" - -SSAnne7Blocks: ; 6195e (18:595e) - INCBIN "maps/ssanne7.blk" +SSAnne7Blocks: INCBIN "maps/ssanne7.blk" INCLUDE "data/mapHeaders/ssanne8.asm" - INCLUDE "scripts/ssanne8.asm" - INCLUDE "data/mapObjects/ssanne8.asm" - -SSAnne8Blocks: ; 61adf (18:5adf) - INCBIN "maps/ssanne8.blk" +SSAnne8Blocks: INCBIN "maps/ssanne8.blk" INCLUDE "data/mapHeaders/ssanne9.asm" - INCLUDE "scripts/ssanne9.asm" - INCLUDE "data/mapObjects/ssanne9.asm" INCLUDE "data/mapHeaders/ssanne10.asm" - INCLUDE "scripts/ssanne10.asm" - INCLUDE "data/mapObjects/ssanne10.asm" INCLUDE "data/mapHeaders/undergroundpathns.asm" - INCLUDE "scripts/undergroundpathns.asm" - INCLUDE "data/mapObjects/undergroundpathns.asm" INCLUDE "data/mapHeaders/undergroundpathwe.asm" - INCLUDE "scripts/undergroundpathwe.asm" - INCLUDE "data/mapObjects/undergroundpathwe.asm" INCLUDE "data/mapHeaders/diglettscave.asm" - INCLUDE "scripts/diglettscave.asm" - INCLUDE "data/mapObjects/diglettscave.asm" - -DiglettsCaveBlocks: ; 61f86 (18:5f86) - INCBIN "maps/diglettscave.blk" +DiglettsCaveBlocks: INCBIN "maps/diglettscave.blk" INCLUDE "data/mapHeaders/silphco11.asm" - INCLUDE "scripts/silphco11.asm" - INCLUDE "data/mapObjects/silphco11.asm" - -SilphCo11Blocks: ; 623c8 (18:63c8) - INCBIN "maps/silphco11.blk" +SilphCo11Blocks: INCBIN "maps/silphco11.blk" INCLUDE "engine/hidden_object_functions18.asm" + SECTION "bank19",ROMX,BANK[$19] -Overworld_GFX: ; 64000 (19:4000) - INCBIN "gfx/tilesets/overworld.w128.t2.2bpp" -Overworld_Block: ; 645e0 (19:45e0) - INCBIN "gfx/blocksets/overworld.bst" +Overworld_GFX: INCBIN "gfx/tilesets/overworld.t2.2bpp" +Overworld_Block: INCBIN "gfx/blocksets/overworld.bst" + RedsHouse1_GFX: -RedsHouse2_GFX: ; 64de0 (19:4de0) - INCBIN "gfx/tilesets/reds_house.w128.t7.2bpp" +RedsHouse2_GFX: INCBIN "gfx/tilesets/reds_house.t7.2bpp" RedsHouse1_Block: -RedsHouse2_Block: ; 65270 (19:5270) - INCBIN "gfx/blocksets/reds_house.bst" -House_GFX: ; 653a0 (19:53a0) - INCBIN "gfx/tilesets/house.w128.t2.2bpp" -House_Block: ; 65980 (19:5980) - INCBIN "gfx/blocksets/house.bst" -Mansion_GFX: ; 65bb0 (19:5bb0) - INCBIN "gfx/tilesets/mansion.w128.t2.2bpp" -Mansion_Block: ; 66190 (19:6190) - INCBIN "gfx/blocksets/mansion.bst" -ShipPort_GFX: ; 66610 (19:6610) - INCBIN "gfx/tilesets/ship_port.w128.t2.2bpp" -ShipPort_Block: ; 66bf0 (19:6bf0) - INCBIN "gfx/blocksets/ship_port.bst" -Interior_GFX: ; 66d60 (19:6d60) - INCBIN "gfx/tilesets/interior.w128.t1.2bpp" -Interior_Block: ; 67350 (19:7350) - INCBIN "gfx/blocksets/interior.bst" -Plateau_GFX: ; 676f0 (19:76f0) - INCBIN "gfx/tilesets/plateau.w128.t10.2bpp" -Plateau_Block: ; 67b50 (19:7b50) - INCBIN "gfx/blocksets/plateau.bst" +RedsHouse2_Block: INCBIN "gfx/blocksets/reds_house.bst" + +House_GFX: INCBIN "gfx/tilesets/house.t2.2bpp" +House_Block: INCBIN "gfx/blocksets/house.bst" +Mansion_GFX: INCBIN "gfx/tilesets/mansion.t2.2bpp" +Mansion_Block: INCBIN "gfx/blocksets/mansion.bst" +ShipPort_GFX: INCBIN "gfx/tilesets/ship_port.t2.2bpp" +ShipPort_Block: INCBIN "gfx/blocksets/ship_port.bst" +Interior_GFX: INCBIN "gfx/tilesets/interior.t1.2bpp" +Interior_Block: INCBIN "gfx/blocksets/interior.bst" +Plateau_GFX: INCBIN "gfx/tilesets/plateau.t10.2bpp" +Plateau_Block: INCBIN "gfx/blocksets/plateau.bst" + SECTION "bank1A",ROMX,BANK[$1A] INCLUDE "engine/battle/1a.asm" -Version_GFX: ; 6802f (1a:402f) +Version_GFX: IF _RED - INCBIN "gfx/red/redgreenversion.h8.1bpp" - ; 80 bytes + INCBIN "gfx/red/redgreenversion.1bpp" ; 10 tiles ENDC IF _BLUE - INCBIN "gfx/blue/blueversion.h8.1bpp" - ; 64 bytes + INCBIN "gfx/blue/blueversion.1bpp" ; 8 tiles ENDC Dojo_GFX: -Gym_GFX: ; 6807f (1a:407f) - INCBIN "gfx/tilesets/gym.w128.2bpp" +Gym_GFX: INCBIN "gfx/tilesets/gym.2bpp" Dojo_Block: -Gym_Block: ; 6867f (1a:467f) - INCBIN "gfx/blocksets/gym.bst" +Gym_Block: INCBIN "gfx/blocksets/gym.bst" + Mart_GFX: -Pokecenter_GFX: ; 68dbf (1a:4dbf) - INCBIN "gfx/tilesets/pokecenter.w128.2bpp" +Pokecenter_GFX: INCBIN "gfx/tilesets/pokecenter.2bpp" Mart_Block: -Pokecenter_Block: ; 693bf (1a:53bf) - INCBIN "gfx/blocksets/pokecenter.bst" +Pokecenter_Block: INCBIN "gfx/blocksets/pokecenter.bst" + ForestGate_GFX: Museum_GFX: -Gate_GFX: ; 6960f (1a:560f) - INCBIN "gfx/tilesets/gate.w128.t1.2bpp" +Gate_GFX: INCBIN "gfx/tilesets/gate.t1.2bpp" ForestGate_Block: Museum_Block: -Gate_Block: ; 69bff (1a:5bff) - INCBIN "gfx/blocksets/gate.bst" -Forest_GFX: ; 6a3ff (1a:63ff) - INCBIN "gfx/tilesets/forest.w128.2bpp" -Forest_Block: ; 6a9ff (1a:69ff) - INCBIN "gfx/blocksets/forest.bst" -Facility_GFX: ; 6b1ff (1a:71ff) - INCBIN "gfx/tilesets/facility.w128.2bpp" -Facility_Block: ; 6b7ff (1a:77ff) - INCBIN "gfx/blocksets/facility.bst" +Gate_Block: INCBIN "gfx/blocksets/gate.bst" + +Forest_GFX: INCBIN "gfx/tilesets/forest.2bpp" +Forest_Block: INCBIN "gfx/blocksets/forest.bst" +Facility_GFX: INCBIN "gfx/tilesets/facility.2bpp" +Facility_Block: INCBIN "gfx/blocksets/facility.bst" + SECTION "bank1B",ROMX,BANK[$1B] -Cemetery_GFX: ; 6c000 (1b:4000) - INCBIN "gfx/tilesets/cemetery.w128.t4.2bpp" -Cemetery_Block: ; 6c5c0 (1b:45c0) - INCBIN "gfx/blocksets/cemetery.bst" -Cavern_GFX: ; 6cca0 (1b:4ca0) - INCBIN "gfx/tilesets/cavern.w128.t14.2bpp" -Cavern_Block: ; 6d0c0 (1b:50c0) - INCBIN "gfx/blocksets/cavern.bst" -Lobby_GFX: ; 6d8c0 (1b:58c0) - INCBIN "gfx/tilesets/lobby.w128.t2.2bpp" -Lobby_Block: ; 6dea0 (1b:5ea0) - INCBIN "gfx/blocksets/lobby.bst" -Ship_GFX: ; 6e390 (1b:6390) - INCBIN "gfx/tilesets/ship.w128.t6.2bpp" -Ship_Block: ; 6e930 (1b:6930) - INCBIN "gfx/blocksets/ship.bst" -Lab_GFX: ; 6ed10 (1b:6d10) - INCBIN "gfx/tilesets/lab.w128.t4.2bpp" -Lab_Block: ; 6f2d0 (1b:72d0) - INCBIN "gfx/blocksets/lab.bst" -Club_GFX: ; 6f670 (1b:7670) - INCBIN "gfx/tilesets/club.w128.t5.2bpp" -Club_Block: ; 6fb20 (1b:7b20) - INCBIN "gfx/blocksets/club.bst" -Underground_GFX: ; 6fd60 (1b:7d60) - INCBIN "gfx/tilesets/underground.w128.t7.2bpp" -Underground_Block: ; 6fef0 (1b:7ef0) - INCBIN "gfx/blocksets/underground.bst" +Cemetery_GFX: INCBIN "gfx/tilesets/cemetery.t4.2bpp" +Cemetery_Block: INCBIN "gfx/blocksets/cemetery.bst" +Cavern_GFX: INCBIN "gfx/tilesets/cavern.t14.2bpp" +Cavern_Block: INCBIN "gfx/blocksets/cavern.bst" +Lobby_GFX: INCBIN "gfx/tilesets/lobby.t2.2bpp" +Lobby_Block: INCBIN "gfx/blocksets/lobby.bst" +Ship_GFX: INCBIN "gfx/tilesets/ship.t6.2bpp" +Ship_Block: INCBIN "gfx/blocksets/ship.bst" +Lab_GFX: INCBIN "gfx/tilesets/lab.t4.2bpp" +Lab_Block: INCBIN "gfx/blocksets/lab.bst" +Club_GFX: INCBIN "gfx/tilesets/club.t5.2bpp" +Club_Block: INCBIN "gfx/blocksets/club.bst" +Underground_GFX: INCBIN "gfx/tilesets/underground.t7.2bpp" +Underground_Block: INCBIN "gfx/blocksets/underground.bst" + SECTION "bank1C",ROMX,BANK[$1C] INCLUDE "engine/gamefreak.asm" - INCLUDE "engine/hall_of_fame.asm" - INCLUDE "engine/overworld/healing_machine.asm" - INCLUDE "engine/overworld/player_animations.asm" - INCLUDE "engine/battle/1c.asm" - INCLUDE "engine/town_map.asm" - INCLUDE "engine/mon_party_sprites.asm" - INCLUDE "engine/in_game_trades.asm" - INCLUDE "engine/palettes.asm" - INCLUDE "engine/save.asm" + SECTION "bank1D",ROMX,BANK[$1D] -CopycatsHouse1FBlocks: ; 74000 (1d:4000) - INCBIN "maps/copycatshouse1f.blk" +CopycatsHouse1FBlocks: INCBIN "maps/copycatshouse1f.blk" -CinnabarMartBlocks: ; 74010 (1d:4010) -PewterMartBlocks: ; 74010 (1d:4010) - INCBIN "maps/pewtermart.blk" +CinnabarMartBlocks: +PewterMartBlocks: INCBIN "maps/pewtermart.blk" -FuchsiaHouse1Blocks: ; 74020 (1d:4020) - INCBIN "maps/fuchsiahouse1.blk" +FuchsiaHouse1Blocks: INCBIN "maps/fuchsiahouse1.blk" -CinnabarPokecenterBlocks: ; 74030 (1d:4030) -FuchsiaPokecenterBlocks: ; 74030 (1d:4030) - INCBIN "maps/fuchsiapokecenter.blk" +CinnabarPokecenterBlocks: +FuchsiaPokecenterBlocks: INCBIN "maps/fuchsiapokecenter.blk" -CeruleanHouse2Blocks: ; 7404c (1d:404c) - INCBIN "maps/ceruleanhouse2.blk" +CeruleanHouse2Blocks: INCBIN "maps/ceruleanhouse2.blk" INCLUDE "engine/HoF_room_pc.asm" @@ -18799,188 +6385,115 @@ INCLUDE "engine/items/itemfinder.asm" INCLUDE "scripts/ceruleancity2.asm" INCLUDE "data/mapHeaders/viridiangym.asm" - INCLUDE "scripts/viridiangym.asm" - INCLUDE "data/mapObjects/viridiangym.asm" - -ViridianGymBlocks: ; 74c47 (1d:4c47) - INCBIN "maps/viridiangym.blk" +ViridianGymBlocks: INCBIN "maps/viridiangym.blk" INCLUDE "data/mapHeaders/pewtermart.asm" - INCLUDE "scripts/pewtermart.asm" - INCLUDE "data/mapObjects/pewtermart.asm" INCLUDE "data/mapHeaders/unknowndungeon1.asm" - INCLUDE "scripts/unknowndungeon1.asm" - INCLUDE "data/mapObjects/unknowndungeon1.asm" - -UnknownDungeon1Blocks: ; 74d76 (1d:4d76) - INCBIN "maps/unknowndungeon1.blk" +UnknownDungeon1Blocks: INCBIN "maps/unknowndungeon1.blk" INCLUDE "data/mapHeaders/ceruleanhouse2.asm" - INCLUDE "scripts/ceruleanhouse2.asm" - INCLUDE "data/mapObjects/ceruleanhouse2.asm" INCLUDE "engine/menu/vending_machine.asm" INCLUDE "data/mapHeaders/fuchsiahouse1.asm" - INCLUDE "scripts/fuchsiahouse1.asm" - INCLUDE "data/mapObjects/fuchsiahouse1.asm" INCLUDE "data/mapHeaders/fuchsiapokecenter.asm" - INCLUDE "scripts/fuchsiapokecenter.asm" - INCLUDE "data/mapObjects/fuchsiapokecenter.asm" INCLUDE "data/mapHeaders/fuchsiahouse2.asm" - INCLUDE "scripts/fuchsiahouse2.asm" - INCLUDE "data/mapObjects/fuchsiahouse2.asm" - -FuchsiaHouse2Blocks: ; 751ad (1d:51ad) - INCBIN "maps/fuchsiahouse2.blk" +FuchsiaHouse2Blocks: INCBIN "maps/fuchsiahouse2.blk" INCLUDE "data/mapHeaders/safarizoneentrance.asm" - INCLUDE "scripts/safarizoneentrance.asm" - INCLUDE "data/mapObjects/safarizoneentrance.asm" - -SafariZoneEntranceBlocks: ; 75425 (1d:5425) - INCBIN "maps/safarizoneentrance.blk" +SafariZoneEntranceBlocks: INCBIN "maps/safarizoneentrance.blk" INCLUDE "data/mapHeaders/fuchsiagym.asm" - INCLUDE "scripts/fuchsiagym.asm" - INCLUDE "data/mapObjects/fuchsiagym.asm" - -FuchsiaGymBlocks: ; 756aa (1d:56aa) - INCBIN "maps/fuchsiagym.blk" +FuchsiaGymBlocks: INCBIN "maps/fuchsiagym.blk" INCLUDE "data/mapHeaders/fuchsiameetingroom.asm" - INCLUDE "scripts/fuchsiameetingroom.asm" - INCLUDE "data/mapObjects/fuchsiameetingroom.asm" - -FuchsiaMeetingRoomBlocks: ; 75722 (1d:5722) - INCBIN "maps/fuchsiameetingroom.blk" +FuchsiaMeetingRoomBlocks: INCBIN "maps/fuchsiameetingroom.blk" INCLUDE "data/mapHeaders/cinnabargym.asm" - INCLUDE "scripts/cinnabargym.asm" - INCLUDE "data/mapObjects/cinnabargym.asm" - -CinnabarGymBlocks: ; 75b26 (1d:5b26) - INCBIN "maps/cinnabargym.blk" +CinnabarGymBlocks: INCBIN "maps/cinnabargym.blk" INCLUDE "data/mapHeaders/lab1.asm" - INCLUDE "scripts/lab1.asm" - INCLUDE "data/mapObjects/lab1.asm" - -Lab1Blocks: ; 75bf1 (1d:5bf1) - INCBIN "maps/lab1.blk" +Lab1Blocks: INCBIN "maps/lab1.blk" INCLUDE "data/mapHeaders/lab2.asm" - INCLUDE "scripts/lab2.asm" - INCLUDE "data/mapObjects/lab2.asm" - -Lab2Blocks: ; 75c6b (1d:5c6b) - INCBIN "maps/lab2.blk" +Lab2Blocks: INCBIN "maps/lab2.blk" INCLUDE "data/mapHeaders/lab3.asm" - INCLUDE "scripts/lab3.asm" - INCLUDE "data/mapObjects/lab3.asm" - -Lab3Blocks: ; 75d15 (1d:5d15) - INCBIN "maps/lab3.blk" +Lab3Blocks: INCBIN "maps/lab3.blk" INCLUDE "data/mapHeaders/lab4.asm" - INCLUDE "scripts/lab4.asm" - INCLUDE "data/mapObjects/lab4.asm" - -Lab4Blocks: ; 75e10 (1d:5e10) - INCBIN "maps/lab4.blk" +Lab4Blocks: INCBIN "maps/lab4.blk" INCLUDE "data/mapHeaders/cinnabarpokecenter.asm" - INCLUDE "scripts/cinnabarpokecenter.asm" - INCLUDE "data/mapObjects/cinnabarpokecenter.asm" INCLUDE "data/mapHeaders/cinnabarmart.asm" - INCLUDE "scripts/cinnabarmart.asm" - INCLUDE "data/mapObjects/cinnabarmart.asm" INCLUDE "data/mapHeaders/copycatshouse1f.asm" - INCLUDE "scripts/copycatshouse1f.asm" - INCLUDE "data/mapObjects/copycatshouse1f.asm" INCLUDE "data/mapHeaders/gary.asm" - INCLUDE "scripts/gary.asm" - INCLUDE "data/mapObjects/gary.asm" - -GaryBlocks: ; 7615f (1d:615f) - INCBIN "maps/gary.blk" +GaryBlocks: INCBIN "maps/gary.blk" INCLUDE "data/mapHeaders/lorelei.asm" - INCLUDE "scripts/lorelei.asm" - INCLUDE "data/mapObjects/lorelei.asm" - -LoreleiBlocks: ; 762ac (1d:62ac) - INCBIN "maps/lorelei.blk" +LoreleiBlocks: INCBIN "maps/lorelei.blk" INCLUDE "data/mapHeaders/bruno.asm" - INCLUDE "scripts/bruno.asm" - INCLUDE "data/mapObjects/bruno.asm" - -BrunoBlocks: ; 76403 (1d:6403) - INCBIN "maps/bruno.blk" +BrunoBlocks: INCBIN "maps/bruno.blk" INCLUDE "data/mapHeaders/agatha.asm" - INCLUDE "scripts/agatha.asm" - INCLUDE "data/mapObjects/agatha.asm" - -AgathaBlocks: ; 76560 (1d:6560) - INCBIN "maps/agatha.blk" +AgathaBlocks: INCBIN "maps/agatha.blk" INCLUDE "engine/menu/league_pc.asm" INCLUDE "engine/overworld/hidden_items.asm" + SECTION "bank1E",ROMX,BANK[$1E] INCLUDE "engine/battle/animations.asm" @@ -18989,17 +6502,10 @@ INCLUDE "engine/overworld/cut2.asm" INCLUDE "engine/overworld/ssanne.asm" -RedFishingTilesFront: ; 79fed (1e:5fed) - INCBIN "gfx/red_fishing_tile_front.2bpp" - -RedFishingTilesBack: ; 7a00d (1e:600d) - INCBIN "gfx/red_fishing_tile_back.2bpp" - -RedFishingTilesSide: ; 7a02d (1e:602d) - INCBIN "gfx/red_fishing_tile_side.2bpp" - -RedFishingRodTiles: ; 7a04d (1e:604d) - INCBIN "gfx/red_fishingrod_tiles.2bpp" +RedFishingTilesFront: INCBIN "gfx/red_fishing_tile_front.2bpp" +RedFishingTilesBack: INCBIN "gfx/red_fishing_tile_back.2bpp" +RedFishingTilesSide: INCBIN "gfx/red_fishing_tile_side.2bpp" +RedFishingRodTiles: INCBIN "gfx/red_fishingrod_tiles.2bpp" INCLUDE "data/animations.asm" diff --git a/audio_red.asm b/red/audio.asm index 6c90a7c1..6c90a7c1 100644 --- a/audio_red.asm +++ b/red/audio.asm diff --git a/pokered.asm b/red/main.asm index ff8de04f..ff8de04f 100644 --- a/pokered.asm +++ b/red/main.asm diff --git a/red/text.asm b/red/text.asm new file mode 100644 index 00000000..d5d571d7 --- /dev/null +++ b/red/text.asm @@ -0,0 +1,2 @@ +INCLUDE "red.asm" +INCLUDE "text.asm" diff --git a/red/wram.asm b/red/wram.asm new file mode 100644 index 00000000..68c3c803 --- /dev/null +++ b/red/wram.asm @@ -0,0 +1,2 @@ +INCLUDE "red.asm" +INCLUDE "wram.asm" diff --git a/scripts/agatha.asm b/scripts/agatha.asm index 749f84e7..b31fc412 100755 --- a/scripts/agatha.asm +++ b/scripts/agatha.asm @@ -9,11 +9,11 @@ AgathaScript: ; 7642d (1d:642d) ret AgathaScript_76443: ; 76443 (1d:6443) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z - ld a, [$d865] + ld a, [wd865] bit 1, a jr z, .asm_76457 ld a, $e @@ -22,10 +22,9 @@ AgathaScript_76443: ; 76443 (1d:6443) ld a, $3b AgathaScript_76459: ; 76459 (1d:6459) - ld [$d09f], a + ld [wd09f], a ld bc, $2 - ld a, $17 - jp Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef_jump Func_ee9e AgathaScript_76464: ; 76464 (1d:6464) xor a @@ -42,7 +41,7 @@ AgathaScriptPointers: ; 76469 (1d:6469) AgathaScript4: ; 76473 (1d:6473) ret asm_76474: ; 76474 (1d:6474) - ld hl, $ccd3 + ld hl, wccd3 ld a, $40 ld [hli], a ld [hli], a @@ -51,7 +50,7 @@ asm_76474: ; 76474 (1d:6474) ld [hli], a ld [hl], a ld a, $6 - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $3 ld [W_AGATHACURSCRIPT], a @@ -63,14 +62,14 @@ AgathaScript0: ; 76490 (1d:6490) call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a - ld [H_NEWLYPRESSEDBUTTONS], a - ld [H_CURRENTPRESSEDBUTTONS], a - ld [$ccd3], a - ld [$cd38], a - ld a, [wWhichTrade] ; $cd3d + ld [hJoyPressed], a + ld [hJoyHeld], a + ld [wccd3], a + ld [wcd38], a + ld a, [wWhichTrade] ; wWhichTrade cp $3 jr c, .asm_764b4 - ld hl, $d865 + ld hl, wd865 bit 6, [hl] set 6, [hl] jr z, asm_76474 @@ -79,9 +78,9 @@ AgathaScript0: ; 76490 (1d:6490) ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID ld a, $40 - ld [$ccd3], a + ld [wccd3], a ld a, $1 - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $3 ld [W_AGATHACURSCRIPT], a @@ -96,19 +95,19 @@ CoordsData_764d1: ; 764d1 (1d:64d1) db $FF AgathaScript3: ; 764da (1d:64da) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_AGATHACURSCRIPT], a ld [W_CURMAPSCRIPT], a ret AgathaScript2: ; 764ed (1d:64ed) call EndTrainerBattle - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, AgathaScript_76464 ld a, $1 @@ -126,7 +125,7 @@ AgathaTrainerHeaders: ; 76509 (1d:6509) AgathaTrainerHeader0: ; 76509 (1d:6509) db $1 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d865 ; flag's byte + dw wd865 ; flag's byte dw AgathaBeforeBattleText ; 0x6520 TextBeforeBattle dw AgathaAfterBattleText ; 0x652a TextAfterBattle dw AgathaEndBattleText ; 0x6525 TextEndBattle diff --git a/scripts/battlecenterm.asm b/scripts/battlecenterm.asm index 846b78fb..b65380d2 100755 --- a/scripts/battlecenterm.asm +++ b/scripts/battlecenterm.asm @@ -10,24 +10,24 @@ BattleCenterMScript: ; 4fd10 (13:7d10) ld a, $1 ld [$ff8c], a call Func_34ae - ld hl, $d72d + ld hl, wd72d bit 0, [hl] set 0, [hl] ret nz - ld hl, $c214 + ld hl, wSpriteStateData2 + $14 ld a, $8 ld [hli], a ld a, $a ld [hl], a ld a, $8 - ld [$c119], a + ld [wSpriteStateData1 + $19], a ld a, [$ffaa] cp $2 ret z ld a, $7 - ld [$c215], a + ld [wSpriteStateData2 + $15], a ld a, $c - ld [$c119], a + ld [wSpriteStateData1 + $19], a ret BattleCenterMTextPointers: ; 4fd4c (13:7d4c) diff --git a/scripts/bikeshop.asm b/scripts/bikeshop.asm index 75714dbc..4bd26a7e 100755 --- a/scripts/bikeshop.asm +++ b/scripts/bikeshop.asm @@ -8,7 +8,7 @@ BikeShopTextPointers: ; 1d73f (7:573f) BikeShopText1: ; 1d745 (7:5745) db $08 ; asm - ld a, [$d75f] + ld a, [wd75f] bit 0, a jr z, .asm_260d4 ; 0x1d74b ld hl, BikeShopText_1d82f @@ -26,7 +26,7 @@ BikeShopText1: ; 1d745 (7:5745) ld a, BIKE_VOUCHER ldh [$db], a callba RemoveItemByID - ld hl, $d75f + ld hl, wd75f set 0, [hl] ld hl, BikeShopText_1d824 call PrintText @@ -39,29 +39,27 @@ BikeShopText1: ; 1d745 (7:5745) ld hl, BikeShopText_1d810 call PrintText xor a - ld [$cc26], a - ld [$cc2a], a + ld [wCurrentMenuItem], a + ld [wLastMenuItem], a ld a, $3 - ld [$cc29], a + ld [wMenuWatchedKeys], a ld a, $1 - ld [$cc28], a + ld [wMaxMenuItem], a ld a, $2 - ld [$cc24], a + ld [wTopMenuItemY], a ld a, $1 - ld [$cc25], a - ld hl, $d730 + ld [wTopMenuItemX], a + ld hl, wd730 set 6, [hl] ld hl, wTileMap ld b, $4 ld c, $f call TextBoxBorder call UpdateSprites - FuncCoord 2, 2 ; $c3ca - ld hl, Coord + hlCoord 2, 2 ld de, BikeShopMenuText call PlaceString - FuncCoord 8, 3 ; $c3e4 - ld hl, Coord + hlCoord 8, 3 ld de, BikeShopMenuPrice call PlaceString ld hl, BikeShopText_1d815 @@ -69,9 +67,9 @@ BikeShopText1: ; 1d745 (7:5745) call HandleMenuInput bit 1, a jr nz, .asm_b7579 ; 0x1d7dc - ld hl, $d730 + ld hl, wd730 res 6, [hl] - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_b7579 ; 0x1d7e7 ld hl, BikeShopText_1d81a @@ -133,7 +131,7 @@ BikeShopText_1d843: ; 1d843 (7:5843) BikeShopText3: ; 1d848 (7:5848) db $08 ; asm - ld a, [$d75f] + ld a, [wd75f] bit 0, a ld hl, BikeShopText_1d861 jr nz, .asm_34d2d ; 0x1d851 diff --git a/scripts/billshouse.asm b/scripts/billshouse.asm index 6d397de1..3a8a33c0 100755 --- a/scripts/billshouse.asm +++ b/scripts/billshouse.asm @@ -16,7 +16,7 @@ BillsHouseScript0: ; 1e782 (7:6782) ret BillsHouseScript1: ; 1e783 (7:6783) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] and a ld de, MovementData_1e79c jr nz, .asm_1e78f ; 0x1e78a $3 @@ -36,29 +36,28 @@ MovementData_1e7a0: ; 1e7a0 (7:67a0) db $C0,$40,$40,$80,$40,$FF BillsHouseScript2: ; 1e7a6 (7:67a6) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz ld a, $61 - ld [$cc4d], a - ld a, $11 - call Predef - ld hl, $d7f2 + ld [wcc4d], a + predef HideObject + ld hl, wd7f2 set 6, [hl] xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $3 ld [W_BILLSHOUSECURSCRIPT], a ret BillsHouseScript3: ; 1e7c5 (7:67c5) - ld a, [$d7f2] + ld a, [wd7f2] bit 3, a ret z ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $2 - ld [$cf13], a + ld [wcf13], a ld a, $c ld [$ffeb], a ld a, $40 @@ -69,9 +68,8 @@ BillsHouseScript3: ; 1e7c5 (7:67c5) ld [$ffee], a call Func_32f9 ld a, $62 - ld [$cc4d], a - ld a, $15 - call Predef + ld [wcc4d], a + predef ShowObject ld c, $8 call DelayFrames ld a, $2 @@ -86,14 +84,14 @@ MovementData_1e807: ; 1e807 (7:6807) db $00,$C0,$C0,$C0,$00,$FF BillsHouseScript4: ; 1e80d (7:680d) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz xor a - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d7f2 + ld [wJoyIgnore], a + ld hl, wd7f2 set 5, [hl] - ld hl, $d7f1 + ld hl, wd7f1 set 0, [hl] ld a, $0 ld [W_BILLSHOUSECURSCRIPT], a @@ -121,7 +119,7 @@ BillsHouseText1: ; 1e83d (7:683d) ld hl, BillsHouseText_1e865 call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, asm_6b196 ; 0x1e84b $d asm_4d03c: ; 1e84d (7:684d) @@ -151,7 +149,7 @@ BillsHouseText_1e86f: ; 1e86f (7:686f) BillsHouseText2: ; 1e874 (7:6874) db $08 ; asm - ld a, [$d7f2] + ld a, [wd7f2] bit 4, a jr nz, .asm_5491f ; 0x1e87a ld hl, BillThankYouText @@ -161,16 +159,14 @@ BillsHouseText2: ; 1e874 (7:6874) jr nc, .BagFull ld hl, SSTicketReceivedText call PrintText - ld hl, $d7f2 + ld hl, wd7f2 set 4, [hl] ld a, $7 - ld [$cc4d], a - ld a, $15 - call Predef + ld [wcc4d], a + predef ShowObject ld a, $9 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject .asm_5491f ; 0x1e8a9 ld hl, BillsHouseText_1e8cb call PrintText diff --git a/scripts/blueshouse.asm b/scripts/blueshouse.asm index 1699160f..4f336ea9 100755 --- a/scripts/blueshouse.asm +++ b/scripts/blueshouse.asm @@ -9,7 +9,7 @@ BluesHouseScriptPointers: ; 19b47 (6:5b47) dw BluesHouseScript1 BluesHouseScript0: ; 19b4b (6:5b4b) - ld hl,$D74A + ld hl,wd74a set 1,[hl] ; trigger the next script @@ -27,10 +27,10 @@ BluesHouseTextPointers: ; 19b57 (6:5b57) BluesHouseText1: ; 19b5d (6:5b5d) db 8 - ld a,[$D74A] + ld a,[wd74a] bit 0,a jr nz,.GotMap - ld a,[$D74B] + ld a,[wd74b] bit 5,a jr nz,.GiveMap ld hl,DaisyInitialText @@ -43,12 +43,11 @@ BluesHouseText1: ; 19b5d (6:5b5d) call GiveItem jr nc, .BagFull ld a,$29 - ld [$CC4D],a - ld a,$11 - call Predef ; hide table map object + ld [wcc4d],a + predef HideObject ; hide table map object ld hl,GotMapText call PrintText - ld hl,$D74A + ld hl,wd74a set 0,[hl] jr .done .GotMap diff --git a/scripts/bruno.asm b/scripts/bruno.asm index 60d579b2..d0382fa4 100755 --- a/scripts/bruno.asm +++ b/scripts/bruno.asm @@ -9,11 +9,11 @@ BrunoScript: ; 762d6 (1d:62d6) ret BrunoScript_762ec: ; 762ec (1d:62ec) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z - ld a, [$d864] + ld a, [wd864] bit 1, a jr z, .asm_76300 ld a, $5 @@ -22,10 +22,9 @@ BrunoScript_762ec: ; 762ec (1d:62ec) ld a, $24 BrunoScript_76302: ; 76302 (1d:6302) - ld [$d09f], a + ld [wd09f], a ld bc, $2 - ld a, $17 - jp Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef_jump Func_ee9e BrunoScript_7630d: ; 7630d (1d:630d) xor a @@ -42,7 +41,7 @@ BrunoScriptPointers: ; 76312 (1d:6312) BrunoScript4: ; 7631c (1d:631c) ret asm_7631d: ; 7631d (1d:631d) - ld hl, $ccd3 + ld hl, wccd3 ld a, $40 ld [hli], a ld [hli], a @@ -51,7 +50,7 @@ asm_7631d: ; 7631d (1d:631d) ld [hli], a ld [hl], a ld a, $6 - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $3 ld [W_BRUNOCURSCRIPT], a @@ -63,14 +62,14 @@ BrunoScript0: ; 76339 (1d:6339) call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a - ld [H_NEWLYPRESSEDBUTTONS], a - ld [H_CURRENTPRESSEDBUTTONS], a - ld [$ccd3], a - ld [$cd38], a - ld a, [wWhichTrade] ; $cd3d + ld [hJoyPressed], a + ld [hJoyHeld], a + ld [wccd3], a + ld [wcd38], a + ld a, [wWhichTrade] ; wWhichTrade cp $3 jr c, .asm_7635d - ld hl, $d864 + ld hl, wd864 bit 6, [hl] set 6, [hl] jr z, asm_7631d @@ -79,9 +78,9 @@ BrunoScript0: ; 76339 (1d:6339) ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID ld a, $40 - ld [$ccd3], a + ld [wccd3], a ld a, $1 - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $3 ld [W_BRUNOCURSCRIPT], a @@ -96,19 +95,19 @@ CoordsData_7637a: ; 7637a (1d:637a) db $FF BrunoScript3: ; 76383 (1d:6383) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_BRUNOCURSCRIPT], a ld [W_CURMAPSCRIPT], a ret BrunoScript2: ; 76396 (1d:6396) call EndTrainerBattle - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, BrunoScript_7630d ld a, $1 @@ -123,7 +122,7 @@ BrunoTrainerHeaders: ; 763ac (1d:63ac) BrunoTrainerHeader0: ; 763ac (1d:63ac) db $1 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d864 ; flag's byte + dw wd864 ; flag's byte dw BrunoBeforeBattleText ; 0x63c3 TextBeforeBattle dw BrunoAfterBattleText ; 0x63cd TextAfterBattle dw BrunoEndBattleText ; 0x63c8 TextEndBattle diff --git a/scripts/celadoncity.asm b/scripts/celadoncity.asm index 2f2a3128..004d8773 100755 --- a/scripts/celadoncity.asm +++ b/scripts/celadoncity.asm @@ -1,9 +1,9 @@ CeladonCityScript: ; 19956 (6:5956) call EnableAutoTextBoxDrawing - ld hl, $d77e + ld hl, wd77e res 0, [hl] res 7, [hl] - ld hl, $d816 + ld hl, wd816 res 7, [hl] ret @@ -45,7 +45,7 @@ CeladonCityText4: ; 19999 (6:5999) CeladonCityText5: ; 1999e (6:599e) db $08 ; asm - ld a, [$d777] + ld a, [wd777] bit 0, a jr nz, .asm_7053f ; 0x199a4 ld hl, TM41PreText @@ -59,7 +59,7 @@ CeladonCityText5: ; 1999e (6:599e) .Success ld hl, ReceivedTM41Text call PrintText - ld hl, $d777 + ld hl, wd777 set 0, [hl] jr .Done .asm_7053f ; 0x199c9 diff --git a/scripts/celadondiner.asm b/scripts/celadondiner.asm index 06cce8fd..5ae89022 100755 --- a/scripts/celadondiner.asm +++ b/scripts/celadondiner.asm @@ -27,7 +27,7 @@ CeladonDinerText4: ; 4916e (12:516e) CeladonDinerText5: ; 49173 (12:5173) db $08 ; asm - ld a, [$d783] + ld a, [wd783] bit 0, a jr nz, .asm_eb14d ; 0x49179 ld hl, CeladonDinerText_491a7 @@ -35,7 +35,7 @@ CeladonDinerText5: ; 49173 (12:5173) ld bc, (COIN_CASE << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, $d783 + ld hl, wd783 set 0, [hl] ld hl, ReceivedCoinCaseText call PrintText diff --git a/scripts/celadongamecorner.asm b/scripts/celadongamecorner.asm index f4e23d6e..9746f54e 100755 --- a/scripts/celadongamecorner.asm +++ b/scripts/celadongamecorner.asm @@ -7,11 +7,11 @@ CeladonGameCornerScript: ; 48bbd (12:4bbd) jp CallFunctionInTable CeladonGameCornerScript_48bcf: ; 48bcf (12:4bcf) - ld hl, $d126 + ld hl, wd126 bit 6, [hl] res 6, [hl] ret z - call GenRandom + call Random ld a, [$ffd3] cp $7 jr nc, .asm_48be2 @@ -20,26 +20,25 @@ CeladonGameCornerScript_48bcf: ; 48bcf (12:4bcf) srl a srl a srl a - ld [$cd05], a + ld [wcd05], a ret CeladonGameCornerScript_48bec: ; 48bec (12:4bec) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z - ld a, [$d77e] + ld a, [wd77e] bit 1, a ret nz ld a, $2a - ld [$d09f], a + ld [wd09f], a ld bc, $0208 - ld a, $17 - jp Predef + predef_jump Func_ee9e CeladonGameCornerScript_48c07: ; 48c07 (12:4c07) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_CELADONGAMECORNERCURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -57,7 +56,7 @@ CeladonGameCornerScript1: ; 48c19 (12:4c19) cp $ff jp z, CeladonGameCornerScript_48c07 ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $d ld [H_SPRITEHEIGHT], a call DisplayTextID @@ -90,16 +89,15 @@ MovementData_48c63: ; 48c63 (12:4c63) db $C0,$C0,$C0,$C0,$C0,$FF CeladonGameCornerScript2: ; 48c69 (12:4c69) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $46 - ld [$cc4d], a - ld a, $11 - call Predef - ld hl, $d126 + ld [wcc4d], a + predef HideObject + ld hl, wd126 set 5, [hl] set 6, [hl] ld a, $0 @@ -131,7 +129,7 @@ CeladonGameCornerText2: ; 48ca9 (12:4ca9) ld hl, CeladonGameCornerText_48d22 call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_c650b ; 0x48cba ld b,COIN_CASE @@ -155,20 +153,18 @@ CeladonGameCornerText2: ; 48ca9 (12:4ca9) ld a, $10 ldh [$a0], a ld hl, $ffa1 - ld de, $d349 + ld de, wPlayerMoney + 2 ld c, $3 - ld a, $c - call Predef + predef SubBCDPredef xor a ldh [$9f], a ldh [$a0], a ld a, $50 ldh [$a1], a - ld de, $d5a5 + ld de, wPlayerCoins + 1 ld hl, $ffa1 ld c, $2 - ld a, $b - call Predef + predef AddBCDPredef call CeladonGameCornerScript_48f1e ld hl, CeladonGameCornerText_48d27 jr .asm_e2afd ; 0x48d0d @@ -218,7 +214,7 @@ CeladonGameCornerText4: ; 48d45 (12:4d45) CeladonGameCornerText5: ; 48d4a (12:4d4a) db $08 ; asm - ld a, [$d77e] + ld a, [wd77e] bit 2, a jr nz, .asm_d0957 ; 0x48d50 ld hl, CeladonGameCornerText_48d9c @@ -233,15 +229,14 @@ CeladonGameCornerText5: ; 48d4a (12:4d4a) ldh [$a0], a ld a, $10 ldh [$a1], a - ld de, $d5a5 + ld de, wPlayerCoins + 1 ld hl, $ffa1 ld c, $2 - ld a, $b - call Predef - ld hl, $d77e + predef AddBCDPredef + ld hl, wd77e set 2, [hl] ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ld hl, Received10CoinsText jr .asm_c7d1a ; 0x48d87 .asm_d0957 ; 0x48d89 @@ -278,7 +273,7 @@ CeladonGameCornerText6: ; 48db1 (12:4db1) CeladonGameCornerText7: ; 48db6 (12:4db6) db $08 ; asm - ld a, [$d77c] + ld a, [wd77c] bit 1, a ld hl, CeladonGameCornerText_48dca ; $4dca jr z, .asm_be3fd ; 0x48dbf @@ -301,7 +296,7 @@ CeladonGameCornerText8: ; 48dd4 (12:4dd4) CeladonGameCornerText9: ; 48dd9 (12:4dd9) db $08 ; asm - ld a, [$d77e] + ld a, [wd77e] bit 4, a jr nz, .asm_ed8bc ; 0x48ddf ld hl, CeladonGameCornerText_48e26 @@ -316,12 +311,11 @@ CeladonGameCornerText9: ; 48dd9 (12:4dd9) ldh [$a0], a ld a, $20 ldh [$a1], a - ld de, $d5a5 + ld de, wPlayerCoins + 1 ld hl, $ffa1 ld c, $2 - ld a, $b - call Predef - ld hl, $d77e + predef AddBCDPredef + ld hl, wd77e set 4, [hl] ld hl, Received20CoinsText jr .asm_0ddc2 ; 0x48e11 @@ -355,7 +349,7 @@ CeladonGameCornerText_48e36: ; 48e36 (12:4e36) CeladonGameCornerText10: ; 48e3b (12:4e3b) db $08 ; asm - ld a, [$d77e] + ld a, [wd77e] bit 3, a jr nz, .asm_ff080 ; 0x48e41 ld hl, CeladonGameCornerText_48e88 ; $4e88 @@ -370,12 +364,11 @@ CeladonGameCornerText10: ; 48e3b (12:4e3b) ldh [$a0], a ld a, $20 ldh [$a1], a - ld de, $d5a5 + ld de, wPlayerCoins + 1 ld hl, $ffa1 ld c, $2 - ld a, $b - call Predef - ld hl, $d77e + predef AddBCDPredef + ld hl, wd77e set 3, [hl] ld hl, CeladonGameCornerText_48e8d jr .asm_78d65 ; 0x48e73 @@ -411,14 +404,14 @@ CeladonGameCornerText11: ; 48e9d (12:4e9d) db $08 ; asm ld hl, CeladonGameCornerText_48ece call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, CeladonGameCornerText_48ed3 ld de, CeladonGameCornerText_48ed3 call PreBattleSaveRegisters ldh a, [$8c] - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters xor a @@ -444,20 +437,19 @@ CeladonGameCornerText13: ; 48ed8 (12:4ed8) CeladonGameCornerText12: ; 48edd (12:4edd) db $08 ; asm ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ld hl, CeladonGameCornerText_48f09 call PrintText call WaitForSoundToFinish ld a, (SFX_02_57 - SFX_Headers_02) / 3 call PlaySound call WaitForSoundToFinish - ld hl, $d77e + ld hl, wd77e set 1, [hl] ld a, $43 - ld [$d09f], a + ld [wd09f], a ld bc, $0208 - ld a, $17 - call Predef + predef Func_ee9e jp TextScriptEnd CeladonGameCornerText_48f09: ; 48f09 (12:4f09) @@ -473,46 +465,38 @@ CeladonGameCornerText_48f19: ; 48f19 (12:4f19) db "@" CeladonGameCornerScript_48f1e: ; 48f1e (12:4f1e) - ld hl, $d730 + ld hl, wd730 set 6, [hl] - FuncCoord 11, 0 ; $c3ab - ld hl, Coord + hlCoord 11, 0 ld b, $5 ld c, $7 call TextBoxBorder call UpdateSprites - FuncCoord 12, 1 ; $c3c0 - ld hl, Coord + hlCoord 12, 1 ld b, $4 ld c, $7 call ClearScreenArea - FuncCoord 12, 2 ; $c3d4 - ld hl, Coord + hlCoord 12, 2 ld de, GameCornerMoneyText call PlaceString - FuncCoord 12, 3 ; $c3e8 - ld hl, Coord + hlCoord 12, 3 ld de, GameCornerBlankText1 call PlaceString - FuncCoord 12, 3 ; $c3e8 - ld hl, Coord - ld de, $d347 + hlCoord 12, 3 + ld de, wPlayerMoney ld c, $a3 call PrintBCDNumber - FuncCoord 12, 4 ; $c3fc - ld hl, Coord + hlCoord 12, 4 ld de, GameCornerCoinText call PlaceString - FuncCoord 12, 5 ; $c410 - ld hl, Coord + hlCoord 12, 5 ld de, GameCornerBlankText2 call PlaceString - FuncCoord 15, 5 ; $c413 - ld hl, Coord - ld de, $d5a4 + hlCoord 15, 5 + ld de, wPlayerCoins ld c, $82 call PrintBCDNumber - ld hl, $d730 + ld hl, wd730 res 6, [hl] ret diff --git a/scripts/celadongym.asm b/scripts/celadongym.asm index 67102fb7..6d44175e 100755 --- a/scripts/celadongym.asm +++ b/scripts/celadongym.asm @@ -1,5 +1,5 @@ CeladonGymScript: ; 4890a (12:490a) - ld hl, $d126 + ld hl, wd126 bit 6, [hl] res 6, [hl] call nz, CeladonGymScript_48927 @@ -24,7 +24,7 @@ Gym4LeaderName: ; 4893d (12:493d) CeladonGymText_48943: ; 48943 (12:4943) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_CELADONGYMCURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -36,17 +36,17 @@ CeladonGymScriptPointers: ; 4894e (12:494e) dw CeladonGymScript3 CeladonGymScript3: ; 48956 (12:4956) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, CeladonGymText_48943 ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a CeladonGymText_48963: ; 48963 (12:4963) ld a, $9 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d77c + ld hl, wd77c set 1, [hl] ld bc, (TM_21 << 8) | 1 call GiveItem @@ -54,7 +54,7 @@ CeladonGymText_48963: ; 48963 (12:4963) ld a, $a ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d77c + ld hl, wd77c set 0, [hl] jr .asm_4898c .BagFull @@ -64,14 +64,14 @@ CeladonGymText_48963: ; 48963 (12:4963) .asm_4898c ld hl, W_OBTAINEDBADGES set 3, [hl] - ld hl, $d72a + ld hl, wd72a set 3, [hl] ; deactivate gym trainers - ld a, [$d77c] + ld a, [wd77c] or %11111100 - ld [$d77c], a - ld hl, $d77d + ld [wd77c], a + ld hl, wd77d set 0, [hl] jp CeladonGymText_48943 @@ -93,7 +93,7 @@ CeladonGymTrainerHeaders: ; 489bc (12:49bc) CeladonGymTrainerHeader0: ; 489bc (12:49bc) db $2 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d77c ; flag's byte + dw wd77c ; flag's byte dw CeladonGymBattleText2 ; 0x4a8b TextBeforeBattle dw CeladonGymAfterBattleText2 ; 0x4a95 TextAfterBattle dw CeladonGymEndBattleText2 ; 0x4a90 TextEndBattle @@ -102,7 +102,7 @@ CeladonGymTrainerHeader0: ; 489bc (12:49bc) CeladonGymTrainerHeader2: ; 489c8 (12:49c8) db $3 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d77c ; flag's byte + dw wd77c ; flag's byte dw CeladonGymBattleText3 ; 0x4aa4 TextBeforeBattle dw CeladonGymAfterBattleText3 ; 0x4aae TextAfterBattle dw CeladonGymEndBattleText3 ; 0x4aa9 TextEndBattle @@ -111,7 +111,7 @@ CeladonGymTrainerHeader2: ; 489c8 (12:49c8) CeladonGymTrainerHeader3: ; 489d4 (12:49d4) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d77c ; flag's byte + dw wd77c ; flag's byte dw CeladonGymBattleText4 ; 0x4abd TextBeforeBattle dw CeladonGymAfterBattleText4 ; 0x4ac7 TextAfterBattle dw CeladonGymEndBattleText4 ; 0x4ac2 TextEndBattle @@ -120,7 +120,7 @@ CeladonGymTrainerHeader3: ; 489d4 (12:49d4) CeladonGymTrainerHeader4: ; 489e0 (12:49e0) db $5 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d77c ; flag's byte + dw wd77c ; flag's byte dw CeladonGymBattleText5 ; 0x4ad6 TextBeforeBattle dw CeladonGymAfterBattleText5 ; 0x4ae0 TextAfterBattle dw CeladonGymEndBattleText5 ; 0x4adb TextEndBattle @@ -129,7 +129,7 @@ CeladonGymTrainerHeader4: ; 489e0 (12:49e0) CeladonGymTrainerHeader5: ; 489ec (12:49ec) db $6 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d77c ; flag's byte + dw wd77c ; flag's byte dw CeladonGymBattleText6 ; 0x4aef TextBeforeBattle dw CeladonGymAfterBattleText6 ; 0x4af9 TextAfterBattle dw CeladonGymEndBattleText6 ; 0x4af4 TextEndBattle @@ -138,7 +138,7 @@ CeladonGymTrainerHeader5: ; 489ec (12:49ec) CeladonGymTrainerHeader6: ; 489f8 (12:49f8) db $7 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d77c ; flag's byte + dw wd77c ; flag's byte dw CeladonGymBattleText7 ; 0x4b08 TextBeforeBattle dw CeladonGymAfterBattleText7 ; 0x4b12 TextAfterBattle dw CeladonGymEndBattleText7 ; 0x4b0d TextEndBattle @@ -147,7 +147,7 @@ CeladonGymTrainerHeader6: ; 489f8 (12:49f8) CeladonGymTrainerHeader7: ; 48a04 (12:4a04) db $8 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d77c ; flag's byte + dw wd77c ; flag's byte dw CeladonGymBattleText8 ; 0x4b21 TextBeforeBattle dw CeladonGymAfterBattleText8 ; 0x4b2b TextAfterBattle dw CeladonGymEndBattleText8 ; 0x4b26 TextEndBattle @@ -157,7 +157,7 @@ CeladonGymTrainerHeader7: ; 48a04 (12:4a04) CeladonGymText1: ; 48a11 (12:4a11) db $08 ; asm - ld a, [$d77c] + ld a, [wd77c] bit 1, a jr z, .asm_16064 ; 0x48a17 bit 0, a @@ -172,18 +172,18 @@ CeladonGymText1: ; 48a11 (12:4a11) .asm_16064 ; 0x48a2d ld hl, CeladonGymText_48a5e call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, CeladonGymText_48a63 ld de, CeladonGymText_48a63 call PreBattleSaveRegisters ldh a, [$8c] - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters ld a, $4 - ld [$d05c], a + ld [W_GYMLEADERNO], a ld a, $3 ld [W_CELADONGYMCURSCRIPT], a ld [W_CURMAPSCRIPT], a diff --git a/scripts/celadonmansion3.asm b/scripts/celadonmansion3.asm index 4c4fd67a..73cd45ed 100755 --- a/scripts/celadonmansion3.asm +++ b/scripts/celadonmansion3.asm @@ -30,7 +30,7 @@ DirectorText: ; 487b2 (12:47b2) ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits - ld a, [$d11e] + ld a, [wd11e] cp 150 jr nc, .CompletedDex ld hl, .GameDesigner @@ -51,7 +51,7 @@ DirectorText: ; 487b2 (12:47b2) db $8 ; asm callab DisplayDiploma ld a, $1 - ld [$cc3c], a + ld [wcc3c], a jp TextScriptEnd GameFreakPCText1: ; 487eb (12:47eb) diff --git a/scripts/celadonmansion5.asm b/scripts/celadonmansion5.asm index 1d03ae5e..66ef96d8 100755 --- a/scripts/celadonmansion5.asm +++ b/scripts/celadonmansion5.asm @@ -15,8 +15,7 @@ CeladonMansion5Text2: ; 1dd46 (7:5d46) call GivePokemon jr nc, .asm_24365 ; 0x1dd4d ld a, $45 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject .asm_24365 ; 0x1dd59 jp TextScriptEnd diff --git a/scripts/celadonmart3.asm b/scripts/celadonmart3.asm index 969fa5f8..8874a743 100755 --- a/scripts/celadonmart3.asm +++ b/scripts/celadonmart3.asm @@ -22,7 +22,7 @@ CeladonMart3TextPointers: ; 48228 (12:4228) CeladonMart3Text1: ; 4824a (12:424a) db $08 ; asm - ld a, [$d778] + ld a, [wd778] bit 7, a jr nz, .asm_a5463 ; 0x48250 ld hl, TM18PreReceiveText @@ -30,7 +30,7 @@ CeladonMart3Text1: ; 4824a (12:424a) ld bc, (TM_18 << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, $d778 + ld hl, wd778 set 7, [hl] ld hl, ReceivedTM18Text jr .asm_81359 ; 0x48268 diff --git a/scripts/celadonmartelevator.asm b/scripts/celadonmartelevator.asm index 9712ef04..1e32647d 100755 --- a/scripts/celadonmartelevator.asm +++ b/scripts/celadonmartelevator.asm @@ -1,5 +1,5 @@ CeladonMartElevatorScript: ; 48600 (12:4600) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] push hl @@ -9,16 +9,16 @@ CeladonMartElevatorScript: ; 48600 (12:4600) res 7, [hl] call nz, CeladonMartElevatorScript_48654 xor a - ld [$cf0c], a + ld [wcf0c], a inc a - ld [$cc3c], a + ld [wcc3c], a ret CeladonMartElevatorScript_4861c: ; 4861c (12:461c) - ld hl, $d3af - ld a, [$d73b] + ld hl, wd3af + ld a, [wd73b] ld b, a - ld a, [$d73c] + ld a, [wd73c] ld c, a call CeladonMartElevatorScript_4862a @@ -35,7 +35,7 @@ CeladonMartElevatorScript_48631: ; 48631 (12:4631) ld hl, CeladonMartElavatorFloors ; $4643 call LoadItemList ld hl, CeldaonMartElevatorWarpMaps ; $464a - ld de, $cc5b + ld de, wcc5b ld bc, $000a jp CopyData @@ -66,6 +66,5 @@ CeladonMartElevatorText1: ; 4865e (12:465e) db $08 ; asm call CeladonMartElevatorScript_48631 ld hl, CeldaonMartElevatorWarpMaps ; $464a - ld a, $61 - call Predef + predef Func_1c9c6 jp TextScriptEnd diff --git a/scripts/celadonmartroof.asm b/scripts/celadonmartroof.asm index d1765575..37025525 100755 --- a/scripts/celadonmartroof.asm +++ b/scripts/celadonmartroof.asm @@ -3,8 +3,8 @@ CeladonMartRoofScript: ; 483d5 (12:43d5) CeladonMartRoofScript_483d8: ; 483d8 (12:43d8) xor a - ld [$cd37], a - ld de, $cc5b + ld [wcd37], a + ld de, wcc5b ld hl, CeladonMartRoofDrinkList ; $4408 .asm_483e2 ld a, [hli] @@ -12,20 +12,19 @@ CeladonMartRoofScript_483d8: ; 483d8 (12:43d8) jr z, .asm_48404 push hl push de - ld [$d11e], a + ld [wd11e], a ld b, a - ld a, $1c - call Predef ; indirect jump to Func_f8a5 (f8a5 (3:78a5)) + predef IsItemInBag_ pop de pop hl ld a, b and a jr z, .asm_483e2 - ld a, [$d11e] + ld a, [wd11e] ld [de], a inc de push hl - ld hl, $cd37 + ld hl, wcd37 inc [hl] pop hl jr .asm_483e2 @@ -41,22 +40,22 @@ CeladonMartRoofDrinkList: ; 48408 (12:4408) db $00 CeladonMartRoofScript_4840c: ; 4840c (12:440c) - ld hl, $d730 + ld hl, wd730 set 6, [hl] ld hl, CeladonMartRoofText_484ee ; $44ee call PrintText xor a - ld [wCurrentMenuItem], a ; $cc26 + ld [wCurrentMenuItem], a ; wCurrentMenuItem ld a, $3 - ld [wMenuWatchedKeys], a ; $cc29 - ld a, [$cd37] + ld [wMenuWatchedKeys], a ; wMenuWatchedKeys + ld a, [wcd37] dec a - ld [wMaxMenuItem], a ; $cc28 + ld [wMaxMenuItem], a ; wMaxMenuItem ld a, $2 - ld [wTopMenuItemY], a ; $cc24 + ld [wTopMenuItemY], a ; wTopMenuItemY ld a, $1 - ld [wTopMenuItemX], a ; $cc25 - ld a, [$cd37] + ld [wTopMenuItemX], a ; wTopMenuItemX + ld a, [wcd37] dec a ld bc, $2 ld hl, $3 @@ -68,13 +67,13 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) call TextBoxBorder call UpdateSprites call CeladonMartRoofScript_48532 - ld hl, $d730 + ld hl, wd730 res 6, [hl] call HandleMenuInput bit 1, a ret nz - ld hl, $cc5b - ld a, [wCurrentMenuItem] ; $cc26 + ld hl, wcc5b + ld a, [wCurrentMenuItem] ; wCurrentMenuItem ld d, $0 ld e, a add hl, de @@ -84,7 +83,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr z, .asm_484b6 cp SODA_POP jr z, .asm_48492 - ld a, [$d778] + ld a, [wd778] bit 6, a jr nz, .asm_484e0 ld hl, CeladonMartRoofText_48515 ; $4515 @@ -95,11 +94,11 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, ReceivedTM49Text call PrintText - ld hl, $d778 + ld hl, wd778 set 6, [hl] ret .asm_48492 - ld a, [$d778] + ld a, [wd778] bit 5, a jr nz, .asm_484e0 ld hl, CeladonMartRoofText_48504 ; $4504 @@ -110,11 +109,11 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, CeladonMartRoofText_4850a ; $450a call PrintText - ld hl, $d778 + ld hl, wd778 set 5, [hl] ret .asm_484b6 - ld a, [$d778] + ld a, [wd778] bit 4, a jr nz, .asm_484e0 ld hl, CeladonMartRoofText_484f3 ; $44f3 @@ -125,7 +124,7 @@ CeladonMartRoofScript_4840c: ; 4840c (12:440c) jr nc, .BagFull ld hl, CeladonMartRoofText_484f9 ; $44f9 call PrintText - ld hl, $d778 + ld hl, wd778 set 4, [hl] ret .BagFull @@ -191,7 +190,7 @@ CeladonMartRoofText_4852c: ; 4852c (12:452c) db "@" CeladonMartRoofScript_48532: ; 48532 (12:4532) - ld hl, $cc5b + ld hl, wcc5b xor a ld [$ffdb], a .asm_48538 @@ -199,14 +198,13 @@ CeladonMartRoofScript_48532: ; 48532 (12:4532) cp $ff ret z push hl - ld [$d11e], a + ld [wd11e], a call GetItemName - FuncCoord 2, 2 ; $c3ca - ld hl, Coord + hlCoord 2, 2 ld a, [$ffdb] ld bc, $28 call AddNTimes - ld de, $cd6d + ld de, wcd6d call PlaceString ld hl, $ffdb inc [hl] @@ -228,15 +226,15 @@ CeladonMartRoofText1: ; 48567 (12:4567) CeladonMartRoofText2: ; 4856c (12:456c) db $08 ; asm call CeladonMartRoofScript_483d8 - ld a, [$cd37] + ld a, [wcd37] and a jr z, .asm_914b9 ; 0x48574 ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ld hl, CeladonMartRoofText4 call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_05aa4 ; 0x48588 call CeladonMartRoofScript_4840c diff --git a/scripts/ceruleancity.asm b/scripts/ceruleancity.asm index 61157bbb..419dbd8c 100755 --- a/scripts/ceruleancity.asm +++ b/scripts/ceruleancity.asm @@ -6,12 +6,11 @@ CeruleanCityScript: ; 19480 (6:5480) CeruleanCityScript_1948c: ; 1948c (6:548c) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_CERULEANCITYCURSCRIPT], a ld a, $5 - ld [$cc4d], a - ld a, $11 - jp Predef + ld [wcc4d], a + predef_jump HideObject CeruleanCityScriptPointers: ; 1949d (6:549d) dw CeruleanCityScript0 @@ -25,25 +24,25 @@ CeruleanCityScript4: ; 194a7 (6:54a7) cp $ff jp z, CeruleanCityScript_1948c ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d75b + ld [wJoyIgnore], a + ld hl, wd75b set 7, [hl] ld a, $2 ld [$ff8c], a call DisplayTextID xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_CERULEANCITYCURSCRIPT], a ret CeruleanCityScript0: ; 194c8 (6:54c8) - ld a, [$d75b] + ld a, [wd75b] bit 7, a jr nz, .asm_194f7 ; 0x194cd $28 ld hl, CeruleanCityCoords1 call ArePlayerCoordsInArray jr nc, .asm_194f7 ; 0x194d5 $20 - ld a, [$cd3d] + ld a, [wWhichTrade] cp $1 ld a, $8 ld b, $0 @@ -51,34 +50,34 @@ CeruleanCityScript0: ; 194c8 (6:54c8) ld a, $4 ld b, $4 .asm_194e6 - ld [$d528], a + ld [wd528], a ld a, b - ld [$c129], a + ld [wSpriteStateData1 + $29], a call Delay3 ld a, $2 ld [$ff8c], a jp DisplayTextID .asm_194f7 - ld a, [$d75a] + ld a, [wd75a] bit 0, a ret nz ld hl, CeruleanCityCoords2 call ArePlayerCoordsInArray ret nc - ld a, [$d700] + ld a, [wd700] and a jr z, .asm_19512 ; 0x19508 $8 ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound .asm_19512 ld c, BANK(Music_MeetRival) ld a, MUSIC_MEET_RIVAL call PlayMusic xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, [W_XCOORD] cp $14 jr z, .asm_19535 ; 0x19526 $d @@ -90,9 +89,8 @@ CeruleanCityScript0: ; 194c8 (6:54c8) ld [hl], $19 .asm_19535 ld a, $5 - ld [$cc4d], a - ld a, $15 - call Predef + ld [wcc4d], a + predef ShowObject ld de, CeruleanCityMovement1 ld a, $1 ld [$ff8c], a @@ -122,15 +120,15 @@ CeruleanCityScript_1955d: ; 1955d (6:555d) jp Func_34a6 ; face object CeruleanCityScript1: ; 19567 (6:5567) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $1 ld [$ff8c], a call DisplayTextID - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, CeruleanCityText_1966d @@ -156,26 +154,26 @@ CeruleanCityScript1: ; 19567 (6:5567) ld [W_TRAINERNO], a xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a call CeruleanCityScript_1955d ld a, $2 ld [W_CERULEANCITYCURSCRIPT], a ret CeruleanCityScript2: ; 195b1 (6:55b1) - ld a, [$d057] + ld a, [W_ISINBATTLE] cp $ff jp z, CeruleanCityScript_1948c call CeruleanCityScript_1955d ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d75a + ld [wJoyIgnore], a + ld hl, wd75a set 0, [hl] ld a, $1 ld [$ff8c], a call DisplayTextID ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound callba Music_RivalAlternateStart ld a, $1 @@ -203,15 +201,14 @@ CeruleanCityMovement4: ; 19608 (6:5608) db $c0,$00,$00,$00,$00,$00,$00,$FF CeruleanCityScript3: ; 19610 (6:5610) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz ld a, $5 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a call Func_2307 ld a, $0 ld [W_CERULEANCITYCURSCRIPT], a @@ -238,7 +235,7 @@ CeruleanCityTextPointers: ; 1962d (6:562d) CeruleanCityText1: ; 1964f (6:564f) db $08 ; asm - ld a, [$d75a] ; rival battle flag + ld a, [wd75a] ; rival battle flag bit 0, a ; do pre-battle text jr z, .PreBattleText @@ -270,19 +267,19 @@ CeruleanCityText_19677: ; 19677 (6:5677) CeruleanCityText2: ; 1967c (6:567c) db $8 - ld a, [$d75b] + ld a, [wd75b] bit 7, a jr nz, .asm_4ca20 ; 0x19682 $29 ld hl, CeruleanCityText_196d9 call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, CeruleanCityText_196ee ld de, CeruleanCityText_196ee call PreBattleSaveRegisters ld a, [$ff8c] - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters ld a, $4 @@ -291,7 +288,7 @@ CeruleanCityText2: ; 1967c (6:567c) .asm_4ca20 ; 0x196ad ld hl, CeruleanCityText_196f3 call PrintText - ld bc, $e401 + ld bc, (TM_28 << 8) + 1 call GiveItem jr c, .Success ld hl, TM28NoRoomText @@ -299,7 +296,7 @@ CeruleanCityText2: ; 1967c (6:567c) jr .Done .Success ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ld hl, ReceivedTM28Text call PrintText callba Func_74872 diff --git a/scripts/ceruleancity2.asm b/scripts/ceruleancity2.asm index db2d12a1..57c9ea4a 100755 --- a/scripts/ceruleancity2.asm +++ b/scripts/ceruleancity2.asm @@ -4,16 +4,13 @@ Func_74872: ; 74872 (1d:4872) ; the screen then fades out, he disappears, and fades back in call GBFadeIn1 ld a, $07 - ld [$CC4D], a - ld a, $15 - call Predef + ld [wcc4d], a + predef ShowObject ld a, $09 - ld [$CC4D], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject ld a, $06 - ld [$CC4D], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject call GBFadeOut1 ret diff --git a/scripts/ceruleangym.asm b/scripts/ceruleangym.asm index 7d35cf71..19296fe2 100755 --- a/scripts/ceruleangym.asm +++ b/scripts/ceruleangym.asm @@ -1,5 +1,5 @@ CeruleanGymScript: ; 5c6b3 (17:46b3) - ld hl, $d126 + ld hl, wd126 bit 6, [hl] res 6, [hl] call nz, CeruleanGymScript_5c6d0 @@ -24,7 +24,7 @@ Gym2LeaderName: ; 5c6e7 (17:46e7) CeruleanGymScript_5c6ed: ; 5c6ed (17:46ed) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_CERULEANGYMCURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -36,17 +36,17 @@ CeruleanGymScriptPointers: ; 5c6f8 (17:46f8) dw CeruleanGymScript3 CeruleanGymScript3: ; 5c700 (17:4700) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, CeruleanGymScript_5c6ed ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a CeruleanGymScript_5c70d: ; 5c70d (17:470d) ld a, $5 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d75e + ld hl, wd75e set 7, [hl] ld bc, (TM_11 << 8) | 1 call GiveItem @@ -54,7 +54,7 @@ CeruleanGymScript_5c70d: ; 5c70d (17:470d) ld a, $6 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d75e + ld hl, wd75e set 6, [hl] jr .asm_5c736 .BagFull @@ -64,11 +64,11 @@ CeruleanGymScript_5c70d: ; 5c70d (17:470d) .asm_5c736 ld hl, W_OBTAINEDBADGES set 1, [hl] - ld hl, $d72a + ld hl, wd72a set 1, [hl] ; deactivate gym trainers - ld hl, $d75e + ld hl, wd75e set 2, [hl] set 3, [hl] @@ -87,7 +87,7 @@ CeruleanGymTrainerHeaders: ; 5c758 (17:4758) CeruleanGymTrainerHeader0: ; 5c758 (17:4758) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d75e ; flag's byte + dw wd75e ; flag's byte dw CeruleanGymBattleText1 ; 0x47e9 TextBeforeBattle dw CeruleanGymAfterBattleText1 ; 0x47f3 TextAfterBattle dw CeruleanGymEndBattleText1 ; 0x47ee TextEndBattle @@ -96,7 +96,7 @@ CeruleanGymTrainerHeader0: ; 5c758 (17:4758) CeruleanGymTrainerHeader1: ; 5c764 (17:4764) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d75e ; flag's byte + dw wd75e ; flag's byte dw CeruleanGymBattleText2 ; 0x4802 TextBeforeBattle dw CeruleanGymAfterBattleText2 ; 0x480c TextAfterBattle dw CeruleanGymEndBattleText2 ; 0x4807 TextEndBattle @@ -106,7 +106,7 @@ CeruleanGymTrainerHeader1: ; 5c764 (17:4764) CeruleanGymText1: ; 5c771 (17:4771) db $08 ; asm - ld a, [$d75e] + ld a, [wd75e] bit 7, a jr z, .asm_10854 ; 0x5c777 bit 6, a @@ -121,18 +121,18 @@ CeruleanGymText1: ; 5c771 (17:4771) .asm_10854 ; 0x5c78d ld hl, CeruleanGymText_5c7be call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, CeruleanGymText_5c7d8 ld de, CeruleanGymText_5c7d8 call PreBattleSaveRegisters ldh a, [$8c] - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters ld a, $2 - ld [$d05c], a + ld [W_GYMLEADERNO], a xor a ldh [$b4], a ld a, $3 @@ -203,7 +203,7 @@ CeruleanGymAfterBattleText2: ; 5c80c (17:480c) CeruleanGymText4: ; 5c811 (17:4811) db $08 ; asm - ld a, [$d75e] + ld a, [wd75e] bit 7, a jr nz, .asm_f80ce ; 0x5c817 ld hl, CeruleanGymText_5c82a diff --git a/scripts/ceruleanhouse1.asm b/scripts/ceruleanhouse1.asm index 6bc1cd30..27a91ab5 100755 --- a/scripts/ceruleanhouse1.asm +++ b/scripts/ceruleanhouse1.asm @@ -13,6 +13,5 @@ CeruleanHouse1Text2: ; 1d702 (7:5702) db $08 ; asm ld a, $6 ld [wWhichTrade], a - ld a, $54 - call Predef + predef Predef54 jp TextScriptEnd diff --git a/scripts/ceruleanhouse2.asm b/scripts/ceruleanhouse2.asm index eae26047..a45c0fda 100755 --- a/scripts/ceruleanhouse2.asm +++ b/scripts/ceruleanhouse2.asm @@ -1,8 +1,8 @@ CeruleanHouse2Script: ; 74e09 (1d:4e09) ld a, $1 - ld [$cf0c], a + ld [wcf0c], a dec a - ld [$cc3c], a + ld [wcc3c], a ret CeruleanHouse2TextPointers: ; 74e13 (1d:4e13) @@ -20,20 +20,20 @@ CeruleanHouse2Text1: ; 74e15 (1d:4e15) call PrintText ld hl, BadgeItemList call LoadItemList - ld hl, $cf7b + ld hl, wStringBuffer2 + 11 ld a, l - ld [$cf8b], a + ld [wcf8b], a ld a, h - ld [$cf8c], a + ld [wcf8c], a xor a - ld [$cf93], a - ld [$cc35], a + ld [wcf93], a + ld [wcc35], a ld a, SPECIALLISTMENU ld [wListMenuID], a call DisplayListMenuID jr c, .asm_74e60 ; 0x74e49 $15 ld hl, TextPointers_74e86 - ld a, [$cf91] + ld a, [wcf91] sub $15 add a ld d, $0 diff --git a/scripts/ceruleanhousetrashed.asm b/scripts/ceruleanhousetrashed.asm index 1bb60564..02b40dcb 100755 --- a/scripts/ceruleanhousetrashed.asm +++ b/scripts/ceruleanhousetrashed.asm @@ -10,8 +10,7 @@ CeruleanHouseTrashedTextPointers: ; 1d689 (7:5689) CeruleanHouseTrashedText1: ; 1d68f (7:568f) db $08 ; asm ld b, $e4 - ld a, $1c - call Predef + predef IsItemInBag_ and b jr z, .asm_f8734 ; 0x1d698 ld hl, CeruleanHouseTrashedText_1d6b0 diff --git a/scripts/cinnabargym.asm b/scripts/cinnabargym.asm index 1d66a1bf..8ce02e81 100755 --- a/scripts/cinnabargym.asm +++ b/scripts/cinnabargym.asm @@ -6,7 +6,7 @@ CinnabarGymScript: ; 7574a (1d:574a) jp CallFunctionInTable CinnabarGymScript_75759: ; 75759 (1d:5759) - ld hl, $D126 + ld hl, wd126 bit 6, [hl] res 6, [hl] push hl @@ -15,7 +15,7 @@ CinnabarGymScript_75759: ; 75759 (1d:5759) bit 5, [hl] res 5, [hl] call nz, Func_3ead - ld hl, $D79B + ld hl, wd79b res 7, [hl] ret CinnabarGymScript_75772: ; 75772 (1d:5772) @@ -30,10 +30,10 @@ Gym7LeaderName: ; 7578b (1d:578b) CinnabarGymScript_75792: ; 75792 (1d:5792) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_CINNABARGYMCURSCRIPT], a ld [W_CURMAPSCRIPT], a - ld [$da38], a + ld [wda38], a ret CinnabarGymScript_757a0: ; 757a0 (1d:57a0) @@ -48,20 +48,20 @@ CinnabarGymScriptPointers: ; 757a6 (1d:57a6) dw CinnabarGymScript3 CinnabarGymScript0: ; 757ae (1d:57ae) - ld a, [$da38] + ld a, [wda38] and a ret z ld [$ff8c], a cp $4 jr nz, .asm_757c3 ; 0x757b7 $a ld a, $4 - ld [$d528], a + ld [wd528], a ld de, MovementData_757d7 jr .asm_757cb ; 0x757c1 $8 .asm_757c3 ld de, MovementData_757da ld a, $1 - ld [$d528], a + ld [wd528], a .asm_757cb call MoveSprite ld a, $1 @@ -76,29 +76,28 @@ MovementData_757da: ; 757da (1d:57da) db $80,$FF CinnabarGymScript1: ; 757dc (1d:57dc) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz xor a - ld [wJoypadForbiddenButtonsMask], a - ld a, [$da38] + ld [wJoyIgnore], a + ld a, [wda38] ld [wTrainerHeaderFlagBit], a ld [$ff8c], a jp DisplayTextID CinnabarGymScript_757f1: ; 757f1 (1d:57f1) - ld a, $10 - jp Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + predef_jump FlagActionPredef CinnabarGymScript2: ; 757f6 (1d:57f6) - ld a, [$d057] + ld a, [W_ISINBATTLE] cp $ff jp z, CinnabarGymScript_75792 ld a, [wTrainerHeaderFlagBit] ld [$ffdb], a ld c, a ld b, $2 - ld hl, $d79a + ld hl, wd79a call CinnabarGymScript_757f1 ld a, c and a @@ -112,34 +111,34 @@ CinnabarGymScript2: ; 757f6 (1d:57f6) ld [$ffdb], a ld c, a ld b, $1 - ld hl, $d79a + ld hl, wd79a call CinnabarGymScript_757f1 ld a, [wTrainerHeaderFlagBit] sub $2 ld c, a ld b, $1 - ld hl, $d79c + ld hl, wd79c call CinnabarGymScript_757f1 call Func_3ead xor a - ld [wJoypadForbiddenButtonsMask], a - ld [$da38], a + ld [wJoyIgnore], a + ld [wda38], a ld a, $0 ld [W_CINNABARGYMCURSCRIPT], a ld [W_CURMAPSCRIPT], a ret CinnabarGymScript3: ; 7584a (1d:584a) - ld a, [$d057] + ld a, [W_ISINBATTLE] cp $ff jp z, CinnabarGymScript_75792 ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a CinnabarGymScript3_75857: ; 75857 (1d:5857) ld a, $a ld [$ff8c], a call DisplayTextID - ld hl, $d79a + ld hl, wd79a set 1, [hl] ld bc, (TM_38 << 8) | 1 call GiveItem @@ -147,7 +146,7 @@ CinnabarGymScript3_75857: ; 75857 (1d:5857) ld a, $b ld [$ff8c], a call DisplayTextID - ld hl, $d79a + ld hl, wd79a set 0, [hl] jr .asm_75880 ; 0x75877 $7 .BagFull @@ -157,17 +156,17 @@ CinnabarGymScript3_75857: ; 75857 (1d:5857) .asm_75880 ld hl, W_OBTAINEDBADGES set 6, [hl] - ld hl, $d72a + ld hl, wd72a set 6, [hl] ; deactivate gym trainers - ld a, [$d79a] + ld a, [wd79a] or %11111100 - ld [$d79a], a - ld hl, $d79b + ld [wd79a], a + ld hl, wd79b set 0, [hl] - ld hl, $d126 + ld hl, wd126 set 5, [hl] jp CinnabarGymScript_75792 @@ -188,13 +187,13 @@ CinnabarGymTextPointers: ; 7589f (1d:589f) CinnabarGymScript_758b7: ; 758b7 (1d:58b7) ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] - ld a, [$cf13] + ld a, [wcf13] cp $1 jr z, .asm_758d4 ld a, $2 @@ -208,7 +207,7 @@ CinnabarGymScript_758b7: ; 758b7 (1d:58b7) CinnabarGymText1: ; 758df (1d:58df) db $8 - ld a, [$d79a] + ld a, [wd79a] bit 1, a jr z, .asm_d9332 ; 0x758e5 $16 bit 0, a @@ -227,7 +226,7 @@ CinnabarGymText1: ; 758df (1d:58df) ld de, BlaineEndBattleText call PreBattleSaveRegisters ld a, $7 - ld [$d05c], a + ld [W_GYMLEADERNO], a jp CinnabarGymScript_758b7 BlaineBattleText: ; 75914 (1d:5914) @@ -261,7 +260,7 @@ TM38NoRoomText: ; 75934 (1d:5934) CinnabarGymText2: ; 75939 (1d:5939) db $08 ; asm call CinnabarGymScript_757a0 - ld a, [$d79a] + ld a, [wd79a] bit 2, a jr nz, .asm_46bb4 ; 0x75942 ld hl, CinnabarGymText_7595f @@ -290,7 +289,7 @@ CinnabarGymText_75969: ; 75969 (1d:5969) CinnabarGymText3: ; 7596e (1d:596e) db $08 ; asm call CinnabarGymScript_757a0 - ld a, [$d79a] + ld a, [wd79a] bit 3, a jr nz, .asm_4b406 ; 0x75977 ld hl, CinnabarGymText_75994 @@ -319,7 +318,7 @@ CinnabarGymText_7599e: ; 7599e (1d:599e) CinnabarGymText4: ; 759a3 (1d:59a3) db $08 ; asm call CinnabarGymScript_757a0 - ld a, [$d79a] + ld a, [wd79a] bit 4, a jr nz, .asm_c0673 ; 0x759ac ld hl, CinnabarGymText_759c9 @@ -348,7 +347,7 @@ CinnabarGymText_759d3: ; 759d3 (1d:59d3) CinnabarGymText5: ; 759d8 (1d:59d8) db $08 ; asm call CinnabarGymScript_757a0 - ld a, [$d79a] + ld a, [wd79a] bit 5, a jr nz, .asm_5cfd7 ; 0x759e1 ld hl, CinnabarGymText_759fe @@ -377,7 +376,7 @@ CinnabarGymText_75a08: ; 75a08 (1d:5a08) CinnabarGymText6: ; 75a0d (1d:5a0d) db $08 ; asm call CinnabarGymScript_757a0 - ld a, [$d79a] + ld a, [wd79a] bit 6, a jr nz, .asm_776b4 ; 0x75a16 ld hl, CinnabarGymText_75a33 @@ -406,7 +405,7 @@ CinnabarGymText_75a3d: ; 75a3d (1d:5a3d) CinnabarGymText7: ; 75a42 (1d:5a42) db $08 ; asm call CinnabarGymScript_757a0 - ld a, [$d79a] + ld a, [wd79a] bit 7, a jr nz, .asm_2f755 ; 0x75a4b ld hl, CinnabarGymText_75a68 @@ -435,7 +434,7 @@ CinnabarGymText_75a72: ; 75a72 (1d:5a72) CinnabarGymText8: ; 75a77 (1d:5a77) db $08 ; asm call CinnabarGymScript_757a0 - ld a, [$d79b] + ld a, [wd79b] bit 0, a jr nz, .asm_d87be ; 0x75a80 ld hl, CinnabarGymText_75a9d @@ -463,7 +462,7 @@ CinnabarGymText_75aa7: ; 75aa7 (1d:5aa7) CinnabarGymText9: ; 75aac (1d:5aac) db $08 ; asm - ld a, [$d79a] + ld a, [wd79a] bit 1, a jr nz, .asm_627d9 ; 0x75ab2 ld hl, CinnabarGymText_75ac2 diff --git a/scripts/cinnabarisland.asm b/scripts/cinnabarisland.asm index ab77926a..8d27198b 100755 --- a/scripts/cinnabarisland.asm +++ b/scripts/cinnabarisland.asm @@ -1,10 +1,10 @@ CinnabarIslandScript: ; 1ca19 (7:4a19) call EnableAutoTextBoxDrawing - ld hl, $d126 + ld hl, wd126 set 5, [hl] - ld hl, $d796 + ld hl, wd796 res 0, [hl] - ld hl, $d7a3 + ld hl, wd7a3 res 1, [hl] ld hl, CinnabarIslandScriptPointers ld a, [W_CINNABARISLANDCURSCRIPT] @@ -25,26 +25,26 @@ CinnabarIslandScript0: ; 1ca38 (7:4a38) cp $12 ret nz ld a, $8 - ld [$d528], a + ld [wd528], a ld a, $8 ld [$ff8c], a call DisplayTextID xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $1 - ld [$cd38], a + ld [wcd38], a ld a, $80 - ld [$ccd3], a + ld [wccd3], a call Func_3486 xor a - ld [$c109], a - ld [wJoypadForbiddenButtonsMask], a + ld [wSpriteStateData1 + 9], a + ld [wJoyIgnore], a ld a, $1 ld [W_CINNABARISLANDCURSCRIPT], a ret CinnabarIslandScript1: ; 1ca73 (7:4a73) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 diff --git a/scripts/copycatshouse2f.asm b/scripts/copycatshouse2f.asm index afe589da..ea1e91b3 100755 --- a/scripts/copycatshouse2f.asm +++ b/scripts/copycatshouse2f.asm @@ -12,11 +12,11 @@ CopycatsHouse2FTextPointers: ; 5cc74 (17:4c74) CopycatsHouse2FText1: ; 5cc82 (17:4c82) db $08 ; asm - ld a, [$d7af] + ld a, [wd7af] bit 0, a jr nz, .asm_7ccf3 ; 0x5cc88 ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ld hl, CopycatsHouse2FText_5ccd4 call PrintText ld b, POKE_DOLL @@ -32,7 +32,7 @@ CopycatsHouse2FText1: ; 5cc82 (17:4c82) ld a, POKE_DOLL ldh [$db], a callba RemoveItemByID - ld hl, $d7af + ld hl, wd7af set 0, [hl] jr .asm_62ecd ; 0x5ccc1 .BagFull @@ -84,7 +84,7 @@ CopycatsHouse2FText6: ; 5ccfe (17:4cfe) CopycatsHouse2FText7: ; 5cd03 (17:4d03) db $08 ; asm - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 ld hl, CopycatsHouse2FText_5cd1c jr nz, .asm_399a4 ; 0x5cd0c diff --git a/scripts/daycarem.asm b/scripts/daycarem.asm index 706a7bbf..e463d380 100755 --- a/scripts/daycarem.asm +++ b/scripts/daycarem.asm @@ -13,20 +13,20 @@ DayCareMText1: ; 56254 (15:6254) ld hl, DayCareMText_5640f call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a ld hl, DayCareMText_5643b jp nz, DayCareMScript_56409 - ld a, [$d163] + ld a, [wPartyCount] dec a ld hl, DayCareMText_56445 jp z, DayCareMScript_56409 ld hl, DayCareMText_56414 call PrintText xor a - ld [$cfcb], a - ld [$d07d], a - ld [$cc35], a + ld [wcfcb], a + ld [wd07d], a + ld [wcc35], a call DisplayPartyMenu push af call GBPalWhiteOutWithDelay3 @@ -39,21 +39,21 @@ DayCareMText1: ; 56254 (15:6254) ld hl, DayCareMText_5644a jp c, DayCareMScript_56409 xor a - ld [$cc2b], a + ld [wcc2b], a ld a, [wWhichPokemon] - ld hl, $d2b5 + ld hl, wPartyMonNicks call GetPartyMonName ld hl, DayCareMText_56419 call PrintText ld a, $1 ld [W_DAYCARE_IN_USE], a ld a, $3 - ld [$cf95], a + ld [wcf95], a call Func_3a68 xor a - ld [$cf95], a + ld [wcf95], a call RemovePokemon - ld a, [$cf91] + ld a, [wcf91] call PlayCry ld hl, DayCareMText_5641e jp DayCareMScript_56409 @@ -63,7 +63,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) ld hl, W_DAYCAREMONNAME call GetPartyMonName ld a, $3 - ld [$cc49], a + ld [wcc49], a call LoadMonData callab Func_58f43 ld a, d @@ -71,7 +71,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) jr c, .asm_56315 ld d, $64 callab CalcExperience - ld hl, $da6d + ld hl, wDayCareMonExp ld a, [H_NUMTOPRINT] ld [hli], a ld a, [$ff97] @@ -83,7 +83,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) .asm_56315 xor a ld [wTrainerEngageDistance], a - ld hl, $da62 + ld hl, wDayCareMonBoxLevel ld a, [hl] ld [wTrainerSpriteOffset], a cp d @@ -99,7 +99,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) .asm_56333 call PrintText - ld a, [W_NUMINPARTY] + ld a, [wPartyCount] cp $6 ld hl, DayCareMText_56440 jp z, .asm_56403 @@ -120,8 +120,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) push hl push de push bc - ld a, $b - call Predef + predef AddBCDPredef pop bc pop de pop hl @@ -130,7 +129,7 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) ld hl, DayCareMText_56428 call PrintText ld a, $13 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID call YesNoChoice ld hl, DayCareMText_56437 @@ -154,38 +153,36 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) ld hl, wTrainerEngageDistance ld [hli], a inc hl - ld de, $d349 + ld de, wPlayerMoney + 2 ld c, $3 - ld a, $c - call Predef + predef SubBCDPredef ld a, (SFX_02_5a - SFX_Headers_02) / 3 call PlaySoundWaitForCurrent ld a, $13 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID ld hl, DayCareMText_5644f call PrintText ld a, $2 - ld [$cf95], a + ld [wcf95], a call Func_3a68 - ld a, [W_DAYCAREMONDATA] - ld [$cf91], a - ld a, [W_NUMINPARTY] + ld a, [wDayCareMonSpecies] + ld [wcf91], a + ld a, [wPartyCount] dec a push af ld bc, $002c push bc - ld hl, W_PARTYMON1_MOVE1 + ld hl, wPartyMon1Moves call AddNTimes ld d, h ld e, l ld a, $1 ld [wHPBarMaxHP], a - ld a, $3e - call Predef + predef WriteMonMoves pop bc pop af - ld hl, W_PARTYMON1_HP + ld hl, wPartyMon1HP call AddNTimes ld d, h ld e, l @@ -196,14 +193,14 @@ DayCareMScript_562e1: ; 562e1 (15:62e1) inc de ld a, [hl] ld [de], a - ld a, [$cf91] + ld a, [wcf91] call PlayCry ld hl, DayCareMText_5642d jr DayCareMScript_56409 .asm_56403 ld a, [wTrainerSpriteOffset] - ld [$da62], a + ld [wDayCareMonBoxLevel], a DayCareMScript_56409: ; 56409 (15:6409) call PrintText diff --git a/scripts/fanclub.asm b/scripts/fanclub.asm index 8ea8d36d..f9a839fa 100755 --- a/scripts/fanclub.asm +++ b/scripts/fanclub.asm @@ -3,7 +3,7 @@ FanClubScript: ; 59b70 (16:5b70) FanClubBikeInBag: ; check if any bike paraphernalia in bag - ld a, [$d771] + ld a, [wd771] bit 1, a ; got bike voucher? ret nz ld b, BICYCLE @@ -25,18 +25,18 @@ FanClubTextPointers: ; 59b84 (16:5b84) FanClubText1: ; pikachu fan db $08 ; asm - ld a, [$d771] + ld a, [wd771] bit 7, a jr nz, .mineisbetter ld hl, .normaltext call PrintText - ld hl, $d771 + ld hl, wd771 set 6, [hl] jr .done .mineisbetter ld hl, .bettertext call PrintText - ld hl, $d771 + ld hl, wd771 res 7, [hl] .done jp TextScriptEnd @@ -52,18 +52,18 @@ FanClubText1: FanClubText2: ; seel fan db $08 ; asm - ld a, [$d771] + ld a, [wd771] bit 6, a jr nz, .mineisbetter ld hl, .normaltext call PrintText - ld hl, $d771 + ld hl, wd771 set 7, [hl] jr .done .mineisbetter ld hl, .bettertext call PrintText - ld hl, $d771 + ld hl, wd771 res 6, [hl] .done jp TextScriptEnd @@ -113,7 +113,7 @@ FanClubText5: ld hl, .meetchairtext call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .nothanks @@ -125,7 +125,7 @@ FanClubText5: jr nc, .BagFull ld hl, .receivedvouchertext call PrintText - ld hl, $d771 + ld hl, wd771 set 1, [hl] jr .done .BagFull diff --git a/scripts/fightingdojo.asm b/scripts/fightingdojo.asm index 4dc7fe7b..5f244781 100755 --- a/scripts/fightingdojo.asm +++ b/scripts/fightingdojo.asm @@ -9,9 +9,9 @@ FightingDojoScript: ; 5cd5d (17:4d5d) FightingDojoScript_5cd70: ; 5cd70 (17:4d70) xor a - ld [$cd6b], a - ld [$d642], a - ld [$da39], a + ld [wJoyIgnore], a + ld [W_FIGHTINGDOJOCURSCRIPT], a + ld [W_CURMAPSCRIPT], a ret FightingDojoScriptPointers: ; 5cd7b (17:4d7b) @@ -21,19 +21,19 @@ FightingDojoScriptPointers: ; 5cd7b (17:4d7b) dw FightingDojoScript3 FightingDojoScript1: ; 5cd83 (17:4d83) - ld a, [$d7b1] + ld a, [wd7b1] bit 0, a ret nz call CheckFightingMapTrainers ld a, [wTrainerHeaderFlagBit] and a ret nz - ld a, [$d7b1] + ld a, [wd7b1] bit 1, a ret nz xor a - ld [H_CURRENTPRESSEDBUTTONS], a - ld [$cf0d], a + ld [hJoyHeld], a + ld [wcf0d], a ld a, [W_YCOORD] cp $3 ret nz @@ -41,9 +41,9 @@ FightingDojoScript1: ; 5cd83 (17:4d83) cp $4 ret nz ld a, $1 - ld [$cf0d], a + ld [wcf0d], a ld a, $1 - ld [$d528], a + ld [wd528], a ld a, $1 ld [$ff8c], a ld a, $8 @@ -55,14 +55,14 @@ FightingDojoScript1: ; 5cd83 (17:4d83) ret FightingDojoScript3: ; 5cdc6 (17:4dc6) - ld a, [$d057] + ld a, [W_ISINBATTLE] cp $ff jp z, FightingDojoScript_5cd70 - ld a, [$cf0d] + ld a, [wcf0d] and a jr z, .asm_5cde4 ld a, $1 - ld [$d528], a + ld [wd528], a ld a, $1 ld [$ff8c], a ld a, $8 @@ -71,17 +71,17 @@ FightingDojoScript3: ; 5cdc6 (17:4dc6) .asm_5cde4 ld a, $f0 - ld [$cd6b], a - ld a, [$d7b1] + ld [wJoyIgnore], a + ld a, [wd7b1] or $3e - ld [$d7b1], a + ld [wd7b1], a ld a, $8 ld [$ff8c], a call DisplayTextID xor a - ld [$cd6b], a - ld [$d642], a - ld [$da39], a + ld [wJoyIgnore], a + ld [W_FIGHTINGDOJOCURSCRIPT], a + ld [W_CURMAPSCRIPT], a ret FightingDojoTextPointers: ; 5ce03 (17:4e03) @@ -98,7 +98,7 @@ FightingDojoTrainerHeaders: ; 5ce13 (17:4e13) FightingDojoTrainerHeader0: ; 5ce13 (17:4e13) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7b1 ; flag's byte + dw wd7b1 ; flag's byte dw FightingDojoBattleText1 ; 0x4eac TextBeforeBattle dw FightingDojoAfterBattleText1 ; 0x4eb6 TextAfterBattle dw FightingDojoEndBattleText1 ; 0x4eb1 TextEndBattle @@ -107,7 +107,7 @@ FightingDojoTrainerHeader0: ; 5ce13 (17:4e13) FightingDojoTrainerHeader1: ; 5ce1f (17:4e1f) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7b1 ; flag's byte + dw wd7b1 ; flag's byte dw FightingDojoBattleText2 ; 0x4ec5 TextBeforeBattle dw FightingDojoAfterBattleText2 ; 0x4ecf TextAfterBattle dw FightingDojoEndBattleText2 ; 0x4eca TextEndBattle @@ -116,7 +116,7 @@ FightingDojoTrainerHeader1: ; 5ce1f (17:4e1f) FightingDojoTrainerHeader2: ; 5ce2b (17:4e2b) db $4 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7b1 ; flag's byte + dw wd7b1 ; flag's byte dw FightingDojoBattleText3 ; 0x4ede TextBeforeBattle dw FightingDojoAfterBattleText3 ; 0x4ee8 TextAfterBattle dw FightingDojoEndBattleText3 ; 0x4ee3 TextEndBattle @@ -125,7 +125,7 @@ FightingDojoTrainerHeader2: ; 5ce2b (17:4e2b) FightingDojoTrainerHeader3: ; 5ce37 (17:4e37) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7b1 ; flag's byte + dw wd7b1 ; flag's byte dw FightingDojoBattleText4 ; 0x4ef7 TextBeforeBattle dw FightingDojoAfterBattleText4 ; 0x4f01 TextAfterBattle dw FightingDojoEndBattleText4 ; 0x4efc TextEndBattle @@ -135,21 +135,21 @@ FightingDojoTrainerHeader3: ; 5ce37 (17:4e37) FightingDojoText1: ; 5ce44 (17:4e44) db $08 ; asm - ld a, [$d7b1] + ld a, [wd7b1] bit 0, a jp nz, .continue1 bit 1, a jp nz, .continue2 ld hl, FightingDojoText_5ce8e call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, FightingDojoText_5ce93 ld de, FightingDojoText_5ce93 call PreBattleSaveRegisters ldh a, [$8c] - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters ld a, $3 @@ -257,7 +257,7 @@ FightingDojoAfterBattleText4: ; 5cf01 (17:4f01) FightingDojoText6: ; 5cf06 (17:4f06) ; Hitmonlee Poké Ball db $08 ; asm - ld a, [$d7b1] + ld a, [wd7b1] and %11000000 jr z, .GetMon ld hl, OtherHitmonText @@ -269,10 +269,10 @@ FightingDojoText6: ; 5cf06 (17:4f06) ld hl, WantHitmonleeText call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .done - ld a, [$cf91] + ld a, [wcf91] ld b, a ld c, 30 call GivePokemon @@ -280,10 +280,9 @@ FightingDojoText6: ; 5cf06 (17:4f06) ; once Poké Ball is taken, hide sprite ld a, $4a - ld [$cc4d], a - ld a, $11 - call Predef - ld hl, $d7b1 + ld [wcc4d], a + predef HideObject + ld hl, wd7b1 set 6, [hl] set 0, [hl] .done @@ -296,7 +295,7 @@ WantHitmonleeText: ; 5cf49 (17:4f49) FightingDojoText7: ; 5cf4e (17:4f4e) ; Hitmonchan Poké Ball db $08 ; asm - ld a, [$d7b1] + ld a, [wd7b1] and %11000000 jr z, .GetMon ld hl, OtherHitmonText @@ -308,23 +307,22 @@ FightingDojoText7: ; 5cf4e (17:4f4e) ld hl, WantHitmonchanText call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .done - ld a, [$cf91] + ld a, [wcf91] ld b, a ld c,30 call GivePokemon jr nc, .done - ld hl, $d7b1 + ld hl, wd7b1 set 7, [hl] set 0, [hl] ; once Poké Ball is taken, hide sprite ld a, $4b - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject .done jp TextScriptEnd diff --git a/scripts/fuchsiacity.asm b/scripts/fuchsiacity.asm index 9014dffe..6b7e067b 100755 --- a/scripts/fuchsiacity.asm +++ b/scripts/fuchsiacity.asm @@ -135,7 +135,7 @@ FuchsiaCityLaprasText: ; 19aef (6:5aef) FuchsiaCityText24: ; 19af4 (6:5af4) db $08 ; asm - ld a, [$d7f6] + ld a, [wd7f6] bit 6, a jr nz, .asm_3b4e8 ; 0x19afa bit 7, a diff --git a/scripts/fuchsiagym.asm b/scripts/fuchsiagym.asm index 789c2367..09a767eb 100755 --- a/scripts/fuchsiagym.asm +++ b/scripts/fuchsiagym.asm @@ -9,7 +9,7 @@ FuchsiaGymScript: ; 7543d (1d:543d) ret FuchsiaGymScript_75453: ; 75453 (1d:5453) - ld hl, $D126 + ld hl, wd126 bit 6, [hl] res 6, [hl] ret z @@ -25,7 +25,7 @@ Gym5LeaderName: ; 75472 (1d:5472) FuchsiaGymScript_75477: ; 75477 (1d:5477) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_FUCHSIAGYMCURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -37,16 +37,16 @@ FuchsiaGymScriptPointers: ; 75482 (1d:5482) dw FuchsiaGymScript3 FuchsiaGymScript3: ; 7548a (1d:548a) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, FuchsiaGymScript_75477 ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a FuchsiaGymScript3_75497: ; 75497 (1d:5497) ld a, $9 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d792 + ld hl, wd792 set 1, [hl] ld bc, (TM_06 << 8) | 1 call GiveItem @@ -54,7 +54,7 @@ FuchsiaGymScript3_75497: ; 75497 (1d:5497) ld a, $a ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d792 + ld hl, wd792 set 0, [hl] jr .asm_754c0 .BagFull @@ -64,13 +64,13 @@ FuchsiaGymScript3_75497: ; 75497 (1d:5497) .asm_754c0 ld hl, W_OBTAINEDBADGES set 4, [hl] - ld hl, $d72a + ld hl, wd72a set 4, [hl] ; deactivate gym trainers - ld a, [$d792] + ld a, [wd792] or %11111100 - ld [$d792], a + ld [wd792], a jp FuchsiaGymScript_75477 @@ -91,7 +91,7 @@ FuchsiaGymTrainerHeaders: ; 754eb (1d:54eb) FuchsiaGymTrainerHeader0: ; 754eb (1d:54eb) db $2 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d792 ; flag's byte + dw wd792 ; flag's byte dw FuchsiaGymBattleText1 ; 0x55ae TextBeforeBattle dw FuchsiaGymAfterBattleText1 ; 0x55b8 TextAfterBattle dw FuchsiaGymEndBattleText1 ; 0x55b3 TextEndBattle @@ -100,7 +100,7 @@ FuchsiaGymTrainerHeader0: ; 754eb (1d:54eb) FuchsiaGymTrainerHeader2: ; 754f7 (1d:54f7) db $3 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d792 ; flag's byte + dw wd792 ; flag's byte dw FuchsiaGymBattleText2 ; 0x55c7 TextBeforeBattle dw FuchsiaGymAfterBattleText2 ; 0x55d1 TextAfterBattle dw FuchsiaGymEndBattleText2 ; 0x55cc TextEndBattle @@ -109,7 +109,7 @@ FuchsiaGymTrainerHeader2: ; 754f7 (1d:54f7) FuchsiaGymTrainerHeader3: ; 75503 (1d:5503) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d792 ; flag's byte + dw wd792 ; flag's byte dw FuchsiaGymBattleText3 ; 0x55e0 TextBeforeBattle dw FuchsiaGymAfterBattleText3 ; 0x55ea TextAfterBattle dw FuchsiaGymEndBattleText3 ; 0x55e5 TextEndBattle @@ -118,7 +118,7 @@ FuchsiaGymTrainerHeader3: ; 75503 (1d:5503) FuchsiaGymTrainerHeader4: ; 7550f (1d:550f) db $5 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d792 ; flag's byte + dw wd792 ; flag's byte dw FuchsiaGymBattleText4 ; 0x55f9 TextBeforeBattle dw FuchsiaGymAfterBattleText4 ; 0x5603 TextAfterBattle dw FuchsiaGymEndBattleText4 ; 0x55fe TextEndBattle @@ -127,7 +127,7 @@ FuchsiaGymTrainerHeader4: ; 7550f (1d:550f) FuchsiaGymTrainerHeader5: ; 7551b (1d:551b) db $6 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d792 ; flag's byte + dw wd792 ; flag's byte dw FuchsiaGymBattleText5 ; 0x5612 TextBeforeBattle dw FuchsiaGymAfterBattleText5 ; 0x561c TextAfterBattle dw FuchsiaGymEndBattleText5 ; 0x5617 TextEndBattle @@ -136,7 +136,7 @@ FuchsiaGymTrainerHeader5: ; 7551b (1d:551b) FuchsiaGymTrainerHeader6: ; 75527 (1d:5527) db $7 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d792 ; flag's byte + dw wd792 ; flag's byte dw FuchsiaGymBattleText6 ; 0x562b TextBeforeBattle dw FuchsiaGymAfterBattleText6 ; 0x5635 TextAfterBattle dw FuchsiaGymEndBattleText6 ; 0x5630 TextEndBattle @@ -146,7 +146,7 @@ FuchsiaGymTrainerHeader6: ; 75527 (1d:5527) FuchsiaGymText1: ; 75534 (1d:5534) db $08 ; asm - ld a, [$d792] + ld a, [wd792] bit 1, a jr z, .asm_181b6 ; 0x7553a bit 0, a @@ -161,18 +161,18 @@ FuchsiaGymText1: ; 75534 (1d:5534) .asm_181b6 ; 0x75550 ld hl, UnnamedText_75581 call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, UnnamedText_75586 ld de, UnnamedText_75586 call PreBattleSaveRegisters ldh a, [$8c] - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters ld a, $5 - ld [$d05c], a + ld [W_GYMLEADERNO], a xor a ldh [$b4], a ld a, $3 @@ -318,7 +318,7 @@ FuchsiaGymAfterBattleText6: ; 75635 (1d:5635) FuchsiaGymText8: ; 7563a (1d:563a) db $08 ; asm - ld a, [$d792] + ld a, [wd792] bit 1, a ld hl, UnnamedText_75653 jr nz, .asm_50671 ; 0x75643 diff --git a/scripts/fuchsiahouse2.asm b/scripts/fuchsiahouse2.asm index 82957d2d..33bae7e4 100755 --- a/scripts/fuchsiahouse2.asm +++ b/scripts/fuchsiahouse2.asm @@ -10,19 +10,19 @@ FuchsiaHouse2TextPointers: ; 750b8 (1d:50b8) FuchsiaHouse2Text1: ; 750c2 (1d:50c2) db $08 ; asm - ld a, [$d78e] + ld a, [wd78e] bit 0, a jr nz, .subtract ; 0x750c8 ld b,GOLD_TEETH call IsItemInBag jr nz, .asm_3f30f ; 0x750cf - ld a, [$d78e] + ld a, [wd78e] bit 1, a jr nz, .asm_60cba ; 0x750d6 ld hl, WardenGibberishText1 call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a ld hl, WardenGibberishText3 jr nz, .asm_61238 ; 0x750e8 @@ -36,7 +36,7 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) ld a, GOLD_TEETH ldh [$db], a callba RemoveItemByID - ld hl, $d78e + ld hl, wd78e set 1, [hl] .asm_60cba ; 0x75109 ld hl, WardenThankYouText @@ -46,7 +46,7 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) jr nc, .BagFull ld hl, ReceivedHM04Text call PrintText - ld hl, $d78e + ld hl, wd78e set 0, [hl] jr .asm_52039 ; 0x75122 .subtract ; 0x75124 diff --git a/scripts/fuchsiahouse3.asm b/scripts/fuchsiahouse3.asm index ec5654ba..372df6a6 100755 --- a/scripts/fuchsiahouse3.asm +++ b/scripts/fuchsiahouse3.asm @@ -6,7 +6,7 @@ FuchsiaHouse3TextPointers: ; 5617f (15:617f) FuchsiaHouse3Text1: ; 56181 (15:6181) db $08 ; asm - ld a, [$d728] + ld a, [wd728] bit 4, a jr nz, .after @@ -14,7 +14,7 @@ FuchsiaHouse3Text1: ; 56181 (15:6181) call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .refused @@ -22,7 +22,7 @@ FuchsiaHouse3Text1: ; 56181 (15:6181) call GiveItem jr nc, .full - ld hl, $d728 + ld hl, wd728 set 4, [hl] ld hl, FuchsiaHouse3Text_561c2 diff --git a/scripts/gary.asm b/scripts/gary.asm index dc7b1252..f909a618 100755 --- a/scripts/gary.asm +++ b/scripts/gary.asm @@ -6,7 +6,7 @@ GaryScript: ; 75f1d (1d:5f1d) GaryScript_75f29: ; 75f29 (1d:5f29) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_GARYCURSCRIPT], a ret @@ -28,12 +28,12 @@ GaryScript0: ; 75f47 (1d:5f47) GaryScript1: ; 75f48 (1d:5f48) ld a, $ff - ld [wJoypadForbiddenButtonsMask], a - ld hl, $ccd3 + ld [wJoyIgnore], a + ld hl, wccd3 ld de, RLEMovement75f63 call DecodeRLEList dec a - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $2 ld [W_GARYCURSCRIPT], a @@ -46,19 +46,19 @@ RLEMovement75f63: ; 75f63 (1d:5f63) db $ff GaryScript2: ; 75f6a (1d:5f6a) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 xor a - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d355 + ld [wJoyIgnore], a + ld hl, W_OPTIONS res 7, [hl] ld a, $1 ld [$ff8c], a call DisplayTextID call Delay3 - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, GaryText_760f9 @@ -84,7 +84,7 @@ GaryScript2: ; 75f6a (1d:5f6a) ld [W_TRAINERNO], a xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $3 ld [W_GARYCURSCRIPT], a ret @@ -94,10 +94,10 @@ GaryScript3: ; 75fbb (1d:5fbb) cp $ff jp z, GaryScript_75f29 call UpdateSprites ; move sprites - ld hl, $d867 + ld hl, wd867 set 1, [hl] ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $1 ld [$ff8c], a call GaryScript_760c8 @@ -121,9 +121,8 @@ GaryScript4: ; 75fe4 (1d:5fe4) ld [$ff8c], a call MoveSprite ld a, $d6 - ld [$cc4d], a - ld a, $15 - call Predef + ld [wcc4d], a + predef ShowObject ld a, $5 ld [W_GARYCURSCRIPT], a ret @@ -132,11 +131,11 @@ MovementData_76014: ; 76014 (1d:6014) db $40,$40,$40,$40,$40,$FF GaryScript5: ; 7601a (1d:601a) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz ld a, $2 - ld [$d528], a + ld [wd528], a ld a, $1 ld [$ff8c], a ld a, $8 @@ -188,25 +187,24 @@ MovementData_76080: ; 76080 (1d:6080) db $40,$40,$FF GaryScript8: ; 76083 (1d:6083) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz ld a, $d6 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject ld a, $9 ld [W_GARYCURSCRIPT], a ret GaryScript9: ; 76099 (1d:6099) ld a, $ff - ld [wJoypadForbiddenButtonsMask], a - ld hl, $ccd3 + ld [wJoyIgnore], a + ld hl, wccd3 ld de, RLEMovement760b4 call DecodeRLEList dec a - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $a ld [W_GARYCURSCRIPT], a @@ -218,21 +216,21 @@ RLEMovement760b4 ; 760b4 (1d:60b4) db $ff GaryScript10: ; 760b9 (1d:60b9) - ld a, [$cd38] + ld a, [wcd38] and a ret nz xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $0 ld [W_GARYCURSCRIPT], a ret GaryScript_760c8 ; 760c8 (1d:60c8) ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a call DisplayTextID ld a, $ff - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ret GaryTextPointers: ; 760d6 (1d:60d6) @@ -244,7 +242,7 @@ GaryTextPointers: ; 760d6 (1d:60d6) GaryText1: ; 760e0 (1d:60e0) db $08 ; asm - ld a, [$d867] + ld a, [wd867] bit 1, a ld hl, GaryText_760f4 jr z, .asm_17e9f ; 0x760e9 @@ -275,8 +273,8 @@ GaryText2: ; 76108 (1d:6108) GaryText3: ; 7610d (1d:610d) db $8 - ld a, [$d717] - ld [$d11e], a + ld a, [W_PLAYERSTARTER] + ld [wd11e], a call GetMonName ld hl, GaryText_76120 call PrintText diff --git a/scripts/halloffameroom.asm b/scripts/halloffameroom.asm index 962fa643..1273305e 100755 --- a/scripts/halloffameroom.asm +++ b/scripts/halloffameroom.asm @@ -6,7 +6,7 @@ HallofFameRoomScript: ; 5a49e (16:649e) HallofFameRoomScript_5a4aa: ; 5a4aa (16:64aa) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_HALLOFFAMEROOMCURSCRIPT], a ret @@ -21,14 +21,13 @@ HallofFameRoomScript3: ; 5a4ba (16:64ba) HallofFameRoomScript2: ; 5a4bb (16:64bb) call Delay3 - ld a, [$d358] + ld a, [wd358] push af xor a - ld [wJoypadForbiddenButtonsMask], a - ld a, $55 - call Predef + ld [wJoyIgnore], a + predef HallOfFamePC pop af - ld [$d358], a + ld [wd358], a ld hl, W_FLAGS_D733 res 1, [hl] inc hl @@ -40,7 +39,7 @@ HallofFameRoomScript2: ; 5a4bb (16:64bb) ld [hl], a ld [W_LANCECURSCRIPT], a ld [W_HALLOFFAMEROOMCURSCRIPT], a - ld hl, $d863 + ld hl, wd863 ld [hli], a ld [hli], a ld [hli], a @@ -58,16 +57,16 @@ HallofFameRoomScript2: ; 5a4bb (16:64bb) dec b jr nz, .asm_5a4ff ; 0x5a505 $f8 call WaitForTextScrollButtonPress - jp InitGame + jp Init HallofFameRoomScript0: ; 5a50d (16:650d) ld a, $ff - ld [wJoypadForbiddenButtonsMask], a - ld hl, $ccd3 + ld [wJoyIgnore], a + ld hl, wccd3 ld de, RLEMovement5a528 call DecodeRLEList dec a - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $1 ld [W_HALLOFFAMEROOMCURSCRIPT], a @@ -78,11 +77,11 @@ RLEMovement5a528: ; 5a528 (16:6528) db $ff HallofFameRoomScript1: ; 5a52b (16:652b) - ld a, [$cd38] + ld a, [wcd38] and a ret nz ld a, $1 - ld [$d528], a + ld [wd528], a ld a, $1 ld [$ff8c], a call SetSpriteMovementBytesToFF @@ -91,18 +90,17 @@ HallofFameRoomScript1: ; 5a52b (16:652b) call Func_34a6 call Delay3 xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a inc a - ld [$d528], a + ld [wd528], a ld a, $1 ld [$ff8c], a call DisplayTextID ld a, $ff - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $8 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject ld a, $2 ld [W_HALLOFFAMEROOMCURSCRIPT], a ret diff --git a/scripts/indigoplateaulobby.asm b/scripts/indigoplateaulobby.asm index 861939b6..96221c97 100755 --- a/scripts/indigoplateaulobby.asm +++ b/scripts/indigoplateaulobby.asm @@ -1,17 +1,17 @@ IndigoPlateauLobbyScript: ; 19c5b (6:5c5b) call Func_22fa call EnableAutoTextBoxDrawing - ld hl, $d126 + ld hl, wd126 bit 6, [hl] res 6, [hl] ret z - ld hl, $d869 + ld hl, wd869 res 7, [hl] - ld hl, $d734 + ld hl, wd734 bit 1, [hl] res 1, [hl] ret z - ld hl, $d863 + ld hl, wd863 xor a ld [hli], a ld [hli], a diff --git a/scripts/lab2.asm b/scripts/lab2.asm index a626de98..4075f737 100755 --- a/scripts/lab2.asm +++ b/scripts/lab2.asm @@ -21,6 +21,5 @@ Lab2Text3: ; 75c37 (1d:5c37) ld a, $8 ld [wWhichTrade], a asm_78552: ; 75c3d (1d:5c3d) - ld a, $54 - call Predef + predef Predef54 jp TextScriptEnd diff --git a/scripts/lab3.asm b/scripts/lab3.asm index d56aba26..66839b17 100755 --- a/scripts/lab3.asm +++ b/scripts/lab3.asm @@ -10,7 +10,7 @@ Lab3TextPointers: ; 75c8a (1d:5c8a) Lab3Text1: ; 75c94 (1d:5c94) db $08 ; asm - ld a, [$d7a1] + ld a, [wd7a1] bit 7, a jr nz, .asm_e551a ; 0x75c9a ld hl, TM35PreReceiveText @@ -20,7 +20,7 @@ Lab3Text1: ; 75c94 (1d:5c94) jr nc, .BagFull ld hl, ReceivedTM35Text call PrintText - ld hl, $d7a1 + ld hl, wd7a1 set 7, [hl] jr .asm_eb896 ; 0x75cb5 .BagFull diff --git a/scripts/lab4.asm b/scripts/lab4.asm index 7bd071ea..a1df3387 100755 --- a/scripts/lab4.asm +++ b/scripts/lab4.asm @@ -7,8 +7,8 @@ Lab4TextPointers: ; 75d34 (1d:5d34) Lab4Script_75d38: ; 75d38 (1d:5d38) xor a - ld [$cd37], a - ld de, $cc5b + ld [wcd37], a + ld de, wcc5b ld hl, FossilsList .asm_75d42 ld a, [hli] @@ -16,20 +16,19 @@ Lab4Script_75d38: ; 75d38 (1d:5d38) jr z, .asm_75d64 push hl push de - ld [$d11e], a + ld [wd11e], a ld b, a - ld a, $1c - call Predef ; indirect jump to Func_f8a5 (f8a5 (3:78a5)) + predef IsItemInBag_ pop de pop hl ld a, b and a jr z, .asm_75d42 - ld a, [$d11e] + ld a, [wd11e] ld [de], a inc de push hl - ld hl, $cd37 + ld hl, wcd37 inc [hl] pop hl jr .asm_75d42 @@ -46,13 +45,13 @@ FossilsList: ; 75d68 (1d:5d68) Lab4Text1: ; 75d6c (1d:5d6c) db $8 - ld a, [$d7a3] + ld a, [wd7a3] bit 0, a jr nz, .asm_75d96 ; 0x75d72 $22 ld hl, Lab4Text_75dc6 call PrintText call Lab4Script_75d38 - ld a, [$cd37] + ld a, [wcd37] and a jr z, .asm_75d8d ; 0x75d81 $a callba GiveFossilToCinnabarLab @@ -72,14 +71,14 @@ Lab4Text1: ; 75d6c (1d:5d6c) call LoadFossilItemAndMonNameBank1D ld hl, Lab4Text_75dd5 call PrintText - ld hl, $d7a3 + ld hl, wd7a3 set 2, [hl] ld a, [W_FOSSILMON] ld b, a ld c, $1e call GivePokemon jr nc, .asm_75d93 ; 0x75db9 $d8 - ld hl, $d7a3 + ld hl, wd7a3 res 0, [hl] res 1, [hl] res 2, [hl] @@ -105,8 +104,7 @@ Lab4Text2: ; 75dda (1d:5dda) db $08 ; asm ld a, $3 ld [wWhichTrade], a - ld a, $54 - call Predef + predef Predef54 jp TextScriptEnd LoadFossilItemAndMonNameBank1D: ; 75de8 (1d:5de8) diff --git a/scripts/lance.asm b/scripts/lance.asm index 445b4052..90295042 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -9,11 +9,11 @@ LanceScript: ; 5a2ae (16:62ae) ret LanceScript_5a2c4: ; 5a2c4 (16:62c4) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z - ld a, [$d866] + ld a, [wd866] bit 7, a jr nz, .asm_5a2da ld a, $31 @@ -25,17 +25,16 @@ LanceScript_5a2c4: ; 5a2c4 (16:62c4) LanceScript_5a2de: ; 5a2de (16:62de) push bc - ld [$d09f], a + ld [wd09f], a ld bc, $602 call LanceScript_5a2f0 pop bc ld a, b - ld [$d09f], a + ld [wd09f], a ld bc, $603 LanceScript_5a2f0: ; 5a2f0 (16:62f0) - ld a, $17 - jp Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef_jump Func_ee9e LanceScript_5a2f5: ; 5a2f5 (16:62f5) xor a @@ -53,15 +52,15 @@ LanceScript4: ; 5a304 (16:6304) ret LanceScript0: ; 5a305 (16:6305) - ld a, [$d866] + ld a, [wd866] bit 6, a ret nz ld hl, CoordsData_5a33e call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a - ld [H_CURRENTPRESSEDBUTTONS], a - ld a, [wWhichTrade] ; $cd3d + ld [hJoyHeld], a + ld a, [wWhichTrade] ; wWhichTrade cp $3 jr nc, .asm_5a325 ld a, $1 @@ -70,11 +69,11 @@ LanceScript0: ; 5a305 (16:6305) .asm_5a325 cp $5 jr z, LanceScript_5a35b - ld hl, $d866 + ld hl, wd866 bit 7, [hl] set 7, [hl] ret nz - ld hl, $d126 + ld hl, wd126 set 5, [hl] ld a, (SFX_02_57 - SFX_Headers_02) / 3 call PlaySound @@ -90,7 +89,7 @@ CoordsData_5a33e: ; 5a33e (16:633e) LanceScript2: ; 5a349 (16:6349) call EndTrainerBattle - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, LanceScript_5a2f5 ld a, $1 @@ -99,12 +98,12 @@ LanceScript2: ; 5a349 (16:6349) LanceScript_5a35b: ; 5a35b (16:635b) ld a, $ff - ld [wJoypadForbiddenButtonsMask], a - ld hl, $ccd3 + ld [wJoyIgnore], a + ld hl, wccd3 ld de, RLEList_5a379 call DecodeRLEList dec a - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $3 ld [W_LANCECURSCRIPT], a @@ -119,12 +118,12 @@ RLEList_5a379: ; 5a379 (16:6379) db $FF LanceScript3: ; 5a382 (16:6382) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_LANCECURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -136,7 +135,7 @@ LanceTrainerHeaders: ; 5a397 (16:6397) LanceTrainerHeader0: ; 5a397 (16:6397) db $1 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d866 ; flag's byte + dw wd866 ; flag's byte dw LanceBeforeBattleText ; 0x63ae TextBeforeBattle dw LanceAfterBattleText ; 0x63b8 TextAfterBattle dw LanceEndBattleText ; 0x63b3 TextEndBattle @@ -161,6 +160,6 @@ LanceEndBattleText: ; 5a3b3 (16:63b3) LanceAfterBattleText: ; 5a3b8 (16:63b8) TX_FAR _LanceAfterBattleText db $8 - ld hl, $d866 + ld hl, wd866 set 6, [hl] jp TextScriptEnd diff --git a/scripts/lavenderhouse1.asm b/scripts/lavenderhouse1.asm index 0f7bf417..5fd1dd34 100755 --- a/scripts/lavenderhouse1.asm +++ b/scripts/lavenderhouse1.asm @@ -12,7 +12,7 @@ LavenderHouse1TextPointers: ; 1d8ac (7:58ac) LavenderHouse1Text1: ; 1d8b8 (7:58b8) db $08 ; asm - ld a, [$d7e0] + ld a, [wd7e0] bit 7, a jr nz, .asm_72e5d ; 0x1d8be ld hl, LavenderHouse1Text_1d8d1 @@ -34,7 +34,7 @@ LavenderHouse1Text_1d8d6: ; 1d8d6 (7:58d6) LavenderHouse1Text2: ; 1d8db (7:58db) db $08 ; asm - ld a, [$d7e0] + ld a, [wd7e0] bit 7, a jr nz, .asm_06470 ; 0x1d8e1 ld hl, LavenderHouse1Text_1d8f4 @@ -70,7 +70,7 @@ LavenderHouse1Text4: ; 1d90b (7:590b) LavenderHouse1Text5: ; 1d918 (7:5918) db $08 ; asm - ld a, [$d76c] + ld a, [wd76c] bit 0, a jr nz, .asm_15ac2 ; 0x1d91e ld hl, LavenderHouse1Text_1d94c @@ -80,7 +80,7 @@ LavenderHouse1Text5: ; 1d918 (7:5918) jr nc, .BagFull ld hl, ReceivedFluteText call PrintText - ld hl, $d76c + ld hl, wd76c set 0, [hl] jr .asm_da749 ; 0x1d939 .BagFull diff --git a/scripts/lavenderhouse2.asm b/scripts/lavenderhouse2.asm index db4f0cab..c2120058 100755 --- a/scripts/lavenderhouse2.asm +++ b/scripts/lavenderhouse2.asm @@ -15,7 +15,7 @@ LavenderHouse2Text1: ; 1d9b6 (7:59b6) LavenderHouse2Text2: ; 1d9c3 (7:59c3) db $08 ; asm - ld a, [$d7e0] + ld a, [wd7e0] bit 7, a jr nz, .asm_65711 ; 0x1d9c9 ld hl, LavenderHouse2Text_1d9dc diff --git a/scripts/lavendermart.asm b/scripts/lavendermart.asm index 78870a66..3852a235 100755 --- a/scripts/lavendermart.asm +++ b/scripts/lavendermart.asm @@ -12,7 +12,7 @@ LavenderMartText2: ; 5c935 (17:4935) LavenderMartText3: ; 5c93a (17:493a) db $08 ; asm - ld a, [$d7e0] + ld a, [wd7e0] bit 7, a jr nz, .asm_c88d4 ; 0x5c940 ld hl, LavenderMart_5c953 diff --git a/scripts/lavendertown.asm b/scripts/lavendertown.asm index 41eb0242..a4f1f200 100755 --- a/scripts/lavendertown.asm +++ b/scripts/lavendertown.asm @@ -17,7 +17,7 @@ LavenderTownText1: ; 44120 (11:4120) ld hl, LavenderTownText_4413c call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a ld hl, LavenderTownText_44146 jr nz, .asm_40831 ; 0x44131 diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index eb2da2bd..670b6b66 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -9,13 +9,13 @@ LoreleiScript: ; 7617b (1d:617b) ret LoreleiScript_76191: ; 76191 (1d:6191) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z - ld hl, $d734 + ld hl, wd734 set 1, [hl] - ld a, [$d863] + ld a, [wd863] bit 1, a jr z, .asm_761a9 ld a, $5 @@ -23,10 +23,9 @@ LoreleiScript_76191: ; 76191 (1d:6191) .asm_761a9 ld a, $24 .asm_761ab - ld [$d09f], a + ld [wd09f], a ld bc, $2 - ld a, $17 - jp Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef_jump Func_ee9e LoreleiScript_761b6: ; 761b6 (1d:61b6) xor a @@ -43,7 +42,7 @@ LoreleiScriptPointers: ; 761bb (1d:61bb) LoreleiScript4: ; 761c5 (1d:61c5) ret asm_761c6: ; 761c6 (1d:61c6) - ld hl, $ccd3 + ld hl, wccd3 ld a, $40 ld [hli], a ld [hli], a @@ -52,7 +51,7 @@ asm_761c6: ; 761c6 (1d:61c6) ld [hli], a ld [hl], a ld a, $6 - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $3 ld [W_LORELEICURSCRIPT], a @@ -63,14 +62,14 @@ LoreleiScript0: ; 761e2 (1d:61e2) call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a - ld [H_NEWLYPRESSEDBUTTONS], a - ld [H_CURRENTPRESSEDBUTTONS], a - ld [$ccd3], a - ld [$cd38], a - ld a, [wWhichTrade] ; $cd3d + ld [hJoyPressed], a + ld [hJoyHeld], a + ld [wccd3], a + ld [wcd38], a + ld a, [wWhichTrade] ; wWhichTrade cp $3 jr c, .asm_76206 - ld hl, $d863 + ld hl, wd863 bit 6, [hl] set 6, [hl] jr z, asm_761c6 @@ -79,9 +78,9 @@ LoreleiScript0: ; 761e2 (1d:61e2) ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID ld a, $40 - ld [$ccd3], a + ld [wccd3], a ld a, $1 - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $3 ld [W_LORELEICURSCRIPT], a @@ -96,18 +95,18 @@ CoordsData_76223: ; 76223 (1d:6223) db $FF LoreleiScript3: ; 7622c (1d:622c) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_LORELEICURSCRIPT], a ld [W_CURMAPSCRIPT], a ret LoreleiScript2: ; 7623f (1d:623f) call EndTrainerBattle - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, LoreleiScript_761b6 ld a, $1 @@ -122,7 +121,7 @@ LoreleiTrainerHeaders: ; 76255 (1d:6255) LoreleiTrainerHeader0: ; 76255 (1d:6255) db $1 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d863 ; flag's byte + dw wd863 ; flag's byte dw LoreleiBeforeBattleText ; 0x626c TextBeforeBattle dw LoreleiAfterBattleText ; 0x6276 TextAfterBattle dw LoreleiEndBattleText ; 0x6271 TextEndBattle diff --git a/scripts/mansion1.asm b/scripts/mansion1.asm index adb73daf..ee1b42b4 100755 --- a/scripts/mansion1.asm +++ b/scripts/mansion1.asm @@ -9,11 +9,11 @@ Mansion1Script: ; 442af (11:42af) ret Mansion1Subscript1: ; 442c5 (11:42c5) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z - ld a, [$d796] + ld a, [wd796] bit 0, a jr nz, .asm_442ec ; 0x442d2 $18 ld bc, $060c @@ -36,23 +36,22 @@ Mansion1Subscript1: ; 442c5 (11:42c5) Mansion1Script_44304: ; 44304 (11:4304) ld a, $2d - ld [$d09f], a + ld [wd09f], a jr asm_44310 Mansion1Script_4430b: ; 4430b (11:430b) ld a, $e - ld [$d09f], a + ld [wd09f], a asm_44310: ; 44310 (11:4310) - ld a, $17 - call Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef Func_ee9e ret Mansion1Script_Switches: ; 44316 (11:4316) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 ret nz xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $4 ld [H_SPRITEHEIGHT], a jp DisplayTextID @@ -72,7 +71,7 @@ Mansion1TrainerHeaders: ; 44334 (11:4334) Mansion1TrainerHeader0: ; 44334 (11:4334) db $1 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d798 ; flag's byte + dw wd798 ; flag's byte dw Mansion1BattleText2 ; 0x434b TextBeforeBattle dw Mansion1AfterBattleText2 ; 0x4355 TextAfterBattle dw Mansion1EndBattleText2 ; 0x4350 TextEndBattle @@ -103,18 +102,18 @@ Mansion1Text4: ; 4435a (11:435a) ld hl, MansionSwitchText call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_4438c ; 0x44368 $22 ld a, $1 - ld [$cc3c], a - ld hl, $d126 + ld [wcc3c], a + ld hl, wd126 set 5, [hl] ld hl, MansionSwitchPressedText call PrintText ld a, (SFX_02_57 - SFX_Headers_02) / 3 call PlaySound - ld hl, $d796 + ld hl, wd796 bit 0, [hl] set 0, [hl] jr z, .asm_44392 ; 0x44386 $a diff --git a/scripts/mansion2.asm b/scripts/mansion2.asm index e55ee4d3..30261637 100755 --- a/scripts/mansion2.asm +++ b/scripts/mansion2.asm @@ -9,11 +9,11 @@ Mansion2Script: ; 51fd8 (14:5fd8) ret Mansion2Script_51fee: ; 51fee (14:5fee) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z - ld a, [$d796] + ld a, [wd796] bit 0, a jr nz, .asm_52016 ld a, $e @@ -39,16 +39,15 @@ Mansion2Script_51fee: ; 51fee (14:5fee) ret Mansion2Script_5202f: ; 5202f (14:602f) - ld [$d09f], a - ld a, $17 - jp Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + ld [wd09f], a + predef_jump Func_ee9e Mansion2Script_Switches: ; 52037 (14:6037) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 ret nz xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $5 ld [H_SPRITEHEIGHT], a jp DisplayTextID @@ -69,7 +68,7 @@ Mansion2TrainerHeaders: ; 52057 (14:6057) Mansion2TrainerHeader0: ; 52057 (14:6057) db $1 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d847 ; flag's byte + dw wd847 ; flag's byte dw Mansion2BattleText1 ; 0x606e TextBeforeBattle dw Mansion2AfterBattleText1 ; 0x6078 TextAfterBattle dw Mansion2EndBattleText1 ; 0x6073 TextEndBattle @@ -109,18 +108,18 @@ Mansion2Text5: ; 52087 (14:6087) ld hl, Mansion2Text_520c2 call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_520b9 ; 0x52095 $22 ld a, $1 - ld [$cc3c], a - ld hl, $d126 + ld [wcc3c], a + ld hl, wd126 set 5, [hl] ld hl, Mansion2Text_520c7 call PrintText ld a, (SFX_02_57 - SFX_Headers_02) / 3 call PlaySound - ld hl, $d796 + ld hl, wd796 bit 0, [hl] set 0, [hl] jr z, .asm_520bf ; 0x520b3 $a diff --git a/scripts/mansion3.asm b/scripts/mansion3.asm index 06757e53..4e9c2271 100755 --- a/scripts/mansion3.asm +++ b/scripts/mansion3.asm @@ -9,11 +9,11 @@ Mansion3Script: ; 521ee (14:61ee) ret Mansion3Script_52204: ; 52204 (14:6204) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z - ld a, [$d796] + ld a, [wd796] bit 0, a jr nz, .asm_52224 ld a, $e @@ -40,7 +40,7 @@ Mansion3ScriptPointers: ; 52235 (14:6235) Mansion3Script0: ; 5223b (14:623b) ld hl, CoordsData_52254 call Mansion3Script_5225b - ld a, [$d71e] + ld a, [wd71e] and a jp z, CheckFightingMapTrainers cp $3 @@ -48,7 +48,7 @@ Mansion3Script0: ; 5223b (14:623b) jr nz, .asm_52250 ld a, $d6 .asm_52250 - ld [$d71d], a + ld [wd71d], a ret CoordsData_52254: ; 52254 (14:6254) @@ -59,26 +59,26 @@ CoordsData_52254: ; 52254 (14:6254) Mansion3Script_5225b: ; 5225b (14:625b) xor a - ld [$d71e], a - ld a, [$d72d] + ld [wd71e], a + ld a, [wd72d] bit 4, a ret nz call ArePlayerCoordsInArray ret nc - ld a, [wWhichTrade] ; $cd3d - ld [$d71e], a - ld hl, $d72d + ld a, [wWhichTrade] ; wWhichTrade + ld [wd71e], a + ld hl, wd72d set 4, [hl] - ld hl, $d732 + ld hl, wd732 set 4, [hl] ret Mansion3Script_Switches: ; 5227a (14:627a) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 ret nz xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $6 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c jp DisplayTextID @@ -95,7 +95,7 @@ Mansion3TrainerHeaders: ; 52296 (14:6296) Mansion3TrainerHeader0: ; 52296 (14:6296) db $1 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d849 ; flag's byte + dw wd849 ; flag's byte dw Mansion3BattleText1 ; 0x62c3 TextBeforeBattle dw Mansion3AfterBattleText1 ; 0x62cd TextAfterBattle dw Mansion3EndBattleText1 ; 0x62c8 TextEndBattle @@ -104,7 +104,7 @@ Mansion3TrainerHeader0: ; 52296 (14:6296) Mansion3TrainerHeader2: ; 522a2 (14:62a2) db $2 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d849 ; flag's byte + dw wd849 ; flag's byte dw Mansion3BattleText2 ; 0x62d2 TextBeforeBattle dw Mansion3AfterBattleText2 ; 0x62dc TextAfterBattle dw Mansion3EndBattleText2 ; 0x62d7 TextEndBattle diff --git a/scripts/mansion4.asm b/scripts/mansion4.asm index d628baf2..cfd78c5f 100755 --- a/scripts/mansion4.asm +++ b/scripts/mansion4.asm @@ -9,11 +9,11 @@ Mansion4Script: ; 523b9 (14:63b9) ret Mansion4Script_523cf: ; 523cf (14:63cf) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z - ld a, [$d796] + ld a, [wd796] bit 0, a jr nz, .asm_523ff ld a, $e @@ -45,11 +45,11 @@ Mansion4Script_523cf: ; 523cf (14:63cf) ret Mansion4Script_Switches: ; 52420 (14:6420) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 ret nz xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $9 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c jp DisplayTextID @@ -74,7 +74,7 @@ Mansion4TrainerHeaders: ; 52448 (14:6448) Mansion4TrainerHeader0: ; 52448 (14:6448) db $1 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d84b ; flag's byte + dw wd84b ; flag's byte dw Mansion4BattleText1 ; 0x6475 TextBeforeBattle dw Mansion4AfterBattleText1 ; 0x647f TextAfterBattle dw Mansion4EndBattleText1 ; 0x647a TextEndBattle @@ -83,7 +83,7 @@ Mansion4TrainerHeader0: ; 52448 (14:6448) Mansion4TrainerHeader2: ; 52454 (14:6454) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d84b ; flag's byte + dw wd84b ; flag's byte dw Mansion4BattleText2 ; 0x6484 TextBeforeBattle dw Mansion4AfterBattleText2 ; 0x648e TextAfterBattle dw Mansion4EndBattleText2 ; 0x6489 TextEndBattle diff --git a/scripts/mtmoon1.asm b/scripts/mtmoon1.asm index 1954391c..42f98d98 100755 --- a/scripts/mtmoon1.asm +++ b/scripts/mtmoon1.asm @@ -32,7 +32,7 @@ MtMoon1TrainerHeaders: ; 499fd (12:59fd) MtMoon1TrainerHeader0: ; 499fd (12:59fd) db $1 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7f5 ; flag's byte + dw wd7f5 ; flag's byte dw MtMoon1BattleText2 ; 0x5a98 TextBeforeBattle dw MtMoon1AfterBattleText2 ; 0x5aa2 TextAfterBattle dw MtMoon1EndBattleText2 ; 0x5a9d TextEndBattle @@ -41,7 +41,7 @@ MtMoon1TrainerHeader0: ; 499fd (12:59fd) MtMoon1TrainerHeader2: ; 49a09 (12:5a09) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7f5 ; flag's byte + dw wd7f5 ; flag's byte dw MtMoon1BattleText3 ; 0x5aa7 TextBeforeBattle dw MtMoon1AfterBattleText3 ; 0x5ab1 TextAfterBattle dw MtMoon1EndBattleText3 ; 0x5aac TextEndBattle @@ -50,7 +50,7 @@ MtMoon1TrainerHeader2: ; 49a09 (12:5a09) MtMoon1TrainerHeader3: ; 49a15 (12:5a15) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7f5 ; flag's byte + dw wd7f5 ; flag's byte dw MtMoon1BattleText4 ; 0x5ab6 TextBeforeBattle dw MtMoon1AfterBattleText4 ; 0x5ac0 TextAfterBattle dw MtMoon1EndBattleText4 ; 0x5abb TextEndBattle @@ -59,7 +59,7 @@ MtMoon1TrainerHeader3: ; 49a15 (12:5a15) MtMoon1TrainerHeader4: ; 49a21 (12:5a21) db $4 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7f5 ; flag's byte + dw wd7f5 ; flag's byte dw MtMoon1BattleText5 ; 0x5ac5 TextBeforeBattle dw MtMoon1AfterBattleText5 ; 0x5acf TextAfterBattle dw MtMoon1EndBattleText5 ; 0x5aca TextEndBattle @@ -68,7 +68,7 @@ MtMoon1TrainerHeader4: ; 49a21 (12:5a21) MtMoon1TrainerHeader5: ; 49a2d (12:5a2d) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7f5 ; flag's byte + dw wd7f5 ; flag's byte dw MtMoon1BattleText6 ; 0x5ad4 TextBeforeBattle dw MtMoon1AfterBattleText6 ; 0x5ade TextAfterBattle dw MtMoon1EndBattleText6 ; 0x5ad9 TextEndBattle @@ -77,7 +77,7 @@ MtMoon1TrainerHeader5: ; 49a2d (12:5a2d) MtMoon1TrainerHeader6: ; 49a39 (12:5a39) db $6 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7f5 ; flag's byte + dw wd7f5 ; flag's byte dw MtMoon1BattleText7 ; 0x5ae3 TextBeforeBattle dw MtMoon1AfterBattleText7 ; 0x5aed TextAfterBattle dw MtMoon1EndBattleText7 ; 0x5ae8 TextEndBattle @@ -86,7 +86,7 @@ MtMoon1TrainerHeader6: ; 49a39 (12:5a39) MtMoon1TrainerHeader7: ; 49a45 (12:5a45) db $7 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7f5 ; flag's byte + dw wd7f5 ; flag's byte dw MtMoon1BattleText8 ; 0x5af2 TextBeforeBattle dw MtMoon1AfterBattleText8 ; 0x5afc TextAfterBattle dw MtMoon1EndBattleText8 ; 0x5af7 TextEndBattle diff --git a/scripts/mtmoon3.asm b/scripts/mtmoon3.asm index 669d6fe4..8d6aaeed 100755 --- a/scripts/mtmoon3.asm +++ b/scripts/mtmoon3.asm @@ -5,17 +5,17 @@ MtMoon3Script: ; 49d0b (12:5d0b) ld a, [W_MTMOON3CURSCRIPT] call ExecuteCurMapScriptInTable ld [W_MTMOON3CURSCRIPT], a - ld a, [$d7f6] + ld a, [wd7f6] bit 1, a ret z ld hl, CoordsData_49d37 call ArePlayerCoordsInArray jr nc, .asm_49d31 ; 0x49d29 $6 - ld hl, $d72e + ld hl, wd72e set 4, [hl] ret .asm_49d31 - ld hl, $d72e + ld hl, wd72e res 4, [hl] ret @@ -40,7 +40,7 @@ CoordsData_49d37: ; 49d37 (12:5d37) MtMoon3Script_49d58: ; 49d58 (12:5d58) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_MTMOON3CURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -54,37 +54,37 @@ MtMoon3ScriptPointers: ; 49d63 (12:5d63) dw MtMoon3Script5 MtMoon3Script0: ; 49d6f (12:5d6f) - ld a, [$d7f6] + ld a, [wd7f6] bit 1, a jp nz, MtMoon3Script_49d91 - ld a, [W_YCOORD] ; $d361 + ld a, [W_YCOORD] ; wd361 cp $8 jp nz, MtMoon3Script_49d91 - ld a, [W_XCOORD] ; $d362 + ld a, [W_XCOORD] ; wd362 cp $d jp nz, MtMoon3Script_49d91 xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $1 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c jp DisplayTextID MtMoon3Script_49d91: ; 49d91 (12:5d91) - ld a, [$d7f6] + ld a, [wd7f6] and $c0 jp z, CheckFightingMapTrainers ret MtMoon3Script3: ; 49d9a (12:5d9a) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, MtMoon3Script_49d58 call UpdateSprites call Delay3 - ld hl, $d7f6 + ld hl, wd7f6 set 1, [hl] xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $0 ld [W_MTMOON3CURSCRIPT], a ld [W_CURMAPSCRIPT], a @@ -132,17 +132,17 @@ MovementData_49df9: ; 49df9 (12:5df9) db $40,$FF MtMoon3Script5: ; 49dfb (12:5dfb) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ld a, $a ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld a, [$d7f6] + ld a, [wd7f6] bit 6, a jr z, .asm_49e1d ld a, $6e @@ -150,11 +150,10 @@ MtMoon3Script5: ; 49dfb (12:5dfb) .asm_49e1d ld a, $6d .asm_49e1f - ld [$cc4d], a - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a + predef HideObject xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $0 ld [W_MTMOON3CURSCRIPT], a ld [W_CURMAPSCRIPT], a @@ -176,7 +175,7 @@ MtMoon3TrainerHeaders: ; 49e48 (12:5e48) MtMoon3TrainerHeader0: ; 49e48 (12:5e48) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7f6 ; flag's byte + dw wd7f6 ; flag's byte dw MtMoon3BattleText2 ; 0x5f9f TextBeforeBattle dw MtMoon3AfterBattleText2 ; 0x5fa9 TextAfterBattle dw MtMoon3EndBattleText2 ; 0x5fa4 TextEndBattle @@ -185,7 +184,7 @@ MtMoon3TrainerHeader0: ; 49e48 (12:5e48) MtMoon3TrainerHeader2: ; 49e54 (12:5e54) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7f6 ; flag's byte + dw wd7f6 ; flag's byte dw MtMoon3BattleText3 ; 0x5fae TextBeforeBattle dw MtMoon3AfterBattleText3 ; 0x5fb8 TextAfterBattle dw MtMoon3EndBattleText3 ; 0x5fb3 TextEndBattle @@ -194,7 +193,7 @@ MtMoon3TrainerHeader2: ; 49e54 (12:5e54) MtMoon3TrainerHeader3: ; 49e60 (12:5e60) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7f6 ; flag's byte + dw wd7f6 ; flag's byte dw MtMoon3BattleText4 ; 0x5fbd TextBeforeBattle dw MtMoon3AfterBattleText4 ; 0x5fc7 TextAfterBattle dw MtMoon3EndBattleText4 ; 0x5fc2 TextEndBattle @@ -203,7 +202,7 @@ MtMoon3TrainerHeader3: ; 49e60 (12:5e60) MtMoon3TrainerHeader4: ; 49e6c (12:5e6c) db $5 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7f6 ; flag's byte + dw wd7f6 ; flag's byte dw MtMoon3BattleText5 ; 0x5fcc TextBeforeBattle dw MtMoon3AfterBattleText5 ; 0x5fd6 TextAfterBattle dw MtMoon3EndBattleText5 ; 0x5fd1 TextEndBattle @@ -213,7 +212,7 @@ MtMoon3TrainerHeader4: ; 49e6c (12:5e6c) MtMoon3Text1: ; 49e79 (12:5e79) db $08 ; asm - ld a, [$d7f6] + ld a, [wd7f6] bit 1, a jr z, .asm_be1e0 ; 0x49e7f and $c0 @@ -224,14 +223,14 @@ MtMoon3Text1: ; 49e79 (12:5e79) .asm_be1e0 ; 0x49e8d ld hl, MtMoon3Text_49f85 call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, MtMoon3Text_49f8a ld de, MtMoon3Text_49f8a call PreBattleSaveRegisters ldh a, [$8c] - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters ld a, $3 @@ -271,11 +270,11 @@ MtMoon3Text5: ; 49edf (12:5edf) MtMoon3Text6: ; 49ee9 (12:5ee9) db $08 ; asm ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ld hl, MtMoon3Text_49f24 call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_1fa5e ; 0x49efc ld bc,(DOME_FOSSIL << 8) | 1 @@ -283,10 +282,9 @@ MtMoon3Text6: ; 49ee9 (12:5ee9) jp nc, MtMoon3Script_49f76 call MtMoon3Script_49f69 ld a, $6d - ld [$cc4d], a - ld a, $11 - call Predef - ld hl, $d7f6 + ld [wcc4d], a + predef HideObject + ld hl, wd7f6 set 6, [hl] ld a, $4 ld [W_MTMOON3CURSCRIPT], a @@ -301,11 +299,11 @@ MtMoon3Text_49f24: ; 49f24 (12:5f24) MtMoon3Text7: ; 49f29 (12:5f29) db $08 ; asm ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ld hl, MtMoon3Text_49f64 call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_8e988 ; 0x49f3c ld bc, (HELIX_FOSSIL << 8) | 1 @@ -313,10 +311,9 @@ MtMoon3Text7: ; 49f29 (12:5f29) jp nc, MtMoon3Script_49f76 call MtMoon3Script_49f69 ld a, $6e - ld [$cc4d], a - ld a, $11 - call Predef - ld hl, $d7f6 + ld [wcc4d], a + predef HideObject + ld hl, wd7f6 set 7, [hl] ld a, $4 ld [W_MTMOON3CURSCRIPT], a diff --git a/scripts/mtmoonpokecenter.asm b/scripts/mtmoonpokecenter.asm index 01272c30..94054561 100755 --- a/scripts/mtmoonpokecenter.asm +++ b/scripts/mtmoonpokecenter.asm @@ -23,16 +23,16 @@ MtMoonPokecenterText3: ; 492e7 (12:52e7) MtMoonPokecenterText4: ; 492ec (12:52ec) db $08 ; asm - ld a, [$d7c6] + ld a, [wd7c6] add a jp c, .asm_49353 ld hl, MtMoonPokecenterText_4935c call PrintText ld a, $13 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jp nz, .asm_4934e ldh [$9f], a @@ -49,18 +49,17 @@ MtMoonPokecenterText4: ; 492ec (12:52ec) jr nc, .asm_49359 ; 0x49324 xor a ld [wWhichTrade], a - ld [$cd3f], a + ld [wTrainerFacingDirection], a ld a, $5 - ld [$cd3e], a - ld hl, $cd3f - ld de, $d349 + ld [wTrainerEngageDistance], a + ld hl, wTrainerFacingDirection + ld de, wPlayerMoney + 2 ld c, $3 - ld a, $c - call Predef + predef SubBCDPredef ld a, $13 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID - ld hl, $d7c6 + ld hl, wd7c6 set 7, [hl] jr .asm_49359 ; 0x4934c .asm_4934e ; 0x4934e diff --git a/scripts/museum1f.asm b/scripts/museum1f.asm index 04261346..e593cf39 100755 --- a/scripts/museum1f.asm +++ b/scripts/museum1f.asm @@ -1,8 +1,8 @@ Museum1FScript: ; 5c0f7 (17:40f7) ld a, $1 - ld [$cf0c], a + ld [wcf0c], a xor a - ld [$cc3c], a + ld [wcc3c], a ld hl, Museum1FScriptPointers ld a, [W_MUSEUM1FCURSCRIPT] jp CallFunctionInTable @@ -23,7 +23,7 @@ Museum1FScript0: ; 5c10d (17:410d) ret nz .asm_5c120 xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $1 ld [$ff8c], a jp DisplayTextID @@ -54,14 +54,14 @@ Museum1FText1: ; 5c135 (17:4135) cp $c jp z, Museum1FScript_5c1f9 .asm_d49e7 - ld a, [$d754] + ld a, [wd754] bit 0, a jr nz, .asm_31a16 ld hl, Museum1FText_5c23d call PrintText jp asm_d1145 .asm_b8709 - ld a, [$d754] + ld a, [wd754] bit 0, a jr z, .asm_3ded4 .asm_31a16 @@ -70,14 +70,14 @@ Museum1FText1: ; 5c135 (17:4135) jp asm_d1145 .asm_3ded4 ld a, $13 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld hl, Museum1FText_5c21f call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_de133 xor a @@ -93,20 +93,19 @@ Museum1FText1: ; 5c135 (17:4135) .asm_0f3e3 ld hl, Museum1FText_5c224 call PrintText - ld hl, $d754 + ld hl, wd754 set 0, [hl] xor a - ld [$cd3d], a - ld [$cd3e], a + ld [wWhichTrade], a + ld [wTrainerEngageDistance], a ld a, $50 - ld [$cd3f], a - ld hl, $cd3f - ld de, $d349 + ld [wTrainerFacingDirection], a + ld hl, wTrainerFacingDirection + ld de, wPlayerMoney + 2 ld c, $3 - ld a, $c - call Predef + predef SubBCDPredef ld a, $13 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID ld a, (SFX_02_5a - SFX_Headers_02) / 3 call PlaySoundWaitForCurrent @@ -116,9 +115,9 @@ Museum1FText1: ; 5c135 (17:4135) ld hl, Museum1FText_5c21a ; $421a call PrintText ld a, $1 - ld [$cd38], a + ld [wcd38], a ld a, $80 - ld [$ccd3], a + ld [wccd3], a call Func_3486 call UpdateSprites jr asm_d1145 @@ -131,7 +130,7 @@ Museum1FScript_5c1f9: ; 5c1f9 (17:41f9) ld hl, Museum1FText_5c22e call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] cp $0 jr nz, .asm_d1144 ld hl, Museum1FText_5c233 @@ -191,7 +190,7 @@ Museum1FText_5c251: ; 5c251 (17:4251) Museum1FText3: ; 5c256 (17:4256) db $08 ; asm - ld a, [$d754] + ld a, [wd754] bit 1, a jr nz, .asm_16599 ; 0x5c25c ld hl, Museum1FText_5c28e @@ -199,12 +198,11 @@ Museum1FText3: ; 5c256 (17:4256) ld bc, (OLD_AMBER << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, $d754 + ld hl, wd754 set 1, [hl] ld a, $34 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject ld hl, ReceivedOldAmberText jr .asm_52e0f ; 0x5c27e .BagFull diff --git a/scripts/namerater.asm b/scripts/namerater.asm index 6e927667..ca357ad1 100755 --- a/scripts/namerater.asm +++ b/scripts/namerater.asm @@ -4,24 +4,24 @@ NameRaterScript: ; 1da12 (7:5a12) NameRaterScript_1da15: ; 1da15 (7:5a15) call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a ret NameRaterScript_1da20: ; 1da20 (7:5a20) - ld hl, W_PARTYMON1OT + ld hl, wPartyMonOT ld bc, $000b ld a, [wWhichPokemon] call AddNTimes - ld de, W_PLAYERNAME + ld de, wPlayerName ld c, $b call .asm_1da47 jr c, .asm_1da52 ; 0x1da34 $1c - ld hl, $d177 + ld hl, wPartyMon1OTID ld bc, $002c ld a, [wWhichPokemon] call AddNTimes - ld de, $d359 + ld de, wPlayerID ld c, $2 .asm_1da47 ld a, [de] @@ -49,9 +49,9 @@ NameRaterText1: ; 1da56 (7:5a56) ld hl, NameRaterText_1dab8 call PrintText xor a - ld [$d07d], a - ld [$cfcb], a - ld [$cc35], a + ld [wd07d], a + ld [wcfcb], a + ld [wcc35], a call DisplayPartyMenu push af call GBPalWhiteOutWithDelay3 diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm index 4f2ca054..fb56aade 100755 --- a/scripts/oakslab.asm +++ b/scripts/oakslab.asm @@ -1,11 +1,11 @@ OaksLabScript: ; 1cb0e (7:4b0e) - ld a, [$d74b] + ld a, [wd74b] bit 6, a call nz, OaksLabScript_1d076 ld a, $1 - ld [$cf0c], a + ld [wcf0c], a xor a - ld [$cc3c], a + ld [wcc3c], a ld hl, OaksLabScriptPointers ld a, [W_OAKSLABCURSCRIPT] jp CallFunctionInTable @@ -32,17 +32,16 @@ OaksLabScriptPointers: ; 1cb28 (7:4b28) dw OaksLabScript18 OaksLabScript0: ; 1cb4e (7:4b4e) - ld a, [$d74b] + ld a, [wd74b] bit 7, a ret z - ld a, [$cf10] + ld a, [wcf10] and a ret nz ld a, $31 - ld [$cc4d], a - ld a, $15 - call Predef - ld hl, $d72e + ld [wcc4d], a + predef ShowObject + ld hl, wd72e res 4, [hl] ld a, $1 @@ -63,17 +62,15 @@ OakEntryMovement: ; 1cb7e (7:4b7e) db $40,$40,$40,$FF OaksLabScript2: ; 1cb82 (7:4b82) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz ld a, $31 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject ld a, $2e - ld [$cc4d], a - ld a, $15 - call Predef + ld [wcc4d], a + predef ShowObject ld a, $3 ld [W_OAKSLABCURSCRIPT], a @@ -81,11 +78,11 @@ OaksLabScript2: ; 1cb82 (7:4b82) OaksLabScript3: ; 1cba2 (7:4ba2) call Delay3 - ld hl, $ccd3 + ld hl, wccd3 ld de, PlayerEntryMovementRLE call DecodeRLEList dec a - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $1 ld [$ff8c], a @@ -106,12 +103,12 @@ PlayerEntryMovementRLE: ; 1cbcf (7:4bcf) db $40, $8, $ff OaksLabScript4: ; 1cbd2 (7:4bd2) - ld a, [$cd38] + ld a, [wcd38] and a ret nz - ld hl, $d747 + ld hl, wd747 set 0, [hl] - ld hl, $d74b + ld hl, wd74b set 0, [hl] ld a, $1 ld [$ff8c], a @@ -129,7 +126,7 @@ OaksLabScript4: ; 1cbd2 (7:4bd2) OaksLabScript5: ; 1cbfd (7:4bfd) ld a, $fc - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $11 ld [$ff8c], a call DisplayTextID @@ -145,10 +142,10 @@ OaksLabScript5: ; 1cbfd (7:4bfd) ld a, $14 ld [$ff8c], a call DisplayTextID - ld hl, $d74b + ld hl, wd74b set 1, [hl] xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $6 ld [W_OAKSLABCURSCRIPT], a @@ -173,19 +170,19 @@ OaksLabScript6: ; 1cc36 (7:4c36) ld [$ff8c], a call DisplayTextID ld a, $1 - ld [$cd38], a + ld [wcd38], a ld a, $40 - ld [$ccd3], a + ld [wccd3], a call Func_3486 ld a, $8 - ld [$d528], a + ld [wd528], a ld a, $7 ld [W_OAKSLABCURSCRIPT], a ret OaksLabScript7: ; 1cc72 (7:4c72) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 @@ -267,11 +264,11 @@ OaksLabScript8: ; 1cc80 (7:4c80) ret OaksLabScript9: ; 1cd00 (7:4d00) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz ld a, $fc - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $1 ld [$ff8c], a ld a, $4 @@ -280,7 +277,7 @@ OaksLabScript9: ; 1cd00 (7:4d00) ld a, $d ld [$ff8c], a call DisplayTextID - ld a, [$cd3e] + ld a, [wTrainerEngageDistance] cp $2 jr nz, .asm_1cd28 ; 0x1cd22 $4 ld a, $2b @@ -293,14 +290,13 @@ OaksLabScript9: ; 1cd00 (7:4d00) .asm_1cd30 ld a, $2d .asm_1cd32 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject call Delay3 - ld a, [$cd3d] + ld a, [wWhichTrade] ld [W_RIVALSTARTER], a - ld [$cf91], a - ld [$d11e], a + ld [wcf91], a + ld [wd11e], a call GetMonName ld a, $1 ld [$ff8c], a @@ -310,10 +306,10 @@ OaksLabScript9: ; 1cd00 (7:4d00) ld a, $e ld [$ff8c], a call DisplayTextID - ld hl, $d74b + ld hl, wd74b set 2, [hl] xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $a ld [W_OAKSLABCURSCRIPT], a @@ -329,7 +325,7 @@ OaksLabScript10: ; 1cd6d (7:4d6d) ld [$ff8d], a call Func_34a6 ; face object ld a, $8 - ld [$d528], a + ld [wd528], a ld c, BANK(Music_MeetRival) ld a, MUSIC_MEET_RIVAL call PlayMusic ; play music @@ -341,14 +337,12 @@ OaksLabScript10: ; 1cd6d (7:4d6d) ld a, $1 swap a ld [$ff95], a - ld a, $22 - call Predef + predef Func_f929 ld a, [$ff95] dec a ld [$ff95], a - ld a, $20 - call Predef - ld de, $cc97 + predef Func_f8ba + ld de, wcc97 ld a, $1 ld [$ff8c], a call MoveSprite @@ -358,7 +352,7 @@ OaksLabScript10: ; 1cd6d (7:4d6d) ret OaksLabScript11: ; 1cdb9 (7:4db9) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz @@ -380,39 +374,38 @@ OaksLabScript11: ; 1cdb9 (7:4db9) .done ld [W_TRAINERNO], a ld a, $1 - ld [$cf13], a + ld [wcf13], a call Func_32ef ld hl, OaksLabText_1d3be ld de, OaksLabText_1d3c3 call PreBattleSaveRegisters - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $8 - ld [$d528], a + ld [wd528], a ld a, $c ld [W_OAKSLABCURSCRIPT], a ret OaksLabScript12: ; 1ce03 (7:4e03) ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $8 - ld [$d528], a + ld [wd528], a call UpdateSprites ld a, $1 - ld [$cf13], a + ld [wcf13], a call Func_32f9 ld a, $1 ld [$ff8c], a xor a ld [$ff8d], a call Func_34a6 ; face object - ld a, $7 - call Predef - ld hl, $d74b + predef HealParty + ld hl, wd74b set 3, [hl] ld a, $d @@ -439,7 +432,7 @@ OaksLabScript13: ; 1ce32 (7:4e32) .asm_1ce5b ld a, $80 .asm_1ce5d - ld [$cc5b], a + ld [wcc5b], a ld a, $e ld [W_OAKSLABCURSCRIPT], a @@ -449,47 +442,46 @@ OaksLabScript13: ; 1ce32 (7:4e32) db $E0,$00,$00,$00,$00,$00,$FF OaksLabScript14: ; 1ce6d (7:4e6d) - ld a, [$d730] + ld a, [wd730] bit 0, a jr nz, .asm_1ce8c ; 0x1ce72 $18 ld a, $2a - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a call Func_2307 ; reset to map music ld a, $12 ld [W_OAKSLABCURSCRIPT], a jr .done ; 0x1ce8a $23 .asm_1ce8c - ld a, [$cf0f] + ld a, [wcf0f] cp $5 jr nz, .asm_1cea8 ; 0x1ce91 $15 ld a, [W_XCOORD] cp $4 jr nz, .asm_1cea1 ; 0x1ce98 $7 ld a, $c - ld [$c109], a + ld [wSpriteStateData1 + 9], a jr .done ; 0x1ce9f $e .asm_1cea1 ld a, $8 - ld [$c109], a + ld [wSpriteStateData1 + 9], a jr .done ; 0x1cea6 $7 .asm_1cea8 cp $4 ret nz xor a - ld [$c109], a + ld [wSpriteStateData1 + 9], a .done ret OaksLabScript15: ; 1ceb0 (7:4eb0) xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a call EnableAutoTextBoxDrawing ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound callba Music_RivalAlternateStart ld a, $15 @@ -497,20 +489,19 @@ OaksLabScript15: ; 1ceb0 (7:4eb0) call DisplayTextID call OaksLabScript_1d02b ld a, $2a - ld [$cc4d], a - ld a, $15 - call Predef - ld a, [$cd37] - ld [$d157], a + ld [wcc4d], a + predef ShowObject + ld a, [wcd37] + ld [wd157], a ld b, $0 ld c, a - ld hl, $cc97 + ld hl, wcc97 ld a, $40 call FillMemory ld [hl], $ff ld a, $1 ld [$ff8c], a - ld de, $cc97 + ld de, wcc97 call MoveSprite ld a, $10 @@ -530,13 +521,13 @@ OaksLabScript_1cefd ; 1cefd (7:4efd) jp Func_34a6 ; face object OaksLabScript16: ; 1cf12 (7:4f12) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz call EnableAutoTextBoxDrawing call Func_2307 ld a, $fc - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a call OaksLabScript_1cefd ld a, $16 ld [$ff8c], a @@ -557,13 +548,11 @@ OaksLabScript16: ; 1cf12 (7:4f12) call DisplayTextID call Delay3 ld a, $2f - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject ld a, $30 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject call OaksLabScript_1cefd ld a, $1a ld [$ff8c], a @@ -577,32 +566,30 @@ OaksLabScript16: ; 1cf12 (7:4f12) ld a, $1b ld [$ff8c], a call DisplayTextID - ld hl, $d74b + ld hl, wd74b set 5, [hl] - ld hl, $d74e + ld hl, wd74e set 0, [hl] ld a, $1 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject ld a, $2 - ld [$cc4d], a - ld a, $15 - call Predef - ld a, [$d157] + ld [wcc4d], a + predef ShowObject + ld a, [wd157] ld b, $0 ld c, a - ld hl, $cc97 + ld hl, wcc97 xor a call FillMemory ld [hl], $ff ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound callba Music_RivalAlternateStart ld a, $1 ld [$ff8c], a - ld de, $cc97 + ld de, wcc97 call MoveSprite ld a, $11 @@ -610,26 +597,24 @@ OaksLabScript16: ; 1cf12 (7:4f12) ret OaksLabScript17: ; 1cfd4 (7:4fd4) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz call Func_2307 ld a, $2a - ld [$cc4d], a - ld a, $11 - call Predef - ld hl, $d7eb + ld [wcc4d], a + predef HideObject + ld hl, wd7eb set 0, [hl] res 1, [hl] set 7, [hl] ld a, $22 - ld [$cc4d], a - ld a, $15 - call Predef + ld [wcc4d], a + predef ShowObject ld a, $5 ld [W_PALLETTOWNCURSCRIPT], a xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $12 ld [W_OAKSLABCURSCRIPT], a @@ -651,11 +636,11 @@ OaksLabScript_1d00a: ; 1d00a (7:500a) inc c jr .asm_1d010 ; 0x1d01a $f4 .GotParcel - ld hl, $d31d + ld hl, wNumBagItems ld a, c ld [wWhichPokemon], a ld a, $1 - ld [$cf96], a + ld [wcf96], a jp RemoveItemFromInventory OaksLabScript_1d02b: ; 1d02b (7:502b) @@ -667,7 +652,7 @@ OaksLabScript_1d02b: ; 1d02b (7:502b) cp $3 jr nz, .asm_1d045 ; 0x1d038 $b ld a, $4 - ld [$cd37], a + ld [wcd37], a ld a, $30 ld b, $b jr .asm_1d068 ; 0x1d043 $23 @@ -675,13 +660,13 @@ OaksLabScript_1d02b: ; 1d02b (7:502b) cp $1 jr nz, .asm_1d054 ; 0x1d047 $b ld a, $2 - ld [$cd37], a + ld [wcd37], a ld a, $30 ld b, $9 jr .asm_1d068 ; 0x1d052 $14 .asm_1d054 ld a, $3 - ld [$cd37], a + ld [wcd37], a ld b, $a ld a, [W_XCOORD] cp $4 @@ -695,7 +680,7 @@ OaksLabScript_1d02b: ; 1d02b (7:502b) ld a, b ld [$ffed], a ld a, $1 - ld [$cf13], a + ld [wcf13], a call Func_32f9 ret @@ -750,7 +735,7 @@ OaksLabTextPointers: ; 1d082 (7:5082) OaksLabText28: ; 1d0ce (7:50ce) OaksLabText1: ; 1d0ce (7:50ce) db $08 ; asm - ld a, [$d74b] + ld a, [wd74b] bit 0, a jr nz, .asm_1d0de ; 0x1d0d4 ld hl, OaksLabGaryText1 @@ -784,9 +769,9 @@ OaksLabText29: ; 1d102 (7:5102) OaksLabText2: ; 1d102 (7:5102) db $8 ld a, STARTER2 - ld [$cd3d], a + ld [wWhichTrade], a ld a, $3 - ld [$cd3e], a + ld [wTrainerEngageDistance], a ld a, STARTER1 ld b, $2 jr OaksLabScript_1d133 ; 0x1d111 $20 @@ -795,9 +780,9 @@ OaksLabText30: ; 1d113 (7:5113) OaksLabText3: ; 1d113 (7:5113) db $8 ld a, STARTER3 - ld [$cd3d], a + ld [wWhichTrade], a ld a, $4 - ld [$cd3e], a + ld [wTrainerEngageDistance], a ld a, STARTER2 ld b, $3 jr OaksLabScript_1d133 ; 0x1d122 $f @@ -806,18 +791,18 @@ OaksLabText31: ; 1d124 (7:5124) OaksLabText4: ; 1d124 (7:5124) db $8 ld a, STARTER1 - ld [$cd3d], a + ld [wWhichTrade], a ld a, $2 - ld [$cd3e], a + ld [wTrainerEngageDistance], a ld a, STARTER3 ld b, $4 OaksLabScript_1d133: ; 1d133 (7:5133) - ld [$cf91], a - ld [$d11e], a + ld [wcf91], a + ld [wd11e], a ld a, b - ld [$cf13], a - ld a, [$d74b] + ld [wcf13], a + ld a, [wd74b] bit 2, a jp nz, OaksLabScript_1d22d bit 1, a @@ -844,16 +829,15 @@ OaksLabScript_1d157: ; 1d157 (7:5157) ld [$ff8b], a call Func_34fc ld [hl], $c - ld hl, $d730 + ld hl, wd730 set 6, [hl] - ld a, $46 - call Predef ; DisplayStarterMonDex - ld hl, $d730 + predef StarterDex ; StarterDex + ld hl, wd730 res 6, [hl] call ReloadMapData ld c, $a call DelayFrames - ld a, [$cf13] + ld a, [wcf13] cp $2 jr z, OaksLabLookAtCharmander cp $3 @@ -884,16 +868,16 @@ OaksLabBulbasaurText: ; 1d1ae (7:51ae) OaksLabMonChoiceMenu: ; 1d1b3 (7:51b3) call PrintText ld a, $1 - ld [$cc3c], a + ld [wcc3c], a call YesNoChoice ; yes/no menu - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, OaksLabMonChoiceEnd - ld a, [$cf91] - ld [$d717], a - ld [$d11e], a + ld a, [wcf91] + ld [W_PLAYERSTARTER], a + ld [wd11e], a call GetMonName - ld a, [$cf13] + ld a, [wcf13] cp $2 jr nz, asm_1d1db ; 0x1d1d5 $4 ld a, $2b @@ -906,26 +890,25 @@ asm_1d1db: ; 1d1db (7:51db) asm_1d1e3: ; 1d1e3 (7:51e3) ld a, $2d asm_1d1e5: ; 1d1e5 (7:51e5) - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ld hl, OaksLabMonEnergeticText call PrintText ld hl, OaksLabReceivedMonText call PrintText xor a - ld [$cc49], a + ld [wcc49], a ld a, $5 - ld [$d127], a - ld a, [$cf91] - ld [$d11e], a - call AddPokemonToParty - ld hl, $d72e + ld [W_CURENEMYLVL], a + ld a, [wcf91] + ld [wd11e], a + call AddPartyMon + ld hl, wd72e set 3, [hl] ld a, $fc - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $8 ld [W_OAKSLABCURSCRIPT], a OaksLabMonChoiceEnd: ; 1d21f (7:521f) @@ -957,39 +940,38 @@ OaksLabLastMonText: ; 1d243 (7:5243) OaksLabText32: ; 1d248 (7:5248) OaksLabText5: ; 1d248 (7:5248) db $08 ; asm - ld a, [$d747] + ld a, [wd747] bit 6, a jr nz, .asm_50e81 ; 0x1d24e - ld hl, $d2f7 + ld hl, wPokedexOwned ld b, $13 call CountSetBits - ld a, [$d11e] + ld a, [wd11e] cp $2 jr c, .asm_b28b0 ; 0x1d25d - ld a, [$d74b] + ld a, [wd74b] bit 5, a jr z, .asm_b28b0 ; 0x1d264 .asm_50e81 ; 0x1d266 ld hl, OaksLabText_1d31d call PrintText ld a, $1 - ld [$cc3c], a - ld a, $56 - call Predef + ld [wcc3c], a + predef DisplayDexRating jp .asm_0f042 .asm_b28b0 ; 0x1d279 ld b,POKE_BALL call IsItemInBag jr nz, .asm_17c30 ; 0x1d27e - ld a, [$d7eb] + ld a, [wd7eb] bit 5, a jr nz, .asm_f1adc ; 0x1d285 - ld a, [$d74b] + ld a, [wd74b] bit 5, a jr nz, .asm_333a2 ; 0x1d28c bit 3, a jr nz, .asm_76269 ; 0x1d290 - ld a, [$d72e] + ld a, [wd72e] bit 3, a jr nz, .asm_4a5e0 ; 0x1d297 ld hl, OaksLabText_1d2f0 @@ -1018,7 +1000,7 @@ OaksLabText5: ; 1d248 (7:5248) call PrintText jr .asm_0f042 ; 0x1d2ce .asm_f1adc ; 0x1d2d0 - ld hl, $d74b + ld hl, wd74b bit 4, [hl] set 4, [hl] jr nz, .asm_17c30 ; 0x1d2d7 diff --git a/scripts/pallettown.asm b/scripts/pallettown.asm index e1b51cf6..16098dcf 100755 --- a/scripts/pallettown.asm +++ b/scripts/pallettown.asm @@ -1,8 +1,8 @@ PalletTownScript: ; 18e5b (6:4e5b) - ld a,[$D74B] + ld a,[wd74b] bit 4,a jr z,.next - ld hl,$D747 + ld hl,wd747 set 6,[hl] .next call EnableAutoTextBoxDrawing @@ -20,16 +20,16 @@ PalletTownScriptPointers: ; 18e73 (6:4e73) dw PalletTownScript6 PalletTownScript0: ; 18e81 (6:4e81) - ld a,[$D747] + ld a,[wd747] bit 0,a ret nz ld a,[W_YCOORD] cp 1 ; is player near north exit? ret nz xor a - ld [H_CURRENTPRESSEDBUTTONS],a + ld [hJoyHeld],a ld a,4 - ld [$D528],a + ld [wd528],a ld a,$FF call PlaySound ; stop music ld a, BANK(Music_MeetProfOak) @@ -37,8 +37,8 @@ PalletTownScript0: ; 18e81 (6:4e81) ld a, MUSIC_MEET_PROF_OAK ; “oak appears” music call PlayMusic ; plays music ld a,$FC - ld [wJoypadForbiddenButtonsMask],a - ld hl,$D74B + ld [wJoyIgnore],a + ld hl,wd74b set 7,[hl] ; trigger the next script @@ -48,16 +48,15 @@ PalletTownScript0: ; 18e81 (6:4e81) PalletTownScript1: ; 18eb2 (6:4eb2) xor a - ld [$CF0D],a + ld [wcf0d],a ld a,1 ld [$FF8C],a call DisplayTextID ld a,$FF - ld [wJoypadForbiddenButtonsMask],a + ld [wJoyIgnore],a ld a,0 - ld [$CC4D],a - ld a,$15 - call Predef + ld [wcc4d],a + predef ShowObject ; trigger the next script ld a,2 @@ -78,18 +77,16 @@ PalletTownScript2: ; 18ed2 (6:4ed2) ld a,1 swap a ld [$FF95],a - ld a,$22 - call Predef + predef Func_f929 ld hl,$FF95 dec [hl] - ld a,$20 - call Predef ; load Oak’s movement into $CC97 - ld de,$CC97 + predef Func_f8ba ; load Oak’s movement into wcc97 + ld de,wcc97 ld a,1 ; oak ld [$FF8C],a call MoveSprite ld a,$FF - ld [wJoypadForbiddenButtonsMask],a + ld [wJoyIgnore],a ; trigger the next script ld a,3 @@ -97,28 +94,28 @@ PalletTownScript2: ; 18ed2 (6:4ed2) ret PalletTownScript3: ; 18f12 (6:4f12) - ld a,[$D730] + ld a,[wd730] bit 0,a ret nz xor a - ld [$C109],a + ld [wSpriteStateData1 + 9],a ld a,1 - ld [$CF0D],a + ld [wcf0d],a ld a,$FC - ld [wJoypadForbiddenButtonsMask],a + ld [wJoyIgnore],a ld a,1 ld [$FF8C],a call DisplayTextID ld a,$FF - ld [wJoypadForbiddenButtonsMask],a + ld [wJoyIgnore],a ld a,1 - ld [$CF13],a + ld [wcf13],a xor a - ld [$CF10],a + ld [wcf10],a ld a,1 - ld [$CC57],a + ld [wcc57],a ld a,[H_LOADEDROMBANK] - ld [$CC58],a + ld [wcc58],a ; trigger the next script ld a,4 @@ -126,7 +123,7 @@ PalletTownScript3: ; 18f12 (6:4f12) ret PalletTownScript4: ; 18f4b (6:4f4b) - ld a,[$CC57] + ld a,[wcc57] and a ret nz @@ -136,27 +133,25 @@ PalletTownScript4: ; 18f4b (6:4f4b) ret PalletTownScript5: ; 18f56 (6:4f56) - ld a,[$D74A] + ld a,[wd74a] bit 2,a jr nz,.next and 3 cp 3 jr nz,.next - ld hl,$D74A + ld hl,wd74a set 2,[hl] ld a,$27 - ld [$CC4D],a - ld a,$11 - call Predef + ld [wcc4d],a + predef HideObject ld a,$28 - ld [$CC4D],a - ld a,$15 - jp Predef + ld [wcc4d],a + predef_jump ShowObject .next - ld a,[$D74B] + ld a,[wd74b] bit 4,a ret z - ld hl,$D74B + ld hl,wd74b set 6,[hl] PalletTownScript6: ; 18f87 (6:4f87) ret @@ -172,11 +167,11 @@ PalletTownTextPointers: ; 18f88 (6:4f88) PalletTownText1: ; 18f96 (6:4f96) db 8 - ld a,[$CF0D] + ld a,[wcf0d] and a jr nz,.next ld a,1 - ld [$CC3C],a + ld [wcc3c],a ld hl,OakAppearsText jr .done .next @@ -191,12 +186,11 @@ OakAppearsText: ; 18fb0 (6:4fb0) ld c,10 call DelayFrames xor a - ld [$CD4F],a - ld [$CD50],a - ld a,$4C - call Predef ; display ! over head + ld [wcd4f],a + ld [wcd50],a + predef EmotionBubble ; display ! over head ld a,4 - ld [$D528],a + ld [wd528],a jp TextScriptEnd OakWalksUpText: ; 18fce (6:4fce) diff --git a/scripts/pewtercity.asm b/scripts/pewtercity.asm index e738dedf..e7a143f9 100755 --- a/scripts/pewtercity.asm +++ b/scripts/pewtercity.asm @@ -16,20 +16,20 @@ PewterCityScriptPointers: ; 19243 (6:5243) PewterCityScript0: ; 19251 (6:5251) xor a ld [W_MUSEUM1FCURSCRIPT], a - ld hl, $d754 + ld hl, wd754 res 0, [hl] call PewterCityScript_1925e ret PewterCityScript_1925e: ; 1925e (6:525e) - ld a, [$d755] + ld a, [wd755] bit 7, a ret nz ld hl, CoordsData_19277 call ArePlayerCoordsInArray ret nc ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $5 ld [$ff8c], a jp DisplayTextID @@ -42,7 +42,7 @@ CoordsData_19277: ; 19277 (6:5277) db $ff PewterCityScript1: ; 19280 (6:5280) - ld a, [$cc57] + ld a, [wcc57] and a ret nz ld a, $3 @@ -68,7 +68,7 @@ PewterCityScript1: ; 19280 (6:5280) ld a, $11 ld [$ffee], a ld a, $3 - ld [$cf13], a + ld [wcf13], a call Func_32f9 ld a, $3 ld [$ff8c], a @@ -82,33 +82,31 @@ MovementData_PewterMuseumGuyExit: ; 192ce (6:52ce) db $00,$00,$00,$00,$FF PewterCityScript2: ; 192d3 (6:52d3) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz ld a, $3 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject ld a, $3 ld [W_PEWTERCITYCURSCRIPT], a ret PewterCityScript3: ; 192e9 (6:52e9) ld a, $3 - ld [$cf13], a + ld [wcf13], a call Func_32fe ld a, $3 - ld [$cc4d], a - ld a, $15 - call Predef + ld [wcc4d], a + predef ShowObject xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $0 ld [W_PEWTERCITYCURSCRIPT], a ret PewterCityScript4: ; 19305 (6:5305) - ld a, [$cc57] + ld a, [wcc57] and a ret nz ld a, $5 @@ -134,7 +132,7 @@ PewterCityScript4: ; 19305 (6:5305) ld a, $10 ld [$ffee], a ld a, $5 - ld [$cf13], a + ld [wcf13], a call Func_32f9 ld a, $5 ld [$ff8c], a @@ -148,27 +146,25 @@ MovementData_PewterGymGuyExit: ; 19353 (6:5353) db $C0,$C0,$C0,$C0,$C0,$FF PewterCityScript5: ; 19359 (6:5359) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz ld a, $4 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject ld a, $6 ld [W_PEWTERCITYCURSCRIPT], a ret PewterCityScript6: ; 1936f (6:536f) ld a, $5 - ld [$cf13], a + ld [wcf13], a call Func_32fe ld a, $4 - ld [$cc4d], a - ld a, $15 - call Predef + ld [wcc4d], a + predef ShowObject xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $0 ld [W_PEWTERCITYCURSCRIPT], a ret @@ -202,7 +198,7 @@ PewterCityText3: ; 193b1 (6:53b1) ld hl, PewterCityText_193f1 call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_f46a9 ; 0x193bf ld hl, PewterCityText_193f6 @@ -214,13 +210,13 @@ PewterCityText3: ; 193b1 (6:53b1) xor a ldh [$b3], a ldh [$b4], a - ld [$cf10], a + ld [wcf10], a ld a, $2 - ld [$cc57], a + ld [wcc57], a ldh a, [$b8] - ld [$cc58], a + ld [wcc58], a ld a, $3 - ld [$cf13], a + ld [wcf13], a call Func_32f4 ld a, $1 ld [W_PEWTERCITYCURSCRIPT], a @@ -248,7 +244,7 @@ PewterCityText4: ; 19405 (6:5405) ld hl, PewterCityText_19427 call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] cp $0 jr nz, .asm_e4603 ld hl, PewterCityText_1942c @@ -278,13 +274,13 @@ PewterCityText5: ; 19436 (6:5436) call PrintText xor a ldh [$b4], a - ld [$cf10], a + ld [wcf10], a ld a, $3 - ld [$cc57], a + ld [wcc57], a ldh a, [$b8] - ld [$cc58], a + ld [wcc58], a ld a, $5 - ld [$cf13], a + ld [wcf13], a call Func_32f4 ld a, $4 ld [W_PEWTERCITYCURSCRIPT], a diff --git a/scripts/pewtergym.asm b/scripts/pewtergym.asm index 2ba001d4..2feb9817 100755 --- a/scripts/pewtergym.asm +++ b/scripts/pewtergym.asm @@ -1,5 +1,5 @@ PewterGymScript: ; 5c387 (17:4387) - ld hl, $d126 + ld hl, wd126 bit 6, [hl] res 6, [hl] call nz, PewterGymScript_5c3a4 @@ -24,7 +24,7 @@ Gym1LeaderName: ; 5c3b9 (17:43b9) PewterGymScript_5c3bf: ; 5c3bf (17:43bf) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_PEWTERGYMCURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -36,17 +36,17 @@ PewterGymScriptPointers: ; 5c3ca (17:43ca) dw PewterGymScript3 PewterGymScript3: ; 5c3d2 (17:43d2) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, PewterGymScript_5c3bf ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a PewterGymScript_5c3df: ; 5c3df (17:43df) ld a, $4 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d755 + ld hl, wd755 set 7, [hl] ld bc, (TM_34 << 8) | 1 call GiveItem @@ -54,7 +54,7 @@ PewterGymScript_5c3df: ; 5c3df (17:43df) ld a, $5 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d755 + ld hl, wd755 set 6, [hl] jr .asm_5c408 .BagFull @@ -64,24 +64,22 @@ PewterGymScript_5c3df: ; 5c3df (17:43df) .asm_5c408 ld hl, W_OBTAINEDBADGES set 0, [hl] - ld hl, $d72a + ld hl, wd72a set 0, [hl] ld a, $4 - ld [$cc4d], a - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a + predef HideObject ld a, $22 - ld [$cc4d], a - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a + predef HideObject - ld hl, $d7eb + ld hl, wd7eb res 0, [hl] res 7, [hl] ; deactivate gym trainers - ld hl, $d755 + ld hl, wd755 set 2, [hl] jp PewterGymScript_5c3bf @@ -98,7 +96,7 @@ PewterGymTrainerHeaders: ; 5c441 (17:4441) PewterGymTrainerHeader0: ; 5c441 (17:4441) db $2 ; flag's bit db ($5 << 4) ; trainer's view range - dw $d755 ; flag's byte + dw wd755 ; flag's byte dw PewterGymBattleText1 ; 0x44d0 TextBeforeBattle dw PewterGymAfterBattleText1 ; 0x44da TextAfterBattle dw PewterGymEndBattleText1 ; 0x44d5 TextEndBattle @@ -108,7 +106,7 @@ PewterGymTrainerHeader0: ; 5c441 (17:4441) PewterGymText1: ; 5c44e (17:444e) db $08 ; asm - ld a, [$d755] + ld a, [wd755] bit 7, a jr z, .asm_4a735 ; 0x5c454 bit 6, a @@ -123,18 +121,18 @@ PewterGymText1: ; 5c44e (17:444e) .asm_4a735 ; 0x5c46a ld hl, PewterGymText_5c49e call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, PewterGymText_5c4bc ld de, PewterGymText_5c4bc call PreBattleSaveRegisters ldh a, [$8c] - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters ld a, $1 - ld [$d05c], a + ld [W_GYMLEADERNO], a xor a ldh [$b4], a ld a, $3 @@ -191,13 +189,13 @@ PewterGymAfterBattleText1: ; 5c4da (17:44da) PewterGymText3: ; 5c4df (17:44df) db $08 ; asm - ld a, [$d72a] + ld a, [wd72a] bit 0, a jr nz, .asm_71369 ; 0x5c4e5 ld hl, PewterGymText_5c515 call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_6123a ; 0x5c4f4 ld hl, PewterGymText_5c51a diff --git a/scripts/pewtermart.asm b/scripts/pewtermart.asm index 3abe2a93..4e867aee 100755 --- a/scripts/pewtermart.asm +++ b/scripts/pewtermart.asm @@ -1,7 +1,7 @@ PewterMartScript: ; 74cad (1d:4cad) call EnableAutoTextBoxDrawing ld a, $1 - ld [$cf0c], a + ld [wcf0c], a ret PewterMartTextPointers: ; 74cb6 (1d:4cb6) diff --git a/scripts/pewterpokecenter.asm b/scripts/pewterpokecenter.asm index 4b97a01d..252c6d5b 100755 --- a/scripts/pewterpokecenter.asm +++ b/scripts/pewterpokecenter.asm @@ -18,7 +18,7 @@ PewterPokecenterText2: ; 5c596 (17:4596) PewterPokecenterText3: ; 5c59b (17:459b) db $8 ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ld hl, PewterPokecenterText5 call PrintText ld a, $ff @@ -26,11 +26,11 @@ PewterPokecenterText3: ; 5c59b (17:459b) ld c, $20 call DelayFrames ld hl, Unknown_5c608 ; $4608 - ld de, $cd3f + ld de, wTrainerFacingDirection ld bc, $0004 call CopyData - ld a, [$c132] - ld hl, $cd3f + ld a, [wSpriteStateData1 + $32] + ld hl, wTrainerFacingDirection .asm_5c5c3 cp [hl] inc hl @@ -43,20 +43,20 @@ PewterPokecenterText3: ; 5c59b (17:459b) pop hl .asm_5c5d1 ld a, [hl] - ld [$c132], a + ld [wSpriteStateData1 + $32], a push hl - ld hl, $cd3f - ld de, $cd3e + ld hl, wTrainerFacingDirection + ld de, wTrainerEngageDistance ld bc, $0004 call CopyData - ld a, [$cd3e] - ld [$cd42], a + ld a, [wTrainerEngageDistance] + ld [wcd42], a pop hl ld c, $18 call DelayFrames - ld a, [$c026] + ld a, [wc026] ld b, a - ld a, [$c027] + ld a, [wc027] or b jr nz, .asm_5c5d1 ; 0x5c5f6 $d9 ld c, $30 diff --git a/scripts/pokemontower2.asm b/scripts/pokemontower2.asm index 4554413a..f370d7b7 100755 --- a/scripts/pokemontower2.asm +++ b/scripts/pokemontower2.asm @@ -6,7 +6,7 @@ PokemonTower2Script: ; 604f2 (18:44f2) PokemonTower2Script_604fe: ; 604fe (18:44fe) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_POKEMONTOWER2CURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -17,31 +17,31 @@ PokemonTower2ScriptPointers: ; 60509 (18:4509) dw PokemonTower2Script2 PokemonTower2Script0: ; 6050f (18:450f) - ld a, [$d764] + ld a, [wd764] bit 7, a ret nz ld hl, CoordsData_6055e ; $455e call ArePlayerCoordsInArray ret nc ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound ld c, BANK(Music_MeetRival) ld a, MUSIC_MEET_RIVAL call PlayMusic - ld hl, $d764 + ld hl, wd764 res 6, [hl] - ld a, [$cd3d] + ld a, [wWhichTrade] cp $1 ld a, $8 ld b, $0 jr nz, .asm_60544 ; 0x60539 $9 - ld hl, $d764 + ld hl, wd764 set 6, [hl] ld a, $2 ld b, $c .asm_60544 - ld [$d528], a + ld [wd528], a ld a, $1 ld [$ff8c], a ld a, b @@ -51,8 +51,8 @@ PokemonTower2Script0: ; 6050f (18:450f) ld [$ff8c], a call DisplayTextID xor a - ld [H_CURRENTPRESSEDBUTTONS], a - ld [H_NEWLYPRESSEDBUTTONS], a + ld [hJoyHeld], a + ld [hJoyPressed], a ret CoordsData_6055e: ; 6055e (18:455e) @@ -61,18 +61,18 @@ CoordsData_6055e: ; 6055e (18:455e) db $0F ; isn't this supposed to end in $ff? PokemonTower2Script1: ; 60563 (18:4563) - ld a, [$d057] + ld a, [W_ISINBATTLE] cp $ff jp z, PokemonTower2Script_604fe ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d764 + ld [wJoyIgnore], a + ld hl, wd764 set 7, [hl] ld a, $1 ld [$ff8c], a call DisplayTextID ld de, MovementData_605b2 - ld a, [$d764] + ld a, [wd764] bit 6, a jr nz, .asm_60589 ; 0x60584 $3 ld de, MovementData_605a9 @@ -81,7 +81,7 @@ PokemonTower2Script1: ; 60563 (18:4563) ld [$ff8c], a call MoveSprite ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound callba Music_RivalAlternateStart ld a, $2 @@ -96,15 +96,14 @@ MovementData_605b2: ; 605b2 (18:45b2) db $00,$00,$C0,$C0,$C0,$C0,$00,$00,$FF PokemonTower2Script2: ; 605bb (18:45bb) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz ld a, $38 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a call Func_2307 ld a, $0 ld [W_POKEMONTOWER2CURSCRIPT], a @@ -117,7 +116,7 @@ PokemonTower2TextPointers: ; 605db (18:45db) PokemonTower2Text1: ; 605df (18:45df) db $08 ; asm - ld a, [$d764] + ld a, [wd764] bit 7, a jr z, .asm_16f24 ; 0x605e5 ld hl, PokemonTower2Text_6063c @@ -126,7 +125,7 @@ PokemonTower2Text1: ; 605df (18:45df) .asm_16f24 ; 0x605ef ld hl, PokemonTower2Text_6062d call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, PokemonTower2Text_60632 diff --git a/scripts/pokemontower3.asm b/scripts/pokemontower3.asm index 74568a83..f05623fb 100755 --- a/scripts/pokemontower3.asm +++ b/scripts/pokemontower3.asm @@ -22,7 +22,7 @@ PokemonTower3TrainerHeaders: ; 606ed (18:46ed) PokemonTower3TrainerHeader0: ; 606ed (18:46ed) db $1 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d765 ; flag's byte + dw wd765 ; flag's byte dw PokemonTower3BattleText1 ; 0x4730 TextBeforeBattle dw PokemonTower3AfterBattleText1 ; 0x473a TextAfterBattle dw PokemonTower3EndBattleText1 ; 0x4735 TextEndBattle @@ -31,7 +31,7 @@ PokemonTower3TrainerHeader0: ; 606ed (18:46ed) PokemonTower3TrainerHeader1: ; 606f9 (18:46f9) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d765 ; flag's byte + dw wd765 ; flag's byte dw PokemonTower3BattleText2 ; 0x473f TextBeforeBattle dw PokemonTower3AfterBattleText2 ; 0x4749 TextAfterBattle dw PokemonTower3EndBattleText2 ; 0x4744 TextEndBattle @@ -40,7 +40,7 @@ PokemonTower3TrainerHeader1: ; 606f9 (18:46f9) PokemonTower3TrainerHeader2: ; 60705 (18:4705) db $3 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d765 ; flag's byte + dw wd765 ; flag's byte dw PokemonTower3BattleText3 ; 0x474e TextBeforeBattle dw PokemonTower3AfterBattleText3 ; 0x4758 TextAfterBattle dw PokemonTower3EndBattleText3 ; 0x4753 TextEndBattle diff --git a/scripts/pokemontower4.asm b/scripts/pokemontower4.asm index 05fcb23f..e48b9681 100755 --- a/scripts/pokemontower4.asm +++ b/scripts/pokemontower4.asm @@ -24,7 +24,7 @@ PokemonTower4TrainerHeaders: ; 6081b (18:481b) PokemonTower4TrainerHeader0: ; 6081b (18:481b) db $1 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d766 ; flag's byte + dw wd766 ; flag's byte dw PokemonTower4BattleText1 ; 0x485e TextBeforeBattle dw PokemonTower4AfterBattleText1 ; 0x4868 TextAfterBattle dw PokemonTower4EndBattleText1 ; 0x4863 TextEndBattle @@ -33,7 +33,7 @@ PokemonTower4TrainerHeader0: ; 6081b (18:481b) PokemonTower4TrainerHeader1: ; 60827 (18:4827) db $2 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d766 ; flag's byte + dw wd766 ; flag's byte dw PokemonTower4BattleText2 ; 0x486d TextBeforeBattle dw PokemonTower4AfterBattleText2 ; 0x4877 TextAfterBattle dw PokemonTower4EndBattleText2 ; 0x4872 TextEndBattle @@ -42,7 +42,7 @@ PokemonTower4TrainerHeader1: ; 60827 (18:4827) PokemonTower4TrainerHeader2: ; 60833 (18:4833) db $3 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d766 ; flag's byte + dw wd766 ; flag's byte dw PokemonTower4BattleText3 ; 0x487c TextBeforeBattle dw PokemonTower4AfterBattleText3 ; 0x4886 TextAfterBattle dw PokemonTower4EndBattleText3 ; 0x4881 TextEndBattle diff --git a/scripts/pokemontower5.asm b/scripts/pokemontower5.asm index 5c43c7da..317690a2 100755 --- a/scripts/pokemontower5.asm +++ b/scripts/pokemontower5.asm @@ -16,24 +16,23 @@ PokemonTower5Script0: ; 6094b (18:494b) ld hl, CoordsData_60992 ; $4992 call ArePlayerCoordsInArray jr c, .asm_60960 - ld hl, $d72e + ld hl, wd72e res 4, [hl] - ld hl, $d767 + ld hl, wd767 res 7, [hl] jp CheckFightingMapTrainers .asm_60960 - ld hl, $d767 + ld hl, wd767 bit 7, [hl] set 7, [hl] ret nz xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d72e + ld [wJoyIgnore], a + ld hl, wd72e set 4, [hl] - ld a, $7 - call Predef ; indirect jump to HealParty (f6a5 (3:76a5)) + predef HealParty call GBFadeOut2 call Delay3 call Delay3 @@ -42,7 +41,7 @@ PokemonTower5Script0: ; 6094b (18:494b) ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ret CoordsData_60992: ; 60992 (18:4992) @@ -65,7 +64,7 @@ PokemonTower5TrainerHeaders: ; 609a9 (18:49a9) PokemonTower5TrainerHeader0: ; 609a9 (18:49a9) db $2 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d767 ; flag's byte + dw wd767 ; flag's byte dw PokemonTower5BattleText1 ; 0x49e9 TextBeforeBattle dw PokemonTower5AfterBattleText1 ; 0x49f3 TextAfterBattle dw PokemonTower5EndBattleText1 ; 0x49ee TextEndBattle @@ -74,7 +73,7 @@ PokemonTower5TrainerHeader0: ; 609a9 (18:49a9) PokemonTower5TrainerHeader1: ; 609b5 (18:49b5) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d767 ; flag's byte + dw wd767 ; flag's byte dw PokemonTower5BattleText2 ; 0x4a02 TextBeforeBattle dw PokemonTower5AfterBattleText2 ; 0x4a0c TextAfterBattle dw PokemonTower5EndBattleText2 ; 0x4a07 TextEndBattle @@ -83,7 +82,7 @@ PokemonTower5TrainerHeader1: ; 609b5 (18:49b5) PokemonTower5TrainerHeader2: ; 609c1 (18:49c1) db $4 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d767 ; flag's byte + dw wd767 ; flag's byte dw PokemonTower5BattleText3 ; 0x4a1b TextBeforeBattle dw PokemonTower5AfterBattleText3 ; 0x4a25 TextAfterBattle dw PokemonTower5EndBattleText3 ; 0x4a20 TextEndBattle @@ -92,7 +91,7 @@ PokemonTower5TrainerHeader2: ; 609c1 (18:49c1) PokemonTower5TrainerHeader3: ; 609cd (18:49cd) db $5 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d767 ; flag's byte + dw wd767 ; flag's byte dw PokemonTower5BattleText4 ; 0x4a34 TextBeforeBattle dw PokemonTower5AfterBattleText4 ; 0x4a3e TextAfterBattle dw PokemonTower5EndBattleText4 ; 0x4a39 TextEndBattle diff --git a/scripts/pokemontower6.asm b/scripts/pokemontower6.asm index e3d8a4c4..fe33ce29 100755 --- a/scripts/pokemontower6.asm +++ b/scripts/pokemontower6.asm @@ -7,9 +7,9 @@ PokemonTower6Script: ; 60aef (18:4aef) ld [W_POKEMONTOWER6CURSCRIPT], a ret -Func_60b02: ; 60b02 (18:4b02) +PokemonTower6Script_60b02: ; 60b02 (18:4b02) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_POKEMONTOWER6CURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -22,21 +22,21 @@ PokemonTower6ScriptPointers: ; 60b0d (18:4b0d) dw PokemonTower6Script4 PokemonTower6Script0: ; 60b17 (18:4b17) - ld a, [$d768] + ld a, [wd768] bit 7, a jp nz, CheckFightingMapTrainers ld hl, CoordsData_60b45 ; $4b45 call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $6 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID ld a, MAROWAK - ld [W_CUROPPONENT], a ; $d059 + ld [W_CUROPPONENT], a ; wd059 ld a, 30 - ld [W_CURENEMYLVL], a ; $d127 + ld [W_CURENEMYLVL], a ; W_CURENEMYLVL ld a, $4 ld [W_POKEMONTOWER6CURSCRIPT], a ld [W_CURMAPSCRIPT], a @@ -46,40 +46,40 @@ CoordsData_60b45: ; 60b45 (18:4b45) db $10,$0A,$FF PokemonTower6Script4: ; 60b48 (18:4b48) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff - jp z, Func_60b02 + jp z, PokemonTower6Script_60b02 ld a, $ff - ld [wJoypadForbiddenButtonsMask], a - ld a, [$d72d] + ld [wJoyIgnore], a + ld a, [wd72d] bit 6, a ret nz call UpdateSprites ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a - ld a, [$cf0b] + ld [wJoyIgnore], a + ld a, [wcf0b] and a jr nz, .asm_60b82 - ld hl, $d768 + ld hl, wd768 set 7, [hl] ld a, $7 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $0 ld [W_POKEMONTOWER6CURSCRIPT], a ld [W_CURMAPSCRIPT], a ret .asm_60b82 ld a, $1 - ld [$cd38], a + ld [wcd38], a ld a, $10 - ld [$ccd3], a + ld [wccd3], a xor a - ld [$c206], a - ld [$cd3b], a - ld hl, $d730 + ld [wSpriteStateData2 + $06], a + ld [wcd3b], a + ld hl, wd730 set 7, [hl] ld a, $3 ld [W_POKEMONTOWER6CURSCRIPT], a @@ -87,7 +87,7 @@ PokemonTower6Script4: ; 60b48 (18:4b48) ret PokemonTower6Script3: ; 60ba1 (18:4ba1) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 @@ -109,7 +109,7 @@ PokemonTower6TrainerHeaders: ; 60bbf (18:4bbf) PokemonTower6TrainerHeader0: ; 60bbf (18:4bbf) db $1 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d768 ; flag's byte + dw wd768 ; flag's byte dw PokemonTower6BattleText1 ; 0x4c29 TextBeforeBattle dw PokemonTower6AfterBattleText1 ; 0x4c33 TextAfterBattle dw PokemonTower6EndBattleText1 ; 0x4c2e TextEndBattle @@ -118,7 +118,7 @@ PokemonTower6TrainerHeader0: ; 60bbf (18:4bbf) PokemonTower6TrainerHeader1: ; 60bcb (18:4bcb) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d768 ; flag's byte + dw wd768 ; flag's byte dw PokemonTower6BattleText2 ; 0x4c38 TextBeforeBattle dw PokemonTower6AfterBattleText2 ; 0x4c42 TextAfterBattle dw PokemonTower6EndBattleText2 ; 0x4c3d TextEndBattle @@ -127,7 +127,7 @@ PokemonTower6TrainerHeader1: ; 60bcb (18:4bcb) PokemonTower6TrainerHeader2: ; 60bd7 (18:4bd7) db $3 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d768 ; flag's byte + dw wd768 ; flag's byte dw PokemonTower6BattleText3 ; 0x4c47 TextBeforeBattle dw PokemonTower6AfterBattleText3 ; 0x4c51 TextAfterBattle dw PokemonTower6EndBattleText3 ; 0x4c4c TextEndBattle diff --git a/scripts/pokemontower7.asm b/scripts/pokemontower7.asm index 3e1fcccb..431855cb 100755 --- a/scripts/pokemontower7.asm +++ b/scripts/pokemontower7.asm @@ -9,7 +9,7 @@ PokemonTower7Script: ; 60d05 (18:4d05) PokemonTower7Script_60d18: ; 60d18 (18:4d18) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_POKEMONTOWER7CURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -24,13 +24,13 @@ PokemonTower7ScriptPointers: ; 60d23 (18:4d23) PokemonTower7Script2: ; 60d23 (18:4d23) ld hl, wFlags_0xcd60 res 0, [hl] - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, PokemonTower7Script_60d18 call EndTrainerBattle ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a - ld a, [$cf13] + ld [wJoyIgnore], a + ld a, [wcf13] ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID call PokemonTower7Script_60db6 @@ -40,25 +40,24 @@ PokemonTower7Script2: ; 60d23 (18:4d23) ret PokemonTower7Script3: ; 60d56 (18:4d56) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz ld hl, W_MISSABLEOBJECTLIST - ld a, [$cf13] + ld a, [wcf13] ld b, a .missableObjectsListLoop ld a, [hli] cp b ; search for sprite ID in missing objects list ld a, [hli] jr nz, .missableObjectsListLoop - ld [$cc4d], a ; remove missable object - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a ; remove missable object + predef HideObject xor a - ld [wJoypadForbiddenButtonsMask], a - ld [$cf13], a + ld [wJoyIgnore], a + ld [wcf13], a ld [wTrainerHeaderFlagBit], a - ld [$da38], a + ld [wda38], a ld a, $0 ld [W_POKEMONTOWER7CURSCRIPT], a ld [W_CURMAPSCRIPT], a @@ -66,20 +65,19 @@ PokemonTower7Script3: ; 60d56 (18:4d56) PokemonTower7Script4: ; 60d86 (18:4d86) ld a, $ff - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $43 - ld [$cc4d], a - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a + predef HideObject ld a, $4 - ld [$c109], a + ld [wSpriteStateData1 + 9], a ld a, $95 ld [H_DOWNARROWBLINKCNT1], a ; $ff8b ld a, $1 - ld [$d42f], a + ld [wd42f], a ld a, LAVENDER_TOWN ld [wLastMap], a - ld hl, $d72d + ld hl, wd72d set 3, [hl] ld a, $0 ld [W_POKEMONTOWER7CURSCRIPT], a @@ -88,15 +86,15 @@ PokemonTower7Script4: ; 60d86 (18:4d86) PokemonTower7Script_60db6: ; 60db6 (18:4db6) ld hl, CoordsData_60de3 ; $4de3 - ld a, [$cf13] + ld a, [wcf13] dec a swap a ld d, $0 ld e, a add hl, de - ld a, [W_YCOORD] ; $d361 + ld a, [W_YCOORD] ; wd361 ld b, a - ld a, [W_XCOORD] ; $d362 + ld a, [W_XCOORD] ; wd362 ld c, a .asm_60dcb ld a, [hli] @@ -108,7 +106,7 @@ PokemonTower7Script_60db6: ; 60db6 (18:4db6) ld a, [hli] ld d, [hl] ld e, a - ld a, [$cf13] + ld a, [wcf13] ld [H_DOWNARROWBLINKCNT2], a ; $ff8c jp MoveSprite .asm_60dde @@ -172,7 +170,7 @@ PokemonTower7TrainerHeaders: ; 60e47 (18:4e47) PokemonTower7TrainerHeader0: ; 60e47 (18:4e47) db $1 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d769 ; flag's byte + dw wd769 ; flag's byte dw PokemonTower7BattleText1 ; 0x4ec9 TextBeforeBattle dw PokemonTower7AfterBattleText1 ; 0x4ed3 TextAfterBattle dw PokemonTower7EndBattleText1 ; 0x4ece TextEndBattle @@ -181,7 +179,7 @@ PokemonTower7TrainerHeader0: ; 60e47 (18:4e47) PokemonTower7TrainerHeader1: ; 60e53 (18:4e53) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d769 ; flag's byte + dw wd769 ; flag's byte dw PokemonTower7BattleText2 ; 0x4ed8 TextBeforeBattle dw PokemonTower7AfterBattleText2 ; 0x4ee2 TextAfterBattle dw PokemonTower7EndBattleText2 ; 0x4edd TextEndBattle @@ -190,7 +188,7 @@ PokemonTower7TrainerHeader1: ; 60e53 (18:4e53) PokemonTower7TrainerHeader2: ; 60e5f (18:4e5f) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d769 ; flag's byte + dw wd769 ; flag's byte dw PokemonTower7BattleText3 ; 0x4ee7 TextBeforeBattle dw PokemonTower7AfterBattleText3 ; 0x4ef1 TextAfterBattle dw PokemonTower7EndBattleText3 ; 0x4eec TextEndBattle @@ -220,22 +218,19 @@ PokemonTower7Text4: ; 60e8a (18:4e8a) db $08 ; asm ld hl, PokemonTower7Text_60ec4 call PrintText - ld hl, $d7e0 + ld hl, wd7e0 set 7, [hl] - ld hl, $d769 + ld hl, wd769 set 7, [hl] ld a, $44 - ld [$cc4d], a - ld a, $15 - call Predef + ld [wcc4d], a + predef ShowObject ld a, $17 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject ld a, $18 - ld [$cc4d], a - ld a, $15 - call Predef + ld [wcc4d], a + predef ShowObject ld a, $4 ld [W_POKEMONTOWER7CURSCRIPT], a ld [W_CURMAPSCRIPT], a diff --git a/scripts/powerplant.asm b/scripts/powerplant.asm index d5e126dc..b90ba7a1 100755 --- a/scripts/powerplant.asm +++ b/scripts/powerplant.asm @@ -32,7 +32,7 @@ PowerPlantTrainerHeaders: ; 1e2fb (7:62fb) PowerPlantTrainerHeader0: ; 1e2fb (7:62fb) db 1 ; flag's bit db 0 ; view range - dw $d7d3 ; flag's byte + dw wd7d3 ; flag's byte dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle @@ -41,7 +41,7 @@ PowerPlantTrainerHeader0: ; 1e2fb (7:62fb) PowerPlantTrainerHeader1: ; 1e307 (7:6307) db 2 ; flag's bit db 0 ; view range - dw $d7d3 ; flag's byte + dw wd7d3 ; flag's byte dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle @@ -50,7 +50,7 @@ PowerPlantTrainerHeader1: ; 1e307 (7:6307) PowerPlantTrainerHeader2: ; 1e313 (7:6313) db 3 ; flag's bit db 0 ; view range - dw $d7d3 ; flag's byte + dw wd7d3 ; flag's byte dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle @@ -59,7 +59,7 @@ PowerPlantTrainerHeader2: ; 1e313 (7:6313) PowerPlantTrainerHeader3: ; 1e31f (7:631f) db 4 ; flag's bit db 0 ; view range - dw $d7d3 ; flag's byte + dw wd7d3 ; flag's byte dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle @@ -68,7 +68,7 @@ PowerPlantTrainerHeader3: ; 1e31f (7:631f) PowerPlantTrainerHeader4: ; 1e32b (7:632b) db 5 ; flag's bit db 0 ; view range - dw $d7d3 ; flag's byte + dw wd7d3 ; flag's byte dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle @@ -77,7 +77,7 @@ PowerPlantTrainerHeader4: ; 1e32b (7:632b) PowerPlantTrainerHeader5: ; 1e337 (7:6337) db 6 ; flag's bit db 0 ; view range - dw $d7d3 ; flag's byte + dw wd7d3 ; flag's byte dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle @@ -86,7 +86,7 @@ PowerPlantTrainerHeader5: ; 1e337 (7:6337) PowerPlantTrainerHeader6: ; 1e343 (7:6343) db 7 ; flag's bit db 0 ; view range - dw $d7d3 ; flag's byte + dw wd7d3 ; flag's byte dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle @@ -95,7 +95,7 @@ PowerPlantTrainerHeader6: ; 1e343 (7:6343) PowerPlantTrainerHeader7: ; 1e34f (7:634f) db 8 ; flag's bit db 0 ; view range - dw $d7d3 ; flag's byte + dw wd7d3 ; flag's byte dw VoltorbBattleText ; TextBeforeBattle dw VoltorbBattleText ; TextAfterBattle dw VoltorbBattleText ; TextEndBattle @@ -104,7 +104,7 @@ PowerPlantTrainerHeader7: ; 1e34f (7:634f) PowerPlantTrainerHeader8: ; 1e35b (7:635b) db 9 ; flag's bit db 0 ; view range - dw $d7d3 ; flag's byte + dw wd7d3 ; flag's byte dw ZapdosBattleText ; TextBeforeBattle dw ZapdosBattleText ; TextAfterBattle dw ZapdosBattleText ; TextEndBattle diff --git a/scripts/redshouse1f.asm b/scripts/redshouse1f.asm index b787669e..0e3e331b 100755 --- a/scripts/redshouse1f.asm +++ b/scripts/redshouse1f.asm @@ -7,7 +7,7 @@ RedsHouse1FTextPointers: ; 4816b (12:416b) RedsHouse1FText1: ; 4816f (12:416f) ; 416F Mom db 8 - ld a, [$D72E] + ld a, [wd72e] bit 3, a jr nz, .heal ; if player has received a Pokémon from Oak, heal team ld hl, MomWakeUpText @@ -27,16 +27,16 @@ MomHealPokemon: ; 4818a (12:418a) call PrintText call GBFadeOut2 call ReloadMapData - PREDEF HealPartyPredef + predef HealParty ld a, MUSIC_PKMN_HEALED - ld [$C0EE], a + ld [wc0ee], a call PlaySound ; play sound? .next - ld a, [$C026] + ld a, [wc026] cp MUSIC_PKMN_HEALED jr z, .next - ld a, [$D35B] - ld [$C0EE], a + ld a, [wd35b] + ld [wc0ee], a call PlaySound call GBFadeIn2 ld hl, MomHealText2 @@ -51,7 +51,7 @@ MomHealText2: ; 481c1 (12:41c1) RedsHouse1FText2: ; 0x481c6 TV db 8 - ld a,[$C109] + ld a,[wSpriteStateData1 + 9] cp 4 ld hl,TVWrongSideText jr nz,.done ; if player is not facing up diff --git a/scripts/redshouse2f.asm b/scripts/redshouse2f.asm index 1004860c..8fcdc66e 100755 --- a/scripts/redshouse2f.asm +++ b/scripts/redshouse2f.asm @@ -10,9 +10,9 @@ RedsHouse2FScriptPointers: ; 5c0bc (17:40bc) RedsHouse2FScript0: ; 5c0c0 (17:40c0) xor a - ld [H_CURRENTPRESSEDBUTTONS],a + ld [hJoyHeld],a ld a,8 - ld [$D528],a + ld [wd528],a ld a,1 ld [W_REDSHOUSE2CURSCRIPT],a ret diff --git a/scripts/rockethideout1.asm b/scripts/rockethideout1.asm index ce88ff90..43e4fd26 100755 --- a/scripts/rockethideout1.asm +++ b/scripts/rockethideout1.asm @@ -9,11 +9,11 @@ RocketHideout1Script: ; 44bca (11:4bca) ret RocketHideout1Script_44be0: ; 44be0 (11:4be0) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z - ld a, [$d815] + ld a, [wd815] bit 7, a jr nz, .asm_44c01 bit 5, a @@ -23,15 +23,14 @@ RocketHideout1Script_44be0: ; 44be0 (11:4be0) .asm_44bf7 ld a, (SFX_02_57 - SFX_Headers_02) / 3 call PlaySound - ld hl, $d815 + ld hl, wd815 bit 7, [hl] .asm_44c01 ld a, $e .asm_44c03 - ld [$d09f], a + ld [wd09f], a ld bc, $080c - ld a, $17 - jp Predef + predef_jump Func_ee9e RocketHideout1ScriptPointers: ; 44c0e (11:4c0e) dw CheckFightingMapTrainers @@ -51,7 +50,7 @@ RocketHideout1TrainerHeaders: ; 44c22 (11:4c22) RocketHideout1TrainerHeader0: ; 44c22 (11:4c22) db $1 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d815 ; flag's byte + dw wd815 ; flag's byte dw RocketHideout1BattleText2 ; 0x4ca1 TextBeforeBattle dw RocketHideout1AfterBattleTxt2 ; 0x4cab TextAfterBattle dw RocketHideout1EndBattleText2 ; 0x4ca6 TextEndBattle @@ -60,7 +59,7 @@ RocketHideout1TrainerHeader0: ; 44c22 (11:4c22) RocketHideout1TrainerHeader2: ; 44c2e (11:4c2e) db $2 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d815 ; flag's byte + dw wd815 ; flag's byte dw RocketHideout1BattleText3 ; 0x4cb0 TextBeforeBattle dw RocketHideout1AfterBattleTxt3 ; 0x4cba TextAfterBattle dw RocketHideout1EndBattleText3 ; 0x4cb5 TextEndBattle @@ -69,7 +68,7 @@ RocketHideout1TrainerHeader2: ; 44c2e (11:4c2e) RocketHideout1TrainerHeader3: ; 44c3a (11:4c3a) db $3 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d815 ; flag's byte + dw wd815 ; flag's byte dw RocketHideout1BattleText4 ; 0x4cbf TextBeforeBattle dw RocketHideout1AfterBattleTxt4 ; 0x4cc9 TextAfterBattle dw RocketHideout1EndBattleText4 ; 0x4cc4 TextEndBattle @@ -78,7 +77,7 @@ RocketHideout1TrainerHeader3: ; 44c3a (11:4c3a) RocketHideout1TrainerHeader4: ; 44c46 (11:4c46) db $4 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d815 ; flag's byte + dw wd815 ; flag's byte dw RocketHideout1BattleText5 ; 0x4cce TextBeforeBattle dw RocketHideout1AfterBattleTxt5 ; 0x4cd8 TextAfterBattle dw RocketHideout1EndBattleText5 ; 0x4cd3 TextEndBattle @@ -87,7 +86,7 @@ RocketHideout1TrainerHeader4: ; 44c46 (11:4c46) RocketHideout1TrainerHeader5: ; 44c52 (11:4c52) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d815 ; flag's byte + dw wd815 ; flag's byte dw RocketHideout1BattleText6 ; 0x4cdd TextBeforeBattle dw RocketHideout1AfterBattleTxt6 ; 0x4ce2 TextAfterBattle dw RocketHideout1EndBattleText6 ; 0x4c91 TextEndBattle @@ -128,7 +127,7 @@ RocketHideout1Text5: ; 44c87 (11:4c87) RocketHideout1EndBattleText6: ; 44c91 (11:4c91) TX_FAR _RocketHideout1EndBattleText6 db $8 - ld hl, $d815 + ld hl, wd815 set 5, [hl] ld hl, RocketHideout1Text_44c9f ret diff --git a/scripts/rockethideout2.asm b/scripts/rockethideout2.asm index ac427373..aa8d31a4 100755 --- a/scripts/rockethideout2.asm +++ b/scripts/rockethideout2.asm @@ -22,13 +22,13 @@ RocketHideout2Script0: ; 44e42 (11:4e42) call Func_3442 cp $ff jp z, CheckFightingMapTrainers - ld hl, $d736 + ld hl, wd736 set 7, [hl] call Func_3486 ld a, (SFX_02_52 - SFX_Headers_02) / 3 call PlaySound ld a, $ff - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $3 ld [W_CURMAPSCRIPT], a ret @@ -306,19 +306,19 @@ RocketHideout2ArrowMovement36: ; 44fbb (11:4fbb) db $FF RocketHideout2Script3: ; 44fc2 (11:4fc2) - ld a, [$cd38] + ld a, [wcd38] and a jr nz, LoadSpinnerArrowTiles xor a - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d736 + ld [wJoyIgnore], a + ld hl, wd736 res 7, [hl] ld a, $0 ld [W_CURMAPSCRIPT], a ret LoadSpinnerArrowTiles: ; 44fd7 (11:4fd7) - ld a, [$c102] + ld a, [wSpriteStateData1 + 2] srl a srl a ld hl, SpinnerPlayerFacingDirections ; $5083 @@ -326,14 +326,14 @@ LoadSpinnerArrowTiles: ; 44fd7 (11:4fd7) ld b, $0 add hl, bc ld a, [hl] - ld [$c102], a - ld a, [W_CURMAPTILESET] ; $d367 + ld [wSpriteStateData1 + 2], a + ld a, [W_CURMAPTILESET] ; W_CURMAPTILESET cp FACILITY - ld hl, SpinnerArrowTilePointers1 ; $5023 + ld hl, FacilitySpinnerArrows ; $5023 jr z, .asm_44ff6 - ld hl, SpinnerArrowTilePointers2 ; $5053 + ld hl, GymSpinnerArrows ; $5053 .asm_44ff6 - ld a, [$cd38] + ld a, [wcd38] bit 0, a jr nz, .asm_45001 ld de, $18 @@ -368,87 +368,41 @@ LoadSpinnerArrowTiles: ; 44fd7 (11:4fd7) jr nz, .asm_45006 ret -SpinnerArrowTilePointers1: ; 45023 (11:5023) - dw SpinnerArrowAnimTiles ;address from within tileset graphics - db 1 ;number of tiles to copy? - db BANK(SpinnerArrowAnimTiles) ;bank of tileset graphics - dw $9200 ;where to load in VRAM - - dw SpinnerArrowAnimTiles + $10 - db 1 - db BANK(SpinnerArrowAnimTiles) - dw $9210 - - dw SpinnerArrowAnimTiles + $20 - db 1 - db BANK(SpinnerArrowAnimTiles) - dw $9300 - - dw SpinnerArrowAnimTiles + $30 - db 1 - db BANK(SpinnerArrowAnimTiles) - dw $9310 - - dw Facility_GFX + $200 - db 1 - db BANK(Facility_GFX) - dw $9200 - - dw Facility_GFX + $210 - db 1 - db BANK(Facility_GFX) - dw $9210 - - dw Facility_GFX + $300 - db 1 - db BANK(Facility_GFX) - dw $9300 - - dw Facility_GFX + $310 - db 1 - db BANK(Facility_GFX) - dw $9310 - -SpinnerArrowTilePointers2: ; 45053 (11:5053) - dw SpinnerArrowAnimTiles + $10 - db 1 - db BANK(SpinnerArrowAnimTiles) - dw $93C0 - - dw SpinnerArrowAnimTiles + $30 - db 1 - db BANK(SpinnerArrowAnimTiles) - dw $93D0 - - dw SpinnerArrowAnimTiles - db 1 - db BANK(SpinnerArrowAnimTiles) - dw $94C0 - - dw SpinnerArrowAnimTiles + $20 - db 1 - db BANK(SpinnerArrowAnimTiles) - dw $94D0 - - dw Gym_GFX + $3C0 - db 1 - db BANK(Facility_GFX) - dw $93C0 - - dw Gym_GFX + $3D0 - db 1 - db BANK(Facility_GFX) - dw $93D0 - - dw Gym_GFX + $4C0 - db 1 - db BANK(Facility_GFX) - dw $94C0 - - dw Gym_GFX + $4D0 - db 1 - db BANK(Facility_GFX) - dw $94D0 +spinner: MACRO +; \1: source +; \2: offset (BANK() chokes on literals) +; \3: length +; \4: dest + dw \1 + \2 + db \3, BANK(\1) + dw \4 +ENDM + +FacilitySpinnerArrows: +FACILITY_SPINNER EQU $20 * $10 +vFacilitySpinner EQU vTileset + FACILITY_SPINNER + + spinner SpinnerArrowAnimTiles, $00, 1, vFacilitySpinner + spinner SpinnerArrowAnimTiles, $10, 1, vFacilitySpinner + $10 + spinner SpinnerArrowAnimTiles, $20, 1, vFacilitySpinner + $100 + spinner SpinnerArrowAnimTiles, $30, 1, vFacilitySpinner + $110 + spinner Facility_GFX, FACILITY_SPINNER + $000, 1, vFacilitySpinner + spinner Facility_GFX, FACILITY_SPINNER + $010, 1, vFacilitySpinner + $10 + spinner Facility_GFX, FACILITY_SPINNER + $100, 1, vFacilitySpinner + $100 + spinner Facility_GFX, FACILITY_SPINNER + $110, 1, vFacilitySpinner + $110 + +GymSpinnerArrows: +GYM_SPINNER EQU $3c * $10 +vGymSpinner EQU vTileset + GYM_SPINNER + + spinner SpinnerArrowAnimTiles, $10, 1, vGymSpinner + spinner SpinnerArrowAnimTiles, $30, 1, vGymSpinner + $10 + spinner SpinnerArrowAnimTiles, $00, 1, vGymSpinner + $100 + spinner SpinnerArrowAnimTiles, $20, 1, vGymSpinner + $110 + spinner Gym_GFX, GYM_SPINNER + $000, 1, vGymSpinner + spinner Gym_GFX, GYM_SPINNER + $010, 1, vGymSpinner + $10 + spinner Gym_GFX, GYM_SPINNER + $100, 1, vGymSpinner + $100 + spinner Gym_GFX, GYM_SPINNER + $110, 1, vGymSpinner + $110 SpinnerPlayerFacingDirections: ; 45083 (11:5083) ; This isn't the order of the facing directions. Rather, it's a list of @@ -474,7 +428,7 @@ RocketHideout2TrainerHeaders: ; 450d1 (11:50d1) RocketHideout2TrainerHeader0: ; 450d1 (11:50d1) db $1 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d817 ; flag's byte + dw wd817 ; flag's byte dw RocketHideout2BattleText2 ; 0x50e8 TextBeforeBattle dw RocketHideout2AfterBattleTxt2 ; 0x50f2 TextAfterBattle dw RocketHideout2EndBattleText2 ; 0x50ed TextEndBattle diff --git a/scripts/rockethideout3.asm b/scripts/rockethideout3.asm index d9e1d077..e3223a85 100755 --- a/scripts/rockethideout3.asm +++ b/scripts/rockethideout3.asm @@ -22,13 +22,13 @@ RocketHideout3Script0: ; 45240 (11:5240) call Func_3442 cp $ff jp z, CheckFightingMapTrainers - ld hl, $d736 + ld hl, wd736 set 7, [hl] call Func_3486 ld a, (SFX_02_52 - SFX_Headers_02) / 3 call PlaySound ld a, $ff - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $3 ld [W_CURMAPSCRIPT], a ret @@ -136,12 +136,12 @@ RocketHideout3ArrowMovement12: ; 452e1 (11:52e1) db $FF RocketHideout3Script3 ; 452e4 (11:452e4) - ld a, [$cd38] + ld a, [wcd38] and a jp nz, LoadSpinnerArrowTiles xor a - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d736 + ld [wJoyIgnore], a + ld hl, wd736 res 7, [hl] ld a, $0 ld [W_CURMAPSCRIPT], a @@ -157,7 +157,7 @@ RocketHideout3TrainerHeaders: ; 45302 (11:5302) RocketHideout3TrainerHeader0: ; 45302 (11:5302) db $1 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d819 ; flag's byte + dw wd819 ; flag's byte dw RocketHideout3BattleText2 ; 0x5325 TextBeforeBattle dw RocketHideout3AfterBattleTxt2 ; 0x532f TextAfterBattle dw RocketHideout3EndBattleText2 ; 0x532a TextEndBattle @@ -166,7 +166,7 @@ RocketHideout3TrainerHeader0: ; 45302 (11:5302) RocketHideout3TrainerHeader2: ; 4530e (11:530e) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d819 ; flag's byte + dw wd819 ; flag's byte dw RocketHideout3BattleTxt ; 0x533e TextBeforeBattle dw RocketHideout3AfterBattleText3 ; 0x5348 TextAfterBattle dw RocketHideout3EndBattleText3 ; 0x5343 TextEndBattle diff --git a/scripts/rockethideout4.asm b/scripts/rockethideout4.asm index 5e245e8d..5c99f3a1 100755 --- a/scripts/rockethideout4.asm +++ b/scripts/rockethideout4.asm @@ -9,11 +9,11 @@ RocketHideout4Script: ; 4545d (11:545d) ret RocketHideout4Script_45473: ; 45473 (11:5473) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z - ld a, [$d81b] + ld a, [wd81b] bit 5, a jr nz, .asm_45496 and $c @@ -24,19 +24,18 @@ RocketHideout4Script_45473: ; 45473 (11:5473) .asm_4548c ld a, (SFX_02_57 - SFX_Headers_02) / 3 call PlaySound - ld hl, $d81b + ld hl, wd81b set 5, [hl] .asm_45496 ld a, $e .asm_45498 - ld [$d09f], a + ld [wd09f], a ld bc, $050c - ld a, $17 - jp Predef + predef_jump Func_ee9e RocketHideout4Script_454a3: ; 454a3 (11:54a3) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_ROCKETHIDEOUT4CURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -53,26 +52,24 @@ RocketHideout4Script3: ; 454b6 (11:54b6) jp z, RocketHideout4Script_454a3 call UpdateSprites ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d81b + ld [wJoyIgnore], a + ld hl, wd81b set 7, [hl] ld a, $a ld [H_SPRITEHEIGHT], a call DisplayTextID call GBFadeIn1 ld a, $83 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject ld a, $87 - ld [$cc4d], a - ld a, $15 - call Predef + ld [wcc4d], a + predef ShowObject call UpdateSprites call GBFadeOut1 xor a - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d126 + ld [wJoyIgnore], a + ld hl, wd126 set 5, [hl] ld a, $0 ld [W_ROCKETHIDEOUT4CURSCRIPT], a @@ -95,7 +92,7 @@ RocketHideout4TrainerHeaders: ; 45515 (11:5515) RocketHideout4TrainerHeader0: ; 45515 (11:5515) db $2 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d81b ; flag's byte + dw wd81b ; flag's byte dw RocketHideout4BattleText2 ; 0x5593 TextBeforeBattle dw RocketHideout4AfterBattleText2 ; 0x559d TextAfterBattle dw RocketHideout4EndBattleText2 ; 0x5598 TextEndBattle @@ -104,7 +101,7 @@ RocketHideout4TrainerHeader0: ; 45515 (11:5515) RocketHideout4TrainerHeader2: ; 45521 (11:5521) db $3 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d81b ; flag's byte + dw wd81b ; flag's byte dw RocketHideout4BattleText3 ; 0x55ac TextBeforeBattle dw RocketHideout4AfterBattleText3 ; 0x55b6 TextAfterBattle dw RocketHideout4EndBattleText3 ; 0x55b1 TextEndBattle @@ -113,7 +110,7 @@ RocketHideout4TrainerHeader2: ; 45521 (11:5521) RocketHideout4TrainerHeader3: ; 4552d (11:552d) db $4 ; flag's bit db ($1 << 4) ; trainer's view range - dw $d81b ; flag's byte + dw wd81b ; flag's byte dw RocketHideout4BattleText4 ; 0x55c5 TextBeforeBattle dw RocketHideout4AfterBattleText4 ; 0x55cf TextAfterBattle dw RocketHideout4EndBattleText4 ; 0x55ca TextEndBattle @@ -123,19 +120,19 @@ RocketHideout4TrainerHeader3: ; 4552d (11:552d) RocketHideout4Text1: ; 4553a (11:553a) db $08 ; asm - ld a, [$d81b] + ld a, [wd81b] bit 7, a jp nz, .asm_545571 ld hl, RocketHideout4Text_4557a call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, RocketHideout4Text_4557f ld de, RocketHideout4Text_4557f call PreBattleSaveRegisters ldh a, [$8c] - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters xor a @@ -216,14 +213,13 @@ RocketHideout4AfterBattleText4: ; 455cf (11:55cf) db $8 ld hl, RocketHideout4Text_455ec ; $55ec call PrintText - ld hl, $d81b + ld hl, wd81b bit 6, [hl] set 6, [hl] jr nz, .asm_455e9 ; 0x455dd $a ld a, $88 - ld [$cc4d], a - ld a, $15 - call Predef + ld [wcc4d], a + predef ShowObject .asm_455e9 jp TextScriptEnd diff --git a/scripts/rockethideoutelevator.asm b/scripts/rockethideoutelevator.asm index 57e62177..73313dd7 100755 --- a/scripts/rockethideoutelevator.asm +++ b/scripts/rockethideoutelevator.asm @@ -1,5 +1,5 @@ RocketHideoutElevatorScript: ; 45710 (11:5710) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] push hl @@ -9,16 +9,16 @@ RocketHideoutElevatorScript: ; 45710 (11:5710) res 7, [hl] call nz, RocketHideoutElevatorScript_4575f xor a - ld [$cf0c], a + ld [wcf0c], a inc a - ld [$cc3c], a + ld [wcc3c], a ret RocketHideoutElevatorScript_4572c: ; 4572c (11:572c) - ld hl, $d3af - ld a, [$d73b] + ld hl, wd3af + ld a, [wd73b] ld b, a - ld a, [$d73c] + ld a, [wd73c] ld c, a call RocketHideoutElevatorScript_4573a @@ -35,7 +35,7 @@ RocketHideoutElevatorScript_45741: ; 45741 (11:5741) ld hl, RocketHideoutElavatorFloors ; $5754 call LoadItemList ld hl, RocketHideoutElevatorWarpMaps ; $5759 - ld de, $cc5b + ld de, wcc5b ld bc, $0006 call CopyData ret @@ -68,8 +68,7 @@ RocketHideoutElevatorText1: ; 4576d (11:576d) jr z, .asm_8d8f0 ; 0x45773 call RocketHideoutElevatorScript_45741 ld hl, RocketHideoutElevatorWarpMaps ; $5759 - ld a, $61 - call Predef + predef Func_1c9c6 jr .asm_46c43 ; 0x45780 .asm_8d8f0 ; 0x45782 ld hl, RocketHideoutElevatorText_4578b diff --git a/scripts/rocktunnel1.asm b/scripts/rocktunnel1.asm index be49e494..ad6e493f 100755 --- a/scripts/rocktunnel1.asm +++ b/scripts/rocktunnel1.asm @@ -26,7 +26,7 @@ RockTunnel1TrainerHeaders: ; 44505 (11:4505) RockTunnel1TrainerHeader1: ; 44505 (11:4505) db $1 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d2 ; flag's byte + dw wd7d2 ; flag's byte dw RockTunnel1BattleText1 ; 0x4588 TextBeforeBattle dw RockTunnel1AfterBattleText1 ; 0x4592 TextAfterBattle dw RockTunnel1EndBattleText1 ; 0x458d TextEndBattle @@ -35,7 +35,7 @@ RockTunnel1TrainerHeader1: ; 44505 (11:4505) RockTunnel1TrainerHeader2: ; 44511 (11:4511) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d2 ; flag's byte + dw wd7d2 ; flag's byte dw RockTunnel1BattleText2 ; 0x4597 TextBeforeBattle dw RockTunnel1AfterBattleText2 ; 0x45a1 TextAfterBattle dw RockTunnel1EndBattleText2 ; 0x459c TextEndBattle @@ -44,7 +44,7 @@ RockTunnel1TrainerHeader2: ; 44511 (11:4511) RockTunnel1TrainerHeader3: ; 4451d (11:451d) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7d2 ; flag's byte + dw wd7d2 ; flag's byte dw RockTunnel1BattleText3 ; 0x45a6 TextBeforeBattle dw RockTunnel1AfterBattleText3 ; 0x45b0 TextAfterBattle dw RockTunnel1EndBattleText3 ; 0x45ab TextEndBattle @@ -53,7 +53,7 @@ RockTunnel1TrainerHeader3: ; 4451d (11:451d) RockTunnel1TrainerHeader4: ; 44529 (11:4529) db $4 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7d2 ; flag's byte + dw wd7d2 ; flag's byte dw RockTunnel1BattleText4 ; 0x45b5 TextBeforeBattle dw RockTunnel1AfterBattleText4 ; 0x45bf TextAfterBattle dw RockTunnel1EndBattleText4 ; 0x45ba TextEndBattle @@ -62,7 +62,7 @@ RockTunnel1TrainerHeader4: ; 44529 (11:4529) RockTunnel1TrainerHeader5: ; 44535 (11:4535) db $5 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d2 ; flag's byte + dw wd7d2 ; flag's byte dw RockTunnel1BattleText5 ; 0x45c4 TextBeforeBattle dw RockTunnel1AfterBattleText5 ; 0x45ce TextAfterBattle dw RockTunnel1EndBattleText5 ; 0x45c9 TextEndBattle @@ -71,7 +71,7 @@ RockTunnel1TrainerHeader5: ; 44535 (11:4535) RockTunnel1TrainerHeader6: ; 44541 (11:4541) db $6 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d2 ; flag's byte + dw wd7d2 ; flag's byte dw RockTunnel1BattleText6 ; 0x45d3 TextBeforeBattle dw RockTunnel1AfterBattleText6 ; 0x45dd TextAfterBattle dw RockTunnel1EndBattleText6 ; 0x45d8 TextEndBattle @@ -80,7 +80,7 @@ RockTunnel1TrainerHeader6: ; 44541 (11:4541) RockTunnel1TrainerHeader7: ; 4454d (11:454d) db $7 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d2 ; flag's byte + dw wd7d2 ; flag's byte dw RockTunnel1BattleText7 ; 0x45e2 TextBeforeBattle dw RockTunnel1AfterBattleText7 ; 0x45ec TextAfterBattle dw RockTunnel1EndBattleText7 ; 0x45e7 TextEndBattle diff --git a/scripts/rocktunnel2.asm b/scripts/rocktunnel2.asm index 62f4fe18..a35a7325 100755 --- a/scripts/rocktunnel2.asm +++ b/scripts/rocktunnel2.asm @@ -26,7 +26,7 @@ RockTunnel2TrainerHeaders: ; 46014 (11:6014) RockTunnel2TrainerHeader0: ; 46014 (11:6014) db $1 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d87d ; flag's byte + dw wd87d ; flag's byte dw RockTunnel2BattleText2 ; 0x60c5 TextBeforeBattle dw RockTunnel2AfterBattleText2 ; 0x60cf TextAfterBattle dw RockTunnel2EndBattleText2 ; 0x60ca TextEndBattle @@ -35,7 +35,7 @@ RockTunnel2TrainerHeader0: ; 46014 (11:6014) RockTunnel2TrainerHeader2: ; 46020 (11:6020) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d87d ; flag's byte + dw wd87d ; flag's byte dw RockTunnel2BattleText3 ; 0x60d4 TextBeforeBattle dw RockTunnel2AfterBattleText3 ; 0x60de TextAfterBattle dw RockTunnel2EndBattleText3 ; 0x60d9 TextEndBattle @@ -44,7 +44,7 @@ RockTunnel2TrainerHeader2: ; 46020 (11:6020) RockTunnel2TrainerHeader3: ; 4602c (11:602c) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d87d ; flag's byte + dw wd87d ; flag's byte dw RockTunnel2BattleText4 ; 0x60e3 TextBeforeBattle dw RockTunnel2AfterBattleText4 ; 0x60ed TextAfterBattle dw RockTunnel2EndBattleText4 ; 0x60e8 TextEndBattle @@ -53,7 +53,7 @@ RockTunnel2TrainerHeader3: ; 4602c (11:602c) RockTunnel2TrainerHeader4: ; 46038 (11:6038) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d87d ; flag's byte + dw wd87d ; flag's byte dw RockTunnel2BattleText5 ; 0x60f2 TextBeforeBattle dw RockTunnel2AfterBattleText5 ; 0x60fc TextAfterBattle dw RockTunnel2EndBattleText5 ; 0x60f7 TextEndBattle @@ -62,7 +62,7 @@ RockTunnel2TrainerHeader4: ; 46038 (11:6038) RockTunnel2TrainerHeader5: ; 46044 (11:6044) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d87d ; flag's byte + dw wd87d ; flag's byte dw RockTunnel2BattleText6 ; 0x6101 TextBeforeBattle dw RockTunnel2AfterBattleText6 ; 0x610b TextAfterBattle dw RockTunnel2EndBattleText6 ; 0x6106 TextEndBattle @@ -71,7 +71,7 @@ RockTunnel2TrainerHeader5: ; 46044 (11:6044) RockTunnel2TrainerHeader6: ; 46050 (11:6050) db $6 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d87d ; flag's byte + dw wd87d ; flag's byte dw RockTunnel2BattleText7 ; 0x6110 TextBeforeBattle dw RockTunnel2AfterBattleText7 ; 0x611a TextAfterBattle dw RockTunnel2EndBattleText7 ; 0x6115 TextEndBattle @@ -80,7 +80,7 @@ RockTunnel2TrainerHeader6: ; 46050 (11:6050) RockTunnel2TrainerHeader7: ; 4605c (11:605c) db $7 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d87d ; flag's byte + dw wd87d ; flag's byte dw RockTunnel2BattleText8 ; 0x611f TextBeforeBattle dw RockTunnel2AfterBattleText8 ; 0x6129 TextAfterBattle dw RockTunnel2EndBattleText8 ; 0x6124 TextEndBattle @@ -89,7 +89,7 @@ RockTunnel2TrainerHeader7: ; 4605c (11:605c) RockTunnel2TrainerHeader8: ; 46068 (11:6068) db $8 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d87d ; flag's byte + dw wd87d ; flag's byte dw RockTunnel2BattleText9 ; 0x612e TextBeforeBattle dw RockTunnel2AfterBattleText9 ; 0x6138 TextAfterBattle dw RockTunnel2EndBattleText9 ; 0x6133 TextEndBattle diff --git a/scripts/route1.asm b/scripts/route1.asm index 1faf5a48..189b987b 100755 --- a/scripts/route1.asm +++ b/scripts/route1.asm @@ -8,7 +8,7 @@ Route1TextPointers: ; 1cab2 (7:4ab2) Route1Text1: ; 1cab8 (7:4ab8) db $08 ; asm - ld hl, $d7bf + ld hl, wd7bf bit 0, [hl] set 0, [hl] jr nz, .asm_02840 ; 0x1cac0 diff --git a/scripts/route10.asm b/scripts/route10.asm index 1e0ecb91..e5e0dec2 100755 --- a/scripts/route10.asm +++ b/scripts/route10.asm @@ -28,7 +28,7 @@ Route10TrainerHeaders: ; 59363 (16:5363) Route10TrainerHeader0: ; 59363 (16:5363) db $1 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d1 ; flag's byte + dw wd7d1 ; flag's byte dw Route10BattleText1 ; 0x53b6 TextBeforeBattle dw Route10AfterBattleText1 ; 0x53c0 TextAfterBattle dw Route10EndBattleText1 ; 0x53bb TextEndBattle @@ -37,7 +37,7 @@ Route10TrainerHeader0: ; 59363 (16:5363) Route10TrainerHeader1: ; 5936f (16:536f) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7d1 ; flag's byte + dw wd7d1 ; flag's byte dw Route10BattleText2 ; 0x53cf TextBeforeBattle dw Route10AfterBattleText2 ; 0x53d9 TextAfterBattle dw Route10EndBattleText2 ; 0x53d4 TextEndBattle @@ -46,7 +46,7 @@ Route10TrainerHeader1: ; 5936f (16:536f) Route10TrainerHeader2: ; 5937b (16:537b) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d1 ; flag's byte + dw wd7d1 ; flag's byte dw Route10BattleText3 ; 0x53e8 TextBeforeBattle dw Route10AfterBattleText3 ; 0x53f2 TextAfterBattle dw Route10EndBattleText3 ; 0x53ed TextEndBattle @@ -55,7 +55,7 @@ Route10TrainerHeader2: ; 5937b (16:537b) Route10TrainerHeader3: ; 59387 (16:5387) db $4 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7d1 ; flag's byte + dw wd7d1 ; flag's byte dw Route10BattleText4 ; 0x5401 TextBeforeBattle dw Route10AfterBattleText4 ; 0x540b TextAfterBattle dw Route10EndBattleText4 ; 0x5406 TextEndBattle @@ -64,7 +64,7 @@ Route10TrainerHeader3: ; 59387 (16:5387) Route10TrainerHeader4: ; 59393 (16:5393) db $5 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7d1 ; flag's byte + dw wd7d1 ; flag's byte dw Route10BattleText5 ; 0x541a TextBeforeBattle dw Route10AfterBattleText5 ; 0x5424 TextAfterBattle dw Route10EndBattleText5 ; 0x541f TextEndBattle @@ -73,7 +73,7 @@ Route10TrainerHeader4: ; 59393 (16:5393) Route10TrainerHeader5: ; 5939f (16:539f) db $6 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7d1 ; flag's byte + dw wd7d1 ; flag's byte dw Route10BattleText6 ; 0x5433 TextBeforeBattle dw Route10AfterBattleText6 ; 0x543d TextAfterBattle dw Route10EndBattleText6 ; 0x5438 TextEndBattle diff --git a/scripts/route11.asm b/scripts/route11.asm index 6217569e..fb50937e 100755 --- a/scripts/route11.asm +++ b/scripts/route11.asm @@ -29,7 +29,7 @@ Route11TrainerHeaders: ; 5947b (16:547b) Route11TrainerHeader0: ; 5947b (16:547b) db $1 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7d5 ; flag's byte + dw wd7d5 ; flag's byte dw Route11BattleText1 ; 0x54fe TextBeforeBattle dw Route11AfterBattleText1 ; 0x5508 TextAfterBattle dw Route11EndBattleText1 ; 0x5503 TextEndBattle @@ -38,7 +38,7 @@ Route11TrainerHeader0: ; 5947b (16:547b) Route11TrainerHeader1: ; 59487 (16:5487) db $2 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7d5 ; flag's byte + dw wd7d5 ; flag's byte dw Route11BattleText2 ; 0x5517 TextBeforeBattle dw Route11AfterBattleText2 ; 0x5521 TextAfterBattle dw Route11EndBattleText2 ; 0x551c TextEndBattle @@ -47,7 +47,7 @@ Route11TrainerHeader1: ; 59487 (16:5487) Route11TrainerHeader2: ; 59493 (16:5493) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7d5 ; flag's byte + dw wd7d5 ; flag's byte dw Route11BattleText3 ; 0x5530 TextBeforeBattle dw Route11AfterBattleText3 ; 0x553a TextAfterBattle dw Route11EndBattleText3 ; 0x5535 TextEndBattle @@ -56,7 +56,7 @@ Route11TrainerHeader2: ; 59493 (16:5493) Route11TrainerHeader3: ; 5949f (16:549f) db $4 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7d5 ; flag's byte + dw wd7d5 ; flag's byte dw Route11BattleText4 ; 0x5549 TextBeforeBattle dw Route11AfterBattleText4 ; 0x5553 TextAfterBattle dw Route11EndBattleText4 ; 0x554e TextEndBattle @@ -65,7 +65,7 @@ Route11TrainerHeader3: ; 5949f (16:549f) Route11TrainerHeader4: ; 594ab (16:54ab) db $5 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d5 ; flag's byte + dw wd7d5 ; flag's byte dw Route11BattleText5 ; 0x5562 TextBeforeBattle dw Route11AfterBattleText5 ; 0x556c TextAfterBattle dw Route11EndBattleText5 ; 0x5567 TextEndBattle @@ -74,7 +74,7 @@ Route11TrainerHeader4: ; 594ab (16:54ab) Route11TrainerHeader5: ; 594b7 (16:54b7) db $6 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7d5 ; flag's byte + dw wd7d5 ; flag's byte dw Route11BattleText6 ; 0x557b TextBeforeBattle dw Route11AfterBattleText6 ; 0x5585 TextAfterBattle dw Route11EndBattleText6 ; 0x5580 TextEndBattle @@ -83,7 +83,7 @@ Route11TrainerHeader5: ; 594b7 (16:54b7) Route11TrainerHeader6: ; 594c3 (16:54c3) db $7 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7d5 ; flag's byte + dw wd7d5 ; flag's byte dw Route11BattleText7 ; 0x5594 TextBeforeBattle dw Route11AfterBattleText7 ; 0x559e TextAfterBattle dw Route11EndBattleText7 ; 0x5599 TextEndBattle @@ -92,7 +92,7 @@ Route11TrainerHeader6: ; 594c3 (16:54c3) Route11TrainerHeader7: ; 594cf (16:54cf) db $8 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d5 ; flag's byte + dw wd7d5 ; flag's byte dw Route11BattleText8 ; 0x55ad TextBeforeBattle dw Route11AfterBattleText8 ; 0x55b7 TextAfterBattle dw Route11EndBattleText8 ; 0x55b2 TextEndBattle @@ -101,7 +101,7 @@ Route11TrainerHeader7: ; 594cf (16:54cf) Route11TrainerHeader8: ; 594db (16:54db) db $9 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7d5 ; flag's byte + dw wd7d5 ; flag's byte dw Route11BattleText9 ; 0x55c6 TextBeforeBattle dw Route11AfterBattleText9 ; 0x55d0 TextAfterBattle dw Route11EndBattleText9 ; 0x55cb TextEndBattle @@ -110,7 +110,7 @@ Route11TrainerHeader8: ; 594db (16:54db) Route11TrainerHeader9: ; 594e7 (16:54e7) db $a ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d5 ; flag's byte + dw wd7d5 ; flag's byte dw Route11BattleText10 ; 0x55df TextBeforeBattle dw Route11AfterBattleText10 ; 0x55e9 TextAfterBattle dw Route11EndBattleText10 ; 0x55e4 TextEndBattle diff --git a/scripts/route11gateupstairs.asm b/scripts/route11gateupstairs.asm index e03331ca..5c0cc574 100755 --- a/scripts/route11gateupstairs.asm +++ b/scripts/route11gateupstairs.asm @@ -11,33 +11,31 @@ Route11GateUpstairsText1: ; 4945f (12:545f) db $08 ; asm xor a ld [wWhichTrade], a - ld a, $54 - call Predef + predef Predef54 asm_49469: ; 49469 (12:5469) jp TextScriptEnd Route11GateUpstairsText2: ; 4946c (12:546c) db $8 - ld a, [$d7d6] + ld a, [wd7d6] add a jr c, .asm_4949b ; 0x49471 $28 ld a, 30 ; pokemon needed ld [$ffdb], a ld a, ITEMFINDER ; oak's aide reward ld [$ffdc], a - ld [$d11e], a + ld [wd11e], a call GetItemName ld h, d ld l, e - ld de, $cc5b + ld de, wcc5b ld bc, $000d call CopyData - ld a, $62 - call Predef ; call oak's aide script + predef OaksAideScript ; call oak's aide script ld a, [$ffdb] dec a jr nz, .asm_494a1 ; 0x49494 $b - ld hl, $d7d6 + ld hl, wd7d6 set 7, [hl] .asm_4949b ld hl, Route11GateUpstairsText_494a3 @@ -51,10 +49,10 @@ Route11GateUpstairsText_494a3: ; 494a3 (12:54a3) Route11GateUpstairsText3: ; 494a8 (12:54a8) db $08 ; asm - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 jp nz, Route12GateUpstairsScript_495c9 - ld a, [$d7d8] + ld a, [wd7d8] bit 7, a ; fought snorlax? ld hl, BinocularsSnorlaxText jr z, .print diff --git a/scripts/route12.asm b/scripts/route12.asm index 5bbdac3f..b7ec451a 100755 --- a/scripts/route12.asm +++ b/scripts/route12.asm @@ -9,7 +9,7 @@ Route12Script: ; 595f3 (16:55f3) Route12Script_59606: ; 59606 (16:5606) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_ROUTE12CURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -21,7 +21,7 @@ Route12ScriptPointers: ; 59611 (16:5611) dw Route12Script3 Route12Script0: ; 59619 (16:5619) - ld hl, $d7d8 + ld hl, wd7d8 bit 7, [hl] jp nz, CheckFightingMapTrainers bit 6, [hl] @@ -31,31 +31,30 @@ Route12Script0: ; 59619 (16:5619) ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID ld a, SNORLAX - ld [W_CUROPPONENT], a ; $d059 + ld [W_CUROPPONENT], a ; wd059 ld a, 30 - ld [W_CURENEMYLVL], a ; $d127 + ld [W_CURENEMYLVL], a ; W_CURENEMYLVL ld a, $1d - ld [$cc4d], a - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a + predef HideObject ld a, $3 ld [W_ROUTE12CURSCRIPT], a ld [W_CURMAPSCRIPT], a ret Route12Script3: ; 5964c (16:564c) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jr z, Route12Script_59606 call UpdateSprites - ld a, [$cf0b] + ld a, [wcf0b] cp $2 jr z, .asm_59664 ld a, $e ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID .asm_59664 - ld hl, $d7d8 + ld hl, wd7d8 set 7, [hl] call Delay3 ld a, $0 @@ -83,7 +82,7 @@ Route12TrainerHeaders: ; 59691 (16:5691) Route12TrainerHeader0: ; 59691 (16:5691) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d7 ; flag's byte + dw wd7d7 ; flag's byte dw Route12BattleText1 ; 0x56ff TextBeforeBattle dw Route12AfterBattleText1 ; 0x5709 TextAfterBattle dw Route12EndBattleText1 ; 0x5704 TextEndBattle @@ -92,7 +91,7 @@ Route12TrainerHeader0: ; 59691 (16:5691) Route12TrainerHeader1: ; 5969d (16:569d) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d7 ; flag's byte + dw wd7d7 ; flag's byte dw Route12BattleText2 ; 0x5718 TextBeforeBattle dw Route12AfterBattleText2 ; 0x5722 TextAfterBattle dw Route12EndBattleText2 ; 0x571d TextEndBattle @@ -101,7 +100,7 @@ Route12TrainerHeader1: ; 5969d (16:569d) Route12TrainerHeader2: ; 596a9 (16:56a9) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d7 ; flag's byte + dw wd7d7 ; flag's byte dw Route12BattleText3 ; 0x5731 TextBeforeBattle dw Route12AfterBattleText3 ; 0x573b TextAfterBattle dw Route12EndBattleText3 ; 0x5736 TextEndBattle @@ -110,7 +109,7 @@ Route12TrainerHeader2: ; 596a9 (16:56a9) Route12TrainerHeader3: ; 596b5 (16:56b5) db $5 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d7 ; flag's byte + dw wd7d7 ; flag's byte dw Route12BattleText4 ; 0x574a TextBeforeBattle dw Route12AfterBattleText4 ; 0x5754 TextAfterBattle dw Route12EndBattleText4 ; 0x574f TextEndBattle @@ -119,7 +118,7 @@ Route12TrainerHeader3: ; 596b5 (16:56b5) Route12TrainerHeader4: ; 596c1 (16:56c1) db $6 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d7 ; flag's byte + dw wd7d7 ; flag's byte dw Route12BattleText5 ; 0x5763 TextBeforeBattle dw Route12AfterBattleText5 ; 0x576d TextAfterBattle dw Route12EndBattleText5 ; 0x5768 TextEndBattle @@ -128,7 +127,7 @@ Route12TrainerHeader4: ; 596c1 (16:56c1) Route12TrainerHeader5: ; 596cd (16:56cd) db $7 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d7 ; flag's byte + dw wd7d7 ; flag's byte dw Route12BattleText6 ; 0x577c TextBeforeBattle dw Route12AfterBattleText6 ; 0x5786 TextAfterBattle dw Route12EndBattleText6 ; 0x5781 TextEndBattle @@ -137,7 +136,7 @@ Route12TrainerHeader5: ; 596cd (16:56cd) Route12TrainerHeader6: ; 596d9 (16:56d9) db $8 ; flag's bit db ($1 << 4) ; trainer's view range - dw $d7d7 ; flag's byte + dw wd7d7 ; flag's byte dw Route12BattleText7 ; 0x5795 TextBeforeBattle dw Route12AfterBattleText7 ; 0x579f TextAfterBattle dw Route12EndBattleText7 ; 0x579a TextEndBattle diff --git a/scripts/route12gateupstairs.asm b/scripts/route12gateupstairs.asm index 97da1b58..94a4f9a2 100755 --- a/scripts/route12gateupstairs.asm +++ b/scripts/route12gateupstairs.asm @@ -8,7 +8,7 @@ Route12GateUpstairsTextPointers: ; 49563 (12:5563) Route12GateUpstairsText1: ; 49569 (12:5569) db $08 ; asm - ld a, [$d7d7] + ld a, [wd7d7] rrca jr c, .asm_0ad3c ; 0x4956e ld hl, TM39PreReceiveText @@ -18,7 +18,7 @@ Route12GateUpstairsText1: ; 49569 (12:5569) jr nc, .BagFull ld hl, ReceivedTM39Text call PrintText - ld hl, $d7d7 + ld hl, wd7d7 set 0, [hl] jr .asm_4ba56 ; 0x49589 .BagFull @@ -66,7 +66,7 @@ Route12GateUpstairsText_495c4: ; 495c4 (12:55c4) db "@" Route12GateUpstairsScript_495c9: ; 495c9 (12:55c9) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $4 jr z, .asm_495d4 ; 0x495ce $4 ld a, $1 @@ -75,5 +75,5 @@ Route12GateUpstairsScript_495c9: ; 495c9 (12:55c9) call PrintText xor a .asm_495d8 - ld [$cc3c], a + ld [wcc3c], a jp TextScriptEnd diff --git a/scripts/route12house.asm b/scripts/route12house.asm index 6b2f5e52..44667b24 100755 --- a/scripts/route12house.asm +++ b/scripts/route12house.asm @@ -6,19 +6,19 @@ Route12HouseTextPointers: ; 56482 (15:6482) Route12HouseText1: ; 56484 (15:6484) db $08 ; asm - ld a, [$d728] + ld a, [wd728] bit 5, a jr nz, .asm_b4cad ld hl, Route12HouseText_564c0 call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_a2d76 ld bc, (SUPER_ROD << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, $d728 + ld hl, wd728 set 5, [hl] ld hl, Route12HouseText_564c5 jr .asm_df984 diff --git a/scripts/route13.asm b/scripts/route13.asm index 3c2fea04..b78b7cb2 100755 --- a/scripts/route13.asm +++ b/scripts/route13.asm @@ -31,7 +31,7 @@ Route13TrainerHeaders: ; 55851 (15:5851) Route13TrainerHeader0: ; 55851 (15:5851) db $1 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7d9 ; flag's byte + dw wd7d9 ; flag's byte dw Route13BattleText2 ; 0x58d4 TextBeforeBattle dw Route13AfterBattleText2 ; 0x58de TextAfterBattle dw Route13EndBattleText2 ; 0x58d9 TextEndBattle @@ -40,7 +40,7 @@ Route13TrainerHeader0: ; 55851 (15:5851) Route13TrainerHeader2: ; 5585d (15:585d) db $2 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7d9 ; flag's byte + dw wd7d9 ; flag's byte dw Route13BattleText3 ; 0x58ed TextBeforeBattle dw Route13AfterBattleText3 ; 0x58f7 TextAfterBattle dw Route13EndBattleText3 ; 0x58f2 TextEndBattle @@ -49,7 +49,7 @@ Route13TrainerHeader2: ; 5585d (15:585d) Route13TrainerHeader3: ; 55869 (15:5869) db $3 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7d9 ; flag's byte + dw wd7d9 ; flag's byte dw Route13BattleText4 ; 0x5906 TextBeforeBattle dw Route13AfterBattleText4 ; 0x5910 TextAfterBattle dw Route13EndBattleText4 ; 0x590b TextEndBattle @@ -58,7 +58,7 @@ Route13TrainerHeader3: ; 55869 (15:5869) Route13TrainerHeader4: ; 55875 (15:5875) db $4 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7d9 ; flag's byte + dw wd7d9 ; flag's byte dw Route13BattleText5 ; 0x591f TextBeforeBattle dw Route13AfterBattleText5 ; 0x5929 TextAfterBattle dw Route13EndBattleText5 ; 0x5924 TextEndBattle @@ -67,7 +67,7 @@ Route13TrainerHeader4: ; 55875 (15:5875) Route13TrainerHeader5: ; 55881 (15:5881) db $5 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d9 ; flag's byte + dw wd7d9 ; flag's byte dw Route13BattleText6 ; 0x5938 TextBeforeBattle dw Route13AfterBattleText6 ; 0x5942 TextAfterBattle dw Route13EndBattleText6 ; 0x593d TextEndBattle @@ -76,7 +76,7 @@ Route13TrainerHeader5: ; 55881 (15:5881) Route13TrainerHeader6: ; 5588d (15:588d) db $6 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7d9 ; flag's byte + dw wd7d9 ; flag's byte dw Route13BattleText7 ; 0x5951 TextBeforeBattle dw Route13AfterBattleText7 ; 0x595b TextAfterBattle dw Route13EndBattleText7 ; 0x5956 TextEndBattle @@ -85,7 +85,7 @@ Route13TrainerHeader6: ; 5588d (15:588d) Route13TrainerHeader7: ; 55899 (15:5899) db $7 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d9 ; flag's byte + dw wd7d9 ; flag's byte dw Route13BattleText8 ; 0x596a TextBeforeBattle dw Route13AfterBattleText8 ; 0x5974 TextAfterBattle dw Route13EndBattleText8 ; 0x596f TextEndBattle @@ -94,7 +94,7 @@ Route13TrainerHeader7: ; 55899 (15:5899) Route13TrainerHeader8: ; 558a5 (15:58a5) db $8 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7d9 ; flag's byte + dw wd7d9 ; flag's byte dw Route13BattleText9 ; 0x5983 TextBeforeBattle dw Route13AfterBattleText9 ; 0x598d TextAfterBattle dw Route13EndBattleText9 ; 0x5988 TextEndBattle @@ -103,7 +103,7 @@ Route13TrainerHeader8: ; 558a5 (15:58a5) Route13TrainerHeader9: ; 558b1 (15:58b1) db $9 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7d9 ; flag's byte + dw wd7d9 ; flag's byte dw Route13BattleText10 ; 0x599c TextBeforeBattle dw Route13AfterBattleText10 ; 0x59a6 TextAfterBattle dw Route13EndBattleText10 ; 0x59a1 TextEndBattle @@ -112,7 +112,7 @@ Route13TrainerHeader9: ; 558b1 (15:58b1) Route13TrainerHeader10: ; 558bd (15:58bd) db $a ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7d9 ; flag's byte + dw wd7d9 ; flag's byte dw Route13BattleText11 ; 0x59b5 TextBeforeBattle dw Route13AfterBattleText11 ; 0x59bf TextAfterBattle dw Route13EndBattleText11 ; 0x59ba TextEndBattle diff --git a/scripts/route14.asm b/scripts/route14.asm index 0f9b49cf..9d8d8fcb 100755 --- a/scripts/route14.asm +++ b/scripts/route14.asm @@ -29,7 +29,7 @@ Route14TrainerHeaders: ; 55a02 (15:5a02) Route14TrainerHeader0: ; 55a02 (15:5a02) db $1 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7db ; flag's byte + dw wd7db ; flag's byte dw Route14BattleText1 ; 0x5a85 TextBeforeBattle dw Route14AfterBattleText1 ; 0x5a8f TextAfterBattle dw Route14EndBattleText1 ; 0x5a8a TextEndBattle @@ -38,7 +38,7 @@ Route14TrainerHeader0: ; 55a02 (15:5a02) Route14TrainerHeader1: ; 55a0e (15:5a0e) db $2 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7db ; flag's byte + dw wd7db ; flag's byte dw Route14BattleText2 ; 0x5a9e TextBeforeBattle dw Route14AfterBattleText2 ; 0x5aa8 TextAfterBattle dw Route14EndBattleText2 ; 0x5aa3 TextEndBattle @@ -47,7 +47,7 @@ Route14TrainerHeader1: ; 55a0e (15:5a0e) Route14TrainerHeader2: ; 55a1a (15:5a1a) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7db ; flag's byte + dw wd7db ; flag's byte dw Route14BattleText3 ; 0x5ab7 TextBeforeBattle dw Route14AfterBattleText3 ; 0x5ac1 TextAfterBattle dw Route14EndBattleText3 ; 0x5abc TextEndBattle @@ -56,7 +56,7 @@ Route14TrainerHeader2: ; 55a1a (15:5a1a) Route14TrainerHeader3: ; 55a26 (15:5a26) db $4 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7db ; flag's byte + dw wd7db ; flag's byte dw Route14BattleText4 ; 0x5ad0 TextBeforeBattle dw Route14AfterBattleText4 ; 0x5ada TextAfterBattle dw Route14EndBattleText4 ; 0x5ad5 TextEndBattle @@ -65,7 +65,7 @@ Route14TrainerHeader3: ; 55a26 (15:5a26) Route14TrainerHeader4: ; 55a32 (15:5a32) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7db ; flag's byte + dw wd7db ; flag's byte dw Route14BattleText5 ; 0x5ae9 TextBeforeBattle dw Route14AfterBattleText5 ; 0x5af3 TextAfterBattle dw Route14EndBattleText5 ; 0x5aee TextEndBattle @@ -74,7 +74,7 @@ Route14TrainerHeader4: ; 55a32 (15:5a32) Route14TrainerHeader5: ; 55a3e (15:5a3e) db $6 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7db ; flag's byte + dw wd7db ; flag's byte dw Route14BattleText6 ; 0x5b02 TextBeforeBattle dw Route14AfterBattleText6 ; 0x5b0c TextAfterBattle dw Route14EndBattleText6 ; 0x5b07 TextEndBattle @@ -83,7 +83,7 @@ Route14TrainerHeader5: ; 55a3e (15:5a3e) Route14TrainerHeader6: ; 55a4a (15:5a4a) db $7 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7db ; flag's byte + dw wd7db ; flag's byte dw Route14BattleText7 ; 0x5b1b TextBeforeBattle dw Route14AfterBattleText7 ; 0x5b25 TextAfterBattle dw Route14EndBattleText7 ; 0x5b20 TextEndBattle @@ -92,7 +92,7 @@ Route14TrainerHeader6: ; 55a4a (15:5a4a) Route14TrainerHeader7: ; 55a56 (15:5a56) db $8 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7db ; flag's byte + dw wd7db ; flag's byte dw Route14BattleText8 ; 0x5b34 TextBeforeBattle dw Route14AfterBattleText8 ; 0x5b3e TextAfterBattle dw Route14EndBattleText8 ; 0x5b39 TextEndBattle @@ -101,7 +101,7 @@ Route14TrainerHeader7: ; 55a56 (15:5a56) Route14TrainerHeader8: ; 55a62 (15:5a62) db $9 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7db ; flag's byte + dw wd7db ; flag's byte dw Route14BattleText9 ; 0x5b4d TextBeforeBattle dw Route14AfterBattleText9 ; 0x5b57 TextAfterBattle dw Route14EndBattleText9 ; 0x5b52 TextEndBattle @@ -110,7 +110,7 @@ Route14TrainerHeader8: ; 55a62 (15:5a62) Route14TrainerHeader9: ; 55a6e (15:5a6e) db $a ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7db ; flag's byte + dw wd7db ; flag's byte dw Route14BattleText10 ; 0x5b66 TextBeforeBattle dw Route14AfterBattleText10 ; 0x5b70 TextAfterBattle dw Route14EndBattleText10 ; 0x5b6b TextEndBattle diff --git a/scripts/route15.asm b/scripts/route15.asm index f7eaa758..789ace21 100755 --- a/scripts/route15.asm +++ b/scripts/route15.asm @@ -30,7 +30,7 @@ Route15TrainerHeaders: ; 597df (16:57df) Route15TrainerHeader0: ; 597df (16:57df) db $1 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7dd ; flag's byte + dw wd7dd ; flag's byte dw Route15BattleText1 ; 0x5898 TextBeforeBattle dw Route15AfterBattleText1 ; 0x58a2 TextAfterBattle dw Route15EndBattleText1 ; 0x589d TextEndBattle @@ -39,7 +39,7 @@ Route15TrainerHeader0: ; 597df (16:57df) Route15TrainerHeader1: ; 597eb (16:57eb) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7dd ; flag's byte + dw wd7dd ; flag's byte dw Route15BattleText2 ; 0x58a7 TextBeforeBattle dw Route15AfterBattleText2 ; 0x58b1 TextAfterBattle dw Route15EndBattleText2 ; 0x58ac TextEndBattle @@ -48,7 +48,7 @@ Route15TrainerHeader1: ; 597eb (16:57eb) Route15TrainerHeader2: ; 597f7 (16:57f7) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7dd ; flag's byte + dw wd7dd ; flag's byte dw Route15BattleText3 ; 0x58b6 TextBeforeBattle dw Route15AfterBattleText3 ; 0x58c0 TextAfterBattle dw Route15EndBattleText3 ; 0x58bb TextEndBattle @@ -57,7 +57,7 @@ Route15TrainerHeader2: ; 597f7 (16:57f7) Route15TrainerHeader3: ; 59803 (16:5803) db $4 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7dd ; flag's byte + dw wd7dd ; flag's byte dw Route15BattleText4 ; 0x58c5 TextBeforeBattle dw Route15AfterBattleText4 ; 0x58cf TextAfterBattle dw Route15EndBattleText4 ; 0x58ca TextEndBattle @@ -66,7 +66,7 @@ Route15TrainerHeader3: ; 59803 (16:5803) Route15TrainerHeader4: ; 5980f (16:580f) db $5 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7dd ; flag's byte + dw wd7dd ; flag's byte dw Route15BattleText5 ; 0x58d4 TextBeforeBattle dw Route15AfterBattleText5 ; 0x58de TextAfterBattle dw Route15EndBattleText5 ; 0x58d9 TextEndBattle @@ -75,7 +75,7 @@ Route15TrainerHeader4: ; 5980f (16:580f) Route15TrainerHeader5: ; 5981b (16:581b) db $6 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7dd ; flag's byte + dw wd7dd ; flag's byte dw Route15BattleText6 ; 0x58e3 TextBeforeBattle dw Route15AfterBattleText6 ; 0x58ed TextAfterBattle dw Route15EndBattleText6 ; 0x58e8 TextEndBattle @@ -84,7 +84,7 @@ Route15TrainerHeader5: ; 5981b (16:581b) Route15TrainerHeader6: ; 59827 (16:5827) db $7 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7dd ; flag's byte + dw wd7dd ; flag's byte dw Route15BattleText7 ; 0x58f2 TextBeforeBattle dw Route15AfterBattleText7 ; 0x58fc TextAfterBattle dw Route15EndBattleText7 ; 0x58f7 TextEndBattle @@ -93,7 +93,7 @@ Route15TrainerHeader6: ; 59827 (16:5827) Route15TrainerHeader7: ; 59833 (16:5833) db $8 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7dd ; flag's byte + dw wd7dd ; flag's byte dw Route15BattleText8 ; 0x5901 TextBeforeBattle dw Route15AfterBattleText8 ; 0x590b TextAfterBattle dw Route15EndBattleText8 ; 0x5906 TextEndBattle @@ -102,7 +102,7 @@ Route15TrainerHeader7: ; 59833 (16:5833) Route15TrainerHeader8: ; 5983f (16:583f) db $9 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7dd ; flag's byte + dw wd7dd ; flag's byte dw Route15BattleText9 ; 0x5910 TextBeforeBattle dw Route15AfterBattleText9 ; 0x591a TextAfterBattle dw Route15EndBattleText9 ; 0x5915 TextEndBattle @@ -111,7 +111,7 @@ Route15TrainerHeader8: ; 5983f (16:583f) Route15TrainerHeader9: ; 5984b (16:584b) db $a ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7dd ; flag's byte + dw wd7dd ; flag's byte dw Route15BattleText10 ; 0x591f TextBeforeBattle dw Route15AfterBattleText10 ; 0x5929 TextAfterBattle dw Route15EndBattleText10 ; 0x5924 TextEndBattle diff --git a/scripts/route15gateupstairs.asm b/scripts/route15gateupstairs.asm index fde968bb..2d328122 100755 --- a/scripts/route15gateupstairs.asm +++ b/scripts/route15gateupstairs.asm @@ -7,25 +7,24 @@ Route15GateUpstairsTextPointers: ; 4964d (12:564d) Route15GateUpstairsText1: ; 49651 (12:5651) db $8 - ld a, [$d7dd] + ld a, [wd7dd] bit 0, a jr nz, .asm_49683 ; 0x49657 $2a ld a, 50 ; pokemon needed ld [$ffdb], a ld a, EXP__ALL ; oak's aide reward ld [$ffdc], a - ld [$d11e], a + ld [wd11e], a call GetItemName - ld hl, $cd6d - ld de, $cc5b + ld hl, wcd6d + ld de, wcc5b ld bc, $000d call CopyData - ld a, $62 - call Predef ; call oak's aide script + predef OaksAideScript ; call oak's aide script ld a, [$ffdb] cp $1 jr nz, .asm_49689 ; 0x4967c $b - ld hl, $d7dd + ld hl, wd7dd set 0, [hl] .asm_49683 ld hl, Route15GateUpstairsText_4968c diff --git a/scripts/route16.asm b/scripts/route16.asm index 08739131..01bd35ad 100755 --- a/scripts/route16.asm +++ b/scripts/route16.asm @@ -7,9 +7,9 @@ Route16Script: ; 59933 (16:5933) ld [W_ROUTE16CURSCRIPT], a ret -Func_59946: ; 59946 (16:5946) +Route16Script_59946: ; 59946 (16:5946) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_ROUTE16CURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -21,7 +21,7 @@ Route16ScriptPointers: ; 59951 (16:5951) dw Route16Script3 Route16Script0: ; 59959 (16:5959) - ld hl, $d7e0 + ld hl, wd7e0 bit 1, [hl] jp nz, CheckFightingMapTrainers bit 0, [hl] @@ -31,13 +31,12 @@ Route16Script0: ; 59959 (16:5959) ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID ld a, SNORLAX - ld [W_CUROPPONENT], a ; $d059 + ld [W_CUROPPONENT], a ; wd059 ld a, 30 - ld [W_CURENEMYLVL], a ; $d127 + ld [W_CURENEMYLVL], a ; W_CURENEMYLVL ld a, $21 - ld [$cc4d], a - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a + predef HideObject call UpdateSprites ld a, $3 ld [W_ROUTE16CURSCRIPT], a @@ -45,18 +44,18 @@ Route16Script0: ; 59959 (16:5959) ret Route16Script3: ; 5998f (16:598f) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff - jp z, Func_59946 + jp z, Route16Script_59946 call UpdateSprites - ld a, [$cf0b] + ld a, [wcf0b] cp $2 jr z, .asm_599a8 ld a, $b ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID .asm_599a8 - ld hl, $d7e0 + ld hl, wd7e0 set 1, [hl] call Delay3 ld a, $0 @@ -81,7 +80,7 @@ Route16TrainerHeaders: ; 599cf (16:59cf) Route16TrainerHeader0: ; 599cf (16:59cf) db $1 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7df ; flag's byte + dw wd7df ; flag's byte dw Route16BattleText1 ; 0x5a22 TextBeforeBattle dw Route16AfterBattleText1 ; 0x5a2c TextAfterBattle dw Route16EndBattleText1 ; 0x5a27 TextEndBattle @@ -90,7 +89,7 @@ Route16TrainerHeader0: ; 599cf (16:59cf) Route16TrainerHeader1: ; 599db (16:59db) db $2 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7df ; flag's byte + dw wd7df ; flag's byte dw Route16BattleText2 ; 0x5a3b TextBeforeBattle dw Route16AfterBattleText2 ; 0x5a45 TextAfterBattle dw Route16EndBattleText2 ; 0x5a40 TextEndBattle @@ -99,7 +98,7 @@ Route16TrainerHeader1: ; 599db (16:59db) Route16TrainerHeader2: ; 599e7 (16:59e7) db $3 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7df ; flag's byte + dw wd7df ; flag's byte dw Route16BattleText3 ; 0x5a54 TextBeforeBattle dw Route16AfterBattleText3 ; 0x5a5e TextAfterBattle dw Route16EndBattleText3 ; 0x5a59 TextEndBattle @@ -108,7 +107,7 @@ Route16TrainerHeader2: ; 599e7 (16:59e7) Route16TrainerHeader3: ; 599f3 (16:59f3) db $4 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7df ; flag's byte + dw wd7df ; flag's byte dw Route16BattleText4 ; 0x5a6d TextBeforeBattle dw Route16AfterBattleText4 ; 0x5a77 TextAfterBattle dw Route16EndBattleText4 ; 0x5a72 TextEndBattle @@ -117,7 +116,7 @@ Route16TrainerHeader3: ; 599f3 (16:59f3) Route16TrainerHeader4: ; 599ff (16:59ff) db $5 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7df ; flag's byte + dw wd7df ; flag's byte dw Route16BattleText5 ; 0x5a86 TextBeforeBattle dw Route16AfterBattleText5 ; 0x5a90 TextAfterBattle dw Route16EndBattleText5 ; 0x5a8b TextEndBattle @@ -126,7 +125,7 @@ Route16TrainerHeader4: ; 599ff (16:59ff) Route16TrainerHeader5: ; 59a0b (16:5a0b) db $6 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7df ; flag's byte + dw wd7df ; flag's byte dw Route16BattleText6 ; 0x5a9f TextBeforeBattle dw Route16AfterBattleText6 ; 0x5aa9 TextAfterBattle dw Route16EndBattleText6 ; 0x5aa4 TextEndBattle diff --git a/scripts/route16gate.asm b/scripts/route16gate.asm index 5131a1ff..e7179ea7 100755 --- a/scripts/route16gate.asm +++ b/scripts/route16gate.asm @@ -1,5 +1,5 @@ Route16GateScript: ; 496be (12:56be) - ld hl, $d732 + ld hl, wd732 res 5, [hl] call EnableAutoTextBoxDrawing ld a, [W_ROUTE16GATECURSCRIPT] @@ -13,7 +13,7 @@ Route16GateScriptPointers: ; 496cf (12:56cf) dw Route16GateScript3 Route16GateScript0: ; 496d7 (12:56d7) - call Func_49755 + call Route16GateScript_49755 ret nz ld hl, CoordsData_49714 call ArePlayerCoordsInArray @@ -22,17 +22,17 @@ Route16GateScript0: ; 496d7 (12:56d7) ld [$ff8c], a call DisplayTextID xor a - ld [H_CURRENTPRESSEDBUTTONS], a - ld a, [$cd3d] + ld [hJoyHeld], a + ld a, [wWhichTrade] cp $1 jr z, .asm_4970e ; 0x496f1 $1b - ld a, [$cd3d] + ld a, [wWhichTrade] dec a - ld [$cd38], a + ld [wcd38], a ld b, $0 ld c, a ld a, $40 - ld hl, $ccd3 + ld hl, wccd3 call FillMemory call Func_3486 ld a, $1 @@ -51,38 +51,38 @@ CoordsData_49714: ; 49714 (12:5714) db $FF Route16GateScript1: ; 4971d (12:571d) - ld a, [$cd38] + ld a, [wcd38] and a ret nz ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a Route16GateScript2: ; 49727 (12:5727) ld a, $1 ld [H_SPRITEHEIGHT], a call DisplayTextID ld a, $1 - ld [$cd38], a + ld [wcd38], a ld a, $10 - ld [$ccd3], a + ld [wccd3], a call Func_3486 ld a, $3 ld [W_ROUTE16GATECURSCRIPT], a ret Route16GateScript3: ; 49741 (12:5741) - ld a, [$cd38] + ld a, [wcd38] and a ret nz xor a - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d730 + ld [wJoyIgnore], a + ld hl, wd730 res 7, [hl] ld a, $0 ld [W_ROUTE16GATECURSCRIPT], a ret -Func_49755: ; 49755 (12:5755) +Route16GateScript_49755: ; 49755 (12:5755) ld b, BICYCLE jp IsItemInBag @@ -93,7 +93,7 @@ Route16GateTextPointers: ; 4975a (12:575a) Route16GateText1: ; 49760 (12:5760) db $08 ; asm - call Func_49755 + call Route16GateScript_49755 jr z, .asm_0bdf3 ; 0x49764 ld hl, Route16GateText_4977c call PrintText diff --git a/scripts/route16house.asm b/scripts/route16house.asm index 21c21b79..9a189757 100755 --- a/scripts/route16house.asm +++ b/scripts/route16house.asm @@ -7,7 +7,7 @@ Route16HouseTextPointers: ; 1e5fb (7:65fb) Route16HouseText1: ; 1e5ff (7:65ff) db $08 ; asm - ld a, [$d7e0] + ld a, [wd7e0] bit 6, a ld hl, HM02ExplanationText jr nz, .asm_13616 ; 0x1e608 @@ -16,7 +16,7 @@ Route16HouseText1: ; 1e5ff (7:65ff) ld bc, (HM_02 << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, $d7e0 + ld hl, wd7e0 set 6, [hl] ld hl, ReceivedHM02Text jr .asm_13616 ; 0x1e620 diff --git a/scripts/route17.asm b/scripts/route17.asm index 976d4236..78ceb2ae 100755 --- a/scripts/route17.asm +++ b/scripts/route17.asm @@ -34,7 +34,7 @@ Route17TrainerHeaders: ; 55bb3 (15:5bb3) Route17TrainerHeader0: ; 55bb3 (15:5bb3) db $1 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7e1 ; flag's byte + dw wd7e1 ; flag's byte dw Route17BattleText1 ; 0x5c36 TextBeforeBattle dw Route17AfterBattleText1 ; 0x5c40 TextAfterBattle dw Route17EndBattleText1 ; 0x5c3b TextEndBattle @@ -43,7 +43,7 @@ Route17TrainerHeader0: ; 55bb3 (15:5bb3) Route17TrainerHeader1: ; 55bbf (15:5bbf) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e1 ; flag's byte + dw wd7e1 ; flag's byte dw Route17BattleText2 ; 0x5c4f TextBeforeBattle dw Route17AfterBattleText2 ; 0x5c59 TextAfterBattle dw Route17EndBattleText2 ; 0x5c54 TextEndBattle @@ -52,7 +52,7 @@ Route17TrainerHeader1: ; 55bbf (15:5bbf) Route17TrainerHeader2: ; 55bcb (15:5bcb) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e1 ; flag's byte + dw wd7e1 ; flag's byte dw Route17BattleText3 ; 0x5c68 TextBeforeBattle dw Route17AfterBattleText3 ; 0x5c72 TextAfterBattle dw Route17EndBattleText3 ; 0x5c6d TextEndBattle @@ -61,7 +61,7 @@ Route17TrainerHeader2: ; 55bcb (15:5bcb) Route17TrainerHeader3: ; 55bd7 (15:5bd7) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e1 ; flag's byte + dw wd7e1 ; flag's byte dw Route17BattleText4 ; 0x5c81 TextBeforeBattle dw Route17AfterBattleText4 ; 0x5c8b TextAfterBattle dw Route17EndBattleText4 ; 0x5c86 TextEndBattle @@ -70,7 +70,7 @@ Route17TrainerHeader3: ; 55bd7 (15:5bd7) Route17TrainerHeader4: ; 55be3 (15:5be3) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7e1 ; flag's byte + dw wd7e1 ; flag's byte dw Route17BattleText5 ; 0x5c9a TextBeforeBattle dw Route17AfterBattleText5 ; 0x5ca4 TextAfterBattle dw Route17EndBattleText5 ; 0x5c9f TextEndBattle @@ -79,7 +79,7 @@ Route17TrainerHeader4: ; 55be3 (15:5be3) Route17TrainerHeader5: ; 55bef (15:5bef) db $6 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7e1 ; flag's byte + dw wd7e1 ; flag's byte dw Route17BattleText6 ; 0x5cb3 TextBeforeBattle dw Route17AfterBattleText6 ; 0x5cbd TextAfterBattle dw Route17EndBattleText6 ; 0x5cb8 TextEndBattle @@ -88,7 +88,7 @@ Route17TrainerHeader5: ; 55bef (15:5bef) Route17TrainerHeader6: ; 55bfb (15:5bfb) db $7 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e1 ; flag's byte + dw wd7e1 ; flag's byte dw Route17BattleText7 ; 0x5ccc TextBeforeBattle dw Route17AfterBattleText7 ; 0x5cd6 TextAfterBattle dw Route17EndBattleText7 ; 0x5cd1 TextEndBattle @@ -97,7 +97,7 @@ Route17TrainerHeader6: ; 55bfb (15:5bfb) Route17TrainerHeader7: ; 55c07 (15:5c07) db $8 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7e1 ; flag's byte + dw wd7e1 ; flag's byte dw Route17BattleText8 ; 0x5ce5 TextBeforeBattle dw Route17AfterBattleText8 ; 0x5cef TextAfterBattle dw Route17EndBattleText8 ; 0x5cea TextEndBattle @@ -106,7 +106,7 @@ Route17TrainerHeader7: ; 55c07 (15:5c07) Route17TrainerHeader8: ; 55c13 (15:5c13) db $9 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7e1 ; flag's byte + dw wd7e1 ; flag's byte dw Route17BattleText9 ; 0x5cfe TextBeforeBattle dw Route17AfterBattleText9 ; 0x5d08 TextAfterBattle dw Route17EndBattleText9 ; 0x5d03 TextEndBattle @@ -115,7 +115,7 @@ Route17TrainerHeader8: ; 55c13 (15:5c13) Route17TrainerHeader9: ; 55c1f (15:5c1f) db $a ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e1 ; flag's byte + dw wd7e1 ; flag's byte dw Route17BattleText10 ; 0x5d17 TextBeforeBattle dw Route17AfterBattleText10 ; 0x5d21 TextAfterBattle dw Route17EndBattleText10 ; 0x5d1c TextEndBattle diff --git a/scripts/route18.asm b/scripts/route18.asm index b15f5e42..a0e4487a 100755 --- a/scripts/route18.asm +++ b/scripts/route18.asm @@ -23,7 +23,7 @@ Route18TrainerHeaders: ; 59aea (16:5aea) Route18TrainerHeader0: ; 59aea (16:5aea) db $1 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7e3 ; flag's byte + dw wd7e3 ; flag's byte dw Route18BattleText1 ; 0x5b19 TextBeforeBattle dw Route18AfterBattleText1 ; 0x5b23 TextAfterBattle dw Route18EndBattleText1 ; 0x5b1e TextEndBattle @@ -32,7 +32,7 @@ Route18TrainerHeader0: ; 59aea (16:5aea) Route18TrainerHeader1: ; 59af6 (16:5af6) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7e3 ; flag's byte + dw wd7e3 ; flag's byte dw Route18BattleText2 ; 0x5b32 TextBeforeBattle dw Route18AfterBattleText2 ; 0x5b3c TextAfterBattle dw Route18EndBattleText2 ; 0x5b37 TextEndBattle @@ -41,7 +41,7 @@ Route18TrainerHeader1: ; 59af6 (16:5af6) Route18TrainerHeader2: ; 59b02 (16:5b02) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e3 ; flag's byte + dw wd7e3 ; flag's byte dw Route18BattleText3 ; 0x5b4b TextBeforeBattle dw Route18AfterBattleText3 ; 0x5b55 TextAfterBattle dw Route18EndBattleText3 ; 0x5b50 TextEndBattle diff --git a/scripts/route18gate.asm b/scripts/route18gate.asm index d55ed412..03c4b921 100755 --- a/scripts/route18gate.asm +++ b/scripts/route18gate.asm @@ -1,5 +1,5 @@ Route18GateScript: ; 49876 (12:5876) - ld hl, $d732 + ld hl, wd732 res 5, [hl] call EnableAutoTextBoxDrawing ld a, [W_ROUTE18GATECURSCRIPT] @@ -13,7 +13,7 @@ Route18GateScriptPointers: ; 49887 (12:5887) dw Route18GateScript3 Route18GateScript0: ; 4988f (12:588f) - call Func_49755 + call Route16GateScript_49755 ret nz ld hl, CoordsData_498cc call ArePlayerCoordsInArray @@ -22,17 +22,17 @@ Route18GateScript0: ; 4988f (12:588f) ld [$ff8c], a call DisplayTextID xor a - ld [H_CURRENTPRESSEDBUTTONS], a - ld a, [$cd3d] + ld [hJoyHeld], a + ld a, [wWhichTrade] cp $1 jr z, .asm_498c6 ; 0x498a9 $1b - ld a, [$cd3d] + ld a, [wWhichTrade] dec a - ld [$cd38], a + ld [wcd38], a ld b, $0 ld c, a ld a, $40 - ld hl, $ccd3 + ld hl, wccd3 call FillMemory call Func_3486 ld a, $1 @@ -51,32 +51,32 @@ CoordsData_498cc: ; 498cc (12:58cc) db $FF Route18GateScript1: ; 498d5 (12:58d5) - ld a, [$cd38] + ld a, [wcd38] and a ret nz ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a Route18GateScript2: ; 498df (12:58df) ld a, $1 ld [H_SPRITEHEIGHT], a call DisplayTextID ld a, $1 - ld [$cd38], a + ld [wcd38], a ld a, $10 - ld [$ccd3], a + ld [wccd3], a call Func_3486 ld a, $3 ld [W_ROUTE18GATECURSCRIPT], a ret Route18GateScript3: ; 498f9 (12:58f9) - ld a, [$cd38] + ld a, [wcd38] and a ret nz xor a - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d730 + ld [wJoyIgnore], a + ld hl, wd730 res 7, [hl] ld a, $0 ld [W_ROUTE18GATECURSCRIPT], a @@ -88,7 +88,7 @@ Route18GateTextPointers: ; 4990d (12:590d) Route18GateText1: ; 49911 (12:5911) db $08 ; asm - call Func_49755 + call Route16GateScript_49755 jr z, .asm_3c84d ; 0x49915 ld hl, Route18GateText_4992d call PrintText diff --git a/scripts/route18gateupstairs.asm b/scripts/route18gateupstairs.asm index d9164d1d..9db16aeb 100755 --- a/scripts/route18gateupstairs.asm +++ b/scripts/route18gateupstairs.asm @@ -10,8 +10,7 @@ Route18GateUpstairsText1: ; 4997e (12:597e) db $08 ; asm ld a, $5 ld [wWhichTrade], a - ld a, $54 - call Predef + predef Predef54 jp TextScriptEnd Route18GateUpstairsText2: ; 4998c (12:598c) diff --git a/scripts/route19.asm b/scripts/route19.asm index 8bc641ff..6c749b03 100755 --- a/scripts/route19.asm +++ b/scripts/route19.asm @@ -29,7 +29,7 @@ Route19TrainerHeaders: ; 55d73 (15:5d73) Route19TrainerHeader0: ; 55d73 (15:5d73) db $1 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e5 ; flag's byte + dw wd7e5 ; flag's byte dw Route19BattleText1 ; 0x5e50 TextBeforeBattle dw Route19AfterBattleText1 ; 0x5e5a TextAfterBattle dw Route19EndBattleText1 ; 0x5e55 TextEndBattle @@ -38,7 +38,7 @@ Route19TrainerHeader0: ; 55d73 (15:5d73) Route19TrainerHeader1: ; 55d7f (15:5d7f) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7e5 ; flag's byte + dw wd7e5 ; flag's byte dw Route19BattleText2 ; 0x5e5f TextBeforeBattle dw Route19AfterBattleText2 ; 0x5e69 TextAfterBattle dw Route19EndBattleText2 ; 0x5e64 TextEndBattle @@ -47,7 +47,7 @@ Route19TrainerHeader1: ; 55d7f (15:5d7f) Route19TrainerHeader2: ; 55d8b (15:5d8b) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7e5 ; flag's byte + dw wd7e5 ; flag's byte dw Route19BattleText3 ; 0x5e6e TextBeforeBattle dw Route19AfterBattleText3 ; 0x5e78 TextAfterBattle dw Route19EndBattleText3 ; 0x5e73 TextEndBattle @@ -56,7 +56,7 @@ Route19TrainerHeader2: ; 55d8b (15:5d8b) Route19TrainerHeader3: ; 55d97 (15:5d97) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e5 ; flag's byte + dw wd7e5 ; flag's byte dw Route19BattleText4 ; 0x5e7d TextBeforeBattle dw Route19AfterBattleText4 ; 0x5e87 TextAfterBattle dw Route19EndBattleText4 ; 0x5e82 TextEndBattle @@ -65,7 +65,7 @@ Route19TrainerHeader3: ; 55d97 (15:5d97) Route19TrainerHeader4: ; 55da3 (15:5da3) db $5 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e5 ; flag's byte + dw wd7e5 ; flag's byte dw Route19BattleText5 ; 0x5e8c TextBeforeBattle dw Route19AfterBattleText5 ; 0x5e96 TextAfterBattle dw Route19EndBattleText5 ; 0x5e91 TextEndBattle @@ -74,7 +74,7 @@ Route19TrainerHeader4: ; 55da3 (15:5da3) Route19TrainerHeader5: ; 55daf (15:5daf) db $6 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e5 ; flag's byte + dw wd7e5 ; flag's byte dw Route19BattleText6 ; 0x5e9b TextBeforeBattle dw Route19AfterBattleText6 ; 0x5ea5 TextAfterBattle dw Route19EndBattleText6 ; 0x5ea0 TextEndBattle @@ -83,7 +83,7 @@ Route19TrainerHeader5: ; 55daf (15:5daf) Route19TrainerHeader6: ; 55dbb (15:5dbb) db $7 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7e5 ; flag's byte + dw wd7e5 ; flag's byte dw Route19BattleText7 ; 0x5eaa TextBeforeBattle dw Route19AfterBattleText7 ; 0x5eb4 TextAfterBattle dw Route19EndBattleText7 ; 0x5eaf TextEndBattle @@ -92,7 +92,7 @@ Route19TrainerHeader6: ; 55dbb (15:5dbb) Route19TrainerHeader7: ; 55dc7 (15:5dc7) db $8 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e5 ; flag's byte + dw wd7e5 ; flag's byte dw Route19BattleText8 ; 0x5eb9 TextBeforeBattle dw Route19AfterBattleText8 ; 0x5ec3 TextAfterBattle dw Route19EndBattleText8 ; 0x5ebe TextEndBattle @@ -101,7 +101,7 @@ Route19TrainerHeader7: ; 55dc7 (15:5dc7) Route19TrainerHeader8: ; 55dd3 (15:5dd3) db $9 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e5 ; flag's byte + dw wd7e5 ; flag's byte dw Route19BattleText9 ; 0x5ec8 TextBeforeBattle dw Route19AfterBattleText9 ; 0x5ed2 TextAfterBattle dw Route19EndBattleText9 ; 0x5ecd TextEndBattle @@ -110,7 +110,7 @@ Route19TrainerHeader8: ; 55dd3 (15:5dd3) Route19TrainerHeader9: ; 55ddf (15:5ddf) db $a ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e5 ; flag's byte + dw wd7e5 ; flag's byte dw Route19BattleText10 ; 0x5ed7 TextBeforeBattle dw Route19AfterBattleText10 ; 0x5ee1 TextAfterBattle dw Route19EndBattleText10 ; 0x5edc TextEndBattle diff --git a/scripts/route20.asm b/scripts/route20.asm index 2d5f3077..7e8df3da 100755 --- a/scripts/route20.asm +++ b/scripts/route20.asm @@ -1,5 +1,5 @@ Route20Script: ; 50ca9 (14:4ca9) - ld hl, $d7e7 + ld hl, wd7e7 bit 0, [hl] res 0, [hl] call nz, Route20Script_50cc6 @@ -12,7 +12,7 @@ Route20Script: ; 50ca9 (14:4ca9) ret Route20Script_50cc6: ; 50cc6 (14:4cc6) - ld a, [$d880] + ld a, [wd880] and $3 cp $3 jr z, .asm_50cef @@ -34,7 +34,7 @@ Route20Script_50cc6: ; 50cc6 (14:4cc6) db $D9,$DA,$DB,$DC,$DF,$E0,$FF .asm_50cef - ld a, [$d881] + ld a, [wd881] and $3 cp $3 ret z @@ -49,14 +49,12 @@ Route20Script_50cc6: ; 50cc6 (14:4cc6) ret Route20Script_50d0c: ; 50d0c (14:4d0c) - ld [$cc4d], a - ld a, $15 - jp Predef ; indirect jump to AddMissableObject (f1c8 (3:71c8)) + ld [wcc4d], a + predef_jump ShowObject Route20Script_50d14: ; 50d14 (14:4d14) - ld [$cc4d], a - ld a, $11 - jp Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a + predef_jump HideObject Route20ScriptPointers: ; 50d1c (14:4d1c) dw CheckFightingMapTrainers @@ -81,7 +79,7 @@ Route20TrainerHeaders: ; 50d3a (14:4d3a) Route20TrainerHeader0: ; 50d3a (14:4d3a) db $1 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e7 ; flag's byte + dw wd7e7 ; flag's byte dw Route20BattleText1 ; 0x4e17 TextBeforeBattle dw Route20AfterBattleText1 ; 0x4e21 TextAfterBattle dw Route20EndBattleText1 ; 0x4e1c TextEndBattle @@ -90,7 +88,7 @@ Route20TrainerHeader0: ; 50d3a (14:4d3a) Route20TrainerHeader2: ; 50d46 (14:4d46) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e7 ; flag's byte + dw wd7e7 ; flag's byte dw Route20BattleText2 ; 0x4e26 TextBeforeBattle dw Route20AfterBattleText2 ; 0x4e30 TextAfterBattle dw Route20EndBattleText2 ; 0x4e2b TextEndBattle @@ -99,7 +97,7 @@ Route20TrainerHeader2: ; 50d46 (14:4d46) Route20TrainerHeader3: ; 50d52 (14:4d52) db $3 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7e7 ; flag's byte + dw wd7e7 ; flag's byte dw Route20BattleText3 ; 0x4e35 TextBeforeBattle dw Route20AfterBattleText3 ; 0x4e3f TextAfterBattle dw Route20EndBattleText3 ; 0x4e3a TextEndBattle @@ -108,7 +106,7 @@ Route20TrainerHeader3: ; 50d52 (14:4d52) Route20TrainerHeader4: ; 50d5e (14:4d5e) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e7 ; flag's byte + dw wd7e7 ; flag's byte dw Route20BattleText4 ; 0x4e44 TextBeforeBattle dw Route20AfterBattleText4 ; 0x4e4e TextAfterBattle dw Route20EndBattleText4 ; 0x4e49 TextEndBattle @@ -117,7 +115,7 @@ Route20TrainerHeader4: ; 50d5e (14:4d5e) Route20TrainerHeader5: ; 50d6a (14:4d6a) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7e7 ; flag's byte + dw wd7e7 ; flag's byte dw Route20BattleText5 ; 0x4e53 TextBeforeBattle dw Route20AfterBattleText5 ; 0x4e5d TextAfterBattle dw Route20EndBattleText5 ; 0x4e58 TextEndBattle @@ -126,7 +124,7 @@ Route20TrainerHeader5: ; 50d6a (14:4d6a) Route20TrainerHeader6: ; 50d76 (14:4d76) db $6 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e7 ; flag's byte + dw wd7e7 ; flag's byte dw Route20BattleText6 ; 0x4e62 TextBeforeBattle dw Route20AfterBattleText6 ; 0x4e6c TextAfterBattle dw Route20EndBattleText6 ; 0x4e67 TextEndBattle @@ -135,7 +133,7 @@ Route20TrainerHeader6: ; 50d76 (14:4d76) Route20TrainerHeader7: ; 50d82 (14:4d82) db $7 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7e7 ; flag's byte + dw wd7e7 ; flag's byte dw Route20BattleText7 ; 0x4e71 TextBeforeBattle dw Route20AfterBattleText7 ; 0x4e7b TextAfterBattle dw Route20EndBattleText7 ; 0x4e76 TextEndBattle @@ -144,7 +142,7 @@ Route20TrainerHeader7: ; 50d82 (14:4d82) Route20TrainerHeader8: ; 50d8e (14:4d8e) db $8 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e7 ; flag's byte + dw wd7e7 ; flag's byte dw Route20BattleText8 ; 0x4e80 TextBeforeBattle dw Route20AfterBattleText8 ; 0x4e8a TextAfterBattle dw Route20EndBattleText8 ; 0x4e85 TextEndBattle @@ -153,7 +151,7 @@ Route20TrainerHeader8: ; 50d8e (14:4d8e) Route20TrainerHeader9: ; 50d9a (14:4d9a) db $9 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7e7 ; flag's byte + dw wd7e7 ; flag's byte dw Route20BattleText9 ; 0x4e8f TextBeforeBattle dw Route20AfterBattleText9 ; 0x4e99 TextAfterBattle dw Route20EndBattleText9 ; 0x4e94 TextEndBattle @@ -162,7 +160,7 @@ Route20TrainerHeader9: ; 50d9a (14:4d9a) Route20TrainerHeader10: ; 50da6 (14:4da6) db $a ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e7 ; flag's byte + dw wd7e7 ; flag's byte dw Route20BattleText10 ; 0x4e9e TextBeforeBattle dw Route20AfterBattleText10 ; 0x4ea8 TextAfterBattle dw Route20EndBattleText10 ; 0x4ea3 TextEndBattle diff --git a/scripts/route21.asm b/scripts/route21.asm index 2332d2c8..034282f8 100755 --- a/scripts/route21.asm +++ b/scripts/route21.asm @@ -27,7 +27,7 @@ Route21TrainerHeaders: ; 55f16 (15:5f16) Route21TrainerHeader0: ; 55f16 (15:5f16) db $1 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d7e9 ; flag's byte + dw wd7e9 ; flag's byte dw Route21BattleText1 ; 0x5fdd TextBeforeBattle dw Route21AfterBattleText1 ; 0x5fe7 TextAfterBattle dw Route21EndBattleText1 ; 0x5fe2 TextEndBattle @@ -36,7 +36,7 @@ Route21TrainerHeader0: ; 55f16 (15:5f16) Route21TrainerHeader1: ; 55f22 (15:5f22) db $2 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d7e9 ; flag's byte + dw wd7e9 ; flag's byte dw Route21BattleText2 ; 0x5fec TextBeforeBattle dw Route21AfterBattleText2 ; 0x5ff6 TextAfterBattle dw Route21EndBattleText2 ; 0x5ff1 TextEndBattle @@ -45,7 +45,7 @@ Route21TrainerHeader1: ; 55f22 (15:5f22) Route21TrainerHeader2: ; 55f2e (15:5f2e) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e9 ; flag's byte + dw wd7e9 ; flag's byte dw Route21BattleText3 ; 0x5ffb TextBeforeBattle dw Route21AfterBattleText3 ; 0x6005 TextAfterBattle dw Route21EndBattleText3 ; 0x6000 TextEndBattle @@ -54,7 +54,7 @@ Route21TrainerHeader2: ; 55f2e (15:5f2e) Route21TrainerHeader3: ; 55f3a (15:5f3a) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e9 ; flag's byte + dw wd7e9 ; flag's byte dw Route21BattleText4 ; 0x600a TextBeforeBattle dw Route21AfterBattleText4 ; 0x6014 TextAfterBattle dw Route21EndBattleText4 ; 0x600f TextEndBattle @@ -63,7 +63,7 @@ Route21TrainerHeader3: ; 55f3a (15:5f3a) Route21TrainerHeader4: ; 55f46 (15:5f46) db $5 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e9 ; flag's byte + dw wd7e9 ; flag's byte dw Route21BattleText5 ; 0x6019 TextBeforeBattle dw Route21AfterBattleText5 ; 0x6023 TextAfterBattle dw Route21EndBattleText5 ; 0x601e TextEndBattle @@ -72,7 +72,7 @@ Route21TrainerHeader4: ; 55f46 (15:5f46) Route21TrainerHeader5: ; 55f52 (15:5f52) db $6 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7e9 ; flag's byte + dw wd7e9 ; flag's byte dw Route21BattleText6 ; 0x6028 TextBeforeBattle dw Route21AfterBattleText6 ; 0x6032 TextAfterBattle dw Route21EndBattleText6 ; 0x602d TextEndBattle @@ -81,7 +81,7 @@ Route21TrainerHeader5: ; 55f52 (15:5f52) Route21TrainerHeader6: ; 55f5e (15:5f5e) db $7 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7e9 ; flag's byte + dw wd7e9 ; flag's byte dw Route21BattleText7 ; 0x6037 TextBeforeBattle dw Route21AfterBattleText7 ; 0x6041 TextAfterBattle dw Route21EndBattleText7 ; 0x603c TextEndBattle @@ -90,7 +90,7 @@ Route21TrainerHeader6: ; 55f5e (15:5f5e) Route21TrainerHeader7: ; 55f6a (15:5f6a) db $8 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d7e9 ; flag's byte + dw wd7e9 ; flag's byte dw Route21BattleText8 ; 0x6046 TextBeforeBattle dw Route21AfterBattleText8 ; 0x6050 TextAfterBattle dw Route21EndBattleText8 ; 0x604b TextEndBattle @@ -99,7 +99,7 @@ Route21TrainerHeader7: ; 55f6a (15:5f6a) Route21TrainerHeader8: ; 55f76 (15:5f76) db $9 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d7e9 ; flag's byte + dw wd7e9 ; flag's byte dw Route21BattleText9 ; 0x6055 TextBeforeBattle dw Route21AfterBattleText9 ; 0x605f TextAfterBattle dw Route21EndBattleText9 ; 0x605a TextEndBattle diff --git a/scripts/route22.asm b/scripts/route22.asm index 75d10595..aba6a479 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -16,13 +16,13 @@ Route22ScriptPointers: ; 50ebe (14:4ebe) Route22Script_50ece: ; 50ece (14:4ece) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_ROUTE22CURSCRIPT], a Route22Script7: ; 50ed5 (14:4ed5) ret Route22Script_50ed6: ; 50ed6 (14:4ed6) - ld a, [W_RIVALSTARTER] ; $d715 + ld a, [W_RIVALSTARTER] ; wd715 ld b, a .asm_50eda ld a, [hli] @@ -32,12 +32,12 @@ Route22Script_50ed6: ; 50ed6 (14:4ed6) jr .asm_50eda .asm_50ee1 ld a, [hl] - ld [W_TRAINERNO], a ; $d05d + ld [W_TRAINERNO], a ; wd05d ret Route22MoveRivalSprite: ; 50ee6 (14:4ee6) ld de, Route22RivalMovementData ; $4efb - ld a, [$cf0d] + ld a, [wcf0d] cp $1 jr z, .asm_50ef1 inc de @@ -51,44 +51,43 @@ Route22RivalMovementData: ; 50efb (14:4efb) db $C0,$C0,$C0,$C0,$FF ; move right 4 times Route22Script0: ; 50f00 (14:4f00) - ld a, [$d7eb] + ld a, [wd7eb] bit 7, a ret z ld hl, .Route22RivalBattleCoords ; $4f2d call ArePlayerCoordsInArray ret nc - ld a, [$cd3d] - ld [$cf0d], a + ld a, [wWhichTrade] + ld [wcf0d], a xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $2 - ld [$d528], a - ld a, [$d7eb] + ld [wd528], a + ld a, [wd7eb] bit 0, a ; is this the rival battle at the beginning of the game? jr nz, .firstRivalBattle ; 0x50f25 $b bit 1, a ; is this the rival at the end of the game? jp nz, Route22Script_5104e ret -.Route22RivalBattleCoords +.Route22RivalBattleCoords db $04, $1D db $05, $1D db $FF .firstRivalBattle ld a, $1 - ld [$cd4f], a + ld [wcd4f], a xor a - ld [$cd50], a - ld a, $4c - call Predef - ld a, [$d700] + ld [wcd50], a + predef EmotionBubble + ld a, [wd700] and a jr z, .asm_50f4e ; 0x50f44 $8 ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound .asm_50f4e ld c, BANK(Music_MeetRival) @@ -102,14 +101,14 @@ Route22Script0: ; 50f00 (14:4f00) ret Route22Script1: ; 50f62 (14:4f62) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz - ld a, [$cf0d] + ld a, [wcf0d] cp $1 jr nz, .asm_50f78 ; 0x50f6d $9 ld a, $4 - ld [$d528], a + ld [wd528], a ld a, $4 jr .asm_50f7a ; 0x50f76 $2 .asm_50f78 @@ -120,11 +119,11 @@ Route22Script1: ; 50f62 (14:4f62) ld [$ff8c], a call Func_34a6 xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $1 ld [$ff8c], a call DisplayTextID - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, Route22RivalDefeatedText1 @@ -145,10 +144,10 @@ StarterMons_50faf: ; 50faf (14:4faf) db STARTER1,$06 Route22Script2: ; 50fb5 (14:4fb5) - ld a, [$d057] + ld a, [W_ISINBATTLE] cp $ff jp z, Route22Script_50ece - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] and a jr nz, .asm_50fc7 ; 0x50fc1 $4 ld a, $4 @@ -161,17 +160,17 @@ Route22Script2: ; 50fb5 (14:4fb5) ld [$ff8c], a call Func_34a6 ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d7eb + ld [wJoyIgnore], a + ld hl, wd7eb set 5, [hl] ld a, $1 ld [$ff8c], a call DisplayTextID ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound callba Music_RivalAlternateStart - ld a, [$cf0d] + ld a, [wcf0d] cp $1 jr nz, .asm_50fff ; 0x50ff8 $5 call Route22Script_51008 @@ -201,17 +200,16 @@ Route22RivalExitMovementData2: ; 5101f (14:501f) db $40,$C0,$C0,$C0,$00,$00,$00,$00,$00,$00,$FF Route22Script3: ; 5102a (14:502a) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $22 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject call Func_2307 - ld hl, $d7eb + ld hl, wd7eb res 0, [hl] res 7, [hl] ld a, $0 @@ -220,20 +218,19 @@ Route22Script3: ; 5102a (14:502a) Route22Script_5104e: ; 5104e (14:504e) ld a, $2 - ld [$cd4f], a + ld [wcd4f], a xor a - ld [$cd50], a - ld a, $4c - call Predef ; indirect jump to PrintEmotionBubble (17c47 (5:7c47)) - ld a, [$d700] + ld [wcd50], a + predef EmotionBubble + ld a, [wd700] and a jr z, .skipYVisibilityTesta ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound .skipYVisibilityTesta ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound callba Music_RivalAlternateTempo ld a, $2 @@ -244,38 +241,38 @@ Route22Script_5104e: ; 5104e (14:504e) ret Route22Script4: ; 51087 (14:5087) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz ld a, $2 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c - ld a, [$cf0d] + ld a, [wcf0d] cp $1 jr nz, .asm_510a1 ld a, $4 - ld [$d528], a + ld [wd528], a ld a, $4 jr .asm_510a8 .asm_510a1 ld a, $2 - ld [$d528], a + ld [wd528], a ld a, $c .asm_510a8 ld [$ff8d], a call Func_34a6 xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $2 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, Route22RivalDefeatedText2 ; $51cb ld de, Route22Text_511d0 ; $51d0 call PreBattleSaveRegisters ld a, SONY2 + $c8 - ld [W_CUROPPONENT], a ; $d059 + ld [W_CUROPPONENT], a ; wd059 ld hl, StarterMons_510d9 ; $50d9 call Route22Script_50ed6 ld a, $5 @@ -288,37 +285,37 @@ StarterMons_510d9: ; 510d9 (14:50d9) db STARTER1,$0c Route22Script5: ; 510df (14:50df) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, Route22Script_50ece ld a, $2 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c - ld a, [$cf0d] + ld a, [wcf0d] cp $1 jr nz, .asm_510fb ld a, $4 - ld [$d528], a + ld [wd528], a ld a, $4 jr .asm_51102 .asm_510fb ld a, $2 - ld [$d528], a + ld [wd528], a ld a, $c .asm_51102 ld [$ff8d], a call Func_34a6 ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d7eb + ld [wJoyIgnore], a + ld hl, wd7eb set 6, [hl] ld a, $2 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound callba Music_RivalAlternateStartAndTempo - ld a, [$cf0d] + ld a, [wcf0d] cp $1 jr nz, .asm_51134 call Route22Script_5113d @@ -348,17 +345,16 @@ MovementData_5114d: ; 5114d (14:514d) db $80,$80,$80,$FF ; left x3 Route22Script6: ; 51151 (14:5151) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $23 - ld [$cc4d], a - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a + predef HideObject call Func_2307 - ld hl, $d7eb + ld hl, wd7eb res 1, [hl] res 7, [hl] ld a, $7 @@ -372,7 +368,7 @@ Route22TextPointers: ; 51175 (14:5175) Route22Text1: ; 5117b (14:517b) db $08 ; asm - ld a, [$d7eb] + ld a, [wd7eb] bit 5, a jr z, .asm_a88cf ; 0x51181 ld hl, Route22RivalAfterBattleText1 @@ -386,7 +382,7 @@ Route22Text1: ; 5117b (14:517b) Route22Text2: ; 51194 (14:5194) db $08 ; asm - ld a, [$d7eb] + ld a, [wd7eb] bit 6, a jr z, .asm_58c0a ; 0x5119a ld hl, Route22RivalAfterBattleText2 diff --git a/scripts/route22gate.asm b/scripts/route22gate.asm index e445a358..107926cf 100755 --- a/scripts/route22gate.asm +++ b/scripts/route22gate.asm @@ -22,7 +22,7 @@ Route22GateScript0: ; 1e6a4 (7:66a4) call ArePlayerCoordsInArray ret nc xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $1 ld [$ff8c], a jp DisplayTextID @@ -34,19 +34,19 @@ Route22GateScriptCoords: ; 1e6b5 (7:66b5) Route22GateScript_1e6ba: ; 1e6ba (7:66ba) ld a, $1 - ld [$cd38], a + ld [wcd38], a ld a, $80 - ld [$ccd3], a - ld [$c109], a - ld [wJoypadForbiddenButtonsMask], a + ld [wccd3], a + ld [wSpriteStateData1 + 9], a + ld [wJoyIgnore], a jp Func_3486 Route22GateScript1: ; 1e6cd (7:66cd) - ld a, [$cd38] + ld a, [wcd38] and a ret nz xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a call Delay3 ld a, $0 ld [W_ROUTE22GATECURSCRIPT], a diff --git a/scripts/route23.asm b/scripts/route23.asm index aca5efb7..55184600 100755 --- a/scripts/route23.asm +++ b/scripts/route23.asm @@ -6,24 +6,22 @@ Route23Script: ; 511da (14:51da) jp CallFunctionInTable Route23Script_511e9: ; 511e9 (14:51e9) - ld hl, $d126 + ld hl, wd126 bit 6, [hl] res 6, [hl] ret z - ld hl, $d7ee + ld hl, wd7ee res 0, [hl] res 7, [hl] - ld hl, $d813 + ld hl, wd813 res 0, [hl] res 6, [hl] ld a, $7a - ld [$cc4d], a - ld a, $15 - call Predef ; indirect jump to AddMissableObject (f1c8 (3:71c8)) + ld [wcc4d], a + predef ShowObject ld a, $60 - ld [$cc4d], a - ld a, $11 - jp Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a + predef_jump HideObject Route23ScriptPointers: ; 51213 (14:5213) dw Route23Script0 @@ -53,18 +51,17 @@ Route23Script0: ; 51219 (14:5219) ld a, e ld [$ff8c], a ld a, c - ld [$cd3d], a + ld [wWhichTrade], a ld b, $2 - ld hl, $d7ed - ld a, $10 - call Predef + ld hl, wd7ed + predef FlagActionPredef ld a, c and a ret nz call Route23Script_5125d call DisplayTextID xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ret YCoordsData_51255: ; 51255 (14:5255) @@ -72,7 +69,7 @@ YCoordsData_51255: ; 51255 (14:5255) Route23Script_5125d: ; 5125d (14:525d) ld hl, BadgeTextPointers ; $5276 - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade ld c, a ld b, $0 add hl, bc @@ -80,7 +77,7 @@ Route23Script_5125d: ; 5125d (14:525d) ld a, [hli] ld h, [hl] ld l, a - ld de, $cd6d + ld de, wcd6d .asm_5126e ld a, [hli] ld [de], a @@ -121,16 +118,16 @@ CascadeBadgeText: ; 512cb (14:52cb) Route23Script_512d8: ; 512d8 (14:52d8) ld a, $1 - ld [$cd38], a + ld [wcd38], a ld a, $80 - ld [$ccd3], a + ld [wccd3], a xor a - ld [$c109], a - ld [wJoypadForbiddenButtonsMask], a + ld [wSpriteStateData1 + 9], a + ld [wJoyIgnore], a jp Func_3486 Route23Script1: ; 512ec (14:52ec) - ld a, [$cd38] + ld a, [wcd38] and a ret nz Route23Script2: ; 512f1 (14:52f1) @@ -191,15 +188,14 @@ Route23Text7: ; 5133d (14:533d) jp TextScriptEnd Route23Script_51346: ; 51346 (14:5346) - ld [wWhichTrade], a ; $cd3d + ld [wWhichTrade], a ; wWhichTrade call Route23Script_5125d - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade inc a ld c, a ld b, $2 ld hl, W_OBTAINEDBADGES - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + predef FlagActionPredef ld a, c and a jr nz, .asm_5136e @@ -212,12 +208,11 @@ Route23Script_51346: ; 51346 (14:5346) .asm_5136e ld hl, VictoryRoadGuardText2 call PrintText - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade ld c, a ld b, $1 - ld hl, $d7ed - ld a, $10 - call Predef ; indirect jump to HandleBitArray (f666 (3:7666)) + ld hl, wd7ed + predef FlagActionPredef ld a, $2 ld [W_ROUTE23CURSCRIPT], a ret diff --git a/scripts/route24.asm b/scripts/route24.asm index 0e77c6f7..cafb3f8e 100755 --- a/scripts/route24.asm +++ b/scripts/route24.asm @@ -9,7 +9,7 @@ Route24Script: ; 513ad (14:53ad) Route24Script_513c0: ; 513c0 (14:53c0) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_ROUTE24CURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -22,25 +22,25 @@ Route24ScriptPointers: ; 513cb (14:53cb) dw Route24Script4 Route24Script0: ; 513d5 (14:53d5) - ld a, [$d7ef] + ld a, [wd7ef] bit 0, a jp nz, CheckFightingMapTrainers ld hl, CoordsData_5140e ; $540e call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $1 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d7f0 + ld hl, wd7f0 bit 1, [hl] res 1, [hl] ret z ld a, $80 - ld [$ccd3], a + ld [wccd3], a ld a, $1 - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $4 ld [W_ROUTE24CURSCRIPT], a @@ -51,7 +51,7 @@ CoordsData_5140e: ; 5140e (14:540e) db $0F,$0A,$FF Route24Script4: ; 51411 (14:5411) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 @@ -61,19 +61,19 @@ Route24Script4: ; 51411 (14:5411) ret Route24Script3: ; 51422 (14:5422) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, Route24Script_513c0 call UpdateSprites ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d7ef + ld [wJoyIgnore], a + ld hl, wd7ef set 1, [hl] ld a, $1 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $0 ld [W_ROUTE24CURSCRIPT], a ld [W_CURMAPSCRIPT], a @@ -93,7 +93,7 @@ Route24TrainerHeaders: ; 5145b (14:545b) Route24TrainerHeader0: ; 5145b (14:545b) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7ef ; flag's byte + dw wd7ef ; flag's byte dw Route24BattleText1 ; 0x5571 TextBeforeBattle dw Route24AfterBattleText1 ; 0x557b TextAfterBattle dw Route24EndBattleText1 ; 0x5576 TextEndBattle @@ -102,7 +102,7 @@ Route24TrainerHeader0: ; 5145b (14:545b) Route24TrainerHeader2: ; 51467 (14:5467) db $3 ; flag's bit db ($1 << 4) ; trainer's view range - dw $d7ef ; flag's byte + dw wd7ef ; flag's byte dw Route24BattleText2 ; 0x5580 TextBeforeBattle dw Route24AfterBattleText2 ; 0x558a TextAfterBattle dw Route24EndBattleText2 ; 0x5585 TextEndBattle @@ -111,7 +111,7 @@ Route24TrainerHeader2: ; 51467 (14:5467) Route24TrainerHeader3: ; 51473 (14:5473) db $4 ; flag's bit db ($1 << 4) ; trainer's view range - dw $d7ef ; flag's byte + dw wd7ef ; flag's byte dw Route24BattleText3 ; 0x558f TextBeforeBattle dw Route24AfterBattleText3 ; 0x5599 TextAfterBattle dw Route24EndBattleText3 ; 0x5594 TextEndBattle @@ -120,7 +120,7 @@ Route24TrainerHeader3: ; 51473 (14:5473) Route24TrainerHeader4: ; 5147f (14:547f) db $5 ; flag's bit db ($1 << 4) ; trainer's view range - dw $d7ef ; flag's byte + dw wd7ef ; flag's byte dw Route24BattleText4 ; 0x559e TextBeforeBattle dw Route24AfterBattleText4 ; 0x55a8 TextAfterBattle dw Route24EndBattleText4 ; 0x55a3 TextEndBattle @@ -129,7 +129,7 @@ Route24TrainerHeader4: ; 5147f (14:547f) Route24TrainerHeader5: ; 5148b (14:548b) db $6 ; flag's bit db ($1 << 4) ; trainer's view range - dw $d7ef ; flag's byte + dw wd7ef ; flag's byte dw Route24BattleText5 ; 0x55ad TextBeforeBattle dw Route24AfterBattleText5 ; 0x55b7 TextAfterBattle dw Route24EndBattleText5 ; 0x55b2 TextEndBattle @@ -138,7 +138,7 @@ Route24TrainerHeader5: ; 5148b (14:548b) Route24TrainerHeader6: ; 51497 (14:5497) db $7 ; flag's bit db ($1 << 4) ; trainer's view range - dw $d7ef ; flag's byte + dw wd7ef ; flag's byte dw Route24BattleText6 ; 0x55bc TextBeforeBattle dw Route24AfterBattleText6 ; 0x55c6 TextAfterBattle dw Route24EndBattleText6 ; 0x55c1 TextEndBattle @@ -148,9 +148,9 @@ Route24TrainerHeader6: ; 51497 (14:5497) Route24Text1: ; 514a4 (14:54a4) db $8 - ld hl, $d7f0 + ld hl, wd7f0 res 1, [hl] - ld a, [$d7ef] + ld a, [wd7ef] bit 0, a jr nz, .asm_a03f5 ; 0x514af $48 ld hl, Route24Text_51510 @@ -158,24 +158,24 @@ Route24Text1: ; 514a4 (14:54a4) ld bc, (NUGGET << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, $d7ef + ld hl, wd7ef set 0, [hl] ld hl, Route24Text_5151a call PrintText ld hl, Route24Text_51526 call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, Route24Text_5152b ld de, Route24Text_5152b call PreBattleSaveRegisters ld a, [$ff8c] - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $3 ld [W_ROUTE24CURSCRIPT], a ld [W_CURMAPSCRIPT], a @@ -187,7 +187,7 @@ Route24Text1: ; 514a4 (14:54a4) .BagFull ld hl, Route24Text_51521 call PrintText - ld hl, $d7f0 + ld hl, wd7f0 set 1, [hl] jp TextScriptEnd diff --git a/scripts/route25.asm b/scripts/route25.asm index 7c5543c7..088be3a2 100755 --- a/scripts/route25.asm +++ b/scripts/route25.asm @@ -9,36 +9,32 @@ Route25Script: ; 515cb (14:55cb) ret Route25Script_515e1: ; 515e1 (14:55e1) - ld hl, $d126 + ld hl, wd126 bit 6, [hl] res 6, [hl] ret z - ld hl, $d7f2 + ld hl, wd7f2 bit 7, [hl] ret nz bit 5, [hl] jr nz, .asm_515ff res 6, [hl] ld a, $61 - ld [$cc4d], a - ld a, $15 - jp Predef ; indirect jump to AddMissableObject (f1c8 (3:71c8)) + ld [wcc4d], a + predef_jump ShowObject .asm_515ff bit 4, [hl] ret z set 7, [hl] ld a, $24 - ld [$cc4d], a - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a + predef HideObject ld a, $62 - ld [$cc4d], a - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a + predef HideObject ld a, $63 - ld [$cc4d], a - ld a, $15 - jp Predef ; indirect jump to AddMissableObject (f1c8 (3:71c8)) + ld [wcc4d], a + predef_jump ShowObject Route25ScriptPointers: ; 51622 (14:5622) dw CheckFightingMapTrainers @@ -62,7 +58,7 @@ Route25TrainerHeaders: ; 5163e (14:563e) Route25TrainerHeader0: ; 5163e (14:563e) db $1 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7f1 ; flag's byte + dw wd7f1 ; flag's byte dw Route25BattleText1 ; 0x5705 TextBeforeBattle dw Route25AfterBattleText1 ; 0x570f TextAfterBattle dw Route25EndBattleText1 ; 0x570a TextEndBattle @@ -71,7 +67,7 @@ Route25TrainerHeader0: ; 5163e (14:563e) Route25TrainerHeader2: ; 5164a (14:564a) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7f1 ; flag's byte + dw wd7f1 ; flag's byte dw Route25BattleText2 ; 0x5714 TextBeforeBattle dw Route25AfterBattleText2 ; 0x571e TextAfterBattle dw Route25EndBattleText2 ; 0x5719 TextEndBattle @@ -80,7 +76,7 @@ Route25TrainerHeader2: ; 5164a (14:564a) Route25TrainerHeader3: ; 51656 (14:5656) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7f1 ; flag's byte + dw wd7f1 ; flag's byte dw Route25BattleText3 ; 0x5723 TextBeforeBattle dw Route25AfterBattleText3 ; 0x572d TextAfterBattle dw Route25EndBattleText3 ; 0x5728 TextEndBattle @@ -89,7 +85,7 @@ Route25TrainerHeader3: ; 51656 (14:5656) Route25TrainerHeader4: ; 51662 (14:5662) db $4 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7f1 ; flag's byte + dw wd7f1 ; flag's byte dw Route25BattleText4 ; 0x5732 TextBeforeBattle dw Route25AfterBattleText4 ; 0x573c TextAfterBattle dw Route25EndBattleText4 ; 0x5737 TextEndBattle @@ -98,7 +94,7 @@ Route25TrainerHeader4: ; 51662 (14:5662) Route25TrainerHeader5: ; 5166e (14:566e) db $5 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7f1 ; flag's byte + dw wd7f1 ; flag's byte dw Route25BattleText5 ; 0x5741 TextBeforeBattle dw Route25AfterBattleText5 ; 0x574b TextAfterBattle dw Route25EndBattleText5 ; 0x5746 TextEndBattle @@ -107,7 +103,7 @@ Route25TrainerHeader5: ; 5166e (14:566e) Route25TrainerHeader6: ; 5167a (14:567a) db $6 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7f1 ; flag's byte + dw wd7f1 ; flag's byte dw Route25BattleText6 ; 0x5750 TextBeforeBattle dw Route25AfterBattleText6 ; 0x575a TextAfterBattle dw Route25EndBattleText6 ; 0x5755 TextEndBattle @@ -116,7 +112,7 @@ Route25TrainerHeader6: ; 5167a (14:567a) Route25TrainerHeader7: ; 51686 (14:5686) db $7 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7f1 ; flag's byte + dw wd7f1 ; flag's byte dw Route25BattleText7 ; 0x575f TextBeforeBattle dw Route25AfterBattleText7 ; 0x5769 TextAfterBattle dw Route25EndBattleText7 ; 0x5764 TextEndBattle @@ -125,7 +121,7 @@ Route25TrainerHeader7: ; 51686 (14:5686) Route25TrainerHeader8: ; 51692 (14:5692) db $8 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7f1 ; flag's byte + dw wd7f1 ; flag's byte dw Route25BattleText8 ; 0x576e TextBeforeBattle dw Route25AfterBattleText8 ; 0x5778 TextAfterBattle dw Route25EndBattleText8 ; 0x5773 TextEndBattle @@ -134,7 +130,7 @@ Route25TrainerHeader8: ; 51692 (14:5692) Route25TrainerHeader9: ; 5169e (14:569e) db $9 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7f1 ; flag's byte + dw wd7f1 ; flag's byte dw Route25BattleText9 ; 0x577d TextBeforeBattle dw Route25AfterBattleText9 ; 0x5787 TextAfterBattle dw Route25EndBattleText9 ; 0x5782 TextEndBattle diff --git a/scripts/route2gate.asm b/scripts/route2gate.asm index 0885812e..8ee087c8 100755 --- a/scripts/route2gate.asm +++ b/scripts/route2gate.asm @@ -7,25 +7,24 @@ Route2GateTextPointers: ; 5d5d7 (17:55d7) Route2GateText1: ; 5d5db (17:55db) db $08 ; asm - ld a, [$d7c2] + ld a, [wd7c2] bit 0, a jr nz, .asm_6592c ; 0x5d5e1 ld a, 10 ; pokemon needed ldh [$db], a ld a, HM_05 ; oak's aide reward ldh [$dc], a - ld [$d11e], a + ld [wd11e], a call GetItemName ; $2fcf - ld hl, $cd6d - ld de, $cc5b + ld hl, wcd6d + ld de, wcc5b ld bc, $000d call CopyData - ld a, $62 - call Predef ; call oak's aide script + predef OaksAideScript ; call oak's aide script ldh a, [$db] cp $1 jr nz, .asm_ad646 ; 0x5d606 - ld hl, $d7c2 + ld hl, wd7c2 set 0, [hl] .asm_6592c ; 0x5d60d ld hl, Route2GateText_5d616 diff --git a/scripts/route2house.asm b/scripts/route2house.asm index 50a058b8..75da399b 100755 --- a/scripts/route2house.asm +++ b/scripts/route2house.asm @@ -13,6 +13,5 @@ Route2HouseText2: ; 1def9 (7:5ef9) db $08 ; asm ld a, $1 ld [wWhichTrade], a - ld a, $54 - call Predef + predef Predef54 jp TextScriptEnd diff --git a/scripts/route3.asm b/scripts/route3.asm index 1ff29f5b..5cd35fd9 100755 --- a/scripts/route3.asm +++ b/scripts/route3.asm @@ -28,7 +28,7 @@ Route3TrainerHeaders: ; 55525 (15:5525) Route3TrainerHeader0: ; 55525 (15:5525) db $2 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7c3 ; flag's byte + dw wd7c3 ; flag's byte dw Route3BattleText1 ; 0x5595 TextBeforeBattle dw Route3AfterBattleText1 ; 0x559f TextAfterBattle dw Route3EndBattleText1 ; 0x559a TextEndBattle @@ -37,7 +37,7 @@ Route3TrainerHeader0: ; 55525 (15:5525) Route3TrainerHeader2: ; 55531 (15:5531) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7c3 ; flag's byte + dw wd7c3 ; flag's byte dw Route3BattleText2 ; 0x55ae TextBeforeBattle dw Route3AfterBattleText2 ; 0x55b8 TextAfterBattle dw Route3EndBattleText2 ; 0x55b3 TextEndBattle @@ -46,7 +46,7 @@ Route3TrainerHeader2: ; 55531 (15:5531) Route3TrainerHeader3: ; 5553d (15:553d) db $4 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7c3 ; flag's byte + dw wd7c3 ; flag's byte dw Route3BattleText3 ; 0x55c7 TextBeforeBattle dw Route3AfterBattleText3 ; 0x55d1 TextAfterBattle dw Route3EndBattleText3 ; 0x55cc TextEndBattle @@ -55,7 +55,7 @@ Route3TrainerHeader3: ; 5553d (15:553d) Route3TrainerHeader4: ; 55549 (15:5549) db $5 ; flag's bit db ($1 << 4) ; trainer's view range - dw $d7c3 ; flag's byte + dw wd7c3 ; flag's byte dw Route3BattleText4 ; 0x55e0 TextBeforeBattle dw Route3AfterBattleText4 ; 0x55ea TextAfterBattle dw Route3EndBattleText4 ; 0x55e5 TextEndBattle @@ -64,7 +64,7 @@ Route3TrainerHeader4: ; 55549 (15:5549) Route3TrainerHeader5: ; 55555 (15:5555) db $6 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7c3 ; flag's byte + dw wd7c3 ; flag's byte dw Route3BattleText5 ; 0x55f9 TextBeforeBattle dw Route3AfterBattleText5 ; 0x5603 TextAfterBattle dw Route3EndBattleText5 ; 0x55fe TextEndBattle @@ -73,7 +73,7 @@ Route3TrainerHeader5: ; 55555 (15:5555) Route3TrainerHeader6: ; 55561 (15:5561) db $7 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7c3 ; flag's byte + dw wd7c3 ; flag's byte dw Route3BattleText6 ; 0x5612 TextBeforeBattle dw Route3AfterBattleText6 ; 0x561c TextAfterBattle dw Route3EndBattleText6 ; 0x5617 TextEndBattle @@ -82,7 +82,7 @@ Route3TrainerHeader6: ; 55561 (15:5561) Route3TrainerHeader7: ; 5556d (15:556d) db $8 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7c3 ; flag's byte + dw wd7c3 ; flag's byte dw Route3BattleText7 ; 0x562b TextBeforeBattle dw Route3AfterBattleText7 ; 0x5635 TextAfterBattle dw Route3EndBattleText7 ; 0x5630 TextEndBattle @@ -91,7 +91,7 @@ Route3TrainerHeader7: ; 5556d (15:556d) Route3TrainerHeader8: ; 55579 (15:5579) db $9 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7c3 ; flag's byte + dw wd7c3 ; flag's byte dw Route3BattleText8 ; 0x5644 TextBeforeBattle dw Route3AfterBattleText8 ; 0x564e TextAfterBattle dw Route3EndBattleText8 ; 0x5649 TextEndBattle diff --git a/scripts/route4.asm b/scripts/route4.asm index 69ec7424..fa234590 100755 --- a/scripts/route4.asm +++ b/scripts/route4.asm @@ -24,7 +24,7 @@ Route4TrainerHeaders: ; 5567d (15:567d) Route4TrainerHeader0: ; 5567d (15:567d) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7c5 ; flag's byte + dw wd7c5 ; flag's byte dw Route4BattleText1 ; 0x5699 TextBeforeBattle dw Route4AfterBattleText1 ; 0x56a3 TextAfterBattle dw Route4EndBattleText1 ; 0x569e TextEndBattle diff --git a/scripts/route5gate.asm b/scripts/route5gate.asm index ea5feda0..d7abeff5 100755 --- a/scripts/route5gate.asm +++ b/scripts/route5gate.asm @@ -10,22 +10,22 @@ Route5GateScriptPointers: ; 1df3f (7:5f3f) Route5GateScript_1df43: ; 1df43 (7:5f43) ld a, $40 - ld [$ccd3], a + ld [wccd3], a ld a, $1 - ld [$cd38], a + ld [wcd38], a jp Func_3486 Route5GateScript0: ; 1df50 (7:5f50) - ld a, [$d728] + ld a, [wd728] bit 6, a ret nz ld hl, CoordsData_1df8f call ArePlayerCoordsInArray ret nc ld a, $2 - ld [$d528], a + ld [wd528], a xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a callba RemoveGuardDrink ld a, [$ff00+$db] and a @@ -41,7 +41,7 @@ Route5GateScript0: ; 1df50 (7:5f50) ld a, $3 ld [$ff00+$8c], a call DisplayTextID - ld hl, $d728 + ld hl, wd728 set 6, [hl] ret @@ -51,15 +51,15 @@ CoordsData_1df8f: ; 1df8f (7:5f8f) db $ff Route5GateScript1: ; 1df94 (7:5f94) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_ROUTE5GATECURSCRIPT], a ret - + Route5GateTextPointers: ; 1dfa4 (7:5fa4) dw Route5GateText1 dw Route5GateText2 @@ -70,7 +70,7 @@ Route7GateText1: ; 1dfaa (7:5faa) Route6GateText1: ; 1dfaa (7:5faa) Route5GateText1: ; 1dfaa (7:5faa) db $8 - ld a, [$d728] + ld a, [wd728] bit 6, a jr nz, .asm_88856 ; 0x1dfb0 $2c callba RemoveGuardDrink @@ -86,7 +86,7 @@ Route5GateText1: ; 1dfaa (7:5faa) .asm_768a2 ; 0x1dfd0 ld hl, Route5GateText3 call PrintText - ld hl, $d728 + ld hl, wd728 set 6, [hl] jp TextScriptEnd .asm_88856 ; 0x1dfde diff --git a/scripts/route6.asm b/scripts/route6.asm index a1cf52a8..018c1b80 100755 --- a/scripts/route6.asm +++ b/scripts/route6.asm @@ -25,7 +25,7 @@ Route6TrainerHeaders: ; 590d7 (16:50d7) Route6TrainerHeader0: ; 590d7 (16:50d7) db $1 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d7c9 ; flag's byte + dw wd7c9 ; flag's byte dw Route6BattleText1 ; 0x512a TextBeforeBattle dw Route6AfterBattleText1 ; 0x5134 TextAfterBattle dw Route6EndBattleText1 ; 0x512f TextEndBattle @@ -34,7 +34,7 @@ Route6TrainerHeader0: ; 590d7 (16:50d7) Route6TrainerHeader1: ; 590e3 (16:50e3) db $2 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d7c9 ; flag's byte + dw wd7c9 ; flag's byte dw Route6BattleText2 ; 0x5143 TextBeforeBattle dw Route6AfterBattleText1 ; 0x5134 TextAfterBattle dw Route6EndBattleText2 ; 0x5148 TextEndBattle @@ -43,7 +43,7 @@ Route6TrainerHeader1: ; 590e3 (16:50e3) Route6TrainerHeader2: ; 590ef (16:50ef) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7c9 ; flag's byte + dw wd7c9 ; flag's byte dw Route6BattleText3 ; 0x5157 TextBeforeBattle dw Route6AfterBattleText3 ; 0x5161 TextAfterBattle dw Route6EndBattleText3 ; 0x515c TextEndBattle @@ -52,7 +52,7 @@ Route6TrainerHeader2: ; 590ef (16:50ef) Route6TrainerHeader3: ; 590fb (16:50fb) db $4 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7c9 ; flag's byte + dw wd7c9 ; flag's byte dw Route6BattleText4 ; 0x5170 TextBeforeBattle dw Route6AfterBattleText4 ; 0x517a TextAfterBattle dw Route6EndBattleText4 ; 0x5175 TextEndBattle @@ -61,7 +61,7 @@ Route6TrainerHeader3: ; 590fb (16:50fb) Route6TrainerHeader4: ; 59107 (16:5107) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7c9 ; flag's byte + dw wd7c9 ; flag's byte dw Route6BattleText5 ; 0x5189 TextBeforeBattle dw Route6AfterBattleText5 ; 0x5193 TextAfterBattle dw Route6EndBattleText5 ; 0x518e TextEndBattle @@ -70,7 +70,7 @@ Route6TrainerHeader4: ; 59107 (16:5107) Route6TrainerHeader5: ; 59113 (16:5113) db $6 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7c9 ; flag's byte + dw wd7c9 ; flag's byte dw Route6BattleText6 ; 0x51a2 TextBeforeBattle dw Route6AfterBattleText6 ; 0x51ac TextAfterBattle dw Route6EndBattleText6 ; 0x51a7 TextEndBattle diff --git a/scripts/route6gate.asm b/scripts/route6gate.asm index 22fe5ede..9945f80f 100755 --- a/scripts/route6gate.asm +++ b/scripts/route6gate.asm @@ -10,16 +10,16 @@ Route6GateScriptPointers: ; 1e04a (7:604a) dw Route6GateScript1 Route6GateScript0: ; 1e04e (7:604e) - ld a, [$d728] + ld a, [wd728] bit 6, a ret nz ld hl, CoordsData_1e08c call ArePlayerCoordsInArray ret nc ld a, $1 - ld [$d528], a + ld [wd528], a xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a callba RemoveGuardDrink ld a, [$ffdb] and a @@ -32,7 +32,7 @@ Route6GateScript0: ; 1e04e (7:604e) ld [W_ROUTE6GATECURSCRIPT], a ret .asm_1e080 - ld hl, $d728 + ld hl, wd728 set 6, [hl] ld a, $3 ld [$ff8c], a @@ -43,25 +43,25 @@ CoordsData_1e08c: ; 1e08c (7:608c) db $02,$04,$FF Route6GateScript1: ; 1e091 (7:6091) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_ROUTE6GATECURSCRIPT], a ret Route6GateScript_1e0a1: ; 1e0a1 (7:60a1) - ld hl, $d730 + ld hl, wd730 set 7, [hl] ld a, $80 - ld [$ccd3], a + ld [wccd3], a ld a, $1 - ld [$cd38], a + ld [wcd38], a xor a - ld [$c206], a - ld [$cd3b], a + ld [wSpriteStateData2 + $06], a + ld [wcd3b], a ret Route6GateTextPointers: ; 1e0b8 (7:60b8) diff --git a/scripts/route7gate.asm b/scripts/route7gate.asm index 5597c784..c9599706 100755 --- a/scripts/route7gate.asm +++ b/scripts/route7gate.asm @@ -10,28 +10,28 @@ Route7GateScriptPointers: ; 1e10d (7:610d) dw Route7GateScript1 Route7GateScript_1e111: ; 1e111 (7:6111) - ld hl, $d730 + ld hl, wd730 set 7, [hl] ld a, $20 - ld [$ccd3], a + ld [wccd3], a ld a, $1 - ld [$cd38], a + ld [wcd38], a xor a - ld [$c206], a - ld [$cd3b], a + ld [wSpriteStateData2 + $06], a + ld [wcd3b], a ret Route7GateScript0: ; 1e128 (7:6128) - ld a, [$d728] + ld a, [wd728] bit 6, a ret nz ld hl, CoordsData_1e167 call ArePlayerCoordsInArray ret nc ld a, $8 - ld [$d528], a + ld [wd528], a xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a callba RemoveGuardDrink ld a, [$ffdb] and a @@ -47,7 +47,7 @@ Route7GateScript0: ; 1e128 (7:6128) ld a, $3 ld [$ff8c], a call DisplayTextID - ld hl, $d728 + ld hl, wd728 set 6, [hl] ret @@ -57,12 +57,12 @@ CoordsData_1e167: ; 1e167 (7:6167) db $ff Route7GateScript1: ; 1e16c (7:616c) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_ROUTE7GATECURSCRIPT], a ld [W_CURMAPSCRIPT], a ret diff --git a/scripts/route8.asm b/scripts/route8.asm index eebc96ff..bf41b5ae 100755 --- a/scripts/route8.asm +++ b/scripts/route8.asm @@ -28,7 +28,7 @@ Route8TrainerHeaders: ; 591e3 (16:51e3) Route8TrainerHeader0: ; 591e3 (16:51e3) db $1 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7cd ; flag's byte + dw wd7cd ; flag's byte dw Route8BattleText1 ; 0x525a TextBeforeBattle dw Route8AfterBattleText1 ; 0x5264 TextAfterBattle dw Route8EndBattleText1 ; 0x525f TextEndBattle @@ -37,7 +37,7 @@ Route8TrainerHeader0: ; 591e3 (16:51e3) Route8TrainerHeader1: ; 591ef (16:51ef) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7cd ; flag's byte + dw wd7cd ; flag's byte dw Route8BattleText2 ; 0x5273 TextBeforeBattle dw Route8AfterBattleText2 ; 0x527d TextAfterBattle dw Route8EndBattleText2 ; 0x5278 TextEndBattle @@ -46,7 +46,7 @@ Route8TrainerHeader1: ; 591ef (16:51ef) Route8TrainerHeader2: ; 591fb (16:51fb) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7cd ; flag's byte + dw wd7cd ; flag's byte dw Route8BattleText3 ; 0x528c TextBeforeBattle dw Route8AfterBattleText3 ; 0x5296 TextAfterBattle dw Route8EndBattleText3 ; 0x5291 TextEndBattle @@ -55,7 +55,7 @@ Route8TrainerHeader2: ; 591fb (16:51fb) Route8TrainerHeader3: ; 59207 (16:5207) db $4 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7cd ; flag's byte + dw wd7cd ; flag's byte dw Route8BattleText4 ; 0x52a5 TextBeforeBattle dw Route8AfterBattleText4 ; 0x52af TextAfterBattle dw Route8EndBattleText4 ; 0x52aa TextEndBattle @@ -64,7 +64,7 @@ Route8TrainerHeader3: ; 59207 (16:5207) Route8TrainerHeader4: ; 59213 (16:5213) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7cd ; flag's byte + dw wd7cd ; flag's byte dw Route8BattleText5 ; 0x52be TextBeforeBattle dw Route8AfterBattleText5 ; 0x52c8 TextAfterBattle dw Route8EndBattleText5 ; 0x52c3 TextEndBattle @@ -73,7 +73,7 @@ Route8TrainerHeader4: ; 59213 (16:5213) Route8TrainerHeader5: ; 5921f (16:521f) db $6 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7cd ; flag's byte + dw wd7cd ; flag's byte dw Route8BattleText6 ; 0x52d7 TextBeforeBattle dw Route8AfterBattleText6 ; 0x52e1 TextAfterBattle dw Route8EndBattleText6 ; 0x52dc TextEndBattle @@ -82,7 +82,7 @@ Route8TrainerHeader5: ; 5921f (16:521f) Route8TrainerHeader6: ; 5922b (16:522b) db $7 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7cd ; flag's byte + dw wd7cd ; flag's byte dw Route8BattleText7 ; 0x52f0 TextBeforeBattle dw Route8AfterBattleText7 ; 0x52fa TextAfterBattle dw Route8EndBattleText7 ; 0x52f5 TextEndBattle @@ -91,7 +91,7 @@ Route8TrainerHeader6: ; 5922b (16:522b) Route8TrainerHeader7: ; 59237 (16:5237) db $8 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7cd ; flag's byte + dw wd7cd ; flag's byte dw Route8BattleText8 ; 0x5309 TextBeforeBattle dw Route8AfterBattleText8 ; 0x5313 TextAfterBattle dw Route8EndBattleText8 ; 0x530e TextEndBattle @@ -100,7 +100,7 @@ Route8TrainerHeader7: ; 59237 (16:5237) Route8TrainerHeader8: ; 59243 (16:5243) db $9 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7cd ; flag's byte + dw wd7cd ; flag's byte dw Route8BattleText9 ; 0x5322 TextBeforeBattle dw Route8AfterBattleText9 ; 0x532c TextAfterBattle dw Route8EndBattleText9 ; 0x5327 TextEndBattle diff --git a/scripts/route8gate.asm b/scripts/route8gate.asm index 426b532e..aff001b4 100755 --- a/scripts/route8gate.asm +++ b/scripts/route8gate.asm @@ -9,28 +9,28 @@ Route8GateScriptPointers: ; 1e1d3 (7:61d3) dw Route8GateScript1 Route8GateScript_1e1d7: ; 1e1d7 (7:61d7) - ld hl, $d730 + ld hl, wd730 set 7, [hl] ld a, $10 - ld [$ccd3], a + ld [wccd3], a ld a, $1 - ld [$cd38], a + ld [wcd38], a xor a - ld [$c206], a - ld [$cd3b], a + ld [wSpriteStateData2 + $06], a + ld [wcd3b], a ret Route8GateScript0: ; 1e1ee (7:61ee) - ld a, [$d728] + ld a, [wd728] bit 6, a ret nz ld hl, CoordsData_1e22c call ArePlayerCoordsInArray ret nc ld a, $2 - ld [$d528], a + ld [wd528], a xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a callba RemoveGuardDrink ld a, [$ffdb] and a @@ -43,7 +43,7 @@ Route8GateScript0: ; 1e1ee (7:61ee) ld [W_ROUTE8GATECURSCRIPT], a ret .asm_1e220 - ld hl, $d728 + ld hl, wd728 set 6, [hl] ld a, $3 ld [$ff8c], a @@ -55,12 +55,12 @@ CoordsData_1e22c: ; 1e22c (7:622c) db $ff Route8GateScript1: ; 1e231 (7:6231) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_ROUTE8GATECURSCRIPT], a ret diff --git a/scripts/route9.asm b/scripts/route9.asm index 852c09b2..f14abef8 100755 --- a/scripts/route9.asm +++ b/scripts/route9.asm @@ -29,7 +29,7 @@ Route9TrainerHeaders: ; 556eb (15:56eb) Route9TrainerHeader0: ; 556eb (15:56eb) db $1 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7cf ; flag's byte + dw wd7cf ; flag's byte dw Route9BattleText1 ; 0x5792 TextBeforeBattle dw Route9AfterBattleText1 ; 0x579c TextAfterBattle dw Route9EndBattleText1 ; 0x5797 TextEndBattle @@ -38,7 +38,7 @@ Route9TrainerHeader0: ; 556eb (15:56eb) Route9TrainerHeader2: ; 556f7 (15:56f7) db $2 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7cf ; flag's byte + dw wd7cf ; flag's byte dw Route9BattleText2 ; 0x57a1 TextBeforeBattle dw Route9AfterBattleText2 ; 0x57ab TextAfterBattle dw Route9EndBattleText2 ; 0x57a6 TextEndBattle @@ -47,7 +47,7 @@ Route9TrainerHeader2: ; 556f7 (15:56f7) Route9TrainerHeader3: ; 55703 (15:5703) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7cf ; flag's byte + dw wd7cf ; flag's byte dw Route9BattleText3 ; 0x57b0 TextBeforeBattle dw Route9AfterBattleText3 ; 0x57ba TextAfterBattle dw Route9EndBattleText3 ; 0x57b5 TextEndBattle @@ -56,7 +56,7 @@ Route9TrainerHeader3: ; 55703 (15:5703) Route9TrainerHeader4: ; 5570f (15:570f) db $4 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7cf ; flag's byte + dw wd7cf ; flag's byte dw Route9BattleText4 ; 0x57bf TextBeforeBattle dw Route9AfterBattleText4 ; 0x57c9 TextAfterBattle dw Route9EndBattleText4 ; 0x57c4 TextEndBattle @@ -65,7 +65,7 @@ Route9TrainerHeader4: ; 5570f (15:570f) Route9TrainerHeader5: ; 5571b (15:571b) db $5 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7cf ; flag's byte + dw wd7cf ; flag's byte dw Route9BattleText5 ; 0x57ce TextBeforeBattle dw Route9AfterBattleText5 ; 0x57d8 TextAfterBattle dw Route9EndBattleText5 ; 0x57d3 TextEndBattle @@ -74,7 +74,7 @@ Route9TrainerHeader5: ; 5571b (15:571b) Route9TrainerHeader6: ; 55727 (15:5727) db $6 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7cf ; flag's byte + dw wd7cf ; flag's byte dw Route9BattleText6 ; 0x57dd TextBeforeBattle dw Route9AfterBattleText6 ; 0x57e7 TextAfterBattle dw Route9EndBattleText6 ; 0x57e2 TextEndBattle @@ -83,7 +83,7 @@ Route9TrainerHeader6: ; 55727 (15:5727) Route9TrainerHeader7: ; 55733 (15:5733) db $7 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7cf ; flag's byte + dw wd7cf ; flag's byte dw Route9BattleText7 ; 0x57ec TextBeforeBattle dw Route9AfterBattleText7 ; 0x57f6 TextAfterBattle dw Route9EndBattleText7 ; 0x57f1 TextEndBattle @@ -92,7 +92,7 @@ Route9TrainerHeader7: ; 55733 (15:5733) Route9TrainerHeader8: ; 5573f (15:573f) db $8 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7cf ; flag's byte + dw wd7cf ; flag's byte dw Route9BattleText8 ; 0x57fb TextBeforeBattle dw Route9AfterBattleText8 ; 0x5805 TextAfterBattle dw Route9EndBattleText8 ; 0x5800 TextEndBattle @@ -101,7 +101,7 @@ Route9TrainerHeader8: ; 5573f (15:573f) Route9TrainerHeader9: ; 5574b (15:574b) db $9 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d7cf ; flag's byte + dw wd7cf ; flag's byte dw Route9BattleText9 ; 0x580a TextBeforeBattle dw Route9AfterBattleText9 ; 0x5814 TextAfterBattle dw Route9EndBattleText9 ; 0x580f TextEndBattle diff --git a/scripts/safarizoneentrance.asm b/scripts/safarizoneentrance.asm index d1bc0d37..ffc7f402 100755 --- a/scripts/safarizoneentrance.asm +++ b/scripts/safarizoneentrance.asm @@ -21,12 +21,12 @@ SafariZoneEntranceScript0: ; 751e7 (1d:51e7) ld [$ff8c], a call DisplayTextID ld a, $ff - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $c - ld [$c109], a - ld a, [$cd3d] + ld [wSpriteStateData1 + 9], a + ld a, [wWhichTrade] cp $1 jr z, .asm_7520f ; 0x75207 $6 ld a, $2 @@ -37,7 +37,7 @@ SafariZoneEntranceScript0: ; 751e7 (1d:51e7) ld c, $1 call SafariZoneEntranceScript_752a3 ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $1 ld [W_SAFARIZONEENTRANCECURSCRIPT], a ret @@ -52,41 +52,41 @@ SafariZoneEntranceScript1: ; 75226 (1d:5226) ret nz SafariZoneEntranceScript2: ; 7522a (1d:522a) xor a - ld [H_CURRENTPRESSEDBUTTONS], a - ld [wJoypadForbiddenButtonsMask], a + ld [hJoyHeld], a + ld [wJoyIgnore], a call UpdateSprites ld a, $4 ld [$ff8c], a call DisplayTextID ld a, $ff - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ret SafariZoneEntranceScript3: ; 75240 (1d:5240) call SafariZoneEntranceScript_752b4 ret nz xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $5 ld [W_SAFARIZONEENTRANCECURSCRIPT], a ret SafariZoneEntranceScript5: ; 7524e (1d:524e) ld a, $4 - ld [$d528], a - ld hl, $d790 + ld [wd528], a + ld hl, wd790 bit 6, [hl] res 6, [hl] jr z, .asm_7527f ; 0x7525a $23 res 7, [hl] call UpdateSprites ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $6 ld [$ff8c], a call DisplayTextID xor a - ld [$da47], a + ld [W_NUMSAFARIBALLS], a ld a, $80 ld c, $3 call SafariZoneEntranceScript_752a3 @@ -104,7 +104,7 @@ SafariZoneEntranceScript4: ; 75287 (1d:5287) call SafariZoneEntranceScript_752b4 ret nz xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $0 ld [W_SAFARIZONEENTRANCECURSCRIPT], a ret @@ -113,7 +113,7 @@ SafariZoneEntranceScript6: ; 75295 (1d:5295) call SafariZoneEntranceScript_752b4 ret nz call Delay3 - ld a, [$cf0d] + ld a, [wcf0d] ld [W_SAFARIZONEENTRANCECURSCRIPT], a ret @@ -121,14 +121,14 @@ SafariZoneEntranceScript_752a3: ; 752a3 (1d:52a3) push af ld b, $0 ld a, c - ld [$cd38], a - ld hl, $ccd3 + ld [wcd38], a + ld hl, wccd3 pop af call FillMemory jp Func_3486 SafariZoneEntranceScript_752b4: ; 752b4 (1d:52b4) - ld a, [$cd38] + ld a, [wcd38] and a ret @@ -149,10 +149,10 @@ SafariZoneEntranceText4: ; 752ca (1d:52ca) TX_FAR SafariZoneEntranceText_9e6e4 ; 0x9e6e4 db $8 ld a, $13 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jp nz, .asm_75346 xor a @@ -168,23 +168,22 @@ SafariZoneEntranceText4: ; 752ca (1d:52ca) jr .asm_7534c ; 0x752f7 $53 .asm_752f9 xor a - ld [$cd3d], a + ld [wWhichTrade], a ld a, $5 - ld [$cd3e], a + ld [wTrainerEngageDistance], a ld a, $0 - ld [$cd3f], a - ld hl, $cd3f - ld de, $d349 + ld [wTrainerFacingDirection], a + ld hl, wTrainerFacingDirection + ld de, wPlayerMoney + 2 ld c, $3 - ld a, $c - call Predef + predef SubBCDPredef ld a, $13 - ld [$d125], a + ld [wd125], a call DisplayTextBoxID ld hl, SafariZoneEntranceText_7535b call PrintText ld a, $1e - ld [$da47], a + ld [W_NUMSAFARIBALLS], a ld a, 502 / $100 ld [wSafariSteps], a ld a, 502 % $100 @@ -192,7 +191,7 @@ SafariZoneEntranceText4: ; 752ca (1d:52ca) ld a, $40 ld c, $3 call SafariZoneEntranceScript_752a3 - ld hl, $d790 + ld hl, wd790 set 7, [hl] res 6, [hl] ld a, $3 @@ -230,32 +229,32 @@ SafariZoneEntranceText5: ; 7536f (1d:536f) TX_FAR SafariZoneEntranceText_9e814 ; 0x9e814 db $8 call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_7539c ; 0x7537b $1f ld hl, SafariZoneEntranceText_753bb call PrintText xor a - ld [$c109], a + ld [wSpriteStateData1 + 9], a ld a, $80 ld c, $3 call SafariZoneEntranceScript_752a3 - ld hl, $d790 + ld hl, wd790 res 6, [hl] res 7, [hl] ld a, $0 - ld [$cf0d], a + ld [wcf0d], a jr .asm_753b3 ; 0x7539a $17 .asm_7539c ld hl, SafariZoneEntranceText_753c0 call PrintText ld a, $4 - ld [$c109], a + ld [wSpriteStateData1 + 9], a ld a, $40 ld c, $1 call SafariZoneEntranceScript_752a3 ld a, $5 - ld [$cf0d], a + ld [wcf0d], a .asm_753b3 ld a, $6 ld [W_SAFARIZONEENTRANCECURSCRIPT], a @@ -278,7 +277,7 @@ SafariZoneEntranceText2: ; 753ca (1d:53ca) ld hl, SafariZoneEntranceText_753e6 call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a ld hl, SafariZoneEntranceText_753f0 jr nz, .asm_278a6 ; 0x753db diff --git a/scripts/safarizonesecrethouse.asm b/scripts/safarizonesecrethouse.asm index 39b7c393..28aae7c4 100755 --- a/scripts/safarizonesecrethouse.asm +++ b/scripts/safarizonesecrethouse.asm @@ -6,7 +6,7 @@ SafariZoneSecretHouseTextPointers: ; 4a31a (12:631a) SafariZoneSecretHouseText1: ; 4a31c (12:631c) db $08 ; asm - ld a, [$d857] + ld a, [wd857] bit 0, a jr nz, .asm_20a9b ; 0x4a322 ld hl, SafariZoneSecretHouseText_4a350 @@ -16,7 +16,7 @@ SafariZoneSecretHouseText1: ; 4a31c (12:631c) jr nc, .BagFull ld hl, ReceivedHM03Text call PrintText - ld hl, $d857 + ld hl, wd857 set 0, [hl] jr .asm_8f1fc ; 0x4a33d .BagFull diff --git a/scripts/saffrongym.asm b/scripts/saffrongym.asm index 40482831..336d40e9 100755 --- a/scripts/saffrongym.asm +++ b/scripts/saffrongym.asm @@ -1,5 +1,5 @@ SaffronGymScript: ; 5d00d (17:500d) - ld hl, $d126 + ld hl, wd126 bit 6, [hl] res 6, [hl] call nz, .extra @@ -24,7 +24,7 @@ Gym6LeaderName: ; 5d040 (17:5040) SaffronGymText_5d048: ; 5d048 (17:5048) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_SAFFRONGYMCURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -36,17 +36,17 @@ SaffronGymScriptPointers: ; 5d053 (17:5053) dw SaffronGymScript3 SaffronGymScript3: ; 5d05b (17:505b) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, SaffronGymText_5d048 ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a SaffronGymText_5d068: ; 5d068 (17:5068) ld a, $a ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d7b3 + ld hl, wd7b3 set 1, [hl] ld bc, (TM_46 << 8) | 1 call GiveItem @@ -54,7 +54,7 @@ SaffronGymText_5d068: ; 5d068 (17:5068) ld a, $b ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d7b3 + ld hl, wd7b3 set 0, [hl] jr .asm_5d091 .BagFull @@ -64,14 +64,14 @@ SaffronGymText_5d068: ; 5d068 (17:5068) .asm_5d091 ld hl, W_OBTAINEDBADGES set 5, [hl] - ld hl, $d72a + ld hl, wd72a set 5, [hl] ; deactivate gym trainers - ld a, [$d7b3] + ld a, [wd7b3] or %11111100 - ld [$d7b3], a - ld hl, $d7b4 + ld [wd7b3], a + ld hl, wd7b4 set 0, [hl] jp SaffronGymText_5d048 @@ -94,7 +94,7 @@ SaffronGymTrainerHeaders: ; 5d0c3 (17:50c3) SaffronGymTrainerHeader0: ; 5d0c3 (17:50c3) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7b3 ; flag's byte + dw wd7b3 ; flag's byte dw SaffronGymBattleText1 ; 0x51f0 TextBeforeBattle dw SaffronGymAfterBattleText1 ; 0x51fa TextAfterBattle dw SaffronGymEndBattleText1 ; 0x51f5 TextEndBattle @@ -103,7 +103,7 @@ SaffronGymTrainerHeader0: ; 5d0c3 (17:50c3) SaffronGymTrainerHeader1: ; 5d0cf (17:50cf) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7b3 ; flag's byte + dw wd7b3 ; flag's byte dw SaffronGymBattleText2 ; 0x51ff TextBeforeBattle dw SaffronGymAfterBattleText2 ; 0x5209 TextAfterBattle dw SaffronGymEndBattleText2 ; 0x5204 TextEndBattle @@ -112,7 +112,7 @@ SaffronGymTrainerHeader1: ; 5d0cf (17:50cf) SaffronGymTrainerHeader2: ; 5d0db (17:50db) db $4 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7b3 ; flag's byte + dw wd7b3 ; flag's byte dw SaffronGymBattleText3 ; 0x520e TextBeforeBattle dw SaffronGymAfterBattleText3 ; 0x5218 TextAfterBattle dw SaffronGymEndBattleText3 ; 0x5213 TextEndBattle @@ -121,7 +121,7 @@ SaffronGymTrainerHeader2: ; 5d0db (17:50db) SaffronGymTrainerHeader3: ; 5d0e7 (17:50e7) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7b3 ; flag's byte + dw wd7b3 ; flag's byte dw SaffronGymBattleText4 ; 0x521d TextBeforeBattle dw SaffronGymAfterBattleText4 ; 0x5227 TextAfterBattle dw SaffronGymEndBattleText4 ; 0x5222 TextEndBattle @@ -130,7 +130,7 @@ SaffronGymTrainerHeader3: ; 5d0e7 (17:50e7) SaffronGymTrainerHeader4: ; 5d0f3 (17:50f3) db $6 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7b3 ; flag's byte + dw wd7b3 ; flag's byte dw SaffronGymBattleText5 ; 0x522c TextBeforeBattle dw SaffronGymAfterBattleText5 ; 0x5236 TextAfterBattle dw SaffronGymEndBattleText5 ; 0x5231 TextEndBattle @@ -139,7 +139,7 @@ SaffronGymTrainerHeader4: ; 5d0f3 (17:50f3) SaffronGymTrainerHeader5: ; 5d0ff (17:50ff) db $7 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7b3 ; flag's byte + dw wd7b3 ; flag's byte dw SaffronGymBattleText6 ; 0x523b TextBeforeBattle dw SaffronGymAfterBattleText6 ; 0x5245 TextAfterBattle dw SaffronGymEndBattleText6 ; 0x5240 TextEndBattle @@ -148,7 +148,7 @@ SaffronGymTrainerHeader5: ; 5d0ff (17:50ff) SaffronGymTrainerHeader6: ; 5d10b (17:510b) db $8 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7b3 ; flag's byte + dw wd7b3 ; flag's byte dw SaffronGymBattleText7 ; 0x524a TextBeforeBattle dw SaffronGymAfterBattleText7 ; 0x5254 TextAfterBattle dw SaffronGymEndBattleText7 ; 0x524f TextEndBattle @@ -158,7 +158,7 @@ SaffronGymTrainerHeader6: ; 5d10b (17:510b) SaffronGymText1: ; 5d118 (17:5118) db $08 ; asm - ld a, [$d7b3] + ld a, [wd7b3] bit 1, a jr z, .asm_e3544 ; 0x5d11e bit 0, a @@ -173,18 +173,18 @@ SaffronGymText1: ; 5d118 (17:5118) .asm_e3544 ; 0x5d134 ld hl, SaffronGymText_5d162 call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, SaffronGymText_5d167 ld de, SaffronGymText_5d167 call PreBattleSaveRegisters ldh a, [$8c] - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters ld a, $6 - ld [$d05c], a + ld [W_GYMLEADERNO], a ld a, $3 ld [W_SAFFRONGYMCURSCRIPT], a .asm_34c2c ; 0x5d15f @@ -262,7 +262,7 @@ SaffronGymText8: ; 5d1c3 (17:51c3) SaffronGymText9: ; 5d1cd (17:51cd) db $08 ; asm - ld a, [$d7b3] + ld a, [wd7b3] bit 1, a jr nz, .asm_13f3c ; 0x5d1d3 ld hl, SaffronGymText_5d1e6 diff --git a/scripts/saffronhouse2.asm b/scripts/saffronhouse2.asm index a48ec3f6..727fd981 100755 --- a/scripts/saffronhouse2.asm +++ b/scripts/saffronhouse2.asm @@ -6,7 +6,7 @@ SaffronHouse2TextPointers: ; 1de3f (7:5e3f) SaffronHouse2Text1: ; 1de41 (7:5e41) db $08 ; asm - ld a, [$d7bd] + ld a, [wd7bd] bit 0, a jr nz, .asm_9e72b ; 0x1de47 ld hl, TM29PreReceiveText @@ -16,7 +16,7 @@ SaffronHouse2Text1: ; 1de41 (7:5e41) jr nc, .BagFull ld hl, ReceivedTM29Text call PrintText - ld hl, $d7bd + ld hl, wd7bd set 0, [hl] jr .asm_fe4e1 ; 0x1de62 .BagFull diff --git a/scripts/seafoamislands1.asm b/scripts/seafoamislands1.asm index 3d20a653..55bbd43e 100755 --- a/scripts/seafoamislands1.asm +++ b/scripts/seafoamislands1.asm @@ -1,6 +1,6 @@ SeafoamIslands1Script: ; 447e9 (11:47e9) call EnableAutoTextBoxDrawing - ld hl, $d7e7 + ld hl, wd7e7 set 0, [hl] ld hl, wFlags_0xcd60 bit 7, [hl] @@ -9,34 +9,32 @@ SeafoamIslands1Script: ; 447e9 (11:47e9) ld hl, Seafoam1HolesCoords call CheckBoulderCoords ret nc - ld hl, $d7e8 - ld a, [$cd3d] + ld hl, wd7e8 + ld a, [wWhichTrade] cp $1 jr nz, .asm_44819 ; 0x44809 $e set 6, [hl] ld a, $d7 - ld [$d079], a + ld [wd079], a ld a, $d9 - ld [$d07a], a + ld [wd07a], a jr .asm_44825 ; 0x44817 $c .asm_44819 set 7, [hl] ld a, $d8 - ld [$d079], a + ld [wd079], a ld a, $da - ld [$d07a], a + ld [wd07a], a .asm_44825 - ld a, [$d079] - ld [$cc4d], a - ld a, $11 - call Predef - ld a, [$d07a] - ld [$cc4d], a - ld a, $15 - jp Predef + ld a, [wd079] + ld [wcc4d], a + predef HideObject + ld a, [wd07a] + ld [wcc4d], a + predef_jump ShowObject .asm_4483b ld a, $9f - ld [$d71d], a + ld [wd71d], a ld hl, Seafoam1HolesCoords jp Func_46981 diff --git a/scripts/seafoamislands2.asm b/scripts/seafoamislands2.asm index a20bf497..b14c16d8 100755 --- a/scripts/seafoamislands2.asm +++ b/scripts/seafoamislands2.asm @@ -7,34 +7,32 @@ SeafoamIslands2Script: ; 46315 (11:6315) ld hl, Seafoam2HolesCoords call CheckBoulderCoords ret nc - ld hl, $d87f - ld a, [$cd3d] + ld hl, wd87f + ld a, [wWhichTrade] cp $1 jr nz, .asm_46340 ; 0x46330 $e set 0, [hl] ld a, $d9 - ld [$d079], a + ld [wd079], a ld a, $db - ld [$d07a], a + ld [wd07a], a jr .asm_4634c ; 0x4633e $c .asm_46340 set 1, [hl] ld a, $da - ld [$d079], a + ld [wd079], a ld a, $dc - ld [$d07a], a + ld [wd07a], a .asm_4634c - ld a, [$d079] - ld [$cc4d], a - ld a, $11 - call Predef - ld a, [$d07a] - ld [$cc4d], a - ld a, $15 - jp Predef + ld a, [wd079] + ld [wcc4d], a + predef HideObject + ld a, [wd07a] + ld [wcc4d], a + predef_jump ShowObject .asm_46362 ld a, $a0 - ld [$d71d], a + ld [wd71d], a ld hl, Seafoam2HolesCoords jp Func_46981 diff --git a/scripts/seafoamislands3.asm b/scripts/seafoamislands3.asm index a6e00936..aa7b3615 100755 --- a/scripts/seafoamislands3.asm +++ b/scripts/seafoamislands3.asm @@ -7,34 +7,32 @@ SeafoamIslands3Script: ; 46451 (11:6451) ld hl, Seafoam3HolesCoords call CheckBoulderCoords ret nc - ld hl, $d880 - ld a, [$cd3d] + ld hl, wd880 + ld a, [wWhichTrade] cp $1 jr nz, .asm_4647c ; 0x4646c $e set 0, [hl] ld a, $db - ld [$d079], a + ld [wd079], a ld a, $df - ld [$d07a], a + ld [wd07a], a jr .asm_46488 ; 0x4647a $c .asm_4647c set 1, [hl] ld a, $dc - ld [$d079], a + ld [wd079], a ld a, $e0 - ld [$d07a], a + ld [wd07a], a .asm_46488 - ld a, [$d079] - ld [$cc4d], a - ld a, $11 - call Predef - ld a, [$d07a] - ld [$cc4d], a - ld a, $15 - jp Predef + ld a, [wd079] + ld [wcc4d], a + predef HideObject + ld a, [wd07a] + ld [wcc4d], a + predef_jump ShowObject .asm_4649e ld a, $a1 - ld [$d71d], a + ld [wd71d], a ld hl, Seafoam3HolesCoords jp Func_46981 diff --git a/scripts/seafoamislands4.asm b/scripts/seafoamislands4.asm index c7be0f44..ac573994 100755 --- a/scripts/seafoamislands4.asm +++ b/scripts/seafoamislands4.asm @@ -7,38 +7,36 @@ SeafoamIslands4Script: ; 4658d (11:658d) ld hl, Seafoam4HolesCoords call CheckBoulderCoords ret nc - ld hl, $d881 - ld a, [$cd3d] + ld hl, wd881 + ld a, [wWhichTrade] cp $1 jr nz, .asm_465b8 ; 0x465a8 $e set 0, [hl] ld a, $dd - ld [$d079], a + ld [wd079], a ld a, $e1 - ld [$d07a], a + ld [wd07a], a jr .asm_465c4 ; 0x465b6 $c .asm_465b8 set 1, [hl] ld a, $de - ld [$d079], a + ld [wd079], a ld a, $e2 - ld [$d07a], a + ld [wd07a], a .asm_465c4 - ld a, [$d079] - ld [$cc4d], a - ld a, $11 - call Predef - ld a, [$d07a] - ld [$cc4d], a - ld a, $15 - call Predef + ld a, [wd079] + ld [wcc4d], a + predef HideObject + ld a, [wd07a] + ld [wcc4d], a + predef ShowObject jr .asm_465ed ; 0x465da $11 .asm_465dc ld a, $a2 - ld [$d71d], a + ld [wd71d], a ld hl, Seafoam4HolesCoords call Func_46981 - ld a, [$d732] + ld a, [wd732] bit 4, a ret nz .asm_465ed @@ -58,7 +56,7 @@ SeafoamIslands4ScriptPointers: ; 465fb (11:65fb) dw SeafoamIslands4Script3 SeafoamIslands4Script0: ; 46603 (11:6603) - ld a, [$d880] + ld a, [wd880] and $3 cp $3 ret z @@ -68,11 +66,11 @@ SeafoamIslands4Script0: ; 46603 (11:6603) ld a, [W_XCOORD] cp $f ret nz - ld hl, $ccd3 + ld hl, wccd3 ld de, RLEMovement46632 call DecodeRLEList dec a - ld [$cd38], a + ld [wcd38], a call Func_3486 ld hl, W_FLAGS_D733 set 2, [hl] @@ -87,7 +85,7 @@ RLEMovement46632: ; 46632 (11:6632) db $ff SeafoamIslands4Script1: ; 46639 (11:6639) - ld a, [$cd38] + ld a, [wcd38] and a ret nz ld a, $0 @@ -95,7 +93,7 @@ SeafoamIslands4Script1: ; 46639 (11:6639) ret SeafoamIslands4Script2: ; 46644 (11:6644) - ld a, [$d880] + ld a, [wd880] and $3 cp $3 ret z @@ -110,13 +108,13 @@ SeafoamIslands4Script2: ; 46644 (11:6644) .asm_4665e ld de, RLEData_46688 .asm_46661 - ld hl, $ccd3 + ld hl, wccd3 call DecodeRLEList dec a - ld [$cd38], a + ld [wcd38], a xor a - ld [$c206], a - ld hl, $d730 + ld [wSpriteStateData2 + $06], a + ld hl, wd730 set 7, [hl] ld hl, W_FLAGS_D733 set 2, [hl] @@ -132,7 +130,7 @@ RLEData_46688: ; 46688 (11:6688) db $80,$06,$10,$02,$80,$04,$FF SeafoamIslands4Script3: ; 4668f (11:668f) - ld a, [$cd38] + ld a, [wcd38] and a ret nz ld a, $0 diff --git a/scripts/seafoamislands5.asm b/scripts/seafoamislands5.asm index 153a1bb6..bea63321 100755 --- a/scripts/seafoamislands5.asm +++ b/scripts/seafoamislands5.asm @@ -7,7 +7,7 @@ SeafoamIslands5Script: ; 46799 (11:6799) SeafoamIslands5Script_467a5: ; 467a5 (11:67a5) xor a ld [W_SEAFOAMISLANDS5CURSCRIPT], a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ret SeafoamIslands5ScriptPointers: ; 467ad (11:67ad) @@ -27,26 +27,26 @@ SeafoamIslands5Script4: ; 467b7 (11:67b7) ret SeafoamIslands5Script0: ; 467c7 (11:67c7) - ld a, [$d880] + ld a, [wd880] and $3 cp $3 ret z ld hl, CoordsData_467fe call ArePlayerCoordsInArray ret nc - ld a, [$cd3d] + ld a, [wWhichTrade] cp $3 jr nc, .asm_467e6 ld a, $40 - ld [$ccd4], a + ld [wccd4], a ld a, $2 jr .asm_467e8 .asm_467e6 ld a, $1 .asm_467e8 - ld [$cd38], a + ld [wcd38], a ld a, $40 - ld [$ccd3], a + ld [wccd3], a call Func_3486 ld hl, W_FLAGS_D733 res 2, [hl] @@ -62,17 +62,17 @@ CoordsData_467fe: ; 467fe (11:67fe) db $FF SeafoamIslands5Script1: ; 46807 (11:6807) - ld a, [$cd38] + ld a, [wcd38] and a ret nz xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $0 ld [W_SEAFOAMISLANDS5CURSCRIPT], a ret SeafoamIslands5Script2: ; 46816 (11:6816) - ld a, [$d881] + ld a, [wd881] and $3 cp $3 ld a, $0 @@ -81,7 +81,7 @@ SeafoamIslands5Script2: ; 46816 (11:6816) call ArePlayerCoordsInArray ld a, $0 jr nc, .asm_46849 - ld a, [$cd3d] + ld a, [wWhichTrade] cp $1 jr nz, .asm_46837 ld de, RLEMovementData_46859 @@ -89,10 +89,10 @@ SeafoamIslands5Script2: ; 46816 (11:6816) .asm_46837 ld de, RLEMovementData_46852 .asm_4683a - ld hl, $ccd3 + ld hl, wccd3 call DecodeRLEList dec a - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $3 .asm_46849 @@ -117,7 +117,7 @@ RLEMovementData_46859: ; 46859 (11:6859) db $FF SeafoamIslands5Script3: ; 46860 (11:6860) - ld a, [$cd38] + ld a, [wcd38] ld b, a cp $1 call z, SeaFoamIslands5Script_46872 @@ -130,8 +130,8 @@ SeafoamIslands5Script3: ; 46860 (11:6860) SeaFoamIslands5Script_46872: ; 46872 (11:6872) xor a - ld [$d700], a - ld [$d11a], a + ld [wd700], a + ld [wd11a], a jp ForceBikeOrSurf SeafoamIslands5TextPointers: ; 4687c (11:687c) @@ -145,7 +145,7 @@ SeafoamIslands5TrainerHeaders: ; 46886 (11:6886) SeafoamIslands5TrainerHeader0: ; 46886 (11:6886) db $2 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d882 ; flag's byte + dw wd882 ; flag's byte dw SeafoamIslands5BattleText2 ; 0x68a2 TextBeforeBattle dw SeafoamIslands5BattleText2 ; 0x68a2 TextAfterBattle dw SeafoamIslands5BattleText2 ; 0x68a2 TextEndBattle diff --git a/scripts/silphco1.asm b/scripts/silphco1.asm index 64f93cdc..990e5c2a 100755 --- a/scripts/silphco1.asm +++ b/scripts/silphco1.asm @@ -1,16 +1,15 @@ SilphCo1Script: ; 5d44e (17:544e) call EnableAutoTextBoxDrawing - ld a, [$d838] + ld a, [wd838] bit 7, a ret z - ld hl, $d7b9 + ld hl, wd7b9 bit 7, [hl] set 7, [hl] ret nz ld a, $4c - ld [$cc4d], a - ld a, $15 - jp Predef + ld [wcc4d], a + predef_jump ShowObject SilphCo1TextPointers: ; 5d469 (17:5469) dw SilphCo1Text1 diff --git a/scripts/silphco10.asm b/scripts/silphco10.asm index ede60acc..c831655f 100755 --- a/scripts/silphco10.asm +++ b/scripts/silphco10.asm @@ -9,21 +9,20 @@ SilphCo10Script: ; 5a139 (16:6139) ret SilphCo10Script_5a14f: ; 5a14f (16:614f) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z ld hl, DataTable_5a173 ; $6173 call SilphCo2Script_59d43 call SilphCo10Text_5a176 - ld a, [$d836] + ld a, [wd836] bit 0, a ret nz ld a, $54 - ld [$d09f], a + ld [wd09f], a ld bc, $405 - ld a, $17 - jp Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef_jump Func_ee9e DataTable_5a173: ; 5a173 (16:6173) db $04,$05,$FF @@ -32,7 +31,7 @@ SilphCo10Text_5a176: ; 5a176 (16:6176) ld a, [$ffe0] and a ret z - ld hl, $d836 + ld hl, wd836 set 0, [hl] ret @@ -53,7 +52,7 @@ SilphCo10TrainerHeaders: ; 5a192 (16:6192) SilphCo10TrainerHeader0: ; 5a192 (16:6192) db $1 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d835 ; flag's byte + dw wd835 ; flag's byte dw SilphCo10BattleText1 ; 0x61dd TextBeforeBattle dw SilphCo10AfterBattleText1 ; 0x61e7 TextAfterBattle dw SilphCo10EndBattleText1 ; 0x61e2 TextEndBattle @@ -62,7 +61,7 @@ SilphCo10TrainerHeader0: ; 5a192 (16:6192) SilphCo10TrainerHeader1: ; 5a19e (16:619e) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d835 ; flag's byte + dw wd835 ; flag's byte dw SilphCo10BattleText2 ; 0x61ec TextBeforeBattle dw SilphCo10AfterBattleText2 ; 0x61f6 TextAfterBattle dw SilphCo10EndBattleText2 ; 0x61f1 TextEndBattle @@ -84,7 +83,7 @@ SilphCo10Text2: ; 5a1b5 (16:61b5) SilphCo10Text3: ; 5a1bf (16:61bf) db $08 ; asm - ld a, [$d838] + ld a, [wd838] bit 7, a ld hl, SilphCo10Text_5a1d8 jr nz, .asm_cf85f diff --git a/scripts/silphco11.asm b/scripts/silphco11.asm index f24c6774..b63bc523 100755 --- a/scripts/silphco11.asm +++ b/scripts/silphco11.asm @@ -9,28 +9,27 @@ SilphCo11Script: ; 620fa (18:60fa) ret SilphCo11Script_62110: ; 62110 (18:6110) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z ld hl, DataTable_62134 ; $6134 call SilphCo11Script_62137 call SilphCo11Script_62163 - ld a, [$d838] + ld a, [wd838] bit 0, a ret nz ld a, $20 - ld [$d09f], a + ld [wd09f], a ld bc, $603 - ld a, $17 - jp Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef_jump Func_ee9e DataTable_62134: ; 62134 (18:6134) db $06,$03,$FF SilphCo11Script_62137: ; 62137 (18:6137) push hl - ld hl, $d73f + ld hl, wd73f ld a, [hli] ld b, a ld a, [hl] @@ -54,7 +53,7 @@ SilphCo11Script_62137: ; 62137 (18:6137) ld a, [hli] cp c jr nz, .asm_62143 - ld hl, $d73f + ld hl, wd73f xor a ld [hli], a ld [hl], a @@ -68,7 +67,7 @@ SilphCo11Script_62163: ; 62163 (18:6163) ld a, [$ffe0] and a ret z - ld hl, $d838 + ld hl, wd838 set 0, [hl] ret @@ -79,9 +78,8 @@ SilphCo11Script_6216d: ; 6216d (18:616d) cp $ff jr z, .asm_62181 push hl - ld [$cc4d], a - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a + predef HideObject pop hl jr .asm_62170 .asm_62181 @@ -91,9 +89,8 @@ SilphCo11Script_6216d: ; 6216d (18:616d) cp $ff ret z push hl - ld [$cc4d], a - ld a, $15 - call Predef ; indirect jump to AddMissableObject (f1c8 (3:71c8)) + ld [wcc4d], a + predef ShowObject pop hl jr .asm_62184 @@ -110,7 +107,7 @@ MissableObjectIDs_6219b: ; 6219b (18:619b) SilphCo11Script_621c4: ; 621c4 (18:61c4) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a SilphCo11Script_621c8: ; 621c8 (18:61c8) ld [W_SILPHCO11CURSCRIPT], a @@ -126,18 +123,18 @@ SilphCo11ScriptPointers: ; 621cf (18:61cf) dw SilphCo11Script5 SilphCo11Script0: ; 621db (18:61db) - ld a, [$d838] + ld a, [wd838] bit 7, a ret nz ld hl, CoordsData_62211 ; $6211 call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers - ld a, [wWhichTrade] ; $cd3d - ld [$cf0d], a + ld a, [wWhichTrade] ; wWhichTrade + ld [wcf0d], a xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $3 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID @@ -158,7 +155,7 @@ MovementData_62216: ; 62216 (18:6216) db $00,$00,$00,$FF SilphCo11Script_6221a: ; 6221a (18:621a) - ld [$d528], a + ld [wd528], a ld a, $3 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c ld a, b @@ -166,10 +163,10 @@ SilphCo11Script_6221a: ; 6221a (18:621a) jp Func_34a6 SilphCo11Script5: ; 62227 (18:6227) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, SilphCo11Script_621c4 - ld a, [$cf0d] + ld a, [wcf0d] cp $1 jr z, .asm_6223c ld a, $2 @@ -181,7 +178,7 @@ SilphCo11Script5: ; 62227 (18:6227) .asm_62240 call SilphCo11Script_6221a ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $6 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID @@ -190,20 +187,20 @@ SilphCo11Script5: ; 62227 (18:6227) call UpdateSprites call Delay3 call GBFadeOut1 - ld hl, $d838 + ld hl, wd838 set 7, [hl] xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a jp SilphCo11Script_621c8 SilphCo11Script3: ; 6226a (18:626a) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz ld a, $3 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call SetSpriteMovementBytesToFF - ld a, [$cf0d] + ld a, [wcf0d] cp $1 jr z, .asm_62284 ld a, $2 @@ -219,18 +216,18 @@ SilphCo11Script3: ; 6226a (18:626a) jp SilphCo11Script_621c8 SilphCo11Script4: ; 62293 (18:6293) - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, SilphCo10Text_62330 ; $6330 ld de, SilphCo10Text_62330 ; $6330 call PreBattleSaveRegisters ld a, [H_DOWNARROWBLINKCNT2] ; $ff8c - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $5 jp SilphCo11Script_621c8 @@ -246,7 +243,7 @@ SilphCo11TrainerHeaders: ; 622c3 (18:62c3) SilphCo11TrainerHeader0: ; 622c3 (18:62c3) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d837 ; flag's byte + dw wd837 ; flag's byte dw SilphCo11BattleText1 ; 0x6344 TextBeforeBattle dw SilphCo11AfterBattleText1 ; 0x634e TextAfterBattle dw SilphCo11EndBattleText1 ; 0x6349 TextEndBattle @@ -255,7 +252,7 @@ SilphCo11TrainerHeader0: ; 622c3 (18:62c3) SilphCo11TrainerHeader1: ; 622cf (18:62cf) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d837 ; flag's byte + dw wd837 ; flag's byte dw SilphCo11BattleText2 ; 0x635d TextBeforeBattle dw SilphCo11AfterBattleText2 ; 0x6367 TextAfterBattle dw SilphCo11EndBattleText2 ; 0x6362 TextEndBattle @@ -265,7 +262,7 @@ SilphCo11TrainerHeader1: ; 622cf (18:62cf) SilphCo11Text1: ; 622dc (18:62dc) db $08 ; asm - ld a, [$d838] + ld a, [wd838] bit 5, a jp nz, .asm_62308 ld hl, SilphCoPresidentText @@ -275,7 +272,7 @@ SilphCo11Text1: ; 622dc (18:62dc) jr nc, .BagFull ld hl, ReceivedSilphCoMasterBallText call PrintText - ld hl, $d838 + ld hl, wd838 set 5, [hl] jr .asm_fd405 ; 0x622fe .BagFull diff --git a/scripts/silphco2.asm b/scripts/silphco2.asm index da59cc4c..20d689e6 100755 --- a/scripts/silphco2.asm +++ b/scripts/silphco2.asm @@ -9,38 +9,36 @@ SilphCo2Script: ; 59cf1 (16:5cf1) ret SilphCo2Script_59d07: ; 59d07 (16:5d07) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z ld hl, DataTable_59d3e call SilphCo2Script_59d43 call SilphCo2Script_59d6f - ld a, [$d826] + ld a, [wd826] bit 5, a jr nz, .asm_59d2e push af ld a, $54 - ld [$d09f], a + ld [wd09f], a ld bc, $0202 - ld a, $17 - call Predef + predef Func_ee9e pop af .asm_59d2e bit 6, a ret nz ld a, $54 - ld [$d09f], a + ld [wd09f], a ld bc, $0502 - ld a, $17 - jp Predef + predef_jump Func_ee9e DataTable_59d3e: ; 59d3e (16:5d3e) db $02,$02,$05,$02,$FF SilphCo2Script_59d43: ; 59d43 (16:5d43) push hl - ld hl, $d73f + ld hl, wd73f ld a, [hli] ld b, a ld a, [hl] @@ -64,7 +62,7 @@ SilphCo2Script_59d43: ; 59d43 (16:5d43) ld a, [hli] cp c jr nz, .asm_59d4f - ld hl, $d73f + ld hl, wd73f xor a ld [hli], a ld [hl], a @@ -75,7 +73,7 @@ SilphCo2Script_59d43: ; 59d43 (16:5d43) ret SilphCo2Script_59d6f: ; 59d6f (16:5d6f) - ld hl, $d826 + ld hl, wd826 ld a, [$ffe0] and a ret z @@ -103,7 +101,7 @@ SilphCo2TrainerHeaders: ; 59d90 (16:5d90) SilphCo2TrainerHeader0: ; 59d90 (16:5d90) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d825 ; flag's byte + dw wd825 ; flag's byte dw SilphCo2BattleText1 ; 0x5e2a TextBeforeBattle dw SilphCo2AfterBattleText1 ; 0x5e34 TextAfterBattle dw SilphCo2EndBattleText1 ; 0x5e2f TextEndBattle @@ -112,7 +110,7 @@ SilphCo2TrainerHeader0: ; 59d90 (16:5d90) SilphCo2TrainerHeader1: ; 59d9c (16:5d9c) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d825 ; flag's byte + dw wd825 ; flag's byte dw SilphCo2BattleText2 ; 0x5e39 TextBeforeBattle dw SilphCo2AfterBattleText2 ; 0x5e43 TextAfterBattle dw SilphCo2EndBattleText2 ; 0x5e3e TextEndBattle @@ -121,7 +119,7 @@ SilphCo2TrainerHeader1: ; 59d9c (16:5d9c) SilphCo2TrainerHeader2: ; 59da8 (16:5da8) db $4 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d825 ; flag's byte + dw wd825 ; flag's byte dw SilphCo2BattleText3 ; 0x5e48 TextBeforeBattle dw SilphCo2AfterBattleText3 ; 0x5e52 TextAfterBattle dw SilphCo2EndBattleText3 ; 0x5e4d TextEndBattle @@ -130,7 +128,7 @@ SilphCo2TrainerHeader2: ; 59da8 (16:5da8) SilphCo2TrainerHeader3: ; 59db4 (16:5db4) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d825 ; flag's byte + dw wd825 ; flag's byte dw SilphCo2BattleText4 ; 0x5e57 TextBeforeBattle dw SilphCo2AfterBattleText4 ; 0x5e61 TextAfterBattle dw SilphCo2EndBattleText4 ; 0x5e5c TextEndBattle @@ -140,7 +138,7 @@ SilphCo2TrainerHeader3: ; 59db4 (16:5db4) SilphCo2Text1: ; 59dc1 (16:5dc1) db $08 ; asm - ld a, [$d826] + ld a, [wd826] bit 7, a jr nz, asm_b8a0d ; 0x59dc7 ld hl, SilphCo2Text_59ded @@ -149,7 +147,7 @@ SilphCo2Text1: ; 59dc1 (16:5dc1) call GiveItem ld hl, TM36NoRoomText jr nc, asm_2c1e0 ; 0x59dd8 - ld hl, $d826 + ld hl, wd826 set 7, [hl] ld hl, ReceivedTM36Text jr asm_2c1e0 ; 0x59de2 diff --git a/scripts/silphco3.asm b/scripts/silphco3.asm index a7ba1bee..5527d923 100755 --- a/scripts/silphco3.asm +++ b/scripts/silphco3.asm @@ -9,37 +9,35 @@ SilphCo3Script: ; 59f5b (16:5f5b) ret SilphCo3Script_59f71: ; 59f71 (16:5f71) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z ld hl, DataTable_59fa8 ; $5fa8 call SilphCo2Script_59d43 call SilphCo3Script_59fad - ld a, [$d828] + ld a, [wd828] bit 0, a jr nz, .asm_59f98 push af ld a, $5f - ld [$d09f], a + ld [wd09f], a ld bc, $404 - ld a, $17 - call Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef Func_ee9e pop af .asm_59f98 bit 1, a ret nz ld a, $5f - ld [$d09f], a + ld [wd09f], a ld bc, $408 - ld a, $17 - jp Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef_jump Func_ee9e DataTable_59fa8: ; 59fa8 (16:5fa8) db $04,$04,$04,$08,$FF SilphCo3Script_59fad: ; 59fad (16:5fad) - ld hl, $d828 + ld hl, wd828 ld a, [$ffe0] and a ret z @@ -66,7 +64,7 @@ SilphCo3TrainerHeaders: ; 59fcc (16:5fcc) SilphCo3TrainerHeader0: ; 59fcc (16:5fcc) db $2 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d827 ; flag's byte + dw wd827 ; flag's byte dw SilphCo3BattleText1 ; 0x600d TextBeforeBattle dw SilphCo3AfterBattleText1 ; 0x6017 TextAfterBattle dw SilphCo3EndBattleText1 ; 0x6012 TextEndBattle @@ -75,7 +73,7 @@ SilphCo3TrainerHeader0: ; 59fcc (16:5fcc) SilphCo3TrainerHeader1: ; 59fd8 (16:5fd8) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d827 ; flag's byte + dw wd827 ; flag's byte dw SilphCo3BattleText2 ; 0x6026 TextBeforeBattle dw SilphCo3AfterBattleText2 ; 0x6030 TextAfterBattle dw SilphCo3EndBattleText2 ; 0x602b TextEndBattle @@ -85,7 +83,7 @@ SilphCo3TrainerHeader1: ; 59fd8 (16:5fd8) SilphCo3Text1: ; 59fe5 (16:5fe5) db $08 ; asm - ld a, [$d838] + ld a, [wd838] bit 7, a ld hl, SilphCo3Text_59ffe jr nz, asm_8c56f ; 0x59fee diff --git a/scripts/silphco4.asm b/scripts/silphco4.asm index 1777ff8c..718077ce 100755 --- a/scripts/silphco4.asm +++ b/scripts/silphco4.asm @@ -9,38 +9,36 @@ SilphCo4Script: ; 19d0b (6:5d0b) ret SilphCo4Script_19d21: ; 19d21 (6:5d21) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z ld hl, SilphCo4Data19d58 call SilphCo4Script_19d5d call SilphCo4Script_19d89 - ld a, [$d82a] + ld a, [wd82a] bit 0, a jr nz, .asm_19d48 push af ld a, $54 - ld [$d09f], a + ld [wd09f], a ld bc, $0602 - ld a, $17 - call Predef + predef Func_ee9e pop af .asm_19d48 bit 1, a ret nz ld a, $54 - ld [$d09f], a + ld [wd09f], a ld bc, $0406 - ld a, $17 - jp Predef + predef_jump Func_ee9e SilphCo4Data19d58: ; 19d58 (6:5d58) db $06, $02, $04, $06, $ff SilphCo4Script_19d5d: ; 19d5d (6:5d5d) push hl - ld hl, $d73f + ld hl, wd73f ld a, [hli] ld b, a ld a, [hl] @@ -64,7 +62,7 @@ SilphCo4Script_19d5d: ; 19d5d (6:5d5d) ld a, [hli] cp c jr nz, .asm_19d69 ; 0x19d7c $eb - ld hl, $d73f + ld hl, wd73f xor a ld [hli], a ld [hl], a @@ -75,7 +73,7 @@ SilphCo4Script_19d5d: ; 19d5d (6:5d5d) ret SilphCo4Script_19d89: ; 19d89 (6:5d89) - ld hl, $d82a + ld hl, wd82a ld a, [$ffe0] and a ret z @@ -105,7 +103,7 @@ SilphCo4TrainerHeaders: ; 19dae (6:5dae) SilphCo4TrainerHeader0: ; 19dae (6:5dae) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d829 ; flag's byte + dw wd829 ; flag's byte dw SilphCo4BattleText2 ; 0x5df4 TextBeforeBattle dw SilphCo4AfterBattleText2 ; 0x5dfe TextAfterBattle dw SilphCo4EndBattleText2 ; 0x5df9 TextEndBattle @@ -114,7 +112,7 @@ SilphCo4TrainerHeader0: ; 19dae (6:5dae) SilphCo4TrainerHeader2: ; 19dba (6:5dba) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d829 ; flag's byte + dw wd829 ; flag's byte dw SilphCo4BattleText3 ; 0x5e0d TextBeforeBattle dw SilphCo4AfterBattleText3 ; 0x5e17 TextAfterBattle dw SilphCo4EndBattleText3 ; 0x5e12 TextEndBattle @@ -123,7 +121,7 @@ SilphCo4TrainerHeader2: ; 19dba (6:5dba) SilphCo4TrainerHeader3: ; 19dc6 (6:5dc6) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d829 ; flag's byte + dw wd829 ; flag's byte dw SilphCo4BattleText4 ; 0x5e26 TextBeforeBattle dw SilphCo4AfterBattleText4 ; 0x5e30 TextAfterBattle dw SilphCo4EndBattleText4 ; 0x5e2b TextEndBattle diff --git a/scripts/silphco5.asm b/scripts/silphco5.asm index c4efc16b..709af20b 100755 --- a/scripts/silphco5.asm +++ b/scripts/silphco5.asm @@ -9,47 +9,44 @@ SilphCo5Script: ; 19f37 (6:5f37) ret SilphCo5Script_19f4d: ; 19f4d (6:5f4d) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z ld hl, SilphCo5Coords call SilphCo4Script_19d5d call SilphCo5Script_19f9e - ld a, [$d82c] + ld a, [wd82c] bit 0, a jr nz, .asm_19f74 ; 0x19f63 $f push af ld a, $5f - ld [$d09f], a + ld [wd09f], a ld bc, $0203 - ld a, $17 - call Predef + predef Func_ee9e pop af .asm_19f74 bit 1, a jr nz, .asm_19f87 ; 0x19f76 $f push af ld a, $5f - ld [$d09f], a + ld [wd09f], a ld bc, $0603 - ld a, $17 - call Predef + predef Func_ee9e pop af .asm_19f87 bit 2, a ret nz ld a, $5f - ld [$d09f], a + ld [wd09f], a ld bc, $0507 - ld a, $17 - jp Predef + predef_jump Func_ee9e SilphCo5Coords: ; 19f97 (6:5f97) ; coords? db $02, $03, $06, $03, $05, $07, $ff SilphCo5Script_19f9e: ; 19f9e (6:5f9e) - ld hl, $d82c + ld hl, wd82c ld a, [$ffe0] and a ret z @@ -88,7 +85,7 @@ SilphCo5TrainerHeaders: ; 19fd2 (6:5fd2) Silphco5TrainerHeader0: ; 19fd2 (6:5fd2) db $2 ; flag's bit db ($1 << 4) ; trainer's view range - dw $d82b ; flag's byte + dw wd82b ; flag's byte dw SilphCo5BattleText2 ; 0x6024 TextBeforeBattle dw SilphCo5AfterBattleText2 ; 0x602e TextAfterBattle dw SilphCo5EndBattleText2 ; 0x6029 TextEndBattle @@ -97,7 +94,7 @@ Silphco5TrainerHeader0: ; 19fd2 (6:5fd2) Silphco5TrainerHeader2: ; 19fde (6:5fde) db $3 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d82b ; flag's byte + dw wd82b ; flag's byte dw SilphCo5BattleText3 ; 0x603d TextBeforeBattle dw SilphCo5AfterBattleText3 ; 0x6047 TextAfterBattle dw SilphCo5EndBattleText3 ; 0x6042 TextEndBattle @@ -106,7 +103,7 @@ Silphco5TrainerHeader2: ; 19fde (6:5fde) Silphco5TrainerHeader3: ; 19fea (6:5fea) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d82b ; flag's byte + dw wd82b ; flag's byte dw SilphCo5BattleText4 ; 0x6056 TextBeforeBattle dw SilphCo5AfterBattleText4 ; 0x6060 TextAfterBattle dw SilphCo5EndBattleText4 ; 0x605b TextEndBattle @@ -115,7 +112,7 @@ Silphco5TrainerHeader3: ; 19fea (6:5fea) Silphco5TrainerHeader4: ; 19ff6 (6:5ff6) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d82b ; flag's byte + dw wd82b ; flag's byte dw SilphCo5BattleText5 ; 0x606f TextBeforeBattle dw SilphCo5AfterBattleText5 ; 0x6079 TextAfterBattle dw SilphCo5EndBattleText5 ; 0x6074 TextEndBattle diff --git a/scripts/silphco6.asm b/scripts/silphco6.asm index 2b5b7ebf..4a9477c6 100755 --- a/scripts/silphco6.asm +++ b/scripts/silphco6.asm @@ -9,21 +9,20 @@ SilphCo6Script: ; 1a1a9 (6:61a9) ret SilphCo6Script_1a1bf: ; 1a1bf (6:61bf) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z ld hl, SilphCo6Coords1 call SilphCo4Script_19d5d call SilphCo6Script_1a1e6 - ld a, [$d82e] + ld a, [wd82e] bit 7, a ret nz ld a, $5f - ld [$d09f], a + ld [wd09f], a ld bc, $0602 - ld a, $17 - jp Predef + predef_jump Func_ee9e SilphCo6Coords1: ; 1a1e3 (6:61e3) db $06, $02 @@ -33,7 +32,7 @@ SilphCo6Script_1a1e6: ; 1a1e6 (6:61e6) ld a, [$ffe0] and a ret z - ld hl, $d82e + ld hl, wd82e set 7, [hl] ret @@ -58,7 +57,7 @@ SilphCo6TrainerHeaders: ; 1a20a (6:620a) SilphCo6TrainerHeader0: ; 1a20a (6:620a) db $6 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d82d ; flag's byte + dw wd82d ; flag's byte dw SilphCo6BattleText2 ; 0x62ba TextBeforeBattle dw SilphCo6AfterBattleText2 ; 0x62c4 TextAfterBattle dw SilphCo6EndBattleText2 ; 0x62bf TextEndBattle @@ -67,7 +66,7 @@ SilphCo6TrainerHeader0: ; 1a20a (6:620a) SilphCo6TrainerHeader2: ; 1a216 (6:6216) db $7 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d82d ; flag's byte + dw wd82d ; flag's byte dw SilphCo6BattleText3 ; 0x62d3 TextBeforeBattle dw SilphCo6AfterBattleText3 ; 0x62dd TextAfterBattle dw SilphCo6EndBattleText3 ; 0x62d8 TextEndBattle @@ -76,7 +75,7 @@ SilphCo6TrainerHeader2: ; 1a216 (6:6216) SilphCo6TrainerHeader3: ; 1a222 (6:6222) db $8 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d82d ; flag's byte + dw wd82d ; flag's byte dw SilphCo6BattleText4 ; 0x62ec TextBeforeBattle dw SilphCo6AfterBattleText4 ; 0x62f6 TextAfterBattle dw SilphCo6EndBattleText4 ; 0x62f1 TextEndBattle @@ -85,7 +84,7 @@ SilphCo6TrainerHeader3: ; 1a222 (6:6222) db $ff SilphCo6Script_1a22f: ; 1a22f (6:622f) - ld a, [$d838] + ld a, [wd838] bit 7, a jr nz, .asm_1a238 ; 0x1a234 $2 jr .asm_1a23a ; 0x1a236 $2 diff --git a/scripts/silphco7.asm b/scripts/silphco7.asm index d1c1bdb6..bd611763 100755 --- a/scripts/silphco7.asm +++ b/scripts/silphco7.asm @@ -9,48 +9,45 @@ SilphCo7Script: ; 51b61 (14:5b61) ret SilphCo7Script_51b77: ; 51b77 (14:5b77) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z ld hl, DataTable_51bc1 ; $5bc1 call SilphCo7Text_51bc8 call SilphCo7Text_51bf4 - ld a, [$d830] + ld a, [wd830] bit 4, a jr nz, .asm_51b9e push af ld a, $54 - ld [$d09f], a + ld [wd09f], a ld bc, $305 - ld a, $17 - call Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef Func_ee9e pop af .asm_51b9e bit 5, a jr nz, .asm_51bb1 push af ld a, $54 - ld [$d09f], a + ld [wd09f], a ld bc, $20a - ld a, $17 - call Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef Func_ee9e pop af .asm_51bb1 bit 6, a ret nz ld a, $54 - ld [$d09f], a + ld [wd09f], a ld bc, $60a - ld a, $17 - jp Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef_jump Func_ee9e DataTable_51bc1: ; 51bc1 (14:5bc1) db $03,$05,$02,$0A,$06,$0A,$FF SilphCo7Text_51bc8: ; 51bc8 (14:5bc8) push hl - ld hl, $d73f + ld hl, wd73f ld a, [hli] ld b, a ld a, [hl] @@ -74,7 +71,7 @@ SilphCo7Text_51bc8: ; 51bc8 (14:5bc8) ld a, [hli] cp c jr nz, .asm_51bd4 - ld hl, $d73f + ld hl, wd73f xor a ld [hli], a ld [hl], a @@ -85,7 +82,7 @@ SilphCo7Text_51bc8: ; 51bc8 (14:5bc8) ret SilphCo7Text_51bf4: ; 51bf4 (14:5bf4) - ld hl, $d830 + ld hl, wd830 ld a, [$ffe0] and a ret z @@ -104,7 +101,7 @@ SilphCo7Text_51bf4: ; 51bf4 (14:5bf4) SilphCo7Text_51c0c: ; 51c0c (14:5c0c) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a SilphCo7Text_51c10: ; 51c10 (14:5c10) ld [W_SILPHCO7CURSCRIPT], a @@ -120,20 +117,20 @@ SilphCo7ScriptPointers: ; 51c17 (14:5c17) dw SilphCo7Script5 SilphCo7Script0: ; 51c23 (14:5c23) - ld a, [$d82f] + ld a, [wd82f] bit 0, a jp nz, CheckFightingMapTrainers ld hl, CoordsData_51c78 call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $4 - ld [$d528], a + ld [wd528], a ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound ld c, BANK(Music_MeetRival) ld a, MUSIC_MEET_RIVAL @@ -145,8 +142,8 @@ SilphCo7Script0: ; 51c23 (14:5c23) ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call SetSpriteMovementBytesToFF ld de, MovementData_51c7d - ld a, [wWhichTrade] ; $cd3d - ld [$cf0d], a + ld a, [wWhichTrade] ; wWhichTrade + ld [wcf0d], a cp $1 jr z, .asm_51c6c inc de @@ -166,24 +163,24 @@ MovementData_51c7d: ; 51c7d (14:5c7d) db $40,$40,$40,$40,$FF SilphCo7Script3: ; 51c82 (14:5c82) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $d ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID call Delay3 - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, SilphCo7Text14 ; $5ec8 ld de, SilphCo7Text_51ecd ; $5ecd call PreBattleSaveRegisters ld a, SONY2 + $c8 - ld [W_CUROPPONENT], a ; $d059 - ld a, [W_RIVALSTARTER] ; $d715 + ld [W_CUROPPONENT], a ; wd059 + ld a, [W_RIVALSTARTER] ; wd715 cp STARTER2 jr nz, .asm_51cb6 ld a, $7 @@ -196,20 +193,20 @@ SilphCo7Script3: ; 51c82 (14:5c82) .asm_51cbe ld a, $9 .asm_51cc0 - ld [W_TRAINERNO], a ; $d05d + ld [W_TRAINERNO], a ; wd05d ld a, $4 jp SilphCo7Text_51c10 SilphCo7Script4: ; 51cc8 (14:5cc8) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, SilphCo7Text_51c0c ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d82f + ld [wJoyIgnore], a + ld hl, wd82f set 0, [hl] ld a, $4 - ld [$d528], a + ld [wd528], a ld a, $9 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c ld a, $4 @@ -219,11 +216,11 @@ SilphCo7Script4: ; 51cc8 (14:5cc8) ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound callba Music_RivalAlternateStart ld de, MovementData_51d1d - ld a, [$cf0d] + ld a, [wcf0d] cp $1 jr nz, .asm_51d0e ld de, MovementData_51d1a @@ -241,16 +238,15 @@ MovementData_51d1d: ; 51d1d (14:5d1d) db $80,$40,$40,$C0,$C0,$C0,$00,$FF SilphCo7Script5: ; 51d25 (14:5d25) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz ld a, $a7 - ld [$cc4d], a - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a + predef HideObject call Func_2307 xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a jp SilphCo7Text_51c10 SilphCo7TextPointers: ; 51d3f (14:5d3f) @@ -274,7 +270,7 @@ SilphCo7TrainerHeaders: ; 51d5d (14:5d5d) SilphCo7TrainerHeader0: ; 51d5d (14:5d5d) db $5 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d82f ; flag's byte + dw wd82f ; flag's byte dw SilphCo7BattleText1 ; 0x5e5a TextBeforeBattle dw SilphCo7AfterBattleText1 ; 0x5e64 TextAfterBattle dw SilphCo7EndBattleText1 ; 0x5e5f TextEndBattle @@ -283,7 +279,7 @@ SilphCo7TrainerHeader0: ; 51d5d (14:5d5d) SilphCo7TrainerHeader2: ; 51d69 (14:5d69) db $6 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d82f ; flag's byte + dw wd82f ; flag's byte dw SilphCo7BattleText2 ; 0x5e73 TextBeforeBattle dw SilphCo7AfterBattleText2 ; 0x5e7d TextAfterBattle dw SilphCo7EndBattleText2 ; 0x5e78 TextEndBattle @@ -292,7 +288,7 @@ SilphCo7TrainerHeader2: ; 51d69 (14:5d69) SilphCo7TrainerHeader3: ; 51d75 (14:5d75) db $7 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d82f ; flag's byte + dw wd82f ; flag's byte dw SilphCo7BattleText3 ; 0x5e8c TextBeforeBattle dw SilphCo7AfterBattleText3 ; 0x5e96 TextAfterBattle dw SilphCo7EndBattleText3 ; 0x5e91 TextEndBattle @@ -301,7 +297,7 @@ SilphCo7TrainerHeader3: ; 51d75 (14:5d75) SilphCo7TrainerHeader4: ; 51d81 (14:5d81) db $8 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d82f ; flag's byte + dw wd82f ; flag's byte dw SilphCo7BattleText4 ; 0x5ea5 TextBeforeBattle dw SilphCo7AfterBattleText4 ; 0x5eaf TextAfterBattle dw SilphCo7EndBattleText4 ; 0x5eaa TextEndBattle @@ -312,10 +308,10 @@ SilphCo7TrainerHeader4: ; 51d81 (14:5d81) SilphCo7Text1: ; lapras guy db $08 ; asm - ld a, [$d72e] + ld a, [wd72e] bit 0, a ; got lapras? jr z, .givelapras - ld a, [$d838] + ld a, [wd838] bit 7, a ; saved silph? jr nz, .savedsilph ld hl, .LaprasGuyText @@ -327,13 +323,13 @@ SilphCo7Text1: ld bc, (LAPRAS << 8) | 15 call GivePokemon jr nc, .done - ld a, [$ccd3] + ld a, [wccd3] and a call z, WaitForTextScrollButtonPress call EnableAutoTextBoxDrawing ld hl, .HeresYourLaprasText call PrintText - ld hl, $d72e + ld hl, wd72e set 0, [hl] jr .done .savedsilph @@ -360,7 +356,7 @@ SilphCo7Text1: SilphCo7Text2: db $8 - ld a, [$d838] + ld a, [wd838] bit 7, a ; saved silph? jr nz, .savedsilph ld hl, .rockettext @@ -382,7 +378,7 @@ SilphCo7Text2: SilphCo7Text3: db $08 ; asm - ld a, [$d838] + ld a, [wd838] bit 7, a ; saved silph? jr nz, .savedsilph ld hl, .rockettext @@ -404,7 +400,7 @@ SilphCo7Text3: SilphCo7Text4: db $08 ; asm - ld a, [$d838] + ld a, [wd838] bit 7, a ; saved silph? jr nz, .savedsilph ld hl, .rockettext diff --git a/scripts/silphco8.asm b/scripts/silphco8.asm index 19cae4ac..cc508e61 100755 --- a/scripts/silphco8.asm +++ b/scripts/silphco8.asm @@ -9,28 +9,27 @@ SilphCo8Script: ; 56504 (15:6504) ret SilphCo8Script_5651a: ; 5651a (15:651a) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z ld hl, DataTable_5653e ; $653e call SilphCo8Script_56541 call SilphCo8Script_5656d - ld a, [$d832] + ld a, [wd832] bit 0, a ret nz ld a, $5f - ld [$d09f], a + ld [wd09f], a ld bc, $403 - ld a, $17 - jp Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef_jump Func_ee9e DataTable_5653e: ; 5653e (15:653e) db $04,$03,$FF SilphCo8Script_56541: ; 56541 (15:6541) push hl - ld hl, $d73f + ld hl, wd73f ld a, [hli] ld b, a ld a, [hl] @@ -54,7 +53,7 @@ SilphCo8Script_56541: ; 56541 (15:6541) ld a, [hli] cp c jr nz, .asm_5654d - ld hl, $d73f + ld hl, wd73f xor a ld [hli], a ld [hl], a @@ -68,7 +67,7 @@ SilphCo8Script_5656d: ; 5656d (15:656d) ld a, [$ffe0] and a ret z - ld hl, $d832 + ld hl, wd832 set 0, [hl] ret @@ -87,7 +86,7 @@ SilphCo8TrainerHeaders: ; 56585 (15:6585) SilphCo8TrainerHeader0: ; 56585 (15:6585) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d831 ; flag's byte + dw wd831 ; flag's byte dw SilphCo8BattleText1 ; 0x65e6 TextBeforeBattle dw SilphCo8AfterBattleText1 ; 0x65f0 TextAfterBattle dw SilphCo8EndBattleText1 ; 0x65eb TextEndBattle @@ -96,7 +95,7 @@ SilphCo8TrainerHeader0: ; 56585 (15:6585) SilphCo8TrainerHeader1: ; 56591 (15:6591) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d831 ; flag's byte + dw wd831 ; flag's byte dw SilphCo8BattleText2 ; 0x65f5 TextBeforeBattle dw SilphCo8AfterBattleText2 ; 0x65ff TextAfterBattle dw SilphCo8EndBattleText2 ; 0x65fa TextEndBattle @@ -105,7 +104,7 @@ SilphCo8TrainerHeader1: ; 56591 (15:6591) SilphCo8TrainerHeader2: ; 5659d (15:659d) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d831 ; flag's byte + dw wd831 ; flag's byte dw SilphCo8BattleText3 ; 0x6604 TextBeforeBattle dw SilphCo8AfterBattleText3 ; 0x660e TextAfterBattle dw SilphCo8EndBattleText3 ; 0x6609 TextEndBattle @@ -115,7 +114,7 @@ SilphCo8TrainerHeader2: ; 5659d (15:659d) SilphCo8Text1: ; 565aa (15:65aa) db $08 ; asm - ld a, [$d838] + ld a, [wd838] bit 7, a ld hl, SilphCo8Text_565c3 jr nz, asm_a468f ; 0x565b3 diff --git a/scripts/silphco9.asm b/scripts/silphco9.asm index ee6e6fdc..c4f7a895 100755 --- a/scripts/silphco9.asm +++ b/scripts/silphco9.asm @@ -9,58 +9,54 @@ SilphCo9Script: ; 5d7bb (17:57bb) ret SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z ld hl, DataTable_5d82e ; $582e call SilphCo9Script_5d837 call SilphCo9Script_5d863 - ld a, [$d834] + ld a, [wd834] bit 0, a jr nz, .asm_5d7f8 push af ld a, $5f - ld [$d09f], a + ld [wd09f], a ld bc, $401 - ld a, $17 - call Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef Func_ee9e pop af .asm_5d7f8 bit 1, a jr nz, .asm_5d80b push af ld a, $54 - ld [$d09f], a + ld [wd09f], a ld bc, $209 - ld a, $17 - call Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef Func_ee9e pop af .asm_5d80b bit 2, a jr nz, .asm_5d81e push af ld a, $54 - ld [$d09f], a + ld [wd09f], a ld bc, $509 - ld a, $17 - call Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef Func_ee9e pop af .asm_5d81e bit 3, a ret nz ld a, $5f - ld [$d09f], a + ld [wd09f], a ld bc, $605 - ld a, $17 - jp Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef_jump Func_ee9e DataTable_5d82e: ; 5d82e (17:582e) db $04,$01,$02,$09,$05,$09,$06,$05,$FF SilphCo9Script_5d837: ; 5d837 (17:5837) push hl - ld hl, $d73f + ld hl, wd73f ld a, [hli] ld b, a ld a, [hl] @@ -84,7 +80,7 @@ SilphCo9Script_5d837: ; 5d837 (17:5837) ld a, [hli] cp c jr nz, .asm_5d843 - ld hl, $d73f + ld hl, wd73f xor a ld [hli], a ld [hl], a @@ -95,7 +91,7 @@ SilphCo9Script_5d837: ; 5d837 (17:5837) ret SilphCo9Script_5d863: ; 5d863 (17:5863) - ld hl, $d834 + ld hl, wd834 ld a, [$ffe0] and a ret z @@ -134,7 +130,7 @@ SilphCo9TrainerHeaders: ; 5d893 (17:5893) SilphCo9TrainerHeader0: ; 5d893 (17:5893) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d833 ; flag's byte + dw wd833 ; flag's byte dw SilphCo9BattleText1 ; 0x5912 TextBeforeBattle dw SilphCo9AfterBattleText1 ; 0x591c TextAfterBattle dw SilphCo9EndBattleText1 ; 0x5917 TextEndBattle @@ -143,7 +139,7 @@ SilphCo9TrainerHeader0: ; 5d893 (17:5893) SilphCo9TrainerHeader1: ; 5d89f (17:589f) db $3 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d833 ; flag's byte + dw wd833 ; flag's byte dw SilphCo9BattleText2 ; 0x5921 TextBeforeBattle dw SilphCo9AfterBattleText2 ; 0x592b TextAfterBattle dw SilphCo9EndBattleText2 ; 0x5926 TextEndBattle @@ -152,7 +148,7 @@ SilphCo9TrainerHeader1: ; 5d89f (17:589f) SilphCo9TrainerHeader2: ; 5d8ab (17:58ab) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d833 ; flag's byte + dw wd833 ; flag's byte dw SilphCo9BattleText3 ; 0x5930 TextBeforeBattle dw SilphCo9AfterBattleText3 ; 0x593a TextAfterBattle dw SilphCo9EndBattleText3 ; 0x5935 TextEndBattle @@ -162,13 +158,12 @@ SilphCo9TrainerHeader2: ; 5d8ab (17:58ab) SilphCo9Text1: ; 5d8b8 (17:58b8) db $08 ; asm - ld a, [$d838] + ld a, [wd838] bit 7, a jr nz, .asm_a14c3 ; 0x5d8be ld hl, SilphCo9Text_5d8e5 call PrintText - ld a, $7 - call Predef + predef HealParty call GBFadeOut2 call Delay3 call GBFadeIn2 diff --git a/scripts/silphcoelevator.asm b/scripts/silphcoelevator.asm index c6442ca9..853d7357 100755 --- a/scripts/silphcoelevator.asm +++ b/scripts/silphcoelevator.asm @@ -1,5 +1,5 @@ SilphCoElevatorScript: ; 457c0 (11:57c0) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] push hl @@ -9,16 +9,16 @@ SilphCoElevatorScript: ; 457c0 (11:57c0) res 7, [hl] call nz, SilphCoElevatorScript_45827 xor a - ld [$cf0c], a + ld [wcf0c], a inc a - ld [$cc3c], a + ld [wcc3c], a ret SilphCoElevatorScript_457dc: ; 457dc (11:57dc) - ld hl, $d3af - ld a, [$d73b] + ld hl, wd3af + ld a, [wd73b] ld b, a - ld a, [$d73c] + ld a, [wd73c] ld c, a call SilphCoElevatorScript_457ea @@ -35,7 +35,7 @@ SilphCoElevatorScript_457f1: ; 457f1 (11:57f1) ld hl, SilphCoElavatorFloors ; $5804 call LoadItemList ld hl, SilphCoElevatorWarpMaps ; $5811 - ld de, $cc5b + ld de, wcc5b ld bc, $16 call CopyData ret @@ -73,6 +73,5 @@ SilphCoElevatorText1: ; 45835 (11:5835) db $08 ; asm call SilphCoElevatorScript_457f1 ld hl, SilphCoElevatorWarpMaps ; $5811 - ld a, $61 - call Predef + predef Func_1c9c6 jp TextScriptEnd diff --git a/scripts/ssanne10.asm b/scripts/ssanne10.asm index eaef6de3..60eb28f2 100755 --- a/scripts/ssanne10.asm +++ b/scripts/ssanne10.asm @@ -29,7 +29,7 @@ SSAnne10TrainerHeaders: ; 61d84 (18:5d84) SSAnne10TrainerHeader0: ; 61d84 (18:5d84) db $1 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d809 ; flag's byte + dw wd809 ; flag's byte dw SSAnne10BattleText1 ; 0x5e16 TextBeforeBattle dw SSAnne10AfterBattleText1 ; 0x5e20 TextAfterBattle dw SSAnne10EndBattleText1 ; 0x5e1b TextEndBattle @@ -38,7 +38,7 @@ SSAnne10TrainerHeader0: ; 61d84 (18:5d84) SSAnne10TrainerHeader1: ; 61d90 (18:5d90) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d809 ; flag's byte + dw wd809 ; flag's byte dw SSAnne10BattleText2 ; 0x5e25 TextBeforeBattle dw SSAnne10AfterBattleText2 ; 0x5e2f TextAfterBattle dw SSAnne10EndBattleText2 ; 0x5e2a TextEndBattle @@ -47,7 +47,7 @@ SSAnne10TrainerHeader1: ; 61d90 (18:5d90) SSAnne10TrainerHeader2: ; 61d9c (18:5d9c) db $3 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d809 ; flag's byte + dw wd809 ; flag's byte dw SSAnne10BattleText3 ; 0x5e34 TextBeforeBattle dw SSAnne10AfterBattleText3 ; 0x5e3e TextAfterBattle dw SSAnne10EndBattleText3 ; 0x5e39 TextEndBattle @@ -56,7 +56,7 @@ SSAnne10TrainerHeader2: ; 61d9c (18:5d9c) SSAnne10TrainerHeader3: ; 61da8 (18:5da8) db $4 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d809 ; flag's byte + dw wd809 ; flag's byte dw SSAnne10BattleText4 ; 0x5e43 TextBeforeBattle dw SSAnne10AfterBattleText4 ; 0x5e4d TextAfterBattle dw SSAnne10EndBattleText4 ; 0x5e48 TextEndBattle @@ -65,7 +65,7 @@ SSAnne10TrainerHeader3: ; 61da8 (18:5da8) SSAnne10TrainerHeader4: ; 61db4 (18:5db4) db $5 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d809 ; flag's byte + dw wd809 ; flag's byte dw SSAnne10BattleText5 ; 0x5e52 TextBeforeBattle dw SSAnne10AfterBattleText5 ; 0x5e5c TextAfterBattle dw SSAnne10EndBattleText5 ; 0x5e57 TextEndBattle @@ -74,7 +74,7 @@ SSAnne10TrainerHeader4: ; 61db4 (18:5db4) SSAnne10TrainerHeader5: ; 61dc0 (18:5dc0) db $6 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d809 ; flag's byte + dw wd809 ; flag's byte dw SSAnne10BattleText6 ; 0x5e61 TextBeforeBattle dw SSAnne10AfterBattleText6 ; 0x5e6b TextAfterBattle dw SSAnne10EndBattleText6 ; 0x5e66 TextEndBattle diff --git a/scripts/ssanne2.asm b/scripts/ssanne2.asm index 449dab83..f3822ec7 100755 --- a/scripts/ssanne2.asm +++ b/scripts/ssanne2.asm @@ -6,7 +6,7 @@ SSAnne2Script: ; 6139f (18:539f) SSAnne2Script_613ab: ; 613ab (18:53ab) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_SSANNE2CURSCRIPT], a ret @@ -25,25 +25,24 @@ SSAnne2Script0: ; 613be (18:53be) call ArePlayerCoordsInArray ret nc ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound ld c, BANK(Music_MeetRival) ld a, MUSIC_MEET_RIVAL call PlayMusic - ld a, [$cd3d] + ld a, [wWhichTrade] ld [$ffdb], a ld a, $71 - ld [$cc4d], a - ld a, $15 - call Predef + ld [wcc4d], a + predef ShowObject call Delay3 ld a, $2 ld [$ff8c], a call SetSpriteMovementBytesToFF xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, [$ffdb] cp $2 jr nz, .asm_61400 ; 0x613f9 $5 @@ -67,11 +66,11 @@ CoordsData_61411: ; 61411 (18:5411) db $08,$24,$08,$25,$FF SSAnne2Script_61416: ; 61416 (18:5416) - ld a, [W_XCOORD] ; $d362 + ld a, [W_XCOORD] ; wd362 cp $25 jr nz, .asm_61426 ld a, $2 - ld [$d528], a + ld [wd528], a ld a, $c jr .asm_61427 .asm_61426 @@ -83,12 +82,12 @@ SSAnne2Script_61416: ; 61416 (18:5416) jp Func_34a6 SSAnne2Script1: ; 61430 (18:5430) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz call SSAnne2Script_61416 xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $2 ld [$ff8c], a call DisplayTextID @@ -118,12 +117,12 @@ SSAnne2Script1: ; 61430 (18:5430) ret SSAnne2Script2: ; 6146d (18:546d) - ld a, [$d057] + ld a, [W_ISINBATTLE] cp $ff jp z, SSAnne2Script_613ab call SSAnne2Script_61416 ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $3 ld [$ff8c], a call DisplayTextID @@ -142,7 +141,7 @@ SSAnne2Script2: ; 6146d (18:546d) ld [$ff8c], a call MoveSprite ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound callba Music_RivalAlternateStart ld a, $3 @@ -156,15 +155,14 @@ MovementData_614b9: ; 614b9 (18:54b9) db $00,$00,$00,$00,$FF SSAnne2Script3: ; 614be (18:54be) - ld a, [$d730] + ld a, [wd730] bit 0, a ret nz xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $71 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject call Func_2307 ld a, $4 ld [W_SSANNE2CURSCRIPT], a @@ -183,7 +181,7 @@ SSAnne2Text2: ; 614e6 (18:54e6) db $8 ld hl, SSAnneRivalBeforeBattleText call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, SSAnneRivalDefeatedText diff --git a/scripts/ssanne5.asm b/scripts/ssanne5.asm index 034dd26a..ea7ff282 100755 --- a/scripts/ssanne5.asm +++ b/scripts/ssanne5.asm @@ -23,7 +23,7 @@ SSAnne5TrainerHeaders: ; 616d1 (18:56d1) SSAnne5TrainerHeader0: ; 616d1 (18:56d1) db $4 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7ff ; flag's byte + dw wd7ff ; flag's byte dw SSAnne5BattleText1 ; 0x5703 TextBeforeBattle dw SSAnne5AfterBattleText1 ; 0x570d TextAfterBattle dw SSAnne5EndBattleText1 ; 0x5708 TextEndBattle @@ -32,7 +32,7 @@ SSAnne5TrainerHeader0: ; 616d1 (18:56d1) SSAnne5TrainerHeader1: ; 616dd (18:56dd) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7ff ; flag's byte + dw wd7ff ; flag's byte dw SSAnne5BattleText2 ; 0x571c TextBeforeBattle dw SSAnne5AfterBattleText2 ; 0x5726 TextAfterBattle dw SSAnne5EndBattleText2 ; 0x5721 TextEndBattle diff --git a/scripts/ssanne7.asm b/scripts/ssanne7.asm index 8e88417f..b708b4fd 100755 --- a/scripts/ssanne7.asm +++ b/scripts/ssanne7.asm @@ -3,10 +3,10 @@ SSAnne7Script: ; 61895 (18:5895) jp EnableAutoTextBoxDrawing SSAnne7Script_6189b: ; 6189b (18:589b) - ld a, [$d803] + ld a, [wd803] bit 1, a ret nz - ld hl, $d72d + ld hl, wd72d set 5, [hl] ret @@ -17,7 +17,7 @@ SSAnne7TextPointers: ; 618a7 (18:58a7) SSAnne7Text1: ; 618ad (18:58ad) db $08 ; asm - ld a, [$d803] + ld a, [wd803] bit 0, a jr nz, .asm_797c4 ; 0x618b3 ld hl, SSAnne7RubText @@ -29,13 +29,13 @@ SSAnne7Text1: ; 618ad (18:58ad) jr nc, .BagFull ld hl, ReceivedHM01Text call PrintText - ld hl, $d803 + ld hl, wd803 set 0, [hl] jr .asm_0faf5 ; 0x618d4 .BagFull ld hl, HM01NoRoomText call PrintText - ld hl, $d72d + ld hl, wd72d set 5, [hl] jr .asm_0faf5 ; 0x618e1 .asm_797c4 ; 0x618e3 @@ -47,27 +47,27 @@ SSAnne7Text1: ; 618ad (18:58ad) SSAnne7RubText: ; 618ec (18:58ec) TX_FAR _SSAnne7RubText db $8 - ld a, [$c0ef] + ld a, [wc0ef] cp $1f - ld [$c0f0], a + ld [wc0f0], a jr nz, .asm_61908 ; 0x618f9 $d ld a, $ff - ld [$c0ee], a + ld [wc0ee], a call PlaySound ld a, Bank(Func_9876) - ld [$c0ef], a + ld [wc0ef], a .asm_61908 ld a, MUSIC_PKMN_HEALED - ld [$c0ee], a + ld [wc0ee], a call PlaySound .asm_61910 - ld a, [$c026] + ld a, [wc026] cp MUSIC_PKMN_HEALED jr z, .asm_61910 ; 0x61915 $f9 call Func_2307 - ld hl, $d803 + ld hl, wd803 set 1, [hl] - ld hl, $d72d + ld hl, wd72d res 5, [hl] jp TextScriptEnd diff --git a/scripts/ssanne8.asm b/scripts/ssanne8.asm index 0f1b8c7e..a2abb4bb 100755 --- a/scripts/ssanne8.asm +++ b/scripts/ssanne8.asm @@ -29,7 +29,7 @@ SSAnne8TrainerHeaders: ; 619a5 (18:59a5) SSAnne8TrainerHeader0: ; 619a5 (18:59a5) db $1 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d805 ; flag's byte + dw wd805 ; flag's byte dw SSAnne8BattleText1 ; 0x5a0b TextBeforeBattle dw SSAnne8AfterBattleText1 ; 0x5a15 TextAfterBattle dw SSAnne8EndBattleText1 ; 0x5a10 TextEndBattle @@ -38,7 +38,7 @@ SSAnne8TrainerHeader0: ; 619a5 (18:59a5) SSAnne8TrainerHeader1: ; 619b1 (18:59b1) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d805 ; flag's byte + dw wd805 ; flag's byte dw SSAnne8BattleText2 ; 0x5a1a TextBeforeBattle dw SSAnne8AfterBattleText2 ; 0x5a24 TextAfterBattle dw SSAnne8EndBattleText2 ; 0x5a1f TextEndBattle @@ -47,7 +47,7 @@ SSAnne8TrainerHeader1: ; 619b1 (18:59b1) SSAnne8TrainerHeader2: ; 619bd (18:59bd) db $3 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d805 ; flag's byte + dw wd805 ; flag's byte dw SSAnne8BattleText3 ; 0x5a29 TextBeforeBattle dw SSAnne8AfterBattleText3 ; 0x5a33 TextAfterBattle dw SSAnne8EndBattleText3 ; 0x5a2e TextEndBattle @@ -56,7 +56,7 @@ SSAnne8TrainerHeader2: ; 619bd (18:59bd) SSAnne8TrainerHeader3: ; 619c9 (18:59c9) db $4 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d805 ; flag's byte + dw wd805 ; flag's byte dw SSAnne8BattleText4 ; 0x5a38 TextBeforeBattle dw SSAnne8AfterBattleText4 ; 0x5a42 TextAfterBattle dw SSAnne8EndBattleText4 ; 0x5a3d TextEndBattle diff --git a/scripts/ssanne9.asm b/scripts/ssanne9.asm index 9b055e3f..2ec0f28c 100755 --- a/scripts/ssanne9.asm +++ b/scripts/ssanne9.asm @@ -1,8 +1,8 @@ SSAnne9Script: ; 61b4b (18:5b4b) ld a, $1 - ld [$cf0c], a + ld [wcf0c], a xor a - ld [$cc3c], a + ld [wcc3c], a ld hl, SSAnne9TrainerHeaders ld de, SSAnne9ScriptPointers ld a, [W_SSANNE9CURSCRIPT] @@ -34,7 +34,7 @@ SSAnne9TrainerHeaders: ; 61b84 (18:5b84) SSAnne9TrainerHeader0: ; 61b84 (18:5b84) db $1 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d807 ; flag's byte + dw wd807 ; flag's byte dw SSAnne9BattleText1 ; 0x5c51 TextBeforeBattle dw SSAnne9AfterBattleText1 ; 0x5c5b TextAfterBattle dw SSAnne9EndBattleText1 ; 0x5c56 TextEndBattle @@ -43,7 +43,7 @@ SSAnne9TrainerHeader0: ; 61b84 (18:5b84) SSAnne9TrainerHeader1: ; 61b90 (18:5b90) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d807 ; flag's byte + dw wd807 ; flag's byte dw SSAnne9BattleText2 ; 0x5c60 TextBeforeBattle dw SSAnne9AfterBattleText2 ; 0x5c6a TextAfterBattle dw SSAnne9EndBattleText2 ; 0x5c65 TextEndBattle @@ -52,7 +52,7 @@ SSAnne9TrainerHeader1: ; 61b90 (18:5b90) SSAnne9TrainerHeader2: ; 61b9c (18:5b9c) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d807 ; flag's byte + dw wd807 ; flag's byte dw SSAnne9BattleText3 ; 0x5c6f TextBeforeBattle dw SSAnne9AfterBattleText3 ; 0x5c79 TextAfterBattle dw SSAnne9EndBattleText3 ; 0x5c74 TextEndBattle @@ -61,7 +61,7 @@ SSAnne9TrainerHeader2: ; 61b9c (18:5b9c) SSAnne9TrainerHeader3: ; 61ba8 (18:5ba8) db $4 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d807 ; flag's byte + dw wd807 ; flag's byte dw SSAnne9BattleText4 ; 0x5c7e TextBeforeBattle dw SSAnne9AfterBattleText4 ; 0x5c88 TextAfterBattle dw SSAnne9EndBattleText4 ; 0x5c83 TextEndBattle diff --git a/scripts/undergroundpathentranceroute5.asm b/scripts/undergroundpathentranceroute5.asm index 9a437e85..1fb62f48 100755 --- a/scripts/undergroundpathentranceroute5.asm +++ b/scripts/undergroundpathentranceroute5.asm @@ -13,7 +13,6 @@ UndergroundPathEntranceRoute5Text1: ; 5d6b2 (17:56b2) db $08 ; asm ld a, $9 ld [wWhichTrade], a - ld a, $54 - call Predef + predef Predef54 ld hl, UndergroundPathEntranceRoute5_5d6af ret diff --git a/scripts/unknowndungeon3.asm b/scripts/unknowndungeon3.asm index b765ef56..2ca624a8 100755 --- a/scripts/unknowndungeon3.asm +++ b/scripts/unknowndungeon3.asm @@ -21,7 +21,7 @@ UnknownDungeon3TrainerHeaders: ; 45f0f (11:5f0f) UnknownDungeon3TrainerHeader0: ; 45f0f (11:5f0f) db $1 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d85f ; flag's byte + dw wd85f ; flag's byte dw UnknownDungeon3MewtwoText ; 0x5f26 TextBeforeBattle dw UnknownDungeon3MewtwoText ; 0x5f26 TextAfterBattle dw UnknownDungeon3MewtwoText ; 0x5f26 TextEndBattle diff --git a/scripts/vermilioncity.asm b/scripts/vermilioncity.asm index 3f582dba..da70b819 100755 --- a/scripts/vermilioncity.asm +++ b/scripts/vermilioncity.asm @@ -1,6 +1,6 @@ VermilionCityScript: ; 197a1 (6:57a1) call EnableAutoTextBoxDrawing - ld hl, $d126 + ld hl, wd126 bit 6, [hl] res 6, [hl] push hl @@ -14,14 +14,14 @@ VermilionCityScript: ; 197a1 (6:57a1) jp CallFunctionInTable VermilionCityScript_197c0: ; 197c0 (6:57c0) - call GenRandom + call Random ld a, [$ffd4] and $e - ld [$d743], a + ld [wd743], a ret VermilionCityScript_197cb: ; 197cb (6:57cb) - ld hl, $d803 + ld hl, wd803 bit 2, [hl] ret z bit 3, [hl] @@ -39,32 +39,31 @@ VermilionCityScriptPointers: ; 197dc (6:57dc) dw VermilionCityScript4 VermilionCityScript0: ; 197e6 (6:57e6) - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] and a ret nz ld hl, CoordsData_19823 call ArePlayerCoordsInArray ret nc xor a - ld [H_CURRENTPRESSEDBUTTONS], a - ld [$cf0d], a + ld [hJoyHeld], a + ld [wcf0d], a ld a, $3 ld [$ff8c], a call DisplayTextID - ld a, [$d803] + ld a, [wd803] bit 2, a jr nz, .asm_19810 ; 0x19804 $a ld b, $3f - ld a, $1c - call Predef + predef IsItemInBag_ ld a, b and a ret nz .asm_19810 ld a, $40 - ld [$ccd3], a + ld [wccd3], a ld a, $1 - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $1 ld [W_VERMILIONCITYCURSCRIPT], a @@ -84,30 +83,30 @@ VermilionCityScript4: ; 19826 (6:5826) VermilionCityScript2: ; 19833 (6:5833) ld a, $ff - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $40 - ld [$ccd3], a - ld [$ccd4], a + ld [wccd3], a + ld [wccd4], a ld a, $2 - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $3 ld [W_VERMILIONCITYCURSCRIPT], a ret VermilionCityScript3: ; 1984e (6:584e) - ld a, [$cd38] + ld a, [wcd38] and a ret nz xor a - ld [wJoypadForbiddenButtonsMask], a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [wJoyIgnore], a + ld [hJoyHeld], a ld a, $0 ld [W_VERMILIONCITYCURSCRIPT], a ret VermilionCityScript1: ; 1985f (6:585f) - ld a, [$cd38] + ld a, [wcd38] and a ret nz ld c, $a @@ -137,7 +136,7 @@ VermilionCityText1: ; 19889 (6:5889) VermilionCityText2: ; 1988e (6:588e) db $08 ; asm - ld a, [$d803] + ld a, [wd803] bit 2, a jr nz, .asm_359bd ; 0x19894 ld hl, VermilionCityText_198a7 @@ -159,10 +158,10 @@ VermilionCityText_198ac: ; 198ac (6:58ac) VermilionCityText3: ; 198b1 (6:58b1) db $08 ; asm - ld a, [$d803] + ld a, [wd803] bit 2, a jr nz, .asm_3e0e9 ; 0x198b7 - ld a, [$c109] + ld a, [wSpriteStateData1 + 9] cp $c jr z, .asm_07af3 ; 0x198be ld hl, VermilionCityCoords1 @@ -176,8 +175,7 @@ VermilionCityText3: ; 198b1 (6:58b1) ld hl, SSAnneWelcomeText9 call PrintText ld b, S_S__TICKET - ld a, $1c - call Predef + predef IsItemInBag_ ld a, b and a jr nz, .asm_0419b ; 0x198df diff --git a/scripts/vermiliondock.asm b/scripts/vermiliondock.asm index 164abe7c..03dc4377 100755 --- a/scripts/vermiliondock.asm +++ b/scripts/vermiliondock.asm @@ -1,60 +1,59 @@ VermilionDockScript: ; 1db52 (7:5b52) call EnableAutoTextBoxDrawing - ld hl, $d803 + ld hl, wd803 bit 4, [hl] jr nz, .asm_1db8d ; 0x1db5a $31 bit 0, [hl] ret z - ld a, [$d42f] + ld a, [wd42f] cp $1 ret nz bit 2, [hl] jp z, VermilionDock_1db9b set 4, [hl] call Delay3 - ld hl, $d730 + ld hl, wd730 set 7, [hl] - ld hl, $ccd3 + ld hl, wccd3 ld a, $40 ld [hli], a ld [hli], a ld [hl], a ld a, $3 - ld [$cd38], a + ld [wcd38], a xor a - ld [$c206], a - ld [$cd3b], a + ld [wSpriteStateData2 + $06], a + ld [wcd3b], a dec a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ret .asm_1db8d bit 5, [hl] ret nz - ld a, [$cd38] + ld a, [wcd38] and a ret nz - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a set 5, [hl] ret VermilionDock_1db9b: ; 1db9b (7:5b9b) set 2, [hl] ld a, $ff - ld [wJoypadForbiddenButtonsMask], a - ld [$c0ee], a + ld [wJoyIgnore], a + ld [wc0ee], a call PlaySound ld c, BANK(Music_Surfing) ld a, MUSIC_SURFING call PlayMusic callba LoadSmokeTileFourTimes xor a - ld [$c102], a + ld [wSpriteStateData1 + 2], a ld c, $78 call DelayFrames ld b, $9c call CopyScreenTileBufferToVRAM - FuncCoord 0, 10 ; $c468 - ld hl, Coord + hlCoord 0, 10 ld bc, $0078 ld a, $14 call FillMemory @@ -63,11 +62,11 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b) call Delay3 xor a ld [$ffba], a - ld [$cd3d], a + ld [wWhichTrade], a ld [$ff49], a ld a, $58 - ld [$cd3e], a - ld hl, $d526 + ld [wTrainerEngageDistance], a + ld hl, wd526 ld c, [hl] inc hl ld b, [hl] @@ -76,16 +75,16 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b) ld a, (SFX_02_54 - SFX_Headers_02) / 3 call PlaySoundWaitForCurrent ld a, $ff - ld [$cfcb], a + ld [wcfcb], a ld d, $0 ld e, $8 .asm_1dbfa ld hl, $0002 add hl, bc ld a, l - ld [$d526], a + ld [wd526], a ld a, h - ld [$d527], a + ld [wd527], a push hl push de call ScheduleEastColumnRedraw @@ -112,22 +111,22 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b) ld a, $90 ld [$ffb0], a ld a, $1 - ld [$cfcb], a + ld [wcfcb], a pop hl pop bc ld [hl], b dec hl ld [hl], c call LoadPlayerSpriteGraphics - ld hl, $d3ae + ld hl, wd3ae dec [hl] ret VermilionDock_1dc42: ; 1dc42 (7:5c42) push bc push de - ld hl, $c311 - ld a, [$cd3d] + ld hl, wOAMBuffer + $11 + ld a, [wWhichTrade] swap a ld c, a ld de, $0004 @@ -142,14 +141,14 @@ VermilionDock_1dc42: ; 1dc42 (7:5c42) ret VermilionDock_1dc59: ; 1dc59 (7:5c59) - ld a, [$cd3e] + ld a, [wTrainerEngageDistance] sub $10 - ld [$cd3e], a + ld [wTrainerEngageDistance], a ld c, a ld b, $64 - ld a, [$cd3d] + ld a, [wWhichTrade] inc a - ld [$cd3d], a + ld [wWhichTrade], a ld a, $1 ld de, VermilionDockOAMBlock call WriteOAMBlock @@ -180,15 +179,15 @@ VermilionDock_1dc7c: ; 1dc7c (7:5c7c) ret VermilionDock_1dc94: ; 1dc94 (7:5c94) - ld hl, $cc5b + ld hl, wcc5b ld bc, $00b4 ld a, $14 call FillMemory - ld hl, $9940 - ld de, $cc5b + ld hl, vBGMap0 + 10 * 32 + ld de, wcc5b ld bc, $000c call CopyVideoData - ld hl, $c754 + ld hl, wOverworldMap + 10 + 7 * VERMILION_DOCK_WIDTH ; 10, 7 ld a, $d ld [hli], a ld [hli], a diff --git a/scripts/vermiliongym.asm b/scripts/vermiliongym.asm index de3678dd..fa6b2fc2 100755 --- a/scripts/vermiliongym.asm +++ b/scripts/vermiliongym.asm @@ -1,5 +1,5 @@ VermilionGymScript: ; 5ca26 (17:4a26) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] push hl @@ -28,7 +28,7 @@ Gym3LeaderName: ; 5ca64 (17:4a64) db "LT.SURGE@" VermilionGymScript_5ca6d: ; 5ca6d (17:4a6d) - ld a, [$d773] + ld a, [wd773] bit 0, a jr nz, .asm_5ca78 ld a, $24 @@ -38,14 +38,13 @@ VermilionGymScript_5ca6d: ; 5ca6d (17:4a6d) call PlaySound ld a, $5 .asm_5ca7f - ld [$d09f], a + ld [wd09f], a ld bc, $202 - ld a, $17 - jp Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef_jump Func_ee9e VermilionGymScript_5ca8a: ; 5ca8a (17:4a8a) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_VERMILIONGYMCURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -57,17 +56,17 @@ VermilionGymScriptPointers: ; 5ca95 (17:4a95) dw VermilionGymScript3 VermilionGymScript3: ; 5ca9d (17:4a9d) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, VermilionGymScript_5ca8a ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a VermilionGymScript_5caaa: ; 5caaa (17:4aaa) ld a, $6 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d773 + ld hl, wd773 set 7, [hl] ld bc, (TM_24 << 8) | 1 call GiveItem @@ -75,7 +74,7 @@ VermilionGymScript_5caaa: ; 5caaa (17:4aaa) ld a, $7 ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d773 + ld hl, wd773 set 6, [hl] jr .asm_5cad3 .BagFull @@ -85,13 +84,13 @@ VermilionGymScript_5caaa: ; 5caaa (17:4aaa) .asm_5cad3 ld hl, W_OBTAINEDBADGES set 2, [hl] - ld hl, $d72a + ld hl, wd72a set 2, [hl] ; deactivate gym trainers - ld a, [$d773] + ld a, [wd773] or %00011100 - ld [$d773], a + ld [wd773], a jp VermilionGymScript_5ca8a @@ -109,7 +108,7 @@ VermilionGymTrainerHeaders: ; 5caf8 (17:4af8) VermilionGymTrainerHeader0: ; 5caf8 (17:4af8) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d773 ; flag's byte + dw wd773 ; flag's byte dw VermilionGymBattleText1 ; 0x4b9a TextBeforeBattle dw VermilionGymAfterBattleText1 ; 0x4ba4 TextAfterBattle dw VermilionGymEndBattleText1 ; 0x4b9f TextEndBattle @@ -118,7 +117,7 @@ VermilionGymTrainerHeader0: ; 5caf8 (17:4af8) VermilionGymTrainerHeader1: ; 5cb04 (17:4b04) db $3 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d773 ; flag's byte + dw wd773 ; flag's byte dw VermilionGymBattleText2 ; 0x4bb3 TextBeforeBattle dw VermilionGymAfterBattleText2 ; 0x4bbd TextAfterBattle dw VermilionGymEndBattleText2 ; 0x4bb8 TextEndBattle @@ -127,7 +126,7 @@ VermilionGymTrainerHeader1: ; 5cb04 (17:4b04) VermilionGymTrainerHeader2: ; 5cb10 (17:4b10) db $4 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d773 ; flag's byte + dw wd773 ; flag's byte dw VermilionGymBattleText3 ; 0x4bcc TextBeforeBattle dw VermilionGymAfterBattleText3 ; 0x4bd6 TextAfterBattle dw VermilionGymEndBattleText3 ; 0x4bd1 TextEndBattle @@ -137,7 +136,7 @@ VermilionGymTrainerHeader2: ; 5cb10 (17:4b10) VermilionGymText1: ; 5cb1d (17:4b1d) db $08 ; asm - ld a, [$d773] + ld a, [wd773] bit 7, a jr z, .asm_7cc29 ; 0x5cb23 bit 6, a @@ -152,18 +151,18 @@ VermilionGymText1: ; 5cb1d (17:4b1d) .asm_7cc29 ; 0x5cb39 ld hl, VermilionGymText_5cb6d call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, ReceivedThunderbadgeText ld de, ReceivedThunderbadgeText call PreBattleSaveRegisters ldh a, [$8c] - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters ld a, $3 - ld [$d05c], a + ld [W_GYMLEADERNO], a xor a ldh [$b4], a ld a, $3 @@ -254,7 +253,7 @@ VermilionGymAfterBattleText3: ; 5cbd6 (17:4bd6) VermilionGymText5: ; 5cbdb (17:4bdb) db $08 ; asm - ld a, [$d72a] + ld a, [wd72a] bit 2, a jr nz, .asm_13b67 ; 0x5cbe1 ld hl, VermilionGymText_5cbf4 diff --git a/scripts/vermilionhouse2.asm b/scripts/vermilionhouse2.asm index 9efb8200..7c06c6e9 100755 --- a/scripts/vermilionhouse2.asm +++ b/scripts/vermilionhouse2.asm @@ -6,19 +6,19 @@ VermilionHouse2TextPointers: ; 56073 (15:6073) VermilionHouse2Text1: ; 56075 (15:6075) db $08 ; asm - ld a, [$d728] + ld a, [wd728] bit 3, a jr nz, .asm_03ef5 ld hl, VermilionHouse2Text_560b1 call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_eb1b7 ld bc, (OLD_ROD << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, $d728 + ld hl, wd728 set 3, [hl] ld hl, VermilionHouse2Text_560b6 jr .asm_5dd95 diff --git a/scripts/vermilionhouse3.asm b/scripts/vermilionhouse3.asm index b6bceeea..7b4e95fd 100755 --- a/scripts/vermilionhouse3.asm +++ b/scripts/vermilionhouse3.asm @@ -8,6 +8,5 @@ VermilionHouse3Text1: ; 19c17 (6:5c17) db $08 ; asm ld a, $4 ld [wWhichTrade], a - ld a, $54 - call Predef + predef Predef54 jp TextScriptEnd diff --git a/scripts/victoryroad1.asm b/scripts/victoryroad1.asm index b9b946ad..cebd8070 100755 --- a/scripts/victoryroad1.asm +++ b/scripts/victoryroad1.asm @@ -1,5 +1,5 @@ VictoryRoad1Script: ; 5da0a (17:5a0a) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] call nz, .next @@ -11,14 +11,13 @@ VictoryRoad1Script: ; 5da0a (17:5a0a) ld [W_VICTORYROAD1CURSCRIPT], a ret .next - ld a, [$d869] + ld a, [wd869] bit 7, a ret z ld a, $1d - ld [$d09f], a + ld [wd09f], a ld bc, $604 - ld a, $17 - jp Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef_jump Func_ee9e VictoryRoad1ScriptPointers: ; 5da3a (17:5a3a) dw VictoryRoad1Script0 @@ -26,15 +25,15 @@ VictoryRoad1ScriptPointers: ; 5da3a (17:5a3a) dw EndTrainerBattle VictoryRoad1Script0: ; 5da40 (17:5a40) - ld a, [$d869] + ld a, [wd869] bit 7, a jp nz, CheckFightingMapTrainers ld hl, CoordsData_5da5c ; $5a5c call CheckBoulderCoords jp nc, CheckFightingMapTrainers - ld hl, $d126 + ld hl, wd126 set 5, [hl] - ld hl, $d869 + ld hl, wd869 set 7, [hl] ret @@ -54,7 +53,7 @@ VictoryRoad1TrainerHeaders: ; 5da6d (17:5a6d) VictoryRoad1TrainerHeader0: ; 5da6d (17:5a6d) db $1 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d869 ; flag's byte + dw wd869 ; flag's byte dw VictoryRoad1BattleText1 ; 0x5a9a TextBeforeBattle dw VictoryRoad1AfterBattleText1 ; 0x5aa4 TextAfterBattle dw VictoryRoad1EndBattleText1 ; 0x5a9f TextEndBattle @@ -63,7 +62,7 @@ VictoryRoad1TrainerHeader0: ; 5da6d (17:5a6d) VictoryRoad1TrainerHeader1: ; 5da79 (17:5a79) db $2 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d869 ; flag's byte + dw wd869 ; flag's byte dw VictoryRoad1BattleText2 ; 0x5aa9 TextBeforeBattle dw VictoryRoad1AfterBattleText2 ; 0x5ab3 TextAfterBattle dw VictoryRoad1EndBattleText2 ; 0x5aae TextEndBattle diff --git a/scripts/victoryroad2.asm b/scripts/victoryroad2.asm index 6270a858..cf52e3a3 100755 --- a/scripts/victoryroad2.asm +++ b/scripts/victoryroad2.asm @@ -1,9 +1,9 @@ VictoryRoad2Script: ; 5179d (14:579d) - ld hl, $d126 + ld hl, wd126 bit 6, [hl] res 6, [hl] call nz, VictoryRoad2Script_517c4 - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] call nz, VictoryRoad2Script_517c9 @@ -16,11 +16,11 @@ VictoryRoad2Script: ; 5179d (14:579d) ret VictoryRoad2Script_517c4: ; 517c4 (14:57c4) - ld hl, $d869 + ld hl, wd869 res 7, [hl] VictoryRoad2Script_517c9: ; 517c9 (14:57c9) - ld a, [$d7ee] + ld a, [wd7ee] bit 0, a jr z, .asm_517da push af @@ -35,9 +35,8 @@ VictoryRoad2Script_517c9: ; 517c9 (14:57c9) ld bc, $70b VictoryRoad2Script_517e2: ; 517e2 (14:57e2) - ld [$d09f], a - ld a, $17 - call Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + ld [wd09f], a + predef Func_ee9e ret VictoryRoad2ScriptPointers: ; 517eb (14:57eb) @@ -49,8 +48,8 @@ VictoryRoad2Script0: ; 517f1 (14:57f1) ld hl, CoordsData_51816 ; $5816 call CheckBoulderCoords jp nc, CheckFightingMapTrainers - ld hl, $d7ee - ld a, [wWhichTrade] ; $cd3d + ld hl, wd7ee + ld a, [wWhichTrade] ; wWhichTrade cp $2 jr z, .asm_5180b bit 0, [hl] @@ -62,7 +61,7 @@ VictoryRoad2Script0: ; 517f1 (14:57f1) set 7, [hl] ret nz .asm_51810 - ld hl, $d126 + ld hl, wd126 set 5, [hl] ret @@ -90,7 +89,7 @@ VictoryRoad2TrainerHeaders: ; 51835 (14:5835) VictoryRoad2TrainerHeader0: ; 51835 (14:5835) db $1 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7ee ; flag's byte + dw wd7ee ; flag's byte dw VictoryRoad2BattleText1 ; 0x58ca TextBeforeBattle dw VictoryRoad2AfterBattleText1 ; 0x58d4 TextAfterBattle dw VictoryRoad2EndBattleText1 ; 0x58cf TextEndBattle @@ -99,7 +98,7 @@ VictoryRoad2TrainerHeader0: ; 51835 (14:5835) VictoryRoad2TrainerHeader2: ; 51841 (14:5841) db $2 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7ee ; flag's byte + dw wd7ee ; flag's byte dw VictoryRoad2BattleText2 ; 0x58d9 TextBeforeBattle dw VictoryRoad2AfterBattleText2 ; 0x58e3 TextAfterBattle dw VictoryRoad2EndBattleText2 ; 0x58de TextEndBattle @@ -108,7 +107,7 @@ VictoryRoad2TrainerHeader2: ; 51841 (14:5841) VictoryRoad2TrainerHeader3: ; 5184d (14:584d) db $3 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7ee ; flag's byte + dw wd7ee ; flag's byte dw VictoryRoad2BattleText3 ; 0x58e8 TextBeforeBattle dw VictoryRoad2AfterBattleText3 ; 0x58f2 TextAfterBattle dw VictoryRoad2EndBattleText3 ; 0x58ed TextEndBattle @@ -117,7 +116,7 @@ VictoryRoad2TrainerHeader3: ; 5184d (14:584d) VictoryRoad2TrainerHeader4: ; 51859 (14:5859) db $4 ; flag's bit db ($1 << 4) ; trainer's view range - dw $d7ee ; flag's byte + dw wd7ee ; flag's byte dw VictoryRoad2BattleText4 ; 0x58f7 TextBeforeBattle dw VictoryRoad2AfterBattleText4 ; 0x5901 TextAfterBattle dw VictoryRoad2EndBattleText4 ; 0x58fc TextEndBattle @@ -126,7 +125,7 @@ VictoryRoad2TrainerHeader4: ; 51859 (14:5859) VictoryRoad2TrainerHeader5: ; 51865 (14:5865) db $5 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d7ee ; flag's byte + dw wd7ee ; flag's byte dw VictoryRoad2BattleText5 ; 0x5906 TextBeforeBattle dw VictoryRoad2AfterBattleText5 ; 0x5910 TextAfterBattle dw VictoryRoad2EndBattleText5 ; 0x590b TextEndBattle @@ -135,7 +134,7 @@ VictoryRoad2TrainerHeader5: ; 51865 (14:5865) VictoryRoad2TrainerHeader6: ; 51871 (14:5871) db $6 ; flag's bit db ($0 << 4) ; trainer's view range - dw $d7ee ; flag's byte + dw wd7ee ; flag's byte dw VictoryRoad2BattleText6 ; 0x58ba TextBeforeBattle dw VictoryRoad2BattleText6 ; 0x58ba TextAfterBattle dw VictoryRoad2BattleText6 ; 0x58ba TextEndBattle diff --git a/scripts/victoryroad3.asm b/scripts/victoryroad3.asm index f2e08ca4..e35e9131 100755 --- a/scripts/victoryroad3.asm +++ b/scripts/victoryroad3.asm @@ -9,18 +9,17 @@ VictoryRoad3Script: ; 44980 (11:4980) ret VictoryRoad3Script_44996: ; 44996 (11:4996) - ld hl, $d126 + ld hl, wd126 bit 5, [hl] res 5, [hl] ret z - ld hl, $d813 + ld hl, wd813 bit 0, [hl] ret z ld a, $1d - ld [$d09f], a + ld [wd09f], a ld bc, $503 - ld a, $17 - jp Predef ; indirect jump to Func_ee9e (ee9e (3:6e9e)) + predef_jump Func_ee9e VictoryRoad3ScriptPointers: ; 449b1 (11:49b1) dw VictoryRoad3Script0 @@ -35,27 +34,25 @@ VictoryRoad3Script0: ; 449b7 (11:49b7) ld hl, .coordsData_449f9 ; $49f9 call CheckBoulderCoords jp nc, .asm_449fe - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade cp $1 jr nz, .asm_449dc - ld hl, $d126 + ld hl, wd126 set 5, [hl] - ld hl, $d813 + ld hl, wd813 set 0, [hl] ret .asm_449dc - ld hl, $d813 + ld hl, wd813 bit 6, [hl] set 6, [hl] jr nz, .asm_449fe ld a, $7a - ld [$cc4d], a - ld a, $11 - call Predef ; indirect jump to RemoveMissableObject (f1d7 (3:71d7)) + ld [wcc4d], a + predef HideObject ld a, $60 - ld [$cc4d], a - ld a, $15 - jp Predef ; indirect jump to AddMissableObject (f1c8 (3:71c8)) + ld [wcc4d], a + predef_jump ShowObject .coordsData_449f9: ; 449f9 (11:49f9) db $05,$03 @@ -64,19 +61,19 @@ VictoryRoad3Script0: ; 449b7 (11:49b7) .asm_449fe ld a, $c2 - ld [$d71d], a + ld [wd71d], a ld hl, .coordsData_449f9 ; $49f9 call Func_46981 - ld a, [wWhichTrade] ; $cd3d + ld a, [wWhichTrade] ; wWhichTrade cp $1 jr nz, .asm_44a1b - ld hl, $d72d + ld hl, wd72d res 4, [hl] - ld hl, $d732 + ld hl, wd732 res 4, [hl] ret .asm_44a1b - ld a, [$d72d] + ld a, [wd72d] bit 4, a jp z, CheckFightingMapTrainers ret @@ -97,7 +94,7 @@ VictoryRoad3TrainerHeaders: ; 44a38 (11:4a38) VictoryRoad3TrainerHeader0: ; 44a38 (11:4a38) db $1 ; flag's bit db ($1 << 4) ; trainer's view range - dw $d813 ; flag's byte + dw wd813 ; flag's byte dw VictoryRoad3BattleText2 ; 0x4a91 TextBeforeBattle dw VictoryRoad3AfterBattleText2 ; 0x4a9b TextAfterBattle dw VictoryRoad3EndBattleText2 ; 0x4a96 TextEndBattle @@ -106,7 +103,7 @@ VictoryRoad3TrainerHeader0: ; 44a38 (11:4a38) VictoryRoad3TrainerHeader2: ; 44a44 (11:4a44) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d813 ; flag's byte + dw wd813 ; flag's byte dw VictoryRoad3BattleText3 ; 0x4aa0 TextBeforeBattle dw VictoryRoad3AfterBattleText3 ; 0x4aaa TextAfterBattle dw VictoryRoad3EndBattleText3 ; 0x4aa5 TextEndBattle @@ -115,7 +112,7 @@ VictoryRoad3TrainerHeader2: ; 44a44 (11:4a44) VictoryRoad3TrainerHeader3: ; 44a50 (11:4a50) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d813 ; flag's byte + dw wd813 ; flag's byte dw VictoryRoad3BattleText4 ; 0x4aaf TextBeforeBattle dw VictoryRoad3AfterBattleText4 ; 0x4ab9 TextAfterBattle dw VictoryRoad3EndBattleText4 ; 0x4ab4 TextEndBattle @@ -124,7 +121,7 @@ VictoryRoad3TrainerHeader3: ; 44a50 (11:4a50) VictoryRoad3TrainerHeader4: ; 44a5c (11:4a5c) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d813 ; flag's byte + dw wd813 ; flag's byte dw VictoryRoad3BattleText5 ; 0x4abe TextBeforeBattle dw VictoryRoad3AfterBattleText5 ; 0x4ac8 TextAfterBattle dw VictoryRoad3EndBattleText5 ; 0x4ac3 TextEndBattle diff --git a/scripts/viridiancity.asm b/scripts/viridiancity.asm index 4bb04ba7..7a769280 100755 --- a/scripts/viridiancity.asm +++ b/scripts/viridiancity.asm @@ -15,13 +15,13 @@ ViridianCityScript0: ; 19005 (6:5005) jp ViridianCityScript_1903d ViridianCityScript_1900b: ; 1900b (6:500b) - ld a, [$d74c] + ld a, [wd74c] bit 0, a ret nz ld a, [W_OBTAINEDBADGES] cp %01111111 jr nz, .asm_1901e ; 0x19016 $6 - ld hl, $d74c + ld hl, wd74c set 0, [hl] ret .asm_1901e @@ -35,14 +35,14 @@ ViridianCityScript_1900b: ; 1900b (6:500b) ld [$ff8c], a call DisplayTextID xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a call ViridianCityScript_190cf ld a, $3 ld [W_VIRIDIANCITYCURSCRIPT], a ret ViridianCityScript_1903d: ; 1903d (6:503d) - ld a, [$d74b] + ld a, [wd74b] bit 5, a ret nz ld a, [W_YCOORD] @@ -55,20 +55,20 @@ ViridianCityScript_1903d: ; 1903d (6:503d) ld [$ff8c], a call DisplayTextID xor a - ld [H_CURRENTPRESSEDBUTTONS], a + ld [hJoyHeld], a call ViridianCityScript_190cf ld a, $3 ld [W_VIRIDIANCITYCURSCRIPT], a ret ViridianCityScript1: ; 19062 (6:5062) - ld a, [$c134] + ld a, [wSpriteStateData1 + $34] ld [$ffeb], a - ld a, [$c136] + ld a, [wSpriteStateData1 + $36] ld [$ffec], a - ld a, [$c234] + ld a, [wSpriteStateData2 + $34] ld [$ffed], a - ld a, [$c235] + ld a, [wSpriteStateData2 + $35] ld [$ffee], a xor a ld [wListScrollOffset], a @@ -86,29 +86,29 @@ ViridianCityScript1: ; 19062 (6:5062) ViridianCityScript2: ; 1908f (6:508f) ld a, [$ffeb] - ld [$c134], a + ld [wSpriteStateData1 + $34], a ld a, [$ffec] - ld [$c136], a + ld [wSpriteStateData1 + $36], a ld a, [$ffed] - ld [$c234], a + ld [wSpriteStateData2 + $34], a ld a, [$ffee] - ld [$c235], a + ld [wSpriteStateData2 + $35], a call UpdateSprites call Delay3 xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $f ld [$ff8c], a call DisplayTextID xor a ld [W_BATTLETYPE], a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $0 ld [W_VIRIDIANCITYCURSCRIPT], a ret ViridianCityScript3: ; 190c1 (6:50c1) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 @@ -119,12 +119,12 @@ ViridianCityScript3: ; 190c1 (6:50c1) ViridianCityScript_190cf: ; 190cf (6:50cf) call Func_3486 ld a, $1 - ld [$cd38], a + ld [wcd38], a ld a, $80 - ld [$ccd3], a + ld [wccd3], a xor a - ld [$c109], a - ld [wJoypadForbiddenButtonsMask], a + ld [wSpriteStateData1 + 9], a + ld [wJoyIgnore], a ret ViridianCityTextPointers: ; 190e4 (6:50e4) @@ -154,7 +154,7 @@ ViridianCityText2: ; 19107 (6:5107) cp %01111111 ld hl, ViridianCityText_19127 jr z, .asm_ae9fe ; 0x19110 - ld a, [$d751] + ld a, [wd751] bit 1, a jr nz, .asm_ae9fe ; 0x19117 ld hl, ViridianCityText_19122 @@ -175,7 +175,7 @@ ViridianCityText3: ; 1912c (6:512c) ld hl, ViridianCityText_1914d call PrintText call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr nz, .asm_6dfea ; 0x1913a ld hl, ViridianCityText_19157 @@ -201,7 +201,7 @@ ViridianCityText_19157: ; 19157 (6:5157) ViridianCityText4: ; 1915c (6:515c) db $08 ; asm - ld a, [$d74b] + ld a, [wd74b] bit 5, a jr nz, .asm_83894 ; 0x19162 ld hl, ViridianCityText_19175 @@ -236,7 +236,7 @@ ViridianCityText_19191: ; 19191 (6:5191) ViridianCityText6: ; 19196 (6:5196) db $08 ; asm - ld a, [$d74c] + ld a, [wd74c] bit 1, a jr nz, .asm_4e5a0 ; 0x1919c ld hl, ViridianCityText_191ca @@ -246,7 +246,7 @@ ViridianCityText6: ; 19196 (6:5196) jr nc, .BagFull ld hl, ReceivedTM42Text call PrintText - ld hl, $d74c + ld hl, wd74c set 1, [hl] jr .asm_3c73c ; 0x191b7 .BagFull @@ -282,7 +282,7 @@ ViridianCityText7: ; 191df (6:51df) ld c, $2 call DelayFrames call YesNoChoice - ld a, [$cc26] + ld a, [wCurrentMenuItem] and a jr z, .asm_42f68 ; 0x191f2 ld hl, ViridianCityText_1920f diff --git a/scripts/viridianforest.asm b/scripts/viridianforest.asm index 4e55733b..3744fc78 100755 --- a/scripts/viridianforest.asm +++ b/scripts/viridianforest.asm @@ -32,7 +32,7 @@ ViridianForestTrainerHeaders: ; 61142 (18:5142) ViridianForestTrainerHeader0: ; 61142 (18:5142) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7f3 ; flag's byte + dw wd7f3 ; flag's byte dw ViridianForestBattleText1 ; 0x518a TextBeforeBattle dw ViridianForestAfterBattleText1 ; 0x5194 TextAfterBattle dw ViridianForestEndBattleText1 ; 0x518f TextEndBattle @@ -41,7 +41,7 @@ ViridianForestTrainerHeader0: ; 61142 (18:5142) ViridianForestTrainerHeader1: ; 6114e (18:514e) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d7f3 ; flag's byte + dw wd7f3 ; flag's byte dw ViridianForestBattleText2 ; 0x5199 TextBeforeBattle dw ViridianForestAfterBattleText2 ; 0x51a3 TextAfterBattle dw ViridianForestEndBattleText2 ; 0x519e TextEndBattle @@ -50,7 +50,7 @@ ViridianForestTrainerHeader1: ; 6114e (18:514e) ViridianForestTrainerHeader2: ; 6115a (18:515a) db $4 ; flag's bit db ($1 << 4) ; trainer's view range - dw $d7f3 ; flag's byte + dw wd7f3 ; flag's byte dw ViridianForestBattleText3 ; 0x51a8 TextBeforeBattle dw ViridianForestAfterBattleText3 ; 0x51b2 TextAfterBattle dw ViridianForestEndBattleText3 ; 0x51ad TextEndBattle diff --git a/scripts/viridiangym.asm b/scripts/viridiangym.asm index 0f042339..65ad3553 100755 --- a/scripts/viridiangym.asm +++ b/scripts/viridiangym.asm @@ -17,7 +17,7 @@ Gym8LeaderName: ; 748cd (1d:48cd) ViridianGymScript_748d6: ; 748d6 (1d:48d6) xor a - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld [W_VIRIDIANGYMCURSCRIPT], a ld [W_CURMAPSCRIPT], a ret @@ -30,21 +30,21 @@ ViridianGymScriptPointers: ; 748e1 (1d:48e1) dw ViridianGymScript4 ViridianGymScript0: ; 748eb (1d:48eb) - ld a, [W_YCOORD] ; $d361 + ld a, [W_YCOORD] ; wd361 ld b, a - ld a, [W_XCOORD] ; $d362 + ld a, [W_XCOORD] ; wd362 ld c, a ld hl, ViridianGymArrowTilePlayerMovement call Func_3442 cp $ff jp z, CheckFightingMapTrainers call Func_3486 - ld hl, $d736 + ld hl, wd736 set 7, [hl] ld a, (SFX_02_52 - SFX_Headers_02) / 3 call PlaySound ld a, $ff - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ld a, $4 ld [W_CURMAPSCRIPT], a ret @@ -121,12 +121,12 @@ ViridianGymArrowMovement12: ; 74968 (1d:4968) db $20,$0C,$FF ViridianGymScript4: ; 7496b (1d:496b) - ld a, [$cd38] + ld a, [wcd38] and a jr nz, .asm_74980 xor a - ld [wJoypadForbiddenButtonsMask], a - ld hl, $d736 + ld [wJoyIgnore], a + ld hl, wd736 res 7, [hl] ld a, $0 ld [W_CURMAPSCRIPT], a @@ -137,16 +137,16 @@ ViridianGymScript4: ; 7496b (1d:496b) jp Bankswitch ViridianGymScript3: ; 74988 (1d:4988) - ld a, [W_ISINBATTLE] ; $d057 + ld a, [W_ISINBATTLE] ; W_ISINBATTLE cp $ff jp z, ViridianGymScript_748d6 ld a, $f0 - ld [wJoypadForbiddenButtonsMask], a + ld [wJoyIgnore], a ViridianGymScript3_74995: ; 74995 (1d:4995) ld a, $c ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d751 + ld hl, wd751 set 1, [hl] ld bc, (TM_27 << 8) | 1 call GiveItem @@ -154,7 +154,7 @@ ViridianGymScript3_74995: ; 74995 (1d:4995) ld a, $d ld [H_DOWNARROWBLINKCNT2], a ; $ff8c call DisplayTextID - ld hl, $d751 + ld hl, wd751 set 0, [hl] jr .asm_749be .BagFull @@ -164,22 +164,21 @@ ViridianGymScript3_74995: ; 74995 (1d:4995) .asm_749be ld hl, W_OBTAINEDBADGES set 7, [hl] - ld hl, $d72a + ld hl, wd72a set 7, [hl] ; deactivate gym trainers - ld a, [$d751] + ld a, [wd751] or %11111100 - ld [$d751], a - ld a, [$d752] + ld [wd751], a + ld a, [wd752] or %00000011 - ld [$d752], a + ld [wd752], a ld a, $23 - ld [$cc4d], a - ld a, $15 - call Predef ; indirect jump to AddMissableObject (f1c8 (3:71c8)) - ld hl, $d7eb + ld [wcc4d], a + predef ShowObject + ld hl, wd7eb set 1, [hl] set 7, [hl] jp ViridianGymScript_748d6 @@ -204,7 +203,7 @@ ViridianGymTrainerHeaders: ; 74a08 (1d:4a08) ViridianGymTrainerHeader0: ; 74a08 (1d:4a08) db $2 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d751 ; flag's byte + dw wd751 ; flag's byte dw ViridianGymBattleText1 ; 0x4afd TextBeforeBattle dw ViridianGymAfterBattleText1 ; 0x4b07 TextAfterBattle dw ViridianGymEndBattleText1 ; 0x4b02 TextEndBattle @@ -213,7 +212,7 @@ ViridianGymTrainerHeader0: ; 74a08 (1d:4a08) ViridianGymTrainerHeader1: ; 74a14 (1d:4a14) db $3 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d751 ; flag's byte + dw wd751 ; flag's byte dw ViridianGymBattleText2 ; 0x4b16 TextBeforeBattle dw ViridianGymAfterBattleText2 ; 0x4b20 TextAfterBattle dw ViridianGymEndBattleText2 ; 0x4b1b TextEndBattle @@ -222,7 +221,7 @@ ViridianGymTrainerHeader1: ; 74a14 (1d:4a14) ViridianGymTrainerHeader2: ; 74a20 (1d:4a20) db $4 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d751 ; flag's byte + dw wd751 ; flag's byte dw ViridianGymBattleText3 ; 0x4b2f TextBeforeBattle dw ViridianGymAfterBattleText3 ; 0x4b39 TextAfterBattle dw ViridianGymEndBattleText3 ; 0x4b34 TextEndBattle @@ -231,7 +230,7 @@ ViridianGymTrainerHeader2: ; 74a20 (1d:4a20) ViridianGymTrainerHeader3: ; 74a2c (1d:4a2c) db $5 ; flag's bit db ($2 << 4) ; trainer's view range - dw $d751 ; flag's byte + dw wd751 ; flag's byte dw ViridianGymBattleText4 ; 0x4b48 TextBeforeBattle dw ViridianGymAfterBattleText4 ; 0x4b52 TextAfterBattle dw ViridianGymEndBattleText4 ; 0x4b4d TextEndBattle @@ -240,7 +239,7 @@ ViridianGymTrainerHeader3: ; 74a2c (1d:4a2c) ViridianGymTrainerHeader4: ; 74a38 (1d:4a38) db $6 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d751 ; flag's byte + dw wd751 ; flag's byte dw ViridianGymBattleText5 ; 0x4b61 TextBeforeBattle dw ViridianGymAfterBattleText5 ; 0x4b6b TextAfterBattle dw ViridianGymEndBattleText5 ; 0x4b66 TextEndBattle @@ -249,7 +248,7 @@ ViridianGymTrainerHeader4: ; 74a38 (1d:4a38) ViridianGymTrainerHeader5: ; 74a44 (1d:4a44) db $7 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d751 ; flag's byte + dw wd751 ; flag's byte dw ViridianGymBattleText6 ; 0x4b7a TextBeforeBattle dw ViridianGymAfterBattleText6 ; 0x4b84 TextAfterBattle dw ViridianGymEndBattleText6 ; 0x4b7f TextEndBattle @@ -258,7 +257,7 @@ ViridianGymTrainerHeader5: ; 74a44 (1d:4a44) ViridianGymTrainerHeader6: ; 74a50 (1d:4a50) db $8 ; flag's bit db ($3 << 4) ; trainer's view range - dw $d751 ; flag's byte + dw wd751 ; flag's byte dw ViridianGymBattleText7 ; 0x4b93 TextBeforeBattle dw ViridianGymAfterBattleText7 ; 0x4b9d TextAfterBattle dw ViridianGymEndBattleText7 ; 0x4b98 TextEndBattle @@ -267,7 +266,7 @@ ViridianGymTrainerHeader6: ; 74a50 (1d:4a50) ViridianGymTrainerHeader7: ; 74a5c (1d:4a5c) db $9 ; flag's bit db ($4 << 4) ; trainer's view range - dw $d751 ; flag's byte + dw wd751 ; flag's byte dw ViridianGymBattleText8 ; 0x4bac TextBeforeBattle dw ViridianGymAfterBattleText8 ; 0x4bb6 TextAfterBattle dw ViridianGymEndBattleText8 ; 0x4bb1 TextEndBattle @@ -277,7 +276,7 @@ ViridianGymTrainerHeader7: ; 74a5c (1d:4a5c) ViridianGymText1: ; 74a69 (1d:4a69) db $08 ; asm - ld a, [$d751] + ld a, [wd751] bit 1, a jr z, .asm_6de66 ; 0x74a6f bit 0, a @@ -287,14 +286,13 @@ ViridianGymText1: ; 74a69 (1d:4a69) jr .asm_6dff7 ; 0x74a7b .asm_9fc95 ; 0x74a7d ld a, $1 - ld [$cc3c], a + ld [wcc3c], a ld hl, ViridianGymText_74ad9 call PrintText call GBFadeIn1 ld a, $32 - ld [$cc4d], a - ld a, $11 - call Predef + ld [wcc4d], a + predef HideObject call UpdateSprites call Delay3 call GBFadeOut1 @@ -302,18 +300,18 @@ ViridianGymText1: ; 74a69 (1d:4a69) .asm_6de66 ; 0x74aa0 ld hl, ViridianGymText_74ace call PrintText - ld hl, $d72d + ld hl, wd72d set 6, [hl] set 7, [hl] ld hl, ViridianGymText_74ad3 ld de, ViridianGymText_74ad3 call PreBattleSaveRegisters ldh a, [$8c] - ld [$cf13], a + ld [wcf13], a call EngageMapTrainer call InitBattleEnemyParameters ld a, $8 - ld [$d05c], a + ld [W_GYMLEADERNO], a ld a, $3 ld [W_VIRIDIANGYMCURSCRIPT], a .asm_6dff7 ; 0x74acb @@ -493,7 +491,7 @@ ViridianGymAfterBattleText8: ; 74bb6 (1d:4bb6) ViridianGymText10: ; 74bbb (1d:4bbb) db $08 ; asm - ld a, [$d751] + ld a, [wd751] bit 1, a jr nz, .asm_1abd1 ; 0x74bc1 ld hl, ViridianGymText_74bd4 diff --git a/scripts/viridianmart.asm b/scripts/viridianmart.asm index 1c53a5a3..a02231f8 100755 --- a/scripts/viridianmart.asm +++ b/scripts/viridianmart.asm @@ -6,7 +6,7 @@ ViridianMartScript: ; 1d46e (7:546e) jp CallFunctionInTable ViridianMartScript_1d47d: ; 1d47d (7:547d) - ld a, [$d74e] + ld a, [wd74e] bit 0, a jr nz, .asm_1d489 ; 0x1d482 $5 ld hl, ViridianMartTextPointers ; $54e0 @@ -30,11 +30,11 @@ ViridianMartScript0: ; 1d49b (7:549b) ld a, $4 ld [$ff8c], a call DisplayTextID - ld hl, $ccd3 + ld hl, wccd3 ld de, RLEMovement1d4bb call DecodeRLEList dec a - ld [$cd38], a + ld [wcd38], a call Func_3486 ld a, $1 ld [W_VIRIDIANMARKETCURSCRIPT], a @@ -46,7 +46,7 @@ RLEMovement1d4bb: ; 1d4bb (7:54bb) db $ff ViridianMartScript1: ; 1d4c0 (7:54c0) - ld a, [$cd38] + ld a, [wcd38] and a ret nz call Delay3 @@ -55,7 +55,7 @@ ViridianMartScript1: ; 1d4c0 (7:54c0) call DisplayTextID ld bc, (OAKS_PARCEL << 8) + 1 call GiveItem - ld hl, $d74e + ld hl, wd74e set 1, [hl] ld a, $2 ld [W_VIRIDIANMARKETCURSCRIPT], a @@ -35,7 +35,7 @@ _CardKeyFailText:: ; 80029 (20:4029) done _TrainerNameText:: ; 80045 (20:4045) - TX_RAM $cd6d + TX_RAM wcd6d text ": @@" _NoNibbleText:: ; 8004d (20:404d) @@ -80,7 +80,7 @@ _PokeCenterSignText:: ; 800fc (20:40fc) _FoundItemText:: ; 80119 (20:4119) text $52, " found" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _NoMoreRoomForItemText:: ; 8012a (20:412a) @@ -100,7 +100,7 @@ _OaksAideHiText:: ; 80143 (20:4143) cont "I'm supposed to" cont "give you an" cont "@" - TX_RAM $cc5b + TX_RAM wcc5b text "!" para "So, ", $52, "! Have" @@ -124,7 +124,7 @@ _OaksAideUhOhText:: ; 801e4 (20:41e4) text " kinds" line "if you want the" cont "@" - TX_RAM $cc5b + TX_RAM wcc5b text "." done @@ -136,7 +136,7 @@ _OaksAideComeBackText:: ; 80250 (20:4250) db $0 line "kinds, come back" cont "for @" - TX_RAM $cc5b + TX_RAM wcc5b text "." done @@ -154,7 +154,7 @@ _OaksAideHereYouGoText:: ; 8028c (20:428c) _OaksAideGotItemText:: ; 802d9 (20:42d9) text $52, " got the" line "@" - TX_RAM $cc5b + TX_RAM wcc5b text "!@@" _OaksAideNoRoomText:: ; 802ec (20:42ec) @@ -162,7 +162,7 @@ _OaksAideNoRoomText:: ; 802ec (20:42ec) line "don't have any" cont "room for the" cont "@" - TX_RAM $cc5b + TX_RAM wcc5b text "." done @@ -239,7 +239,7 @@ _AIBattleWithdrawText:: ; 880be (22:40be) TX_RAM W_TRAINERNAME text " with-" line "drew @" - TX_RAM W_ENEMYMONNAME + TX_RAM wEnemyMonNick text "!" prompt @@ -247,44 +247,44 @@ _AIBattleUseItemText:: ; 880d5 (22:40d5) TX_RAM W_TRAINERNAME db $0 line "used @" - TX_RAM $CD6D + TX_RAM wcd6d db $0 cont "on @" - TX_RAM W_ENEMYMONNAME + TX_RAM wEnemyMonNick text "!" prompt _TradeWentToText:: ; 880ef (22:40ef) - TX_RAM $cf4b + TX_RAM wcf4b text " went" line "to @" - TX_RAM $d887 + TX_RAM W_GRASSRATE text "." done _TradeForText:: ; 88103 (22:4103) text "For ", $52, "'s" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "," done _TradeSendsText:: ; 88112 (22:4112) - TX_RAM $d887 + TX_RAM W_GRASSRATE text " sends" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text "." done _TradeWavesFarewellText:: ; 88124 (22:4124) - TX_RAM $d887 + TX_RAM W_GRASSRATE text " waves" line "farewell as" done _TradeTransferredText:: ; 8813b (22:413b) - TX_RAM $cd6d + TX_RAM wcd6d text " is" line "transferred." done @@ -292,22 +292,22 @@ _TradeTransferredText:: ; 8813b (22:413b) _TradeTakeCareText:: ; 88150 (22:4150) text "Take good care of" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text "." done _TradeWillTradeText:: ; 8816a (22:416a) - TX_RAM $d887 + TX_RAM W_GRASSRATE text " will" line "trade @" - TX_RAM $cd6d + TX_RAM wcd6d db $0 done _TradeforText:: ; 88180 (22:4180) text "for ", $52, "'s" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "." done @@ -343,7 +343,7 @@ _OneMoreGoSlotMachineText:: ; 881f7 (22:41f7) _LinedUpText:: ; 88206 (22:4206) text " lined up!" line "Scored @" - TX_RAM $cf4b + TX_RAM wcf4b text " coins!" done @@ -356,10 +356,10 @@ _YeahText:: ; 88236 (22:4236) _DexSeenOwnedText:: ; 8823e (22:423e) text "#DEX Seen:@" - TX_NUM $cc5b, 1, 3 + TX_NUM wcc5b, 1, 3 db $0 line " Owned:@" - TX_NUM $cc5c, 1, 3 + TX_NUM wcc5c, 1, 3 db "@" _DexRatingText:: ; 88267 (22:4267) @@ -980,7 +980,7 @@ _VermilionGymTrashFailText:: ; 8948c (22:548c) _FoundHiddenItemText:: ; 894d0 (22:54d0) text $52, " found" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text "!@@" _HiddenItemBagFullText:: ; 894e1 (22:54e1) @@ -992,13 +992,13 @@ _HiddenItemBagFullText:: ; 894e1 (22:54e1) _FoundHiddenCoinsText:: ; 8950b (22:550b) text $52, " found" line "@" - db $2, $a0, $ff, $c2 ; XXX $2 + TX_BCD $ffa0, $c2 text " coins!@@" _FoundHiddenCoins2Text:: ; 89523 (22:5523) text $52, " found" line "@" - db $2, $a0, $ff, $c2 ; XXX $2 probably coins + TX_BCD $ffa0, $c2 text " coins!@@" _DroppedHiddenCoinsText:: ; 8953b (22:553b) @@ -1055,14 +1055,14 @@ _OutOfSafariBallsText:: ; 89639 (22:5639) _WildRanText:: ; 89666 (22:5666) text "Wild @" - TX_RAM W_ENEMYMONNAME + TX_RAM wEnemyMonNick db $0 line "ran!" prompt _EnemyRanText:: ; 89677 (22:5677) text "Enemy @" - TX_RAM W_ENEMYMONNAME + TX_RAM wEnemyMonNick db $0 line "ran!" prompt @@ -1084,15 +1084,14 @@ _HurtByLeechSeedText:: ; 896b3 (22:56b3) _EnemyMonFaintedText:: ; 0x896c7 text "Enemy @" - TX_RAM W_ENEMYMONNAME + TX_RAM wEnemyMonNick db $0 line "fainted!" prompt _MoneyForWinningText:: ; 896dd (22:56dd) text $52, " got ¥@" - ;XXX $2 - db $2, $79, $d0, $c3 + TX_BCD wd079, $c3 db $0 line "for winning!" prompt @@ -1105,7 +1104,7 @@ _TrainerDefeatedText:: ; 896f9 (22:56f9) prompt _PlayerMonFaintedText:: ; 8970c (22:570c) - TX_RAM W_PLAYERMONNAME + TX_RAM wBattleMonNick db $0 line "fainted!" prompt @@ -1139,7 +1138,7 @@ _TrainerAboutToUseText:: ; 89784 (22:5784) text " is" line "about to use" cont"@" - TX_RAM W_ENEMYMONNAME + TX_RAM wEnemyMonNick text "!" para "Will ", $52 @@ -1150,7 +1149,7 @@ _TrainerSentOutText:: ; 897b4 (22:57b4) TX_RAM W_TRAINERNAME text " sent" line "out @" - TX_RAM W_ENEMYMONNAME + TX_RAM wEnemyMonNick text "!" done @@ -1179,7 +1178,7 @@ _ItemsCantBeUsedHereText:: ; 89831 (22:5831) prompt _AlreadyOutText:: ; 8984b (22:584b) - TX_RAM W_PLAYERMONNAME + TX_RAM wBattleMonNick text " is" line "already out!" prompt @@ -1195,7 +1194,7 @@ _MoveDisabledText:: ; 8987b (22:587b) prompt _NoMovesLeftText:: ; 89892 (22:5892) - TX_RAM W_PLAYERMONNAME + TX_RAM wBattleMonNick text " has no" line "moves left!" done @@ -1208,7 +1207,7 @@ _MultiHitText:: ; 898aa (22:58aa) prompt _ScaredText:: ; 898c7 (22:58c7) - TX_RAM W_PLAYERMONNAME + TX_RAM wBattleMonNick text " is too" line "scared to move!" prompt @@ -1296,7 +1295,7 @@ _CantMoveText:: ; 89a1b (22:5a1b) _MoveIsDisabledText:: ; 89a29 (22:5a29) text $5a, "'s" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text " is" cont "disabled!" prompt @@ -1317,7 +1316,7 @@ _InsteadText:: ; 89a56 (22:5a56) cont "@@" _CF4BText:: ; 89a62 (22:5a62) - TX_RAM $cf4b + TX_RAM wcf4b text "@" _ExclamationPoint1Text:: ; 89a67 (22:5a67) @@ -1370,31 +1369,31 @@ _OHKOText:: ; 89ad8 (22:5ad8) prompt _LoafingAroundText:: ; 89ae5 (22:5ae5) - TX_RAM W_PLAYERMONNAME + TX_RAM wBattleMonNick text " is" line "loafing around." prompt _BeganToNapText:: ; 89afd (22:5afd) - TX_RAM W_PLAYERMONNAME + TX_RAM wBattleMonNick text " began" line "to nap!" prompt _WontObeyText:: ; 89b10 (22:5b10) - TX_RAM W_PLAYERMONNAME + TX_RAM wBattleMonNick text " won't" line "obey!" prompt _TurnedAwayText:: ; 89b20 (22:5b20) - TX_RAM W_PLAYERMONNAME + TX_RAM wBattleMonNick text " turned" line "away!" prompt _IgnoredOrdersText:: ; 89b32 (22:5b32) - TX_RAM W_PLAYERMONNAME + TX_RAM wBattleMonNick db $0 line "ignored orders!" prompt @@ -1422,12 +1421,12 @@ _MirrorMoveFailedText:: ; 89b96 (22:5b96) _HitXTimesText:: ; 89baf (22:5baf) text "Hit @" - TX_NUM $cd05, 1, 1 + TX_NUM wcd05, 1, 1 text " times!" prompt _GainedText:: ; 89bc2 (22:5bc2) - TX_RAM $cd6d + TX_RAM wcd6d text " gained" line "@@" @@ -1439,20 +1438,20 @@ _BoostedText:: ; 89be1 (22:5be1) text "a boosted" cont "@@" _ExpPointsText:: ; 89bee (22:5bee) - TX_NUM $cf4b, 2, 4 + TX_NUM wcf4b, 2, 4 text " EXP. Points!" prompt _GrewLevelText:: ; 89c01 (22:5c01) - TX_RAM $cd6d + TX_RAM wcd6d text " grew" line "to level @" - TX_NUM $d127, 1, 3 + TX_NUM W_CURENEMYLVL, 1, 3 text "!@@" _WildMonAppearedText:: ; 89c1d (22:5c1d) text "Wild @" - TX_RAM W_ENEMYMONNAME + TX_RAM wEnemyMonNick db $0 line "appeared!" prompt @@ -1460,13 +1459,13 @@ _WildMonAppearedText:: ; 89c1d (22:5c1d) _HookedMonAttackedText:: ; 89c33 (22:5c33) text "The hooked" line "@" - TX_RAM W_ENEMYMONNAME + TX_RAM wEnemyMonNick db $0 cont "attacked!" prompt _EnemyAppearedText:: ; 89c4f (22:5c4f) - TX_RAM W_ENEMYMONNAME + TX_RAM wEnemyMonNick db $0 line "appeared!" prompt @@ -1502,12 +1501,12 @@ _EnemysWeakText:: ; 89cd6 (22:5cd6) line "Get'm! @@" _PlayerMon1Text:: ; 89cf0 (22:5cf0) - TX_RAM W_PLAYERMONNAME + TX_RAM wBattleMonNick text "!" done _PlayerMon2Text:: ; 89cf6 (22:5cf6) - TX_RAM W_PLAYERMONNAME + TX_RAM wBattleMonNick text " @@" _EnoughText:: ; 89cfd (22:5cfd) @@ -1536,25 +1535,23 @@ _NotVeryEffectiveText:: ; 89d38 (22:5d38) _SafariZoneEatingText:: ; 89d53 (22:5d53) text "Wild @" - TX_RAM W_ENEMYMONNAME + TX_RAM wEnemyMonNick db $0 line "is eating!" prompt _SafariZoneAngryText:: ; 89d6a (22:5d6a) text "Wild @" - TX_RAM W_ENEMYMONNAME + TX_RAM wEnemyMonNick db $0 line "is angry!" prompt ; money related -; XXX $2 BCD macro -; $2, pointer, byte _PickUpPayDayMoneyText:: ; 89d80 (22:5d80) text $52, " picked up" line "¥@" - db $2, $e5, $cc, $c3 + TX_BCD wcce5, $c3 text "!" prompt @@ -1593,7 +1590,7 @@ _PartyMenuSwapMonText:: ; 89e1f (22:5e1f) done _PotionText:: ; 89e31 (22:5e31) - TX_RAM $cd6d + TX_RAM wcd6d db $0 line "recovered by @" TX_NUM wHPBarHPDifference, 2, 3 @@ -1601,52 +1598,52 @@ _PotionText:: ; 89e31 (22:5e31) done _AntidoteText:: ; 89e4b (22:5e4b) - TX_RAM $cd6d + TX_RAM wcd6d text " was" line "cured of poison!" done _ParlyzHealText:: ; 89e65 (22:5e65) - TX_RAM $cd6d + TX_RAM wcd6d text "'s" line "rid of paralysis!" done _BurnHealText:: ; 89e7d (22:5e7d) - TX_RAM $cd6d + TX_RAM wcd6d text "'s" line "burn was healed!" done _IceHealText:: ; 89e94 (22:5e94) - TX_RAM $cd6d + TX_RAM wcd6d text " was" line "defrosted!" done _AwakeningText:: ; 89ea8 (22:5ea8) - TX_RAM $cd6d + TX_RAM wcd6d db $0 line "woke up!" done _FullHealText:: ; 89eb6 (22:5eb6) - TX_RAM $cd6d + TX_RAM wcd6d text "'s" line "health returned!" done _ReviveText:: ; 89ecd (22:5ecd) - TX_RAM $cd6d + TX_RAM wcd6d db $0 line "is revitalized!" done _RareCandyText:: ; 89ee2 (22:5ee2) - TX_RAM $cd6d + TX_RAM wcd6d text " grew" line "to level @" - TX_NUM $d127, $1,$3 + TX_NUM W_CURENEMYLVL, $1,$3 text "!@@" _TurnedOnPC1Text:: ; 89efe (22:5efe) @@ -1697,7 +1694,7 @@ _DepositHowManyText:: ; 89ff5 (22:5ff5) done _ItemWasStoredText:: ; 8a000 (22:6000) - TX_RAM $cd6d + TX_RAM wcd6d text " was" line "stored via PC." prompt @@ -1724,7 +1721,7 @@ _WithdrawHowManyText:: ; 8a073 (22:6073) _WithdrewItemText:: ; 8a07e (22:607e) text "Withdrew" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text "." prompt @@ -1769,10 +1766,10 @@ _DepositWhichMonText:: ; 0x8a144 done _MonWasStoredText:: ; 0x8a159 - TX_RAM $cf4b + TX_RAM wcf4b text " was" line "stored in Box @" - TX_RAM $cd3d + TX_RAM wWhichTrade text "." prompt @@ -1787,11 +1784,11 @@ _BoxFullText:: ; 0x8a198 prompt _MonIsTakenOutText:: ; 0x8a1b9 - TX_RAM $cf4b + TX_RAM wcf4b text " is" line "taken out." cont "Got @" - TX_RAM $cf4b + TX_RAM wcf4b text "." prompt @@ -1816,19 +1813,19 @@ _ReleaseWhichMonText:: ; 0x8a228 _OnceReleasedText:: ; 0x8a23d text "Once released," line "@" - TX_RAM $cf4b + TX_RAM wcf4b text " is" cont "gone forever. OK?" done _MonWasReleasedText:: ; 0x8a268 - TX_RAM $cf4b + TX_RAM wcf4b text " was" line "released outside." cont "Bye @" _CF4BExclamationText:: ; 8a288 (22:6288) - TX_RAM $cf4b + TX_RAM wcf4b text "!" prompt @@ -1852,7 +1849,7 @@ _HereYouGoText:: ; 8a2e7 (22:62e7) _SoYouWantPrizeText:: ; 8a2f6 (22:62f6) text "So, you want" line "@" - TX_RAM $CD6D + TX_RAM wcd6d text "?" done @@ -1905,7 +1902,7 @@ _DoYouWantToNicknameText:: ; 0x8a605 text "Do you want to" line "give a nickname" cont "to @" - TX_RAM $cd6d + TX_RAM wcd6d text "?" done @@ -1921,10 +1918,10 @@ _HisNameIsText:: ; 8a64a (22:664a) prompt _WillBeTradedText:: ; 8a677 (22:6677) - TX_RAM $cd3f + TX_RAM wTrainerFacingDirection text " and" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text " will" cont "be traded." done @@ -2044,27 +2041,27 @@ _ChooseABoxText:: ; 946b0 (25:46b0) line $4a, " BOX.@@" _EvolvedText:: ; 946c2 (25:46c2) - TX_RAM $cf4b + TX_RAM wcf4b text " evolved" done _IntoText:: ; 946cf (25:46cf) db $0 line "into @" - TX_RAM $cd6d + TX_RAM wcd6d text "!" done _StoppedEvolvingText:: ; 946dd (25:46dd) text "Huh? @" - TX_RAM $cf4b + TX_RAM wcf4b db $0 line "stopped evolving!" prompt _IsEvolvingText:: ; 946fb (25:46fb) text "What? @" - TX_RAM $cf4b + TX_RAM wcf4b db $0 line "is evolving!" done @@ -2107,7 +2104,7 @@ _FireDefrostedText:: ; 94782 (25:4782) _MonsStatsRoseText:: ; 94795 (25:4795) text $5a, "'s" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "@@" _GreatlyRoseText:: ; 947a0 (25:47a0) @@ -2120,7 +2117,7 @@ _RoseText:: ; 947ab (25:47ab) _MonsStatsFellText:: ; 947b3 (25:47b3) text $59, "'s" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "@@" _GreatlyFellText:: ; 947be (25:47be) @@ -2187,14 +2184,14 @@ _MimicLearnedMoveText:: ; 9488c (25:488c) text $5a line "learned" cont "@" - TX_RAM $cd6d + TX_RAM wcd6d text "!" prompt _MoveWasDisabledText:: ; 9489e (25:489e) text $59, "'s" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text " was" cont "disabled!" prompt @@ -2297,7 +2294,7 @@ _TransformedText:: ; 94a6c (25:4a6c) text $5a line "transformed into" cont "@" - TX_RAM $cd6d + TX_RAM wcd6d text "!" prompt @@ -2441,7 +2438,7 @@ _PokemartGreetingText:: ; a259c (28:659c) done _PokemonFaintedText:: ; a25b7 (28:65b7) - TX_RAM $cd6d + TX_RAM wcd6d db $0 line "fainted!" done @@ -2464,11 +2461,11 @@ _PokemartBuyingGreetingText:: ; a2608 (28:6608) done _PokemartTellBuyPriceText:: ; a2619 (28:6619) - TX_RAM $cf4b + TX_RAM wcf4b text "?" line "That will be" cont "¥@" - db $2, $9f, $ff, $c3 + TX_BCD $ff9f, $c3 text ". OK?" done @@ -2495,7 +2492,7 @@ _PokemonSellingGreetingText:: ; a2690 (28:6690) _PokemartTellSellPriceText:: ; a26ae (28:66ae) text "I can pay you" line "¥@" - db $2, $9f, $ff, $c3 ; XXX + TX_BCD $ff9f, $c3 text " for that." done @@ -2519,10 +2516,10 @@ _PokemartAnythingElseText:: ; a2719 (28:6719) done _LearnedMove1Text:: ; a273b (28:673b) - TX_RAM $d036 + TX_RAM wd036 text " learned" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _WhichMoveToForgetText:: ; a2750 (28:6750) @@ -2533,29 +2530,29 @@ _WhichMoveToForgetText:: ; a2750 (28:6750) _AbandonLearningText:: ; a2771 (28:6771) text "Abandon learning" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "?" done _DidNotLearnText:: ; a278a (28:678a) - TX_RAM $d036 + TX_RAM wd036 db $0 line "did not learn" cont "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!" prompt _TryingToLearnText:: ; a27a4 (28:67a4) - TX_RAM $d036 + TX_RAM wd036 text " is" line "trying to learn" cont "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!" para "But, @" - TX_RAM $d036 + TX_RAM wd036 db $0 line "can't learn more" cont "than 4 moves!" @@ -2563,7 +2560,7 @@ _TryingToLearnText:: ; a27a4 (28:67a4) para "Delete an older" line "move to make room" cont "for @" - TX_RAM $cf4b + TX_RAM wcf4b text "?" done @@ -2576,10 +2573,10 @@ _PoofText:: ; a2827 (28:6827) _ForgotAndText:: ; a2830 (28:6830) db $0 para "@" - TX_RAM $d036 + TX_RAM wd036 text " forgot" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text "!" para "And..." @@ -2667,12 +2664,12 @@ _CableClubNPCText6:: ; a4014 (29:4014) done _UsedStrengthText:: ; a403c (29:403c) - TX_RAM $cd6d + TX_RAM wcd6d text " used" line "STRENGTH.@@" _CanMoveBouldersText:: ; a4051 (29:4051) - TX_RAM $cd6d + TX_RAM wcd6d text " can" line "move boulders." prompt @@ -2698,13 +2695,13 @@ _WarpToLastPokemonCenterText:: ; a40cc (29:40cc) done _CannotUseTeleportNowText:: ; a40eb (29:40eb) - TX_RAM $cd6d + TX_RAM wcd6d text " can't" line "use TELEPORT now." prompt _CannotFlyHereText:: ; a4107 (29:4107) - TX_RAM $cd6d + TX_RAM wcd6d text " can't" line "FLY here." prompt @@ -2732,18 +2729,18 @@ _CannotGetOffHereText:: ; a4168 (29:4168) _GotMonText:: ; a4180 (29:4180) text $52, " got" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text "!@@" _SetToBoxText:: ; a418f (29:418f) text "There's no more" line "room for #MON!" cont "@" - TX_RAM W_BOXMON1NAME + TX_RAM wBoxMonNicks text " was" cont "sent to #MON" cont "BOX @" - TX_RAM $cf4b + TX_RAM wcf4b text " on PC!" done @@ -2801,19 +2798,19 @@ _ItemUseBallText04:: ; a67b2 (29:67b2) _ItemUseBallText05:: ; a67cf (29:67cf) text "All right!" line "@" - TX_RAM W_ENEMYMONNAME + TX_RAM wEnemyMonNick text " was" cont "caught!@@" _ItemUseBallText07:: ; a67ee (29:67ee) - TX_RAM W_BOXMON1NAME + TX_RAM wBoxMonNicks text " was" line "transferred to" cont "BILL's PC!" prompt _ItemUseBallText08:: ; a6810 (29:6810) - TX_RAM W_BOXMON1NAME + TX_RAM wBoxMonNicks text " was" line "transferred to" cont "someone's PC!" @@ -2823,13 +2820,13 @@ _ItemUseBallText06:: ; a6835 (29:6835) text "New #DEX data" line "will be added for" cont "@" - TX_RAM W_ENEMYMONNAME + TX_RAM wEnemyMonNick text "!@@" _SurfingGotOnText:: ; a685e (29:685e) text $52, " got on" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text "!" prompt @@ -2839,10 +2836,10 @@ _SurfingNoPlaceToGetOffText:: ; a686f (29:686f) prompt _VitaminStatRoseText:: ; a688c (29:688c) - TX_RAM $cd6d + TX_RAM wcd6d text "'s" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text " rose." prompt @@ -2881,7 +2878,7 @@ _PlayedFluteHadEffectText:: ; a6928 (29:6928) _CoinCaseNumCoinsText:: ; a6940 (29:6940) text "Coins" line "@" - db $2, $a4, $d5, $c2 ; print BCD number + TX_BCD wPlayerCoins, $c2 text " " prompt @@ -2907,13 +2904,13 @@ _RestorePPWhichTechniqueText:: ; a69c2 (29:69c2) done _PPMaxedOutText:: ; a69e2 (29:69e2) - TX_RAM $cf4b + TX_RAM wcf4b text "'s PP" line "is maxed out." prompt _PPIncreasedText:: ; a69f9 (29:69f9) - TX_RAM $cf4b + TX_RAM wcf4b text "'s PP" line "increased." prompt @@ -2933,26 +2930,26 @@ _BootedUpHMText:: ; a6a30 (29:6a30) _TeachMachineMoveText:: ; a6a42 (29:6a42) text "It contained" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!" para "Teach @" - TX_RAM $cf4b + TX_RAM wcf4b db $0 line "to a #MON?" done _MonCannotLearnMachineMoveText:: ; a6a6e (29:6a6e) - TX_RAM $cd6d + TX_RAM wcd6d text " is not" line "compatible with" cont "@" - TX_RAM $cf4b + TX_RAM wcf4b text "." para "It can't learn" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "." prompt @@ -2989,7 +2986,7 @@ _NoCyclingAllowedHereText:: ; a6b34 (29:6b34) _NoSurfingHereText:: ; a6b4e (29:6b4e) text "No SURFing on" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text " here!" prompt @@ -3006,7 +3003,7 @@ _ItemUseText001:: ; a8000 (2a:4000) text $52," used@@" _ItemUseText002:: ; a8009 (2a:4009) - TX_RAM $cf4b + TX_RAM wcf4b text "!" done @@ -3014,7 +3011,7 @@ _GotOnBicycleText1:: ; a800f (2a:400f) text $52, " got on the@@" _GotOnBicycleText2:: ; a801e (2a:401e) - TX_RAM $cf4b + TX_RAM wcf4b text "!" prompt @@ -3023,21 +3020,21 @@ _GotOffBicycleText1:: ; a8024 (2a:4024) _GotOffBicycleText2:: ; a8030 (2a:4030) text "the @" - TX_RAM $cf4b + TX_RAM wcf4b text "." prompt _ThrewAwayItemText:: ; a803c (2a:403c) text "Threw away" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text "." prompt _IsItOKToTossItemText:: ; a804f (2a:404f) text "Is it OK to toss" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "?" prompt @@ -3047,10 +3044,10 @@ _TooImportantToTossText:: ; a8068 (2a:4068) prompt _AlreadyKnowsText:: ; a8088 (2a:4088) - TX_RAM $cd6d + TX_RAM wcd6d text " knows" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!" prompt @@ -3062,21 +3059,21 @@ _ConnectCableText:: ; a809a (2a:409a) _TradedForText:: ; a80bc (2a:40bc) text $52, " traded" line "@" - TX_RAM $cd13 + TX_RAM wcd13 text " for" cont "@" - TX_RAM $cd1e + TX_RAM wPlayerMonAccuracyMod text "!@@" _WannaTrade1Text:: ; a80d8 (2a:40d8) text "I'm looking for" line "@" - TX_RAM $cd13 + TX_RAM wcd13 text "! Wanna" para "trade one for" line "@" - TX_RAM $cd1e + TX_RAM wPlayerMonAccuracyMod text "? " done @@ -3088,7 +3085,7 @@ _NoTrade1Text:: ; a810b (2a:410b) _WrongMon1Text:: ; a811d (2a:411d) text "What? That's not" line "@" - TX_RAM $cd13 + TX_RAM wcd13 text "!" para "If you get one," @@ -3102,7 +3099,7 @@ _Thanks1Text:: ; a8155 (2a:4155) _AfterTrade1Text:: ; a8162 (2a:4162) text "Isn't my old" line "@" - TX_RAM $cd1e + TX_RAM wPlayerMonAccuracyMod text " great?" done @@ -3111,10 +3108,10 @@ _WannaTrade2Text:: ; a817c (2a:417c) line "you want to trade" para "your @" - TX_RAM $cd13 + TX_RAM wcd13 db $0 line "for @" - TX_RAM $cd1e + TX_RAM wPlayerMonAccuracyMod text "?" done @@ -3126,7 +3123,7 @@ _NoTrade2Text:: ; a81b5 (2a:41b5) _WrongMon2Text:: ; a81d3 (2a:41d3) text "Hmmm? This isn't" line "@" - TX_RAM $cd13 + TX_RAM wcd13 text "." para "Think of me when" @@ -3139,7 +3136,7 @@ _Thanks2Text:: ; a8209 (2a:4209) _AfterTrade2Text:: ; a8212 (2a:4212) text "The @" - TX_RAM $cd13 + TX_RAM wcd13 text " you" line "traded to me" @@ -3149,12 +3146,12 @@ _AfterTrade2Text:: ; a8212 (2a:4212) _WannaTrade3Text:: ; a8240 (2a:4240) text "Hi! Do you have" line "@" - TX_RAM $cd13 + TX_RAM wcd13 text "?" para "Want to trade it" line "for @" - TX_RAM $cd1e + TX_RAM wPlayerMonAccuracyMod text "?" done @@ -3165,7 +3162,7 @@ _NoTrade3Text:: ; a8274 (2a:4274) _WrongMon3Text:: ; a8284 (2a:4284) text "...This is no" line "@" - TX_RAM $cd13 + TX_RAM wcd13 text "." para "If you get one," @@ -3179,11 +3176,11 @@ _Thanks3Text:: ; a82bc (2a:42bc) _AfterTrade3Text:: ; a82c9 (2a:42c9) text "How is my old" line "@" - TX_RAM $cd1e + TX_RAM wPlayerMonAccuracyMod text "?" para "My @" - TX_RAM $cd13 + TX_RAM wcd13 text " is" line "doing great!" done @@ -3194,7 +3191,7 @@ _NothingToCutText:: ; a82f8 (2a:42f8) prompt _UsedCutText:: ; a8315 (2a:4315) - TX_RAM $cd6d + TX_RAM wcd6d text " hacked" line "away with CUT!" prompt diff --git a/text/maps/bills_house.asm b/text/maps/bills_house.asm index 24062b5d..5963d7ea 100644 --- a/text/maps/bills_house.asm +++ b/text/maps/bills_house.asm @@ -56,7 +56,7 @@ _BillThankYouText:: ; 8d3f5 (23:53f5) _SSTicketReceivedText:: ; 8d499 (23:5499) text $52, " received" line "an @" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _SSTicketNoRoomText:: ; 8d4b0 (23:54b0) diff --git a/text/maps/blues_house.asm b/text/maps/blues_house.asm index a6f4264a..147b23fb 100644 --- a/text/maps/blues_house.asm +++ b/text/maps/blues_house.asm @@ -14,7 +14,7 @@ _DaisyOfferMapText:: _GotMapText:: text $52," got a" line "@" - TX_RAM $CF4B + TX_RAM wcf4b text "!@@" _DaisyBagFullText:: diff --git a/text/maps/celadon_city.asm b/text/maps/celadon_city.asm index c7b2cb1c..585ece03 100644 --- a/text/maps/celadon_city.asm +++ b/text/maps/celadon_city.asm @@ -42,7 +42,7 @@ _TM41PreText:: ; a5afd (29:5afd) _ReceivedTM41Text:: ; a5b5a (29:5b5a) text $52, " received" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _TM41ExplanationText:: ; a5b6e (29:5b6e) diff --git a/text/maps/celadon_dept_store_3f.asm b/text/maps/celadon_dept_store_3f.asm index 19c74bd4..289ed1d4 100644 --- a/text/maps/celadon_dept_store_3f.asm +++ b/text/maps/celadon_dept_store_3f.asm @@ -10,7 +10,7 @@ _TM18PreReceiveText:: ; 9c814 (27:4814) _ReceivedTM18Text:: ; 9c85a (27:485a) text $52, " received" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _TM18ExplanationText:: ; 9c86e (27:486e) diff --git a/text/maps/celadon_dept_store_roof.asm b/text/maps/celadon_dept_store_roof.asm index 3d83317f..851afc41 100644 --- a/text/maps/celadon_dept_store_roof.asm +++ b/text/maps/celadon_dept_store_roof.asm @@ -16,13 +16,13 @@ _CeladonMartRoofText_484f3:: ; 9cbcc (27:4bcc) _CeladonMartRoofText_484f9:: ; 9cc06 (27:4c06) text $52, " received" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _CeladonMartRoofText_484fe:: ; 9cc1a (27:4c1a) db $0 para "@" - TX_RAM $cf4b + TX_RAM wcf4b text " contains" line "ICE BEAM!" @@ -42,13 +42,13 @@ _CeladonMartRoofText_48504:: ; 9cc5a (27:4c5a) _CeladonMartRoofText_4850a:: ; 9cc91 (27:4c91) text $52, " received" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _CeladonMartRoofText_4850f:: ; 9cca5 (27:4ca5) db $0 para "@" - TX_RAM $cf4b + TX_RAM wcf4b text " contains" line "ROCK SLIDE!" @@ -123,7 +123,7 @@ _VendingMachineText4:: ; 9ce96 (27:4e96) done _VendingMachineText5:: ; 9ceaf (27:4eaf) - TX_RAM $cf4b + TX_RAM wcf4b db $0 line "popped out!" done diff --git a/text/maps/celadon_diner.asm b/text/maps/celadon_diner.asm index ee27fadd..2b4cc321 100644 --- a/text/maps/celadon_diner.asm +++ b/text/maps/celadon_diner.asm @@ -44,7 +44,7 @@ _CeladonDinerText_491a7:: ; 9e003 (27:6003) _ReceivedCoinCaseText:: ; 9e07a (27:607a) text $52, " received" line "a @" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _CoinCaseNoRoomText:: ; 9e090 (27:6090) diff --git a/text/maps/celadon_gym.asm b/text/maps/celadon_gym.asm index e377365e..66452a2c 100644 --- a/text/maps/celadon_gym.asm +++ b/text/maps/celadon_gym.asm @@ -64,7 +64,7 @@ _CeladonGymText9:: ; 9d481 (27:5481) _ReceivedTM21Text:: ; 9d50c (27:550c) text $52, " received" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _TM21ExplanationText:: ; 9d520 (27:5520) diff --git a/text/maps/champion.asm b/text/maps/champion.asm index 259d530b..19484c23 100644 --- a/text/maps/champion.asm +++ b/text/maps/champion.asm @@ -96,7 +96,7 @@ _GaryText_76120:: ; 863ca (21:63ca) line "much since you" cont "first left with" cont "@" - TX_RAM $cd6d + TX_RAM wcd6d text "!" para $52, ", you have" diff --git a/text/maps/cinnabar_gym.asm b/text/maps/cinnabar_gym.asm index 4d8f796e..c3208a84 100644 --- a/text/maps/cinnabar_gym.asm +++ b/text/maps/cinnabar_gym.asm @@ -44,7 +44,7 @@ _BlaineBadgeText:: ; a0946 (28:4946) _ReceivedTM38Text:: ; a09a8 (28:49a8) text $52, " received" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _TM38ExplanationText:: ; a09bc (28:49bc) diff --git a/text/maps/cinnabar_lab_fossil_room.asm b/text/maps/cinnabar_lab_fossil_room.asm index 3e544bd6..cdbaca13 100644 --- a/text/maps/cinnabar_lab_fossil_room.asm +++ b/text/maps/cinnabar_lab_fossil_room.asm @@ -30,7 +30,7 @@ _Lab4Text_75dd5:: ; a118d (28:518d) line "back to life!" para "It was @" - TX_RAM $cf4b + TX_RAM wcf4b db $0 line "like I think!" prompt @@ -38,12 +38,12 @@ _Lab4Text_75dd5:: ; a118d (28:518d) _Lab4Text_610ae:: ; a11d6 (28:51d6) text "Oh! That is" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text "!" para "It is fossil of" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text ", a" cont "#MON that is" cont "already extinct!" @@ -60,7 +60,7 @@ _Lab4Text_610b3:: ; a1259 (28:5259) para $52, " handed" line "over @" - TX_RAM $cd6d + TX_RAM wcd6d text "!" prompt diff --git a/text/maps/cinnabar_lab_metronome_room.asm b/text/maps/cinnabar_lab_metronome_room.asm index c52dccec..af5dc150 100644 --- a/text/maps/cinnabar_lab_metronome_room.asm +++ b/text/maps/cinnabar_lab_metronome_room.asm @@ -9,7 +9,7 @@ _TM35PreReceiveText:: ; a0f09 (28:4f09) _ReceivedTM35Text:: ; a0f48 (28:4f48) text $52, " received " line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _TM35ExplanationText:: ; a0f5d (28:4f5d) diff --git a/text/maps/copycats_house_2f.asm b/text/maps/copycats_house_2f.asm index 502f7611..85202aa8 100644 --- a/text/maps/copycats_house_2f.asm +++ b/text/maps/copycats_house_2f.asm @@ -29,7 +29,7 @@ _TM31PreReceiveText:: ; a1636 (28:5636) _ReceivedTM31Text:: ; a1675 (28:5675) text $52, " received" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _TM31ExplanationText1:: ; a1689 (28:5689) diff --git a/text/maps/daycare_1.asm b/text/maps/daycare_1.asm index 1743cbc3..a4182351 100644 --- a/text/maps/daycare_1.asm +++ b/text/maps/daycare_1.asm @@ -13,7 +13,7 @@ _DayCareMText_56414:: ; 8abd4 (22:6bd4) _DayCareMText_56419:: ; 8abf0 (22:6bf0) text "Fine, I'll look" line "after @" - TX_RAM $cd6d + TX_RAM wcd6d db $0 cont "for a while." prompt @@ -25,7 +25,7 @@ _DayCareMText_5641e:: ; 8ac19 (22:6c19) _DayCareMText_56423:: ; 8ac32 (22:6c32) text "Your @" - TX_RAM $cd6d + TX_RAM wcd6d db $0 line "has grown a lot!" @@ -33,7 +33,7 @@ _DayCareMText_56423:: ; 8ac32 (22:6c32) line "grown by @" DayCareMText_8ac67:: ; 8ac67 (22:6c67) - TX_NUM $cd3e,$1,$3 + TX_NUM wTrainerEngageDistance,$1,$3 text "!" para "Aren't I great?" @@ -41,7 +41,7 @@ DayCareMText_8ac67:: ; 8ac67 (22:6c67) _DayCareMText_56428:: ; 8ac7d (22:6c7d) text "You owe me ¥@" - db $2, $3f, $cd, $c2 + TX_BCD wcd3f, $c2 db $0 line "for the return" cont "of this #MON." @@ -57,7 +57,7 @@ _DayCareMText_5642d:: ; 8acae (22:6cae) _DayCareMText_56432:: ; 8acc1 (22:6cc1) text "Back already?" line "Your @" - TX_RAM $cd6d + TX_RAM wcd6d db $0 cont "needs some more" cont "time with me." diff --git a/text/maps/fan_club.asm b/text/maps/fan_club.asm index 7e98b181..b623fa4a 100644 --- a/text/maps/fan_club.asm +++ b/text/maps/fan_club.asm @@ -85,7 +85,7 @@ FanClubChairStoryText:: ReceivedBikeVoucherText:: text $52, " received" line "a @" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" ExplainBikeVoucherText:: diff --git a/text/maps/fuchsia_fishing_house.asm b/text/maps/fuchsia_fishing_house.asm index 5ad09ef0..23d0476b 100644 --- a/text/maps/fuchsia_fishing_house.asm +++ b/text/maps/fuchsia_fishing_house.asm @@ -19,7 +19,7 @@ _FuchsiaHouse3Text_561c2:: ; a06e8 (28:46e8) para $52, " received" line "a @" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _FuchsiaHouse3Text_56212:: ; a0737 (28:4737) diff --git a/text/maps/fuchsia_gym_2.asm b/text/maps/fuchsia_gym_2.asm index a6616dde..e0cb6807 100644 --- a/text/maps/fuchsia_gym_2.asm +++ b/text/maps/fuchsia_gym_2.asm @@ -27,7 +27,7 @@ _UnnamedText_75590:: ; a0069 (28:4069) _ReceivedTM06Text:: ; a00eb (28:40eb) text $52, " received" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _TM06ExplanationText:: ; a00ff (28:40ff) diff --git a/text/maps/fujis_house.asm b/text/maps/fujis_house.asm index 033777c2..b54c55f2 100644 --- a/text/maps/fujis_house.asm +++ b/text/maps/fujis_house.asm @@ -48,7 +48,7 @@ _LavenderHouse1Text_1d94c:: ; 99f97 (26:5f97) _ReceivedFluteText:: ; 99ffb (26:5ffb) text $52, " received" line "a @" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _FluteExplanationText:: ; 9a011 (26:6011) diff --git a/text/maps/mr_psychics_house.asm b/text/maps/mr_psychics_house.asm index c35779e9..ed181eb6 100644 --- a/text/maps/mr_psychics_house.asm +++ b/text/maps/mr_psychics_house.asm @@ -8,7 +8,7 @@ _TM29PreReceiveText:: ; a24fe (28:64fe) _ReceivedTM29Text:: ; a252a (28:652a) text $52, " received" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _TM29ExplanationText:: ; a253e (28:653e) diff --git a/text/maps/mt_moon_b2f.asm b/text/maps/mt_moon_b2f.asm index 4088e280..f8357f00 100644 --- a/text/maps/mt_moon_b2f.asm +++ b/text/maps/mt_moon_b2f.asm @@ -11,7 +11,7 @@ _MtMoon3Text_49f64:: ; 80979 (20:4979) _MtMoon3Text_49f6f:: ; 80995 (20:4995) text $52, " got the" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _MtMoon3Text_49f7f:: ; 809a8 (20:49a8) diff --git a/text/maps/name_rater.asm b/text/maps/name_rater.asm index c2e0b2ea..4a81ecf1 100644 --- a/text/maps/name_rater.asm +++ b/text/maps/name_rater.asm @@ -14,7 +14,7 @@ _NameRaterText_1dab8:: ; 9a361 (26:6361) prompt _NameRaterText_1dabd:: ; 9a37f (26:637f) - TX_RAM $cd6d + TX_RAM wcd6d text ", is it?" line "That is a decent" cont "nickname!" @@ -35,7 +35,7 @@ _NameRaterText_1dac7:: ; 9a404 (26:6404) text "OK! This #MON" line "has been renamed" cont "@" - TX_RAM $cee9 + TX_RAM wHPBarMaxHP text "!" para "That's a better" @@ -48,14 +48,14 @@ _NameRaterText_1dacc:: ; 9a44c (26:644c) done _NameRaterText_1dad1:: ; 9a46b (26:646b) - TX_RAM $cd6d + TX_RAM wcd6d text ", is it?" line "That is a truly" cont "impeccable name!" para "Take good care of" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text "!" done diff --git a/text/maps/oaks_lab.asm b/text/maps/oaks_lab.asm index 3e10758e..8b45742c 100644 --- a/text/maps/oaks_lab.asm +++ b/text/maps/oaks_lab.asm @@ -51,7 +51,7 @@ _OaksLabMonEnergeticText:: ; 94e80 (25:4e80) _OaksLabReceivedMonText:: ; 94ea0 (25:4ea0) text $52, " received" line "a @" - TX_RAM $cd6d + TX_RAM wcd6d text "!@@" _OaksLabLastMonText:: ; 94eb6 (25:4eb6) @@ -240,7 +240,7 @@ _OaksLabRivalPickingMonText:: ; 95444 (25:5444) _OaksLabRivalReceivedMonText:: ; 95461 (25:5461) text $53, " received" line "a @" - TX_RAM $cd6d + TX_RAM wcd6d text "!@@" _OaksLabRivalChallengeText:: ; 95477 (25:5477) diff --git a/text/maps/route_1.asm b/text/maps/route_1.asm index c7db4d1c..99807e3e 100644 --- a/text/maps/route_1.asm +++ b/text/maps/route_1.asm @@ -15,7 +15,7 @@ _Route1ViridianMartSampleText:: ; 8d5bf (23:55bf) _Route1Text_1cae8:: ; 8d643 (23:5643) text $52, " got" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _Route1Text_1caee:: ; 8d652 (23:5652) diff --git a/text/maps/route_12_house.asm b/text/maps/route_12_house.asm index ed645a01..8ec4552b 100644 --- a/text/maps/route_12_house.asm +++ b/text/maps/route_12_house.asm @@ -18,7 +18,7 @@ _Route12HouseText_564c5:: ; 8ca00 (23:4a00) para $52, " received" line "a @" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _Route12HouseText_564ca:: ; 8ca4f (23:4a4f) diff --git a/text/maps/route_23.asm b/text/maps/route_23.asm index 30b8e003..ab73a363 100644 --- a/text/maps/route_23.asm +++ b/text/maps/route_23.asm @@ -2,12 +2,12 @@ _VictoryRoadGuardText1:: ; 9261e (24:661e) text "You can pass here" line "only if you have" cont "the @" - TX_RAM $cd6d + TX_RAM wcd6d text "!" para "You don't have the" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text " yet!" para "You have to have" @@ -18,12 +18,12 @@ _VictoryRoadGuardText2:: ; 92696 (24:6696) text "You can pass here" line "only if you have" cont "the @" - TX_RAM $cd6d + TX_RAM wcd6d text "!" para "Oh! That is the" line "@" - TX_RAM $cd6d + TX_RAM wcd6d text "!@@" _VictoryRoadGuardText_513a3:: ; 926dd (24:66dd) diff --git a/text/maps/route_24_1.asm b/text/maps/route_24_1.asm index ec32744d..84a6d720 100644 --- a/text/maps/route_24_1.asm +++ b/text/maps/route_24_1.asm @@ -12,7 +12,7 @@ _Route24Text_51515:: ; 92755 (24:6755) _Route24Text_5151a:: ; 92779 (24:6779) text $52, " received" line "a @" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _Route24Text_51521:: ; 9278f (24:678f) diff --git a/text/maps/safari_zone_secret_house.asm b/text/maps/safari_zone_secret_house.asm index b7b391be..67b677be 100644 --- a/text/maps/safari_zone_secret_house.asm +++ b/text/maps/safari_zone_secret_house.asm @@ -17,7 +17,7 @@ _SecretHouseText_4a350:: ; 858a4 (21:58a4) _ReceivedHM03Text:: ; 85943 (21:5943) text $52, " received" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _HM03ExplanationText:: ; 85957 (21:5957) diff --git a/text/maps/silph_co_11f.asm b/text/maps/silph_co_11f.asm index fdfcd313..caacd757 100644 --- a/text/maps/silph_co_11f.asm +++ b/text/maps/silph_co_11f.asm @@ -22,7 +22,7 @@ _SilphCoPresidentText:: ; 84e9b (21:4e9b) _ReceivedSilphCoMasterBallText:: ; 84f63 (21:4f63) text $52, " got a" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _SilphCo10Text_6231c:: ; 84f74 (21:4f74) diff --git a/text/maps/silph_co_2f.asm b/text/maps/silph_co_2f.asm index b8924ef1..8096d806 100644 --- a/text/maps/silph_co_2f.asm +++ b/text/maps/silph_co_2f.asm @@ -12,7 +12,7 @@ _SilphCo2Text_59ded:: ; 82454 (20:6454) _ReceivedTM36Text:: ; 824ba (20:64ba) text $52, " got" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _TM36ExplanationText:: ; 824c9 (20:64c9) diff --git a/text/maps/ss_anne_7.asm b/text/maps/ss_anne_7.asm index 9e87cdf5..daef3e4a 100644 --- a/text/maps/ss_anne_7.asm +++ b/text/maps/ss_anne_7.asm @@ -33,7 +33,7 @@ _ReceivingHM01Text:: ; 81347 (20:5347) _ReceivedHM01Text:: ; 8140d (20:540d) text $52, " got" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _SSAnne7Text_61932:: ; 8141c (20:541c) diff --git a/text/maps/vermilion_fishing_house.asm b/text/maps/vermilion_fishing_house.asm index 5ed59033..b1377252 100644 --- a/text/maps/vermilion_fishing_house.asm +++ b/text/maps/vermilion_fishing_house.asm @@ -18,7 +18,7 @@ _VermilionHouse2Text_560b6:: ; 9c554 (27:4554) para $52, " received" line "an @" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _VermilionHouse2Text_560bb:: ; 9c5a4 (27:45a4) diff --git a/text/maps/vermilion_gym_2.asm b/text/maps/vermilion_gym_2.asm index 28304f37..2788d840 100644 --- a/text/maps/vermilion_gym_2.asm +++ b/text/maps/vermilion_gym_2.asm @@ -26,7 +26,7 @@ _VermilionGymText_5cb77:: ; 9c069 (27:4069) _ReceivedTM24Text:: ; 9c0e0 (27:40e0) text $52, " received " line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _TM24ExplanationText:: ; 9c0f5 (27:40f5) diff --git a/text/maps/wardens_house.asm b/text/maps/wardens_house.asm index d5834483..a215da34 100644 --- a/text/maps/wardens_house.asm +++ b/text/maps/wardens_house.asm @@ -44,7 +44,7 @@ _WardenThankYouText:: ; 9e51b (27:651b) _ReceivedHM04Text:: ; 9e5a2 (27:65a2) text $52, " received" line "@" - TX_RAM $cf4b + TX_RAM wcf4b text "!@@" _HM04ExplanationText:: ; 9e5b6 (27:65b6) diff --git a/vram.asm b/vram.asm new file mode 100644 index 00000000..05f3199e --- /dev/null +++ b/vram.asm @@ -0,0 +1,21 @@ +vChars0 EQU $8000 +vChars1 EQU $8800 +vChars2 EQU $9000 +vBGMap0 EQU $9800 +vBGMap1 EQU $9c00 + +; Battle/Menu +vSprites EQU vChars0 +vFont EQU vChars1 +vFrontPic EQU vChars2 +vBackPic EQU vFrontPic + 7 * 7 * $10 + +; Overworld +vNPCSprites EQU vChars0 +vNPCSprites2 EQU vChars1 +vTileset EQU vChars2 + +; Title +vTitleLogo EQU vChars1 +vTitleLogo2 EQU vFrontPic + 7 * 7 * $10 + @@ -1,9 +1,127 @@ -INCLUDE "constants/wram_constants.asm" +INCLUDE "constants.asm" + +flag_array: MACRO + ds ((\1) + 7) / 8 +ENDM + +box_struct_length EQU 25 + NUM_MOVES * 2 +box_struct: MACRO +\1Species:: db +\1HP:: dw +\1BoxLevel:: db +\1Status:: db +\1Type:: +\1Type1:: db +\1Type2:: db +\1CatchRate:: db +\1Moves:: ds NUM_MOVES +\1OTID:: dw +\1Exp:: ds 3 +\1HPExp:: dw +\1AttackExp:: dw +\1DefenseExp:: dw +\1SpeedExp:: dw +\1SpecialExp:: dw +\1DVs:: ds 2 +\1PP:: ds NUM_MOVES +ENDM + +party_struct: MACRO + box_struct \1 +\1Level:: db +\1Stats:: +\1MaxHP:: dw +\1Attack:: dw +\1Defense:: dw +\1Speed:: dw +\1Special:: dw +ENDM + +battle_struct: MACRO +\1Species:: db +\1HP:: dw +\1BoxLevel:: db +\1Status:: db +\1Type:: +\1Type1:: db +\1Type2:: db +\1CatchRate:: db +\1Moves:: ds NUM_MOVES +\1DVs:: ds 2 +\1Level:: db +\1MaxHP:: dw +\1Attack:: dw +\1Defense:: dw +\1Speed:: dw +\1Special:: dw +\1PP:: ds NUM_MOVES +ENDM SECTION "WRAM Bank 0", WRAM0 +wc000:: ds 1 +wc001:: ds 1 +wc002:: ds 1 +wc003:: ds 1 +wc004:: ds 1 +wc005:: ds 1 +wc006:: ds 8 +wc00e:: ds 4 +wc012:: ds 4 +wc016:: ds 16 +wc026:: ds 1 +wc027:: ds 1 +wc028:: ds 2 +wc02a:: ds 1 +wc02b:: ds 1 +wc02c:: ds 1 +wc02d:: ds 1 +wc02e:: ds 8 +wc036:: ds 8 +wc03e:: ds 8 +wc046:: ds 8 +wc04e:: ds 8 +wc056:: ds 8 +wc05e:: ds 8 +wc066:: ds 8 +wc06e:: ds 8 +wc076:: ds 8 +wc07e:: ds 8 +wc086:: ds 8 +wc08e:: ds 8 +wc096:: ds 8 +wc09e:: ds 8 +wc0a6:: ds 8 +wc0ae:: ds 8 +wc0b6:: ds 8 +wc0be:: ds 8 +wc0c6:: ds 8 +wc0ce:: ds 1 +wc0cf:: ds 1 +wc0d0:: ds 1 +wc0d1:: ds 1 +wc0d2:: ds 1 +wc0d3:: ds 1 +wc0d4:: ds 1 +wc0d5:: ds 1 +wc0d6:: ds 8 +wc0de:: ds 8 +wc0e6:: ds 1 +wc0e7:: ds 1 +wc0e8:: ds 1 +wc0e9:: ds 1 +wc0ea:: ds 1 +wc0eb:: ds 1 +wc0ec:: ds 1 +wc0ed:: ds 1 +wc0ee:: ds 1 +wc0ef:: ds 1 +wc0f0:: ds 1 +wc0f1:: ds 1 +wc0f2:: ds 14 + SECTION "Sprite State Data", WRAM0[$c100] @@ -29,12 +147,15 @@ wSpriteStateData1:: ; c100 ; C1xF ds $10 * $10 + +SECTION "Sprite State Data 2", WRAM0[$c200] + wSpriteStateData2:: ; c200 ; more data for all sprites on the current map ; holds info for 16 sprites with $10 bytes each ; player sprite is always sprite 0 ; C2x0: walk animation counter (counting from $10 backwards when moving) -; C2x1: +; C2x1: ; C2x2: Y displacement (initialized at 8, supposed to keep moving sprites from moving too far, but bugged) ; C2x3: X displacement (initialized at 8, supposed to keep moving sprites from moving too far, but bugged) ; C2x4: Y position (in 2x2 tile grid steps, topmost 2x2 tile has value 4) @@ -52,13 +173,12 @@ wSpriteStateData2:: ; c200 ds $10 * $10 +SECTION "OAM Buffer", WRAM0[$c300] + wOAMBuffer:: ; c300 ; buffer for OAM data. Copied to OAM by DMA ds 4 * 40 - -SECTION "Tile Map", WRAM0[$c3a0] - wTileMap:: ; c3a0 ; buffer for tiles that are visible on screen (20 columns by 18 rows) ds 20 * 18 @@ -68,10 +188,11 @@ wTileMapBackup:: ; c508 ; (e.g. if menus are drawn on top) ds 20 * 18 -; c670 + ds 120 - -SECTION "Screen Edge Tiles", WRAM0[$cbfc] +wTempPic:: +wOverworldMap:: ; c6e8 + ds 1300 wScreenEdgeTiles:: ; cbfc ; the tiles of the row or column to be redrawn by RedrawExposedScreenEdge @@ -106,9 +227,9 @@ wLastMenuItem:: ; cc2a ; id of previously selected menu item ds 1 -; cc2b - - ds 3 +wcc2b:: ds 1 +wcc2c:: ds 1 +wcc2d:: ds 1 wPlayerMoveListIndex:: ; cc2e ds 1 @@ -126,33 +247,64 @@ wMenuJoypadPollCount:: ; cc34 ; how many times should HandleMenuInput poll the joypad state before it returns? ds 1 - ds 1 +wcc35:: ds 1 wListScrollOffset:: ; cc36 ; offset of the current top menu item from the beginning of the list ; keeps track of what section of the list is on screen ds 1 - ds 19 +wcc37:: ds 1 +wcc38:: ds 2 +wcc3a:: ds 1 +wcc3b:: ds 1 +wcc3c:: ds 1 +wcc3d:: ds 1 +wcc3e:: ds 4 +wcc42:: ds 1 +wcc43:: ds 4 +wcc47:: ds 1 +wcc48:: ds 1 +wcc49:: ds 1 wMenuWrappingEnabled:: ; cc4a ; set to 1 if you can go from the bottom to the top or top to bottom of a menu ; set to 0 if you can't go past the top or bottom of the menu ds 1 - ds 10 +wcc4b:: ds 2 +wcc4d:: ds 1 + +wPredefID:: ; cc4e + ds 1 +wPredefRegisters:: ; cc4f + ds 6 wTrainerHeaderFlagBit:: ; cc55 ds 1 -; cc56 + ds 1 + +wcc57:: ds 1 +wcc58:: ds 3 + +wHallOfFame:: ; cc5b +wcc5b:: ds 1 +wcc5c:: ds 1 +wcc5d:: ds 1 +wcc5e:: ds 13 +wcc6b:: ds 14 +wcc79:: ds 30 +wcc97:: ds 10 +wcca1:: ds 49 -SECTION "RLE", WRAM0[$ccd2] wRLEByteCount:: ; ccd2 ds 1 - ds 4 +wccd3:: ds 1 +wccd4:: ds 1 +wccd5:: ds 2 ; current HP of player and enemy substitutes wPlayerSubstituteHP:: ; ccd7 @@ -160,7 +312,7 @@ wPlayerSubstituteHP:: ; ccd7 wEnemySubstituteHP:: ; ccd8 ds 1 - ds 2 +wccd9:: ds 2 wMoveMenuType:: ; ccdb ; 0=regular, 1=mimic, 2=above message box (relearn, heal pp..) @@ -171,7 +323,7 @@ wPlayerSelectedMove:: ; ccdc wEnemySelectedMove:: ; ccdd ds 1 - ds 1 +wccde:: ds 1 wAICount:: ; ccdf ; number of times remaining that AI action can occur @@ -182,10 +334,32 @@ wAICount:: ; ccdf wEnemyMoveListIndex:: ; cce2 ds 1 -; cce3 - - -SECTION "Stat Modifiers", WRAM0[$cd1a] +wcce3:: ds 1 +wcce4:: ds 1 +wcce5:: ds 2 +wcce7:: ds 1 +wcce8:: ds 1 +wcce9:: ds 2 +wcceb:: ds 1 +wccec:: ds 1 +wcced:: ds 1 +wccee:: ds 1 +wccef:: ds 1 +wccf0:: ds 1 +wccf1:: ds 1 +wccf2:: ds 1 +wccf3:: ds 1 +wccf4:: ds 1 +wccf5:: ds 1 +wccf6:: ds 1 +wccf7:: ds 14 +wcd05:: ds 1 +wcd06:: ds 9 +wcd0f:: ds 1 +wcd10:: ds 1 +wcd11:: ds 1 +wcd12:: ds 1 +wcd13:: ds 7 ; stat modifiers for the player's current pokemon ; value can range from 1 - 13 ($1 to $D) @@ -205,7 +379,11 @@ wPlayerMonAccuracyMod:: ; cd1e wPlayerMonEvasionMod:: ; cd1f ds 1 - ds 13 + ds 3 + +wcd23:: ds 3 +wcd26:: ds 3 +wcd29:: ds 4 wEngagedTrainerClass:: ; cd2d ds 1 @@ -230,7 +408,12 @@ wEnemyMonAccuracyMod:: ; cd32 wEnemyMonEvasionMod:: ; cd33 ds 1 - ds 9 +wcd34:: ds 3 +wcd37:: ds 1 +wcd38:: ds 1 +wcd39:: ds 1 +wcd3a:: ds 1 +wcd3b:: ds 2 wWhichTrade:: ; cd3d ; which entry from TradeMons to select @@ -241,33 +424,61 @@ wTrainerSpriteOffset:: ; cd3d wTrainerEngageDistance:: ; cd3e ds 1 wTrainerFacingDirection:: ; cd3f +wcd3f:: ds 1 wTrainerScreenY:: ; cd40 ds 1 wTrainerScreenX:: ; cd41 ds 1 - ds 30 +wcd42:: ds 1 +wcd43:: ds 1 +wcd44:: ds 1 +wcd45:: ds 1 +wcd46:: ds 1 +wcd47:: ds 1 +wcd48:: ds 1 +wcd49:: ds 1 +wcd4a:: ds 1 +wcd4b:: ds 1 +wcd4c:: ds 1 +wcd4d:: ds 1 +wcd4e:: ds 1 +wcd4f:: ds 1 +wcd50:: ds 9 +wcd59:: ds 1 +wcd5a:: ds 1 +wcd5b:: ds 1 +wcd5c:: ds 1 +wcd5d:: ds 1 +wcd5e:: ds 1 +wcd5f:: ds 1 wFlags_0xcd60:: ; cd60 -; bit 0: is player engaged by trainer (to avoid being engaged by multiple trainers simultaniously) +; bit 0: is player engaged by trainer (to avoid being engaged by multiple trainers simultaneously) ds 1 - ds 10 + ds 9 + +wcd6a:: ds 1 -wJoypadForbiddenButtonsMask:: ; cd6b -; bit 1 means button presses will be ignored for that button +wJoyIgnore:: ; cd6b +; Set buttons are ignored. ds 1 - ds 21 +wcd6c:: ds 1 +wcd6d:: ds 4 +wcd71:: ds 1 +wcd72:: ds 5 +wcd77:: ds 1 +wcd78:: ds 9 wTileMapBackup2:: ; cd81 ; second buffer for temporarily saving and restoring current screen's tiles (e.g. if menus are drawn on top) ds 20 * 18 wBuffer:: ; cee9 -; used for temporary things - +; Temporary storage area of 30 bytes. wHPBarMaxHP:: ; cee9 ds 2 wHPBarOldHP:: ; ceeb @@ -277,24 +488,61 @@ wHPBarNewHP:: ; ceed wHPBarDelta:: ; ceef ds 1 - ds 13 +wcef0:: ds 1 +wcef1:: ds 12 wHPBarHPDifference:: ; cefd ds 1 + ds 7 - ds 9 +wcf05:: ds 1 +wcf06:: ds 1 wAnimSoundID:: ; cf07 ; sound ID during battle animations ds 1 - ds 12 +wcf08:: ds 1 +wcf09:: ds 1 +wcf0a:: ds 1 +wcf0b:: ds 1 +wcf0c:: ds 1 +wcf0d:: ds 1 +wcf0e:: ds 1 +wcf0f:: ds 1 +wcf10:: ds 1 +wcf11:: ds 1 + +wPredefParentBank:: ; cf12 + ds 1 + +wcf13:: ds 1 wCurSpriteMovement2:: ; cf14 ; movement byte 2 of current sprite ds 1 - ds 74 + ds 2 + +wcf17:: ds 1 +wcf18:: ds 2 + +wGBC:: ; cf1a + ds 1 + +wcf1b:: ds 1 +wcf1c:: ds 1 +wcf1d:: ds 1 +wcf1e:: ds 1 +wcf1f:: ds 6 +wcf25:: ds 8 +wcf2d:: ds 1 +wcf2e:: ds 2 +wcf30:: ds 7 +wcf37:: ds 20 +wcf4b:: ds 1 +wcf4c:: ds 1 +wcf4d:: ds 18 wGymCityName:: ; cf5f wStringBuffer1:: ; cf5f @@ -303,31 +551,62 @@ wGymLeaderName:: ; cf70 wStringBuffer2:: ; cf70 ds 16 + 1 wStringBuffer3:: ; cf81 - ds 16 + 1 + ds 9 + 1 + +wcf8b:: ds 1 +wcf8c:: ds 1 +wcf8d:: ds 1 +wcf8e:: ds 1 +wcf8f:: ds 1 +wcf90:: ds 1 +wcf91:: ds 1 wWhichPokemon:: ; cf92 ; which pokemon you selected ds 1 - ds 1 +wcf93:: ds 1 wListMenuID:: ; cf94 ; ID used by DisplayListMenuID ds 1 - ds 48 +wcf95:: ds 1 +wcf96:: ds 1 +wcf97:: ds 1 +wcf98:: ds 1 +wcf99:: ds 1 +wcf9a:: ds 1 +wcf9b:: ds 1 +wcf9c:: ds 4 +wcfa0:: ds 4 +wcfa4:: ds 2 +wcfa6:: ds 2 +wcfa8:: ds 7 +wcfaf:: ds 10 +wcfb9:: ds 1 +wcfba:: ds 1 +wcfbb:: ds 1 +wcfbc:: ds 2 +wcfbe:: ds 2 +wcfc0:: ds 2 +wcfc2:: ds 2 +wcfc4:: ds 1 wWalkCounter:: ; cfc5 ; walk animation counter ds 1 - ds 1 +wcfc6:: ds 1 wMusicHeaderPointer:: ; cfc7 ; (the current music channel address - $4000) / 3 ds 1 - ds 4 +wcfc8:: ds 1 +wcfc9:: ds 1 +wcfca:: ds 1 +wcfcb:: ds 1 W_ENEMYMOVENUM:: ; cfcc ds 1 @@ -354,105 +633,65 @@ W_PLAYERMOVEACCURACY:: ; cfd6 W_PLAYERMOVEMAXPP:: ; cfd7 ds 1 -W_ENEMYMONID:: ; cfd8 - ds 1 +wEnemyMonSpecies2:: ; cfd8 ds 1 - -W_ENEMYMONNAME:: ; cfda - ds 11 - +wBattleMonSpecies2:: ; cfd9 ds 1 -W_ENEMYMONCURHP:: ; cfe6 -; active opponent's hp (16 bits) - ds 2 -W_ENEMYMONNUMBER:: ; cfe8 -; active opponent's position in team (0 to 5) - ds 1 -W_ENEMYMONSTATUS:: ; cfe9 -; active opponent's status condition - ds 1 -W_ENEMYMONTYPES:: ; cfea -W_ENEMYMONTYPE1:: ; cfea - ds 1 -W_ENEMYMONTYPE2:: ; cfeb - ds 1 - ds 1 -W_ENEMYMONMOVES:: ; cfed - ds 4 -W_ENEMYMONATKDEFIV:: ; cff1 - ds 1 -W_ENEMYMONSPDSPCIV:: ; cff2 - ds 1 -W_ENEMYMONLEVEL:: ; cff3 - ds 1 -W_ENEMYMONMAXHP:: ; cff4 - ds 2 -W_ENEMYMONATTACK:: ; cff6 - ds 2 -W_ENEMYMONDEFENSE:: ; cff8 - ds 2 -W_ENEMYMONSPEED:: ; cffa - ds 2 -W_ENEMYMONSPECIAL:: ; cffc - ds 2 +wEnemyMonNick:: ds 11 ; cfda -W_ENEMYMONPP:: ; cffe -; four moves (extends past $cfff) - ds 2 +wEnemyMon:: ; cfe5 +; The wEnemyMon struct reaches past 0xcfff, +; the end of wram bank 0 on cgb. +; This has no significance on dmg, where wram +; isn't banked (c000-dfff is contiguous). +; However, recent versions of rgbds have replaced +; dmg-style wram with cgb wram banks. +; Until this is fixed, this struct will have +; to be declared manually. +wEnemyMonSpecies:: db +wEnemyMonHP:: dw +wEnemyMonPartyPos:: +wEnemyMonBoxLevel:: db +wEnemyMonStatus:: db +wEnemyMonType:: +wEnemyMonType1:: db +wEnemyMonType2:: db +wEnemyMonCatchRate:: db +wEnemyMonMoves:: ds NUM_MOVES +wEnemyMonDVs:: ds 2 +wEnemyMonLevel:: db +wEnemyMonMaxHP:: dw +wEnemyMonAttack:: dw +wEnemyMonDefense:: dw +wEnemyMonSpeed:: dw +wEnemyMonSpecial:: dw +wEnemyMonPP:: ds 2 ; NUM_MOVES - 2 SECTION "WRAM Bank 1", WRAMX, BANK[1] + ds 2 ; NUM_MOVES - 2 - ds 2 ; W_ENEMYMONPP - - ds 7 +wd002:: ds 5 +wd007:: ds 1 +wd008:: ds 1 -W_PLAYERMONNAME:: ; d009 - ds 11 +wBattleMonNick:: ds 11 ; d009 +wBattleMon:: battle_struct wBattleMon ; d014 -W_PLAYERMONID:: ; d014 - ds 1 -W_PLAYERMONCURHP:: ; d015 - ds 2 - ds 1 -W_PLAYERMONSTATUS:: ; d018 -; the status of the player’s current monster - ds 1 -W_PLAYERMONTYPES:: ; d019 -W_PLAYERMONTYPE1:: ; d019 - ds 1 -W_PLAYERMONTYPE2:: ; d01a - ds 1 - ds 1 -W_PLAYERMONMOVES:: ; d01c - ds 4 -W_PLAYERMONIVS:: ; d020 -; 4x 4 bit: atk, def, spd, spc - ds 2 -W_PLAYERMONLEVEL:: ; d022 +W_TRAINERCLASS:: ; d031 ds 1 -W_PLAYERMONMAXHP:: ; d023 - ds 2 -W_PLAYERMONATK:: ; d025 - ds 2 -W_PLAYERMONDEF:: ; d027 - ds 2 -W_PLAYERMONSPEED:: ; d029 - ds 2 -W_PLAYERMONSPECIAL:: ; d02b - ds 2 -W_PLAYERMONPP:: ; d02d - ds 4 - - -W_TRAINERCLASS:: ; d031 ds 1 - ds 24 +wd033:: ds 1 +wd034:: ds 2 +wd036:: ds 16 +wd046:: ds 1 +wd047:: ds 1 +wd048:: ds 2 W_TRAINERNAME:: ; d04a ; 13 bytes for the letters of the opposing trainer @@ -466,9 +705,8 @@ W_ISINBATTLE:: ; d057 ; trainer battle, this is 2 ds 1 -W_PLAYERMONSALIVEFLAGS:: ; d058 -; 6 bit array, 1 if player mon is alive - ds 1 +wPartyAliveFlags:: ; d058 + flag_array 6 W_CUROPPONENT:: ; d059 ; in a wild battle, this is the species of pokemon @@ -481,7 +719,7 @@ W_BATTLETYPE:: ; d05a ; in safari battle, this is 2 ds 1 - ds 1 +wd05b:: ds 1 W_LONEATTACKNO:: ; d05c ; which entry in LoneAttacks to use @@ -492,12 +730,13 @@ W_TRAINERNO:: ; d05d ; which instance of [youngster, lass, etc] is this? ds 1 - ds 1 +wd05e:: ds 1 W_MOVEMISSED:: ; d05f ds 1 - ds 2 +wd060:: ds 1 +wd061:: ds 1 W_PLAYERBATTSTATUS1:: ; d062 ; bit 0 - bide @@ -527,7 +766,8 @@ W_PLAYERBATTSTATUS3:: ; d064 ; bit 3 - tranformed ds 1 - ds 2 +wd065:: ds 1 +wd066:: ds 1 W_ENEMYBATTSTATUS1:: ; d067 ds 1 @@ -536,14 +776,18 @@ W_ENEMYBATTSTATUS2:: ; d068 W_ENEMYBATTSTATUS3:: ; d069 ds 1 - ds 2 +wd06a:: ds 1 +wd06b:: ds 1 W_PLAYERTOXICCOUNTER:: ; d06c ds 1 W_PLAYERDISABLEDMOVE:: ; d06d ds 1 - ds 3 + ds 1 + +wd06f:: ds 1 +wd070:: ds 1 W_ENEMYTOXICCOUNTER:: ; d071 ds 1 @@ -556,13 +800,18 @@ W_NUMHITS:: ; d074 ; number of hits in attacks like Doubleslap, etc. ds 1 - ds 7 +wd075:: ds 3 +wd078:: ds 1 +wd079:: ds 1 +wd07a:: ds 1 +wd07b:: ds 1 W_ANIMATIONID:: ; d07c ; ID number of the current battle animation ds 1 - ds 4 +wd07d:: ds 1 +wd07e:: ds 3 ; base coordinates of frame block W_BASECOORDX:: ; d081 @@ -570,13 +819,13 @@ W_BASECOORDX:: ; d081 W_BASECOORDY:: ; d082 ds 1 - ds 1 +wd083:: ds 1 W_FBTILECOUNTER:: ; d084 ; counts how many tiles of the current frame block have been drawn ds 1 - ds 1 +wd085:: ds 1 W_SUBANIMFRAMEDELAY:: ; d086 ; duration of each frame of the current subanimation in terms of screen refreshes @@ -585,13 +834,13 @@ W_SUBANIMCOUNTER:: ; d087 ; counts the number of subentries left in the current subanimation ds 1 - ds 1 +wd088:: ds 1 W_NUMFBTILES:: ; d089 ; number of tiles in current battle animation frame block ds 1 - ds 1 +wd08a:: ds 1 W_SUBANIMTRANSFORM:: ; d08b ; controls what transformations are applied to the subanimation @@ -624,7 +873,10 @@ W_SUBANIMSUBENTRYADDR:: ; d096 ; the address of the current subentry of the current subanimation ds 2 - ds 4 + ds 2 + +wd09a:: ds 1 +wd09b:: ds 1 W_FBDESTADDR:: ; d09c ; current destination address in OAM for frame blocks (big endian) @@ -642,18 +894,8 @@ W_FBMODE:: ; d09e ; contain the upper and lower bit of each of the 8 pixels, respectively ds 1 - -SECTION "Sprite Buffers", SRAM - -S_SPRITEBUFFER0:: ; a000 - ds SPRITEBUFFERSIZE -S_SPRITEBUFFER1:: ; a188 - ds SPRITEBUFFERSIZE -S_SPRITEBUFFER2:: ; a310 - ds SPRITEBUFFERSIZE - - -SECTION "Sprites", WRAMX[$d0a1], BANK[1] +wd09f:: ds 1 +wd0a0:: ds 1 W_SPRITECURPOSX:: ; d0a1 ds 1 @@ -702,11 +944,12 @@ W_SPRITEDECODETABLE1PTR:: ; d0b3 ; pointer to differential decoding table (assuming initial value 1) ds 2 - ds 1 +wd0b5:: ds 1 W_LISTTYPE:: ; d0b6 ds 1 +wPredefBank:: ; d0b7 ds 1 W_MONHEADER:: ; d0b8 @@ -750,9 +993,10 @@ W_MONHGROWTHRATE:: ; d0cb W_MONHLEARNSET:: ; d0cc ; bit field - ds 7 + flag_array 50 + 5 + ds 1 - ds 4 +wd0d4:: ds 3 W_MONHPADDING:: ; d0d7 @@ -760,17 +1004,47 @@ W_MONHPADDING:: ; d0d7 W_DAMAGE:: ; d0d7 ds 1 - ds 79 +wd0d8:: ds 3 +wd0db:: ds 1 +wd0dc:: ds 4 +wd0e0:: ds 1 +wd0e1:: ds 56 +wd119:: ds 1 +wd11a:: ds 1 +wd11b:: ds 1 +wd11c:: ds 1 +wd11d:: ds 1 +wd11e:: ds 1 +wd11f:: ds 1 +wd120:: ds 1 +wd121:: ds 1 +wd122:: ds 2 +wd124:: ds 1 +wd125:: ds 1 +wd126:: ds 1 W_CURENEMYLVL:: ; d127 ds 1 - ds 3 +wd128:: ds 1 +wd129:: ds 1 +wd12a:: ds 1 W_ISLINKBATTLE:: ; d12b ds 1 - ds 17 +wd12c:: ds 1 +wd12d:: ds 1 +wd12e:: ds 1 +wd12f:: ds 1 +wd130:: ds 1 +wd131:: ds 1 +wd132:: ds 1 +wd133:: ds 6 +wd139:: ds 1 +wd13a:: ds 1 +wd13b:: ds 1 +wd13c:: ds 1 W_PRIZE1:: ; d13d ds 1 @@ -779,134 +1053,43 @@ W_PRIZE2:: ; d13e W_PRIZE3:: ; d13f ds 1 - ds 24 - -W_PLAYERNAME:: ; d158 - ds 11 - -W_NUMINPARTY:: ; d163 - ds 1 -W_PARTYMON1:: ; d164 - ds 1 -W_PARTYMON2:: ; d165 - ds 1 -W_PARTYMON3:: ; d166 - ds 1 -W_PARTYMON4:: ; d167 - ds 1 -W_PARTYMON5:: ; d168 - ds 1 -W_PARTYMON6:: ; d169 - ds 1 -W_PARTYMONEND:: ; d16a ds 1 -W_PARTYMON1DATA:: ; d16b -W_PARTYMON1_NUM:: ; d16b - ds 1 -W_PARTYMON1_HP:: ; d16c - ds 2 -W_PARTYMON1_BOXLEVEL:: ; d16e - ds 1 -W_PARTYMON1_STATUS:: ; d16f - ds 1 -W_PARTYMON1_TYPE1:: ; d170 - ds 1 -W_PARTYMON1_TYPE2:: ; d171 - ds 1 -W_PARTYMON1_CRATE:: ; d172 - ds 1 -W_PARTYMON1_MOVE1:: ; d173 - ds 1 -W_PARTYMON1_MOVE2:: ; d174 - ds 1 -W_PARTYMON1_MOVE3:: ; d175 - ds 1 -W_PARTYMON1_MOVE4:: ; d176 - ds 1 -W_PARTYMON1_OTID:: ; d177 - ds 2 -W_PARTYMON1_EXP:: ; d179 - ds 3 -W_PARTYMON1_EVHP:: ; d17c - ds 2 -W_PARTYMON1_EVATTACK:: ; d17e - ds 2 -W_PARTYMON1_EVDEFENSE:: ; d180 - ds 2 -W_PARTYMON1_EVSPEED:: ; d182 - ds 2 -W_PARTYMON1_EVSECIAL:: ; d184 - ds 2 -W_PARTYMON1_IV:: ; d186 - ds 2 -W_PARTYMON1_MOVE1PP:: ; d188 - ds 1 -W_PARTYMON1_MOVE2PP:: ; d189 - ds 1 -W_PARTYMON1_MOVE3PP:: ; d18a - ds 1 -W_PARTYMON1_MOVE4PP:: ; d18b - ds 1 -W_PARTYMON1_LEVEL:: ; d18c - ds 1 -W_PARTYMON1_MAXHP:: ; d18d - ds 2 -W_PARTYMON1_ATACK:: ; d18f - ds 2 -W_PARTYMON1_DEFENSE:: ; d191 - ds 2 -W_PARTYMON1_SPEED:: ; d193 - ds 2 -W_PARTYMON1_SPECIAL:: ; d195 - ds 2 +wd141:: ds 2 +wd143:: ds 2 +wd145:: ds 3 +wd148:: ds 10 +wd152:: ds 1 +wd153:: ds 3 +wd156:: ds 1 +wd157:: ds 1 -W_PARTYMON2DATA:: ; d197 - ds 44 -W_PARTYMON3DATA:: ; d1c3 - ds 44 -W_PARTYMON4DATA:: ; d1ef - ds 44 -W_PARTYMON5DATA:: ; d21b - ds 44 -W_PARTYMON6DATA:: ; d247 - ds 44 - -W_PARTYMON1OT:: ; d273 - ds 11 -W_PARTYMON2OT:: ; d27e - ds 11 -W_PARTYMON3OT:: ; d289 - ds 11 -W_PARTYMON4OT:: ; d294 - ds 11 -W_PARTYMON5OT:: ; d29f - ds 11 -W_PARTYMON6OT:: ; d2aa - ds 11 -W_PARTYMON1NAME:: ; d2b5 - ds 11 -W_PARTYMON2NAME:: ; d2c0 - ds 11 -W_PARTYMON3NAME:: ; d2cb - ds 11 -W_PARTYMON4NAME:: ; d2d6 - ds 11 -W_PARTYMON5NAME:: ; d2e1 - ds 11 -W_PARTYMON6NAME:: ; d2ec +wPlayerName:: ; d158 ds 11 +wPartyCount:: ds 1 ; d163 +wPartySpecies:: ds PARTY_LENGTH ; d164 +wPartyEnd:: ds 1 ; d16a + +wPartyMons:: +wPartyMon1:: party_struct wPartyMon1 ; d16b +wPartyMon2:: party_struct wPartyMon2 ; d197 +wPartyMon3:: party_struct wPartyMon3 ; d1c3 +wPartyMon4:: party_struct wPartyMon4 ; d1ef +wPartyMon5:: party_struct wPartyMon5 ; d21b +wPartyMon6:: party_struct wPartyMon6 ; d247 + +wPartyMonOT:: ds 11 * PARTY_LENGTH ; d273 +wPartyMonNicks:: ds 11 * PARTY_LENGTH ; d2b5 -SECTION "Pokedex", WRAMX[$d2f7], BANK[1] wPokedexOwned:: ; d2f7 - ds (150 / 8) + 1 + flag_array NUM_POKEMON wPokedexOwnedEnd:: wPokedexSeen:: ; d30a - ds (150 / 8) + 1 + flag_array NUM_POKEMON wPokedexSeenEnd:: @@ -917,9 +1100,8 @@ wBagItems:: ; d31e ds 20 * 2 ds 1 ; end -; money is in decimal wPlayerMoney:: ; d347 - ds 3 + ds 3 ; BCD W_RIVALNAME:: ; d34a ds 11 @@ -940,17 +1122,22 @@ W_OPTIONS:: ; d355 W_OBTAINEDBADGES:: ; d356 ds 1 - ds 2 + ds 1 + +wd358:: ds 1 wPlayerID:: ; d359 ds 2 - ds 3 +wd35b:: ds 1 +wd35c:: ds 1 +wd35d:: ds 1 W_CURMAP:: ; d35e ds 1 - ds 2 +wd35f:: ds 1 +wd360:: ds 1 W_YCOORD:: ; d361 ; player’s position on the current map @@ -969,7 +1156,7 @@ W_XBLOCKCOORD:: ; d364 wLastMap:: ; d365 ds 1 - ds 1 +wd366:: ds 1 W_CURMAPTILESET:: ; d367 ds 1 @@ -996,20 +1183,60 @@ W_MAPCONNECTIONS:: ; d370 ds 1 W_MAPCONN1PTR:: ; d371 - ds 2 - ds 9 + ds 1 + +wd372:: ds 1 +wd373:: ds 1 +wd374:: ds 1 +wd375:: ds 1 +wd376:: ds 1 +wd377:: ds 1 +wd378:: ds 1 +wd379:: ds 1 +wd37a:: ds 1 +wd37b:: ds 1 W_MAPCONN2PTR:: ; d37c - ds 2 - ds 9 + ds 1 + +wd37d:: ds 1 +wd37e:: ds 1 +wd37f:: ds 1 +wd380:: ds 1 +wd381:: ds 1 +wd382:: ds 1 +wd383:: ds 1 +wd384:: ds 1 +wd385:: ds 1 +wd386:: ds 1 W_MAPCONN3PTR:: ; d387 - ds 2 - ds 9 + ds 1 + +wd388:: ds 1 +wd389:: ds 1 +wd38a:: ds 1 +wd38b:: ds 1 +wd38c:: ds 1 +wd38d:: ds 1 +wd38e:: ds 1 +wd38f:: ds 1 +wd390:: ds 1 +wd391:: ds 1 W_MAPCONN4PTR:: ; d392 - ds 2 - ds 9 + ds 1 + +wd393:: ds 1 +wd394:: ds 1 +wd395:: ds 1 +wd396:: ds 1 +wd397:: ds 1 +wd398:: ds 1 +wd399:: ds 1 +wd39a:: ds 1 +wd39b:: ds 1 +wd39c:: ds 1 W_SPRITESET:: ; d39d ; sprite set for the current map (11 sprite picture ID's) @@ -1019,19 +1246,38 @@ W_SPRITESETID:: ; d3a8 ; sprite set ID for the current map ds 1 - ds 312 +wd3a9:: ds 1 +wd3aa:: ds 3 +wd3ad:: ds 1 +wd3ae:: ds 1 +wd3af:: ds 128 +wd42f:: ds 129 +wd4b0:: ds 1 +wd4b1:: ds 32 +wd4d1:: ds 16 W_NUMSPRITES:: ; d4e1 ; number of sprites on the current map ; two bytes per sprite (movement byte 2 , text ID) - ds 3 + ds 1 + +wd4e2:: ds 1 +wd4e3:: ds 1 W_MAPSPRITEDATA:: ; d4e4 ; two bytes per sprite (trainer class/item ID , trainer set ID) ds 32 W_MAPSPRITEEXTRADATA:: ; d504 - ds 39 + ds 32 + +wd524:: ds 1 +wd525:: ds 1 +wd526:: ds 1 +wd527:: ds 1 +wd528:: ds 1 +wd529:: ds 1 +wd52a:: ds 1 W_TILESETBANK:: ; d52b ds 1 @@ -1053,8 +1299,7 @@ W_TILESETTALKINGOVERTILES:: ; d532 W_GRASSTILE:: ; d535 ds 1 - -SECTION "Items", WRAMX[$d53a], BANK[1] + ds 4 wNumBoxItems:: ; d53a ds 1 @@ -1063,15 +1308,18 @@ wBoxItems:: ; d53b ds 50 * 2 ds 1 ; end - ds 4 +wd5a0:: ds 2 +wd5a2:: ds 1 +wd5a3:: ds 1 -; coins are in decimal wPlayerCoins:: ; d5a4 - ds 2 + ds 2 ; BCD W_MISSABLEOBJECTFLAGS:: ; d5a6 ; bit array of missable objects. set = removed - ds 40 + ds 39 + +wd5cd:: ds 1 W_MISSABLEOBJECTLIST:: ; d5ce ; each entry consists of 2 bytes @@ -1294,11 +1542,14 @@ W_SEAFOAMISLANDS5CURSCRIPT:: ; d668 W_ROUTE18GATECURSCRIPT:: ; d669 ds 1 - ds 161 + ds 134 + +wd6f0:: ds 14 +wd6fe:: ds 2 +wd700:: ds 11 W_TOWNVISITEDFLAG:: ; d70b -; 2 bytes bit array, 1 means visited - ds 2 + flag_array 13 wSafariSteps:: ; d70d ; starts at 502 @@ -1318,7 +1569,7 @@ W_ENEMYMONORTRAINERCLASS:: ; d713 ; trainer classes start at $c8 ds 1 - ds 1 +wd714:: ds 1 W_RIVALSTARTER:: ; d715 ds 1 @@ -1328,17 +1579,165 @@ W_RIVALSTARTER:: ; d715 W_PLAYERSTARTER:: ; d717 ds 1 - ds 1 +wd718:: ds 1 wLastBlackoutMap:: ; d719 ds 1 - ds 25 - +wd71a:: ds 1 +wd71b:: ds 1 +wd71c:: ds 1 +wd71d:: ds 1 +wd71e:: ds 1 +wd71f:: ds 9 +wd728:: ds 2 +wd72a:: ds 2 +wd72c:: ds 1 +wd72d:: ds 1 +wd72e:: ds 2 +wd730:: ds 2 +wd732:: ds 1 W_FLAGS_D733:: ; d733 ; bit 4: use variable [W_CURMAPSCRIPT] instead of the provided index for next frame's map script (used to start battle when talking to trainers) - ds 340 + ds 1 + +wd734:: ds 2 +wd736:: ds 1 +wd737:: ds 4 +wd73b:: ds 1 +wd73c:: ds 3 +wd73f:: ds 1 +wd740:: ds 3 +wd743:: ds 1 +wd744:: ds 3 +wd747:: ds 3 +wd74a:: ds 1 +wd74b:: ds 1 +wd74c:: ds 2 +wd74e:: ds 3 +wd751:: ds 1 +wd752:: ds 2 +wd754:: ds 1 +wd755:: ds 5 +wd75a:: ds 1 +wd75b:: ds 3 +wd75e:: ds 1 +wd75f:: ds 5 +wd764:: ds 1 +wd765:: ds 1 +wd766:: ds 1 +wd767:: ds 1 +wd768:: ds 1 +wd769:: ds 3 +wd76c:: ds 5 +wd771:: ds 2 +wd773:: ds 4 +wd777:: ds 1 +wd778:: ds 4 +wd77c:: ds 1 +wd77d:: ds 1 +wd77e:: ds 5 +wd783:: ds 11 +wd78e:: ds 2 +wd790:: ds 2 +wd792:: ds 4 +wd796:: ds 2 +wd798:: ds 2 +wd79a:: ds 1 +wd79b:: ds 1 +wd79c:: ds 5 +wd7a1:: ds 2 +wd7a3:: ds 12 +wd7af:: ds 2 +wd7b1:: ds 2 +wd7b3:: ds 1 +wd7b4:: ds 5 +wd7b9:: ds 4 +wd7bd:: ds 2 +wd7bf:: ds 3 +wd7c2:: ds 1 +wd7c3:: ds 2 +wd7c5:: ds 1 +wd7c6:: ds 3 +wd7c9:: ds 4 +wd7cd:: ds 2 +wd7cf:: ds 2 +wd7d1:: ds 1 +wd7d2:: ds 1 +wd7d3:: ds 2 +wd7d5:: ds 1 +wd7d6:: ds 1 +wd7d7:: ds 1 +wd7d8:: ds 1 +wd7d9:: ds 2 +wd7db:: ds 2 +wd7dd:: ds 2 +wd7df:: ds 1 +wd7e0:: ds 1 +wd7e1:: ds 2 +wd7e3:: ds 2 +wd7e5:: ds 2 +wd7e7:: ds 1 +wd7e8:: ds 1 +wd7e9:: ds 2 +wd7eb:: ds 2 +wd7ed:: ds 1 +wd7ee:: ds 1 +wd7ef:: ds 1 +wd7f0:: ds 1 +wd7f1:: ds 1 +wd7f2:: ds 1 +wd7f3:: ds 2 +wd7f5:: ds 1 +wd7f6:: ds 9 +wd7ff:: ds 4 +wd803:: ds 2 +wd805:: ds 2 +wd807:: ds 2 +wd809:: ds 10 +wd813:: ds 2 +wd815:: ds 1 +wd816:: ds 1 +wd817:: ds 2 +wd819:: ds 2 +wd81b:: ds 10 +wd825:: ds 1 +wd826:: ds 1 +wd827:: ds 1 +wd828:: ds 1 +wd829:: ds 1 +wd82a:: ds 1 +wd82b:: ds 1 +wd82c:: ds 1 +wd82d:: ds 1 +wd82e:: ds 1 +wd82f:: ds 1 +wd830:: ds 1 +wd831:: ds 1 +wd832:: ds 1 +wd833:: ds 1 +wd834:: ds 1 +wd835:: ds 1 +wd836:: ds 1 +wd837:: ds 1 +wd838:: ds 15 +wd847:: ds 2 +wd849:: ds 2 +wd84b:: ds 12 +wd857:: ds 8 +wd85f:: ds 4 +wd863:: ds 1 +wd864:: ds 1 +wd865:: ds 1 +wd866:: ds 1 +wd867:: ds 2 +wd869:: ds 20 +wd87d:: ds 2 +wd87f:: ds 1 +wd880:: ds 1 +wd881:: ds 1 +wd882:: ds 5 W_GRASSRATE:: ; d887 ds 1 @@ -1346,66 +1745,28 @@ W_GRASSRATE:: ; d887 W_GRASSMONS:: ; d888 ds 20 -wEnemyPartyCount:: ; d89c - ds 1 -wEnemyPartyMons:: ; d89d - ds 6 - ds 1 ; end - - -wEnemyMons:: -wEnemyMon1:: ; d8a4 -wEnemyMon1Species:: ; d8a4 - ds 1 -W_ENEMYMON1HP:: ; d8a5 - ds 2 +wEnemyPartyCount:: ds 1 ; d89c +wEnemyPartyMons:: ds PARTY_LENGTH + 1 ; d89d - ds 7 +wEnemyMons:: ; d8a4 +wEnemyMon1:: party_struct wEnemyMon1 +wEnemyMon2:: party_struct wEnemyMon2 +wEnemyMon3:: party_struct wEnemyMon3 +wEnemyMon4:: party_struct wEnemyMon4 +wEnemyMon5:: party_struct wEnemyMon5 +wEnemyMon6:: party_struct wEnemyMon6 -W_ENEMYMON1MOVE3:: ; d8ae - ds 44 -W_ENEMYMON2MOVE3:: ; d8da - ds 44 -W_ENEMYMON3MOVE3:: ; d906 - ds 44 -W_ENEMYMON4MOVE3:: ; d932 - ds 44 -W_ENEMYMON5MOVE3:: ; d95e - ds 44 -W_ENEMYMON6MOVE3:: ; d98a - ds 34 - -W_ENEMYMON1OT:: ; d9ac - ds 11 -W_ENEMYMON2OT:: ; d9b7 - ds 11 -W_ENEMYMON3OT:: ; d9c2 - ds 11 -W_ENEMYMON4OT:: ; d9cd - ds 11 -W_ENEMYMON5OT:: ; d9d8 - ds 11 -W_ENEMYMON6OT:: ; d9e3 - ds 11 +wEnemyMonOT:: ds 11 * PARTY_LENGTH ; d9ac +wEnemyMonNicks:: ds 11 * PARTY_LENGTH ; d9ee -W_ENEMYMON1NAME:: ; d9ee - ds 11 -W_ENEMYMON2NAME:: ; d9f9 - ds 11 -W_ENEMYMON3NAME:: ; da04 - ds 11 -W_ENEMYMON4NAME:: ; da0f - ds 11 -W_ENEMYMON5NAME:: ; da1a - ds 11 -W_ENEMYMON6NAME:: ; da25 - ds 11 W_TRAINERHEADERPTR:: ; da30 ds 2 - ds 7 + ds 6 + +wda38:: ds 1 W_CURMAPSCRIPT:: ; da39 ; index of current map script, mostly used as index for function pointer array @@ -1423,42 +1784,47 @@ W_PLAYTIMESECONDS:: ; da44 W_PLAYTIMEFRAMES:: ; da45 ds 1 - ds 1 +wda46:: ds 1 W_NUMSAFARIBALLS:: ; da47 ds 1 + W_DAYCARE_IN_USE:: ; da48 ; 0 if no pokemon is in the daycare ; 1 if pokemon is in the daycare ds 1 -W_DAYCAREMONNAME:: ; da49 - ds 11 +W_DAYCAREMONNAME:: ds 11 ; da49 +W_DAYCAREMONOT:: ds 11 ; da54 -W_DAYCAREMONOT:: ; da54 - ds 11 +wDayCareMon:: box_struct wDayCareMon ; da5f -W_DAYCAREMONDATA:: ; da5f - ds 33 -W_NUMINBOX:: ; da80 -; number of mons in current box - ds 22 +W_NUMINBOX:: ds 1 ; da80 +wBoxSpecies:: ds MONS_PER_BOX + 1 -W_BOXMON1DATA:: ; da96 - ds 33 -W_BOXMON2DATA:: ; dab7 - ds 33 * 19 +wBoxMons:: +wBoxMon1:: box_struct wBoxMon1 ; da96 +wBoxMon2:: ds box_struct_length * (MONS_PER_BOX + -1) ; dab7 -W_BOXMON1OT:: ; dd2a - ds 11 -W_BOXMON2OT:: ; dd35 - ds 11 * 19 +wBoxMonOT:: ds 11 * MONS_PER_BOX ; dd2a +wBoxMonNicks:: ds 11 * MONS_PER_BOX ; de06 +wBoxMonNicksEnd:: ; dee2 -W_BOXMON1NAME:: ; de06 - ds 11 -W_BOXMON2NAME:: ; de11 - ds 11 * 19 -; dee2 +SECTION "Stack", WRAMX[$dfff], BANK[1] +wStack:: ; dfff + ds -$100 + + +SECTION "Sprite Buffers", SRAM, BANK[0] + +S_SPRITEBUFFER0:: ds SPRITEBUFFERSIZE ; a000 +S_SPRITEBUFFER1:: ds SPRITEBUFFERSIZE ; a188 +S_SPRITEBUFFER2:: ds SPRITEBUFFERSIZE ; a310 + + ds $100 + +sHallOfFame:: ds HOF_TEAM * NUM_HOF_TEAMS ; a598 + diff --git a/yellow.asm b/yellow.asm new file mode 100644 index 00000000..2dedf586 --- /dev/null +++ b/yellow.asm @@ -0,0 +1 @@ +_YELLOW EQU 1 diff --git a/yellow/audio.asm b/yellow/audio.asm new file mode 100644 index 00000000..e94c7db5 --- /dev/null +++ b/yellow/audio.asm @@ -0,0 +1,2 @@ +INCLUDE "yellow.asm" +INCLUDE "audio.asm" diff --git a/yellow/main.asm b/yellow/main.asm new file mode 100644 index 00000000..36c88720 --- /dev/null +++ b/yellow/main.asm @@ -0,0 +1,2 @@ +INCLUDE "yellow.asm" +INCLUDE "main.asm" diff --git a/yellow/text.asm b/yellow/text.asm new file mode 100644 index 00000000..a84a633d --- /dev/null +++ b/yellow/text.asm @@ -0,0 +1,2 @@ +INCLUDE "yellow.asm" +INCLUDE "text.asm" diff --git a/yellow/wram.asm b/yellow/wram.asm new file mode 100644 index 00000000..c0b7f781 --- /dev/null +++ b/yellow/wram.asm @@ -0,0 +1,2 @@ +INCLUDE "yellow.asm" +INCLUDE "wram.asm" |