Match and link COsContext

Former-commit-id: cc514ecf6e
This commit is contained in:
2022-10-02 00:43:00 -07:00
parent 6b23e11db8
commit b9ea7a76b9
13 changed files with 226 additions and 54 deletions

View File

@@ -7,19 +7,46 @@
#include <dolphin/gx/GXStruct.h>
enum EConsoleType {
kCT_Emulator,
kCT_Development1,
kCT_Development2Or3,
kCT_Retail,
};
class COsKeyState {
public:
COsKeyState(int key, bool down, bool released, bool repeat, bool unk)
: x0_key(key), x4_down(down), x4_released(released), x4_repeat(repeat), x4_unk(unk) {}
private:
int x0_key;
short x4_down : 1;
short x4_released : 1;
short x4_repeat : 1;
short x4_unk : 1;
};
class COsContext {
static bool mProgressiveMode;
public:
COsContext(bool, bool);
~COsContext();
void OpenWindow(const char* title, int x, int y, int w, int h, bool fullscreen);
int OpenWindow(const char* title, int x, int y, int w, int h, bool fullscreen);
bool Update();
COsKeyState GetOsKeyState(int key) const;
void* AllocFromArena(size_t sz);
uint GetBaseFreeRam() const {
size_t hiAddr = reinterpret_cast< size_t >(x1c_arenaHi);
size_t loAddr = reinterpret_cast< size_t >(x20_arenaLo2);
return ((hiAddr & ~31) - ((loAddr + 31) & ~31));
}
static void SetProgressiveMode(bool progressive) { mProgressiveMode = progressive; }
static bool GetProgressiveMode() { return mProgressiveMode; }
private:
int x0_right;
int x4_bottom;