From 596e714064c950c36b33c25c454fc94aa6c0e22d Mon Sep 17 00:00:00 2001 From: Boomslangnz Date: Thu, 9 Mar 2023 20:16:34 +1300 Subject: [PATCH] Demul Fixes --- Game Files/DemulATVTrackInputs.cpp | 8 ++++---- Game Files/DemulFasterThanSpeedInputs.cpp | 8 ++++---- Game Files/DemulInitialDInputs.cpp | 8 ++++---- Game Files/DemulMaximumSpeedInputs.cpp | 8 ++++---- Game Files/DemulNascarInputs.cpp | 8 ++++---- Game Files/DemulSmashingDriveInputs.cpp | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Game Files/DemulATVTrackInputs.cpp b/Game Files/DemulATVTrackInputs.cpp index a264e53..68c7f50 100644 --- a/Game Files/DemulATVTrackInputs.cpp +++ b/Game Files/DemulATVTrackInputs.cpp @@ -146,7 +146,7 @@ void ATVTrackInputsEnabled(Helpers* helpers) while (SDL_WaitEvent(&e) != 0) { - if ((e.type == SDL_JOYAXISMOTION) & (ShowAxisForSetup == 0)) + if ((e.type == SDL_JOYAXISMOTION) && (ShowAxisForSetup == 0)) { if (e.jaxis.which == joystick_index1) { @@ -164,7 +164,7 @@ void ATVTrackInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value + WHEEL_DEAD_ZONE; SteeringValue = (127 + (e.jaxis.value - WHEEL_DEAD_ZONE) / 255); } - else if ((e.jaxis.value < WHEEL_DEAD_ZONE) & (e.jaxis.value > -WHEEL_DEAD_ZONE)) + else if ((e.jaxis.value < WHEEL_DEAD_ZONE) && (e.jaxis.value > -WHEEL_DEAD_ZONE)) { SteeringValue = 0x7F; } @@ -187,7 +187,7 @@ void ATVTrackInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value - ACCL_DEAD_ZONE; BrakeValue = ((e.jaxis.value + ACCL_DEAD_ZONE) / 128); } - else if ((e.jaxis.value < ACCL_DEAD_ZONE) & (e.jaxis.value > -ACCL_DEAD_ZONE)) + else if ((e.jaxis.value < ACCL_DEAD_ZONE) && (e.jaxis.value > -ACCL_DEAD_ZONE)) { helpers->WriteByte(AcclAddress, 0x00, false); BrakeValue = 0x00; @@ -274,7 +274,7 @@ void ATVTrackInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value + ACCL_DEAD_ZONE; BrakeValue = ((-e.jaxis.value + ACCL_DEAD_ZONE) / 128); } - else if ((e.jaxis.value < ACCL_DEAD_ZONE) & (e.jaxis.value > -ACCL_DEAD_ZONE)) + else if ((e.jaxis.value < ACCL_DEAD_ZONE) && (e.jaxis.value > -ACCL_DEAD_ZONE)) { helpers->WriteByte(AcclAddress, 0xFF, false); BrakeValue = 0x00; diff --git a/Game Files/DemulFasterThanSpeedInputs.cpp b/Game Files/DemulFasterThanSpeedInputs.cpp index 95e215c..22a5050 100644 --- a/Game Files/DemulFasterThanSpeedInputs.cpp +++ b/Game Files/DemulFasterThanSpeedInputs.cpp @@ -140,7 +140,7 @@ void FasterThanSpeedInputsEnabled(Helpers* helpers) while (SDL_WaitEvent(&e) != 0) { - if ((e.type == SDL_JOYAXISMOTION) & (ShowAxisForSetup == 0)) + if ((e.type == SDL_JOYAXISMOTION) && (ShowAxisForSetup == 0)) { if (e.jaxis.which == joystick_index1) { @@ -158,7 +158,7 @@ void FasterThanSpeedInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value + WHEEL_DEAD_ZONE; helpers->WriteByte(SteeringAddress, (127 + (e.jaxis.value - WHEEL_DEAD_ZONE) / 255), false); } - else if ((e.jaxis.value < WHEEL_DEAD_ZONE) & (e.jaxis.value > -WHEEL_DEAD_ZONE)) + else if ((e.jaxis.value < WHEEL_DEAD_ZONE) && (e.jaxis.value > -WHEEL_DEAD_ZONE)) { helpers->WriteByte(SteeringAddress, 0x7F, false); } @@ -179,7 +179,7 @@ void FasterThanSpeedInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value - ACCL_DEAD_ZONE; helpers->WriteByte(BrakeAddress, ((e.jaxis.value + ACCL_DEAD_ZONE) / 128), false); } - else if ((e.jaxis.value < ACCL_DEAD_ZONE) & (e.jaxis.value > -ACCL_DEAD_ZONE)) + else if ((e.jaxis.value < ACCL_DEAD_ZONE) && (e.jaxis.value > -ACCL_DEAD_ZONE)) { helpers->WriteByte(AcclAddress, 0x00, false); helpers->WriteByte(BrakeAddress, 0x00, false); @@ -232,7 +232,7 @@ void FasterThanSpeedInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value + ACCL_DEAD_ZONE; helpers->WriteByte(BrakeAddress, ((-e.jaxis.value + ACCL_DEAD_ZONE) / 128), false); } - else if ((e.jaxis.value < ACCL_DEAD_ZONE) & (e.jaxis.value > -ACCL_DEAD_ZONE)) + else if ((e.jaxis.value < ACCL_DEAD_ZONE) && (e.jaxis.value > -ACCL_DEAD_ZONE)) { helpers->WriteByte(AcclAddress, 0xFF, false); helpers->WriteByte(BrakeAddress, 0xFF, false); diff --git a/Game Files/DemulInitialDInputs.cpp b/Game Files/DemulInitialDInputs.cpp index a5c473e..e8579a6 100644 --- a/Game Files/DemulInitialDInputs.cpp +++ b/Game Files/DemulInitialDInputs.cpp @@ -152,7 +152,7 @@ void InitialDInputsEnabled(Helpers* helpers) while (SDL_WaitEvent(&e) != 0) { - if ((e.type == SDL_JOYAXISMOTION) & (ShowAxisForSetup == 0)) + if ((e.type == SDL_JOYAXISMOTION) && (ShowAxisForSetup == 0)) { if (e.jaxis.which == joystick_index1) { @@ -170,7 +170,7 @@ void InitialDInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value + WHEEL_DEAD_ZONE; helpers->WriteByte(SteeringAddress, (127 + (e.jaxis.value - WHEEL_DEAD_ZONE) / 255), false); } - else if ((e.jaxis.value < WHEEL_DEAD_ZONE) & (e.jaxis.value > -WHEEL_DEAD_ZONE)) + else if ((e.jaxis.value < WHEEL_DEAD_ZONE) && (e.jaxis.value > -WHEEL_DEAD_ZONE)) { helpers->WriteByte(SteeringAddress, 0x7F, false); } @@ -191,7 +191,7 @@ void InitialDInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value - ACCL_DEAD_ZONE; helpers->WriteByte(BrakeAddress, ((e.jaxis.value + ACCL_DEAD_ZONE) / 128), false); } - else if ((e.jaxis.value < ACCL_DEAD_ZONE) & (e.jaxis.value > -ACCL_DEAD_ZONE)) + else if ((e.jaxis.value < ACCL_DEAD_ZONE) && (e.jaxis.value > -ACCL_DEAD_ZONE)) { helpers->WriteByte(AcclAddress, 0x00, false); helpers->WriteByte(BrakeAddress, 0x00, false); @@ -244,7 +244,7 @@ void InitialDInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value + ACCL_DEAD_ZONE; helpers->WriteByte(BrakeAddress, ((-e.jaxis.value + ACCL_DEAD_ZONE) / 128), false); } - else if ((e.jaxis.value < ACCL_DEAD_ZONE) & (e.jaxis.value > -ACCL_DEAD_ZONE)) + else if ((e.jaxis.value < ACCL_DEAD_ZONE) && (e.jaxis.value > -ACCL_DEAD_ZONE)) { helpers->WriteByte(AcclAddress, 0xFF, false); helpers->WriteByte(BrakeAddress, 0xFF, false); diff --git a/Game Files/DemulMaximumSpeedInputs.cpp b/Game Files/DemulMaximumSpeedInputs.cpp index ee7b011..ce2f5e6 100644 --- a/Game Files/DemulMaximumSpeedInputs.cpp +++ b/Game Files/DemulMaximumSpeedInputs.cpp @@ -135,7 +135,7 @@ void MaximumSpeedInputsEnabled(Helpers* helpers) while (SDL_WaitEvent(&e) != 0) { - if ((e.type == SDL_JOYAXISMOTION) & (ShowAxisForSetup == 0)) + if ((e.type == SDL_JOYAXISMOTION) && (ShowAxisForSetup == 0)) { if (e.jaxis.which == joystick_index1) { @@ -153,7 +153,7 @@ void MaximumSpeedInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value + WHEEL_DEAD_ZONE; helpers->WriteByte(SteeringAddress, (127 + (e.jaxis.value - WHEEL_DEAD_ZONE) / 255), false); } - else if ((e.jaxis.value < WHEEL_DEAD_ZONE) & (e.jaxis.value > -WHEEL_DEAD_ZONE)) + else if ((e.jaxis.value < WHEEL_DEAD_ZONE) && (e.jaxis.value > -WHEEL_DEAD_ZONE)) { helpers->WriteByte(SteeringAddress, 0x7F, false); } @@ -174,7 +174,7 @@ void MaximumSpeedInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value - ACCL_DEAD_ZONE; helpers->WriteByte(BrakeAddress, ((e.jaxis.value + ACCL_DEAD_ZONE) / 128), false); } - else if ((e.jaxis.value < ACCL_DEAD_ZONE) & (e.jaxis.value > -ACCL_DEAD_ZONE)) + else if ((e.jaxis.value < ACCL_DEAD_ZONE) && (e.jaxis.value > -ACCL_DEAD_ZONE)) { helpers->WriteByte(AcclAddress, 0x00, false); helpers->WriteByte(BrakeAddress, 0x00, false); @@ -227,7 +227,7 @@ void MaximumSpeedInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value + ACCL_DEAD_ZONE; helpers->WriteByte(BrakeAddress, ((-e.jaxis.value + ACCL_DEAD_ZONE) / 128), false); } - else if ((e.jaxis.value < ACCL_DEAD_ZONE) & (e.jaxis.value > -ACCL_DEAD_ZONE)) + else if ((e.jaxis.value < ACCL_DEAD_ZONE) && (e.jaxis.value > -ACCL_DEAD_ZONE)) { helpers->WriteByte(AcclAddress, 0xFF, false); helpers->WriteByte(BrakeAddress, 0xFF, false); diff --git a/Game Files/DemulNascarInputs.cpp b/Game Files/DemulNascarInputs.cpp index 0e977ac..ac6753d 100644 --- a/Game Files/DemulNascarInputs.cpp +++ b/Game Files/DemulNascarInputs.cpp @@ -151,7 +151,7 @@ void NascarInputsEnabled(Helpers* helpers) while (SDL_WaitEvent(&e) != 0) { UINT8 shiftupdownreadA = helpers->ReadByte(ShiftUpDownAddress, false); - if ((e.type == SDL_JOYAXISMOTION) & (ShowAxisForSetup == 0)) + if ((e.type == SDL_JOYAXISMOTION) && (ShowAxisForSetup == 0)) { if (e.jaxis.which == joystick_index1) { @@ -169,7 +169,7 @@ void NascarInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value + WHEEL_DEAD_ZONE; helpers->WriteByte(SteeringAddress, (127 + (e.jaxis.value - WHEEL_DEAD_ZONE) / 255), false); } - else if ((e.jaxis.value < WHEEL_DEAD_ZONE) & (e.jaxis.value > -WHEEL_DEAD_ZONE)) + else if ((e.jaxis.value < WHEEL_DEAD_ZONE) && (e.jaxis.value > -WHEEL_DEAD_ZONE)) { helpers->WriteByte(SteeringAddress, 0x7F, false); } @@ -190,7 +190,7 @@ void NascarInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value - ACCL_DEAD_ZONE; helpers->WriteByte(BrakeAddress, ((e.jaxis.value + ACCL_DEAD_ZONE) / 128), false); } - else if ((e.jaxis.value < ACCL_DEAD_ZONE) & (e.jaxis.value > -ACCL_DEAD_ZONE)) + else if ((e.jaxis.value < ACCL_DEAD_ZONE) && (e.jaxis.value > -ACCL_DEAD_ZONE)) { helpers->WriteByte(AcclAddress, 0x00, false); helpers->WriteByte(BrakeAddress, 0x00, false); @@ -243,7 +243,7 @@ void NascarInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value + ACCL_DEAD_ZONE; helpers->WriteByte(BrakeAddress, ((-e.jaxis.value + ACCL_DEAD_ZONE) / 128), false); } - else if ((e.jaxis.value < ACCL_DEAD_ZONE) & (e.jaxis.value > -ACCL_DEAD_ZONE)) + else if ((e.jaxis.value < ACCL_DEAD_ZONE) && (e.jaxis.value > -ACCL_DEAD_ZONE)) { helpers->WriteByte(AcclAddress, 0xFF, false); helpers->WriteByte(BrakeAddress, 0xFF, false); diff --git a/Game Files/DemulSmashingDriveInputs.cpp b/Game Files/DemulSmashingDriveInputs.cpp index db5f854..93ec752 100644 --- a/Game Files/DemulSmashingDriveInputs.cpp +++ b/Game Files/DemulSmashingDriveInputs.cpp @@ -138,7 +138,7 @@ void SmashingDriveInputsEnabled(Helpers* helpers) while (SDL_WaitEvent(&e) != 0) { - if ((e.type == SDL_JOYAXISMOTION) & (ShowAxisForSetup == 0)) + if ((e.type == SDL_JOYAXISMOTION) && (ShowAxisForSetup == 0)) { if (e.jaxis.which == joystick_index1) { @@ -156,7 +156,7 @@ void SmashingDriveInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value + WHEEL_DEAD_ZONE; helpers->WriteByte(SteeringAddress, (127 + (e.jaxis.value - WHEEL_DEAD_ZONE) / 255), false); } - else if ((e.jaxis.value < WHEEL_DEAD_ZONE) & (e.jaxis.value > -WHEEL_DEAD_ZONE)) + else if ((e.jaxis.value < WHEEL_DEAD_ZONE) && (e.jaxis.value > -WHEEL_DEAD_ZONE)) { helpers->WriteByte(SteeringAddress, 0x7F, false); } @@ -177,7 +177,7 @@ void SmashingDriveInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value - ACCL_DEAD_ZONE; BrakeValue = ((e.jaxis.value + ACCL_DEAD_ZONE) / 128); } - else if ((e.jaxis.value < ACCL_DEAD_ZONE) & (e.jaxis.value > -ACCL_DEAD_ZONE)) + else if ((e.jaxis.value < ACCL_DEAD_ZONE) && (e.jaxis.value > -ACCL_DEAD_ZONE)) { AcclValue = 0x00; BrakeValue = 0x00; @@ -298,7 +298,7 @@ void SmashingDriveInputsEnabled(Helpers* helpers) e.jaxis.value = e.jaxis.value + ACCL_DEAD_ZONE; BrakeValue = ((-e.jaxis.value + ACCL_DEAD_ZONE) / 128); } - else if ((e.jaxis.value < ACCL_DEAD_ZONE) & (e.jaxis.value > -ACCL_DEAD_ZONE)) + else if ((e.jaxis.value < ACCL_DEAD_ZONE) && (e.jaxis.value > -ACCL_DEAD_ZONE)) { AcclValue = 0xFF; BrakeValue = 0xFF;