Fix invaders sound and fix bitrot in balloon-bomber and lunar-rescue
parent
1223b554ff
commit
41dd639427
|
|
@ -3,7 +3,7 @@
|
||||||
USING: help.syntax help.markup cpu.8080.emulator ;
|
USING: help.syntax help.markup cpu.8080.emulator ;
|
||||||
IN: balloon-bomber
|
IN: balloon-bomber
|
||||||
|
|
||||||
HELP: run
|
HELP: run-balloon
|
||||||
{ $description
|
{ $description
|
||||||
"Run the Balloon Bomber emulator in a new window." $nl
|
"Run the Balloon Bomber emulator in a new window." $nl
|
||||||
{ $link rom-root } " must be set to the directory containing the "
|
{ $link rom-root } " must be set to the directory containing the "
|
||||||
|
|
@ -25,7 +25,7 @@ ARTICLE: { "balloon-bomber" "balloon-bomber" } "Balloon Bomber Emulator"
|
||||||
"ballbomb/tn05-1"
|
"ballbomb/tn05-1"
|
||||||
}
|
}
|
||||||
"These are the same ROM files as used by MAME. To run the game use the "
|
"These are the same ROM files as used by MAME. To run the game use the "
|
||||||
{ $link run } " word." $nl
|
{ $link run-balloon } " word." $nl
|
||||||
"Keys:"
|
"Keys:"
|
||||||
{ $table
|
{ $table
|
||||||
{ "Backspace" "Insert Coin" }
|
{ "Backspace" "Insert Coin" }
|
||||||
|
|
@ -3,21 +3,28 @@
|
||||||
!
|
!
|
||||||
! Balloon Bomber: http://www.mameworld.net/maws/romset/ballbomb
|
! Balloon Bomber: http://www.mameworld.net/maws/romset/ballbomb
|
||||||
!
|
!
|
||||||
USING: kernel space-invaders cpu.8080 ui ;
|
USING:
|
||||||
|
cpu.8080
|
||||||
|
kernel
|
||||||
|
space-invaders
|
||||||
|
ui
|
||||||
|
;
|
||||||
IN: balloon-bomber
|
IN: balloon-bomber
|
||||||
|
|
||||||
TUPLE: balloon-bomber ;
|
TUPLE: balloon-bomber < space-invaders ;
|
||||||
|
|
||||||
: <balloon-bomber> ( -- cpu )
|
: <balloon-bomber> ( -- cpu )
|
||||||
<space-invaders> balloon-bomber construct-delegate ;
|
balloon-bomber new cpu-init ;
|
||||||
|
|
||||||
: run ( -- )
|
CONSTANT: rom-info {
|
||||||
"Balloon Bomber" <balloon-bomber> {
|
|
||||||
{ HEX: 0000 "ballbomb/tn01" }
|
{ HEX: 0000 "ballbomb/tn01" }
|
||||||
{ HEX: 0800 "ballbomb/tn02" }
|
{ HEX: 0800 "ballbomb/tn02" }
|
||||||
{ HEX: 1000 "ballbomb/tn03" }
|
{ HEX: 1000 "ballbomb/tn03" }
|
||||||
{ HEX: 1800 "ballbomb/tn04" }
|
{ HEX: 1800 "ballbomb/tn04" }
|
||||||
{ HEX: 4000 "ballbomb/tn05-1" }
|
{ HEX: 4000 "ballbomb/tn05-1" }
|
||||||
} [ (run) ] with-ui ;
|
}
|
||||||
|
|
||||||
MAIN: run
|
: run-balloon ( -- )
|
||||||
|
[ "Balloon Bomber" <balloon-bomber> rom-info (run) ] with-ui ;
|
||||||
|
|
||||||
|
MAIN: run-balloon
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
USING: help.syntax help.markup cpu.8080.emulator ;
|
USING: help.syntax help.markup cpu.8080.emulator ;
|
||||||
IN: lunar-rescue
|
IN: lunar-rescue
|
||||||
|
|
||||||
HELP: run
|
HELP: run-lunar
|
||||||
{ $description
|
{ $description
|
||||||
"Run the Lunar Rescue emulator in a new window." $nl
|
"Run the Lunar Rescue emulator in a new window." $nl
|
||||||
{ $link rom-root } " must be set to the directory containing the "
|
{ $link rom-root } " must be set to the directory containing the "
|
||||||
|
|
@ -26,7 +26,7 @@ ARTICLE: { "lunar-rescue" "lunar-rescue" } "Lunar Rescue Emulator"
|
||||||
"lrescue/lrescue.6"
|
"lrescue/lrescue.6"
|
||||||
}
|
}
|
||||||
"These are the same ROM files as used by MAME. To run the game use the "
|
"These are the same ROM files as used by MAME. To run the game use the "
|
||||||
{ $link run } " word." $nl
|
{ $link run-lunar } " word." $nl
|
||||||
"Keys:"
|
"Keys:"
|
||||||
{ $table
|
{ $table
|
||||||
{ "Backspace" "Insert Coin" }
|
{ "Backspace" "Insert Coin" }
|
||||||
|
|
@ -3,22 +3,29 @@
|
||||||
!
|
!
|
||||||
! Lunar Rescue: http://www.mameworld.net/maws/romset/lrescue
|
! Lunar Rescue: http://www.mameworld.net/maws/romset/lrescue
|
||||||
!
|
!
|
||||||
USING: kernel space-invaders cpu.8080 ui ;
|
USING:
|
||||||
|
cpu.8080
|
||||||
|
kernel
|
||||||
|
space-invaders
|
||||||
|
ui
|
||||||
|
;
|
||||||
IN: lunar-rescue
|
IN: lunar-rescue
|
||||||
|
|
||||||
TUPLE: lunar-rescue ;
|
TUPLE: lunar-rescue < space-invaders ;
|
||||||
|
|
||||||
: <lunar-rescue> ( -- cpu )
|
: <lunar-rescue> ( -- cpu )
|
||||||
<space-invaders> lunar-rescue construct-delegate ;
|
lunar-rescue new cpu-init ;
|
||||||
|
|
||||||
: run ( -- )
|
CONSTANT: rom-info {
|
||||||
"Lunar Rescue" <lunar-rescue> {
|
|
||||||
{ HEX: 0000 "lrescue/lrescue.1" }
|
{ HEX: 0000 "lrescue/lrescue.1" }
|
||||||
{ HEX: 0800 "lrescue/lrescue.2" }
|
{ HEX: 0800 "lrescue/lrescue.2" }
|
||||||
{ HEX: 1000 "lrescue/lrescue.3" }
|
{ HEX: 1000 "lrescue/lrescue.3" }
|
||||||
{ HEX: 1800 "lrescue/lrescue.4" }
|
{ HEX: 1800 "lrescue/lrescue.4" }
|
||||||
{ HEX: 4000 "lrescue/lrescue.5" }
|
{ HEX: 4000 "lrescue/lrescue.5" }
|
||||||
{ HEX: 4800 "lrescue/lrescue.6" }
|
{ HEX: 4800 "lrescue/lrescue.6" }
|
||||||
} [ (run) ] with-ui ;
|
}
|
||||||
|
|
||||||
MAIN: run
|
: run-lunar ( -- )
|
||||||
|
[ "Lunar Rescue" <lunar-rescue> rom-info (run) ] with-ui ;
|
||||||
|
|
||||||
|
MAIN: run-lunar
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
USING: help.syntax help.markup cpu.8080.emulator ;
|
USING: help.syntax help.markup cpu.8080.emulator ;
|
||||||
IN: space-invaders
|
IN: space-invaders
|
||||||
|
|
||||||
HELP: run
|
HELP: run-invaders
|
||||||
{ $description
|
{ $description
|
||||||
"Run the Space Invaders emulator in a new window." $nl
|
"Run the Space Invaders emulator in a new window." $nl
|
||||||
{ $link rom-root } " must be set to the directory containing the "
|
{ $link rom-root } " must be set to the directory containing the "
|
||||||
|
|
@ -24,7 +24,7 @@ ARTICLE: { "space-invaders" "space-invaders" } "Space Invaders Emulator"
|
||||||
"invaders/invaders.h"
|
"invaders/invaders.h"
|
||||||
}
|
}
|
||||||
"These are the same ROM files as used by MAME. To run the game use the "
|
"These are the same ROM files as used by MAME. To run the game use the "
|
||||||
{ $link run } " word." $nl
|
{ $link run-invaders } " word." $nl
|
||||||
"Keys:"
|
"Keys:"
|
||||||
{ $table
|
{ $table
|
||||||
{ "Backspace" "Insert Coin" }
|
{ "Backspace" "Insert Coin" }
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ USING:
|
||||||
cpu.8080
|
cpu.8080
|
||||||
cpu.8080.emulator
|
cpu.8080.emulator
|
||||||
io.files
|
io.files
|
||||||
|
io.pathnames
|
||||||
kernel
|
kernel
|
||||||
math
|
math
|
||||||
openal
|
openal
|
||||||
|
|
@ -66,7 +67,7 @@ CONSTANT: SOUND-WALK4 7
|
||||||
CONSTANT: SOUND-UFO-HIT 8
|
CONSTANT: SOUND-UFO-HIT 8
|
||||||
|
|
||||||
: init-sound ( index cpu filename -- )
|
: init-sound ( index cpu filename -- )
|
||||||
swapd [ sounds>> nth AL_BUFFER ] dip
|
canonicalize-path swapd [ sounds>> nth AL_BUFFER ] dip
|
||||||
create-buffer-from-wav set-source-param ;
|
create-buffer-from-wav set-source-param ;
|
||||||
|
|
||||||
: init-sounds ( cpu -- )
|
: init-sounds ( cpu -- )
|
||||||
|
|
@ -76,7 +77,7 @@ CONSTANT: SOUND-UFO-HIT 8
|
||||||
[ SOUND-UFO "resource:extra/space-invaders/resources/Ufo.wav" init-sound ] keep
|
[ SOUND-UFO "resource:extra/space-invaders/resources/Ufo.wav" init-sound ] keep
|
||||||
[ sounds>> SOUND-UFO swap nth AL_LOOPING AL_TRUE set-source-param ] keep
|
[ sounds>> SOUND-UFO swap nth AL_LOOPING AL_TRUE set-source-param ] keep
|
||||||
[ SOUND-BASE-HIT "resource:extra/space-invaders/resources/BaseHit.wav" init-sound ] keep
|
[ SOUND-BASE-HIT "resource:extra/space-invaders/resources/BaseHit.wav" init-sound ] keep
|
||||||
[ SOUND-INVADER-HIT "resource:extra/space-invaders/resources/InvHit.wav" init-sound ] keep
|
[ SOUND-INVADER-HIT "resource:extra/space-invaders/resources/InvHit.Wav" init-sound ] keep
|
||||||
[ SOUND-WALK1 "resource:extra/space-invaders/resources/Walk1.wav" init-sound ] keep
|
[ SOUND-WALK1 "resource:extra/space-invaders/resources/Walk1.wav" init-sound ] keep
|
||||||
[ SOUND-WALK2 "resource:extra/space-invaders/resources/Walk2.wav" init-sound ] keep
|
[ SOUND-WALK2 "resource:extra/space-invaders/resources/Walk2.wav" init-sound ] keep
|
||||||
[ SOUND-WALK3 "resource:extra/space-invaders/resources/Walk3.wav" init-sound ] keep
|
[ SOUND-WALK3 "resource:extra/space-invaders/resources/Walk3.wav" init-sound ] keep
|
||||||
|
|
@ -84,12 +85,14 @@ CONSTANT: SOUND-UFO-HIT 8
|
||||||
[ SOUND-UFO-HIT "resource:extra/space-invaders/resources/UfoHit.wav" init-sound ] keep
|
[ SOUND-UFO-HIT "resource:extra/space-invaders/resources/UfoHit.wav" init-sound ] keep
|
||||||
f swap (>>looping?) ;
|
f swap (>>looping?) ;
|
||||||
|
|
||||||
: <space-invaders> ( -- cpu )
|
: cpu-init ( cpu -- cpu )
|
||||||
space-invaders new
|
|
||||||
make-opengl-bitmap over (>>bitmap)
|
make-opengl-bitmap over (>>bitmap)
|
||||||
[ init-sounds ] keep
|
[ init-sounds ] keep
|
||||||
[ reset ] keep ;
|
[ reset ] keep ;
|
||||||
|
|
||||||
|
: <space-invaders> ( -- cpu )
|
||||||
|
space-invaders new cpu-init ;
|
||||||
|
|
||||||
: play-invaders-sound ( cpu sound -- )
|
: play-invaders-sound ( cpu sound -- )
|
||||||
swap sounds>> nth source-play ;
|
swap sounds>> nth source-play ;
|
||||||
|
|
||||||
|
|
@ -395,9 +398,9 @@ CONSTANT: rom-info {
|
||||||
{ HEX: 1800 "invaders/invaders.e" }
|
{ HEX: 1800 "invaders/invaders.e" }
|
||||||
}
|
}
|
||||||
|
|
||||||
: run ( -- )
|
: run-invaders ( -- )
|
||||||
[
|
[
|
||||||
"Space Invaders" <space-invaders> rom-info (run)
|
"Space Invaders" <space-invaders> rom-info (run)
|
||||||
] with-ui ;
|
] with-ui ;
|
||||||
|
|
||||||
MAIN: run
|
MAIN: run-invaders
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue