Remove: PSP support

This commit is contained in:
Patric Stout 2018-04-29 14:12:23 +02:00
parent 8d8b9a026a
commit 85adde7485
13 changed files with 18 additions and 174 deletions

View File

@ -264,14 +264,7 @@ endif
$(TTD): $(OBJS) $(CONFIG_CACHE_LINKER)
$(E) '$(STAGE) Linking $@'
ifeq ($(OS), PSP)
# Because of a bug in the PSP GCC tools, linking via CXX results
# in total chaos and more problems then you can handle. So we need
# CC to link OpenTTD for PSP
$(Q)+$(CC_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
else
$(Q)+$(CXX_HOST) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
endif
ifdef STRIP
$(Q)$(STRIP) $@
endif

View File

@ -88,7 +88,6 @@ set_default() {
with_icu_layout="1"
with_icu_sort="1"
static_icu="0"
with_psp_config="1"
with_threads="1"
with_distcc="1"
with_ccache="1"
@ -165,7 +164,6 @@ set_default() {
with_icu_layout
with_icu_sort
static_icu
with_psp_config
with_threads
with_distcc
with_ccache
@ -406,10 +404,6 @@ detect_params() {
--static-libicu) static_icu="1";;
--static-libicu=*) static_icu="$optarg";;
--with-psp-config) with_psp_config="2";;
--without-psp-config) with_psp_config="0";;
--with-psp-config=*) with_psp_config="$optarg";;
--disable-builtin-depend) enable_builtin_depend="0";;
--enable-builtin-depend) enable_builtin_depend="2";;
--enable-builtin-depend=*) enable_builtin_depend="$optarg";;
@ -564,10 +558,10 @@ check_params() {
log 1 " PREPROCESSOR is only available for OSX"
exit 1
fi
# OS only allows DETECT, UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, MORPHOS, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP
if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS|WINCE|PSP)$'`" ]; then
# OS only allows DETECT, UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, MORPHOS, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, DOS, and WINCE
if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS|WINCE)$'`" ]; then
log 1 "configure: error: invalid option --os=$os"
log 1 " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS|WINCE|PSP]"
log 1 " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS|WINCE]"
exit 1
fi
# cpu_type can be either 32 or 64
@ -878,7 +872,6 @@ check_params() {
detect_fontconfig
detect_icu_layout
detect_icu_sort
detect_pspconfig
detect_libtimidity
if [ "$with_direct_music" != "0" ]; then
@ -1528,9 +1521,6 @@ make_cflags_and_ldflags() {
# Each debug level reduces the optimization by a bit
if [ $enable_debug -ge 1 ]; then
CFLAGS="$CFLAGS -g -D_DEBUG"
if [ "$os" = "PSP" ]; then
CFLAGS="$CFLAGS -G0"
fi
fi
if [ $enable_debug -ge 2 ]; then
CFLAGS="$CFLAGS -fno-inline"
@ -1604,7 +1594,7 @@ make_cflags_and_ldflags() {
fi
fi
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ] && [ "$os" != "OS2" ]; then
LIBS="$LIBS -lpthread"
fi
@ -1614,13 +1604,6 @@ make_cflags_and_ldflags() {
if [ "$os" = "WINCE" ]; then
LIBS="$LIBS -lcoredll -lcorelibc -laygshell -lws2 -e WinMainCRTStartup"
fi
if [ "$os" = "PSP" ]; then
CFLAGS="$CFLAGS -I`$psp_config -p`/include"
LDFLAGS="$LDFLAGS -L`$psp_config -p`/lib"
CFLAGS="$CFLAGS -fno-exceptions -fno-rtti -D_PSP_FW_VERSION=150"
LIBS="$LIBS -D_PSP_FW_VERSION=150 -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -lm"
fi
if [ "$os" = "MORPHOS" ]; then
# -Wstrict-prototypes generates much noise because of system headers
@ -2321,7 +2304,7 @@ detect_awk() {
detect_os() {
if [ "$os" = "DETECT" ]; then
# Detect UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP
# Detect UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, DOS, and WINCE
# Try first via dumpmachine, then via uname
os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk '
@ -2342,7 +2325,6 @@ detect_os() {
/os2/ { print "OS2"; exit}
/dos/ { print "DOS"; exit}
/wince/ { print "WINCE"; exit}
/psp/ { print "PSP"; exit}
'`
if [ -z "$os" ]; then
@ -2368,7 +2350,7 @@ detect_os() {
if [ -z "$os" ]; then
log 1 "detecting OS... none detected"
log 1 "I couldn't detect your OS. Please use --os=OS to force one"
log 1 "Allowed values are: UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, MORPHOS, HPUX, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP"
log 1 "Allowed values are: UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, MORPHOS, HPUX, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, DOS, and WINCE"
exit 1
fi
@ -2834,55 +2816,6 @@ detect_icu_sort() {
detect_pkg_config "$with_icu_sort" "icu-i18n" "icu_sort_config" "4.8" "1"
}
detect_pspconfig() {
# 0 means no, 1 is auto-detect, 2 is force
if [ "$with_psp_config" = "0" ]; then
log 1 "checking psp-config... disabled"
psp_config=""
return 0
fi
if [ "$with_psp_config" = "1" ] && [ "$os" != "PSP" ]; then
log 1 "checking psp-config... not PSP, skipping"
psp_config="";
return 0
fi
if [ "$os" != "PSP" ]; then
log 1 "checking psp-config... not PSP"
log 1 "configure: error: psp-config is only supported for PSP"
exit 1
fi
if [ "$with_psp_config" = "1" ] || [ "$with_psp_config" = "" ] || [ "$with_psp_config" = "2" ]; then
psp_config="psp-config"
else
psp_config="$with_psp_config"
fi
version=`$psp_config -p 2>/dev/null`
ret=$?
log 2 "executing $psp_config -p"
log 2 " returned $version"
log 2 " exit code $ret"
if [ -z "$version" ] || [ "$ret" != "0" ]; then
log 1 "checking psp-config... not found"
log 1 "configure: error: psp-config couldn't be found"
# It was forced, so it should be found.
if [ "$with_psp_config" != "1" ]; then
log 1 "configure: error: you supplied '$with_psp_config', but it seems invalid"
fi
exit 1
fi
log 1 "checking psp-config... found"
}
detect_iconv() {
# 0 means no, 1 is auto-detect, 2 is force
if [ "$with_iconv" = "0" ]; then
@ -3476,7 +3409,7 @@ showhelp() {
echo " --os=OS the OS we are compiling for [DETECT]"
echo " DETECT/UNIX/OSX/FREEBSD/DRAGONFLY/OPENBSD/"
echo " NETBSD/MORPHOS/HPUX/BEOS/SUNOS/CYGWIN/"
echo " MINGW/OS2/DOS/WINCE/PSP/HAIKU"
echo " MINGW/OS2/DOS/WINCE/HAIKU"
echo " --endian=ENDIAN set the endian of the HOST (AUTO/LE/BE)"
echo ""
echo "Paths:"
@ -3573,7 +3506,6 @@ showhelp() {
echo " --static-icu try to link statically (libsicu instead of"
echo " libicu; can fail as the new name is guessed)"
echo " --with-iconv[=iconv-path] enables iconv support"
echo " --with-psp-config[=psp-config] enables psp-config support (PSP ONLY)"
echo " --disable-builtin-depend disable use of builtin deps finder"
echo " --with-makedepend[=makedepend] enables makedepend support"
echo " --with-ccache enables ccache support"

1
configure vendored
View File

@ -114,7 +114,6 @@ AWKCOMMAND='
if ($0 == "PNG" && "'$png_config'" == "") { next; }
if ($0 == "OSX" && "'$os'" != "OSX") { next; }
if ($0 == "OS2" && "'$os'" != "OS2") { next; }
if ($0 == "PSP" && "'$os'" != "PSP") { next; }
if ($0 == "DEDICATED" && "'$enable_dedicated'" != "1") { next; }
if ($0 == "AI" && "'$enable_ai'" == "0") { next; }
if ($0 == "COCOA" && "'$with_cocoa'" == "0") { next; }

View File

@ -123,7 +123,6 @@ load_main_data() {
if ($0 == "PNG" && "'$png_config'" == "") { next; }
if ($0 == "OSX" && "'$os'" != "OSX") { next; }
if ($0 == "OS2" && "'$os'" != "OS2") { next; }
if ($0 == "PSP" && "'$os'" != "PSP") { next; }
if ($0 == "DOS" && "'$os'" != "DOS") { next; }
if ($0 == "DEDICATED" && "'$enable_dedicated'" != "1") { next; }
if ($0 == "AI" && "'$enable_ai'" == "0") { next; }

View File

@ -1111,14 +1111,11 @@ music/null_m.cpp
#else
#if WINCE
#else
#if PSP
#if DOS
#else
#if DOS
#if MORPHOS
#else
#if MORPHOS
#else
music/extmidi.cpp
#end
music/extmidi.cpp
#end
#end
#end

View File

@ -22,9 +22,6 @@
#include <sys/stat.h>
#include <errno.h>
#include <timidity.h>
#if defined(PSP)
#include <pspaudiolib.h>
#endif /* PSP */
#include "../safeguards.h"
@ -44,16 +41,6 @@ static struct {
uint32 song_position;
} _midi; ///< Metadata about the midi we're playing.
#if defined(PSP)
static void AudioOutCallback(void *buf, unsigned int _reqn, void *userdata)
{
memset(buf, 0, _reqn * PSP_NUM_AUDIO_CHANNELS);
if (_midi.status == MIDI_PLAYING) {
mid_song_read_wave(_midi.song, buf, _reqn * PSP_NUM_AUDIO_CHANNELS);
}
}
#endif /* PSP */
/** Factory for the libtimidity driver. */
static FMusicDriver_LibTimidity iFMusicDriver_LibTimidity;
@ -75,17 +62,7 @@ const char *MusicDriver_LibTimidity::Start(const char * const *param)
_midi.options.rate = 44100;
_midi.options.format = MID_AUDIO_S16LSB;
_midi.options.channels = 2;
#if defined(PSP)
_midi.options.buffer_size = PSP_NUM_AUDIO_SAMPLES;
#else
_midi.options.buffer_size = _midi.options.rate;
#endif
#if defined(PSP)
pspAudioInit();
pspAudioSetChannelCallback(_midi.options.channels, &AudioOutCallback, NULL);
pspAudioSetVolume(_midi.options.channels, PSP_VOLUME_MAX, PSP_VOLUME_MAX);
#endif /* PSP */
return NULL;
}

View File

@ -24,12 +24,7 @@
*/
static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast);
#if defined(PSP)
static void NetworkFindBroadcastIPsInternal(NetworkAddressList *broadcast) // PSP implementation
{
}
#elif defined(BEOS_NET_SERVER) || defined(__HAIKU__) /* doesn't have neither getifaddrs or net/if.h */
#if defined(BEOS_NET_SERVER) || defined(__HAIKU__) /* doesn't have neither getifaddrs or net/if.h */
/* Based on Andrew Bachmann's netstat+.c. Big thanks to him! */
extern "C" int _netstat(int fd, char **output, int verbose);

View File

@ -194,29 +194,6 @@ static inline void OTTDfreeaddrinfo(struct addrinfo *ai)
#define IPV6_V6ONLY 27
#endif
#if defined(PSP)
# include <sys/socket.h>
# include <netinet/in.h>
# include <arpa/inet.h>
# include <pspnet.h>
# include <pspnet_inet.h>
# include <pspnet_apctl.h>
# include <pspnet_resolver.h>
# include <errno.h>
# include <unistd.h>
# include <sys/select.h>
# include <sys/time.h>
# include <sys/fd_set.h>
# define TCP_NODELAY 1
# define SO_NONBLOCK 0x1009
# define SOCKET int
# define INVALID_SOCKET -1
# define INADDR_NONE 0xffffffff
# define closesocket close
# define GET_LAST_ERROR() sceNetInetGetErrno()
#endif /* PSP */
/* OS/2 stuff */
#if defined(__OS2__)
# define SOCKET int
@ -318,7 +295,7 @@ static inline bool SetNonBlocking(SOCKET d)
#else
int nonblocking = 1;
#endif
#if (defined(__BEOS__) && defined(BEOS_NET_SERVER)) || defined(PSP)
#if (defined(__BEOS__) && defined(BEOS_NET_SERVER))
return setsockopt(d, SOL_SOCKET, SO_NONBLOCK, &nonblocking, sizeof(nonblocking)) == 0;
#else
return ioctlsocket(d, FIONBIO, &nonblocking) == 0;

View File

@ -1407,11 +1407,6 @@ static void DoAutosave()
{
char buf[MAX_PATH];
#if defined(PSP)
/* Autosaving in networking is too time expensive for the PSP */
if (_networking) return;
#endif /* PSP */
if (_settings_client.gui.keep_all_autosave) {
GenerateDefaultSaveName(buf, lastof(buf));
strecat(buf, ".sav", lastof(buf));

View File

@ -308,9 +308,7 @@ bool GetClipboardContents(char *buffer, const char *last)
void CSleep(int milliseconds)
{
#if defined(PSP)
sceKernelDelayThread(milliseconds * 1000);
#elif defined(__BEOS__)
#if defined(__BEOS__)
snooze(milliseconds * 1000);
#elif defined(__AMIGA__)
{

View File

@ -100,12 +100,6 @@
#define strcasecmp stricmp
#endif
#if defined(PSP)
#include <psptypes.h>
#include <pspdebug.h>
#include <pspthreadman.h>
#endif
#if defined(SUNOS) || defined(HPUX)
#include <alloca.h>
#endif
@ -134,14 +128,6 @@
#define CLIB_USERGROUP_PROTOS_H
#endif /* __MORPHOS__ */
#if defined(PSP)
/* PSP can only have 10 file-descriptors open at any given time, but this
* switch only limits reads via the Fio system. So keep 2 fds free for things
* like saving a game. */
#define LIMITED_FDS 8
#define printf pspDebugScreenPrintf
#endif /* PSP */
/* Stuff for GCC */
#if defined(__GNUC__)
#define NORETURN __attribute__ ((noreturn))

View File

@ -458,7 +458,7 @@ void VideoDriver_Allegro::Stop()
if (--_allegro_instance_count == 0) allegro_exit();
}
#if defined(UNIX) || defined(__OS2__) || defined(PSP) || defined(DOS)
#if defined(UNIX) || defined(__OS2__) || defined(DOS)
# include <sys/time.h> /* gettimeofday */
static uint32 GetTime()

View File

@ -57,16 +57,12 @@ static void OS2_SwitchToConsoleMode()
}
#endif
#if defined(UNIX) || defined(PSP)
#if defined(UNIX)
# include <sys/time.h> /* gettimeofday */
# include <sys/types.h>
# include <unistd.h>
# include <signal.h>
# define STDIN 0 /* file descriptor for standard input */
# if defined(PSP)
# include <sys/fd_set.h>
# include <sys/select.h>
# endif /* PSP */
/* Signal handlers */
static void DedicatedSignalHandler(int sig)
@ -196,7 +192,7 @@ void VideoDriver_Dedicated::MakeDirty(int left, int top, int width, int height)
bool VideoDriver_Dedicated::ChangeResolution(int w, int h) { return false; }
bool VideoDriver_Dedicated::ToggleFullscreen(bool fs) { return false; }
#if defined(UNIX) || defined(__OS2__) || defined(PSP)
#if defined(UNIX) || defined(__OS2__)
static bool InputWaiting()
{
struct timeval tv;
@ -242,7 +238,7 @@ static void DedicatedHandleKeyInput()
if (_exit_game) return;
#if defined(UNIX) || defined(__OS2__) || defined(PSP)
#if defined(UNIX) || defined(__OS2__)
if (fgets(input_line, lengthof(input_line), stdin) == NULL) return;
#else
/* Handle console input, and signal console thread, it can accept input again */
@ -269,7 +265,7 @@ void VideoDriver_Dedicated::MainLoop()
uint32 next_tick = cur_ticks + MILLISECONDS_PER_TICK;
/* Signal handlers */
#if defined(UNIX) || defined(PSP)
#if defined(UNIX)
signal(SIGTERM, DedicatedSignalHandler);
signal(SIGINT, DedicatedSignalHandler);
signal(SIGQUIT, DedicatedSignalHandler);