diff options
author | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2019-06-20 17:21:34 +0000 |
---|---|---|
committer | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2019-06-20 17:21:34 +0000 |
commit | dd321341472d48dec57e23cbae7fc77450a58e61 (patch) | |
tree | fbfe34d0e973329c8dcf3d2985a92852831e9edf /packages/libndsfpc/examples/graphics/Printing/print_both_screens | |
parent | bdec57935fdb7f20eb519f9d99d12d2d07e9cb15 (diff) | |
parent | 754a9168ff60fc59322032d21d4ca127ec4b27cd (diff) | |
download | fpc-dd321341472d48dec57e23cbae7fc77450a58e61.tar.gz |
* synchronised with trunk till r42256
git-svn-id: https://svn.freepascal.org/svn/fpc/branches/debug_eh@42257 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/libndsfpc/examples/graphics/Printing/print_both_screens')
-rw-r--r-- | packages/libndsfpc/examples/graphics/Printing/print_both_screens/printBothScreens.pp | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/packages/libndsfpc/examples/graphics/Printing/print_both_screens/printBothScreens.pp b/packages/libndsfpc/examples/graphics/Printing/print_both_screens/printBothScreens.pp index a9a72013a8..84d91fc1c7 100644 --- a/packages/libndsfpc/examples/graphics/Printing/print_both_screens/printBothScreens.pp +++ b/packages/libndsfpc/examples/graphics/Printing/print_both_screens/printBothScreens.pp @@ -6,35 +6,39 @@ uses ctypes, nds9; var - touch: touchPosition; - topScreen, bottomScreen: PrintConsole; + keys: integer; + touch: touchPosition; + topScreen, bottomScreen: PrintConsole; begin - videoSetMode(MODE_0_2D); - videoSetModeSub(MODE_0_2D); + videoSetMode(MODE_0_2D); + videoSetModeSub(MODE_0_2D); - vramSetBankA(VRAM_A_MAIN_BG); - vramSetBankC(VRAM_C_SUB_BG); + 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); + 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(#10#10#9'Hello DS dev''rs'#10); - iprintf(#9'www.drunkencoders.com'#10); - iprintf(#9'www.devkitpro.org'); + consoleSelect(@topScreen); + + iprintf(#10#10#9'Hello DS dev''rs'#10); + iprintf(#9'www.drunkencoders.com'#10); + iprintf(#9'www.devkitpro.org'); consoleSelect(@bottomScreen); - while true do - begin - touchRead(touch); - iprintf(#27'[10;0H' + 'Touch x = %04i, %04i'#10, touch.rawx, touch.px); - iprintf('Touch y = %04i, %04i'#10, touch.rawy, touch.py); - - swiWaitForVBlank(); - end; + while true do + begin + touchRead(touch); + iprintf(#27'[10;0H' + 'Touch x = %04i, %04i'#10, touch.rawx, touch.px); + iprintf('Touch y = %04i, %04i'#10, touch.rawy, touch.py); + + swiWaitForVBlank(); + scanKeys(); + keys := keysDown(); + if (keys and KEY_START) <> 0 then break; + end; end. |