loadMapper :: ROM -> ST s (Mapper s)
loadMapper catridge =
    case mapnum of
      0 -> do
        ntMap <- newSTRef defaultNameTableMap
        return $ Mapper0 ntMap
      x -> error $ "Mapper " ++ show x ++ " not implemented"
    where
      mapnum = (flags6 (header catridge) `shiftR` 4) + ((flags7 (header catridge) `shiftR` 4) `shiftL` 4)
      defaultNameTableMap
        | testBit (flags6 $ header catridge) 3 = setMirroring FourScreenMirror
        | testBit (flags6 $ header catridge) 0 = setMirroring VerticalMirror
        | otherwise = setMirroring HorizontalMirror
loadMapper :: ROM -> ST s (Mapper s)
loadMapper catridge =
    case mapnum of
      0 -> do
        ntMap <- newSTRef defaultNameTableMap
        return $ Mapper0 ntMap
      x -> error $ "Mapper " ++ show x ++ " not implemented"
    where
      mapnum = (flags6 (header catridge) `shiftR` 4) + ((flags7 (header catridge) `shiftR` 4) `shiftL` 4)
      defaultNameTableMap
        | testBit (flags6 $ header catridge) 3 = setMirroring FourScreenMirror
        | testBit (flags6 $ header catridge) 0 = setMirroring VerticalMirror
        | otherwise = setMirroring HorizontalMirror
loadMapper catridge =
    case mapnum of
      0 -> do
        ntMap <- newSTRef defaultNameTableMap
        return $ Mapper0 ntMap
      x -> error $ "Mapper " ++ show x ++ " not implemented"
    where
      mapnum = (flags6 (header catridge) `shiftR` 4) + ((flags7 (header catridge) `shiftR` 4) `shiftL` 4)
      defaultNameTableMap
        | testBit (flags6 $ header catridge) 3 = setMirroring FourScreenMirror
        | testBit (flags6 $ header catridge) 0 = setMirroring VerticalMirror
        | otherwise = setMirroring HorizontalMirror