Move const data to ground lives

This commit is contained in:
DizzyEggg 2025-05-23 15:14:03 +02:00
parent 52f0e1e58c
commit b3b973fba9
6 changed files with 477 additions and 609 deletions

View File

@ -2,213 +2,9 @@
.align 2
.string "pksdir0\0"
.align 2,0
.global gGroundLivesCallbacks
gGroundLivesCallbacks: @ 8117F10
.byte 0x01, 0x00, 0x00, 0x00
.4byte CallbackLivesGetIndex
.4byte CallbackLivesGetSize
.4byte CallbackLivesGetHitboxCenter
.4byte CallbackLivesGetPosHeightAndUnk
.4byte CallbackLivesGetDirection
.4byte CallbackLivesGetFlags
.4byte CallbackLivesSetHitboxPos
.4byte CallbackLivesSetPositionBounds
.4byte CallbackLivesMoveReal
.4byte CallbackLivesSetPosHeight
.4byte CallbackLivesSetDirection
.4byte CallbackLivesSetEventIndex
.4byte nullsub_211
.4byte CallbackLivesSetUnk_80AB194
.4byte CallbackLivesSetFlags
.4byte CallbackLivesClearFlags
.4byte CallbackLivesSpriteRelated_80AB238
.4byte CallbackLivesMoveRelative
.4byte CallbackLivesSpriteRelatedCheck_80AB1C0
.4byte CallbackLivesSpriteRelated_80AB1E4
.global gUnknown_8117F64
gUnknown_8117F64: @ 8117F64
@ replacing .incbin "baserom.gba", 0x117F64, 0x6A
.byte 0xff, 0xff, 0x00, 0x08, 0x00, 0x03, 0x00, 0x03, 0x07, 0x08, 0x00, 0x08, 0x05, 0x08, 0x02, 0x03
.byte 0x06, 0x03, 0x0b, 0x08, 0x07, 0x03, 0x06, 0x10, 0x02, 0x10, 0x01, 0x10, 0x08, 0x10, 0x0c, 0x10
.byte 0x09, 0x10, 0x0a, 0x10, 0x03, 0x10, 0x04, 0x10, 0x03, 0x08, 0x04, 0x08, 0x0d, 0x10, 0x0e, 0x10
.byte 0x0f, 0x10, 0x10, 0x10, 0x11, 0x10, 0x12, 0x10, 0x13, 0x10, 0x14, 0x10, 0x0d, 0x08, 0x0e, 0x08
.byte 0x0f, 0x08, 0x10, 0x08, 0x11, 0x08, 0x12, 0x08, 0x13, 0x08, 0x14, 0x08, 0x0d, 0x08, 0x0e, 0x10
.byte 0x0f, 0x10, 0x10, 0x10, 0x11, 0x10, 0x12, 0x08, 0x13, 0x10, 0x14, 0x10, 0x15, 0x10, 0x16, 0x10
.byte 0x17, 0x10, 0x18, 0x08, 0x19, 0x10, 0x1a, 0x08, 0x1b, 0x08
.global gUnknown_8117FCE
gUnknown_8117FCE: @ 8117FCE
@ replacing .incbin "baserom.gba", 0x117FCE, 0x22
.byte 0x19, 0x00, 0x34, 0x00, 0x85, 0x00, 0x45, 0x01, 0x07, 0x00, 0x9e, 0x00, 0x1b, 0x01, 0x36, 0x00
.byte 0x04, 0x00, 0x18, 0x01, 0x9b, 0x00, 0x68, 0x00, 0x42, 0x00, 0x01, 0x00, 0x98, 0x00, 0x15, 0x01
.byte 0x00, 0x00
.global gUnknown_8117FF0
gUnknown_8117FF0: @ 8117FF0
@ replacing .incbin "baserom.gba", 0x117FF0, 0x20
.byte 0x00, 0x06, 0x00, 0x00, 0x41, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x41, 0x04, 0x00, 0x00
.byte 0x00, 0x06, 0x00, 0x00, 0x41, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x41, 0x04, 0x00, 0x00
.global gUnknown_8118010
gUnknown_8118010: @ 8118010
@ replacing .incbin "baserom.gba", 0x118010, 0x20
.byte 0x00, 0x20, 0x00, 0x00, 0xb1, 0x16, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0xb1, 0x16, 0x00, 0x00
.byte 0x00, 0x20, 0x00, 0x00, 0xb1, 0x16, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0xb1, 0x16, 0x00, 0x00
.global gUnknown_8118030
gUnknown_8118030: @ 8118030
@ replacing .incbin "baserom.gba", 0x118030, 0x20
.byte 0x00, 0x08, 0x00, 0x00, 0xac, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0xac, 0x05, 0x00, 0x00
.byte 0x00, 0x08, 0x00, 0x00, 0xac, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0xac, 0x05, 0x00, 0x00
.global gUnknown_8118050
gUnknown_8118050: @ 8118050
.byte 0x00, 0x14, 0x00, 0x00
.byte 0x00, 0x14, 0x00, 0x00
.byte 0x00, 0x18, 0x00, 0x00
.global GroundLivesFile_Text
GroundLivesFile_Text: @ Text
.string "../ground/ground_lives.c\0"
.align 2,0
.global GroundLives_Select_Text
GroundLives_Text: @ Text
.string "GroundLives_Select\0"
.align 2,0
.global gUnknown_811808C
gUnknown_811808C: @ 811808C
.4byte GroundLivesFile_Text
.byte 0x1E, 0x02, 0x00, 0x00
.4byte GroundLives_Text
.global gUnknown_8118098
gUnknown_8118098: @ 8118098
.string "GroundLives Select %3d %3d %3d\0"
.align 2,0
.global gUnknown_81180BC
gUnknown_81180BC: @ 81180BC
.string "GroundLives Cancel %3d %3d\0"
.align 2,0
.global gUnknown_81180D8
gUnknown_81180D8: @ 81180D8
.string "GroundLives CancelBlank\0"
.align 2,0
.global gUnknown_81180F0
gUnknown_81180F0: @ 81180F0
.byte 0x5F, 0x00
.byte 0x22, 0x00
.byte 0x10, 0x00
.byte 0x13, 0x00
.byte 0x1B, 0x00
.byte 0x29, 0x00
.global gUnknown_81180FC
gUnknown_81180FC: @ 81180FC
@ replacing .incbin "baserom.gba", 0x1180FC, 0x20
.byte 0x19, 0x00, 0x34, 0x00, 0x85, 0x00, 0x45, 0x01, 0x07, 0x00, 0x9e, 0x00, 0x1b, 0x01, 0x36, 0x00
.byte 0x04, 0x00, 0x18, 0x01, 0x9b, 0x00, 0x68, 0x00, 0x42, 0x00, 0x01, 0x00, 0x98, 0x00, 0x15, 0x01
.global gUnknown_811811C
gUnknown_811811C: @ 811811C
.string "GroundLive Add id %3d kind %3d type %3d group %3d sector %3d\0"
.align 2,0
.global GroundLives_Add_Text
GroundLives_Add_Text: @ Add
.string "GroundLives_Add\0"
.align 2,0
.global gUnknown_8118170
gUnknown_8118170: @ 8118170
.4byte GroundLivesFile_Text
.byte 0x89, 0x05, 0x00, 0x00
.4byte GroundLives_Add_Text
.global gUnknown_811817C
gUnknown_811817C: @ 811817C
.4byte GroundLivesFile_Text
.byte 0xb4, 0x05, 0x00, 0x00
.4byte GroundLives_Add_Text
.global gUnknown_8118188
gUnknown_8118188: @ 8118188
.4byte GroundLivesFile_Text
.byte 0xba, 0x05, 0x00, 0x00
.4byte GroundLives_Add_Text
.global gUnknown_8118194
gUnknown_8118194: @ 8118194
.string "GroundLives Delete id %3d\0"
.align 2,0
.global gUnknown_81181B0
gUnknown_81181B0: @ 81181B0
.string "GroundLives Execute %3d kind %3d %p\0"
.align 2,0
.global GroundLives_ExecuteScript_Text
GroundLives_ExecuteScript_Text: @ ExecuteScript
.string "GroundLives_ExecuteScript\0"
.align 2,0
.global gUnknown_81181F4
gUnknown_81181F4: @ 81181F4
.4byte GroundLivesFile_Text
.byte 0xa7, 0x06, 0x00, 0x00
.4byte GroundLives_ExecuteScript_Text
.global ExecutePlayerScript_Text
ExecutePlayerScript_Text: @ Text
.string "_ExecutePlayerScript\0"
.align 2,0
.global gUnknown_8118218
gUnknown_8118218: @ 8118218
.4byte GroundLivesFile_Text
.byte 0xC8, 0x06, 0x00, 0x00
.4byte ExecutePlayerScript_Text
.global ExecutePlayerScriptActionLives_Text
ExecutePlayerScriptActionLives_Text: @ Text
.string "GroundLives_ExecutePlayerScriptActionLives\0"
.align 2,0
.global gUnknown_8118250
gUnknown_8118250: @ 8118250
.4byte GroundLivesFile_Text
.byte 0xF9, 0x06, 0x00, 0x00
.4byte ExecutePlayerScriptActionLives_Text
.global gGroundLives_InvalidityText
gGroundLives_InvalidityText: @ 811825C
.string "{COLOR RED_W}invalidity{RESET}\0"
.align 2,0
.global GroundLives_ActionText
GroundLives_ActionText: @ ActionText
.string "GroundLives_Action\0"
.align 2,0
.global gUnknown_8118280
gUnknown_8118280: @ 8118280
.4byte GroundLivesFile_Text
.byte 0xA2, 0x11, 0x00, 0x00
.4byte GroundLives_ActionText
.global gUnknown_811828C
gUnknown_811828C: @ 811828C
.4byte GroundLivesFile_Text
.byte 0x0E, 0x12, 0x00, 0x00
.4byte GroundLives_ActionText
.string "pksdir0\0"
.align 2,0

View File

@ -80,15 +80,15 @@ typedef struct CallbackData
/* 0x18 */ void (*getFlags)(void*, u32 *flags);
/* 0x1C */ void (*setHitboxPos)(void*, PixelPos *posOrNull);
/* 0x20 */ void (*setPositionBounds)(void*, PixelPos *from, PixelPos *to);
/* 0x24 */ bool8 (*moveReal)(void*, PixelPos*);
/* 0x24 */ s32 (*moveReal)(void*, PixelPos*);
/* 0x28 */ void (*setPosHeight)(void*, u32 height);
/* 0x2C */ s32 (*setDirection)(void*, s32 dir); // direction must be signed char!
/* 0x2C */ void (*setDirection)(void*, s32 dir);
/* 0x30 */ void (*setEventIndex)(void*, u16);
/* 0x34 */ void (*livesOnlyNullsub)(void*, u16);
/* 0x38 */ void (*func38)(void*, s16, u32);
/* 0x38 */ void (*func38)(void*, s32, s32);
/* 0x3C */ void (*setFlags)(void*, u32 bits);
/* 0x40 */ void (*clearFlags)(void*, u32 bits);
/* 0x44 */ void (*func44_livesOnlySpriteRelated)(void*, u32);
/* 0x44 */ void (*func44_livesOnlySpriteRelated)(void*, s32);
/* 0x48 */ s32 (*moveRelative)(void*, PixelPos*);
/* 0x4C */ bool8 (*func4C_spriteRelatedCheck)(void*);
/* 0x50 */ bool8 (*func50_spriteRelated)(void*);

View File

@ -701,6 +701,7 @@ SECTIONS {
src/ground_sprite_util.o(.rodata);
data/pksdir_6.o(.rodata);
src/ground_script_file.o(.rodata);
src/ground_lives.o(.rodata);
data/data_8115F5C_1.o(.rodata);
src/ground_event.o(.rodata);
src/unk_dungeon_load_maybe.o(.rodata);

View File

@ -54,7 +54,7 @@ PokemonStruct1 *sub_808D3BC(void);
PokemonStruct1 *sub_808D3F8(void);
PokemonStruct1 *sub_80A8D54(s16);
void sub_80A7DDC(s16 *, s16*);
u8 sub_80A8CF0(s16);
u8 IsStarterMonster(s16);
s16 sub_80A8BFC(s32);
struct Unk8116040Struct
@ -398,7 +398,7 @@ bool8 sub_809A8B8(s32 param_1, s32 param_2)
case 7:
case 0x21:
case 0x22:
if (sub_80A8CF0(local_26) != 0) {
if (IsStarterMonster(local_26)) {
byte1 = 0x1;
}
else {

File diff suppressed because it is too large Load Diff

View File

@ -112,7 +112,7 @@ s16 GetAdjustedGroundMap(s32);
void sub_80A87AC(s32, s32);
void sub_80A8BD8(s16, s32*);
u32 sub_80A8C2C();
u32 sub_80A8C98();
u32 GroundLives_IsStarterMon();
PokemonStruct1 *sub_80A8D54(s16);
s16 sub_80A8F9C(s32, PixelPos*);
u32 sub_80A9050();
@ -2784,7 +2784,7 @@ s32 ExecuteScriptCommand(Action *action)
}
case 0xbe: {
if (action->unk8[0] == 1) {
if ((s8)sub_80A8C98(action->unk8[1])) {
if ((s8)GroundLives_IsStarterMon(action->unk8[1])) {
scriptData->script.ptr = FindLabel(action, (u8)curCmd.argByte);
}
}