mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-14 19:26:08 +00:00
CGBASupport (#13)
* Start work on GBASupport
* Match update
* Almost perfect match
* Very close to 100% match
* Match & link CGBASupport
* Fix some naming
* use c-cstle cast and round-up
Former-commit-id: d8804b5244
This commit is contained in:
55
include/MetroidPrime/CGBASupport.hpp
Normal file
55
include/MetroidPrime/CGBASupport.hpp
Normal file
@@ -0,0 +1,55 @@
|
||||
#ifndef _CGBASUPPORT
|
||||
#define _CGBASUPPORT
|
||||
|
||||
#include "Kyoto/CDvdFile.hpp"
|
||||
#include "rstl/auto_ptr.hpp"
|
||||
#include "rstl/single_ptr.hpp"
|
||||
#include "rstl/rc_ptr.hpp"
|
||||
|
||||
class CGBASupport {
|
||||
public:
|
||||
enum EPhase {
|
||||
kP_LoadClientPad,
|
||||
kP_Standby,
|
||||
kP_StartProbeTimeout,
|
||||
kP_PollProbe,
|
||||
kP_StartJoyBusBoot,
|
||||
kP_PollJoyBusBoot,
|
||||
kP_DataTransfer,
|
||||
kP_Complete,
|
||||
kP_Failed
|
||||
};
|
||||
|
||||
private:
|
||||
CDvdFile x0_file;
|
||||
uint x28_fileSize;
|
||||
rstl::single_ptr<uchar> x2c_buffer;
|
||||
rstl::single_ptr<IDvdRequest> x30_dvdReq;
|
||||
EPhase x34_phase;
|
||||
float x38_timeout;
|
||||
uchar x3c_status;
|
||||
uint x40_siChan;
|
||||
bool x44_fusionLinked;
|
||||
bool x45_fusionBeat;
|
||||
|
||||
// this is inlined weirdly... this probably should be handled differently
|
||||
bool CheckReadyStatus();
|
||||
public:
|
||||
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; }
|
||||
};
|
||||
|
||||
extern CGBASupport* g_GBA;
|
||||
|
||||
#endif // _CGBASUPPORT
|
||||
Reference in New Issue
Block a user