;;-*-Lisp-*- (in-package goal) ;; name: memcard-h.gc ;; name in dgo: memcard-h ;; dgos: ENGINE, GAME ;; +++mc-status-code (defenum mc-status-code :type uint32 (busy 0) (ok 1) (bad-handle 2) (format-failed 3) (internal-error 4) (write-error 5) (read-error 6) (new-game 7) (no-memory 8) (no-card 9) (no-last 10) (no-format 11) (no-file 12) (no-save 13) (no-space 14) (bad-version 15) (no-process 16) (no-auto-save 17) ) ;; ---mc-status-code ;; DECOMP BEGINS (deftype mc-handle (int32) () ) (deftype mc-file-info (structure) ((present int32) (blind-data float 16 :offset 4) (blind-data-int8 int8 64 :overlay-at (-> blind-data 0)) (level-index int32 :overlay-at (-> blind-data 0)) (gem-count float :overlay-at (-> blind-data 1)) (skill-count float :overlay-at (-> blind-data 2)) (completion-percentage float :overlay-at (-> blind-data 3)) (minute uint8 :overlay-at (-> blind-data-int8 20)) (hour uint8 :overlay-at (-> blind-data-int8 21)) (week uint8 :overlay-at (-> blind-data-int8 22)) (day uint8 :overlay-at (-> blind-data-int8 23)) (month uint8 :overlay-at (-> blind-data-int8 24)) (year uint8 :overlay-at (-> blind-data-int8 25)) (game-time0 uint32 :overlay-at (-> blind-data 8)) (game-time1 uint32 :overlay-at (-> blind-data 9)) (secrets uint32 :overlay-at (-> blind-data 10)) (features uint32 :overlay-at (-> blind-data 11)) ) :pack-me ) (deftype mc-slot-info (structure) ((handle int32) (known int32) (formatted int32) (inited int32) (last-file int32) (mem-required int32) (mem-actual int32) (file mc-file-info 4 :inline) ) :pack-me ) (defun mc-sync () (let ((v0-0 0)) (while (zero? v0-0) (mc-run) (set! v0-0 (the-as int (mc-check-result))) ) v0-0 ) ) (defun show-mc-info ((arg0 dma-buffer)) (let ((s5-0 (new 'stack-no-clear 'mc-slot-info))) (dotimes (s4-0 2) (mc-get-slot-info s4-0 s5-0) (cond ((zero? (-> s5-0 known)) (format (clear *temp-string*) "SLOT ~D: EXAMINING SLOT~%" s4-0) *temp-string* ) ((zero? (-> s5-0 handle)) (format (clear *temp-string*) "SLOT ~D: NO CARD~%" s4-0) *temp-string* ) ((zero? (-> s5-0 formatted)) (format (clear *temp-string*) "SLOT ~D: CARD [~D] : NOT FORMATTED~%" s4-0 (-> s5-0 handle)) *temp-string* ) ((zero? (-> s5-0 inited)) (format (clear *temp-string*) "SLOT ~D: CARD [~D] : NO FILE [~D/~D]~%" s4-0 (-> s5-0 handle) (-> s5-0 mem-required) (-> s5-0 mem-actual) ) *temp-string* ) (else (format (clear *temp-string*) "SLOT ~D: CARD [~D] : " s4-0 (-> s5-0 handle)) *temp-string* (format *temp-string* "SAVES ~D ~D ~D ~D : LAST ~D~%" (-> s5-0 file 0 present) (-> s5-0 file 1 present) (-> s5-0 file 2 present) (-> s5-0 file 3 present) (-> s5-0 last-file) ) ) ) (draw-string-xy *temp-string* arg0 32 (+ (* 12 s4-0) 8) (font-color red) (font-flags shadow)) ) ) 0 (none) )