Commit graph

92 commits

Author SHA1 Message Date
Peter Schorn
0f6bcb9682 SIMH: Fix spelling errors in comments and strings 2024-07-11 12:29:53 +02:00
Patrick Linstruth
e7b2431f11 VIDEO: Add vid_render_set_logical_size() stub
Fixes oversite of missing sim_video stub function.
2024-07-03 10:54:33 -04:00
Patrick Linstruth
1e4a43d8f8 AltairZ80: Adds Cromemco DAZZLER and JS1 devices
Adds Cromemco Dazzler and JS1 joystick devices
Adds vid_render_set_logical_size() to sim_video.c
2024-06-08 13:55:30 -04:00
B. Scott Michel
1e371e7c98 Memory sanitizer fixes
Fixes suggested by running the Clang memory santizer on the Github CI/CD
pipeline:

- sim_exp_check: Use calloc() to allocate and initialize the PCRE
  captured string offset vector. Also check the offsets to ensure they
  are captured substrings:

  -- If a substring wasn't captured, the offset pair is { -1, -1 }.
     (Of course, this would never happen in SIMH. :-)

  -- Remove the corresponding "_EXPECT_MATCH_GROUP_{pat}" variable
     from the environment when its substring isn't captured.  unsetenv()
     is locally implemented in scp.c, which sets the environment
     variable to an empty string; it isn't actually removed.

  Failure occurs in multiple tests.

- _sim_debug_write_flush: Ensure that debug_line_buf_last's underlying
  buffer is initialized when realloc-ed. (i650 failure.)

- vid_version: Initialize local variables "compiled" and "running". MSan
  claims that these aren't initialized. Reading the SDL  source, the
  patch level might not be initialized on some platforms. (multiple
  sim_video tests.)

NOTE: Do not attempt to run interactive memory-santized simulators on
Linux platforms where ncurses <= 6.2+20201114-2. MSan detects
uninitialized variables within ncurses; newer versions of ncurses fix
them.
2023-07-16 16:35:58 -04:00
Lars Brinkhoff
793149d1bd VIDEO: Include png.h before sim_defs.h.
Older versions of the PNG library header file want to include setjmp.h
and complain if it's already included.
2023-05-11 17:46:40 +02:00
Lars Brinkhoff
783ee136d7 VIDEO: Check whether SDL_WINDOW_RESIZABLE is present.
SDL versions older than 2.0.5 doesn't have this symbol or the
SDL_SetWindowResizable function.
2023-05-11 17:46:40 +02:00
Patrick Linstruth
cf9fac614c AltairZ80: Adds SOL20 and VDM1 devices
This PR adds support for the Processor Technology VDM-1 display adapter and Sol-20 computer system. The VDM-1 was integrated into the Sol-20 but has been separated out into its own device.

This PR adds the following devices to the AltairZ80 simulator:

VDM1 - Processor Technology VDM-1 display adapter
SOL20 - Processor Technology SOL20 with SOLOS ROMs
SOL20K - SOL20 Keyboard (callback from VDM1)
SOL20T - SOL20 Tape (reads/writes cassette file images)
SOL20S - SOL20 Serial Port (TMXR capable)
SOL20P - SOL20 Printer Port (TMXR capable)
2023-03-19 16:47:38 -04:00
Lars Brinkhoff
8e109fe787 VIDEO: Fix bug handling a redraw event.
An event pulled from the queue after redraw has been handled needs to
update the vptr pointer.
2022-10-31 16:46:45 -04:00
Lars Brinkhoff
2a4e4dc10d
Bug fixes for various video code. (#80)
* VIDEO: Fix bug: vid_ready can be used uninitialized.

* VIDEO: Not all events come with a valid windowID.

* PDP11: Fix NG SET TYPE.

The sense of MATCH_CMD is reversed.

* display: Fix bug in NG display controller.

There should be a separate state for each of the eight displays.

* display: Symbolic constant for number of displays.
2022-10-23 11:42:00 -04:00
Paul Koning
75aefcb75c
video: don't disable the screen saver (#57)
This fixes issue #38 by setting the SDL_HINT_VIDEO_ALLOW_SCREENSAVER
hint to 1, leaving the screen saver enabled.  SDL 2.0.2 had changed
the default to disable the screen saver.

Co-authored-by: Paul Koning <ni1d@arrl.net>
2022-09-18 12:21:42 -04:00
Mark Pizzolato
ac955b270d VIDEO: Fix broken beep behavior that caused infinite loop 2022-01-15 11:21:27 -08:00
Lars Brinkhoff
a615b89f11 VIDEO: Fix bug in vid_dst_last handling.
The handling of vid_dst_last and vid_data_last was not updated to work
with multiple windows, which can cause window updates to be lost.
2021-09-04 10:02:49 +02:00
Mark Pizzolato
f95b20e1f3 SCP: Cleanup potential compiler warnings 2021-08-13 09:09:53 -07:00
Lars Brinkhoff
ab48f31317 video: Ignore events from unrecognized windows.
Print information about ignored event.
2021-04-20 18:37:32 +02:00
Lars Brinkhoff
1d613f1f50 VIDEO: Fix use of uninitialized variable. 2021-03-06 09:59:50 +01:00
Lars Brinkhoff
ed4b204584 VIDEO: Allow setting alpha blending mode. 2021-02-27 14:43:18 +01:00
Mark Emmer
10f3a9dea3 VIDEO: Initialize event structure to 0 before waiting for events
No clear reason to do this, given the SDL code path in the call to
SDL_WaitEvent, but initializing at startup adds no overhead and
was reported to help some debugging activities.
2021-02-25 13:30:34 -08:00
Mark Pizzolato
c6710ee054 VIDEO: Silence minor compiler warning 2020-12-02 14:45:41 -08:00
Lars Brinkhoff
970fb8ec95 PDP10, ETHER, VIDEO, VAX: Fix set but unused variables. 2020-11-25 04:50:47 -08:00
Lars Brinkhoff
66a426c48e VIDEO: Add stubs for new APIs. 2020-11-25 09:17:14 +01:00
Lars Brinkhoff
3fc46f3b57 VIDEO: Allow more than one window.
New sim_video APIs have been added to make it possible for a simulator
to open multiple windows.  Two slightly updated functions are:

t_stat vid_open_window (VID_DISPLAY **vptr, DEVICE *dptr, const char *title, uint32 width, uint32 height, int flags);

Like vid_open, but return a dynamically allocated VID_DISPLAY struct
and return it in *vptr.

t_stat vid_close_all (void);

Close all currently opened windows.

In addition, these new functions correspond completely to the old set
of sim_video functions, except the first argument is a VID_DISPLAY
pointer: vid_close_window, vid_map_rgb_window, vid_draw_window,
vid_refresh_window, vid_set_cursor_window, vid_show_video_window,
vid_is_fullscreen_window, vid_set_fullscreen_window,
vid_set_cursor_position_window.
2020-11-24 13:24:43 +01:00
Lars Brinkhoff
6ca7a938ad VIDEO: Stretch frame buffer to accomodate output window. 2020-07-08 08:28:38 +02:00
Lars Brinkhoff
d93bfe62de VIDEO: Add API for querying and setting fullscreen mode. 2020-07-08 08:28:35 +02:00
Mark Pizzolato
337062fcf0 VIDEO: Always raise priority of thread consuming SDL Events 2020-06-13 05:05:11 -07:00
Mark Pizzolato
be117a33bd VIDEO: Move beep and joystick/gamepad init & cleanup into SDL event thread 2020-06-12 22:00:25 -07:00
Mark Pizzolato
973ee4cecb VIDEO: Assure proper initialization sequence in both operating modes
There are two separate running contexts that provide video capabilities:
1) Video event processing threads created on the fly as needed
2) Video events must be run in the context of the initial thread in
    a process.  In this context simulation and SCP runs in a created
    thread and when video activities are enabled needed activities
    are passed back to the primary thread to be handled.
2020-06-12 05:29:36 -07:00
Mark Pizzolato
737f31fea0 VIDEO: Move gamecontroller/joystick cleanup to the right place. 2020-06-11 12:53:28 -07:00
Mark Pizzolato
ebb327bff6 VIDEO: Protect all accesses to last draw buffers
- Cleanup order of gamepad/joystick shutdown to avoid unwinding these
  things while the rendering thread may still reference them.
2020-06-11 07:00:54 -07:00
Mark Pizzolato
9331d14e30 VIDEO: Avoid queuing draw events for identical unprocessed regions 2020-06-10 23:05:54 -07:00
Mark Pizzolato
6c6f66914d VIDEO: Explicitly initialize and cleanup SDL Audio subsystem
As mentioned in #873, there didn't appear to be a problem at runtime,
but the formal definition suggests SDL_InitSubSystem and its cleanup
should be called.  It is likely that, as a vestige of SDL 1.2,
SDL_OpenAudio is doing this under the covers.  No harm adding it.
2020-06-10 07:30:36 -07:00
Mark Pizzolato
0f992e1db7 VIDEO: Remove support for libSDL (prior to libSDL2)
All interesting simh host platforms have long supported libSDL2
functionality which wasn't the case when sim_video was initially
implemented.  The mixed API set significantly complicates maintaining
and extending sim_video, hence this explicit effort to remove
the vestiges  of the old libSDL API.
2020-05-28 11:40:35 -07:00
Lars Brinkhoff
8b64e5df1a VIDEO: SDL init/quit gamecontroller subsystem implies joystick. 2020-02-25 06:38:19 +01:00
Lars Brinkhoff
a562c8727b video: SDL_ControllerButtonEvent button conversion.
Uint8 needs casting to SDL_GameControllerButton.
2020-02-09 13:15:21 -08:00
Lars Brinkhoff
72b89054da video: Add support for SDL joysticks and game controllers. 2020-02-07 16:58:24 +01:00
Lars Brinkhoff
05e4babe24 video: Take address of SDL event union member rather than casting pointer. 2020-02-07 16:58:19 +01:00
Mark Pizzolato
9777e8fa36 VIDEO: Add zlib version to version string (zlib used by png) 2019-12-16 11:21:23 -08:00
Mark Pizzolato
354a1e42ea VIDEO: Add display of versions of dependent libraries (libpng, zlib)
Add specific makefile check for zlib being available
2019-07-30 22:30:03 -07:00
Mark Pizzolato
24ed486222 VIDEO: Fix coverity identified memory allocation failure error check 2019-07-05 09:59:08 -07:00
Matt Burke
4babf7f529 MicroVAX2: Added new video device (VCB02) 2019-04-10 22:01:52 -07:00
Mark Pizzolato
c7b0928b33 SCP: Avoid potential buffer overruns by using strlcpy() and strlcat() 2019-03-08 12:31:01 -08:00
Mark Pizzolato
627c7e3e25 VIDEO: Issue reasonable failure message when SDL can't initialize 2018-07-03 13:58:40 -07:00
Mark Pizzolato
e522daf906 SCP: Replace stray TAB and fix sprintf format specifier 2017-04-23 23:43:14 -07:00
Matt Burke
c94edb6b2d VAXStations: Improvements and bug fixes to keyboard and mouse devices
Whilst working on a new video device I ran into a few problems with the
LKxxx keyboard and I noticed there are already some open issues against
the keyboard and mouse devices. These changes should resolve #320 and
may help with #272 (although I think that is an SDL issue). I've tested these
changes with VWS, UWS and DECwindows with both captured and
uncaptured input modes.
2017-04-23 10:40:00 -07:00
Mark Pizzolato
d741bdc375 VIDEO: Allow SCREENSHOT command to optionally specify bitmap file extension
When PNG support is available, both .png and .bmp screenshots can be
generated based on the file extension specified by the user on the SCREENSHOT
command.  If no extension is specified, then a PNG format screenshot will be
produced.
2016-06-15 00:27:07 -07:00
Mark Pizzolato
a24aba69ae VIDEO: Added priority boost to thread performing SDL processing and updates
Reworked all priority adjustment code to leverage a new
sim_os_set_thread_priority API which is coded to use pthreads or OS
priority adjustment APIs as necessary.
2016-06-11 09:52:33 -07:00
Mark Pizzolato
3743d3d68a VIDEO: Avoid losing mouse button state when coalescing motion events
Identified by @shattered in #321

Added better debug output for keyboard events.
2016-06-11 08:39:25 -07:00
Mark Pizzolato
5531ccb175 ALL: Massive 'const' cleanup
These changes facilitate more robust parameter type checking and helps
to identify unexpected coding errors.

Most simulators can now also be compiled with a C++ compiler without
warnings.

Additionally, these changes have also been configured to facilitate easier
backporting of simulator and device simulation modules to run under the
simh v3.9+ SCP framework.
2016-05-15 15:25:33 -07:00
Mark Pizzolato
717f3820b9 VIDEO: cleanup SHOW VERSION output when video support isn't available. 2016-04-26 20:58:05 -07:00
Mark Pizzolato
aadd66c7c7 VIDEO: Fix uninitialized pointer reference under libSDL
This change fixes issue #276
2016-02-15 12:53:30 -08:00
Mark Pizzolato
51419a2e4b VIDEO: Add ability for a video window Quit event to optionally propagate back to SCP. 2016-01-29 00:30:02 -08:00