-
Notifications
You must be signed in to change notification settings - Fork 0
/
csm_exc.c
102 lines (90 loc) · 1.63 KB
/
csm_exc.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Draw Hook //
//csm_exc.c - Çàïðåò ðàáîòû ïàò÷à íà íåêîòîðûõ CSM äëÿ X75
//(c)Dimadze
#include "drawhook.h"
typedef struct{
#ifdef NEWSGOLD
int pid_from;
int msg;
#else
short pid_from;
short msg;
#endif
int submess;
void *data0;
void *data1;
} GBS_MSG;
typedef struct
{
void *first;
void *last;
void (*data_mfree)(void *);
}LLQ;
typedef struct{
void *next;
void *prev;
void /*CSM_DESC*/ *constr;
int id;
int state;
int unk1;
int unk2;
LLQ gui_ll;
} CSM_RAM;
typedef struct{
int (*onMessage)(CSM_RAM*,GBS_MSG*);
void (*onCreate)(CSM_RAM*);
#ifdef NEWSGOLD
int zero1;
int zero2;
int zero3;
int zero4;
#endif
void (*onClose)(CSM_RAM*);
int datasize;
int statesize;
const int *states;
} CSM_DESC;
#ifdef NEWSGOLD
typedef struct{
int id;
CSM_RAM *current_msg_processing_csm;
LLQ csm;
LLQ cmd;
LLQ csm_background;
} CSMQ;
#else
typedef struct{
int id;
CSM_RAM *current_msg_processing_csm;
LLQ csm;
LLQ cmd;
int unk;
int unk1;
void *methods;
int unk2;
void *tmr;
short cepid;
} CSMQ;
#endif
typedef struct{
int under_idle_id;
int idle_id;
CSMQ *csm_q;
} CSMROOT;
#pragma swi_number=0x8106
__swi __arm CSMROOT *CSM_root();
__arm int isCSMException() //CSM = addr CSM of CSMList.txt, 1 = CSM on top
{
asm("PUSH {R1}");
CSM_RAM *csm = CSM_root()->csm_q->csm.last;
CSM_DESC *desc = csm->constr;
if (EXC_CSM_MP == (int)desc || EXC_CSM_ZP == (int)desc)
{
asm("POP {R1}");
return 1;
} else
{
asm("POP {R1}");
return 0;
}
}