Merge in master (and update some macros)
@@ -20,6 +20,7 @@
|
||||
# converted image/palette data
|
||||
*.1bpp
|
||||
*.2bpp
|
||||
*.pal
|
||||
|
||||
# *disasm.py output file
|
||||
*disasm_output.asm
|
||||
*disasm_output.asm
|
||||
|
||||
@@ -1,39 +1,108 @@
|
||||
.PHONY: all compare clean
|
||||
rom := poketcg.gbc
|
||||
|
||||
rom_obj := \
|
||||
src/main.o \
|
||||
src/gfx.o \
|
||||
src/text.o \
|
||||
src/audio.o \
|
||||
src/wram.o \
|
||||
src/hram.o
|
||||
|
||||
|
||||
### Build tools
|
||||
|
||||
ifeq (,$(shell which sha1sum))
|
||||
SHA1 := shasum
|
||||
else
|
||||
SHA1 := sha1sum
|
||||
endif
|
||||
|
||||
RGBDS ?=
|
||||
RGBASM ?= $(RGBDS)rgbasm
|
||||
RGBFIX ?= $(RGBDS)rgbfix
|
||||
RGBGFX ?= $(RGBDS)rgbgfx
|
||||
RGBLINK ?= $(RGBDS)rgblink
|
||||
|
||||
|
||||
### Build targets
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .asm .o .gbc .png .2bpp .1bpp .pal
|
||||
.SECONDEXPANSION:
|
||||
.PRECIOUS:
|
||||
.SECONDARY:
|
||||
.PHONY: all tcg clean tidy compare tools
|
||||
|
||||
OBJS = src/main.o src/gfx.o src/text.o src/audio.o src/wram.o src/hram.o
|
||||
EXTRAS = tools
|
||||
all: $(rom) compare
|
||||
tcg: $(rom) compare
|
||||
|
||||
$(foreach obj, $(OBJS), \
|
||||
$(eval $(obj:.o=)_dep = $(shell python $(EXTRAS)/scan_includes.py $(obj:.o=.asm))) \
|
||||
)
|
||||
clean: tidy
|
||||
find src/gfx \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pal' \) -delete
|
||||
|
||||
all: tcg.gbc compare
|
||||
tidy:
|
||||
rm -f $(rom) $(rom_obj) $(rom:.gbc=.map) $(rom:.gbc=.sym) src/rgbdscheck.o
|
||||
$(MAKE) clean -C tools/
|
||||
|
||||
compare: baserom.gbc tcg.gbc
|
||||
cmp $^
|
||||
compare: $(rom)
|
||||
@$(SHA1) -c rom.sha1
|
||||
|
||||
$(OBJS): $$*.asm $$($$*_dep)
|
||||
@python $(EXTRAS)/gfx.py 2bpp $(2bppq)
|
||||
@python $(EXTRAS)/gfx.py 1bpp $(1bppq)
|
||||
rgbasm -h -i src/ -o $@ $<
|
||||
tools:
|
||||
$(MAKE) -C tools/
|
||||
|
||||
tcg.gbc: $(OBJS)
|
||||
rgblink -n $*.sym -m $*.map -l $*.link -o $@ $^
|
||||
rgbfix -cjsv -k 01 -l 0x33 -m 0x1b -p 0 -r 03 -t POKECARD -i AXQE $@
|
||||
sort $*.sym -o $*.sym
|
||||
|
||||
clean:
|
||||
rm -f tcg.gbc $(OBJS) *.sym *.map
|
||||
find . \( -iname '*.1bpp' -o -iname '*.2bpp' \) -exec rm {} +
|
||||
RGBASMFLAGS = -h -i src/ -L -Weverything
|
||||
# Create a sym/map for debug purposes if `make` run with `DEBUG=1`
|
||||
ifeq ($(DEBUG),1)
|
||||
RGBASMFLAGS += -E
|
||||
endif
|
||||
|
||||
src/rgbdscheck.o: src/rgbdscheck.asm
|
||||
$(RGBASM) -o $@ $<
|
||||
|
||||
# The dep rules have to be explicit or else missing files won't be reported.
|
||||
# As a side effect, they're evaluated immediately instead of when the rule is invoked.
|
||||
# It doesn't look like $(shell) can be deferred so there might not be a better way.
|
||||
define DEP
|
||||
$1: $2 $$(shell tools/scan_includes -s -i src/ $2) | src/rgbdscheck.o
|
||||
$$(RGBASM) $$(RGBASMFLAGS) -o $$@ $$<
|
||||
endef
|
||||
|
||||
# Build tools when building the rom.
|
||||
# This has to happen before the rules are processed, since that's when scan_includes is run.
|
||||
ifeq (,$(filter clean tidy tools,$(MAKECMDGOALS)))
|
||||
|
||||
$(info $(shell $(MAKE) -C tools))
|
||||
|
||||
# Dependencies for objects
|
||||
$(foreach obj, $(rom_obj), $(eval $(call DEP,$(obj),$(obj:.o=.asm))))
|
||||
|
||||
endif
|
||||
|
||||
|
||||
%.asm: ;
|
||||
|
||||
|
||||
opts = -cjsv -k 01 -l 0x33 -m 0x1b -p 0 -r 03 -t POKECARD -i AXQE
|
||||
|
||||
$(rom): $(rom_obj) src/layout.link
|
||||
$(RGBLINK) -m $(rom:.gbc=.map) -n $(rom:.gbc=.sym) -l src/layout.link -o $@ $(filter %.o,$^)
|
||||
$(RGBFIX) $(opts) $@
|
||||
|
||||
|
||||
### Misc file-specific graphics rules
|
||||
|
||||
|
||||
### Catch-all graphics rules
|
||||
|
||||
%.png: ;
|
||||
|
||||
%.pal: ;
|
||||
|
||||
%.2bpp: %.png
|
||||
$(eval 2bppq += $<)
|
||||
@rm -f $@
|
||||
$(RGBGFX) $(rgbgfx) -o $@ $<
|
||||
$(if $(tools/gfx),\
|
||||
tools/gfx $(tools/gfx) -o $@ $@)
|
||||
|
||||
%.1bpp: %.png
|
||||
$(eval 1bppq += $<)
|
||||
@rm -f $@
|
||||
$(RGBGFX) $(rgbgfx) -d1 -o $@ $<
|
||||
$(if $(tools/gfx),\
|
||||
tools/gfx $(tools/gfx) -d1 -o $@ $@)
|
||||
|
||||
@@ -4,27 +4,30 @@ This is a disassembly of Pokémon TCG.
|
||||
|
||||
It uses the following ROM as a base:
|
||||
|
||||
* Pokémon Trading Card Game (U) [C][!].gbc `md5: 219b2cc64e5a052003015d4bd4c622cd`
|
||||
- Pokémon Trading Card Game (U) [C][!].gbc `sha1: 0f8670a583255cff3e5b7ca71b5d7454d928fc48`
|
||||
|
||||
To assemble, first download RGBDS (https://github.com/gbdev/rgbds/releases) and extract it to /usr/local/bin.
|
||||
Copy the above ROM to this directory as "baserom.gbc".
|
||||
Run `make` in your shell.
|
||||
|
||||
This will output a file named "tcg.gbc".
|
||||
This will output a file named "poketcg.gbc".
|
||||
|
||||
|
||||
# See Also
|
||||
## See also
|
||||
|
||||
* Disassembly of [**Pokémon Red/Blue**][pokered]
|
||||
* Disassembly of [**Pokémon Yellow**][pokeyellow]
|
||||
* Disassembly of [**Pokémon Gold**][pokegold]
|
||||
* Disassembly of [**Pokémon Crystal**][pokecrystal]
|
||||
* Disassembly of [**Pokémon Pinball**][pokepinball]
|
||||
* Disassembly of [**Pokémon Ruby**][pokeruby]
|
||||
* Disassembly of [**Pokémon Fire Red**][pokefirered]
|
||||
* Disassembly of [**Pokémon Emerald**][pokeemerald]
|
||||
* Discord: [**pret**][Discord]
|
||||
* irc: **irc.freenode.net** [**#pret**][irc]
|
||||
- **Discord:** [pret][discord]
|
||||
- **IRC:** [freenode#pret][irc]
|
||||
|
||||
Other disassembly projects:
|
||||
|
||||
- [**Pokémon Red/Blue**][pokered]
|
||||
- [**Pokémon Yellow**][pokeyellow]
|
||||
- [**Pokémon Gold/Silver**][pokegold]
|
||||
- [**Pokémon Crystal**][pokecrystal]
|
||||
- [**Pokémon Pinball**][pokepinball]
|
||||
- [**Pokémon Ruby**][pokeruby]
|
||||
- [**Pokémon FireRed**][pokefirered]
|
||||
- [**Pokémon Emerald**][pokeemerald]
|
||||
|
||||
[pokered]: https://github.com/pret/pokered
|
||||
[pokeyellow]: https://github.com/pret/pokeyellow
|
||||
@@ -34,5 +37,5 @@ This will output a file named "tcg.gbc".
|
||||
[pokeruby]: https://github.com/pret/pokeruby
|
||||
[pokefirered]: https://github.com/pret/pokefirered
|
||||
[pokeemerald]: https://github.com/pret/pokeemerald
|
||||
[Discord]: https://discord.gg/d5dubZ3
|
||||
[discord]: https://discord.gg/d5dubZ3
|
||||
[irc]: https://kiwiirc.com/client/irc.freenode.net/?#pret
|
||||
|
||||
@@ -106,13 +106,13 @@ Func_f406f: ; f406f (3d:406f)
|
||||
|
||||
Music1_Init: ; f407d (3d:407d)
|
||||
xor a
|
||||
ld [rNR52], a
|
||||
ldh [rNR52], a
|
||||
ld a, $80
|
||||
ld [rNR52], a
|
||||
ldh [rNR52], a
|
||||
ld a, $77
|
||||
ld [rNR50], a
|
||||
ldh [rNR50], a
|
||||
ld a, $ff
|
||||
ld [rNR51], a
|
||||
ldh [rNR51], a
|
||||
ld a, $3d
|
||||
ld [wCurSongBank], a
|
||||
ld a, $80
|
||||
@@ -216,34 +216,34 @@ Music1_StopAllChannels: ; f414b (3d:414b)
|
||||
bit 0, d
|
||||
jr nz, .stop_channel_2
|
||||
ld a, $8
|
||||
ld [rNR12], a
|
||||
ldh [rNR12], a
|
||||
swap a
|
||||
ld [rNR14], a
|
||||
ldh [rNR14], a
|
||||
.stop_channel_2
|
||||
xor a
|
||||
ld [wMusicIsPlaying + 1], a
|
||||
bit 1, d
|
||||
jr nz, .stop_channel_4
|
||||
ld a, $8
|
||||
ld [rNR22], a
|
||||
ldh [rNR22], a
|
||||
swap a
|
||||
ld [rNR24], a
|
||||
ldh [rNR24], a
|
||||
.stop_channel_4
|
||||
xor a
|
||||
ld [wMusicIsPlaying + 3], a
|
||||
bit 3, d
|
||||
jr nz, .stop_channel_3
|
||||
ld a, $8
|
||||
ld [rNR42], a
|
||||
ldh [rNR42], a
|
||||
swap a
|
||||
ld [rNR44], a
|
||||
ldh [rNR44], a
|
||||
.stop_channel_3
|
||||
xor a
|
||||
ld [wMusicIsPlaying + 2], a
|
||||
bit 2, d
|
||||
jr nz, .done
|
||||
ld a, $0
|
||||
ld [rNR32], a
|
||||
ldh [rNR32], a
|
||||
.done
|
||||
ret
|
||||
|
||||
@@ -429,9 +429,9 @@ Music1_UpdateChannel1: ; f42a5 (3d:42a5)
|
||||
bit 0, a
|
||||
jr nz, .asm_f4309
|
||||
ld a, $8
|
||||
ld [rNR12], a
|
||||
ldh [rNR12], a
|
||||
swap a
|
||||
ld [rNR14], a
|
||||
ldh [rNR14], a
|
||||
.asm_f4309
|
||||
ret
|
||||
|
||||
@@ -482,9 +482,9 @@ Music1_UpdateChannel2: ; f430a (3d:430a)
|
||||
bit 1, a
|
||||
jr nz, .asm_f436e
|
||||
ld a, $8
|
||||
ld [rNR22], a
|
||||
ldh [rNR22], a
|
||||
swap a
|
||||
ld [rNR24], a
|
||||
ldh [rNR24], a
|
||||
.asm_f436e
|
||||
ret
|
||||
|
||||
@@ -506,7 +506,7 @@ Music1_UpdateChannel3: ; f436f (3d:436f)
|
||||
cp $1
|
||||
jr z, .asm_f4398
|
||||
ld a, [wMusicE9 + 2]
|
||||
ld [rNR32], a
|
||||
ldh [rNR32], a
|
||||
.asm_f4398
|
||||
ld a, [wddbb + 2]
|
||||
dec a
|
||||
@@ -531,9 +531,9 @@ Music1_UpdateChannel3: ; f436f (3d:436f)
|
||||
bit 2, a
|
||||
jr nz, .asm_f43cd
|
||||
ld a, $0
|
||||
ld [rNR32], a
|
||||
ldh [rNR32], a
|
||||
ld a, $80
|
||||
ld [rNR34], a
|
||||
ldh [rNR34], a
|
||||
.asm_f43cd
|
||||
ret
|
||||
|
||||
@@ -569,9 +569,9 @@ Music1_UpdateChannel4: ; f43ce (3d:43ce)
|
||||
xor a
|
||||
ld [wddef], a
|
||||
ld a, $8
|
||||
ld [rNR42], a
|
||||
ldh [rNR42], a
|
||||
swap a
|
||||
ld [rNR44], a
|
||||
ldh [rNR44], a
|
||||
.asm_f4413
|
||||
ret
|
||||
|
||||
@@ -1167,19 +1167,19 @@ Func_f4714: ; f4714 (3d:4714)
|
||||
cp $80
|
||||
jr z, .asm_f4733
|
||||
ld a, [wMusicVolume]
|
||||
ld [rNR12], a
|
||||
ldh [rNR12], a
|
||||
ld d, $80
|
||||
.asm_f4733
|
||||
ld [hl], $2
|
||||
ld a, $8
|
||||
ld [rNR10], a
|
||||
ldh [rNR10], a
|
||||
ld a, [wMusicDuty1]
|
||||
ld [rNR11], a
|
||||
ldh [rNR11], a
|
||||
ld a, [wMusicCh1CurPitch]
|
||||
ld [rNR13], a
|
||||
ldh [rNR13], a
|
||||
ld a, [wMusicCh1CurOctave]
|
||||
or d
|
||||
ld [rNR14], a
|
||||
ldh [rNR14], a
|
||||
.asm_f4749
|
||||
ret
|
||||
.asm_f474a
|
||||
@@ -1206,17 +1206,17 @@ Func_f475a: ; f475a (3d:475a)
|
||||
cp $80
|
||||
jr z, .asm_f4779
|
||||
ld a, [wMusicVolume + 1]
|
||||
ld [rNR22], a
|
||||
ldh [rNR22], a
|
||||
ld d, $80
|
||||
.asm_f4779
|
||||
ld [hl], $2
|
||||
ld a, [wMusicDuty2]
|
||||
ld [rNR21], a
|
||||
ldh [rNR21], a
|
||||
ld a, [wMusicCh2CurPitch]
|
||||
ld [rNR23], a
|
||||
ldh [rNR23], a
|
||||
ld a, [wMusicCh2CurOctave]
|
||||
or d
|
||||
ld [rNR24], a
|
||||
ldh [rNR24], a
|
||||
.asm_f478b
|
||||
ret
|
||||
.asm_f478c
|
||||
@@ -1239,7 +1239,7 @@ Func_f479c: ; f479c (3d:479c)
|
||||
or a
|
||||
jr z, .no_wave_change
|
||||
xor a
|
||||
ld [rNR30], a
|
||||
ldh [rNR30], a
|
||||
call Music1_LoadWaveInstrument
|
||||
ld d, $80
|
||||
.no_wave_change
|
||||
@@ -1251,28 +1251,28 @@ Func_f479c: ; f479c (3d:479c)
|
||||
cp $80
|
||||
jr z, .asm_f47cc
|
||||
ld a, [wMusicVolume + 2]
|
||||
ld [rNR32], a
|
||||
ldh [rNR32], a
|
||||
xor a
|
||||
ld [rNR30], a
|
||||
ldh [rNR30], a
|
||||
ld d, $80
|
||||
.asm_f47cc
|
||||
ld [hl], $2
|
||||
xor a
|
||||
ld [rNR31], a
|
||||
ldh [rNR31], a
|
||||
ld a, [wMusicCh3CurPitch]
|
||||
ld [rNR33], a
|
||||
ldh [rNR33], a
|
||||
ld a, $80
|
||||
ld [rNR30], a
|
||||
ldh [rNR30], a
|
||||
ld a, [wMusicCh3CurOctave]
|
||||
or d
|
||||
ld [rNR34], a
|
||||
ldh [rNR34], a
|
||||
.asm_f47e0
|
||||
ret
|
||||
.asm_f47e1
|
||||
ld hl, wMusicTie
|
||||
ld [hl], $0
|
||||
xor a
|
||||
ld [rNR30], a
|
||||
ldh [rNR30], a
|
||||
ret
|
||||
|
||||
Music1_LoadWaveInstrument: ; f479c (3d:47ea)
|
||||
@@ -1349,7 +1349,7 @@ Func_f4839: ; f4839 (3d:4839)
|
||||
jr nz, .asm_f4853
|
||||
jr asm_f482a
|
||||
.asm_f4853
|
||||
ld [rNR43], a
|
||||
ldh [rNR43], a
|
||||
inc de
|
||||
ld a, d
|
||||
ld [hld], a
|
||||
@@ -1368,7 +1368,7 @@ Func_f485a: ; f485a (3d:485a)
|
||||
|
||||
Func_f4866: ; f4866 (3d:4866)
|
||||
ld a, [wMusicPanning]
|
||||
ld [rNR50], a
|
||||
ldh [rNR50], a
|
||||
ld a, [wdd8c]
|
||||
or a
|
||||
ld hl, wMusicDC
|
||||
@@ -1397,7 +1397,7 @@ Func_f4866: ; f4866 (3d:4866)
|
||||
swap e
|
||||
or e
|
||||
and d
|
||||
ld [rNR51], a
|
||||
ldh [rNR51], a
|
||||
ret
|
||||
|
||||
Music1_UpdateVibrato: ; f4898 (3d:4898)
|
||||
@@ -1495,13 +1495,13 @@ Func_f490b: ; f490b (3d:490b)
|
||||
bit 0, a
|
||||
jr nz, .done
|
||||
ld a, e
|
||||
ld [rNR13], a
|
||||
ld a, [rNR11]
|
||||
ldh [rNR13], a
|
||||
ldh a, [rNR11]
|
||||
and $c0
|
||||
ld [rNR11], a
|
||||
ldh [rNR11], a
|
||||
ld a, d
|
||||
and $3f
|
||||
ld [rNR14], a
|
||||
ldh [rNR14], a
|
||||
ret
|
||||
.not_channel_1
|
||||
cp $1
|
||||
@@ -1513,12 +1513,12 @@ Func_f490b: ; f490b (3d:490b)
|
||||
bit 1, a
|
||||
jr nz, .done
|
||||
ld a, e
|
||||
ld [rNR23], a
|
||||
ld a, [rNR21]
|
||||
ldh [rNR23], a
|
||||
ldh a, [rNR21]
|
||||
and $c0
|
||||
ld [rNR21], a
|
||||
ldh [rNR21], a
|
||||
ld a, d
|
||||
ld [rNR24], a
|
||||
ldh [rNR24], a
|
||||
ret
|
||||
.not_channel_2
|
||||
cp $2
|
||||
@@ -1530,11 +1530,11 @@ Func_f490b: ; f490b (3d:490b)
|
||||
bit 2, a
|
||||
jr nz, .done
|
||||
ld a, e
|
||||
ld [rNR33], a
|
||||
ldh [rNR33], a
|
||||
xor a
|
||||
ld [rNR31], a
|
||||
ldh [rNR31], a
|
||||
ld a, d
|
||||
ld [rNR34], a
|
||||
ldh [rNR34], a
|
||||
.done
|
||||
ret
|
||||
|
||||
@@ -1567,28 +1567,28 @@ Func_f4980: ; f4980 (3d:4980)
|
||||
bit 0, d
|
||||
jr nz, .asm_f4990
|
||||
ld a, $8
|
||||
ld [rNR12], a
|
||||
ldh [rNR12], a
|
||||
swap a
|
||||
ld [rNR14], a
|
||||
ldh [rNR14], a
|
||||
.asm_f4990
|
||||
bit 1, d
|
||||
jr nz, .asm_f499c
|
||||
swap a
|
||||
ld [rNR22], a
|
||||
ldh [rNR22], a
|
||||
swap a
|
||||
ld [rNR24], a
|
||||
ldh [rNR24], a
|
||||
.asm_f499c
|
||||
bit 3, d
|
||||
jr nz, .asm_f49a8
|
||||
swap a
|
||||
ld [rNR42], a
|
||||
ldh [rNR42], a
|
||||
swap a
|
||||
ld [rNR44], a
|
||||
ldh [rNR44], a
|
||||
.asm_f49a8
|
||||
bit 2, d
|
||||
jr nz, .asm_f49b0
|
||||
ld a, $0
|
||||
ld [rNR32], a
|
||||
ldh [rNR32], a
|
||||
.asm_f49b0
|
||||
ret
|
||||
|
||||
|
||||
@@ -106,13 +106,13 @@ Func_f806f: ; f806f (3e:406f)
|
||||
|
||||
Music2_Init: ; f807d (3e:407d)
|
||||
xor a
|
||||
ld [rNR52], a
|
||||
ldh [rNR52], a
|
||||
ld a, $80
|
||||
ld [rNR52], a
|
||||
ldh [rNR52], a
|
||||
ld a, $77
|
||||
ld [rNR50], a
|
||||
ldh [rNR50], a
|
||||
ld a, $ff
|
||||
ld [rNR51], a
|
||||
ldh [rNR51], a
|
||||
ld a, $3d
|
||||
ld [wCurSongBank], a
|
||||
ld a, $80
|
||||
@@ -216,34 +216,34 @@ Music2_StopAllChannels: ; f814b (3e:414b)
|
||||
bit 0, d
|
||||
jr nz, .stop_channel_2
|
||||
ld a, $8
|
||||
ld [rNR12], a
|
||||
ldh [rNR12], a
|
||||
swap a
|
||||
ld [rNR14], a
|
||||
ldh [rNR14], a
|
||||
.stop_channel_2
|
||||
xor a
|
||||
ld [wMusicIsPlaying + 1], a
|
||||
bit 1, d
|
||||
jr nz, .stop_channel_4
|
||||
ld a, $8
|
||||
ld [rNR22], a
|
||||
ldh [rNR22], a
|
||||
swap a
|
||||
ld [rNR24], a
|
||||
ldh [rNR24], a
|
||||
.stop_channel_4
|
||||
xor a
|
||||
ld [wMusicIsPlaying + 3], a
|
||||
bit 3, d
|
||||
jr nz, .stop_channel_3
|
||||
ld a, $8
|
||||
ld [rNR42], a
|
||||
ldh [rNR42], a
|
||||
swap a
|
||||
ld [rNR44], a
|
||||
ldh [rNR44], a
|
||||
.stop_channel_3
|
||||
xor a
|
||||
ld [wMusicIsPlaying + 2], a
|
||||
bit 2, d
|
||||
jr nz, .done
|
||||
ld a, $0
|
||||
ld [rNR32], a
|
||||
ldh [rNR32], a
|
||||
.done
|
||||
ret
|
||||
|
||||
@@ -429,9 +429,9 @@ Music2_UpdateChannel1: ; f82a5 (3e:42a5)
|
||||
bit 0, a
|
||||
jr nz, .asm_f8309
|
||||
ld a, $8
|
||||
ld [rNR12], a
|
||||
ldh [rNR12], a
|
||||
swap a
|
||||
ld [rNR14], a
|
||||
ldh [rNR14], a
|
||||
.asm_f8309
|
||||
ret
|
||||
|
||||
@@ -482,9 +482,9 @@ Music2_UpdateChannel2: ; f830a (3e:430a)
|
||||
bit 1, a
|
||||
jr nz, .asm_f836e
|
||||
ld a, $8
|
||||
ld [rNR22], a
|
||||
ldh [rNR22], a
|
||||
swap a
|
||||
ld [rNR24], a
|
||||
ldh [rNR24], a
|
||||
.asm_f836e
|
||||
ret
|
||||
|
||||
@@ -506,7 +506,7 @@ Music2_UpdateChannel3: ; f836f (3e:436f)
|
||||
cp $1
|
||||
jr z, .asm_f8398
|
||||
ld a, [wMusicE9 + 2]
|
||||
ld [rNR32], a
|
||||
ldh [rNR32], a
|
||||
.asm_f8398
|
||||
ld a, [wddbb + 2]
|
||||
dec a
|
||||
@@ -531,9 +531,9 @@ Music2_UpdateChannel3: ; f836f (3e:436f)
|
||||
bit 2, a
|
||||
jr nz, .asm_f83cd
|
||||
ld a, $0
|
||||
ld [rNR32], a
|
||||
ldh [rNR32], a
|
||||
ld a, $80
|
||||
ld [rNR34], a
|
||||
ldh [rNR34], a
|
||||
.asm_f83cd
|
||||
ret
|
||||
|
||||
@@ -569,9 +569,9 @@ Music2_UpdateChannel4: ; f83ce (3e:43ce)
|
||||
xor a
|
||||
ld [wddef], a
|
||||
ld a, $8
|
||||
ld [rNR42], a
|
||||
ldh [rNR42], a
|
||||
swap a
|
||||
ld [rNR44], a
|
||||
ldh [rNR44], a
|
||||
.asm_f8413
|
||||
ret
|
||||
|
||||
@@ -1167,19 +1167,19 @@ Func_f8714: ; f8714 (3e:4714)
|
||||
cp $80
|
||||
jr z, .asm_f8733
|
||||
ld a, [wMusicVolume]
|
||||
ld [rNR12], a
|
||||
ldh [rNR12], a
|
||||
ld d, $80
|
||||
.asm_f8733
|
||||
ld [hl], $2
|
||||
ld a, $8
|
||||
ld [rNR10], a
|
||||
ldh [rNR10], a
|
||||
ld a, [wMusicDuty1]
|
||||
ld [rNR11], a
|
||||
ldh [rNR11], a
|
||||
ld a, [wMusicCh1CurPitch]
|
||||
ld [rNR13], a
|
||||
ldh [rNR13], a
|
||||
ld a, [wMusicCh1CurOctave]
|
||||
or d
|
||||
ld [rNR14], a
|
||||
ldh [rNR14], a
|
||||
.asm_f8749
|
||||
ret
|
||||
.asm_f874a
|
||||
@@ -1206,17 +1206,17 @@ Func_f875a: ; f875a (3e:475a)
|
||||
cp $80
|
||||
jr z, .asm_f8779
|
||||
ld a, [wMusicVolume + 1]
|
||||
ld [rNR22], a
|
||||
ldh [rNR22], a
|
||||
ld d, $80
|
||||
.asm_f8779
|
||||
ld [hl], $2
|
||||
ld a, [wMusicDuty2]
|
||||
ld [rNR21], a
|
||||
ldh [rNR21], a
|
||||
ld a, [wMusicCh2CurPitch]
|
||||
ld [rNR23], a
|
||||
ldh [rNR23], a
|
||||
ld a, [wMusicCh2CurOctave]
|
||||
or d
|
||||
ld [rNR24], a
|
||||
ldh [rNR24], a
|
||||
.asm_f878b
|
||||
ret
|
||||
.asm_f878c
|
||||
@@ -1239,7 +1239,7 @@ Func_f879c: ; f879c (3e:479c)
|
||||
or a
|
||||
jr z, .no_wave_change
|
||||
xor a
|
||||
ld [rNR30], a
|
||||
ldh [rNR30], a
|
||||
call Music2_LoadWaveInstrument
|
||||
ld d, $80
|
||||
.no_wave_change
|
||||
@@ -1251,28 +1251,28 @@ Func_f879c: ; f879c (3e:479c)
|
||||
cp $80
|
||||
jr z, .asm_f87cc
|
||||
ld a, [wMusicVolume + 2]
|
||||
ld [rNR32], a
|
||||
ldh [rNR32], a
|
||||
xor a
|
||||
ld [rNR30], a
|
||||
ldh [rNR30], a
|
||||
ld d, $80
|
||||
.asm_f87cc
|
||||
ld [hl], $2
|
||||
xor a
|
||||
ld [rNR31], a
|
||||
ldh [rNR31], a
|
||||
ld a, [wMusicCh3CurPitch]
|
||||
ld [rNR33], a
|
||||
ldh [rNR33], a
|
||||
ld a, $80
|
||||
ld [rNR30], a
|
||||
ldh [rNR30], a
|
||||
ld a, [wMusicCh3CurOctave]
|
||||
or d
|
||||
ld [rNR34], a
|
||||
ldh [rNR34], a
|
||||
.asm_f87e0
|
||||
ret
|
||||
.asm_f87e1
|
||||
ld hl, wMusicTie
|
||||
ld [hl], $0
|
||||
xor a
|
||||
ld [rNR30], a
|
||||
ldh [rNR30], a
|
||||
ret
|
||||
|
||||
Music2_LoadWaveInstrument: ; f879c (3e:47ea)
|
||||
@@ -1349,7 +1349,7 @@ Func_f8839: ; f8839 (3e:4839)
|
||||
jr nz, .asm_f8853
|
||||
jr asm_f882a
|
||||
.asm_f8853
|
||||
ld [rNR43], a
|
||||
ldh [rNR43], a
|
||||
inc de
|
||||
ld a, d
|
||||
ld [hld], a
|
||||
@@ -1368,7 +1368,7 @@ Func_f885a: ; f885a (3e:485a)
|
||||
|
||||
Func_f8866: ; f8866 (3e:4866)
|
||||
ld a, [wMusicPanning]
|
||||
ld [rNR50], a
|
||||
ldh [rNR50], a
|
||||
ld a, [wdd8c]
|
||||
or a
|
||||
ld hl, wMusicDC
|
||||
@@ -1397,7 +1397,7 @@ Func_f8866: ; f8866 (3e:4866)
|
||||
swap e
|
||||
or e
|
||||
and d
|
||||
ld [rNR51], a
|
||||
ldh [rNR51], a
|
||||
ret
|
||||
|
||||
Func_f8898: ; f8898 (3e:4898)
|
||||
@@ -1495,13 +1495,13 @@ Func_f890b: ; f890b (3e:490b)
|
||||
bit 0, a
|
||||
jr nz, .done
|
||||
ld a, e
|
||||
ld [rNR13], a
|
||||
ld a, [rNR11]
|
||||
ldh [rNR13], a
|
||||
ldh a, [rNR11]
|
||||
and $c0
|
||||
ld [rNR11], a
|
||||
ldh [rNR11], a
|
||||
ld a, d
|
||||
and $3f
|
||||
ld [rNR14], a
|
||||
ldh [rNR14], a
|
||||
ret
|
||||
.not_channel_1
|
||||
cp $1
|
||||
@@ -1513,12 +1513,12 @@ Func_f890b: ; f890b (3e:490b)
|
||||
bit 1, a
|
||||
jr nz, .done
|
||||
ld a, e
|
||||
ld [rNR23], a
|
||||
ld a, [rNR21]
|
||||
ldh [rNR23], a
|
||||
ldh a, [rNR21]
|
||||
and $c0
|
||||
ld [rNR21], a
|
||||
ldh [rNR21], a
|
||||
ld a, d
|
||||
ld [rNR24], a
|
||||
ldh [rNR24], a
|
||||
ret
|
||||
.not_channel_2
|
||||
cp $2
|
||||
@@ -1530,11 +1530,11 @@ Func_f890b: ; f890b (3e:490b)
|
||||
bit 2, a
|
||||
jr nz, .done
|
||||
ld a, e
|
||||
ld [rNR33], a
|
||||
ldh [rNR33], a
|
||||
xor a
|
||||
ld [rNR31], a
|
||||
ldh [rNR31], a
|
||||
ld a, d
|
||||
ld [rNR34], a
|
||||
ldh [rNR34], a
|
||||
.done
|
||||
ret
|
||||
|
||||
@@ -1567,28 +1567,28 @@ Func_f8980: ; f8980 (3e:4980)
|
||||
bit 0, d
|
||||
jr nz, .asm_f8990
|
||||
ld a, $8
|
||||
ld [rNR12], a
|
||||
ldh [rNR12], a
|
||||
swap a
|
||||
ld [rNR14], a
|
||||
ldh [rNR14], a
|
||||
.asm_f8990
|
||||
bit 1, d
|
||||
jr nz, .asm_f899c
|
||||
swap a
|
||||
ld [rNR22], a
|
||||
ldh [rNR22], a
|
||||
swap a
|
||||
ld [rNR24], a
|
||||
ldh [rNR24], a
|
||||
.asm_f899c
|
||||
bit 3, d
|
||||
jr nz, .asm_f89a8
|
||||
swap a
|
||||
ld [rNR42], a
|
||||
ldh [rNR42], a
|
||||
swap a
|
||||
ld [rNR44], a
|
||||
ldh [rNR44], a
|
||||
.asm_f89a8
|
||||
bit 2, d
|
||||
jr nz, .asm_f89b0
|
||||
ld a, $0
|
||||
ld [rNR32], a
|
||||
ldh [rNR32], a
|
||||
.asm_f89b0
|
||||
ret
|
||||
|
||||
|
||||
@@ -400,7 +400,7 @@ SFX_7: ; fc202 (3f:4202)
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
ld a, $0
|
||||
ld [rNR30], a
|
||||
ldh [rNR30], a
|
||||
ld b, d
|
||||
ld de, $ff30
|
||||
.asm_fc215
|
||||
@@ -414,7 +414,7 @@ SFX_7: ; fc202 (3f:4202)
|
||||
ld a, $1
|
||||
ld [wMusicWaveChange], a
|
||||
ld a, $80
|
||||
ld [rNR30], a
|
||||
ldh [rNR30], a
|
||||
ld b, $0
|
||||
pop hl
|
||||
jp Func_fc094
|
||||
@@ -481,14 +481,14 @@ Func_fc26c: ; fc26c (3f:426c)
|
||||
|
||||
Func_fc279: ; fc279 (3f:4279)
|
||||
ld a, $8
|
||||
ld a, [rNR12]
|
||||
ld a, [rNR22]
|
||||
ld a, [rNR32]
|
||||
ld a, [rNR42]
|
||||
ldh a, [rNR12]
|
||||
ldh a, [rNR22]
|
||||
ldh a, [rNR32]
|
||||
ldh a, [rNR42]
|
||||
ld a, $80
|
||||
ld a, [rNR14]
|
||||
ld a, [rNR24]
|
||||
ld a, [rNR44]
|
||||
ldh a, [rNR14]
|
||||
ldh a, [rNR24]
|
||||
ldh a, [rNR44]
|
||||
xor a
|
||||
ld [wdd8c], a
|
||||
ret
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
ANIM_SPELL_MOVE EQU $01
|
||||
ANIM_GET_HIT EQU $07
|
||||
ANIM_THUNDER_SHOCK EQU $0a
|
||||
ANIM_FURY_SWEEPES EQU $24
|
||||
ANIM_FURY_SWIPES EQU $24
|
||||
|
||||
; Special animations
|
||||
ANIM_SHOW_DAMAGE EQU $09
|
||||
|
||||
@@ -227,4 +227,4 @@
|
||||
const POKEMON_FLUTE ; $e2
|
||||
const GAMBLER ; $e3
|
||||
const RECYCLE ; $e4
|
||||
NUM_CARDS EQU const_value + -1
|
||||
NUM_CARDS EQU const_value - 1
|
||||
|
||||
@@ -116,7 +116,7 @@ TYPE_ENERGY EQU const_value
|
||||
const TYPE_ENERGY_UNUSED ; $0f
|
||||
const TYPE_TRAINER ; $10
|
||||
const TYPE_TRAINER_UNUSED ; $11
|
||||
NUM_CARD_TYPES EQU const_value + -1
|
||||
NUM_CARD_TYPES EQU const_value - 1
|
||||
|
||||
TYPE_PKMN EQU %111
|
||||
TYPE_ENERGY_F EQU 3
|
||||
@@ -146,6 +146,7 @@ PRO EQU $8
|
||||
BASIC EQU $00
|
||||
STAGE1 EQU $01
|
||||
STAGE2 EQU $02
|
||||
STAGE2_WITHOUT_STAGE1 EQU $03
|
||||
|
||||
; CARD_DATA_WEAKNESS and CARD_DATA_RESISTANCE constants
|
||||
WR_FIRE EQU $80
|
||||
|
||||
@@ -94,6 +94,7 @@ ENDM
|
||||
fwcharmap 3, "\", $98
|
||||
fwcharmap 3, "┐", $99
|
||||
fwcharmap 3, "|", $9a
|
||||
fwcharmap 3, " ", $9c
|
||||
fwcharmap 3, "!", $9d
|
||||
fwcharmap 3, "#", $9f
|
||||
fwcharmap 3, "$", $a0
|
||||
@@ -279,11 +280,11 @@ ENDM
|
||||
fwcharmap 0, "ぷ", $54
|
||||
fwcharmap 0, "ぺ", $55
|
||||
fwcharmap 0, "ぽ", $56
|
||||
fwcharmap 0, "あ", $57
|
||||
fwcharmap 0, "い", $58
|
||||
fwcharmap 0, "う", $59
|
||||
fwcharmap 0, "え", $5a
|
||||
fwcharmap 0, "お", $5b
|
||||
fwcharmap 0, "あ(2)", $57
|
||||
fwcharmap 0, "い(2)", $58
|
||||
fwcharmap 0, "う(2)", $59
|
||||
fwcharmap 0, "え(2)", $5a
|
||||
fwcharmap 0, "お(2)", $5b
|
||||
fwcharmap 0, "ゃ", $5c
|
||||
fwcharmap 0, "ゅ", $5d
|
||||
fwcharmap 0, "ょ", $5e
|
||||
@@ -316,7 +317,7 @@ FW_SPACE EQU $70
|
||||
|
||||
txsymbol: MACRO
|
||||
const SYM_\1
|
||||
charmap "\1>", const_value + -1
|
||||
charmap "\1>", const_value - 1
|
||||
ENDM
|
||||
|
||||
; TX_SYMBOL
|
||||
|
||||
@@ -42,7 +42,8 @@ AI_ENERGY_FLAG_SKIP_ARENA_CARD EQU 1 << 7 ; whether to include Arena card in det
|
||||
; used by wAIBarrierFlagCounter to determine
|
||||
; whether Player is running Mewtwo1 mill deck.
|
||||
; flag set means true, flag not set means false.
|
||||
AI_FLAG_MEWTWO_MILL EQU 1 << 7
|
||||
AI_MEWTWO_MILL_F EQU 7
|
||||
AI_MEWTWO_MILL EQU 1 << AI_MEWTWO_MILL_F
|
||||
|
||||
; defines the behaviour of HandleAIEnergyTrans, for determining
|
||||
; whether to move energy cards from the Bench to the Arena or vice-versa
|
||||
@@ -59,3 +60,19 @@ AI_ENERGY_TRANS_TO_BENCH EQU $e ; moves energy cards away from Arena card
|
||||
const AIACTION_FORCED_SWITCH ; $3
|
||||
const AIACTION_KO_SWITCH ; $4
|
||||
const AIACTION_TAKE_PRIZE ; $5
|
||||
|
||||
; this bit is set when the AI decides to use Peek on their Prize cards,
|
||||
; with the following bits deciding which one to Peek. That is:
|
||||
; %10'0000 = first prize card
|
||||
; %10'0001 = second prize card
|
||||
; %10'0010 = third prize card
|
||||
; etc...
|
||||
AI_PEEK_TARGET_PRIZE_F EQU 6
|
||||
AI_PEEK_TARGET_PRIZE EQU 1 << AI_PEEK_TARGET_PRIZE_F
|
||||
; this bit is set when the AI decides to use Peek on Player hand card,
|
||||
; with the following bits deciding which one to Peek. That is:
|
||||
; %1XXX XXXX, where XXX XXXX is the deck index of card chosen
|
||||
AI_PEEK_TARGET_HAND_F EQU 7
|
||||
AI_PEEK_TARGET_HAND EQU 1 << AI_PEEK_TARGET_HAND_F
|
||||
; all bits set means AI chose to look at Player's top deck card
|
||||
AI_PEEK_TARGET_DECK EQU $ff
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
deck_const: MACRO
|
||||
if const_value >= 2
|
||||
\1_ID EQU const_value + -2
|
||||
\1_ID EQU const_value - 2
|
||||
endc
|
||||
const \1
|
||||
ENDM
|
||||
@@ -65,4 +65,6 @@ ENDM
|
||||
deck_const FLAMETHROWER_DECK ; $34
|
||||
deck_const RESHUFFLE_DECK ; $35
|
||||
deck_const IMAKUNI_DECK ; $36
|
||||
DECKS_END EQU const_value + -1
|
||||
DECKS_END EQU const_value - 1
|
||||
DECK_IDS_END EQU DECKS_END - 2
|
||||
|
||||
|
||||
@@ -25,58 +25,61 @@ DUEL_WIN EQU $0
|
||||
DUEL_LOSS EQU $1
|
||||
|
||||
; wPlayerDuelVariables or wOpponentDuelVariables constants
|
||||
DUELVARS_CARD_LOCATIONS EQUS "LOW(wPlayerCardLocations)" ; 00
|
||||
DUELVARS_PRIZE_CARDS EQUS "LOW(wPlayerPrizeCards)" ; 3c
|
||||
DUELVARS_HAND EQUS "LOW(wPlayerHand)" ; 42
|
||||
DUELVARS_DECK_CARDS EQUS "LOW(wPlayerDeckCards)" ; 7e
|
||||
DUELVARS_NUMBER_OF_CARDS_NOT_IN_DECK EQUS "LOW(wPlayerNumberOfCardsNotInDeck)" ; ba
|
||||
DUELVARS_ARENA_CARD EQUS "LOW(wPlayerArenaCard)" ; bb
|
||||
DUELVARS_BENCH EQUS "LOW(wPlayerBench)" ; bc
|
||||
DUELVARS_ARENA_CARD_FLAGS_C2 EQU $c2
|
||||
DUELVARS_ARENA_CARD_HP EQUS "LOW(wPlayerArenaCardHP)" ; c8
|
||||
DUELVARS_BENCH1_CARD_HP EQUS "LOW(wPlayerBench1CardHP)" ; c9
|
||||
DUELVARS_BENCH2_CARD_HP EQUS "LOW(wPlayerBench2CardHP)" ; ca
|
||||
DUELVARS_BENCH3_CARD_HP EQUS "LOW(wPlayerBench3CardHP)" ; cb
|
||||
DUELVARS_BENCH4_CARD_HP EQUS "LOW(wPlayerBench4CardHP)" ; cc
|
||||
DUELVARS_BENCH5_CARD_HP EQUS "LOW(wPlayerBench5CardHP)" ; cd
|
||||
DUELVARS_ARENA_CARD_STAGE EQUS "LOW(wPlayerArenaCardStage)" ; ce
|
||||
DUELVARS_BENCH1_CARD_STAGE EQUS "LOW(wPlayerBench1CardStage)" ; cf
|
||||
DUELVARS_BENCH2_CARD_STAGE EQUS "LOW(wPlayerBench2CardStage)" ; d0
|
||||
DUELVARS_BENCH3_CARD_STAGE EQUS "LOW(wPlayerBench3CardStage)" ; d1
|
||||
DUELVARS_BENCH4_CARD_STAGE EQUS "LOW(wPlayerBench4CardStage)" ; d2
|
||||
DUELVARS_BENCH5_CARD_STAGE EQUS "LOW(wPlayerBench5CardStage)" ; d3
|
||||
DUELVARS_ARENA_CARD_CHANGED_TYPE EQUS "LOW(wPlayerArenaCardChangedType)" ; d4
|
||||
DUELVARS_BENCH1_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench1CardChangedType)" ; d5
|
||||
DUELVARS_BENCH2_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench2CardChangedType)" ; d6
|
||||
DUELVARS_BENCH3_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench3CardChangedType)" ; d7
|
||||
DUELVARS_BENCH4_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench4CardChangedType)" ; d8
|
||||
DUELVARS_BENCH5_CARD_CHANGED_TYPE EQUS "LOW(wPlayerBench5CardChangedType)" ; d9
|
||||
DUELVARS_ARENA_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerArenaCardAttachedDefender)" ; da
|
||||
DUELVARS_BENCH1_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench1CardAttachedDefender)" ; db
|
||||
DUELVARS_BENCH2_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench2CardAttachedDefender)" ; dc
|
||||
DUELVARS_BENCH3_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench3CardAttachedDefender)" ; dd
|
||||
DUELVARS_BENCH4_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench4CardAttachedDefender)" ; de
|
||||
DUELVARS_BENCH5_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench5CardAttachedDefender)" ; df
|
||||
DUELVARS_ARENA_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerArenaCardAttachedPluspower)" ; e0
|
||||
DUELVARS_BENCH1_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench1CardAttachedPluspower)" ; e1
|
||||
DUELVARS_BENCH2_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench2CardAttachedPluspower)" ; e2
|
||||
DUELVARS_BENCH3_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench3CardAttachedPluspower)" ; e3
|
||||
DUELVARS_BENCH4_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench4CardAttachedPluspower)" ; e4
|
||||
DUELVARS_BENCH5_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench5CardAttachedPluspower)" ; e5
|
||||
DUELVARS_ARENA_CARD_SUBSTATUS1 EQUS "LOW(wPlayerArenaCardSubstatus1)" ; e7
|
||||
DUELVARS_ARENA_CARD_SUBSTATUS2 EQUS "LOW(wPlayerArenaCardSubstatus2)" ; e8
|
||||
DUELVARS_ARENA_CARD_CHANGED_WEAKNESS EQUS "LOW(wPlayerArenaCardChangedWeakness)" ; e9
|
||||
DUELVARS_ARENA_CARD_CHANGED_RESISTANCE EQUS "LOW(wPlayerArenaCardChangedResistance)" ; ea
|
||||
DUELVARS_ARENA_CARD_SUBSTATUS3 EQUS "LOW(wPlayerArenaCardSubstatus3)" ; eb
|
||||
DUELVARS_PRIZES EQUS "LOW(wPlayerPrizes)" ; ec
|
||||
DUELVARS_NUMBER_OF_CARDS_IN_DISCARD_PILE EQUS "LOW(wPlayerNumberOfCardsInDiscardPile)" ; ed
|
||||
DUELVARS_NUMBER_OF_CARDS_IN_HAND EQUS "LOW(wPlayerNumberOfCardsInHand)" ; ee
|
||||
DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA EQUS "LOW(wPlayerNumberOfPokemonInPlayArea)" ; ef
|
||||
DUELVARS_ARENA_CARD_STATUS EQUS "LOW(wPlayerArenaCardStatus)" ; f0
|
||||
DUELVARS_DUELIST_TYPE EQUS "LOW(wPlayerDuelistType)" ; f1
|
||||
DUELVARS_ARENA_CARD_DISABLED_MOVE_INDEX EQUS "LOW(wPlayerArenaCardDisabledMoveIndex)" ; f2
|
||||
DUELVARS_ARENA_CARD_LAST_TURN_DAMAGE EQUS "LOW(wPlayerArenaCardLastTurnDamage)" ; f3
|
||||
DUELVARS_ARENA_CARD_LAST_TURN_STATUS EQUS "LOW(wPlayerArenaCardLastTurnStatus)" ; f5
|
||||
DUELVARS_CARD_LOCATIONS EQUS "LOW(wPlayerCardLocations)" ; 00
|
||||
DUELVARS_PRIZE_CARDS EQUS "LOW(wPlayerPrizeCards)" ; 3c
|
||||
DUELVARS_HAND EQUS "LOW(wPlayerHand)" ; 42
|
||||
DUELVARS_DECK_CARDS EQUS "LOW(wPlayerDeckCards)" ; 7e
|
||||
DUELVARS_NUMBER_OF_CARDS_NOT_IN_DECK EQUS "LOW(wPlayerNumberOfCardsNotInDeck)" ; ba
|
||||
DUELVARS_ARENA_CARD EQUS "LOW(wPlayerArenaCard)" ; bb
|
||||
DUELVARS_BENCH EQUS "LOW(wPlayerBench)" ; bc
|
||||
DUELVARS_ARENA_CARD_FLAGS EQUS "LOW(wPlayerArenaCardFlags)" ; c2
|
||||
DUELVARS_ARENA_CARD_HP EQUS "LOW(wPlayerArenaCardHP)" ; c8
|
||||
DUELVARS_BENCH1_CARD_HP EQUS "LOW(wPlayerBench1CardHP)" ; c9
|
||||
DUELVARS_BENCH2_CARD_HP EQUS "LOW(wPlayerBench2CardHP)" ; ca
|
||||
DUELVARS_BENCH3_CARD_HP EQUS "LOW(wPlayerBench3CardHP)" ; cb
|
||||
DUELVARS_BENCH4_CARD_HP EQUS "LOW(wPlayerBench4CardHP)" ; cc
|
||||
DUELVARS_BENCH5_CARD_HP EQUS "LOW(wPlayerBench5CardHP)" ; cd
|
||||
DUELVARS_ARENA_CARD_STAGE EQUS "LOW(wPlayerArenaCardStage)" ; ce
|
||||
DUELVARS_BENCH1_CARD_STAGE EQUS "LOW(wPlayerBench1CardStage)" ; cf
|
||||
DUELVARS_BENCH2_CARD_STAGE EQUS "LOW(wPlayerBench2CardStage)" ; d0
|
||||
DUELVARS_BENCH3_CARD_STAGE EQUS "LOW(wPlayerBench3CardStage)" ; d1
|
||||
DUELVARS_BENCH4_CARD_STAGE EQUS "LOW(wPlayerBench4CardStage)" ; d2
|
||||
DUELVARS_BENCH5_CARD_STAGE EQUS "LOW(wPlayerBench5CardStage)" ; d3
|
||||
DUELVARS_ARENA_CARD_CHANGED_TYPE EQUS "LOW(wPlayerArenaCardChangedType)" ; d4
|
||||
DUELVARS_BENCH1_CARD_CHANGED_COLOR EQUS "LOW(wPlayerBench1CardChangedType)" ; d5
|
||||
DUELVARS_BENCH2_CARD_CHANGED_COLOR EQUS "LOW(wPlayerBench2CardChangedType)" ; d6
|
||||
DUELVARS_BENCH3_CARD_CHANGED_COLOR EQUS "LOW(wPlayerBench3CardChangedType)" ; d7
|
||||
DUELVARS_BENCH4_CARD_CHANGED_COLOR EQUS "LOW(wPlayerBench4CardChangedType)" ; d8
|
||||
DUELVARS_BENCH5_CARD_CHANGED_COLOR EQUS "LOW(wPlayerBench5CardChangedType)" ; d9
|
||||
DUELVARS_ARENA_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerArenaCardAttachedDefender)" ; da
|
||||
DUELVARS_BENCH1_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench1CardAttachedDefender)" ; db
|
||||
DUELVARS_BENCH2_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench2CardAttachedDefender)" ; dc
|
||||
DUELVARS_BENCH3_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench3CardAttachedDefender)" ; dd
|
||||
DUELVARS_BENCH4_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench4CardAttachedDefender)" ; de
|
||||
DUELVARS_BENCH5_CARD_ATTACHED_DEFENDER EQUS "LOW(wPlayerBench5CardAttachedDefender)" ; df
|
||||
DUELVARS_ARENA_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerArenaCardAttachedPluspower)" ; e0
|
||||
DUELVARS_BENCH1_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench1CardAttachedPluspower)" ; e1
|
||||
DUELVARS_BENCH2_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench2CardAttachedPluspower)" ; e2
|
||||
DUELVARS_BENCH3_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench3CardAttachedPluspower)" ; e3
|
||||
DUELVARS_BENCH4_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench4CardAttachedPluspower)" ; e4
|
||||
DUELVARS_BENCH5_CARD_ATTACHED_PLUSPOWER EQUS "LOW(wPlayerBench5CardAttachedPluspower)" ; e5
|
||||
DUELVARS_ARENA_CARD_SUBSTATUS1 EQUS "LOW(wPlayerArenaCardSubstatus1)" ; e7
|
||||
DUELVARS_ARENA_CARD_SUBSTATUS2 EQUS "LOW(wPlayerArenaCardSubstatus2)" ; e8
|
||||
DUELVARS_ARENA_CARD_CHANGED_WEAKNESS EQUS "LOW(wPlayerArenaCardChangedWeakness)" ; e9
|
||||
DUELVARS_ARENA_CARD_CHANGED_RESISTANCE EQUS "LOW(wPlayerArenaCardChangedResistance)" ; ea
|
||||
DUELVARS_ARENA_CARD_SUBSTATUS3 EQUS "LOW(wPlayerArenaCardSubstatus3)" ; eb
|
||||
DUELVARS_PRIZES EQUS "LOW(wPlayerPrizes)" ; ec
|
||||
DUELVARS_NUMBER_OF_CARDS_IN_DISCARD_PILE EQUS "LOW(wPlayerNumberOfCardsInDiscardPile)" ; ed
|
||||
DUELVARS_NUMBER_OF_CARDS_IN_HAND EQUS "LOW(wPlayerNumberOfCardsInHand)" ; ee
|
||||
DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA EQUS "LOW(wPlayerNumberOfPokemonInPlayArea)" ; ef
|
||||
DUELVARS_ARENA_CARD_STATUS EQUS "LOW(wPlayerArenaCardStatus)" ; f0
|
||||
DUELVARS_DUELIST_TYPE EQUS "LOW(wPlayerDuelistType)" ; f1
|
||||
DUELVARS_ARENA_CARD_DISABLED_MOVE_INDEX EQUS "LOW(wPlayerArenaCardDisabledMoveIndex)" ; f2
|
||||
DUELVARS_ARENA_CARD_LAST_TURN_DAMAGE EQUS "LOW(wPlayerArenaCardLastTurnDamage)" ; f3
|
||||
DUELVARS_ARENA_CARD_LAST_TURN_STATUS EQUS "LOW(wPlayerArenaCardLastTurnStatus)" ; f5
|
||||
DUELVARS_ARENA_CARD_LAST_TURN_SUBSTATUS2 EQUS "LOW(wPlayerArenaCardLastTurnSubstatus2)" ; f6
|
||||
DUELVARS_ARENA_CARD_LAST_TURN_CHANGE_WEAK EQUS "LOW(wPlayerArenaCardLastTurnChangeWeak)" ; f7
|
||||
DUELVARS_ARENA_CARD_LAST_TURN_EFFECT EQUS "LOW(wPlayerArenaCardLastTurnEffect)" ; f8
|
||||
|
||||
; card location constants (DUELVARS_CARD_LOCATIONS)
|
||||
CARD_LOCATION_DECK EQU $00
|
||||
@@ -153,6 +156,7 @@ SUBSTATUS2_AMNESIA EQU $04
|
||||
SUBSTATUS2_TAIL_WAG EQU $05
|
||||
SUBSTATUS2_LEER EQU $06
|
||||
SUBSTATUS2_POUNCE EQU $07
|
||||
SUBSTATUS2_CONVERSION2 EQU $08
|
||||
SUBSTATUS2_UNABLE_RETREAT EQU $09
|
||||
SUBSTATUS2_BONE_ATTACK EQU $0b
|
||||
SUBSTATUS2_GROWL EQU $12
|
||||
@@ -160,22 +164,41 @@ SUBSTATUS2_GROWL EQU $12
|
||||
SUBSTATUS3_THIS_TURN_DOUBLE_DAMAGE EQU 0
|
||||
SUBSTATUS3_HEADACHE EQU 1
|
||||
|
||||
; DUELVARS_ARENA_CARD_FLAGS_C2 constants
|
||||
CAN_EVOLVE_THIS_TURN_F EQU 7
|
||||
CAN_EVOLVE_THIS_TURN EQU 1 << CAN_EVOLVE_THIS_TURN_F
|
||||
; DUELVARS_ARENA_CARD_FLAGS constants
|
||||
USED_PKMN_POWER_THIS_TURN_F EQU 5
|
||||
USED_LEEK_SLAP_THIS_DUEL_F EQU 6
|
||||
CAN_EVOLVE_THIS_TURN_F EQU 7
|
||||
|
||||
USED_PKMN_POWER_THIS_TURN EQU 1 << USED_PKMN_POWER_THIS_TURN_F
|
||||
USED_LEEK_SLAP_THIS_DUEL EQU 1 << USED_LEEK_SLAP_THIS_DUEL_F
|
||||
CAN_EVOLVE_THIS_TURN EQU 1 << CAN_EVOLVE_THIS_TURN_F
|
||||
|
||||
; DUELVARS_ARENA_CARD_LAST_TURN_EFFECT constants
|
||||
const_def
|
||||
const LAST_TURN_EFFECT_NONE ; $00
|
||||
const LAST_TURN_EFFECT_DISCARD_ENERGY ; $01
|
||||
const LAST_TURN_EFFECT_AMNESIA ; $02
|
||||
|
||||
; *_CHANGED_COLOR constants
|
||||
HAS_CHANGED_COLOR_F EQU 7
|
||||
HAS_CHANGED_COLOR EQU 1 << HAS_CHANGED_COLOR_F
|
||||
|
||||
; flag in wDamage + 1 that indicates
|
||||
; whether damage is unaffected by Weakness/Resistance
|
||||
UNAFFECTED_BY_WEAKNESS_RESISTANCE_F EQU 7
|
||||
|
||||
; effect command constants (TryExecuteEffectCommandFunction)
|
||||
; ordered by (roughly) execution time
|
||||
EFFECTCMDTYPE_INITIAL_EFFECT_1 EQU $01
|
||||
EFFECTCMDTYPE_INITIAL_EFFECT_2 EQU $02
|
||||
EFFECTCMDTYPE_DISCARD_ENERGY EQU $06
|
||||
EFFECTCMDTYPE_REQUIRE_SELECTION EQU $05
|
||||
EFFECTCMDTYPE_BEFORE_DAMAGE EQU $03
|
||||
EFFECTCMDTYPE_AFTER_DAMAGE EQU $04
|
||||
EFFECTCMDTYPE_SWITCH_DEFENDING_PKMN EQU $0a
|
||||
EFFECTCMDTYPE_PKMN_POWER_TRIGGER EQU $07
|
||||
EFFECTCMDTYPE_AI EQU $09
|
||||
EFFECTCMDTYPE_UNKNOWN_08 EQU $08
|
||||
EFFECTCMDTYPE_INITIAL_EFFECT_1 EQU $01
|
||||
EFFECTCMDTYPE_INITIAL_EFFECT_2 EQU $02
|
||||
EFFECTCMDTYPE_DISCARD_ENERGY EQU $06
|
||||
EFFECTCMDTYPE_REQUIRE_SELECTION EQU $05
|
||||
EFFECTCMDTYPE_BEFORE_DAMAGE EQU $03
|
||||
EFFECTCMDTYPE_AFTER_DAMAGE EQU $04
|
||||
EFFECTCMDTYPE_AI_SELECTION EQU $08
|
||||
EFFECTCMDTYPE_AI_SWITCH_DEFENDING_PKMN EQU $0a
|
||||
EFFECTCMDTYPE_PKMN_POWER_TRIGGER EQU $07
|
||||
EFFECTCMDTYPE_AI EQU $09
|
||||
|
||||
; wDamageEffectiveness constants
|
||||
WEAKNESS EQU 1
|
||||
@@ -210,7 +233,7 @@ NO_DAMAGE_OR_EFFECT_NSHIELD EQU $05
|
||||
const OPPACTION_TOSS_COIN_A_TIMES ; $11
|
||||
const OPPACTION_6B30 ; $12
|
||||
const OPPACTION_NO_ACTION_13 ; $13
|
||||
const OPPACTION_6B3E ; $14
|
||||
const OPPACTION_USE_METRONOME_ATTACK ; $14
|
||||
const OPPACTION_6B15 ; $15
|
||||
const OPPACTION_DUEL_MAIN_SCENE ; $16
|
||||
|
||||
@@ -234,9 +257,16 @@ EFFECT_FAILED_UNSUCCESSFUL EQU $02
|
||||
; wAnimationQueue length
|
||||
ANIMATION_QUEUE_LENGTH EQU 7
|
||||
|
||||
PRIZES_1 EQU $01
|
||||
PRIZES_2 EQU $02
|
||||
PRIZES_3 EQU $03
|
||||
PRIZES_4 EQU $04
|
||||
PRIZES_5 EQU $05
|
||||
PRIZES_6 EQU $06
|
||||
PRIZES_1 EQU $01
|
||||
PRIZES_2 EQU $02
|
||||
PRIZES_3 EQU $03
|
||||
PRIZES_4 EQU $04
|
||||
PRIZES_5 EQU $05
|
||||
PRIZES_6 EQU $06
|
||||
|
||||
; constants to use as input to LookForCardInDeck
|
||||
SEARCHEFFECT_CARD_ID EQU $0
|
||||
SEARCHEFFECT_NIDORAN EQU $1
|
||||
SEARCHEFFECT_BASIC_FIGHTING EQU $2
|
||||
SEARCHEFFECT_BASIC_ENERGY EQU $3
|
||||
SEARCHEFFECT_POKEMON EQU $4
|
||||
|
||||
@@ -101,7 +101,7 @@ 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)
|
||||
rNR44 EQU $ff23 ; Channel 4 Counter/consecutive; Initial (R/W)
|
||||
|
||||
rNR50 EQU $ff24 ; Channel control / ON-OFF / Volume (R/W)
|
||||
rNR51 EQU $ff25 ; Selection of Sound output terminal (R/W)
|
||||
|
||||
@@ -12,7 +12,7 @@ booster_set: MACRO
|
||||
ENDM
|
||||
|
||||
; For the energy or energy generation function, there are three options:
|
||||
; - Ponter to a function that generates energies (some generate one, some generate a full pack)
|
||||
; - Pointer to a function that generates energies (some generate one, some generate a full pack)
|
||||
; - A single energy of a specific type
|
||||
; - $0000 if no card in the pack is an energy
|
||||
|
||||
@@ -37,7 +37,7 @@ BoosterPack_ColosseumNeutral:: ; 1e4e4 (7:64e4)
|
||||
|
||||
BoosterPack_ColosseumGrass:: ; 1e4f0 (7:64f0)
|
||||
booster_set COLOSSEUM ; booster pack set
|
||||
dw GRASS_ENERGY ; energy or energy generation function
|
||||
dw GRASS_ENERGY ; energy or energy generation function
|
||||
|
||||
; Card Type Chances
|
||||
db 48 ; Grass Type Chance
|
||||
@@ -52,7 +52,7 @@ BoosterPack_ColosseumGrass:: ; 1e4f0 (7:64f0)
|
||||
|
||||
BoosterPack_ColosseumFire:: ; 1e4fc (7:64fc)
|
||||
booster_set COLOSSEUM ; booster pack set
|
||||
dw FIRE_ENERGY ; energy or energy generation function
|
||||
dw FIRE_ENERGY ; energy or energy generation function
|
||||
|
||||
; Card Type Chances
|
||||
db 16 ; Grass Type Chance
|
||||
|
||||
@@ -858,12 +858,12 @@ NidoranFCard: ; 31134 (c:5134)
|
||||
|
||||
; move 1
|
||||
energy GRASS, 1 ; energies
|
||||
tx FurySweepesName ; name
|
||||
tx FurySwipesName ; name
|
||||
tx TripleAttackX10Description ; description
|
||||
dw NONE ; description (cont)
|
||||
db 10 ; damage
|
||||
db DAMAGE_X ; category
|
||||
dw NidoranFFurySweepesEffectCommands ; effect commands
|
||||
dw NidoranFFurySwipesEffectCommands ; effect commands
|
||||
db NONE ; flags 1
|
||||
db NONE ; flags 2
|
||||
db NONE ; flags 3
|
||||
@@ -3320,12 +3320,12 @@ PsyduckCard: ; 31d64 (c:5d64)
|
||||
|
||||
; move 2
|
||||
energy WATER, 1 ; energies
|
||||
tx FurySweepesName ; name
|
||||
tx FurySwipesName ; name
|
||||
tx TripleAttackX10Description ; description
|
||||
dw NONE ; description (cont)
|
||||
db 10 ; damage
|
||||
db DAMAGE_X ; category
|
||||
dw PsyduckFurySweepesEffectCommands ; effect commands
|
||||
dw PsyduckFurySwipesEffectCommands ; effect commands
|
||||
db NONE ; flags 1
|
||||
db NONE ; flags 2
|
||||
db NONE ; flags 3
|
||||
@@ -5972,12 +5972,12 @@ SandslashCard: ; 32a98 (c:6a98)
|
||||
|
||||
; move 2
|
||||
energy FIGHTING, 2 ; energies
|
||||
tx FurySweepesName ; name
|
||||
tx FurySwipesName ; name
|
||||
tx TripleAttackX20Description ; description
|
||||
dw NONE ; description (cont)
|
||||
db 20 ; damage
|
||||
db DAMAGE_X ; category
|
||||
dw SandslashFurySweepesEffectCommands ; effect commands
|
||||
dw SandslashFurySwipesEffectCommands ; effect commands
|
||||
db NONE ; flags 1
|
||||
db NONE ; flags 2
|
||||
db NONE ; flags 3
|
||||
@@ -6162,12 +6162,12 @@ PrimeapeCard: ; 32b9c (c:6b9c)
|
||||
|
||||
; move 1
|
||||
energy FIGHTING, 2 ; energies
|
||||
tx FurySweepesName ; name
|
||||
tx FurySwipesName ; name
|
||||
tx TripleAttackX20Description ; description
|
||||
dw NONE ; description (cont)
|
||||
db 20 ; damage
|
||||
db DAMAGE_X ; category
|
||||
dw PrimeapeFurySweepesEffectCommands ; effect commands
|
||||
dw PrimeapeFurySwipesEffectCommands ; effect commands
|
||||
db NONE ; flags 1
|
||||
db NONE ; flags 2
|
||||
db NONE ; flags 3
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
; TODO: figure out the rest of the data for each map
|
||||
; related to the table at 20:4e5d
|
||||
MapHeaders: ; 1c374 (7:4374)
|
||||
db $00,$01,$00,$01,$01,MUSIC_OVERWORLD ; OVERWORLD_MAP
|
||||
db $02,$03,$00,$02,$02,MUSIC_OVERWORLD ; MASON_LABORATORY
|
||||
db $06,$07,$00,$02,$02,MUSIC_OVERWORLD ; DECK_MACHINE_ROOM
|
||||
db $0A,$0B,$00,$03,$03,MUSIC_OVERWORLD ; ISHIHARAS_HOUSE
|
||||
db $0C,$0D,$00,$03,$04,MUSIC_OVERWORLD ; FIGHTING_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; FIGHTING_CLUB_LOBBY
|
||||
db $20,$21,$00,$04,$0D,MUSIC_CLUB_3 ; FIGHTING_CLUB
|
||||
db $0E,$0F,$00,$03,$05,MUSIC_OVERWORLD ; ROCK_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; ROCK_CLUB_LOBBY
|
||||
db $22,$23,$00,$04,$0E,MUSIC_CLUB_2 ; ROCK_CLUB
|
||||
db $10,$11,$00,$03,$06,MUSIC_OVERWORLD ; WATER_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; WATER_CLUB_LOBBY
|
||||
db $24,$25,$00,$02,$0F,MUSIC_CLUB_2 ; WATER_CLUB
|
||||
db $12,$13,$00,$03,$07,MUSIC_OVERWORLD ; LIGHTNING_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; LIGHTNING_CLUB_LOBBY
|
||||
db $26,$27,$00,$05,$10,MUSIC_CLUB_1 ; LIGHTNING_CLUB
|
||||
db $14,$15,$00,$03,$08,MUSIC_OVERWORLD ; GRASS_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; GRASS_CLUB_LOBBY
|
||||
db $28,$29,$00,$06,$11,MUSIC_CLUB_1 ; GRASS_CLUB
|
||||
db $16,$17,$00,$03,$09,MUSIC_OVERWORLD ; PSYCHIC_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; PSYCHIC_CLUB_LOBBY
|
||||
db $2A,$2B,$00,$07,$12,MUSIC_CLUB_2 ; PSYCHIC_CLUB
|
||||
db $18,$19,$00,$03,$0A,MUSIC_OVERWORLD ; SCIENCE_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; SCIENCE_CLUB_LOBBY
|
||||
db $2C,$2D,$00,$06,$13,MUSIC_CLUB_3 ; SCIENCE_CLUB
|
||||
db $1A,$1B,$00,$03,$0B,MUSIC_OVERWORLD ; FIRE_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; FIRE_CLUB_LOBBY
|
||||
db $2E,$2F,$00,$08,$14,MUSIC_CLUB_3 ; FIRE_CLUB
|
||||
db $1C,$1D,$00,$03,$04,MUSIC_OVERWORLD ; CHALLENGE_HALL_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; CHALLENGE_HALL_LOBBY
|
||||
db $30,$31,$00,$09,$15,MUSIC_OVERWORLD ; CHALLENGE_HALL
|
||||
db $32,$33,$00,$0A,$16,MUSIC_OVERWORLD ; POKEMON_DOME_ENTRANCE
|
||||
db $36,$37,$00,$0A,$17,MUSIC_POKEMON_DOME ; POKEMON_DOME
|
||||
db $00,$01,$00,$01,$01,MUSIC_OVERWORLD ; OVERWORLD_MAP
|
||||
db $02,$03,$00,$02,$02,MUSIC_OVERWORLD ; MASON_LABORATORY
|
||||
db $06,$07,$00,$02,$02,MUSIC_OVERWORLD ; DECK_MACHINE_ROOM
|
||||
db $0A,$0B,$00,$03,$03,MUSIC_OVERWORLD ; ISHIHARAS_HOUSE
|
||||
db $0C,$0D,$00,$03,$04,MUSIC_OVERWORLD ; FIGHTING_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; FIGHTING_CLUB_LOBBY
|
||||
db $20,$21,$00,$04,$0D,MUSIC_CLUB_3 ; FIGHTING_CLUB
|
||||
db $0E,$0F,$00,$03,$05,MUSIC_OVERWORLD ; ROCK_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; ROCK_CLUB_LOBBY
|
||||
db $22,$23,$00,$04,$0E,MUSIC_CLUB_2 ; ROCK_CLUB
|
||||
db $10,$11,$00,$03,$06,MUSIC_OVERWORLD ; WATER_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; WATER_CLUB_LOBBY
|
||||
db $24,$25,$00,$02,$0F,MUSIC_CLUB_2 ; WATER_CLUB
|
||||
db $12,$13,$00,$03,$07,MUSIC_OVERWORLD ; LIGHTNING_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; LIGHTNING_CLUB_LOBBY
|
||||
db $26,$27,$00,$05,$10,MUSIC_CLUB_1 ; LIGHTNING_CLUB
|
||||
db $14,$15,$00,$03,$08,MUSIC_OVERWORLD ; GRASS_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; GRASS_CLUB_LOBBY
|
||||
db $28,$29,$00,$06,$11,MUSIC_CLUB_1 ; GRASS_CLUB
|
||||
db $16,$17,$00,$03,$09,MUSIC_OVERWORLD ; PSYCHIC_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; PSYCHIC_CLUB_LOBBY
|
||||
db $2A,$2B,$00,$07,$12,MUSIC_CLUB_2 ; PSYCHIC_CLUB
|
||||
db $18,$19,$00,$03,$0A,MUSIC_OVERWORLD ; SCIENCE_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; SCIENCE_CLUB_LOBBY
|
||||
db $2C,$2D,$00,$06,$13,MUSIC_CLUB_3 ; SCIENCE_CLUB
|
||||
db $1A,$1B,$00,$03,$0B,MUSIC_OVERWORLD ; FIRE_CLUB_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; FIRE_CLUB_LOBBY
|
||||
db $2E,$2F,$00,$08,$14,MUSIC_CLUB_3 ; FIRE_CLUB
|
||||
db $1C,$1D,$00,$03,$04,MUSIC_OVERWORLD ; CHALLENGE_HALL_ENTRANCE
|
||||
db $1E,$1F,$00,$03,$0C,MUSIC_OVERWORLD ; CHALLENGE_HALL_LOBBY
|
||||
db $30,$31,$00,$09,$15,MUSIC_OVERWORLD ; CHALLENGE_HALL
|
||||
db $32,$33,$00,$0A,$16,MUSIC_OVERWORLD ; POKEMON_DOME_ENTRANCE
|
||||
db $36,$37,$00,$0A,$17,MUSIC_POKEMON_DOME ; POKEMON_DOME
|
||||
db $3A,$3B,$00,$0A,$18,MUSIC_HALL_OF_HONOR ; HALL_OF_HONOR
|
||||
|
||||
@@ -538,7 +538,6 @@ PokemonDomeEntranceObjects: ; 13e5e (3:7e5e)
|
||||
tx Text0500
|
||||
tx Text04ff
|
||||
|
||||
|
||||
db NORTH, 2, 8
|
||||
dw PrintInteractableObjectText
|
||||
tx Text0502
|
||||
|
||||
@@ -167,7 +167,7 @@ PointerTable_MoveAnimation:
|
||||
dw MoveAnimation_5673
|
||||
dw MoveAnimation_5673
|
||||
|
||||
MoveAnimation_52c6: ; (6:52c6)
|
||||
MoveAnimation_52c6: ; (6:52c6)
|
||||
anim_player ANIM_SPELL_MOVE
|
||||
anim_opponent ANIM_GET_HIT
|
||||
anim_normal ANIM_SHAKE1
|
||||
@@ -391,7 +391,7 @@ MoveAnimation_53eb:
|
||||
|
||||
MoveAnimation_53f6:
|
||||
anim_player ANIM_SPELL_MOVE
|
||||
anim_opponent ANIM_FURY_SWEEPES
|
||||
anim_opponent ANIM_FURY_SWIPES
|
||||
anim_opponent ANIM_GET_HIT
|
||||
anim_normal ANIM_SHAKE1
|
||||
anim_opponent ANIM_SHOW_DAMAGE
|
||||
|
||||
@@ -187,7 +187,7 @@ MainDuelLoop: ; 40ee (1:40ee)
|
||||
cp TURN_PLAYER_WON
|
||||
jr z, .active_duelist_won_battle
|
||||
cp TURN_PLAYER_LOST
|
||||
jr z, .active_duelist_lost_batte
|
||||
jr z, .active_duelist_lost_battle
|
||||
ld a, $5f
|
||||
ld c, MUSIC_DARK_DIDDLY
|
||||
ldtx hl, DuelWasADrawText
|
||||
@@ -205,7 +205,7 @@ MainDuelLoop: ; 40ee (1:40ee)
|
||||
ldtx hl, WonDuelText
|
||||
jr .handle_duel_finished
|
||||
|
||||
.active_duelist_lost_batte
|
||||
.active_duelist_lost_battle
|
||||
ldh a, [hWhoseTurn]
|
||||
cp PLAYER_TURN
|
||||
jr nz, .player_won_battle
|
||||
@@ -778,8 +778,8 @@ PlayPokemonCard: ; 44db (1:44db)
|
||||
ldh [hTemp_ffa0], a
|
||||
ldh a, [hTempPlayAreaLocation_ff9d]
|
||||
ldh [hTempPlayAreaLocation_ffa1], a
|
||||
call EvolvePokemonCard
|
||||
jr c, .try_evolve_loop ; jump if evolution wasn't successsful somehow
|
||||
call EvolvePokemonCardIfPossible
|
||||
jr c, .try_evolve_loop ; jump if evolution wasn't successful somehow
|
||||
ld a, OPPACTION_EVOLVE_PKMN
|
||||
call SetOppAction_SerialSendDuelData
|
||||
call PrintPlayAreaCardList_EnableLCD
|
||||
@@ -1019,7 +1019,7 @@ HandleEnergyDiscardMenuInput: ; 46b7 (1:46b7)
|
||||
scf
|
||||
ret
|
||||
|
||||
EnergyDiscardCardListParameters:
|
||||
EnergyDiscardCardListParameters: ; 46f3 (1:46f3)
|
||||
db 1, 5 ; cursor x, cursor y
|
||||
db 4 ; item x
|
||||
db 14 ; maximum length, in tiles, occupied by the name and level string of each card in the list
|
||||
@@ -1161,7 +1161,7 @@ OpenMovePage: ; 478b (1:478b)
|
||||
jr z, .loop
|
||||
ret
|
||||
|
||||
AttackMenuParameters:
|
||||
AttackMenuParameters: ; 47e4 (1:47e4)
|
||||
db 1, 13 ; cursor x, cursor y
|
||||
db 2 ; y displacement between items
|
||||
db 2 ; number of items
|
||||
@@ -1438,10 +1438,17 @@ CheckIfActiveCardParalyzedOrAsleep: ; 4918 (1:4918)
|
||||
scf
|
||||
ret
|
||||
|
||||
; display the animation of the turn duelist drawing a card at the beginning of the turn
|
||||
; display the animation of the turn duelist drawing one card at the beginning of the turn
|
||||
; if there isn't any card left in the deck, let the player know with a text message
|
||||
DisplayDrawOneCardScreen: ; 4933 (1:4933)
|
||||
ld a, 1
|
||||
; fallthrough
|
||||
|
||||
; display the animation of the turn duelist drawing number of cards that is in a.
|
||||
; if there isn't any card left in the deck, let the player know with a text message.
|
||||
; input:
|
||||
; - a = number of cards to draw
|
||||
DisplayDrawNCardsScreen: ; 4935 (1:4935)
|
||||
push hl
|
||||
push de
|
||||
push bc
|
||||
@@ -1547,14 +1554,14 @@ PrintDeckAndHandIconsAndNumberOfCards: ; 49ca (1:49ca)
|
||||
; prints, for each duelist, the number of cards in the hand, and the number
|
||||
; of cards in the deck, according to their placement in the draw card(s) screen.
|
||||
; input: wNumCardsBeingDrawn = number of cards being drawn (in order to add
|
||||
; them to the hand cards and substract them from the deck cards).
|
||||
; them to the hand cards and subtract them from the deck cards).
|
||||
PrintNumberOfHandAndDeckCards: ; 49ed (1:49ed)
|
||||
ldh a, [hWhoseTurn]
|
||||
cp PLAYER_TURN
|
||||
jr nz, PrintOpponentNumberOfHandAndDeckCards
|
||||
; fallthrough
|
||||
|
||||
PrintPlayerNumberOfHandAndDeckCards:
|
||||
PrintPlayerNumberOfHandAndDeckCards: ; 49f3 (1:49f3)
|
||||
ld a, [wPlayerNumberOfCardsInHand]
|
||||
ld hl, wNumCardsBeingDrawn
|
||||
add [hl]
|
||||
@@ -1572,7 +1579,7 @@ PrintPlayerNumberOfHandAndDeckCards:
|
||||
lb bc, 10, 10
|
||||
jp WriteTwoDigitNumberInTxSymbolFormat
|
||||
|
||||
PrintOpponentNumberOfHandAndDeckCards:
|
||||
PrintOpponentNumberOfHandAndDeckCards: ; 4a14 (1:4a14)
|
||||
ld a, [wOpponentNumberOfCardsInHand]
|
||||
ld hl, wNumCardsBeingDrawn
|
||||
add [hl]
|
||||
@@ -1590,7 +1597,7 @@ PrintOpponentNumberOfHandAndDeckCards:
|
||||
lb bc, 11, 3
|
||||
jp WriteTwoDigitNumberInTxSymbolFormat
|
||||
|
||||
DeckAndHandIconsTileData:
|
||||
DeckAndHandIconsTileData: ; 4a35 (1:4a35)
|
||||
; x, y, tiles[], 0
|
||||
db 4, 3, SYM_CROSS, 0 ; x for opponent's hand
|
||||
db 10, 3, SYM_CROSS, 0 ; x for opponent's deck
|
||||
@@ -1606,7 +1613,7 @@ DeckAndHandIconsTileData:
|
||||
db 13, 10, $fa, $fb, 0 ; player's hand icon
|
||||
db $ff
|
||||
|
||||
DeckAndHandIconsCGBPalData:
|
||||
DeckAndHandIconsCGBPalData: ; 4a6e (1:4a6e)
|
||||
; x, y, pals[], 0
|
||||
db 8, 2, $02, $02, 0
|
||||
db 8, 3, $02, $02, 0
|
||||
@@ -1941,7 +1948,7 @@ ChooseInitialArenaAndBenchPokemon: ; 4cd5 (1:4cd5)
|
||||
|
||||
; link opponent's turn
|
||||
.exchange_duelvars
|
||||
ldtx hl, TransmitingDataText
|
||||
ldtx hl, TransmittingDataText
|
||||
call DrawWideTextBox_PrintText
|
||||
call ExchangeRNG
|
||||
ld hl, wPlayerDuelVariables
|
||||
@@ -2134,7 +2141,7 @@ DisplayNoBasicPokemonInHandScreen: ; 4e06 (1:4e06)
|
||||
call WaitForWideTextBoxInput
|
||||
ret
|
||||
|
||||
NoBasicPokemonCardListParameters:
|
||||
NoBasicPokemonCardListParameters: ; 4e37 (1:4e37)
|
||||
db 1, 3 ; cursor x, cursor y
|
||||
db 4 ; item x
|
||||
db 14 ; maximum length, in tiles, occupied by the name and level string of each card in the list
|
||||
@@ -2268,11 +2275,11 @@ Func_4e98: ; 4e98 (1:4e98)
|
||||
Func_4f2d: ; 4f2d (1:4f2d)
|
||||
ld a, [wDuelDisplayedScreen]
|
||||
cp SHUFFLE_DECK
|
||||
jr z, .asm_4f3d
|
||||
jr z, .skip_draw_scene
|
||||
call ZeroObjectPositionsAndToggleOAMCopy
|
||||
call EmptyScreen
|
||||
call DrawDuelistPortraitsAndNames
|
||||
.asm_4f3d
|
||||
.skip_draw_scene
|
||||
ld a, SHUFFLE_DECK
|
||||
ld [wDuelDisplayedScreen], a
|
||||
ld a, DUELVARS_NUMBER_OF_CARDS_NOT_IN_DECK
|
||||
@@ -2573,7 +2580,7 @@ DrawDuelHUD: ; 5093 (1:5093)
|
||||
.done
|
||||
ret
|
||||
|
||||
; draws an horizonal line that separates the arena side of each duelist
|
||||
; draws an horizontal line that separates the arena side of each duelist
|
||||
; also colorizes the line on CGB
|
||||
DrawDuelHorizontalSeparator: ; 516f (1:516f)
|
||||
ld hl, DuelHorizontalSeparatorTileData
|
||||
@@ -3061,7 +3068,7 @@ PracticeDuelVerify_Turn7Or8: ; 54b7 (1:54b7)
|
||||
jr nz, ReturnWrongAction
|
||||
ret
|
||||
|
||||
ReturnWrongAction:
|
||||
ReturnWrongAction: ; 54c6 (1:54c6)
|
||||
scf
|
||||
ret
|
||||
|
||||
@@ -3204,7 +3211,7 @@ Func_5591: ; 5591 (1:5591)
|
||||
; Discard Pile card list, including a bottom-right image of the current card.
|
||||
; since this loads the text for the Hand card list screen, SetDiscardPileScreenTexts
|
||||
; is called after this if the screen corresponds to a Discard Pile list.
|
||||
; the dimensions of text box where the card list is printed are 20x13, in order to accomodate
|
||||
; the dimensions of text box where the card list is printed are 20x13, in order to accommodate
|
||||
; another text box below it (wCardListInfoBoxText) as well as the image of the selected card.
|
||||
InitAndDrawCardListScreenLayout: ; 559a (1:559a)
|
||||
xor a
|
||||
@@ -3230,7 +3237,7 @@ InitAndDrawCardListScreenLayout: ; 559a (1:559a)
|
||||
|
||||
; same as InitAndDrawCardListScreenLayout, except that variables like wSelectedDuelSubMenuItem,
|
||||
; wNoItemSelectionMenuKeys, wCardListInfoBoxText, wCardListHeaderText, etc already set by caller.
|
||||
DrawCardListScreenLayout:
|
||||
DrawCardListScreenLayout: ; 55be (1:55be)
|
||||
call ZeroObjectPositionsAndToggleOAMCopy
|
||||
call EmptyScreen
|
||||
call LoadSymbolsFont
|
||||
@@ -3439,7 +3446,7 @@ CardListItemSelectionMenu: ; 56c2 (1:56c2)
|
||||
ret
|
||||
|
||||
ItemSelectionMenuParameters: ; 5708 (1:5708)
|
||||
db 1, 14 ; corsor x, cursor y
|
||||
db 1, 14 ; cursor x, cursor y
|
||||
db 2 ; y displacement between items
|
||||
db 2 ; number of items
|
||||
db SYM_CURSOR_R ; cursor tile number
|
||||
@@ -3481,7 +3488,7 @@ CardListFunction: ; 5719 (1:5719)
|
||||
|
||||
Func_5735: ; 5735 (1:5735)
|
||||
ld hl, wcbd8
|
||||
ld de, Func_574a
|
||||
ld de, PrintSortNumberInCardList
|
||||
ld [hl], e
|
||||
inc hl
|
||||
ld [hl], d
|
||||
@@ -3493,7 +3500,11 @@ Func_5744: ; 5744 (1:5744)
|
||||
ld hl, wcbd8
|
||||
jp CallIndirect
|
||||
|
||||
Func_574a: ; 574a (1:574a)
|
||||
; goes through list in wDuelTempList + 10
|
||||
; and prints the number stored in each entry
|
||||
; beside the corresponding card in screen.
|
||||
; used in lists for reordering cards in the Deck.
|
||||
PrintSortNumberInCardList: ; 574a (1:574a)
|
||||
lb bc, 1, 2
|
||||
ld hl, wDuelTempList + 10
|
||||
.next
|
||||
@@ -3502,7 +3513,7 @@ Func_574a: ; 574a (1:574a)
|
||||
jr z, .done
|
||||
or a ; SYM_SPACE
|
||||
jr z, .space
|
||||
add SYM_0
|
||||
add SYM_0 ; load number symbol
|
||||
.space
|
||||
call WriteByteToBGMap0
|
||||
; move two lines down
|
||||
@@ -3606,7 +3617,10 @@ DisplayCardPageOnLeftOrRightPressed: ; 57cd (1:57cd)
|
||||
call c, DisplayCardPage
|
||||
ret
|
||||
|
||||
Func_57df: ; 57df (1:57df)
|
||||
; draws text box that covers the whole screen
|
||||
; and prints the text ID in hl, then
|
||||
; waits for Player input.
|
||||
DrawWholeScreenTextBox: ; 57df (1:57df)
|
||||
push hl
|
||||
call EmptyScreen
|
||||
lb de, 0, 0
|
||||
@@ -3778,7 +3792,7 @@ GoToFirstOrNextCardPage: ; 58e2 (1:58e2)
|
||||
; stay in this page if it exists, or skip to previous page if it doesn't
|
||||
or a
|
||||
ret nz
|
||||
; non-existant page: skip to next
|
||||
; non-existent page: skip to next
|
||||
jr .advance_page
|
||||
.set_card_page
|
||||
ld [wCardPageNumber], a
|
||||
@@ -3795,7 +3809,7 @@ GoToPreviousCardPage: ; 5911 (1:5911)
|
||||
; stay in this page if it exists, or skip to previous page if it doesn't
|
||||
or a
|
||||
ret nz
|
||||
; non-existant page: skip to previous
|
||||
; non-existent page: skip to previous
|
||||
jr GoToPreviousCardPage
|
||||
.set_card_page
|
||||
ld [wCardPageNumber], a
|
||||
@@ -3814,7 +3828,7 @@ GoToPreviousCardPage: ; 5911 (1:5911)
|
||||
; return with the equivalent to one of these three actions:
|
||||
; stay in card page trying to switch to (nc, nz)
|
||||
; change to card page returned in a if D_LEFT/D_RIGHT pressed, or exit if A_BUTTON/START pressed (c)
|
||||
; non-existant page, so skip to next/previous (nc, z)
|
||||
; non-existent page, so skip to next/previous (nc, z)
|
||||
SwitchCardPage: ; 5930 (1:5930)
|
||||
ld hl, CardPageSwitchPointerTable
|
||||
jp JumpToFunctionInTable
|
||||
@@ -5170,7 +5184,7 @@ Func_6137: ; 6137 (1:6137)
|
||||
call EraseCursor
|
||||
; fallthrough
|
||||
|
||||
Func_615c:
|
||||
Func_615c: ; 615c (1:615c)
|
||||
ld a, [wCurrentDuelMenuItem]
|
||||
ld d, a
|
||||
add a
|
||||
@@ -5194,7 +5208,7 @@ Func_616e: ; 616e (1:616e)
|
||||
call EnableLCD
|
||||
; fallthrough
|
||||
|
||||
Func_6186:
|
||||
Func_6186: ; 6186 (1:6186)
|
||||
ld hl, wCurPlayAreaSlot
|
||||
ldh a, [hTempPlayAreaLocation_ff9d]
|
||||
ld [hli], a
|
||||
@@ -5813,10 +5827,10 @@ TwoByteNumberToTxSymbol_TrimLeadingZeros_Bank1: ; 65d1 (1:65d1)
|
||||
|
||||
.get_digit
|
||||
ld a, SYM_0 - 1
|
||||
.substract_loop
|
||||
.subtract_loop
|
||||
inc a
|
||||
add hl, bc
|
||||
jr c, .substract_loop
|
||||
jr c, .subtract_loop
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, l
|
||||
@@ -6404,7 +6418,7 @@ OppActionTable: ; 695e (1:695e)
|
||||
dw OppAction_TossCoinATimes
|
||||
dw OppAction_6b30
|
||||
dw OppAction_NoAction
|
||||
dw OppAction_6b3e
|
||||
dw OppAction_UseMetronomeAttack
|
||||
dw OppAction_6b15
|
||||
dw OppAction_DrawDuelMainScene
|
||||
|
||||
@@ -6447,7 +6461,7 @@ OppAction_EvolvePokemonCard: ; 69c5 (1:69c5)
|
||||
ldh [hTempCardIndex_ff98], a
|
||||
call LoadCardDataToBuffer1_FromDeckIndex
|
||||
call DrawLargePictureOfCard
|
||||
call EvolvePokemonCard
|
||||
call EvolvePokemonCardIfPossible
|
||||
call PrintPokemonEvolvedIntoPokemon
|
||||
call Func_161e
|
||||
call DrawDuelMainScene
|
||||
@@ -6656,7 +6670,7 @@ OppAction_6b30: ; 6b30 (1:6b30)
|
||||
ldh [hWhoseTurn], a
|
||||
ret
|
||||
|
||||
OppAction_6b3e: ; 6b3e (1:6b3e)
|
||||
OppAction_UseMetronomeAttack: ; 6b3e (1:6b3e)
|
||||
call DrawDuelMainScene
|
||||
ld a, DUELVARS_ARENA_CARD_STATUS
|
||||
call GetTurnDuelistVariable
|
||||
@@ -6682,7 +6696,7 @@ OppAction_6b3e: ; 6b3e (1:6b3e)
|
||||
call Func_16f6
|
||||
pop bc
|
||||
ld a, c
|
||||
ld [wccf0], a
|
||||
ld [wMetronomeEnergyCost], a
|
||||
ret
|
||||
|
||||
OppAction_NoAction: ; 6b7d (1:6b7d)
|
||||
@@ -6945,7 +6959,6 @@ Func_6cfa: ; 6cfa (1:6cfa)
|
||||
pop hl
|
||||
call WaitForWideTextBoxInput
|
||||
ret
|
||||
; 0x6d3f
|
||||
|
||||
Func_6d3f: ; 6d3f (1:6d3f)
|
||||
or a
|
||||
@@ -6974,7 +6987,7 @@ Func_6d3f: ; 6d3f (1:6d3f)
|
||||
ld d, $00
|
||||
ld a, DUELVARS_ARENA_CARD_HP
|
||||
call GetTurnDuelistVariable
|
||||
call SubstractHP
|
||||
call SubtractHP
|
||||
push hl
|
||||
ld a, $8c
|
||||
call Func_6cab
|
||||
@@ -6985,7 +6998,6 @@ Func_6d3f: ; 6d3f (1:6d3f)
|
||||
pop af
|
||||
pop hl
|
||||
ret
|
||||
; 0x6d84
|
||||
|
||||
; given the deck index of a turn holder's card in register a,
|
||||
; and a pointer in hl to the wLoadedCard* buffer where the card data is loaded,
|
||||
@@ -7386,9 +7398,9 @@ Func_6ff7: ; 6ff7 (1:6ff7)
|
||||
ret
|
||||
|
||||
; print one of the "There was no effect from" texts depending
|
||||
; on the value at wNoEffectFromStatus (NO_STATUS or a status condition constant)
|
||||
; on the value at wNoEffectFromWhichStatus (NO_STATUS or a status condition constant)
|
||||
PrintThereWasNoEffectFromStatusText: ; 700a (1:700a)
|
||||
ld a, [wNoEffectFromStatus]
|
||||
ld a, [wNoEffectFromWhichStatus]
|
||||
or a
|
||||
jr nz, .status
|
||||
ld hl, wLoadedMoveName
|
||||
@@ -7490,7 +7502,8 @@ GetCardOneStageBelow: ; 7045 (1:7045)
|
||||
ld hl, wAllStagesIndices ; pointing to basic
|
||||
cp STAGE1
|
||||
jr z, .done
|
||||
cp STAGE2 + 1 ; unnecessary check?
|
||||
; if stage1 was skipped, hl should point to Basic stage card
|
||||
cp STAGE2_WITHOUT_STAGE1
|
||||
jr z, .done
|
||||
inc hl ; pointing to stage 1
|
||||
.done
|
||||
@@ -7548,7 +7561,7 @@ SetAllPlayAreaPokemonCanEvolve: ; 70f6 (1:70f6)
|
||||
ld a, DUELVARS_NUMBER_OF_POKEMON_IN_PLAY_AREA
|
||||
call GetTurnDuelistVariable
|
||||
ld c, a
|
||||
ld l, DUELVARS_ARENA_CARD_FLAGS_C2
|
||||
ld l, DUELVARS_ARENA_CARD_FLAGS
|
||||
.next_pkmn_loop
|
||||
res 5, [hl]
|
||||
set CAN_EVOLVE_THIS_TURN_F, [hl]
|
||||
@@ -7894,12 +7907,154 @@ _TossCoin: ; 71ad (1:71ad)
|
||||
ret
|
||||
; 0x72ff
|
||||
|
||||
INCROM $72ff, $7354
|
||||
Func_72ff: ; 72ff (1:72ff)
|
||||
ldh [hff96], a
|
||||
ld a, [wDuelType]
|
||||
cp DUELTYPE_LINK
|
||||
ret nz
|
||||
ldh a, [hff96]
|
||||
call SerialSendByte
|
||||
call Func_7344
|
||||
ret
|
||||
; 0x7310
|
||||
|
||||
Func_7310: ; 7310 (1:7310)
|
||||
ldh [hff96], a
|
||||
ld a, [wDuelType]
|
||||
cp DUELTYPE_LINK
|
||||
jr z, .asm_7338
|
||||
.asm_7319
|
||||
call DoFrame
|
||||
call CheckAnyAnimationPlaying
|
||||
jr c, .asm_7319
|
||||
ldh a, [hff96]
|
||||
ret
|
||||
ldh [hff96], a
|
||||
ld a, [wDuelType]
|
||||
cp DUELTYPE_LINK
|
||||
jr z, .asm_7338
|
||||
ld a, 30
|
||||
.asm_732f
|
||||
call DoFrame
|
||||
dec a
|
||||
jr nz, .asm_732f
|
||||
ldh a, [hff96]
|
||||
ret
|
||||
.asm_7338
|
||||
call DoFrame
|
||||
call SerialRecvByte
|
||||
jr c, .asm_7338
|
||||
call Func_7344
|
||||
ret
|
||||
; 0x7344
|
||||
|
||||
Func_7344: ; 7344 (1:7344)
|
||||
push af
|
||||
ld a, [wSerialFlags]
|
||||
or a
|
||||
jr nz, .asm_734d
|
||||
pop af
|
||||
ret
|
||||
.asm_734d
|
||||
call Func_3b31
|
||||
call DuelTransmissionError
|
||||
ret
|
||||
; 0x7354
|
||||
|
||||
BuildVersion: ; 7354 (1:7354)
|
||||
db "VER 12/20 09:36", TX_END
|
||||
|
||||
INCROM $7364, $7415
|
||||
Func_7364: ; 7364 (1:7364)
|
||||
xor a
|
||||
ld [wTileMapFill], a
|
||||
call ZeroObjectPositionsAndToggleOAMCopy
|
||||
call EmptyScreen
|
||||
call LoadSymbolsFont
|
||||
lb de, $38, $9f
|
||||
call SetupText
|
||||
call DrawWideTextBox
|
||||
call EnableLCD
|
||||
xor a
|
||||
ld [wOpponentDeckID], a
|
||||
call Func_73d8
|
||||
.asm_7384
|
||||
call DoFrame
|
||||
ldh a, [hDPadHeld]
|
||||
or a
|
||||
jr z, .asm_7384
|
||||
ld b, a
|
||||
and A_BUTTON | START
|
||||
jr nz, .asm_73cd
|
||||
bit B_BUTTON_F, b
|
||||
jr nz, .asm_73cb
|
||||
ld a, [wOpponentDeckID]
|
||||
bit D_RIGHT_F, b
|
||||
jr z, .asm_73a2
|
||||
inc a
|
||||
cp $35
|
||||
jr c, .asm_73a2
|
||||
xor a
|
||||
.asm_73a2
|
||||
bit D_LEFT_F, b
|
||||
jr z, .asm_73ae
|
||||
or a
|
||||
jr nz, .asm_73ad
|
||||
ld a, IMAKUNI_DECK_ID
|
||||
jr .asm_73ae
|
||||
.asm_73ad
|
||||
dec a
|
||||
.asm_73ae
|
||||
bit D_UP_F, b
|
||||
jr z, .asm_73b9
|
||||
add $0a
|
||||
cp $35
|
||||
jr c, .asm_73b9
|
||||
xor a
|
||||
.asm_73b9
|
||||
bit D_DOWN_F, b
|
||||
jr z, .asm_73c3
|
||||
sub $0a
|
||||
jr nc, .asm_73c3
|
||||
ld a, IMAKUNI_DECK_ID
|
||||
.asm_73c3
|
||||
ld [wOpponentDeckID], a
|
||||
call Func_73d8
|
||||
jr .asm_7384
|
||||
.asm_73cb
|
||||
scf
|
||||
ret
|
||||
.asm_73cd
|
||||
ld a, [wOpponentDeckID]
|
||||
ld [wcc19], a
|
||||
call Func_3ae8
|
||||
or a
|
||||
ret
|
||||
; 0x73d8
|
||||
|
||||
Func_73d8: ; 73d8 (1:73d8)
|
||||
ld a, [wOpponentDeckID]
|
||||
ld [wcc19], a
|
||||
call Func_3ae8
|
||||
jr c, .asm_73ec
|
||||
xor a
|
||||
ld [wOpponentPortrait], a
|
||||
ld hl, wOpponentName
|
||||
ld [hli], a
|
||||
ld [hl], a
|
||||
.asm_73ec
|
||||
ld hl, $7408
|
||||
call PlaceTextItems
|
||||
call DrawDuelistPortraitsAndNames
|
||||
ld a, [wOpponentDeckID]
|
||||
lb bc, 5, 16
|
||||
call WriteTwoByteNumberInTxSymbolFormat
|
||||
ld a, [wcc18]
|
||||
lb bc, 15, 10
|
||||
call WriteTwoByteNumberInTxSymbolFormat
|
||||
ret
|
||||
; 0x7408
|
||||
|
||||
INCROM $7408, $7415
|
||||
|
||||
Func_7415: ; 7415 (1:7415)
|
||||
xor a
|
||||
@@ -7965,7 +8120,7 @@ PlayAttackAnimation_DealAttackDamageSimple: ; 7469 (1:7469)
|
||||
call WaitMoveAnimation
|
||||
pop de
|
||||
pop hl
|
||||
call SubstractHP
|
||||
call SubtractHP
|
||||
ld a, [wDuelDisplayedScreen]
|
||||
cp DUEL_MAIN_SCENE
|
||||
ret nz
|
||||
@@ -8042,7 +8197,6 @@ PlayMoveAnimation: ; 7494 (1:7494)
|
||||
Func_7571: ; 7571 (1:7571)
|
||||
farcall Func_19c20
|
||||
ret
|
||||
; 0x7576
|
||||
|
||||
Func_7576: ; 7576 (1:7576)
|
||||
farcall Func_1991f
|
||||
@@ -8054,7 +8208,6 @@ Func_7576: ; 7576 (1:7576)
|
||||
Func_758f: ; 758f (1:758f)
|
||||
farcall Func_1a4cf
|
||||
ret
|
||||
; 0x7594
|
||||
|
||||
Func_7594: ; 7594 (1:7594)
|
||||
farcall Func_1a61f
|
||||
|
||||
@@ -105,7 +105,7 @@ OpenYourOrOppPlayAreaScreen_TurnHolderPlayArea: ; 809e (2:409e)
|
||||
ldh [hWhoseTurn], a
|
||||
ret
|
||||
|
||||
OpenYourOrOppPlayAreaScreen_NonTurnHolderPlayArea:
|
||||
OpenYourOrOppPlayAreaScreen_NonTurnHolderPlayArea: ; 80a8 (2:40a8)
|
||||
ldh a, [hWhoseTurn]
|
||||
push af
|
||||
bank1call OpenNonTurnHolderPlayAreaScreen
|
||||
@@ -113,7 +113,7 @@ OpenYourOrOppPlayAreaScreen_NonTurnHolderPlayArea:
|
||||
ldh [hWhoseTurn], a
|
||||
ret
|
||||
|
||||
OpenYourOrOppPlayAreaScreen_TurnHolderHand:
|
||||
OpenYourOrOppPlayAreaScreen_TurnHolderHand: ; 80b2 (2:40b2)
|
||||
ldh a, [hWhoseTurn]
|
||||
push af
|
||||
bank1call OpenTurnHolderHandScreen_Simple
|
||||
@@ -121,7 +121,7 @@ OpenYourOrOppPlayAreaScreen_TurnHolderHand:
|
||||
ldh [hWhoseTurn], a
|
||||
ret
|
||||
|
||||
OpenYourOrOppPlayAreaScreen_NonTurnHolderHand:
|
||||
OpenYourOrOppPlayAreaScreen_NonTurnHolderHand: ; 80bc (2:40bc)
|
||||
ldh a, [hWhoseTurn]
|
||||
push af
|
||||
bank1call OpenNonTurnHolderHandScreen_Simple
|
||||
@@ -129,7 +129,7 @@ OpenYourOrOppPlayAreaScreen_NonTurnHolderHand:
|
||||
ldh [hWhoseTurn], a
|
||||
ret
|
||||
|
||||
OpenYourOrOppPlayAreaScreen_TurnHolderDiscardPile:
|
||||
OpenYourOrOppPlayAreaScreen_TurnHolderDiscardPile: ; 80c6 (2:40c6)
|
||||
ldh a, [hWhoseTurn]
|
||||
push af
|
||||
bank1call OpenTurnHolderDiscardPileScreen
|
||||
@@ -137,7 +137,7 @@ OpenYourOrOppPlayAreaScreen_TurnHolderDiscardPile:
|
||||
ldh [hWhoseTurn], a
|
||||
ret
|
||||
|
||||
OpenYourOrOppPlayAreaScreen_NonTurnHolderDiscardPile:
|
||||
OpenYourOrOppPlayAreaScreen_NonTurnHolderDiscardPile: ; 80d0 (2:40d0)
|
||||
ldh a, [hWhoseTurn]
|
||||
push af
|
||||
bank1call OpenNonTurnHolderDiscardPileScreen
|
||||
@@ -191,7 +191,6 @@ DuelCheckMenu_OppPlayArea: ; 80da (2:40da)
|
||||
call DrawYourOrOppPlayArea_DrawArrows
|
||||
call DrawWideTextBox
|
||||
|
||||
|
||||
; reset cursor blink
|
||||
xor a
|
||||
ld [wCheckMenuCursorBlinkCounter], a
|
||||
@@ -234,25 +233,25 @@ DuelCheckMenu_OppPlayArea: ; 80da (2:40da)
|
||||
dw OpenYourOrOppPlayAreaScreen_NonTurnHolderHand
|
||||
dw OpenYourOrOppPlayAreaScreen_NonTurnHolderDiscardPile
|
||||
|
||||
CheckMenuData: ; (2:4158)
|
||||
CheckMenuData: ; 8158 (2:4158)
|
||||
textitem 2, 14, InPlayAreaText
|
||||
textitem 2, 16, YourPlayAreaText
|
||||
textitem 12, 14, GlossaryText
|
||||
textitem 12, 16, OppPlayAreaText
|
||||
db $ff
|
||||
|
||||
YourPlayAreaMenuData: ; (2:4169)
|
||||
YourPlayAreaMenuData: ; 8169 (2:4169)
|
||||
textitem 2, 14, YourPokemonText
|
||||
textitem 12, 14, YourHandText
|
||||
textitem 2, 16, YourDiscardPileText2
|
||||
db $ff
|
||||
|
||||
OppPlayAreaMenuData: ; (2:4176)
|
||||
OppPlayAreaMenuData: ; 8176 (2:4176)
|
||||
textitem 2, 14, OpponentsPokemonText
|
||||
textitem 2, 16, OpponentsDiscardPileText2
|
||||
db $ff
|
||||
|
||||
OppPlayAreaMenuData_WithClairvoyance: ; (2:4176)
|
||||
OppPlayAreaMenuData_WithClairvoyance: ; 8176 (2:4176)
|
||||
textitem 2, 14, OpponentsPokemonText
|
||||
textitem 12, 14, OpponentsHandText
|
||||
textitem 2, 16, OpponentsDiscardPileText2
|
||||
@@ -1288,7 +1287,7 @@ HandleCheckMenuInput_YourOrOppPlayArea: ; 86ac (2:46ac)
|
||||
call EraseCheckMenuCursor_YourOrOppPlayArea
|
||||
pop de
|
||||
|
||||
;update x and y cursor positions
|
||||
; update x and y cursor positions
|
||||
ld a, d
|
||||
ld [wCheckMenuCursorXPosition], a
|
||||
ld a, e
|
||||
@@ -1513,7 +1512,7 @@ Func_8819: ; 8819 (2:4819)
|
||||
call GetTurnDuelistVariable
|
||||
jr Func_8855
|
||||
|
||||
Func_883c:
|
||||
Func_883c: ; 883c (2:483c)
|
||||
call CreateHandCardList
|
||||
ret c
|
||||
ld hl, wDuelTempList
|
||||
@@ -1521,7 +1520,7 @@ Func_883c:
|
||||
ld a, [hl]
|
||||
jr Func_8855
|
||||
|
||||
Func_8849:
|
||||
Func_8849: ; 8849 (2:4849)
|
||||
call CreateDeckCardList
|
||||
ret c
|
||||
ld a, %01111111
|
||||
@@ -1534,7 +1533,7 @@ Func_8849:
|
||||
; output:
|
||||
; a = ce5c
|
||||
; with upper bit set if turn was swapped
|
||||
Func_8855:
|
||||
Func_8855: ; 8855 (2:4855)
|
||||
ld b, a
|
||||
ld a, [$ce5c]
|
||||
or a
|
||||
@@ -2308,7 +2307,7 @@ HandleCheckMenuInput: ; 9065 (2:5065)
|
||||
call EraseCheckMenuCursor
|
||||
pop de
|
||||
|
||||
;update x and y cursor positions
|
||||
; update x and y cursor positions
|
||||
ld a, d
|
||||
ld [wCheckMenuCursorXPosition], a
|
||||
ld a, e
|
||||
@@ -2360,7 +2359,7 @@ EraseCheckMenuCursor: ; 90d8 (2:50d8)
|
||||
; draws in the cursor position
|
||||
; input:
|
||||
; a = tile byte to draw
|
||||
DrawCheckMenuCursor:
|
||||
DrawCheckMenuCursor: ; 90da (2:50da)
|
||||
ld e, a
|
||||
ld a, 10
|
||||
ld l, a
|
||||
|
||||
@@ -2712,27 +2712,61 @@ Func_d244: ; d244 (3:5244)
|
||||
farcall Func_80ba4
|
||||
jp IncreaseScriptPointerBy2
|
||||
|
||||
Func_d24c: ; d24c (3:524c)
|
||||
ld hl, $525e
|
||||
ScriptCommand_ChooseDeckToDuelAgainstMultichoice: ; d24c (3:524c)
|
||||
ld hl, .multichoice_menu_args
|
||||
xor a
|
||||
call Func_d28c
|
||||
ld a, [wd695]
|
||||
call ShowMultichoiceTextbox
|
||||
ld a, [wMultichoiceTextboxResult_ChooseDeckToDuelAgainst]
|
||||
ld c, a
|
||||
set_flag_value EVENT_FLAG_76
|
||||
jp IncreaseScriptPointerBy1
|
||||
|
||||
INCROM $d25e, $d271
|
||||
.multichoice_menu_args ; d25e
|
||||
dw $0000 ; NPC title for textbox under menu
|
||||
tx Text03f9 ; text for textbox under menu
|
||||
dw MultichoiceTextbox_ConfigTable_ChooseDeckToDuelAgainst ; location of table configuration in bank 4
|
||||
db $03 ; the value to return when b is pressed
|
||||
dw wMultichoiceTextboxResult_ChooseDeckToDuelAgainst ; ram location to return result into
|
||||
dw .text_entries ; location of table containing text entries
|
||||
|
||||
Func_d271: ; d271 (3:5271)
|
||||
ld hl, $527b
|
||||
.text_entries ; d269
|
||||
tx Text03f6
|
||||
tx Text03f7
|
||||
tx Text03f8
|
||||
|
||||
INCROM $d26f, $d271
|
||||
|
||||
ScriptCommand_ChooseStarterDeckMultichoice: ; d271 (3:5271)
|
||||
ld hl, .multichoice_menu_args
|
||||
xor a
|
||||
call Func_d28c
|
||||
call ShowMultichoiceTextbox
|
||||
jp IncreaseScriptPointerBy1
|
||||
; 0xd27b
|
||||
|
||||
INCROM $d27b, $d28c
|
||||
.multichoice_menu_args ; d27b
|
||||
dw $0000 ; NPC title for textbox under menu
|
||||
tx Text03fd ; text for textbox under menu
|
||||
dw MultichoiceTextbox_ConfigTable_ChooseDeckStarterDeck ; location of table configuration in bank 4
|
||||
db $00 ; the value to return when b is pressed
|
||||
dw $d693 ; ram location to return result into
|
||||
dw .text_entries ; location of table containing text entries
|
||||
|
||||
Func_d28c: ; d28c (3:528c)
|
||||
.text_entries
|
||||
tx Text03fa
|
||||
tx Text03fb
|
||||
tx Text03fc
|
||||
|
||||
|
||||
; displays a textbox with multiple choices and a cursor.
|
||||
; takes as an argument in h1 a pointer to a table
|
||||
; dw text id for NPC title for textbox under menu
|
||||
; dw text id for textbox under menu
|
||||
; dw location of table configuration in bank 4
|
||||
; db the value to return when b is pressed
|
||||
; dw ram location to return result into
|
||||
; dw location of table containing text entries (optional)
|
||||
|
||||
ShowMultichoiceTextbox: ; d28c (3:528c)
|
||||
ld [wd416], a
|
||||
push hl
|
||||
call Func_c241
|
||||
@@ -2808,31 +2842,42 @@ Func_d28c: ; d28c (3:528c)
|
||||
.asm_d2f5
|
||||
ret
|
||||
|
||||
Func_d2f6: ; d2f6 (3:52f6)
|
||||
ld hl, $530c
|
||||
ScriptCommand_ShowSamNormalMultichoice: ; d2f6 (3:52f6)
|
||||
ld hl, .multichoice_menu_args
|
||||
xor a
|
||||
call Func_d28c
|
||||
ld a, [wd694]
|
||||
call ShowMultichoiceTextbox
|
||||
ld a, [wMultichoiceTextboxResult_Sam]
|
||||
ld c, a
|
||||
set_flag_value EVENT_FLAG_75
|
||||
xor a
|
||||
ld [wd694], a
|
||||
ld [wMultichoiceTextboxResult_Sam], a
|
||||
jp IncreaseScriptPointerBy1
|
||||
; 0xd30c
|
||||
|
||||
INCROM $d30c, $d317
|
||||
.multichoice_menu_args ; d30c
|
||||
tx SamNPCName ; NPC title for textbox under menu
|
||||
tx Text03fe ; text for textbox under menu
|
||||
dw SamNormalMultichoice_ConfigurationTable ; location of table configuration in bank 4
|
||||
db $03 ; the value to return when b is pressed
|
||||
dw wMultichoiceTextboxResult_Sam ; ram location to return result into
|
||||
dw $0000 ; location of table containing text entries
|
||||
|
||||
Func_d317: ; d317 (3:5317)
|
||||
ld hl, $532b
|
||||
ld a, [wd694]
|
||||
call Func_d28c
|
||||
ld a, [wd694]
|
||||
ScriptCommand_ShowSamTutorialMultichoice: ; d317 (3:5317)
|
||||
ld hl, .multichoice_menu_args
|
||||
ld a, [wMultichoiceTextboxResult_Sam]
|
||||
call ShowMultichoiceTextbox
|
||||
ld a, [wMultichoiceTextboxResult_Sam]
|
||||
ld c, a
|
||||
set_flag_value EVENT_FLAG_75
|
||||
jp IncreaseScriptPointerBy1
|
||||
|
||||
Unknown_d32b: ; d32b (3:532b)
|
||||
INCROM $d32b, $d336
|
||||
.multichoice_menu_args: ; d32b (3:532b)
|
||||
dw $0000 ; NPC title for textbox under menu
|
||||
dw $0000 ; text for textbox under menu
|
||||
dw SamTutorialMultichoice_ConfigurationTable ; location of table configuration in bank 4
|
||||
db $07 ; the value to return when b is pressed
|
||||
dw wMultichoiceTextboxResult_Sam ; ram location to return result into
|
||||
dw $0000
|
||||
|
||||
ScriptCommand_OpenDeckMachine: ; d336 (3:5336)
|
||||
push bc
|
||||
@@ -3278,7 +3323,7 @@ Script_d794: ; d794 (3:5794)
|
||||
|
||||
.ows_d7bc
|
||||
close_text_box
|
||||
run_command Func_d317
|
||||
show_sam_tutorial_multichoice
|
||||
close_text_box
|
||||
jump_if_flag_equal EVENT_FLAG_75, $07, .ows_d80c
|
||||
jump_if_flag_equal EVENT_FLAG_75, $01, .ows_d7e8
|
||||
@@ -3357,10 +3402,28 @@ AfterTutorialBattleScript: ; d834 (3:5834)
|
||||
tx Text05f1
|
||||
close_text_box
|
||||
print_text_string Text05f2
|
||||
run_command Func_d271
|
||||
; 0xd860
|
||||
|
||||
INCROM $d860, $d880
|
||||
.ows_d85f
|
||||
choose_starter_deck_multichoice
|
||||
close_text_box
|
||||
ask_question_jump Text05f3, .ows_d869
|
||||
script_jump .ows_d85f
|
||||
.ows_d869
|
||||
print_text_string Text05f4
|
||||
close_text_box
|
||||
pause_song
|
||||
run_command Func_d40f
|
||||
try_give_medal_pc_packs
|
||||
run_command Func_ccdc
|
||||
tx Text05f5
|
||||
wait_for_song_to_finish
|
||||
resume_song
|
||||
close_text_box
|
||||
script_set_flag_value EVENT_FLAG_3E, $03
|
||||
run_command Func_d3d4
|
||||
print_text_string Text05f6
|
||||
run_command Func_d396
|
||||
db $00
|
||||
quit_script_fully
|
||||
|
||||
NPCMovement_d880: ; d880 (3:5880)
|
||||
db EAST
|
||||
|
||||
@@ -13,8 +13,8 @@ Func_10000: ; 10000 (4:4000)
|
||||
bit LCDC_ENABLE_F, a
|
||||
jr nz, .asm_10025
|
||||
xor a
|
||||
ld [rSCX], a
|
||||
ld [rSCY], a
|
||||
ldh [rSCX], a
|
||||
ldh [rSCY], a
|
||||
|
||||
.asm_10025
|
||||
call Func_1288c
|
||||
@@ -1023,9 +1023,9 @@ OverworldScriptTable: ; 1217b (4:617b)
|
||||
dw Func_d1b3
|
||||
dw ScriptCommand_QuitScriptFully
|
||||
dw Func_d244
|
||||
dw Func_d24c
|
||||
dw ScriptCommand_ChooseDeckToDuelAgainstMultichoice
|
||||
dw ScriptCommand_OpenDeckMachine
|
||||
dw Func_d271
|
||||
dw ScriptCommand_ChooseStarterDeckMultichoice
|
||||
dw ScriptCommand_EnterMap
|
||||
dw ScriptCommand_MoveArbitraryNPC
|
||||
dw Func_d209
|
||||
@@ -1048,8 +1048,8 @@ OverworldScriptTable: ; 1217b (4:617b)
|
||||
dw ScriptCommand_WaitForSongToFinish
|
||||
dw Func_d435
|
||||
dw ScriptCommand_AskQuestionJumpDefaultYes
|
||||
dw Func_d2f6
|
||||
dw Func_d317
|
||||
dw ScriptCommand_ShowSamNormalMultichoice
|
||||
dw ScriptCommand_ShowSamTutorialMultichoice
|
||||
dw Func_d43d
|
||||
dw ScriptCommand_EndScriptLoop2
|
||||
dw ScriptCommand_EndScriptLoop3
|
||||
@@ -1073,7 +1073,68 @@ OverworldScriptTable: ; 1217b (4:617b)
|
||||
dw ScriptCommand_EndScriptLoop9
|
||||
dw ScriptCommand_EndScriptLoop10
|
||||
|
||||
INCROM $1224b, $1229f
|
||||
|
||||
MultichoiceTextbox_ConfigTable_ChooseDeckToDuelAgainst: ;1224b
|
||||
db $04, $00 ; x, y to start drawing box
|
||||
db $10, $08 ; width, height of box
|
||||
db $06, $02 ; x, y coordinate to start printing next text
|
||||
tx Text03f6 ; text id to print next
|
||||
db $06, $04 ; x, y coordinate to start printing next text
|
||||
tx Text03f7 ; text id to print next
|
||||
db $06, $06 ; x, y coordinate to start printing next text
|
||||
tx Text03f8 ; text id to print next
|
||||
db $ff ; marker byte -- end text entries
|
||||
db $05, $02 ; cursor starting x, y
|
||||
db $02 ; number of tiles the cursor moves per toggle
|
||||
db $03 ; cursor max index
|
||||
db $0f ; cursor image
|
||||
|
||||
db $00, $00, $00 ; marker bytes -- end of config table
|
||||
|
||||
MultichoiceTextbox_ConfigTable_ChooseDeckStarterDeck: ;12264
|
||||
db $04, $00 ; x, y to start drawing box
|
||||
db $10, $08 ; width, height of box
|
||||
db $06, $02 ; x, y coordinate to start printing next text
|
||||
tx Text03fa ; text id to print next
|
||||
db $06, $04 ; x, y coordinate to start printing next text
|
||||
tx Text03fb ; text id to print next
|
||||
db $06, $06 ; x, y coordinate to start printing next text
|
||||
tx Text03fc ; text id to print next
|
||||
db $ff ; marker byte -- end text entries
|
||||
db $05, $02 ; cursor starting x, y
|
||||
db $02 ; number of tiles the cursor moves per toggle
|
||||
db $03 ; cursor max index
|
||||
db $0f ; cursor image
|
||||
|
||||
db $00, $00, $00 ; marker bytes -- end of config table
|
||||
|
||||
SamNormalMultichoice_ConfigurationTable: ;1227d
|
||||
db $0A, $00 ; x, y to start drawing box
|
||||
db $0A, $0A ; width, height of box
|
||||
db $0C, $02 ; x, y coordinate to start printing next text
|
||||
tx Text03ff ; text id to print next
|
||||
db $ff ; marker byte -- end text entries
|
||||
db $0b, $02 ; cursor starting x, y
|
||||
db $02 ; number of tiles the cursor moves per toggle
|
||||
db $04 ; cursor max index
|
||||
db $0f ; cursor image
|
||||
|
||||
db $00, $00, $00 ; marker bytes -- end of config table
|
||||
|
||||
SamTutorialMultichoice_ConfigurationTable: ;1228e
|
||||
db $06, $00 ; x, y to start drawing box
|
||||
db $0E, $12 ; width, height of box
|
||||
db $08, $02 ; x coordinate to start printing text
|
||||
tx Text0400 ; text id to print next
|
||||
db $ff ; marker byte -- end text entries
|
||||
db $07, $02 ; cursor starting x, y
|
||||
db $02 ; number of tiles the cursor moves per toggle
|
||||
db $08 ; cursor max index
|
||||
db $0f ; cursor image
|
||||
|
||||
db $00, $00, $00 ; marker bytes -- end of config table
|
||||
|
||||
|
||||
|
||||
Unknown_1229f: ; 1229f (4:629f)
|
||||
INCROM $1229f, $126d1
|
||||
@@ -1103,7 +1164,7 @@ _GameLoop: ; 126d1 (4:66d1)
|
||||
scf
|
||||
ret
|
||||
|
||||
MainMenuFunctionTable:
|
||||
MainMenuFunctionTable: ; 126fc (4:66fc)
|
||||
dw MainMenu_CardPop
|
||||
dw MainMenu_ContinueFromDiary
|
||||
dw MainMenu_NewGame
|
||||
@@ -1230,7 +1291,7 @@ Unknown_128fb: ; 128fb
|
||||
Func_1296e: ; 1296e (4:696e)
|
||||
INCROM $1296e, $1299f
|
||||
|
||||
; creates a new entry in SpriteAnimBuffer, Alse loads the sprite if need be
|
||||
; creates a new entry in SpriteAnimBuffer, else loads the sprite if need be
|
||||
CreateSpriteAndAnimBufferEntry: ; 1299f (4:699f)
|
||||
push af
|
||||
ld a, [wd5d7]
|
||||
@@ -1489,7 +1550,7 @@ HandleAnimationFrame: ; 12b13 (4:6b13)
|
||||
call GetAnimFramePointerFromOffset
|
||||
inc de
|
||||
ld a, [de]
|
||||
call SetAimationCounterAndLoop
|
||||
call SetAnimationCounterAndLoop
|
||||
jr c, .tryHandlingFrame
|
||||
inc de
|
||||
ld bc, SPRITE_ANIM_COORD_X
|
||||
@@ -1547,7 +1608,7 @@ GetAnimFramePointerFromOffset: ; 12b6a (4:6b6a)
|
||||
|
||||
; Sets the animation counter for the current sprite. If the value is zero, loop the animation
|
||||
; a - new animation counter
|
||||
SetAimationCounterAndLoop: ; 12b89 (4:6b89)
|
||||
SetAnimationCounterAndLoop: ; 12b89 (4:6b89)
|
||||
push hl
|
||||
push bc
|
||||
ld bc, SPRITE_ANIM_COUNTER
|
||||
|
||||
@@ -190,7 +190,7 @@ AITryUseAttack: ; 14145 (5:4145)
|
||||
|
||||
call AISelectSpecialAttackParameters
|
||||
jr c, .use_attack
|
||||
ld a, OPPACTION_BEGIN_ATTACK
|
||||
ld a, EFFECTCMDTYPE_AI_SELECTION
|
||||
call TryExecuteEffectCommandFunction
|
||||
|
||||
.use_attack
|
||||
@@ -204,7 +204,7 @@ AITryUseAttack: ; 14145 (5:4145)
|
||||
bank1call AIMakeDecision
|
||||
ret c
|
||||
|
||||
ld a, OPPACTION_ATTACK_ANIM_AND_DAMAGE
|
||||
ld a, EFFECTCMDTYPE_AI_SWITCH_DEFENDING_PKMN
|
||||
call TryExecuteEffectCommandFunction
|
||||
ld a, OPPACTION_ATTACK_ANIM_AND_DAMAGE
|
||||
bank1call AIMakeDecision
|
||||
@@ -866,11 +866,9 @@ _CalculateDamage_VersusDefendingPokemon: ; 14462 (5:4462)
|
||||
ldh a, [hTempPlayAreaLocation_ff9d]
|
||||
or a
|
||||
call z, HandleDoubleDamageSubstatus
|
||||
; skips the weak/res checks if bit 7 is set
|
||||
; I guess to avoid overflowing?
|
||||
; should probably just have skipped weakness test instead?
|
||||
bit 7, d
|
||||
res 7, d
|
||||
; skips the weak/res checks if unaffected.
|
||||
bit UNAFFECTED_BY_WEAKNESS_RESISTANCE_F, d
|
||||
res UNAFFECTED_BY_WEAKNESS_RESISTANCE_F, d
|
||||
jr nz, .not_resistant
|
||||
|
||||
; handle weakness
|
||||
@@ -1083,8 +1081,8 @@ CalculateDamage_FromDefendingPokemon: ; 1458c (5:458c)
|
||||
|
||||
call SwapTurn
|
||||
call HandleDoubleDamageSubstatus
|
||||
bit 7, d
|
||||
res 7, d
|
||||
bit UNAFFECTED_BY_WEAKNESS_RESISTANCE_F, d
|
||||
res UNAFFECTED_BY_WEAKNESS_RESISTANCE_F, d
|
||||
jr nz, .not_resistant
|
||||
|
||||
; handle weakness
|
||||
@@ -1225,7 +1223,7 @@ LookForCardIDInHandList_Bank5: ; 155d2 (5:55d2)
|
||||
; input:
|
||||
; a = card ID
|
||||
; b = PLAY_AREA_* to start with
|
||||
; ouput:
|
||||
; output:
|
||||
; a = PLAY_AREA_* of found card
|
||||
; carry set if found
|
||||
LookForCardIDInPlayArea_Bank5: ; 155ef (5:55ef)
|
||||
@@ -1339,7 +1337,7 @@ InitAITurnVars: ; 15649 (5:5649)
|
||||
; check if flag was already set, if so,
|
||||
; reset wAIBarrierFlagCounter to $80.
|
||||
ld a, [wAIBarrierFlagCounter]
|
||||
bit 7, a
|
||||
bit AI_MEWTWO_MILL_F, a
|
||||
jr nz, .set_flag
|
||||
|
||||
; if not, increase it by 1 and check if it exceeds 2.
|
||||
@@ -1369,14 +1367,14 @@ InitAITurnVars: ; 15649 (5:5649)
|
||||
jr .done
|
||||
|
||||
.set_flag
|
||||
ld a, AI_FLAG_MEWTWO_MILL + 0
|
||||
ld a, AI_MEWTWO_MILL
|
||||
ld [wAIBarrierFlagCounter], a
|
||||
jr .done
|
||||
|
||||
.check_flag
|
||||
; increase counter by 1 if flag is set
|
||||
ld a, [wAIBarrierFlagCounter]
|
||||
bit 7, a
|
||||
bit AI_MEWTWO_MILL_F, a
|
||||
jr z, .reset_2
|
||||
inc a
|
||||
ld [wAIBarrierFlagCounter], a
|
||||
@@ -3122,7 +3120,7 @@ AIDecideEvolution: ; 15f4c (5:5f4c)
|
||||
.check_damage
|
||||
ld a, [wTempAI]
|
||||
ld e, a
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
or a
|
||||
jr z, .check_mysterious_fossil
|
||||
srl a
|
||||
@@ -3294,7 +3292,7 @@ Func_16120: ; 16120 (5:6120)
|
||||
dec b
|
||||
ld e, b
|
||||
push bc
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
pop bc
|
||||
add c
|
||||
ld c, a
|
||||
@@ -3324,7 +3322,7 @@ Func_16120: ; 16120 (5:6120)
|
||||
; check if there's a Muk in any duelist's Play Area
|
||||
.is_active
|
||||
ld e, 0
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
cp 50
|
||||
jr c, .lower_score
|
||||
ld e, PLAY_AREA_ARENA
|
||||
@@ -3974,7 +3972,7 @@ AIProcessButDontPlayEnergy_SkipEvolutionAndArena: ; 164ba (5:64ba)
|
||||
jr AIProcessEnergyCards
|
||||
|
||||
; copies wTempPlayAreaAIScore to wPlayAreaAIScore
|
||||
; and loads wAIscore with value in wTempAIScore.
|
||||
; and loads wAIScore with value in wTempAIScore.
|
||||
; identical to RetrievePlayAreaAIScoreFromBackup2.
|
||||
RetrievePlayAreaAIScoreFromBackup1: ; 164d3 (5:64d3)
|
||||
push af
|
||||
@@ -4089,7 +4087,7 @@ AIProcessEnergyCards: ; 164fc (5:64fc)
|
||||
|
||||
; arena
|
||||
ld a, [wAIBarrierFlagCounter]
|
||||
bit 7, a
|
||||
bit AI_MEWTWO_MILL_F, a
|
||||
jr z, .add_to_score
|
||||
|
||||
; subtract from score instead
|
||||
@@ -4613,7 +4611,7 @@ CheckIfEvolutionNeedsEnergyForMove: ; 16805 (5:6805)
|
||||
; returns in e the card ID of the energy required for
|
||||
; the Discard/Energy Boost attack loaded in wSelectedAttack.
|
||||
; if it's Zapdos2's Thunderbolt attack, return no carry.
|
||||
; if it's Charizard's Fire Spin or Exeggutor's Big Eggplosion
|
||||
; if it's Charizard's Fire Spin or Exeggutor's Big Eggsplosion
|
||||
; attack, don't return energy card ID, but set carry.
|
||||
; output:
|
||||
; b = 1 if needs color energy, 0 otherwise;
|
||||
@@ -4881,7 +4879,7 @@ CheckSpecificDecksToAttachDoubleColorless: ; 1696e (5:696e)
|
||||
push de
|
||||
push hl
|
||||
|
||||
; check if AI is playing any of the aplicable decks.
|
||||
; check if AI is playing any of the applicable decks.
|
||||
ld a, [wOpponentDeckID]
|
||||
cp LEGENDARY_DRAGONITE_DECK_ID
|
||||
jr z, .legendary_dragonite_deck
|
||||
@@ -4976,7 +4974,7 @@ AIProcessButDontUseAttack: ; 169ca (5:69ca)
|
||||
jr AIProcessAttacks
|
||||
|
||||
; copies wTempPlayAreaAIScore to wPlayAreaAIScore
|
||||
; and loads wAIscore with value in wTempAIScore.
|
||||
; and loads wAIScore with value in wTempAIScore.
|
||||
; identical to RetrievePlayAreaAIScoreFromBackup1.
|
||||
RetrievePlayAreaAIScoreFromBackup2: ; 169e3 (5:69e3)
|
||||
push af
|
||||
@@ -5019,7 +5017,7 @@ AIProcessAttacks: ; 169fc (5:69fc)
|
||||
; if Player is running Mewtwo1 mill deck,
|
||||
; skip attack if Barrier counter is 0.
|
||||
ld a, [wAIBarrierFlagCounter]
|
||||
cp AI_FLAG_MEWTWO_MILL + 0
|
||||
cp AI_MEWTWO_MILL + 0
|
||||
jp z, .dont_attack
|
||||
|
||||
; determine AI score of both attacks.
|
||||
@@ -5308,7 +5306,7 @@ GetAIScoreOfAttack: ; 16a86 (5:6a86)
|
||||
cp 31
|
||||
jr nc, .high_recoil_generic_checks
|
||||
ld e, PLAY_AREA_ARENA
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
sla a
|
||||
cp c
|
||||
jr c, .high_recoil_generic_checks
|
||||
@@ -5544,7 +5542,7 @@ GetAIScoreOfAttack: ; 16a86 (5:6a86)
|
||||
.tally_heal_score
|
||||
push af
|
||||
ld e, PLAY_AREA_ARENA
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
call CalculateByteTensDigit
|
||||
pop bc
|
||||
cp b ; wLoadedMoveEffectParam
|
||||
@@ -5738,7 +5736,7 @@ HandleSpecialAIMoves: ; 16dcd (5:6dcd)
|
||||
|
||||
; if any of card ID in a is found in deck,
|
||||
; return a score of $80 + slots available in bench.
|
||||
HandleCallForFamily:
|
||||
HandleCallForFamily: ; 16e3e (5:6e3e)
|
||||
ld a, CARD_LOCATION_DECK
|
||||
call CheckIfAnyCardIDinLocation
|
||||
jr nc, HandleSpecialAIMoves.zero
|
||||
@@ -5754,7 +5752,7 @@ HandleCallForFamily:
|
||||
|
||||
; if any of NidoranM or NidoranF is found in deck,
|
||||
; return a score of $80 + slots available in bench.
|
||||
HandleNidoranFCallForFamily:
|
||||
HandleNidoranFCallForFamily: ; 16e55 (5:6e55)
|
||||
ld e, NIDORANM
|
||||
ld a, CARD_LOCATION_DECK
|
||||
call CheckIfAnyCardIDinLocation
|
||||
@@ -5777,7 +5775,7 @@ HandleNidoranFCallForFamily:
|
||||
; checks for certain card IDs of Fighting color in deck.
|
||||
; if any of them are found, return a score of
|
||||
; $80 + slots available in bench.
|
||||
HandleMarowak1CallForFriend:
|
||||
HandleMarowak1CallForFriend: ; 16e77 (5:6e77)
|
||||
ld e, GEODUDE
|
||||
ld a, CARD_LOCATION_DECK
|
||||
call CheckIfAnyCardIDinLocation
|
||||
@@ -6191,7 +6189,7 @@ LookForCardThatIsKnockedOutOnDevolution: ; 17080 (5:7080)
|
||||
ld [wTempAI], a
|
||||
ld e, c
|
||||
push bc
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
pop bc
|
||||
ld e, a
|
||||
ld a, [wTempAI]
|
||||
@@ -6414,7 +6412,7 @@ AISelectSpecialAttackParameters: ; 17161 (5:7161)
|
||||
ld a, CARD_LOCATION_DISCARD_PILE
|
||||
call CheckIfAnyCardIDinLocation
|
||||
ldh [hTemp_ffa0], a
|
||||
farcall CreateEnergyCardListFromOpponentDiscardPile
|
||||
farcall CreateEnergyCardListFromDiscardPile_AllEnergy
|
||||
|
||||
; find any energy card different from
|
||||
; the one found by CheckIfAnyCardIDinLocation.
|
||||
@@ -6632,7 +6630,7 @@ CheckCardEvolutionInHandOrDeck: ; 17274 (5:7274)
|
||||
scf
|
||||
ret
|
||||
|
||||
; sets up the inital hand of boss deck.
|
||||
; sets up the initial hand of boss deck.
|
||||
; always draws at least 2 Basic Pokemon cards and 2 Energy cards.
|
||||
; also sets up so that the next cards to be drawn have
|
||||
; some minimum number of Basic Pokemon and Energy cards.
|
||||
@@ -7223,13 +7221,13 @@ Func_174f2: ; 174f2 (5:74f2)
|
||||
jp .loop_play_area
|
||||
|
||||
; loads wcdea + play area location in e
|
||||
; with nenergy * 2 + $80 - floor(dam / 10)
|
||||
; with energy * 2 + $80 - floor(dam / 10)
|
||||
; loads wcdfa + play area location in e
|
||||
; with $01
|
||||
Func_17583: ; 17583 (5:7583)
|
||||
push hl
|
||||
push de
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
call CalculateByteTensDigit
|
||||
ld b, a
|
||||
push bc
|
||||
|
||||
@@ -90,7 +90,7 @@ _CopyCardNameAndLevel: ; 18000 (6:4000)
|
||||
ret
|
||||
|
||||
; the name starts with TX_HALFWIDTH
|
||||
_CopyCardNameAndLevel_HalfwidthText:
|
||||
_CopyCardNameAndLevel_HalfwidthText: ; 18086 (6:4086)
|
||||
ld a, [wcd9b]
|
||||
inc a
|
||||
add a
|
||||
@@ -382,7 +382,7 @@ OpenInPlayAreaScreen: ; 180d5 (6:40d5)
|
||||
dw OpenInPlayAreaScreen_NonTurnHolderPlayArea ; 0x0e: INPLAYAREA_OPP_BENCH_4
|
||||
dw OpenInPlayAreaScreen_NonTurnHolderPlayArea ; 0x0f: INPLAYAREA_OPP_BENCH_5
|
||||
|
||||
OpenInPlayAreaScreen_TurnHolderPlayArea:
|
||||
OpenInPlayAreaScreen_TurnHolderPlayArea: ; 18248 (6:4248)
|
||||
; wInPlayAreaCurPosition constants conveniently map to (PLAY_AREA_* constants - 1)
|
||||
; for bench locations. this mapping is taken for granted in the following code.
|
||||
ld a, [wInPlayAreaCurPosition]
|
||||
@@ -403,7 +403,7 @@ OpenInPlayAreaScreen_TurnHolderPlayArea:
|
||||
bank1call OpenCardPage_FromCheckPlayArea
|
||||
ret
|
||||
|
||||
OpenInPlayAreaScreen_NonTurnHolderPlayArea:
|
||||
OpenInPlayAreaScreen_NonTurnHolderPlayArea: ; 1826a (6:426a)
|
||||
ld a, [wInPlayAreaCurPosition]
|
||||
sub INPLAYAREA_OPP_ACTIVE
|
||||
or a
|
||||
@@ -425,7 +425,7 @@ OpenInPlayAreaScreen_NonTurnHolderPlayArea:
|
||||
call SwapTurn
|
||||
ret
|
||||
|
||||
OpenInPlayAreaScreen_TurnHolderHand:
|
||||
OpenInPlayAreaScreen_TurnHolderHand: ; 18293 (6:4293)
|
||||
ldh a, [hWhoseTurn]
|
||||
push af
|
||||
bank1call OpenTurnHolderHandScreen_Simple
|
||||
@@ -433,7 +433,7 @@ OpenInPlayAreaScreen_TurnHolderHand:
|
||||
ldh [hWhoseTurn], a
|
||||
ret
|
||||
|
||||
OpenInPlayAreaScreen_NonTurnHolderHand:
|
||||
OpenInPlayAreaScreen_NonTurnHolderHand: ; 1829d (6:429d)
|
||||
ldh a, [hWhoseTurn]
|
||||
push af
|
||||
bank1call OpenNonTurnHolderHandScreen_Simple
|
||||
@@ -441,7 +441,7 @@ OpenInPlayAreaScreen_NonTurnHolderHand:
|
||||
ldh [hWhoseTurn], a
|
||||
ret
|
||||
|
||||
OpenInPlayAreaScreen_TurnHolderDiscardPile:
|
||||
OpenInPlayAreaScreen_TurnHolderDiscardPile: ; 182a7 (6:42a7)
|
||||
ldh a, [hWhoseTurn]
|
||||
push af
|
||||
bank1call OpenTurnHolderDiscardPileScreen
|
||||
@@ -449,7 +449,7 @@ OpenInPlayAreaScreen_TurnHolderDiscardPile:
|
||||
ldh [hWhoseTurn], a
|
||||
ret
|
||||
|
||||
OpenInPlayAreaScreen_NonTurnHolderDiscardPile:
|
||||
OpenInPlayAreaScreen_NonTurnHolderDiscardPile: ; 182b1 (6:42b1)
|
||||
ldh a, [hWhoseTurn]
|
||||
push af
|
||||
bank1call OpenNonTurnHolderDiscardPileScreen
|
||||
@@ -915,7 +915,7 @@ OpenGlossaryScreen: ; 184c8 (6:44c8)
|
||||
|
||||
; unit: 5 bytes.
|
||||
; [structure]
|
||||
; horizonal align (1) / title text id (2) / desc. text id (2)
|
||||
; horizontal align (1) / title text id (2) / desc. text id (2)
|
||||
glossary_entry: MACRO
|
||||
db \1
|
||||
tx \2
|
||||
@@ -1197,7 +1197,7 @@ Func_19079: ; 19079 (6:5079)
|
||||
call Func_3b6a
|
||||
jp Func_18f9c.asm_4fd4
|
||||
|
||||
PointerTable_006_508f: ; (6:508f)
|
||||
PointerTable_006_508f: ; 1908f (6:508f)
|
||||
dw Func_18fdc
|
||||
dw Func_19014
|
||||
dw Func_18fdd
|
||||
@@ -1523,10 +1523,10 @@ Func_19a12: ; 19a12 (6:5a12)
|
||||
; 0x19a1f
|
||||
|
||||
INCROM $19a1f, $19c20
|
||||
|
||||
|
||||
Func_19c20: ; 19c20 (6:5c20)
|
||||
INCROM $19c20, $1a4cf
|
||||
|
||||
INCROM $19c20, $1a4cf
|
||||
|
||||
Func_1a4cf: ; 1a4cf (6:64cf)
|
||||
INCROM $1a4cf, $1a61f
|
||||
|
||||
@@ -1677,7 +1677,7 @@ Func_1a6cd: ; 1a6cd (6:66cd)
|
||||
lb de, $38, $9f
|
||||
call SetupText
|
||||
ld hl, $00a3
|
||||
bank1call Func_57df
|
||||
bank1call DrawWholeScreenTextBox
|
||||
ld a, $0a
|
||||
ld [$0000], a
|
||||
xor a
|
||||
@@ -1715,32 +1715,32 @@ Func_1a73a: ; 1a73a (6:673a)
|
||||
pop hl
|
||||
ret
|
||||
|
||||
WhatIsYourNameData: ; (6:675e)
|
||||
WhatIsYourNameData: ; 1a75e (6:675e)
|
||||
textitem 1, 1, WhatIsYourNameText
|
||||
db $ff
|
||||
; [Deck1Data ~ Deck4Data]
|
||||
; These are directed from around (2:4f05),
|
||||
; without any bank description.
|
||||
; That is, the developers hard-coded it. -_-;;
|
||||
Deck1Data: ; (6:6763)
|
||||
Deck1Data: ; 1a763 (6:6763)
|
||||
textitem 2, 1, Text022b
|
||||
textitem 14, 1, Text0219
|
||||
db $ff
|
||||
Deck2Data: ; (6:676c)
|
||||
Deck2Data: ; 1a76c (6:676c)
|
||||
textitem 2, 1, Text022c
|
||||
textitem 14, 1, Text0219
|
||||
db $ff
|
||||
Deck3Data: ; (6:6775)
|
||||
Deck3Data: ; 1a775 (6:6775)
|
||||
textitem 2, 1, Text022d
|
||||
textitem 14, 1, Text0219
|
||||
db $ff
|
||||
Deck4Data: ; (6:677e)
|
||||
Deck4Data: ; 1a77e (6:677e)
|
||||
textitem 2, 1, Text022e
|
||||
textitem 14, 1, Text0219
|
||||
db $ff
|
||||
|
||||
; set each byte zero from hl for b bytes.
|
||||
ClearMemory: ; (6:6787)
|
||||
ClearMemory: ; 1a787 (6:6787)
|
||||
push af
|
||||
push bc
|
||||
push hl
|
||||
@@ -1758,7 +1758,7 @@ ClearMemory: ; (6:6787)
|
||||
; play different sfx by a.
|
||||
; if a is 0xff play SFX_03 (usually following a B press),
|
||||
; else play SFX_02 (usually following an A press).
|
||||
PlayAcceptOrDeclineSFX: ; (6:6794)
|
||||
PlayAcceptOrDeclineSFX: ; 1a794 (6:6794)
|
||||
push af
|
||||
inc a
|
||||
jr z, .sfx_decline
|
||||
@@ -1773,7 +1773,7 @@ PlayAcceptOrDeclineSFX: ; (6:6794)
|
||||
|
||||
; get player name from the user
|
||||
; into hl
|
||||
InputPlayerName: ; (6:67a3)
|
||||
InputPlayerName: ; 1a7a3 (6:67a3)
|
||||
ld e, l
|
||||
ld d, h
|
||||
ld a, MAX_PLAYER_NAME_LENGTH
|
||||
@@ -1858,7 +1858,7 @@ InputPlayerName: ; (6:67a3)
|
||||
; bc: position of name.
|
||||
; de: dest. pointer.
|
||||
; hl: pointer to text item of the question.
|
||||
InitializeInputName:
|
||||
InitializeInputName: ; 1a846 (6:6846)
|
||||
ld [wNamingScreenBufferMaxLength], a
|
||||
push hl
|
||||
ld hl, wNamingScreenNamePosition
|
||||
@@ -1900,7 +1900,7 @@ InitializeInputName:
|
||||
ld [wNamingScreenBufferLength], a
|
||||
ret
|
||||
|
||||
FinalizeInputName:
|
||||
FinalizeInputName: ; 1a880 (6:6880)
|
||||
ld hl, wNamingScreenDestPointer
|
||||
ld e, [hl]
|
||||
inc hl
|
||||
@@ -1915,7 +1915,7 @@ FinalizeInputName:
|
||||
|
||||
; draws the keyboard frame
|
||||
; and the question if it exists.
|
||||
DrawNamingScreenBG:
|
||||
DrawNamingScreenBG: ; 1a892 (6:6892)
|
||||
call DrawTextboxForKeyboard
|
||||
call PrintPlayerNameFromInput
|
||||
ld hl, wNamingScreenQuestionPointer
|
||||
@@ -1943,13 +1943,13 @@ DrawNamingScreenBG:
|
||||
textitem $0f, $10, EndText ; "End"
|
||||
db $ff
|
||||
|
||||
DrawTextboxForKeyboard:
|
||||
DrawTextboxForKeyboard: ; 1a8c1 (6:68c1)
|
||||
lb de, 0, 3 ; x, y
|
||||
lb bc, 20, 15 ; w, h
|
||||
call DrawRegularTextBox
|
||||
ret
|
||||
|
||||
PrintPlayerNameFromInput:
|
||||
PrintPlayerNameFromInput: ; 1a8cb (6:68cb)
|
||||
ld hl, wNamingScreenNamePosition
|
||||
ld d, [hl]
|
||||
inc hl
|
||||
@@ -1983,7 +1983,7 @@ endr
|
||||
|
||||
; check if button pressed.
|
||||
; if pressed, set the carry bit on.
|
||||
NamingScreen_CheckButtonState:
|
||||
NamingScreen_CheckButtonState: ; 1a908 (6:6908)
|
||||
xor a
|
||||
ld [wPlaysSfx], a
|
||||
ldh a, [hDPadHeld]
|
||||
@@ -2232,7 +2232,7 @@ Func_1aa28: ; 1aa28 (6:6a28)
|
||||
; load, to the first tile of v0Tiles0, the graphics for the
|
||||
; blinking black square used in name input screens.
|
||||
; for inputting full width text.
|
||||
LoadTextCursorTile:
|
||||
LoadTextCursorTile: ; 1aa65 (6:6a65)
|
||||
ld hl, v0Tiles0 + $00 tiles
|
||||
ld de, .data
|
||||
ld b, 0
|
||||
@@ -2253,7 +2253,7 @@ endr
|
||||
|
||||
; set the carry bit on,
|
||||
; if "End" was selected.
|
||||
NamingScreen_ProcessInput:
|
||||
NamingScreen_ProcessInput: ; 1aa87 (6:6a87)
|
||||
ld a, [wNamingScreenCursorX]
|
||||
ld h, a
|
||||
ld a, [wNamingScreenCursorY]
|
||||
@@ -2416,7 +2416,7 @@ NamingScreen_ProcessInput:
|
||||
; it seems to have been deprecated as the game was translated into english.
|
||||
; but it can still be applied to english, such as upper-lower case transition.
|
||||
; hl: info. pointer.
|
||||
TransformCharacter:
|
||||
TransformCharacter: ; 1ab61 (6:6b61)
|
||||
ld a, [wNamingScreenBufferLength]
|
||||
or a
|
||||
jr z, .return ; if the length is zero, just return.
|
||||
@@ -2468,7 +2468,7 @@ TransformCharacter:
|
||||
; it returns the pointer to the proper information.
|
||||
; h: position x.
|
||||
; l: position y.
|
||||
GetCharInfoFromPos_Player:
|
||||
GetCharInfoFromPos_Player: ; 1ab93 (6:6b93)
|
||||
push de
|
||||
; (information index) = (x) * (height) + (y)
|
||||
; (height) = 0x05(Deck) or 0x06(Player)
|
||||
@@ -2510,7 +2510,7 @@ else
|
||||
endc
|
||||
ENDM
|
||||
|
||||
KeyboardData_Player: ; (6:6baf)
|
||||
KeyboardData_Player: ; 1abaf (6:6baf)
|
||||
kbitem $04, $02, $11, $00, TX_FULLWIDTH3, "A"
|
||||
kbitem $06, $02, $12, $00, TX_FULLWIDTH3, "J"
|
||||
kbitem $08, $02, $13, $00, TX_FULLWIDTH3, "S"
|
||||
@@ -2737,7 +2737,7 @@ InputDeckName: ; 1ad89 (6:6d89)
|
||||
; load, to the first tile of v0Tiles0, the graphics for the
|
||||
; blinking black square used in name input screens.
|
||||
; for inputting half width text.
|
||||
LoadHalfWidthTextCursorTile:
|
||||
LoadHalfWidthTextCursorTile: ; 1ae37 (6:6e37)
|
||||
ld hl, v0Tiles0 + $00 tiles
|
||||
ld de, .data
|
||||
ld b, 0
|
||||
@@ -2757,7 +2757,7 @@ rept TILE_SIZE
|
||||
endr
|
||||
|
||||
; it's only for naming the deck.
|
||||
ProcessTextWithUnderbar:
|
||||
ProcessTextWithUnderbar: ; 1ae59 (6:6e59)
|
||||
ld hl, wNamingScreenNamePosition
|
||||
ld d, [hl]
|
||||
inc hl
|
||||
@@ -3036,7 +3036,7 @@ Func_1afc2: ; 1afc2 (6:6fc2)
|
||||
; its unit size is 3, and player's is 6.
|
||||
; h: x
|
||||
; l: y
|
||||
GetCharInfoFromPos_Deck:
|
||||
GetCharInfoFromPos_Deck: ; 1b000 (6:7000)
|
||||
push de
|
||||
ld e, l
|
||||
ld d, h
|
||||
@@ -3058,7 +3058,7 @@ GetCharInfoFromPos_Deck:
|
||||
jr nz, .loop
|
||||
ret
|
||||
|
||||
KeyboardData_Deck: ; (6:7019)
|
||||
KeyboardData_Deck: ; 1b019 (6:7019)
|
||||
db $04, $02, "A"
|
||||
db $06, $02, "J"
|
||||
db $08, $02, "S"
|
||||
|
||||
@@ -553,7 +553,35 @@ Func_1c83d: ; 1c83d (7:483d)
|
||||
ret
|
||||
; 0x1c858
|
||||
|
||||
INCROM $1c858, $1c8ef
|
||||
INCROM $1c858, $1c8bc
|
||||
|
||||
Func_1c8bc: ; 1c8bc (7:48bc)
|
||||
push hl
|
||||
push bc
|
||||
call Set_OBJ_8x8
|
||||
ld a, LOW(Func_3ba2)
|
||||
ld [wDoFrameFunction], a
|
||||
ld a, HIGH(Func_3ba2)
|
||||
ld [wDoFrameFunction + 1], a
|
||||
ld a, $ff
|
||||
ld hl, wAnimationQueue
|
||||
ld c, ANIMATION_QUEUE_LENGTH
|
||||
.fill_queue
|
||||
ld [hli], a
|
||||
dec c
|
||||
jr nz, .fill_queue
|
||||
ld [wd42a], a
|
||||
ld [wd4c0], a
|
||||
xor a
|
||||
ld [wd4ac], a
|
||||
ld [wd4ad], a
|
||||
ld [wd4b3], a
|
||||
call Func_1ccbc
|
||||
call Func_3ca0
|
||||
pop bc
|
||||
pop hl
|
||||
ret
|
||||
; 0x1c8ef
|
||||
|
||||
Func_1c8ef: ; 1c8ef (7:48ef)
|
||||
ld a, [wDoFrameFunction + 0]
|
||||
@@ -625,7 +653,7 @@ Func_1c8ef: ; 1c8ef (7:48ef)
|
||||
.address
|
||||
dw Func_1c94a
|
||||
|
||||
Func_1c94a:
|
||||
Func_1c94a: ; 1c94a (7:494a)
|
||||
ld e, l
|
||||
ld d, h
|
||||
ld c, 3
|
||||
@@ -777,6 +805,7 @@ macro_1ca04: MACRO
|
||||
dw \1
|
||||
db \2
|
||||
ENDM
|
||||
|
||||
Data_1ca04:
|
||||
; value(2), flag(1)
|
||||
macro_1ca04 $5858, $08
|
||||
@@ -795,7 +824,7 @@ Data_1ca04:
|
||||
macro_1ca04 $2838, $00
|
||||
macro_1ca04 $2818, $00
|
||||
|
||||
Func_1ca31:
|
||||
Func_1ca31: ; 1ca31 (7:4a6b)
|
||||
push hl
|
||||
push bc
|
||||
ld a, [wd4ac]
|
||||
@@ -895,7 +924,24 @@ Func_1cb18: ; 1cb18 (7:4b18)
|
||||
jr .asm_1cb57
|
||||
; 0x1cb5e
|
||||
|
||||
INCROM $1cb5e, $1d078
|
||||
INCROM $1cb5e, $1ccbc
|
||||
|
||||
Func_1ccbc: ; 1ccbc (7:4cbc)
|
||||
ld a, $ff
|
||||
ld [wd42a], a
|
||||
call DisableInt_LYCoincidence
|
||||
xor a
|
||||
ldh [hSCX], a
|
||||
ldh [rSCX], a
|
||||
ldh [hSCY], a
|
||||
ld hl, wd4b9
|
||||
ld [hl], LOW(Func_1ccbc)
|
||||
inc hl
|
||||
ld [hl], HIGH(Func_1ccbc)
|
||||
ret
|
||||
; 0x1ccd4
|
||||
|
||||
INCROM $1ccd4, $1d078
|
||||
|
||||
Func_1d078: ; 1d078 (7:5078)
|
||||
ld a, [wd627]
|
||||
|
||||
@@ -202,7 +202,7 @@ AIPlay_Potion: ; 201b5 (8:41b5)
|
||||
ld a, [wAITrainerCardParameter]
|
||||
ldh [hTemp_ffa0], a
|
||||
ld e, a
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
cp 20
|
||||
jr c, .play_card
|
||||
ld a, 20
|
||||
@@ -232,7 +232,7 @@ AIDecide_Potion1: ; 201d1 (8:41d1)
|
||||
call GetTurnDuelistVariable
|
||||
ld h, a
|
||||
ld e, PLAY_AREA_ARENA
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
cp 20 + 1 ; if damage <= 20
|
||||
jr c, .calculate_hp
|
||||
ld a, 20 ; amount of Potion HP healing
|
||||
@@ -270,7 +270,7 @@ AIDecide_Potion2: ; 20204 (8:4204)
|
||||
call GetTurnDuelistVariable
|
||||
ld h, a
|
||||
ld e, PLAY_AREA_ARENA
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
cp 20 + 1 ; if damage <= 20
|
||||
jr c, .calculate_hp
|
||||
ld a, 20
|
||||
@@ -309,7 +309,7 @@ AIDecide_Potion2: ; 20204 (8:4204)
|
||||
ret z
|
||||
call .check_boost_if_taken_damage
|
||||
jr c, .has_boost_damage
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
cp 20 ; if damage >= 20
|
||||
jr nc, .found
|
||||
.has_boost_damage
|
||||
@@ -392,7 +392,7 @@ AIPlay_SuperPotion: ; 202a8 (8:42a8)
|
||||
ldh [hTemp_ffa0], a
|
||||
ld a, [wAITrainerCardParameter]
|
||||
ld e, a
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
cp 40
|
||||
jr c, .play_card
|
||||
ld a, 40
|
||||
@@ -426,7 +426,7 @@ AIDecide_SuperPotion1: ; 202cc (8:42cc)
|
||||
call GetTurnDuelistVariable
|
||||
ld h, a
|
||||
ld e, PLAY_AREA_ARENA
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
cp 40 + 1 ; if damage < 40
|
||||
jr c, .calculate_hp
|
||||
ld a, 40
|
||||
@@ -470,7 +470,7 @@ AIDecide_SuperPotion2: ; 2030f (8:430f)
|
||||
call GetTurnDuelistVariable
|
||||
ld h, a
|
||||
ld e, PLAY_AREA_ARENA
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
cp 40 + 1 ; if damage < 40
|
||||
jr c, .calculate_hp
|
||||
ld a, 40
|
||||
@@ -516,7 +516,7 @@ AIDecide_SuperPotion2: ; 2030f (8:430f)
|
||||
jr c, .next
|
||||
call .check_energy_cost
|
||||
jr c, .next
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
cp 40 ; if damage >= 40
|
||||
jr nc, .found
|
||||
.next
|
||||
@@ -974,7 +974,7 @@ AIDecide_Pluspower2: ; 205a5 (8:45a5)
|
||||
; return carry if move is useable but cannot KO.
|
||||
.check_can_ko ; 205d7 (8:45d7)
|
||||
farcall CheckIfSelectedMoveIsUnusable
|
||||
jr c, .unuseable
|
||||
jr c, .unusable
|
||||
ld a, [wSelectedAttack]
|
||||
farcall EstimateDamage_VersusDefendingCard
|
||||
ld a, DUELVARS_ARENA_CARD_HP
|
||||
@@ -987,7 +987,7 @@ AIDecide_Pluspower2: ; 205a5 (8:45a5)
|
||||
; can't KO.
|
||||
scf
|
||||
ret
|
||||
.unuseable
|
||||
.unusable
|
||||
or a
|
||||
ret
|
||||
|
||||
@@ -995,12 +995,12 @@ AIDecide_Pluspower2: ; 205a5 (8:45a5)
|
||||
; move is useable and minimum damage > 0.
|
||||
.check_random ; 205f6 (8:45f6)
|
||||
farcall CheckIfSelectedMoveIsUnusable
|
||||
jr c, .unuseable
|
||||
jr c, .unusable
|
||||
ld a, [wSelectedAttack]
|
||||
farcall EstimateDamage_VersusDefendingCard
|
||||
ld a, [wAIMinDamage]
|
||||
cp 10
|
||||
jr c, .unuseable
|
||||
jr c, .unusable
|
||||
ld a, 10
|
||||
call Random
|
||||
cp 3
|
||||
@@ -2274,7 +2274,7 @@ AIDecide_PokemonBreeder: ; 20b1b (8:4b1b)
|
||||
dec b
|
||||
ld e, b
|
||||
push bc
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
pop bc
|
||||
call ConvertHPToCounters
|
||||
add c
|
||||
@@ -2296,7 +2296,7 @@ AIDecide_PokemonBreeder: ; 20b1b (8:4b1b)
|
||||
; compare number of this card's damage counters
|
||||
; with 5, if less than that, set carry
|
||||
ld e, PLAY_AREA_ARENA
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
cp 5
|
||||
jr c, .set_carry
|
||||
|
||||
@@ -3182,7 +3182,7 @@ AIDecide_PokemonCenter: ; 210eb (8:50eb)
|
||||
|
||||
; get this Pokemon's current damage counters
|
||||
; and add it to the total.
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
call ConvertHPToCounters
|
||||
ld b, a
|
||||
ld a, [wce08]
|
||||
@@ -3559,7 +3559,7 @@ AIDecide_Pokedex: ; 212dc (8:52dc)
|
||||
jp PickPokedexCards ; bug, should be jp nz
|
||||
|
||||
; picks order of the cards in deck from the effects of Pokedex.
|
||||
; prioritises Pokemon cards, then Trainer cards, then energy cards.
|
||||
; prioritizes Pokemon cards, then Trainer cards, then energy cards.
|
||||
; stores the resulting order in wce1a.
|
||||
PickPokedexCards_Unreferenced: ; 212ff (8:52ff)
|
||||
; unreferenced
|
||||
@@ -3690,7 +3690,7 @@ PickPokedexCards_Unreferenced: ; 212ff (8:52ff)
|
||||
ret
|
||||
|
||||
; picks order of the cards in deck from the effects of Pokedex.
|
||||
; prioritises energy cards, then Pokemon cards, then Trainer cards.
|
||||
; prioritizes energy cards, then Pokemon cards, then Trainer cards.
|
||||
; stores the resulting order in wce1a.
|
||||
PickPokedexCards: ; 2138e (8:538e)
|
||||
xor a
|
||||
@@ -3950,7 +3950,7 @@ AIDecide_MrFuji: ; 214a7 (8:54a7)
|
||||
ld b, a
|
||||
|
||||
; skip if zero damage counters
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
call ConvertHPToCounters
|
||||
or a
|
||||
jr z, .next
|
||||
@@ -4061,7 +4061,7 @@ AIDecide_ScoopUp: ; 21506 (8:5506)
|
||||
|
||||
; skip if card has no damage counters.
|
||||
ld e, PLAY_AREA_ARENA
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
or a
|
||||
jr z, .no_carry
|
||||
|
||||
@@ -4168,7 +4168,7 @@ AIDecide_ScoopUp: ; 21506 (8:5506)
|
||||
scf
|
||||
ret
|
||||
|
||||
; this deck will use Scoop Up on a benched Articuno2, Zapdos3 or Molres2.
|
||||
; this deck will use Scoop Up on a benched Articuno2, Zapdos3 or Moltres2.
|
||||
; interestingly, does not check for Muk in both Play Areas.
|
||||
.HandleLegendaryRonald ; 215e7 (8:55e7)
|
||||
; if less than 3 Play Area Pokemon cards, skip.
|
||||
@@ -4626,7 +4626,7 @@ AIDecide_Gambler: ; 21875 (8:5875)
|
||||
|
||||
; check if flag is set for Player using Mewtwo1 only deck
|
||||
ld a, [wAIBarrierFlagCounter]
|
||||
and AI_FLAG_MEWTWO_MILL
|
||||
and AI_MEWTWO_MILL
|
||||
jr z, .no_carry
|
||||
|
||||
; set carry if number of cards in deck <= 4.
|
||||
@@ -6042,7 +6042,7 @@ AIDecide_PokemonTrader_FlowerGarden: ; 220a8 (8:60a8)
|
||||
|
||||
AIDecide_PokemonTrader_StrangePower: ; 22122 (8:6122)
|
||||
; looks for a Pokemon in hand to trade with Mr Mime in deck.
|
||||
; inputing Mr Mime in register e for the function is redundant
|
||||
; inputting Mr Mime in register e for the function is redundant
|
||||
; since it already checks whether a Mr Mime exists in the hand.
|
||||
ld a, MR_MIME
|
||||
ld e, MR_MIME
|
||||
@@ -6637,7 +6637,7 @@ HandleAIHeal: ; 22402 (8:6402)
|
||||
ld a, OPPACTION_USE_PKMN_POWER
|
||||
bank1call AIMakeDecision
|
||||
pop af
|
||||
ldh [hAIHealCard], a
|
||||
ldh [hPlayAreaEffectTarget], a
|
||||
ld a, OPPACTION_EXECUTE_PKMN_POWER_EFFECT
|
||||
bank1call AIMakeDecision
|
||||
ld a, OPPACTION_DUEL_MAIN_SCENE
|
||||
@@ -6653,7 +6653,7 @@ HandleAIHeal: ; 22402 (8:6402)
|
||||
; check if Arena card has any damage counters,
|
||||
; if not, check Bench instead.
|
||||
ld e, PLAY_AREA_ARENA
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
or a
|
||||
jr z, .check_bench
|
||||
|
||||
@@ -6666,7 +6666,7 @@ HandleAIHeal: ; 22402 (8:6402)
|
||||
call GetTurnDuelistVariable
|
||||
ld h, a
|
||||
ld e, PLAY_AREA_ARENA
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
; this seems useless since it was already
|
||||
; checked that Arena card has damage,
|
||||
; so card damage is at least 10.
|
||||
@@ -6704,7 +6704,7 @@ HandleAIHeal: ; 22402 (8:6402)
|
||||
cp d
|
||||
jr z, .done
|
||||
push bc
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
pop bc
|
||||
cp b
|
||||
jr c, .next_bench
|
||||
@@ -6764,7 +6764,7 @@ HandleAIShift: ; 22476 (8:6476)
|
||||
ld a, OPPACTION_USE_PKMN_POWER
|
||||
bank1call AIMakeDecision
|
||||
|
||||
; converts WR_* to apropriate color
|
||||
; converts WR_* to appropriate color
|
||||
ld a, [wAIDefendingPokemonWeakness]
|
||||
ld b, 0
|
||||
.loop_color
|
||||
@@ -6824,7 +6824,7 @@ HandleAIPeek: ; 224e6 (8:64e6)
|
||||
ld a, 3
|
||||
call Random
|
||||
or a
|
||||
jr z, .check_player_prizes
|
||||
jr z, .check_ai_prizes
|
||||
cp 2
|
||||
jr c, .check_player_hand
|
||||
|
||||
@@ -6833,10 +6833,10 @@ HandleAIPeek: ; 224e6 (8:64e6)
|
||||
call GetNonTurnDuelistVariable
|
||||
cp DECK_SIZE - 1
|
||||
ret nc ; return if Player has one or no cards in Deck
|
||||
ld a, $ff
|
||||
ld a, AI_PEEK_TARGET_DECK
|
||||
jr .use_peek
|
||||
|
||||
.check_player_prizes
|
||||
.check_ai_prizes
|
||||
ld a, DUELVARS_PRIZES
|
||||
call GetTurnDuelistVariable
|
||||
ld hl, wcda5
|
||||
@@ -6861,7 +6861,7 @@ HandleAIPeek: ; 224e6 (8:64e6)
|
||||
ld a, c
|
||||
sub b
|
||||
ld [hl], a
|
||||
ld a, $40
|
||||
ld a, AI_PEEK_TARGET_PRIZE
|
||||
add d
|
||||
jr .use_peek
|
||||
|
||||
@@ -6876,7 +6876,7 @@ HandleAIPeek: ; 224e6 (8:64e6)
|
||||
call CountCardsInDuelTempList
|
||||
call ShuffleCards
|
||||
ld a, [wDuelTempList]
|
||||
or $80
|
||||
or AI_PEEK_TARGET_HAND
|
||||
|
||||
.use_peek
|
||||
push af
|
||||
@@ -6902,7 +6902,7 @@ HandleAIStrangeBehavior: ; 2255d (8:655d)
|
||||
|
||||
ldh [hTemp_ffa0], a
|
||||
ld e, PLAY_AREA_ARENA
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
or a
|
||||
ret z ; return if Arena card has no damage counters
|
||||
|
||||
@@ -6977,7 +6977,7 @@ HandleAICurse: ; 225b5 (8:65b5)
|
||||
call SwapTurn
|
||||
.loop_play_area_1
|
||||
push bc
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
pop bc
|
||||
or a
|
||||
jr z, .next_1
|
||||
@@ -7033,7 +7033,7 @@ HandleAICurse: ; 225b5 (8:65b5)
|
||||
cp b
|
||||
jr z, .next_2 ; skip same Pokemon card
|
||||
push bc
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
pop bc
|
||||
jr nz, .use_curse ; has damage counters, choose this card
|
||||
.next_2
|
||||
@@ -7116,7 +7116,7 @@ HandleAICowardice: ; 2262d (8:662d)
|
||||
ld a, c
|
||||
ldh [hTemp_ffa0], a
|
||||
ld e, a
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
.asm_22678
|
||||
or a
|
||||
ret z ; return if has no damage counters
|
||||
@@ -7183,7 +7183,7 @@ HandleAIDamageSwap: ; 226a3 (8:66a3)
|
||||
|
||||
.ok
|
||||
ld e, PLAY_AREA_ARENA
|
||||
call GetCardDamage
|
||||
call GetCardDamageAndMaxHP
|
||||
or a
|
||||
ret z ; return if no damage
|
||||
|
||||
@@ -7380,12 +7380,12 @@ CheckIfPlayerHasPokemonOtherThanMewtwo1: ; 227a9 (8:67a9)
|
||||
HandleAIAntiMewtwoDeckStrategy: ; 227d3 (8:67d3)
|
||||
; return carry if Player is not playing Mewtwo1 mill deck
|
||||
ld a, [wAIBarrierFlagCounter]
|
||||
bit 7, a
|
||||
bit AI_MEWTWO_MILL_F, a
|
||||
jr z, .set_carry
|
||||
|
||||
; else, check if there's been less than 2 turns
|
||||
; without the Player using Barrier.
|
||||
cp AI_FLAG_MEWTWO_MILL + 2
|
||||
cp AI_MEWTWO_MILL + 2
|
||||
jr c, .count_bench
|
||||
|
||||
; if there has been, reset wAIBarrierFlagCounter
|
||||
@@ -7535,7 +7535,7 @@ AIPickEnergyCardToDiscard: ; 2282e (8:682e)
|
||||
|
||||
; returns in a the deck index of an energy card attached to card
|
||||
; in player's Play Area location a to remove.
|
||||
; prioritises double colorless energy, then any useful energy,
|
||||
; prioritizes double colorless energy, then any useful energy,
|
||||
; then defaults to the first energy card attached if neither
|
||||
; of those are found.
|
||||
; returns $ff in a if there are no energy cards attached.
|
||||
@@ -7614,7 +7614,7 @@ PickAttachedEnergyCardToRemove: ; 22875 (8:6875)
|
||||
|
||||
; stores in wTempAI and wCurCardCanAttack the deck indices
|
||||
; of energy cards attached to card in Play Area location a.
|
||||
; prioritises double colorless energy, then any useful energy,
|
||||
; prioritizes double colorless energy, then any useful energy,
|
||||
; then defaults to the first two energy cards attached if neither
|
||||
; of those are found.
|
||||
; returns $ff in a if there are no energy cards attached.
|
||||
@@ -8014,7 +8014,7 @@ LookForCardIDInDeck_GivenCardIDInHand: ; 22a49 (8:6a49)
|
||||
; input:
|
||||
; a = card ID
|
||||
; b = PLAY_AREA_* to start with
|
||||
; ouput:
|
||||
; output:
|
||||
; a = PLAY_AREA_* of found card
|
||||
; carry set if found
|
||||
LookForCardIDInPlayArea_Bank8: ; 22a72 (8:6a72)
|
||||
@@ -8134,7 +8134,7 @@ RemoveFromListDifferentCardOfGivenType: ; 22a95 (8:6a95)
|
||||
; e = card ID 2
|
||||
; output:
|
||||
; a = deck index of card ID 1 found in deck
|
||||
; e = deck index of Pokemon card in hand dfferent than card ID 2
|
||||
; e = deck index of Pokemon card in hand different than card ID 2
|
||||
LookForCardIDToTradeWithDifferentHandCard: ; 22ae0 (8:6ae0)
|
||||
ld hl, wCurCardCanAttack
|
||||
ld [hl], e
|
||||
|
||||
@@ -176,13 +176,13 @@ Func_70136: ; 70136 (1c:4136)
|
||||
or LCDC_BGON
|
||||
ld [wLCDC], a
|
||||
ld a, %11100100
|
||||
ld [rBGP], a
|
||||
ldh [rBGP], a
|
||||
call SetBGP
|
||||
xor a
|
||||
ldh [hSCX], a
|
||||
ld [rSCX], a
|
||||
ldh [rSCX], a
|
||||
ldh [hSCY], a
|
||||
ld [rSCY], a
|
||||
ldh [rSCY], a
|
||||
pop de
|
||||
pop bc
|
||||
pop hl
|
||||
|
||||
@@ -164,7 +164,7 @@ GetBoosterCardType: ; 1e2a0 (7:62a0)
|
||||
pop hl
|
||||
ret
|
||||
|
||||
CardTypeTable: ; 1e2b1 (7:62b1)
|
||||
CardTypeTable: ; 1e2b1 (7:62b1)
|
||||
db BOOSTER_CARD_TYPE_FIRE ; TYPE_PKMN_FIRE
|
||||
db BOOSTER_CARD_TYPE_GRASS ; TYPE_PKMN_GRASS
|
||||
db BOOSTER_CARD_TYPE_LIGHTNING ; TYPE_PKMN_LIGHTNING
|
||||
@@ -344,7 +344,7 @@ GenerateRandomEnergy: ; 1e387 (7:6387)
|
||||
jr AddBoosterEnergyToDrawnEnergies
|
||||
|
||||
; generates a booster with 10 random energies
|
||||
GenerateRandomEnergyBooster: ; 1e390 (7:6390)
|
||||
GenerateRandomEnergyBooster: ; 1e390 (7:6390)
|
||||
ld a, NUM_CARDS_IN_BOOSTER
|
||||
.generate_energy_loop
|
||||
push af
|
||||
@@ -355,22 +355,22 @@ GenerateRandomEnergyBooster: ; 1e390 (7:6390)
|
||||
jr ZeroBoosterRarityData
|
||||
|
||||
; generates a booster with 5 Lightning energies and 5 Fire energies
|
||||
GenerateEnergyBoosterLightningFire: ; 1e39c (7:639c)
|
||||
GenerateEnergyBoosterLightningFire: ; 1e39c (7:639c)
|
||||
ld hl, EnergyBoosterLightningFireData
|
||||
jr GenerateTwoTypesEnergyBooster
|
||||
|
||||
; generates a booster with 5 Water energies and 5 Fighting energies
|
||||
GenerateEnergyBoosterWaterFighting: ; 1e3a1 (7:63a1)
|
||||
GenerateEnergyBoosterWaterFighting: ; 1e3a1 (7:63a1)
|
||||
ld hl, EnergyBoosterWaterFightingData
|
||||
jr GenerateTwoTypesEnergyBooster
|
||||
|
||||
; generates a booster with 5 Grass energies and 5 Psychic energies
|
||||
GenerateEnergyBoosterGrassPsychic: ; 1e3a6 (7:63a6)
|
||||
GenerateEnergyBoosterGrassPsychic: ; 1e3a6 (7:63a6)
|
||||
ld hl, EnergyBoosterGrassPsychicData
|
||||
jr GenerateTwoTypesEnergyBooster
|
||||
|
||||
; generates a booster with 5 energies of 2 different types each
|
||||
GenerateTwoTypesEnergyBooster: ; 1e3ab (7:63ab)
|
||||
GenerateTwoTypesEnergyBooster: ; 1e3ab (7:63ab)
|
||||
ld b, $02
|
||||
.add_two_energies_to_booster_loop
|
||||
ld c, NUM_CARDS_IN_BOOSTER / 2
|
||||
@@ -388,7 +388,7 @@ GenerateTwoTypesEnergyBooster: ; 1e3ab (7:63ab)
|
||||
jr nz, .add_two_energies_to_booster_loop
|
||||
; fallthrough
|
||||
|
||||
ZeroBoosterRarityData:
|
||||
ZeroBoosterRarityData: ; 1e3be (7:63be)
|
||||
xor a
|
||||
ld [wBoosterData_CommonAmount], a
|
||||
ld [wBoosterData_UncommonAmount], a
|
||||
@@ -452,8 +452,8 @@ PutEnergiesAndNonEnergiesTogether: ; 1e3f3 (7:63f3)
|
||||
pop hl
|
||||
ret
|
||||
|
||||
; add the final cards drawn from the booster pack to the player's colection (sCardCollection)
|
||||
AddBoosterCardsToCollection:; 1e40a (7:640a)
|
||||
; add the final cards drawn from the booster pack to the player's collection (sCardCollection)
|
||||
AddBoosterCardsToCollection: ; 1e40a (7:640a)
|
||||
push hl
|
||||
ld hl, wBoosterCardsDrawn
|
||||
.add_cards_loop
|
||||
|
||||
@@ -78,7 +78,7 @@ AIActionTable_LegendaryArticuno: ; 14c0b (5:4c0b)
|
||||
ret
|
||||
|
||||
; this routine handles how Legendary Articuno
|
||||
; prioritises playing energy cards to each Pokémon.
|
||||
; prioritizes playing energy cards to each Pokémon.
|
||||
; first, it makes sure that all Lapras have at least
|
||||
; 3 energy cards before moving on to Articuno,
|
||||
; and then to Dewgong and Seel
|
||||
|
||||
@@ -105,7 +105,7 @@ AIDoTurn_LegendaryDragonite: ; 14def (5:4def)
|
||||
or a
|
||||
jr nz, .skip_energy_attach_1
|
||||
|
||||
; if Arena card is Kangaskhan and doens't
|
||||
; if Arena card is Kangaskhan and doesn't
|
||||
; have Energy cards attached, try attaching from hand.
|
||||
; otherwise run normal AI energy attach routine.
|
||||
ld a, DUELVARS_ARENA_CARD
|
||||
|
||||
@@ -15,7 +15,7 @@ AIActionTable_SamPractice: ; 147bd (05:47bd)
|
||||
call AIMainTurnLogic
|
||||
ret
|
||||
.scripted_1 ; use scripted actions instead
|
||||
call AIPerformSciptedTurn
|
||||
call AIPerformScriptedTurn
|
||||
ret
|
||||
|
||||
.start_duel ; 147d6 (5:47d6)
|
||||
@@ -93,7 +93,7 @@ GetPlayAreaLocationOfRaticateOrRattata: ; 1481f (5:481f)
|
||||
ret
|
||||
|
||||
; has AI execute some scripted actions depending on Duel turn.
|
||||
AIPerformSciptedTurn: ; 1483a (5:483a)
|
||||
AIPerformScriptedTurn: ; 1483a (5:483a)
|
||||
ld a, [wDuelTurns]
|
||||
srl a
|
||||
ld hl, .scripted_actions_list
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 803 B After Width: | Height: | Size: 803 B |
|
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 784 B |
|
Before Width: | Height: | Size: 745 B |
|
After Width: | Height: | Size: 791 B |
|
Before Width: | Height: | Size: 759 B |
|
After Width: | Height: | Size: 810 B |
|
Before Width: | Height: | Size: 755 B |
|
After Width: | Height: | Size: 806 B |
|
Before Width: | Height: | Size: 831 B |
|
After Width: | Height: | Size: 875 B |
|
Before Width: | Height: | Size: 760 B |
|
After Width: | Height: | Size: 807 B |
|
Before Width: | Height: | Size: 772 B |
|
After Width: | Height: | Size: 809 B |
|
Before Width: | Height: | Size: 793 B |
@@ -1 +0,0 @@
|
||||
��~�U�
|
||||
|
After Width: | Height: | Size: 847 B |
|
Before Width: | Height: | Size: 795 B |
|
After Width: | Height: | Size: 831 B |
|
Before Width: | Height: | Size: 825 B |
|
After Width: | Height: | Size: 869 B |
|
Before Width: | Height: | Size: 775 B |
|
After Width: | Height: | Size: 817 B |
|
Before Width: | Height: | Size: 519 B |
|
After Width: | Height: | Size: 556 B |
|
Before Width: | Height: | Size: 737 B |
|
After Width: | Height: | Size: 782 B |
|
Before Width: | Height: | Size: 830 B |
|
After Width: | Height: | Size: 866 B |
|
Before Width: | Height: | Size: 808 B |
|
After Width: | Height: | Size: 844 B |
|
Before Width: | Height: | Size: 801 B |
|
After Width: | Height: | Size: 841 B |
|
Before Width: | Height: | Size: 764 B |
@@ -1 +0,0 @@
|
||||
_kB1�
|
||||
|
After Width: | Height: | Size: 793 B |
|
Before Width: | Height: | Size: 801 B |
|
After Width: | Height: | Size: 843 B |
|
Before Width: | Height: | Size: 744 B |
|
After Width: | Height: | Size: 780 B |
|
Before Width: | Height: | Size: 745 B |