folders=getFolderList("images")
foldersNB=tableLength(folders)
iterations=1
fdebug("into testfilesystem")


for key,value in pairs(FONTS) do
	fdebug("FONTS[\""..key.."\"]")
	--screen:fontPrint(value, 20, 100, key, black)
	value:setPixelSizes(0,14)
end

while true do
	
	--also erases everything 
	screen:blit(0, 0, background,  false)
	--enableDebug()
	updateInputs(Controls.read())
	
	if inputLongPress("start") and inputLongPress("select") then
		break
	end
	
	local x=10
	local y=10
	local i=0
	
	for i=1,foldersNB do
		screen:print(x, y*i, folders[i])
	end
	
	local i=0
	for key,value in pairs(FONTS) do
		screen:print(15, 100+i*20, "-", black)
		screen:fontPrint(value, 20, 100+i*20, key, black)
		i=i+1
	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