From 64624b52279bd76d473aa92b072a0e5ebd516530 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 23 Apr 2024 21:50:15 -0400 Subject: Automated instruction testing using linked repo https://github.com/adtennant/GameboyCPUTests --- fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fig-emulator-gb/src/Fig/Emulator/GB/Component/RAM.hs') 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)) -- cgit v1.2.3