Jo Engine  2023.08.26
Jo Sega Saturn Engine
Enumerations | Functions
smpc.h File Reference

System Management & Peripheral Control. More...

Go to the source code of this file.

Enumerations

enum  jo_smpc_command {
  EnableMasterCPU, EnableSlaveCPU, DisableSlaveCPU, EnableSoundCPU,
  DisableSoundCPU, EnableCD, DisableCD, EnableNetlink,
  DisableNetlink, SystemReset, ChangeSystemClockSpeed352, ChangeSystemClockSpeed320,
  FetchStatusAndPeripheralData, SetRTCDateAndTime, SetSMPCMemory, SendNMIRequestToMasterCPU,
  EnableReset, DisableReset
}
 SMPC Commands. More...
 
enum  jo_smpc_memory_address {
  CommandRegister, StatusRegister, StatusFlag, InputRegister0,
  InputRegister1, InputRegister2, InputRegister3, InputRegister4,
  InputRegister5, InputRegister6, OutputRegister0, OutputRegister1,
  OutputRegister2, OutputRegister3, OutputRegister4, OutputRegister5,
  OutputRegister6, OutputRegister7, OutputRegister8, OutputRegister9,
  OutputRegister10, OutputRegister11, OutputRegister12, OutputRegister13,
  OutputRegister14, OutputRegister15, OutputRegister16, OutputRegister17,
  OutputRegister18, OutputRegister19, OutputRegister20, OutputRegister21,
  OutputRegister22, OutputRegister23, OutputRegister24, OutputRegister25,
  OutputRegister26, OutputRegister27, OutputRegister28, OutputRegister29,
  OutputRegister30, OutputRegister31, PortDataRegister1, PortDataRegister2,
  DataDirectionRegister1, DataDirectionRegister2, InputOutputSelectRegister, ExternalLatchEnableRegister
}
 

Functions

static __jo_force_inline void jo_smpc_write_byte (jo_smpc_memory_address addr, unsigned char data)
 
static __jo_force_inline unsigned char jo_smpc_read_byte (jo_smpc_memory_address addr)
 
static __jo_force_inline void jo_smpc_wait (void)
 
static __jo_force_inline void jo_smpc_begin_command (void)
 
static __jo_force_inline void jo_smpc_end_command (jo_smpc_command command)
 

Detailed Description

System Management & Peripheral Control.

Author
Johannes Fetz
Remarks
The SMPC (System Management & Peripheral Control) is a Hitachi 4-bit MCU with built-in program ROM.
The actual part number is HD404920FS, but the chip is branded with a Sega custom part number of 315-5744.
Bug:
No known bugs.

Enumeration Type Documentation

◆ jo_smpc_command

SMPC Commands.

Enumerator
EnableMasterCPU 

Resets and enables the SH-2 Master CPU.

EnableSlaveCPU 

Resets and enables the SH-2 Slave CPU.

DisableSlaveCPU 

Disables the SH-2 Slave CPU.

EnableSoundCPU 

Resets and enables the Motorola C68K (sound) CPU.

DisableSoundCPU 

Disables the Motorola C68K (sound) CPU.

EnableCD 

Resets and enables the CD Block.

DisableCD 

Disables the CD Block.

EnableNetlink 

Resets and enables Netlink execution.

DisableNetlink 

Disables Netlink execution.

SystemReset 

Resets the System.

ChangeSystemClockSpeed352 

Changes the system clockspeed.

ChangeSystemClockSpeed320 

Changes the system clockspeed.

FetchStatusAndPeripheralData 

Fetches the SMPC status and peripheral data.

SetRTCDateAndTime 

Sets the date and time for the RTC.

SetSMPCMemory 

Sets the 4-byte battery-backed memory contained on the SMPC(which is used by the bios for language settings, etc.

SendNMIRequestToMasterCPU 

Sends an NMI request to the Master SH2.

EnableReset 

Enables NMI requests to be sent when the Reset button is pressed.

DisableReset 

Disables NMI requests to be sent when the Reset button is pressed.

◆ jo_smpc_memory_address

Enumerator
CommandRegister 

The command that's supposed to be issued by the SMPC.

StatusRegister 

Status Register.

StatusFlag 

Status Flag. Shows the status of the SMPC command. Normally you set this to 1 when issuing out a command, and then the SMPC clears it when it's finished.

InputRegister0 

Input registers for command issuing. Whatever data the SMPC needs for processing command goes here.

InputRegister1 
InputRegister2 
InputRegister3 
InputRegister4 
InputRegister5 
InputRegister6 
OutputRegister0 

Ouput Register for the command. If it supports it, it'll output any return data here.

OutputRegister1 
OutputRegister2 
OutputRegister3 
OutputRegister4 
OutputRegister5 
OutputRegister6 
OutputRegister7 
OutputRegister8 
OutputRegister9 
OutputRegister10 
OutputRegister11 
OutputRegister12 
OutputRegister13 
OutputRegister14 
OutputRegister15 
OutputRegister16 
OutputRegister17 
OutputRegister18 
OutputRegister19 
OutputRegister20 
OutputRegister21 
OutputRegister22 
OutputRegister23 
OutputRegister24 
OutputRegister25 
OutputRegister26 
OutputRegister27 
OutputRegister28 
OutputRegister29 
OutputRegister30 
OutputRegister31 
PortDataRegister1 
PortDataRegister2 
DataDirectionRegister1 
DataDirectionRegister2 
InputOutputSelectRegister 
ExternalLatchEnableRegister 

Function Documentation

◆ jo_smpc_begin_command()

static __jo_force_inline void jo_smpc_begin_command ( void  )
static

◆ jo_smpc_end_command()

static __jo_force_inline void jo_smpc_end_command ( jo_smpc_command  command)
static

◆ jo_smpc_read_byte()

static __jo_force_inline unsigned char jo_smpc_read_byte ( jo_smpc_memory_address  addr)
static

◆ jo_smpc_wait()

static __jo_force_inline void jo_smpc_wait ( void  )
static

◆ jo_smpc_write_byte()

static __jo_force_inline void jo_smpc_write_byte ( jo_smpc_memory_address  addr,
unsigned char  data 
)
static