get rid of pointers in pokedex

This commit is contained in:
DizzyEggg 2017-12-22 18:43:41 +01:00
parent cddd44834e
commit 08ebf59e44
5 changed files with 419 additions and 81 deletions

View File

@ -2028,7 +2028,7 @@ _080BC56E:
bl SetGpuReg
movs r0, 0
bl ResetBgsAndClearDma3BusyFlags
ldr r1, =gUnknown_0855D298
ldr r1, =gBgTemplates_0855D298
movs r0, 0
movs r2, 0x4
bl InitBgsFromTemplates
@ -2119,7 +2119,7 @@ _080BC682:
lsls r0, 31
lsrs r0, 31
bl sub_80BC844
ldr r0, =gUnknown_0855D2A8
ldr r0, =sWindowTemplates_0855D2A8
bl InitWindows
bl DeactivateAllTextPrinters
movs r0, 0
@ -2141,9 +2141,9 @@ _080BC6CC:
ldr r1, =gReservedSpritePaletteCount
movs r0, 0x8
strb r0, [r1]
ldr r0, =gUnknown_0855D26C
ldr r0, =gSpriteSheets_0855D26C
bl LoadCompressedObjectPic
ldr r0, =gUnknown_0855D27C
ldr r0, =gSpritePalettes_0855D26C
bl LoadSpritePalettes
adds r0, r5, 0
bl sub_80BDB7C
@ -2298,7 +2298,7 @@ _080BC858:
bl IsNationalPokedexEnabled
cmp r0, 0
bne _080BC870
ldr r0, =gUnknown_08DC16F6
ldr r0, =gUnknown_08DC16F4 + 2
_080BC862:
movs r1, 0x1
movs r2, 0xBE
@ -3517,7 +3517,7 @@ sub_80BD23C: @ 80BD23C
b _080BD266
.pool
_080BD264:
ldr r4, =gUnknown_0855D2FE
ldr r4, =sText_TenDashes
_080BD266:
str r5, [sp]
movs r0, 0
@ -8751,7 +8751,7 @@ _080C00E8:
ands r1, r0
cmp r1, 0
beq _080C0114
ldr r0, =gUnknown_08DC16F6
ldr r0, =gUnknown_08DC16F4 + 2
movs r1, 0x31
movs r2, 0xE
bl LoadPalette
@ -11172,9 +11172,9 @@ _080C13F0:
b _080C1516
.pool
_080C1414:
ldr r0, =gUnknown_0855D26C
ldr r0, =gSpriteSheets_0855D26C
bl LoadCompressedObjectPic
ldr r0, =gUnknown_0855D27C
ldr r0, =gSpritePalettes_0855D26C
bl LoadSpritePalettes
adds r0, r4, 0
bl sub_80C2594

View File

@ -1217,10 +1217,10 @@ gUnknown_08DC0754:: @ 8DC0754
.incbin "baserom.gba", 0xdc0754, 0x440
gUnknown_08DC0B94:: @ 8DC0B94
.incbin "baserom.gba", 0xdc0b94, 0xb62
.incbin "baserom.gba", 0xdc0b94, 0xb60
gUnknown_08DC16F6:: @ 8DC16F6
.incbin "baserom.gba", 0xdc16f6, 0x60
gUnknown_08DC16F4:: @ 8DC16F4
.incbin "baserom.gba", 0xdc16f4, 0x62
gUnknown_08DC1756:: @ 8DC1756
.incbin "baserom.gba", 0xdc1756, 0x60
@ -1232,7 +1232,10 @@ gUnknown_08DC1876:: @ 8DC1876
.incbin "baserom.gba", 0xdc1876, 0xbe
gUnknown_08DC1934:: @ 8DC1934
.incbin "baserom.gba", 0xdc1934, 0x10d4
.incbin "baserom.gba", 0xdc1934, 0xA18
gUnknown_08DC234C:: @ 8DC234C
.incbin "baserom.gba", 0xDC234C, 0x6BC
gUnknown_08DC2A08:: @ 8DC2A08
.incbin "baserom.gba", 0xdc2a08, 0x114

View File

@ -4,53 +4,23 @@
.section .rodata
.align 2, 0
gUnknown_0855D114:: @ 855D114
.incbin "baserom.gba", 0x55D114, 0x80
.macro unk_dex_struct texts, a2, a3, a4
.4byte \texts
.byte \a2, \a3, \a4
.byte 0 @padding
.endm
gUnknown_0855D194:: @ 855D194
.incbin "baserom.gba", 0x55d194, 0x18
.macro unk_dex_struct_2 text, a2, a3, a4, a5, a6, a7
.4byte \text
.byte \a2, \a3, \a4, \a5, \a6, \a7
.2byte 0 @padding
.endm
gUnknown_0855D1AC:: @ 855D1AC
.incbin "baserom.gba", 0x55d1ac, 0x18
gUnknown_0855D1C4:: @ 855D1C4
.incbin "baserom.gba", 0x55d1c4, 0x18
gUnknown_0855D1DC:: @ 855D1DC
.incbin "baserom.gba", 0x55d1dc, 0x18
gUnknown_0855D1F4:: @ 855D1F4
.incbin "baserom.gba", 0x55d1f4, 0x18
gUnknown_0855D20C:: @ 855D20C
.incbin "baserom.gba", 0x55d20c, 0x18
gUnknown_0855D224:: @ 855D224
.incbin "baserom.gba", 0x55d224, 0x18
gUnknown_0855D23C:: @ 855D23C
.incbin "baserom.gba", 0x55d23c, 0x18
gUnknown_0855D254:: @ 855D254
.incbin "baserom.gba", 0x55d254, 0x18
gUnknown_0855D26C:: @ 855D26C
.incbin "baserom.gba", 0x55d26c, 0x10
gUnknown_0855D27C:: @ 855D27C
.incbin "baserom.gba", 0x55d27c, 0x10
gUnknown_0855D28C:: @ 855D28C
.incbin "baserom.gba", 0x55d28c, 0x5
gUnknown_0855D291:: @ 855D291
.incbin "baserom.gba", 0x55d291, 0x7
gUnknown_0855D298:: @ 855D298
.incbin "baserom.gba", 0x55d298, 0x10
gUnknown_0855D2A8:: @ 855D2A8
.incbin "baserom.gba", 0x55d2a8, 0x10
.macro unk_dex_struct_3 text, a2, a3, a4
.4byte \text
.byte \a2, \a3, \a4
.byte 0 @padding
.endm
gUnknown_0855D2B8:: @ 855D2B8
.incbin "baserom.gba", 0x55d2b8, 0x6
@ -58,8 +28,10 @@ gUnknown_0855D2B8:: @ 855D2B8
gUnknown_0855D2BE:: @ 855D2BE
.incbin "baserom.gba", 0x55d2be, 0x40
gUnknown_0855D2FE:: @ 855D2FE
.incbin "baserom.gba", 0x55d2fe, 0xe
sText_TenDashes:: @ 855D2FE
.string "----------$"
.align 2
gUnknown_0855D30C:: @ 855D30C
.string "$"
@ -95,10 +67,18 @@ gUnknown_0856ED08:: @ 856ED08
.incbin "baserom.gba", 0x56ed08, 0x28
gUnknown_0856ED30:: @ 856ED30
.incbin "baserom.gba", 0x56ed30, 0x18
unk_dex_struct_3 gUnknown_085E87A5, 0, 0, 5
unk_dex_struct_3 gUnknown_085E87D6, 6, 0, 5
unk_dex_struct_3 gUnknown_085E87EF, 12, 0, 5
gUnknown_0856ED48:: @ 856ED48
.incbin "baserom.gba", 0x56ed48, 0x54
unk_dex_struct_2 gUnknown_085E8840, 0, 2, 5, 5, 2, 12
unk_dex_struct_2 gUnknown_085E887C, 0, 4, 5, 5, 4, 12
unk_dex_struct_2 gUnknown_085E88A6, 0, 6, 5, 5, 6, 6
unk_dex_struct_2 gUnknown_085E88A6, 0, 6, 5, 11, 6, 6
unk_dex_struct_2 gUnknown_085E881F, 0, 8, 5, 5, 8, 12
unk_dex_struct_2 gUnknown_085E8806, 0, 10, 5, 5, 10, 12
unk_dex_struct_2 gUnknown_085E88C8, 0, 12, 5, 0, 0, 0
gUnknown_0856ED9C:: @ 856ED9C
.incbin "baserom.gba", 0x56ed9c, 0x1c
@ -113,19 +93,119 @@ gUnknown_0856EDF0:: @ 856EDF0
.incbin "baserom.gba", 0x56edf0, 0x1c
gUnknown_0856EE0C:: @ 856EE0C
.incbin "baserom.gba", 0x56ee0c, 0x18
.4byte gUnknown_085E89A4
.4byte gUnknown_085E88DF
.4byte gUnknown_085E89BB
.4byte gUnknown_085E88E9
.4byte NULL
.4byte NULL
gUnknown_0856EE24:: @ 856EE24
.incbin "baserom.gba", 0x56ee24, 0x38
.4byte gUnknown_085E89D4
.4byte gUnknown_085E88F6
.4byte gUnknown_085E8A02
.4byte gUnknown_085E8905
.4byte gUnknown_085E8A37
.4byte gUnknown_085E8911
.4byte gUnknown_085E8A73
.4byte gUnknown_085E891F
.4byte gUnknown_085E8AAF
.4byte gUnknown_085E892D
.4byte gUnknown_085E8AEA
.4byte gUnknown_085E893A
.4byte 0
.4byte 0
gUnknown_0856EE5C:: @ 856EE5C
.incbin "baserom.gba", 0x56ee5c, 0x58
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8B26
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8948
.4byte gUnknown_085E8B25
.4byte gUnknown_085E894C
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8950
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8954
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8958
.4byte gUnknown_085E8B25
.4byte gUnknown_085E895C
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8960
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8964
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8968
.4byte 0
.4byte 0
gUnknown_0856EEB4:: @ 856EEB4
.incbin "baserom.gba", 0x56eeb4, 0x60
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8B26
.4byte gUnknown_085E8B25
.4byte gUnknown_085E896B
.4byte gUnknown_085E8B25
.4byte gUnknown_085E896F
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8974
.4byte gUnknown_085E8B25
.4byte gUnknown_085E897B
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8981
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8987
.4byte gUnknown_085E8B25
.4byte gUnknown_085E898D
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8994
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8999
.4byte gUnknown_085E8B25
.4byte gUnknown_085E899F
.4byte 0
.4byte 0
@ read from type table for each type except ???, entry is 7 byte of length
gUnknown_0856EF14:: @ 856EF14
.incbin "baserom.gba", 0x56ef14, 0x98
.4byte gUnknown_085E8B25
.4byte gUnknown_085E8B35
.4byte gUnknown_085E8B25
.4byte gTypeNames + 0
.4byte gUnknown_085E8B25
.4byte gTypeNames + 7
.4byte gUnknown_085E8B25
.4byte gTypeNames + 14
.4byte gUnknown_085E8B25
.4byte gTypeNames + 21
.4byte gUnknown_085E8B25
.4byte gTypeNames + 28
.4byte gUnknown_085E8B25
.4byte gTypeNames + 35
.4byte gUnknown_085E8B25
.4byte gTypeNames + 42
.4byte gUnknown_085E8B25
.4byte gTypeNames + 49
.4byte gUnknown_085E8B25
.4byte gTypeNames + 56
.4byte gUnknown_085E8B25
.4byte gTypeNames + 70
.4byte gUnknown_085E8B25
.4byte gTypeNames + 77
.4byte gUnknown_085E8B25
.4byte gTypeNames + 84
.4byte gUnknown_085E8B25
.4byte gTypeNames + 91
.4byte gUnknown_085E8B25
.4byte gTypeNames + 98
.4byte gUnknown_085E8B25
.4byte gTypeNames + 105
.4byte gUnknown_085E8B25
.4byte gTypeNames + 112
.4byte gUnknown_085E8B25
.4byte gTypeNames + 119
.4byte 0
.4byte 0
gUnknown_0856EFAC:: @ 856EFAC
.incbin "baserom.gba", 0x56efac, 0x2
@ -137,7 +217,12 @@ gUnknown_0856EFB4:: @ 856EFB4
.incbin "baserom.gba", 0x56efb4, 0x14
gUnknown_0856EFC8:: @ 856EFC8
.incbin "baserom.gba", 0x56efc8, 0x30
unk_dex_struct gUnknown_0856EE5C, 6, 7, 10
unk_dex_struct gUnknown_0856EEB4, 8, 9, 11
unk_dex_struct gUnknown_0856EF14, 10,11, 18
unk_dex_struct gUnknown_0856EF14, 12, 13, 18
unk_dex_struct gUnknown_0856EE24, 4, 5, 6
unk_dex_struct gUnknown_0856EE0C, 2, 3, 2
gUnknown_0856EFF8:: @ 856EFF8
.incbin "baserom.gba", 0x56eff8, 0x10

View File

@ -238,4 +238,7 @@ extern const u8 gBattleTerrainPalette_StadiumGlacia[];
extern const u8 gBattleTerrainPalette_StadiumDrake[];
extern const u8 gBattleTerrainPalette_StadiumWallace[];
extern const u8 gUnknown_08DC234C[];
extern const u8 gUnknown_08DC16F4[];
#endif //GUARD_GRAPHICS_H

View File

@ -1,10 +1,24 @@
#include "global.h"
#include "gba/m4a_internal.h"
#include "pokedex.h"
#include "sprite.h"
#include "graphics.h"
#include "decompress.h"
#include "bg.h"
#include "window.h"
// this file's functions
void sub_80BE604(struct Sprite *sprite);
void sub_80BE658(struct Sprite *sprite);
void sub_80BE758(struct Sprite *sprite);
void sub_80BE780(struct Sprite *sprite);
void sub_80BE44C(struct Sprite *sprite);
void sub_80BE834(struct Sprite *sprite);
// const rom data
#include "data/pokedex_orders.h"
static const struct OamData gOamData_83A0404 =
static const struct OamData sOamData_855CFE4 =
{
.y = 160,
.affineMode = 0,
@ -18,9 +32,10 @@ static const struct OamData gOamData_83A0404 =
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
.affineParam = 0,
.affineParam = 0
};
static const struct OamData gOamData_83A040C =
static const struct OamData sOamData_855CFEC =
{
.y = 160,
.affineMode = 0,
@ -34,9 +49,10 @@ static const struct OamData gOamData_83A040C =
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0,
.affineParam = 0
};
static const struct OamData gOamData_83A0414 =
static const struct OamData sOamData_855CFF4 =
{
.y = 160,
.affineMode = 0,
@ -50,9 +66,10 @@ static const struct OamData gOamData_83A0414 =
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0,
.affineParam = 0
};
static const struct OamData gOamData_83A041C =
static const struct OamData sOamData_855CFFC =
{
.y = 160,
.affineMode = 0,
@ -66,9 +83,10 @@ static const struct OamData gOamData_83A041C =
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
.affineParam = 0,
.affineParam = 0
};
static const struct OamData gOamData_83A0424 =
static const struct OamData sOamData_855D004 =
{
.y = 160,
.affineMode = 0,
@ -82,9 +100,10 @@ static const struct OamData gOamData_83A0424 =
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0,
.affineParam = 0
};
static const struct OamData gOamData_83A042C =
static const struct OamData sOamData_855D00C =
{
.y = 160,
.affineMode = 0,
@ -98,10 +117,9 @@ static const struct OamData gOamData_83A042C =
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0,
.affineParam = 0
};
static const union AnimCmd sSpriteAnim_855D014[] =
{
ANIMCMD_FRAME(3, 30),
@ -293,3 +311,232 @@ static const union AnimCmd sSpriteAnim_855D10C[] =
ANIMCMD_FRAME(4, 30),
ANIMCMD_END
};
static const union AnimCmd *const sSpriteAnimTable_855D114[] =
{
sSpriteAnim_855D014
};
static const union AnimCmd *const sSpriteAnimTable_855D118[] =
{
sSpriteAnim_855D01C
};
static const union AnimCmd *const sSpriteAnimTable_855D11C[] =
{
sSpriteAnim_855D024
};
static const union AnimCmd *const sSpriteAnimTable_855D120[] =
{
sSpriteAnim_855D02C,
sSpriteAnim_855D034,
sSpriteAnim_855D03C,
sSpriteAnim_855D044
};
static const union AnimCmd *const sSpriteAnimTable_855D130[] =
{
sSpriteAnim_855D04C,
sSpriteAnim_855D054
};
static const union AnimCmd *const sSpriteAnimTable_855D138[] =
{
sSpriteAnim_855D05C,
sSpriteAnim_855D064
};
static const union AnimCmd *const sSpriteAnimTable_855D140[] =
{
sSpriteAnim_855D06C,
sSpriteAnim_855D074,
sSpriteAnim_855D07C,
sSpriteAnim_855D084,
sSpriteAnim_855D08C,
sSpriteAnim_855D094,
sSpriteAnim_855D09C,
sSpriteAnim_855D0A4,
sSpriteAnim_855D0AC,
sSpriteAnim_855D0B4
};
static const union AnimCmd *const sSpriteAnimTable_855D168[] =
{
sSpriteAnim_855D0BC,
sSpriteAnim_855D0C4,
sSpriteAnim_855D0CC,
sSpriteAnim_855D0D4,
sSpriteAnim_855D0DC,
sSpriteAnim_855D0E4,
sSpriteAnim_855D0EC,
sSpriteAnim_855D0F4,
sSpriteAnim_855D0FC,
sSpriteAnim_855D104
};
static const union AnimCmd *const sSpriteAnimTable_855D190[] =
{
sSpriteAnim_855D10C
};
const struct SpriteTemplate gUnknown_0855D194 =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855CFE4,
.anims = sSpriteAnimTable_855D114,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE604,
};
const struct SpriteTemplate gUnknown_0855D1AC =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855CFEC,
.anims = sSpriteAnimTable_855D118,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE658,
};
const struct SpriteTemplate gUnknown_0855D1C4 =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855CFF4,
.anims = sSpriteAnimTable_855D120,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE758,
};
const struct SpriteTemplate gUnknown_0855D1DC =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855CFFC,
.anims = sSpriteAnimTable_855D11C,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE780,
};
const struct SpriteTemplate gUnknown_0855D1F4 =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855D004,
.anims = sSpriteAnimTable_855D130,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE44C,
};
const struct SpriteTemplate gUnknown_0855D20C =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855CFF4,
.anims = sSpriteAnimTable_855D138,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE44C,
};
const struct SpriteTemplate gUnknown_0855D224 =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855D00C,
.anims = sSpriteAnimTable_855D140,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE44C,
};
const struct SpriteTemplate gUnknown_0855D23C =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855D00C,
.anims = sSpriteAnimTable_855D168,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE44C,
};
const struct SpriteTemplate gUnknown_0855D254 =
{
.tileTag = 4096,
.paletteTag = 4096,
.oam = &sOamData_855D00C,
.anims = sSpriteAnimTable_855D190,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80BE834,
};
const struct CompressedSpriteSheet gSpriteSheets_0855D26C[] =
{
{gUnknown_08DC234C, 0x2000, 4096},
{0}
};
const struct CompressedSpritePalette gSpritePalettes_0855D26C[] =
{
{gUnknown_08DC16F4, 4096},
{0}
};
const u8 gUnknown_0855D28C[] = {0x4, 0x8, 0x10, 0x20, 0x20};
const u8 gUnknown_0855D291[] = {0x8, 0x4, 0x2, 0x1, 0x1};
const struct BgTemplate gBgTemplates_0855D298[] =
{
{
.bg = 0,
.charBaseIndex = 0,
.mapBaseIndex = 12,
.screenSize = 0,
.paletteMode = 0,
.priority = 0,
.baseTile = 0
},
{
.bg = 1,
.charBaseIndex = 0,
.mapBaseIndex = 13,
.screenSize = 0,
.paletteMode = 0,
.priority = 1,
.baseTile = 0
},
{
.bg = 2,
.charBaseIndex = 2,
.mapBaseIndex = 14,
.screenSize = 0,
.paletteMode = 0,
.priority = 2,
.baseTile = 0
},
{
.bg = 3,
.charBaseIndex = 0,
.mapBaseIndex = 15,
.screenSize = 0,
.paletteMode = 0,
.priority = 3,
.baseTile = 0
}
};
const struct WindowTemplate sWindowTemplates_0855D2A8[] =
{
{2, 0, 0, 0x20, 0x20, 0, 1},
DUMMY_WIN_TEMPLATE
};