metaforce/Runtime/MP1/CGBASupport.hpp

55 lines
1.1 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2016-12-14 22:56:59 +00:00
#include "CDvdFile.hpp"
2017-12-29 08:08:12 +00:00
namespace urde::MP1
2016-12-14 22:56:59 +00:00
{
class CGBASupport : public CDvdFile
2016-12-14 22:56:59 +00:00
{
2017-01-01 06:46:52 +00:00
public:
enum class EPhase
{
LoadClientPad,
Standby,
StartProbeTimeout,
PollProbe,
StartJoyBusBoot,
PollJoyBusBoot,
DataTransfer,
Complete,
Failed
};
private:
u32 x28_fileSize;
std::unique_ptr<u8[]> x2c_buffer;
2017-01-01 06:46:52 +00:00
EPhase x34_phase = EPhase::LoadClientPad;
float x38_timeout = 0.f;
2017-01-08 02:52:49 +00:00
std::shared_ptr<IDvdRequest> x30_dvdReq;
2017-01-01 06:46:52 +00:00
u8 x3c_status = 0;
u32 x40_siChan = -1;
bool x44_fusionLinked = false;
bool x45_fusionBeat = false;
2017-01-08 02:52:49 +00:00
static u8 CalculateFusionJBusChecksum(const u8* data, size_t len);
2017-01-01 06:46:52 +00:00
2016-12-14 22:56:59 +00:00
public:
2017-01-08 02:52:49 +00:00
static void Initialize();
static void GlobalPoll();
CGBASupport();
2018-05-08 05:10:24 +00:00
~CGBASupport();
2017-01-01 06:46:52 +00:00
bool PollResponse();
void Update(float dt);
bool IsReady();
void InitializeSupport();
void StartLink();
EPhase GetPhase() const { return x34_phase; }
bool IsFusionLinked() const { return x44_fusionLinked; }
bool IsFusionBeat() const { return x45_fusionBeat; }
2016-12-14 22:56:59 +00:00
};
}