[4.3.5 - February 06, 2016]
* Added Fix94 wiiflow plugin mode * Removed sound from GUI and now gets better perfomance/FPS on games like Yoshi's Island and Kirby Dream Land 3.
@ -27,20 +27,20 @@ INCLUDES := source source/snes9x
|
|||||||
# options for code generation
|
# options for code generation
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
|
||||||
CFLAGS = -g -O3 -Wall $(MACHDEP) $(INCLUDE) \
|
CFLAGS = -g -O3 -Wall $(MACHDEP) $(INCLUDE) -DNO_SOUND \
|
||||||
-DZLIB -DRIGHTSHIFT_IS_SAR -DCPU_SHUTDOWN -DCORRECT_VRAM_READS \
|
-DZLIB -DRIGHTSHIFT_IS_SAR -DCPU_SHUTDOWN -DCORRECT_VRAM_READS \
|
||||||
-D_SZ_ONE_DIRECTORY -D_LZMA_IN_CB -D_LZMA_OUT_READ \
|
-D_SZ_ONE_DIRECTORY -D_LZMA_IN_CB -D_LZMA_OUT_READ \
|
||||||
-fomit-frame-pointer \
|
-fomit-frame-pointer \
|
||||||
-Wno-unused-parameter -Wno-strict-aliasing \
|
-Wno-unused-parameter -Wno-strict-aliasing \
|
||||||
-Wno-write-strings -Wno-parentheses
|
-Wno-write-strings -Wno-parentheses
|
||||||
CXXFLAGS = $(CFLAGS)
|
CXXFLAGS = $(CFLAGS)
|
||||||
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
|
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map,-wrap,wiiuse_register
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# any extra libraries we wish to link with the project
|
# any extra libraries we wish to link with the project
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
LIBS := -ldi -liso9660 -lpng -lmxml \
|
LIBS := -ldi -liso9660 -lpng -lmxml \
|
||||||
-lfat -lwiiuse -lz -lbte -lasnd -logc -lvorbisidec -lfreetype -ltinysmb
|
-lfat -lwiiuse -lwupc -lz -lbte -lasnd -logc -lvorbisidec -lfreetype -ltinysmb
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# list of directories containing libraries, this must be the top level containing
|
# list of directories containing libraries, this must be the top level containing
|
||||||
# include and lib
|
# include and lib
|
||||||
|
2
compile.cmd
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
make -f Makefile.wii
|
||||||
|
pause
|
@ -2,7 +2,7 @@
|
|||||||
<app version="1">
|
<app version="1">
|
||||||
<name>Snes9x GX</name>
|
<name>Snes9x GX</name>
|
||||||
<coder>Tantric</coder>
|
<coder>Tantric</coder>
|
||||||
<version>4.3.2</version>
|
<version>4.3.4</version>
|
||||||
<release_date>20121109</release_date>
|
<release_date>20121109</release_date>
|
||||||
<short_description>Super Nintendo Emulator</short_description>
|
<short_description>Super Nintendo Emulator</short_description>
|
||||||
<long_description>A port of Snes9x to the Wii.</long_description>
|
<long_description>A port of Snes9x to the Wii.</long_description>
|
||||||
|
35
readme.txt
@ -1,19 +1,8 @@
|
|||||||
╜≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈╜
|
_____________________________________________________________________________
|
||||||
:::::::::::::::в:::::::::::: .______ ::::::::::::::::::: _ ::::::::::
|
|
||||||
| _________ / ___╟/ -------. (_)'\ / `╟|
|
|
||||||
в /______ ╟ ---__---./ /___ _________ / --- / __| / \ ╟╡
|
|
||||||
в _______\ \ / ___ // /____//\_____ ╟ /---/ / ___ --- в
|
|
||||||
| ╟________/ / / / // /__ _______\ \ / / \ \ / / .||
|
|
||||||
::::::::::::::::/ /::--/_______\::.________/::::/ /:╜::\ _ \::::::в:::
|
|
||||||
:::::::╟:::::::/___\:::::::::::::::::::::::::::::/ /::::/__/ \--::╜::::::
|
|
||||||
╟:::::::::::::::::в:::::::::::::::╟::::в:::::::::\--/::::::::::::::::::в:::::
|
|
||||||
╜≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
|
|
||||||
|
|
||||||
в≈√╜≈√╜≈√╜≈√╜ √╜≈√╜≈√╜≈√╜≈√╜≈√╜≈√╜≈√╜≈√╜≈√╜≈ ╜≈√╜≈√╜≈√╜≈√╜≈√╜≈√╜≈√╜≈-╜≈√╜-√∙╛
|
|
||||||
|0O×øo· Snes9x GX ·oø×O0|
|
|0O×øo· Snes9x GX ·oø×O0|
|
||||||
| http://code.google.com/p/snes9x-gx |
|
| http://code.google.com/p/snes9x-gx |
|
||||||
| (Under GPL License) |
|
| (Under GPL License) |
|
||||||
`╗∙╗╗╗╗╗ ╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗ ╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗ ╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗ ╗╗╗╗╗╗╗╗╗╗╗╗╗'
|
|___________________________________________________________________________|
|
||||||
|
|
||||||
Snes9x GX is a Super Nintendo™ / Super Famicom emulator for the Nintendo Wii.
|
Snes9x GX is a Super Nintendo™ / Super Famicom emulator for the Nintendo Wii.
|
||||||
Snes9x GX is a port of Snes9x (http://www.snes9x.com).
|
Snes9x GX is a port of Snes9x (http://www.snes9x.com).
|
||||||
@ -43,6 +32,26 @@ Wii homebrew is WiiBrew (www.wiibrew.org).
|
|||||||
| UPDATE HISTORY |
|
| UPDATE HISTORY |
|
||||||
•˜———–—––-- - —————————––––– ———–—––-- - —————————––––– ———–—––-- - ————————•
|
•˜———–—––-- - —————————––––– ———–—––-- - —————————––––– ———–—––-- - ————————•
|
||||||
|
|
||||||
|
[4.3.4 - February 2, 2016]
|
||||||
|
|
||||||
|
* Fixed screenshot image dimensions
|
||||||
|
* Fixed screenshot option, it no longer creates an additional "dummy" file
|
||||||
|
* Fixed performance issues, reverted to previous vsync method
|
||||||
|
* Compiled with devkitPPC r26
|
||||||
|
Note: If compiled with devkitPPC r27 some games, like Final Fantasy III
|
||||||
|
and Chrono Trigger would crash on a battle
|
||||||
|
|
||||||
|
[4.3.3 - September 3, 2015July 7, 2015]
|
||||||
|
|
||||||
|
* Added Cebolleto's preview image support
|
||||||
|
* Added WiiUPro controller support
|
||||||
|
* Added a Scanline filter option
|
||||||
|
* Increase preview image size and reduce game list width
|
||||||
|
* Added a background to the preview image
|
||||||
|
* Added a Screenshot button
|
||||||
|
* Added a "WiiuPro" button on the button mapping menu
|
||||||
|
* Fixed the inverted color button selection that was in some option windows
|
||||||
|
|
||||||
[4.3.2 - November 9, 2012]
|
[4.3.2 - November 9, 2012]
|
||||||
|
|
||||||
* Fixed lag with GameCube controllers
|
* Fixed lag with GameCube controllers
|
||||||
|
@ -104,6 +104,8 @@ extern const u8 icon_settings_gamecube_png[];
|
|||||||
extern const u32 icon_settings_gamecube_png_size;
|
extern const u32 icon_settings_gamecube_png_size;
|
||||||
extern const u8 icon_settings_nunchuk_png[];
|
extern const u8 icon_settings_nunchuk_png[];
|
||||||
extern const u32 icon_settings_nunchuk_png_size;
|
extern const u32 icon_settings_nunchuk_png_size;
|
||||||
|
extern const u8 icon_settings_wiiupro_png[];
|
||||||
|
extern const u32 icon_settings_wiiupro_png_size;
|
||||||
|
|
||||||
extern const u8 icon_settings_snescontroller_png[];
|
extern const u8 icon_settings_snescontroller_png[];
|
||||||
extern const u32 icon_settings_snescontroller_png_size;
|
extern const u32 icon_settings_snescontroller_png_size;
|
||||||
@ -124,6 +126,8 @@ extern const u8 icon_settings_network_png[];
|
|||||||
extern const u32 icon_settings_network_png_size;
|
extern const u32 icon_settings_network_png_size;
|
||||||
extern const u8 icon_settings_video_png[];
|
extern const u8 icon_settings_video_png[];
|
||||||
extern const u32 icon_settings_video_png_size;
|
extern const u32 icon_settings_video_png_size;
|
||||||
|
extern const u8 icon_settings_screenshot_png[];
|
||||||
|
extern const u32 icon_settings_screenshot_png_size;
|
||||||
|
|
||||||
extern const u8 button_png[];
|
extern const u8 button_png[];
|
||||||
extern const u32 button_png_size;
|
extern const u32 button_png_size;
|
||||||
@ -251,6 +255,9 @@ extern const u32 bg_game_selection_png_size;
|
|||||||
extern const u8 bg_game_selection_entry_png[];
|
extern const u8 bg_game_selection_entry_png[];
|
||||||
extern const u32 bg_game_selection_entry_png_size;
|
extern const u32 bg_game_selection_entry_png_size;
|
||||||
|
|
||||||
|
extern const u8 bg_preview_png[];
|
||||||
|
extern const u32 bg_preview_png_size;
|
||||||
|
|
||||||
extern const u8 scrollbar_png[];
|
extern const u8 scrollbar_png[];
|
||||||
extern const u32 scrollbar_png_size;
|
extern const u32 scrollbar_png_size;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Snes9x Nintendo Wii/Gamecube Port
|
* Snes9x 1.51 Nintendo Wii/Gamecube Port
|
||||||
*
|
*
|
||||||
* Michniewski 2008
|
* Michniewski 2008
|
||||||
*
|
*
|
||||||
@ -11,9 +11,6 @@
|
|||||||
* Adapted from Snes9x Win32/MacOSX ports
|
* Adapted from Snes9x Win32/MacOSX ports
|
||||||
* Video Filter Code (hq2x)
|
* Video Filter Code (hq2x)
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef HW_RVL
|
|
||||||
|
|
||||||
#include <gccore.h>
|
#include <gccore.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -24,10 +21,10 @@
|
|||||||
|
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "snes9xgx.h"
|
#include "snes9xGX.h"
|
||||||
#include "menu.h"
|
#include "memmap.h"
|
||||||
|
|
||||||
#include "snes9x/memmap.h"
|
#include "menu.h"
|
||||||
|
|
||||||
#define NUMBITS (16)
|
#define NUMBITS (16)
|
||||||
|
|
||||||
@ -64,6 +61,7 @@ GetFilterName (RenderFilter filterID)
|
|||||||
case FILTER_HQ2X: return "hq2x";
|
case FILTER_HQ2X: return "hq2x";
|
||||||
case FILTER_HQ2XS: return "hq2x Soft";
|
case FILTER_HQ2XS: return "hq2x Soft";
|
||||||
case FILTER_HQ2XBOLD: return "hq2x Bold";
|
case FILTER_HQ2XBOLD: return "hq2x Bold";
|
||||||
|
case FILTER_SCANLINES: return "Scanlines";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,6 +76,7 @@ FilterToMethod (RenderFilter filterID)
|
|||||||
case FILTER_HQ2X: return RenderHQ2X<FILTER_HQ2X>;
|
case FILTER_HQ2X: return RenderHQ2X<FILTER_HQ2X>;
|
||||||
case FILTER_HQ2XS: return RenderHQ2X<FILTER_HQ2XS>;
|
case FILTER_HQ2XS: return RenderHQ2X<FILTER_HQ2XS>;
|
||||||
case FILTER_HQ2XBOLD: return RenderHQ2X<FILTER_HQ2XBOLD>;
|
case FILTER_HQ2XBOLD: return RenderHQ2X<FILTER_HQ2XBOLD>;
|
||||||
|
case FILTER_SCANLINES: return Scanlines<FILTER_SCANLINES>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,6 +91,7 @@ int GetFilterScale(RenderFilter filterID)
|
|||||||
case FILTER_HQ2X:
|
case FILTER_HQ2X:
|
||||||
case FILTER_HQ2XS:
|
case FILTER_HQ2XS:
|
||||||
case FILTER_HQ2XBOLD:
|
case FILTER_HQ2XBOLD:
|
||||||
|
case FILTER_SCANLINES:
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -542,4 +542,20 @@ void RenderHQ2X (uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
|
|||||||
sp += (src1line - width);
|
sp += (src1line - width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
template<int GuiScale>
|
||||||
|
void Scanlines (uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height)
|
||||||
|
{
|
||||||
|
while (height--) {
|
||||||
|
uint16 *dp = (uint16 *) dstPtr;
|
||||||
|
for (int i = 0; i < width; ++i, dp += 2) {
|
||||||
|
uint16 sp = *((uint16 *)srcPtr + i);
|
||||||
|
*(dp) = sp;
|
||||||
|
*(dp + 1) = sp;
|
||||||
|
*(dp + dstPitch) = 0;
|
||||||
|
*(dp + dstPitch + 1) = 0;
|
||||||
|
}
|
||||||
|
dstPtr += dstPitch<<1;
|
||||||
|
srcPtr += srcPitch;
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Snes9x Nintendo Wii/Gamecube Port
|
* Snes9x 1.51 Nintendo Wii/Gamecube Port
|
||||||
*
|
*
|
||||||
* Michniewski 2008
|
* Michniewski 2008
|
||||||
*
|
*
|
||||||
@ -18,7 +18,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "snes9x/snes9x.h"
|
#include "snes9x.h"
|
||||||
|
|
||||||
enum RenderFilter{
|
enum RenderFilter{
|
||||||
FILTER_NONE = 0,
|
FILTER_NONE = 0,
|
||||||
@ -26,6 +26,7 @@ enum RenderFilter{
|
|||||||
FILTER_HQ2X,
|
FILTER_HQ2X,
|
||||||
FILTER_HQ2XS,
|
FILTER_HQ2XS,
|
||||||
FILTER_HQ2XBOLD,
|
FILTER_HQ2XBOLD,
|
||||||
|
FILTER_SCANLINES,
|
||||||
|
|
||||||
NUM_FILTERS
|
NUM_FILTERS
|
||||||
};
|
};
|
||||||
@ -56,6 +57,7 @@ const char* GetFilterName (RenderFilter filterID);
|
|||||||
bool GetFilterHiResSupport (RenderFilter filterID);
|
bool GetFilterHiResSupport (RenderFilter filterID);
|
||||||
int GetFilterScale(RenderFilter filterID);
|
int GetFilterScale(RenderFilter filterID);
|
||||||
template<int GuiScale> void RenderHQ2X (uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
|
template<int GuiScale> void RenderHQ2X (uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
|
||||||
|
template<int GuiScale> void Scanlines (uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
|
||||||
void InitLUTs();
|
void InitLUTs();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -139,3 +139,30 @@ LoadSnapshotAuto (bool silent)
|
|||||||
|
|
||||||
return LoadSnapshot(filepath, silent);
|
return LoadSnapshot(filepath, silent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* SavePreview
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
int
|
||||||
|
SavePreviewImg (char * filepath, bool silent)
|
||||||
|
{
|
||||||
|
int device;
|
||||||
|
|
||||||
|
if(!FindDevice(filepath, &device))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// save screenshot
|
||||||
|
if(gameScreenPngSize > 0)
|
||||||
|
{
|
||||||
|
char screenpath[1024];
|
||||||
|
strcpy(screenpath, filepath);
|
||||||
|
screenpath[strlen(screenpath)] = 0;
|
||||||
|
sprintf(screenpath, "%s.png", screenpath);
|
||||||
|
SaveFile((char *)gameScreenPng, screenpath, gameScreenPngSize, silent);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!silent)
|
||||||
|
InfoPrompt("Save successful");
|
||||||
|
return 1;
|
||||||
|
}
|
@ -16,5 +16,5 @@ int SaveSnapshot (char * filepath, bool silent);
|
|||||||
int SaveSnapshotAuto (bool silent);
|
int SaveSnapshotAuto (bool silent);
|
||||||
int LoadSnapshot (char * filepath, bool silent);
|
int LoadSnapshot (char * filepath, bool silent);
|
||||||
int LoadSnapshotAuto (bool silent);
|
int LoadSnapshotAuto (bool silent);
|
||||||
|
int SavePreviewImg (char * filepath, bool silent);
|
||||||
#endif
|
#endif
|
||||||
|
@ -123,6 +123,16 @@ typedef struct _paddata {
|
|||||||
u8 triggerR;
|
u8 triggerR;
|
||||||
} PADData;
|
} PADData;
|
||||||
|
|
||||||
|
typedef struct _wupcfulldata {
|
||||||
|
u32 btns_d;
|
||||||
|
u32 btns_u;
|
||||||
|
u32 btns_h;
|
||||||
|
s16 stickX;
|
||||||
|
s16 stickY;
|
||||||
|
s16 substickX;
|
||||||
|
s16 substickY;
|
||||||
|
} WUPCFullData;
|
||||||
|
|
||||||
#define EFFECT_SLIDE_TOP 1
|
#define EFFECT_SLIDE_TOP 1
|
||||||
#define EFFECT_SLIDE_BOTTOM 2
|
#define EFFECT_SLIDE_BOTTOM 2
|
||||||
#define EFFECT_SLIDE_RIGHT 4
|
#define EFFECT_SLIDE_RIGHT 4
|
||||||
@ -226,6 +236,7 @@ class GuiTrigger
|
|||||||
|
|
||||||
WPADData wpaddata; //!< Wii controller trigger data
|
WPADData wpaddata; //!< Wii controller trigger data
|
||||||
PADData pad; //!< GameCube controller trigger data
|
PADData pad; //!< GameCube controller trigger data
|
||||||
|
WUPCFullData wupcdata; //!< WiiU Pro controller trigger data
|
||||||
WPADData * wpad; //!< Wii controller trigger
|
WPADData * wpad; //!< Wii controller trigger
|
||||||
s32 chan; //!< Trigger controller channel (0-3, -1 for all)
|
s32 chan; //!< Trigger controller channel (0-3, -1 for all)
|
||||||
u8 type; //!< trigger type (TRIGGER_SIMPLE, TRIGGER_HELD, TRIGGER_BUTTON_ONLY, TRIGGER_BUTTON_ONLY_IN_FOCUS)
|
u8 type; //!< trigger type (TRIGGER_SIMPLE, TRIGGER_HELD, TRIGGER_BUTTON_ONLY, TRIGGER_BUTTON_ONLY_IN_FOCUS)
|
||||||
|
@ -156,6 +156,7 @@ void GuiButton::Draw()
|
|||||||
label[0]->Draw();
|
label[0]->Draw();
|
||||||
|
|
||||||
if(labelOver[1])
|
if(labelOver[1])
|
||||||
|
|
||||||
labelOver[1]->Draw();
|
labelOver[1]->Draw();
|
||||||
else if(label[1])
|
else if(label[1])
|
||||||
label[1]->Draw();
|
label[1]->Draw();
|
||||||
@ -254,7 +255,7 @@ void GuiButton::Update(GuiTrigger * t)
|
|||||||
// button triggers
|
// button triggers
|
||||||
if(this->IsClickable())
|
if(this->IsClickable())
|
||||||
{
|
{
|
||||||
s32 wm_btns, wm_btns_trig, cc_btns, cc_btns_trig;
|
s32 wm_btns, wm_btns_trig, cc_btns, cc_btns_trig, wupc_btns, wupc_btns_trig;
|
||||||
for(int i=0; i<3; i++)
|
for(int i=0; i<3; i++)
|
||||||
{
|
{
|
||||||
if(trigger[i] && (trigger[i]->chan == -1 || trigger[i]->chan == t->chan))
|
if(trigger[i] && (trigger[i]->chan == -1 || trigger[i]->chan == t->chan))
|
||||||
@ -267,11 +268,17 @@ void GuiButton::Update(GuiTrigger * t)
|
|||||||
cc_btns = t->wpad->btns_d >> 16;
|
cc_btns = t->wpad->btns_d >> 16;
|
||||||
cc_btns_trig = trigger[i]->wpad->btns_d >> 16;
|
cc_btns_trig = trigger[i]->wpad->btns_d >> 16;
|
||||||
|
|
||||||
|
// lower 16 bits only (WiiU Pro controller)
|
||||||
|
wupc_btns = t->wupcdata.btns_d >> 16;
|
||||||
|
wupc_btns_trig = trigger[i]->wupcdata.btns_d >> 16;
|
||||||
|
|
||||||
if(
|
if(
|
||||||
(t->wpad->btns_d > 0 &&
|
(t->wpad->btns_d > 0 &&
|
||||||
(wm_btns == wm_btns_trig ||
|
(wm_btns == wm_btns_trig ||
|
||||||
(cc_btns == cc_btns_trig && t->wpad->exp.type == EXP_CLASSIC))) ||
|
(cc_btns == cc_btns_trig && t->wpad->exp.type == EXP_CLASSIC))) ||
|
||||||
(t->pad.btns_d == trigger[i]->pad.btns_d && t->pad.btns_d > 0))
|
(t->pad.btns_d == trigger[i]->pad.btns_d && t->pad.btns_d > 0) ||
|
||||||
|
(wupc_btns == wupc_btns_trig && wupc_btns_trig > 0))
|
||||||
|
|
||||||
{
|
{
|
||||||
if(t->chan == stateChan || stateChan == -1)
|
if(t->chan == stateChan || stateChan == -1)
|
||||||
{
|
{
|
||||||
@ -303,7 +310,7 @@ void GuiButton::Update(GuiTrigger * t)
|
|||||||
if(this->IsHoldable())
|
if(this->IsHoldable())
|
||||||
{
|
{
|
||||||
bool held = false;
|
bool held = false;
|
||||||
s32 wm_btns, wm_btns_h, wm_btns_trig, cc_btns, cc_btns_h, cc_btns_trig;
|
s32 wm_btns, wm_btns_h, wm_btns_trig, cc_btns, cc_btns_h, cc_btns_trig, wupc_btns, wupc_btns_h, wupc_btns_trig;
|
||||||
|
|
||||||
for(int i=0; i<3; i++)
|
for(int i=0; i<3; i++)
|
||||||
{
|
{
|
||||||
@ -319,11 +326,17 @@ void GuiButton::Update(GuiTrigger * t)
|
|||||||
cc_btns_h = t->wpad->btns_h >> 16;
|
cc_btns_h = t->wpad->btns_h >> 16;
|
||||||
cc_btns_trig = trigger[i]->wpad->btns_h >> 16;
|
cc_btns_trig = trigger[i]->wpad->btns_h >> 16;
|
||||||
|
|
||||||
|
// lower 16 bits only (WiiU Pro controller)
|
||||||
|
wupc_btns = t->wpad->btns_d >> 16;
|
||||||
|
wupc_btns_h = t->wpad->btns_h >> 16;
|
||||||
|
wupc_btns_trig = trigger[i]->wpad->btns_h >> 16;
|
||||||
|
|
||||||
if(
|
if(
|
||||||
(t->wpad->btns_d > 0 &&
|
(t->wpad->btns_d > 0 &&
|
||||||
(wm_btns == wm_btns_trig ||
|
(wm_btns == wm_btns_trig ||
|
||||||
(cc_btns == cc_btns_trig && t->wpad->exp.type == EXP_CLASSIC))) ||
|
(cc_btns == cc_btns_trig && t->wpad->exp.type == EXP_CLASSIC))) ||
|
||||||
(t->pad.btns_d == trigger[i]->pad.btns_h && t->pad.btns_d > 0))
|
(t->pad.btns_d == trigger[i]->pad.btns_h && t->pad.btns_d > 0) ||
|
||||||
|
(wupc_btns == wupc_btns_trig && wupc_btns > 0))
|
||||||
{
|
{
|
||||||
if(trigger[i]->type == TRIGGER_HELD && state == STATE_SELECTED &&
|
if(trigger[i]->type == TRIGGER_HELD && state == STATE_SELECTED &&
|
||||||
(t->chan == stateChan || stateChan == -1))
|
(t->chan == stateChan || stateChan == -1))
|
||||||
@ -334,7 +347,9 @@ void GuiButton::Update(GuiTrigger * t)
|
|||||||
(t->wpad->btns_h > 0 &&
|
(t->wpad->btns_h > 0 &&
|
||||||
(wm_btns_h == wm_btns_trig ||
|
(wm_btns_h == wm_btns_trig ||
|
||||||
(cc_btns_h == cc_btns_trig && t->wpad->exp.type == EXP_CLASSIC))) ||
|
(cc_btns_h == cc_btns_trig && t->wpad->exp.type == EXP_CLASSIC))) ||
|
||||||
(t->pad.btns_h == trigger[i]->pad.btns_h && t->pad.btns_h > 0))
|
(t->pad.btns_h == trigger[i]->pad.btns_h && t->pad.btns_h > 0) ||
|
||||||
|
(wupc_btns_h == wupc_btns_trig && wupc_btns_h > 0))
|
||||||
|
|
||||||
{
|
{
|
||||||
if(trigger[i]->type == TRIGGER_HELD)
|
if(trigger[i]->type == TRIGGER_HELD)
|
||||||
held = true;
|
held = true;
|
||||||
|
@ -108,12 +108,12 @@ GuiFileBrowser::GuiFileBrowser(int w, int h)
|
|||||||
fileListText[i] = new GuiText(NULL, 20, (GXColor){0, 0, 0, 0xff});
|
fileListText[i] = new GuiText(NULL, 20, (GXColor){0, 0, 0, 0xff});
|
||||||
fileListText[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
fileListText[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
||||||
fileListText[i]->SetPosition(5,0);
|
fileListText[i]->SetPosition(5,0);
|
||||||
fileListText[i]->SetMaxWidth(380);
|
fileListText[i]->SetMaxWidth(295);
|
||||||
|
|
||||||
fileListBg[i] = new GuiImage(bgFileSelectionEntry);
|
fileListBg[i] = new GuiImage(bgFileSelectionEntry);
|
||||||
fileListIcon[i] = NULL;
|
fileListIcon[i] = NULL;
|
||||||
|
|
||||||
fileList[i] = new GuiButton(380, 26);
|
fileList[i] = new GuiButton(295, 26);
|
||||||
fileList[i]->SetParent(this);
|
fileList[i]->SetParent(this);
|
||||||
fileList[i]->SetLabel(fileListText[i]);
|
fileList[i]->SetLabel(fileListText[i]);
|
||||||
fileList[i]->SetImageOver(fileListBg[i]);
|
fileList[i]->SetImageOver(fileListBg[i]);
|
||||||
|
@ -22,6 +22,7 @@ static u32 delay[4];
|
|||||||
GuiTrigger::GuiTrigger()
|
GuiTrigger::GuiTrigger()
|
||||||
{
|
{
|
||||||
chan = -1;
|
chan = -1;
|
||||||
|
memset(&wupcdata, 0, sizeof(WUPCFullData));
|
||||||
memset(&wpaddata, 0, sizeof(WPADData));
|
memset(&wpaddata, 0, sizeof(WPADData));
|
||||||
memset(&pad, 0, sizeof(PADData));
|
memset(&pad, 0, sizeof(PADData));
|
||||||
wpad = &wpaddata;
|
wpad = &wpaddata;
|
||||||
@ -43,6 +44,7 @@ void GuiTrigger::SetSimpleTrigger(s32 ch, u32 wiibtns, u16 gcbtns)
|
|||||||
{
|
{
|
||||||
type = TRIGGER_SIMPLE;
|
type = TRIGGER_SIMPLE;
|
||||||
chan = ch;
|
chan = ch;
|
||||||
|
wupcdata.btns_d = wiibtns;
|
||||||
wpaddata.btns_d = wiibtns;
|
wpaddata.btns_d = wiibtns;
|
||||||
pad.btns_d = gcbtns;
|
pad.btns_d = gcbtns;
|
||||||
}
|
}
|
||||||
@ -56,6 +58,7 @@ void GuiTrigger::SetHeldTrigger(s32 ch, u32 wiibtns, u16 gcbtns)
|
|||||||
{
|
{
|
||||||
type = TRIGGER_HELD;
|
type = TRIGGER_HELD;
|
||||||
chan = ch;
|
chan = ch;
|
||||||
|
wupcdata.btns_h = wiibtns;
|
||||||
wpaddata.btns_h = wiibtns;
|
wpaddata.btns_h = wiibtns;
|
||||||
pad.btns_h = gcbtns;
|
pad.btns_h = gcbtns;
|
||||||
}
|
}
|
||||||
@ -68,6 +71,7 @@ void GuiTrigger::SetButtonOnlyTrigger(s32 ch, u32 wiibtns, u16 gcbtns)
|
|||||||
{
|
{
|
||||||
type = TRIGGER_BUTTON_ONLY;
|
type = TRIGGER_BUTTON_ONLY;
|
||||||
chan = ch;
|
chan = ch;
|
||||||
|
wupcdata.btns_d = wiibtns;
|
||||||
wpaddata.btns_d = wiibtns;
|
wpaddata.btns_d = wiibtns;
|
||||||
pad.btns_d = gcbtns;
|
pad.btns_d = gcbtns;
|
||||||
}
|
}
|
||||||
@ -81,6 +85,7 @@ void GuiTrigger::SetButtonOnlyInFocusTrigger(s32 ch, u32 wiibtns, u16 gcbtns)
|
|||||||
{
|
{
|
||||||
type = TRIGGER_BUTTON_ONLY_IN_FOCUS;
|
type = TRIGGER_BUTTON_ONLY_IN_FOCUS;
|
||||||
chan = ch;
|
chan = ch;
|
||||||
|
wupcdata.btns_d = wiibtns;
|
||||||
wpaddata.btns_d = wiibtns;
|
wpaddata.btns_d = wiibtns;
|
||||||
pad.btns_d = gcbtns;
|
pad.btns_d = gcbtns;
|
||||||
}
|
}
|
||||||
@ -158,11 +163,14 @@ bool GuiTrigger::Left()
|
|||||||
u32 wiibtn = GCSettings.WiimoteOrientation ? WPAD_BUTTON_UP : WPAD_BUTTON_LEFT;
|
u32 wiibtn = GCSettings.WiimoteOrientation ? WPAD_BUTTON_UP : WPAD_BUTTON_LEFT;
|
||||||
|
|
||||||
if((wpad->btns_d | wpad->btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_LEFT)
|
if((wpad->btns_d | wpad->btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_LEFT)
|
||||||
|
|| (wupcdata.btns_d | wupcdata.btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_LEFT)
|
||||||
|| (pad.btns_d | pad.btns_h) & PAD_BUTTON_LEFT
|
|| (pad.btns_d | pad.btns_h) & PAD_BUTTON_LEFT
|
||||||
|| pad.stickX < -PADCAL
|
|| pad.stickX < -PADCAL
|
||||||
|| WPAD_StickX(0) < -PADCAL)
|
|| WPAD_StickX(0) < -PADCAL
|
||||||
|
|| wupcdata.stickX < -WUPCCAL)
|
||||||
{
|
{
|
||||||
if(wpad->btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_LEFT)
|
if((wpad->btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_LEFT))
|
||||||
|
|| (wupcdata.btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_LEFT))
|
||||||
|| pad.btns_d & PAD_BUTTON_LEFT)
|
|| pad.btns_d & PAD_BUTTON_LEFT)
|
||||||
{
|
{
|
||||||
prev[chan] = gettime();
|
prev[chan] = gettime();
|
||||||
@ -191,11 +199,14 @@ bool GuiTrigger::Right()
|
|||||||
u32 wiibtn = GCSettings.WiimoteOrientation ? WPAD_BUTTON_DOWN : WPAD_BUTTON_RIGHT;
|
u32 wiibtn = GCSettings.WiimoteOrientation ? WPAD_BUTTON_DOWN : WPAD_BUTTON_RIGHT;
|
||||||
|
|
||||||
if((wpad->btns_d | wpad->btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_RIGHT)
|
if((wpad->btns_d | wpad->btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_RIGHT)
|
||||||
|
|| ((wupcdata.btns_d | wupcdata.btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_RIGHT))
|
||||||
|| (pad.btns_d | pad.btns_h) & PAD_BUTTON_RIGHT
|
|| (pad.btns_d | pad.btns_h) & PAD_BUTTON_RIGHT
|
||||||
|| pad.stickX > PADCAL
|
|| pad.stickX > PADCAL
|
||||||
|| WPAD_StickX(0) > PADCAL)
|
|| WPAD_StickX(0) > PADCAL
|
||||||
|
|| wupcdata.stickX > WUPCCAL)
|
||||||
{
|
{
|
||||||
if(wpad->btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_RIGHT)
|
if((wpad->btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_RIGHT))
|
||||||
|
|| (wupcdata.btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_RIGHT))
|
||||||
|| pad.btns_d & PAD_BUTTON_RIGHT)
|
|| pad.btns_d & PAD_BUTTON_RIGHT)
|
||||||
{
|
{
|
||||||
prev[chan] = gettime();
|
prev[chan] = gettime();
|
||||||
@ -223,12 +234,15 @@ bool GuiTrigger::Up()
|
|||||||
{
|
{
|
||||||
u32 wiibtn = GCSettings.WiimoteOrientation ? WPAD_BUTTON_RIGHT : WPAD_BUTTON_UP;
|
u32 wiibtn = GCSettings.WiimoteOrientation ? WPAD_BUTTON_RIGHT : WPAD_BUTTON_UP;
|
||||||
|
|
||||||
if((wpad->btns_d | wpad->btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_UP)
|
if(((wpad->btns_d | wpad->btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_UP))
|
||||||
|
|| ((wupcdata.btns_d | wupcdata.btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_UP))
|
||||||
|| (pad.btns_d | pad.btns_h) & PAD_BUTTON_UP
|
|| (pad.btns_d | pad.btns_h) & PAD_BUTTON_UP
|
||||||
|| pad.stickY > PADCAL
|
|| pad.stickY > PADCAL
|
||||||
|| WPAD_StickY(0) > PADCAL)
|
|| WPAD_StickY(0) > PADCAL
|
||||||
|
|| wupcdata.stickY > WUPCCAL)
|
||||||
{
|
{
|
||||||
if(wpad->btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_UP)
|
if((wpad->btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_UP))
|
||||||
|
|| (wupcdata.btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_UP))
|
||||||
|| pad.btns_d & PAD_BUTTON_UP)
|
|| pad.btns_d & PAD_BUTTON_UP)
|
||||||
{
|
{
|
||||||
prev[chan] = gettime();
|
prev[chan] = gettime();
|
||||||
@ -256,12 +270,15 @@ bool GuiTrigger::Down()
|
|||||||
{
|
{
|
||||||
u32 wiibtn = GCSettings.WiimoteOrientation ? WPAD_BUTTON_LEFT : WPAD_BUTTON_DOWN;
|
u32 wiibtn = GCSettings.WiimoteOrientation ? WPAD_BUTTON_LEFT : WPAD_BUTTON_DOWN;
|
||||||
|
|
||||||
if((wpad->btns_d | wpad->btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_DOWN)
|
if(((wpad->btns_d | wpad->btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_DOWN))
|
||||||
|
|| ((wupcdata.btns_d | wupcdata.btns_h) & (wiibtn | WPAD_CLASSIC_BUTTON_DOWN))
|
||||||
|| (pad.btns_d | pad.btns_h) & PAD_BUTTON_DOWN
|
|| (pad.btns_d | pad.btns_h) & PAD_BUTTON_DOWN
|
||||||
|| pad.stickY < -PADCAL
|
|| pad.stickY < -PADCAL
|
||||||
|| WPAD_StickY(0) < -PADCAL)
|
|| WPAD_StickY(0) < -PADCAL
|
||||||
|
|| wupcdata.stickY < -WUPCCAL)
|
||||||
{
|
{
|
||||||
if(wpad->btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_DOWN)
|
if((wpad->btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_DOWN))
|
||||||
|
|| wupcdata.btns_d & (wiibtn | WPAD_CLASSIC_BUTTON_DOWN)
|
||||||
|| pad.btns_d & PAD_BUTTON_DOWN)
|
|| pad.btns_d & PAD_BUTTON_DOWN)
|
||||||
{
|
{
|
||||||
prev[chan] = gettime();
|
prev[chan] = gettime();
|
||||||
@ -271,7 +288,7 @@ bool GuiTrigger::Down()
|
|||||||
|
|
||||||
now[chan] = gettime();
|
now[chan] = gettime();
|
||||||
|
|
||||||
if(diff_usec(prev[chan], now[chan]) > delay[chan])
|
if(diff_usec(prev[chan], now[chan]) > delay[chan])
|
||||||
{
|
{
|
||||||
prev[chan] = now[chan];
|
prev[chan] = now[chan];
|
||||||
|
|
||||||
|
@ -228,8 +228,8 @@ void GuiWindow::ToggleFocus(GuiTrigger * t)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// change focus
|
// change focus
|
||||||
else if(t->wpad->btns_d & (WPAD_BUTTON_1 | WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B)
|
else if((t->wpad->btns_d & (WPAD_BUTTON_1 | WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B))
|
||||||
|| t->pad.btns_d & PAD_BUTTON_B)
|
|| (t->pad.btns_d & PAD_BUTTON_B) || (t->wupcdata.btns_d & WPAD_CLASSIC_BUTTON_B))
|
||||||
{
|
{
|
||||||
for (i = found; i < elemSize; ++i)
|
for (i = found; i < elemSize; ++i)
|
||||||
{
|
{
|
||||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 549 B After Width: | Height: | Size: 546 B |
Before Width: | Height: | Size: 546 B After Width: | Height: | Size: 549 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 777 B After Width: | Height: | Size: 810 B |
@ -20,6 +20,7 @@
|
|||||||
#include <ogcsys.h>
|
#include <ogcsys.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wiiuse/wpad.h>
|
#include <wiiuse/wpad.h>
|
||||||
|
#include <wupc/wupc.h>
|
||||||
#include <ogc/lwp_watchdog.h>
|
#include <ogc/lwp_watchdog.h>
|
||||||
|
|
||||||
#include "snes9xgx.h"
|
#include "snes9xgx.h"
|
||||||
@ -202,6 +203,7 @@ void
|
|||||||
UpdatePads()
|
UpdatePads()
|
||||||
{
|
{
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
|
WUPC_UpdateButtonStats();
|
||||||
WPAD_ScanPads();
|
WPAD_ScanPads();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -218,6 +220,15 @@ UpdatePads()
|
|||||||
userInput[i].pad.substickY = PAD_SubStickY(i);
|
userInput[i].pad.substickY = PAD_SubStickY(i);
|
||||||
userInput[i].pad.triggerL = PAD_TriggerL(i);
|
userInput[i].pad.triggerL = PAD_TriggerL(i);
|
||||||
userInput[i].pad.triggerR = PAD_TriggerR(i);
|
userInput[i].pad.triggerR = PAD_TriggerR(i);
|
||||||
|
#ifdef HW_RVL
|
||||||
|
userInput[i].wupcdata.btns_d = WUPC_ButtonsDown(i);
|
||||||
|
userInput[i].wupcdata.btns_u = WUPC_ButtonsUp(i);
|
||||||
|
userInput[i].wupcdata.btns_h = WUPC_ButtonsHeld(i);
|
||||||
|
userInput[i].wupcdata.stickX = WUPC_lStickX(i);
|
||||||
|
userInput[i].wupcdata.stickY = WUPC_lStickY(i);
|
||||||
|
userInput[i].wupcdata.substickX = WUPC_rStickX(i);
|
||||||
|
userInput[i].wupcdata.substickY = WUPC_rStickY(i);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,6 +309,7 @@ static void UpdateCursorPosition (int chan, int &pos_x, int &pos_y)
|
|||||||
{
|
{
|
||||||
#define SCOPEPADCAL 20
|
#define SCOPEPADCAL 20
|
||||||
|
|
||||||
|
#define WUPCSCOPEPADCAL 160
|
||||||
// gc left joystick
|
// gc left joystick
|
||||||
|
|
||||||
if (userInput[chan].pad.stickX > SCOPEPADCAL)
|
if (userInput[chan].pad.stickX > SCOPEPADCAL)
|
||||||
@ -354,6 +366,32 @@ static void UpdateCursorPosition (int chan, int &pos_x, int &pos_y)
|
|||||||
pos_y -= (wm_ay*1.0)/SCOPEPADCAL;
|
pos_y -= (wm_ay*1.0)/SCOPEPADCAL;
|
||||||
if (pos_y < 0) pos_y = 0;
|
if (pos_y < 0) pos_y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* WiiU Pro Controller */
|
||||||
|
s8 wupc_ax = userInput[chan].wupcdata.stickX;
|
||||||
|
s8 wupc_ay = userInput[chan].wupcdata.stickX;
|
||||||
|
|
||||||
|
if (wupc_ax > WUPCSCOPEPADCAL)
|
||||||
|
{
|
||||||
|
pos_x += (wupc_ax*1.0)/WUPCSCOPEPADCAL;
|
||||||
|
if (pos_x > 256) pos_x = 256;
|
||||||
|
}
|
||||||
|
if (wupc_ax < -WUPCSCOPEPADCAL)
|
||||||
|
{
|
||||||
|
pos_x -= (wupc_ax*-1.0)/WUPCSCOPEPADCAL;
|
||||||
|
if (pos_x < 0) pos_x = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wupc_ay < -WUPCSCOPEPADCAL)
|
||||||
|
{
|
||||||
|
pos_y += (wupc_ay*-1.0)/WUPCSCOPEPADCAL;
|
||||||
|
if (pos_y > 224) pos_y = 224;
|
||||||
|
}
|
||||||
|
if (wupc_ay > WUPCSCOPEPADCAL)
|
||||||
|
{
|
||||||
|
pos_y -= (wupc_ay*1.0)/WUPCSCOPEPADCAL;
|
||||||
|
if (pos_y < 0) pos_y = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -383,6 +421,10 @@ static void decodepad (int chan)
|
|||||||
u32 exp_type;
|
u32 exp_type;
|
||||||
if ( WPAD_Probe(chan, &exp_type) != 0 )
|
if ( WPAD_Probe(chan, &exp_type) != 0 )
|
||||||
exp_type = WPAD_EXP_NONE;
|
exp_type = WPAD_EXP_NONE;
|
||||||
|
|
||||||
|
s16 wupc_ax = userInput[chan].wupcdata.stickX;
|
||||||
|
s16 wupc_ay = userInput[chan].wupcdata.stickY;
|
||||||
|
u32 wupcp = userInput[chan].wupcdata.btns_h;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/***
|
/***
|
||||||
@ -427,6 +469,20 @@ static void decodepad (int chan)
|
|||||||
else if(sin(angle) < -THRES)
|
else if(sin(angle) < -THRES)
|
||||||
wp |= (exp_type == WPAD_EXP_CLASSIC) ? WPAD_CLASSIC_BUTTON_DOWN : WPAD_BUTTON_DOWN;
|
wp |= (exp_type == WPAD_EXP_CLASSIC) ? WPAD_CLASSIC_BUTTON_DOWN : WPAD_BUTTON_DOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Pro Controller */
|
||||||
|
if (wupc_ax * wupc_ax + wupc_ay * wupc_ay > WUPCCAL * WUPCCAL)
|
||||||
|
{
|
||||||
|
angle = atan2(wupc_ay, wupc_ax);
|
||||||
|
if(cos(angle) > THRES)
|
||||||
|
wupcp |= WPAD_CLASSIC_BUTTON_RIGHT;
|
||||||
|
else if(cos(angle) < -THRES)
|
||||||
|
wupcp |= WPAD_CLASSIC_BUTTON_LEFT;
|
||||||
|
if(sin(angle) > THRES)
|
||||||
|
wupcp |= WPAD_CLASSIC_BUTTON_UP;
|
||||||
|
else if(sin(angle) < -THRES)
|
||||||
|
wupcp |= WPAD_CLASSIC_BUTTON_DOWN;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*** Fix offset to pad ***/
|
/*** Fix offset to pad ***/
|
||||||
@ -440,6 +496,7 @@ static void decodepad (int chan)
|
|||||||
|| ( (exp_type == WPAD_EXP_NONE) && (wp & btnmap[CTRL_PAD][CTRLR_WIIMOTE][i]) ) // wiimote
|
|| ( (exp_type == WPAD_EXP_NONE) && (wp & btnmap[CTRL_PAD][CTRLR_WIIMOTE][i]) ) // wiimote
|
||||||
|| ( (exp_type == WPAD_EXP_CLASSIC) && (wp & btnmap[CTRL_PAD][CTRLR_CLASSIC][i]) ) // classic controller
|
|| ( (exp_type == WPAD_EXP_CLASSIC) && (wp & btnmap[CTRL_PAD][CTRLR_CLASSIC][i]) ) // classic controller
|
||||||
|| ( (exp_type == WPAD_EXP_NUNCHUK) && (wp & btnmap[CTRL_PAD][CTRLR_NUNCHUK][i]) ) // nunchuk + wiimote
|
|| ( (exp_type == WPAD_EXP_NUNCHUK) && (wp & btnmap[CTRL_PAD][CTRLR_NUNCHUK][i]) ) // nunchuk + wiimote
|
||||||
|
|| ( (wupcp & btnmap[CTRL_PAD][CTRLR_CLASSIC][i]) ) // WiiU Pro Controller
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
S9xReportButton (offset + i, true);
|
S9xReportButton (offset + i, true);
|
||||||
@ -457,6 +514,7 @@ static void decodepad (int chan)
|
|||||||
if (jp & btnmap[CTRL_SCOPE][CTRLR_GCPAD][i]
|
if (jp & btnmap[CTRL_SCOPE][CTRLR_GCPAD][i]
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
|| wp & btnmap[CTRL_SCOPE][CTRLR_WIIMOTE][i]
|
|| wp & btnmap[CTRL_SCOPE][CTRLR_WIIMOTE][i]
|
||||||
|
|| wupcp & btnmap[CTRL_SCOPE][CTRLR_WIIMOTE][i]
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -494,6 +552,7 @@ static void decodepad (int chan)
|
|||||||
if (jp & btnmap[CTRL_MOUSE][CTRLR_GCPAD][i]
|
if (jp & btnmap[CTRL_MOUSE][CTRLR_GCPAD][i]
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
|| wp & btnmap[CTRL_MOUSE][CTRLR_WIIMOTE][i]
|
|| wp & btnmap[CTRL_MOUSE][CTRLR_WIIMOTE][i]
|
||||||
|
|| wupcp & btnmap[CTRL_MOUSE][CTRLR_WIIMOTE][i]
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
S9xReportButton(offset + i, true);
|
S9xReportButton(offset + i, true);
|
||||||
@ -516,6 +575,7 @@ static void decodepad (int chan)
|
|||||||
if (jp & btnmap[CTRL_JUST][CTRLR_GCPAD][i]
|
if (jp & btnmap[CTRL_JUST][CTRLR_GCPAD][i]
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
|| wp & btnmap[CTRL_JUST][CTRLR_WIIMOTE][i]
|
|| wp & btnmap[CTRL_JUST][CTRLR_WIIMOTE][i]
|
||||||
|
|| wupcp & btnmap[CTRL_JUST][CTRLR_WIIMOTE][i]
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
S9xReportButton(offset + i, true);
|
S9xReportButton(offset + i, true);
|
||||||
@ -548,9 +608,12 @@ bool MenuRequested()
|
|||||||
userInput[i].pad.btns_h & PAD_TRIGGER_R &&
|
userInput[i].pad.btns_h & PAD_TRIGGER_R &&
|
||||||
userInput[i].pad.btns_h & PAD_BUTTON_X &&
|
userInput[i].pad.btns_h & PAD_BUTTON_X &&
|
||||||
userInput[i].pad.btns_h & PAD_BUTTON_Y
|
userInput[i].pad.btns_h & PAD_BUTTON_Y
|
||||||
) ||
|
)
|
||||||
(userInput[i].wpad->btns_h & WPAD_BUTTON_HOME) ||
|
#ifdef HW_RVL
|
||||||
(userInput[i].wpad->btns_h & WPAD_CLASSIC_BUTTON_HOME)
|
|| (userInput[i].wpad->btns_h & WPAD_BUTTON_HOME) ||
|
||||||
|
(userInput[i].wpad->btns_h & WPAD_CLASSIC_BUTTON_HOME) ||
|
||||||
|
(userInput[i].wupcdata.btns_h & WPAD_CLASSIC_BUTTON_HOME)
|
||||||
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
@ -573,7 +636,8 @@ void ReportButtons ()
|
|||||||
|
|
||||||
Settings.TurboMode = (
|
Settings.TurboMode = (
|
||||||
userInput[0].pad.substickX > 70 ||
|
userInput[0].pad.substickX > 70 ||
|
||||||
userInput[0].WPAD_StickX(1) > 70
|
userInput[0].WPAD_StickX(1) > 70 ||
|
||||||
|
userInput[0].wupcdata.substickX > 560
|
||||||
); // RIGHT on c-stick and on classic controller right joystick
|
); // RIGHT on c-stick and on classic controller right joystick
|
||||||
|
|
||||||
/* Check for menu:
|
/* Check for menu:
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#define PI 3.14159265f
|
#define PI 3.14159265f
|
||||||
#define PADCAL 50
|
#define PADCAL 50
|
||||||
|
#define WUPCCAL 400
|
||||||
#define MAXJP 12 // # of mappable controller buttons
|
#define MAXJP 12 // # of mappable controller buttons
|
||||||
|
|
||||||
extern u32 btnmap[4][4][12];
|
extern u32 btnmap[4][4][12];
|
||||||
|
@ -1,6 +1,42 @@
|
|||||||
msgid "&"
|
msgid "&"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Up"
|
||||||
|
msgstr "Arriba"
|
||||||
|
|
||||||
|
msgid "Down"
|
||||||
|
msgstr "Abajo"
|
||||||
|
|
||||||
|
msgid "Left"
|
||||||
|
msgstr "Izquierda"
|
||||||
|
|
||||||
|
msgid "Right"
|
||||||
|
msgstr "Derecha"
|
||||||
|
|
||||||
|
msgid "PLUS"
|
||||||
|
msgstr "MAS"
|
||||||
|
|
||||||
|
msgid "MINUS"
|
||||||
|
msgstr "MENOS"
|
||||||
|
|
||||||
|
msgid "Aim Offscreen"
|
||||||
|
msgstr "Apuntar Fuera de Pantalla"
|
||||||
|
|
||||||
|
msgid "Cursor"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Turbo On"
|
||||||
|
msgstr "Turbo Encendido"
|
||||||
|
|
||||||
|
msgid "Turbo Off"
|
||||||
|
msgstr "Turbo Apagado"
|
||||||
|
|
||||||
|
msgid "Pause"
|
||||||
|
msgstr "Pausa"
|
||||||
|
|
||||||
|
msgid "START"
|
||||||
|
msgstr "Inicio"
|
||||||
|
|
||||||
msgid "16:9 Correction"
|
msgid "16:9 Correction"
|
||||||
msgstr "Corrección 16:9"
|
msgstr "Corrección 16:9"
|
||||||
|
|
||||||
@ -82,6 +118,12 @@ msgstr "Vista Portada"
|
|||||||
msgid "Covers Folder"
|
msgid "Covers Folder"
|
||||||
msgstr "Carpeta Portadas"
|
msgstr "Carpeta Portadas"
|
||||||
|
|
||||||
|
msgid "Wii U Pro Controller"
|
||||||
|
msgstr "Mando Wii U Pro"
|
||||||
|
|
||||||
|
msgid "Screenshots Folder"
|
||||||
|
msgstr "Carpeta Img. Pantalla"
|
||||||
|
|
||||||
msgid "Credits"
|
msgid "Credits"
|
||||||
msgstr "Créditos"
|
msgstr "Créditos"
|
||||||
|
|
||||||
@ -233,7 +275,7 @@ msgid "Press any button on the GameCube Controller now. Press Home or the C-Stic
|
|||||||
msgstr "Presione un botón en el Mando de GameCube. Presione HOME o mueva el el Stick-C para eliminar la configuración actual."
|
msgstr "Presione un botón en el Mando de GameCube. Presione HOME o mueva el el Stick-C para eliminar la configuración actual."
|
||||||
|
|
||||||
msgid "Press any button on the GameCube Controller now. Press the C-Stick in any direction to clear the existing mapping."
|
msgid "Press any button on the GameCube Controller now. Press the C-Stick in any direction to clear the existing mapping."
|
||||||
msgstr "Presione un botón en el Mando de GameCube. Presione HOME o mueva el el Stick-C para eliminar la configuración actual."
|
msgstr "Presione un botón en el Mando de GameCube. Mueva el el Stick-C para eliminar la configuración actual."
|
||||||
|
|
||||||
msgid "Press any button on the Wiimote now. Press Home to clear the existing mapping."
|
msgid "Press any button on the Wiimote now. Press Home to clear the existing mapping."
|
||||||
msgstr "Presione un botón en el Wiimote. Presione HOME para eliminar la configuración actual."
|
msgstr "Presione un botón en el Wiimote. Presione HOME para eliminar la configuración actual."
|
||||||
@ -241,6 +283,18 @@ msgstr "Presione un bot
|
|||||||
msgid "Press any button on the Wiimote or Nunchuk now. Press Home to clear the existing mapping."
|
msgid "Press any button on the Wiimote or Nunchuk now. Press Home to clear the existing mapping."
|
||||||
msgstr "Presione un botón en el Wiimote o Nunchuck. Presione HOME para eliminar la configuración actual."
|
msgstr "Presione un botón en el Wiimote o Nunchuck. Presione HOME para eliminar la configuración actual."
|
||||||
|
|
||||||
|
msgid "Press any button on the Wii U Pro Controller now. Press Home to clear the existing mapping."
|
||||||
|
msgstr "Presione un botón en el Mando Wii U Pro. Presione HOME para eliminar la configuración actual."
|
||||||
|
|
||||||
|
msgid "ScreenShot"
|
||||||
|
msgstr "Pantalla"
|
||||||
|
|
||||||
|
msgid "Preview Screenshot"
|
||||||
|
msgstr "Imagen de Pantalla"
|
||||||
|
|
||||||
|
msgid "Save a new Preview Screenshot? Current Screenshot image will be overwritten."
|
||||||
|
msgstr "¿Grabar una nueva imagen de pantalla? La imagen actual será sobre-escrita."
|
||||||
|
|
||||||
msgid "Progressive (480p)"
|
msgid "Progressive (480p)"
|
||||||
msgstr "Progresivo (480p)"
|
msgstr "Progresivo (480p)"
|
||||||
|
|
||||||
|
129
source/menu.cpp
@ -14,6 +14,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <wiiuse/wpad.h>
|
#include <wiiuse/wpad.h>
|
||||||
|
#include <wupc/wupc.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
@ -74,6 +75,7 @@ static GuiWindow * mainWindow = NULL;
|
|||||||
static GuiText * settingText = NULL;
|
static GuiText * settingText = NULL;
|
||||||
static GuiText * settingText2 = NULL;
|
static GuiText * settingText2 = NULL;
|
||||||
static int lastMenu = MENU_NONE;
|
static int lastMenu = MENU_NONE;
|
||||||
|
static int wiiuproCtrl = 0;
|
||||||
static int mapMenuCtrl = 0;
|
static int mapMenuCtrl = 0;
|
||||||
static int mapMenuCtrlSNES = 0;
|
static int mapMenuCtrlSNES = 0;
|
||||||
|
|
||||||
@ -882,10 +884,10 @@ static void WindowCredits(void * ptr)
|
|||||||
|
|
||||||
Menu_Render();
|
Menu_Render();
|
||||||
|
|
||||||
if((userInput[0].wpad->btns_d || userInput[0].pad.btns_d) ||
|
if((userInput[0].wpad->btns_d || userInput[0].pad.btns_d || userInput[0].wupcdata.btns_d) ||
|
||||||
(userInput[1].wpad->btns_d || userInput[1].pad.btns_d) ||
|
(userInput[1].wpad->btns_d || userInput[1].pad.btns_d || userInput[1].wupcdata.btns_d) ||
|
||||||
(userInput[2].wpad->btns_d || userInput[2].pad.btns_d) ||
|
(userInput[2].wpad->btns_d || userInput[2].pad.btns_d || userInput[2].wupcdata.btns_d) ||
|
||||||
(userInput[3].wpad->btns_d || userInput[3].pad.btns_d))
|
(userInput[3].wpad->btns_d || userInput[3].pad.btns_d || userInput[3].wupcdata.btns_d))
|
||||||
{
|
{
|
||||||
exit = true;
|
exit = true;
|
||||||
}
|
}
|
||||||
@ -895,6 +897,7 @@ static void WindowCredits(void * ptr)
|
|||||||
// clear buttons pressed
|
// clear buttons pressed
|
||||||
for(i=0; i < 4; i++)
|
for(i=0; i < 4; i++)
|
||||||
{
|
{
|
||||||
|
userInput[i].wupcdata.btns_d = 0;
|
||||||
userInput[i].wpad->btns_d = 0;
|
userInput[i].wpad->btns_d = 0;
|
||||||
userInput[i].pad.btns_d = 0;
|
userInput[i].pad.btns_d = 0;
|
||||||
}
|
}
|
||||||
@ -925,6 +928,7 @@ static int MenuGameSelection()
|
|||||||
GuiImageData iconSettings(icon_settings_png);
|
GuiImageData iconSettings(icon_settings_png);
|
||||||
GuiImageData btnOutline(button_long_png);
|
GuiImageData btnOutline(button_long_png);
|
||||||
GuiImageData btnOutlineOver(button_long_over_png);
|
GuiImageData btnOutlineOver(button_long_over_png);
|
||||||
|
GuiImageData bgPreviewImg(bg_preview_png);
|
||||||
|
|
||||||
GuiTrigger trigHome;
|
GuiTrigger trigHome;
|
||||||
trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0);
|
trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0);
|
||||||
@ -972,13 +976,16 @@ static int MenuGameSelection()
|
|||||||
buttonWindow.Append(&settingsBtn);
|
buttonWindow.Append(&settingsBtn);
|
||||||
buttonWindow.Append(&exitBtn);
|
buttonWindow.Append(&exitBtn);
|
||||||
|
|
||||||
GuiFileBrowser gameBrowser(424, 268);
|
GuiFileBrowser gameBrowser(330, 268);
|
||||||
gameBrowser.SetPosition(10, 98);
|
gameBrowser.SetPosition(20, 98);
|
||||||
ResetBrowser();
|
ResetBrowser();
|
||||||
|
|
||||||
|
GuiImage bgPreview(&bgPreviewImg);
|
||||||
|
bgPreview.SetPosition(365, 98);
|
||||||
|
|
||||||
GuiImage preview;
|
GuiImage preview;
|
||||||
preview.SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE);
|
preview.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||||
preview.SetPosition(-10, 0);
|
preview.SetPosition(174, -8);
|
||||||
u8* imgBuffer = MEM_ALLOC(512 * 512 * 4);
|
u8* imgBuffer = MEM_ALLOC(512 * 512 * 4);
|
||||||
int previousBrowserIndex = -1;
|
int previousBrowserIndex = -1;
|
||||||
char screenshotPath[MAXJOLIET + 1];
|
char screenshotPath[MAXJOLIET + 1];
|
||||||
@ -989,6 +996,7 @@ static int MenuGameSelection()
|
|||||||
mainWindow->Append(&titleTxt);
|
mainWindow->Append(&titleTxt);
|
||||||
mainWindow->Append(&gameBrowser);
|
mainWindow->Append(&gameBrowser);
|
||||||
mainWindow->Append(&buttonWindow);
|
mainWindow->Append(&buttonWindow);
|
||||||
|
mainWindow->Append(&bgPreview);
|
||||||
mainWindow->Append(&preview);
|
mainWindow->Append(&preview);
|
||||||
ResumeGui();
|
ResumeGui();
|
||||||
|
|
||||||
@ -1075,7 +1083,8 @@ static int MenuGameSelection()
|
|||||||
if(DecodePNG(savebuffer, &width, &height, imgBuffer, 512, 512))
|
if(DecodePNG(savebuffer, &width, &height, imgBuffer, 512, 512))
|
||||||
{
|
{
|
||||||
preview.SetImage(imgBuffer, width, height);
|
preview.SetImage(imgBuffer, width, height);
|
||||||
preview.SetScale(180.0f / width);
|
//preview.SetScale(225.0f / width);
|
||||||
|
preview.SetScale( MIN(225.0f / width, 235.0f / height) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1101,6 +1110,7 @@ static int MenuGameSelection()
|
|||||||
mainWindow->Remove(&titleTxt);
|
mainWindow->Remove(&titleTxt);
|
||||||
mainWindow->Remove(&buttonWindow);
|
mainWindow->Remove(&buttonWindow);
|
||||||
mainWindow->Remove(&gameBrowser);
|
mainWindow->Remove(&gameBrowser);
|
||||||
|
mainWindow->Remove(&bgPreview);
|
||||||
mainWindow->Remove(&preview);
|
mainWindow->Remove(&preview);
|
||||||
MEM_DEALLOC(imgBuffer);
|
MEM_DEALLOC(imgBuffer);
|
||||||
return menu;
|
return menu;
|
||||||
@ -1431,8 +1441,17 @@ static int MenuGame()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newStatus = false;
|
struct WUPCData *data = WUPC_Data(i);
|
||||||
newLevel = 0;
|
if(data != NULL)
|
||||||
|
{
|
||||||
|
newStatus = true;
|
||||||
|
newLevel = data->battery;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newStatus = false;
|
||||||
|
newLevel = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(status[i] != newStatus || level[i] != newLevel)
|
if(status[i] != newStatus || level[i] != newLevel)
|
||||||
@ -1836,6 +1855,7 @@ static int MenuGameSaves(int action)
|
|||||||
static int MenuGameSettings()
|
static int MenuGameSettings()
|
||||||
{
|
{
|
||||||
int menu = MENU_NONE;
|
int menu = MENU_NONE;
|
||||||
|
char filepath[1024];
|
||||||
|
|
||||||
GuiText titleTxt("Game Settings", 26, (GXColor){255, 255, 255, 255});
|
GuiText titleTxt("Game Settings", 26, (GXColor){255, 255, 255, 255});
|
||||||
titleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
titleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
||||||
@ -1851,6 +1871,7 @@ static int MenuGameSettings()
|
|||||||
GuiImageData iconVideo(icon_settings_video_png);
|
GuiImageData iconVideo(icon_settings_video_png);
|
||||||
GuiImageData iconController(icon_game_controllers_png);
|
GuiImageData iconController(icon_game_controllers_png);
|
||||||
GuiImageData iconCheats(icon_game_cheats_png);
|
GuiImageData iconCheats(icon_game_cheats_png);
|
||||||
|
GuiImageData iconScreenshot(icon_settings_screenshot_png);
|
||||||
GuiImageData btnCloseOutline(button_small_png);
|
GuiImageData btnCloseOutline(button_small_png);
|
||||||
GuiImageData btnCloseOutlineOver(button_small_over_png);
|
GuiImageData btnCloseOutlineOver(button_small_over_png);
|
||||||
|
|
||||||
@ -1899,7 +1920,7 @@ static int MenuGameSettings()
|
|||||||
GuiImage controllerBtnIcon(&iconController);
|
GuiImage controllerBtnIcon(&iconController);
|
||||||
GuiButton controllerBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
|
GuiButton controllerBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
|
||||||
controllerBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
controllerBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
controllerBtn.SetPosition(-125, 250);
|
controllerBtn.SetPosition(-200, 250);
|
||||||
controllerBtn.SetLabel(&controllerBtnTxt);
|
controllerBtn.SetLabel(&controllerBtnTxt);
|
||||||
controllerBtn.SetImage(&controllerBtnImg);
|
controllerBtn.SetImage(&controllerBtnImg);
|
||||||
controllerBtn.SetImageOver(&controllerBtnImgOver);
|
controllerBtn.SetImageOver(&controllerBtnImgOver);
|
||||||
@ -1910,13 +1931,30 @@ static int MenuGameSettings()
|
|||||||
controllerBtn.SetTrigger(trig2);
|
controllerBtn.SetTrigger(trig2);
|
||||||
controllerBtn.SetEffectGrow();
|
controllerBtn.SetEffectGrow();
|
||||||
|
|
||||||
|
GuiText screenshotBtnTxt("ScreenShot", 22, (GXColor){0, 0, 0, 255});
|
||||||
|
GuiImage screenshotBtnImg(&btnLargeOutline);
|
||||||
|
GuiImage screenshotBtnImgOver(&btnLargeOutlineOver);
|
||||||
|
GuiImage screenshotBtnIcon(&iconScreenshot);
|
||||||
|
GuiButton screenshotBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
|
||||||
|
screenshotBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
|
screenshotBtn.SetPosition(0, 250);
|
||||||
|
screenshotBtn.SetLabel(&screenshotBtnTxt);
|
||||||
|
screenshotBtn.SetImage(&screenshotBtnImg);
|
||||||
|
screenshotBtn.SetImageOver(&screenshotBtnImgOver);
|
||||||
|
screenshotBtn.SetIcon(&screenshotBtnIcon);
|
||||||
|
screenshotBtn.SetSoundOver(&btnSoundOver);
|
||||||
|
screenshotBtn.SetSoundClick(&btnSoundClick);
|
||||||
|
screenshotBtn.SetTrigger(trigA);
|
||||||
|
screenshotBtn.SetTrigger(trig2);
|
||||||
|
screenshotBtn.SetEffectGrow();
|
||||||
|
|
||||||
GuiText cheatsBtnTxt("Cheats", 22, (GXColor){0, 0, 0, 255});
|
GuiText cheatsBtnTxt("Cheats", 22, (GXColor){0, 0, 0, 255});
|
||||||
GuiImage cheatsBtnImg(&btnLargeOutline);
|
GuiImage cheatsBtnImg(&btnLargeOutline);
|
||||||
GuiImage cheatsBtnImgOver(&btnLargeOutlineOver);
|
GuiImage cheatsBtnImgOver(&btnLargeOutlineOver);
|
||||||
GuiImage cheatsBtnIcon(&iconCheats);
|
GuiImage cheatsBtnIcon(&iconCheats);
|
||||||
GuiButton cheatsBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
|
GuiButton cheatsBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
|
||||||
cheatsBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
cheatsBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
cheatsBtn.SetPosition(125, 250);
|
cheatsBtn.SetPosition(200, 250);
|
||||||
cheatsBtn.SetLabel(&cheatsBtnTxt);
|
cheatsBtn.SetLabel(&cheatsBtnTxt);
|
||||||
cheatsBtn.SetImage(&cheatsBtnImg);
|
cheatsBtn.SetImage(&cheatsBtnImg);
|
||||||
cheatsBtn.SetImageOver(&cheatsBtnImgOver);
|
cheatsBtn.SetImageOver(&cheatsBtnImgOver);
|
||||||
@ -1964,6 +2002,7 @@ static int MenuGameSettings()
|
|||||||
w.Append(&mappingBtn);
|
w.Append(&mappingBtn);
|
||||||
w.Append(&videoBtn);
|
w.Append(&videoBtn);
|
||||||
w.Append(&controllerBtn);
|
w.Append(&controllerBtn);
|
||||||
|
w.Append(&screenshotBtn);
|
||||||
w.Append(&cheatsBtn);
|
w.Append(&cheatsBtn);
|
||||||
w.Append(&closeBtn);
|
w.Append(&closeBtn);
|
||||||
w.Append(&backBtn);
|
w.Append(&backBtn);
|
||||||
@ -1996,6 +2035,14 @@ static int MenuGameSettings()
|
|||||||
else
|
else
|
||||||
InfoPrompt("Cheats file not found!");
|
InfoPrompt("Cheats file not found!");
|
||||||
}
|
}
|
||||||
|
else if(screenshotBtn.GetState() == STATE_CLICKED)
|
||||||
|
{
|
||||||
|
if (WindowPrompt("Preview Screenshot", "Save a new Preview Screenshot? Current Screenshot image will be overwritten.", "OK", "Cancel"))
|
||||||
|
{
|
||||||
|
snprintf(filepath, 1024, "%s%s/%s", pathPrefix[GCSettings.SaveMethod], GCSettings.ScreenshotsFolder, Memory.ROMFilename);
|
||||||
|
SavePreviewImg(filepath, NOTSILENT);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if(closeBtn.GetState() == STATE_CLICKED)
|
else if(closeBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
menu = MENU_EXIT;
|
menu = MENU_EXIT;
|
||||||
@ -2290,6 +2337,7 @@ static int MenuSettingsMappingsController()
|
|||||||
GuiImageData iconClassic(icon_settings_classic_png);
|
GuiImageData iconClassic(icon_settings_classic_png);
|
||||||
GuiImageData iconGamecube(icon_settings_gamecube_png);
|
GuiImageData iconGamecube(icon_settings_gamecube_png);
|
||||||
GuiImageData iconNunchuk(icon_settings_nunchuk_png);
|
GuiImageData iconNunchuk(icon_settings_nunchuk_png);
|
||||||
|
GuiImageData iconWiiupro(icon_settings_wiiupro_png);
|
||||||
|
|
||||||
GuiText gamecubeBtnTxt("GameCube Controller", 22, (GXColor){0, 0, 0, 255});
|
GuiText gamecubeBtnTxt("GameCube Controller", 22, (GXColor){0, 0, 0, 255});
|
||||||
gamecubeBtnTxt.SetWrap(true, btnLargeOutline.GetWidth()-20);
|
gamecubeBtnTxt.SetWrap(true, btnLargeOutline.GetWidth()-20);
|
||||||
@ -2333,7 +2381,7 @@ static int MenuSettingsMappingsController()
|
|||||||
GuiImage classicBtnIcon(&iconClassic);
|
GuiImage classicBtnIcon(&iconClassic);
|
||||||
GuiButton classicBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
|
GuiButton classicBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
|
||||||
classicBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
classicBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
classicBtn.SetPosition(-125, 250);
|
classicBtn.SetPosition(-200, 250);
|
||||||
classicBtn.SetLabel(&classicBtnTxt);
|
classicBtn.SetLabel(&classicBtnTxt);
|
||||||
classicBtn.SetImage(&classicBtnImg);
|
classicBtn.SetImage(&classicBtnImg);
|
||||||
classicBtn.SetImageOver(&classicBtnImgOver);
|
classicBtn.SetImageOver(&classicBtnImgOver);
|
||||||
@ -2344,6 +2392,24 @@ static int MenuSettingsMappingsController()
|
|||||||
classicBtn.SetTrigger(trig2);
|
classicBtn.SetTrigger(trig2);
|
||||||
classicBtn.SetEffectGrow();
|
classicBtn.SetEffectGrow();
|
||||||
|
|
||||||
|
GuiText wiiuproBtnTxt("Wii U Pro Controller", 22, (GXColor){0, 0, 0, 255});
|
||||||
|
wiiuproBtnTxt.SetWrap(true, btnLargeOutline.GetWidth()-20);
|
||||||
|
GuiImage wiiuproBtnImg(&btnLargeOutline);
|
||||||
|
GuiImage wiiuproBtnImgOver(&btnLargeOutlineOver);
|
||||||
|
GuiImage wiiuproBtnIcon(&iconWiiupro);
|
||||||
|
GuiButton wiiuproBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
|
||||||
|
wiiuproBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
|
wiiuproBtn.SetPosition(0, 250);
|
||||||
|
wiiuproBtn.SetLabel(&wiiuproBtnTxt);
|
||||||
|
wiiuproBtn.SetImage(&wiiuproBtnImg);
|
||||||
|
wiiuproBtn.SetImageOver(&wiiuproBtnImgOver);
|
||||||
|
wiiuproBtn.SetIcon(&wiiuproBtnIcon);
|
||||||
|
wiiuproBtn.SetSoundOver(&btnSoundOver);
|
||||||
|
wiiuproBtn.SetSoundClick(&btnSoundClick);
|
||||||
|
wiiuproBtn.SetTrigger(trigA);
|
||||||
|
wiiuproBtn.SetTrigger(trig2);
|
||||||
|
wiiuproBtn.SetEffectGrow();
|
||||||
|
|
||||||
GuiText nunchukBtnTxt1("Wiimote", 22, (GXColor){0, 0, 0, 255});
|
GuiText nunchukBtnTxt1("Wiimote", 22, (GXColor){0, 0, 0, 255});
|
||||||
GuiText nunchukBtnTxt2("&", 18, (GXColor){0, 0, 0, 255});
|
GuiText nunchukBtnTxt2("&", 18, (GXColor){0, 0, 0, 255});
|
||||||
GuiText nunchukBtnTxt3("Nunchuk", 22, (GXColor){0, 0, 0, 255});
|
GuiText nunchukBtnTxt3("Nunchuk", 22, (GXColor){0, 0, 0, 255});
|
||||||
@ -2354,7 +2420,7 @@ static int MenuSettingsMappingsController()
|
|||||||
GuiImage nunchukBtnIcon(&iconNunchuk);
|
GuiImage nunchukBtnIcon(&iconNunchuk);
|
||||||
GuiButton nunchukBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
|
GuiButton nunchukBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
|
||||||
nunchukBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
nunchukBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||||
nunchukBtn.SetPosition(125, 250);
|
nunchukBtn.SetPosition(200, 250);
|
||||||
nunchukBtn.SetLabel(&nunchukBtnTxt1, 0);
|
nunchukBtn.SetLabel(&nunchukBtnTxt1, 0);
|
||||||
nunchukBtn.SetLabel(&nunchukBtnTxt2, 1);
|
nunchukBtn.SetLabel(&nunchukBtnTxt2, 1);
|
||||||
nunchukBtn.SetLabel(&nunchukBtnTxt3, 2);
|
nunchukBtn.SetLabel(&nunchukBtnTxt3, 2);
|
||||||
@ -2395,6 +2461,7 @@ static int MenuSettingsMappingsController()
|
|||||||
{
|
{
|
||||||
w.Append(&nunchukBtn);
|
w.Append(&nunchukBtn);
|
||||||
w.Append(&classicBtn);
|
w.Append(&classicBtn);
|
||||||
|
w.Append(&wiiuproBtn);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
w.Append(&backBtn);
|
w.Append(&backBtn);
|
||||||
@ -2419,6 +2486,13 @@ static int MenuSettingsMappingsController()
|
|||||||
}
|
}
|
||||||
else if(classicBtn.GetState() == STATE_CLICKED)
|
else if(classicBtn.GetState() == STATE_CLICKED)
|
||||||
{
|
{
|
||||||
|
wiiuproCtrl = 0;
|
||||||
|
menu = MENU_GAMESETTINGS_MAPPINGS_MAP;
|
||||||
|
mapMenuCtrl = CTRLR_CLASSIC;
|
||||||
|
}
|
||||||
|
else if(wiiuproBtn.GetState() == STATE_CLICKED)
|
||||||
|
{
|
||||||
|
wiiuproCtrl = 1;
|
||||||
menu = MENU_GAMESETTINGS_MAPPINGS_MAP;
|
menu = MENU_GAMESETTINGS_MAPPINGS_MAP;
|
||||||
mapMenuCtrl = CTRLR_CLASSIC;
|
mapMenuCtrl = CTRLR_CLASSIC;
|
||||||
}
|
}
|
||||||
@ -2474,7 +2548,14 @@ ButtonMappingWindow()
|
|||||||
sprintf(msg, "Press any button on the Wiimote now. Press Home to clear the existing mapping.");
|
sprintf(msg, "Press any button on the Wiimote now. Press Home to clear the existing mapping.");
|
||||||
break;
|
break;
|
||||||
case CTRLR_CLASSIC:
|
case CTRLR_CLASSIC:
|
||||||
sprintf(msg, "Press any button on the Classic Controller now. Press Home to clear the existing mapping.");
|
if(wiiuproCtrl == 1)
|
||||||
|
{
|
||||||
|
sprintf(msg, "Press any button on the Wii U Pro Controller now. Press Home to clear the existing mapping.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sprintf(msg, "Press any button on the Classic Controller now. Press Home to clear the existing mapping.");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case CTRLR_NUNCHUK:
|
case CTRLR_NUNCHUK:
|
||||||
sprintf(msg, "Press any button on the Wiimote or Nunchuk now. Press Home to clear the existing mapping.");
|
sprintf(msg, "Press any button on the Wiimote or Nunchuk now. Press Home to clear the existing mapping.");
|
||||||
@ -2506,11 +2587,10 @@ ButtonMappingWindow()
|
|||||||
{
|
{
|
||||||
pressed = userInput[0].pad.btns_d;
|
pressed = userInput[0].pad.btns_d;
|
||||||
|
|
||||||
|
|
||||||
if(userInput[0].pad.substickX < -70 ||
|
if(userInput[0].pad.substickX < -70 ||
|
||||||
userInput[0].pad.substickX > 70 ||
|
userInput[0].pad.substickX > 70 ||
|
||||||
userInput[0].pad.substickY < -70 ||
|
userInput[0].pad.substickY < -70 ||
|
||||||
userInput[0].pad.substickY > 70)
|
userInput[0].pad.substickY > 70)
|
||||||
pressed = WPAD_BUTTON_HOME;
|
pressed = WPAD_BUTTON_HOME;
|
||||||
|
|
||||||
if(userInput[0].wpad->btns_d == WPAD_BUTTON_HOME)
|
if(userInput[0].wpad->btns_d == WPAD_BUTTON_HOME)
|
||||||
@ -2543,6 +2623,8 @@ ButtonMappingWindow()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(pressed == 0)
|
||||||
|
pressed = userInput[0].wupcdata.btns_d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2573,7 +2655,15 @@ static int MenuSettingsMappingsMap()
|
|||||||
titleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
titleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
||||||
titleTxt.SetPosition(50,30);
|
titleTxt.SetPosition(50,30);
|
||||||
|
|
||||||
sprintf(menuSubtitle, "%s - %s", gettext(ctrlName[mapMenuCtrlSNES]), gettext(ctrlrName[mapMenuCtrl]));
|
if(wiiuproCtrl == 1)
|
||||||
|
{
|
||||||
|
sprintf(menuSubtitle, "%s - %s", gettext(ctrlName[mapMenuCtrlSNES]),"Wii U Pro Controller");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sprintf(menuSubtitle, "%s - %s", gettext(ctrlName[mapMenuCtrlSNES]), gettext(ctrlrName[mapMenuCtrl]));
|
||||||
|
}
|
||||||
|
|
||||||
GuiText subtitleTxt(menuSubtitle, 20, (GXColor){255, 255, 255, 255});
|
GuiText subtitleTxt(menuSubtitle, 20, (GXColor){255, 255, 255, 255});
|
||||||
subtitleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
subtitleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
|
||||||
subtitleTxt.SetPosition(50,60);
|
subtitleTxt.SetPosition(50,60);
|
||||||
@ -2731,6 +2821,7 @@ static int MenuSettingsMappingsMap()
|
|||||||
optionBrowser.TriggerUpdate();
|
optionBrowser.TriggerUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
wiiuproCtrl = 0;
|
||||||
HaltGui();
|
HaltGui();
|
||||||
mainWindow->Remove(&optionBrowser);
|
mainWindow->Remove(&optionBrowser);
|
||||||
mainWindow->Remove(&w);
|
mainWindow->Remove(&w);
|
||||||
|
@ -28,7 +28,7 @@ char wiiIP[16] = { 0 };
|
|||||||
|
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
static int netHalt = 0;
|
static int netHalt = 0;
|
||||||
static bool updateChecked = false; // true if checked for app update
|
static bool updateChecked = true; // true if checked for app update
|
||||||
static char updateURL[128]; // URL of app update
|
static char updateURL[128]; // URL of app update
|
||||||
bool updateFound = false; // true if an app update was found
|
bool updateFound = false; // true if an app update was found
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ void UpdateCheck()
|
|||||||
if(tmp)
|
if(tmp)
|
||||||
{
|
{
|
||||||
snprintf(updateURL, 128, "%s", tmp);
|
snprintf(updateURL, 128, "%s", tmp);
|
||||||
updateFound = true;
|
updateFound = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,6 +78,7 @@ bool8 S9xOpenSoundDevice(void)
|
|||||||
/* eke-eke */
|
/* eke-eke */
|
||||||
void S9xInitSync()
|
void S9xInitSync()
|
||||||
{
|
{
|
||||||
|
FrameTimer = 0;
|
||||||
prev = gettime();
|
prev = gettime();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,8 +86,6 @@ void S9xInitSync()
|
|||||||
|
|
||||||
void S9xSyncSpeed ()
|
void S9xSyncSpeed ()
|
||||||
{
|
{
|
||||||
unsigned int timediffallowed = Settings.TurboMode ? 0 : Settings.FrameTime;
|
|
||||||
|
|
||||||
while (!S9xSyncSound())
|
while (!S9xSyncSound())
|
||||||
usleep(10);
|
usleep(10);
|
||||||
|
|
||||||
@ -95,12 +94,17 @@ void S9xSyncSpeed ()
|
|||||||
if (Settings.TurboMode)
|
if (Settings.TurboMode)
|
||||||
skipFrms = Settings.TurboSkipFrames;
|
skipFrms = Settings.TurboSkipFrames;
|
||||||
|
|
||||||
now = gettime();
|
if (timerstyle == 0) /* use Wii vertical sync (VSYNC) with NTSC roms */
|
||||||
|
|
||||||
if (diff_usec(prev, now) > timediffallowed)
|
|
||||||
{
|
{
|
||||||
/* Timer has already expired */
|
while (FrameTimer == 0)
|
||||||
if (IPPU.SkippedFrames < skipFrms)
|
{
|
||||||
|
usleep(50);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FrameTimer > skipFrms)
|
||||||
|
FrameTimer = skipFrms;
|
||||||
|
|
||||||
|
if ((FrameTimer > 1) && (IPPU.SkippedFrames < skipFrms))
|
||||||
{
|
{
|
||||||
IPPU.SkippedFrames++;
|
IPPU.SkippedFrames++;
|
||||||
IPPU.RenderThisFrame = FALSE;
|
IPPU.RenderThisFrame = FALSE;
|
||||||
@ -111,20 +115,42 @@ void S9xSyncSpeed ()
|
|||||||
IPPU.RenderThisFrame = TRUE;
|
IPPU.RenderThisFrame = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else /* use internal timer for PAL roms */
|
||||||
{
|
{
|
||||||
/*** Ahead - so hold up ***/
|
unsigned int timediffallowed = Settings.TurboMode ? 0 : Settings.FrameTime;
|
||||||
while (diff_usec(prev, now) < timediffallowed)
|
now = gettime();
|
||||||
|
|
||||||
|
if (diff_usec(prev, now) > timediffallowed)
|
||||||
{
|
{
|
||||||
now = gettime();
|
/* Timer has already expired */
|
||||||
usleep(50);
|
if (IPPU.SkippedFrames < skipFrms)
|
||||||
|
{
|
||||||
|
IPPU.SkippedFrames++;
|
||||||
|
IPPU.RenderThisFrame = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IPPU.SkippedFrames = 0;
|
||||||
|
IPPU.RenderThisFrame = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
IPPU.RenderThisFrame = TRUE;
|
else
|
||||||
IPPU.SkippedFrames = 0;
|
{
|
||||||
|
/*** Ahead - so hold up ***/
|
||||||
|
while (diff_usec(prev, now) < timediffallowed)
|
||||||
|
{
|
||||||
|
now = gettime();
|
||||||
|
usleep(50);
|
||||||
|
}
|
||||||
|
IPPU.RenderThisFrame = TRUE;
|
||||||
|
IPPU.SkippedFrames = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
prev = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
prev = now;
|
if (!Settings.TurboMode)
|
||||||
|
FrameTimer--;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,10 +15,11 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <string>
|
||||||
#include <ogcsys.h>
|
#include <ogcsys.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wiiuse/wpad.h>
|
#include <wiiuse/wpad.h>
|
||||||
|
#include <wupc/wupc.h>
|
||||||
#include <fat.h>
|
#include <fat.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <sys/iosupport.h>
|
#include <sys/iosupport.h>
|
||||||
@ -85,6 +86,26 @@ void ExitCleanup()
|
|||||||
void (*PSOReload) () = (void (*)()) 0x80001800;
|
void (*PSOReload) () = (void (*)()) 0x80001800;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void ExitToWiiflow()
|
||||||
|
{
|
||||||
|
ShutoffRumble();
|
||||||
|
SavePrefs(SILENT);
|
||||||
|
if (SNESROMSize > 0 && !ConfigRequested && GCSettings.AutoSave == 1)
|
||||||
|
SaveSRAMAuto(SILENT);
|
||||||
|
ExitCleanup();
|
||||||
|
|
||||||
|
if( !!*(u32*)0x80001800 )
|
||||||
|
{
|
||||||
|
// Were we launched via HBC? (or via wiiflows stub replacement? :P)
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Wii channel support
|
||||||
|
SYS_ResetSystem( SYS_RETURNTOMENU, 0, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ExitApp()
|
void ExitApp()
|
||||||
{
|
{
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
@ -181,6 +202,31 @@ void ipl_set_config(unsigned char c)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* setFrameTimerMethod()
|
||||||
|
* change frametimer method depending on whether ROM is NTSC or PAL
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
void setFrameTimerMethod()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
Set frametimer method
|
||||||
|
(timerstyle: 0=NTSC vblank, 1=PAL int timer)
|
||||||
|
*/
|
||||||
|
if ( Settings.PAL ) {
|
||||||
|
if(vmode_60hz)
|
||||||
|
timerstyle = 1;
|
||||||
|
else
|
||||||
|
timerstyle = 0;
|
||||||
|
} else {
|
||||||
|
if(vmode_60hz)
|
||||||
|
timerstyle = 0;
|
||||||
|
else
|
||||||
|
timerstyle = 1;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* IOS Check
|
* IOS Check
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
@ -346,6 +392,7 @@ int main(int argc, char *argv[])
|
|||||||
SYS_SetPowerCallback(ShutdownCB);
|
SYS_SetPowerCallback(ShutdownCB);
|
||||||
SYS_SetResetCallback(ResetCB);
|
SYS_SetResetCallback(ResetCB);
|
||||||
|
|
||||||
|
WUPC_Init();
|
||||||
WPAD_Init();
|
WPAD_Init();
|
||||||
WPAD_SetPowerButtonCallback((WPADShutdownCallback)ShutdownCB);
|
WPAD_SetPowerButtonCallback((WPADShutdownCallback)ShutdownCB);
|
||||||
DI_Init();
|
DI_Init();
|
||||||
@ -399,6 +446,64 @@ int main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
InitGUIThreads();
|
InitGUIThreads();
|
||||||
|
|
||||||
|
bool autoboot = false;
|
||||||
|
if(argc > 3 && argv[1] != NULL && argv[2] != NULL && argv[3] != NULL)
|
||||||
|
{
|
||||||
|
autoboot = true;
|
||||||
|
ResetBrowser();
|
||||||
|
LoadPrefs();
|
||||||
|
if(strcasestr(argv[1], "sd:/") != NULL)
|
||||||
|
{
|
||||||
|
GCSettings.SaveMethod = DEVICE_SD;
|
||||||
|
GCSettings.LoadMethod = DEVICE_SD;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GCSettings.SaveMethod = DEVICE_USB;
|
||||||
|
GCSettings.LoadMethod = DEVICE_USB;
|
||||||
|
}
|
||||||
|
SavePrefs(SILENT);
|
||||||
|
selectLoadedFile = 1;
|
||||||
|
std::string dir(argv[1]);
|
||||||
|
dir.assign(&dir[dir.find_last_of(":") + 2]);
|
||||||
|
char arg_filename[1024];
|
||||||
|
strncpy(arg_filename, argv[2], sizeof(arg_filename));
|
||||||
|
strncpy(GCSettings.LoadFolder, dir.c_str(), sizeof(GCSettings.LoadFolder));
|
||||||
|
OpenGameList();
|
||||||
|
strncpy(GCSettings.Exit_Dol_File, argv[3], sizeof(GCSettings.Exit_Dol_File));
|
||||||
|
if(argc > 5 && argv[4] != NULL && argv[5] != NULL)
|
||||||
|
{
|
||||||
|
sscanf(argv[4], "%08x", &GCSettings.Exit_Channel[0]);
|
||||||
|
sscanf(argv[5], "%08x", &GCSettings.Exit_Channel[1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GCSettings.Exit_Channel[0] = 0x00010008;
|
||||||
|
GCSettings.Exit_Channel[1] = 0x57494948;
|
||||||
|
}
|
||||||
|
if(argc > 6 && argv[6] != NULL)
|
||||||
|
strncpy(GCSettings.LoaderName, argv[6], sizeof(GCSettings.LoaderName));
|
||||||
|
else
|
||||||
|
snprintf(GCSettings.LoaderName, sizeof(GCSettings.LoaderName), "WiiFlow");
|
||||||
|
for(int i = 0; i < browser.numEntries; i++)
|
||||||
|
{
|
||||||
|
// Skip it
|
||||||
|
if (strcmp(browserList[i].filename, ".") == 0 || strcmp(browserList[i].filename, "..") == 0)
|
||||||
|
continue;
|
||||||
|
if(strcasestr(browserList[i].filename, arg_filename) != NULL)
|
||||||
|
{
|
||||||
|
browser.selIndex = i;
|
||||||
|
if(IsSz())
|
||||||
|
{
|
||||||
|
BrowserLoadSz();
|
||||||
|
browser.selIndex = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BrowserLoadFile();
|
||||||
|
}
|
||||||
|
|
||||||
while (1) // main loop
|
while (1) // main loop
|
||||||
{
|
{
|
||||||
// go back to checking if devices were inserted/removed
|
// go back to checking if devices were inserted/removed
|
||||||
@ -407,10 +512,21 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
SwitchAudioMode(1);
|
SwitchAudioMode(1);
|
||||||
|
|
||||||
if(SNESROMSize == 0)
|
// if(SNESROMSize == 0)
|
||||||
MainMenu(MENU_GAMESELECTION);
|
// MainMenu(MENU_GAMESELECTION);
|
||||||
else
|
// else
|
||||||
|
// MainMenu(MENU_GAME);
|
||||||
|
if(!autoboot)
|
||||||
|
{
|
||||||
MainMenu(MENU_GAME);
|
MainMenu(MENU_GAME);
|
||||||
|
ConfigRequested = 0;
|
||||||
|
ScreenshotRequested = 0;
|
||||||
|
}
|
||||||
|
else if(SNESROMSize != 0 && autoboot)
|
||||||
|
autoboot = false;
|
||||||
|
else
|
||||||
|
ExitApp();
|
||||||
|
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
SelectFilterMethod();
|
SelectFilterMethod();
|
||||||
#endif
|
#endif
|
||||||
@ -430,6 +546,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
AudioStart ();
|
AudioStart ();
|
||||||
|
|
||||||
|
FrameTimer = 0;
|
||||||
|
setFrameTimerMethod (); // set frametimer method every time a ROM is loaded
|
||||||
|
|
||||||
CheckVideo = 2; // force video update
|
CheckVideo = 2; // force video update
|
||||||
prevRenderedFrameCount = IPPU.RenderedFramesCount;
|
prevRenderedFrameCount = IPPU.RenderedFramesCount;
|
||||||
currentMode = GCSettings.render;
|
currentMode = GCSettings.render;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "filelist.h"
|
#include "filelist.h"
|
||||||
|
|
||||||
#define APPNAME "Snes9x GX"
|
#define APPNAME "Snes9x GX"
|
||||||
#define APPVERSION "4.3.2"
|
#define APPVERSION "4.3.4"
|
||||||
#define APPFOLDER "snes9xgx"
|
#define APPFOLDER "snes9xgx"
|
||||||
#define PREF_FILE_NAME "settings.xml"
|
#define PREF_FILE_NAME "settings.xml"
|
||||||
|
|
||||||
@ -90,6 +90,10 @@ struct SGCSettings{
|
|||||||
char CheatFolder[MAXPATHLEN]; // Path to cheat files
|
char CheatFolder[MAXPATHLEN]; // Path to cheat files
|
||||||
char ScreenshotsFolder[MAXPATHLEN]; //Path to screenshots files
|
char ScreenshotsFolder[MAXPATHLEN]; //Path to screenshots files
|
||||||
|
|
||||||
|
char Exit_Dol_File[MAXPATHLEN]; // Exit Path
|
||||||
|
char LoaderName[20]; // Menu Loader Name
|
||||||
|
u32 Exit_Channel[2]; // Exit Channel
|
||||||
|
|
||||||
char smbip[80];
|
char smbip[80];
|
||||||
char smbuser[20];
|
char smbuser[20];
|
||||||
char smbpwd[20];
|
char smbpwd[20];
|
||||||
|
@ -67,7 +67,8 @@ int gameScreenPngSize = 0;
|
|||||||
|
|
||||||
u32 FrameTimer = 0;
|
u32 FrameTimer = 0;
|
||||||
|
|
||||||
static bool vmode_60hz = true;
|
bool vmode_60hz = true;
|
||||||
|
int timerstyle = 0;
|
||||||
bool progressive = 0;
|
bool progressive = 0;
|
||||||
|
|
||||||
#define HASPECT 320
|
#define HASPECT 320
|
||||||
|
@ -36,6 +36,8 @@ extern bool progressive;
|
|||||||
extern u8 * gameScreenPng;
|
extern u8 * gameScreenPng;
|
||||||
extern int gameScreenPngSize;
|
extern int gameScreenPngSize;
|
||||||
extern u32 FrameTimer;
|
extern u32 FrameTimer;
|
||||||
|
extern bool vmode_60hz;
|
||||||
|
extern int timerstyle;
|
||||||
extern int CheckVideo;
|
extern int CheckVideo;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <ppc/timebase.h>
|
#include <ppc/timebase.h>
|
||||||
#include <xenon_sound/sound.h>
|
#include <xenon_sound/sound.h>
|
||||||
|
|
||||||
int FrameTimer = 0;
|
int FrameTimer, timerstyle = 1;
|
||||||
unsigned long long prev, now;
|
unsigned long long prev, now;
|
||||||
|
|
||||||
unsigned long long gettime(void)
|
unsigned long long gettime(void)
|
||||||
@ -128,6 +128,7 @@ void S9xGenerateSound()
|
|||||||
/* eke-eke */
|
/* eke-eke */
|
||||||
void S9xInitSync()
|
void S9xInitSync()
|
||||||
{
|
{
|
||||||
|
FrameTimer = 0;
|
||||||
prev = gettime();
|
prev = gettime();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,14 +141,17 @@ void S9xSyncSpeed ()
|
|||||||
if (Settings.TurboMode)
|
if (Settings.TurboMode)
|
||||||
skipFrms = Settings.TurboSkipFrames;
|
skipFrms = Settings.TurboSkipFrames;
|
||||||
|
|
||||||
unsigned int timediffallowed = Settings.TurboMode ? 0 : Settings.FrameTime;
|
if (timerstyle == 0) /* use NGC vertical sync (VSYNC) with NTSC roms */
|
||||||
now = gettime();
|
|
||||||
|
|
||||||
if (diff_usec(prev, now) > timediffallowed)
|
|
||||||
{
|
{
|
||||||
printf("L\n");
|
while (FrameTimer == 0)
|
||||||
/* Timer has already expired */
|
{
|
||||||
if (IPPU.SkippedFrames < skipFrms)
|
udelay(50);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FrameTimer > skipFrms)
|
||||||
|
FrameTimer = skipFrms;
|
||||||
|
|
||||||
|
if ((FrameTimer > 1) && (IPPU.SkippedFrames < skipFrms))
|
||||||
{
|
{
|
||||||
IPPU.SkippedFrames++;
|
IPPU.SkippedFrames++;
|
||||||
IPPU.RenderThisFrame = FALSE;
|
IPPU.RenderThisFrame = FALSE;
|
||||||
@ -158,20 +162,43 @@ void S9xSyncSpeed ()
|
|||||||
IPPU.RenderThisFrame = TRUE;
|
IPPU.RenderThisFrame = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else /* use internal timer for PAL roms */
|
||||||
{
|
{
|
||||||
/*** Ahead - so hold up ***/
|
unsigned int timediffallowed = Settings.TurboMode ? 0 : Settings.FrameTime;
|
||||||
while (diff_usec(prev, now) < timediffallowed)
|
now = gettime();
|
||||||
|
|
||||||
|
if (diff_usec(prev, now) > timediffallowed)
|
||||||
{
|
{
|
||||||
now = gettime();
|
printf("L\n");
|
||||||
udelay(50);
|
/* Timer has already expired */
|
||||||
|
if (IPPU.SkippedFrames < skipFrms)
|
||||||
|
{
|
||||||
|
IPPU.SkippedFrames++;
|
||||||
|
IPPU.RenderThisFrame = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IPPU.SkippedFrames = 0;
|
||||||
|
IPPU.RenderThisFrame = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
IPPU.RenderThisFrame = TRUE;
|
else
|
||||||
IPPU.SkippedFrames = 0;
|
{
|
||||||
|
/*** Ahead - so hold up ***/
|
||||||
|
while (diff_usec(prev, now) < timediffallowed)
|
||||||
|
{
|
||||||
|
now = gettime();
|
||||||
|
udelay(50);
|
||||||
|
}
|
||||||
|
IPPU.RenderThisFrame = TRUE;
|
||||||
|
IPPU.SkippedFrames = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
prev = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
prev = now;
|
if (!Settings.TurboMode)
|
||||||
|
FrameTimer--;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<app version="4.3.2">
|
<app version="4.3.4">
|
||||||
<file url="http://snes9x-gx.googlecode.com/files/Snes9x%20GX%204.3.2.zip"></file>
|
<file url="http://snes9x-gx.googlecode.com/files/Snes9x%20GX%204.3.2.zip"></file>
|
||||||
</app>
|
</app>
|
||||||
|