Memory Card with a Library of PSX Dithering Codes

From Modding Fridays
Jump to navigation Jump to search

GS code?

A GameShark (GS) code, or Action Replay (AR) code, is a code that can be used by GameShark and Action Replay console add-ons, compatible devices and cheat engines. The main purpose is to alter a game's memory, for instance to get infinite lives, access all the weapons, reactivate debug mode, teleport to places, but also all sorts of interesting hacks. A particular interesting one, discovered by Chris Covell, is the possibility to disable the checkerboard dithering applied indiscriminately in many PSX games. While for some games this can artificially provide more depth to the 15bit graphics output, in other games where the artworks were bitmaps mapped or designed with to the correct colour limitations of the PSX in mind, this made little sense and the dithering just added noise to the image. More generally, GS and AR code can be handy to mess around with a game software for fun and profit.

To be sure, unlike popular beliefs GS/AR codes are more than instructions to overwrite memory with a particular value. GS, AR, and other lesser known devices, work with their own sets of instructions, called code types. It's possible to do memory copy operations, conditionals, increment values, etc. For instance, consider the following series of GS codes as a routine:

80tttttt 00uu - write uu to the address tttttt
E3vvvvvv 00ww - if the value at address vvvvvv is greater than ww, activate the next code
C2xxxxxx yyyy - copy yyyy bytes from address xxxxxx to...
80zzzzzz 0000 - ...the address zzzzzz

These devices have led to the emergence of a rich and active code hacking scene, where code contributors would use dedicated hardware interface, sometimes connected to their own computer, in order to explore and discover interesting codes that could be shared in the community. These days, such setup tend to be replaced by emulators that provide much faster workflows as well as many more tools to explore a console's memory.

Install Tonyhax International

There are several ways to run Tonyhax International. In my opinion, the nicest and fastest one is to repurpose... an existing GS/AR device (oh the irony). The vast majority of PSX GS/AR devices, and clones, are not running mask ROMs but an EEPROM which will vary in size, from 128K to 384K, maybe bigger. For Tonyhax 128K is enough. To flash the GS/AR device, you can do it directly from the PSX, it's quite amazing really. And fear not, if you want to use the original GS/AR software in the future, you can use Unirom and its ever growing collection of contributed ROM dumps from pretty much all GS/AR/clones PSX devices ever made, which also means that you can also flash other or more recent GS/AR software if you're into this.

Let's make ourselves a Tonyhax International device instead :)

 sudo cdrdao write --speed 1 --eject 'tonyhax-rom-flasher.cue'
  • plug your action replay thing, insert the CD in the PSX, and boot the Tonyhax flasher using whatever preferred exploit/modchip/swap trick
  • make sure your EEPROM is detected properly (otherwise you may use Unirom to flash tonyhax-international-v1.x.x.rom not covered here but less complicated than it sounds)
  • press START to flash
  • done
  • poweroff the PSX and remove the CD
  • turn on the PSX, welcome to Tonyhax International

special save file

generate the save file

  • edit a text file that contains the dithering code(s) you want to use (you can use up to 255, but realistically the PS1 can't handle more than 139 per game on real hardware according to tonyhax documentation)
echo "80022144 0000" >  valkyrie_profile.txt  # disable dithering
echo "301F6274 0011" >> valkyrie_profile.txt  # save anywhere
  • generate the save file
./thigsgen valkyrie_profile.txt
  • if all goes well you will end up with a TONYHAXINTGS file, it's the save file :)
  • find a way to copy this save file to your PS1 save card, without dedicated hardware the "easiest" is with a... PS2... and uLaunchELF or one of the newer versions. Put the save file on a USB key, and copy it to the PS1 save card.

Enable the codes

  • Boot

Ref and futher reading

general codes

dithering off codes

tony hax docs

GS codes