[keel,nostalgia,studio,turbine] Cleanup structure of Turbine
This commit is contained in:
@@ -12,9 +12,10 @@ target_link_libraries(
|
||||
NostalgiaCore-GBA PUBLIC
|
||||
TeaGBA
|
||||
Keel
|
||||
Turbine
|
||||
)
|
||||
|
||||
if(TURBINE_BUILD_TYPE STREQUAL "GBA")
|
||||
set_source_files_properties(gfx.cpp PROPERTIES COMPILE_FLAGS -marm)
|
||||
target_link_libraries(NostalgiaCore PUBLIC NostalgiaCore-GBA)
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -15,8 +15,8 @@ struct GbaContext: public core::Context {
|
||||
explicit GbaContext(turbine::Context &tctx) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
auto const&rom() const noexcept {
|
||||
return *turbine::rom(turbineCtx);
|
||||
ox::MemFS const&rom() const noexcept {
|
||||
return static_cast<ox::MemFS const&>(*turbine::rom(turbineCtx));
|
||||
}
|
||||
|
||||
};
|
||||
|
@@ -142,7 +142,7 @@ ox::Error loadBgTileSheet(
|
||||
ox::FileAddress const&tilesheetAddr,
|
||||
ox::FileAddress const&paletteAddr) noexcept {
|
||||
auto &gctx = static_cast<GbaContext&>(ctx);
|
||||
auto &rom = static_cast<const ox::MemFS&>(gctx.rom());
|
||||
auto &rom = gctx.rom();
|
||||
return loadBgTileSheet(rom, cbb, tilesheetAddr, paletteAddr);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ ox::Error loadSpriteTileSheet(
|
||||
ox::FileAddress const&tilesheetAddr,
|
||||
ox::FileAddress const&paletteAddr) noexcept {
|
||||
auto &gctx = static_cast<GbaContext&>(ctx);
|
||||
auto &rom = static_cast<const ox::MemFS&>(gctx.rom());
|
||||
auto &rom = gctx.rom();
|
||||
oxRequire(tsStat, gctx.rom().stat(tilesheetAddr));
|
||||
oxRequire(ts, rom.directAccess(tilesheetAddr));
|
||||
GbaTileMapTarget target;
|
||||
@@ -169,7 +169,7 @@ ox::Error loadSpriteTileSheet(
|
||||
|
||||
ox::Error loadBgPalette(Context &ctx, unsigned, ox::FileAddress const&paletteAddr) noexcept {
|
||||
auto &gctx = static_cast<GbaContext&>(ctx);
|
||||
auto &rom = static_cast<const ox::MemFS&>(gctx.rom());
|
||||
auto &rom = gctx.rom();
|
||||
GbaPaletteTarget target;
|
||||
target.palette = MEM_BG_PALETTE;
|
||||
oxRequire(palStat, gctx.rom().stat(paletteAddr));
|
||||
@@ -180,7 +180,7 @@ ox::Error loadBgPalette(Context &ctx, unsigned, ox::FileAddress const&paletteAdd
|
||||
|
||||
ox::Error loadSpritePalette(Context &ctx, unsigned cbb, ox::FileAddress const&paletteAddr) noexcept {
|
||||
auto &gctx = static_cast<GbaContext&>(ctx);
|
||||
auto &rom = static_cast<const ox::MemFS&>(gctx.rom());
|
||||
auto &rom = gctx.rom();
|
||||
GbaPaletteTarget target;
|
||||
target.palette = &MEM_SPRITE_PALETTE[cbb];
|
||||
oxRequire(palStat, rom.stat(paletteAddr));
|
||||
|
Reference in New Issue
Block a user