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

78 Commits

Author SHA1 Message Date
Nick Briggs
b2a22a8ac8 Updates CMakeLists.txt to add Solaris specific define to ldeint build 2024-11-24 02:45:50 -05:00
Nick Briggs
578b26547a Updates CMakeLists.txt to avoid recreating vdate.c if nothing has changed
Creating vdate.c/vdate.o should not be done unconditionally.  It is only
necessary to recreate it if one of the input files has changed.
2024-11-19 15:20:44 -08:00
Nick Briggs
baeec1b957 Renames bitblt.h to bbtmacro.h and updates all uses 2024-11-07 12:39:55 -08:00
Nick Briggs
99550aaa7c Renames return.h to retmacro.h and updates all uses 2024-11-06 13:31:46 -08:00
Nick Briggs
99601ede75 Removes incorrect dependency on osmsg.h and renames it to osmsgprint.h 2024-11-05 14:57:00 -08:00
Nick Briggs
4f3cb4d326 Removes ether.h and merges Lisp interface structs into lsptypes.h 2024-11-05 14:24:36 -08:00
Nick Briggs
b98e1612d1 Removes tty.h and merges #defines (all local) and Lisp interface structs into tty.c 2024-11-05 14:07:16 -08:00
Nick Briggs
fe71946f82 Removes vmemsave.h and merges #defines (all local, mostly unused) into vmemsave.c 2024-11-05 14:02:27 -08:00
Nick Briggs
c332c71a3e Removes unreferenced xscroll.h (dup of xscrolldefs.h) 2024-11-05 13:56:08 -08:00
Nick Briggs
29e5b374fe Update CMakeLists.txt to suggested syntax for SDL projects. 2024-10-17 14:26:16 -07:00
Nick Briggs
aa4df518a1
Release 201 corrections (#510)
* Fix compilation for maiko version 201

Version 201 does not have BIGVM, so SWA_FNHEAD requires swapx
which is defined in byteswapdefs.h

* Fix compilation for maiko version 201

Version 201 did not have NEWCDRCODING, so the implementation of
N_OP_rplcons requires definitions from gcdata.h and address.h

* Set up makeright etc. to allow for easier compilation of alternate versions

The makeright script and the makefile-* slices it depends are modified
to allow easily specifying the RELEASE version number of the Maiko emulator
to be built.  The default version remains 351, but can be changed with e.g.

RELEASE=201 ./makeright x

The object directories and executables are NOT named with the version.

* Remove unnecessary include of gcdata.h from bbtsub.c

* Users of gcdata.h should include gchtfinddefs.h explicitly if they use gcdata.h macros

* Correct modify_big_reference_count entry parameter type to reflect dependence on GCENTRY size differences between releases

* Add MAIKO_RELEASE to CMake options for building
2024-09-01 16:26:30 -07:00
Nick Briggs
c765ca5cc8
Update SDL dependent code and makefile segments to prepare for SDL3 (#497)
* Update SDL dependent code and makefile segments to prepare for SDL3

Many APIs have changed between SDL2 and SDL3.  This update adds
preprocessor conditionals to adapt the Maiko SDL code to allow selection of
the SDL major version (2 or 3) from the -DSDL=n define.

The SDL3 implementation is currently available as a preview release, 3.1.0, at
   https://github.com/libsdl-org/SDL/releases/tag/prerelease-3.1.0

* Add updates for makefile-haiku.x86_64-sdl to prepare for SDL3

* Allow makeright to accept sdl3 as display type to ease SDL3 experiments

* Update CMakeLists.txt for SDL3 library

 * Replaces configuration option -DMAIKO_DISPLAY_SDL=ON/OFF with
   -DMAIKO_DISPLAY_SDL=OFF/2/3
 * Replaces PUBLIC definitions with PRIVATE definitions on targets since
   we are not exporting definitions outside this local compilation
 * Update messages to indicate which version of SDL is being configured
 * Add fixup for SDL3.xcframework on macOS to compensate for missing
   RPATH specification (CMake issue 25998)
2024-05-21 12:07:13 -07:00
Nick Briggs
b441a28c34
Teach CMake to build ldeinit, update clang-tidy names (#474)
Have CMake build ldeinit when configured for X11 display, and
update the ever-growing list of names under which clang-tidy may
be found (now up to version 16)
2023-08-03 10:20:15 -07:00
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
b265d3a917 Reorganize CMakeLists.txt to put display option selections together. 2023-05-06 13:36:00 -07:00
Nick Briggs
3223ef2839 Remove now unnecessary hdw_conf.h and all references in makefile fragments and CMakeLists.txt 2023-05-05 14:02:30 -07:00
Nick Briggs
6ce6aa25e1 Make X11 default display method for CMake builds when SDL branch merged 2023-05-04 12:40:21 -07:00
Nick Briggs
68d63cc080 CMake warning: CMAKE_MINIMUM_REQUIRED must preceed PROJECT 2023-05-03 12:49:31 -07:00
Nick Briggs
11c7df5813 Note display subsystem configuration in CMake output. 2023-02-19 10:12:05 -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
d2700aa637 Some systems require C99 extensions to get sigset utilities. 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
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
083d153d43 Maybe fix cmake for SDL2. 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
40b24ec655 Try to make builds pass again. 2023-02-19 10:06:26 -08:00
Peter
0187073ae0 Revert CMakeLists.txt change until better understanding. 2023-02-19 10:05:18 -08:00
Peter
8038a959c5 Update CMakeLists.txt for cross-compiling. 2023-02-19 10:03:59 -08:00
Peter
8cf471bec9 Add prototypical SDL support.
Build with cmake. This will create a new backend (ldesdl).
- Resolution can only be set by editing the variables in sdl.c.
- Key repeat does not work.
- Still problems with keysyms that implicitly contain modifiers.
- The entire screen is bitblted onto the SDL display every frame.

Support keyboard, and work on mouse.

Kind of working...

Fix display resolution problems.
2023-02-19 10:00:21 -08:00
devhawala
82577ce951
Dodo Nethub support (#445)
* added support for XNS networking via Dodo-Nethub

* NetHub connection now optional (only if -nh-host is given); released NetHub-related changes to 'ether.c' to the public domain

* Added file using-dodo-networking-with-maiko.md

Documentation for building and using the Dodo-networking addition to Maiko

* Added support for running Maiko unter cygwin/x86_64-x

* Migrate Addr68k/NativeAlignment{2,4} in Nethub code, move timer/async defines to platform.h

* added missing include <netinet/in.h> for FreeBSD

* updated 'compile-flags' with added flags

* splitted ether.c in 3 (_common, _sunos, _nethub)

* reworks/modifications for nbriggs' pull-request review comments

* addintional additions for nbriggs' pull-request review comments

* get the Lisp packet lengths with 'LispInt2CInt'

* renamed variables in dblwordsSwap to indicate it's about double-words

* fixed wrong preprocessor directive unnoticed by clang

* added networking choice option to cmake build, fix to printf warning

- for cmake specify the networking to use with -DMAIKO_NETWORK_TYPE=<type>
- with <type> one of: NONE, SUN_DLPI, SUN_NIT, NETHUB
- e.g.: cmake .. -DMAIKO_NETWORK_TYPE=NETHUB

* integrated improvement to sendPacket() proposed by nbriggs

* integrated fix for SIGBUS on 32-bit big-endian, provided by nbriggs

* MAIKO_ENABLE_ETHERNET should not be unconditionally set on Solaris systems

* Receiving an ethernet packet is an ether interrupt but not an i/o interrupt.

Co-authored-by: dev hawala <devhawala@x.y>
Co-authored-by: Nick Briggs <nicholas.h.briggs@gmail.com>
2022-10-11 14:21:55 -07:00
Krister Joas
0c505f9576
Run the 'mkvdate' script relative to CMAKE_CURRENT_SOURCE_DIR
This fixes the limitation that the build directory has to be in the
source tree and can instead be located anywhere.
2022-08-29 18:18:38 +09:00
Nick Briggs
b94cb8809b Combine three small arithmetic opcode implementation files into one
Combines arith2.c ... arith4.c files and their associated header files
into new arithops.c/arithopsdefs.h files, and adjusts the CMakeLists.txt,
and old-style makefile-tail.  Also updates  makefile-dos,
inlnPS2.h, and inlndos.h to reflect these changes, though these are not
used.
2022-08-10 20:16:59 -07:00
Nick Briggs
601d6e9142 Combine six small array opcode implementation files into one
Combines the array..array6 files and their associated header files
into new arrayops.c/arrayopsdefs.h files, and adjusts the CMakeLists.txt
and old-style makefile-tail to reflect these changes.
2022-08-10 12:54:06 -07:00
Nick Briggs
317f081409
Add missing uraidextdefs.h to CMakeLists.txt (#429) 2022-07-22 10:29:00 -07:00
Nick Briggs
fa08a08648 Update possible names for clang-tidy to include version 13 2022-01-22 14:03:14 -08:00
Nick Briggs
26fe840edf
Convert "mkvdate" into a shell script instead of compiled C code (#411)
For all	systems other than DOS, use a simple shell script to create
the vdate.c (contains version date) that goes into every build.
2021-12-09 12:36:12 -08:00
Nick Briggs
7284e19b32 Suppress clang-tidy warnings for uses of bzero()
The only uses of bzero() in the maiko sources come about because it is used in the macOS
definition of the FD_ZERO() macro in sys/select.h.  Suppress the warning by including
   -clang-analyzer-security.insecureAPI.bzero
in the clang-tidy list of checks.  This may well have been replaced by a memset()
call in more up-to-date macOS releases.
2021-09-03 16:39:29 -07:00
Nick Briggs
377a6f3f47
Rewrite keyboard and async I/O handling to improve performance and reduce dependency on async I/O signals (#392)
* Rewrite keyboard and async I/O handling to improve performance and reduce dependency on async I/O signals

Replaces the SIGIO handler, which used to process X events in the interrupt context, with
a stub routine that sets a flag to signal processing is required.
Actual event processing is moved to the main dispatch loop where Lisp periodic interrupts
are handled.

Removes the X connection file descriptor from the set of fds contributing to SIGIO events
and moves the processing of X events to where the Lisp periodic interrupt is handled in
the main dispatch loop.  This code is already guarded by a check for XPending() so can
be called regardless of whether any file descriptors are known to be ready.

Actual processing of async I/O events and X events are handled by procedures
process_io_events() and process_Xevents() respectively.  For the most part these are
a renaming of getsignaldata() and getXsignaldata().

The Lisp periodic timer (VTALRM) was set to operate with a 25000 us period (40 Hz),
but on modern hardware it is possible to run this timer with a period of 10000 us (100 Hz)

Incidentally, a bug was noted (and fixed) in the X event handling code for motion events:
Mouse motion without any keyboard activity should not add an entry to the keyboard event
ring buffer as these events do not represent a key state change.
Since the ring buffer is of limited size, when it is filled new events are ignored
until the buffered events are processed.  This resulted in the loss of a key/mouse button
transition (up or down) if the mouse was moved about "too much" between keyboard events.

A few incidental cleanups were also made:
  - KBDEventFlg initialization fixed (wrong semantic type)
  - Event_Req renamed to IO_Signalled (more appropriate name)
  - int_io_open() sets up process (self) to handle SIGIO generated by O_ASYNC operations
  - LOCK_X_EVENTS turned off since X library calls can no longer happen in an interrupt context

* Use of O_ASYNC must depend on the symbol being defined (looking at you, Cygwin)

* Add SA_RESTART flag to sigaction for SIGVTALRM periodic interrupt

* LOCK_X_UPDATE is no longer needed and should not be defined by default for Solaris in version.h
2021-09-02 12:42:51 -07:00
Nick Briggs
dbbb59b30b Add clang-tidy to CMakeLists.txt -- run it at compile time if it is found at cmake configuration time 2021-08-29 13:39:07 -07:00
Nick Briggs
e957e331c4
Lock X updates for all systems and lock around X cleanup at exit (#391)
* Lock X updates for all systems and lock around X cleanup at exit

All systems which could generate I/O interrupts on the X file descriptor need
to have locking enabled, or there is a high probability that the X library
will deadlock. This requirement may be removed in the future with restructuring
of the way that the interrupt driven I/O is handled.

Ensure that the appropriate XLOCK/XUNLOCK is done around the X window
closing code.

* Also lock X updates when building with CMake.
2021-08-26 16:29:10 -07:00
Bruce Mitchener
015972c05c
Remove Cldeetr.c. (#340)
This was like `ldeether`, but for SunOS4 with a color display. It
isn't needed any longer as on Solaris, we have `ldeether`, no color
display, and that code already works, unlike this one.
2021-02-09 23:14:51 -08:00
Bruce Mitchener
b21aeecf4c
Remove cdrom&cdaudio support code. (#339)
This is not used in Medley (the MISCN-TABLE-LIST doesn't include
the required constants), nor does anything use or reference this
code. It also won't compile as it needs some routines that are
missing from our code.
2021-02-09 20:38:08 -08:00
Bruce Mitchener
275c5b9c13
Clean up MAIKO_HANDLE_CONSOLE_MESSAGES some. (#331)
* `LOGINT` is only useful when `MAIKO_HANDLE_CONSOLE_MESSAGES`
  is set.
* Only define some variables if `MAIKO_HANDLE_CONSOLE_MESSAGES`
  is set. Flag them as static.
* Remove setting `LOGINT` from the build system as it isn't
  needed because we aren't handling console messages.
2021-01-31 21:22:13 -08:00
Nick Briggs
261069f131
Detect byte order from preprocessor definition (#330)
Rather than having to specify or omit -DBYTESWAP in the Makefile
fragment for each system we can detect whether the system requires
byte swapping  based on the __BYTE_ORDER__ C preprocessor definition.

Update CMakeLists.txt to account for this as well.
2021-01-31 16:56:35 -08:00
Bruce Mitchener
70db63449c
Remove support for the Sun386i. (#329)
This was a machine running SunOS 4, which we no longer support.

It had an odd display controller and a compiler with issues that
required workarounds. Those compiler issues aren't an issue in
today's world, so we don't need to keep the workarounds present
for reference.

It had a bit of inline assembly, but that is still present in
other files for other platforms.
2021-01-31 04:02:40 +00:00
Bruce Mitchener
0efeedd6d3
Remove AIX define from Linux, Cygwin, Solaris, OpenBSD. (#320) 2021-01-28 23:04:57 -08:00
Bruce Mitchener
db1d7ca5ae
cmake: Always build byteswap.c. (#310)
This is used on all platforms, not just ones where we need
byteswapping.
2021-01-27 18:28:43 -08:00
Bruce Mitchener
1753dd16a3
cmake: Improve build structure for multiple display implementations. (#308)
We no longer build a separate `maiko` library that gets linked
into `ldex`. It was the only thing linking it, so now we just
build those files as part of `ldex`.

We only build `ldex` when X11 is requested (which it is by default).

If we add a new display implementation, this structure will support
that by adding a new `ldewhatever` and it will build a new binary
that the `lde` launcher can be updated to support.
2021-01-27 09:48:02 -08:00