rem Rift rem by Fort Apocalypse rem uses modified code from bbdraw from Karl G: rem https://atariage.com/forums/topic/336457-running-code-at-each-scanline-for-pcm-voice-playback/?do=findComment&comment=5070516 rem It has some problems with timing, so may not rem work well for everyone. player0x=0 player0y=80 NextFrame VerticalSync ; Grouping these together saves cycles WSYNC = 2 : VSYNC = 2 : WSYNC = 2 : WSYNC = 2 WSYNC = 0 : VSYNC = 0 VerticalBlank ; Set timer for VB TIM64T = 44 ; Your vertical blank code COLUBK = rand ; Wait for VB timer to expire before visible screen WaitVB if INTIM then goto WaitVB VisibleScreen VBLANK = 0 ; Draw a different color on each scanline for temp5 = 0 to 57; WSYNC = 0 COLUBK = rand&3 COLUBK = temp5 WSYNC = 0 COLUBK = rand&3 COLUBK = temp5+temp5 WSYNC = 0 COLUBK = rand&3 COLUBK = temp5+temp5+temp5 next for temp5 = 0 to 12; WSYNC = 0 COLUBK = 50+temp5 next WSYNC = 0 : COLUBK = 0 OverScan ; Set timer for OS TIM64T = 36 WSYNC = 2 : VBLANK = 1 ; Your overscan code AUDC0=m AUDF0=n AUDV0=1 if n=0 then m=m-1 n=n-(rand&3) ; Wait for VB timer to expire before visible screen WaitOS if INTIM then goto WaitOS COLUPF=255 scorecolor=200 gosub fly h=0 if joy0left then player0x=player0x-2 : h=1 if joy0right then player0x=player0x+1 : h=1 if joy0up then player0y=player0y-1 : h=1 if joy0down then player0y=player0y+1 : h=1 if h=1 then AUDC1=8 : AUDF1=15 : AUDV1=1 else AUDV1=0 if player0x<120 then player0x=player0x+1 else goto nowind if player0y>50 then if n&3=0 then player0y=player0y+1 if player0y<50 then if n&3=0 then player0y=player0y-1 nowind drawscreen goto NextFrame fly COLUP0=rand f=f+1 : if f>5 then f=0 if f=0 then gosub fly1 if f=1 then gosub fly2 if f=2 then REFP0=8 : gosub fly2 if f=3 then REFP0=8 : gosub fly1 if f=4 then gosub fly3 if f=5 then REFP0=8 : gosub fly3 return fly1 player0: %00111100 %01100010 %10010001 %10001001 %01000110 %00111100 end return fly2 player0: %00111100 %01010010 %10010001 %10001001 %01001010 %00111100 end return fly3 player0: %00111100 %01000010 %10001111 %11110001 %01000010 %00111100 end return