git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@38796 e17a0e51-4ae3-4d35-97c3-1a29b211df97

This commit is contained in:
SND\weimingzhi_cp 2009-12-04 10:19:29 +00:00
parent 41e7b60e2e
commit 821c3db4ef
2 changed files with 25 additions and 24 deletions

View File

@ -7,6 +7,9 @@ December 4, 2009 Wei Mingzhi <weimingzhi@gmail.com>
* plugins/dfinput/xkb.c: Likewise.
* plugins/dfinput/pad.h: Likewise.
* po/zh_CN.po, po/zh_TW.po, po/pt_BR.po, po/pcsx.pot: Updated.
* libpcsxcore/psxbios.c: Don't touch the stack pointer if pointed to the
hardware area, which fixes FF7 chocobo racing problem. Don't always
allocate stack spaces before softcall.
December 3, 2009 Wei Mingzhi <weimingzhi@gmail.com>

View File

@ -263,22 +263,15 @@ static __inline void softCall(u32 pc) {
pc0 = pc;
ra = 0x80001000;
// Fixes crashing problems with at least Final Fantasy 7 and Xenogears.
// This should be considered a temporary fix; after all, we do not
// know how much space below sp is in use. It may be worth considering
// creating a new stack for interrupt handlers.
sp -= 256;
while (pc0 != 0x80001000) psxCpu->ExecuteBlock();
sp += 256;
}
static __inline void softCall2(u32 pc) {
u32 sra = ra;
pc0 = pc;
ra = 0x80001000;
sp -= 128;
while (pc0 != 0x80001000) psxCpu->ExecuteBlock();
sp += 128;
ra = sra;
}
@ -490,9 +483,9 @@ void psxBios_malloc() { // 33
unsigned int *chunk, *newchunk;
unsigned int dsize, csize, cstat;
int colflag;
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s\n", biosA0n[0x33]);
#endif
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s\n", biosA0n[0x33]);
#endif
// scan through heap and combine free chunks of space
chunk = heap_addr;
@ -593,9 +586,9 @@ void psxBios_calloc() { // 37
void psxBios_realloc() { // 38
u32 block = a0;
u32 size = a1;
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s\n", biosA0n[0x38]);
#endif
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s\n", biosA0n[0x38]);
#endif
a0 = block;
psxBios_free();
@ -606,11 +599,11 @@ void psxBios_realloc() { // 38
/* InitHeap(void *block , int n) */
void psxBios_InitHeap() { // 39
unsigned int size;
unsigned int size;
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s\n", biosA0n[0x39]);
#endif
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s\n", biosA0n[0x39]);
#endif
if (((a0 & 0x1fffff) + a1)>= 0x200000) size = 0x1ffffc - (a0 & 0x1fffff);
else size = a1;
@ -892,11 +885,11 @@ void psxBios__96_remove() { // 72
void psxBios_SetMem() { // 9f
u32 new = psxHu32(0x1060);
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s: %x, %x\n", biosA0n[0x9f], a0, a1);
#endif
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s: %x, %x\n", biosA0n[0x9f], a0, a1);
#endif
switch(a0) {
case 2:
psxHu32ref(0x1060) = SWAP32(new);
@ -2297,7 +2290,6 @@ void biosInterrupt() {
if (NET_recvPadData(&((u16*)buf)[1], 2) == -1)
netError();
}
}
if (Config.UseNet && pad_buf1 && pad_buf2) {
psxBios_PADpoll(1);
@ -2332,7 +2324,13 @@ void biosInterrupt() {
for (i=0; i<3; i++) {
if (psxHu32(0x1070) & (1 << (i+4))) {
if (RcEV[i][1].status == EvStACTIVE) {
// Fixes crashing problems with at least Final Fantasy 7 and Xenogears.
// This should be considered a temporary fix; after all, we do not
// know how much space below sp is in use. It may be worth considering
// creating a new stack for interrupt handlers.
if ((sp >> 24) != 0x1f) sp -= 256;
softCall(RcEV[i][1].fhandler);
if ((sp >> 24) != 0x1f) sp += 256;
}
psxHwWrite32(0x1f801070, ~(1 << (i+4)));
}