2013-07-16 01:59:59 +00:00
|
|
|
|
using BizHawk.DiscSystem;
|
2011-08-03 00:57:01 +00:00
|
|
|
|
using SlimDX.Direct3D9;
|
2011-01-11 02:55:51 +00:00
|
|
|
|
using SlimDX.DirectSound;
|
2013-07-16 01:59:59 +00:00
|
|
|
|
#if WINDOWS
|
2013-04-15 02:14:14 +00:00
|
|
|
|
|
2012-03-12 04:44:34 +00:00
|
|
|
|
#endif
|
2011-01-11 02:55:51 +00:00
|
|
|
|
|
|
|
|
|
namespace BizHawk.MultiClient
|
|
|
|
|
{
|
2011-06-19 23:39:25 +00:00
|
|
|
|
public static class Global
|
|
|
|
|
{
|
|
|
|
|
public static MainForm MainForm;
|
2012-03-12 04:44:34 +00:00
|
|
|
|
#if WINDOWS
|
2011-06-19 23:39:25 +00:00
|
|
|
|
public static DirectSound DSound;
|
|
|
|
|
public static Direct3D Direct3D;
|
2012-03-12 04:44:34 +00:00
|
|
|
|
#endif
|
2011-06-19 23:39:25 +00:00
|
|
|
|
public static Sound Sound;
|
|
|
|
|
public static IRenderer RenderPanel;
|
2012-04-16 08:18:41 +00:00
|
|
|
|
public static OSDManager OSD = new OSDManager();
|
|
|
|
|
public static DisplayManager DisplayManager = new DisplayManager();
|
2011-06-19 23:39:25 +00:00
|
|
|
|
public static Config Config;
|
|
|
|
|
public static IEmulator Emulator;
|
2012-12-10 00:43:43 +00:00
|
|
|
|
public static CoreComm CoreComm;
|
2011-08-04 03:20:54 +00:00
|
|
|
|
public static GameInfo Game;
|
2011-08-06 19:30:21 +00:00
|
|
|
|
public static CheatList CheatList;
|
2013-07-14 05:05:29 +00:00
|
|
|
|
|
2012-12-22 01:56:14 +00:00
|
|
|
|
public static Controller NullControls;
|
2011-08-09 22:13:57 +00:00
|
|
|
|
public static AutofireController AutofireNullControls;
|
2012-12-22 01:56:14 +00:00
|
|
|
|
|
2011-09-04 05:18:38 +00:00
|
|
|
|
/// <summary>
|
2012-10-10 17:19:51 +00:00
|
|
|
|
/// whether throttling is force-disabled by use of fast forward
|
2011-09-04 05:18:38 +00:00
|
|
|
|
/// </summary>
|
2012-10-10 17:19:51 +00:00
|
|
|
|
public static bool ForceNoThrottle;
|
2011-09-04 05:18:38 +00:00
|
|
|
|
|
2011-07-24 23:14:16 +00:00
|
|
|
|
//the movie will be spliced inbetween these if it is present
|
2011-06-27 05:31:46 +00:00
|
|
|
|
public static CopyControllerAdapter MovieInputSourceAdapter = new CopyControllerAdapter();
|
2011-08-21 04:44:40 +00:00
|
|
|
|
public static CopyControllerAdapter MovieOutputHardpoint = new CopyControllerAdapter();
|
2011-06-27 05:31:46 +00:00
|
|
|
|
|
2011-07-24 23:14:16 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// the global MovieSession can use this to deal with multitrack player remapping (should this be here? maybe it should be in MovieSession)
|
|
|
|
|
/// </summary>
|
2011-06-27 05:31:46 +00:00
|
|
|
|
public static MultitrackRewiringControllerAdapter MultitrackRewiringControllerAdapter = new MultitrackRewiringControllerAdapter();
|
|
|
|
|
|
2011-07-24 23:14:16 +00:00
|
|
|
|
public static MovieSession MovieSession = new MovieSession();
|
|
|
|
|
|
2011-07-24 19:52:13 +00:00
|
|
|
|
//dont take my word for it, since the final word is actually in RewireInputChain, but here is a guide...
|
|
|
|
|
//user -> Input -> ActiveController -> UDLR -> StickyXORPlayerInputAdapter -> TurboAdapter(TBD) -> Lua(?TBD?) -> ..
|
2011-07-24 23:14:16 +00:00
|
|
|
|
//.. -> MultitrackRewiringControllerAdapter -> MovieInputSourceAdapter -> (MovieSession) -> MovieOutputAdapter -> ControllerOutput(1) -> Game
|
2011-06-27 05:31:46 +00:00
|
|
|
|
//(1)->Input Display
|
-Finished my simplification of InputAdapters for everything but TI-83 (I don't remember how to test it). Saved 183 lines from the last revision, and this number is probably going to grow tremendously after TI-83 is handled.
-Inadvertently fixed the seemingly broken Genesis 3-Button Controller mnemonics...the controllers weren't responding at all before. I guess refactoring and working with simplified code IS worth it. <_<
--That said, this is still really broken:
---Mnemonics don't show up while recording.
---Input goes past the frame length, and it's never labeled finished.
---Doesn't seem to sync at all.
---This exception:
---------------------------
Oh, no, a terrible thing happened!
System.Exception: unhandled opcode at pc=013648
at BizHawk.Emulation.CPUs.M68000.MC68000.ExecuteCycles(Int32 cycles) in C:\Users\Administrator\Repo\bizhawk\BizHawk.Emulation\CPUs\68000\MC68000.cs:line 147
at BizHawk.Emulation.Consoles.Sega.Genesis.FrameAdvance(Boolean render) in C:\Users\Administrator\Repo\bizhawk\BizHawk.Emulation\Consoles\Sega\Genesis\Genesis.cs:line 106
at BizHawk.MultiClient.MainForm.StepRunLoop_Core() in C:\Users\Administrator\Repo\bizhawk\BizHawk.MultiClient\MainForm.cs:line 1676
at BizHawk.MultiClient.MainForm.ProgramRunLoop() in C:\Users\Administrator\Repo\bizhawk\BizHawk.MultiClient\MainForm.cs:line 346
at BizHawk.MultiClient.Program.Main(String[] args) in C:\Users\Administrator\Repo\bizhawk\BizHawk.MultiClient\Program.cs:line 47
---------------------------
System.Exception: unhandled opcode at pc=013648
at BizHawk.Emulation.CPUs.M68000.MC68000.ExecuteCycles(Int32 cycles) in C:\Users\Administrator\Repo\bizhawk\BizHawk.Emulation\CPUs\68000\MC68000.cs:line 147
at BizHawk.Emulation.Consoles.Sega.Genesis.FrameAdvance(Boolean render) in C:\Users\Administrator\Repo\bizhawk\BizHawk.Emulation\Consoles\Sega\Genesis\Genesis.cs:line 106
at BizHawk.MultiClient.MainForm.StepRunLoop_Core() in C:\Users\Administrator\Repo\bizhawk\BizHawk.MultiClient\MainForm.cs:line 1676
at BizHawk.MultiClient.MainForm.ProgramRunLoop() in C:\Users\Administrator\Repo\bizhawk\BizHawk.MultiClient\MainForm.cs:line 346
at BizHawk.MultiClient.Program.Main(String[] args) in C:\Users\Administrator\Repo\bizhawk\BizHawk.MultiClient\Program.cs:line 47
---------------------------
OK
---------------------------
--I don't think I broke anything...if anything, I fixed it slightly so that input is at least recognized in some way.
--Question: Is Genesis going to be properly supported by release time? If so, I might hold off a Genesis TAS until this is done. I hate Gens.
-Moved BUTTONS, COMMANDS, and new variable PLAYERS, which indicates how many players are for a given system, to Global.cs.
--If there's a better place for this, please let me know.
--That said, if there are places in the code that refer to the mnemonics of button names of a given system, we should definitely apply these variables for easier modification. Please let me know where these places might be.
-Fixed ImportText(). It now only reads as many controllers as the given system supports.
TODO:
-Merge the TI-83 stuff.
-Mnemonic header.
-Comment!
-Fix the TI-83 mnemonics with the IRCs blessings.
-Port the new mnemonics to the wiki.
-Fix the importers.
--I don't think ImportMMV handles the Pause and Reset commands (Or buttons, I don't even know) covert.
2012-02-20 23:25:26 +00:00
|
|
|
|
|
2011-06-27 05:31:46 +00:00
|
|
|
|
//the original source controller, bound to the user, sort of the "input" port for the chain, i think
|
|
|
|
|
public static Controller ActiveController;
|
2011-08-09 00:51:46 +00:00
|
|
|
|
|
|
|
|
|
//rapid fire version on the user controller, has its own key bindings and is OR'ed against ActiveController
|
2011-08-09 22:13:57 +00:00
|
|
|
|
public static AutofireController AutoFireController;
|
-Finished my simplification of InputAdapters for everything but TI-83 (I don't remember how to test it). Saved 183 lines from the last revision, and this number is probably going to grow tremendously after TI-83 is handled.
-Inadvertently fixed the seemingly broken Genesis 3-Button Controller mnemonics...the controllers weren't responding at all before. I guess refactoring and working with simplified code IS worth it. <_<
--That said, this is still really broken:
---Mnemonics don't show up while recording.
---Input goes past the frame length, and it's never labeled finished.
---Doesn't seem to sync at all.
---This exception:
---------------------------
Oh, no, a terrible thing happened!
System.Exception: unhandled opcode at pc=013648
at BizHawk.Emulation.CPUs.M68000.MC68000.ExecuteCycles(Int32 cycles) in C:\Users\Administrator\Repo\bizhawk\BizHawk.Emulation\CPUs\68000\MC68000.cs:line 147
at BizHawk.Emulation.Consoles.Sega.Genesis.FrameAdvance(Boolean render) in C:\Users\Administrator\Repo\bizhawk\BizHawk.Emulation\Consoles\Sega\Genesis\Genesis.cs:line 106
at BizHawk.MultiClient.MainForm.StepRunLoop_Core() in C:\Users\Administrator\Repo\bizhawk\BizHawk.MultiClient\MainForm.cs:line 1676
at BizHawk.MultiClient.MainForm.ProgramRunLoop() in C:\Users\Administrator\Repo\bizhawk\BizHawk.MultiClient\MainForm.cs:line 346
at BizHawk.MultiClient.Program.Main(String[] args) in C:\Users\Administrator\Repo\bizhawk\BizHawk.MultiClient\Program.cs:line 47
---------------------------
System.Exception: unhandled opcode at pc=013648
at BizHawk.Emulation.CPUs.M68000.MC68000.ExecuteCycles(Int32 cycles) in C:\Users\Administrator\Repo\bizhawk\BizHawk.Emulation\CPUs\68000\MC68000.cs:line 147
at BizHawk.Emulation.Consoles.Sega.Genesis.FrameAdvance(Boolean render) in C:\Users\Administrator\Repo\bizhawk\BizHawk.Emulation\Consoles\Sega\Genesis\Genesis.cs:line 106
at BizHawk.MultiClient.MainForm.StepRunLoop_Core() in C:\Users\Administrator\Repo\bizhawk\BizHawk.MultiClient\MainForm.cs:line 1676
at BizHawk.MultiClient.MainForm.ProgramRunLoop() in C:\Users\Administrator\Repo\bizhawk\BizHawk.MultiClient\MainForm.cs:line 346
at BizHawk.MultiClient.Program.Main(String[] args) in C:\Users\Administrator\Repo\bizhawk\BizHawk.MultiClient\Program.cs:line 47
---------------------------
OK
---------------------------
--I don't think I broke anything...if anything, I fixed it slightly so that input is at least recognized in some way.
--Question: Is Genesis going to be properly supported by release time? If so, I might hold off a Genesis TAS until this is done. I hate Gens.
-Moved BUTTONS, COMMANDS, and new variable PLAYERS, which indicates how many players are for a given system, to Global.cs.
--If there's a better place for this, please let me know.
--That said, if there are places in the code that refer to the mnemonics of button names of a given system, we should definitely apply these variables for easier modification. Please let me know where these places might be.
-Fixed ImportText(). It now only reads as many controllers as the given system supports.
TODO:
-Merge the TI-83 stuff.
-Mnemonic header.
-Comment!
-Fix the TI-83 mnemonics with the IRCs blessings.
-Port the new mnemonics to the wiki.
-Fix the importers.
--I don't think ImportMMV handles the Pause and Reset commands (Or buttons, I don't even know) covert.
2012-02-20 23:25:26 +00:00
|
|
|
|
|
|
|
|
|
//the "output" port for the controller chain.
|
2011-07-24 23:14:16 +00:00
|
|
|
|
public static CopyControllerAdapter ControllerOutput = new CopyControllerAdapter();
|
2011-06-27 05:31:46 +00:00
|
|
|
|
|
2011-07-10 07:39:40 +00:00
|
|
|
|
//input state which has been destined for game controller inputs are coalesced here
|
2012-12-09 01:42:47 +00:00
|
|
|
|
public static ControllerInputCoalescer ControllerInputCoalescer = new ControllerInputCoalescer();
|
2011-07-10 07:39:40 +00:00
|
|
|
|
//input state which has been destined for client hotkey consumption are colesced here
|
|
|
|
|
public static InputCoalescer HotkeyCoalescer = new InputCoalescer();
|
|
|
|
|
|
2011-07-10 06:24:04 +00:00
|
|
|
|
public static UD_LR_ControllerAdapter UD_LR_ControllerAdapter = new UD_LR_ControllerAdapter();
|
2011-07-10 02:14:58 +00:00
|
|
|
|
|
2011-07-24 19:52:13 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// provides an opportunity to mutate the player's input in an autohold style
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static StickyXORAdapter StickyXORAdapter = new StickyXORAdapter();
|
|
|
|
|
|
2012-09-15 13:11:29 +00:00
|
|
|
|
public static AutoFireStickyXORAdapter AutofireStickyXORAdapter = new AutoFireStickyXORAdapter();
|
|
|
|
|
|
2013-03-23 20:34:25 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Forces any controller button to Off, useful for things like Joypad.Set
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static ForceOffAdaptor ForceOffAdaptor = new ForceOffAdaptor();
|
|
|
|
|
|
2011-08-09 00:51:46 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// will OR together two IControllers
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static ORAdapter OrControllerAdapter = new ORAdapter();
|
|
|
|
|
|
2011-07-24 20:37:10 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// fire off one-frame logical button clicks here. useful for things like ti-83 virtual pad and reset buttons
|
|
|
|
|
/// </summary>
|
2011-07-24 20:23:27 +00:00
|
|
|
|
public static ClickyVirtualPadController ClickyVirtualPadController = new ClickyVirtualPadController();
|
|
|
|
|
|
2011-07-24 23:14:16 +00:00
|
|
|
|
public static SimpleController MovieOutputController = new SimpleController();
|
|
|
|
|
|
2011-07-10 07:39:40 +00:00
|
|
|
|
public static Controller ClientControls;
|
|
|
|
|
|
2011-06-27 05:31:46 +00:00
|
|
|
|
public static string GetOutputControllersAsMnemonic()
|
|
|
|
|
{
|
|
|
|
|
MnemonicsGenerator mg = new MnemonicsGenerator();
|
2013-04-15 02:14:14 +00:00
|
|
|
|
mg.SetSource(ControllerOutput);
|
2011-06-27 05:31:46 +00:00
|
|
|
|
return mg.GetControllersAsMnemonic();
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-03 00:57:01 +00:00
|
|
|
|
public static DiscHopper DiscHopper = new DiscHopper();
|
2011-06-19 23:39:25 +00:00
|
|
|
|
}
|
2012-03-12 04:44:34 +00:00
|
|
|
|
}
|