 rem ----------------------------------------- 
 rem -- Display List Interrupt Demo         --
 rem ----------------------------------------- 
 rem ---init section, runs once: -------------
 rem -----------------------------------------
 loadplayer1(40):COLUP1=$FE 
 rem ------------------------------------------------
 rem end init section (implicit return)--------------
 rem ------------------------------------------------

 rem ------------------------------------------------
 rem ---:the next comment line is used by the compiler
 rem ---gameloop subroutine, runs every frame:    ---
 rem ------------------------------------------------
0 data city 1,4,2,5,3,2,3,1,4,1,1,1,5,2,2,3,1,4,1,4,3,1,4,4,1,1,2,2,3,1,3,4,1,5,2,2,3,1,3,1,1,4,1,5,3,2,1,1,4,1,5,6,1,4,5,5,1,1,3,3,3,1
 if t=0 then scrollvirtualworldtoggle=35:gosub DLI: rem run this DLI every other frame
 if t=1 then BYTErowoffset=v*12:h=BITIndex:BITIndex=u:vwpixel(29,5,bindplayer1):scrollvirtualworldtoggle=30:gosub DLI:BITIndex=h:BYTErowoffset=120 
 scrollvirtualworldtoggle=0
 data pl 0,224,127,231,252,192,128,0:rem bitmap
1 if g=0 then for j=0 to 7:player0(j)=pl(j):next j:BYTErowoffset=120:COLUPF=$64:COLUP0=$b4:MUSICINDEX=15 else return
 rem ---setup 
 for j = 120 to 239:virtualworld(j)=0:next j 
 for j=20 to 71:k=j-20:k=city(k)+14:for i=k to 19:vwpixel(j,i,on)
 if j<41 then n=j-20: vwpixel(n,i,on):n=52+j:vwpixel(n,i,on) 
 next i,j:player0y=88:player0x=94:COLUP1=$74:y=20:COLUBK=$0:AUDV0=0 
 g=1

 rem -------------------------------------------------------------
 rem end game loop (implicit return)-----------------
 rem -------------------------------------------------------------

 rem -------------------------------------------------------------
 rem ---gameloop2 subroutine, runs every frame:    --
 rem ------------------------------------------------
 t=1-t 
 if BITIndex>71 then BITIndex=0
 
 if x=255 then x=71
 if t=0 then z=1-z:x=x-z:BITIndex=BITIndex+1:h=BITIndex:BITIndex=x:scrollvirtualworldtoggle=8:gosub DLI:scrollvirtualworldtoggle=0:BITIndex=h:return else COLUPF=100

 rem --20221005 c64 2nd joystick button controls changing tile petscii
 if joy1fire=0 or w<>1 then goto skippetscii
 rem comment block for Atari 2600 (c64 only)
 if joy1up=1 then BackgroundTileCharacters(0)=BackgroundTileCharacters(0)+1
 if joy1down=1 then BackgroundTileCharacters(1)=BackgroundTileCharacters(1)+1
 if joy1left=1 then BackgroundTileCharacters(2)=BackgroundTileCharacters(2)+1
 if joy1right=1 then BackgroundTileCharacters(3)=BackgroundTileCharacters(3)+1

 if joy0up=1 then TileCharacters(0)=TileCharacters(0)+1
 if joy0down=1 then TileCharacters(1)=TileCharacters(1)+1
 if joy0left=1 then TileCharacters(2)=TileCharacters(2)+1
 if joy0right=1 then TileCharacters(3)=TileCharacters(3)+1
skippetscii

 
  
 rem byterowoffset is 120 for 1st DL
 w=w+1
 if w=3 then h=BITIndex:BITIndex=u:w=0:v=v+1:BYTErowoffset=v*12:vwpixel(29,5,bindplayer1):scrollvirtualworldtoggle=3:gosub DLI:scrollvirtualworldtoggle=0:BITIndex=h:return

 if v>10 then v=0:u=u+20
 if u>60 then u=19
 
 player0y=player0y+1:player0x=player0x+1
 rem BITIndex=h:rem preserved
 BYTErowoffset=120
 if joy0down=1 then player0y=player0y-2
 if joy0left=1 then player0x=player0x-3
 rem -------------------------------------------------------------
 rem end gameloop2 (implicit return)----------------- 
 rem ------------------------------------------------

 rem -------------------------------------------------------------
 rem ---KITCHENSINK subroutine, runs when scrollvirtualworldtoggle=1
 rem -------------------------------------------------------------
 
 rem end kitchensink events----------------------------------------------

rowcolors $58,$58,$58,$58,$32,$38,$3e,$1c,$1c,$58
 
virtualworld
............................................................................................
............................................................................................
............................................................................................
............................................................................................
....................xxx.xxx.xxx..xxx..x.xxxx.xx...xxxx.xxxxxxxx..xx....x.x.xxxx.............
....................x.x..x..x.x..x.x..x.x.xx.xx...x..x.x..xx..xx.xx....x...xx...............
....................x.x..x..x.x..x.x..x..xxx.xx...x..x.x..xx..xx.xx...xx...xxxx.............
...................xxxx..x..xxxx.xxxx.x.xx...xxxx.x.xx.x.xxxx.xx.xx...xx...xxxx.............
...................xx.x..x..xx.x.xx.x.x.xx...xx.x.x.xx.x.xxxx.xx.xxxx.xx.....xx.............
...................xx.x..x..xx.x.xx.x.x.xxxx.xxxx.xxxx.xxxxxxxx..xxxx.xx...xxxx.............
............................................................................................
............................................................................................
............................................................................................
............................................................................................
............................................................................................
............................................................................................
............................................................................................
............................................................................................
............................................................................................
............................................................................................

sprites
0
........
X.......
XX......
XXXXXX..
XXX..XXX
.XXXXXXX
XXX.....
........
8
.x....x.
..xxxx..
.x.xx.x.
..xxxx..
...xx...
..xxxx..
.x.xx.x.
x..x...x
16
..xxxx..
.xXXXXx.
XXX.xxXX
XxXxx.XX
xXXXXX.x
XXX..XXX
XxxxxxxX
..xxxx..
24
x...xx..
...XXXX.
X....XXX
XXX.....
..X..XX.
X.X.XXXX
Xx...XX.
...x....
32
..xxxx..
.xXXXXx.
XXX.xxXX
XxXxx.XX
xXXXXX.x
XXX..XXX
XxxxxxxX
..xxxx..
40
..xxxx..
.xXXXXx.
XX.xx.XX
XxxxxxXX
x.XXXX.x
XX....XX
.xxxxxx.
..xxxx..
48
xxxxxxxx
xx....XX
Xx....XX
XX....xx
xxxx..xx
Xxxx..XX
Xxxx..xx
xxxxxxxx
56x
..xxx...
.xxxx...
..xxx...
..xxx...
..xxx...
.xxxxx..
.xxxxx..
.xxxxx..
64
........
xxxxxxxx
......xx
......xx
xxxxxxxx
xxxx....
xxxx....
xxxxxxxx
72
xxxxxxx.
......x.
......x.
......x.
xxxxxxxx
......xx
......xx
xxxxxxxx
80
xx......
xx......
xx......
xx...xx.
xxxxxxx.
.....xx.
.....xx.
.....xx.
88
........
xxxxxxxx
xx......
xx......
xxxxxxxx
....xxxx
....xxxx
xxxxxxxx
96
........
xxxxxxxx
xx....xx
xx......
xxxxxxxx
xx....xx
xxxx..xx
xxxxxxxx
104
xxxxxxxx
xxxxxxxx
xx...xxx
....xxx.
...xxx..
...xxx..
...xxx..
...xxx..
112
.xxxxxx.
.x....X.
.x....X.
XXxxxxxx
xx....xx
Xxxx..XX
Xxxx..xx
xxxxxxxx
120
xxxxxxxx
x.....xx
x....xxx
xxxxxxxx
......xx
......xx
......xx
......xx
128
xx.xxxxx
xx.xx..x
xx.xx..x
xx.xx..x
xx.xx..x
xx.xxx.x
xxx.xx.x
xxx.xxxx
136
.xx..xx.
xxx.xxx.
.xx..xx.
.xx..xx.
.xx..xx.
.xx..xx.
.xxx.xxx
.xxx.xxx
144
xx.xxxxx
xx.x..xx
xx....xx
xx.xxxxx
xx.xxxxx
xx.xx...
xxx.x...
xxx.xxxx

152
xx.xxxx.
xx....x.
xx....x.
xx....x.
xx.xxxxx
xx.....x
xxx....x
xxx.xxxx

160
xx.xx..x
xx.xx..x
xx.xx..x
xx.xxxxx
xx....xx
xx....xx
xxx...xx
xxx...xx

168
xx.xxxxx
xx.xx...
xx.xx...
xx.xx...
xx.xxxxx
xx....xx
xxx...xx
xxx.xxxx

176
xx.xxxxx
xx.xx...
xx.xx...
xx.xx...
xx.xxxxx
xx.xx.xx
xxx.x.xx
xxx.xxxx

184
.xx.....
x....x..
xxx.x.x.
..x.x.x.
xx..x.x.
...x.x.x
...x....
...xxxx.

chiptunes
0,0,0,0,0
0,0,0,0,0

6, 5, 4, 12, 5
6, 5, 4, 12, 12
6, 5, 4, 12, 5
12, 9, 12, 7, 4
6, 5, 4, 12, 5
6, 5, 4, 12, 12
6, 5, 4, 12, 12
12, 9, 12, 7, 4

0,0,0,0,0

6, 5, 4, 12, 20
6, 17, 4, 19, 20
6, 5, 4, 12, 20
6, 17, 4, 15, 35
0, 0, 0, 0, 255
29,23,5,10,0

27, 0, 0, 8, 15
24, 8, 0, 8, 17

27, 0, 0, 8, 15
24, 8, 0, 8, 17

27, 0, 0, 8, 15
24, 8, 0, 8, 17
24,24,24,24,0
                                                               