25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_dreamcast_g2.c,v 1.4 2007/02/03 20:14:23 debug Exp $ |
* $Id: dev_dreamcast_g2.c,v 1.5 2007/06/15 19:11:15 debug Exp $ |
29 |
* |
* |
30 |
* Dreamcast G2 bus. |
* COMMENT: Dreamcast G2 bus |
31 |
* |
* |
32 |
* Register offsets are from KOS, NetBSD sources, etc. |
* Register offsets are from KOS, NetBSD sources, etc. |
33 |
* |
* |
93 |
|
|
94 |
DEVICE_ACCESS(dreamcast_g2) |
DEVICE_ACCESS(dreamcast_g2) |
95 |
{ |
{ |
96 |
struct dreamcast_g2_data *d = (struct dreamcast_g2_data *) extra; |
struct dreamcast_g2_data *d = extra; |
97 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
98 |
|
|
99 |
if (writeflag == MEM_WRITE) |
if (writeflag == MEM_WRITE) |
155 |
|
|
156 |
DEVICE_ACCESS(dreamcast_g2_extdma) |
DEVICE_ACCESS(dreamcast_g2_extdma) |
157 |
{ |
{ |
158 |
struct dreamcast_g2_data *d = (struct dreamcast_g2_data *) extra; |
struct dreamcast_g2_data *d = extra; |
159 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
160 |
int reg = relative_addr, channel = 0; |
int reg = relative_addr, channel = 0; |
161 |
|
|
214 |
|
|
215 |
DEVICE_ACCESS(dreamcast_g2_unknown) |
DEVICE_ACCESS(dreamcast_g2_unknown) |
216 |
{ |
{ |
217 |
struct dreamcast_g2_data *d = (struct dreamcast_g2_data *) extra; |
struct dreamcast_g2_data *d = extra; |
218 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
219 |
|
|
220 |
if (writeflag == MEM_WRITE) |
if (writeflag == MEM_WRITE) |
274 |
DEVINIT(dreamcast_g2) |
DEVINIT(dreamcast_g2) |
275 |
{ |
{ |
276 |
struct machine *machine = devinit->machine; |
struct machine *machine = devinit->machine; |
277 |
struct dreamcast_g2_data *d = malloc(sizeof(struct dreamcast_g2_data)); |
struct dreamcast_g2_data *d; |
278 |
if (d == NULL) { |
|
279 |
fprintf(stderr, "out of memory\n"); |
CHECK_ALLOCATION(d = malloc(sizeof(struct dreamcast_g2_data))); |
|
exit(1); |
|
|
} |
|
280 |
memset(d, 0, sizeof(struct dreamcast_g2_data)); |
memset(d, 0, sizeof(struct dreamcast_g2_data)); |
281 |
|
|
282 |
memory_device_register(machine->memory, devinit->name, |
memory_device_register(machine->memory, devinit->name, |