Parallel Launcher Avanced Star Layout Creation

This document decribes how to create and test a custom star layout for your SM64 hack.

This process is intended for romhack developers who have altered how their hack stores save data. If your hack simply uses the vanilla save format, or only uses the 8 star per course patch, then you can instead use the much simpler web UI on romhacking.com to create your star layout.

Advanced star layouts consist of a single json file that tells Parallel Launcher where to look in the save data for star progress and how it should display that information to the user.

Layout Schema

{
	"$schema": "https://parallel-launcher.ca/layout/advanced-01/schema.json",
	"format": {
		"save_type": [Optional] (string),
		"num_slots": (number),
		"slots_start": (number),
		"slot_size": (number),
		"active_bit": (number),
		"checksum_offset": (number OR null)
	},
	"groups": [
		{
			"name": (string),
			"side": (string),
			"courses": [
				{
					"name": [Optional] (string),
					"data": [
						{
							"offset": (number),
							"mask": (number)
						},
						...
					]
				},
				...
			]
		},
		...
	],
	"collectedStarIcon": [Optional] (string OR null),
	"missingStarIcon": [Optional] (string OR null)
}
		

Top Level Properties

$schema - string, requried
The schema uri. Must be "https://parallel-launcher.ca/layout/advanced-01/schema.json"
format - object, required
A Format object describing the save type and slot layout
groups - array, required
An array of one or more Groups (see below)
collectedStarIcon - string | null, optional
A base64-encoded image to use as an icon for collected stars. The image must be under 5kB and will be displayed at 24x24 resolution. Recommended format is SVG or PNG. You can use this web UI to convert an icon into base64. If not present, a default star icon will be used.
missingStarIcon - string | null, optional
Same as above, but for the icon shown for uncollected stars. If not present, a grey silhouette of the collected star icon will be used.

Format Properties

save_type - string, optional
What type of save data is used. Valid values are EEPROM, SRAM, FlashRAM, MemPak, and Multi. If this property is not present, it defaults to EEPROM. See Save Types for more information.
num_slots - number, required
The number of save slots accessible. All slots are assumed to be directly next to each other in the save file.
slots_start - number, required
The offset from the start of the save data where the first save slot begins. In the vanilla save format, this has value 0. If you are using the MemPak save type and your total save file size is greater than 32kB, then this must have value 0.
slot_size - number, required
The size of each save slot in bytes. In the vanilla save format, this has value 112. If you are using the MemPak save type and your total save file size is greater than 32kB, then this must have value 32768.
active_bit - number, required
The offset from the start of the save slot in bits of the bit that indicates whether a save slot exists or not. In the vanilla format, this has value 95.
checksum_offset - number | null, required
The offset from the start of the save slot where the checksum is located. In the vanilla save format, this has value 54. If you have removed the checksum from your save format, enter null for this value.

Group Properties

name - string, required
The name of the group to show in Parallel Launcher.
side - string, required
One of "left", "right", "top", or "bottom" indicating which side of the UI the group should appear on. Groups in the top or bottom sides will span both the left and right columns.
courses - array, required
An array of Courses to list in the group. Usually, this represents a course, but it can be any collection of star data. This array can be empty if you simply want to use the group to display a line of text.

Course Properties

name - string, optional
The label to show in front of the stars. If this property is not present, no label will be shown.
data - array, required
An array of Star Data, each representing a single byte of save data. Must contain at least one entry. All stars in a course will be shown on the same line. To show stars on multiple lines, add another Course with an empty name below this one instead. Note that the stars in each datum will be in order of the least significant bit on the left, and the most significant bit on the right, opposite to how the number would be written in binary. This is to make it consistent with how star data is stored in vanilla.

Star Data Properties

offset - number, required
The offset of the byte from the start of the save slot
mask - number, required
A mask of which bits in the byte contain star data. For example, 255 means all bits contain star data, while 1 means only the least significant bit should be checked. Cannot be 0.

Save Types

The following save types are supported:

EEPROM

The most common save format, and the kind used for vanilla SM64. Maximum save file size is 2kB (2048 bytes), but if you use more than 512 bytes, your hack may require some configuration to work on Everdrive.

SRAM

A larger save format with a maximum size of 32kB (32768 bytes). May require some configuration to work on Everdrive.

FlashRAM

The largest save format available with a maximum size of 128kB (131072 bytes). May require some configuration to work on Everdrive.

MemPak

A save format that, on console, stores data in the MemPak addon for your N64 controller. This means you cannot use both MemPak saves and rumble for the same hack. Each MemPak can hold 32kB (32768 bytes), for a total of 128kB (131072 bytes) if all four controllers are used.

Multi

This mode operates on RetroArch's raw save file (SRM), allowing you to access all of the above save formats at once. There is very little reason to actually do this. In this mode, your offsets should be given from the start of the SRM save file. The SRM save format is simply all 2kB of EEPROM, followed by all 4 MemPaks in order, followed by SRAM, followed by FlashRAM.

Testing Your Layout

You can test the basic syntax of your layout using any JSON schema validator such as this one. The schema to validate against can be found here.

To test that your layout is reading save data correctly, you can use the star layout tester in Parallel Launcher. In the classic view, right click on the rom you want to test your layout on (or, if you are in the RHDC view, select the hack and click the ≡ button beside the version selector), then select [RHDC] Test Star Layout. You can then paste the contents of your layout file into the textbox, and Parallel Launcher will validate it and show you a preview of what it will look like on your current save file. You can also click on the stars to temporarily toggle them in your save file and use the Test Layout button to test your rom with the altered save file to verify that it behaves as expected. Any changes you make to your save file here will be reverted once you close the layout tester dialog, and no progress will be submitted to RHDC, so you can freely test without worrying about breaking your save file or star progress.