50 #define DEV_SGI_MARDIGRAS_LENGTH 0x800000 52 #define MARDIGRAS_FAKE_OFFSET 0x500000000ULL 53 #define MARDIGRAS_DEFAULT_XSIZE 1280 54 #define MARDIGRAS_DEFAULT_YSIZE 1024 56 #define MICROCODE_START 0x50000 57 #define MICROCODE_END 0x55000 83 int i, x, y, r,g,b, len,
addr;
84 unsigned char pixels[3 * 8000];
92 if ((idata & 0x00ffffff00000000ULL) == 0x00185C0400000000ULL) {
93 int color = (idata >> 12) & 0xff;
99 if ((idata & 0x00ffffff00000000ULL) == 0x0018460400000000ULL) {
100 d->
startx = (idata >> 16) & 0xffff;
101 d->
starty = idata & 0xffff;
102 if (d->
startx >= mardigras_xsize)
104 if (d->
starty >= mardigras_ysize)
112 if ((idata & 0x00ffffff00000000ULL) == 0x0018470400000000ULL) {
113 d->
stopx = (idata >> 16) & 0xffff;
114 d->
stopy = idata & 0xffff;
115 if (d->
stopx >= mardigras_xsize)
117 if (d->
stopy >= mardigras_ysize)
123 if (idata == 0x0019100400018000ULL ||
124 idata == 0x0019100400418008ULL) {
130 if (idata == 0x001C130400000018ULL) {
133 case 0x0019100400018000ULL:
145 addr = (mardigras_xsize * (mardigras_ysize -
155 case 0x0019100400418008ULL:
158 fatal(
"[ sgi_mardigras: unknown draw mode ]\n");
164 if ((idata & 0x00ffffff00000000ULL) == 0x001C700400000000ULL) {
165 addr = (mardigras_xsize * (mardigras_ysize - 1 - d->
currenty)
174 if (addr > mardigras_xsize * mardigras_ysize * 3 || addr < 0)
183 if ((idata >> (24 + (7-i))) & 1) {
206 debug(
"mardigras_20400(): 0x%016" PRIx64
"\n", (uint64_t) idata);
212 uint64_t idata = 0, odata = 0;
230 switch (relative_addr) {
237 odata = (2 << 28) | (0xc003 << 12) | (0x2aa << 1);
250 debug(
"[ sgi_mardigras: read from 0x20400? ]\n");
285 debug(
"[ sgi_mardigras: read from 0x%08lx ]\n",
286 (
long)relative_addr);
288 debug(
"[ sgi_mardigras: write to 0x%08lx: 0x%016" PRIx64
289 " ]\n", (
long) relative_addr, (uint64_t) idata);
309 mardigras_xsize, mardigras_ysize,
310 mardigras_xsize, mardigras_ysize, 24,
"SGI MardiGras");
312 fprintf(stderr,
"dev_sgi_mardigras_init(): out of memory\n");
uint64_t memory_readmax64(struct cpu *cpu, unsigned char *buf, int len)
void fatal(const char *fmt,...)
unsigned char microcode_ram[MICROCODE_END - MICROCODE_START]
struct vfb_data * dev_fb_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, int vfb_type, int visible_xsize, int visible_ysize, int xsize, int ysize, int bit_depth, const char *name)
#define MARDIGRAS_FAKE_OFFSET
DEVICE_ACCESS(sgi_mardigras)
void mardigras_20400(struct cpu *cpu, struct sgi_mardigras_data *d, uint64_t idata)
#define CHECK_ALLOCATION(ptr)
#define DEV_SGI_MARDIGRAS_LENGTH
#define MARDIGRAS_DEFAULT_XSIZE
uint64_t palette_reg_select
#define MARDIGRAS_DEFAULT_YSIZE
void memory_writemax64(struct cpu *cpu, unsigned char *buf, int len, uint64_t data)
int dev_fb_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *)
void memory_device_register(struct memory *mem, const char *, uint64_t baseaddr, uint64_t len, int(*f)(struct cpu *, struct memory *, uint64_t, unsigned char *, size_t, int, void *), void *extra, int flags, unsigned char *dyntrans_data)
unsigned char rgb_palette[256 *3]