--- trunk/src/devices/dev_px.c 2007/10/08 16:19:23 20 +++ trunk/src/devices/dev_px.c 2007/10/08 16:21:17 34 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2005 Anders Gavare. All rights reserved. + * Copyright (C) 2004-2007 Anders Gavare. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: dev_px.c,v 1.30 2005/11/13 00:14:09 debug Exp $ + * $Id: dev_px.c,v 1.36 2006/12/30 13:30:59 debug Exp $ * * TURBOchannel Pixelstamp graphics device. * @@ -107,7 +107,7 @@ struct px_data *d = extra; if (d->intr & STIC_INT_P_EN) /* or _WE ? */ - cpu_interrupt(cpu, d->irq_nr); + INTERRUPT_ASSERT(d->irq); #endif } @@ -143,7 +143,7 @@ void dev_px_dma(struct cpu *cpu, uint32_t sys_addr, struct px_data *d) { unsigned char dma_buf[32768]; - int dma_len = sizeof(dma_buf); + size_t dma_len = sizeof(dma_buf); int bytesperpixel; uint32_t cmdword; @@ -231,7 +231,7 @@ debug(",HS_EQUALS"); { - int i; + size_t i; for (i=0; ivfb_data->update_x1 = 0; d->vfb_data->update_x2 = PX_XSIZE-1; - if (span_dst < d->vfb_data->update_y1) + if ((int32_t)span_dst < d->vfb_data->update_y1) d->vfb_data->update_y1 = span_dst; - if (span_dst > d->vfb_data->update_y2) + if ((int32_t)span_dst > d->vfb_data->update_y2) d->vfb_data->update_y2 = span_dst; - if (span_src < d->vfb_data->update_y1) + if ((int32_t)span_src < d->vfb_data->update_y1) d->vfb_data->update_y1 = span_src; - if (span_src > d->vfb_data->update_y2) + if ((int32_t)span_src > d->vfb_data->update_y2) d->vfb_data->update_y2 = span_src; } } /* NetBSD and Ultrix erasecols/eraserows */ if (cmdword == 0x411) { - uint32_t v1, v2, lw, attr; + uint32_t v1, v2, attr; + int32_t lw; int x,y,x2,y2; int fb_y; int bg_r, bg_g, bg_b; @@ -560,12 +561,11 @@ /* * dev_px_access(): */ -int dev_px_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, - unsigned char *data, size_t len, int writeflag, void *extra) +DEVICE_ACCESS(px) { uint64_t idata = 0, odata = 0; struct px_data *d = extra; - int i; + size_t i; if (writeflag == MEM_WRITE) idata = memory_readmax64(cpu, data, len); @@ -751,7 +751,7 @@ * dev_px_init(): */ void dev_px_init(struct machine *machine, struct memory *mem, - uint64_t baseaddr, int px_type, int irq_nr) + uint64_t baseaddr, int px_type, char *irq_path) { struct px_data *d; @@ -763,7 +763,8 @@ memset(d, 0, sizeof(struct px_data)); d->type = px_type; - d->irq_nr = irq_nr; + + INTERRUPT_CONNECT(irq_path, d->irq); d->xconfig = d->yconfig = 0; /* 4x1 */ @@ -807,13 +808,13 @@ switch (d->type) { case DEV_PX_TYPE_PX: dev_bt459_init(machine, mem, baseaddr + 0x200000, 0, - d->vfb_data, 8, irq_nr, BT459_PX); + d->vfb_data, 8, irq_path, BT459_PX); break; case DEV_PX_TYPE_PXG: case DEV_PX_TYPE_PXGPLUS: case DEV_PX_TYPE_PXGPLUSTURBO: dev_bt459_init(machine, mem, baseaddr + 0x300000, 0, - d->vfb_data, d->bitdepth, irq_nr, BT459_PX); + d->vfb_data, d->bitdepth, irq_path, BT459_PX); break; default: fatal("dev_px_init(): unimplemented px_type\n"); @@ -821,6 +822,6 @@ memory_device_register(mem, "px", baseaddr, DEV_PX_LENGTH, dev_px_access, d, DM_DEFAULT, NULL); - machine_add_tickfunction(machine, dev_px_tick, d, 14); + machine_add_tickfunction(machine, dev_px_tick, d, 14, 0.0); }