1 |
/* |
/* |
2 |
* Copyright (C) 2004-2005 Anders Gavare. All rights reserved. |
* Copyright (C) 2004-2006 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_px.c,v 1.28 2005/07/19 10:48:06 debug Exp $ |
* $Id: dev_px.c,v 1.33 2006/01/01 13:17:17 debug Exp $ |
29 |
* |
* |
30 |
* TURBOchannel Pixelstamp graphics device. |
* TURBOchannel Pixelstamp graphics device. |
31 |
* |
* |
143 |
void dev_px_dma(struct cpu *cpu, uint32_t sys_addr, struct px_data *d) |
void dev_px_dma(struct cpu *cpu, uint32_t sys_addr, struct px_data *d) |
144 |
{ |
{ |
145 |
unsigned char dma_buf[32768]; |
unsigned char dma_buf[32768]; |
146 |
int dma_len = sizeof(dma_buf); |
size_t dma_len = sizeof(dma_buf); |
147 |
int bytesperpixel; |
int bytesperpixel; |
148 |
uint32_t cmdword; |
uint32_t cmdword; |
149 |
|
|
231 |
debug(",HS_EQUALS"); |
debug(",HS_EQUALS"); |
232 |
|
|
233 |
{ |
{ |
234 |
int i; |
size_t i; |
235 |
for (i=0; i<dma_len; i++) |
for (i=0; i<dma_len; i++) |
236 |
debug(" %02x", dma_buf[i]); |
debug(" %02x", dma_buf[i]); |
237 |
} |
} |
242 |
/* NetBSD and Ultrix copyspans */ |
/* NetBSD and Ultrix copyspans */ |
243 |
if (cmdword == 0x405) { |
if (cmdword == 0x405) { |
244 |
uint32_t nspans, lw; |
uint32_t nspans, lw; |
245 |
int spannr, ofs; |
uint32_t spannr, ofs; |
246 |
uint32_t span_len, span_src, span_dst; |
uint32_t span_len, span_src, span_dst; |
247 |
/* unsigned char pixels[PX_XSIZE * 3]; */ |
/* unsigned char pixels[PX_XSIZE * 3]; */ |
248 |
|
|
328 |
|
|
329 |
d->vfb_data->update_x1 = 0; d->vfb_data->update_x2 = |
d->vfb_data->update_x1 = 0; d->vfb_data->update_x2 = |
330 |
PX_XSIZE-1; |
PX_XSIZE-1; |
331 |
if (span_dst < d->vfb_data->update_y1) |
if ((int32_t)span_dst < d->vfb_data->update_y1) |
332 |
d->vfb_data->update_y1 = span_dst; |
d->vfb_data->update_y1 = span_dst; |
333 |
if (span_dst > d->vfb_data->update_y2) |
if ((int32_t)span_dst > d->vfb_data->update_y2) |
334 |
d->vfb_data->update_y2 = span_dst; |
d->vfb_data->update_y2 = span_dst; |
335 |
if (span_src < d->vfb_data->update_y1) |
if ((int32_t)span_src < d->vfb_data->update_y1) |
336 |
d->vfb_data->update_y1 = span_src; |
d->vfb_data->update_y1 = span_src; |
337 |
if (span_src > d->vfb_data->update_y2) |
if ((int32_t)span_src > d->vfb_data->update_y2) |
338 |
d->vfb_data->update_y2 = span_src; |
d->vfb_data->update_y2 = span_src; |
339 |
} |
} |
340 |
} |
} |
341 |
|
|
342 |
/* NetBSD and Ultrix erasecols/eraserows */ |
/* NetBSD and Ultrix erasecols/eraserows */ |
343 |
if (cmdword == 0x411) { |
if (cmdword == 0x411) { |
344 |
uint32_t v1, v2, lw, attr; |
uint32_t v1, v2, attr; |
345 |
|
int32_t lw; |
346 |
int x,y,x2,y2; |
int x,y,x2,y2; |
347 |
int fb_y; |
int fb_y; |
348 |
int bg_r, bg_g, bg_b; |
int bg_r, bg_g, bg_b; |
561 |
/* |
/* |
562 |
* dev_px_access(): |
* dev_px_access(): |
563 |
*/ |
*/ |
564 |
int dev_px_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, |
DEVICE_ACCESS(px) |
|
unsigned char *data, size_t len, int writeflag, void *extra) |
|
565 |
{ |
{ |
566 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
567 |
struct px_data *d = extra; |
struct px_data *d = extra; |
568 |
int i; |
size_t i; |
569 |
|
|
570 |
idata = memory_readmax64(cpu, data, len); |
if (writeflag == MEM_WRITE) |
571 |
|
idata = memory_readmax64(cpu, data, len); |
572 |
|
|
573 |
if (relative_addr < 0x0c0000) { |
if (relative_addr < 0x0c0000) { |
574 |
/* |
/* |
820 |
} |
} |
821 |
|
|
822 |
memory_device_register(mem, "px", baseaddr, DEV_PX_LENGTH, |
memory_device_register(mem, "px", baseaddr, DEV_PX_LENGTH, |
823 |
dev_px_access, d, MEM_DEFAULT, NULL); |
dev_px_access, d, DM_DEFAULT, NULL); |
824 |
machine_add_tickfunction(machine, dev_px_tick, d, 14); |
machine_add_tickfunction(machine, dev_px_tick, d, 14); |
825 |
} |
} |
826 |
|
|