annotate src/xsf/desmume/MMU.h @ 3200:8da9787de69d

alsa-ng: More paranoid debugging.
author John Lindgren <john.lindgren@tds.net>
date Tue, 11 Aug 2009 10:34:26 -0400
parents 70b0973e7b70
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2961
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1 /* Copyright (C) 2006 yopyop
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
2 yopyop156@ifrance.com
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
3 yopyop156.ifrance.com
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
4
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
5 Copyright (C) 2007 shash
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
6
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
7 This file is part of DeSmuME
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
8
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
9 DeSmuME is free software; you can redistribute it and/or modify
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
10 it under the terms of the GNU General Public License as published by
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
11 the Free Software Foundation; either version 2 of the License, or
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
12 (at your option) any later version.
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
13
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
14 DeSmuME is distributed in the hope that it will be useful,
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
17 GNU General Public License for more details.
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
18
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
20 along with DeSmuME; if not, write to the Free Software
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
22 */
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
23
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
24 #ifndef MMU_H
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
25 #define MMU_H
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
26
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
27 #include "FIFO.h"
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
28 #include "dscard.h"
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
29
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
30 #include "ARM9.h"
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
31 #include "mc.h"
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
32
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
33 #ifdef __cplusplus
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
34 extern "C" {
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
35 #endif
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
36
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
37 extern char szRomPath[512];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
38 extern char szRomBaseName[512];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
39
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
40 /* theses macros are designed for reading/writing in memory (m is a pointer to memory, like MMU.MMU_MEM[proc], and a is an adress, like 0x04000000 */
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
41 #define MEM_8(m, a) (((u8*)(m[((a)>>20)&0xff]))[((a)&0xfff)])
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
42
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
43 /* theses ones for reading in rom data */
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
44 #define ROM_8(m, a) (((u8*)(m))[(a)])
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
45
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
46 #define IPCFIFO 0
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
47 #define MAIN_MEMORY_DISP_FIFO 2
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
48
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
49 typedef struct {
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
50 //ARM7 mem
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
51 u8 ARM7_BIOS[0x4000];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
52 u8 ARM7_ERAM[0x10000];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
53 u8 ARM7_REG[0x10000];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
54 u8 ARM7_WIRAM[0x10000];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
55
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
56 u8 vram_mode[9];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
57 u8 vScreen;
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
58
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
59 //Shared ram
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
60 u8 SWIRAM[0x8000];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
61
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
62 //Card rom & ram
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
63 u8 * CART_ROM;
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
64 u8 CART_RAM[0x10000];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
65
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
66 //Unused ram
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
67 u8 UNUSED_RAM[4];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
68
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
69 u8 * * MMU_MEM[2];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
70 u32 * MMU_MASK[2];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
71
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
72 u8 ARM9_RW_MODE;
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
73
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
74 FIFO fifos[16];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
75
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
76 u32 * MMU_WAIT16[2];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
77 u32 * MMU_WAIT32[2];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
78
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
79 u32 DTCMRegion;
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
80 u32 ITCMRegion;
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
81
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
82 u16 timer[2][4];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
83 s32 timerMODE[2][4];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
84 u32 timerON[2][4];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
85 u32 timerRUN[2][4];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
86 u16 timerReload[2][4];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
87
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
88 u32 reg_IME[2];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
89 u32 reg_IE[2];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
90 u32 reg_IF[2];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
91
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
92 u32 DMAStartTime[2][4];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
93 s32 DMACycle[2][4];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
94 u32 DMACrt[2][4];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
95 BOOL DMAing[2][4];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
96
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
97 memory_chip_t fw;
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
98 memory_chip_t bupmem;
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
99
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
100 nds_dscard dscard[2];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
101
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
102 } MMU_struct;
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
103
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
104 extern MMU_struct MMU;
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
105
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
106
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
107 struct armcpu_memory_iface {
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
108 /** the 32 bit instruction prefetch */
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
109 u32 FASTCALL (*prefetch32)( void *data, u32 adr);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
110
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
111 /** the 16 bit instruction prefetch */
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
112 u16 FASTCALL (*prefetch16)( void *data, u32 adr);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
113
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
114 /** read 8 bit data value */
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
115 u8 FASTCALL (*read8)( void *data, u32 adr);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
116 /** read 16 bit data value */
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
117 u16 FASTCALL (*read16)( void *data, u32 adr);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
118 /** read 32 bit data value */
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
119 u32 FASTCALL (*read32)( void *data, u32 adr);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
120
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
121 /** write 8 bit data value */
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
122 void FASTCALL (*write8)( void *data, u32 adr, u8 val);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
123 /** write 16 bit data value */
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
124 void FASTCALL (*write16)( void *data, u32 adr, u16 val);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
125 /** write 32 bit data value */
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
126 void FASTCALL (*write32)( void *data, u32 adr, u32 val);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
127
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
128 void *data;
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
129 };
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
130
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
131
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
132
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
133 static void mmu_select_savetype(int type, int *bmemtype, u32 *bmemsize) {
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
134 if (type<0 || type > 5) return;
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
135 *bmemtype=save_types[type][0];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
136 *bmemsize=save_types[type][1];
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
137 mc_realloc(&MMU.bupmem, *bmemtype, *bmemsize);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
138 }
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
139
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
140 void MMU_Init(void);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
141 void MMU_DeInit(void);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
142
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
143 void MMU_clearMem( void);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
144
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
145 void MMU_setRom(u8 * rom, u32 mask);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
146 void MMU_unsetRom( void);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
147
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
148
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
149 /**
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
150 * Memory reading
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
151 */
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
152 u8 FASTCALL MMU_read8(u32 proc, u32 adr);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
153 u16 FASTCALL MMU_read16(u32 proc, u32 adr);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
154 u32 FASTCALL MMU_read32(u32 proc, u32 adr);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
155
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
156 #ifdef MMU_ENABLE_ACL
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
157 u8 FASTCALL MMU_read8_acl(u32 proc, u32 adr, u32 access);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
158 u16 FASTCALL MMU_read16_acl(u32 proc, u32 adr, u32 access);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
159 u32 FASTCALL MMU_read32_acl(u32 proc, u32 adr, u32 access);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
160 #else
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
161 #define MMU_read8_acl(proc,adr,access) MMU_read8(proc,adr)
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
162 #define MMU_read16_acl(proc,adr,access) MMU_read16(proc,adr)
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
163 #define MMU_read32_acl(proc,adr,access) MMU_read32(proc,adr)
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
164 #endif
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
165
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
166 /**
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
167 * Memory writing
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
168 */
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
169 void FASTCALL MMU_write8(u32 proc, u32 adr, u8 val);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
170 void FASTCALL MMU_write16(u32 proc, u32 adr, u16 val);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
171 void FASTCALL MMU_write32(u32 proc, u32 adr, u32 val);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
172
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
173 #ifdef MMU_ENABLE_ACL
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
174 void FASTCALL MMU_write8_acl(u32 proc, u32 adr, u8 val);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
175 void FASTCALL MMU_write16_acl(u32 proc, u32 adr, u16 val);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
176 void FASTCALL MMU_write32_acl(u32 proc, u32 adr, u32 val);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
177 #else
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
178 #define MMU_write8_acl MMU_write8
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
179 #define MMU_write16_acl MMU_write16
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
180 #define MMU_write32_acl MMU_write32
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
181 #endif
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
182
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
183 void FASTCALL MMU_doDMA(u32 proc, u32 num);
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
184
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
185
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
186 /*
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
187 * The base ARM memory interfaces
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
188 */
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
189 extern struct armcpu_memory_iface arm9_base_memory_iface;
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
190 extern struct armcpu_memory_iface arm7_base_memory_iface;
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
191 extern struct armcpu_memory_iface arm9_direct_memory_iface;
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
192
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
193
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
194 #ifdef __cplusplus
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
195 }
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
196 #endif
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
197
70b0973e7b70 Merge xsf plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
198 #endif