From 87968a87f0309936f95c80f3636b3599aee1cc18 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 11 Feb 2020 21:47:48 -0600 Subject: [PATCH] [nostalgia/core/gba] Fix memory range --- src/nostalgia/core/gba/addresses.hpp | 2 +- src/nostalgia/core/gba/media.cpp | 2 +- src/nostalgia/core/gba/tests.cpp | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/nostalgia/core/gba/addresses.hpp b/src/nostalgia/core/gba/addresses.hpp index 6cf22c39..e126cec3 100644 --- a/src/nostalgia/core/gba/addresses.hpp +++ b/src/nostalgia/core/gba/addresses.hpp @@ -45,7 +45,7 @@ typedef uint16_t BgMapTile[1024]; #define MEM_BG_MAP reinterpret_cast(0x06000000) -#define MEM_ROM *reinterpret_cast(0x08000000) +#define MEM_ROM reinterpret_cast(0x08000000) #define MEM_WRAM_BEGIN reinterpret_cast(0x02000000) #define MEM_WRAM_END reinterpret_cast(0x0203FFFF) diff --git a/src/nostalgia/core/gba/media.cpp b/src/nostalgia/core/gba/media.cpp index 0719af06..c8e50db6 100644 --- a/src/nostalgia/core/gba/media.cpp +++ b/src/nostalgia/core/gba/media.cpp @@ -23,7 +23,7 @@ char *loadRom(const char*) { constexpr auto headerP2Len = 16; constexpr auto headerLen = headerP1Len + headerP2Len + 1; - for (auto current = &MEM_ROM; current < reinterpret_cast(0x0a000000); current += headerLen) { + for (auto current = MEM_ROM; current < reinterpret_cast(0x0a000000); current += headerLen) { if (ox_memcmp(current, headerP1, headerP1Len) == 0 && ox_memcmp(current + headerP1Len, headerP2, headerP2Len) == 0) { return current + headerLen; diff --git a/src/nostalgia/core/gba/tests.cpp b/src/nostalgia/core/gba/tests.cpp index bd0e4ff1..3d45eff9 100644 --- a/src/nostalgia/core/gba/tests.cpp +++ b/src/nostalgia/core/gba/tests.cpp @@ -13,10 +13,6 @@ namespace nostalgia::core { void free(void *ptr); -void panic(const char *msg) { - oxPanic(msg, OxError(1)); -} - void initHeap(char *heapBegin, char *heapEnd); }