David Griffith [Tue, 23 Jul 2019 10:00:36 +0000 (03:00 -0700)]
Identify host OS as Unix if so. Include unistd.h protected by UNIX define.
David Griffith [Thu, 25 Jul 2019 22:51:20 +0000 (15:51 -0700)]
Add list of packages for sfrotz using NetBSD nomenclature.
David Griffith [Tue, 23 Jul 2019 07:54:47 +0000 (00:54 -0700)]
Remove pointless link to dl library.
David Griffith [Tue, 23 Jul 2019 07:44:25 +0000 (00:44 -0700)]
Add specifics for NetBSD compilation. Remove -ltinfo.
David Griffith [Tue, 23 Jul 2019 06:55:06 +0000 (23:55 -0700)]
Reorder ifdefs to prevent redefinition of wint_t problems in NetBSD.
David Griffith [Mon, 22 Jul 2019 00:38:34 +0000 (17:38 -0700)]
Set h_config and h_flags properly concerning graphics in curses.
I noticed this was being done in the old V6 semi-support for the dumb
interface. For some reason, Alembic didn't see fit to copy it over to
when he submitted his V6 semi-support for the curses interface.
This should probably be done for SDL as well.
David Griffith [Sun, 21 Jul 2019 23:28:27 +0000 (16:28 -0700)]
Added Blorbified V6 semi-support to dumb interface.
David Griffith [Sun, 21 Jul 2019 02:24:02 +0000 (19:24 -0700)]
Add processing of Rect chunks for V6 semi-support.
David Griffith [Thu, 18 Jul 2019 01:06:45 +0000 (18:06 -0700)]
Endian swap not necessary.
David Griffith [Thu, 18 Jul 2019 00:09:23 +0000 (17:09 -0700)]
Update leading comments for Makefiles: for Frotz and GNU make required.
David Griffith [Thu, 18 Jul 2019 00:06:04 +0000 (00:06 +0000)]
Fix problem with an ifdef that should have been ifndef.
David Griffith [Wed, 17 Jul 2019 10:06:14 +0000 (03:06 -0700)]
First stab at V6 semi-support through Blorb in curses. Things are distorted.
Right now, the code detects PNG and JPG images. However, stuff seems to
be done only for Infocom's games and the blorbs made up for them. Even
then, the results are distorted. This may be because rectangle chunks
aren't being processed and the code depends on some chunks that aren't
found in post-Infocom V6 blorbs. Still, here's something to play with.
David Griffith [Mon, 15 Jul 2019 09:42:46 +0000 (02:42 -0700)]
Get the number of CPUs available with Linux. Not doing anything with it yet.
David Griffith [Mon, 15 Jul 2019 09:38:12 +0000 (02:38 -0700)]
Avoid race conditions when doing a parallelized buid.
If the -jX flag is used to indicate that X CPUs should be used to build
Frotz, there is a slight chance that the definitions files:
src/common/defs.h, src/curses/ux_defines.h, and src/common/git_hash.h;
will not be complete before the build process starts on the rest of the
source files. If this happens, the build fails.
David Griffith [Mon, 15 Jul 2019 04:52:56 +0000 (21:52 -0700)]
Fix trouble with wint_t being redefined with NetBSD.
David Griffith [Mon, 15 Jul 2019 04:46:35 +0000 (21:46 -0700)]
Detect NetBSD and add casts to quell complaints with toupper() and isspace().
David Griffith [Mon, 15 Jul 2019 03:53:51 +0000 (20:53 -0700)]
Fix problem with reporting audio enabled when really disabled.
David Griffith [Mon, 15 Jul 2019 03:39:47 +0000 (20:39 -0700)]
Re-add src/common/git_hash.h to .gitignore.
David Griffith [Sun, 14 Jul 2019 09:15:52 +0000 (02:15 -0700)]
Mention CONTRIBUTORS in README.1st.
David Griffith [Sun, 14 Jul 2019 09:14:11 +0000 (02:14 -0700)]
Delete the old and very stale BUGS file.
David Griffith [Sun, 14 Jul 2019 07:53:31 +0000 (00:53 -0700)]
Delete stale link to PDF.
David Griffith [Sun, 14 Jul 2019 00:49:12 +0000 (17:49 -0700)]
Rework lead comments for DOS interface files.
David Griffith [Sun, 14 Jul 2019 00:19:48 +0000 (17:19 -0700)]
Corrected address of the Free Software Foundation.
David Griffith [Sun, 14 Jul 2019 00:16:05 +0000 (17:16 -0700)]
Added README.md for respository use.
David Griffith [Sun, 14 Jul 2019 00:04:51 +0000 (17:04 -0700)]
Some minor edits to README and INSTALL.
David Griffith [Sat, 13 Jul 2019 11:58:16 +0000 (04:58 -0700)]
Merge branch 'fleger1/frotz-story-ids'
David Griffith [Sat, 13 Jul 2019 11:57:46 +0000 (04:57 -0700)]
Indent and space fixes.
David Griffith [Sat, 13 Jul 2019 07:19:52 +0000 (00:19 -0700)]
get_prop_len opcode returns 0 when argument is 0 per Z-machine spec 1.1.
Copied from Windows Frotz.
David Griffith [Sat, 13 Jul 2019 06:55:22 +0000 (23:55 -0700)]
Adding a "nosound" target to build curses interface without audio support.
Previously if you wanted to build Frotz without sound support, you
needed to edit the Makefile.
David Griffith [Fri, 12 Jul 2019 20:55:33 +0000 (13:55 -0700)]
Adding the Praxix tests to test suite.
David Griffith [Fri, 12 Jul 2019 20:53:59 +0000 (20:53 +0000)]
Merge branch 'print_table' into 'master'
Fix @print_table in non-V6 lower window
See merge request DavidGriffith/frotz!117
borg323 [Fri, 12 Jul 2019 14:43:16 +0000 (17:43 +0300)]
Fix @print_table in non-V6 lower window
This is a direct port of commit
7adcf62693ecfc8439260a7abe62c3d5a190c160
from Windows-Frotz:
https://github.com/DavidKinder/Windows-Frotz/commit/
7adcf62693ecfc8439260a7abe62c3d5a190c160
Florian Léger [Fri, 12 Jul 2019 06:57:22 +0000 (08:57 +0200)]
Add a few more story ids for alpha/beta/gamma versions
Some of them come from the WinFrotz source code,
others are from The Obsessively Complete Infocom Catalog.
Florian Léger [Wed, 10 Jul 2019 11:55:17 +0000 (13:55 +0200)]
Add more story ids
David Griffith [Wed, 10 Jul 2019 08:29:58 +0000 (08:29 +0000)]
Merge branch 'resizable' into 'master'
SFROTZ: make window resizable
See merge request DavidGriffith/frotz!114
Florian Léger [Wed, 10 Jul 2019 07:55:04 +0000 (09:55 +0200)]
SFROTZ: make window resizable
David Griffith [Tue, 9 Jul 2019 22:42:59 +0000 (22:42 +0000)]
Merge branch 'win-diff' into 'master'
reduce diff to windows frotz
See merge request DavidGriffith/frotz!113
borg323 [Tue, 9 Jul 2019 14:41:17 +0000 (17:41 +0300)]
remove stale comment
borg323 [Mon, 8 Jul 2019 23:03:53 +0000 (02:03 +0300)]
reduce diff to windows frotz
David Griffith [Mon, 8 Jul 2019 02:13:37 +0000 (19:13 -0700)]
Added another note to the ChangeLog.
David Griffith [Mon, 8 Jul 2019 01:48:37 +0000 (18:48 -0700)]
Add stuff to the ChangeLog.
David Griffith [Mon, 8 Jul 2019 00:08:08 +0000 (00:08 +0000)]
Merge branch 'zchar_cleanup' into 'master'
change os_check_unicode() 2nd argument to zchar
See merge request DavidGriffith/frotz!112
borg323 [Sun, 7 Jul 2019 11:16:04 +0000 (14:16 +0300)]
change os_check_unicode() 2nd argument to zchar
David Griffith [Sat, 6 Jul 2019 02:12:26 +0000 (19:12 -0700)]
Allow for alternative Blorb file at command line for curses, sdl, and dumb.
Doing this for the SDL interface is proved a bit troublesome because
it's not very clear where stuff is being set and where not. After the
audio overhaul release, I want to overhaul the SDL interface code to
make it as closely resemble as feasible that of the curses interface.
David Griffith [Sat, 6 Jul 2019 01:44:35 +0000 (18:44 -0700)]
Merge branch 'welash-audio_repeats'
borg323 [Fri, 5 Jul 2019 22:33:58 +0000 (01:33 +0300)]
curses: filter unicode chars > 0xffff
borg323 [Fri, 5 Jul 2019 16:03:12 +0000 (19:03 +0300)]
scale sdl file dialog with font
borg323 [Fri, 5 Jul 2019 13:48:38 +0000 (16:48 +0300)]
revert sdl to old code when USE_UTF8=no
borg323 [Fri, 5 Jul 2019 00:19:18 +0000 (03:19 +0300)]
fix sdl file dialog list display
Bill Lash [Thu, 4 Jul 2019 05:59:00 +0000 (00:59 -0500)]
First pass at adding repeats for aiff/ogg sounds
Pass the repeats parameter to load_aiff() and in process_aiff()
if there are repeats try to keep the scratch buffer for the resampler
full.
borg323 [Thu, 4 Jul 2019 12:18:05 +0000 (15:18 +0300)]
improve sdl utf-8 filename entry
borg323 [Tue, 2 Jul 2019 13:34:51 +0000 (16:34 +0300)]
fix sdl char, zchar and zword confusion
David Griffith [Mon, 1 Jul 2019 23:05:02 +0000 (23:05 +0000)]
Merge branch 'issue118' into 'master'
utf-8 input for dumb interface
See merge request DavidGriffith/frotz!108
borg323 [Mon, 1 Jul 2019 15:19:59 +0000 (18:19 +0300)]
utf-8 input for dumb interface
David Griffith [Sun, 30 Jun 2019 01:11:07 +0000 (18:11 -0700)]
Clean up stray trailing whitespace.
David Griffith [Sun, 30 Jun 2019 01:08:41 +0000 (01:08 +0000)]
Merge branch 'fix_wait' into 'master'
Make sure to set the maxwait before each select call
See merge request DavidGriffith/frotz!107
William Lash [Sun, 30 Jun 2019 01:08:41 +0000 (01:08 +0000)]
Make sure to set the maxwait before each select call
On linux at least select will update the timeout value if it returns
before the timeout is up.
It seems that simply moving the ````maxwait.tv_usec=10000;```` statement inside the ````while(1)```` loop significantly reduced CPU usage. We'll keep the timeout at 10 msec until the delay becomes noticable, which so far isn't.
David Griffith [Sat, 29 Jun 2019 00:45:26 +0000 (17:45 -0700)]
Merge branch 'welash/frotz-mac_sema'
Because MacOS lacks support for unnamed POSIX semaphores, this wrapper
code was added. For MacOS, it uses Grand Central Dispatch semaphores,
otherwise standard POSIX unnamed semaphores are used. Currently return
codes are not checked. Eventually this code will be gone over and
turned into a generic drop-in for other projects needing to reconcile
unnamed semaphores with the Apple Way. At that point, structure and
function names will be changed and return codes will be checked.
Because this is intended for later widespread re-use, ux_sema.h is
dual-licensed GPL and MIT.
Bill Lash [Fri, 28 Jun 2019 05:29:04 +0000 (00:29 -0500)]
Check for NULL dispatch semaphore ptr on MAC
Bill Lash [Fri, 28 Jun 2019 03:35:46 +0000 (22:35 -0500)]
Fixing assert due to failure of src_process
Based on discussion with @borg323 src_process was leaving the
input data pointer at an old value if it ran out of input data and
completed the output buffer in the same call. Fixed it by setting
the input data pointer back to the beginning, but since the number
of input frames was set to 0, it wouldn't read any data from it.
Bill Lash [Thu, 27 Jun 2019 04:34:30 +0000 (23:34 -0500)]
Fix a few issues discovered on the MAC
Reduce the max wait from 1 second to 1 msec to prevent pauses
between sounds. Also check the return value of the samplerate
converter src_process() and if there was an error, tell the caller
to try calling again.
Bill Lash [Tue, 25 Jun 2019 02:31:56 +0000 (21:31 -0500)]
Make a try at MACOS unnamed semaphores
David Griffith [Mon, 24 Jun 2019 06:40:42 +0000 (06:40 +0000)]
Merge branch 'typo-fixes' into 'master'
Fix a few typos in docs/comments/strings
See merge request DavidGriffith/frotz!105
David Griffith [Mon, 24 Jun 2019 02:42:57 +0000 (19:42 -0700)]
Get rid of some leftovers from audio overhaul.
David Griffith [Mon, 24 Jun 2019 00:25:56 +0000 (00:25 +0000)]
Merge branch 'successivesounds' into 'master'
Change ux_input to periodically call os_tick()
See merge request DavidGriffith/frotz!104
David Griffith [Mon, 24 Jun 2019 00:11:45 +0000 (17:11 -0700)]
Fix problem of os_fatal() trying to write to SDL window when SDL not active.
If we have a showstopping problem right from the start, like trying to
load a file that's not a Zcode file or Blorb file that lacks a Zcode
chunk, then Frotz will call os_fatal() to complain about it and then
exit. But sfrotz's version of os_fatal doesn't check if SDL is active
or not before calling functions that depend on SDL. The first of these
is os_set_text_style(). This leads to a segfault when a call of
current.font->getglyph(current.font,c,1); dereferences getglyph, which
does not exist because current is not properly initialized yet.
Chris Bracken [Mon, 24 Jun 2019 00:05:01 +0000 (17:05 -0700)]
Fix a few typos in docs/comments/strings
Fixes a few minor typos revealed by running a spell-checker [1] over the
repo. It also identified 'auxilary' -> 'auxiliary', but it's
consistently spelled throughout the code and this patch is limited to
changes to docs, comments, and string literals.
[1] https://github.com/client9/misspell
Bill Lash [Sun, 23 Jun 2019 22:24:34 +0000 (17:24 -0500)]
Change ux_input to periodically call os_tick()
Regardless of the timeout. This seems to fix the cab sound sequence
in sherlock.
David Griffith [Sun, 23 Jun 2019 21:11:47 +0000 (21:11 +0000)]
Merge branch 'transcript-spelling-fix' into 'master'
Fix typo: transcript
See merge request DavidGriffith/frotz!103
Chris Bracken [Sun, 23 Jun 2019 19:40:21 +0000 (12:40 -0700)]
Fix typo: transcript
Fix a typo (transscript -> transcript) in the docs/man pages.
David Griffith [Sun, 23 Jun 2019 01:52:14 +0000 (01:52 +0000)]
Merge branch 'macosfixes' into 'master'
Macosfixes
See merge request DavidGriffith/frotz!102
Bill Lash [Sat, 22 Jun 2019 20:59:11 +0000 (15:59 -0500)]
Add auto detection of MAC OS X
Bill Lash [Sat, 22 Jun 2019 04:41:32 +0000 (23:41 -0500)]
Clean up makefile for MACOS
Bill Lash [Sat, 22 Jun 2019 04:39:22 +0000 (23:39 -0500)]
Fix sdl build on MACOS
Need to include sf_frotz.h before system headers for MACOS build
Bill Lash [Sat, 22 Jun 2019 04:36:12 +0000 (23:36 -0500)]
Fix dfrotz compile on MACOS
Need to include dumb_frotz.h before system headers on MACOS
Bill Lash [Sat, 22 Jun 2019 04:33:56 +0000 (23:33 -0500)]
Add override for CFLAG += for MACOS
For some reason, on MACOSX, adding the flags for SDL didn't work
without adding the override directive.
Bill Lash [Sat, 22 Jun 2019 01:53:14 +0000 (20:53 -0500)]
Some changes for MACOSX
Fix Makefile generation of defs.h move inclusion of frotz.h before
first system includes.
David Griffith [Wed, 19 Jun 2019 08:27:55 +0000 (01:27 -0700)]
Add code to check for Infocom games that use bleeps, but don't set SOUND_FLAG.
This may be useful later on when os_beep() is rewritten to make high and low
noises. Right now this code does nothing.
David Griffith [Wed, 19 Jun 2019 08:15:03 +0000 (01:15 -0700)]
Move os_beep() call to beginning of z_sound_effect(). In curses it calls beep().
David Griffith [Wed, 19 Jun 2019 08:09:57 +0000 (01:09 -0700)]
OLD_SOUND_FLAG is valid only for V3 games. For V5+, the game wants to use UNDO.
David Griffith [Wed, 19 Jun 2019 07:38:50 +0000 (00:38 -0700)]
Reenable compiling with no sound.
David Griffith [Tue, 18 Jun 2019 07:37:21 +0000 (00:37 -0700)]
Partial fix of #120. Subsequent hoofbeats block until another key is pressed.
end_of_sound() must be called at the end of every sound played so that
the next sound can be played. Otherwise only one sound is played per
turn. os_tick() seems to be the correct place for end_of_sound() to be
called, but I'm not sure about the sem_post(&sound_done) call. Why does
process_engine() block until the next key is pressed?
David Griffith [Tue, 18 Jun 2019 02:51:14 +0000 (19:51 -0700)]
Adding some MacOS compilation fixes.
David Griffith [Fri, 14 Jun 2019 23:41:24 +0000 (23:41 +0000)]
Merge branch 'issue118' into 'master'
sdl render glyphs only when needed
See merge request DavidGriffith/frotz!101
borg323 [Fri, 14 Jun 2019 13:59:04 +0000 (16:59 +0300)]
sdl render glyphs only when needed
David Griffith [Wed, 12 Jun 2019 20:55:59 +0000 (20:55 +0000)]
Merge branch 'issue118' into 'master'
utf8 changes for issue 118
See merge request DavidGriffith/frotz!100
borg323 [Mon, 10 Jun 2019 19:07:38 +0000 (22:07 +0300)]
first effort to use all unicode chars from ttf font
borg323 [Mon, 10 Jun 2019 19:02:58 +0000 (22:02 +0300)]
use os_check_unicode()
borg323 [Mon, 10 Jun 2019 16:37:40 +0000 (19:37 +0300)]
dumb: allow utf8 output
borg323 [Mon, 10 Jun 2019 16:31:56 +0000 (19:31 +0300)]
dumb: covert char input buffer to zchar
David Griffith [Fri, 7 Jun 2019 01:45:32 +0000 (18:45 -0700)]
Adding names of contributors to the manpage and new file CONTRIBUTORS.
David Griffith [Fri, 7 Jun 2019 00:39:12 +0000 (17:39 -0700)]
Fix cast in call to read_string().
David Griffith [Fri, 7 Jun 2019 00:14:35 +0000 (00:14 +0000)]
Merge branch 'no_sound_fix' into 'master'
ux_audio cleanup
See merge request DavidGriffith/frotz!99
borg323 [Thu, 6 Jun 2019 07:34:29 +0000 (10:34 +0300)]
Merge branch 'master' into no_sound_fix
borg323 [Wed, 5 Jun 2019 19:04:09 +0000 (22:04 +0300)]
fix build with SOUND=none
David Griffith [Wed, 5 Jun 2019 08:36:39 +0000 (01:36 -0700)]
Don't activate sound subsystem if SOUND_FLAG or OLD_SOUND_FLAG is not set.
David Griffith [Tue, 4 Jun 2019 07:37:43 +0000 (07:37 +0000)]
Merge branch 'audio_rewrite' into 'master'
Rewrite Frotz audio system core
See merge request DavidGriffith/frotz!98
fundamental [Tue, 4 Jun 2019 01:00:20 +0000 (21:00 -0400)]
Avoid loading OGG segments into memory
Uses the virtual IO interface for sndfile providing pread() as the
mechanism for loading data from the file handle. pread() makes it
possible to read bytes from the file without impacting the offset
which would be altered with normal fread()/fseek() or
dup()+fread()/fseek() calls.
By avoiding changing the shared offset values, pread() makes it
possible to avoid multi-threaded data races while avoiding the
modest memory usage of loading a single audio track to memory.
fundamental [Wed, 29 May 2019 01:58:23 +0000 (21:58 -0400)]
Fix Mod file stereo/mono bug
fundamental [Tue, 28 May 2019 00:01:45 +0000 (20:01 -0400)]
Rewrite Frotz audio system core
Introduce an audio manager which works on audio streams which are loaded into
one of several audio voices. These streams are loaded into memory in the
interperter thread and then incrementally translated to samples in the audio
thread. Multiple concurrent voices is normal during operation and should not
cause issues. Overhead when no voices are playing should be low, though as the
audio thread will be running in the background after it has been initialized,
the overhead will be non-zero.
The provided work is C89 compliant (according to GCC), is available under a
dual GPLv2+ and MIT license, and as a result of the stream loaded approach
removes the libvorbis dependency as libsndfile handles in-memory OGG files.