diff --git a/contrib/space-invaders/cpu.factor b/contrib/space-invaders/cpu.factor index 0d9accf1db..3c3da2cd9f 100644 --- a/contrib/space-invaders/cpu.factor +++ b/contrib/space-invaders/cpu.factor @@ -219,6 +219,18 @@ TUPLE: cpu b c d e f h l a pc sp halted? last-interrupt cycles port1 port2i port #! F |= quot call [ cpu-f swap call bitxor ] keep set-cpu-f ; inline +: cpu-f-bitor= ( value cpu -- ) + #! cpu-f |= value + [ cpu-f bitor ] keep set-cpu-f ; + +: cpu-f-bitand= ( value cpu -- ) + #! cpu-f &= value + [ cpu-f bitand ] keep set-cpu-f ; + +: cpu-f-bitxor= ( value cpu -- ) + #! cpu-f ^= value + [ cpu-f bitxor ] keep set-cpu-f ; + : set-flag ( cpu flag -- ) swap cpu-f-bitor= ; @@ -290,17 +302,6 @@ TUPLE: cpu b c d e f h l a pc sp halted? last-interrupt cycles port1 port2i port bitand HEX: 80 bitand ( cpu v ) 0 = not [ [ overflow-flag ] swap cpu-f-bitor ] [ drop ] ifte ; -: cpu-f-bitor= ( value cpu -- ) - #! cpu-f |= value - [ cpu-f bitor ] keep set-cpu-f ; - -: cpu-f-bitand= ( value cpu -- ) - #! cpu-f &= value - [ cpu-f bitand ] keep set-cpu-f ; - -: cpu-f-bitxor= ( value cpu -- ) - #! cpu-f ^= value - [ cpu-f bitxor ] keep set-cpu-f ; : add-byte ( lhs rhs cpu -- result ) #! Add rhs to lhs diff --git a/contrib/space-invaders/load.factor b/contrib/space-invaders/load.factor index 058e325543..bc33408e8a 100644 --- a/contrib/space-invaders/load.factor +++ b/contrib/space-invaders/load.factor @@ -4,4 +4,4 @@ USE: parser "../parser-combinators/lazy.factor" run-file "../parser-combinators/parser-combinators.factor" run-file "cpu.factor" run-file -"tests.factor" run-file +! "tests.factor" run-file