Skip to content

Commit

Permalink
-button mappings for caanoo updated
Browse files Browse the repository at this point in the history
  • Loading branch information
SiENcE committed Sep 22, 2010
1 parent 946c981 commit 3151fee
Show file tree
Hide file tree
Showing 8 changed files with 214 additions and 236 deletions.
2 changes: 1 addition & 1 deletion Makefile_cygwin.caanoo
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
UNZIP=1
#GLIDE=1
#OPENGL=1
#THREAD_SOUND=1
THREAD_SOUND=1
CHEATS=1
#ASMKREED=1
#ZSNESC4=1
Expand Down
2 changes: 1 addition & 1 deletion Makefile_cygwin.dingoo
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ STRIP := $(BINPATH)/mipsel-linux-uclibc-strip
AS := $(BINPATH)/mipsel-linux-uclibc-as
GASM := $(BINPATH)/mipsel-linux-uclibc-g++

OPTIMISE= -D_ZAURUS -O2 -ffast-math -fstrict-aliasing -fomit-frame-pointer -ftree-vectorize -funroll-all-loops -fpeel-loops -ftracer -funswitch-loops -finline-functions -G 0 -march=mips32 -mtune=r4600 -mno-mips16 -msoft-float
OPTIMISE= -D_ZAURUS -O3 -ffast-math -fstrict-aliasing -fomit-frame-pointer -ftree-vectorize -funroll-all-loops -fpeel-loops -ftracer -funswitch-loops -finline-functions -G 0 -march=mips32 -mtune=r4600 -mno-mips16 -msoft-float
# -fprofile-use -ftest-coverage -fprofile-arcs

CCFLAGS = $(OPTIMISE) \
Expand Down
4 changes: 2 additions & 2 deletions Makefile_cygwin.wizz
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ STRIP := ${BINPATH}/$(ARCH)-strip
AS := ${BINPATH}/$(ARCH)-as
GASM := ${BINPATH}/$(ARCH)-g++

# OPTIMISE= -mcpu=arm926ej-s -mtune=arm926ej-s -D_ZAURUS -O2 -ffast-math -fstrict-aliasing -fomit-frame-pointer -ftree-vectorize -funroll-all-loops -fpeel-loops -ftracer -funswitch-loops -finline-functions 0 -msoft-float
OPTIMISE = -mcpu=arm926ej-s -mtune=arm926ej-s -g -I. -I$(TOOLCHAINDIR)/arm-open2x-linux/include -O3 -D_ZAURUS -D__WIZ__ -DUSE_SA1
OPTIMISE += -ffast-math -fexpensive-optimizations -finline -finline-functions -msoft-float -falign-functions=32 -falign-loops -falign-labels -falign-jumps -fomit-frame-pointer
OPTIMISE += -ffast-math -fexpensive-optimizations -finline -finline-functions -falign-functions=32 -falign-loops -falign-labels -falign-jumps -fomit-frame-pointer
#-msoft-float

CCFLAGS = $(OPTIMISE) \
-I. \
Expand Down
1 change: 0 additions & 1 deletion display.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ void S9xInitInputDevices ();
void S9xSetTitle (const char *title);
void S9xProcessEvents (bool8_32 block);
void S9xPutImage (int width, int height);
void S9xParseDisplayArg (char **argv, int &index, int argc);
void S9xToggleSoundChannel (int channel);
void S9xSetInfoString (const char *string);
int S9xMinCommandLineArgs ();
Expand Down
5 changes: 3 additions & 2 deletions unix/caanoo.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
#define CAANOO_BUTTON_Y 3
#define CAANOO_BUTTON_L 4
#define CAANOO_BUTTON_R 5
#define CAANOO_BUTTON_START 6
#define CAANOO_BUTTON_SELECT 9
#define CAANOO_BUTTON_HOME 6
#define CAANOO_BUTTON_HELP1 8
#define CAANOO_BUTTON_HELP2 9
#define CAANOO_BUTTON_UP 11
#define CAANOO_BUTTON_DOWN 12
#define CAANOO_BUTTON_LEFT 13
Expand Down
41 changes: 11 additions & 30 deletions unix/keydef.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,14 @@
#define Y_1 3
#define L_1 4
#define R_1 5
#define START_1 6
#define SELECT_1 9
#define QUIT 6 //CAANOO_BUTTON_HOME
#define START_1 8 //CAANOO_BUTTON_HELP1
#define SELECT_1 9 //CAANOO_BUTTON_HELP2
#define UP_1 11
#define DOWN_1 12
#define LEFT_1 13
#define RIGHT_1 14

#define ACCEL 50
#define QUIT 51
#define HELP 52

#define SHIFTL 30
#define SHIFTR 31
#define CTRLL 32
#define CTRLR 33

#define UP_2 20
#define DOWN_2 21
#define LEFT_2 22
#define RIGHT_2 23
#define LU_2 24
#define LD_2 25
#define RU_2 26
#define RD_2 27

#define ACCEL 50
#define QUIT 51
#define HELP 52

#else

#define A_1 0
Expand All @@ -43,24 +22,26 @@
#define Y_1 3
#define L_1 4
#define R_1 5
#define START_1 12
#define SELECT_1 13
#define UP_1 16
#define DOWN_1 17
#define LEFT_1 18
#define RIGHT_1 19

#define A_2 6
#define B_2 7
#define X_2 8
#define Y_2 9
#define L_2 10
#define R_2 11
#define START_1 12
#define SELECT_1 13
#define START_2 14
#define SELECT_2 15
#define UP_1 16
#define DOWN_1 17
#define LEFT_1 18
#define RIGHT_1 19
#define UP_2 20
#define DOWN_2 21
#define LEFT_2 22
#define RIGHT_2 23

#define LU_2 24
#define LD_2 25
#define RU_2 26
Expand Down
135 changes: 52 additions & 83 deletions unix/svga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
#include <SDL/SDL.h>

#ifdef PANDORA
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#endif

#include "snes9x.h"
Expand All @@ -68,15 +68,14 @@

#define COUNT(a) (sizeof(a) / sizeof(a[0]))

SDL_Surface *screen, *gfxscreen;// *hwscreen;
uint16 *RGBconvert;
SDL_Surface *screen, *gfxscreen;
extern uint32 xs, ys, cl, cs;
extern bool8_32 Scale;

#ifdef PANDORA
#include "blitscale.h"
extern blit_scaler_e g_scale;
extern unsigned char g_fullscreen;
#include "blitscale.h"
extern blit_scaler_e g_scale;
extern unsigned char g_fullscreen;
#endif

#ifndef _ZAURUS
Expand All @@ -94,27 +93,25 @@ void S9xTextMode ()
}
#endif


#ifdef CAANOO
extern SDL_Joystick* keyssnes;
#else
extern uint8 *keyssnes;
#endif


void S9xInitDisplay (int /*argc*/, char ** /*argv*/)
{
#ifdef CAANOO
if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK|(Settings.NextAPUEnabled ? SDL_INIT_AUDIO : 0)) < 0 )
{
printf("Could not initialize SDL(%s)\n", SDL_GetError());
S9xExit();
}
#else
if (SDL_Init(SDL_INIT_VIDEO | (Settings.NextAPUEnabled ? SDL_INIT_AUDIO : 0)) < 0 )
{
#endif
{
printf("Could not initialize SDL(%s)\n", SDL_GetError());
S9xExit();
}
#endif
atexit(SDL_Quit);

// No more MOUSE-CURSOR
Expand All @@ -126,8 +123,6 @@ void S9xInitDisplay (int /*argc*/, char ** /*argv*/)
keyssnes = SDL_GetKeyState(NULL);
#endif

//screen = SDL_CreateRGBSurface(SDL_HWSURFACE, xs, ys, 16, 0, 0, 0, 0);
//hwscreen = SDL_SetVideoMode(xs, ys, 16, SDL_HWSURFACE|SDL_FULLSCREEN);
#ifdef PANDORA
//screen = SDL_SetVideoMode(xs * blit_scalers [ g_scale ].scale_x, ys * blit_scalers [ g_scale ].scale_y, 16,
// g_fullscreen ? SDL_SWSURFACE|SDL_FULLSCREEN : SDL_SWSURFACE);
Expand All @@ -144,20 +139,22 @@ void S9xInitDisplay (int /*argc*/, char ** /*argv*/)
}

// for LCD refresh rate
switch ( (int) Memory.ROMFramesPerSecond ) {
case 60:
fprintf ( stderr, "Assuming 60hz LCD\n" );
break; // nothing to do
case 50:
fprintf ( stderr, "Switching to 50hz LCD\n" );
system ( "/usr/bin/sudo -n /usr/pandora/scripts/op_lcdrate.sh 50" );
break;
default:
fprintf ( stderr, "Game reports %d hz display; ignoring.\n", (int) Memory.ROMFramesPerSecond );
break;
switch ( (int) Memory.ROMFramesPerSecond )
{
case 60:
fprintf ( stderr, "Assuming 60hz LCD\n" );
break; // nothing to do
case 50:
fprintf ( stderr, "Switching to 50hz LCD\n" );
system ( "/usr/bin/sudo -n /usr/pandora/scripts/op_lcdrate.sh 50" );
break;
default:
fprintf ( stderr, "Game reports %d hz display; ignoring.\n", (int) Memory.ROMFramesPerSecond );
break;
}

#else
//DINGOO / CAANOO
screen = SDL_SetVideoMode(xs, ys, 16, SDL_SWSURFACE); //SDL_HWSURFACE
#endif

Expand Down Expand Up @@ -199,27 +196,15 @@ void S9xInitDisplay (int /*argc*/, char ** /*argv*/)
GFX.SubScreen = (uint8 *)malloc(512 * 480 * 2);
GFX.ZBuffer = (uint8 *)malloc(512 * 480 * 2);
GFX.SubZBuffer = (uint8 *)malloc(512 * 480 * 2);

/*
RGBconvert = (uint16 *)malloc(65536 * 2);
if (!RGBconvert)
{
// OutOfMemory();
S9xExit();
}
for (uint32 i = 0; i < 65536; i++)
((uint16 *)(RGBconvert))[i] = ((i >> 11) << 10) | ((((i >> 5) & 63) >> 1) << 5) | (i & 31);
*/
}

void S9xDeinitDisplay ()
{
// SDL_FreeSurface(gfxscreen);

#ifdef PANDORA
// for vsync
extern int g_fb;
if ( g_fb >= 0 ) {
// for vsync
extern int g_fb;
if ( g_fb >= 0 )
{
close ( g_fb );
}
// for LCD refresh
Expand Down Expand Up @@ -250,53 +235,37 @@ const char *S9xSelectFilename (const char *def, const char *dir1,
S9xTextMode ();
printf ("\n%s (default: %s): ", title, def);
fflush (stdout);

if (fgets (buffer, sizeof (buffer) - 1, stdin))
{
char *p = buffer;
while (isspace (*p) || *p == '\n')
p++;
if (!*p)
{
strcpy (buffer, def);
p = buffer;
}

char *q = strrchr (p, '\n');
if (q)
*q = 0;

char fname [PATH_MAX];
char drive [_MAX_DRIVE];
char dir [_MAX_DIR];
char ext [_MAX_EXT];

_splitpath (p, drive, dir, fname, ext);
_makepath (path, drive, *dir ? dir : dir1, fname, *ext ? ext : ext1);
S9xGraphicsMode ();
return (path);
char *p = buffer;
while (isspace (*p) || *p == '\n')
p++;
if (!*p)
{
strcpy (buffer, def);
p = buffer;
}
char *q = strrchr (p, '\n');
if (q)
*q = 0;
char fname [PATH_MAX];
char drive [_MAX_DRIVE];
char dir [_MAX_DIR];
char ext [_MAX_EXT];
_splitpath (p, drive, dir, fname, ext);
_makepath (path, drive, *dir ? dir : dir1, fname, *ext ? ext : ext1);
S9xGraphicsMode ();
return (path);
}

S9xGraphicsMode ();
return (NULL);
}

void S9xParseDisplayArg (char **argv, int &ind, int)
{
if (strcasecmp (argv [ind], "-scale") == 0 ||
strcasecmp (argv [ind], "-sc") == 0)
stretch = TRUE;
else
if (strcasecmp (argv [ind], "-y") == 0 ||
strcasecmp (argv [ind], "-interpolation") == 0)
{
interpolation = TRUE;
Settings.SixteenBit = TRUE;
Settings.SupportHiRes = TRUE;
Settings.Transparency = TRUE;
}
else
S9xUsage ();
}

void S9xExtraUsage ()
{
}
Expand Down
Loading

0 comments on commit 3151fee

Please sign in to comment.