25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_sgi_gbe.c,v 1.26 2005/08/16 05:37:12 debug Exp $ |
* $Id: dev_sgi_gbe.c,v 1.29 2005/11/13 00:14:09 debug Exp $ |
29 |
* |
* |
30 |
* SGI "gbe", graphics controller. Framebuffer. |
* SGI "gbe", graphics controller. Framebuffer. |
31 |
* Loosely inspired by Linux code. |
* Loosely inspired by Linux code. |
49 |
#define GBE_DEBUG |
#define GBE_DEBUG |
50 |
/* #define debug fatal */ |
/* #define debug fatal */ |
51 |
|
|
52 |
/* #define MTE_TEST */ |
#define MTE_TEST |
53 |
|
|
54 |
#define GBE_DEFAULT_XRES 640 |
#define GBE_DEFAULT_XRES 640 |
55 |
#define GBE_DEFAULT_YRES 480 |
#define GBE_DEFAULT_YRES 480 |
205 |
struct sgi_gbe_data *d = extra; |
struct sgi_gbe_data *d = extra; |
206 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
207 |
|
|
208 |
idata = memory_readmax64(cpu, data, len); |
if (writeflag == MEM_WRITE) |
209 |
|
idata = memory_readmax64(cpu, data, len); |
210 |
|
|
211 |
#ifdef GBE_DEBUG |
#ifdef GBE_DEBUG |
212 |
if (writeflag == MEM_WRITE) |
if (writeflag == MEM_WRITE) |
400 |
exit(1); |
exit(1); |
401 |
} |
} |
402 |
memset(d, 0, sizeof(struct sgi_gbe_data)); |
memset(d, 0, sizeof(struct sgi_gbe_data)); |
403 |
|
|
404 |
|
/* 640x480 for Linux: */ |
405 |
d->xres = GBE_DEFAULT_XRES; |
d->xres = GBE_DEFAULT_XRES; |
406 |
d->yres = GBE_DEFAULT_YRES; |
d->yres = GBE_DEFAULT_YRES; |
407 |
d->bitdepth = 8; |
d->bitdepth = 8; |
|
#if 0 |
|
408 |
d->control = 0x20aa000; /* or 0x00000001? */ |
d->control = 0x20aa000; /* or 0x00000001? */ |
409 |
#endif |
|
410 |
|
/* 1280x1024 for booting the O2's PROM: */ |
411 |
|
d->xres = 1280; d->yres = 1024; |
412 |
|
|
413 |
d->fb_data = dev_fb_init(machine, mem, FAKE_GBE_FB_ADDRESS, |
d->fb_data = dev_fb_init(machine, mem, FAKE_GBE_FB_ADDRESS, |
414 |
VFB_GENERIC, d->xres, d->yres, d->xres, d->yres, 8, "SGI GBE"); |
VFB_GENERIC, d->xres, d->yres, d->xres, d->yres, 8, "SGI GBE"); |
415 |
set_grayscale_palette(d->fb_data, 256); |
set_grayscale_palette(d->fb_data, 256); |
416 |
|
|
417 |
memory_device_register(mem, "sgi_gbe", baseaddr, DEV_SGI_GBE_LENGTH, |
memory_device_register(mem, "sgi_gbe", baseaddr, DEV_SGI_GBE_LENGTH, |
418 |
dev_sgi_gbe_access, d, MEM_DEFAULT, NULL); |
dev_sgi_gbe_access, d, DM_DEFAULT, NULL); |
419 |
machine_add_tickfunction(machine, dev_sgi_gbe_tick, d, 18); |
machine_add_tickfunction(machine, dev_sgi_gbe_tick, d, 18); |
420 |
} |
} |
421 |
|
|