Klasse SidTune

java.lang.Object
libsidplay.sidtune.SidTune
Bekannte direkte Unterklassen:
MP3Tune, Prg

public abstract class SidTune extends Object
Autor:
Ken Händel
  • Felddetails

    • RESET

      public static final SidTune RESET
      Do not load a tune, just reset C64.
    • RESET_INIT_DELAY

      public static final int RESET_INIT_DELAY
      Delay in cycles to wait for completion of a normal RESET.
      Siehe auch:
    • USE_KICKASSEMBLER

      public static boolean USE_KICKASSEMBLER
    • MAX_MEM_64K

      private static final int MAX_MEM_64K
      Maximum possible file size of C64 programs to load.
      Siehe auch:
    • info

      protected SidTuneInfo info
  • Konstruktordetails

    • SidTune

      public SidTune()
  • Methodendetails

    • load

      public static SidTune load(File file) throws IOException, SidTuneError
      Loads a file as a SidTune (PSID, PRG, P00, T64, MUS, MP3).
      Parameter:
      file - The file to load.
      Gibt zurück:
      A SidTune instance of the specified file to load.
      Löst aus:
      IOException
      SidTuneError
    • load

      public static SidTune load(String url, InputStream stream) throws IOException, SidTuneError
      Loads an InputStream as a SidTune (PSID, PRG, P00, T64).
      Parameter:
      url - URL of the given stream
      stream - The InputStream to load.
      Gibt zurück:
      A SidTune of the specified InputStream.
      Löst aus:
      IOException - If the stream cannot be read.
      SidTuneError
    • load

      protected static SidTune load(String name, byte[] fileContents) throws SidTuneError
      Load tune (PSID, PRG, P00, T64).
      Parameter:
      name - name of the file (for file extension check)
      fileContents - The tune data to load.
      Gibt zurück:
      A SidTune of the specified contents.
      Löst aus:
      IOException - If the stream cannot be read.
      SidTuneError
    • getPSidHeader

      public byte[] getPSidHeader()
    • getContents

      protected static final byte[] getContents(File file) throws IOException
      Does not affect status of object, and therefore can be used to load files.
      Parameter:
      file - The file to load.
      Gibt zurück:
      The data of the loaded file.
      Löst aus:
      IOException - if the file could not be found.
    • getContents

      private static byte[] getContents(InputStream stream) throws IOException
      Löst aus:
      IOException
    • getInfo

      public final SidTuneInfo getInfo()
      Retrieve sub-song specific information.
      Gibt zurück:
      Sub-song specific information about the currently loaded tune.
    • getSongSpeed

      public SidTune.Speed getSongSpeed(int selected)
      Gets the speed of the selected song.
      Parameter:
      selected - The song to get the speed of.
      Gibt zurück:
      The speed of the selected song.
    • getSongSpeedWord

      public int getSongSpeedWord()
      Create 32-bit PSID-style speed word. Each bit in 'speed' specifies the speed for the corresponding song number, i.e. bit 0 specifies the speed for song 1. If there are more than 32 song, the speed specified for song 32 is also used for all higher numbered songs. A 0 bit specifies vertical blank interrupt (50Hz PAL, 60Hz NTSC), and a 1 bit specifies CIA 1 timer interrupt (default 60Hz).
      Gibt zurück:
      32-bit PSID-style speed word (defaults to CIA 1 timer interrupt)
    • isFakeStereoSid

      public static boolean isFakeStereoSid(IEmulationSection emulation, SidTune tune, int sidNum)
      Detect fake-stereo SID (second SID at the same address).
      Parameter:
      tune - current tune
      sidNum - current SID number
      Gibt zurück:
      fake-stereo SID has been detected
    • isSIDUsed

      public static boolean isSIDUsed(IEmulationSection emulation, SidTune tune, int sidNum)
      Is specified SID number in use?
      1. 0 - first SID is always used
      2. 1 - second SID is only used for stereo tunes
      3. 2 - third SID is used for 3-SID tunes
    • getSIDAddress

      public static int getSIDAddress(IEmulationSection emulation, SidTune tune, int sidNum)
      Get SID address of specified SID number
      1. 0xd400 - always used for first SID
      2. fake stereo - a second SID at the same address (0xd400)
      3. forced SID base - configured value for forced stereo or 3-SID output
      4. tune SID base - SID base detected by tune information
      5. 0 - SID is not used
      Note: this function is static, even if no tune is loaded stereo mode can be configured! Note: tune SID base can be overridden by tune recognition WhatsSID
    • placeProgramInMemory

      public abstract Integer placeProgramInMemory(byte[] c64buf)
      Copy program into C64 memory.
      Parameter:
      c64buf -
      Gibt zurück:
      play driver address
      Löst aus:
      SidTuneError
    • placeProgramInMemory

      public abstract Integer placeProgramInMemory(byte[] mem, byte[] PSID)
    • save

      public abstract void save(String destFileName) throws IOException
      Parameter:
      destFileName - Destination for the file.
      Löst aus:
      IOException
    • identify

      public abstract Collection<String> identify()
      Identify the player ID of a tune
      Gibt zurück:
      the player IDs as a list
    • identify

      public abstract Collection<String> identify(byte[] sidIdCfgBin)
      Identify the player ID of a tune
      Gibt zurück:
      the player IDs as a list
    • getPlayerInfo

      public abstract SidIdInfo.PlayerInfoSection getPlayerInfo(String playerName)
      Search player ID Info.
      Parameter:
      playerName - player to get infos for
      Gibt zurück:
      player infos (or null, if not found)
    • getMD5Digest

      public abstract String getMD5Digest(MD5Method md5Method)
      Calculate MD5 checksum.
    • getInitDelay

      protected abstract long getInitDelay()
      Return delay in C64 clocks before song init is done.
    • getInitDelay

      public static long getInitDelay(SidTune tune)
    • prepare

      public void prepare()