25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_sgi_gbe.c,v 1.35 2006/12/30 13:30:59 debug Exp $ |
* $Id: dev_sgi_gbe.c,v 1.37 2007/06/15 19:57:34 debug Exp $ |
29 |
|
* |
30 |
|
* COMMENT: SGI "gbe", graphics controller + framebuffer |
31 |
* |
* |
|
* SGI "gbe", graphics controller. Framebuffer. |
|
32 |
* Loosely inspired by Linux code. |
* Loosely inspired by Linux code. |
33 |
*/ |
*/ |
34 |
|
|
84 |
* These numbers (when << 16 bits) are pointers to the tiles. Tiles are |
* These numbers (when << 16 bits) are pointers to the tiles. Tiles are |
85 |
* 512x128 in 8-bit mode, 256x128 in 16-bit mode, and 128x128 in 32-bit mode. |
* 512x128 in 8-bit mode, 256x128 in 16-bit mode, and 128x128 in 32-bit mode. |
86 |
*/ |
*/ |
87 |
void dev_sgi_gbe_tick(struct cpu *cpu, void *extra) |
DEVICE_TICK(sgi_gbe) |
88 |
{ |
{ |
89 |
struct sgi_gbe_data *d = extra; |
struct sgi_gbe_data *d = extra; |
90 |
int tile_nr = 0, on_screen = 1, xbase = 0, ybase = 0; |
int tile_nr = 0, on_screen = 1, xbase = 0, ybase = 0; |
205 |
} |
} |
206 |
|
|
207 |
|
|
|
/* |
|
|
* dev_sgi_gbe_access(): |
|
|
*/ |
|
208 |
DEVICE_ACCESS(sgi_gbe) |
DEVICE_ACCESS(sgi_gbe) |
209 |
{ |
{ |
210 |
struct sgi_gbe_data *d = extra; |
struct sgi_gbe_data *d = extra; |
411 |
} |
} |
412 |
|
|
413 |
|
|
|
/* |
|
|
* dev_sgi_gbe_init(): |
|
|
*/ |
|
414 |
void dev_sgi_gbe_init(struct machine *machine, struct memory *mem, |
void dev_sgi_gbe_init(struct machine *machine, struct memory *mem, |
415 |
uint64_t baseaddr) |
uint64_t baseaddr) |
416 |
{ |
{ |
417 |
struct sgi_gbe_data *d; |
struct sgi_gbe_data *d; |
418 |
|
|
419 |
d = malloc(sizeof(struct sgi_gbe_data)); |
CHECK_ALLOCATION(d = malloc(sizeof(struct sgi_gbe_data))); |
|
if (d == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
420 |
memset(d, 0, sizeof(struct sgi_gbe_data)); |
memset(d, 0, sizeof(struct sgi_gbe_data)); |
421 |
|
|
422 |
/* 640x480 for Linux: */ |
/* 640x480 for Linux: */ |
434 |
|
|
435 |
memory_device_register(mem, "sgi_gbe", baseaddr, DEV_SGI_GBE_LENGTH, |
memory_device_register(mem, "sgi_gbe", baseaddr, DEV_SGI_GBE_LENGTH, |
436 |
dev_sgi_gbe_access, d, DM_DEFAULT, NULL); |
dev_sgi_gbe_access, d, DM_DEFAULT, NULL); |
437 |
machine_add_tickfunction(machine, dev_sgi_gbe_tick, d, 18, 0.0); |
machine_add_tickfunction(machine, dev_sgi_gbe_tick, d, 18); |
438 |
} |
} |
439 |
|
|