Commit Graph

95 Commits

Author SHA1 Message Date
robxnano
177a297527 Fixed string building for mouse grab hotkey message 2022-09-06 23:23:33 +01:00
robxnano
481b675e1a Try to fix building on SDL 1.2 2022-09-03 14:31:30 +01:00
aarojun
9621850735 Add Render Driver setting to GUI 2021-05-27 23:40:24 +03:00
aarojun
42e70e85c6 Add sdl_vsync setting to GUI 2021-05-27 17:16:35 +03:00
kanjitalk755
623abaa243 prefs item "title" 2021-02-27 18:29:57 +09:00
rakslice
6b4cc38de6 Corresponding header change for BII; cleanup
(cherry picked from commit 36ccf8a46a72b6c970df04bd6ecc60efd0363476)
2020-11-17 05:23:16 -08:00
rakslice
c8c1a76381 prevent truncating unaligned rows in non-vosf mode with 16 colors or less
(cherry picked from commit 9d6124871be79f5c3028ebe3f5d1068dbcea0c84)
2020-11-17 05:23:04 -08:00
rakslice
561f1dfcde For NewWorld ROM, implement the bootdriver setting by reordering the drive queue once CD-ROM drives are added 2020-09-24 19:09:54 -07:00
kanjitalk755
d851a65548 fix gamma ramp when 16-bit color 2020-09-13 23:03:51 +09:00
Seth Polsley
6de9a5032d Splitting mac_pal and mac_gamma to always allow SDL gamma changes 2020-09-13 03:41:23 -05:00
Seth Polsley
40e2d3d84b Removing temp ignoresegv patch 2020-09-10 17:31:21 -05:00
kanjitalk755
09429e6021 SS: Patch the sound input driver if using New World ROM and ignore SEGV is false 2020-09-04 19:06:49 +09:00
kanjitalk755
5b31736785
Merge pull request #45 from spolsley/cdaudio_test
Cross Platform Bin/Cue Support for CD Audio
2020-07-15 14:37:46 +09:00
Seth Polsley
66a69dc79b Refactoring to handle crossplatform bincue support 2020-07-05 23:54:53 -05:00
kanjitalk755
9895200f79 fixed video contstants 2020-06-02 22:49:03 +09:00
rakslice
2a6dc7e328 clean up some warnings 2020-03-17 18:47:02 -07:00
kanjitalk755
700b57d758 added pref item "hotkey"
added MB notation pref item "ramsize"
2018-06-27 19:13:30 +09:00
kanjitalk755
52fe2290fe Linux: change configure defaults to SDL2
MinGW: change SDL1 to SDL2
2018-06-26 21:00:52 +09:00
kanjitalk755
1cd716ee8e Merge commit 'da46a07b7c25996aeda2cf8b49d3b9bf2e08c46f' into mingw32 2018-06-19 10:33:33 +09:00
Alexei Svitkine
bc7edbc677 move STR_WINDOW_TITLE_GRABBED to user_strings.h and fix header
guard for user_strings_unix.h
2017-12-10 11:26:26 -05:00
Andrew Tonner
83ea8b0779 Merge remote-tracking branch 'cebix/master' into windows_build_script_test_merge 2017-01-18 16:49:19 -08:00
Andrew Tonner
b74ae092c9 builds on mingw32 without jit, still untested 2017-01-18 04:41:40 -08:00
Adam Sampson
b44a674d7e Add MacTimeToTime to SheepShaver's macos_util.
Commit e1693eb92b made extfs_unix.cpp
require this function in both BasiliskII and SheepShaver, but only added
the function itself to BasiliskII.
2016-08-20 03:14:21 +01:00
Alexei Svitkine
77862b2103 Update version in version.h too. 2012-07-07 21:25:44 -04:00
Charles
6f2635ee31 More clipboard-related fixes for Basilisk / SheepShaver
This patch fixes one lingering problem with the 64-bit clipboard code; the way it was designed, the Mac clipboard was being cleared every time a single item was being requested by GetScrap, causing clipboards with multiple items to be unceremoniously whittled down to one. On the other hand, a similar issue was causing some items to get duplicated on the host pasteboard. This patch fixes the issue by making conversion between the host pasteboard and the Mac clipboard a singular operation; when the pasteboard data changes on the host side, it is all converted and sent to the Mac pasteboard at once, and similarly, all Mac clipboard data is sent to the host pasteboard in one operation. Also, data from the host side is copied to the Mac clipboard only if it has changed since the last check, which should improve performance as conversions will not be done over and over every time the Mac side checks whether the scrap has changed.

In addition, I've added a rudimentary PICT converter. It's rudimentary at the moment, only going in one direction, converting to PICT and not from PICT, and currently it always rasterizes the source image and creates a PICT containing bitmap data. However, it's a start, and it should solve Ronald's issue with copying images from OS X to Mac OS. In the future, more could possibly be added. I've put the new PICT code in the main source directory instead of in the MacOSX subdirectory, so that it can be used by other platforms if needed.

I would like to leave the license on the new PICT code as "Public Domain" if that is okay.

Thanks,
Charles
2012-07-07 11:30:21 -04:00
CharlesJS
ed28705ee3 Patch for copying and pasting styled text in Basilisk II / SheepShaver
Added code to parse the Classic Mac OS 'styl' resources, allowing formatted text to be copied and pasted out of SheepShaver, not just plain text. In order to do this, I made some changes to the emul_op mechanism, patching ZeroScrap() in addition to the scrap methods that were already being patched. The reason for this is that since we need to read data from multiple items that are on the clipboard at once, we cannot simply assume a zero at the beginning of each PutScrap() operation.

This patch uses RTF to store styled text on the host side; unfortunately, since the APIs to convert to and from RTF data are in Cocoa but not in CoreFoundation, I had to write the new portions in Objective-C rather than C, and changed the extension from .cpp to .mm accordingly. In the future, if we are confident that this file will only be used on Mac OS X 10.6 and up, we can rewrite the Pasteboard Manager code to use NSPasteboardReading/Writing instead. This would allow us to read and write NSAttributedString objects directly to and from the pasteboard, which would make sure we were always using the OS's preferred rich text format internally instead of hard-coding it specifically to RTF as in the current implementation.

I believe that this patch should also fix the problem Ronald reported with copying accented characters.

Since I am new to 68k assembly and the emul_op mechanism, I would appreciate if someone could double-check all my changes to make sure that I have done everything correctly.

Thanks,
Charles
2012-06-30 22:20:55 -04:00
Christian Bauer
ca96911c07 add SheepShaver -> BasiliskII symlinks 2012-06-18 20:02:42 +02:00
cebix
23b0bda1a5 fixed const-ness and compiler warnings 2010-02-21 09:58:47 +00:00
asvitkine
b3b5db5456 [Michael Schmitt]
Attached is a patch to SheepShaver to fix memory allocation problems when OS X 10.5 is the host. It also relaxes the 512 MB RAM limit on OS X hosts.


Problem
-------
Some users have been unable to run SheepShaver on OS X 10.5 (Leopard) hosts. The symptom is error "ERROR: Cannot map RAM: File already exists".

SheepShaver allocates RAM at fixed addresses. If it is running in "Real" addressing mode, and can't allocate at address 0, then it was hard-coded to allocate the RAM area at 0x20000000. The ROM area as allocated at 0x40800000.

The normal configuration is for SheepShaver to run under SDL, which is a Cocoa wrapper. By the time SheepShaver does its memory allocations, the Cocoa application has already started. The result is the SheepShaver memory address space already contains libraries, fonts, Input Managers, and IOKit areas.

On Leopard hosts these areas can land on the same addresses SheepShaver needs, so SheepShaver's memory allocation fails.


Solution
--------
The approach is to change SheepShaver (on Unix & OS X hosts) to allocate the RAM area anywhere it can find the space, rather than at a fixed address.

This could result in the RAM allocated higher than the ROM area, which causes a crash. To prevent this from occurring, the RAM and ROM areas are allocated contiguously.

Previously the ROM starting address was a constant ROM_BASE, which was used throughout the source files. The ROM start address is now a variable ROMBase. ROMBase is allocated and set by main_*.cpp just like RAMBase.

A side-effect of this change is that it lifts the 512 MB RAM limit for OS X hosts. The limit was because the fixed RAM and ROM addresses were such that the RAM could only be 512 MB before it overlapped the ROM area.


Impact
------
The change to make ROMBase a variable is throughout all hosts & addressing modes.

The RAM and ROM areas will only shift when run on Unix & OS X hosts, otherwise the same fixed allocation address is used as before.

This change is limited to "Real" addressing mode. Unlike Basilisk II, SheepShaver *pre-calculates* the offset for "Direct" addressing mode; the offset is compiled into the program. If the RAM address were allowed to shift, it could result in the RAM area wrapping around address 0.


Changes to main_unix.cpp
------------------------
1. Real addressing mode no longer defines a RAM_BASE constant.

2. The base address of the Mac ROM (ROMBase) is defined and exported by this program.

3. Memory management helper vm_mac_acquire is renamed to vm_mac_acquire_fixed. Added a new memory management helper vm_mac_acquire, which allocates memory at any address.

4. Changed and rearranged the allocation of RAM and ROM areas.

Before it worked like this:

  - Allocate ROM area
  - If can, attempt to allocate RAM at address zero
  - If RAM not allocated at 0, allocate at fixed address

We still want to try allocating the RAM at zero, and if using DIRECT addressing we're still going to use the fixed addresses. So we don't know where the ROM should be until after we do the RAM. The new logic is:

  - If can, attempt to allocate RAM at address zero
  - If RAM not allocated at 0
      if REAL addressing
         allocate RAM and ROM together. The ROM address is aligned to a 1 MB boundary
      else (direct addressing)
         allocate RAM at fixed address
  - If ROM hasn't been allocated yet, allocate at fixed address

5. Calculate ROMBase and ROMBaseHost based on where the ROM was loaded.

6. There is a crash if the RAM is allocated too high. To try and catch this, check if it was allocated higher than the kernel data address.

7. Change subsequent code from using constant ROM_BASE to variable ROMBase.


Changes to Other Programs
-------------------------
emul_op.cpp, main.cpp, name_registery.cpp, rom_patches.cpp, rsrc_patches.cpp, emul_ppc.cpp, sheepshaver_glue.cpp, ppc-translate-cpp:
Change from constant ROM_BASE to variable ROMBase.

ppc_asm.S: It was setting register to a hard-coded literal address: 0x40b0d000. Changed to set it to ROMBase + 0x30d000.

ppc_asm.tmpl: It defined a macro ASM_LO16 but it assumed that the macro would always be used with operands that included a register specification. This is not true. Moved the register specification from the macro to the macro invocations.

main_beos.cpp, main_windows.cpp: Since the subprograms are all expecting a variable ROMBase, all the main_*.cpp pgrams have to define and export it. The ROM_BASE constant is moved here for consistency. The mains for beos and windows just allocate the ROM at the same fixed address as before, set ROMBaseHost and ROMBase to that address, and then use ROMBase for the subsequent code.

cpu_emulation.h: removed ROM_BASE constant. This value is moved to the main_*.cpp modules, to be consistent with RAM_BASE.

user_strings_unix.cpp, user_strings_unix.h: Added new error messages related to errors that occur when the RAM and ROM are allocated anywhere.
2009-08-18 18:26:11 +00:00
asvitkine
5b958defa7 support for .sheepvm bundles on macosx, containing "prefs" and "nvram" files 2009-07-23 19:12:51 +00:00
asvitkine
c23511080e [patch from Kelvin Delbarre]
Software cursor mode is now supported, although currently the existing hardware
cursor mode is used whenever possible. (Software mode will be used if you are
running with a recent version of SDL's Quartz video driver, since a bug in SDL
1.2.11 and later prevents the hardware cursor from working properly with that
driver.)

In hardware cursor mode, the hot-spot is now determined heuristically. Formerly
it could not be determined and was always (1,1), an annoyance for many cursors
other than the arrow.

In hardware cursor mode, the cursor will now be hidden when requested by the
emulated OS (such as when you are typing in a text field).

In hardware cursor mode, some cursor image formats that the code does not handle
correctly will now be rejected, causing the emulated OS to revert temporarily to
software cursor mode. Formerly you would just end up with random garbage for a
cursor. This typically happened for grayscale or color cursors; rejecting images
with rowBytes != 2 eliminates the worst cases.
2008-06-25 02:52:52 +00:00
gbeauche
054c37ca0c Happy New Year! 2008-01-01 09:47:39 +00:00
gbeauche
c512377a12 Add 1GB item to GUI 2006-05-14 16:14:29 +00:00
gbeauche
74a5024be4 NQD dirty boxes, generic code
+ while we are at it, also rename a few NQD related NativeOps.
2006-05-13 17:12:18 +00:00
gbeauche
21f35a34f0 Add patches for native GetNamedResource() and Get1NamedResource(). This will
be useful to fix a bug in the AppleShare extension (see DRVR .AFPTranslator
in Basilisk II)

Unrelated improvement: call sheepshaver_cpu::get_resource() directly, don't
get it through another global function.
2006-05-03 21:45:14 +00:00
gbeauche
7a24d4c8b6 Use #pragma pack() on IRIX and enforce a means to pack structs 2005-12-04 15:58:52 +00:00
gbeauche
bc463966c8 V2.3-Pre (snapshot) 2005-11-29 23:48:18 +00:00
gbeauche
4ddc2368d1 add "CD-ROM Drive" label 2005-11-29 20:55:33 +00:00
gbeauche
5a5defb9d8 Build Windows GUI with GTK 2005-11-27 23:54:26 +00:00
gbeauche
b5562ede18 GUI cosmetics from Basilisk II, add missing "slirp" ethernet option 2005-11-27 16:01:59 +00:00
gbeauche
97726bd1e7 Minor tweaks to support compilation of ether.cpp within MacOS. i.e. mostly
migrate the Ethernet driver to the MacOS side. This is enabled for
DIRECT_ADDRESSING cases. I didn't want to alter much of ether.cpp (as it
would have required to support that mode). Of course, in REAL_ADDRESSING
mode (the default) and for debugging purposes, the old driver is still
available.
2005-07-03 22:02:01 +00:00
gbeauche
2cf7fd2a88 First round of patches to increase ethernet code portability. 2005-07-03 08:23:42 +00:00
gbeauche
029d86ce4c Fix build with CodeWarrior in MacOS (9 under SheepShaver ;-) 2005-07-02 22:54:07 +00:00
gbeauche
7cc1bbc7b8 Issue a SysError(dsOldSystem) if we are trying to use MacOS < 8.1.0 with a
NewWorld ROM. That may be 8.1.0 included but original iMac had a NewWorld
ROM compatible system.

Otherwise we will crash because the boot routine is trying to execute code
through unitialized descriptor that points to 0x13ff, which is obviously
wrong (and unaligned on word-boundaries for 68k code).
2005-07-02 17:51:43 +00:00
gbeauche
5810c6a764 Use "screen TYPE/WIDTH/HEIGHT" prefs item by default on Unix systems. The
former options (windowmodes/screenmodes) are migrated if the user uses the
GUI. Also make a note about EXPERIMENTAL state for jit68k.
2005-03-27 22:32:46 +00:00
gbeauche
fbe378f780 Add custom video modes for full screen in unsual resolutions (e.g. 1400x1050).
X11 and SDL infrastructures have yet to be implemented
2005-03-27 13:44:45 +00:00
gbeauche
663facbf97 Fix native Linux/ppc with recent enough glibc that supports TLS; r2 is used
in that case. Tell me if I broke other arches, e.g. r13 is no longer saved
in Video and Ethernet stubs, though it seems to be OK.

Colateral feature: SheepShaver should now run on Linux/ppc64 with relevant
32-bit runtime. Native Linux/ppc64 support is harder as low mem globals are
32-bit in mind and e.g. the TLS register there is %r13, %r2 is the TOC
(PowerOpen/AIX ABI)
2005-02-27 21:52:06 +00:00
gbeauche
df0d5d2a41 Happy New Year 2005! 2005-01-30 21:48:22 +00:00
gbeauche
26314e240e Add InitAll() which covers common initializations so that to avoid duplicate
code and possible bugs (e.g. on BeOS/PPC). Likewise for ExitAll().
2005-01-30 21:19:07 +00:00
gbeauche
f2d7689435 direct addressing fixes to video.cpp way to handle the VSL service owner 2004-12-19 23:05:34 +00:00