Lines 56-63
Link Here
|
56 |
|
56 |
|
57 |
writeok=1; |
57 |
writeok=1; |
58 |
|
58 |
|
59 |
psxMemLUT = (u32*)malloc(0x10000 * 4); |
59 |
psxMemLUT = malloc(0x10000 * sizeof(psxMemLUT)); |
60 |
memset(psxMemLUT, 0, 0x10000 * 4); |
60 |
memset(psxMemLUT, 0, 0x10000 * sizeof(psxMemLUT)); |
61 |
|
61 |
|
62 |
psxM = (char*)malloc(0x00200000); |
62 |
psxM = (char*)malloc(0x00200000); |
63 |
psxP = (char*)malloc(0x00010000); |
63 |
psxP = (char*)malloc(0x00010000); |
Lines 67-82
Link Here
|
67 |
printf("Error allocating memory"); return -1; |
67 |
printf("Error allocating memory"); return -1; |
68 |
} |
68 |
} |
69 |
|
69 |
|
|
|
70 |
#ifdef _LP64 |
71 |
for (i=0; i<0x80; i++) psxMemLUT[i + 0x0000] = (u64)&psxM[(i & 0x1f) << 16]; |
72 |
#else |
70 |
for (i=0; i<0x80; i++) psxMemLUT[i + 0x0000] = (u32)&psxM[(i & 0x1f) << 16]; |
73 |
for (i=0; i<0x80; i++) psxMemLUT[i + 0x0000] = (u32)&psxM[(i & 0x1f) << 16]; |
71 |
|
74 |
#endif |
72 |
memcpy(psxMemLUT + 0x8000, psxMemLUT, 0x80 * 4); |
75 |
memcpy(psxMemLUT + 0x8000, psxMemLUT, 0x80 * sizeof(psxMemLUT)); |
73 |
memcpy(psxMemLUT + 0xa000, psxMemLUT, 0x80 * 4); |
76 |
memcpy(psxMemLUT + 0xa000, psxMemLUT, 0x80 * sizeof(psxMemLUT)); |
74 |
|
77 |
|
|
|
78 |
#ifdef _LP64 |
79 |
for (i=0; i<0x01; i++) psxMemLUT[i + 0x1f00] = (u64)&psxP[i << 16]; |
80 |
for (i=0; i<0x01; i++) psxMemLUT[i + 0x1f80] = (u64)&psxH[i << 16]; |
81 |
for (i=0; i<0x08; i++) psxMemLUT[i + 0xbfc0] = (u64)&psxR[i << 16]; |
82 |
#else |
75 |
for (i=0; i<0x01; i++) psxMemLUT[i + 0x1f00] = (u32)&psxP[i << 16]; |
83 |
for (i=0; i<0x01; i++) psxMemLUT[i + 0x1f00] = (u32)&psxP[i << 16]; |
76 |
|
|
|
77 |
for (i=0; i<0x01; i++) psxMemLUT[i + 0x1f80] = (u32)&psxH[i << 16]; |
84 |
for (i=0; i<0x01; i++) psxMemLUT[i + 0x1f80] = (u32)&psxH[i << 16]; |
78 |
|
|
|
79 |
for (i=0; i<0x08; i++) psxMemLUT[i + 0xbfc0] = (u32)&psxR[i << 16]; |
85 |
for (i=0; i<0x08; i++) psxMemLUT[i + 0xbfc0] = (u32)&psxR[i << 16]; |
|
|
86 |
#endif |
80 |
|
87 |
|
81 |
return 0; |
88 |
return 0; |
82 |
} |
89 |
} |
Lines 215-230
Link Here
|
215 |
case 0x800: case 0x804: |
222 |
case 0x800: case 0x804: |
216 |
if (writeok == 0) break; |
223 |
if (writeok == 0) break; |
217 |
writeok = 0; |
224 |
writeok = 0; |
218 |
memset(psxMemLUT + 0x0000, 0, 0x80 * 4); |
225 |
memset(psxMemLUT + 0x0000, 0, 0x80 * sizeof(psxMemLUT)); |
219 |
memset(psxMemLUT + 0x8000, 0, 0x80 * 4); |
226 |
memset(psxMemLUT + 0x8000, 0, 0x80 * sizeof(psxMemLUT)); |
220 |
memset(psxMemLUT + 0xa000, 0, 0x80 * 4); |
227 |
memset(psxMemLUT + 0xa000, 0, 0x80 * sizeof(psxMemLUT)); |
221 |
break; |
228 |
break; |
222 |
case 0x1e988: |
229 |
case 0x1e988: |
223 |
if (writeok == 1) break; |
230 |
if (writeok == 1) break; |
224 |
writeok = 1; |
231 |
writeok = 1; |
|
|
232 |
#ifdef _LP64 |
233 |
for (i=0; i<0x80; i++) psxMemLUT[i + 0x0000] = (u64)&psxM[(i & 0x1f) << 16]; |
234 |
#else |
225 |
for (i=0; i<0x80; i++) psxMemLUT[i + 0x0000] = (u32)&psxM[(i & 0x1f) << 16]; |
235 |
for (i=0; i<0x80; i++) psxMemLUT[i + 0x0000] = (u32)&psxM[(i & 0x1f) << 16]; |
226 |
memcpy(psxMemLUT + 0x8000, psxMemLUT, 0x80 * 4); |
236 |
#endif |
227 |
memcpy(psxMemLUT + 0xa000, psxMemLUT, 0x80 * 4); |
237 |
memcpy(psxMemLUT + 0x8000, psxMemLUT, 0x80 * sizeof(psxMemLUT)); |
|
|
238 |
memcpy(psxMemLUT + 0xa000, psxMemLUT, 0x80 * sizeof(psxMemLUT)); |
228 |
break; |
239 |
break; |
229 |
default: |
240 |
default: |
230 |
break; |
241 |
break; |