diff --git a/Assets/Plugins/Essgee/Emulation/Machines/GameBoyColor.cs b/Assets/Plugins/Essgee/Emulation/Machines/GameBoyColor.cs index d492444..1ba1308 100644 --- a/Assets/Plugins/Essgee/Emulation/Machines/GameBoyColor.cs +++ b/Assets/Plugins/Essgee/Emulation/Machines/GameBoyColor.cs @@ -161,7 +161,7 @@ namespace Essgee.Emulation.Machines int currentMasterClockCyclesInFrame, totalMasterClockCyclesInFrame; - Configuration.GameBoyColor configuration; + public Configuration.GameBoyColor configuration; public GameBoyColor() { } diff --git a/Assets/Plugins/Essgee/Emulation/Machines/GameGear.cs b/Assets/Plugins/Essgee/Emulation/Machines/GameGear.cs index 2da9e4b..6b70ad5 100644 --- a/Assets/Plugins/Essgee/Emulation/Machines/GameGear.cs +++ b/Assets/Plugins/Essgee/Emulation/Machines/GameGear.cs @@ -122,7 +122,7 @@ namespace Essgee.Emulation.Machines int currentMasterClockCyclesInFrame, totalMasterClockCyclesInFrame; - Configuration.GameGear configuration; + public Configuration.GameGear configuration; public GameGear() { } diff --git a/Assets/Plugins/Essgee/Emulation/Machines/SC3000.cs b/Assets/Plugins/Essgee/Emulation/Machines/SC3000.cs index cbec38c..82ff3f6 100644 --- a/Assets/Plugins/Essgee/Emulation/Machines/SC3000.cs +++ b/Assets/Plugins/Essgee/Emulation/Machines/SC3000.cs @@ -128,7 +128,7 @@ namespace Essgee.Emulation.Machines int currentMasterClockCyclesInFrame, totalMasterClockCyclesInFrame; - Configuration.SC3000 configuration; + public Configuration.SC3000 configuration; public SC3000() { } diff --git a/Assets/Plugins/Essgee/Emulation/Machines/SG1000.cs b/Assets/Plugins/Essgee/Emulation/Machines/SG1000.cs index 0303fe2..00adea9 100644 --- a/Assets/Plugins/Essgee/Emulation/Machines/SG1000.cs +++ b/Assets/Plugins/Essgee/Emulation/Machines/SG1000.cs @@ -116,7 +116,7 @@ namespace Essgee.Emulation.Machines int currentMasterClockCyclesInFrame, totalMasterClockCyclesInFrame; - Configuration.SG1000 configuration; + public Configuration.SG1000 configuration; public SG1000() { } diff --git a/Assets/Scripts/Essgeeinit.cs b/Assets/Scripts/Essgeeinit.cs index 731dfd3..51373e5 100644 --- a/Assets/Scripts/Essgeeinit.cs +++ b/Assets/Scripts/Essgeeinit.cs @@ -39,8 +39,8 @@ public class Essgeeinit : MonoBehaviour { instance = this; InitAll(Application.streamingAssetsPath, Application.persistentDataPath); - //LoadAndRunCartridge("G:/Ninja_Gaiden_(UE)_type_A_[!].sms"); - LoadAndRunCartridge("G:/SML2.gb"); + LoadAndRunCartridge("G:/Ninja_Gaiden_(UE)_type_A_[!].sms"); + //LoadAndRunCartridge("G:/SML2.gb"); } void OnDisable() @@ -189,7 +189,12 @@ public class Essgeeinit : MonoBehaviour } List machineType = new List(); machineType.Add(typeof(GameBoy)); + machineType.Add(typeof(GameBoyColor)); + machineType.Add(typeof(ColecoVision)); + machineType.Add(typeof(GameGear)); machineType.Add(typeof(MasterSystem)); + machineType.Add(typeof(SC3000)); + machineType.Add(typeof(SG1000)); //foreach (var machineConfigType in Assembly.GetExecutingAssembly().GetTypes().Where(x => typeof(IConfiguration).IsAssignableFrom(x) && !x.IsInterface && !x.IsAbstract)) foreach (var machineConfigType in machineType) diff --git a/Assets/Scripts/UniInterface/KeyCodeCore.cs b/Assets/Scripts/UniInterface/KeyCodeCore.cs index ce69cdf..814fc73 100644 --- a/Assets/Scripts/UniInterface/KeyCodeCore.cs +++ b/Assets/Scripts/UniInterface/KeyCodeCore.cs @@ -92,7 +92,6 @@ public class KeyCodeCore //} dictKeyCfgs.Clear(); //dictKeyCfgs.Add(KeyCode.P, MotionKey.EMU_PAUSED); - if (Machine is Essgee.Emulation.Machines.MasterSystem) { var machine = (Essgee.Emulation.Machines.MasterSystem)Machine; @@ -124,7 +123,112 @@ public class KeyCodeCore dictKeyCfgs.Add(KeyCode.Return, machine.configuration.ControlsStart); dictKeyCfgs.Add(KeyCode.RightShift, machine.configuration.ControlsSelect); } + else if (Machine is Essgee.Emulation.Machines.GameBoyColor) + { + var machine = (Essgee.Emulation.Machines.GameBoyColor)Machine; + dictKeyCfgs.Add(KeyCode.W, machine.configuration.ControlsUp); + dictKeyCfgs.Add(KeyCode.S, machine.configuration.ControlsDown); + dictKeyCfgs.Add(KeyCode.A, machine.configuration.ControlsLeft); + dictKeyCfgs.Add(KeyCode.D, machine.configuration.ControlsRight); + dictKeyCfgs.Add(KeyCode.J, machine.configuration.ControlsB); + dictKeyCfgs.Add(KeyCode.K, machine.configuration.ControlsA); + + dictKeyCfgs.Add(KeyCode.Return, machine.configuration.ControlsStart); + dictKeyCfgs.Add(KeyCode.RightShift, machine.configuration.ControlsSelect); + dictKeyCfgs.Add(KeyCode.Space, machine.configuration.ControlsSendIR); + } + else if (Machine is Essgee.Emulation.Machines.GameGear) + { + var machine = (Essgee.Emulation.Machines.GameGear)Machine; + dictKeyCfgs.Add(KeyCode.W, machine.configuration.ControlsUp); + dictKeyCfgs.Add(KeyCode.S, machine.configuration.ControlsDown); + dictKeyCfgs.Add(KeyCode.A, machine.configuration.ControlsLeft); + dictKeyCfgs.Add(KeyCode.D, machine.configuration.ControlsRight); + dictKeyCfgs.Add(KeyCode.J, machine.configuration.ControlsButton2); + dictKeyCfgs.Add(KeyCode.K, machine.configuration.ControlsButton1); + dictKeyCfgs.Add(KeyCode.Return, machine.configuration.ControlsStart); + } + else if (Machine is Essgee.Emulation.Machines.SC3000) + { + var machine = (Essgee.Emulation.Machines.SC3000)Machine; + + /* + * InputReset = MotionKey.F12; + InputChangeMode = MotionKey.F1; + InputPlayTape = MotionKey.F2; + + Joypad1Up = MotionKey.Up; + Joypad1Down = MotionKey.Down; + Joypad1Left = MotionKey.Left; + Joypad1Right = MotionKey.Right; + Joypad1Button1 = MotionKey.A; + Joypad1Button2 = MotionKey.S; + + Joypad2Up = MotionKey.NumPad8; + Joypad2Down = MotionKey.NumPad2; + Joypad2Left = MotionKey.NumPad4; + Joypad2Right = MotionKey.NumPad6; + Joypad2Button1 = MotionKey.NumPad1; + Joypad2Button2 = MotionKey.NumPad3; + */ + + dictKeyCfgs.Add(KeyCode.F12, machine.configuration.InputReset); + dictKeyCfgs.Add(KeyCode.F1, machine.configuration.InputChangeMode); + dictKeyCfgs.Add(KeyCode.F2, machine.configuration.InputPlayTape); + + dictKeyCfgs.Add(KeyCode.W, machine.configuration.Joypad1Up); + dictKeyCfgs.Add(KeyCode.S, machine.configuration.Joypad1Down); + dictKeyCfgs.Add(KeyCode.A, machine.configuration.Joypad1Left); + dictKeyCfgs.Add(KeyCode.D, machine.configuration.Joypad1Right); + dictKeyCfgs.Add(KeyCode.J, machine.configuration.Joypad1Button2); + dictKeyCfgs.Add(KeyCode.K, machine.configuration.Joypad1Button1); + + dictKeyCfgs.Add(KeyCode.UpArrow, machine.configuration.Joypad2Up); + dictKeyCfgs.Add(KeyCode.DownArrow, machine.configuration.Joypad2Down); + dictKeyCfgs.Add(KeyCode.LeftArrow, machine.configuration.Joypad2Left); + dictKeyCfgs.Add(KeyCode.RightAlt, machine.configuration.Joypad2Right); + dictKeyCfgs.Add(KeyCode.Alpha1, machine.configuration.Joypad2Button1); + dictKeyCfgs.Add(KeyCode.Alpha2, machine.configuration.Joypad2Button2); + } + else if (Machine is Essgee.Emulation.Machines.SG1000) + { + var machine = (Essgee.Emulation.Machines.SG1000)Machine; + + /* + TVStandard = TVStandard.NTSC; + + InputPause = MotionKey.Space; + + Joypad1Up = MotionKey.Up; + Joypad1Down = MotionKey.Down; + Joypad1Left = MotionKey.Left; + Joypad1Right = MotionKey.Right; + Joypad1Button1 = MotionKey.A; + Joypad1Button2 = MotionKey.S; + + Joypad2Up = MotionKey.NumPad8; + Joypad2Down = MotionKey.NumPad2; + Joypad2Left = MotionKey.NumPad4; + Joypad2Right = MotionKey.NumPad6; + Joypad2Button1 = MotionKey.NumPad1; + Joypad2Button2 = MotionKey.NumPad3; + */ + + dictKeyCfgs.Add(KeyCode.W, machine.configuration.Joypad1Up); + dictKeyCfgs.Add(KeyCode.S, machine.configuration.Joypad1Down); + dictKeyCfgs.Add(KeyCode.A, machine.configuration.Joypad1Left); + dictKeyCfgs.Add(KeyCode.D, machine.configuration.Joypad1Right); + dictKeyCfgs.Add(KeyCode.J, machine.configuration.Joypad1Button2); + dictKeyCfgs.Add(KeyCode.K, machine.configuration.Joypad1Button1); + + dictKeyCfgs.Add(KeyCode.UpArrow, machine.configuration.Joypad2Up); + dictKeyCfgs.Add(KeyCode.DownArrow, machine.configuration.Joypad2Down); + dictKeyCfgs.Add(KeyCode.LeftArrow, machine.configuration.Joypad2Left); + dictKeyCfgs.Add(KeyCode.RightAlt, machine.configuration.Joypad2Right); + dictKeyCfgs.Add(KeyCode.Alpha1, machine.configuration.Joypad2Button1); + dictKeyCfgs.Add(KeyCode.Alpha2, machine.configuration.Joypad2Button2); + } CheckList = dictKeyCfgs.Keys.ToArray();