diff --git a/!DosBox-X/!Boot,feb b/!DosBox-X/!Boot,feb new file mode 100644 index 000000000..b39623257 --- /dev/null +++ b/!DosBox-X/!Boot,feb @@ -0,0 +1,2 @@ +Set DosBox-X$Dir +IconSprites .!Sprites diff --git a/!DosBox-X/!Run,feb b/!DosBox-X/!Run,feb new file mode 100644 index 000000000..2d20bd7c4 --- /dev/null +++ b/!DosBox-X/!Run,feb @@ -0,0 +1,9 @@ +Set DosBox-X$Dir + +RMEnsure SharedUnixLibrary 1.14 RMLoad System:Modules.SharedULib +RMEnsure SharedUnixLibrary 1.14 Error DOSBox-X requires SharedUnixLibrary 1.14 or later. This can be downloaded from https://www.riscos.info/packages/LibraryDetails.html#SharedUnixLibrary + +RMEnsure DigitalRenderer 0.56 RMLoad System:Modules.DRenderer +RMEnsure DigitalRenderer 0.56 Error DOSBox-X requires DigitalRenderer 0.56 or later. This can be downloaded from https://www.riscos.info/packages/LibraryDetails.html#DRenderer + +Run .dosbox-x 2>.stderr diff --git a/!DosBox-X/!Sprites,ff9 b/!DosBox-X/!Sprites,ff9 new file mode 100644 index 000000000..51ed562d9 Binary files /dev/null and b/!DosBox-X/!Sprites,ff9 differ diff --git a/.gitignore b/.gitignore index 7150aa1ae..b67469427 100644 --- a/.gitignore +++ b/.gitignore @@ -325,6 +325,10 @@ windows-installer/DOSBox-X-standalone-* windows-installer/DOSBox-X-setup-*.exe windows-installer/DOSBox-X-setup-*.zip +\!DosBox-X/*,ff8 +\!DosBox-X/CHANGELOG,fff +\!DosBox-X/resources/* + *.o *.a *.la diff --git a/build-riscos b/build-riscos new file mode 100755 index 000000000..278239a2e --- /dev/null +++ b/build-riscos @@ -0,0 +1,20 @@ +#!/bin/bash + +# I'm sick and tired of all the churn the three versions of autoconf +# are causing in this repo. Stop committing the configure scripts +# and just autoregen. +./autogen.sh || exit 1 + +echo Compiling DOSBox-X +chmod +x configure + +# for sdl-config +export PATH=$GCCSDK_INSTALL_ENV/bin:$PATH +export CPPFLAGS=-I$GCCSDK_INSTALL_ENV/include +export LDFLAGS="-L$GCCSDK_INSTALL_ENV/lib -static" + +./configure --host=arm-unknown-riscos --enable-core-inline "$@" +make -j3 || exit 1 +elf2aif src/dosbox-x !DosBox-X/dosbox-x,ff8 +cp font/FREECG98.BMP !DosBox-X/resources/freecg98.bmp,69c +dos2unix -n CHANGELOG !DosBox-X/CHANGELOG,fff diff --git a/configure.ac b/configure.ac index c0c2f951b..c4fc05427 100644 --- a/configure.ac +++ b/configure.ac @@ -405,6 +405,11 @@ case "$host" in dnl FEATURE: Whether to support direct serial port passthrough AC_DEFINE(C_DIRECTSERIAL, 1, [ Define to 1 if you want serial passthrough support (Win32, Posix and OS/2).]) ;; + *-*-riscos*) + AC_DEFINE(RISCOS, 1, [Compiling on RISC OS]) + dnl The following line is required in order to use std::to_string() + CXXFLAGS="$CXXFLAGS -D_GLIBCXX_USE_C99=1" + ;; esac fi diff --git a/include/byteorder.h b/include/byteorder.h index 2d03aec5a..a394081ba 100644 --- a/include/byteorder.h +++ b/include/byteorder.h @@ -5,7 +5,7 @@ # include /* MinGW implements some MSVC idioms, so always test for MinGW first. */ -# elif defined(__MINGW32__) +# elif defined(__MINGW32__) || defined(__riscos__) # if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ diff --git a/src/dos/dos_programs.cpp b/src/dos/dos_programs.cpp index 979f84381..cbe1f44ef 100644 --- a/src/dos/dos_programs.cpp +++ b/src/dos/dos_programs.cpp @@ -55,6 +55,11 @@ bool Mouse_Vertical = false; #include "os2.h" #endif +#if defined(RISCOS) +#include +#include +#endif + #if C_DEBUG Bitu DEBUG_EnableDebugger(void); #endif @@ -339,6 +344,17 @@ public: (void)failed;// MAY BE UNUSED +#if defined (RISCOS) + // If the user provided a RISC OS style path, convert it to a Unix style path + // TODO: Disable UnixLib's automatic path conversion and use RISC OS style paths internally? + if (temp_line.find('$',0) != std::string::npos) { + char fname[PATH_MAX]; + is_physfs = false; + __unixify_std(temp_line.c_str(), fname, sizeof(fname), 0); + temp_line = fname; + } +#endif + #if defined (WIN32) || defined(OS2) /* nothing */ #else diff --git a/src/gui/sdl_mapper.cpp b/src/gui/sdl_mapper.cpp index b04afcc95..4b518b14c 100644 --- a/src/gui/sdl_mapper.cpp +++ b/src/gui/sdl_mapper.cpp @@ -4059,7 +4059,7 @@ void MAPPER_StartUp() { /* Note: table has to be tested/updated for various OSs */ #if defined (MACOSX) /* nothing */ -#elif defined(HAIKU) +#elif defined(HAIKU) || defined(RISCOS) usescancodes = false; #elif defined(OS2) sdlkey_map[0x61]=SDLK_UP; diff --git a/src/misc/cross.cpp b/src/misc/cross.cpp index 0063de330..e2d829e05 100644 --- a/src/misc/cross.cpp +++ b/src/misc/cross.cpp @@ -66,6 +66,8 @@ static void W32_ConfDir(std::string& in,bool create) { void Cross::GetPlatformResDir(std::string& in) { #if defined(MACOSX) in = MacOSXResPath; +#elif defined(RISCOS) + in = "//resources"; #elif defined(RESDIR) in = RESDIR; #endif @@ -83,6 +85,8 @@ void Cross::GetPlatformConfigDir(std::string& in) { #elif defined(HAIKU) in = "~/config/settings/dosbox"; ResolveHomedir(in); +#elif defined(RISCOS) + in = "//DosBox-X"; #elif !defined(HX_DOS) in = "~/.dosbox"; ResolveHomedir(in); @@ -114,6 +118,9 @@ void Cross::CreatePlatformConfigDir(std::string& in) { in = "~/config/settings/dosbox"; ResolveHomedir(in); mkdir(in.c_str(),0700); +#elif defined(RISCOS) + in = "//DosBox-X"; + mkdir(in.c_str(),0700); #elif !defined(HX_DOS) in = "~/.dosbox"; ResolveHomedir(in);