Print memory dump again

This commit is contained in:
Joscha 2019-11-07 16:46:21 +00:00
parent ef06f7b309
commit af70c1a02c
3 changed files with 63 additions and 7 deletions

View file

@ -7,6 +7,9 @@ module Mima.State
MimaMemory
, readAt
, writeAt
-- ** Querying
, addressRange
, sparseAddressRange
-- ** Converting
, wordsToMemory
, memoryToWords
@ -36,6 +39,9 @@ addressRange (MimaMemory m) =
Nothing -> []
Just maxAddr -> [minBound..maxAddr]
sparseAddressRange :: MimaMemory -> [MimaAddress]
sparseAddressRange (MimaMemory m) = Map.keys m
wordsToMemory :: [MimaWord] -> MimaMemory
wordsToMemory = MimaMemory
. Map.filter (/= zeroBits)