Skip to content

Commit

Permalink
xTRC work (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
escape209 authored Aug 6, 2024
1 parent 6a95333 commit f44e6fa
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
60 changes: 60 additions & 0 deletions src/SB/Core/x/xTRC.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,67 @@
#include "xTRC.h"
#include "xSnd.h"

#include "zGame.h"
#include "zGlobals.h"

#include <string.h>
#include <types.h>

_tagTRCPadInfo gTrcPad[4];
_tagTRCState gTrcDisk[2];

const char* message_text;

void xTRCInit()
{
memset(gTrcPad, 0, sizeof(gTrcPad));
gTrcPad[0].id = 0;
gTrcPad[1].id = 1;
gTrcPad[2].id = 2;
gTrcPad[3].id = 3;
memset(gTrcDisk, 0, 8);
}

void render_message(const char*);

void xTRCRender()
{
if (message_text != NULL)
{
render_message(message_text);
}
}

void xTRCReset()
{
message_text = NULL;
globals.dontShowPadMessageDuringLoadingOrCutScene = false;

eGameMode mode = gGameMode;
bool isStall = mode == eGameMode_Stall;

if (isStall)
{
zGameModeSwitch(eGameMode_Game);
}

xSndResume();
}

// SDA relocation shenanigans
void xTRCDisk(_tagTRCState state)
{
if (state != TRC_DiskNotIdentified)
{
gTrcDisk[0] = state;
gTrcDisk[1] = TRC_DiskIdentified;
}
else
{
gTrcDisk[1] = TRC_DiskNotIdentified;
}
}

void xTRCPad(S32, _tagTRCState)
{
}
4 changes: 3 additions & 1 deletion src/SB/Core/x/xTRC.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ struct _tagTRCPadInfo : _tagiTRCPadInfo
_tagTRCState state;
};

_tagTRCPadInfo gTrcPad[4];
_tagTRCPadInfo gTrcPad[];
_tagTRCState gTrcDisk[];

void xTRCInit();
void xTRCPad(S32 pad_id, _tagTRCState state);
void xTRCRender();
void xTRCReset();
Expand Down

0 comments on commit f44e6fa

Please sign in to comment.