Commit Graph

133 Commits

Author SHA1 Message Date
asvitkine
732029a512 Fix various compiler warnings with Xcode builds. 2022-04-04 23:44:30 -04:00
kanjitalk755
33c3419b08 SS: append --config command line option 2022-01-26 13:43:08 +09:00
kanjitalk755
2a5ac90370 SS: Change ROM_BASE address 2022-01-24 15:57:36 +09:00
kanjitalk755
20d2de95ce marged Jagmn's patch
https://emaculation.com/forum/viewtopic.php?p=70121#p70121
2021-04-23 10:19:48 +09:00
kanjitalk755
ccf38a4005 condition modified 2020-02-07 11:16:59 +09:00
kanjitalk755
1a875b1c10 in case backend is not X 2020-02-07 11:04:02 +09:00
kanjitalk755
19033a4a39 same fix for SS 2020-02-01 20:44:32 +09:00
kanjitalk755
03a92c7815 append pref item cpuclock 2019-01-16 19:44:09 +09:00
kanjitalk755
e760d289b2 SS adjust minimum ramsize 2018-07-09 19:24:52 +09:00
kanjitalk755
700b57d758 added pref item "hotkey"
added MB notation pref item "ramsize"
2018-06-27 19:13:30 +09:00
kanjitalk755
949e07e4eb fix for linux build 2018-06-23 14:59:07 +09:00
kanjitalk755
a76069f879 View menu removed 2018-06-21 15:21:56 +09:00
kanjitalk755
7f8ddaeacf in case using SDL1
fix merge error of configure.ac
2018-06-18 18:42:19 +09:00
kanjitalk755
ccb11c0d7a fixed initial chdir 2018-06-16 21:42:43 +09:00
kanjitalk755
03dda6db82 host menu re-correct 2018-06-16 17:38:57 +09:00
kanjitalk755
f053fda3c8 fix for sheepvm 2018-06-16 13:33:13 +09:00
kanjitalk755
8d89152b79 set current directory 2018-06-15 21:57:59 +09:00
kanjitalk755
33a5112968 remove keyboard shortcut of host menu 2018-06-14 22:03:17 +09:00
kanjitalk755
a98054215e SDL related fix
update project files
add a pref
2018-06-14 18:26:27 +09:00
kanjitalk755
d247c35d58 Merge commit '2e302d60a337daa252c6992335e6365a9beac83f' 2018-06-08 14:11:27 +09:00
Alexei Svitkine
b150b42fc6 Fix some string conversion warnings. 2017-12-10 11:27:08 -05:00
kanjitalk755
5c4466b841 fix #1 2017-12-04 22:43:51 +09:00
kanjitalk755
aaeb0dd5eb revert vm_protect of ROM area 2017-11-24 21:40:06 +09:00
kanjitalk755
0903a3adfd offset error fixed 2017-11-24 21:07:07 +09:00
kanjitalk755
f170a527b2 64-bit JIT 2017-11-22 11:27:42 +09:00
kanjitalk755
5065fb9d95 64-bit build for 10.10+ 2017-11-17 21:43:36 +09:00
Dave Vasilevsky
e3710843b1 FreeBSD amd64 fixups
* Look for CPU named "amd64" as well as "x86_64"
* Don't use /dev/ptmx on FreeBSD
* On amd64 FreeBSD uses SIGSEGV, not SIGBUS
* Use MAP_FIXED to force allocations within 32-bits, it's the only way
* Need <sys/param.h> for SHMLBA
* The old offsetof() fix is no longer needed
* Preliminary work on instruction skipping
2013-05-30 21:34:30 -04:00
Dave Vasilevsky
d23a421a49 Work even if TRUE is undefined 2013-03-27 03:38:59 -04:00
Alexei Svitkine
407edc8bfd Cleanup shm cleanup code. 2012-09-02 11:29:16 -04:00
Alexander von Gluck IV
5dc5f50d46 UNIX main: don't set int to NULL 2012-06-18 20:33:30 -04:00
asvitkine
c13fd620a1 fix some unused vars warnings 2012-03-01 04:25:10 +00:00
asvitkine
f68b4c1152 remove some code that was accidentally committed 2012-01-01 23:18:36 +00:00
asvitkine
60779756ab better cleanup of shared memory on failure 2012-01-01 19:11:31 +00:00
asvitkine
84a6ec3a05 wrap init_sdl() in USE_SDL ifdef 2012-01-01 18:51:40 +00:00
asvitkine
df4342b6db fix compile error introduced by my recent refactoring 2012-01-01 18:50:01 +00:00
asvitkine
78ea64bbd9 fix ppc build breakage 2011-12-30 17:38:39 +00:00
asvitkine
c78c3046db refactor init_sdl() into a function 2011-12-28 23:33:04 +00:00
asvitkine
d58da945c6 refactor install_signal_handlers() into its own function 2011-12-28 23:30:25 +00:00
asvitkine
7930deea4d refactor load_mac_rom() into a function 2011-12-28 23:24:30 +00:00
asvitkine
cea73a29ed refactor get_system_info() into a function 2011-12-28 23:17:29 +00:00
asvitkine
97c7aa5756 delete unused vars 2011-12-28 20:21:40 +00:00
asvitkine
faadf4cbb1 correct whitespace 2011-12-26 22:44:22 +00:00
asvitkine
18729e6f07 [Douglas Mencken]
Add recognition for 970MP processors.

I took these values from this kernel patch from year 2005:
http://lists.ozlabs.org/pipermail/linuxppc64-dev/2005-July/004688.html
2011-12-26 22:41:53 +00:00
asvitkine
8a062fefdc fix printf safety warning 2010-08-22 18:57:11 +00:00
asvitkine
15b346b031 use setenv in preference of putenv 2010-08-22 18:56:11 +00:00
cebix
4f28f70207 fixed warnings 2010-02-21 09:59:52 +00:00
asvitkine
868bb283d2 [Michael Schmitt]
Attached is a patch to SheepShaver, to fix a problem where the ROM file can only be found on the first boot.

When a user creates a new SheepShaver machine, there is no preference file, so there is not ROM path preference. SheepShaver has logic so that in this case, it will look for a ROM file named "ROM" or "Mac OS ROM" in the current directory.

The user starts SheepShaver in order to get to the built-in Preferences Editor, and changes various settings (such as creation of a hard disk). Then the user reboots.

If the user forgot to set the ROM path at this time, then SheepShaver can no longer boot. The only recourse is for the user to find and delete the preferences file, or use an external preferences editor to set the ROM path.

The fix is to change SheepShaver to use the default ROM names when either the rom path is null (no preference) OR an empty string (preference exists with no rom path).
2009-08-26 00:11:56 +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
a98f16a1bd support both foo.sheepvm and foo.sheepvm/ command-line parameters 2009-08-18 02:36:59 +00:00
asvitkine
5b958defa7 support for .sheepvm bundles on macosx, containing "prefs" and "nvram" files 2009-07-23 19:12:51 +00:00