diff --git a/unmaintained/balloon-bomber/authors.txt b/extra/balloon-bomber/authors.txt similarity index 100% rename from unmaintained/balloon-bomber/authors.txt rename to extra/balloon-bomber/authors.txt diff --git a/unmaintained/balloon-bomber/balloon-bomber-docs.factor b/extra/balloon-bomber/balloon-bomber-docs.factor similarity index 93% rename from unmaintained/balloon-bomber/balloon-bomber-docs.factor rename to extra/balloon-bomber/balloon-bomber-docs.factor index 694ac1882a..e80ccb9b2f 100644 --- a/unmaintained/balloon-bomber/balloon-bomber-docs.factor +++ b/extra/balloon-bomber/balloon-bomber-docs.factor @@ -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" } diff --git a/unmaintained/balloon-bomber/balloon-bomber.factor b/extra/balloon-bomber/balloon-bomber.factor similarity index 56% rename from unmaintained/balloon-bomber/balloon-bomber.factor rename to extra/balloon-bomber/balloon-bomber.factor index 160447dc79..c52c029c7c 100644 --- a/unmaintained/balloon-bomber/balloon-bomber.factor +++ b/extra/balloon-bomber/balloon-bomber.factor @@ -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 ; : ( -- cpu ) - balloon-bomber construct-delegate ; + balloon-bomber new cpu-init ; -: run ( -- ) - "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" rom-info (run) ] with-ui ; + +MAIN: run-balloon diff --git a/unmaintained/balloon-bomber/summary.txt b/extra/balloon-bomber/summary.txt similarity index 100% rename from unmaintained/balloon-bomber/summary.txt rename to extra/balloon-bomber/summary.txt diff --git a/unmaintained/balloon-bomber/tags.txt b/extra/balloon-bomber/tags.txt similarity index 100% rename from unmaintained/balloon-bomber/tags.txt rename to extra/balloon-bomber/tags.txt diff --git a/unmaintained/lunar-rescue/authors.txt b/extra/lunar-rescue/authors.txt similarity index 100% rename from unmaintained/lunar-rescue/authors.txt rename to extra/lunar-rescue/authors.txt diff --git a/unmaintained/lunar-rescue/lunar-rescue-docs.factor b/extra/lunar-rescue/lunar-rescue-docs.factor similarity index 94% rename from unmaintained/lunar-rescue/lunar-rescue-docs.factor rename to extra/lunar-rescue/lunar-rescue-docs.factor index d54fe7d485..c8cdb3b6ee 100644 --- a/unmaintained/lunar-rescue/lunar-rescue-docs.factor +++ b/extra/lunar-rescue/lunar-rescue-docs.factor @@ -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" } diff --git a/unmaintained/lunar-rescue/lunar-rescue.factor b/extra/lunar-rescue/lunar-rescue.factor similarity index 60% rename from unmaintained/lunar-rescue/lunar-rescue.factor rename to extra/lunar-rescue/lunar-rescue.factor index 558b7154d0..1b7ef6bb69 100644 --- a/unmaintained/lunar-rescue/lunar-rescue.factor +++ b/extra/lunar-rescue/lunar-rescue.factor @@ -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 ; : ( -- cpu ) - lunar-rescue construct-delegate ; + lunar-rescue new cpu-init ; -: run ( -- ) - "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" rom-info (run) ] with-ui ; + +MAIN: run-lunar diff --git a/unmaintained/lunar-rescue/summary.txt b/extra/lunar-rescue/summary.txt similarity index 100% rename from unmaintained/lunar-rescue/summary.txt rename to extra/lunar-rescue/summary.txt diff --git a/unmaintained/lunar-rescue/tags.txt b/extra/lunar-rescue/tags.txt similarity index 100% rename from unmaintained/lunar-rescue/tags.txt rename to extra/lunar-rescue/tags.txt diff --git a/extra/space-invaders/space-invaders-docs.factor b/extra/space-invaders/space-invaders-docs.factor index c4e3a35668..0c02f8fd4c 100644 --- a/extra/space-invaders/space-invaders-docs.factor +++ b/extra/space-invaders/space-invaders-docs.factor @@ -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" } diff --git a/extra/space-invaders/space-invaders.factor b/extra/space-invaders/space-invaders.factor index 0508f9a31c..cb0f4319d6 100755 --- a/extra/space-invaders/space-invaders.factor +++ b/extra/space-invaders/space-invaders.factor @@ -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?) ; -: ( -- cpu ) - space-invaders new +: cpu-init ( cpu -- cpu ) make-opengl-bitmap over (>>bitmap) [ init-sounds ] keep [ reset ] keep ; +: ( -- 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" rom-info (run) ] with-ui ; -MAIN: run +MAIN: run-invaders