モード 5 の Extended。
VRAM 周りの再学習。
モード 3, 5 の Extended で 16 bmp BMP を展開の場合、VRAM のやり繰りがカツカツになってしまうな。
割り当てた VRAM バンクの 128KB 中 96KB を1枚絵が消費する訳だから当然といえば当然か。
こういうマゾい仕様は嫌いじゃないけど。
main.c
/*--------------------------------------------------------------------------------- mode5 2D Extended sample version 0.01 Mar 11, 2010 By. REGEKATSU ---------------------------------------------------------------------------------*/ #include <nds.h> #include "bootBgTop.h" #include "bootBgBottom.h" //--------------------------------------------------------------------------------- int main(void) { //--------------------------------------------------------------------------------- int bg_top, bg_bottom; videoSetMode(MODE_5_2D); videoSetModeSub(MODE_5_2D); vramSetBankA(VRAM_A_MAIN_BG); vramSetBankC(VRAM_C_SUB_BG); bg_top = bgInit(3, BgType_Bmp16, BgSize_B16_256x256, 0, 0); bg_bottom = bgInitSub(3, BgType_Bmp16, BgSize_B16_256x256, 0, 0); dmaCopy(bootBgTopBitmap, bgGetGfxPtr(bg_top), bootBgTopBitmapLen); dmaCopy(bootBgBottomBitmap, bgGetGfxPtr(bg_bottom), bootBgBottomBitmapLen); while(1) { swiWaitForVBlank(); } } //---------------------------------------------------------------------------------
bootBgTop.grit
bootBgBottom.grit
-gT! -gB16