1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-11 23:43:19 +00:00

777 Commits

Author SHA1 Message Date
Nick Briggs
32335d5304 Rename sdl_bitblt_to_texture2 to sdl_bitblt_to_texture_exact to be more descriptive 2021-12-20 12:56:11 -08:00
Nick Briggs
e175a69377 Use SDL_LowerBlitScaled() rather than SDL_BlitScaled() 2021-12-10 16:35:19 -08:00
Nick Briggs
f87b1604e5 Handle pixel scaling when creating the cursors 2021-12-06 19:21:10 -08:00
Nick Briggs
88f5729727 Merge branch 'master' into sdl-texture-direct 2021-11-26 19:57:40 -08:00
Nick Briggs
65bbcb7d9d
Remove makepathname() (#410)
makepathname() is only ever called with one of two constant string
arguments, in one case (DOS) such that it only does a strncpy(...),
and the other case (non-DOS) expanding "~" to the current user's home
directory. Additional code duplicates realpath() functionality but is
never used.
maiko-211203
2021-11-26 19:53:26 -08:00
Nick Briggs
ceda3d146e 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.
2021-11-26 18:02:21 -08:00
Nick Briggs
753c7d37a9 Reformat to standard with clang-format 2021-11-23 17:52:37 -08:00
Nick Briggs
ffd86beb52 Cleanup, strip some debug/performance code in display update, minor formatting 2021-11-23 17:45:01 -08:00
Nick Briggs
31a244c0e6 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.
2021-11-20 18:26:50 -08:00
Nick Briggs
2eae377e5f Take pixelscale into account when repositioning cursor 2021-11-17 12:27:13 -08:00
Nick Briggs
00125785be Some systems require C99 extensions to get sigset utilities. 2021-11-15 18:57:51 -08:00
Nick Briggs
c32233b824 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.
2021-11-15 18:38:16 -08:00
Nick Briggs
3091bb2e5a 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
2021-11-15 18:34:01 -08:00
Nick Briggs
fabfca2486 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.
2021-11-09 20:15:00 -08:00
Nick Briggs
e430513d6a 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.
2021-11-09 13:57:25 -08:00
Nick Briggs
184f02d0c1 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.
2021-11-08 22:18:08 -08:00
Nick Briggs
0606015793 Move display update into separate procedure 2021-11-08 22:02:43 -08:00
Nick Briggs
d64e1d1b38 Width, but not height, must be multiple of 32 2021-11-08 21:28:06 -08:00
Nick Briggs
f59e4395b8 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.
2021-11-08 20:40:30 -08:00
Nick Briggs
f7588b8c8e 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()
2021-11-08 18:21:38 -08:00
Peter
241e5fe9a9 Cache cursors for SDL. 2021-11-08 21:10:23 +01:00
Peter
f9d1e51456 Change Pixelformat to 332 (one byte) instead of 8888 (four bytes). 2021-11-08 20:03:28 +01:00
ecraven
c64f8534df
Merge pull request #408 from Interlisp/sdl-fix-implicit-decls
Add proper header for SDL-specific functions with prototypes.
2021-11-08 12:56:47 +01:00
Nick Briggs
ba6e365cc8 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.
2021-11-07 11:26:46 -08:00
Peter
37aed57027 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.
2021-11-07 19:37:33 +01:00
Peter
ecfd4048e0 Add support for inverting video and setting mouse position.
Use (IL:VIDEOCOLOR T/NIL) to change inversion.
2021-11-07 19:37:33 +01:00
Peter
a3fdf18edc Add mouse wheel diagnostics. 2021-11-07 19:37:33 +01:00
Peter
8a872d7d85 Only update texture on damage. 2021-11-07 19:37:33 +01:00
Peter
5413934525 Add support for key repeating. 2021-11-07 19:37:33 +01:00
Peter
784d9f61cb For now, some more extern functions declarations. 2021-11-07 19:37:33 +01:00
Peter
00c4d65aff Maybe fix cmake for SDL2. 2021-11-07 19:37:33 +01:00
Peter
bab9213120 Remove SDL2 directory from include SDL2/SDL.h. 2021-11-07 19:37:33 +01:00
Peter
9bb7fab4a4 Fix Caso. 2021-11-07 19:37:33 +01:00
Peter
bab54bca6a Try to unify cmake file for different versions of SDL2. 2021-11-07 19:37:33 +01:00
Peter
572b94d4a7 Try SDL2::SDL2 instead of SDL2 in CMakeLists.txt. 2021-11-07 19:37:33 +01:00
Peter
e9968a211b Try to placate the macos build. 2021-11-07 19:37:33 +01:00
Peter
e346db4b99 Apparently there is no sdl2 cask for macos :-/ 2021-11-07 19:37:33 +01:00
Peter
f769dbadeb Add SDL2 dependency to macos build. 2021-11-07 19:37:33 +01:00
Peter
56d563983e Show cmake version before building. 2021-11-07 19:37:33 +01:00
Peter
ccfacb23a7 Try to make builds pass again. 2021-11-07 19:37:33 +01:00
Peter
4ee904fd1d Run apt-get update before trying to install. 2021-11-07 19:37:33 +01:00
Peter
ab94538d0c Add support for -t / -title. 2021-11-07 19:37:33 +01:00
Peter
f8fea0b8d8 Revert CMakeLists.txt change until better understanding. 2021-11-07 19:37:33 +01:00
Peter
0d4703086e Also *correctly* install SDL2 on ubuntu runners. 2021-11-07 19:37:33 +01:00
Peter
5c225467ab Also install SDL2 on ubuntu runners. 2021-11-07 19:37:33 +01:00
Peter
8f7067943f Try to get CI running again ;) 2021-11-07 19:37:33 +01:00
Peter
2092a74869 Add command line parameters -sc WxH and -pixelscale n for SDL. 2021-11-07 19:37:33 +01:00
Peter
f198204bca Update CMakeLists.txt for cross-compiling. 2021-11-07 19:37:33 +01:00
Peter
4821dac4c0 Add more #ifdef XWINDOW 2021-11-07 19:37:33 +01:00
Peter
28931acd36 Remove extra directory from includes for SDL. 2021-11-07 19:37:33 +01:00