feat(console): add more work to understand ConsoleDeviceInitialize

This commit is contained in:
phaneron 2025-04-03 02:21:40 -04:00
parent 9df5775a17
commit 6cda64dfc4
16 changed files with 224 additions and 28 deletions

View file

@ -0,0 +1,31 @@
#ifndef COMMON_DATA_STORE_H
#define COMMON_DATA_STORE_H
DECLARE_STRUCT(CDataStore__v_table);
DECLARE_STRUCT(CDataStore);
struct CDataStore__v_table{
void* fn_InternalInitialize;
void* fn_InternalDestroy;
void* fn_InternalFetchRead;
void* fn_InternalFetchWrite;
void* fn_destructor;
void* fn_IsRead;
void* fn_Reset;
void* fn_Finalize;
void* fn_GetBufferParams;
void* fn_DetachBuffer;
void* fn_GetHeaderSpace;
};
struct CDataStore {
CDataStore__v_table* v_table;
uint8_t* m_data;
uint32_t m_base;
uint32_t m_alloc;
uint32_t m_size;
uint32_t m_read;
};
#endif

View file

@ -17,6 +17,7 @@ DECLARE_ENUM(SCHEDSTATE);
DECLARE_STRUCT(EvtContext);
DECLARE_STRUCT(EvtTimer);
DECLARE_HANDLE(HPROPCONTEXT);
DECLARE_HANDLE(HEVENTCONTEXT);
// EvtContext::SCHEDSTATE
enum SCHEDSTATE {

View file

@ -23,6 +23,7 @@
#include "common/handle.h"
#include "common/instance.h"
#include "common/datarecycler.h"
#include "common/datastore.h"
#include "common/status.h"
#include "common/refcount.h"
#include "common/rcstring.h"
@ -76,6 +77,9 @@
#include "m2/shared.h"
#include "m2/types.h"
#include "os/processorfeatures.h"
#include "os/timemanager.h"
#include "screen/layer.h"
#include "storm/array.h"
@ -87,6 +91,7 @@
#include "storm/region.h"
#include "storm/thread.h"
#include "storm/log.h"
#include "storm/options.h"
#include "tempest/box.h"
#include "tempest/matrix.h"

View file

@ -0,0 +1,41 @@
#ifndef OS_PROCESSOR_FEATURES_H
#define OS_PROCESSOR_FEATURES_H
DECLARE_STRUCT(ProcessorFeatures);
struct ProcessorFeatures {
// vendor ID string
uint32_t std_0b; // 00
uint32_t std_0d; // 04
uint32_t std_0c; // 08
// standard
uint32_t std_0a; // 0C
uint32_t std_1b; // 10
uint32_t std_1d; // 14
uint32_t std_4a; // 18
// extended
uint32_t ext_0a; // 1C
uint32_t ext_1c; // 20
uint32_t ext_1d; // 24
uint32_t ext_8c; // 28
// processor brand string
uint32_t ext_2a; // 2C
uint32_t ext_2b; // 30
uint32_t ext_2c; // 34
uint32_t ext_2d; // 38
uint32_t ext_3a; // 3C
uint32_t ext_3b; // 40
uint32_t ext_3c; // 44
uint32_t ext_3d; // 48
uint32_t ext_4a; // 4c
uint32_t ext_4b; // 50
uint32_t ext_4c; // 54
uint32_t ext_4d; // 58
};
#endif

View file

@ -0,0 +1,26 @@
#ifndef OS_TIME_MANAGER_H
#define OS_TIME_MANAGER_H
#include "storm/thread.h"
DECLARE_ENUM(TimingMethod);
DECLARE_STRUCT(OsTimeManager);
enum TimingMethod {
BestAvailable = 0,
// GetTickCount (Windows), mach_absolute_time (MacOS)
SystemMethod1 = 1,
// QueryPerformanceCounter (Windows), Carbon Microseconds (MacOS)
SystemMethod2 = 2,
NotSet = 0xFFFFFFFF,
};
struct OsTimeManager {
double scaleToMs;
TimingMethod timingMethod;
uint32_t timingTestError;
int64_t performanceFrequency;
double timeBegin;
};
#endif

View file

@ -0,0 +1,34 @@
#ifndef STORM_OPTIONS_H
#define STORM_OPTIONS_H
DECLARE_STRUCT(STORMOPTIONS);
struct STORMOPTIONS {
// int smemleaksilentwarning;
// int serrleaksilentwarning;
// unsigned int wavechunksize;
// int alignstreamingwavedata;
// int echotooutputdebugstring;
// int serrsuppresslogs;
// int crcenabled;
// int orderedprintfenabled;
// int noreaderrordialog;
// int assertlogonly;
// int serrsuppressdialogs;
// int serrignorerecoverable;
// uint64_t opt00; // dword_CAE950
int32_t smemleaksilentwarning; // dword_CAE958
int32_t serrleaksilentwarning; // dword_CAE95C
uint32_t wavechunksize; // dword_CAE960
int32_t opt0C; // dword_CAE964
int32_t opt10; // dword_CAE968
int32_t opt14; // dword_CAE96C
int32_t opt18; // dword_CAE970
int32_t opt1C; // dword_CAE974
int32_t sregunicode; // dword_CAE978
int32_t opt24; // dword_CAE97C
int32_t opt28; // dword_CAE980
};
#endif

View file

@ -1,9 +1,13 @@
#ifndef STORM_THREAD_H
#define STORM_THREAD_H
DECLARE_STRUCT(SCritSect);
DECLARE_STRUCT(SSyncObject);
DECLARE_STRUCT(SEvent);
DECLARE_STRUCT(SThread);
#include "system/types.h"
DECLARE_STRUCT(SCritSect);
typedef struct CSRWLock CSRWLock;
struct SCritSect {
@ -14,4 +18,17 @@ struct CSRWLock {
uint8_t m_opaqueData[12];
};
struct SSyncObject {
// HANDLE
void* m_opaqueData;
};
struct SEvent {
SSyncObject b_base;
};
struct SThread {
SSyncObject b_base;
};
#endif