Jordan
427c952558
[Jak 2 and Jak 3]: Fixing menu text boundaries and drawing alignments for Automatic and Custom aspect ratios ( #4380 )
...
This PR fixes the alignment of text and other elements in several menus
of Jak 3 (as well as some of Jak 2) when using Automatic or Custom
aspect ratios. It also cleans up some of the relevant functions which
are used to draw these menus (although I'm still learning how to clean
goal code).
I mostly used french text for testing (since the french text seems to
push the font boundaries to their limits a bit more).
I used Automatic 16:9 and Custom 4:1 aspect ratios for testing to see if
my changes scale to other aspect ratios properly, comparing with PS2 4:3
for reference.
### Jak 3
### Image Color Scale
Before:
- The black/white color scale would get stretched (beyond the limits of
the menu in 4x1)
<img width="1280" height="758" alt="color-scale-16x9-broken"
src="https://github.com/user-attachments/assets/4b3b897e-1417-42da-86a1-dd78926ccb73 "
/>
<img width="1283" height="747" alt="color-scale-4x1-broken"
src="https://github.com/user-attachments/assets/44d192ba-5afe-43ae-9419-021123478a31 "
/>
Reference (PS2 4:3 in OpenGoal):
<img width="1278" height="773" alt="color-scale-reference"
src="https://github.com/user-attachments/assets/d9bd8f4e-8f69-49a9-8a99-3fcd3d7a4097 "
/>
After fixes:
<img width="1283" height="765" alt="color-scale-16x9-fixed"
src="https://github.com/user-attachments/assets/99422d7f-d688-4d91-8ce0-6ad0b7cb10df "
/>
<img width="1282" height="762" alt="color-scale-4x1-fixed"
src="https://github.com/user-attachments/assets/6011f30a-0c31-4ea9-afe1-735ec36f3d32 "
/>
### Secrets menu
Before:
- The secret titles touch their costs (#4233 ).
- The alignment of the top line showing orbs available/cost and total
orbs collected is broken (more noticeable in 4:1)
- The alignment of the titles for groups of secrets is broken (more
noticeable in 4:1)
- The indentation for secret titles relative to the group of secrets is
also broken (again, more noticeable in 4:1)
<img width="1286" height="758" alt="secrets-broken-16x9"
src="https://github.com/user-attachments/assets/bd6c7dab-ce95-4349-bf1d-2a09f82fcbfe "
/>
<img width="1287" height="751" alt="secrets-broken-4x1"
src="https://github.com/user-attachments/assets/3e1ce842-19ba-49b3-92f9-52034ae1982f "
/>
Reference (PS2 4:3 in OpenGoal):
<img width="1280" height="761" alt="Screenshot from 2026-08-16 22-58-22"
src="https://github.com/user-attachments/assets/7326a1c7-b479-4fb7-9450-377a05ab7963 "
/>
After fixes:
<img width="1280" height="722" alt="secrets-fixed-16x9"
src="https://github.com/user-attachments/assets/0a66d45f-3aa3-4cc8-ac88-c6aef20f1319 "
/>
<img width="1286" height="713" alt="secrets-fixed-4x1"
src="https://github.com/user-attachments/assets/e8740739-42ac-4a12-aad1-e6620dfc73ed "
/>
### Secrets purchase menu
Before:
- The text for the secret you're purchasing can get cut off if too big.
- As before, the top line showing orb cost/orbs collected is misaligned.
<img width="1288" height="754" alt="secrets-purchase-broken-16x9"
src="https://github.com/user-attachments/assets/49b709e3-c015-42ba-b0aa-034769286d77 "
/>
<img width="1281" height="756" alt="secrets-purchase-broken-4x1"
src="https://github.com/user-attachments/assets/0c3c5e02-048a-4188-ada7-2413c384224b "
/>
Reference (PS2 4:3 in OpenGoal):
<img width="1286" height="753" alt="secrets-purchase-reference"
src="https://github.com/user-attachments/assets/bb0b1d1a-87f6-4343-8a82-2e1f968943cd "
/>
After fixes:
<img width="1286" height="759" alt="secrets-purchase-fixed-16x9"
src="https://github.com/user-attachments/assets/1d73593f-1d58-407e-9ce6-2da5bf0fd84b "
/>
<img width="1283" height="750" alt="secrets-purchase-fixed-4x1"
src="https://github.com/user-attachments/assets/85c7e14d-c6b2-4b21-83e5-173af5cba185 "
/>
### Save/Load/Create Hero Mode Save menu
Here I show the load game screen only but the bugs were the same among
all 3 as the code is shared. The fixes apply to all 3 as well 😃
Before:
- The header text is cut off in french.
- There is a faint red rectangle to the right of the menu (look closely!
It's a bit clearer and goes beyond the menu in 4x1).
- The left yellow boxes around the save-games that are not selected do
not scale properly (more noticeable in 4x1).
<img width="1284" height="749" alt="load-broken-Automatic"
src="https://github.com/user-attachments/assets/2ae3bd8b-42ec-49bc-9851-cbaace4ce64b "
/>
<img width="1285" height="751" alt="load-broken-4x1"
src="https://github.com/user-attachments/assets/655de844-748c-43f9-a2e8-d779fe3a8e19 "
/>
Reference (PS2 4:3 in OpenGoal):
<img width="1281" height="762" alt="load-screen-4x3"
src="https://github.com/user-attachments/assets/e4e320c9-999a-44a7-8b3e-34cfdbeef5a1 "
/>
After Fixes:
- Now headers that exceed the width of the menu screen will be shrunken
down to fit. This will hopefully work for any other menus that need it
as well 😃
- No more red rectangle on the right, and the yellow box to the left
around the save games scales properly.
<img width="1286" height="754" alt="load-fixed-automatic"
src="https://github.com/user-attachments/assets/1a48d811-5684-4f7e-a12a-19e896e30b48 "
/>
<img width="1288" height="749" alt="load-fixed-4x1"
src="https://github.com/user-attachments/assets/f5a68cb1-576a-4927-977b-b3419aaf7c23 "
/>
### Missions menu
Before:
- Mission text is sometimes cut off on the right
- Mission text is shifted to the right (more noticeable in 4x1)
<img width="1286" height="753" alt="missions-alignment-broken-16x9"
src="https://github.com/user-attachments/assets/37175eb7-e191-4c09-bb72-b40819acd99b "
/>
<img width="1281" height="750" alt="missions-alignment-broken-16x9-2"
src="https://github.com/user-attachments/assets/482f351a-7386-4211-8434-cf60c0691fdb "
/>
<img width="1286" height="756" alt="missions-broken-4x1"
src="https://github.com/user-attachments/assets/4cbfa4d0-999b-4265-bed0-957958663037 "
/>
<img width="1290" height="750" alt="missions-broken-4x1-2"
src="https://github.com/user-attachments/assets/4889b498-d6aa-4e6c-87fc-4dfadeac5827 "
/>
Reference (PS2 4:3 in OpenGoal):
<img width="1284" height="768" alt="missions-reference-1"
src="https://github.com/user-attachments/assets/91a526c8-08c2-4a62-8219-09e967fab9c2 "
/>
<img width="1276" height="755" alt="missions-reference-2"
src="https://github.com/user-attachments/assets/65c4e944-5b1f-479a-bf7c-eca19c81f5d6 "
/>
After:
<img width="1281" height="760" alt="missions-fixed-16x9"
src="https://github.com/user-attachments/assets/a972daf0-1872-46f0-a829-cd8d292df1d6 "
/>
<img width="1282" height="750" alt="missions-fixed-16x9-2"
src="https://github.com/user-attachments/assets/973611d6-a72c-43f8-b2f3-034e83f6c416 "
/>
<img width="1289" height="760" alt="missions-alignment-fixed-4x1"
src="https://github.com/user-attachments/assets/699c5dbc-8c39-468d-9e14-94007a789e48 "
/>
<img width="1281" height="755" alt="missions-alignment-fixed-4x1-2"
src="https://github.com/user-attachments/assets/89216187-d453-4d3e-8e8b-5ae365e7227d "
/>
### Jak 2
### Secrets menu orb icon
Position was wrong in Automatic and some (but strangely, not all) Custom
Aspect ratios. A correction for the aspect ratio was also being applied
in the setter.
Before:
<img width="1284" height="755" alt="image"
src="https://github.com/user-attachments/assets/0a15e238-1d98-4ba7-86ce-b295e8d78d7a "
/>
After:
<img width="1283" height="755" alt="image"
src="https://github.com/user-attachments/assets/bd97de44-ef41-426c-a76f-d4fe99a35285 "
/>
### Missions menu
- Indentation was not working, even in 4:3, due to a typo.
- Width was broken in Automatic and Custom
Before:
<img width="1281" height="753" alt="Screenshot from 2026-08-19 01-05-54"
src="https://github.com/user-attachments/assets/6f5e3cc4-3522-45a5-a45b-34a46a7db544 "
/>
After:
<img width="1287" height="761" alt="image"
src="https://github.com/user-attachments/assets/cae5498b-6ca4-40ab-a31c-feb8899bc1e7 "
/>
2026-08-28 16:42:47 +02:00
water111
637990314b
wip: better stack var support ( #4222 )
...
Closes #736
---------
Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com >
2026-04-19 00:14:44 +02:00
Hat Kid
c61a69d751
jak3: wip pc progress code ( #3898 )
2025-04-16 20:57:43 +02:00
water111
48cb9bb787
[decompiler] as-type and font method support ( #3855 )
...
Add support for `as-type` macro, and detecting inline font methods. This
works in all three games but I've only updated jak 3's goal_src for now.
Eventually I will go back and work through the others, but I want to get
more decompiler features in first.

---------
Co-authored-by: water111 <awaterford1111445@gmail.com >
2025-02-01 21:23:11 -05:00
water111
7348e6a4ff
[decompiler] Update vector ops, reduce casts ( #3849 )
...
Update the decompiler to use the new vf macros.
Also, fix a bunch of silly casting issues where accessing inline fields
with an offset of 0 would be better than a cast:

---------
Co-authored-by: water111 <awaterford1111445@gmail.com >
2025-01-20 16:32:58 -05:00
water111
3ee2b4423c
[decompiler] Cleanup for Jak 3 ( #3845 )
...
This PR does a few cleanups:
- improve method names/comments/flags for `enemy.gc` and a few other
files
- fix `new-stack-matrix0` not working for jak 3
- add `matrix-copy!` detection for jak 3
- add `vector-copy!` detection
---------
Co-authored-by: water111 <awaterford1111445@gmail.com >
2025-01-20 10:31:29 -05:00
Hat Kid
51d008f9ab
decompiler: detect and turn inverse mult to div ( #3795 )
...
Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com >
2024-12-07 23:10:49 +01:00
Hat Kid
6a06291e6e
jak1, jak2: add get-texture macro ( #3778 )
...
Ports the `get-texture` macro added in Jak 3 to Jak 1 and 2.
2024-11-26 11:29:34 +01:00
Hat Kid
af5cb9b1cb
jak3: subtitle3, vag-player ( #3758 )
2024-11-12 02:45:16 +01:00
Hat Kid
7053090541
jak3: decomp bigmap, blit-displays, fix progress crash ( #3657 )
...
`bigmap` and `blit-displays` mostly work. `blit-displays` is still
missing all of the special effects that were added in Jak 3 (brightness
and contrast settings, screen blur effect, etc.).
`bigmap` is missing the player marker texture (`hud-target-marker`) for
some reason, it's part of `tpage-17` which is coming from
`progress-minimap` and should already be included. The icons also
currently stretch when using aspect ratios other than 4:3.
The progress menu now also works for the most part. The draw order is a
bit messed up because some code was initially drawing things with the
ocean bucket, which was changed to use `hud-draw-hud-alpha` instead for
now. The texture for the volume and brightness/contrast sliders still
looks wrong.
Fixes #3653
Fixes #3656
2024-09-07 14:18:30 +02:00
Hat Kid
bc66d416b4
decompiler: call-parent-state-handler and suspend-for macros ( #3625 )
...
Also fix `hud-draw-pris2` bucket in Jak 3 to make subtitles work and
foreground HUD envmap.
2024-09-04 19:35:54 +02:00
Hat Kid
58a5440c8a
decomp3: more misc files ( #3466 )
...
Makes a bunch of missions mostly playable, including:
- `arena-training-1`
- `arena-fight-1`
- `wascity-chase`
- `arena-fight-2`
- `arena-fight-3`
- `volcano-darkeco`
- `desert-hover`
- `nest-eggs`
- `temple-climb`
- `temple-oracle`
- `temple-tests`
- `desert-beast-battle`
- `desert-turtle-training`
- `desert-course-race`
- `desert-artifact-race1`
- `wascity-leaper-race`
- `wascity-pre-game`
- `sewer-met-hum`
- `forest-kill-plants`
- `forest-ring-chase`
- `temple-defend`
- `tower-destroy`
- `desert-glide`
---
Files:
- `ripple`
- `waswide-mood`
- `sig-rider`
- `nst-tasks`
- `nst-part`
- `nst-gas`
- `nst-eggs-h`
- `nst-obs`
- `nst-mood`
- `egg-spider`
- `wasdoors-init`
- `wasall-tasks`
- `wvehicle-race`
- `wcar-marauder`
- `wcar-marauder-b`
- `turret-control`
- `was-squad-control`
- `turtle-training`
- `kleever-rider`
- `course-race`
- `artifact-race`
- `desert-hover`
- `desbeast-path-h`
- `des-beast`
- `desertg-obs`
- `desertf-obs`
- `desertd-obs`
- `desert-dust-storm`
- `des-cactus`
- `race-hud`
- `race-info`
- `race-manager`
- `tizard`
- `flyingsaw`
- `hover-training`
- `temple-mood`
- `temple-obs`
- `temple-obs2`
- `temple-part`
- `temple-scenes`
- `templex-mood`
- `templex-obs`
- `templex-part`
- `tomb-baby-spider`
- `target-turret-shot`
- `target-turret`
- `beast-battle-path`
- `des-beast-2`
- `mh-flyer`
- `scorpion-gun`
- `hover-enemy-h`
- `hover-enemy`
- `hover-formation-h`
- `hover-formation`
- `hover-nav-control-h`
- `hover-nav-control`
- `flamer-hover`
- `hover-nav-templea`
- `robo-hover`
- `hover-nav-sewb`
- `hover-nav-sewg`
- `hover-nav-sewj`
- `hover-nav-sewl`
- `hover-nav-sewo`
- `hover-nav-towera`
- `tower-mood`
- `tower-obs`
- `tower-scenes`
- `tower-part`
- `eco-green-collider`
- `forest-bridges`
- `forest-kill-plants`
- `forest-mood`
- `forest-ring-chase`
- `forest-tasks`
- `forest-part`
- `foresta-obs`
- `hover-nav-foresta`
- `mh-plant`
- `dp-bipedal-part`
- `dp-bipedal-shot`
- `dp-bipedal`
- `neo-spawner`
- `for-turret`
- `for-turret-shot`
- `neo-wasp`
- `neo-wasp-part`
- `volcanox-scenes`
- `volcanox-mood`
- `volcano-scenes`
- `volcano-mood`
- `volcano-obs`
- `volcano-obs2`
- `chain-physics`
- `rigid-body-plat`
- `volcano-part`
- `flamer-lava`
- `flitter`
- `spiky-frog`
- `flut-wild`
- `target-indax`
- `target-indax-hang`
- `mantis`
- `volcanox-obs`
- `spyder`
- `wcar-faccar`
- `mhcity-obs2`
- `mhcity-part`
- `mhcity-obs`
- `dm-mine-spider`
- `rapid-gunner`
- `stadium-mood`
- `stadium-scenes`
- `stadiuma-mood`
- `stadiuma-part`
- `kanga-lizard`
- `marauder`
- `arena-scenes`
- `wasstada-mood`
- `wasstada-obs`
- `wasstada-part`
- `wasstadb-obs`
- `wasstadc-obs`
- `dm-flyer`
- `maker-part`
- `maker-projectile`
- `skeet-part`
- `wascity-turret`
- `wasgun-h`
- `wasgun-hud`
- `wasgun-manager`
- `nav-graph-h`
- `traffic-engine-h`
- `waswide-init`
- `cty-borrow-manager-h`
- `cty-borrow-manager`
- `desert-part`
- `height-map-h`
- `height-map`
- `traffic-height-map`
- `vehicle-control`
- `hvehicle-h`
- `hvehicle`
- `hvehicle-effects`
- `hvehicle-physics`
- `hvehicle-util`
- `glider-h`
- `glider-hud`
- `glider-manager`
- `glider-ring`
- `glider-ring-part`
- `h-glider`
- `hanga-init`
- `was-pre-game`
- `was-leaper-race`
- `flut-racer`
- `desert-scenes`
- `desert-lizard-h`
- `desert-lizard-task`
- `desert-lizard`
- `throne-scenes`
- `waspal-mood`
- `waspala-obs`
- `waspala-part`
- `deswalk-obs`
- `deswalk-part`
- `terraformer-drone`
- `terraformer-head`
- `terraformer-part`
- `terraformer-setup`
2024-04-22 18:43:51 +02:00
Hat Kid
36f1592b90
decomp3: lightning renderer, nav code, texture remap, fix progress menu crash ( #3461 )
...
Also adds:
- BLERC
- Minimap (with missing texture for the map, sprites work)
- Eco Mine files
- Precursor robot boss files
- Sewer files
- Vehicle files
2024-04-12 18:44:38 -04:00
water111
ffe01a352d
Decompile level ( #3433 )
2024-03-23 13:03:01 -04:00
Hat Kid
99866cec88
decomp3: more engine files, get-texture macro, use print method in autogenerated inspect, fix bitfield float print ( #3432 )
...
- `fma-sphere`
- `prim-beam-h`
- `cam-start`
- `ragdoll`
- `light-trails-h`
- `light-trails`
- `menu`
- `water`
- `water-flow`
- `hud`
- `hud-classes`
- `progress`
- `progress-draw`
---
The `get-texture` macro replaces calls to `lookup-texture-by-id` and
`lookup-texture-by-id-fast`. The `defpart` macro detection was modified
to print a pair like `(texture-name tpage-name)` for the texture field
that gets turned into a `texture-id` constant. Only used in Jak 3 at the
moment, I'll probably go through the other games at a later point.
2024-03-23 09:25:11 -04:00
water111
13def9a8b2
Decompile foreground and bones ( #3427 )
...
Small fix to decompiler when the original compiler uses `ra` register.
This seems to happen in "normal" code very rarely - perhaps they
manually specified this in an `rlet`.
Start figuring out buckets/textures for Jak 3.
The foreground code is not yet modified for PC - I want to wait until
the game is running, since it is too hard to do it now.
2024-03-16 14:50:41 -04:00
Hat Kid
2969833b2d
decomp3: more engine stuff, detect non-virtual state inheritance ( #3377 )
...
- `speech`
- `ambient`
- `water-h`
- `vol-h`
- `generic-obs`
- `carry-h`
- `pilot-h`
- `board-h`
- `gun-h`
- `flut-h`
- `indax-h`
- `lightjak-h`
- `darkjak-h`
- `target-util`
- `history`
- `collide-reaction-target`
- `logic-target`
- `sidekick`
- `projectile`
- `voicebox`
- `ragdoll-edit`
- most of `ragdoll` (not added to gsrc yet)
- `curves`
- `find-nearest`
- `lightjak-wings`
- `target-handler`
- `target-anim`
- `target`
- `target2`
- `target-swim`
- `target-lightjak`
- `target-invisible`
- `target-death`
- `target-gun`
- `gun-util`
- `board-util`
- `target-board`
- `board-states`
- `mech-h`
- `vol`
- `vent`
- `viewer`
- `gem-pool`
- `collectables`
- `crates`
- `secrets-menu`
Additionally:
- Detection of non-virtual state inheritance
- Added a config file that allows overriding the process stack size set
by `stack-size-set!` calls
- Fix for integer multiplication with `r0`
- Fixed detection for the following macros:
- `static-attack-info`
- `defpart` and `defpartgroup` (probably still needs adjustments, uses
Jak 2 implementation at the moment)
- `sound-play` (Jak 3 seems to always call `sound-play-by-name` with a
`sound-group` of 0, so the macro has been temporarily defaulted to use
that)
One somewhat significant change made here that should be noted is that
the return type of `process::init-from-entity!` was changed to `object`.
I've been thinking about this for a while, since it looks a bit nicer
without the `(none)` at the end and I have recently encountered init
methods that early return `0`.
2024-03-03 15:15:27 -05:00
Hat Kid
406441038b
decomp3: game-info, game-task, game-save, level-info, process-drawable and more ( #3374 )
...
- `settings`
- `generic-vu1`
- `generic-vu0`
2024-02-15 11:16:07 +00:00
Hat Kid
a4e629ebf9
decompiler: defskelgroup macro detection for jak 3, fix art group dumping for jak 3 and some more decomp work ( #3370 )
...
- `transformq`
- `wind-work`
- `progress-static`
- `merc-vu1`
- `emerc-vu1`
- `merc`
- `emerc`
- `cloth-h`
- Most of `cloth`, not added to gsrc yet
Art group dumps were incorrect for Jak 3 because the master art group
fields were at different offsets.
2024-02-11 09:32:06 -05:00
Hat Kid
9e8bee5b42
decomp3: more headers (again) ( #3362 )
...
- `entity-h`
- `eye-h`
- `simple-sprite-h`
- `sprite-h`
- `cam-debug-h`
- `cam-update-h`
- `cam-interface-h`
- `hud-h`
- `actor-link-h`
- `camera-h`
- `progress-h`
Also fills out a lot of the `text-id` enum. `progress-static` is also
very close to ready, only being blocked by #3361 .
2024-02-03 11:39:29 -05:00