X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/d4ead771b48095b3889d0c5694dc6152e6d58359..cc3aea5b110f944ce10a22cdea96a0b3f6da15c9:/charset.plp diff --git a/charset.plp b/charset.plp index e55e771..15183cf 100644 --- a/charset.plp +++ b/charset.plp @@ -107,15 +107,16 @@ sub range_cell { 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'; } @@ -125,7 +126,7 @@ sub range_cell { # 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; @@ -149,7 +150,7 @@ for my $row (@request) { } print ''; for my $msb (0 .. (length($row->{table}) || 256) - 1 >> 4) { - printf '%X', $msb + ($row->{offset} >> 4); + printf '%X', ($msb + ($row->{offset} >> 4)) * $nibsize; for my $lsb (0 .. $#nibble) { my $val = ( ($msb<<4) + $lsb ) * $nibsize; if ($row->{cell}) {