skeg64
11th November 2004, 17:13
Hi,
I am authoring with Maestro. I'm trying to make use of SPRM 15, which contains the audio capabilites of the player.
This register uses 11 of the 16 bits, with the other 5 not defined. Each bit that is used denotes whether a certain audio format can be decoded by the player. The value stored in the SPRM is the sum of the values for all supported formats. For example, a player that can play MPEG, DTS and AC3 would have the following breakdown:
................................ Bit .|. Value.|. 0N/OFF.|. Total
-----------------------------------------------------------------
(Reserved)....................... 0 ..... 1 ....... 0 ....... 0
(Reserved)....................... 1 ..... 2 ....... 0 ....... 0
SDDS Karaoke capability (option). 2 ..... 4 ....... 0 ....... 0
DTS Karaoke capability (option).. 3 ..... 8 ....... 0 ....... 0
MPEG Karaoke capability 1st bit.. 4 ..... 16 ...... 0 ....... 0
MPEG Karaoke capability 2nd bit.. 5 ..... 32 ...... 0 ....... 0
AC-3 Karaoke capability.......... 6 ..... 64 ...... 0 ....... 0
PCM Karaoke capability........... 7 ..... 128 ..... 0 ....... 0
(Reserved)....................... 8 ..... 256 ..... 0 ....... 0
(Reserved)....................... 9 ..... 512 ..... 0 ....... 0
SDDS capability (option)........ 10 ..... 1024 .... 0 ....... 0
DTS capability (option)......... 11 ..... 2048 .... 1 .... 2048
MPEG capability first bit....... 12 ..... 4096 .... 1 .... 4096
MPEG capability second bit...... 13 ..... 8192 .... 0 ....... 0
AC-3 capability................. 14 ..... 16384 ... 1 ... 16384
(Reserved)...................... 15 ..... 32768 ... 0 ....... 0
.................................................. Total: 22528
Since 11 bits can potentially be used here, there are obviously 2^11 different values that could be in this register.
My question is, how do I make use of this SPRM, without writing commands for all 2^11 possible values? Is there a way to tell if a certain bit is turned ON or OFF?
I can test for AC3 by checking if the value is > 16383. But how would I test for DTS capabilites?
OK, I could do:
MOV GP0, SPRM15
SUB GP0, 16384 if (GP0 > 16383)
SUB GP0, 4096 if (GP0 > 4095)
(Output command) if (GP0 > 2047)
That would test for DTS. But say I want to test for SDDS Karaoke, that's a lot of lines of commands! What if I want to test them in ascending order, that's about 91 lines of code, at a rough estimate. Is there a faster way to check the value of a particular bit?
Thanks in advance for any help. P.S. don't ask me why I want to do this, I am more interested in it for academic reasons.
I am authoring with Maestro. I'm trying to make use of SPRM 15, which contains the audio capabilites of the player.
This register uses 11 of the 16 bits, with the other 5 not defined. Each bit that is used denotes whether a certain audio format can be decoded by the player. The value stored in the SPRM is the sum of the values for all supported formats. For example, a player that can play MPEG, DTS and AC3 would have the following breakdown:
................................ Bit .|. Value.|. 0N/OFF.|. Total
-----------------------------------------------------------------
(Reserved)....................... 0 ..... 1 ....... 0 ....... 0
(Reserved)....................... 1 ..... 2 ....... 0 ....... 0
SDDS Karaoke capability (option). 2 ..... 4 ....... 0 ....... 0
DTS Karaoke capability (option).. 3 ..... 8 ....... 0 ....... 0
MPEG Karaoke capability 1st bit.. 4 ..... 16 ...... 0 ....... 0
MPEG Karaoke capability 2nd bit.. 5 ..... 32 ...... 0 ....... 0
AC-3 Karaoke capability.......... 6 ..... 64 ...... 0 ....... 0
PCM Karaoke capability........... 7 ..... 128 ..... 0 ....... 0
(Reserved)....................... 8 ..... 256 ..... 0 ....... 0
(Reserved)....................... 9 ..... 512 ..... 0 ....... 0
SDDS capability (option)........ 10 ..... 1024 .... 0 ....... 0
DTS capability (option)......... 11 ..... 2048 .... 1 .... 2048
MPEG capability first bit....... 12 ..... 4096 .... 1 .... 4096
MPEG capability second bit...... 13 ..... 8192 .... 0 ....... 0
AC-3 capability................. 14 ..... 16384 ... 1 ... 16384
(Reserved)...................... 15 ..... 32768 ... 0 ....... 0
.................................................. Total: 22528
Since 11 bits can potentially be used here, there are obviously 2^11 different values that could be in this register.
My question is, how do I make use of this SPRM, without writing commands for all 2^11 possible values? Is there a way to tell if a certain bit is turned ON or OFF?
I can test for AC3 by checking if the value is > 16383. But how would I test for DTS capabilites?
OK, I could do:
MOV GP0, SPRM15
SUB GP0, 16384 if (GP0 > 16383)
SUB GP0, 4096 if (GP0 > 4095)
(Output command) if (GP0 > 2047)
That would test for DTS. But say I want to test for SDDS Karaoke, that's a lot of lines of commands! What if I want to test them in ascending order, that's about 91 lines of code, at a rough estimate. Is there a faster way to check the value of a particular bit?
Thanks in advance for any help. P.S. don't ask me why I want to do this, I am more interested in it for academic reasons.