View Source Chip8.Interpreter.Display (chip8 v1.0.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
@type coordinates() :: {x :: non_neg_integer(), y :: non_neg_integer()}
@type dimension() :: non_neg_integer()
@type pixel() :: 0 | 1
@type pixelmap() :: [[pixel()]]
Link to this section Functions
@spec create_sprite([byte()]) :: Chip8.Interpreter.Display.Sprite.t()
@spec draw(t(), coordinates(), Chip8.Interpreter.Display.Sprite.t()) :: t()
@spec get_coordinates(t(), non_neg_integer(), non_neg_integer()) :: coordinates()