# SMPC: the system manager, pads, clock, region Sources: the SMPC User's Manual (ST-169-R1, cited SMPC), Preliminary Technical Bulletin #42 (cautions on using the SMPC), and MacDonald's SMPC section (CMH, tested on two units). ## What it is A Hitachi HD404920FS 4-bit microcontroller with its own mask ROM, branded Sega 315-5744, battery-backed, at 4 MHz with a 32.768 kHz RTC crystal (DOC: CMH). Its firmware has not been dumped as far as this phase found (MAME 0.285 models it as "SMPC HLE (HD404920FS)": OBSERVED, `-listdevices saturn`). The board therefore models it **functionally**: the documented commands with their documented execution times. ## Commands (DOC: SMPC 2.1, tables 2.1-2.3, p. 12) | Code | Name | Execution time (the table's min column; INTBACK's is its max) | | --- | --- | --- | | 00h | MSHON master SH-2 on | 30 us | | 02h / 03h | SSHON / SSHOFF slave SH-2 on / off | 30 us | | 06h / 07h | SNDON / SNDOFF 68EC000 on / off | 30 us | | 08h / 09h | CDON / CDOFF CD block on / off | 40 us | | 0Dh | SYSRES reset the system | 100 ms + a | | 0Eh / 0Fh | CKCHG352 / CKCHG320 change the PLL | 100 ms + a | | 18h | NMIREQ NMI to the master | 30 us | | 19h / 1Ah | RESENAB / RESDISA reset button on / off | 30 us | | 10h | INTBACK status and peripheral data | 320 ms | | 17h | SETSMEM write SMPC memory | 40 us | | 16h | SETTIME set the RTC | 70 us | The protocol: wait for SF clear, set SF, write IREGs, write COMREG; the SMPC clears SF and fills OREGs and SR when done (DOC: SMPC 2.2). INTBACK collects peripheral data from V-blank-out, must be issued in a window before it, and ends status collection about 300 us after the command (DOC: SMPC 2.4, fig. 2.5); the System Manager interrupt (SCU vector 47h) reports it. Effects other domains see: the clock change resets the slave SH-2, which must be restarted by SSHON (DOC: DUAL 3.0); SYSRES and the clock change take ~100 ms; the PLL frequency changes the CPU, SCU and VDP clocks but not the SCSP's or the SMPC's (DOC: CMH). ## Ports (DOC: CMH "I/O Ports"; SMPC ch. 3) Two 7-bit ports (TH, TR, TL, D3-D0) through PDR1/2, DDR1/2 and IOSEL (0 = SMPC polls, 1 = direct). An empty port reads 0x7F; bit 7 latches what was written. CMH gives the standard pad's four TH/TR phases and the 3D pad's nibble protocol, which needs ~10 NOPs between write and read on real hardware (a timing the board must model if a game depends on it; U16). EXLE routes a port pin to the SCU and the VDP2 HV latch for light guns (CMH, untested by him). ## Region INTBACK returns the **area code** in OREG9 (DOC: SMPC table "Area Code"): 1 Japan, 2 Asia NTSC (Taiwan, Philippines), 4 North America (USA, Canada, Mexico), 5 Central/South America NTSC (Brazil), 6 Korea, A Asia PAL, C Europe PAL, D Central/South America PAL; 0 prohibited, the rest reserved. The boot ROM compares it with the disc's area symbols (DOC: DISC 4.3, "Compatible Area Symbol"): J, T, U, E in Sega's 1995 list; the Redump set also carries B, K, A and L ([census.md](census.md)), which the 1995 list does not name (C4). A machine table row sets: area code, PAL/NTSC (VDP2's TVSTAT PAL bit, line count, PLL frequencies), and which boot ROM. ## What the board owns All of it (Saturn and ST-V only). The 4-bit MCU is a CPU, but with no dumped firmware a core would have nothing to run: open decision 6 records that no `hd404920-python` is proposed.