Amiga Serial Commands
Posted: Mon Aug 02, 2010 5:34 pm
I decided to start playing around with the Amiga software a bit (Prevue Grid/A2-Blue/TV Guide software/whatever you want to call it), since it's pretty cool, and I kinda want to see if we can get our own listings going to it, even if it involves simply editing the curday.dat file. Unfortunately, it takes a VERY long time to edit curday.dat, re-PowerPack it (since I can't find any Mac/UNIX software that can do that, I have to do it inside Workbench), replace the curday.dat on the PREVUE.ADF, and then boot it up and see what happened. A little later, I'll be looking at a way to streamline that process so that we can start doing some cool things with this, but in the meantime, I decided to revisit serial commands.
After a good bit of fiddling (I do NOT understand most of the code of E-UAE, so I kinda had to work around it with what I do know, which is perhaps even more difficult), I was able to build my UDP data listener directly into E-UAE (like I did with Atari800), and now I can send arbitrary serial commands to the emulated machine whenever I want. Here's what I've found:
The DATA Cmds counter in Diagnostic Mode works quite oddly and is confusing. For example, if I boot up the machine and send it a time command, the Cmds counter (which seems to count how many successful commands have been received) says 2 and the CErrs (which seems to count how many unsuccessful commands have been received) says 1. When I send it an "End of Data Burst" (mode 0xBB) command, the Cmds updates to 3. However, if I then send another 0xBB command, it updates to 5. It seems that it sometimes counts the first part of the command (55AA412A0094, which contains the select code of * and a checksum of 94) as an entire successful command, but sometimes it does not. The lack of consistency in the DATA counter makes this research process quite confusing.
Here's a breakdown of the various commands we know of and their impact on the TV Guide software. Keep in mind all of these commands were reverse engineered by tin on the Atari platform on software likely built in 1985, which is why we don't understand their impact on the Amiga platform as much on software built in 1999. Obviously the command structure is still fundamentally the same.
End of Data Burst (Mode 0xBB)
Works completely as expected. Turns off the data light after another command turns it on. Counted as 1 "Cmd" if following another, but counted as 2 if multiple in a row are sent.
Title (Mode T)
Is received as 1 Cmd with no CErrs, but seems to be ignored. I have not tried this command while listings are active, MAYBE it shows up as an announcement or cable provider title somewhere in the listings? (Probably not) If multiple in a row are sent, only the first is recognized as a Cmd.
Ad (Mode C)
Ad commands work as expected - sorta. They only work when the TEXT setting, which is seen in Diagnostic mode and can be changed by typing an exclamation point, is set to either R or S. They have no effect when TEXT is set to L or N. (The TEXT setting probably was changed remotely through the F command.) The other quirky thing about the ad commands is that if an ad is already set in the slot that you are sending it to - whether it was sent over the feed or locally set, sending the ad command will cause an instant Guru Meditation. Really, Prevue software engineers? Didn't bother to put any checking in there? Maybe there's some newer way of sending ads, because that doesn't really make sense. UVSG could have quickly and easily killed every single running Prevue machine by accidentally issuing a simple 55AA412A009455AA4C0100B2. Ad commands are accepted (even in L and N modes) as 2 Cmds the first time, with subsequent ad commands being received as a single Cmd.
Time (Mode K)
Sadly, the time command seems to fail on the Amiga software. It was probably changed slightly since the Atari version, but we don't really know what changed. The time command is received as two successful Cmds and one CErr the first time it is received; if multiple are sent in a row they are received as one Cmd and one CErr. The time and date that the software are using do not change.
Settings (Mode F) (Originally documented here)
Here's an interesting one. I predicted the Atari settings command would do nothing on here, but in fact it has an effect. Issuing an Atari settings block is counted as 2 Cmds, and changes almost all of the settings at the bottom. It clears the VIN, CONT, LINE, and GRPH settings, sets FWD to C, the number of ads to 0@ (instead of 36), and the timezone to 5. Basically, it totally screws up the settings, but the important thing is that it is able to mess with the settings at all. I'll definitely be playing around with this one a bit to figure out what these settings mean and how to change them effectively with the Mode F command. After issuing this command, the menus function a bit oddly and doing basically anything will result in a crash and reboot.
After a good bit of fiddling (I do NOT understand most of the code of E-UAE, so I kinda had to work around it with what I do know, which is perhaps even more difficult), I was able to build my UDP data listener directly into E-UAE (like I did with Atari800), and now I can send arbitrary serial commands to the emulated machine whenever I want. Here's what I've found:
The DATA Cmds counter in Diagnostic Mode works quite oddly and is confusing. For example, if I boot up the machine and send it a time command, the Cmds counter (which seems to count how many successful commands have been received) says 2 and the CErrs (which seems to count how many unsuccessful commands have been received) says 1. When I send it an "End of Data Burst" (mode 0xBB) command, the Cmds updates to 3. However, if I then send another 0xBB command, it updates to 5. It seems that it sometimes counts the first part of the command (55AA412A0094, which contains the select code of * and a checksum of 94) as an entire successful command, but sometimes it does not. The lack of consistency in the DATA counter makes this research process quite confusing.
Here's a breakdown of the various commands we know of and their impact on the TV Guide software. Keep in mind all of these commands were reverse engineered by tin on the Atari platform on software likely built in 1985, which is why we don't understand their impact on the Amiga platform as much on software built in 1999. Obviously the command structure is still fundamentally the same.
End of Data Burst (Mode 0xBB)
Works completely as expected. Turns off the data light after another command turns it on. Counted as 1 "Cmd" if following another, but counted as 2 if multiple in a row are sent.
Title (Mode T)
Is received as 1 Cmd with no CErrs, but seems to be ignored. I have not tried this command while listings are active, MAYBE it shows up as an announcement or cable provider title somewhere in the listings? (Probably not) If multiple in a row are sent, only the first is recognized as a Cmd.
Ad (Mode C)
Ad commands work as expected - sorta. They only work when the TEXT setting, which is seen in Diagnostic mode and can be changed by typing an exclamation point, is set to either R or S. They have no effect when TEXT is set to L or N. (The TEXT setting probably was changed remotely through the F command.) The other quirky thing about the ad commands is that if an ad is already set in the slot that you are sending it to - whether it was sent over the feed or locally set, sending the ad command will cause an instant Guru Meditation. Really, Prevue software engineers? Didn't bother to put any checking in there? Maybe there's some newer way of sending ads, because that doesn't really make sense. UVSG could have quickly and easily killed every single running Prevue machine by accidentally issuing a simple 55AA412A009455AA4C0100B2. Ad commands are accepted (even in L and N modes) as 2 Cmds the first time, with subsequent ad commands being received as a single Cmd.
Time (Mode K)
Sadly, the time command seems to fail on the Amiga software. It was probably changed slightly since the Atari version, but we don't really know what changed. The time command is received as two successful Cmds and one CErr the first time it is received; if multiple are sent in a row they are received as one Cmd and one CErr. The time and date that the software are using do not change.
Settings (Mode F) (Originally documented here)
Here's an interesting one. I predicted the Atari settings command would do nothing on here, but in fact it has an effect. Issuing an Atari settings block is counted as 2 Cmds, and changes almost all of the settings at the bottom. It clears the VIN, CONT, LINE, and GRPH settings, sets FWD to C, the number of ads to 0@ (instead of 36), and the timezone to 5. Basically, it totally screws up the settings, but the important thing is that it is able to mess with the settings at all. I'll definitely be playing around with this one a bit to figure out what these settings mean and how to change them effectively with the Mode F command. After issuing this command, the menus function a bit oddly and doing basically anything will result in a crash and reboot.