notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
frontend: export fps stats to plugins
[pcsx_rearmed.git]
/
libpcsxcore
/
psxbios.c
diff --git
a/libpcsxcore/psxbios.c
b/libpcsxcore/psxbios.c
index
f2f2540
..
e4fcad3
100644
(file)
--- a/
libpcsxcore/psxbios.c
+++ b/
libpcsxcore/psxbios.c
@@
-25,6
+25,7
@@
#include "psxbios.h"
#include "psxhw.h"
#include "psxbios.h"
#include "psxhw.h"
+#include "gpu.h"
#undef SysPrintf
#define SysPrintf if (Config.PsxOut) printf
#undef SysPrintf
#define SysPrintf if (Config.PsxOut) printf
@@
-259,6
+260,7
@@
static int CardState = -1;
static TCB Thread[8];
static int CurThread = 0;
static FileDesc FDesc[32];
static TCB Thread[8];
static int CurThread = 0;
static FileDesc FDesc[32];
+static u32 card_active_chan;
boolean hleSoftCall = FALSE;
boolean hleSoftCall = FALSE;
@@
-803,8
+805,8
@@
void psxBios_qsort() { // 0x31
}
void psxBios_malloc() { // 0x33
}
void psxBios_malloc() { // 0x33
- unsigned int *chunk, *newchunk;
- unsigned int dsize, csize, cstat;
+ unsigned int *chunk, *newchunk
= NULL
;
+ unsigned int dsize
= 0
, csize, cstat;
int colflag;
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s\n", biosA0n[0x33]);
int colflag;
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s\n", biosA0n[0x33]);
@@
-874,7
+876,7
@@
void psxBios_malloc() { // 0x33
// split free chunk
*chunk = SWAP32(dsize);
newchunk = (u32*)((uptr)chunk + dsize + 4);
// split free chunk
*chunk = SWAP32(dsize);
newchunk = (u32*)((uptr)chunk + dsize + 4);
- *newchunk = SWAP32((
csize - dsize - 4) & 0xfffffffc
| 1);
+ *newchunk = SWAP32((
(csize - dsize - 4) & 0xfffffffc)
| 1);
}
// return pointer to allocated memory
}
// return pointer to allocated memory
@@
-1009,7
+1011,7
@@
_start:
memcpy((char*)PSXM(sp), save, 4 * 4);
memcpy((char*)PSXM(sp), save, 4 * 4);
- SysPrintf(tmp);
+ SysPrintf(
"%s",
tmp);
pc0 = ra;
}
pc0 = ra;
}
@@
-1117,6
+1119,7
@@
void psxBios_mem2vram() { // 0x47
void psxBios_SendGPU() { // 0x48
GPU_writeStatus(a0);
void psxBios_SendGPU() { // 0x48
GPU_writeStatus(a0);
+ gpuSyncPluginSR();
pc0 = ra;
}
pc0 = ra;
}
@@
-1240,6
+1243,8
@@
void psxBios__card_info() { // ab
PSXBIOS_LOG("psxBios_%s: %x\n", biosA0n[0xab], a0);
#endif
PSXBIOS_LOG("psxBios_%s: %x\n", biosA0n[0xab], a0);
#endif
+ card_active_chan = a0;
+
// DeliverEvent(0x11, 0x2); // 0xf0000011, 0x0004
DeliverEvent(0x81, 0x2); // 0xf4000001, 0x0004
// DeliverEvent(0x11, 0x2); // 0xf0000011, 0x0004
DeliverEvent(0x81, 0x2); // 0xf4000001, 0x0004
@@
-1251,6
+1256,8
@@
void psxBios__card_load() { // ac
PSXBIOS_LOG("psxBios_%s: %x\n", biosA0n[0xac], a0);
#endif
PSXBIOS_LOG("psxBios_%s: %x\n", biosA0n[0xac], a0);
#endif
+ card_active_chan = a0;
+
// DeliverEvent(0x11, 0x2); // 0xf0000011, 0x0004
DeliverEvent(0x81, 0x2); // 0xf4000001, 0x0004
// DeliverEvent(0x11, 0x2); // 0xf0000011, 0x0004
DeliverEvent(0x81, 0x2); // 0xf4000001, 0x0004
@@
-1813,7
+1820,7
@@
void psxBios_putchar() { // 3d
}
void psxBios_puts() { // 3e/3f
}
void psxBios_puts() { // 3e/3f
- SysPrintf(Ra0);
+ SysPrintf(
"%s",
Ra0);
pc0 = ra;
}
pc0 = ra;
}
@@
-2024,6
+2031,7
@@
void psxBios__card_write() { // 0x4e
PSXBIOS_LOG("psxBios_%s: %x,%x,%x\n", biosB0n[0x4e], a0, a1, a2);
#endif
PSXBIOS_LOG("psxBios_%s: %x,%x,%x\n", biosB0n[0x4e], a0, a1, a2);
#endif
+ card_active_chan = a0;
port = a0 >> 4;
if (port == 0) {
port = a0 >> 4;
if (port == 0) {
@@
-2047,6
+2055,7
@@
void psxBios__card_read() { // 0x4f
PSXBIOS_LOG("psxBios_%s\n", biosB0n[0x4f]);
#endif
PSXBIOS_LOG("psxBios_%s\n", biosB0n[0x4f]);
#endif
+ card_active_chan = a0;
port = a0 >> 4;
if (port == 0) {
port = a0 >> 4;
if (port == 0) {
@@
-2128,6
+2137,15
@@
void psxBios_GetB0Table() { // 57
v0 = 0x874; pc0 = ra;
}
v0 = 0x874; pc0 = ra;
}
+void psxBios__card_chan() { // 0x58
+#ifdef PSXBIOS_LOG
+ PSXBIOS_LOG("psxBios_%s\n", biosB0n[0x58]);
+#endif
+
+ v0 = card_active_chan;
+ pc0 = ra;
+}
+
void psxBios_ChangeClearPad() { // 5b
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s: %x\n", biosB0n[0x5b], a0);
void psxBios_ChangeClearPad() { // 5b
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s: %x\n", biosB0n[0x5b], a0);
@@
-2485,7
+2503,7
@@
void psxBiosInit() {
//biosB0[0x55] = psxBios__get_error;
biosB0[0x56] = psxBios_GetC0Table;
biosB0[0x57] = psxBios_GetB0Table;
//biosB0[0x55] = psxBios__get_error;
biosB0[0x56] = psxBios_GetC0Table;
biosB0[0x57] = psxBios_GetB0Table;
-
//
biosB0[0x58] = psxBios__card_chan;
+ biosB0[0x58] = psxBios__card_chan;
//biosB0[0x59] = psxBios_sys_b0_59;
//biosB0[0x5a] = psxBios_sys_b0_5a;
biosB0[0x5b] = psxBios_ChangeClearPad;
//biosB0[0x59] = psxBios_sys_b0_59;
//biosB0[0x5a] = psxBios_sys_b0_5a;
biosB0[0x5b] = psxBios_ChangeClearPad;
@@
-2820,4
+2838,5
@@
void psxBiosFreeze(int Mode) {
bfreezes(Thread);
bfreezel(&CurThread);
bfreezes(FDesc);
bfreezes(Thread);
bfreezel(&CurThread);
bfreezes(FDesc);
+ bfreezel(&card_active_chan);
}
}