From e0bc6e8166be9bce8c27d7f51565b79e4d9ac8b5 Mon Sep 17 00:00:00 2001 From: Chris Double Date: Mon, 12 Sep 2005 23:22:02 +0000 Subject: [PATCH] space invaders: fix things so 'step' compiles --- contrib/space-invaders/cpu-8080.factor | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/contrib/space-invaders/cpu-8080.factor b/contrib/space-invaders/cpu-8080.factor index bc4395148f..cf2514d24e 100644 --- a/contrib/space-invaders/cpu-8080.factor +++ b/contrib/space-invaders/cpu-8080.factor @@ -414,6 +414,17 @@ M: cpu write-port ( value port cpu -- ) f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f }@ ; inline +: not-implemented ( -- ) + drop ; + +instructions length [ + dup instructions nth [ + drop + ] [ + [ not-implemented ] swap instructions set-nth + ] ifte +] each + M: cpu reset ( cpu -- ) #! Reset the CPU to its poweron state [ 0 swap set-cpu-b ] keep @@ -732,7 +743,7 @@ SYMBOL: $4 [[ "SCF" [ carry-flag swap cpu-f-bitor= ] ]] [[ "RLCA" [ (emulate-RLCA) ] ]] [[ "RRCA" [ (emulate-RRCA) ] ]] - [[ "HALT" [ drop "HALT not implemented" throw ] ]] + [[ "HALT" [ drop ] ]] [[ "DI" [ [ 255 interrupt-flag - ] swap cpu-f-bitand ] ]] [[ "EI" [ [ interrupt-flag ] swap cpu-f-bitor ] ]] [[ "POP-RR" [ [ pop-sp ] keep $2 ] ]]