Changeset 242 in xtideuniversalbios for trunk/Tools/StringsCompress.pl


Ignore:
Timestamp:
Feb 10, 2012, 3:12:40 AM (12 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Optimizations (both for size and speed) in IdeTransfer.asm and MemIdeTransfer.asm
  • Fixed a bug where the SingleByteRead/Write functions in IdeTransfer.asm would fail on 128 sector transfers.
  • Fixed some typos and errors in general, comments etc.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/StringsCompress.pl

    r241 r242  
    66#                   gregli@hotmail.com
    77#
    8 # Description   :   Script for compiling and compressing strings for 
     8# Description   :   Script for compiling and compressing strings for
    99#                   use by DisplayFormatCompressed.asm.  See the header of that file
    1010#                   for a description of the compression scheme.
    1111#
    12 # Usage         :   stdin:  Listing of strings.asm, 
     12# Usage         :   stdin:  Listing of strings.asm,
    1313#                           assembled with MODULE_STRINGS_COMPRESSED_PRECOMPRESS.
    1414#                           We used the listing so that the assembler can take care of
     
    2828#  1. Those in the Translate associative array
    2929#  2. Those in the Format associative array
    30 #  3. Characters between $normal_base and $normal_base+0x40 
    31 #     (typically covers upper and lowe case alphabets)
     30#  3. Characters between $normal_base and $normal_base+0x40
     31#     (typically covers upper and lower case alphabets)
    3232#  4. Null characters (marking the end of strings)
    3333#  5. The special string LF,CR
    3434#
    35 # If a character or format read at the input cannot be found in one of the above categories, 
    36 # it must be added here before this script will accept it (and DisplayFormatCompressed can 
     35# If a character or format read at the input cannot be found in one of the above categories,
     36# it must be added here before this script will accept it (and DisplayFormatCompressed can
    3737# display it).
    3838#
    3939# Tables for the above categories are expected in the input stream, before string to be
    40 # compressed are provided.  Note that these tables are not present in DisplayFormatCompressed, 
    41 # and do not need to updated there.  Needed information is put in the compression output
     40# compressed are provided.  Note that these tables are not present in DisplayFormatCompressed,
     41# and do not need to be updated there.  Needed information is put in the compression output
    4242# that it reads.
    4343#
     
    6161print ";;;\n";
    6262print ";;; This file is generated by StringsCompress.pl from source in Strings.asm\n";
    63 print ";;; DO NOT EDIT DIRECTLY - See the maekfile for how to rebuild this file.\n";
     63print ";;; DO NOT EDIT DIRECTLY - See the makefile for how to rebuild this file.\n";
    6464print ";;; This file only needs to be rebuilt if Strings.asm is changed.\n";
    6565print ";;;\n";
     
    6868
    6969#
    70 # On a first pass, look for our table directives.  $translate{...}, $format{...}, etc. 
    71 # are expectd in the input stream.
     70# On a first pass, look for our table directives.  $translate{...}, $format{...}, etc.
     71# are expected in the input stream.
    7272#
    7373$processed = "    [StringsCompress Processed]";
     
    115115
    116116#
    117 # On the second pass, loop through lines of the listing, looking for 'db' lines 
     117# On the second pass, loop through lines of the listing, looking for 'db' lines
    118118# (and dealing with continuations) and compressing each line as it is encountered.
    119119#
     
    157157        &processString( $bytes, $label.$spacing, $db );
    158158    }
    159    
    160     # 
     159
     160    #
    161161    # everything else, copy to the output as is
    162162    #
     
    208208print "\n";
    209209
    210 # 
     210#
    211211# Ensure that branch targets are within reach
    212212#
     
    280280        $orig .= sprintf( ($v[$i] > 0x9f ? ", %03xh" : ",  %02xh"), $v[$i] );
    281281    }
    282     $v[length($chars)/2] = 0xff;      # guard byte to avoid thinking going past the end of 
     282    $v[length($chars)/2] = 0xff;      # guard byte to avoid thinking going past the end of
    283283                                      # the string is a null
    284284
     
    336336            $used{$v[$g]}++;
    337337        }
    338        
     338
    339339        #
    340340        # "normal" characters (alphabet, and ASCII characters around the alphabet)
     
    350350        #
    351351        # Not found
    352         # 
     352        #
    353353        else
    354354        {
     
    378378            if( $v[$g+1] == 0x20 && $v[$g+2] != 0 )
    379379            {
    380                 # can't take this optimization if the next byte is a null, 
     380                # can't take this optimization if the next byte is a null,
    381381                # since we can't have both a postfix space and null
    382382                $g++;
Note: See TracChangeset for help on using the changeset viewer.