Timo Korvola [Tue, 20 Feb 2018 16:47:28 +0000 (18:47 +0200)]
Add a dummy os_repaint_window to DOS version.
Untested, as I don't have the compiler for it.
Timo Korvola [Mon, 19 Feb 2018 23:08:50 +0000 (01:08 +0200)]
Ensure window 0 has at least one line.
No other window heights are adjusted, so they may be out of bounds
and overlap with window 0.
Timo Korvola [Mon, 19 Feb 2018 21:41:49 +0000 (23:41 +0200)]
Keep cursor within bounds in os_read_line.
Maximum scrpos is width - 1 even if len == width. Then the cursor
will stay on the last character because there is no room to the right
of it.
#42: Handle terminal resizing
Timo Korvola [Sun, 18 Feb 2018 18:24:46 +0000 (20:24 +0200)]
Stay in os_read_line on resize.
The callers of os_read_line weren't taking a return value of ZC_BAD
too well. So just chop input to fit and keep editing.
Document that width is adjusted according to terminal width.
#42: Handle terminal resizing
Timo Korvola [Sun, 18 Feb 2018 14:36:08 +0000 (16:36 +0200)]
Clean up a bit.
Add resize_screen to frotz.h. Remove its declarations from .c files.
Also remove an unused declaration.
#42: Handle terminal resizing
Timo Korvola [Sun, 18 Feb 2018 14:28:02 +0000 (16:28 +0200)]
Forgot to update dfrotz after interface change.
dfrotz is not built by default, so it is easy to miss errors there.
Timo Korvola [Sat, 17 Feb 2018 21:00:12 +0000 (23:00 +0200)]
Have resize_screen repaint window 0.
resize_screen decides which part of the window it wants to keep,
adjusts the window properties and calls a new front end function
os_repaint_window to repaint the required part. Only window 0 currently
has this special handling - for the others it seems to suffice that
curses repaints the screen from the top left. Resizing now
works pretty well in Beyond Zork as long as the width is not resized
and the height is enough for the upper window.
Also have resize_screen ask V6 games to redraw. This used to be in
the front end but I can't see how any front end could do anything else
because the interpreter does not know what kind of window layout the
game wants. So it may as well be in the common code.
#42: Handle terminal resizing
Timo Korvola [Sat, 17 Feb 2018 18:36:21 +0000 (20:36 +0200)]
Use a pad for storing the old screen during resize.
Why bother reinventing the wheel when curses does the job?
#42: Handle terminal resizing
Timo Korvola [Sun, 11 Feb 2018 20:41:17 +0000 (22:41 +0200)]
Use select to wait for input.
Using select is more complicated but guarantees interruption on
signals and thus allows immediate reaction to terminal resize.
#42: Handle terminal resizing
Timo Korvola [Sun, 11 Feb 2018 15:58:46 +0000 (17:58 +0200)]
Split out a struct timeval version of timeout_to_ms.
Planning to move to select for timeout handling, and select uses
struct timeval.
#42: Handle terminal resizing
Timo Korvola [Sat, 10 Feb 2018 17:12:47 +0000 (19:12 +0200)]
Clip cursor position to window sizes.
This introduces an inconvenient dependency between resize_screen
and unix_resize_screen.
#42: Handle terminal resizing
Timo Korvola [Sat, 10 Feb 2018 12:43:44 +0000 (14:43 +0200)]
Cope with resize in os_read_line.
os_read_line now returns ZC_BAD if the screen becomes too narrow.
Not sure if that is right but it will do for now. The bigger problem
is that the Zwindow structures in screen.c are not updated, thus
subsequent output makes a mess of the screen.
#42: Handle terminal resizing
Timo Korvola [Sat, 10 Feb 2018 12:23:48 +0000 (14:23 +0200)]
Use // for commenting away.
Stops warnings about nested comments. Eventually the commented
away declarations should be either implemented or dropped, but let's
keep them in limbo for now.
Timo Korvola [Tue, 6 Feb 2018 22:25:46 +0000 (00:25 +0200)]
Better method for row shrinking.
Shrink the screen so that the cursor will normally be on the last row.
#42: Handle terminal resizing
Timo Korvola [Fri, 26 Jan 2018 19:11:31 +0000 (21:11 +0200)]
Try to repaint the screen.
The old screen contents are read from curses.
Timo Korvola [Sat, 10 Feb 2018 12:57:04 +0000 (14:57 +0200)]
Merge branch 'master' into resize
David Griffith [Tue, 6 Feb 2018 04:26:36 +0000 (20:26 -0800)]
Update README to state that audio support is through libao.
David Griffith [Tue, 6 Feb 2018 04:23:49 +0000 (20:23 -0800)]
Merge pull request #57 from escondida/make
Rewrite the Makefile
Ivy Foster [Fri, 2 Feb 2018 00:56:20 +0000 (18:56 -0600)]
Rewrite the Makefile
Some general patterns for the changes:
- Use user LDFLAGS and CFLAGS
- Generally allow user to pass well-known variables through the
environment or on the command-line rather than editing the file and
finding what they're called
- Get rid of non-standard variables like OPTS in favor of additive
assignmet
- Remove repetitive code (compare %.a definition with previous foo_lib
recipes)
- Correct build dependencies (e.g., it is frotz_curses.a that requires
the curses defines.h; frotz itself requires that defines.h only
indirectly)
- Reduce number of needless variables; it's just as easy to use sed to
change all occurrences of "frotz" if the name ever changes as it
would be to change $(NAME)
- Clarify recipes where possible by breaking out conditionals and such
that can go elsewhere
- Make git usage less brittle by providing fall-backs; this also means
that releases built from dist tarballs are more clearly marked by
having GIT_BRANCH and GIT_HASH be "none"
- Remove variable definitions that make automagically handles when not
passed by user, such as CC
I also removed any mention of the oss and sun audio options, since the
existing checks raised an error if any option other than "ao" or
"none" was passed
Timo Korvola [Sat, 27 Jan 2018 22:21:59 +0000 (00:21 +0200)]
Check for resize after getch.
Most of the time is spent in getch, so that is when we'll likely
get SIGWINCH.
Timo Korvola [Sat, 27 Jan 2018 17:51:29 +0000 (19:51 +0200)]
Call endwin() if unix_get_terminal_size() has to punt.
Curses must be very messed up at this point. Turn it off and hope
something prints on our way out.
This is
3505ee0d revived, as it got clobbered in the merge.
Timo Korvola [Sat, 27 Jan 2018 18:26:45 +0000 (20:26 +0200)]
Merge branch 'master' into resize
David Griffith [Fri, 26 Jan 2018 14:17:51 +0000 (06:17 -0800)]
Found some new droppings that need to be ignored.
David Griffith [Fri, 26 Jan 2018 13:56:16 +0000 (05:56 -0800)]
Turn off curses before doing an os_fatal() for screen width > 255.
David Griffith [Fri, 26 Jan 2018 12:55:45 +0000 (04:55 -0800)]
Fixed weirdness in os_char_width() carried over from old DOS interface.
David Griffith [Fri, 26 Jan 2018 12:23:56 +0000 (04:23 -0800)]
Add DUMMY macro call to calm the compiler.
David Griffith [Fri, 26 Jan 2018 12:13:55 +0000 (04:13 -0800)]
Set screen width to 255 when terminal asks for more.
The Z-machine design uses an 8-bit value to describe the number of
columns on a terminal. At the time (late 1970s), this seemed like a
reasonable limitation. Now some people are trying to use terminals
(emulators really) this wide.
David Griffith [Fri, 26 Jan 2018 12:10:07 +0000 (04:10 -0800)]
Remove duplicate prototypes and move other stuff to a better place.
Timo Korvola [Thu, 25 Jan 2018 22:08:29 +0000 (00:08 +0200)]
New function unix_get_terminal_size.
Now startup and resize use the same code for getting the terminal
size (including override support).
Timo Korvola [Wed, 24 Jan 2018 23:46:46 +0000 (01:46 +0200)]
Simplify the SIGWINCH handler.
Calling curses from the signal handler may not be safe.
So just set a flag and do the actual work in unix_read_char.
Timo Korvola [Wed, 24 Jan 2018 21:59:15 +0000 (23:59 +0200)]
Fix unix_resize_display.
COLS and LINES are updated by refresh(), so that needs
to come first.
Timo Korvola [Wed, 24 Jan 2018 22:05:42 +0000 (00:05 +0200)]
Merge branch 'master' into resize
David Griffith [Wed, 24 Jan 2018 20:59:07 +0000 (12:59 -0800)]
Merge pull request #55 from tkorvola/undo
Fix SEGV on undo past beginning of game.
Timo Korvola [Sun, 21 Jan 2018 18:53:26 +0000 (20:53 +0200)]
Fix SEGV on undo past beginning of game.
David Griffith [Sun, 31 Dec 2017 15:13:11 +0000 (07:13 -0800)]
Merge pull request #54 from laanwj/2017_12_yellow
Allow color 'yellow' for option -f and -b
Wladimir J. van der Laan [Sat, 23 Dec 2017 07:24:51 +0000 (08:24 +0100)]
Allow color 'yellow' for option -f and -b
This color was missing in `getcolor()`, but is supported by the ncurses
backend, so add it.
David Griffith [Fri, 15 Dec 2017 14:01:33 +0000 (06:01 -0800)]
Merge pull request #52 from llasram/dumb-command-name
Provide dfrotz `f_setup.command_name` with an initial buffer
David Griffith [Fri, 15 Dec 2017 14:00:06 +0000 (06:00 -0800)]
Merge pull request #51 from everlastingwonder/patch-1
Update Makefile to support versions of install that don't recognize -D option
Marshall Bockrath [Thu, 14 Dec 2017 19:09:52 +0000 (14:09 -0500)]
Provide dfrotz `f_setup.command_name` with an initial buffer
Without this initialization `f_setup.command_name` is NULL, but
e.g. `replay_open()` assumes that it points to a valid buffer, and produces a
segfault if it does not. In particular, this causes `dfrotz` to segfault when
attempting to replay a command playback file.
Gus Wiedey [Tue, 12 Dec 2017 20:07:18 +0000 (15:07 -0500)]
Update Makefile to support versions of install that don't recognize -D
On some versions of MacOS (e.g. the one I'm currently using), the system default version of `install` doesn't recognize the `-D` option (the closest equivalent is `-d`); this provides support for those versions.
David Griffith [Fri, 21 Jul 2017 23:12:23 +0000 (16:12 -0700)]
...forgot src/dumb/dumb_params.txt
David Griffith [Fri, 21 Jul 2017 23:11:36 +0000 (16:11 -0700)]
Clean up minor unevenness in "dfrotz -h" output.
David Griffith [Fri, 21 Jul 2017 23:08:14 +0000 (16:08 -0700)]
Mention the '-m' flag in "dfrotz -h" output.
David Griffith [Thu, 13 Jul 2017 00:05:48 +0000 (17:05 -0700)]
Remove references to obsolete PORTING and PACKAGING files from README.
David Griffith [Wed, 12 Jul 2017 12:34:45 +0000 (05:34 -0700)]
Added .EXE, .LIB, and .z? to .gitignore.
David Griffith [Wed, 12 Jul 2017 12:31:13 +0000 (05:31 -0700)]
DOS Frotz restricted mode (not tested yet) and fixed problems in bcsample.c.
David Griffith [Sat, 1 Jul 2017 09:25:49 +0000 (02:25 -0700)]
Style correction.
David Griffith [Wed, 28 Jun 2017 23:48:03 +0000 (16:48 -0700)]
Add list of parameters for DOS interface for use with src/misc/twocol.pl
David Griffith [Wed, 28 Jun 2017 23:29:02 +0000 (16:29 -0700)]
Add restricted mode for curses, which is now -R. -L is for loading saves.
David Griffith [Wed, 28 Jun 2017 22:38:35 +0000 (15:38 -0700)]
Add -W flag to dumb help. Clarify that -W restricts reading as well.
David Griffith [Tue, 27 Jun 2017 11:57:07 +0000 (04:57 -0700)]
Added support for directory restriction.
I cringed while writing this, looking at all those unsafe string calls.
I resisted the urge to go off on a tangent, correcting all of them.
Rather than do that now and forget what I should be doing, I'll get
directory restriction done and THEN tackle the string call problem.
David Griffith [Tue, 27 Jun 2017 11:09:53 +0000 (04:09 -0700)]
Clarify some stuff about the intended effects of -W.
David Griffith [Tue, 27 Jun 2017 09:43:02 +0000 (02:43 -0700)]
Adding some stuff to ease the process of reworking -h output.
David Griffith [Tue, 27 Jun 2017 09:39:11 +0000 (02:39 -0700)]
Modified the manpages in anticipation of the -W option
The -W option restricts Frotz to writing only in the specified
directory. This is to prevent players from writing somewhere they
should not. This is intended to be useful for front-ends or restricted
environments -- for instance a chatbot or telnetting to a certain TCP/IP
port to play a game.
David Griffith [Thu, 15 Jun 2017 19:10:24 +0000 (12:10 -0700)]
Merge branch 'timtelcik-frotz-issue-44'
David Griffith [Thu, 15 Jun 2017 19:08:53 +0000 (12:08 -0700)]
Fix to appease -Wmisleading-indentation
Tim Telcik [Thu, 15 Jun 2017 15:05:32 +0000 (23:05 +0800)]
frotz-issue-44: Replaced type "ulong" with type "unsigned long" to enable support for Apple MacOS Sierra 10.12 plus MacPorts 2.4.1.
Tim Telcik [Mon, 12 Jun 2017 16:20:33 +0000 (00:20 +0800)]
frotz-issue-44: Added compiler support for Apple MacOS Sierra 10.12 plus MacPorts 2.4.1.
David Griffith [Thu, 9 Mar 2017 11:37:09 +0000 (03:37 -0800)]
Clean up assorted foibles in Makefile.
Fix problem with "make dist" resulting in a distro file missing src/common/git_hash.h
Only delete src/common/git_hash.h when cleaning IF we're in a git repo (and git is installed).
Make sure compiling with no sound actually works
Optimized the hash target and refrain from needlessly redoing it
David Griffith [Thu, 9 Mar 2017 11:31:52 +0000 (03:31 -0800)]
Clean up assorted foibles in Makefile.
Fix problem with "make dist" resulting in a distro file missing src/common/git_hash.h
Only delete src/common/git_hash.h when cleaning IF we're in a git repo (and git is installed).
Make sure compiling with no sound actually works
Optimized the hash target and refrain from needlessly redoing it
David Griffith [Thu, 9 Mar 2017 06:21:05 +0000 (22:21 -0800)]
This approach almost works. First character typed after the resize gets lost though.
David Griffith [Thu, 9 Mar 2017 06:19:59 +0000 (22:19 -0800)]
Delete useless os_speech_output() call.
David Griffith [Wed, 8 Mar 2017 13:25:15 +0000 (05:25 -0800)]
Initial attempt at resizing the screen.
Essentially I just copied stuff from FrotzWnd.cpp from David Kinder's
Windows Frotz codebase. I don't understand how he's getting the screen
contents to reprint.
David Griffith [Mon, 27 Feb 2017 05:13:34 +0000 (21:13 -0800)]
Added some commentary to the end of the build process.
David Griffith [Mon, 27 Feb 2017 04:59:44 +0000 (20:59 -0800)]
Added preliminary support for Blorb loading for Dumb interface.
In the interest of keeping the dumb interface as simple as possible,
I want to make sure that Blorb support is optional.
David Griffith [Mon, 27 Feb 2017 04:49:30 +0000 (20:49 -0800)]
Remove more Blorb stuff from ux_frotz.h.
David Griffith [Mon, 27 Feb 2017 04:08:48 +0000 (20:08 -0800)]
Move use_blorb and exec_in_blorb from u_setup_t to f_setup_t.
David Griffith [Mon, 27 Feb 2017 04:00:34 +0000 (20:00 -0800)]
Delete useless Blorb members of u_setup_t structure.
David Griffith [Mon, 27 Feb 2017 03:59:27 +0000 (19:59 -0800)]
Move Blorb stuff out of ux_setup.h and into ux_blorb.h. Fix ux_audio.c to work with this.
David Griffith [Wed, 22 Feb 2017 13:31:54 +0000 (05:31 -0800)]
Head off another potential problem with dotless files when loading a Blorb file.
David Griffith [Wed, 22 Feb 2017 13:30:01 +0000 (05:30 -0800)]
Fix for Frotz tries too hard to read game files. #35.
David Griffith [Wed, 22 Feb 2017 13:10:08 +0000 (05:10 -0800)]
Added GPL and FSF stuff to leading comments in src/dumb/
David Griffith [Wed, 22 Feb 2017 13:07:14 +0000 (05:07 -0800)]
Add http://www.fsf.org/ to leading comments.
David Griffith [Wed, 22 Feb 2017 12:47:14 +0000 (04:47 -0800)]
Adjust the look of dfrotz information.
David Griffith [Wed, 22 Feb 2017 12:41:38 +0000 (04:41 -0800)]
Delete useless old CVS version tags.
David Griffith [Wed, 22 Feb 2017 12:33:25 +0000 (04:33 -0800)]
Fix long option crap.
The zgetopt() function will throw an error if you attempt to use a long
option flag like --this. So I'm including "-" in the third parameter to
zgetopt() to cause long option flags to be ignored.
David Griffith [Wed, 22 Feb 2017 12:24:59 +0000 (04:24 -0800)]
DUMB FROTZ: Fix syntax and version. Fix defines.h and git_hash.h. Fix long option crap.
The zgetopt() function will throw an error if you attempt to use a long
option flag like --this. So I'm including "-" in the third parameter to
zgetopt() to cause long option flags to be ignored.
David Griffith [Wed, 22 Feb 2017 11:42:51 +0000 (03:42 -0800)]
Update and rearrange use syntax and version information.
David Griffith [Wed, 22 Feb 2017 03:04:47 +0000 (19:04 -0800)]
Add to manpages the -R option for loading a save on startup.
David Griffith [Wed, 22 Feb 2017 03:01:10 +0000 (19:01 -0800)]
Make syntax guide a bit clearer for what's expected for -b and -f.
David Griffith [Wed, 22 Feb 2017 02:53:40 +0000 (18:53 -0800)]
Merge remote-tracking branch 'origin/ao-curses'
Conflicts:
.gitignore
ChangeLog
Makefile
PORTING
README
doc/dfrotz.6
doc/frotz.6
src/common/fastmem.c
src/common/frotz.h
src/common/main.c
src/common/process.c
src/common/screen.c
src/curses/ux_audio_none.c
src/curses/ux_blorb.c
src/curses/ux_file.c
src/curses/ux_frotz.h
src/curses/ux_init.c
src/curses/ux_screen.c
src/curses/ux_text.c
src/dos/bcinit.c
src/dumb/dumb_init.c
David Griffith [Tue, 21 Feb 2017 20:28:10 +0000 (12:28 -0800)]
Fix src/curses/defines.h trouble.
David Griffith [Tue, 21 Feb 2017 20:35:30 +0000 (12:35 -0800)]
Merge pull request #38 from fundamental/partial-audio-fix
Partial audio fix
fundamental [Tue, 21 Feb 2017 20:18:18 +0000 (15:18 -0500)]
Fix Typo When bleep.nsamples < music.nsamples
fundamental [Tue, 21 Feb 2017 15:37:20 +0000 (10:37 -0500)]
Remove Debug Printfs Within Audio Engine
fundamental [Tue, 21 Feb 2017 15:29:22 +0000 (10:29 -0500)]
Add Separate Buffers For Music/FX
This commit:
- Adds a second set of thread signaling semaphores
- Removes pthread_kill() to avoid one lock/unlock race
- Uses *equal length* samples from music/effect streams when mixing
- Temporarily adds a lot of debug prints
The threading logic for this code was rather poor prior to this commit.
As such, I make no claims to the correctness of the threading code
within this commit as the assumptions presented by the code previously
installed in the audio engine are not clearly stated.
The code as presented fixes some of the issues involved in mixing, however
effect + ogg music still seems to pose an issue and the reasons why are
unclear. A rewrite of the architecture of the audio engine is recommended.
fundamental [Tue, 21 Feb 2017 15:28:38 +0000 (10:28 -0500)]
Get Project To Build With Makefile
David Griffith [Thu, 16 Feb 2017 09:56:55 +0000 (01:56 -0800)]
Fix .gitignore
David Griffith [Thu, 16 Feb 2017 09:33:44 +0000 (01:33 -0800)]
dumb interface: add -R option to immediately load a saved game.
David Griffith [Thu, 16 Feb 2017 08:17:38 +0000 (00:17 -0800)]
Actually use the new my_strdup() function.
David Griffith [Thu, 16 Feb 2017 07:31:19 +0000 (23:31 -0800)]
Delete src/common/git_hash.h when doing "make clean".
David Griffith [Thu, 16 Feb 2017 01:05:15 +0000 (17:05 -0800)]
Fix #31: Several struct f_setup variables were not being set up at all.
In the interest of making sure this still compiles and runs on super-old
machinery, I opted to use a local implementation of strdup() instead of
using what's in string.h.
Later I'll address the possibility of strrchr() not being available.
Code shamelessly ripped from http://stackoverflow.com/questions/
37132549
David Griffith [Wed, 1 Feb 2017 03:58:00 +0000 (19:58 -0800)]
Mention the need for libsamplerate.
David Griffith [Tue, 31 Jan 2017 03:32:21 +0000 (19:32 -0800)]
Fix #33: Increase TEXT_BUFFER_SIZE to 275.
Inform7 is capable of overflowing the text (output) buffer by cramming
it with a maximum of 263 bytes. This was discovered by pushing the
limits of the Inform7 compiler. Inform6 won't do this, even if it's
told to print text far exceeding 263 bytes.
This overflow situation is not a security problem because the VM catches
it and aborts. I am unsure if it's a good idea to truncate the attempt
to overfill the buffer and continue.
David Griffith [Tue, 10 Jan 2017 12:45:21 +0000 (04:45 -0800)]
Fix #34: Exit if screen is wider than 255 instead of giving width of zero.
David Griffith [Tue, 10 Jan 2017 12:36:10 +0000 (04:36 -0800)]
Possible incorrect use of print_string() in os_reset_screen().
If print_string() and probably by extension print_char() are used before
the Z-machine is running, a few random garbage characters are printed
instead of the intended text. I'm not clear why this happens.
David Griffith [Fri, 23 Sep 2016 09:27:15 +0000 (02:27 -0700)]
Fixed a problem with segfault on attempting to load a nonexistant file.
ux_blorb_init() needs to be revisited to make sure all common blorb
filename extensions are supported.
David Griffith [Sun, 17 Jul 2016 06:25:07 +0000 (23:25 -0700)]
Make Git hash, tag, and branch info available to Frotz.
David Griffith [Wed, 15 Jun 2016 08:06:01 +0000 (01:06 -0700)]
Add UNUSED() macro to ux_audio_none.c.
David Griffith [Sat, 11 Jun 2016 09:03:40 +0000 (02:03 -0700)]
Merge pull request #30 from erikd/ao-curses
Add two new locks