Skip to content

Commit

Permalink
Add logger lib
Browse files Browse the repository at this point in the history
Includes helper function log-quote to print strings to the bottom of the screen and scrolling previous messages up automatically
  • Loading branch information
tkers committed Jul 26, 2019
1 parent b7c2a06 commit a5c4019
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/logger.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require ./gbhw.fs
require ./term.fs

: scroll-to-bottom ( -- )
cursor-y @ 8 *
[ SCRN_Y 8 - ]L - \ SCRN_VY mod
rSCY c! ;

: type-fill-line ( addr u -- )
type
SCRN_VX_B cursor-x @ - spaces ;

:m log"
postpone scroll-to-bottom
postpone s"
postpone type-fill-line
postpone cr
; immediate

: init-logger
init-term
scroll-to-bottom ;

0 comments on commit a5c4019

Please sign in to comment.