diff --git a/src/nostalgia/core/gba/media.cpp b/src/nostalgia/core/gba/media.cpp index e39680e7..0719af06 100644 --- a/src/nostalgia/core/gba/media.cpp +++ b/src/nostalgia/core/gba/media.cpp @@ -14,7 +14,7 @@ namespace nostalgia::core { -uint8_t *loadRom(const char*) { +char *loadRom(const char*) { // put the header in the wrong order to prevent mistaking this code for the // media section constexpr auto headerP2 = "_HEADER_________"; @@ -23,7 +23,7 @@ uint8_t *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; @@ -32,7 +32,7 @@ uint8_t *loadRom(const char*) { return nullptr; } -void unloadRom(uint8_t*) { +void unloadRom(char*) { } } diff --git a/src/nostalgia/core/media.hpp b/src/nostalgia/core/media.hpp index d1502fbf..06bac96d 100644 --- a/src/nostalgia/core/media.hpp +++ b/src/nostalgia/core/media.hpp @@ -12,8 +12,8 @@ namespace nostalgia::core { -uint8_t *loadRom(const char *path = ""); +char *loadRom(const char *path = ""); -void unloadRom(uint8_t*); +void unloadRom(char*); } diff --git a/src/nostalgia/core/userland/media.cpp b/src/nostalgia/core/userland/media.cpp index edd7a03a..888dc65b 100644 --- a/src/nostalgia/core/userland/media.cpp +++ b/src/nostalgia/core/userland/media.cpp @@ -14,7 +14,7 @@ namespace nostalgia::core { -uint8_t *loadRom(const char *path) { +char *loadRom(const char *path) { std::ifstream file(path, std::ios::binary | std::ios::ate); if (!file.good()) { oxTrace("nostalgia::core::userland::loadRom") << "Read failed:" << path; @@ -23,12 +23,12 @@ uint8_t *loadRom(const char *path) { const std::size_t size = file.tellg(); file.seekg(0, std::ios::beg); - auto buff = new uint8_t[size]; - file.read(reinterpret_cast(buff), size); + auto buff = new char[size]; + file.read(buff, size); return buff; } -void unloadRom(uint8_t *rom) { +void unloadRom(char *rom) { delete rom; } diff --git a/src/nostalgia/player/main.cpp b/src/nostalgia/player/main.cpp index 474ab923..d5ff48ed 100644 --- a/src/nostalgia/player/main.cpp +++ b/src/nostalgia/player/main.cpp @@ -29,7 +29,7 @@ ox::Error run(ox::FileSystem *fs) { int main(int argc, const char **argv) { if (argc > 1) { ox::FileSystem *fs = nullptr; - uint8_t *rom = nullptr; + char *rom = nullptr; auto path = argv[1]; const auto lastDot = ox_lastIndexOf(path, '.'); const auto fsExt = lastDot != -1 ? path + lastDot : "";