From 01f49908879197b1715483321a9490dd71c8874b Mon Sep 17 00:00:00 2001 From: Stelios Tsampas Date: Mon, 31 Jul 2017 12:48:37 +0300 Subject: [PATCH] * Sync with codeplex branch (libpcsxcore, linux gui) This commit reflects mostly changes that happened in upstream since the last sync. Commit messages in upstream are lacking information. Most important changes are commented below, the rest of them are either formating or just trivial stuff. Memory viewer, invalidate dynarec gui/DebugMemory.c libpcsxcore/cdrom.c libpcsxcore/gpu.c libpcsxcore/misc.c libpcsxcore/psxdma.c Load binary files and psx executables libpcsxcore/misc.c libpcsxcore/misc.h libpcsxcore/plugin.c libpcsxcore/plugin.h Support for psxida libpcsxcore/debug.c libpcsxcore/r3000a.c plugins/bladesio1/connection.c disable loading save states with digits gui/Plugin.c Fix psxDIV in interpreter libpcsxcore/psxinterpreter.c --- autogen.sh | 4 +- configure.ac | 2 +- gui/DebugMemory.c | 4 + gui/GtkGui.c | 6 +- gui/Plugin.c | 2 +- libpcsxcore/cdrom.c | 4 +- libpcsxcore/debug.c | 61 ++++++++++- libpcsxcore/gpu.c | 3 +- libpcsxcore/gte.c | 20 ++-- libpcsxcore/ix86/iR3000A.c | 146 ++------------------------- libpcsxcore/ix86_64/ix86_cpudetect.c | 2 +- libpcsxcore/misc.c | 120 +++++++++++++++++++++- libpcsxcore/misc.h | 1 + libpcsxcore/plugins.c | 26 +++++ libpcsxcore/plugins.h | 4 + libpcsxcore/psxcommon.c | 3 +- libpcsxcore/psxcommon.h | 2 +- libpcsxcore/psxcounters.c | 4 +- libpcsxcore/psxdma.c | 2 + libpcsxcore/psxhw.c | 10 +- libpcsxcore/psxinterpreter.c | 17 ++-- libpcsxcore/psxmem.c | 19 ++-- libpcsxcore/psxmem.h | 4 +- libpcsxcore/r3000a.c | 1 + plugins/bladesio1/Makefile.am | 1 - plugins/bladesio1/cfg.c | 2 +- plugins/bladesio1/connection.c | 22 +++- plugins/bladesio1/gui.c | 2 +- plugins/bladesio1/sio1.c | 3 + plugins/dfcdrom/Makefile.am | 1 - plugins/dfcdrom/cdr.c | 4 + plugins/dfsound/Makefile.am | 1 - plugins/dfsound/cfg.c | 4 + plugins/dfxvideo/Makefile.am | 1 - plugins/dfxvideo/cfg.c | 4 + plugins/peopsxgl/Makefile.am | 1 - plugins/peopsxgl/draw.c | 1 - plugins/peopsxgl/gpu.c | 14 +-- plugins/peopsxgl/prim.c | 2 - plugins/peopsxgl/stdafx.h | 2 + 40 files changed, 321 insertions(+), 211 deletions(-) diff --git a/autogen.sh b/autogen.sh index ea9f1a52..ade33aa3 100755 --- a/autogen.sh +++ b/autogen.sh @@ -8,8 +8,10 @@ for dir in include m4; do mkdir "$dir" fi done -autoreconf -f -i . +autoreconf -f -i if [ $? -ne 0 ]; then echo "autoreconf failed" exit $? fi + +./configure --enable-maintainer-mode "$@" diff --git a/configure.ac b/configure.ac index 001bacbd..542b500f 100644 --- a/configure.ac +++ b/configure.ac @@ -48,12 +48,12 @@ doc/Makefile libpcsxcore/Makefile gui/Makefile plugins/bladesio1/Makefile +plugins/nullsio1/Makefile plugins/dfinput/Makefile plugins/dfsound/Makefile plugins/dfxvideo/Makefile plugins/dfcdrom/Makefile plugins/dfnet/Makefile -plugins/nullsio1/Makefile plugins/peopsxgl/Makefile gui/data/pixmaps/Makefile po/Makefile.in]) diff --git a/gui/DebugMemory.c b/gui/DebugMemory.c index 096b6c5c..9bd4d322 100755 --- a/gui/DebugMemory.c +++ b/gui/DebugMemory.c @@ -18,6 +18,7 @@ #include "Linux.h" #include "../libpcsxcore/psxmem.h" +#include "../libpcsxcore/r3000a.h" #include #define MEMVIEW_MAX_LINES 256 @@ -286,6 +287,9 @@ static void MemView_Patch() { } psxMemWrite8(addr, (u8)val); +#ifdef PSXREC + psxCpu->Clear(addr, 1); +#endif addr++; } diff --git a/gui/GtkGui.c b/gui/GtkGui.c index 0fd6b65d..9ac46749 100755 --- a/gui/GtkGui.c +++ b/gui/GtkGui.c @@ -69,6 +69,8 @@ GtkWidget *Window = NULL; int destroy = 0; +extern void LidInterrupt(); + #define MAX_SLOTS 9 /* TODO - If MAX_SLOTS changes, need to find a way to automatically set all positions */ @@ -777,8 +779,8 @@ static gchar *Open_Iso_Proc() { } /* Save current path. */ - strcpy(Config.IsoImgDir, current_folder); - SaveConfig(); + strcpy(Config.IsoImgDir, current_folder); + SaveConfig(); /* free useless data */ GSList * ll = l; diff --git a/gui/Plugin.c b/gui/Plugin.c index 55068c31..389f4246 100755 --- a/gui/Plugin.c +++ b/gui/Plugin.c @@ -182,7 +182,7 @@ void PADhandleKey(int key) { return; if (modalt) KeyStateLoad(slot); else if (modctrl) KeyStateSave(slot); - else KeyStateLoad(OLD_SLOT + slot); + //else KeyStateLoad(OLD_SLOT + slot); break; case XK_F1: diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index f92cdd22..b0d462c6 100755 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -1516,9 +1516,9 @@ void psxDma3(u32 madr, u32 bcr, u32 chcr) { cdr.transferIndex++; adjustTransferIndex(); } - +#ifdef PSXREC psxCpu->Clear(madr, cdsize / 4); - +#endif // burst vs normal if( chcr == 0x11400100 ) { CDRDMA_INT( (cdsize/4) / 4 ); diff --git a/libpcsxcore/debug.c b/libpcsxcore/debug.c index b5497d11..a4e9ab35 100755 --- a/libpcsxcore/debug.c +++ b/libpcsxcore/debug.c @@ -230,6 +230,10 @@ Error messages (5xx): */ static int debugger_active = 0, paused = 0, trace = 0, printpc = 0, reset = 0, resetting = 0; +static int run_to = 0; +static u32 run_to_addr = 0; +static int step_over = 0; +static u32 step_over_addr = 0; static int mapping_e = 0, mapping_r8 = 0, mapping_r16 = 0, mapping_r32 = 0, mapping_w8 = 0, mapping_w16 = 0, mapping_w32 = 0; static int breakmp_e = 0, breakmp_r8 = 0, breakmp_r16 = 0, breakmp_r32 = 0, breakmp_w8 = 0, breakmp_w16 = 0, breakmp_w32 = 0; @@ -393,13 +397,34 @@ void ProcessDebug() { } } if (!paused) { - if(trace && printpc) - { + if(trace && printpc) { char reply[256]; sprintf(reply, "219 %s\r\n", disR3000AF(psxMemRead32(psxRegs.pc), psxRegs.pc)); WriteSocket(reply, strlen(reply)); } + if(step_over) { + if(psxRegs.pc == step_over_addr) { + char reply[256]; + step_over = 0; + step_over_addr = 0; + sprintf(reply, "050 @%08X\r\n", psxRegs.pc); + WriteSocket(reply, strlen(reply)); + paused = 1; + } + } + + if(run_to) { + if(psxRegs.pc == run_to_addr) { + char reply[256]; + run_to = 0; + run_to_addr = 0; + sprintf(reply, "040 @%08X\r\n", psxRegs.pc); + WriteSocket(reply, strlen(reply)); + paused = 1; + } + } + DebugCheckBP(psxRegs.pc, BE); } if (mapping_e) { @@ -1078,6 +1103,37 @@ static void ProcessCommands() { reset = 1; sprintf(reply, "499 Resetting\r\n"); break; + case 0x3A0: + // run to + p = arguments; + if (arguments) { + run_to = 1; + run_to_addr = strtol(arguments, &p, 16); + paused = 0; + } + if (p == arguments) { + sprintf(reply, "500 Malformed 3A0 command '%s'\r\n", arguments); + break; + } + sprintf(reply, "4A0 run to addr %08X\r\n", run_to_addr); + break; + case 0x3A1: + // step over (jal) + if(paused) { + u32 opcode = psxMemRead32(psxRegs.pc); + if((opcode >> 26) == 3) { + step_over = 1; + step_over_addr = psxRegs.pc + 8; + paused = 0; + + sprintf(reply, "4A1 step over addr %08X\r\n", psxRegs.pc); + } + else { + trace = 1; + paused = 0; + } + } + break; default: sprintf(reply, "500 Unknown command '%s'\r\n", cmd); break; @@ -1100,6 +1156,7 @@ void DebugCheckBP(u32 address, enum breakpoint_types type) { if (!debugger_active || reset) return; + for (bp = first; bp; bp = next_breakpoint(bp)) { if ((bp->type == type) && (bp->address == address)) { sprintf(reply, "030 %X@%08X\r\n", bp->number, psxRegs.pc); diff --git a/libpcsxcore/gpu.c b/libpcsxcore/gpu.c index 37367363..d34093ea 100755 --- a/libpcsxcore/gpu.c +++ b/libpcsxcore/gpu.c @@ -118,8 +118,9 @@ void psxDma2(u32 madr, u32 bcr, u32 chcr) { // GPU // BA blocks * BS words (word = 32-bits) size = (bcr >> 16) * (bcr & 0xffff); GPU_readDataMem(ptr, size); +#ifdef PSXREC psxCpu->Clear(madr, size); - +#endif #if 1 // already 32-bit word size ((size * 4) / 4) GPUDMA_INT(size); diff --git a/libpcsxcore/gte.c b/libpcsxcore/gte.c index 05cb74a6..bd9c30c6 100755 --- a/libpcsxcore/gte.c +++ b/libpcsxcore/gte.c @@ -250,43 +250,37 @@ static void CTC2(u32 value, int reg) { psxRegs.CP2C.p[reg].d = value; } -void gteMFC2() -{ +void gteMFC2() { // CPU[Rt] = GTE_D[Rd] if (!_Rt_) return; psxRegs.GPR.r[_Rt_] = MFC2(_Rd_); } -void gteCFC2() -{ +void gteCFC2() { // CPU[Rt] = GTE_C[Rd] if (!_Rt_) return; psxRegs.GPR.r[_Rt_] = psxRegs.CP2C.p[_Rd_].d; } -void gteMTC2() -{ +void gteMTC2() { MTC2(psxRegs.GPR.r[_Rt_], _Rd_); } -void gteCTC2() -{ +void gteCTC2() { CTC2(psxRegs.GPR.r[_Rt_], _Rd_); } #define _oB_ (psxRegs.GPR.r[_Rs_] + _Imm_) void gteLWC2() { - u32 val = psxMemRead32(_oB_); - MTC2(val, _Rt_); + MTC2(psxMemRead32(_oB_), _Rt_); } void gteSWC2() { - u32 val = MFC2(_Rt_); - psxMemWrite32(_oB_, val); + psxMemWrite32(_oB_, MFC2(_Rt_)); } -inline s64 gte_shift(s64 a, int sf) { +static inline s64 gte_shift(s64 a, int sf) { if(sf > 0) return a >> 12; else if(sf < 0) diff --git a/libpcsxcore/ix86/iR3000A.c b/libpcsxcore/ix86/iR3000A.c index 66fac432..9e66e9ca 100755 --- a/libpcsxcore/ix86/iR3000A.c +++ b/libpcsxcore/ix86/iR3000A.c @@ -156,12 +156,10 @@ static void iFlushRegs() { } } -static void iPushReg(int reg) -{ +static void iPushReg(int reg) { if (IsConst(reg)) { PUSH32I(iRegs[reg].k); - } - else { + } else { PUSH32M((u32)&psxRegs.GPR.r[reg]); } } @@ -619,9 +617,6 @@ static void recADDIU() { // iFlushRegs(); - - - if (_Rs_ == _Rt_) { if (IsConst(_Rt_)) { iRegs[_Rt_].k+= _Imm_; @@ -651,7 +646,6 @@ static void recADDIU() { MOV32RtoM((u32)&psxRegs.GPR.r[_Rt_], EAX); } } - } static void recADDI() { @@ -660,46 +654,35 @@ static void recADDI() { // iFlushRegs(); - - - if (_Rs_ == _Rt_) { if (IsConst(_Rt_)) { iRegs[_Rt_].k += _Imm_; - } - else { + } else { if (_Imm_ == 1) { INC32M((u32)&psxRegs.GPR.r[_Rt_]); - } - else if (_Imm_ == -1) { + } else if (_Imm_ == -1) { DEC32M((u32)&psxRegs.GPR.r[_Rt_]); - } - else if (_Imm_) { + } else if (_Imm_) { ADD32ItoM((u32)&psxRegs.GPR.r[_Rt_], _Imm_); } } - } - else { + } else { if (IsConst(_Rs_)) { MapConst(_Rt_, iRegs[_Rs_].k + _Imm_); - } - else { + } else { iRegs[_Rt_].state = ST_UNK; MOV32MtoR(EAX, (u32)&psxRegs.GPR.r[_Rs_]); if (_Imm_ == 1) { INC32R(EAX); - } - else if (_Imm_ == -1) { + } else if (_Imm_ == -1) { DEC32R(EAX); - } - else if (_Imm_) { + } else if (_Imm_) { ADD32ItoR(EAX, _Imm_); } MOV32RtoM((u32)&psxRegs.GPR.r[_Rt_], EAX); } } - } static void recSLTI() { @@ -708,7 +691,6 @@ static void recSLTI() { // iFlushRegs(); - if (IsConst(_Rs_)) { MapConst(_Rt_, (s32)iRegs[_Rs_].k < _Imm_); } else { @@ -720,8 +702,6 @@ static void recSLTI() { AND32ItoR(EAX, 0xff); MOV32RtoM((u32)&psxRegs.GPR.r[_Rt_], EAX); } - - } static void recSLTIU() { @@ -730,7 +710,6 @@ static void recSLTIU() { // iFlushRegs(); - if (IsConst(_Rs_)) { MapConst(_Rt_, iRegs[_Rs_].k < _ImmU_); } else { @@ -742,8 +721,6 @@ static void recSLTIU() { AND32ItoR(EAX, 0xff); MOV32RtoM((u32)&psxRegs.GPR.r[_Rt_], EAX); } - - } static void recANDI() { @@ -752,7 +729,6 @@ static void recANDI() { // iFlushRegs(); - if (_Rs_ == _Rt_) { if (IsConst(_Rt_)) { iRegs[_Rt_].k&= _ImmU_; @@ -770,14 +746,13 @@ static void recANDI() { MOV32RtoM((u32)&psxRegs.GPR.r[_Rt_], EAX); } } - - } static void recORI() { // Rt = Rs Or Im if (!_Rt_) return; +// iFlushRegs(); if (_Rs_ == _Rt_) { if (IsConst(_Rt_)) { @@ -796,14 +771,13 @@ static void recORI() { MOV32RtoM((u32)&psxRegs.GPR.r[_Rt_], EAX); } } - - } static void recXORI() { // Rt = Rs Xor Im if (!_Rt_) return; +// iFlushRegs(); if (_Rs_ == _Rt_) { if (IsConst(_Rt_)) { @@ -822,8 +796,6 @@ static void recXORI() { MOV32RtoM((u32)&psxRegs.GPR.r[_Rt_], EAX); } } - - } //#endif //end of * Arithmetic with immediate operand @@ -839,8 +811,6 @@ static void recLUI() { if (!_Rt_) return; MapConst(_Rt_, psxRegs.code << 16); - - } //#endif //End of Load Higher ..... @@ -869,9 +839,6 @@ static void recADDU() { // iFlushRegs(); - - - if (IsConst(_Rs_) && IsConst(_Rt_)) { MapConst(_Rd_, iRegs[_Rs_].k + iRegs[_Rt_].k); } else if (IsConst(_Rs_)) { @@ -933,8 +900,6 @@ static void recADDU() { MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); } } - - } static void recADD() { @@ -948,8 +913,6 @@ static void recSUBU() { // iFlushRegs(); - - if (IsConst(_Rs_) && IsConst(_Rt_)) { MapConst(_Rd_, iRegs[_Rs_].k - iRegs[_Rt_].k); } else if (IsConst(_Rs_)) { @@ -971,8 +934,6 @@ static void recSUBU() { SUB32MtoR(EAX, (u32)&psxRegs.GPR.r[_Rt_]); MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); } - - } static void recSUB() { @@ -986,7 +947,6 @@ static void recAND() { // iFlushRegs(); - if (IsConst(_Rs_) && IsConst(_Rt_)) { MapConst(_Rd_, iRegs[_Rs_].k & iRegs[_Rt_].k); } else if (IsConst(_Rs_)) { @@ -1024,8 +984,6 @@ static void recAND() { MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); } } - - } static void recOR() { @@ -1034,8 +992,6 @@ static void recOR() { // iFlushRegs(); - - if (IsConst(_Rs_) && IsConst(_Rt_)) { MapConst(_Rd_, iRegs[_Rs_].k | iRegs[_Rt_].k); } else if (IsConst(_Rs_)) { @@ -1057,8 +1013,6 @@ static void recOR() { OR32MtoR (EAX, (u32)&psxRegs.GPR.r[_Rt_]); MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); } - - } static void recXOR() { @@ -1067,8 +1021,6 @@ static void recXOR() { // iFlushRegs(); - - if (IsConst(_Rs_) && IsConst(_Rt_)) { MapConst(_Rd_, iRegs[_Rs_].k ^ iRegs[_Rt_].k); } else if (IsConst(_Rs_)) { @@ -1090,8 +1042,6 @@ static void recXOR() { XOR32MtoR(EAX, (u32)&psxRegs.GPR.r[_Rt_]); MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); } - - } static void recNOR() { @@ -1100,7 +1050,6 @@ static void recNOR() { // iFlushRegs(); - if (IsConst(_Rs_) && IsConst(_Rt_)) { MapConst(_Rd_, ~(iRegs[_Rs_].k | iRegs[_Rt_].k)); } else if (IsConst(_Rs_)) { @@ -1125,8 +1074,6 @@ static void recNOR() { NOT32R (EAX); MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); } - - } static void recSLT() { @@ -1135,8 +1082,6 @@ static void recSLT() { // iFlushRegs(); - - if (IsConst(_Rs_) && IsConst(_Rt_)) { MapConst(_Rd_, (s32)iRegs[_Rs_].k < (s32)iRegs[_Rt_].k); } else if (IsConst(_Rs_)) { @@ -1164,8 +1109,6 @@ static void recSLT() { AND32ItoR(EAX, 0xff); MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); } - - } static void recSLTU() { @@ -1174,8 +1117,6 @@ static void recSLTU() { // iFlushRegs(); - - if (IsConst(_Rs_) && IsConst(_Rt_)) { MapConst(_Rd_, iRegs[_Rs_].k < iRegs[_Rt_].k); } else if (IsConst(_Rs_)) { @@ -1203,8 +1144,6 @@ static void recSLTU() { NEG32R (EAX); MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); } - - } //#endif //End of * Register arithmetic @@ -1224,14 +1163,11 @@ static void recMULT() { // iFlushRegs(); - if ((IsConst(_Rs_) && iRegs[_Rs_].k == 0) || (IsConst(_Rt_) && iRegs[_Rt_].k == 0)) { XOR32RtoR(EAX, EAX); MOV32RtoM((u32)&psxRegs.GPR.n.lo, EAX); MOV32RtoM((u32)&psxRegs.GPR.n.hi, EAX); - - return; } @@ -1248,8 +1184,6 @@ static void recMULT() { } MOV32RtoM((u32)&psxRegs.GPR.n.lo, EAX); MOV32RtoM((u32)&psxRegs.GPR.n.hi, EDX); - - } static void recMULTU() { @@ -1257,15 +1191,11 @@ static void recMULTU() { // iFlushRegs(); - - if ((IsConst(_Rs_) && iRegs[_Rs_].k == 0) || (IsConst(_Rt_) && iRegs[_Rt_].k == 0)) { XOR32RtoR(EAX, EAX); MOV32RtoM((u32)&psxRegs.GPR.n.lo, EAX); MOV32RtoM((u32)&psxRegs.GPR.n.hi, EAX); - - return; } @@ -1282,8 +1212,6 @@ static void recMULTU() { } MOV32RtoM((u32)&psxRegs.GPR.n.lo, EAX); MOV32RtoM((u32)&psxRegs.GPR.n.hi, EDX); - - } static void recDIV() { @@ -1291,8 +1219,6 @@ static void recDIV() { // iFlushRegs(); - - if (IsConst(_Rt_)) { if (iRegs[_Rt_].k == 0) { MOV32ItoM((u32)&psxRegs.GPR.n.lo, 0xffffffff); @@ -1302,8 +1228,6 @@ static void recDIV() { MOV32MtoR(EAX, (u32)&psxRegs.GPR.r[_Rs_]); MOV32RtoM((u32)&psxRegs.GPR.n.hi, EAX); } - - return; } MOV32ItoR(ECX, iRegs[_Rt_].k);// printf("divrtk %x\n", iRegs[_Rt_].k); @@ -1337,8 +1261,6 @@ static void recDIV() { x86SetJ8(j8Ptr[1]); } - - } static void recDIVU() { @@ -1346,8 +1268,6 @@ static void recDIVU() { // iFlushRegs(); - - if (IsConst(_Rt_)) { if (iRegs[_Rt_].k == 0) { MOV32ItoM((u32)&psxRegs.GPR.n.lo, 0xffffffff); @@ -1357,8 +1277,6 @@ static void recDIVU() { MOV32MtoR(EAX, (u32)&psxRegs.GPR.r[_Rs_]); MOV32RtoM((u32)&psxRegs.GPR.n.hi, EAX); } - - return; } MOV32ItoR(ECX, iRegs[_Rt_].k);// printf("divurtk %x\n", iRegs[_Rt_].k); @@ -1392,8 +1310,6 @@ static void recDIVU() { x86SetJ8(j8Ptr[1]); } - - } //#endif //End of * Register mult/div & Register trap logic @@ -1474,7 +1390,6 @@ static void recLB() { resp+= 4; } - static void recLBU() { // Rt = mem[Rs + Im] (unsigned) @@ -1520,7 +1435,6 @@ static void recLBU() { resp+= 4; } - static void recLH() { // Rt = mem[Rs + Im] (signed) @@ -1566,7 +1480,6 @@ static void recLH() { resp+= 4; } - static void recLHU() { // Rt = mem[Rs + Im] (unsigned) @@ -1661,7 +1574,6 @@ static void recLHU() { resp+= 4; } - static void recLW() { // Rt = mem[Rs + Im] (unsigned) @@ -1974,7 +1886,6 @@ void recLWR() { } } - static void recSB() { // mem[Rs + Im] = Rt @@ -2053,7 +1964,6 @@ static void recSH() { MOV16MtoR(EAX, (u32)&psxRegs.GPR.r[_Rt_]); MOV16RtoM((u32)&psxH[addr & 0xfff], EAX); } - return; } if (t == 0x1f80) { @@ -2261,7 +2171,6 @@ void iSWLk(u32 shift) { OR32RtoR (EAX, ECX); } - void recSWL() { // mem[Rs + Im] = Rt Merge mem[Rs + Im] @@ -2281,7 +2190,6 @@ void recSWL() { MOV32MtoR(EAX, (u32)&psxH[addr & 0xffc]); iSWLk(addr & 3); MOV32RtoM((u32)&psxH[addr & 0xffc], EAX); - return; } } @@ -2424,8 +2332,6 @@ static void recSLL() { // iFlushRegs(); - - if (IsConst(_Rt_)) { MapConst(_Rd_, iRegs[_Rt_].k << _Sa_); } else { @@ -2435,8 +2341,6 @@ static void recSLL() { if (_Sa_) SHL32ItoR(EAX, _Sa_); MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); } - - } static void recSRL() { @@ -2446,7 +2350,6 @@ static void recSRL() { // iFlushRegs(); - if (IsConst(_Rt_)) { MapConst(_Rd_, iRegs[_Rt_].k >> _Sa_); } else { @@ -2456,8 +2359,6 @@ static void recSRL() { if (_Sa_) SHR32ItoR(EAX, _Sa_); MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); } - - } static void recSRA() { @@ -2467,7 +2368,6 @@ static void recSRA() { // iFlushRegs(); - if (IsConst(_Rt_)) { MapConst(_Rd_, (s32)iRegs[_Rt_].k >> _Sa_); } else { @@ -2477,8 +2377,6 @@ static void recSRA() { if (_Sa_) SAR32ItoR(EAX, _Sa_); MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); } - - } //#endif @@ -2493,7 +2391,6 @@ static void recSLLV() { // iFlushRegs(); - if (IsConst(_Rt_) && IsConst(_Rs_)) { MapConst(_Rd_, iRegs[_Rt_].k << iRegs[_Rs_].k); } else if (IsConst(_Rs_)) { @@ -2518,8 +2415,6 @@ static void recSLLV() { SHL32CLtoR(EAX); MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); } - - } static void recSRLV() { @@ -2528,7 +2423,6 @@ static void recSRLV() { // iFlushRegs(); - if (IsConst(_Rt_) && IsConst(_Rs_)) { MapConst(_Rd_, iRegs[_Rt_].k >> iRegs[_Rs_].k); } else if (IsConst(_Rs_)) { @@ -2553,8 +2447,6 @@ static void recSRLV() { SHR32CLtoR(EAX); MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); } - - } static void recSRAV() { @@ -2564,7 +2456,6 @@ static void recSRAV() { // iFlushRegs(); - if (IsConst(_Rt_) && IsConst(_Rs_)) { MapConst(_Rd_, (s32)iRegs[_Rt_].k >> iRegs[_Rs_].k); } else if (IsConst(_Rs_)) { @@ -2589,8 +2480,6 @@ static void recSRAV() { SAR32CLtoR(EAX); MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); } - - } //#endif @@ -2628,26 +2517,20 @@ static void recMFHI() { if (!_Rd_) return; - iRegs[_Rd_].state = ST_UNK; MOV32MtoR(EAX, (u32)&psxRegs.GPR.n.hi); MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); - - } static void recMTHI() { // Hi = Rs - if (IsConst(_Rs_)) { MOV32ItoM((u32)&psxRegs.GPR.n.hi, iRegs[_Rs_].k); } else { MOV32MtoR(EAX, (u32)&psxRegs.GPR.r[_Rs_]); MOV32RtoM((u32)&psxRegs.GPR.n.hi, EAX); } - - } static void recMFLO() { @@ -2655,25 +2538,20 @@ static void recMFLO() { if (!_Rd_) return; - iRegs[_Rd_].state = ST_UNK; MOV32MtoR(EAX, (u32)&psxRegs.GPR.n.lo); MOV32RtoM((u32)&psxRegs.GPR.r[_Rd_], EAX); - } static void recMTLO() { // Lo = Rs - if (IsConst(_Rs_)) { MOV32ItoM((u32)&psxRegs.GPR.n.lo, iRegs[_Rs_].k); } else { MOV32MtoR(EAX, (u32)&psxRegs.GPR.r[_Rs_]); MOV32RtoM((u32)&psxRegs.GPR.n.lo, EAX); } - - } //#endif @@ -3089,7 +2967,6 @@ static void recHLE() { } // - #include "iPGXP.h" static void (*recBSC[64])() = { @@ -3146,7 +3023,6 @@ static void (*recCP2BSC[32])() = { recNULL, recNULL, recNULL, recNULL, recNULL, recNULL, recNULL, recNULL }; - // Trace all functions using PGXP static void(*pgxpRecBSC[64])() = { recSPECIAL, recREGIMM, recJ , recJAL , recBEQ , recBNE , recBLEZ, recBGTZ, diff --git a/libpcsxcore/ix86_64/ix86_cpudetect.c b/libpcsxcore/ix86_64/ix86_cpudetect.c index c59186bf..9bbb67d5 100755 --- a/libpcsxcore/ix86_64/ix86_cpudetect.c +++ b/libpcsxcore/ix86_64/ix86_cpudetect.c @@ -145,7 +145,7 @@ u64 GetCPUTick( void ) #endif } -#if defined(__LINUX__) || defined(__APPLE__) +#if defined(__linux__) || defined(__APPLE__) #include #include diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index d8a7805c..3c3eb318 100755 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -52,6 +52,10 @@ struct iso_directory_record { char name [1]; }; +//local extern +void trim_key(char *str, char key ); +void split( char* str, char key, char* pout ); + void mmssdd( char *b, char *p ) { int m, s, d; @@ -261,7 +265,9 @@ int LoadCdromFile(const char *filename, EXE_HEADER *head) { addr = head->t_addr; // Cache clear/invalidate dynarec/int. Fixes startup of Casper/X-Files and possibly others. +#ifdef PSXREC psxCpu->Clear(addr, size / 4); +#endif psxRegs.ICache_valid = FALSE; while (size) { @@ -540,6 +546,95 @@ int Load(const char *ExePath) { return retval; } +static int LoadBin( unsigned long addr, char* filename ) { + int result = -1; + + FILE *f; + long len; + unsigned long mem = addr & 0x001fffff; + + // Load binery files + f = fopen(filename, "rb"); + if (f != NULL) { + fseek(f,0,SEEK_END); + len = ftell(f); + fseek(f,0,SEEK_SET); + if( len + mem < 0x00200000 ) { + if( psxM ) { + int readsize = fread(psxM + mem, len, 1, f); + if( readsize == len ) + result = 0; + } + } + fclose(f); + } + + if( result == 0 ) + SysPrintf(_("ng Load Bin file: [0x%08x] : %s\n"), addr, filename ); + else + SysPrintf(_("ok Load Bin file: [0x%08x] : %s\n"), addr, filename ); + + return result; +} + +int LoadLdrFile(const char *LdrPath ) { + FILE * tmpFile; + int retval = 0; //-1 is error, 0 is success + + tmpFile = fopen(LdrPath, "rt"); + if (tmpFile == NULL) { + SysPrintf(_("Error opening file: %s.\n"), LdrPath); + retval = -1; + } else { + int index = 0; + char sztext[16][256]; + + memset( sztext, 0x00, sizeof(sztext) ); + + while(index <= 15 && fgets( &sztext[index][0], 254, tmpFile )) { + + char szaddr[256]; + char szpath[256]; + char* psrc = &sztext[index][0]; + char* paddr; + char* ppath; + int len; + unsigned long addr = 0L; + + memset( szaddr, 0x00, sizeof(szaddr)); + memset( szpath, 0x00, sizeof(szpath)); + + len = strlen( psrc ); + if( len > 0 ) { + trim( psrc ); + trim_key( psrc, '\t' ); + split( psrc, '\t', szaddr ); + + paddr = szaddr; + ppath = psrc + strlen(paddr); + + //getting address + trim( paddr ); + trim_key( paddr, '\t' ); + addr = strtoul(szaddr, NULL, 16); + if( addr != 0 ) { + //getting bin filepath in ldrfile + trim( ppath ); + trim_key( ppath, '\t' ); + memmove( szpath, ppath, sizeof(szpath)); + + //Load binary to main memory + LoadBin( addr, szpath ); + } + } + + index++; + } + } + + return retval; +} + // STATES #define PCSXR_HEADER_SZ (10) #define SZ_GPUPIC (128 * 96 * 3) @@ -870,11 +965,15 @@ int RecvPcsxInfo() { // remove the leading and trailing spaces in a string void trim(char *str) { + trim_key( str, ' ' ); +} + +void trim_key(char *str, char key ) { int pos = 0; char *dest = str; // skip leading blanks - while (str[pos] <= ' ' && str[pos] > 0) + while (str[pos] <= key && str[pos] > 0) pos++; while (str[pos]) { @@ -885,10 +984,27 @@ void trim(char *str) { *(dest--) = '\0'; // store the null // remove trailing blanks - while (dest >= str && *dest <= ' ' && *dest > 0) + while (dest >= str && *dest <= key && *dest > 0) *(dest--) = '\0'; } +// split by the keys codes in strings +void split( char* str, char key, char* pout ) +{ + char* psrc = str; + char* pdst = pout; + int len = strlen(str); + int i; + for( i = 0; i < len; i++ ) { + if( psrc[i] == '\0' || psrc[i] == key ) { + *pdst = '\0'; + break; + } else { + *pdst++ = psrc[i]; + } + } +} + // lookup table for crc calculation static unsigned short crctab[256] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, 0x8108, diff --git a/libpcsxcore/misc.h b/libpcsxcore/misc.h index 860c1d29..2e44364f 100755 --- a/libpcsxcore/misc.h +++ b/libpcsxcore/misc.h @@ -60,6 +60,7 @@ int LoadCdrom(); int LoadCdromFile(const char *filename, EXE_HEADER *head); int CheckCdrom(); int Load(const char *ExePath); +int LoadLdrFile(const char *LdrPath); int SaveState(const char *file); int SaveStateMem(const u32 id); diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index c4fdae68..a1175e48 100755 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -25,7 +25,9 @@ #include "cdriso.h" static char IsoFile[MAXPATHLEN] = ""; +static char ExeFile[MAXPATHLEN] = ""; static char AppPath[MAXPATHLEN] = ""; //Application path(== pcsxr.exe directory) +static char LdrFile[MAXPATHLEN] = ""; //bin-load file static s64 cdOpenCaseTime = 0; GPUupdateLace GPU_updateLace; @@ -846,6 +848,14 @@ void SetIsoFile(const char *filename) { strncpy(IsoFile, filename, MAXPATHLEN); } +void SetExeFile(const char *filename) { + if (filename == NULL) { + ExeFile[0] = '\0'; + return; + } + strncpy(ExeFile, filename, MAXPATHLEN); +} + // Set pcsxr.exe directory. This is not contain filename(and ext)). void SetAppPath(const char *apppath ) { if (apppath == NULL) { @@ -855,14 +865,30 @@ void SetAppPath(const char *apppath ) { strncpy(AppPath, apppath, MAXPATHLEN); } +void SetLdrFile(const char *ldrfile ) { + if (ldrfile == NULL) { + LdrFile[0] = '\0'; + return; + } + strncpy(LdrFile, ldrfile, MAXPATHLEN); +} + const char *GetIsoFile(void) { return IsoFile; } +const char *GetExeFile(void) { + return ExeFile; +} + const char *GetAppPath(void) { return AppPath; } +const char *GetLdrFile(void) { + return LdrFile; +} + boolean UsingIso(void) { return (IsoFile[0] != '\0' || Config.Cdr[0] == '\0'); } diff --git a/libpcsxcore/plugins.h b/libpcsxcore/plugins.h index 982d0978..a9756b7e 100755 --- a/libpcsxcore/plugins.h +++ b/libpcsxcore/plugins.h @@ -422,9 +422,13 @@ extern SIO1registerCallback SIO1_registerCallback; void CALLBACK clearDynarec(void); void SetIsoFile(const char *filename); +void SetExeFile(const char *filename); void SetAppPath(const char *filename); +void SetLdrFile(const char *ldrfile ); const char *GetIsoFile(void); +const char *GetExeFile(void); const char *GetAppPath(void); +const char *GetLdrFile(void); boolean UsingIso(void); void SetCdOpenCaseTime(s64 time); diff --git a/libpcsxcore/psxcommon.c b/libpcsxcore/psxcommon.c index ff846a11..b77d17a6 100755 --- a/libpcsxcore/psxcommon.c +++ b/libpcsxcore/psxcommon.c @@ -80,8 +80,7 @@ void EmuUpdate() { } } -void EmuSetPGXPMode(u32 pgxpMode) -{ +void EmuSetPGXPMode(u32 pgxpMode) { psxSetPGXPMode(pgxpMode); } diff --git a/libpcsxcore/psxcommon.h b/libpcsxcore/psxcommon.h index f89044a2..f2fba819 100755 --- a/libpcsxcore/psxcommon.h +++ b/libpcsxcore/psxcommon.h @@ -71,7 +71,7 @@ typedef uint8_t boolean; #include "system.h" #include "debug.h" -#if defined (__LINUX__) || defined (__MACOSX__) +#if defined (__linux__) || defined (__MACOSX__) #define strnicmp strncasecmp #endif #define __inline inline diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c index 01fc7c2b..a6d7e10e 100755 --- a/libpcsxcore/psxcounters.c +++ b/libpcsxcore/psxcounters.c @@ -68,11 +68,13 @@ static const u32 FrameRate[] = { 60, 50 }; static const u32 VBlankStart[] = { 243, 256 }; static const u32 SpuUpdInterval[] = { 23, 22 }; -#if defined(PSXHW_LOG) && defined(PSXMEM_LOG) && defined(PSXDMA_LOG) // automatic guess if we want trace level logging +#if defined(PSXHW_LOG) +#if defined(PSXMEM_LOG) && defined(PSXDMA_LOG) // automatic guess if we want trace level logging static const s32 VerboseLevel = 4; #else static const s32 VerboseLevel = 0; #endif +#endif static const u16 JITTER_FLAGS = (Rc2OneEighthClock|RcIrqRegenerate|RcCountToTarget); /******************************************************************************/ diff --git a/libpcsxcore/psxdma.c b/libpcsxcore/psxdma.c index 4f5290bd..7443577a 100755 --- a/libpcsxcore/psxdma.c +++ b/libpcsxcore/psxdma.c @@ -68,7 +68,9 @@ void psxDma4(u32 madr, u32 bcr, u32 chcr) { // SPU } size = (bcr >> 16) * (bcr & 0xffff) * 2; SPU_readDMAMem(ptr, size); +#ifdef PSXREC psxCpu->Clear(madr, size); +#endif #if 1 SPUDMA_INT((bcr >> 16) * (bcr & 0xffff) / 2); diff --git a/libpcsxcore/psxhw.c b/libpcsxcore/psxhw.c index 91aa4b32..58a2ba65 100755 --- a/libpcsxcore/psxhw.c +++ b/libpcsxcore/psxhw.c @@ -650,11 +650,11 @@ void psxHwWrite32(u32 add, u32 value) { PSXHW_LOG("DMA2 CHCR 32bit write %x\n", value); #endif /* A hack that makes Vampire Hunter D title screen visible, - /* but makes Tomb Raider II water effect to stay opaque - /* Root cause for this problem is that when DMA2 is issued - /* it is incompletele and still beign built by the game. - /* Maybe it is ready when some signal comes in or within given delay? - */ + * but makes Tomb Raider II water effect to stay opaque + * Root cause for this problem is that when DMA2 is issued + * it is incompletele and still beign built by the game. + * Maybe it is ready when some signal comes in or within given delay? + */ if (dmaGpuListHackEn && value == 0x00000401 && HW_DMA2_BCR == 0x0) { psxDma2(SWAPu32(HW_DMA2_MADR), SWAPu32(HW_DMA2_BCR), SWAPu32(value)); return; diff --git a/libpcsxcore/psxinterpreter.c b/libpcsxcore/psxinterpreter.c index 6aa5ac15..a4f38e6d 100755 --- a/libpcsxcore/psxinterpreter.c +++ b/libpcsxcore/psxinterpreter.c @@ -559,14 +559,20 @@ void psxSLTU() { if (!_Rd_) return; _rRd_ = _u32(_rRs_) < _u32(_rRt_); } // Rd * Format: OP rs, rt * *********************************************************/ void psxDIV() { - if (_i32(_rRt_) != 0) { + if (!_i32(_rRt_)) { + if (_i32(_rRs_) & 0x80000000) { + _i32(_rLo_) = 1; + } else { + _i32(_rLo_) = 0xFFFFFFFF; + _i32(_rHi_) = _i32(_rRs_); + } + } else if (_i32(_rRs_) == 0x80000000 && _i32(_rRt_) == 0xFFFFFFFF) { + _i32(_rLo_) = 0x80000000; + _i32(_rHi_) = 0; + } else { _i32(_rLo_) = _i32(_rRs_) / _i32(_rRt_); _i32(_rHi_) = _i32(_rRs_) % _i32(_rRt_); } - else { - _i32(_rLo_) = 0xffffffff; - _i32(_rHi_) = _i32(_rRs_); - } } void psxDIVU() { @@ -1115,7 +1121,6 @@ void (*psxCP2BSC[32])() = { }; #include "psxinterpreter_pgxp.h" - // Trace all functions using PGXP static void(*pgxpPsxBSC[64])() = { psxSPECIAL, psxREGIMM, psxJ , psxJAL , psxBEQ , psxBNE , psxBLEZ, psxBGTZ, diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c index ae2600ab..f8013886 100755 --- a/libpcsxcore/psxmem.c +++ b/libpcsxcore/psxmem.c @@ -114,7 +114,6 @@ void psxMemReset() { // Load BIOS if (strcmp(Config.Bios, "HLE") != 0) { - //AppPath's priority is high. const char* apppath = GetAppPath(); if( strlen(apppath) > 0 ) @@ -150,8 +149,7 @@ u8 psxMemRead8(u32 mem) { char *p; u32 t; - if (!Config.MemHack) - { + if (!Config.MemHack) { psxRegs.cycle += 0; } @@ -180,8 +178,7 @@ u16 psxMemRead16(u32 mem) { char *p; u32 t; - if (!Config.MemHack) - { + if (!Config.MemHack) { psxRegs.cycle += 1; } @@ -210,8 +207,7 @@ u32 psxMemRead32(u32 mem) { char *p; u32 t; - if (!Config.MemHack) - { + if (!Config.MemHack) { psxRegs.cycle += 1; } @@ -240,8 +236,7 @@ void psxMemWrite8(u32 mem, u8 value) { char *p; u32 t; - if (!Config.MemHack) - { + if (!Config.MemHack) { psxRegs.cycle += 1; } @@ -272,8 +267,7 @@ void psxMemWrite16(u32 mem, u16 value) { char *p; u32 t; - if (!Config.MemHack) - { + if (!Config.MemHack) { psxRegs.cycle += 1; } @@ -304,8 +298,7 @@ void psxMemWrite32(u32 mem, u32 value) { char *p; u32 t; - if (!Config.MemHack) - { + if (!Config.MemHack) { psxRegs.cycle += 1; } diff --git a/libpcsxcore/psxmem.h b/libpcsxcore/psxmem.h index 08d16197..a1e32b4f 100755 --- a/libpcsxcore/psxmem.h +++ b/libpcsxcore/psxmem.h @@ -31,8 +31,8 @@ extern "C" { #define _SWAP16(b) ((((unsigned char *)&(b))[0] & 0xff) | (((unsigned char *)&(b))[1] & 0xff) << 8) #define _SWAP32(b) ((((unsigned char *)&(b))[0] & 0xff) | ((((unsigned char *)&(b))[1] & 0xff) << 8) | ((((unsigned char *)&(b))[2] & 0xff) << 16) | (((unsigned char *)&(b))[3] << 24)) -#define SWAP16(v) ((((v) & 0xff00) >> 8) +(((v) & 0xff) << 8)) -#define SWAP32(v) ((((v) & 0xff000000ul) >> 24) + (((v) & 0xff0000ul) >> 8) + (((v) & 0xff00ul)<<8) +(((v) & 0xfful) << 24)) +#define SWAP16(v) ((((v) & 0xff00) >> 8) | (((v) & 0xff) << 8)) +#define SWAP32(v) ((((v) & 0xff000000ul) >> 24) | (((v) & 0xff0000ul) >> 8) | (((v) & 0xff00ul)<<8) | (((v) & 0xfful) << 24)) #define SWAPu32(v) SWAP32((u32)(v)) #define SWAPs32(v) SWAP32((s32)(v)) diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c index 61adc5c0..fd0a2414 100755 --- a/libpcsxcore/r3000a.c +++ b/libpcsxcore/r3000a.c @@ -46,6 +46,7 @@ int psxInit() { if (psxMemInit() == -1) return -1; PGXP_Init(); + PauseDebugger(); return psxCpu->Init(); } diff --git a/plugins/bladesio1/Makefile.am b/plugins/bladesio1/Makefile.am index badd57e5..840713b4 100644 --- a/plugins/bladesio1/Makefile.am +++ b/plugins/bladesio1/Makefile.am @@ -40,4 +40,3 @@ GtkResources.h: bladesio1.gresource.xml $(bladesio1_gresource) EXTRA_DIST = $(glade_DATA) CLEANFILES = bladesio1.gresource.xml GtkResources.c GtkResources.h - diff --git a/plugins/bladesio1/cfg.c b/plugins/bladesio1/cfg.c index f830d7b3..df120b1a 100755 --- a/plugins/bladesio1/cfg.c +++ b/plugins/bladesio1/cfg.c @@ -22,7 +22,7 @@ #include #include -#include "psxcommon.h" +#include "typedefs.h" #include "psemu_plugin_defs.h" #include "sio1.h" diff --git a/plugins/bladesio1/connection.c b/plugins/bladesio1/connection.c index 1d4a075d..c922f2f2 100755 --- a/plugins/bladesio1/connection.c +++ b/plugins/bladesio1/connection.c @@ -61,7 +61,11 @@ int connectionOpen() { serversock = socket(AF_INET, SOCK_STREAM, 0); if(serversock == -1) { +#if defined _WINDOWS + fprintf(stderr, "[SIO1] ERROR: server socket(): %d\n", WSAGetLastError()); +#else fprintf(stderr, "[SIO1] ERROR: server socket()\n"); +#endif return -1; } @@ -74,12 +78,20 @@ int connectionOpen() { address.sin_port = settings.port; if(bind(serversock,(struct sockaddr*)&address,sizeof(address)) == -1) { +#if defined _WINDOWS + fprintf(stderr, "[SIO1] ERROR: server bind(): %d\n", WSAGetLastError()); +#else fprintf(stderr, "[SIO1] ERROR: server bind()\n"); +#endif return -1; } if(listen(serversock, 1) != 0) { +#if defined _WINDOWS + fprintf(stderr, "[SIO1] ERROR: server listen(): %d\n", WSAGetLastError()); +#else fprintf(stderr, "[SIO1] ERROR: server listen()\n"); +#endif return -1; } @@ -99,14 +111,22 @@ int connectionOpen() { clientsock = socket(AF_INET, SOCK_STREAM, 0); if(clientsock == -1) { +#if defined _WINDOWS + fprintf(stderr, "[SIO1] ERROR: client socket(): %d\n", WSAGetLastError()); +#else fprintf(stderr, "[SIO1] ERROR: client socket()\n"); +#endif return -1; } setsockopt(clientsock, IPPROTO_TCP, TCP_NODELAY, (const char*)&one, sizeof(one)); if(connect(clientsock,(struct sockaddr*)&address,sizeof(address)) != 0) { - fprintf(stderr, "[SIO1] ERROR: client connect(%s)\n", settings.ip); +#if defined _WINDOWS + fprintf(stderr, "[SIO1] ERROR: client connect(%s): %d\n", settings.ip, WSAGetLastError()); +#else + fprintf(stderr, "[SIO1] ERROR: client connect(%s)", settings.ip); +#endif return -1; } } diff --git a/plugins/bladesio1/gui.c b/plugins/bladesio1/gui.c index 37ffb83f..9a265899 100644 --- a/plugins/bladesio1/gui.c +++ b/plugins/bladesio1/gui.c @@ -32,7 +32,7 @@ #include #include -#include "psxcommon.h" +//#include "psxcommon.h" #include "psemu_plugin_defs.h" #include "cfg.c" diff --git a/plugins/bladesio1/sio1.c b/plugins/bladesio1/sio1.c index 453d7fec..feab1bb6 100755 --- a/plugins/bladesio1/sio1.c +++ b/plugins/bladesio1/sio1.c @@ -30,7 +30,10 @@ void AboutDlgProc(); void ConfDlgProc(); #else +#include #include +#include +#include #endif #include "typedefs.h" diff --git a/plugins/dfcdrom/Makefile.am b/plugins/dfcdrom/Makefile.am index 1f87998b..c942fb40 100644 --- a/plugins/dfcdrom/Makefile.am +++ b/plugins/dfcdrom/Makefile.am @@ -55,4 +55,3 @@ GtkResources.h: dfcdrom.gresource.xml $(dfcdrom_gresource) EXTRA_DIST = $(glade_DATA) CLEANFILES = dfcdrom.gresource.xml GtkResources.c GtkResources.h - diff --git a/plugins/dfcdrom/cdr.c b/plugins/dfcdrom/cdr.c index ecd0d9a4..97a2735d 100755 --- a/plugins/dfcdrom/cdr.c +++ b/plugins/dfcdrom/cdr.c @@ -20,6 +20,10 @@ */ #include "cdr.h" +#if defined(__linux__) +#include +#include +#endif #ifndef USE_NULL static char *LibName = N_("CD-ROM Drive Reader"); diff --git a/plugins/dfsound/Makefile.am b/plugins/dfsound/Makefile.am index 9f8130a1..18a49ac7 100755 --- a/plugins/dfsound/Makefile.am +++ b/plugins/dfsound/Makefile.am @@ -76,4 +76,3 @@ GtkResources.h: dfsound.gresource.xml $(dfsound_gresource) EXTRA_DIST = $(glade_DATA) CLEANFILES = dfsound.gresource.xml GtkResources.c GtkResources.h - diff --git a/plugins/dfsound/cfg.c b/plugins/dfsound/cfg.c index 0bb2172c..0e1f63fa 100755 --- a/plugins/dfsound/cfg.c +++ b/plugins/dfsound/cfg.c @@ -26,6 +26,10 @@ //////////////////////////////////////////////////////////////////////// #include +#if defined(__linux__) +#include +#include +#endif //////////////////////////////////////////////////////////////////////// // START EXTERNAL CFG TOOL diff --git a/plugins/dfxvideo/Makefile.am b/plugins/dfxvideo/Makefile.am index 520749b2..b1dc9c3d 100755 --- a/plugins/dfxvideo/Makefile.am +++ b/plugins/dfxvideo/Makefile.am @@ -54,4 +54,3 @@ GtkResources.h: dfxvideo.gresource.xml $(dfxvideo_gresource) EXTRA_DIST = $(glade_DATA) CLEANFILES = dfxvideo.gresource.xml GtkResources.c GtkResources.h - diff --git a/plugins/dfxvideo/cfg.c b/plugins/dfxvideo/cfg.c index 1bf879b8..67f79a8a 100755 --- a/plugins/dfxvideo/cfg.c +++ b/plugins/dfxvideo/cfg.c @@ -20,6 +20,10 @@ #include #include #include +#if defined(__linux__) +#include +#include +#endif #undef FALSE #undef TRUE diff --git a/plugins/peopsxgl/Makefile.am b/plugins/peopsxgl/Makefile.am index 576e140d..e9d7de4e 100755 --- a/plugins/peopsxgl/Makefile.am +++ b/plugins/peopsxgl/Makefile.am @@ -54,4 +54,3 @@ GtkResources.h: peopsxgl.gresource.xml $(peopsxgl_gresource) EXTRA_DIST = $(glade_DATA) CLEANFILES = peopsxgl.gresource.xml GtkResources.c GtkResources.h - diff --git a/plugins/peopsxgl/draw.c b/plugins/peopsxgl/draw.c index c7a778a8..c60d9379 100755 --- a/plugins/peopsxgl/draw.c +++ b/plugins/peopsxgl/draw.c @@ -1020,7 +1020,6 @@ BOOL offsetline(unsigned int* addr) vertex[1].y=(short)((float)y1+px); vertex[2].y=(short)((float)y1+py); - if(vertex[0].x==vertex[3].x && // ortho rect? done vertex[1].x==vertex[2].x && vertex[0].y==vertex[1].y && diff --git a/plugins/peopsxgl/gpu.c b/plugins/peopsxgl/gpu.c index c19dd2b6..12c453b5 100755 --- a/plugins/peopsxgl/gpu.c +++ b/plugins/peopsxgl/gpu.c @@ -35,6 +35,10 @@ static int iOldMode=0; #endif +#if defined(__linux__) +#include +#endif + #define _IN_GPU #include "externals.h" @@ -1088,13 +1092,7 @@ long GPUopen(unsigned long * disp,char * CapText,char * CfgFile) GLinitialize(); // init opengl if(disp) - { -#if defined (_MACGL) - *disp = display; -#else - *disp=(unsigned long *)display; // return display ID to main emu -#endif - } + *disp = (unsigned long)display; // return display ID to main emu if(display) return 0; return -1; @@ -1317,7 +1315,6 @@ void SetScanLines(void) //PGXP_SetMatrix(0, PSXDisplay.DisplayMode.x, PSXDisplay.DisplayMode.y, 0, -1, 1); - if(bKeepRatio) glViewport(rRatioRect.left, iResY-(rRatioRect.top+rRatioRect.bottom), @@ -1895,7 +1892,6 @@ void updateDisplayIfChanged(void) // PGXP_SetMatrix(0, PSXDisplay.DisplayModeNew.x, PSXDisplay.DisplayModeNew.y, 0, -1, 1); - if(bKeepRatio) SetAspectRatio(); } diff --git a/plugins/peopsxgl/prim.c b/plugins/peopsxgl/prim.c index 1af588f0..b03d87d7 100755 --- a/plugins/peopsxgl/prim.c +++ b/plugins/peopsxgl/prim.c @@ -155,7 +155,6 @@ static __inline void PRIMdrawTexturedQuad(OGLVertex* vertex1, OGLVertex* vertex2 if(PGXP_DrawDebugTriQuad(vertex1, vertex2, vertex4, vertex3, COLOUR_NONE, 1)) return; } - glBegin(GL_TRIANGLE_STRIP); glTexCoord2fv(&vertex1->sow); @@ -2553,7 +2552,6 @@ void DrawMultiBlur(void) fx=(float)PSXDisplay.DisplayMode.x/(float)(iResX); fy=(float)PSXDisplay.DisplayMode.y/(float)(iResY); - for (unsigned int i = 0; i < 4; ++i) { vertex[i].PGXP_flag = 999; diff --git a/plugins/peopsxgl/stdafx.h b/plugins/peopsxgl/stdafx.h index b069ba25..ab40002e 100755 --- a/plugins/peopsxgl/stdafx.h +++ b/plugins/peopsxgl/stdafx.h @@ -62,6 +62,8 @@ #include #include #include +#include +#include #include #include #include