ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/sysdeps.h
Revision 1.35 - (view) (annotate) - [select for diffs]
2009-08-17T20:42:26Z (15 years, 3 months ago) by asvitkine
Branch: MAIN
CVS Tags: HEAD
Changes since 1.34: +5 -0 lines
Diff to previous 1.34
[Charles Srstka]
Attached is a set of patches to port the precise timer that is currently used in the Linux and BeOS builds of SheepShaver to Mac OS X (and any other Mach-based operating systems).

Currently, the Linux build uses the clock_gettime() function to get nanosecond-precision time, and falls back on gettimeofday() if it is not present. Unfortunately, Mac OS X does not currently support clock_gettime(), and gettimeofday() has only microsecond granularity. The Mach kernel, however, has a clock_get_time() function that does very nearly the same thing as clock_gettime(). The patches to BasiliskII cause the timing functions such as timer_current_time() to use clock_get_time() instead of gettimeofday() on Mach-based systems that do not support clock_gettime().

The changes to SheepShaver involve the precise timer. The existing code for Linux uses pthreads and real-time signals to handle the timing. Mac OS X unfortunately does not seem to support real-time signals, so Mach calls are again used to suspend and resume the timer thread in order to attempt to duplicate the Linux and BeOS versions of the timer. The code is somewhat ugly right now, as I decided to leave alone the pre-existing style of the source file, which unfortunately involves #ifdefs scattered throughout the file and some duplication of code. A future patch may want to clean this up to separate out the OS-specific code and put it all together at the top of the file. However, for the time being, this seems to work.

This has not been extensively tested, because I have not been able to get my hands on a good test-case app for the classic Mac OS that would run inside the emulator and try out the timer. However, performance does seem to be better than with the pre-existing code, and nothing seems to have blown up as far as I can tell. I did find a game via a Google search -  Cap'n Magneto - that is known to have problems with Basilisk/SheepShaver's legacy 60 Hz timer, and the opening fade-to-color for this game appears to run much more smoothly with the precise timer code in place.

Revision 1.34 - (view) (annotate) - [select for diffs]
2008-01-01T09:40:33Z (16 years, 10 months ago) by gbeauche
Branch: MAIN
Changes since 1.33: +1 -1 lines
Diff to previous 1.33
Happy New Year!

Revision 1.33 - (view) (annotate) - [select for diffs]
2005-06-11T06:43:24Z (19 years, 5 months ago) by gbeauche
Branch: MAIN
CVS Tags: nigel-build-17, nigel-build-19
Changes since 1.32: +13 -0 lines
Diff to previous 1.32
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.

Revision 1.32 - (view) (annotate) - [select for diffs]
2005-01-30T21:42:14Z (19 years, 9 months ago) by gbeauche
Branch: MAIN
Changes since 1.31: +1 -1 lines
Diff to previous 1.31
Happy New Year!

Revision 1.31 - (view) (annotate) - [select for diffs]
2004-11-15T23:24:09Z (20 years ago) by gbeauche
Branch: MAIN
Changes since 1.30: +155 -0 lines
Diff to previous 1.30
Fast spinlocks from SheepShaver for X11 clipboard handling

Revision 1.30 - (view) (annotate) - [select for diffs]
2004-06-23T14:30:48Z (20 years, 4 months ago) by gbeauche
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29
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.

Revision 1.29 - (view) (annotate) - [select for diffs]
2004-01-12T15:29:25Z (20 years, 10 months ago) by cebix
Branch: MAIN
CVS Tags: nigel-build-15, nigel-build-16
Changes since 1.28: +1 -1 lines
Diff to previous 1.28
Happy New Year! :)

Revision 1.28 - (view) (annotate) - [select for diffs]
2003-11-21T14:16:02Z (20 years, 11 months ago) by gbeauche
Branch: MAIN
Changes since 1.27: +4 -1 lines
Diff to previous 1.27
fix loff_t & caddr_t type checks

Revision 1.27 - (view) (annotate) - [select for diffs]
2003-11-18T11:14:43Z (21 years ago) by nigel
Branch: MAIN
Changes since 1.26: +4 -0 lines
Diff to previous 1.26
Compile fix for OS X (which does not define loff_t)

Revision 1.26 - (view) (annotate) - [select for diffs]
2002-11-16T15:38:53Z (22 years ago) by gbeauche
Branch: MAIN
CVS Tags: nigel-build-12, nigel-build-13
Changes since 1.25: +1 -1 lines
Diff to previous 1.25
Update ASM_SYM_FOR_FUNC to match x86-64 too, may be useful later.

Revision 1.25 - (view) (annotate) - [select for diffs]
2002-11-05T10:32:05Z (22 years ago) by gbeauche
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24
x86-64 can do unaligned accesses

Revision 1.24 - (view) (annotate) - [select for diffs]
2002-09-16T14:48:53Z (22 years, 2 months ago) by gbeauche
Branch: MAIN
Changes since 1.23: +4 -0 lines
Diff to previous 1.23
#include <pthread.h> to get pthread_attr_t definition

Revision 1.23 - (view) (annotate) - [select for diffs]
2002-09-16T12:03:07Z (22 years, 2 months ago) by gbeauche
Branch: MAIN
Changes since 1.22: +8 -0 lines
Diff to previous 1.22
- Make "ieee" core default, where applicable
- Import gcc configury to determine HOST_FLOAT_FORMAT

Revision 1.22 - (view) (annotate) - [select for diffs]
2002-02-07T16:10:55Z (22 years, 9 months ago) by cebix
Branch: MAIN
Changes since 1.21: +5 -0 lines
Diff to previous 1.21
cleaned up pthread attributes [Brian Johnson]

Revision 1.21 - (view) (annotate) - [select for diffs]
2002-01-15T14:58:37Z (22 years, 10 months ago) by cebix
Branch: MAIN
CVS Tags: snapshot-15012002
Changes since 1.20: +1 -1 lines
Diff to previous 1.20
- documentation updates
- 2001 -> 2002
- version 0.9 -> 1.0

Revision 1.20 - (view) (annotate) - [select for diffs]
2001-07-12T19:48:27Z (23 years, 4 months ago) by cebix
Branch: MAIN
Changes since 1.19: +3 -0 lines
Diff to previous 1.19
- Implemented AppleTalk-over-UDP tunnelling, activated by setting "udptunnel"
  to "true". This uses the BSD socket API, so it's fairly portable (currently
  only imeplemented under Unix, though). This works by sending raw Ethernet
  packets as UDP packets to a fixed port number ("udpport", default is 6066),
  using IP broadcasts to simulate Ethernet broad- and multicasts. Currently
  only tested with AppleTalk.

Revision 1.19 - (view) (annotate) - [select for diffs]
2001-07-06T17:36:08Z (23 years, 4 months ago) by cebix
Branch: MAIN
Changes since 1.18: +0 -3 lines
Diff to previous 1.18
replaced TIME_OFFSET constant by portable TimeToMacTime() function

Revision 1.18 - (view) (annotate) - [select for diffs]
2001-07-03T15:59:47Z (23 years, 4 months ago) by cebix
Branch: MAIN
Changes since 1.17: +0 -2 lines
Diff to previous 1.17
- 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)

Revision 1.17 - (view) (annotate) - [select for diffs]
2001-02-02T20:52:58Z (23 years, 9 months ago) by cebix
Branch: MAIN
CVS Tags: release-0_9-1, snapshot-17022001, snapshot-29052001
Changes since 1.16: +1 -1 lines
Diff to previous 1.16
- bumped version number to 0.9
- updated copyright dates

Revision 1.16 - (view) (annotate) - [select for diffs]
2001-01-28T14:03:19Z (23 years, 9 months ago) by gbeauche
Branch: MAIN
Changes since 1.15: +19 -0 lines
Diff to previous 1.15
- added do_byteswap_16() and do_byteswap_32()

Revision 1.15 - (view) (annotate) - [select for diffs]
2000-11-30T16:20:52Z (23 years, 11 months ago) by cebix
Branch: MAIN
Changes since 1.14: +0 -8 lines
Diff to previous 1.14
- removed USE_MAPPED_MEMORY (unused)
- fixed Delay_usec() on Solaris

Revision 1.14 - (view) (annotate) - [select for diffs]
2000-10-09T17:05:17Z (24 years, 1 month ago) by cebix
Branch: MAIN
Changes since 1.13: +2 -1 lines
Diff to previous 1.13
works again under NetBSD/m68k

Revision 1.13 - (view) (annotate) - [select for diffs]
2000-09-22T17:14:46Z (24 years, 1 month ago) by gbeauche
Branch: MAIN
Changes since 1.12: +26 -1 lines
Diff to previous 1.12
- added [u]intptr types
- set rom protection flag according to the addressing mode used
- set use_prefetch_buffer to 0

Revision 1.12 - (view) (annotate) - [select for diffs]
2000-07-22T18:12:34Z (24 years, 3 months ago) by cebix
Branch: MAIN
Changes since 1.11: +4 -0 lines
Diff to previous 1.11
- improved timing of periodic threads

Revision 1.11 - (view) (annotate) - [select for diffs]
2000-07-13T13:47:11Z (24 years, 4 months ago) by cebix
Branch: MAIN
CVS Tags: snapshot-13072000
Changes since 1.10: +19 -4 lines
Diff to previous 1.10
- first version to run natively on NetBSD/m68k

Revision 1.10 - (view) (annotate) - [select for diffs]
2000-04-10T18:53:08Z (24 years, 7 months ago) by cebix
Branch: MAIN
Changes since 1.9: +1 -1 lines
Diff to previous 1.9
- updated copyright info: 1999->2000

Revision 1.9 - (view) (annotate) - [select for diffs]
1999-11-03T10:56:29Z (25 years ago) by cebix
Branch: MAIN
CVS Tags: release-0_8-1, snapshot-22121999
Changes since 1.8: +10 -3 lines
Diff to previous 1.8
- imported UAE CPU 0.8.10 changes
- new utility functions Mac_memset, Mac2Host_memcpy, Host2Mac_memcpu and
  Mac2Mac_memcpy
- extfs.cpp: fixed bug in fs_rename() and fs_cat_move() (auxiliary IOParam
  block was not in Mac address space)
- some provisions for using UAE CPU compiler (doesn't work yet)

Revision 1.8 - (view) (annotate) - [select for diffs]
1999-10-27T17:50:07Z (25 years ago) by cebix
Branch: MAIN
CVS Tags: snapshot-02111999
Changes since 1.7: +4 -0 lines
Diff to previous 1.7
- provided VAL64() and UVAL64() macros

Revision 1.7 - (view) (annotate) - [select for diffs]
1999-10-27T16:59:48Z (25 years ago) by cebix
Branch: MAIN
Changes since 1.6: +2 -0 lines
Diff to previous 1.6
- imported fixed UAE FPU from Lauri
- extfs.cpp: fixed bug with fsResolveWDCB in fs_get_wd_info()
- ExtFS: MAX_PATH_LENGTH is global, removed third parameter to
  add_path_component()
- rom_patches.cpp: added print_rom_info()
- Unix: added "-rominfo" command line argument
- extfs_unix.cpp: supports finder info and resource forks
- prefs_editor_gtk.cpp: tab widget is no longer scrollable

Revision 1.6 - (view) (annotate) - [select for diffs]
1999-10-21T22:40:03Z (25 years ago) by cebix
Branch: MAIN
Changes since 1.5: +3 -0 lines
Diff to previous 1.5
- ExtFS works under AmigaOS
- fixed erroneous __regargs attributes in prefs_editor_amiga.cpp
  and audio_amiga.cpp for GCC

Revision 1.5 - (view) (annotate) - [select for diffs]
1999-10-19T17:41:38Z (25 years, 1 month ago) by cebix
Branch: MAIN
CVS Tags: snapshot-21101999
Changes since 1.4: +3 -0 lines
Diff to previous 1.4
- added external file system
- moved most init/deinit code to InitAll()/ExitAll() in main.cpp

Revision 1.4 - (view) (annotate) - [select for diffs]
1999-10-18T11:44:20Z (25 years, 1 month ago) by cebix
Branch: MAIN
Changes since 1.3: +1 -1 lines
Diff to previous 1.3
- 680x0 added to list of CPU that can handle unaligned accesses

Revision 1.3 - (view) (annotate) - [select for diffs]
1999-10-12T20:00:54Z (25 years, 1 month ago) by cebix
Branch: MAIN
Changes since 1.2: +1 -0 lines
Diff to previous 1.2
- disk insertions are now checked for by the 60Hz interrupt routine
- localizable strings are split into a common and a platform-specific set
- fixed bug in CR->LF translation in AmigaOS/clip_amiga.cpp

Revision 1.2 - (view) (annotate) - [select for diffs]
1999-10-04T21:07:18Z (25 years, 1 month ago) by cebix
Branch: MAIN
CVS Tags: release-0_7-2
Changes since 1.1: +5 -5 lines
Diff to previous 1.1
- improved configuration and installation

Revision 1.1 - (view) (annotate) - [select for diffs]
1999-10-03T14:16:25Z (25 years, 1 month ago) by cebix
Branch: MAIN
Branch point for: cebix
Initial revision

Convenience Links

Links to HEAD: (view) (annotate) Links to MAIN: (view) (annotate)

Compare Revisions

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.

  Diffs between and
  Type of Diff should be a