Main Menu
Main Page
Forums
Recent changes
Random page
Help

Databases
GlitchDex
AttackDex
ItemDex
TrainerDex
TypeDex
UnownDex
More

Major Glitches
Trainer escape glitch
Old man trick
Celebi Egg trick
Select glitches (Japan)
SRAM glitch
CoolTrainer♀ corruption
LOL glitch
Rival LOL glitch
Super Glitch
ZZAZZ glitch
Pomeg corruption glitch (Glitzer Popping)
Tweaking
Elite Four door glitch (Japan)
Pokémon merge glitch
Pokémon cloning
Time Capsule exploit
Arbitrary code execution
Coin Case glitches
More

Other Glitch Categories
Glitches by generation
Glitches between two generations
Japan-only/language specific glitches
Music glitches
Natural glitches
Non-core series glitches
Non-Pokémon glitches
Officially acknowledged glitches
Recurring glitches
Dead glitches

References
Pokémon GameShark codes
The Big HEX List
Glitch Pokémon cries
GB programming
Curiosities
Debugging features
Easter eggs
Error traps
Glitch areas
Glitch myths
Non-glitch exploits
Placeholder texts
Pokémon glitch terminology
Unused content and prerelease information

Useful Tools
8F Helper
GBz80 to Items
Old man trick name generator
PATH (Prama's Advanced Tweaking Heaven)
Save file editors
Special stat/Pokémon converter
Trainer escape Trainer Pokémon finder

Affiliates
Legendary Star Blob 2 (Hakuda)
Pokémon Speedruns wiki
PRAMA Initiative
Become an affiliate!

Technical
Site Source Code

Search Wiki

 

Search Forums

 

Author Topic: Anatomy of an e-Reader Mystery Event  (Read 13379 times)

0 Members and 1 Guest are viewing this topic.

Evie ✿

  • Administrator
  • *****
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #15 on: November 24, 2014, 04:43:42 pm »
Thanks for your reply.

Interesting. Is that Berry data in the final game too?
No. It doesn’t even exist coherently in the debug ROM—it’s pieced together at runtime from the actual Cheri Berry data and a few scattered strings—but those strings aren’t in the final Japanese ROM.

Oh, OK.
Hi! I identify as transgender female.  She/her pronouns, please.

Online I most often use the username Torchickens or Chickasaurus.



Thank you Aeriixion for the cute sprite above! :) Roelof also made different variations of the sprite (which I animated).

Contact:

Email Youtube Twitter
Skype: Torchickens
Bulbapedia Starfy Wiki

I like to collect interesting video games.
https://www.vgcollect.com/Torchickens

The psychology of birth (including spiritual birth): pain>acceptance/courage in face of pain>embracement>unconditional love and strength

Beyond all philosophies are the things that go best for you; what makes you feel content. It's important to always follow your heart, so unless you feel perfectly happy about it don't just follow something because it is popular, fits a style or is conventional. Sometimes you may reach a point you're not sure who you are, but as things settle I'm convinced things do work out in time.

Háčky

  • Distinguished Member
  • *
  • Offline Offline
  • Pick which packet as an error?
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #16 on: November 25, 2014, 03:46:16 am »
$45E606: In-game clock adjustment?
The type $0E chunk has zero bytes of data, and results in the message „Das spielinterne Zeiteingabe-System ist jetzt verfügbar.“ (The in-game clock adjustment system is now useable.)

Does anyone know what the in-game clock adjustment system is? It didn’t enable me to change the time on the clock in my bedroom.

The “clock” function sends this. I’m not convinced of TCRF’s claim that this is related to the berry glitch.
Found it! After this Mystery Event is sent, pressing Left + Select + B on the game’s title screen will activate a screen that asks “Reset RTC? A: Confirm, B: Cancel”. It’s the same as the “Time in game” option on the debug ROM’s menu, but this makes it accessible on retail cartridges. I’ll certainly want to make an e-Reader card that activates this.

SatoMew

  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #17 on: January 26, 2015, 03:48:35 pm »
Does any of this apply to Japanese Emerald, considering that it has both Mystery Events from Ruby/Sapphire and Mystery Gift from FireRed/LeafGreen (video)?

Háčky

  • Distinguished Member
  • *
  • Offline Offline
  • Pick which packet as an error?
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #18 on: January 26, 2015, 06:32:47 pm »
Does any of this apply to Japanese Emerald, considering that it has both Mystery Events from Ruby/Sapphire and Mystery Gift from FireRed/LeafGreen (video)?
I didn’t know about that. It seems that Mystery Events in Japanese Emerald doesn’t accept any of the Ruby/Sapphire cards (I tried a Battle Trainer, a Berry, and the Decoration Present), giving the “cannot be used in this version” message. It also doesn’t accept the Trainer Hill cards that were released for Emerald, because those are for Mystery Gift. Was Mystery Events used for anything at all in that game?

My guess would be that the data structures are the same as for Ruby/Sapphire, and some version number needs to be changed in the headers to make a Mystery Events card be recognized as Emerald-compatible.

SatoMew

  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #19 on: January 26, 2015, 06:46:46 pm »
Was Mystery Events used for anything at all in that game?

I honestly don't know. I found out that it had both systems by accident/out of curiosity since all the sources I read mentioned that Japanese Emerald used the Mystery Events system instead of the Mystery Gift system used by the international versions.

Háčky

  • Distinguished Member
  • *
  • Offline Offline
  • Pick which packet as an error?
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #20 on: February 01, 2015, 12:17:22 pm »
My guess would be that the data structures are the same as for Ruby/Sapphire, and some version number needs to be changed in the headers to make a Mystery Events card be recognized as Emerald-compatible.
That was a good guess. Bytes $D and $E of the header are a version compatibility bitfield: bit 7 is Ruby, bit 8 is Sapphire, and bit 9 is Emerald. All released Mystery Events e-Reader cards have this field set to $180, allowing them to be used with Ruby and Sapphire but not Emerald. Changing it to $380 will make a card work with all three Japanese versions. Emerald seems to support the same data types as Ruby and Sapphire, with nothing new added. (Scanning a card with a chunk of type $11 or higher just produces the Japanese equivalent of “The event was safely loaded.”, implying it’s not doing anything.)

While I was experimenting with the header, another thing I discovered is that it’s actually treated as chunk type $01 (16 bytes long). If the initial $01 byte is replaced with a different chunk type, the game will still read the data, but anything involving pointers will behave wrong—sometimes spectacularly wrong! (That happened when I changed the Eon Ticket’s header to type $07 and the region code to Japanese. I think the game was trying to print the “Obtained a [name] BERRY! DAD has it at PETALBURG GYM.” message, but the name was something hideously long. no$gba eventually halted on an unknown opcode.)

SatoMew

  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #21 on: February 02, 2015, 06:05:15 pm »
Thanks for the reply, Háčky.

This Japanese Wikipedia article has info on Mystery Events and Mystery Gift.

Mystery Events:
Quote from: Wikipedia
『ルビー・サファイア・エメラルド』に登場。キャンペーンで配布される特殊なデータや、カードe+から読み込まれた新たなトレーナーやアイテムを追加できる(エメラルドではこの方法でのカードe+通信は不可)。

My translation: "Appears in Ruby, Sapphire, and Emerald. Special data was distributed in the campaign, and new Trainers and items can be added by reading the Cards e+ (Communicating with the Cards e+ in this manner is not possible in Emerald)."

Mystery Gift:
Quote from: Wikipedia
『ファイアレッド・リーフグリーン』と『エメラルド』に登場。カードe+から読み込まれた新たなトレーナーやマップを追加できる。出現には「ふしぎなおくりもの」と同様の手順が必要で、ワイヤレスアダプタ接続時には表示されない。

My translation: "Appears in FireRed, LeafGreen, and Emerald. New Trainers and maps can be added by reading the Cards e+. Shows up as 'ふしぎなおくりもの' and the process is identical. It is not displayed when the Wireless Adapter is connected."

I'm not sure if it makes sense, especially since my knowledge of Japanese is limited and I had trouble parsing the last two sentences on the Mystery Gift part.

Team Fail

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #22 on: June 05, 2015, 11:43:23 pm »
Considering this is a "significant reason" as per forum rules, I'll go ahead and post it here.

I've been working, for the past month, on e-Reader content and generating custom content for fangames, and I've come a long way even before I found this thread. Anyways, last night, I found some interesting content in copies of Pokémon FireRed's ROM, as well as similar data being in Emerald (I have backed up my own copies for this research (If you need proof I can provide it)). Anyways, there is a chunk of data in each game that is actually e-Card data that can be saved to a Card-e+ console and run. I'm not entirely sure what it's for though. After decompressing the VPK data (VPK data is the data that the RGBDS assembly creates, but as is, not re-compressed), I found similarities and important differences to the data that you have established.

Main differences:
1. The card is in ARM/Thumb rather than Z80
2. The cards do vastly different things from regular cards (They seem to take an e-Card for some form of input):

FireRed Card data:


Emerald Card data:


3. The 10-byte Unknown is actually different, although I'm not sure what the difference is supposed to be for yet (It shows as 00 00 00 00 02 55 00 00 00 00 in the data)

I'm not sure what this is for, perhaps could someone shed some light on this application? Also, if you guys want me to, I can upload the decompressed copies of these applications onto my dropbox if you'd like to take a peek at them or disassemble them. I'm trying to find what I can for game data in there, as well as the strings, but I've been preoccupied with other things at the moment.

Háčky

  • Distinguished Member
  • *
  • Offline Offline
  • Pick which packet as an error?
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #23 on: June 06, 2015, 12:05:34 am »
The Ruby/Sapphire Battle-e cards work by scanning them using the e-Reader’s “Scan Card” (カードリード) option. The FireRed/LeafGreen/Emerald cards require the e-Reader’s “Communication” (つうしん) option; if you try to scan them using Scan Card, you just get this message telling you to use Communication instead:



The e-Reader menu describes the Communication option as “Load application from Game Boy ® Advance or Nintendo GameCube ™.” I think what you’ve found is the application that’s sent to the e-Reader when this option is used.

Team Fail

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #24 on: June 06, 2015, 12:13:24 am »
Ah, that'd explain it, that was going to be my next theory, however, I don't have a Card-e+ so I couldn't test that without having region issues. I was given a large set of unnamed e-Cards and if memory serves, there's some of the cards that, presumably, these applications can use. I'll have to dig them out, but did you want a peek at those? You may be able to add them to your disassembly that you have going and it'd probably complete the set a bit more.

Háčky

  • Distinguished Member
  • *
  • Offline Offline
  • Pick which packet as an error?
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #25 on: June 06, 2015, 12:47:17 am »
Ah, that'd explain it, that was going to be my next theory, however, I don't have a Card-e+ so I couldn't test that without having region issues. I was given a large set of unnamed e-Cards and if memory serves, there's some of the cards that, presumably, these applications can use. I'll have to dig them out, but did you want a peek at those? You may be able to add them to your disassembly that you have going and it'd probably complete the set a bit more.
Nearly all of the Battle-e cards have been dumped and are generally available online; the ones that aren’t include seven cards from the Emerald set (19-A029, 19-A057~A060, 19-A062, 19-A064) and the Club Nintendo exclusive cards (08-N001~N008 and 15-N001~N004). There are a few other missing promo cards which I’ve recently obtained myself and will be dumping soon.

Team Fail

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #26 on: June 07, 2015, 06:21:09 pm »
I'll probably look at the FireRed-based cards for now then, I've been working for the past few hours to re-activate the e-Reader functionality in an English copy of FireRed to a varying degree of success.

SatoMew

  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #27 on: June 08, 2015, 04:51:31 am »
I'll probably look at the FireRed-based cards for now then, I've been working for the past few hours to re-activate the e-Reader functionality in an English copy of FireRed to a varying degree of success.

The localizations of FireRed and LeafGreen still have the e-Reader code from the Japanese versions, right? What about Mystery Events? I tried replicating this in the Japanese versions and it didn't work but they likely left it in completely unused, unlike in Japanese Emerald.

Team Fail

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #28 on: June 08, 2015, 01:01:23 pm »
I'll probably look at the FireRed-based cards for now then, I've been working for the past few hours to re-activate the e-Reader functionality in an English copy of FireRed to a varying degree of success.

The localizations of FireRed and LeafGreen still have the e-Reader code from the Japanese versions, right? What about Mystery Events? I tried replicating this in the Japanese versions and it didn't work but they likely left it in completely unused, unlike in Japanese Emerald.
They do have the e-Reader code, it's just skipped out on. Normally, if a Wireless Adapter is not detected, it will default to e-Reader mode in the Japanese versions (Otherwise go to Mystery Gift if it is attached), but this check simply errors out on you and tells you it's not attached (Or if attached, it does go to Mystery Gift), so it never does jump to the code responsible for e-Reader usage in the international releases. However, by editing the Main Menu option to allow the original Japanese behaviour, you can connect to an e-Reader, all the code is still there and completely functional:



(Note that the text is not actually in the ROM, so I had it ripped from the Japanese games and translated. This is how it looks without the text.)



It also seems that in FireRed and LeafGreen, both are unlocked at the same time, as opposed to Emerald needing two methods of unlocking to have both options. However, I can't seem to get the game and the e-Reader to communicate, and I'm not sure what I'm doing wrong. The code that's left over is virtually identical to the Japanese games, so it should be able to communicate, but it doesn't for some reason. I've even tried it on hardware, but because I lack a card e-Reader+ unit, I can't do a full hardware test to troubleshoot.
« Last Edit: June 08, 2015, 05:18:09 pm by Team Fail »

SatoMew

  • Member+
  • *
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Anatomy of an e-Reader Mystery Event
« Reply #29 on: June 10, 2015, 09:05:00 am »
They do have the e-Reader code, it's just skipped out on. Normally, if a Wireless Adapter is not detected, it will default to e-Reader mode in the Japanese versions (Otherwise go to Mystery Gift if it is attached), but this check simply errors out on you and tells you it's not attached (Or if attached, it does go to Mystery Gift), so it never does jump to the code responsible for e-Reader usage in the international releases. However, by editing the Main Menu option to allow the original Japanese behaviour, you can connect to an e-Reader, all the code is still there and completely functional:



(Note that the text is not actually in the ROM, so I had it ripped from the Japanese games and translated. This is how it looks without the text.)

I see, thanks. So, to clarify, the Japanese FireRed and LeafGreen will load the same Mystery Gift screen as the localizations when the Wireless Adapter is attached and detected by the game, correct?