aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-02-17 19:34:41 +0100
committerStapleButter <thetotalworm@gmail.com>2017-02-17 19:34:41 +0100
commit261689d3d123df541bb201babfa06a02861e2aaa (patch)
tree4cbe6fbeb86c45874c9ad20e8f2f793984221d0e
parent97d76addd9c876a3438e8af1f83acc8bd20be70a (diff)
'FIFO full' hack for SM64DS.
-rw-r--r--GPU3D.cpp19
-rw-r--r--GPU3D.h2
-rw-r--r--NDS.cpp2
-rw-r--r--melonDS.depend2
4 files changed, 15 insertions, 10 deletions
diff --git a/GPU3D.cpp b/GPU3D.cpp
index de860f2..e38f7c2 100644
--- a/GPU3D.cpp
+++ b/GPU3D.cpp
@@ -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;
}
diff --git a/GPU3D.h b/GPU3D.h
index cbb8234..c95e3b7 100644
--- a/GPU3D.h
+++ b/GPU3D.h
@@ -56,6 +56,8 @@ bool Init();
void DeInit();
void Reset();
+void ExecuteCommand();
+
void Run(s32 cycles);
void CheckFIFOIRQ();
void CheckFIFODMA();
diff --git a/NDS.cpp b/NDS.cpp
index 182abe1..63013ab 100644
--- a/NDS.cpp
+++ b/NDS.cpp
@@ -311,7 +311,7 @@ void Reset()
// test
//LoadROM();
//LoadFirmware();
- if (NDSCart::LoadROM("rom/nsmb.nds"))
+ if (NDSCart::LoadROM("rom/sm64ds.nds"))
Running = true; // hax
}
diff --git a/melonDS.depend b/melonDS.depend
index bdce235..e0cd1ce 100644
--- a/melonDS.depend
+++ b/melonDS.depend
@@ -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>