X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fpsxbios.c;h=a0588be99d9646971efb9ce6ef7902f5fffd8fe1;hp=ecd4264d5db5fe1d24e7f84ee8c9b69fb1103ea1;hb=857275a93c8e222bc800999f08d4b42e327f4c1b;hpb=3c8913013a3bb1908186342759f881baa16602b9 diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index ecd4264d..a0588be9 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -35,6 +35,10 @@ #include "gpu.h" #include +#if (defined(__GNUC__) && __GNUC__ >= 5) || defined(__clang__) +#pragma GCC diagnostic ignored "-Wpointer-sign" +#endif + #undef SysPrintf #define SysPrintf if (Config.PsxOut) printf @@ -1401,43 +1405,46 @@ void psxBios_FlushCache() { // 44 #ifdef PSXBIOS_LOG PSXBIOS_LOG("psxBios_%s\n", biosA0n[0x44]); #endif - +#ifdef ICACHE_EMULATION + psxCpu->Notify(R3000ACPU_NOTIFY_CACHE_ISOLATED, NULL); + psxCpu->Notify(R3000ACPU_NOTIFY_CACHE_UNISOLATED, NULL); +#endif pc0 = ra; } void psxBios_GPU_dw() { // 0x46 int size; - s32 *ptr; + u32 *ptr; #ifdef PSXBIOS_LOG PSXBIOS_LOG("psxBios_%s\n", biosA0n[0x46]); #endif GPU_writeData(0xa0000000); - GPU_writeData((a1<<16)|(a0&0xffff)); - GPU_writeData((a3<<16)|(a2&0xffff)); - size = (a2*a3+1)/2; - ptr = (s32*)PSXM(Rsp[4]); //that is correct? - do { - GPU_writeData(SWAP32(*ptr)); - ptr++; - } while(--size); + GPU_writeData((a1<<0x10)|(a0&0xffff)); + GPU_writeData((a3<<0x10)|(a2&0xffff)); + size = (a2*a3)/2; + ptr = (u32*)PSXM(Rsp[4]); //that is correct? + while(size--) + { + GPU_writeData(SWAPu32(*ptr++)); + } pc0 = ra; } void psxBios_mem2vram() { // 0x47 int size; - + gpuSyncPluginSR(); GPU_writeData(0xa0000000); - GPU_writeData((a1<<16)|(a0&0xffff)); - GPU_writeData((a3<<16)|(a2&0xffff)); - size = (a2*a3+1)/2; + GPU_writeData((a1<<0x10)|(a0&0xffff)); + GPU_writeData((a3<<0x10)|(a2&0xffff)); + size = ((((a2 * a3) / 2) >> 4) << 16); GPU_writeStatus(0x04000002); psxHwWrite32(0x1f8010f4,0); psxHwWrite32(0x1f8010f0,psxHwRead32(0x1f8010f0)|0x800); psxHwWrite32(0x1f8010a0,Rsp[4]);//might have a buggy... - psxHwWrite32(0x1f8010a4,((size/16)<<16)|16); + psxHwWrite32(0x1f8010a4, size | 0x10); psxHwWrite32(0x1f8010a8,0x01000201); pc0 = ra; @@ -1450,22 +1457,26 @@ void psxBios_SendGPU() { // 0x48 } void psxBios_GPU_cw() { // 0x49 + gpuSyncPluginSR(); GPU_writeData(a0); pc0 = ra; + v0 = HW_GPU_STATUS; } void psxBios_GPU_cwb() { // 0x4a - s32 *ptr = (s32*)Ra0; + u32 *ptr = (u32*)Ra0; int size = a1; - while(size--) { - GPU_writeData(SWAP32(*ptr)); - ptr++; + gpuSyncPluginSR(); + while(size--) + { + GPU_writeData(SWAPu32(*ptr++)); } pc0 = ra; } void psxBios_GPU_SendPackets() { //4b: + gpuSyncPluginSR(); GPU_writeStatus(0x04000002); psxHwWrite32(0x1f8010f4,0); psxHwWrite32(0x1f8010f0,psxHwRead32(0x1f8010f0)|0x800); @@ -2021,10 +2032,10 @@ void psxBios_UnDeliverEvent() { // 0x20 char ffile[64], *pfile; int nfile; -static void buopen(int mcd, u8 *ptr, u8 *cfg) +static void buopen(int mcd, char *ptr, char *cfg) { int i; - u8 *fptr = ptr; + char *fptr = ptr; strcpy(FDesc[1 + mcd].name, Ra0+5); FDesc[1 + mcd].offset = 0; @@ -2055,7 +2066,7 @@ static void buopen(int mcd, u8 *ptr, u8 *cfg) fptr[6] = 0x00; fptr[7] = 0x00; strcpy(fptr+0xa, FDesc[1 + mcd].name); - pptr = fptr2 = fptr; + pptr = fptr2 = (u8 *)fptr; for(j=2; j<=nblk; j++) { int k; for(i++; i<16; i++) { @@ -2090,8 +2101,6 @@ static void buopen(int mcd, u8 *ptr, u8 *cfg) */ void psxBios_open() { // 0x32 - int i; - char *ptr; void *pa0 = Ra0; #ifdef PSXBIOS_LOG