From af7705b821471d7881dde303a2a1dc9f1bc93f76 Mon Sep 17 00:00:00 2001 From: Mateusz Faderewski Date: Thu, 10 Aug 2023 21:25:54 +0200 Subject: [PATCH] Reboot procedure fixes --- src/boot/boot.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/boot/boot.c b/src/boot/boot.c index 969bd211..901c2eb9 100644 --- a/src/boot/boot.c +++ b/src/boot/boot.c @@ -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 (