Screen 0 not modified     
 0                                                                 
 1 This display interface uses BIOS call $10 functions for a fast  
 2 display interface. A couple of state variables is contained     
 3 in a vector that is task specific such that different tasks     
 4 may use different windows. For simplicity windows always        
 5 span the whole width of the screen. They can be defined by      
 6 top and bottom line. This mechanism is used for a convenient    
 7 status display line on the bottom of the screen.                
 8                                                                 
 9                                                                 
10                                                                 
11                                                                 
12                                                                 
13                                                                 
14                                                                 
15                                                                 
Screen 1 not modified     
 0 \ Multitsking display interface loadscreen        ks cas 10nov05
 1   Onlyforth    \needs Assembler   2 loadfrom asm.scr            
 2                                                                 
 3       User area     area off    \ points at active window       
 4   Variable status   \ to switch status on/off                   
 5 | Variable cursor   \ points at area with active cursor         
 6                                                                 
 7   1 8 +thru   .( Multitasking display driver loaded ) cr        
 8                                                                 
 9                                                                 
10                                                                 
11                                                                 
12                                                                 
13                                                                 
14                                                                 
15                                                                 
Screen 2 not modified     
 0 \ Multitsking display interface                   ks  6 sep 86  
 1                                                                 
 2   : Area:  Create  0 , 0 , 7 c, Does> area ! ;                  
 3 \ | col | row | top | bot | att |                               
 4                                                                 
 5 Area: terminal    terminal   area @ cursor !                    
 6                                                                 
 7   : (area   Create dup c, 1+ Does> c@ area @ + ;                
 8                                                                 
 9 0 | (area ccol    | (area crow    | (area ctop                  
10   | (area cbot      (area catt    drop                          
11                                                                 
12   : window  ( topline botline -- )   cbot c!  ctop c! ;         
13                                                                 
14   : full     0 c/col 2- window ;  full                          
15                                                                 
Screen 3 not modified     
 0 \ Multitask (type (emit                           ks 20 dez 87  
 1                                                                 
 2   Code (type   ( addr len -- )   W pop   I push   R push        
 3      u' area U D) I mov   U push   D U mov                      
 4      $F # A+ mov   $10 int   u' catt I D) R- mov                
 5      3 # A+ mov   $10 int   C push   D push   $E0E # C mov      
 6      1 # A+ mov   $10 int   I ) D mov   1 # C mov               
 7      U inc   [[  U dec  0= not ?[[  2 # A+ mov   $10 int        
 8          D- inc   ' c/row >body #) D- cmp   0= not              
 9      ?[[  W ) A- mov   W inc   9 # A+ mov   $10 int   ]]? ]?    
10      D I ) mov   D pop   cursor #) I cmp   0= ?[  I ) D mov  ]? 
11      2 # A+ mov   $10 int   C pop   1 # A+ mov   $10 int   U pop
12      R pop   I pop   D pop   ' pause #) jmp   end-code          
13                                                                 
14   : (emit  ( char -- )   sp@ 1 (type drop ;                     
15                                                                 
Screen 4 not modified     
 0 \ Multitask (at (at?                              ks 04 aug 87  
 1   Code (at    ( row col -- )   A pop   A- D+ mov                
 2      u' area U D) W mov   D W ) mov   cursor #) W cmp  0=       
 3      ?[  R push   U push   $F # A+ mov   $10 int                
 4          2 # A+ mov   $10 int   U pop   R pop                   
 5      ]?  D pop   Next   end-code                                
 6                                                                 
 7   Code (at?   ( -- row col )                                    
 8      D push   u' area U D) W mov   W ) D mov                    
 9      D+ A- mov   0 # A+ mov   A+ D+ mov   A push   Next         
10   end-code                                                      
11                                                                 
12   Code curat? ( -- row col )   D push   R push                  
13      $F # A+ mov   $10 int   3 # A+ mov   $10 int               
14      R pop   0 # A mov   D+ A- xchg   A push   Next             
15   end-code                                                      
Screen 5 not modified     
 0 \ cur!  curshape  setpage                         ks 28 jun 87  
 1                                                                 
 2   : cur!   \ set cursor into current task's window              
 3      area @ cursor !  (at? (at ;  cur!                          
 4                                                                 
 5   Code curshape  ( top bot -- )   D C mov   D pop               
 6      D- C+ mov   1 # A+ mov   $10 int   D pop   Next            
 7   end-code                                                      
 8                                                                 
 9   Code setpage   ( n -- )                                       
10      $503 # A mov   D- A- and   $10 int   D pop   Next          
11   end-code                                                      
12                                                                 
13                                                                 
14                                                                 
15                                                                 
Screen 6 not modified     
 0 \ Multitask normal invers blankline               ks 01 nov 88  
 1   : normal     7 catt c! ;     : invers   $70 catt c! ;         
 2   : underline  1 catt c! ;     : bright    $F catt c! ;         
 3                                                                 
 4   Code blankline    D push   R push   U push   $F # A+ mov      
 5      $10 int   u' area U D) W mov   u' catt W D) R- mov         
 6      3 # A+ mov   $10 int   C push   D push                     
 7      $E0E # C mov   1 # A+ mov   $10 int   W ) D mov            
 8      2 # A+ mov   $10 int   ' c/row >body #) C mov              
 9      D- C- sub   bl # A- mov   9 # A+ mov                       
10      C- C- or   0= not ?[  $10 int  ]?                          
11      D pop   2 # A+ mov   $10 int  \ set cursor back            
12      C pop   1 # A+ mov   $10 int  \ cursor visible again       
13      U pop   R pop   D pop   ' pause #) jmp   end-code          
14                                                                 
15 | : lineerase  ( line# -- )  0 (at blankline ;                  
Screen 7 not modified     
 0 \ Multitask (del scroll (cr (page                 ks 04 okt 87  
 1                                                                 
 2   : (del    (at? ?dup                                           
 3      IF  1- 2dup (at  bl (emit  (at exit  THEN  drop ;          
 4                                                                 
 5   Code scroll   D push   R push   U push                        
 6      u' area U D) W mov   u' catt W D) R+ mov                   
 7      u' ctop W D) D mov   D- C+ mov   0 # C- mov                
 8      ' c/row >body #) D- mov   D- dec   $601 # A mov            
 9      $10 int   U pop   R pop   D pop   Next                     
10   end-code                                                      
11                                                                 
12   : (cr     (at? drop 1+ dup cbot c@ u>                         
13      IF  scroll drop cbot c@  THEN  lineerase ;                 
14                                                                 
15   : (page   ctop c@ cbot c@ DO  I lineerase  -1 +LOOP ;         
Screen 8 not modified     
 0 \ Multitask status display                        ks 10 okt 87  
 1                                                                 
 2   ' (emit ' display   2 + !  ' (cr   ' display   4 + !          
 3   ' (type ' display   6 + !  ' (del  ' display   8 + !          
 4   ' (page ' display &10 + !                                     
 5   ' (at   ' display &12 + !  ' (at?  ' display &14 + !          
 6                                                                 
 7   : .base    base @ decimal  dup 2 .r  base ! ;                 
 8   : .sp      ( n -- )  ."  s" depth   swap 1+ - 2 .r ;          
 9   : (.drv    ( n -- )   Ascii A + emit ." : " ;                 
10   : .dr      ."   " drv (.drv ;                                 
11   : .scr     blk @ IF  ."   Blk" blk  ELSE  ."   Scr" scr  THEN 
12              @ 5 .r ;                                           
13   : .space   ."   Dic" s0 @ here $100 + - 6 u.r ;               
14                                                                 
15                                                                 
Screen 9 not modified     
 0 \ statuszeile                                 ks  ks 04 aug 87  
 1                                                                 
 2 | : fstat  ( n -- )   .base .sp                                 
 3      .space .scr .dr file? 2 spaces order ;                     
 4                                                                 
 5 | Area: statusline                                              
 6   statusline c/col 1- dup window page invers  terminal          
 7                                                                 
 8   : (.status   output @ display   area @ statusline             
 9      status @ IF  (at? drop 0 (at 2 fstat  blankline            
10               ELSE  normal page invers                          
11               THEN  area !  output ! ;                          
12   ' (.status Is .status                                         
13                                                                 
14   : bye  status off .status bye ;                               
15                                                                 
Screen 10 not modified     
 0                                                                 
 1                                                                 
 2                                                                 
 3                                                                 
 4                                                                 
 5                                                                 
 6                                                                 
 7                                                                 
 8                                                                 
 9                                                                 
10                                                                 
11                                                                 
12                                                                 
13                                                                 
14                                                                 
15                                                                 
Screen 11 not modified     
 0                                                                 
 1                                                                 
 2                                                                 
 3                                                                 
 4                                                                 
 5                                                                 
 6                                                                 
 7                                                                 
 8                                                                 
 9                                                                 
10                                                                 
11                                                                 
12                                                                 
13                                                                 
14                                                                 
15                                                                 
Screen 12 not modified     
 0                                                                 
 1                                                                 
 2                                                                 
 3                                                                 
 4                                                                 
 5                                                                 
 6                                                                 
 7                                                                 
 8                                                                 
 9                                                                 
10                                                                 
11                                                                 
12                                                                 
13                                                                 
14                                                                 
15                                                                 
Screen 13 not modified     
 0                                                                 
 1                                                                 
 2                                                                 
 3                                                                 
 4                                                                 
 5                                                                 
 6                                                                 
 7                                                                 
 8                                                                 
 9                                                                 
10                                                                 
11                                                                 
12                                                                 
13                                                                 
14                                                                 
15                                                                 
Screen 14 not modified     
 0                                                                 
 1                                                                 
 2                                                                 
 3                                                                 
 4                                                                 
 5                                                                 
 6                                                                 
 7                                                                 
 8                                                                 
 9                                                                 
10                                                                 
11                                                                 
12                                                                 
13                                                                 
14                                                                 
15                                                                 
Screen 15 not modified     
 0                                                                 
 1                                                                 
 2                                                                 
 3                                                                 
 4                                                                 
 5                                                                 
 6                                                                 
 7                                                                 
 8                                                                 
 9                                                                 
10                                                                 
11                                                                 
12                                                                 
13                                                                 
14                                                                 
15                                                                 
Screen 16 not modified     
 0                                                                 
 1                                                                 
 2                                                                 
 3                                                                 
 4                                                                 
 5                                                                 
 6                                                                 
 7                                                                 
 8                                                                 
 9                                                                 
10                                                                 
11                                                                 
12                                                                 
13                                                                 
14                                                                 
15                                                                 
Screen 17 not modified     
 0                                                                 
 1                                                                 
 2                                                                 
 3                                                                 
 4                                                                 
 5                                                                 
 6                                                                 
 7                                                                 
 8                                                                 
 9                                                                 
10                                                                 
11                                                                 
12                                                                 
13                                                                 
14                                                                 
15                                                                 
