fix last commit not working at all, and also, move stylus jitter (for CSI: dark motives) into a game hack

This commit is contained in:
zeromus 2017-03-04 01:42:08 -06:00
parent c1e5a56233
commit 23c8955551
5 changed files with 8 additions and 22 deletions

View File

@ -1,7 +1,7 @@
/*
Copyright (C) 2006 yopyop
Copyright (C) 2007 shash
Copyright (C) 2007-2016 DeSmuME team
Copyright (C) 2007-2017 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -1560,7 +1560,7 @@ void FASTCALL MMU_writeToSPIData(u16 val)
if(nds.adc_jitterctr == 25)
{
nds.adc_jitterctr = 0;
if (nds.stylusJitter)
if (CommonSettings.gamehacks.flags.stylusjitter)
{
nds.adc_touchY ^= 16;
nds.adc_touchX ^= 16;

View File

@ -306,7 +306,7 @@ bool GameInfo::hasRomBanner()
bool GameInfo::IsCode(const char* code) const
{
return memcmp(code,header.gameCode,strlen(code));
return memcmp(code,header.gameCode,strlen(code))==0;
}
const RomBanner& GameInfo::getRomBanner()
@ -2547,7 +2547,6 @@ 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;
nds_timer = 0;
@ -2764,7 +2763,6 @@ void NDS_setTouchPos(u16 x, u16 y)
rawUserInput.touch.touchX = x<<4;
rawUserInput.touch.touchY = y<<4;
rawUserInput.touch.isTouch = true;
nds.stylusJitter = CommonSettings.StylusJitter;
if(movieMode != MOVIEMODE_INACTIVE && movieMode != MOVIEMODE_FINISHED)
{
@ -3078,6 +3076,7 @@ void TCommonSettings::GameHacks::apply()
if(!en) return;
flags.overclock = gameInfo.IsCode("IPK") || gameInfo.IsCode("IPG"); //HG/SS
flags.stylusjitter = gameInfo.IsCode("YDM"); //CSI: Dark Motives
}
void TCommonSettings::GameHacks::clear()

View File

@ -182,7 +182,6 @@ 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;
@ -513,7 +512,6 @@ extern struct TCommonSettings
, spu_advanced(false)
, StylusPressure(50)
, ConsoleType(NDS_CONSOLE_TYPE_FAT)
, StylusJitter(false)
, backupSave(false)
, SPU_sync_mode(0)
, SPU_sync_method(0)
@ -592,6 +590,7 @@ extern struct TCommonSettings
struct {
bool overclock;
bool stylusjitter;
} flags;
void apply();

View File

@ -3,7 +3,7 @@
licensed under the terms supplied at the end of this file (for the terms are very long!)
Differences from that baseline version are:
Copyright (C) 2009-2016 DeSmuME team
Copyright (C) 2009-2017 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -492,12 +492,6 @@ void HK_DecreasePressure(int, bool justPressed) {
if(CommonSettings.StylusPressure<0) CommonSettings.StylusPressure = 0;
driver->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);
driver->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);}
@ -639,12 +633,6 @@ 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

@ -1,6 +1,6 @@
/*
Copyright (C) 2006 yopyop
Copyright (C) 2008-2016 DeSmuME team
Copyright (C) 2008-2017 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -78,7 +78,7 @@ struct SCustomKeys
#ifdef HAVE_JIT
SCustomKey CpuMode, JitBlockSizeDec, JitBlockSizeInc;
#endif
SCustomKey FrameAdvance, FastForward, FastForwardToggle, IncreaseSpeed, DecreaseSpeed, FrameLimitToggle, Microphone, IncreasePressure, DecreasePressure, ToggleStylusJitter;
SCustomKey FrameAdvance, FastForward, FastForwardToggle, IncreaseSpeed, DecreaseSpeed, FrameLimitToggle, Microphone, IncreasePressure, DecreasePressure;
SCustomKey PlayMovie, RecordMovie, StopMovie, ToggleReadOnly;