Skip to content

Commit

Permalink
-Button, Joystick support for Caanoo added
Browse files Browse the repository at this point in the history
  • Loading branch information
SiENcE committed Sep 22, 2010
1 parent 6431cf2 commit 946c981
Show file tree
Hide file tree
Showing 5 changed files with 260 additions and 350 deletions.
2 changes: 1 addition & 1 deletion Makefile_cygwin.caanoo
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ STRIP := ${BINPATH}/$(ARCH)-strip
AS := ${BINPATH}/$(ARCH)-as
GASM := ${BINPATH}/$(ARCH)-g++

OPTIMISE = -mcpu=arm926ej-s -mtune=arm926ej-s -g -I. -I$(TOOLCHAINDIR)/$(ARCH)/include -O3 -D_ZAURUS -DUSE_SA1
OPTIMISE = -mcpu=arm926ej-s -mtune=arm926ej-s -g -I. -I$(TOOLCHAINDIR)/$(ARCH)/include -O3 -D_ZAURUS -DCAANOO -DUSE_SA1
OPTIMISE += -ffast-math -fexpensive-optimizations -finline -finline-functions -falign-functions=32 -falign-loops -falign-labels -falign-jumps -fomit-frame-pointer

CCFLAGS = $(OPTIMISE) \
Expand Down
176 changes: 88 additions & 88 deletions dsp3emu.cpp
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
/*******************************************************************************
Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
(c) Copyright 1996 - 2002 Gary Henderson ([email protected]) and
Jerremy Koot ([email protected])
(c) Copyright 2001 - 2004 John Weidman ([email protected])
(c) Copyright 2002 - 2004 Brad Jorsch ([email protected]),
funkyass ([email protected]),
Joel Yliluoma (http://iki.fi/bisqwit/)
Kris Bleakley ([email protected]),
Matthew Kendora,
Nach ([email protected]),
Peter Bortas ([email protected]) and
zones ([email protected])
C4 x86 assembler and some C emulation code
(c) Copyright 2000 - 2003 zsKnight ([email protected]),
_Demo_ ([email protected]), and Nach
C4 C++ code
(c) Copyright 2003 Brad Jorsch
DSP-1 emulator code
(c) Copyright 1998 - 2004 Ivar ([email protected]), _Demo_, Gary Henderson,
John Weidman, neviksti ([email protected]),
Kris Bleakley, Andreas Naive
DSP-2 emulator code
(c) Copyright 2003 Kris Bleakley, John Weidman, neviksti, Matthew Kendora, and
Lord Nightmare ([email protected]
OBC1 emulator code
(c) Copyright 2001 - 2004 zsKnight, pagefault ([email protected]) and
Kris Bleakley
Ported from x86 assembler to C by sanmaiwashi
SPC7110 and RTC C++ emulator code
(c) Copyright 2002 Matthew Kendora with research by
zsKnight, John Weidman, and Dark Force
S-DD1 C emulator code
(c) Copyright 2003 Brad Jorsch with research by
Andreas Naive and John Weidman
S-RTC C emulator code
(c) Copyright 2001 John Weidman
ST010 C++ emulator code
(c) Copyright 2003 Feather, Kris Bleakley, John Weidman and Matthew Kendora
Super FX x86 assembler emulator code
(c) Copyright 1998 - 2003 zsKnight, _Demo_, and pagefault
Super FX C emulator code
(c) Copyright 1997 - 1999 Ivar, Gary Henderson and John Weidman
SH assembler code partly based on x86 assembler code
(c) Copyright 2002 - 2004 Marcus Comstedt ([email protected])
Specific ports contains the works of other authors. See headers in
individual files.
Snes9x homepage: http://www.snes9x.com
Permission to use, copy, modify and distribute Snes9x in both binary and
source form, for non-commercial purposes, is hereby granted without fee,
providing that this license information and copyright notice appear with
all copies and any derived work.
This software is provided 'as-is', without any express or implied
warranty. In no event shall the authors be held liable for any damages
arising from the use of this software.
Snes9x is freeware for PERSONAL USE only. Commercial users should
seek permission of the copyright holders first. Commercial use includes
charging money for Snes9x or software derived from Snes9x.
The copyright holders request that bug fixes and improvements to the code
should be forwarded to them so everyone can benefit from the modifications
in future versions.
Super NES and Super Nintendo Entertainment System are trademarks of
Nintendo Co., Limited and its subsidiary companies.
/*******************************************************************************
Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
(c) Copyright 1996 - 2002 Gary Henderson ([email protected]) and
Jerremy Koot ([email protected])
(c) Copyright 2001 - 2004 John Weidman ([email protected])
(c) Copyright 2002 - 2004 Brad Jorsch ([email protected]),
funkyass ([email protected]),
Joel Yliluoma (http://iki.fi/bisqwit/)
Kris Bleakley ([email protected]),
Matthew Kendora,
Nach ([email protected]),
Peter Bortas ([email protected]) and
zones ([email protected])
C4 x86 assembler and some C emulation code
(c) Copyright 2000 - 2003 zsKnight ([email protected]),
_Demo_ ([email protected]), and Nach
C4 C++ code
(c) Copyright 2003 Brad Jorsch
DSP-1 emulator code
(c) Copyright 1998 - 2004 Ivar ([email protected]), _Demo_, Gary Henderson,
John Weidman, neviksti ([email protected]),
Kris Bleakley, Andreas Naive
DSP-2 emulator code
(c) Copyright 2003 Kris Bleakley, John Weidman, neviksti, Matthew Kendora, and
Lord Nightmare ([email protected]
OBC1 emulator code
(c) Copyright 2001 - 2004 zsKnight, pagefault ([email protected]) and
Kris Bleakley
Ported from x86 assembler to C by sanmaiwashi
SPC7110 and RTC C++ emulator code
(c) Copyright 2002 Matthew Kendora with research by
zsKnight, John Weidman, and Dark Force
S-DD1 C emulator code
(c) Copyright 2003 Brad Jorsch with research by
Andreas Naive and John Weidman
S-RTC C emulator code
(c) Copyright 2001 John Weidman
ST010 C++ emulator code
(c) Copyright 2003 Feather, Kris Bleakley, John Weidman and Matthew Kendora
Super FX x86 assembler emulator code
(c) Copyright 1998 - 2003 zsKnight, _Demo_, and pagefault
Super FX C emulator code
(c) Copyright 1997 - 1999 Ivar, Gary Henderson and John Weidman
SH assembler code partly based on x86 assembler code
(c) Copyright 2002 - 2004 Marcus Comstedt ([email protected])
Specific ports contains the works of other authors. See headers in
individual files.
Snes9x homepage: http://www.snes9x.com
Permission to use, copy, modify and distribute Snes9x in both binary and
source form, for non-commercial purposes, is hereby granted without fee,
providing that this license information and copyright notice appear with
all copies and any derived work.
This software is provided 'as-is', without any express or implied
warranty. In no event shall the authors be held liable for any damages
arising from the use of this software.
Snes9x is freeware for PERSONAL USE only. Commercial users should
seek permission of the copyright holders first. Commercial use includes
charging money for Snes9x or software derived from Snes9x.
The copyright holders request that bug fixes and improvements to the code
should be forwarded to them so everyone can benefit from the modifications
in future versions.
Super NES and Super Nintendo Entertainment System are trademarks of
Nintendo Co., Limited and its subsidiary companies.
*******************************************************************************/

uint16 DSP3_DataROM[1024] = {
Expand Down Expand Up @@ -725,4 +725,4 @@ uint8 DSP3GetByte(uint16 address)
}

return (uint8) DSP3_SR;
}
}
40 changes: 40 additions & 0 deletions unix/keydef.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
#ifdef CAANOO

#define A_1 0
#define X_1 1
#define B_1 2
#define Y_1 3
#define L_1 4
#define R_1 5
#define START_1 6
#define SELECT_1 9
#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
#define B_1 1
#define X_1 2
Expand Down Expand Up @@ -36,3 +75,4 @@
#define CTRLL 32
#define CTRLR 33

#endif
19 changes: 18 additions & 1 deletion unix/svga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,37 @@ void S9xTextMode ()
}
#endif

extern uint8 *keyssnes;
#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 )
{
printf("Could not initialize SDL(%s)\n", SDL_GetError());
S9xExit();
}
#endif
atexit(SDL_Quit);

// No more MOUSE-CURSOR
SDL_ShowCursor(SDL_DISABLE);

#ifdef CAANOO
keyssnes = SDL_JoystickOpen(0);
#else
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);
Expand Down
Loading

0 comments on commit 946c981

Please sign in to comment.