Package screens

Class Screen32

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class Screen32 extends Screen
This is the screen object for a "mode 32" screen, where each pixels is a word in GGGBBBBB RRRRRGGG format.
See Also:
  • Constructor Details

    • Screen32

      public Screen32(int xsize, int ysize, int vrambase, boolean vibrantColours, 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.
      vrambase - the start of the "videoram" as far as the CPU is concerned.
      vibrantColours - if true brighter colours are used (ie. the lover 3 bits of each R, G, B byte are set to 1).
      monitor - the monitor.
      isMac - true if screen is 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 val2)
      Writes a byte to the "screen memory" and paints the corresponding pixel on the screen. Not implemented for this type of screen!
      Specified by:
      writeByteToScreen in class Screen
      Parameters:
      address - where to write to. This is the SMSQE address, where it thinks video memory lies.
      value - the value to write.
      val2 - ignored
    • writeWordToScreen

      public void writeWordToScreen(int addr, int value)
      Paints the pixel on the screen by setting the RGB value in the image dataBuffer. One word = 1 pixel.
      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, a word in GGGBBBBB RRRRRGGG format.
    • writeLongToScreen

      public void writeLongToScreen(int addr, int value)
      Paints two pixels on the screen by setting the RGB values in the image dataBuffer. One word = 1 pixel.
      Specified by:
      writeLongToScreen in class Screen
      Parameters:
      addr - where to write to.
      value - the value for 2 pixels (high word|low word, both in GGGBBBBB RRRRRGGG format).
    • fillBlock

      public void fillBlock(MC68000Cpu cpu, boolean resolveStipple)
      Fills a block with colour : this updates the memory AND the underlying image data (if block is actually within screen). Sometimes, the block is only within the main memory. The main memory is an array of shorts, the image databuffer is an array of ints (ARGB). Colours may be stipples, (=diffferent colours on odd and even lines).
      Specified by:
      fillBlock in class Screen
      Parameters:
      cpu - the CPU used.
      resolveStipple - true if we need to convert a stipple number in d6 into colours in d6/d7 The block size and origin are assumed to have been adjusted for correct position within the area to be set. Registers: Entry Exit D0 smashed D1 block size smashed D2 block origin smashed D3-D5 smashed D6 stipple Nbr (cn_block) OR long word colour for even row (bm_block) D7 colour mask in long word (cn_block) or long word colour for odd row (bm_block) smashed A1 area base address smashed A2 area row increment smashed stipples are such that they affect a block of 2*2 pixels even row : p1p2 odd row : p3p4 where each of the 4 pixels may be one of two colours. Hence the colours in D6 and D7 are the colours for two consecutive pixels :p1 and p2 in D6, p3 and p4 in D7. This is why there may be a leading and a trailing colour. And this is why there are two different colours for even and odd rows.
    • xorBlock

      public void xorBlock(MC68000Cpu cpu, boolean resolveStipple)
      XORs a block with colour : this updates the memory AND the underlying image data (if block is actually within screen). Sometimes, the block is only within the main memory. The main memory is an array of shorts, the image databuffer is an array of ints (ARGB). v. 1.15 : removed premature exit when not to screen.
      Specified by:
      xorBlock in class Screen
      Parameters:
      cpu - the CPU used.
      resolveStipple - true if we need to convert a stipple number in d6 into colours in d6/d7 The block size and origin are assumed to have been adjusted for correct position within the area to be set. Registers: Entry Exit D0 smashed D1 block size smashed D2 block origin smashed D3-D5 smashed D6 stipple Nbr (cn_block) OR long word colour for even row (bm_block) D7 colour mask in long word (cn_block) or long word colour for odd row (bm_block) smashed A1 area base address smashed A2 area row increment smashed stipples are such that they affect a block of 2*2 pixels even row : p1p2 odd row : p3p4 where each of the 4 pixels may be one of two colours. Hence the colours in D6 and D7 are the colours for two consecutive pixels :p1 and p2 in D6, p3 and p4 in D7. This is why there may be a leading and a trailing colour. And this is why there are two different colours for even and odd rows.
    • moveBlock

      public void moveBlock(MC68000Cpu cpu, boolean copyFromScreen)
      This is called when a block of memory was copied to the vram.. 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 - .
      start - where the bytes were loaded to.
      nbrOfBytes - how many bytes were loaded.
    • combineBlocks

      public void combineBlocks(MC68000Cpu cpu)
      This combines two blocks (source 1, source2) with alpha blending and puts the result into the destination array and the image buffer.
      Specified by:
      combineBlocks in class Screen
      Parameters:
      cpu - the CPU used.
    • setVramBase

      public void setVramBase(int vrambase)
      Sets the new Vrambase. Adjust vramtop accordingly.
      Specified by:
      setVramBase in class Screen
      Parameters:
      vrambase - the new vrambase, the start address of the vram.
    • setVibrantColours

      public void setVibrantColours(boolean b, char[] vramBuffer)
      Sets whether brighter colours should be used.
      Specified by:
      setVibrantColours in class Screen
      Parameters:
      b - true if brighter colours should be used.
      vramBuffer - where data is stored.
    • 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