Skip to content

Commit

Permalink
renamed gfx ERASE=>PEN
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotlinski committed Apr 21, 2023
1 parent eccfb2f commit f675bd7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- #> (the pictured numeric output string buffer) now uses its own buffer, separate from HERE.
- Do not print "ok" while compiling. Makes it easier to re-enter multi-line word definitions in interpreter.
- Moved tests to a separate disk (tests.d64).
- gfx: Renamed ERASE to PEN.
### Removed
- GETC, 100/
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion forth/gfx.fs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ over negate err +!
then
repeat 2drop kernal-in ;

: erase if
: pen if
4d ['] xor else
d ['] or then ['] blitop @ !
['] blitop 2+ @ c! ;
Expand Down
8 changes: 4 additions & 4 deletions forth/gfxdemo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ dup 0 swap plot dup 13f swap line
a0 64 plot
dup 64 swap *cos a0 +
over 64 swap *sin 64 + line
1- repeat 1 erase loop
0 erase ;
1- repeat 1 pen loop
0 pen ;
hires erasecirc key drop lores

.( rotsqr..)
: rotsqr
hires 16 clrcol
8 d020 c! 1 erase
8 d020 c! 1 pen
2 0 do fa begin ?dup while
dup dup *cos a0 +
over dup *sin 64 + 2dup plot plot
Expand All @@ -120,7 +120,7 @@ dup dup *sin a0 +
over dup *cos 64 swap - line
dup dup *cos a0 +
over dup *sin 64 + line
5 - repeat loop 0 erase ;
5 - repeat loop 0 pen ;
hires rotsqr key drop lores

.( seascape..)
Expand Down
4 changes: 2 additions & 2 deletions manual/gfx.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ E.g. `15 clrcol` clears the screen with green background, white foreground.
((peek)) _( x y -- p )_ :: Get the pixel at _x_, _y_.
((line)) _( x y -- )_ :: Draw a line to _x_, _y_.
((circle)) _( x y r -- )_ :: Draw a circle with radius _r_ around _x_, _y_.
((erase)) _( mode -- )_ :: Change blit method for line drawing.
`1 erase` uses `xor` for line drawing, `0 erase` switches back to `or`.
((pen)) _( mode -- )_ :: Change line drawing method.
`1 pen` inverts color, `0 pen` switches back to normal mode.
((paint)) _( x y -- )_ :: Paint the area at _x_, _y_.
((text)) _( column row str strlen -- )_ :: Draw a text string at the given position.
E.g. `10 8 parse-name hallo text` draws the message `hallo` at column 16, row 8.
Expand Down

0 comments on commit f675bd7

Please sign in to comment.