It all depends on what you've got going on elsewhere on the screen(s). As long as you've got a small stable area on a screen, a simple:
Locate X,Y : Print Y_POS;Will show you where the beam's got to. It will jitter about a lot (it's being refreshed 50 times a second!) but should be readable unless
Y_POS is hovering around the 1-to-2 and 2-to-3 digit changeover values. E.g. 8,12,10,9,10,etc. or 97,101,100,98,etc. If that's a problem just change it to:
Locate X,Y : Print Using "###";Y_POS;Don't worry too much about chewing resources to display the result - you've got 144,000 CPU clock cycles each
1/
50th second on a standard A600. You can't do anything without chewing
some resources. The instructions to get
Y_POS only take a handful of cycles. And, to some extent, it's then irrelevant how long it takes to display it.
If you've got no stable screen space to display the values, a more complex solution is to log them into a memory bank. Create a Data Bank so you can save it if need be. Size it to whatever number of samples you think is reasonable. It will get written to at the rate of 50 bytes per second, so, for example, a 60 second sample would need 60 * 50 = 3,000 bytes.
Here's a quick sample prog to get a rough idea how long that
Locate and
Print Using is taking. When it finishes, it goes to direct mode. From there, just
ListBank to get its adddress and use
Peek to get at your samples. If you've got a lot of samples, save the bank to disc and put a simple program together to list it to screen. Note that this sample makes no attempt to Erase the bank as you will want to look at it - multiple runs will produce multiple banks!
'
' I always prefix my globals with "G_"
'
' G_Y_POS Beam's Y position
'
' G_B_NUM Bank number
' G_B_START Bank start address
' G_B_END Bank end address
' G_B_LEN Bank length
' G_B_POS Bank pointer
Global G_Y_POS
Global G_B_NUM
Global G_B_START
Global G_B_END
Global G_B_LEN
Global G_B_POS
G_B_LEN=100
'===============================================
'
' Somewhere in your intialisation code:
'
Proc _INIT_BANK
'
'===============================================
Screen Open 0,640,256,16,Hires
_COUNT=1
Do
Wait Vbl
Locate 0,10
Print Using "####";_COUNT
'===============================================
' Wherever in your code that you're putting
' your check on the Y beam position:
'
G_Y_POS=Leek($DFF004) and $1FF00
Ror.l 8,G_Y_POS
If G_B_POS<G_B_END
Poke G_B_POS,G_Y_POS
Inc G_B_POS
End If
'
'===============================================
Inc _COUNT
If _COUNT>G_B_LEN Then Exit
Loop
Direct
Procedure _INIT_BANK
'
' Create the bank, grab its details and
' initialise its pointer
'
Proc _GET_FREE_BANK_NUMBER
G_B_NUM=Param
Reserve As Data G_B_NUM,G_B_LEN
G_B_START=Start(G_B_NUM)
G_B_END=G_B_START+G_B_LEN
G_B_POS=G_B_START
End Proc
Procedure _GET_FREE_BANK_NUMBER
'
' Search for a free memory bank and return its number
'
For B=255 To 16 Step -1
If Length(B)=0 Then Exit
Next B
End Proc[B]