Commit graph

170 commits

Author SHA1 Message Date
Bill Currie
a28e7417e6 [qwaq] Make traceon and traceoff always available
Tired of adding and removing them all the time.
2020-03-26 13:27:53 +09:00
Bill Currie
30b97af65a [qwaq] Actually send on receive/release focus messages
Noticed while tracking down the proxy view switch issue.
2020-03-26 13:21:05 +09:00
Bill Currie
dbb3802740 [qwaq] Transfer context to new view in proxy
This fixes the broken source window on file change.
2020-03-26 13:20:10 +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
35bb3a3854 [qwaq] Raise windows when clicked 2020-03-26 11:18:00 +09:00
Bill Currie
af0333a172 [qwaq] Ensure super's handleEvent is called
This fixes the inability to single-step (debug window couldn't regain
focus).
2020-03-26 11:04:57 +09:00
Bill Currie
1f8301774c [qwaq] Fix over-consumption of editor events
This lets the window scroll again.
2020-03-26 09:19:22 +09:00
Bill Currie
fd73daea4b [qwaq] Correct mangled params to qwaq_mvwvprintf 2020-03-26 09:11:56 +09:00
Bill Currie
22d173068b [qwaq] Make a start on a locals viewer
It's just a data dump for now. Also, found a bug...
2020-03-26 09:11:39 +09:00
Bill Currie
e579ffcb00 [qwaq] Add functions to get functions by number 2020-03-26 09:03:44 +09:00
Bill Currie
115541877a [qwaq] Set up an application color palette
Nothing special, just all the combinations of the 8 colors
2020-03-26 09:01:39 +09:00
Bill Currie
3ea16c2764 [qwaq] Add support for getting data, defs and functions
This will allow for really probing the target progs.
2020-03-25 22:39:17 +09:00
Bill Currie
513bb868fc [qfcc] Remove unsigned define
I had forgotten that qfcc supports the keyword, just not the type yet.
2020-03-25 22:37:38 +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
7b9177ec56 [qwaq] Extract the double-clicked word
The plan is to use it for variable lookups etc.
2020-03-25 17:29:08 +09:00
Bill Currie
585b33c111 [qwaq] Close up race-condition hole
After a lot of thought, I have come to the conclusion that the weird
crash the other day was caused by a race while the command ring buffer
had just been emptied: the command submission code opened up space for
writing, threads switched, and command processing saw the available data
and pounced on it before the submit code could write valid data. Thus
include the while header in the lock, and move the loop-end release
outside the lock. It may be a little confusing, but it seems to work.
2020-03-25 16:23:36 +09:00
Bill Currie
4cef9792f4 [util] Make hash-tables semi-thread-safe
They take a pointer to a free-list used for hashlinks so the hashlink
pools can be per-thread. However, hash tables that are not updated are
always thread-safe, so this affects only updates. progs_t has been set
up such that it is easy for multiple progs within one thread can share
hashlinks.
2020-03-25 15:43:16 +09:00
Bill Currie
ee6b078f18 [qwaq] Fix last window drag-resize corner case
I think I got distracted by the HoM bug while testing corners. Anyway,
with this, window resize by dragging seems to work well.
2020-03-25 14:45:55 +09:00
Bill Currie
e554202c24 [qwaq] Add combined move and resize method
This fixes the hall of mirrors bug (needed to move, resize, then move
the window).
2020-03-25 14:41:40 +09:00
Bill Currie
42f20f200d [qwaq] Fix window resize bounds logic
Have a lot of HoM going on, though :(
2020-03-25 11:18:07 +09:00
Bill Currie
257b658059 [qfcc] Implement single-stepping
That... worked nicely. Program exit needs some work because exiting
terminates the thread and the debugger has no clue about it, but I was
able to single-step through gcd.r quite nicely.
2020-03-25 10:00:18 +09:00
Bill Currie
16bd047022 [qwaq] Add a key event listener to Editor
This will allow for easy expansion of editor functionality without
messing with the editor itself. In particularly, an editor normally
doesn't need to know anything about debugger hot keys.
2020-03-25 09:41:56 +09:00
Bill Currie
d96059c70e [qwaq] Change listener respond param to void *
Avoids writing another method for Array, so probably only for now.
2020-03-25 09:20:40 +09:00
Bill Currie
9a2ea54e78 [qwaq] Highlight the current line 2020-03-25 08:28:12 +09:00
Bill Currie
1c3e503ad2 [qwaq] Set the window title to the file name 2020-03-25 01:39:56 +09:00
Bill Currie
0d8815f274 [qwaq] Handle debug events at the app level
The debugger displays the source file but doesn't highlight the current
line yet.
2020-03-25 01:32:52 +09:00
Bill Currie
c7597b94d2 [qwaq] Create a debugger class
Each debugger manages a single target.
2020-03-25 01:07:58 +09:00
Bill Currie
e69c430abc [qwaq] Clean up QwaqApplication
It doesn't need to be fun little tests any more.
2020-03-25 01:06:20 +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
9bfd14b687 [qwaq] Bring in qc gcd to use for debugger testing
It was even recent enough to compile first try.
2020-03-24 23:02:19 +09:00
Bill Currie
fd0700f9ae [qwaq] Add a proxy view class
The idea is that the view can be switched out readily: the proxy simply
passes all messages to its view object.
2020-03-24 21:02:54 +09:00
Bill Currie
05e377c3ac [qwaq] Make a View protocol 2020-03-24 21:02:26 +09:00
Bill Currie
d73f380ba4 [qwaq] Add -hide to View's interface
Missed it somehow.
2020-03-24 21:01:48 +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
12f7b52fff [qwaq] Add initial qwaq debugger system
It's not hooked up yet, and only very basic functionality is
implemented, but I think this approach will work.
2020-03-24 19:52:35 +09:00
Bill Currie
e56d00f27f [qwaq] Make qwaq_message_t more useful
Couldn't use @param because of its use in gcc as well as qfcc.
2020-03-24 19:52:00 +09:00
Bill Currie
0bbef18786 [qwaq] Make qwaq_add_event public 2020-03-24 19:50:05 +09:00
Bill Currie
60f9f4815a [qwaq] Make qwaq_cond_init public 2020-03-24 19:48:57 +09:00
Bill Currie
baff891345 [qwaq] Rename cond_t to rwcond_t 2020-03-24 19:48:20 +09:00
Bill Currie
148a351e94 [qwaq] Offset event coords only when positional
This fixes pgup/pgdn not working in the editor.
2020-03-24 13:46:26 +09:00
Bill Currie
995074269b [qwaq] Handle some keys in the editor
Doesn't work yet, though.
2020-03-24 13:38:20 +09:00
Bill Currie
a75eeb6955 [qwaq] Remove unnecessary options flag
I don't think it will be necessary.
2020-03-24 13:36:54 +09:00
Bill Currie
d022c6c4bd [qwaq] Disable updateScreenCursor
It's wrong for the current hierarchy and corrupts the view's owning
group. Thought is needed for how to proceed with cursor handling.
2020-03-24 13:34:45 +09:00
Bill Currie
77651dbcba [qwaq] Implement focus handling
Sort of works (when not segfaulting due to problem fixed in next
commit).
2020-03-24 13:33:28 +09:00
Bill Currie
47b8f8dd6a [qwaq] Remove useless protocols
The HandleEvent protocols wound up being unnecessary.
2020-03-24 13:27:35 +09:00
Bill Currie
30519e93fb [qwaq] Move mouse event offsetting to Window
This way, Group doesn't need to query its owner's position.
2020-03-23 23:59:54 +09:00
Bill Currie
8707ac0d57 [qwaq] Add a guard to formatLine
I got really weird error (invalid panel passed to top_panel) when there
was no such call, so I guess there was some memory corruption.
formatLine is the only suspect, but when I put in the guard, the error
wasn't reproduced (just scrolling through qwaq's makefile in a big
window).
2020-03-23 23:18:02 +09:00
Bill Currie
52722b73c1 [qwaq] Adjust edge window control lengths
I'd forgotten them when adjusting the corner control sizes
2020-03-23 23:03:35 +09:00