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:

Code:
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 &#40;touchXY.X <> 0&#41; then
      vram_A&#91;100 * 256 + 100&#93; &#58;= rgb15&#40;31,31,31&#41;;
  end;
end.
... saved as touch.pp9

and...

Code:
program Touch;

&#123;$apptype arm7&#125; //...or arm7
&#123;$define ARM7&#125;   //...or arm7, according to apptype

&#123;$mode objfpc&#125;   // required for some libc funcs implementation

uses
  ctypes; // required by nds headers!

&#123;$include nds.inc&#125;  // headers!

var
  tempPos&#58; touchPosition;

procedure CatchTheTouch&#40;&#41;;
begin
  tempPos &#58;=  touchReadXY&#40;&#41;;

  IPC^.touchX &#58;= tempPos.x;
  IPC^.touchY &#58;= tempPos.y;

end;

begin
  // Reset the clock if needed
  rtcReset&#40;&#41;;
  irqInit&#40;&#41;;
  irqSet&#40;IRQ_VCOUNT, @CatchTheTouch&#41;;
  irqEnable&#40;IRQ_VCOUNT&#41;;

  while true do
    swiWaitForVBlank&#40;&#41;;
end.
... saved as touch.pp7

my batch-file looks like this:

Code:
@cls
ppcarmnds %1.pp9 -Sg
ppcarmnds %1.pp7 -Sg
ndstool -c %1.nds -9 %1.arm9.bin -7 %1.arm7.bin
j&#58;\nds\no$gba %1
-Sg enables Jumping
%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?