Jump to content

suloku

Innovator
  • Posts

    742
  • Joined

  • Last visited

  • Days Won

    26

Posts posted by suloku

  1. First of all, thank you very much for your contribution!!

    Back in the day, all the games we could get here were American versions, there was no localizations and if you wanted some pokemon games in spanish you had to import them, which of course was more expensive (and personally I just hate the way the game reads in spanish, such horrible translatios!)

    Do ypu happen to know if people who imported spanish (or other region besides japan) carts were able to receive the mystic ticket event with the imported games?

    We assume it was possible, though the card will still be in english, and confirming this would be awesome!

    Finally, I would like the saves to be kept private, so I'm sending you the saves via PM. I hope my saves are useful to you guys! And thank you, really thank you!

    Just to make sure, you have no problem if we extract the data related to the event (the wondercard) and make it public so everyone can get the legit event then?

  2. @Maveon, any saves you have with legit events will be interesting, even if we already got them, so if you can dumo them and upload them (or send via pm if you want to keep the saves private) it would be a really big help. Any information you still remember from the events (when and where) would also be apreciates. It would be awesome if you really have that leaf green Mystic Ticket, since one of those is the most relevant event we are still missing.

    About the special berries you want: you can emulate the e-reader, both usa and jap, with the berry e-cards. You'll need to use a japanese rom and save for the berries exclusive to japan though if you want to keep it legit.

    Alternatively, you may just inject the berries into the savegame using the tool I coded. You can injwct jap only berries and use them on USA saves too, of course if you do this depends on what you consider legit, but you could trade your tiranitar to a japanese save and use the berries on the japanese game, so it makes not that much difference for the pokemon, so it ia up to you.

    ps: if you want legit, real hardware stuff, no emulator involved, I'm sure HaxAras will be able to help

  3. it's A-okay. Where do you go in sapphire to get the tickets? I don't see anyone upstairs like in E/FR so I don't know if it's an error or if I just don't know where to go.

    You need to go to the gym in petalburg city and talk to your father to enable the event.

    This is how it was before the wondercards.

    Maybe I should add a simple text pointing where to go after the event is injected, just like the original distribution device.

  4. I didn't expect the wii version to also fail.

    I only have spanish carts, so testing on my side is a little tricky (need to mess with the region detection so mine are recognized as other regions). I'm sorry for the trouble, I thought this was working fine. I'd like to have the time to fix this as soon as possible, but my free time is pretty scarce until february, I can't look into this until tomorrow, but I'll try to get them fixed as soon as possible.

    Also, there should be no need to test LG or both R and S, since the same code applies to both versions of the same game, as the save is basically the same (unless the cartridge isn't correctly recognized, but give I'm reading the rom header this should not happen).

    ps: I'll link you to my RS saves.

  5. Cool. I'll try out the GC version on the cube and the wii and see how they hold up too then.

    EDIT:

    DS version gave me an error saying that it 'could not find ini file', but I didn't see an ini in any of the packages.

    Wii, GC, and PC versions went all the way through the process for FR and E but failed to put anything on, I didn't see anything in the mart or PC.

    I'm clearly missing something but I'm not quite sure what.

    If you're trying to inject the Aurora Ticket, suloku messed up with the code and will update later today.

    Ok, what's exactly not working with the 0.1c?

    Pleasetell me

    Game (RS, E, FRLG):

    Region:

    Ticket:

    You need the ini file from the savegame tool the DS event tool is based off of.

    Wooops, I had the file in my sd card, I though I removed the code checking for the ini, the modification doesn't need the file at all, next update will remove the need for that file.

    So what's the difference between Emerald Eon Ticket distributed in Japan, and the one you can get via Record Mixing rith R/S?

    Do they both change different areas of the save file or something?

    When you record mix:

    Eon ticket item is added.

    Flags for the event are set.

    The one distributed in japan:

    Sets a flag that enables an in-game event. This in game event (at the 2nd floor at the pokemon center) in turn enables the flags for the eon ticket event and provides the eon ticket item.

    Sets the eon ticket as the "sareable" item via record mixing.

    So, with the official event, you can record mix emerald with other games to get the ticket on those games. Also, the save has the in-game eont ticket event flag set, which is something really technical but for me it triggers the savegame "illegal" if made on a non-japanese region.

    I'm not too worried about "Illegal" events. I've been wanting to experiment. For example, taking this shareable Emerald Eon Ticket and the Old Sea Map and injecting them to a Japanese save and then backing up and writing that on a Non J game and see what happens. I like to push the boundaries and whatever rules are implemented into the tool, I'll just work around. Not to say I don't value legitimacy. But these are just trophies for my personal collection anyway. I've really been wondering what people would consider the legitimacy of that to be.

    Jap wondercards aren't compatible with non-jap games, they have a different format due to character encoding.

    The wonder news I'd like to scan into my games. I have a good majority of the E-reader cards, the actual physical cards. A Colosseum set, Fire Red/Leaf Green, the Decoration Present, etc. so I'm not worried about that feature either.

    I mention this because the tool has E-reader support. I want to scan the Japanese E-reader cards into my English game and get the English versions of the final 3 shadow Pokemon and try the Fire Red/Leaf Green trainer hill cards on a J save and then restore it to other regions, etc. What would the legitimacy of these be considered? Mainly the shadow Pokemon. With stuff like the Regi dolls, I can 100% legitimately just trade them using record mixing so that isn't an issue.

    The e-reader was deliverately blocked, so in my opinion they are not legal in any way, but I agree it's fun to mess with these things.

    There has been research, done with those 3 missing pokemon, it can be done with emulators on any region right now, I can't find the thread though. There were even some savegames to get those last shadow pokemon.

  6. Hi KazoWAR, need some help...

    i was about to use this save editor of yours because it looks great, however i noticed something strange

    the number of items in the editor doesnt match to the number of items in the game

    for example, i had 57 Timer Balls, however in the saveeditor, it was 99 instead

    any recommendations??[ATTACH]13849[/ATTACH]

    Try pkhex, it now supports all generations.

  7. Initial DS Tool testing shows that the cart swapping does work. However, the Aurora Ticket refuses to inject. For English Emerald, it just injects the Mystic Ticket while the ticket never gets injected into English FRLG.

     

    Did that happen with the previous version?

    EDIT: nvm, I found the problem (I foolishly forgot a couple break statements). Jap FRLG is afected in the same way. Bad news is I can't recompile and upload until tonight, but will do as soon as I get home.

    EDIT2: @Invader TAK uploaded new version for NDS: https://github.com/suloku/savegame-manager/releases/tag/0.1c

    I'll update the GC/Wii for the USA Emerald Mystic ticket on other regions at another time.

  8. Thanks for the report, I'll look into them tomorrow as it's getting late here and I was working on the Day Mirage Spot for ORAS (finally got it working :D)

    And I've also updated the NDS version of the injector to support cartridge switching https://github.com/suloku/savegame-manager/releases/tag/0.1b (@Invader TAK)

    While updating the NDS version I've been wondering 2 things, since my intention for the nds and GC/Wii versions was to keep them locked to official events that were distributed to each region:

    - When (if ever) we get a Mystyc Ticket for FRLG, should I enable it for other regions besides english? The same goes for the Emerald one. We suspect it was possible to get them on other non-jap cartridges, but we have no real evidence besides this being the case for Aurora Ticket distribution.

    - Should I include Old Sea Map for non-jap versions with a very big ILLEGAL indicator? As I said, the idea was to only distribute official events, but maybe this would be convenient? I could say the same for the in-game emerald eon ticket, which just requires enabling a flag in the save for it to trigger, but this was never released outside japan.

    I don't want to confuse people and make they think they are getting a legal OldSeaMap or Eon ticket for emerald. For any "illegal" events there's always the pc version, but I'd like to hear some opinions.

  9.  

    Year 2014: Summer 2014 Poke Ball Pattern Vivillon	Vivillon	UK Pokeball Forme	0511	08134	Online+Serial	SPA

     

    marc_max had this wondercard in his savefile. It is used though.

    Also, what's the deal with these two diancies?

     

    Year 2014: October 2014 Pokemon	Diancie	3 Set Ivs (Oct)	0525	10274	Serial Code	FREYear 2014: October 2014 Pokemon	Diancie	No Set Ivs	0525	10274	Serial Code	FRE & SPA

     

    They seem to be the same one, even the serial for the wondercard is the same, so how come some came with 3 fixed IVs and some didn't? Did nintendo mess up and fixed the wondercard later?

    EDIT: I was checking the event file and luckily a friend's savegame has the SPA wondercard for the female spooky pumkaboo that seems to be still missing from the file.

  10. I think this is interesting enough to get posted here, as it is relevant to Mystery Event.

    Aparently, the Regi Dolls are actually obtaniable in non-japanese games via record mixing, @HaxAras has made it with real hardware too, so there's no doubt about it. You can read his post here: https://projectpokemon.org/forums/showthread.php?50474-GEN-III-Mystery-Gift-Tool-Nintendo-Events-Wondercards-e-Trainer-cards-and-e-Berry-editor-(and-more!)&p=221895&viewfull=1#post221895

    Here is how to legitimately get them (instructions by Invader TAK):

    Only Emerald can mix records between japanese and non-japanese versions. Ruby/Sapphire cannot mix records between languages. So the process would be:

    1. Scan Decoration Present on Japanese Ruby/Sapphire and give a Regi Doll to the Decoration Trader at Mauville City's Pokemon Center.

    2. Mix Records with Japanese Emerald.

    3. Mix Records between Japanese Emerald and non-Japanese Emerald.

    4. Mix records between the non-Japanese Emerald and non-Japanese R/S of the same language.

     

  11. What I meant in my previous post is that the buttons which are only usable for a specific game like the inject and export berry are only usable if the game was detected correctly by the auto detection but not if you set it manually.

    Thanks, updated: https://github.com/suloku/wc-tool/releases/tag/0.1c

    I've also included the ect and ecb files you uploaded earlier (with propper credit in a little readme I put with them). Tell me if you want me to remove them or the credit (I guess I should have asked first? I assumed you were Ok with it, hope it is not a problem).

    ps: the problems Shin-Chan was having were due to the savegame files being empty.

    ps2: @Invader TAK I think I can add the "Switch Cartridge" to the nds app, save-manager does not support this, but I think I can implement it without much issue, if you'd like to beta-test so we know it doesn't mess up the savegames tell me.

  12. You might be right about FRLG not having mystery event, my memories might have cofused me, as I never looked into the jap games that much. I recall testing if the script would work without a wondercard in FRLG and I think it worked, so they could have done it just likr they did in emerald, but these games came out before emerald, so who knows.

    Shin-Chan, if you pm me your saves I'll take a look, as I said the auto-detection is not bound to always work as there is no 100% way of doing it.

    Maybe I should just prompt the user for game and language like pkhex does? Or check the file name looking for key workds like "green", "emerald" and the like?

  13. I can confirm that non-japanese games were unable to detect or download the japanese old sea map distribution.

    Does that mean you or someone you know withnessed the unability of a non-japanese game to download the Old Sea Map?

    Nice work!

    It looks like the visibility of the buttons don't get updated when you override the game version.

    They get updated in the Event Tool. Also the offsets seem to be fine though.

    By the way, if anyone is looking for ECT and ECB files:

    [ATTACH]13840[/ATTACH]

    [ATTACH]13841[/ATTACH]

    Do you mean the override button when accessing the events in theain tool? I'll check that. I originally intended to leave the eventa out of the main tool, but decided keeping the button there doesn't hurt. The official event injector is just a stripped version for those only interested in the events,imicking a little the ones taka coded long ago.

    And thanks for the berries and trainer files compilation! I need to add support to inject/extract them directly from uncompressed vpks to create e-reader saves with Team Fail's program, or ideally, be able to do everything (extract vkp, decompress vpk, inject/extract berry/trainer, recompress vpk and inject the savegame.

    The vpk compression algorythm is open source and the e-reader save checksum was implemented by the SciresM we know and love, so it is absolutely possible, it just needs time to get done.

    All of the Wonder Cards and Eon Ticket files are official in the PC tool zip are official.

    @HaxAras as Invader TAK states, all the files included are oficial, except the obvious CUSTOM folder, which is the only place where non official events will be placed in the file I upload.

    Right now the folder just holds a FRLG Mystic ticket and an Old Sea Map for non-japanese games, just so anyone wanting to trigger the events doesn't need to use morpheo's codes.

    Custom wondercards are very powerful, as they can trigger a lot of things in-game, and can be associated with any npc. I have one that enables the eon ticket event in emerald, showing an image of the missing lati depending on which one you selected, for example, but you can make a wondercard that distributes a Celebi, or gives you a master ball or whatever, the only limitation would be that without enabling in-game flags, the event would be triggered more than once. This can be "solved" by using a command that deletes the script from the save once executed.

    About regions and such:

    Emarald wondercards won't work on FireRed/LeafGreen and vice versa.

    Jap wondercards only work with japanese games

    Non-jap wondercards work on any non-jap game, only difference is text language. In the USA you could receive aurora ticket to any non-jap, but the wondercard and event in-game will be in english. The European distributions auto-selected the correct language when downloading the wondercard.

    With the tool, use the override region button to get other region wondercards injected. The language autodetection is not perfect, so it may fail with some savegames, specially FRLG are the hardest and more prone to fail, that's actually the main purpose of the override button.

    Eon ticket: the distribution machine was/is language locked (this is tied to how the mystery event itself is coded), but the event itself works on any region if you override and inject it to a savegame of a different language.

    To clarify how the events work: they are a single script associated to an npc,for wondercards it's the man in the 2nd floor, fo eon ticket your father at petalburg. Talking to them executes the script and the only difference between the different language scripts is, game-wise, the text, besides that everything else is the same script.

    The scripts also contain trash data, not relevant for the game or the event iself, but relevant so we can claim the file is the Official Nintendo event with proud.

    Also, the scripts for wondercards are independent to the wondercard, so I suspect that Emerald and FRLG, which had mystery gift and mystery event in the japanese versions, would fail to download a wondercard if you still had a mystery event script there. I should test this, but I wouldn't understand the japanese errors. They never used mystery event on emerald or frlg to distribute an script, favoring wondercard distribution, so this was not a problem in real practice.

    Also, this is probably because the savegame doesn't have enough room to store both scripts.

  14. I uploaded 0.1b with the emerald eon ticket bugfix and the package includes Mystick Ticket for FRLG and Old Sea Map custom wondercards for non-japanese games. Those are, of course, not the official files, as stated in the included txt file.

    https://github.com/suloku/wc-tool/releases/tag/0.1b

    That is entirely incorrect.

    I have the Decoration Present card, English and Japanese Emerald versions, E-readers and whatever else I'm forgetting to mention.

    Scan Decoration Present into Japanese R/S/E (I honestly can't remember if you can scan it into Emerald)

    Mix records to transfer it from a Japanese Ruby to a Japanese Emerald using the Mauville city decoration trader.

    Then mix records between the Japanese Emerald and the English Emerald using the same trader.

    I may be the first English player or one of to get legit Regi dolls on the English games. I can provide proof that I have all these thins as well as a video showing the process needed to transfer legit dolls. I also uploaded a Japanese Ruby save on the thread for this project with the Regi dolls inserted.

    ----

    When you were talking about the Japanese Old Sea Map. It made me wonder if I could just write my non-Japanese roms to my Japanese save, insert the Old Sea map and get the Mew on my Japanese cart, back it up and restore it back to my non J saves. As well as just restore it before I catch it to get non J Mew. What would be the legality of that?

    Edit: I don't like making claims without providing proof. So here it is.

    Picture of all my stuff.

    http://imgur.com/a/UEWJq

    Here's a terrible video of the Decoration Present being scanned in. I can make a video of the transfer but I'd have to record one game with a webcam and the other using my Hauppauge.

     

    That's VERY insteresting to know! I didn't know jap games could mix records with other regions, this is really cool to know, since that means the saves would provide an easy way of getting the dolls, rather than sending them just for fun to the saves.

  15. I don't personally think there will be any kind of restriction if the distributed Mews are perfect DV, since any other Mew would, as much, be as good as the one they distributed, thus not being unfair for the players who got it at the event, and still allow to not piss all the people who got a glitched one. I think the existence of the Mew glitch is too widely known to just ignore it. and since there is going to be an UK event, that means non-japanese mews will also be allowed I guess?

    But this is nintendo we are talking about, so anything could happen... but since you can "upgrade" IVs in gen 7, I don't think they care much about gen1 DVs.

  16. Hey guys, I don't mean to spam this thread, but I found this while searching in Google and I've been following the process of you guys working on these tools. I have a quick question, is it possible to inject the Old Sea Map wonder card into a Japanese save and then transfer that wonder card in game from that save to an English save, and 'legally' obtain the Old Sea Map that way? Also, after I injected the wonder card into my Japanese save, I could not receive the Old Sea Map. The man on the 2nd floor of the PC would just 'thank me for using Mystery Gift'. I think there might be a bug or something.

    1.- Japanese-Internation roms aren't compatible since the wondercard format is different. They can't share/download wondercards or wonder news between them, they don't even detect that other players are "online" using the wireless adapter. This makes me think that japanese wondercard distributions were not compatible with other regions, so any non-japanese old sea map mew is illegal. Of course I wasn't there and I don't have the distribution cart for the old sea map or any other japanese event to confirm this, so we might never know for sure.

    1.5- Keep in mind that any non-japanese old sea map mew is illegal (even though it is "legit", interpreted as being generated in-game with correct location data). Loading your savegame on a japanese rom to get the Mew will only generate a fully legal Mew if you edit your OT to use the japanese character encoding table, as simply loading the save will apparently display the correct OT, but the encoding used is different to the one you would get if you had input your name in the japanese rom when prompted and the data that ends up in the OT field of the pk3 file generated by the game will be "wrong".

    2.- I'll upload the fixed version of the tool later for the emerald eon ticket bug. I'll also include a custom wondercard for the FRLG Mistyc Ticket and one for the international Old Sea Map using the unused scripts that lie inside the rom. Of course those two wondercards will be completely illegal and non-official. The obtained Mew for the Old sea map will also be illegal, for the reasons stated above. On the contrary, Ho-ho or Lugia captured using this custom wondercard will be completely legal, but only in the english roms, since the pokemon are generated in-game. Just delete the custom wondercard if you want and there will be no difference with the official event.

    2.5.- We know the US Aurora ticket distribution cartridge was compatible with all the ENG/FRE/GER/ITA/ESP roms (though the received wondercard would be in english in all cases), so there's no reason to think this was not the case for the Mistyc ticket distribution, so technically speaking, there is a very high probability that FRE/GER/ITA/ESP Mistyc Ho-ho/Lugia are totally legal too.

    3.- If the man in the 2nd floor tells you "thank you for using Mystery Gift", that means that either you already have the Old Sea map or one of the flags related to the event enabled, but not all (or you would be able to visit the island). Did you try any kind of action replay codes on that savegame?

    3.5.- Just to be safe: Old Sea Map is only compatible with Emerald, even if you can inject the wondercard on a FRLG savegame with the tool the wondercard won't work on them as intended and unexpected behavior can occur.

    P.S., there is another thread on this site that provides a ZIP with a lot of the official e-Reader files and a tool to inject them. Pretty cool, I've been checking them all out: https://projectpokemon.org/forums/showthread.php?46216-GEN-3-e-Reader-Event-Injection

    I'm aware of Team Fail's work, in fact I have used it to make customized e-reader savegames for Eon ticket distribution for the other european languages. The japanesse Eon ticket for RS should work too, but I need to test it a little more. For japanese emerald, I'm pretty sure I can craft a savegame that enables the event, but the japanese emerald eon ticket works a little different to.

    I also want to upload savegames for the Regi Dolls distribution that work with other languages games (of course, this would be considered as "illegal" since those were never obtainable in non japanese roms).

  17. I kept getting an "Unhandled Exception" in the Mystery Gift Tool whenever I tried injecting a sharable Wonder Card and overwriting the save I was injecting to. I had to output to a new file for it to work. But it did work!

    I can't reaplicate this, may you please tell me exact steps you do to produce the bug?

    I have sent you a PM along with a quick video on how it wasnt working. ^_^

    I found the problem, I forgot to fix a section checksum for Japanese Emerald (eon ticket on that game works a little different, the event is in-game and the mistery event only enabled it and added the eon ticket data for record mixing. The NDS and GC/Wii version are not affected, as I did the propper job there.

    I'll upload update program tonight, I'll wait a little and see if I can also upload a fixed version for the bug Invader TAK mentioned. If you are eagger, you may fix the section checksums by loading the save on Mystery gift tool and using the menu option for that.

  18. I realy hope we can get someone to dump this mew. With all the homebrewed 3DS there must be someone right? I hope it is the same as the japanesse distribution, being all perfect DV Mew clones. We wouldn't even need a save dump if this was confirmed.

    We should try to at least gather pictures from people at twitter, to see if all have the same OT and stats, if all base stats at level 5 are 16 for all the distributed mews, that would mean this distro mimics the japanesse one.

    Also, why only UK?

  19. did the island change, though?

    try this:

    TID 44271 and 0x1600 with 00 00 00 06 (0x06000000), it will change current to Cres Isle.

    I tested this on the C app I put toguether the other day, and it outputs crescent island. I will try this in-game later.

    Edit: @the_SLAYER I tested on my savefile those values and crescent isle appeared, so I guess we have all the pieces. I'll try to make a simple c# code for this so it can be added to pkhex (I guess it'll have to wait until SM frenzy slows dowb a little)

    • Like 3
  20. I was able to inject the Eon Ticket into my Japanese Sapphire using the DS tool no problem.

    Speaking of the DS tool, would it be possible to put in the option to swap carts without needing to reloading it or is that a limitation with the save manager you used for it?

    Will check if the original one supports swapping carts, if it does, I'll try to re-add it. All the gba cart reading code is totally foreing to me, so I didn't want to mess with it more than needed.

    EDIT:

    Great job Suloku, ajxpkm and others for bringing this to life!

    I have discovered a bug with Gen 3 Event Tool. I used to the tool to add the Old Sea Map and the Mystic Ticket to my Japanese Save. Both went perfect! I caught the pokemon and saved. But When I at last tried to inject the Eon Ticket, in the tool itself everything went fine. But when I loaded up the game, The save file had been deleted and the backup save file had been restored. I saved the game a couple of times and tried to inject the ticket again but the same thing recurred. This seems to be exclusively with the Eon Ticket. The other two are working as intended.

    I can't seem to be able to replicate this, works for me just fine. Might you send me your savegame via private message?

  21. I just read this now. This is ?on ticket for japanesse savegame right? I'll get this fixed tomorrow.

    Japanesse are different and have been the less tested, sorry for the inconvenience. I'll also check if the problem happens in the nds and wii versions.

    My time is very limited right now, so not much time to support this tool, but this seems to be a major bug so I'll get this fixed tomorrow night.

  22. It was just a quick analysis,

    init_rtc_ctx initializes a 8 byte structure

    this is then used by j_getGameTime, i'm not sure if it "gets" or "sets" the time, since "get" makes more sense i used that name.

    savePtr is a pointer to the Savedata:: Savedata structure, not the raw save.

    gfl2::math::Random::Initialize, the name comes from the sun&moon demo, not oras,

    this initializes a mersenne twister algo, here the rest of the functions: (pseudo c code)

     

    int __fastcall j_gfl2::math::Random::Initialize(int *ctx, int a2){ return gfl2::math::Random::Initialize(ctx, a2);}unsigned int __fastcall j_MersenneTwister(int *a1){ return MersenneTwister(a1);}int __fastcall gfl2::math::Random::Initialize(int *a1, int a2){ signed int v2; // r1@1 unsigned int v3; // r2@2 int v4; // r3@2 int *v5; // r2@2 int v6; // r3@2 *a1 = a2; a1[1] = 0x8F7011EE; v2 = 1; *((_QWORD *)a1 + 1) = 0x3793FDFFFC78FF1FLL; do {   v3 = a1[(v2 - 1) % 4];   v4 = 1812433253 * (v3 ^ (v3 >> 30));   v5 = &a1[v2 % 4];   v6 = v4 + v2++;   *v5 ^= v6; } while ( v2 < 8 ); return sub_11A29C((int)a1);}int *__fastcall sub_11A29C(int *result){ bool v1; // zf@1 int v2; // r1@5 bool v3; // zf@5 signed int v4; // r3@10 int v5; // r12@11 int v6; // r1@11 int v7; // r4@11 unsigned int v8; // r2@11 int v9; // r4@11 v1 = (*result & 0x7FFFFFFF) == 0; if ( !(*result & 0x7FFFFFFF) )   v1 = result[1] == 0; if ( v1 ) {   v2 = result[2];   v3 = v2 == 0;   if ( !v2 )     v3 = result[3] == 0;   if ( v3 )   {     *result = 84;     result[1] = 73;     result[2] = 78;     result[3] = 89;   } } v4 = 0; do {   v5 = result[1];   ++v4;   v6 = result[2];   v7 = *result & 0x7FFFFFFF ^ v5 ^ v6 ^ 2 * (*result & 0x7FFFFFFF ^ v5 ^ v6);   v8 = result[3] ^ ((unsigned int)result[3] >> 1) ^ v7;   v9 = v7 ^ (v8 << 10);   result[3] = v8;   if ( v8 & 1 )   {     v6 ^= 0x8F7011EE;     v9 ^= 0xFC78FF1F;   }   *result = v5;   result[1] = v6;   result[2] = v9; } while ( v4 < 8 ); return result;}unsigned int __fastcall MersenneTwister(int *a1){ int v1; // r2@1 int v2; // r3@1 int v3; // r12@1 unsigned int v4; // r1@1 unsigned int v5; // r12@1 int *v6; // r0@3 int v7; // r4@3 unsigned int result; // r0@3 v1 = a1[2]; v2 = a1[1]; v3 = *a1 & 0x7FFFFFFF ^ v2 ^ v1 ^ 2 * (*a1 & 0x7FFFFFFF ^ v2 ^ v1); v4 = a1[3] ^ ((unsigned int)a1[3] >> 1) ^ v3; v5 = v3 ^ (v4 << 10); if ( v4 & 1 ) {   v1 ^= 0x8F7011EE;   v5 ^= 0xFC78FF1F; } *a1 = v2; a1[3] = v4; v6 = a1 + 1; v7 = v2 + (v5 >> 8); *v6 = v1; v6[1] = v5; result = v4 ^ v7; if ( v7 & 1 )   v4 = 0x3793FDFF; if ( v7 & 1 )   result ^= v4; return result;}

     

    I found the algo online, it's "Tiny Mersenne Twister"

    https://gitlab-dev.in2p3.fr/SOPHYA/SophyaLib/blob/927c275e1bbe27c728119b9763ef174ece43fc47/BaseTools/tinymt32.c

    https://gitlab-dev.in2p3.fr/SOPHYA/SophyaLib/blob/927c275e1bbe27c728119b9763ef174ece43fc47/BaseTools/tinymt32.h

    Thank you very much for the functions! With this I can generate values for any given TID and Mirage Spot. I need to test in game, but seems it will work. I don't know what the time call does there, doesn't seem to impact the mirage spot in any way.

    If someone wants to test, this should produce cresscent isle:

    TID: 12345 (this is in decimal!)

    0x1600: 3C 1C 12 91 (this is direct hex view!)

  23. I'm a bit confused, I seem to understand that the SaveData::RandomGroup and TID are used to initialize the MersenneTwister algorythm for generating a random value that is used to calculate the daily spot, but I fail to see the role that these play:

    init_rnc_ctx((int)&ctx);

    j_getGameTime(savePtr, (int)&ctx);

    rnd_ctx

    I've looked at some MersenneTwister implementations and none seem to have an input argument beside getting it seeded, unlike this call j_MersenneTwister((int)&rnd_ctx).

    Just to clarify, the goal I'm after is to make a function such as this:

     

    u32 RandomGroup_MDV (u16 TID, u8 MirageSpot){  u32 randomgroup = 0;  for (randomgroup = 0; randomgroup < 0xFFFFFFFF; i++)  {     //Algorythm that uses randomgroup and TID to generate a value between 1-33 (yes, I know you just posted the algorythm the game uses)     if (result == MirageSpot)       break;       }  return randomgroup;}

     

×
×
  • Create New...