Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions decompile/WorkInProgress/buildList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
//common, exe, TT_EndEvent_DrawMenu, 0x0, src/224/TT_EndEvent_DrawMenu.c
//common, exe, TT_EndEvent_DrawHighScore, 0x0, src/224/TT_EndEvent_DrawHighScore.c

common, exe, BOTS_ThTick_Drive, 0x0, src/BOTS/BOTS_11_ThTick_Drive.c
common, exe, Timer_GetTime_Elapsed, 0x0, Timer_3_GetTime_Elapsed.c
926, exe, 0x800379b0, 0x0, DF_JalDrawOTag.s
common, exe, rdata_free, 0x0, DF_main.c
// common, exe, BOTS_ThTick_Drive, 0x0, src/BOTS/BOTS_11_ThTick_Drive.c
// common, exe, Timer_GetTime_Elapsed, 0x0, Timer_3_GetTime_Elapsed.c
// 926, exe, 0x800379b0, 0x0, DF_JalDrawOTag.s
// common, exe, rdata_free, 0x0, DF_main.c

common, 233, CS_Thread_UseOpcode, 0x0, src/233/233_14_CS_Thread_UseOpcode.c, CS_Thread_UseOpcode
16 changes: 9 additions & 7 deletions decompile/WorkInProgress/src/233/233_02_09_CS_ScriptCmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ void CS_ScriptCmd_ReadOpcode_Main(struct CutsceneObj* cs)
{
char meta;
char* opcodes;
struct CsOpcodeMeta* decoded;
short* offsets;
char *local_18[2];

Expand All @@ -34,7 +35,8 @@ void CS_ScriptCmd_ReadOpcode_Main(struct CutsceneObj* cs)
if (opcodes != cs->currOpcode[0])
{
// char offset of meta data
offsets = (short*)cs->metadata;
decoded = (struct CsOpcodeMeta*)cs->metadata;
offsets = (short*)decoded;

// remember 0x38 (curr opcode) as 0x40 (prev opcode)
cs->prevOpcode = opcodes;
Expand Down Expand Up @@ -83,27 +85,27 @@ void CS_ScriptCmd_ReadOpcode_Main(struct CutsceneObj* cs)
if ((meta & 8) == 0)
{
// clear XA category
*(u_int*)(offsets[4]) = 0;
decoded->arg0.u = 0;
}
// & 8
// CDSYS_XAPlay -- Category (param1)
else
{
// set category
*(u_int*)(offsets[4]) = CS_ScriptCmd_ReadOpcode_GetInt(local_18);
decoded->arg0.u = CS_ScriptCmd_ReadOpcode_GetInt(local_18);
}

if ((meta & 0x10) == 0)
{
// clear XA index
*(int*)offsets[6] = 0;
decoded->arg1.i = 0;
}
// & 0x10
// CDSYS_XAPlay -- Index (param2)
else
{
// set index
*(u_int*)(offsets[6]) = CS_ScriptCmd_ReadOpcode_GetInt(local_18);
decoded->arg1.u = CS_ScriptCmd_ReadOpcode_GetInt(local_18);
}

// & 0x20,
Expand All @@ -116,7 +118,7 @@ void CS_ScriptCmd_ReadOpcode_Main(struct CutsceneObj* cs)
local_18[0] += 1;
}

*(u_int*)(offsets[6]) = CS_ScriptCmd_ReadOpcode_GetInt_dup(local_18);
decoded->arg1.u = CS_ScriptCmd_ReadOpcode_GetInt_dup(local_18);

local_18[0] += 1;
}
Expand Down Expand Up @@ -167,4 +169,4 @@ void CS_ScriptCmd_OpcodeAt(struct CutsceneObj* cs, char* opCodeAt)
cs->prevOpcode = 0xffffffff;

CS_ScriptCmd_ReadOpcode_Main(cs);
}
}
Loading