--- Screen.pm 2007/08/05 19:44:20 161 +++ Screen.pm 2007/08/06 07:04:40 165 @@ -14,7 +14,7 @@ use Data::Dump qw/dump/; use Exporter 'import'; -our @EXPORT = qw'$white $black'; +our @EXPORT = qw'$white $black @flip'; use base qw(Class::Accessor Prefs); __PACKAGE__->mk_accessors(qw(app event)); @@ -326,6 +326,23 @@ } } +# helper array to flip bytes for display +our @flip; + +foreach my $i ( 0 .. 255 ) { + my $t = 0; + $i & 0b00000001 and $t = $t | 0b10000000; + $i & 0b00000010 and $t = $t | 0b01000000; + $i & 0b00000100 and $t = $t | 0b00100000; + $i & 0b00001000 and $t = $t | 0b00010000; + $i & 0b00010000 and $t = $t | 0b00001000; + $i & 0b00100000 and $t = $t | 0b00000100; + $i & 0b01000000 and $t = $t | 0b00000010; + $i & 0b10000000 and $t = $t | 0b00000001; + #warn "$i = $t\n"; + $flip[$i] = $t; +} + =head1 SEE ALSO L is sample implementation using this module