Merge branch 'kanjitalk755_master' into gamma

This commit is contained in:
rakslice 2020-08-18 04:48:28 -07:00
commit ba111a5cb7
61 changed files with 1841 additions and 3441 deletions

View File

@ -2499,6 +2499,14 @@ static bool arm_skip_instruction(unsigned long * regs)
}
#endif
#ifdef _STRUCT_ARM_THREAD_STATE64
static bool aarch64_skip_instruction(unsigned long *regs) {
_STRUCT_ARM_THREAD_STATE64 *ts = (_STRUCT_ARM_THREAD_STATE64 *)regs;
if (!ts->__pc) return false;
ts->__pc += 4;
return true;
}
#endif
// Fallbacks
#ifndef SIGSEGV_FAULT_ADDRESS_FAST

View File

@ -105,6 +105,22 @@ extern "C" {
#define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction
#define SIGSEGV_REGISTER_FILE ((SIGSEGV_REGISTER_TYPE *)&SIP->thr_state.MACH_FIELD_NAME(rax)) /* RAX is the first GPR we consider */
#endif
#ifdef __aarch64__
#if __DARWIN_UNIX03 && defined _STRUCT_ARM_THREAD_STATE64
#define MACH_FIELD_NAME(X) __CONCAT(__,X)
#endif
#define SIGSEGV_EXCEPTION_STATE_TYPE arm_exception_state64_t
#define SIGSEGV_EXCEPTION_STATE_FLAVOR ARM_EXCEPTION_STATE64
#define SIGSEGV_EXCEPTION_STATE_COUNT ARM_EXCEPTION_STATE64_COUNT
#define SIGSEGV_FAULT_ADDRESS SIP->exc_state.MACH_FIELD_NAME(far)
#define SIGSEGV_THREAD_STATE_TYPE arm_thread_state64_t
#define SIGSEGV_THREAD_STATE_FLAVOR ARM_THREAD_STATE64
#define SIGSEGV_THREAD_STATE_COUNT ARM_THREAD_STATE64_COUNT
#define SIGSEGV_REGISTER_FILE ((SIGSEGV_REGISTER_TYPE *)&SIP->thr_state.MACH_FIELD_NAME(x[0])) /* x[0] is the first GPR we consider */
#define SIGSEGV_SKIP_INSTRUCTION aarch64_skip_instruction
#endif
#ifdef __x86_64__
#define SIGSEGV_FAULT_ADDRESS_FAST (((uint64_t)code[1])|0x100000000)
#else

View File

@ -222,6 +222,13 @@ void vm_exit(void)
#endif
}
static void *reserved_buf;
static const size_t RESERVED_SIZE = 64 * 1024 * 1024; // for 5K Retina
void *vm_acquire_reserved(size_t size) {
return reserved_buf && size <= RESERVED_SIZE ? reserved_buf : VM_MAP_FAILED;
}
/* Allocate zero-filled memory of SIZE bytes. The mapping is private
and default protection bits are read / write. The return value
is the actual mapping address chosen or VM_MAP_FAILED for errors. */
@ -243,11 +250,13 @@ void * vm_acquire(size_t size, int options)
#if defined(HAVE_MACH_VM)
// vm_allocate() returns a zero-filled memory region
kern_return_t ret_code = vm_allocate(mach_task_self(), (vm_address_t *)&addr, size, TRUE);
kern_return_t ret_code = vm_allocate(mach_task_self(), (vm_address_t *)&addr, reserved_buf ? size : size + RESERVED_SIZE, TRUE);
if (ret_code != KERN_SUCCESS) {
errno = vm_error(ret_code);
return VM_MAP_FAILED;
}
if (!reserved_buf)
reserved_buf = (char *)addr + size;
#elif defined(HAVE_MMAP_VM)
int fd = zero_fd;
int the_map_flags = translate_map_flags(options) | map_flags;

View File

@ -99,6 +99,8 @@ extern void vm_exit(void);
extern void * vm_acquire(size_t size, int options = VM_MAP_DEFAULT);
extern void * vm_acquire_reserved(size_t size);
/* Allocate zero-filled memory at exactly ADDR (which must be page-aligned).
Returns 0 if successful, -1 on errors. */

View File

@ -51,23 +51,23 @@ void AudioDevice::Init(AudioDeviceID devid, bool isInput)
UInt32 propsize;
propsize = sizeof(UInt32);
verify_noerr(AudioDeviceGetProperty(mID, 0, mIsInput, kAudioDevicePropertySafetyOffset, &propsize, &mSafetyOffset));
__Verify_noErr(AudioDeviceGetProperty(mID, 0, mIsInput, kAudioDevicePropertySafetyOffset, &propsize, &mSafetyOffset));
propsize = sizeof(UInt32);
verify_noerr(AudioDeviceGetProperty(mID, 0, mIsInput, kAudioDevicePropertyBufferFrameSize, &propsize, &mBufferSizeFrames));
__Verify_noErr(AudioDeviceGetProperty(mID, 0, mIsInput, kAudioDevicePropertyBufferFrameSize, &propsize, &mBufferSizeFrames));
propsize = sizeof(AudioStreamBasicDescription);
verify_noerr(AudioDeviceGetProperty(mID, 0, mIsInput, kAudioDevicePropertyStreamFormat, &propsize, &mFormat));
__Verify_noErr(AudioDeviceGetProperty(mID, 0, mIsInput, kAudioDevicePropertyStreamFormat, &propsize, &mFormat));
}
void AudioDevice::SetBufferSize(UInt32 size)
{
UInt32 propsize = sizeof(UInt32);
verify_noerr(AudioDeviceSetProperty(mID, NULL, 0, mIsInput, kAudioDevicePropertyBufferFrameSize, propsize, &size));
__Verify_noErr(AudioDeviceSetProperty(mID, NULL, 0, mIsInput, kAudioDevicePropertyBufferFrameSize, propsize, &size));
propsize = sizeof(UInt32);
verify_noerr(AudioDeviceGetProperty(mID, 0, mIsInput, kAudioDevicePropertyBufferFrameSize, &propsize, &mBufferSizeFrames));
__Verify_noErr(AudioDeviceGetProperty(mID, 0, mIsInput, kAudioDevicePropertyBufferFrameSize, &propsize, &mBufferSizeFrames));
}
int AudioDevice::CountChannels()
@ -92,6 +92,6 @@ int AudioDevice::CountChannels()
char * AudioDevice::GetName(char *buf, UInt32 maxlen)
{
verify_noerr(AudioDeviceGetProperty(mID, 0, mIsInput, kAudioDevicePropertyDeviceName, &maxlen, buf));
__Verify_noErr(AudioDeviceGetProperty(mID, 0, mIsInput, kAudioDevicePropertyDeviceName, &maxlen, buf));
return buf;
}

View File

@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
5D5C3B0A24B2DF3500CDAB41 /* bincue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D5C3B0924B2DF3400CDAB41 /* bincue.cpp */; };
752F26F91F240E51001032B4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 752F26F81F240E51001032B4 /* Foundation.framework */; };
752F26FB1F240E69001032B4 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 752F26FA1F240E69001032B4 /* IOKit.framework */; };
752F27011F242BAF001032B4 /* prefs_sdl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 752F27001F242BAF001032B4 /* prefs_sdl.cpp */; };
@ -49,7 +50,6 @@
7539E1E11F23B25A006B2DF2 /* user_strings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7539E1221F23B25A006B2DF2 /* user_strings.cpp */; };
7539E1E21F23B25A006B2DF2 /* video.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7539E1231F23B25A006B2DF2 /* video.cpp */; };
7539E1E31F23B25A006B2DF2 /* xpram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7539E1241F23B25A006B2DF2 /* xpram.cpp */; };
7539E23F1F23B32A006B2DF2 /* bincue_unix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7539E1F01F23B329006B2DF2 /* bincue_unix.cpp */; };
7539E24A1F23B32A006B2DF2 /* disk_sparsebundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7539E1FD1F23B32A006B2DF2 /* disk_sparsebundle.cpp */; };
7539E2681F23B32A006B2DF2 /* rpc_unix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7539E2241F23B32A006B2DF2 /* rpc_unix.cpp */; };
7539E26C1F23B32A006B2DF2 /* sshpty.c in Sources */ = {isa = PBXBuildFile; fileRef = 7539E22A1F23B32A006B2DF2 /* sshpty.c */; };
@ -97,6 +97,10 @@
E4555EED2354434B00139FCE /* Credits.html in Resources */ = {isa = PBXBuildFile; fileRef = 7539E00A1F23B25A006B2DF2 /* Credits.html */; };
E490334E20D3A5890012DD5F /* clip_macosx64.mm in Sources */ = {isa = PBXBuildFile; fileRef = E490334D20D3A5890012DD5F /* clip_macosx64.mm */; };
E4D8245323543D9800849B78 /* fpu_ieee.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4D8245223543D9700849B78 /* fpu_ieee.cpp */; };
E4ED8EDE24E39AFE00843219 /* compemu_support.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4ED8EDD24E39AFE00843219 /* compemu_support.cpp */; };
E4ED8EE224E39BC400843219 /* compemu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4ED8EE024E39BC400843219 /* compemu.cpp */; };
E4ED8EE324E39BC400843219 /* compstbl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4ED8EE124E39BC400843219 /* compstbl.cpp */; };
E4ED8EE524E39C0D00843219 /* compemu_fpp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4ED8EE424E39C0D00843219 /* compemu_fpp.cpp */; };
E4EE777523D7D71400BAE63A /* defs68k.c in Sources */ = {isa = PBXBuildFile; fileRef = E417913123D7D67C0009AD63 /* defs68k.c */; };
/* End PBXBuildFile section */
@ -115,6 +119,15 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
5D5C3B0924B2DF3400CDAB41 /* bincue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bincue.cpp; path = ../bincue.cpp; sourceTree = "<group>"; };
5D5C3B0B24B2DF4200CDAB41 /* bincue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bincue.h; sourceTree = "<group>"; };
5DDE95122255D075004D0E79 /* AudioBackEnd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioBackEnd.h; sourceTree = "<group>"; };
5DDE95132255D076004D0E79 /* AudioDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioDevice.cpp; sourceTree = "<group>"; };
5DDE95142255D076004D0E79 /* AudioDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioDevice.h; sourceTree = "<group>"; };
5DDE95152255D076004D0E79 /* audio_macosx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = audio_macosx.cpp; sourceTree = "<group>"; };
5DDE95162255D076004D0E79 /* MacOSX_sound_if.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MacOSX_sound_if.cpp; sourceTree = "<group>"; };
5DDE95172255D076004D0E79 /* AudioBackEnd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioBackEnd.cpp; sourceTree = "<group>"; };
5DDE95182255D076004D0E79 /* MacOSX_sound_if.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacOSX_sound_if.h; sourceTree = "<group>"; };
752F26F81F240E51001032B4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
752F26FA1F240E69001032B4 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
752F27001F242BAF001032B4 /* prefs_sdl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = prefs_sdl.cpp; sourceTree = "<group>"; };
@ -226,8 +239,6 @@
7539E1221F23B25A006B2DF2 /* user_strings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = user_strings.cpp; path = ../user_strings.cpp; sourceTree = "<group>"; };
7539E1231F23B25A006B2DF2 /* video.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = video.cpp; path = ../video.cpp; sourceTree = "<group>"; };
7539E1241F23B25A006B2DF2 /* xpram.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xpram.cpp; path = ../xpram.cpp; sourceTree = "<group>"; };
7539E1F01F23B329006B2DF2 /* bincue_unix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bincue_unix.cpp; sourceTree = "<group>"; };
7539E1F11F23B329006B2DF2 /* bincue_unix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bincue_unix.h; sourceTree = "<group>"; };
7539E1F81F23B329006B2DF2 /* gtk-osx.patch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "gtk-osx.patch"; sourceTree = "<group>"; };
7539E1FA1F23B32A006B2DF2 /* mkstandalone */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = mkstandalone; sourceTree = "<group>"; };
7539E1FC1F23B32A006B2DF2 /* testlmem.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = testlmem.sh; sourceTree = "<group>"; };
@ -330,6 +341,11 @@
E417913123D7D67C0009AD63 /* defs68k.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = defs68k.c; path = gencpu_output/defs68k.c; sourceTree = BUILT_PRODUCTS_DIR; };
E490334D20D3A5890012DD5F /* clip_macosx64.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = clip_macosx64.mm; sourceTree = "<group>"; };
E4D8245223543D9700849B78 /* fpu_ieee.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fpu_ieee.cpp; sourceTree = "<group>"; };
E4ED8EDD24E39AFE00843219 /* compemu_support.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = compemu_support.cpp; sourceTree = "<group>"; };
E4ED8EDF24E39B2A00843219 /* comptbl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = comptbl.h; path = gencpu_output/comptbl.h; sourceTree = BUILT_PRODUCTS_DIR; };
E4ED8EE024E39BC400843219 /* compemu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = compemu.cpp; path = gencpu_output/compemu.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
E4ED8EE124E39BC400843219 /* compstbl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = compstbl.cpp; path = gencpu_output/compstbl.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
E4ED8EE424E39C0D00843219 /* compemu_fpp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = compemu_fpp.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -421,6 +437,9 @@
7532532B1F53675E0024025B /* gencpu output */ = {
isa = PBXGroup;
children = (
E4ED8EE024E39BC400843219 /* compemu.cpp */,
E4ED8EE124E39BC400843219 /* compstbl.cpp */,
E4ED8EDF24E39B2A00843219 /* comptbl.h */,
7532532C1F5368370024025B /* cpuemu_nf.cpp */,
7532532D1F5368370024025B /* cpuemu.cpp */,
7532532E1F5368370024025B /* cpustbl_nf.cpp */,
@ -472,6 +491,7 @@
7539DFD91F23B25A006B2DF2 /* adb.h */,
7539DFDA1F23B25A006B2DF2 /* audio.h */,
7539DFDB1F23B25A006B2DF2 /* audio_defs.h */,
5D5C3B0B24B2DF4200CDAB41 /* bincue.h */,
7539DFDC1F23B25A006B2DF2 /* cdrom.h */,
7539DFDD1F23B25A006B2DF2 /* clip.h */,
7539DFDE1F23B25A006B2DF2 /* debug.h */,
@ -525,6 +545,13 @@
756C1B321F252FC100620917 /* utils_macosx.h */,
756C1B331F252FC100620917 /* utils_macosx.mm */,
7539E02E1F23B25A006B2DF2 /* Versions.html */,
5DDE95152255D076004D0E79 /* audio_macosx.cpp */,
5DDE95172255D076004D0E79 /* AudioBackEnd.cpp */,
5DDE95122255D075004D0E79 /* AudioBackEnd.h */,
5DDE95132255D076004D0E79 /* AudioDevice.cpp */,
5DDE95142255D076004D0E79 /* AudioDevice.h */,
5DDE95162255D076004D0E79 /* MacOSX_sound_if.cpp */,
5DDE95182255D076004D0E79 /* MacOSX_sound_if.h */,
);
name = MacOSX;
sourceTree = "<group>";
@ -573,6 +600,8 @@
isa = PBXGroup;
children = (
7539E0AB1F23B25A006B2DF2 /* compemu.h */,
E4ED8EE424E39C0D00843219 /* compemu_fpp.cpp */,
E4ED8EDD24E39AFE00843219 /* compemu_support.cpp */,
7539E0AE1F23B25A006B2DF2 /* flags_x86.h */,
);
path = compiler;
@ -607,6 +636,7 @@
children = (
7539DFC91F23B25A006B2DF2 /* adb.cpp */,
7539DFCA1F23B25A006B2DF2 /* audio.cpp */,
5D5C3B0924B2DF3400CDAB41 /* bincue.cpp */,
7539DFCB1F23B25A006B2DF2 /* cdrom.cpp */,
7539DFCC1F23B25A006B2DF2 /* CrossPlatform */,
7539DFD41F23B25A006B2DF2 /* disk.cpp */,
@ -642,8 +672,6 @@
7539E1E91F23B329006B2DF2 /* Unix */ = {
isa = PBXGroup;
children = (
7539E1F01F23B329006B2DF2 /* bincue_unix.cpp */,
7539E1F11F23B329006B2DF2 /* bincue_unix.h */,
7539E1F71F23B329006B2DF2 /* Darwin */,
7539E1FD1F23B32A006B2DF2 /* disk_sparsebundle.cpp */,
7539E1FE1F23B32A006B2DF2 /* disk_unix.h */,
@ -804,6 +832,8 @@
$BUILT_PRODUCTS_DIR/gencpu_output/cpustbl.cpp,
$BUILT_PRODUCTS_DIR/gencpu_output/cpustbl_nf.cpp,
$BUILT_PRODUCTS_DIR/gencpu_output/defs68k.c,
$BUILT_PRODUCTS_DIR/gencpu_output/compemu.cpp,
$BUILT_PRODUCTS_DIR/gencpu_output/compstbl.cpp,
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@ -817,6 +847,7 @@
buildActionMask = 2147483647;
files = (
E4EE777523D7D71400BAE63A /* defs68k.c in Sources */,
E4ED8EE524E39C0D00843219 /* compemu_fpp.cpp in Sources */,
7539E19E1F23B25A006B2DF2 /* rounding.cpp in Sources */,
7539E29D1F23C83F006B2DF2 /* sys_darwin.cpp in Sources */,
7539E1291F23B25A006B2DF2 /* video_blit.cpp in Sources */,
@ -826,6 +857,8 @@
7539E1A01F23B25A006B2DF2 /* memory.cpp in Sources */,
E40CEEC620D7910E00BCB88D /* SDLMain.m in Sources */,
753253351F53688D0024025B /* readcpu.cpp in Sources */,
E4ED8EDE24E39AFE00843219 /* compemu_support.cpp in Sources */,
E4ED8EE324E39BC400843219 /* compstbl.cpp in Sources */,
7539E1741F23B25A006B2DF2 /* audio_sdl.cpp in Sources */,
E413D93120D260BC00E437D8 /* ip_output.c in Sources */,
7539E1E21F23B25A006B2DF2 /* video.cpp in Sources */,
@ -833,11 +866,13 @@
7539E1711F23B25A006B2DF2 /* rom_patches.cpp in Sources */,
7539E1281F23B25A006B2DF2 /* sigsegv.cpp in Sources */,
753253341F5368370024025B /* cpustbl.cpp in Sources */,
E4ED8EE224E39BC400843219 /* compemu.cpp in Sources */,
756C1B341F252FC100620917 /* utils_macosx.mm in Sources */,
E413D92620D260BC00E437D8 /* misc.c in Sources */,
753253321F5368370024025B /* cpuemu.cpp in Sources */,
7539E2701F23B32A006B2DF2 /* tinyxml2.cpp in Sources */,
7539E1721F23B25A006B2DF2 /* rsrc_patches.cpp in Sources */,
5D5C3B0A24B2DF3500CDAB41 /* bincue.cpp in Sources */,
7539E2931F23C56F006B2DF2 /* serial_dummy.cpp in Sources */,
7539E1981F23B25A006B2DF2 /* exceptions.cpp in Sources */,
75CBCF771F5DB65E00830063 /* video_sdl.cpp in Sources */,
@ -874,7 +909,6 @@
7539E18E1F23B25A006B2DF2 /* sony.cpp in Sources */,
7539E26F1F23B32A006B2DF2 /* timer_unix.cpp in Sources */,
7539E12E1F23B25A006B2DF2 /* extfs.cpp in Sources */,
7539E23F1F23B32A006B2DF2 /* bincue_unix.cpp in Sources */,
7539E12C1F23B25A006B2DF2 /* emul_op.cpp in Sources */,
E413D92720D260BC00E437D8 /* debug.c in Sources */,
E413D92220D260BC00E437D8 /* mbuf.c in Sources */,
@ -1050,10 +1084,11 @@
GCC_C_LANGUAGE_STANDARD = "compiler-default";
GCC_ENABLE_PASCAL_STRINGS = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
ENABLE_MACOSX_ETHERHELPER,
HAVE_CONFIG_H,
"BINCUE=1",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_USE_STANDARD_INCLUDE_SEARCHING = YES;
@ -1072,11 +1107,15 @@
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
"-pagezero_size",
0x1000,
);
PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
PRODUCT_BUNDLE_IDENTIFIER = net.cebix.basilisk;
PRODUCT_NAME = "$(TARGET_NAME)";
USE_HEADERMAP = YES;
VALID_ARCHS = x86_64;
VALID_ARCHS = "x86_64 arm64";
WARNING_CFLAGS = "";
};
name = Debug;
@ -1110,7 +1149,7 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
ENABLE_MACOSX_ETHERHELPER,
HAVE_CONFIG_H,
"BINCUE=1",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_USE_STANDARD_INCLUDE_SEARCHING = YES;
@ -1128,11 +1167,15 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.7;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
"-pagezero_size",
0x1000,
);
PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
PRODUCT_BUNDLE_IDENTIFIER = net.cebix.basilisk;
PRODUCT_NAME = "$(TARGET_NAME)";
USE_HEADERMAP = YES;
VALID_ARCHS = x86_64;
VALID_ARCHS = "x86_64 arm64";
WARNING_CFLAGS = "";
};
name = Release;

View File

@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MACOSX_SOUND_IF
#define MACOSX_SOUND_IF
typedef int (*audioCallback)(void);
@ -39,3 +41,5 @@ class OSXsoundOutput {
unsigned int bufferSizeFrames();
int sendAudioBuffer(void *buffer, int numFrames);
};
#endif

View File

@ -1,14 +1,16 @@
SRC = $(PROJECT_DIR)/../uae_cpu
DST = $(BUILT_PRODUCTS_DIR)/gencpu_output
VPATH = $(SRC)
VPATH = $(SRC) $(SRC)/compiler
CFLAGS = -DUSE_XCODE=1 -I. -I../uae_cpu -I../UNIX
CXXFLAGS = -stdlib=libc++ $(CFLAGS)
OBJS = $(addprefix $(DST)/, defs68k.o gencpu.o readcpu.o)
all: $(DST)/gencpu
cd $(DST); ./gencpu
all: $(DST)/gencpu $(DST)/gencomp
cd $(DST); ./gencpu; ./gencomp
$(DST)/gencpu: $(OBJS)
$(DST)/gencpu: $(addprefix $(DST)/, defs68k.o readcpu.o gencpu.o)
$(CXX) $(CXXFLAGS) -o $@ $^
$(DST)/gencomp: $(addprefix $(DST)/, defs68k.o readcpu.o gencomp.o)
$(CXX) $(CXXFLAGS) -o $@ $^
$(DST)/%.o: %.c

View File

@ -19,6 +19,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef USE_SDL_AUDIO
#include "sysdeps.h"
#include <sys/ioctl.h>
@ -269,3 +271,5 @@ static int audioInt(void)
TriggerInterrupt();
return 0;
}
#endif

View File

@ -817,4 +817,11 @@
#define FPU_IEEE
#if USE_JIT
#define DIRECT_ADDRESSING 1
#define USE_JIT_FPU
#define X86_64_ASSEMBLY
#define OPTIMIZED_FLAGS
#endif
#endif

View File

@ -34,7 +34,7 @@
#include "debug.h"
#if defined(BINCUE)
#include "bincue_unix.h"
#include "bincue.h"
#endif
@ -112,7 +112,7 @@ static bool open_sdl_audio(void)
#if defined(BINCUE)
OpenAudio_bincue(audio_spec.freq, audio_spec.format, audio_spec.channels,
audio_spec.silence);
audio_spec.silence, audio_volume);
#endif
#if SDL_VERSION_ATLEAST(2,0,0)
@ -249,11 +249,13 @@ static void stream_func(void *arg, uint8 *stream, int stream_len)
} else {
// Audio not active, play silence
silence: memset(stream, silence_byte, stream_len);
silence: memset(stream, silence_byte, stream_len);
}
#if defined(BINCUE)
MixAudio_bincue(stream, stream_len);
MixAudio_bincue(stream, stream_len, audio_volume);
#endif
}

View File

@ -90,19 +90,13 @@ enum {
static int display_type = DISPLAY_WINDOW; // See enum above
#endif
#ifdef SHEEPSHAVER
#define PROGRAM_NAME "SheepShaver"
#else
#define PROGRAM_NAME "BasiliskII"
#endif
// Constants
#ifdef WIN32
const char KEYCODE_FILE_NAME[] = PROGRAM_NAME "_keycodes";
#elif __MACOSX__
const char KEYCODE_FILE_NAME[] = PROGRAM_NAME "_keycodes";
#if defined(__MACOSX__) || defined(WIN32)
const char KEYCODE_FILE_NAME[] = "keycodes";
const char KEYCODE_FILE_NAME2[] = "BasiliskII_keycodes";
#else
const char KEYCODE_FILE_NAME[] = DATADIR "/keycodes";
const char KEYCODE_FILE_NAME2[] = DATADIR "/BasiliskII_keycodes";
#endif
@ -226,6 +220,9 @@ extern void SysMountFirstFloppy(void);
static void *vm_acquire_framebuffer(uint32 size)
{
#ifdef HAVE_MACH_VM
return vm_acquire_reserved(size);
#else
// always try to reallocate framebuffer at the same address
static void *fb = VM_MAP_FAILED;
if (fb != VM_MAP_FAILED) {
@ -239,11 +236,14 @@ static void *vm_acquire_framebuffer(uint32 size)
if (fb == VM_MAP_FAILED)
fb = vm_acquire(size, VM_MAP_DEFAULT | VM_MAP_32BIT);
return fb;
#endif
}
static inline void vm_release_framebuffer(void *fb, uint32 size)
{
#ifndef HAVE_MACH_VM
vm_release(fb, size);
#endif
}
static inline int get_customized_color_depth(int default_depth)
@ -752,7 +752,7 @@ static SDL_Surface * init_sdl_video(int width, int height, int bpp, Uint32 flags
*/
if (!sdl_window) {
sdl_window = SDL_CreateWindow(
PROGRAM_NAME,
"Basilisk II",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
window_width,
@ -774,11 +774,17 @@ static SDL_Surface * init_sdl_video(int width, int height, int bpp, Uint32 flags
}
if (!sdl_renderer) {
const char *render_driver = PrefsFindString("sdlrender");
if (render_driver) {
SDL_SetHint(SDL_HINT_RENDER_DRIVER, render_driver);
}
else {
#ifdef WIN32
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "software");
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "software");
#else
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "");
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "");
#endif
}
sdl_renderer = SDL_CreateRenderer(sdl_window, -1, 0);
if (!sdl_renderer) {
shutdown_sdl_video();
@ -1035,6 +1041,11 @@ void driver_base::init()
set_mac_frame_buffer(monitor, VIDEO_MODE_DEPTH, true);
adapt_to_video_mode();
// set default B/W palette
sdl_palette = SDL_AllocPalette(256);
sdl_palette->colors[1] = (SDL_Color){ .r = 0, .g = 0, .b = 0 };
SDL_SetSurfacePalette(s, sdl_palette);
}
void driver_base::adapt_to_video_mode() {
@ -1211,7 +1222,8 @@ static void keycode_init(void)
const char *kc_path = PrefsFindString("keycodefile");
// Open keycode table
FILE *f = fopen(kc_path ? kc_path : KEYCODE_FILE_NAME, "r");
FILE *f = fopen(kc_path && *kc_path ? kc_path : KEYCODE_FILE_NAME, "r");
if (f == NULL) f = fopen(KEYCODE_FILE_NAME2, "r");
if (f == NULL) {
char str[256];
snprintf(str, sizeof(str), GetString(STR_KEYCODE_FILE_WARN), kc_path ? kc_path : KEYCODE_FILE_NAME, strerror(errno));

View File

@ -71,7 +71,7 @@ void SaveXPRAM(void)
SDL_snprintf(full_path, sizeof(full_path), "%s/%s", dir, XPRAM_FILE_NAME);
// Save the XPRAM file
FILE *f = fopen(XPRAM_FILE_NAME, "wb");
FILE *f = fopen(full_path, "wb");
if (f != NULL) {
fwrite(XPRAM, 256, 1, f);
fclose(f);

File diff suppressed because it is too large Load Diff

View File

@ -1,166 +0,0 @@
/* GIMP RGBA C-Source image dump (BasiliskII_32x32x32_icon.c) */
static const struct {
unsigned int width;
unsigned int height;
unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */
unsigned char pixel_data[32 * 32 * 4 + 1];
} icon_32x32x32 = {
32, 32, 4,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q'\17s\377s\0\377q\37\6s\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0JJJ\377\7\7\7!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0h(\16k\377\214\0\377"
"\356b\16\357\36\27\27!\12\12\12\30%%%)\356b\16\357\315Y\40\316\263I\40\326"
"\245B)\377\203\27\0\204z\16\0{z\16\0{\203\27\0\204z\16\0{\203\27\0\204z\16"
"\0{z\16\0{\203\27\0\204\264I\27\265,\26\15""9\0\0\0\10\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10\377{\0\377\377\204"
"\0\377%\22\22)\27\27\27!AAARbbb\224jjj\224\377\224\0\377\377\214\0\377\377"
"\224\0\377\377\224\0\377\377\214\0\377\377\224\0\377\377\224\0\377\377\224"
"\0\377\377\224\0\377\377\224\0\377\377\224\0\377\377\224\0\377\377\224\0"
"\377\377s\0\377,((9\37\37\37)\0\0\0\0\0\0\0\0,,,9jjj\204jjj\204aaa{jjj\204"
"\2138\40\224\377\224\0\377\377k\0\377bbb\204jjj\234zzz\306zzz\326\203\203"
"\203\316zzz\245\377\224\0\377\377\204\0\377\377s\0\377\377s\0\377\377{\0"
"\377\377s\0\377\377s\0\377\377s\0\377\377{\0\377\377s\0\377\377s\0\377\377"
"s\0\377\377s\0\377\377c\0\377zzz\306rrr\265\0\0\0\0\0\0\0\0jjj\204\234\234"
"\234\377\234\234\234\377\245\245\245\377\357c\30\377\377\224\0\377\367c\0"
"\377\224\224\224\377{{{\377ccc\377sss\377\214\214\214\377\234\234\234\377"
"\234\234\234\377\377\224\0\377\377{\0\377\377s\0\377\377k\0\377\377k\0\377"
"\377s\0\377\377k\0\377\377s\0\377\377k\0\377\377s\0\377\377s\0\377\377s\0"
"\377\377s\0\377\306Z9\377{{{\377rrr\275\0\0\0\0\0\0\0\0bbb\204\234\234\234"
"\377\245\245\245\377\367s\20\377\377\204\0\377\377k\0\377\214\214\214\377"
"kkk\377ZZZ\377{{{\377\224\224\224\377\234\234\234\377\245\245\245\377\224"
"\224\224\377\2559!\377\306\224\204\377\214kk\377kkk\377sss\377sss\377sss"
"\377sss\377sss\377sss\377sss\377\367R\10\377\377k\0\377{{{\377\203\203\203"
"\367XXX\204\0\0\0\0\0\0\0\0jjj\204\245\245\245\377\357c\30\377\377\204\0"
"\377\377s\0\377\224\204\204\377ccc\377ZZZ\377{{{\377\234\234\234\377\245"
"\245\245\377\245\245\245\377\234\234\234\377RRR\377sss\377\306\306\306\377"
"\214\214\214\377\214\214\214\377\214\214\214\377\214\214\214\377\214\214"
"\214\377\224\224\224\377\214\214\214\377\214\214\214\377\224\224\224\377"
"\377c\0\377\357R\30\377\204\204\204\377zzz\326666B\0\0\0\0\0\0\0\0aaa{\306"
"sR\377\377\224\0\377\377{\0\377\316R1\377ccc\377RRR\377JJJ\377{{{\377\234"
"\234\234\377\245\245\245\377\234\234\234\377\224\224\224\377RRR\377\336\336"
"\336\377\336\336\336\377\316\316\316\377\316\316\316\377\224\224\224\377"
"RRR\377\326\326\326\377\326\326\326\377\326\326\326\377\326\326\326\377\326"
"\306\306\377\377k\0\377\306\275\265\377\203\203\203\357jjj\234\25\25\25\30"
"\0\0\0\0\0\0\0\0jbb\204\377\224\0\377\377{\0\377\377k\0\377ccc\377RRR\377"
"kkk\377ccc\377\204\204\204\377\245\245\245\377\245\245\245\377\234\234\234"
"\377ZZZ\377ccc\377\347\347\347\377\347\347\347\377\347\347\347\377\347\347"
"\347\377\224\224\224\377RRR\377\347\347\347\377\336\336\336\377\347\347\347"
"\377\347\347\347\377\367k9\377\377c\0\377\275\275\275\377\203\203\203\347"
"IIIZ\0\0\0\0\0\0\0\0\0\0\0\0\356j\16\357\377\204\0\377\377s\0\377\234R9\377"
"RRR\377ZZZ\377\214\214\214\377ccc\377\204\204\204\377\234\234\234\377\234"
"\234\234\377\245\245\245\377RRR\377\326\326\326\377\347\347\347\377\336\336"
"\336\377\347\347\347\377\336\336\336\377\234\234\234\377JJJ\377\347\347\347"
"\377\347\347\347\377\347\347\347\377\336\336\336\377\377k\0\377\347\224\204"
"\377\234\234\234\377\203\203\203\326\36\36\36!\0\0\0\0\0\0\0\0\0\0\0\10\377"
"\224\0\377\377{\0\377\377k\0\377RRR\377RRR\377sss\377\224\224\224\377\234"
"\234\234\377\245\245\245\377\245\245\245\377\234\234\234\377\214\214\214"
"\377JJJ\377\347\347\347\377\347\347\347\377\347\347\347\377\336\336\336\377"
"\347\347\347\377\347\347\347\377\347\347\347\377\347\347\347\377\347\347"
"\347\377\336\336\336\377\347\275\265\377\377s\0\377\316\316\316\377\214\214"
"\214\377\203\203\203\265\0\0\0\10\0\0\0\0\0\0\0\0\335Y\26\336\377\214\0\377"
"\377s\0\377\316B\30\377JJJ\377ZZZ\377\204\204\204\377\234\234\234\377\245"
"\245\245\377\245\245\245\377\234\234\234\377\245\245\245\377ccc\377kkk\377"
"\347\347\347\377\336\336\336\377\347\347\347\377\347\347\347\377\347\347"
"\347\377\336\336\336\377\336\336\336\377\347\347\347\377\336\336\336\377"
"\347\347\347\377\377c!\377\367c)\377\265\265\265\377\214\214\214\377zzz\224"
"\0\0\0\0\0\0\0\0\0\0\0\0\377\224\0\377\377{\0\377\377k\0\377ZRR\377RRR\377"
"{kk\377\377Z\10\377\377s\0\377\377s\0\377\377s\0\377\357R\30\377\245\245"
"\245\377RRR\377\255\255\255\377\347\347\347\377\336\336\336\377\347\347\347"
"\377\336\336\336\377\347\347\347\377\347\347\347\377\347\347\347\377\347"
"\347\347\377\347\347\347\377\347\347\347\377\377k\0\377\336\316\316\377\234"
"\234\234\377\245\245\245\377yyy\204\0\0\0\0\0\0\0\0\36\27\27!\377\224\0\377"
"\377s\0\377\377k\0\377RRR\377ZRR\377\377k\0\377\316cJ\377\316cJ\377\377\214"
"\0\377\377s\0\377\377s\0\377\377c\0\377RRR\377\326\326\326\377\336\336\336"
"\377\347\347\347\377\347\347\347\377\347\347\347\377\336\336\336\377\347"
"\347\347\377\336\336\336\377\347\347\347\377\336\336\336\377\357\245\224"
"\377\377c\0\377\306\306\306\377\214\214\214\377\275\275\275\377yyy\204\0"
"\0\0\0\0\0\0\0\212(\16\214\377\224\0\377\377k\0\377\377R\0\377RRR\377ccc"
"\377\224\224\224\377\234\234\234\377{{{\377ccc\377\377\214\0\377\377s\0\377"
"\377s\0\377\347B\10\377\316\316\316\377\347\347\347\377\347\347\347\377\347"
"\347\347\377\336\336\336\377\347\347\347\377\347\347\347\377\347\347\347"
"\377\347\347\347\377\347\347\347\377\377R\0\377\357\204c\377\255\255\255"
"\377\224\224\224\377\326\326\326\377zzz{\0\0\0\0\0\0\0\0\335b\26\336\377"
"\214\0\377\377s\0\377\336J\20\377RRR\377kkk\377\224\224\224\377\204\204\204"
"\377kkk\377{{{\377\265ZJ\377\377\214\0\377\377s\0\377\377s\0\377111\377J"
"JJ\377RRR\377JJJ\377RRR\377\347\347\347\377\347\347\347\377\347\347\347\377"
"\336\336\336\377\347\347\347\377\377k\0\377\326\326\326\377\234\234\234\377"
"\255\255\255\377\336\336\336\377yyy\204\0\0\0\0\0\0\0\0\377Z\0\377\377\204"
"\0\377\377k\0\377\275B\30\377JJJ\377{{{\377\234\234\234\377\234\234\234\377"
"\234\234\234\377\234\234\234\377\234\234\234\377\377\224\0\377\377{\0\377"
"\377s\0\377\265B)\377sss\377\224\224\224\377kkk\377ZZZ\377\336\336\336\377"
"\336\336\336\377\347\347\347\377\347\347\347\377\367\224{\377\377Z\10\377"
"\306\306\306\377\214\214\214\377\306\306\306\377\336\336\336\377\203\203"
"\203\204\0\0\0\0\0\0\0\0\377c\0\377\377\204\0\377\377s\0\377\275B!\377RR"
"R\377{{{\377\234\234\234\377\245\245\245\377\234\234\234\377\245\245\245"
"\377\234\234\234\377\377c\0\377\377\214\0\377\377k\0\377\357J\10\377ccc\377"
"\224\224\224\377RRR\377\214\214\214\377\347\347\347\377\347\347\347\377\347"
"\347\347\377\336\336\336\377\377Z\0\377\347\245\234\377\255\255\255\377\234"
"\234\234\377\326\326\326\377\347\347\347\377zzz{\0\0\0\0\0\0\0\0\377c\0\377"
"\377\204\0\377\377s\0\377\316J\30\377RRR\377\204\204\204\377\224\224\224"
"\377kkk\377{{{\377\234\234\234\377\245\245\245\377\347c)\377\377\224\0\377"
"\377s\0\377\377R\0\377RRR\377\204\204\204\377JJJ\377\265\265\265\377\347"
"\347\347\377\336\336\336\377\347\347\347\377\336\336\336\377\377k\0\377J"
"JJ\377\214\214\214\377\265\265\265\377\336\336\336\377\347\347\347\377zz"
"z{\0\0\0\0\0\0\0\0\346b\17\347\377\214\0\377\377k\0\377\347J\10\377ZZZ\377"
"\204\204\204\377\245\245\245\377\214\214\214\377kkk\377kkk\377kkk\377\275"
"J1\377\377\224\0\377\377s\0\377\377Z\0\377JJJ\377sss\377RRR\377\214\214\214"
"\377sss\377ZZZ\377JJJ\377\275B!\377\336J\20\377\255\255\255\377\224\224\224"
"\377\316\316\316\377\336\336\336\377\347\347\347\377zzz{\0\0\0\0\0\0\0\0"
"\2437\27\245\377\214\0\377\377s\0\377\377Z\0\377RRR\377\204\204\204\377\234"
"\234\234\377\245\245\245\377\234\234\234\377\245\245\245\377\234\234\234"
"\377\306ZB\377\377\224\0\377\377s\0\377\367J\0\377111\377RRR\377RRR\377Z"
"ZZ\377sss\377\224\224\224\377\326\326\326\377\377c\0\377\336\326\316\377"
"\245\245\245\377\245\245\245\377\336\336\336\377\347\347\347\377\347\347"
"\347\377zzz{\0\0\0\0\0\0\0\0%\22\22)\377\214\0\377\377s\0\377\377k\0\377"
"RRR\377{{{\377\234\234\234\377\245\245\245\377\234\234\234\377\245\245\245"
"\377\234\234\234\377\326kJ\377\377\214\0\377\377s\0\377\306J!\377RRR\377"
"sss\377JJJ\377\265\265\265\377\336\336\336\377\347\347\347\377\347\326\326"
"\377\377c\0\377\316\316\316\377\224\224\224\377\275\275\275\377\336\336\336"
"\377\347\347\347\377\336\336\336\377zzz{\0\0\0\0\0\0\0\0\0\0\0\0\377\224"
"\0\377\377\204\0\377\377s\0\377kJJ\377kkk\377\234\234\234\377\245\245\245"
"\377\234\234\234\377\245\245\245\377\245\245\245\377\347c)\377\377\214\0"
"\377\377s\0\377cJB\377ZZZ\377{{{\377RRR\377\224\224\224\377\347\347\347\377"
"\347\347\347\377\367c)\377\367\204c\377\275\275\275\377\224\224\224\377\316"
"\316\316\377\347\347\347\377\347\347\347\377\347\347\347\377yyy\204\0\0\0"
"\0\0\0\0\0\0\0\0\0\264@\27\265\377\214\0\377\377s\0\377\357J\10\377kkk\377"
"\224\224\224\377\245\245\245\377\234\234\234\377\245\245\245\377\234\234"
"\234\377\377c\0\377\377\204\0\377\377c\0\377RRR\377ZZZ\377\204\204\204\377"
"ccc\377ccc\377\336\336\336\377\347\347\347\377\377s\0\377\326\326\326\377"
"\245\245\245\377\245\245\245\377\336\336\336\377\336\336\336\377\336\336"
"\336\377\347\347\347\377zzz{\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10\377\224\0\377"
"\377\204\0\377\377k\0\377kkc\377\245\245\245\377\265\265\265\377\275\275"
"\275\377\265\265\265\377\265\265\265\377\377\224\0\377\377s\0\377\234ZR\377"
"ccc\377kkk\377\245\245\245\377\245\245\245\377RRR\377\357\357\357\377\357"
"\255\234\377\377R\0\377\326\326\326\377\234\234\234\377\326\326\326\377\357"
"\357\357\377\357\357\357\377\367\367\367\377\357\357\357\377zzz{\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0H%\37J\377\214\0\377\377{\0\377\367Z\0\377XXX\204"
"\17\17\17\20\0\0\0\0\0\0\0\0\2128\27\214\377{\0\377\335Q\16\336zzz\326zz"
"z\367bbb\224\17\17\17\20\0\0\0\0RRR\377\0\0\0\0\377Z\0\377W\37\26ZQQQkjj"
"j\234\27\27\27!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0yA0\204\377\224\0\377\377{\0\377\367Z\10\3776..B\0"
"\0\0\0P\37\17R\377{\0\377\346Y\16\357QQQk\203\203\203\357zzz\316666B\0\0"
"\0\10\0\0\0\0III\336777\234\377s\0\377\27\27\27!rrr\245QQQk\0\0\0\10\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\17\17\17\20YYY{\356Y\7\367\377k\0\377\377k\0\377\377s\0\377\377c\0\377"
"a&\27c%%%)rrr\265zzz\326QQQk\0\0\0\10\0\0\0\0\0\0\0\0\0\0\0\20RRR\377\0\0"
"\0\0""777Jrrr\265$$$1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\25\25\25\30YYY{zzz\336\203\203"
"\203\357rrr\255IIIZIIIZjjj\245zzz\316QQQk\17\17\17\20\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\10IIIZXXXs\17\17\17\20\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\10\17\17\17\20AAAJbbb\224rrr\275zzz\275jjj\255bbb\214666B\17\17\17"
"\20\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10\0\0\0\20\17"
"\17\17\20\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0",
};

View File

@ -100,7 +100,7 @@ define GUI_SRCS_LIST_TO_OBJS
endef
GUI_OBJS = $(GUI_SRCS_LIST_TO_OBJS)
ifeq ($(USE_BINCUE),yes)
GUI_OBJS += bincue_unix.o
GUI_OBJS += bincue.o
endif
GUI_SRCS := $(GUI_SRCS:%=@top_srcdir@/%)

View File

@ -369,6 +369,7 @@ AS_IF([test "x$with_bincue" = "xyes" ], [have_bincue=yes], [have_bincue=no])
AS_IF([test "x$have_bincue" = "xyes" ], [
if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
DEFINES="$DEFINES -DBINCUE"
CPPFLAGS="$CPPFLAGS -DBINCUE"
AC_SUBST(USE_BINCUE, yes)
else
AC_MSG_ERROR([You need SDL Audio to use BINCUE support.])
@ -898,7 +899,7 @@ fi
dnl BINCUE overrides
if [[ "x$have_bincue" = "xyes" ]]; then
EXTRASYSSRCS="$EXTRASYSSRCS bincue_unix.cpp"
EXTRASYSSRCS="$EXTRASYSSRCS bincue.cpp"
fi
dnl libvhd overrides

View File

@ -59,7 +59,7 @@
#include "disk_unix.h"
#if defined(BINCUE)
#include "bincue_unix.h"
#include "bincue.h"
#endif
@ -1407,8 +1407,13 @@ bool SysCDScan(void *arg, uint8 start_m, uint8 start_s, uint8 start_f, bool reve
mac_file_handle *fh = (mac_file_handle *)arg;
if (!fh)
return false;
// Not supported under Linux
#if defined(BINCUE)
if (fh->is_bincue)
return CDScan_bincue(fh->bincue_fd,start_m,start_s,start_f,reverse);
#endif
// Not supported outside bincue
return false;
}
@ -1422,6 +1427,11 @@ void SysCDSetVolume(void *arg, uint8 left, uint8 right)
mac_file_handle *fh = (mac_file_handle *)arg;
if (!fh)
return;
#if defined(BINCUE)
if (fh->is_bincue)
CDSetVol_bincue(fh->bincue_fd,left,right);
#endif
if (fh->is_cdrom) {
#if defined(__linux__)
@ -1450,6 +1460,12 @@ void SysCDGetVolume(void *arg, uint8 &left, uint8 &right)
return;
left = right = 0;
#if defined(BINCUE)
if (fh->is_bincue)
CDGetVol_bincue(fh->bincue_fd,&left,&right);
#endif
if (fh->is_cdrom) {
#if defined(__linux__)
cdrom_volctrl vol;

View File

@ -446,87 +446,6 @@ static void set_window_name(Window w, int name)
}
}
// This struct is designed to match the ones generated by GIMP in
// BasiliskII_*_icon.c
struct gimp_image {
unsigned int width;
unsigned int height;
unsigned int bytes_per_pixel;
unsigned char pixel_data[0]; // Variable-length
};
// These were generated by using 'icns2png -x
// ../MacOSX/BasiliskII.icns', then using GIMP to convert the
// resulting .png files into "C source code (*.c)". GIMP doesn't
// generate corresponding .h files with extern declarations, so just
// #include the .c files here.
#include "BasiliskII_32x32x32_icon.c"
#include "BasiliskII_128x128x32_icon.c"
// Set window icons
static void set_window_icons(Window w)
{
// As per the _NET_WM_ICON documentation at
// https://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idm140200472568384,
// "The first two cardinals are width, height."
const unsigned int HEADER_SIZE = 2;
// We will pass 32-bit values to XChangeProperty()
const unsigned int FORMAT = 32;
// Icon data from GIMP to be converted and passed to the
// Window Manager
const struct gimp_image* const icons[] =
{(struct gimp_image *) &icon_32x32x32,
(struct gimp_image *) &icon_128x128x32};
const unsigned int num_icons = sizeof(icons) / sizeof(icons[0]);
unsigned int icon;
// Work out how big the buffer needs to be to store all of our icons
unsigned int buffer_size = 0;
for (icon = 0; icon < num_icons; icon++) {
buffer_size += HEADER_SIZE +
icons[icon]->width * icons[icon]->height;
}
// As per the XChangeProperty() man page, "If the specified
// format is 32, the property data must be a long array."
unsigned long buffer[buffer_size];
// This points to the start of the current icon within buffer
unsigned long *buffer_icon = buffer;
// Copy the icons into the buffer
for (icon = 0; icon < num_icons; icon++) {
const unsigned int pixel_count = icons[icon]->width *
icons[icon]->height;
assert(icons[icon]->bytes_per_pixel == 4);
buffer_icon[0] = icons[icon]->width;
buffer_icon[1] = icons[icon]->height;
unsigned long *const buffer_pixels = buffer_icon + HEADER_SIZE;
unsigned int i;
for (i = 0; i < pixel_count; i++) {
const unsigned char *src =
&icons[icon]->pixel_data[i * icons[icon]->bytes_per_pixel];
buffer_pixels[i] = (src[3] << 24 |
src[0] << 16 |
src[1] << 8 |
src[2]);
}
buffer_icon += HEADER_SIZE + pixel_count;
}
Atom net_wm_icon = XInternAtom(x_display, "_NET_WM_ICON", False);
if (net_wm_icon == None) {
ErrorAlert(STR_X_ICON_ATOM_ALLOC_ERR);
// We can still continue running, just without an icon
return;
}
XChangeProperty(x_display, w, net_wm_icon, XA_CARDINAL, FORMAT,
PropModeReplace, (const unsigned char *) buffer,
buffer_size);
}
// Set window input focus flag
static void set_window_focus(Window w)
{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 141 KiB

View File

@ -31,6 +31,8 @@ SLIRP_SRCS = \
../slirp/ip_input.c ../slirp/socket.c ../slirp/udp.c
SLIRP_OBJS = $(SLIRP_SRCS:../slirp/%.c=$(OBJ_DIR)/slirp-%.o)
USE_BINCUE = @USE_BINCUE@
LN_S = @LN_S@
WINDRES = @WINDRES@
CC = @CC@
@ -42,6 +44,7 @@ DEFS = @DEFS@ @DEFINES@
LDFLAGS = @LDFLAGS@ -Wl,-Bstatic
LIBS = @LIBS@ -lws2_32 -lwsock32 -liphlpapi
CPUSRCS = @CPUSRCS@
EXTRASRCS = @EXTRASRCS@
HOST_CC = gcc
HOST_CXX = g++
@ -68,7 +71,7 @@ SRCS = ../main.cpp main_windows.cpp ../prefs.cpp ../prefs_items.cpp prefs_window
../extfs.cpp extfs_windows.cpp ../user_strings.cpp user_strings_windows.cpp \
vm_alloc.cpp sigsegv.cpp posix_emu.cpp util_windows.cpp \
../dummy/prefs_editor_dummy.cpp BasiliskII.rc \
$(CDENABLESRCS) $(ROUTERSRCS) $(CPUSRCS) $(SLIRP_OBJS)
$(CDENABLESRCS) $(ROUTERSRCS) $(CPUSRCS) $(EXTRASRCS) $(SLIRP_OBJS)
UI_SRCS = ../prefs.cpp prefs_windows.cpp prefs_editor_gtk.cpp xpram_windows.cpp \
../prefs_items.cpp ../user_strings.cpp user_strings_windows.cpp util_windows.cpp \

View File

@ -36,6 +36,9 @@ AC_ARG_ENABLE(fpe,
dnl External packages.
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
AC_ARG_WITH(bincue,
AS_HELP_STRING([--with-bincue], [Allow cdrom image files in bin/cue mode]))
dnl Addressing modes.
AC_ARG_ENABLE(addressing,
[ --enable-addressing=AM specify the addressing mode to use [default=fastest]],
@ -85,6 +88,14 @@ AC_SUBST(WANT_GTK)
dnl We use 64-bit file size support if possible.
AC_SYS_LARGEFILE
dnl BINCUE
AS_IF([test "x$with_bincue" = "xyes" ], [have_bincue=yes], [have_bincue=no])
AS_IF([test "x$have_bincue" = "xyes" ], [
DEFINES="$DEFINES -DBINCUE"
CPPFLAGS="$CPPFLAGS -DBINCUE"
AC_SUBST(USE_BINCUE, yes)
], [AC_SUBST(USE_BINCUE, no)])
dnl Checks for header files.
AC_HEADER_STDC
@ -304,6 +315,11 @@ elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_X86_64" = "xyes" ]]; then
fi
fi
dnl BINCUE overrides
if [[ "x$have_bincue" = "xyes" ]]; then
EXTRASRCS="$EXTRASRCS bincue.cpp"
fi
dnl Enable JIT compiler, if possible.
if [[ "x$WANT_JIT" = "xyes" -a "x$CAN_JIT" ]]; then
JITSRCS="$JITSRCS ../uae_cpu/compiler/compemu_support.cpp ../uae_cpu/compiler/compemu_fpp.cpp compstbl.o cpustbl_nf.o"
@ -552,6 +568,7 @@ dnl Generate Makefile.
AC_SUBST(DEFINES)
AC_SUBST(CPUINCLUDES)
AC_SUBST(CPUSRCS)
AC_SUBST(EXTRASRCS)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
@ -564,6 +581,7 @@ echo JIT debug mode ......................... : $WANT_JIT_DEBUG
echo Floating-Point emulation core .......... : $FPE_CORE
echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS
echo Addressing mode ........................ : $ADDRESSING_MODE
echo BINCUE support ......................... : $have_bincue
echo GTK user interface ..................... : $WANT_GTK
echo
echo "Configuration done. Now type \"make\" (or \"gmake\")."

View File

@ -361,10 +361,10 @@ int main(int argc, char **argv)
D(bug("Mac ROM starts at %p (%08x)\n", ROMBaseHost, ROMBaseMac));
// Get rom file path from preferences
auto rom_path = tstr(PrefsFindString("rom"));
const char* rom_path = PrefsFindString("rom");
// Load Mac ROM
HANDLE rom_fh = CreateFile(rom_path ? rom_path.get() : ROM_FILE_NAME,
HANDLE rom_fh = CreateFile((rom_path != NULL) ? rom_path : ROM_FILE_NAME,
GENERIC_READ,
FILE_SHARE_READ, NULL,
OPEN_EXISTING,

View File

@ -40,6 +40,10 @@ using std::min;
#include "cdenable/cache.h"
#include "cdenable/eject_nt.h"
#if defined(BINCUE)
#include "bincue.h"
#endif
#define DEBUG 0
#include "debug.h"
@ -56,6 +60,12 @@ struct file_handle {
loff_t file_size; // Size of file data (only valid if is_file is true)
cachetype cache;
bool is_media_present;
#if defined(BINCUE)
bool is_bincue; // Flag: BIN CUE file
void *bincue_fd;
file_handle() {is_bincue = false;} // default bincue false
#endif
};
// Open file handles
@ -462,6 +472,11 @@ void *Sys_open(const char *path_name, bool read_only)
read_only = true;
// Open file
#if defined(BINCUE)
void *binfd = open_bincue(name); // check if bincue
#endif
HANDLE h = CreateFile(
name,
read_only ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE,
@ -486,6 +501,16 @@ void *Sys_open(const char *path_name, bool read_only)
fh->is_floppy = false;
fh->is_cdrom = false;
#if defined(BINCUE)
if (binfd) {
fh->bincue_fd = binfd;
fh->is_bincue = true;
fh->is_media_present = true;
sys_add_file_handle(fh);
return fh;
}
#endif
// Detect disk image file layout
loff_t size = GetFileSize(h, NULL);
DWORD bytes_read;
@ -517,6 +542,11 @@ void Sys_close(void *arg)
sys_remove_file_handle(fh);
#if defined(BINCUE)
if (fh->is_bincue)
close_bincue(fh->bincue_fd);
#endif
if (fh->is_cdrom) {
cache_final(&fh->cache);
SysAllowRemoval((void *)fh);
@ -543,6 +573,11 @@ size_t Sys_read(void *arg, void *buffer, loff_t offset, size_t length)
if (!fh)
return 0;
#if defined(BINCUE)
if (fh->is_bincue)
return read_bincue(fh->bincue_fd, buffer, offset, length);
#endif
DWORD bytes_read = 0;
if (fh->is_file) {
@ -623,6 +658,11 @@ loff_t SysGetFileSize(void *arg)
if (!fh)
return true;
#if defined(BINCUE)
if (fh->is_bincue)
return size_bincue(fh->bincue_fd);
#endif
if (fh->is_file)
return fh->file_size;
else if (fh->is_cdrom)
@ -644,6 +684,13 @@ void SysEject(void *arg)
if (!fh)
return;
#if defined(BINCUE)
if (fh->is_bincue) {
fh->is_media_present = false;
return;
}
#endif
if (fh->is_cdrom && fh->fh) {
fh->is_media_present = false;
// Commented out because there was some problems, but can't remember
@ -782,16 +829,26 @@ void SysAllowRemoval(void *arg)
bool SysCDReadTOC(void *arg, uint8 *toc)
{
file_handle *fh = (file_handle *)arg;
if (!fh || !fh->fh || !fh->is_cdrom)
if (!fh)
return false;
DWORD dummy;
return DeviceIoControl(fh->fh,
IOCTL_CDROM_READ_TOC,
NULL, 0,
toc, min((int)sizeof(CDROM_TOC), 804),
&dummy,
NULL) != FALSE;
#if defined(BINCUE)
if (fh->is_bincue)
return readtoc_bincue(fh->bincue_fd, toc);
#endif
if (fh->is_cdrom) {
DWORD dummy;
return DeviceIoControl(fh->fh,
IOCTL_CDROM_READ_TOC,
NULL, 0,
toc, min((int)sizeof(CDROM_TOC), 804),
&dummy,
NULL) != FALSE;
} else
return false;
}
@ -802,26 +859,34 @@ bool SysCDReadTOC(void *arg, uint8 *toc)
bool SysCDGetPosition(void *arg, uint8 *pos)
{
file_handle *fh = (file_handle *)arg;
if (!fh || !fh->fh || !fh->is_cdrom)
if (!fh)
return false;
SUB_Q_CHANNEL_DATA q_data;
#if defined(BINCUE)
if (fh->is_bincue)
return GetPosition_bincue(fh->bincue_fd, pos);
#endif
CDROM_SUB_Q_DATA_FORMAT q_format;
q_format.Format = IOCTL_CDROM_CURRENT_POSITION;
q_format.Track = 0; // used only by ISRC reads
if (fh->is_cdrom) {
SUB_Q_CHANNEL_DATA q_data;
DWORD dwBytesReturned = 0;
bool ok = DeviceIoControl(fh->fh,
IOCTL_CDROM_READ_Q_CHANNEL,
&q_format, sizeof(CDROM_SUB_Q_DATA_FORMAT),
&q_data, sizeof(SUB_Q_CHANNEL_DATA),
&dwBytesReturned,
NULL) != FALSE;
if (ok)
memcpy(pos, &q_data.CurrentPosition, sizeof(SUB_Q_CURRENT_POSITION));
CDROM_SUB_Q_DATA_FORMAT q_format;
q_format.Format = IOCTL_CDROM_CURRENT_POSITION;
q_format.Track = 0; // used only by ISRC reads
return ok;
DWORD dwBytesReturned = 0;
bool ok = DeviceIoControl(fh->fh,
IOCTL_CDROM_READ_Q_CHANNEL,
&q_format, sizeof(CDROM_SUB_Q_DATA_FORMAT),
&q_data, sizeof(SUB_Q_CHANNEL_DATA),
&dwBytesReturned,
NULL) != FALSE;
if (ok)
memcpy(pos, &q_data.CurrentPosition, sizeof(SUB_Q_CURRENT_POSITION));
return ok;
} else
return false;
}
@ -832,24 +897,32 @@ bool SysCDGetPosition(void *arg, uint8 *pos)
bool SysCDPlay(void *arg, uint8 start_m, uint8 start_s, uint8 start_f, uint8 end_m, uint8 end_s, uint8 end_f)
{
file_handle *fh = (file_handle *)arg;
if (!fh || !fh->fh || !fh->is_cdrom)
if (!fh)
return false;
CDROM_PLAY_AUDIO_MSF msf;
msf.StartingM = start_m;
msf.StartingS = start_s;
msf.StartingF = start_f;
msf.EndingM = end_m;
msf.EndingS = end_s;
msf.EndingF = end_f;
#if defined(BINCUE)
if (fh->is_bincue)
return CDPlay_bincue(fh->bincue_fd, start_m, start_s, start_f, end_m, end_s, end_f);
#endif
DWORD dwBytesReturned = 0;
return DeviceIoControl(fh->fh,
IOCTL_CDROM_PLAY_AUDIO_MSF,
&msf, sizeof(CDROM_PLAY_AUDIO_MSF),
NULL, 0,
&dwBytesReturned,
NULL) != FALSE;
if (fh->is_cdrom) {
CDROM_PLAY_AUDIO_MSF msf;
msf.StartingM = start_m;
msf.StartingS = start_s;
msf.StartingF = start_f;
msf.EndingM = end_m;
msf.EndingS = end_s;
msf.EndingF = end_f;
DWORD dwBytesReturned = 0;
return DeviceIoControl(fh->fh,
IOCTL_CDROM_PLAY_AUDIO_MSF,
&msf, sizeof(CDROM_PLAY_AUDIO_MSF),
NULL, 0,
&dwBytesReturned,
NULL) != FALSE;
} else
return false;
}
@ -860,16 +933,24 @@ bool SysCDPlay(void *arg, uint8 start_m, uint8 start_s, uint8 start_f, uint8 end
bool SysCDPause(void *arg)
{
file_handle *fh = (file_handle *)arg;
if (!fh || !fh->fh || !fh->is_cdrom)
if (!fh)
return false;
DWORD dwBytesReturned = 0;
return DeviceIoControl(fh->fh,
IOCTL_CDROM_PAUSE_AUDIO,
NULL, 0,
NULL, 0,
&dwBytesReturned,
NULL) != FALSE;
#if defined(BINCUE)
if (fh->is_bincue)
return CDPause_bincue(fh->bincue_fd);
#endif
if (fh->is_cdrom) {
DWORD dwBytesReturned = 0;
return DeviceIoControl(fh->fh,
IOCTL_CDROM_PAUSE_AUDIO,
NULL, 0,
NULL, 0,
&dwBytesReturned,
NULL) != FALSE;
} else
return false;
}
@ -880,15 +961,23 @@ bool SysCDPause(void *arg)
bool SysCDResume(void *arg)
{
file_handle *fh = (file_handle *)arg;
if (!fh || !fh->fh || !fh->is_cdrom)
if (!fh)
return false;
DWORD dwBytesReturned = 0;
return DeviceIoControl(fh->fh,
IOCTL_CDROM_RESUME_AUDIO,
NULL, 0,
NULL, 0,
&dwBytesReturned, NULL) != FALSE;
#if defined(BINCUE)
if (fh->is_bincue)
return CDResume_bincue(fh->bincue_fd);
#endif
if (fh->is_cdrom) {
DWORD dwBytesReturned = 0;
return DeviceIoControl(fh->fh,
IOCTL_CDROM_RESUME_AUDIO,
NULL, 0,
NULL, 0,
&dwBytesReturned, NULL) != FALSE;
} else
return false;
}
@ -899,16 +988,24 @@ bool SysCDResume(void *arg)
bool SysCDStop(void *arg, uint8 lead_out_m, uint8 lead_out_s, uint8 lead_out_f)
{
file_handle *fh = (file_handle *)arg;
if (!fh || !fh->fh || !fh->is_cdrom)
if (!fh)
return false;
DWORD dwBytesReturned = 0;
return DeviceIoControl(fh->fh,
IOCTL_CDROM_STOP_AUDIO,
NULL, 0,
NULL, 0,
&dwBytesReturned,
NULL) != FALSE;
#if defined(BINCUE)
if (fh->is_bincue)
return CDStop_bincue(fh->bincue_fd);
#endif
if (fh->is_cdrom) {
DWORD dwBytesReturned = 0;
return DeviceIoControl(fh->fh,
IOCTL_CDROM_STOP_AUDIO,
NULL, 0,
NULL, 0,
&dwBytesReturned,
NULL) != FALSE;
} else
return false;
}
@ -919,21 +1016,30 @@ bool SysCDStop(void *arg, uint8 lead_out_m, uint8 lead_out_s, uint8 lead_out_f)
bool SysCDScan(void *arg, uint8 start_m, uint8 start_s, uint8 start_f, bool reverse)
{
file_handle *fh = (file_handle *)arg;
if (!fh || !fh->fh || !fh->is_cdrom)
if (!fh)
return false;
CDROM_SEEK_AUDIO_MSF msf;
msf.M = start_m;
msf.S = start_s;
msf.F = start_f;
#if defined(BINCUE)
if (fh->is_bincue)
return CDScan_bincue(fh->bincue_fd,start_m,start_s,start_f,reverse);
#endif
DWORD dwBytesReturned = 0;
return DeviceIoControl(fh->fh,
IOCTL_CDROM_SEEK_AUDIO_MSF,
&msf, sizeof(CDROM_SEEK_AUDIO_MSF),
NULL, 0,
&dwBytesReturned,
NULL) != FALSE;
if (fh->is_cdrom) {
CDROM_SEEK_AUDIO_MSF msf;
msf.M = start_m;
msf.S = start_s;
msf.F = start_f;
DWORD dwBytesReturned = 0;
return DeviceIoControl(fh->fh,
IOCTL_CDROM_SEEK_AUDIO_MSF,
&msf, sizeof(CDROM_SEEK_AUDIO_MSF),
NULL, 0,
&dwBytesReturned,
NULL) != FALSE;
} else
return false;
}
@ -944,22 +1050,30 @@ bool SysCDScan(void *arg, uint8 start_m, uint8 start_s, uint8 start_f, bool reve
void SysCDSetVolume(void *arg, uint8 left, uint8 right)
{
file_handle *fh = (file_handle *)arg;
if (!fh || !fh->fh || !fh->is_cdrom)
if (!fh)
return;
VOLUME_CONTROL vc;
vc.PortVolume[0] = left;
vc.PortVolume[1] = right;
vc.PortVolume[2] = left;
vc.PortVolume[3] = right;
#if defined(BINCUE)
if (fh->is_bincue)
CDSetVol_bincue(fh->bincue_fd,left,right);
#endif
DWORD dwBytesReturned = 0;
DeviceIoControl(fh->fh,
IOCTL_CDROM_SET_VOLUME,
&vc, sizeof(VOLUME_CONTROL),
NULL, 0,
&dwBytesReturned,
NULL);
if (fh->is_cdrom) {
VOLUME_CONTROL vc;
vc.PortVolume[0] = left;
vc.PortVolume[1] = right;
vc.PortVolume[2] = left;
vc.PortVolume[3] = right;
DWORD dwBytesReturned = 0;
DeviceIoControl(fh->fh,
IOCTL_CDROM_SET_VOLUME,
&vc, sizeof(VOLUME_CONTROL),
NULL, 0,
&dwBytesReturned,
NULL);
}
}
@ -974,21 +1088,27 @@ void SysCDGetVolume(void *arg, uint8 &left, uint8 &right)
return;
left = right = 0;
if (!fh->fh || !fh->is_cdrom)
return;
VOLUME_CONTROL vc;
memset(&vc, 0, sizeof(vc));
#if defined(BINCUE)
if (fh->is_bincue)
CDGetVol_bincue(fh->bincue_fd,&left,&right);
#endif
if (fh->is_cdrom) {
DWORD dwBytesReturned = 0;
if (DeviceIoControl(fh->fh,
IOCTL_CDROM_GET_VOLUME,
NULL, 0,
&vc, sizeof(VOLUME_CONTROL),
&dwBytesReturned,
NULL))
{
left = vc.PortVolume[0];
right = vc.PortVolume[1];
VOLUME_CONTROL vc;
memset(&vc, 0, sizeof(vc));
DWORD dwBytesReturned = 0;
if (DeviceIoControl(fh->fh,
IOCTL_CDROM_GET_VOLUME,
NULL, 0,
&vc, sizeof(VOLUME_CONTROL),
&dwBytesReturned,
NULL))
{
left = vc.PortVolume[0];
right = vc.PortVolume[1];
}
}
}

View File

@ -21,11 +21,6 @@
#ifndef SYSDEPS_H
#define SYSDEPS_H
#ifdef __MINGW32__
#define _UNICODE
#define UNICODE
#endif
#if !defined _MSC_VER && !defined __STDC__
#error "Your compiler is not ANSI. Get a real one."
#endif

View File

@ -31,6 +31,8 @@
#include "main.h"
#include "audio.h"
#include "audio_defs.h"
#include "user_strings.h"
#include "cdrom.h"
#define DEBUG 0
#include "debug.h"
@ -533,7 +535,7 @@ delegate: // Delegate call to Apple Mixer
}
}
// not currently using these functions
/*
* Sound input driver Open() routine
*/
@ -553,7 +555,20 @@ int16 SoundInPrime(uint32 pb, uint32 dce)
{
D(bug("SoundInPrime\n"));
//!!
return paramErr;
uint16 code = ReadMacInt16(pb + csCode);
D(bug("SoundInControl %d\n", code));
if (code == 1) {
D(bug(" SoundInKillIO\n"));
//!!
return noErr;
}
if (code != 2)
return -231; // siUnknownInfoType
return noErr;
}
@ -574,12 +589,20 @@ int16 SoundInControl(uint32 pb, uint32 dce)
if (code != 2)
return -231; // siUnknownInfoType
uint32 *param = (uint32 *)Mac2HostAddr(pb + csParam);
uint32 selector = param[0];
D(bug(" selector %c%c%c%c\n", selector >> 24, selector >> 16, selector >> 8, selector));
uint32 selector = ReadMacInt32(pb + csParam); // 4-byte selector (should match via FOURCC above)
switch (selector) {
case siInitializeDriver: {
// If possible, the driver initializes the device to a sampling rate of 22 kHz, a sample size of 8 bits, mono recording, no compression, automatic gain control on, and all other features off.
return noErr;
}
case siCloseDriver: {
// The sound input device driver should stop any recording in progress, deallocate the input hardware, and initialize local variables to default settings.
return noErr;
}
default:
return -231; // siUnknownInfoType
}
@ -590,58 +613,123 @@ int16 SoundInControl(uint32 pb, uint32 dce)
* Sound input driver Status() routine
*/
int16 SoundInStatus(uint32 pb, uint32 dce)
int16 SoundInStatus(uint32 pb, uint32 dce) // A0 points to Device Manager parameter block (pb) and A1 to device control entry (dce)
{
uint16 code = ReadMacInt16(pb + csCode);
D(bug("SoundInStatus %d\n", code));
if (code != 2)
return -231; // siUnknownInfoType
// two choices on return
// 1: if under 18 bytes, place # of bytes at (pb+csParam) and write from (pb+csParam+4) on
// 2: if over 18 bytes, place 0 at (pb+csParam) and directly write into buffer pointed to by bufferptr
uint32 selector = ReadMacInt32(pb + csParam); // 4-byte selector (should match via FOURCC above)
uint32 bufferptr = ReadMacInt32(pb + csParam + 4); // 4-byte address to the buffer in vm memory
uint32 *param = (uint32 *)Mac2HostAddr(pb + csParam);
uint32 selector = param[0];
D(bug(" selector %c%c%c%c\n", selector >> 24, selector >> 16, selector >> 8, selector));
switch (selector) {
#if 0
case siDeviceName: {
const char *str = GetString(STR_SOUND_IN_NAME);
param[0] = 0;
memcpy((void *)param[1], str, strlen(str));
//#if 0
case siDeviceName: { // return name in STR255 format
const uint8 str[] = { // size 9
0x08, // 1-byte length
0x42, 0x75, // Bu
0x69, 0x6c, // il
0x74, 0x2d, // t-
0x69, 0x6e // in
};
WriteMacInt32(pb + csParam, 0); // response will directly be written into buffer
// vm_memcpy(bufferptr, str, 9);
memcpy(Mac2HostAddr(bufferptr),str,9);
return noErr;
}
case siDeviceIcon: {
M68kRegisters r;
static const uint8 proc[] = {
0x55, 0x8f, // subq.l #2,sp
0xa9, 0x94, // CurResFile
0x42, 0x67, // clr.w -(sp)
0xa9, 0x98, // UseResFile
0x59, 0x8f, // subq.l #4,sp
0x48, 0x79, 0x49, 0x43, 0x4e, 0x23, // move.l #'ICN#',-(sp)
0x3f, 0x3c, 0xbf, 0x76, // move.w #-16522,-(sp)
0xa9, 0xa0, // GetResource
0x24, 0x5f, // move.l (sp)+,a2
0xa9, 0x98, // UseResFile
0x20, 0x0a, // move.l a2,d0
0x66, 0x04, // bne 1
0x70, 0x00, // moveq #0,d0
M68K_RTS >> 8, M68K_RTS & 0xff,
0x2f, 0x0a, //1 move.l a2,-(sp)
0xa9, 0x92, // DetachResource
0x20, 0x4a, // move.l a2,a0
0xa0, 0x4a, // HNoPurge
0x70, 0x01, // moveq #1,d0
M68K_RTS >> 8, M68K_RTS & 0xff
};
Execute68k(Host2MacAddr((uint8 *)proc), &r);
if (r.d[0]) {
param[0] = 4; // Length of returned data
param[1] = r.a[2]; // Handle to icon suite
return noErr;
} else
return -192; // resNotFound
// Borrow ICN resource from cd rom driver, just a hack since loading a true ICN would be better
WriteMacInt32(pb + csParam, 0);
WriteMacInt32(bufferptr, CDROMIconAddr);
return noErr;
// 68k code causes crash in sheep and link error in basilisk
// M68kRegisters r;
// static const uint8 proc[] = {
// 0x55, 0x8f, // subq.l #2,sp
// 0xa9, 0x94, // CurResFile
// 0x42, 0x67, // clr.w -(sp)
// 0xa9, 0x98, // UseResFile
// 0x59, 0x8f, // subq.l #4,sp
// 0x48, 0x79, 0x49, 0x43, 0x4e, 0x23, // move.l #'ICN#',-(sp)
// 0x3f, 0x3c, 0xbf, 0x76, // move.w #-16522,-(sp)
// 0xa9, 0xa0, // GetResource
// 0x24, 0x5f, // move.l (sp)+,a2
// 0xa9, 0x98, // UseResFile
// 0x20, 0x0a, // move.l a2,d0
// 0x66, 0x04, // bne 1
// 0x70, 0x00, // moveq #0,d0
// M68K_RTS >> 8, M68K_RTS & 0xff,
// 0x2f, 0x0a, //1 move.l a2,-(sp)
// 0xa9, 0x92, // DetachResource
// 0x20, 0x4a, // move.l a2,a0
// 0xa0, 0x4a, // HNoPurge
// 0x70, 0x01, // moveq #1,d0
// M68K_RTS >> 8, M68K_RTS & 0xff
// };
// Execute68k(Host2MacAddr((uint8 *)proc), &r);
// if (r.d[0]) {
// WriteMacInt32(pb + csParam, 4); // Length of returned data
// WriteMacInt32(pb + csParam + 4, r.a[2]); // Handle to icon suite
// return noErr;
// } else
// return -192; // resNotFound
}
#endif
case siInputSource: {
// return -231 if only 1 or index if more
return -231;
// WriteMacInt32(pb + csParam, 4);
// WriteMacInt32(pb + csParam + 4, 1); // index 1
// return noErr;
}
case siInputSourceNames: { // list of sources in STR# resource format
// return -231 if only 1 or handle to STR# resource if more
return -231;
// const uint8 str[] = {
// 0x00, 0x02, // 2-byte count of #strings
// 0x0b, // byte size indicator (up to 255 length supported)
// 0x49, 0x6e, // start of string in ASCII, In
// 0x74, 0x65, // te
// 0x72, 0x6e, // rn
// 0x61, 0x6c, // al
// 0x20, 0x43, // C
// 0x44, // D
// 0x0a, // size is 10
// 0x4d, 0x69, // Mi
// 0x63, 0x72, // cr
// 0x6f, 0x70, // op
// 0x68, 0x6f, // ho
// 0x6e, 0x65, // ne
// };
//
// WriteMacInt32(pb + csParam, 0);
// vm_memcpy(bufferptr, str, 25);
// return noErr;
}
case siOptionsDialog: {
// 0 if no options box supported and 1 if so
WriteMacInt32(pb + csParam, 4);
WriteMacInt32(pb + csParam + 4, 0);
return noErr;
}
case siPlayThruOnOff: {
// playthrough volume, 0 is off and 7 is max
WriteMacInt32(pb + csParam, 4);
WriteMacInt32(pb + csParam + 4, 0);
return noErr;
}
//#endif
default:
return -231; // siUnknownInfoType
}

View File

@ -41,6 +41,8 @@
#include <sys/stat.h>
#include <errno.h>
#include <vector>
#ifdef OSX_CORE_AUDIO
#include "../MacOSX/MacOSX_sound_if.h"
static int bincue_core_audio_callback(void);
@ -51,15 +53,20 @@ static int bincue_core_audio_callback(void);
#include <SDL_audio.h>
#endif
#include "bincue_unix.h"
#ifdef WIN32
#define bzero(b,len) (memset((b), '\0', (len)), (void) 0)
#define bcopy(b1,b2,len) (memmove((b2), (b1), (len)), (void) 0)
#endif
#include "bincue.h"
#define DEBUG 0
#include "debug.h"
#define MAXTRACK 100
#define MAXLINE 512
#define CD_FRAMES 75
#define RAW_SECTOR_SIZE 2352
#define COOKED_SECTOR_SIZE 2048
//#define RAW_SECTOR_SIZE 2352
//#define COOKED_SECTOR_SIZE 2048
// Bits of Track Control Field -- These are standard for scsi cd players
@ -91,6 +98,7 @@ typedef struct {
unsigned int length; // Track length in frames
loff_t fileoffset; // Track frame start within file
unsigned int pregap; // Silence in frames to generate
unsigned int postgap; // Silence in frames to generate at end
unsigned char tcf; // Track control field
} Track;
@ -99,7 +107,10 @@ typedef struct {
unsigned int length; // file length in frames
int binfh; // binary file handle
int tcnt; // number of tracks
Track tracks[MAXTRACK];
Track tracks[MAXTRACK]; // Track management
int raw_sector_size; // Raw bytes to read per sector
int cooked_sector_size; // Actual data bytes per sector (depends on Mode)
int header_size; // Number of bytes used in header
} CueSheet;
typedef struct {
@ -110,10 +121,17 @@ typedef struct {
unsigned int audioend; // end position if playing (frames)
unsigned int silence; // pregap (silence) bytes
unsigned char audiostatus; // See defines above for status
uint8 volume_left; // CD player volume (left)
uint8 volume_right; // CD player volume (right)
uint8 volume_mono; // CD player single-channel volume
loff_t fileoffset; // offset from file beginning to audiostart
bool audio_enabled = false; // audio initialized for this player?
#ifdef OSX_CORE_AUDIO
OSXsoundOutput soundoutput;
#endif
#ifdef USE_SDL_AUDIO
SDL_AudioStream *stream;
#endif
} CDPlayer;
// Minute,Second,Frame data type
@ -127,15 +145,24 @@ typedef struct {
static unsigned int totalPregap;
static unsigned int prestart;
// Audio System State
// Audio System Variables
static bool audio_enabled = false;
static uint8 silence_byte;
// CD Player state. Note only one player is supported !
// CD Player state; multiple players supported through vectors
static CDPlayer player;
std::vector<CDPlayer*> players;
CDPlayer* currently_playing = NULL;
CDPlayer* CSToPlayer(CueSheet* cs)
{
for (std::vector<CDPlayer*>::iterator it = players.begin(); it != players.end(); ++it)
if (cs == (*it)->cs) // look for cuesheet matching existing player
return *it;
return NULL; // if no player with the cuesheet found, return null player
}
static void FramesToMSF(unsigned int frames, MSF *msf)
{
@ -181,7 +208,7 @@ static bool AddTrack(CueSheet *cs)
}
}
curr->fileoffset = curr->start * RAW_SECTOR_SIZE;
curr->fileoffset = curr->start * cs->raw_sector_size;
// now we patch up the indicated time
@ -236,6 +263,11 @@ static bool ParseCueSheet(FILE *fh, CueSheet *cs, const char *cuefile)
totalPregap = 0;
prestart = 0;
// Use Audio CD settings by default, otherwise data mode will be specified
cs->raw_sector_size = 2352;
cs->cooked_sector_size = 2352;
cs->header_size = 0;
while (fgets(line, MAXLINE, fh) != NULL) {
Track *curr = &cs->tracks[cs->tcnt];
@ -294,11 +326,24 @@ static bool ParseCueSheet(FILE *fh, CueSheet *cs, const char *cuefile)
}
curr->number = i_track;
// parse track type
// parse track type and update sector size for data discs if applicable
field = strtok(NULL, " \t\n\r");
if (!strcmp("MODE1/2352", field)) {
if (!strcmp("MODE1/2352", field)) { // red-book CD-ROM standard
curr->tcf = DATA;
cs->raw_sector_size = 2352;
cs->cooked_sector_size = 2048;
cs->header_size = 16; // remaining 288 bytes for error detection
} else if (!strcmp("MODE2/2352", field)) { // yellow-book CD-ROM standard
curr->tcf = DATA;
cs->raw_sector_size = 2352;
cs->cooked_sector_size = 2336; // no error bytes at end
cs->header_size = 16;
} else if (!strcmp("MODE1/2048", field)) { // pure data CD-ROM
curr->tcf = DATA;
cs->raw_sector_size = 2048;
cs->cooked_sector_size = 2048;
cs->header_size = 0; // no header or error bytes
} else if (!strcmp("AUDIO", field)) {
curr->tcf = AUDIO;
} else {
@ -342,8 +387,18 @@ static bool ParseCueSheet(FILE *fh, CueSheet *cs, const char *cuefile)
}
curr->pregap = MSFToFrames(msf);
} else if (!strcmp("POSTGAP", keyword)) {
MSF msf;
char *field = strtok(NULL, " \t\n\r");
if (3 != sscanf(field, "%d:%d:%d",
&msf.m, &msf.s, &msf.f)) {
D(bug("Expected postgap frame\n"));
goto fail;
}
curr->postgap = MSFToFrames(msf);
// Ignored directives
} else if (!strcmp("TITLE", keyword)) {
} else if (!strcmp("PERFORMER", keyword)) {
} else if (!strcmp("REM", keyword)) {
@ -377,8 +432,12 @@ static bool LoadCueSheet(const char *cuefile, CueSheet *cs)
if (!ParseCueSheet(fh, cs, cuefile)) goto fail;
// Open bin file and find length
if ((binfh = open(cs->binfile,O_RDONLY)) < 0) {
#ifdef WIN32
binfh = open(cs->binfile,O_RDONLY|O_BINARY);
#else
binfh = open(cs->binfile,O_RDONLY);
#endif
if (binfh < 0) {
D(bug("Can't read bin file %s\n", cs->binfile));
goto fail;
}
@ -392,7 +451,7 @@ static bool LoadCueSheet(const char *cuefile, CueSheet *cs)
tlast = &cs->tracks[cs->tcnt - 1];
tlast->length = buf.st_size/RAW_SECTOR_SIZE
tlast->length = buf.st_size/cs->raw_sector_size
- tlast->start + totalPregap;
if (tlast->length < 0) {
@ -402,7 +461,7 @@ static bool LoadCueSheet(const char *cuefile, CueSheet *cs)
// save bin file length and pointer
cs->length = buf.st_size/RAW_SECTOR_SIZE;
cs->length = buf.st_size/cs->raw_sector_size;
cs->binfh = binfh;
fclose(fh);
@ -423,45 +482,62 @@ static bool LoadCueSheet(const char *cuefile, CueSheet *cs)
void *open_bincue(const char *name)
{
CueSheet *cs;
if (player.cs == NULL) {
cs = (CueSheet *) malloc(sizeof(CueSheet));
if (!cs) {
D(bug("malloc failed\n"));
return NULL;
}
if (LoadCueSheet(name, cs)) {
player.cs = cs;
#ifdef OSX_CORE_AUDIO
audio_enabled = true;
#endif
if (audio_enabled)
player.audiostatus = CDROM_AUDIO_NO_STATUS;
else
player.audiostatus = CDROM_AUDIO_INVALID;
player.audiofh = dup(cs->binfh);
return cs;
}
else
free(cs);
CueSheet *cs = (CueSheet *) malloc(sizeof(CueSheet));
if (!cs) {
D(bug("malloc failed\n"));
return NULL;
}
if (LoadCueSheet(name, cs)) {
CDPlayer *player = (CDPlayer *) malloc(sizeof(CDPlayer));
player->cs = cs;
player->volume_left = 0;
player->volume_right = 0;
player->volume_mono = 0;
#ifdef OSX_CORE_AUDIO
player->audio_enabled = true;
#endif
if (player->audio_enabled)
player->audiostatus = CDROM_AUDIO_NO_STATUS;
else
player->audiostatus = CDROM_AUDIO_INVALID;
player->audiofh = dup(cs->binfh);
// add to list of available CD players
players.push_back(player);
return cs;
}
else
free(cs);
return NULL;
}
void close_bincue(void *fh)
{
CueSheet *cs = (CueSheet *) fh;
CDPlayer *player = CSToPlayer(cs);
if (cs && player) {
free(cs);
#ifdef USE_SDL_AUDIO
if (player->stream) // if audiostream has been opened, free it as well
free(player->stream);
#endif
free(player);
}
}
/*
* File read (cooked)
* Data are stored in raw sectors of which only COOKED_SECTOR_SIZE
* bytes are valid -- the remaining include 16 bytes at the beginning
* bytes are valid -- the remaining include header bytes at the beginning
* of each raw sector and RAW_SECTOR_SIZE - COOKED_SECTOR_SIZE - bytes
* at the end
* at the end for error correction
*
* The actual number of bytes used for header, raw, cooked, error depend
* on mode specified in the cuesheet
*
* We assume that a read request can land in the middle of
* sector. We compute the byte address of that sector (sec)
@ -473,20 +549,20 @@ void close_bincue(void *fh)
size_t read_bincue(void *fh, void *b, loff_t offset, size_t len)
{
CueSheet *cs = (CueSheet *) fh;
size_t bytes_read = 0; // bytes read so far
unsigned char *buf = (unsigned char *) b; // target buffer
unsigned char secbuf[RAW_SECTOR_SIZE]; // temporary buffer
unsigned char secbuf[cs->raw_sector_size]; // temporary buffer
off_t sec = ((offset/COOKED_SECTOR_SIZE) * RAW_SECTOR_SIZE);
off_t secoff = offset % COOKED_SECTOR_SIZE;
off_t sec = ((offset/cs->cooked_sector_size) * cs->raw_sector_size);
off_t secoff = offset % cs->cooked_sector_size;
// sec contains location (in bytes) of next raw sector to read
// secoff contains offset within that sector at which to start
// reading since we can request a read that starts in the middle
// of a sector
CueSheet *cs = (CueSheet *) fh;
if (cs == NULL || lseek(cs->binfh, sec, SEEK_SET) < 0) {
return -1;
}
@ -495,19 +571,19 @@ size_t read_bincue(void *fh, void *b, loff_t offset, size_t len)
// bytes available in next raw sector or len (bytes)
// we want whichever is less
size_t available = COOKED_SECTOR_SIZE - secoff;
size_t available = cs->cooked_sector_size - secoff;
available = (available > len) ? len : available;
// read the next raw sector
if (read(cs->binfh, secbuf, RAW_SECTOR_SIZE) != RAW_SECTOR_SIZE) {
if (read(cs->binfh, secbuf, cs->raw_sector_size) != cs->raw_sector_size) {
return bytes_read;
}
// copy cooked sector bytes (skip first 16)
// copy cooked sector bytes (skip header if needed, typically 16 bytes)
// we want out of those available
bcopy(&secbuf[16+secoff], &buf[bytes_read], available);
bcopy(&secbuf[cs->header_size+secoff], &buf[bytes_read], available);
// next sector we start at the beginning
@ -524,7 +600,7 @@ size_t read_bincue(void *fh, void *b, loff_t offset, size_t len)
loff_t size_bincue(void *fh)
{
if (fh) {
return ((CueSheet *)fh)->length * COOKED_SECTOR_SIZE;
return ((CueSheet *)fh)->length * ((CueSheet *)fh)->cooked_sector_size;
}
return 0;
}
@ -571,20 +647,22 @@ bool readtoc_bincue(void *fh, unsigned char *toc)
bool GetPosition_bincue(void *fh, uint8 *pos)
{
CueSheet *cs = (CueSheet *) fh;
if (cs && player.cs == cs) {
CDPlayer *player = CSToPlayer(cs);
if (cs && player) {
MSF abs, rel;
int fpos = player.audioposition / RAW_SECTOR_SIZE + player.audiostart;
int fpos = player->audioposition / cs->raw_sector_size + player->audiostart;
int trackno = PositionToTrack(cs, fpos);
if (!audio_enabled)
if (!(player->audio_enabled))
return false;
FramesToMSF(fpos, &abs);
if (trackno < cs->tcnt) {
// compute position relative to start of frame
unsigned int position = player.audioposition/RAW_SECTOR_SIZE +
player.audiostart - player.cs->tracks[trackno].start;
unsigned int position = player->audioposition/cs->raw_sector_size +
player->audiostart - player->cs->tracks[trackno].start;
FramesToMSF(position, &rel);
}
@ -592,7 +670,7 @@ bool GetPosition_bincue(void *fh, uint8 *pos)
FramesToMSF(0, &rel);
*pos++ = 0;
*pos++ = player.audiostatus;
*pos++ = player->audiostatus;
*pos++ = 0;
*pos++ = 12; // Sub-Q data length
*pos++ = 0;
@ -608,7 +686,7 @@ bool GetPosition_bincue(void *fh, uint8 *pos)
*pos++ = rel.m;
*pos++ = rel.s;
*pos++ = rel.f;
*pos++ = 0;
// *pos++ = 0;
// D(bug("CDROM position %02d:%02d:%02d track %02d\n", abs.m, abs.s, abs.f, trackno));
return true;
}
@ -616,14 +694,26 @@ bool GetPosition_bincue(void *fh, uint8 *pos)
return false;
}
void CDPause_playing(CDPlayer* player) {
if (currently_playing && currently_playing != player) {
currently_playing->audiostatus = CDROM_AUDIO_PAUSED;
currently_playing = NULL;
}
}
bool CDPause_bincue(void *fh)
{
CueSheet *cs = (CueSheet *) fh;
if (cs && cs == player.cs) {
if (player.audiostatus == CDROM_AUDIO_PLAY) {
player.audiostatus = CDROM_AUDIO_PAUSED;
return true;
}
CDPlayer *player = CSToPlayer(cs);
if (cs && player) {
// Pause another player if needed
CDPause_playing(player);
// doesn't matter if it was playing, just ensure it's now paused
player->audiostatus = CDROM_AUDIO_PAUSED;
currently_playing = NULL;
return true;
}
return false;
}
@ -631,13 +721,19 @@ bool CDPause_bincue(void *fh)
bool CDStop_bincue(void *fh)
{
CueSheet *cs = (CueSheet *) fh;
if (cs && cs == player.cs) {
CDPlayer *player = CSToPlayer(cs);
if (cs && player) {
// Pause another player if needed
CDPause_playing(player);
#ifdef OSX_CORE_AUDIO
player.soundoutput.stop();
player->soundoutput.stop();
#endif
if (player.audiostatus != CDROM_AUDIO_INVALID)
player.audiostatus = CDROM_AUDIO_NO_STATUS;
if (player->audiostatus != CDROM_AUDIO_INVALID)
player->audiostatus = CDROM_AUDIO_NO_STATUS;
currently_playing = NULL;
return true;
}
return false;
@ -646,11 +742,16 @@ bool CDStop_bincue(void *fh)
bool CDResume_bincue(void *fh)
{
CueSheet *cs = (CueSheet *) fh;
if (cs && cs == player.cs) {
if (player.audiostatus == CDROM_AUDIO_PAUSED) {
player.audiostatus = CDROM_AUDIO_PLAY;
return true;
}
CDPlayer *player = CSToPlayer(cs);
if (cs && player) {
// Pause another player if needed
CDPause_playing(player);
// doesn't matter if it was paused, just ensure this one plays now
player->audiostatus = CDROM_AUDIO_PLAY;
currently_playing = player;
return true;
}
return false;
}
@ -658,8 +759,13 @@ bool CDResume_bincue(void *fh)
bool CDPlay_bincue(void *fh, uint8 start_m, uint8 start_s, uint8 start_f,
uint8 end_m, uint8 end_s, uint8 end_f)
{
CueSheet *cs = (CueSheet *)fh;
if (cs && cs == player.cs) {
CueSheet *cs = (CueSheet *) fh;
CDPlayer *player = CSToPlayer(cs);
if (cs && player) {
// Pause another player if needed
CDPause_playing(player);
int track;
MSF msf;
@ -667,42 +773,42 @@ bool CDPlay_bincue(void *fh, uint8 start_m, uint8 start_s, uint8 start_f,
SDL_LockAudio();
#endif
player.audiostatus = CDROM_AUDIO_NO_STATUS;
player->audiostatus = CDROM_AUDIO_NO_STATUS;
player.audiostart = (start_m * 60 * CD_FRAMES) +
player->audiostart = (start_m * 60 * CD_FRAMES) +
(start_s * CD_FRAMES) + start_f;
player.audioend = (end_m * 60 * CD_FRAMES) + (end_s * CD_FRAMES) + end_f;
player->audioend = (end_m * 60 * CD_FRAMES) + (end_s * CD_FRAMES) + end_f;
track = PositionToTrack(player.cs, player.audiostart);
track = PositionToTrack(player->cs, player->audiostart);
if (track < player.cs->tcnt) {
player.audioposition = 0;
if (track < player->cs->tcnt) {
player->audioposition = 0;
// here we need to compute silence
if (player.audiostart - player.cs->tracks[track].start >
player.cs->tracks[track].pregap)
player.silence = 0;
if (player->audiostart - player->cs->tracks[track].start >
player->cs->tracks[track].pregap)
player->silence = 0;
else
player.silence = (player.cs->tracks[track].pregap -
player.audiostart +
player.cs->tracks[track].start) * RAW_SECTOR_SIZE;
player->silence = (player->cs->tracks[track].pregap -
player->audiostart +
player->cs->tracks[track].start) * cs->raw_sector_size;
player.fileoffset = player.cs->tracks[track].fileoffset;
player->fileoffset = player->cs->tracks[track].fileoffset;
D(bug("file offset %d\n", (unsigned int) player.fileoffset));
D(bug("file offset %d\n", (unsigned int) player->fileoffset));
// fix up file offset if beyond the silence bytes
if (!player.silence) // not at the beginning
player.fileoffset += (player.audiostart -
player.cs->tracks[track].start -
player.cs->tracks[track].pregap) * RAW_SECTOR_SIZE;
if (!player->silence) // not at the beginning
player->fileoffset += (player->audiostart -
player->cs->tracks[track].start -
player->cs->tracks[track].pregap) * cs->raw_sector_size;
FramesToMSF(player.cs->tracks[track].start, &msf);
FramesToMSF(player->cs->tracks[track].start, &msf);
D(bug("CDPlay_bincue track %02d start %02d:%02d:%02d silence %d",
player.cs->tracks[track].number, msf.m, msf.s, msf.f,
player.silence/RAW_SECTOR_SIZE));
player->cs->tracks[track].number, msf.m, msf.s, msf.f,
player->silence/cs->raw_sector_size));
D(bug(" Stop %02u:%02u:%02u\n", end_m, end_s, end_f));
}
else
@ -712,21 +818,71 @@ bool CDPlay_bincue(void *fh, uint8 start_m, uint8 start_s, uint8 start_f,
SDL_UnlockAudio();
#endif
if (audio_enabled) {
player.audiostatus = CDROM_AUDIO_PLAY;
if (player->audio_enabled) {
player->audiostatus = CDROM_AUDIO_PLAY;
#ifdef OSX_CORE_AUDIO
D(bug("starting os x sound"));
player.soundoutput.setCallback(bincue_core_audio_callback);
player->soundoutput.setCallback(bincue_core_audio_callback);
// should be from current track !
player.soundoutput.start(16, 2, 44100);
player->soundoutput.start(16, 2, 44100);
#endif
currently_playing = player;
return true;
}
}
return false;
}
static uint8 *fill_buffer(int stream_len)
bool CDScan_bincue(void *fh, uint8 start_m, uint8 start_s, uint8 start_f, bool reverse) {
CueSheet *cs = (CueSheet *) fh;
CDPlayer *player = CSToPlayer(cs);
if (cs && player) {
uint8 scanrate = 8; // 8x scan default but could use different value or make configurable
MSF msf;
msf.m = start_m; msf.s = start_s; msf.f = start_f;
int current_frame = MSFToFrames(msf);
if (reverse) {
msf.s -= scanrate;
int goto_frame = MSFToFrames(msf);
player->audioposition -= (current_frame - goto_frame) * player->cs->raw_sector_size;
}
else {
msf.s += scanrate;
int goto_frame = MSFToFrames(msf);
player->audioposition += (goto_frame - current_frame) * player->cs->raw_sector_size;
}
return true;
}
return false;
}
void CDSetVol_bincue(void* fh, uint8 left, uint8 right) {
CueSheet *cs = (CueSheet *) fh;
CDPlayer *player = CSToPlayer(cs);
if (cs && player) {
// Convert from classic Mac's 0-255 to 0-128;
// calculate mono mix as well in place of panning
player->volume_left = (left*128)/255;
player->volume_right = (right*128)/255;
player->volume_mono = (player->volume_left + player->volume_right)/2; // use avg
}
}
void CDGetVol_bincue(void* fh, uint8* left, uint8* right) {
CueSheet *cs = (CueSheet *) fh;
CDPlayer *player = CSToPlayer(cs);
if (cs && player) { // Convert from 0-128 to 0-255 scale
*left = (player->volume_left*255)/128;
*right = (player->volume_right*255)/128;
}
}
static uint8 *fill_buffer(int stream_len, CDPlayer* player)
{
static uint8 *buf = 0;
static int bufsize = 0;
@ -745,44 +901,44 @@ static uint8 *fill_buffer(int stream_len)
}
memset(buf, silence_byte, stream_len);
if (player->audiostatus == CDROM_AUDIO_PLAY) {
int remaining_silence = player->silence - player->audioposition;
if (player.audiostatus == CDROM_AUDIO_PLAY) {
int remaining_silence = player.silence - player.audioposition;
if (player.audiostart + player.audioposition/RAW_SECTOR_SIZE
>= player.audioend) {
player.audiostatus = CDROM_AUDIO_COMPLETED;
if (player->audiostart + player->audioposition/player->cs->raw_sector_size
>= player->audioend) {
player->audiostatus = CDROM_AUDIO_COMPLETED;
return buf;
}
if (remaining_silence >= stream_len) {
player.audioposition += stream_len;
player->audioposition += stream_len;
return buf;
}
if (remaining_silence > 0) {
offset += remaining_silence;
player.audioposition += remaining_silence;
player->audioposition += remaining_silence;
}
int ret = 0;
int available = ((player.audioend - player.audiostart) *
RAW_SECTOR_SIZE) - player.audioposition;
int available = ((player->audioend - player->audiostart) *
player->cs->raw_sector_size) - player->audioposition;
if (available > (stream_len - offset))
available = stream_len - offset;
if (lseek(player.audiofh,
player.fileoffset + player.audioposition - player.silence,
if (lseek(player->audiofh,
player->fileoffset + player->audioposition - player->silence,
SEEK_SET) < 0)
return NULL;
if (available < 0) {
player.audioposition += available; // correct end !;
player->audioposition += available; // correct end !;
available = 0;
}
if ((ret = read(player.audiofh, &buf[offset], available)) >= 0) {
player.audioposition += ret;
if ((ret = read(player->audiofh, &buf[offset], available)) >= 0) {
player->audioposition += ret;
offset += ret;
available -= ret;
}
@ -790,33 +946,56 @@ static uint8 *fill_buffer(int stream_len)
while (offset < stream_len) {
buf[offset++] = silence_byte;
if (available-- > 0){
player.audioposition++;
player->audioposition++;
}
}
}
}
return buf;
}
#ifdef USE_SDL_AUDIO
void MixAudio_bincue(uint8 *stream, int stream_len)
void MixAudio_bincue(uint8 *stream, int stream_len, int volume)
{
if (audio_enabled && (player.audiostatus == CDROM_AUDIO_PLAY)) {
uint8 *buf = fill_buffer(stream_len);
if (buf)
SDL_MixAudio(stream, buf, stream_len, SDL_MIX_MAXVOLUME);
if (currently_playing) {
CDPlayer *player = currently_playing;
if (player->audiostatus == CDROM_AUDIO_PLAY) {
uint8 *buf = fill_buffer(stream_len, player);
if (buf)
SDL_AudioStreamPut(player->stream, buf, stream_len);
int avail = SDL_AudioStreamAvailable(player->stream);
if (avail >= stream_len) {
uint8 converted[stream_len];
SDL_AudioStreamGet(player->stream, converted, stream_len);
SDL_MixAudio(stream, converted, stream_len, player->volume_mono);
}
}
}
}
void OpenAudio_bincue(int freq, int format, int channels, uint8 silence)
void OpenAudio_bincue(int freq, int format, int channels, uint8 silence, int volume)
{
if (freq == 44100 && format == AUDIO_S16MSB && channels == 2) {
audio_enabled = true;
silence_byte = silence;
}
else {
D(bug("unexpected frequency %d , format %d, or channels %d\n",
freq, format, channels));
// setup silence at init
silence_byte = silence;
// init players
for (std::vector<CDPlayer*>::iterator it = players.begin(); it != players.end(); ++it)
{
CDPlayer *player = *it;
// set player volume based on SDL volume
player->volume_left = player->volume_right = player->volume_mono = volume;
// audio stream handles converting cd audio to destination output
player->stream = SDL_NewAudioStream(AUDIO_S16LSB, 2, 44100, format, channels, freq);
if (player->stream == NULL) {
D(bug("Failed to open CD player audio stream using SDL!"));
}
else {
player->audio_enabled = true;
}
}
}
#endif
@ -824,13 +1003,18 @@ void OpenAudio_bincue(int freq, int format, int channels, uint8 silence)
#ifdef OSX_CORE_AUDIO
static int bincue_core_audio_callback(void)
{
int frames = player.soundoutput.bufferSizeFrames();
uint8 *buf = fill_buffer(frames*4);
for (std::vector<CDPlayer*>::iterator it = players.begin(); it != players.end(); ++it)
{
CDPlayer *player = *it;
int frames = player->soundoutput.bufferSizeFrames();
uint8 *buf = fill_buffer(frames*4);
// D(bug("Audio request %d\n", stream_len));
// D(bug("Audio request %d\n", stream_len));
player.soundoutput.sendAudioBuffer((void *) buf, (buf ? frames : 0));
player->soundoutput.sendAudioBuffer((void *) buf, (buf ? frames : 0));
return 1;
return 1;
}
}
#endif

View File

@ -58,7 +58,7 @@ const uint8 CDROMIcon[258] = {
0x8a, 0xaa, 0xaa, 0xe4, 0x8d, 0x55, 0x55, 0xc4, 0x86, 0xaa, 0xab, 0xc4, 0x83, 0x55, 0x57, 0x84,
0x81, 0xaa, 0xaf, 0x04, 0x80, 0xf5, 0x7e, 0x04, 0x80, 0x3f, 0xf8, 0x04, 0x80, 0x0f, 0xe0, 0x04,
0xff, 0xff, 0xff, 0xfc, 0x80, 0x00, 0x00, 0x04, 0x80, 0x1f, 0xf0, 0x04, 0x7f, 0xff, 0xff, 0xf8,
0x3f, 0xff, 0xff, 0xf0, 0x7f, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc,
0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc,
0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc,
@ -67,7 +67,7 @@ const uint8 CDROMIcon[258] = {
0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc,
0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc,
0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xf8,
0, 0
};
@ -103,7 +103,7 @@ static const uint8 bin2bcd[256] = {
};
static const uint8 bcd2bin[256] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
@ -126,9 +126,9 @@ static const uint8 bcd2bin[256] = {
struct cdrom_drive_info {
cdrom_drive_info() : num(0), fh(NULL), start_byte(0), status(0) {}
cdrom_drive_info(void *fh_) : num(0), fh(fh_), start_byte(0), status(0) {}
void close_fh(void) { SysAllowRemoval(fh); Sys_close(fh); }
int num; // Drive number
void *fh; // File handle
int block_size; // CD-ROM block size
@ -136,12 +136,15 @@ struct cdrom_drive_info {
loff_t start_byte; // Start of HFS partition on disk
bool to_be_mounted; // Flag: drive must be mounted in accRun
bool mount_non_hfs; // Flag: Issue disk-inserted events for non-HFS disks
uint8 toc[804]; // TOC of currently inserted disk
uint8 lead_out[3]; // MSF address of lead-out track
uint8 stop_at[3]; // MSF address of audio play stopping point
uint8 start_at[3]; // MSF address of position set by track search or audio play
uint8 play_mode; // Audio play mode
uint8 play_order; // Play mode order (normal, shuffle, program)
bool repeat; // Repeat flag
uint8 power_mode; // Power mode
uint32 status; // Mac address of drive status record
};
@ -150,6 +153,8 @@ struct cdrom_drive_info {
typedef vector<cdrom_drive_info> drive_vec;
static drive_vec drives;
int last_drive_num; // track last drive called to support multiple audio CDs
// Icon address (Mac address space, set by PatchROM())
uint32 CDROMIconAddr;
@ -165,8 +170,10 @@ static drive_vec::iterator get_drive_info(int num)
{
drive_vec::iterator info, end = drives.end();
for (info = drives.begin(); info != end; ++info) {
if (info->num == num)
if (info->num == num) {
last_drive_num = num;
return info;
}
}
return info;
}
@ -181,18 +188,18 @@ static void find_hfs_partition(cdrom_drive_info &info)
info.start_byte = 0;
uint8 *map = new uint8[512];
D(bug("Looking for HFS partitions on CD-ROM...\n"));
// Search first 64 blocks for HFS partition
for (int i=0; i<64; i++) {
if (Sys_read(info.fh, map, i * 512, 512) != 512)
break;
D(bug(" block %d, signature '%c%c' (%02x%02x)\n", i, map[0], map[1], map[0], map[1]));
// Not a partition map block? Then look at next block
uint16 sig = (map[0] << 8) | map[1];
if (sig != 0x504d)
continue;
// Partition map block found, Apple HFS partition?
if (strcmp((char *)(map + 48), "Apple_HFS") == 0) {
info.start_byte = (loff_t)((map[8] << 24) | (map[9] << 16) | (map[10] << 8) | map[11]) << 9;
@ -214,7 +221,7 @@ static void read_toc(cdrom_drive_info &info)
// Read TOC
memset(info.toc, 0, sizeof(info.toc));
SysCDReadTOC(info.fh, info.toc);
#if DEBUG
// Dump TOC for debugging
D(bug(" TOC:\n %02x%02x%02x%02x : %d bytes, first track = %d, last track = %d\n", info.toc[0], info.toc[1], info.toc[2], info.toc[3], (info.toc[0] << 8) | info.toc[1], info.toc[2], info.toc[3]));
@ -226,7 +233,12 @@ static void read_toc(cdrom_drive_info &info)
break;
}
#endif
// Default start
info.start_at[0] = 0;
info.start_at[1] = 0;
info.start_at[2] = 0;
// Find lead-out track
info.lead_out[0] = 0;
info.lead_out[1] = 0;
@ -288,16 +300,25 @@ static bool position2msf(const cdrom_drive_info &info, uint16 postype, uint32 po
void CDROMInit(void)
{
// No drives specified in prefs? Then add defaults
if (PrefsFindString("cdrom", 0) == NULL)
if (PrefsFindString("cdrom", 0) == NULL) {
SysAddCDROMPrefs();
// Add drives specified in preferences
int index = 0;
const char *str;
while ((str = PrefsFindString("cdrom", index++)) != NULL) {
void *fh = Sys_open(str, true);
if (fh)
drives.push_back(cdrom_drive_info(fh));
}
else {
// Add drives specified in preferences
int index = 0;
const char *str;
while ((str = PrefsFindString("cdrom", index++)) != NULL) {
void *fh = Sys_open(str, true);
if (fh)
drives.push_back(cdrom_drive_info(fh));
}
}
if (!drives.empty()) { // set to first drive by default
last_drive_num = drives.begin()->num;
}
else {
last_drive_num = 0;
}
}
@ -348,15 +369,15 @@ static void mount_mountable_volumes(void)
{
drive_vec::iterator info, end = drives.end();
for (info = drives.begin(); info != end; ++info) {
// Disk in drive?
if (ReadMacInt8(info->status + dsDiskInPlace) == 0) {
// No, check if disk was inserted
if (SysIsDiskInserted(info->fh))
CDROMMountVolume(info->fh);
}
// Mount disk if flagged
if (info->to_be_mounted) {
D(bug(" mounting drive %d\n", info->num));
@ -377,25 +398,27 @@ static void mount_mountable_volumes(void)
int16 CDROMOpen(uint32 pb, uint32 dce)
{
D(bug("CDROMOpen\n"));
// Set up DCE
WriteMacInt32(dce + dCtlPosition, 0);
acc_run_called = false;
// Install drives
drive_vec::iterator info, end = drives.end();
for (info = drives.begin(); info != end; ++info) {
info->num = FindFreeDriveNumber(1);
info->to_be_mounted = false;
if (info->fh) {
info->mount_non_hfs = true;
info->block_size = 512;
info->twok_offset = -1;
info->play_mode = 0x09;
info->play_order = 0;
info->repeat = 0;
info->power_mode = 0;
// Allocate drive status record
M68kRegisters r;
r.d[0] = SIZEOF_DrvSts;
@ -404,12 +427,12 @@ int16 CDROMOpen(uint32 pb, uint32 dce)
continue;
info->status = r.a[0];
D(bug(" DrvSts at %08lx\n", info->status));
// Set up drive status
WriteMacInt8(info->status + dsWriteProt, 0x80);
WriteMacInt8(info->status + dsInstalled, 1);
WriteMacInt8(info->status + dsSides, 1);
// Disk in drive?
if (SysIsDiskInserted(info->fh)) {
SysPreventRemoval(info->fh);
@ -418,7 +441,7 @@ int16 CDROMOpen(uint32 pb, uint32 dce)
find_hfs_partition(*info);
info->to_be_mounted = true;
}
// Add drive to drive queue
D(bug(" adding drive %d\n", info->num));
r.d[0] = (info->num << 16) | (CDROMRefNum & 0xffff);
@ -437,14 +460,14 @@ int16 CDROMOpen(uint32 pb, uint32 dce)
int16 CDROMPrime(uint32 pb, uint32 dce)
{
WriteMacInt32(pb + ioActCount, 0);
// Drive valid and disk inserted?
drive_vec::iterator info = get_drive_info(ReadMacInt16(pb + ioVRefNum));
if (info == drives.end())
return nsDrvErr;
if (ReadMacInt8(info->status + dsDiskInPlace) == 0)
return offLinErr;
// Get parameters
void *buffer = Mac2HostAddr(ReadMacInt32(pb + ioBuffer));
size_t length = ReadMacInt32(pb + ioReqCount);
@ -452,17 +475,17 @@ int16 CDROMPrime(uint32 pb, uint32 dce)
if ((length & (info->block_size - 1)) || (position & (info->block_size - 1)))
return paramErr;
info->twok_offset = (position + info->start_byte) & 0x7ff;
size_t actual = 0;
if ((ReadMacInt16(pb + ioTrap) & 0xff) == aRdCmd) {
// Read
actual = Sys_read(info->fh, buffer, position + info->start_byte, length);
if (actual != length) {
// Read error, tried to read HFS root block?
if (length == 0x200 && position == 0x400) {
// Yes, fake (otherwise audio CDs won't get mounted)
memset(buffer, 0, 0x200);
actual = 0x200;
@ -473,7 +496,7 @@ int16 CDROMPrime(uint32 pb, uint32 dce)
} else {
return wPrErr;
}
// Update ParamBlock and DCE
WriteMacInt32(pb + ioActCount, actual);
WriteMacInt32(dce + dCtlPosition, ReadMacInt32(dce + dCtlPosition) + actual);
@ -489,34 +512,37 @@ int16 CDROMControl(uint32 pb, uint32 dce)
{
uint16 code = ReadMacInt16(pb + csCode);
D(bug("CDROMControl %d\n", code));
// General codes
switch (code) {
case 1: // KillIO
return noErr;
case 65: { // Periodic action (accRun, "insert" disks on startup)
mount_mountable_volumes();
WriteMacInt16(dce + dCtlFlags, ReadMacInt16(dce + dCtlFlags) & ~0x2000); // Disable periodic action
acc_run_called = true;
return noErr;
}
case 81: // Set poll freq
WriteMacInt16(dce + dCtlDelay, ReadMacInt16(pb + csParam));
return noErr;
}
// Drive valid?
drive_vec::iterator info = get_drive_info(ReadMacInt16(pb + ioVRefNum));
if (info == drives.end()) {
if (drives.empty()) {
return nsDrvErr;
} else {
info = drives.begin(); // This is needed for Apple's Audio CD program
// Audio calls tend to end up without correct reference
// Real mac would just play first disc, but we can guess correct one from last data call
info = get_drive_info(last_drive_num);
if (info == drives.end()) return nsDrvErr;
}
}
// Drive-specific codes
switch (code) {
case 5: // VerifyTheDisc
@ -524,28 +550,54 @@ int16 CDROMControl(uint32 pb, uint32 dce)
return noErr;
else
return offLinErr;
case 6: // FormatTheDisc
return writErr;
case 7: // EjectTheDisc
if (ReadMacInt8(info->status + dsDiskInPlace) > 0) {
SysAllowRemoval(info->fh);
SysEject(info->fh);
WriteMacInt8(info->status + dsDiskInPlace, 0);
info->twok_offset = -1;
return noErr;
} else {
return offLinErr;
}
return noErr;
case 21: // GetDriveIcon
case 22: // GetMediaIcon
WriteMacInt32(pb + csParam, CDROMIconAddr);
return noErr;
case 23: // GetDriveInfo
WriteMacInt32(pb + csParam, 0x00000b01); // Unspecified external removable SCSI disk
return noErr;
// TODO: revist this section, is it necessary with DriverGestalt also in Status section?
case 43: { // DriverGestalt
int selector = ReadMacInt32(pb + csParam);
switch (selector) {
case FOURCC('v','e','r','s'):
WriteMacInt32(pb + csParam + 4, 0x05208000); // vers 5.2.0
break;
case FOURCC('d','e','v','t'):
WriteMacInt32(pb + csParam + 4, FOURCC('c','d','r','m'));
break;
case FOURCC('i','n','t','f'):
case FOURCC('d','A','P','I'):
WriteMacInt32(pb + csParam + 4, FOURCC('a','t','p','i'));
break;
case FOURCC('s','y','n','c'):
WriteMacInt32(pb + csParam + 4, 1); // true/false = sync/async
break;
case FOURCC('c','d','3','d'):
WriteMacInt32(pb + csParam + 4, 0);
break;
}
return noErr;
}
case 70: { // SetPowerMode
uint8 mode = ReadMacInt8(pb + csParam);
if (mode > 3) {
@ -555,11 +607,11 @@ int16 CDROMControl(uint32 pb, uint32 dce)
return noErr;
}
}
case 76: // ModifyPostEvent
info->mount_non_hfs = ReadMacInt16(pb + csParam) != 0;
return noErr;
case 79: { // Change block size
uint16 size = ReadMacInt16(pb + csParam);
D(bug(" change block size to %d bytes\n", size));
@ -570,7 +622,7 @@ int16 CDROMControl(uint32 pb, uint32 dce)
return noErr;
}
}
case 80: // SetUserEject
if (ReadMacInt8(info->status + dsDiskInPlace) > 0) {
if (ReadMacInt16(pb + csParam) == 1)
@ -581,11 +633,11 @@ int16 CDROMControl(uint32 pb, uint32 dce)
} else {
return offLinErr;
}
case 100: { // ReadTOC
if (ReadMacInt8(info->status + dsDiskInPlace) == 0)
return offLinErr;
int action = ReadMacInt16(pb + csParam);
D(bug(" read TOC %d\n", action));
switch (action) {
@ -594,26 +646,26 @@ int16 CDROMControl(uint32 pb, uint32 dce)
WriteMacInt8(pb + csParam + 1, bin2bcd[info->toc[3]]);
WriteMacInt16(pb + csParam + 2, 0);
break;
case 2: // Get lead out MSF starting address
WriteMacInt8(pb + csParam, bin2bcd[info->lead_out[0]]);
WriteMacInt8(pb + csParam + 1, bin2bcd[info->lead_out[1]]);
WriteMacInt8(pb + csParam + 2, bin2bcd[info->lead_out[2]]);
WriteMacInt8(pb + csParam + 3, 0);
break;
case 3: { // Get track starting address
uint32 buf = ReadMacInt32(pb + csParam + 2);
uint16 buf_size = ReadMacInt16(pb + csParam + 6);
int track = bcd2bin[ReadMacInt8(pb + csParam + 8)];
// Search start track in TOC
int i;
for (i=4; i<804; i+=8) {
if (info->toc[i+2] == track)
break;
}
// Fill buffer
if (i != 804) {
while (buf_size > 0) {
@ -621,18 +673,91 @@ int16 CDROMControl(uint32 pb, uint32 dce)
WriteMacInt8(buf, bin2bcd[info->toc[i+5]]); buf++; // M
WriteMacInt8(buf, bin2bcd[info->toc[i+6]]); buf++; // S
WriteMacInt8(buf, bin2bcd[info->toc[i+7]]); buf++; // F
// Lead-Out? Then stop
if (info->toc[i+2] == 0xaa)
break;
buf_size -= 4;
i += 8;
}
}
break;
}
case 4: { // Type 4 TOC for non-AppleCD SC
uint32 buf = ReadMacInt32(pb + csParam + 2);
uint16 buf_size = 512; // buffer must be 512 bytes for this TOC type
// start filling buffer
WriteMacInt8(buf, 0); buf++; // first byte reserved for 0
buf_size--;
int i = 4;
// in TOC, first 4 are session and/or track number; so tracks start at i = 4
// (info->toc[2] is first track num and info->toc[3] is last num)
// each track entry is 8 bytes:
// 0: unused, 1: control, 2: tracknum, 3: unused
// 4: unused, 5: MIN, 6: SEC, 7: FRAME
// entry for point A0 (first track num)
WriteMacInt8(buf, info->toc[i+1] & 0x0f); buf++; // control field
WriteMacInt8(buf, bin2bcd[info->toc[2]]); buf++; // track number
WriteMacInt8(buf, bin2bcd[info->toc[i+5]]); buf++; // PMIN
WriteMacInt8(buf, bin2bcd[info->toc[i+6]]); buf++; // PSEC
WriteMacInt8(buf, bin2bcd[info->toc[i+7]]); buf++; // PFRAME
buf_size -= 5; // every 8 bits written decreases byte buffer size by 1
// entry for point A1 (last track)
int buf_a1 = buf; // save for filling last track num
buf += 5; buf_size -= 5;
// entry for point A2 (address of start of lead out)
int buf_a2 = buf; // save for filling at end
buf += 5; buf_size -= 5;
// Fill buffer
while (i <= 804 && buf_size > 1) { // index 511 never used
// Lead out? then fill a2 and stop
if (info->toc[i+2] == 0xaa) {
// entry for point a2
WriteMacInt8(buf_a2, info->toc[i+1] & 0x0f); // Control
WriteMacInt8(buf_a2 + 1, bin2bcd[info->toc[i+2]]); // tracknum
WriteMacInt8(buf_a2 + 2, bin2bcd[info->lead_out[0]]); // M, same as toc[i+5]
WriteMacInt8(buf_a2 + 3, bin2bcd[info->lead_out[1]]); // S
WriteMacInt8(buf_a2 + 4, bin2bcd[info->lead_out[2]]); // F
break;
}
WriteMacInt8(buf, info->toc[i+1] & 0x0f); buf++; // Control
WriteMacInt8(buf, bin2bcd[info->toc[i+2]]); buf++; // tracknum
WriteMacInt8(buf, bin2bcd[info->toc[i+5]]); buf++; // M
WriteMacInt8(buf, bin2bcd[info->toc[i+6]]); buf++; // S
WriteMacInt8(buf, bin2bcd[info->toc[i+7]]); buf++; // F
// Last track? fill a1 as well
if (info->toc[i+2] == info->toc[3]) {
// entry for point a1
WriteMacInt8(buf_a1, info->toc[i+1] & 0x0f); // Control
WriteMacInt8(buf_a1 + 1, bin2bcd[info->toc[3]]); // tracknum
WriteMacInt8(buf_a1 + 2, bin2bcd[info->toc[i+5]]); // M
WriteMacInt8(buf_a1 + 3, bin2bcd[info->toc[i+6]]); // S
WriteMacInt8(buf_a1 + 4, bin2bcd[info->toc[i+7]]); // F
}
buf_size -= 5;
i += 8;
}
// fill rest of buffer with zeroes
while (buf_size > 0) {
WriteMacInt8(buf, 0); buf++;
buf_size--;
}
break;
}
case 5: // Get session information
WriteMacInt16(pb + csParam, 1); // First session number
WriteMacInt16(pb + csParam + 2, 1); // Last session number
@ -642,20 +767,20 @@ int16 CDROMControl(uint32 pb, uint32 dce)
WriteMacInt8(pb + csParam + 8, bin2bcd[info->toc[10]]); // S
WriteMacInt8(pb + csParam + 9, bin2bcd[info->toc[11]]); // F
break;
default:
printf("FATAL: .AppleCD/Control(100): unimplemented TOC type\n");
return paramErr;
}
return noErr;
}
case 101: { // ReadTheQSubcode
if (ReadMacInt8(info->status + dsDiskInPlace) == 0) {
Mac_memset(pb + csParam, 0, 10);
return offLinErr;
}
uint8 pos[16];
if (SysCDGetPosition(info->fh, pos)) {
uint32 p = pb + csParam;
@ -674,51 +799,51 @@ int16 CDROMControl(uint32 pb, uint32 dce)
return ioErr;
}
}
case 102: // ReadHeader
printf("FATAL: .AppleCD/Control(102): unimplemented call\n");
return controlErr;
case 103: { // AudioTrackSearch
D(bug(" AudioTrackSearch postype %d, pos %08x, hold %d\n", ReadMacInt16(pb + csParam), ReadMacInt32(pb + csParam + 2), ReadMacInt16(pb + csParam + 6)));
if (ReadMacInt8(info->status + dsDiskInPlace) == 0)
return offLinErr;
uint8 start_m, start_s, start_f;
if (!position2msf(*info, ReadMacInt16(pb + csParam), ReadMacInt32(pb + csParam + 2), false, start_m, start_s, start_f))
if (!position2msf(*info, ReadMacInt16(pb + csParam), ReadMacInt32(pb + csParam + 2), false, info->start_at[0], info->start_at[1], info->start_at[2]))
return paramErr;
info->play_mode = ReadMacInt8(pb + csParam + 9) & 0x0f;
if (!SysCDPlay(info->fh, start_m, start_s, start_f, info->stop_at[0], info->stop_at[1], info->stop_at[2]))
if (!SysCDPlay(info->fh, info->start_at[0], info->start_at[1], info->start_at[2], info->stop_at[0], info->stop_at[1], info->stop_at[2]))
return paramErr;
if (ReadMacInt16(pb + csParam + 6) == 0) // Hold
SysCDPause(info->fh);
return noErr;
}
case 104: // AudioPlay
D(bug(" AudioPlay postype %d, pos %08lx, hold %d\n", ReadMacInt16(pb + csParam), ReadMacInt32(pb + csParam + 2), ReadMacInt16(pb + csParam + 6)));
if (ReadMacInt8(info->status + dsDiskInPlace) == 0)
return offLinErr;
if (ReadMacInt16(pb + csParam + 6)) {
// Given stopping address
if (!position2msf(*info, ReadMacInt16(pb + csParam), ReadMacInt32(pb + csParam + 2), true, info->stop_at[0], info->stop_at[1], info->stop_at[2]))
return paramErr;
} else {
// Given starting address
uint8 start_m, start_s, start_f;
if (!position2msf(*info, ReadMacInt16(pb + csParam), ReadMacInt32(pb + csParam + 2), false, start_m, start_s, start_f))
return paramErr;
info->play_mode = ReadMacInt8(pb + csParam + 9) & 0x0f;
if (!SysCDPlay(info->fh, start_m, start_s, start_f, info->stop_at[0], info->stop_at[1], info->stop_at[2]))
if (!position2msf(*info, ReadMacInt16(pb + csParam), ReadMacInt32(pb + csParam + 2), false, info->start_at[0], info->start_at[1], info->start_at[2]))
return paramErr;
}
// Still need to process the AudioPlay command
info->play_mode = ReadMacInt8(pb + csParam + 9) & 0x0f;
if (!SysCDPlay(info->fh, info->start_at[0], info->start_at[1], info->start_at[2], info->stop_at[0], info->stop_at[1], info->stop_at[2]))
return paramErr;
return noErr;
case 105: // AudioPause
if (ReadMacInt8(info->status + dsDiskInPlace) == 0)
return offLinErr;
switch (ReadMacInt32(pb + csParam)) {
case 0:
if (!SysCDResume(info->fh))
@ -732,12 +857,12 @@ int16 CDROMControl(uint32 pb, uint32 dce)
return paramErr;
}
return noErr;
case 106: // AudioStop
D(bug(" AudioStop postype %d, pos %08lx\n", ReadMacInt16(pb + csParam), ReadMacInt32(pb + csParam + 2)));
if (ReadMacInt8(info->status + dsDiskInPlace) == 0)
return offLinErr;
if (ReadMacInt16(pb + csParam) == 0 && ReadMacInt32(pb + csParam + 2) == 0) {
// Stop immediately
if (!SysCDStop(info->fh, info->lead_out[0], info->lead_out[1], info->lead_out[2]))
@ -748,15 +873,15 @@ int16 CDROMControl(uint32 pb, uint32 dce)
return paramErr;
}
return noErr;
case 107: { // AudioStatus
if (ReadMacInt8(info->status + dsDiskInPlace) == 0)
return offLinErr;
uint8 pos[16];
if (!SysCDGetPosition(info->fh, pos))
return paramErr;
uint32 p = pb + csParam;
switch (pos[1]) {
case 0x11:
@ -783,34 +908,33 @@ int16 CDROMControl(uint32 pb, uint32 dce)
WriteMacInt8(p, bin2bcd[pos[11]]); p++; // F (abs)
return noErr;
}
case 108: { // AudioScan
if (ReadMacInt8(info->status + dsDiskInPlace) == 0)
return offLinErr;
uint8 start_m, start_s, start_f;
if (!position2msf(*info, ReadMacInt16(pb + csParam), ReadMacInt32(pb + csParam + 2), false, start_m, start_s, start_f))
if (!position2msf(*info, ReadMacInt16(pb + csParam), ReadMacInt32(pb + csParam + 2), false, info->start_at[0], info->start_at[1], info->start_at[2]))
return paramErr;
if (!SysCDScan(info->fh, start_m, start_s, start_f, ReadMacInt16(pb + csParam + 6) != 0)) {
if (!SysCDScan(info->fh, info->start_at[0], info->start_at[1], info->start_at[2], ReadMacInt16(pb + csParam + 6) != 0)) {
return paramErr;
} else {
return noErr;
}
}
case 109: // AudioControl
SysCDSetVolume(info->fh, ReadMacInt8(pb + csParam), ReadMacInt8(pb + csParam + 1));
return noErr;
case 110: // ReadMCN
printf("FATAL: .AppleCD/Control(110): unimplemented call\n");
return controlErr;
case 111: // ReadISRC
printf("FATAL: .AppleCD/Control(111): unimplemented call\n");
return controlErr;
case 112: { // ReadAudioVolume
uint8 left = 0, right = 0;
SysCDGetVolume(info->fh, left, right);
@ -818,43 +942,50 @@ int16 CDROMControl(uint32 pb, uint32 dce)
WriteMacInt8(pb + csParam + 1, right);
return noErr;
}
case 113: // GetSpindleSpeed
WriteMacInt16(pb + csParam, 0xff);
return noErr;
case 114: // SetSpindleSpeed
return noErr;
case 115: // ReadAudio
printf("FATAL: .AppleCD/Control(115): unimplemented call\n");
return controlErr;
case 116: // ReadAllSubcodes
printf("FATAL: .AppleCD/Control(116): unimplemented call\n");
return controlErr;
case 122: // SetTrackList
printf("FATAL: .AppleCD/Control(122): unimplemented call\n");
return controlErr;
case 123: // GetTrackList
printf("FATAL: .AppleCD/Control(123): unimplemented call\n");
return controlErr;
case 124: // GetTrackIndex
printf("FATAL: .AppleCD/Control(124): unimplemented call\n");
return controlErr;
case 125: // SetPlayMode
D(bug(" SetPlayMode %04x\n", ReadMacInt16(pb + csParam)));
printf("FATAL: .AppleCD/Control(125): unimplemented call\n");
return controlErr;
case 126: // GetPlayMode (Apple's Audio CD program needs this)
WriteMacInt16(pb + csParam, 0);
// repeat flag (0 is off, 1 is on)
info->repeat = ReadMacInt8(pb + csParam);
// playmode (0 is normal, 1 is shuffle, 2 is program mode)
info->play_order = ReadMacInt8(pb + csParam + 1);
// D(bug(" SetPlayMode %04x\n", ReadMacInt16(pb + csParam)));
// printf("FATAL: .AppleCD/Control(125): unimplemented call\n");
return noErr;
case 126: // GetPlayMode (Apple's Audio CD program needs this)
// repeat flag
WriteMacInt8(pb + csParam, bcd2bin[info->repeat]);
// playmode
WriteMacInt8(pb + csParam + 1, bcd2bin[info->play_order]);
return noErr;
default:
printf("WARNING: Unknown CDROMControl(%d)\n", code);
return controlErr;
@ -871,7 +1002,7 @@ int16 CDROMStatus(uint32 pb, uint32 dce)
drive_vec::iterator info = get_drive_info(ReadMacInt16(pb + ioVRefNum));
uint16 code = ReadMacInt16(pb + csCode);
D(bug("CDROMStatus %d\n", code));
// General codes (we can get these even if the drive was invalid)
switch (code) {
case 43: { // DriverGestalt
@ -885,10 +1016,12 @@ int16 CDROMStatus(uint32 pb, uint32 dce)
WriteMacInt32(pb + csParam + 4, FOURCC('c','d','r','m'));
break;
case FOURCC('i','n','t','f'): // Interface type
WriteMacInt32(pb + csParam + 4, EMULATOR_ID_4);
// WriteMacInt32(pb + csParam + 4, EMULATOR_ID_4);
WriteMacInt32(pb + csParam + 4, FOURCC('a','t','p','i'));
break;
case FOURCC('s','y','n','c'): // Only synchronous operation?
WriteMacInt32(pb + csParam + 4, 0x01000000);
// WriteMacInt32(pb + csParam + 4, 1);
break;
case FOURCC('b','o','o','t'): // Boot ID
if (info != drives.end())
@ -912,12 +1045,15 @@ int16 CDROMStatus(uint32 pb, uint32 dce)
case FOURCC('v','m','o','p'): // Virtual memory attributes
WriteMacInt32(pb + csParam + 4, 0); // Drive not available for VM
break;
case FOURCC('c', 'd', '3', 'd'):
WriteMacInt16(pb + csParam + 4, 0);
break;
default:
return statusErr;
}
return noErr;
}
case 97: { // WhoIsThere
uint8 drives_present = 0;
drive_vec::iterator info, end = drives.end();
@ -929,15 +1065,17 @@ int16 CDROMStatus(uint32 pb, uint32 dce)
return noErr;
}
}
// Drive valid?
if (info == drives.end()) {
if (drives.empty())
if (drives.empty()) {
return nsDrvErr;
else
info = drives.begin(); // This is needed for Apple's Audio CD program
} else {
info = get_drive_info(last_drive_num);
if (info == drives.end()) return nsDrvErr;
}
}
// Drive-specific codes
switch (code) {
case 6: // Return format list
@ -950,15 +1088,15 @@ int16 CDROMStatus(uint32 pb, uint32 dce)
} else {
return paramErr;
}
case 8: // DriveStatus
Mac2Mac_memcpy(pb + csParam, info->status, 22);
return noErr;
case 70: // GetPowerMode
WriteMacInt16(pb + csParam, info->power_mode << 8);
return noErr;
case 95: // Get2KOffset
if (info->twok_offset > 0) {
WriteMacInt16(pb + csParam, info->twok_offset);
@ -966,24 +1104,24 @@ int16 CDROMStatus(uint32 pb, uint32 dce)
} else {
return statusErr;
}
case 96: // Get drive type
WriteMacInt16(pb + csParam, 3); // Apple CD 300 or newer
return noErr;
case 98: // Get block size
WriteMacInt16(pb + csParam, info->block_size);
return noErr;
case 120: // Return device ident
WriteMacInt32(pb + csParam, 0);
return noErr;
case 121: // Get CD features
WriteMacInt16(pb + csParam, 0x0200); // 300 KB/s
WriteMacInt16(pb + csParam + 2, 0x0c00); // SCSI-2, stereo
return noErr;
default:
printf("WARNING: Unknown CDROMStatus(%d)\n", code);
return statusErr;
@ -999,6 +1137,6 @@ void CDROMInterrupt(void)
{
if (!acc_run_called)
return;
mount_mountable_volumes();
}

View File

@ -72,14 +72,20 @@ const uint32 siHardwareMute = FOURCC('h','m','u','t'); // mute state of all ha
const uint32 siHardwareVolume = FOURCC('h','v','o','l'); // volume level of all hardware
const uint32 siHardwareVolumeSteps = FOURCC('h','s','t','p'); // number of volume steps for hardware
const uint32 siHardwareBusy = FOURCC('h','w','b','s'); // sound hardware is in use
const uint32 siHardwareFormat = FOURCC('h','w','f','m'); // hardware format
const uint32 siHeadphoneMute = FOURCC('p','m','u','t'); // mute state of headphone
const uint32 siHeadphoneVolume = FOURCC('p','v','o','l'); // volume level of headphone
const uint32 siHeadphoneVolumeSteps = FOURCC('h','d','s','t'); // number of volume steps for headphone
const uint32 siSpeakerMute = FOURCC('s','m','u','t'); // mute state of all built-in speakers
const uint32 siSpeakerVolume = FOURCC('s','v','o','l'); // volume level of built-in speaker
const uint32 siDeviceName = FOURCC('n','a','m','e');
const uint32 siDeviceIcon = FOURCC('i','c','o','n');
const uint32 siHardwareFormat = FOURCC('h','w','f','m');
const uint32 siDeviceName = FOURCC('n','a','m','e'); // sound input name
const uint32 siDeviceIcon = FOURCC('i','c','o','n'); // sound input icon resource location
const uint32 siInputSourceNames = FOURCC('s','n','a','m'); // sound input source names
const uint32 siInputSource = FOURCC('s','o','u','r'); // sound input source selector
const uint32 siOptionsDialog = FOURCC('o','p','t','d'); // display options dialog box
const uint32 siPlayThruOnOff = FOURCC('p','l','t','h'); // play-through state
const uint32 siInitializeDriver = FOURCC('i','n','i','t'); // open sound input device
const uint32 siCloseDriver = FOURCC('c','l','o','s'); // close sound input device
enum { // ComponentResource struct
componentType = 0,

View File

@ -1,5 +1,5 @@
/*
* bincue_unix.h -- support for cdrom image files in bin/cue format
* bincue.h -- support for cdrom image files in bin/cue format
*
* (C) 2010 Geoffrey Brown
*
@ -34,10 +34,13 @@ extern bool CDPlay_bincue(void *, uint8, uint8,
extern bool CDPause_bincue(void *);
extern bool CDResume_bincue(void *);
extern bool CDStop_bincue(void *);
extern bool CDScan_bincue(void *, uint8, uint8, uint8, bool);
extern void CDSetVol_bincue(void *, uint8, uint8);
extern void CDGetVol_bincue(void *, uint8 *, uint8 *);
#ifdef USE_SDL_AUDIO
extern void OpenAudio_bincue(int, int, int, uint8);
extern void MixAudio_bincue(uint8 *, int);
extern void OpenAudio_bincue(int, int, int, uint8, int);
extern void MixAudio_bincue(uint8 *, int, int);
#endif
#endif

View File

@ -225,6 +225,9 @@ enum {
STR_WINDOW_ITEM_MOUNT,
STR_SUSPEND_WINDOW_TITLE,
// Audio
STR_SOUND_IN_NAME = 6000,
// External file system
STR_EXTFS_NAME = 5000,
STR_EXTFS_VOLUME_NAME

View File

@ -5,7 +5,7 @@
* terms and conditions of the copyright.
*/
// #include <stdlib.h>
#include <stdlib.h>
#include <slirp.h>
/* Done as a macro in socket.h */

View File

@ -34,6 +34,8 @@
#include "sysdeps.h"
#if USE_JIT
#include <math.h>
#include <stdio.h>
@ -1635,3 +1637,5 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
m68k_setpc (m68k_getpc () - 4);
fpuop_illg (opcode,extra);
}
#endif //USE_JIT

View File

@ -25,6 +25,8 @@
#include "sysdeps.h"
#if USE_JIT
#if !REAL_ADDRESSING && !DIRECT_ADDRESSING
#error "Only Real or Direct Addressing is supported with the JIT Compiler"
#endif
@ -7125,3 +7127,5 @@ void m68k_compile_execute (void)
m68k_do_compile_execute();
}
}
#endif //USE_JIT

View File

@ -3038,6 +3038,9 @@ main (int argc, char **argv)
stblfile = fopen ("compstbl.cpp", "wb");
freopen ("compemu.cpp", "wb", stdout);
fprintf(stblfile, "#if USE_JIT\n");
printf("#if USE_JIT\n");
generate_includes (stdout);
generate_includes (stblfile);
@ -3059,6 +3062,9 @@ main (int argc, char **argv)
noflags=1;
generate_func (noflags);
fprintf(stblfile, "#endif //USE_JIT\n");
printf("#endif //USE_JIT\n");
free(opcode_map);
free(opcode_last_postfix);
free(opcode_next_clev);

View File

@ -243,6 +243,8 @@ user_string_def common_strings[] = {
{STR_WINDOW_ITEM_MOUNT, "Mount"},
{STR_SUSPEND_WINDOW_TITLE, "Basilisk II suspended. Press space to reactivate."},
{STR_SOUND_IN_NAME, "\010Built-In"},
{STR_EXTFS_NAME, "Host Directory Tree"},
{STR_EXTFS_VOLUME_NAME, "Host"},

View File

@ -52,6 +52,7 @@ links:
(cd src/Windows; if [ ! -e m4 ]; then ln -s ../../../BasiliskII/src/Unix/m4; fi)
@list='adb.cpp audio.cpp cdrom.cpp disk.cpp extfs.cpp pict.c \
prefs.cpp scsi.cpp sony.cpp xpram.cpp \
bincue.cpp include/bincue.h \
include/adb.h include/audio.h include/audio_defs.h \
include/cdrom.h include/clip.h include/debug.h include/disk.h \
include/extfs.h include/extfs_defs.h include/pict.h \

View File

@ -2499,6 +2499,14 @@ static bool arm_skip_instruction(unsigned long * regs)
}
#endif
#ifdef _STRUCT_ARM_THREAD_STATE64
static bool aarch64_skip_instruction(unsigned long *regs) {
_STRUCT_ARM_THREAD_STATE64 *ts = (_STRUCT_ARM_THREAD_STATE64 *)regs;
if (!ts->__pc) return false;
ts->__pc += 4;
return true;
}
#endif
// Fallbacks
#ifndef SIGSEGV_FAULT_ADDRESS_FAST

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -28,9 +28,6 @@
0846E4C114B1268B00574779 /* jit-cache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CDCD14A99EEF000B1711 /* jit-cache.cpp */; };
0846E4C214B1269600574779 /* basic-dyngen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CDC514A99EEF000B1711 /* basic-dyngen.cpp */; };
0846E51314B128ED00574779 /* sheepshaver_glue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CDBB14A99EEF000B1711 /* sheepshaver_glue.cpp */; };
0856CFC114A99EF0000B1711 /* adb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CD4B14A99EEF000B1711 /* adb.cpp */; };
0856CFC214A99EF0000B1711 /* audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CD4C14A99EEF000B1711 /* audio.cpp */; };
0856CFE214A99EF0000B1711 /* cdrom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CD7814A99EEF000B1711 /* cdrom.cpp */; };
0856CFE614A99EF0000B1711 /* disk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CD7D14A99EEF000B1711 /* disk.cpp */; };
0856CFEC14A99EF0000B1711 /* scsi_dummy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CD8414A99EEF000B1711 /* scsi_dummy.cpp */; };
0856CFEE14A99EF0000B1711 /* emul_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CD8614A99EEF000B1711 /* emul_op.cpp */; };
@ -55,7 +52,6 @@
0856D07C14A99EF1000B1711 /* thunks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CEC114A99EF0000B1711 /* thunks.cpp */; };
0856D07D14A99EF1000B1711 /* timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CEC214A99EF0000B1711 /* timer.cpp */; };
0856D07E14A99EF1000B1711 /* about_window_unix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CEC414A99EF0000B1711 /* about_window_unix.cpp */; };
0856D08714A99EF1000B1711 /* bincue_unix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CECF14A99EF0000B1711 /* bincue_unix.cpp */; };
0856D09814A99EF1000B1711 /* ether_unix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CEE314A99EF0000B1711 /* ether_unix.cpp */; };
0856D0AA14A99EF1000B1711 /* main_unix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CEFB14A99EF0000B1711 /* main_unix.cpp */; };
0856D10614A99EF1000B1711 /* prefs_unix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0856CF5A14A99EF0000B1711 /* prefs_unix.cpp */; };
@ -80,6 +76,11 @@
08CD42DC14B7B85B009CA2A2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08CD42DB14B7B85B009CA2A2 /* Cocoa.framework */; };
08CD42E814B7B8AA009CA2A2 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08CD42E714B7B8AA009CA2A2 /* Carbon.framework */; };
3D2C25B5221092BA00B635DE /* SheepVM.icns in Resources */ = {isa = PBXBuildFile; fileRef = 3D2C25B4221092BA00B635DE /* SheepVM.icns */; };
5D2143D524B2DD90008BB372 /* bincue.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D2143D424B2DD90008BB372 /* bincue.h */; };
5D35961124B8F5FB0081EC8A /* bincue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D35961024B8F5FA0081EC8A /* bincue.cpp */; };
5D55CB40225584D000FF8E81 /* cdrom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D55CB3F225584D000FF8E81 /* cdrom.cpp */; };
5DE93B46247C71F200B2C821 /* adb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D3967BF2328D315003925D6 /* adb.cpp */; };
5DF4CB7F22B5BD5D00512A86 /* audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DF4CB7E22B5BD5D00512A86 /* audio.cpp */; };
A7B1921418C35D4700791D8D /* DiskType.m in Sources */ = {isa = PBXBuildFile; fileRef = A7B1921318C35D4700791D8D /* DiskType.m */; };
E413A40320CF7E6D00FBE967 /* video_sdl2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E413A40220CF7E6D00FBE967 /* video_sdl2.cpp */; };
E4150D1220D557820077C51A /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E4150D1120D557820077C51A /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@ -156,9 +157,6 @@
0846E52314B129DA00574779 /* ppc_asm.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = ppc_asm.S; sourceTree = "<group>"; };
0846E55214B12B0D00574779 /* paranoia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = paranoia.cpp; sourceTree = "<group>"; };
0856CCC114A99E1C000B1711 /* SheepShaver.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SheepShaver.app; sourceTree = BUILT_PRODUCTS_DIR; };
0856CD4B14A99EEF000B1711 /* adb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = adb.cpp; path = ../adb.cpp; sourceTree = SOURCE_ROOT; };
0856CD4C14A99EEF000B1711 /* audio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = audio.cpp; path = ../audio.cpp; sourceTree = SOURCE_ROOT; };
0856CD7814A99EEF000B1711 /* cdrom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cdrom.cpp; path = ../cdrom.cpp; sourceTree = SOURCE_ROOT; };
0856CD7D14A99EEF000B1711 /* disk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = disk.cpp; path = ../disk.cpp; sourceTree = SOURCE_ROOT; };
0856CD8414A99EEF000B1711 /* scsi_dummy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scsi_dummy.cpp; sourceTree = "<group>"; };
0856CD8614A99EEF000B1711 /* emul_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = emul_op.cpp; path = ../emul_op.cpp; sourceTree = SOURCE_ROOT; };
@ -276,8 +274,6 @@
0856CEC114A99EF0000B1711 /* thunks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = thunks.cpp; path = ../thunks.cpp; sourceTree = SOURCE_ROOT; };
0856CEC214A99EF0000B1711 /* timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = timer.cpp; path = ../timer.cpp; sourceTree = SOURCE_ROOT; };
0856CEC414A99EF0000B1711 /* about_window_unix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = about_window_unix.cpp; sourceTree = "<group>"; };
0856CECF14A99EF0000B1711 /* bincue_unix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bincue_unix.cpp; sourceTree = "<group>"; };
0856CED014A99EF0000B1711 /* bincue_unix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bincue_unix.h; sourceTree = "<group>"; };
0856CEE314A99EF0000B1711 /* ether_unix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ether_unix.cpp; sourceTree = "<group>"; };
0856CEFB14A99EF0000B1711 /* main_unix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main_unix.cpp; sourceTree = "<group>"; };
0856CF5A14A99EF0000B1711 /* prefs_unix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = prefs_unix.cpp; sourceTree = "<group>"; };
@ -326,6 +322,19 @@
08CD42DB14B7B85B009CA2A2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
08CD42E714B7B8AA009CA2A2 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
3D2C25B4221092BA00B635DE /* SheepVM.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = SheepVM.icns; sourceTree = "<group>"; };
5D2143D424B2DD90008BB372 /* bincue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bincue.h; sourceTree = "<group>"; };
5D35961024B8F5FA0081EC8A /* bincue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bincue.cpp; path = ../../../BasiliskII/src/bincue.cpp; sourceTree = "<group>"; };
5D3967BF2328D315003925D6 /* adb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = adb.cpp; path = ../../../BasiliskII/src/adb.cpp; sourceTree = "<group>"; };
5D55CB3F225584D000FF8E81 /* cdrom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cdrom.cpp; path = ../../../BasiliskII/src/cdrom.cpp; sourceTree = "<group>"; };
5DDE94F82255C70C004D0E79 /* MacOSX_sound_if.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MacOSX_sound_if.h; path = ../../../BasiliskII/src/MacOSX/MacOSX_sound_if.h; sourceTree = "<group>"; };
5DDE94FA2255C712004D0E79 /* MacOSX_sound_if.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MacOSX_sound_if.cpp; path = ../../../BasiliskII/src/MacOSX/MacOSX_sound_if.cpp; sourceTree = "<group>"; };
5DDE94FD2255C740004D0E79 /* AudioBackEnd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioBackEnd.h; path = ../../../BasiliskII/src/MacOSX/AudioBackEnd.h; sourceTree = "<group>"; };
5DDE94FF2255C74C004D0E79 /* AudioBackEnd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AudioBackEnd.cpp; path = ../../../BasiliskII/src/MacOSX/AudioBackEnd.cpp; sourceTree = "<group>"; };
5DDE95082255C88E004D0E79 /* AudioDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AudioDevice.cpp; path = ../../../BasiliskII/src/MacOSX/AudioDevice.cpp; sourceTree = "<group>"; };
5DDE950B2255C895004D0E79 /* AudioBackEnd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioBackEnd.h; path = ../../../BasiliskII/src/MacOSX/AudioBackEnd.h; sourceTree = "<group>"; };
5DDE950D2255C8B3004D0E79 /* audio_defs_macosx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = audio_defs_macosx.h; path = ../../../BasiliskII/src/MacOSX/audio_defs_macosx.h; sourceTree = "<group>"; };
5DDE950E2255C8B3004D0E79 /* audio_macosx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = audio_macosx.cpp; path = ../../../BasiliskII/src/MacOSX/audio_macosx.cpp; sourceTree = "<group>"; };
5DF4CB7E22B5BD5D00512A86 /* audio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = audio.cpp; path = ../../../BasiliskII/src/audio.cpp; sourceTree = "<group>"; };
A7B1921218C35D4700791D8D /* DiskType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiskType.h; sourceTree = "<group>"; };
A7B1921318C35D4700791D8D /* DiskType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DiskType.m; sourceTree = "<group>"; };
E413A40220CF7E6D00FBE967 /* video_sdl2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = video_sdl2.cpp; path = ../../../BasiliskII/src/SDL/video_sdl2.cpp; sourceTree = "<group>"; };
@ -381,6 +390,7 @@
E44C460320D262AF000583AE /* cksum.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cksum.c; path = ../../../BasiliskII/src/slirp/cksum.c; sourceTree = "<group>"; };
E44C460420D262AF000583AE /* tcp_output.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tcp_output.c; path = ../../../BasiliskII/src/slirp/tcp_output.c; sourceTree = "<group>"; };
E456E2AC20C82B60006C8DC2 /* clip_macosx64.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = clip_macosx64.mm; sourceTree = "<group>"; };
E4989F3224DE4438004D43E2 /* config-macosx-aarch64.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "config-macosx-aarch64.h"; sourceTree = "<group>"; };
E4C9A03D1FD55CDC00CABBF9 /* basic-dyngen-ops-x86_64_macos.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = "basic-dyngen-ops-x86_64_macos.hpp"; path = "dyngen_precompiled/basic-dyngen-ops-x86_64_macos.hpp"; sourceTree = "<group>"; };
E4C9A03F1FD55CE700CABBF9 /* ppc-dyngen-ops-x86_64_macos.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = "ppc-dyngen-ops-x86_64_macos.hpp"; path = "dyngen_precompiled/ppc-dyngen-ops-x86_64_macos.hpp"; sourceTree = "<group>"; };
E4CBF46020CFC451009F40CC /* video_sdl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = video_sdl.cpp; path = ../../../BasiliskII/src/SDL/video_sdl.cpp; sourceTree = "<group>"; };
@ -455,9 +465,10 @@
isa = PBXGroup;
children = (
087B91B11B780EC900825F7F /* CrossPlatform */,
0856CD4B14A99EEF000B1711 /* adb.cpp */,
0856CD4C14A99EEF000B1711 /* audio.cpp */,
0856CD7814A99EEF000B1711 /* cdrom.cpp */,
5D3967BF2328D315003925D6 /* adb.cpp */,
5DF4CB7E22B5BD5D00512A86 /* audio.cpp */,
5D35961024B8F5FA0081EC8A /* bincue.cpp */,
5D55CB3F225584D000FF8E81 /* cdrom.cpp */,
0856CD7D14A99EEF000B1711 /* disk.cpp */,
0856CD7E14A99EEF000B1711 /* dummy */,
0856CD8614A99EEF000B1711 /* emul_op.cpp */,
@ -508,6 +519,7 @@
0856CD9014A99EEF000B1711 /* adb.h */,
0856CD9114A99EEF000B1711 /* audio.h */,
0856CD9214A99EEF000B1711 /* audio_defs.h */,
5D2143D424B2DD90008BB372 /* bincue.h */,
0856CD9314A99EEF000B1711 /* cdrom.h */,
0856CD9414A99EEF000B1711 /* clip.h */,
0856CD9514A99EEF000B1711 /* cpu_emulation.h */,
@ -719,6 +731,12 @@
E4202602241250EE000508DF /* runtool.c */,
0873A76514ABD151004F12B7 /* config */,
0856D2D614A9A704000B1711 /* Launcher */,
5DDE950D2255C8B3004D0E79 /* audio_defs_macosx.h */,
5DDE950E2255C8B3004D0E79 /* audio_macosx.cpp */,
5DDE94FD2255C740004D0E79 /* AudioBackEnd.h */,
5DDE94FF2255C74C004D0E79 /* AudioBackEnd.cpp */,
5DDE95082255C88E004D0E79 /* AudioDevice.cpp */,
5DDE950B2255C895004D0E79 /* AudioBackEnd.h */,
E456E2AC20C82B60006C8DC2 /* clip_macosx64.mm */,
0856CE2D14A99EF0000B1711 /* extfs_macosx.cpp */,
0879BDAF15A8B1AA00DC277D /* Info.plist.in */,
@ -729,6 +747,8 @@
0856CE8714A99EF0000B1711 /* sys_darwin.cpp */,
0873A80014AC515D004F12B7 /* utils_macosx.h */,
0873A80114AC515D004F12B7 /* utils_macosx.mm */,
5DDE94F82255C70C004D0E79 /* MacOSX_sound_if.h */,
5DDE94FA2255C712004D0E79 /* MacOSX_sound_if.cpp */,
);
name = MacOSX;
sourceTree = "<group>";
@ -802,8 +822,6 @@
08003F841E0624BD00A3ADAB /* dyngen_precompiled */,
082AC25614AA59DA00071F5E /* Darwin */,
0856CEC414A99EF0000B1711 /* about_window_unix.cpp */,
0856CECF14A99EF0000B1711 /* bincue_unix.cpp */,
0856CED014A99EF0000B1711 /* bincue_unix.h */,
083E370A16EFE85000CCCA59 /* disk_sparsebundle.cpp */,
083E370B16EFE85000CCCA59 /* disk_unix.h */,
0856CEE314A99EF0000B1711 /* ether_unix.cpp */,
@ -848,6 +866,7 @@
0873A76514ABD151004F12B7 /* config */ = {
isa = PBXGroup;
children = (
E4989F3224DE4438004D43E2 /* config-macosx-aarch64.h */,
0879BD8515A891EC00DC277D /* config-macosx-ppc_32.h */,
0879BD8615A891EC00DC277D /* config-macosx-x86_32.h */,
0873A76614ABD151004F12B7 /* config-macosx-x86_64.h */,
@ -900,6 +919,7 @@
08003F8F1E0624D100A3ADAB /* ppc-dyngen-ops-x86_32.hpp in Headers */,
08003F8E1E0624D100A3ADAB /* basic-dyngen-ops.hpp in Headers */,
E4C9A03E1FD55CDC00CABBF9 /* basic-dyngen-ops-x86_64_macos.hpp in Headers */,
5D2143D524B2DD90008BB372 /* bincue.h in Headers */,
E4C9A0401FD55CE700CABBF9 /* ppc-dyngen-ops-x86_64_macos.hpp in Headers */,
08163339158C121000C449F9 /* dis-asm.h in Headers */,
08003F8C1E0624D100A3ADAB /* basic-dyngen-ops-x86_32.hpp in Headers */,
@ -1006,7 +1026,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "sed -i '' 's/@PACKAGE_VERSION@/2.5/g' \"${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}\"";
shellScript = "sed -i '' 's/@PACKAGE_VERSION@/2.5/g' \"${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}\"\n";
};
E4202606241251C6000508DF /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@ -1052,18 +1072,17 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5DE93B46247C71F200B2C821 /* adb.cpp in Sources */,
E44C460B20D262B0000583AE /* debug.c in Sources */,
E44C460C20D262B0000583AE /* tcp_subr.c in Sources */,
0856CFC114A99EF0000B1711 /* adb.cpp in Sources */,
E44C461520D262B0000583AE /* ip_output.c in Sources */,
0856CFC214A99EF0000B1711 /* audio.cpp in Sources */,
0856CFE214A99EF0000B1711 /* cdrom.cpp in Sources */,
E44C461820D262B0000583AE /* tcp_output.c in Sources */,
0856CFE614A99EF0000B1711 /* disk.cpp in Sources */,
0856CFEC14A99EF0000B1711 /* scsi_dummy.cpp in Sources */,
E44C460E20D262B0000583AE /* sbuf.c in Sources */,
0856CFEE14A99EF0000B1711 /* emul_op.cpp in Sources */,
0856CFF014A99EF0000B1711 /* ether.cpp in Sources */,
5DF4CB7F22B5BD5D00512A86 /* audio.cpp in Sources */,
0856CFF314A99EF0000B1711 /* extfs.cpp in Sources */,
0856CFF414A99EF0000B1711 /* gfxaccel.cpp in Sources */,
0856D00914A99EF0000B1711 /* macos_util.cpp in Sources */,
@ -1082,6 +1101,7 @@
E44C461420D262B0000583AE /* ip_input.c in Sources */,
E44C461320D262B0000583AE /* bootp.c in Sources */,
0856D05E14A99EF1000B1711 /* prefs.cpp in Sources */,
5D55CB40225584D000FF8E81 /* cdrom.cpp in Sources */,
0856D05F14A99EF1000B1711 /* rom_patches.cpp in Sources */,
0856D06014A99EF1000B1711 /* rsrc_patches.cpp in Sources */,
0856D06114A99EF1000B1711 /* scsi.cpp in Sources */,
@ -1094,7 +1114,6 @@
0856D07D14A99EF1000B1711 /* timer.cpp in Sources */,
0856D07E14A99EF1000B1711 /* about_window_unix.cpp in Sources */,
E44C460720D262B0000583AE /* ip_icmp.c in Sources */,
0856D08714A99EF1000B1711 /* bincue_unix.cpp in Sources */,
E4CBF46120CFC451009F40CC /* video_sdl.cpp in Sources */,
0856D09814A99EF1000B1711 /* ether_unix.cpp in Sources */,
0856D0AA14A99EF1000B1711 /* main_unix.cpp in Sources */,
@ -1107,6 +1126,7 @@
0856D10E14A99EF1000B1711 /* sys_unix.cpp in Sources */,
E44C461720D262B0000583AE /* cksum.c in Sources */,
0856D10F14A99EF1000B1711 /* timer_unix.cpp in Sources */,
5D35961124B8F5FB0081EC8A /* bincue.cpp in Sources */,
0856D11114A99EF1000B1711 /* user_strings_unix.cpp in Sources */,
E44C461020D262B0000583AE /* slirp.c in Sources */,
0856D11614A99EF1000B1711 /* xpram_unix.cpp in Sources */,
@ -1157,10 +1177,12 @@
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULE_DEBUGGING = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_PREPROCESSOR_DEFINITIONS = (
"DATADIR=",
HAVE_CONFIG_H,
@ -1182,8 +1204,9 @@
);
INSTALL_PATH = /usr/local/lib;
MACOSX_DEPLOYMENT_TARGET = 10.7;
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
PRODUCT_NAME = kpx_cpu;
VALID_ARCHS = x86_64;
VALID_ARCHS = "x86_64 arm64";
};
name = Debug;
};
@ -1193,7 +1216,8 @@
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LIBRARY = "libc++";
COPY_PHASE_STRIP = YES;
CLANG_ENABLE_MODULE_DEBUGGING = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_DYNAMIC_NO_PIC = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@ -1219,8 +1243,9 @@
);
INSTALL_PATH = /usr/local/lib;
MACOSX_DEPLOYMENT_TARGET = 10.7;
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
PRODUCT_NAME = kpx_cpu;
VALID_ARCHS = x86_64;
VALID_ARCHS = "x86_64 arm64";
};
name = Release;
};
@ -1274,6 +1299,8 @@
"_GNU_SOURCE=1",
_THREAD_SAFE,
_REENTRANT,
"BINCUE=1",
"USE_SDL_AUDIO=1",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_UNUSED_FUNCTION = YES;
@ -1305,7 +1332,7 @@
PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
PRODUCT_BUNDLE_IDENTIFIER = net.cebix.sheepshaver;
PRODUCT_NAME = SheepShaver;
VALID_ARCHS = x86_64;
VALID_ARCHS = "x86_64 arm64";
WARNING_LDFLAGS = "";
};
name = Debug;
@ -1337,6 +1364,8 @@
"_GNU_SOURCE=1",
_THREAD_SAFE,
_REENTRANT,
"BINCUE=1",
"USE_SDL_AUDIO=1",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_UNUSED_FUNCTION = YES;
@ -1369,7 +1398,7 @@
PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
PRODUCT_BUNDLE_IDENTIFIER = net.cebix.sheepshaver;
PRODUCT_NAME = SheepShaver;
VALID_ARCHS = x86_64;
VALID_ARCHS = "x86_64 arm64";
};
name = Release;
};

View File

@ -0,0 +1,527 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
#ifndef CONFIG_H
#define CONFIG_H
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* Define if using a PowerPC CPU emulator. */
#define EMULATED_PPC 1
/* Define to enable dyngen engine */
#define ENABLE_DYNGEN 0
/* Define is using ESD. */
/* #undef ENABLE_ESD */
/* Define if using Linux fbdev extension. */
/* #undef ENABLE_FBDEV_DGA */
/* Define if using GTK. */
/* #undef ENABLE_GTK */
/* Define if using "mon". */
/* #undef ENABLE_MON */
/* Define if your system supports TUN/TAP devices. */
/* #undef ENABLE_TUNTAP */
/* Define if using video enabled on SEGV signals. */
/* #undef ENABLE_VOSF */
/* Define if using XFree86 DGA extension. */
/* #undef ENABLE_XF86_DGA */
/* Define if using XFree86 DGA extension. */
/* #undef ENABLE_XF86_VIDMODE */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
/* Define to 1 if you have the <AvailabilityMacros.h> header file. */
#define HAVE_AVAILABILITYMACROS_H 1
/* Define to 1 if you have the <byteswap.h> header file. */
/* #undef HAVE_BYTESWAP_H */
/* Define to 1 if you have the `ceil' function. */
#define HAVE_CEIL 1
/* Define to 1 if you have the `ceilf' function. */
#define HAVE_CEILF 1
/* Define to 1 if you have the `cfmakeraw' function. */
#define HAVE_CFMAKERAW 1
/* Define to 1 if you have the `clock_gettime' function. */
/* #undef HAVE_CLOCK_GETTIME */
/* Define to 1 if you have the `clock_nanosleep' function. */
/* #undef HAVE_CLOCK_NANOSLEEP */
/* Define if you have /dev/ptmx. */
/* #undef HAVE_DEV_PTMX */
/* Define if you have /dev/ptc. */
/* #undef HAVE_DEV_PTS_AND_PTC */
/* Define to 1 if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H 1
/* Define to 1 if you have the `exp2' function. */
#define HAVE_EXP2 1
/* Define to 1 if you have the `exp2f' function. */
#define HAVE_EXP2F 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the <fenv.h> header file. */
#define HAVE_FENV_H 1
/* Define to 1 if you have the `floor' function. */
#define HAVE_FLOOR 1
/* Define to 1 if you have the `floorf' function. */
#define HAVE_FLOORF 1
/* Define if framework AppKit is available. */
#define HAVE_FRAMEWORK_APPKIT 1
/* Define if framework AudioToolbox is available. */
#define HAVE_FRAMEWORK_AUDIOTOOLBOX 1
/* Define if framework AudioUnit is available. */
#define HAVE_FRAMEWORK_AUDIOUNIT 1
/* Define if framework Carbon is available. */
#define HAVE_FRAMEWORK_CARBON 1
/* Define if framework CoreAudio is available. */
#define HAVE_FRAMEWORK_COREAUDIO 1
/* Define if framework CoreFoundation is available. */
#define HAVE_FRAMEWORK_COREFOUNDATION 1
/* Define if framework IOKit is available. */
#define HAVE_FRAMEWORK_IOKIT 1
/* Define if framework SDL is available. */
/* #undef HAVE_FRAMEWORK_SDL */
/* Define to 1 if you have the <history.h> header file. */
/* #undef HAVE_HISTORY_H */
/* Define to 1 if you have the `inet_aton' function. */
#define HAVE_INET_ATON 1
/* Define to 1 if you have the <inttypes.h> header file. */
/* #undef HAVE_INTTYPES_H */
/* Define to 1 if you have the <IOKit/storage/IOBlockStorageDevice.h> header
file. */
#define HAVE_IOKIT_STORAGE_IOBLOCKSTORAGEDEVICE_H 1
/* Define to 1 if you have the `curses' library (-lcurses). */
/* #undef HAVE_LIBCURSES */
/* Define to 1 if you have the `c_r' library (-lc_r). */
/* #undef HAVE_LIBC_R */
/* Define to 1 if you have the `Hcurses' library (-lHcurses). */
/* #undef HAVE_LIBHCURSES */
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1
/* Define to 1 if you have the `ncurses' library (-lncurses). */
/* #undef HAVE_LIBNCURSES */
/* Define to 1 if you have the `posix4' library (-lposix4). */
/* #undef HAVE_LIBPOSIX4 */
/* Define to 1 if you have the `pthread' library (-lpthread). */
#define HAVE_LIBPTHREAD 1
/* Define to 1 if you have the `PTL' library (-lPTL). */
/* #undef HAVE_LIBPTL */
/* Define to 1 if you have the `readline' library (-lreadline). */
/* #undef HAVE_LIBREADLINE */
/* Define to 1 if you have the `termcap' library (-ltermcap). */
/* #undef HAVE_LIBTERMCAP */
/* Define to 1 if you have the `terminfo' library (-lterminfo). */
/* #undef HAVE_LIBTERMINFO */
/* Define to 1 if you have the `termlib' library (-ltermlib). */
/* #undef HAVE_LIBTERMLIB */
/* Define to 1 if you have the `vhd' library (-lvhd). */
/* #undef HAVE_LIBVHD */
/* Define if there is a linker script to relocate the executable above
0x70000000. */
#define HAVE_LINKER_SCRIPT 1
/* Define to 1 if you have the <linux/if.h> header file. */
/* #undef HAVE_LINUX_IF_H */
/* Define to 1 if you have the <linux/if_tun.h> header file. */
/* #undef HAVE_LINUX_IF_TUN_H */
/* Define to 1 if you have the `log2' function. */
#define HAVE_LOG2 1
/* Define to 1 if you have the `log2f' function. */
#define HAVE_LOG2F 1
/* Define to 1 if you have the <login.h> header file. */
/* #undef HAVE_LOGIN_H */
/* Define if your system supports Mach exceptions. */
#define HAVE_MACH_EXCEPTIONS 1
/* Define to 1 if you have the <mach/mach_init.h> header file. */
#define HAVE_MACH_MACH_INIT_H 1
/* Define to 1 if you have the `mach_task_self' function. */
#define HAVE_MACH_TASK_SELF 1
/* Define if your system has a working vm_allocate()-based memory allocator.
*/
#define HAVE_MACH_VM 1
/* Define to 1 if you have the <mach/vm_map.h> header file. */
#define HAVE_MACH_VM_MAP_H 1
/* Define to 1 if you have the <malloc.h> header file. */
/* #undef HAVE_MALLOC_H */
/* Define to 1 if you have the <memory.h> header file. */
/* #undef HAVE_MEMORY_H */
/* Define to 1 if you have the `mmap' function. */
#define HAVE_MMAP 1
/* Define if <sys/mman.h> defines MAP_ANON and mmap()'ing with MAP_ANON works.
*/
/* #undef HAVE_MMAP_ANON */
/* Define if <sys/mman.h> defines MAP_ANONYMOUS and mmap()'ing with
MAP_ANONYMOUS works. */
/* #undef HAVE_MMAP_ANONYMOUS */
/* Define if your system has a working mmap()-based memory allocator. */
/* #undef HAVE_MMAP_VM */
/* Define to 1 if you have the `mprotect' function. */
#define HAVE_MPROTECT 1
/* Define to 1 if you have the `munmap' function. */
#define HAVE_MUNMAP 1
/* Define to 1 if you have the `nanosleep' function. */
#define HAVE_NANOSLEEP 1
/* Define to 1 if you have the <net/if.h> header file. */
#define HAVE_NET_IF_H 1
/* Define to 1 if you have the <net/if_tun.h> header file. */
/* #undef HAVE_NET_IF_TUN_H */
/* Define if you are on NEWS-OS (additions from openssh-3.2.2p1, for
sshpty.c). */
/* #undef HAVE_NEWS4 */
/* Define to 1 if you have the `poll' function. */
#define HAVE_POLL 1
/* Define if pthreads are available. */
#define HAVE_PTHREADS 1
/* Define to 1 if you have the `pthread_cancel' function. */
#define HAVE_PTHREAD_CANCEL 1
/* Define to 1 if you have the `pthread_cond_init' function. */
#define HAVE_PTHREAD_COND_INIT 1
/* Define to 1 if you have the `pthread_mutexattr_setprotocol' function. */
#define HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL 1
/* Define to 1 if you have the `pthread_mutexattr_setpshared' function. */
#define HAVE_PTHREAD_MUTEXATTR_SETPSHARED 1
/* Define to 1 if you have the `pthread_mutexattr_settype' function. */
#define HAVE_PTHREAD_MUTEXATTR_SETTYPE 1
/* Define to 1 if you have the `pthread_testcancel' function. */
#define HAVE_PTHREAD_TESTCANCEL 1
/* Define to 1 if you have the <pty.h> header file. */
/* #undef HAVE_PTY_H */
/* Define to 1 if you have the <readline.h> header file. */
/* #undef HAVE_READLINE_H */
/* Define to 1 if you have the <readline/history.h> header file. */
/* #undef HAVE_READLINE_HISTORY_H */
/* Define to 1 if you have the <readline/readline.h> header file. */
/* #undef HAVE_READLINE_READLINE_H */
/* Define to 1 if you have the `round' function. */
#define HAVE_ROUND 1
/* Define to 1 if you have the `roundf' function. */
#define HAVE_ROUNDF 1
/* Define to 1 if you have the `sem_init' function. */
#define HAVE_SEM_INIT 1
/* Define to 1 if you have the `sigaction' function. */
#define HAVE_SIGACTION 1
/* Define if we know a hack to replace siginfo_t->si_addr member. */
/* #undef HAVE_SIGCONTEXT_SUBTERFUGE */
/* Define if your system support extended signals. */
/* #undef HAVE_SIGINFO_T */
/* Define to 1 if you have the `signal' function. */
#define HAVE_SIGNAL 1
/* Define if sa_restorer is available in struct sigaction. */
/* #undef HAVE_SIGNAL_SA_RESTORER */
/* Define if we can ignore the fault (instruction skipping in SIGSEGV
handler). */
#define HAVE_SIGSEGV_SKIP_INSTRUCTION 1
/* Define if slirp library is supported */
#define HAVE_SLIRP 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
/* #undef HAVE_STDLIB_H */
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
/* #undef HAVE_STRING_H */
/* Define to 1 if you have the `strlcpy' function. */
#define HAVE_STRLCPY 1
/* Define to 1 if you have the <sys/bitypes.h> header file. */
/* #undef HAVE_SYS_BITYPES_H */
/* Define to 1 if you have the <sys/bsdtty.h> header file. */
/* #undef HAVE_SYS_BSDTTY_H */
/* Define to 1 if you have the <sys/filio.h> header file. */
#define HAVE_SYS_FILIO_H 1
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/mman.h> header file. */
#define HAVE_SYS_MMAN_H 1
/* Define to 1 if you have the <sys/poll.h> header file. */
#define HAVE_SYS_POLL_H 1
/* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
/* #undef HAVE_SYS_TYPES_H */
/* Define to 1 if you have the <sys/wait.h> header file. */
#define HAVE_SYS_WAIT_H 1
/* Define to 1 if you have the `task_self' function. */
/* #undef HAVE_TASK_SELF */
/* Define to 1 if you have the `trunc' function. */
#define HAVE_TRUNC 1
/* Define to 1 if you have the `truncf' function. */
#define HAVE_TRUNCF 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the <util.h> header file. */
#define HAVE_UTIL_H 1
/* Define to 1 if you have the `vhangup' function. */
/* #undef HAVE_VHANGUP */
/* Define to 1 if you have the `vm_allocate' function. */
#define HAVE_VM_ALLOCATE 1
/* Define to 1 if you have the `vm_deallocate' function. */
#define HAVE_VM_DEALLOCATE 1
/* Define to 1 if you have the `vm_protect' function. */
#define HAVE_VM_PROTECT 1
/* Define if your system supports Windows exceptions. */
/* #undef HAVE_WIN32_EXCEPTIONS */
/* Define to 1 if you have the `_getpty' function. */
/* #undef HAVE__GETPTY */
/* Define to the floating point format of the host machine. */
#define HOST_FLOAT_FORMAT IEEE_FLOAT_FORMAT
/* Define to 1 if the host machine stores floating point numbers in memory
with the word containing the sign bit at the lowest address, or to 0 if it
does it the other way around. This macro should not be defined if the
ordering is the same as for multi-word integers. */
/* #undef HOST_FLOAT_WORDS_BIG_ENDIAN */
/* Define constant offset for Mac address translation */
/* #undef NATMEM_OFFSET */
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "Christian.Bauer@uni-mainz.de"
/* Define to the full name of this package. */
#define PACKAGE_NAME "SheepShaver"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "SheepShaver 2.5"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "SheepShaver"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "2.5"
/* Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this
system. */
#define PAGEZERO_HACK 1
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
/* Define if your system requires sigactions to be reinstalled. */
/* #undef SIGACTION_NEED_REINSTALL */
/* Define if your system requires signals to be reinstalled. */
/* #undef SIGNAL_NEED_REINSTALL */
/* The size of `double', as computed by sizeof. */
#define SIZEOF_DOUBLE 8
/* The size of `float', as computed by sizeof. */
#define SIZEOF_FLOAT 4
/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 8
/* The size of `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG 8
/* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT 2
/* The size of `void *', as computed by sizeof. */
#define SIZEOF_VOID_P 8
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */
/* Define if BSD-style non-blocking I/O is to be used */
/* #undef USE_FIONBIO */
/* Define to enble SDL support. */
#define USE_SDL 1
/* Define to enable SDL audio support */
#define USE_SDL_AUDIO 1
/* Define to enable SDL video graphics support. */
#define USE_SDL_VIDEO 1
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
/* Define to 1 if the X Window System is missing or not being used. */
/* #undef X_DISPLAY_MISSING */
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to `off_t' if <sys/types.h> does not define. */
#define loff_t off_t
/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
/* Define to 'int' if <sys/types.h> doesn't define. */
/* #undef socklen_t */
#endif /* CONFIG_H */

View File

@ -4,6 +4,8 @@
#include "config-macosx-x86_32.h"
#elif defined(__ppc__)
#include "config-macosx-ppc_32.h"
#elif defined(__aarch64__)
#include "config-macosx-aarch64.h"
#else
#error Unknown platform
#endif
#endif

View File

@ -105,9 +105,6 @@ define GUI_SRCS_LIST_TO_OBJS
$(basename $(notdir $(file))))))
endef
GUI_OBJS = $(GUI_SRCS_LIST_TO_OBJS)
ifeq ($(USE_BINCUE),yes)
GUI_OBJS += bincue_unix.o
endif
define DYNGENSRCS_LIST_TO_OBJS
$(addprefix $(OBJ_DIR)/, $(addsuffix .dgo, $(foreach file, $(DYNGENSRCS), \

View File

@ -1 +0,0 @@
../../../BasiliskII/src/Unix/bincue_unix.cpp

View File

@ -1 +0,0 @@
../../../BasiliskII/src/Unix/bincue_unix.h

View File

@ -698,6 +698,7 @@ AS_IF([test "x$have_bincue" = "xyes" ], [
AC_SUBST(USE_BINCUE, no)
else
CPPFLAGS="$CPPFLAGS -DBINCUE $OSX_CORE_AUDIO"
DEFINES="$DEFINES -DBINCUE"
AC_SUBST(USE_BINCUE, yes)
fi
], [AC_SUBST(USE_BINCUE, no)])
@ -781,7 +782,7 @@ fi
dnl BINCUE overrides
if [[ "x$have_bincue" = "xyes" ]]; then
EXTRASYSSRCS="$EXTRASYSSRCS bincue_unix.cpp"
EXTRASYSSRCS="$EXTRASYSSRCS bincue.cpp"
fi
dnl libvhd overrides

View File

@ -29,6 +29,8 @@ SLIRP_SRCS = \
../slirp/ip_input.c ../slirp/socket.c ../slirp/udp.c
SLIRP_OBJS = $(SLIRP_SRCS:../slirp/%.c=$(OBJ_DIR)/slirp-%.o)
USE_BINCUE = @USE_BINCUE@
LN_S = @LN_S@
WINDRES = @WINDRES@
CC = @CC@
@ -41,6 +43,7 @@ LDFLAGS = @LDFLAGS@ -Wl,-Bstatic
#TODO remove pthread part of that if irrelevant
LIBS = @LIBS@ -lws2_32 -lwsock32 -liphlpapi
CPUSRCS = @CPUSRCS@
EXTRASRCS = @EXTRASRCS@
PERL = @PERL@
USE_DYNGEN = @USE_DYNGEN@
@ -73,7 +76,7 @@ SRCS = ../main.cpp main_windows.cpp ../prefs.cpp ../prefs_items.cpp prefs_window
about_window_windows.cpp ../user_strings.cpp user_strings_windows.cpp \
../dummy/prefs_editor_dummy.cpp clip_windows.cpp util_windows.cpp \
vm_alloc.cpp sigsegv.cpp posix_emu.cpp SheepShaver.rc \
$(CPUSRCS) $(ROUTERSRCS) $(SLIRP_OBJS)
$(CPUSRCS) $(ROUTERSRCS) $(EXTRASRCS) $(SLIRP_OBJS)
UI_SRCS = ../prefs.cpp prefs_windows.cpp prefs_editor_gtk.cpp xpram_windows.cpp \
../prefs_items.cpp ../user_strings.cpp user_strings_windows.cpp util_windows.cpp \

View File

@ -16,6 +16,9 @@ AC_ARG_ENABLE(jit, [ --enable-jit enable JIT compiler [defa
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
AC_ARG_WITH(bincue,
AS_HELP_STRING([--with-bincue], [Allow cdrom image files in bin/cue mode]))
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
@ -199,6 +202,19 @@ cygwin)
;;
esac
dnl BINCUE
AS_IF([test "x$with_bincue" = "xyes" ], [have_bincue=yes], [have_bincue=no])
AS_IF([test "x$have_bincue" = "xyes" ], [
DEFINES="$DEFINES -DBINCUE"
CPPFLAGS="$CPPFLAGS -DBINCUE"
AC_SUBST(USE_BINCUE, yes)
], [AC_SUBST(USE_BINCUE, no)])
dnl BINCUE overrides
if [[ "x$have_bincue" = "xyes" ]]; then
EXTRASRCS="$EXTRASRCS bincue.cpp"
fi
dnl CPU emulator sources
CPUSRCS="\
../kpx_cpu/src/mathlib/ieeefp.cpp \
@ -278,6 +294,7 @@ AC_SUBST(USE_PREGENERATED_DYNGEN)
AC_SUBST(DYNGENSRCS)
AC_SUBST(DYNGEN_OP_FLAGS)
AC_SUBST(CPUSRCS)
AC_SUBST(EXTRASRCS)
AC_OUTPUT([Makefile])
dnl Print summary.
@ -286,6 +303,7 @@ echo SheepShaver configuration summary:
echo
echo Enable JIT compiler .............. : $WANT_JIT
echo GTK user interface ............... : $WANT_GTK
echo BINCUE support ......................... : $have_bincue
echo Enable VOSF ...................... : $WANT_VOSF
echo
echo "Configuration done. Now type \"make\"."

1
SheepShaver/src/bincue.cpp Symbolic link
View File

@ -0,0 +1 @@
../../BasiliskII/src/bincue.cpp

View File

@ -0,0 +1 @@
../../../BasiliskII/src/include/bincue.h

View File

@ -164,9 +164,9 @@ enum {
enum {
kDisplayModeIDCurrent = 0x00, /* Reference the Current DisplayModeID */
kDisplayModeIDInvalid = (long)0xFFFFFFFF, /* A bogus DisplayModeID in all cases */
kDisplayModeIDFindFirstResolution = (long)0xFFFFFFFE, /* Used in cscGetNextResolution to reset iterator */
kDisplayModeIDNoMoreResolutions = (long)0xFFFFFFFD /* Used in cscGetNextResolution to indicate End Of List */
kDisplayModeIDInvalid = 0xFFFFFFFF, /* A bogus DisplayModeID in all cases */
kDisplayModeIDFindFirstResolution = 0xFFFFFFFE, /* Used in cscGetNextResolution to reset iterator */
kDisplayModeIDNoMoreResolutions = 0xFFFFFFFD /* Used in cscGetNextResolution to indicate End Of List */
};
/* codes for Display Manager status requests */

View File

@ -19,6 +19,9 @@
*/
#include "sysdeps.h"
#if ENABLE_DYNGEN
#include "basic-dyngen.hpp"
int __op_param1, __op_param2, __op_param3;
@ -181,3 +184,5 @@ basic_dyngen::gen_align(int align)
#endif
return code_ptr();
}
#endif //ENABLE_DYNGEN

View File

@ -19,6 +19,9 @@
*/
#include "sysdeps.h"
#if ENABLE_DYNGEN
#include "vm_alloc.h"
#include "cpu/jit/jit-cache.hpp"
@ -146,3 +149,5 @@ basic_jit_cache::copy_data(const uint8 *block, uint32 size)
D(bug("basic_jit_cache: DATA %p, %d bytes [data=%p, offs=%u]\n", ptr, size, data, data->offs));
return ptr;
}
#endif //ENABLE_DYNGEN

View File

@ -372,6 +372,7 @@ powerpc_cpu::powerpc_cpu(task_struct *parent_task)
#if PPC_ENABLE_JIT
use_jit = false;
#endif
spcflags().init();
++ppc_refcount;
initialize();
}

View File

@ -19,6 +19,9 @@
*/
#include "sysdeps.h"
#if ENABLE_DYNGEN
#include "utils/utils-cpuinfo.hpp"
#include "cpu/ppc/ppc-dyngen.hpp"
#include "cpu/ppc/ppc-bitfields.hpp"
@ -311,3 +314,5 @@ void powerpc_dyngen::gen_store_vect_VS_T0(int vS)
gen_load_ad_VD_VR(vS);
gen_op_store_vect_VD_T0();
}
#endif //ENABLE_DYNGEN

View File

@ -19,6 +19,9 @@
*/
#include "sysdeps.h"
#if ENABLE_DYNGEN
#include "cpu/jit/dyngen-exec.h"
#include "cpu/ppc/ppc-jit.hpp"
#include "cpu/ppc/ppc-cpu.hpp"
@ -949,3 +952,5 @@ bool powerpc_jit::gen_ssse3_vperm(int mnemo, int vD, int vA, int vB, int vC)
return true;
}
#endif
#endif //ENABLE_DYNGEN

View File

@ -41,8 +41,10 @@ class basic_spcflags
public:
basic_spcflags()
: mask(0), lock(SPIN_LOCK_UNLOCKED)
{ }
{ init(); }
void init()
{ mask = 0; lock = SPIN_LOCK_UNLOCKED; }
bool empty() const
{ return (mask == 0); }

View File

@ -411,12 +411,12 @@ static const uint8 sony_driver[] = { // Replacement for .Sony driver
static const uint8 disk_driver[] = { // Generic disk driver
// Driver header
DiskDriverFlags >> 8, DiskDriverFlags & 0xff, 0, 0, 0, 0, 0, 0,
0x00, 0x18, // Open() offset
0x00, 0x1c, // Prime() offset
0x00, 0x20, // Control() offset
0x00, 0x2c, // Status() offset
0x00, 0x52, // Close() offset
0x05, 0x2e, 0x44, 0x69, 0x73, 0x6b, // ".Disk"
0x00, 0x1c, // Open() offset
0x00, 0x20, // Prime() offset
0x00, 0x24, // Control() offset
0x00, 0x30, // Status() offset
0x00, 0x56, // Close() offset
0x08, 0x2e, 0x41, 0x54, 0x41, 0x44, 0x69, 0x73, 0x6b, 0x00, // ".ATADisk"
// Open()
M68K_EMUL_OP_DISK_OPEN >> 8, M68K_EMUL_OP_DISK_OPEN & 0xff,
@ -2362,6 +2362,7 @@ static bool patch_68k(void)
*wp++ = htons(0x4e74); *wp++ = htons(0x0008); // rtd #8
}
}
return true;
}
@ -2418,7 +2419,7 @@ void InstallDrivers(void)
WriteMacInt16(dce + dCtlFlags, DiskDriverFlags);
// Open disk driver
SheepString disk_str("\005.Disk");
SheepString disk_str("\010.ATADisk");
WriteMacInt32(pb + ioNamePtr, disk_str.addr());
r.a[0] = pb;
Execute68kTrap(0xa000, &r); // Open()

View File

@ -517,12 +517,13 @@ void CheckLoad(uint32 type, int16 id, uint16 *p, uint32 size)
D(bug(" patch applied\n"));
}
} else if (type == FOURCC('D','R','V','R') && (id == -16501 || id == -16500)) {
// patch for -16501 resource ID not even needed? seems to run off native driver without
/* } else if (type == FOURCC('D','R','V','R') && (id == -16501)){// || id == -16500)) { // -16500 will patch over native driver and traps out to code, but very hard to re-implement there!
D(bug("DRVR -16501/-16500 found\n"));
// Install sound input driver
memcpy(p, sound_input_driver, sizeof(sound_input_driver));
D(bug(" patch 1 applied\n"));
*/
} else if (type == FOURCC('I','N','I','T') && id == 1 && size == (2416 >> 1)) {
D(bug("INIT 1 (size 2416) found\n"));
size >>= 1;

View File

@ -777,7 +777,7 @@ static int16 VideoStatus(uint32 pb, VidLocals *csSave)
case cscGetNextResolution: {
D(bug("GetNextResolution \n"));
int work_id = ReadMacInt32(param + csPreviousDisplayModeID);
unsigned int work_id = ReadMacInt32(param + csPreviousDisplayModeID);
switch (work_id) {
case kDisplayModeIDCurrent:
work_id = csSave->saveData;