-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reconfigure a few instructions, including replacing a conditional near jump with an 80286-compatible equivalent. Also updated the file standard, but none of that takes effect quite yet.
- Loading branch information
1 parent
1a5b438
commit a0956d4
Showing
2 changed files
with
79 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,60 @@ | ||
Video codec notes | ||
.98V video codec specification | ||
Header: | ||
0x00 "98v" | ||
0x00 "98V" | ||
0x03 uint8 framerate (number of GPU frames to skip for every video frame) | ||
0x04 uint32 number of frames | ||
0x08 low byte uint8 Sample rate spec | ||
0x08 low byte uint8 | ||
86 sample rate spec (bit 0-2) | ||
0x00 44100 Hz | ||
0x01 33075 Hz | ||
0x02 22050 Hz | ||
0x03 16537.5 Hz | ||
0x04 11025 Hz | ||
0x05 8270 Hz | ||
0x05 8268.75 Hz | ||
0x06 5520 Hz | ||
0x07 4130 Hz | ||
high byte uint8 Sample depth spec | ||
0x00 16-bits | ||
0x40 8-bits | ||
0x0A uint4[16][3] colour table (rg br gb ...) for all 16 colours | ||
Audio type spec (bit 3) | ||
0x00 ADPCM (with buzzer compat option) | ||
0x08 Buzzer audio | ||
Screen resolution spec (bit 4) | ||
0x00 640x400 (pixel aspect 1:1) | ||
0x10 640x200 (pixel aspect 1:2) | ||
Unused (bit 5-7) | ||
high byte uint8 Unused | ||
0x0A uint4[16][3] colour table (rg br gb ...) for all 16 initial colours | ||
|
||
Frame Data: | ||
Audio Data: | ||
uint16 length of audio data (16-bit words) | ||
Then a bunch of 16-bit words containing the audio data for this frame | ||
0x00 uint16 length of audio data (16-bit words, n) | ||
0x02 uint16[n] Audio data | ||
ADPCM: | ||
The audio data is in 8-bit signed ADPCM format which expands to signed 16-bit PCM | ||
Buzzer audio: | ||
The audio data is in 8-bit pulse widths that can be pushed to the buzzer audio control after a shift if necessary | ||
ADPCM codec: | ||
Encodes the difference from the last sample, and applies a bitshift according to the last difference. | ||
The first sample is 0x0000, and the initial bitshift is 0. The bitshift value can reach a maximum of 8. | ||
Uses two-complement signed format. The sign is figured out with test data, 0x80, and if it is negative, then abs(data) is not(data) (this is off by one but it doesn't matter). | ||
abs(data) <= 0x18: decrement bitshift by 1 after this sample. | ||
abs(data) >= 0x68: increment bitshift by 1 after this sample. | ||
(My decoder actually uses an acceleration table it creates at startup just to speed things up by using an acceptable amount of memory) | ||
Video Frame Header: | ||
0x00 low byte 0000 IRGB planes to update (automatically determines how many plane sections and which planes they correspond to) | ||
high byte 0000 0000 | ||
0x00 low byte UUUU IRGB planes to update (automatically determines how many plane sections and which planes they correspond to, U is reserved for 256 colour board compatibility) | ||
high byte 0000 000P update palette? | ||
0x02 uint4[16][3] colour table (rg br gb ...) for all 16 colours if palette is to be updated this frame, otherwise not included | ||
Plane Header: | ||
0x00 uint16 total length of data for this plane | ||
Plane data chunk: | ||
0x02 uint16 offset in plane to update (highest bit determines data type: 0 -> copy data, 1 -> fill data | ||
Fill section: | ||
0x00 uint16 number of fills (n) | ||
Plane data chunk (n repetitions): | ||
0x02 uint16 offset in plane to update | ||
0x04 uint16 length to update (in 16-bit words) | ||
0x06 Plane data: | ||
16-bit words containing data for the plane (copy) | ||
or | ||
Single 16-bit word containing the data to fill with (fill) | ||
0x06 uint16 Single 16-bit word containing the data to fill with | ||
(repeats as many times as necessary) | ||
Copy section: | ||
0x00 uint16 number of copies (n) | ||
Plane data chunk (n repetitions): | ||
0x02 uint16 offset in plane to update | ||
0x04 uint16 length to update (in 16-bit words, m) | ||
0x06 uint16[m] 16-bit words containing data for the plane | ||
(repeats as many times as necessary) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters