my ($len, $class, $name, $title) = @{$def};
my $attr = '';
+ $len /= $nibsize;
$name //= $len <= 2 ? 'res' : 'reserved';
- if (my $part = $offset % 16) {
+ if (my $part = $offset/$nibsize % 16) {
# continued row
my $cols = 16 - $part; # remaining
$cols = $len if $len < $cols; #TODO: optimise
if ($len -= $cols) {
# continued on new row
- $table->{$offset + $cols} = [$len, "$class joinu", $name, $title];
+ $table->{$offset + $nibsize*$cols} = [$len*$nibsize, "$class joinu", $name, $title];
$name = '';
$class .= ' joind';
}
# multiple full rows
if ($len -= $rows << 4) {
# partial row remains
- $table->{$offset + $rows * 16} = [$len, "$class joinu", '', $title];
+ $table->{$offset + $nibsize*$rows * 16} = [$len*$nibsize, "$class joinu", '', $title];
$class .= ' joind';
}
$attr .= sprintf ' rowspan=%d', $rows;
}
print '<tbody>';
for my $msb (0 .. (length($row->{table}) || 256) - 1 >> 4) {
- printf '<tr><th>%X', $msb + ($row->{offset} >> 4);
+ printf '<tr><th>%X', ($msb + ($row->{offset} >> 4)) * $nibsize;
for my $lsb (0 .. $#nibble) {
my $val = ( ($msb<<4) + $lsb ) * $nibsize;
if ($row->{cell}) {