Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: replace local 'frame' with *np-frame* defvar in native notepat

SBCL save-lisp-and-die loses lexical bindings in unwind-protect
cleanup. Using a defvar ensures the variable is always bound.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+6 -6
+6 -6
fedac/native/cl/main.lisp
··· 352 352 (screen (fb-create sw sh)) 353 353 (graph (make-graph :fb screen :screen screen)) 354 354 (input (ac-native.input:input-init dw dh scale)) 355 - (audio (ac-native.audio:audio-init)) 356 - (frame 0)) 355 + (audio (ac-native.audio:audio-init))) 356 + (setf *np-frame* 0) 357 357 358 358 (format *error-output* "[notepat] ~Dx~D scale:~D → ~Dx~D~%" 359 359 dw dh scale sw sh) ··· 434 434 (setf *running* t) 435 435 (unwind-protect 436 436 (loop while *running* do 437 - (incf frame) 437 + (incf *np-frame*) 438 438 439 439 ;; FPS 440 440 (let ((now (monotonic-time-ms))) ··· 477 477 (when (eq type :key-down) 478 478 ;; ESC: triple-press to quit 479 479 (when (= code ac-native.input:+key-esc+) 480 - (when (> (- frame *esc-last-frame*) 90) (setf *esc-count* 0)) 480 + (when (> (- *np-frame* *esc-last-frame*) 90) (setf *esc-count* 0)) 481 481 (incf *esc-count*) 482 - (setf *esc-last-frame* frame) 482 + (setf *esc-last-frame* *np-frame*) 483 483 (when (and audio (< *esc-count* 3)) 484 484 (audio-synth audio :type 3 485 485 :tone (if (= *esc-count* 1) 440.0d0 660.0d0) ··· 747 747 (font-draw graph txt (- (floor sw 2) (floor (font-measure txt) 2)) 3))) 748 748 749 749 ;; Refresh IP every ~5 seconds 750 - (when (zerop (mod frame 300)) (refresh-ip)) 750 + (when (zerop (mod *np-frame* 300)) (refresh-ip)) 751 751 752 752 ;; ── Present ── 753 753 (ac-native.drm:drm-present display screen scale)