-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
105 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using HandheldCompanion.Inputs; | ||
using HandheldCompanion.Managers; | ||
using System.Collections.Generic; | ||
using WindowsInput.Events; | ||
|
||
namespace HandheldCompanion.Devices; | ||
|
||
public class OneXPlayerX1 : IDevice | ||
{ | ||
public OneXPlayerX1() | ||
{ | ||
// device specific settings | ||
ProductIllustration = "device_onexplayer_x1"; | ||
ProductModel = "ONEXPLAYERX1"; | ||
|
||
ECDetails = new ECDetails | ||
{ | ||
AddressStatusCommandPort = 0x4E, | ||
AddressDataPort = 0x4F, | ||
}; | ||
|
||
OEMChords.Add(new DeviceChord("Turbo", | ||
new List<KeyCode> { KeyCode.RControlKey, KeyCode.LWin, KeyCode.LMenu }, | ||
new List<KeyCode> { KeyCode.LMenu, KeyCode.LWin, KeyCode.RControlKey }, | ||
false, ButtonFlags.OEM1 | ||
)); | ||
} | ||
|
||
public override string GetGlyph(ButtonFlags button) | ||
{ | ||
switch (button) | ||
{ | ||
case ButtonFlags.OEM1: | ||
return "\u2211"; | ||
} | ||
|
||
return defaultGlyph; | ||
} | ||
|
||
public override bool Open() | ||
{ | ||
var success = base.Open(); | ||
if (!success) | ||
return false; | ||
|
||
// allow OneX button to pass key inputs | ||
LogManager.LogInformation("Unlocked {0} OEM button", ButtonFlags.OEM1); | ||
|
||
ECRamDirectWrite(0x4EB, ECDetails, 0x40); | ||
|
||
return ECRamReadByte(0x4EB, ECDetails) == 0x40; | ||
} | ||
|
||
public override void Close() | ||
{ | ||
LogManager.LogInformation("Locked {0} OEM button", ButtonFlags.OEM1); | ||
ECRamDirectWrite(0x4EB, ECDetails, 0x00); | ||
base.Close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using HandheldCompanion.Inputs; | ||
using HandheldCompanion.Managers; | ||
using HandheldCompanion.Misc; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Numerics; | ||
using WindowsInput.Events; | ||
using static HandheldCompanion.Utils.DeviceUtils; | ||
|
||
namespace HandheldCompanion.Devices; | ||
|
||
public class OneXPlayerX1AMD : OneXPlayerX1 | ||
{ | ||
public OneXPlayerX1AMD() | ||
{ | ||
// https://www.amd.com/en/products/apu/amd-ryzen-7-8840u | ||
nTDP = new double[] { 15, 15, 28 }; | ||
cTDP = new double[] { 15, 30 }; | ||
GfxClock = new double[] { 100, 2700 }; | ||
CpuClock = 5100; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace HandheldCompanion.Devices; | ||
|
||
public class OneXPlayerX1Intel : OneXPlayerX1 | ||
{ | ||
public OneXPlayerX1Intel() | ||
{ | ||
// https://www.intel.com/content/www/us/en/products/sku/236847/intel-core-ultra-7-processor-155h-24m-cache-up-to-4-80-ghz/specifications.html | ||
// follow some of the values presented in OneXConsole at the moment | ||
nTDP = new double[] { 15, 15, 65 }; | ||
cTDP = new double[] { 15, 65 }; | ||
GfxClock = new double[] { 100, 2250 }; | ||
CpuClock = 4800; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters