summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-06-08 09:27:25 +0000
committerSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-06-08 09:27:25 +0000
commit5f868fa161d5827e45a060a0b17b44a997625315 (patch)
tree1694ae3dfcb0189abdf098edbf6dae0bf2a18e4d /libpcsxcore
parentc7eb23ccf1813fb4ca47c309c40baff308151237 (diff)
downloadpcsxr-5f868fa161d5827e45a060a0b17b44a997625315.tar.gz
Rebranding.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@67621 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/Makefile.am3
-rw-r--r--libpcsxcore/debug.c8
-rw-r--r--libpcsxcore/misc.c8
-rw-r--r--libpcsxcore/r3000a.c380
-rw-r--r--libpcsxcore/socket.c2
5 files changed, 202 insertions, 199 deletions
diff --git a/libpcsxcore/Makefile.am b/libpcsxcore/Makefile.am
index 6c84e354..1ae5389e 100644
--- a/libpcsxcore/Makefile.am
+++ b/libpcsxcore/Makefile.am
@@ -10,6 +10,7 @@ libpcsxcore_a_SOURCES = \
$(top_builddir)/libpcsxcore/psxdma.c \
$(top_builddir)/libpcsxcore/disr3000a.c \
$(top_builddir)/libpcsxcore/gpu.c \
+ $(top_builddir)/libpcsxcore/gpu.h \
$(top_builddir)/libpcsxcore/spu.c \
$(top_builddir)/libpcsxcore/sio.c \
$(top_builddir)/libpcsxcore/psxhw.c \
@@ -68,8 +69,10 @@ libpcsxcore_a_SOURCES += \
else
if ARCH_X86
libpcsxcore_a_SOURCES += \
+ $(top_builddir)/libpcsxcore/ix86/iGte.h \
$(top_builddir)/libpcsxcore/ix86/iR3000A.c \
$(top_builddir)/libpcsxcore/ix86/ix86.c \
+ $(top_builddir)/libpcsxcore/ix86/ix86.h \
$(top_builddir)/libpcsxcore/
endif
endif
diff --git a/libpcsxcore/debug.c b/libpcsxcore/debug.c
index 08abd41f..bcf0ddb4 100644
--- a/libpcsxcore/debug.c
+++ b/libpcsxcore/debug.c
@@ -21,7 +21,7 @@
#include "socket.h"
/*
-PCSX Debug console protocol description, version 1.0
+PCSXR Debug console protocol description, version 1.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Commands number are formatted using %03X (yes)
@@ -37,7 +37,7 @@ Basic commands (1xx):
100 <message>
Sends a dumb message. Will be replied with a 200 reply, followed by the message.
101
- Gets PCSX version.
+ Gets PCSXR version.
102
Gets protocol version.
103
@@ -143,14 +143,14 @@ Spontaneous messages (0xx):
010 / 011 / 012 / 013 / 014 / 015 / 016
Execution hit mapping flow automatic breakpoint.
030 <number>@<PC>
- Execution hit breakpoint, PCSX is paused. Displays PC's value.
+ Execution hit breakpoint, PCSXR is paused. Displays PC's value.
Basic commands acknowledge (2xx):
--------------------------------
200 <message>
Sends a dumb message.
201 <message>
- Returns PCSX version.
+ Returns PCSXR version.
202 <message>
Returns protocol version.
203 <status>
diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c
index 0269a8d4..e7f4a2ca 100644
--- a/libpcsxcore/misc.c
+++ b/libpcsxcore/misc.c
@@ -494,7 +494,7 @@ int Load(const char *ExePath) {
// STATES
-static const char PcsxHeader[32] = "STv4 PCSX v" PACKAGE_VERSION;
+static const char PcsxrHeader[32] = "STv4 PCSXR v" PACKAGE_VERSION;
// Savestate Versioning!
// If you make changes to the savestate version, please increment the value below.
@@ -510,7 +510,7 @@ int SaveState(const char *file) {
f = gzopen(file, "wb");
if (f == NULL) return -1;
- gzwrite(f, (void *)PcsxHeader, 32);
+ gzwrite(f, (void *)PcsxrHeader, 32);
gzwrite(f, (void *)&SaveVersion, sizeof(u32));
gzwrite(f, (void *)&Config.HLE, sizeof(boolean));
@@ -572,7 +572,7 @@ int LoadState(const char *file) {
gzread(f, &version, sizeof(u32));
gzread(f, &hle, sizeof(boolean));
- if (strncmp("STv4 PCSX", header, 9) != 0 || version != SaveVersion || hle != Config.HLE) {
+ if (strncmp("STv4 PCSXR", header, 10) != 0 || version != SaveVersion || hle != Config.HLE) {
gzclose(f);
return -1;
}
@@ -627,7 +627,7 @@ int CheckState(const char *file) {
gzclose(f);
- if (strncmp("STv4 PCSX", header, 9) != 0 || version != SaveVersion || hle != Config.HLE)
+ if (strncmp("STv4 PCSXR", header, 10) != 0 || version != SaveVersion || hle != Config.HLE)
return -1;
return 0;
diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c
index d5616cbe..a44bc369 100644
--- a/libpcsxcore/r3000a.c
+++ b/libpcsxcore/r3000a.c
@@ -1,111 +1,111 @@
-/***************************************************************************
- * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA. *
- ***************************************************************************/
-
-/*
-* R3000A CPU functions.
-*/
-
-#include "r3000a.h"
-#include "cdrom.h"
-#include "mdec.h"
-#include "gpu.h"
+/***************************************************************************
+ * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA. *
+ ***************************************************************************/
+
+/*
+* R3000A CPU functions.
+*/
+
+#include "r3000a.h"
+#include "cdrom.h"
+#include "mdec.h"
+#include "gpu.h"
#include "gte.h"
-R3000Acpu *psxCpu = NULL;
-psxRegisters psxRegs;
-
-int psxInit() {
- SysPrintf(_("Running PCSX Version %s (%s).\n"), PACKAGE_VERSION, __DATE__);
-
-#ifdef PSXREC
- if (Config.Cpu == CPU_INTERPRETER) {
- psxCpu = &psxInt;
- } else psxCpu = &psxRec;
-#else
- psxCpu = &psxInt;
-#endif
-
- Log = 0;
-
- if (psxMemInit() == -1) return -1;
-
- return psxCpu->Init();
-}
-
-void psxReset() {
- psxCpu->Reset();
-
- psxMemReset();
-
- memset(&psxRegs, 0, sizeof(psxRegs));
-
- psxRegs.pc = 0xbfc00000; // Start in bootstrap
-
- psxRegs.CP0.r[12] = 0x10900000; // COP0 enabled | BEV = 1 | TS = 1
- psxRegs.CP0.r[15] = 0x00000002; // PRevID = Revision ID, same as R3000A
-
- psxHwReset();
- psxBiosInit();
-
- if (!Config.HLE)
- psxExecuteBios();
-
-#ifdef EMU_LOG
- EMU_LOG("*BIOS END*\n");
-#endif
- Log = 0;
-}
-
-void psxShutdown() {
- psxMemShutdown();
- psxBiosShutdown();
-
- psxCpu->Shutdown();
-}
-
-void psxException(u32 code, u32 bd) {
- // Set the Cause
- psxRegs.CP0.n.Cause = code;
-
- // Set the EPC & PC
- if (bd) {
-#ifdef PSXCPU_LOG
- PSXCPU_LOG("bd set!!!\n");
-#endif
- SysPrintf("bd set!!!\n");
- psxRegs.CP0.n.Cause |= 0x80000000;
- psxRegs.CP0.n.EPC = (psxRegs.pc - 4);
- } else
- psxRegs.CP0.n.EPC = (psxRegs.pc);
-
- if (psxRegs.CP0.n.Status & 0x400000)
- psxRegs.pc = 0xbfc00180;
- else
- psxRegs.pc = 0x80000080;
-
- // Set the Status
- psxRegs.CP0.n.Status = (psxRegs.CP0.n.Status &~0x3f) |
- ((psxRegs.CP0.n.Status & 0xf) << 2);
-
- if (Config.HLE) psxBiosException();
-}
-
+R3000Acpu *psxCpu = NULL;
+psxRegisters psxRegs;
+
+int psxInit() {
+ SysPrintf(_("Running PCSXR Version %s (%s).\n"), PACKAGE_VERSION, __DATE__);
+
+#ifdef PSXREC
+ if (Config.Cpu == CPU_INTERPRETER) {
+ psxCpu = &psxInt;
+ } else psxCpu = &psxRec;
+#else
+ psxCpu = &psxInt;
+#endif
+
+ Log = 0;
+
+ if (psxMemInit() == -1) return -1;
+
+ return psxCpu->Init();
+}
+
+void psxReset() {
+ psxCpu->Reset();
+
+ psxMemReset();
+
+ memset(&psxRegs, 0, sizeof(psxRegs));
+
+ psxRegs.pc = 0xbfc00000; // Start in bootstrap
+
+ psxRegs.CP0.r[12] = 0x10900000; // COP0 enabled | BEV = 1 | TS = 1
+ psxRegs.CP0.r[15] = 0x00000002; // PRevID = Revision ID, same as R3000A
+
+ psxHwReset();
+ psxBiosInit();
+
+ if (!Config.HLE)
+ psxExecuteBios();
+
+#ifdef EMU_LOG
+ EMU_LOG("*BIOS END*\n");
+#endif
+ Log = 0;
+}
+
+void psxShutdown() {
+ psxMemShutdown();
+ psxBiosShutdown();
+
+ psxCpu->Shutdown();
+}
+
+void psxException(u32 code, u32 bd) {
+ // Set the Cause
+ psxRegs.CP0.n.Cause = code;
+
+ // Set the EPC & PC
+ if (bd) {
+#ifdef PSXCPU_LOG
+ PSXCPU_LOG("bd set!!!\n");
+#endif
+ SysPrintf("bd set!!!\n");
+ psxRegs.CP0.n.Cause |= 0x80000000;
+ psxRegs.CP0.n.EPC = (psxRegs.pc - 4);
+ } else
+ psxRegs.CP0.n.EPC = (psxRegs.pc);
+
+ if (psxRegs.CP0.n.Status & 0x400000)
+ psxRegs.pc = 0xbfc00180;
+ else
+ psxRegs.pc = 0x80000080;
+
+ // Set the Status
+ psxRegs.CP0.n.Status = (psxRegs.CP0.n.Status &~0x3f) |
+ ((psxRegs.CP0.n.Status & 0xf) << 2);
+
+ if (Config.HLE) psxBiosException();
+}
+
void psxBranchTest() {
// GameShark Sampler: Give VSync pin some delay before exception eats it
if (psxHu32(0x1070) & psxHu32(0x1074)) {
@@ -146,53 +146,53 @@ void psxBranchTest() {
}
#endif
- if ((psxRegs.cycle - psxNextsCounter) >= psxNextCounter)
- psxRcntUpdate();
-
+ if ((psxRegs.cycle - psxNextsCounter) >= psxNextCounter)
+ psxRcntUpdate();
+
if (psxRegs.interrupt) {
- if ((psxRegs.interrupt & (1 << PSXINT_SIO)) && !Config.Sio) { // sio
- if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_SIO].sCycle) >= psxRegs.intCycle[PSXINT_SIO].cycle) {
- psxRegs.interrupt &= ~(1 << PSXINT_SIO);
- sioInterrupt();
- }
- }
- if (psxRegs.interrupt & (1 << PSXINT_CDR)) { // cdr
- if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_CDR].sCycle) >= psxRegs.intCycle[PSXINT_CDR].cycle) {
- psxRegs.interrupt &= ~(1 << PSXINT_CDR);
- cdrInterrupt();
- }
- }
- if (psxRegs.interrupt & (1 << PSXINT_CDREAD)) { // cdr read
- if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_CDREAD].sCycle) >= psxRegs.intCycle[PSXINT_CDREAD].cycle) {
- psxRegs.interrupt &= ~(1 << PSXINT_CDREAD);
- cdrReadInterrupt();
- }
- }
- if (psxRegs.interrupt & (1 << PSXINT_GPUDMA)) { // gpu dma
- if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_GPUDMA].sCycle) >= psxRegs.intCycle[PSXINT_GPUDMA].cycle) {
- psxRegs.interrupt &= ~(1 << PSXINT_GPUDMA);
- gpuInterrupt();
- }
- }
- if (psxRegs.interrupt & (1 << PSXINT_MDECOUTDMA)) { // mdec out dma
- if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_MDECOUTDMA].sCycle) >= psxRegs.intCycle[PSXINT_MDECOUTDMA].cycle) {
- psxRegs.interrupt &= ~(1 << PSXINT_MDECOUTDMA);
- mdec1Interrupt();
- }
- }
- if (psxRegs.interrupt & (1 << PSXINT_SPUDMA)) { // spu dma
- if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_SPUDMA].sCycle) >= psxRegs.intCycle[PSXINT_SPUDMA].cycle) {
- psxRegs.interrupt &= ~(1 << PSXINT_SPUDMA);
- spuInterrupt();
- }
- }
- if (psxRegs.interrupt & (1 << PSXINT_GPUBUSY)) { // gpu busy
- if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_GPUBUSY].sCycle) >= psxRegs.intCycle[PSXINT_GPUBUSY].cycle) {
- psxRegs.interrupt &= ~(1 << PSXINT_GPUBUSY);
- GPU_idle();
- }
+ if ((psxRegs.interrupt & (1 << PSXINT_SIO)) && !Config.Sio) { // sio
+ if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_SIO].sCycle) >= psxRegs.intCycle[PSXINT_SIO].cycle) {
+ psxRegs.interrupt &= ~(1 << PSXINT_SIO);
+ sioInterrupt();
+ }
+ }
+ if (psxRegs.interrupt & (1 << PSXINT_CDR)) { // cdr
+ if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_CDR].sCycle) >= psxRegs.intCycle[PSXINT_CDR].cycle) {
+ psxRegs.interrupt &= ~(1 << PSXINT_CDR);
+ cdrInterrupt();
+ }
+ }
+ if (psxRegs.interrupt & (1 << PSXINT_CDREAD)) { // cdr read
+ if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_CDREAD].sCycle) >= psxRegs.intCycle[PSXINT_CDREAD].cycle) {
+ psxRegs.interrupt &= ~(1 << PSXINT_CDREAD);
+ cdrReadInterrupt();
+ }
+ }
+ if (psxRegs.interrupt & (1 << PSXINT_GPUDMA)) { // gpu dma
+ if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_GPUDMA].sCycle) >= psxRegs.intCycle[PSXINT_GPUDMA].cycle) {
+ psxRegs.interrupt &= ~(1 << PSXINT_GPUDMA);
+ gpuInterrupt();
+ }
+ }
+ if (psxRegs.interrupt & (1 << PSXINT_MDECOUTDMA)) { // mdec out dma
+ if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_MDECOUTDMA].sCycle) >= psxRegs.intCycle[PSXINT_MDECOUTDMA].cycle) {
+ psxRegs.interrupt &= ~(1 << PSXINT_MDECOUTDMA);
+ mdec1Interrupt();
+ }
+ }
+ if (psxRegs.interrupt & (1 << PSXINT_SPUDMA)) { // spu dma
+ if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_SPUDMA].sCycle) >= psxRegs.intCycle[PSXINT_SPUDMA].cycle) {
+ psxRegs.interrupt &= ~(1 << PSXINT_SPUDMA);
+ spuInterrupt();
+ }
+ }
+ if (psxRegs.interrupt & (1 << PSXINT_GPUBUSY)) { // gpu busy
+ if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_GPUBUSY].sCycle) >= psxRegs.intCycle[PSXINT_GPUBUSY].cycle) {
+ psxRegs.interrupt &= ~(1 << PSXINT_GPUBUSY);
+ GPU_idle();
+ }
}
-
+
if (psxRegs.interrupt & (1 << PSXINT_MDECINDMA)) { // mdec in
if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_MDECINDMA].sCycle) >= psxRegs.intCycle[PSXINT_MDECINDMA].cycle) {
psxRegs.interrupt &= ~(1 << PSXINT_MDECINDMA);
@@ -234,42 +234,42 @@ void psxBranchTest() {
cdrLidSeekInterrupt();
}
}
- }
-}
-
-void psxJumpTest() {
- if (!Config.HLE && Config.PsxOut) {
- u32 call = psxRegs.GPR.n.t1 & 0xff;
- switch (psxRegs.pc & 0x1fffff) {
- case 0xa0:
-#ifdef PSXBIOS_LOG
- if (call != 0x28 && call != 0xe) {
- PSXBIOS_LOG("Bios call a0: %s (%x) %x,%x,%x,%x\n", biosA0n[call], call, psxRegs.GPR.n.a0, psxRegs.GPR.n.a1, psxRegs.GPR.n.a2, psxRegs.GPR.n.a3); }
-#endif
- if (biosA0[call])
- biosA0[call]();
- break;
- case 0xb0:
-#ifdef PSXBIOS_LOG
- if (call != 0x17 && call != 0xb) {
- PSXBIOS_LOG("Bios call b0: %s (%x) %x,%x,%x,%x\n", biosB0n[call], call, psxRegs.GPR.n.a0, psxRegs.GPR.n.a1, psxRegs.GPR.n.a2, psxRegs.GPR.n.a3); }
-#endif
- if (biosB0[call])
- biosB0[call]();
- break;
- case 0xc0:
-#ifdef PSXBIOS_LOG
- PSXBIOS_LOG("Bios call c0: %s (%x) %x,%x,%x,%x\n", biosC0n[call], call, psxRegs.GPR.n.a0, psxRegs.GPR.n.a1, psxRegs.GPR.n.a2, psxRegs.GPR.n.a3);
-#endif
- if (biosC0[call])
- biosC0[call]();
- break;
- }
- }
-}
-
-void psxExecuteBios() {
- while (psxRegs.pc != 0x80030000)
- psxCpu->ExecuteBlock();
-}
-
+ }
+}
+
+void psxJumpTest() {
+ if (!Config.HLE && Config.PsxOut) {
+ u32 call = psxRegs.GPR.n.t1 & 0xff;
+ switch (psxRegs.pc & 0x1fffff) {
+ case 0xa0:
+#ifdef PSXBIOS_LOG
+ if (call != 0x28 && call != 0xe) {
+ PSXBIOS_LOG("Bios call a0: %s (%x) %x,%x,%x,%x\n", biosA0n[call], call, psxRegs.GPR.n.a0, psxRegs.GPR.n.a1, psxRegs.GPR.n.a2, psxRegs.GPR.n.a3); }
+#endif
+ if (biosA0[call])
+ biosA0[call]();
+ break;
+ case 0xb0:
+#ifdef PSXBIOS_LOG
+ if (call != 0x17 && call != 0xb) {
+ PSXBIOS_LOG("Bios call b0: %s (%x) %x,%x,%x,%x\n", biosB0n[call], call, psxRegs.GPR.n.a0, psxRegs.GPR.n.a1, psxRegs.GPR.n.a2, psxRegs.GPR.n.a3); }
+#endif
+ if (biosB0[call])
+ biosB0[call]();
+ break;
+ case 0xc0:
+#ifdef PSXBIOS_LOG
+ PSXBIOS_LOG("Bios call c0: %s (%x) %x,%x,%x,%x\n", biosC0n[call], call, psxRegs.GPR.n.a0, psxRegs.GPR.n.a1, psxRegs.GPR.n.a2, psxRegs.GPR.n.a3);
+#endif
+ if (biosC0[call])
+ biosC0[call]();
+ break;
+ }
+ }
+}
+
+void psxExecuteBios() {
+ while (psxRegs.pc != 0x80030000)
+ psxCpu->ExecuteBlock();
+}
+
diff --git a/libpcsxcore/socket.c b/libpcsxcore/socket.c
index eb4b6f45..4edf7f0c 100644
--- a/libpcsxcore/socket.c
+++ b/libpcsxcore/socket.c
@@ -119,7 +119,7 @@ void GetClient() {
}
#endif
- sprintf(hello, "000 PCSX Version %s - Debug console\r\n", PACKAGE_VERSION);
+ sprintf(hello, "000 PCSXR Version %s - Debug console\r\n", PACKAGE_VERSION);
WriteSocket(hello, strlen(hello));
ptr = 0;
}