#161875 - cornaljoe - Sat Aug 16, 2008 2:33 pm
I'm using DevkitARM r21 and I can compile this code but GBA mode doesn't boot properly. I get a white screen on the screen set for GBA in the firmware and a black screen on the other. I can hear the GBA startup logo but nothing else just a white screen.
Code: |
ARM9 #include <nds.h> int main(void) { if(((PERSONAL_DATA *)0x023FFC80)->_user_data.gbaScreen) { REG_POWERCNT &= ~POWER_SWAP_LCDS; } else { REG_POWERCNT |= POWER_SWAP_LCDS; } return 0; } ARM7 #include <nds.h> int main(void) { uint8 current, backlight; if(((PERSONAL_DATA *)0x023FFC80)->_user_data.gbaScreen) { backlight = ~PM_BACKLIGHT_TOP; } else { backlight = ~PM_BACKLIGHT_BOTTOM; } // Reset the clock if needed rtcReset(); //enable sound powerON(POWER_SOUND); SOUND_CR = SOUND_ENABLE | SOUND_VOL(0x7F); REG_SPICNT = SPI_ENABLE | SPI_DEVICE_POWER | SPI_BAUD_1MHz | SPI_CONTINUOUS; REG_SPIDATA = 0x80; SerialWaitBusy(); REG_SPICNT = SPI_ENABLE | SPI_DEVICE_POWER | SPI_BAUD_1MHz ; REG_SPIDATA = 0; SerialWaitBusy(); current = REG_SPIDATA & 0xff; current = current & backlight; SerialWaitBusy(); REG_SPICNT = SPI_ENABLE | SPI_DEVICE_POWER | SPI_BAUD_1MHZ | SPI_CONTINUOUS; REG_SPIDATA = 0; SerialWaitBusy(); REG_SPICNT = SPI_ENABLE | SPI_DEVICE_POWER | SPI_BAUD_1MHZ; REG_SPIDATA = current; SerialWaitBusy(); swiSwitchToGBAMode(); return 0; } |