
num=1
iterations=1

startTimer()

while true do
	
	--also erases everything 
	screen:blit(0, 0, background,  false)
	--enableDebug()
	updateInputs(Controls.read())

	playEvent=getPlayEvent(inputIsPressed("r"))
	if playEvent~=nil then
		screen:print(150, 150, playEvent, white)
	end
	
	if inputLongPress("start") and inputLongPress("select") then
		break
	end

	itmess=iterations.." iter."
	screen:print(381, 231, itmess)
	screen:print(381, 229, itmess)
	screen:print(379, 231, itmess)
	screen:print(379, 229, itmess)
	screen:print(380, 230, itmess, white)
	
	mem=getMemoryInfo()
	screen:print(381, 246, mem)
	screen:print(381, 244, mem)
	screen:print(379, 246, mem)
	screen:print(379, 244, mem)
	screen:print(380, 245, mem, white)

	iterations=iterations+1
   	screen.waitVblankStart()
	screen.flip()
   	
end