Commit graph

21 commits

Author SHA1 Message Date
Bill Currie
6ff5b5c101 [qwaq] Clean up the qwaq directory
Things were getting rather cluttered with everything being qwaq-* and
all in one directory. Now most have lost the qwaq- prefix and have been
moved into subdirectories (non-recursive make).
2020-03-30 02:34:08 +09:00
Bill Currie
2d5df34234 [gamecode] Add VM enter/exit events
And rename prd_exit to prd_terminate (the idea is the host will
terminate the VM). This makes it possible for the debugger to pause the
VM before any code, even a builtin function, is executed. Breaks the
debugger source window, but only because it's not updating on file
change (I think).
2020-03-26 12:30:32 +09:00
Bill Currie
1bd8e2ee85 [gamecode] Add a param pointer to debug_handler
I decided I want events for VM enter/exit but enter needs to somehow
pass the function which will be executed (even if a builtin). A generic
void * param seemed the best idea, which meant the error string could be
passed via the param instead of a "global" string in the progs struct.
2020-03-26 11:44:02 +09:00
Bill Currie
6f7ddf52ac [gamecode] Add an exit debug event type
The VM never sends it because it cannot know if its exit is program exit
or just sub-program exit, but it's available for host systems to send.
2020-03-25 18:28:28 +09:00
Bill Currie
1e56a8efbc [qwaq] Fix a silly that caused qwaq-app to spawn twice
progs_t is very much most definitely NOT thread-safe (ie, two threads
using the same progs_t). It was actually rather funny when I figured out
what was going on to cause qwaq's universe to explode.
2020-03-25 00:44:04 +09:00
Bill Currie
48c65b3363 [qwaq] Move builtin printf to main.c
and add traceon/traceoff defs (that don't need PF_Cmds). This lets
gcd.dat load in the second progs thread.
2020-03-25 00:41:14 +09:00
Bill Currie
32d77eabac [qwaq] Hook up the debugger modules
Now to write all the high level stuff. Wheeeee
2020-03-24 20:15:35 +09:00
Bill Currie
ee9d3a36ab [qwaq] Add an editor buffer
It's a fairly high-level wrapper for TextBuffer in that it implements
file ops (load/save), searching, navigation, and formatting (simple
line-oriented with tab stops (currently at 4 spaces)).
2020-03-22 21:31:30 +09:00
Bill Currie
75f38f456b [qwaq] Fix a linker warning that had been hiding 2020-03-22 13:49:42 +09:00
Bill Currie
fc44582726 [qwaq] Parse function keys
While the key escape sequences are xterm-specific, they are only the
default and preliminary provision has been made for overriding them.
However, no override mechanism has been implemented beyond using dynamic
table lookup.
2020-03-22 13:47:44 +09:00
Bill Currie
7beaa567e6 [qwaq] Pass resource data into the thread
Things have come crashing down, but no fire (ie, no deadlocks so far).
2020-03-21 12:58:07 +09:00
Bill Currie
cf9455293b [qwaq] Start threads for progs and curses
No idea if anything works, probably come crashing down in a flaming pile
of debris.
2020-03-21 12:58:07 +09:00
Bill Currie
6c1a026bf1 [qwaq] Change thread data array to pointers
I realized that with dynamic thread creation the arrays resizing could
cause them to move around in memory which would be bad for anything
holding a pointer to the data, and even using indices wouldn't help that
much as the array would need to be mutex protected.
2020-03-21 12:58:07 +09:00
Bill Currie
f14f2f518a [qwaq] Rename thread_args to thread_data 2020-03-21 12:58:07 +09:00
Bill Currie
93886d6cd7 [qwaq] Use main args non-options as progs files
If none are specified, default to qwaq-app.dat (for now, anyway). For
each progs file, an optional args set can be specified in the same order
(separated by --). Missing sets default to empty, excess sets are
ignored.
2020-03-21 12:58:07 +09:00
Bill Currie
0cc28c8641 [qwaq] Run main thread
And only thread, still, so things lock up still, but they're coming
together.
2020-03-21 12:58:07 +09:00
Bill Currie
a5f57a8a4c [qwaq] Parse arguments into sets
The sets are separated by --, and the first set is passed to
getopt_long which currently recognizes only --qargs and non-options. The
--qargs options parses out a set (to -- or end of args) that is passed
to the qargs sub-system for standard qf command line parsing. Set 0 is
for the main qwaq application. Any additional sets (excluding --qargs)
will be used to spawn additional threads when that's working.
2020-03-21 12:58:07 +09:00
Bill Currie
52a46f5d5c [qwaq] Use allocate progs instead of static 2020-03-21 12:58:07 +09:00
Bill Currie
89cf9f9523 [qwaq] Use Sys_Printf for load error messages
It gets them into the log file.
2020-03-08 22:19:37 +09:00
Bill Currie
d88a091fc6 [qwaq] Use protocols to distinguish object abilities
Well, that took a fair bit more than it should have to get working: had
to implement the protocol support in qfcc and engine-side ruamoko.
2020-03-02 15:22:54 +09:00
Bill Currie
df2ed4b086 [qwaq] Move from tools to ruamoko
This fixes the dependency issues between qwaq and ruamoko. qwaq is
actually older than ruamoko. That little language feature test has come
a long way.

However, I'm considering moving to non-recursive make, but...
2020-03-01 00:55:15 +09:00
Renamed from tools/qwaq/main.c (Browse further)