metaforce/Runtime/MP1/CGBASupport.hpp

59 lines
1.2 KiB
C++
Raw Normal View History

2016-12-14 22:56:59 +00:00
#ifndef __URDE_CGBASUPPORT_HPP__
#define __URDE_CGBASUPPORT_HPP__
#include "CDvdFile.hpp"
2016-12-14 22:56:59 +00:00
namespace urde
{
namespace MP1
{
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();
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
};
}
}
#endif // __URDE_CGBASUPPORT_HPP__