Created
February 12, 2010 22:09
-
-
Save BlockoS/303035 to your computer and use it in GitHub Desktop.
Create a crappy html showing zero page occupancy from pceas sym file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use Data::Dumper; | |
my $zp = {}; | |
foreach my $line (`head -n -2 $ARGV[0]`) | |
{ | |
my ($label, $addr, $bank) = $line =~ /^\s*([\w.]+)\s*([0-9A-Fa-f]{4})\s*([0-9A-Fa-f]{2})$/; | |
if( ( ( $bank eq "f8" ) || | |
( $bank eq "f0" ) ) && | |
( $addr =~ m/20[0-9A-Fa-f]{2}/ ) ) | |
{ | |
if( exists( $zp->{ $addr } ) ) | |
{ | |
push @{$zp->{ $addr }}, $label; | |
} | |
else | |
{ | |
$zp->{ $addr } = [ $label ]; | |
} | |
} | |
} | |
print <<EOT; | |
<html> | |
<head> | |
<title>!</title> | |
</head> | |
<style type="text/css"> | |
div.map { | |
display: table; | |
} | |
div.row { | |
display: table-row; | |
} | |
div.element { | |
display: table-cell; | |
background-color: red; | |
width: 16px; | |
} | |
div.empty { | |
display: table-cell; | |
background-color: green; | |
width: 16px; | |
} | |
</style> | |
<body> | |
<div class="map"> | |
EOT | |
for(my $j=0; $j<16; $j++) | |
{ | |
print '<div class="row">';; | |
for(my $i=0; $i<16; $i++) | |
{ | |
print '<div class="'; | |
my $addr = sprintf("20%02x", $i+($j*16)); | |
if( exists( $zp->{ $addr }) ) | |
{ | |
print 'element'; | |
} | |
else | |
{ | |
print 'empty'; | |
} | |
print '"> </div>'; | |
} | |
print "</div>\n"; | |
} | |
print <<EOT; | |
</div> | |
</html> | |
</body> | |
EOT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment