#author("2023-04-22T19:08:25+09:00","","") * ビットマップモード4 [#udb7a212] ** mode5 [#k1c64c9e] | サイズ | 160*128 | | フレームバッファ | 2 | | 色/パレット | 32768色 | | 伸縮回転 | 可能 | mode5です。ポイントは画面のサイズが小さく160*128で、32768色。パレットは使わず、mode3のように2バイトを色データとしています。フレームバッファは2となっています。画面サイズが小さいため、画像は画面左上に表示されます。右側や下側などの表示されない領域は真っ黒のままで見栄えが悪いです。~ ** mode5の画像を表示 [#cfc8eca7] #include "lib/gba.h" #include "res.h" //--------------------------------------------------------------------------- void WaitForVsync(void) { while(*(vu16*)0x4000006 >= 160) {}; while(*(vu16*)0x4000006 < 160) {}; } //--------------------------------------------------------------------------- void Mode5SetFrame(u16* img, u32 f) { u16* fr; if(f == 1) { fr = (u16*)0x6000000; } else { fr = (u16*)0x600A000; } u32 x, y; for(y=0; y<128; y++) { for(x=0; x<160; x++) { fr[y*128+x] = img[y*128+x]; } } } //--------------------------------------------------------------------------- int main(void) { // モード設定。フレーム2を指定 SetMode(MODE_5 | BG2_ENABLE | BACKBUFFER); // 画像の読み込み Mode5SetFrame((u16*)&frame1Bitmap, 1); Mode5SetFrame((u16*)&frame2Bitmap, 2); for(;;) { WaitForVsync(); } } ***動作画面 [#i3920c44] モード5で、160x128の画像の表示(フレーム2と1) #ref(clip_1.png,nolink) #ref(clip_2.png,nolink) ** 履歴 [#ja129eaa] - 2014/12/21