diff --git a/bootloader/source/arm9clear.arm.c b/bootloader/source/arm9clear.arm.c index 9a076f9..512437b 100644 --- a/bootloader/source/arm9clear.arm.c +++ b/bootloader/source/arm9clear.arm.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -22,7 +23,7 @@ Modified by Chishm: --------------------------------------------------------------------------*/ void __attribute__ ((long_call)) __attribute__((naked)) __attribute__((noreturn)) resetMemory2_ARM9 (void) { - register int i; + register int i, reg; //clear out ARM9 DMA channels for (i=0; i<4; i++) { @@ -31,8 +32,14 @@ void __attribute__ ((long_call)) __attribute__((naked)) __attribute__((noreturn) DMA_DEST(i) = 0; TIMER_CR(i) = 0; TIMER_DATA(i) = 0; + for (reg=0; reg<0x1c; reg+=4)*((vu32*)(0x04004104 + ((i*0x1c)+reg))) = 0;//Reset NDMA. } + // Clear out FIFO + REG_IPC_SYNC = 0; + REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_SEND_CLEAR; + REG_IPC_FIFO_CR = 0; + VRAM_CR = (VRAM_CR & 0xffff0000) | 0x00008080 ; vu16 *mainregs = (vu16*)0x04000000; @@ -44,6 +51,7 @@ void __attribute__ ((long_call)) __attribute__((naked)) __attribute__((noreturn) } REG_DISPSTAT = 0; + GFX_STATUS = 0; VRAM_A_CR = 0; VRAM_B_CR = 0;