From 232e71ad5bc38a6f29264fe291d4940eca09381b Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Mon, 15 Nov 2021 22:55:43 -0500 Subject: [PATCH] fix actor compaction (#973) --- goal_src/engine/entity/relocate.gc | 4 ++-- goal_src/engine/level/level.gc | 1 - goal_src/kernel/gkernel-h.gc | 6 +----- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/goal_src/engine/entity/relocate.gc b/goal_src/engine/entity/relocate.gc index 216fbe089..60168113d 100644 --- a/goal_src/engine/entity/relocate.gc +++ b/goal_src/engine/entity/relocate.gc @@ -5,7 +5,7 @@ ;; name in dgo: relocate ;; dgos: GAME, ENGINE -;; DECOMP BEGINS +;; note: the while loop in this is changed to include a cast to basic. (defmethod relocate process ((obj process) (arg0 int)) (let ((v1-0 *kernel-context*)) @@ -85,7 +85,7 @@ (&+! (-> obj ppointer) arg0) ) ) - (let ((s4-0 (&+ (-> obj heap-base) 4))) + (let ((s4-0 (the basic (&+ (-> obj heap-base) 4)))) (while (< (the-as int s4-0) (the-as int (-> obj heap-cur))) (relocate s4-0 arg0) (&+! s4-0 (logand -16 (+ (asize-of s4-0) 15))) diff --git a/goal_src/engine/level/level.gc b/goal_src/engine/level/level.gc index 832393342..94f51075a 100644 --- a/goal_src/engine/level/level.gc +++ b/goal_src/engine/level/level.gc @@ -2120,7 +2120,6 @@ ;; before calling play, the C Kernel would set this. (define *kernel-boot-message* 'play) (load-package "game" global) - (set! *compact-actors* #f) (play #t #t) ) ) diff --git a/goal_src/kernel/gkernel-h.gc b/goal_src/kernel/gkernel-h.gc index 1ee9601c7..57ea84543 100644 --- a/goal_src/kernel/gkernel-h.gc +++ b/goal_src/kernel/gkernel-h.gc @@ -550,15 +550,11 @@ (defmacro suspend () ;; suspend the current process. `(rlet ((pp :reg r13 :reset-here #t)) - ;; we pass the current thread to the kernel with the pp register. - ;; so it should be backed up on the stack here. - (.push pp) ;; set to the current thread (set! pp (-> (the process pp) top-thread)) ;; call the suspend hook (put nothing as the argument) ((-> (the cpu-thread pp) suspend-hook) (the cpu-thread 0)) - ;; now we've been resumed, restore pp. - (.pop pp) + ;; the kernel will set pp (possibly to a new value) on resume. ) )