2020-10-08 02:04:42 +02:00
|
|
|
#include <libdragon.h>
|
|
|
|
|
|
|
|
#include "boot.h"
|
|
|
|
#include "sc64.h"
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
init_interrupts();
|
|
|
|
|
|
|
|
sc64_enable_sdram();
|
|
|
|
|
|
|
|
cic_type_t cic_type = sc64_get_cic_type();
|
|
|
|
tv_type_t tv_type = sc64_get_tv_type();
|
|
|
|
|
2020-10-13 00:25:09 +02:00
|
|
|
cart_header_t *cart_header = boot_load_cart_header();
|
2020-10-08 02:04:42 +02:00
|
|
|
|
2020-10-13 00:25:09 +02:00
|
|
|
// Try to guess CIC and TV type from ROM in SDRAM if no override is provided
|
|
|
|
if (cic_type == E_CIC_TYPE_UNKNOWN || tv_type == E_TV_TYPE_UNKNOWN) {
|
2020-10-08 02:04:42 +02:00
|
|
|
if (cic_type == E_CIC_TYPE_UNKNOWN) {
|
|
|
|
cic_type = boot_get_cic_type(cart_header);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tv_type == E_TV_TYPE_UNKNOWN) {
|
|
|
|
tv_type = boot_get_tv_type(cart_header);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
disable_interrupts();
|
|
|
|
|
2020-10-13 00:25:09 +02:00
|
|
|
boot(cart_header, cic_type, tv_type);
|
2020-10-08 02:04:42 +02:00
|
|
|
}
|