Scratch work in audio.cpp to re-implement driver logic in trapped-out code, but working due to change in rscr patcher

This commit is contained in:
Seth Polsley 2019-11-05 01:20:21 -06:00
parent c7594f569a
commit 2ba2d12f8b
5 changed files with 333 additions and 53 deletions

View File

@ -32,6 +32,7 @@
#include "audio.h"
#include "audio_defs.h"
#include "user_strings.h"
#include "cdrom.h"
#define DEBUG 0
#include "debug.h"
@ -554,7 +555,22 @@ 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
uint32 selector = ReadMacInt32(pb + csParam); // 4-byte selector (should match via FOURCC above)
return noErr;
}
@ -576,11 +592,23 @@ 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)
// 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_flipped = bswap_32(selector); // endianness of selector needs swapping?
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
}
@ -591,60 +619,286 @@ 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
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_flipped = bswap_32(selector); // endianness of selector needs swapping?
switch (selector_flipped) {
// reading directly
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
// reading through location in memory
// uint32 *param = (uint32 *)Mac2HostAddr(pb + csParam);
// uint32 selector_flipped = param[0];
// uint32 selector = bswap_32(selector_flipped); // endianness of selector needs swapping?
// D(bug(" selector %c%c%c%c\n", selector >> 24, selector >> 16, selector >> 8, selector));
// uint32 bufferptr_flipped = param[1]; // pointer to application-supplied buffer for return data
// uint32 bufferptr = bswap_32(bufferptr_flipped); // endianness of buffer address needs swapping?
// 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
// uint8 *buffer = Mac2HostAddr(bufferptr);
switch (selector) {
//#if 0
case siDeviceName: {
const char *str = GetString(STR_SOUND_IN_NAME);
param[0] = 0;
memcpy((void *)param[1], str, strlen(str));
case siDeviceName: { // return name in STR255 format
// const char *str = GetString(STR_SOUND_IN_NAME);
const uint8 str[] = { // size 9
0x08, // 1-byte length
0x42, 0x75, // Bu
0x69, 0x6c, // il
0x74, 0x2d, // t-
0x69, 0x6e // in
};
const uint8 str2[] = { // size 8
0x07, // 1-byte length
0x41, 0x70, // Ap
0x70, 0x6c, // pl
0x65, 0x43, // eC
0x44 // D
};
const uint8 str3[] = { // size 12
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
};
const uint8 str4[] = { // size 18
0x10, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x00 // ".AppleSoundInput"
};
WriteMacInt32(pb + csParam, 0); // response will directly be written into buffer
vm_memcpy(bufferptr, str3, 12);
// memcpy(buffer, str, 9);
return noErr;
}
case siDeviceIcon: {
return -192; // early return: 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]) {
param[0] = 4; // Length of returned data
param[1] = r.a[2]; // Handle to icon suite
// return -192;
WriteMacInt32(pb + csParam, 0);
WriteMacInt32(bufferptr, CDROMIconAddr);
return noErr;
// attempt to load from external file into emulator
// FILE *fl = fopen("/Emulators/SheepShaver/Shared/SoundIcon.icn", "r");
// fseek(fl, 0, SEEK_END);
// long len = ftell(fl);
// uint32 icnbuffer = Mac_sysalloc(len);
// uint8 *ret = (uint8*)Mac2HostAddr(icnbuffer);
// fseek(fl, 0, SEEK_SET);
// fread(ret, 1, len, fl);
// fclose(fl);
// WriteMacInt32(pb + csParam, 4); // will be the address of the icn in memory
// WriteMacInt32(pb + csParam + 4, icnbuffer);
// WriteMacInt32(bufferptr,icnbuffer);
// 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
}
case siInputSource: {
// uint32 addr = Mac_sysalloc(1);
// WriteMacInt32(addr, 0);
// param[0] = 4;
// param[1] = addr;
// WriteMacInt32(param[1], 0);
// const uint32 opt = 0; // 0 if no options box supported and 1 if so
// const uint8 ind[] = {
// 0x00, 0x00, 0x00, 0x00
// };
// param[0] = 0;s
// memcpy((void *)buffer, ind, 4);
// uint8 *src = (uint8 *)Mac2HostAddr(Mac_sysalloc(1));
// *src = 0x00;
// param[0] = 4;
// param[1] = Host2MacAddr(src);
// return -231;
// uint32 opt = Mac_sysalloc(4);
// WriteMacInt32(opt, 0);
// param[0] = 4;
// param[1] = opt;
// return -231;
WriteMacInt32(pb + csParam, 4);
WriteMacInt32(pb + csParam + 4, 1);
return noErr;
}
case siInputSourceNames: { // list of sources in str# resource format
// return -231;
// const char names[] = {
// '\x00', '\x02',
// '\x0b',
// 'I','n','t','e','r','n','a','l',' ','C','D',
// '\x0a',
// 'M','i','c','r','o','p','h','o','n','e','\0'
// };
// const char names2[] = {
// '\x00', 'e', 'n', 'o', 'h', 'p', 'o', 'r', 'c', 'i', 'M', '\x0a', 'D', 'C', ' ', 'l', 'a', 'n', 'r', 'e', 't', 'n', 'I', '\x0b', '\x02', '\x00'
// };
// SheepVar names_str(26);
// strcpy((char*)Mac2HostAddr(names_str.addr()),names2);
// WriteMacInt32(pb + csParam, 0);
// WriteMacInt32(bufferptr, names_str.addr());
// return noErr;
// SheepString names("\00bInternal CD");
// WriteMacInt32(pb + csParam, 0);
// WriteMacInt32(bufferptr, names.addr());
// return noErr;
// uint32 nameshandle = Mac_sysalloc(14);
// SheepVar names_str(25);
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
};
const char str2[] = {
0x00, 0x01, // 2-byte count of #strings
0x02, // string size is 2
0x43, 0x44, // CD
0x00
};
SheepString names(str2);
// vm_memcpy(names_str.addr(), str, 25);
WriteMacInt32(pb + csParam, 0);
// vm_memcpy(bufferptr, str, 25);
WriteMacInt32(bufferptr, names.addr());
return noErr;
// vm_memcpy(nameshandle, str, 14);
// memcpy(names, str, 14);
// attempt to load from external file into emulator
// FILE *fl = fopen("/Emulators/SheepShaver/Shared/soundnames.rsrc", "r");
// fseek(fl, 0, SEEK_END);
// long len = ftell(fl);
// uint8 *ret = (uint8*)malloc(len);
// fseek(fl, 0, SEEK_SET);
// fread(ret, 1, len, fl);
// fclose(fl);
// SheepVar names_strs(len);
// vm_memcpy(names_strs.addr(), ret, len);
// WriteMacInt32(pb + csParam, 0);
// WriteMacInt32(bufferptr, names_strs.addr());
// return noErr;
// uint32 name = Mac_sysalloc(14);
// Host2Mac_memcpy(name, str, 14);
// uint32 handle = Host2MacAddr(names);
// param[0] = 4;
// memcpy((void *)param[1], str, 14);
// return noErr;
// WriteMacInt16(param[1], 1);
// const char *str = "Internal CD";
//// Host2Mac_memcpy(param[1]+sizeof(uint16), str, strlen(str));
//// uint16 *num = new uint16; // number of sources (2-bytes at start of infoData
//// *num = (uint16) 1;
//// const char *str = "Built-In";//GetString(STR_SOUND_IN_SOURCE);
//// param[0] = sizeof(uint16) + strlen(str);
//// memcpy((void *)param[1], num, sizeof(uint16));
// memcpy((void *)param[1], str, strlen(str));
// return -231; // when only 1 source, return siUnknownInfoType
}
case siOptionsDialog: {
// WriteMacInt32(param[1], 0);
// const uint32 opt = 0; // 0 if no options box supported and 1 if so
// param[0] = 0;
// memcpy((void *)param[1], &opt, sizeof(opt));
// const uint8 ind[] = {
// 0x00, 0x00, 0x00, 0x00
// };
// uint32 opt = Mac_sysalloc(4);
// WriteMacInt32(opt, 0);
// param[0] = 0;
// WriteMacInt32(bufferptr, 0);
WriteMacInt32(pb + csParam, 4);
WriteMacInt32(pb + csParam + 4, 0);
// uint8 *src = (uint8 *)Mac2HostAddr(Mac_sysalloc(1));
// *src = 0x00;
// param[0] = 4;
// param[1] = Host2MacAddr(src);
// uint32 opt = Mac_sysalloc(4);
// WriteMacInt32(opt, 0);
// param[0] = 4;
// param[1] = opt;
return noErr;
}
case siPlayThruOnOff: {
// WriteMacInt32(param[1], 0);
// const uint32 plt = 7; // playthrough volume, 0 is off and 7 is max
// param[0] = 0;
// memcpy((void *)param[1], &plt, sizeof(plt));
// uint32 opt = Mac_sysalloc(4);
// WriteMacInt32(opt, 0);
// param[0] = 0;
// WriteMacInt32(bufferptr, 7);
WriteMacInt32(pb + csParam, 4);
WriteMacInt32(pb + csParam + 4, 7);
// uint32 opt = Mac_sysalloc(4);
// WriteMacInt32(opt, 0);
// param[0] = 4;
// param[1] = opt;
return noErr;
} else
return -192; // resNotFound
}
//#endif
case FOURCC('p', 't', 'k', 'd'): {
return -231;
WriteMacInt32(pb + csParam, 1);
WriteMacInt8(pb + csParam + 4, 0);
return noErr;
}
case FOURCC('i', 'n', 'p', 't'): {
return -231;
}
default:
return -231; // siUnknownInfoType
}

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

@ -28,7 +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 */; };
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 */; };
@ -77,6 +76,7 @@
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 */; };
5D3967C02328D315003925D6 /* adb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D3967BF2328D315003925D6 /* adb.cpp */; };
5D55CB40225584D000FF8E81 /* cdrom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D55CB3F225584D000FF8E81 /* cdrom.cpp */; };
5D55CB432255B4FE00FF8E81 /* bincue_unix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D55CB422255B4FD00FF8E81 /* bincue_unix.cpp */; };
5D55CB452255B50E00FF8E81 /* bincue_unix.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D55CB442255B50E00FF8E81 /* bincue_unix.h */; };
@ -169,7 +169,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; };
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; };
@ -335,6 +334,7 @@
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>"; };
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>"; };
5D55CB422255B4FD00FF8E81 /* bincue_unix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bincue_unix.cpp; path = ../../../BasiliskII/src/Unix/bincue_unix.cpp; sourceTree = "<group>"; };
5D55CB442255B50E00FF8E81 /* bincue_unix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bincue_unix.h; path = ../../../BasiliskII/src/Unix/bincue_unix.h; sourceTree = "<group>"; };
@ -476,7 +476,7 @@
isa = PBXGroup;
children = (
087B91B11B780EC900825F7F /* CrossPlatform */,
0856CD4B14A99EEF000B1711 /* adb.cpp */,
5D3967BF2328D315003925D6 /* adb.cpp */,
5DF4CB7E22B5BD5D00512A86 /* audio.cpp */,
5D55CB3F225584D000FF8E81 /* cdrom.cpp */,
0856CD7D14A99EEF000B1711 /* disk.cpp */,
@ -1066,7 +1066,6 @@
E44C460B20D262B0000583AE /* debug.c in Sources */,
5DDE94FB2255C712004D0E79 /* MacOSX_sound_if.cpp in Sources */,
E44C460C20D262B0000583AE /* tcp_subr.c in Sources */,
0856CFC114A99EF0000B1711 /* adb.cpp in Sources */,
E44C461520D262B0000583AE /* ip_output.c in Sources */,
E44C461820D262B0000583AE /* tcp_output.c in Sources */,
0856CFE614A99EF0000B1711 /* disk.cpp in Sources */,
@ -1100,6 +1099,7 @@
0856D06214A99EF1000B1711 /* audio_sdl.cpp in Sources */,
0856D06614A99EF1000B1711 /* serial.cpp in Sources */,
E456E2AD20C82B61006C8DC2 /* clip_macosx64.mm in Sources */,
5D3967C02328D315003925D6 /* adb.cpp in Sources */,
0856D07B14A99EF1000B1711 /* sony.cpp in Sources */,
0856D07C14A99EF1000B1711 /* thunks.cpp in Sources */,
0856D07D14A99EF1000B1711 /* timer.cpp in Sources */,

View File

@ -2341,6 +2341,15 @@ static bool patch_68k(void)
if (ReadMacInt32(thing + componentPFCount))
AddSifter(ReadMacInt32(thing + componentPFResType), ReadMacInt16(thing + componentPFResID));
}
// else if (ReadMacInt32(thing) == FOURCC('s','i','n','p')) {
// D(bug("found sinp component at offset %08x in ROM\n", thing));
// }
// else if (ReadMacInt32(thing) == FOURCC('c','d',' ',' ')) {
// D(bug("found sinp component at offset %08x in ROM\n", thing));
// }
// else if (ReadMacInt32(thing) == FOURCC('i','m','i','c')) {
// D(bug("found sinp component at offset %08x in ROM\n", thing));
// }
thing = find_rom_resource(FOURCC('t','h','n','g'), 4711, true);
}
@ -2362,6 +2371,17 @@ static bool patch_68k(void)
*wp++ = htons(0x4e74); *wp++ = htons(0x0008); // rtd #8
}
}
// // Find sound input in ROM
// D(bug("Searching for sound components with type sdev in ROM\n"));
// uint32 sinp = find_rom_resource(FOURCC('s','i','n','p'));
// if (sinp == 0) {
// sinp = find_rom_resource(FOURCC('c','d',' ',' '));
// if (sinp == 0) {
// sinp = find_rom_resource(FOURCC('i','m','i','c'));
// }
// }
return true;
}

View File

@ -517,7 +517,7 @@ 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)) {
} else if (type == FOURCC('D','R','V','R') && (id == -16501)){// || id == -16500)) { // -16501 patches the native driver and -16500 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));