N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential

## n64mdisk

Syntax

    n64mdisk [config file]
    n64mdisk -m [master data file name]

Explanation
It creates the game program’s master data. The master data is used by the developer when submitting an N64 Disk Drive game program to Nintendo after debugging. The data follows a certain fixed format. A disk is created from the master data using a batch file called mwrite for final checking of the game. The n64mdisk tool creates this batch file when it is producing the master data.
Note: When presenting the master data, please also provide NCC, the code used for checking the data. Use the calcncc tool to calculate the NCC. The first form of the command (n64mdisk [config file]) creates master data by following the specification in the config file.
The second form of the command (n64mdisk -m [master data file name]) creates the mwrite and mwrite.id files from the master data already created. If the master data file name is left off, the master.d64 file is used.
This form of the command also checks to make sure the master data file specified (or master.d64) is in fact proper master data. If it isn't, the tool displays the following message and terminates:

    ******** This is not master data!! **********

Also, when the extension of the file is not .d64 the following confirmation is requested:

    ** This file name does not end with .d64,
       so it may not be master data OK? (y/n) [y]

If you want to use the specified file, input "y" or "Y" or press the Enter key. If you press any other key, the tool terminates without doing anything.
More Information
When you enter the following command line, the file n64mdisk.cfg (the default config file) is read and its contents used to create the master data file.

    % n64mdisk        [for Partner-N64NW]
    C> n64mdisk       [for Partner-N64PC]

Three files are produced at the time the master data is created:

- master.64 The master data file.
- mwrite The batch file that writes the master data to a disk. A disk for final checking can be created by entering <mwrite in the Partner command window. The less than symbol is the Partner command for executing a batch file. Please be sure to complete final debugging before creating the master data for submission.
- mwrite.id The ID file used by mwrite. This is a 32-byte file and it is copied as-is into the ID region when mwrite is executed. The information includes the "factory line number" and the "production time" of the machine on which mwrite was run. For more details about the ID region, see Chapter 6 of the N64 Disk Drive Programmer's Guide.

Notes and Examples
When creating the master data, be sure to use the libleo.a and libultra_rom.a libraries for linking. (The libraries libleo_d.a and libultra_d.a are for debugging.) Please create a disk for final checking using master data linked to libleo.a and libultra_rom.a, and conduct sufficient debugging with this disk before submitting the master.
A master production config file can be specified as follows (here named n64mdisk.yes):

    % n64mdisk n64mdisk.yes	  [for Partner-N64NW]
    C> n64mdisk n64mdisk.yes  [for Partner-N64PC]

Following is an example of such a config file followed by details about each line:

    USE GWRITE gwrite
    DISK TYPE AUTO
    IPL LOAD ADDRESS 0x80000400
    RAM START LBA AUTO
    RAM END LBA AUTO
    INITIAL CODE NINT
    GAME VERSION 11
    DISK NUMBER 22
    DISK USE 0
    DESTINATION CODE JAPAN
    COMPANY CODE 1
    FREE AREA 0x123456789abc

USE GWRITE
Specifies NO or gwrite. When NO is specified, the ROM INIT. FILE line must also be specified (see below). When gwrite is specified, the master’s ROM region data is created based on the contents of the gwrite file. If the RAM region data is specified in the gwrite file, then RAM region data is also created.
Example: USE GWRITE gwrite
Example: USE GWRITE NO
DISK TYPE
Specifies the disk type. Numerical values of 0 to 6 can be specified. For details, see Chapter 11 of the N64 Disk Drive Programmer's Guide.
Example: DISK TYPE 0
IPL LOAD ADDRESS
Specifies the IPL load address. Refer to Chapter 11 of the N64 Disk Drive Programmer's Guide for the load address. When an address is specified in gwrite with the leowrite -a xxxxxx command, it is given priority.
Example: IPL LOAD ADDRESS 0x80000400
IPL LOAD SIZE
Specifies the IPL load size. When data is created with gwrite this data is not needed (it is ignored). Refer to Chapter 11 of the N64 Disk Drive Programmer's Guide for information about IPL size.
Example: IPL LOAD SIZE 8
ROM INIT. FILE
Specifies the image file for ROM region data. This must be specified when no data is created using gwrite. Conversely, when gwrite is used to create data, this cannot be specified.
Example: ROM INIT. FILE romimage
RAM START LBA
Specifies the start LBA for RAM region data. When AUTO is specified, the RAM region start LBA is set according to the disk type specified by DISK TYPE. Specify AUTO even if a RAM region is not being used.
Example: RAM START LBA AUTO
Example: RAM START LBA 1500
RAM END LBA
Specifies the end LBA for RAM region data. When AUTO is specified, the end LBA is automatically set from the RAM region image file size specified by gwrite or RAM INIT. FILE.
Example: RAM END LBA AUTO
Example: RAM END LBA 2000
RAM INIT. FILE
Specifies the image file for RAM region data.
Example: RAM INIT. FILE ramimage
Note: When there is a clearly specified value for RAM END LBA, the RAM region from the start LBA to the specified end LBA is secured. But at that time, the portions of data where initial values are not specified by gwrite or RAM INIT. FILE are enclosed by 0xFF markers.
For details concerning all of the following specifications, see Chapter 6 of the N64 Disk Drive Programmer's Guide.
INITAL CODE
Specifies the initial code, which must contain at least four ASCII characters.
Example: INITIAL CODE NINT
GAME VERSION
Specifies the game version, which must be at most a two-digit decimal number.
Example: GAME VERSION 1
Example: GAME VERSION 99
DISK NUMBER
Specifies the disk number, which must be at most a two-digit decimal number.
Example: DISK NUMBER 0
Example: DISK NUMBER 99

RAM USE
Specifies RAM usage (no greater than 2-digit hexadecimal). 1 indicates use of Nintendo's recommended file system. Specify 0 when no special format is used.

Example: RAM USE 0x0
DISK USE
Specifies the disk use code. 0 is normally specifiec.
Example: DISK USE 0
DESTINATION CODE
Specifies the destination or the destination code.
Example: DESTINATION CODE JAPAN
Example: DESTINATION CODE 1
COMPANY CODE
Specifies the company code (ASCII two-byte code) of the producer of the game.
Example: COMPANY CODE 12
FREE AREA
An area to freely write data (at most a 12-digit hexadecimal)
Example: FREE AREA 0x123456789abc
See Also
calcncc

Nintendo® Confidential Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.
Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated March 1998