Add the STR RPC to overlord and game code (#134)

* work in progress streaming rpc, simple test is working

* actually add the test

* debug windows failure

* windows fix maybe

* windows 2

* use str-load-status

* update types
This commit is contained in:
water111
2020-11-22 12:59:55 -05:00
committed by GitHub
parent 460ec874bb
commit 19b8bb81c9
27 changed files with 749 additions and 126 deletions
@@ -1,7 +1,38 @@
(start-test "game-text")
(let ((text (the game-text-info (load "$ISO/0TEST.TXT" *common-text-heap*))))
(defun hack-load ()
;(declare (inline))
(str-load "0TEST.TXT"
-1
(the pointer (align64 (-> *common-text-heap* current)))
; note, this max size is probably wrong because of the alignment.
(the int (&- (-> *common-text-heap* top) (-> *common-text-heap* current)))
)
(sync *load-str-rpc* '#t)
(let* ((got-length (new 'stack 'array 'int32 1))
(status (str-load-status got-length)))
;(format #t "Status is ~A, length ~D~%" status (-> got-length))
;; failed!
(if (!= status 'complete)
(return-from #f #f)
)
(link (the pointer (align64 (-> *common-text-heap* current)))
(-> "test" data)
(-> got-length)
*common-text-heap*
0
)
)
)
(let ((text (the game-text-info (hack-load))))
(format 0 "~I~%" text)
(expect-true (= #x123 (-> text data 0 id)))
(expect-true (= #x456 (-> text data 1 id)))