diff options
| author | LLLL Colonq <llll@colonq> | 2024-04-23 21:50:15 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2024-04-23 21:50:15 -0400 |
| commit | 64624b52279bd76d473aa92b072a0e5ebd516530 (patch) | |
| tree | 80e6c1a1586a42a138eb5440419a08c03797325e /fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs | |
| parent | 828b424422d8ba17322eb08a22ca4f3815cf0ed3 (diff) | |
Automated instruction testing using linked repo
https://github.com/adtennant/GameboyCPUTests
Diffstat (limited to 'fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs')
| -rw-r--r-- | fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs b/fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs index f5c08b4..e20dd8d 100644 --- a/fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs +++ b/fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs @@ -24,7 +24,7 @@ compWRAM :: (MonadIO m, MonadThrow m) => Addr -> Int -> Component m compWRAM start size = Component { compState = V.replicate size 0 :: V.Vector Word8 , compMatches = \a -> - a >= start && a < end + a >= start && a <= end , compUpdate = \s _ -> pure s , compWrite = \s ad v -> do let offset = fromIntegral . unAddr $ ad - start @@ -38,4 +38,4 @@ compWRAM start size = Component Just v -> pure v } where - end = start + Addr (fromIntegral size) + end = start + Addr (fromIntegral (size - 1)) |
