Commit 261689d3 authored by StapleButter's avatar StapleButter
Browse files

'FIFO full' hack for SM64DS.

parent 97d76add
......@@ -841,8 +841,6 @@ void SubmitVertex()
int logflag = 0;
void CmdFIFOWrite(CmdFIFOEntry& entry)
{
if (CmdFIFO->IsEmpty() && !CmdPIPE->IsFull())
......@@ -853,10 +851,17 @@ void CmdFIFOWrite(CmdFIFOEntry& entry)
{
if (CmdFIFO->IsFull())
{
if (!logflag) printf("!!! GX FIFO FULL\n");
logflag = 1;
//NDS::debug(0);
return;
//printf("!!! GX FIFO FULL\n");
//return;
// temp. hack
// SM64DS seems to overflow the FIFO occasionally
// either leftover bugs in our implementation, or the game accidentally doing that
// TODO: investigate.
// TODO: implement this behavior properly (freezes the bus until the FIFO isn't full anymore)
while (CmdFIFO->IsFull())
ExecuteCommand();
}
CmdFIFO->Write(entry);
......@@ -878,8 +883,6 @@ CmdFIFOEntry CmdFIFORead()
CheckFIFOIRQ();
}
logflag = 0;
return ret;
}
......
......@@ -56,6 +56,8 @@ bool Init();
void DeInit();
void Reset();
void ExecuteCommand();
void Run(s32 cycles);
void CheckFIFOIRQ();
void CheckFIFODMA();
......
......@@ -311,7 +311,7 @@ void Reset()
// test
//LoadROM();
//LoadFirmware();
if (NDSCart::LoadROM("rom/nsmb.nds"))
if (NDSCart::LoadROM("rom/sm64ds.nds"))
Running = true; // hax
}
......
......@@ -146,7 +146,7 @@
"NDS.h"
"NDSCart.h"
1487287868 c:\documents\sources\melonds\gpu3d.h
1487356069 c:\documents\sources\melonds\gpu3d.h
1487354054 source:c:\documents\sources\melonds\gpu3d.cpp
<stdio.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment