## Setup

Here we describe how to install and update NIFF Editor.

### N64 Previewer

N64 Previewer must be set up in order to convert NIFF files into display lists and to use the Preview and Quick Preview functions on NINTENDO64. N64 Previewer contains niff2gfx.exe for converting NIFF files into display lists, along with source files for the Previewer and n64 files for Quick Preview.

To install N64 Previewer, please execute the N64 Previewer setup program in one of the following ways:

- Activate Explorer, open the directory containing N64 Previewer and double-click on SETUP.EXE
- Activate the MS-DOS prompt (Windows 95/98) or the command prompt (Windows NT), change the current directory to the directory containing the setup program, then input "setup"
- Select the "Run" command from the Start button to open the Run dialog box. Enter the filename, including the directory path.

Use any of these methods to open the setup program, then follow the instructions in the program to install N64 Previewer.

### Install

To setup NIFF Editor in your computer, execute the setup program as described below:

- First, use one of these methods to execute the setup program SETUP.EXE
  - Activate Explorer, open the directory containing NIFF Editor and double-click on SETUP.EXE
  - Activate the MS-DOS prompt (Windows 95/98) or the command prompt (Windows NT), change the current directory to the directory containing the setup program, then input "setup"
  - Select the "Run" command from the Start button to open the Run dialog box. Enter the filename, including the directory path.
- Using any of these methods will start the NIFF Editor setup program. Prompts will ask for the user name, install directory etc. Follow the messages and install NIFF Editor.

If installation has been completed successfully, then the environment has been prepared to use NIFF Editor, and you can refer to the next section on Starting and Quitting and actually start up NIFF Editor.

### Uninstall

If deleting NIFF Checker, make sure to follow the sequence described below, using "Add/Remove Programs" from the Control Panel.

- Click the Start button and select Control Panel in the Settings command to open the Control Panel.
- Double-click on "Add/Remove Programs" in the Control Panel to display the "Add/Remove Programs Properties" dialog. Click on "NIFF Editor" in the list in the Install/Uninstall tab and then click the Add/Remove button.

Following this procedure will delete NIFF Editor.

### Version Upgrades

To upgrade the version of NIFF Editor, follow the above-described uninstall procedure to delete the existing version of NIFF Editor, then follow the above-described install procedure to install the program again. If you upgrade the version without first deleting the existing version, then NIFF Editor itself will not be upgraded.

### Convert & Preview

When you select "Convert" or "Preview" from the Tools menu, NIFF Editor will output a NIFF file and execute either the MIFFCON.BAT batch file to just convert, or the NIFFPREV.BAT batch file to convert as well as perform make and makemask. In order to run Convert or Preview, the following items must be set up in advance to match the existing user environment.

- Install exeGCC and set the environment to activate exeGCC. Normally, the directory in which exeGCC is installed is specified in the "root" environment variable in the SETUP.BAT contained in exeGCC. For details about installing and setting environment variables, please see the exeGCC manual.

- Change MAKEFILE.WIN in the Previewer directory (C:\NINTENDO\N64KIT\NIFF\N64PREV) to match the environment of the installed exeGCC. Open MAKEFILE.WIN using Notepad or an editor and look at the part at the start of the file specifying the path for exeGCC and Include files.

      N64GCC_PATH = c:\ultra\gcc\mipse
      N64GCC_BIN = $(N64GCC_PATH)\bin
      N64GCC_INC = c:\ultra\usr\include
      CC = $(N64GCC_BIN)\gcc
      AS = $(N64GCC_BIN)\as
      LD = $(N64GCC_BIN)\ld

  Please change this part so that it matches the environment of the installed exeGCC. As long as there are no problems, no other parts need to be changed.

- When a NIFF file is converted into a display list, NIFF Editor calls NIFFCON.BAT and the settings in this batch file are carried out. Open NIFFCON.BAT with Notepad or an editor and you will see the following settings:

      @echo off
      set root=c:\ultra
      set gccdir=%ROOT%\gcc
      path %gccdir%\mipse\bin;%root%\sbin;%path%
      set gccsw=-mips3 -mgp32 -mfp32 -D_LANGUAGE_C -D_ULTRA64 -D__EXTENSIONS__
      set n64align=on
      niff2gfx -header model.h niffconv.nif model.c
      if errorlevel 1 goto error
      goto done
      :error
      pause
      :done
      echo on

  The six lines from the start set the environment for exeGCC. If these lines are already included in the AUTOEXEC.BAT file, please delete them here or REM them out.
  The 7th line calls NIFF2GFX.EXE and converts the NIFF file into a display list. NIFF Editor outputs the currently read NIFF file to a temporary file called NIFFCONV.NIF. Because of this, please do not change the name of the NIFF file sent to NIFF2GFX.EXE. The names of other output files and the options can be freely changed, however. For details about NIFF2GFX.EXE please see the NIFF2GFX user's manual.

- As the last step, set the NIFFPREV.BAT file called from NIFF Editor when a NIFF file is to be previewed. Open NIFFPREV.BAT with Notepad or an editor and you will see the following settings:

      @echo off
      set root=c:\ultra
      set gccdir=%ROOT%\gcc
      path %gccdir%\mipse\bin;%root%\sbin;%path%
      set gccsw=-mips3 -mgp32 -mfp32 -D_LANGUAGE_C -D_ULTRA64 -D__EXTENSIONS__
      set n64align=on
      niff2gfx -header model.h niffprev.nif model.c
      if errorlevel 1 goto error
      make -f makefile.win
      if errorlevel 1 goto error
      makemask nuprev.n64
      if errorlevel 1 goto error
      "C:\Program Files\Intelligent Systems\IS-VIEWER64\PROGRAM\nload" -n -v -s0x200000 "quickprev\clean.bin"
      if errorlevel 1 goto error
      "C:\Program Files\Intelligent Systems\IS-VIEWER64\PROGRAM\nload" -n -v nuprev.n64
      if errorlevel 1 goto error
      goto done
      :error
      pause
      :done
      echo on

  This is nearly the same as the NIFFCONV.BAT used for conversion, except that the NIFF file output by NIFF Editor is different, and there is make and makemask.
  The six lines from the start set the environment for exeGCC. If these lines are already included in the AUTOEXEC.BAT file, please delete them here or REM them out.
  The 7th line calls NIFF2GFX.EXE and converts the NIFF file into a display list. NIFF Editor outputs the currently read NIFF file to a temporary file called NIFFPREV.NIF. Because of this, please do not change the name of the NIFF file sent to NIFF2GFX.EXE. The names of other output files and the options can be freely changed, however. For details about NIFF2GFX.EXE please see the NIFF2GFX user's manual.
  Line 9 performs make, and line 11 performs makemask. These lines normally do not need to be changed.

### Quick Preview

Quick Preview is performed by executing the quickprev.bat file included in the N64 Previewer. Please setup this file following the steps shown below so that the file will execute correctly.

- The default quickprev.bat file is described as follows:

      @echo off
      "C:\Program Files\Intelligent Systems\IS-VIEWER64\PROGRAM\nload" -n -v quickprev.n64
      if errorlevel 1 goto error
      ..\niff2gfx -b quickprev.nif model.bin
      if errorlevel 1 goto error
      "C:\Program Files\Intelligent Systems\IS-VIEWER64\PROGRAM\nload" -n -v -s0x200000 model.bin
      if errorlevel 1 goto error
      goto done
      :error
      pause
      :done
      echo on

  In line 2, nload.exe reads the Previewer's quickprev.n64 file into IS-VIEWER64. In line 4, niff2gfx.exe converts quickprev.nif, which is the temporary file output by NIFF Editor, into a binary file. In line 6, this converted file is read by nload.exe into IS-VIEWER64.

- makemask is not executed in quickprev.bat, because version 1.03p of nload.exe in IS-VIEWER64 incorporates a function to automatically perform makemask with a file is read, and because it is not needed in environments outside of NIFF Editor and N64 Previewer. If you have an earlier version of nload.exe please download the latest version from Intelligent Systems' IS-VIEWER64 Home Page (http://www.intsys.co.jp/tool/isv/).

- You may use an earlier version of nload.exe by adding makemask to the quickprev.bat file.

      set root=c:\ultra
      set gccdir=%ROOT%\gcc
      path %gccdir%\mipse\bin
      makemask quickprev.n64

- As the last step, specify the name of the temporary NIFF file that NIFF Editor will output for quick preview, as well as the path for quickprev.bat. These can be set from the "Quick Preview" tab in Options from the Tools menu.