Thread: Development: Set Disobedience
View Single Post
Old August 7th, 2010 (12:42 PM).
colcolstyles's Avatar
colcolstyles colcolstyles is offline
Yours truly
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Posts: 1,585
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'.

Brother of Vrai
Reply With Quote