OK, I actually got it narrowed down to a single pixel with only 2 flashes, plus 1 extra for confirmation. Not bad. Total elapsed time from start to finish, 52 minutes -- including writing the completely optional SMG building script, and not including writing it up in this post.
This is the first image:
Basically the top line is completely orange, the bottom line is completely pink, the left line is red, then green, then blue (top to bottom), but not including the topmost or bottom-most pixel, and the right line is gold, then aqua, then gold (oops, used the same color twice) not including the topmost or bottom-most pixel. The middle is of course yellow.
When I flashed this in, the background was orange. Yay - our pixel is on the top line.
This is the second image:
Now the whole image is yellow except the top line (since we only care about the top line). The upper left pixel is black, the upper right pixel is white, and then at about 80 pixels apiece the segments in between are red, orange, yellow, green, blue, and violet. Yeah, if the background had been yellow it would have been semi-ambiguous, but not really since the body seems not to matter.
Flashed it in, booted, background was white.
Voila -- the only thing white in that image is the upper right pixel.
Made this 3rd image just for confirmation:
The whole image is yellow except the upper right pixel is pink. Flashed it in, booted, background is pink. Mystery solved and confirmed.
Final answer -- the
upper right corner of the image (as saved, after mirroring, before doing all the other manipulation to it in the hex editor) is the color that will be the background.
Also, I'm a programmer, so I got tired of hex editing files manually and dashed off a quick script to do all the hex manipulation of the BMP. Just save the BMP, feed it to this script (assuming you've got Perl on your machine) and it spits out a CG42.smg file.
Code:
#!/usr/local/bin/perl
# MotoCache1 - take 480 x 182, 24 bit BMP file and make it into a CG42 code group
use strict;
my $file = $ARGV[0];
die("Syntax: MakeCG42FromBMP.pl filename.bmp") unless (-e $file);
open (IN,$file) or die ("No in $file. Error: $!");
binmode IN;
open (OUT,">$file.CG42.smg") or die ("No out $file.CG42.smg");
binmode OUT;
my $junkData;
my $junkBytes = read(IN,$junkData,54);
die ("Failed to read the 54 junk bytes at the beginning.") unless $junkBytes == 54;
my $imageData;
my $imageBytes = read(IN,$imageData,262080);
die ("Failed to read the 262080 image bytes.") unless $imageBytes == 262080;
close IN;
my $pad64 = "\xFF" x 64;
$imageBytes = reverse(split(//,$imageData)) . $pad64;
print OUT $imageBytes;
close OUT;
I could make it do the mirror for you too, but that's a little tougher than the reverse and presumably everyone that has been making these is used to doing the mirror (and it takes like half a second), so I doubt I'd bother making changes at this point.
P.S. The attachments are PNG's just to make them small -- the ones actually used in the files were of course BMPs. For anybody that has never understood what hacking is, that's hacking. Modify, observe, hypothesize, test, repeat until solved. The better (or luckier) you are, the fewer "repeat" cycles you hopefully need.