From 1aceeebd5d0603ee7504620e843d8c5b1c04416e Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 27 Jan 2023 00:01:14 -0600 Subject: [PATCH] [nostalgia/core/gba] Update for Ox FS changes --- src/nostalgia/core/gba/gfx.cpp | 12 ++++++------ src/nostalgia/core/gba/media.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/nostalgia/core/gba/gfx.cpp b/src/nostalgia/core/gba/gfx.cpp index f0fff621..522e8aeb 100644 --- a/src/nostalgia/core/gba/gfx.cpp +++ b/src/nostalgia/core/gba/gfx.cpp @@ -151,7 +151,7 @@ ox::Error loadBgTileSheet(Context *ctx, const ox::FileAddress &tilesheetAddr, const ox::FileAddress &paletteAddr) noexcept { oxRequire(tsStat, ctx->rom->stat(tilesheetAddr)); - oxRequire(ts, ctx->rom->directAccess(tilesheetAddr)); + oxRequire(ts, static_cast(ctx->rom.get())->directAccess(tilesheetAddr)); GbaTileMapTarget target; target.pal.palette = MEM_BG_PALETTE; target.cbbData = &g_cbbData[cbb]; @@ -160,7 +160,7 @@ ox::Error loadBgTileSheet(Context *ctx, // load external palette if available if (paletteAddr) { oxRequire(palStat, ctx->rom->stat(paletteAddr)); - oxRequire(pal, ctx->rom->directAccess(paletteAddr)); + oxRequire(pal, static_cast(ctx->rom.get())->directAccess(paletteAddr)); oxReturnError(ox::readMC(pal, palStat.size, &target.pal)); } // update bpp of all bgs with the updated cbb @@ -177,7 +177,7 @@ ox::Error loadSpriteTileSheet(Context *ctx, const ox::FileAddress &tilesheetAddr, const ox::FileAddress &paletteAddr) noexcept { oxRequire(tsStat, ctx->rom->stat(tilesheetAddr)); - oxRequire(ts, ctx->rom->directAccess(tilesheetAddr)); + oxRequire(ts, static_cast(ctx->rom.get())->directAccess(tilesheetAddr)); GbaTileMapTarget target; target.pal.palette = MEM_SPRITE_PALETTE; target.tileMap = MEM_SPRITE_TILES; @@ -185,7 +185,7 @@ ox::Error loadSpriteTileSheet(Context *ctx, // load external palette if available if (paletteAddr) { oxRequire(palStat, ctx->rom->stat(paletteAddr)); - oxRequire(pal, ctx->rom->directAccess(paletteAddr)); + oxRequire(pal, static_cast(ctx->rom.get())->directAccess(paletteAddr)); oxReturnError(ox::readMC(pal, palStat.size, &target.pal)); } return {}; @@ -195,7 +195,7 @@ ox::Error loadBgPalette(Context *ctx, unsigned, const ox::FileAddress &paletteAd GbaPaletteTarget target; target.palette = MEM_BG_PALETTE; oxRequire(palStat, ctx->rom->stat(paletteAddr)); - oxRequire(pal, ctx->rom->directAccess(paletteAddr)); + oxRequire(pal, static_cast(ctx->rom.get())->directAccess(paletteAddr)); oxReturnError(ox::readMC(pal, palStat.size, &target)); return {}; } @@ -204,7 +204,7 @@ ox::Error loadSpritePalette(Context *ctx, unsigned cbb, const ox::FileAddress &p GbaPaletteTarget target; target.palette = &MEM_SPRITE_PALETTE[cbb]; oxRequire(palStat, ctx->rom->stat(paletteAddr)); - oxRequire(pal, ctx->rom->directAccess(paletteAddr)); + oxRequire(pal, static_cast(ctx->rom.get())->directAccess(paletteAddr)); oxReturnError(ox::readMC(pal, palStat.size, &target)); return {}; } diff --git a/src/nostalgia/core/gba/media.cpp b/src/nostalgia/core/gba/media.cpp index 4fecd0a5..6efaa922 100644 --- a/src/nostalgia/core/gba/media.cpp +++ b/src/nostalgia/core/gba/media.cpp @@ -33,7 +33,7 @@ void unloadRom(char*) noexcept { ox::Result getPreloadAddr(Context *ctx, ox::CRStringView path) noexcept { oxRequire(stat, ctx->rom->stat(path)); - oxRequire(buff, ctx->rom->directAccess(path)); + oxRequire(buff, static_cast(ctx->rom.get())->directAccess(path)); PreloadPtr p; oxReturnError(ox::readMC(buff, stat.size, &p)); return p.preloadAddr + ctx->preloadSectionOffset; @@ -41,7 +41,7 @@ ox::Result getPreloadAddr(Context *ctx, ox::CRStringView path) noex ox::Result getPreloadAddr(Context *ctx, const ox::FileAddress &file) noexcept { oxRequire(stat, ctx->rom->stat(file)); - oxRequire(buff, ctx->rom->directAccess(file)); + oxRequire(buff, static_cast(ctx->rom.get())->directAccess(file)); PreloadPtr p; oxReturnError(ox::readMC(buff, stat.size, &p)); return p.preloadAddr + ctx->preloadSectionOffset;