Various SWIs use R3 and R4 (or two consequtive memory locations which will be referred to as R3 and R4) to specify the range of playable data in the file.
|
Bit 31 of R3 clear: |
|
R3 = byte offset of sample data start |
|
R4 = byte offset of byte after sample data end (ie R3+#bytes) |
|
Bit 31 of R3 set: (from v1.59 only!) |
|
R3 bit 30 = inherit table |
|
R3 bits 0-15 = number of blocks |
|
R4 = address of block list (word aligned) |
When specifying the range (PlayIt_Open
) a normal contiguous data stream is specified by placing the range of bytes containing data in R3-R4. If the end point is not greater than the start point the end-of-file is used (eg 0,0 can be used to mean the entire file). This is not the same as the limits defined by PlayIt_BeginEnd
(which is the range to play) but rather the limits to which PlayIt_BeginEnd
and PlayIt_SetPtr
are bound. Initially the play pointer is set to this start position.
Also non-contiguous data can be specified by placing the number of chunks (n) in R3 with bit 31 set (this distinguishes it from the single block mode) and R4 pointing to a table of data describing the chunks. The table has 2*n 32-bit words (ie 8 bytes per chunk) arranged as follows:
0 |
byte offset of first chunk |
4 |
number of bytes in first chunk |
8 |
byte offset of second chunk |
12 |
number of bytes in second chunk |
etc |
Chunks need not have monotonically increasing positions. ie they can jump all over the file. When bit 31 of R3 is set, bit 30 is used to indicate whether PlayIt needs to make a copy of the table (bit clear) or whether it can use it directly (bit set). Bit 30 should only be set if the table is a block was claimed with
OS_Module,6 and PlayIt is allowed to dispose of it when it's finished with it (ie if it can inherit it). This inheritance mechanism is mainly for PlayIt's internal use when passing a table from the auto-detector to PlayIt_Open.
When range data is returned as information (ie <<PlayIt_FileInfo,0=>PlayIt_FileInfo0>>, PlayIt_SampleInfo
, PlayIt_Identify
and PlayIt_Open
in auto-detect mode) bit 31 of R3 may be set indicating that PlayIt is using a table. Accessing this table is not recommended in general and the table address will only actually be valid if the information refers to the currently open file since for transient enquiries the address will be in temporary workspace.
[ Parent ]
[ Manual root ]
Created by SHtoHTML v1.20