1 |
/* |
/* |
2 |
* Copyright (C) 2004-2006 Anders Gavare. All rights reserved. |
* Copyright (C) 2004-2007 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_pmagja.c,v 1.19 2006/01/01 13:17:16 debug Exp $ |
* $Id: dev_pmagja.c,v 1.21 2006/12/30 13:30:58 debug Exp $ |
29 |
* |
* |
30 |
* TURBOchannel PMAG-JA graphics device. |
* TURBOchannel PMAG-JA graphics device. |
31 |
* |
* |
50 |
/* #define JA_DEBUG */ |
/* #define JA_DEBUG */ |
51 |
|
|
52 |
struct pmagja_data { |
struct pmagja_data { |
53 |
int irq_nr; |
struct interrupt irq; |
54 |
struct memory *fb_mem; |
struct memory *fb_mem; |
55 |
struct vfb_data *vfb_data; |
struct vfb_data *vfb_data; |
56 |
|
|
57 |
unsigned char pixeldata[XSIZE * YSIZE]; |
unsigned char pixeldata[XSIZE * YSIZE]; |
58 |
|
|
59 |
int current_r; |
int current_r; |
60 |
int current_g; |
int current_g; |
61 |
int current_b; |
int current_b; |
62 |
|
|
63 |
int pip_offset; |
int pip_offset; |
64 |
}; |
}; |
65 |
|
|
66 |
|
|
202 |
* dev_pmagja_init(): |
* dev_pmagja_init(): |
203 |
*/ |
*/ |
204 |
void dev_pmagja_init(struct machine *machine, struct memory *mem, |
void dev_pmagja_init(struct machine *machine, struct memory *mem, |
205 |
uint64_t baseaddr, int irq_nr) |
uint64_t baseaddr, char *irq_path) |
206 |
{ |
{ |
207 |
struct pmagja_data *d; |
struct pmagja_data *d; |
208 |
|
|
213 |
} |
} |
214 |
memset(d, 0, sizeof(struct pmagja_data)); |
memset(d, 0, sizeof(struct pmagja_data)); |
215 |
|
|
216 |
d->irq_nr = irq_nr; |
INTERRUPT_CONNECT(irq_path, d->irq); |
217 |
|
|
218 |
d->fb_mem = memory_new(XSIZE * YSIZE * 3, machine->arch); |
d->fb_mem = memory_new(XSIZE * YSIZE * 3, machine->arch); |
219 |
if (d->fb_mem == NULL) { |
if (d->fb_mem == NULL) { |
229 |
|
|
230 |
/* TODO: not bt459, but a bt463: */ |
/* TODO: not bt459, but a bt463: */ |
231 |
dev_bt459_init(machine, mem, baseaddr + 0x40000, 0, d->vfb_data, 8, |
dev_bt459_init(machine, mem, baseaddr + 0x40000, 0, d->vfb_data, 8, |
232 |
irq_nr, 0); /* palette (TODO: type) */ |
irq_path, 0); /* palette (TODO: type) */ |
233 |
dev_bt431_init(mem, baseaddr + 0x40010, d->vfb_data, 8); /* cursor */ |
dev_bt431_init(mem, baseaddr + 0x40010, d->vfb_data, 8); /* cursor */ |
234 |
|
|
235 |
memory_device_register(mem, "pmagja", baseaddr + PMAGJA_FIRSTOFFSET, |
memory_device_register(mem, "pmagja", baseaddr + PMAGJA_FIRSTOFFSET, |