diff --git a/source/arm11/hardware/gfx.c b/source/arm11/hardware/gfx.c index fd0bf9a..06b4905 100644 --- a/source/arm11/hardware/gfx.c +++ b/source/arm11/hardware/gfx.c @@ -122,9 +122,8 @@ *((vu32*)0x10140140) = 0; // REG_CFG11_GPUPROT // Reset. - // TODO: The reset destroys bootrom and OTP data. Move it elsewhere. - //REG_PDN_GPU_CNT = 0x10000; - //wait(12); + REG_PDN_GPU_CNT = 0x10000; + wait(12); REG_PDN_GPU_CNT = 0x1007F; REG_GX_GPU_CLK = 0x100; REG_GX_PSC_UNK = 0; @@ -156,12 +155,9 @@ IRQ_registerHandler(IRQ_PPF, 14, 0, true, gfxIrqHandler); IRQ_registerHandler(IRQ_P3D, 14, 0, true, gfxIrqHandler); - // Clear first half of VRAM + half of the second half. - // The bootrom dumps are stored at the end of the second half. - // Writing at least one byte to the second half is needed - // to "wake" the VRAM up (will read as zeros otherwise). + // Clear entire VRAM. GX_memoryFill((u32*)VRAM_BANK0, 1u<<9, VRAM_SIZE / 2, 0, - (u32*)VRAM_BANK1, 1u<<9, VRAM_SIZE / 4, 0); + (u32*)VRAM_BANK1, 1u<<9, VRAM_SIZE / 2, 0); // Backlight and other stuff. REG_LCD_ABL0_LIGHT = 0; diff --git a/source/arm11/menu/menu_func.c b/source/arm11/menu/menu_func.c index 0e523ec..7c7125d 100644 --- a/source/arm11/menu/menu_func.c +++ b/source/arm11/menu/menu_func.c @@ -995,7 +995,7 @@ // dump boot9.bin ee_printf("%-20.20s", "Dump ARM9 bootrom"); - u8 *dumpPtr = (u8*)VRAM_BASE + VRAM_SIZE - OTP_SIZE - BOOT11_SIZE - BOOT9_SIZE; + u8 *dumpPtr = (u8*)AXIWRAM_BASE + AXIWRAM_SIZE - OTP_SIZE - BOOT11_SIZE - BOOT9_SIZE; bool valid = fsQuickCreate("sdmc:/3ds/boot9.bin", dumpPtr, BOOT9_SIZE); ee_printf(valid ? ESC_SCHEME_GOOD "success\n" ESC_RESET : ESC_SCHEME_BAD "failed!\n" ESC_RESET); updateScreens(); diff --git a/source/arm11/start.s b/source/arm11/start.s index 626a7c3..2691039 100644 --- a/source/arm11/start.s +++ b/source/arm11/start.s @@ -190,7 +190,7 @@ bxeq lr ldr r1, =__superhaxEnabled mov r2, #1 - ldr r0, =VRAM_BASE + VRAM_SIZE - OTP_SIZE - BOOT11_SIZE + ldr r0, =AXIWRAM_BASE + AXIWRAM_SIZE - OTP_SIZE - BOOT11_SIZE strb r2, [r1] ldr r1, =BOOT11_BASE ldr r2, =BOOT11_SIZE diff --git a/source/arm9/start.s b/source/arm9/start.s index 6c615e0..14c05ad 100644 --- a/source/arm9/start.s +++ b/source/arm9/start.s @@ -97,9 +97,10 @@ msr cpsr_cxsf, #PSR_INT_OFF | PSR_SYS_MODE ldr sp, =A9_STACK_END + bl checkSuperhax + bl setupMpu - bl checkSuperhax @ Clear bss section ldr r0, =__bss_start__ ldr r1, =__bss_end__ @@ -181,7 +182,7 @@ ldrb r1, [r0] cmp r1, #0 bxne lr - ldr r0, =VRAM_BASE + VRAM_SIZE - OTP_SIZE - BOOT11_SIZE - BOOT9_SIZE + ldr r0, =AXIWRAM_BASE + AXIWRAM_SIZE - OTP_SIZE - BOOT11_SIZE - BOOT9_SIZE ldr r1, =BOOT9_BASE ldr r2, =BOOT9_SIZE str lr, [sp, #-4]!