23 |
|
typedef uae_u32 (REGPARAM2 *mem_get_func)(uaecptr) REGPARAM; |
24 |
|
typedef void (REGPARAM2 *mem_put_func)(uaecptr, uae_u32) REGPARAM; |
25 |
|
typedef uae_u8 *(REGPARAM2 *xlate_func)(uaecptr) REGPARAM; |
26 |
– |
typedef int (REGPARAM2 *check_func)(uaecptr, uae_u32) REGPARAM; |
26 |
|
|
27 |
|
#undef DIRECT_MEMFUNCS_SUCCESSFUL |
28 |
|
|
43 |
|
* This doesn't work for all memory banks, so this function may call |
44 |
|
* abort(). */ |
45 |
|
xlate_func xlateaddr; |
47 |
– |
/* To prevent calls to abort(), use check before calling xlateaddr. |
48 |
– |
* It checks not only that the memory bank can do xlateaddr, but also |
49 |
– |
* that the pointer points to an area of at least the specified size. |
50 |
– |
* This is used for example to translate bitplane pointers in custom.c */ |
51 |
– |
check_func check; |
46 |
|
} addrbank; |
47 |
|
|
48 |
|
extern uae_u8 filesysory[65536]; |
53 |
|
|
54 |
|
/* Default memory access functions */ |
55 |
|
|
62 |
– |
extern int REGPARAM2 default_check(uaecptr addr, uae_u32 size) REGPARAM; |
56 |
|
extern uae_u8 *REGPARAM2 default_xlate(uaecptr addr) REGPARAM; |
57 |
|
|
58 |
|
#define bankindex(addr) (((uaecptr)(addr)) >> 16) |
157 |
|
{ |
158 |
|
return do_get_virtual_address(addr); |
159 |
|
} |
167 |
– |
static __inline__ int valid_address(uaecptr addr, uae_u32 size) |
168 |
– |
{ |
169 |
– |
return 1; |
170 |
– |
} |
160 |
|
#else |
161 |
|
static __inline__ uae_u32 get_long(uaecptr addr) |
162 |
|
{ |
188 |
|
} |
189 |
|
/* gb-- deliberately not implemented since it shall not be used... */ |
190 |
|
extern uae_u32 get_virtual_address(uae_u8 *addr); |
202 |
– |
static __inline__ int valid_address(uaecptr addr, uae_u32 size) |
203 |
– |
{ |
204 |
– |
return get_mem_bank(addr).check(addr, size); |
205 |
– |
} |
191 |
|
#endif /* DIRECT_ADDRESSING || REAL_ADDRESSING */ |
192 |
|
|
193 |
|
#endif /* MEMORY_H */ |