Any examples for these CodeBreaker types of codes. I understand most, but not these few

gukingofheart

Well-Known Member
OP
Member
Joined
Feb 2, 2022
Messages
232
Trophies
0
Age
124
XP
433
Country
United States
This is a Life Code, & I used 6.
630042BC 0008

If I have 9(value of 8) lives, it changes to 1.
Having 1 life kills me if I die... and I can't get a life either.
----------

This is a Life Code, & I used 2.
230042BC 0008

I keep gaining 8 lives, anytime I die or get a 1-Up.

is AND a subtract? OR is add?


4aaaaaaa yyyy [aaaaaaa+0..(cccc-1)*ssss]=yyyy+0..(cccc-1)*ssss
iiiicccc ssss parameters for above code
5aaaaaaa cccc [aaaaaaa+0..(cccc-1)]=11,22,33,44,etc.

https://web.archive.org/web/20071019040951/http://etk.scener.org/?op=showtutorial&st=5
4 has an example, but not sure how 5 works.

Got ideas on what kind of codes I could make with either... My theory is, a Stat code for a RPG to make all stats 255.

"IF then next code"
Can I do multiple IF statements?
(I'll find out soon, as I plan on testing... but figured I'd ask, just incase if someone knows)
Edit: Can't do multiple If statements like I wanted.
Edit2: Found a simple way to do multiple if statements by simply increasing values for each IF statement being true.
 
Last edited by gukingofheart,

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
Most tend not to use Codebreaker but hey
https://problemkaputt.de/gbatek.htm#gbacheatcodescodebreakerxploder
Code:
2aaaaaaa yyyy  [aaaaaaa]=[aaaaaaa] OR yyyy

OR and AND are two of the Boolean logic operations (NAND, XOR, NOR and NOT for the others). It is a series of things that are fairly fundamental to digital electronics and low level coding. Pick any digital electronics course or book you like (I was taught it initially in high school electronics) and you will find it covered, and if they don't explain it in a way that clicks for you then pick another until you get one.

basic premise in this case though
OR means you take two numbers and the result is high if either of the inputs are high. In practical terms this means if you OR something with 1 you make it high or if you OR it with 0 then it is only high if the input is high. Used then mostly to set a bit high leaving all the others alone.
0011 1111
1000 0001
If I OR them together
1011 1111

AND takes two inputs (or more later but more things are limited to 2 inputs for the purposes of coding) and they are only high if both inputs are high.
In practical terms this is often used to set bits low as if you AND with 0 that means it is never going to be high (usually this means AND with 1 for everything else but the bit you want to set to 0 which means they will be high only of the original is and the thing you want set to 0 will be assured to not be as one of the inputs is).
Example, same as before
0011 1111
1000 1111
Results in
0000 1111

Probably could have picked better examples that cover all the eventualities but I will leave that to whatever Boolean logic in depth explanation you end up picking.

Both then are useful if you have flags maybe contained in one big number and want to set things not knowing what the rest is -- can't just add or subtract as you don't know what the original number is, and can't just set the number either as it will also wipe out all the other flags (or set them) when you might not want that -- if you have say poison, burn, paralyse, sleep... rather than wasting a byte or two for something that is on or off then many games (especially the really old systems, you kind of had enough memory to waste by the GBA but would still be bad form) would bundle them all together into one number like it would also be doing for aspects of the system anyway and use that instead (indeed likely using the Booleans to "extract" the relevant bit for the checks).
A game might even do it internally -- maybe you are inherently poisoned by being in a location so it will flip the poison option constantly and leave all the others alone. Or I was playing an earlier final fantasy one time and there is a supposedly magnetic cave that would paralyse you if you had metal weapons or armour which forced you to play with certain weapons and armour for that particular scenario/scene/mission, and another for Final Fantasy 9 that had a thing that disabled magic by constantly silencing your characters (me thinking what a nice time to train my mages and going with them rather than the heavily suggested party of fighters which made for a challenging section and expensive on the potions).
You can do useful things in the lives or max life scenarios as well. Say the game has a max of 255 (1111 1111 in binary, FF in hex) and you can't find or won't edit a separate max health value. If you constantly AND with with 0111 1111 (7F hex, 127 decimal) then the max is now 0111 1111 but the rest of the numbers will remain the same as they started out and be calculated as normal (damage, healing, enemy detection of it and resulting reaction*).
Also useful if the number is signed to set the upper bit as setting it to 0 is likely to mean it is positive (depending upon the method of doing the signed numbers anyway -- simply using the upper bit means there are two values for 0 which can make logic complicated so usually something like the twos complement method is used instead which gets away from things there).

You may also later move into control hacks. Boolean logic is good here for some types of them to set bits to make it look like another button was pressed.
Or to set things to 0 so it does not have to have to check the values for up and a, down and a, left and a, right and a, a and b, a and start, up and a and b and start... and instead just be what you want. Or alternatively if you have ever had to let go of buttons to do an action then the original devs did not do their Boolean logic on the control state and instead went for a raw read. Not so bad for a menu based effort but pretty killer/bad controls for an action game or platformer (or at least a way to maybe lessen the potency of an ability if you have to stop and then use it).
Or combine the two (AND everything to wipe out the rest, leaving one number you can put into the IF to in turn set another thing as button pressed thus gaining a control remap).

*boss hits a health amount and suddenly activates rage mode or something. Or alternatively maybe the enemies in a RPG target a player with less health.

You mentioned addition. It appears there is an option under the E code
https://problemkaputt.de/gbatek.htm#gbacheatcodescodebreakerxploder (not covered on enhacklopedia, don't know if that means enhacklopedia is incomplete or covers an older version without it -- addition historically not always being an option in cheat engines).

As far as stacking/nesting IF commands you should be able to. If nothing else I have seen a few button activator cheats have their own comparisons further into the cheat. Might be a weak engine in your chosen emulator or flash cart though (few people use codebreaker format stuff so such things can fall by the wayside).

The two line code starting with 4 is what is called a slide code
https://doc.kodewerx.org/hacking_gba.html#cba has a bit clearer explanation.
Say you have 30 slots in an inventory each corresponding to a number of items and you want max in all of them. You could waste 30 cheat lines (some engines might not even allow for this) doing all of them one by one, older systems might even force you to, but here they saw fit to give you a slide code which says for the next however many addresses set this value. You get a bit more flexibility in that you can also set the address increment so it is not one byte after the other (if the stats in a party are each character ATK DEF CON INT and you only want to set ATK high then you can basically increment to skip the rest of each character's stats and land on the next ATK for the next character). You can also set the value increment, in this case for value increment if it was the inventory method I discussed in the other thread where you have the indicator value of the item (01 = starting rusty dagger, 02 = first shop dagger, 03 = steel dagger in second town... 20 = final boss dungeon ancient magic mythril dagger) and then the corresponding amount of them you have you could do either two slide codes (one to do the value so you have the item value set and then another to just set them all to 99) or if it is short enough to be all in one value (4 hex values is 255 item choices and 255 maximum items, more than enough for most RPGs)
5 is another type of slide code but rather than the maths options above it instead allows you to set a pattern and it will repeat that across its range
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
EDIT: Can I turn an IF STATEMENT, into 8 Bytes. I just learned that things can break with 16 Bytes.

Is it possible (without a super long code), to have something trigger if a Timer is Less than 100 seconds.
I can do Less than 9 seconds easy, but this means it will do less than 309, 299, 289, 279 etc.

I learned after constant testing, that 330054e2 reads the most left digit & middle digit (330054e4 only works for the right digit), but it Mirrors it.
290 seconds equals 09 02. 280 seconds equals 08 02.


Best method I found, that I could think of is doing an IF statement for 10, 20, 30, etc.. since the second digit will be below 0, I made sure it won't trigger above 100.

730054e2 0100
330054D0 0004
730054e2 0200
330054D0 0004
730054e2 0300
330054D0 0004

PS. If it's not simple without a long code, then this is fine.. as I'm more curious, then actually needing this.

I don't know if you are encountering either endianess (most systems that are not the X86 PC will tend to flip numbers around, see little endian vs big endian) or sometimes I have seen timers do something called BCD (binary coded decimal) wherein the numbers are broken out into sub divisions that are more human readable than plain binary. The latter is a rare thing nowadays but if you were looking up the Boolean logic thing from before then such a thing is probably the chapter after in whatever electrical engineering text you ended up with.
It is rarely seen nowadays used in anger (I believe the DS firmware has it for a date format or something somewhere) but timers in older games (which I suppose the GBA is nowadays, was more prevalent in older still systems though which this might well be a port of that the coders carried over. Also another reason why timers can be a pain to work with) and as a means of doing fractional values or large values* if you don't want to do floating point or some aspects of fixed point (which this kind of is) being some of those occasions.

*2^16= 65,536 which is a large number but not much if you are simulating a casino in a game as a millionaire.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    BakerMan @ BakerMan: BO1 is good, all 3 modes are good in that game