printBothScreens.pp 942 B

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