metaforce/Runtime/MP1/CGBASupport.hpp

54 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 <memory>
#include "Runtime/GCNTypes.hpp"
#include "Runtime/CDvdFile.hpp"
2018-12-08 05:30:43 +00:00
namespace urde::MP1 {
2016-12-14 22:56:59 +00:00
2018-12-08 05:30:43 +00:00
class CGBASupport : public CDvdFile {
2017-01-01 06:46:52 +00:00
public:
2018-12-08 05:30:43 +00:00
enum class EPhase {
LoadClientPad,
Standby,
StartProbeTimeout,
PollProbe,
StartJoyBusBoot,
PollJoyBusBoot,
DataTransfer,
Complete,
Failed
};
2017-01-01 06:46:52 +00:00
private:
2018-12-08 05:30:43 +00:00
u32 x28_fileSize;
std::unique_ptr<u8[]> x2c_buffer;
EPhase x34_phase = EPhase::LoadClientPad;
float x38_timeout = 0.f;
std::shared_ptr<IDvdRequest> x30_dvdReq;
u8 x3c_status = 0;
u32 x40_siChan = -1;
bool x44_fusionLinked = false;
bool x45_fusionBeat = false;
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:
2018-12-08 05:30:43 +00:00
static void Initialize();
static void GlobalPoll();
CGBASupport();
~CGBASupport();
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
};
2018-12-08 05:30:43 +00:00
} // namespace urde::MP1