27 lines
548 B
C
Raw Normal View History

2022-05-20 00:31:45 +02:00
#include "error.h"
2022-01-12 16:14:08 +01:00
#include "exception.h"
#include "io.h"
#include "sc64.h"
void init (void) {
uint32_t pifram = si_io_read((io32_t *) (&PIFRAM[0x3C]));
si_io_write((io32_t *) (&PIFRAM[0x3C]), pifram | 0x08);
2022-01-12 16:14:08 +01:00
exception_install();
2022-05-20 00:31:45 +02:00
if (!sc64_check_presence()) {
error_display("SC64 hardware not detected");
}
2022-01-12 16:14:08 +01:00
exception_enable_watchdog();
exception_enable_interrupts();
sc64_init();
}
2022-01-12 16:14:08 +01:00
void deinit (void) {
exception_disable_interrupts();
exception_disable_watchdog();
}