: titlec ( c -- ) textx @ texty @ 40 * + swap text-color @ rawtextc 1 textx +! ; : textline ( w r m l ) textleft @ textx ! titlec > - textx ! titles ; : option ( s -- ) 19 center ; intern save.sav var savedlevel defer redraw-menu : show-title-bg s" title" loadscr ; : startgame ( n -- ) show-title-bg s" start.jor" loadjor ; : help s" help" loadscr ^ENTER wait-key show-title-bg redraw-menu ; : menu-opts s" New Game" :| 1 startgame |; yield s" Continue" savedlevel @ if :| savedlevel @ startgame |; else 0 then yield s" Help" ' help yield s" Catalog" :| s" catalog.exe" system fuck show-title-bg redraw-menu |; yield s" Quit" ' quit yield done ; var menu-selected : menu-y ( i -- y ) 12 * 88 + ; : draw-menu 0 menu-opts each if over menu-selected @ = if LGREEN else WHITE then else RED then text-color ! over menu-y texty ! option dup menu-selected @ = if 15 else sp then optionbg 1 + more drop ; :noname WHITE text-color ! 21 10 8 72 box draw-menu ; ' redraw-menu redefine : exec-selected 0 menu-opts each swap drop over menu-selected @ = if dup if sfx-confirm execute else drop then break else drop then 1 + more drop ; : menu-count 0 menu-opts each drop drop 1 + more ; : menu-select ( di -- ) menu-selected menu-count +!cycle draw-menu sfx-bink ; :noname save.sav open fget close savedlevel ! fuck 0 split-screen show-title-bg redraw-menu :| ^ENTER key-pressed if exec-selected then ^UP key-pressed if -1 menu-select then ^DOWN key-pressed if 1 menu-select then ^ESC key-pressed if quit then |; ' tick redefine ' noop ' draw redefine ; checkpoint title