I was musing about this and had a preliminary notion of how to do it, like MIDI (but actually being a compliant IFF)
NES video format
extensions: .nvf, .nesv, .nesvideo
big-endian (for little-endian long-values begin with "RIFF" instead)
[Reminder: AIFF = 4-char chunkname, ULONG chunklength,then chunkdata, except for the FORM chunk which excludes the filetype. Even-length chunks only.]
always: "FORM" + ULONG(4B): bytes in file (excl. this 12) + "NESV"
always: "NVhd" [+ ULONG(4B): bytes in header]
-NTSC? PAL? DEND?
-Mapper? (what kind of sounds)
usually: "NAME" [+len] + string of title. Null terminator unnecessary.
'AUTH' /* chunkID for Author Chunk */
'(c) ' /* chunkID for Copyright Chunk */
'ANNO' /* chunkID for Annotation Chunk */
'COMT' : comments chunk (standard AIFF)
'MARK' : markers chunk (standard AIFF)
'ROM ' : what rom is it on (for use with? to get CHR?)
always: "NViD" [+len] + any number of events, in sequential order.
Byte of scanline to execute event (0 = "prerender", 241+ = postrender), then bytecode of event, then data.
-00 Frame break: VWF # frames to skip (0 = "done for this frame")
-xx "fine"/Mid-line-event: Which pixel specifically to execute the next event, rather than before the scanline.
-$20-$27 PPU Register hits (one can, in theory, use only this + framebreaks)
--PPUCTRL,PPUMASK,PPUSTATUS,OAMADDR,OAMDATA,PPUSCROLL,PPUADDR,PPUDATA
--then databyte
--$28: PPU_SCROLL_WHOLE: both bytes
--$29: PPU_ADDR_WHOLE: both bytes
-$40-$57 APU/I/O register hits
--$58: DMC_WHOLE: the waveform itself, rather than pointer/length
--$59: OAMDMA_WHOLE: then whole OAM contents, rather than the byte of address to copy from
-xx Palette change (whole palette? redundant with...)
-xx PPURAM data block (incl. PT, NT, AT)
--address to start at (2 byte), length of block (2 byte), then data.
-xx Fine palette block
--NT address of tile to start at, number of tiles to hit, then each's palette, four to a byte
[actual ExGrafx-style would require including the whole of CHR/referring to the proper ROM- which is probably desirable space-wise, rather than just acting like there's RAM and overwriting to emulate a bankswitch]
As the original notion was also about streaming, the events could also be sent as a stream (again, MIDI-style) (scanline-positions, frame-terminators would still be present, but would be less likely to include more frames of inactivity).
Thoughts/revisions/suggestions welcome.
NES video format
extensions: .nvf, .nesv, .nesvideo
big-endian (for little-endian long-values begin with "RIFF" instead)
[Reminder: AIFF = 4-char chunkname, ULONG chunklength,then chunkdata, except for the FORM chunk which excludes the filetype. Even-length chunks only.]
always: "FORM" + ULONG(4B): bytes in file (excl. this 12) + "NESV"
always: "NVhd" [+ ULONG(4B): bytes in header]
-NTSC? PAL? DEND?
-Mapper? (what kind of sounds)
usually: "NAME" [+len] + string of title. Null terminator unnecessary.
'AUTH' /* chunkID for Author Chunk */
'(c) ' /* chunkID for Copyright Chunk */
'ANNO' /* chunkID for Annotation Chunk */
'COMT' : comments chunk (standard AIFF)
'MARK' : markers chunk (standard AIFF)
'ROM ' : what rom is it on (for use with? to get CHR?)
always: "NViD" [+len] + any number of events, in sequential order.
Byte of scanline to execute event (0 = "prerender", 241+ = postrender), then bytecode of event, then data.
-00 Frame break: VWF # frames to skip (0 = "done for this frame")
-xx "fine"/Mid-line-event: Which pixel specifically to execute the next event, rather than before the scanline.
-$20-$27 PPU Register hits (one can, in theory, use only this + framebreaks)
--PPUCTRL,PPUMASK,PPUSTATUS,OAMADDR,OAMDATA,PPUSCROLL,PPUADDR,PPUDATA
--then databyte
--$28: PPU_SCROLL_WHOLE: both bytes
--$29: PPU_ADDR_WHOLE: both bytes
-$40-$57 APU/I/O register hits
--$58: DMC_WHOLE: the waveform itself, rather than pointer/length
--$59: OAMDMA_WHOLE: then whole OAM contents, rather than the byte of address to copy from
-xx Palette change (whole palette? redundant with...)
-xx PPURAM data block (incl. PT, NT, AT)
--address to start at (2 byte), length of block (2 byte), then data.
-xx Fine palette block
--NT address of tile to start at, number of tiles to hit, then each's palette, four to a byte
[actual ExGrafx-style would require including the whole of CHR/referring to the proper ROM- which is probably desirable space-wise, rather than just acting like there's RAM and overwriting to emulate a bankswitch]
As the original notion was also about streaming, the events could also be sent as a stream (again, MIDI-style) (scanline-positions, frame-terminators would still be present, but would be less likely to include more frames of inactivity).
Thoughts/revisions/suggestions welcome.