From: David Griffith Date: Mon, 16 Dec 2013 10:50:28 +0000 (-0800) Subject: Updates and cleanups. Now things are more or less self-consistant. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=17eb0e7bde7cd0f0730e752a8b704e6a9924da9f;p=liskon_frotz.git Updates and cleanups. Now things are more or less self-consistant. --- diff --git a/Makefile b/Makefile index 0ff635a..490c46d 100644 --- a/Makefile +++ b/Makefile @@ -6,9 +6,10 @@ CC = gcc # Define your optimization flags. # # These are good for regular use. -OPTS = -O2 -fomit-frame-pointer -falign-functions=2 -falign-loops=2 -falign-jumps=2 +#OPTS = -O2 -fomit-frame-pointer -falign-functions=2 -falign-loops=2 -falign-jumps=2 # These are handy for debugging. -#OPTS = -O2 -g -Wall +OPTS = -O2 -g -Wall + # Define where you want Frotz installed (typically /usr/local). # @@ -105,8 +106,8 @@ CURSES_OBJECT = $(CURSES_DIR)/ux_init.o \ $(CURSES_DIR)/ux_text.o \ $(CURSES_DIR)/ux_blorb.o \ $(CURSES_DIR)/ux_audio.o \ - $(CURSES_DIR)/ux_resource.o -# $(CURSES_DIR)/ux_audio_none.o \ + $(CURSES_DIR)/ux_resource.o \ + $(CURSES_DIR)/ux_audio_none.o DUMB_DIR = $(SRCDIR)/dumb DUMB_TARGET = $(SRCDIR)/frotz_dumb.a @@ -127,11 +128,13 @@ TARGETS = $(COMMON_TARGET) $(CURSES_TARGET) $(BLORB_TARGET) OPT_DEFS = -DCONFIG_DIR="\"$(CONFIG_DIR)\"" $(CURSES_DEF) \ -DVERSION="\"$(VERSION)\"" -CURSES_DEFS = $(OPT_DEFS) $(COLOR_DEFS) $(SOUND_DEF) $(MEMMOVE_DEF) +CURSES_DEFS = $(OPT_DEFS) $(COLOR_DEFS) $(NO_SOUND) $(MEMMOVE_DEF) FLAGS = $(OPTS) $(CURSES_DEFS) $(INCL) -SOUND_LIB = -lao -ldl -lm -lsndfile -lvorbisfile -lmodplug +ifeq ($(NO_SOUND), ) + SOUND_LIB = -lao -ldl -lm -lsndfile -lvorbisfile -lmodplug +endif $(NAME): $(NAME)-curses diff --git a/PACKAGING b/PACKAGING deleted file mode 100644 index 5f0ac33..0000000 --- a/PACKAGING +++ /dev/null @@ -1,19 +0,0 @@ -I heartily encourage people to create packages to make it easier for less -computer-savvy people to use Frotz. However, I do have a few rules on -this. - -1. Email me if you wish to put Unix Frotz into something like a .deb, - .rpm, Slackware package, the NetBSD pkgsrc tree, FreeBSD's ports - tree, or anything like that. When you do so I can note that on the - Unix Frotz webpage at http://www.cs.csubak.edu/~dgriffi/proj/frotz. - -2. DO NOT have auto-install programs or scripts grab files from that - page. The Interactive Fiction Archive at http://www.ifarchive.org - has mirrors around the world for that sort of thing. - -3. If you distribute a patched version, SEND ME THE PATCHES. If you - don't tell me what bugs you've found and fixed, I can't very well fix - those bugs in the main codebase for all the other users of Frotz. - Patches that simply change around options in the Makefile obviously - don't apply. - diff --git a/PORTING b/PORTING deleted file mode 100644 index f6b7313..0000000 --- a/PORTING +++ /dev/null @@ -1,150 +0,0 @@ -Frotz is a very portable program and as such has been ported to quite a -lot of different platforms. - - -These are actively-maintained ports and their webpages (if known): ------------------------------------- - -WinFrotz -Frotz for machines running Microsoft Windows. -http://www.d.kinder.btinternet.co.uk - -AmigaFrotz -Frotz for the Amiga series of computers. -(no webpage) - -FrotzCE -Frotz for PocketPC machines running WindowsCE. -http://www.pyram-id.demon.co.uk/FrotzCE.html -(Based on 2.32) - -DOS -Good ol' DOS -(no webpage) - -Kwest -Frotz ported to KDE. -http://users.pandora.be/peter.bienstman/kwest/ - -EbmFrotz -Frotz ported to Franklin's eBookman. -http://www.twpo.com.au/cwarrens/ebm - - - -Nobody maintains these ports: ------------------------------ - -Pilot Frotz -Frotz for Palm Pilot machines. -http://www.geocities.com/SiliconValley/Way/2367/ -(Link has been dead for several months) - - - -Frotz might work well with these platforms: -------------------------------------------- - -Apple IIgs. -I'm fairly sure that with its greater memory capacity than the ealier -members of the Apple II family, at least text-mode Frotz should be -doable. Perhaps even graphics and sound could be done. - -RISC/OS -I don't see why not. - -Texas Instruments TI-92 and TI-92+ graphing calculators: -With a Motorola 680000 of some sort and loads of nifty development -software, it should be a worthwhile effort. Look at -http://www.ticalc.org or all sorts of interesting things that have been -done with this calculator. - -CP/M: -Usually we'll have a 64 kilobyte limit to memory. Fortunately there is -a solution in the form of an interpreter written in Z80 assembly called -ZXZVM available at the IF Archive. It seems specific to the Spectrum -+3, PCW16, and PCW10 CP/M machines. I'd be most pleased if someone with -one of those new IMSAI Series 2 machines is able to get ZXZVM working on -that machine. However, at http://www.imsai.net, the new machine is -described as having 1 meg of static system memory. Given all this, -Frotz might be doable on some more beefy CP/M machines. - - -Frotz probably won't work on these platforms: ---------------------------------------------- - -Apple II: -The IIe and IIc with expanded memory (at least 143k) might be enough for -running up to V5, but I'm not sure if Frotz will appreciate working in -such a small space. Yes, I know that several Solid Gold editions were -released for Apple II. - -Commodore 64: -Memory is limited to a bit less than 64 kilobytes. In the heyday of -Infocom, the C64 could barely support V4 games. - -Commodore 128: -Probably same troubles as with Apple II. - -Atari 8-bit: -Probably troubles as with the Commodore 64. - -Wireless phones: -They might have enough memory to handle Frotz, but I have severe doubts -about how usable any sort of Interactive Fiction can be on such a -device. Phones were not designed to be used as general-purpose -terminals. - -Digital cameras: -Someone ported the venerable arcade machine emulator MAME to a Kodak -digital camera some time ago. There should be enough space and -processing power to run Frotz, but as with wireless phones, IF is -impractical on such a platform. - - -I asked Brian Moriarty, author of several works of Interactive Fiction -for Infocom about the feasability of porting Frotz to machines using the -MOS 6502 (Apple II, Atari 8-bit, Commodore 64 and 128). Here is his -response to my emailed question: - - -Date: Thu, 8 Aug 2002 18:54:51 -0400 -From: Brian Moriarty -To: Dave -Subject: RE: porting Frotz to 6502 machines - -The original 6502 ZIPs were hand-written in assembler, and -the resulting binaries were usually quite small (around 8k). -Of course, a C compiler wouldn't be quite as efficient. - -The larger problem is that many of the later Z features (beyond -version 2) simply won't work on an Atari, C64 or Apple II, -either due to RAM, display or disk drive restrictions. When moving -into versions 3 and beyond, we decided to leave that class of -machine behind. - ------Original Message----- -From: Dave [mailto:dgriffi@cs.csubak.edu] -Sent: Thursday, August 08, 2002 6:43 PM -To: prof@ludix.com -Subject: porting Frotz to 6502 machines - - - -Brian Moriarty, - -I was wondering if I could pick your brain a bit on Z-machine portability. -One of the ongoing goals for the Frotz project is extreme portability, -including to all sorts of old architectures. I've been pondering porting -Frotz to 6502 machines such as the C64, Apple II, and Atari 8-bit -computers. Doing some investigation with the CC65 6502 C compiler brought -me to the conclusion that Frotz would produce a binary too large to fit in -the memory of these machines. Apple IIgs might work. Given your work on -making Z-machine interpreters for these machines (albeit in assembly, I -assume) would this be an accurate assumption? - -Also, given what I've found out about the new upcoming IMSAI Series 2 -machine, this might be capable of handling Frotz. - - - diff --git a/SPEECH b/SPEECH deleted file mode 100644 index bdf606c..0000000 --- a/SPEECH +++ /dev/null @@ -1,52 +0,0 @@ -=============================================== ------------------------------------------------ -| Speech synthesis and recognition in Frotz | ------------------------------------------------ -=============================================== - -This is highly-experimental code being commissioned by a presently -undisclosed party. When complete, Frotz (at least for Linux and NetBSD) -will speak its output and accept voice for input. The libraries being -used to do this are Flite and Sphinx2. Public release in any meaningful -way is on hold until the project is complete and I have been paid. In -case you're wondering, this voice-enabled version of Frotz will appear -as another make target in the Unix Frotz tarball. - - -Flite (http://cmuflite.org/) is a small run-time speech synthesis engine -created by Carnegie Mellon University around 1999. It's intended as a -lightweight substitute for University of Edinburgh's Festival Speech -Synthesis System and CMU's Festbox project. Flite is somewhat based on -Festival, but requires neither of those systems to compile and run. At -first I wanted to use Festival for voice output, but this quickly became -impractical for various reasons (like the fact it only outputs to NAS). - - -Sphinx2 (http://www.speech.cs.cmu.edu/sphinx/) is also from Carnagie -Mellon. It is unique among voice-recognition schemes with which most -people are familiar in that it doesn't need to be trained. That's -right. Joe Blow can walk in off the street, talk to a program using -Sphinx, and be understood. The tradeoff is that the programmer must -know beforehand what words are to be recognized. This makes it -difficult, if not impossible for voice-input to be used for arbitrary -games. The game's dictionary must be parsed and a pronunciation guide -made. This must be done manually because of the way the Z-machine -recognizes words. Because it only cares about the first six letters, a -real person must check for words longer than six letters, figure out -what the rest of the letters are, and how the words should be -pronounced. This is the core of the problem of supporting arbitrary -games. A computer cannot "know" what a story is about in order to guess -what the remaining letters are. - -You've probably encountered programs that do voice recognition like -Sphinx does without realizing it. The most common example I can think -of is how many locales handle collect calls. You get a phone call and -an obviously recorded voice says something like the following: - - You have a collect call from . - To accept the charges, please say "yes". - -That program is expecting to hear "yes" and is configured with several -ways that "yes" might be constructed. For good measure, "yeah", "yep", -"yup", "uh-huh", "alright", "okay", and other affirmatives are probably -programmed in there too. I don't know. I haven't checked. diff --git a/src/curses/ux_audio.c b/src/curses/ux_audio.c index 9db220b..7fd28d8 100644 --- a/src/curses/ux_audio.c +++ b/src/curses/ux_audio.c @@ -1,5 +1,5 @@ /* - * ux_audio_none.c - Unix interface, sound support + * ux_audio.c - Unix interface, sound support * * This file is part of Frotz. * @@ -20,6 +20,8 @@ #define __UNIX_PORT_FILE +#ifndef NO_SOUND + #include #include #include @@ -181,8 +183,7 @@ static void sigchld_handler(int signal) { struct sigaction sa; int dead_child; -// dead_child = wait(&status); - dead_child = waitpid(-1, &status, WNOHANG); + dead_child = wait(&status); if (dead_child == sfx_pid) sfx_pid = 0; @@ -495,3 +496,5 @@ static int playogg(FILE *fp, bb_result_t result, int vol, int repeats) exit(0); } + +#endif /* NO_SOUND */ diff --git a/src/curses/ux_audio_none.c b/src/curses/ux_audio_none.c index f847543..64b3157 100644 --- a/src/curses/ux_audio_none.c +++ b/src/curses/ux_audio_none.c @@ -19,6 +19,7 @@ */ #define __UNIX_PORT_FILE +#ifdef NO_SOUND /* don't compile this unless we're using no audio */ #ifdef USE_NCURSES_H #include @@ -28,7 +29,6 @@ #include "ux_frotz.h" -#ifdef NO_SOUND /* don't compile this unless we're using no audio */ /* * os_beep diff --git a/src/curses/ux_blorb.c b/src/curses/ux_blorb.c index 4dea719..0ffc051 100644 --- a/src/curses/ux_blorb.c +++ b/src/curses/ux_blorb.c @@ -1,6 +1,5 @@ /* * ux_blorb.c - Blorb routines - * David Griffith * * This file is part of Frotz. * diff --git a/src/curses/ux_frotz.h b/src/curses/ux_frotz.h index 6ab1d08..a313a51 100644 --- a/src/curses/ux_frotz.h +++ b/src/curses/ux_frotz.h @@ -59,10 +59,6 @@ #define PATH1 "ZCODE_PATH" #define PATH2 "INFOCOM_PATH" -#define NO_SOUND -#ifdef OSS_SOUND -# undef NO_SOUND -#endif /* Some regular curses (not ncurses) libraries don't do this correctly. */ #ifndef getmaxyx diff --git a/src/curses/ux_init.c b/src/curses/ux_init.c index 7a1e0b1..f2ffcd0 100644 --- a/src/curses/ux_init.c +++ b/src/curses/ux_init.c @@ -1,7 +1,5 @@ /* * ux_init.c - Unix interface, initialisation - * Galen Hazelwood - * David Griffith * * This file is part of Frotz. * @@ -252,14 +250,9 @@ void os_process_arguments (int argc, char *argv[]) if (optind != argc - 1) { printf("FROTZ V%s\t", VERSION); -#ifdef OSS_SOUND - printf("oss sound driver, "); -#endif -#ifdef USE_NCURSES - printf("ncurses interface."); -#else - printf("curses interface."); +#ifndef NO_SOUND + printf("Audio output enabled."); #endif putchar('\n'); @@ -304,13 +297,6 @@ void os_process_arguments (int argc, char *argv[]) strncpy(f_setup.aux_name, f_setup.story_name, strlen(f_setup.story_name) + 1); strncat(f_setup.aux_name, EXT_AUX, strlen(EXT_AUX)); -/* - printf("f_setup.story_file %s\n", f_setup.story_file); - printf("f_setup.story_name %s\n", f_setup.story_name); - printf("f_setup.story_path %s\n", f_setup.story_path); -*/ - - }/* os_process_arguments */ /* @@ -539,18 +525,10 @@ FILE *os_load_story(void) printf("Blorb file loaded, but lacks executable chunk.\n\n"); break; case bb_err_None: - printf("No blorb errors.\n\n"); +// printf("No blorb errors.\n\n"); break; } -// ux_initsound(); -// os_start_sample(5, 8, 1, 0); -// os_start_sample(4, 8, 1, 0); -// os_start_sample(3, 8, 1, 0); -// exit(1); - - printf("Loading %s\n", f_setup.story_file); - fp = fopen(f_setup.story_file, "rb"); /* Is this a Blorb file containing Zcode? */