User:Zzo38/Compound NSF: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
No edit summary
(Citations for Hamster archive format)
Line 1: Line 1:
This is a draft proposal of "Compound NSF" format. The file is a Hamster archive. All chunks are optional other than <tt>PAYLOAD.NSF</tt>. Unrecognized chunks should be ignored. An implementation does not need to read all chunks; it can skip any chunk that it doesn't need.
This is a draft proposal of "Compound NSF" format. The file is a Hamster archive. All chunks are optional other than <tt>PAYLOAD.NSF</tt>. Unrecognized chunks should be ignored. An implementation does not need to read all chunks; it can skip any chunk that it doesn't need.


Specification of Hamster archive: Consists of a concatenation of chunks. Each chunk consists of null-terminated chunk name, data size in PDP-endian, and then the data.
'''Hamster archive''' is an [http://rpg.hamsterrepublic.com/ohrrpgce/RPG_format archive format used by OHRRPGCE].
Each file in the archive, or "lump", consists of an ASCII filename, a NUL byte ($00), a length in PDP-11 byte order (medium high byte, high byte, low byte, medium low byte), and the file contents. Filenames are case-insensitive, and contents are uncompressed.
The [http://rpg.hamsterrepublic.com/ohrrpgce/Ohrtool1#HAMARC HAMARC tool] manipulates Hamster archives.


== COMPOSER.TXT ==
== COMPOSER.TXT ==

Revision as of 03:20, 23 March 2015

This is a draft proposal of "Compound NSF" format. The file is a Hamster archive. All chunks are optional other than PAYLOAD.NSF. Unrecognized chunks should be ignored. An implementation does not need to read all chunks; it can skip any chunk that it doesn't need.

Hamster archive is an archive format used by OHRRPGCE. Each file in the archive, or "lump", consists of an ASCII filename, a NUL byte ($00), a length in PDP-11 byte order (medium high byte, high byte, low byte, medium low byte), and the file contents. Filenames are case-insensitive, and contents are uncompressed. The HAMARC tool manipulates Hamster archives.

COMPOSER.TXT

List of composers of each song, one per each line. First line for song $00, second line for song $01, etc.

CONTROLS.BIN

Contains a number of small-endian 16-bit numbers for various optional features. List using word offsets (not byte offsets):

  • $00: Start RAM offset to load random data into.
  • $01: End RAM offset to load random data into. If supported, all from the start and end offset but not including the end offset, must be RAM addresses, and are filled with random data before calling init.
  • $02: If nonzero, write to this RAM address (just before calling play) to request to start a sound effect.
  • $03: If nonzero, write to this RAM address to request to stop a sound effect.

DURATION.TXT

Default duration for each song when using with playlists, in frames.

PAYLOAD.NSF

This chunk has the same as ordinary NSF (version 1) except the header modified as follows:

  • Offset $006: If this is zero, then there are 256 songs in total.
  • Offset $007: If this is zero, then the default song is number $FF.
  • Offset $07C: Volume controls. Bit3 is MMC5 volume and bit2-bit0 is N163 volume. Other bits should always be clear. (This may be subject to moving to another offset for compatibility with NSF2)

MMC5 volume:

  • 0 = use default (same as 2A03 square waves)
  • 1 = use marked resistance value

N163 volume:

  • 0 = default (automatically)
  • 1 = 3.6x (Final Lap)
  • 2 = 4.0x (Megami Tensei II)
  • 3 = 6.0x
  • 4 = 6.5x (Rolling Thunder)
  • 5 = 7.3x (King of Kings)
  • 6 = 8.0x
  • 7 = 8.5x (Erika to Satoru no Yumebouken)

SONGTYPE.BIN

Starting bit7 of first byte for song $00, bit6 for song $01, etc, having 32 bytes in total, bit is set if it is a sound effect rather than a full song.

TITLE.TXT

List of song titles, one per each line. First line for song $00, second line for song $01, etc.