Idea: "Register Machine" to increase Cheat Engine
Posted: Thu Apr 20, 2006 8:51 am
Just a thought on how to use the remaining undesignated space in the 32-bit cheat specification (that would be the A0000000-E0000000 area, I think).
It came across as I was looking for Game Boy Advance cheats. Right now, no GBA emulator that I know of has a powerful enough cheat engine to do relative addressing (GSA and CBA do only a zero-offset RA, which isn't really useful). As an example, the 3G Pok?mon games extensively use RA to store crucial game data (to deter aspiring Gamesharkers), so much that there are a LOT of kludges in terms of GSA and CBA codes to rig the random number generator or otherwise work around the RA mechanism (and for the most part, they unnecessarily corrupt data and requires very specific working conditions).
One thing in the 3G Pok?mon games is that the item pocket is a series of RA cheats (for example, in Emerald the item pocket starts at [03005D90] + 150C), in which the item is a straightforward RA and the quantity is xor-encrypted, with the encryption key stored in another RA (I'm not sure if it's [03005D90] + AC or [[03005D90] + AC]).
Obviously, this kind of thing is simply too much for the GBA emulator's cheat engine (or for GSA and CBA). It's even too much for the MAME cheat engine if a MAME game had some data stored in this manner.
My idea is admittedly taken from CheatScript, but in a much more simpler way. For those of you who don't know, CheatScript is an idea to bring a VM for complex cheats, including UI details and stuff. From that I borrow the idea of having 32 32-bit registers, and using cheat types themselves as operators on those registers (the fact that a cheat has three data fields also proves convienient...).
As we know, a multipart cheat executes its parts in the order the parts are listed. If we add cheat types for the register operations, we effectively create a simple register machine. With a register machine, we could make very complex nonbranching cheats in this manner (branching is considerably more difficult, and perhaps is why we might still need CheatScript, or at least have the ability to activate a cheat from another cheat). Cheats requiring double-indirection, or indirect offsets and indirect base addresses (both of which have been found in MAME games but were unable to implement elegantly, IIRC) would become very trivial with proper usage of load and store instructions. We can easily deal with encrypted values, and perhaps with a little bit of greasemonkeying around, we can finally build enumerations (in the sense that selecting a value from an enumeration will automatically write values into some registers) so that we can finally get multipart list cheats (a good way to shrink the appearance of the ddsom cheat list in the UI...).
This might seem overly ambitious (and/or even redundant), but what do you think of this idea?
It came across as I was looking for Game Boy Advance cheats. Right now, no GBA emulator that I know of has a powerful enough cheat engine to do relative addressing (GSA and CBA do only a zero-offset RA, which isn't really useful). As an example, the 3G Pok?mon games extensively use RA to store crucial game data (to deter aspiring Gamesharkers), so much that there are a LOT of kludges in terms of GSA and CBA codes to rig the random number generator or otherwise work around the RA mechanism (and for the most part, they unnecessarily corrupt data and requires very specific working conditions).
One thing in the 3G Pok?mon games is that the item pocket is a series of RA cheats (for example, in Emerald the item pocket starts at [03005D90] + 150C), in which the item is a straightforward RA and the quantity is xor-encrypted, with the encryption key stored in another RA (I'm not sure if it's [03005D90] + AC or [[03005D90] + AC]).
Obviously, this kind of thing is simply too much for the GBA emulator's cheat engine (or for GSA and CBA). It's even too much for the MAME cheat engine if a MAME game had some data stored in this manner.
My idea is admittedly taken from CheatScript, but in a much more simpler way. For those of you who don't know, CheatScript is an idea to bring a VM for complex cheats, including UI details and stuff. From that I borrow the idea of having 32 32-bit registers, and using cheat types themselves as operators on those registers (the fact that a cheat has three data fields also proves convienient...).
As we know, a multipart cheat executes its parts in the order the parts are listed. If we add cheat types for the register operations, we effectively create a simple register machine. With a register machine, we could make very complex nonbranching cheats in this manner (branching is considerably more difficult, and perhaps is why we might still need CheatScript, or at least have the ability to activate a cheat from another cheat). Cheats requiring double-indirection, or indirect offsets and indirect base addresses (both of which have been found in MAME games but were unable to implement elegantly, IIRC) would become very trivial with proper usage of load and store instructions. We can easily deal with encrypted values, and perhaps with a little bit of greasemonkeying around, we can finally build enumerations (in the sense that selecting a value from an enumeration will automatically write values into some registers) so that we can finally get multipart list cheats (a good way to shrink the appearance of the ddsom cheat list in the UI...).
This might seem overly ambitious (and/or even redundant), but what do you think of this idea?