Commit graph

2655 commits

Author SHA1 Message Date
ManDude 5587593204
fps selection fixes i missed (#3109) 2023-10-30 19:55:16 +00:00
ManDude 99cb51ff57
[jak2] simplify fps disclaimer (#3108) 2023-10-30 18:17:11 +00:00
ManDude cd68cb671e
deftype and defmethod syntax major changes (#3094)
Major change to how `deftype` shows up in our code:
- the decompiler will no longer emit the `offset-assert`,
`method-count-assert`, `size-assert` and `flag-assert` parameters. There
are extremely few cases where having this in the decompiled code is
helpful, as the types there come from `all-types` which already has
those parameters. This also doesn't break type consistency because:
  - the asserts aren't compared.
- the first step of the test uses `all-types`, which has the asserts,
which will throw an error if they're bad.
- the decompiler won't emit the `heap-base` parameter unless necessary
now.
- the decompiler will try its hardest to turn a fixed-offset field into
an `overlay-at` field. It falls back to the old offset if all else
fails.
- `overlay-at` now supports field "dereferencing" to specify the offset
that's within a field that's a structure, e.g.:
```lisp
(deftype foobar (structure)
  ((vec    vector  :inline)
   (flags  int32   :overlay-at (-> vec w))
   )
  )
```
in this structure, the offset of `flags` will be 12 because that is the
final offset of `vec`'s `w` field within this structure.
- **removed ID from all method declarations.** IDs are only ever
automatically assigned now. Fixes #3068.
- added an `:overlay` parameter to method declarations, in order to
declare a new method that goes on top of a previously-defined method.
Syntax is `:overlay <method-name>`. Please do not ever use this.
- added `state-methods` list parameter. This lets you quickly specify a
list of states to be put in the method table. Same syntax as the
`states` list parameter. The decompiler will try to put as many states
in this as it can without messing with the method ID order.

Also changes `defmethod` to make the first type definition (before the
arguments) optional. The type can now be inferred from the first
argument. Fixes #3093.

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2023-10-30 03:20:02 +00:00
ManDude 09536c68ac
[compiler] asm-only disasm output + fix spacing bug (#3104) 2023-10-29 10:16:14 +00:00
Matt Dallmeyer 7c74b0c999
Fix starting continue point for Hub 2/3 category extensions (#3103) 2023-10-29 02:17:32 +01:00
OpenGOAL Bot 2ce7b36568
CI: Periodic Controller Database Update (#3101)
Co-authored-by: OpenGOALBot <OpenGOALBot@users.noreply.github.com>
2023-10-24 18:43:00 -04:00
Hat Kid c7c615a043
custom levels: refactor level building code and jak 2 support (#3090)
Co-authored-by: water <awaterford111445@gmail.com>
2023-10-21 06:07:43 +02:00
Tyler Wilding dccc3da1b3
formatter: rewrite and refactor, address more edge-cases, begin documenting my work (#3096) 2023-10-20 21:24:31 -04:00
Tyler Wilding 94603bce49
ci: Workaround CMake/Perl regression in recent windows-2022 images (#3097) 2023-10-20 21:06:12 -04:00
jabermony cdf13a92ec
Add label_types file merge for PAL version (#3086) 2023-10-20 01:40:24 -04:00
OpenGOAL Bot fcebf977f8
CI: Periodic Controller Database Update (#3091)
Co-authored-by: OpenGOALBot <OpenGOALBot@users.noreply.github.com>
2023-10-20 01:29:29 -04:00
Hat Kid 2c825ab7bf
jak2: add warning text when changing frame rate for the first time (#3092) 2023-10-17 18:29:02 +02:00
jabermony 95dca764fc
Fix build failure at llvm-rc on windows due to codepage error on zydis (#3088)
This fix is for the following error when building with llvm on windows

```
[build] llvm-rc: Error in VERSIONINFO statement (ID 1): 
[proc] The command: "C:\Program Files\CMake\bin\cmake.exe" --build C:/.../git/jak-project-test/out/build/Release --parallel 8 exited with code: 1
[build] Non-ASCII 8-bit codepoint (´┐¢) can't be interpreted in the current codepage
[build] ninja: build stopped: subcommand failed.
```

It's caused by llvm-rc not handling non 8-bit characters.
The same issue is discussed in the curl project here
https://github.com/curl/curl/issues/7765

This commit copies the fix from curl, replacing '©' with '(C)'.
2023-10-15 10:38:14 -04:00
Hat Kid e6b73f1058
custom levels: support for packing textures (#3089) 2023-10-15 16:36:14 +02:00
water111 ec23e6c5d9
[glb export] Export bones. (#3087)
![image](https://github.com/open-goal/jak-project/assets/48171810/0f26e77b-af68-4450-882e-762a501bdef4)
2023-10-14 16:49:23 -04:00
ManDude ae45037489
fix *jak1-full-game* being flipped (#3085) 2023-10-13 03:41:55 +01:00
Tyler Wilding 60eaac8051
decompiler: add texture merging feature (#3083) 2023-10-12 19:02:36 -04:00
Hat Kid 598ba1aaa3
jak3: add missing files and implement pexcw (#3084)
Some files were in the `banned_objects` list and were thus excluded from
the `all_objs` file.

Also implements the `pexcw` instruction which is only used in `hfrag`
code.
2023-10-12 18:07:37 -04:00
Aloqas ce1c2eb7c2
[jak1] Finnish base game strings (#3058)
Finnish translations for the remaining UI texts

---------

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2023-10-12 18:05:40 -04:00
Tyler Wilding 8b3b96761d
g/j2: Integrate highscores with Speedrun.com/JakSpeedruns.com when speedrunner mode is enabled (#3037) 2023-10-11 20:43:55 -04:00
water111 97e04a7612
[jak2] Fix collision renderer extract (#3081)
Fixes missing collision geometry reported in
https://github.com/open-goal/jak-project/issues/3011

The issue happens when there are 256 polygons. In this case `num-polys`
is 0 (it's a u8). There are actual cases where there are 0 polygons, so
we have to do a more complicated check to get the real count. I should
have done this in the first place, but it seemed to work...
2023-10-11 19:32:25 -04:00
Hat Kid 5be46c9852
decompiler: allow jak 3 texture and model extraction (#3080)
Added some hacks and stubs to allow extracting textures and models.
2023-10-11 19:32:12 -04:00
Hat Kid 6285c61662
decompiler: fix for v5 art group info dump, update taskfile for jak 3 (#3077) 2023-10-11 10:17:46 +02:00
water111 cfce5e5916
[decompiler] Support v5 data file link data (#3076)
Fix the implementation of `link_v5` so it works on "data" files for jak
3.
2023-10-10 21:56:03 -04:00
Hat Kid 5a6aab4fab
jak3: add goal_src skeleton (#3069) 2023-10-10 15:41:05 +02:00
Tyler Wilding 2adf440e3e
github: add issue template for jak 2 (#3073) 2023-10-09 19:41:41 -04:00
ManDude 27980218aa
[jak2] fix minor original game visual bugs (#3072)
Fixes #2994 the underport and consite icons being green (same color as
the goal, likely copy-pasta).

Fixes the hundredths timer in the race timer actually being a 60ths
timer.
2023-10-09 22:39:35 +01:00
ManDude 884f0ef6e3
[glow] potentially fix bad glow texture (#3071)
Might fix #3065 

fixes #3070
2023-10-09 14:16:13 +01:00
Hat Kid bf961a36f4
decompiler: some hacks to allow running decompiler on jak 3 v5 code files, improve all-types generation (#2526)
Co-authored-by: water <awaterford111445@gmail.com>
2023-10-07 22:14:12 +02:00
water111 5f8415320b
[jak2] new glow fix (#3067)
Fix a typo in the shader. (fixes
https://github.com/open-goal/jak-project/issues/3045, and fixes fadeout
when glows move offscreen on the bottom).

Also, try a different format for the depth blit, in an attempt to fix
this issue https://github.com/open-goal/jak-project/issues/3065.
2023-10-07 12:37:06 -04:00
water111 395c98db19
[goalc] Cleaned up speedups (#3066)
Started at 349,880,038 allocations and 42s

- Switched to making `Symbol` in GOOS be a "fixed type", just a wrapper
around a `const char*` pointing to the string in the symbol table. This
is a step toward making a lot of things better, but by itself not a huge
improvement. Some things may be worse due to more temp `std::string`
allocations, but one day all these can be removed. On linux it saved
allocations (347,685,429), and saved a second or two (41 s).
- cache `#t` and `#f` in interpreter, better lookup for special
forms/builtins (hashtable of pointers instead of strings, vector for the
small special form list). Dropped time to 38s.
- special-case in quasiquote when splicing is the last thing in a list.
Allocation dropped to 340,603,082
- custom hash table for environment lookups (lexical vars). Dropped to
36s and 314,637,194
- less allocation in `read_list` 311,613,616. Time about the same.
- `let` and `let*` in Interpreter.cpp 191,988,083, time down to 28s.
2023-10-07 10:48:17 -04:00
water111 af6f489657
[jak2] Set up extractor (#3042)
This sets up the extractor for jak 2. I was expecting that I'd have to
make some more significant changes to the decompiler/compiler path
stuff, but this was not the case!

The only real change is that you can now provide multiple ISO hashes for
an entry in `ISOMetadata`. This is needed for the two different NTSC
versions, which have the same configs, serials, and ELF hashes, but
slightly different contents.

I also didn't add the korean version because I don't have the info for
it.

---------

Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2023-10-06 23:09:09 -04:00
Hat Kid 3c27b3942b
decompiler: better automatic detection of art groups and joint-node-index macro detection (#3061) 2023-10-06 16:42:16 +02:00
OpenGOAL Bot 2d480a6df6
CI: Periodic Controller Database Update (#3060)
Co-authored-by: OpenGOALBot <OpenGOALBot@users.noreply.github.com>
2023-10-03 13:55:31 -04:00
ManDude 1338fed9c9
fix eco pickup time bug (#3056) 2023-10-02 01:22:05 +01:00
Tyler Wilding 42e3b7f89c
g/j2: don't force auto-save on in jak 2 when starting a speedrun (#3048) 2023-09-30 23:40:00 -04:00
dependabot[bot] 4731ae6e22
Bump actions/checkout from 3 to 4 (#3047)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-30 23:36:22 -04:00
ManDude dfeb88b35d
[jak2] fully implement *user* (#3046)
Fixes #1918
2023-10-01 04:28:30 +01:00
Matt Dallmeyer d149838485
fix draw-string-xy-scaled cropping (#3041)
fixes #3038 


https://github.com/open-goal/jak-project/assets/2515356/5b7a490f-e1fb-4a12-a3d9-b576a2c1d574
2023-10-01 00:17:50 +01:00
ManDude e130244271
[jak2] scalable debug font + fix debug menu widescreen bugs (#3044)
also hides empty (no commands) regions from the viewers by default now.
2023-09-30 21:19:47 +01:00
water111 0e31a9c407
[decompiler] Handle find-parent-method (#3018)
This change adds a few new features:
- Decompiler automatically knows the type of `find-parent-method` use in
jak 1 and jak2 when used in a method or virtual state handler.
- Decompiler inserts a call to `call-parent-method` or
`find-parent-state`
- Removed most casts related to these functions

There are still a few minor issues around this:
- There are still some casts needed when using `post` methods, as `post`
is just a `function`, and needs a cast to `(function none)` or similar.
It didn't seem easy to change the type of `post`, so I'm not going to
worry about it for this PR. It only shows up in like 3 places in jak 2.
(and 0 in jak 1)
- If "call the handler if it's not #f" logic should probably be another
macro.

Fixes #805
2023-09-30 11:06:09 -04:00
Matt Dallmeyer 0f3782128f
Remove dupe line in discord-rpc .clang-format (#3039) 2023-09-30 00:10:51 +01:00
ManDude 15fb677f5f
[jak2] un-mips2c draw-string (#3040)
It's not an asm function.
2023-09-30 00:07:55 +01:00
ManDude 1f4044b9ff
Jak 2 controller LED implementation (#3035)
Adds controller LED features to Jak 2:
- progressive flickering denoting health
- copies tomb simon says puzzle colors
- unique colors for each gun
- orange color for being indax
- yellow color for being in mech
- purple color for being darkjak
- blue color for being in board
- red flash when wanted.

May add more features later?

Also did some minor clean-up on some types.
2023-09-28 02:47:09 +01:00
ManDude 170cbd7e6c
misc low hanging fruit fixes (#3034)
Fixes #2235 
Fixes #2236 
Fixes #2963 
Fixes #3027
2023-09-27 00:59:07 +01:00
ManDude a662150327
[decompiler] do not use time-elapsed? on unsigned comps (#3031) 2023-09-26 18:48:13 +01:00
Hat Kid fc43870d85
decompiler: obj -> this, set-time! and time-elapsed? macros (#3026)
This renames the method object in `defmethod`s to `this` and adds
detection for the `set-time!` and `time-elapsed?` macros.

Definitely my biggest PR yet...
2023-09-26 15:17:00 +01:00
ManDude 9b60afe6e6
[compiler] fix compile_condition not attempting macro expansion (#3030)
Ancient bug! Resulted in a 1%-2% decrease in code object file size (and
more importantly the asm is more readable).

Fixes #3029
2023-09-25 23:49:12 +01:00
OpenGOAL Bot c695ef1393
CI: Periodic Controller Database Update (#3028)
Co-authored-by: OpenGOALBot <OpenGOALBot@users.noreply.github.com>
2023-09-25 17:44:21 -04:00
ManDude 1ff55d5015
fix (font-flags left) name + fix right flag not reflecting in debug text box (#3020)
Fixes #3016 
Fixes #3017
2023-09-24 03:00:09 +01:00