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

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