[keel,nostalgia,studio,turbine] Make turbine::Context have a keel::Context instead of being one

This commit is contained in:
2023-06-20 00:56:55 -05:00
parent d4eaade326
commit c5233e0d1d
24 changed files with 134 additions and 79 deletions

View File

@@ -1,7 +1,3 @@
if(TURBINE_BUILD_TYPE STREQUAL "GBA")
enable_language(CXX ASM)
endif()
add_library(Turbine-GBA OBJECT)
target_sources(
Turbine-GBA PRIVATE
@@ -13,6 +9,7 @@ target_sources(
)
if(TURBINE_BUILD_TYPE STREQUAL "GBA")
enable_language(ASM)
set_source_files_properties(turbine.arm.cpp irq.arm.cpp PROPERTIES COMPILE_FLAGS -marm)
target_sources(
Turbine-GBA PRIVATE

View File

@@ -39,4 +39,12 @@ ox::Size getScreenSize(Context&) noexcept {
return {240, 160};
}
ox::Bounds getWindowBounds(Context&) noexcept {
return {0, 0, 240, 160};
}
ox::Error setWindowBounds(Context&, const ox::Bounds&) noexcept {
return OxError(1, "setWindowBounds not supported on GBA");
}
}

View File

@@ -55,9 +55,10 @@ static ox::Result<std::size_t> findPreloadSection() noexcept {
}
ox::Result<ox::UniquePtr<turbine::Context>> init(ox::UPtr<ox::FileSystem> fs, ox::CRStringView appName) noexcept {
oxRequireM(ctx, keel::init<gba::Context>(std::move(fs), appName));
auto ctx = ox::make_unique<gba::Context>();
oxReturnError(keel::init(&ctx->keelCtx, std::move(fs), appName));
#ifdef OX_BARE_METAL
oxReturnError(findPreloadSection().moveTo(&ctx->preloadSectionOffset));
oxReturnError(findPreloadSection().moveTo(&ctx->keelCtx.preloadSectionOffset));
#endif
oxReturnError(initGfx(*ctx));
initTimer();