Documentation and mini fix for editor
This commit is contained in:
parent
2e1ca6192e
commit
c75698541a
2 changed files with 14 additions and 4 deletions
12
README.md
12
README.md
|
@ -1,3 +1,13 @@
|
||||||
# C64 Livecoding demo
|
# C64 Livecoding demo
|
||||||
|
|
||||||
WIP
|
Livecoding a Commodore 64 in a language compiled on a modern PC written via an editor running on a VT220.
|
||||||
|
|
||||||
|
## Editor
|
||||||
|
|
||||||
|
In a real hardware setup, the editor, which is integrated with the compiler, runs the show. In this setup, running it is simple. Running it interactively is almost as simple.
|
||||||
|
|
||||||
|
To first enter an environment in which the editor can be easily loaded, enter Lisp using the command `ros run -- --load asdf-paths.lisp`. Then load the editor by typing `(asdf:load-system "editor")`. The editor can now be started by typing `(editor:main "/dev/<the tty device>")` where `<the tty device>` is the terminal you wish to have the editor run on. This is most likely `/dev/ttyUSB0`, but may be something like `/dev/pts/3` if you're testing without a real VT220. **If the host program is likely to change during the editor process's life time**, add `:refresh-asm-functions-p t` to the call to `EDITOR::MAIN`, after the terminal path. This will ensure it reads the host program's listing before each compile to find the addresses of built-in functions.
|
||||||
|
|
||||||
|
The editor should now run. Keybindings will eventually be listed, but for now the source code is the canonical list of bindings.
|
||||||
|
|
||||||
|
The editor will, when the *compile* command is issued, perform a compilation, write statistics and IR to standard output, save both the source code and 6502 binary to the current working directory, then attempt to upload the code to the C64 via a serial device on `/dev/ttyACM0`. This path should ideally not change, but if the need arises, it can be changed simply be changing the variable `USC::*C64-TTY*`. In the event this transfer fails to begin, for example if the serial device is missing, a warning is printed to standard output, but the editor does not display anything. Saved files are unaffected by a failed transfer.
|
||||||
|
|
|
@ -8,16 +8,16 @@ open it, check which pts it's running on using \"ps\", run a command like
|
||||||
\"clear; while true; do sleep 1000;done\", then start the editor in another
|
\"clear; while true; do sleep 1000;done\", then start the editor in another
|
||||||
terminal giving the pts as a command-line parameter.~%"))
|
terminal giving the pts as a command-line parameter.~%"))
|
||||||
|
|
||||||
(defun main (&rest arguments)
|
(defun main (tty &key refresh-asm-functions-p)
|
||||||
(format t "C64 Livecoding editor, v~A~%"
|
(format t "C64 Livecoding editor, v~A~%"
|
||||||
#.(asdf:component-version (asdf:find-system '#:user-side-compiler)))
|
#.(asdf:component-version (asdf:find-system '#:user-side-compiler)))
|
||||||
(let ((tty (and (first arguments)
|
(let ((tty (probe-file tty)))
|
||||||
(probe-file (first arguments)))))
|
|
||||||
(unless tty
|
(unless tty
|
||||||
(batch-help)
|
(batch-help)
|
||||||
(abort))
|
(abort))
|
||||||
(let ((*terminal-path* tty))
|
(let ((*terminal-path* tty))
|
||||||
(make-editor))
|
(make-editor))
|
||||||
|
(setf *refresh-asm-functions-p* refresh-asm-functions-p)
|
||||||
(editor-loop)))
|
(editor-loop)))
|
||||||
|
|
||||||
(defun batch-main ()
|
(defun batch-main ()
|
||||||
|
|
Loading…
Add table
Reference in a new issue