Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lisphacker committed Oct 25, 2023
1 parent f7aadbd commit 2bba0b1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

stack build --pedantic 2>&1 | tee build.log
stack build 2>&1 | tee build.log
13 changes: 8 additions & 5 deletions src/TIS100/Tiles/T21.hs
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,14 @@ instance IsConnectedTile T21 where

writeValueTo = setPortVal False -- External call

step t = case (runState . tileState) t of
Ready -> stepReady
WaitingOnRead _ Nothing -> t
WaitingOnRead _ (Just _) -> stepReady
WaitingOnWrite _ _ -> t
step t =
if null (tileProgram t)
then t
else case (runState . tileState) t of
Ready -> stepReady
WaitingOnRead _ Nothing -> t
WaitingOnRead _ (Just _) -> stepReady
WaitingOnWrite _ _ -> t
where
stepReady :: T21
stepReady = stepReady'
Expand Down
2 changes: 2 additions & 0 deletions tissim/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ main = do
print asm

let initialCPUState = CPU.createInitialCPUState cfg asm
print initialCPUState

finalSimState <- case initialCPUState of
Left err -> error $ show err
Right cpuState -> Run.run $ Run.SimState cpuState (ParserCfg.inputs cfg) (ParserCfg.outputs cfg)
Expand Down

0 comments on commit 2bba0b1

Please sign in to comment.