Fix dumb mistake...

This commit is contained in:
ManDude 2021-08-16 04:04:04 +01:00
parent ff3174f292
commit 395f97a0c0
2 changed files with 20 additions and 4 deletions

View file

@ -32,7 +32,7 @@
(set! (-> *level* border?) #f)
(set! (-> *setting-control* default border-mode) #f)
(stop game-mode)
(let ((v1-3 (make-function-process *target-dead-pool* *target-pool* target 'target init-target cont)))
(let ((v1-3 (make-init-process *target-dead-pool* *target-pool* target 'target init-target cont)))
(if v1-3
(set! *target* (the target (-> v1-3 0 self)))
(set! *target* #f)

View file

@ -81,12 +81,28 @@ There are several ways to "go"
)
(defmacro make-function-process (dead-pool new-pool proc-type proc-name func &key (stack-size #x4000) &key (stack *kernel-dram-stack*) &rest args)
"Start a new process that runs a function on its main thread. Returns a pointer to the new process (or #f)."
"Start a new process that runs a function on its main thread.
Returns a pointer to the new process (or #f on error)."
(with-gensyms (new-proc)
`(let ((,new-proc (get-process ,dead-pool ,proc-type ,stack-size)))
`(let ((,new-proc (the-as ,proc-type (get-process ,dead-pool ,proc-type ,stack-size))))
(when ,new-proc
((method-of-type ,proc-type activate) (the-as ,proc-type ,new-proc) ,new-pool ,proc-name ,stack)
((method-of-type ,proc-type activate) ,new-proc ,new-pool ,proc-name ,stack)
(run-next-time-in-process ,new-proc ,func ,@args)
(-> ,new-proc ppointer)
)
)
)
)
(defmacro make-init-process (dead-pool new-pool proc-type proc-name func &key (stack-size #x4000) &key (stack *kernel-dram-stack*) &rest args)
"Start a new process and run an init function on it.
Returns a pointer to the new process, or #f (or is it 0?) if something goes wrong."
(with-gensyms (new-proc)
`(let ((,new-proc (the-as ,proc-type (get-process ,dead-pool ,proc-type ,stack-size))))
(when ,new-proc
((method-of-type ,proc-type activate) ,new-proc ,new-pool ,proc-name ,stack)
(run-now-in-process ,new-proc ,func ,@args)
(-> ,new-proc ppointer)
)