metaforce/Runtime/MP1/CGBASupport.hpp

54 lines
1.1 KiB
C++
Raw Normal View History

2018-10-06 20:42:33 -07:00
#pragma once
2016-12-14 14:56:59 -08:00
#include <memory>
#include "Runtime/GCNTypes.hpp"
#include "Runtime/CDvdFile.hpp"
2021-04-10 01:42:06 -07:00
namespace metaforce::MP1 {
2016-12-14 14:56:59 -08:00
2018-12-07 21:30:43 -08:00
class CGBASupport : public CDvdFile {
2016-12-31 22:46:52 -08:00
public:
2018-12-07 21:30:43 -08:00
enum class EPhase {
LoadClientPad,
Standby,
StartProbeTimeout,
PollProbe,
StartJoyBusBoot,
PollJoyBusBoot,
DataTransfer,
Complete,
Failed
};
2016-12-31 22:46:52 -08:00
private:
2018-12-07 21:30:43 -08: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);
2016-12-31 22:46:52 -08:00
2016-12-14 14:56:59 -08:00
public:
2018-12-07 21:30:43 -08: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 14:56:59 -08:00
};
2021-04-10 01:42:06 -07:00
} // namespace metaforce::MP1