1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-15 15:57:13 +00:00

816 Commits

Author SHA1 Message Date
Nick Briggs
2e893a75ab
Merge pull request #467 from Interlisp/sdl
Bring SDL into master branch
2023-05-31 14:44:04 -07:00
Nick Briggs
4754ec73eb Add ctrl-shift-esc as a synonym for ctrl-shift-delete (user interrupt)
On a Mac laptop (without a full keyboard) it isn't easy to generate
the delete in the ctrl-shift-delete user interrupt.  The esc key is
in the same word and can easily be generated, so add ctrl-shift-esc
as an alternative.
2023-05-30 17:19:14 -07:00
Nick Briggs
a6d645ce9b SunOS bug avoidances should only execute when on SunOS 2023-05-16 21:18:15 -07:00
Nick Briggs
e8daed41ea UNIX-GETPARM(DISPLAY) should return "SDL" for SDL-based display, as it returns "X" for X11 2023-05-16 18:52:23 -07:00
Nick Briggs
41ae0162da Construct path for invoking display executable to match original path of lde
The pathname for the display program is constructed to parallel the
path for "lde", which makes it more likely that the correct display
program will get run rather than
  (a) not being found because "lde" wasn't found from the PATH, or
  (b) a different version of the display program which was found from the PATH
2023-05-07 15:10:01 -07:00
Nick Briggs
9cc7d9e13c Remove references to KATANA and replace with MAIKO
No functional difference. Replaces a few leftover references to a prior
project name for the C implementation of the Lisp Virtual Machine with the
current name.
2023-05-05 13:37:25 -07:00
Nick Briggs
45494170a3 Use SDL defined symbolic constants for mouse button events 2023-05-04 18:47:34 -07:00
Nick Briggs
a511feff39 Resolve some warnings noted by clang-tidy
Remove unused #include "miscstat.h"
Make parameters of cursor_equal_p both const
Remove unnecessary extern declarations for EmKbdAd068K, EmRealUtilin68K, MiscStats
2023-05-04 18:11:56 -07:00
Nick Briggs
d14d6183da Comment out debug printf for mousewheel(trackpad) handling. 2023-05-04 12:51:29 -07:00
Nick Briggs
44b2412fd6
Merge pull request #465 from Interlisp/warning-reductions-clang15-part2
Warning reductions clang15 part2
2023-05-01 15:35:01 -07:00
Nick Briggs
087c7a053a Compiling with -DDTDDEBUG requires including testtooldefs.h in gcrcell.c 2023-04-20 18:19:04 -07:00
Nick Briggs
222a9594d5
Speed up initial sysout loading by avoiding unnecessary lseek() calls. (#461)
On slower filesystems/disks, an lseek() operation can consume
noticeable time. During initial sysout loading we can avoid an
unnecessary lseek() before each read() by tracking if the position it
will seek to is the same position that the previous read() left us.
2023-03-19 16:32:00 -07:00
Nick Briggs
0bd29ae643 Remove extraneous extern declarations. Convert some int to LispPTR as appropriate. 2023-03-10 15:23:25 -08:00
Nick Briggs
f16b01167e Remove LHS casts in old color code. Add void return types where needed. Add includes. 2023-03-10 15:20:08 -08:00
Frank Halasz
00d306d72f
Maiko code changes needed to compile on Alpine Linux with clang. (#456)
* Changes needed to compile maiko on Alpine Linux with clang.  Switching to Alpine on github actions to streamline maiko release builds

* Changes needed to compile maiko on Alpine Linux with clang.

Switching to Alpine on github actions to streamline maiko release builds.

  * ether_nethub.c missing a couple of includes, and incorrectly including
    <sys/poll.h> instead of plain <poll.h>
  * <dirent.h> does not define MAXNAMLEN on Alpine Linux, but "locfile.h"
    compensates for this already, if it is modified to include <limits.h>,
    so use this in "dirdefs.h".

---------

Co-authored-by: Nick Briggs <nicholas.h.briggs@gmail.com>
2023-03-07 12:12:55 -08:00
Nick Briggs
a8ded8a5f6
Correct syntax error, missing semicolon (#459)
* Correct syntax error, missing semicolon

* Use appropriate datatype for dlpi buffer.  DLPI_CHUNKSIZE is already defined as 4*DLPI_MAXDLBUF.
2023-02-27 17:33:04 -08:00
Nick Briggs
88cde175fc Remove duplicate include version.h (loopsops.c, subr.c, z2.c) 2023-02-26 12:08:25 -08:00
Nick Briggs
d19aec2fbf Remove duplicate include version.h in xbbt.c 2023-02-26 12:04:47 -08:00
Nick Briggs
8e40ae8811 Remove duplicate include version.h in xlspwin.c 2023-02-26 12:04:47 -08:00
Nick Briggs
7c81d1fa08 Remove duplicate include version.h in xrdopt.c 2023-02-26 12:04:47 -08:00
Nick Briggs
ac14ce0e40 Collapse conditionals with identical consequents 2023-02-26 12:04:47 -08:00
Nick Briggs
3745c08f51 Remove unused include files from asmbbt.c 2023-02-26 12:04:47 -08:00
Nick Briggs
d4cccd7878 Simplify awkward if-test expression 2023-02-26 12:04:47 -08:00
Nick Briggs
3e1130909c Simplify awkward if-test expression 2023-02-26 12:04:47 -08:00
Nick Briggs
55b45aa2aa Replace grammatically incorrect comments in rplaca/rplacd 2023-02-26 12:04:47 -08:00
Nick Briggs
2b5a34ebe9 Correct parameter declarations for N_OP_cons (int => LispPTR) 2023-02-26 12:04:47 -08:00
Nick Briggs
2474619e83 Cleanup errors introduced resolving rebase conflicts. 2023-02-19 10:43:55 -08:00
Nick Briggs
d63b933dc8 Clean up various aspects of ldeboot.c (lde)
Handle compilation with both SDL and XWINDOW defines
   If both are defined then the -d/-display will accept
   SDL as a display name and invoke ldesdl rather than ldex.

Improve error messages when display can't be opened

Use exit status 1 for all failures (vs. mixed 1, -1)
2023-02-19 10:11:53 -08:00
Nick Briggs
7d8a7a6668 Clean up SDL infrastructure, add makefiles for more system/cpu combinations
Rationalize the SDL.h include file references so that they work on all systems

Use the correct macOS Framework options to get include path and library search path

Add makefile fragments for SDL on macOS on Apple Silicon, plus FreeBSD and Linux
on same cpus as X11

Switch to gcc rather than clang as the default compiler for Linux systems
2023-02-19 10:07:28 -08:00
Nick Briggs
2bc704c5e3 Minor cleanups after rebase onto master
Fix merge edit mistake in CMakeLists.txt
Add missing includes in draw.c, keyevent.c
2023-02-19 10:07:28 -08:00
Nick Briggs
a3c462d211 Rename sdl_bitblt_to_texture2 to sdl_bitblt_to_texture_exact to be more descriptive 2023-02-19 10:07:28 -08:00
Nick Briggs
376b045c33 Use SDL_LowerBlitScaled() rather than SDL_BlitScaled() 2023-02-19 10:07:28 -08:00
Nick Briggs
7048f7dd8d Handle pixel scaling when creating the cursors 2023-02-19 10:07:28 -08:00
Nick Briggs
a5923f42f9 Clean up cursor code
Use the Lisp type DLword where referring to data stored by Lisp
Access the extern EmCursorBitMap68K directly where appropriate.
Use GETBYTE() macro to correct for endian-ness of host system
when accessing the cursor bitmaps.
Cached cursors can use an ordering strategy that only promotes the
found item if it is third or later in the list since in normal
operation Medley is highly likely to flip back-and-forth between
two cursors.
2023-02-19 10:07:28 -08:00
Nick Briggs
355e6dfb51 Reformat to standard with clang-format 2023-02-19 10:07:28 -08:00
Nick Briggs
b166d36ec4 Cleanup, strip some debug/performance code in display update, minor formatting 2023-02-19 10:07:28 -08:00
Nick Briggs
878168f4f5 Implement bitblt to texture at bit level rather than word level, some cleanup
sdl_bitblt_to_texture2 is an experiment, parallel to sdl_bitblt_to_texture
that only moves as many bits as are required, rather than rounding down(up) to the
nearest (16-bit) word boundary for the start(end) of the line.

Introduces some name changes to make things a little clearer.
2023-02-19 10:07:28 -08:00
Nick Briggs
78bcb188a8 Take pixelscale into account when repositioning cursor 2023-02-19 10:07:28 -08:00
Nick Briggs
0600a034b6 Speedups in texture based display path
Instead of checking "do_invert" at each pixel assignment, assign the
foreground and background colors appropriately when responding to the
(VIDEOCOLOR x) call.

Modify sdl_bitblt_to_texture() so that it does less arithmetic in the inner loop,
including using a table of masks rather than computing 1<<n on each pixel.
Modify sdl_bitblt_to_texture() so that it accesses the Lisp display region
16-bits at a time with the correct ordering for whether we are on a byte-swapped
system or not.
2023-02-19 10:07:28 -08:00
Nick Briggs
16e4062b8f When updating the window surface directly, at scale 1, avoid the intermediate buffer
Adds an sdl_blt_to_window_surface() that goes directly from the Lisp bitmap
to the window surface avoiding the intermediate copy.  This is only coded for a
scale factor of 1.  Uses the intermediate buffer if the scale is not 1.

Corrects an error where the damage rectangle was not properly reset.
2023-02-19 10:07:28 -08:00
Nick Briggs
4104219ee5 Avoid intermediate buffer and bitblt Lisp screen changes directly into the texture pixels
Using SDL_LockTexture/SDL_UnlockTexture we can gain more direct access to the pixels of the
texture and update them directly from the Lisp screen bitmap.

At the same time, for both the rendering case and the display surface case,
update the pixel format used to be either the first (presumably preferred?)
format for a texture, or the surface format of the window.

Use the SDL routines to pick out the pixel value for Black and White based on the
destination it will be placed in.
2023-02-19 10:07:28 -08:00
Nick Briggs
74da70d0b4 Introduce alternative method for updating window from Lisp bitmap
If the preprocessor symbol SDLRENDERING is defined the code operates as
it previously did.  In the absence of that, we process the Lisp bitmap
into an intermediate form (as before) but then use SDL bitblt to
redraw the intermediate form on the window's surface.
2023-02-19 10:07:28 -08:00
Nick Briggs
2b957aa8f3 Move display update into separate procedure 2023-02-19 10:07:28 -08:00
Nick Briggs
e5b8248465 Width, but not height, must be multiple of 32 2023-02-19 10:07:28 -08:00
Nick Briggs
fab10fc71f Bounds check indexing into intermediate screen buffer
When building with -DCMAKE_BUILD_TYPE=Debug, we assert() that the
index into the intermediate screen buffer is in bounds.
2023-02-19 10:07:28 -08:00
Nick Briggs
a2f8f23152 Keep damage notification boundaries within the current screen
On startup, bitblt calls may be made for the original screen size
and if the new screen size is smaller than that, we must ensure
that damage notifications are contained within the new screen.

Move definition of min() so we can use it in sdl_notify_damage()
2023-02-19 10:07:28 -08:00
Peter
0e731ce02d Cache cursors for SDL. 2023-02-19 10:07:28 -08:00
Peter
0ed7719343 Change Pixelformat to 332 (one byte) instead of 8888 (four bytes). 2023-02-19 10:07:28 -08:00
Nick Briggs
64e0419af3 Fix "error: implicit declaration of function" from dspsubrs
Creates an sdldefs.h, declares a few more functions in sdl.c static,
and includes sdldefs.h in dspsubrs.c when necessary.
2023-02-19 10:07:28 -08:00
Peter
1db44b1f76 Add support for setting the mouse cursor. Not finished!
Currently this just allocates a new X cursor each time, should be
amended to cache the cursor, just like X does at the moment.
2023-02-19 10:07:27 -08:00