Repository navigation
SPUDUMP: 64-byte sample data, the loop point loop, reference player limits #6
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,7 +87,7 @@ Each packet consists of a header and a payload. The header is 4 bytes long: | |
|
|
||
| - **End of pattern (0x02)**: The payload size is 0. Signals that the current pattern is complete. The player advances to the next entry in the current order table and begins processing the corresponding pattern. If the current order is the last entry, behavior depends on the order table's loop setting. | ||
|
|
||
| - **Loop point (0x03)**: The payload size is 0. Marks the current stream position as the loop restart point within the current pattern. When the player reaches the end of pattern (0x02) and the pattern is set to loop, it returns to this position. Only one loop point per pattern is valid; a second loop point overrides the first. | ||
| - **Loop point (0x03)**: The payload size is 0. Marks the current stream position as the loop restart point within the current pattern. When the player reaches the end of pattern (0x02) and the pattern is set to loop, that is the order table loops from its last entry back to that same entry, it returns to this position instead of the start of the pattern. Only one loop point per pattern is valid; a second loop point overrides the first. | ||
|
|
||
| - **Trace begin (0x04)**: The payload size is 0. Indicates that all preceding packets were synthetically generated to restore SPU state, and that subsequent packets represent actual captured data. This is analogous to the GPU dump format's trace begin packet. For composition-driven files, this packet is not required. | ||
|
|
||
|
|
@@ -134,7 +134,7 @@ Each packet consists of a header and a payload. The header is 4 bytes long: | |
|
|
||
| The payload consists of: | ||
| - 1 word: SPU RAM base address in 8-byte units. | ||
| - Remaining words: raw ADPCM data, to be DMA'd contiguously starting at the base address. | ||
| - Remaining words: raw ADPCM data, to be DMA'd contiguously starting at the base address. Its length must be a multiple of 64 bytes, padded with zeroes if needed: the SPU DMA moves whole 64-byte blocks, so a player may read up to 60 bytes past a shorter payload. | ||
|
|
||
| ### Timing Packets | ||
|
|
||
|
|
@@ -179,6 +179,15 @@ A minimal player performs the following steps: | |
|
|
||
| Seeking to an arbitrary order position is accomplished by setting the current order index and jumping to the corresponding pattern's stream offset. Because each pattern begins with a full SPU state snapshot, no history is required. | ||
|
|
||
| ### Player limits | ||
|
|
||
| The reference player, nugget's `spdplayer`, has fixed-size tables. A file meant for it should stay within them; the player ignores what does not fit: | ||
|
|
||
| - 256 entries per order table, and 16 order tables. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| - 256 pattern headers. | ||
| - 128 samples in the sample directory. | ||
| - 256 macros (indices 0-255), of up to 8 register writes each. | ||
|
|
||
| ## Usage Notes | ||
|
|
||
| - For composition-driven files, the SPU state snapshot at the head of each pattern should write all registers for every voice used by the song, including volume, pitch, ADSR, and sample address registers. Voices not used by the song should not be touched, leaving them available for sound effects. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
State the loop condition in terms of the order table.
pattern is set to loopis not a defined condition. Lines 97-98 place the loop flag and target on the order table. The phrasethat isalso makes the sentence ambiguous. State that the current order is the last entry and that the order table loops from that entry back to itself. (github.com)Proposed wording
Committable suggestion
Script executed:
Repository: ps1dev/standards
Length of output: 14097
Script executed:
Repository: ps1dev/standards
Length of output: 320
Web query:
"github.com/pcsx-redux/nugget" spdplayer.c PKT_LOOP_POINT s_loopPoint advanceOrderResult:
Script executed:
Repository: ps1dev/standards
Length of output: 4195
Resolve the loop-point mismatch with the reference player.
In
spdplayer.cat the currentnuggetmainrevision175f329db302892e4aac146a22778d1876cae48f,PKT_LOOP_POINTstores the stream position ins_loopPoint. However,PKT_END_PATTERNcallsadvanceOrder(), which reloads the target pattern and clearss_loopPointwithout using it. A self-targeting order loop therefore restarts the pattern instead of returning to the documented loop point.Pin the intended
nuggetrevision. If it has this control flow, updatespdplayeror revise the SPUDUMP contract.