You can't access arm7 functions from arm9 directly. In order to get the touch screen coordinates from arm9 you will need to access the IPC register via touchReadXY() function. The right way to do that is:

1. In arm7 code, make a function to pass the touch screen values to the IPC register in arm7, then pass this function to an IRQ activated via IRQ_VCOUNT
[pascal]
// arm7
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.

[/pascal]

2. In arm9 code, read the IPC values using the function touchReadXY();
[pascal]
//arm9
var
touchXY: touchPosition;

begin
...

while true do
begin
touchXY := touchReadXY();
....
end;
end.
[/pascal]


I haven't touched (:lol fpc4nds for a while, so I really don't know if something is changed in the last libnds vesion. I need to update my pascal binding, I know :roll: