logo RbVBA for Linux (x86)

Trainer and Cheats

arrow NOTE: Cheats, also referred to as cheat codes operate on the save state file that VisualBoyAdvance can create via Shift + F9 only. The ROMs or battery saves are NOT affected by the Trainer or cheat codes.

Cheats

What Are Cheats?

Cheats (cheat codes) are codes that modify certain values within a game such as lives or ammo. Enter cheats into the Cheats tab. You can create your own cheats using the supplied Trainer or you can type them in from another source.

The Cheat Code Format

Address.Bytes.Value for example:-

FEB3B.1.63 would set a single byte at address FEB3B to hexadecimal 63 (decimal 99). It is also possible to have 2-byte cheat codes for example 33A8.2.7FFF would set a 2-byte word at address 33A8 to hexadecimal 7FFF (decimal 32767) in little-endian format i.e. actually stored within the save state file as FF7F.

A Typical Cheat List

* CT Special Forces 2 - Back to Hell *
-= Machine Gun Ammo =-
33AF.2.3E7
-= Grenades =-
33AB.2.63
-= Health =-
33A3.1.65
-= Grenade Launcher Ammo =-
33B5.2.3E7
-= Flame Thrower Ammo =-
33B1.2.3E7
-= Lives =-
332B.1.9

It is possible to enter anything into the cheat list and the above example is a format that I am content with, but you are free to design yours as you like. Only valid enabled cheats can be applied to the save state file which is always #9 i.e. the save state file that is created by pressing Shift + F9 from within VisualBoyAdvance. Cheats must be enabled (checked) before pressing the Apply button otherwise nothing will be applied.

Cheat Code Files

Cheats can be saved to their own game related file. The cheat codes will be saved to gamename.rcf in the folder specified in the RbVBArc tab under Cheats. I suggest setting this path to a similar place you will have already set the battery, saves, snaps and covers to for example /home/user/.VisualBoyAdvance/cheats/. Cheat codes are always referenced in hexadecimal format although it is possible to display their values in decimal within the cheat list. When they are saved to file they are always stored in hexadecimal format.

An Example Use of a Cheat Code

Select CT Special Forces 2 - Back to Hell in the game list.
Play the game, start a mission and then press Shift + F9 to save state #9. Quit back to RbVBA.
Select the Cheats tab, press New and type in 332B.1.9. Click the checkbox to enable it or press the space bar to toggle it on. Press Apply.
Play the game again and press F9 to load save state #9. Now you have 9 lives!

Thus the sequence is Play arrow Shift + F9 arrow Quit arrow Apply arrow Play arrow F9. There is no realtime Gameboy memory hacking; this is a save state system.

Cheat Code Tips

tip For 4-byte codes use two 2-byte codes e.g. 2317B.2.F23F and 2317D.2.4 which would be 999999 decimal.
tip Pressing Enter or F2 with a selected cheat code will enter edit mode.
tip Clicking a selected cheat code will enter edit mode.
tip Pressing Delete with a selected cheat code will delete it.
tip Pressing Insert with the cheat list selected will Add a new cheat.
tip Pressing Space with a selected cheat code will toggle it enabled/disabled if it is valid.
tip Drag and release unselected cheat codes to move them within the list.

The Trainer

What is the Trainer?

The Trainer is a system to search for values that could represent number of lives, number of bullets, health, level etc. The Trainer within RbVBA is a save state Trainer, meaning it operates on save state files. This system is different to Trainers that operate persistently on memory.

The Two Types of Search

There are two different search methods depending on what you are searching for. One is the Known Value Search and the other the Unknown Value Search. Known values are values such as those that represent bullets or grenades, unknown values represent health bars.

An Example Using the Known Value Search

Throughout use of the Trainer there are Context Sensitive Instructions at the top. Read them until you are familiar with the system.

Select Advance Wars in the game list.
Play the game, start the War Room level Spann Island using Andy and then press Shift + F9 to save state #9. Quit back to RbVBA.
You will notice you have 5000 funds. Select the Trainer tab, enter 5000 (decimal) in the Known Value text box and press Enter (or click Search). Play the game again (you can use the Play button on the Trainer tab) and reload save state #9 with F9.
Build one infantry unit for 1000 so that you have 4000 remaining. Save the state again with Shift + F9 and quit back to RbVBA.
In the Known Value text box enter 4000 and press Enter. This time you will see results in the Results list and you should only have one - 0002317B.2.0FA0. 0FA0 is 4000 in hexadecimal. Double-click this single result and it will be added to the cheat list on the Cheats tab which will be brought into view if not previously visible. We want more funds than 4000 so click the cheat code and edit it so that 0FA0 becomes FFFF then press Enter. It should now read 2317B.2.FFFF. Press Space to toggle the cheat code on and then click Apply. This will apply the cheat code to save state #9 only.
Press the Reset button on the Trainer tab as we have finished with the Trainer. Play the game again, reload save state #9 (F9) and now you have 65535 funds!
That's it.

Advanced: the funds value in Advance Wars is actually 4 bytes so you can manually create a new cheat code 2317D.2.E and apply that too which would give you 983039 funds; more than enough.

An Example Using the Unknown Value Search

This system is quite difficult to explain using an example because it differs considerably depending on what game you are playing and what you are searching for, so I will just explain the process.

You want to search for the value that represents your characters health but you don't know what the value is as it's just a bar, no numbers. For this you can use the Unknown Value Search. The first time you use this method you simply press Search to initialise it. Thereafter you describe the difference between the previous value and the current value. Perhaps your health bar was full and you have taken damage so now your health is less than it previously was, so you click the less than button (<). Maybe your health has been increased by a power-up so now your health is greater than it previously was (>), maybe it's been the same for some time (=) or not the same (<>). The point is you must describe how the current value relates to the previous value and keep repeating this process until you have reduced the results to something useable. It is not uncommon to finish with 8 or so results after 10 iterations of the process. More so than the Known Value Search, this method relies on you understanding what you are looking for and being able to distinguish it.

I have used this method to search for the health bar in CT Special Forces 2 - Back to Hell. It took 11 iterations to get 6 results and I could see the result which would generate a cheat code because it was similar to others I had found and wildly different to the other 5 results. The code is 33A3.1.64 (64 hex is 100 decimal).

Trainer Tips

tip If you are using the Known Value Search and are searching for hex 7F (a single byte) but want to search for a 2-byte word then use leading zeros - 007F. Using decimal this would be equivalent to 127 (single byte) or 00127 (2 bytes).
tip Don't mix number formats i.e. search for decimal values but leave the results and cheats showing hexadecimal otherwise you will get confused. The ability to switch number formats should be used as an aid, but mostly it is best to use the default settings.
tip When using the Unknown Value Search, use as many different combinations of comparisons as possible. Don't just use less than, less than, less than, try to use it randomnly to reduce the search iterations.

Valid HTML 4.01 Transitional blank1x1 Valid CSS! blank1x1 Get Firefox! blank1x1