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

Making the parser more closely resemble the N64 libs #4

Closed
bryc opened this issue Mar 28, 2015 · 3 comments
Closed

Making the parser more closely resemble the N64 libs #4

bryc opened this issue Mar 28, 2015 · 3 comments

Comments

@bryc
Copy link
Owner

bryc commented Mar 28, 2015

parseNoteTable:

  1. gameCode typically must exist, and cannot be 00 00 00 00. Most games rely on this for identifying associated notes. For example, Gex 64 (NX2E) relies on the noteName only (In the format GEX:%s), and any gameCode will function as long as it's not completely empty.
  2. publisherCode also typically must exist, and cannot be 00 00 although some games don't care.
    3, noteName is typically not empty, and many games rely on this, especially when making use of extensions.
    Perhaps use a more strict mode by default, and have an option for a more lax mode (for salvaging repairable data).

headerCheck:

  1. Certain bits in the data must be set to avoid some errors (Pak is full, etc). However, headerCheck validates checksums without setting it. These bits should be fixed if they are not set, to be more robust.

See wiki entry

@bryc bryc closed this as completed Apr 15, 2015
Repository owner locked and limited conversation to collaborators Jul 16, 2015
@bryc
Copy link
Owner Author

bryc commented Aug 11, 2015

Aug 11: headerCheck handles the required bits properly. I removed the strict-checking for 00 00 00 00 in the gameCode field, because it didn't make sense - some notes were perfectly parsable despite having an invalid gameCode, no sense in causing it to break a perfectly valid file.

In the future, the MPKParser should be adapted to be able to salvage valid data and delete invalid data, which is what the Controller Pak library does. (Pertaining to the INODE table)

Note/recap (Nov 23 2016): I wrote this after doing a bunch of testing and seeing just how verbose the official controller pak library is, hence why I want to study it further and follow the lib behaviour more closely.

@bryc bryc reopened this Aug 11, 2015
@bryc bryc closed this as completed Jan 24, 2017
@bryc
Copy link
Owner Author

bryc commented Jan 24, 2017

Eventually I will get around to doing game tests to understand these constraints, as well as the unknown bytes. Issue 8 would also fall into those tests.

The whole idea of "making the parser follow the libs" means that my app must do more than just parse the data. I'm trying to keep unintended modification to a minimum. The n64 libs include a lot of recovery functions, like salvaging valid data from invalid data, which my parser does not do. This should be optional and a prompt to the user "This file is damaged. Continue loading only valid data? Some data may be lost."

@bryc
Copy link
Owner Author

bryc commented Aug 27, 2017

Different games may have different versions of the ultra64 library, or may have implemented their own functions for dealing with MPK. Important to keep that in mind, that the code for these functions is contained in the game itself, and may differ between games.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant