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"
|
2021-12-10 17:36:30 +01:00
|
|
|
#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();
|
|
|
|
|
2021-12-10 17:36:30 +01:00
|
|
|
sc64_init();
|
|
|
|
}
|
2022-01-12 16:14:08 +01:00
|
|
|
|
|
|
|
void deinit (void) {
|
|
|
|
exception_disable_interrupts();
|
|
|
|
exception_disable_watchdog();
|
|
|
|
}
|