Initial commit

This commit is contained in:
2026-02-02 04:50:13 +01:00
commit 5b11698731
22592 changed files with 7677434 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#!/bin/sh
echo Quick script to make building all the time less painful.
. /usr/local/angstrom/arm/environment-setup
CROSS_COMPILE=arm-angstrom-linux-gnueabi-
export CROSS_COMPILE
# Export the tool names for cross-compiling
export CXX=arm-angstrom-linux-gnueabi-g++
export CC=arm-angstrom-linux-gnueabi-gcc
export DEFINES=-DNDEBUG
cd ../../../..
echo Building ScummVM/OpenPandora.
make
echo Build for OpenPandora complete - Please check build logs.

View File

@@ -0,0 +1,13 @@
#!/bin/sh
. /usr/local/angstrom/arm/environment-setup
CROSS_COMPILE=arm-angstrom-linux-gnueabi-
export CROSS_COMPILE
echo Quick script to make building a distribution of the OpenPanodra backend more consistent.
cd ../../../..
make op-bundle
make op-pnd

View File

@@ -0,0 +1,10 @@
#!/bin/sh
echo Quick script to make building all the time less painful.
. /usr/local/angstrom/arm/environment-setup
cd ../../../..
echo Cleaning ScummVM for the OpenPandora.
make clean

View File

@@ -0,0 +1,28 @@
#!/bin/sh
echo Quick script to make running configure all the time less painful
echo and let all the build work be done from the backend/build folder.
. /usr/local/angstrom/arm/environment-setup
CROSS_COMPILE=arm-angstrom-linux-gnueabi-
export CROSS_COMPILE
# Export the tool names for cross-compiling
export CXX=arm-angstrom-linux-gnueabi-g++
export CPPFLAGS=-I/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include
export LDFLAGS=-L/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib
export DEFINES=-DNDEBUG
# Edit the configure line to suit.
cd ../../../..
./configure --backend=openpandora --host=openpandora --disable-nasm \
--with-sdl-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/bin \
--disable-vorbis --enable-tremor --with-tremor-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \
--enable-zlib --with-zlib-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \
--enable-mad --with-mad-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \
--enable-png --with-png-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \
--enable-all-engines --enable-plugins --default-dynamic
echo Generating config for OpenPandora complete. Check for errors.

View File

@@ -0,0 +1,28 @@
#!/bin/sh
echo Quick script to make running configure all the time less painful
echo and let all the build work be done from the backend/build folder.
. /usr/local/angstrom/arm/environment-setup
CROSS_COMPILE=arm-angstrom-linux-gnueabi-
export CROSS_COMPILE
# Export the tool names for cross-compiling
export CXX=arm-angstrom-linux-gnueabi-g++
export CPPFLAGS=-I/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include
export LDFLAGS=-L/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib
export DEFINES=-DNDEBUG
# Edit the configure line to suit.
cd ../../../..
./configure --backend=openpandora --host=openpandora --disable-nasm \
--with-sdl-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/bin \
--disable-vorbis --enable-tremor --with-tremor-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \
--enable-zlib --with-zlib-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \
--enable-mad --with-mad-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \
--enable-png --with-png-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr \
--enable-plugins --default-dynamic
echo Generating config for OpenPandora complete. Check for errors.

View File

@@ -0,0 +1,13 @@
MODULE := backends/platform/openpandora
MODULE_OBJS := \
op-backend.o \
op-main.o
# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS.
MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS))
OBJS := $(MODULE_OBJS) $(OBJS)
MODULE_DIRS += $(sort $(dir $(MODULE_OBJS)))
# Hack to ensure the SDL backend is built so we can use OSystem_SDL.
-include $(srcdir)/backends/platform/sdl/module.mk

View File

@@ -0,0 +1,189 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#if defined(OPENPANDORA)
// Disable symbol overrides so that we can use system headers.
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include "backends/platform/sdl/sdl-sys.h"
#include "backends/platform/openpandora/op-sdl.h"
#include "backends/plugins/posix/posix-provider.h"
#include "backends/saves/default/default-saves.h"
#include "backends/timer/default/default-timer.h"
#include "common/archive.h"
#include "common/config-manager.h"
#include "common/debug.h"
#include "common/events.h"
#include "common/file.h"
#include "common/textconsole.h"
#include "common/util.h"
#include "audio/mixer_intern.h"
#include <unistd.h> // for getcwd()
/* Dump console info to files. */
#define DUMP_STDOUT
OSystem_OP::OSystem_OP()
:
OSystem_POSIX() {
}
Common::String OSystem_OP::getCurrentDirectory() {
char cwd[MAXPATHLEN+1];
return Common::String(getcwd(cwd, MAXPATHLEN));
}
void OSystem_OP::initBackend() {
assert(!_inited);
/* Setup default save path to be workingdir/saves */
Common::String workDirName = getCurrentDirectory();
if (workDirName.empty()) {
error("Could not obtain current working directory.");
} else {
printf("Current working directory: %s\n", workDirName.c_str());
}
Common::String savePath = workDirName + "/../saves";
printf("Current save directory: %s\n", savePath.c_str());
_savefileManager = new DefaultSaveFileManager(savePath);
#ifdef DUMP_STDOUT
// The OpenPandora has a serial console on the EXT connection but most users do not use this so we
// output all our STDOUT and STDERR to files for debug purposes.
Common::String STDOUT_FILE = workDirName + "/scummvm.stdout.txt";
Common::String STDERR_FILE = workDirName + "/scummvm.stderr.txt";
// Flush the output in case anything is queued
fclose(stdout);
fclose(stderr);
// Redirect standard input and standard output
FILE *newfp = freopen(STDOUT_FILE.c_str(), "w", stdout);
if (newfp == NULL) {
#if !defined(stdout)
stdout = fopen(STDOUT_FILE.c_str(), "w");
#else
newfp = fopen(STDOUT_FILE.c_str(), "w");
if (newfp) {
*stdout = *newfp;
}
#endif
}
newfp = freopen(STDERR_FILE.c_str(), "w", stderr);
if (newfp == NULL) {
#if !defined(stderr)
stderr = fopen(STDERR_FILE.c_str(), "w");
#else
newfp = fopen(STDERR_FILE.c_str(), "w");
if (newfp) {
*stderr = *newfp;
}
#endif
}
setbuf(stderr, NULL);
printf("%s\n", "Debug: STDOUT and STDERR redirected to text files.");
#endif /* DUMP_STDOUT */
/* Trigger autosave every 4 minutes. */
ConfMan.registerDefault("autosave_period", 4 * 60);
ConfMan.registerDefault("fullscreen", true);
/* Make sure that aspect ratio correction is enabled on the 1st run to stop
users asking me what the 'wasted space' at the bottom is ;-). */
ConfMan.registerDefault("aspect_ratio", true);
/* Make sure SDL knows that we have a joystick we want to use. */
ConfMan.setInt("joystick_num", 0);
// Create the events manager
if (_eventSource == 0)
_eventSource = new OPEventSource();
// Create the graphics manager
if (_graphicsManager == 0) {
_graphicsManager = new OPGraphicsManager(_eventSource, _window);
}
/* Pass to POSIX method to do the heavy lifting */
OSystem_POSIX::initBackend();
_inited = true;
}
void OSystem_OP::initSDL() {
#ifdef SDL_INIT_EVENTTHREAD
// Check if SDL has not been initialized
if (!_initedSDL) {
uint32 sdlFlags = SDL_INIT_EVENTTHREAD | SDL_INIT_VIDEO;
if (ConfMan.hasKey("disable_sdl_parachute"))
sdlFlags |= SDL_INIT_NOPARACHUTE;
// Initialize SDL (SDL Subsystems are initiliazed in the corresponding sdl managers)
if (SDL_Init(sdlFlags) == -1)
error("Could not initialize SDL: %s", SDL_GetError());
_initedSDL = true;
}
#endif
OSystem_SDL::initSDL();
}
void OSystem_OP::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
/* Setup default extra data paths for engine data files and plugins */
Common::String workDirName = getCurrentDirectory();
if (workDirName.empty()) {
error("Error: Could not obtain current working directory.");
}
Common::String enginedataPath = workDirName + "/../data";
printf("Default engine data directory: %s\n", enginedataPath.c_str());
Common::FSNode engineNode(enginedataPath);
if (engineNode.exists() && engineNode.isDirectory()) {
s.add("__OP_ENGDATA__", new Common::FSDirectory(enginedataPath), priority);
}
}
void OSystem_OP::quit() {
#ifdef DUMP_STDOUT
printf("%s\n", "Debug: STDOUT and STDERR text files closed.");
fclose(stdout);
fclose(stderr);
#endif /* DUMP_STDOUT */
OSystem_POSIX::quit();
}
#endif

View File

@@ -0,0 +1,101 @@
# Special target to create bundles and PND's for the OpenPandora.
#bundle_name = release/scummvm-op-`date '+%Y-%m-%d'`
bundle_name = release/scummvm-op
f=$(shell which $(STRIP))
libloc = $(shell dirname $(f))
op-bundle: $(EXECUTABLE)
$(MKDIR) "$(bundle_name)"
$(MKDIR) "$(bundle_name)/scummvm"
$(MKDIR) "$(bundle_name)/scummvm/bin"
$(MKDIR) "$(bundle_name)/scummvm/data"
$(MKDIR) "$(bundle_name)/scummvm/docs"
$(MKDIR) "$(bundle_name)/scummvm/icon"
$(MKDIR) "$(bundle_name)/scummvm/lib"
$(CP) $(srcdir)/dists/openpandora/runscummvm.sh $(bundle_name)/scummvm/
$(CP) $(srcdir)/dists/openpandora/PXML.xml $(bundle_name)/scummvm/data/
$(CP) $(srcdir)/dists/openpandora/icon/scummvm.png $(bundle_name)/scummvm/icon/
$(CP) $(srcdir)/dists/openpandora/icon/preview-pic.png $(bundle_name)/scummvm/icon/
$(CP) $(srcdir)/dists/openpandora/README-OPENPANDORA $(bundle_name)/scummvm/docs/
$(CP) $(srcdir)/dists/openpandora/index.html $(bundle_name)/scummvm/docs/
$(INSTALL) -c -m 644 $(DIST_FILES_DOCS) $(bundle_name)/scummvm/docs/
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(bundle_name)/scummvm/data/
ifdef DIST_FILES_ENGINEDATA
$(INSTALL) -c -m 644 $(DIST_FILES_ENGINEDATA) $(bundle_name)/scummvm/data/
endif
ifdef DIST_FILES_NETWORKING
$(INSTALL) -c -m 644 $(DIST_FILES_NETWORKING) $(bundle_name)/scummvm/data/
endif
ifdef DIST_FILES_VKEYBD
$(INSTALL) -c -m 644 $(DIST_FILES_VKEYBD) $(bundle_name)/scummvm/data/
endif
$(STRIP) $(EXECUTABLE) -o $(bundle_name)/scummvm/bin/$(EXECUTABLE)
ifdef DYNAMIC_MODULES
$(INSTALL) -d "$(bundle_name)/scummvm/plugins"
$(INSTALL) -c -m 644 $(PLUGINS) "$(bundle_name)/scummvm/plugins"
$(STRIP) $(bundle_name)/scummvm/plugins/*
endif
$(CP) $(libloc)/../arm-angstrom-linux-gnueabi/usr/lib/libFLAC.so.8.2.0 $(bundle_name)/scummvm/lib/libFLAC.so.8
tar -C $(bundle_name) -cvjf $(bundle_name).tar.bz2 .
rm -R ./$(bundle_name)
op-pnd: $(EXECUTABLE)
$(MKDIR) "$(bundle_name)"
$(MKDIR) "$(bundle_name)/scummvm"
$(MKDIR) "$(bundle_name)/scummvm/bin"
$(MKDIR) "$(bundle_name)/scummvm/data"
$(MKDIR) "$(bundle_name)/scummvm/docs"
$(MKDIR) "$(bundle_name)/scummvm/icon"
$(MKDIR) "$(bundle_name)/scummvm/lib"
$(CP) $(srcdir)/dists/openpandora/runscummvm.sh $(bundle_name)/scummvm/
$(CP) $(srcdir)/dists/openpandora/PXML.xml $(bundle_name)/scummvm/data/
$(CP) $(srcdir)/dists/openpandora/icon/scummvm.png $(bundle_name)/scummvm/icon/
$(CP) $(srcdir)/dists/openpandora/icon/preview-pic.png $(bundle_name)/scummvm/icon/
$(CP) $(srcdir)/dists/openpandora/README-OPENPANDORA $(bundle_name)/scummvm/docs/
$(CP) $(srcdir)/dists/openpandora/index.html $(bundle_name)/scummvm/docs/
$(INSTALL) -c -m 644 $(DIST_FILES_DOCS) $(bundle_name)/scummvm/docs/
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(bundle_name)/scummvm/data/
ifdef DIST_FILES_ENGINEDATA
$(INSTALL) -c -m 644 $(DIST_FILES_ENGINEDATA) $(bundle_name)/scummvm/data/
endif
ifdef DIST_FILES_NETWORKING
$(INSTALL) -c -m 644 $(DIST_FILES_NETWORKING) $(bundle_name)/scummvm/data/
endif
ifdef DIST_FILES_VKEYBD
$(INSTALL) -c -m 644 $(DIST_FILES_VKEYBD) $(bundle_name)/scummvm/data/
endif
$(STRIP) $(EXECUTABLE) -o $(bundle_name)/scummvm/bin/$(EXECUTABLE)
ifdef DYNAMIC_MODULES
$(INSTALL) -d "$(bundle_name)/scummvm/plugins"
$(INSTALL) -c -m 644 $(PLUGINS) "$(bundle_name)/scummvm/plugins"
$(STRIP) $(bundle_name)/scummvm/plugins/*
endif
$(CP) $(libloc)/../arm-angstrom-linux-gnueabi/usr/lib/libFLAC.so.8.2.0 $(bundle_name)/scummvm/lib/libFLAC.so.8
$(srcdir)/dists/openpandora/pnd_make.sh -p $(bundle_name).pnd -c -d $(bundle_name)/scummvm -x $(bundle_name)/scummvm/data/PXML.xml -i $(bundle_name)/scummvm/icon/scummvm.png
$(CP) $(srcdir)/dists/openpandora/README-PND.txt $(bundle_name)
tar -cvjf $(bundle_name)-pnd.tar.bz2 $(bundle_name).pnd $(bundle_name)/README-PND.txt
rm -R ./$(bundle_name)
.PHONY: op-bundle op-pnd

View File

@@ -0,0 +1,50 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "backends/platform/openpandora/op-sdl.h"
#include "backends/plugins/sdl/sdl-provider.h"
#include "base/main.h"
#if defined(OPENPANDORA)
int main(int argc, char *argv[]) {
// Create our OSystem instance
g_system = new OSystem_OP();
assert(g_system);
// Pre initialize the backend
g_system->init();
#ifdef DYNAMIC_MODULES
PluginManager::instance().addPluginProvider(new SDLPluginProvider());
#endif
// Invoke the actual ScummVM main entry point:
int res = scummvm_main(argc, argv);
// Free OSystem
g_system->destroy();
return res;
}
#endif

View File

@@ -0,0 +1,56 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef OP_SDL_H
#define OP_SDL_H
#if defined(OPENPANDORA)
#include "backends/base-backend.h"
#include "backends/platform/sdl/sdl-sys.h"
#include "backends/platform/sdl/posix/posix.h"
#include "backends/events/openpandora/op-events.h"
#include "backends/graphics/openpandora/op-graphics.h"
class OSystem_OP : public OSystem_POSIX {
public:
OSystem_OP();
/* Platform Setup Stuff */
void addSysArchivesToSearchSet(Common::SearchSet &s, int priority);
void initBackend();
void quit();
protected:
bool _inited;
bool _initedSDL;
/**
* Initialse the SDL library
* with an OpenPandora workaround.
*/
virtual void initSDL();
private:
Common::String getCurrentDirectory();
};
#endif
#endif //OP_SDL_H