Homebrew Discussion SM3DAS: Research and Development

Psi-hate

GBATemp's Official Psi-Hater
OP
Member
Joined
Dec 14, 2014
Messages
1,750
Trophies
1
XP
3,427
Country
United States
I thought it'd be a good idea to make a centralized R&D thread for those who are tinkering with the collection for whatever purposes. Currently, there's a lot of interest in swapping the collection's games with different ones. In this post, as more is discovered, I'll update it with information.

Any suggestions for currently found info, along with things to help people get started into researching this, would be appreciated.

Here's the post from @WatchMeNow explaining important information in regards to the process. I'll personally be looking into figuring out the solution to it.

To extract the romfs from the game, use nxdumptool.

Made an account just to post this but:

Just replacing the ROM file will crash the emulator without changing corresponding config files related to the ROM.

In order to replace the ROM you need to have your replacement file located at:
Code:
\atmosphere\contents\010049900F546002\romfs\MarioSunshine\Super_Mario_Sunshine_Stardust-trimmed.gcm

The file that loads the ROM is:
Code:
\atmosphere\contents\010049900F546002\romfs\rom.json

That contains the text:
Code:
{   "UID": "MarioSunshine",   "DolHash": "4e10808fdbd8a8beefab38163bb43a5002f60d63",   "ROM": [     "rom:/MarioSunshine/Super_Mario_Sunshine_Stardust-trimmed.gcm"   ] }

The UID is how the emulator searches the /data/ folder to replace textures and gecko codes, so in theory we could replace that with something like "NewGame" and then match that to "rom:/NewGame/NewGame.gcm" in the replacement "rom.json" file we would load with LayeredFS.

We would then also need to find out how to generate new hashes associated with a newly inserted ROM (NewGame.gcm) in the files:


Code:
\atmosphere\contents\010049900F546002\romfs\NewGame\NewGame.gcm
Code:
\atmosphere\contents\010049900F546002\romfs\NewGame\NewGame.hash

Code:
{
    "hash": {
        "exe": "corresponding exe hash with NewGame",
        "media": "corresponding media hash with NewGame",
        "full": "corresponding full hash with NewGame"
    }
}


as well as

Code:
\atmosphere\contents\010049900F546002\romfs\data\database\hagi\NewGame.json

Code:
{     "Info": {         "GCM": {             "Name": "New Game",             "CountryCode": "US",             "GameID": "GAME",             "DVD": 0,             "ROMVersion": 0,             "GCMID": "GAME.0.0"         },         "Hashes": {             "exe": "appropriate hash here",             "media": "appropriate hash here",             "full": "appropriate hash here"         },         "UID": "NewGame",         "ShortName": "NewGame"     },     "Mxic": {         "Hashes": ["appropriate hash here", "appropriate hash here"]     } }

and finally the "boot" code needs the GameID ("FourCC") and VideoMode changed in this file

Code:
\atmosphere\contents\010049900F546002\romfs\data\database\config\NewGame.config

Code:
        },
        "Boot" :
        {
            "Country" : "US",
            "DVDRoot" :
            {
                "FourCC" : "GAME"
            },
            "VideoMode" : "NTSC",
            "Retail" : true,
            "UseDolHash" : true,
            "LoadBios" : false
        },

Hope this thread will help others and facilitate a good place to research. Of course, don't link to any illegal content like keys, extracted files, etc. Thanks!
 
Last edited by Psi-hate,

Psi-hate

GBATemp's Official Psi-Hater
OP
Member
Joined
Dec 14, 2014
Messages
1,750
Trophies
1
XP
3,427
Country
United States
Nice! Good thinking about making a new thread exclusive to R&D.
Will keep a close eye on this thread for sure :)
Thanks!
Right now I'm actually having some trouble extracting the romfs of the game, as for whatever reason, my attempts with hactool fails to finish with an error like:
Saving romfs\control.nacp...
Failed to write file!"

I'm using keys I've dumped myself, so it's weird. Currently trying to debug it. I'm also using an administrative command prompt session, so it shouldn't be permission issues.

Here's the batch script I'm using right now for reference:

@Echo off
echo Command line argument 1: "%1"
echo Command line argument 2: "%2"
hactool --disablekeywarns -t pfs0 --pfs0dir=temp --keyset=%1 %2
for %%f in (temp\*.nca) do (
hactool --disablekeywarns --keyset=prod.keys --romfsdir=romfs %%f
)
rmdir temp /s /q

Argument 1 being the keys, Argument 2 being the NSP.
 
Last edited by Psi-hate,

Psi-hate

GBATemp's Official Psi-Hater
OP
Member
Joined
Dec 14, 2014
Messages
1,750
Trophies
1
XP
3,427
Country
United States
aads.PNG
Weird. Hashes are wack.
 

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
38,471
Trophies
3
XP
29,170
Country
United States
https://pastebin.com/32iUR7BU I used a program to create hashes for every file in my Sunshine romfs dump and nothing matches the ones its asking for, probably not necessary but i wanted to be thorough

I haven't looked at this, but ps3 pkg files use a hash (sha-1), which is the bottom two lines of the pkg. the hash is everything but those two lines if that helps. it may not be the complete file.
 
  • Like
Reactions: Psi-hate

Dakota_Pixel

Member
Newcomer
Joined
Feb 22, 2018
Messages
10
Trophies
0
XP
94
Country
United States
Is it possible to see what happens when you set "UseDolHash" : false, but on the sunshine .gcm provided by nintendo?
That seems to work. I also got the game to render at a lower resolution using the same file that UseDolHash is in by setting handheld upscale to 1 instead of 2.
 

Tomobobo

Champion.
Member
Joined
Nov 26, 2005
Messages
1,310
Trophies
1
XP
2,150
Country
United States
That seems to work. I also got the game to render at a lower resolution using the same file that UseDolHash is in by setting handheld upscale to 1 instead of 2.

Sweet, I wonder if the hash search is even worth it then. I'm gonna try to tinker but I haven't messed with the rom/exefs stuff in a long time.
 

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
38,471
Trophies
3
XP
29,170
Country
United States
the boot.dol may be a common file for the emulator meaning it's probably the main executable like the EBOOT.BIN on the ps3, 4, and vita or the default.xex on the 360 for that particular game. it's the first file that's loaded, so other files could be named anything. I'm assuming the cube like the wii uses it inside the gcm. try to look for some identifying marker or even possibly a hex length that's normal (if they're all the same). look in a homebrew boot.dol and see if there's some identifying mark to show the beginning and possibly end of the file, then look for something like that in the gcm. hash the file, which I'm assuming is the boot.dol. most of the time files are padded with 0s, sometimes Fs to equal 16 bytes or a full line once the end of the file has been reached. if it's a hex length thing, there could be dozens of lines with just that to fill up the size.
 

Tomobobo

Champion.
Member
Joined
Nov 26, 2005
Messages
1,310
Trophies
1
XP
2,150
Country
United States
The sunshine .gcm provided does work on dolphin but at 25 fps for me and the videos play audio but only the subtitles, and some of the sound is weird like the name of the button is cut out. Also in the subtitles and the map screen there are references to keyboard inputs.
upload_2020-9-15_23-50-50.png

upload_2020-9-15_23-51-26.png


And I think the hash will be of the .dol executable within the .gcm, not of the iso itself.
 
Last edited by Tomobobo,
  • Like
Reactions: KiiWii

KiiWii

Editorial Team
Editorial Team
Joined
Nov 17, 2008
Messages
16,687
Trophies
3
Website
defaultdnb.github.io
XP
27,209
Country
United Kingdom
Maybe set ‘use dol hash’ to false, or comment out/remove hash related categories altogether.... see if ninty actually made them a prerequisite :ph34r:

edit:

looking forward to a compatibility list soon :)
 
  • Like
Reactions: peteruk

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
38,471
Trophies
3
XP
29,170
Country
United States
you also need to determine if it's using compression. I don't know about nintendo, but sony likes to use zlib. in fact, both the ps3 and the vita (probably ps4 as well) use it. adrenaline, for example, is compressed using that format. it's 78 DA in hex, and you can decompress adrenaline with simply zip.
 

rafaelia

Well-Known Member
Newcomer
Joined
Feb 17, 2010
Messages
69
Trophies
1
XP
984
Country
I'm thinking gcm is a stripped build with assets linked to and loaded externally, or all the assets are in the gcm and the switch emu is loading them in on the fly
 
  • Like
Reactions: Tomobobo

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • AncientBoi
  • BakerMan
    I rather enjoy a life of taking it easy. I haven't reached that life yet though.
  • Psionic Roshambo @ Psionic Roshambo:
    Not sure about other models of Pi4 but the Pi 4 B with 8GBs OCed to 2Ghz handles PSP really great except like 1 game I found and it is playable it just looks bad lol Motor Storm Arctic something or other.
  • Psionic Roshambo @ Psionic Roshambo:
    Other games I can have turned up to like 2X and all kinds of enhancements, Motorstorm hmmm nope 1X and no enhancements lol
  • Veho @ Veho:
    Waiting for Anbernic's rg[whatever]SP price announcement, gimme.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I will admit that one does seem more interesting than the usual Ambernic ones, and I already liked those.
  • Veho @ Veho:
    I dread the price point.
    +1
  • Veho @ Veho:
    This looks like one of their premium models, so... $150 :glare:
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    To me that seems reasonable.
  • Psionic Roshambo @ Psionic Roshambo:
    I mean since basically all the games are errmmm free lol
  • Veho @ Veho:
    I mean yeah sure but the specs are the same as a $50 model, it's just those pesky "quality of life" things driving up the price, like an actually working speaker, or buttons that don't melt, and stuff like that.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I think all in my Pi 4 was well north of 200 bucks 150ish for the Pi 4 the case the fancy cooler, then like 70 for the 500GB MicroSD then like 70 for the Xbox controller. But honestly it's a nice set up I really enjoy and to me was worth every penny. (even bought more controllers for 2 or 4 player games.) hmmm have never played any 2 player games yet :(
  • Veho @ Veho:
    Yeah that's what I hate about the RPi, it's supposedly $30 or something but it takes an additional $200 of accessories to actually turn it into a working something.
  • Psionic Roshambo @ Psionic Roshambo:
    yes that's the expensive part lol
  • Veho @ Veho:
    I mean sure it's flexible and stuff but so is uremum but it's fiddly.
  • Psionic Roshambo @ Psionic Roshambo:
    Yeah a lot of it I consider a hobby, using Batocera I am constantly adjusting the collection adding and removing stuff, scraping the artwork. Haven't even started on some music for the theme... Also way down the road I am considering attempting to do a WiiFlow knock off lol
  • Veho @ Veho:
    I want everything served on a plate plz ktnx, "work" is too much work for me.
  • Veho @ Veho:
    Hmm, with that in mind, maybe a complete out-the-box solution with all the games collected, pacthed and optimized for me would be worth $150 :unsure:
  • Psionic Roshambo @ Psionic Roshambo:
    Yeah it's all choice and that's a good thing :)
  • Bunjolio @ Bunjolio:
    animal crossing new leaf 11pm music
  • Bunjolio @ Bunjolio:
    avatars-kKKZnC8XiW7HEUw0-KdJMsw-t1080x1080.jpg
    wokey d pronouns
  • SylverReZ @ SylverReZ:
    What its like to do online shopping in 1998: https://www.youtube.com/watch?v=vwag5XE8oJo
  • BakerMan @ BakerMan:
    wokey d pronouns when woku walks in

    "CALL ME THEY SLASH THEEEEEEEEEEEEEEEEEEEEEEEEEEM"
    AncientBoi @ AncientBoi: :O