com.monkeycoder.monkeynes.hardware
Class PatternTableTile

java.lang.Object
  |
  +--com.monkeycoder.monkeynes.hardware.PatternTableTile

public class PatternTableTile
extends Object

This represents a single graphics tile from the pattern tables.

Originally part of the MonkeyNES project.

Author:
David Stephens

Constructor Summary
PatternTableTile(int[] inTop, int[] inBottom)
          Creates a new PatternTableTile with the specified data.
 
Method Summary
 int getPixelValue(int x, int y)
          This gets the pixel value of of a requested pixel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternTableTile

public PatternTableTile(int[] inTop,
                        int[] inBottom)
Creates a new PatternTableTile with the specified data. Data for this object is in the form of 1-bit per pixel and is found as layers stacked up on top of one another. A pattern table tile has only 2 layers. Additional layers are from the name tables or other places.

Parameters:
inTop - An array of 8 bytes of data representing the top layer.
inBottom - An array of 8 bytes of data representing the bottom layer.
Method Detail

getPixelValue

public int getPixelValue(int x,
                         int y)
This gets the pixel value of of a requested pixel. This value is the value that results from combining the top and bottom layers. X and Y coordinates are in typical computer graphics orientation. +X to the right and +Y down.

Parameters:
x - The X coordinate of the requested pixel.
y - The Y coordinate of the requested pixel.