summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Cox <garrettjcox@gmail.com>2025-05-20 00:06:23 -0500
committerGitHub <noreply@github.com>2025-05-20 00:06:23 -0500
commit008b0dfd0ce18e01ec03b3552598714dd6bf4c69 (patch)
tree3eecabc28c756e05d2065d94ca0dffead018061e
parent4425ae363ad7079ed3ccadf37b5758f7425e5053 (diff)
Fix goron dust particles not spawning by seeding gIrqMgrRetraceTime & gRDPTimeTotal (#1160)
-rw-r--r--mm/2s2h/BenPort.cpp4
-rw-r--r--mm/src/code/graph.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/mm/2s2h/BenPort.cpp b/mm/2s2h/BenPort.cpp
index e872eba98..ca183ea61 100644
--- a/mm/2s2h/BenPort.cpp
+++ b/mm/2s2h/BenPort.cpp
@@ -732,6 +732,10 @@ extern "C" void InitOTR() {
OTRAudio_Init();
OTRExtScanner();
+ // Just came up with arbitrary numbers that seemed to work, this is
+ // usually set once(?) in currently stubbed out areas of code.
+ gIrqMgrRetraceTime = Ship_Random(700000, 850000);
+
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnFileDropped>(Ben_ProcessDroppedFiles);
time_t now = time(NULL);
diff --git a/mm/src/code/graph.c b/mm/src/code/graph.c
index f6972f151..ca9303ea1 100644
--- a/mm/src/code/graph.c
+++ b/mm/src/code/graph.c
@@ -336,10 +336,15 @@ void Graph_ExecuteAndDraw(GraphicsContext* gfxCtx, GameState* gameState) {
gRSPGfxTimeTotal = gRSPGfxTimeAcc;
gRSPAudioTimeTotal = gRSPAudioTimeAcc;
- gRDPTimeTotal = gRDPTimeAcc;
+ // #region @2S2H [Port] gRDPTimeAcc is usually set in Sched_HandleRDPDone, which
+ // is currently never called and stubbed out in the port. For now we're
+ // just opting to set this to the time per frame / 10 instead, no idea
+ // how bad of an idea this is. :)
+ gRDPTimeTotal = (time - gRDPTimeAcc) / 10;
gRSPGfxTimeAcc = 0;
gRSPAudioTimeAcc = 0;
- gRDPTimeAcc = 0;
+ gRDPTimeAcc = time;
+ // #endregion
if (sGraphPrevUpdateEndTime != 0) {
gGraphUpdatePeriod = time - sGraphPrevUpdateEndTime;