Tiny Editor Compiles Itself. #437
Replies: 3 comments 3 replies
-
It's not too difficult to keep the screen from scrolling but it limits screen to 999 bytes. $d6 c@ 24 = $d3 c@ 39 = and over dup
$91 <> swap $9d <> and and if 2drop 0 From a Facebook discussion reference, Documented: 999 rem Cursor Blink on
1000 poke204,0
1004 rem loop for char
1005 ifpeek(198)=0then1005
1009 rem blink off
1010 poke204,1
1014 rem Was Last Curson Blink reverse?
1015 ifpeek(207)=0then1040
1019 rem Blink to non reverse
1020 poke207,0
1023 rem poke the address of the current line + Cursor Column
1024 rem on Current Line with Character Under Cursor
1025 poke(peek(210)*256+peek(209)+peek(211)),peek(206)
1030 rem likewise to color ram
1030 poke(peek(244)*256+peek(243)+peek(211)),peek(647)
1040 geta$:printa$;:goto1000 |
Beta Was this translation helpful? Give feedback.
-
To help myself understand this one too I rewrote parts of it and am now using it in a program of mine. I was able to make the keyboard interpreter rather simpler.
In include io
: ssave ( ... as before ... ) ;
: run dup ssave 999 evaluate quit ;
: x $d3 c@ ; : ?emit and emit ;
: y $d6 c@ ; : y24< y 24 < ;
: unblink 1 $cc c! $cf c@ if
0 $cf c! $ce c@ $d1 @ x + c! then ;
: t page begin
0 $cc c! key dup unblink case
$91 of emit endof \ up
$9d of emit endof \ left
$11 of y24< ?emit endof \ down
$0d of y24< ?emit endof \ return
$8d of drop here $ff + run endof \ sret
x 39 < y24< or ?emit endcase again ; To fix the insert-mode problem in my program I added the case
But it's less than satisfactory. |
Beta Was this translation helpful? Give feedback.
-
I believe I understand how to handle the screen editor without starting entirely from scratch. |
Beta Was this translation helpful? Give feedback.
-
It's not bullet-proof and doesn't account for graphics characters, but you can full screen edit one screen worth of code, and compile it with Shift-Return. A save to disk?
Beta Was this translation helpful? Give feedback.
All reactions