Merge branch 'master' of https://github.com/water111/jak-project into w/dma-for-font

This commit is contained in:
water
2021-08-09 21:41:25 -04:00
60 changed files with 1662 additions and 811 deletions
+2
View File
@@ -1,4 +1,6 @@
third-party/**/* linguist-vendored
test/decompiler/reference/** linguist-vendored
*.gc linguist-language=lisp
*.gd linguist-language=lisp
*.gs linguist-language=Scheme
goal_src/engine/gfx/ocean/ocean-tables.gc linguist-vendored
+1 -3
View File
@@ -22,9 +22,7 @@ jobs:
# just do a sed for now
- name: Update Line Count
run: |
chmod +x ./.github/workflows/scripts/line-count.sh
./.github/workflows/scripts/line-count.sh
run: python ./scripts/update-file-progress.py
- name: Update Site
run: |
-5
View File
@@ -1,5 +0,0 @@
#!/bin/bash
LINE_COUNT=$(find ./goal_src -name '*.gc' | xargs wc -l | tail -1 | awk -F'[^0-9]+' '{ print $2 }')
sed -i "s/.*value.*/ \"value\": ${LINE_COUNT},/g" ./docs/gh-pages-proj/src/config/progress.json
+7
View File
@@ -49,6 +49,13 @@
"name" : "Run - Runtime (with kernel)",
"args" : [ "-fakeiso", "-debug", "-v", "-nodisplay" ]
},
{
"type" : "default",
"project" : "CMakeLists.txt",
"projectTarget" : "gk.exe (bin\\gk.exe)",
"name" : "Run - Runtime (with kernel + display)",
"args" : [ "-fakeiso", "-debug", "-v" ]
},
{
"type" : "default",
"project" : "CMakeLists.txt",
+2 -1
View File
@@ -4,6 +4,7 @@
#include "common/common_types.h"
#include "third-party/dragonbox.h"
#include "print_float.h"
#include "common/util/assert.h"
/*!
* Convert a float to a string. The string is _always_ in this format:
@@ -127,4 +128,4 @@ int float_to_cstr(float value, char* buffer) {
}
}
return i;
}
}
+28 -49
View File
@@ -782,7 +782,7 @@
(leaving-misty 114)
(assistant-village3 115)
(max 116)
(*unknown* 255))
)
(defenum game-text-id
@@ -11432,7 +11432,7 @@
(projectile-dissipate () none 21) ;; state
(projectile-impact () none 22) ;; state
(dummy-23 () none 23)
(dummy-24 () none 24)
(dummy-24 (_type_ ) none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
@@ -11864,15 +11864,15 @@
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-12 (_type_ vector float uint process bone uint) float 12) ;; TODO - bone not confirmed
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-16 (_type_ vector float uint process uint) none 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-20 () none 20)
(dummy-20 (_type_ vector float uint bone uint) none 20) ;; TODO - bone not confirmed
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
@@ -13232,12 +13232,12 @@
(deftype sp-field-init-spec (structure)
((field uint16 :offset-assert 0)
(flags uint16 :offset-assert 2)
(initial-valuef float :offset-assert 4)
(random-rangef float :offset-assert 8)
(random-multf float :offset-assert 12)
(initial-value int32 :offset 4)
(random-range int32 :offset 8)
(random-mult int32 :offset 12)
(initial-value int32 :offset-assert 4)
(random-range int32 :offset-assert 8)
(random-mult int32 :offset-assert 12)
(initial-valuef float :offset 4) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
(random-rangef float :offset 8) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
(random-multf float :offset 12) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
(func basic :offset 4)
(tex uint32 :offset 4)
(pntr uint32 :offset 4)
@@ -13252,7 +13252,7 @@
(deftype sparticle-launcher (basic)
((birthaccum float :offset-assert 4)
(soundaccum float :offset-assert 8)
(init-specs uint32 :offset-assert 12)
(init-specs (inline-array sp-field-init-spec) :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10
@@ -18989,7 +18989,7 @@
(define-extern level-setup (function none))
(define-extern target-exit function)
(define-extern target-calc-camera-pos function)
(define-extern do-target-shadow function)
(define-extern do-target-shadow (function none :behavior target))
(define-extern target-powerup-process function)
(define-extern flag-setup function)
(define-extern build-conversions function)
@@ -20865,7 +20865,7 @@
(define-extern projectile-collision-reaction function)
(define-extern projectile-update-velocity-space-wars function)
(define-extern find-nearest-attackable function)
(define-extern find-ground-and-draw-shadow function)
(define-extern find-ground-and-draw-shadow (function vector vector float uint process float float none))
(define-extern spawn-projectile-blue function)
;; - Unknowns
@@ -21022,9 +21022,9 @@
;; - Functions
(define-extern compute-and-draw-shadow function)
(define-extern draw-shadow function)
(define-extern add-fake-shadow-to-buffer function)
(define-extern compute-and-draw-shadow (function vector vector vector vector float float none))
(define-extern draw-shadow (function vector vector vector float float float none))
(define-extern add-fake-shadow-to-buffer (function vector vector float int none))
(define-extern swap-fake-shadow-buffers (function none))
@@ -22463,8 +22463,8 @@
:size-assert #x3c
:flag-assert #xb0000003c
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(reset! (_type_ process-drawable float float) none 9)
(TODO-RENAME-10 (_type_ process-drawable vector) symbol 10)
)
)
@@ -36969,36 +36969,15 @@
;; - Types
; (deftype mother-spider-proj (projectile)
; ((facing-dir vector :inline :offset-assert 416)
; )
; :method-count-assert 29
; :size-assert #x1b0
; :flag-assert #x1d014001b0
; ;; inherited inspect of projectile
; (:methods
; (dummy-9 () none 9)
; (dummy-10 () none 10)
; (dummy-11 () none 11)
; (dummy-12 () none 12)
; (dummy-13 () none 13)
; (dummy-14 () none 14)
; (dummy-15 () none 15)
; (dummy-16 () none 16)
; (dummy-17 () none 17)
; (dummy-18 () none 18)
; (dummy-19 () none 19)
; (dummy-20 () none 20)
; (dummy-21 () none 21)
; (dummy-22 () none 22)
; (dummy-23 () none 23)
; (dummy-24 () none 24)
; (dummy-25 () none 25)
; (dummy-26 () none 26)
; (dummy-27 () none 27)
; (dummy-28 () none 28)
; )
; )
(deftype mother-spider-proj (projectile)
((facing-dir vector :inline :offset-assert 416)
)
:method-count-assert 29
:heap-base #x140
:size-assert #x1b0
:flag-assert #x1d014001b0
;; inherited inspect of projectile
)
;; - Functions
@@ -1428,6 +1428,17 @@
["L508", "float", true]
],
"shadow": [
["L23", "sparticle-launcher", true],
["L26", "float", true],
["L27", "float", true],
["L28", "float", true]
],
"tippy": [
["L7", "float", true]
],
"title-obs": [["L499", "float", true]],
"drawable": [
@@ -821,6 +821,25 @@
[16, "sphere"]
],
"(method 10 tippy)": [
[16, "vector"]
],
"compute-and-draw-shadow": [
[16, "vector"],
[32, "vector"],
[48, "sparticle-cpuinfo"] // kinda a guess
],
"find-ground-and-draw-shadow": [
[16, "vector"],
[32, "vector"],
[48, "bone"] // what a guess!
],
"(method 20 collide-cache)": [
[16, "vector"]
],
"(anon-function 0 title-obs)": [
[16, "font-context"]
],
@@ -1823,9 +1823,10 @@
"draw-ocean-transition": [[255, "v1", "ocean-mid-mask"]],
// "ocean-trans-mask-ptrs-bit?": [
// [[32, 41], "a0", "(pointer ocean-trans-mask)"]
// ],
"do-target-shadow": [
[[0, 999], "s6", "target"],
[46, "v1", "collide-shape-prim"] // `event-other` from collide-shape
],
"draw-string": [
[[93, 96], "a0", "(pointer uint8)"],
+19 -1
View File
@@ -288,7 +288,7 @@ int index_of_closest_following_label_in_segment(int start_byte,
for (int i = 0; i < (int)labels.size(); i++) {
const auto& label = labels.at(i);
if (label.target_segment == seg) {
if (result_idx == -1) {
if (result_idx == -1 && label.offset > start_byte) {
result_idx = i;
closest_byte = label.offset;
} else {
@@ -419,6 +419,20 @@ goos::Object ocean_mid_masks_decompile(const std::vector<LinkedWord>& words,
data_field, all_words, file,
TypeSpec("ocean-mid-mask"), 8);
}
goos::Object sp_field_init_spec_decompile(const std::vector<LinkedWord>& words,
const std::vector<DecompilerLabel>& labels,
int my_seg,
int field_location,
const TypeSystem& ts,
const Field& data_field,
const std::vector<std::vector<LinkedWord>>& all_words,
const LinkedObjectFile* file) {
return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts,
data_field, all_words, file,
TypeSpec("sp-field-init-spec"), 16);
}
} // namespace
goos::Object decompile_structure(const TypeSpec& type,
@@ -608,6 +622,10 @@ goos::Object decompile_structure(const TypeSpec& type,
field_defs_out.emplace_back(
field.name(), ocean_mid_masks_decompile(obj_words, labels, label.target_segment,
field_start, ts, field, words, file));
} else if (field.name() == "init-specs" && type.print() == "sparticle-launcher") {
field_defs_out.emplace_back(
field.name(), sp_field_init_spec_decompile(obj_words, labels, label.target_segment,
field_start, ts, field, words, file));
} else {
std::vector<u8> bytes_out;
for (int byte_idx = field_start; byte_idx < field_end; byte_idx++) {
File diff suppressed because one or more lines are too long
+7 -4
View File
@@ -1,8 +1,11 @@
{
"jak1": {
"locPercentage": {
"value": 117858,
"label": "Lines of Code"
"fileProgress": {
"src_files_total": 514,
"src_files_finished": 54,
"src_files_started": 176,
"data_files_total": 584,
"data_files_started": 4
}
}
}
}
+31 -5
View File
@@ -58,13 +58,33 @@
<v-col cols="10">
<v-subheader>Decompilation</v-subheader>
<v-progress-linear
color="teal"
color="green"
buffer-value="0"
:value="jak1BlackLabelStatus.decompDone"
:value="jak1BlackLabelStatus.srcFilesFinishedValue"
stream
height="25"
>
{{jak1BlackLabelStatus.decompLabel}} - {{jak1BlackLabelStatus.decompDone}}%
Source Files Finished - {{ jak1BlackLabelStatus.srcFilesFinished }} / {{ jak1BlackLabelStatus.srcFilesTotal }}
</v-progress-linear>
<br>
<v-progress-linear
color="yellow"
buffer-value="0"
:value="jak1BlackLabelStatus.srcFilesStartedValue"
stream
height="25"
>
Source Files Started - {{ jak1BlackLabelStatus.srcFilesStarted }} / {{ jak1BlackLabelStatus.srcFilesTotal }}
</v-progress-linear>
<br>
<v-progress-linear
color="teal"
buffer-value="0"
:value="jak1BlackLabelStatus.dataFilesStartedValue"
stream
height="25"
>
Data Files Started - {{ jak1BlackLabelStatus.dataFilesStarted }} / {{ jak1BlackLabelStatus.dataFilesTotal }}
</v-progress-linear>
</v-col>
</v-row>
@@ -129,8 +149,14 @@ export default {
return {
recentPRs: [],
jak1BlackLabelStatus: {
decompDone: (projectProgress.jak1.locPercentage.value / 750000.0) * 100.0,
decompLabel: projectProgress.jak1.locPercentage.label
srcFilesTotal: projectProgress.jak1.fileProgress.src_files_total,
srcFilesFinished: projectProgress.jak1.fileProgress.src_files_finished,
srcFilesFinishedValue: projectProgress.jak1.fileProgress.src_files_finished / projectProgress.jak1.fileProgress.src_files_total * 100,
srcFilesStarted: projectProgress.jak1.fileProgress.src_files_started,
srcFilesStartedValue: projectProgress.jak1.fileProgress.src_files_started / projectProgress.jak1.fileProgress.src_files_total * 100,
dataFilesTotal: projectProgress.jak1.fileProgress.data_files_total,
dataFilesStarted: projectProgress.jak1.fileProgress.data_files_started,
dataFilesStartedValue: projectProgress.jak1.fileProgress.data_files_started / projectProgress.jak1.fileProgress.data_files_total * 100,
}
};
},
+1 -1
View File
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/jak-project/favicon.png"><title>OpenGOAL Tooling</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link href="/jak-project/css/about.8d0e9591.css" rel="prefetch"><link href="/jak-project/js/about.93743c22.js" rel="prefetch"><link href="/jak-project/css/chunk-vendors.b018c88a.css" rel="preload" as="style"><link href="/jak-project/js/app.1e67702b.js" rel="preload" as="script"><link href="/jak-project/js/chunk-vendors.f27e8f37.js" rel="preload" as="script"><link href="/jak-project/css/chunk-vendors.b018c88a.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but docs-and-tooling doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/jak-project/js/chunk-vendors.f27e8f37.js"></script><script src="/jak-project/js/app.1e67702b.js"></script></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/jak-project/favicon.png"><title>OpenGOAL Tooling</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link href="/jak-project/css/about.bf16c6ab.css" rel="prefetch"><link href="/jak-project/js/about.10e9478b.js" rel="prefetch"><link href="/jak-project/css/chunk-vendors.b018c88a.css" rel="preload" as="style"><link href="/jak-project/js/app.2ac786b5.js" rel="preload" as="script"><link href="/jak-project/js/chunk-vendors.874e560a.js" rel="preload" as="script"><link href="/jak-project/css/chunk-vendors.b018c88a.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but docs-and-tooling doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/jak-project/js/chunk-vendors.874e560a.js"></script><script src="/jak-project/js/app.2ac786b5.js"></script></body></html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
(function(e){function t(t){for(var n,o,i=t[0],c=t[1],l=t[2],s=0,p=[];s<i.length;s++)o=i[s],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&p.push(a[o][0]),a[o]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);f&&f(t);while(p.length)p.shift()();return u.push.apply(u,l||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,o=1;o<r.length;o++){var i=r[o];0!==a[i]&&(n=!1)}n&&(u.splice(t--,1),e=c(c.s=r[0]))}return e}var n={},o={app:0},a={app:0},u=[];function i(e){return c.p+"js/"+({about:"about"}[e]||e)+"."+{about:"93743c22"}[e]+".js"}function c(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,c),r.l=!0,r.exports}c.e=function(e){var t=[],r={about:1};o[e]?t.push(o[e]):0!==o[e]&&r[e]&&t.push(o[e]=new Promise((function(t,r){for(var n="css/"+({about:"about"}[e]||e)+"."+{about:"8d0e9591"}[e]+".css",a=c.p+n,u=document.getElementsByTagName("link"),i=0;i<u.length;i++){var l=u[i],s=l.getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(s===n||s===a))return t()}var p=document.getElementsByTagName("style");for(i=0;i<p.length;i++){l=p[i],s=l.getAttribute("data-href");if(s===n||s===a)return t()}var f=document.createElement("link");f.rel="stylesheet",f.type="text/css",f.onload=t,f.onerror=function(t){var n=t&&t.target&&t.target.src||a,u=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");u.code="CSS_CHUNK_LOAD_FAILED",u.request=n,delete o[e],f.parentNode.removeChild(f),r(u)},f.href=a;var d=document.getElementsByTagName("head")[0];d.appendChild(f)})).then((function(){o[e]=0})));var n=a[e];if(0!==n)if(n)t.push(n[2]);else{var u=new Promise((function(t,r){n=a[e]=[t,r]}));t.push(n[2]=u);var l,s=document.createElement("script");s.charset="utf-8",s.timeout=120,c.nc&&s.setAttribute("nonce",c.nc),s.src=i(e);var p=new Error;l=function(t){s.onerror=s.onload=null,clearTimeout(f);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;p.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",p.name="ChunkLoadError",p.type=n,p.request=o,r[1](p)}a[e]=void 0}};var f=setTimeout((function(){l({type:"timeout",target:s})}),12e4);s.onerror=s.onload=l,document.head.appendChild(s)}return Promise.all(t)},c.m=e,c.c=n,c.d=function(e,t,r){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(c.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)c.d(r,n,function(t){return e[t]}.bind(null,n));return r},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/jak-project/",c.oe=function(e){throw console.error(e),e};var l=window["webpackJsonp"]=window["webpackJsonp"]||[],s=l.push.bind(l);l.push=t,l=l.slice();for(var p=0;p<l.length;p++)t(l[p]);var f=s;u.push([0,"chunk-vendors"]),r()})({0:function(e,t,r){e.exports=r("56d7")},"56d7":function(e,t,r){"use strict";r.r(t);r("e260"),r("e6cf"),r("cca6"),r("a79d");var n=r("2b0e"),o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-app",[r("v-main",[r("router-view")],1)],1)},a=[],u={name:"App",components:{},data:function(){return{}}},i=u,c=r("2877"),l=r("6544"),s=r.n(l),p=r("7496"),f=r("f6c4"),d=Object(c["a"])(i,o,a,!1,null,null,null),h=d.exports;s()(d,{VApp:p["a"],VMain:f["a"]});var m=r("f309");n["a"].use(m["a"]);var v=new m["a"]({theme:{dark:!0}}),b=(r("d3b7"),r("3ca3"),r("ddb0"),r("8c4f"));n["a"].use(b["a"]);var g=[{path:"/",name:"Home",component:function(){return r.e("about").then(r.bind(null,"bb51"))}}],y=new b["a"]({mode:"history",base:"/jak-project/",routes:g}),w=y;n["a"].config.productionTip=!1,new n["a"]({vuetify:v,router:w,render:function(e){return e(h)}}).$mount("#app")}});
//# sourceMappingURL=app.1e67702b.js.map
(function(e){function t(t){for(var n,o,i=t[0],c=t[1],l=t[2],s=0,p=[];s<i.length;s++)o=i[s],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&p.push(a[o][0]),a[o]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);f&&f(t);while(p.length)p.shift()();return u.push.apply(u,l||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,o=1;o<r.length;o++){var i=r[o];0!==a[i]&&(n=!1)}n&&(u.splice(t--,1),e=c(c.s=r[0]))}return e}var n={},o={app:0},a={app:0},u=[];function i(e){return c.p+"js/"+({about:"about"}[e]||e)+"."+{about:"10e9478b"}[e]+".js"}function c(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,c),r.l=!0,r.exports}c.e=function(e){var t=[],r={about:1};o[e]?t.push(o[e]):0!==o[e]&&r[e]&&t.push(o[e]=new Promise((function(t,r){for(var n="css/"+({about:"about"}[e]||e)+"."+{about:"bf16c6ab"}[e]+".css",a=c.p+n,u=document.getElementsByTagName("link"),i=0;i<u.length;i++){var l=u[i],s=l.getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(s===n||s===a))return t()}var p=document.getElementsByTagName("style");for(i=0;i<p.length;i++){l=p[i],s=l.getAttribute("data-href");if(s===n||s===a)return t()}var f=document.createElement("link");f.rel="stylesheet",f.type="text/css",f.onload=t,f.onerror=function(t){var n=t&&t.target&&t.target.src||a,u=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");u.code="CSS_CHUNK_LOAD_FAILED",u.request=n,delete o[e],f.parentNode.removeChild(f),r(u)},f.href=a;var d=document.getElementsByTagName("head")[0];d.appendChild(f)})).then((function(){o[e]=0})));var n=a[e];if(0!==n)if(n)t.push(n[2]);else{var u=new Promise((function(t,r){n=a[e]=[t,r]}));t.push(n[2]=u);var l,s=document.createElement("script");s.charset="utf-8",s.timeout=120,c.nc&&s.setAttribute("nonce",c.nc),s.src=i(e);var p=new Error;l=function(t){s.onerror=s.onload=null,clearTimeout(f);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;p.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",p.name="ChunkLoadError",p.type=n,p.request=o,r[1](p)}a[e]=void 0}};var f=setTimeout((function(){l({type:"timeout",target:s})}),12e4);s.onerror=s.onload=l,document.head.appendChild(s)}return Promise.all(t)},c.m=e,c.c=n,c.d=function(e,t,r){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(c.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)c.d(r,n,function(t){return e[t]}.bind(null,n));return r},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/jak-project/",c.oe=function(e){throw console.error(e),e};var l=window["webpackJsonp"]=window["webpackJsonp"]||[],s=l.push.bind(l);l.push=t,l=l.slice();for(var p=0;p<l.length;p++)t(l[p]);var f=s;u.push([0,"chunk-vendors"]),r()})({0:function(e,t,r){e.exports=r("56d7")},"56d7":function(e,t,r){"use strict";r.r(t);r("e260"),r("e6cf"),r("cca6"),r("a79d");var n=r("2b0e"),o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-app",[r("v-main",[r("router-view")],1)],1)},a=[],u={name:"App",components:{},data:function(){return{}}},i=u,c=r("2877"),l=r("6544"),s=r.n(l),p=r("7496"),f=r("f6c4"),d=Object(c["a"])(i,o,a,!1,null,null,null),h=d.exports;s()(d,{VApp:p["a"],VMain:f["a"]});var b=r("f309");n["a"].use(b["a"]);var m=new b["a"]({theme:{dark:!0}}),v=(r("d3b7"),r("3ca3"),r("ddb0"),r("8c4f"));n["a"].use(v["a"]);var g=[{path:"/",name:"Home",component:function(){return r.e("about").then(r.bind(null,"bb51"))}}],y=new v["a"]({mode:"history",base:"/jak-project/",routes:g}),w=y;n["a"].config.productionTip=!1,new n["a"]({vuetify:m,router:w,render:function(e){return e(h)}}).$mount("#app")}});
//# sourceMappingURL=app.2ac786b5.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
@@ -83,6 +83,7 @@ set(RUNTIME_SOURCE
graphics/opengl_renderer/Shader.cpp
graphics/texture/TextureConverter.cpp
graphics/texture/TexturePool.cpp
graphics/pipelines/opengl.cpp
system/vm/dmac.cpp
system/vm/vm.cpp)
+112 -35
View File
@@ -4,51 +4,128 @@
*/
#include "display.h"
#include "gfx.h"
#include "common/log/log.h"
namespace Display {
/* ****************************** */
/* Internal functions */
/* ****************************** */
GLFWwindow* display = NULL;
namespace {
void InitDisplay(int width, int height, const char* title, GLFWwindow*& d) {
if (d) {
lg::warn("InitDisplay has already created a display window");
return;
}
// request OpenGL 3.0 (placeholder)
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
d = glfwCreateWindow(width, height, title, NULL, NULL);
if (!d) {
lg::error("InitDisplay failed - Could not create display window");
return;
}
glfwMakeContextCurrent(d);
if (!gladLoadGL()) {
lg::error("GL init fail");
KillDisplay(d);
return;
}
// enable vsync by default
glfwSwapInterval(1);
lg::debug("init display #x{}", (uintptr_t)d);
bool renderer_is_correct(const GfxRendererModule* renderer, GfxPipeline pipeline) {
return renderer->pipeline == pipeline;
}
void KillDisplay(GLFWwindow*& d) {
lg::debug("kill display #x{}", (uintptr_t)d);
if (!d) {
lg::warn("KillDisplay called when no display was available");
void set_main_display(std::shared_ptr<GfxDisplay> display) {
if (Display::g_displays.size() > 0) {
Display::g_displays[0] = display;
} else {
Display::g_displays.push_back(display);
}
}
} // namespace
/* ****************************** */
/* GfxDisplay */
/* ****************************** */
GfxDisplay::GfxDisplay(GLFWwindow* a_window) {
set_renderer(GfxPipeline::OpenGL);
set_window(a_window);
}
GfxDisplay::~GfxDisplay() {
m_renderer->kill_display(this);
// window_generic_ptr = nullptr;
}
void GfxDisplay::set_renderer(GfxPipeline pipeline) {
if (is_active()) {
lg::error("Can't change display's renderer while window exists.");
return;
}
if (m_renderer != nullptr) {
lg::error("A display changed renderer unexpectedly.");
return;
}
glfwDestroyWindow(d);
d = NULL;
m_renderer = Gfx::GetRenderer(pipeline);
}
void GfxDisplay::set_window(GLFWwindow* window) {
if (!renderer_is_correct(m_renderer, GfxPipeline::OpenGL)) {
lg::error("Can't set OpenGL window when using {}", m_renderer->name);
return;
}
if (is_active()) {
lg::error("Already have a window. Close window first.");
return;
}
this->window_glfw = window;
}
void GfxDisplay::set_title(const char* title) {
if (!is_active()) {
lg::error("No window to set title `{}`.", title);
return;
}
m_title = title;
}
void GfxDisplay::render_graphics() {
m_renderer->render_display(this);
}
/* ****************************** */
/* DISPLAY */
/* ****************************** */
namespace Display {
std::vector<std::shared_ptr<GfxDisplay>> g_displays;
std::shared_ptr<GfxDisplay> GetMainDisplay() {
if (g_displays.size() == 0)
return NULL;
return g_displays.front()->is_active() ? g_displays.front() : NULL;
}
int InitMainDisplay(int width, int height, const char* title, GfxSettings& settings) {
if (GetMainDisplay() != NULL) {
lg::warn("InitMainDisplay called when main display already exists.");
return 1;
}
auto display = settings.renderer->make_main_display(width, height, title, settings);
if (display == NULL) {
lg::error("Failed to make main display.");
return 1;
}
set_main_display(display);
}
void KillDisplay(std::shared_ptr<GfxDisplay> display) {
// lg::debug("kill display #x{:x}", (uintptr_t)display);
if (!display->is_active()) {
lg::warn("display #x{:x} cant be killed because it is not active");
return;
}
if (GetMainDisplay() == display) {
// killing the main display, kill all children displays too!
for (int i = 1; i < g_displays.size(); ++i) {
KillDisplay(g_displays.at(i));
}
}
// find this display in the list and remove it from there
// if everything went right the smart pointer should delete the display.
auto this_disp = std::find(g_displays.begin(), g_displays.end(), display);
g_displays.erase(this_disp);
}
} // namespace Display
+38 -11
View File
@@ -5,21 +5,48 @@
* Display for graphics. This is the game window, distinct from the runtime console.
*/
#ifndef RUNTIME_DISPLAY_H
#define RUNTIME_DISPLAY_H
#include "pipelines/opengl.h"
#include "gfx.h"
#include <vector>
#include <memory>
#include "opengl.h"
// a GfxDisplay class is equivalent to a window that displays stuff. This holds an actual internal
// window pointer used by whichever renderer. It also contains functions for setting and
// retrieving certain window parameters.
class GfxDisplay {
const char* m_title;
const GfxRendererModule* m_renderer = nullptr;
public:
GfxDisplay(GLFWwindow* a_window); // OpenGL window constructor
~GfxDisplay(); // destructor - this calls the renderer's function for getting rid of a window,
// and we can then get rid of the GfxDisplay itself
// all kinds of windows for the display
union {
void* window_generic_ptr = nullptr;
GLFWwindow* window_glfw;
};
bool is_active() const { return window_generic_ptr != nullptr; }
void set_renderer(GfxPipeline pipeline);
void set_window(GLFWwindow* window);
void set_title(const char* title);
const char* get_title() const { return m_title; }
void render_graphics();
};
namespace Display {
// TODO - eventually we might actually want to support having multiple windows and viewpoints
// so it would be nice if we didn't end up designing this system such that this MUST be
// a single window.
extern GLFWwindow* display;
// a list of displays. the first one is the "main" display, all others are spectator-like extra
// views.
extern std::vector<std::shared_ptr<GfxDisplay>> g_displays;
void InitDisplay(int width, int height, const char* title, GLFWwindow*& d);
void KillDisplay(GLFWwindow*& d);
int InitMainDisplay(int width, int height, const char* title, GfxSettings& settings);
void KillDisplay(std::shared_ptr<GfxDisplay> display);
std::shared_ptr<GfxDisplay> GetMainDisplay();
} // namespace Display
#endif // RUNTIME_DISPLAY_H
+48 -171
View File
@@ -1,211 +1,88 @@
/*!
* @file gfx.cpp
* Graphics component for the runtime. Handles some low-level routines.
* Graphics component for the runtime. Abstraction layer for the main graphics routines.
*/
#include "gfx.h"
#include <functional>
#include <memory>
#include <mutex>
#include <chrono>
#include <condition_variable>
#include "common/log/log.h"
#include "game/runtime.h"
#include "game/graphics/dma/dma_copy.h"
#include "display.h"
#include "common/goal_constants.h"
#include "common/util/Timer.h"
#include "game/graphics/opengl_renderer/OpenGLRenderer.h"
#include "game/graphics/texture/TexturePool.h"
#include "pipelines/opengl.h"
namespace {
// initializes a gfx settings.
// TODO save and load from file
void InitSettings(GfxSettings& settings) {
// use opengl by default for now
settings.renderer = Gfx::GetRenderer(GfxPipeline::OpenGL); // Gfx::renderers[0];
// 1 screen update per frame
settings.vsync = 1;
return;
}
} // namespace
namespace Gfx {
struct GraphicsData {
// vsync
std::mutex sync_mutex;
std::condition_variable sync_cv;
GfxVertex g_vertices_temp[VERTEX_BUFFER_LENGTH_TEMP];
// dma chain transfer
std::mutex dma_mutex;
std::condition_variable dma_cv;
u64 frame_idx = 0;
bool has_data_to_render = false;
FixedChunkDmaCopier dma_copier;
GfxSettings g_settings;
// const std::vector<const GfxRendererModule*> renderers = {&moduleOpenGL};
// texture pool
std::shared_ptr<TexturePool> texture_pool;
// temporary opengl renderer
OpenGLRenderer ogl_renderer;
GraphicsData()
: dma_copier(EE_MAIN_MEM_SIZE),
texture_pool(std::make_shared<TexturePool>()),
ogl_renderer(texture_pool) {}
};
std::unique_ptr<GraphicsData> g_gfx_data;
bool g_is_initialized = false;
void GlfwErrorCallback(int err, const char* msg) {
lg::error("GLFW ERR {}: " + std::string(msg), err);
const GfxRendererModule* GetRenderer(GfxPipeline pipeline) {
switch (pipeline) {
case GfxPipeline::Invalid:
lg::error("Requested invalid graphics pipeline!");
return NULL;
break;
case GfxPipeline::OpenGL:
return &moduleOpenGL;
default:
lg::error("Unknown graphics pipeline {}", (u64)pipeline);
return NULL;
}
}
u32 Init() {
if (glfwSetErrorCallback(GlfwErrorCallback) != NULL) {
lg::warn("glfwSetErrorCallback has been re-set!");
}
lg::info("GFX Init");
// initialize settings
InitSettings(g_settings);
if (!glfwInit()) {
lg::error("glfwInit error");
if (g_settings.renderer->init()) {
lg::error("Gfx::Init error");
return 1;
}
if (g_main_thread_id != std::this_thread::get_id()) {
lg::warn("ran Gfx::Init outside main thread. Init display elsewhere?");
} else {
Display::InitDisplay(640, 480, "testy", Display::display);
Display::InitMainDisplay(640, 480, "testy", g_settings);
}
g_gfx_data = std::make_unique<GraphicsData>();
g_is_initialized = true;
return 0;
}
void Loop(std::function<bool()> f) {
lg::info("GFX Loop");
while (f()) {
// run display-specific things
if (Display::display) {
// pre-render setup
glfwMakeContextCurrent(Display::display);
// wait for a copied chain.
bool got_chain = false;
{
std::unique_lock<std::mutex> lock(g_gfx_data->dma_mutex);
// note: there's a timeout here. If the engine is messed up and not sending us frames,
// we still want to run the glfw loop.
got_chain = g_gfx_data->dma_cv.wait_for(lock, std::chrono::milliseconds(20),
[=] { return g_gfx_data->has_data_to_render; });
}
// render that chain.
if (got_chain) {
auto& chain = g_gfx_data->dma_copier.get_last_result();
int width, height;
glfwGetFramebufferSize(Display::display, &width, &height);
g_gfx_data->ogl_renderer.render(DmaFollower(chain.data.data(), chain.start_offset), width,
height);
}
// before vsync, mark the chain as rendered.
{
// should be fine to remove this mutex if the game actually waits for vsync to call
// send_chain again. but let's be safe for now.
std::unique_lock<std::mutex> lock(g_gfx_data->dma_mutex);
g_gfx_data->has_data_to_render = false;
}
// actual vsync
glfwSwapBuffers(Display::display);
// toggle even odd and wake up engine waiting on vsync.
{
std::unique_lock<std::mutex> lock(g_gfx_data->sync_mutex);
g_gfx_data->frame_idx++;
g_gfx_data->sync_cv.notify_all();
}
// poll events TODO integrate input with cpad
glfwPollEvents();
// exit if display window was closed
if (glfwWindowShouldClose(Display::display)) {
// Display::KillDisplay(Display::display);
MasterExit = 2;
}
// check if we have a display
if (Display::GetMainDisplay()) {
// lg::debug("run display");
Display::GetMainDisplay()->render_graphics();
}
}
}
u32 Exit() {
g_is_initialized = false;
g_gfx_data.reset();
lg::debug("gfx exit");
Display::KillDisplay(Display::display);
glfwTerminate();
glfwSetErrorCallback(NULL);
lg::info("GFX Exit");
Display::KillDisplay(Display::GetMainDisplay());
g_settings.renderer->exit();
return 0;
}
bool is_initialized() {
return g_is_initialized;
}
/*!
* Wait for the next vsync. Returns 0 or 1 depending on if frame is even or odd.
* Called from the game thread, on a GOAL stack.
*/
u32 vsync() {
if (!g_gfx_data) {
return 0;
}
std::unique_lock<std::mutex> lock(g_gfx_data->sync_mutex);
auto init_frame = g_gfx_data->frame_idx;
g_gfx_data->sync_cv.wait(lock, [=] { return g_gfx_data->frame_idx > init_frame; });
return g_gfx_data->frame_idx & 1;
}
/*!
* Send DMA to the renderer.
* Called from the game thread, on a GOAL stack.
*/
void send_chain(const void* data, u32 offset) {
if (g_gfx_data) {
std::unique_lock<std::mutex> lock(g_gfx_data->dma_mutex);
if (g_gfx_data->has_data_to_render) {
lg::error(
"Gfx::send_chain called when the graphics renderer has pending data. Was this called "
"multiple times per frame?");
return;
}
// we copy the dma data and give a copy of it to the render.
// the copy has a few advantages:
// - if the game code has a bug and corrupts the DMA buffer, the renderer won't see it.
// - the copied DMA is much smaller than the entire game memory, so it can be dumped to a file
// separate of the entire RAM.
// - it verifies the DMA data is valid early on.
// but it may also be pretty expensive. Both the renderer and the game wait on this to complete.
// The renderers should just operate on DMA chains, so eliminating this step in the future may
// be easy.
// Timer copy_timer;
g_gfx_data->dma_copier.run(data, offset);
// fmt::print("copy took {:.3f}ms\n", copy_timer.getMs());
g_gfx_data->has_data_to_render = true;
g_gfx_data->dma_cv.notify_all();
}
}
void texture_upload_now(const u8* tpage, int mode, u32 s7_ptr) {
if (g_gfx_data) {
// just pass it to the texture pool.
// the texture pool will take care of locking.
// we don't want to lock here for the entire duration of the conversion.
g_gfx_data->texture_pool->handle_upload_now(tpage, mode, g_ee_main_mem, s7_ptr);
}
}
void texture_relocate(u32 destination, u32 source) {
if (g_gfx_data) {
g_gfx_data->texture_pool->relocate(destination, source);
}
}
} // namespace Gfx
+51 -7
View File
@@ -2,19 +2,65 @@
/*!
* @file gfx.h
* Graphics component for the runtime. Handles some low-level routines.
* Graphics component for the runtime. Abstraction layer for the main graphics routines.
*/
#ifndef RUNTIME_GFX_H
#define RUNTIME_GFX_H
#include <functional>
#include <memory>
#include "common/common_types.h"
#include "display.h"
#include "game/kernel/kboot.h"
// forward declarations
struct GfxSettings;
class GfxDisplay;
// enum for rendering pipeline
enum class GfxPipeline { Invalid = 0, OpenGL };
// module for the different rendering pipelines
struct GfxRendererModule {
std::function<int()> init;
std::function<std::shared_ptr<GfxDisplay>(int w, int h, const char* title, GfxSettings& settings)>
make_main_display;
std::function<void(GfxDisplay* display)> kill_display;
std::function<void(GfxDisplay* display)> render_display;
std::function<void()> exit;
GfxPipeline pipeline;
const char* name;
};
// store settings related to the gfx systems
struct GfxSettings {
const GfxRendererModule* renderer; // which rendering pipeline to use.
int vsync; // (temp) number of screen update per frame
};
// struct for a single vertex. this should in theory be renderer-agnostic
struct GfxVertex {
// x y z
float x, y, z;
// rgba or the full u32 thing.
union {
u32 rgba;
struct {
u8 r, g, b, a;
};
};
};
namespace Gfx {
static constexpr int VERTEX_BUFFER_LENGTH_TEMP = 4096;
extern GfxVertex g_vertices_temp[VERTEX_BUFFER_LENGTH_TEMP];
extern GfxSettings g_settings;
// extern const std::vector<const GfxRendererModule*> renderers;
const GfxRendererModule* GetRenderer(GfxPipeline pipeline);
u32 Init();
void Loop(std::function<bool()> f);
u32 Exit();
@@ -25,5 +71,3 @@ void texture_upload_now(const u8* tpage, int mode, u32 s7_ptr);
void texture_relocate(u32 destination, u32 source);
} // namespace Gfx
#endif // RUNTIME_GFX_H
-15
View File
@@ -1,15 +0,0 @@
#pragma once
/*!
* @file opengl.h
* OpenGL includes.
*/
#ifndef RUNTIME_OPENGL_H
#define RUNTIME_OPENGL_H
#define GLFW_INCLUDE_NONE
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#endif // RUNTIME_OPENGL_H
+127
View File
@@ -0,0 +1,127 @@
/*!
* @file opengl.cpp
* Lower-level OpenGL implementation.
*/
#include "opengl.h"
#include "game/graphics/gfx.h"
#include "game/graphics/display.h"
#include "common/log/log.h"
#include <memory>
namespace {
void SetDisplayCallbacks(GLFWwindow* d) {
glfwSetKeyCallback(d, [](GLFWwindow* window, int key, int scancode, int action, int mods) {
if (action == GlfwKeyAction::Press) {
lg::debug("KEY PRESS: key: {} scancode: {} mods: {:X}", key, scancode, mods);
} else if (action == GlfwKeyAction::Release) {
lg::debug("KEY RELEASE: key: {} scancode: {} mods: {:X}", key, scancode, mods);
}
});
}
void ErrorCallback(int err, const char* msg) {
lg::error("GLFW ERR {}: " + std::string(msg), err);
}
bool HasError() {
return glfwGetError(NULL) != GLFW_NO_ERROR;
}
} // namespace
static bool gl_inited = false;
static int gl_init() {
if (glfwSetErrorCallback(ErrorCallback) != NULL) {
lg::warn("glfwSetErrorCallback has been re-set!");
}
if (glfwInit() == GLFW_FALSE) {
lg::error("glfwInit error");
return 1;
}
// request OpenGL 3.0 (placeholder)
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
return 0;
}
static void gl_exit() {
glfwTerminate();
glfwSetErrorCallback(NULL);
}
static std::shared_ptr<GfxDisplay> gl_make_main_display(int width,
int height,
const char* title,
GfxSettings& settings) {
GLFWwindow* window = glfwCreateWindow(width, height, title, NULL, NULL);
if (!window) {
lg::error("gl_make_main_display failed - Could not create display window");
return NULL;
}
glfwMakeContextCurrent(window);
if (!gl_inited && !gladLoadGL()) {
lg::error("GL init fail");
return NULL;
}
gl_inited = true;
// enable vsync by default
// glfwSwapInterval(1);
glfwSwapInterval(settings.vsync);
SetDisplayCallbacks(window);
if (HasError()) {
lg::error("gl_make_main_display error");
return NULL;
}
std::shared_ptr<GfxDisplay> display = std::make_shared<GfxDisplay>(window);
// lg::debug("init display #x{:x}", (uintptr_t)display);
return display;
}
static void gl_kill_display(GfxDisplay* display) {
glfwDestroyWindow(display->window_glfw);
}
static void gl_render_display(GfxDisplay* display) {
GLFWwindow* window = display->window_glfw;
glfwMakeContextCurrent(window);
// render graphics
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(window);
// poll events TODO integrate input with cpad
glfwPollEvents();
// exit if display window was closed
if (glfwWindowShouldClose(window)) {
// Display::KillDisplay(window);
MasterExit = 2;
}
}
const GfxRendererModule moduleOpenGL = {
gl_init, // init
gl_make_main_display, // make_main_display
gl_kill_display, // kill_display
gl_render_display, // render_display
gl_exit, // exit
GfxPipeline::OpenGL, // pipeline
"OpenGL 3.0" // name
};
+20
View File
@@ -0,0 +1,20 @@
#pragma once
/*!
* @file opengl.h
* OpenGL includes.
*/
#define GLFW_INCLUDE_NONE
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include "game/graphics/gfx.h"
enum GlfwKeyAction {
Release = GLFW_RELEASE, // falling edge of key press
Press = GLFW_PRESS, // rising edge of key press
Repeat = GLFW_REPEAT // repeated input on hold e.g. when typing something
};
extern const GfxRendererModule moduleOpenGL;
-2
View File
@@ -48,9 +48,7 @@
#include "game/overlord/stream.h"
#include "game/overlord/sbank.h"
#include "game/graphics/opengl.h"
#include "game/graphics/gfx.h"
#include "game/graphics/display.h"
#include "game/system/vm/vm.h"
#include "game/system/vm/dmac.h"
-5
View File
@@ -6,9 +6,6 @@
* Not meant to work as a full DMAC emulator, just enough to inspect DMA packets.
*/
#ifndef VM_DMAC_H
#define VM_DMAC_H
#include "common/common_types.h"
#include "game/kernel/Ptr.h"
@@ -73,5 +70,3 @@ static_assert(alignof(DmaChannelRegisters) == 0x10, "DmaChannelRegisters unalign
void dmac_init_globals();
} // namespace VM
#endif // VM_DMAC_H
-5
View File
@@ -7,9 +7,6 @@
* Not an emulator!
*/
#ifndef VM_H
#define VM_H
#include "common/common_types.h"
namespace VM {
@@ -33,5 +30,3 @@ void unsubscribe_component();
u64 get_vm_ptr(u32 ptr);
} // namespace VM
#endif // VM_H
+3 -3
View File
@@ -110,15 +110,15 @@
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-12 (_type_ vector float uint process bone uint) float 12) ;; TODO - bone not confirmed
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-16 (_type_ vector float uint process uint) none 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-20 () none 20)
(dummy-20 (_type_ vector float uint bone uint) none 20) ;; TODO - bone not confirmed
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
+1 -37
View File
@@ -343,43 +343,7 @@
(defun disasm-dma-tag ((arg0 dma-tag) (arg1 symbol))
(format arg1 "(dma-tag ")
;; this is a case statement.
(let ((t9-1 format)
(a0-2 arg1)
(a1-2 "~s")
(v1-1 (-> arg0 id))
)
(t9-1 a0-2 a1-2 (cond
((= v1-1 (dma-tag-id end))
"end"
)
((= v1-1 (dma-tag-id ret))
"ret"
)
((= v1-1 (dma-tag-id call))
"call"
)
((= v1-1 (dma-tag-id refs))
"refs"
)
((= v1-1 (dma-tag-id ref))
"ref"
)
((= v1-1 (dma-tag-id next))
"next"
)
((= v1-1 (dma-tag-id cnt))
"cnt"
)
((zero? v1-1)
"refe"
)
(else
"*unknown*"
)
)
)
)
(format arg1 "~s" (enum->string dma-tag-id (-> arg0 id)))
(if (> (the-as uint (-> arg0 addr)) 0)
(format arg1 " :addr #x~8x" (-> arg0 addr))
)
+1 -13
View File
@@ -62,19 +62,7 @@
)
(defun pickup-type->string ((arg0 pickup-type))
(case arg0
(((pickup-type eco-pill-random)) "eco-pill-random")
(((pickup-type buzzer)) "buzzer")
(((pickup-type eco-pill)) "eco-pill")
(((pickup-type fuel-cell)) "fuel-cell")
(((pickup-type money)) "money")
(((pickup-type eco-green)) "eco-green")
(((pickup-type eco-blue)) "eco-blue")
(((pickup-type eco-red)) "eco-red")
(((pickup-type eco-yellow)) "eco-yellow")
(((pickup-type none)) "none")
(else "*unknown*")
)
(enum->string pickup-type arg0)
)
;; Each individual enemy and pickup process will allocate a fact-info on its process heap
+7 -7
View File
@@ -126,11 +126,11 @@
(leaving-misty 114)
(assistant-village3 115)
(max 116)
(*unknown* 255))
)
;; Game parameters.
(deftype game-bank (basic)
((life-max-default float :offset-assert 4)
((life-max-default float :offset-assert 4) ;; yes this life system works, but does nothing
(life-start-default float :offset-assert 8)
(life-single-inc float :offset-assert 12)
(money-task-inc float :offset-assert 16)
@@ -142,11 +142,11 @@
)
(define *GAME-bank* (new 'static 'game-bank
:life-max-default 99.000000
:life-start-default 5.000000
:life-single-inc 1.000000
:money-task-inc 90.000000
:money-oracle-inc 120.000000
:life-max-default 99.0
:life-start-default 5.0
:life-single-inc 1.0
:money-task-inc 90.0
:money-oracle-inc 120.0
)
)
+1 -120
View File
@@ -708,126 +708,7 @@
)
(defun-debug game-task->string ((arg0 game-task))
(case arg0
(((game-task max)) "max")
(((game-task assistant-village3)) "assistant-village3")
(((game-task leaving-misty)) "leaving-misty")
(((game-task plunger-lurker-hit)) "plunger-lurker-hit")
(((game-task finalboss-movies)) "finalboss-movies")
(((game-task village4-button)) "village4-button")
(((game-task ogre-secret)) "ogre-secret")
(((game-task intro)) "intro")
(((game-task lavatube-start)) "lavatube-start")
(((game-task lavatube-balls)) "lavatube-balls")
(((game-task red-eggtop)) "red-eggtop")
(((game-task village3-button)) "village3-button")
(((game-task swamp-arm)) "swamp-arm")
(((game-task village2-levitator)) "village2-levitator")
(((game-task firecanyon-assistant)) "firecanyon-assistant")
(((game-task village3-oracle-money2)) "village3-oracle-money2")
(((game-task village3-oracle-money1)) "village3-oracle-money1")
(((game-task village3-miner-money4)) "village3-miner-money4")
(((game-task village3-miner-money3)) "village3-miner-money3")
(((game-task village3-miner-money2)) "village3-miner-money2")
(((game-task village3-miner-money1)) "village3-miner-money1")
(((game-task training-buzzer)) "training-buzzer")
(((game-task training-climb)) "training-climb")
(((game-task training-door)) "training-door")
(((game-task training-gimmie)) "training-gimmie")
(((game-task citadel-buzzer)) "citadel-buzzer")
(((game-task lavatube-buzzer)) "lavatube-buzzer")
(((game-task lavatube-end)) "lavatube-end")
(((game-task ogre-buzzer)) "ogre-buzzer")
(((game-task ogre-end)) "ogre-end")
(((game-task ogre-boss)) "ogre-boss")
(((game-task cave-buzzer)) "cave-buzzer")
(((game-task cave-platforms)) "cave-platforms")
(((game-task cave-spider-tunnel)) "cave-spider-tunnel")
(((game-task cave-swing-poles)) "cave-swing-poles")
(((game-task cave-robot-climb)) "cave-robot-climb")
(((game-task cave-dark-climb)) "cave-dark-climb")
(((game-task cave-dark-crystals)) "cave-dark-crystals")
(((game-task cave-gnawers)) "cave-gnawers")
(((game-task village3-buzzer)) "village3-buzzer")
(((game-task village2-buzzer)) "village2-buzzer")
(((game-task village1-buzzer)) "village1-buzzer")
(((game-task village3-extra1)) "village3-extra1")
(((game-task citadel-sage-yellow)) "citadel-sage-yellow")
(((game-task citadel-sage-red)) "citadel-sage-red")
(((game-task citadel-sage-blue)) "citadel-sage-blue")
(((game-task citadel-sage-green)) "citadel-sage-green")
(((game-task firecanyon-end)) "firecanyon-end")
(((game-task firecanyon-buzzer)) "firecanyon-buzzer")
(((game-task snow-cage)) "snow-cage")
(((game-task snow-bumpers)) "snow-bumpers")
(((game-task snow-buzzer)) "snow-buzzer")
(((game-task snow-bunnies)) "snow-bunnies")
(((game-task snow-ball)) "snow-ball")
(((game-task snow-fort)) "snow-fort")
(((game-task snow-ram)) "snow-ram")
(((game-task snow-eggtop)) "snow-eggtop")
(((game-task rolling-ring-chase-2)) "rolling-ring-chase-2")
(((game-task rolling-ring-chase-1)) "rolling-ring-chase-1")
(((game-task rolling-buzzer)) "rolling-buzzer")
(((game-task rolling-lake)) "rolling-lake")
(((game-task rolling-plants)) "rolling-plants")
(((game-task rolling-moles)) "rolling-moles")
(((game-task rolling-robbers)) "rolling-robbers")
(((game-task rolling-race)) "rolling-race")
(((game-task sunken-spinning-room)) "sunken-spinning-room")
(((game-task sunken-top-of-helix)) "sunken-top-of-helix")
(((game-task sunken-buzzer)) "sunken-buzzer")
(((game-task sunken-sharks)) "sunken-sharks")
(((game-task sunken-room)) "sunken-room")
(((game-task sunken-slide)) "sunken-slide")
(((game-task sunken-pipe)) "sunken-pipe")
(((game-task sunken-platforms)) "sunken-platforms")
(((game-task swamp-buzzer)) "swamp-buzzer")
(((game-task swamp-tether-4)) "swamp-tether-4")
(((game-task swamp-tether-3)) "swamp-tether-3")
(((game-task swamp-tether-2)) "swamp-tether-2")
(((game-task swamp-tether-1)) "swamp-tether-1")
(((game-task swamp-battle)) "swamp-battle")
(((game-task swamp-flutflut)) "swamp-flutflut")
(((game-task swamp-billy)) "swamp-billy")
(((game-task village2-oracle-money2)) "village2-oracle-money2")
(((game-task village2-oracle-money1)) "village2-oracle-money1")
(((game-task village2-warrior-money)) "village2-warrior-money")
(((game-task village2-geologist-money)) "village2-geologist-money")
(((game-task village2-gambler-money)) "village2-gambler-money")
(((game-task misty-eco-challenge)) "misty-eco-challenge")
(((game-task misty-bike-jump)) "misty-bike-jump")
(((game-task misty-buzzer)) "misty-buzzer")
(((game-task misty-bike)) "misty-bike")
(((game-task misty-cannon)) "misty-cannon")
(((game-task misty-warehouse)) "misty-warehouse")
(((game-task misty-boat)) "misty-boat")
(((game-task misty-muse)) "misty-muse")
(((game-task beach-sentinel)) "beach-sentinel")
(((game-task beach-gimmie)) "beach-gimmie")
(((game-task beach-buzzer)) "beach-buzzer")
(((game-task beach-cannon)) "beach-cannon")
(((game-task beach-seagull)) "beach-seagull")
(((game-task beach-flutflut)) "beach-flutflut")
(((game-task beach-pelican)) "beach-pelican")
(((game-task beach-ecorocks)) "beach-ecorocks")
(((game-task village1-oracle-money2)) "village1-oracle-money2")
(((game-task village1-oracle-money1)) "village1-oracle-money1")
(((game-task village1-uncle-money)) "village1-uncle-money")
(((game-task village1-mayor-money)) "village1-mayor-money")
(((game-task village1-yakow)) "village1-yakow")
(((game-task jungle-temple-door)) "jungle-temple-door")
(((game-task jungle-canyon-end)) "jungle-canyon-end")
(((game-task jungle-buzzer)) "jungle-buzzer")
(((game-task jungle-plant)) "jungle-plant")
(((game-task jungle-fishgame)) "jungle-fishgame")
(((game-task jungle-tower)) "jungle-tower")
(((game-task jungle-lurkerm)) "jungle-lurkerm")
(((game-task jungle-eggtop)) "jungle-eggtop")
(((game-task complete)) "complete")
(((game-task none)) "none")
(else "*unknown*")
)
(enum->string game-task arg0)
)
(defmethod debug-print game-info ((obj game-info) (arg0 symbol))
+1 -49
View File
@@ -131,55 +131,7 @@
)
(defun-debug game-save-elt->string ((arg0 game-save-elt))
"Convert a game-save-elt to a string"
(let ((v1-0 arg0))
(cond
((= v1-0 (game-save-elt aspect-ratio)) "aspect-ratio")
((= v1-0 (game-save-elt video-mode)) "video-mode")
((= v1-0 (game-save-elt play-hints)) "play-hints")
((= v1-0 (game-save-elt vibration)) "vibration")
((= v1-0 (game-save-elt screeny)) "screeny")
((= v1-0 (game-save-elt screenx)) "screenx")
((= v1-0 (game-save-elt language)) "language")
((= v1-0 (game-save-elt dialog-volume)) "dialog-volume")
((= v1-0 (game-save-elt music-volume)) "music-volume")
((= v1-0 (game-save-elt sfx-volume)) "sfx-volume")
((= v1-0 (game-save-elt in-level-time)) "in-level-time")
((= v1-0 (game-save-elt auto-save-count)) "auto-save-count")
((= v1-0 (game-save-elt death-pos)) "death-pos")
((= v1-0 (game-save-elt deaths-per-level)) "deaths-per-level")
((= v1-0 (game-save-elt enter-level-time)) "enter-level-time")
((= v1-0 (game-save-elt fuel-cell-time)) "fuel-cell-time")
((= v1-0 (game-save-elt continue-time)) "continue-time")
((= v1-0 (game-save-elt fuel-cell-pickup-time)) "fuel-cell-pickup-time")
((= v1-0 (game-save-elt hit-time)) "hit-time")
((= v1-0 (game-save-elt death-time)) "death-time")
((= v1-0 (game-save-elt continue-timke)) "continue-timke")
((= v1-0 (game-save-elt game-start-time)) "game-start-time")
((= v1-0 (game-save-elt fuel-cell-deaths)) "fuel-cell-deaths")
((= v1-0 (game-save-elt continue-deaths)) "continue-deaths")
((= v1-0 (game-save-elt total-deaths)) "total-deaths")
((= v1-0 (game-save-elt level-open-list)) "level-open-list")
((= v1-0 (game-save-elt text-list)) "text-list")
((= v1-0 (game-save-elt hint-list)) "hint-list")
((= v1-0 (game-save-elt perm-list)) "perm-list")
((= v1-0 (game-save-elt task-list)) "task-list")
((= v1-0 (game-save-elt death-movie-tick)) "death-movie-tick")
((= v1-0 (game-save-elt fuel-cell)) "fuel-cell")
((= v1-0 (game-save-elt buzzer-total)) "buzzer-total")
((= v1-0 (game-save-elt moeny-per-level)) "money-per-level")
((= v1-0 (game-save-elt money-total)) "money-total")
((= v1-0 (game-save-elt money)) "money")
((= v1-0 (game-save-elt life)) "life")
((= v1-0 (game-save-elt continue)) "continue")
((= v1-0 (game-save-elt integral-time)) "integral-time")
((= v1-0 (game-save-elt game-time)) "game-time")
((= v1-0 (game-save-elt real-time)) "real-time")
((= v1-0 (game-save-elt base-time)) "base-time")
((= v1-0 (game-save-elt name)) "name")
(else "*unknown*")
)
)
(enum->string game-save-elt arg0)
)
(defun progress-level-index->string ((arg0 int))
+23 -23
View File
@@ -6,28 +6,28 @@
;; dgos: GAME, ENGINE
(deftype projectile (process-drawable)
((base-trans vector :inline :offset-assert 176)
(target vector :inline :offset-assert 192)
(target-base vector :inline :offset-assert 208)
(parent-base vector :inline :offset-assert 224)
(parent-quat vector :inline :offset-assert 240)
(base-vector vector :inline :offset-assert 256)
(timeout uint64 :offset-assert 272)
(options uint64 :offset-assert 280)
(last-target uint64 :offset-assert 288)
(notify-handle uint64 :offset-assert 296)
(max-speed float :offset-assert 304)
(max-turn float :offset-assert 308)
(old-dist float 16 :offset-assert 312)
(old-dist-count int32 :offset-assert 376)
(hits int32 :offset-assert 380)
(max-hits int32 :offset-assert 384)
(tween float :offset-assert 388)
(attack-mode basic :offset-assert 392)
(update-velocity basic :offset-assert 396)
(counter int32 :offset-assert 400)
(target-count int32 :offset-assert 404)
(sound-id sound-id :offset-assert 408)
((base-trans vector :inline :offset-assert 176)
(target vector :inline :offset-assert 192)
(target-base vector :inline :offset-assert 208)
(parent-base vector :inline :offset-assert 224)
(parent-quat vector :inline :offset-assert 240)
(base-vector vector :inline :offset-assert 256)
(timeout uint64 :offset-assert 272)
(options uint64 :offset-assert 280)
(last-target uint64 :offset-assert 288)
(notify-handle uint64 :offset-assert 296)
(max-speed float :offset-assert 304)
(max-turn float :offset-assert 308)
(old-dist float 16 :offset-assert 312)
(old-dist-count int32 :offset-assert 376)
(hits int32 :offset-assert 380)
(max-hits int32 :offset-assert 384)
(tween float :offset-assert 388)
(attack-mode basic :offset-assert 392)
(update-velocity basic :offset-assert 396)
(counter int32 :offset-assert 400)
(target-count int32 :offset-assert 404)
(sound-id sound-id :offset-assert 408)
)
:heap-base #x130
:method-count-assert 29
@@ -38,7 +38,7 @@
(projectile-dissipate () none 21) ;; state
(projectile-impact () none 22) ;; state
(dummy-23 () none 23)
(dummy-24 () none 24)
(dummy-24 (_type_) none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
+1 -11
View File
@@ -6,17 +6,7 @@
;; dgos: GAME, ENGINE
(defun-debug task-status->string ((arg0 task-status))
(case arg0
(((task-status need-resolution)) "need-resolution")
(((task-status need-reward-speech)) "need-reward-speech")
(((task-status need-reminder)) "need-reminder")
(((task-status need-reminder-a)) "need-reminder-a")
(((task-status need-introduction)) "need-introduction")
(((task-status need-hint)) "need-hint")
(((task-status unknown)) "unknown")
(((task-status invalid)) "invalid")
(else "*unknown*")
)
(enum->string task-status arg0)
)
(defmethod get-game-task task-cstage ((obj task-cstage))
+1 -16
View File
@@ -98,22 +98,7 @@
(defun psm->string ((arg0 gs-psm))
"Get the name of a texture format."
(case arg0
(((gs-psm mz16s)) "mz16s")
(((gs-psm mz16)) "mz16")
(((gs-psm mz24)) "mz24")
(((gs-psm mz32)) "mz32")
(((gs-psm mt4hh)) "mt4hh")
(((gs-psm mt4hl)) "mt4hl")
(((gs-psm mt8h)) "mt8h")
(((gs-psm mt4)) "mt4")
(((gs-psm mt8)) "mt8")
(((gs-psm ct16s)) "ct16s")
(((gs-psm ct16)) "ct16")
(((gs-psm ct24)) "ct24")
(((gs-psm ct32)) "ct32")
(else "*unknown*")
)
(enum->string gs-psm arg0)
)
+336
View File
@@ -5,3 +5,339 @@
;; name in dgo: shadow
;; dgos: GAME, ENGINE
;; definition for function add-fake-shadow-to-buffer
;; INFO: Return type mismatch int vs none.
(defun
add-fake-shadow-to-buffer
((arg0 vector) (arg1 vector) (arg2 float) (arg3 int))
(let ((v1-0 *fake-shadow-buffer*))
(when (< (-> v1-0 num-shadows) 32)
(let ((t0-5 (-> v1-0 data (-> v1-0 num-shadows))))
(set! (-> t0-5 px) (-> arg0 x))
(set! (-> t0-5 py) (-> arg0 y))
(set! (-> t0-5 pz) (-> arg0 z))
(set! (-> t0-5 scale) arg2)
(set! (-> t0-5 qx) (-> arg1 x))
(set! (-> t0-5 qy) (-> arg1 y))
(set! (-> t0-5 qz) (-> arg1 z))
(set! (-> t0-5 flags) arg3)
)
(+! (-> v1-0 num-shadows) 1)
)
)
0
(none)
)
;; definition for function swap-fake-shadow-buffers
;; INFO: Return type mismatch int vs none.
(defun swap-fake-shadow-buffers ()
(set! *fake-shadow-buffer* (if (= *fake-shadow-buffer* *fake-shadow-buffer-1*)
*fake-shadow-buffer-2*
*fake-shadow-buffer-1*
)
)
(set! (-> *fake-shadow-buffer* num-shadows) 0)
0
(none)
)
;; definition for function draw-shadow
;; INFO: Return type mismatch int vs none.
(defun
draw-shadow
((arg0 vector)
(arg1 vector)
(arg2 vector)
(arg3 float)
(arg4 float)
(arg5 float)
)
(let ((f0-1 (- (-> arg0 y) (-> arg1 y))))
(if (< f0-1 arg4)
(add-fake-shadow-to-buffer
arg1
arg2
(* (- 1.0 (/ f0-1 arg4)) arg3)
(the-as int arg5)
)
)
)
0
(none)
)
;; definition for function compute-and-draw-shadow
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defun
compute-and-draw-shadow
((arg0 vector)
(arg1 vector)
(arg2 vector)
(arg3 vector)
(arg4 float)
(arg5 float)
)
(local-vars
(v1-10 float)
(v1-11 float)
(sv-96 vector)
(sv-112 (function quaternion vector float quaternion))
(sv-128 vector)
(sv-144 vector)
)
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(set! sv-96 arg2)
(let ((s4-0 arg3)
(s3-0 arg4)
(s2-0 arg5)
)
(when (< (- (-> arg0 y) (-> arg1 y)) s3-0)
(set! sv-144 (new 'stack-no-clear 'vector))
(let ((s0-0 (new 'stack-no-clear 'vector))
(s1-0 (new 'stack-no-clear 'sparticle-cpuinfo))
)
(set! (-> arg1 y) (+ 40.96 (-> arg1 y)))
(set! (-> sv-144 x) (-> sv-96 z))
(set! (-> sv-144 y) 0.0)
(set! (-> sv-144 z) (- (-> sv-96 x)))
(vector-normalize! sv-144 1.0)
(set! sv-112 quaternion-vector-angle!)
(set! sv-128 s0-0)
(let ((a2-1 (acos (-> sv-96 y))))
(sv-112 (the-as quaternion sv-128) sv-144 a2-1)
)
(let ((v1-9 s1-0))
(cond
((< (-> s0-0 w) 0.0)
(.lvf vf1 (&-> v1-9 vel-sxvel quad))
(.lvf vf2 (&-> s0-0 quad))
(.sub.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> v1-9 vel-sxvel quad) vf1)
(.mov v1-10 vf1)
)
(else
(.lvf vf1 (&-> v1-9 vel-sxvel quad))
(.lvf vf2 (&-> s0-0 quad))
(.add.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> v1-9 vel-sxvel quad) vf1)
(.mov v1-11 vf1)
)
)
)
(draw-shadow arg0 arg1 (-> s1-0 vel-sxvel) (the-as float s4-0) s3-0 s2-0)
)
)
)
0
(none)
)
)
;; definition for function find-ground-and-draw-shadow
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defun
find-ground-and-draw-shadow
((arg0 vector)
(arg1 vector)
(arg2 float)
(arg3 uint)
(arg4 process)
(arg5 float)
(arg6 float)
)
(let ((s2-0 (new 'stack-no-clear 'vector)))
(set! (-> s2-0 quad) (-> arg0 quad))
(new 'stack-no-clear 'vector)
(+! (-> s2-0 y) arg5)
(let ((s4-0 (new 'stack-no-clear 'bone)))
(cond
((>=
(dummy-12 *collide-cache* s2-0 arg6 arg3 arg4 s4-0 (the-as uint 1))
0.0
)
(if (!= arg2 0.0)
(compute-and-draw-shadow
s2-0
(-> s4-0 position)
(-> s4-0 scale)
(the-as vector arg2)
arg6
(the-as float 0)
)
)
(if (and arg1 (!= (shr (shl (-> s4-0 cache bone-matrix) 52) 58) 3))
(set! (-> arg1 quad) (-> s4-0 position quad))
)
)
(else
(if arg1
(vector+float*!
arg1
arg0
(-> *standard-dynamics* gravity-normal)
(- arg6)
)
)
)
)
)
)
0
(none)
)
;; definition for function do-target-shadow
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defbehavior do-target-shadow target ()
(if
(and
(logtest? (-> self control status) 1)
(!= (-> self control unknown-surface mode) 'swim)
(!= (-> self control unknown-surface mode) 'dive)
(!= (-> self next-state name) 'target-flop)
(zero? (logand (-> self draw status) 38))
)
(set! (-> self control shadow-pos quad) (-> self control trans quad))
(find-ground-and-draw-shadow
(-> self control trans)
(-> self control shadow-pos)
0.0
(-> (the-as collide-shape-prim (-> self control root-prim)) collide-with)
self
0.0
81920.0
)
)
0
(none)
)
;; failed to figure out what this is:
(set!
(-> *part-id-table* 362)
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 20
(new 'static 'sp-field-init-spec :field #x1 :initial-value #x200000)
(new 'static 'sp-field-init-spec
:field #x6
:flags #x1
:initial-value #x41000000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #xd
:flags #x1
:initial-value #x4499999a
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x10
:flags #x1
:initial-value -956301312
:random-range #x47800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x11
:flags #x3
:initial-value -4
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x12
:flags #x1
:initial-value #x42b40000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x13
:flags #x1
:initial-value #x42b40000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x14
:flags #x1
:initial-value #x42b40000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x15
:flags #x1
:initial-value #x41a00000
:random-range #x41a00000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x1a
:flags #x1
:initial-value #x4103126f
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x1c
:flags #x1
:initial-value #x41888889
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x20
:flags #x3
:initial-value -4
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x24
:flags #x1
:initial-value -1097229926
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x2e
:initial-value #x138c
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x2f
:initial-value 12
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x36
:flags #x1
:initial-value -983331271
:random-range #x452aaaab
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x3a
:flags #x1
:initial-value #x46800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x3b
:flags #x1
:initial-value -956301312
:random-range #x47800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x3e
:flags #x1
:initial-value #x444ccccd
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec :field #x43)
)
)
)
+1 -20
View File
@@ -224,26 +224,7 @@
(camera 16))
(defun-debug perf-stat-bucket->string ((arg0 perf-stat-bucket))
(case arg0
(((perf-stat-bucket camera)) "camera")
(((perf-stat-bucket collide)) "collide")
(((perf-stat-bucket nav)) "nav")
(((perf-stat-bucket bones)) "bones")
(((perf-stat-bucket proto-tie-n)) "proto-tie-n")
(((perf-stat-bucket proto-tie)) "proto-tie")
(((perf-stat-bucket proto-tie-g)) "proto-tie-g")
(((perf-stat-bucket inst-tie)) "inst-tie")
(((perf-stat-bucket proto-shrub)) "proto-shrub")
(((perf-stat-bucket inst-shrub)) "inst-shrub")
(((perf-stat-bucket tfrag-near)) "tfrag-near")
(((perf-stat-bucket tfrag)) "tfrag")
(((perf-stat-bucket drawable)) "drawable")
(((perf-stat-bucket background)) "background")
(((perf-stat-bucket tie-generic)) "tie-generic")
(((perf-stat-bucket mercneric)) "mercneric")
(((perf-stat-bucket all-code)) "all-code")
(else "*unknown*")
)
(enum->string perf-stat-bucket arg0)
)
+1 -26
View File
@@ -182,32 +182,7 @@
)
(defun-debug sound-command->string ((cmd sound-command))
(case cmd
(((sound-command unload-music)) "unload-music")
(((sound-command list-sounds)) "list-sounds")
(((sound-command shutdown)) "shutdown")
(((sound-command set-ear-trans)) "set-ear-trans")
(((sound-command set-reverb)) "set-reverb")
(((sound-command set-flava)) "set-flava")
(((sound-command set-language)) "set-language")
(((sound-command reload-info)) "reload-info")
(((sound-command set-sound-falloff)) "set-sound-falloff")
(((sound-command set-falloff-curve)) "set-falloff-curve")
(((sound-command get-irx-version)) "get-irx-version")
(((sound-command continue-group)) "continue-group")
(((sound-command stop-group)) "stop-group")
(((sound-command pause-group)) "pause-group")
(((sound-command set-master-volume)) "set-master-volume")
(((sound-command set-param)) "set-param")
(((sound-command continue-sound)) "continue-sound")
(((sound-command stop-sound)) "stop-sound")
(((sound-command pause-sound)) "pause-sound")
(((sound-command play)) "play")
(((sound-command unload-bank)) "unload-bank")
(((sound-command load-music)) "load-music")
(((sound-command load-bank)) "load-bank")
(else "*unknown*")
)
(enum->string sound-command cmd)
)
(defun sound-buffer-dump ()
+4
View File
@@ -84,3 +84,7 @@
)
(define-extern part-group-pointer? (function pointer symbol))
;; TODO - for shadow
(define-extern *part-id-table* (array sparticle-launcher))
(define-extern *part-group-id-table* (array sparticle-launch-group))
@@ -6,19 +6,19 @@
;; dgos: GAME, ENGINE
(deftype sp-field-init-spec (structure)
((field uint16 :offset-assert 0)
(flags uint16 :offset-assert 2)
(initial-valuef float :offset-assert 4)
(random-rangef float :offset-assert 8)
(random-multf float :offset-assert 12)
(initial-value int32 :offset 4)
(random-range int32 :offset 8)
(random-mult int32 :offset 12)
(func basic :offset 4)
(tex uint32 :offset 4)
(pntr uint32 :offset 4)
(sym basic :offset 4)
(sound basic :offset 4)
((field uint16 :offset-assert 0)
(flags uint16 :offset-assert 2)
(initial-value int32 :offset-assert 4)
(random-range int32 :offset-assert 8)
(random-mult int32 :offset-assert 12)
(initial-valuef float :offset 4) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
(random-rangef float :offset 8) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
(random-multf float :offset 12) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
(func basic :offset 4)
(tex uint32 :offset 4)
(pntr uint32 :offset 4)
(sym basic :offset 4)
(sound basic :offset 4)
)
:method-count-assert 9
:size-assert #x10
@@ -28,7 +28,7 @@
(deftype sparticle-launcher (basic)
((birthaccum float :offset-assert 4)
(soundaccum float :offset-assert 8)
(init-specs uint32 :offset-assert 12)
(init-specs (inline-array sp-field-init-spec) :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10
@@ -5,3 +5,6 @@
;; name in dgo: sparticle-launcher
;; dgos: GAME, ENGINE
;; TODO - for shadow
(define *part-id-table* (new 'global 'boxed-array sparticle-launcher 3584))
(define *part-group-id-table* (new 'global 'boxed-array sparticle-launch-group 1024))
+3 -42
View File
@@ -70,54 +70,15 @@
)
(defun-debug pat-material->string ((pat pat-surface))
(case (-> pat material)
(((pat-material neutral)) "neutral")
(((pat-material rotate)) "rotate")
(((pat-material stopproj)) "stopproj")
(((pat-material swamp)) "swamp")
(((pat-material tube)) "tube")
(((pat-material straw)) "straw")
(((pat-material metal)) "metal")
(((pat-material dirt)) "dirt")
(((pat-material gravel)) "gravel")
(((pat-material crwood)) "crwood")
(((pat-material lava)) "lava")
(((pat-material hotcoals)) "hotcoals")
(((pat-material deepsnow)) "deepsnow")
(((pat-material snow)) "snow")
(((pat-material pcmetal)) "pcmetal")
(((pat-material grass)) "grass")
(((pat-material wood)) "wood")
(((pat-material sand)) "sand")
(((pat-material tar)) "tar")
(((pat-material waterbottom)) "waterbottom")
(((pat-material quicksand)) "quicksand")
(((pat-material ice)) "ice")
(((pat-material stone)) "stone")
(else "*unknown*")
)
(enum->string pat-material (-> pat material))
)
(defun-debug pat-mode->string ((pat pat-surface))
(case (-> pat mode)
(((pat-mode obstacle)) "obstacle")
(((pat-mode wall)) "wall")
(((pat-mode ground)) "ground")
(else "*unknown*")
)
(enum->string pat-mode (-> pat mode))
)
(defun-debug pat-event->string ((pat pat-surface))
(case (-> pat event)
(((pat-event melt)) "melt")
(((pat-event burnup)) "burnup")
(((pat-event deadlyup)) "deadlyup")
(((pat-event burn)) "burn")
(((pat-event endlessfall)) "endlessfall")
(((pat-event deadly)) "deadly")
(((pat-event none)) "none")
(else "*unknown*")
)
(enum->string pat-event (-> pat event))
)
(deftype pat-mode-info (structure)
+32 -2
View File
@@ -524,7 +524,7 @@
(defmacro logtesta? (a b)
"does a have ALL of the bits in b?"
`(= (logand ,a ,b) ,b)
`(= (logand ,b ,a) ,b)
)
(defmacro deref (t addr &rest fields)
@@ -712,7 +712,37 @@
(dbg)
)
)
;;;;;;;;;;;;;;;;;;;
;; enum stuff
;;;;;;;;;;;;;;;;;;;
(defmacro enum->string (enum input)
"return the name of an enum value"
`(case ,input
,@(apply (lambda (x) `(((,enum ,(car x) )) ,(symbol->string (car x) ) )) (reverse (get-enum-vals enum)))
(else "*unknown*")
)
)
(defmacro bit-enum->string (enum input stream)
"print the enum bits in input to stream"
(with-gensyms (val str)
`(let ((,val ,input)
(,str ,stream))
,@(apply (lambda (x)
`(if (logtesta? ,val (,enum ,(car x)))
(format ,str ,(fmt #f "{} " (car x)))
)
) (reverse (get-enum-vals enum)))
)
)
)
;; load the default project
(load-project "goal_src/game.gp")
+80
View File
@@ -62,6 +62,9 @@
(defsmacro cddr (x)
`(cdr (cdr ,x)))
(defsmacro cdddr (x)
`(cdr (cdr (cdr ,x))))
(desfun first (x)
(car x))
@@ -116,6 +119,40 @@
)
)
(desfun reverse (lst)
(if (null? lst)
'()
(let ((old-lst lst)
(new-lst '()))
(while (not (null? old-lst))
(set! new-lst (cons (car old-lst) new-lst))
(set! old-lst (cdr old-lst))
)
new-lst
)
)
)
(desfun reverse-recursive (lst)
(if (null? lst)
'()
(let ((old-lst lst)
(new-lst '()))
(while (not (null? old-lst))
(let ((cur-obj (car old-lst)))
(set! new-lst (cons (if (pair? cur-obj)
(reverse-recursive cur-obj)
cur-obj
)
new-lst))
(set! old-lst (cdr old-lst))
)
)
new-lst
)
)
)
(defsmacro let (bindings &rest body)
`((lambda ,(apply first bindings) ,@body)
,@(apply second bindings)))
@@ -239,6 +276,49 @@
)
;;;;;;;;;;;;;;;;;;;
;; enum stuff
;;;;;;;;;;;;;;;;;;;
(desfun enum-length (enum)
(length (get-enum-vals enum))
)
(defsmacro doenum (bindings &rest body)
;; (doenum (name-var val-var 'enum &rest result) &rest body)
(with-gensyms (enum-vals)
`(let ((,enum-vals (get-enum-vals ,(third bindings))))
(while (not (null? ,enum-vals))
(let ((,(first bindings) (caar ,enum-vals)) ;; name
(,(second bindings) (cdar ,enum-vals)) ;; value
)
,@body
)
(set! ,enum-vals (cdr ,enum-vals))
)
,@(cdddr bindings)
)
)
)
(desfun enum-max (enum)
"get the highest value in an enum"
(let ((max-val -999999999))
(doenum (name val enum)
(when (> val max-val)
(set! max-val val))
)
max-val
)
)
;; shortcut to quit GOOS
+1 -78
View File
@@ -279,84 +279,7 @@
;; Each process-tree element has a process-mask which indicates what type of node it is.
(defun-debug stream<-process-mask ((arg0 object) (arg1 process-mask))
(let ((s4-0 arg1))
(if (= (logand #x1000000 (the-as int s4-0)) (process-mask death))
(format arg0 "death ")
)
(if (= (logand #x800000 (the-as int s4-0)) (process-mask attackable))
(format arg0 "attackable ")
)
(if (= (logand #x400000 (the-as int s4-0)) (process-mask projectile))
(format arg0 "projectile ")
)
(if (= (logand #x200000 (the-as int s4-0)) (process-mask entity))
(format arg0 "entity ")
)
(if (= (logand #x100000 (the-as int s4-0)) (process-mask ambient))
(format arg0 "ambient ")
)
(if (= (logand #x80000 (the-as int s4-0)) (process-mask platform))
(format arg0 "platform ")
)
(if (= (logand #x40000 (the-as int s4-0)) (process-mask camera))
(format arg0 "camera ")
)
(if (= (logand #x20000 (the-as int s4-0)) (process-mask enemy))
(format arg0 "enemy ")
)
(if (= (logand #x10000 (the-as int s4-0)) (process-mask collectable))
(format arg0 "collectable ")
)
(if (= (logand s4-0 (process-mask crate)) (process-mask crate))
(format arg0 "crate ")
)
(if (= (logand s4-0 (process-mask sidekick)) (process-mask sidekick))
(format arg0 "sidekick ")
)
(if (= (logand s4-0 (process-mask target)) (process-mask target))
(format arg0 "target ")
)
(if
(= (logand s4-0 (process-mask movie-subject)) (process-mask movie-subject))
(format arg0 "movie-subject ")
)
(if (= (logand s4-0 (process-mask movie)) (process-mask movie))
(format arg0 "movie ")
)
(if (= (logand s4-0 (process-mask going)) (process-mask going))
(format arg0 "going ")
)
(if (= (logand s4-0 (process-mask heap-shrunk)) (process-mask heap-shrunk))
(format arg0 "heap-shrunk ")
)
(if (= (logand s4-0 (process-mask process-tree)) (process-mask process-tree))
(format arg0 "process-tree ")
)
(if (= (logand s4-0 (process-mask sleep-code)) (process-mask sleep-code))
(format arg0 "sleep-code ")
)
(if (= (logand s4-0 (process-mask sleep)) (process-mask sleep))
(format arg0 "sleep ")
)
(if (= (logand s4-0 (process-mask actor-pause)) (process-mask actor-pause))
(format arg0 "actor-pause ")
)
(if (= (logand s4-0 (process-mask progress)) (process-mask progress))
(format arg0 "progress ")
)
(if (= (logand s4-0 (process-mask menu)) (process-mask menu))
(format arg0 "menu ")
)
(if (= (logand s4-0 (process-mask pause)) (process-mask pause))
(format arg0 "pause ")
)
(if (= (logand s4-0 (process-mask draw)) (process-mask draw))
(format arg0 "draw ")
)
(if (= (logand s4-0 (process-mask execute)) (process-mask execute))
(format arg0 "execute ")
)
)
(bit-enum->string process-mask arg1 arg0)
arg1
)
+99
View File
@@ -5,3 +5,102 @@
;; name in dgo: tippy
;; dgos: GAME, COMMON, L1
;; definition of type tippy
(deftype tippy (structure)
((axis vector :inline :offset-assert 0)
(angle float :offset-assert 16)
(orig quaternion :inline :offset-assert 32)
(dist-ratio float :offset-assert 48)
(damping float :offset-assert 52)
(1-damping float :offset-assert 56)
)
:method-count-assert 11
:size-assert #x3c
:flag-assert #xb0000003c
(:methods
(reset! (_type_ process-drawable float float) none 9)
(TODO-RENAME-10 (_type_ process-drawable vector) symbol 10)
)
)
;; definition for method 3 of type tippy
(defmethod inspect tippy ((obj tippy))
(format #t "[~8x] ~A~%" obj 'tippy)
(format #t "~Taxis: #<vector @ #x~X>~%" (-> obj axis))
(format #t "~Tangle: ~f~%" (-> obj angle))
(format #t "~Torig: #<quaternion @ #x~X>~%" (-> obj orig))
(format #t "~Tdist-ratio: ~f~%" (-> obj dist-ratio))
(format #t "~Tdamping: ~f~%" (-> obj damping))
(format #t "~T1-damping: ~f~%" (-> obj 1-damping))
obj
)
;; definition for method 9 of type tippy
;; INFO: Return type mismatch int vs none.
(defmethod
reset!
tippy
((obj tippy) (arg0 process-drawable) (arg1 float) (arg2 float))
(set-vector! (-> obj axis) 0.0 0.0 0.0 1.0)
(set! (-> obj angle) 0.0)
(quaternion-copy! (-> obj orig) (-> arg0 root quat))
(set! (-> obj dist-ratio) arg1)
(set! (-> obj damping) arg2)
(set! (-> obj 1-damping) (- 1.0 arg2))
0
(none)
)
;; definition for method 10 of type tippy
(defmethod
TODO-RENAME-10
tippy
((obj tippy) (arg0 process-drawable) (arg1 vector))
(let ((s4-0 #t))
(cond
(arg1
(let ((s3-0 (new 'stack-no-clear 'vector)))
0.0
(set! (-> s3-0 x) (- (-> arg1 z) (-> arg0 root trans z)))
(set! (-> s3-0 y) 0.0)
(set! (-> s3-0 z) (- (-> arg0 root trans x) (-> arg1 x)))
(let ((f0-6 (vector-length s3-0)))
(vector-float*! s3-0 s3-0 (/ 1.0 f0-6))
(let ((f30-0 (* f0-6 (-> obj dist-ratio))))
(set!
(-> obj axis x)
(+
(* (-> obj 1-damping) (-> obj axis x))
(* (-> obj damping) (-> s3-0 x))
)
)
(set! (-> obj axis y) 0.0)
(set!
(-> obj axis z)
(+
(* (-> obj 1-damping) (-> obj axis z))
(* (-> obj damping) (-> s3-0 z))
)
)
(vector-normalize! (-> obj axis) 1.0)
(set!
(-> obj angle)
(+ (* (-> obj 1-damping) (-> obj angle)) (* (-> obj damping) f30-0))
)
)
)
)
)
(else
(set! (-> obj angle) (* (-> obj 1-damping) (-> obj angle)))
(when (< (-> obj angle) 182.04445)
(set! (-> obj angle) 0.0)
(set! s4-0 #f)
)
)
)
(quaternion-vector-angle! (-> arg0 root quat) (-> obj axis) (-> obj angle))
(quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> obj orig))
s4-0
)
)
+44
View File
@@ -0,0 +1,44 @@
import glob
src_files = glob.glob("./goal_src/**/*.g[cs]", recursive=True)
data_files = glob.glob("./goal_src/**/*.gd", recursive=True)
# Find how many of each have been started
src_files_started = 0
src_files_finished = 0
data_files_started = 0
for f in src_files:
with open(f, "r") as temp_file:
lines = temp_file.readlines()
line_count = len(lines)
if line_count > 7:
# Check to see if there are any TODOs
if any("TODO" in string for string in lines):
src_files_finished = src_files_finished + 1
else:
src_files_started = src_files_started + 1
for f in data_files:
with open(f, "r") as temp_file:
line_count = len(temp_file.readlines())
if line_count > 7:
data_files_started = data_files_started + 1
import json
with open('./docs/gh-pages-proj/src/config/progress.json', 'r+', encoding='utf-8') as f:
data = {
'jak1': {
'fileProgress': {
'src_files_total': len(src_files),
'src_files_finished': src_files_finished,
'src_files_started': src_files_started,
'data_files_total': len(data_files),
'data_files_started': data_files_started
}
}
}
f.seek(0)
json.dump(data, f, ensure_ascii=False, indent=2)
f.truncate()
@@ -189,15 +189,15 @@
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-12 (_type_ vector float uint process bone uint) float 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-16 (_type_ vector float uint process uint) none 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-20 () none 20)
(dummy-20 (_type_ vector float uint bone uint) none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
+1 -1
View File
@@ -35,7 +35,7 @@
(projectile-dissipate () none 21)
(projectile-impact () none 22)
(dummy-23 () none 23)
(dummy-24 () none 24)
(dummy-24 (_type_) none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
@@ -0,0 +1,343 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for function add-fake-shadow-to-buffer
;; INFO: Return type mismatch int vs none.
(defun
add-fake-shadow-to-buffer
((arg0 vector) (arg1 vector) (arg2 float) (arg3 int))
(let ((v1-0 *fake-shadow-buffer*))
(when (< (-> v1-0 num-shadows) 32)
(let ((t0-5 (-> v1-0 data (-> v1-0 num-shadows))))
(set! (-> t0-5 px) (-> arg0 x))
(set! (-> t0-5 py) (-> arg0 y))
(set! (-> t0-5 pz) (-> arg0 z))
(set! (-> t0-5 scale) arg2)
(set! (-> t0-5 qx) (-> arg1 x))
(set! (-> t0-5 qy) (-> arg1 y))
(set! (-> t0-5 qz) (-> arg1 z))
(set! (-> t0-5 flags) arg3)
)
(+! (-> v1-0 num-shadows) 1)
)
)
0
(none)
)
;; definition for function swap-fake-shadow-buffers
;; INFO: Return type mismatch int vs none.
(defun swap-fake-shadow-buffers ()
(set! *fake-shadow-buffer* (if (= *fake-shadow-buffer* *fake-shadow-buffer-1*)
*fake-shadow-buffer-2*
*fake-shadow-buffer-1*
)
)
(set! (-> *fake-shadow-buffer* num-shadows) 0)
0
(none)
)
;; definition for function draw-shadow
;; INFO: Return type mismatch int vs none.
(defun
draw-shadow
((arg0 vector)
(arg1 vector)
(arg2 vector)
(arg3 float)
(arg4 float)
(arg5 float)
)
(let ((f0-1 (- (-> arg0 y) (-> arg1 y))))
(if (< f0-1 arg4)
(add-fake-shadow-to-buffer
arg1
arg2
(* (- 1.0 (/ f0-1 arg4)) arg3)
(the-as int arg5)
)
)
)
0
(none)
)
;; definition for function compute-and-draw-shadow
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defun
compute-and-draw-shadow
((arg0 vector)
(arg1 vector)
(arg2 vector)
(arg3 vector)
(arg4 float)
(arg5 float)
)
(local-vars
(v1-10 float)
(v1-11 float)
(sv-96 vector)
(sv-112 (function quaternion vector float quaternion))
(sv-128 vector)
(sv-144 vector)
)
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(set! sv-96 arg2)
(let ((s4-0 arg3)
(s3-0 arg4)
(s2-0 arg5)
)
(when (< (- (-> arg0 y) (-> arg1 y)) s3-0)
(set! sv-144 (new 'stack-no-clear 'vector))
(let ((s0-0 (new 'stack-no-clear 'vector))
(s1-0 (new 'stack-no-clear 'sparticle-cpuinfo))
)
(set! (-> arg1 y) (+ 40.96 (-> arg1 y)))
(set! (-> sv-144 x) (-> sv-96 z))
(set! (-> sv-144 y) 0.0)
(set! (-> sv-144 z) (- (-> sv-96 x)))
(vector-normalize! sv-144 1.0)
(set! sv-112 quaternion-vector-angle!)
(set! sv-128 s0-0)
(let ((a2-1 (acos (-> sv-96 y))))
(sv-112 (the-as quaternion sv-128) sv-144 a2-1)
)
(let ((v1-9 s1-0))
(cond
((< (-> s0-0 w) 0.0)
(.lvf vf1 (&-> v1-9 vel-sxvel quad))
(.lvf vf2 (&-> s0-0 quad))
(.sub.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> v1-9 vel-sxvel quad) vf1)
(.mov v1-10 vf1)
)
(else
(.lvf vf1 (&-> v1-9 vel-sxvel quad))
(.lvf vf2 (&-> s0-0 quad))
(.add.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> v1-9 vel-sxvel quad) vf1)
(.mov v1-11 vf1)
)
)
)
(draw-shadow arg0 arg1 (-> s1-0 vel-sxvel) (the-as float s4-0) s3-0 s2-0)
)
)
)
0
(none)
)
)
;; definition for function find-ground-and-draw-shadow
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defun
find-ground-and-draw-shadow
((arg0 vector)
(arg1 vector)
(arg2 float)
(arg3 uint)
(arg4 process)
(arg5 float)
(arg6 float)
)
(let ((s2-0 (new 'stack-no-clear 'vector)))
(set! (-> s2-0 quad) (-> arg0 quad))
(new 'stack-no-clear 'vector)
(+! (-> s2-0 y) arg5)
(let ((s4-0 (new 'stack-no-clear 'bone)))
(cond
((>=
(dummy-12 *collide-cache* s2-0 arg6 arg3 arg4 s4-0 (the-as uint 1))
0.0
)
(if (!= arg2 0.0)
(compute-and-draw-shadow
s2-0
(-> s4-0 position)
(-> s4-0 scale)
(the-as vector arg2)
arg6
(the-as float 0)
)
)
(if (and arg1 (!= (shr (shl (-> s4-0 cache bone-matrix) 52) 58) 3))
(set! (-> arg1 quad) (-> s4-0 position quad))
)
)
(else
(if arg1
(vector+float*!
arg1
arg0
(-> *standard-dynamics* gravity-normal)
(- arg6)
)
)
)
)
)
)
0
(none)
)
;; definition for function do-target-shadow
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defbehavior do-target-shadow target ()
(if
(and
(logtest? (-> self control status) 1)
(!= (-> self control unknown-surface mode) 'swim)
(!= (-> self control unknown-surface mode) 'dive)
(!= (-> self next-state name) 'target-flop)
(zero? (logand (-> self draw status) 38))
)
(set! (-> self control shadow-pos quad) (-> self control trans quad))
(find-ground-and-draw-shadow
(-> self control trans)
(-> self control shadow-pos)
0.0
(-> (the-as collide-shape-prim (-> self control root-prim)) collide-with)
self
0.0
81920.0
)
)
0
(none)
)
;; failed to figure out what this is:
(set!
(-> *part-id-table* 362)
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 20
(new 'static 'sp-field-init-spec :field #x1 :initial-value #x200000)
(new 'static 'sp-field-init-spec
:field #x6
:flags #x1
:initial-value #x41000000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #xd
:flags #x1
:initial-value #x4499999a
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x10
:flags #x1
:initial-value -956301312
:random-range #x47800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x11
:flags #x3
:initial-value -4
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x12
:flags #x1
:initial-value #x42b40000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x13
:flags #x1
:initial-value #x42b40000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x14
:flags #x1
:initial-value #x42b40000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x15
:flags #x1
:initial-value #x41a00000
:random-range #x41a00000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x1a
:flags #x1
:initial-value #x4103126f
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x1c
:flags #x1
:initial-value #x41888889
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x20
:flags #x3
:initial-value -4
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x24
:flags #x1
:initial-value -1097229926
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x2e
:initial-value #x138c
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x2f
:initial-value 12
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x36
:flags #x1
:initial-value -983331271
:random-range #x452aaaab
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x3a
:flags #x1
:initial-value #x46800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x3b
:flags #x1
:initial-value -956301312
:random-range #x47800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x3e
:flags #x1
:initial-value #x444ccccd
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec :field #x43)
)
)
)
@@ -5,12 +5,12 @@
(deftype sp-field-init-spec (structure)
((field uint16 :offset-assert 0)
(flags uint16 :offset-assert 2)
(initial-valuef float :offset-assert 4)
(random-rangef float :offset-assert 8)
(random-multf float :offset-assert 12)
(initial-value int32 :offset 4)
(random-range int32 :offset 8)
(random-mult int32 :offset 12)
(initial-value int32 :offset-assert 4)
(random-range int32 :offset-assert 8)
(random-mult int32 :offset-assert 12)
(initial-valuef float :offset 4)
(random-rangef float :offset 8)
(random-multf float :offset 12)
(func basic :offset 4)
(tex uint32 :offset 4)
(pntr uint32 :offset 4)
@@ -30,9 +30,9 @@
(format #t "~Tinitial-valuef: ~f~%" (-> obj initial-valuef))
(format #t "~Trandom-rangef: ~f~%" (-> obj random-rangef))
(format #t "~Trandom-multf: ~f~%" (-> obj random-multf))
(format #t "~Tinitial-value: ~D~%" (-> obj initial-valuef))
(format #t "~Trandom-range: ~D~%" (-> obj random-rangef))
(format #t "~Trandom-mult: ~D~%" (-> obj random-multf))
(format #t "~Tinitial-value: ~D~%" (-> obj initial-value))
(format #t "~Trandom-range: ~D~%" (-> obj random-range))
(format #t "~Trandom-mult: ~D~%" (-> obj random-mult))
(format #t "~Tfunc: ~A~%" (-> obj initial-valuef))
(format #t "~Ttex: ~D~%" (-> obj initial-valuef))
(format #t "~Tpntr: #x~X~%" (-> obj initial-valuef))
@@ -43,9 +43,9 @@
;; definition of type sparticle-launcher
(deftype sparticle-launcher (basic)
((birthaccum float :offset-assert 4)
(soundaccum float :offset-assert 8)
(init-specs uint32 :offset-assert 12)
((birthaccum float :offset-assert 4)
(soundaccum float :offset-assert 8)
(init-specs (inline-array sp-field-init-spec) :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10
+106
View File
@@ -0,0 +1,106 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type tippy
(deftype tippy (structure)
((axis vector :inline :offset-assert 0)
(angle float :offset-assert 16)
(orig quaternion :inline :offset-assert 32)
(dist-ratio float :offset-assert 48)
(damping float :offset-assert 52)
(1-damping float :offset-assert 56)
)
:method-count-assert 11
:size-assert #x3c
:flag-assert #xb0000003c
(:methods
(reset! (_type_ process-drawable float float) none 9)
(TODO-RENAME-10 (_type_ process-drawable vector) symbol 10)
)
)
;; definition for method 3 of type tippy
(defmethod inspect tippy ((obj tippy))
(format #t "[~8x] ~A~%" obj 'tippy)
(format #t "~Taxis: #<vector @ #x~X>~%" (-> obj axis))
(format #t "~Tangle: ~f~%" (-> obj angle))
(format #t "~Torig: #<quaternion @ #x~X>~%" (-> obj orig))
(format #t "~Tdist-ratio: ~f~%" (-> obj dist-ratio))
(format #t "~Tdamping: ~f~%" (-> obj damping))
(format #t "~T1-damping: ~f~%" (-> obj 1-damping))
obj
)
;; definition for method 9 of type tippy
;; INFO: Return type mismatch int vs none.
(defmethod
reset!
tippy
((obj tippy) (arg0 process-drawable) (arg1 float) (arg2 float))
(set-vector! (-> obj axis) 0.0 0.0 0.0 1.0)
(set! (-> obj angle) 0.0)
(quaternion-copy! (-> obj orig) (-> arg0 root quat))
(set! (-> obj dist-ratio) arg1)
(set! (-> obj damping) arg2)
(set! (-> obj 1-damping) (- 1.0 arg2))
0
(none)
)
;; definition for method 10 of type tippy
(defmethod
TODO-RENAME-10
tippy
((obj tippy) (arg0 process-drawable) (arg1 vector))
(let ((s4-0 #t))
(cond
(arg1
(let ((s3-0 (new 'stack-no-clear 'vector)))
0.0
(set! (-> s3-0 x) (- (-> arg1 z) (-> arg0 root trans z)))
(set! (-> s3-0 y) 0.0)
(set! (-> s3-0 z) (- (-> arg0 root trans x) (-> arg1 x)))
(let ((f0-6 (vector-length s3-0)))
(vector-float*! s3-0 s3-0 (/ 1.0 f0-6))
(let ((f30-0 (* f0-6 (-> obj dist-ratio))))
(set!
(-> obj axis x)
(+
(* (-> obj 1-damping) (-> obj axis x))
(* (-> obj damping) (-> s3-0 x))
)
)
(set! (-> obj axis y) 0.0)
(set!
(-> obj axis z)
(+
(* (-> obj 1-damping) (-> obj axis z))
(* (-> obj damping) (-> s3-0 z))
)
)
(vector-normalize! (-> obj axis) 1.0)
(set!
(-> obj angle)
(+ (* (-> obj 1-damping) (-> obj angle)) (* (-> obj damping) f30-0))
)
)
)
)
)
(else
(set! (-> obj angle) (* (-> obj 1-damping) (-> obj angle)))
(when (< (-> obj angle) 182.04445)
(set! (-> obj angle) 0.0)
(set! s4-0 #f)
)
)
)
(quaternion-vector-angle! (-> arg0 root quat) (-> obj axis) (-> obj angle))
(quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> obj orig))
s4-0
)
)