get DateTime working with chibi-scheme
This commit is contained in:
parent
c3886f44f2
commit
667fb36489
23
vm.scm
23
vm.scm
|
@ -29,12 +29,19 @@
|
|||
;; (vector-set! v 8 (not (= tz 0)))
|
||||
;; v))
|
||||
|
||||
;; ;; chibi scheme, invoke with ???
|
||||
;; (import (scheme base) (scheme bitwise) (scheme file))
|
||||
;; (import (chibi io) (chibi process))
|
||||
;; ;; chibi scheme, invoke with chibi-scheme vm.scm ROM ...
|
||||
;; (import (scheme base) (scheme bitwise) (scheme file) (scheme process-context))
|
||||
;; (import (chibi io) (chibi process) (chibi time))
|
||||
;; (define (get-u8 port) (read-u8 port))
|
||||
;; (define (open-rom path) (open-input-file path))
|
||||
;; (define (display s) (write-string s))
|
||||
;; (define display write-string)
|
||||
;; (define (command-line-arguments) (cdr (command-line)))
|
||||
;; (define (get-date-time)
|
||||
;; (let ((t (seconds->time (current-seconds))))
|
||||
;; (vector
|
||||
;; (time-second t) (time-minute t) (time-hour t)
|
||||
;; (time-day t) (+ (time-month t) 1) (+ (time-year t) 1900)
|
||||
;; (time-day-of-week t) (time-day-of-year t) (not (= (time-dst? t) 0)))))
|
||||
|
||||
;; ;; chez scheme, invoke with chezscheme --script vm.scm ROM ...
|
||||
;; (define (open-rom path) (open-file-input-port path))
|
||||
|
@ -246,8 +253,12 @@
|
|||
(u:debug-stack "WST" wst) (u:debug-stack "RST" rst))
|
||||
|
||||
(define (u:debug-stack label st)
|
||||
(display label)
|
||||
(u:debug-cells (cdr st) (u8 (- (car st) 8)) (car st) (current-output-port)))
|
||||
(let* ((cells (cdr st))
|
||||
(limit (car st))
|
||||
(i (u8 (- limit 8)))
|
||||
(port (current-output-port)))
|
||||
(display label port)
|
||||
(u:debug-cells cells i limit port)))
|
||||
|
||||
(define (u:debug-cells cells i limit port)
|
||||
(display (if (= i 0) "|" " ") port)
|
||||
|
|
Loading…
Reference in New Issue