so, i found something out.
This:
Code:
Program Touch;
{$APPTYPE ARM9}
{$DEFINE ARM9}
{$MODE OBJFPC}
uses
cTypes;
{$INCLUDE NDS.INC}
//arm9
var
touchXY: touchPosition;
begin
consoleDemoInit();
videoSetMode(MODE_FB0);
vramSetBankA(vram_A_LCD);
irqInit();
irqEnable(IRQ_VBLANK);
lcdSwap;
vram_a[0] := rgb15(0,0,0);
vram_a[10] := rgb15(0,0,0);
vram_a[20] := rgb15(0,0,0);
while true do
begin
swiWaitForVBlank;
touchXY := touchReadXY();
If (touchxy.X <> 0) then
begin
iprintf(#27 + '[7;5H' + 'Touch x = %04X, %04X' + #10, [touchxy.px, touchxy.py]);
vram_A[(touchxy.py div 16) * 256 + (touchxy.px div 16)] := rgb15(31,31,31);
end;
end;
end.
...WORKS. It's the code for ARM9 and it works... but it's strange, because:
1st:
i've read that the arm9 can't communicate with the touchpad directly and has
to do this via arm7 and ipc, BUT THERE IS NO arm7-code.
2nd: normally i used px/py without dividing and it gave me the exact
position of the pen, whereas NOW i have to divide px/py (like before in x/y,
which gave me unexact results) and x is increasing continously and y just stays empty.
what the hell is going on here??
Bookmarks