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

Write NSFe format #39

Closed
6 of 7 tasks
pinobatch opened this issue Mar 8, 2019 · 3 comments
Closed
6 of 7 tasks

Write NSFe format #39

pinobatch opened this issue Mar 8, 2019 · 3 comments
Labels
enhancement shell NES, NSF, and NSFe shells

Comments

@pinobatch
Copy link
Owner

pinobatch commented Mar 8, 2019

The NSFe format allows including more structured metadata than NSF. It begins with four bytes NSFE in ASCII, followed by a sequence of chunks as length, fourcc, data tuples: "INFO" first and "NEND" last. Integers are little-endian as in NSF, and no CRC is used unlike PNG.

NSFPlay and VLC media player can reportedly play NSFe files.

  • Get it writing a valid NSFe with the essential chunks: INFO, DATA, and NEND
  • If PENTLY_USE_PAL_ADJUST, enable Dendy mode in the player by writing a regn chunk containing 07 00
  • Add auth chunk containing "$title\x00$author\x00$publisher\x00"

After #38, add credit metadata:

  • Fix auth chunk not to hardcode the strings
  • Write song titles as null-terminated strings in tlbl chunk
  • Write song authors as null-terminated strings in taut chunk
  • If PENTLY_USE_NSF_SOUND_FX, write a psfx chunk containing all bytes from NUM_SONGS through NUM_SONGS + NUM_SOUNDS - 1.
This was referenced Mar 8, 2019
pinobatch added a commit that referenced this issue Mar 8, 2019
Handle most chunks described in #39:

- required INFO, DATA, and NEND chunks
- regn if PAL compensation is enabled
- auth (preliminary, pending changes in #38)

Not done:

- psfx (length depends on sound effects count; would require
  changes to pentlyas)
@pinobatch
Copy link
Owner Author

Basic NSFe generation is in. But because the length of psfx depends on NUM_SOUNDS yet must be determined at assembly time, adding psfx will have to wait for include file generation, which I plan to add along with #38.

@pinobatch pinobatch added enhancement shell NES, NSF, and NSFe shells labels Mar 8, 2019
pinobatch added a commit that referenced this issue Mar 8, 2019
- pentlyas.py: write song title to comments in output
- NSFe shell: write song title and author to tlbl and taut chunks
  (not well tested)
- NSFe shell: write sound effect playlist to psfx chunk
  (not well tested)
- Document title, author, and copyright commands

This should fix #38.
But #39 needs more testing in other NSFe players.
pinobatch added a commit that referenced this issue Mar 8, 2019
the dword is "damn".  Having confirmed that NSFPlay reads tlbl and
taut, #39 is two steps closer.  Still need something that supports
psfx though.
@pinobatch
Copy link
Owner Author

Verifying the last part (psfx) depends on an NSFPlay defect fixed in b100dfc. Will close once that fix lands in the next beta release and I can test.

@pinobatch
Copy link
Owner Author

NSFPlay 2.4b13 fixes psfx parsing, reading the NSFe correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement shell NES, NSF, and NSFe shells
Projects
None yet
Development

No branches or pull requests

1 participant