fix bug in cpu-8080 emulation

chris.double 2006-08-02 09:14:51 +00:00
parent 21563691ba
commit ad1f62fb54
2 changed files with 19 additions and 13 deletions

View File

@ -1077,14 +1077,14 @@ SYMBOL: $4
8-bit-registers sp <&> 8-bit-registers sp <&>
"," token <& "," token <&
8-bit-registers <&> 8-bit-registers <&>
just [ >2array< swap >2array< swap >r append r> curry ] <@ ; just [ >2array< swap >2array< swap >r swap append r> curry ] <@ ;
: ADC-R,(RR)-instruction ( -- parser ) : ADC-R,(RR)-instruction ( -- parser )
"ADC-R,(RR)" "ADC" complex-instruction "ADC-R,(RR)" "ADC" complex-instruction
8-bit-registers sp <&> 8-bit-registers sp <&>
"," token <& "," token <&
16-bit-registers indirect <&> 16-bit-registers indirect <&>
just [ >2array< swap >2array< swap >r append r> curry ] <@ ; just [ >2array< swap >2array< swap >r swap append r> curry ] <@ ;
: SBC-R,N-instruction ( -- parser ) : SBC-R,N-instruction ( -- parser )
"SBC-R,N" "SBC" complex-instruction "SBC-R,N" "SBC" complex-instruction
@ -1097,14 +1097,14 @@ SYMBOL: $4
8-bit-registers sp <&> 8-bit-registers sp <&>
"," token <& "," token <&
8-bit-registers <&> 8-bit-registers <&>
just [ >2array< swap >2array< swap >r append r> curry ] <@ ; just [ >2array< swap >2array< swap >r swap append r> curry ] <@ ;
: SBC-R,(RR)-instruction ( -- parser ) : SBC-R,(RR)-instruction ( -- parser )
"SBC-R,(RR)" "SBC" complex-instruction "SBC-R,(RR)" "SBC" complex-instruction
8-bit-registers sp <&> 8-bit-registers sp <&>
"," token <& "," token <&
16-bit-registers indirect <&> 16-bit-registers indirect <&>
just [ >2array< swap >2array< swap >r append r> curry ] <@ ; just [ >2array< swap >2array< swap >r swap append r> curry ] <@ ;
: SUB-R-instruction ( -- parser ) : SUB-R-instruction ( -- parser )
"SUB-R" "SUB" complex-instruction "SUB-R" "SUB" complex-instruction
@ -1132,21 +1132,21 @@ SYMBOL: $4
8-bit-registers sp <&> 8-bit-registers sp <&>
"," token <& "," token <&
8-bit-registers <&> 8-bit-registers <&>
just [ >2array< swap >2array< swap >r append r> curry ] <@ ; just [ >2array< swap >2array< swap >r swap append r> curry ] <@ ;
: ADD-RR,RR-instruction ( -- parser ) : ADD-RR,RR-instruction ( -- parser )
"ADD-RR,RR" "ADD" complex-instruction "ADD-RR,RR" "ADD" complex-instruction
16-bit-registers sp <&> 16-bit-registers sp <&>
"," token <& "," token <&
16-bit-registers <&> 16-bit-registers <&>
just [ >2array< swap >2array< swap >r append r> curry ] <@ ; just [ >2array< swap >2array< swap >r swap append r> curry ] <@ ;
: ADD-R,(RR)-instruction ( -- parser ) : ADD-R,(RR)-instruction ( -- parser )
"ADD-R,(RR)" "ADD" complex-instruction "ADD-R,(RR)" "ADD" complex-instruction
8-bit-registers sp <&> 8-bit-registers sp <&>
"," token <& "," token <&
16-bit-registers indirect <&> 16-bit-registers indirect <&>
just [ >2array< swap >2array< swap >r append r> curry ] <@ ; just [ >2array< swap >2array< swap >r swap append r> curry ] <@ ;
: LD-RR,NN-instruction : LD-RR,NN-instruction
#! LD BC,nn #! LD BC,nn
@ -1174,28 +1174,28 @@ SYMBOL: $4
16-bit-registers indirect sp <&> 16-bit-registers indirect sp <&>
"," token <& "," token <&
8-bit-registers <&> 8-bit-registers <&>
just [ >2array< swap >2array< swap >r append r> curry ] <@ ; just [ >2array< swap >2array< swap >r swap append r> curry ] <@ ;
: LD-R,R-instruction : LD-R,R-instruction
"LD-R,R" "LD" complex-instruction "LD-R,R" "LD" complex-instruction
8-bit-registers sp <&> 8-bit-registers sp <&>
"," token <& "," token <&
8-bit-registers <&> 8-bit-registers <&>
just [ >2array< swap >2array< swap >r append r> curry ] <@ ; just [ >2array< swap >2array< swap >r swap append r> curry ] <@ ;
: LD-RR,RR-instruction : LD-RR,RR-instruction
"LD-RR,RR" "LD" complex-instruction "LD-RR,RR" "LD" complex-instruction
16-bit-registers sp <&> 16-bit-registers sp <&>
"," token <& "," token <&
16-bit-registers <&> 16-bit-registers <&>
just [ >2array< swap >2array< swap >r append r> curry ] <@ ; just [ >2array< swap >2array< swap >r swap append r> curry ] <@ ;
: LD-R,(RR)-instruction : LD-R,(RR)-instruction
"LD-R,(RR)" "LD" complex-instruction "LD-R,(RR)" "LD" complex-instruction
8-bit-registers sp <&> 8-bit-registers sp <&>
"," token <& "," token <&
16-bit-registers indirect <&> 16-bit-registers indirect <&>
just [ >2array< swap >2array< swap >r append r> curry ] <@ ; just [ >2array< swap >2array< swap >r swap append r> curry ] <@ ;
: LD-(NN),RR-instruction : LD-(NN),RR-instruction
"LD-(NN),RR" "LD" complex-instruction "LD-(NN),RR" "LD" complex-instruction
@ -1244,14 +1244,14 @@ SYMBOL: $4
16-bit-registers indirect sp <&> 16-bit-registers indirect sp <&>
"," token <& "," token <&
16-bit-registers <&> 16-bit-registers <&>
just [ >2array< swap >2array< swap >r append r> curry ] <@ ; just [ >2array< swap >2array< swap >r swap append r> curry ] <@ ;
: EX-RR,RR-instruction : EX-RR,RR-instruction
"EX-RR,RR" "EX" complex-instruction "EX-RR,RR" "EX" complex-instruction
16-bit-registers sp <&> 16-bit-registers sp <&>
"," token <& "," token <&
16-bit-registers <&> 16-bit-registers <&>
just [ >2array< swap >2array< swap >r append r> curry ] <@ ; just [ >2array< swap >2array< swap >r swap append r> curry ] <@ ;
: 8080-generator-parser : 8080-generator-parser
NOP-instruction NOP-instruction

View File

@ -326,3 +326,9 @@ M: right-up-msg handle-invaders-message ( gadget message -- quit? )
dup "Space Invaders" open-titled-window dup "Space Invaders" open-titled-window
dup [ millis swap invaders-process ] curry spawn dup [ millis swap invaders-process ] curry spawn
swap dupd set-invaders-gadget-process ; swap dupd set-invaders-gadget-process ;
: runx ( -- process )
<space-invaders> "invaders.rom" over load-rom
<invaders-gadget> [ set-invaders-gadget-cpu ] keep
dup "Space Invaders" open-titled-window
dup "a" set invaders-gadget-cpu 1000 [ dup gui-frame "a" get relayout-1 ] times drop ;