Thread: Development: Set Disobedience
View Single Post
Old August 7th, 2010 (1:24 PM). Edited August 7th, 2010 by metapod23.
metapod23's Avatar
metapod23 metapod23 is offline
Hardened Trainer
    Join Date: Mar 2009
    Gender: Male
    Nature: Timid
    Posts: 673
    Originally Posted by colcolstyles View Post
    Sorry for the delay. The game uses a very long and inefficient way to perform the modulo operation and it does it about 6 times before it actually starts to edit anything. D:

    Well from what I can tell, the game is editing the last byte of the Growth substructure. There is no documentation on that piece of data which means that is possible that it controls obedience. The guy who wrote that article seems to think that it's a halfword (16-bit) but the game reads from it using ldrb so I'm guessing that it is actually two bytes. The 'setobedience' command takes whatever value is stored there, 'and's it with '0x7F' (i.e., clears the most significant bit), 'orr's that with some other value (it was '0x80' for me) and then stores the final result back in the Growth substructure. I'll look more into it later but right now I have to go run a few errands. If anyone's interested, the routine that does what I mentioned above is located at '0x08040A82'.
    That's interesting, thanks. Don't worry about delays, take your time. I appreciate the effort.

    Oh, and I thought that ldrb was for reading one byte, and that two bytes = 16 bits. So if the game uses ldrb, it's only loading one byte?
    Reply With Quote