fpc/packages/libndsfpc/examples/graphics/Printing/console_windows/ConsoleWindows.pp
Legolas 3f9327d340 * NDS: updated the rtl, libnds and fixed the examples. Now it should work fine with devkitARM r26
- Removed (again) old libgba examples

git-svn-id: trunk@13585 -
2009-08-23 13:57:45 +00:00

67 lines
1.2 KiB
ObjectPascal

program ConsoleWindows;
{$mode objfpc}
uses
ctypes, nds9;
const border = '------------' +
'| |' +
'| |' +
'| |' +
'| |' +
'| |' +
'| |' +
'| |' +
'| |' +
'| |' +
'| |' +
'| |' +
'| |' +
'| |' +
'| |' +
'------------';
var
touch: touchPosition;
left: pPrintConsole;
right: PrintConsole;
keys: integer;
begin
left := consoleDemoInit();
right := left^;
consoleSetWindow(left, 15,1,12,16);
consoleSetWindow(@right, 1,1,12,16);
consoleSelect(left);
iprintf(border);
consoleSelect(@right);
iprintf(border);
consoleSetWindow(left, 2,2,10,14);
consoleSetWindow(@right,16,2,10,14);
while true do
begin
scanKeys();
keys := keysHeld();
if (keys and KEY_TOUCH) <> 0 then
begin
touchRead(touch);
if (touch.px < 128) then
consoleSelect(left)
else
consoleSelect(@right);
iprintf(#10'T: %i', touch.px);
end;
swiWaitForVBlank();
end;
end.