Advertiser Content

Deokishisu

Mr. Magius

Male
If I'm online, it's a safe bet I'm at a computer.
Seen January 9th, 2019
Posted March 4th, 2018
859 posts
13.6 Years
Okay, so this is the coolest thing ever. I didn't even think to use my flashcart as an E-Reader.

As far as I know, the Wireless Adapter games (so everything but R/S) had e-Reader support in Japan. I found leftover translated text somewhere in Emerald for e-Reader functionality when I was manually decapitalizing things with my hex editor. Perhaps there's a way to reenable the menu for it? Some of the Japanese cards would be useless, mainly everything related to the Trainer Tower, as some of the e-Reader stuff was just programmed in and unlocked natively for the localizations.

It'd also be nice to rip apart the saves and see if it's possible to easily change what flag is activated by the card/what item the card gives, allowing custom "cards" that unlock different things in a hack. It'd be cool for doing event distributions. Set a flag with the e-Reader and suddenly an event opens up, or extra storyline, or whatever.

Edit: Colosseum had e-Reader functionality which was translated but blocked off to the player in localized releases. Could be worth a look if anyone has the hardware. I bet a flashcart (for the e-Reader with the correct Japanese data) and a hacked Wii with a modified Colosseum iso/save file would be all you'd need to unlock the extra Shadow Pokemon.

esperance

Age 22
Male
Ohio
Seen 6 Hours Ago
Posted June 23rd, 2019
3,827 posts
9.5 Years
This is really cool! It's pretty amazing that you've figured this all out.

Also, here are two better (in my opinion) ways of doing the checksum, assuming that I read how it was done correctly:

This first one is similar to what you've already got, but it uses bitwise operations:
uint doTrainerChecksum(byte[] data)
{
  // Check if data length is divisible by four
  if (data.Length % 4 != 0) throw new Exception("Data length must be divisible by 4!");
  
  // This is the same as what you have, except it uses bitwise operations
  uint sum = 0;
  for (int i = 0; i < data.Length - 4; i++)
  {
    sum += (uint)(data[i] << (8 * (i % 4)));
  }
  return sum;
}
This one uses a .NET helper class:
uint doTrainerChecksum(byte[] data)
{
  // Just change this if I got the format wrong
  if (data.Length != 0xB8) throw new Exception("Invalid data size!");
  
  // This is what's important
  uint sum = 0;
  for (int i = 0; i < data.Length / 4 - 1; i++)
  {
    sum += BitConverter.ToUInt32(data, i * 4);
  }
  return sum;
}
Hope that helps!

Touched

Resident ASMAGICIAN

Male
Seen February 1st, 2018
Posted October 19th, 2017
626 posts
5.2 Years
This one uses a .NET helper class:
uint doTrainerChecksum(byte[] data)
{
  // Just change this if I got the format wrong
  if (data.Length != 0xB8) throw new Exception("Invalid data size!");
  
  // This is what's important
  uint sum = 0;
  for (int i = 0; i < data.Length / 4 - 1; i++)
  {
    sum += BitConverter.ToUInt32(data, i * 4);
  }
  return sum;
}
Hope that helps!
Wouldn't changing that loop to increment by 4 instead of 1 make that more readable?

A Pokemon that is discriminated!
Support squirtle and make it everyone's favourite.

esperance

Age 22
Male
Ohio
Seen 6 Hours Ago
Posted June 23rd, 2019
3,827 posts
9.5 Years
Wouldn't changing that loop to increment by 4 instead of 1 make that more readable?
Yes, it probably would.
But, from what I know of C#, making the loop increment by 1 as opposed to 4 seems to be just a tiny bit faster (as in a barely noticeable difference).

But, here's a version using your suggestion:
uint doTrainerChecksum(byte[] data)
{
  // Just change this if I got the format wrong
  if (data.Length != 0xB8) throw new Exception("Invalid data size!");
  
  // This is what's important
  uint sum = 0;
  for (int i = 0; i < data.Length - 4; i += 4)
  {
    sum += BitConverter.ToUInt32(data, i);
  }
  return sum;
}

sab

Now too much of a life.

Age 23
Male
Midgar
Seen September 15th, 2018
Posted June 17th, 2018
998 posts
11.2 Years
with the proper cheating devices (I really wish I had one of these) that support ROM-area writes...
I have two "broken" gamesharks sps and an action replay max duo. All the hardware works, but they were on the old firmware which broke when you ran multiple codes at once. Supposedly gamesharks can be updated to run the action replay firmware which supports rom patch slots, so that would work as well. There are also lists of the data structures and their capabilities that I have been using with my action replay to write rom patching codes for pokemon emerald on actual hardware. I can't give you the working action replay max duo, but if you think you might be able to flash one of the gameshark sps, or can tell me how to do so in a decent way, I would be happy to send you one. Also, if you want to know all the data structures for the codes and how the encoding works, let me know. I've got all the documents/software for that. I also have the necessary hardware to dump roms, saves, and the ability to dump ereader card codes if that's helpful. Also, I've found that you really need photo paper to print codes and use them on actual hardware. Normal printer paper is just too grainy. I'm really excited that someone is actually looking into this after all these years, and would be happy to assist if any of that sounds useful.

sab

Now too much of a life.

Age 23
Male
Midgar
Seen September 15th, 2018
Posted June 17th, 2018
998 posts
11.2 Years
I don't know if mine can be updated, actually...
You are correct, I was mistaken. It is only actual gamesharks that can be updated and not SPs. My post has been updated to reflect this. If you do come across one of the old game sharks, here's how you'd update it for anyone interested.
http://akadewboy.awardspace.com/gbacheats/mirror.htm
Sadly, the GBA Action Replays tend to go for around $50 on ebay, which is pretty painful.

Ammako

I hate you. You know who you are.

Seen February 1st, 2018
Posted November 20th, 2017
534 posts
11.6 Years
Hm, that's weird, I had been able to use my 3in1 to simulate an e-Reader with the Eon Ticket save file just fine a few years back.
3in1 supports 128KB save files so unless you had patched it wrong, it shouldn't have patched it to 64KB SRAM. Just patched it for the 3in1, added the Eon Ticket save file to it, and it worked fine.

Guess it doesn't really matter anymore, but I thought that was weird. :p

Deokishisu

Mr. Magius

Male
If I'm online, it's a safe bet I'm at a computer.
Seen January 9th, 2019
Posted March 4th, 2018
859 posts
13.6 Years
I know that this is probably a stupid question (because you probably have), but have you looked at GBATEK's e-Reader section? I was going through GBATEK out of boredom and came across something that may help with your region error issue.
Spoiler:
GBA Cart e-Reader Data Format
Data Strip Format
The size of the data region is I*48 bytes (I=Interleave Value, see Dotcode Format), the first 48-byte fragment contains the Data Header, the remaining (I-1) fragments are Data Fragments (which contain title(s), and VPK compressed program code).

First Strip
Data Header (48 bytes)
Main-Title (17 bytes, or 33 bytes)
Sub-Title(s) (3+18 bytes, or 33 bytes) (for each strip) (optional)
VPK Size (2 byte value, total length of VPK Data in ALL strips)
NULL Value (4 bytes, contained ONLY in 1st strip of GBA strips)
VPK Data (length as defined in VPK Size entry, see above)

Further Strip(s)
Data Header (48 bytes)
Main-Title (17 bytes, or 33 bytes)
Sub-Title(s) (3+18 bytes, or 33 bytes) (for each strip) (optional)
VPK Data (continued from previous strip)

Data Header (30h bytes) (1st fragment)
00h-01h Fixed (00h,30h)
02h Fixed (01h) ;01h="Do not calculate Global Checksum" ?
03h Primary Type (see below)
04h-05h Fixed (00h,01h) (don't care)
06h-07h Strip Size (0510h=Short, 0810h=Long Strip) ((I-1)*30h) (MSB,LSB)
08h-0Bh Fixed (00h,00h,10h,12h)
0Ch-0DhRegion/Type(seebelow)
0Eh Strip Type (02h=Short Strip, 01h=Long Strip) (don't care)
0Fh Fixed (00h) (don't care)
10h-11h Unknown (whatever) (don't care)
12h Fixed (10h) ;10h="Do calculate Data Checksum" ?
13h-14h Data Checksum (see below) (MSB,LSB)
15h-19h Fixed (19h,00h,00h,00h,08h)
1Ah-21h ID String ('NINTENDO')
22h-25h Fixed (00h,22h,00h,09h)
26h-29h Size Info (see below)
2Ah-2Dh Flags (see below)
2Eh Header Checksum (entries [0Ch-0Dh,10h-11h,26h-2Dh] XORed together)
2Fh Global Checksum (see below)

Primary Type [03h] is 8bit,
0 Card Type (upper bit) (see below)
1 Unknown (usually opposite of Bit0) (don't care)
2-7 Unknown (usually zero)

Region/Type[0Ch..0Dh]is16bit,
0-3 Unknown (don't care)
4-7 Card Type (lower bits) (see below)

8-11Region/Version(0=Japan/Original,1=Non-japan,2=Japan/Plus)
12-15 Unknown (don't care)

Size Info [26h-29h] is 32bit,
0 Unknown (don't care)
1-4 Strip Number (01h..Number of strips)
5-8 Number of Strips (01h..0Ch) (01h..08h for Japan/Original version)
9-23 Size of all Strips (excluding Headers and Main/Sub-Titles) (same as "VPK Size", but also including the 2-byte "VPK Size" value, plus the 4-byte NULL value; if it is present)
24-31 Fixed (02h) (don't care)

Flags [2Ah-2Dh] is 32bit,
0 Permission to save (0=Start Immediately, 1=Prompt for FLASH Saving)
1 Sub-Title Flag (0=Yes, 1=None) (Japan/Original: always 0=Yes)
2 Application Type (0=GBA/Z80, 1=NES) (Japan/Original: always 0=Z80)
3-31 Zero (0) (don't care)

Data Checksum [13h-14h] is the complement (NOT) of the sum of all halfwords in all Data Fragments, however, it's all done in reversed byte order: checksum is calculated with halfwords that are read in MSB,LSB order, and the resulting checksum is stored in MSB,LSB order in the Header Fragment.

Global Checksum [2Fh] is the complement (NOT) of the sum of the first 2Fh bytes in the Data Header plus the sum of all Data Fragment checksums; the Data Fragment checksums are all 30h bytes in a fragment XORed with each other.
Taken from HERE. I rainbow'd the relevant parts. The problem you're facing could be as simple as changing the region bits in the card's data and recalculating the checksum. Not as great a solution as making the game accept Japanese cards in the first place, but by forcing the card to be non-Japanese, maybe you can get English Firered to accept it?

This spoiler is just to ping you:
Spoiler:
...
Advertiser Content