forked from nedwill/soundhax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.h
49 lines (41 loc) · 2.07 KB
/
constants.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* sound constants by nedwill */
#define GARBAGE 0xDEADC0DE
#define REGION_CONST(name, eur, usa, jap) .set name, usa
#define GLOBAL_CONST(name, val) .set name, val
#define PA_TO_GPU_ADDR(pa) ((pa) - 0x0C000000)
#define GPU_TO_PA_ADDR(pa) ((pa) + 0x0C000000)
/* Apparently JAP code is a bit smaller than the other ones, making code.bin
being allocated at a slightly different address. */
REGION_CONST(NEW_VA_TO_PA, 0x27700000, 0x27700000, 0x27800000);
REGION_CONST(OLD_VA_TO_PA, 0x23B00000, 0x23B00000, 0x23C00000);
#if defined(NEW3DS)
#define CODE_VA_TO_PA(va) ((va) + NEW_VA_TO_PA)
#else
#define CODE_VA_TO_PA(va) ((va) + OLD_VA_TO_PA)
#endif
/* FS functions. */
REGION_CONST(FS_MOUNT_SDMC, 0x002CCCF8, 0x002CDA28, 0x002CCA34);
REGION_CONST(FS_OPEN_FILE, 0x0028CC30, 0x0028D220, 0x0028C830);
REGION_CONST(FS_READ_FILE, 0x00115A90, 0x00115B00, 0x00115A80);
/* GSP functions. */
REGION_CONST(GSP_FLUSH_DATA_CACHE, 0x00116AB8, 0x00116B28, 0x00116AA8);
REGION_CONST(GSP_ENQUEUE_CMD, 0x00285994, 0x00285F84, 0x00285594);
REGION_CONST(GSP_GX_CMD4, 0x00116BB8, 0x00116C28, 0x00116BA8);
REGION_CONST(GSP_GET_HANDLE, 0x0028A8F8, 0x0028AEE8, 0x0028A4F8);
REGION_CONST(GSP_GET_INTERRUPTRECEIVER, 0x00287F94, 0x00288584, 0x00287B94);
REGION_CONST(GSP_WRITE_HW_REGS, 0x00110080, 0x001100F0, 0x00110070);
REGION_CONST(GSP_THREAD_OBJ_PTR, 0x00594C40, 0x0051FC40, 0x00480C40);
/* We will overwrite the padding at end of the last code page. This guarantees
that we don't overwrite existing code, and also avoids potential issues
with the instruction cache. */
REGION_CONST(STAGE2_CODE_VA, 0x003AE800, 0x003AF200, 0x003AE400);
GLOBAL_CONST(STAGE2_CODE_PA, CODE_VA_TO_PA(STAGE2_CODE_VA));
GLOBAL_CONST(STAGE2_SIZE, 0x800); // European game limits this size.
GLOBAL_CONST(FREAKYBIN_LOAD_ADDR, 0x14200000);
GLOBAL_CONST(FRAMEBUF_ADDR, 0x14200000);
GLOBAL_CONST(FRAMEBUF_SIZE, (400*240*4));
GLOBAL_CONST(PARAMBLK_ADDR, 0x14000000);
GLOBAL_CONST(OTHERAPP_CODE_VA, 0x00101000);
GLOBAL_CONST(OTHERAPP_CODE_PA, CODE_VA_TO_PA(OTHERAPP_CODE_VA));
GLOBAL_CONST(OTHERAPP_ADDR, 0x142C0000);
GLOBAL_CONST(OTHERAPP_SIZE, 0xC000);