Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2018-08-20 00:37:03

Missingno
New member
Registered: 2017-06-03
Post 3/4

Importing Gen II Monsters in Vanilla Red

Hi Everyone,

I know there were a couple of posts on expanding the Pokedex and adding new Pokemon in Generation I, so I wasn't sure whether I should be creating a new post or grave dig the existing ones. If I should move it please let me know and I'll correct my mistake.

I am expanding Pokedex in Gen I to hold 251 Pokemon instead of 151. While doing this I am trying to maintain most of the consistencies that are in the existing vanilla code. I've noticed that there is one solution to expand the entire Pokedex to 255+ However the solution seems to be unstable in certain cases and converts all of the logic and Mon values to juggle two-byte values instead of one. So far, I have managed to load all of the extra 100 Pokemon in Gen II successfully however the final hurdle that needs to be cleared is how to delineate trainers.

When initializing battles, the way the game determines whether its a trainer or a wild Pokemon based on a offset index of 200 (I fondly remember this when I fiddled on my Gameshark). Anything that is invoked above the 200 range will initialize a trainer battle then send out junk Pokemon and potentially crash the game. Removing this offset will get all 251 Pokemon to spawn without any but naturally trainers will cease to work and will turn into wild Pokemon.

Heres some of the changes I made:

pokedex_constants, pokemon_constants, pokedex_order, monster_names, evos_moves, pokedex_entries.asm files: All of the extra 39 Missingnos have been populated with the first 39 pokemon after Mew. The rest have been appended at the end.
pokedex.asm: New dex entries have been appended at the end since order doesn't matter in this file.



Heres a sample of how the baseStats are shown (They're identical to the vanilla version):

db DEX_AIPOM ; pokedex id
db 50 ; base hp
db 70 ; base attack
db 55 ; base defense
db 85 ; base speed
db 50 ; base special
db NORMAL ; species type 1
db NORMAL ; species type 2
db 45 ; catch rate
db 94 ; base exp yield
INCBIN "pic/bmon/aipom.pic",0,1 ; 55, sprite dimensions
dw AipomPicFront
dw AipomPicBack
; attacks known at lvl 0
db SCRATCH
db TAIL_WHIP
db 0
db 0
db 0 ; growth rate
; learnset
    tmlearn 1,5,6,8
    tmlearn 9,10,16
    tmlearn 17,18,19,20,24
    tmlearn 25,28,31,32
    tmlearn 34,35,39,40
    tmlearn 44,48
    tmlearn 50,54
db 0 ; padding

Currently all base stats have been relocated to serve in an isolated bank in main.asm.

The collections of pictures also respect the order in which they're ordered according to index. Not that Mew has also been taken out of Bank 1 and has been merged into the collection. I think this may have created some minor side effects.

SECTION "Pics 1", ROMX, BANK[PICS_1]

RhydonPicFront::      INCBIN "pic/bmon/rhydon.pic"
RhydonPicBack::       INCBIN "pic/monback/rhydonb.pic"
KangaskhanPicFront::  INCBIN "pic/bmon/kangaskhan.pic"
KangaskhanPicBack::   INCBIN "pic/monback/kangaskhanb.pic"
NidoranMPicFront::    INCBIN "pic/bmon/nidoranm.pic"
NidoranMPicBack::     INCBIN "pic/monback/nidoranmb.pic"
ClefairyPicFront::    INCBIN "pic/bmon/clefairy.pic"
ClefairyPicBack::     INCBIN "pic/monback/clefairyb.pic"
SpearowPicFront::     INCBIN "pic/bmon/spearow.pic"
SpearowPicBack::      INCBIN "pic/monback/spearowb.pic"
VoltorbPicFront::     INCBIN "pic/bmon/voltorb.pic"
VoltorbPicBack::      INCBIN "pic/monback/voltorbb.pic"
NidokingPicFront::    INCBIN "pic/bmon/nidoking.pic"
NidokingPicBack::     INCBIN "pic/monback/nidokingb.pic"
SlowbroPicFront::     INCBIN "pic/bmon/slowbro.pic"
SlowbroPicBack::      INCBIN "pic/monback/slowbrob.pic"
IvysaurPicFront::     INCBIN "pic/bmon/ivysaur.pic"
IvysaurPicBack::      INCBIN "pic/monback/ivysaurb.pic"
ExeggutorPicFront::   INCBIN "pic/bmon/exeggutor.pic"
ExeggutorPicBack::    INCBIN "pic/monback/exeggutorb.pic"
LickitungPicFront::   INCBIN "pic/bmon/lickitung.pic"
LickitungPicBack::    INCBIN "pic/monback/lickitungb.pic"
ExeggcutePicFront::   INCBIN "pic/bmon/exeggcute.pic"
ExeggcutePicBack::    INCBIN "pic/monback/exeggcuteb.pic"
GrimerPicFront::      INCBIN "pic/bmon/grimer.pic"
GrimerPicBack::       INCBIN "pic/monback/grimerb.pic"
GengarPicFront::      INCBIN "pic/bmon/gengar.pic"
GengarPicBack::       INCBIN "pic/monback/gengarb.pic"
NidoranFPicFront::    INCBIN "pic/bmon/nidoranf.pic"
NidoranFPicBack::     INCBIN "pic/monback/nidoranfb.pic"
NidoqueenPicFront::   INCBIN "pic/bmon/nidoqueen.pic"
NidoqueenPicBack::    INCBIN "pic/monback/nidoqueenb.pic"
CubonePicFront::      INCBIN "pic/bmon/cubone.pic"
CubonePicBack::       INCBIN "pic/monback/cuboneb.pic"
RhyhornPicFront::     INCBIN "pic/bmon/rhyhorn.pic"
RhyhornPicBack::      INCBIN "pic/monback/rhyhornb.pic"
LaprasPicFront::      INCBIN "pic/bmon/lapras.pic"
LaprasPicBack::       INCBIN "pic/monback/laprasb.pic"
ArcaninePicFront::    INCBIN "pic/bmon/arcanine.pic"
ArcaninePicBack::     INCBIN "pic/monback/arcanineb.pic"
MewPicFront::         INCBIN "pic/bmon/mew.pic"
MewPicBack::          INCBIN "pic/monback/mewb.pic"
GyaradosPicFront::    INCBIN "pic/bmon/gyarados.pic"
GyaradosPicBack::     INCBIN "pic/monback/gyaradosb.pic"
ShellderPicFront::    INCBIN "pic/bmon/shellder.pic"
ShellderPicBack::     INCBIN "pic/monback/shellderb.pic"
TentacoolPicFront::   INCBIN "pic/bmon/tentacool.pic"
TentacoolPicBack::    INCBIN "pic/monback/tentacoolb.pic"
GastlyPicFront::      INCBIN "pic/bmon/gastly.pic"
GastlyPicBack::       INCBIN "pic/monback/gastlyb.pic"
ScytherPicFront::     INCBIN "pic/bmon/scyther.pic"
ScytherPicBack::      INCBIN "pic/monback/scytherb.pic"
StaryuPicFront::      INCBIN "pic/bmon/staryu.pic"
StaryuPicBack::       INCBIN "pic/monback/staryub.pic"
BlastoisePicFront::   INCBIN "pic/bmon/blastoise.pic"
BlastoisePicBack::    INCBIN "pic/monback/blastoiseb.pic"
PinsirPicFront::      INCBIN "pic/bmon/pinsir.pic"
PinsirPicBack::       INCBIN "pic/monback/pinsirb.pic"


SECTION "Battle (bank 9)", ROMX, BANK[$9]
INCLUDE "engine/battle/print_type.asm"
INCLUDE "engine/battle/save_trainer_name.asm"
INCLUDE "engine/battle/moveEffects/focus_energy_effect.asm"


SECTION "Pics 2", ROMX, BANK[PICS_2]

TangelaPicFront::     INCBIN "pic/bmon/tangela.pic"
TangelaPicBack::      INCBIN "pic/monback/tangelab.pic"
ChikoritaPicFront::        INCBIN "pic/bmon/chikorita.pic"
ChikoritaPicBack::        INCBIN "pic/monback/chikoritab.pic"
BayleefPicFront::     INCBIN "pic/bmon/bayleef.pic"
BayleefPicBack::      INCBIN "pic/monback/bayleefb.pic"
GrowlithePicFront::   INCBIN "pic/bmon/growlithe.pic"
GrowlithePicBack::    INCBIN "pic/monback/growlitheb.pic"
OnixPicFront::        INCBIN "pic/bmon/onix.pic"
OnixPicBack::         INCBIN "pic/monback/onixb.pic"
FearowPicFront::      INCBIN "pic/bmon/fearow.pic"
FearowPicBack::       INCBIN "pic/monback/fearowb.pic"
PidgeyPicFront::      INCBIN "pic/bmon/pidgey.pic"
PidgeyPicBack::       INCBIN "pic/monback/pidgeyb.pic"
SlowpokePicFront::    INCBIN "pic/bmon/slowpoke.pic"
SlowpokePicBack::     INCBIN "pic/monback/slowpokeb.pic"
KadabraPicFront::     INCBIN "pic/bmon/kadabra.pic"
KadabraPicBack::      INCBIN "pic/monback/kadabrab.pic"
GravelerPicFront::    INCBIN "pic/bmon/graveler.pic"
GravelerPicBack::     INCBIN "pic/monback/gravelerb.pic"
ChanseyPicFront::     INCBIN "pic/bmon/chansey.pic"
ChanseyPicBack::      INCBIN "pic/monback/chanseyb.pic"
MachokePicFront::     INCBIN "pic/bmon/machoke.pic"
MachokePicBack::      INCBIN "pic/monback/machokeb.pic"
MrMimePicFront::      INCBIN "pic/bmon/mr.mime.pic"
MrMimePicBack::       INCBIN "pic/monback/mr.mimeb.pic"
HitmonleePicFront::   INCBIN "pic/bmon/hitmonlee.pic"
HitmonleePicBack::    INCBIN "pic/monback/hitmonleeb.pic"
HitmonchanPicFront::  INCBIN "pic/bmon/hitmonchan.pic"
HitmonchanPicBack::   INCBIN "pic/monback/hitmonchanb.pic"
ArbokPicFront::       INCBIN "pic/bmon/arbok.pic"
ArbokPicBack::        INCBIN "pic/monback/arbokb.pic"
ParasectPicFront::    INCBIN "pic/bmon/parasect.pic"
ParasectPicBack::     INCBIN "pic/monback/parasectb.pic"
PsyduckPicFront::     INCBIN "pic/bmon/psyduck.pic"
PsyduckPicBack::      INCBIN "pic/monback/psyduckb.pic"
DrowzeePicFront::     INCBIN "pic/bmon/drowzee.pic"
DrowzeePicBack::      INCBIN "pic/monback/drowzeeb.pic"
GolemPicFront::       INCBIN "pic/bmon/golem.pic"
GolemPicBack::        INCBIN "pic/monback/golemb.pic"
MeganiumPicFront::    INCBIN "pic/bmon/meganium.pic"
MeganiumPicBack::     INCBIN "pic/monback/meganiumb.pic"
MagmarPicFront::      INCBIN "pic/bmon/magmar.pic"
MagmarPicBack::       INCBIN "pic/monback/magmarb.pic"
CyndaquilPicFront::   INCBIN "pic/bmon/cyndaquil.pic"
CyndaquilPicBack::    INCBIN "pic/monback/cyndaquilb.pic"
ElectabuzzPicFront::  INCBIN "pic/bmon/electabuzz.pic"
ElectabuzzPicBack::   INCBIN "pic/monback/electabuzzb.pic"
MagnetonPicFront::    INCBIN "pic/bmon/magneton.pic"
MagnetonPicBack::     INCBIN "pic/monback/magnetonb.pic"
KoffingPicFront::     INCBIN "pic/bmon/koffing.pic"
KoffingPicBack::      INCBIN "pic/monback/koffingb.pic"
QuilavaPicFront::     INCBIN "pic/bmon/quilava.pic"
QuilavaPicBack::      INCBIN "pic/monback/quilavab.pic"
MankeyPicFront::      INCBIN "pic/bmon/mankey.pic"
MankeyPicBack::       INCBIN "pic/monback/mankeyb.pic"
SeelPicFront::        INCBIN "pic/bmon/seel.pic"
SeelPicBack::         INCBIN "pic/monback/seelb.pic"
DiglettPicFront::     INCBIN "pic/bmon/diglett.pic"
DiglettPicBack::      INCBIN "pic/monback/diglettb.pic"
TaurosPicFront::      INCBIN "pic/bmon/tauros.pic"
TaurosPicBack::       INCBIN "pic/monback/taurosb.pic"
TyphlosionPicFront::  INCBIN "pic/bmon/typhlosion.pic"
TyphlosionPicBack::   INCBIN "pic/monback/typhlosionb.pic"
TotodilePicFront::    INCBIN "pic/bmon/totodile.pic"
TotodilePicBack::     INCBIN "pic/monback/totodileb.pic"


SECTION "Battle (bank A)", ROMX, BANK[$A]
INCLUDE "engine/battle/moveEffects/leech_seed_effect.asm"


SECTION "Pics 3", ROMX, BANK[PICS_3]

CroconawPicFront::    INCBIN "pic/bmon/croconaw.pic"
CroconawPicBack::     INCBIN "pic/monback/croconawb.pic"
FarfetchdPicFront::   INCBIN "pic/bmon/farfetchd.pic"
FarfetchdPicBack::    INCBIN "pic/monback/farfetchdb.pic"
VenonatPicFront::     INCBIN "pic/bmon/venonat.pic"
VenonatPicBack::      INCBIN "pic/monback/venonatb.pic"
DragonitePicFront::   INCBIN "pic/bmon/dragonite.pic"
DragonitePicBack::    INCBIN "pic/monback/dragoniteb.pic"
FeraligatrPicFront::  INCBIN "pic/bmon/feraligatr.pic"
FeraligatrPicBack::   INCBIN "pic/monback/feraligatrb.pic"
SentretPicFront::     INCBIN "pic/bmon/sentret.pic"
SentretPicBack::      INCBIN "pic/monback/sentretb.pic"
FurretPicFront::      INCBIN "pic/bmon/furret.pic"
FurretPicBack::       INCBIN "pic/monback/furretb.pic"
DoduoPicFront::       INCBIN "pic/bmon/doduo.pic"
DoduoPicBack::        INCBIN "pic/monback/doduob.pic"
PoliwagPicFront::     INCBIN "pic/bmon/poliwag.pic"
PoliwagPicBack::      INCBIN "pic/monback/poliwagb.pic"
JynxPicFront::        INCBIN "pic/bmon/jynx.pic"
JynxPicBack::         INCBIN "pic/monback/jynxb.pic"
MoltresPicFront::     INCBIN "pic/bmon/moltres.pic"
MoltresPicBack::      INCBIN "pic/monback/moltresb.pic"
ArticunoPicFront::    INCBIN "pic/bmon/articuno.pic"
ArticunoPicBack::     INCBIN "pic/monback/articunob.pic"
ZapdosPicFront::      INCBIN "pic/bmon/zapdos.pic"
ZapdosPicBack::       INCBIN "pic/monback/zapdosb.pic"
DittoPicFront::       INCBIN "pic/bmon/ditto.pic"
DittoPicBack::        INCBIN "pic/monback/dittob.pic"
MeowthPicFront::      INCBIN "pic/bmon/meowth.pic"
MeowthPicBack::       INCBIN "pic/monback/meowthb.pic"
KrabbyPicFront::      INCBIN "pic/bmon/krabby.pic"
KrabbyPicBack::       INCBIN "pic/monback/krabbyb.pic"
HoothootPicFront::    INCBIN "pic/bmon/hoothoot.pic"
HoothootPicBack::     INCBIN "pic/monback/hoothootb.pic"
NoctowlPicFront::     INCBIN "pic/bmon/noctowl.pic"
NoctowlPicBack::      INCBIN "pic/monback/noctowlb.pic"
LedybaPicFront::      INCBIN "pic/bmon/ledyba.pic"
LedybaPicBack::       INCBIN "pic/monback/ledybab.pic"
VulpixPicFront::      INCBIN "pic/bmon/vulpix.pic"
VulpixPicBack::       INCBIN "pic/monback/vulpixb.pic"
NinetalesPicFront::   INCBIN "pic/bmon/ninetales.pic"
NinetalesPicBack::    INCBIN "pic/monback/ninetalesb.pic"
PikachuPicFront::     INCBIN "pic/bmon/pikachu.pic"
PikachuPicBack::      INCBIN "pic/monback/pikachub.pic"
RaichuPicFront::      INCBIN "pic/bmon/raichu.pic"
RaichuPicBack::       INCBIN "pic/monback/raichub.pic"
LedianPicFront::      INCBIN "pic/bmon/ledian.pic"
LedianPicBack::       INCBIN "pic/monback/ledianb.pic"
SpinarakPicFront::    INCBIN "pic/bmon/spinarak.pic"
SpinarakPicBack::     INCBIN "pic/monback/spinarakb.pic"
DratiniPicFront::     INCBIN "pic/bmon/dratini.pic"
DratiniPicBack::      INCBIN "pic/monback/dratinib.pic"
DragonairPicFront::   INCBIN "pic/bmon/dragonair.pic"
DragonairPicBack::    INCBIN "pic/monback/dragonairb.pic"
KabutoPicFront::      INCBIN "pic/bmon/kabuto.pic"
KabutoPicBack::       INCBIN "pic/monback/kabutob.pic"
KabutopsPicFront::    INCBIN "pic/bmon/kabutops.pic"
KabutopsPicBack::     INCBIN "pic/monback/kabutopsb.pic"
HorseaPicFront::      INCBIN "pic/bmon/horsea.pic"
HorseaPicBack::       INCBIN "pic/monback/horseab.pic"

FossilKabutopsPic::   INCBIN "pic/bmon/fossilkabutops.pic"

SECTION "Battle (bank B)", ROMX, BANK[$B]

INCLUDE "engine/battle/display_effectiveness.asm"

TrainerInfoTextBoxTileGraphics:  INCBIN "gfx/trainer_info.2bpp"
TrainerInfoTextBoxTileGraphicsEnd:
BlankLeaderNames:                INCBIN "gfx/blank_leader_names.2bpp"
CircleTile:                      INCBIN "gfx/circle_tile.2bpp"
BadgeNumbersTileGraphics:        INCBIN "gfx/badge_numbers.2bpp"

INCLUDE "engine/items/tmhm.asm"
INCLUDE "engine/battle/scale_sprites.asm"
INCLUDE "engine/battle/moveEffects/pay_day_effect.asm"
INCLUDE "engine/game_corner_slots2.asm"


SECTION "Pics 4", ROMX, BANK[PICS_4]

SeadraPicFront::      INCBIN "pic/bmon/seadra.pic"
SeadraPicBack::       INCBIN "pic/monback/seadrab.pic"
AriadosPicFront::     INCBIN "pic/bmon/ariados.pic"
AriadosPicBack::      INCBIN "pic/monback/ariadosb.pic"
CrobatPicFront::      INCBIN "pic/bmon/crobat.pic"
CrobatPicBack::       INCBIN "pic/monback/crobatb.pic"
SandshrewPicFront::   INCBIN "pic/bmon/sandshrew.pic"
SandshrewPicBack::    INCBIN "pic/monback/sandshrewb.pic"
SandslashPicFront::   INCBIN "pic/bmon/sandslash.pic"
SandslashPicBack::    INCBIN "pic/monback/sandslashb.pic"
OmanytePicFront::     INCBIN "pic/bmon/omanyte.pic"
OmanytePicBack::      INCBIN "pic/monback/omanyteb.pic"
OmastarPicFront::     INCBIN "pic/bmon/omastar.pic"
OmastarPicBack::      INCBIN "pic/monback/omastarb.pic"
JigglypuffPicFront::  INCBIN "pic/bmon/jigglypuff.pic"
JigglypuffPicBack::   INCBIN "pic/monback/jigglypuffb.pic"
WigglytuffPicFront::  INCBIN "pic/bmon/wigglytuff.pic"
WigglytuffPicBack::   INCBIN "pic/monback/wigglytuffb.pic"
EeveePicFront::       INCBIN "pic/bmon/eevee.pic"
EeveePicBack::        INCBIN "pic/monback/eeveeb.pic"
FlareonPicFront::     INCBIN "pic/bmon/flareon.pic"
FlareonPicBack::      INCBIN "pic/monback/flareonb.pic"
JolteonPicFront::     INCBIN "pic/bmon/jolteon.pic"
JolteonPicBack::      INCBIN "pic/monback/jolteonb.pic"
VaporeonPicFront::    INCBIN "pic/bmon/vaporeon.pic"
VaporeonPicBack::     INCBIN "pic/monback/vaporeonb.pic"
MachopPicFront::      INCBIN "pic/bmon/machop.pic"
MachopPicBack::       INCBIN "pic/monback/machopb.pic"
ZubatPicFront::       INCBIN "pic/bmon/zubat.pic"
ZubatPicBack::        INCBIN "pic/monback/zubatb.pic"
EkansPicFront::       INCBIN "pic/bmon/ekans.pic"
EkansPicBack::        INCBIN "pic/monback/ekansb.pic"
ParasPicFront::       INCBIN "pic/bmon/paras.pic"
ParasPicBack::        INCBIN "pic/monback/parasb.pic"
PoliwhirlPicFront::   INCBIN "pic/bmon/poliwhirl.pic"
PoliwhirlPicBack::    INCBIN "pic/monback/poliwhirlb.pic"
PoliwrathPicFront::   INCBIN "pic/bmon/poliwrath.pic"
PoliwrathPicBack::    INCBIN "pic/monback/poliwrathb.pic"
WeedlePicFront::      INCBIN "pic/bmon/weedle.pic"
WeedlePicBack::       INCBIN "pic/monback/weedleb.pic"
KakunaPicFront::      INCBIN "pic/bmon/kakuna.pic"
KakunaPicBack::       INCBIN "pic/monback/kakunab.pic"
BeedrillPicFront::    INCBIN "pic/bmon/beedrill.pic"
BeedrillPicBack::     INCBIN "pic/monback/beedrillb.pic"
ChinchouPicFront::    INCBIN "pic/bmon/chinchou.pic"
ChinchouPicBack::     INCBIN "pic/monback/chinchoub.pic"
DodrioPicFront::       INCBIN "pic/bmon/dodrio.pic"
DodrioPicBack::        INCBIN "pic/monback/dodriob.pic"
PrimeapePicFront::     INCBIN "pic/bmon/primeape.pic"
PrimeapePicBack::      INCBIN "pic/monback/primeapeb.pic"
DugtrioPicFront::      INCBIN "pic/bmon/dugtrio.pic"
DugtrioPicBack::       INCBIN "pic/monback/dugtriob.pic"
VenomothPicFront::     INCBIN "pic/bmon/venomoth.pic"
VenomothPicBack::      INCBIN "pic/monback/venomothb.pic"
DewgongPicFront::      INCBIN "pic/bmon/dewgong.pic"
DewgongPicBack::       INCBIN "pic/monback/dewgongb.pic"
LanturnPicFront::      INCBIN "pic/bmon/lanturn.pic"
LanturnPicBack::       INCBIN "pic/monback/lanturnb.pic"
PichuPicFront::        INCBIN "pic/bmon/pichu.pic"
PichuPicBack::         INCBIN "pic/monback/pichub.pic"
CaterpiePicFront::     INCBIN "pic/bmon/caterpie.pic"
CaterpiePicBack::      INCBIN "pic/monback/caterpieb.pic"
MetapodPicFront::      INCBIN "pic/bmon/metapod.pic"
MetapodPicBack::       INCBIN "pic/monback/metapodb.pic"
ButterfreePicFront::   INCBIN "pic/bmon/butterfree.pic"
ButterfreePicBack::    INCBIN "pic/monback/butterfreeb.pic"
MachampPicFront::      INCBIN "pic/bmon/machamp.pic"
MachampPicBack::       INCBIN "pic/monback/machampb.pic"
CleffaPicFront::       INCBIN "pic/bmon/cleffa.pic"
CleffaPicBack::        INCBIN "pic/monback/cleffab.pic"

RedPicBack::           INCBIN "pic/trainer/redb.pic"
OldManPic::            INCBIN "pic/trainer/oldman.pic"


SECTION "Battle (bank C)", ROMX, BANK[$C]
INCLUDE "engine/battle/moveEffects/mist_effect.asm"
INCLUDE "engine/battle/moveEffects/one_hit_ko_effect.asm"


SECTION "Pics 5", ROMX, BANK[PICS_5]

GolduckPicFront::      INCBIN "pic/bmon/golduck.pic"
GolduckPicBack::       INCBIN "pic/monback/golduckb.pic"
HypnoPicFront::        INCBIN "pic/bmon/hypno.pic"
HypnoPicBack::         INCBIN "pic/monback/hypnob.pic"
GolbatPicFront::       INCBIN "pic/bmon/golbat.pic"
GolbatPicBack::        INCBIN "pic/monback/golbatb.pic"
MewtwoPicFront::       INCBIN "pic/bmon/mewtwo.pic"
MewtwoPicBack::        INCBIN "pic/monback/mewtwob.pic"
SnorlaxPicFront::      INCBIN "pic/bmon/snorlax.pic"
SnorlaxPicBack::       INCBIN "pic/monback/snorlaxb.pic"
MagikarpPicFront::     INCBIN "pic/bmon/magikarp.pic"
MagikarpPicBack::      INCBIN "pic/monback/magikarpb.pic"
IgglybuffPicFront::    INCBIN "pic/bmon/igglybuff.pic"
IgglybuffPicBack::     INCBIN "pic/monback/igglybuffb.pic"
TogepiPicFront::       INCBIN "pic/bmon/togepi.pic"
TogepiPicBack::        INCBIN "pic/monback/togepib.pic"
MukPicFront::          INCBIN "pic/bmon/muk.pic"
MukPicBack::           INCBIN "pic/monback/mukb.pic"
TogeticPicFront::      INCBIN "pic/bmon/togetic.pic"
TogeticPicBack::       INCBIN "pic/monback/togeticb.pic"
KinglerPicFront::      INCBIN "pic/bmon/kingler.pic"
KinglerPicBack::       INCBIN "pic/monback/kinglerb.pic"
CloysterPicFront::     INCBIN "pic/bmon/cloyster.pic"
CloysterPicBack::      INCBIN "pic/monback/cloysterb.pic"
NatuPicFront::         INCBIN "pic/bmon/natu.pic"
NatuPicBack::          INCBIN "pic/monback/natub.pic"
ElectrodePicFront::    INCBIN "pic/bmon/electrode.pic"
ElectrodePicBack::     INCBIN "pic/monback/electrodeb.pic"
ClefablePicFront::     INCBIN "pic/bmon/clefable.pic"
ClefablePicBack::      INCBIN "pic/monback/clefableb.pic"
WeezingPicFront::      INCBIN "pic/bmon/weezing.pic"
WeezingPicBack::       INCBIN "pic/monback/weezingb.pic"
PersianPicFront::      INCBIN "pic/bmon/persian.pic"
PersianPicBack::       INCBIN "pic/monback/persianb.pic"
MarowakPicFront::      INCBIN "pic/bmon/marowak.pic"
MarowakPicBack::       INCBIN "pic/monback/marowakb.pic"
XatuPicFront::         INCBIN "pic/bmon/xatu.pic"
XatuPicBack::          INCBIN "pic/monback/xatub.pic"
HaunterPicFront::      INCBIN "pic/bmon/haunter.pic"
HaunterPicBack::       INCBIN "pic/monback/haunterb.pic"
AbraPicFront::         INCBIN "pic/bmon/abra.pic"
AbraPicBack::          INCBIN "pic/monback/abrab.pic"
AlakazamPicFront::     INCBIN "pic/bmon/alakazam.pic"
AlakazamPicBack::      INCBIN "pic/monback/alakazamb.pic"
PidgeottoPicFront::    INCBIN "pic/bmon/pidgeotto.pic"
PidgeottoPicBack::     INCBIN "pic/monback/pidgeottob.pic"
PidgeotPicFront::      INCBIN "pic/bmon/pidgeot.pic"
PidgeotPicBack::       INCBIN "pic/monback/pidgeotb.pic"

SECTION "Pics 6", ROMX, BANK[PICS_6]

StarmiePicFront::      INCBIN "pic/bmon/starmie.pic"
StarmiePicBack::       INCBIN "pic/monback/starmieb.pic"
BulbasaurPicFront::    INCBIN "pic/bmon/bulbasaur.pic"
BulbasaurPicBack::     INCBIN "pic/monback/bulbasaurb.pic"
VenusaurPicFront::     INCBIN "pic/bmon/venusaur.pic"
VenusaurPicBack::      INCBIN "pic/monback/venusaurb.pic"
TentacruelPicFront::   INCBIN "pic/bmon/tentacruel.pic"
TentacruelPicBack::    INCBIN "pic/monback/tentacruelb.pic"
MareepPicFront::       INCBIN "pic/bmon/mareep.pic"
MareepPicBack::        INCBIN "pic/monback/mareepb.pic"
GoldeenPicFront::      INCBIN "pic/bmon/goldeen.pic"
GoldeenPicBack::       INCBIN "pic/monback/goldeenb.pic"
SeakingPicFront::      INCBIN "pic/bmon/seaking.pic"
SeakingPicBack::       INCBIN "pic/monback/seakingb.pic"
FlaaffyPicFront::      INCBIN "pic/bmon/flaaffy.pic"
FlaaffyPicBack::       INCBIN "pic/monback/flaaffyb.pic"
AmpharosPicFront::     INCBIN "pic/bmon/ampharos.pic"
AmpharosPicBack::      INCBIN "pic/monback/ampharosb.pic"
BellossomPicFront::    INCBIN "pic/bmon/bellossom.pic"
BellossomPicBack::     INCBIN "pic/monback/bellossomb.pic"
MarillPicFront::       INCBIN "pic/bmon/marill.pic"
MarillPicBack::        INCBIN "pic/monback/marillb.pic"
PonytaPicFront::       INCBIN "pic/bmon/ponyta.pic"
PonytaPicBack::        INCBIN "pic/monback/ponytab.pic"
RapidashPicFront::     INCBIN "pic/bmon/rapidash.pic"
RapidashPicBack::      INCBIN "pic/monback/rapidashb.pic"
RattataPicFront::      INCBIN "pic/bmon/rattata.pic"
RattataPicBack::       INCBIN "pic/monback/rattatab.pic"
RaticatePicFront::     INCBIN "pic/bmon/raticate.pic"
RaticatePicBack::      INCBIN "pic/monback/raticateb.pic"
NidorinoPicFront::     INCBIN "pic/bmon/nidorino.pic"
NidorinoPicBack::      INCBIN "pic/monback/nidorinob.pic"
NidorinaPicFront::     INCBIN "pic/bmon/nidorina.pic"
NidorinaPicBack::      INCBIN "pic/monback/nidorinab.pic"
GeodudePicFront::      INCBIN "pic/bmon/geodude.pic"
GeodudePicBack::       INCBIN "pic/monback/geodudeb.pic"
PorygonPicFront::      INCBIN "pic/bmon/porygon.pic"
PorygonPicBack::       INCBIN "pic/monback/porygonb.pic"
AerodactylPicFront::   INCBIN "pic/bmon/aerodactyl.pic"
AerodactylPicBack::    INCBIN "pic/monback/aerodactylb.pic"
AzumarillPicFront::    INCBIN "pic/bmon/azumarill.pic"
AzumarillPicBack::     INCBIN "pic/monback/azumarillb.pic"
MagnemitePicFront::    INCBIN "pic/bmon/magnemite.pic"
MagnemitePicBack::     INCBIN "pic/monback/magnemiteb.pic"
SudowoodoPicFront::    INCBIN "pic/bmon/sudowoodo.pic"
SudowoodoPicBack::     INCBIN "pic/monback/sudowoodob.pic"
PolitoedPicFront::     INCBIN "pic/bmon/politoed.pic"
PolitoedPicBack::      INCBIN "pic/monback/politoedb.pic"
CharmanderPicFront::   INCBIN "pic/bmon/charmander.pic"
CharmanderPicBack::    INCBIN "pic/monback/charmanderb.pic"
SquirtlePicFront::     INCBIN "pic/bmon/squirtle.pic"
SquirtlePicBack::      INCBIN "pic/monback/squirtleb.pic"
CharmeleonPicFront::   INCBIN "pic/bmon/charmeleon.pic"
CharmeleonPicBack::    INCBIN "pic/monback/charmeleonb.pic"
WartortlePicFront::    INCBIN "pic/bmon/wartortle.pic"
WartortlePicBack::     INCBIN "pic/monback/wartortleb.pic"
CharizardPicFront::    INCBIN "pic/bmon/charizard.pic"
CharizardPicBack::     INCBIN "pic/monback/charizardb.pic"
HoppipPicFront::       INCBIN "pic/bmon/hoppip.pic"
HoppipPicBack::        INCBIN "pic/monback/hoppipb.pic"
FossilAerodactylPic::  INCBIN "pic/bmon/fossilaerodactyl.pic"
GhostPic::             INCBIN "pic/other/ghost.pic"
OddishPicFront::       INCBIN "pic/bmon/oddish.pic"
OddishPicBack::        INCBIN "pic/monback/oddishb.pic"
GloomPicFront::        INCBIN "pic/bmon/gloom.pic"
GloomPicBack::         INCBIN "pic/monback/gloomb.pic"
VileplumePicFront::    INCBIN "pic/bmon/vileplume.pic"
VileplumePicBack::     INCBIN "pic/monback/vileplumeb.pic"
BellsproutPicFront::   INCBIN "pic/bmon/bellsprout.pic"
BellsproutPicBack::    INCBIN "pic/monback/bellsproutb.pic"

SECTION "Pics 7", ROMX, BANK[PICS_7]

WeepinbellPicFront::   INCBIN "pic/bmon/weepinbell.pic"
WeepinbellPicBack::    INCBIN "pic/monback/weepinbellb.pic"
VictreebelPicFront::   INCBIN "pic/bmon/victreebel.pic"
VictreebelPicBack::    INCBIN "pic/monback/victreebelb.pic"
SkiploomPicFront::     INCBIN "pic/bmon/skiploom.pic"
SkiploomPicBack::      INCBIN "pic/monback/skiploomb.pic"
JumpluffPicFront::     INCBIN "pic/bmon/jumpluff.pic"
JumpluffPicBack::      INCBIN "pic/monback/jumpluffb.pic"
AipomPicFront::        INCBIN "pic/bmon/aipom.pic"
AipomPicBack::         INCBIN "pic/monback/aipomb.pic"
SunkernPicFront::      INCBIN "pic/bmon/sunkern.pic"
SunkernPicBack::       INCBIN "pic/monback/sunkernb.pic"
SunfloraPicFront::     INCBIN "pic/bmon/sunflora.pic"
SunfloraPicBack::      INCBIN "pic/monback/sunflorab.pic"
YanmaPicFront::        INCBIN "pic/bmon/yanma.pic"
YanmaPicBack::         INCBIN "pic/monback/yanmab.pic"
WooperPicFront::       INCBIN "pic/bmon/wooper.pic"
WooperPicBack::        INCBIN "pic/monback/wooperb.pic"
QuagsirePicFront::     INCBIN "pic/bmon/quagsire.pic"
QuagsirePicBack::      INCBIN "pic/monback/quagsireb.pic"
EspeonPicFront::       INCBIN "pic/bmon/espeon.pic"
EspeonPicBack::        INCBIN "pic/monback/espeonb.pic"
UmbreonPicFront::      INCBIN "pic/bmon/umbreon.pic"
UmbreonPicBack::       INCBIN "pic/monback/umbreonb.pic"
MurkrowPicFront::      INCBIN "pic/bmon/murkrow.pic"
MurkrowPicBack::       INCBIN "pic/monback/murkrowb.pic"
SlowkingPicFront::     INCBIN "pic/bmon/slowking.pic"
SlowkingPicBack::      INCBIN "pic/monback/slowkingb.pic"
MisdreavusPicFront::   INCBIN "pic/bmon/misdreavus.pic"
MisdreavusPicBack::    INCBIN "pic/monback/misdreavusb.pic"
UnownPicFront::        INCBIN "pic/bmon/unown-h.pic"
UnownPicBack::         INCBIN "pic/monback/unown-hb.pic"
WobbuffetPicFront::    INCBIN "pic/bmon/wobbuffet.pic"
WobbuffetPicBack::     INCBIN "pic/monback/wobbuffetb.pic"
GirafarigPicFront::    INCBIN "pic/bmon/girafarig.pic"
GirafarigPicBack::     INCBIN "pic/monback/girafarigb.pic"
PinecoPicFront::       INCBIN "pic/bmon/pineco.pic"
PinecoPicBack::        INCBIN "pic/monback/pinecob.pic"
ForretressPicFront::   INCBIN "pic/bmon/forretress.pic"
ForretressPicBack::    INCBIN "pic/monback/forretressb.pic"
DunsparcePicFront::    INCBIN "pic/bmon/dunsparce.pic"
DunsparcePicBack::     INCBIN "pic/monback/dunsparceb.pic"
GligarPicFront::       INCBIN "pic/bmon/gligar.pic"
GligarPicBack::        INCBIN "pic/monback/gligarb.pic"
SteelixPicFront::      INCBIN "pic/bmon/steelix.pic"
SteelixPicBack::       INCBIN "pic/monback/steelixb.pic"
SnubbullPicFront::     INCBIN "pic/bmon/snubbull.pic"
SnubbullPicBack::      INCBIN "pic/monback/snubbullb.pic"
GranbullPicFront::     INCBIN "pic/bmon/granbull.pic"
GranbullPicBack::      INCBIN "pic/monback/granbullb.pic"
QwilfishPicFront::     INCBIN "pic/bmon/qwilfish.pic"
QwilfishPicBack::      INCBIN "pic/monback/qwilfishb.pic"
ScizorPicFront::       INCBIN "pic/bmon/scizor.pic"
ScizorPicBack::        INCBIN "pic/monback/scizorb.pic"
ShucklePicFront::      INCBIN "pic/bmon/shuckle.pic"
ShucklePicBack::       INCBIN "pic/monback/shuckleb.pic"
HeracrossPicFront::    INCBIN "pic/bmon/heracross.pic"
HeracrossPicBack::     INCBIN "pic/monback/heracrossb.pic"
SneaselPicFront::      INCBIN "pic/bmon/sneasel.pic"
SneaselPicBack::       INCBIN "pic/monback/sneaselb.pic"
TeddiursaPicFront::    INCBIN "pic/bmon/teddiursa.pic"
TeddiursaPicBack::     INCBIN "pic/monback/teddiursab.pic"
UrsaringPicFront::     INCBIN "pic/bmon/ursaring.pic"
UrsaringPicBack::      INCBIN "pic/monback/ursaringb.pic"
SlugmaPicFront::       INCBIN "pic/bmon/slugma.pic"
SlugmaPicBack::        INCBIN "pic/monback/slugmab.pic"
MagcargoPicFront::     INCBIN "pic/bmon/magcargo.pic"
MagcargoPicBack::      INCBIN "pic/monback/magcargob.pic"
SwinubPicFront::       INCBIN "pic/bmon/swinub.pic"
SwinubPicBack::        INCBIN "pic/monback/swinubb.pic"
PiloswinePicFront::    INCBIN "pic/bmon/piloswine.pic"
PiloswinePicBack::     INCBIN "pic/monback/piloswineb.pic"

SECTION "Pics 8", ROMX, BANK[PICS_8]

CorsolaPicFront::      INCBIN "pic/bmon/corsola.pic"
CorsolaPicBack::       INCBIN "pic/monback/corsolab.pic"
RemoraidPicFront::     INCBIN "pic/bmon/remoraid.pic"
RemoraidPicBack::      INCBIN "pic/monback/remoraidb.pic"
OctilleryPicFront::    INCBIN "pic/bmon/octillery.pic"
OctilleryPicBack::     INCBIN "pic/monback/octilleryb.pic"
DelibirdPicFront::     INCBIN "pic/bmon/delibird.pic"
DelibirdPicBack::      INCBIN "pic/monback/delibirdb.pic"
MantinePicFront::      INCBIN "pic/bmon/mantine.pic"
MantinePicBack::       INCBIN "pic/monback/mantineb.pic"
SkarmoryPicFront::     INCBIN "pic/bmon/skarmory.pic"
SkarmoryPicBack::      INCBIN "pic/monback/skarmoryb.pic"
HoundourPicFront::     INCBIN "pic/bmon/houndour.pic"
HoundourPicBack::      INCBIN "pic/monback/houndourb.pic"
HoundoomPicFront::     INCBIN "pic/bmon/houndoom.pic"
HoundoomPicBack::      INCBIN "pic/monback/houndoomb.pic"
KingdraPicFront::      INCBIN "pic/bmon/kingdra.pic"
KingdraPicBack::       INCBIN "pic/monback/kingdrab.pic"
PhanpyPicFront::       INCBIN "pic/bmon/phanpy.pic"
PhanpyPicBack::        INCBIN "pic/monback/phanpyb.pic"
DonphanPicFront::      INCBIN "pic/bmon/donphan.pic"
DonphanPicBack::       INCBIN "pic/monback/donphanb.pic"
Porygon2PicFront::     INCBIN "pic/bmon/porygon2.pic"
Porygon2PicBack::      INCBIN "pic/monback/porygon2b.pic"
StantlerPicFront::     INCBIN "pic/bmon/stantler.pic"
StantlerPicBack::      INCBIN "pic/monback/stantlerb.pic"
SmearglePicFront::     INCBIN "pic/bmon/smeargle.pic"
SmearglePicBack::      INCBIN "pic/monback/smeargleb.pic"
TyroguePicFront::           INCBIN "pic/bmon/tyrogue.pic"
TyroguePicBack::           INCBIN "pic/monback/tyrogueb.pic"
HitmontopPicFront::    INCBIN "pic/bmon/hitmontop.pic"
HitmontopPicBack::     INCBIN "pic/monback/hitmontopb.pic"
SmoochumPicFront::     INCBIN "pic/bmon/smoochum.pic"
SmoochumPicBack::      INCBIN "pic/monback/smoochumb.pic"
ElekidPicFront::       INCBIN "pic/bmon/elekid.pic"
ElekidPicBack::        INCBIN "pic/monback/elekidb.pic"
MagbyPicFront::        INCBIN "pic/bmon/magby.pic"
MagbyPicBack::         INCBIN "pic/monback/magbyb.pic"
MiltankPicFront::      INCBIN "pic/bmon/miltank.pic"
MiltankPicBack::       INCBIN "pic/monback/miltankb.pic"
BlisseyPicFront::      INCBIN "pic/bmon/blissey.pic"
BlisseyPicBack::       INCBIN "pic/monback/blisseyb.pic"
RaikouPicFront::       INCBIN "pic/bmon/raikou.pic"
RaikouPicBack::        INCBIN "pic/monback/raikoub.pic"
EnteiPicFront::        INCBIN "pic/bmon/entei.pic"
EnteiPicBack::         INCBIN "pic/monback/enteib.pic"
SuicunePicFront::      INCBIN "pic/bmon/suicune.pic"
SuicunePicBack::       INCBIN "pic/monback/suicuneb.pic"
LarvitarPicFront::     INCBIN "pic/bmon/larvitar.pic"
LarvitarPicBack::      INCBIN "pic/monback/larvitarb.pic"
PupitarPicFront::      INCBIN "pic/bmon/pupitar.pic"
PupitarPicBack::       INCBIN "pic/monback/pupitarb.pic"
TyranitarPicFront::    INCBIN "pic/bmon/tyranitar.pic"
TyranitarPicBack::     INCBIN "pic/monback/tyranitarb.pic"
LugiaPicFront::        INCBIN "pic/bmon/lugia.pic"
LugiaPicBack::         INCBIN "pic/monback/lugiab.pic"
Ho_OhPicFront::        INCBIN "pic/bmon/ho_oh.pic"
Ho_OhPicBack::         INCBIN "pic/monback/ho_ohb.pic"
CelebiPicFront::       INCBIN "pic/bmon/celebi.pic"
CelebiPicBack::        INCBIN "pic/monback/celebib.pic"

In home.asm in UncompressMonSprite the original vanilla code to point to the front and back sprites are similar in the vanilla version:

UncompressMonSprite::
    ld bc, wMonHeader
    add hl, bc
    ld a, [hli]
    ld [wSpriteInputPtr], a    ; fetch sprite input pointer
    ld a, [hl]
    ld [wSpriteInputPtr+1], a
    ld a, [wcf91] ; XXX name for this ram location
    ld b, a
    cp FOSSIL_KABUTOPS
    ld a, BANK(FossilKabutopsPic)
    jr z, .GotBank
    ld a, b
    cp PINSIR + 1
    ld a, BANK(PinsirPicFront)
    jr c, .GotBank
    ld a, b
    cp TOTODILE + 1
    ld a, BANK(TotodilePicFront)
    jr c, .GotBank
    ld a, b
    cp HORSEA + 2
    ld a, BANK(HorseaPicFront)
    jr c, .GotBank
    ld a, b
    cp CLEFFA + 1
    ld a, BANK(CleffaPicFront)
    jr c, .GotBank
    ld a, b
    cp PIDGEOT + 1
    ld a, BANK(PidgeotPicFront)
    jr c, .GotBank
    ld a, b
    cp BELLSPROUT + 1
    ld a, BANK(BellsproutPicFront)
    jr c, .GotBank
    ld a, b
    cp PILOSWINE + 1
    ld a, BANK(PiloswinePicFront)
    jr c, .GotBank
    ld a, BANK(CelebiPicFront)
.GotBank
    jp UncompressSpriteData

Currently the culprit of this problem is coming from battle/core.asm in the InitBattleCommon routine and any other places which are using a 200 subtraction or anywhere thats using a cp check of 200 or $C8.

I have tried one approach to try and patch this. It involved creating a new short in WRAM and setting it to the current trainer focus when a trainer battle is registered and resetting whenever a battle has ended in any scenario. When there is no value provided then it implies it should initialize a wild battle and when a value is contained then it should continue to assume that its a trainer battle. However this only worked after one trainer loss/win and after that encountering a trainer again will have the game not find the correct trainer class and result in a crash.

Has anyone been able to solve this? Could anyone provide any suggestions on how this can be solved? Also if there's already a repo that implements a stable version of this can someone provide it?

Thanks.

Last edited by Missingno (2018-08-20 00:38:06)

Offline

#2 2018-08-20 02:51:49

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,560/3,578

Re: Importing Gen II Monsters in Vanilla Red

I see this asked a lot recently. After work, I'll try to find the commits where I separated them in Red++ and link them. I just copied what Sanqui did in his Red Randomizer.

Offline

#3 2018-08-20 12:47:49

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,561/3,578

Re: Importing Gen II Monsters in Vanilla Red

Keep in mind this was done on a copy of pokered that is pretty outdated now.
Here is the first commit where I added it.
Here was a bugfix to it later.

Hopefully that will at least help a little.

Offline

#4 2018-08-20 22:23:57

Missingno
New member
Registered: 2017-06-03
Post 4/4

Re: Importing Gen II Monsters in Vanilla Red

Mateo wrote:

Keep in mind this was done on a copy of pokered that is pretty outdated now.
Here is the first commit where I added it.
Here was a bugfix to it later.

Hopefully that will at least help a little.

I applied the appropriate changes to my version and it worked! I knew somewhere along the lines using some extra WRAM variables and treating them as boolean values was a good approach it seemed my strategy was lacking some coverage and some other important nuances. I was also using 'or a' to clear up the values in the accumulator as opposed to xor a. For some odd reason the changes also cleared a small side effect I was having in the overworld.

Thanks again those commits helped me understand whats going on now.

Last edited by Missingno (2018-08-20 22:24:40)

Offline

#5 2018-08-21 03:19:03

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,562/3,578

Re: Importing Gen II Monsters in Vanilla Red

Glad to help!

Offline

Board footer

Powered by FluxBB