You need it to increment by 256 in 768 frames, so like Blink0k suggested it's time related, so you can create a clock kinda code to count out the measures for you to increment only when 3 Sync() are complete. With 60 FPS, needing it to increment 1 per 3 frames, that would be 20 per second. It actually worked out 12.8 seconds for the 256 to increment at 60 FPS, however it got to 256 within 13 seconds, must be some fault in my logic, but it seems to be able to do what you want it to.
// Project: Alpha Test
// Created: 0000000
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "AlphaTest" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 ) // 60fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
alpha_value = 0
alpha_value2 = 0
alpha_value3 = 0
b = 0
do
inc b
if b=3
inc alpha_value
inc alpha_value3
b=0
endif
s# = Timer()
if alpha_value=20
alpha_value2 = alpha_value2 + alpha_value
alpha_value=0
endif
if s#>13
s2#=s#
endif
while s2#=s#
print(str(s2#)+" secs")
print(alpha_value3)
sync()
endwhile
print(str(s#)+" secs")
print(alpha_value2)
Sync()
loop
It's an alternative, not sure how applicable this can be to your programme.
????????