Skip to content

Commit d9a1c18

Browse files
committed
use standard type instead
1 parent 3d483a6 commit d9a1c18

26 files changed

+492
-500
lines changed

include/ps2s/core.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace Core {
2121
*/
2222

2323
namespace MemMappings {
24-
static const tU32 Normal = 0x00000000,
24+
static const uint32_t Normal = 0x00000000,
2525
Uncached = 0x20000000,
2626
UncachedAccl = 0x30000000,
2727

@@ -36,19 +36,19 @@ namespace MemMappings {
3636
template <class ptrType>
3737
inline ptrType MakePtrNormal(ptrType ptr)
3838
{
39-
return reinterpret_cast<ptrType>((tU32)ptr & 0x0fffffff);
39+
return reinterpret_cast<ptrType>((uint32_t)ptr & 0x0fffffff);
4040
}
4141

4242
template <class ptrType>
4343
inline ptrType MakePtrUncached(ptrType ptr)
4444
{
45-
return reinterpret_cast<ptrType>((tU32)MakePtrNormal(ptr) | MemMappings::Uncached);
45+
return reinterpret_cast<ptrType>((uint32_t)MakePtrNormal(ptr) | MemMappings::Uncached);
4646
}
4747

4848
template <class ptrType>
4949
inline ptrType MakePtrUncachedAccl(ptrType ptr)
5050
{
51-
return reinterpret_cast<ptrType>((tU32)MakePtrNormal(ptr) | MemMappings::UncachedAccl);
51+
return reinterpret_cast<ptrType>((uint32_t)MakePtrNormal(ptr) | MemMappings::UncachedAccl);
5252
}
5353

5454
/********************************************
@@ -70,24 +70,24 @@ inline void Delete16(void* p)
7070
// cop0 counter
7171

7272
inline void ZeroCount(void);
73-
inline tU32 GetCount(void);
73+
inline uint32_t GetCount(void);
7474

7575
// fpu
7676

77-
inline tU32 FToI4(float flp);
77+
inline uint32_t FToI4(float flp);
7878

7979
// cop0 performance counter
8080

81-
static const tU32 COP0_NUM_PERF_COUNTERS = 2;
82-
static const tU32 COP0_NUM_PERF_EVENTS = 17;
81+
static const uint32_t COP0_NUM_PERF_COUNTERS = 2;
82+
static const uint32_t COP0_NUM_PERF_EVENTS = 17;
8383

84-
void SetupPerfCounters(tU32 evt_0, tU32 evt_1); // set up,also zero + halt
84+
void SetupPerfCounters(uint32_t evt_0, uint32_t evt_1); // set up,also zero + halt
8585

8686
inline void HaltPerfCounters(); // stop both counters
8787
inline void ZeroStartPerfCounters(); // clear and start both counters
8888

89-
inline tU32 ReadPerfCounter0(); // read counter 0
90-
inline tU32 ReadPerfCounter1(); // read counter 1
89+
inline uint32_t ReadPerfCounter0(); // read counter 0
90+
inline uint32_t ReadPerfCounter1(); // read counter 1
9191

9292
// names of the events for people
9393

@@ -106,10 +106,10 @@ Core::ZeroCount(void)
106106
"sync.p ");
107107
}
108108

109-
inline tU32
109+
inline uint32_t
110110
Core::GetCount(void)
111111
{
112-
tU32 ret;
112+
uint32_t ret;
113113

114114
asm __volatile__("mfc0 %0, $9 \n"
115115
"sync.p "
@@ -118,10 +118,10 @@ Core::GetCount(void)
118118
return ret;
119119
}
120120

121-
inline tU32
121+
inline uint32_t
122122
Core::FToI4(float flp)
123123
{
124-
tU32 fip;
124+
uint32_t fip;
125125

126126
asm __volatile__("qmtc2 %1, $vf1 \n"
127127
"vftoi4 $vf1, $vf1 \n"
@@ -154,18 +154,18 @@ inline void Core::ZeroStartPerfCounters()
154154
: "v0");
155155
};
156156

157-
inline tU32 Core::ReadPerfCounter0()
157+
inline uint32_t Core::ReadPerfCounter0()
158158
{
159-
tU32 ret;
159+
uint32_t ret;
160160
asm __volatile__(" mfpc %0,0 \n"
161161
" sync.p "
162162
: "=r"(ret));
163163
return ret;
164164
}
165165

166-
inline tU32 Core::ReadPerfCounter1()
166+
inline uint32_t Core::ReadPerfCounter1()
167167
{
168-
tU32 ret;
168+
uint32_t ret;
169169
asm __volatile__(" mfpc %0,1 \n"
170170
" sync.p "
171171
: "=r"(ret));

include/ps2s/displayenv.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ class CDisplayEnv {
110110
inline void BlendRC1WithBG(void) { gsrPMode.SLBG = 1; }
111111
inline void BlendRC1WithRC2(void) { gsrPMode.SLBG = 0; }
112112
inline void BlendUsingRC1Alpha(void) { gsrPMode.MMOD = 0; }
113-
inline void BlendUsingConstAlpha(tU8 alpha)
113+
inline void BlendUsingConstAlpha(uint8_t alpha)
114114
{
115115
gsrPMode.MMOD = 1;
116116
gsrPMode.ALP = alpha;
117117
}
118118
void DontBlend(void);
119119

120-
inline void SetBGColor(tU8 r, tU8 g, tU8 b)
120+
inline void SetBGColor(uint8_t r, uint8_t g, uint8_t b)
121121
{
122122
gsrBGColor.R = r;
123123
gsrBGColor.G = g;

include/ps2s/dmac.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ typedef struct tD_CHCR_t {
2828
} tD_CHCR;
2929

3030
typedef struct tSourceChainTag_t {
31-
tU64 QWC : 16;
32-
tU64 pad : 10;
33-
tU64 PCE : 2;
34-
tU64 ID : 3;
35-
tU64 IRQ : 1;
36-
tU64 ADDR : 31;
37-
tU64 SPR : 1;
38-
tU32 opt1;
39-
tU32 opt2;
31+
uint64_t QWC : 16;
32+
uint64_t pad : 10;
33+
uint64_t PCE : 2;
34+
uint64_t ID : 3;
35+
uint64_t IRQ : 1;
36+
uint64_t ADDR : 31;
37+
uint64_t SPR : 1;
38+
uint32_t opt1;
39+
uint32_t opt2;
4040
} __attribute__((packed,aligned(16))) tSourceChainTag;
4141

4242
typedef tSourceChainTag tDmaTag;

include/ps2s/drawenv.h

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,22 @@ class CDrawEnv {
9999
public:
100100
CDrawEnv(GS::tContext context);
101101
CDrawEnv(const CDrawEnv& rhs);
102-
CDrawEnv(GS::tContext context, tU32 fbW, tU32 fbH, tU32 fbWordAddr, tU32 zbufWordAddr = NULL);
102+
CDrawEnv(GS::tContext context, uint32_t fbW, uint32_t fbH, uint32_t fbWordAddr, uint32_t zbufWordAddr = NULL);
103103

104104
void operator=(const CDrawEnv& otherDE);
105105

106106
void SetContext(GS::tContext context);
107107

108108
inline void EnableAlphaTest(void) { gsrTest.atest_enable = 1; }
109109
inline void DisableAlphaTest(void) { gsrTest.atest_enable = 0; }
110-
inline void SetAlphaTestPassMode(tAlphaTestPassMode mode) { gsrTest.atest_method = (tU64)mode; }
111-
inline void SetAlphaTestFailAction(tAlphaTestFailAction action) { gsrTest.atest_fail_method = (tU64)action; }
112-
inline void SetAlphaRefVal(tU8 refVal) { gsrTest.atest_reference = refVal; }
110+
inline void SetAlphaTestPassMode(tAlphaTestPassMode mode) { gsrTest.atest_method = (uint64_t)mode; }
111+
inline void SetAlphaTestFailAction(tAlphaTestFailAction action) { gsrTest.atest_fail_method = (uint64_t)action; }
112+
inline void SetAlphaRefVal(uint8_t refVal) { gsrTest.atest_reference = refVal; }
113113

114114
inline void EnableSelectiveAlphaBlend(void) { gsrPABE.enable = 1; }
115115
inline void DisableSelectiveAlphaBlend(void) { gsrPABE.enable = 0; }
116116

117-
inline void SetAlphaBlendFunc(tAlphaBlendVal a, tAlphaBlendVal b, tAlphaBlendVal c, tAlphaBlendVal d, tU32 fix);
117+
inline void SetAlphaBlendFunc(tAlphaBlendVal a, tAlphaBlendVal b, tAlphaBlendVal c, tAlphaBlendVal d, uint32_t fix);
118118

119119
inline void EnableColorClamp(void) { gsrColClamp.clamp = 1; }
120120
inline void DisableColorClamp(void) { gsrColClamp.clamp = 0; }
@@ -126,11 +126,11 @@ class CDrawEnv {
126126

127127
inline void SetDepthTestPassMode(tZTestPassMode passMode)
128128
{
129-
gsrTest.ztest_method = (tU64)passMode;
129+
gsrTest.ztest_method = (uint64_t)passMode;
130130
eZTestPassMode = passMode;
131131
}
132-
inline void SetDepthBufferAddr(tU32 wordAddress) { gsrZBuf.fb_addr = wordAddress / 2048; }
133-
inline void SetDepthBufferPSM(tU32 psm) { gsrZBuf.psm = (tU64)psm; }
132+
inline void SetDepthBufferAddr(uint32_t wordAddress) { gsrZBuf.fb_addr = wordAddress / 2048; }
133+
inline void SetDepthBufferPSM(uint32_t psm) { gsrZBuf.psm = (uint64_t)psm; }
134134
inline void EnableDepthTest(void)
135135
{
136136
gsrZBuf.update_mask = 0;
@@ -139,34 +139,34 @@ class CDrawEnv {
139139
inline void DisableDepthTest(void)
140140
{
141141
gsrZBuf.update_mask = 1;
142-
gsrTest.ztest_method = (tU64)ZTest::kAlways;
142+
gsrTest.ztest_method = (uint64_t)ZTest::kAlways;
143143
}
144144
inline void SetDepthWriteEnabled(bool write) { gsrZBuf.update_mask = !write; }
145145

146-
inline void SetFrameBufferAddr(tU32 wordAddress)
146+
inline void SetFrameBufferAddr(uint32_t wordAddress)
147147
{
148148
mAssert((wordAddress & 2047) == 0);
149149
gsrFrame.fb_addr = wordAddress / 2048;
150150
}
151-
inline void SetFrameBufferDrawMask(tU32 drawMask) { gsrFrame.draw_mask = drawMask; }
152-
void SetFrameBufferDim(tU32 pixelW, tU32 pixelH);
153-
inline void SetFrameBufferPSM(tU32 psm) { gsrFrame.psm = psm; }
151+
inline void SetFrameBufferDrawMask(uint32_t drawMask) { gsrFrame.draw_mask = drawMask; }
152+
void SetFrameBufferDim(uint32_t pixelW, uint32_t pixelH);
153+
inline void SetFrameBufferPSM(uint32_t psm) { gsrFrame.psm = psm; }
154154
float GetInterlacedPixelOffset() const { return InterlacedOffset; }
155155
void SetInterlacedPixelOffset(float offset) { InterlacedOffset = offset; }
156156
void CalculateClippedFBXYOffsets(bool addHalfPixel);
157-
inline void SetXYOffsets(tU16 offsetX, tU16 offsetY)
157+
inline void SetXYOffsets(uint16_t offsetX, uint16_t offsetY)
158158
{
159159
gsrXYOffset.offset_x = offsetX << 4;
160160
gsrXYOffset.offset_y = offsetY << 4;
161161
}
162-
inline void SetXYOffsetsFix4(tU16 offsetX, tU16 offsetY)
162+
inline void SetXYOffsetsFix4(uint16_t offsetX, uint16_t offsetY)
163163
{
164164
gsrXYOffset.offset_x = offsetX;
165165
gsrXYOffset.offset_y = offsetY;
166166
}
167167

168-
inline void SetFrameBufAlphaORMask(tU32 mask) { gsrFBA.alpha = mask; }
169-
inline void SetFogColor(tU32 r, tU32 g, tU32 b)
168+
inline void SetFrameBufAlphaORMask(uint32_t mask) { gsrFBA.alpha = mask; }
169+
inline void SetFogColor(uint32_t r, uint32_t g, uint32_t b)
170170
{
171171
gsrFogCol.r = r;
172172
gsrFogCol.g = g;
@@ -180,14 +180,14 @@ class CDrawEnv {
180180
tDitherVal dm20, tDitherVal dm21, tDitherVal dm22, tDitherVal dm23,
181181
tDitherVal dm30, tDitherVal dm31, tDitherVal dm32, tDitherVal dm33);
182182

183-
inline void SetScissorArea(tU32 scX, tU32 scY, tU32 scWidth, tU32 scHeight); // must be after SetFrameBufferDim() to have effect
183+
inline void SetScissorArea(uint32_t scX, uint32_t scY, uint32_t scWidth, uint32_t scHeight); // must be after SetFrameBufferDim() to have effect
184184

185185
void SendSettings(bool waitForEnd = false, bool flushCache = true);
186186
void SendSettings(CSCDmaPacket& packet);
187187
void SendSettings(CVifSCDmaPacket& packet);
188188

189189
// accessors
190-
tU32 GetFrameBufferAddr(void) { return gsrFrame.fb_addr * 2048; }
190+
uint32_t GetFrameBufferAddr(void) { return gsrFrame.fb_addr * 2048; }
191191

192192
inline void* operator new(size_t size) { return Core::New16(size); }
193193
inline void operator delete(void* p) { Core::Delete16(p); }
@@ -198,38 +198,38 @@ class CDrawEnv {
198198
tSourceChainTag SettingsDmaTag;
199199
tGifTag SettingsGifTag;
200200
GS::tFrame gsrFrame;
201-
tU64 FrameAddr;
201+
uint64_t FrameAddr;
202202
GS::tZbuf gsrZBuf;
203-
tU64 ZBufAddr;
203+
uint64_t ZBufAddr;
204204
GS::tXyoffset gsrXYOffset;
205-
tU64 XYOffsetAddr;
205+
uint64_t XYOffsetAddr;
206206
GS::tPrmodecont gsrPrModeCont;
207-
tU64 PrModeContAddr;
207+
uint64_t PrModeContAddr;
208208
GS::tColclamp gsrColClamp;
209-
tU64 ColClampAddr;
209+
uint64_t ColClampAddr;
210210
GS::tTest gsrTest;
211-
tU64 TestAddr;
211+
uint64_t TestAddr;
212212
GS::tAlpha gsrAlpha;
213-
tU64 AlphaAddr;
213+
uint64_t AlphaAddr;
214214
GS::tPabe gsrPABE;
215-
tU64 PABEAddr;
215+
uint64_t PABEAddr;
216216
GS::tFba gsrFBA;
217-
tU64 FBAAddr;
217+
uint64_t FBAAddr;
218218
GS::tDthe gsrDTHE;
219-
tU64 DTHEAddr;
219+
uint64_t DTHEAddr;
220220
GS::tDimx gsrDIMX;
221-
tU64 DIMXAddr;
221+
uint64_t DIMXAddr;
222222
GS::tScissor gsrScissor;
223-
tU64 ScissorAddr;
223+
uint64_t ScissorAddr;
224224
GS::tFogcol gsrFogCol;
225-
tU64 FogColAddr;
225+
uint64_t FogColAddr;
226226
} __attribute__((packed,aligned(16)));
227-
tU32 uiNumGSRegs;
227+
uint32_t uiNumGSRegs;
228228

229229
CSCDmaPacket GifPacket;
230230

231231
tZTestPassMode eZTestPassMode;
232-
tU32 uiFBWidth, uiFBHeight;
232+
uint32_t uiFBWidth, uiFBHeight;
233233
float InterlacedOffset;
234234

235235
private:
@@ -242,7 +242,7 @@ class CDrawEnv {
242242
*/
243243

244244
inline void
245-
CDrawEnv::SetAlphaBlendFunc(tAlphaBlendVal a, tAlphaBlendVal b, tAlphaBlendVal c, tAlphaBlendVal d, tU32 fix)
245+
CDrawEnv::SetAlphaBlendFunc(tAlphaBlendVal a, tAlphaBlendVal b, tAlphaBlendVal c, tAlphaBlendVal d, uint32_t fix)
246246
{
247247
gsrAlpha.a = a;
248248
gsrAlpha.b = b;
@@ -257,26 +257,26 @@ CDrawEnv::SetDitherMatrix(tDitherVal dm00, tDitherVal dm01, tDitherVal dm02, tDi
257257
tDitherVal dm20, tDitherVal dm21, tDitherVal dm22, tDitherVal dm23,
258258
tDitherVal dm30, tDitherVal dm31, tDitherVal dm32, tDitherVal dm33)
259259
{
260-
gsrDIMX.DIMX00 = (tU64)dm00;
261-
gsrDIMX.DIMX01 = (tU64)dm01;
262-
gsrDIMX.DIMX02 = (tU64)dm02;
263-
gsrDIMX.DIMX03 = (tU64)dm03;
264-
gsrDIMX.DIMX10 = (tU64)dm10;
265-
gsrDIMX.DIMX11 = (tU64)dm11;
266-
gsrDIMX.DIMX12 = (tU64)dm12;
267-
gsrDIMX.DIMX13 = (tU64)dm13;
268-
gsrDIMX.DIMX20 = (tU64)dm20;
269-
gsrDIMX.DIMX21 = (tU64)dm21;
270-
gsrDIMX.DIMX22 = (tU64)dm22;
271-
gsrDIMX.DIMX23 = (tU64)dm23;
272-
gsrDIMX.DIMX30 = (tU64)dm30;
273-
gsrDIMX.DIMX31 = (tU64)dm31;
274-
gsrDIMX.DIMX32 = (tU64)dm32;
275-
gsrDIMX.DIMX33 = (tU64)dm33;
260+
gsrDIMX.DIMX00 = (uint64_t)dm00;
261+
gsrDIMX.DIMX01 = (uint64_t)dm01;
262+
gsrDIMX.DIMX02 = (uint64_t)dm02;
263+
gsrDIMX.DIMX03 = (uint64_t)dm03;
264+
gsrDIMX.DIMX10 = (uint64_t)dm10;
265+
gsrDIMX.DIMX11 = (uint64_t)dm11;
266+
gsrDIMX.DIMX12 = (uint64_t)dm12;
267+
gsrDIMX.DIMX13 = (uint64_t)dm13;
268+
gsrDIMX.DIMX20 = (uint64_t)dm20;
269+
gsrDIMX.DIMX21 = (uint64_t)dm21;
270+
gsrDIMX.DIMX22 = (uint64_t)dm22;
271+
gsrDIMX.DIMX23 = (uint64_t)dm23;
272+
gsrDIMX.DIMX30 = (uint64_t)dm30;
273+
gsrDIMX.DIMX31 = (uint64_t)dm31;
274+
gsrDIMX.DIMX32 = (uint64_t)dm32;
275+
gsrDIMX.DIMX33 = (uint64_t)dm33;
276276
}
277277

278278
inline void
279-
CDrawEnv::SetScissorArea(tU32 scX, tU32 scY, tU32 scWidth, tU32 scHeight)
279+
CDrawEnv::SetScissorArea(uint32_t scX, uint32_t scY, uint32_t scWidth, uint32_t scHeight)
280280
{
281281
gsrScissor.clip_x0 = scX;
282282
gsrScissor.clip_y0 = scY;

include/ps2s/eetimer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class CEETimer {
133133
tMode.OVFF = 0;
134134
}
135135

136-
inline void SetCompareValue(tU16 val)
136+
inline void SetCompareValue(uint16_t val)
137137
{
138138
tComp = val;
139139
*pComp = tComp;
@@ -168,7 +168,7 @@ class CEETimer {
168168
protected:
169169
Timers::tMode tMode;
170170
Timers::tCount tCount;
171-
tU16 tComp;
171+
uint16_t tComp;
172172
tResolution Resolution;
173173

174174
volatile unsigned int* pMode;

0 commit comments

Comments
 (0)