Package screens

Class Screen0

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class Screen0 extends Screen
The emulated machine's screen - a QL mode 4 or 8 screen. In ql screen mode 4/0, colours for 8 pixels are in 1 word - 4 pixels per byte. The lower (even) address = green bits, the higer (odd) byte of the word = red bits

"Drawing" on the screen is done by copying the image back to the screen. The "video ram" data structure is an array of short : in QL modes 4 and 8, pixels are addressed as words (8 or 4 pixels per word)

See Also:
  • Constructor Details

    • Screen0

      public Screen0(int xsize, int ysize, int vrambase, Monitor monitor, boolean isMac, boolean ddouble, int windowMode, boolean pctype)
      Creates the object.
      Parameters:
      xsize - the xsize of the screen in pixels
      ysize - the ysize of the screen in pixels. If they are both - 1, then use a QL screen.
      vrambase - the start of the "videoram" as far as the CPU is concerned.
      monitor - the monitor running the cpu.
      isMac - true if we're running on a mac.
      ddouble - true if double sized pixels
      windowMode - mode of window 0 = window , 1 = full size, 2 = special fullsize
      pctype - true if standard home etc keys
  • Method Details

    • writeByteToScreen

      public void writeByteToScreen(int address, int value, int wordValue)
      Writes a byte to the screen, painting the corresponding pixel(s).
      Specified by:
      writeByteToScreen in class Screen
      Parameters:
      address - where to write to. This is the SMSQE address, where it thinks video memory lies. It has already been checked that the address is in my memory space.
      value - the value to write.
      wordValue - the value to write into the word this byte is part of
    • writeWordToScreen

      public void writeWordToScreen(int addr, int value)
      Writes a word to the screen, painting the corresponding pixel(s).
      Specified by:
      writeWordToScreen in class Screen
      Parameters:
      addr - the address where to write to. It is presumed that it has been checked that this is in screen mem.
      value - the value to write to screen mem.
    • writeLongToScreen

      public void writeLongToScreen(int addr, int value)
      Writes a long word to the java screen.
      Specified by:
      writeLongToScreen in class Screen
      Parameters:
      addr - where to write to
      value - the value to write
    • setColourMode

      public void setColourMode(int mode)
      Sets the screen mode when in QL compatible mode. Only modes 4 and 8 are supported.
      Overrides:
      setColourMode in class Screen
      Parameters:
      mode - 0 for mode 4 ,8 for mode 8
    • fillBlock

      public void fillBlock(MC68000Cpu cpu, boolean resolveStipple)
      Fills a block with colour - not implemented here.
      Specified by:
      fillBlock in class Screen
      Parameters:
      cpu - the Cpu used.
      resolveStipple - ignored.
    • xorBlock

      public void xorBlock(MC68000Cpu cpu, boolean resolveStrip)
      XORS a block with colour - not implemented here.
      Specified by:
      xorBlock in class Screen
      Parameters:
      cpu - the CPu used.
      resolveStrip - ignored
    • combineBlocks

      public void combineBlocks(MC68000Cpu cpu)
      This combines two blocks with alpha blending - not implemented here. Not used here.
      Specified by:
      combineBlocks in class Screen
      Parameters:
      cpu - the CPU used
    • moveBlock

      public void moveBlock(MC68000Cpu cpu, boolean copyFromScreen)
      This is called when a block of memory was copied to the vram - not implemented here. It must copy the data from the vram into the image.
      Specified by:
      moveBlock in class Screen
      Parameters:
      cpu - the CPU used.
      copyFromScreen - = true if the source is also the screen.
    • displayRegion

      public void displayRegion(MC68000Cpu cpu, int start, int nbrOfBytes)
      Displays a region if bytes were loaded directly to the screen memory. Used from CPU.
      Specified by:
      displayRegion in class Screen
      Parameters:
      cpu - the cpu used.
      start - where the bytes were loaded to.
      nbrOfBytes - how many bytes were loaded.
    • setVramBase

      public void setVramBase(int vrambase)
      Sets the new Vrambase for the screen buffer if we are in QL compatible mode (this implies that the CPU or its memory changed). Adjust vramtop accordingly.
      Specified by:
      setVramBase in class Screen
      Parameters:
      vrambase - the new video ram base.
    • setVibrantColours

      public void setVibrantColours(boolean b, char[] s)
      Sets whether brighter colours should be used - ignored. This does nothing here.
      Specified by:
      setVibrantColours in class Screen
      Parameters:
      b - true if brighter colours should be used.
      s - ignored
    • getScreenSizeInBytes

      public final int getScreenSizeInBytes()
      Gets size, in bytes, of the vram.
      Specified by:
      getScreenSizeInBytes in class Screen
      Returns:
      screen size, in number of bytes.
    • isQLScreen

      public boolean isQLScreen()
      Checks whether this is a QL type screen
      Specified by:
      isQLScreen in class Screen
      Returns:
      true if this is a QL screen (512*256 i mode 4, 256*256 in mode 8), else false