"quit game" option in title + reduce particle cap (30720 2D -> 15360 2D) (#1410)

* add "quit game" option to title

* reduce amount of particles in particle system

* increase merc2 memory

* enable extra particles by default

* fix tests
This commit is contained in:
ManDude 2022-06-03 02:40:37 +01:00 committed by GitHub
parent b9e23514dc
commit b173734e1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 466 additions and 26 deletions

View File

@ -15519,6 +15519,7 @@
(music-player)
(scene-player)
(credits)
(quit-title)
;; the last one!
(max)

View File

@ -82,16 +82,16 @@
"LEVEL OF DETAIL (BACKGROUND)")
(#x1071 "LEVEL OF DETAIL (FOREGROUND)"
"LEVEL OF DETAIL (FOREGROUND)")
(#x1072 "HIGHEST"
"HIGHEST")
(#x1072 "MAXIMUM"
"MAXIMUM")
(#x1073 "HIGH"
"HIGH")
(#x1074 "MID"
"MID")
(#x1074 "MEDIUM"
"MEDIUM")
(#x1075 "LOW"
"LOW")
(#x1076 "LOWEST"
"LOWEST")
(#x1076 "MINIMUM"
"MINIMUM")
(#x1077 "PS2"
"PS2")

View File

@ -73,7 +73,7 @@ class Merc2 : public BucketRenderer {
static constexpr int MAX_SKEL_BONES = 128;
static constexpr int BONE_VECTORS_PER_BONE = 7;
static constexpr int MAX_SHADER_BONE_VECTORS = 8192; // ??
static constexpr int MAX_SHADER_BONE_VECTORS = 1024 * 32; // ??
static constexpr int MAX_LEVELS = 3;
static constexpr int MAX_DRAWS_PER_LEVEL = 1024;
@ -137,7 +137,7 @@ class Merc2 : public BucketRenderer {
}
};
static constexpr int MAX_LIGHTS = 256;
static constexpr int MAX_LIGHTS = 1024;
VuLights m_lights_buffer[MAX_LIGHTS];
u32 m_next_free_light = 0;
VuLights m_current_lights;

View File

@ -5,7 +5,12 @@
;; name in dgo: sprite-h
;; dgos: GAME, ENGINE
;; definition of type sprite-vec-data-2d
(#if PC_BIG_MEMORY
(defconstant SPRITE_MAX_AMOUNT_MULT 8)
(none))
(deftype sprite-vec-data-2d (structure)
((x-y-z-sx vector :inline :offset-assert 0)
(flag-rot-sy vector :inline :offset-assert 16)

View File

@ -394,8 +394,8 @@
(defmethod new sprite-array-2d ((allocation symbol) (type-to-make type) (group-0-size int) (group-1-size int))
"Allocate a sprite-array for 2d sprites. There are two groups, each can contain the given number."
(#when PC_BIG_MEMORY
(*! group-0-size 16) ;; 16x more particles!
(*! group-1-size 16) ;; 16x more particles!
(*! group-0-size SPRITE_MAX_AMOUNT_MULT)
(*! group-1-size SPRITE_MAX_AMOUNT_MULT)
)
(let* ((sprite-count (+ group-0-size group-1-size))
(vec-data-size (* 3 sprite-count)) ;; 3 quadwords of vec-data per sprite
@ -421,8 +421,8 @@
"Allocate a sprite-array for 3d sprites. There are two groups, each can contain the given number of sprites.
Group 1 size is zero in practice for 3d."
(#when PC_BIG_MEMORY
(*! group-0-size 16) ;; 16x more particles!
(*! group-1-size 16) ;; 16x more particles!
(*! group-0-size SPRITE_MAX_AMOUNT_MULT)
(*! group-1-size SPRITE_MAX_AMOUNT_MULT)
)
(let* ((sprite-count (+ group-0-size group-1-size))
(vec-data-size (* 3 sprite-count))

View File

@ -63,8 +63,8 @@
arg3: pointer to sprite allocations
arg4: pointer to adgif allocation"
(#when PC_BIG_MEMORY
(*! arg0 16) ;; 16x more particles!
(*! arg1 16) ;; 16x more particles!
(*! arg0 SPRITE_MAX_AMOUNT_MULT)
(*! arg1 SPRITE_MAX_AMOUNT_MULT)
)
(let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(let* ((v1-3 (/ (+ arg0 63) 64)) ;; num blocks

View File

@ -118,6 +118,7 @@
(music-player)
(scene-player)
(credits)
(quit-title)
;; the last one!
(max)

View File

@ -410,7 +410,7 @@
"Set the default ps2 settings"
(set! (-> obj ps2-read-speed?) #f)
(set! (-> obj ps2-parts?) #t)
(set! (-> obj ps2-parts?) #f)
(set! (-> obj ps2-music?) #t)
(set! (-> obj ps2-se?) #t)
(set! (-> obj ps2-hints?) #t)

View File

@ -203,6 +203,16 @@
)
)
(define *title-pc*
(new 'static 'boxed-array :type game-option :length 5 :allocated-length 5
(new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id new-game) :scale #t :param3 (game-option-menu save-game-title))
(new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id load-game) :scale #t :param3 (game-option-menu load-game))
(new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id options) :scale #t :param3 (game-option-menu settings-title))
(new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id quit-game) :scale #t :param3 (game-option-menu quit-title))
(new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t)
)
)
(define *back-button* (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t))
(define-perm *temp-options-alloced* symbol #f)
@ -461,7 +471,7 @@
(set! (-> *options-remap* (progress-screen memcard-auto-save-error)) *ok-options*)
(set! (-> *options-remap* (progress-screen memcard-removed)) *ok-options*)
(set! (-> *options-remap* (progress-screen memcard-no-data)) *yes-no-options*)
(set! (-> *options-remap* (progress-screen title)) *title*)
(set! (-> *options-remap* (progress-screen title)) *title-pc*)
(set! (-> *options-remap* (progress-screen settings-title)) *options*)
(set! (-> *options-remap* (progress-screen auto-save)) *ok-options*)
(set! (-> *options-remap* (progress-screen pal-change-to-60hz)) *yes-no-options*)
@ -470,13 +480,14 @@
(set! (-> *options-remap* (progress-screen bad-disc)) *ok-options*)
(set! (-> *options-remap* (progress-screen quit)) *yes-no-options*)
;; our screens!
(set! (-> *options-remap* (progress-screen aspect-msg)) *yes-no-options*)
(set! (-> *options-remap* (progress-screen camera-options)) *camera-options*)
(set! (-> *options-remap* (progress-screen misc-options)) *misc-options*)
(set! (-> *options-remap* (progress-screen accessibility-options)) *accessibility-options*)
(set! (-> *options-remap* (progress-screen gfx-ps2-options)) *gfx-ps2-options*)
(set! (-> *options-remap* (progress-screen resolution)) *temp-options*)
(set! (-> *options-remap* (progress-screen aspect-ratio)) *aspect-ratio-options*)
(set! (-> *options-remap* (progress-screen aspect-msg)) *yes-no-options*)
(set! (-> *options-remap* (progress-screen camera-options)) *camera-options*)
(set! (-> *options-remap* (progress-screen misc-options)) *misc-options*)
(set! (-> *options-remap* (progress-screen accessibility-options)) *accessibility-options*)
(set! (-> *options-remap* (progress-screen gfx-ps2-options)) *gfx-ps2-options*)
(set! (-> *options-remap* (progress-screen resolution)) *temp-options*)
(set! (-> *options-remap* (progress-screen aspect-ratio)) *aspect-ratio-options*)
(set! (-> *options-remap* (progress-screen quit-title)) *yes-no-options*)
;; set default params
(set! (-> *progress-state* aspect-ratio-choice) (get-aspect-ratio))
@ -1090,6 +1101,208 @@
(none)
)
(defmethod respond-memcard progress ((obj progress))
"logic for handling input in memcard screens."
(let ((s5-0 (-> obj card-info)))
(when (and s5-0 (not (-> obj in-transition)))
(when (or (cpad-pressed? 0 x) (cpad-pressed? 0 circle))
(cpad-clear! 0 x)
(cpad-clear! 0 circle)
(case (-> obj display-state)
(((progress-screen load-game))
(cond
((< (-> obj option-index) 4)
(when (nonzero? (-> s5-0 file (-> obj option-index) present))
(sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> *progress-state* which) (-> obj option-index))
(set! (-> obj next-display-state) (progress-screen memcard-loading))
)
)
(else
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj next-display-state) (progress-screen invalid))
)
)
)
(((progress-screen save-game) (progress-screen save-game-title))
(cond
((< (-> obj option-index) 4)
(sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> *progress-state* which) (-> obj option-index))
(if (zero? (-> s5-0 file (-> obj option-index) present))
(set! (-> obj next-display-state) (progress-screen memcard-saving))
(set! (-> obj next-display-state) (progress-screen memcard-data-exists))
)
)
((and (= (-> obj display-state) (progress-screen save-game-title)) (= (-> obj option-index) 4))
(sound-play-by-name (static-sound-name "starts-options") (new-sound-id) 1024 0 0 1 #t)
(sound-volume-off)
(set! (-> *game-info* mode) 'play)
(initialize! *game-info* 'game (the-as game-save #f) "intro-start")
(set-master-mode 'game)
)
(else
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj next-display-state) (progress-screen invalid))
)
)
)
(((progress-screen memcard-insert))
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj next-display-state) (progress-screen invalid))
)
(((progress-screen memcard-data-exists))
(cond
((-> *progress-state* yes-no-choice)
(sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj next-display-state) (progress-screen memcard-saving))
)
(else
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(if (= (-> obj display-state-stack 0) (progress-screen title))
(set! (-> obj next-display-state) (progress-screen save-game-title))
(set! (-> obj next-display-state) (progress-screen save-game))
)
)
)
)
(((progress-screen memcard-no-data))
(cond
((-> *progress-state* yes-no-choice)
(sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj next-display-state) (progress-screen memcard-creating))
)
(else
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(sound-volume-off)
(set! (-> *game-info* mode) 'play)
(initialize! *game-info* 'game (the-as game-save #f) "intro-start")
(set-master-mode 'game)
)
)
)
(((progress-screen memcard-no-space)
(progress-screen memcard-not-inserted)
(progress-screen memcard-not-formatted)
)
(cond
((= (-> obj display-state-stack 0) (progress-screen title))
(sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t)
(sound-volume-off)
(set! (-> *game-info* mode) 'play)
(initialize! *game-info* 'game (the-as game-save #f) "intro-start")
(set-master-mode 'game)
)
((nonzero? (-> obj display-state-stack 0))
(sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t)
(set-master-mode 'game)
)
(else
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj next-display-state) (progress-screen invalid))
)
)
)
(((progress-screen memcard-error-loading)
(progress-screen memcard-error-saving)
(progress-screen memcard-error-formatting)
(progress-screen memcard-error-creating)
(progress-screen memcard-auto-save-error)
(progress-screen memcard-removed)
(progress-screen auto-save)
)
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj next-display-state) (progress-screen invalid))
)
(((progress-screen pal-change-to-60hz))
(cond
((-> *progress-state* yes-no-choice)
(sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice))
(set! (-> obj video-mode-timeout) (-> *display* real-frame-counter))
(set! (-> obj next-display-state) (progress-screen pal-now-60hz))
)
(else
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> *progress-state* video-mode-choice) 'pal)
(set! (-> obj next-display-state) (progress-screen invalid))
)
)
)
(((progress-screen pal-now-60hz))
(cond
((not (-> *progress-state* yes-no-choice))
(set! (-> *progress-state* video-mode-choice) 'pal)
(set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice))
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
)
(else
(sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t)
)
)
(set! (-> obj next-display-state) (progress-screen invalid))
)
(((progress-screen no-disc) (progress-screen bad-disc))
(when (is-cd-in?)
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj next-display-state) (progress-screen invalid))
)
)
(((progress-screen quit))
(cond
((-> *progress-state* yes-no-choice)
(sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t)
(sound-volume-off)
(set! (-> *game-info* mode) 'play)
(initialize! *game-info* 'game (the-as game-save #f) "title-start")
)
(else
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj next-display-state) (progress-screen invalid))
)
)
)
(((progress-screen memcard-format))
(cond
((-> *progress-state* yes-no-choice)
(sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj next-display-state) (progress-screen memcard-formatting))
)
((= (-> obj display-state-stack 0) (progress-screen title))
(sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t)
(sound-volume-off)
(set! (-> *game-info* mode) 'play)
(initialize! *game-info* 'game (the-as game-save #f) "intro-start")
(set-master-mode 'game)
)
(else
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj next-display-state) (progress-screen invalid))
)
)
)
(((progress-screen quit-title))
(cond
((-> *progress-state* yes-no-choice)
(sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t)
(sound-volume-off)
(kernel-shutdown)
)
(else
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj next-display-state) (progress-screen invalid))
)
)
)
)
)
)
)
0
(none)
)
(defmethod draw-options progress ((obj progress) (arg0 int) (arg1 int) (arg2 float))
"common logic for drawing options menus."
@ -1377,10 +1590,82 @@
)
(defmethod draw-notice-screen progress ((obj progress))
(hide-progress-icons)
(when *common-text*
(let ((a1-1 (new 'stack 'font-context *font-default-matrix* (- 70 (-> obj left-x-offset)) 10 0.0
(font-color default) (font-flags shadow kerning))))
(case (-> obj display-state)
(((progress-screen memcard-format))
(draw-memcard-format obj a1-1)
)
(((progress-screen memcard-no-space)
(progress-screen memcard-not-inserted)
(progress-screen memcard-not-formatted)
)
(draw-memcard-storage-error obj a1-1)
)
(((progress-screen memcard-data-exists))
(draw-memcard-data-exists obj a1-1)
)
(((progress-screen memcard-no-data))
(draw-memcard-no-data obj a1-1)
)
(((progress-screen memcard-loading)
(progress-screen memcard-saving)
(progress-screen memcard-formatting)
(progress-screen memcard-creating)
)
(draw-memcard-accessing obj a1-1)
)
(((progress-screen memcard-insert))
(draw-memcard-insert obj a1-1)
)
(((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title))
(draw-memcard-file-select obj a1-1)
)
(((progress-screen memcard-auto-save-error))
(draw-memcard-auto-save-error obj a1-1)
)
(((progress-screen memcard-removed))
(draw-memcard-removed obj a1-1)
)
(((progress-screen memcard-error-loading)
(progress-screen memcard-error-saving)
(progress-screen memcard-error-formatting)
(progress-screen memcard-error-creating)
)
(draw-memcard-error obj a1-1)
)
(((progress-screen auto-save))
(draw-auto-save obj a1-1)
)
(((progress-screen pal-change-to-60hz))
(draw-pal-change-to-60hz obj a1-1)
)
(((progress-screen pal-now-60hz))
(draw-pal-now-60hz obj a1-1)
)
(((progress-screen no-disc))
(draw-no-disc obj a1-1)
)
(((progress-screen bad-disc))
(draw-bad-disc obj a1-1)
)
(((progress-screen quit) (progress-screen quit-title))
(draw-quit obj a1-1)
)
)
)
)
0
(none)
)
;; override the post handler for progress-normal
(set! (-> progress-normal post)
(lambda :behavior progress ()
;; scroll stuff TODO time ratio
(when (progress-scrolling?)
(seek! (-> *progress-scroll* transition) 1.0 (* 1.75 (1/ 512) (-> self transition-speed) (-> *display* time-adjust-ratio)))
)
@ -1469,7 +1754,7 @@
(draw-options self 170 0 0.82)
)
)
(((progress-screen quit))
(((progress-screen quit) (progress-screen quit-title))
(draw-notice-screen self)
(draw-options self 110 0 0.82)
)
@ -1549,6 +1834,154 @@
(set! (-> progress-going-out post) (-> progress-normal post))
(set! (-> progress-coming-in post) (-> progress-normal post))
;; override this as well...
(set! (-> progress-normal code)
(lambda :behavior progress ()
(loop
(when (and (cpad-hold? 0 l1) (cpad-hold? 0 r1) *cheat-mode*)
(when (and (< (-> self task-index) (-> *level-task-data* (-> self display-level-index) nb-of-tasks))
(>= (-> self task-index) 0)
)
(let ((gp-0 (-> *level-task-data* (-> self display-level-index) task-info (-> self task-index) task-id)))
(close-specific-task! gp-0 (task-status need-resolution))
(send-event *target* 'get-pickup 6 (the float gp-0))
)
)
)
(if (and (= (-> self display-state) (-> self next-display-state))
(= (-> self display-level-index) (-> self next-level-index))
)
(seekl!
(-> self transition-offset)
0
(* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio)))
(if (or (-> self stat-transition) (nonzero? (-> self level-transition)))
2
1
)
)
)
(seekl!
(-> self transition-offset)
512
(* (the int (* (-> self transition-speed) (-> *display* time-adjust-ratio)))
(if (or (-> self stat-transition) (nonzero? (-> self level-transition)))
2
1
)
)
)
)
(set-transition-progress! self (-> self transition-offset))
(set! (-> self in-transition) (or (-> self force-transition) (nonzero? (-> self transition-offset))))
(when (and (not (handle->process (-> *game-info* auto-save-proc)))
(or (-> self force-transition) (-> self in-transition))
(>= (-> self transition-offset) (if (and (zero? (-> self level-transition))
(nonzero? (-> self next-display-state))
(!= (-> self next-display-state) 1)
(!= (-> self next-display-state) 2)
)
512
256
)
)
)
(if (>= (the-as int (-> self next-display-state)) 0)
(enter! self (-> self next-display-state) 0)
(pop! self)
)
(set! (-> self display-level-index) (-> self next-level-index))
(when (nonzero? (-> self level-transition))
(set! (-> self task-index) (get-next-task-up -1 (-> self display-level-index)))
(case (-> self level-transition)
((1)
(set! (-> self level-transition) 2)
)
((2)
(set! (-> self level-transition) 1)
)
)
)
(set! (-> self force-transition) #f)
)
(when (zero? (-> self transition-offset))
(set! (-> self stat-transition) #f)
(set! (-> self level-transition) 0)
0
)
(let ((gp-1 #f))
(let ((v1-62 #f))
(case (-> self display-state)
(((progress-screen fuel-cell) (progress-screen money) (progress-screen buzzer))
(let ((s5-0 (-> self display-level-index)))
(when (and (< (mod (-> *display* real-frame-counter) (seconds 0.2)) (seconds 0.1))
(zero? (-> *progress-process* 0 in-out-position))
(not (-> self in-transition))
(zero? (-> self transition-offset))
)
(set! gp-1 (!= s5-0 (get-next-level-up s5-0)))
(set! v1-62 (!= s5-0 (get-next-level-down s5-0)))
)
)
)
)
(set! (-> self particles 3 init-pos x) (the float (if v1-62
(- 195 (-> *progress-process* 0 left-x-offset))
-320
)
)
)
)
(set! (-> self particles 4 init-pos x) (the float (if gp-1
(- 195 (-> *progress-process* 0 left-x-offset))
-320
)
)
)
)
(respond-common self)
(set! (-> self next-display-state) (set-memcard-screen self (-> self next-display-state)))
(let ((v1-74 (-> self display-state)))
(cond
((or (= v1-74 (progress-screen fuel-cell))
(or (= v1-74 (progress-screen money)) (= v1-74 (progress-screen buzzer)))
)
(respond-progress self)
)
((or (= v1-74 (progress-screen memcard-no-space))
(= v1-74 (progress-screen memcard-format))
(= v1-74 (progress-screen memcard-data-exists))
(= v1-74 (progress-screen memcard-insert))
(= v1-74 (progress-screen load-game))
(= v1-74 (progress-screen save-game))
(= v1-74 (progress-screen save-game-title))
(= v1-74 (progress-screen memcard-error-loading))
(= v1-74 (progress-screen memcard-error-saving))
(= v1-74 (progress-screen memcard-error-formatting))
(= v1-74 (progress-screen memcard-error-creating))
(= v1-74 (progress-screen memcard-auto-save-error))
(= v1-74 (progress-screen memcard-removed))
(= v1-74 (progress-screen memcard-no-data))
(= v1-74 (progress-screen memcard-not-inserted))
(= v1-74 (progress-screen memcard-not-formatted))
(= v1-74 (progress-screen auto-save))
(= v1-74 (progress-screen pal-change-to-60hz))
(= v1-74 (progress-screen pal-now-60hz))
(= v1-74 (progress-screen no-disc))
(= v1-74 (progress-screen bad-disc))
(= v1-74 (progress-screen quit))
(= v1-74 (progress-screen quit-title))
)
(respond-memcard self)
)
)
)
(suspend)
)
(none)
)
)