johannes-fetz / joengine

Jo Engine is an open source 2D and 3D game engine for the Sega Saturn written in C under MIT license
http://jo-engine.org/
MIT License
205 stars 32 forks source link

jo_restart_saturn() #41

Closed slinga-homebrew closed 3 years ago

slinga-homebrew commented 3 years ago

Hi Johannes,

I would like to request the addition of a function that restarts the Saturn. I grepped through Jo's source and found jo_core_disable_reset() and jo_core_enable_reset() but that's not quite what I'm looking for.

Someone from the SX discord recommended the following code to reboot: ((volatile void()(void))0x600026C)();.

slinga-homebrew commented 3 years ago

I tried this and it works:

define SMPC_CMD_NMIREQ 0x18

jo_smpc_begin_command(); jo_smpc_end_command(SMPC_CMD_NMIREQ);

However:

jo_smpc_begin_command(); jo_smpc_end_command(SystemReset);

Did not reboot the system.