Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

VitaGrafix

From GameBrew
VitaGrafix
File:Vitagrafixvita.jpg
General
AuthorElectry
TypePlugins
Version5.0.2
LicenseGPL-3.0
Last Updated2019/12/29
Links
Download
Source

VitaGrafix is allowing user to change games resolution/FPS cap.

What is VitaGrafix?

VitaGrafix is a taiHEN plugin that allows you to change resolution and FPS cap of PS Vita games (to get better visuals, higher FPS or longer battery life).

VitaGrafix was originally, in it’s early days, based on vitaRescale by Rinnegatamante (which was unfortunately quickly abandoned), with hardcoded patches only for a dozen of games.

The project has evolved quite a bit since then. It is now an independent taiHEN plugin with custom interpreter to easily support user-made patches.

The official patchlist contains support for over 50 games.

Note: Per-game patches are required. Some are easy to patch, others plainly impossible.

What VitaGrafix does

It patches eboot.bin executable on game start-up, allowing us to alter game’s graphics initialization and runtime code. Because each game does this differently, per-game patches are required.

Media

Screenshots

vitagrafixvita-01.jpg vitagrafixvita-02.jpg

How To Install VitaGrafix

  1. Download latest VitaGrafix.suprx on gamebrew or from the releases section and ioPlus.skprx (v0.1) from ioPlus Vita
  2. If ux0:tai/config.txt file does exist
    1. Copy VitaGrafix.suprx and ioPlus.skprx to ux0:tai/ directory
    2. Open ux0:tai/config.txt in a text editor
    3. Add following lines to the file
*KERNEL
ux0:tai/ioPlus.skprx
*ALL
ux0:tai/VitaGrafix.suprx
  1. Otherwise (e.g. if you are using SD2VITA mounted as ux0)
    1. Copy VitaGrafix.suprx and ioPlus.skprx to ur0:tai/ directory
    2. Open ur0:tai/config.txt in a text editor
    3. Add following lines to the file
*KERNEL
ur0:tai/ioPlus.skprx
*ALL
ur0:tai/VitaGrafix.suprx
  1. Create ux0:data/VitaGrafix/ folder
  2. Download patchlist.txt from HERE and move it to the folder
  3. Create and open ux0:data/VitaGrafix/config.txt file
  4. Add games to the config you wish to apply patches for (refer to your patchlist.txt)

VitaGrafix's Configuration

You can configure every game separately using unified configuration file.
ux0:data/VitaGrafix/config.txt

MAIN section

  • This section applies to all games, unless specific entry for a game exists. Available options are listed below.
[MAIN]
# Same options as in GAME section are permitted here.

GAME section

  • This section applies to a single game. These options override the [MAIN] section (for that game). Each game supports different options! Refer to the compatibility table of your patchlist.txt

Example:

[PCSA00001]
# options...

TIP: Because collections share one TITLE ID for multiple games, you might want to configure each game individually. To do that you need to specify game's .self path/name (and optionally NID). If you're not sure what those are, check patchlist.txt, it uses the same header format.

[PCSA00001, GOW1.self, 0x12345678]
PCSA00001 game's TITLE ID required
GOW1.self a part of executable's full path optional
0x12345678 main module NID, 8 hex digits with '0x' prefix optional

Patchlist For VitaGrafix

Collection of patches for VitaGrafix below.

How To Install VitaGrafix's Patchlist

  1. Download raw patchlist.txt
    • optionally download files in patch/ folder, these are separated due to their larger size (100+ lines for one game)
  2. Copy it to ux0:/data/VitaGrafix/
    • patch/ files go into ux0:/data/VitaGrafix/patch/
  3. Configure your game by editing ux0:/data/VitaGrafix/config.txt or by using VitaGrafixConfigurator

Supported games

Game Title ID(s) Supported features Game defaults Notes..............
Assassin's Creed III: Liberation PCSB00074

PCSE00053
PCSG00116

Internal res.

FPS cap.

720x408

30

Asphalt: Injection PCSB00040

PCSE00007

Framebuffer

FPS cap

720x408

50

Atelier Firis: The Alchemist and the Mysterious Journey PCSB01087

PCSE01044
PCSG00929
PCSH10026

Internal res. 960x442
Atelier Lydie & Soeur: Fushigi na Kaiga no Renkinjutsu Samurai PCSG01116 Internal res. 960x442
Atelier Shallie Plus: Alchemists of the Dusk Sea PCSB01043

PCSE00998
PCSG00821

Internal res. 960x408
Atelier Sophie: The Alchemist of the Mysterious Book PCSB00973

PCSE00892
PCSG00694
PCSH00220

Internal res. 960x442
Blue Reflection: Maboroshi ni Mau - Shoujo no Ken PCSG00987 Internal res. 960x442
Borderlands 2 PCSF00570

PCSF00576
PCSE00383
PCSG00400

Framebuffer 960x544
Catherine: Full Body PCSG01179 Internal res. 720x408
Dead or Alive 5 Plus PCSB00296

PCSE00235
PCSG00167

Internal res. 720x408
Dead or Alive Xtreme 3: Venus PCSG00773

PCSH00250
PCSH00281

2x Internal res. 736x416, 640x368
Deception IV: Blood Ties

Kagero: Darkside Princess

PCSB00499

PCSE00401
PCSG00304

3x Internal res. 960x544, 720x408, 640x368
Deception IV: The Nightmare Princess

Kagero: Mou Hitori no Princess

PCSB00829

PCSE00743
PCSG00565

3x Internal res. 960x544, 720x408, 640x368
Disney Epic Mickey 2: The Power of Two PCSF00308

PCSF00309
PCSA00110

Internal res. 720x408
Dragon Ball Z: Battle of Z PCSB00396

PCSE00305
PCSG00213

Internal res. 704x448
Dragon Quest Builders PCSB00981

PCSE00912
PCSG00697
PCSH00221

Internal res.

FPS cap

720x408

60

Dungeon Hunter: Alliance PCSB00041

PCSE00008

Internal res. 702x408
Fantasy Hero: Unsigned Legacy PCSB00663

PCSE00536
PCSG00280
PCSH00157

Framebuffer 720x408
Fate/EXTELLA (The Umbral Star) PCSB01030

PCSE00928
PCSH00299
PCSG00600

Internal res. 720x408
Fate/EXTELLA LINK PCSE01254

PCSG01091
PCSH10121

Internal res. 720x408
F1 2011 PCSB00027

PCSE00002

Internal res. 640x384
God of War Collection PCSF00438

PCSA00126
PCSC00059

Framebuffer

FPS cap

720x408

30

Gundam Breaker 2 PCSG00412

PCSH00132

Internal res. 720x408
Hatsune Miku: Project Diva f PCSB00419

PCSE00326
PCSG00074

Internal res.

FPS cap

640x352

30

#120, #81
Hatsune Miku: Project Diva f 2nd PCSB00554

PCSE00434
PCSG00205
PCSH00088

Internal res.

FPS cap

720x408

30

#120, #80
Hatsune Miku: Project Diva X PCSB01007

PCSE00867
PCSH00176
PCSG00683

Internal res. 720x408
Helldivers PCSF00465

PCSA00134
PCSC00078
PCSD00086
PCSD00097

Framebuffer 960x544 #82
I am Setsuna PCSG00756 FPS cap 30
Injustice: Gods Among Us PCSB00356

PCSE00271

Framebuffer 720x408 #82
Jak and Daxter: The Precursor Legacy PCSF00247

PCSF00248
PCSA00080

Framebuffer

FPS cap

720x408

20

Jak II PCSF00247

PCSF00249
PCSA00080

Framebuffer 720x408
Jak 3 PCSF00247

PCSF00250
PCSA00080

Framebuffer 720x408
J-Stars Victory Vs PCSG00300 Internal res. 768x448
J-Stars Victory Vs+ PCSB00713

PCSE00595
PCSH00136

Internal res. 768x448
Kidou Senshi Gundam Seed: Battle Destiny PCSG00040 Internal res.

FPS cap

704x384

30

Killzone: Mercenary PCSF00243

PCSF00403
PCSA00107
PCSC00045
PCSD00071

Internal res.

FPS cap

Dynamic

30

LEGO Batman 3: Beyond Gotham PCSB00563

PCSE00442

Internal res. 640x368
LEGO Harry Potter: Years 5–7 PCSB00103

PCSE00057

Framebuffer 640x368 #3
LEGO Jurassic World PCSB00703

PCSE00587

Internal res. 640x368
LEGO Marvel Super Heroes: Universe in Peril PCSB00315

PCSE00250

Internal res. 640x368
LEGO Marvel's Avengers PCSB00764

PCSE00670

Internal res. 640x368
LEGO Ninjago: Shadow of Ronin PCSB00706

PCSE00534

Internal res. 640x368
LEGO Star Wars: The Force Awakens PCSB00877

PCSE00791

Internal res. 640x368
LEGO The Hobbit PCSB00503

PCSE00390

Internal res. 640x368
LittleBigPlanet PCSF00021

PCSA00017
PCSC00013
PCSD00006

Internal res. 720x408 #24
Lumines: Electronic Symphony PCSB00061

PCSE00009
PCSG00014

FPS cap 30
Macross Delta Scramble PCSG00947 Internal res. 800x448
Mahouka Koukou no Rettousei: Out of Order PCSG00456 Internal res.

FPS cap

720x408

30

Minecraft: PlayStation Vita Edition PCSB00560

PCSE00491
PCSG00302

Framebuffer

FPS cap

720x408

60

Miracle Girls Festival PCSG00610 Internal res. 720x408
MotoGP 13 PCSB00316

PCSE00409

Internal res. 704x448
MotoGP 14 PCSB00498

PCSE00529

Internal res. 704x448
MUD - FIM Motocross World Championship PCSB00182

PCSE00219

Internal res. 704x448
MXGP: The Official Motocross Videogame PCSB00470

PCSE00530

Internal res. 704x448
Need for Speed: Most Wanted PCSB00183

PCSE00089
PCSG00106

Internal res. 640x368
Nelke to Densetsu no Renkinjutsushi Tachi: Aratana Daichi no Atelier PCSG01223 Internal res. 960x442
Ninja Gaiden Sigma 2 Plus PCSB00294

PCSE00233
PCSG00157

2x Internal res. 864x480, 640x416
Oddworld: Munch's Oddysee HD PCSB00275

PCSE00369

FPS cap 30
One Piece: Burning Blood PCSB00893

PCSE00808
PCSH00202

Internal res. 704x384
Persona 4 Golden PCSB00245

PCSE00120
PCSG00004
PCSG00563
PCSH00021

Internal res. 840x476
Phantasy Star Nova PCSG00351

PCSH00143

Internal res. 960x544
Project Root PCSB00650

PCSE00486
PCSG00783

FPS cap 30
Puella Magi Madoka Magica: The Battle Pentagram PCSG00214 Internal res.

FPS cap

704x448

30

Ratchet & Clank PCSF00484

PCSF00482
PCSA00133

Framebuffer 720x408
Ratchet & Clank 2: Locked and Loaded / Going Commando PCSF00485

PCSF00482
PCSA00133

Framebuffer 720x408
Ratchet & Clank 3 / Up Your Arsenal PCSF00486

PCSF00482
PCSA00133

Framebuffer 720x408
Ratchet & Clank: QForce / Full Frontal Assault PCSF00191

PCSA00086
PCSC00041

Framebuffer 720x408
Resident Evil: Revelations 2 PCSF00728

PCSE00608
PCSG00594
PCSH00187

Internal res. 720x408
RESOGUN PCSF00262

PCSA00103
PCSC00088

Framebuffer 720x408
Ridge Racer PCSB00048

PCSE00001
PCSG00001

Internal res. 720x408
Sly Cooper and the Thievius Raccoonus PCSF00269

PCSF00338
PCSA00095
PCSA00096

Framebuffer

FPS cap

720x408

30

Sly Cooper 2: Band of Thieves PCSF00270

PCSF00338
PCSA00095
PCSA00097

Framebuffer

FPS cap

960x544

30

Sly Cooper 3: Honor Among Thieves PCSF00271

PCSF00338
PCSA00095
PCSA00098

Framebuffer

FPS cap

960x544

30

Sly Cooper: Thieves in Time PCSF00156

PCSF00206
PCSF00207
PCSF00208
PCSF00209
PCSA00068

FPS cap 30
Soul Sacrifice PCSF00178

PCSA00092
PCSD00065
PCSC00039

Internal res. 720x408
Soul Sacrifice Delta PCSF00532

PCSA00152
PCSD00079
PCSC00049

Internal res. 720x408
Spy Hunter PCSB00166

PCSE00068

Framebuffer

FPS cap
MSAA

640x368

30
4x

SteamWorld Heist PCSB00693

PCSE00583

FPS cap 30
Street Fighter X Tekken PCSB00144

PCSE00005
PCSG00063

Internal res. 640x480
Summon Night 6: Lost Borders PCSB01013

PCSE00951
PCSG00827
PCSH00225

MSAA 2x
Supremacy MMA: Unrestricted PCSE00012 Internal res. 720x408
The Amazing Spider-Man PCSB00428

PCSE00333

Internal res.

FPS cap

704x400

60

The Legend of Heroes: Trails of Cold Steel

Eiyuu Densetsu: Sen no Kiseki

PCSB00866

PCSE00786
PCSG00195
PCSH00074

Internal res. 720x408
The Legend of Heroes: Trails of Cold Steel II

Eiyuu Densetsu: Sen no Kiseki II

PCSB01016

PCSE00896
PCSG00354
PCSH00075

Internal res.

MSAA

720x408

2x

The LEGO Movie Videogame PCSB00553

PCSE00353

Internal res. 640x368
Tokyo Xanadu PCSB01062

PCSE00893
PCSG00608
PCSH10009

Internal res.

MSAA

720x408

2x

Ukiyo no Roushi PCSG00480 Internal res.

FPS cap

704x384

30

Urban Trial Freestyle PCSB00038

PCSE00051
PCSG00231

Framebuffer 720x408
Utawarerumono: Mask of Deception / Itsuwari no Kamen PCSB01093

PCSE00959
PCSG00617

Internal res. 672x384
Utawarerumono: Mask of Truth / Futari no Hakuoro PCSB01145

PCSE01102
PCSG00838

Internal res. 672x384
Utawarerumono: Chiriyuku Mono he no Komoriuta PCSG01079 Internal res. 672x384
Valhalla Knights 3 PCSB00432

PCSE00244
PCSG00076

Internal res. 640x384
Valhalla Knights 3 GOLD PCSG00307 Internal res.

FPS cap

640x384

30

Wipeout 2048 PCSF00007

PCSA00015
PCSC00006
PCSD00005

14x Internal res.

FPS cap

up to 960x544

30

World of Final Fantasy PCSB00951

PCSE00880
PCSH00223
PCSG00709

Internal res. 640x384
WRC 3: FIA World Rally Championship PCSB00204

PCSE00242

Internal res. 704x448
WRC 4: FIA World Rally Championship PCSB00345

PCSE00411
PCSG00376

Internal res. 704x448
WRC 5: FIA World Rally Championship PCSB00762

PCSE00667

Framebuffer 960x544
Ys: Memories of Celceta PCSB00497

PCSE00245
PCSH00181
PCSG00105

Internal res. 720x408
Ys Origin PCSB01081

PCSE01033
PCSH10049

FPS cap 30
Ys VIII: Lacrimosa of Dana PCSB01128

PCSE01103
PCSG00881
PCSH00297

3x Internal res.

FPS cap

960x512, 840x476, 720x320

30

Supported games (patch/)

These require patchlist.txt as well as additional files located in patch/ folder.

Game Title ID(s) Supported features Game defaults Notes..............
Mortal Kombat PCSB00106

PCSE00023

Framebuffer 640x368 PCSB00106.txt

PCSE00023.txt

Uncharted: Golden Abyss PCSF00001

PCSF00012
PCSA00029
PCSD00001

Internal res. 768x384 PCSF00001.txt
  • no known issues
  • playable, but with some minor issues (check Issues section)

Adding support for each and every game requires manual disassembly of game's binary to find addresses in the game code where the resolution is set. Some are easy to patch, others plainly impossible.

FAQ

  • Encountered a bug? Feel free to open a Github issue here.
  • Found a new patch? I'll gladly include it in here :) Just open a new issue or create a merge request.

Available options When Using VitaGrafix

The format is OPTION=VALUE, each on a separate line.

option description valid values default
ENABLED Enables/disables game modifications (and OSD). ON: 1, on or true

OFF: 0, off or false

ON
OSD Enables/disables the small overlay that is

shown during first few seconds when starting a game.

ON: 1, on or true

OFF: 0, off or false

ON
LOG Enables/disables logging

(to ux0:data/VitaGrafix/log.txt file)

ON: 1, on or true

OFF: 0, off or false

ON
FB Framebuffer resolution ON:

960x544
720x408
640x368

OFF:
0, off or false

OFF
IB Internal buf. resolution ON:

WxH where:
1 <= W <= 960
1 <= H <= 544

If patch supports multiple res.
(e.g. dyn. res. scaling) use:
WxH,WxH,...

OFF:
0, off or false

OFF
FPS Frames per second cap (upper limit) ON:

60
30
20

OFF:
0, off or false

OFF
MSAA Multisample anti-aliasing ON:

4x
2x
1x (no AA)

OFF:
0, off or false

OFF

TIP: If you leave some options out, the plugin will use their default values.
TIP: If patch supports multiple IB res. and you don't specify them all, the last WxH will be used for those that would go after. It is therefore perfectly fine to just use IB=960x544 to set them all to 960x544 (e.g. to disable dynamic res. scaling) in such situations.

Comments

Comments always start with # character. They can, but don't need to be on a separate line.

# This is a comment
[PCSA00001] # This is also a valid comment
...

Example config.txt

[MAIN]
# Set default options for all games
FB=960x544
IB=960x544
FPS=60
MSAA=4x

# Persona 4 Golden [EU], disable osd
# Notice that IB=960x544 is redundant here as it is
#  the same resolution as the 'fallback' one in [MAIN] section above.
#  This of course doesn't cause any harm.
[PCSB00245]
OSD=0
IB=960x544

# Ninja Gaiden Sigma 2 Plus, uses dynamic resolution scaling
#  and switches between two specified IB resolutions when patched
#  (based on framerate)
# Override the [MAIN] IB resolution(s) for this game.
[PCSB00294]
IB=960x544,720x408

# LittleBigPlanet res. patch introduces some glitches,
#  let's disable it here.
[PCSA00017]
ENABLED=0

# GoW 2 won't reach 60 FPS @ 960x544 very often, so let's
#  keep it locked to 30 (default FPS cap).
[PCSF00438, GOW2.self]
FPS=OFF

# I think you get what this does by now.
[PCSB00204]
IB=OFF

Advanced - The VG Language

To facilitate user-made game patches without having to recompile the whole plugin, a domain specific language was created. Similar, but somewhat simplified to that of VitaCheat.

Written in patchlist.txt, patches are parsed and applied during game boot-up.

Section header

A patch for each game starts with a header. Header identifies SKU/region (TITLE ID), the executable name (because several “collections” use the same TITLE ID for multiple games in their series) and the game version (indirectly, in a form of module NID).

[PCSA00001, eboot.bin, 0x12345678]
PCSA00001 game's TITLE ID required
eboot.bin a part of executable's full path recommended
0x12345678 main module NID, 8 hex digits with '0x' prefix recommended


Executable name/path is used to differentiate between games that share a single TITLE ID (e.g. collections).

NID is used to inform user about potentional version mismatch (e.g. when game gets a new update), instead of applying patches to wrong/old memory addresses and then crashing.

If multiple regions/SKUs share the same offsets, having to duplicate patches would be wasteful. You can freely stack multiple headers after each other, like shown below. Patches will then be applied for all matching games/regions.

[PCSA00001, eboot.bin, 0x12345678]
[PCSB00023, eboot.bin, 0x87654321]
...

Feature type

Header is followed by patch feature/type marking. This indicates that subsequent patches shall only be applied if user has enabled said feature in their configuration file.

Use one of the following:

@FB
@IB
@FPS
@MSAA

Patches

The rules for patches are simple. Each patched memory location is on a separate line, starts with a relative address (segment:offset) followed by the new value.

0:0x1234 0xDEADBEEF

Datatypes

VitaGrafix internally always works with one of the following datatypes:

  • Primitive types:
    • int (32-bit signed integer)
    • uint (32-bit unsigned integer)
    • float (32-bit floating point number)
  • Raw type:
    • bytes (size up to 32 B)

You can cast between those types freely using casting functions (see Explicit type conversion).

Immediate values are always parsed as

  • int – when + or - sign precedes 1 or more decimal digits (with no space inbetween)
    • OK - +1, -1
    • KO - + 1
  • uint – when:
    • hex number is prefixed with 0x or 0X
    • octal number is prefixed with 0
    • decimal integer does not have prefix or suffix
    • OK - 0xCAFE, 0876, 123
    • KO - CAFE
  • float – when 1 or more decimal digits (optionally with preceding + or - sign) are followed by:
    • . and optionally:
      • 1 or more digits after the decimal point and optionally f
      • f
    • f
    • OK - 1., 1.2, 1.2f, 1f, 1.f, -1.0, -2f, +123.4f
    • KO - .1, .1f, 1 . 0 f
  • bytes – when 1 or more (up to 32) 8-bit hex values (without the 0x prefix) are followed by r
    • OK - DEADr, DE AD r
    • KO - DEAD, 0xDEADr, 0xDE 0xAD r

Implicit type conversion

The interpreter makes use of implicit conversion when necessary. This is done when applying infix operator or math function (arity >= 2) to following operand types (in no particular order):

operand 1 operand 2, 3, ... result example
float int or uint all casted to float float 100 / 2.0 equals 50.0
int uint all casted to int int 100 / -2 equals -50
uint uint ONLY if result is < 0 int 1 - 2 equals -1
any any ONLY when applying . (concat) bytes 1 . 2 equals 0100000002000000r

Explicit type conversion

While working with values, changing the datatype manually might sometimes be desirable.

To convert value of any type to one of the primitive types use following functions:

function argument type result type example
int(value) any int int(-2.0) equals -2
uint(value) any uint uint(FFr) equals 255
float(value) any float float(2) equals 2.0

To convert value of any type to raw type use:

function argument type result type result size (B) example
int8(value) any bytes 1 int8(-128) equals 80 r
int16(value) any bytes 2 int16(-32768) equals 00 80 r
int32(value) any bytes 4 int32(-2147483648) equals 00 00 00 80 r
uint8(value) any bytes 1 uint8(255) equals FF r
uint16(value) any bytes 2 uint16(65535) equals FF FF r
uint32(value) any bytes 4 uint32(4294967295) equals FF FF FF FF r
fl32(value) any bytes 4 fl32(12345.0) equals 00 E4 40 46 r

If you don't wish to cast the value, but rather just reinterpret bytes, use:

function value type result type result size (B) example
raw(value) any bytes sizeof(value) raw(1.0 >> 16) equals 80 3F 00 00 r
rawn(value, n) any bytes n rawn(1.0 >> 16, 2) equals 80 3F r

Infix operators

Operator precedence is honored, order is similar to C-like languages. Brackets (parentheses) are allowed and evaluated first.

operator operand type description example
+ primitive addition 1 + 2 equals 3
- primitive subtraction 1 - 2 equals -1
* primitive multiplication 2 * 3 equals 6
/ primitive division 3 / 2.0 equals 1.5
% int or uint modulo (division remainder) 123 % 23 equals 8
| primitive bitwise OR 5 equals 15
^ primitive bitwise XOR 14 ^ 5 equals 11
& primitive bitwise AND 14 & 5 equals 4
<< primitive bitwise left shift 14 >> 2 equals 3
>> primitive bitwise right shift 14 << 2 equals 56
. raw concatenation DEr . ADr equals DE AD r
* primitive * raw raw repeat nop * 2 equals 00 BF 00 BF r

Math functions

function description example
abs(value) absolute value abs(-1.0) equals 1.0
acos(rad) arc cosine (inverse cosine) in radians acos(-0.5) equals 2.094395
align(value, al) aligns value to a multiple of al align(720, 32) equals 736
asin(rad) arc sine (inverse sine) in radians asin(0.5) equals 0.523599
atan(rad) arc tangent (inverse tangent) in radians atan(1.0) equals 0.785398
atan2(y, x) arc tangent of y/x in radians atan2(0.5, 0.4) equals 0.896055
ceil(value) nearest integer greater than value ceil(1.23) equals 2.0
cos(rad) cosine in radians cos(0.5) equals 0.877583
cosh(rad) hyperbolic cosine in radians cosh(0.5) equals 1.127626
exp(value) exponential (Euler's number) raised to value exp(2.0) equals 7.389056
floor(value) nearest integer lesser than value floor(1.23) equals 1.0
ln(value) natural logarithm of value ln(10.0) equals 2.302585
log10(value) base 10 logarithm of value log10(10.0) equals 1.0
min(a, b) the smaller of a and b min(123, 23) equals 23
max(a, b) the greater of a and b max(123, 23) equals 123
pow(base, power) base raised to the power pow(2, 4) equals 16
round(value) nearest integer to value (0.5 rounds up) round(1.23) equals 1.0
sin(rad) sine in radians sin(0.5) equals 0.479426
sinh(rad) hyperbolic sine in radians sinh(0.5) equals 0.521095
sqrt(value) square root of value sqrt(10.0) equals 3.162278
tan(rad) tangent in radians tan(0.5) equals 0.546302
tanh(rad) hyperbolic tangent in radians tanh(0.5) equals 0.462117

Math constants

constant description defined as
pi The number π 3.141593
e Euler's number 2.718282

User configuration macros

These return values based on user configuration entry (in config.txt) for current game.

macro description config option
fb_w Framebuffer width in pixels FB
fb_h Framebuffer height in pixels FB
ib_w Internal buf. width in pixels IB
ib_h Internal buf. height in pixels IB
ib_wi(index) Internal buf. width in pixels (indexed from 0) IB (multiple)
ib_hi(index) Internal buf. height in pixels (indexed from 0) IB (multiple)
vblank Vertical blanking interval (1 for 60Hz, 2 for 30, etc...) FPS
msaa SceGxmMultisampleMode (0 for no MSAA, 1 for 2x, 2 for 4x) MSAA

Instruction encoders

These encode few of the commonly used instructions. Result type is always raw, size depends on encoder. All are unconditional.

Register arguments are expected to be decimal integers.
ARM within 0 <= reg <= 14 range, where 0 denotes R0 or A1, 13 = SP and 14 = LR.
VFP within 0 <= reg <= 31 range, where 0 denotes S0.

encoder description instr. set

(enc.)

size (B)
t1_mov(reg, imm) Insert an immediate value to a register.


MOV <Rd>,#<imm8>

reg - destination
imm - immediate value (up to 8-bit)

Thumb

(T1)

2
t2_mov(sf, reg, imm) Insert an immediate value to a register.


MOV{S}.W <Rd>,#<const>

sf - set condition flags (0 = MOV.W, 1 = MOVS.W)
reg - destination
imm - immediate value (constant)

Thumb-2

(T2)

4
t3_mov(reg, imm) Insert an immediate value to a register.


MOVW <Rd>,#<imm16>

reg - destination
imm - immediate value (up to 16-bit)

Thumb-2

(T3)

4
t1_movt(reg, imm) Insert 16-bit immediate value to the top halfword of a register.

Bottom halfword is not affected.

MOVT <Rd>,#<imm16>

reg - destination
imm - immediate value (up to 16-bit)

Thumb-2

(T1)

4
mov32(reg, imm, gap) Pseduo-instruction, generates MOVW, MOVT pair,

allows you to load any 32-bit value into a register.

MOVW <Rd>,#<imm16>
...
MOVT <Rd>,#<imm16>

reg - destination
imm - immediate value (up to 32-bit)
gap - gap size (in bytes) between MOVW and MOVT (max. 24 B)

Thumb-2

(T3 + T1)

4 + gap + 4
a1_mov(sf, reg, imm) Insert an immediate value to a register.


MOV{S} <Rd>,#<const>

sf - set condition flags (0 = MOV, 1 = MOVS)
reg - destination
imm - immediate value (constant)

Arm

(A1)

4
a2_mov(reg, imm) Insert an immediate value to a register.


MOVW <Rd>,#<imm16>

reg - destination
imm - immediate value (up to 16-bit)

Arm

(A2)

4
t2_vmov(reg, imm) Insert a floating-point immediate value in a single-precision register.


VMOV.F32 <Sd>, #<imm>

reg - destination (VFP)
imm - float immediate (+/-n * 2^-r, 16 <= n <= 31, 0 <= r <= 7)

VFPv3

(T2/A2)

4
bkpt Breakpoint (enter debug state).


BKPT #0

Thumb

(T1)

2
nop No operation.


NOP

Thumb-2

(T1)

2

Comments

Comments always start with # character. They can, but don't need to be on a separate line.

# This is a comment
[PCSA00001, eboot.bin, 0x12345678] # This is also a valid comment
...

Backwards compatibility with v4.x

All older patches are compatible with v5.x, however, support for the old syntax/style might be dropped in future versions. It is highly advised to use the new syntax for new patches.

Changes:

v4.x: nop() and bkpt() encoders must have brackets
v5.x: nop and bkpt encoders are classified as constants, constants do not have brackets
example:

  • nop() => nop

v4.x: no support for math operators/fns/precedence, macros start with < and end with >
v5.x: infix operators and math functions are available
example:

  • <+,1,2> => 1 + 2
  • <*,<&,<+,<fb_w>,31>,0xFFFFFFE0>,4> => align(fb_w, 32) * 4

v4.x: config-option macros start with < and end with >
v5.x: config-option macros are used just like regular constants and functions
example:

  • <fb_w> => fb_w
  • <ib_w> => ib_w
  • <ib_w,2> => ib_wi(2)

v4.x: no extra spaces are allowed, comments have to be on a separate line
v5.x: spaces are ignored, anything after # too (until EOL)
example:

  • t2_mov(1,1,<fb_w>) => t2_mov(1, 1, fb_w)
  • # Comment

0:0x1234 nop is valid just like 0:0x1234 nop # Comment

v4.x: bytes() is used to parse raw bytes
v5.x: r suffix is used to parse raw bytes, raw() is used for reinterpreting/conversion
example:

  • bytes(DE AD BE EF) => DEADBEEF r

and more...

Examples

Here are some examples of valid patches.

[PCSF00243,eboot.bin]            # Killzone Mercenary [EU 1.12]
[PCSF00403,eboot.bin]            # Killzone Mercenary [EU 1.12]
[PCSA00107,eboot.bin,0x0F9D3B7C] # Killzone Mercenary [US 1.12]
[PCSC00045,eboot.bin]            # Killzone Mercenary [JP 1.12]
[PCSD00071,eboot.bin]            # Killzone Mercenary [ASIA 1.12]
@IB
0:0x15A5C8 nop *4
1:0xD728 uint32(ib_w) . uint32(ib_h)
1:0xD730 uint32(ib_w) . uint32(ib_h)
# God of War Collection [EU 1.00]
[PCSF00438,GOW1.self,0x8638ffed]
@FB
0:0x9E212 t2_mov(1, 4, fb_w)
0:0x9E21A t2_mov(1, 2, fb_h)
0:0x9F0F0 t2_mov(1, 0, fb_w)
0:0x9F0F8 t2_mov(1, 1, fb_h)
0:0xA31C6 t2_mov(1, 7, fb_w)
0:0xA31CC t2_mov(1, 1, fb_h)
0:0xCEF06 t2_mov(1, 0, fb_w)
0:0xCEF0E t2_mov(1, 2, fb_h)
0:0xA1098 t2_mov(1, 14, fb_h)
@FPS
0:0x9E228 t1_mov(0, vblank)
# LEGO Star Wars: The Force Awakens [EU 1.00]
[PCSB00877,eboot.bin]
@IB
0:0x2241C4 t2_mov(1, 1, 0xA00000)
0:0x1F313E t2_mov(1, 4, ib_w)
0:0x1F3144 t2_mov(1, 5, ib_h)
1:0x4650 uint32(ib_w) . uint32(ib_h)
# Fix touchscreen/touchpad pos calc
0:0x223AF6 t2_mov(0, 0, 640) . nop *3
0:0x223B36 t2_mov(0, 0, 368) . nop *3

IO/patcher/syntax errors

The parser will try to warn you if you make a mistake. Nevertheless, it isn't perfect so you shouldn't rely on it.

Example:

vitagrafix_errors.png

Changelog

(v.5.0.2)

  • Fixed a bug where "Your game version is not supported" message would not appear if you had a different game version to that of a patch

(v.5.0.1)

  • Fixed bug where last IB res. in config.txt was not propagated, causing crash in multi-res. games (e.g. those with dynamic scaling such as Wipeout 2048)
  • Added support for manual redirection to alternate patch file (aka. !USE directive in patchlist.txt)

(v.5.0.0)

  • Vastly improved UX (UI, logging, error reporting, etc...)
  • Rewritten parser/interpreter from scratch - revamped patchlist.txt syntax (compatible with v4.x patches)
  • Added support for per-self headers in config.txt
    • Now you can use separate options for each game in "collections" with single Title ID (e.g. GoW 1/2)
  • Added internal log buffer - reduced game startup times due to I/O stall
  • Added config.txt option to disable logging altogether
  • Added support for 20 FPS option in config.txt
  • Added support for individual per-game patchlists (e.g. ux0:data/VitaGrafix/patch/PCSF00001.txt)
  • Added support for inline comments on the same line as code
  • Bug fixes

(v.4.1.1)

  • Fixed bug where [MAIN] options were ignored in some occasions.
  • Minor UI QoL improvements
  • Config/patchlist parsing is now case-insensitive
  • [MAIN] accepts same options as GAME section - the latter takes precedence if both are present. You can set your FB/IB/FPS/etc.. in [MAIN], those will be used as default values.
  • Added support for Arm A2 MOVW encoding (a2_mov) in patchlist.txt

(v.4.0)

  • Hardcoded patches were removed, which means, updates to VitaGrafix plugin in the future will only bring new feature support / bug fixes.
  • All game related stuff, new game support, fixes, etc... will be available here: VitaGrafixPatchlist (changelog)
  • Download patchlist.txt (or make your own) and place it in ux0:data/VitaGrafix/

(v.3.2)

  • Game support:
    • Wipeout 2048 [EU/US/JP/ASIA] - 14x IB resolution - game uses dynamic res. scaling, you can specify up to 14 IB resolutions to override the default ones (or just 1 to disable the scaling completely)
    • Fate/EXTELLA LINK [JP/ASIA] - IB resolution
    • Assassin's Creed III: Liberation [EU/US] - IB resolution + FPS cap

Thanks to @FormerNoob:

  • The Legend of Heroes: Trails of Cold Steel [EU/US/JP/ASIA] - IB resolution
  • The Legend of Heroes: Trails of Cold Steel II [EU/US/JP/ASIA] - IB resolution
  • Dead or Alive Xtreme 3: Venus [JP/ASIA] - 2x IB resolution - uses dynamic scaling

Thanks to @nigelweng:

  • Resident Evil: Revelations 2 [EU/US/JP] - IB resolution


(v.3.1.1)

  • Fixed bug where Jak & Daxter Collection [EU/US] would show 'game version unsupported' message in the game shell (Jak 1, 2, 3 game selection menu).
  • Fixed crash when only one IB resolution was specified for Ninja Gaiden Sigma 2 Plus.
  • Fixed issue where World of Final Fantasy would not show any special effects at 960x544 (hopefully).
  • Fixed log messages line feed.

(v.3.1)

  • New game support:
    • Sly Cooper Collection (1, 2, 3) [EU/US] - FB res. + FPS cap
    • Sly Cooper Thieves in Time [EU/US] - FPS cap
    • Ninja Gaiden Sigma 2 Plus [EU/US/JP] - 2x IB res. (game uses dynamic scaling, you need to specify two res. e.g. IB=960x544,720x408)
    • Dragon Quest Builders [EU/US/JP/ASIA] - FPS cap (you can force 30 FPS lock)
    • Ratchet & Clank Collection (1, 2, 3) [EU/US] - FB res.
    • Ratchet & Clank Full Frontal Assault / QForce [EU/US] - FB res.
    • Utawarerumono: Chiriyuku Mono he no Komoriuta [JP] - IB res.
    • Dragon Ball Z: Battle of Z [EU/US/JP] - IB res.

New region support:

  • Borderlands 2 [EU-2] (PCSF00576) - FB res.

Fixes:

  • LEGO Star Wars: The Force Awakens [EU/US] - now playable at 960x544 without crashes

Known issues:

  • Ratchet & Clank 2 + 3 has some UI clipping issues. #16

(v.2.4)

  • Game support
    • Added Hatsune Miku: Project Diva f [EUR/USA/JPN] internal res. patch
    • Added Hatsune Miku: Project Diva f 2nd [EUR/USA/JPN/ASA] internal res. + FPS cap patch
    • Added Hatsune Miku: Project Diva X [EUR/USA/ASA] internal res. patch
    • Added The Amazing Spider-Man [EUR] internal res. + FPS cap patch
    • Added Sly Cooper and the Thievius Raccoonus [USA] framebuffer res. + FPS cap patch
    • Fixed the issue in Killzone: Mercenary where (controller) input didn't work at >59 fps.

Known issues

  • The Amazing Spider-Man: Only few IB resolutions work properly. 960x544 causes GPU crash in some areas.

(v.2.3)

  • Game support
    • Added MotoGP 13 [EUR/USA] internal res. patch
    • Added MotoGP 14 [USA] internal res. patch
    • Added WRC 5 [EUR] framebuffer res. patch
    • Added Utawarerumono: Mask of Deception [EUR] internal res. patch
    • Added Utawarerumono: Mask of Truth [EUR/USA/JPN] internal res. patch
    • Added Dragon Quest Builders [EUR/USA/JPN/ASA] internal res. patch

(v.2.2)

  • Game support
    • Added Ridge Racer [EUR/USA/JPN] internal res. patch.
    • Added Utawarerumono: Mask of Deception [USA/JPN] internal res. patch.
    • Added World of Final Fantasy [JPN] internal res. patch.
    • Added Dead or Alive 5 Plus [EUR/USA/JPN] internal res. patch.
    • Added Miracle Girls Festival [JPN] internal res. patch.
    • Added Jak and Daxter Collection [EUR/USA] framebuffer res. patch.
    • Added Hatsune Miku: Project Diva f [EUR/USA/JPN] FPS cap patch.

Known issues

  • World of Final Fantasy: Only few resolutions work properly. Default has been changed to 800x480 (known working res.).
  • LEGO Star Wars: The Force Awakens: Crashes at native res (when opening pause menu, and possibly at other times too). Default has been changed to 720x408 (still higher than original 640x384).
  • LittleBigPlanet: Particles don't render correctly at native res. Default has been changed to OFF.
  • Hatsune Miku: Project Diva f: 60 FPS doubles menu animations speed. Gameplay remains normal.

(v.2.1)

  • Game support
    • Added F1 2011 [EUR] internal resolution patch
    • Added LittleBigPlanet [EUR/USA/JPN/ASA] internal resolution patch
    • Added Borderlands 2 [EUR/USA] framebuffer resolution patch
    • Added Asphalt: Injection [EUR/USA] internal resolution patch
    • Added LEGO Star Wars: The Force Awakens [EUR/USA] internal resolution patch
    • Added World of Final Fantasy [EUR/USA/ASA] internal resolution patch

(v.2.0)

  • Game support:
    • Added Killzone Mercenary [EUR/USA/JPN/ASA] internal resolution patch
    • Added WRC 3 [EUR] internal resolution patch*
    • Added WRC 4 [EUR/USA] internal resolution patch*
    • Added Persona 4 Golden [JPN] (PCSG00004) internal resolution patch
    • Added God of War Collection [EUR/USA/JPN] framebuffer resolution + FPS cap patch (GoW 1 + 2)
    • Added MUD - FIM Motocross World Championship [EUR] internal resolution patch
    • Added MXGP: The Official Motocross Videogame [EUR/USA] internal resolution patch

Thanks to InquisitionImplied for finding the HEX edits

(v.1.3.1)

  • Fixed P4G offsets for JPN+ASA (hopefully)

(v.1.3)

  • Added Persona 4 Golden 476p -> 544p 3D resolution hack for ASA (PCSH00021). (thanks to /u/kane159)
  • The plugin now shows OSD for a few seconds after starting the game.

(v.1.2)

  • Added Persona 4 Golden 476p -> 544p 3D resolution hack for USA + JPN versions

(v.1.1)

  • Added Persona 4 Golden [EUR] 476p -> 544p 3D resolution hack

(v.1.0)

  • Add Killzone Mercenary 60 fps patch

Credits

I'd like to thank the following people who made this possible:

External links

Advertising: