Files
HackerSM64/asm/rom_header.s
Gregory Heskett 67ab8512b7 Switch to the ED header to support UNFLoader save type autodetection + newer flashcarts (#858)
* Force save type for UNFLoader

This fixes save type not being autodetected on SC64 with EEP4K due to the non-ED cartridge ID. Changing from SM to ED is a last resort, as emulators or other flashcarts have no means of autodetecting whether a ROM is an SM64 hack otherwise.

* Rely on ED header for UNFLoader autodetection of save type instead
2025-06-21 03:24:19 -04:00

53 lines
1.4 KiB
ArmAsm

/*
* Super Mario 64 ROM header
* Only the first 0x18 bytes matter to the console.
*/
#include "config.h"
.byte 0x80, 0x37, 0x12, 0x40 /* PI BSD Domain 1 register */
.word 0x0000000F /* Clockrate setting*/
.word entry_point /* Entrypoint */
/* Revision */
.word 0x0000144C
.word 0x00000000 /* Checksum 1 */
.word 0x00000000 /* Checksum 2 */
.word 0x00000000 /* Unknown */
.word 0x00000000 /* Unknown */
.ascii INTERNAL_ROM_NAME /* Internal ROM name */
#if defined(EMU_DEFAULT_TO_GCN)
/* Advanced homebrew ROM header bytes: https://n64brew.dev/wiki/ROM_Header#Advanced_Homebrew_ROM_Header */
.word 0x82000000
#else
.word 0x00000000 /* Unknown */
#endif
.word 0x0000004E /* Cartridge */
.ascii "ED" /* Cartridge ID */
/* Region */
#if defined(VERSION_JP) || defined(VERSION_SH)
.ascii "J" /* NTSC-J (Japan) */
#else
.ascii "E" /* NTSC-U (North America) */
#endif
#if defined(USE_RTC)
#define RTC_BIT 0x1
#else
#define RTC_BIT 0x0
#endif
/* Savetype, region, and RTC */
#if defined(SRAM)
.byte 0x32 | RTC_BIT
#elif defined(EEP16K)
.byte 0x22 | RTC_BIT
#elif defined(SRAM768K)
.byte 0x42 | RTC_BIT
#elif defined(FLASHRAM)
.byte 0x52 | RTC_BIT
#else
.byte 0x12 | RTC_BIT
#endif