「NMI割り込み」の編集履歴(バックアップ)一覧はこちら

NMI割り込み」(2014/07/28 (月) 22:12:19) の最新版変更点

追加された行は緑色になります。

削除された行は赤色になります。

-while文の中でVBlank待ちをしなくても、.asmで宣言した処理(NMIProc)が毎回実行されます。 #highlight(c){{{ #include <kihon.h> // メイン処理 void NesMain() { const char bgpalette[] = { 0x0f, 0x21, 0x11, 0x20, 0x0f, 0x21, 0x11, 0x20, 0x0f, 0x21, 0x11, 0x20, 0x0f, 0x21, 0x11, 0x20 }; const char sppalette[] = { 0x0f, 0x0a, 0x37, 0x20, 0x0f, 0x0a, 0x25, 0x20, 0x0f, 0x0a, 0x11, 0x20, 0x0f, 0x0a, 0x2a, 0x20 }; VBlank(); InitPPU(); SetPalette((char *)bgpalette ,0); SetPalette((char *)sppalette, 1); //NMI割り込みの設定(flag1の7bitを1に) SetPPU(0x80,0x1e); while (1); } //NMI割り込み void NMIProc(void) { static unsigned char x = 50; x++; SetSprite(1,x,100,1,0); } }}}
-while文の中でVBlank待ちをしなくても、.asmで宣言した処理(NMIProc)が毎回実行されます。 #highlight(c){{{ #include <kihon.h> // メイン処理 void NesMain() { const char bgpalette[] = { 0x0f, 0x21, 0x11, 0x20, 0x0f, 0x21, 0x11, 0x20, 0x0f, 0x21, 0x11, 0x20, 0x0f, 0x21, 0x11, 0x20 }; const char sppalette[] = { 0x0f, 0x0a, 0x37, 0x20, 0x0f, 0x0a, 0x25, 0x20, 0x0f, 0x0a, 0x11, 0x20, 0x0f, 0x0a, 0x2a, 0x20 }; InitPPU(); SetPalette((char *)bgpalette ,0); SetPalette((char *)sppalette, 1); //NMI割り込みの設定(flag1の7bitを1に) SetPPU(0x80,0x1e); while (1); } //NMI割り込み void NMIProc(void) { static unsigned char x = 50; x++; SetSprite(1,x,100,1,0); } }}}

表示オプション

横に並べて表示:
変化行の前後のみ表示: