package.path=package.path..";C:\\Users\\micro\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\rift\\?.lua"	-- jtruk
package.path=package.path..";C:\\Users\\Ronan\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\rift\\?.lua"	-- Mantratronic

local R={}
require("./sys/sys")(R)
require("./sys/palette")(R)
require("./sys/math")(R)

T=0
function TIC()
	R.tryBreak()
	R.hideMouse()

	-- Draw vertical bars, 15 on each vbank
	for v=0,1 do
		vbank(v)
		for i=0,14 do
			local x=240*(v*15+i)/30
			local w=240/30
			rect(x,0,w,136,i+1)
		end
	end

	T=T+1
end

function BDR(y)
	-- Do some palette swimming!
	for v=0,1 do
		vbank(v)
		for i=1,15 do
			r=i/15
			g=T/200
			local u=y/136
			u=(v==0) and u or 1-u
			b=R.clamp(u,0,1)

			R.palette.setRGBU(i,r,g,b)
		end
	end
end
