Audio-SID

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

          allowed to be exactly 32 chars in length as per the latest SID file
          format spec.
        - Added support for second and third SID model fields.
        - Added support for second and third SID address fields.
        - Fixed 'speed' field related algorithms for PSID v1 or PlaySID-
          specific files when the number of songs is more than 32 as per the
          latest SID file format spec.
        - Fixed MD5 calculation bug for files with more than 32 songs. (I'm
          hoping this will fix MD5 calculations once and for all. :-)
        - Fixed: v1 files are now always considered PlaySID specific.
        - Fixed: during validation, ROM area checks for the relocation range
          are now applied to RSID files only.

3.11 - Sun Aug 14 2005
        - The textual fields of "title", "author" and "released" were
          handled as Unicode. They were supposed to be ISO 8859-1 ASCII
          single-byte chars in SID files. This is now enforced when doing
          a set(), write() or validate().
        - getC64BASIC() returned undef for RSIDs, which was incorrect.

3.10 - Sun Jul 17 2005

Changes  view on Meta::CPAN


3.03 - Tue Jan 31 2004
        - Added check in validate() to make sure the initAddress is within
          the load range for PSIDs.
        - Added complete support for the 'C64 BASIC' RSID flag: added the new
          getC64BASIC(), isC64BASIC(), setC64BASIC() methods, changed the
          PlaySID flag related methods. See documentation for details.

3.02 - Fri Nov 22 2002
        - The load range wasn't calculated correctly when checking for the
          relocation range. Fixed it.
        - Changed the "copyright" field name to "released", but "copyright"
          remains an accepted alias for "released".

3.01 - Sat Nov 03 2002
        - There was a bug in the relocation page checking code. Fixed it.

3.00 - Tue Oct 29 2002
        Major changes:
        - First of all, the module name was changed from Audio::PSID to
          Audio::SID.
        - The module now also handles RSID (Real SID) files, which are
          basically PSID v2NG files with 'RSID' as their magic ID (instead
          of 'PSID'). These files strictly require a C64 environment in SID
          emulators to run properly, appropriate PSID v2NG restrictions are
          enforced for it.

SID.pm  view on Meta::CPAN


        # Is startPage within the ROM or reserved memory areas?
        if ( (($self->{SIDdata}{startPage} >= 0xA0) and ($self->{SIDdata}{startPage} < 0xC0)) or
             (($self->{SIDdata}{startPage} >= 0xD0) and ($self->{SIDdata}{startPage} < 0xFF)) or
             (($self->{SIDdata}{startPage} > 0x00) and ($self->{SIDdata}{startPage} < 0x04)) ) {

             $self->{SIDdata}{startPage} = 0xFF;
             $self->{SIDdata}{pageLength} = 0x00;
        }

        # Is the end of the relocation range within the ROM or reserved memory areas?
        if ( (( ($self->{SIDdata}{startPage} << 8) + ($self->{SIDdata}{pageLength} << 8) - 1 >= 0xA000) and ( ($self->{SIDdata}{startPage} << 8) + ($self->{SIDdata}{pageLength} << 8) - 1 < 0xC000)) or
             (( ($self->{SIDdata}{startPage} << 8) + ($self->{SIDdata}{pageLength} << 8) - 1 >= 0xD000) and ( ($self->{SIDdata}{startPage} << 8) + ($self->{SIDdata}{pageLength} << 8) - 1 <= 0xFFFF)) or
             (( ($self->{SIDdata}{startPage} << 8) + ($self->{SIDdata}{pageLength} << 8) - 1 > 0x0000) and  ( ($self->{SIDdata}{startPage} << 8) + ($self->{SIDdata}{pageLength} << 8) - 1 < 0x0400)) ) {

             $self->{SIDdata}{startPage} = 0xFF;
             $self->{SIDdata}{pageLength} = 0x00;
        }

        # Does the relocation range encompass a ROM area?
        if ( ($self->{SIDdata}{startPage} < 0xA0) and (($self->{SIDdata}{startPage} << 8) + ($self->{SIDdata}{pageLength} << 8) - 1 >= 0xC000) ) {

             $self->{SIDdata}{startPage} = 0xFF;
             $self->{SIDdata}{pageLength} = 0x00;
        }
    }
    
    # Relocation range must not overlap or encompass the load range.

    if ( (($self->{SIDdata}{startPage} << 8) >= $self->getRealLoadAddress()) and

SID.pm  view on Meta::CPAN

setting only the recognized bits in I<flags>, namely 'MUSPlayer',
'psidSpecific', 'clock', 'sidModel', 'second sidModel' (version 3+ only), and
'third sidModel' (bits 0-9) (version 4+ only), and setting the rest to 0,

=item *

setting the I<pageLength> to 0 if I<startPage> is 0 or 0xFF,

=item *

setting the I<startPage> to 0xFF and the I<pageLength> to 0 if the relocation
range indicated by these two fields overlaps or encompasses the load range of
the C64 data,

=item *

setting the I<startPage> to 0xFF and the I<pageLength> to 0 if the I<magicID>
is 'RSID' and the relocation range indicated by these two fields overlaps or
encompasses the ROMs ($A000-$BFFF and $D000-$FFFF) or reserved memory
($0000-$03FF) areas,

=item *

setting the I<secondSIDAddress> and I<thirdSIDAddress> fields according to the
rules described for the I<setSIDAddress> function,

=item *

SID_file_format.txt  view on Meta::CPAN

- Bits 10-15 are reserved and should be set to 0.

+78    BYTE startPage (relocStartPage)

This is a v2NG specific field.

This is an 8 bit number. If 'startPage' is 0, the SID file is clean, i.e. it
does not write outside its data range within the driver ranges. In this case
the largest free memory range can be determined from the start address and the
data length of the SID binary data. If 'startPage' is 0xFF, there is not even
a single free page, and driver relocation is impossible. Otherwise,
'startPage' specifies the start page of the single largest free memory range
within the driver ranges. For example, if 'startPage' is 0x1E, this free
memory range starts at $1E00.

+79    BYTE pageLength (relocPages)

This is a v2NG specific field.

This is an 8 bit number indicating the number of free pages after 'startPage'.
If 'startPage' is not 0 or 0xFF, 'pageLength' is set to the number of free
pages starting at 'startPage'. If 'startPage' is 0 or 0xFF, 'pageLength' must
be set to 0.

The relocation range indicated by 'startPage' and 'pageLength' should never
overlap or encompass the load range of the C64 data. For RSID files, the
relocation range should also not overlap or encompass any of the ROM areas
($A000-$BFFF and $D000-$FFFF) or the reserved memory area ($0000-$03FF).

+7A    BYTE secondSIDAddress

This is a v3 specific field. For v2NG, it should be set to 0.

This is an 8 bit number indicating the address of the second SID. It specifies
the middle part of the address, $Dxx0, starting from value 0x42 for $D420 to
0xFE for $DFE0). Only even values are valid. Ranges 0x00-0x41 ($D000-$D410) and
0x80-0xDF ($D800-$DDF0) are invalid. Any invalid value means that no second SID



( run in 0.526 second using v1.01-cache-2.11-cpan-71847e10f99 )