33 lines
785 B
C
Raw Normal View History

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();
sc64_disable_flash();
cic_type_t cic_type = sc64_get_cic_type();
tv_type_t tv_type = sc64_get_tv_type();
if (cic_type == E_CIC_TYPE_UNKNOWN || tv_type == E_TV_TYPE_UNKNOWN) {
// Try to guess CIC and TV type from ROM in SDRAM if no override is provided
cart_header_t *cart_header = boot_load_cart_header();
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();
boot(cic_type, tv_type);
}