1
0
mirror of synced 2024-11-27 16:10:52 +01:00

MAME and Demul Changes

This commit is contained in:
Aaron M 2020-06-24 17:15:56 +12:00
parent 5830fa50db
commit 747d96cb04
2 changed files with 9 additions and 25 deletions

View File

@ -28,6 +28,7 @@ extern void SmashingDriveInputsEnabled(Helpers* helpers);
extern void ATVTrackInputsEnabled(Helpers* helpers);
extern void FasterThanSpeedInputsEnabled(Helpers* helpers);
extern void MaximumSpeedInputsEnabled(Helpers* helpers);
extern void changeVolume();
static EffectTriggers* myTriggers;
static EffectConstants* myConstants;
@ -45,7 +46,6 @@ static bool shiftupA;
static bool shiftdownA;
static bool coinA;
static bool VolumeMute = false;
static bool VolumeMute2 = false;
static bool CRCinit = false;
static bool NOPinit = false;
static bool InputFind = false;
@ -80,9 +80,9 @@ extern int configAlternativeMinForceRight;
extern int configAlternativeMaxForceRight;
extern int EnableForceSpringEffect;
extern int ForceSpringStrength;
extern int AutoCloseWindowError;
static int InputDeviceWheelEnable = GetPrivateProfileInt(TEXT("Settings"), TEXT("InputDeviceWheelEnable"), 0, settingsFilename);
static int AutoCloseWindowError = GetPrivateProfileInt(TEXT("Settings"), TEXT("AutoCloseWindowError"), 0, settingsFilename);
static int configMinForceInitialDDemul = GetPrivateProfileInt(TEXT("Settings"), TEXT("MinForceInitialDDemul"), 0, settingsFilename);
static int configMaxForceInitialDDemul = GetPrivateProfileInt(TEXT("Settings"), TEXT("MaxForceInitialDDemul"), 100, settingsFilename);
@ -497,16 +497,6 @@ static DWORD WINAPI MaximumSpeedRunningLoop(LPVOID lpParam)
}
}
void changeVolume()
{
INPUT ip = { 0 };
ip.type = INPUT_KEYBOARD;
ip.ki.wVk = VK_VOLUME_MUTE;
SendInput(1, &ip, sizeof(INPUT));
ip.ki.dwFlags = KEYEVENTF_KEYUP;
SendInput(1, &ip, sizeof(INPUT));
}
static DWORD WINAPI VolumeMuteThread(LPVOID lpParam)
{
SendMessage(hWnd, WM_CLOSE, NULL, NULL);
@ -550,12 +540,6 @@ void Demul::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers
{
if (!VolumeMute)
{
if (!VolumeMute2)
{
changeVolume();
VolumeMute2 = true;
}
//Remove window error popup
hWnd = FindWindowA(0, ("padDemul"));
if (hWnd > NULL)

View File

@ -1186,7 +1186,7 @@ static DWORD WINAPI ScanThread(LPVOID lpParam)
if (romname == indy500 || romname == indy500d || romname == indy500to) //Indy500
{
aAddy2 = PatternScan("\xFF\x4E\x00\x00\x00\x00\x01", "xxxxxxx");
aAddy2 = PatternScan("\x01\xFF\xFF\xFF\x10\x00\xFF\x4E", "xxxx??xx");
}
if (romname == sgt24h) //Sega GT 24hr
@ -1196,7 +1196,7 @@ static DWORD WINAPI ScanThread(LPVOID lpParam)
if (romname == srallyc || romname == srallycb || romname == srallycdx || romname == srallycdxa) //Sega Rally
{
aAddy2 = PatternScan("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x70\xFF\x00\x00\x70\xFF", "xxxxxxxxxxxxxxxx");
aAddy2 = PatternScan("\x01\x04\x00\x00\x80\x3F\xF2\xFF\xFF\xFF\x01\x00\x02\x00\x00\x00\x0B\x00\x01\x00\x01", "xxxxxxxxxxxxxxxxxxxxx");
}
if (romname == superchs || romname == superchsj || romname == superchsp || romname == superchsu) //Super Chase Criminal Termination
@ -3327,11 +3327,10 @@ void MAMESupermodel::FFBLoop(EffectConstants* constants, Helpers* helpers, Effec
CreateThread(NULL, 0, ScanThread, NULL, 0, NULL);
Scan = true;
}
UINT8 CheckAddy2 = helpers->ReadByte((int)aAddy2 - 0x02, false);
UINT8 CheckAddy2 = helpers->ReadByte((int)aAddy2 + 0x04, false);
if (CheckAddy2 == 0x01)
{
FFBAddress = (int)aAddy2 - 0x02;
FFBAddress = (int)aAddy2 + 0x04;
PatternFind = true;
}
}
@ -3432,9 +3431,10 @@ void MAMESupermodel::FFBLoop(EffectConstants* constants, Helpers* helpers, Effec
Scan = true;
}
if ((UINT8)aAddy2 == 0x53)
UINT8 CheckAddy2 = helpers->ReadByte((int)aAddy2 + 0x35, false);
if (CheckAddy2 == 0xFF)
{
FFBAddress = (int)aAddy2 - 0x0A;
FFBAddress = (int)aAddy2 + 0x2B;
PatternFind = true;
}
}