add stylus jitter on/off hotkey (default:on)

because the jitter hack can be annoying when TASing.
This commit is contained in:
gocha 2012-07-27 10:31:23 +00:00
parent 49eb575ccb
commit d47e9bd2d6
7 changed files with 23 additions and 3 deletions

View File

@ -4009,8 +4009,11 @@ void FASTCALL _MMU_ARM7_write16(u32 adr, u16 val)
if(nds.adc_jitterctr == 25)
{
nds.adc_jitterctr = 0;
nds.adc_touchY ^= 16;
nds.adc_touchX ^= 16;
if (nds.stylusJitter)
{
nds.adc_touchY ^= 16;
nds.adc_touchX ^= 16;
}
}
if(MMU.SPI_CNT&(1<<11))
{

View File

@ -2522,6 +2522,7 @@ void NDS_Reset()
nds.ConsoleType = CommonSettings.ConsoleType;
nds._DebugConsole = CommonSettings.DebugConsole;
nds.ensataEmulation = CommonSettings.EnsataEmulation;
nds.stylusJitter = CommonSettings.StylusJitter;
nds.ensataHandshake = ENSATA_HANDSHAKE_none;
nds.ensataIpcSyncCounter = 0;
SetupMMU(nds.Is_DebugConsole(),nds.Is_DSI());

View File

@ -177,6 +177,7 @@ struct NDSSystem
u16 adc_touchX;
u16 adc_touchY;
s32 adc_jitterctr;
BOOL stylusJitter;
//the DSI returns calibrated touch coords from its TSC (?), so we need to save these separately
u16 scr_touchX;
@ -507,6 +508,7 @@ extern struct TCommonSettings {
, spu_advanced(false)
, StylusPressure(50)
, ConsoleType(NDS_CONSOLE_TYPE_FAT)
, StylusJitter(true)
{
strcpy(ARM9BIOS, "biosnds9.bin");
strcpy(ARM7BIOS, "biosnds7.bin");
@ -558,6 +560,7 @@ extern struct TCommonSettings {
bool rigorous_timing;
int StylusPressure;
bool StylusJitter;
bool dispLayers[2][5];

View File

@ -464,6 +464,12 @@ void HK_DecreasePressure(int, bool justPressed) {
if(CommonSettings.StylusPressure<0) CommonSettings.StylusPressure = 0;
osd->addLine("Stylus Pressure to %d%%",CommonSettings.StylusPressure);
}
void HK_ToggleStylusJitter(int, bool justPressed) {
CommonSettings.StylusJitter = !CommonSettings.StylusJitter;
nds.stylusJitter = CommonSettings.StylusJitter;
WritePrivateProfileBool("Emulation", "StylusJitter", CommonSettings.StylusJitter, IniName);
osd->addLine("Stylus Jitter %s",CommonSettings.StylusJitter ? "On" : "Off");
}
void HK_Rotate0(int, bool justPressed) { SetRotate(MainWindow->getHWnd(), 0);}
void HK_Rotate90(int, bool justPressed) { SetRotate(MainWindow->getHWnd(), 90);}
@ -579,6 +585,12 @@ void InitCustomKeys (SCustomKeys *keys)
keys->DecreasePressure.key = VK_OEM_MINUS;
keys->DecreasePressure.modifiers = CUSTKEY_SHIFT_MASK;
keys->ToggleStylusJitter.handleKeyDown = HK_ToggleStylusJitter;
keys->ToggleStylusJitter.code = "ToggleStylusJitter";
keys->ToggleStylusJitter.name = STRW(ID_LABEL_HK61);
keys->ToggleStylusJitter.page = HOTKEY_PAGE_MAIN;
keys->ToggleStylusJitter.key = NULL;
keys->Microphone.handleKeyDown = HK_MicrophoneKeyDown;
keys->Microphone.handleKeyUp = HK_MicrophoneKeyUp;
keys->Microphone.code = "Microphone";

View File

@ -71,7 +71,7 @@ struct SCustomKeys
SCustomKey Rotate0, Rotate90, Rotate180, Rotate270;
SCustomKey OpenROM, ReloadROM, Reset, Pause, CpuMode, FrameAdvance, FastForward, FastForwardToggle, IncreaseSpeed, DecreaseSpeed, FrameLimitToggle, Microphone, IncreasePressure, DecreasePressure;
SCustomKey OpenROM, ReloadROM, Reset, Pause, CpuMode, FrameAdvance, FastForward, FastForwardToggle, IncreaseSpeed, DecreaseSpeed, FrameLimitToggle, Microphone, IncreasePressure, DecreasePressure, ToggleStylusJitter;
SCustomKey PlayMovie, RecordMovie, StopMovie, ToggleReadOnly;

View File

@ -805,6 +805,7 @@
#define ID_LABEL_HK58 4523
#define ID_LABEL_HK59 4524
#define ID_LABEL_HK60 4525
#define ID_LABEL_HK61 4526
#define IDD_MICROPHONE 5000
#define IDM_MICROPHONESETTINGS 5001
#define IDC_MICSAMPLEBROWSE 5003

Binary file not shown.