shithub: cstory

Download patch

ref: 44544a65d23de1c3d618c65198a22fc3b51ea107
parent: 131a8decc0b71253b41f65e76a712e3eef76fb7d
author: Cameron Cawley <ccawley2011@gmail.com>
date: Tue Oct 20 13:33:36 EDT 2020

RISC OS port

diff: cannot open b/assets/riscos//null: file does not exist: 'b/assets/riscos//null'
--- a/.gitignore
+++ b/.gitignore
@@ -2,7 +2,7 @@
 /obj
 
 # Exclude the (recommended) CMake build directory
-/build
+/build*
 
 # Exclude executables
 /game_english/CSE2_debug.exe
@@ -15,6 +15,7 @@
 /game_english/DoConfig
 /game_english/CSE2_debug.rpx
 /game_english/CSE2.rpx
+/game_english/\!CSE2
 /game_japanese/CSE2_debug.exe
 /game_japanese/DoConfig_debug.exe
 /game_japanese/CSE2.exe
@@ -25,6 +26,7 @@
 /game_japanese/DoConfig
 /game_japanese/CSE2_debug.rpx
 /game_japanese/CSE2.rpx
+/game_japanese/\!CSE2
 
 # Exclude MSVC debug data
 /game_english/CSE2_debug.ilk
@@ -96,9 +98,6 @@
 ###################
 # Portable branch #
 ###################
-
-# Exclude Wii U build directory
-/buildwiiu
 
 # Exclude converted resource files
 /src/Resource
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -775,3 +775,7 @@
 		RUNTIME_OUTPUT_DIRECTORY_DEBUG ${BUILD_DIRECTORY}
 	)
 endif()
+
+if(RISCOS)
+	include(RISCOSApp)
+endif()
--- /dev/null
+++ b/assets/riscos/!Boot,feb
@@ -1,0 +1,2 @@
+Set CSE2$Dir <Obey$Dir>
+IconSprites <CSE2$Dir>.!Sprites
--- /dev/null
+++ b/assets/riscos/!Run,feb
@@ -1,0 +1,2 @@
+Set CSE2$Dir <Obey$Dir>
+Run <CSE2$Dir>.CSE2 ><CSE2$Dir>.Log 2>&1
binary files /dev/null b/assets/riscos/!Sprites,ff9 differ
--- /dev/null
+++ b/cmake/RISCOSApp.cmake
@@ -1,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)
--- a/src/Config.cpp
+++ b/src/Config.cpp
@@ -65,6 +65,8 @@
 
 #ifdef _3DS
 	conf->display_mode = 1;
+#elif defined(__riscos__)
+	conf->display_mode = 2;
 #endif
 
 	// Reset joystick settings (as these can't simply be set to 0)