lazyboy-0.2.1.1: An EDSL for programming the Game Boy.

Copyright(c) Rose 2019
LicenseBSD3
Maintainerrose@lain.org.uk
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Lazyboy.IO

Description

This module defines IO and primitive graphics operations for Lazyboy.

Synopsis

Documentation

class Bitfield a where Source #

A typeclass for packing types into Word8.

Methods

pack :: a -> Word8 Source #

Instances
Bitfield BackgroundPalette Source # 
Instance details

Defined in Lazyboy.IO

Bitfield LCDControl Source # 
Instance details

Defined in Lazyboy.IO

Bitfield Color Source # 
Instance details

Defined in Lazyboy.IO

Methods

pack :: Color -> Word8 Source #

data Color Source #

A type representing the monochrome shades available on the hardware.

Constructors

White 
Light 
Dark 
Black 
Instances
Eq Color Source # 
Instance details

Defined in Lazyboy.IO

Methods

(==) :: Color -> Color -> Bool #

(/=) :: Color -> Color -> Bool #

Ord Color Source # 
Instance details

Defined in Lazyboy.IO

Methods

compare :: Color -> Color -> Ordering #

(<) :: Color -> Color -> Bool #

(<=) :: Color -> Color -> Bool #

(>) :: Color -> Color -> Bool #

(>=) :: Color -> Color -> Bool #

max :: Color -> Color -> Color #

min :: Color -> Color -> Color #

Bitfield Color Source # 
Instance details

Defined in Lazyboy.IO

Methods

pack :: Color -> Word8 Source #

data LCDControl Source #

A type representing the LCD screen control state.

Instances
Bitfield LCDControl Source # 
Instance details

Defined in Lazyboy.IO

defaultLCDControl :: LCDControl Source #

The default LCDControl state - all flags set to False (0). In effect, this turns the screen off.

disableLCD :: Lazyboy () Source #

A convenience function which executes setLCDControl with the defaultLCDControl state. This turns the screen off.

setLCDControl :: LCDControl -> Lazyboy () Source #

Sets the LCD control state to a given value.

data BackgroundPalette Source #

A type representing the background palette.

Instances
Bitfield BackgroundPalette Source # 
Instance details

Defined in Lazyboy.IO

defaultPalette :: BackgroundPalette Source #

The default monochrome background palette.

setBackgroundPalette :: BackgroundPalette -> Lazyboy () Source #

Sets the background palette to a given palette.

byte :: Register8 -> Word8 -> Lazyboy () Source #

Writes a Word8 to a Register8.

write :: Location -> Word8 -> Lazyboy () Source #

Loads a Word8 into a Location.

memcpy :: Location -> Location -> Word8 -> Lazyboy () Source #

Copy a region of memory (limit 255 bytes) to a destination.

memset :: Location -> Word8 -> Word8 -> Lazyboy () Source #

Sets a region of memory to a Word8 value (limit 255 bytes).

onVblank :: Lazyboy () -> Lazyboy () Source #

Executes an action when vertical blank occurs.