From 614f3088eeead11ed1de4cd9a025ac9082971b22 Mon Sep 17 00:00:00 2001 From: Zak Larue-Buckley Date: Fri, 13 Dec 2019 20:45:37 +0000 Subject: [PATCH] Fix demo loop crash. --- source/d_main.c | 78 +++++++++++++++++----------------------- source/doom_iwad.c | 2 +- source/r_hotpath.iwram.c | 3 -- 3 files changed, 34 insertions(+), 49 deletions(-) diff --git a/source/d_main.c b/source/d_main.c index 0a548b4..cfa95c2 100644 --- a/source/d_main.c +++ b/source/d_main.c @@ -354,69 +354,57 @@ static struct } const demostates[][4] = - { +{ { - {D_DrawTitle1, "TITLEPIC"}, - {D_DrawTitle1, "TITLEPIC"}, - {D_DrawTitle2, "TITLEPIC"}, - {D_DrawTitle1, "TITLEPIC"}, + {D_DrawTitle1, "TITLEPIC"}, + {D_DrawTitle1, "TITLEPIC"}, + {D_DrawTitle2, "TITLEPIC"}, + {D_DrawTitle1, "TITLEPIC"}, }, { - {G_DeferedPlayDemo, "demo1"}, - {G_DeferedPlayDemo, "demo1"}, - {G_DeferedPlayDemo, "demo1"}, - {G_DeferedPlayDemo, "demo1"}, + {G_DeferedPlayDemo, "demo1"}, + {G_DeferedPlayDemo, "demo1"}, + {G_DeferedPlayDemo, "demo1"}, + {G_DeferedPlayDemo, "demo1"}, }, { - {D_SetPageName, NULL}, - {D_SetPageName, NULL}, - {D_SetPageName, NULL}, - {D_SetPageName, NULL}, + {D_SetPageName, "TITLEPIC"}, + {D_SetPageName, "TITLEPIC"}, + {D_SetPageName, "TITLEPIC"}, + {D_SetPageName, "TITLEPIC"}, }, { - {G_DeferedPlayDemo, "demo2"}, - {G_DeferedPlayDemo, "demo2"}, - {G_DeferedPlayDemo, "demo2"}, - {G_DeferedPlayDemo, "demo2"}, + {G_DeferedPlayDemo, "demo2"}, + {G_DeferedPlayDemo, "demo2"}, + {G_DeferedPlayDemo, "demo2"}, + {G_DeferedPlayDemo, "demo2"}, }, { - {D_SetPageName, "HELP2"}, - {D_SetPageName, "HELP2"}, - {D_SetPageName, "CREDIT"}, - {D_DrawTitle1, "TITLEPIC"}, + {D_SetPageName, "TITLEPIC"}, + {D_SetPageName, "TITLEPIC"}, + {D_SetPageName, "TITLEPIC"}, + {D_SetPageName, "TITLEPIC"}, }, { - {G_DeferedPlayDemo, "demo3"}, - {G_DeferedPlayDemo, "demo3"}, - {G_DeferedPlayDemo, "demo3"}, - {G_DeferedPlayDemo, "demo3"}, + {G_DeferedPlayDemo, "demo3"}, + {G_DeferedPlayDemo, "demo3"}, + {G_DeferedPlayDemo, "demo3"}, + {G_DeferedPlayDemo, "demo3"}, }, { - {NULL}, - {NULL}, - {NULL}, - {D_SetPageName, "CREDIT"}, - }, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + {NULL, NULL}, + } - { - {NULL}, - {NULL}, - {NULL}, - {G_DeferedPlayDemo, "demo4"}, - }, - { - {NULL}, - {NULL}, - {NULL}, - {NULL}, - } - }; +}; /* * This cycles through the demo sequences. @@ -435,8 +423,8 @@ void D_DoAdvanceDemo(void) if (!demostates[++_g->demosequence][_g->gamemode].func) _g->demosequence = 0; - demostates[_g->demosequence][_g->gamemode].func - (demostates[_g->demosequence][_g->gamemode].name); + + demostates[_g->demosequence][_g->gamemode].func(demostates[_g->demosequence][_g->gamemode].name); } // diff --git a/source/doom_iwad.c b/source/doom_iwad.c index 09a4fad..fa6f94f 100644 --- a/source/doom_iwad.c +++ b/source/doom_iwad.c @@ -1,4 +1,4 @@ -#include "iwad/doom1.gba.h" +#include "iwad/doomu.gba.h" #include "doom_iwad.h" diff --git a/source/r_hotpath.iwram.c b/source/r_hotpath.iwram.c index 7367f27..d6cdeb8 100644 --- a/source/r_hotpath.iwram.c +++ b/source/r_hotpath.iwram.c @@ -1602,9 +1602,6 @@ static void R_DrawColumnInCache(const column_t* patch, byte* cache, int originy, #define CACHE_ENTRY(c, t) ((c << 16 | t)) #define CACHE_HASH(c, t) (((c >> 4) ^ t) & CACHE_KEY_MASK) -#define CACHE_HASH2(c, t) ((((unsigned int)t | (unsigned int)c << 16)*2654435761u) & CACHE_KEY_MASK) - - static unsigned int FindColumnCacheItem(unsigned int texture, unsigned int column) { //static unsigned int looks, peeks;