-- title:  Font routine (system)
-- author: Decca / RiFT
-- script: lua

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
package.path=package.path..";C:\\Users\\Matt\\AppData\\Roaming\\com.nesbox.tic\\TIC-80\\rift\\?.lua"	-- jynx

local R={}
require("./sys/sys")(R)
require("./font/sysfont")(R)

-- init vars
TAB=0
FONTNAME=""

-- main loop
function BOOT()
  local data=require("./data/sysfont/informics-7x7/informics-7x7")
  R.sysfontLoad(data)
  FONTNAME=data.name
  drawText()
end

function TIC()
  R.tryBreak()
  
  if keyp(49,60,6) then
    TAB=1-TAB
    drawText()
  end
end

function drawText()
  cls()
  print("THE QUICK BROWN FOX JUMPED OVER THE",24,16,03)
  print("LAZY DOGS BACK IN 1 / 2 / 3 SECONDS",28,32,07)
  print("7-0-9 SHOW ME SOME MORE COOL TRICKS",24,48,10)
  
  print("THE ANSWER IS '42' (BUT IS IT REAL)",34,64,05) 
  print("#TIC80 - LETS SMASH SOME PURE BITS!",28,80,11)
  if TAB==0 then
    print("BRING ME COFFEE & TEA + SOFT-DRINK$",26,96,02)
  else
    print("BRING ME COFFEE & TEA + SOFT-DRINK$\n   SKILL IS NEEDED, ARE YOU BORED?",26,96,02)
  end
  print(FONTNAME,0,130,15,false,1,true)
  print("TAB - newline",194,130,15,false,1,true)
end

-- <PALETTE>
-- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
-- </PALETTE>
