funes-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Nes.Render.Frame

Synopsis

State

newFrameState :: IO FrameState Source #

Allocates the buffers and frame

Frame

frameWidth :: Int Source #

Width (in pixels of the frame)

frameHeight :: Int Source #

Height (in pixels of the frame)

frameLength :: Int Source #

Size, in bytes, of the frame

Buffer

newtype Buffer a Source #

Constructors

MkBuffer 

Fields

bufferWidth :: Int Source #

Width of the internal buffer

Equals frameWidth

bufferLength :: Int Source #

Number of elements in a buffer

bufferSet :: a -> Coord -> Buffer a -> IO () Source #

bufferSetOffset :: a -> Int -> Buffer a -> IO () Source #

Sprite Pixel

foreachSpritePixel :: Monad m => (Int -> SpritePixel -> m ()) -> FrameState -> m () Source #

Pixel

type Coord = (Int, Int) Source #

data PixelType Source #

Says _where_ the pixel comes from

Constructors

TransparentBG

An opaque background pixel (e.g. pipe in mario)

OpaqueBG

A transparent background pixel (e.g. sky in mario)

Sprite

Pixel from a sprite

Instances

Instances details
Show PixelType Source # 
Instance details

Defined in Nes.Render.Frame

Eq PixelType Source # 
Instance details

Defined in Nes.Render.Frame

Misc

data SpritePriority Source #

Priority of the sprite (from bit 5 of attribute table)

https://www.nesdev.org/wiki/PPU_sprite_priority

Constructors

Front 
Back 

Instances

Instances details
Show SpritePriority Source # 
Instance details

Defined in Nes.Render.Frame

Eq SpritePriority Source # 
Instance details

Defined in Nes.Render.Frame