fpc/packages/libndsfpc/examples/hello_world/helloWorld.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

39 lines
705 B
ObjectPascal

program hello_world;
{$mode objfpc}
uses
ctypes, nds9;
var
frame: integer;
touchXY: touchPosition;
procedure Vblank();
begin
inc(frame);
end;
begin
irqSet(IRQ_VBLANK, @Vblank);
consoleDemoInit();
iprintf(' Hello DS dev''rs'#10);
iprintf(#27'[32m' + 'www.devkitpro.org'#10);
iprintf(#27'[32;1m' + 'www.drunkencoders.com'#27'[39m');
while true do
begin
swiWaitForVBlank();
touchRead(touchXY);
// print at using ansi escape sequence \x1b[line;columnH
iprintf(#27'[10;0H' + 'Frame = %d', frame);
iprintf(#27'[16;0H' + 'Touch x = %04X, %04X'#10, touchXY.rawx, touchXY.px);
iprintf('Touch y = %04X, %04X'#10, touchXY.rawy, touchXY.py);
end;
end.