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

1115 Commits

Author SHA1 Message Date
Nick Briggs
68d63cc080 CMake warning: CMAKE_MINIMUM_REQUIRED must preceed PROJECT 2023-05-03 12:49:31 -07:00
Nick Briggs
2474619e83 Cleanup errors introduced resolving rebase conflicts. 2023-02-19 10:43:55 -08:00
Nick Briggs
11c7df5813 Note display subsystem configuration in CMake output. 2023-02-19 10:12:05 -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
4ae1987c33 Teach makeright to compile for SDL display on MacOS on x86_64 CPU 2023-02-19 10:07:28 -08:00
Nick Briggs
8c490df964 Instruct git to ignore SDL object directories for x86_64 builds 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
d2700aa637 Some systems require C99 extensions to get sigset utilities. 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
ca7f09bb6d Minor changes to add missing file for SDL and set no extensions for C compiler
Sets CMAKE_C_EXTENSIONS to OFF as we wish to use c99 *not* gnu99
Adds inc/sdldefs.h to SDL header files list
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
Peter
dbba06d9e1 Add support for inverting video and setting mouse position.
Use (IL:VIDEOCOLOR T/NIL) to change inversion.
2023-02-19 10:07:27 -08:00
Peter
cf8ecc1dd4 Add mouse wheel diagnostics. 2023-02-19 10:07:27 -08:00
Peter
380416fa2d Only update texture on damage. 2023-02-19 10:07:27 -08:00
Peter
6f0ca7ad1c Add support for key repeating. 2023-02-19 10:07:27 -08:00
Peter
7573151be8 For now, some more extern functions declarations. 2023-02-19 10:07:27 -08:00
Peter
083d153d43 Maybe fix cmake for SDL2. 2023-02-19 10:07:27 -08:00
Peter
13d367e766 Remove SDL2 directory from include SDL2/SDL.h. 2023-02-19 10:07:27 -08:00
Peter
af6c6e3e1d Fix Caso. 2023-02-19 10:07:27 -08:00
Peter
2f633f2f50 Try to unify cmake file for different versions of SDL2. 2023-02-19 10:07:27 -08:00
Peter
74d47b07ca Try SDL2::SDL2 instead of SDL2 in CMakeLists.txt. 2023-02-19 10:07:27 -08:00
Peter
292e5dd9b2 Try to placate the macos build. 2023-02-19 10:07:27 -08:00
Peter
71d2d0a5b0 Apparently there is no sdl2 cask for macos :-/ 2023-02-19 10:07:27 -08:00
Peter
d046d26003 Add SDL2 dependency to macos build. 2023-02-19 10:07:27 -08:00
Peter
81e17c0955 Show cmake version before building. 2023-02-19 10:07:23 -08:00
Peter
40b24ec655 Try to make builds pass again. 2023-02-19 10:06:26 -08:00
Peter
5e28babfa5 Run apt-get update before trying to install. 2023-02-19 10:06:26 -08:00
Peter
6604b3dd06 Add support for -t / -title. 2023-02-19 10:06:24 -08:00
Peter
0187073ae0 Revert CMakeLists.txt change until better understanding. 2023-02-19 10:05:18 -08:00
Peter
79903e311e Also *correctly* install SDL2 on ubuntu runners. 2023-02-19 10:05:18 -08:00
Peter
e2e6aa5366 Also install SDL2 on ubuntu runners. 2023-02-19 10:05:18 -08:00