- add experimental control of bus (fix games with "--FIFO FULL--" message) - a HACK!!!
This commit is contained in:
parent
cfb5940ea8
commit
ef767f03c3
|
@ -2973,6 +2973,9 @@ void FASTCALL _MMU_ARM9_write32(u32 adr, u32 val)
|
|||
case 0x40005A:
|
||||
case 0x40005B:
|
||||
case 0x40005C: // Individual Commands
|
||||
if (gxFIFO.size > 254)
|
||||
nds.freezeBus = TRUE;
|
||||
|
||||
((u32 *)(MMU.MMU_MEM[ARMCPU_ARM9][0x40]))[(adr & 0xFFF) >> 2] = val;
|
||||
gfx3d_sendCommand(adr, val);
|
||||
return;
|
||||
|
|
|
@ -1190,6 +1190,8 @@ template<int procnum, int chan> struct TSequenceItem_DMA : public TSequenceItem
|
|||
{
|
||||
IF_DEVELOPER(DEBUG_statistics.sequencerExecutionCounters[5+procnum*4+chan]++);
|
||||
|
||||
//if (nds.freezeBus) return;
|
||||
|
||||
//printf("exec from TSequenceItem_DMA: %d %d\n",procnum,chan);
|
||||
controller->exec();
|
||||
// //give gxfifo dmas a chance to re-trigger
|
||||
|
@ -1847,7 +1849,7 @@ static /*donotinline*/ std::pair<s32,s32> armInnerLoop(
|
|||
{
|
||||
if(doarm9 && (!doarm7 || arm9 <= timer))
|
||||
{
|
||||
if(!NDS_ARM9.waitIRQ)
|
||||
if(!NDS_ARM9.waitIRQ&&!nds.freezeBus)
|
||||
{
|
||||
arm9log();
|
||||
arm9 += armcpu_exec<ARMCPU_ARM9>();
|
||||
|
@ -1860,11 +1862,12 @@ static /*donotinline*/ std::pair<s32,s32> armInnerLoop(
|
|||
s32 temp = arm9;
|
||||
arm9 = min(s32next, arm9 + kIrqWait);
|
||||
nds.idleCycles += arm9-temp;
|
||||
if (gxFIFO.size < 255) nds.freezeBus = FALSE;
|
||||
}
|
||||
}
|
||||
if(doarm7 && (!doarm9 || arm7 <= timer))
|
||||
{
|
||||
if(!NDS_ARM7.waitIRQ)
|
||||
if(!NDS_ARM7.waitIRQ&&!nds.freezeBus)
|
||||
{
|
||||
arm7log();
|
||||
arm7 += (armcpu_exec<ARMCPU_ARM7>()<<1);
|
||||
|
@ -2080,6 +2083,7 @@ void NDS_Reset()
|
|||
|
||||
nds.sleeping = FALSE;
|
||||
nds.cardEjected = FALSE;
|
||||
nds.freezeBus = FALSE;
|
||||
nds.power1.lcd = nds.power1.gpuMain = nds.power1.gfx3d_render = nds.power1.gfx3d_geometry = nds.power1.gpuSub = nds.power1.dispswap = 1;
|
||||
nds.power2.speakers = 1;
|
||||
nds.power2.wifi = 0;
|
||||
|
|
|
@ -180,6 +180,7 @@ struct NDSSystem
|
|||
|
||||
BOOL sleeping;
|
||||
BOOL cardEjected;
|
||||
BOOL freezeBus;
|
||||
|
||||
//this is not essential NDS runtime state.
|
||||
//it was perhaps a mistake to put it here.
|
||||
|
|
|
@ -172,6 +172,7 @@ SFORMAT SF_NDS[]={
|
|||
{ "_ENH", 4, 1, &nds.ensataHandshake},
|
||||
{ "_ENI", 4, 1, &nds.ensataIpcSyncCounter},
|
||||
{ "_SLP", 4, 1, &nds.sleeping},
|
||||
{ "_FBS", 4, 1, &nds.freezeBus},
|
||||
{ "_CEJ", 4, 1, &nds.cardEjected},
|
||||
{ "_P00", 1, 1, &nds.power1.lcd},
|
||||
{ "_P01", 1, 1, &nds.power1.gpuMain},
|
||||
|
|
Loading…
Reference in New Issue