Fix invaders sound and fix bitrot in balloon-bomber and lunar-rescue

db4
Chris Double 2009-10-16 12:15:10 +13:00
parent 1223b554ff
commit 41dd639427
12 changed files with 43 additions and 26 deletions

View File

@ -3,7 +3,7 @@
USING: help.syntax help.markup cpu.8080.emulator ;
IN: balloon-bomber
HELP: run
HELP: run-balloon
{ $description
"Run the Balloon Bomber emulator in a new window." $nl
{ $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"
}
"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:"
{ $table
{ "Backspace" "Insert Coin" }

View File

@ -3,21 +3,28 @@
!
! 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
TUPLE: balloon-bomber ;
TUPLE: balloon-bomber < space-invaders ;
: <balloon-bomber> ( -- cpu )
<space-invaders> balloon-bomber construct-delegate ;
balloon-bomber new cpu-init ;
: run ( -- )
"Balloon Bomber" <balloon-bomber> {
CONSTANT: rom-info {
{ HEX: 0000 "ballbomb/tn01" }
{ HEX: 0800 "ballbomb/tn02" }
{ HEX: 1000 "ballbomb/tn03" }
{ HEX: 1800 "ballbomb/tn04" }
{ HEX: 4000 "ballbomb/tn05-1" }
} [ (run) ] with-ui ;
}
MAIN: run
: run-balloon ( -- )
[ "Balloon Bomber" <balloon-bomber> rom-info (run) ] with-ui ;
MAIN: run-balloon

View File

@ -3,7 +3,7 @@
USING: help.syntax help.markup cpu.8080.emulator ;
IN: lunar-rescue
HELP: run
HELP: run-lunar
{ $description
"Run the Lunar Rescue emulator in a new window." $nl
{ $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"
}
"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:"
{ $table
{ "Backspace" "Insert Coin" }

View File

@ -3,22 +3,29 @@
!
! 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
TUPLE: lunar-rescue ;
TUPLE: lunar-rescue < space-invaders ;
: <lunar-rescue> ( -- cpu )
<space-invaders> lunar-rescue construct-delegate ;
lunar-rescue new cpu-init ;
: run ( -- )
"Lunar Rescue" <lunar-rescue> {
CONSTANT: rom-info {
{ HEX: 0000 "lrescue/lrescue.1" }
{ HEX: 0800 "lrescue/lrescue.2" }
{ HEX: 1000 "lrescue/lrescue.3" }
{ HEX: 1800 "lrescue/lrescue.4" }
{ HEX: 4000 "lrescue/lrescue.5" }
{ HEX: 4800 "lrescue/lrescue.6" }
} [ (run) ] with-ui ;
}
MAIN: run
: run-lunar ( -- )
[ "Lunar Rescue" <lunar-rescue> rom-info (run) ] with-ui ;
MAIN: run-lunar

View File

@ -3,7 +3,7 @@
USING: help.syntax help.markup cpu.8080.emulator ;
IN: space-invaders
HELP: run
HELP: run-invaders
{ $description
"Run the Space Invaders emulator in a new window." $nl
{ $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"
}
"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:"
{ $table
{ "Backspace" "Insert Coin" }

View File

@ -12,6 +12,7 @@ USING:
cpu.8080
cpu.8080.emulator
io.files
io.pathnames
kernel
math
openal
@ -66,7 +67,7 @@ CONSTANT: SOUND-WALK4 7
CONSTANT: SOUND-UFO-HIT 8
: 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 ;
: init-sounds ( cpu -- )
@ -76,7 +77,7 @@ CONSTANT: SOUND-UFO-HIT 8
[ 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
[ 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-WALK2 "resource:extra/space-invaders/resources/Walk2.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
f swap (>>looping?) ;
: <space-invaders> ( -- cpu )
space-invaders new
: cpu-init ( cpu -- cpu )
make-opengl-bitmap over (>>bitmap)
[ init-sounds ] keep
[ reset ] keep ;
: <space-invaders> ( -- cpu )
space-invaders new cpu-init ;
: play-invaders-sound ( cpu sound -- )
swap sounds>> nth source-play ;
@ -395,9 +398,9 @@ CONSTANT: rom-info {
{ HEX: 1800 "invaders/invaders.e" }
}
: run ( -- )
: run-invaders ( -- )
[
"Space Invaders" <space-invaders> rom-info (run)
] with-ui ;
MAIN: run
MAIN: run-invaders