Here's the alternative ... but it's slower.
Use 1 and 2 to switch the gamma effect off/on, and space to exit.
sync on
sync rate 0
dot 0,0,rgb(0,0,255)
get image 1,0,0,1,1,1
sprite 1,0,0,1
size sprite 1, screen width(), screen height()
set sprite alpha 1,128
set sprite 1,0,1
while inkey$() <> " "
box 0,0,screen width(), screen height(), rgb(255,0,0), rgb(0,255,0), rgb(255,255,255), rgb(0,0,255)
if inkey$() = "1" then hide sprite 1
if inkey$() = "2" then show sprite 1
sync
endwhile
Your code can decide which to use by checking the result of the FULLSCREENGAMMA AVAILABLE() function.