mirror of
https://github.com/open-goal/jak-project
synced 2026-07-29 15:44:03 -04:00
[jak3] Work on getting the game loop running
This commit is contained in:
+16
-9
@@ -34,7 +34,7 @@ class Trie {
|
||||
int size() const { return m_size; }
|
||||
|
||||
// Get all objects starting with the given prefix.
|
||||
std::vector<T*> lookup_prefix(const std::string& str) const;
|
||||
std::vector<T*> lookup_prefix(const std::string& str, int max_count = -1) const;
|
||||
|
||||
// Get all nodes in the tree.
|
||||
std::vector<T*> get_all_nodes() const;
|
||||
@@ -119,25 +119,32 @@ class Trie {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void get_all_children(std::vector<T*>& result) const {
|
||||
bool get_all_children(std::vector<T*>& result, int max_count) const {
|
||||
if (value) {
|
||||
if (max_count >= 0 && result.size() >= (size_t)max_count) {
|
||||
return false;
|
||||
}
|
||||
result.push_back(value);
|
||||
}
|
||||
for (auto child : children) {
|
||||
if (child) {
|
||||
child->get_all_children(result);
|
||||
if (!child->get_all_children(result, max_count)) {
|
||||
// full
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<T*> lookup_prefix(const char* str) const {
|
||||
std::vector<T*> lookup_prefix(const char* str, int max_count) const {
|
||||
if (!*str) {
|
||||
std::vector<T*> result;
|
||||
get_all_children(result);
|
||||
get_all_children(result, max_count);
|
||||
return result;
|
||||
} else {
|
||||
if (children[idx(*str)]) {
|
||||
return children[idx(*str)]->lookup_prefix(str + 1);
|
||||
return children[idx(*str)]->lookup_prefix(str + 1, max_count);
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
@@ -178,13 +185,13 @@ T* Trie<T>::operator[](const std::string& str) {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
std::vector<T*> Trie<T>::lookup_prefix(const std::string& str) const {
|
||||
return m_root.lookup_prefix(str.c_str());
|
||||
std::vector<T*> Trie<T>::lookup_prefix(const std::string& str, int max_count) const {
|
||||
return m_root.lookup_prefix(str.c_str(), max_count);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
std::vector<T*> Trie<T>::get_all_nodes() const {
|
||||
std::vector<T*> result;
|
||||
m_root.get_all_children(result);
|
||||
m_root.get_all_children(result, -1);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -3534,7 +3534,7 @@
|
||||
:type int32
|
||||
(bucket0 0)
|
||||
(bucket1 1)
|
||||
(bucket2 2)
|
||||
(bucket2 2) ;; pc vis stuff
|
||||
(bucket3 3) ;; blit?
|
||||
(tex-lcom-sky-pre 4)
|
||||
(bucket5 5) ;; sky
|
||||
@@ -4187,7 +4187,7 @@
|
||||
(bucket582 582)
|
||||
(bucket583 583)
|
||||
(debug-no-zbuf2 584)
|
||||
(bucket585 585)
|
||||
(debug-menu 585)
|
||||
(bucket586 586)
|
||||
)
|
||||
|
||||
@@ -6645,11 +6645,14 @@
|
||||
(miptbp1 gs-miptbp :offset 32) ;;
|
||||
(clamp gs-clamp :offset 48) ;; gs-clamp
|
||||
(clamp-reg gs-reg64 :offset 56) ;;
|
||||
(alpha gs-alpha :offset 64) ;;
|
||||
(alpha gs-miptbp :offset 64) ;;
|
||||
(link-test link-test-flags :offset 8) ;; guessed by decompiler
|
||||
(texture-id texture-id :offset 24) ;; guessed by decompiler
|
||||
(next shader-ptr :offset 40) ;; guessed by decompiler
|
||||
;(alpha-as-miptb2 gs-miptbp :offset 64) ;; added!!
|
||||
(alpha-as-miptb2 gs-miptbp :offset 64)
|
||||
(reg-4-u32 gs-reg32 :offset 72)
|
||||
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x50
|
||||
@@ -6880,7 +6883,7 @@
|
||||
(alpha-near float :offset-assert 124)
|
||||
(alpha-far float :offset-assert 128)
|
||||
(alpha-delta float :offset-assert 132)
|
||||
(color uint32 :offset-assert 136)
|
||||
(color rgba :offset-assert 136)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x8c
|
||||
@@ -10808,7 +10811,7 @@
|
||||
(remove-setting (_type_ process symbol) none) ;; 12
|
||||
(kill-persister (_type_ engine-pers object) none) ;; 13
|
||||
(setting-control-method-14 (_type_ object) connectable) ;; 14
|
||||
(setting-control-method-15 (_type_ object) connectable) ;; 15
|
||||
(get-setting (_type_ object) connectable) ;; 15
|
||||
(remove-setting-by-arg0 (_type_ object) none) ;; 16
|
||||
(set-setting-by-param (_type_ symbol object object object) connection) ;; 17
|
||||
(apply-settings (_type_) user-setting-data) ;; 18
|
||||
@@ -11214,7 +11217,7 @@
|
||||
(sky-work-method-9 () none) ;; 9 ;; (init-sun-data! (_type_ int float float float) none)
|
||||
(sky-work-method-10 () none) ;; 10 ;; (init-orbit-settings! (_type_ int float float float float float float) none)
|
||||
(sky-work-method-11 () none) ;; 11 ;; (update-colors-for-time (_type_ float) none)
|
||||
(sky-work-method-12 () none) ;; 12 ;; (update-time-and-speed (_type_ float float) none)
|
||||
(update-time-and-speed (_type_ float float) none) ;; 12
|
||||
(sky-work-method-13 () none) ;; 13
|
||||
(draw (_type_) none) ;; 14 ;; (update-matrix (_type_ matrix) none)
|
||||
(sky-work-method-15 () none) ;; 15 ;; (update-template-colors (_type_) none)
|
||||
@@ -12487,7 +12490,7 @@
|
||||
|
||||
(deftype drawable-tree-array (drawable-group)
|
||||
"Collection of drawable trees. This might have a tfrag tree, tie tree, etc."
|
||||
()
|
||||
((trees drawable-tree :dynamic :offset 32 :score 100))
|
||||
:flag-assert #x1100000020
|
||||
)
|
||||
|
||||
@@ -24161,6 +24164,7 @@
|
||||
(color-count uint8 :offset 57)
|
||||
(texture-masks-index uint16 :offset 58)
|
||||
(generic generic-tfragment :offset 60)
|
||||
(generic-u32 uint32 :offset 60) ;; added
|
||||
)
|
||||
:method-count-assert 17
|
||||
:size-assert #x40
|
||||
@@ -31785,17 +31789,17 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define-extern time-of-day-effect (function none))
|
||||
(define-extern time-of-day-update (function none :behavior time-of-day-proc))
|
||||
(define-extern update-counters (function float :behavior time-of-day-proc))
|
||||
(define-extern time-of-day-update "Update particles, sky, and effect for time-of-day." (function none :behavior time-of-day-proc))
|
||||
(define-extern update-counters "Set hours, minutes, senonds based on current frame." (function float :behavior time-of-day-proc))
|
||||
(define-extern time-of-day-tick (state time-of-day-proc))
|
||||
(define-extern init-time-of-day (function object :behavior time-of-day-proc))
|
||||
(define-extern start-time-of-day (function (pointer time-of-day-proc)))
|
||||
(define-extern time-of-day-setup (function symbol symbol))
|
||||
(define-extern init-time-of-day "Initialize the time-of-day process" (function object :behavior time-of-day-proc))
|
||||
(define-extern start-time-of-day "Start a new time of day process, killing old one if needed." (function (pointer time-of-day-proc)))
|
||||
(define-extern time-of-day-setup "Check if the time of day ratio is set up or not. If arg0 = #t, then set it if needed." (function symbol symbol))
|
||||
(define-extern time-of-day-interp-colors (function (pointer rgba) uint mood-context none))
|
||||
(define-extern time-of-day-interp-colors-scratch (function (pointer rgba) time-of-day-palette mood-context none))
|
||||
(define-extern init-time-of-day-context (function time-of-day-context symbol))
|
||||
(define-extern set-filter-color! (function float float float none))
|
||||
(define-extern tod-madd! (function vector vector vector float))
|
||||
(define-extern init-time-of-day-context "Set up lighting data to defaults" (function time-of-day-context symbol))
|
||||
(define-extern set-filter-color! "Set RGB of filter." (function float float float none))
|
||||
(define-extern tod-madd! "Multiply-add" (function vector vector vector float))
|
||||
(define-extern update-environment-colors (function time-of-day-context vector))
|
||||
(define-extern update-time-of-day (function time-of-day-context none))
|
||||
(define-extern calc-fade-from-fog (function vector float))
|
||||
@@ -39153,6 +39157,7 @@
|
||||
)
|
||||
|#
|
||||
|
||||
(declare-type editable-player process-drawable)
|
||||
#|
|
||||
(deftype editable-player (process-drawable)
|
||||
((current editable-array :offset-assert 200) ;; guessed by decompiler
|
||||
@@ -39210,7 +39215,7 @@
|
||||
;; (define-extern editable-command->string function) ;; (function editable-command string)
|
||||
;; (define-extern editable-filter->string function) ;; (function editable-filter basic string)
|
||||
;; (define-extern *editable-work* object) ;; editable-work
|
||||
;; (define-extern *editable* object) ;; (pointer editable-player)
|
||||
(define-extern *editable* object) ;; (pointer editable-player)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; editable ;;
|
||||
@@ -39240,7 +39245,7 @@
|
||||
;; (define-extern editable-player-init function) ;; (function symbol none :behavior editable-player)
|
||||
;; (define-extern set-editable-name function)
|
||||
;; (define-extern select-editable-by-name function)
|
||||
;; (define-extern *editable-menu-context* object) ;; debug-menu-context
|
||||
(define-extern *editable-menu-context* debug-menu-context)
|
||||
;; (define-extern editable-menu-command function) ;; (function int none)
|
||||
;; (define-extern editable-menu-command-no-close function) ;; (function int none)
|
||||
;; (define-extern dm-region-tree-pick-func function) ;; (function symbol debug-menu-msg symbol)
|
||||
@@ -39821,8 +39826,8 @@
|
||||
;; (define-extern *continue-bug-report* continue-point)
|
||||
;; (define-extern *bug-report* object)
|
||||
;; (define-extern bug-report-init function)
|
||||
;; (define-extern bug-report-stop function)
|
||||
;; (define-extern bug-report-start function)
|
||||
(define-extern bug-report-stop (function none))
|
||||
(define-extern bug-report-start (function none))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; sampler ;;
|
||||
@@ -39839,47 +39844,47 @@
|
||||
;; default-menu ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; (define-extern *debug-menu-context* object) ;; debug-menu-context
|
||||
;; (define-extern *dm-cam-mode-interpolation* object) ;; int
|
||||
;; (define-extern dm-cam-mode-func function) ;; (function (state camera-slave) debug-menu-msg object)
|
||||
;; (define-extern dm-cam-mode-default function) ;; (function object debug-menu-msg symbol)
|
||||
;; (define-extern dm-cam-settings-default function) ;; (function object debug-menu-msg symbol)
|
||||
;; (define-extern dm-cam-settings-func function) ;; (function int debug-menu-msg symbol)
|
||||
;; (define-extern dm-cam-settings-func-int function) ;; (function int debug-menu-msg int int int)
|
||||
;; (define-extern dm-cam-externalize function) ;; (function symbol debug-menu-msg symbol)
|
||||
;; (define-extern dm-cam-setting-float function) ;; (function float debug-menu-msg float float float)
|
||||
;; (define-extern dm-cam-render-float function) ;; (function int debug-menu-msg float float float)
|
||||
;; (define-extern dm-subdiv-float function) ;; (function symbol debug-menu-msg float float float)
|
||||
(define-extern *debug-menu-context* debug-menu-context)
|
||||
(define-extern *dm-cam-mode-interpolation* int)
|
||||
(define-extern dm-cam-mode-func (function (state camera-slave) debug-menu-msg object))
|
||||
(define-extern dm-cam-mode-default (function object debug-menu-msg symbol))
|
||||
(define-extern dm-cam-settings-default (function object debug-menu-msg symbol))
|
||||
(define-extern dm-cam-settings-func (function int debug-menu-msg symbol))
|
||||
(define-extern dm-cam-settings-func-int (function int debug-menu-msg int int int))
|
||||
(define-extern dm-cam-externalize (function symbol debug-menu-msg symbol))
|
||||
(define-extern dm-cam-setting-float (function float debug-menu-msg float float float))
|
||||
(define-extern dm-cam-render-float (function int debug-menu-msg float float float))
|
||||
(define-extern dm-subdiv-float (function symbol debug-menu-msg float float float))
|
||||
;; (define-extern dm-subdiv-int function) ;; (function symbol debug-menu-msg int int int)
|
||||
;; (define-extern dm-select-race-path function) ;; (function object debug-menu-msg int int)
|
||||
;; (define-extern dm-setting-language function) ;; (function int debug-menu-msg symbol)
|
||||
;; (define-extern dm-setting-subtitle-language function) ;; (function int debug-menu-msg symbol)
|
||||
;; (define-extern dm-setting-audio-language function)
|
||||
;; (define-extern dm-setting-stereo-mode function) ;; (function object debug-menu-msg symbol)
|
||||
;; (define-extern dm-current-continue function) ;; (function string debug-menu-msg symbol)
|
||||
;; (define-extern dm-subdiv-draw-func function) ;; (function int debug-menu-msg symbol)
|
||||
;; (define-extern dm-scissor-subdiv-draw-func function) ;; (function int debug-menu-msg symbol)
|
||||
;; (define-extern dm-foreground-subdiv-draw-func function) ;; (function int debug-menu-msg symbol)
|
||||
;; (define-extern dm-col-rend-on-func function) ;; (function object debug-menu-msg symbol)
|
||||
;; (define-extern dm-col-rend-outline-func function) ;; (function object debug-menu-msg symbol)
|
||||
;; (define-extern dm-col-rend-back-face-func function) ;; (function object debug-menu-msg symbol)
|
||||
;; (define-extern dm-col-rend-normals-func function) ;; (function object debug-menu-msg symbol)
|
||||
;; (define-extern dm-col-rend-ghost-hidden-func function) ;; (function object debug-menu-msg symbol)
|
||||
;; (define-extern dm-col-rend-track-func function) ;; (function int debug-menu-msg symbol)
|
||||
;; (define-extern dm-col-rend-show-only-toggle-func function) ;; (function uint debug-menu-msg symbol)
|
||||
;; (define-extern dm-col-rend-show-only-set-func function) ;; (function uint debug-menu-msg symbol)
|
||||
;; (define-extern dm-col-rend-cspec-toggle function) ;; (function uint debug-menu-msg symbol)
|
||||
;; (define-extern dm-col-rend-size function) ;; (function object debug-menu-msg float float)
|
||||
;; (define-extern dm-col-rend-cam-dist function) ;; (function object debug-menu-msg float float)
|
||||
;; (define-extern dm-ocean-height-func function) ;; (function ocean-height-hack debug-menu-msg symbol)
|
||||
;; (define-extern dm-ocean-subdiv-draw-func function) ;; (function object debug-menu-msg symbol)
|
||||
;; (define-extern dm-time-of-day-func function) ;; (function dm-time-of-day-setting debug-menu-msg symbol)
|
||||
;; (define-extern dm-time-of-day-func2 function) ;; (function symbol debug-menu-msg object)
|
||||
;; (define-extern dm-time-of-day-palette-func function) ;; (function dm-time-of-day-palette-settings debug-menu-msg symbol)
|
||||
;; (define-extern dm-boolean-toggle-pick-func function) ;; (function symbol debug-menu-msg object)
|
||||
;; (define-extern dm-time-of-day-pick-func function) ;; (function symbol debug-menu-msg symbol)
|
||||
;; (define-extern dm-stats-memory-func function) ;; (function int debug-menu-msg symbol)
|
||||
;; (define-extern dm-actor-marks-pick-func function) ;; (function symbol debug-menu-msg symbol)
|
||||
(define-extern dm-select-race-path (function object debug-menu-msg int int))
|
||||
(define-extern dm-setting-language (function int debug-menu-msg symbol))
|
||||
(define-extern dm-setting-subtitle-language (function int debug-menu-msg symbol))
|
||||
(define-extern dm-setting-audio-language (function int debug-menu-msg symbol))
|
||||
(define-extern dm-setting-stereo-mode (function object debug-menu-msg symbol))
|
||||
(define-extern dm-current-continue (function string debug-menu-msg symbol))
|
||||
(define-extern dm-subdiv-draw-func (function int debug-menu-msg symbol))
|
||||
(define-extern dm-scissor-subdiv-draw-func (function int debug-menu-msg symbol))
|
||||
(define-extern dm-foreground-subdiv-draw-func (function int debug-menu-msg symbol))
|
||||
(define-extern dm-col-rend-on-func (function object debug-menu-msg symbol))
|
||||
(define-extern dm-col-rend-outline-func (function object debug-menu-msg symbol))
|
||||
(define-extern dm-col-rend-back-face-func (function object debug-menu-msg symbol))
|
||||
(define-extern dm-col-rend-normals-func (function object debug-menu-msg symbol))
|
||||
(define-extern dm-col-rend-ghost-hidden-func (function object debug-menu-msg symbol))
|
||||
(define-extern dm-col-rend-track-func (function int debug-menu-msg symbol))
|
||||
(define-extern dm-col-rend-show-only-toggle-func (function uint debug-menu-msg symbol))
|
||||
(define-extern dm-col-rend-show-only-set-func (function uint debug-menu-msg symbol))
|
||||
(define-extern dm-col-rend-cspec-toggle (function uint debug-menu-msg symbol))
|
||||
(define-extern dm-col-rend-size (function object debug-menu-msg float float))
|
||||
(define-extern dm-col-rend-cam-dist (function object debug-menu-msg float float))
|
||||
;; (define-extern dm-ocean-height-func (function ocean-height-hack debug-menu-msg symbol))
|
||||
(define-extern dm-ocean-subdiv-draw-func (function object debug-menu-msg symbol))
|
||||
(define-extern dm-time-of-day-func (function int debug-menu-msg symbol))
|
||||
(define-extern dm-time-of-day-func2 (function symbol debug-menu-msg object))
|
||||
(define-extern dm-time-of-day-palette-func (function int debug-menu-msg symbol))
|
||||
(define-extern dm-boolean-toggle-pick-func (function symbol debug-menu-msg object))
|
||||
(define-extern dm-time-of-day-pick-func (function symbol debug-menu-msg symbol))
|
||||
(define-extern dm-stats-memory-func (function int debug-menu-msg symbol))
|
||||
(define-extern dm-actor-marks-pick-func (function symbol debug-menu-msg symbol))
|
||||
;; (define-extern dm-debug-actor-lod-dist function)
|
||||
;; (define-extern dm-select-race-pick-func function) ;; (function int debug-menu-msg symbol)
|
||||
;; (define-extern dm-compact-actor-pick-func function) ;; (function symbol debug-menu-msg symbol)
|
||||
@@ -39909,36 +39914,36 @@
|
||||
;; (define-extern dm-bug-report-report-pick-func function) ;; (function symbol debug-menu-msg none)
|
||||
;; (define-extern debug-menu-node<? function) ;; (function debug-menu-node debug-menu-node symbol)
|
||||
;; (define-extern dm-shader-pick-func function) ;; (function texture-id debug-menu-msg symbol)
|
||||
;; (define-extern *shader-pick-menu* object) ;; debug-menu
|
||||
(define-extern *shader-pick-menu* debug-menu)
|
||||
;; (define-extern build-shader-list function) ;; (function none)
|
||||
;; (define-extern dm-instance-pick-func function) ;; (function string debug-menu-msg basic)
|
||||
;; (define-extern dm-enable-instance-func function) ;; (function string debug-menu-msg symbol)
|
||||
;; (define-extern *instance-shrub-menu* object) ;; debug-menu
|
||||
;; (define-extern *instance-tie-menu* object) ;; debug-menu
|
||||
;; (define-extern *enable-instance-shrub-menu* object) ;; debug-menu
|
||||
;; (define-extern *enable-instance-tie-menu* object) ;; debug-menu
|
||||
(define-extern *instance-shrub-menu* debug-menu)
|
||||
(define-extern *instance-tie-menu* debug-menu)
|
||||
(define-extern *enable-instance-shrub-menu* symbol) ;; debug-menu
|
||||
(define-extern *enable-instance-tie-menu* symbol) ;; debug-menu
|
||||
;; (define-extern build-instance-list function) ;; (function object none)
|
||||
;; (define-extern dm-scene-load-pick-func function) ;; (function pair debug-menu-msg symbol)
|
||||
;; (define-extern debug-create-cam-restore function) ;; (function none)
|
||||
;; (define-extern debug-menu-make-camera-mode-menu function) ;; (function debug-menu debug-menu debug-menu-node)
|
||||
;; (define-extern debug-menu-make-camera-menu function) ;; (function debug-menu-context debug-menu-item-submenu)
|
||||
;; (define-extern debug-menu-make-shader-menu function) ;; (function debug-menu-context debug-menu-item-submenu)
|
||||
;; (define-extern debug-menu-make-instance-menu function) ;; (function debug-menu-context debug-menu-item-submenu)
|
||||
(define-extern debug-menu-make-camera-menu (function debug-menu-context debug-menu-item-submenu))
|
||||
(define-extern debug-menu-make-shader-menu (function debug-menu-context debug-menu-item-submenu))
|
||||
(define-extern debug-menu-make-instance-menu (function debug-menu-context debug-menu-item-submenu))
|
||||
;; (define-extern dm-task-menu-pick-func function) ;; (function game-task debug-menu-msg symbol)
|
||||
;; (define-extern debug-menu-make-continue-sub-menu function) ;; (function game-info symbol pair)
|
||||
(define-extern debug-menu-make-continue-sub-menu (function game-info symbol pair))
|
||||
;; (define-extern debug-menu-make-task-sub-menu function) ;; (function symbol pair)
|
||||
;; (define-extern debug-menu-make-task-menu function) ;; (function debug-menu-context debug-menu-item-submenu)
|
||||
(define-extern debug-menu-make-task-menu (function debug-menu-context debug-menu-item-submenu))
|
||||
;; (define-extern dm-play-task-with-continue function) ;; (function game-task string none)
|
||||
;; (define-extern dm-play-task function) ;; (function game-task none)
|
||||
;; (define-extern dm-play-race function) ;; (function race-selection symbol none)
|
||||
;; (define-extern debug-menu-make-play-menu function) ;; (function debug-menu-context debug-menu-node)
|
||||
(define-extern debug-menu-make-play-menu (function debug-menu-context debug-menu-node))
|
||||
;; (define-extern dm-anim-tester-flag-func function) ;; (function int debug-menu-msg symbol)
|
||||
;; (define-extern dm-anim-tester-func function) ;; (function int debug-menu-msg symbol)
|
||||
;; (define-extern dm-pilot-mode function) ;; (function object none)
|
||||
;; (define-extern stop-watch-display function) ;; (function object object symbol)
|
||||
;; (define-extern debug-menu-context-make-default-menus function) ;; (function debug-menu-context debug-menu-context)
|
||||
;; (define-extern *popup-menu-context* object) ;; debug-menu-context
|
||||
;; (define-extern popup-menu-context-make-default-menus function) ;; (function debug-menu-context debug-menu-context)
|
||||
(define-extern debug-menu-context-make-default-menus (function debug-menu-context debug-menu-context))
|
||||
(define-extern *popup-menu-context* debug-menu-context)
|
||||
(define-extern popup-menu-context-make-default-menus (function debug-menu-context debug-menu-context))
|
||||
(define-extern menu-respond-to-pause (function symbol))
|
||||
;; (define-extern *menu-hook* function) ;; (function debug-menu-context)
|
||||
|
||||
@@ -40091,7 +40096,7 @@
|
||||
;; texture-upload ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; (define-extern *generic-envmap-texture* object) ;; texture
|
||||
(define-extern *generic-envmap-texture* texture)
|
||||
(define-extern *default-envmap-shader* adgif-shader)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
@@ -152,7 +152,50 @@
|
||||
],
|
||||
"default-menu": [
|
||||
[3, "(function none)"],
|
||||
[4, "(function none)"]
|
||||
[4, "(function none)"],
|
||||
[5, "(function none)"],
|
||||
[6, "(function none)"],
|
||||
[7, "(function int debug-menu-msg none)"],
|
||||
[8, "(function none)"],
|
||||
[9, "(function none)"],
|
||||
[10, "(function none)"],
|
||||
[11, "(function none)"],
|
||||
[12, "(function none)"],
|
||||
[13, "(function none)"],
|
||||
[14, "(function none)"],
|
||||
[15, "(function none)"],
|
||||
[16, "(function none)"],
|
||||
[17, "(function none)"],
|
||||
[18, "(function none)"],
|
||||
[20, "(function none)"],
|
||||
[21, "(function none)"],
|
||||
[22, "(function none)"],
|
||||
[23, "(function none)"],
|
||||
[24, "(function none)"],
|
||||
[25, "(function none)"],
|
||||
[26, "(function none)"],
|
||||
[27, "(function int debug-menu-msg float none)"],
|
||||
[28, "(function int debug-menu-msg float none)"],
|
||||
[29, "(function none)"],
|
||||
[30, "(function int debug-menu-msg float none)"],
|
||||
[31, "(function int debug-menu-msg float none)"],
|
||||
[32, "(function int debug-menu-msg float none)"],
|
||||
[33, "(function int debug-menu-msg float none)"],
|
||||
[34, "(function none)"],
|
||||
[35, "(function none)"],
|
||||
[36, "(function int debug-menu-msg float none)"],
|
||||
[37, "(function int debug-menu-msg float none)"],
|
||||
[38, "(function int debug-menu-msg float none)"],
|
||||
[39, "(function int debug-menu-msg float none)"],
|
||||
[40, "(function none)"],
|
||||
[41, "(function none)"],
|
||||
[42, "(function int debug-menu-msg float none)"],
|
||||
[43, "(function int debug-menu-msg float none)"],
|
||||
[44, "(function int debug-menu-msg float none)"],
|
||||
[45, "(function int debug-menu-msg float none)"],
|
||||
[46, "(function int debug-menu-msg float none)"],
|
||||
[47, "(function int debug-menu-msg float none)"],
|
||||
[48, "(function int debug-menu-msg float none)"]
|
||||
],
|
||||
"enemy-states": [[38, "(function object :behavior enemy)"]],
|
||||
"scene-actor": [
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
//"CGO/ART.CGO",
|
||||
"CGO/KERNEL.CGO",
|
||||
// "CGO/ENGINE.CGO",
|
||||
"CGO/GAME.CGO"
|
||||
"CGO/GAME.CGO",
|
||||
// "CGO/COMMON.CGO",
|
||||
// "DGO/LJKDMPK.DGO",
|
||||
// "DGO/LBBSDRP1.DGO",
|
||||
@@ -188,7 +188,7 @@
|
||||
// "DGO/DESC.DGO",
|
||||
// "DGO/LDAMPECK.DGO",
|
||||
// "DGO/LJAKSIG.DGO",
|
||||
// "DGO/HALFPIPE.DGO",
|
||||
"DGO/HALFPIPE.DGO"
|
||||
// "DGO/DESRACE1.DGO",
|
||||
// "DGO/SEN.DGO",
|
||||
// "DGO/TEMP.DGO",
|
||||
|
||||
@@ -711,7 +711,7 @@
|
||||
[
|
||||
617,
|
||||
"s0",
|
||||
"(function symbol symbol continue-point game-save resetter-spec none :behavior process)"
|
||||
"(function cpu-thread function symbol symbol continue-point game-save resetter-spec none)"
|
||||
]
|
||||
],
|
||||
"(method 9 lod-set)": [["_stack_", 16, "res-tag"]],
|
||||
@@ -3561,5 +3561,11 @@
|
||||
[92, "a0", "connection"],
|
||||
[93, "a0", "collide-shape"]
|
||||
],
|
||||
"(trans charging gun-red-2-shockwave)": [[6, "a1", "process-drawable"]]
|
||||
"(trans charging gun-red-2-shockwave)": [[6, "a1", "process-drawable"]],
|
||||
"command-get-float": [
|
||||
[20, "gp", "bfloat"]
|
||||
],
|
||||
"command-get-int": [
|
||||
[17, "gp", "bfloat"]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@ void BlitDisplays::init_textures(TexturePool& texture_pool, GameVersion version)
|
||||
case GameVersion::Jak2:
|
||||
tbp = 0x3300;
|
||||
break;
|
||||
case GameVersion::Jak3:
|
||||
tbp = 0x3300; // assuming this for now...
|
||||
break;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
@@ -129,10 +129,83 @@ void OpenGLRenderer::init_bucket_renderers_jak3() {
|
||||
using namespace jak3;
|
||||
m_bucket_renderers.resize((int)BucketId::MAX_BUCKETS);
|
||||
m_bucket_categories.resize((int)BucketId::MAX_BUCKETS, BucketCategory::OTHER);
|
||||
|
||||
std::shared_ptr<TextureAnimator> texture_animator = nullptr; // todo tex anim
|
||||
{
|
||||
auto p = scoped_prof("render-inits");
|
||||
// for now, for any unset renderers, just set them to an EmptyBucketRenderer.
|
||||
|
||||
m_blit_displays =
|
||||
init_bucket_renderer<BlitDisplays>("blit", BucketCategory::OTHER, BucketId::BLIT_START);
|
||||
|
||||
// 4
|
||||
init_bucket_renderer<TextureUploadHandler>("tex-lcom-sky-pre", BucketCategory::TEX,
|
||||
BucketId::TEX_LCOM_SKY_PRE, texture_animator);
|
||||
|
||||
// 10
|
||||
for (int i = 0; i < LEVEL_MAX; i++) {
|
||||
#define GET_BUCKET_ID_FOR_LIST(bkt1, bkt2, idx) ((int)(bkt1) + ((int)(bkt2) - (int)(bkt1)) * (idx))
|
||||
init_bucket_renderer<TextureUploadHandler>(
|
||||
fmt::format("tex-l{}-tfrag", i), BucketCategory::TEX,
|
||||
GET_BUCKET_ID_FOR_LIST(BucketId::TEX_L0_TFRAG, BucketId::TEX_L1_TFRAG, i),
|
||||
texture_animator);
|
||||
}
|
||||
|
||||
// 340
|
||||
init_bucket_renderer<TextureUploadHandler>("tex-lcom-tfrag", BucketCategory::TEX,
|
||||
BucketId::TEX_LCOM_TFRAG, texture_animator);
|
||||
// 345
|
||||
init_bucket_renderer<TextureUploadHandler>("tex-lcom-shrub", BucketCategory::TEX,
|
||||
BucketId::TEX_LCOM_SHRUB, texture_animator);
|
||||
// 351
|
||||
for (int i = 0; i < LEVEL_MAX; i++) {
|
||||
#define GET_BUCKET_ID_FOR_LIST(bkt1, bkt2, idx) ((int)(bkt1) + ((int)(bkt2) - (int)(bkt1)) * (idx))
|
||||
init_bucket_renderer<TextureUploadHandler>(
|
||||
fmt::format("tex-l{}-pris", i), BucketCategory::TEX,
|
||||
GET_BUCKET_ID_FOR_LIST(BucketId::TEX_L0_PRIS, BucketId::TEX_L1_PRIS, i),
|
||||
texture_animator);
|
||||
}
|
||||
|
||||
// 401
|
||||
init_bucket_renderer<TextureUploadHandler>("tex-lcom-pris", BucketCategory::TEX,
|
||||
BucketId::TEX_LCOM_PRIS, texture_animator);
|
||||
|
||||
// 461
|
||||
init_bucket_renderer<TextureUploadHandler>("tex-lcom-sky-post", BucketCategory::TEX,
|
||||
BucketId::TEX_LCOM_SKY_POST, texture_animator);
|
||||
|
||||
// 463
|
||||
for (int i = 0; i < LEVEL_MAX; i++) {
|
||||
#define GET_BUCKET_ID_FOR_LIST(bkt1, bkt2, idx) ((int)(bkt1) + ((int)(bkt2) - (int)(bkt1)) * (idx))
|
||||
init_bucket_renderer<TextureUploadHandler>(
|
||||
fmt::format("tex-l{}-water", i), BucketCategory::TEX,
|
||||
GET_BUCKET_ID_FOR_LIST(BucketId::TEX_L0_WATER, BucketId::TEX_L1_WATER, i),
|
||||
texture_animator);
|
||||
}
|
||||
|
||||
// 563
|
||||
init_bucket_renderer<TextureUploadHandler>("tex-lcom-water", BucketCategory::TEX,
|
||||
BucketId::TEX_LCOM_WATER, texture_animator);
|
||||
|
||||
// 568
|
||||
init_bucket_renderer<TextureUploadHandler>("tex-sprite", BucketCategory::TEX,
|
||||
BucketId::TEX_SPRITE, texture_animator);
|
||||
// 575
|
||||
init_bucket_renderer<TextureUploadHandler>("tex-warp", BucketCategory::TEX, BucketId::TEX_WARP,
|
||||
texture_animator);
|
||||
|
||||
// 578
|
||||
init_bucket_renderer<TextureUploadHandler>("tex-hud-hud-alpha", BucketCategory::TEX,
|
||||
BucketId::TEX_HUD_HUD_ALPHA, texture_animator);
|
||||
|
||||
// init_bucket_renderer<TextureUploadHandler>("tex-hud-hud-alpha", BucketCategory::TEX,
|
||||
// BucketId::TEX_HUD_HUD_ALPHA, texture_animator);
|
||||
|
||||
// 584
|
||||
init_bucket_renderer<DirectRenderer>("debug-no-zbuf2", BucketCategory::OTHER,
|
||||
BucketId::DEBUG_NO_ZBUF2, 0x8000);
|
||||
init_bucket_renderer<DirectRenderer>("debug-menu", BucketCategory::OTHER, BucketId::DEBUG_MENU,
|
||||
0x8000);
|
||||
|
||||
// for any unset renderers, just set them to an EmptyBucketRenderer.
|
||||
for (size_t i = 0; i < m_bucket_renderers.size(); i++) {
|
||||
if (!m_bucket_renderers[i]) {
|
||||
init_bucket_renderer<EmptyBucketRenderer>(fmt::format("bucket-{}", i),
|
||||
@@ -1083,6 +1156,43 @@ void OpenGLRenderer::dispatch_buckets_jak2(DmaFollower dma,
|
||||
// TODO ending data.
|
||||
}
|
||||
|
||||
void OpenGLRenderer::dispatch_buckets_jak3(DmaFollower dma,
|
||||
ScopedProfilerNode& prof,
|
||||
bool sync_after_buckets) {
|
||||
// The first thing the DMA chain should be a call to a common default-registers chain.
|
||||
// this chain resets the state of the GS. After this is buckets
|
||||
m_category_times.fill(0);
|
||||
|
||||
m_render_state.buckets_base = dma.current_tag_offset(); // starts at 0 in jak 2
|
||||
m_render_state.next_bucket = m_render_state.buckets_base + 16;
|
||||
m_render_state.bucket_for_vis_copy = (int)jak3::BucketId::BUCKET_2;
|
||||
m_render_state.num_vis_to_copy = jak3::LEVEL_MAX;
|
||||
|
||||
for (size_t bucket_id = 0; bucket_id < m_bucket_renderers.size(); bucket_id++) {
|
||||
auto& renderer = m_bucket_renderers[bucket_id];
|
||||
auto bucket_prof = prof.make_scoped_child(renderer->name_and_id());
|
||||
g_current_renderer = renderer->name_and_id();
|
||||
// lg::info("Render: {} start", g_current_renderer);
|
||||
renderer->render(dma, &m_render_state, bucket_prof);
|
||||
if (sync_after_buckets) {
|
||||
auto pp = scoped_prof("finish");
|
||||
glFinish();
|
||||
}
|
||||
|
||||
// lg::info("Render: {} end", g_current_renderer);
|
||||
// should have ended at the start of the next chain
|
||||
ASSERT(dma.current_tag_offset() == m_render_state.next_bucket);
|
||||
m_render_state.next_bucket += 16;
|
||||
vif_interrupt_callback(bucket_id + 1);
|
||||
m_category_times[(int)m_bucket_categories[bucket_id]] += bucket_prof.get_elapsed_time();
|
||||
|
||||
// TODO: collision renderer
|
||||
}
|
||||
vif_interrupt_callback(m_bucket_renderers.size());
|
||||
|
||||
// TODO ending data.
|
||||
}
|
||||
|
||||
/*!
|
||||
* This function finds buckets and dispatches them to the appropriate part.
|
||||
*/
|
||||
@@ -1100,6 +1210,9 @@ void OpenGLRenderer::dispatch_buckets(DmaFollower dma,
|
||||
case GameVersion::Jak2:
|
||||
dispatch_buckets_jak2(dma, prof, sync_after_buckets);
|
||||
break;
|
||||
case GameVersion::Jak3:
|
||||
dispatch_buckets_jak3(dma, prof, sync_after_buckets);
|
||||
break;
|
||||
default:
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ struct RenderOptions {
|
||||
bool internal_res_screenshot = false;
|
||||
std::string screenshot_path;
|
||||
|
||||
float pmode_alp_register = 0.f;
|
||||
float pmode_alp_register = 1.f;
|
||||
|
||||
// when enabled, does a `glFinish()` after each major rendering pass. This blocks until the GPU
|
||||
// is done working, making it easier to profile GPU utilization.
|
||||
@@ -75,6 +75,8 @@ class OpenGLRenderer {
|
||||
void dispatch_buckets(DmaFollower dma, ScopedProfilerNode& prof, bool sync_after_buckets);
|
||||
void dispatch_buckets_jak1(DmaFollower dma, ScopedProfilerNode& prof, bool sync_after_buckets);
|
||||
void dispatch_buckets_jak2(DmaFollower dma, ScopedProfilerNode& prof, bool sync_after_buckets);
|
||||
void dispatch_buckets_jak3(DmaFollower dma, ScopedProfilerNode& prof, bool sync_after_buckets);
|
||||
|
||||
|
||||
void do_pcrtc_effects(float alp, SharedRenderState* render_state, ScopedProfilerNode& prof);
|
||||
void blit_display();
|
||||
|
||||
@@ -414,6 +414,43 @@ enum class BucketId {
|
||||
|
||||
namespace jak3 {
|
||||
enum class BucketId {
|
||||
BUCKET_2 = 2,
|
||||
BLIT_START = 3,
|
||||
TEX_LCOM_SKY_PRE = 4,
|
||||
|
||||
TEX_L0_TFRAG = 10,
|
||||
|
||||
TEX_L1_TFRAG = 22,
|
||||
|
||||
TEX_LCOM_TFRAG = 340,
|
||||
|
||||
TEX_LCOM_SHRUB = 345,
|
||||
|
||||
TEX_L0_PRIS = 351,
|
||||
|
||||
TEX_L1_PRIS = 356,
|
||||
|
||||
TEX_LCOM_PRIS = 401,
|
||||
|
||||
TEX_LCOM_SKY_POST = 461,
|
||||
|
||||
TEX_L0_WATER = 463,
|
||||
|
||||
TEX_L1_WATER = 473,
|
||||
|
||||
TEX_LCOM_WATER = 563,
|
||||
|
||||
TEX_SPRITE = 568,
|
||||
|
||||
TEX_WARP = 575,
|
||||
|
||||
TEX_HUD_HUD_ALPHA = 578,
|
||||
|
||||
TEX_HUD_PRIS2 = 580,
|
||||
|
||||
DEBUG_NO_ZBUF2 = 584,
|
||||
DEBUG_MENU = 585,
|
||||
|
||||
MAX_BUCKETS = 587,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ struct GraphicsData {
|
||||
FrameLimiter frame_limiter;
|
||||
Timer engine_timer;
|
||||
double last_engine_time = 1. / 60.;
|
||||
float pmode_alp = 0.f;
|
||||
float pmode_alp = 1.f;
|
||||
|
||||
std::string imgui_log_filename, imgui_filename;
|
||||
GameVersion version;
|
||||
|
||||
@@ -400,6 +400,8 @@ PcTextureId TexturePool::allocate_pc_port_texture(GameVersion version) {
|
||||
return PcTextureId(get_jak1_tpage_dir().size() - 1, m_next_pc_texture_to_allocate++);
|
||||
case GameVersion::Jak2:
|
||||
return PcTextureId(get_jak2_tpage_dir().size() - 1, m_next_pc_texture_to_allocate++);
|
||||
case GameVersion::Jak3:
|
||||
return PcTextureId(get_jak3_tpage_dir().size() - 1, m_next_pc_texture_to_allocate++);
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
@@ -741,6 +741,7 @@ void link_control::jak3_finish(bool jump_from_c_to_goal) {
|
||||
|
||||
*EnableMethodSet = *EnableMethodSet + m_keep_debug;
|
||||
|
||||
// printf("finish %s\n", m_object_name);
|
||||
if (m_opengoal) {
|
||||
// setup mips2c functions
|
||||
const auto& it = Mips2C::gMips2CLinkCallbacks[GameVersion::Jak3].find(m_object_name);
|
||||
@@ -824,11 +825,25 @@ u32 link_busy() {
|
||||
void link_reset() {
|
||||
saved_link_control.m_busy = 0;
|
||||
}
|
||||
uint64_t link_begin(u64* /*args*/) {
|
||||
ASSERT_NOT_REACHED();
|
||||
uint64_t link_begin(u64* args) {
|
||||
saved_link_control.jak3_begin(Ptr<u8>(args[0]), Ptr<char>(args[1]).c(), args[2],
|
||||
Ptr<kheapinfo>(args[3]), args[4]);
|
||||
auto work_result = saved_link_control.jak3_work();
|
||||
// if we managed to finish in one shot, take care of calling finish
|
||||
if (work_result) {
|
||||
// called from goal
|
||||
saved_link_control.jak3_finish(false);
|
||||
}
|
||||
return work_result != 0;
|
||||
|
||||
}
|
||||
uint64_t link_resume() {
|
||||
ASSERT_NOT_REACHED();
|
||||
auto work_result = saved_link_control.jak3_work();
|
||||
if (work_result) {
|
||||
// called from goal
|
||||
saved_link_control.jak3_finish(false);
|
||||
}
|
||||
return work_result != 0;
|
||||
}
|
||||
|
||||
// Note: update_goal_fns changed to skip the hashtable lookup since symlink2/symlink3 are now fixed
|
||||
|
||||
@@ -303,11 +303,13 @@ int ShutdownMachine() {
|
||||
}
|
||||
|
||||
u32 KeybdGetData(u32 /*_mouse*/) {
|
||||
ASSERT_NOT_REACHED();
|
||||
return 0;
|
||||
// ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
u32 MouseGetData(u32 /*_mouse*/) {
|
||||
ASSERT_NOT_REACHED();
|
||||
// ASSERT_NOT_REACHED();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -664,6 +664,9 @@ Ptr<Symbol4<u32>> intern_from_c_ht(const char* name) {
|
||||
*/
|
||||
Ptr<Symbol4<u32>> find_symbol_from_c(uint16_t sym_id, const char* name) {
|
||||
#ifdef JAK3_HASH_TABLE
|
||||
if (!strcmp(name, "_empty_")) {
|
||||
return (s7 + S7_OFF_FIX_SYM_EMPTY_PAIR).cast<Symbol4<u32>>();
|
||||
}
|
||||
return find_symbol_from_c_ht(name);
|
||||
#endif
|
||||
// sign extend
|
||||
@@ -733,6 +736,9 @@ Ptr<Symbol4<u32>> find_symbol_from_c(uint16_t sym_id, const char* name) {
|
||||
*/
|
||||
Ptr<Symbol4<u32>> intern_from_c(int sym_id, int flags, const char* name) {
|
||||
#ifdef JAK3_HASH_TABLE
|
||||
if (!strcmp(name, "_empty_")) {
|
||||
return (s7 + S7_OFF_FIX_SYM_EMPTY_PAIR).cast<Symbol4<u32>>();
|
||||
}
|
||||
return intern_from_c_ht(name);
|
||||
#endif
|
||||
// first, look up the symbol.
|
||||
|
||||
@@ -73,6 +73,7 @@ s32 iso_thread;
|
||||
s32 dgo_thread;
|
||||
s32 str_thread;
|
||||
s32 play_thread;
|
||||
constexpr int kRpcBuffSize = sizeof(RPC_Dgo_Cmd);
|
||||
static RPC_Dgo_Cmd sRPCBuff[1];
|
||||
DgoCommand sLoadDGO; // renamed from scmd to sLoadDGO in Jak 2
|
||||
|
||||
@@ -281,7 +282,8 @@ u32 DGOThread() {
|
||||
CpuDisableIntr();
|
||||
sceSifInitRpc(0);
|
||||
sceSifSetRpcQueue(&dq, GetThreadId());
|
||||
sceSifRegisterRpc(&serve, DGO_RPC_ID[g_game_version], RPC_DGO, sRPCBuff, nullptr, nullptr, &dq);
|
||||
sceSifRegisterRpc(&serve, DGO_RPC_ID[g_game_version], RPC_DGO, sRPCBuff, kRpcBuffSize, nullptr,
|
||||
nullptr, &dq);
|
||||
CpuEnableIntr();
|
||||
sceSifRpcLoop(&dq);
|
||||
return 0;
|
||||
|
||||
@@ -34,7 +34,8 @@ u32 gMemSize; // Total memory of RAMDISK
|
||||
u32 gMemFreeAtStart; // Memory free after allocation of RAMDISK
|
||||
uint8_t* gMem; // Allocation for RAMDISK
|
||||
uint8_t* gRamdiskRAM; // Also allocation for RAMDISK
|
||||
uint8_t gRPCBuf[40]; // Buffer for RAMDISK RPC handler
|
||||
constexpr int kRamdiskBufferSize = 40;
|
||||
uint8_t gRPCBuf[kRamdiskBufferSize]; // Buffer for RAMDISK RPC handler
|
||||
|
||||
// Each file stored in the ramdisk has a file record:
|
||||
struct RamdiskFileRecord {
|
||||
@@ -100,8 +101,8 @@ u32 Thread_Server() {
|
||||
CpuDisableIntr();
|
||||
sceSifInitRpc(0);
|
||||
sceSifSetRpcQueue(&dq, GetThreadId());
|
||||
sceSifRegisterRpc(&serve, RAMDISK_RPC_ID[g_game_version], RPC_Ramdisk, gRPCBuf, nullptr, nullptr,
|
||||
&dq);
|
||||
sceSifRegisterRpc(&serve, RAMDISK_RPC_ID[g_game_version], RPC_Ramdisk, gRPCBuf,
|
||||
kRamdiskBufferSize, nullptr, nullptr, &dq);
|
||||
CpuEnableIntr();
|
||||
sceSifRpcLoop(&dq);
|
||||
return 0;
|
||||
|
||||
@@ -31,8 +31,9 @@ using namespace iop;
|
||||
|
||||
namespace jak1 {
|
||||
constexpr int SRPC_MESSAGE_SIZE = 0x50;
|
||||
constexpr int SRPC_MESSAGE_COUNT = 128;
|
||||
static uint8_t gLoaderBuf[SRPC_MESSAGE_SIZE];
|
||||
static uint8_t gPlayerBuf[SRPC_MESSAGE_SIZE * 128];
|
||||
static uint8_t gPlayerBuf[SRPC_MESSAGE_SIZE * SRPC_MESSAGE_COUNT];
|
||||
static u32 gInfoEE = 0; // EE address where we should send info on each frame.
|
||||
s16 gFlava;
|
||||
u32 gFreeMem = 0;
|
||||
@@ -62,8 +63,8 @@ u32 Thread_Player() {
|
||||
CpuDisableIntr();
|
||||
sceSifInitRpc(0);
|
||||
sceSifSetRpcQueue(&dq, GetThreadId());
|
||||
sceSifRegisterRpc(&serve, PLAYER_RPC_ID[g_game_version], RPC_Player, gPlayerBuf, nullptr, nullptr,
|
||||
&dq);
|
||||
sceSifRegisterRpc(&serve, PLAYER_RPC_ID[g_game_version], RPC_Player, gPlayerBuf,
|
||||
SRPC_MESSAGE_SIZE * SRPC_MESSAGE_COUNT, nullptr, nullptr, &dq);
|
||||
CpuEnableIntr();
|
||||
sceSifRpcLoop(&dq);
|
||||
return 0;
|
||||
@@ -79,8 +80,8 @@ u32 Thread_Loader() {
|
||||
CpuDisableIntr();
|
||||
sceSifInitRpc(0);
|
||||
sceSifSetRpcQueue(&dq, GetThreadId());
|
||||
sceSifRegisterRpc(&serve, LOADER_RPC_ID[g_game_version], RPC_Loader, gLoaderBuf, nullptr, nullptr,
|
||||
&dq);
|
||||
sceSifRegisterRpc(&serve, LOADER_RPC_ID[g_game_version], RPC_Loader, gLoaderBuf,
|
||||
SRPC_MESSAGE_SIZE, nullptr, nullptr, &dq);
|
||||
CpuEnableIntr();
|
||||
sceSifRpcLoop(&dq);
|
||||
return 0;
|
||||
|
||||
@@ -24,7 +24,9 @@
|
||||
using namespace iop;
|
||||
|
||||
namespace jak1 {
|
||||
constexpr int kStrBufSize = sizeof(RPC_Str_Cmd_Jak1);
|
||||
static RPC_Str_Cmd_Jak1 sSTRBuf;
|
||||
constexpr int kPlayBufSize = 2 * sizeof(RPC_Play_Cmd_Jak1);
|
||||
static RPC_Play_Cmd_Jak1 sPLAYBuf[2];
|
||||
|
||||
void* RPC_STR(unsigned int fno, void* _cmd, int y);
|
||||
@@ -66,7 +68,8 @@ u32 STRThread() {
|
||||
CpuDisableIntr();
|
||||
sceSifInitRpc(0);
|
||||
sceSifSetRpcQueue(&dq, GetThreadId());
|
||||
sceSifRegisterRpc(&serve, STR_RPC_ID[g_game_version], RPC_STR, &sSTRBuf, nullptr, nullptr, &dq);
|
||||
sceSifRegisterRpc(&serve, STR_RPC_ID[g_game_version], RPC_STR, &sSTRBuf, kStrBufSize, nullptr,
|
||||
nullptr, &dq);
|
||||
CpuEnableIntr();
|
||||
sceSifRpcLoop(&dq);
|
||||
return 0;
|
||||
@@ -79,7 +82,8 @@ u32 PLAYThread() {
|
||||
CpuDisableIntr();
|
||||
sceSifInitRpc(0);
|
||||
sceSifSetRpcQueue(&dq, GetThreadId());
|
||||
sceSifRegisterRpc(&serve, PLAY_RPC_ID[g_game_version], RPC_PLAY, sPLAYBuf, nullptr, nullptr, &dq);
|
||||
sceSifRegisterRpc(&serve, PLAY_RPC_ID[g_game_version], RPC_PLAY, sPLAYBuf, kPlayBufSize, nullptr,
|
||||
nullptr, &dq);
|
||||
CpuEnableIntr();
|
||||
sceSifRpcLoop(&dq);
|
||||
return 0;
|
||||
|
||||
@@ -49,6 +49,7 @@ int ext_resume = 0;
|
||||
|
||||
CmdDgo sLoadDgo; // renamed from scmd to sLoadDGO in Jak 2
|
||||
static RPC_Dgo_Cmd sRPCBuff[1];
|
||||
constexpr int kRpcBuffSize = sizeof(RPC_Dgo_Cmd);
|
||||
VagDir gVagDir;
|
||||
|
||||
/// The main buffer used for reading data and doing blzo decompression.
|
||||
@@ -1097,7 +1098,8 @@ u32 DGOThread() {
|
||||
CpuDisableIntr();
|
||||
sceSifInitRpc(0);
|
||||
sceSifSetRpcQueue(&dq, GetThreadId());
|
||||
sceSifRegisterRpc(&serve, DGO_RPC_ID[g_game_version], RPC_DGO, sRPCBuff, nullptr, nullptr, &dq);
|
||||
sceSifRegisterRpc(&serve, DGO_RPC_ID[g_game_version], RPC_DGO, sRPCBuff, kRpcBuffSize, nullptr,
|
||||
nullptr, &dq);
|
||||
CpuEnableIntr();
|
||||
sceSifRpcLoop(&dq);
|
||||
return 0;
|
||||
|
||||
@@ -24,8 +24,10 @@ static const char* languages[] = {"ENG", "FRE", "GER", "SPA", "ITA", "JAP", "KOR
|
||||
static u32 gInfoEE = 0;
|
||||
static u32 IopTicks = 0;
|
||||
static SoundIopInfo info;
|
||||
static uint8_t gPlayerBuf[0x50 * 128];
|
||||
static uint8_t gLoaderBuf[0x50];
|
||||
constexpr int kPlayerBufSize = 0x50 * 128;
|
||||
static uint8_t gPlayerBuf[kPlayerBufSize];
|
||||
constexpr int kLoaderBufSize = 0x50;
|
||||
static uint8_t gLoaderBuf[kLoaderBufSize];
|
||||
|
||||
void srpc_init_globals() {}
|
||||
|
||||
@@ -575,8 +577,8 @@ u32 Thread_Player() {
|
||||
CpuDisableIntr();
|
||||
sceSifInitRpc(0);
|
||||
sceSifSetRpcQueue(&dq, GetThreadId());
|
||||
sceSifRegisterRpc(&serve, PLAYER_RPC_ID[g_game_version], RPC_Player, gPlayerBuf, nullptr, nullptr,
|
||||
&dq);
|
||||
sceSifRegisterRpc(&serve, PLAYER_RPC_ID[g_game_version], RPC_Player, gPlayerBuf, kPlayerBufSize,
|
||||
nullptr, nullptr, &dq);
|
||||
CpuEnableIntr();
|
||||
sceSifRpcLoop(&dq);
|
||||
return 0;
|
||||
@@ -590,8 +592,8 @@ u32 Thread_Loader() {
|
||||
CpuDisableIntr();
|
||||
sceSifInitRpc(0);
|
||||
sceSifSetRpcQueue(&dq, GetThreadId());
|
||||
sceSifRegisterRpc(&serve, LOADER_RPC_ID[g_game_version], RPC_Loader, gLoaderBuf, nullptr, nullptr,
|
||||
&dq);
|
||||
sceSifRegisterRpc(&serve, LOADER_RPC_ID[g_game_version], RPC_Loader, gLoaderBuf, kLoaderBufSize,
|
||||
nullptr, nullptr, &dq);
|
||||
CpuEnableIntr();
|
||||
sceSifRpcLoop(&dq);
|
||||
return 0;
|
||||
|
||||
@@ -19,8 +19,12 @@
|
||||
using namespace iop;
|
||||
|
||||
namespace jak2 {
|
||||
constexpr int kStrBufSize = sizeof(RPC_Str_Cmd_Jak2);
|
||||
static RPC_Str_Cmd_Jak2 sSTRBuf;
|
||||
static RPC_Play_Cmd_Jak2 sPLAYBuf[2]; // called sRPCBuf2
|
||||
// the size has been increased to 4 to fit jak3. This is a total hack, since the structures
|
||||
// are probably just completely different.
|
||||
constexpr int kPlayBufSize = 4 * sizeof(RPC_Play_Cmd_Jak2);
|
||||
static RPC_Play_Cmd_Jak2 sPLAYBuf[4]; // called sRPCBuf2
|
||||
|
||||
struct CacheEntry {
|
||||
FileRecord* fr = nullptr;
|
||||
@@ -337,7 +341,8 @@ u32 STRThread() {
|
||||
CpuDisableIntr();
|
||||
sceSifInitRpc(0);
|
||||
sceSifSetRpcQueue(&dq, GetThreadId());
|
||||
sceSifRegisterRpc(&serve, STR_RPC_ID[g_game_version], RPC_STR, &sSTRBuf, nullptr, nullptr, &dq);
|
||||
sceSifRegisterRpc(&serve, STR_RPC_ID[g_game_version], RPC_STR, &sSTRBuf, kStrBufSize, nullptr,
|
||||
nullptr, &dq);
|
||||
|
||||
CpuEnableIntr();
|
||||
sceSifRpcLoop(&dq);
|
||||
@@ -351,7 +356,8 @@ u32 PLAYThread() {
|
||||
CpuDisableIntr();
|
||||
sceSifInitRpc(0);
|
||||
sceSifSetRpcQueue(&dq, GetThreadId());
|
||||
sceSifRegisterRpc(&serve, PLAY_RPC_ID[g_game_version], RPC_PLAY, sPLAYBuf, nullptr, nullptr, &dq);
|
||||
sceSifRegisterRpc(&serve, PLAY_RPC_ID[g_game_version], RPC_PLAY, sPLAYBuf, kPlayBufSize, nullptr,
|
||||
nullptr, &dq);
|
||||
CpuEnableIntr();
|
||||
sceSifRpcLoop(&dq);
|
||||
return 0;
|
||||
|
||||
@@ -133,12 +133,14 @@ void sceSifRegisterRpc(sceSifServeData* serve,
|
||||
unsigned int request,
|
||||
sceSifRpcFunc func,
|
||||
void* buff,
|
||||
int buff_size,
|
||||
sceSifRpcFunc cfunc,
|
||||
void* cbuff,
|
||||
sceSifQueueData* qd) {
|
||||
serve->command = request;
|
||||
serve->func = func;
|
||||
serve->buff = buff;
|
||||
serve->buff_size = buff_size;
|
||||
(void)cfunc;
|
||||
(void)cbuff;
|
||||
ASSERT(!cfunc);
|
||||
|
||||
@@ -39,6 +39,8 @@ struct sceSifServeData {
|
||||
unsigned int command; // the RPC ID
|
||||
sceSifRpcFunc func;
|
||||
void* buff;
|
||||
// added
|
||||
int buff_size = 0;
|
||||
};
|
||||
|
||||
struct sceSifQueueData {
|
||||
@@ -116,6 +118,7 @@ void sceSifRegisterRpc(sceSifServeData* serve,
|
||||
unsigned int request,
|
||||
sceSifRpcFunc func,
|
||||
void* buff,
|
||||
int buff_size,
|
||||
sceSifRpcFunc cfunc,
|
||||
void* cbuff,
|
||||
sceSifQueueData* qd);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "common/log/log.h"
|
||||
#include "common/util/Assert.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
|
||||
@@ -337,6 +338,11 @@ void IOP_Kernel::sif_rpc(s32 rpcChannel,
|
||||
ASSERT(rec->cmd.finished && rec->cmd.started);
|
||||
|
||||
// step 3 - memcpy!
|
||||
if (rec->qd->serve_data->buff_size < sendSize) {
|
||||
lg::die(
|
||||
"Buffer overflow in EE -> IOP RPC. channel {}, fno {}, requested size {}, buffer size {}\n",
|
||||
rpcChannel, fno, sendSize, rec->qd->serve_data->buff_size);
|
||||
}
|
||||
memcpy(rec->qd->serve_data->buff, sendBuff, sendSize);
|
||||
|
||||
// step 4 - setup command
|
||||
|
||||
@@ -18,5 +18,5 @@
|
||||
"urn-b-ag.go"
|
||||
"urn-c-ag.go"
|
||||
"urn-a-ag.go"
|
||||
"halfpipe.o"
|
||||
"halfpipe.go"
|
||||
))
|
||||
|
||||
@@ -58,5 +58,5 @@
|
||||
"toad-ag.go"
|
||||
"rhino-ag.go"
|
||||
"vehicle-explosion-ag.go"
|
||||
"wasall.o"
|
||||
"wasall.go"
|
||||
))
|
||||
|
||||
@@ -995,7 +995,9 @@
|
||||
(-> self local-down)
|
||||
(vector-normalize-copy! (-> self local-down) (-> *standard-dynamics* gravity) 1.0)
|
||||
)
|
||||
(cam-master-effect)
|
||||
(when (nonzero? cam-master-effect) ;; og:preserve-this not-yet-implemented check
|
||||
(cam-master-effect)
|
||||
)
|
||||
)
|
||||
)
|
||||
:code (behavior ()
|
||||
@@ -1057,7 +1059,9 @@
|
||||
(let ((a1-4 (new-stack-vector0)))
|
||||
(tracking-spline-method-10 (-> self target-spline) a1-4)
|
||||
)
|
||||
(set! (-> self water-drip) (create-launch-control group-rain-screend-drop self))
|
||||
(when (nonzero? group-rain-screend-drop) ;; og:preserve-this not-yet-implemented check
|
||||
(set! (-> self water-drip) (create-launch-control group-rain-screend-drop self))
|
||||
)
|
||||
(set! (-> self water-drip-time) (seconds -60))
|
||||
(go cam-master-active)
|
||||
0
|
||||
|
||||
@@ -45,6 +45,4 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(format 0 "Skipping cam-start!!~%")
|
||||
(format #t "Skipping cam-start!!~%")
|
||||
;; (cam-start #f)
|
||||
(cam-start #f)
|
||||
|
||||
@@ -5,5 +5,135 @@
|
||||
;; name in dgo: default-menu
|
||||
;; dgos: GAME
|
||||
|
||||
;; TODO: replace with real decomp of this stuff.
|
||||
|
||||
(define *debug-menu-context* (new 'debug 'debug-menu-context))
|
||||
(defun dm-boolean-toggle-pick-func ((arg0 symbol) (arg1 debug-menu-msg))
|
||||
(if (= arg1 (debug-menu-msg press))
|
||||
(set! (-> arg0 value) (not (-> arg0 value)))
|
||||
)
|
||||
(-> arg0 value)
|
||||
)
|
||||
|
||||
|
||||
(defun debug-menu-context-make-default-menus ((arg0 debug-menu-context))
|
||||
(local-vars (sv-16 debug-menu-context))
|
||||
(let ((s5-0 (new 'debug 'debug-menu arg0 "Main menu")))
|
||||
(debug-menu-context-set-root-menu arg0 s5-0)
|
||||
(debug-menu-append-item
|
||||
s5-0
|
||||
(debug-menu-make-from-template
|
||||
arg0
|
||||
'(menu
|
||||
"Artist"
|
||||
(flag "Poly Stats" *stats-poly* dm-boolean-toggle-pick-func)
|
||||
(menu
|
||||
"Memory Stats"
|
||||
(flag "Enable" *stats-memory* dm-boolean-toggle-pick-func)
|
||||
(flag "Short" *stats-memory-short* dm-boolean-toggle-pick-func)
|
||||
; (flag "Level 0" 0 dm-stats-memory-func)
|
||||
; (flag "Level 1" 1 dm-stats-memory-func)
|
||||
; (flag "Level 2" 2 dm-stats-memory-func)
|
||||
; (flag "Level 3" 3 dm-stats-memory-func)
|
||||
; (flag "Level 4" 4 dm-stats-memory-func)
|
||||
; (flag "Level 5" 5 dm-stats-memory-func)
|
||||
; (flag "Level 6" 6 dm-stats-memory-func)
|
||||
; (flag "Level 7" 7 dm-stats-memory-func)
|
||||
; (flag "Level 8" 8 dm-stats-memory-func)
|
||||
; (flag "Level 9" 9 dm-stats-memory-func)
|
||||
)
|
||||
(flag "All Visible" *artist-all-visible* dm-boolean-toggle-pick-func)
|
||||
(flag "Flip Visible" *artist-flip-visible* dm-boolean-toggle-pick-func)
|
||||
(flag "Fix Visible" *artist-fix-visible* dm-boolean-toggle-pick-func)
|
||||
(flag "Fix Frustum" *artist-fix-frustum* dm-boolean-toggle-pick-func)
|
||||
(flag "Manual Sample Point" *manual-sample-point* dm-boolean-toggle-pick-func)
|
||||
(flag "Error Spheres" *artist-error-spheres* dm-boolean-toggle-pick-func)
|
||||
(flag "Use menu subdiv" *artist-use-menu-subdiv* dm-boolean-toggle-pick-func)
|
||||
; (float-var "Subdiv Close" close dm-subdiv-float 10 1 #t 1 1000 1)
|
||||
; (float-var "Subdiv Far" far dm-subdiv-float 10 1 #t 1 1000 1)
|
||||
;; (function "Target Start" #f <lambda at L613>)
|
||||
;; (function "Target Stop" #f <lambda at L612>)
|
||||
; (menu
|
||||
; "Anim Tester"
|
||||
; (int-var "Speed" anim-speed dm-subdiv-int 10 10 #t -300 1000)
|
||||
; (flag "Apply Align" at-apply-align dm-anim-tester-flag-func)
|
||||
; (flag "Show Joint Inf" at-show-joint-info dm-anim-tester-flag-func)
|
||||
; (function "Pick Object" at-pick-object dm-anim-tester-func)
|
||||
; (function "Pick Joint Anim" at-pick-joint-anim dm-anim-tester-func)
|
||||
; (function "Pick Sequence" at-pick-sequence dm-anim-tester-func)
|
||||
; (function "Save Sequences" at-save-sequences dm-anim-tester-func)
|
||||
; )
|
||||
(flag "Show Entity Errors" *display-entity-errors* dm-boolean-toggle-pick-func)
|
||||
(flag "Capture Mode" *display-capture-mode* dm-boolean-toggle-pick-func)
|
||||
(flag "Sprite Info" *display-sprite-info* dm-boolean-toggle-pick-func)
|
||||
(flag "Sprite Marks" *display-sprite-marks* dm-boolean-toggle-pick-func)
|
||||
(flag "Sprite Spheres" *display-sprite-spheres* dm-boolean-toggle-pick-func)
|
||||
;(flag "Time of Day" #f dm-time-of-day-pick-func)
|
||||
(flag "Preload Anims" *preload-spool-anims* dm-boolean-toggle-pick-func)
|
||||
;; (function "Mike F" #f <lambda at L610>)
|
||||
;; (function "Editor" #f <lambda at L608>)
|
||||
;; (flag "Screen shot highres enable" #f <lambda at L605>)
|
||||
;; (flag "Screen shot hud enable" #f <lambda at L602>)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
arg0
|
||||
)
|
||||
|
||||
(define *popup-menu-context* (new 'debug 'debug-menu-context))
|
||||
|
||||
(defun popup-menu-context-make-default-menus ((arg0 debug-menu-context))
|
||||
(debug-menu-make-from-template
|
||||
arg0
|
||||
'(main-menu
|
||||
"Popup"
|
||||
;; (flag "Cam 1" pad-1 dm-cam-externalize)
|
||||
(flag "Turbo Cam" *camera-turbo-free* dm-boolean-toggle-pick-func)
|
||||
)
|
||||
)
|
||||
arg0
|
||||
)
|
||||
|
||||
(debug-menu-context-make-default-menus *debug-menu-context*)
|
||||
(popup-menu-context-make-default-menus *popup-menu-context*)
|
||||
|
||||
(defun menu-respond-to-pause ()
|
||||
(case *master-mode*
|
||||
(('menu)
|
||||
(cond
|
||||
((and (cpad-hold? 0 l3) (cpad-hold? 0 select))
|
||||
(debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg activate) (debug-menu-dest activation))
|
||||
(debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation))
|
||||
;; (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation))
|
||||
)
|
||||
; ((and (cpad-hold? 1 start) *editable*)
|
||||
; (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg activate) (debug-menu-dest activation))
|
||||
; (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation))
|
||||
; (debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation))
|
||||
; )
|
||||
((and (cpad-hold? 0 l3) (cpad-hold? 0 start))
|
||||
(debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg activate) (debug-menu-dest activation))
|
||||
(debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation))
|
||||
;;(debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation))
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation))
|
||||
(debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation))
|
||||
;; (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation))
|
||||
)
|
||||
)
|
||||
#f
|
||||
)
|
||||
|
||||
(defun *menu-hook* ()
|
||||
(debug-menus-handler *debug-menu-context*)
|
||||
(debug-menus-handler *popup-menu-context*)
|
||||
)
|
||||
|
||||
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
|
||||
@@ -747,7 +747,7 @@
|
||||
)
|
||||
)
|
||||
(with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) debug-buf))
|
||||
(bucket-id bucket585)
|
||||
(bucket-id debug-menu)
|
||||
)
|
||||
(draw-string-adv (-> arg0 name) s3-0 s5-0)
|
||||
(draw-string-adv "..." s3-0 s5-0)
|
||||
@@ -783,7 +783,7 @@
|
||||
)
|
||||
)
|
||||
(with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) debug-buf))
|
||||
(bucket-id bucket585)
|
||||
(bucket-id debug-menu)
|
||||
)
|
||||
(set-context! *font-work* s5-0)
|
||||
(draw-string (-> arg0 name) s3-0 s5-0)
|
||||
@@ -819,7 +819,7 @@
|
||||
)
|
||||
)
|
||||
(with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) debug-buf))
|
||||
(bucket-id bucket585)
|
||||
(bucket-id debug-menu)
|
||||
)
|
||||
(set-context! *font-work* s5-0)
|
||||
(draw-string (-> arg0 name) s3-0 s5-0)
|
||||
@@ -852,7 +852,7 @@
|
||||
)
|
||||
)
|
||||
(with-dma-buffer-add-bucket ((s1-0 (-> *display* frames (-> *display* on-screen) debug-buf))
|
||||
(bucket-id bucket585)
|
||||
(bucket-id debug-menu)
|
||||
)
|
||||
(draw-string-adv (-> arg0 name) s1-0 s5-0)
|
||||
(draw-string-adv ":" s1-0 s5-0)
|
||||
@@ -933,7 +933,7 @@
|
||||
)
|
||||
)
|
||||
(with-dma-buffer-add-bucket ((s0-0 (-> *display* frames (-> *display* on-screen) debug-buf))
|
||||
(bucket-id bucket585)
|
||||
(bucket-id debug-menu)
|
||||
)
|
||||
(draw-sprite2d-xy
|
||||
s0-0
|
||||
@@ -978,7 +978,7 @@
|
||||
)
|
||||
(dma-bucket-insert-tag
|
||||
(-> *display* frames (-> *display* on-screen) bucket-group)
|
||||
(bucket-id bucket585)
|
||||
(bucket-id debug-menu)
|
||||
sv-32
|
||||
(the-as (pointer dma-tag) a3-3)
|
||||
)
|
||||
|
||||
@@ -1785,7 +1785,11 @@
|
||||
;; WARN: Return type mismatch display vs none.
|
||||
(defun display-frame-start ((arg0 display) (arg1 int) (arg2 float))
|
||||
"Advance clocks, poll pads/mouse, set up buckets."
|
||||
(set! (-> (the-as vif-bank #x10003c00) err me0) 1)
|
||||
|
||||
;; workaround for PS2 hardware bug
|
||||
;; (set! (-> (the-as vif-bank #x10003c00) err me0) 1)
|
||||
|
||||
;; update clocks
|
||||
(set-time-ratios *display* 1.0)
|
||||
(tick! (-> arg0 frame-clock))
|
||||
(tick! (-> arg0 real-frame-clock))
|
||||
@@ -1811,6 +1815,7 @@
|
||||
(tick! (-> arg0 user9-clock))
|
||||
(set! (-> arg0 bg-clock frame-counter) (the-as time-frame (mod (-> arg0 bg-clock frame-counter) #x69780)))
|
||||
(tick! (-> arg0 part-clock))
|
||||
|
||||
(when (and (nonzero? *screen-shot-work*) (!= (-> *screen-shot-work* count) -1))
|
||||
(let ((v1-61 (-> *screen-shot-work* size)))
|
||||
(if (!= (-> *screen-shot-work* count) (* v1-61 v1-61))
|
||||
@@ -1871,8 +1876,9 @@
|
||||
(with-profiler 'texture *profile-texture-color*
|
||||
(when (-> *texture-pool* update-sprites-flag)
|
||||
(update-sprites *texture-pool*)
|
||||
(particle-adgif-cache-flush)
|
||||
(remap-all-particles)
|
||||
;; TODO
|
||||
;(particle-adgif-cache-flush)
|
||||
;(remap-all-particles)
|
||||
)
|
||||
(let ((s3-1 (-> pp clock)))
|
||||
(if (= (-> *time-of-day-context* mode) (time-of-day-palette-id unk3))
|
||||
@@ -1886,7 +1892,7 @@
|
||||
(update-warp-and-hud *texture-pool*)
|
||||
)
|
||||
(-> arg0 frames (-> arg0 on-screen) global-buf)
|
||||
(update-eyes)
|
||||
;; (update-eyes) TODO
|
||||
)
|
||||
(when *debug-segment*
|
||||
(with-profiler 'debug *profile-debug-color*
|
||||
@@ -2098,15 +2104,34 @@
|
||||
)
|
||||
)
|
||||
|
||||
;; og:preserve-this pc port function
|
||||
(defun pc-maybe-vsync ()
|
||||
"PC Port implementation of the block of code in display-sync that computes frame-time-ratio and maybe vsyncs."
|
||||
;; for now, it's very simple.
|
||||
|
||||
;; I think the right logic in the future is to always vsync here, but return a more accurate dog ratio.
|
||||
|
||||
(syncv 0) ;; sync always!
|
||||
1.0 ;; and report that we run at full speed.
|
||||
)
|
||||
|
||||
(defun display-sync ((arg0 display))
|
||||
;; wait for VU1 rendering to complete.
|
||||
(sync-path 0 0)
|
||||
|
||||
;; measure the time it took for this frame
|
||||
(let* ((s4-0 (-> arg0 last-screen))
|
||||
(s2-0 (shl (timer-count (the-as timer-bank #x10000800)) 48))
|
||||
(s5-0 (shl (-> arg0 frames s4-0 start-time) 48))
|
||||
(a1-1 (shl (-> arg0 vblank-start-time 0) 48))
|
||||
(s1-0 (shl (-> arg0 vblank-start-time 1) 48))
|
||||
)
|
||||
(set! *ticks-per-frame* (max 9000 (min #x2ee0 (sar (- s1-0 a1-1) 48))))
|
||||
|
||||
;; the *ticks-per-frame* is set based on vblank interrupt timing. Just lock it, like we did for Jak 2.
|
||||
;; this value should be related the PS2's NTSC/PAL output system.
|
||||
;; (set! *ticks-per-frame* (max 9000 (min #x2ee0 (sar (- s1-0 a1-1) 48))))
|
||||
(set! *ticks-per-frame* 9765)
|
||||
|
||||
(let ((f28-0 (the float *ticks-per-frame*))
|
||||
(s3-0 (sar (- s2-0 s5-0) 48))
|
||||
(f30-1 (fmax 1.0 (calc-ratio (the-as int s2-0) (the-as int s5-0))))
|
||||
@@ -2118,47 +2143,58 @@
|
||||
(if (< (the-as int s3-0) 0)
|
||||
(set! s3-0 (the uint (+ #x10000 s3-0)))
|
||||
)
|
||||
(set! (-> arg0 frames s4-0 run-time) s3-0)
|
||||
(set! f30-1 (cond
|
||||
((-> arg0 run-half-speed)
|
||||
(syncv 0)
|
||||
(let ((a0-8 (shl (timer-count (the-as timer-bank #x10000800)) 48)))
|
||||
(if (and (< (calc-ratio (the-as int a0-8) (the-as int s5-0)) 2.0) (< f28-1 0.9))
|
||||
(syncv 0)
|
||||
)
|
||||
)
|
||||
2.0
|
||||
)
|
||||
((< 1.0 f30-1)
|
||||
(when (> (-> arg0 force-sync) 0)
|
||||
(syncv 0)
|
||||
(+! (-> arg0 force-sync) -1)
|
||||
(let ((a0-12 (shl (timer-count (the-as timer-bank #x10000800)) 48)))
|
||||
(set! f30-1 (calc-ratio (the-as int a0-12) (the-as int s5-0)))
|
||||
)
|
||||
)
|
||||
f30-1
|
||||
)
|
||||
((and (= f30-1 1.0) (< f30-1 f26-0))
|
||||
(while (< f30-1 f26-0)
|
||||
(let ((a0-14 (shl (timer-count (the-as timer-bank #x10000800)) 48)))
|
||||
(set! f30-1 (calc-ratio (the-as int a0-14) (the-as int s5-0)))
|
||||
)
|
||||
(if (< f30-1 0.0)
|
||||
(set! f30-1 f26-0)
|
||||
)
|
||||
)
|
||||
1.0
|
||||
)
|
||||
(else
|
||||
(if (< f28-1 0.9)
|
||||
(syncv 0)
|
||||
)
|
||||
f30-1
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; track previous frame's run time. This is used to disable some extra effects if the game
|
||||
;; is close to lagging. We disable this.
|
||||
; (set! (-> arg0 frames s4-0 run-time) s3-0)
|
||||
(set! (-> arg0 frames s4-0 run-time) 0)
|
||||
|
||||
;; disable their vsync logic:
|
||||
; (set! f30-1 (cond
|
||||
; ((-> arg0 run-half-speed)
|
||||
; (syncv 0)
|
||||
; (let ((a0-8 (shl (timer-count (the-as timer-bank #x10000800)) 48)))
|
||||
; (if (and (< (calc-ratio (the-as int a0-8) (the-as int s5-0)) 2.0) (< f28-1 0.9))
|
||||
; (syncv 0)
|
||||
; )
|
||||
; )
|
||||
; 2.0
|
||||
; )
|
||||
; ((< 1.0 f30-1)
|
||||
; (when (> (-> arg0 force-sync) 0)
|
||||
; (syncv 0)
|
||||
; (+! (-> arg0 force-sync) -1)
|
||||
; (let ((a0-12 (shl (timer-count (the-as timer-bank #x10000800)) 48)))
|
||||
; (set! f30-1 (calc-ratio (the-as int a0-12) (the-as int s5-0)))
|
||||
; )
|
||||
; )
|
||||
; f30-1
|
||||
; )
|
||||
; ((and (= f30-1 1.0) (< f30-1 f26-0))
|
||||
; (while (< f30-1 f26-0)
|
||||
; (let ((a0-14 (shl (timer-count (the-as timer-bank #x10000800)) 48)))
|
||||
; (set! f30-1 (calc-ratio (the-as int a0-14) (the-as int s5-0)))
|
||||
; )
|
||||
; (if (< f30-1 0.0)
|
||||
; (set! f30-1 f26-0)
|
||||
; )
|
||||
; )
|
||||
; 1.0
|
||||
; )
|
||||
; (else
|
||||
; (if (< f28-1 0.9)
|
||||
; (syncv 0)
|
||||
; )
|
||||
; f30-1
|
||||
; )
|
||||
; )
|
||||
; )
|
||||
)
|
||||
|
||||
;; always vsync:
|
||||
(set! f30-1 (pc-maybe-vsync))
|
||||
|
||||
;; remember start time:
|
||||
(let ((s4-1 (-> arg0 on-screen)))
|
||||
(let ((v1-50 (timer-count (the-as timer-bank #x10000800))))
|
||||
(let ((a0-19 (sar (- (shl v1-50 48) s5-0) 48)))
|
||||
@@ -2169,22 +2205,30 @@
|
||||
)
|
||||
(set! (-> arg0 frames s4-1 start-time) v1-50)
|
||||
)
|
||||
(set-graphics-mode)
|
||||
|
||||
;; (set-graphics-mode)
|
||||
|
||||
;; start dma
|
||||
(let ((s5-1 (-> arg0 frames s4-1 calc-buf)))
|
||||
(when (nonzero? (dma-buffer-length s5-1))
|
||||
;; swap buffers
|
||||
(+! s4-1 1)
|
||||
(if (< 1 s4-1)
|
||||
(set! s4-1 0)
|
||||
)
|
||||
(set! (-> arg0 last-screen) (-> arg0 on-screen))
|
||||
(set! (-> arg0 on-screen) s4-1)
|
||||
;; reset VU profiler
|
||||
(when *debug-segment*
|
||||
(set! *profile-interrupt-segment* (-> *display* frames (-> *display* last-screen) profile-array data 1))
|
||||
(set! (-> *profile-interrupt-segment* depth) 0)
|
||||
(set! (-> *profile-interrupt-segment* max-depth) 1)
|
||||
)
|
||||
;; DMA!
|
||||
(if (not (-> *display* dma-buffer-overflow))
|
||||
(dma-buffer-send-chain (the-as dma-bank-source #x10009000) s5-1)
|
||||
;; (dma-buffer-send-chain (the-as dma-bank-source #x10009000) s5-1)
|
||||
(__send-gfx-dma-chain (the-as dma-bank-source #x10009000) (-> s5-1 data))
|
||||
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -5,5 +5,19 @@
|
||||
;; name in dgo: entity
|
||||
;; dgos: GAME
|
||||
|
||||
(defmethod birth bsp-header ((this bsp-header))
|
||||
(format #t "skipping birth for ~A~%" this)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun reset-actors ((arg0 symbol))
|
||||
(format #t "skipping reset-actors ~A~%" arg0)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun entity-by-name ((arg0 string))
|
||||
(the entity #f)
|
||||
)
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
|
||||
@@ -587,7 +587,10 @@
|
||||
(dotimes (v1-96 (-> this game-score length))
|
||||
(set! (-> this game-score v1-96) 0.0)
|
||||
)
|
||||
((method-of-object *bigmap* bigmap-method-9))
|
||||
(when (nonzero? *bigmap*) ;; og:preserve-this not-yet-implemented check
|
||||
(format 0 "skipping bigmap init in game-info~%")
|
||||
((method-of-object *bigmap* bigmap-method-9))
|
||||
)
|
||||
)
|
||||
)
|
||||
(case mode
|
||||
@@ -684,13 +687,17 @@
|
||||
(get-current-continue-forced this)
|
||||
)
|
||||
)
|
||||
(t1-3 arg2)
|
||||
(t2-0 reset-spec)
|
||||
)
|
||||
((the-as (function symbol symbol continue-point game-save resetter-spec none :behavior process) s0-2)
|
||||
(the-as symbol sv-128)
|
||||
(the-as symbol sv-144)
|
||||
(the-as continue-point sv-160)
|
||||
(the-as game-save mode)
|
||||
(the-as resetter-spec t0-4)
|
||||
((the-as (function cpu-thread function symbol symbol continue-point game-save resetter-spec none) s0-2)
|
||||
sv-128
|
||||
sv-144
|
||||
sv-160
|
||||
mode
|
||||
(the-as continue-point t0-4)
|
||||
t1-3
|
||||
t2-0
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1394,6 +1401,10 @@
|
||||
|
||||
(defmethod copy-perms-to-level! ((this game-info) (arg0 level))
|
||||
(let ((s5-0 (-> arg0 bsp level entity)))
|
||||
(when (not s5-0) ;; og:preserve-this not-yet-implemented check
|
||||
(format #t "skipping copy-perms-to-level! since we have no entity links (needs entity.gc)~%")
|
||||
(return 0)
|
||||
)
|
||||
(dotimes (s4-0 (-> s5-0 length))
|
||||
(let* ((s3-0 (-> s5-0 data s4-0 entity extra perm))
|
||||
(v1-7 (actor-perm this (-> s3-0 aid)))
|
||||
@@ -1893,7 +1904,10 @@
|
||||
|
||||
(defmethod adjust-to-screen-flip ((this cpad-info))
|
||||
(if (and (not (paused?)) (zero? (-> this number)) (-> *setting-control* user-current player-control-override))
|
||||
(override-player-controls)
|
||||
(when (nonzero? override-player-controls) ;; og:preserve-this not-yet-implemented check
|
||||
;; added nonzero check, but I suspect there's a bug we're even getting here...
|
||||
(override-player-controls)
|
||||
)
|
||||
)
|
||||
(when (logtest? (-> *game-info* secrets) (game-secrets hflip-screen))
|
||||
(set! (-> this leftx) (- 255 (the-as int (-> this leftx))))
|
||||
|
||||
@@ -1410,20 +1410,20 @@
|
||||
(load-continue (-> *level* loading-level))
|
||||
)
|
||||
|
||||
;; modify vertices for merc face animation. I believe this is somewhat racing DMA of merc data to VU1.
|
||||
(with-profiler 'merc *profile-merc-color*
|
||||
(blerc-execute)
|
||||
(blerc-init)
|
||||
)
|
||||
; ;; modify vertices for merc face animation. I believe this is somewhat racing DMA of merc data to VU1.
|
||||
; (with-profiler 'merc *profile-merc-color*
|
||||
; (blerc-execute)
|
||||
; (blerc-init)
|
||||
; )
|
||||
|
||||
;; modify merc vertices for texture scrolling effect. Again, racing DMA.
|
||||
(texscroll-execute)
|
||||
; ;; modify merc vertices for texture scrolling effect. Again, racing DMA.
|
||||
; (texscroll-execute)
|
||||
|
||||
;; modify merc vertices for water ripple effect. Again, racing DMA.
|
||||
(ripple-execute)
|
||||
; ;; modify merc vertices for water ripple effect. Again, racing DMA.
|
||||
; (ripple-execute)
|
||||
|
||||
;; detect player/camera entering/exiting regions, and run callbacks for those.
|
||||
(region-execute)
|
||||
; ;; detect player/camera entering/exiting regions, and run callbacks for those.
|
||||
; (region-execute)
|
||||
|
||||
;; decompress joint animations, compute joint and bone transformation for each actor.
|
||||
;; note that we also run this in a separate process. The math-engine will only run for
|
||||
@@ -1433,8 +1433,8 @@
|
||||
(execute-math-engine)
|
||||
)
|
||||
|
||||
;; cloth simulation update
|
||||
(execute-cloth-engine)
|
||||
; ;; cloth simulation update
|
||||
; (execute-cloth-engine)
|
||||
|
||||
(with-profiler 'debug *profile-debug-color*
|
||||
;; run debug callbacks
|
||||
@@ -1459,34 +1459,35 @@
|
||||
(execute-cam-post-hook-engine)
|
||||
)
|
||||
|
||||
;; Update start-menu map and masking
|
||||
(update *bigmap*)
|
||||
; ;; Update start-menu map and masking
|
||||
; (update *bigmap*)
|
||||
|
||||
;; do some more level loading.
|
||||
(if (-> *level* loading-level)
|
||||
(load-continue (-> *level* loading-level))
|
||||
)
|
||||
|
||||
;; run the drawing system!
|
||||
;; (note that this does a significant amount of non-drawing stuff, like collision callbacks, actors-update,
|
||||
;; navigation update...)
|
||||
(with-profiler 'draw-hook *profile-draw-hook-color*
|
||||
(*draw-hook*)
|
||||
)
|
||||
; ;; run the drawing system!
|
||||
; ;; (note that this does a significant amount of non-drawing stuff, like collision callbacks, actors-update,
|
||||
; ;; navigation update...)
|
||||
; (with-profiler 'draw-hook *profile-draw-hook-color*
|
||||
; (*draw-hook*)
|
||||
; )
|
||||
|
||||
;; more level loading
|
||||
(if (-> *level* loading-level)
|
||||
(load-continue (-> *level* loading-level))
|
||||
)
|
||||
|
||||
(if *display-color-bars*
|
||||
(draw-color-bars *blit-displays-work*)
|
||||
)
|
||||
; (if *display-color-bars*
|
||||
; (draw-color-bars *blit-displays-work*)
|
||||
; )
|
||||
|
||||
;; run debug menu
|
||||
(*menu-hook*)
|
||||
;; load the right language file.
|
||||
(load-level-text-files -1)
|
||||
; load the right language file.
|
||||
;; disabled for now: seems to load 255COMMON.TXT.
|
||||
; (load-level-text-files -1)
|
||||
|
||||
;; draw screen filter
|
||||
(when (-> *screen-filter* draw?)
|
||||
@@ -1524,10 +1525,10 @@
|
||||
)
|
||||
)
|
||||
|
||||
;; generate DMA to copy from render buffer to frame buffer.
|
||||
(with-profiler 'blit-displays *profile-blit-color*
|
||||
(blit-displays-work-method-19 *blit-displays-work*)
|
||||
)
|
||||
; ;; generate DMA to copy from render buffer to frame buffer.
|
||||
; (with-profiler 'blit-displays *profile-blit-color*
|
||||
; (blit-displays-work-method-19 *blit-displays-work*)
|
||||
; )
|
||||
|
||||
;; wrap up this frame (drawing of stdcon, debugging, etc.)
|
||||
(end-display arg0)
|
||||
@@ -1546,6 +1547,7 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; start stat collection for this frame
|
||||
(start-frame! (-> arg0 frames (-> arg0 on-screen) profile-array data 0))
|
||||
(start-profiling! (-> *perf-stats* data 0))
|
||||
|
||||
;; update *teleport* flag, which is set when the game intentionally teleports the camera,
|
||||
@@ -1558,45 +1560,45 @@
|
||||
)
|
||||
|
||||
;; do particles as soon as possible, since we're racing to send their data to VU1.
|
||||
(execute-particle-local-space-engine 0)
|
||||
(let ((gp-1 (-> pp clock)))
|
||||
(set! (-> pp clock) (-> *display* part-clock))
|
||||
(process-particles)
|
||||
(set! (-> pp clock) gp-1)
|
||||
)
|
||||
(execute-particle-local-space-engine 1)
|
||||
; (execute-particle-local-space-engine 0)
|
||||
; (let ((gp-1 (-> pp clock)))
|
||||
; (set! (-> pp clock) (-> *display* part-clock))
|
||||
; (process-particles)
|
||||
; (set! (-> pp clock) gp-1)
|
||||
; )
|
||||
; (execute-particle-local-space-engine 1)
|
||||
|
||||
;; init unused? VU0 collision stuff.
|
||||
(dma-send
|
||||
(the-as dma-bank #x10008000)
|
||||
(the-as uint (-> *collide-vif0-init* data))
|
||||
(the-as uint (/ (-> *collide-vif0-init* length) 4))
|
||||
)
|
||||
; (dma-send
|
||||
; (the-as dma-bank #x10008000)
|
||||
; (the-as uint (-> *collide-vif0-init* data))
|
||||
; (the-as uint (/ (-> *collide-vif0-init* length) 4))
|
||||
; )
|
||||
|
||||
;; update sound system.
|
||||
(swap-sound-buffers
|
||||
(ear-trans 0)
|
||||
(ear-trans 1)
|
||||
(if (-> *setting-control* user-current lock-sound-camera-to-target)
|
||||
(ear-trans 1)
|
||||
(camera-pos)
|
||||
)
|
||||
(-> (math-camera-matrix) fvec)
|
||||
(-> (math-camera-matrix) rvec)
|
||||
(-> *setting-control* user-current sound-ear-scale)
|
||||
)
|
||||
; (swap-sound-buffers
|
||||
; (ear-trans 0)
|
||||
; (ear-trans 1)
|
||||
; (if (-> *setting-control* user-current lock-sound-camera-to-target)
|
||||
; (ear-trans 1)
|
||||
; (camera-pos)
|
||||
; )
|
||||
; (-> (math-camera-matrix) fvec)
|
||||
; (-> (math-camera-matrix) rvec)
|
||||
; (-> *setting-control* user-current sound-ear-scale)
|
||||
; )
|
||||
|
||||
;; update streaming animations
|
||||
(str-play-kick)
|
||||
; (str-play-kick)
|
||||
|
||||
;; update the level system
|
||||
(level-update *level*)
|
||||
|
||||
;; update memory card
|
||||
(mc-run)
|
||||
; (mc-run)
|
||||
|
||||
;; check for memory card errors.
|
||||
(auto-save-check)
|
||||
; (auto-save-check)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -1630,21 +1632,21 @@
|
||||
(let ((gp-1 *display*))
|
||||
;; initial setup
|
||||
(set! *teleport* #t)
|
||||
(update *setting-control*)
|
||||
(init-time-of-day-context *time-of-day-context*)
|
||||
;; (update *setting-control*) ;; dies on camera stuff, which looks for entities.
|
||||
;; (init-time-of-day-context *time-of-day-context*) ;; no time of day yet.
|
||||
(display-sync gp-1)
|
||||
(display-frame-finish gp-1)
|
||||
(display-sync gp-1)
|
||||
(install-handler 3 vblank-handler)
|
||||
(free-nodes *touching-list*)
|
||||
(prepare *collide-rider-pool*)
|
||||
(update-actor-hash)
|
||||
(blerc-init)
|
||||
(dma-send
|
||||
(the-as dma-bank #x10008000)
|
||||
(the-as uint (-> *collide-vif0-init* data))
|
||||
(the-as uint (/ (-> *collide-vif0-init* length) 4))
|
||||
)
|
||||
;; (free-nodes *touching-list*)
|
||||
;; (prepare *collide-rider-pool*)
|
||||
;; (update-actor-hash)
|
||||
;; (blerc-init)
|
||||
; (dma-send
|
||||
; (the-as dma-bank #x10008000)
|
||||
; (the-as uint (-> *collide-vif0-init* data))
|
||||
; (the-as uint (/ (-> *collide-vif0-init* length) 4))
|
||||
; )
|
||||
(suspend)
|
||||
(set! (-> *setting-control* user-default bg-a) 0.0)
|
||||
(set! (-> gp-1 frames 0 start-time) (timer-count (the-as timer-bank #x10000800)))
|
||||
|
||||
@@ -5,5 +5,57 @@
|
||||
;; name in dgo: task-control
|
||||
;; dgos: GAME
|
||||
|
||||
|
||||
(defmethod game-task-node-info-method-12 ((this game-task-node-info))
|
||||
(local-vars (a0-3 symbol) (a1-1 symbol))
|
||||
(let ((a1-0 (-> *game-info* sub-task-list))
|
||||
(v1-1 this)
|
||||
)
|
||||
(and (not (logtest? (-> v1-1 flags) (game-task-node-flag closed)))
|
||||
(begin
|
||||
(dotimes (a2-2 4)
|
||||
(let ((t0-0 (-> v1-1 parent-node a2-2)))
|
||||
(when (and (nonzero? t0-0) (not (logtest? (-> a1-0 t0-0 flags) (game-task-node-flag closed))))
|
||||
(set! a1-1 #f)
|
||||
(goto cfg-12)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! a1-1 #t)
|
||||
(label cfg-12)
|
||||
a1-1
|
||||
)
|
||||
(and (or (zero? (+ (-> *setting-control* user-current exclusive-task-count) (-> *game-info* task-node-exclusive length))
|
||||
)
|
||||
(begin
|
||||
(dotimes (a1-6 (the-as int (-> *setting-control* user-current exclusive-task-count)))
|
||||
(when (= (-> *setting-control* user-current exclusive-task a1-6) (-> this task))
|
||||
(set! a0-3 #t)
|
||||
(goto cfg-29)
|
||||
)
|
||||
)
|
||||
(dotimes (a1-9 (-> *game-info* task-node-exclusive length))
|
||||
(when (= (-> *game-info* task-node-exclusive a1-9) (-> this task))
|
||||
(set! a0-3 #t)
|
||||
(goto cfg-29)
|
||||
)
|
||||
)
|
||||
(set! a0-3 #f)
|
||||
(label cfg-29)
|
||||
(or a0-3 (logtest? (-> v1-1 flags) (game-task-node-flag auto-close disk-close)))
|
||||
)
|
||||
)
|
||||
(or (not (-> v1-1 open?)) ((-> v1-1 open?) v1-1))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod open! ((this game-task-node-info) (arg symbol))
|
||||
(format #t "skipping (open! ~A ~A)~%" this arg)
|
||||
0
|
||||
)
|
||||
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
|
||||
@@ -5,7 +5,83 @@
|
||||
;; name in dgo: blit-displays
|
||||
;; dgos: GAME
|
||||
|
||||
;; just a stub for now.
|
||||
(define-extern draw-color-bars (function blit-displays-work none))
|
||||
|
||||
(define *blit-displays-work* (new 'static 'blit-displays-work
|
||||
:adgif-tmpl (new 'static 'dma-gif-packet
|
||||
:dma-vif (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))
|
||||
:vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)
|
||||
)
|
||||
:gif (new 'static 'array uint64 2 #x1000000000008005 #xe)
|
||||
)
|
||||
:sprite-tmpl (new 'static 'dma-gif-packet
|
||||
:dma-vif (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x41 :id (dma-tag-id cnt))
|
||||
:vif1 (new 'static 'vif-tag :imm #x41 :cmd (vif-cmd direct) :msk #x1)
|
||||
)
|
||||
:gif (new 'static 'array uint64 2 #x408b400000008010 #x5353)
|
||||
)
|
||||
:contrast-tmpl (new 'static 'dma-gif-packet
|
||||
:dma-vif (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x41 :id (dma-tag-id cnt))
|
||||
:vif1 (new 'static 'vif-tag :imm #x41 :cmd (vif-cmd direct) :msk #x1)
|
||||
)
|
||||
:gif (new 'static 'array uint64 2 #x40ab400000008010 #x5353)
|
||||
)
|
||||
:sprite-slow-tmpl (new 'static 'dma-gif-packet
|
||||
:dma-vif (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))
|
||||
:vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)
|
||||
)
|
||||
:gif (new 'static 'array uint64 2 #x50ab400000008001 #x53531)
|
||||
)
|
||||
:draw-slow-time-tmpl (new 'static 'dma-gif-packet
|
||||
:dma-vif (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x13 :id (dma-tag-id cnt))
|
||||
:vif1 (new 'static 'vif-tag :imm #x13 :cmd (vif-cmd direct) :msk #x1)
|
||||
)
|
||||
:gif (new 'static 'array uint64 2 #x30aec00000008006 #x531)
|
||||
)
|
||||
:line-tmpl (new 'static 'dma-gif-packet
|
||||
:dma-vif (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x41 :id (dma-tag-id cnt))
|
||||
:vif1 (new 'static 'vif-tag :imm #x41 :cmd (vif-cmd direct) :msk #x1)
|
||||
)
|
||||
:gif (new 'static 'array uint64 2 #x2020c00000008020 #x55)
|
||||
)
|
||||
:scan-tmpl (new 'static 'dma-gif-packet
|
||||
:dma-vif (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x4c :id (dma-tag-id cnt))
|
||||
:vif1 (new 'static 'vif-tag :imm #x4c :cmd (vif-cmd direct) :msk #x1)
|
||||
)
|
||||
:gif (new 'static 'array uint64 2 #x5020c0000000800f #x55551)
|
||||
)
|
||||
:color (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80)
|
||||
:line-color #x3f80000000000000
|
||||
:scan-colors (new 'static 'inline-array vector4w 15
|
||||
(new 'static 'vector4w :y 1 :z 1)
|
||||
(new 'static 'vector4w :y 1 :z 1)
|
||||
(new 'static 'vector4w :y 1 :z 1)
|
||||
(new 'static 'vector4w :y 1 :z 1)
|
||||
(new 'static 'vector4w :x 1 :y 3 :z 2)
|
||||
(new 'static 'vector4w :x 1 :y 4 :z 3)
|
||||
(new 'static 'vector4w :x 2 :y 6 :z 5)
|
||||
(new 'static 'vector4w :x 3 :y 8 :z 7)
|
||||
(new 'static 'vector4w :x 5 :y 11 :z 10)
|
||||
(new 'static 'vector4w :x 6 :y 14 :z 13)
|
||||
(new 'static 'vector4w :x 9 :y 20 :z 17)
|
||||
(new 'static 'vector4w :x 13 :y 27 :z 21)
|
||||
(new 'static 'vector4w :x 17 :y 36 :z 24)
|
||||
(new 'static 'vector4w :x 22 :y 45 :z 28)
|
||||
(new 'static 'vector4w :x 32 :y 63 :z 32)
|
||||
)
|
||||
:menu-mode #f
|
||||
:screen-copied #f
|
||||
:horizontal-flip-flag #f
|
||||
)
|
||||
)
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
|
||||
@@ -5,5 +5,7 @@
|
||||
;; name in dgo: texture-anim-funcs
|
||||
;; dgos: GAME
|
||||
|
||||
(define *fog-texture-work* (new 'static 'fog-texture-work :const (new 'static 'vector :x 0.00390625)))
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
|
||||
@@ -7,3 +7,22 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(setup-font-texture *texture-pool*)
|
||||
|
||||
(let ((v1-2 (get-texture skull-gem-dest programmer)))
|
||||
(when v1-2
|
||||
(set! (-> v1-2 w) 32)
|
||||
(set! (-> v1-2 h) 32)
|
||||
(set! (-> v1-2 dest 0) (-> *skull-gem-texture-base* vram-block))
|
||||
)
|
||||
)
|
||||
|
||||
(format #t "skipping init in texture-finish.~%")
|
||||
; (init! *sky-texture-anim-array*)
|
||||
; (init! *darkjak-texture-anim-array*)
|
||||
; (init! *skull-gem-texture-anim-array*)
|
||||
; (init! *default-water-texture-anim-array*)
|
||||
; (init! *default-warp-texture-anim-array*)
|
||||
|
||||
(kmemclose)
|
||||
|
||||
|
||||
@@ -294,6 +294,8 @@ of the texture."
|
||||
(link-test link-test-flags :overlay-at (-> quad 0 data 2))
|
||||
(texture-id texture-id :overlay-at reg-1)
|
||||
(next shader-ptr :overlay-at reg-2)
|
||||
(alpha-as-miptb2 gs-miptbp :overlay-at alpha)
|
||||
(reg-4-u32 gs-reg32 :overlay-at reg-4)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -7,3 +7,23 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(define *generic-envmap-texture* (get-texture pal-environment-front environment-generic))
|
||||
(define *default-envmap-shader* (new 'global 'adgif-shader))
|
||||
|
||||
(let ((gp-0 *default-envmap-shader*))
|
||||
(let ((a1-1 *generic-envmap-texture*))
|
||||
(adgif-shader<-texture! gp-0 a1-1)
|
||||
)
|
||||
(set! (-> gp-0 tex1) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1))
|
||||
(set! (-> gp-0 clamp) (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)))
|
||||
(set! (-> gp-0 alpha) (new 'static 'gs-alpha :b #x2 :c #x1 :d #x1))
|
||||
(set! (-> gp-0 prims 1) (gs-reg64 tex0-1))
|
||||
(set! (-> gp-0 prims 3) (gs-reg64 tex1-1))
|
||||
(set! (-> gp-0 prims 5) (gs-reg64 miptbp1-1))
|
||||
(set! (-> gp-0 clamp-reg) (gs-reg64 clamp-1))
|
||||
(set! (-> gp-0 prims 9) (gs-reg64 alpha-1))
|
||||
)
|
||||
|
||||
(set! (-> *texture-pool* allocate-func) texture-page-common-boot-allocate)
|
||||
|
||||
(kmemopen global "tpages")
|
||||
@@ -716,6 +716,10 @@
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defun upload-vram-data ((dma-buf dma-buffer) (dest int) (data-ptr pointer) (h int) (w int))
|
||||
"Add DMA to later upload a texture, by reference. Sets up the GIF for receiving the texture."
|
||||
(#when PC_PORT
|
||||
;; disabled.
|
||||
(return #f)
|
||||
)
|
||||
(let ((v1-0 *display*)
|
||||
(a0-2 (* 96 (+ (sar h 11) 1)))
|
||||
)
|
||||
@@ -829,6 +833,13 @@
|
||||
(+! s5-0 sv-32)
|
||||
)
|
||||
(dma-buffer-add-gs-set s3-0 (texflush 1))
|
||||
|
||||
(#when PC_PORT
|
||||
(dma-buffer-add-cnt-vif2 s3-0 1 (new 'static 'vif-tag :cmd (vif-cmd pc-port)) (the-as vif-tag 3))
|
||||
(dma-buffer-add-uint64 s3-0 page)
|
||||
(dma-buffer-add-uint64 s3-0 mode)
|
||||
)
|
||||
|
||||
(let ((a3-3 (-> s3-0 base)))
|
||||
(when (!= s4-0 a3-3)
|
||||
(let ((v1-56 (the-as dma-packet (-> s3-0 base))))
|
||||
@@ -906,6 +917,76 @@
|
||||
0
|
||||
)
|
||||
|
||||
;; og:preserve-this pc port function
|
||||
(defun upload-vram-pages-pris-pc ((pool texture-pool)
|
||||
(dest-seg texture-pool-segment)
|
||||
(tpage texture-page)
|
||||
(bucket bucket-id)
|
||||
(mask (pointer int32))
|
||||
)
|
||||
"Build DMA for uploading the given texture-page in pc format.
|
||||
We don't use the mask system of the original game properly."
|
||||
(if (not tpage)
|
||||
(return 0)
|
||||
)
|
||||
(let* ((dma-buf (-> *display* frames (-> *display* on-screen) global-buf))
|
||||
(s4-0 (-> dma-buf base))
|
||||
(any-uploads #f)
|
||||
(vram-ptr (shr (-> tpage segment 0 dest) 12))
|
||||
(tpage-num-chunks (the-as int (-> tpage size)))
|
||||
(tpage-id (-> tpage id))
|
||||
)
|
||||
;; align and truncate
|
||||
(set! tpage-num-chunks (shr (min (the-as int (-> dest-seg size)) (the-as int (+ tpage-num-chunks 4095))) 12))
|
||||
|
||||
;; loop over chunks, seeing if any need to be uploaded.
|
||||
(dotimes (chunk-idx tpage-num-chunks)
|
||||
(let ((mask-work (-> mask (/ chunk-idx 32))))
|
||||
(when (logtest? mask-work (ash 1 (logand chunk-idx 31)))
|
||||
(set! any-uploads #t)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; not used at all. we don't set merc masks on PC, so this should happen most of the time.
|
||||
; (when (not any-uploads)
|
||||
; (return 0)
|
||||
; )
|
||||
|
||||
;; but non-merc users of this function (like map/hud) will get here
|
||||
|
||||
;; upload everything in the tpage.
|
||||
;; uploads are "free" on PC, so no harm, but we have to tell the game we're doing this
|
||||
;; otherwise it might think that an old texture was left behind and skip a later upload
|
||||
(dotimes (chunk-idx tpage-num-chunks)
|
||||
(let ((chunk-dest (+ vram-ptr chunk-idx)))
|
||||
(set! (-> pool ids chunk-dest) tpage-id)
|
||||
)
|
||||
)
|
||||
|
||||
;; tell pc port we upload everything.
|
||||
(dma-buffer-add-cnt-vif2 dma-buf 1 (new 'static 'vif-tag :cmd (vif-cmd pc-port)) (the-as vif-tag 3))
|
||||
(dma-buffer-add-uint64 dma-buf tpage)
|
||||
(dma-buffer-add-uint64 dma-buf -1)
|
||||
|
||||
(let ((a3-5 (-> dma-buf base)))
|
||||
(let ((v1-43 (the-as dma-packet (-> dma-buf base))))
|
||||
(set! (-> v1-43 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
|
||||
(set! (-> v1-43 vif0) (new 'static 'vif-tag))
|
||||
(set! (-> v1-43 vif1) (new 'static 'vif-tag))
|
||||
(set! (-> dma-buf base) (the-as pointer (&+ v1-43 16)))
|
||||
)
|
||||
(dma-bucket-insert-tag
|
||||
(-> *display* frames (-> *display* on-screen) bucket-group)
|
||||
bucket
|
||||
s4-0
|
||||
(the-as (pointer dma-tag) a3-5)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
(defun upload-vram-pages-pris ((pool texture-pool)
|
||||
(pool-segment texture-pool-segment)
|
||||
(page texture-page)
|
||||
@@ -1345,71 +1426,74 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a1-26 (-> lev texture-anim-array category)))
|
||||
(cond
|
||||
((= category (tpage-category warp))
|
||||
(when (= (-> lev index) 10)
|
||||
(dotimes (s2-1 11)
|
||||
(let ((v1-55 (-> *level* level s2-1)))
|
||||
(when (or (= (-> v1-55 status) 'active) (= (-> v1-55 status) 'reserved))
|
||||
(let ((a1-30 (-> v1-55 texture-anim-array 5)))
|
||||
(if a1-30
|
||||
(update-texture-anim bucket a1-30)
|
||||
)
|
||||
;; added nonzero check.
|
||||
(when (nonzero? update-texture-anim)
|
||||
(let ((a1-26 (-> lev texture-anim-array category)))
|
||||
(cond
|
||||
((= category (tpage-category warp))
|
||||
(when (= (-> lev index) 10)
|
||||
(dotimes (s2-1 11)
|
||||
(let ((v1-55 (-> *level* level s2-1)))
|
||||
(when (or (= (-> v1-55 status) 'active) (= (-> v1-55 status) 'reserved))
|
||||
(let ((a1-30 (-> v1-55 texture-anim-array 5)))
|
||||
(if a1-30
|
||||
(update-texture-anim bucket a1-30)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
((= category (tpage-category sprite))
|
||||
(when (= (-> lev index) 10)
|
||||
(dotimes (s2-2 11)
|
||||
(let ((v1-64 (-> *level* level s2-2)))
|
||||
(when (or (= (-> v1-64 status) 'active) (= (-> v1-64 status) 'reserved))
|
||||
(let ((a1-34 (-> v1-64 texture-anim-array 7)))
|
||||
(if a1-34
|
||||
(update-texture-anim bucket a1-34)
|
||||
)
|
||||
((= category (tpage-category sprite))
|
||||
(when (= (-> lev index) 10)
|
||||
(dotimes (s2-2 11)
|
||||
(let ((v1-64 (-> *level* level s2-2)))
|
||||
(when (or (= (-> v1-64 status) 'active) (= (-> v1-64 status) 'reserved))
|
||||
(let ((a1-34 (-> v1-64 texture-anim-array 7)))
|
||||
(if a1-34
|
||||
(update-texture-anim bucket a1-34)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
((= category (tpage-category hud))
|
||||
(when (= (-> lev index) 10)
|
||||
(dotimes (s2-3 11)
|
||||
(let ((v1-73 (-> *level* level s2-3)))
|
||||
(when (or (= (-> v1-73 status) 'active) (= (-> v1-73 status) 'reserved))
|
||||
(let ((a1-38 (-> v1-73 texture-anim-array 8)))
|
||||
(if a1-38
|
||||
(update-texture-anim bucket a1-38)
|
||||
)
|
||||
((= category (tpage-category hud))
|
||||
(when (= (-> lev index) 10)
|
||||
(dotimes (s2-3 11)
|
||||
(let ((v1-73 (-> *level* level s2-3)))
|
||||
(when (or (= (-> v1-73 status) 'active) (= (-> v1-73 status) 'reserved))
|
||||
(let ((a1-38 (-> v1-73 texture-anim-array 8)))
|
||||
(if a1-38
|
||||
(update-texture-anim bucket a1-38)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
((= category (tpage-category sky))
|
||||
(when (-> *time-of-day-context* sky)
|
||||
(if a1-26
|
||||
(update-texture-anim bucket a1-26)
|
||||
)
|
||||
((= category (tpage-category sky))
|
||||
(when (-> *time-of-day-context* sky)
|
||||
(if a1-26
|
||||
(update-texture-anim bucket a1-26)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
((= bucket (bucket-id tex-lcom-sky-post))
|
||||
(when (and (-> *time-of-day-context* sky) *ocean-map*)
|
||||
(if a1-26
|
||||
(update-texture-anim bucket a1-26)
|
||||
)
|
||||
((= bucket (bucket-id tex-lcom-sky-post))
|
||||
(when (and (-> *time-of-day-context* sky) *ocean-map*)
|
||||
(if a1-26
|
||||
(update-texture-anim bucket a1-26)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(if a1-26
|
||||
(update-texture-anim bucket a1-26)
|
||||
)
|
||||
(else
|
||||
(if a1-26
|
||||
(update-texture-anim bucket a1-26)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1456,7 +1540,8 @@
|
||||
(defun upload-textures ((pool texture-pool))
|
||||
"Set up DMA for all texture uploads for this frame."
|
||||
(cond
|
||||
((not (get-screen-copied *blit-displays-work*))
|
||||
;; added the nonzero check here.
|
||||
((and (nonzero? *blit-displays-work*) (not (get-screen-copied *blit-displays-work*)))
|
||||
(set-skull-gem-masks)
|
||||
(set! (-> *level* level-default texture-anim-array 0) *skull-gem-texture-anim-array*)
|
||||
)
|
||||
@@ -1490,7 +1575,7 @@
|
||||
(add-level-tpage-dma pool s3-0 (the-as tpage-category (-> s4-0 level-texture-page)) (-> s4-0 bucket))
|
||||
)
|
||||
(else
|
||||
(if (not (get-menu-mode *blit-displays-work*))
|
||||
(if (or (zero? *blit-displays-work*) (not (get-menu-mode *blit-displays-work*))) ;; added or check.
|
||||
(add-level-tpage-dma pool s3-0 (the-as tpage-category (-> s4-0 level-texture-page)) (-> s4-0 bucket))
|
||||
)
|
||||
)
|
||||
@@ -1521,7 +1606,11 @@
|
||||
(defmethod upload-now! ((this texture-page) (mode tex-upload-mode))
|
||||
"Upload a texture to VRAM immediately, wait for DMA to finish."
|
||||
|
||||
(format 0 "TODO: upload-now!~%")
|
||||
;; og:preserve-this
|
||||
(#when PC_PORT
|
||||
;; load it to the PC Port's texture pool.
|
||||
(__pc-texture-upload-now this mode)
|
||||
)
|
||||
(let ((gp-0 *txt-dma-list*))
|
||||
(let ((v1-0 gp-0))
|
||||
(set! (-> v1-0 base) (-> v1-0 data))
|
||||
@@ -1577,6 +1666,13 @@
|
||||
|
||||
(defun texture-relocate ((dma-buf dma-buffer) (tex texture) (dest int) (tex-format gs-psm) (clut-dest int))
|
||||
"Move a texture in VRAM."
|
||||
|
||||
;; og:preserve-this
|
||||
(#when PC_PORT
|
||||
;; as far as I know this is only used for fonts which have 1 mip level.
|
||||
(__pc-texture-relocate (/ dest 64) (-> tex dest 0) tex-format)
|
||||
(return dma-buf)
|
||||
)
|
||||
(dotimes (v1-0 (the-as int (-> tex num-mips)))
|
||||
(let ((t1-1 (ash (-> tex w) (- v1-0)))
|
||||
(t2-3 (ash (-> tex h) (- v1-0)))
|
||||
@@ -1718,7 +1814,9 @@
|
||||
(set! (-> (the-as (pointer uint64) a0-32) 1) (the-as uint 0))
|
||||
(set! (-> v1-30 base) (&+ a0-32 16))
|
||||
)
|
||||
(dma-buffer-send-chain (the-as dma-bank-source #x10009000) s4-0)
|
||||
(#unless PC_PORT
|
||||
(dma-buffer-send-chain (the-as dma-bank-source #x10009000) s4-0)
|
||||
)
|
||||
)
|
||||
(dma-sync (the-as pointer #x10009000) 0 0)
|
||||
(if (and s5-0 (-> s5-0 page) (= (-> this cur) (+ sv-16 (-> s5-0 page size))))
|
||||
@@ -1804,6 +1902,9 @@
|
||||
)
|
||||
(set! (-> this segment 1 dest) (-> this segment 0 size))
|
||||
(set! (-> this segment 2 dest) (+ (-> this segment 0 size) (-> this segment 1 size)))
|
||||
|
||||
;; todo, if needed, pc texture remaps (__pc-get-tex-remap)
|
||||
|
||||
(set! (-> this vram-size) (-> this size))
|
||||
(let* ((a3-0 (-> this id))
|
||||
(s4-0 (-> *texture-page-dir* entries a3-0))
|
||||
@@ -2247,7 +2348,12 @@
|
||||
)
|
||||
)
|
||||
|
||||
(when (not *debug-segment*)
|
||||
;; modified for PC port: never bother with the debug-mode texture login.
|
||||
;; it will never work on PC, and it causes problems with custom levels, due to the way that it allocates the link
|
||||
;; array for texture-pages that don't exist, which are never then set to false, causing them to be referenced
|
||||
;; after the level is unloaded. This probably works fine if you are playing one level at a time, or if the backup
|
||||
;; texture page loading actually works.
|
||||
(when (or (not *debug-segment*) PC_PORT)
|
||||
(set! adgif-shader-login adgif-shader-login-fast)
|
||||
(set! adgif-shader-login-no-remap adgif-shader-login-no-remap-fast)
|
||||
)
|
||||
@@ -2395,5 +2501,47 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun adgif-shader<-texture! ((arg0 adgif-shader) (arg1 texture))
|
||||
"Set up an adgif-shader from a texture."
|
||||
(set! (-> arg0 tex1 mxl) (+ (-> arg1 num-mips) -1))
|
||||
(set! (-> arg0 tex1 l) (-> arg1 mip-shift))
|
||||
(set! (-> arg0 tex1 mmag) (logand (-> arg1 tex1-control) 1))
|
||||
(set! (-> arg0 tex1 mmin) (shr (-> arg1 tex1-control) 1))
|
||||
(set! (-> arg0 tex0) (new 'static 'gs-tex0
|
||||
:tcc #x1
|
||||
:cld #x1
|
||||
:cpsm (-> arg1 clutpsm)
|
||||
:cbp (-> arg1 clutdest)
|
||||
:tfx (-> arg0 tex0 tfx)
|
||||
:th (log2 (-> arg1 h))
|
||||
:tw (log2 (-> arg1 w))
|
||||
:tbw (-> arg1 width 0)
|
||||
:tbp0 (-> arg1 dest 0)
|
||||
:psm (the-as int (-> arg1 psm))
|
||||
)
|
||||
)
|
||||
(set! (-> arg0 miptbp1) (new 'static 'gs-miptbp
|
||||
:tbp1 (-> arg1 dest 1)
|
||||
:tbw1 (-> arg1 width 1)
|
||||
:tbp2 (-> arg1 dest 2)
|
||||
:tbw2 (-> arg1 width 2)
|
||||
:tbp3 (-> arg1 dest 3)
|
||||
:tbw3 (-> arg1 width 3)
|
||||
)
|
||||
)
|
||||
(when (< (the-as uint 4) (-> arg1 num-mips))
|
||||
(set! (-> arg0 alpha-as-miptb2) (new 'static 'gs-miptbp
|
||||
:tbp1 (-> arg1 dest 4)
|
||||
:tbw1 (-> arg1 width 4)
|
||||
:tbp2 (-> arg1 dest 5)
|
||||
:tbw2 (-> arg1 width 5)
|
||||
:tbp3 (-> arg1 dest 6)
|
||||
:tbw3 (-> arg1 width 6)
|
||||
)
|
||||
)
|
||||
(set! (-> (&-> arg0 reg-4-u32) 0) (gs-reg32 miptbp2-1))
|
||||
)
|
||||
arg0
|
||||
)
|
||||
|
||||
(define *texture-pool* (new 'global 'texture-pool))
|
||||
|
||||
@@ -681,7 +681,7 @@
|
||||
(bucket582 582)
|
||||
(bucket583 583)
|
||||
(debug-no-zbuf2 584)
|
||||
(bucket585 585)
|
||||
(debug-menu 585)
|
||||
(bucket586 586)
|
||||
)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
(defmacro start-debug (str &rest args)
|
||||
`(format 0 ,(string-append "[START] " str) ,@args)
|
||||
0)
|
||||
)
|
||||
|
||||
(defmacro test-play ()
|
||||
"Temporary start macro"
|
||||
@@ -20,7 +20,7 @@
|
||||
(define *kernel-boot-message* 'play)
|
||||
(start-debug "loading GAME.DGO~%")
|
||||
(load-package "game" global)
|
||||
;; (play-boot)
|
||||
(play-boot)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -411,11 +411,15 @@
|
||||
it will kick out levels as needed to make a free slot, and set up a new level, and start
|
||||
the load. This should only be used when you might want to start a load."
|
||||
(local-vars (s5-1 level))
|
||||
|
||||
(start-debug "level-get-for-use: ~A ~A~%" arg0 arg1)
|
||||
(init-level-system this #f)
|
||||
(let* ((s2-0 (lookup-level-info arg0))
|
||||
(s1-0 (remap-level-name s2-0))
|
||||
)
|
||||
(start-debug " remapped name: ~A~%" s1-0)
|
||||
(let ((s5-0 (level-get this s1-0)))
|
||||
(start-debug " existing? ~A~%" s5-0)
|
||||
(when s5-0
|
||||
(level-status-update! s5-0 arg1)
|
||||
(set! s5-1 s5-0)
|
||||
@@ -423,6 +427,7 @@
|
||||
)
|
||||
)
|
||||
(let ((a0-7 (level-get-most-disposable this)))
|
||||
(start-debug " most disposable: ~A~%" a0-7)
|
||||
(set! s5-1 (if a0-7
|
||||
(level-status-update! a0-7 'inactive)
|
||||
a0-7
|
||||
@@ -560,6 +565,7 @@
|
||||
This can do both loading, linking, login, and activation.
|
||||
This is somewhat similar to level-get-for-use, but requires that you already have the level object.
|
||||
This function is the way to transition from loaded to alive/active."
|
||||
(start-debug "level-status-update: ~A ~A (current ~A)~%" this arg0 (-> this status))
|
||||
(case arg0
|
||||
(('inactive)
|
||||
(-> this status)
|
||||
@@ -1649,8 +1655,10 @@
|
||||
(defmethod login-begin ((this level))
|
||||
"Start logging in loaded level data."
|
||||
(set! (-> *texture-pool* allocate-func) texture-page-default-allocate)
|
||||
(format 0 "LOGIN-BEGIN: ~A~%" this)
|
||||
(cond
|
||||
((-> this bsp)
|
||||
(format 0 " and with a bsp too~%")
|
||||
(let ((s5-0 (-> this bsp)))
|
||||
(set! (-> s5-0 level tfrag-gs-test)
|
||||
(if (logtest? (-> s5-0 texture-flags 0) (texture-page-flag alpha-enable))
|
||||
@@ -1733,16 +1741,16 @@
|
||||
(s2-0 (-> s3-0 drawable-trees))
|
||||
)
|
||||
0
|
||||
(.mfc0 s5-0 Count)
|
||||
; (.mfc0 s5-0 Count)
|
||||
(label cfg-1)
|
||||
0
|
||||
(.mfc0 v1-4 Count)
|
||||
(let ((v1-5 (- v1-4 s5-0)))
|
||||
(when (< #x186a0 v1-5)
|
||||
(set! arg0 arg0)
|
||||
(goto cfg-116)
|
||||
)
|
||||
)
|
||||
; (.mfc0 v1-4 Count)
|
||||
; (let ((v1-5 (- v1-4 s5-0)))
|
||||
; (when (< #x186a0 v1-5)
|
||||
; (set! arg0 arg0)
|
||||
; (goto cfg-116)
|
||||
; )
|
||||
; )
|
||||
(let ((s0-0 (the-as int (-> arg1 pos))))
|
||||
(when (= (-> arg1 state) -1)
|
||||
(when (< s0-0 (-> s2-0 length))
|
||||
@@ -2041,7 +2049,10 @@
|
||||
(let ((s1-2 (-> this status)))
|
||||
(set! (-> this status) 'active)
|
||||
(do-nothing *level*)
|
||||
(update-task-masks 'level)
|
||||
(when (nonzero? update-task-masks) ;; added check
|
||||
(format 0 "skipping update-task-masks~%")
|
||||
(update-task-masks 'level)
|
||||
)
|
||||
(assign-draw-indices *level*)
|
||||
(let ((s0-0 (-> this bsp nav-meshes)))
|
||||
(when (nonzero? s0-0)
|
||||
@@ -2425,6 +2436,7 @@
|
||||
(defmethod init-level-system ((this level-group) (arg0 symbol))
|
||||
"If needed, initialize the level system by loading common/art packages and allocating level heaps."
|
||||
(when (zero? (-> *level* heap base))
|
||||
(start-debug "allocating levels~%")
|
||||
(kmemopen global "level-heaps")
|
||||
(when (nmember "game" *kernel-packages*)
|
||||
(set! *kernel-packages* (cons "art" *kernel-packages*))
|
||||
@@ -2446,6 +2458,10 @@
|
||||
(set! (-> gp-1 top-base) (&+ (-> gp-1 base) s5-1))
|
||||
(set! (-> gp-1 top) (-> gp-1 top-base))
|
||||
)
|
||||
(start-debug "GLOBAL~%")
|
||||
(inspect global)
|
||||
(start-debug "LEVEL~%")
|
||||
(inspect (-> this heap))
|
||||
(kmemclose)
|
||||
)
|
||||
0
|
||||
@@ -2706,9 +2722,12 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defconstant *default-boot-level* 'halfpipe)
|
||||
|
||||
(defun play ((arg0 symbol) (arg1 symbol))
|
||||
"Start (or restart) the game!
|
||||
This will start up the display process, and load the initial level."
|
||||
(start-debug "call to play!~%")
|
||||
(kmemopen global "level-boot")
|
||||
(when *kernel-boot-level*
|
||||
(bg (string->symbol (the-as string *kernel-boot-level*)))
|
||||
@@ -2719,7 +2738,7 @@
|
||||
)
|
||||
*kernel-boot-message*
|
||||
(let ((s5-0 (if *debug-segment*
|
||||
'wasall
|
||||
*default-boot-level*
|
||||
'title
|
||||
)
|
||||
)
|
||||
@@ -2738,11 +2757,15 @@
|
||||
)
|
||||
)
|
||||
(set! *time-of-day-fast* #f)
|
||||
(send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0)
|
||||
(send-event (ppointer->process *time-of-day*) 'change 'hour 7)
|
||||
(send-event (ppointer->process *time-of-day*) 'change 'minutes 0)
|
||||
(send-event (ppointer->process *time-of-day*) 'change 'seconds 0)
|
||||
(send-event (ppointer->process *time-of-day*) 'change 'frames 0)
|
||||
|
||||
;; added nonzero check here.
|
||||
(when (nonzero? *time-of-day*)
|
||||
(send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0)
|
||||
(send-event (ppointer->process *time-of-day*) 'change 'hour 7)
|
||||
(send-event (ppointer->process *time-of-day*) 'change 'minutes 0)
|
||||
(send-event (ppointer->process *time-of-day*) 'change 'seconds 0)
|
||||
(send-event (ppointer->process *time-of-day*) 'change 'frames 0)
|
||||
)
|
||||
(set! (-> *time-of-day-context* mode) (time-of-day-palette-id unk3))
|
||||
(set! (-> *mood-control* overide-weather-flag) #f)
|
||||
(set-blackout-frames (seconds 0.02))
|
||||
@@ -2790,6 +2813,8 @@
|
||||
|
||||
(defun play-boot ()
|
||||
"Function called by the C Kernel to start the game (wrapper around play)."
|
||||
|
||||
(start-debug "call to play-boot!~%")
|
||||
(process-spawn-function
|
||||
process
|
||||
(lambda () (play #t #t) (none))
|
||||
@@ -3720,6 +3745,25 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
;; og:preserve-this added
|
||||
(let ((lev-names (new 'stack-no-clear 'array 'string 10))
|
||||
(active-lev-names (new 'stack-no-clear 'array 'string 10)))
|
||||
(dotimes (i 10)
|
||||
(set! (-> active-lev-names i) "none")
|
||||
(set! (-> lev-names i) "none")
|
||||
(cond
|
||||
((or (= (-> this level i status) 'active)
|
||||
(= (-> this level i status) 'alive)
|
||||
(= (-> this level i status) 'loaded))
|
||||
(set! (-> lev-names i) (symbol->string (-> this level i nickname)))
|
||||
(if (-> this level i display?)
|
||||
(set! (-> active-lev-names i) (symbol->string (-> this level i nickname))))
|
||||
)
|
||||
)
|
||||
)
|
||||
(__pc-set-levels lev-names)
|
||||
(__pc-set-active-levels active-lev-names)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -5,5 +5,15 @@
|
||||
;; name in dgo: nav-mesh
|
||||
;; dgos: GAME
|
||||
|
||||
(defmethod initialize-nav-mesh! ((this entity-nav-mesh))
|
||||
(format #t "skipping initialize-nav-mesh~%")
|
||||
(none))
|
||||
|
||||
(defmethod birth! ((this entity-nav-mesh))
|
||||
(format #t "skipping birth! for entity-nav-mesh~%")
|
||||
this
|
||||
)
|
||||
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
|
||||
@@ -5,5 +5,12 @@
|
||||
;; name in dgo: scene
|
||||
;; dgos: GAME
|
||||
|
||||
;; TODO: remove this. just a stub so the game starts
|
||||
(defmethod load-scene ((this scene))
|
||||
(format 0 "unsupported load-scene~%")
|
||||
(format #t "unsupported load-scene~%")
|
||||
this
|
||||
)
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
|
||||
@@ -3317,6 +3317,9 @@
|
||||
)
|
||||
|
||||
(defun start ((arg0 symbol) (arg1 continue-point))
|
||||
(format #t "aborting target start since there is no collide yet.~%")
|
||||
(return *target*)
|
||||
|
||||
(let ((v1-0 arg0))
|
||||
(set! (-> *level* play?) (if (= v1-0 'play)
|
||||
#t
|
||||
|
||||
@@ -76,7 +76,8 @@
|
||||
)
|
||||
)
|
||||
|
||||
(define *profile-translate-array* (new 'static 'array uint64 584
|
||||
;; the size of this is not quite right...
|
||||
(define *profile-translate-array* (new 'static 'array uint64 587
|
||||
#x0
|
||||
#x0
|
||||
#x0
|
||||
@@ -661,6 +662,8 @@
|
||||
#xc
|
||||
#xc
|
||||
#xc
|
||||
0 ;; hack...
|
||||
0 ;; another hack
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -5,5 +5,42 @@
|
||||
;; name in dgo: script
|
||||
;; dgos: GAME
|
||||
|
||||
(defun command-get-float ((arg0 object) (arg1 float))
|
||||
(cond
|
||||
((null? arg0)
|
||||
(empty)
|
||||
arg1
|
||||
)
|
||||
((type? arg0 binteger)
|
||||
(the float (/ (the-as int arg0) 8))
|
||||
)
|
||||
((type? arg0 bfloat)
|
||||
(-> (the-as bfloat arg0) data)
|
||||
)
|
||||
(else
|
||||
(empty)
|
||||
arg1
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defun command-get-int ((arg0 object) (arg1 int))
|
||||
(cond
|
||||
((null? arg0)
|
||||
(empty)
|
||||
arg1
|
||||
)
|
||||
((type? arg0 binteger)
|
||||
(the-as int (/ (the-as int arg0) 8))
|
||||
)
|
||||
((type? arg0 bfloat)
|
||||
(the int (-> (the-as bfloat arg0) data))
|
||||
)
|
||||
(else
|
||||
(empty)
|
||||
arg1
|
||||
)
|
||||
)
|
||||
)
|
||||
;; DECOMP BEGINS
|
||||
|
||||
|
||||
@@ -96,8 +96,11 @@
|
||||
;; the case of a .o appearing in multiple dgos. But, if we depend on the last item in both lists, it
|
||||
;; works out.
|
||||
|
||||
(define common-dep '("$OUT/obj/default-menu.o"))
|
||||
(cgo-file "halfpipe.gd" common-dep)
|
||||
(cgo-file "wasall.gd" common-dep)
|
||||
|
||||
#|
|
||||
(define common-dep '("$OUT/obj/cty-guard-turret-button.o" "$OUT/obj/default-menu-pc.o"))
|
||||
(cgo-file "preca.gd" common-dep)
|
||||
(cgo-file "outrocst.gd" common-dep)
|
||||
(cgo-file "ltornsam.gd" common-dep)
|
||||
@@ -229,7 +232,6 @@
|
||||
(cgo-file "sea.gd" common-dep)
|
||||
(cgo-file "nsa.gd" common-dep)
|
||||
(cgo-file "lbiped.gd" common-dep)
|
||||
(cgo-file "wasall.gd" common-dep)
|
||||
(cgo-file "waschase.gd" common-dep)
|
||||
(cgo-file "desrescc.gd" common-dep)
|
||||
(cgo-file "desf.gd" common-dep)
|
||||
@@ -318,7 +320,6 @@
|
||||
(cgo-file "sec.gd" common-dep)
|
||||
(cgo-file "lsnkwhls.gd" common-dep)
|
||||
(cgo-file "loninsim.gd" common-dep)
|
||||
(cgo-file "halfpipe.gd" common-dep)
|
||||
(cgo-file "cib.gd" common-dep)
|
||||
(cgo-file "inttitle.gd" common-dep)
|
||||
(cgo-file "desresc.gd" common-dep)
|
||||
|
||||
@@ -328,6 +328,8 @@
|
||||
|
||||
(define-extern __pc-texture-upload-now (function object object none))
|
||||
(define-extern __pc-texture-relocate (function object object object none))
|
||||
(define-extern __pc-set-levels (function (pointer string) none))
|
||||
(define-extern __pc-set-active-levels (function (pointer string) none))
|
||||
|
||||
(define-extern link-resume (function int))
|
||||
(define-extern unload (function string none))
|
||||
|
||||
@@ -112,15 +112,15 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmacro copy-go (name)
|
||||
(let* ((path (string-append "$DECOMP/raw_obj/" name ".go")))
|
||||
(defmacro copy-obj (name)
|
||||
(let* ((path (string-append "$DECOMP/raw_obj/" name)))
|
||||
`(defstep :in ,path
|
||||
:tool 'copy
|
||||
:out '(,(string-append "$OUT/obj/" name ".go")))))
|
||||
:out '(,(string-append "$OUT/obj/" name)))))
|
||||
|
||||
(defmacro copy-gos (&rest gos)
|
||||
(defmacro copy-objs (&rest gos)
|
||||
`(begin
|
||||
,@(apply (lambda (x) `(copy-go ,x)) gos)
|
||||
,@(apply (lambda (x) `(copy-obj ,x)) gos)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
(set! curr-elt (cdr curr-elt)))
|
||||
new-list))
|
||||
|
||||
(defmacro cgo-file (dgo-file-name deps)
|
||||
(defmacro cgo-file (dgo-file-name deps &key (bsp-file-name #f))
|
||||
;; First read in the DGO file, it has pretty much everything we need
|
||||
(let ((dgo-data (car (read-data-file (string-append "goal_src/jak3/dgos/" dgo-file-name)))))
|
||||
;; Get the name of the DGO
|
||||
@@ -175,7 +175,7 @@
|
||||
(files (cadr dgo-data))
|
||||
(gsrc-seq-args '())
|
||||
(textures '())
|
||||
(gos '()))
|
||||
(objs '()))
|
||||
;; create the dgo step
|
||||
(cgo dgo-name dgo-file-name)
|
||||
;; Now we iterate through the list of files, skipping ones we've already processed
|
||||
@@ -186,7 +186,9 @@
|
||||
(when (not (car (hash-table-try-ref *file-entry-map* file-name)))
|
||||
;; Depending on the type of file, generate the appropriate steps
|
||||
(cond
|
||||
((string-ends-with? file-name ".o")
|
||||
((and (string-ends-with? file-name ".o")
|
||||
(neq? file-name bsp-file-name)
|
||||
)
|
||||
;; build up a list of all gsrc files needing to be compiled
|
||||
(let ((base-name (symbol->string (first (string-split file-name ".")))))
|
||||
(cond
|
||||
@@ -211,23 +213,25 @@
|
||||
;; copy textures
|
||||
(let ((tpage-id (second (string-split (symbol->string (first (string-split file-name "."))) "-"))))
|
||||
(set! textures (cons tpage-id textures))))
|
||||
((string-ends-with? file-name ".go")
|
||||
((or (string-ends-with? file-name ".go")
|
||||
(eq? file-name bsp-file-name)
|
||||
)
|
||||
;; copy art files
|
||||
(set! gos (cons (stem file-name) gos))))
|
||||
(set! objs (cons file-name objs))))
|
||||
;; Update the map so this file isn't processed again
|
||||
(hash-table-set! *file-entry-map* file-name #f)))
|
||||
(set! files (cdr files)))
|
||||
;; TODO - need an `append`!, reverse lists by re-cons'ing them for now
|
||||
(set! gsrc-seq-args (reverse-list gsrc-seq-args))
|
||||
(set! textures (reverse-list textures))
|
||||
(set! gos (reverse-list gos))
|
||||
(set! objs (reverse-list objs))
|
||||
`(begin
|
||||
;; macros can't return nothing, so these macros assume they will be given a non-empty list
|
||||
(when (not (null? '(,@gsrc-seq-args)))
|
||||
(goal-src-sequence "" :deps ,(eval deps) ,@gsrc-seq-args))
|
||||
(when (not (null? '(,@textures)))
|
||||
(copy-textures ,@textures))
|
||||
(when (not (null? '(,@gos)))
|
||||
(copy-gos ,@gos)))
|
||||
(when (not (null? '(,@objs)))
|
||||
(copy-objs ,@objs)))
|
||||
)
|
||||
))
|
||||
|
||||
@@ -96,7 +96,8 @@ class Compiler {
|
||||
std::vector<std::pair<std::string, replxx::Replxx::Color>> const& user_data);
|
||||
bool knows_object_file(const std::string& name);
|
||||
MakeSystem& make_system() { return m_make; }
|
||||
std::set<std::string> lookup_symbol_infos_starting_with(const std::string& prefix) const;
|
||||
std::set<std::string> lookup_symbol_infos_starting_with(const std::string& prefix,
|
||||
int max_count) const;
|
||||
std::vector<SymbolInfo>* lookup_exact_name_info(const std::string& name) const;
|
||||
std::optional<TypeSpec> lookup_typespec(const std::string& symbol_name);
|
||||
|
||||
|
||||
@@ -220,9 +220,10 @@ class SymbolInfoMap {
|
||||
return m_map.lookup(name);
|
||||
}
|
||||
|
||||
std::set<std::string> lookup_symbols_starting_with(const std::string& prefix) const {
|
||||
std::set<std::string> lookup_symbols_starting_with(const std::string& prefix,
|
||||
int max_count) const {
|
||||
std::set<std::string> result;
|
||||
auto lookup = m_map.lookup_prefix(prefix);
|
||||
auto lookup = m_map.lookup_prefix(prefix, max_count);
|
||||
for (auto& x : lookup) {
|
||||
for (auto& y : *x) {
|
||||
result.insert(y.name());
|
||||
|
||||
@@ -439,7 +439,8 @@ replxx::Replxx::completions_t Compiler::find_symbols_or_object_file_by_prefix(
|
||||
} else {
|
||||
const auto [token, stripped_leading_paren] = m_repl->get_current_repl_token(context);
|
||||
// Otherwise, look for symbols
|
||||
auto possible_forms = lookup_symbol_infos_starting_with(token);
|
||||
constexpr int kMaxForms = 100;
|
||||
auto possible_forms = lookup_symbol_infos_starting_with(token, kMaxForms);
|
||||
|
||||
for (auto& x : possible_forms) {
|
||||
completions.push_back(stripped_leading_paren ? "(" + x : x);
|
||||
@@ -456,7 +457,8 @@ replxx::Replxx::hints_t Compiler::find_hints_by_prefix(std::string const& contex
|
||||
(void)contextLen;
|
||||
(void)user_data;
|
||||
auto token = m_repl->get_current_repl_token(context);
|
||||
auto possible_forms = lookup_symbol_infos_starting_with(token.first);
|
||||
constexpr int kMaxForms = 100;
|
||||
auto possible_forms = lookup_symbol_infos_starting_with(token.first, kMaxForms);
|
||||
|
||||
replxx::Replxx::hints_t hints;
|
||||
|
||||
@@ -550,7 +552,8 @@ Val* Compiler::compile_autocomplete(const goos::Object& form, const goos::Object
|
||||
va_check(form, args, {goos::ObjectType::SYMBOL}, {});
|
||||
|
||||
Timer timer;
|
||||
auto result = m_symbol_info.lookup_symbols_starting_with(args.unnamed.at(0).as_symbol().name_ptr);
|
||||
auto result =
|
||||
m_symbol_info.lookup_symbols_starting_with(args.unnamed.at(0).as_symbol().name_ptr, -1);
|
||||
auto time = timer.getMs();
|
||||
|
||||
for (auto& x : result) {
|
||||
@@ -588,9 +591,10 @@ Val* Compiler::compile_update_macro_metadata(const goos::Object& form,
|
||||
return get_none();
|
||||
}
|
||||
|
||||
std::set<std::string> Compiler::lookup_symbol_infos_starting_with(const std::string& prefix) const {
|
||||
std::set<std::string> Compiler::lookup_symbol_infos_starting_with(const std::string& prefix,
|
||||
int max_count) const {
|
||||
if (m_goos.reader.check_string_is_valid(prefix)) {
|
||||
return m_symbol_info.lookup_symbols_starting_with(prefix);
|
||||
return m_symbol_info.lookup_symbols_starting_with(prefix, max_count);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user