Skip to content
Beta: this is a preview of the new SplitScreen.Me. Data may be reset before launch.

Super Mario 64 · handler “SuperMarioNet64”

Version 1

Release notes

First Release

Released
Size
554 KB
Downloads
530
Check
Verified
SHA-256
312eae851ab26ee55b9b2e654717c88cf116c4639b1cf652409039d3e9be743f
Download v1 (.nc)All versions

Files 7

PathSize
handler.js12 KB
SuperMarioNet64/dgVoodoo.conf15 KB
SuperMarioNet64/dgVoodooCpl.exe208 KB
SuperMarioNet64/Glide.dll122 KB
SuperMarioNet64/Glide2x.dll122 KB
SuperMarioNet64/Glide3x.dll126 KB
SuperMarioNet64/Project64.cht6.8 KB

handler.js

Plain text
Hub.Handler.Version = 1; // Released at https://hub.splitscreen.me/ on Sun May 10 2020 17:25:52 GMT+0000 (UTC).
Hub.Handler.Id = "rbTfwX2jB3G9MbMtW";
Hub.Maintainer.Name = "Bizzo";
Hub.Maintainer.Id = "HEgozNi3MNvhAmWfi";

var answers = ["Xinput", "DirectInput"]; //adding variables that user can use on the options
Game.AddOption("What type of controller are you using?", "DirectInput users: check the Script Author's Notes.", "PAD", answers); //adding options after the input/screen selector

Game.FileSymlinkCopyInstead = [
  //this files will be copied from the original folder

  "Project64.cfg",
  "NRage.ini"
];
//You can find what the lines do in the Mod-Readme.txt file inside the Nucleus root folder
Game.FileSymlinkExclusions = ["glide3x.dll", "Project64.cht"];
Game.GameName = "Super Mario 64";
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SupportsKeyboard = false;
Game.ExecutableName = "Project64.exe"; //executable of the emulator
Game.ChangeExe = true;
Game.HideTaskbar = true;
Game.SteamID = "";
Game.GUID = "SuperMario64";
Game.MaxPlayers = 16; //this is just a info. It doesn't limit the script to a max of players.
Game.MaxPlayersOneMonitor = 4; //this is just a info. It doesn't limit the script to a max of players on one monitor.
Game.BinariesFolder = "";
Game.NeedsSteamEmulation = false;
Game.UseGoldberg = false;
Game.LauncherTitle = "";
//Game.ForceProcessPick = true; //manual select the process that Nucleus for resize and positioning
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "Project64MM 2.2.0.1"; //name of the window instance. It depends from the emulator used.
Game.HasDynamicWindowTitle = true; //Nucleus know that the window name will change so it will follow the window with the starting text
Game.WindowStyleValues = ["0x40000000"]; //remove the remain boreders from Project64
Game.ExtWindowStyleValues = ["0x00002000"]; //remove the remain boreders from Project64
Game.KillProcessesOnClose = ["Net64+"]; //close the process Net64+ when you close Nucleus
Game.Hook.DInputEnabled = true;
Game.Hook.DInputForceDisable = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false; //set on true if you want to use Xinput as DirectInput controllers. This could make work even more than 4 controllers (XboxOne controllers seems that doesn't works with this feature. Try this http://www.snes9x.com/phpbb3/viewtopic.php?t=27510 , could fix the problem)
Game.Hook.CustomDllEnabled = false;
Game.XInputPlusDll = ["xinput1_4.dll"];
Game.UseDevReorder = false; //set on true if you use DirectInput controllers
Game.FakeFocus = true;
Game.HookFocus = true;
Game.PromptBetweenInstances = true;
Game.KeepSymLinkOnExit = true; //set on true for keep the copied files even after you close the game. This helps if you need to store files like saves or configs for the next session.
Game.PauseBetweenStarts = 40;
Game.PauseBetweenContextAndLaunch = 10;
Game.ResetWindows = true;
Game.Description =
  "Move the client Net64 folder inside the emulator Net64 folder (in the root). The very first time, before run the game through Nucleus, set the emulator like in the Net64+ UI FAQ tab and select N-Rage For PJ64: 2.4.0.4 as Input (controller) plugin. You can choose to enable NoMusic and Widescreen by editing the ROM cheats (already included) of a specific emulator instance (do it when is launched through Nucleus + it will be saved for the next time). DirectInput players must set true Game.UseDevReorder in the SuperMario64.js file and when the game is launched through Nucleus map the controllers in PJ64 only for the first player of each instance (Don't change the controller plugin). Keyboards players, in any case (Xinput or DirectInput), when the game is launched through Nucleus must map the buttons in PJ64 only for the first player of each instance (you must select even the mouse but is not working in game) also you need to press END when all instances are ready. For Xinput players, all is already mapped. For DirectInput+Xinput players you must set true Game.UseDevReorder and Game.Hook.XInputReroute in the SuperMario64.js file (choose DirectInput then).";

Game.SupportsMultipleKeyboardsAndMice = true;

Game.HookSetCursorPos = true;
Game.HookGetCursorPos = true;
Game.HookGetKeyState = false;
Game.HookGetAsyncKeyState = false;
Game.HookGetKeyboardState = false;
Game.HookFilterRawInput = true;
Game.HookFilterMouseMessages = false;
Game.HookUseLegacyInput = false;
Game.HookDontUpdateLegacyInMouseMsg = false;
Game.HookMouseVisibility = false;

Game.SendNormalMouseInput = true;
Game.SendNormalKeyboardInput = true;
Game.SendScrollWheel = true;
Game.ForwardRawKeyboardInput = false;
Game.ForwardRawMouseInput = false;
Game.HookReRegisterRawInput = true;
Game.HookReRegisterRawInputMouse = true;
Game.HookReRegisterRawInputKeyboard = false;
Game.DrawFakeMouseCursor = true;
Game.LockInputAtStart = false;
Game.LockInputToggleKey = 0x23;

Game.Play = function() {
  //var Args = (Context.Args = "\"" + Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Roms\\Super Mario 64 (U) [!].z64\"") ; //Automatic rom launch? in the example on the left, Nucleus will lunch the rom named "Super Mario 64 (U) [!].z64" _
  //_inside a named folder named "Roms" in the root folder of the emulator exe (this is tested with Project64)
  //Context.StartArguments = Args;

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\dgVoodoo.conf"); //Copying the specific files to the Emulator Nucleus instance content folders from the SuperMario64 scripts Nucleus folder
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "dgVoodoo.conf");
  System.IO.File.Copy(savePkgOrigin, savePath, true);
  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Glide.dll");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Glide.dll");
  System.IO.File.Copy(savePkgOrigin, savePath, true);
  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Glide2x.dll");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Glide2x.dll");
  System.IO.File.Copy(savePkgOrigin, savePath, true);
  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Glide3x.dll");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Glide3x.dll");
  System.IO.File.Copy(savePkgOrigin, savePath, true);
  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\Project64.cht");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Project64.cht");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\dgVoodoo.conf"; //Editing a specific file by manually selecting the line and manually edit the text
  var dict = [
    "121|Resolution                          = h:" + Context.Width + ", v:" + Context.Height + "," //Context.Widht and Height will write the numbers of the resolution choosed by the user in the Nucleus UI screen selector
  ];
  Context.ReplaceLinesInTextFile(txtPath, dict);

  var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\Project64.cfg"; //this edit the Project64 config file for run it in fullscreen
  Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [new Nucleus.IniSaveInfo("default", "Auto Full Screen", "1")]);

  var pad = Context.Options["PAD"]; //this is what happens on the "What type of controller are you using?" option. Basically it just edit ini files depending by the user choice
  if (pad == "Xinput") {
    //if you select Xinput this happens
    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\NRage.ini";
    Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
      new Nucleus.IniSaveInfo("lastBrowserDir", "Profile", Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config"),
      new Nucleus.IniSaveInfo("Controls", "DInputGUID", Context.GamepadGuid),
      new Nucleus.IniSaveInfo("Controller 1", "Plugged", "1"),
      new Nucleus.IniSaveInfo("Controller 1", "xInput", "1"),
      new Nucleus.IniSaveInfo("Controller 2", "Plugged", "0"),
      new Nucleus.IniSaveInfo("Controller 3", "Plugged", "0"),
      new Nucleus.IniSaveInfo("Controller 4", "Plugged", "0")
    ]);
  } //closing the IF
  if (pad == "DirectInput") {
    //if you select DirectInput this happens
    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\NRage.ini";
    Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
      new Nucleus.IniSaveInfo("lastBrowserDir", "Profile", Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config"),
      new Nucleus.IniSaveInfo("Controls", "DInputGUID", Context.GamepadGuid),
      new Nucleus.IniSaveInfo("Controller 1", "Plugged", "1"),
      new Nucleus.IniSaveInfo("Controller 1", "xInput", "0"),
      new Nucleus.IniSaveInfo("Controller 2", "Plugged", "0"),
      new Nucleus.IniSaveInfo("Controller 2", "xInput", "0"),
      new Nucleus.IniSaveInfo("Controller 3", "Plugged", "0"),
      new Nucleus.IniSaveInfo("Controller 3", "xInput", "0"),
      new Nucleus.IniSaveInfo("Controller 4", "Plugged", "0"),
      new Nucleus.IniSaveInfo("Controller 4", "xInput", "0")
    ]);

    if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\XInputPlus.ini")) {
      var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\XInputPlus.ini";
      Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
        new Nucleus.IniSaveInfo("Misc", "UseXInput1_3", "False"),
        new Nucleus.IniSaveInfo("Misc", "UseXInput1_1", "False"),
        new Nucleus.IniSaveInfo("Misc", "UseXInput1_2", "False"),
        new Nucleus.IniSaveInfo("Misc", "UseXInput1_4", "False"),
        new Nucleus.IniSaveInfo("Misc", "UseXInput9_1_0", "False"),
        new Nucleus.IniSaveInfo("X2DInput", "DisableXInput", "True"),
        new Nucleus.IniSaveInfo("X2DInput", "EnableX2Dinput", "True")
      ]);
    }
  } //closing the IF
  if (Player.IsKeyboardPlayer) {
    //This what happens if the player use the keyboard
    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\NRage.ini";
    Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
      new Nucleus.IniSaveInfo("lastBrowserDir", "Profile", Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config"),
      new Nucleus.IniSaveInfo("Controls", "DInputGUID", Context.GamepadGuid),
      new Nucleus.IniSaveInfo("Controller 1", "Plugged", "1"),
      new Nucleus.IniSaveInfo("Controller 1", "xInput", "0"),
      new Nucleus.IniSaveInfo("Controller 2", "Plugged", "0"),
      new Nucleus.IniSaveInfo("Controller 2", "xInput", "0"),
      new Nucleus.IniSaveInfo("Controller 3", "Plugged", "0"),
      new Nucleus.IniSaveInfo("Controller 3", "xInput", "0"),
      new Nucleus.IniSaveInfo("Controller 4", "Plugged", "0"),
      new Nucleus.IniSaveInfo("Controller 4", "xInput", "0")
    ]);

    if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\XInputPlus.ini")) {
      var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\XInputPlus.ini";
      Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
        new Nucleus.IniSaveInfo("Misc", "UseXInput1_3", "False"),
        new Nucleus.IniSaveInfo("Misc", "UseXInput1_1", "False"),
        new Nucleus.IniSaveInfo("Misc", "UseXInput1_2", "False"),
        new Nucleus.IniSaveInfo("Misc", "UseXInput1_4", "False"),
        new Nucleus.IniSaveInfo("Misc", "UseXInput9_1_0", "False"),
        new Nucleus.IniSaveInfo("X2DInput", "DisableXInput", "True"),
        new Nucleus.IniSaveInfo("X2DInput", "EnableX2Dinput", "True")
      ]);
    }
  }

  //launching Net64+ from a folder named "client" in the root folder of the emulator
  Context.RunAdditionalFiles(["all|" + Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\client\\Net64+-win32-x64\\Net64+.exe"], false, 0, true); //true= ask for admin rights
};