- Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathheffalumpStatics.h
35 lines (23 loc) · 724 Bytes
/
heffalumpStatics.h
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
#ifndefHEFFLUMP_STATICS_H_
#defineHEFFLUMP_STATICS_H_
//globals (8 slots maximum, each stores a void*, zero-inited at app start)
#defineNUM_GLOBALS_SLOTS 8
register void**a5 asm("a5");
staticinlinevoid**globalsSlotPtr(UInt8slotID) //[0] is reserved
{
if (!slotID||slotID>NUM_GLOBALS_SLOTS)
returnNULL;
returna5+slotID;
}
staticinlinevoid*globalsSlotVal(UInt8slotID) //[0] is reserved
{
if (!slotID||slotID>NUM_GLOBALS_SLOTS)
returnNULL;
returna5[slotID];
}
#defineGLOBALS_SLOT_SHARED_VARS 1
#defineGLOBALS_SLOT_PREFS 2
#defineGLOBALS_SLOT_AUTHOR_DB 3
#defineGLOBALS_SLOT_CONTENT_DB 4
#defineGLOBALS_SLOT_WRITES_DB 5
#endif