Hacking Homebrew Custom Hiyoko NSP Creator

ZachyCatGames

Well-Known Member
Member
Joined
Jun 19, 2018
Messages
3,380
Trophies
1
Location
Hell
XP
3,778
Country
United States
It's the more common thing thats corrupt. But in some titles, another thing is corrupt too. For example, in 01004b9000490003_000012c30000_Program.nca the "sdk" file is corrupt in addition to the "subsdk0" file.

I haven't thoroughly examined all the files of all the titles. I have just gone through as far as focusing on the subsdk0's as those are what happens to be corrupt with the debug versions. I can probably compile a better list of whats corrupt and what isn't if needed.

I'll take anything that gives a chance at making it boot. The dev version is clearly different, and offers more features. For one, it looks to have IMGUI options like Sloop. Probably not the same exact interface, but something. There is even a --ask argument that I suspect may allow the inclusion of more than 1 ROM with each game, and a menu selection among them. Rather than 1 game per title.

EDIT:

Corrupt files:
  • 01004b9000490000_000017234000_Program.nca: subsdk0
  • 01004b9000490001_0000070ac000_Program.nca: subsdk0
  • 01004b9000490003_000012c30000_Program.nca: sdk
  • 01004b9000490003_000012c30000_Program.nca: subsdk0
  • 01004b9000490003_000008470000_Program.nca: subsdk0
  • 01004b9000490004_00000356c000_Program.nca: subsdk0
  • 01004b9000490005_000005cf0000_Program.nca: subsdk0
  • 01004b9000490006_000013fec000_Program.nca: The nca itself seems bad.
  • 01004b9000490006_000004930000_Program.nca: subsdk0
  • 01004b9000490014_0000153a0000_Program.nca: subsdk0
The things shown in orange in the OP do not have corrupt files, but instead something else that makes them not boot.

EDIT2:

The corruption of the subsdk0's in the following two pairs are the same, fyi. As in, they are the same exact data.
for 0015 that can make sense, as its the same game probably recompiled with a fix. But for 0003 and 0004... not so much. They are different games, with different testing goals (Touch controls vs. normal controls).
  • 01004b9000490003_000008470000_Program.nca: subsdk0
  • 01004b9000490004_00000356c000_Program.nca: subsdk0
&
  • 01004b9000490015_000006d44000_Program.nca: subsdk0
  • 01004b9000490015_0000094b8000_Program.nca: subsdk0
For 0002, there appears to be a string sanitization/localization error in the control.nacp. At a glance it would seem like corrupt data, but my experience finds it consistent with not converting the string format between Unicode/UTF-8 and such. But such a issue could certainly be the cause for a failure to work.

Im not sure what the issue is with the first 0013 not booting, or what the issue is with the first 0006 nca not reading correctly.
I poked around a bit and was able to find a couple Develop nnrtld + nnSdkEn + glslc pairs (sdk rel 6.4.0 and 6.4.2) that seem to be close in size to those in the corrupt debug titles though, I couldn't find any exact matches, so I think they were using an internal build of the sdk (or Nintendo silently updated smth). But it probably doesn't matter, I can't imagine they'd change anything significant between silent/micro revisions.
Got anywhere I can send them over?

Also I checked the original dev unit dump and it does seem the scanner dumped everything correctly... so I guess subsdk0 being corrupt everywhere is just an unfortunate coincidence..?

Maybe that control is in Japanese?
Also I can extract the non-corrupt 006 fine, if that's what you mean?
 

DarkAkuma

Well-Known Member
OP
Member
Joined
Sep 20, 2008
Messages
301
Trophies
0
XP
1,787
Country
United States
I poked around a bit and was able to find a couple Develop nnrtld + nnSdkEn + glslc pairs (sdk rel 6.4.0 and 6.4.2) that seem to be close in size to those in the corrupt debug titles though, I couldn't find any exact matches, so I think they were using an internal build of the sdk (or Nintendo silently updated smth). But it probably doesn't matter, I can't imagine they'd change anything significant between silent/micro revisions.
Got anywhere I can send them over?

Also I checked the original dev unit dump and it does seem the scanner dumped everything correctly... so I guess subsdk0 being corrupt everywhere is just an unfortunate coincidence..?

Maybe that control is in Japanese?
Also I can extract the non-corrupt 006 fine, if that's what you mean?

You can contact me on Discord.

Yea. It's strange. But there is probably some reasoning for the corruption. If it was just that it was overwritten data as the reclaimed space is index as empty now, I doubt those pairs I listed would have the same corruption.

Yes. That type of string corruption is exactly what I see with japanese strings.

Hmm... I may have to look at that 01004b9000490006_000013fec000_Program.nca again. I couldn't extract files from it, but I may have messed something up and not tried to hard or long, simply moving on as there was a lot to look through. Ultimately, its likely not a very important file though. The control nacp just suggests its another tetris v2 touch control build.
 
Last edited by DarkAkuma,

DarkAkuma

Well-Known Member
OP
Member
Joined
Sep 20, 2008
Messages
301
Trophies
0
XP
1,787
Country
United States
2022042816240600_s.jpg
2022042816242700_s.jpg


After a bit of work, I was able to figure out how to get the debug build to boot on emu and hardware.

But... as the first screenshot indicates... the frame rate isn't great. This isn't going to be desirable to most users, but I'm including support for it anyway.

In the rar I have included 3 new debug .bat files, an ips patch, and updated the readme.

Some args are not available, while other args that arent available in the release builds are. But theres not much interesting besides the overlay. And that can be accessed in app by pressing the right stick down.

I don't think I'm going to try to improve the frame rate or anything. It's a lot of effort, for little to no gain. If I am to work on this stuff more it would be to get saving working... which I have been exploring, with no luck.

Anyway, to those who care... enjoy! =)
 
  • Like
Reactions: hippy dave

theapguy

New Member
Newbie
Joined
Apr 29, 2022
Messages
2
Trophies
0
Age
37
Location
Brooklyn, NY
XP
10
Country
United States
Thank you very much for putting this together, it's really awesome. I'm not a developer but do have some facility with coding/scripting and after a bit of file/folder permission tweaking and manual terminal commands on my Windows machine, I was able to get these scripts to run and generate nsps for a number of gb/gbc games that I then installed using Goldleaf on my v1 softmodded Switch. I used the Super Mario Land "01004b9000490011_000030e44000_Program.nca" and "01004b9000490011_000030434000_Control.nca" files.

Question for DarkAkuma: could you go into more detail as to how I could save and load save states given the above approach? I'd love to be able to play through Legend of Zelda: Oracles of Ages/Seasons and be able to save. Thanks a bunch for any information you can provide.
 

DarkAkuma

Well-Known Member
OP
Member
Joined
Sep 20, 2008
Messages
301
Trophies
0
XP
1,787
Country
United States
Question for DarkAkuma: could you go into more detail as to how I could save and load save states given the above approach? I'd love to be able to play through Legend of Zelda: Oracles of Ages/Seasons and be able to save. Thanks a bunch for any information you can provide.

Umm... this is and always has been there right in the opening post.

Issues:
  • No saving. SRAM or save states.

And I added this to the FAQ section yesterday.

Q: Should I expect saving support in the future?
A: No. Not really. The emu lacks any code that writes to the standard save directory, nor any for the user account access. While the features for saving exist, they do so for use with a dev environment where the current working directory (where save files are made/accessed with this emu) is typically mounted to a remote path, like a host PC. So a simple hack is not possible. But I am exploring ideas that may offer something.

I'm trying to get saves working. I haven't given up yet, and I have some ideas. But this is a feature that should not be assumed to be made to work... until if/when I find a way.

Believe me. Its a top priority, right after the debug emu. I know how make or break it is for many games.

EDIT:

As I said, I have been working on this. But sadly... it's looking like its not going to be possible.

While I did figure out that the GUI from my last screenshots is in fact not a titlebar for a window called "Save states Misc", but instead a menubar with "Save states" and "Misc" options... the save state menuitems do not work. They just freeze the emu.

As to why... its why saving, both SRAM and States won't work. Both forms of saving are too deeply embedded with the Virtual Machine control code. Im not very familiar with VMs... if I ever even have used them at all. There's no simple hack that's possible to redirect saving to the SD card, which is what I was trying to do. Maybe there is a complex hack, but Im not going to hold my breath on it.

In fact... I may have to admit defeat and move on. But hopefully this effort will have helped me prepare for tackling the same issue with Sloop. I think that may be more promising... maybe.
 
Last edited by DarkAkuma,

theapguy

New Member
Newbie
Joined
Apr 29, 2022
Messages
2
Trophies
0
Age
37
Location
Brooklyn, NY
XP
10
Country
United States
Umm... this is and always has been there right in the opening post.



And I added this to the FAQ section yesterday.



I'm trying to get saves working. I haven't given up yet, and I have some ideas. But this is a feature that should not be assumed to be made to work... until if/when I find a way.

Believe me. Its a top priority, right after the debug emu. I know how make or break it is for many games.

EDIT:

As I said, I have been working on this. But sadly... it's looking like its not going to be possible.

While I did figure out that the GUI from my last screenshots is in fact not a titlebar for a window called "Save states Misc", but instead a menubar with "Save states" and "Misc" options... the save state menuitems do not work. They just freeze the emu.

As to why... its why saving, both SRAM and States won't work. Both forms of saving are too deeply embedded with the Virtual Machine control code. Im not very familiar with VMs... if I ever even have used them at all. There's no simple hack that's possible to redirect saving to the SD card, which is what I was trying to do. Maybe there is a complex hack, but Im not going to hold my breath on it.

In fact... I may have to admit defeat and move on. But hopefully this effort will have helped me prepare for tackling the same issue with Sloop. I think that may be more promising... maybe.
Thanks for this update and the efforts to try to get saving to work on Hiyoko. I misunderstood your note about neither SRAM or save states working but I get it now. Fingers crossed for Sloop!
 

DarkAkuma

Well-Known Member
OP
Member
Joined
Sep 20, 2008
Messages
301
Trophies
0
XP
1,787
Country
United States
Thanks for this update and the efforts to try to get saving to work on Hiyoko. I misunderstood your note about neither SRAM or save states working but I get it now. Fingers crossed for Sloop!

Don't need to keep your fingers crossed anymore. I had better luck with Sloop. I'll make new post and announcement for that in a few days. =)
 

DarkAkuma

Well-Known Member
OP
Member
Joined
Sep 20, 2008
Messages
301
Trophies
0
XP
1,787
Country
United States
Success!

But with a caveat...

I was able to figure out how to get Hiyoko to save/load both SRAM and Save States to the SD Card. But... It's only with the Debug version of the emu.

While that version would be nicer to use since it has a UI with save state saving and loading slots... It runs at around 10fps. Obviously not playable.

But... There's a chance I can fix it to run better. It just may take a lot of work.

Anyway. Here's a screenshot I took of seeing SRAM loaded. And it running at a whopping 11fps! =)

1651929707256.png
 
Latest News New

DarkAkuma

Well-Known Member
OP
Member
Joined
Sep 20, 2008
Messages
301
Trophies
0
XP
1,787
Country
United States
No luck with improving performance of the debug version yet... if I even will be able to. But before that I need to get things better set up for testing. And with that, I decided to do some research into the emu differences among all the .nca's in the leak.

First up, among all those files, there are 4 different versions of the emulator. There's 2 others with different build ID's, but internally they are the same as 2 of the other 4.

I have been able to piece together a build order, based on what I have detected in the code changes. But first, these are how the versions are distributed among the ncas.

V1: 0000, 0015
V2: 0001, 0002, 0003, 0004, 0005-A, 0006
V3: 0005-B, 0011-B, 0012, 0013, 0014, 001B, 001C
V4: 0011-A

V1 is the Debug emulator. As it was compiled for debug use, I can't 100% say that it was built before the others. But it does lack code for 1 of the 2 features that were the focus of the changes in the other builds.

V2 added the --color-temperature setting. With an internal default value set to 6500.

V3 changed the code for --tactile-inputs. Behind the scenes it looks more dynamic, but as far as usage goes it adds value "2" (Larger screen rotated 90 degrees right).

V4 changed the internal default value of --color-temperature from 6500, to 3000.

You could say other features were removed between v1 and v2, but the way dev builds are, often code is written in a way that it only compiles in Debug mode or Release mode. So its more likely that things like the GUI were simply coded to be compiled in Debug builds only.

...

Anyway. Heads up. Im considering merging this project into Slip. So I can provide a better interface, and so it will be easier for me to manage the code. Im far more used to C# than bat scripting, and I wont be as limited. It will probably be available from the Tools menu, like the Sloop+ setup wizard is.

Until then, this thread will remain open.

EDIT:

This project is instead getting merged into CaVE along with Slip.
 
Last edited by DarkAkuma,
  • Love
Reactions: hippy dave
General chit-chat
Help Users
    DEMONGreninjaPG @ DEMONGreninjaPG: my chromebook and wii