RISC OS port

This commit is contained in:
Cameron Cawley 2020-10-20 17:33:36 +01:00
parent 131a8decc0
commit 44544a65d2
7 changed files with 35 additions and 4 deletions

7
.gitignore vendored
View file

@ -2,7 +2,7 @@
/obj /obj
# Exclude the (recommended) CMake build directory # Exclude the (recommended) CMake build directory
/build /build*
# Exclude executables # Exclude executables
/game_english/CSE2_debug.exe /game_english/CSE2_debug.exe
@ -15,6 +15,7 @@
/game_english/DoConfig /game_english/DoConfig
/game_english/CSE2_debug.rpx /game_english/CSE2_debug.rpx
/game_english/CSE2.rpx /game_english/CSE2.rpx
/game_english/\!CSE2
/game_japanese/CSE2_debug.exe /game_japanese/CSE2_debug.exe
/game_japanese/DoConfig_debug.exe /game_japanese/DoConfig_debug.exe
/game_japanese/CSE2.exe /game_japanese/CSE2.exe
@ -25,6 +26,7 @@
/game_japanese/DoConfig /game_japanese/DoConfig
/game_japanese/CSE2_debug.rpx /game_japanese/CSE2_debug.rpx
/game_japanese/CSE2.rpx /game_japanese/CSE2.rpx
/game_japanese/\!CSE2
# Exclude MSVC debug data # Exclude MSVC debug data
/game_english/CSE2_debug.ilk /game_english/CSE2_debug.ilk
@ -97,8 +99,5 @@
# Portable branch # # Portable branch #
################### ###################
# Exclude Wii U build directory
/buildwiiu
# Exclude converted resource files # Exclude converted resource files
/src/Resource /src/Resource

View file

@ -775,3 +775,7 @@ if(DOCONFIG)
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${BUILD_DIRECTORY} RUNTIME_OUTPUT_DIRECTORY_DEBUG ${BUILD_DIRECTORY}
) )
endif() endif()
if(RISCOS)
include(RISCOSApp)
endif()

2
assets/riscos/!Boot,feb Normal file
View file

@ -0,0 +1,2 @@
Set CSE2$Dir <Obey$Dir>
IconSprites <CSE2$Dir>.!Sprites

2
assets/riscos/!Run,feb Normal file
View file

@ -0,0 +1,2 @@
Set CSE2$Dir <Obey$Dir>
Run <CSE2$Dir>.CSE2 ><CSE2$Dir>.Log 2>&1

BIN
assets/riscos/!Sprites,ff9 Normal file

Binary file not shown.

22
cmake/RISCOSApp.cmake Normal file
View file

@ -0,0 +1,22 @@
# Use the following commands to build for RISC OS:
# cmake -B build-riscos -DCMAKE_BUILD_TYPE=Release -DBACKEND_PLATFORM=SDL1 -DBACKEND_RENDERER=Software -DBACKEND_AUDIO=SDL1 -DDOCONFIG=OFF -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake -DRISCOS=ON -DPKG_CONFIG_STATIC_LIBS=ON
# cmake --build build-riscos
# (cd game_english && $GCCSDK_INSTALL_ENV/bin/zip -,9r cse2-riscos.zip \!CSE2)
function(elf_to_aif)
cmake_parse_arguments(ELFTOAIF "" "TARGET;OUTPUT" "" ${ARGN})
get_filename_component(ELFTOAIF_OUTPUT_DIR "${ELFTOAIF_OUTPUT}" DIRECTORY)
add_custom_command(OUTPUT "${ELFTOAIF_OUTPUT}"
COMMAND ${CMAKE_COMMAND} -E make_directory ${ELFTOAIF_OUTPUT_DIR}
COMMAND elf2aif $<TARGET_FILE:${ELFTOAIF_TARGET}> ${ELFTOAIF_OUTPUT}
DEPENDS ${ELFTOAIF_TARGET})
add_custom_target(${ELFTOAIF_TARGET}-aif ALL DEPENDS ${ELFTOAIF_OUTPUT})
endfunction(elf_to_aif)
elf_to_aif(TARGET CSE2 OUTPUT ${BUILD_DIRECTORY}/!CSE2/CSE2,ff8)
configure_file(${ASSETS_DIRECTORY}/riscos/!Boot,feb ${BUILD_DIRECTORY}/!CSE2/!Boot,feb COPYONLY)
configure_file(${ASSETS_DIRECTORY}/riscos/!Run,feb ${BUILD_DIRECTORY}/!CSE2/!Run,feb COPYONLY)
configure_file(${ASSETS_DIRECTORY}/riscos/!Sprites,ff9 ${BUILD_DIRECTORY}/!CSE2/!Sprites,ff9 COPYONLY)
configure_file(${BUILD_DIRECTORY}/licence.txt ${BUILD_DIRECTORY}/!CSE2/Licence COPYONLY)
file(COPY ${BUILD_DIRECTORY}/data DESTINATION ${BUILD_DIRECTORY}/!CSE2)

View file

@ -65,6 +65,8 @@ void DefaultConfigData(CONFIGDATA *conf)
#ifdef _3DS #ifdef _3DS
conf->display_mode = 1; conf->display_mode = 1;
#elif defined(__riscos__)
conf->display_mode = 2;
#endif #endif
// Reset joystick settings (as these can't simply be set to 0) // Reset joystick settings (as these can't simply be set to 0)