diff options
author | jiangzhengwenjz <jiangzhengwenjzw@qq.com> | 2019-07-14 08:17:42 +0800 |
---|---|---|
committer | jiangzhengwenjz <jiangzhengwenjzw@qq.com> | 2019-07-14 08:17:42 +0800 |
commit | fc16f5ac4f937c7ecd3b196878e4d33b7f752dcd (patch) | |
tree | c60dda0811210b1ced77f274b6f438d5185b9c96 | |
parent | 1caed4e6320570e9815ef43a4f0ebd14cc52c066 (diff) |
start of data decomp and data.s setup
-rw-r--r-- | data/data.s | 82 | ||||
-rw-r--r-- | ld_script.txt | 1 | ||||
-rw-r--r-- | src/pokemon.c | 97 |
3 files changed, 144 insertions, 36 deletions
diff --git a/data/data.s b/data/data.s index 286bad013..79b048241 100644 --- a/data/data.s +++ b/data/data.s @@ -68,7 +68,52 @@ gUnknown_8234690:: @ 8234690 .incbin "baserom.gba", 0x234690, 0x4 gUnknown_8234694:: @ 8234694 - .incbin "baserom.gba", 0x234694, 0x328 + .incbin "baserom.gba", 0x234694, 0x4 + +gUnknown_8234698:: @ 8234698 + .incbin "baserom.gba", 0x234698, 0x20 + +gUnknown_82346B8:: @ 82346B8 + .incbin "baserom.gba", 0x2346B8, 0x20 + +gUnknown_82346D8:: @ 82346D8 + .incbin "baserom.gba", 0x2346D8, 0x20 + +gUnknown_82346F8:: @ 82346F8 + .incbin "baserom.gba", 0x2346F8, 0x20 + +gUnknown_8234718:: @ 8234718 + .incbin "baserom.gba", 0x234718, 0x28 + +gUnknown_8234740:: @ 8234740 + .incbin "baserom.gba", 0x234740, 0x28 + +gUnknown_8234768:: @ 8234768 + .incbin "baserom.gba", 0x234768, 0x20 + +gUnknown_8234788:: @ 8234788 + .incbin "baserom.gba", 0x234788, 0x20 + +gUnknown_82347A8:: @ 82347A8 + .incbin "baserom.gba", 0x2347A8, 0x20 + +gUnknown_82347C8:: @ 82347C8 + .incbin "baserom.gba", 0x2347C8, 0x20 + +gUnknown_82347E8:: @ 82347E8 + .incbin "baserom.gba", 0x2347E8, 0xE0 + +gUnknown_82348C8:: @ 82348C8 + .incbin "baserom.gba", 0x2348C8, 0x24 + +gUnknown_82348EC:: @ 82348EC + .incbin "baserom.gba", 0x2348EC, 0x58 + +gUnknown_8234944:: @ 8234944 + .incbin "baserom.gba", 0x234944, 0x58 + +gUnknown_823499C:: @ 823499C + .incbin "baserom.gba", 0x23499C, 0x20 gUnknown_82349BC:: @ 82349BC .incbin "baserom.gba", 0x2349BC, 0x10 @@ -174,7 +219,16 @@ gUnknown_824EFF0:: @ 824EFF0 .incbin "baserom.gba", 0x24EFF0, 0x18 gUnknown_824F008:: @ 824F008 - .incbin "baserom.gba", 0x24F008, 0x40 + .incbin "baserom.gba", 0x24F008, 0x8 + +gUnknown_824F010:: @ 824F010 + .incbin "baserom.gba", 0x24F010, 0x8 + +gUnknown_824F018:: @ 824F018 + .incbin "baserom.gba", 0x24F018, 0x8 + +gUnknown_824F020:: @ 824F020 + .incbin "baserom.gba", 0x24F020, 0x28 gUnknown_824F048:: @ 824F048 .incbin "baserom.gba", 0x24F048, 0x8 @@ -523,30 +577,6 @@ gUnknown_825DEF0:: @ 825DEF0 gUnknown_825DF50:: @ 825DF50 .incbin "baserom.gba", 0x25DF50, 0x90 -sSecretBaseFacilityClasses:: @ 825DFE0 - .incbin "baserom.gba", 0x25DFE0, 0xA - -sGetMonDataEVConstants:: @ 825DFEA - .incbin "baserom.gba", 0x25DFEA, 0x6 - -gUnknown_825DFF0:: @ 825DFF0 - .incbin "baserom.gba", 0x25DFF0, 0x6 - -sFriendshipEventDeltas:: @ 825DFF6 - .incbin "baserom.gba", 0x25DFF6, 0x1E - -sHMMoves:: @ 825E014 - .incbin "baserom.gba", 0x25E014, 0x12 - -sDeoxysBaseStats:: @ 825E026 - .incbin "baserom.gba", 0x25E026, 0xC - -gLinkPlayerFacilityClasses:: @ 825E032 - .incbin "baserom.gba", 0x25E032, 0x2A - -gUnknown_825E05C:: @ 825E05C - .incbin "baserom.gba", 0x25E05C, 0x18 - .section .rodata.825EF0C .align 2 diff --git a/ld_script.txt b/ld_script.txt index 1e9974d21..2159a7390 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -380,6 +380,7 @@ SECTIONS { src/bg_regs.o(.rodata); src/string_util.o(.rodata); data/data.o(.rodata); + src/pokemon.o(.rodata); src/trig.o(.rodata); src/util.o(.rodata); src/daycare.o(.rodata); diff --git a/src/pokemon.c b/src/pokemon.c index 2c2264f05..e1c8c6d43 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -80,17 +80,9 @@ static u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move); static u8 GetLevelFromMonExp(struct Pokemon *mon); static u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon); -// decomp here extern struct SpriteTemplate gUnknown_825DF50[]; -extern const u16 sDeoxysBaseStats[]; -extern const u16 gLinkPlayerFacilityClasses[]; -extern const struct SpriteTemplate gUnknown_825E05C; extern s8 gPokeblockFlavorCompatibilityTable[]; -extern const u16 sHMMoves[]; extern const u8 gPPUpWriteMasks[]; -extern const u8 sSecretBaseFacilityClasses[2][5]; -extern const s8 sFriendshipEventDeltas[][3]; -extern const u8 gUnknown_825DFF0[]; extern const u8 sHoldEffectToType[][2]; extern u16 gUnknown_8251CB8[]; extern u16 gUnknown_8251FEE[]; @@ -103,7 +95,92 @@ extern s8 gNatureStatTable[][5]; extern u32 gTMHMLearnsets[][2]; extern const u8 gUnknown_825DEA1[]; extern const u8 gUnknown_825DEA9[]; -extern const u8 sGetMonDataEVConstants[]; + +static const u8 sSecretBaseFacilityClasses[][5] = +{ + { 0x58, 0x58, 0x58, 0x58, 0x58 }, + { 0x58, 0x58, 0x58, 0x58, 0x58 }, +}; + +static const u8 sGetMonDataEVConstants[] = +{ + MON_DATA_HP_EV, + MON_DATA_ATK_EV, + MON_DATA_DEF_EV, + MON_DATA_SPEED_EV, + MON_DATA_SPDEF_EV, + MON_DATA_SPATK_EV +}; + +static const u8 gUnknown_825DFF0[] = +{ + STAT_ATK, STAT_ATK, STAT_SPEED, STAT_DEF, STAT_SPATK, STAT_ACC +}; + +static const s8 sFriendshipEventDeltas[][3] = +{ + { 5, 3, 2 }, + { 5, 3, 2 }, + { 1, 1, 0 }, + { 3, 2, 1 }, + { 1, 1, 0 }, + { 1, 1, 1 }, + { 3, 3, 3 }, + {-1, -1, -1 }, + {-5, -5, -10 }, + {-5, -5, -10 }, +}; + +static const u16 sHMMoves[] = +{ + MOVE_CUT, MOVE_FLY, MOVE_SURF, MOVE_STRENGTH, MOVE_FLASH, + MOVE_ROCK_SMASH, MOVE_WATERFALL, MOVE_DIVE, 0xFFFF +}; + +static const u16 sDeoxysBaseStats[] = +{ + 50, // Hp + 180, // Attack + 20, // Defense + 150, // Speed + 180, // Sp.Attack + 20, // Sp.Defense +}; + +const u16 gLinkPlayerFacilityClasses[] = +{ + 0x74, 0x6F, 0x5C, 0x58, 0x6A, + 0x59, 0x6D, 0x6C, 0x75, 0x7D, + 0x5D, 0x5A, 0x89, 0x8A, 0x8C, + 0x68, 0x0, +}; + +const static struct OamData sOakSpeechNidoranFDummyOamData = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, +}; + +const struct SpriteTemplate sOakSpeechNidoranFDummyTemplate = +{ + .tileTag = SPRITE_INVALID_TAG, + .paletteTag = SPRITE_INVALID_TAG, + .oam = &sOakSpeechNidoranFDummyOamData, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; // code void ZeroBoxMonData(struct BoxPokemon *boxMon) @@ -5834,7 +5911,7 @@ static void OakSpeechNidoranFSetupTemplateDummy(struct OakSpeechNidoranFStruct * for (i = 0; i < (s8)structPtr->spriteCount; ++i) { - structPtr->templates[i] = gUnknown_825E05C; + structPtr->templates[i] = sOakSpeechNidoranFDummyTemplate; for (j = 0; j < structPtr->frameCount; ++j) structPtr->frameImages[i * structPtr->spriteCount + j].data = &structPtr->bufferPtrs[i][j * 0x800]; structPtr->templates[i].images = &structPtr->frameImages[i * structPtr->spriteCount]; // should be frameCount logically |