Hi ... AGAIN. :)
I can not read the touchpad.
It worked before. before = yesterday, before i recompiled fpc ...
it's not the code, because it ran before and i also copied the code from
another thread from here.
it can't be my batch-file either (or are there any new compiler switches that
i need for the touchpad O_O).
here's the code anyway:
... saved as touch.pp9Code:Program Touch; {$APPTYPE ARM9} {$DEFINE ARM9} {$MODE OBJFPC} uses cTypes; {$INCLUDE NDS.INC} var touchXY: touchPosition; begin consoleDemoInit(); videoSetMode(MODE_FB0); vramSetBankA(vram_A_LCD); irqInit(); irqEnable(IRQ_VBLANK); lcdSwap; while true do begin touchXY := touchReadXY(); If (touchXY.X <> 0) then vram_A[100 * 256 + 100] := rgb15(31,31,31); end; end.
and...
... saved as touch.pp7Code:program Touch; {$apptype arm7} //...or arm7 {$define ARM7} //...or arm7, according to apptype {$mode objfpc} // required for some libc funcs implementation uses ctypes; // required by nds headers! {$include nds.inc} // headers! var tempPos: touchPosition; procedure CatchTheTouch(); begin tempPos := touchReadXY(); IPC^.touchX := tempPos.x; IPC^.touchY := tempPos.y; end; begin // Reset the clock if needed rtcReset(); irqInit(); irqSet(IRQ_VCOUNT, @CatchTheTouch); irqEnable(IRQ_VCOUNT); while true do swiWaitForVBlank(); end.
my batch-file looks like this:
-Sg enables JumpingCode:@cls ppcarmnds %1.pp9 -Sg ppcarmnds %1.pp7 -Sg ndstool -c %1.nds -9 %1.arm9.bin -7 %1.arm7.bin j:\nds\no$gba %1
%1 = Parameter 1 for the batch-file
I have tried using px instead of x, which of course didn't make any difference, probably because there isn't any ipc happening at all.
i did not look at the asm-source yet. i could, but i do not have a reference
to compare with ... maybe if someone could compile the code and upload
the asm-source somewhere ... it could help me find the error.
any advise?


Reply With Quote
i don't care about that as long i can write

