Jump to content

Regarding the Medal Box and AR codes to modify it


ZigRaiserBlue

Recommended Posts

(I'm not entirely sure if this should be in RAM editing or save editing. Please move to the correct location if this is not correct.)

So for a personal problem: The date on my DS was completely wrong when I picked up some medals, and I find this personally frustrating.

I decided to see where the community was with modifying medals. As far as I can tell, save editing is complicated because the medal box is encrypted, so simple modifications to the addresses won't do much. I tried playing around with that area of the save file with a hex editor and couldn't seem to get anything to change. (That said, considering that apparently 2000 bytes change when you get a medal, I shouldn't be surprised.)

I know that there's effectively ONE AR code regarding medals, and that is one to set all medal conditions as met, which Kaphotics created:

94000130 FFFB0000

B2000024 00000000

C0000000 000000F6

00025C3C 00030000

DC000000 00000004

D1000000 00000000

D2000000 00000000

So I'm wondering if someone can help translate what each line of this code does, so that I may modify specific medals. (Such as unobtain them, if possible.) I understand that the 00030000 marks that the requirements have been met, and will be changed to the date when picked up, but I'm unsure of the rest of it.

Thank you in advance!

(I'm wondering if it's as straightforward as each medal being associated with an address, so all I would need to do is just directly modify the date section to fix the medals I'm unhappy with.)

Link to comment
Share on other sites

This is a great reference, though there's probably better if you look elsewhere.

(PDF) http://us.codejunkies.com/support_downloads/Trainer-Toolkit-for-Nintendo-DS-User-Manual.pdf

94000130 FFFB0000 - Button combination

B2000024 00000000 - Sets offset to 0x2000024

C0000000 000000F6 - Loop 0xF6 times

00025C3C 00030000 - 32 bit write of 0x00030000 to 0x0025C3 + offset

DC000000 00000004 - Adds 4 to offset

D1000000 00000000 - End Loop

D2000000 00000000 - End Code

Edited by evandixon
fixed comment about second line, thanks to Kaphotics for indirectly pointing it out
Link to comment
Share on other sites

94000130 FFFB0000 - 9 'if' ~ 4000130 is FFFB. activator button = pressed

B2000024 00000000 - B instruction means load value at 0x2000024 as a pointer

C0000000 000000F6 - C instruction is a repeat type instruction, 0xF6 times (0xFF total, see post bottom)

00025C3C 00030000 - 0 instruction means write 32bytes at pointer+0x0025C3C, with a writevalue of 0x00030000

DC000000 00000004 - DC instruction says to increase our pointer value by 4

D1000000 00000000 - D1 instruction says to end the repeat loop

D2000000 00000000 - D2 instruction... end instruction/code.

humanly readable:

if button=select then

offset=read32(0x02000024)

for i=1,0xF6 do
	write32(offset+0x25C3C,0x00030000)
	offset=offset+4
end

end

0x00030000 just happens to be the value that tells the game to "give player this medal". I skip the easy medals you get at the start to save the user time; total of 246 or so medals have to be picked up. If any of the u32's = 0x00030000, the medal guy appears to give you 'em.

It just makes it so you get awarded them naturally (skipping the step of satisfying the criteria, which then flags it to award).

Link to comment
Share on other sites

Oh wow, this is great. I didn't know about this resource. Thank you very much! Now hopefully I can figure out how individual medals work.

Edit: Thanks Kaphotics. It occurred to me that what you had was a straightforward loop function after evandixon explained what it did.

So unfortunately for me, your code does not modify the medal box directly, but instead just sets the flags for criteria completion. Still, that's a start for me. Thank you.

Second edit: Okay, so what I want to be doing is using a D5 instruction to set the stored value (date) pertaining to specific addresses, then use D6 to write the value in. So all I have to do is find the location of the three medals I want to modify, and use those two instructions and I'll have pulled off what I wanted.

Huh. You Project Pokemon people are amazing. Thanks!

Link to comment
Share on other sites

No, it does modify the medal box. Although it is encrypted when the game is saved, during play it is not.

There was an old code which gave you all the medals on the same date, but I didn't like that one.

94000130 FFFB0000 
B2000024 00000000 
D5000000 000CE50C 
C0000000 000000FE 
D6000000 00025C20 
D2000000 00000000

It sets the 32 byte medal field to 000CE50C, which is 28 Oct 2012 in the datetime format the games use. I'd not have a code that sets the date to the same 'probably hacked' date, so I made it a little more flexible.

Link to comment
Share on other sites

Yeah, I was looking at that one to figure out how to modify the dates I wanted.

And I agree with you, that was not a desirable outcome for "all medals". But it's useful for me because it demonstrates to me that 000CE50C is the date 28 Oct 2012, so if I can figure out how to change that to the date of my choice, I'll have achieved what I set out to do.

Link to comment
Share on other sites

Okay, so it could be that I'm screwing around with an EXP-patched rom, but 000CE50C is a strange field. The 0C is the year (and increments and decreases accordingly, with 2000 as the 00 value) And then E is the day (but multiplied by 2) and 5 is the month. (but again, multiplied by 2) I'm not sure what the 000C does, except that when changed to 000B, it turned all of the medals into hint medals.

And at 0x80 for the year field, it goes back to 2000, but increments the month field by 1. Similarly, at 8 for the month field, it returns to 0, but increments the day field by 1. So I've figured out dates. Now I'll see if I can figure out which address corresponds to which medal.

And I apologize if all of this is already known.

Edited by ZigRaiserBlue
Link to comment
Share on other sites

And it figures, but sites like Serebii and Bulbapedia's medal lists are in the internal memory order, so starting with 25C20, it's every medal in the listed order with increments of 4.

So for example, I wanted to modify the date for the Good Souvenir Getter medal. That's 193 in the internal memory, so I convert that to hex and get 0xC1. Multiply that by 4, and I get 0x304. Now, the thing to remember is that the medal list starts at 1, not 0. So we've got to subtract 4 to account for that. Thus we get 0x300. I add that to the 25C20 and get 25F20, and presto, I have modified the date of that medal and only that medal.

So I've managed to fix the three medals that had the wrong dates, and I'm pretty happy with the outcome. Thank you all at Project Pokemon for helping me with this, I really appreciate it. For anyone who wants to do the same, I used the October 28th code, but removed the loop line as I'm only writing to one medal at a time.

I don't know if I've contributed anything useful to the Project Pokemon knowledge-base, but I hope I have. And again, thanks evandixon, Kaphotics and bond697.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...