 #name ^.Tun1k
 #set xscreen = 320
 #set yscreen = 256
 #set xres = 320/4
 #set yres = 256/2

 ;Screen mode
 swi 256+22
 swi 256+9+128 ;(shadow mode)
 swi OS_RemoveCursors

 ;Find the video memory
 mov r0,#2
 swi OS_ReadDynamicArea
 str r0,video

 ;Data calculations
 #include "<tun1k$dir>.Data"

.loop
 ;escape?
 mov r0,#121
 mov r1,#240
 swi OS_Byte
 cmp r1,#&ff
 swieq OS_Exit
 ;swap banks..
 mov r0,#19
 swi OS_Byte
 ldr r1,bank
 mov r0,#113
 swi OS_Byte
 rsb r1,r1,#3
 str r1,bank
 #include "<tun1k$dir>.raytrace"
 #include "<tun1k$dir>.tunnel"
 b loop

.bank
 dcd 1

 #set xvw=160
 #set yvw=128
 #set zvw=150

.vr
 DCD -xvw
 DCD yvw
 DCD zvw

 DCD xvw
 DCD yvw
 DCD zvw

 DCD -xvw
 DCD -yvw
 DCD zvw

 ;all these can be chopped off at the end with zap..
.angle
 dcd 0
.vx
 dcd 0
 dcd 0
 dcd 0
.vy
 dcd 0
 dcd 0
 dcd 0
.oc
 dcd 0
 dcd 0
 dcd 0
.z
 dcd 0
.video
 dcd 0
.cos
 dcd 0
.tex
 dcd 0

.bss

