diff --git a/src/nostalgia/core/context.hpp b/src/nostalgia/core/context.hpp index 5aa60ef5..82d0dac9 100644 --- a/src/nostalgia/core/context.hpp +++ b/src/nostalgia/core/context.hpp @@ -26,6 +26,7 @@ class Context { Context(const Context &other) noexcept = delete; Context(const Context &&other) noexcept = delete; + [[nodiscard]] const auto &rom() const noexcept { return *turbineCtx->rom; } diff --git a/src/nostalgia/core/gba/gfx.cpp b/src/nostalgia/core/gba/gfx.cpp index e49893b3..a7937241 100644 --- a/src/nostalgia/core/gba/gfx.cpp +++ b/src/nostalgia/core/gba/gfx.cpp @@ -104,8 +104,8 @@ ox::Error initConsole(Context *ctx) noexcept { if (!ctx) { ctx = new(ox_alloca(sizeof(Context))) Context; oxRequire(rom, keel::loadRom()); - ox::FileStore32 fs(rom, 32 * ox::units::MB); - auto romFs = new(ox_alloca(sizeof(ox::FileSystem32))) ox::FileSystem32(fs); + auto romFs = new(ox_alloca(sizeof(ox::FileSystem32))) + ox::FileSystem32(ox::FileStore32(rom, 32 * ox::units::MB)); oxRequireM(tctx, turbine::init(ox::UPtr<ox::FileSystem>(romFs), "")); ctx->turbineCtx = tctx.release(); oxReturnError(loadBgTileSheet(ctx, 0, TilesheetAddr, PaletteAddr));