Graphics/Printing/print_both_screens/source/template.c

/*---------------------------------------------------------------------------------

        Simple console print demo which prints to both screens
        -- dovoto

---------------------------------------------------------------------------------*/
#include <nds.h>
#include <stdio.h>

//---------------------------------------------------------------------------------
int main(void) {
//---------------------------------------------------------------------------------
        touchPosition touch;

        PrintConsole topScreen;
        PrintConsole bottomScreen;
        
        videoSetMode(MODE_0_2D);
        videoSetModeSub(MODE_0_2D);

        vramSetBankA(VRAM_A_MAIN_BG);
        vramSetBankC(VRAM_C_SUB_BG);

        consoleInit(&topScreen, 3,BgType_Text4bpp, BgSize_T_256x256, 31, 0, true, true);
        consoleInit(&bottomScreen, 3,BgType_Text4bpp, BgSize_T_256x256, 31, 0, false, true);


        consoleSelect(&topScreen);
        iprintf("\n\n\tHello DS dev'rs\n");
        iprintf("\twww.drunkencoders.com\n");
        iprintf("\twww.devkitpro.org");

        consoleSelect(&bottomScreen);

        while(1) {

                touchRead(&touch);
                
                iprintf("\x1b[10;0HTouch x = %04i, %04i\n", touch.rawx, touch.px);
                iprintf("Touch y = %04i, %04i\n", touch.rawy, touch.py);

                swiWaitForVBlank();
        }

        return 0;
}
 全て クラス ファイル 関数 変数 型定義 列挙型 列挙型の値 マクロ定義
libndsに対してMon Apr 26 23:39:49 2010に生成されました。  doxygen 1.6.3