Skip to content

x.1sav.rtc.rtc4513

Owner: these specifications, under a reserved name · Applies to: the header of a save or state, or one of its parts · Status: normative schema, optional to carry

Tengai Makyou Zero has an Epson RTC-4513 beside the SPC7110 on its board. The two other SPC7110 games have no clock. This key carries what the chip holds and the moment a producer took it. x.1sav.rtc carries the reading.

The representation belongs to no one emulator, so the name sits in the x tree, under x.1sav.rtc.

; ============================================================================
; x.1sav.rtc.rtc4513 - the Epson RTC-4513 on a Super Famicom SPC7110 board
;
; An extension key for the Universal Saves Format, defined by these
; specifications under a name reserved in the Vendor Names registry because
; the chip's registers belong to no one emulator.
;
; The root here is the value carried under the key, not a bundle. A bundle
; validates against the format's own schema whatever this holds, since an
; extension value is `any` there; this file is what makes the shape checkable.
; ============================================================================
rtc-rtc4513 = {
0 => [16*16 nybble], ; registers - index 0 to F, as a read returns them
? 1 => #6.1(int), ; taken_at - the producer's clock when it took them
}
; The flags share registers with the digits, in the bits the chip puts them
; in: LOST beside the tens of seconds, PM beside the tens of hours, and the
; control bits in D, E and F. None of them gets a field of its own.
nybble = 0..15

Key 0 is the chip’s 16 registers, four bits each, in index order. Each holds what a read of it returns. The digits are BCD, and the flags sit in the bits the chip gives them:

IndexHolds
0seconds, ones
1seconds, tens in bits 0 to 2; LOST in bit 3
2minutes, ones
3minutes, tens in bits 0 to 2; WRAP in bit 3
4hours, ones
5hours, tens in bits 0 and 1; PM in bit 2; WRAP in bit 3
6day, ones
7day, tens in bits 0 and 1; RAM in bit 2; WRAP in bit 3
8month, ones
9month, tens in bit 0; RAM in bits 1 and 2; WRAP in bit 3
Ayear, ones
Byear, tens
Cweekday, 0 to 6, in bits 0 to 2; WRAP in bit 3
DHOLD in bit 0, CAL/HW in bit 1, IRQ-F in bit 2, 30ADJ in bit 3
EMASK in bit 0, DUTY in bit 1, RATE in bits 2 and 3
FRESET in bit 0, STOP in bit 1, 24/12 in bit 2, TEST in bit 3

Key 1 is the anchor: the producer’s clock at the moment it took the registers. It is the moment the producer advances the chip from when the save is next loaded. A producer that keeps one SHOULD carry it. bsnes, Snes9x and Mesen2 each write one, in files of three different layouts.

The RTC-4513 is a dating clock. x.1sav.rtc reads its components as though they were UTC, as it does for every dating clock.

  • The year is two digits with no century, so a producer supplies one.
  • With 24/12 clear the clock runs in 12-hour mode, and PM is what says the hour is after noon.
  • With CAL/HW clear the day, month and year registers are user RAM rather than a date. A producer MUST omit x.1sav.rtc then, as that key requires of any reading a producer cannot compute.

Wherever x.1sav.rtc goes, and nowhere else: the header of a save or a state, or one of its parts. A producer carrying this key SHOULD carry x.1sav.rtc on the same map. The two describe one clock, and a consumer that wants only the time then reads it without knowing the chip. They may disagree without either being wrong.

Only for Tengai Makyou Zero, including its Shounen Jump no Shou edition. The other Super Famicom clock is the Sharp S-RTC in Daikaijuu Monogatari II, which takes x.1sav.rtc.srtc.