GitHub Hot Board

GitHub Hot Board · Repository archive

HayatoG/gr2_pc

Native PC port (Linux/Windows) of Gravity Rush 2 (PS4, CUSA03694) — runs your own game dump; no game or firmware files included. Bilingual launcher (English/Portuguese). | Port nativo para PC de Gravity Rush 2 — usa o seu próprio dump. (This description comes from the repository itself.)

Data at October 25HayatoG

Best

#30

Underappreciated Gems

100

Total stars

7

Total forks

1

Days on boards (30d)

Project statusLicense: unknownLast push: unknownOpen issues: unknown

Collected since 2026-10-25; unknown = not yet harvested

Put your badge on the README · HayatoG/gr2_pc[![Put your badge on the README](https://git.vaiox.xyz/api/badge/HayatoG/gr2_pc.svg)](https://git.vaiox.xyz/en/repo/HayatoG/gr2_pc)
<a href="https://git.vaiox.xyz/en/repo/HayatoG/gr2_pc"><img src="https://git.vaiox.xyz/api/badge/HayatoG/gr2_pc.svg" alt="Put your badge on the README" height="20"></a>

README

Gravity Rush 2 — port nativo para PC

English below · Download · YouTube · Discord

Build

Como portar jogos de PS4 — vídeo no YouTube

▶️ Vídeo tutorial: como portar jogos de PS4 para o PC

Gravity Rush 2 (PS4, CUSA03694, update 01.11) rodando no PC com imagem, som e controle, a 30 FPS estáveis e sem emulador de CPU. O código original do jogo roda nativo no processador. O sistema do PS4 é reimplementado, e a GPU é traduzida para Vulkan. Usa o mesmo núcleo do port de The Last Guardian, também da Japan Studio.

Nenhum arquivo do jogo vem com este projeto. Para jogar, você precisa da sua própria cópia, tirada do seu PS4.

Por HayatoG · YouTube @hayatog-dev · Discord discord.gg/UMkdMYZh9g

Tela de título Menu de pausa
Kat nas ruínas Gameplay com legenda em português
Cena em quadrinhos: a capitã Cena em quadrinhos: Kat acorda

Navios voadores da vila de mineradores

Capturas na resolução nativa (1920×1080), direto da GPU, no Linux com uma RTX 2060, com o jogo em português.

Novidades

  • Mouse: o mouse gira a câmera (analógico direito) e os botões viram botões do controle: esquerdo = R1 (mudança de gravidade: mire com a câmera e clique), direito = L1 (cancela a mudança), do meio = R2 (campo de estase). Segurando Ctrl esquerdo (ou o botão lateral X1), o mouse vira um dedo no touchpad. A janela prende o mouse; Esc solta e um clique prende de novo. Veja Mouse.
  • Correções do tradutor de shaders vindas do inFAMOUS: atomics de float min/max com um só atomic inteiro, S_WQM_B64 (GR2_WQM, ligado), barreiras de LDS e divergência de lanes (GR2_LDS_SMALL, GR2_LDS_MULTI, GR2_LDS_READLANE, GR2_LANE_DIVERGENCE; desligadas por padrão no GR2, como no inFAMOUS fora dele), wave64 no tamanho de subgrupo em que o pipeline roda, e o catálogo de correções GR2_BP01–GR2_BP12 (aba Desempenho → Correções do menu Insert). O cache de shaders se refaz sozinho.
  • Processadores Intel: o jogo não fecha mais logo no começo (instrução ilegal, 0xc000001d). O processador do PS4 tem o SSE4A da AMD, que nenhum Intel tem, e o eboot.bin usa 96 EXTRQ. Agora o port reescreve essas instruções e as emula (junto com MOVBE, BMI1 e LZCNT, se faltarem) quando o processador não as tem. Em CPUs Ryzen nada muda.
  • Launcher bilíngue (português e inglês, automático ou escolhido), com o idioma do jogo (voz e texto) escolhido ali.
  • Linhas pretas: o contorno do geometry shader com adjacência, que gerava os traços pretos perto dos personagens, fica desligado por padrão (docs/BUG_LINHAS_PRETAS.md, #1).
  • Sensor de movimento: o giroscópio do DualShock 4/DualSense funciona direto. Em controles sem sensor, um toque em Share (ou L3+R3) liga o "modo sensor": o analógico esquerdo inclina o controle e X/A sacode. No teclado, T/G inclinam e Y sacode.
  • Analógicos: zona morta de 10% contra drift (TLG_STICK_DEADZONE), e o último controle usado é o que vale.
  • Touchpad sem touchpad: segure View/Select (ou Tab) e mova o analógico direito (ou as setas) para deslizar o dedo; um toque rápido continua sendo clique.
  • Desempenho: o FPS não cai mais com o tempo (as variantes de shader agora se repetem), e transições parciais de imagem repetidas são puladas.
  • Cache de shaders automático: fica em user/cache/, junto dos saves (em Linux e Windows; o cache antigo de ~/.local/share/shadPS4 ou user/user/ é trazido sozinho na primeira partida). A pasta leva a versão do tradutor de shaders, e o cache antigo é apagado sozinho depois de uma atualização. Para recompilar tudo, o launcher tem o botão Limpar cache de shaders (ou ./run_gr2.sh --clear-shader-cache); ele apaga só os shaders compilados deste jogo, nunca saves ou configurações.

Status

Área Estado
Boot, abertura com créditos e legendas ✅ Funciona
Título, menu e gameplay ✅ 30 FPS, 1080p nativo
Áudio ✅ Com o libSceNgs2.sprx do firmware do seu console + Audio3d reimplementado
Idioma ✅ Escolhido no launcher (legendas e menus em português testados)
Controle ✅ DualSense, DualShock 4, Xbox e 8BitDo via SDL3; sensor de movimento real ou simulado e touchpad simulado
Linhas pretas perto dos personagens 🔧 Contorno do geometry shader desligado por padrão (#1)
Saves e mundo aberto ⏳ Testando (#6)
Linux ✅ Testado (Nobara/Fedora 44)
Windows 🧪 Build automático, ainda sem teste em jogo (#5)
macOS (Apple Silicon) 📋 Planejado (#5)

Desempenho de uma sessão de 5 minutos

FPS, pior quadro e draws por quadro a cada 5 s, tirados do log do port (TLG_FRAME_STATS=1). Gerado por scripts/session_chart.py.

Download

A última versão é gerada pelo GitHub Actions a cada mudança; as anteriores ficam em Releases como histórico:

  • Linux x86-64 (glibc 2.39+: Ubuntu 24.04, Fedora 40, SteamOS 3.6 ou mais novos): gr2-linux-x86_64.tar.gz
  • Windows 10/11 64 bits: gr2-windows-x86_64.zip

Arquivos do jogo necessários

Tudo vem do seu PS4 (GoldHEN + Itemzflow). Nada disso vai no download. Use Gravity Rush 2 CUSA03694 (EUA) com o update 01.11, montado numa pasta só, com o jogo base e o update por cima. São ~28 GB.

Arquivo Vem de Tamanho Para quê
eboot.bin update 01.11 28 MB o código do jogo (tem que ser o do 1.11)
sce_module/libc.prx, libSceFios2.prx, libSceJobManager.prx jogo base 1,7 MB bibliotecas do próprio jogo
sysdata/libSceSecure.prx jogo base pequeno criptografia do próprio jogo
sce_sys/ (param.sfo, playgo-chunk.dat, icon0.png, pic1.png) base + update ~5 MB metadados, instalação e a arte do launcher
Gravite2_Chunk0.psarc, Gravite2_Chunk1.psarc jogo base 10 + 15,8 GB conteúdo principal
Gravite2_Patch_Chunk0.psarc, Gravite2_Patch_Chunk1.psarc update 01.11 0,5 + 1,6 GB correções do update
sce_discmap.plt, sce_discmap_patch.plt update 01.11 pequenos mapa de arquivos

Do firmware do console (opcional, para ter som): libSceNgs2.sprx, de /system/common/lib/ do seu PS4. Ele vai na pasta system_lib/ ao lado do executável. Ainda é necessário: o áudio sem esse arquivo está em #8.

Como montar a pasta:

  1. No Itemzflow, faça o dump do jogo (CUSA03694) e do update (CUSA03694-patch) para um pendrive exFAT.
  2. No PC, copie a pasta do jogo base e depois copie o conteúdo do update por cima, substituindo os arquivos. Também dá para usar scripts/make_game_view.py <base> <update> <saída>, que monta a pasta com links, sem ocupar espaço.
  3. Confira os tamanhos. Arquivos acima de 4 GB vindos pelo FTP do GoldHEN 2.2 chegam cortados, então use o pendrive.

A lista completa, que também vai nas notas de cada Release, está em docs/ARQUIVOS_NECESSARIOS.md.

Como jogar

  1. Extraia o pacote e coloque o libSceNgs2.sprx na pasta system_lib/.
  2. Abra o Gravity Rush 2, escolha a pasta do jogo e o idioma do jogo (e, se quiser, o da interface), e clique em Jogar.
  3. No jogo, F10 liga o contador de FPS, e Insert (ou R3 + L2 no controle) abre o menu do port.

Variáveis de ambiente do port usam o prefixo GR2_ (o nome antigo TLG_ continua valendo; se os dois estiverem definidos, vale o GR2_). GR2_ISA_REWRITE controla a reescrita de instruções que o processador não tem: sem definir, só as que faltam (SSE4A em qualquer Intel); 0 nunca reescreve; 1 força todas (MOVBE, BMI1, LZCNT e SSE4A, para testar a emulação num Ryzen); ou uma lista, como sse4a ou movbe,bmi1. O log mostra ISA: CPU lacks ... ou ISA: forced rewrite of N sites.

Mouse

O mouse funciona com ou sem controle (os botões dele somam aos do controle). A janela do jogo prende o mouse enquanto tem o foco e o menu Insert está fechado; Esc solta (o cursor volta) e um clique na janela prende de novo (esse clique não vira botão do jogo).

Mouse No jogo (Gravity Rush 2)
Mover gira a câmera (analógico direito)
Botão esquerdo R1: mudança de gravidade (mire com a câmera e clique para cair naquela direção)
Botão direito L1: cancela a mudança de gravidade
Botão do meio R2: campo de estase (pegar objetos)
Botões laterais X1 / X2 e rodinha livres (veja GR2_KEY_MAP); X1 também é a tecla do modo touchpad

Modo touchpad: segure Ctrl esquerdo ou o botão lateral X1. A câmera para e o mouse leva um dedo virtual pelo touchpad (um quadradinho no canto inferior esquerdo mostra onde ele está): esquerdo toca/clica (arrastar desliza), do meio toca sem clicar, direito = dois dedos.

Variáveis (GR2_ e TLG_ valem igual; mouse_* também ficam no tlg.ini e na aba Controle do menu Insert):

Variável Padrão O que faz
GR2_MOUSE 1 0 desliga o mouse (a janela não prende mais)
GR2_MOUSE_SENS 1.0 sensibilidade da câmera (0,05–10)
GR2_MOUSE_INVERT_Y 0 1 inverte o eixo Y
GR2_MOUSE_SMOOTHING 0.5 suavização (0–0,95)
GR2_MOUSE_ACCEL 0 aceleração (0–2)
GR2_MOUSE_DEADZONE 0.1 anti-zona morta: movimentos pequenos pulam a zona morta do jogo (0–0,5)
GR2_MOUSE_PAD 1 0 desliga o modo touchpad do mouse
GR2_MOUSE_PAD_KEY Left Ctrl|Mouse X1 tecla(s) do modo touchpad
GR2_MOUSE_PAD_MODE hold toggle: um toque liga, outro desliga
GR2_KEY_MAP — remapeia teclas e mouse: "square=Mouse Left|E,r1=Mouse X2,l1=Wheel Down"; none tira todos
GR2_MOUSE_LOG 0 1 mostra no log o que o jogo recebe do mouse

Solução de problemas

Device lost during submit (o jogo fecha com código 23 depois de um tempo, mais visto no Windows): a placa ficou presa num shader e o sistema reiniciou a GPU (no Windows, o TDR depois de ~2 s). A causa mais comum é um laço de shader que termina no PS4 mas não no PC. Desde esta versão, todo laço de shader tem um limite de voltas: GR2_LOOP_LIMIT_PER_LOOP (padrão 8192 por laço, contado de novo a cada vez que o laço começa) e GR2_LOOP_LIMIT (padrão 262144 no total por execução do shader). Quando passa do limite, o laço é interrompido, e no pior caso um quadro sai errado em vez de o jogo fechar. Se ainda cair, tente valores menores (GR2_LOOP_LIMIT_PER_LOOP=2048); se algum efeito aparecer cortado (reflexo, sombra ou partícula incompleta), tente valores maiores. 0 desliga: GR2_LOOP_LIMIT=0 desliga os dois limites, e GR2_LOOP_LIMIT_PER_LOOP=0 só o de cada laço. O log mostra os valores em uso (tlg: shader loop budget ...), e o cache de shaders é refeito sozinho quando eles mudam.

Windows: proteção da red zone. O código do PS4 guarda variáveis nos 128 bytes abaixo do rsp (a "red zone"), e o Windows escreve ali a cada exceção (o port usa exceções para acompanhar a memória da GPU), o que no inFAMOUS derrubava o jogo em pontos aleatórios. Na partida o port reescreve as instruções de memória das funções que usam a red zone para rodarem com o rsp 128 bytes mais baixo (vem do inFAMOUS, iss_pc #29/#41). Vem ligada no Windows; GR2_RED_ZONE_REWRITE=0 desliga e GR2_RED_ZONE_REWRITE=1 liga no Linux (teste). Teste no Linux: TLG_CLOBBER_RED_ZONE=<bytes> apaga essa quantidade de bytes abaixo do rsp a cada exceção, como o Windows (1 = 128). Detalhes: port/docs/red_zone.md.

Windows: falhas de leitura e gravação de arquivos. No Windows o port guarda a posição de cada arquivo, lê e grava por um buffer próprio (e não direto na memória do jogo que a GPU protege) e tenta de novo os erros que esse caso dá. Toda leitura, gravação, abertura ou renomeação que falhar vai para o log (Runtime: read(...) ... Win32 error N), até 32 de cada tipo: mande esse log se o jogo disser que não conseguiu ler ou gravar dados (no inFAMOUS era "disco corrompido").

Compilar do código-fonte

git clone --recursive https://github.com/HayatoG/gr2_pc.git && cd gr2_pc
cd port && TLG_LTO=OFF bash build.sh   # Linux: SDL3, Vulkan, FFmpeg, FreeType, Boost, fmt, Zydis, glslang
cd .. && ./gr2_launcher.sh             # ou ./run_gr2.sh pelo terminal

No Windows, o build roda no MSYS2 CLANG64 (port/packaging/windows/README.md). O workflow .github/workflows/build.yml mostra o processo completo nas duas plataformas.

Como funciona

Camada O que faz Base
Loader Carrega o eboot.bin e liga os módulos do jogo (libc, Fios2, JobManager, libSceSecure) e o libSceNgs2.sprx do console tlg_pc, gow3_pc, bloodborne_pc
Runtime Reimplementa as bibliotecas do PS4. Específicos do GR2: Fiber, Audio3d, fontes (FreeType), Json2, PSN offline (NpToolkit) port/src/runtime_gr2*.c
Vídeo Traduz os comandos Gnm e os shaders GCN para Vulkan/SPIR-V núcleo de vídeo do shadPS4

O plano completo está em docs/ROADMAP.md.

Próximos passos

Issues:

  • #1 linhas pretas (geometry shader);
  • #2 60 FPS;
  • #3 imagem (pós-processamento, resolução, FSR/DLSS);
  • #4 mouse e teclado (o giroscópio e o touchpad simulado já entraram);
  • #5 pacotes Linux/Windows/macOS;
  • #6 jogar do início ao fim;
  • #8 áudio sem o arquivo do firmware.

Créditos e aviso legal

Base de código: tlg_pc, gow3_pc (FelipePrado0), bloodborne_pc e shadPS4, todos GPL-2.0, assim como este projeto (LICENSE). Áudio ATRAC9 via LibAtrac9; fontes via FreeType.

Este projeto não tem vínculo com a Sony Interactive Entertainment ou a SIE Japan Studio. Gravity Rush é marca da Sony Interactive Entertainment. Nenhum código, arquivo ou arte do jogo é distribuído aqui. O ícone é uma arte original do projeto.


Gravity Rush 2 — native PC port

Gravity Rush 2 (PS4, CUSA03694, update 01.11) running on PC with graphics, audio and controller support, at a steady 30 FPS and without a CPU emulator. The game's original code runs natively on the processor, the PS4 system is reimplemented, and the GPU is translated to Vulkan. It uses the same core as the The Last Guardian port, another Japan Studio game.

No game files come with this project. To play, you need your own copy, dumped from your own PS4.

By HayatoG · YouTube @hayatog-dev · Discord discord.gg/UMkdMYZh9g

The screenshots and the performance chart are at the top of this page.

What's new

  • Mouse: the mouse turns the camera (right stick) and its buttons become controller buttons: left = R1 (gravity shift: aim with the camera and click), right = L1 (cancel the shift), middle = R2 (stasis field). Holding Left Ctrl (or the X1 side button) turns the mouse into a finger on the touchpad. The window takes the mouse; Esc releases it and a click takes it back. See Mouse.
  • Shader recompiler fixes from inFAMOUS: float atomic min/max with a single integer atomic, S_WQM_B64 (GR2_WQM, on), LDS barriers and lane divergence (GR2_LDS_SMALL, GR2_LDS_MULTI, GR2_LDS_READLANE, GR2_LANE_DIVERGENCE; off by default in GR2, as inFAMOUS keeps them for itself), wave64 lowering at the subgroup size the pipeline runs with, and the GR2_BP01–GR2_BP12 fix catalog (Insert menu, Performance → Fixes). The shader cache rebuilds itself.
  • Intel CPUs: the game no longer dies right at the start (illegal instruction, 0xc000001d). The PS4's processor has AMD's SSE4A, which no Intel CPU has, and eboot.bin uses 96 EXTRQ. The port now rewrites and emulates those instructions (and MOVBE, BMI1 and LZCNT, if missing) when the CPU lacks them. Nothing changes on Ryzen CPUs.
  • Bilingual launcher (Portuguese and English, automatic or chosen), where the game language (voice and text) is picked too.
  • Black streaks: the adjacency geometry-shader outline that drew black streaks near characters is off by default (docs/BUG_LINHAS_PRETAS.md, in Portuguese, #1).
  • Motion sensor: the DualShock 4/DualSense gyro works as is. On controllers without one, a tap on Share (or L3+R3) toggles "sensor mode": the left stick tilts the controller and cross/A shakes it. On the keyboard, T/G tilt and Y shakes.
  • Sticks: a 10% dead zone against drift (TLG_STICK_DEADZONE), and the last controller used is the one that counts.
  • Touchpad without a touchpad: hold View/Select (or Tab) and move the right stick (or the arrow keys) to swipe; a quick tap still clicks.
  • Performance: FPS no longer drops over time (shader variants are now reused), and repeated partial image transitions are skipped.
  • Automatic shader cache: it lives in user/cache/, next to the saves (Linux and Windows; the old cache in ~/.local/share/shadPS4 or user/user/ is moved over on the first start). The folder is keyed by the shader recompiler version, and the old cache is deleted on its own after an update. To rebuild everything, the launcher has a Clear shader cache button (or ./run_gr2.sh --clear-shader-cache); it deletes only this game's compiled shaders, never saves or settings.

Status

Area State
Boot, opening with credits and subtitles ✅ Works
Title, menu and gameplay ✅ 30 FPS, native 1080p
Audio ✅ With libSceNgs2.sprx from your console's firmware + reimplemented Audio3d
Language ✅ Chosen in the launcher (Portuguese subtitles and menus tested)
Controller ✅ DualSense, DualShock 4, Xbox and 8BitDo via SDL3; real or simulated motion sensor and simulated touchpad
Black streaks near characters 🔧 Geometry-shader outline off by default (#1)
Saves and open world ⏳ Testing (#6)
Linux ✅ Tested (Nobara/Fedora 44)
Windows 🧪 Automatic build, not yet tested in game (#5)
macOS (Apple Silicon) 📋 Planned (#5)

Download

The latest release is built by GitHub Actions on every change; older ones stay under Releases as history:

  • Linux x86-64 (glibc 2.39+: Ubuntu 24.04, Fedora 40, SteamOS 3.6 or newer): gr2-linux-x86_64.tar.gz
  • Windows 10/11 64-bit: gr2-windows-x86_64.zip

Required game files

Everything comes from your own PS4 (GoldHEN + Itemzflow). None of it is in the download. Use Gravity Rush 2 CUSA03694 (US) with update 01.11, merged into one folder, with the base game and the update on top. About 28 GB.

File From Size Purpose
eboot.bin update 01.11 28 MB the game code (must be the 1.11 one)
sce_module/libc.prx, libSceFios2.prx, libSceJobManager.prx base game 1.7 MB the game's own libraries
sysdata/libSceSecure.prx base game small the game's own cryptography
sce_sys/ (param.sfo, playgo-chunk.dat, icon0.png, pic1.png) base + update ~5 MB metadata, install info and the launcher art
Gravite2_Chunk0.psarc, Gravite2_Chunk1.psarc base game 10 + 15.8 GB main content
Gravite2_Patch_Chunk0.psarc, Gravite2_Patch_Chunk1.psarc update 01.11 0.5 + 1.6 GB update fixes
sce_discmap.plt, sce_discmap_patch.plt update 01.11 small file map

From the console firmware (optional, for audio): libSceNgs2.sprx, from /system/common/lib/ on your PS4. It goes in the system_lib/ folder next to the executable. It is still needed: audio without it is #8.

How to build the folder:

  1. In Itemzflow, dump the game (CUSA03694) and the update (CUSA03694-patch) to an exFAT USB drive.
  2. On the PC, copy the base game folder, then copy the update's contents over it, replacing files. Or use scripts/make_game_view.py <base> <update> <out>, which builds the folder with links and uses no extra space.
  3. Check the sizes. Files over 4 GB sent through GoldHEN 2.2's FTP arrive truncated, so use the USB drive.

The full list, which also goes in the notes of every Release, is in docs/ARQUIVOS_NECESSARIOS.md.

How to play

  1. Extract the package and put libSceNgs2.sprx in the system_lib/ folder.
  2. Open Gravity Rush 2, pick the game folder and the game language (and, if you like, the interface language), and click Play.
  3. In game, F10 toggles the FPS counter, and Insert (or R3 + L2 on a controller) opens the port's menu.

The port's environment variables use the GR2_ prefix (the old TLG_ name still works; when both are set, GR2_ wins). GR2_ISA_REWRITE controls the rewrite of instructions the CPU lacks: unset, only the missing ones (SSE4A on any Intel CPU); 0 never rewrites; 1 forces them all (MOVBE, BMI1, LZCNT and SSE4A, to test the emulation on a Ryzen); or a list such as sse4a or movbe,bmi1. The log shows ISA: CPU lacks ... or ISA: forced rewrite of N sites.

Mouse

The mouse works with or without a controller (its buttons add to the controller's). The game window takes the mouse while it has focus and the Insert menu is closed; Esc releases it (the cursor comes back) and a click in the window takes it again (that click does not reach the game).

Mouse In game (Gravity Rush 2)
Move turns the camera (right stick)
Left button R1: gravity shift (aim with the camera, click to fall that way)
Right button L1: cancel the gravity shift
Middle button R2: stasis field (pick objects up)
X1 / X2 side buttons and wheel free (see GR2_KEY_MAP); X1 is also the touchpad-mode key

Touchpad mode: hold Left Ctrl or the X1 side button. The camera stops and the mouse moves a virtual finger on the touchpad (a small pad in the bottom-left corner shows it): left touches/clicks (dragging swipes), middle touches without a click, right = two fingers.

Variables (GR2_ and TLG_ work the same; mouse_* also live in tlg.ini and in the Insert menu's Controls tab):

Variable Default What it does
GR2_MOUSE 1 0 turns the mouse off (the window no longer takes it)
GR2_MOUSE_SENS 1.0 camera sensitivity (0.05–10)
GR2_MOUSE_INVERT_Y 0 1 inverts the Y axis
GR2_MOUSE_SMOOTHING 0.5 smoothing (0–0.95)
GR2_MOUSE_ACCEL 0 acceleration (0–2)
GR2_MOUSE_DEADZONE 0.1 anti-dead zone: small motions skip the game's stick dead zone (0–0.5)
GR2_MOUSE_PAD 1 0 turns the mouse touchpad mode off
GR2_MOUSE_PAD_KEY Left Ctrl|Mouse X1 touchpad-mode key(s)
GR2_MOUSE_PAD_MODE hold toggle: one press turns it on, another off
GR2_KEY_MAP — remaps keys and mouse: "square=Mouse Left|E,r1=Mouse X2,l1=Wheel Down"; none removes all
GR2_MOUSE_LOG 0 1 logs what the game gets from the mouse

Troubleshooting

Device lost during submit (the game closes with exit code 23 after a while, mostly on Windows): the GPU got stuck in a shader and the OS reset it (on Windows, TDR after ~2 s). The usual cause is a shader loop that ends on the PS4 but not on the PC. Since this version every shader loop has an iteration limit: GR2_LOOP_LIMIT_PER_LOOP (default 8192 per loop, counted again each time the loop starts) and GR2_LOOP_LIMIT (default 262144 in total per shader invocation). Past the limit the loop is cut short, so at worst one frame is wrong instead of the game closing. If it still crashes, try lower values (GR2_LOOP_LIMIT_PER_LOOP=2048); if some effect looks cut off (an incomplete reflection, shadow or particle), try higher ones. 0 turns them off: GR2_LOOP_LIMIT=0 disables both limits, GR2_LOOP_LIMIT_PER_LOOP=0 only the per-loop one. The log shows the values in use (tlg: shader loop budget ...), and the shader cache is rebuilt by itself when they change.

Windows red-zone protection. PS4 code keeps variables in the 128 bytes below rsp (the "red zone"), and Windows writes there on every exception (the port uses exceptions to track GPU memory), which crashed inFAMOUS at random places. At start the port rewrites the memory instructions of the functions that use the red zone so they run with rsp 128 bytes lower (from inFAMOUS, iss_pc #29/#41). On by default on Windows; GR2_RED_ZONE_REWRITE=0 turns it off and GR2_RED_ZONE_REWRITE=1 turns it on on Linux (testing). Linux test: TLG_CLOBBER_RED_ZONE=<bytes> zeroes that many bytes below rsp on every exception, like Windows (1 = 128). Details: port/docs/red_zone.md.

Windows file read and write errors. On Windows the port keeps each file's position itself, reads and writes through its own buffer (not straight into game memory the GPU protects) and retries the errors that case gives. Every failed read, write, open or rename goes to the log (Runtime: read(...) ... Win32 error N), up to 32 of each kind: send that log if the game says it could not read or save its data (on inFAMOUS it was "disc is corrupt").

Building from source

git clone --recursive https://github.com/HayatoG/gr2_pc.git && cd gr2_pc
cd port && TLG_LTO=OFF bash build.sh   # Linux: SDL3, Vulkan, FFmpeg, FreeType, Boost, fmt, Zydis, glslang
cd .. && ./gr2_launcher.sh             # or ./run_gr2.sh from a terminal

On Windows, the build runs in MSYS2 CLANG64 (port/packaging/windows/README.md). The workflow .github/workflows/build.yml shows the full process on both platforms.

How it works

Layer What it does Based on
Loader Loads eboot.bin and links the game's modules (libc, Fios2, JobManager, libSceSecure) and the console's libSceNgs2.sprx tlg_pc, gow3_pc, bloodborne_pc
Runtime Reimplements the PS4 libraries. GR2-specific: Fiber, Audio3d, fonts (FreeType), Json2, offline PSN (NpToolkit) port/src/runtime_gr2*.c
Video Translates Gnm commands and GCN shaders to Vulkan/SPIR-V shadPS4 video core

The full plan is in docs/ROADMAP.md.

Next steps

Issues:

  • #1 black streaks (geometry shader);
  • #2 60 FPS;
  • #3 graphics (post-processing, resolution, FSR/DLSS);
  • #4 mouse and keyboard (gyro and the simulated touchpad are in);
  • #5 Linux/Windows/macOS packages;
  • #6 playing start to finish;
  • #8 audio without the firmware file.

Credits and legal notice

Code base: tlg_pc, gow3_pc (FelipePrado0), bloodborne_pc and shadPS4, all GPL-2.0, as is this project (LICENSE). ATRAC9 audio via LibAtrac9; fonts via FreeType.

This project is not affiliated with Sony Interactive Entertainment or SIE Japan Studio. Gravity Rush is a trademark of Sony Interactive Entertainment. No game code, files or art are distributed here. The icon is original artwork made for this project.

Current rankings

  • 30

    Underappreciated Gems

    100 stars · 7 fork · Total stars (ascending)

    Underrated →

Momentum, past 30 days

Cumulative stars

Rank movement

← Back to boards