Skip to content

Commit

Permalink
more tilt fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjay900 committed Apr 12, 2023
1 parent 5e5a11d commit 9abc8b5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Configuration/Conversions/DigitalToAnalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public DigitalToAnalog(Input child, ConfigViewModel model) : base(model)
{
_trigger = false;
Child = child;
On = -32767;
On = 32767;
Tilt = true;
this.WhenAnyValue(x => x.Child.RawValue).Subscribe(s => RawValue = s > 0 ? On : 0);

Expand Down
1 change: 1 addition & 0 deletions Configuration/Other/EmulationMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public override string GetImagePath(DeviceControllerType type, RhythmType rhythm
var image = Type switch
{
EmulationModeType.XboxOne => "XboxOne",
EmulationModeType.Xbox360 => "Xbox360",
EmulationModeType.Wii => "Wii",
EmulationModeType.Ps3 => "PS3",
EmulationModeType.Ps4Or5 => "PS4",
Expand Down
3 changes: 2 additions & 1 deletion Configuration/Outputs/GuitarAxis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,11 @@ when Model is
Type == GuitarAxisType.Tilt && Input is not DigitalToAnalog:
// PS3 RB expects tilt as a digital bit, so map that here
// On pc, we use a standard axis because that works better in games like clone hero
// Clone hero specifically seems to want tilt to go negative by default
return $@"if (consoleType == PS3 || consoleType == REAL_PS3) {{
{GenerateOutput(mode)} = {GenerateAssignment(mode, false, false, false)} == 0xFF;
}} else {{
report->tilt_pc = {GenerateAssignment(mode, false, false, false)};
report->tilt_pc = 255 - ({GenerateAssignment(mode, false, false, false)});
}}";
// Xbox 360 Pickup Selector is actually on one of the triggers.
case ConfigField.Xbox360
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Serialization/SerializedDigitalToAnalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public SerializedDigitalToAnalog(SerializedInput child, int on, bool trigger, bo
[ProtoMember(1)] private SerializedInput Child { get; }
[ProtoMember(2)] private int On { get; }
[ProtoMember(3)] private bool Trigger { get; }
[ProtoMember(3)] private bool Tilt { get; }
[ProtoMember(4)] private bool Tilt { get; }

public override Input Generate(ConfigViewModel model)
{
Expand Down
1 change: 0 additions & 1 deletion Configuration/Serialization/SerializedInput.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using GuitarConfigurator.NetCore.Configuration.Inputs;
using GuitarConfigurator.NetCore.Configuration.Microcontrollers;
using GuitarConfigurator.NetCore.ViewModels;
using ProtoBuf;

Expand Down

0 comments on commit 9abc8b5

Please sign in to comment.