- add IDM_DEFSIZE to resource.h (luigi__ will have merge issues).
- add code to use bios if the bios files exist. this code is preliminary. it seems to freeze games right now. to use this, make sure BiosNds7.ROM and BiosNds9.ROM exist in the application startup working directory. this is probably not a good way to do it, but it is a start. - fix recently created spu issues with adpcm and psg. - change execute = FALSE; to emu_pause(); so that other things can be done or disabled in one place. - analyze performance of MatrixIdentity for speedup. - accept crazymax's correction to my matrix caching. that was boneheaded, sorry!
This commit is contained in:
parent
70a8af9942
commit
5a940dc2be
|
@ -1,166 +1,166 @@
|
|||
/* Copyright (C) 2006 yopyop
|
||||
yopyop156@ifrance.com
|
||||
yopyop156.ifrance.com
|
||||
|
||||
Copyright (C) 2007 shash
|
||||
|
||||
This file is part of DeSmuME
|
||||
|
||||
DeSmuME 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.
|
||||
|
||||
DeSmuME 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 DeSmuME; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "FIFO.h"
|
||||
#include <string.h>
|
||||
#include "armcpu.h"
|
||||
#include "debug.h"
|
||||
#include "mem.h"
|
||||
#include "MMU.h"
|
||||
|
||||
// ========================================================= IPC FIFO
|
||||
IPC_FIFO ipc_fifo;
|
||||
|
||||
void IPC_FIFOclear()
|
||||
{
|
||||
memset(&ipc_fifo, 0, sizeof(IPC_FIFO));
|
||||
//LOG("FIFO is cleared\n");
|
||||
}
|
||||
|
||||
void IPC_FIFOsend(u8 proc, u32 val)
|
||||
{
|
||||
//LOG("IPC%s send FIFO 0x%08X\n", proc?"7":"9", val);
|
||||
u16 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184);
|
||||
if (!(cnt_l & 0x8000)) return; // FIFO disabled
|
||||
u16 cnt_r = T1ReadWord(MMU.MMU_MEM[proc^1][0x40], 0x184);
|
||||
|
||||
if (ipc_fifo.sendTail[proc] < 16) // last full == error
|
||||
{
|
||||
ipc_fifo.sendBuf[proc][ipc_fifo.sendTail[proc]] = val;
|
||||
ipc_fifo.sendTail[proc]++;
|
||||
if (ipc_fifo.sendTail[proc] == 16) cnt_l |= 0x02; // full
|
||||
cnt_l &= 0xFFFE;
|
||||
|
||||
if (ipc_fifo.recvTail[proc^1] < 16) // last full == error
|
||||
{
|
||||
ipc_fifo.recvBuf[proc^1][ipc_fifo.recvTail[proc^1]] = val;
|
||||
ipc_fifo.recvTail[proc^1]++;
|
||||
if (ipc_fifo.recvTail[proc^1] == 16) cnt_r |= 0x0200; // full
|
||||
cnt_r &= 0xFEFF;
|
||||
}
|
||||
else
|
||||
cnt_r |= 0x4200;
|
||||
}
|
||||
else
|
||||
cnt_l |= 0x4002;
|
||||
|
||||
// save in mem
|
||||
T1WriteWord(MMU.MMU_MEM[proc][0x40], 0x184, cnt_l);
|
||||
T1WriteWord(MMU.MMU_MEM[proc^1][0x40], 0x184, cnt_r);
|
||||
|
||||
if ((cnt_r & (1<<10)))
|
||||
NDS_makeInt(proc^1, 18);
|
||||
}
|
||||
|
||||
u32 IPC_FIFOrecv(u8 proc)
|
||||
{
|
||||
//LOG("IPC%s recv FIFO:\n", proc?"7":"9");
|
||||
u32 val = 0;
|
||||
u16 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184);
|
||||
u16 cnt_r = T1ReadWord(MMU.MMU_MEM[proc^1][0x40], 0x184);
|
||||
|
||||
if (ipc_fifo.recvTail[proc] > 0) // not empty
|
||||
{
|
||||
val = ipc_fifo.recvBuf[proc][0];
|
||||
for (int i = 0; i < ipc_fifo.recvTail[proc]; i++)
|
||||
ipc_fifo.recvBuf[proc][i] = ipc_fifo.recvBuf[proc][i+1];
|
||||
ipc_fifo.recvTail[proc]--;
|
||||
if (ipc_fifo.recvTail[proc] == 0) // empty
|
||||
cnt_l |= 0x0100;
|
||||
|
||||
// remove from head
|
||||
for (int i = 0; i < ipc_fifo.sendTail[proc^1]; i++)
|
||||
ipc_fifo.sendBuf[proc^1][i] = ipc_fifo.sendBuf[proc^1][i+1];
|
||||
ipc_fifo.sendTail[proc^1]--;
|
||||
if (ipc_fifo.sendTail[proc^1] == 0) // empty
|
||||
cnt_r |= 0x0001;
|
||||
}
|
||||
else
|
||||
cnt_l |= 0x4100;
|
||||
|
||||
T1WriteWord(MMU.MMU_MEM[proc][0x40], 0x184, cnt_l);
|
||||
T1WriteWord(MMU.MMU_MEM[proc^1][0x40], 0x184, cnt_r);
|
||||
|
||||
if ((cnt_l & (1<<3)))
|
||||
NDS_makeInt(proc, 19);
|
||||
return (val);
|
||||
}
|
||||
|
||||
void IPC_FIFOcnt(u8 proc, u16 val)
|
||||
{
|
||||
//LOG("IPC%s FIFO context 0x%X\n", proc?"7":"9", val);
|
||||
|
||||
u16 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184);
|
||||
|
||||
cnt_l &= ~0x8404;
|
||||
cnt_l |= (val & 0x8404);
|
||||
cnt_l &= (~(val & 0x4000));
|
||||
if (val & 0x0008)
|
||||
{
|
||||
IPC_FIFOclear();
|
||||
cnt_l |= 0x0101;
|
||||
}
|
||||
T1WriteWord(MMU.MMU_MEM[proc][0x40], 0x184, cnt_l);
|
||||
|
||||
if ((cnt_l & 0x0004))
|
||||
NDS_makeInt(proc, 18);
|
||||
}
|
||||
|
||||
// ========================================================= GFX FIFO
|
||||
GFX_FIFO gxFIFO;
|
||||
|
||||
void GFX_FIFOclear()
|
||||
{
|
||||
u32 gxstat = T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x600);
|
||||
|
||||
memset(&gxFIFO, 0, sizeof(GFX_FIFO));
|
||||
|
||||
// TODO: irq handle
|
||||
gxstat &= 0x0000FF00;
|
||||
/* Copyright (C) 2006 yopyop
|
||||
yopyop156@ifrance.com
|
||||
yopyop156.ifrance.com
|
||||
|
||||
Copyright (C) 2007 shash
|
||||
|
||||
This file is part of DeSmuME
|
||||
|
||||
DeSmuME 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.
|
||||
|
||||
DeSmuME 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 DeSmuME; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "FIFO.h"
|
||||
#include <string.h>
|
||||
#include "armcpu.h"
|
||||
#include "debug.h"
|
||||
#include "mem.h"
|
||||
#include "MMU.h"
|
||||
|
||||
// ========================================================= IPC FIFO
|
||||
IPC_FIFO ipc_fifo;
|
||||
|
||||
void IPC_FIFOclear()
|
||||
{
|
||||
memset(&ipc_fifo, 0, sizeof(IPC_FIFO));
|
||||
//LOG("FIFO is cleared\n");
|
||||
}
|
||||
|
||||
void IPC_FIFOsend(u8 proc, u32 val)
|
||||
{
|
||||
//LOG("IPC%s send FIFO 0x%08X\n", proc?"7":"9", val);
|
||||
u16 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184);
|
||||
if (!(cnt_l & 0x8000)) return; // FIFO disabled
|
||||
u16 cnt_r = T1ReadWord(MMU.MMU_MEM[proc^1][0x40], 0x184);
|
||||
|
||||
if (ipc_fifo.sendTail[proc] < 16) // last full == error
|
||||
{
|
||||
ipc_fifo.sendBuf[proc][ipc_fifo.sendTail[proc]] = val;
|
||||
ipc_fifo.sendTail[proc]++;
|
||||
if (ipc_fifo.sendTail[proc] == 16) cnt_l |= 0x02; // full
|
||||
cnt_l &= 0xFFFE;
|
||||
|
||||
if (ipc_fifo.recvTail[proc^1] < 16) // last full == error
|
||||
{
|
||||
ipc_fifo.recvBuf[proc^1][ipc_fifo.recvTail[proc^1]] = val;
|
||||
ipc_fifo.recvTail[proc^1]++;
|
||||
if (ipc_fifo.recvTail[proc^1] == 16) cnt_r |= 0x0200; // full
|
||||
cnt_r &= 0xFEFF;
|
||||
}
|
||||
else
|
||||
cnt_r |= 0x4200;
|
||||
}
|
||||
else
|
||||
cnt_l |= 0x4002;
|
||||
|
||||
// save in mem
|
||||
T1WriteWord(MMU.MMU_MEM[proc][0x40], 0x184, cnt_l);
|
||||
T1WriteWord(MMU.MMU_MEM[proc^1][0x40], 0x184, cnt_r);
|
||||
|
||||
if ((cnt_r & (1<<10)))
|
||||
NDS_makeInt(proc^1, 18);
|
||||
}
|
||||
|
||||
u32 IPC_FIFOrecv(u8 proc)
|
||||
{
|
||||
//LOG("IPC%s recv FIFO:\n", proc?"7":"9");
|
||||
u32 val = 0;
|
||||
u16 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184);
|
||||
u16 cnt_r = T1ReadWord(MMU.MMU_MEM[proc^1][0x40], 0x184);
|
||||
|
||||
if (ipc_fifo.recvTail[proc] > 0) // not empty
|
||||
{
|
||||
val = ipc_fifo.recvBuf[proc][0];
|
||||
for (int i = 0; i < ipc_fifo.recvTail[proc]; i++)
|
||||
ipc_fifo.recvBuf[proc][i] = ipc_fifo.recvBuf[proc][i+1];
|
||||
ipc_fifo.recvTail[proc]--;
|
||||
if (ipc_fifo.recvTail[proc] == 0) // empty
|
||||
cnt_l |= 0x0100;
|
||||
|
||||
// remove from head
|
||||
for (int i = 0; i < ipc_fifo.sendTail[proc^1]; i++)
|
||||
ipc_fifo.sendBuf[proc^1][i] = ipc_fifo.sendBuf[proc^1][i+1];
|
||||
ipc_fifo.sendTail[proc^1]--;
|
||||
if (ipc_fifo.sendTail[proc^1] == 0) // empty
|
||||
cnt_r |= 0x0001;
|
||||
}
|
||||
else
|
||||
cnt_l |= 0x4100;
|
||||
|
||||
T1WriteWord(MMU.MMU_MEM[proc][0x40], 0x184, cnt_l);
|
||||
T1WriteWord(MMU.MMU_MEM[proc^1][0x40], 0x184, cnt_r);
|
||||
|
||||
if ((cnt_l & (1<<3)))
|
||||
NDS_makeInt(proc, 19);
|
||||
return (val);
|
||||
}
|
||||
|
||||
void IPC_FIFOcnt(u8 proc, u16 val)
|
||||
{
|
||||
//LOG("IPC%s FIFO context 0x%X\n", proc?"7":"9", val);
|
||||
|
||||
u16 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184);
|
||||
|
||||
cnt_l &= ~0x8404;
|
||||
cnt_l |= (val & 0x8404);
|
||||
cnt_l &= (~(val & 0x4000));
|
||||
if (val & 0x0008)
|
||||
{
|
||||
IPC_FIFOclear();
|
||||
cnt_l |= 0x0101;
|
||||
}
|
||||
T1WriteWord(MMU.MMU_MEM[proc][0x40], 0x184, cnt_l);
|
||||
|
||||
if ((cnt_l & 0x0004))
|
||||
NDS_makeInt(proc, 18);
|
||||
}
|
||||
|
||||
// ========================================================= GFX FIFO
|
||||
GFX_FIFO gxFIFO;
|
||||
|
||||
void GFX_FIFOclear()
|
||||
{
|
||||
u32 gxstat = T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x600);
|
||||
|
||||
memset(&gxFIFO, 0, sizeof(GFX_FIFO));
|
||||
|
||||
// TODO: irq handle
|
||||
gxstat &= 0x0000FF00;
|
||||
gxstat |= 0x00000002; // this is hack
|
||||
gxstat |= 0x86000000;
|
||||
T1WriteLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x600, gxstat);
|
||||
}
|
||||
|
||||
void GFX_FIFOsend(u32 cmd, u32 param)
|
||||
{
|
||||
u32 gxstat = T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x600);
|
||||
gxstat &= 0x0000FF00;
|
||||
gxstat |= 0x00000002; // this is hack
|
||||
|
||||
if (gxFIFO.tail < 260)
|
||||
{
|
||||
gxFIFO.cmd[gxFIFO.tail] = cmd & 0xFF;
|
||||
gxFIFO.param[gxFIFO.tail] = param;
|
||||
gxFIFO.tail++;
|
||||
// TODO: irq handle
|
||||
if (gxFIFO.tail < 130)
|
||||
gxstat |= 0x72000000;
|
||||
if (gxFIFO.tail == 16)
|
||||
gxstat |= 0x01000000;
|
||||
}
|
||||
else
|
||||
gxstat |= 0x01000000;
|
||||
|
||||
T1WriteLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x600, gxstat);
|
||||
}
|
||||
}
|
||||
|
||||
void GFX_FIFOsend(u32 cmd, u32 param)
|
||||
{
|
||||
u32 gxstat = T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x600);
|
||||
gxstat &= 0x0000FF00;
|
||||
gxstat |= 0x00000002; // this is hack
|
||||
|
||||
if (gxFIFO.tail < 260)
|
||||
{
|
||||
gxFIFO.cmd[gxFIFO.tail] = cmd & 0xFF;
|
||||
gxFIFO.param[gxFIFO.tail] = param;
|
||||
gxFIFO.tail++;
|
||||
// TODO: irq handle
|
||||
if (gxFIFO.tail < 130)
|
||||
gxstat |= 0x72000000;
|
||||
if (gxFIFO.tail == 16)
|
||||
gxstat |= 0x01000000;
|
||||
}
|
||||
else
|
||||
gxstat |= 0x01000000;
|
||||
|
||||
T1WriteLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x600, gxstat);
|
||||
}
|
||||
|
|
|
@ -2040,7 +2040,7 @@ static void FASTCALL _MMU_ARM9_write16(u32 adr, u16 val)
|
|||
}
|
||||
case REG_DISPB_DISPCNT+2 :
|
||||
{
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
u32 v = (T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x1000) & 0xFFFF) | ((u32) val << 16);
|
||||
GPU_setVideoProp(SubScreen.gpu, v);
|
||||
T1WriteLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0x1000, v);
|
||||
|
@ -2049,7 +2049,7 @@ static void FASTCALL _MMU_ARM9_write16(u32 adr, u16 val)
|
|||
case REG_DMA0CNTH :
|
||||
{
|
||||
u32 v;
|
||||
//if(val&0x8000) execute = FALSE;
|
||||
//if(val&0x8000) emu_halt();
|
||||
//LOG("16 bit dma0 %04X\r\n", val);
|
||||
T1WriteWord(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0xBA, val);
|
||||
DMASrc[ARMCPU_ARM9][0] = T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0xB0);
|
||||
|
@ -2070,7 +2070,7 @@ static void FASTCALL _MMU_ARM9_write16(u32 adr, u16 val)
|
|||
case REG_DMA1CNTH :
|
||||
{
|
||||
u32 v;
|
||||
//if(val&0x8000) execute = FALSE;
|
||||
//if(val&0x8000) emu_halt();
|
||||
//LOG("16 bit dma1 %04X\r\n", val);
|
||||
T1WriteWord(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0xC6, val);
|
||||
DMASrc[ARMCPU_ARM9][1] = T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0xBC);
|
||||
|
@ -2091,7 +2091,7 @@ static void FASTCALL _MMU_ARM9_write16(u32 adr, u16 val)
|
|||
case REG_DMA2CNTH :
|
||||
{
|
||||
u32 v;
|
||||
//if(val&0x8000) execute = FALSE;
|
||||
//if(val&0x8000) emu_halt();
|
||||
//LOG("16 bit dma2 %04X\r\n", val);
|
||||
T1WriteWord(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0xD2, val);
|
||||
DMASrc[ARMCPU_ARM9][2] = T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0xC8);
|
||||
|
@ -2112,7 +2112,7 @@ static void FASTCALL _MMU_ARM9_write16(u32 adr, u16 val)
|
|||
case REG_DMA3CNTH :
|
||||
{
|
||||
u32 v;
|
||||
//if(val&0x8000) execute = FALSE;
|
||||
//if(val&0x8000) emu_halt();
|
||||
//LOG("16 bit dma3 %04X\r\n", val);
|
||||
T1WriteWord(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0xDE, val);
|
||||
DMASrc[ARMCPU_ARM9][3] = T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM9][0x40], 0xD4);
|
||||
|
@ -2131,7 +2131,7 @@ static void FASTCALL _MMU_ARM9_write16(u32 adr, u16 val)
|
|||
#endif
|
||||
}
|
||||
return;
|
||||
//case REG_AUXSPICNT : execute = FALSE;
|
||||
//case REG_AUXSPICNT : emu_halt();
|
||||
}
|
||||
#ifdef _MMU_DEBUG
|
||||
mmu_log_debug_ARM9(adr, "(write16) %0x%X", val);
|
||||
|
@ -2464,7 +2464,7 @@ static void FASTCALL _MMU_ARM9_write32(u32 adr, u32 val)
|
|||
LOG("ARMCPU_ARM9 %d, dma %d src %08X dst %08X start taille %d %d\r\n", ARMCPU_ARM9, 0, DMASrc[ARMCPU_ARM9][0], DMADst[ARMCPU_ARM9][0], 0, ((MMU.DMACrt[ARMCPU_ARM9][0]>>27)&7));
|
||||
}
|
||||
#endif
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
return;
|
||||
case REG_DMA1CNTL:
|
||||
//LOG("32 bit dma1 %04X\r\n", val);
|
||||
|
@ -2579,7 +2579,7 @@ static void FASTCALL _MMU_ARM9_write32(u32 adr, u32 val)
|
|||
case REG_DISPA_BG0CNT :
|
||||
GPU_setBGProp(MainScreen.gpu, 0, (val&0xFFFF));
|
||||
GPU_setBGProp(MainScreen.gpu, 1, (val>>16));
|
||||
//if((val>>16)==0x400) execute = FALSE;
|
||||
//if((val>>16)==0x400) emu_halt();
|
||||
T1WriteLong(ARM9Mem.ARM9_REG, 8, val);
|
||||
return;
|
||||
case REG_DISPA_BG2CNT :
|
||||
|
@ -3006,14 +3006,14 @@ static void FASTCALL _MMU_ARM7_write16(u32 adr, u16 val)
|
|||
val = 0;
|
||||
break;
|
||||
case 0x10 :
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
if(SPI_CNT&(1<<11))
|
||||
{
|
||||
if(partie)
|
||||
{
|
||||
val = ((nds.touchY<<3)&0x7FF);
|
||||
partie = 0;
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
break;
|
||||
}
|
||||
val = (nds.touchY>>5);
|
||||
|
@ -3102,7 +3102,7 @@ static void FASTCALL _MMU_ARM7_write16(u32 adr, u16 val)
|
|||
#endif
|
||||
return;
|
||||
case REG_IE + 2 :
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
MMU.reg_IE[ARMCPU_ARM7] = (MMU.reg_IE[ARMCPU_ARM7]&0xFFFF) | (((u32)val)<<16);
|
||||
#ifndef NEW_IRQ
|
||||
if ( MMU.reg_IME[ARMCPU_ARM7])
|
||||
|
@ -3118,11 +3118,11 @@ static void FASTCALL _MMU_ARM7_write16(u32 adr, u16 val)
|
|||
return;
|
||||
|
||||
case REG_IF :
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
MMU.reg_IF[ARMCPU_ARM7] &= (~((u32)val));
|
||||
return;
|
||||
case REG_IF + 2 :
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
MMU.reg_IF[ARMCPU_ARM7] &= (~(((u32)val)<<16));
|
||||
return;
|
||||
|
||||
|
@ -3183,7 +3183,7 @@ static void FASTCALL _MMU_ARM7_write16(u32 adr, u16 val)
|
|||
{
|
||||
u32 v;
|
||||
|
||||
//if(val&0x8000) execute = FALSE;
|
||||
//if(val&0x8000) emu_halt();
|
||||
//LOG("16 bit dma0 %04X\r\n", val);
|
||||
T1WriteWord(MMU.MMU_MEM[ARMCPU_ARM7][0x40], 0xBA, val);
|
||||
DMASrc[ARMCPU_ARM7][0] = T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM7][0x40], 0xB0);
|
||||
|
@ -3204,7 +3204,7 @@ static void FASTCALL _MMU_ARM7_write16(u32 adr, u16 val)
|
|||
case REG_DMA1CNTH :
|
||||
{
|
||||
u32 v;
|
||||
//if(val&0x8000) execute = FALSE;
|
||||
//if(val&0x8000) emu_halt();
|
||||
//LOG("16 bit dma1 %04X\r\n", val);
|
||||
T1WriteWord(MMU.MMU_MEM[ARMCPU_ARM7][0x40], 0xC6, val);
|
||||
DMASrc[ARMCPU_ARM7][1] = T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM7][0x40], 0xBC);
|
||||
|
@ -3225,7 +3225,7 @@ static void FASTCALL _MMU_ARM7_write16(u32 adr, u16 val)
|
|||
case REG_DMA2CNTH :
|
||||
{
|
||||
u32 v;
|
||||
//if(val&0x8000) execute = FALSE;
|
||||
//if(val&0x8000) emu_halt();
|
||||
//LOG("16 bit dma2 %04X\r\n", val);
|
||||
T1WriteWord(MMU.MMU_MEM[ARMCPU_ARM7][0x40], 0xD2, val);
|
||||
DMASrc[ARMCPU_ARM7][2] = T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM7][0x40], 0xC8);
|
||||
|
@ -3246,7 +3246,7 @@ static void FASTCALL _MMU_ARM7_write16(u32 adr, u16 val)
|
|||
case REG_DMA3CNTH :
|
||||
{
|
||||
u32 v;
|
||||
//if(val&0x8000) execute = FALSE;
|
||||
//if(val&0x8000) emu_halt();
|
||||
//LOG("16 bit dma3 %04X\r\n", val);
|
||||
T1WriteWord(MMU.MMU_MEM[ARMCPU_ARM7][0x40], 0xDE, val);
|
||||
DMASrc[ARMCPU_ARM7][3] = T1ReadLong(MMU.MMU_MEM[ARMCPU_ARM7][0x40], 0xD4);
|
||||
|
@ -3265,7 +3265,7 @@ static void FASTCALL _MMU_ARM7_write16(u32 adr, u16 val)
|
|||
#endif
|
||||
}
|
||||
return;
|
||||
//case REG_AUXSPICNT : execute = FALSE;
|
||||
//case REG_AUXSPICNT : emu_halt();
|
||||
}
|
||||
#ifdef _MMU_DEBUG
|
||||
mmu_log_debug_ARM7(adr, "(write16) %0x%X", val);
|
||||
|
@ -3408,7 +3408,7 @@ static void FASTCALL _MMU_ARM7_write32(u32 adr, u32 val)
|
|||
LOG("ARMCPU_ARM7 %d, dma %d src %08X dst %08X start taille %d %d\r\n", ARMCPU_ARM7, 0, DMASrc[ARMCPU_ARM7][0], DMADst[ARMCPU_ARM7][0], 0, ((MMU.DMACrt[ARMCPU_ARM7][0]>>27)&7));
|
||||
}
|
||||
#endif
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
return;
|
||||
case REG_DMA1CNTL:
|
||||
//LOG("32 bit dma1 %04X\r\n", val);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -102,6 +102,7 @@ typedef struct
|
|||
} NDS_header;
|
||||
|
||||
extern void debug();
|
||||
void emu_halt();
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -232,7 +233,7 @@ inline u32 NDS_exec(s32 nb) { return NDS_exec<false>(nb); }
|
|||
{
|
||||
MMU.reg_IF[0] |= 1;// & (MMU.reg_IME[0]);// (MMU.reg_IE[0] & 1);
|
||||
NDS_ARM9.wIRQ = TRUE;
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
/*logcount++;*/
|
||||
}
|
||||
}
|
||||
|
@ -242,7 +243,7 @@ inline u32 NDS_exec(s32 nb) { return NDS_exec<false>(nb); }
|
|||
if(T1ReadWord(MMU.ARM7_REG, 4) & 0x8)
|
||||
MMU.reg_IF[1] |= 1;// & (MMU.reg_IME[1]);// (MMU.reg_IE[1] & 1);
|
||||
NDS_ARM7.wIRQ = TRUE;
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
}
|
||||
|
||||
static INLINE void NDS_swapScreen(void)
|
||||
|
|
|
@ -792,7 +792,7 @@ static void SPU_ChanUpdate8LR(SPU_struct* SPU, channel_struct *chan)
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void SPU_ChanUpdateNoMix(SPU_struct *SPU, channel_struct *chan)
|
||||
static void SPU_ChanUpdate8NoMix(SPU_struct *SPU, channel_struct *chan)
|
||||
{
|
||||
for (; SPU->bufpos < SPU->buflength; SPU->bufpos++)
|
||||
{
|
||||
|
@ -837,6 +837,16 @@ static void SPU_ChanUpdate8R(SPU_struct* SPU, channel_struct *chan)
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void SPU_ChanUpdate16NoMix(SPU_struct *SPU, channel_struct *chan)
|
||||
{
|
||||
for (; SPU->bufpos < SPU->buflength; SPU->bufpos++)
|
||||
{
|
||||
// check to see if we're passed the length and need to loop, etc.
|
||||
TestForLoop(SPU, chan);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void SPU_ChanUpdate16LR(SPU_struct* SPU, channel_struct *chan)
|
||||
{
|
||||
for (; SPU->bufpos < SPU->buflength; SPU->bufpos++)
|
||||
|
@ -891,6 +901,16 @@ static void SPU_ChanUpdate16R(SPU_struct* SPU, channel_struct *chan)
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void SPU_ChanUpdateADPCMNoMix(SPU_struct *SPU, channel_struct *chan)
|
||||
{
|
||||
for (; SPU->bufpos < SPU->buflength; SPU->bufpos++)
|
||||
{
|
||||
// check to see if we're passed the length and need to loop, etc.
|
||||
TestForLoop2(SPU, chan);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void SPU_ChanUpdateADPCMLR(SPU_struct* SPU, channel_struct *chan)
|
||||
{
|
||||
for (; SPU->bufpos < SPU->buflength; SPU->bufpos++)
|
||||
|
@ -945,6 +965,15 @@ static void SPU_ChanUpdateADPCMR(SPU_struct* SPU, channel_struct *chan)
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void SPU_ChanUpdatePSGNoMix(SPU_struct* SPU, channel_struct *chan)
|
||||
{
|
||||
for (; SPU->bufpos < SPU->buflength; SPU->bufpos++)
|
||||
{
|
||||
chan->sampcnt += chan->sampinc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void SPU_ChanUpdatePSGLR(SPU_struct* SPU, channel_struct *chan)
|
||||
{
|
||||
for (; SPU->bufpos < SPU->buflength; SPU->bufpos++)
|
||||
|
@ -1001,25 +1030,25 @@ void (*SPU_ChanUpdate[4][4])(SPU_struct* SPU, channel_struct *chan) = {
|
|||
SPU_ChanUpdate8L,
|
||||
SPU_ChanUpdate8LR,
|
||||
SPU_ChanUpdate8R,
|
||||
SPU_ChanUpdateNoMix
|
||||
SPU_ChanUpdate8NoMix
|
||||
},
|
||||
{ // 16-bit PCM
|
||||
SPU_ChanUpdate16L,
|
||||
SPU_ChanUpdate16LR,
|
||||
SPU_ChanUpdate16R,
|
||||
SPU_ChanUpdateNoMix,
|
||||
SPU_ChanUpdate16NoMix,
|
||||
},
|
||||
{ // IMA-ADPCM
|
||||
SPU_ChanUpdateADPCML,
|
||||
SPU_ChanUpdateADPCMLR,
|
||||
SPU_ChanUpdateADPCMR,
|
||||
SPU_ChanUpdateNoMix
|
||||
SPU_ChanUpdateADPCMNoMix
|
||||
},
|
||||
{ // PSG/White Noise
|
||||
SPU_ChanUpdatePSGL,
|
||||
SPU_ChanUpdatePSGLR,
|
||||
SPU_ChanUpdatePSGR,
|
||||
SPU_ChanUpdateNoMix
|
||||
SPU_ChanUpdatePSGNoMix
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "debug.h"
|
||||
#include "MMU.h"
|
||||
#include "armcpu.h"
|
||||
#include "NDSSystem.h"
|
||||
|
||||
#define cpu (&ARMPROC)
|
||||
#define TEMPLATE template<int PROCNUM>
|
||||
|
@ -248,7 +249,7 @@ extern volatile BOOL execute;
|
|||
TEMPLATE static u32 FASTCALL OP_UND()
|
||||
{
|
||||
LOG("Undefined instruction: %08X\n", cpu->instruction);
|
||||
execute = FALSE;
|
||||
emu_halt();
|
||||
LOG("Stopped (OP_UND)\n");
|
||||
return 1;
|
||||
}
|
||||
|
@ -269,7 +270,7 @@ TEMPLATE static u32 FASTCALL OP_UND()
|
|||
} \
|
||||
else \
|
||||
{ \
|
||||
execute = FALSE; \
|
||||
emu_halt(); \
|
||||
return 4; \
|
||||
} \
|
||||
|
||||
|
@ -5033,7 +5034,7 @@ TEMPLATE static u32 FASTCALL OP_STR_P_IMM_OFF()
|
|||
u32 adr = cpu->R[REG_POS(i,16)] + IMM_OFF_12;
|
||||
WRITE32(cpu->mem_if->data, adr, cpu->R[REG_POS(i,12)]);
|
||||
|
||||
// execute = false;
|
||||
// emu_halt();
|
||||
|
||||
return 2 + MMU.MMU_WAIT32[PROCNUM][(adr>>24)&0xF];
|
||||
}
|
||||
|
@ -5791,7 +5792,7 @@ TEMPLATE static u32 FASTCALL OP_LDRBT_M_IMM_OFF_POSTIND()
|
|||
return 2;
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_LDRBT_M_IMM_OFF_POSTIND\n");
|
||||
|
||||
|
||||
|
@ -5817,7 +5818,7 @@ TEMPLATE static u32 FASTCALL OP_LDRBT_P_REG_OFF_POSTIND()
|
|||
return 2;
|
||||
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_LDRBT_P_REG_OFF_POSTIND\n");
|
||||
|
||||
|
||||
|
@ -5843,7 +5844,7 @@ TEMPLATE static u32 FASTCALL OP_LDRBT_P_LSL_IMM_OFF_POSTIND()
|
|||
if(cpu->CPSR.bits.mode==USR)
|
||||
return 2;
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_LDRBT_P_LSL_IMM_OFF_POSTIND\n");
|
||||
|
||||
|
||||
|
@ -5871,7 +5872,7 @@ TEMPLATE static u32 FASTCALL OP_LDRBT_M_LSL_IMM_OFF_POSTIND()
|
|||
return 2;
|
||||
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_LDRBT_M_LSL_IMM_OFF_POSTIND\n");
|
||||
|
||||
|
||||
|
@ -5899,7 +5900,7 @@ TEMPLATE static u32 FASTCALL OP_LDRBT_P_LSR_IMM_OFF_POSTIND()
|
|||
return 2;
|
||||
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_LDRBT_P_LSR_IMM_OFF_POSTIND\n");
|
||||
|
||||
|
||||
|
@ -5927,7 +5928,7 @@ TEMPLATE static u32 FASTCALL OP_LDRBT_M_LSR_IMM_OFF_POSTIND()
|
|||
return 2;
|
||||
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_LDRBT_M_LSR_IMM_OFF_POSTIND\n");
|
||||
|
||||
|
||||
|
@ -5955,7 +5956,7 @@ TEMPLATE static u32 FASTCALL OP_LDRBT_P_ASR_IMM_OFF_POSTIND()
|
|||
return 2;
|
||||
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_LDRBT_P_ASR_IMM_OFF_POSTIND\n");
|
||||
|
||||
|
||||
|
@ -5983,7 +5984,7 @@ TEMPLATE static u32 FASTCALL OP_LDRBT_M_ASR_IMM_OFF_POSTIND()
|
|||
return 2;
|
||||
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_LDRBT_M_ASR_IMM_OFF_POSTIND\n");
|
||||
|
||||
|
||||
|
@ -6011,7 +6012,7 @@ TEMPLATE static u32 FASTCALL OP_LDRBT_P_ROR_IMM_OFF_POSTIND()
|
|||
return 2;
|
||||
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_LDRBT_P_ROR_IMM_OFF_POSTIND\n");
|
||||
|
||||
|
||||
|
@ -6039,7 +6040,7 @@ TEMPLATE static u32 FASTCALL OP_LDRBT_M_ROR_IMM_OFF_POSTIND()
|
|||
return 2;
|
||||
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_LDRBT_M_ROR_IMM_OFF_POSTIND\n");
|
||||
|
||||
|
||||
|
@ -6774,7 +6775,7 @@ TEMPLATE static u32 FASTCALL OP_LDMIB2()
|
|||
u32 start = cpu->R[REG_POS(i,16)];
|
||||
u32 * registres;
|
||||
TWaitState* waitState;
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_LDMIB2\n");
|
||||
|
||||
if(BIT15(i)==0)
|
||||
|
@ -6833,7 +6834,7 @@ TEMPLATE static u32 FASTCALL OP_LDMDA2()
|
|||
TWaitState* waitState;
|
||||
|
||||
u32 start = cpu->R[REG_POS(i,16)];
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_LDMDA2\n");
|
||||
|
||||
if(BIT15(i)==0)
|
||||
|
@ -6958,7 +6959,7 @@ TEMPLATE static u32 FASTCALL OP_LDMIA2_W()
|
|||
TWaitState* waitState;
|
||||
u32 tmp;
|
||||
Status_Reg SPSR;
|
||||
// execute = FALSE;
|
||||
// emu_halt();
|
||||
if(BIT15(i)==0)
|
||||
{
|
||||
if(cpu->CPSR.bits.mode==USR)
|
||||
|
@ -7073,7 +7074,7 @@ TEMPLATE static u32 FASTCALL OP_LDMDA2_W()
|
|||
u32 * registres;
|
||||
TWaitState * waitState;
|
||||
Status_Reg SPSR;
|
||||
// execute = FALSE;
|
||||
// emu_halt();
|
||||
if(BIT15(i)==0)
|
||||
{
|
||||
if(cpu->CPSR.bits.mode==USR)
|
||||
|
@ -7133,7 +7134,7 @@ TEMPLATE static u32 FASTCALL OP_LDMDB2_W()
|
|||
u32 * registres;
|
||||
TWaitState* waitState;
|
||||
Status_Reg SPSR;
|
||||
// execute = FALSE;
|
||||
// emu_halt();
|
||||
if(BIT15(i)==0)
|
||||
{
|
||||
if(cpu->CPSR.bits.mode==USR)
|
||||
|
@ -7352,7 +7353,7 @@ TEMPLATE static u32 FASTCALL OP_STMIA2()
|
|||
start = cpu->R[REG_POS(i,16)];
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_STMIA2\n");
|
||||
|
||||
for(b=0; b<16; ++b)
|
||||
|
@ -7383,7 +7384,7 @@ TEMPLATE static u32 FASTCALL OP_STMIB2()
|
|||
start = cpu->R[REG_POS(i,16)];
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_STMIB2\n");
|
||||
|
||||
for(b=0; b<16; ++b)
|
||||
|
@ -7414,7 +7415,7 @@ TEMPLATE static u32 FASTCALL OP_STMDA2()
|
|||
start = cpu->R[REG_POS(i,16)];
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_STMDA2\n");
|
||||
|
||||
for(b=0; b<16; ++b)
|
||||
|
@ -7473,7 +7474,7 @@ TEMPLATE static u32 FASTCALL OP_STMIA2_W()
|
|||
start = cpu->R[REG_POS(i,16)];
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_STMIA2_W\n");
|
||||
|
||||
for(b=0; b<16; ++b)
|
||||
|
@ -7533,7 +7534,7 @@ TEMPLATE static u32 FASTCALL OP_STMDA2_W()
|
|||
c = 0;
|
||||
start = cpu->R[REG_POS(i,16)];
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_STMDA2_W\n");
|
||||
|
||||
for(b=0; b<16; ++b)
|
||||
|
@ -7567,7 +7568,7 @@ TEMPLATE static u32 FASTCALL OP_STMDB2_W()
|
|||
start = cpu->R[REG_POS(i,16)];
|
||||
oldmode = armcpu_switchMode(cpu, SYS);
|
||||
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
LOG("Untested opcode: OP_STMDB2_W\n");
|
||||
|
||||
for(b=0; b<16; ++b)
|
||||
|
@ -7757,7 +7758,7 @@ TEMPLATE static u32 FASTCALL OP_MCR()
|
|||
|
||||
if(!cpu->coproc[cpnum])
|
||||
{
|
||||
execute = FALSE;
|
||||
emu_halt();
|
||||
LOG("Stopped (OP_MCR)\n");
|
||||
return 2;
|
||||
}
|
||||
|
@ -7776,7 +7777,7 @@ TEMPLATE static u32 FASTCALL OP_MRC()
|
|||
|
||||
if(!cpu->coproc[cpnum])
|
||||
{
|
||||
execute = FALSE;
|
||||
emu_halt();
|
||||
LOG("Stopped (OP_MRC)\n");
|
||||
return 2;
|
||||
}
|
||||
|
@ -7789,26 +7790,23 @@ TEMPLATE static u32 FASTCALL OP_MRC()
|
|||
//--------------SWI-------------------------------
|
||||
TEMPLATE static u32 FASTCALL OP_SWI()
|
||||
{
|
||||
if (((cpu->intVector != 0) ^ (PROCNUM == ARMCPU_ARM9)))
|
||||
{
|
||||
if(cpu->swi_tab) {
|
||||
u32 swinum = (cpu->instruction>>16)&0x1F;
|
||||
return cpu->swi_tab[swinum](cpu) + 3;
|
||||
} else {
|
||||
/* TODO (#1#): translocated SWI vectors */
|
||||
/* we use an irq thats not in the irq tab, as
|
||||
it was replaced duie to a changed intVector */
|
||||
Status_Reg tmp = cpu->CPSR;
|
||||
armcpu_switchMode(cpu, SVC); /* enter svc mode */
|
||||
cpu->R[14] = cpu->R[15] - 4; /* jump to swi Vector */
|
||||
cpu->R[14] = cpu->next_instruction;
|
||||
cpu->SPSR = tmp; /* save old CPSR as new SPSR */
|
||||
cpu->CPSR.bits.T = 0; /* handle as ARM32 code */
|
||||
cpu->CPSR.bits.I = cpu->SPSR.bits.I; /* keep int disable flag */
|
||||
cpu->R[15] = cpu->intVector + 0x08;
|
||||
cpu->CPSR.bits.I = 1;
|
||||
cpu->R[15] = cpu->intVector + 0x08;
|
||||
cpu->next_instruction = cpu->R[15];
|
||||
return 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
u32 swinum = (cpu->instruction>>16)&0x1F;
|
||||
return cpu->swi_tab[swinum](cpu) + 3;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------BKPT-------------------------
|
||||
|
|
|
@ -181,11 +181,6 @@ int armcpu_new( armcpu_t *armcpu, u32 id)
|
|||
{
|
||||
armcpu->proc_ID = id;
|
||||
|
||||
if(id==0)
|
||||
armcpu->swi_tab = ARM9_swi_tab;
|
||||
else
|
||||
armcpu->swi_tab = ARM7_swi_tab;
|
||||
|
||||
#ifdef GDB_STUB
|
||||
armcpu->mem_if = mem_if;
|
||||
|
||||
|
|
|
@ -212,7 +212,7 @@ static u32 intrWaitARM(armcpu_t * cpu)
|
|||
u32 intr;
|
||||
u32 intrFlag = 0;
|
||||
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
if(cpu->proc_ID)
|
||||
{
|
||||
intrFlagAdr = 0x380FFF8;
|
||||
|
@ -246,7 +246,7 @@ static u32 waitVBlankARM(armcpu_t * cpu)
|
|||
u32 intr;
|
||||
u32 intrFlag = 0;
|
||||
|
||||
//execute = FALSE;
|
||||
//emu_halt();
|
||||
if(cpu->proc_ID)
|
||||
{
|
||||
intrFlagAdr = 0x380FFF8;
|
||||
|
|
|
@ -624,23 +624,26 @@ static void SetVertex()
|
|||
break;
|
||||
}
|
||||
|
||||
if(completed) {
|
||||
if(completed)
|
||||
{
|
||||
POLY &poly = polylist->list[polylist->count];
|
||||
//todo - dont overrun proj list
|
||||
|
||||
//see if the last entry in the proj list matches the current matrix, if there is one.
|
||||
if(projlist->count != 0 &&
|
||||
//but as a speed hack, we consider the matrices different if the first element differs.
|
||||
//i think this should be good enough.
|
||||
!MatrixCompare(mtxCurrent[0],projlist->projMatrix[projlist->count-1])
|
||||
|
||||
// if compare only one value this is broke some games
|
||||
// zeromus check it please
|
||||
//here is an example of something that does not work.
|
||||
//(for a speed hack, we consider the matrices different if the first element differs)
|
||||
//mtxCurrent[0][0] == projlist->projMatrix[projlist->count-1][0]
|
||||
) {
|
||||
|
||||
//here is what we must do: make sure the matrices are identical
|
||||
!MatrixCompare(mtxCurrent[0],projlist->projMatrix[projlist->count-1])
|
||||
)
|
||||
{
|
||||
//it matches. use it
|
||||
poly.projIndex = projlist->count-1;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
MatrixCopy(projlist->projMatrix[projlist->count],mtxCurrent[0]);
|
||||
poly.projIndex = projlist->count;
|
||||
projlist->count++;
|
||||
|
@ -1150,7 +1153,7 @@ void gfx3d_FlushFIFO()
|
|||
}
|
||||
for (int i=0; i< gxFIFO.tail; i++)
|
||||
{
|
||||
cmd = gxFIFO.cmd[i];
|
||||
cmd = gxFIFO.cmd[i];
|
||||
param = gxFIFO.param[i];
|
||||
gfx3d_execute(cmd, param);
|
||||
}
|
||||
|
|
|
@ -127,7 +127,14 @@ void MatrixTranspose(float *matrix)
|
|||
|
||||
void MATRIXFASTCALL MatrixIdentity (float *matrix) //============== TODO
|
||||
{
|
||||
memset (matrix, 0, sizeof(float)*16);
|
||||
//memset (matrix, 0, sizeof(float)*16);
|
||||
//this is fastest for SSE2 i think.
|
||||
//study code generation and split into sse2 specific module later
|
||||
for(int i=0;i<16;i++)
|
||||
matrix[i] = 0.0f;
|
||||
//matrix[1] = matrix[2] = matrix[3] = matrix[4] = 0.0f;
|
||||
//matrix[6] = matrix[7] = matrix[8] = matrix[9] = 0.0f;
|
||||
//matrix[11] = matrix[12] = matrix[13] = matrix[14] = 0.0f;
|
||||
matrix[0] = matrix[5] = matrix[10] = matrix[15] = 1.f;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1019,7 +1019,7 @@ DWORD WINAPI run()
|
|||
if (frameAdvance)
|
||||
{
|
||||
frameAdvance = false;
|
||||
execute = FALSE;
|
||||
emu_halt();
|
||||
SPU_Pause(1);
|
||||
}
|
||||
frameCounter++;
|
||||
|
@ -1043,7 +1043,7 @@ void NDS_Pause()
|
|||
{
|
||||
if (!paused)
|
||||
{
|
||||
execute = FALSE;
|
||||
emu_halt();
|
||||
paused = TRUE;
|
||||
SPU_Pause(1);
|
||||
while (!paused) {}
|
||||
|
@ -1229,7 +1229,7 @@ int RegClass(WNDPROC Proc, LPCTSTR szName)
|
|||
static void ExitRunLoop()
|
||||
{
|
||||
finished = TRUE;
|
||||
execute = FALSE;
|
||||
emu_halt();
|
||||
}
|
||||
|
||||
int WINAPI WinMain (HINSTANCE hThisInstance,
|
||||
|
|
|
@ -101,6 +101,7 @@
|
|||
#define IDC_LANGENGLISH 210
|
||||
#define IDC_LANGFRENCH 211
|
||||
#define IDC_LANGDANISH 212
|
||||
#define IDM_DEFSIZE 213
|
||||
#define IDD_MEM_VIEWER 301
|
||||
#define IDC_8_BIT 302
|
||||
#define IDC_16_BIT 303
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
|
@ -2362,7 +2363,8 @@ END
|
|||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
|
|
Loading…
Reference in New Issue