Commit Graph

83 Commits

Author SHA1 Message Date
gbeauche
0a7fe2eaf8 Workaround video mode switch problems. IOW, make sure to always allocate
the frame buffer at the same base address.
2007-06-14 14:45:54 +00:00
gbeauche
a2840298b0 - factor out native_byte_order determination
- fix ExpandMap[] when client X image byte order is different than host's
  e.g. { mips, ppc } -> x86 in 8 bpp mode
2006-01-03 22:03:27 +00:00
gbeauche
369d01cf16 %Ld is for long double, not long long (%lld) 2005-06-11 06:52:22 +00:00
gbeauche
0f0b06b099 Much improved responsiveness on NetBSD systems.
On those systems, it's really hard to get high resolution timings and the
system oftens fails to honour a timeout in less than 20 ms. The idea here
is to have an average m68k instruction count (countdown quantum) that
triggers real interrupt checks. The quantum is calibrated every 10 ticks
and has a 1000 Hz resolution on average.
2005-06-11 06:43:24 +00:00
gbeauche
31f80e338b Fix DGA when visible screen is smaller than virtual display, aka fix
fullscreen mode when VidMode extension is enabled. Also fix SDL fullscreen
to really update the screen as this is necessary by default on Linux since
simple windowed is used (and not DGA for fullscreen).

Always prefer the 64 pixel chunks update code.

Rearrange B2 video_x.cpp to match video_vosf.h updates
2005-05-12 11:09:31 +00:00
gbeauche
e8ac4897b6 Enable multiple depths in fullscreen DGA modes, i.e. add 1-bit to 16/32-bit
blitters, rewrite update_display_dga_vosf() to actually work with sub byte
pixels. Factor out update_display_window_vosf() since it's long time that
it is no longer checking for first column and last column that have changed.
2005-03-28 16:14:25 +00:00
gbeauche
04a331e827 Avoid use of pthread_cancel() for redraw thread cancellation. Use an extra
variable to acknowledge cancellation. This avoids Xserver events queue
corruption when clipboard is in use. Concretely, this fixes following errors:
Xlib: unexpected async reply (sequence 0xHEX)!
2005-03-21 23:57:34 +00:00
gbeauche
30632aed4f Happy New Year! 2005-01-30 21:42:16 +00:00
gbeauche
61e223471b Force use of MacX mappings with Apple's X server 2004-12-18 19:28:33 +00:00
gbeauche
ce67261af4 lock X11 display better around update_display_window_vosf() 2004-11-15 23:40:23 +00:00
gbeauche
e85f4397c8 Backport copy-paste of 'TEXT' from SheepShaver 2004-11-15 23:27:43 +00:00
gbeauche
e3c5f1769d Enable 33-bit memory addressing on 64-bit JIT capable platforms (e.g. x86-64).
This is useful to get rid of address offset sign extensions. It uses POSIX
shared memory to create aliased regions, fallback to usual sign-extension
way if shm_open et al. don't work (e.g. no /dev/shm mounted)
2004-11-08 21:07:07 +00:00
gbeauche
19494038b3 Initial SDL/video support. Fix VOSF code could lead to a crash on run-time
resolution/depth switching. Rearrange blitter lookup code, aka make it cleaner.
2004-06-23 14:30:48 +00:00
cebix
9e7932abf0 Happy New Year! :) 2004-01-12 15:29:31 +00:00
gbeauche
548e5a3dfd Rearrange video_vosf.h to accomodate both SheepShaver and BasiliskII video
infrastructure. Make video_blit.cpp a little more emulator independent.
2003-05-22 22:13:56 +00:00
gbeauche
98d1246815 - Let fullscreen DGA mode work again, even with a DirectColor visual. In
that case, we do need add it when creating the window otherwise we
  result int a nice BadMatch for X_CreateWindow request. FIXME?
- Fix typo and do enable VOSF in DGA mode, if necessary.
2002-09-28 12:42:39 +00:00
cebix
00a32a9afb fixed compilation problem in fbdev code 2002-04-28 12:09:23 +00:00
cebix
8871da753d - added infrastructure for multi-monitor support; only video_x.cpp is
converted for the new scheme; not actually tested with a mult-monitor
  setup yet but at least single-monitor display doesn't seem to be broken
  (UAE banked addressing would definitely require some extensions to handle
  multiple frame buffers)
- struct video_mode has an extra field that is free for use by platform-
  specific code
2002-04-25 11:00:31 +00:00
cebix
78254ebddd added missing return values 2002-03-20 19:03:41 +00:00
cebix
7627f346ee cleaned up pthread attributes [Brian Johnson] 2002-02-07 16:10:57 +00:00
cebix
628533940d - documentation updates
- 2001 -> 2002
- version 0.9 -> 1.0
2002-01-15 14:58:43 +00:00
gbeauche
55df210d27 - video_x.cpp: the_buffer shall always be mapped through vm_alloc() so
that it can be vm_protect()'ed at will afterwards
- video_x.cpp: let driver_base free() the_buffer_copy and the_host_buffer,
  if necessary
- video_vosf.h: reverted to use malloc() for mainBuffer.dirtyPages and
  mainBuffer.pageInfo
- vm_alloc.cpp: small cleanups
- fixed typos
2001-07-14 18:41:05 +00:00
cebix
20db0c7260 - 1-bit mode under X11 always uses default visual
- fixed possible crash in driver_window dtor (image data would be freed twice,
  once by XDestroyImage() and once in driver_base dtor)
- fixed compilation problems with banked memory
- fixed typos
2001-07-14 15:02:49 +00:00
cebix
90c7198b75 fixed a couple of compiler warnings 2001-07-11 19:26:14 +00:00
cebix
5fa9b2abe9 - find_visual_for_depth() did not return true on success 2001-07-11 17:04:41 +00:00
cebix
456830630c - background_pixel, border_pixel and colormap attributes of window are now
always set as this seems to be required for non-default visuals
2001-07-10 15:50:57 +00:00
cebix
5868a40a37 - ADB has its own interrupt flag, INTFLAG_ADB
- ADBMouseMoved(), ADBMouseDown/Up() and ADBKeyDown/Up() trigger the ADB
  interrupt
- ADB mutex is only used for mouse movement (the only input state where it
  matters)
- adb.cpp: toggling relative mouse mode resets mouse_x/y
- PrimeTime(0) schedules a timer task with 0 delay time; this is still not
  the correct implementation, but it makes MacSyndicate work...
- Unix: pthreads are preferred to POSIX.4 timers for 60Hz ticks because the
  timers drift badly under Linux and the thread can compensate for drifting
  well enough
- Unix: moved GetTicks_usec() and Delay_usec() to timer_unix.cpp
- video_x.cpp: X mouse acceleration is disabled in relative mouse mode because
  MacOS does its own acceleration
- video_x.cpp: palette[].pixel and palette[].flags are always preset
- video_x.cpp: decoupled X event handling from 60Hz video refresh cycle by
  using select() with a timeout on the X fd
2001-07-09 11:22:01 +00:00
gbeauche
8d733ed691 - added video_vosf_init()/video_vosf_exit() for initialization and destruction
of the internal structures used for the VOSF system
- use vm_acquire()/vm_release() for VOSF buffers and hope the_buffer is
  allocated above RAM address space (temporary workaround for 64-bit
  addressing systems)
- don't free() screen buffers in driver_base dtor
- don't free() memory mapped buffers in driver_base dtor
2001-07-07 09:14:47 +00:00
cebix
64eb0dcad1 fixed memory leaks in video mode switching 2001-07-06 22:37:23 +00:00
cebix
0e7b5acffe added support for 2/4-bit modes on 8-bit visuals 2001-07-06 22:00:39 +00:00
cebix
1186b42a20 - an appropriate visual is selected for the requested Mac color depth
- the list of supported Mac color depths is constructed from the list of
  depth and visuals supported by the X server
2001-07-06 20:49:53 +00:00
cebix
d0a4b3e5fc - improved compatibility of multiple depth/resolution handling with versions
of MacOS before 7.6:
   - Apple mode IDs are now allocated contiguously from 0x80 (the video_*.cpp
     module must call video_init_depth_list() after adding all modes)
   - if the video driver didn't receive a GetVideoParameters call, it patches
     ScrnBase and the main GDevice upon a video mode switch (otherwise MacOS
     will continue to use the old frame buffer base)
   - the rowBytes values in the video parameters slot resources are correct
     for all bit depths
2001-07-03 19:20:47 +00:00
cebix
cf22cb032a - added support for platform-independant mutexes, currently only properly
implemented under Unix
- adb.cpp uses mutexes for thread-safe mouse handling
- video_x.cpp: pressing Ctrl-F5 in windowed mode switches to a "grabbed"
  relative mouse mode, useful for some games
- video_x.cpp: fixed some bugs relating to the hotkeys (key releases are no
  longer treated as hotkeys)
2001-07-03 15:59:49 +00:00
cebix
5bd08dac88 - video_set_palette() gets passed the number of used palette entries
- video_x.cpp supports 2- and 4-bit modes on truecolor screens
2001-07-01 21:09:30 +00:00
cebix
f4243a191b added support for 8-bit windowed modes on 16 and 32-bit screens (for the
games, man, the games! :-)
2001-07-01 19:57:55 +00:00
cebix
af35353cf0 - sony.cpp/disk.cpp/cdrom.cpp use vector<> of drive_info objects instead of
linked list
- color depth switching updates slot ROM
- video_x.cpp always supports 1-bit window modes
- timer_create()/clock_gettime() are pulled from librt if present
2001-07-01 14:38:03 +00:00
cebix
a4b36fd674 - added some documentation
- VidLocal.sp -> VidLocal.slot_param
- X11 color map is loaded with ramp upon startup to avoid the annoying black
  screen during initialization
2001-07-01 00:46:38 +00:00
cebix
50520dcf2f gamma tables work with X11 2001-06-30 22:23:44 +00:00
cebix
a3ea4f3ead - fixed compilation problems in fbdev DGA code
- nicer "about" dialog in GTK prefs editor
- display refresh is inhibited during mode switch if !HAVE_PTHREADS
2001-06-30 20:18:36 +00:00
cebix
b0b21f7fe6 - experimental gamma table support
- restructured video_x.cpp: uses classes for display types
2001-06-30 17:21:56 +00:00
gbeauche
d011594d4e zero_fd is not longer used since vm_alloc.cpp should handle that correctly.
However, vm_init() and vm_exit() are called in main_unix.cpp to ensure proper
initialization of the internal zero_fd descriptor, if needed. i.e. no
anonymous mapping for mmap()-based memory allocation.
2001-06-28 22:06:18 +00:00
cebix
0cf3f32b7d video_x.cpp supports resolution switching in windowed mode: the available
resolutions are 512x384, 640x480, 800x600, 1024x768 and 1280x1024 (the prefs
editor has to be updated to reflect this). The resolution selected in the
prefs editor is used as the default, but it can be changed in the Monitors
control panel. So far only tested with direct addressing.
2001-06-28 21:20:02 +00:00
cebix
0fe2584d92 depth/resolution switching infrastructure should be complete now; slot ROM
contains all supported depths, default mode is stored in XPRAM upon startup,
and added video_switch_to_mode() call (currently unimplemented in all drivers)
2001-06-27 20:05:31 +00:00
cebix
1be8a821a8 added infrastructure for resolution/depth switching (currently, all video
drivers only support one mode, the one selected by the user)
2001-06-27 19:03:38 +00:00
gbeauche
dae4fb627c - added SIGSEGV support for Linux/Alpha (to be checked), Darwin/PPC
- added uniform virtual memory allocation
  (supports mmap(), vm_allocate(), or fallbacks to malloc()/free())
- cleaned up memory allocation in main_unix.cpp
2001-06-26 22:35:42 +00:00
gbeauche
98192c4ba9 - new and updated SIGSEGV support functions:
+ configure script cleanups
  + possible support for Direct Addressing / VOSF on other platforms
2001-05-20 20:31:50 +00:00
cebix
4d5028655f added patches from Brian J. Johnson (better VOSF performance and responsiveness) 2001-03-06 18:41:12 +00:00
gbeauche
e94d644b19 Mainly changes to the VOSF code:
- improved blitters selection
- improved blitters performance if UNALIGNED_PROFITABLE is set
- cleaned up 8 bpp blitters
2001-01-28 14:05:19 +00:00
gbeauche
252d602e96 - Cleaned up some comments again
- The dirtyPages[] array overrun conditions should be really safe now
2001-01-11 18:00:40 +00:00
gbeauche
d583307d6b - Cleaned up the process for determining the ranges of pages touched
that have to be blitted onto the screen (find_next_page_set() and
  find_next_page_clear() functions)
- Cleaned up some comments
Changes from Brian J. Johnson
- Fixed mainBuffer.dirtyPages[] array overrun in VOSF code
- Fixed calculation of the frames-per-second value
2001-01-11 16:38:48 +00:00