Making some Runtime progress
This commit is contained in:
parent
c15173cc66
commit
9db40b5649
12 changed files with 1537 additions and 24 deletions
|
|
@ -157,7 +157,7 @@ lbl_1_bss_54 = .bss:0x00000054; // type:object size:0x4 data:4byte
|
|||
lbl_1_bss_58 = .bss:0x00000058; // type:object size:0x4 data:4byte
|
||||
lbl_1_bss_5C = .bss:0x0000005C; // type:object size:0x2D0
|
||||
lbl_1_bss_32C = .bss:0x0000032C; // type:object size:0x4 data:4byte
|
||||
lbl_1_bss_330 = .bss:0x00000330; // type:object size:0x24 data:4byte
|
||||
lbl_1_bss_330 = .bss:0x00000330; // type:object size:0x24 scope:local data:4byte
|
||||
lbl_1_bss_354 = .bss:0x00000354; // type:object size:0x4 data:4byte
|
||||
lbl_1_bss_358 = .bss:0x00000358; // type:object size:0x4 data:4byte
|
||||
lbl_1_bss_35C = .bss:0x0000035C; // type:object size:0x1C0 data:4byte
|
||||
|
|
|
|||
|
|
@ -955,7 +955,7 @@ Runtime.PPCEABI.H/NewMore.cp:
|
|||
.data start:0x8013E208 end:0x8013E218
|
||||
.sdata start:0x801D39A0 end:0x801D39A8
|
||||
|
||||
Runtime.PPCEABI.H/NMWException.cp:
|
||||
Runtime.PPCEABI.H/NMWException.cpp:
|
||||
extab start:0x80005650 end:0x80005670
|
||||
extabindex start:0x80005718 end:0x80005748
|
||||
.text start:0x800E2108 end:0x800E23CC
|
||||
|
|
@ -971,7 +971,7 @@ Runtime.PPCEABI.H/__init_cpp_exceptions.cpp:
|
|||
.dtors start:0x8011DCE0 end:0x8011DCE8
|
||||
.sdata start:0x801D39B0 end:0x801D39B8
|
||||
|
||||
Runtime.PPCEABI.H/Gecko_ExceptionPPC.cp:
|
||||
Runtime.PPCEABI.H/Gecko_ExceptionPPC.cpp:
|
||||
extab start:0x80005670 end:0x800056E4
|
||||
extabindex start:0x80005748 end:0x8000579C
|
||||
.text start:0x800E2B24 end:0x800E3F5C
|
||||
|
|
|
|||
|
|
@ -3646,10 +3646,10 @@ __THPAANScaleFactor = .rodata:0x8011E490; // type:object size:0x40 data:byte
|
|||
lbl_8011E4D0 = .rodata:0x8011E4D0; // type:object size:0x10
|
||||
lbl_8011E4E0 = .rodata:0x8011E4E0; // type:object size:0x10
|
||||
__constants = .rodata:0x8011E4F0; // type:object size:0x18 scope:local data:double
|
||||
lbl_8011E508 = .rodata:0x8011E508; // type:object size:0x54
|
||||
lbl_8011E55C = .rodata:0x8011E55C; // type:object size:0x14
|
||||
lbl_8011E570 = .rodata:0x8011E570; // type:object size:0x10
|
||||
lbl_8011E580 = .rodata:0x8011E580; // type:object size:0x20
|
||||
lbl_8011E508 = .rodata:0x8011E508; // type:object size:0x54 data:string
|
||||
lbl_8011E55C = .rodata:0x8011E55C; // type:object size:0x14 data:string
|
||||
lbl_8011E570 = .rodata:0x8011E570; // type:object size:0x10 data:string
|
||||
lbl_8011E580 = .rodata:0x8011E580; // type:object size:0x20 data:string
|
||||
lbl_8011E5A0 = .rodata:0x8011E5A0; // type:object size:0x38
|
||||
lbl_8011E5D8 = .rodata:0x8011E5D8; // type:object size:0x40
|
||||
fix_pool_sizes = .rodata:0x8011E618; // type:object size:0x18 scope:local data:4byte
|
||||
|
|
|
|||
|
|
@ -955,7 +955,7 @@ Runtime.PPCEABI.H/NewMore.cp:
|
|||
.data start:0x8013E208 end:0x8013E218
|
||||
.sdata start:0x801D39A0 end:0x801D39A8
|
||||
|
||||
Runtime.PPCEABI.H/NMWException.cp:
|
||||
Runtime.PPCEABI.H/NMWException.cpp:
|
||||
extab start:0x80005650 end:0x80005670
|
||||
extabindex start:0x80005718 end:0x80005748
|
||||
.text start:0x800E2108 end:0x800E23CC
|
||||
|
|
@ -971,7 +971,7 @@ Runtime.PPCEABI.H/__init_cpp_exceptions.cpp:
|
|||
.dtors start:0x8011DCE0 end:0x8011DCE8
|
||||
.sdata start:0x801D39B0 end:0x801D39B8
|
||||
|
||||
Runtime.PPCEABI.H/Gecko_ExceptionPPC.cp:
|
||||
Runtime.PPCEABI.H/Gecko_ExceptionPPC.cpp:
|
||||
extab start:0x80005670 end:0x800056E4
|
||||
extabindex start:0x80005748 end:0x8000579C
|
||||
.text start:0x800E2B24 end:0x800E3F5C
|
||||
|
|
|
|||
12
configure.py
12
configure.py
|
|
@ -209,7 +209,7 @@ else:
|
|||
cflags_runtime = [
|
||||
*cflags_base,
|
||||
"-use_lmw_stmw on",
|
||||
"-str reuse,pool,readonly",
|
||||
"-str reuse,readonly",
|
||||
"-common off",
|
||||
"-inline auto,deferred",
|
||||
]
|
||||
|
|
@ -668,11 +668,15 @@ config.libs = [
|
|||
Object(MatchingFor("GMPE01_00", "GMPE01_01"), "Runtime.PPCEABI.H/__mem.c"),
|
||||
Object(NonMatching, "Runtime.PPCEABI.H/New.cp"),
|
||||
Object(NonMatching, "Runtime.PPCEABI.H/NewMore.cp"),
|
||||
Object(NonMatching, "Runtime.PPCEABI.H/NMWException.cp"),
|
||||
Object(NonMatching, "Runtime.PPCEABI.H/NMWException.cpp"),
|
||||
Object(MatchingFor("GMPE01_00", "GMPE01_01"), "Runtime.PPCEABI.H/runtime.c"),
|
||||
Object(MatchingFor("GMPE01_00", "GMPE01_01"), "Runtime.PPCEABI.H/__init_cpp_exceptions.cpp"),
|
||||
Object(NonMatching, "Runtime.PPCEABI.H/Gecko_ExceptionPPC.cp"),
|
||||
Object(NonMatching, "Runtime.PPCEABI.H/GCN_mem_alloc.c"),
|
||||
Object(
|
||||
NonMatching,
|
||||
"Runtime.PPCEABI.H/Gecko_ExceptionPPC.cpp",
|
||||
extra_cflags=["-Cpp_exceptions on"]
|
||||
),
|
||||
Object(MatchingFor("GMPE01_00", "GMPE01_01"), "Runtime.PPCEABI.H/GCN_mem_alloc.c"),
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
|||
231
include/PowerPC_EABI_Support/Runtime/Gecko_ExceptionPPC.h
Executable file
231
include/PowerPC_EABI_Support/Runtime/Gecko_ExceptionPPC.h
Executable file
|
|
@ -0,0 +1,231 @@
|
|||
#ifndef _RUNTIME_GECKO_EXCEPTIONPPC_H
|
||||
#define _RUNTIME_GECKO_EXCEPTIONPPC_H
|
||||
|
||||
#include <dolphin/types.h>
|
||||
|
||||
typedef u8 exaction_type;
|
||||
|
||||
#define EXACTION_ENDBIT 0x80
|
||||
#define EXACTION_MASK 0x7F
|
||||
|
||||
// EXAction structs
|
||||
|
||||
#define EXACTION_ENDOFLIST 0
|
||||
#define EXACTION_BRANCH 1
|
||||
|
||||
typedef struct ex_branch {
|
||||
exaction_type action;
|
||||
u8 unused;
|
||||
u16 target;
|
||||
} ex_branch;
|
||||
|
||||
#define EXACTION_DESTROYLOCAL 2
|
||||
|
||||
typedef struct ex_destroylocal {
|
||||
exaction_type action;
|
||||
u8 unused;
|
||||
s16 local;
|
||||
void* dtor;
|
||||
} ex_destroylocal;
|
||||
|
||||
#define EXACTION_DESTROYLOCALCOND 3
|
||||
|
||||
typedef struct ex_destroylocalcond {
|
||||
exaction_type action;
|
||||
u8 dlc_field;
|
||||
s16 cond;
|
||||
s16 local;
|
||||
void* dtor;
|
||||
} ex_destroylocalcond;
|
||||
|
||||
#define ex_destroylocalcond_MakeField(regcond) (((regcond) << 7))
|
||||
#define ex_destroylocalcond_GetRegCond(field) ((field) >> 7)
|
||||
|
||||
#define EXACTION_DESTROYLOCALPOINTER 4
|
||||
|
||||
typedef struct ex_destroylocalpointer {
|
||||
exaction_type action;
|
||||
u8 dlp_field;
|
||||
s16 pointer;
|
||||
void* dtor;
|
||||
} ex_destroylocalpointer;
|
||||
|
||||
#define ex_destroylocalpointer_MakeField(regpointer) (((regpointer) << 7))
|
||||
#define ex_destroylocalpointer_GetRegPointer(field) ((field) >> 7)
|
||||
|
||||
#define EXACTION_DESTROYLOCALARRAY 5
|
||||
|
||||
typedef struct ex_destroylocalarray {
|
||||
exaction_type action;
|
||||
u8 unused;
|
||||
s16 localarray;
|
||||
u16 elements;
|
||||
u16 element_size;
|
||||
void* dtor;
|
||||
} ex_destroylocalarray;
|
||||
|
||||
#define EXACTION_DESTROYBASE 6
|
||||
#define EXACTION_DESTROYMEMBER 7
|
||||
|
||||
typedef struct ex_destroymember {
|
||||
exaction_type action;
|
||||
u8 dm_field;
|
||||
s16 objectptr;
|
||||
s32 offset;
|
||||
void* dtor;
|
||||
} ex_destroymember;
|
||||
|
||||
#define ex_destroymember_MakeField(regpointer) (((regpointer) << 7))
|
||||
#define ex_destroymember_GetRegPointer(field) ((field) >> 7)
|
||||
|
||||
#define EXACTION_DESTROYMEMBERCOND 8
|
||||
|
||||
typedef struct ex_destroymembercond {
|
||||
exaction_type action;
|
||||
u8 dmc_field;
|
||||
s16 cond;
|
||||
s16 objectptr;
|
||||
s32 offset;
|
||||
void* dtor;
|
||||
} ex_destroymembercond;
|
||||
|
||||
#define ex_destroymembercond_MakeField(regcond, regpointer) (((regcond) << 7) | (((regpointer)&0x1) << 6))
|
||||
#define ex_destroymembercond_GetRegCond(field) ((field) >> 7)
|
||||
#define ex_destroymembercond_GetRegPointer(field) (((field) >> 6) & 0x1)
|
||||
|
||||
#define EXACTION_DESTROYMEMBERARRAY 9
|
||||
|
||||
typedef struct ex_destroymemberarray {
|
||||
exaction_type action;
|
||||
u8 dma_field;
|
||||
s16 objectptr;
|
||||
s32 offset;
|
||||
s32 elements;
|
||||
s32 element_size;
|
||||
void* dtor;
|
||||
} ex_destroymemberarray;
|
||||
|
||||
#define ex_destroymemberarray_MakeField(regpointer) (((regpointer) << 7))
|
||||
#define ex_destroymemberarray_GetRegPointer(field) ((field) >> 7)
|
||||
|
||||
#define EXACTION_DELETEPOINTER 10
|
||||
|
||||
typedef struct ex_deletepointer {
|
||||
exaction_type action;
|
||||
u8 dp_field;
|
||||
s16 objectptr;
|
||||
void* deletefunc;
|
||||
} ex_deletepointer;
|
||||
|
||||
#define ex_deletepointer_MakeField(regpointer) (((regpointer) << 7))
|
||||
#define ex_deletepointer_GetRegPointer(field) ((field) >> 7)
|
||||
|
||||
#define EXACTION_DELETEPOINTERCOND 11
|
||||
|
||||
typedef struct ex_deletepointercond {
|
||||
exaction_type action;
|
||||
u8 dpc_field;
|
||||
s16 cond;
|
||||
s16 objectptr;
|
||||
void* deletefunc;
|
||||
} ex_deletepointercond;
|
||||
|
||||
#define ex_deletepointercond_MakeField(regcond, regpointer) (((regcond) << 7) | (((regpointer)&0x1) << 6))
|
||||
#define ex_deletepointercond_GetRegCond(field) ((field) >> 7)
|
||||
#define ex_deletepointercond_GetRegPointer(field) (((field) >> 6) & 0x1)
|
||||
|
||||
#define EXACTION_CATCHBLOCK 12
|
||||
|
||||
typedef struct ex_catchblock {
|
||||
exaction_type action;
|
||||
u8 unused;
|
||||
char* catch_type;
|
||||
u16 catch_pcoffset;
|
||||
s16 cinfo_ref;
|
||||
} ex_catchblock;
|
||||
|
||||
#define EXACTION_ACTIVECATCHBLOCK 13
|
||||
|
||||
typedef struct ex_activecatchblock {
|
||||
exaction_type action;
|
||||
u8 unused;
|
||||
s16 cinfo_ref;
|
||||
} ex_activecatchblock;
|
||||
|
||||
#define EXACTION_TERMINATE 14
|
||||
|
||||
typedef struct ex_terminate {
|
||||
exaction_type action;
|
||||
u8 unused;
|
||||
} ex_terminate;
|
||||
|
||||
#define EXACTION_SPECIFICATION 15
|
||||
|
||||
typedef struct ex_specification {
|
||||
exaction_type action;
|
||||
u8 unused;
|
||||
u16 specs;
|
||||
s32 pcoffset;
|
||||
s32 cinfo_ref;
|
||||
char* spec[];
|
||||
} ex_specification;
|
||||
|
||||
#define EXACTION_CATCHBLOCK_32 16
|
||||
|
||||
typedef struct ex_catchblock_32 {
|
||||
exaction_type action;
|
||||
u8 unused;
|
||||
char* catch_type;
|
||||
s32 catch_pcoffset;
|
||||
s32 cinfo_ref;
|
||||
} ex_catchblock_32;
|
||||
|
||||
// Other structs
|
||||
|
||||
typedef struct ExceptionRangeSmall {
|
||||
u16 start;
|
||||
u16 end;
|
||||
u16 action;
|
||||
} ExceptionRangeSmall;
|
||||
|
||||
typedef struct ExceptionTableSmall {
|
||||
u16 et_field;
|
||||
ExceptionRangeSmall ranges[0];
|
||||
} ExceptionTableSmall;
|
||||
|
||||
typedef struct ExceptionRangeLarge {
|
||||
u32 start;
|
||||
u16 size;
|
||||
u16 action;
|
||||
} ExceptionRangeLarge;
|
||||
|
||||
typedef struct ExceptionTableLarge {
|
||||
u16 et_field;
|
||||
u16 et_field2;
|
||||
ExceptionRangeLarge ranges[];
|
||||
} ExceptionTableLarge;
|
||||
|
||||
#define ET_MakeField(savedGPRs, savedFPRs, savedCR, hasframeptr, isLarge) \
|
||||
(((savedGPRs) << 11) | ((savedFPRs & 0x1f) << 6) | ((savedCR & 0x1) << 5) | ((hasframeptr & 0x1) << 4) | ((isLarge & 1) << 3))
|
||||
|
||||
#define ET_GetSavedGPRs(field) ((field) >> 11)
|
||||
#define ET_GetSavedFPRs(field) (((field) >> 6) & 0x1f)
|
||||
#define ET_GetSavedCR(field) (((field) >> 5) & 0x1)
|
||||
#define ET_GetHasFramePtr(field) (((field) >> 4) & 0x1)
|
||||
#define ET_IsLargeTable(field) (((field) >> 3) & 0x1)
|
||||
#define ET_ClearLargeBit(field) ((field) & ~(1 << 3))
|
||||
#define ET_SetLargeBit(field) ((field) | (1 << 3))
|
||||
|
||||
#define ET_HasElfVector(field) (((field) >> 1) & 0x1)
|
||||
|
||||
typedef struct ExceptionTableIndex {
|
||||
u32 functionoffset;
|
||||
u32 eti_field;
|
||||
u32 exceptionoffset;
|
||||
} ExceptionTableIndex;
|
||||
|
||||
#define ETI_MakeField(direct, fsize) ((((s32)(direct)) << 31) | ((fsize)&0x7fffffff))
|
||||
#define ETI_GetDirectStore(field) ((field) >> 31)
|
||||
#define ETI_GetFunctionSize(field) ((field)&0x7fffffff)
|
||||
|
||||
#endif
|
||||
|
|
@ -1,7 +1,15 @@
|
|||
#ifndef _NMWEXCEPTION
|
||||
#define _NMWEXCEPTION
|
||||
|
||||
typedef short vbase_ctor_arg_type;
|
||||
#include "types.h"
|
||||
#include "PowerPC_EABI_Support/Runtime/exception.h"
|
||||
#include "PowerPC_EABI_Support/Runtime/__ppc_eabi_linker.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef s16 vbase_ctor_arg_type;
|
||||
typedef char local_cond_type;
|
||||
|
||||
typedef struct CatchInfo {
|
||||
|
|
@ -9,7 +17,7 @@ typedef struct CatchInfo {
|
|||
void* typeinfo;
|
||||
void* dtor;
|
||||
void* sublocation;
|
||||
long pointercopy;
|
||||
s32 pointercopy;
|
||||
void* stacktop;
|
||||
} CatchInfo;
|
||||
|
||||
|
|
@ -19,18 +27,12 @@ typedef struct DestructorChain {
|
|||
void* object;
|
||||
} DestructorChain;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void* __register_global_object(void* object, void* destructor,
|
||||
void* registration);
|
||||
extern void* __register_global_object(void* object, void* destructor, void* registration);
|
||||
extern void __destroy_global_chain(void);
|
||||
|
||||
extern void __end__catch(CatchInfo* catchinfo);
|
||||
extern void __throw(char* throwtype, void* location, void* dtor);
|
||||
extern char __throw_catch_compare(const char* throwtype, const char* catchtype,
|
||||
long* offset_result);
|
||||
extern char __throw_catch_compare(const char* throwtype, const char* catchtype, s32* offset_result);
|
||||
extern void __unexpected(CatchInfo* catchinfo);
|
||||
|
||||
extern int __register_fragment(struct __eti_init_info* info, char* TOC);
|
||||
|
|
|
|||
38
include/PowerPC_EABI_Support/Runtime/exception.h
Executable file
38
include/PowerPC_EABI_Support/Runtime/exception.h
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
#ifndef _EXCEPTION
|
||||
#define _EXCEPTION
|
||||
|
||||
namespace std {
|
||||
class exception {
|
||||
public:
|
||||
exception() { }
|
||||
virtual ~exception() { }
|
||||
virtual const char* what() const { return "exception"; }
|
||||
};
|
||||
|
||||
class bad_exception : public exception {
|
||||
public:
|
||||
bad_exception() { }
|
||||
virtual ~bad_exception() { }
|
||||
virtual const char* what() const { return "bad_exception"; }
|
||||
};
|
||||
|
||||
typedef void (*unexpected_handler)();
|
||||
unexpected_handler set_unexpected(unexpected_handler handler);
|
||||
void unexpected();
|
||||
|
||||
typedef void (*terminate_handler)();
|
||||
terminate_handler set_terminate(terminate_handler handler);
|
||||
void terminate();
|
||||
|
||||
} // namespace std
|
||||
|
||||
using std::bad_exception;
|
||||
using std::exception;
|
||||
using std::set_terminate;
|
||||
using std::set_unexpected;
|
||||
using std::terminate;
|
||||
using std::terminate_handler;
|
||||
using std::unexpected;
|
||||
using std::unexpected_handler;
|
||||
|
||||
#endif
|
||||
|
|
@ -2,7 +2,6 @@
|
|||
#include "PowerPC_EABI_Support/Msl/MSL_C/MSL_Common/critical_regions.h"
|
||||
#include "PowerPC_EABI_Support/Msl/MSL_C/MSL_Common/signal.h"
|
||||
#include "stddef.h"
|
||||
#include "PowerPC_EABI_Support/Runtime/NMWException.h"
|
||||
|
||||
void _ExitProcess();
|
||||
|
||||
|
|
|
|||
30
src/Runtime.PPCEABI.H/GCN_mem_alloc.c
Executable file
30
src/Runtime.PPCEABI.H/GCN_mem_alloc.c
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#include "dolphin/os.h"
|
||||
|
||||
inline static void InitDefaultHeap(void) {
|
||||
void* arenaLo;
|
||||
void* arenaHi;
|
||||
|
||||
OSReport("GCN_Mem_Alloc.c : InitDefaultHeap. No Heap Available\n");
|
||||
OSReport("Metrowerks CW runtime library initializing default heap\n");
|
||||
|
||||
arenaLo = OSGetArenaLo();
|
||||
arenaHi = OSGetArenaHi();
|
||||
|
||||
arenaLo = OSInitAlloc(arenaLo, arenaHi, 1);
|
||||
OSSetArenaLo(arenaLo);
|
||||
|
||||
arenaLo = OSRoundUpPtr(arenaLo, 0x20);
|
||||
arenaHi = OSRoundDownPtr(arenaHi, 0x20);
|
||||
|
||||
OSSetCurrentHeap(OSCreateHeap(arenaLo, arenaHi));
|
||||
OSSetArenaLo(arenaLo = arenaHi);
|
||||
}
|
||||
|
||||
/* 80362914-803629CC 35D254 00B8+00 0/0 1/1 0/0 .text __sys_free */
|
||||
void __sys_free(void* p) {
|
||||
if (__OSCurrHeap == -1) {
|
||||
InitDefaultHeap();
|
||||
}
|
||||
|
||||
OSFreeToHeap(__OSCurrHeap, p);
|
||||
}
|
||||
1052
src/Runtime.PPCEABI.H/Gecko_ExceptionPPC.cpp
Executable file
1052
src/Runtime.PPCEABI.H/Gecko_ExceptionPPC.cpp
Executable file
File diff suppressed because it is too large
Load diff
157
src/Runtime.PPCEABI.H/NMWException.cpp
Executable file
157
src/Runtime.PPCEABI.H/NMWException.cpp
Executable file
|
|
@ -0,0 +1,157 @@
|
|||
#include "PowerPC_EABI_Support/Runtime/NMWException.h"
|
||||
#include "PowerPC_EABI_Support/Runtime/MWCPlusLib.h"
|
||||
|
||||
#define ARRAY_HEADER_SIZE 16
|
||||
|
||||
extern "C" {
|
||||
extern void abort();
|
||||
}
|
||||
|
||||
namespace std {
|
||||
/**
|
||||
* @note Address: N/A
|
||||
* @note Size: 0x20
|
||||
*/
|
||||
static void dthandler() { abort(); }
|
||||
|
||||
static terminate_handler thandler = dthandler;
|
||||
|
||||
/**
|
||||
* @note Address: N/A
|
||||
* @note Size: 0x28
|
||||
*/
|
||||
static void duhandler() { terminate(); }
|
||||
|
||||
static unexpected_handler uhandler = duhandler;
|
||||
|
||||
/**
|
||||
* @note Address: N/A
|
||||
* @note Size: 0x28
|
||||
*/
|
||||
extern void terminate() { thandler(); }
|
||||
|
||||
/**
|
||||
* @note Address: N/A
|
||||
* @note Size: 0x28
|
||||
*/
|
||||
extern void unexpected() { uhandler(); }
|
||||
} // namespace std
|
||||
|
||||
/**
|
||||
* @note Address: N/A
|
||||
* @note Size: 0x22C
|
||||
*/
|
||||
extern char __throw_catch_compare(const char* throwtype, const char* catchtype, s32* offset_result)
|
||||
{
|
||||
const char *cptr1, *cptr2;
|
||||
|
||||
*offset_result = 0;
|
||||
|
||||
if ((cptr2 = catchtype) == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
cptr1 = throwtype;
|
||||
|
||||
if (*cptr2 == 'P') {
|
||||
cptr2++;
|
||||
if (*cptr2 == 'C')
|
||||
cptr2++;
|
||||
if (*cptr2 == 'V')
|
||||
cptr2++;
|
||||
if (*cptr2 == 'v') {
|
||||
if (*cptr1 == 'P' || *cptr1 == '*') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
cptr2 = catchtype;
|
||||
}
|
||||
|
||||
switch (*cptr1) {
|
||||
case '*':
|
||||
case '!':
|
||||
if (*cptr1++ != *cptr2++)
|
||||
return false;
|
||||
for (;;) {
|
||||
if (*cptr1 == *cptr2++) {
|
||||
if (*cptr1++ == '!') {
|
||||
s32 offset;
|
||||
|
||||
for (offset = 0; *cptr1 != '!';) {
|
||||
offset = offset * 10 + *cptr1++ - '0';
|
||||
}
|
||||
*offset_result = offset;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
while (*cptr1++ != '!') { }
|
||||
while (*cptr1++ != '!') { }
|
||||
if (*cptr1 == 0)
|
||||
return false;
|
||||
|
||||
cptr2 = catchtype + 1;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
while ((*cptr1 == 'P' || *cptr1 == 'R') && *cptr1 == *cptr2) {
|
||||
cptr1++;
|
||||
cptr2++;
|
||||
|
||||
if (*cptr2 == 'C') {
|
||||
if (*cptr1 == 'C')
|
||||
cptr1++;
|
||||
cptr2++;
|
||||
}
|
||||
if (*cptr1 == 'C')
|
||||
return false;
|
||||
|
||||
if (*cptr2 == 'V') {
|
||||
if (*cptr1 == 'V')
|
||||
cptr1++;
|
||||
cptr2++;
|
||||
}
|
||||
if (*cptr1 == 'V')
|
||||
return false;
|
||||
}
|
||||
|
||||
for (; *cptr1 == *cptr2; cptr1++, cptr2++) {
|
||||
if (*cptr1 == 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
class __partial_array_destructor {
|
||||
private:
|
||||
void* p;
|
||||
size_t size;
|
||||
size_t n;
|
||||
ConstructorDestructor dtor;
|
||||
|
||||
public:
|
||||
size_t i;
|
||||
|
||||
__partial_array_destructor(void* array, size_t elementsize, size_t nelements, ConstructorDestructor destructor)
|
||||
{
|
||||
p = array;
|
||||
size = elementsize;
|
||||
n = nelements;
|
||||
dtor = destructor;
|
||||
i = n;
|
||||
}
|
||||
|
||||
~__partial_array_destructor()
|
||||
{
|
||||
char* ptr;
|
||||
|
||||
if (i < n && dtor) {
|
||||
for (ptr = (char*)p + size * i; i > 0; i--) {
|
||||
ptr -= size;
|
||||
DTORCALL_COMPLETE(dtor, ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue