Skip to content

Commit

Permalink
more work on ground_script
Browse files Browse the repository at this point in the history
  • Loading branch information
SethBarberee committed Aug 15, 2024
1 parent 3bfc80f commit 1b707be
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 221 deletions.
147 changes: 0 additions & 147 deletions asm/code_809D148.s

This file was deleted.

6 changes: 3 additions & 3 deletions include/ground_script.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ typedef struct CallbackData
typedef struct Action
{
// size: 0xE4
/* 0x00 */ struct CallbackData *callbacks;
/* 0x00 */ const struct CallbackData *callbacks;
/* 0x04 */ void *parentObject; // struct GroundObject *
/* 0x08 */ s16 unk8[2]; // id?
/* 0x0C */ ScriptUnion1632 unkC;
/* 0x10 */ u16 group;
/* 0x12 */ u8 sector;
/* 0x10 */ s16 group;
/* 0x12 */ s8 sector;
// padding
/* 0x14 */ ScriptCommand *predefinedScripts[4];
/* 0x24 */ ScriptData scriptData;
Expand Down
1 change: 0 additions & 1 deletion ld_script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ SECTIONS {
src/code_809C5C4.o(.text);
asm/code_809C5C4.o(.text);
src/code_809D148.o(.text);
asm/code_809D148.o(.text);
src/ground_script.o(.text);
asm/handleaction.o(.text);
src/ground_script_1.o(.text);
Expand Down
69 changes: 0 additions & 69 deletions src/code_809D148.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "global.h"
#include "other_random.h"
#include "memory.h"
#include "ground_script.h"

struct unkStruct_809D158
{
Expand Down Expand Up @@ -415,71 +414,3 @@ void sub_809D508(void)
MemoryFree(gUnknown_203B4B0);
gUnknown_203B4B0 = NULL;
}

// -1 didn't match
void sub_809D520(void *a0)
{
u16 *ptr = a0;
u16 v = 0xFFFF;
*ptr = v;
}

extern s32 sub_80A882C(s16);
extern s32 sub_80AC240(s16);
extern s32 sub_80AD158(s16);

s32 sub_809D52C(void *a0)
{
s16 *ptr = a0;

switch (ptr[0])
{
case 0: return 0;
case 1: return sub_80A882C(ptr[1]);
case 2: return sub_80AC240(ptr[1]);
case 3: return sub_80AD158(ptr[1]);
}
return 0;
}

void InitScriptData(ScriptData *a0)
{
s32 i;

a0->state = -1;
a0->savedState = 0;
a0->script.ptr2 = 0;
a0->script.ptr = 0;
a0->savedScript.ptr2 = 0;
a0->savedScript.ptr = 0;
a0->curScriptOp = 0;
a0->curPtr = 0;
a0->unk22 = -1;
a0->unk24 = 0;
a0->unk26 = 0xFF;
a0->branchDiscriminant = 0;
a0->unk2A = 0;
a0->unk2C = 0;
a0->unk30 = 0;
for (i = 0; i < 4; i++) {
a0->unk50[i].raw = 0;
}
}

void InitAction(Action *a0)
{
s32 i;

a0->callbacks = NULL;
a0->parentObject = NULL;
a0->group = -1;
a0->sector = 0xFF;
sub_809D520(&a0->unkC);

for (i = 0; i < 4; i++) {
a0->predefinedScripts[i] = NULL;
}

InitScriptData(&a0->scriptData);
InitScriptData(&a0->scriptData2);
}
Loading

0 comments on commit 1b707be

Please sign in to comment.