Tool: makerom - pseudophpt/pseultra GitHub Wiki
Tool: makerom
makerom allows for the creation of N64 roms by taking in many relocatable object files and a specification file spec describing their RAM and ROM locations. makerom is tailored for use with the bootcode provided in pseultra/boot, but may be easily forked to fit with the Nintendo bootcode.
Installation
Simply make in the pseultra/makerom directory.
Usage
To use makerom, invoke the makerom executable with the following arguments:
- A specification file describing the layout of the ROM (explained below)
- The path to the MIPS
ldexecutable - The bootcode file to be used. This should be the
bootfile frompseultra/boot - The output file in which to put the ROMM at which the segment starts or ends
The specification file has the following format:
<boot segment name>
<object file to include in segment>
<object file to include in segment>
<object file to include in segment>
;
<segment name>
<object file to include in segment>
<object file to include in segment>
;
<segment name>
<object file to include in segment>
The first segment in the specfile is always the boot segment, and so the main boot function should be located in this segment. To end a segment, use a semicolon. At the end of the file, however, do not include a semicolon.
The makerom tool provides 6 symbols which can be externed to provide information on the segment:
_<segmentName>SegmentRom(Start/End), a pointer to the location in ROM at which the segment starts or ends_<segmentName>SegmentText(Start/End), a pointer to the location in RAM at which thetextsection is expected to start or end. This includes the.datasection of the object files_<segmentName>SegmentBss(Start/End), a pointer to the location in RAM where the BSS section is expected to start or end.
The makerom tool creates 3 files:
- A
link.ldlinker script used to link all objects together into one ELF file - A
rom.elfELF file which is the result of invokingldwithlink.ld - The output file whose filename is specified in the command line arguments, which is a bootable N64 ROM
Tests
There are currently no tests available.
Todo
- Allow for the inclusion of relocatable overlays.