31 |
|
#include "rom_patches.h" |
32 |
|
#include "main.h" |
33 |
|
#include "audio.h" |
34 |
+ |
#include "audio_defs.h" |
35 |
+ |
#include "thunks.h" |
36 |
|
|
37 |
|
#define DEBUG 0 |
38 |
|
#include "debug.h" |
449 |
|
|
450 |
|
} else if (type == FOURCC('t','h','n','g')) { |
451 |
|
// Collect info about used audio sifters |
452 |
< |
uint32 c_type = ntohl(0[(uint32 *)p]); |
453 |
< |
uint32 sub_type = ntohl(1[(uint32 *)p]); |
452 |
> |
uint32 thing = (uintptr)p; |
453 |
> |
uint32 c_type = ReadMacInt32(thing); |
454 |
> |
uint32 sub_type = ReadMacInt32(thing + 4); |
455 |
|
if (c_type == FOURCC('s','d','e','v') && sub_type == FOURCC('s','i','n','g')) { |
456 |
< |
1[(uint32 *)p] = htonl(FOURCC('a','w','g','c')); |
456 |
> |
WriteMacInt32(thing + 4, FOURCC('a','w','g','c')); |
457 |
|
D(bug("thng %d, type %c%c%c%c (%08x), sub type %c%c%c%c (%08x), data %p\n", id, c_type >> 24, (c_type >> 16) & 0xff, (c_type >> 8) & 0xff, c_type & 0xff, c_type, sub_type >> 24, (sub_type >> 16) & 0xff, (sub_type >> 8) & 0xff, sub_type & 0xff, sub_type, p)); |
458 |
< |
AddSifter(ReadMacInt32(((uintptr)p)+20), ntohs(p[12])); |
459 |
< |
if (ntohs(p[28])) // componentPFCount |
460 |
< |
AddSifter(ReadMacInt32(((uintptr)p)+62), ntohs(p[33])); |
458 |
> |
AddSifter(ReadMacInt32(thing + componentResType), ReadMacInt16(thing + componentResID)); |
459 |
> |
if (ReadMacInt32(thing + componentPFCount)) |
460 |
> |
AddSifter(ReadMacInt32(thing + componentPFResType), ReadMacInt16(thing + componentPFResID)); |
461 |
|
} |
462 |
|
|
463 |
|
} else if (type == FOURCC('s','i','f','t') || type == FOURCC('n','i','f','t')) { |
719 |
|
*(uint32 *)XLM_RES_LIB_TOC = tvec[1]; |
720 |
|
*(uint32 *)XLM_GET_RESOURCE = tvec[0]; |
721 |
|
#if EMULATED_PPC |
722 |
< |
tvec[0] = htonl(POWERPC_NATIVE_OP_FUNC(NATIVE_GET_RESOURCE)); |
722 |
> |
tvec[0] = htonl(NativeFunction(NATIVE_GET_RESOURCE)); |
723 |
|
#else |
724 |
|
#ifdef __BEOS__ |
725 |
|
uint32 *tvec2 = (uint32 *)get_resource; |
736 |
|
D(bug(" Get1Resource() entry %08x, TOC %08x\n", ntohl(tvec[0]), ntohl(tvec[1]))); |
737 |
|
*(uint32 *)XLM_GET_1_RESOURCE = tvec[0]; |
738 |
|
#if EMULATED_PPC |
739 |
< |
tvec[0] = htonl(POWERPC_NATIVE_OP_FUNC(NATIVE_GET_1_RESOURCE)); |
739 |
> |
tvec[0] = htonl(NativeFunction(NATIVE_GET_1_RESOURCE)); |
740 |
|
#else |
741 |
|
#ifdef __BEOS__ |
742 |
|
tvec2 = (uint32 *)get_1_resource; |
753 |
|
D(bug(" GetIndResource() entry %08x, TOC %08x\n", ntohl(tvec[0]), ntohl(tvec[1]))); |
754 |
|
*(uint32 *)XLM_GET_IND_RESOURCE = tvec[0]; |
755 |
|
#if EMULATED_PPC |
756 |
< |
tvec[0] = htonl(POWERPC_NATIVE_OP_FUNC(NATIVE_GET_IND_RESOURCE)); |
756 |
> |
tvec[0] = htonl(NativeFunction(NATIVE_GET_IND_RESOURCE)); |
757 |
|
#else |
758 |
|
#ifdef __BEOS__ |
759 |
|
tvec2 = (uint32 *)get_ind_resource; |
770 |
|
D(bug(" Get1IndResource() entry %08x, TOC %08x\n", ntohl(tvec[0]), ntohl(tvec[1]))); |
771 |
|
*(uint32 *)XLM_GET_1_IND_RESOURCE = tvec[0]; |
772 |
|
#if EMULATED_PPC |
773 |
< |
tvec[0] = htonl(POWERPC_NATIVE_OP_FUNC(NATIVE_GET_1_IND_RESOURCE)); |
773 |
> |
tvec[0] = htonl(NativeFunction(NATIVE_GET_1_IND_RESOURCE)); |
774 |
|
#else |
775 |
|
#ifdef __BEOS__ |
776 |
|
tvec2 = (uint32 *)get_1_ind_resource; |
787 |
|
D(bug(" RGetResource() entry %08x, TOC %08x\n", ntohl(tvec[0]), ntohl(tvec[1]))); |
788 |
|
*(uint32 *)XLM_R_GET_RESOURCE = tvec[0]; |
789 |
|
#if EMULATED_PPC |
790 |
< |
tvec[0] = htonl(POWERPC_NATIVE_OP_FUNC(NATIVE_R_GET_RESOURCE)); |
790 |
> |
tvec[0] = htonl(NativeFunction(NATIVE_R_GET_RESOURCE)); |
791 |
|
#else |
792 |
|
#ifdef __BEOS__ |
793 |
|
tvec2 = (uint32 *)r_get_resource; |