--- /dev/null
+Chris Double
--- /dev/null
+! Copyright (C) 2007 Chris Double.\r
+! See http://factorcode.org/license.txt for BSD license.\r
+USING: help.syntax help.markup cpu.8080.emulator ;\r
+IN: balloon-bomber\r
+\r
+HELP: run-balloon\r
+{ $description \r
+"Run the Balloon Bomber emulator in a new window." $nl\r
+{ $link rom-root } " must be set to the directory containing the "\r
+"location of the Balloon Bomber ROM files. See " \r
+{ $link { "balloon-bomber" "balloon-bomber" } } " for details."\r
+} ;\r
+\r
+ARTICLE: { "balloon-bomber" "balloon-bomber" } "Balloon Bomber Emulator"\r
+"Provides an emulation of the original 8080 Arcade Game 'Balloon Bomber'." $nl\r
+"More information on the arcade game can be obtained from " { $url "http://www.mameworld.net/maws/romset/ballbomb" } "." $nl\r
+"To play the game you need the ROM files for the arcade game. They should "\r
+"be placed in a directory called 'ballbomb' in the location specified by "\r
+"the variable " { $link rom-root } ". The specific files needed are:"\r
+{ $list\r
+ "ballbomb/tn01"\r
+ "ballbomb/tn02"\r
+ "ballbomb/tn03"\r
+ "ballbomb/tn04"\r
+ "ballbomb/tn05-1"\r
+}\r
+"These are the same ROM files as used by MAME. To run the game use the " \r
+{ $link run-balloon } " word." $nl\r
+"Keys:" \r
+{ $table\r
+ { "Backspace" "Insert Coin" }\r
+ { "1" "1 Player" }\r
+ { "2" "2 Player" }\r
+ { "Left" "Move Left" }\r
+ { "Right" "Move Right" }\r
+ { "Up" "Fire" }\r
+}\r
+"If you save the Factor image while a game is running, when you restart "\r
+"the image the game continues where it left off." ;\r
--- /dev/null
+! Copyright (C) 2007 Chris Double.\r
+! See http://factorcode.org/license.txt for BSD license.\r
+!\r
+! Balloon Bomber: http://www.mameworld.net/maws/romset/ballbomb\r
+!\r
+USING: \r
+ cpu.8080\r
+ kernel \r
+ space-invaders\r
+ ui \r
+;\r
+IN: balloon-bomber\r
+\r
+TUPLE: balloon-bomber < space-invaders ; \r
+\r
+: <balloon-bomber> ( -- cpu )\r
+ balloon-bomber new cpu-init ;\r
+\r
+CONSTANT: rom-info {\r
+ { HEX: 0000 "ballbomb/tn01" }\r
+ { HEX: 0800 "ballbomb/tn02" }\r
+ { HEX: 1000 "ballbomb/tn03" }\r
+ { HEX: 1800 "ballbomb/tn04" }\r
+ { HEX: 4000 "ballbomb/tn05-1" }\r
+ }\r
+\r
+: run-balloon ( -- ) \r
+ [ "Balloon Bomber" <balloon-bomber> rom-info (run) ] with-ui ;\r
+\r
+MAIN: run-balloon\r
--- /dev/null
+Intel 8080-based Balloon Bomber arcade machine emulator
--- /dev/null
+demos
+games
+applications
--- /dev/null
+Chris Double
--- /dev/null
+! Copyright (C) 2007 Chris Double.\r
+! See http://factorcode.org/license.txt for BSD license.\r
+USING: help.syntax help.markup cpu.8080.emulator ;\r
+IN: lunar-rescue \r
+\r
+HELP: run-lunar \r
+{ $description \r
+"Run the Lunar Rescue emulator in a new window." $nl\r
+{ $link rom-root } " must be set to the directory containing the "\r
+"location of the Lunar Rescue ROM files. See " \r
+{ $link { "lunar-rescue" "lunar-rescue" } } " for details."\r
+} ;\r
+\r
+ARTICLE: { "lunar-rescue" "lunar-rescue" } "Lunar Rescue Emulator"\r
+"Provides an emulation of the original 8080 Arcade Game 'Lunar Rescue'." $nl\r
+"More information on the arcade game can be obtained from " { $url "http://www.mameworld.net/maws/romset/lrescue" } "." $nl\r
+"To play the game you need the ROM files for the arcade game. They should "\r
+"be placed in a directory called 'lrescue' in the location specified by "\r
+"the variable " { $link rom-root } ". The specific files needed are:"\r
+{ $list\r
+ "lrescue/lrescue.1"\r
+ "lrescue/lrescue.2"\r
+ "lrescue/lrescue.3"\r
+ "lrescue/lrescue.4"\r
+ "lrescue/lrescue.5"\r
+ "lrescue/lrescue.6"\r
+}\r
+"These are the same ROM files as used by MAME. To run the game use the " \r
+{ $link run-lunar } " word." $nl\r
+"Keys:" \r
+{ $table\r
+ { "Backspace" "Insert Coin" }\r
+ { "1" "1 Player" }\r
+ { "2" "2 Player" }\r
+ { "Left" "Move Left" }\r
+ { "Right" "Move Right" }\r
+ { "Up" "Fire or apply thrusters" }\r
+}\r
+"If you save the Factor image while a game is running, when you restart "\r
+"the image the game continues where it left off." ;\r
--- /dev/null
+! Copyright (C) 2007 Chris Double.\r
+! See http://factorcode.org/license.txt for BSD license.\r
+!\r
+! Lunar Rescue: http://www.mameworld.net/maws/romset/lrescue\r
+!\r
+USING: \r
+ cpu.8080\r
+ kernel \r
+ space-invaders\r
+ ui \r
+;\r
+IN: lunar-rescue\r
+\r
+TUPLE: lunar-rescue < space-invaders ; \r
+\r
+: <lunar-rescue> ( -- cpu )\r
+ lunar-rescue new cpu-init ;\r
+\r
+CONSTANT: rom-info {\r
+ { HEX: 0000 "lrescue/lrescue.1" }\r
+ { HEX: 0800 "lrescue/lrescue.2" }\r
+ { HEX: 1000 "lrescue/lrescue.3" }\r
+ { HEX: 1800 "lrescue/lrescue.4" }\r
+ { HEX: 4000 "lrescue/lrescue.5" }\r
+ { HEX: 4800 "lrescue/lrescue.6" }\r
+ }\r
+\r
+: run-lunar ( -- ) \r
+ [ "Lunar Rescue" <lunar-rescue> rom-info (run) ] with-ui ;\r
+\r
+MAIN: run-lunar\r
--- /dev/null
+Intel 8080-based Lunar Rescue arcade machine emulator
--- /dev/null
+games
+applications
USING: help.syntax help.markup cpu.8080.emulator ;\r
IN: space-invaders \r
\r
-HELP: run \r
+HELP: run-invaders\r
{ $description \r
"Run the Space Invaders emulator in a new window." $nl\r
{ $link rom-root } " must be set to the directory containing the "\r
"invaders/invaders.h"\r
}\r
"These are the same ROM files as used by MAME. To run the game use the " \r
-{ $link run } " word." $nl\r
+{ $link run-invaders } " word." $nl\r
"Keys:" \r
{ $table\r
{ "Backspace" "Insert Coin" }\r
cpu.8080
cpu.8080.emulator
io.files
+ io.pathnames
kernel
math
openal
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 -- )
[ 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
[ 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 ;
{ HEX: 1800 "invaders/invaders.e" }
}
-: run ( -- )
+: run-invaders ( -- )
[
"Space Invaders" <space-invaders> rom-info (run)
] with-ui ;
-MAIN: run
+MAIN: run-invaders
+++ /dev/null
-Chris Double
+++ /dev/null
-! Copyright (C) 2007 Chris Double.\r
-! See http://factorcode.org/license.txt for BSD license.\r
-USING: help.syntax help.markup cpu.8080.emulator ;\r
-IN: balloon-bomber\r
-\r
-HELP: run \r
-{ $description \r
-"Run the Balloon Bomber emulator in a new window." $nl\r
-{ $link rom-root } " must be set to the directory containing the "\r
-"location of the Balloon Bomber ROM files. See " \r
-{ $link { "balloon-bomber" "balloon-bomber" } } " for details."\r
-} ;\r
-\r
-ARTICLE: { "balloon-bomber" "balloon-bomber" } "Balloon Bomber Emulator"\r
-"Provides an emulation of the original 8080 Arcade Game 'Balloon Bomber'." $nl\r
-"More information on the arcade game can be obtained from " { $url "http://www.mameworld.net/maws/romset/ballbomb" } "." $nl\r
-"To play the game you need the ROM files for the arcade game. They should "\r
-"be placed in a directory called 'ballbomb' in the location specified by "\r
-"the variable " { $link rom-root } ". The specific files needed are:"\r
-{ $list\r
- "ballbomb/tn01"\r
- "ballbomb/tn02"\r
- "ballbomb/tn03"\r
- "ballbomb/tn04"\r
- "ballbomb/tn05-1"\r
-}\r
-"These are the same ROM files as used by MAME. To run the game use the " \r
-{ $link run } " word." $nl\r
-"Keys:" \r
-{ $table\r
- { "Backspace" "Insert Coin" }\r
- { "1" "1 Player" }\r
- { "2" "2 Player" }\r
- { "Left" "Move Left" }\r
- { "Right" "Move Right" }\r
- { "Up" "Fire" }\r
-}\r
-"If you save the Factor image while a game is running, when you restart "\r
-"the image the game continues where it left off." ;\r
+++ /dev/null
-! Copyright (C) 2007 Chris Double.\r
-! See http://factorcode.org/license.txt for BSD license.\r
-!\r
-! Balloon Bomber: http://www.mameworld.net/maws/romset/ballbomb\r
-!\r
-USING: kernel space-invaders cpu.8080 ui ;\r
-IN: balloon-bomber\r
-\r
-TUPLE: balloon-bomber ; \r
-\r
-: <balloon-bomber> ( -- cpu )\r
- <space-invaders> balloon-bomber construct-delegate ;\r
-\r
-: run ( -- ) \r
- "Balloon Bomber" <balloon-bomber> {\r
- { HEX: 0000 "ballbomb/tn01" }\r
- { HEX: 0800 "ballbomb/tn02" }\r
- { HEX: 1000 "ballbomb/tn03" }\r
- { HEX: 1800 "ballbomb/tn04" }\r
- { HEX: 4000 "ballbomb/tn05-1" }\r
- } [ (run) ] with-ui ;\r
-\r
-MAIN: run\r
+++ /dev/null
-Intel 8080-based Balloon Bomber arcade machine emulator
+++ /dev/null
-demos
-games
-applications
+++ /dev/null
-Chris Double
+++ /dev/null
-! Copyright (C) 2007 Chris Double.\r
-! See http://factorcode.org/license.txt for BSD license.\r
-USING: help.syntax help.markup cpu.8080.emulator ;\r
-IN: lunar-rescue \r
-\r
-HELP: run \r
-{ $description \r
-"Run the Lunar Rescue emulator in a new window." $nl\r
-{ $link rom-root } " must be set to the directory containing the "\r
-"location of the Lunar Rescue ROM files. See " \r
-{ $link { "lunar-rescue" "lunar-rescue" } } " for details."\r
-} ;\r
-\r
-ARTICLE: { "lunar-rescue" "lunar-rescue" } "Lunar Rescue Emulator"\r
-"Provides an emulation of the original 8080 Arcade Game 'Lunar Rescue'." $nl\r
-"More information on the arcade game can be obtained from " { $url "http://www.mameworld.net/maws/romset/lrescue" } "." $nl\r
-"To play the game you need the ROM files for the arcade game. They should "\r
-"be placed in a directory called 'lrescue' in the location specified by "\r
-"the variable " { $link rom-root } ". The specific files needed are:"\r
-{ $list\r
- "lrescue/lrescue.1"\r
- "lrescue/lrescue.2"\r
- "lrescue/lrescue.3"\r
- "lrescue/lrescue.4"\r
- "lrescue/lrescue.5"\r
- "lrescue/lrescue.6"\r
-}\r
-"These are the same ROM files as used by MAME. To run the game use the " \r
-{ $link run } " word." $nl\r
-"Keys:" \r
-{ $table\r
- { "Backspace" "Insert Coin" }\r
- { "1" "1 Player" }\r
- { "2" "2 Player" }\r
- { "Left" "Move Left" }\r
- { "Right" "Move Right" }\r
- { "Up" "Fire or apply thrusters" }\r
-}\r
-"If you save the Factor image while a game is running, when you restart "\r
-"the image the game continues where it left off." ;\r
+++ /dev/null
-! Copyright (C) 2007 Chris Double.\r
-! See http://factorcode.org/license.txt for BSD license.\r
-!\r
-! Lunar Rescue: http://www.mameworld.net/maws/romset/lrescue\r
-!\r
-USING: kernel space-invaders cpu.8080 ui ;\r
-IN: lunar-rescue\r
-\r
-TUPLE: lunar-rescue ; \r
-\r
-: <lunar-rescue> ( -- cpu )\r
- <space-invaders> lunar-rescue construct-delegate ;\r
-\r
-: run ( -- ) \r
- "Lunar Rescue" <lunar-rescue> {\r
- { HEX: 0000 "lrescue/lrescue.1" }\r
- { HEX: 0800 "lrescue/lrescue.2" }\r
- { HEX: 1000 "lrescue/lrescue.3" }\r
- { HEX: 1800 "lrescue/lrescue.4" }\r
- { HEX: 4000 "lrescue/lrescue.5" }\r
- { HEX: 4800 "lrescue/lrescue.6" }\r
- } [ (run) ] with-ui ;\r
-\r
-MAIN: run\r
+++ /dev/null
-Intel 8080-based Lunar Rescue arcade machine emulator
+++ /dev/null
-games
-applications