On to the channel data format itself. A typical channel block looks like this on the ASCII side:
Code: Select all
[ 2 ......CBS006.KCBS....................00...CBS006.
Obviously most of the actual attributes are stored as hex codes that can't be seen on the ASCII side, but let's focus on this first for a second. First, you see the open bracket, which just seems to mark the beginning of a channel block (and the end of the previous one). Then, there are a few spaces, followed by a channel number. On channels without a number (the pseudo-channels that are just messages, like "Effective February 1st, our Torrance & Hawthorne Service Center hours will be..."), the number is simply another space. After another space, there are a series of 0x00s, followed by the internal name of the channel, which is usually a six character code.
Since there are multiple (a lot, actually) of CBS affiliates/O&Os in the country, each one has its own unique code. In this case, CBS006 refers to KCBS, which is LA's CBS station. Some channels only have one version for the entire country, like TWC001, and some have two, like ETV001 and ETV002 (002 being E!'s west coast feed, which is presumably the same as ETV001 but 3 hours delayed).
The unique channel code is followed by an 0x00 and then the name of the channel that shows up in the listings. Some channels do not have a name, like the "Effective February 1st" notice at the beginning of the listings and the TV Guide copyright notice at the bottom. After the name, you see several dots, which are actually the channel's "flags". They seem to signify things like color (regular, highlight, or alt highlight), whether or not the channel is ditto (meaning the same listings continue at all times), whether or not the channel is stereo, whether it's a real channel or just a notice, and some extra stuff if the channel has Pay-Per-View information attached to it (indicating that the listings should pause over the channel and/or that there is more information about it after the listings scroll). Here is an example of these flags as they appear for L0708J (the "Effective February 1st notice", which is by default highlighted in red):
Code: Select all
00 00 00 00 00 00 00 00 00 A2 FF FF FF FF FF FF 00 00 00 00 00 00 82 FF FF
As you can see, first there's a bunch of padding for no apparent reason, and then a byte (in this case, A2) that sets several flags. Here are all of the different combinations of these flags I could find in curday.dat. (Thanks to swest77 for his table in another thread that made figuring out which channels have which flags much much easier!)
[html]<table>
<tr>
<th>Flags</th>
<th>Byte</th>
</tr>
<tr>
<td>None</td>
<td>0x01</td>
</tr>
<tr>
<td>HILITESRC CAF_PPVSRC</td>
<td>0x12</td>
</tr>
<tr>
<td>None HILITESRC CAF_PPVSRC</td>
<td>0x13</td>
</tr>
<tr>
<td>DITTO</td>
<td>0x20</td>
</tr>
<tr>
<td>None STEREO</td>
<td>0x81</td>
</tr>
<tr>
<td>HILITESRC SUMBYSRC CAF_PPVSRC STEREO</td>
<td>0x96</td>
</tr>
<tr>
<td>DITTO STEREO</td>
<td>0xA0</td>
</tr>
<tr>
<td>HILITESRC DITTO STEREO</td>
<td>0xA2</td>
</tr>
<tr>
<td>ALTHILITESRC STEREO</td>
<td>0xC0</td>
</tr>
<tr>
<td>DITTO ALTHILITESRC STEREO</td>
<td>0xE0</td>
</tr>
</table>[/html]
None - I don't quite understand this one. What is there none of? I don't get the pattern here.
DITTO - Seems to indicate that the listings do not change, or do not change often. May be responsible for the double arrows on either end of the listings?
CAF_PPVSRC - Marks the channel as having Pay-Per-View. Not 100% sure what that affects.
SUMBYSRC - Marks the channel as a summary source, meaning that after the listings are done rolling around, some of the programs that are going to be on the channel for that day will be listed on that grey background with a title of "Summary of <CHANNELNAME>".
STEREO - Marks the station as having stereo. Not sure why this is necessary.
HILITESRC - Red gradient highlight.
ALTHILITESRC - Blue gradient highlight.
After the flag byte, we have 6 bytes of 0xFF if the channel is to be displayed in the listings (or apparently sometimes something else - in the case of The Weather Channel, this is replaced with FC FF FF 03 00 00. I don't know what difference it makes), or 6 bytes of 0x00 if it should not be. Then, 6 more bytes of 0x00 for no discernible reason, and then either 0x82, 0x8A, or 0x8B (not sure what this affects yet), and FF FF 30 30 00 00 03, the internal name of the channel again, another 00, and finally the program data. Here's a full block of the TV Guide Channel on channel 12 in both ASCII and Hex just for reference.
Code: Select all
[ 12 ......TVGC...TVGC....................00...TVGC.
Code: Select all
5B 20 20 31 32 20 00 00 00 00 00 00 54 56 47 43 00 00 00 54 56 47 43 00 00 00 00 A0 FF FF FF FF FF FF 00 00 00 00 00 00 82 FF FF 30 30 00 00 03 54 56 47 43