| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Nes.CPU.Monad
Synopsis
- newtype CPU r a = MkCPU {}
- reset :: CPU r ()
- incrementPC :: CPU r ()
- readAtPC :: CPU r Byte
- tick :: Int -> CPU r ()
- tickOnce :: CPU r ()
- popStackAddr :: CPU r Addr
- popStackByte :: CPU r Byte
- pushAddrStack :: Addr -> CPU r ()
- pushByteStack :: Byte -> CPU r ()
- popStatusRegister :: CPU r ()
- pushStatusRegister :: Bool -> CPU r ()
- liftBus :: Bus (a, BusState) a -> CPU r a
- unsafeLiftBus :: Bus (a, BusState) a -> CPU r a
Monad
Note: we use IO because it is likely to readwrite fromto memory, which is not pure
Constructors
| MkCPU | |
Instances
| MonadState BusState (CPU r) Source # | |
| MonadState CPUState (CPU r) Source # | |
| MonadState InterruptStatus (CPU r) Source # | |
Defined in Nes.CPU.Monad | |
| MemoryInterface () (CPU r) Source # | |
| MonadFail (CPU r) Source # | |
Defined in Nes.CPU.Monad | |
| MonadIO (CPU r) Source # | |
Defined in Nes.CPU.Monad | |
| Applicative (CPU r) Source # | |
| Functor (CPU r) Source # | |
| Monad (CPU r) Source # | |
State
Program counter
incrementPC :: CPU r () Source #
Stack
popStackAddr :: CPU r Addr Source #
popStackByte :: CPU r Byte Source #
pushAddrStack :: Addr -> CPU r () Source #
pushByteStack :: Byte -> CPU r () Source #
Status register
popStatusRegister :: CPU r () Source #
Pops value on the stack, clear BFlag and sets the results value as status register
pushStatusRegister :: Bool -> CPU r () Source #
If the argument is True, the pushed value will have the B Flag set