Handbook
Glossary
write-port3 ( value cpu -- )
Vocabulary
roms
.
space-invaders
Inputs
value
an
object
cpu
an
object
Outputs
None
Definition
USING:
accessors
kernel
math
;
IN:
roms.space-invaders
:
write-port3
( value cpu -- )
over
0
bit?
[
dup
looping?>>
[
dup
SOUND-UFO
play-invaders-sound
t
>>looping?
]
unless
]
[
dup
looping?>>
[
dup
SOUND-UFO
stop-invaders-sound
f
>>looping?
]
when
]
if
2dup
0
port3-newly-set?
[
dup
SOUND-UFO
play-invaders-sound
]
when
2dup
1
port3-newly-set?
[
dup
SOUND-SHOT
play-invaders-sound
]
when
2dup
2
port3-newly-set?
[
dup
SOUND-BASE-HIT
play-invaders-sound
]
when
2dup
3
port3-newly-set?
[
dup
SOUND-INVADER-HIT
play-invaders-sound
]
when
port3o<<
;