rename to ground_script_file

This commit is contained in:
DizzyEggg 2025-05-16 11:50:08 +02:00
parent 80ea413c02
commit 876fa795b1
5 changed files with 27 additions and 25 deletions

View File

@ -2,16 +2,6 @@
.align 2
.align 2,0
.string "pksdir0\0"
.align 2,0
.string "pksdir0\0"
.align 2,0
.global gNullGroundScript
gNullGroundScript: @ 8117EFC
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.string "pksdir0\0"
.align 2,0

9
data/pksdir_6.s Normal file
View File

@ -0,0 +1,9 @@
.section .rodata
.align 2, 0
@ ???
.string "pksdir0\0"
.align 2, 0

View File

@ -349,7 +349,7 @@ SECTIONS {
src/ground_sprite_data.o(.text);
src/ground_sprite_monster.o(.text);
src/ground_sprite_util.o(.text);
src/code_80A7714.o(.text);
src/ground_script_file.o(.text);
src/ground_lives.o(.text);
asm/ground_lives.o(.text);
src/ground_object.o(.text);
@ -702,6 +702,8 @@ SECTIONS {
src/ground_sprite_data.o(.rodata);
src/ground_sprite_monster.o(.rodata);
src/ground_sprite_util.o(.rodata);
data/pksdir_6.o(.rodata);
src/ground_script_file.o(.rodata);
data/data_8115F5C_1.o(.rodata);
src/ground_event.o(.rodata);
src/unk_dungeon_load_maybe.o(.rodata);

View File

@ -1,22 +1,21 @@
#include "global.h"
#include "structs/axdata.h"
#include "globaldata.h"
#include "ground_script.h"
extern void sub_80A68A0(u32);
extern void ResetCurrentScriptFile();
static EWRAM_DATA s16 sScriptFileId = {0};
static EWRAM_DATA s16 sUnknown_2039DE0 = {0};
extern const struct GroundScriptHeader gNullGroundScript;
extern const struct GroundScriptHeader *gMapScriptTable[]; // 811E2F8
static void ResetCurrentScriptFile(void);
void sub_80A7744(void)
{
sUnknown_2039DE0 = -1;
sScriptFileId = -1;
}
void sub_80A7754(void)
{
sUnknown_2039DE0 = -1;
sScriptFileId = -1;
}
void SetCurrentScriptFile(s16 a0)
@ -26,13 +25,13 @@ void SetCurrentScriptFile(s16 a0)
ResetCurrentScriptFile();
if (temp != -1)
sUnknown_2039DE0 = temp;
sScriptFileId = temp;
}
void ResetCurrentScriptFile(void)
{
if (sUnknown_2039DE0 != -1)
sUnknown_2039DE0 = -1;
if (sScriptFileId != -1)
sScriptFileId = -1;
}
bool8 ChangeScriptFile(s16 a0)
@ -41,7 +40,7 @@ bool8 ChangeScriptFile(s16 a0)
s32 temp2;
temp = a0;
temp2 = temp;
if (sUnknown_2039DE0 != temp) {
if (sScriptFileId != temp) {
if (temp < 0)
ResetCurrentScriptFile();
else
@ -51,10 +50,12 @@ bool8 ChangeScriptFile(s16 a0)
return FALSE;
}
static const struct GroundScriptHeader sNullGroundScript = {0};
const struct GroundScriptHeader *GetGroundScript(s16 a0)
{
if (a0 != -1)
return gMapScriptTable[a0];
else
return &gNullGroundScript;
return &sNullGroundScript;
}

View File

@ -167,4 +167,4 @@ gUnknown_2039DA8: /* 2039DA8 (sub_80A14E8) */
.space 0x8
.include "src/ground_sprite.o"
.include "src/code_80A7714.o"
.include "src/ground_script_file.o"