Set Gold Value ASMC

I did this one for Arch but it’s very flexible, easy to change, very small(0xF bytes long) and I think more folks than just him can make use of it.

01 49 02 48 08 60 70 47 00 BC 02 02 04 03 02 01

To figure out what value to set, take the decimal number you want, convert it to hex and then reverse it(0x12345678 become 0x78563412) The 01,02,03 and 04 at the end correspond to the 1st, 2nd, 3rd and 4th bytes of the value to set. The gold value is a word, meaning it’s 32 bits or 4 bytes long so when you convert the number to hex you need to put 0’s at the beginning to make it 8 digits long.

Have an example: Say I want to make the current gold 20,000; 20000=0x4E20 which then becomes 0x00004E20 to make it 8 digits, then reverse to get 20 4E 00 00. So you make the last four bytes in the routine 20 4E 00 making it:

01 49 02 48 08 60 70 47 00 BC 02 02 20 4E 00 00

To call the routine, paste it somewhere in your ROM at a word aligned offset and call it in your events with ASMC Offset + 1

Enjoy guys

4 Likes

For FE8, your money is stored at 0x0202BCF8, so the routine would go like so:

01 49 02 48 08 60 70 47 F8 BC 02 02 04 03 02 01
1 Like

Maybe I should make an equivalent of the gold requirement for FE8