mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-01-23 09:16:20 -08:00
Merge pull request #256 from yenatch/master
Fix predefs and battle code.
This commit is contained in:
commit
1ecfe6bd23
53
Makefile
53
Makefile
@ -5,14 +5,13 @@ PYTHON := python
|
||||
.PHONY: all clean crystal pngs
|
||||
.SECONDEXPANSION:
|
||||
|
||||
POKEMONTOOLS := extras/pokemontools
|
||||
GFX := $(PYTHON) $(POKEMONTOOLS)/gfx.py
|
||||
INCLUDES := $(PYTHON) $(POKEMONTOOLS)/scan_includes.py
|
||||
PREPROCESS := $(PYTHON) prequeue.py
|
||||
poketools := extras/pokemontools
|
||||
gfx := $(PYTHON) $(poketools)/gfx.py
|
||||
includes := $(PYTHON) $(poketools)/scan_includes.py
|
||||
pre := $(PYTHON) prequeue.py
|
||||
|
||||
TEXTQUEUE :=
|
||||
|
||||
CRYSTAL_OBJS := \
|
||||
crystal_obj := \
|
||||
wram.o \
|
||||
main.o \
|
||||
lib/mobile/main.o \
|
||||
@ -29,20 +28,21 @@ data/pokedex/entries_crystal.o \
|
||||
misc/crystal_misc.o \
|
||||
gfx/pics.o
|
||||
|
||||
OBJS := $(CRYSTAL_OBJS)
|
||||
|
||||
ROMS := pokecrystal.gbc
|
||||
all_obj := $(crystal_obj)
|
||||
|
||||
# object dependencies
|
||||
$(shell $(foreach obj, $(OBJS), $(eval $(obj:.o=)_DEPENDENCIES := $(shell $(INCLUDES) $(obj:.o=.asm)))))
|
||||
$(foreach obj, $(all_obj), \
|
||||
$(eval $(obj:.o=)_dep := $(shell $(includes) $(obj:.o=.asm))) \
|
||||
)
|
||||
|
||||
all: $(ROMS)
|
||||
|
||||
roms := pokecrystal.gbc
|
||||
|
||||
all: $(roms)
|
||||
crystal: pokecrystal.gbc
|
||||
|
||||
clean:
|
||||
rm -f $(ROMS)
|
||||
rm -f $(OBJS)
|
||||
rm -f $(roms) $(all_obj)
|
||||
find -iname '*.tx' -exec rm {} +
|
||||
|
||||
baserom.gbc: ;
|
||||
@ -50,30 +50,31 @@ baserom.gbc: ;
|
||||
|
||||
|
||||
%.asm: ;
|
||||
.asm.tx:
|
||||
$(eval TEXTQUEUE += $<)
|
||||
@rm -f $@
|
||||
%.tx: %.asm ; $(eval txq += $<) @rm -f $@
|
||||
|
||||
$(OBJS): $$*.tx $$(patsubst %.asm, %.tx, $$($$*_DEPENDENCIES))
|
||||
@$(PREPROCESS) $(TEXTQUEUE)
|
||||
$(eval TEXTQUEUE :=)
|
||||
$(all_obj): $$*.tx $$(patsubst %.asm, %.tx, $$($$*_dep))
|
||||
@$(pre) $(txq); $(eval txq :=)
|
||||
@$(gfx) 2bpp $(2bppq); $(eval 2bppq :=)
|
||||
@$(gfx) 1bpp $(1bppq); $(eval 1bppq :=)
|
||||
@$(gfx) lz $(lzq); $(eval lzq :=)
|
||||
rgbasm -o $@ $*.tx
|
||||
|
||||
pokecrystal.gbc: $(CRYSTAL_OBJS)
|
||||
pokecrystal.gbc: $(crystal_obj)
|
||||
rgblink -n $*.sym -m $*.map -o $@ $^
|
||||
rgbfix -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -p 0 -r 3 -t PM_CRYSTAL $@
|
||||
cmp baserom.gbc $@
|
||||
|
||||
|
||||
pngs:
|
||||
find . -iname "*.lz" -exec $(GFX) unlz {} +
|
||||
find . -iname "*.[12]bpp" -exec $(GFX) png {} +
|
||||
find . -iname "*.[12]bpp" -exec touch {} +
|
||||
find . -iname "*.lz" -exec $(gfx) unlz {} +
|
||||
find . -iname "*.[12]bpp" -exec $(gfx) png {} +
|
||||
find . -iname "*.lz" -exec touch {} +
|
||||
find . -iname "*.[12]bpp" -exec touch {} +
|
||||
|
||||
%.2bpp: %.png ; $(eval 2bppq += $<) @rm -f $@
|
||||
%.1bpp: %.png ; $(eval 1bppq += $<) @rm -f $@
|
||||
%.lz: % ; $(eval lzq += $<) @rm -f $@
|
||||
|
||||
%.2bpp: %.png ; $(GFX) 2bpp $<
|
||||
%.1bpp: %.png ; $(GFX) 1bpp $<
|
||||
%.lz: % ; $(GFX) lz $<
|
||||
|
||||
%.pal: ;
|
||||
%.bin: ;
|
||||
|
847
battle/ai/items.asm
Normal file
847
battle/ai/items.asm
Normal file
@ -0,0 +1,847 @@
|
||||
Function38000: ; 38000
|
||||
and a
|
||||
ld a, [IsInBattle]
|
||||
dec a
|
||||
ret z
|
||||
ld a, [InLinkBattle]
|
||||
and a
|
||||
ret nz
|
||||
callba Function3e8d1
|
||||
ret nz
|
||||
ld a, [PlayerSubStatus5]
|
||||
bit SUBSTATUS_CANT_RUN, a
|
||||
jr nz, Function38041
|
||||
ld a, [$c731]
|
||||
and a
|
||||
jr nz, Function38041
|
||||
ld hl, TrainerClassAttributes + 5
|
||||
ld a, [$cfc0]
|
||||
and a
|
||||
jr nz, .asm_38032
|
||||
ld a, [TrainerClass]
|
||||
dec a
|
||||
ld bc, 7
|
||||
call AddNTimes
|
||||
|
||||
.asm_38032
|
||||
bit 0, [hl]
|
||||
jp nz, Function38045
|
||||
bit 1, [hl]
|
||||
jp nz, Function38083
|
||||
bit 2, [hl]
|
||||
jp nz, Function380c1
|
||||
; fallthrough
|
||||
; 38041
|
||||
|
||||
Function38041: ; 38041
|
||||
call Function38105
|
||||
ret
|
||||
; 38045
|
||||
|
||||
Function38045: ; 38045
|
||||
callab Function34941
|
||||
ld a, [$c717]
|
||||
and $f0
|
||||
jp z, Function38041
|
||||
cp $10
|
||||
jr nz, .asm_38061
|
||||
call Random
|
||||
cp $80
|
||||
jr c, .asm_38077
|
||||
jp Function38041
|
||||
|
||||
.asm_38061
|
||||
cp $20
|
||||
jr nz, .asm_3806f
|
||||
call Random
|
||||
cp $c8
|
||||
jr c, .asm_38077
|
||||
jp Function38041
|
||||
|
||||
.asm_3806f
|
||||
call Random
|
||||
cp $a
|
||||
jp c, Function38041
|
||||
|
||||
.asm_38077
|
||||
ld a, [$c717]
|
||||
and $f
|
||||
inc a
|
||||
ld [$c718], a
|
||||
jp Function3844b
|
||||
; 38083
|
||||
|
||||
Function38083: ; 38083
|
||||
callab Function34941
|
||||
ld a, [$c717]
|
||||
and $f0
|
||||
jp z, Function38041
|
||||
cp $10
|
||||
jr nz, .asm_3809f
|
||||
call Random
|
||||
cp $14
|
||||
jr c, .asm_380b5
|
||||
jp Function38041
|
||||
|
||||
.asm_3809f
|
||||
cp $20
|
||||
jr nz, .asm_380ad
|
||||
call Random
|
||||
cp $1e
|
||||
jr c, .asm_380b5
|
||||
jp Function38041
|
||||
|
||||
.asm_380ad
|
||||
call Random
|
||||
cp $c8
|
||||
jp c, Function38041
|
||||
|
||||
.asm_380b5
|
||||
ld a, [$c717]
|
||||
and $f
|
||||
inc a
|
||||
ld [$c718], a
|
||||
jp Function3844b
|
||||
; 380c1
|
||||
|
||||
Function380c1: ; 380c1
|
||||
callab Function34941
|
||||
ld a, [$c717]
|
||||
and $f0
|
||||
jp z, Function38041
|
||||
cp $10
|
||||
jr nz, .asm_380dd
|
||||
call Random
|
||||
cp $32
|
||||
jr c, .asm_380f3
|
||||
jp Function38041
|
||||
|
||||
.asm_380dd
|
||||
cp $20
|
||||
jr nz, .asm_380eb
|
||||
call Random
|
||||
cp $80
|
||||
jr c, .asm_380f3
|
||||
jp Function38041
|
||||
|
||||
.asm_380eb
|
||||
call Random
|
||||
cp $32
|
||||
jp c, Function38041
|
||||
|
||||
.asm_380f3
|
||||
ld a, [$c717]
|
||||
and $f
|
||||
inc a
|
||||
ld [$c718], a
|
||||
jp Function3844b
|
||||
; 380ff
|
||||
|
||||
|
||||
Function380ff: ; 380ff
|
||||
ld a, [EnemySubStatus5]
|
||||
bit SUBSTATUS_CANT_RUN, a
|
||||
ret
|
||||
; 38105
|
||||
|
||||
|
||||
Function38105: ; 38105
|
||||
ld a, [$cfc0]
|
||||
and a
|
||||
ret nz
|
||||
ld a, [$c650]
|
||||
ld b, a
|
||||
ld a, [$c651]
|
||||
or b
|
||||
ret z
|
||||
call Function38170
|
||||
ret nc
|
||||
ld a, [TrainerClass]
|
||||
dec a
|
||||
ld hl, TrainerClassAttributes + 5
|
||||
ld bc, 7
|
||||
call AddNTimes
|
||||
ld b, h
|
||||
ld c, l
|
||||
ld hl, Unknown_38196
|
||||
ld de, $c650
|
||||
.asm_3812c
|
||||
ld a, [hl]
|
||||
and a
|
||||
inc a
|
||||
ret z
|
||||
ld a, [de]
|
||||
cp [hl]
|
||||
jr z, .asm_3813f
|
||||
inc de
|
||||
ld a, [de]
|
||||
cp [hl]
|
||||
jr z, .asm_3813f
|
||||
dec de
|
||||
inc hl
|
||||
inc hl
|
||||
inc hl
|
||||
jr .asm_3812c
|
||||
|
||||
.asm_3813f
|
||||
inc hl
|
||||
push hl
|
||||
push de
|
||||
ld de, .asm_3814a
|
||||
push de
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
jp [hl]
|
||||
|
||||
.asm_3814a
|
||||
pop de
|
||||
pop hl
|
||||
inc hl
|
||||
inc hl
|
||||
jr c, .asm_3812c
|
||||
xor a
|
||||
ld [de], a
|
||||
inc a
|
||||
ld [$c70f], a
|
||||
ld hl, EnemySubStatus3 ; $c66f
|
||||
res SUBSTATUS_BIDE, [hl]
|
||||
xor a
|
||||
ld [EnemyFuryCutterCount], a ; $c680
|
||||
ld [$c681], a
|
||||
ld [$c72c], a
|
||||
ld hl, EnemySubStatus4 ; $c670
|
||||
res SUBSTATUS_RAGE, [hl]
|
||||
xor a
|
||||
ld [LastPlayerCounterMove], a ; $c6f9
|
||||
scf
|
||||
ret
|
||||
|
||||
|
||||
Function38170: ; 38170
|
||||
ld a, [OTPartyCount]
|
||||
ld d, a
|
||||
ld e, 0
|
||||
ld hl, OTPartyMon1Level
|
||||
ld bc, OTPartyMon2 - OTPartyMon1
|
||||
.asm_3817c
|
||||
ld a, [hl]
|
||||
cp e
|
||||
jr c, .asm_38181
|
||||
ld e, a
|
||||
.asm_38181
|
||||
add hl, bc
|
||||
dec d
|
||||
jr nz, .asm_3817c
|
||||
|
||||
ld a, [CurOTMon]
|
||||
ld hl, OTPartyMon1Level
|
||||
call AddNTimes
|
||||
ld a, [hl]
|
||||
cp e
|
||||
jr nc, .asm_38194
|
||||
and a
|
||||
ret
|
||||
|
||||
.asm_38194
|
||||
scf
|
||||
ret
|
||||
; 38196
|
||||
|
||||
Unknown_38196: ; 39196
|
||||
dbw FULL_RESTORE, Function38208
|
||||
dbw MAX_POTION, Function38220
|
||||
dbw HYPER_POTION, Function38284
|
||||
dbw SUPER_POTION, Function38292
|
||||
dbw POTION, Function382a0
|
||||
dbw X_ACCURACY, Function382f9
|
||||
dbw FULL_HEAL, Function381be
|
||||
dbw GUARD_SPEC, Function38305
|
||||
dbw DIRE_HIT, Function38311
|
||||
dbw X_ATTACK, Function3831d
|
||||
dbw X_DEFEND, Function38329
|
||||
dbw X_SPEED, Function38335
|
||||
dbw X_SPECIAL, Function38341
|
||||
db $ff
|
||||
; 381be
|
||||
|
||||
Function381be: ; 381be
|
||||
call Function381ca
|
||||
jp c, Function38383
|
||||
call Function383a3
|
||||
jp Function38385
|
||||
; 381ca
|
||||
|
||||
; known jump sources: 381be (e:41be), 38214 (e:4214)
|
||||
Function381ca: ; 381ca (e:41ca)
|
||||
ld a, [EnemyMonStatus] ; $d214
|
||||
and a
|
||||
jp z, Function38383
|
||||
|
||||
ld a, [bc]
|
||||
bit 6, a
|
||||
jr nz, .asm_381e7
|
||||
ld a, [bc]
|
||||
bit 4, a
|
||||
jp nz, Function38385
|
||||
call Random
|
||||
cp $32
|
||||
jp c, Function38385
|
||||
jp Function38383
|
||||
|
||||
.asm_381e7
|
||||
ld a, [EnemySubStatus5]
|
||||
bit SUBSTATUS_TOXIC, a
|
||||
jr z, .asm_381fd
|
||||
ld a, [$c67c]
|
||||
cp $4
|
||||
jr c, .asm_381fd
|
||||
call Random
|
||||
cp $80
|
||||
jp c, Function38385
|
||||
.asm_381fd
|
||||
ld a, [EnemyMonStatus]
|
||||
and 1 << FRZ | SLP
|
||||
jp z, Function38383
|
||||
jp Function38385
|
||||
; 38208
|
||||
|
||||
Function38208: ; 38208
|
||||
call Function3822c
|
||||
jp nc, Function3821a
|
||||
ld a, [bc]
|
||||
bit 6, a
|
||||
jp z, Function38383
|
||||
call Function381ca
|
||||
jp c, Function38383
|
||||
|
||||
; known jump sources: 3820b (e:420b)
|
||||
Function3821a: ; 3821a (e:421a)
|
||||
call Function383b5
|
||||
jp Function38385
|
||||
; 38220
|
||||
|
||||
Function38220: ; 38220
|
||||
call Function3822c
|
||||
jp c, Function38383
|
||||
call Function383ae
|
||||
jp Function38385
|
||||
|
||||
; known jump sources: 38208 (e:4208), 38220 (e:4220), 38284 (e:4284)
|
||||
Function3822c: ; 3822c (e:422c)
|
||||
ld a, [bc]
|
||||
bit 6, a
|
||||
jr nz, Function38267
|
||||
callab AICheckEnemyHalfHP
|
||||
jp c, Function38383
|
||||
ld a, [bc]
|
||||
bit 5, a
|
||||
jp nz, Function38254
|
||||
callab AICheckEnemyQuarterHP
|
||||
jp nc, Function38281
|
||||
call Random
|
||||
cp $80
|
||||
jp c, Function38281
|
||||
jp Function38383
|
||||
|
||||
Function38254: ; 38254 (e:4254)
|
||||
callab AICheckEnemyQuarterHP
|
||||
jp c, Function38383
|
||||
call Random
|
||||
cp $32
|
||||
jp c, Function38383
|
||||
jr Function38281
|
||||
|
||||
Function38267: ; 38267 (e:4267)
|
||||
callab AICheckEnemyHalfHP
|
||||
jp c, Function38383
|
||||
callab AICheckEnemyQuarterHP
|
||||
jp nc, Function38281
|
||||
call Random
|
||||
cp $32
|
||||
jp nc, Function38383
|
||||
|
||||
Function38281: ; 38281 (e:4281)
|
||||
jp Function38385
|
||||
; 38284
|
||||
|
||||
Function38284: ; 38284
|
||||
call Function3822c
|
||||
jp c, Function38383
|
||||
ld b, 200
|
||||
call Function383f4
|
||||
jp Function38385
|
||||
; 38292 (e:4292)
|
||||
|
||||
Function38292: ; 38292
|
||||
call Function3822c
|
||||
jp c, Function38383
|
||||
|
||||
Function38298: ; 38298
|
||||
ld b, 50
|
||||
call Function383ee
|
||||
jp Function38385
|
||||
; 382a0
|
||||
|
||||
Function382a0: ; 382a0
|
||||
call Function3822c
|
||||
jp c, Function38383
|
||||
ld b, 20
|
||||
call Function383e8
|
||||
jp Function38385
|
||||
; 382ae
|
||||
|
||||
Function382ae: ; 382ae
|
||||
callab AICheckEnemyMaxHP
|
||||
jr c, .asm_382e4
|
||||
push bc
|
||||
ld de, EnemyMonMaxHP + 1
|
||||
ld hl, EnemyMonHP + 1
|
||||
ld a, [de]
|
||||
sub [hl]
|
||||
jr z, .asm_382e7
|
||||
dec hl
|
||||
dec de
|
||||
ld c, a
|
||||
sbc [hl]
|
||||
and a
|
||||
jr nz, .asm_382e7
|
||||
ld a, c
|
||||
cp b
|
||||
jp c, .asm_382d5
|
||||
callab AICheckEnemyQuarterHP
|
||||
jr c, .asm_382e7
|
||||
|
||||
.asm_382d5
|
||||
pop bc
|
||||
ld a, [bc]
|
||||
bit 5, a
|
||||
jp z, Function38385
|
||||
call Random
|
||||
cp $80
|
||||
jp c, Function38385
|
||||
|
||||
.asm_382e4
|
||||
jp Function38383
|
||||
|
||||
.asm_382e7
|
||||
pop bc
|
||||
ld a, [bc]
|
||||
bit 5, a
|
||||
jp z, Function38383
|
||||
call Random
|
||||
cp $64
|
||||
jp c, Function38385
|
||||
jp Function38383
|
||||
; 382f9
|
||||
|
||||
Function382f9: ; 382f9
|
||||
call Function3834d
|
||||
jp c, Function38383
|
||||
call Function384f7
|
||||
jp Function38385
|
||||
; 38305
|
||||
|
||||
Function38305: ; 38305
|
||||
call Function3834d
|
||||
jp c, Function38383
|
||||
call Function38504
|
||||
jp Function38385
|
||||
; 38311
|
||||
|
||||
Function38311: ; 38311
|
||||
call Function3834d
|
||||
jp c, Function38383
|
||||
call Function38511
|
||||
jp Function38385
|
||||
; 3831d (e:431d)
|
||||
|
||||
Function3831d: ; 3831d
|
||||
call Function3834d
|
||||
jp c, Function38383
|
||||
call Function38541
|
||||
jp Function38385
|
||||
; 38329
|
||||
|
||||
Function38329: ; 38329
|
||||
call Function3834d
|
||||
jp c, Function38383
|
||||
call Function38547
|
||||
jp Function38385
|
||||
; 38335
|
||||
|
||||
Function38335: ; 38335
|
||||
call Function3834d
|
||||
jp c, Function38383
|
||||
call Function3854d
|
||||
jp Function38385
|
||||
; 38341
|
||||
|
||||
Function38341: ; 38341
|
||||
call Function3834d
|
||||
jp c, Function38383
|
||||
call Function38553
|
||||
jp Function38385
|
||||
; 3834d
|
||||
|
||||
; known jump sources: 38311 (e:4311)
|
||||
Function3834d: ; 3834d (e:434d)
|
||||
ld a, [EnemyTurnsTaken] ; $c6dc
|
||||
and a
|
||||
jr nz, .asm_38372
|
||||
ld a, [bc]
|
||||
bit 4, a
|
||||
jp nz, Function38385
|
||||
call Random
|
||||
cp $80
|
||||
jp c, Function38383
|
||||
ld a, [bc]
|
||||
bit 6, a
|
||||
jp nz, Function38385
|
||||
call Random
|
||||
cp $80
|
||||
jp c, Function38383
|
||||
jp Function38385
|
||||
.asm_38372
|
||||
ld a, [bc]
|
||||
bit 4, a
|
||||
jp z, Function38383
|
||||
call Random
|
||||
cp $32
|
||||
jp nc, Function38383
|
||||
jp Function38385
|
||||
|
||||
Function38383: ; 38383 (e:4383)
|
||||
scf
|
||||
ret
|
||||
|
||||
Function38385: ; 38385 (e:4385)
|
||||
and a
|
||||
ret
|
||||
|
||||
|
||||
Function38387: ; 38387
|
||||
call UpdateEnemyMonInParty
|
||||
callba UpdateEnemyHUD
|
||||
ld a, $1
|
||||
ld [hBGMapMode], a
|
||||
ld hl, $c6e6
|
||||
dec [hl]
|
||||
scf
|
||||
ret
|
||||
; 3839a
|
||||
|
||||
Function3839a: ; 3839a
|
||||
push de
|
||||
ld de, SFX_FULL_HEAL
|
||||
call PlaySFX
|
||||
pop de
|
||||
ret
|
||||
; 383a3
|
||||
|
||||
|
||||
; known jump sources: 381c4 (e:41c4)
|
||||
Function383a3: ; 383a3 (e:43a3)
|
||||
call Function3839a
|
||||
call Function384e0
|
||||
ld a, FULL_HEAL
|
||||
jp Function38568
|
||||
|
||||
; known jump sources: 38226 (e:4226)
|
||||
Function383ae: ; 383ae (e:43ae)
|
||||
ld a, $f
|
||||
ld [$d1f1], a
|
||||
jr asm_383c6
|
||||
|
||||
; known jump sources: 3821a (e:421a)
|
||||
Function383b5: ; 383b5 (e:43b5)
|
||||
call Function384e0
|
||||
ld a, $e
|
||||
ld [$d1f1], a
|
||||
ld hl, EnemySubStatus3 ; $c66f
|
||||
res SUBSTATUS_CONFUSED, [hl]
|
||||
xor a
|
||||
ld [EnemyConfuseCount], a ; $c67b
|
||||
asm_383c6: ; 383c6 (e:43c6)
|
||||
ld de, $d1ec
|
||||
ld hl, EnemyMonHP + 1 ; $d217
|
||||
ld a, [hld]
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, [hl]
|
||||
ld [de], a
|
||||
inc de
|
||||
ld hl, EnemyMonMaxHP + 1 ; $d219
|
||||
ld a, [hld]
|
||||
ld [de], a
|
||||
inc de
|
||||
ld [Buffer1], a ; $d1ea (aliases: MagikarpLength)
|
||||
ld [EnemyMonHP + 1], a ; $d217
|
||||
ld a, [hl]
|
||||
ld [de], a
|
||||
ld [Buffer2], a ; $d1eb (aliases: MovementType)
|
||||
ld [EnemyMonHP], a ; $d216 (aliases: EnemyMonHP)
|
||||
jr asm_38436
|
||||
; 383e8 (e:43e8)
|
||||
|
||||
Function383e8: ; 383e8
|
||||
ld a, POTION
|
||||
ld b, 20
|
||||
jr Function383f8
|
||||
|
||||
Function383ee: ; 383ee
|
||||
ld a, SUPER_POTION
|
||||
ld b, 50
|
||||
jr Function383f8
|
||||
|
||||
; known jump sources: 3828c (e:428c)
|
||||
Function383f4: ; 383f4 (e:43f4)
|
||||
ld a, HYPER_POTION
|
||||
ld b, 200
|
||||
|
||||
Function383f8: ; 383f8
|
||||
ld [$d1f1], a
|
||||
ld hl, EnemyMonHP + 1 ; $d217
|
||||
ld a, [hl]
|
||||
ld [$d1ec], a
|
||||
add b
|
||||
ld [hld], a
|
||||
ld [$d1ee], a
|
||||
ld a, [hl]
|
||||
ld [$d1ed], a
|
||||
ld [$d1ef], a
|
||||
jr nc, .asm_38415
|
||||
inc a
|
||||
ld [hl], a
|
||||
ld [$d1ef], a
|
||||
.asm_38415
|
||||
inc hl
|
||||
ld a, [hld]
|
||||
ld b, a
|
||||
ld de, EnemyMonMaxHP + 1 ; $d219
|
||||
ld a, [de]
|
||||
dec de
|
||||
ld [Buffer1], a ; $d1ea (aliases: MagikarpLength)
|
||||
sub b
|
||||
ld a, [hli]
|
||||
ld b, a
|
||||
ld a, [de]
|
||||
ld [Buffer2], a ; $d1eb (aliases: MovementType)
|
||||
sbc b
|
||||
jr nc, asm_38436
|
||||
inc de
|
||||
ld a, [de]
|
||||
dec de
|
||||
ld [hld], a
|
||||
ld [$d1ee], a
|
||||
ld a, [de]
|
||||
ld [hl], a
|
||||
ld [$d1ef], a
|
||||
asm_38436: ; 38436 (e:4436)
|
||||
call Function38571
|
||||
hlcoord 2, 2
|
||||
xor a
|
||||
ld [$d10a], a
|
||||
call Function3839a
|
||||
predef Functionc6e0
|
||||
jp Function38387
|
||||
|
||||
|
||||
Function3844b: ; 3844b
|
||||
ld a, [OTPartyCount]
|
||||
ld c, a
|
||||
ld hl, OTPartyMon1HP
|
||||
ld d, 0
|
||||
.asm_38454
|
||||
ld a, [hli]
|
||||
ld b, a
|
||||
ld a, [hld]
|
||||
or b
|
||||
jr z, .asm_3845b
|
||||
inc d
|
||||
|
||||
.asm_3845b
|
||||
push bc
|
||||
ld bc, PartyMon2 - PartyMon1
|
||||
add hl, bc
|
||||
pop bc
|
||||
dec c
|
||||
jr nz, .asm_38454
|
||||
ld a, d
|
||||
cp $2
|
||||
jp nc, Function3846c
|
||||
and a
|
||||
ret
|
||||
; 3846c
|
||||
|
||||
Function3846c: ; 3846c
|
||||
ld a, $1
|
||||
ld [$c711], a
|
||||
ld [$c70f], a
|
||||
ld hl, EnemySubStatus4
|
||||
res SUBSTATUS_RAGE, [hl]
|
||||
xor a
|
||||
ld [hBattleTurn], a
|
||||
callab Function3dc5b
|
||||
push af
|
||||
ld a, [CurOTMon]
|
||||
ld hl, OTPartyMon1Status
|
||||
ld bc, PartyMon2 - PartyMon1
|
||||
call AddNTimes
|
||||
ld d, h
|
||||
ld e, l
|
||||
ld hl, EnemyMonStatus
|
||||
ld bc, $0004
|
||||
call CopyBytes
|
||||
pop af
|
||||
jr c, .asm_384a3
|
||||
ld hl, UnknownText_0x384d0
|
||||
call PrintText
|
||||
|
||||
.asm_384a3
|
||||
ld a, $1
|
||||
ld [$d264], a
|
||||
callab NewEnemyMonStatus
|
||||
callab ResetEnemyStatLevels
|
||||
ld hl, PlayerSubStatus1
|
||||
res SUBSTATUS_IN_LOVE, [hl]
|
||||
callba Function3d4e1
|
||||
callba Function3d57a
|
||||
xor a
|
||||
ld [$d264], a
|
||||
ld a, [InLinkBattle]
|
||||
and a
|
||||
ret nz
|
||||
scf
|
||||
ret
|
||||
; 384d0
|
||||
|
||||
UnknownText_0x384d0: ; 384d0
|
||||
text_jump UnknownText_0x1bcf9c
|
||||
db "@"
|
||||
; 384d5
|
||||
|
||||
Function384d5: ; 384d5
|
||||
call Function3839a
|
||||
call Function384e0
|
||||
ld a, X_SPEED
|
||||
jp Function38568
|
||||
; 384e0
|
||||
|
||||
Function384e0: ; 384e0
|
||||
ld a, [CurOTMon]
|
||||
ld hl, OTPartyMon1Status
|
||||
ld bc, PartyMon2 - PartyMon1
|
||||
call AddNTimes
|
||||
xor a
|
||||
ld [hl], a
|
||||
ld [EnemyMonStatus], a
|
||||
ld hl, EnemySubStatus5
|
||||
res SUBSTATUS_TOXIC, [hl]
|
||||
ret
|
||||
; 384f7
|
||||
|
||||
Function384f7: ; 384f7
|
||||
call Function3839a
|
||||
ld hl, EnemySubStatus4
|
||||
set SUBSTATUS_UNLEASH, [hl]
|
||||
ld a, X_ACCURACY
|
||||
jp Function38568
|
||||
; 38504
|
||||
|
||||
Function38504: ; 38504
|
||||
call Function3839a
|
||||
ld hl, EnemySubStatus4
|
||||
set SUBSTATUS_MIST, [hl]
|
||||
ld a, GUARD_SPEC
|
||||
jp Function38568
|
||||
; 38511
|
||||
|
||||
Function38511: ; 38511
|
||||
call Function3839a
|
||||
ld hl, EnemySubStatus4
|
||||
set SUBSTATUS_FOCUS_ENERGY, [hl]
|
||||
ld a, DIRE_HIT
|
||||
jp Function38568
|
||||
; 3851e
|
||||
|
||||
Function3851e: ; 3851e
|
||||
ld [hMultiplier], a
|
||||
ld hl, EnemyMonMaxHP
|
||||
ld a, [hli]
|
||||
ld [hProduct], a
|
||||
ld a, [hl]
|
||||
ld [hMultiplicand], a
|
||||
ld b, $2
|
||||
call Divide
|
||||
ld a, [$ffb6]
|
||||
ld c, a
|
||||
ld a, [$ffb5]
|
||||
ld b, a
|
||||
ld hl, EnemyMonHP + 1
|
||||
ld a, [hld]
|
||||
ld e, a
|
||||
ld a, [hl]
|
||||
ld d, a
|
||||
ld a, d
|
||||
sub b
|
||||
ret nz
|
||||
ld a, e
|
||||
sub c
|
||||
ret
|
||||
; 38541
|
||||
|
||||
Function38541: ; 38541
|
||||
ld b, ATTACK
|
||||
ld a, X_ATTACK
|
||||
jr Function38557
|
||||
; 38547
|
||||
|
||||
Function38547: ; 38547
|
||||
ld b, DEFENSE
|
||||
ld a, X_DEFEND
|
||||
jr Function38557
|
||||
; 3854d
|
||||
|
||||
Function3854d: ; 3854d
|
||||
ld b, SPEED
|
||||
ld a, X_SPEED
|
||||
jr Function38557
|
||||
; 38553
|
||||
|
||||
Function38553: ; 38553
|
||||
ld b, SP_ATTACK
|
||||
ld a, X_SPECIAL
|
||||
|
||||
Function38557
|
||||
ld [$d1f1], a
|
||||
push bc
|
||||
call Function38571
|
||||
pop bc
|
||||
callba Function361ef
|
||||
jp Function38387
|
||||
; 38568
|
||||
|
||||
|
||||
Function38568: ; 38568
|
||||
ld [$d1f1], a
|
||||
call Function38571
|
||||
jp Function38387
|
||||
; 38571
|
||||
|
||||
Function38571: ; 38571
|
||||
ld a, [$d1f1]
|
||||
ld [$d265], a
|
||||
call GetItemName
|
||||
ld hl, StringBuffer1
|
||||
ld de, $d050
|
||||
ld bc, $000d
|
||||
call CopyBytes
|
||||
ld hl, UnknownText_0x3858c
|
||||
jp PrintText
|
||||
; 3858c
|
||||
|
||||
UnknownText_0x3858c: ; 3858c
|
||||
text_jump UnknownText_0x1bcfaf
|
||||
db "@"
|
||||
; 38591
|
File diff suppressed because it is too large
Load Diff
@ -954,22 +954,18 @@ BattleAnimCmd_DC: ; cc5dc (33:45dc)
|
||||
ld a, [TempBattleMonSpecies] ; $d205
|
||||
ld [CurPartySpecies], a ; $d108
|
||||
ld hl, BattleMonDVs ; $c632
|
||||
ld a, PREDEF_GET_UNOWN_LETTER
|
||||
call Predef
|
||||
predef GetUnownLetter
|
||||
ld de, $8000
|
||||
ld a, $3c
|
||||
call Predef
|
||||
predef GetFrontpic
|
||||
jr .done
|
||||
|
||||
.player
|
||||
ld a, [TempEnemyMonSpecies] ; $d204
|
||||
ld [CurPartySpecies], a ; $d108
|
||||
ld hl, EnemyMonDVs ; $d20c
|
||||
ld a, PREDEF_GET_UNOWN_LETTER
|
||||
call Predef
|
||||
predef GetUnownLetter
|
||||
ld de, $8000
|
||||
ld a, $3d
|
||||
call Predef
|
||||
predef GetBackpic
|
||||
|
||||
.done
|
||||
pop af
|
||||
@ -1194,20 +1190,16 @@ BattleAnimCmd_E6: ; cc776 (33:4776)
|
||||
jr z, .player
|
||||
|
||||
ld hl, BattleMonDVs ; $c632
|
||||
ld a, PREDEF_GET_UNOWN_LETTER
|
||||
call Predef
|
||||
predef GetUnownLetter
|
||||
ld de, $9000
|
||||
ld a, $3c
|
||||
call Predef
|
||||
predef GetFrontpic
|
||||
jr .done
|
||||
|
||||
.player
|
||||
ld hl, EnemyMonDVs ; $d20c
|
||||
ld a, PREDEF_GET_UNOWN_LETTER
|
||||
call Predef
|
||||
predef GetUnownLetter
|
||||
ld de, $9310
|
||||
ld a, $3d
|
||||
call Predef
|
||||
predef GetBackpic
|
||||
|
||||
.done
|
||||
pop af
|
||||
|
1699
battle/core.asm
1699
battle/core.asm
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -66,11 +66,11 @@ BattleCommand54: ; 37588
|
||||
jr nz, .failed
|
||||
|
||||
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
||||
call _GetBattleVar
|
||||
bit 1, [hl]
|
||||
call GetBattleVarAddr
|
||||
bit SUBSTATUS_CURSE, [hl]
|
||||
jr nz, .failed
|
||||
|
||||
set 1, [hl]
|
||||
set SUBSTATUS_CURSE, [hl]
|
||||
call AnimateCurrentMove
|
||||
ld hl, GetHalfMaxHP
|
||||
call CallBattleCore
|
||||
|
@ -7,7 +7,7 @@ BattleCommand5a: ; 3766f
|
||||
ret c
|
||||
|
||||
ld a, BATTLE_VARS_SUBSTATUS1
|
||||
call _GetBattleVar
|
||||
call GetBattleVarAddr
|
||||
set SUBSTATUS_ENDURE, [hl]
|
||||
|
||||
call AnimateCurrentMove
|
||||
|
@ -9,7 +9,7 @@ BattleCommand57: ; 376a0
|
||||
jr nz, .failed
|
||||
|
||||
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
||||
call _GetBattleVar
|
||||
call GetBattleVarAddr
|
||||
bit SUBSTATUS_IDENTIFIED, [hl]
|
||||
jr nz, .failed
|
||||
|
||||
|
@ -36,7 +36,7 @@ BattleCommand34: ; 37418
|
||||
|
||||
|
||||
ld a, BATTLE_VARS_MOVE
|
||||
call _GetBattleVar
|
||||
call GetBattleVarAddr
|
||||
ld [hl], b
|
||||
call UpdateMoveData
|
||||
jp ResetTurn
|
||||
|
@ -4,7 +4,7 @@ BattleCommand1b: ; 373c9
|
||||
call Function372d8
|
||||
|
||||
ld a, BATTLE_VARS_MOVE
|
||||
call _GetBattleVar
|
||||
call GetBattleVarAddr
|
||||
|
||||
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
|
||||
call GetBattleVar
|
||||
@ -28,7 +28,7 @@ BattleCommand1b: ; 373c9
|
||||
|
||||
push af
|
||||
ld a, BATTLE_VARS_MOVE_ANIM
|
||||
call _GetBattleVar
|
||||
call GetBattleVarAddr
|
||||
ld d, h
|
||||
ld e, l
|
||||
pop af
|
||||
|
@ -14,14 +14,14 @@ BattleCommand52: ; 37536
|
||||
; Only works on a sleeping opponent.
|
||||
|
||||
ld a, BATTLE_VARS_STATUS_OPP
|
||||
call _GetBattleVar
|
||||
call GetBattleVarAddr
|
||||
and SLP
|
||||
jr z, .failed
|
||||
|
||||
; Bail if the opponent is already having a nightmare.
|
||||
|
||||
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
||||
call _GetBattleVar
|
||||
call GetBattleVarAddr
|
||||
bit SUBSTATUS_NIGHTMARE, [hl]
|
||||
jr nz, .failed
|
||||
|
||||
|
@ -4,7 +4,7 @@ BattleCommand55: ; 37618
|
||||
ret c
|
||||
|
||||
ld a, BATTLE_VARS_SUBSTATUS1
|
||||
call _GetBattleVar
|
||||
call GetBattleVarAddr
|
||||
set SUBSTATUS_PROTECT, [hl]
|
||||
|
||||
call AnimateCurrentMove
|
||||
|
@ -1,22 +1,24 @@
|
||||
MAX_ROLLOUT_COUNT EQU 5
|
||||
|
||||
|
||||
BattleCommand5b: ; 37718
|
||||
; checkcurl
|
||||
|
||||
ld de, PlayerRolloutCount
|
||||
ld a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .asm_37723
|
||||
jr z, .ok
|
||||
ld de, EnemyRolloutCount
|
||||
|
||||
.asm_37723
|
||||
.ok
|
||||
ld a, BATTLE_VARS_SUBSTATUS1
|
||||
call GetBattleVar
|
||||
bit SUBSTATUS_ENCORED, a
|
||||
jr z, .asm_37731
|
||||
bit SUBSTATUS_ROLLOUT, a
|
||||
jr z, .reset
|
||||
|
||||
ld b, $4 ; doturn
|
||||
jp SkipToBattleCommand
|
||||
|
||||
.asm_37731
|
||||
.reset
|
||||
xor a
|
||||
ld [de], a
|
||||
ret
|
||||
@ -28,7 +30,7 @@ BattleCommand5c: ; 37734
|
||||
|
||||
ld a, BATTLE_VARS_STATUS
|
||||
call GetBattleVar
|
||||
and 7
|
||||
and SLP
|
||||
ret nz
|
||||
|
||||
ld hl, PlayerRolloutCount
|
||||
@ -50,7 +52,7 @@ BattleCommand5c: ; 37734
|
||||
jr z, .hit
|
||||
|
||||
ld a, BATTLE_VARS_SUBSTATUS1
|
||||
call _GetBattleVar
|
||||
call GetBattleVarAddr
|
||||
res 6, [hl]
|
||||
ret
|
||||
|
||||
@ -58,23 +60,23 @@ BattleCommand5c: ; 37734
|
||||
inc [hl]
|
||||
ld a, [hl]
|
||||
ld b, a
|
||||
cp $5
|
||||
cp MAX_ROLLOUT_COUNT
|
||||
jr c, .asm_3776e
|
||||
|
||||
ld a, BATTLE_VARS_SUBSTATUS1
|
||||
call _GetBattleVar
|
||||
res 6, [hl]
|
||||
call GetBattleVarAddr
|
||||
res SUBSTATUS_ROLLOUT, [hl]
|
||||
jr .asm_37775
|
||||
|
||||
.asm_3776e
|
||||
ld a, BATTLE_VARS_SUBSTATUS1
|
||||
call _GetBattleVar
|
||||
set 6, [hl]
|
||||
call GetBattleVarAddr
|
||||
set SUBSTATUS_ROLLOUT, [hl]
|
||||
|
||||
.asm_37775
|
||||
ld a, BATTLE_VARS_SUBSTATUS2
|
||||
call GetBattleVar
|
||||
bit 0, a
|
||||
bit SUBSTATUS_CURLED, a
|
||||
jr z, .asm_3777f
|
||||
inc b
|
||||
.asm_3777f
|
||||
|
@ -96,7 +96,7 @@ HiddenPowerDamage: ; fbced
|
||||
; Overwrite the current move type.
|
||||
push af
|
||||
ld a, BATTLE_VARS_MOVE_TYPE
|
||||
call _GetBattleVar
|
||||
call GetBattleVarAddr
|
||||
pop af
|
||||
ld [hl], a
|
||||
|
||||
|
@ -1,22 +1,17 @@
|
||||
Moves: ; 41afb
|
||||
|
||||
; Characteristics of each move
|
||||
|
||||
; animation, effect, power, type, accuracy, PP, effect chance
|
||||
; Characteristics of each move.
|
||||
|
||||
move: MACRO
|
||||
db \1 ; animation
|
||||
db \2 ; effect
|
||||
db \3 ; power
|
||||
db \4 ; type
|
||||
db \5 * $ff / 100 ; accuracy (percent)
|
||||
db \5 percent ; accuracy
|
||||
db \6 ; pp
|
||||
db \7 * $ff / 100 ; effect chance (percent)
|
||||
db \7 percent ; effect chance
|
||||
ENDM
|
||||
|
||||
Move1:
|
||||
move POUND, EFFECT_NORMAL_HIT, 40, NORMAL, 100, 35, 0
|
||||
Move2:
|
||||
move KARATE_CHOP, EFFECT_NORMAL_HIT, 50, FIGHTING, 100, 25, 0
|
||||
move DOUBLESLAP, EFFECT_MULTI_HIT, 15, NORMAL, 85, 10, 0
|
||||
move COMET_PUNCH, EFFECT_MULTI_HIT, 18, NORMAL, 85, 15, 0
|
||||
|
@ -1,6 +1,8 @@
|
||||
MAX_LEVEL EQU 100
|
||||
NUM_MOVES EQU 4
|
||||
|
||||
REST_TURNS EQU 2
|
||||
|
||||
ATTACK EQU 0
|
||||
DEFENSE EQU 1
|
||||
SPEED EQU 2
|
||||
@ -44,9 +46,12 @@ BATTLETYPE_CANLOSE EQU $01
|
||||
BATTLETYPE_TUTORIAL EQU $03
|
||||
BATTLETYPE_FISH EQU $04
|
||||
BATTLETYPE_ROAMING EQU $05
|
||||
BATTLETYPE_CONTEST EQU $06
|
||||
BATTLETYPE_SHINY EQU $07
|
||||
BATTLETYPE_TREE EQU $08
|
||||
BATTLETYPE_TRAP EQU $09
|
||||
BATTLETYPE_FORCEITEM EQU $0a
|
||||
BATTLETYPE_CELEBI EQU $0b
|
||||
BATTLETYPE_SUICUNE EQU $0c
|
||||
|
||||
; battle variables
|
||||
@ -81,7 +86,7 @@ PAR EQU 6
|
||||
|
||||
; substatus
|
||||
SUBSTATUS_IN_LOVE EQU 7
|
||||
SUBSTATUS_ENCORED EQU 6
|
||||
SUBSTATUS_ROLLOUT EQU 6
|
||||
SUBSTATUS_ENDURE EQU 5
|
||||
SUBSTATUS_PERISH EQU 4
|
||||
SUBSTATUS_IDENTIFIED EQU 3
|
||||
@ -96,7 +101,8 @@ SUBSTATUS_FLYING EQU 6
|
||||
SUBSTATUS_UNDERGROUND EQU 5
|
||||
SUBSTATUS_CHARGED EQU 4
|
||||
SUBSTATUS_FLINCHED EQU 3
|
||||
SUBSTATUS_ROLLOUT EQU 1
|
||||
SUBSTATUS_IN_LOOP EQU 2
|
||||
SUBSTATUS_RAMPAGE EQU 1
|
||||
SUBSTATUS_BIDE EQU 0
|
||||
|
||||
SUBSTATUS_LEECH_SEED EQU 7
|
||||
@ -110,6 +116,8 @@ SUBSTATUS_UNLEASH EQU 0
|
||||
SUBSTATUS_CANT_RUN EQU 7
|
||||
SUBSTATUS_DESTINY_BOND EQU 6
|
||||
SUBSTATUS_LOCK_ON EQU 5
|
||||
SUBSTATUS_ENCORED EQU 4
|
||||
SUBSTATUS_TRANSFORMED EQU 3
|
||||
SUBSTATUS_TOXIC EQU 0
|
||||
|
||||
; environmental
|
||||
@ -119,6 +127,7 @@ SCREENS_SAFEGUARD EQU 2
|
||||
SCREENS_SPIKES EQU 0
|
||||
|
||||
; weather
|
||||
WEATHER_NONE EQU 0
|
||||
WEATHER_RAIN EQU 1
|
||||
WEATHER_SUN EQU 2
|
||||
WEATHER_SANDSTORM EQU 3
|
||||
|
@ -267,6 +267,7 @@ HELD_BERRY EQU $01
|
||||
HELD_LEFTOVERS EQU $03
|
||||
HELD_RESTORE_PP EQU $06
|
||||
HELD_CLEANSE_TAG EQU $08
|
||||
|
||||
HELD_HEAL_POISON EQU $0a
|
||||
HELD_HEAL_FREEZE EQU $0b
|
||||
HELD_HEAL_BURN EQU $0c
|
||||
@ -274,7 +275,24 @@ HELD_HEAL_SLEEP EQU $0d
|
||||
HELD_HEAL_PARALYZE EQU $0e
|
||||
HELD_HEAL_STATUS EQU $0f
|
||||
HELD_HEAL_CONFUSION EQU $10
|
||||
|
||||
HELD_PREVENT_POISON EQU $14
|
||||
HELD_PREVENT_BURN EQU $15
|
||||
HELD_PREVENT_FREEZE EQU $16
|
||||
HELD_PREVENT_SLEEP EQU $17
|
||||
HELD_PREVENT_PARALYZE EQU $18
|
||||
HELD_PREVENT_CONFUSE EQU $19
|
||||
|
||||
HELD_ATTACK_UP EQU $1f
|
||||
HELD_DEFENSE_UP EQU $20
|
||||
HELD_SPEED_UP EQU $21
|
||||
HELD_SP_ATTACK_UP EQU $22
|
||||
HELD_SP_DEFENSE_UP EQU $23
|
||||
HELD_ACCURACY_UP EQU $24
|
||||
HELD_EVASION_UP EQU $25
|
||||
|
||||
HELD_METAL_POWDER EQU $2a
|
||||
|
||||
HELD_NORMAL_BOOST EQU $32
|
||||
HELD_FIGHTING_BOOST EQU $33
|
||||
HELD_FLYING_BOOST EQU $34
|
||||
@ -292,6 +310,7 @@ HELD_ICE_BOOST EQU $3f
|
||||
HELD_DRAGON_BOOST EQU $40
|
||||
HELD_DARK_BOOST EQU $41
|
||||
HELD_STEEL_BOOST EQU $42
|
||||
|
||||
HELD_ESCAPE EQU $48
|
||||
HELD_CRITICAL_UP EQU $49
|
||||
HELD_QUICK_CLAW EQU $4a
|
||||
|
@ -1,40 +1,28 @@
|
||||
PARTY_LENGTH EQU 6
|
||||
|
||||
; strings
|
||||
PLAYER_NAME_LENGTH EQU 8
|
||||
PKMN_NAME_LENGTH EQU 11
|
||||
MOVE_NAME_LENGTH EQU 13
|
||||
NAME_LENGTH EQU 11
|
||||
LV_CHAR EQU $6e
|
||||
|
||||
; GetName types
|
||||
PKMN_NAME EQU 1
|
||||
MOVE_NAME EQU 2
|
||||
ITEM_NAME EQU 4
|
||||
PARTY_OT_NAME EQU 5
|
||||
ENEMY_OT_NAME EQU 6
|
||||
TRAINER_NAME EQU 7
|
||||
|
||||
; hp
|
||||
HP_GREEN EQU 0
|
||||
HP_YELLOW EQU 1
|
||||
HP_RED EQU 2
|
||||
|
||||
; boxes
|
||||
NUM_BOXES EQU 14
|
||||
|
||||
|
||||
; predefs
|
||||
PREDEF_FLAG EQU $03
|
||||
PREDEF_FILLPP EQU $05
|
||||
PREDEF_ADDPARTYMON EQU $06
|
||||
PREDEF_FILLSTATS EQU $0C
|
||||
PREDEF_PRINT_MOVE_DESCRIPTION EQU $11
|
||||
PREDEF_UPDATE_PLAYER_HUD EQU $12
|
||||
PREDEF_FILL_BOX EQU $13
|
||||
PREDEF_UPDATE_ENEMY_HUD EQU $15
|
||||
PREDEF_START_BATTLE EQU $16
|
||||
PREDEF_FILL_IN_EXP_BAR EQU $17
|
||||
PREDEF_FILLMOVES EQU $1B
|
||||
PREDEF_GET_GENDER EQU $24
|
||||
PREDEF_STATS_SCREEN EQU $25
|
||||
PREDEF_DRAW_PLAYER_HP EQU $26
|
||||
PREDEF_DRAW_ENEMY_HP EQU $27
|
||||
PREDEF_GET_TYPE_NAME EQU $29
|
||||
PREDEF_PRINT_MOVE_TYPE EQU $2A
|
||||
PREDEF_PRINT_TYPE EQU $2B
|
||||
PREDEF_GET_UNOWN_LETTER EQU $2D
|
||||
PREDEF_LOAD_SGB_LAYOUT EQU $31
|
||||
PREDEF_CHECK_CONTEST_MON EQU $33
|
||||
PREDEF_BATTLE_TRANSITION EQU $34
|
||||
PREDEF_PARTYMON_ITEM_NAME EQU $3B
|
||||
PREDEF_DECOMPRESS EQU $40
|
||||
MONS_PER_BOX EQU 20
|
||||
NUM_BOXES EQU 14
|
||||
|
||||
|
||||
; flag manipulation
|
||||
@ -60,9 +48,9 @@ D_DOWN EQU %10000000
|
||||
|
||||
; screen
|
||||
HP_BAR_LENGTH EQU 6
|
||||
HP_BAR_LENGTH_PX EQU 48
|
||||
HP_BAR_LENGTH_PX EQU HP_BAR_LENGTH * 8
|
||||
EXP_BAR_LENGTH EQU 8
|
||||
EXP_BAR_LENGTH_PX EQU 64
|
||||
EXP_BAR_LENGTH_PX EQU EXP_BAR_LENGTH * 8
|
||||
|
||||
SCREEN_WIDTH EQU 20
|
||||
SCREEN_HEIGHT EQU 18
|
||||
|
@ -25,7 +25,7 @@ UNUSED_TYPES EQU const_value
|
||||
const TYPE_17
|
||||
const TYPE_18
|
||||
const CURSE_T
|
||||
|
||||
UNUSED_TYPES_END EQU const_value
|
||||
|
||||
SPECIAL EQU const_value
|
||||
const FIRE
|
||||
@ -37,3 +37,4 @@ SPECIAL EQU const_value
|
||||
const DRAGON
|
||||
const DARK
|
||||
|
||||
TYPES_END EQU const_value
|
||||
|
@ -70,9 +70,11 @@ Function1f8000: ; 1f8000
|
||||
|
||||
Function1f8081: ; 1f8081
|
||||
ld c, $3
|
||||
.loop
|
||||
push bc
|
||||
ld a, $1
|
||||
call GetSRAMBank
|
||||
|
||||
.asm_1f8089
|
||||
ld a, [$d800]
|
||||
dec a
|
||||
@ -150,14 +152,15 @@ Function1f8081: ; 1f8081
|
||||
ld h, d
|
||||
ld l, e
|
||||
pop de
|
||||
ld bc, $000b
|
||||
ld bc, PKMN_NAME_LENGTH
|
||||
call CopyBytes
|
||||
pop de
|
||||
pop af
|
||||
ld [$d265], a
|
||||
pop bc
|
||||
dec c
|
||||
jp nz, $4083
|
||||
jp nz, .loop
|
||||
|
||||
ld a, [$be51]
|
||||
ld [$be54], a
|
||||
ld a, [$be52]
|
||||
|
@ -35,7 +35,7 @@ GiveOddEgg: ; 1fb4b6
|
||||
ld hl, OddEggs
|
||||
ld a, OddEgg2 - OddEgg1
|
||||
call AddNTimes
|
||||
ld de, EnemyMoveAnimation
|
||||
ld de, $c608
|
||||
ld bc, $0046
|
||||
call CopyBytes
|
||||
ld a, EGG_TICKET
|
||||
|
@ -9,13 +9,13 @@
|
||||
dwb $d957, %00001000 ; expn card
|
||||
dwb $d957, %10000000 ; on/off
|
||||
|
||||
; DaycareMan, %10000000 ; daycare 1 on
|
||||
dwb DaycareMan, %01000000 ; monster 1 and 2 are compatible
|
||||
; DaycareMan, %00100000 ; egg is ready
|
||||
dwb DaycareMan, %00000001 ; monster 1 in daycare
|
||||
; wDaycareMan, %10000000 ; daycare 1 on
|
||||
dwb wDaycareMan, %01000000 ; monster 1 and 2 are compatible
|
||||
; wDaycareMan, %00100000 ; egg is ready
|
||||
dwb wDaycareMan, %00000001 ; monster 1 in daycare
|
||||
|
||||
; DaycareLady, %10000000 = daycare 2 on
|
||||
dwb DaycareLady, %00000001 ; monster 2 in daycare
|
||||
; wDaycareLady, %10000000 = daycare 2 on
|
||||
dwb wDaycareLady, %00000001 ; monster 2 in daycare
|
||||
|
||||
dwb $d854, %00000001 ; mom saving money ; $8
|
||||
dwb $d854, %10000000 ; dst
|
||||
|
@ -1531,8 +1531,7 @@ Script_startbattle: ; 0x97436
|
||||
; script command 0x5f
|
||||
|
||||
call Function2879
|
||||
ld a, PREDEF_START_BATTLE
|
||||
call Predef
|
||||
predef StartBattle
|
||||
ld a, [$d0ee]
|
||||
and $3f
|
||||
ld [ScriptVar], a
|
||||
@ -1545,7 +1544,7 @@ Script_catchtutorial: ; 0x97447
|
||||
; byte (SingleByteParam)
|
||||
|
||||
call GetScriptByte
|
||||
ld [$d230], a
|
||||
ld [BattleType], a
|
||||
call Function2879
|
||||
callba Function4e554
|
||||
jp Script_reloadmap
|
||||
@ -1573,8 +1572,8 @@ Script_returnafterbattle: ; 0x97459
|
||||
ld a, [$d0ee]
|
||||
bit 7, a
|
||||
jr z, .asm_9748e ; 0x97481 $b
|
||||
ld b, $24
|
||||
ld de, $4255
|
||||
ld b, BANK(UnknownScript_0x90255)
|
||||
ld de, UnknownScript_0x90255
|
||||
callba Function97c4f
|
||||
.asm_9748e
|
||||
jp Script_reloadmap
|
||||
@ -2659,7 +2658,7 @@ Script_giveegg: ; 0x97968
|
||||
ld [CurPartySpecies], a
|
||||
call GetScriptByte
|
||||
ld [CurPartyLevel], a
|
||||
callba Functiondf8c
|
||||
callba GiveEgg
|
||||
ret nc
|
||||
ld a, $2
|
||||
ld [ScriptVar], a
|
||||
|
@ -51,8 +51,8 @@ SpecialDratini: ; 0x8b170
|
||||
|
||||
; get the PP of the new move
|
||||
dec a
|
||||
ld hl, Moves + PlayerMovePP - PlayerMoveStruct
|
||||
ld bc, Move2 - Move1
|
||||
ld hl, Moves + MOVE_PP
|
||||
ld bc, MOVE_LENGTH
|
||||
call AddNTimes
|
||||
ld a, BANK(Moves)
|
||||
call GetFarByte
|
||||
|
@ -34,7 +34,7 @@ NameRater: ; fb6ed
|
||||
call Functionfb7d3
|
||||
ld hl, UnknownText_0xfb837
|
||||
jr c, .asm_fb76c
|
||||
ld hl, PartyMon1Nickname
|
||||
ld hl, PartyMonNicknames
|
||||
ld bc, $000b
|
||||
ld a, [CurPartyMon]
|
||||
call AddNTimes
|
||||
@ -70,12 +70,12 @@ NameRater: ; fb6ed
|
||||
; fb78a
|
||||
|
||||
Functionfb78a: ; fb78a
|
||||
ld hl, PartyMon1OT
|
||||
ld bc, $000b
|
||||
ld hl, PartyMonOT
|
||||
ld bc, NAME_LENGTH
|
||||
ld a, [CurPartyMon]
|
||||
call AddNTimes
|
||||
ld de, PlayerName
|
||||
ld c, $b
|
||||
ld c, NAME_LENGTH
|
||||
call .asm_fb7b1
|
||||
jr c, .asm_fb7bc
|
||||
ld hl, PartyMon1ID
|
||||
@ -122,7 +122,7 @@ Functionfb7be: ; fb7be
|
||||
; fb7d3
|
||||
|
||||
Functionfb7d3: ; fb7d3
|
||||
ld hl, PartyMon1Nickname
|
||||
ld hl, PartyMonNicknames
|
||||
ld bc, $000b
|
||||
ld a, [CurPartyMon]
|
||||
call AddNTimes
|
||||
|
@ -139,7 +139,7 @@ ReadCaughtData: ; 4f134
|
||||
|
||||
GetCaughtName: ; 4f176
|
||||
ld a, [CurPartyMon]
|
||||
ld hl, PartyMon1Nickname
|
||||
ld hl, PartyMonNicknames
|
||||
ld bc, PKMN_NAME_LENGTH
|
||||
call AddNTimes
|
||||
ld de, $d003
|
||||
@ -258,8 +258,8 @@ GetCaughtLocation: ; 4f20a
|
||||
|
||||
GetCaughtOT: ; 4f242
|
||||
ld a, [CurPartyMon]
|
||||
ld hl, PartyMon1OT
|
||||
ld bc, $000b
|
||||
ld hl, PartyMonOT
|
||||
ld bc, NAME_LENGTH
|
||||
call AddNTimes
|
||||
ld de, $d02a
|
||||
ld bc, $000b
|
||||
|
@ -1007,8 +1007,7 @@ Functiond066e: ; d066e
|
||||
push bc
|
||||
push hl
|
||||
ld de, VTiles2
|
||||
ld a, $3e
|
||||
call Predef
|
||||
predef Function5108b
|
||||
pop hl
|
||||
pop bc
|
||||
ld d, $0
|
||||
|
24
home.asm
24
home.asm
@ -753,15 +753,14 @@ GetSGBLayout:: ; 3340
|
||||
|
||||
ld a, [hCGB]
|
||||
and a
|
||||
jr nz, .dosgb
|
||||
jr nz, .sgb
|
||||
|
||||
ld a, [hSGB]
|
||||
and a
|
||||
ret z
|
||||
|
||||
.dosgb
|
||||
ld a, $31 ; LoadSGBLayout
|
||||
jp Predef
|
||||
.sgb
|
||||
predef_jump Function864c ; LoadSGBLayout
|
||||
; 334e
|
||||
|
||||
|
||||
@ -776,7 +775,7 @@ SetHPPal:: ; 334e
|
||||
GetHPPal:: ; 3353
|
||||
; Get palette for hp bar pixel length e in d.
|
||||
|
||||
ld d, 0 ; green
|
||||
ld d, HP_GREEN
|
||||
ld a, e
|
||||
cp 24
|
||||
ret nc
|
||||
@ -1583,7 +1582,7 @@ Function36f5:: ; 36f5
|
||||
|
||||
Function3718:: ; 3718
|
||||
ld a, [BattleType]
|
||||
cp $1
|
||||
cp BATTLETYPE_CANLOSE
|
||||
jr .asm_3724
|
||||
|
||||
ld hl, WalkingTile
|
||||
@ -1697,22 +1696,21 @@ Function3786:: ; 3786
|
||||
Function378b:: ; 378b
|
||||
ld a, [CurPartySpecies]
|
||||
call IsAPokemon
|
||||
jr c, .asm_37ad
|
||||
jr c, .not_pokemon
|
||||
|
||||
push hl
|
||||
ld de, VTiles2
|
||||
ld a, $3c
|
||||
call Predef
|
||||
predef GetFrontpic
|
||||
pop hl
|
||||
xor a
|
||||
ld [$ffad], a
|
||||
ld bc, $0707
|
||||
ld a, $13
|
||||
call Predef
|
||||
lb bc, 7, 7
|
||||
predef FillBox
|
||||
xor a
|
||||
ld [$c2c6], a
|
||||
ret
|
||||
|
||||
.asm_37ad
|
||||
.not_pokemon
|
||||
xor a
|
||||
ld [$c2c6], a
|
||||
inc a
|
||||
|
@ -130,8 +130,8 @@ RefreshBattleHuds:: ; 39c9
|
||||
; 39d4
|
||||
|
||||
UpdateBattleHuds:: ; 39d4
|
||||
callba Function3df48
|
||||
callba Function3e036
|
||||
callba UpdatePlayerHUD
|
||||
callba UpdateEnemyHUD
|
||||
ret
|
||||
; 39e1
|
||||
|
||||
@ -139,12 +139,12 @@ UpdateBattleHuds:: ; 39d4
|
||||
GetBattleVar:: ; 39e1
|
||||
; Preserves hl.
|
||||
push hl
|
||||
call _GetBattleVar
|
||||
call GetBattleVarAddr
|
||||
pop hl
|
||||
ret
|
||||
; 39e7
|
||||
|
||||
_GetBattleVar:: ; 39e7
|
||||
GetBattleVarAddr:: ; 39e7
|
||||
; Get variable from pair a, depending on whose turn it is.
|
||||
; There are 21 variable pairs.
|
||||
|
||||
@ -250,10 +250,10 @@ _GetBattleVar:: ; 39e7
|
||||
dw PlayerSubStatus4, EnemySubStatus4
|
||||
dw PlayerSubStatus5, EnemySubStatus5
|
||||
dw BattleMonStatus, EnemyMonStatus
|
||||
dw PlayerMoveAnimation, EnemyMoveAnimation
|
||||
dw PlayerMoveEffect, EnemyMoveEffect
|
||||
dw PlayerMovePower, EnemyMovePower
|
||||
dw PlayerMoveType, EnemyMoveType
|
||||
dw wPlayerMoveStruct + MOVE_ANIM, wEnemyMoveStruct + MOVE_ANIM
|
||||
dw wPlayerMoveStruct + MOVE_EFFECT, wEnemyMoveStruct + MOVE_EFFECT
|
||||
dw wPlayerMoveStruct + MOVE_POWER, wEnemyMoveStruct + MOVE_POWER
|
||||
dw wPlayerMoveStruct + MOVE_TYPE, wEnemyMoveStruct + MOVE_TYPE
|
||||
dw CurPlayerMove, CurEnemyMove
|
||||
dw LastEnemyCounterMove, LastPlayerCounterMove
|
||||
dw LastPlayerMove, LastEnemyMove
|
||||
|
@ -167,8 +167,7 @@ Init:: ; 17d
|
||||
|
||||
call DelayFrame
|
||||
|
||||
ld a, $30
|
||||
call Predef
|
||||
predef Function9853
|
||||
|
||||
call SoundRestart
|
||||
xor a
|
||||
|
@ -120,7 +120,7 @@ Function2198:: ; 2198
|
||||
ld e, a
|
||||
ld a, [$d195]
|
||||
ld d, a
|
||||
ld hl, EnemyMoveAnimation
|
||||
ld hl, $c608
|
||||
ld b, $5
|
||||
|
||||
.asm_21a5
|
||||
|
@ -454,7 +454,7 @@ Function19e9:: ; 19e9
|
||||
Function1a13:: ; 1a13
|
||||
push bc
|
||||
push de
|
||||
ld hl, $d4d6
|
||||
ld hl, ObjectStructs
|
||||
ld de, $0028
|
||||
ld c, $d
|
||||
.asm_1a1d
|
||||
@ -641,7 +641,7 @@ Function1ad2:: ; 1ad2
|
||||
|
||||
Function1ae5:: ; 1ae5
|
||||
ld bc, $0028
|
||||
ld hl, $d4d6
|
||||
ld hl, ObjectStructs
|
||||
call AddNTimes
|
||||
ld b, h
|
||||
ld c, l
|
||||
|
@ -31,8 +31,7 @@ CheckSeenMon:: ; 339b
|
||||
|
||||
PokedexFlagAction:: ; 33a1
|
||||
ld d, 0
|
||||
ld a, PREDEF_FLAG
|
||||
call Predef
|
||||
predef FlagPredef
|
||||
ld a, c
|
||||
and a
|
||||
ret
|
||||
|
@ -8,8 +8,7 @@ GetItemDescription: ; 0x1c8955
|
||||
pop hl
|
||||
ld a, [$d265]
|
||||
ld [$cf60], a
|
||||
ld a, $11
|
||||
call Predef
|
||||
predef PrintMoveDesc
|
||||
ret
|
||||
|
||||
.nomovedesc
|
||||
|
@ -238,10 +238,10 @@ ParkBall: ; e8a2
|
||||
ld a, [EnemyMonCatchRate]
|
||||
ld b, a
|
||||
ld a, [BattleType]
|
||||
cp $3
|
||||
cp BATTLETYPE_TUTORIAL
|
||||
jp z, .asm_e99c
|
||||
ld a, [CurItem]
|
||||
cp $1
|
||||
cp MASTER_BALL
|
||||
jp z, .asm_e99c
|
||||
ld a, [CurItem]
|
||||
ld c, a
|
||||
@ -274,7 +274,7 @@ ParkBall: ; e8a2
|
||||
ld a, b
|
||||
ld [$ffb6], a
|
||||
|
||||
ld hl, EnemyMonHPHi
|
||||
ld hl, EnemyMonHP
|
||||
ld b, [hl]
|
||||
inc hl
|
||||
ld c, [hl]
|
||||
@ -366,7 +366,7 @@ ParkBall: ; e8a2
|
||||
|
||||
.asm_e98e
|
||||
ld b, a
|
||||
ld [MagikarpLength], a
|
||||
ld [Buffer1], a
|
||||
call Random
|
||||
|
||||
cp b
|
||||
@ -399,8 +399,7 @@ ParkBall: ; e8a2
|
||||
ld [hBattleTurn], a
|
||||
ld [Buffer2], a
|
||||
ld [$cfca], a
|
||||
ld a, $37
|
||||
call Predef
|
||||
predef PlayBattleAnim
|
||||
|
||||
ld a, [$c64e]
|
||||
and a
|
||||
@ -449,9 +448,9 @@ ParkBall: ; e8a2
|
||||
.asm_ea1a
|
||||
set 3, [hl]
|
||||
ld hl, $c6f2
|
||||
ld a, [EnemyMonAtkDefDV]
|
||||
ld a, [EnemyMonDVs]
|
||||
ld [hli], a
|
||||
ld a, [EnemyMonSpdSpclDV]
|
||||
ld a, [EnemyMonDVs + 1]
|
||||
ld [hl], a
|
||||
|
||||
.asm_ea27
|
||||
@ -478,13 +477,13 @@ ParkBall: ; e8a2
|
||||
bit 3, [hl]
|
||||
jr nz, .asm_ea67
|
||||
ld hl, $c735
|
||||
ld de, EnemyMonMove1
|
||||
ld bc, $0004
|
||||
ld de, EnemyMonMoves
|
||||
ld bc, NUM_MOVES
|
||||
call CopyBytes
|
||||
|
||||
ld hl, $c739
|
||||
ld de, EnemyMonPPMove1
|
||||
ld bc, $0004
|
||||
ld de, EnemyMonPP
|
||||
ld bc, NUM_MOVES
|
||||
call CopyBytes
|
||||
|
||||
.asm_ea67
|
||||
@ -525,8 +524,7 @@ ParkBall: ; e8a2
|
||||
|
||||
ld a, [EnemyMonSpecies]
|
||||
ld [$d265], a
|
||||
ld a, $43
|
||||
call Predef
|
||||
predef Functionfb877
|
||||
|
||||
.asm_eab7
|
||||
ld a, [BattleType]
|
||||
@ -546,8 +544,7 @@ ParkBall: ; e8a2
|
||||
ld [MonType], a
|
||||
call ClearSprites
|
||||
|
||||
ld a, $6
|
||||
call Predef
|
||||
predef Functiond88c
|
||||
|
||||
callba Function4db49
|
||||
|
||||
@ -579,7 +576,7 @@ ParkBall: ; e8a2
|
||||
ld a, [PartyCount]
|
||||
dec a
|
||||
ld [CurPartyMon], a
|
||||
ld hl, PartyMon1Nickname
|
||||
ld hl, PartyMonNicknames
|
||||
ld bc, PKMN_NAME_LENGTH
|
||||
call AddNTimes
|
||||
|
||||
@ -604,8 +601,7 @@ ParkBall: ; e8a2
|
||||
.asm_eb3c
|
||||
call ClearSprites
|
||||
|
||||
ld a, $9
|
||||
call Predef
|
||||
predef Functionde6e
|
||||
|
||||
callba Function4db83
|
||||
|
||||
@ -1265,8 +1261,7 @@ Functionee8c: ; ee8c
|
||||
ld a, PartyMon1HPExp - 1 - PartyMon1
|
||||
call GetPartyParamLocation
|
||||
ld b, $1
|
||||
ld a, $c
|
||||
jp Predef
|
||||
predef_jump Functione167
|
||||
; ee9f
|
||||
|
||||
Functionee9f: ; ee9f
|
||||
@ -1316,11 +1311,11 @@ Functioneed9: ; eed9
|
||||
; eeeb
|
||||
|
||||
Table_eeeb: ; eeeb
|
||||
db HP_UP, PartyMon1HPExp - PartyMon1StatExp
|
||||
db PROTEIN, PartyMon1AtkExp - PartyMon1StatExp
|
||||
db IRON, PartyMon1DefExp - PartyMon1StatExp
|
||||
db CARBOS, PartyMon1SpdExp - PartyMon1StatExp
|
||||
db CALCIUM, PartyMon1SpclExp - PartyMon1StatExp
|
||||
db HP_UP, PartyMon1HPExp - PartyMon1StatExp
|
||||
db PROTEIN, PartyMon1AtkExp - PartyMon1StatExp
|
||||
db IRON, PartyMon1DefExp - PartyMon1StatExp
|
||||
db CARBOS, PartyMon1SpdExp - PartyMon1StatExp
|
||||
db CALCIUM, PartyMon1SpcExp - PartyMon1StatExp
|
||||
; eef5
|
||||
|
||||
|
||||
@ -1334,7 +1329,7 @@ Functioneef5: ; eef5
|
||||
ld [CurPartyLevel], a
|
||||
call GetBaseData
|
||||
ld a, [CurPartyMon]
|
||||
ld hl, PartyMon1Nickname
|
||||
ld hl, PartyMonNicknames
|
||||
call GetNick
|
||||
ret
|
||||
; 0xef14
|
||||
@ -1405,8 +1400,7 @@ RareCandy: ; ef14
|
||||
|
||||
xor a
|
||||
ld [MonType], a
|
||||
ld a, $1f
|
||||
call Predef
|
||||
predef Function5084a
|
||||
|
||||
hlcoord 9, 0
|
||||
ld b, 10
|
||||
@ -1415,8 +1409,7 @@ RareCandy: ; ef14
|
||||
|
||||
hlcoord 11, 1
|
||||
ld bc, $0004
|
||||
ld a, $28
|
||||
call Predef
|
||||
predef Function50b7b
|
||||
|
||||
call Functiona80
|
||||
|
||||
@ -1424,8 +1417,7 @@ RareCandy: ; ef14
|
||||
ld [MonType], a
|
||||
ld a, [CurPartySpecies]
|
||||
ld [$d265], a
|
||||
ld a, $1a
|
||||
call Predef
|
||||
predef LearnLevelMoves
|
||||
|
||||
xor a
|
||||
ld [$d1e9], a
|
||||
@ -1654,8 +1646,7 @@ Functionf0d6: ; f0d6
|
||||
ld d, 0
|
||||
ld hl, $c6fc
|
||||
ld b, CHECK_FLAG
|
||||
ld a, PREDEF_FLAG
|
||||
call Predef
|
||||
predef FlagPredef
|
||||
ld a, c
|
||||
and a
|
||||
jr z, .asm_f104
|
||||
@ -1664,8 +1655,7 @@ Functionf0d6: ; f0d6
|
||||
ld c, a
|
||||
ld hl, $c664
|
||||
ld b, SET_FLAG
|
||||
ld a, PREDEF_FLAG
|
||||
call Predef
|
||||
predef FlagPredef
|
||||
|
||||
.asm_f104
|
||||
xor a
|
||||
@ -1834,8 +1824,7 @@ Functionf1db: ; f1db (3:71db)
|
||||
call AddNTimes
|
||||
ld a, $2
|
||||
ld [$d10a], a
|
||||
ld a, $b
|
||||
jp Predef
|
||||
predef_jump Functionc6e0
|
||||
|
||||
; known jump sources: ee11 (3:6e11), ee3f (3:6e3f), ef16 (3:6f16), efaf (3:6faf), efce (3:6fce), f0ab (3:70ab), f0ca (3:70ca), f12a (3:712a), f1ab (3:71ab), f5c7 (3:75c7)
|
||||
Functionf1f9: ; f1f9 (3:71f9)
|
||||
@ -2367,10 +2356,10 @@ XSpecial: ; f4c5
|
||||
; f504
|
||||
|
||||
Tablef504: ; f504
|
||||
db X_ATTACK, 0
|
||||
db X_DEFEND, 1
|
||||
db X_SPEED, 2
|
||||
db X_SPECIAL, 3
|
||||
db X_ATTACK, ATTACK
|
||||
db X_DEFEND, DEFENSE
|
||||
db X_SPEED, SPEED
|
||||
db X_SPECIAL, SP_ATTACK
|
||||
; f50c
|
||||
|
||||
|
||||
@ -2378,21 +2367,23 @@ PokeFlute: ; f50c
|
||||
ld a, [IsInBattle]
|
||||
and a
|
||||
jr nz, .asm_f512
|
||||
|
||||
.asm_f512
|
||||
|
||||
xor a
|
||||
ld [$d002], a
|
||||
ld b, $f8
|
||||
|
||||
ld b, $ff ^ SLP
|
||||
|
||||
ld hl, PartyMon1Status
|
||||
call .asm_f554
|
||||
call .Functionf554
|
||||
|
||||
ld a, [IsInBattle]
|
||||
cp $1
|
||||
cp WILD_BATTLE
|
||||
jr z, .asm_f52b
|
||||
ld hl, OTPartyMon1Status
|
||||
call .asm_f554
|
||||
|
||||
call .Functionf554
|
||||
.asm_f52b
|
||||
|
||||
ld hl, BattleMonStatus
|
||||
ld a, [hl]
|
||||
and b
|
||||
@ -2401,6 +2392,7 @@ PokeFlute: ; f50c
|
||||
ld a, [hl]
|
||||
and b
|
||||
ld [hl], a
|
||||
|
||||
ld a, [$d002]
|
||||
and a
|
||||
ld hl, UnknownText_0xf56c
|
||||
@ -2411,31 +2403,29 @@ PokeFlute: ; f50c
|
||||
ld a, [Danger]
|
||||
and $80
|
||||
jr nz, .asm_f54e
|
||||
|
||||
.asm_f54e
|
||||
ld hl, UnknownText_0xf571
|
||||
jp PrintText
|
||||
|
||||
|
||||
.asm_f554
|
||||
ld de, $0030
|
||||
ld c, $6
|
||||
.Functionf554
|
||||
ld de, PartyMon2 - PartyMon1
|
||||
ld c, PARTY_LENGTH
|
||||
|
||||
.asm_f559
|
||||
.loop
|
||||
ld a, [hl]
|
||||
push af
|
||||
and $7
|
||||
and SLP
|
||||
jr z, .asm_f564
|
||||
ld a, $1
|
||||
ld a, 1
|
||||
ld [$d002], a
|
||||
|
||||
.asm_f564
|
||||
pop af
|
||||
and b
|
||||
ld [hl], a
|
||||
add hl, de
|
||||
dec c
|
||||
jr nz, .asm_f559
|
||||
jr nz, .loop
|
||||
ret
|
||||
; f56c
|
||||
|
||||
@ -2633,11 +2623,11 @@ Functionf652: ; f652
|
||||
|
||||
.asm_f677
|
||||
ld a, [CurPartyMon]
|
||||
ld hl, PartyMon1Move1
|
||||
ld bc, $0030
|
||||
ld hl, PartyMon1Moves
|
||||
ld bc, PartyMon2 - PartyMon1
|
||||
call AddNTimes
|
||||
ld de, BattleMonMove1
|
||||
ld b, $4
|
||||
ld de, BattleMonMoves
|
||||
ld b, NUM_MOVES
|
||||
.asm_f688
|
||||
ld a, [de]
|
||||
and a
|
||||
@ -2647,13 +2637,10 @@ Functionf652: ; f652
|
||||
push hl
|
||||
push de
|
||||
push bc
|
||||
rept NUM_MOVES + 2 ; BattleMonPP - BattleMonMoves
|
||||
inc de
|
||||
inc de
|
||||
inc de
|
||||
inc de
|
||||
inc de
|
||||
inc de
|
||||
ld bc, $0015
|
||||
endr
|
||||
ld bc, PartyMon1PP - PartyMon1Moves
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
ld [de], a
|
||||
@ -2682,15 +2669,16 @@ Functionf6af: ; f6af
|
||||
ld hl, $cfa9
|
||||
ld [hli], a
|
||||
ld [hl], a
|
||||
ld b, $4
|
||||
ld b, NUM_MOVES
|
||||
.asm_f6b7
|
||||
push bc
|
||||
ld hl, PartyMon1Move1
|
||||
ld bc, $0030
|
||||
ld hl, PartyMon1Moves
|
||||
ld bc, PartyMon2 - PartyMon1
|
||||
call Functionf963
|
||||
ld a, [hl]
|
||||
and a
|
||||
jr z, .asm_f6ce
|
||||
|
||||
call Functionf6e8
|
||||
jr z, .asm_f6ce
|
||||
ld hl, $cfaa
|
||||
@ -2721,7 +2709,7 @@ Functionf6e8: ; f6e8
|
||||
ld [MonType], a
|
||||
call Functionf8ec
|
||||
ld hl, PartyMon1PP
|
||||
ld bc, $0030
|
||||
ld bc, PartyMon2 - PartyMon1
|
||||
call Functionf963
|
||||
ld a, [$d265]
|
||||
ld b, a
|
||||
@ -2739,6 +2727,7 @@ Functionf6e8: ; f6e8
|
||||
ld c, 5
|
||||
cp MYSTERYBERRY
|
||||
jr z, .asm_f715
|
||||
|
||||
ld c, 10
|
||||
|
||||
.asm_f715
|
||||
@ -2972,8 +2961,7 @@ Functionf7a0: ; f7a0
|
||||
ld [$c689], a
|
||||
ld [hBattleTurn], a
|
||||
ld [$cfca], a
|
||||
ld a, $37
|
||||
call Predef
|
||||
predef PlayBattleAnim
|
||||
ld hl, BlockedTheBallText
|
||||
call PrintText
|
||||
ld hl, DontBeAThiefText
|
||||
@ -2985,7 +2973,7 @@ WontHaveAnyEffect_NotUsedMessage: ; f7ca
|
||||
ld hl, WontHaveAnyEffectText
|
||||
call PrintText
|
||||
|
||||
; Item wasn't used.
|
||||
; Item wasn't used.
|
||||
ld a, $2
|
||||
ld [$d0ec], a
|
||||
ret
|
||||
@ -3000,7 +2988,7 @@ Ball_BoxIsFullMessage: ; f7dc
|
||||
ld hl, Ball_BoxIsFullText
|
||||
call PrintText
|
||||
|
||||
; Item wasn't used.
|
||||
; Item wasn't used.
|
||||
ld a, $2
|
||||
ld [$d0ec], a
|
||||
ret
|
||||
@ -3116,21 +3104,20 @@ GotOffTheItemText: ; 0xf847
|
||||
|
||||
|
||||
Functionf84c: ; f84c
|
||||
ld a, $2
|
||||
ld a, PartyMon1Moves - PartyMon1
|
||||
call GetPartyParamLocation
|
||||
push hl
|
||||
ld de, MagikarpLength
|
||||
ld a, $5
|
||||
call Predef
|
||||
ld de, Buffer1
|
||||
predef FillPP
|
||||
pop hl
|
||||
ld bc, $0015
|
||||
ld bc, PartyMon1PP - PartyMon1Moves
|
||||
add hl, bc
|
||||
ld de, MagikarpLength
|
||||
ld b, $0
|
||||
ld de, Buffer1
|
||||
ld b, 0
|
||||
.asm_f864
|
||||
inc b
|
||||
ld a, b
|
||||
cp $5
|
||||
cp NUM_MOVES + 1
|
||||
ret z
|
||||
ld a, [$d265]
|
||||
dec a
|
||||
@ -3157,14 +3144,14 @@ Functionf84c: ; f84c
|
||||
Functionf881: ; f881
|
||||
push bc
|
||||
ld a, [de]
|
||||
ld [$ffb6], a
|
||||
ld [hDividend + 3], a
|
||||
xor a
|
||||
ld [hProduct], a
|
||||
ld [hMultiplicand], a
|
||||
ld [$ffb5], a
|
||||
ld a, $5
|
||||
ld [hMultiplier], a
|
||||
ld b, $4
|
||||
ld [hDividend], a
|
||||
ld [hDividend + 1], a
|
||||
ld [hDividend + 2], a
|
||||
ld a, 5
|
||||
ld [hDivisor], a
|
||||
ld b, 4
|
||||
call Divide
|
||||
ld a, [hl]
|
||||
ld b, a
|
||||
@ -3197,17 +3184,17 @@ Functionf881: ; f881
|
||||
; f8b9
|
||||
|
||||
Functionf8b9: ; f8b9
|
||||
ld a, $17
|
||||
ld a, PartyMon1PP - PartyMon1
|
||||
call GetPartyParamLocation
|
||||
push hl
|
||||
ld a, $2
|
||||
ld a, PartyMon1Moves - PartyMon1
|
||||
call GetPartyParamLocation
|
||||
pop de
|
||||
xor a
|
||||
ld [$cfa9], a
|
||||
ld [MonType], a
|
||||
ld c, $4
|
||||
.asm_f8ce
|
||||
ld c, NUM_MOVES
|
||||
.loop
|
||||
ld a, [hli]
|
||||
and a
|
||||
ret z
|
||||
@ -3228,30 +3215,36 @@ Functionf8b9: ; f8b9
|
||||
inc [hl]
|
||||
pop hl
|
||||
dec c
|
||||
jr nz, .asm_f8ce
|
||||
jr nz, .loop
|
||||
ret
|
||||
; f8ec
|
||||
|
||||
|
||||
Functionf8ec: ; f8ec
|
||||
ld a, [StringBuffer1]
|
||||
ld a, [StringBuffer1 + 0]
|
||||
push af
|
||||
ld a, [$d074]
|
||||
ld a, [StringBuffer1 + 1]
|
||||
push af
|
||||
|
||||
ld a, [MonType]
|
||||
and a
|
||||
|
||||
ld hl, PartyMon1Moves
|
||||
ld bc, PartyMon2 - PartyMon1
|
||||
jr z, .asm_f91a
|
||||
|
||||
ld hl, OTPartyMon1Moves
|
||||
dec a
|
||||
jr z, .asm_f91a
|
||||
|
||||
ld hl, TempMonMoves
|
||||
dec a
|
||||
jr z, .asm_f915
|
||||
|
||||
ld hl, TempMonMoves
|
||||
dec a
|
||||
jr z, .asm_f915
|
||||
|
||||
ld hl, BattleMonMoves
|
||||
|
||||
.asm_f915
|
||||
@ -3264,28 +3257,30 @@ Functionf8ec: ; f8ec
|
||||
.asm_f91d
|
||||
ld a, [hl]
|
||||
dec a
|
||||
|
||||
push hl
|
||||
ld hl, $5b00
|
||||
ld bc, $0007
|
||||
ld hl, Moves + MOVE_PP
|
||||
ld bc, MOVE_LENGTH
|
||||
call AddNTimes
|
||||
ld a, $10
|
||||
ld a, BANK(Moves)
|
||||
call GetFarByte
|
||||
ld b, a
|
||||
ld de, StringBuffer1
|
||||
ld [de], a
|
||||
pop hl
|
||||
|
||||
push bc
|
||||
ld bc, $0015
|
||||
ld bc, PartyMon1PP - PartyMon1Moves
|
||||
ld a, [MonType]
|
||||
cp WILDMON
|
||||
jr nz, .asm_f942
|
||||
ld bc, $0006
|
||||
|
||||
ld bc, EnemyMonPP - EnemyMonMoves
|
||||
.asm_f942
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and $c0
|
||||
pop bc
|
||||
|
||||
or b
|
||||
ld hl, $d074
|
||||
ld [hl], a
|
||||
@ -3296,10 +3291,11 @@ Functionf8ec: ; f8ec
|
||||
ld a, [hl]
|
||||
and $3f
|
||||
ld [$d265], a
|
||||
|
||||
pop af
|
||||
ld [$d074], a
|
||||
ld [StringBuffer1 + 1], a
|
||||
pop af
|
||||
ld [StringBuffer1], a
|
||||
ld [StringBuffer1 + 0], a
|
||||
ret
|
||||
; f963
|
||||
|
||||
@ -3310,7 +3306,7 @@ Functionf963: ; f963
|
||||
Functionf969: ; f969
|
||||
ld a, [$cfa9]
|
||||
ld c, a
|
||||
ld b, $0
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ret
|
||||
; f971
|
||||
|
30
macros.asm
30
macros.asm
@ -13,6 +13,8 @@ page EQUS "db $50," ; Start a new Pokedex page.
|
||||
dex EQUS "db $e8, $50" ; End a Pokedex entry.
|
||||
|
||||
|
||||
percent EQUS "* $ff / 100"
|
||||
|
||||
; macros require rst vectors to be defined
|
||||
FarCall EQU $08
|
||||
Bankswitch EQU $10
|
||||
@ -118,15 +120,15 @@ B_ EQU 12
|
||||
|
||||
|
||||
bccoord: MACRO
|
||||
ld bc, TileMap + SCREEN_WIDTH * \2 + \1
|
||||
ld bc, TileMap + SCREEN_WIDTH * (\2) + (\1)
|
||||
ENDM
|
||||
|
||||
decoord: MACRO
|
||||
ld de, TileMap + SCREEN_WIDTH * \2 + \1
|
||||
ld de, TileMap + SCREEN_WIDTH * (\2) + (\1)
|
||||
ENDM
|
||||
|
||||
hlcoord: MACRO
|
||||
ld hl, TileMap + SCREEN_WIDTH * \2 + \1
|
||||
ld hl, TileMap + SCREEN_WIDTH * (\2) + (\1)
|
||||
ENDM
|
||||
|
||||
|
||||
@ -194,3 +196,25 @@ x = x + \1 * $40000
|
||||
endr
|
||||
ENDM
|
||||
|
||||
|
||||
add_predef: MACRO
|
||||
\1Predef::
|
||||
dw \1
|
||||
db BANK(\1)
|
||||
ENDM
|
||||
|
||||
predef_id: MACRO
|
||||
; Some functions load the predef id
|
||||
; without immediately calling Predef.
|
||||
ld a, (\1Predef - PredefPointers) / 3
|
||||
ENDM
|
||||
|
||||
predef: MACRO
|
||||
predef_id \1
|
||||
call Predef
|
||||
ENDM
|
||||
|
||||
predef_jump: MACRO
|
||||
predef_id \1
|
||||
jp Predef
|
||||
ENDM
|
||||
|
@ -130,7 +130,7 @@ UnknownScript_0x19c0ae: ; 0x19c0ae
|
||||
winlosstext UnknownText_0x19c57f, UnknownText_0x19c5e6
|
||||
setlasttalked $3
|
||||
loadtrainer RIVAL1, RIVAL1_3
|
||||
writecode $3, $1
|
||||
writecode $3, BATTLETYPE_CANLOSE
|
||||
startbattle
|
||||
reloadmapmusic
|
||||
reloadmap
|
||||
@ -142,7 +142,7 @@ UnknownScript_0x19c0ee: ; 0x19c0ee
|
||||
winlosstext UnknownText_0x19c57f, UnknownText_0x19c5e6
|
||||
setlasttalked $3
|
||||
loadtrainer RIVAL1, RIVAL1_1
|
||||
writecode $3, $1
|
||||
writecode $3, BATTLETYPE_CANLOSE
|
||||
startbattle
|
||||
reloadmapmusic
|
||||
reloadmap
|
||||
@ -154,7 +154,7 @@ UnknownScript_0x19c104: ; 0x19c104
|
||||
winlosstext UnknownText_0x19c57f, UnknownText_0x19c5e6
|
||||
setlasttalked $3
|
||||
loadtrainer RIVAL1, RIVAL1_2
|
||||
writecode $3, $1
|
||||
writecode $3, BATTLETYPE_CANLOSE
|
||||
startbattle
|
||||
reloadmapmusic
|
||||
reloadmap
|
||||
|
@ -88,7 +88,7 @@ GyaradosScript_0x70063: ; 0x70063
|
||||
cry GYARADOS
|
||||
loadmovesprites
|
||||
loadpokedata GYARADOS, 30
|
||||
writecode $3, $7
|
||||
writecode $3, BATTLETYPE_SHINY
|
||||
startbattle
|
||||
if_equal $1, UnknownScript_0x7007a
|
||||
disappear $a
|
||||
|
@ -52,7 +52,7 @@ UnknownScript_0x1a0f6d: ; 0x1a0f6d
|
||||
applymovement $2, MovementData_0x1a109a
|
||||
stopfollow
|
||||
loadpokedata RATTATA, 5
|
||||
catchtutorial $3
|
||||
catchtutorial BATTLETYPE_TUTORIAL
|
||||
spriteface $2, $1
|
||||
loadfont
|
||||
2writetext UnknownText_0x1a114d
|
||||
@ -78,7 +78,7 @@ UnknownScript_0x1a0fa3: ; 0x1a0fa3
|
||||
applymovement $2, MovementData_0x1a10a1
|
||||
stopfollow
|
||||
loadpokedata RATTATA, 5
|
||||
catchtutorial $3
|
||||
catchtutorial BATTLETYPE_TUTORIAL
|
||||
spriteface $2, $1
|
||||
loadfont
|
||||
2writetext UnknownText_0x1a114d
|
||||
@ -121,7 +121,7 @@ CooltrainerMScript_0x1a0ff1: ; 0x1a0ff1
|
||||
iffalse UnknownScript_0x1a1022
|
||||
loadmovesprites
|
||||
loadpokedata RATTATA, 5
|
||||
catchtutorial $3
|
||||
catchtutorial BATTLETYPE_TUTORIAL
|
||||
loadfont
|
||||
2writetext UnknownText_0x1a114d
|
||||
closetext
|
||||
|
@ -464,7 +464,7 @@ VoltorbExplodingTrap: ; 0x6ca34
|
||||
cry VOLTORB
|
||||
special $0031
|
||||
setlasttalked $ff
|
||||
writecode $3, $9
|
||||
writecode $3, BATTLETYPE_TRAP
|
||||
loadpokedata VOLTORB, 23
|
||||
startbattle
|
||||
end
|
||||
@ -474,7 +474,7 @@ GeodudeExplodingTrap: ; 0x6ca47
|
||||
cry GEODUDE
|
||||
special $0031
|
||||
setlasttalked $ff
|
||||
writecode $3, $9
|
||||
writecode $3, BATTLETYPE_TRAP
|
||||
loadpokedata GEODUDE, 21
|
||||
startbattle
|
||||
end
|
||||
@ -484,7 +484,7 @@ KoffingExplodingTrap: ; 0x6ca5a
|
||||
cry KOFFING
|
||||
special $0031
|
||||
setlasttalked $ff
|
||||
writecode $3, $9
|
||||
writecode $3, BATTLETYPE_TRAP
|
||||
loadpokedata KOFFING, 21
|
||||
startbattle
|
||||
end
|
||||
|
@ -122,7 +122,7 @@ UnknownScript_0x1850d7: ; 0x1850d7
|
||||
cry SUICUNE
|
||||
pause 20
|
||||
loadpokedata SUICUNE, 40
|
||||
writecode $3, $c
|
||||
writecode $3, BATTLETYPE_SUICUNE
|
||||
startbattle
|
||||
reloadmapmusic
|
||||
disappear $2
|
||||
|
@ -36,7 +36,7 @@ HoOhScript_0x77244: ; 0x77244
|
||||
pause 15
|
||||
loadmovesprites
|
||||
setevent EVENT_FOUGHT_HO_OH
|
||||
writecode $3, $a
|
||||
writecode $3, BATTLETYPE_FORCEITEM
|
||||
loadpokedata HO_OH, 60
|
||||
startbattle
|
||||
disappear $2
|
||||
|
@ -56,7 +56,7 @@ UnknownScript_0x1aa9ab: ; 0x1aa9ab
|
||||
pause 15
|
||||
cry SNORLAX
|
||||
loadmovesprites
|
||||
writecode $3, $a
|
||||
writecode $3, BATTLETYPE_FORCEITEM
|
||||
loadpokedata SNORLAX, 50
|
||||
startbattle
|
||||
disappear $6
|
||||
|
@ -36,7 +36,7 @@ LugiaScript_0x18c518: ; 0x18c518
|
||||
pause 15
|
||||
loadmovesprites
|
||||
setevent EVENT_FOUGHT_LUGIA
|
||||
writecode $3, $a
|
||||
writecode $3, BATTLETYPE_FORCEITEM
|
||||
loadpokedata LUGIA, 60
|
||||
startbattle
|
||||
disappear $2
|
||||
|
@ -611,7 +611,7 @@ Function91e4: ; 91e4
|
||||
|
||||
.asm_91f5
|
||||
ld hl, PartyMon1DVs
|
||||
ld bc, $0030
|
||||
ld bc, PartyMon2 - PartyMon1
|
||||
ld a, [CurPartyMon]
|
||||
call AddNTimes
|
||||
ld c, l
|
||||
@ -840,11 +840,13 @@ Function93ba: ; 93ba
|
||||
|
||||
Function93d3: ; 93d3
|
||||
ld a, [BattleType]
|
||||
cp $3
|
||||
cp BATTLETYPE_TUTORIAL
|
||||
jr z, .asm_93e6
|
||||
|
||||
ld a, [PlayerGender]
|
||||
bit 0, a
|
||||
jr z, .asm_93e6
|
||||
|
||||
ld hl, Palettes_9469
|
||||
jr .asm_93e9
|
||||
|
||||
|
@ -30,7 +30,7 @@ PokemonFellFromTreeText: ; 0x80778
|
||||
prompt
|
||||
; 0x80793
|
||||
|
||||
WildPokemonAppearedText2: ; 0x80793
|
||||
WildCelebiAppearedText: ; 0x80793
|
||||
text "Wild @"
|
||||
text_from_ram $c616
|
||||
db $0
|
||||
@ -60,43 +60,43 @@ BattleText_0x807cf: ; 0x807cf
|
||||
prompt
|
||||
; 0x807e2
|
||||
|
||||
BattleText_0x807e2: ; 0x807e2
|
||||
HurtByPoisonText: ; 0x807e2
|
||||
text $5a
|
||||
line "is hurt by poison!"
|
||||
prompt
|
||||
; 0x807f8
|
||||
|
||||
BattleText_0x807f8: ; 0x807f8
|
||||
HurtByBurnText: ; 0x807f8
|
||||
text $5a, "'s"
|
||||
line "hurt by its burn!"
|
||||
prompt
|
||||
; 0x8080e
|
||||
|
||||
BattleText_0x8080e: ; 0x8080e
|
||||
LeechSeedSapsText: ; 0x8080e
|
||||
text "LEECH SEED saps"
|
||||
line $5a, "!"
|
||||
prompt
|
||||
; 0x80822
|
||||
|
||||
BattleText_0x80822: ; 0x80822
|
||||
HasANightmareText: ; 0x80822
|
||||
text $5a
|
||||
line "has a NIGHTMARE!"
|
||||
prompt
|
||||
; 0x80836
|
||||
|
||||
BattleText_0x80836: ; 0x80836
|
||||
HurtByCurseText: ; 0x80836
|
||||
text $5a, "'s"
|
||||
line "hurt by the CURSE!"
|
||||
prompt
|
||||
; 0x8084d
|
||||
|
||||
BattleText_0x8084d: ; 0x8084d
|
||||
SandstormHitsText: ; 0x8084d
|
||||
text "The SANDSTORM hits"
|
||||
line $5a, "!"
|
||||
prompt
|
||||
; 0x80864
|
||||
|
||||
BattleText_0x80864: ; 0x80864
|
||||
PerishCountText: ; 0x80864
|
||||
text $5a, "'s"
|
||||
line "PERISH count is @"
|
||||
deciram $d265, $11
|
||||
|
@ -42,13 +42,13 @@ PrintMoveType: ; 5093a
|
||||
push hl
|
||||
ld a, b
|
||||
dec a
|
||||
ld bc, Move2 - Move1
|
||||
ld bc, MOVE_LENGTH
|
||||
ld hl, Moves
|
||||
call AddNTimes
|
||||
ld de, StringBuffer1
|
||||
ld a, BANK(Moves)
|
||||
call FarCopyBytes
|
||||
ld a, [StringBuffer1 + PlayerMoveType - PlayerMoveStruct]
|
||||
ld a, [StringBuffer1 + MOVE_TYPE]
|
||||
pop hl
|
||||
|
||||
ld b, a
|
||||
|
@ -5,7 +5,7 @@
|
||||
; Type
|
||||
; 0: Level, species
|
||||
; 1: Level, species, moves
|
||||
; 2: Level, sepcies, item
|
||||
; 2: Level, species, item
|
||||
; 3: Level, species, item, moves
|
||||
; Party
|
||||
; Up to six monsters following the data type
|
||||
|
Loading…
x
Reference in New Issue
Block a user