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

Daytona USA 2 · handler “Supermodel Arcade Emulator”

Version 1

Release notes

First release

Released
Size
40 KB
Downloads
326
Check
Verified
SHA-256
908a60fe5ef979593d4af45c56527eb96335fa081b832cda4e7e2c50be24dc1b
Download v1 (.nc)All versions

Files 9

PathSize
handler.js53 KB
Supermodel/dayto2pe.nv128 KB
Supermodel/daytona2.nv128 KB
Supermodel/dirtdvls.nv128 KB
Supermodel/harley.nv128 KB
Supermodel/lemans24.nv128 KB
Supermodel/scudplus.nv128 KB
Supermodel/Supermodel.ini3.4 KB
Supermodel/Xinput1_4.dll32 KB

handler.js

Plain text
Hub.Handler.Version = 1; // Released at https://hub.splitscreen.me/ on Fri Jul 02 2021 16:32:15 GMT+0000 (UTC).
Hub.Handler.Id = "9FQjJQcFcPowC7juG";
Hub.Maintainer.Name = "PoundlandBacon";
Hub.Maintainer.Id = "AdiAjSyfZPMvu3a4M";

var answers = ["Daytona USA 2", "Daytona USA 2 Power Edition", "Dirt Devils", "Harley-Davidson and L.A. Riders (Revision B)", "LeMans 24", "Scud Race Plus (Revision A)"];
Game.AddOption("Select a ROM", "", "rom", answers);
var answers6 = ["No", "Yes"];
Game.AddOption("Disable music", "By default music is only enabled for Player 1. Select Yes to completely disable it.", "bgmop", answers6);
var answers2 = ["Last used", "Triggers", "Buttons"];
Game.AddOption("Accelerate and brake mapped to...", "", "accl", answers2);
var answers3 = ["Last used", "Yes", "No"];
Game.AddOption("Enable controller vibration", "", "ff", answers3);
var answers4 = ["Last used", "0", "10", "15", "20", "50", "60", "70", "80", "90", "100"];
Game.AddOption("Deadzone amount", "increase if you get jitter when there is no input. Default is 10.", "dz", answers4);
var answers5 = ["Last used", "0", "25", "50", "75", "100", "125", "150", "175", "200", "225", "250", "275", "300"];
Game.AddOption("Saturation amount", "increase for less sensitive controls, decrease for more. Default is 160.", "sat", answers5);

Game.DirSymlinkExclusions = ["Config", "NVRAM"];
Game.FileSymlinkExclusions = ["Supermodel.ini", "daytona2.nv", "dayto2pe.nv", "scudplus.nv", "harley.nv", "lemans24.nv", "dirtdvls.nv", "srally2x.nv", "launch.bat"];
Game.GameName = "Supermodel Emulator";
Game.Description =
  "Supports Daytona USA 2, Daytona USA 2 Power Edition, Dirt Devils, Harley-Davidson and L.A. Riders (Revision B), LeMans 24 and Scud Race Plus (Revision A). Recommended you use a recent 64 bit version of Supermodel with Netboard support. I used Supermodel_0.3a x64 - https://www.supermodel3.com/ Requires xinput controllers. If you use a keyboard make sure it is added as the last player. Daytona 2, Daytona USA 2 Power Edition and Scud Race Plus support up to 8 players. Due to the use of some workarounds to get 8 player working the controllers may not match the positions selected in the Nucleus UI.";
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.KeepSymLinkOnExit = true;
Game.SymlinkGame = true;
Game.SymlinkFolders = true;
Game.SupportsKeyboard = true;
Game.ExecutableName = "Supermodel.exe";
Game.SteamID = "";
Game.GUID = "supermodel";
Game.MaxPlayers = 8;
Game.MaxPlayersOneMonitor = 8;
Game.BinariesFolder = "";
Game.NeedsSteamEmulation = false;
Game.UseGoldberg = false;
Game.GoldbergExperimental = false;
Game.GoldbergLobbyConnect = false;
Game.Hook.ForceFocusWindowName = "Supermodel - ";
Game.HasDynamicWindowTitle = true;
Game.Hook.DInputEnabled = true;
Game.Hook.DInputForceDisable = true;
Game.Hook.XInputEnabled = false;
Game.Hook.XInputReroute = false;
Game.Hook.CustomDllEnabled = false;
Game.PauseBetweenStarts = 2;
Game.PauseBetweenProcessGrab = 15;
Game.UserProfileConfigPath = "";

Game.Play = function() {
  var rom = Context.Options["rom"];
  if (rom == "Daytona USA 2") {
    var romarg = "daytona2.zip";
  }
  if (rom == "Scud Race Plus (Revision A)") {
    var romarg = "scudp.zip";
  }
  if (rom == "Harley-Davidson and L.A. Riders (Revision B)") {
    var romarg = "harleyb.zip";
  }
  if (rom == "LeMans 24") {
    var romarg = "lemans24.zip";
  }
  if (rom == "Daytona USA 2 Power Edition") {
    var romarg = "dayto2pe.zip";
  }
  if (rom == "Dirt Devils") {
    var romarg = "dirtdvls.zip";
  }
  if (Context.PlayerID > 0) {
    var bgm = "-music-volume=0";
  } else {
    var bgm = "";
  }
  Context.StartArguments = " roms\\" + romarg + " -input-system=xinput " + bgm;

  Game.LauncherTitle = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\supermodel.exe";

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Xinput1_4.dll");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Xinput1_4.dll");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\supermodel.ini")) {
    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\supermodel.ini");
    var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "supermodel.ini");
    System.IO.File.Copy(savePkgOrigin, savePath, true);
  }

  if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv")) {
    if (rom == "Daytona USA 2") {
      var nvram = "daytona2";
      if (Context.PlayerID == 1) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0xf1, 0x47, 0x10, 0xa2, 0x43, 0x01, 0x02, 0x00, 0x04, 0x00, 0xff, 0x02, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x73, 0xdd, 0x10, 0xa2, 0x43, 0x01, 0x03, 0x00, 0x04, 0x00, 0xff, 0x02, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02]
        );
      }
      if (Context.PlayerID == 2) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0xf1, 0x47, 0x10, 0xa2, 0x43, 0x01, 0x02, 0x00, 0x04, 0x00, 0xff, 0x02, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x55, 0x59, 0x10, 0xa2, 0x43, 0x01, 0x04, 0x00, 0x04, 0x00, 0xff, 0x02, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02]
        );
      }
      if (Context.PlayerID == 3) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0xf1, 0x47, 0x10, 0xa2, 0x43, 0x01, 0x02, 0x00, 0x04, 0x00, 0xff, 0x02, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x1a, 0xe0, 0x10, 0xa2, 0x43, 0x01, 0x05, 0x00, 0x04, 0x00, 0xff, 0x02, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02]
        );
      }
      if (Context.PlayerID == 4) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0xf1, 0x47, 0x10, 0xa2, 0x43, 0x01, 0x02, 0x00, 0x04, 0x00, 0xff, 0x02, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x42, 0xa1, 0x10, 0xa2, 0x43, 0x01, 0x06, 0x00, 0x04, 0x00, 0xff, 0x02, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02]
        );
      }
      if (Context.PlayerID == 5) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0xf1, 0x47, 0x10, 0xa2, 0x43, 0x01, 0x02, 0x00, 0x04, 0x00, 0xff, 0x02, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x0d, 0x18, 0x10, 0xa2, 0x43, 0x01, 0x07, 0x00, 0x04, 0x00, 0xff, 0x02, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x05, 0x02]
        );
      }
      if (Context.PlayerID == 6) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0xf1, 0x47, 0x10, 0xa2, 0x43, 0x01, 0x02, 0x00, 0x04, 0x00, 0xff, 0x02, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x87, 0x23, 0x10, 0xa2, 0x43, 0x01, 0x08, 0x00, 0x04, 0x00, 0xff, 0x02, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x06, 0x02]
        );
      }
      if (Context.PlayerID == 7) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0xf1, 0x47, 0x10, 0xa2, 0x43, 0x01, 0x02, 0x00, 0x04, 0x00, 0xff, 0x02, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0xc8, 0x9a, 0x10, 0xa2, 0x43, 0x01, 0x09, 0x00, 0x04, 0x00, 0xff, 0x02, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x07, 0x02]
        );
      }
    }
    if (rom == "Daytona USA 2 Power Edition") {
      var nvram = "dayto2pe";
      if (Context.PlayerID == 1) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0x33, 0x05, 0x10, 0xa2, 0x44, 0x01, 0x02, 0x00, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0xb1, 0x9f, 0x10, 0xa2, 0x44, 0x01, 0x03, 0x00, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02]
        );
      }
      if (Context.PlayerID == 2) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0x33, 0x05, 0x10, 0xa2, 0x44, 0x01, 0x02, 0x00, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x97, 0x1b, 0x10, 0xa2, 0x44, 0x01, 0x04, 0x00, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02]
        );
      }
      if (Context.PlayerID == 3) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0x33, 0x05, 0x10, 0xa2, 0x44, 0x01, 0x02, 0x00, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0xd8, 0xa2, 0x10, 0xa2, 0x44, 0x01, 0x05, 0x00, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02]
        );
      }
      if (Context.PlayerID == 4) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0x33, 0x05, 0x10, 0xa2, 0x44, 0x01, 0x02, 0x00, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x80, 0xe3, 0x10, 0xa2, 0x44, 0x01, 0x06, 0x00, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02]
        );
      }
      if (Context.PlayerID == 5) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0x33, 0x05, 0x10, 0xa2, 0x44, 0x01, 0x02, 0x00, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0xcf, 0x5a, 0x10, 0xa2, 0x44, 0x01, 0x07, 0x00, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x05, 0x02]
        );
      }
      if (Context.PlayerID == 6) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0x33, 0x05, 0x10, 0xa2, 0x44, 0x01, 0x02, 0x00, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x45, 0x61, 0x10, 0xa2, 0x44, 0x01, 0x08, 0x00, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x06, 0x02]
        );
      }
      if (Context.PlayerID == 7) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0x33, 0x05, 0x10, 0xa2, 0x44, 0x01, 0x02, 0x00, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x0a, 0xd8, 0x10, 0xa2, 0x44, 0x01, 0x09, 0x00, 0x04, 0x00, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x07, 0x02]
        );
      }
    }
    if (rom == "Dirt Devils") {
      var nvram = "dirtdvls";
      if (Context.PlayerID == 1) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [
            0x87,
            0x86,
            0x19,
            0xa3,
            0x99,
            0x02,
            0x03,
            0x00,
            0x01,
            0x07,
            0x01,
            0x01,
            0x01,
            0x01,
            0x01,
            0x01,
            0x1a,
            0x00,
            0x00,
            0x02,
            0x00,
            0x0e,
            0x05,
            0x03,
            0x80,
            0x04,
            0x00,
            0x01,
            0x00,
            0x00,
            0x00,
            0x00,
            0xd0,
            0x30,
            0xd0,
            0x30,
            0xd0,
            0x30,
            0x03,
            0x80,
            0x00,
            0x00,
            0x02,
            0x02,
            0x00,
            0x02,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x03,
            0x00,
            0x7f,
            0x00,
            0xe8,
            0xce,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x25,
            0x08,
            0x08,
            0x0c,
            0x00,
            0xcc,
            0x56,
            0x7f,
            0x00,
            0xe8,
            0xce,
            0x06,
            0x00,
            0x68,
            0x85,
            0x2d,
            0x19,
            0x00,
            0x00,
            0x00,
            0x00,
            0x0a,
            0x00,
            0x00,
            0x00,
            0x0a,
            0x00,
            0x0c,
            0x00,
            0x80,
            0x5d,
            0x06,
            0x00,
            0x28,
            0x6c,
            0x00,
            0x00,
            0xe0,
            0x05,
            0x7f,
            0x00,
            0x08,
            0xcf,
            0x06,
            0x00,
            0xa0,
            0x87,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x60
          ],
          [
            0x5e,
            0x7a,
            0x19,
            0xa3,
            0x99,
            0x02,
            0x04,
            0x00,
            0x01,
            0x07,
            0x01,
            0x01,
            0x01,
            0x01,
            0x01,
            0x01,
            0x1a,
            0x00,
            0x01,
            0x02,
            0x00,
            0x0e,
            0x05,
            0x03,
            0x80,
            0x04,
            0x00,
            0x01,
            0x00,
            0x00,
            0x00,
            0x00,
            0xd0,
            0x30,
            0xd0,
            0x30,
            0xd0,
            0x30,
            0x03,
            0x80,
            0x00,
            0x01,
            0x02,
            0x02,
            0x00,
            0x02,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x04,
            0x00,
            0x7f,
            0x00,
            0x68,
            0xce,
            0x27,
            0x00,
            0x00,
            0x00,
            0x27,
            0x25,
            0x00,
            0x00,
            0x00,
            0x00,
            0x08,
            0x00,
            0x7f,
            0x00,
            0x68,
            0xce,
            0x00,
            0x00,
            0x09,
            0x00,
            0x05,
            0x19,
            0xa0,
            0x34,
            0x00,
            0x00,
            0x0a,
            0x00,
            0x00,
            0x00,
            0x0a,
            0x00,
            0x0c,
            0x00,
            0x80,
            0x5d,
            0x06,
            0x00,
            0x28,
            0x6c,
            0x00,
            0x00,
            0xe0,
            0x05,
            0x7f,
            0x00,
            0x88,
            0xce,
            0x06,
            0x00,
            0xa0,
            0x87,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x10
          ]
        );
      }
      if (Context.PlayerID == 2) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [
            0x87,
            0x86,
            0x19,
            0xa3,
            0x99,
            0x02,
            0x03,
            0x00,
            0x01,
            0x07,
            0x01,
            0x01,
            0x01,
            0x01,
            0x01,
            0x01,
            0x1a,
            0x00,
            0x00,
            0x02,
            0x00,
            0x0e,
            0x05,
            0x03,
            0x80,
            0x04,
            0x00,
            0x01,
            0x00,
            0x00,
            0x00,
            0x00,
            0xd0,
            0x30,
            0xd0,
            0x30,
            0xd0,
            0x30,
            0x03,
            0x80,
            0x00,
            0x00,
            0x02,
            0x02,
            0x00,
            0x02,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x03,
            0x00,
            0x7f,
            0x00,
            0xe8,
            0xce,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x25,
            0x08,
            0x08,
            0x0c,
            0x00,
            0xcc,
            0x56,
            0x7f,
            0x00,
            0xe8,
            0xce,
            0x06,
            0x00,
            0x68,
            0x85,
            0x2d,
            0x19,
            0x00,
            0x00,
            0x00,
            0x00,
            0x0a,
            0x00,
            0x00,
            0x00,
            0x0a,
            0x00,
            0x0c,
            0x00,
            0x80,
            0x5d,
            0x06,
            0x00,
            0x28,
            0x6c,
            0x00,
            0x00,
            0xe0,
            0x05,
            0x7f,
            0x00,
            0x08,
            0xcf,
            0x06,
            0x00,
            0xa0,
            0x87,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x60
          ],
          [
            0x03,
            0xe9,
            0x19,
            0xa3,
            0x99,
            0x02,
            0x05,
            0x00,
            0x01,
            0x07,
            0x01,
            0x01,
            0x01,
            0x01,
            0x01,
            0x01,
            0x1a,
            0x00,
            0x01,
            0x02,
            0x00,
            0x0e,
            0x05,
            0x03,
            0x80,
            0x04,
            0x00,
            0x01,
            0x00,
            0x00,
            0x00,
            0x00,
            0xd0,
            0x30,
            0xd0,
            0x30,
            0xd0,
            0x30,
            0x03,
            0x80,
            0x00,
            0x02,
            0x02,
            0x02,
            0x00,
            0x02,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x05,
            0x00,
            0x7f,
            0x00,
            0x68,
            0xce,
            0x27,
            0x00,
            0x00,
            0x00,
            0x27,
            0x25,
            0x00,
            0x00,
            0x00,
            0x00,
            0x08,
            0x00,
            0x7f,
            0x00,
            0x68,
            0xce,
            0x00,
            0x00,
            0x09,
            0x00,
            0x05,
            0x19,
            0xa0,
            0x34,
            0x00,
            0x00,
            0x0a,
            0x00,
            0x00,
            0x00,
            0x0a,
            0x00,
            0x0c,
            0x00,
            0x80,
            0x5d,
            0x06,
            0x00,
            0x28,
            0x6c,
            0x00,
            0x00,
            0xe0,
            0x05,
            0x7f,
            0x00,
            0x88,
            0xce,
            0x06,
            0x00,
            0xa0,
            0x87,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x50
          ]
        );
      }
      if (Context.PlayerID == 3) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [
            0x87,
            0x86,
            0x19,
            0xa3,
            0x99,
            0x02,
            0x03,
            0x00,
            0x01,
            0x07,
            0x01,
            0x01,
            0x01,
            0x01,
            0x01,
            0x01,
            0x1a,
            0x00,
            0x00,
            0x02,
            0x00,
            0x0e,
            0x05,
            0x03,
            0x80,
            0x04,
            0x00,
            0x01,
            0x00,
            0x00,
            0x00,
            0x00,
            0xd0,
            0x30,
            0xd0,
            0x30,
            0xd0,
            0x30,
            0x03,
            0x80,
            0x00,
            0x00,
            0x02,
            0x02,
            0x00,
            0x02,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x03,
            0x00,
            0x7f,
            0x00,
            0xe8,
            0xce,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x25,
            0x08,
            0x08,
            0x0c,
            0x00,
            0xcc,
            0x56,
            0x7f,
            0x00,
            0xe8,
            0xce,
            0x06,
            0x00,
            0x68,
            0x85,
            0x2d,
            0x19,
            0x00,
            0x00,
            0x00,
            0x00,
            0x0a,
            0x00,
            0x00,
            0x00,
            0x0a,
            0x00,
            0x0c,
            0x00,
            0x80,
            0x5d,
            0x06,
            0x00,
            0x28,
            0x6c,
            0x00,
            0x00,
            0xe0,
            0x05,
            0x7f,
            0x00,
            0x08,
            0xcf,
            0x06,
            0x00,
            0xa0,
            0x87,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x60
          ],
          [
            0x84,
            0xeb,
            0x19,
            0xa3,
            0x99,
            0x02,
            0x06,
            0x00,
            0x01,
            0x07,
            0x01,
            0x01,
            0x01,
            0x01,
            0x01,
            0x01,
            0x1a,
            0x00,
            0x01,
            0x02,
            0x00,
            0x0e,
            0x05,
            0x03,
            0x80,
            0x04,
            0x00,
            0x01,
            0x00,
            0x00,
            0x00,
            0x00,
            0xd0,
            0x30,
            0xd0,
            0x30,
            0xd0,
            0x30,
            0x03,
            0x80,
            0x00,
            0x03,
            0x02,
            0x02,
            0x00,
            0x02,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x06,
            0x00,
            0x7f,
            0x00,
            0x68,
            0xce,
            0x27,
            0x00,
            0x00,
            0x00,
            0x27,
            0x25,
            0x00,
            0x00,
            0x00,
            0x00,
            0x08,
            0x00,
            0x7f,
            0x00,
            0x68,
            0xce,
            0x00,
            0x00,
            0x09,
            0x00,
            0x05,
            0x19,
            0xa0,
            0x34,
            0x00,
            0x00,
            0x0a,
            0x00,
            0x00,
            0x00,
            0x0a,
            0x00,
            0x0c,
            0x00,
            0x80,
            0x5d,
            0x06,
            0x00,
            0x28,
            0x6c,
            0x00,
            0x00,
            0xe0,
            0x05,
            0x7f,
            0x00,
            0x88,
            0xce,
            0x06,
            0x00,
            0xa0,
            0x87,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x30
          ]
        );
      }
    }
    if (rom == "Harley-Davidson and L.A. Riders (Revision B)") {
      var nvram = "harley";
      if (Context.PlayerID == 1) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0x83, 0x62, 0x11, 0x0a, 0x54, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00],
          [0x12, 0xb3, 0x11, 0x0a, 0x54, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01]
        );
      }
      if (Context.PlayerID == 2) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0x83, 0x62, 0x11, 0x0a, 0x54, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00],
          [0x95, 0xf5, 0x11, 0x0a, 0x54, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x01]
        );
      }
      if (Context.PlayerID == 3) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0x83, 0x62, 0x11, 0x0a, 0x54, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00],
          [0x45, 0x0d, 0x11, 0x0a, 0x54, 0x00, 0x05, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, 0x01]
        );
      }
    }
    if (rom == "LeMans 24") {
      var nvram = "lemans24";
      if (Context.PlayerID == 1) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [
            0xc9,
            0xb0,
            0x19,
            0xa3,
            0x5f,
            0x01,
            0x03,
            0x00,
            0x01,
            0x05,
            0x02,
            0x01,
            0x01,
            0x02,
            0x01,
            0x01,
            0x1a,
            0x00,
            0x00,
            0x01,
            0xc0,
            0x0c,
            0x05,
            0x00,
            0x70,
            0x00,
            0x00,
            0x01,
            0x00,
            0x00,
            0x00,
            0x00,
            0x03,
            0x04,
            0x03,
            0x07,
            0x00,
            0x01,
            0x06,
            0x01,
            0x01,
            0x00,
            0x01,
            0x04,
            0x00,
            0x04,
            0x01,
            0x00,
            0x09,
            0x0e,
            0x02,
            0x08,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x03,
            0x00,
            0x1f,
            0x00,
            0x98,
            0xde,
            0x10,
            0x00,
            0x1c,
            0x82,
            0x00,
            0x25,
            0x03,
            0x00,
            0x10,
            0x00,
            0x14,
            0x82
          ],
          [
            0x2a,
            0x31,
            0x19,
            0xa3,
            0x5f,
            0x01,
            0x04,
            0x00,
            0x01,
            0x05,
            0x02,
            0x01,
            0x01,
            0x02,
            0x01,
            0x01,
            0x1a,
            0x00,
            0x01,
            0x01,
            0xc0,
            0x0c,
            0x05,
            0x00,
            0x70,
            0x00,
            0x00,
            0x01,
            0x00,
            0x00,
            0x00,
            0x00,
            0x03,
            0x04,
            0x03,
            0x07,
            0x00,
            0x01,
            0x06,
            0x01,
            0x01,
            0x00,
            0x01,
            0x04,
            0x01,
            0x04,
            0x01,
            0x00,
            0x09,
            0x0e,
            0x02,
            0x08,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x04,
            0x00,
            0x1f,
            0x00,
            0x98,
            0xde,
            0x00,
            0x00,
            0x41,
            0x12,
            0x01,
            0x25,
            0x00,
            0x0a,
            0x17,
            0x00,
            0xe4,
            0xa0
          ]
        );
      }
      if (Context.PlayerID == 2) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [
            0xc9,
            0xb0,
            0x19,
            0xa3,
            0x5f,
            0x01,
            0x03,
            0x00,
            0x01,
            0x05,
            0x02,
            0x01,
            0x01,
            0x02,
            0x01,
            0x01,
            0x1a,
            0x00,
            0x00,
            0x01,
            0xc0,
            0x0c,
            0x05,
            0x00,
            0x70,
            0x00,
            0x00,
            0x01,
            0x00,
            0x00,
            0x00,
            0x00,
            0x03,
            0x04,
            0x03,
            0x07,
            0x00,
            0x01,
            0x06,
            0x01,
            0x01,
            0x00,
            0x01,
            0x04,
            0x00,
            0x04,
            0x01,
            0x00,
            0x09,
            0x0e,
            0x02,
            0x08,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x03,
            0x00,
            0x1f,
            0x00,
            0x98,
            0xde,
            0x10,
            0x00,
            0x1c,
            0x82,
            0x00,
            0x25,
            0x03,
            0x00,
            0x10,
            0x00,
            0x14,
            0x82
          ],
          [
            0x39,
            0x25,
            0x19,
            0xa3,
            0x5f,
            0x01,
            0x05,
            0x00,
            0x01,
            0x05,
            0x02,
            0x01,
            0x01,
            0x02,
            0x01,
            0x01,
            0x1a,
            0x00,
            0x01,
            0x01,
            0xc0,
            0x0c,
            0x05,
            0x00,
            0x70,
            0x00,
            0x00,
            0x01,
            0x00,
            0x00,
            0x00,
            0x00,
            0x03,
            0x04,
            0x03,
            0x07,
            0x00,
            0x01,
            0x06,
            0x01,
            0x01,
            0x00,
            0x01,
            0x04,
            0x02,
            0x04,
            0x01,
            0x00,
            0x09,
            0x0e,
            0x02,
            0x08,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x05,
            0x00,
            0x1f,
            0x00,
            0x98,
            0xde,
            0x00,
            0x00,
            0x41,
            0x12,
            0x01,
            0x25,
            0x00,
            0x0a,
            0x17,
            0x00,
            0xe4,
            0xa0
          ]
        );
      }
      if (Context.PlayerID == 3) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [
            0xc9,
            0xb0,
            0x19,
            0xa3,
            0x5f,
            0x01,
            0x03,
            0x00,
            0x01,
            0x05,
            0x02,
            0x01,
            0x01,
            0x02,
            0x01,
            0x01,
            0x1a,
            0x00,
            0x00,
            0x01,
            0xc0,
            0x0c,
            0x05,
            0x00,
            0x70,
            0x00,
            0x00,
            0x01,
            0x00,
            0x00,
            0x00,
            0x00,
            0x03,
            0x04,
            0x03,
            0x07,
            0x00,
            0x01,
            0x06,
            0x01,
            0x01,
            0x00,
            0x01,
            0x04,
            0x00,
            0x04,
            0x01,
            0x00,
            0x09,
            0x0e,
            0x02,
            0x08,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x03,
            0x00,
            0x1f,
            0x00,
            0x98,
            0xde,
            0x10,
            0x00,
            0x1c,
            0x82,
            0x00,
            0x25,
            0x03,
            0x00,
            0x10,
            0x00,
            0x14,
            0x82
          ],
          [
            0x84,
            0x5a,
            0x19,
            0xa3,
            0x5f,
            0x01,
            0x06,
            0x00,
            0x01,
            0x05,
            0x02,
            0x01,
            0x01,
            0x02,
            0x01,
            0x01,
            0x1a,
            0x00,
            0x01,
            0x01,
            0xc0,
            0x0c,
            0x05,
            0x00,
            0x70,
            0x00,
            0x00,
            0x01,
            0x00,
            0x00,
            0x00,
            0x00,
            0x03,
            0x04,
            0x03,
            0x07,
            0x00,
            0x01,
            0x06,
            0x01,
            0x01,
            0x00,
            0x01,
            0x04,
            0x03,
            0x04,
            0x01,
            0x00,
            0x09,
            0x0e,
            0x02,
            0x08,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x00,
            0x06,
            0x00,
            0x1f,
            0x00,
            0x98,
            0xde,
            0x00,
            0x00,
            0x41,
            0x12,
            0x01,
            0x25,
            0x00,
            0x0a,
            0x17,
            0x00,
            0xe4,
            0xa0
          ]
        );
      }
    }
    if (rom == "Scud Race Plus (Revision A)") {
      var nvram = "scudplus";
      if (Context.PlayerID == 1) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0xb3, 0x2e, 0x18, 0xa2, 0x05, 0x01, 0x02, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x31, 0xb4, 0x18, 0xa2, 0x05, 0x01, 0x03, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02]
        );
      }
      if (Context.PlayerID == 2) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0xb3, 0x2e, 0x18, 0xa2, 0x05, 0x01, 0x02, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x17, 0x30, 0x18, 0xa2, 0x05, 0x01, 0x04, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02]
        );
      }
      if (Context.PlayerID == 3) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0xb3, 0x2e, 0x18, 0xa2, 0x05, 0x01, 0x02, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x58, 0x89, 0x18, 0xa2, 0x05, 0x01, 0x05, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02]
        );
      }
      if (Context.PlayerID == 4) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0xb3, 0x2e, 0x18, 0xa2, 0x05, 0x01, 0x02, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x7a, 0x28, 0x18, 0xa2, 0x05, 0x01, 0x0a, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02]
        );
      }
      if (Context.PlayerID == 5) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0xb3, 0x2e, 0x18, 0xa2, 0x05, 0x01, 0x02, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x35, 0x91, 0x18, 0xa2, 0x05, 0x01, 0x0b, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x05, 0x02]
        );
      }
      if (Context.PlayerID == 6) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0xb3, 0x2e, 0x18, 0xa2, 0x05, 0x01, 0x02, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x13, 0x15, 0x18, 0xa2, 0x05, 0x01, 0x0c, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x02]
        );
      }
      if (Context.PlayerID == 7) {
        Context.PatchFile(
          System.IO.Path.Combine(Game.Folder, nvram + ".nv"),
          System.IO.Path.Combine(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv"),
          [0xb3, 0x2e, 0x18, 0xa2, 0x05, 0x01, 0x02, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
          [0x5c, 0xac, 0x18, 0xa2, 0x05, 0x01, 0x0d, 0x00, 0x01, 0x00, 0xff, 0xff, 0x01, 0xff, 0x01, 0x01, 0x1b, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x07, 0x02]
        );
      }
    }
    if (Context.PlayerID == 0) {
      var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\NVRAM\\" + nvram + ".nv");
      var savePkgOrigin = System.IO.Path.Combine(Game.Folder, nvram + ".nv");
      System.IO.File.Copy(savePkgOrigin, savePath, true);
    }
  }

  var playcon = "JOY" + (Context.PlayerID + 1);

  var accl = Context.Options["accl"];
  if (accl != "Last used") {
    if (accl == "Triggers") {
      var gearup = "KEY_Y," + playcon + "_BUTTON1";
      var geardn = "KEY_H," + playcon + "_BUTTON3";
      var acclerator = "KEY_UP," + playcon + "_RZAXIS_POS";
      var brakes = "KEY_DOWN," + playcon + "_ZAXIS_POS";
    }
    if (accl == "Buttons") {
      var acclerator = "KEY_UP," + playcon + "_BUTTON1";
      var brakes = "KEY_DOWN," + playcon + "_BUTTON3";
      var gearup = "KEY_Y," + playcon + "_BUTTON5";
      var geardn = "KEY_H," + playcon + "_BUTTON6";
    }
    var aline = new Nucleus.IniSaveInfo("Global", "InputAccelerator", acclerator);
    var bline = new Nucleus.IniSaveInfo("Global", "InputBrake", brakes);
    var guline = new Nucleus.IniSaveInfo("Global", "InputGearShiftUp", gearup);
    var gdline = new Nucleus.IniSaveInfo("Global", "InputGearShiftDown", geardn);
  }
  if (accl == "Last used") {
    if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\marker" + Context.PlayerID + ".txt")) {
      var gearup = "KEY_Y," + playcon + "_BUTTON1";
      var geardn = "KEY_H," + playcon + "_BUTTON3";
      var acclerator = "KEY_UP," + playcon + "_RZAXIS_POS";
      var brakes = "KEY_DOWN," + playcon + "_ZAXIS_POS";
      var aline = new Nucleus.IniSaveInfo("Global", "InputAccelerator", acclerator);
      var bline = new Nucleus.IniSaveInfo("Global", "InputBrake", brakes);
      var guline = new Nucleus.IniSaveInfo("Global", "InputGearShiftUp", gearup);
      var gdline = new Nucleus.IniSaveInfo("Global", "InputGearShiftDown", geardn);
    } else {
      var aline = new Nucleus.IniSaveInfo("Global", "InputSystem", "xinput");
      var bline = new Nucleus.IniSaveInfo("Global", "InputSystem", "xinput");
      var guline = new Nucleus.IniSaveInfo("Global", "InputSystem", "xinput");
      var gdline = new Nucleus.IniSaveInfo("Global", "InputSystem", "xinput");
    }
  }

  var ff = Context.Options["ff"];
  if (ff != "Last used") {
    if (ff == "Yes") {
      var ffb = 1;
    } else {
      var ffb = 0;
    }
    var ffbline = new Nucleus.IniSaveInfo("Global", "ForceFeedback", ffb);
  }
  if (ff == "Last used") {
    if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\marker" + Context.PlayerID + ".txt")) {
      var ffbline = new Nucleus.IniSaveInfo("Global", "ForceFeedback", "1");
    } else {
      var ffbline = new Nucleus.IniSaveInfo("Global", "InputSystem", "xinput");
    }
  }

  var deadzone = Context.Options["dz"];
  if (deadzone != "Last used") {
    var dzline = new Nucleus.IniSaveInfo("Global", "Input" + playcon + "XDeadZone", deadzone);
  }
  if (deadzone == "Last used") {
    if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\marker" + Context.PlayerID + ".txt")) {
      var dzline = new Nucleus.IniSaveInfo("Global", "Input" + playcon + "XDeadZone", "10");
    } else {
      var dzline = new Nucleus.IniSaveInfo("Global", "InputSystem", "xinput");
    }
  }

  var saturation = Context.Options["sat"];
  if (saturation != "Last used") {
    var satline = new Nucleus.IniSaveInfo("Global", "Input" + playcon + "XSaturation", saturation);
  }
  if (saturation == "Last used") {
    if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\marker" + Context.PlayerID + ".txt")) {
      var satline = new Nucleus.IniSaveInfo("Global", "Input" + playcon + "XSaturation", "160");
    } else {
      var satline = new Nucleus.IniSaveInfo("Global", "InputSystem", "xinput");
    }
  }

  var aspect = 1;
  if (Context.AspectRatioDecimal < 1.5) {
    aspect = 0;
  }

  var bgmop = Context.Options["bgmop"];
  if (bgmop != "Yes") {
    if (Context.PlayerID != 0) {
      var bgmline = new Nucleus.IniSaveInfo("Global", "MusicVolume", "0");
    } else {
      var bgmline = new Nucleus.IniSaveInfo("Global", "MusicVolume", "100");
    }
  } else {
    var bgmline = new Nucleus.IniSaveInfo("Global", "MusicVolume", "0");
  }

  var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\supermodel.ini";
  Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
    bgmline,
    ffbline,
    dzline,
    satline,
    aline,
    bline,
    guline,
    gdline,
    new Nucleus.IniSaveInfo("Global", "Network", "1"),
    new Nucleus.IniSaveInfo("Global", "SimulateNet", "1"),
    new Nucleus.IniSaveInfo("Global", "InputSystem", "xinput"),
    new Nucleus.IniSaveInfo("Global", "XResolution", Context.Width),
    new Nucleus.IniSaveInfo("Global", "YResolution", Context.Height),
    new Nucleus.IniSaveInfo("Global", "WideScreen", aspect),
    new Nucleus.IniSaveInfo("Global", "PortIn", "197" + Context.PlayerID),
    new Nucleus.IniSaveInfo("Global", "PortOut", "197" + (Context.PlayerID + 1)),
    new Nucleus.IniSaveInfo("Global", "InputStart1", "KEY_1," + playcon + "_BUTTON8"),
    new Nucleus.IniSaveInfo("Global", "InputStart2", "KEY_1," + playcon + "_BUTTON8"),
    new Nucleus.IniSaveInfo("Global", "InputCoin1", "KEY_3," + playcon + "_BUTTON7"),
    new Nucleus.IniSaveInfo("Global", "InputCoin2", "KEY_4," + playcon + "_BUTTON7"),
    new Nucleus.IniSaveInfo("Global", "InputServiceA", "KEY_5," + playcon + "_BUTTON7+" + playcon + "_BUTTON1"),
    new Nucleus.IniSaveInfo("Global", "InputTestA", "KEY_6," + playcon + "_BUTTON7+" + playcon + "_BUTTON2"),
    new Nucleus.IniSaveInfo("Global", "InputSteering", "" + playcon + "_XAXIS"),
    new Nucleus.IniSaveInfo("Global", "InputVR1", "KEY_F," + playcon + "_POV1_LEFT"),
    new Nucleus.IniSaveInfo("Global", "InputVR2", "KEY_S," + playcon + "_POV1_RIGHT"),
    new Nucleus.IniSaveInfo("Global", "InputVR3", "KEY_A," + playcon + "_POV1_UP"),
    new Nucleus.IniSaveInfo("Global", "InputVR4", "KEY_D," + playcon + "_POV1_DOWN"),
    new Nucleus.IniSaveInfo("Global", "InputViewChange", "KEY_A," + playcon + "_BUTTON4"),
    new Nucleus.IniSaveInfo("Global", "InputHandBrake", "KEY_S," + playcon + "_BUTTON2"),
    new Nucleus.IniSaveInfo("Global", "InputRearBrake", "KEY_S," + playcon + "_BUTTON2"),
    new Nucleus.IniSaveInfo("Global", "InputMusicSelect", "KEY_D," + playcon + "_BUTTON8")
  ]);

  if (Context.NumberOfPlayers == Context.PlayerID + 1) {
    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\supermodel.ini";
    Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [new Nucleus.IniSaveInfo("Global", "PortOut", "1970")]);
  }

  if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\marker" + Context.PlayerID + ".txt")) {
    var marker = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Config\\marker" + Context.PlayerID + ".txt";
    var lines = ["used to check if it's the first run of the script"];
    Context.WriteTextFile(marker, lines);
  }
};