mirror of
https://github.com/open-goal/jak-project
synced 2026-07-07 14:13:45 -04:00
game: Get camera code working (#965)
* cmake: disable edit&continue flags * goos: make the build system work for alternate file paths nicely * vs: update vs config * vscode: extend terminal buffer! * vs: fix presets * debugger: fix exception handler * game: add logo to application * decomp: get `cam-master` to "work" -- manually changed return type * debugger: fix printing issue * game: get the camera actually working * game: neutralize the analog sticks * game: support analog sticks * tests: update ref tests * temp commit - inprogress stuff * fix `send-macro` * turn camera stuff back on, seems to work. Still kernel-dispatch problem though * address feedback * formatting
This commit is contained in:
+5
-1
@@ -67,7 +67,11 @@
|
||||
"type" : "default",
|
||||
"project" : "CMakeLists.txt",
|
||||
"projectTarget" : "goalc.exe (bin\\goalc.exe)",
|
||||
"name" : "Run - REPL"
|
||||
"name" : "Run - REPL",
|
||||
"args" : [ "-auto-lt" ],
|
||||
"env": {
|
||||
"OPENGOAL_DECOMP_DIR": "jak1/"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type" : "default",
|
||||
|
||||
Vendored
+5
-3
@@ -1,9 +1,11 @@
|
||||
{
|
||||
"terminal.integrated.scrollback": 32000,
|
||||
"files.associations": {
|
||||
"*ir2.asm": "Plain Text",
|
||||
".gc": "lisp",
|
||||
".gs": "lisp",
|
||||
".gd": "lisp"
|
||||
"*.gc": "lisp",
|
||||
"*.gs": "lisp",
|
||||
"*.gd": "lisp",
|
||||
"*.gp": "lisp"
|
||||
},
|
||||
"highlight.maxMatches": 50000, // Maximum number of matches to decorate per regex, in order not to crash the app with accidental cathastropic regexes
|
||||
"highlight.regexes": {
|
||||
|
||||
+8
-2
@@ -9,9 +9,15 @@ tasks:
|
||||
ignore_error: true
|
||||
run-game:
|
||||
cmds:
|
||||
- ./out/build/Debug/bin/gk.exe -fakeiso -debug -nodisplay
|
||||
repl:
|
||||
- ./out/build/Release/bin/gk.exe -fakeiso -debug
|
||||
run-game-headless:
|
||||
cmds:
|
||||
- ./out/build/Release/bin/gk.exe -fakeiso -debug -nodisplay
|
||||
repl:
|
||||
env:
|
||||
OPENGOAL_DECOMP_DIR: "jak1/"
|
||||
cmds:
|
||||
# (mi) | (test-play)
|
||||
- ./out/build/Release/bin/goalc.exe -auto-lt
|
||||
decomp:
|
||||
cmds:
|
||||
|
||||
@@ -34,7 +34,7 @@ add_library(common
|
||||
util/Timer.cpp
|
||||
util/print_float.cpp
|
||||
util/FontUtils.cpp
|
||||
)
|
||||
util/image_loading.h)
|
||||
|
||||
target_link_libraries(common fmt lzokay replxx libzstd_static)
|
||||
|
||||
|
||||
@@ -391,7 +391,7 @@ void ignore_debug_event() {
|
||||
cont_status = -1;
|
||||
}
|
||||
|
||||
const char* win32_exception_code_to_charp(DWORD exc) {
|
||||
std::string win32_exception_code_to_charp(DWORD exc) {
|
||||
switch (exc) {
|
||||
case EXCEPTION_ACCESS_VIOLATION:
|
||||
return "EXCEPTION_ACCESS_VIOLATION";
|
||||
@@ -434,7 +434,7 @@ const char* win32_exception_code_to_charp(DWORD exc) {
|
||||
case EXCEPTION_STACK_OVERFLOW:
|
||||
return "EXCEPTION_STACK_OVERFLOW";
|
||||
default:
|
||||
return "??????????";
|
||||
return "UNHANDLED_WIN32_EXCEPTION";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,8 @@ Interpreter::Interpreter() {
|
||||
{"string-append", &Interpreter::eval_string_append},
|
||||
{"ash", &Interpreter::eval_ash},
|
||||
{"symbol->string", &Interpreter::eval_symbol_to_string},
|
||||
{"string->symbol", &Interpreter::eval_string_to_symbol}};
|
||||
{"string->symbol", &Interpreter::eval_string_to_symbol},
|
||||
{"get-environment-variable", &Interpreter::eval_get_env}};
|
||||
|
||||
string_to_type = {{"empty-list", ObjectType::EMPTY_LIST},
|
||||
{"integer", ObjectType::INTEGER},
|
||||
@@ -1643,4 +1644,20 @@ Object Interpreter::eval_string_to_symbol(const Object& form,
|
||||
vararg_check(form, args, {ObjectType::STRING}, {});
|
||||
return SymbolObject::make_new(reader.symbolTable, args.unnamed.at(0).as_string()->data);
|
||||
}
|
||||
|
||||
Object Interpreter::eval_get_env(const Object& form,
|
||||
Arguments& args,
|
||||
const std::shared_ptr<EnvironmentObject>&) {
|
||||
vararg_check(form, args, {ObjectType::STRING}, {{"default", {false, ObjectType::STRING}}});
|
||||
const std::string var_name = args.unnamed.at(0).as_string()->data;
|
||||
const char* env_p = std::getenv(var_name.c_str());
|
||||
if (env_p == NULL) {
|
||||
if (args.has_named("default")) {
|
||||
return args.get_named("default");
|
||||
} else {
|
||||
throw_eval_error(form, fmt::format("env-var {} not found and no default provided", var_name));
|
||||
}
|
||||
}
|
||||
return StringObject::make_new(env_p);
|
||||
}
|
||||
} // namespace goos
|
||||
|
||||
@@ -212,6 +212,9 @@ class Interpreter {
|
||||
Object eval_string_to_symbol(const Object& form,
|
||||
Arguments& args,
|
||||
const std::shared_ptr<EnvironmentObject>& env);
|
||||
Object eval_get_env(const Object& form,
|
||||
Arguments& args,
|
||||
const std::shared_ptr<EnvironmentObject>& env);
|
||||
|
||||
// specials
|
||||
Object eval_define(const Object& form,
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "third-party/stb_image.h"
|
||||
@@ -395,7 +395,8 @@ std::optional<RegisterAccess> rewrite_to_get_var(std::vector<FormElement*>& defa
|
||||
auto cast = last_op_as_set->required_cast(env);
|
||||
if (cast && cast == TypeSpec("none")) {
|
||||
env.func->warnings.general_warning(
|
||||
"rewrite_to_get_var got a none typed variable. Is there unreachable code?");
|
||||
"rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: {}]",
|
||||
last_op_as_set->dst().idx());
|
||||
cast = std::nullopt;
|
||||
}
|
||||
if (cast) {
|
||||
|
||||
@@ -18520,7 +18520,7 @@
|
||||
(define-extern cam-circular (state camera-slave))
|
||||
(define-extern cam-standoff-read-entity (state camera-slave))
|
||||
(define-extern cam-spline (state camera-slave))
|
||||
(define-extern *camera-base-mode* state)
|
||||
(define-extern *camera-base-mode* (state camera-slave))
|
||||
(define-extern cam-fixed-read-entity (state camera-slave))
|
||||
|
||||
;; ----------------------
|
||||
@@ -21938,7 +21938,7 @@
|
||||
(define-extern dm-cam-settings-func (function int int symbol))
|
||||
(define-extern dm-cam-settings-func-int (function int int debug-menu debug-menu debug-menu))
|
||||
(define-extern debug-create-cam-restore (function none)) ;; TODO - level-group type isn't complete
|
||||
(define-extern dm-cam-mode-func (function uint int object))
|
||||
(define-extern dm-cam-mode-func (function (state camera-slave) int symbol))
|
||||
(define-extern dm-instance-pick-func (function string int basic))
|
||||
(define-extern dm-enable-instance-func (function string int symbol))
|
||||
(define-extern dm-shader-pick-func (function texture-id int object)) ;; TODO - more texture stuff...
|
||||
|
||||
@@ -3554,8 +3554,15 @@
|
||||
"(event cam-master-active)": [
|
||||
[95, "gp", "matrix"],
|
||||
[184, "v1", "vector"],
|
||||
[240, "v1", "target"],
|
||||
[280, "v1", "target"],
|
||||
[235, "v1", "process"],
|
||||
[239, "v1", "process"],
|
||||
[240, "v1", "process"],
|
||||
[262, "v1", "process"],
|
||||
[270, "v1", "process"],
|
||||
[279, "v1", "process"],
|
||||
[280, "v1", "process"],
|
||||
[329, "v1", "float"],
|
||||
[335, "a0", "float"],
|
||||
[457, "v1", "camera-slave"],
|
||||
[511, "v1", "camera-slave"],
|
||||
[524, "v0", "camera-slave"],
|
||||
@@ -3574,7 +3581,13 @@
|
||||
[1011, "a0", "camera-slave"],
|
||||
[1023, "v1", "projectile"],
|
||||
[1033, "a0", "camera-slave"],
|
||||
[1035, "a0", "camera-slave"],
|
||||
[1049, "v1", "float"],
|
||||
[1053, "v1", "float"],
|
||||
[1062, "v1", "float"],
|
||||
[1066, "v1", "float"],
|
||||
[1071, "a0", "vector"],
|
||||
[1368, "v1", "float"],
|
||||
[1371, "v1", "float"]
|
||||
],
|
||||
|
||||
|
||||
@@ -3502,12 +3502,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
"(event cam-master-active)": {
|
||||
"vars": {
|
||||
// "v0-0": ["v0-0", "symbol"]
|
||||
}
|
||||
},
|
||||
|
||||
"(code plunger-lurker-plunge)": {
|
||||
"vars": {
|
||||
"gp-1": ["gp-1", "handle"],
|
||||
@@ -3692,5 +3686,12 @@
|
||||
}
|
||||
},
|
||||
|
||||
// this shouldn't be required
|
||||
"(event cam-master-active)": {
|
||||
"vars": {
|
||||
"v0-0": ["v0-0", "object"]
|
||||
}
|
||||
},
|
||||
|
||||
"aaaaaaaaaaaaaaaaaaaaaaa": {}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
@@ -198,4 +198,8 @@ int PadIsPressed(Pad::Button button, int port) {
|
||||
return Pad::IsPressed(g_settings.pad_mapping_info, button, port);
|
||||
}
|
||||
|
||||
int PadAnalogValue(Pad::Analog analog, int port) {
|
||||
return Pad::AnalogValue(g_settings.pad_mapping_info, analog, port);
|
||||
}
|
||||
|
||||
} // namespace Gfx
|
||||
|
||||
@@ -79,5 +79,6 @@ void input_mode_save();
|
||||
s64 get_mapped_button(s64 pad, s64 button);
|
||||
|
||||
int PadIsPressed(Pad::Button button, int port);
|
||||
int PadAnalogValue(Pad::Analog analog, int port);
|
||||
|
||||
} // namespace Gfx
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "game/system/newpad.h"
|
||||
#include "common/log/log.h"
|
||||
#include "common/goal_constants.h"
|
||||
#include "common/util/image_loading.h"
|
||||
#include "game/runtime.h"
|
||||
#include "common/util/Timer.h"
|
||||
#include "game/graphics/opengl_renderer/debug_gui.h"
|
||||
@@ -139,6 +140,14 @@ static std::shared_ptr<GfxDisplay> gl_make_main_display(int width,
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
|
||||
std::string image_path = fmt::format("{}/docs/favicon-nobg.png", file_util::get_project_path());
|
||||
|
||||
GLFWimage images[1];
|
||||
images[0].pixels =
|
||||
stbi_load(image_path.c_str(), &images[0].width, &images[0].height, 0, 4); // rgba channels
|
||||
glfwSetWindowIcon(window, 1, images);
|
||||
stbi_image_free(images[0].pixels);
|
||||
|
||||
if (!gl_inited && !gladLoadGL()) {
|
||||
lg::error("GL init fail");
|
||||
return NULL;
|
||||
|
||||
+4
-4
@@ -69,10 +69,10 @@ int scePadRead(int port, int /*slot*/, u8* rdata) {
|
||||
|
||||
cpad->status = 0x70 /* (dualshock2) */ | (20 / 2); /* (dualshock2 data size) */
|
||||
|
||||
cpad->rightx = 0;
|
||||
cpad->righty = 0;
|
||||
cpad->leftx = 0;
|
||||
cpad->lefty = 0;
|
||||
cpad->rightx = Gfx::PadAnalogValue(Pad::Analog::Right_X, port);
|
||||
cpad->righty = Gfx::PadAnalogValue(Pad::Analog::Right_Y, port);
|
||||
cpad->leftx = Gfx::PadAnalogValue(Pad::Analog::Left_X, port);
|
||||
cpad->lefty = Gfx::PadAnalogValue(Pad::Analog::Left_Y, port);
|
||||
|
||||
// pressure sensitivity. ignore for now.
|
||||
for (int i = 0; i < 12; ++i) {
|
||||
|
||||
@@ -22,6 +22,7 @@ std::unordered_map<int, int> g_key_status;
|
||||
std::unordered_map<int, int> g_buffered_key_status;
|
||||
|
||||
bool g_gamepad_buttons[(int)Button::Max] = {0};
|
||||
float g_gamepad_analogs[(int)Analog::Max] = {127};
|
||||
|
||||
// input mode for controller mapping
|
||||
InputModeStatus input_mode = InputModeStatus::Disabled;
|
||||
@@ -116,6 +117,17 @@ int IsPressed(MappingInfo& mapping, Button button, int pad = 0) {
|
||||
return keymap.at(key);
|
||||
}
|
||||
|
||||
// returns the value of the analog axis (in the future, likely pressure sensitive if we support it?)
|
||||
// if invalid or otherwise -- returns 127 (analog stick neutral position)
|
||||
int AnalogValue(MappingInfo& mapping, Analog analog, int pad = 0) {
|
||||
if (CheckPadIdx(pad) == -1) {
|
||||
return 127;
|
||||
}
|
||||
// TODO - dead-zone support needed?
|
||||
return (g_gamepad_analogs[(int)analog] * 127) + 127;
|
||||
// TODO - support keyboard inputs as well
|
||||
}
|
||||
|
||||
// map a button on a pad to a key
|
||||
void MapButton(MappingInfo& mapping, Button button, int pad, int key) {
|
||||
// check if pad is valid. dont map buttons with invalid pads.
|
||||
@@ -234,12 +246,22 @@ void update_gamepads() {
|
||||
{Button::X, GLFW_GAMEPAD_BUTTON_CROSS},
|
||||
{Button::Square, GLFW_GAMEPAD_BUTTON_SQUARE}};
|
||||
|
||||
constexpr std::pair<Analog, int> gamepad_analog_map[] = {
|
||||
{Analog::Left_X, GLFW_GAMEPAD_AXIS_LEFT_X},
|
||||
{Analog::Left_Y, GLFW_GAMEPAD_AXIS_LEFT_Y},
|
||||
{Analog::Right_X, GLFW_GAMEPAD_AXIS_RIGHT_X},
|
||||
{Analog::Right_Y, GLFW_GAMEPAD_AXIS_RIGHT_Y}};
|
||||
|
||||
for (const auto& [button, idx] : gamepad_map) {
|
||||
g_gamepad_buttons[(int)button] = state.buttons[idx];
|
||||
}
|
||||
|
||||
g_gamepad_buttons[(int)Button::L2] = state.axes[GLFW_GAMEPAD_AXIS_LEFT_TRIGGER] > 0;
|
||||
g_gamepad_buttons[(int)Button::R2] = state.axes[GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER] > 0;
|
||||
|
||||
for (const auto& [analog_vector, idx] : gamepad_analog_map) {
|
||||
g_gamepad_analogs[(int)analog_vector] = state.axes[idx];
|
||||
}
|
||||
}
|
||||
|
||||
}; // namespace Pad
|
||||
|
||||
@@ -20,6 +20,15 @@ namespace Pad {
|
||||
|
||||
static constexpr int CONTROLLER_COUNT = 2; // support 2 controllers.
|
||||
|
||||
enum class Analog {
|
||||
Left_X = 0,
|
||||
Left_Y,
|
||||
Right_X,
|
||||
Right_Y,
|
||||
|
||||
Max
|
||||
};
|
||||
|
||||
// mirrors goal enum pad-buttons. used as indices to an array!
|
||||
enum class Button {
|
||||
Select = 0,
|
||||
@@ -70,6 +79,7 @@ void ClearKeys();
|
||||
|
||||
void DefaultMapping(MappingInfo& mapping);
|
||||
int IsPressed(MappingInfo& mapping, Button button, int pad);
|
||||
int AnalogValue(MappingInfo& mapping, Analog analog, int pad);
|
||||
void MapButton(MappingInfo& mapping, Button button, int pad, int key);
|
||||
|
||||
// this enum is also in pc-pad-utils.gc
|
||||
|
||||
@@ -722,4 +722,4 @@
|
||||
(go cam-combiner-active)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -29,4 +29,4 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
)
|
||||
)
|
||||
|
||||
+1195
-1181
File diff suppressed because it is too large
Load Diff
@@ -14,68 +14,48 @@
|
||||
(set! *camera* #f)
|
||||
(set! *camera-combiner* #f)
|
||||
(let ((v0-3 cam-string))
|
||||
(set! *camera-base-mode* v0-3)
|
||||
(the-as state v0-3)
|
||||
)
|
||||
)
|
||||
(set! *camera-base-mode* v0-3)
|
||||
(the-as state v0-3)))
|
||||
|
||||
;; definition for function cam-start
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun cam-start ((arg0 symbol))
|
||||
(cam-stop)
|
||||
(let ((s5-0 (get-process *camera-dead-pool* camera-combiner #x4000)))
|
||||
(when s5-0
|
||||
(let ((t9-2 (method-of-type camera-combiner activate)))
|
||||
(t9-2
|
||||
(the-as camera-combiner s5-0)
|
||||
*camera-pool*
|
||||
'camera-combiner
|
||||
(the-as pointer #x70004000)
|
||||
)
|
||||
)
|
||||
(run-now-in-process s5-0 cam-combiner-init)
|
||||
(-> s5-0 ppointer)
|
||||
)
|
||||
)
|
||||
(when s5-0
|
||||
(let ((t9-2 (method-of-type camera-combiner activate)))
|
||||
(t9-2
|
||||
(the-as camera-combiner s5-0)
|
||||
*camera-pool*
|
||||
'camera-combiner
|
||||
(the-as pointer #x70004000)))
|
||||
(run-now-in-process s5-0 cam-combiner-init)
|
||||
(-> s5-0 ppointer)))
|
||||
(let ((s5-1 (get-process *camera-master-dead-pool* camera-master #x4000)))
|
||||
(set! *camera* (the-as camera-master (ppointer->process (when s5-1
|
||||
(let
|
||||
((t9-5
|
||||
(method-of-type
|
||||
camera-master
|
||||
activate
|
||||
)
|
||||
)
|
||||
)
|
||||
(t9-5
|
||||
(the-as
|
||||
camera-master
|
||||
s5-1
|
||||
)
|
||||
*camera-pool*
|
||||
'camera-master
|
||||
(the-as
|
||||
pointer
|
||||
#x70004000
|
||||
)
|
||||
)
|
||||
)
|
||||
(run-next-time-in-process
|
||||
s5-1
|
||||
cam-master-init
|
||||
)
|
||||
(-> s5-1 ppointer)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! *camera*
|
||||
(the-as camera-master
|
||||
(ppointer->process
|
||||
(when s5-1
|
||||
(let ((t9-5 (method-of-type
|
||||
camera-master
|
||||
activate)))
|
||||
(t9-5
|
||||
(the-as
|
||||
camera-master
|
||||
s5-1)
|
||||
*camera-pool*
|
||||
'camera-master
|
||||
(the-as
|
||||
pointer
|
||||
#x70004000)))
|
||||
(run-next-time-in-process
|
||||
s5-1
|
||||
cam-master-init)
|
||||
(-> s5-1 ppointer))))))
|
||||
(if arg0
|
||||
(reset-cameras)
|
||||
)
|
||||
(reset-cameras))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
(none))
|
||||
|
||||
;; failed to figure out what this is:
|
||||
; (cam-start #f)
|
||||
(cam-start #f)
|
||||
|
||||
@@ -4512,7 +4512,7 @@
|
||||
)
|
||||
)
|
||||
|
||||
(define *camera-base-mode* (the-as state cam-string))
|
||||
(define *camera-base-mode* cam-string)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
(define-extern cam-circular (state camera-slave))
|
||||
(define-extern cam-standoff-read-entity (state camera-slave))
|
||||
(define-extern cam-spline (state camera-slave))
|
||||
(define-extern *camera-base-mode* state)
|
||||
(define-extern *camera-base-mode* (state camera-slave))
|
||||
(define-extern cam-fixed-read-entity (state camera-slave))
|
||||
(define-extern camera-line-rel-len (function vector vector float vector4w none))
|
||||
(define-extern cam-calc-follow! (function cam-rotation-tracker vector symbol vector))
|
||||
|
||||
@@ -21,14 +21,13 @@
|
||||
|
||||
(define *dm-cam-mode-interpolation* (the-as debug-menu 0))
|
||||
|
||||
(defun dm-cam-mode-func ((arg0 uint) (arg1 int))
|
||||
(defun dm-cam-mode-func ((arg0 (state camera-slave)) (arg1 int))
|
||||
(if (and (= arg1 4) arg0)
|
||||
(send-event *camera* 'change-state arg0 *dm-cam-mode-interpolation*)
|
||||
)
|
||||
(if *camera*
|
||||
(send-event *camera* 'query-state arg0)
|
||||
(send-event *camera* 'query-state arg0))
|
||||
(not arg0)
|
||||
)
|
||||
)
|
||||
|
||||
(defun dm-cam-settings-func ((arg0 int) (arg1 int))
|
||||
@@ -2933,7 +2932,7 @@
|
||||
(stub-item (new 'debug 'debug-menu-item-submenu "Instance" stub-menu)))
|
||||
stub-item
|
||||
)
|
||||
;; TODO - fix me!
|
||||
; TODO - fix me!
|
||||
; (let* ((gp-0 (new 'debug 'debug-menu arg0 "Instance menu"))
|
||||
; (s5-0 (new 'debug 'debug-menu-item-submenu "Instance" gp-0))
|
||||
; )
|
||||
|
||||
@@ -554,7 +554,7 @@
|
||||
(add-ee-profile-frame 'draw :r #x40 :b #x40)
|
||||
;; debug hook
|
||||
(main-cheats)
|
||||
;; update-camera
|
||||
(update-camera)
|
||||
(*draw-hook*)
|
||||
(add-ee-profile-frame 'draw :g #x80)
|
||||
|
||||
|
||||
+10
-10
@@ -80,11 +80,11 @@
|
||||
)
|
||||
|
||||
(defmacro copy-texture (tpage-id)
|
||||
`(defstep :in ,(string-append "decompiler_out/raw_obj/" (tpage-name tpage-id))
|
||||
:tool 'copy
|
||||
:out '(,(string-append "out/obj/" (tpage-name tpage-id)))
|
||||
)
|
||||
)
|
||||
(let* ((folder (get-environment-variable "OPENGOAL_DECOMP_DIR" :default ""))
|
||||
(path (string-append "decompiler_out/" folder "raw_obj/" (tpage-name tpage-id))))
|
||||
`(defstep :in ,path
|
||||
:tool 'copy
|
||||
:out '(,(string-append "out/obj/" (tpage-name tpage-id))))))
|
||||
|
||||
(defmacro copy-textures (&rest ids)
|
||||
`(begin
|
||||
@@ -93,11 +93,11 @@
|
||||
)
|
||||
|
||||
(defmacro copy-go (name)
|
||||
`(defstep :in ,(string-append "decompiler_out/raw_obj/" name ".go")
|
||||
:tool 'copy
|
||||
:out '(,(string-append "out/obj/" name ".go"))
|
||||
)
|
||||
)
|
||||
(let* ((folder (get-environment-variable "OPENGOAL_DECOMP_DIR" :default ""))
|
||||
(path (string-append "decompiler_out/" folder "raw_obj/" name ".go")))
|
||||
`(defstep :in ,path
|
||||
:tool 'copy
|
||||
:out '(,(string-append "out/obj/" name ".go")))))
|
||||
|
||||
(defmacro copy-gos (&rest gos)
|
||||
`(begin
|
||||
|
||||
@@ -620,4 +620,4 @@
|
||||
(define-extern ,name ,type)
|
||||
(set! ,name (the-as ,type (__pc-get-mips2c ,(symbol->string name))))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -452,9 +452,7 @@ It type checks the arguments for the entry function.
|
||||
(set! (-> event-data from) pp)
|
||||
(set! (-> event-data num-params) ,(length params))
|
||||
(set! (-> event-data message) ,msg)
|
||||
,@(let ((ep 0))
|
||||
(apply (lambda (x) `(set! (-> event-data param ep) (the-as uint ,x)) (inc! ep)) params)
|
||||
)
|
||||
,@(apply-i (lambda (x i) `(set! (-> event-data param ,i) (the-as uint ,x))) params)
|
||||
(send-event-function ,proc event-data)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -5,3 +5,107 @@
|
||||
;; name in dgo: joint-exploder
|
||||
;; dgos: GAME, COMMON, L1
|
||||
|
||||
;; TODO - for racer-states
|
||||
(deftype joint-exploder-tuning (structure)
|
||||
((explosion uint64 :offset-assert 0)
|
||||
(duration uint64 :offset-assert 8)
|
||||
(gravity float :offset-assert 16)
|
||||
(rot-speed float :offset-assert 20)
|
||||
(fountain-rand-transv-lo vector :inline :offset-assert 32)
|
||||
(fountain-rand-transv-hi vector :inline :offset-assert 48)
|
||||
(away-from-focal-pt vector :inline :offset 32)
|
||||
(away-from-rand-transv-xz-lo float :offset 48)
|
||||
(away-from-rand-transv-xz-hi float :offset 52)
|
||||
(away-from-rand-transv-y-lo float :offset 56)
|
||||
(away-from-rand-transv-y-hi float :offset 60)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type int) _type_ 0)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x40
|
||||
:flag-assert #x900000040
|
||||
)
|
||||
|
||||
(deftype joint-exploder-static-joint-params (structure)
|
||||
((joint-index int16 :offset-assert 0)
|
||||
(parent-joint-index int16 :offset-assert 2)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x4
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
|
||||
(deftype joint-exploder-static-params (basic)
|
||||
((joints array :offset-assert 4) ;; an array of...what?
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x8
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
(deftype joint-exploder-joint (structure)
|
||||
((next int16 :offset-assert 0)
|
||||
(prev int16 :offset-assert 2)
|
||||
(joint-index int16 :offset-assert 4)
|
||||
(rspeed float :offset-assert 8)
|
||||
(mat matrix :inline :offset-assert 16)
|
||||
(rmat matrix :inline :offset-assert 80)
|
||||
(transv vector :inline :offset-assert 144)
|
||||
(prev-pos vector :inline :offset-assert 160)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xb0
|
||||
:flag-assert #x9000000b0
|
||||
)
|
||||
|
||||
(deftype joint-exploder-joints (basic)
|
||||
((num-joints int32 :offset-assert 4)
|
||||
(joint joint-exploder-joint :dynamic :offset 16)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
(:methods
|
||||
(new (symbol _type_ int) _type_ 0))
|
||||
)
|
||||
|
||||
(deftype joint-exploder-list (structure)
|
||||
((head int32 :offset-assert 0)
|
||||
(pre-moved? symbol :offset-assert 4)
|
||||
(bbox-valid? symbol :offset-assert 8)
|
||||
(bbox bounding-box :inline :offset-assert 16)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x30
|
||||
:flag-assert #x900000030
|
||||
)
|
||||
|
||||
(deftype joint-exploder (process-drawable)
|
||||
((die-if-below-y float :offset-assert 176)
|
||||
(die-if-beyond-xz-dist-sqrd float :offset-assert 180)
|
||||
(joints joint-exploder-joints :offset-assert 184)
|
||||
(static-params joint-exploder-static-params :offset-assert 188)
|
||||
(anim art-joint-anim :offset-assert 192)
|
||||
(scale-vector vector :inline :offset-assert 208)
|
||||
(tuning joint-exploder-tuning :inline :offset-assert 224)
|
||||
(lists joint-exploder-list 5 :inline :offset-assert 288)
|
||||
)
|
||||
:method-count-assert 29
|
||||
:size-assert #x210
|
||||
:heap-base #x1a0
|
||||
:flag-assert #x1d01a00210
|
||||
(:methods
|
||||
(dummy-20 (_type_) none 20)
|
||||
(dummy-21 (_type_) none 21)
|
||||
(dummy-22 () none 22)
|
||||
(dummy-23 () none 23)
|
||||
(dummy-24 (_type_) none 24)
|
||||
(dummy-25 () none 25)
|
||||
(dummy-26 (_type_) none 26)
|
||||
(dummy-27 (_type_) none 27)
|
||||
(dummy-28 () none 28)
|
||||
)
|
||||
)
|
||||
|
||||
(define-extern joint-exploder-init-by-other (function skeleton-group int joint-exploder-static-params joint-exploder-tuning none :behavior joint-exploder))
|
||||
|
||||
@@ -24,7 +24,9 @@ files_with_modifications = [
|
||||
"target-util",
|
||||
"ambient",
|
||||
"viewer",
|
||||
"sunken-obs"
|
||||
"sunken-obs",
|
||||
"cam-master",
|
||||
"default-menu"
|
||||
]
|
||||
|
||||
for file in files:
|
||||
|
||||
+4
-4
@@ -993,10 +993,10 @@
|
||||
)
|
||||
|
||||
;; definition for function master-switch-to-entity
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 166]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 176]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 196]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 220]
|
||||
;; Used lq/sq
|
||||
(defbehavior master-switch-to-entity camera-master ((arg0 entity))
|
||||
(local-vars
|
||||
|
||||
+2
-2
@@ -4653,5 +4653,5 @@
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for symbol *camera-base-mode*, type state
|
||||
(define *camera-base-mode* (the-as state cam-string))
|
||||
;; definition for symbol *camera-base-mode*, type (state camera-slave)
|
||||
(define *camera-base-mode* cam-string)
|
||||
|
||||
+25
-23
@@ -239,27 +239,29 @@
|
||||
)
|
||||
|
||||
;; definition for function cam-state-from-entity
|
||||
;; INFO: Return type mismatch (state camera-slave) vs state.
|
||||
(defun cam-state-from-entity ((arg0 entity))
|
||||
(let ((s5-0 (new 'stack 'curve)))
|
||||
(cond
|
||||
((not arg0)
|
||||
(the-as state #f)
|
||||
)
|
||||
((res-lump-struct arg0 'pivot structure)
|
||||
cam-circular
|
||||
)
|
||||
((res-lump-struct arg0 'align structure)
|
||||
cam-standoff-read-entity
|
||||
)
|
||||
((get-curve-data! arg0 s5-0 'campath 'campath-k -1000000000.0)
|
||||
cam-spline
|
||||
)
|
||||
((< 0.0 (cam-slave-get-float arg0 'stringMaxLength 0.0))
|
||||
*camera-base-mode*
|
||||
)
|
||||
(else
|
||||
cam-fixed-read-entity
|
||||
)
|
||||
(the-as state (cond
|
||||
((not arg0)
|
||||
(the-as (state camera-slave) #f)
|
||||
)
|
||||
((res-lump-struct arg0 'pivot structure)
|
||||
cam-circular
|
||||
)
|
||||
((res-lump-struct arg0 'align structure)
|
||||
cam-standoff-read-entity
|
||||
)
|
||||
((get-curve-data! arg0 s5-0 'campath 'campath-k -1000000000.0)
|
||||
cam-spline
|
||||
)
|
||||
((< 0.0 (cam-slave-get-float arg0 'stringMaxLength 0.0))
|
||||
*camera-base-mode*
|
||||
)
|
||||
(else
|
||||
cam-fixed-read-entity
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1273,10 +1275,10 @@
|
||||
|
||||
;; definition for function cam-standard-event-handler
|
||||
;; INFO: Return type mismatch none vs object.
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 7]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 31]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 45]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 50]
|
||||
;; Used lq/sq
|
||||
(defbehavior
|
||||
cam-standard-event-handler camera-slave
|
||||
|
||||
+3
-3
@@ -1967,9 +1967,9 @@
|
||||
)
|
||||
|
||||
;; definition for function anim-test-edit-sequence-list-handler
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 893]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 938]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 1045]
|
||||
;; Used lq/sq
|
||||
(defun anim-test-edit-sequence-list-handler ((arg0 int) (arg1 list-control))
|
||||
(local-vars
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
(define *dm-cam-mode-interpolation* (the-as debug-menu 0))
|
||||
|
||||
;; definition for function dm-cam-mode-func
|
||||
(defun dm-cam-mode-func ((arg0 uint) (arg1 int))
|
||||
(defun dm-cam-mode-func ((arg0 (state camera-slave)) (arg1 int))
|
||||
(if (and (= arg1 4) arg0)
|
||||
(send-event *camera* 'change-state arg0 *dm-cam-mode-interpolation*)
|
||||
)
|
||||
|
||||
+7
-7
@@ -290,13 +290,13 @@
|
||||
|
||||
;; definition for method 10 of type effect-control
|
||||
;; INFO: Return type mismatch int vs object.
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 205]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 217]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 237]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 343]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 364]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 450]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 469]
|
||||
;; Used lq/sq
|
||||
(defmethod
|
||||
dummy-10
|
||||
|
||||
+1
-1
@@ -162,7 +162,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 9 of type game-info
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 191]
|
||||
;; Used lq/sq
|
||||
(defmethod
|
||||
initialize!
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@
|
||||
|
||||
;; definition for function looping-code
|
||||
;; INFO: Return type mismatch none vs symbol.
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 2]
|
||||
(defun looping-code ()
|
||||
(while #t
|
||||
(suspend)
|
||||
|
||||
+2
-2
@@ -186,8 +186,8 @@
|
||||
|
||||
;; definition for function ecoclaw-handler
|
||||
;; INFO: Return type mismatch none vs object.
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 28]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 79]
|
||||
;; Used lq/sq
|
||||
(defbehavior
|
||||
ecoclaw-handler ecoclaw
|
||||
|
||||
+1
-1
@@ -281,7 +281,7 @@
|
||||
|
||||
;; definition for function baby-spider-default-event-handler
|
||||
;; INFO: Return type mismatch none vs object.
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 7]
|
||||
(defbehavior
|
||||
baby-spider-default-event-handler baby-spider
|
||||
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@
|
||||
|
||||
;; definition for function swamp-rat-default-event-handler
|
||||
;; INFO: Return type mismatch none vs object.
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 7]
|
||||
(defbehavior
|
||||
swamp-rat-default-event-handler swamp-rat
|
||||
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
|
||||
+2
-2
@@ -214,8 +214,8 @@
|
||||
|
||||
;; definition for function yakow-default-event-handler
|
||||
;; INFO: Return type mismatch none vs object.
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 52]
|
||||
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?. [OP: 54]
|
||||
(defbehavior
|
||||
yakow-default-event-handler yakow
|
||||
((arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
|
||||
+8709
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user