Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modest cleanups for DSi_NAND #1714

Merged
merged 20 commits into from
Jul 8, 2023
Merged

Conversation

JesseTG
Copy link
Contributor

@JesseTG JesseTG commented Jul 3, 2023

My latest chapter in the melonDS DS saga has led me to DSiWare support. Since melonDS doesn't support direct-booting DSiWare, I took an alternative approach; temporarily installing DSiWare and save data for the duration of a session, then exporting it back to the host at the end.

This PR introduces some odds and ends to make that simpler, including:

  • A struct definition for title metadata (minus the certificates)
  • A function to import DSiWare from memory

- melonDS ignores it anyway
- Move bitwise operations on the title ID into helper methods
- Use TitleMetadata objects instead of pointers to raw data
- Replace some constants with sizeof
- Use an NDSHeader object instead of a raw array of bytes
- It will be reused in the next commit
- The bytes of the title ID/category were being swapped in most places, but not all
Copy link
Member

@RayyanAnsari RayyanAnsari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skimmed through DSi_TMD.h in particular, there are some things that could be improved.

src/DSi_TMD.h Outdated Show resolved Hide resolved
src/DSi_TMD.h Outdated Show resolved Hide resolved
src/DSi_TMD.h Outdated Show resolved Hide resolved
src/DSi_TMD.h Show resolved Hide resolved
src/DSi_TMD.h Outdated Show resolved Hide resolved
src/DSi_TMD.h Outdated Show resolved Hide resolved
src/DSi_TMD.h Outdated Show resolved Hide resolved
src/DSi_TMD.h Outdated Show resolved Hide resolved
src/DSi_TMD.h Outdated Show resolved Hide resolved
@JesseTG JesseTG requested a review from RayyanAnsari July 4, 2023 17:29
src/DSi_TMD.h Outdated Show resolved Hide resolved
@JesseTG JesseTG requested a review from RSDuck July 7, 2023 22:52
@RSDuck RSDuck merged commit 0947e94 into melonDS-emu:master Jul 8, 2023
7 checks passed
kvnp pushed a commit to kvnp/melonDS that referenced this pull request Dec 25, 2023
* Add a definition for TMD files

* Wrap TitleMetadata in a namespace

* Add a comment

* Remove TitleMetadataCertificate

- melonDS ignores it anyway

* Refactor the use of title metadata

- Move bitwise operations on the title ID into helper methods
- Use TitleMetadata objects instead of pointers to raw data

* Slight cleanup in DSi_NAND

- Replace some constants with sizeof
- Use an NDSHeader object instead of a raw array of bytes

* Add a DSi_NAND::ImportFile overload that loads a file from memory

* Split most of ImportTitle into InitTitleFileStructure

- It will be reused in the next commit

* Add ability to import title from memory

* Fix another potential issue

* Fix broken DSiWare installation

- The bytes of the title ID/category were being swapped in most places, but not all

* Add some logging calls

* Declare array sizes in DSi_TMD in decimal, not hex

* Add a space after the #endif

- To adhere to the style guide

* Assert the size of TitleMetadataContent

* Change the type of SignatureName

* Don't mark the TMD structs as packed

* Remove extraneous comments

* Cut down some newlines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants