Chip8.Interpreter.Display (chip8 v0.1.0)
A monochrome display device.
The monochrome display has a resolution of 64x32
pixels (64 pixels wide and
32 pixels high), programs can render graphics on it through the use of
sprites (see Chip8.Interpreter.Display.Sprite
) and coordinates. The
origin point of the display is at the top-left corner, with the coordinates
(0, 0)
.
pixelmap
Pixelmap
In most cases, pixelmaps contain the color information of each pixel in the screen but, since the COSMAC VIP wasn't able to produce colors and there is no way to specify one with the DRW instruction, the only information returned is the pixel "state", which can be, 1 when the pixel is "on" and 0 when is "off".
Link to this section Summary
Link to this section Types
Link to this type
coordinates()
@type coordinates() :: {x :: non_neg_integer(), y :: non_neg_integer()}
Link to this type
dimension()
@type dimension() :: non_neg_integer()
Link to this type
pixel()
@type pixel() :: 0 | 1
Link to this type
pixelmap()
@type pixelmap() :: [[pixel()]]
Link to this section Functions
Link to this function
clear(display)
Link to this function
create_sprite(data)
@spec create_sprite([byte()]) :: Chip8.Interpreter.Display.Sprite.t()
Link to this function
draw(display, arg, sprite)
@spec draw(t(), coordinates(), Chip8.Interpreter.Display.Sprite.t()) :: t()
Link to this function
get_coordinates(display, x, y)
@spec get_coordinates(t(), non_neg_integer(), non_neg_integer()) :: coordinates()
Link to this function
has_collision?(display1, display2)
Link to this function
new(height, width)
Link to this function