Skip to content

Commit 4000b8d

Browse files
committed
update ps2sdk
1 parent 645c3c1 commit 4000b8d

File tree

13 files changed

+52
-51
lines changed

13 files changed

+52
-51
lines changed

external/modutils

external/ps2sdk

Submodule ps2sdk updated 3201 files

includes/pcsx2/inireader.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
void SetIniPath(const char* szFileContent, size_t size)
44
{
5-
inireader.iniBuf = szFileContent;
5+
inireader.iniBuf = (int)szFileContent;
66
inireader.iniBufSize = size;
77
}
88

99
int ReadInteger(char* szSection, char* szKey, int iDefaultValue)
1010
{
1111
// hex numbers are not supported
1212
int result = iDefaultValue;
13-
if (rini_get_key(szSection, szKey, inireader.iniBuf, inireader.iniBufSize, &result, sizeof(result), INT_VAL))
13+
if (rini_get_key(szSection, szKey, (char*)inireader.iniBuf, inireader.iniBufSize, &result, sizeof(result), INT_VAL))
1414
{
1515
return result;
1616
}
@@ -55,7 +55,7 @@ float ratof(char* arr)
5555
float ReadFloat(char* szSection, char* szKey, float fltDefaultValue)
5656
{
5757
static char Buffer[30];
58-
if (rini_get_key(szSection, szKey, inireader.iniBuf, inireader.iniBufSize, &Buffer, sizeof(Buffer), STRING_VAL))
58+
if (rini_get_key(szSection, szKey, (char*)inireader.iniBuf, inireader.iniBufSize, &Buffer, sizeof(Buffer), STRING_VAL))
5959
{
6060
return ratof(Buffer);
6161
}
@@ -68,7 +68,7 @@ float ReadFloat(char* szSection, char* szKey, float fltDefaultValue)
6868
bool ReadBoolean(char* szSection, char* szKey, bool bDefaultValue)
6969
{
7070
bool result = bDefaultValue;
71-
if (rini_get_key(szSection, szKey, inireader.iniBuf, inireader.iniBufSize, &result, sizeof(result), BOOL_VAL))
71+
if (rini_get_key(szSection, szKey, (char*)inireader.iniBuf, inireader.iniBufSize, &result, sizeof(result), BOOL_VAL))
7272
{
7373
return result;
7474
}
@@ -80,7 +80,7 @@ bool ReadBoolean(char* szSection, char* szKey, bool bDefaultValue)
8080

8181
char* ReadString(char* szSection, char* szKey, char* szDefaultValue, char* Buffer, int BufferSize)
8282
{
83-
if (rini_get_key(szSection, szKey, inireader.iniBuf, inireader.iniBufSize, Buffer, BufferSize, STRING_VAL))
83+
if (rini_get_key(szSection, szKey, (char*)inireader.iniBuf, inireader.iniBufSize, Buffer, BufferSize, STRING_VAL))
8484
{
8585
while (*Buffer == ' ')
8686
*Buffer++;

includes/pcsx2/injector.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ uint32_t parseCommand(uint32_t command, uint32_t from, uint32_t to)
99
return (command & mask) >> from;
1010
}
1111

12-
void* GetGP()
12+
void* _GetGP()
1313
{
14-
unsigned int gp;
14+
void* gp;
1515
asm(
1616
"move %0, $gp\n"
1717
: "=r"(gp)
@@ -26,17 +26,17 @@ uintptr_t adjustAddress(uintptr_t addr)
2626

2727
void WriteMemoryRaw(uintptr_t addr, void* value, size_t size)
2828
{
29-
memcpy(adjustAddress(addr), value, size);
29+
memcpy((void*)adjustAddress(addr), value, size);
3030
}
3131

3232
void ReadMemoryRaw(uintptr_t addr, void* ret, size_t size)
3333
{
34-
memcpy(ret, adjustAddress(addr), size);
34+
memcpy((void*)ret, (void*)adjustAddress(addr), size);
3535
}
3636

3737
void MemoryFill(uintptr_t addr, uint8_t value, size_t size)
3838
{
39-
unsigned char* p = adjustAddress(addr);
39+
unsigned char* p = (unsigned char*)adjustAddress(addr);
4040
while (size--)
4141
{
4242
*p++ = (unsigned char)value;
@@ -134,7 +134,7 @@ uintptr_t MakeJMPwNOP(uintptr_t at, uintptr_t dest)
134134
{
135135
uintptr_t bd = GetBranchDestination(at);
136136
WriteMemory32(adjustAddress(at), (0x08000000 | ((adjustAddress(dest) & 0x0FFFFFFC) >> 2)));
137-
MakeNOP(adjustAddress(at + 4));
137+
injector.MakeNOP(adjustAddress(at + 4));
138138
return bd;
139139
}
140140

@@ -182,7 +182,7 @@ uintptr_t MakeInline(size_t instrCount, uintptr_t at, ...)
182182
}
183183

184184
uintptr_t MakeCallStub(uintptr_t numInstr) {
185-
return AllocMemBlock(numInstr * sizeof(uintptr_t));
185+
return (uintptr_t)AllocMemBlock(numInstr * sizeof(uintptr_t));
186186
}
187187

188188
void MakeLUIORI(uintptr_t at, RegisterID reg, float imm)
@@ -291,7 +291,7 @@ void MakeInlineLI(uintptr_t at, int32_t imm)
291291

292292
struct injector_t injector =
293293
{
294-
.GetGP = GetGP,
294+
.GetGP = _GetGP,
295295
.WriteMemoryRaw = WriteMemoryRaw,
296296
.ReadMemoryRaw = ReadMemoryRaw,
297297
.MemoryFill = MemoryFill,

includes/pcsx2/injector.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ extern struct injector_t injector;
7979
9,8,7,6,5,4,3,2,1,0
8080
#endif
8181

82-
#define MakeInlineWrapper(at, ...) MakeInline(PP_NARG(__VA_ARGS__), at, __VA_ARGS__)
83-
#define MakeInlineWrapperWithNOP(at, ...) MakeNOP(at + 4); MakeInline(PP_NARG(__VA_ARGS__), at, __VA_ARGS__)
82+
#define MakeInlineWrapper(at, ...) injector.MakeInline(PP_NARG(__VA_ARGS__), at, __VA_ARGS__)
83+
#define MakeInlineWrapperWithNOP(at, ...) injector.MakeNOP(at + 4); injector.MakeInline(PP_NARG(__VA_ARGS__), at, __VA_ARGS__)
8484
#endif

includes/pcsx2/memalloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#endif
66

77
int mem_custom_initialized = 0;
8-
char mem_custom[MEM_CUSTOM_TOTAL_SIZE] = { 0 };
8+
char mem_custom[MEM_CUSTOM_TOTAL_SIZE] = { 1 };
99
struct mem_block* mem_freeList = (struct mem_block*)mem_custom;
1010

1111
void mem_initialize() {

includes/pcsx2/memalloc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define H_MEMALLOC
33
#include <stdio.h>
44
#include <stddef.h>
5+
#include <string.h>
56

67
struct mem_block {
78
size_t size;

includes/pcsx2/patterns.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ uintptr_t range_get(size_t count, uintptr_t range_start, size_t range_size, cons
9595
size_t len = strlen(pattern_str);
9696
static uint8_t buf[buf_size/*len*/];
9797
uint8_t size = hextobin(pattern_str, buf, len, wc);
98-
uint8_t* result = bytes_find_nth(count, range_start, range_size, buf, size, wc);
98+
uint8_t* result = bytes_find_nth(count, (uint8_t*)range_start, range_size, buf, size, wc);
9999
if (result)
100-
return result + offset;
100+
return (uintptr_t)(result + offset);
101101
else
102102
return 0;
103103
}

source/GTALCS.PCSX2F.WidescreenFix/lodl.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4831,7 +4831,7 @@ void RegisterLODLights()
48314831
{
48324832
if (!aLodLights[i].nCoronaShowMode)
48334833
{
4834-
CCoronas__RegisterCorona(&aLodLights[i], aLodLights[i].r, aLodLights[i].g, aLodLights[i].b, alpha, pos, 0, 0, radius, fCoronaFarClip, fUnkDist1, fUnkDist2, 1, 0, 0, 0);
4834+
CCoronas__RegisterCorona((int)&aLodLights[i], aLodLights[i].r, aLodLights[i].g, aLodLights[i].b, alpha, pos, 0, 0, radius, fCoronaFarClip, fUnkDist1, fUnkDist2, 1, 0, 0, 0);
48354835
}
48364836
//else
48374837
//{
@@ -4850,7 +4850,7 @@ void RegisterLODLights()
48504850
{
48514851
if ((aLodLights[i].r >= 250 && aLodLights[i].g >= 100 && aLodLights[i].b <= 100) && ((curMin == 9 || curMin == 19 || curMin == 29 || curMin == 39 || curMin == 49 || curMin == 59))) //yellow
48524852
{
4853-
CCoronas__RegisterCorona(&aLodLights[i], aLodLights[i].r, aLodLights[i].g, aLodLights[i].b, alpha, pos, 0, 0, radius, fCoronaFarClip, fUnkDist1, fUnkDist2, 1, 0, 0, 0);
4853+
CCoronas__RegisterCorona((int)&aLodLights[i], aLodLights[i].r, aLodLights[i].g, aLodLights[i].b, alpha, pos, 0, 0, radius, fCoronaFarClip, fUnkDist1, fUnkDist2, 1, 0, 0, 0);
48544854
}
48554855
else
48564856
{
@@ -4859,27 +4859,27 @@ void RegisterLODLights()
48594859
{
48604860
if ((aLodLights[i].r >= 250 && aLodLights[i].g < 100 && aLodLights[i].b == 0) && (((curMin >= 0 && curMin < 9) || (curMin >= 20 && curMin < 29) || (curMin >= 40 && curMin < 49)))) //red
48614861
{
4862-
CCoronas__RegisterCorona(&aLodLights[i], aLodLights[i].r, aLodLights[i].g, aLodLights[i].b, alpha, pos, 0, 0, radius, fCoronaFarClip, fUnkDist1, fUnkDist2, 1, 0, 0, 0);
4862+
CCoronas__RegisterCorona((int)&aLodLights[i], aLodLights[i].r, aLodLights[i].g, aLodLights[i].b, alpha, pos, 0, 0, radius, fCoronaFarClip, fUnkDist1, fUnkDist2, 1, 0, 0, 0);
48634863
}
48644864
else
48654865
{
48664866
if ((aLodLights[i].r == 0 && aLodLights[i].g >= 250 && aLodLights[i].b == 0) && (((curMin > 9 && curMin < 19) || (curMin > 29 && curMin < 39) || (curMin > 49 && curMin < 59)))) //green
48674867
{
4868-
CCoronas__RegisterCorona(&aLodLights[i], aLodLights[i].r, aLodLights[i].g, aLodLights[i].b, alpha, pos, 0, 0, radius, fCoronaFarClip, fUnkDist1, fUnkDist2, 1, 0, 0, 0);
4868+
CCoronas__RegisterCorona((int)&aLodLights[i], aLodLights[i].r, aLodLights[i].g, aLodLights[i].b, alpha, pos, 0, 0, radius, fCoronaFarClip, fUnkDist1, fUnkDist2, 1, 0, 0, 0);
48694869
}
48704870
}
48714871
}
48724872
else
48734873
{
48744874
if ((aLodLights[i].r == 0 && aLodLights[i].g >= 250 && aLodLights[i].b == 0) && (((curMin >= 0 && curMin < 9) || (curMin >= 20 && curMin < 29) || (curMin >= 40 && curMin < 49)))) //red
48754875
{
4876-
CCoronas__RegisterCorona(&aLodLights[i], aLodLights[i].r, aLodLights[i].g, aLodLights[i].b, alpha, pos, 0, 0, radius, fCoronaFarClip, fUnkDist1, fUnkDist2, 1, 0, 0, 0);
4876+
CCoronas__RegisterCorona((int)&aLodLights[i], aLodLights[i].r, aLodLights[i].g, aLodLights[i].b, alpha, pos, 0, 0, radius, fCoronaFarClip, fUnkDist1, fUnkDist2, 1, 0, 0, 0);
48774877
}
48784878
else
48794879
{
48804880
if ((aLodLights[i].r >= 250 && aLodLights[i].g < 100 && aLodLights[i].b == 0) && (((curMin > 9 && curMin < 19) || (curMin > 29 && curMin < 39) || (curMin > 49 && curMin < 59)))) //green
48814881
{
4882-
CCoronas__RegisterCorona(&aLodLights[i], aLodLights[i].r, aLodLights[i].g, aLodLights[i].b, alpha, pos, 0, 0, radius, fCoronaFarClip, fUnkDist1, fUnkDist2, 1, 0, 0, 0);
4882+
CCoronas__RegisterCorona((int)&aLodLights[i], aLodLights[i].r, aLodLights[i].g, aLodLights[i].b, alpha, pos, 0, 0, radius, fCoronaFarClip, fUnkDist1, fUnkDist2, 1, 0, 0, 0);
48834883
}
48844884
}
48854885
}

source/GTAVCS.PCSX2F.ImVehLM/main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ struct VehicleLightsData
538538
uint8_t align16 rasterBuffer[NUM_LIGHTS][16384];
539539
};
540540

541-
struct VehicleLightsData align16 arrayofData[NUM_VEHICLES - _6ATV] = { 0 };
541+
struct VehicleLightsData align16 arrayofData[NUM_VEHICLES - _6ATV] = { 1 };
542542

543543
struct RslTexture* DuplicateCarTexture(int arrI, int lightI, struct RslTexture* src)
544544
{
@@ -670,19 +670,19 @@ int CEntity__Render(void* car)
670670

671671
#ifdef DUMPER_MODE
672672
int (*FindPlayerVehicle)() = (void*)0x24A2D0;
673-
if (FindPlayerVehicle() == (int)car)
673+
if (FindPlayerVehicle() == (uintptr_t)car)
674674
#endif
675675
{
676676
#ifdef DUMPER_MODE
677-
if (gPVeh != (int)car)
677+
if (gPVeh != (uintptr_t)car)
678678
gCounter = 0;
679679

680-
gPVeh = (int)car;
680+
gPVeh = (uintptr_t)car;
681681
counter++;
682682
#endif
683683

684684
// PreRender
685-
struct RslElement* m_pRwClump = *(struct RslElement**)((int)car + 0x50);
685+
struct RslElement* m_pRwClump = *(struct RslElement**)((uintptr_t)car + 0x50);
686686
RslElementGroupForAllElements(m_pRwClump, SetElementRendererCB_ImVehLM, car);
687687
// Render
688688
res = CEntityRender(car);

0 commit comments

Comments
 (0)