[game] HUD/sprite fixes for widescreen + a few other things (#1203)

* mood palette debugging

* fix HUD sprites (most of them)

* racer hud fixes

* automtic widescreen adjust for racer and power hud (crappy)

* add money starburst toggle!

* cheat codes (SECRET!!!)

* fix tests

* fix error

* fix tests

* always for 16x9 for cutscenes

* better lod hacks

* full alphabet

* fog hack for less ugliness + particle density hack
This commit is contained in:
ManDude 2022-02-27 21:44:43 +00:00 committed by GitHub
parent 382ec1d1c5
commit 42806d504f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 3177 additions and 3193 deletions

View file

@ -17818,7 +17818,7 @@
;; - Functions
(define-extern make-light-kit (function light-group float float float float float))
(define-extern make-light-kit (function light-group float float float float none))
(define-extern make-village1-light-kit (function mood-context none))
(define-extern make-misty-light-kit (function mood-context none))
(define-extern make-village2-light-kit (function mood-context none))
@ -18146,7 +18146,7 @@
(define-extern update-mood-interp (function mood-context mood-context mood-context float none))
(define-extern update-mood-lightning (function mood-context int int int int float symbol none)) ;; TODO - asm - ret not verified
(define-extern update-mood-lava (function mood-context int int symbol none))
(define-extern update-light-kit (function light-group light float float))
(define-extern update-light-kit (function light-group light float none))
(define-extern set-target-light-index (function int int))
(define-extern update-mood-caustics (function mood-context int int none))
(define-extern update-mood-jungleb-blue (function mood-context float int none))
@ -18237,7 +18237,7 @@
(define-extern start-time-of-day (function none))
(define-extern time-of-day-setup (function symbol symbol))
(define-extern set-time-of-day (function float none))
(define-extern init-time-of-day-context (function time-of-day-context float))
(define-extern init-time-of-day-context (function time-of-day-context none))
(define-extern update-time-of-day (function time-of-day-context none))
;; - Symbols
@ -21028,7 +21028,7 @@
(die () _type_ :state 24) ;; state
(jump () _type_ :state 25)
(notice-blue (handle) _type_ :state 26) ;; state
(get-pickup-sound (_type_ pickup-type) ambient-sound 27)
(initialize-effect (_type_ pickup-type) none 27)
(initialize-eco (_type_ entity-actor pickup-type float) object 28)
(animate (_type_) none 29)
(blocked () _type_ :state 30)
@ -21188,7 +21188,7 @@
(define-extern vent-standard-event-handler (function process int symbol event-message-block object :behavior vent))
(define-extern ecovalve-init-by-other (function (function vent symbol) none :behavior ecovalve))
(define-extern birth-pickup-at-point (function vector pickup-type float symbol process-drawable fact-info (pointer process) :behavior process))
(define-extern birth-pickup-at-point (function vector pickup-type float symbol process-tree fact-info (pointer process) :behavior process))
(define-extern fuel-cell-pick-anim (function process-drawable spool-anim))
(define-extern othercam-init-by-other (function process-taskable symbol symbol symbol none :behavior othercam))
(define-extern fuel-cell-animate (function none :behavior fuel-cell))
@ -27051,12 +27051,12 @@
;; - Functions
(define-extern zoomer-heat-slice-color (function matrix float float))
(define-extern part-hud-racer-speed-func (function sparticle-system sparticle-cpuinfo matrix float))
(define-extern part-hud-racer-heat-func (function sparticle-system sparticle-cpuinfo matrix float))
(define-extern part-hud-zoomer-heat-slice-01-func (function sparticle-system sparticle-cpuinfo matrix float))
(define-extern part-hud-zoomer-heat-slice-02-func (function sparticle-system sparticle-cpuinfo matrix float))
(define-extern part-hud-zoomer-heat-slice-03-func (function sparticle-system sparticle-cpuinfo matrix float))
(define-extern zoomer-heat-slice-color (function matrix float none))
(define-extern part-hud-racer-speed-func (function sparticle-system sparticle-cpuinfo matrix none))
(define-extern part-hud-racer-heat-func (function sparticle-system sparticle-cpuinfo matrix none))
(define-extern part-hud-zoomer-heat-slice-01-func (function sparticle-system sparticle-cpuinfo matrix none))
(define-extern part-hud-zoomer-heat-slice-02-func (function sparticle-system sparticle-cpuinfo matrix none))
(define-extern part-hud-zoomer-heat-slice-03-func (function sparticle-system sparticle-cpuinfo matrix none))
;; ----------------------

View file

@ -29,150 +29,150 @@ out vec3 tex_coord;
out flat uvec2 tex_info;
vec4 matrix_transform(mat4 mtx, vec3 pt) {
return mtx[3]
+ mtx[0] * pt.x
+ mtx[1] * pt.y
+ mtx[2] * pt.z;
return mtx[3]
+ mtx[0] * pt.x
+ mtx[1] * pt.y
+ mtx[2] * pt.z;
}
mat3 sprite_quat_to_rot(vec3 quat) {
mat3 result;
float qr = sqrt(abs(1.0 - (quat.x * quat.x + quat.y * quat.y + quat.z * quat.z)));
result[0][0] = 1.0 - 2.0 * (quat.y * quat.y + quat.z * quat.z);
result[1][0] = 2.0 * (quat.x * quat.y - quat.z * qr);
result[2][0] = 2.0 * (quat.x * quat.z + quat.y * qr);
result[0][1] = 2.0 * (quat.x * quat.y + quat.z * qr);
result[1][1] = 1.0 - 2.0 * (quat.x * quat.x + quat.z * quat.z);
result[2][1] = 2.0 * (quat.y * quat.z - quat.x * qr);
result[0][2] = 2.0 * (quat.x * quat.z - quat.y * qr);
result[1][2] = 2.0 * (quat.y * quat.z + quat.x * qr);
result[2][2] = 1.0 - 2.0 * (quat.x * quat.x + quat.y * quat.y);
return result;
mat3 result;
float qr = sqrt(abs(1.0 - (quat.x * quat.x + quat.y * quat.y + quat.z * quat.z)));
result[0][0] = 1.0 - 2.0 * (quat.y * quat.y + quat.z * quat.z);
result[1][0] = 2.0 * (quat.x * quat.y - quat.z * qr);
result[2][0] = 2.0 * (quat.x * quat.z + quat.y * qr);
result[0][1] = 2.0 * (quat.x * quat.y + quat.z * qr);
result[1][1] = 1.0 - 2.0 * (quat.x * quat.x + quat.z * quat.z);
result[2][1] = 2.0 * (quat.y * quat.z - quat.x * qr);
result[0][2] = 2.0 * (quat.x * quat.z - quat.y * qr);
result[1][2] = 2.0 * (quat.y * quat.z + quat.x * qr);
result[2][2] = 1.0 - 2.0 * (quat.x * quat.x + quat.y * quat.y);
return result;
}
vec4 sprite_transform2(vec3 root, vec4 off, mat3 sprite_rot, float sx, float sy) {
vec3 pos = root;
vec3 pos = root;
vec3 offset = sprite_rot[0] * off.x * sx + sprite_rot[1] * off.y + sprite_rot[2] * off.z * sy;
vec3 offset = sprite_rot[0] * off.x * sx + sprite_rot[1] * off.y + sprite_rot[2] * off.z * sy;
pos += offset;
vec4 transformed_pos = -matrix_transform(camera, pos);
float Q = pfog0 / transformed_pos.w;
transformed_pos.xyz *= Q;
transformed_pos.xyz += hvdf_offset.xyz;
pos += offset;
vec4 transformed_pos = -matrix_transform(camera, pos);
float Q = pfog0 / transformed_pos.w;
transformed_pos.xyz *= Q;
transformed_pos.xyz += hvdf_offset.xyz;
return transformed_pos;
return transformed_pos;
}
void main() {
// STEP 1: UNPACK DATA AND CREATE READABLE VARIABLES
// STEP 1: UNPACK DATA AND CREATE READABLE VARIABLES
vec3 position = xyz_sx.xyz;
float sx = xyz_sx.w;
float sy = quat_sy.w;
fragment_color = rgba;
uint vert_id = tex_info_in.z;
uint rendermode = tex_info_in.w; // 2D, HUD, 3D
vec3 quat = quat_sy.xyz;
uint matrix = flags_matrix.y;
vec3 position = xyz_sx.xyz;
float sx = xyz_sx.w;
float sy = quat_sy.w;
fragment_color = rgba;
uint vert_id = tex_info_in.z;
uint rendermode = tex_info_in.w; // 2D, HUD, 3D
vec3 quat = quat_sy.xyz;
uint matrix = flags_matrix.y;
vec4 transformed;
vec4 transformed;
// STEP 2: perspective transform for distance
vec4 transformed_pos_vf02 = matrix_transform(rendermode == 2 ? hud_matrix : camera, position);
float Q = pfog0 / transformed_pos_vf02.w;
// STEP 2: perspective transform for distance
vec4 transformed_pos_vf02 = matrix_transform(rendermode == 2 ? hud_matrix : camera, position);
float Q = pfog0 / transformed_pos_vf02.w;
// STEP 3: fade out sprite!
vec4 scales_vf01 = xyz_sx; // now used for something else.
scales_vf01.z = sy; // start building the scale vector
scales_vf01.zw *= Q; // sy sx
scales_vf01.x = scales_vf01.z; // = sy
scales_vf01.x *= scales_vf01.w; // x = sx * sy
scales_vf01.x *= inv_area; // x = sx * sy * inv_area (area ratio)
fragment_color.w *= min(scales_vf01.x, 1.0); // is this right? doesn't this stall??
// STEP 3: fade out sprite!
vec4 scales_vf01 = xyz_sx; // now used for something else.
scales_vf01.z = sy; // start building the scale vector
scales_vf01.zw *= Q; // sy sx
scales_vf01.x = scales_vf01.z; // = sy
scales_vf01.x *= scales_vf01.w; // x = sx * sy
scales_vf01.x *= inv_area; // x = sx * sy * inv_area (area ratio)
fragment_color.w *= min(scales_vf01.x, 1.0); // is this right? doesn't this stall??
// STEP 4: actual vertex transformation
if (rendermode == 3) { // 3D sprites
// STEP 4: actual vertex transformation
if (rendermode == 3) { // 3D sprites
mat3 rot = sprite_quat_to_rot(quat);
transformed = sprite_transform2(position, xyz_array[vert_id], rot, sx, sy);
mat3 rot = sprite_quat_to_rot(quat);
transformed = sprite_transform2(position, xyz_array[vert_id], rot, sx, sy);
} else if (rendermode == 1) { // 2D sprites
} else if (rendermode == 1) { // 2D sprites
transformed_pos_vf02.xyz *= Q;
vec4 offset_pos_vf10 = transformed_pos_vf02 + hvdf_offset;
transformed_pos_vf02.xyz *= Q;
vec4 offset_pos_vf10 = transformed_pos_vf02 + hvdf_offset;
/* transformed_pos_vf02.w = offset_pos_vf10.w - fog_max;
int fge = matrix == 0;
if (transformed_pos_vf02.w != 0) {
fge = false;
} */
/* transformed_pos_vf02.w = offset_pos_vf10.w - fog_max;
int fge = matrix == 0;
if (transformed_pos_vf02.w != 0) {
fge = false;
} */
scales_vf01.z = min(max(scales_vf01.z, min_scale), max_scale);
scales_vf01.w = min(max(scales_vf01.w, min_scale), max_scale);
scales_vf01.z = min(max(scales_vf01.z, min_scale), max_scale);
scales_vf01.w = min(max(scales_vf01.z, min_scale), max_scale);
quat.z *= deg_to_rad;
float sp_sin = sin(quat.z);
float sp_cos = cos(quat.z);
quat.z *= deg_to_rad;
float sp_sin = sin(quat.z);
float sp_cos = cos(quat.z);
vec4 xy0_vf19 = xy_array[vert_id + flags_matrix.x];
vec4 vf12_rotated = (basis_x * sp_cos) - (basis_y * sp_sin);
vec4 vf13_rotated_trans = (basis_x * sp_sin) + (basis_y * sp_cos);
vec4 xy0_vf19 = xy_array[vert_id + flags_matrix.x];
vec4 vf12_rotated = (basis_x * sp_cos) - (basis_y * sp_sin);
vec4 vf13_rotated_trans = (basis_x * sp_sin) + (basis_y * sp_cos);
vf12_rotated *= scales_vf01.w;
vf13_rotated_trans *= scales_vf01.z;
vf12_rotated *= scales_vf01.w;
vf13_rotated_trans *= scales_vf01.z;
transformed = offset_pos_vf10 + vf12_rotated * xy0_vf19.x + vf13_rotated_trans * xy0_vf19.y;
transformed = offset_pos_vf10 + vf12_rotated * xy0_vf19.x + vf13_rotated_trans * xy0_vf19.y;
} else if (rendermode == 2) { // hud sprites
} else if (rendermode == 2) { // hud sprites
transformed_pos_vf02.xyz *= Q;
vec4 offset_pos_vf10 = transformed_pos_vf02 + (matrix == 0 ? hud_hvdf_offset : hud_hvdf_user[matrix - 1]);
transformed_pos_vf02.xyz *= Q;
vec4 offset_pos_vf10 = transformed_pos_vf02 + (matrix == 0 ? hud_hvdf_offset : hud_hvdf_user[matrix - 1]);
// NOTE: no max scale for hud
scales_vf01.z = max(scales_vf01.z, min_scale);
scales_vf01.w = max(scales_vf01.z, min_scale);
scales_vf01.z = min(max(scales_vf01.z, min_scale), max_scale);
scales_vf01.w = min(max(scales_vf01.w, min_scale), max_scale);
quat.z *= deg_to_rad;
float sp_sin = sin(quat.z);
float sp_cos = cos(quat.z);
quat.z *= deg_to_rad;
float sp_sin = sin(quat.z);
float sp_cos = cos(quat.z);
vec4 xy0_vf19 = xy_array[vert_id + flags_matrix.x];
vec4 vf12_rotated = (basis_x * sp_cos) - (basis_y * sp_sin);
vec4 vf13_rotated_trans = (basis_x * sp_sin) + (basis_y * sp_cos);
vec4 xy0_vf19 = xy_array[vert_id + flags_matrix.x];
vec4 vf12_rotated = (basis_x * sp_cos) - (basis_y * sp_sin);
vec4 vf13_rotated_trans = (basis_x * sp_sin) + (basis_y * sp_cos);
vf12_rotated *= scales_vf01.w;
vf13_rotated_trans *= scales_vf01.z;
vf12_rotated *= scales_vf01.w;
vf13_rotated_trans *= scales_vf01.z;
transformed = offset_pos_vf10 + vf12_rotated * xy0_vf19.x + vf13_rotated_trans * xy0_vf19.y;
transformed = offset_pos_vf10 + vf12_rotated * xy0_vf19.x + vf13_rotated_trans * xy0_vf19.y;
}
}
tex_coord = st_array[vert_id].xyz;
tex_coord = st_array[vert_id].xyz;
// STEP 5: final adjustments
// correct xy offset
transformed.xy -= (2048.);
// STEP 5: final adjustments
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// hack
transformed.xyz *= transformed.w;
gl_Position = transformed;
// scissoring area adjust
gl_Position.y *= 512.0/448.0;
gl_Position = transformed;
// scissoring area adjust
gl_Position.y *= 512.0/448.0;
fragment_color.w *= 2;
fragment_color.w *= 2;
tex_info = tex_info_in.xy;
tex_info = tex_info_in.xy;
}

View file

@ -76,5 +76,11 @@ void main() {
// time of day lookup
fragment_color = texelFetch(tex_T1, time_of_day_index, 0);
fragment_color.w *= 2;
// fog hack
if (fragment_color.r < 0.01 && fragment_color.g < 0.01 && fragment_color.b < 0.01) {
fogginess = 0;
}
tex_coord = tex_coord_in;
}

View file

@ -153,8 +153,8 @@
"goal_src/engine/nav/navigate-h.gc"
"goal_src/engine/load/load-dgo.gc"
"goal_src/engine/load/ramdisk.gc"
"goal_src/engine/pc/pckernel.gc" ;; added
"goal_src/engine/sound/gsound.gc"
"goal_src/engine/pc/pckernel.gc" ;; added
"goal_src/engine/math/transformq.gc"
"goal_src/engine/collide/collide-func.gc"
"goal_src/engine/anim/joint.gc"

View file

@ -354,8 +354,8 @@
("navigate-h.o" "navigate-h")
("load-dgo.o" "load-dgo")
("ramdisk.o" "ramdisk")
("pckernel.o" "pckernel") ;; added
("gsound.o" "gsound")
("pckernel.o" "pckernel") ;; added
("transformq.o" "transformq")
("collide-func.o" "collide-func")
("joint.o" "joint")
@ -718,6 +718,7 @@
("load-dgo.o" "load-dgo")
("ramdisk.o" "ramdisk")
("gsound.o" "gsound")
("pckernel.o" "pckernel") ;; added
("transformq.o" "transformq")
("collide-func.o" "collide-func")
("joint.o" "joint")
@ -825,7 +826,6 @@
("prototype.o" "prototype")
("main-collide.o" "main-collide")
("video.o" "video")
("pckernel.o" "pckernel") ;; added
("main.o" "main")
("collide-cache.o" "collide-cache")
("relocate.o" "relocate")

View file

@ -145,8 +145,8 @@
("navigate-h.o" "navigate-h")
("load-dgo.o" "load-dgo")
("ramdisk.o" "ramdisk")
("pckernel.o" "pckernel") ;; added
("gsound.o" "gsound")
("pckernel.o" "pckernel") ;; added
("transformq.o" "transformq")
("collide-func.o" "collide-func")
("joint.o" "joint")
@ -295,4 +295,5 @@
("viewer.o" "viewer")
("part-tester.o" "part-tester")
("default-menu.o" "default-menu")
)
)

View file

@ -141,8 +141,8 @@
("navigate-h.o" "navigate-h")
("load-dgo.o" "load-dgo")
("ramdisk.o" "ramdisk")
("pckernel.o" "pckernel") ;; added
("gsound.o" "gsound")
("pckernel.o" "pckernel") ;; added
("transformq.o" "transformq")
("collide-func.o" "collide-func")
("joint.o" "joint")

File diff suppressed because it is too large Load diff

View file

@ -16,10 +16,8 @@
(defun update-light-kit ((arg0 light-group) (arg1 light) (arg2 float))
(set! (-> arg0 ambi color quad) (-> arg1 color quad))
(let ((f0-1 (* (-> arg1 levels x) arg2)))
(set! (-> arg0 ambi levels x) f0-1)
f0-1
)
(set! (-> arg0 ambi levels x) (* (-> arg1 levels x) arg2))
(none)
)
(defun set-target-light-index ((arg0 int))
@ -60,6 +58,17 @@
(t3-1 uint128)
(f31-0 none)
)
;; pc mood debug
(with-pc
(case (-> *pc-settings* mood-override?)
(('copy #t)
(dotimes (mti 8)
(set! (-> arg0 times mti w) (-> *pc-settings* mood-overrides mti)))
)
(('mult)
(dotimes (mti 8)
(*! (-> arg0 times mti w) (-> *pc-settings* mood-overrides mti)))
)))
(rlet ((vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)

View file

@ -45,7 +45,17 @@
((-> *pc-settings* use-vis?)
;; using game vis, cannot allow seeing more of the view
;; crops excess aspect ratio at the top and bottom
(set! (-> math-cam y-ratio) (* (1/ (-> *pc-settings* aspect-ratio)) (-> math-cam x-ratio)))
;(set! (-> math-cam y-ratio) (* (1/ (-> *pc-settings* aspect-ratio)) (-> math-cam x-ratio)))
)
((-> *pc-settings* movie?)
;; this mess is just so that we can force the original 16x9 cropping during cutscenes.
(if (<= (-> *pc-settings* aspect-ratio) ASPECT_16X9)
(set! (-> math-cam y-ratio) (* (1/ (-> *pc-settings* aspect-ratio)) (-> math-cam x-ratio)))
(begin
(set! (-> math-cam y-ratio) (* (1/ ASPECT_16X9) (-> math-cam x-ratio)))
(*! (-> math-cam x-ratio) (/ (-> *pc-settings* aspect-ratio) ASPECT_16X9))
)
)
)
(else
;; not using game vis, allow *extended* aspect ratios

View file

@ -4285,6 +4285,38 @@
(= (-> *pc-settings* subtitle-speaker?) setting)
)
(defun dm-mood-override-palette-pick-func ((bpal int) (msg debug-menu-msg))
(let* ((pal (/ bpal 8))
(cur-val (-> *pc-settings* mood-overrides pal)))
(when (= msg (debug-menu-msg press))
(set! (-> *pc-settings* mood-overrides pal) (if (= cur-val 0.0) 1.0 0.0))
(when (not (= 'mult (-> *pc-settings* mood-override?)))
(set! (-> *pc-settings* mood-override?) #f)
(dotimes (i 8)
(if (!= (-> *pc-settings* mood-overrides i) 0.0)
(set! (-> *pc-settings* mood-override?) 'copy)))
))
(= (-> *pc-settings* mood-overrides pal) 1.0)
)
)
(defun dm-mood-override-pick-func ((kind symbol) (msg debug-menu-msg))
(when (= msg (debug-menu-msg press))
(if (= kind (-> *pc-settings* mood-override?))
(set! (-> *pc-settings* mood-override?) #f)
(set! (-> *pc-settings* mood-override?) kind)))
(= kind (-> *pc-settings* mood-override?))
)
(defun dm-mood-palette-float ((pal int) (arg1 debug-menu-msg) (newval float) (val float))
(when (= arg1 (debug-menu-msg press))
(set! (-> *pc-settings* mood-overrides (/ pal 8)) newval))
(-> *pc-settings* mood-overrides (/ pal 8))
)
(when (-> *debug-menu-context* root-menu)
(debug-menu-append-item (-> *debug-menu-context* root-menu) (debug-menu-make-load-menu *debug-menu-context*))
(debug-menu-append-item (-> *debug-menu-context* root-menu) (debug-menu-make-part-menu *debug-menu-context*))
@ -4350,6 +4382,7 @@
)
(flag "Letterbox" #f ,(dm-lambda-boolean-flag (-> *pc-settings* letterbox?)))
;(flag "Skip movies" #f ,(dm-lambda-boolean-flag (-> *pc-settings* skip-movies?)))
(flag "Money starburst" #f ,(dm-lambda-boolean-flag (-> *pc-settings* money-starburst?)))
(flag "Subtitles" #f ,(dm-lambda-boolean-flag (-> *pc-settings* subtitles?)))
;(flag "Hinttitles" #f ,(dm-lambda-boolean-flag (-> *pc-settings* hinttitles?)))
(menu "Subtitle speaker"
@ -4412,7 +4445,7 @@
(debug-menu-make-from-template *debug-menu-context*
'(menu "Other"
(flag "DECI Count" *display-deci-count* dm-boolean-toggle-pick-func)
(flag "Actor graph" *display-actor-graph* dm-boolean-toggle-pick-func)
;(flag "Actor graph" *display-actor-graph* dm-boolean-toggle-pick-func)
(flag "Update vis outside bsp" *update-leaf-when-outside-bsp* dm-boolean-toggle-pick-func)
(flag "Pad display" #f ,(dm-lambda-boolean-flag (-> *pc-settings* debug-pad-display)))
(flag "Display actor bank" #f ,(dm-lambda-boolean-flag (-> *pc-settings* display-actor-bank)))
@ -4421,6 +4454,29 @@
(flag "Heap status" #f ,(dm-lambda-boolean-flag (-> *pc-settings* display-heap-status)))
(flag "Bug report" #f ,(dm-lambda-boolean-flag (-> *pc-settings* display-bug-report)))
(flag "Force progress" #f ,(dm-lambda-boolean-flag (-> *pc-settings* progress-force?)))
(menu "Mood override"
(function "-- SIMPLE OVERRIDE" #f nothing)
(flag "Palette 0" 0 dm-mood-override-palette-pick-func)
(flag "Palette 1" 1 dm-mood-override-palette-pick-func)
(flag "Palette 2" 2 dm-mood-override-palette-pick-func)
(flag "Palette 3" 3 dm-mood-override-palette-pick-func)
(flag "Palette 4" 4 dm-mood-override-palette-pick-func)
(flag "Palette 5" 5 dm-mood-override-palette-pick-func)
(flag "Palette 6" 6 dm-mood-override-palette-pick-func)
(flag "Palette 7" 7 dm-mood-override-palette-pick-func)
(menu "Advanced"
(flag "Overwrite" copy dm-mood-override-pick-func)
(flag "Multiply" mult dm-mood-override-pick-func)
(float-fixed-var "Palette 0 Amt" 0 dm-mood-palette-float 0 10 #t 0 1000 3)
(float-fixed-var "Palette 1 Amt" 1 dm-mood-palette-float 0 10 #t 0 1000 3)
(float-fixed-var "Palette 2 Amt" 2 dm-mood-palette-float 0 10 #t 0 1000 3)
(float-fixed-var "Palette 3 Amt" 3 dm-mood-palette-float 0 10 #t 0 1000 3)
(float-fixed-var "Palette 4 Amt" 4 dm-mood-palette-float 0 10 #t 0 1000 3)
(float-fixed-var "Palette 5 Amt" 5 dm-mood-palette-float 0 10 #t 0 1000 3)
(float-fixed-var "Palette 6 Amt" 6 dm-mood-palette-float 0 10 #t 0 1000 3)
(float-fixed-var "Palette 7 Amt" 7 dm-mood-palette-float 0 10 #t 0 1000 3)
)
)
)
))
(other-menu (-> (the-as debug-menu-item-submenu other-menu-node) submenu))

View file

@ -668,7 +668,7 @@
(/ (the-as int (ref arg1 8)) 8)
(= s4-0 'hex-var)
)
;; changed... i have no idea what they were doing here
;; changed... i have no idea what they were trying to do here
(set! (-> (the-as debug-menu-item-var s5-0) ifloat-p) (= s4-0 'int-var-gat1));;#t)
s5-0
)

View file

@ -711,13 +711,24 @@
)
)
)
(if (and (< (-> arg1 lod-set lod lod-to-use dist) cam-dist) (< (-> arg1 force-lod) 0))
;; lod hacks!
(with-pc
(if (not (-> *pc-settings* ps2-lod-dist?))
(set! lod-to-use (minmax (-> *pc-settings* lod-force-actor) 0 (-> arg1 lod-set max-lod))))
)
(if (#if (not PC_PORT)
(and (< (-> arg1 lod-set lod lod-to-use dist) cam-dist) (< (-> arg1 force-lod) 0))
(and (-> *pc-settings* ps2-lod-dist?) (< (-> arg1 lod-set lod lod-to-use dist) cam-dist) (< (-> arg1 force-lod) 0))
)
(return #f)
)
(let ((v1-64 (-> arg1 sink-group level))
(a0-26 (+ (-> arg1 sink-group merc-sink foreground-texture-page) 6))
)
(when (zero? (logand (-> arg1 status) (draw-status do-not-check-distance)))
(when (#if (not PC_PORT)
(not (logtest? (-> arg1 status) (draw-status do-not-check-distance)))
(and (-> *pc-settings* ps2-lod-dist?) (not (logtest? (-> arg1 status) (draw-status do-not-check-distance))))
)
(if (< cam-dist (-> v1-64 closest-object a0-26))
(set! (-> v1-64 closest-object a0-26) cam-dist)
)

View file

@ -85,11 +85,6 @@
)
(defmethod lod-set! draw-control ((obj draw-control) (arg0 int))
;; note: good spot to mess with lods here.
(with-pc
(if (not (-> *pc-settings* ps2-lod-dist?))
(set! arg0 (-> *pc-settings* lod-force-actor)))
)
(let ((v1-1 (max 0 (min arg0 (-> obj lod-set max-lod)))))
(set! (-> obj desired-lod) v1-1)
(when (!= (-> obj cur-lod) v1-1)

View file

@ -140,7 +140,7 @@
:package "game"
:art-group '()
:pool '*16k-dead-pool*
:heap-size #x800
:heap-size #xc00 ;; CHANGED from 2k!!
)
(new 'static 'entity-info
:ptype (type-ref water-vol :method-count 30)

View file

@ -2174,6 +2174,24 @@
)
)
;; customized
(defpart 238
:init-specs
((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #x2))
(sp-flt spt-num 1.0)
(sp-flt spt-scale-x (meters 1.2))
(sp-copy-from-other spt-scale-y -4)
(sp-flt spt-r 128.0)
(sp-flt spt-g 128.0)
(sp-flt spt-b 128.0)
(sp-flt spt-a 128.0)
(sp-int spt-timer 1)
(sp-cpuinfo-flags bit2 bit3)
(sp-func spt-func 'sparticle-track-root-money)
)
)
;; customized
(defpartgroup group-money-starburst :id 64 :bounds (static-bspherem 0 0.5 0 1.5) :parts ((sp-item 238)))
(defpartgroup group-buzzer-effect

View file

@ -122,7 +122,7 @@
(die () _type_ :state 24)
(jump () _type_ :state 25)
(notice-blue (handle) _type_ :state 26)
(get-pickup-sound (_type_ pickup-type) ambient-sound 27)
(initialize-effect (_type_ pickup-type) none 27)
(initialize-eco (_type_ entity-actor pickup-type float) object 28)
(animate (_type_) none 29)
(blocked () _type_ :state 30)
@ -158,7 +158,7 @@
obj
)
(defmethod get-pickup-sound eco-collectable ((obj eco-collectable) (arg0 pickup-type))
(defmethod initialize-effect eco-collectable ((obj eco-collectable) (arg0 pickup-type))
(set! (-> obj fact pickup-type) arg0)
(case (-> obj fact pickup-type)
(((pickup-type eco-blue) (pickup-type eco-red) (pickup-type eco-green) (pickup-type eco-yellow))
@ -235,11 +235,9 @@
)
(set! (-> obj part) (create-launch-control (-> obj eco-effect) obj))
(when (-> obj sound-name)
(let ((v0-1 (new 'process 'ambient-sound (-> obj sound-name) (-> obj root-override trans))))
(set! (-> obj sound) v0-1)
v0-1
)
(set! (-> obj sound) (new 'process 'ambient-sound (-> obj sound-name) (-> obj root-override trans)))
)
(none)
)
(defbehavior initialize-eco-by-other eco ((arg0 vector) (arg1 vector) (arg2 fact-info))
@ -255,7 +253,7 @@
(set! (-> self fact options) (-> arg2 options))
(set! (-> self root-override trans quad) (-> arg0 quad))
(set! (-> self root-override transv quad) (-> arg1 quad))
(get-pickup-sound self (-> self fact pickup-type))
(initialize-effect self (-> self fact pickup-type))
(set! (-> self notify-parent) #f)
(case (-> self fact pickup-type)
(((pickup-type eco-blue) (pickup-type eco-yellow) (pickup-type eco-red))
@ -287,7 +285,7 @@
(set! (-> obj pickup-type) arg1)
(initialize obj)
(set! (-> obj root-override trans quad) (-> arg0 extra trans quad))
(get-pickup-sound obj (-> obj fact pickup-type))
(initialize-effect obj (-> obj fact pickup-type))
(initialize-params obj 0 (the-as float 1024.0))
(update-transforms! (-> obj root-override))
(if (logtest? (fact-options eco-blocked) (-> obj fact options))
@ -1213,7 +1211,7 @@
(* f30-0
(sin
(* 109.22667
(the float (mod (+ (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self bob-offset)) 600))
(the float (mod (+ (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self bob-offset)) (seconds 2)))
)
)
)
@ -1223,6 +1221,10 @@
)
)
(ja-post)
;; added! particle
(with-pc
(if (-> *pc-settings* money-starburst?)
(spawn (-> self part) (-> self root-override root-prim world-sphere))))
(suspend)
)
(none)
@ -1249,7 +1251,7 @@
(* f30-0
(sin
(* 109.22667
(the float (mod (+ (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self bob-offset)) 600))
(the float (mod (+ (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self bob-offset)) (seconds 2)))
)
)
)
@ -1258,6 +1260,10 @@
)
)
(transform-post)
;; added! particle
(with-pc
(if (-> *pc-settings* money-starburst?)
(spawn (-> self part) (-> self root-override root-prim world-sphere))))
(suspend)
)
(none)
@ -1268,6 +1274,9 @@
:virtual #t
:code
(behavior ((arg0 object) (arg1 handle))
(if (nonzero? (-> self part))
(kill-and-free-particles (-> self part))
)
(logclear! (-> self mask) (process-mask actor-pause))
(clear-collide-with-as (-> self root-override))
(process-entity-status! self (entity-perm-status dead) #t)
@ -1315,6 +1324,8 @@
)
(set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0)
(set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0)
;; added! money starburst
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 64) obj))
obj
)
@ -2559,7 +2570,7 @@
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 356]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 363]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 122]
(defbehavior birth-pickup-at-point process ((arg0 vector) (arg1 pickup-type) (arg2 float) (arg3 symbol) (arg4 process-drawable) (arg5 fact-info))
(defbehavior birth-pickup-at-point process ((arg0 vector) (arg1 pickup-type) (arg2 float) (arg3 symbol) (arg4 process-tree) (arg5 fact-info))
(local-vars
(v1-2 basic)
(v1-28 symbol)

View file

@ -240,7 +240,7 @@
"demo-start"
)
(*debug-segment*
(#if (user? dass) "citadel-launch-end" "village1-hut")
(#if (user? dass) "village1-warp" "village1-hut")
)
(else
"title-start"

View file

@ -14,7 +14,7 @@
(define-extern fuel-cell type)
(define-extern birth-pickup-at-point (function vector pickup-type float symbol process-drawable fact-info (pointer process) :behavior process))
(define-extern birth-pickup-at-point (function vector pickup-type float symbol process-tree fact-info (pointer process) :behavior process))
(declare-type collide-shape-moving basic)
(declare-type sparticle-launch-group basic)

View file

@ -20,8 +20,39 @@
(with-dma-buffer-add-bucket ((dma-buf (-> (current-frame) global-buf))
(bucket-id debug-draw1)) ;; debug-draw1 is one of the last buckets
;; draw the two sprites
(draw-sprite2d-xy dma-buf 0 0 512 25 (new 'static 'rgba :a #x80))
(draw-sprite2d-xy dma-buf 0 199 512 26 (new 'static 'rgba :a #x80))
(#cond
((not PC_PORT)
(draw-sprite2d-xy dma-buf 0 0 512 25 (new 'static 'rgba :a #x80))
(draw-sprite2d-xy dma-buf 0 199 512 26 (new 'static 'rgba :a #x80))
)
(#t
(if (-> *pc-settings* use-vis?)
;; original game mode. dont do anything.
(begin
(draw-sprite2d-xy dma-buf 0 0 512 25 (new 'static 'rgba :a #x80))
(draw-sprite2d-xy dma-buf 0 199 512 26 (new 'static 'rgba :a #x80)))
;; native mode. force 16x9 letterboxing always.
(begin
(cond
((< (-> *pc-settings* aspect-ratio) ASPECT_16X9)
;; too tall. needs vertical letterboxing.
(let ((lbx-h (the int (* 112.0 (- 1.0 (/ (-> *pc-settings* aspect-ratio) ASPECT_16X9))))))
(draw-sprite2d-xy dma-buf 0 0 512 lbx-h (new 'static 'rgba :a #x80))
(draw-sprite2d-xy dma-buf 0 (- 224 lbx-h) 512 lbx-h (new 'static 'rgba :a #x80))
)
)
((> (-> *pc-settings* aspect-ratio) ASPECT_16X9)
;; too wide. needs horizontal letterboxing.
(let ((lbx-w (the int (* 256.0 (- 1.0 (/ ASPECT_16X9 (-> *pc-settings* aspect-ratio)))))))
(draw-sprite2d-xy dma-buf 0 0 lbx-w 224 (new 'static 'rgba :a #x80))
(draw-sprite2d-xy dma-buf (- 512 lbx-w) 0 lbx-w 224 (new 'static 'rgba :a #x80))
)
)
)
)
)
)
)
)
(none)
)
@ -314,15 +345,6 @@
(define *progress-cheat* #f)
(define *first-boot* #t) ;; PAL
(defmacro cheats-sound-play (cheat?)
"play the appropriate sound for inputting a cheat code"
`(if ,cheat?
(sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t)
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
)
)
(defun main-cheats ()
"Handle cheat codes and timeout"
@ -672,7 +694,9 @@
(if (< (-> *game-info* letterbox-time) (-> *display* base-frame-counter))
(set! (-> *game-info* letterbox-time) (-> *display* base-frame-counter))
)
(if (= (-> *setting-control* current aspect-ratio) 'aspect4x3)
(if (#if (not PC_PORT)
(= (-> *setting-control* current aspect-ratio) 'aspect4x3)
(or (not (-> *pc-settings* use-vis?)) (and (-> *pc-settings* use-vis?) (= (-> *setting-control* current aspect-ratio) 'aspect4x3))))
(letterbox)
)
)

View file

@ -642,6 +642,7 @@
)
((< 0.0 (-> self control unknown-float141))
(set! (-> self control unknown-float141) 0.0)
(#when PC_DEBUG_SOUND_ENABLE
(let ((v1-64 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
(set! (-> v1-64 command) (sound-command set-param))
(set! (-> v1-64 id) (-> self control unknown-soundid00))
@ -651,6 +652,7 @@
(set! (-> v1-64 parms mask) (the-as uint 17))
(-> v1-64 id)
)
)
)
)
(let ((v1-67 (-> *time-of-day-context* current-shadow))

View file

@ -1059,23 +1059,23 @@
)
)
(#when PC_DEBUG_SOUND_ENABLE
(let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
(set! (-> s5-0 command) (sound-command set-param))
(set! (-> s5-0 id) (-> obj sound-id))
(let ((a1-3 (-> obj root-override trans)))
(let ((gp-1 pp))
(when (= a1-3 #t)
(if (and gp-1 (type-type? (-> gp-1 type) process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root)))
(set! a1-3 (-> (the-as process-drawable gp-1) root trans))
(set! a1-3 (the-as vector #f))
)
)
(let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
(set! (-> s5-0 command) (sound-command set-param))
(set! (-> s5-0 id) (-> obj sound-id))
(let ((a1-3 (-> obj root-override trans)))
(let ((gp-1 pp))
(when (= a1-3 #t)
(if (and gp-1 (type-type? (-> gp-1 type) process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root)))
(set! a1-3 (-> (the-as process-drawable gp-1) root trans))
(set! a1-3 (the-as vector #f))
)
)
(sound-trans-convert (-> s5-0 parms trans) a1-3)
)
(set! (-> s5-0 parms mask) (the-as uint 32))
(-> s5-0 id)
(sound-trans-convert (-> s5-0 parms trans) a1-3)
)
(set! (-> s5-0 parms mask) (the-as uint 32))
(-> s5-0 id)
)
)
0
(none)

View file

@ -555,11 +555,10 @@
)
(#when PC_PORT
(when (and *pc-settings* (not (-> *pc-settings* use-vis?)))
;; these are the values used when the game is in 4x3
;; when the game is in widescreen, HUD sprites are generally enlarged, which looks terrible
(set! f1-0 (the-as float #xbeccdcf4))
(set! f2-0 (the-as float #xbe6f01c8))
(set! f0-1 (the-as float #x3f4cd277))
;; when the game is in widescreen, HUD sprites are generally enlarged, which looks terrible.
;; this reverts that.
(*! f1-0 (-> *pc-settings* aspect-ratio-scale))
(*! f0-1 (-> *pc-settings* aspect-ratio-scale))
)
)
(set-vector! (-> mtx2 vector 0) f0-1 0.0 0.0 0.0)

View file

@ -274,25 +274,20 @@
(set-vector! (-> arg0 title-light-group ambi color) 0.5 0.5 0.5 1.0)
(set! (-> arg0 title-light-group dir0 levels x) 1.0)
(set! (-> arg0 title-light-group dir1 levels x) 1.0)
(let ((f0-14 1.0))
(set! (-> arg0 title-light-group ambi levels x) f0-14)
f0-14
)
)
(set! (-> arg0 title-light-group ambi levels x) 1.0)
(none))
(defun update-time-of-day ((arg0 time-of-day-context))
"Update the time of day context"
;; set defaults
(set! (-> arg0 sky) #f)
(set! (-> arg0 target-interp) 0.0)
;; TODO re-enable
(set! (-> arg0 target-interp) 0.0)
(when *target*
(set! (-> *target* draw light-index) (the-as uint 0))
(when (-> *target* sidekick)
(set! (-> *target* sidekick 0 draw light-index) (the-as uint 0))
0
)
)

View file

@ -1505,7 +1505,7 @@
(let ((startup-level (case *kernel-boot-message*
(('play)
(if *debug-segment*
(#if (user? dass) 'citadel 'village1)
'village1
'title
)
)

View file

@ -32,7 +32,7 @@
(defglobalconstant PC_KERNEL_VERSION_BUILD #x0001)
(defglobalconstant PC_KERNEL_VERSION_REVISION #x0001)
(defglobalconstant PC_KERNEL_VERSION_REVISION #x0002)
(defglobalconstant PC_KERNEL_VERSION_MINOR #x0000)
(defglobalconstant PC_KERNEL_VERSION_MAJOR #x0001)
@ -109,6 +109,21 @@
(test)
)
;; cheats
(defenum pc-cheats
:bitfield #t
:type uint64
(eco-green)
(eco-red)
(eco-blue)
(eco-yellow)
(invinc)
(sidekick-blue)
)
(defmacro pc-cheats? (obj &rest cheats)
`(logtest? (-> ,obj cheats) (pc-cheats ,@cheats)))
;; secrets and goodies
(deftype pc-game-secrets (structure)
((art pc-jak1-concept-art) ;; concept art unlocked
@ -120,7 +135,10 @@
(hero-mode? symbol) ;; unsure how this should work
(hud-map? symbol) ;; enable map in HUD/progress?
(hud-counters? symbol) ;; enable level orb counter/global buzzer counter?
(hud-watch? symbol) ;; a watch that tells the time of day!
(watch-12hr? symbol) ;; 12-hour clock toggle
)
:pack-me
)
;; general fixes
@ -135,11 +153,13 @@
(fix-movies symbol) ;; bad camera and single-frame crappiness
(fix-credits symbol) ;; one of the credits lines has the wrong color!!
)
:pack-me
)
;; bingo integration. placeholder for now.
(deftype pc-bingo-info (structure)
()
:pack-me
)
@ -205,6 +225,9 @@
(display-bug-report symbol)
(display-heap-status symbol)
(display-actor-counts symbol)
(mood-override? symbol)
(mood-overrides float 8)
(movie? symbol)
;; device settings
;(device-audio pc-device-info :inline) ;; used audio device
@ -250,6 +273,9 @@
(hinttitles? symbol) ;; if on, non-cutscene subtitles will show up
(subtitle-language pc-subtitle-lang) ;; language for subtitles
(subtitle-speaker? symbol) ;; #f (force off), #t (force on), auto (on for offscreen)
(camera-hflip? symbol) ;; horizontal camera invert
(camera-vflip? symbol) ;; vertical camera invert
(money-starburst? symbol) ;; add a starburst to the money
(fixes pc-fixes :inline) ;; extra game fixes
@ -260,6 +286,8 @@
(scenes-seen uint8 197) ;; cutscenes that have been seen, by spool-anim (maybe use 8-char name or bits instead?)
(discord-rpc? symbol) ;; enable discord rich presence integration
(cheats pc-cheats)
)
(:methods
@ -283,6 +311,7 @@
(read-from-file (_type_ string) symbol)
(write-to-file (_type_ string) symbol)
(actor-force-visible? (_type_) symbol)
(update-cheats (_type_) int)
)
)
@ -333,6 +362,8 @@
(set! (-> obj display-bug-report) #f)
(set! (-> obj display-heap-status) #f)
(set! (-> obj display-actor-counts) #f)
(set! (-> obj mood-override?) #f)
(set! (-> obj movie?) #f)
(set! (-> obj font-scale) 1.0)
(set! (-> obj aspect-custom-x) 1)
(set! (-> obj aspect-custom-y) 1)
@ -405,6 +436,9 @@
(set! (-> obj hinttitles?) #t)
(set! (-> obj subtitle-speaker?) 'auto)
(set! (-> obj subtitle-language) (pc-subtitle-lang english))
(set! (-> obj camera-hflip?) #f)
(set! (-> obj camera-vflip?) #f)
(set! (-> obj money-starburst?) #f)
(none))
(defmethod reset-fixes pc-settings ((obj pc-settings))
@ -439,6 +473,8 @@
(set! (-> obj secrets hero-mode?) #f)
(set! (-> obj secrets hud-map?) #t)
(set! (-> obj secrets hud-counters?) #t)
(set! (-> obj secrets hud-watch?) #f)
(set! (-> obj secrets watch-12hr?) #f)
(none))
(defmethod actor-force-visible? pc-settings ((obj pc-settings))
@ -454,6 +490,84 @@
))
)
(seval (define *pc-cheat-map*
'((a (triangle triangle))
(b (square square))
(c (circle circle))
(d (x x))
(e (right right))
(f (right up))
(g (right down))
(h (left right))
(i (up right))
(j (down left))
(k (square right))
(l (left down))
(m (up circle))
(n (up up))
(o (circle square))
(p (down circle))
(q (dowm square))
(r (circle x))
(s (down x))
(t (triangle square))
(u (square x))
(v (x triangle))
(w (left left))
(x (up down))
(y (up x))
(z (up circle))
))
)
(desfun pc-cheat-encode (letters extra)
"turn a cheat word into input names."
(let ((out '()))
(dolist (in letters)
(let ((buttons (cadr (assoc (car in) *pc-cheat-map*))))
(dolist (button buttons)
(set! out (cons (car button) out))
)
)
)
(dolist (ex extra)
(set! out (cons (car ex) out))
)
(reverse out)
)
)
(defmacro pc-check-cheat-code (cheat-var pad-idx input &key (extra ()) &rest body)
"execute body when a cheat code made up of sequential inputs has been inputted"
(let ((buttons (pc-cheat-encode input extra)))
`(when (nonzero? (cpad-pressed ,pad-idx)) ;; only check when some button has been pressed
(case ,cheat-var
,@(apply-i
(lambda (x i)
`((,i)
(if (cpad-pressed? ,pad-idx ,x)
,(if (< i (- (length buttons) 1))
`(1+! ,cheat-var)
`(begin ,@body (set! ,cheat-var 0))
)
(set! ,cheat-var 0)
)
)
)
buttons)
)
)
))
)

View file

@ -48,13 +48,14 @@
0)
(defmethod set-size! pc-settings ((obj pc-settings) (width int) (height int))
"toggles fullscreen mode"
"sets window size"
(pc-set-window-size width height)
0)
(defmethod set-aspect! pc-settings ((obj pc-settings) (aw int) (ah int))
"set the aspect ratio used for rendering. this forces native widescreen and takes width and height ratios."
(let ((aspect (/ (the float aw) (the float ah))))
(set-aspect-ratio! obj aspect)
(set! (-> obj aspect-ratio-auto?) #f)
@ -64,6 +65,7 @@
(defmethod set-aspect-ratio! pc-settings ((obj pc-settings) (aspect float))
"set the aspect ratio used for rendering."
(set! (-> obj aspect-ratio) aspect)
(set! (-> obj aspect-ratio-scale) (/ aspect ASPECT_4X3))
(set! (-> obj aspect-ratio-reciprocal) (/ ASPECT_4X3 aspect))
@ -95,7 +97,7 @@
)
((> win-aspect (-> obj aspect-ratio))
;; too wide
(set! (-> obj width) (the int (* (-> obj aspect-ratio) (the float (-> obj win-height)))))
(set! (-> obj width) (the int (* (the float (-> obj win-height)) (-> obj aspect-ratio))))
(set! (-> obj height) (-> obj win-height))
)
((< win-aspect (-> obj aspect-ratio))
@ -131,7 +133,7 @@
(pc-discord-rpc-set 1)
)
(else
(pc-discord-rpc-set 0)
(pc-discord-rpc-set 0)
)
)
@ -142,12 +144,23 @@
(none))
(define *pc-cheat-temp* (the-as (pointer int32) (malloc 'global 24)))
(defmacro pc-cheat-toggle-and-tune (obj cheat)
`(begin
(cpad-clear-buttons! 0 r1)
(logxor! (-> ,obj cheats) (pc-cheats ,cheat))
(cheats-sound-play (logtest? (-> ,obj cheats) (pc-cheats ,cheat)))
)
)
(defmethod update pc-settings ((obj pc-settings))
"Update settings to/from PC kernel. Call this at the start of every frame.
This will update things like the aspect-ratio, which will be used for graphics code later."
(update-from-os obj)
(update-to-os obj)
(set! (-> obj movie?) (movie?))
(let ((info (new 'stack 'discord-info)))
(set! (-> info fuel) (&-> *game-info* fuel))
@ -169,6 +182,8 @@
(set! (-> *font-default-matrix* vector 0 x) (-> *video-parms* relative-x-scale))
)
(when (not (-> obj use-vis?))
(set-hud-aspect-ratio 'aspect4x3 'ntsc) ;; set hud aspect ratios every frame because why not?
(when *progress-process*
;; adjust sizes for progress.
;; video.gc sets the sizes in the normal game.
@ -194,8 +209,73 @@
(set! (-> *ACTOR-bank* pause-dist) (meters 220))
))
;; cheats.
(update-cheats obj)
(none))
(defmethod update-cheats pc-settings ((obj pc-settings))
"run cheats."
(when (and (cpad-hold? 0 l2) (cpad-hold? 0 l1) (cpad-hold? 0 r2) (cpad-hold? 0 r1))
(pc-check-cheat-code (-> *pc-cheat-temp* 0) 0 (s p i r i t) :extra (x)
(logclear! (-> obj cheats) (pc-cheats eco-red eco-yellow eco-green))
(pc-cheat-toggle-and-tune obj eco-blue))
(pc-check-cheat-code (-> *pc-cheat-temp* 1) 0 (s p i r i t) :extra (circle)
(logclear! (-> obj cheats) (pc-cheats eco-blue eco-yellow eco-green))
(pc-cheat-toggle-and-tune obj eco-red))
(pc-check-cheat-code (-> *pc-cheat-temp* 2) 0 (s p i r i t) :extra (triangle)
(logclear! (-> obj cheats) (pc-cheats eco-red eco-yellow eco-blue))
(pc-cheat-toggle-and-tune obj eco-green))
(pc-check-cheat-code (-> *pc-cheat-temp* 3) 0 (s p i r i t) :extra (square)
(logclear! (-> obj cheats) (pc-cheats eco-red eco-blue eco-green))
(pc-cheat-toggle-and-tune obj eco-yellow))
(pc-check-cheat-code (-> *pc-cheat-temp* 4) 0 (s t e e l)
(logclear! (-> *target* state-flags) 16)
(pc-cheat-toggle-and-tune obj invinc))
(pc-check-cheat-code (-> *pc-cheat-temp* 5) 0 (l e a d s)
(pc-cheat-toggle-and-tune obj sidekick-blue))
)
(when *target*
(when (and (pc-cheats? obj eco-blue)
(or (= (-> *target* fact-info-target eco-type) (pickup-type eco-blue))
(<= (-> *target* fact-info-target eco-level) 0.0)))
(send-event *target* 'get-pickup (pickup-type eco-blue) (-> *FACT-bank* eco-full-inc)))
(when (and (pc-cheats? obj eco-yellow)
(or (= (-> *target* fact-info-target eco-type) (pickup-type eco-yellow))
(<= (-> *target* fact-info-target eco-level) 0.0)))
(send-event *target* 'get-pickup (pickup-type eco-yellow) (-> *FACT-bank* eco-full-inc)))
(when (and (pc-cheats? obj eco-red)
(or (= (-> *target* fact-info-target eco-type) (pickup-type eco-red))
(<= (-> *target* fact-info-target eco-level) 0.0)))
(send-event *target* 'get-pickup (pickup-type eco-red) (-> *FACT-bank* eco-full-inc)))
(when (and (pc-cheats? obj eco-green)
(or (= (-> *target* fact-info-target eco-type) (pickup-type eco-green))
(<= (-> *target* fact-info-target eco-level) 0.0)))
(with-pp
(define-extern vent type)
(protect ((-> (the basic pp) type) (-> *target* control root-prim prim-core action))
(set! (-> (the basic pp) type) vent)
(logior! (-> *target* control root-prim prim-core action) #x200)
(send-event *target* 'get-pickup (pickup-type eco-green) (-> *FACT-bank* eco-full-inc)))
))
(when (pc-cheats? obj invinc)
(logior! (-> *target* state-flags) 16)
)
)
0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -311,15 +391,7 @@
(defun file-stream-read-symbol ((file file-stream))
(file-stream-seek-past-whitespace file)
(file-stream-read-word file)
(case-str *pc-temp-string*
(("#f") #f)
(("#t") #t)
(("aspect4x3") 'aspect4x3)
(("aspect16x9") 'aspect16x9)
(("borderless") 'borderless)
(("auto") 'auto)
(else #t)
)
(string->symbol *pc-temp-string*)
)
(defmacro pc-settings-read-throw-error (fs msg)
@ -434,6 +506,9 @@
(("subtitles?") (set! (-> obj subtitles?) (file-stream-read-symbol file)))
(("hinttitles?") (set! (-> obj hinttitles?) (file-stream-read-symbol file)))
(("discord-rpc?") (set! (-> obj discord-rpc?) (file-stream-read-symbol file)))
(("camera-hflip?") (set! (-> obj camera-hflip?) (file-stream-read-symbol file)))
(("camera-vflip?") (set! (-> obj camera-vflip?) (file-stream-read-symbol file)))
(("money-starburst?") (set! (-> obj money-starburst?) (file-stream-read-symbol file)))
(("scenes-seen")
(dotimes (i 197)
(set! (-> obj scenes-seen i) (file-stream-read-int file))
@ -461,6 +536,8 @@
(("hero-mode?") (set! (-> obj secrets hero-mode?) (file-stream-read-symbol file)))
(("hud-map?") (set! (-> obj secrets hud-map?) (file-stream-read-symbol file)))
(("hud-counters?") (set! (-> obj secrets hud-counters?) (file-stream-read-symbol file)))
(("hud-watch?") (set! (-> obj secrets hud-watch?) (file-stream-read-symbol file)))
(("watch-12hr?") (set! (-> obj secrets watch-12hr?) (file-stream-read-symbol file)))
(("art") (set! (-> obj secrets art) (the-as pc-jak1-concept-art (file-stream-read-int file))))
(("hard-fish-hiscore") (set! (-> obj secrets hard-fish-hiscore) (file-stream-read-int file)))
(("hard-rats-hiscore") (set! (-> obj secrets hard-rats-hiscore) (file-stream-read-int file)))
@ -661,9 +738,9 @@
(defmethod new entity-debug-inspect ((allocation symbol) (type-to-make type))
"make a new entity-debug-inspect object"
(let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(set! (-> obj scroll-y) 0)
(set! (-> obj scroll-y-max) 0)
(set! (-> obj entity) (the entity #f))
@ -674,28 +751,30 @@
(defmethod set-entity! entity-debug-inspect ((obj entity-debug-inspect) (e entity))
"set the entity to inspect"
(set! (-> obj entity) e)
(unless e
(set! *display-actor-anim* (the string #f)))
(set! (-> obj scroll-y) 0)
e
)
(defmethod update-pad entity-debug-inspect ((obj entity-debug-inspect) (pad-idx int))
"respond to pad inputs"
;; scroll up
(if (cpad-pressed? pad-idx l1)
(set! (-> obj scroll-y) (max 0 (1- (-> obj scroll-y)))))
(1-! (-> obj scroll-y)))
;; scroll down
(if (cpad-pressed? pad-idx r1)
(set! (-> obj scroll-y) (min (-> obj scroll-y-max) (1+ (-> obj scroll-y)))))
(1+! (-> obj scroll-y)))
;; toggle actor info
(if (cpad-pressed? pad-idx l3)
(not! (-> obj show-actor-info)))
(minmax! (-> obj scroll-y) 0 (-> obj scroll-y-max))
(none))

View file

@ -394,3 +394,12 @@
)
)
(defmacro cheats-sound-play (cheat?)
"play the appropriate sound for inputting a cheat code"
`(if ,cheat?
(sound-play-by-name (static-sound-name "select-menu") (new-sound-id) 1024 0 0 1 #t)
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
)
)

View file

@ -982,6 +982,10 @@
(set! f30-0 0.0)
)
;; pc hack for more particles.
(with-pc
(if (not (-> *pc-settings* ps2-parts?)) (/! f30-0 128.0)))
;; loop over particles in the group.
(let ((s2-1 (-> obj length)))
(while (begin

View file

@ -151,6 +151,10 @@
(let ((v1-22 (-> self parent-override 0 draw color-mult quad)))
(set! (-> self draw color-mult quad) v1-22)
)
(with-pc ;; duh!
(if (pc-cheats? *pc-settings* sidekick-blue)
(set! (-> self draw color-mult x) (set! (-> self draw color-mult y) 0.0)))
)
(let ((v1-26 (-> self parent-override 0 draw color-emissive quad)))
(set! (-> self draw color-emissive quad) v1-26)
)

View file

@ -437,6 +437,14 @@
(set! (-> obj particles 2 init-pos x) 70.0)
(set! (-> obj particles 2 init-pos y) 76.0)
(set! (-> obj scale) 6963.2)
(with-pc
(when (not (-> *pc-settings* use-vis?))
(let ((base-x (-> obj particles 0 init-pos x)))
(set! (-> obj particles 1 init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> obj particles 1 init-pos x) base-x))))
(set! (-> obj particles 2 init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> obj particles 2 init-pos x) base-x))))
)
)
)
)
)
0
@ -1936,6 +1944,22 @@
(set! (-> obj scale-backing) 10240.0)
)
)
(#when PC_PORT
(let ((base-x (-> obj particles 2 init-pos x)))
(+! base-x (* (- 512.0 base-x) (- 1.0 (-> *pc-settings* aspect-ratio-reciprocal))))
(set! (-> obj particles 0 init-pos x) 435.0)
(set! (-> obj particles 1 init-pos x) 432.0)
(set! (-> obj particles 2 init-pos x) 435.0)
(when (not (-> *pc-settings* use-vis?))
(dotimes (i (-> obj nb-of-particles))
(set! (-> obj particles i init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> obj particles i init-pos x) base-x))))
))
)
)
0
(none)
)

View file

@ -5,10 +5,6 @@
;; name in dgo: hud
;; dgos: GAME, ENGINE
;; TODO - for hud-classes
(define-extern hud-init-by-other (function int none :behavior hud))
;; DECOMP BEGINS
(defmethod relocate hud ((obj hud) (arg0 int))
@ -147,7 +143,13 @@
(* 0.5 (- (* (-> *video-parms* relative-y-scale)
(+ (-> obj particles s5-0 init-pos y)
(the float (* (-> obj y-sgn) (-> obj offset)))
(* (the float (-> obj y-offset)) (-> *video-parms* relative-x-scale-reciprical))
(#if PC_PORT
(if (not (-> *pc-settings* use-vis?))
(* (the float (-> obj y-offset)) (-> *video-parms* relative-y-scale))
(* (the float (-> obj y-offset)) (-> *video-parms* relative-x-scale-reciprical))
)
(* (the float (-> obj y-offset)) (-> *video-parms* relative-x-scale-reciprical))
)
)
)
(the float (-> *video-parms* screen-sy))

View file

@ -1679,8 +1679,8 @@
"nav/navigate-h.gc"
"load/load-dgo.gc"
"load/ramdisk.gc"
"pc/pckernel.gc" ;; added
"sound/gsound.gc"
"pc/pckernel.gc" ;; added
"math/transformq.gc"
"collide/collide-func.gc"
"anim/joint.gc"

View file

@ -546,6 +546,10 @@
`(neq? ,thing 0)
)
(defmacro or! (place &rest args)
`(set! ,place (or ,place ,@args))
)
(defmacro not! (var)
`(set! ,var (not ,var)))
(defmacro true! (var)
@ -559,6 +563,12 @@
(defmacro fminmax (val minval maxval)
`(fmax (fmin ,val ,maxval) ,minval)
)
(defmacro minmax! (val minval maxval)
`(set! ,val (max (min ,val ,maxval) ,minval))
)
(defmacro fminmax! (val minval maxval)
`(set! ,val (fmax (fmin ,val ,maxval) ,minval))
)
(defmacro maxmin (val minval maxval)
`(min (max ,val ,maxval) ,minval)

View file

@ -36,27 +36,17 @@
)
(cond
((< (-> *hud-parts* bike-speed 0 offset) 10)
(cond
((< f0-1 (-> arg2 vector 1 z))
(let ((f0-4 (deg-seek (-> arg2 vector 1 z) f0-1 (* 131072.0 (-> *display* seconds-per-frame)))))
(set! (-> arg2 vector 1 z) f0-4)
f0-4
)
)
(else
(let ((f0-7 (deg-seek (-> arg2 vector 1 z) f0-1 (* 32768.0 (-> *display* seconds-per-frame)))))
(set! (-> arg2 vector 1 z) f0-7)
f0-7
)
(if (< f0-1 (-> arg2 vector 1 z))
(set! (-> arg2 vector 1 z) (deg-seek (-> arg2 vector 1 z) f0-1 (* 131072.0 (-> *display* seconds-per-frame))))
(set! (-> arg2 vector 1 z) (deg-seek (-> arg2 vector 1 z) f0-1 (* 32768.0 (-> *display* seconds-per-frame))))
)
)
)
(else
(set! (-> arg2 vector 1 z) f0-1)
f0-1
)
)
)
(none)
)
(defpartgroup group-part-hud-racer-speed-dial
@ -140,21 +130,16 @@
((and (< 0.8 f0-1) (zero? (logand (-> *display* integral-frame-counter) 8)))
(set! (-> arg2 vector 2 x) 128.0)
(set! (-> arg2 vector 2 y) 0.0)
(let ((f0-4 0.0))
(set! (-> arg2 vector 2 z) f0-4)
f0-4
)
(set! (-> arg2 vector 2 z) 0.0)
)
(else
(set! (-> arg2 vector 2 x) 128.0)
(set! (-> arg2 vector 2 y) 128.0)
(let ((f0-7 128.0))
(set! (-> arg2 vector 2 z) f0-7)
f0-7
)
(set! (-> arg2 vector 2 z) 128.0)
)
)
)
(none)
)
(defun zoomer-heat-slice-color ((arg0 matrix) (arg1 float))
@ -162,36 +147,25 @@
((< arg1 0.6)
(set! (-> arg0 vector 2 x) (* 213.33333 arg1))
(set! (-> arg0 vector 2 y) 128.0)
(let ((f0-4 0.0))
(set! (-> arg0 vector 2 z) f0-4)
f0-4
)
(set! (-> arg0 vector 2 z) 0.0)
)
((< arg1 0.8)
(set! (-> arg0 vector 2 x) 128.0)
(set! (-> arg0 vector 2 y) (- 128.0 (* 640.0 (+ -0.6 arg1))))
(let ((f0-9 0.0))
(set! (-> arg0 vector 2 z) f0-9)
f0-9
)
(set! (-> arg0 vector 2 z) 0.0)
)
((zero? (logand (-> *display* integral-frame-counter) 8))
(set! (-> arg0 vector 2 x) 128.0)
(set! (-> arg0 vector 2 y) 0.0)
(let ((f0-12 0.0))
(set! (-> arg0 vector 2 z) f0-12)
f0-12
)
(set! (-> arg0 vector 2 z) 0.0)
)
(else
(set! (-> arg0 vector 2 x) 128.0)
(set! (-> arg0 vector 2 y) 100.0)
(let ((f0-15 100.0))
(set! (-> arg0 vector 2 z) f0-15)
f0-15
)
(set! (-> arg0 vector 2 z) 100.0)
)
)
(none)
)
(defun part-hud-zoomer-heat-slice-01-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
@ -199,6 +173,7 @@
(set! (-> arg2 vector 1 z) (* 182.04445 (+ -135.0 (* 215.0 f0-1))))
(zoomer-heat-slice-color arg2 f0-1)
)
(none)
)
(defun part-hud-zoomer-heat-slice-02-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
@ -209,6 +184,7 @@
)
(zoomer-heat-slice-color arg2 f0-1)
)
(none)
)
(defun part-hud-zoomer-heat-slice-03-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
@ -219,6 +195,7 @@
)
(zoomer-heat-slice-color arg2 f0-1)
)
(none)
)
(defpartgroup group-part-hud-racer-heat-backing
@ -493,6 +470,48 @@
)
)
(#when PC_PORT
;; extra methods needed for aspect ratio in pc port
(defmethod animate! hud-bike-heat ((obj hud-bike-heat) (arg0 symbol) (arg1 symbol))
(with-pc
(let ((base-x (-> obj particles 0 init-pos x)))
(*! base-x (-> *pc-settings* aspect-ratio-reciprocal))
(set! (-> obj particles 0 init-pos x) 13.0)
(set! (-> obj particles 1 init-pos x) 70.0)
(set! (-> obj particles 2 init-pos x) 20.0)
(set! (-> obj particles 3 init-pos x) 70.0)
(when (not (-> *pc-settings* use-vis?))
(dotimes (i (-> obj nb-of-particles))
(set! (-> obj particles i init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> obj particles i init-pos x) base-x))))
))
)
)
(none)
)
(defmethod animate! hud-bike-speed ((obj hud-bike-speed) (arg0 symbol) (arg1 symbol))
(with-pc
(let ((base-x (-> obj particles 1 init-pos x)))
(+! base-x (* (- 512.0 base-x) (- 1.0 (-> *pc-settings* aspect-ratio-reciprocal))))
(set! (-> obj particles 0 init-pos x) 433.0)
(set! (-> obj particles 1 init-pos x) 378.0)
(set! (-> obj particles 2 init-pos x) 415.0)
(when (not (-> *pc-settings* use-vis?))
(dotimes (i (-> obj nb-of-particles))
(set! (-> obj particles i init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> obj particles i init-pos x) base-x))))
))
)
)
(none)
)
)
(defpartgroup group-racer-trans-pad
:id 115
:bounds (static-bspherem 0 0 0 8)

View file

@ -946,6 +946,7 @@
(= (-> self racer boost-level) 0.0)
)
(when (nonzero? (-> self racer boost-sound-id))
(#when PC_DEBUG_SOUND_ENABLE
(let ((v1-241 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
(set! (-> v1-241 command) (sound-command set-param))
(set! (-> v1-241 id) (-> self racer boost-sound-id))
@ -955,6 +956,7 @@
(set! (-> v1-241 parms mask) (the-as uint 17))
(-> v1-241 id)
)
)
(set! (-> self racer boost-sound-id) (new 'static 'sound-id))
0
)

View file

@ -2,6 +2,7 @@
(in-package goal)
;; definition for function make-light-kit
;; INFO: Return type mismatch float vs none.
(defun make-light-kit ((arg0 light-group) (arg1 float) (arg2 float) (arg3 float) (arg4 float))
(let ((s4-0 (new 'stack-no-clear 'matrix)))
(matrix-rotate-y! s4-0 arg1)
@ -31,14 +32,11 @@
(set! (-> v1-4 direction w) 0.0)
)
(set-vector! (-> arg0 dir2 color) 0.8 0.775 0.7 1.0)
(let ((f0-26 arg4))
(set! (-> arg0 dir2 levels x) f0-26)
f0-26
)
(set! (-> arg0 dir2 levels x) arg4)
(none)
)
;; definition for function make-village1-light-kit
;; INFO: Return type mismatch float vs none.
(defun make-village1-light-kit ((arg0 mood-context))
(make-light-kit (-> arg0 light-group 1) 38229.332 0.9 0.9 0.4)
(let ((s5-0 (-> arg0 light-group 2)))

View file

@ -10,13 +10,12 @@
)
;; definition for function update-light-kit
;; INFO: Return type mismatch float vs none.
;; Used lq/sq
(defun update-light-kit ((arg0 light-group) (arg1 light) (arg2 float))
(set! (-> arg0 ambi color quad) (-> arg1 color quad))
(let ((f0-1 (* (-> arg1 levels x) arg2)))
(set! (-> arg0 ambi levels x) f0-1)
f0-1
)
(set! (-> arg0 ambi levels x) (* (-> arg1 levels x) arg2))
(none)
)
;; definition for function set-target-light-index

View file

@ -129,7 +129,7 @@
(die () _type_ :state 24)
(jump () _type_ :state 25)
(notice-blue (handle) _type_ :state 26)
(get-pickup-sound (_type_ pickup-type) ambient-sound 27)
(initialize-effect (_type_ pickup-type) none 27)
(initialize-eco (_type_ entity-actor pickup-type float) object 28)
(animate (_type_) none 29)
(blocked () _type_ :state 30)
@ -185,7 +185,8 @@
)
;; definition for method 27 of type eco-collectable
(defmethod get-pickup-sound eco-collectable ((obj eco-collectable) (arg0 pickup-type))
;; INFO: Return type mismatch ambient-sound vs none.
(defmethod initialize-effect eco-collectable ((obj eco-collectable) (arg0 pickup-type))
(set! (-> obj fact pickup-type) arg0)
(case (-> obj fact pickup-type)
(((pickup-type eco-blue) (pickup-type eco-red) (pickup-type eco-green) (pickup-type eco-yellow))
@ -261,12 +262,10 @@
)
)
(set! (-> obj part) (create-launch-control (-> obj eco-effect) obj))
(when (-> obj sound-name)
(let ((v0-1 (new 'process 'ambient-sound (-> obj sound-name) (-> obj root-override trans))))
(set! (-> obj sound) v0-1)
v0-1
(if (-> obj sound-name)
(set! (-> obj sound) (new 'process 'ambient-sound (-> obj sound-name) (-> obj root-override trans)))
)
)
(none)
)
;; definition for function initialize-eco-by-other
@ -285,7 +284,7 @@
(set! (-> self fact options) (-> arg2 options))
(set! (-> self root-override trans quad) (-> arg0 quad))
(set! (-> self root-override transv quad) (-> arg1 quad))
(get-pickup-sound self (-> self fact pickup-type))
(initialize-effect self (-> self fact pickup-type))
(set! (-> self notify-parent) #f)
(case (-> self fact pickup-type)
(((pickup-type eco-blue) (pickup-type eco-yellow) (pickup-type eco-red))
@ -319,7 +318,7 @@
(set! (-> obj pickup-type) arg1)
(initialize obj)
(set! (-> obj root-override trans quad) (-> arg0 extra trans quad))
(get-pickup-sound obj (-> obj fact pickup-type))
(initialize-effect obj (-> obj fact pickup-type))
(initialize-params obj 0 (the-as float 1024.0))
(update-transforms! (-> obj root-override))
(if (logtest? (fact-options eco-blocked) (-> obj fact options))
@ -2744,7 +2743,7 @@
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 363]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 122]
;; Used lq/sq
(defbehavior birth-pickup-at-point process ((arg0 vector) (arg1 pickup-type) (arg2 float) (arg3 symbol) (arg4 process-drawable) (arg5 fact-info))
(defbehavior birth-pickup-at-point process ((arg0 vector) (arg1 pickup-type) (arg2 float) (arg3 symbol) (arg4 process-tree) (arg5 fact-info))
(local-vars
(v1-2 basic)
(v1-28 symbol)
@ -3017,7 +3016,7 @@
(if (= (the-as int s3-0) 6)
(set! (-> s2-1 y) (+ 6144.0 (-> s2-1 y)))
)
(birth-pickup-at-point s2-1 (the-as pickup-type s3-0) f30-0 arg0 (the-as process-drawable arg1) obj)
(birth-pickup-at-point s2-1 (the-as pickup-type s3-0) f30-0 arg0 arg1 obj)
)
)
)

View file

@ -234,16 +234,15 @@
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function init-time-of-day-context
;; INFO: Return type mismatch float vs none.
(defun init-time-of-day-context ((arg0 time-of-day-context))
(set-vector! (-> arg0 title-light-group dir0 color) 0.82 0.82 0.82 1.0)
(set-vector! (-> arg0 title-light-group dir1 color) 2.0 2.0 2.0 1.0)
(set-vector! (-> arg0 title-light-group ambi color) 0.5 0.5 0.5 1.0)
(set! (-> arg0 title-light-group dir0 levels x) 1.0)
(set! (-> arg0 title-light-group dir1 levels x) 1.0)
(let ((f0-14 1.0))
(set! (-> arg0 title-light-group ambi levels x) f0-14)
f0-14
)
(set! (-> arg0 title-light-group ambi levels x) 1.0)
(none)
)
;; definition for function update-time-of-day

View file

@ -938,7 +938,7 @@
(pickup-type fuel-cell)
(the float (-> self entity extra perm task))
#f
(the-as process-drawable *entity-pool*)
*entity-pool*
(the-as fact-info #f)
)
)

View file

@ -384,7 +384,7 @@
(-> self pickup-type)
(-> *FACT-bank* eco-single-inc)
#t
(the-as process-drawable *entity-pool*)
*entity-pool*
t1-0
)
)

View file

@ -2,6 +2,7 @@
(in-package goal)
;; definition for function part-hud-racer-speed-func
;; INFO: Return type mismatch float vs none.
(defun part-hud-racer-speed-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let* ((f0-0 (-> *target* control unknown-float01))
(f0-1 (cond
@ -31,27 +32,17 @@
)
(cond
((< (-> *hud-parts* bike-speed 0 offset) 10)
(cond
((< f0-1 (-> arg2 vector 1 z))
(let ((f0-4 (deg-seek (-> arg2 vector 1 z) f0-1 (* 131072.0 (-> *display* seconds-per-frame)))))
(set! (-> arg2 vector 1 z) f0-4)
f0-4
)
)
(else
(let ((f0-7 (deg-seek (-> arg2 vector 1 z) f0-1 (* 32768.0 (-> *display* seconds-per-frame)))))
(set! (-> arg2 vector 1 z) f0-7)
f0-7
)
(if (< f0-1 (-> arg2 vector 1 z))
(set! (-> arg2 vector 1 z) (deg-seek (-> arg2 vector 1 z) f0-1 (* 131072.0 (-> *display* seconds-per-frame))))
(set! (-> arg2 vector 1 z) (deg-seek (-> arg2 vector 1 z) f0-1 (* 32768.0 (-> *display* seconds-per-frame))))
)
)
)
(else
(set! (-> arg2 vector 1 z) f0-1)
f0-1
)
)
)
(none)
)
;; failed to figure out what this is:
@ -135,6 +126,7 @@
)
;; definition for function part-hud-racer-heat-func
;; INFO: Return type mismatch float vs none.
(defun part-hud-racer-heat-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix))
(let ((f0-1 (/ (-> *target* racer heat) (-> *RACER-bank* heat-max))))
(set! (-> arg2 vector 1 z) (* 182.04445 (+ -45.0 (* 215.0 f0-1))))
@ -142,59 +134,44 @@
((and (< 0.8 f0-1) (zero? (logand (-> *display* integral-frame-counter) 8)))
(set! (-> arg2 vector 2 x) 128.0)
(set! (-> arg2 vector 2 y) 0.0)
(let ((f0-4 0.0))
(set! (-> arg2 vector 2 z) f0-4)
f0-4
)
(set! (-> arg2 vector 2 z) 0.0)
)
(else
(set! (-> arg2 vector 2 x) 128.0)
(set! (-> arg2 vector 2 y) 128.0)
(let ((f0-7 128.0))
(set! (-> arg2 vector 2 z) f0-7)
f0-7
)
(set! (-> arg2 vector 2 z) 128.0)
)
)
)
(none)
)
;; definition for function zoomer-heat-slice-color
;; INFO: Return type mismatch float vs none.
(defun zoomer-heat-slice-color ((arg0 matrix) (arg1 float))
(cond
((< arg1 0.6)
(set! (-> arg0 vector 2 x) (* 213.33333 arg1))
(set! (-> arg0 vector 2 y) 128.0)
(let ((f0-4 0.0))
(set! (-> arg0 vector 2 z) f0-4)
f0-4
)
(set! (-> arg0 vector 2 z) 0.0)
)
((< arg1 0.8)
(set! (-> arg0 vector 2 x) 128.0)
(set! (-> arg0 vector 2 y) (- 128.0 (* 640.0 (+ -0.6 arg1))))
(let ((f0-9 0.0))
(set! (-> arg0 vector 2 z) f0-9)
f0-9
)
(set! (-> arg0 vector 2 z) 0.0)
)
((zero? (logand (-> *display* integral-frame-counter) 8))
(set! (-> arg0 vector 2 x) 128.0)
(set! (-> arg0 vector 2 y) 0.0)
(let ((f0-12 0.0))
(set! (-> arg0 vector 2 z) f0-12)
f0-12
)
(set! (-> arg0 vector 2 z) 0.0)
)
(else
(set! (-> arg0 vector 2 x) 128.0)
(set! (-> arg0 vector 2 y) 100.0)
(let ((f0-15 100.0))
(set! (-> arg0 vector 2 z) f0-15)
f0-15
)
(set! (-> arg0 vector 2 z) 100.0)
)
)
(none)
)
;; definition for function part-hud-zoomer-heat-slice-01-func
@ -203,6 +180,7 @@
(set! (-> arg2 vector 1 z) (* 182.04445 (+ -135.0 (* 215.0 f0-1))))
(zoomer-heat-slice-color arg2 f0-1)
)
(none)
)
;; definition for function part-hud-zoomer-heat-slice-02-func
@ -214,6 +192,7 @@
)
(zoomer-heat-slice-color arg2 f0-1)
)
(none)
)
;; definition for function part-hud-zoomer-heat-slice-03-func
@ -225,6 +204,7 @@
)
(zoomer-heat-slice-color arg2 f0-1)
)
(none)
)
;; failed to figure out what this is: