Commit 39c8e8d7 authored by alistert's avatar alistert

Applied Pickle's GP2X/Wiz patch.

parent 59165d12
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "controls.h" #include "controls.h"
#ifdef WIZ #if defined(WIZ) || defined(GP2X)
#include "platforms/wiz.h" #include "platforms/wiz.h"
#endif #endif
...@@ -53,7 +53,7 @@ Controls::Controls () { ...@@ -53,7 +53,7 @@ Controls::Controls () {
keys[C_STATS].key = SDLK_F9; keys[C_STATS].key = SDLK_F9;
keys[C_PAUSE].key = SDLK_p; keys[C_PAUSE].key = SDLK_p;
#ifdef WIZ #if defined(WIZ) || defined(GP2X)
buttons[C_UP].button = GP2X_BUTTON_UP; buttons[C_UP].button = GP2X_BUTTON_UP;
buttons[C_DOWN].button = GP2X_BUTTON_DOWN; buttons[C_DOWN].button = GP2X_BUTTON_DOWN;
buttons[C_LEFT].button = GP2X_BUTTON_LEFT; buttons[C_LEFT].button = GP2X_BUTTON_LEFT;
......
...@@ -61,15 +61,14 @@ SDL_Surface * createSurface (unsigned char * pixels, int width, int height) { ...@@ -61,15 +61,14 @@ SDL_Surface * createSurface (unsigned char * pixels, int width, int height) {
void createFullscreen () { void createFullscreen () {
SDL_ShowCursor(SDL_DISABLE); #if defined(WIZ) || defined(GP2X)
screen = SDL_SetVideoMode(320, 240, 8,
#ifdef WIZ
screen = SDL_SetVideoMode(screenW, screenH, 8,
SDL_FULLSCREEN | SDL_SWSURFACE | SDL_HWPALETTE); SDL_FULLSCREEN | SDL_SWSURFACE | SDL_HWPALETTE);
#else #else
screen = SDL_SetVideoMode(screenW, screenH, 8, screen = SDL_SetVideoMode(screenW, screenH, 8,
SDL_FULLSCREEN | SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWPALETTE); SDL_FULLSCREEN | SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWPALETTE);
#endif #endif
SDL_ShowCursor(SDL_DISABLE);
SDL_SetPalette(screen, SDL_LOGPAL, logicalPalette, 0, 256); SDL_SetPalette(screen, SDL_LOGPAL, logicalPalette, 0, 256);
SDL_SetPalette(screen, SDL_PHYSPAL, currentPalette, 0, 256); SDL_SetPalette(screen, SDL_PHYSPAL, currentPalette, 0, 256);
......
...@@ -48,10 +48,15 @@ ModPlugFile *musicFile; ...@@ -48,10 +48,15 @@ ModPlugFile *musicFile;
#define MUSIC_RESAMPLEMODE MODPLUG_RESAMPLE_LINEAR #define MUSIC_RESAMPLEMODE MODPLUG_RESAMPLE_LINEAR
#define MUSIC_FLAGS MODPLUG_ENABLE_MEGABASS #define MUSIC_FLAGS MODPLUG_ENABLE_MEGABASS
#else #else
#if defined(WIZ) || defined(GP2X)
#define MUSIC_RESAMPLEMODE MODPLUG_RESAMPLE_LINEAR
#define MUSIC_FLAGS 0
#else
#define MUSIC_RESAMPLEMODE MODPLUG_RESAMPLE_FIR #define MUSIC_RESAMPLEMODE MODPLUG_RESAMPLE_FIR
#define MUSIC_FLAGS MODPLUG_ENABLE_NOISE_REDUCTION | MODPLUG_ENABLE_REVERB | MODPLUG_ENABLE_MEGABASS | MODPLUG_ENABLE_SURROUND #define MUSIC_FLAGS MODPLUG_ENABLE_NOISE_REDUCTION | MODPLUG_ENABLE_REVERB | MODPLUG_ENABLE_MEGABASS | MODPLUG_ENABLE_SURROUND
#endif #endif
#endif #endif
#endif
SDL_AudioSpec audioSpec; SDL_AudioSpec audioSpec;
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#include <string.h> #include <string.h>
#ifdef WIZ #if defined(WIZ) || defined(GP2X)
#include "platforms/wiz.h" #include "platforms/wiz.h"
extern int volume; extern int volume;
extern int volume_direction; extern int volume_direction;
...@@ -570,7 +570,7 @@ int loop (int type) { ...@@ -570,7 +570,7 @@ int loop (int type) {
} }
#endif #endif
#ifdef WIZ #if defined(WIZ) || defined(GP2X)
SDL_ShowCursor(SDL_DISABLE); SDL_ShowCursor(SDL_DISABLE);
#endif #endif
// Break statement intentionally omitted // Break statement intentionally omitted
...@@ -584,7 +584,7 @@ int loop (int type) { ...@@ -584,7 +584,7 @@ int loop (int type) {
if (ret != E_NONE) return ret; if (ret != E_NONE) return ret;
#ifdef WIZ #if defined(WIZ) || defined(GP2X)
if (event.jbutton.button == GP2X_BUTTON_VOLUP ) { if (event.jbutton.button == GP2X_BUTTON_VOLUP ) {
if( event.type == SDL_JOYBUTTONDOWN ) if( event.type == SDL_JOYBUTTONDOWN )
volume_direction = VOLUME_UP; volume_direction = VOLUME_UP;
...@@ -655,7 +655,7 @@ int loop (int type) { ...@@ -655,7 +655,7 @@ int loop (int type) {
} }
#ifdef WIZ #if defined(WIZ) || defined(GP2X)
WIZ_AdjustVolume( volume_direction ); WIZ_AdjustVolume( volume_direction );
#endif #endif
......
...@@ -258,8 +258,6 @@ int Menu::setupJoystick () { ...@@ -258,8 +258,6 @@ int Menu::setupJoystick () {
int Menu::setupResolution () { int Menu::setupResolution () {
#ifndef FULLSCREEN_ONLY
int widthOptions[] = {320, 400, 512, 640, 720, 768, 800, 960, 1024, 1152, int widthOptions[] = {320, 400, 512, 640, 720, 768, 800, 960, 1024, 1152,
1280, 1440, 1600, 1920}; 1280, 1440, 1600, 1920};
int heightOptions[] = {200, 240, 300, 384, 400, 480, 576, 600, 720, 768, int heightOptions[] = {200, 240, 300, 384, 400, 480, 576, 600, 720, 768,
...@@ -269,20 +267,25 @@ int Menu::setupResolution () { ...@@ -269,20 +267,25 @@ int Menu::setupResolution () {
dimension = 0; dimension = 0;
if (fullscreen) #ifndef FULLSCREEN_ONLY
if (!fullscreen)
resolutions = SDL_ListModes(NULL, resolutions = SDL_ListModes(NULL,
SDL_FULLSCREEN | SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWPALETTE); SDL_RESIZABLE | SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWPALETTE);
else else
#endif
resolutions = SDL_ListModes(NULL, resolutions = SDL_ListModes(NULL,
SDL_RESIZABLE | SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWPALETTE); SDL_FULLSCREEN | SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWPALETTE);
#if defined(WIZ) || defined(GP2X)
maxW = 320;
maxH = 240;
#else
if (resolutions == (SDL_Rect **)(-1)) { if (resolutions == (SDL_Rect **)(-1)) {
maxW = 1920; maxW = 1920;
maxH = 1200; maxH = 1200;
} else { } else {
maxW = 320; maxW = 320;
maxH = 200; maxH = 200;
...@@ -292,8 +295,8 @@ int Menu::setupResolution () { ...@@ -292,8 +295,8 @@ int Menu::setupResolution () {
if (resolutions[count]->h > maxH) maxH = resolutions[count]->h; if (resolutions[count]->h > maxH) maxH = resolutions[count]->h;
} }
} }
#endif
while (true) { while (true) {
...@@ -386,15 +389,19 @@ int Menu::setupResolution () { ...@@ -386,15 +389,19 @@ int Menu::setupResolution () {
playSound(S_ORB); playSound(S_ORB);
if (fullscreen) createFullscreen(); #ifndef FULLSCREEN_ONLY
else createWindow(); if (!fullscreen)
{
createWindow();
}
else
#endif
createFullscreen();
} }
} }
#endif
return E_NONE; return E_NONE;
} }
...@@ -461,9 +468,9 @@ int Menu::setup () { ...@@ -461,9 +468,9 @@ int Menu::setup () {
break; break;
case 1: case 1:
#if !defined(WIZ) && !defined(GP2X)
setupKeyboard(); setupKeyboard();
#endif
break; break;
case 2: case 2:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment