does GETPTR only work with streamer?
GETPTR doesn't seem to be working like I'd like...
I'm trying to use it with a wflong loop, to mark where a trigger occurred...
When I search here for info, I just see stuff about using it with the streamer...
As a test, I did this:
I would have expected that d1 would have same value as pBuf, put it doesn't. Looks at it is pointing to where it would wrap.
But, in real code it just seems to give quasi random values...
I'm trying to use it with a wflong loop, to mark where a trigger occurred...
When I search here for info, I just see stuff about using it with the streamer...
As a test, I did this:
wrfast #nBlocks/2,pBuf 'we keep writing to buffer in a loop until triggered and then read a bit more
getptr d1
I would have expected that d1 would have same value as pBuf, put it doesn't. Looks at it is pointing to where it would wrap.
But, in real code it just seems to give quasi random values...

Comments
GETPTR just increments according to RFBYTE/RFWORD/RFLONG. It doesn't wrap. I tried to make it wrap, but it was very complicated, so I didn't do it.
Only RFxxxx, not WFxxxx?
Whoops! Both reads and writes work.
getptr .x 'capture write pointer, reflects trigger point waitx ##320*4 'allow time to fill second half of buffer xstop 'stop streamer, ~640 samples gathered within 1k sample buffer sub .x,##320*4 'determine start of buffer so that trigger point is in the middle and .x,##$0FFC or .x,##bufferI guess the math is easy with a buffer size like $1000
The AND operation above gets you position in buffer.