Reboot procedure fixes

This commit is contained in:
Mateusz Faderewski 2023-08-10 21:25:54 +02:00
parent ac63083089
commit af7705b821

View File

@ -93,6 +93,7 @@ void boot (boot_params_t *params) {
while (cpu_io_read(&SP->DMA_BUSY));
cpu_io_write(&PI->SR, PI_SR_CLR_INTR | PI_SR_RESET);
while (cpu_io_read(&VI->CURR_LINE) != 2);
cpu_io_write(&VI->V_INTR, 0x3FF);
cpu_io_write(&VI->H_LIMITS, 0);
cpu_io_write(&VI->CURR_LINE, 0);
@ -146,7 +147,10 @@ void boot (boot_params_t *params) {
tv_type = (params->tv_type & 0x03);
reset_type = BOOT_RESET_TYPE_COLD;
cic_seed = (params->cic_seed & 0xFF);
version = (params->tv_type == BOOT_TV_TYPE_PAL) ? 6 : 1;
version = (params->tv_type == BOOT_TV_TYPE_PAL) ? 6
: (params->tv_type == BOOT_TV_TYPE_NTSC) ? 1
: (params->tv_type == BOOT_TV_TYPE_MPAL) ? 4
: 0;
stack_pointer = (void *) UNCACHED(&SP_MEM->IMEM[1020]);
asm volatile (