2 * Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
4 * (c) Copyright 1996 - 2001 Gary Henderson (gary.henderson@ntlworld.com) and
5 * Jerremy Koot (jkoot@snes9x.com)
7 * Super FX C emulator code
8 * (c) Copyright 1997 - 1999 Ivar (ivar@snes9x.com) and
10 * Super FX assembler emulator code (c) Copyright 1998 zsKnight and _Demo_.
12 * DSP1 emulator code (c) Copyright 1998 Ivar, _Demo_ and Gary Henderson.
13 * C4 asm and some C emulation code (c) Copyright 2000 zsKnight and _Demo_.
14 * C4 C code (c) Copyright 2001 Gary Henderson (gary.henderson@ntlworld.com).
16 * DOS port code contains the works of other authors. See headers in
19 * Snes9x homepage: http://www.snes9x.com
21 * Permission to use, copy, modify and distribute Snes9x in both binary and
22 * source form, for non-commercial purposes, is hereby granted without fee,
23 * providing that this license information and copyright notice appear with
24 * all copies and any derived work.
26 * This software is provided 'as-is', without any express or implied
27 * warranty. In no event shall the authors be held liable for any damages
28 * arising from the use of this software.
30 * Snes9x is freeware for PERSONAL USE only. Commercial users should
31 * seek permission of the copyright holders first. Commercial use includes
32 * charging money for Snes9x or software derived from Snes9x.
34 * The copyright holders request that bug fixes and improvements to the code
35 * should be forwarded to them so everyone can benefit from the modifications
38 * Super NES and Super Nintendo Entertainment System are trademarks of
39 * Nintendo Co., Limited and its subsidiary companies.
44 #define MAX_RTC_INDEX 0xC
47 #define MODE_LOAD_RTC 1
48 #define MODE_COMMAND 2
49 #define MODE_COMMAND_DONE 3
51 #define COMMAND_LOAD_RTC 0
52 #define COMMAND_CLEAR_RTC 4
55 /*** The format of the rtc_data structure is:
57 Index Description Range (nibble)
58 ----- -------------- ---------------------------------------
72 8 Month 1-C (0xC is December, 12th month)
76 B Year High 9-B (9=19xx, A=20xx, B=21xx)
78 C Day of week 0-6 (0=Sunday, 1=Monday,...,6=Saturday)
85 bool8 count_enable; // Does RTC mark time or is it frozen
86 uint8 data [MAX_RTC_INDEX+1];
90 time_t system_timestamp; // Of latest RTC load time
96 void S9xUpdateSrtcTime ();
97 void S9xSetSRTC (uint8 data, uint16 Address);
98 uint8 S9xGetSRTC (uint16 Address);
99 void S9xSRTCPreSaveState ();
100 void S9xSRTCPostLoadState ();
101 void S9xResetSRTC ();
102 void S9xHardResetSRTC ();
104 #define SRTC_SRAM_PAD (4 + 8 + 1 + MAX_RTC_INDEX)