Package CPU

Class CPUforScreenEmulation

java.lang.Object
CPU.MC68000Cpu
CPU.CPUforScreenEmulation

public class CPUforScreenEmulation extends MC68000Cpu
Object derived from CPU, used only when emulating QL screen and copying from there to display.
  • Constructor Details

    • CPUforScreenEmulation

      public CPUforScreenEmulation(int size, Screen screen, inifile.IniFile iniFile, int romSize)
      Creates the object.
      Parameters:
      size - the size of ram in bytes.
      screen - the screen to use.
      iniFile - my .ini file with options to set.
      romSize - the size of the ROM image. Loaded after the RAM image.
    • CPUforScreenEmulation

      public CPUforScreenEmulation(int size, inifile.IniFile iniFile, int romSize, int videoRamSize)
      Creates the object.
      Parameters:
      size - the size of ram in bytes.
      iniFile - my .ini file with options to set.
      romSize - the size of the ROM image. Loaded after the RAM image.
      videoRamSize - size,in bytes, of screen memory to be allocated here.
  • Method Details

    • writeMemoryByte

      public final void writeMemoryByte(int address, int value)
      Writes a byte to memory.
      Overrides:
      writeMemoryByte in class MC68000Cpu
      Parameters:
      address - where to write to.
      value - the byte to write (in the LSB of the int).
    • writeMemoryWord

      public final void writeMemoryWord(int address, int value)
      Writes a word to memory.
      Overrides:
      writeMemoryWord in class MC68000Cpu
      Parameters:
      address - where to write to.
      value - the word to write (in the LSW of the int).
    • writeMemoryShort

      public final void writeMemoryShort(int address, short value)
      Writes a short to memory.
      Overrides:
      writeMemoryShort in class MC68000Cpu
      Parameters:
      address - where to write to.
      value - the short to write.
    • writeMemoryLong

      public final void writeMemoryLong(int address, int value)
      Writes a long to the memory.
      Overrides:
      writeMemoryLong in class MC68000Cpu
      Parameters:
      address - the address where to write to.
      value - the value to write.
    • setCopyScreen

      public void setCopyScreen(int QLScreenMode, int origins)
      This switches QL screen emulation on or off. If on, any writes to the QL screen area are copied to the true display.
      Overrides:
      setCopyScreen in class MC68000Cpu
      Parameters:
      QLScreenMode - the screen mode the QL screen is supposed to be in.
      origins - origins in y screen which should correspond to (0,0) in QL screen.
    • readFromBuffer

      protected int readFromBuffer(int address, int nbrOfBytes, ByteBuffer buffer, int startInBuffer, boolean specialRead)
      Reads bytes from a ByteBuffer and writes them into memory. Possibly copies QL screen memory to display.
      Overrides:
      readFromBuffer in class MC68000Cpu
      Parameters:
      address - where to read to.
      nbrOfBytes - how many bytes are to be read.
      buffer - the buffer to read from.
      startInBuffer - where in the buffer to start reading from.
      specialRead - =true ONLY when loading the OS, must be false at all other times!
      Returns:
      nbr of bytes read.