[nostalgia,turbine] Make GBA files (other than ARM asm) build on all platforms
This commit is contained in:
@ -3,9 +3,8 @@ add_library(
|
||||
event.cpp
|
||||
)
|
||||
|
||||
if(TURBINE_BUILD_TYPE STREQUAL "GBA")
|
||||
add_subdirectory(gba)
|
||||
else()
|
||||
add_subdirectory(gba)
|
||||
if(NOT TURBINE_BUILD_TYPE STREQUAL "GBA")
|
||||
add_subdirectory(glfw)
|
||||
endif()
|
||||
|
||||
|
@ -1,16 +1,33 @@
|
||||
enable_language(CXX ASM)
|
||||
set_source_files_properties(turbine.arm.cpp irq.arm.cpp PROPERTIES COMPILE_FLAGS -marm)
|
||||
if(TURBINE_BUILD_TYPE STREQUAL "GBA")
|
||||
enable_language(CXX ASM)
|
||||
endif()
|
||||
|
||||
add_library(Turbine-GBA OBJECT)
|
||||
target_sources(
|
||||
Turbine PRIVATE
|
||||
Turbine-GBA PRIVATE
|
||||
clipboard.cpp
|
||||
gfx.cpp
|
||||
irq.arm.cpp
|
||||
irq.s
|
||||
turbine.arm.cpp
|
||||
turbine.cpp
|
||||
)
|
||||
|
||||
if(TURBINE_BUILD_TYPE STREQUAL "GBA")
|
||||
set_source_files_properties(turbine.arm.cpp irq.arm.cpp PROPERTIES COMPILE_FLAGS -marm)
|
||||
target_sources(
|
||||
Turbine-GBA PRIVATE
|
||||
irq.s
|
||||
)
|
||||
target_link_libraries(Turbine PUBLIC Turbine-GBA)
|
||||
else()
|
||||
target_sources(
|
||||
Turbine-GBA PRIVATE
|
||||
irqstub.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(
|
||||
Turbine PUBLIC
|
||||
Turbine-GBA PUBLIC
|
||||
TeaGBA
|
||||
Keel
|
||||
)
|
||||
|
8
src/turbine/gba/irqstub.cpp
Normal file
8
src/turbine/gba/irqstub.cpp
Normal file
@ -0,0 +1,8 @@
|
||||
/*
|
||||
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||
*/
|
||||
|
||||
// stub for building TeaGBA for PC targets, for purposes of not having to
|
||||
// switch back and forth between builds when editing GBA files
|
||||
|
||||
extern "C" void turbine_isr() {}
|
@ -36,6 +36,7 @@ static void initTimer() noexcept {
|
||||
REG_IE = REG_IE | teagba::Int_timer0;
|
||||
}
|
||||
|
||||
[[maybe_unused]]
|
||||
static ox::Result<std::size_t> findPreloadSection() noexcept {
|
||||
// put the header in the wrong order to prevent mistaking this code for the
|
||||
// media section
|
||||
@ -55,7 +56,9 @@ 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));
|
||||
#ifdef OX_BARE_METAL
|
||||
oxReturnError(findPreloadSection().moveTo(&ctx->preloadSectionOffset));
|
||||
#endif
|
||||
oxReturnError(initGfx(*ctx));
|
||||
initTimer();
|
||||
initIrq();
|
||||
|
Reference in New Issue
Block a user