Skip to content

Commit

Permalink
Add a "Loading" message in load-buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
davazp committed Apr 9, 2012
1 parent 4312974 commit a3b1c0f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
23 changes: 18 additions & 5 deletions core.fs
Original file line number Diff line number Diff line change
Expand Up @@ -541,21 +541,33 @@ create pad 1024 allot
: buffer>size ( addr -- size )
cell + @ ;

: buffer>string ( addr -- addr u )
dup buffer>start swap buffer>size ;

: buffer>loaded ( addr -- load-var )
2 cells + ;

: buffer>nt ( addr -- nt )
3 cells + @ ;

: buffer>string ( addr -- addr u )
dup buffer>start swap buffer>size ;

: buffer-loaded? ( addr -- flag )
buffer>loaded @ ;

: mark-buffer-as-loaded ( addr -- )
buffer>loaded true swap ! ;
@core.fs mark-buffer-as-loaded

variable load-buffer-print-hook
variable load-buffer-print
' drop load-buffer-print-hook !
load-buffer-print on

: load-buffer ( addr -- )
dup mark-buffer-as-loaded buffer>string evaluate ;
dup mark-buffer-as-loaded
load-buffer-print @ if
dup load-buffer-print-hook @ execute
endif
buffer>string evaluate ;

: require-buffer ( addr -- )
dup buffer-loaded? if drop else load-buffer then ;
Expand Down Expand Up @@ -684,12 +696,13 @@ create nextname-buffer 32 allot
endif ;

require @vocabulary.fs
require @kernel/multiboot.fs
require @kernel/console.fs
require @colors.fs
require @output.fs
LIGHT GRAY UPON BLACK
.( Loading...) CR
require @kernel/multiboot.fs
:noname ." Loading " buffer>nt id. ." ..." cr ; load-buffer-print-hook !
require @memory.fs
require @tools.fs
require @kernel/interrupts.fs
Expand Down
1 change: 1 addition & 0 deletions generate-builtin-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ for file in $*; do
echo " .long $SYMBOL_START" >> $OUTPUT
echo " .long $SYMBOL_SIZE" >> $OUTPUT
echo " .long 0" >> $OUTPUT
echo " .long begin___$BN" >> $OUTPUT
echo "END_WORD(__$BN)" >> $OUTPUT
done
2 changes: 0 additions & 2 deletions kernel/floppy.fs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
\ on real hardware however I have not a real machine with floppy drive
\ to test it properly.

.( Loading floppy.fs ...) CR

require @structures.fs
require @kernel/timer.fs

Expand Down
1 change: 0 additions & 1 deletion lisp/lisp.fs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,6 @@ defer repl-function
endcase
again ;

.( Loading core.lisp...) CR
@lisp/core.lisp buffer>string
:noname
['] repl-iteration is repl-function
Expand Down
1 change: 1 addition & 0 deletions output.fs
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,6 @@ variable .index
drop
; immediate

: id. nt>name type space ;

\ output.fs ends here
1 change: 0 additions & 1 deletion tools.fs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
endwords
r> drop ;

: id. nt>name type space ;
: words ['] id. map-nt ;

: room-count ( -- n )
Expand Down

0 comments on commit a3b1c0f

Please sign in to comment.