From 2e34514ee50726144e912eb3686f704a833dbdd0 Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Thu, 23 Mar 2023 01:15:07 +0000 Subject: [PATCH] [jak2] increase size of DMA buffers + potentially fix print buffer bug (#2398) The actor heap size was increased but not the DMA buffer because I forgot. --- game/kernel/jak2/kprint.cpp | 12 +++++++----- goal_src/jak2/engine/gfx/hw/display.gc | 13 +++++++++---- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/game/kernel/jak2/kprint.cpp b/game/kernel/jak2/kprint.cpp index 45f43abfca..2db8ffcd18 100644 --- a/game/kernel/jak2/kprint.cpp +++ b/game/kernel/jak2/kprint.cpp @@ -123,7 +123,7 @@ s32 format_impl_jak2(uint64_t* args) { } // read arguments - while ((u8)(format_ptr[1] - '0') < 10 || // number 0 to 10 + while ((u8)(format_ptr[1] - '0') < 10 || // number 0 to 9 format_ptr[1] == ',' || // comma format_ptr[1] == '\'' || // quote format_ptr[1] == '`' || // backtick @@ -538,10 +538,12 @@ s32 format_impl_jak2(uint64_t* args) { // change for Jak 2: if we are disk-booting and do a (format #t, immediately flush to stdout. // we'd get these eventually in ClearPending, but for some reason they flush these here. // This is nicer because we may crash in between here and flushing the print buffer. - // It's actually really annoying though so we disable it when in debug mode - if (DiskBoot && !MasterDebug) { - printf("%s", PrintPendingLocal3); - fflush(stdout); + if (DiskBoot) { + // It's actually really annoying when debugging though so we disable it then + if (!MasterDebug) { + printf("%s", PrintPendingLocal3); + fflush(stdout); + } PrintPending = make_ptr(PrintPendingLocal2).cast(); } diff --git a/goal_src/jak2/engine/gfx/hw/display.gc b/goal_src/jak2/engine/gfx/hw/display.gc index 9517ba2bfd..19cd011dd6 100644 --- a/goal_src/jak2/engine/gfx/hw/display.gc +++ b/goal_src/jak2/engine/gfx/hw/display.gc @@ -5,6 +5,11 @@ ;; name in dgo: display ;; dgos: ENGINE, GAME +;(defconstant DMA_BUFFER_GLOBAL_SIZE (* 1280 1024)) ;; 1280K +(defconstant DMA_BUFFER_GLOBAL_SIZE (* 1280 1024 PROCESS_HEAP_MULT)) ;; expand based on actor heap expansion +;(defconstant DMA_BUFFER_DEBUG_SIZE (* 8 1024 1024)) ;; 8M +(defconstant DMA_BUFFER_DEBUG_SIZE (* 12 1024 1024)) ;; expand to 12M because we can + ;; DECOMP BEGINS (defun get-current-time () @@ -69,11 +74,11 @@ (when (zero? (-> arg0 frames 0 calc-buf)) (set! (-> arg0 frames 0 calc-buf) (new 'global 'dma-buffer 10000)) (set! (-> arg0 frames 1 calc-buf) (new 'global 'dma-buffer 10000)) - (set! (-> arg0 frames 0 global-buf) (new 'global 'dma-buffer #x140000)) - (set! (-> arg0 frames 1 global-buf) (new 'global 'dma-buffer #x140000)) + (set! (-> arg0 frames 0 global-buf) (new 'global 'dma-buffer DMA_BUFFER_GLOBAL_SIZE)) + (set! (-> arg0 frames 1 global-buf) (new 'global 'dma-buffer DMA_BUFFER_GLOBAL_SIZE)) (when *debug-segment* - (set! (-> arg0 frames 0 debug-buf) (new 'debug 'dma-buffer #x800000)) - (set! (-> arg0 frames 1 debug-buf) (new 'debug 'dma-buffer #x800000)) + (set! (-> arg0 frames 0 debug-buf) (new 'debug 'dma-buffer DMA_BUFFER_DEBUG_SIZE)) + (set! (-> arg0 frames 1 debug-buf) (new 'debug 'dma-buffer DMA_BUFFER_DEBUG_SIZE)) ) ) arg0