GBC_load_exec.h
1.83 KB
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
#ifndef __gbcp_LOAD_H__
#define __gbcp_LOAD_H__
/*********************************************************************************
* º¯ÊýÀàÐÍ
*********************************************************************************/
typedef int FAppInit(void);
typedef int FAppEntry(char **argv);
typedef int FAppExit(void);
typedef void* FGetAddr (int id);
typedef unsigned int FGetConst (int id, int *e);
#define APP_HEADER_MAGIC 0x3141574D
#define APP_TYPE_NULL 0
#define APP_TYPE_UAPP 1
#define APP_TYPE_TSR 2
typedef struct TTPAppHeader_
{
unsigned int magic;
unsigned int flags;
unsigned int version;
char name[32]; //ucs2±àÂë
unsigned int vendor;
unsigned int time;
unsigned short icon_flags;
unsigned short icon_size;
unsigned int text_size;
unsigned int rw_size;
unsigned int zi_size;
unsigned char sign[8];
}TTPAppHeader;
typedef struct TTPAppInfo_
{
unsigned int flags;
int pid;
struct {
FGetAddr *get_addr;
FGetConst *get_const;
} mw;
struct {
char *saved_sb;
FAppInit *init;
FAppEntry *entry;
FAppExit *exit;
} app;
unsigned int rwzi_size;
char rwzi_data[1];
}TTPAppInfo;
typedef struct TTPAppStruct_
{
unsigned int state; //bitmap
union {
unsigned int data;
struct {
unsigned int exiting : 1;
} bits;
} flags;
int pid;
TTPAppHeader *ah;
TTPAppInfo *ai;
struct TTPAppStruct_ *next;
}TTPAppStruct;
typedef struct TTPLoadStruct_
{
TTPAppStruct *tsr;
TTPAppStruct *uapp;
}TTPLoadStruct;
extern const char gbcp_APP_PATH[];
//----------------------------------------------------------------------------
#endif