| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Nes.APU.State.DMC
Synopsis
- data DMC = MkDMC {
- interruptFlag :: !Bool
- loopFlag :: !Bool
- period :: !Int
- timer :: !Int
- sampleOgAddr :: !Addr
- sampleOgLength :: !Int
- sampleBufferAddr :: !Addr
- sampleBytesRemaining :: !Int
- sampleBuffer :: !(Maybe Byte)
- outputLevel :: !Int
- enableChannel :: !Bool
- shouldClock :: !Bool
- sleepingCycles :: !Int
- shiftRegister :: !Byte
- remainingBits :: !Byte
- silentFlag :: !Bool
- newDMC :: DMC
- tickDMC :: DMC -> InterruptStatus -> (DMC, InterruptStatus)
- getPeriodValue :: Int -> Int
- restartSample :: DMC -> DMC
- loadSampleBuffer :: Byte -> DMC -> InterruptStatus -> (DMC, InterruptStatus)
- getDMCOutput :: DMC -> Int
Documentation
Constructors
| MkDMC | |
Fields
| |
tickDMC :: DMC -> InterruptStatus -> (DMC, InterruptStatus) Source #
getPeriodValue :: Int -> Int Source #
Actions
restartSample :: DMC -> DMC Source #
When a sample is (re)started, the current address is set to the sample address, and bytes remaining is set to the sample length.
loadSampleBuffer :: Byte -> DMC -> InterruptStatus -> (DMC, InterruptStatus) Source #
Loads the byte into the sample buffer and shift the sample buffer-related values
Output
getDMCOutput :: DMC -> Int Source #