use C++ style structs everywhere

This commit is contained in:
RSDuck 2021-01-02 11:38:06 +01:00
parent e2c61b28e0
commit 7d448d911d
10 changed files with 28 additions and 39 deletions

View File

@ -23,23 +23,21 @@
#include "types.h" #include "types.h"
typedef struct struct ARCode
{ {
char Name[128]; char Name[128];
bool Enabled; bool Enabled;
u32 CodeLen; u32 CodeLen;
u32 Code[2*64]; u32 Code[2*64];
};
} ARCode;
typedef std::list<ARCode> ARCodeList; typedef std::list<ARCode> ARCodeList;
typedef struct struct ARCodeCat
{ {
char Name[128]; char Name[128];
ARCodeList Codes; ARCodeList Codes;
};
} ARCodeCat;
typedef std::list<ARCodeCat> ARCodeCatList; typedef std::list<ARCodeCat> ARCodeCatList;

View File

@ -26,7 +26,7 @@
namespace Config namespace Config
{ {
typedef struct struct ConfigEntry
{ {
char Name[32]; char Name[32];
int Type; int Type;
@ -34,8 +34,7 @@ typedef struct
int DefaultInt; int DefaultInt;
const char* DefaultStr; const char* DefaultStr;
int StrLength; // should be set to actual array length minus one int StrLength; // should be set to actual array length minus one
};
} ConfigEntry;
FILE* GetConfigFile(const char* fileName, const char* permissions); FILE* GetConfigFile(const char* fileName, const char* permissions);
bool HasConfigFile(const char* fileName); bool HasConfigFile(const char* fileName);

View File

@ -150,14 +150,13 @@ void SyncDirtyFlags();
extern u32 OAMDirty; extern u32 OAMDirty;
extern u32 PaletteDirty; extern u32 PaletteDirty;
typedef struct struct RenderSettings
{ {
bool Soft_Threaded; bool Soft_Threaded;
int GL_ScaleFactor; int GL_ScaleFactor;
bool GL_BetterPolygons; bool GL_BetterPolygons;
};
} RenderSettings;
bool Init(); bool Init();

View File

@ -25,7 +25,7 @@
namespace GPU3D namespace GPU3D
{ {
typedef struct struct Vertex
{ {
s32 Position[4]; s32 Position[4];
s32 Color[3]; s32 Color[3];
@ -43,9 +43,9 @@ typedef struct
// TODO maybe: hi-res color? (that survives clipping) // TODO maybe: hi-res color? (that survives clipping)
s32 HiresPosition[2]; s32 HiresPosition[2];
} Vertex; };
typedef struct struct Polygon
{ {
Vertex* Vertices[10]; Vertex* Vertices[10];
u32 NumVertices; u32 NumVertices;
@ -74,7 +74,7 @@ typedef struct
u32 SortKey; u32 SortKey;
} Polygon; };
extern u32 RenderDispCnt; extern u32 RenderDispCnt;
extern u8 RenderAlphaRef; extern u8 RenderAlphaRef;

View File

@ -70,7 +70,7 @@ struct
GLuint ShaderConfigUBO; GLuint ShaderConfigUBO;
typedef struct struct RendererPolygon
{ {
Polygon* PolyData; Polygon* PolyData;
@ -82,8 +82,7 @@ typedef struct
u32 EdgeIndicesOffset; u32 EdgeIndicesOffset;
u32 RenderKey; u32 RenderKey;
};
} RendererPolygon;
RendererPolygon PolygonList[2048]; RendererPolygon PolygonList[2048];
int NumFinalPolys, NumOpaqueFinalPolys; int NumFinalPolys, NumOpaqueFinalPolys;

View File

@ -538,7 +538,7 @@ private:
s32 ycoverage, ycov_incr; s32 ycoverage, ycov_incr;
}; };
typedef struct struct RendererPolygon
{ {
Polygon* PolyData; Polygon* PolyData;
@ -548,7 +548,7 @@ typedef struct
u32 CurVL, CurVR; u32 CurVL, CurVR;
u32 NextVL, NextVR; u32 NextVL, NextVR;
} RendererPolygon; };
RendererPolygon PolygonList[2048]; RendererPolygon PolygonList[2048];

View File

@ -54,13 +54,12 @@ enum
Event_MAX Event_MAX
}; };
typedef struct struct SchedEvent
{ {
void (*Func)(u32 param); void (*Func)(u32 param);
u64 Timestamp; u64 Timestamp;
u32 Param; u32 Param;
};
} SchedEvent;
enum enum
{ {
@ -121,21 +120,19 @@ enum
IRQ2_DSi_MicExt IRQ2_DSi_MicExt
}; };
typedef struct struct Timer
{ {
u16 Reload; u16 Reload;
u16 Cnt; u16 Cnt;
u32 Counter; u32 Counter;
u32 CycleShift; u32 CycleShift;
};
} Timer; struct MemRegion
typedef struct
{ {
u8* Mem; u8* Mem;
u32 Mask; u32 Mask;
};
} MemRegion;
extern int ConsoleType; extern int ConsoleType;
extern int CurCPU; extern int CurCPU;

View File

@ -19,13 +19,12 @@
#ifndef ROMLIST_H #ifndef ROMLIST_H
#define ROMLIST_H #define ROMLIST_H
typedef struct struct ROMListEntry
{ {
u32 GameCode; u32 GameCode;
u32 ROMSize; u32 ROMSize;
u32 SaveMemType; u32 SaveMemType;
};
} ROMListEntry;
ROMListEntry ROMList[] = ROMListEntry ROMList[] =

View File

@ -55,7 +55,7 @@ u16 RFData1;
u16 RFData2; u16 RFData2;
u32 RFRegs[0x40]; u32 RFRegs[0x40];
typedef struct struct TXSlot
{ {
u16 Addr; u16 Addr;
u16 Length; u16 Length;
@ -63,8 +63,7 @@ typedef struct
u8 CurPhase; u8 CurPhase;
u32 CurPhaseTime; u32 CurPhaseTime;
u32 HalfwordTimeMask; u32 HalfwordTimeMask;
};
} TXSlot;
TXSlot TXSlots[6]; TXSlot TXSlots[6];

View File

@ -24,7 +24,7 @@
namespace LAN_PCap namespace LAN_PCap
{ {
typedef struct struct AdapterData
{ {
char DeviceName[128]; char DeviceName[128];
char FriendlyName[128]; char FriendlyName[128];
@ -34,8 +34,7 @@ typedef struct
u8 IP_v4[4]; u8 IP_v4[4];
void* Internal; void* Internal;
};
} AdapterData;
extern AdapterData* Adapters; extern AdapterData* Adapters;