Posted on 2024-02-27 10:03 lisp
this is another guru narration by kalman repi of lisp machine use, this time the goal is produce a cute hack to autoscroll a sheet of music
https://www.youtube.com/watch?v=sfgjL7EUHZ8
(si:login-to-sys-host) c-? Set X Keyboard Mapping + gives you previous repl input, but for commands it'll return lisp equivalent of command input (elsewhere reti uses + to set a variable after exploring its value, as in ,foo followed by (set + 'bar)) c-s-a arglist (storage:open-disk-stream (fs:parse-pathname"host:/disk1/VLM/fep0") :direction :block) ;block is r/w, lets you dynamically attach a fep a section on presentation system
(defun foo0 () (graphics::with-room-for-graphics (nil 6201) (graphics::draw-image kr2 0 0 :alu :flip))) ;alu flip draw b-on-w (defun scroll (&optional start limit increment) (loop for i from (or start 0) below (- (or limit (fourth (multiple-value-list (scl::send *terminal-io* :visible-cursorpos-limits)))) (scl::send *terminal-io* :height)) by (or increment 1) do (scl::send *terminal-io* :set-viewport-position 0 i))) (defun top-down-flip (bit-array) (let* ((dims (si:array-dimensions bit-array)) (height (first dims)) (width (second dims)) (new-bit-array (si:make-array dims :type (si::array-type bit-array)))) (loop for j below height for jj downfrom (1- height) do (loop for i below width do (setf (aref new-bit-array jj i) (aref bit-array j i)))) new-bit-array)) (defun playit1 (array &optional increment before-sleep after-sleep) (tv::with-notification-mode (:ignore) (cp::com-clear-output-history *terminal-io*) (graphics::with-room-for-graphics (nil (first (si:array-dimensions array))) (graphics::draw-image array 0 0 :alu :flip)) (loop repeat 14 do (terpri)) (let ((end (fourth (multiple-value-list (scl:send *terminal-io* :visible-cursor-limits))))) (time (progn (scl:send *terminal-io* :set-viewport-position 0 0) (sleep (or before-sleep 12)) (scroll 0 end (or increment 3)) (sleep (or after-sleep 35))))))) (defun foo1 () ;; preserves operations in history, so scrolling around will replay&block (graphics::with-room-for-graphics (nil 800) (loop for i below 500 do (send *standard-output* :bitblt tv:alu-seta 1300 800 kr32 0 i 0 (- (car (last (graphics::stream-transform *standard-output*))) 800))))) (defun foo2 () (graphics::with-room-for-graphics (nil 900) (loop repeat (or 200 (- 8192 900)) for i downfrom (- 8192 900) do (graphics::draw-image kr2 0 0 :image-top i :image-bottom (min 8192 (+ i 900))))))
C-S-a arglist on (scl:send ... :method) give arglist for method Read Image File C-mouse-l mark region m-w copy to kill ring (describe (accept'images::named-image)) (setq kr #|he clicks on color:data-array from describe, which is an array bit type|#) (setq kr2 (top-down-flip kr)) from debugger can :Load File ... he then loads a file called sddt-flattened, which lets him call an memory inspection function (si:sdddt). there's a definition for sddt in sys/in-house/sddt.lisp. gives help on Ü C-l in debugger show frame :detailed no :clear screen yes , in both repl and debugger is a way to enter individual value. no more (progn ...)! Start GC :Ephemeral No :Dynamic No stops gc (tv:notify nil "Hi!") time's storage system is always 0s on vlm, because there are shortcuts, storage is handled in vlm
Post a comment