~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/SLOF/board-qemu/slof/dev-null.fs

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\ Introduce a dummy console that will eat away all chars and make all
 
2
\ the components dependent on stdout happy.
 
3
 
 
4
new-device
 
5
" devnull-console" device-name
 
6
 
 
7
: open true ;
 
8
: close ;
 
9
 
 
10
: write ( adr len -- actual )
 
11
  nip
 
12
;
 
13
 
 
14
: read  ( adr len -- actual )
 
15
    2drop 0
 
16
;
 
17
 
 
18
: setup-alias
 
19
    " devnull-console" find-alias 0= IF
 
20
        " devnull-console" get-node node>path set-alias
 
21
    ELSE
 
22
        drop
 
23
    THEN
 
24
;
 
25
 
 
26
: dummy-term-emit drop ;
 
27
: dummy-term-key  0 ;
 
28
: dummy-term-key? FALSE ;
 
29
 
 
30
' dummy-term-emit to emit
 
31
' dummy-term-key  to key
 
32
' dummy-term-key? to key?
 
33
 
 
34
setup-alias
 
35
finish-device