- add Guitar Grip device;
This commit is contained in:
mtabachenko 2009-07-08 23:26:35 +00:00
parent 20bbb21f56
commit 5d2a46c1ad
9 changed files with 120 additions and 3 deletions

View File

@ -40,13 +40,16 @@ extern ADDONINTERFACE addonNone;
extern ADDONINTERFACE addonCFlash;
extern ADDONINTERFACE addonRumblePak;
extern ADDONINTERFACE addonGBAgame;
extern ADDONINTERFACE addonGuitarGrip;
//extern ADDONINTERFACE addonExternalMic;
ADDONINTERFACE addonList[NDS_ADDON_COUNT] = {
addonNone,
addonCFlash,
addonRumblePak,
addonGBAgame};
addonGBAgame,
addonGuitarGrip
};
ADDONINTERFACE addon = addonCFlash; // default none pak
u8 addon_type = NDS_ADDON_CFLASH;

View File

@ -65,6 +65,7 @@ enum {
NDS_ADDON_CFLASH, // compact flash
NDS_ADDON_RUMBLEPAK, // rumble pack
NDS_ADDON_GBAGAME, // gba game in slot
NDS_ADDON_GUITARGRIP, // Guitar Grip
//NDS_ADDON_EXTERNALMIC,
NDS_ADDON_COUNT // use for counter addons - MUST TO BE LAST!!!
};
@ -90,4 +91,6 @@ extern void addonsClose(); // Shutdown addons
extern void addonsReset(); // Reset addon
extern BOOL addonsChangePak(u8 type); // change current adddon
extern void guitarGrip_setKey(bool green, bool red, bool yellow, bool blue); // Guitar grip keys
#endif

View File

@ -0,0 +1,79 @@
/* Copyright (C) 2006 yopyop
yopyop156@ifrance.com
yopyop156.ifrance.com
Copyright (C) 2009 CrazyMax
Copyright (C) 2009 DeSmuME team
This file is part of DeSmuME
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
DeSmuME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "../addons.h"
#include <string.h>
static u8 guitarKeyStatus = 0;
static BOOL guitarGrip_init(void) { return (TRUE); }
static void guitarGrip_reset(void)
{
//INFO("GuitarGrip: Reset\n");
guitarKeyStatus = 0;
}
static void guitarGrip_close(void) {}
static void guitarGrip_config(void) {}
static void guitarGrip_write08(u32 adr, u8 val) {}
static void guitarGrip_write16(u32 adr, u16 val) {}
static void guitarGrip_write32(u32 adr, u32 val) {}
static u8 guitarGrip_read08(u32 adr)
{
//INFO("GuitarGrip: read 08 at 0x%08X\n", adr);
if (adr == 0x0A000000) return (~guitarKeyStatus);
return (0x0);
}
static u16 guitarGrip_read16(u32 adr)
{
//INFO("GuitarGrip: read 16 at 0x%08X\n", adr);
if (adr == 0x080000BE) return (0xF9FF);
if (adr == 0x0801FFFE) return (0xF9FF);
return (0);
}
static u32 guitarGrip_read32(u32 adr)
{
//INFO("GuitarGrip: read 32 at 0x%08X\n", adr);
return (0);
}
static void guitarGrip_info(char *info) { strcpy(info, "Guitar Grid for Guitar Hero games"); }
void guitarGrip_setKey(bool green, bool red, bool yellow, bool blue)
{
guitarKeyStatus = 0 | (green << 6) | (red << 5) | (yellow << 4) | (blue << 3);
}
ADDONINTERFACE addonGuitarGrip = {
"Guitar Grid",
guitarGrip_init,
guitarGrip_reset,
guitarGrip_close,
guitarGrip_config,
guitarGrip_write08,
guitarGrip_write16,
guitarGrip_write32,
guitarGrip_read08,
guitarGrip_read16,
guitarGrip_read32,
guitarGrip_info};

View File

@ -737,6 +737,10 @@
RelativePath="..\addons\gbagame.cpp"
>
</File>
<File
RelativePath="..\addons\guitarGrip.cpp"
>
</File>
<File
RelativePath="..\addons\none.cpp"
>

View File

@ -672,6 +672,10 @@
RelativePath="..\addons\gbagame.cpp"
>
</File>
<File
RelativePath="..\addons\guitarGrip.cpp"
>
</File>
<File
RelativePath="..\addons\none.cpp"
>

View File

@ -287,18 +287,33 @@ BOOL CALLBACK GbaSlotGBAgame(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam)
return FALSE;
}
BOOL CALLBACK GbaSlotGuitarGrip(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam)
{
switch(msg)
{
case WM_INITDIALOG:
{
_OKbutton = TRUE;
return TRUE;
}
}
return FALSE;
}
u32 GBAslot_IDDs[NDS_ADDON_COUNT] = {
IDD_GBASLOT_NONE,
IDD_GBASLOT_CFLASH,
IDD_GBASLOT_RUMBLEPAK,
IDD_GBASLOT_GBAGAME
IDD_GBASLOT_GBAGAME,
IDD_GBASLOT_GUITARGRIP
};
DLGPROC GBAslot_Procs[NDS_ADDON_COUNT] = {
GbaSlotNone,
GbaSlotCFlash,
GbaSlotRumblePak,
GbaSlotGBAgame
GbaSlotGBAgame,
GbaSlotGuitarGrip
};
@ -416,6 +431,8 @@ void GBAslotDialog(HWND hwnd)
strcpy(GBAgameName, tmp_gbagame_filename);
WritePrivateProfileString("GBAslot.GBAgame","filename",GBAgameName,IniName);
break;
case NDS_ADDON_GUITARGRIP:
break;
default:
return;
}

View File

@ -1685,6 +1685,8 @@ int _main()
}
// TODO: check for file exist
break;
case NDS_ADDON_GUITARGRIP:
break;
default:
addon_type = NDS_ADDON_NONE;
break;

View File

@ -297,13 +297,17 @@
#define IDC_EDIT07 1005
#define IDC_MROM 1005
#define IDC_ROTATE180 1005
#define IDC_GGREEN 1005
#define IDC_EDIT12 1006
#define IDC_ROTATE270 1006
#define IDC_SPU_CACHE 1006
#define IDC_GRED 1006
#define IDC_ARM7BIOSBROWSE 1007
#define IDC_EDIT06 1007
#define IDC_GYELLOW 1007
#define IDC_EDIT09 1008
#define IDC_MEMVIEWBOX 1008
#define IDC_GBLUE 1008
#define IDC_ADDRESS 1009
#define IDC_BIOSSWIS 1009
#define IDC_EDIT10 1009
@ -644,6 +648,7 @@
#define IDD_IOREG_VIEW_DMA 10006
#define IDD_IOREG_VIEW_TIMERS 10007
#define IDD_IOREG_VIEW_IPC_ROM 10008
#define IDD_GBASLOT_GUITARGRIP 10009
#define IDM_FILE_STOPAVI 40000
#define IDM_SCREENSEP_NONE 40000
#define IDM_FILE_STOPWAV 40001

Binary file not shown.