printBothScreens.pp 816 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. program printBothScreens;
  2. {$mode objfpc}
  3. uses
  4. ctypes, nds9;
  5. var
  6. touch: touchPosition;
  7. topScreen, bottomScreen: PrintConsole;
  8. begin
  9. videoSetMode(MODE_0_2D);
  10. videoSetModeSub(MODE_0_2D);
  11. vramSetBankA(VRAM_A_MAIN_BG);
  12. vramSetBankC(VRAM_C_SUB_BG);
  13. consoleInit(@topScreen, 3,BgType_Text4bpp, BgSize_T_256x256, 31, 0, true, true);
  14. consoleInit(@bottomScreen, 3,BgType_Text4bpp, BgSize_T_256x256, 31, 0, false, true);
  15. consoleSelect(@topScreen);
  16. iprintf(#10#10#9'Hello DS dev''rs'#10);
  17. iprintf(#9'www.drunkencoders.com'#10);
  18. iprintf(#9'www.devkitpro.org');
  19. consoleSelect(@bottomScreen);
  20. while true do
  21. begin
  22. touchRead(touch);
  23. iprintf(#27'[10;0H' + 'Touch x = %04i, %04i'#10, touch.rawx, touch.px);
  24. iprintf('Touch y = %04i, %04i'#10, touch.rawy, touch.py);
  25. swiWaitForVBlank();
  26. end;
  27. end.