Skip to content

x.1sav.rtc.upd4990a

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

An MVS board keeps a NEC uPD4990A clock beside its backup RAM, and the BIOS dates its bookkeeping by it. An AES console has none. 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.upd4990a - the NEC uPD4990A clock on a Neo Geo MVS 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-upd4990a = {
0 => bstr .size 6, ; time - BCD second, minute, hour, day; month and weekday; BCD year
? 1 => #6.1(int), ; taken_at - the producer's clock when it took them
}
; The fifth byte holds the month, 1 to 12 in binary, in its high nibble and
; the weekday, 0 to 6, in its low one. The hour runs 0 to 23. The year is two
; BCD digits with no century.

Key 0 is the chip’s time in the order it shifts it out: second, minute, hour and day, one BCD byte each; then a byte holding the month, 1 to 12 in binary, in its high nibble and the weekday, 0 to 6, in its low one; then the year, two BCD digits. The hours run 0 to 23.

Key 1 is the anchor: the producer’s clock at the moment it took key 0. A producer that keeps one SHOULD carry it. ares keeps the chip in a 16-byte time.rtc in the MVS’s system folder: the six bytes, two bytes it does not use, then the anchor as a little-endian count of Unix seconds. Keys 0 and 1 hold all of it. MAME, FinalBurn Neo and MiSTer’s NeoGeo core read the host’s clock instead and keep nothing.

The clock 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.

The header of a device or a state, and nowhere else. The clock is the board’s, so a save does not carry it. An MVS’s device holds its backup RAM as the internal component and its card as neogeo-card, and this key goes on that device’s header. A producer carrying this key SHOULD carry x.1sav.rtc on the same map, and the two may disagree without either being wrong.

Only for an MVS, and only when the producer read its clock, from a board or from a file that keeps it, as ares’s does. A tool that runs the clock from its host’s has no clock of its own to carry, and a producer reading it omits the key.