mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-26 22:18:06 +11:00
Compare commits
No commits in common. "77aedd7338906505233adef30ca93ac194e769b4" and "f53f91558b43025fcdd15ba6c998f9d5b4708aa8" have entirely different histories.
77aedd7338
...
f53f91558b
2
blk/001
2
blk/001
@ -2,7 +2,7 @@ MASTER INDEX
|
|||||||
|
|
||||||
3 Usage 30 Dictionary
|
3 Usage 30 Dictionary
|
||||||
70 Implementation notes 100 Block editor
|
70 Implementation notes 100 Block editor
|
||||||
120 Visual Editor 150 Extra words
|
150 Extra words
|
||||||
200 Z80 assembler 260 Cross compilation
|
200 Z80 assembler 260 Cross compilation
|
||||||
280 Z80 boot code 350 Core words
|
280 Z80 boot code 350 Core words
|
||||||
410 PS/2 keyboard subsystem 420 Bootstrap guide
|
410 PS/2 keyboard subsystem 420 Bootstrap guide
|
||||||
|
2
blk/064
2
blk/064
@ -14,3 +14,5 @@ LOADR+ n1 n2 -- Relative ranged load.
|
|||||||
WIPE -- Empties current block
|
WIPE -- Empties current block
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
16
blk/120
16
blk/120
@ -1,16 +0,0 @@
|
|||||||
Visual Editor
|
|
||||||
|
|
||||||
This editor, unlike the Block Editor (B100), is grid-based
|
|
||||||
instead of being command-based. It requires the AT-XY, COLS
|
|
||||||
and LINES words to be implemented.
|
|
||||||
|
|
||||||
It is loaded with "125 LOAD" and invoked with "VE".
|
|
||||||
|
|
||||||
This editor uses 17 lines. The top line is the status line and
|
|
||||||
the 16 others are contents lines. The content shown is that
|
|
||||||
of the currently selected block.
|
|
||||||
|
|
||||||
All keystrokes are directly interpreted by VE and have the
|
|
||||||
effect described below.
|
|
||||||
|
|
||||||
(cont.)
|
|
16
blk/121
16
blk/121
@ -1,16 +0,0 @@
|
|||||||
Pressing a 0-9 digit accumulates that digit into what is named
|
|
||||||
the "modifier". That modifier affects the behavior of many
|
|
||||||
keystokes described below. The modifier starts at zero, but
|
|
||||||
most commands interpret a zero as a 1 so that they can have an
|
|
||||||
effect.
|
|
||||||
|
|
||||||
'G' selects the block specified by the modifier as the current
|
|
||||||
block. Any change madde to the previously selected block is
|
|
||||||
saved beforehand.
|
|
||||||
|
|
||||||
'[' and ']' advance the selected block by modifier.
|
|
||||||
|
|
||||||
';' resets the modifier
|
|
||||||
|
|
||||||
H and L move the cursor by "modifier" characters. J and K, by
|
|
||||||
lines.
|
|
14
blk/126
14
blk/126
@ -1,14 +0,0 @@
|
|||||||
CREATE CMD 2 C, '$' C, 0 C,
|
|
||||||
VARIABLE ACC
|
|
||||||
VARIABLE POS
|
|
||||||
: 0acc 0 ACC ! ;
|
|
||||||
: acc@ ACC @ 1 MAX 0acc ;
|
|
||||||
: num ACC @ SWAP _pdacc IF DROP ELSE ACC ! THEN ;
|
|
||||||
: nspcs ( n -- , spit n space ) 0 DO SPC LOOP ;
|
|
||||||
: aty 0 SWAP AT-XY ;
|
|
||||||
: clrln DUP aty COLS nspcs aty ;
|
|
||||||
: clrscr LINES 0 DO I clrln LOOP ;
|
|
||||||
: status 0 clrln ." BLK" SPC BLK> ? SPC ACC ?
|
|
||||||
SPC POS @ 64 /MOD . ',' EMIT . ;
|
|
||||||
: contents 1 aty BLK> @ LIST ;
|
|
||||||
: selblk BLK@ contents ;
|
|
15
blk/127
15
blk/127
@ -1,15 +0,0 @@
|
|||||||
: setpos POS @ 64 /MOD 1+ ( status line ) AT-XY ;
|
|
||||||
: pos+ POS @ + 1024 MOD POS ! ;
|
|
||||||
: cmv ( n -- , char movement ) acc@ * pos+ ;
|
|
||||||
: $; 0acc ;
|
|
||||||
: $G ACC @ selblk 0acc ;
|
|
||||||
: $[ BLK> @ acc@ - selblk ;
|
|
||||||
: $] BLK> @ acc@ + selblk ;
|
|
||||||
: $H -1 cmv ; : $L 1 cmv ; : $K -64 cmv ; : $J 64 cmv ;
|
|
||||||
: handle ( c -- f )
|
|
||||||
UPPER DUP '0' '9' =><= IF num 0 EXIT THEN
|
|
||||||
DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN
|
|
||||||
'Q' = ;
|
|
||||||
: VE clrscr 0acc 0 POS ! contents
|
|
||||||
BEGIN status setpos KEY handle UNTIL 18 aty ;
|
|
||||||
|
|
2
blk/158
2
blk/158
@ -1,2 +0,0 @@
|
|||||||
: LOWER DUP 'A' 'Z' =><= IF 32 + THEN ;
|
|
||||||
: UPPER DUP 'a' 'z' =><= IF 32 - THEN ;
|
|
1
blk/496
1
blk/496
@ -14,3 +14,4 @@ CODE @GET ( a -- c f )
|
|||||||
0x28 RSTn,
|
0x28 RSTn,
|
||||||
PUSHA, PUSHZ,
|
PUSHA, PUSHZ,
|
||||||
;CODE
|
;CODE
|
||||||
|
|
||||||
|
@ -54,10 +54,6 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
strncpy(buf+(blkid*1024)+(i*64), line, cnt-1);
|
strncpy(buf+(blkid*1024)+(i*64), line, cnt-1);
|
||||||
}
|
}
|
||||||
ssize_t cnt = getline(&line, &n, fp);
|
|
||||||
if (cnt > 0) {
|
|
||||||
fprintf(stderr, "blk %s has more than 16 lines\n", ep->d_name);
|
|
||||||
}
|
|
||||||
free(line);
|
free(line);
|
||||||
}
|
}
|
||||||
fwrite(buf, 1024, blkcnt, stdout);
|
fwrite(buf, 1024, blkcnt, stdout);
|
||||||
|
Loading…
Reference in New Issue
Block a user