Installer nocturne-cd
files:
- update: https://github.com/keenanweaver/lutris-files/raw/nocturne/Nocturne_Patch_Win_EN_Patch-2.exe
- iv5setup: https://lutris.nyc3.digitaloceanspaces.com/tools/indeo/iv5setup.exe
- unshield: https://lutris.net/files/tools/unshield-1.3-x86_64.tar.gz
game:
  arch: win32
  exe: drive_c/Program Files/Terminal Reality/Nocturne/nocturne.exe
  prefix: $GAMEDIR
installer:
- insert-disc:
    description: Please mount the Nocturne disc and browse to the directory
    requires: setup.exe
- task:
    arch: win32
    description: Installing Nocturne. Please use default options.
    executable: $DISC/setup.exe
    name: wineexec
    prefix: $GAMEDIR
- task:
    description: Installing Nocturne Patch 2
    executable: update
    name: wineexec
    prefix: $GAMEDIR
- execute:
    command: curl https://api.github.com/repos/dege-diosg/dgVoodoo2/releases/latest
      | grep browser_download_url | grep -vE '(dbg|API)' | cut -d '"' -f 4 | wget
      -i- -P $CACHE
    description: Download latest dgVoodoo2 release
- execute:
    command: find $CACHE -name 'dgVoodoo*' -exec unzip {} -d $CACHE ';'
    description: Extract latest dgVoodoo2 release to $CACHE
- execute:
    command: mv $CACHE/MS/x86/DDraw.dll $CACHE/MS/x86/D3DImm.dll $CACHE/dgVoodooCpl.exe
      $CACHE/dgVoodoo.conf '$GAMEDIR/drive_c/Program Files/Terminal Reality/Nocturne'
    description: Move dgVoodoo2 components to $GAMEDIR
- write_config:
    data:
      DirectX:
        Antialiasing: 8x
        AppControlledScreenMode: false
        DisableAltEnterToToggleScreenMode: false
        Filtering: 16
        Resolution: max_isf
        VRAM: 256
        VideoCard: internal3D
        dgVoodooWatermark: false
      General:
        ScalingMode: stretched_ar
    description: Write dgVoodoo.conf file
    file: $GAMEDIR/drive_c/Program Files/Terminal Reality/Nocturne/dgVoodoo.conf
    merge: false
- execute:
    args: -d $CACHE/tmp/ligos1 iv5setup
    description: Installing Ligos Indeo Codec (cabextract)...
    file: cabextract
- extract:
    description: Installing Ligos Indeo Codec (unshield)...
    dst: $CACHE/tmp/unshield
    file: unshield
- execute:
    args: -d $CACHE/tmp/ligos2 x $CACHE/tmp/ligos1/data1.cab
    description: Installing Ligos Indeo Codec (data1.cab)...
    file: $CACHE/tmp/unshield/unshield
- execute:
    command: find $CACHE/tmp/ligos2 \( -name *.dll -o -name *.ax \) -exec cp {} $GAMEDIR/drive_c/windows/system32
      \;
    description: Installing Ligos Indeo Codec (system32)...
- write_file:
    content: 'REGEDIT4
      [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Drivers32]
      "msacm.iac2"="iac25_32.ax"
      "vidc.iv31"="ir32_32.dll"
      "vidc.iv32"="ir32_32.dll"
      "vidc.iv41"="ir41_32.ax"
      "vidc.iv50"="ir50_32.dll"
      "vidc.yvu9"="iyvu9_32.dll" '
    description: Installing Ligos Indeo Codec (regedit)...
    file: $CACHE/ligos.reg
- task:
    description: Installing Ligos Indeo Codec (set_regedit)...
    filename: $CACHE/ligos.reg
    name: set_regedit_file
    prefix: $GAMEDIR
- write_file:
    content: '; Nocturne settings
      [Graphics]
      currentBoard=0
      quimbyFlag=0
      shadowFlag=1
      foulLanguageFlag=1
      nudityFlag=1
      bloodFlag=1
      subtitleMode=1
      gamePIXX=1280
      gamePIXY=960
      gameBPP=32
      useDirect3D=1
      useAGPFlag=2
      rendererDLLPath=tridx7.dll
      gamma=65536
      heroNumber=2
      haloMode=0
      firstTimeFlag=0
      [Sound]
      MaxSwLatency=0.5
      HwMixingEnabled=0
      SfxChannel2Vol=1
      SfxChannel2Enabled=1
      SfxChannel1Vol=0.25
      SfxChannel1Enabled=1
      SfxChannel0Vol=0.25
      SfxChannel0Enabled=1
      Mute=0
      Hz=22050
      Channels=2
      Bits=16
      DeviceName=DirectSound: Primary Sound Driver
      [Control]
      keyWalk=328
      keyBackup=336
      keyRun=42
      keyRight=333
      keyLeft=331
      keyFire=57
      keyPickup=28
      keyLight=33
      keyDraw=32
      keyPointUp=16
      keyPointDown=30
      keyWeapon1=2
      keyWeapon2=3
      keyWeapon3=4
      keyWeapon4=5
      keyWeapon5=6
      gameControl=0
      xCenter=0
      yCenter=32768
      xStickMin=256
      xStickMax=65280
      yStickMin=256
      yStickMax=65280
      keyStrafe=56
      keyStrafeLeft=44
      keyStrafeRight=45
      keyInventory=15
      invertMouseYAxis=0
      alwaysRun=0
      xMouseSensitivity=65536
      yMouseSensitivity=65536
      aimMode=0
      keyJump=34
      keyUseItem=28
      keyNextWeapon=13
      keyPrevWeapon=12
      keyNextItem=26
      keyPrevItem=27
      keyItemDesc=53
      keyNextAmmo=41
      keyInfrared=23
      autoUseHealth=1
      [Debug]
      logConsoleFlag=0
      headOfHorrorCheat=0 '
    description: Write nocturne.ini
    file: $GAMEDIR/drive_c/Program Files/Terminal Reality/Nocturne/SYSTEM/nocturne.ini
wine:
  overrides:
    ddraw: n,b
      description: ''
game_slug: nocturne
gogslug: ''
humblestoreid: ''
installer_slug: nocturne-cd
name: Nocturne
notes: "Cap framerate to 60\r\n\r\nVery slow menu navigation. A predefine config file\
  \ is included to help mitigate the slowness."
runner: wine
script:
  files:
  - update: https://github.com/keenanweaver/lutris-files/raw/nocturne/Nocturne_Patch_Win_EN_Patch-2.exe
  - iv5setup: https://lutris.nyc3.digitaloceanspaces.com/tools/indeo/iv5setup.exe
  - unshield: https://lutris.net/files/tools/unshield-1.3-x86_64.tar.gz
  game:
    arch: win32
    exe: drive_c/Program Files/Terminal Reality/Nocturne/nocturne.exe
    prefix: $GAMEDIR
  installer:
  - insert-disc:
      description: Please mount the Nocturne disc and browse to the directory
      requires: setup.exe
  - task:
      arch: win32
      description: Installing Nocturne. Please use default options.
      executable: $DISC/setup.exe
      name: wineexec
      prefix: $GAMEDIR
  - task:
      description: Installing Nocturne Patch 2
      executable: update
      name: wineexec
      prefix: $GAMEDIR
  - execute:
      command: curl https://api.github.com/repos/dege-diosg/dgVoodoo2/releases/latest
        | grep browser_download_url | grep -vE '(dbg|API)' | cut -d '"' -f 4 | wget
        -i- -P $CACHE
      description: Download latest dgVoodoo2 release
  - execute:
      command: find $CACHE -name 'dgVoodoo*' -exec unzip {} -d $CACHE ';'
      description: Extract latest dgVoodoo2 release to $CACHE
  - execute:
      command: mv $CACHE/MS/x86/DDraw.dll $CACHE/MS/x86/D3DImm.dll $CACHE/dgVoodooCpl.exe
        $CACHE/dgVoodoo.conf '$GAMEDIR/drive_c/Program Files/Terminal Reality/Nocturne'
      description: Move dgVoodoo2 components to $GAMEDIR
  - write_config:
      data:
        DirectX:
          Antialiasing: 8x
          AppControlledScreenMode: false
          DisableAltEnterToToggleScreenMode: false
          Filtering: 16
          Resolution: max_isf
          VRAM: 256
          VideoCard: internal3D
          dgVoodooWatermark: false
        General:
          ScalingMode: stretched_ar
      description: Write dgVoodoo.conf file
      file: $GAMEDIR/drive_c/Program Files/Terminal Reality/Nocturne/dgVoodoo.conf
      merge: false
  - execute:
      args: -d $CACHE/tmp/ligos1 iv5setup
      description: Installing Ligos Indeo Codec (cabextract)...
      file: cabextract
  - extract:
      description: Installing Ligos Indeo Codec (unshield)...
      dst: $CACHE/tmp/unshield
      file: unshield
  - execute:
      args: -d $CACHE/tmp/ligos2 x $CACHE/tmp/ligos1/data1.cab
      description: Installing Ligos Indeo Codec (data1.cab)...
      file: $CACHE/tmp/unshield/unshield
  - execute:
      command: find $CACHE/tmp/ligos2 \( -name *.dll -o -name *.ax \) -exec cp {}
        $GAMEDIR/drive_c/windows/system32 \;
      description: Installing Ligos Indeo Codec (system32)...
  - write_file:
      content: 'REGEDIT4
        [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Drivers32]
        "msacm.iac2"="iac25_32.ax"
        "vidc.iv31"="ir32_32.dll"
        "vidc.iv32"="ir32_32.dll"
        "vidc.iv41"="ir41_32.ax"
        "vidc.iv50"="ir50_32.dll"
        "vidc.yvu9"="iyvu9_32.dll" '
      description: Installing Ligos Indeo Codec (regedit)...
      file: $CACHE/ligos.reg
  - task:
      description: Installing Ligos Indeo Codec (set_regedit)...
      filename: $CACHE/ligos.reg
      name: set_regedit_file
      prefix: $GAMEDIR
  - write_file:
      content: '; Nocturne settings
        [Graphics]
        currentBoard=0
        quimbyFlag=0
        shadowFlag=1
        foulLanguageFlag=1
        nudityFlag=1
        bloodFlag=1
        subtitleMode=1
        gamePIXX=1280
        gamePIXY=960
        gameBPP=32
        useDirect3D=1
        useAGPFlag=2
        rendererDLLPath=tridx7.dll
        gamma=65536
        heroNumber=2
        haloMode=0
        firstTimeFlag=0
        [Sound]
        MaxSwLatency=0.5
        HwMixingEnabled=0
        SfxChannel2Vol=1
        SfxChannel2Enabled=1
        SfxChannel1Vol=0.25
        SfxChannel1Enabled=1
        SfxChannel0Vol=0.25
        SfxChannel0Enabled=1
        Mute=0
        Hz=22050
        Channels=2
        Bits=16
        DeviceName=DirectSound: Primary Sound Driver
        [Control]
        keyWalk=328
        keyBackup=336
        keyRun=42
        keyRight=333
        keyLeft=331
        keyFire=57
        keyPickup=28
        keyLight=33
        keyDraw=32
        keyPointUp=16
        keyPointDown=30
        keyWeapon1=2
        keyWeapon2=3
        keyWeapon3=4
        keyWeapon4=5
        keyWeapon5=6
        gameControl=0
        xCenter=0
        yCenter=32768
        xStickMin=256
        xStickMax=65280
        yStickMin=256
        yStickMax=65280
        keyStrafe=56
        keyStrafeLeft=44
        keyStrafeRight=45
        keyInventory=15
        invertMouseYAxis=0
        alwaysRun=0
        xMouseSensitivity=65536
        yMouseSensitivity=65536
        aimMode=0
        keyJump=34
        keyUseItem=28
        keyNextWeapon=13
        keyPrevWeapon=12
        keyNextItem=26
        keyPrevItem=27
        keyItemDesc=53
        keyNextAmmo=41
        keyInfrared=23
        autoUseHealth=1
        [Debug]
        logConsoleFlag=0
        headOfHorrorCheat=0 '
      description: Write nocturne.ini
      file: $GAMEDIR/drive_c/Program Files/Terminal Reality/Nocturne/SYSTEM/nocturne.ini
  wine:
    overrides:
      ddraw: n,b
slug: nocturne-cd
steamid: null
version: CD
year: 1999
      {
  "game_slug": "nocturne",
  "version": "CD",
  "description": "",
  "notes": "Cap framerate to 60\r\n\r\nVery slow menu navigation. A predefine config file is included to help mitigate the slowness.",
  "name": "Nocturne",
  "year": 1999,
  "steamid": null,
  "gogslug": "",
  "humblestoreid": "",
  "runner": "wine",
  "slug": "nocturne-cd",
  "installer_slug": "nocturne-cd",
  "script": {
    "files": [
      {
        "update": "https://github.com/keenanweaver/lutris-files/raw/nocturne/Nocturne_Patch_Win_EN_Patch-2.exe"
      },
      {
        "iv5setup": "https://lutris.nyc3.digitaloceanspaces.com/tools/indeo/iv5setup.exe"
      },
      {
        "unshield": "https://lutris.net/files/tools/unshield-1.3-x86_64.tar.gz"
      }
    ],
    "game": {
      "arch": "win32",
      "exe": "drive_c/Program Files/Terminal Reality/Nocturne/nocturne.exe",
      "prefix": "$GAMEDIR"
    },
    "installer": [
      {
        "insert-disc": {
          "description": "Please mount the Nocturne disc and browse to the directory",
          "requires": "setup.exe"
        }
      },
      {
        "task": {
          "arch": "win32",
          "description": "Installing Nocturne. Please use default options.",
          "executable": "$DISC/setup.exe",
          "name": "wineexec",
          "prefix": "$GAMEDIR"
        }
      },
      {
        "task": {
          "description": "Installing Nocturne Patch 2",
          "executable": "update",
          "name": "wineexec",
          "prefix": "$GAMEDIR"
        }
      },
      {
        "execute": {
          "command": "curl https://api.github.com/repos/dege-diosg/dgVoodoo2/releases/latest | grep browser_download_url | grep -vE '(dbg|API)' | cut -d '\"' -f 4 | wget -i- -P $CACHE",
          "description": "Download latest dgVoodoo2 release"
        }
      },
      {
        "execute": {
          "command": "find $CACHE -name 'dgVoodoo*' -exec unzip {} -d $CACHE ';'",
          "description": "Extract latest dgVoodoo2 release to $CACHE"
        }
      },
      {
        "execute": {
          "command": "mv $CACHE/MS/x86/DDraw.dll $CACHE/MS/x86/D3DImm.dll $CACHE/dgVoodooCpl.exe $CACHE/dgVoodoo.conf '$GAMEDIR/drive_c/Program Files/Terminal Reality/Nocturne'",
          "description": "Move dgVoodoo2 components to $GAMEDIR"
        }
      },
      {
        "write_config": {
          "data": {
            "DirectX": {
              "Antialiasing": "8x",
              "AppControlledScreenMode": false,
              "DisableAltEnterToToggleScreenMode": false,
              "Filtering": 16,
              "Resolution": "max_isf",
              "VRAM": 256,
              "VideoCard": "internal3D",
              "dgVoodooWatermark": false
            },
            "General": {
              "ScalingMode": "stretched_ar"
            }
          },
          "description": "Write dgVoodoo.conf file",
          "file": "$GAMEDIR/drive_c/Program Files/Terminal Reality/Nocturne/dgVoodoo.conf",
          "merge": false
        }
      },
      {
        "execute": {
          "args": "-d $CACHE/tmp/ligos1 iv5setup",
          "description": "Installing Ligos Indeo Codec (cabextract)...",
          "file": "cabextract"
        }
      },
      {
        "extract": {
          "description": "Installing Ligos Indeo Codec (unshield)...",
          "dst": "$CACHE/tmp/unshield",
          "file": "unshield"
        }
      },
      {
        "execute": {
          "args": "-d $CACHE/tmp/ligos2 x $CACHE/tmp/ligos1/data1.cab",
          "description": "Installing Ligos Indeo Codec (data1.cab)...",
          "file": "$CACHE/tmp/unshield/unshield"
        }
      },
      {
        "execute": {
          "command": "find $CACHE/tmp/ligos2 \\( -name *.dll -o -name *.ax \\) -exec cp {} $GAMEDIR/drive_c/windows/system32 \\;",
          "description": "Installing Ligos Indeo Codec (system32)..."
        }
      },
      {
        "write_file": {
          "content": "REGEDIT4\n[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32]\n\"msacm.iac2\"=\"iac25_32.ax\"\n\"vidc.iv31\"=\"ir32_32.dll\"\n\"vidc.iv32\"=\"ir32_32.dll\"\n\"vidc.iv41\"=\"ir41_32.ax\"\n\"vidc.iv50\"=\"ir50_32.dll\"\n\"vidc.yvu9\"=\"iyvu9_32.dll\" ",
          "description": "Installing Ligos Indeo Codec (regedit)...",
          "file": "$CACHE/ligos.reg"
        }
      },
      {
        "task": {
          "description": "Installing Ligos Indeo Codec (set_regedit)...",
          "filename": "$CACHE/ligos.reg",
          "name": "set_regedit_file",
          "prefix": "$GAMEDIR"
        }
      },
      {
        "write_file": {
          "content": "; Nocturne settings\n[Graphics]\ncurrentBoard=0\nquimbyFlag=0\nshadowFlag=1\nfoulLanguageFlag=1\nnudityFlag=1\nbloodFlag=1\nsubtitleMode=1\ngamePIXX=1280\ngamePIXY=960\ngameBPP=32\nuseDirect3D=1\nuseAGPFlag=2\nrendererDLLPath=tridx7.dll\ngamma=65536\nheroNumber=2\nhaloMode=0\nfirstTimeFlag=0\n[Sound]\nMaxSwLatency=0.5\nHwMixingEnabled=0\nSfxChannel2Vol=1\nSfxChannel2Enabled=1\nSfxChannel1Vol=0.25\nSfxChannel1Enabled=1\nSfxChannel0Vol=0.25\nSfxChannel0Enabled=1\nMute=0\nHz=22050\nChannels=2\nBits=16\nDeviceName=DirectSound: Primary Sound Driver\n[Control]\nkeyWalk=328\nkeyBackup=336\nkeyRun=42\nkeyRight=333\nkeyLeft=331\nkeyFire=57\nkeyPickup=28\nkeyLight=33\nkeyDraw=32\nkeyPointUp=16\nkeyPointDown=30\nkeyWeapon1=2\nkeyWeapon2=3\nkeyWeapon3=4\nkeyWeapon4=5\nkeyWeapon5=6\ngameControl=0\nxCenter=0\nyCenter=32768\nxStickMin=256\nxStickMax=65280\nyStickMin=256\nyStickMax=65280\nkeyStrafe=56\nkeyStrafeLeft=44\nkeyStrafeRight=45\nkeyInventory=15\ninvertMouseYAxis=0\nalwaysRun=0\nxMouseSensitivity=65536\nyMouseSensitivity=65536\naimMode=0\nkeyJump=34\nkeyUseItem=28\nkeyNextWeapon=13\nkeyPrevWeapon=12\nkeyNextItem=26\nkeyPrevItem=27\nkeyItemDesc=53\nkeyNextAmmo=41\nkeyInfrared=23\nautoUseHealth=1\n[Debug]\nlogConsoleFlag=0\nheadOfHorrorCheat=0 ",
          "description": "Write nocturne.ini",
          "file": "$GAMEDIR/drive_c/Program Files/Terminal Reality/Nocturne/SYSTEM/nocturne.ini"
        }
      }
    ],
    "wine": {
      "overrides": {
        "ddraw": "n,b"
      }
    }
  }
}
      