Add initial RISC OS support

This commit is contained in:
Cameron Cawley 2019-02-06 23:24:19 +00:00
parent 2c8a415f4f
commit 5c103a49ac
10 changed files with 65 additions and 2 deletions

2
!DosBox-X/!Boot,feb Normal file
View File

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

9
!DosBox-X/!Run,feb Normal file
View File

@ -0,0 +1,9 @@
Set DosBox-X$Dir <Obey$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$Dir>.dosbox-x 2><Obey$Dir>.stderr

BIN
!DosBox-X/!Sprites,ff9 Normal file

Binary file not shown.

4
.gitignore vendored
View File

@ -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

20
build-riscos Executable file
View File

@ -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

View File

@ -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

View File

@ -5,7 +5,7 @@
# include <endian.h>
/* 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__

View File

@ -55,6 +55,11 @@ bool Mouse_Vertical = false;
#include "os2.h"
#endif
#if defined(RISCOS)
#include <unixlib/local.h>
#include <limits.h>
#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

View File

@ -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;

View File

@ -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 = "/<DosBox-X$Dir>/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 = "/<Choices$Write>/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 = "/<Choices$Write>/DosBox-X";
mkdir(in.c_str(),0700);
#elif !defined(HX_DOS)
in = "~/.dosbox";
ResolveHomedir(in);