Converted voodoo into a proper device.

Updated drivers accordingly.
This commit is contained in:
Aaron Giles 2008-06-23 01:28:05 +00:00
parent 167df11887
commit 0dc00ab33f
12 changed files with 881 additions and 916 deletions

View File

@ -31,7 +31,7 @@ struct _ide_config
/***************************************************************************
TIMER DEVICE CONFIGURATION MACROS
DEVICE CONFIGURATION MACROS
***************************************************************************/
#define MDRV_IDE_CONTROLLER_ADD(_tag, _disknum, _callback) \
@ -68,7 +68,7 @@ READ16_DEVICE_HANDLER( ide_controller16_r );
WRITE16_DEVICE_HANDLER( ide_controller16_w );
/* ----- timer device interface ----- */
/* ----- device interface ----- */
/* device get info callback */
#define IDE_CONTROLLER DEVICE_GET_INFO_NAME(ide_controller)

View File

@ -1340,9 +1340,9 @@ typedef struct _rgba rgba;
struct _rgba
{
#ifdef LSB_FIRST
UINT8 b, g, r, a;
UINT8 b, g, r, a;
#else
UINT8 a, r, g, b;
UINT8 a, r, g, b;
#endif
};
@ -1350,10 +1350,10 @@ struct _rgba
typedef union _voodoo_reg voodoo_reg;
union _voodoo_reg
{
INT32 i;
UINT32 u;
float f;
rgba rgb;
INT32 i;
UINT32 u;
float f;
rgba rgb;
};
@ -1363,26 +1363,26 @@ typedef voodoo_reg rgb_union;
typedef struct _voodoo_stats voodoo_stats;
struct _voodoo_stats
{
UINT8 lastkey; /* last key state */
UINT8 display; /* display stats? */
INT32 swaps; /* total swaps */
INT32 stalls; /* total stalls */
INT32 total_triangles; /* total triangles */
INT32 total_pixels_in; /* total pixels in */
INT32 total_pixels_out; /* total pixels out */
INT32 total_chroma_fail; /* total chroma fail */
INT32 total_zfunc_fail; /* total z func fail */
INT32 total_afunc_fail; /* total a func fail */
INT32 total_clipped; /* total clipped */
INT32 total_stippled; /* total stippled */
INT32 lfb_writes; /* LFB writes */
INT32 lfb_reads; /* LFB reads */
INT32 reg_writes; /* register writes */
INT32 reg_reads; /* register reads */
INT32 tex_writes; /* texture writes */
INT32 texture_mode[16]; /* 16 different texture modes */
UINT8 render_override; /* render override */
char buffer[1024]; /* string */
UINT8 lastkey; /* last key state */
UINT8 display; /* display stats? */
INT32 swaps; /* total swaps */
INT32 stalls; /* total stalls */
INT32 total_triangles; /* total triangles */
INT32 total_pixels_in; /* total pixels in */
INT32 total_pixels_out; /* total pixels out */
INT32 total_chroma_fail; /* total chroma fail */
INT32 total_zfunc_fail; /* total z func fail */
INT32 total_afunc_fail; /* total a func fail */
INT32 total_clipped; /* total clipped */
INT32 total_stippled; /* total stippled */
INT32 lfb_writes; /* LFB writes */
INT32 lfb_reads; /* LFB reads */
INT32 reg_writes; /* register writes */
INT32 reg_reads; /* register reads */
INT32 tex_writes; /* texture writes */
INT32 texture_mode[16]; /* 16 different texture modes */
UINT8 render_override; /* render override */
char buffer[1024]; /* string */
};
@ -1390,319 +1390,320 @@ struct _voodoo_stats
typedef struct _stats_block stats_block;
struct _stats_block
{
INT32 pixels_in; /* pixels in statistic */
INT32 pixels_out; /* pixels out statistic */
INT32 chroma_fail; /* chroma test fail statistic */
INT32 zfunc_fail; /* z function test fail statistic */
INT32 afunc_fail; /* alpha function test fail statistic */
INT32 clip_fail; /* clipping fail statistic */
INT32 stipple_count; /* stipple statistic */
INT32 filler[64/4 - 7]; /* pad this structure to 64 bytes */
INT32 pixels_in; /* pixels in statistic */
INT32 pixels_out; /* pixels out statistic */
INT32 chroma_fail; /* chroma test fail statistic */
INT32 zfunc_fail; /* z function test fail statistic */
INT32 afunc_fail; /* alpha function test fail statistic */
INT32 clip_fail; /* clipping fail statistic */
INT32 stipple_count; /* stipple statistic */
INT32 filler[64/4 - 7]; /* pad this structure to 64 bytes */
};
typedef struct _fifo_state fifo_state;
struct _fifo_state
{
UINT32 * base; /* base of the FIFO */
INT32 size; /* size of the FIFO */
INT32 in; /* input pointer */
INT32 out; /* output pointer */
UINT32 * base; /* base of the FIFO */
INT32 size; /* size of the FIFO */
INT32 in; /* input pointer */
INT32 out; /* output pointer */
};
typedef struct _cmdfifo_info cmdfifo_info;
struct _cmdfifo_info
{
UINT8 enable; /* enabled? */
UINT8 count_holes; /* count holes? */
UINT32 base; /* base address in framebuffer RAM */
UINT32 end; /* end address in framebuffer RAM */
UINT32 rdptr; /* current read pointer */
UINT32 amin; /* minimum address */
UINT32 amax; /* maximum address */
UINT32 depth; /* current depth */
UINT32 holes; /* number of holes */
UINT8 enable; /* enabled? */
UINT8 count_holes; /* count holes? */
UINT32 base; /* base address in framebuffer RAM */
UINT32 end; /* end address in framebuffer RAM */
UINT32 rdptr; /* current read pointer */
UINT32 amin; /* minimum address */
UINT32 amax; /* maximum address */
UINT32 depth; /* current depth */
UINT32 holes; /* number of holes */
};
typedef struct _pci_state pci_state;
struct _pci_state
{
fifo_state fifo; /* PCI FIFO */
UINT32 init_enable; /* initEnable value */
UINT8 stall_state; /* state of the system if we're stalled */
void (*stall_callback)(running_machine *, int); /* callback for stalling/unstalling */
UINT8 op_pending; /* true if an operation is pending */
attotime op_end_time; /* time when the pending operation ends */
emu_timer *continue_timer; /* timer to use to continue processing */
UINT32 fifo_mem[64*2]; /* memory backing the PCI FIFO */
fifo_state fifo; /* PCI FIFO */
UINT32 init_enable; /* initEnable value */
UINT8 stall_state; /* state of the system if we're stalled */
voodoo_stall_func stall_callback; /* callback for stalling/unstalling */
UINT8 op_pending; /* true if an operation is pending */
attotime op_end_time; /* time when the pending operation ends */
emu_timer * continue_timer; /* timer to use to continue processing */
UINT32 fifo_mem[64*2]; /* memory backing the PCI FIFO */
};
typedef struct _ncc_table ncc_table;
struct _ncc_table
{
UINT8 dirty; /* is the texel lookup dirty? */
voodoo_reg *reg; /* pointer to our registers */
INT32 ir[4], ig[4], ib[4]; /* I values for R,G,B */
INT32 qr[4], qg[4], qb[4]; /* Q values for R,G,B */
INT32 y[16]; /* Y values */
rgb_t * palette; /* pointer to associated RGB palette */
rgb_t * palettea; /* pointer to associated ARGB palette */
rgb_t texel[256]; /* texel lookup */
UINT8 dirty; /* is the texel lookup dirty? */
voodoo_reg * reg; /* pointer to our registers */
INT32 ir[4], ig[4], ib[4]; /* I values for R,G,B */
INT32 qr[4], qg[4], qb[4]; /* Q values for R,G,B */
INT32 y[16]; /* Y values */
rgb_t * palette; /* pointer to associated RGB palette */
rgb_t * palettea; /* pointer to associated ARGB palette */
rgb_t texel[256]; /* texel lookup */
};
typedef struct _tmu_state tmu_state;
struct _tmu_state
{
UINT8 * ram; /* pointer to our RAM */
UINT32 mask; /* mask to apply to pointers */
voodoo_reg *reg; /* pointer to our register base */
UINT32 regdirty; /* true if the LOD/mode/base registers have changed */
UINT8 * ram; /* pointer to our RAM */
UINT32 mask; /* mask to apply to pointers */
voodoo_reg * reg; /* pointer to our register base */
UINT32 regdirty; /* true if the LOD/mode/base registers have changed */
UINT32 texaddr_mask; /* mask for texture address */
UINT8 texaddr_shift; /* shift for texture address */
UINT32 texaddr_mask; /* mask for texture address */
UINT8 texaddr_shift; /* shift for texture address */
INT64 starts, startt; /* starting S,T (14.18) */
INT64 startw; /* starting W (2.30) */
INT64 dsdx, dtdx; /* delta S,T per X */
INT64 dwdx; /* delta W per X */
INT64 dsdy, dtdy; /* delta S,T per Y */
INT64 dwdy; /* delta W per Y */
INT64 starts, startt; /* starting S,T (14.18) */
INT64 startw; /* starting W (2.30) */
INT64 dsdx, dtdx; /* delta S,T per X */
INT64 dwdx; /* delta W per X */
INT64 dsdy, dtdy; /* delta S,T per Y */
INT64 dwdy; /* delta W per Y */
INT32 lodmin, lodmax; /* min, max LOD values */
INT32 lodbias; /* LOD bias */
UINT32 lodmask; /* mask of available LODs */
UINT32 lodoffset[9]; /* offset of texture base for each LOD */
INT32 detailmax; /* detail clamp */
INT32 detailbias; /* detail bias */
UINT8 detailscale; /* detail scale */
INT32 lodmin, lodmax; /* min, max LOD values */
INT32 lodbias; /* LOD bias */
UINT32 lodmask; /* mask of available LODs */
UINT32 lodoffset[9]; /* offset of texture base for each LOD */
INT32 detailmax; /* detail clamp */
INT32 detailbias; /* detail bias */
UINT8 detailscale; /* detail scale */
UINT32 wmask; /* mask for the current texture width */
UINT32 hmask; /* mask for the current texture height */
UINT32 wmask; /* mask for the current texture width */
UINT32 hmask; /* mask for the current texture height */
UINT32 bilinear_mask; /* mask for bilinear resolution (0xf0 for V1, 0xff for V2) */
UINT32 bilinear_mask; /* mask for bilinear resolution (0xf0 for V1, 0xff for V2) */
ncc_table ncc[2]; /* two NCC tables */
ncc_table ncc[2]; /* two NCC tables */
rgb_t * lookup; /* currently selected lookup */
rgb_t * texel[16]; /* texel lookups for each format */
rgb_t * lookup; /* currently selected lookup */
rgb_t * texel[16]; /* texel lookups for each format */
rgb_t palette[256]; /* palette lookup table */
rgb_t palettea[256]; /* palette+alpha lookup table */
rgb_t palette[256]; /* palette lookup table */
rgb_t palettea[256]; /* palette+alpha lookup table */
};
typedef struct _tmu_shared_state tmu_shared_state;
struct _tmu_shared_state
{
rgb_t rgb332[256]; /* RGB 3-3-2 lookup table */
rgb_t alpha8[256]; /* alpha 8-bit lookup table */
rgb_t int8[256]; /* intensity 8-bit lookup table */
rgb_t ai44[256]; /* alpha, intensity 4-4 lookup table */
rgb_t rgb332[256]; /* RGB 3-3-2 lookup table */
rgb_t alpha8[256]; /* alpha 8-bit lookup table */
rgb_t int8[256]; /* intensity 8-bit lookup table */
rgb_t ai44[256]; /* alpha, intensity 4-4 lookup table */
rgb_t rgb565[65536]; /* RGB 5-6-5 lookup table */
rgb_t argb1555[65536]; /* ARGB 1-5-5-5 lookup table */
rgb_t argb4444[65536]; /* ARGB 4-4-4-4 lookup table */
rgb_t rgb565[65536]; /* RGB 5-6-5 lookup table */
rgb_t argb1555[65536]; /* ARGB 1-5-5-5 lookup table */
rgb_t argb4444[65536]; /* ARGB 4-4-4-4 lookup table */
};
typedef struct _setup_vertex setup_vertex;
struct _setup_vertex
{
float x, y; /* X, Y coordinates */
float a, r, g, b; /* A, R, G, B values */
float z, wb; /* Z and broadcast W values */
float w0, s0, t0; /* W, S, T for TMU 0 */
float w1, s1, t1; /* W, S, T for TMU 1 */
float x, y; /* X, Y coordinates */
float a, r, g, b; /* A, R, G, B values */
float z, wb; /* Z and broadcast W values */
float w0, s0, t0; /* W, S, T for TMU 0 */
float w1, s1, t1; /* W, S, T for TMU 1 */
};
typedef struct _fbi_state fbi_state;
struct _fbi_state
{
void * ram; /* pointer to frame buffer RAM */
UINT32 mask; /* mask to apply to pointers */
UINT16 * rgb[3]; /* pointer to 3 RGB buffers */
UINT16 * aux; /* pointer to 1 aux buffer */
UINT32 rgbmax[3]; /* maximum valid offset in each RGB buffer */
UINT32 auxmax; /* maximum valid offset in the aux buffer */
void * ram; /* pointer to frame buffer RAM */
UINT32 mask; /* mask to apply to pointers */
UINT16 * rgb[3]; /* pointer to 3 RGB buffers */
UINT16 * aux; /* pointer to 1 aux buffer */
UINT32 rgbmax[3]; /* maximum valid offset in each RGB buffer */
UINT32 auxmax; /* maximum valid offset in the aux buffer */
UINT8 frontbuf; /* front buffer index */
UINT8 backbuf; /* back buffer index */
UINT8 swaps_pending; /* number of pending swaps */
UINT8 video_changed; /* did the frontbuffer video change? */
UINT8 frontbuf; /* front buffer index */
UINT8 backbuf; /* back buffer index */
UINT8 swaps_pending; /* number of pending swaps */
UINT8 video_changed; /* did the frontbuffer video change? */
UINT32 yorigin; /* Y origin subtract value */
UINT32 lfb_base; /* base of LFB in memory */
UINT8 lfb_stride; /* stride of LFB accesses in bits */
UINT32 yorigin; /* Y origin subtract value */
UINT32 lfb_base; /* base of LFB in memory */
UINT8 lfb_stride; /* stride of LFB accesses in bits */
UINT32 width; /* width of current frame buffer */
UINT32 height; /* height of current frame buffer */
UINT32 xoffs; /* horizontal offset (back porch) */
UINT32 yoffs; /* vertical offset (back porch) */
UINT32 vsyncscan; /* vertical sync scanline */
UINT32 rowpixels; /* pixels per row */
UINT32 tile_width; /* width of video tiles */
UINT32 tile_height; /* height of video tiles */
UINT32 x_tiles; /* number of tiles in the X direction */
UINT32 width; /* width of current frame buffer */
UINT32 height; /* height of current frame buffer */
UINT32 xoffs; /* horizontal offset (back porch) */
UINT32 yoffs; /* vertical offset (back porch) */
UINT32 vsyncscan; /* vertical sync scanline */
UINT32 rowpixels; /* pixels per row */
UINT32 tile_width; /* width of video tiles */
UINT32 tile_height; /* height of video tiles */
UINT32 x_tiles; /* number of tiles in the X direction */
emu_timer * vblank_timer; /* VBLANK timer */
UINT8 vblank; /* VBLANK state */
UINT8 vblank_count; /* number of VBLANKs since last swap */
UINT8 vblank_swap_pending; /* a swap is pending, waiting for a vblank */
UINT8 vblank_swap; /* swap when we hit this count */
UINT8 vblank_dont_swap; /* don't actually swap when we hit this point */
void (*vblank_client)(running_machine *, int); /* client callback */
emu_timer * vblank_timer; /* VBLANK timer */
UINT8 vblank; /* VBLANK state */
UINT8 vblank_count; /* number of VBLANKs since last swap */
UINT8 vblank_swap_pending; /* a swap is pending, waiting for a vblank */
UINT8 vblank_swap; /* swap when we hit this count */
UINT8 vblank_dont_swap; /* don't actually swap when we hit this point */
voodoo_vblank_func vblank_client; /* client callback */
/* triangle setup info */
UINT8 cheating_allowed; /* allow cheating? */
INT32 sign; /* triangle sign */
INT16 ax, ay; /* vertex A x,y (12.4) */
INT16 bx, by; /* vertex B x,y (12.4) */
INT16 cx, cy; /* vertex C x,y (12.4) */
INT32 startr, startg, startb, starta; /* starting R,G,B,A (12.12) */
INT32 startz; /* starting Z (20.12) */
INT64 startw; /* starting W (16.32) */
INT32 drdx, dgdx, dbdx, dadx; /* delta R,G,B,A per X */
INT32 dzdx; /* delta Z per X */
INT64 dwdx; /* delta W per X */
INT32 drdy, dgdy, dbdy, dady; /* delta R,G,B,A per Y */
INT32 dzdy; /* delta Z per Y */
INT64 dwdy; /* delta W per Y */
UINT8 cheating_allowed; /* allow cheating? */
INT32 sign; /* triangle sign */
INT16 ax, ay; /* vertex A x,y (12.4) */
INT16 bx, by; /* vertex B x,y (12.4) */
INT16 cx, cy; /* vertex C x,y (12.4) */
INT32 startr, startg, startb, starta; /* starting R,G,B,A (12.12) */
INT32 startz; /* starting Z (20.12) */
INT64 startw; /* starting W (16.32) */
INT32 drdx, dgdx, dbdx, dadx; /* delta R,G,B,A per X */
INT32 dzdx; /* delta Z per X */
INT64 dwdx; /* delta W per X */
INT32 drdy, dgdy, dbdy, dady; /* delta R,G,B,A per Y */
INT32 dzdy; /* delta Z per Y */
INT64 dwdy; /* delta W per Y */
stats_block lfb_stats; /* LFB-access statistics */
stats_block lfb_stats; /* LFB-access statistics */
UINT8 sverts; /* number of vertices ready */
setup_vertex svert[3]; /* 3 setup vertices */
UINT8 sverts; /* number of vertices ready */
setup_vertex svert[3]; /* 3 setup vertices */
fifo_state fifo; /* framebuffer memory fifo */
cmdfifo_info cmdfifo[2]; /* command FIFOs */
fifo_state fifo; /* framebuffer memory fifo */
cmdfifo_info cmdfifo[2]; /* command FIFOs */
UINT8 fogblend[64]; /* 64-entry fog table */
UINT8 fogdelta[64]; /* 64-entry fog table */
UINT8 fogdelta_mask; /* mask for for delta (0xff for V1, 0xfc for V2) */
UINT8 fogblend[64]; /* 64-entry fog table */
UINT8 fogdelta[64]; /* 64-entry fog table */
UINT8 fogdelta_mask; /* mask for for delta (0xff for V1, 0xfc for V2) */
rgb_t pen[65536]; /* mapping from pixels to pens */
rgb_t clut[512]; /* clut gamma data */
UINT8 clut_dirty; /* do we need to recompute? */
rgb_t pen[65536]; /* mapping from pixels to pens */
rgb_t clut[512]; /* clut gamma data */
UINT8 clut_dirty; /* do we need to recompute? */
};
typedef struct _dac_state dac_state;
struct _dac_state
{
UINT8 reg[8]; /* 8 registers */
UINT8 read_result; /* pending read result */
UINT8 reg[8]; /* 8 registers */
UINT8 read_result; /* pending read result */
};
typedef struct _raster_info raster_info;
struct _raster_info
{
struct _raster_info *next; /* pointer to next entry with the same hash */
poly_draw_scanline_func callback; /* callback pointer */
UINT8 is_generic; /* TRUE if this is one of the generic rasterizers */
UINT8 display; /* display index */
UINT32 hits; /* how many hits (pixels) we've used this for */
UINT32 polys; /* how many polys we've used this for */
UINT32 eff_color_path; /* effective fbzColorPath value */
UINT32 eff_alpha_mode; /* effective alphaMode value */
UINT32 eff_fog_mode; /* effective fogMode value */
UINT32 eff_fbz_mode; /* effective fbzMode value */
UINT32 eff_tex_mode_0; /* effective textureMode value for TMU #0 */
UINT32 eff_tex_mode_1; /* effective textureMode value for TMU #1 */
struct _raster_info *next; /* pointer to next entry with the same hash */
poly_draw_scanline_func callback; /* callback pointer */
UINT8 is_generic; /* TRUE if this is one of the generic rasterizers */
UINT8 display; /* display index */
UINT32 hits; /* how many hits (pixels) we've used this for */
UINT32 polys; /* how many polys we've used this for */
UINT32 eff_color_path; /* effective fbzColorPath value */
UINT32 eff_alpha_mode; /* effective alphaMode value */
UINT32 eff_fog_mode; /* effective fogMode value */
UINT32 eff_fbz_mode; /* effective fbzMode value */
UINT32 eff_tex_mode_0; /* effective textureMode value for TMU #0 */
UINT32 eff_tex_mode_1; /* effective textureMode value for TMU #1 */
};
struct _poly_extra_data
{
voodoo_state *state; /* pointer back to the voodoo state */
raster_info *info; /* pointer to rasterizer information */
voodoo_state * state; /* pointer back to the voodoo state */
raster_info * info; /* pointer to rasterizer information */
INT16 ax, ay; /* vertex A x,y (12.4) */
INT32 startr, startg, startb, starta; /* starting R,G,B,A (12.12) */
INT32 startz; /* starting Z (20.12) */
INT64 startw; /* starting W (16.32) */
INT32 drdx, dgdx, dbdx, dadx; /* delta R,G,B,A per X */
INT32 dzdx; /* delta Z per X */
INT64 dwdx; /* delta W per X */
INT32 drdy, dgdy, dbdy, dady; /* delta R,G,B,A per Y */
INT32 dzdy; /* delta Z per Y */
INT64 dwdy; /* delta W per Y */
INT16 ax, ay; /* vertex A x,y (12.4) */
INT32 startr, startg, startb, starta; /* starting R,G,B,A (12.12) */
INT32 startz; /* starting Z (20.12) */
INT64 startw; /* starting W (16.32) */
INT32 drdx, dgdx, dbdx, dadx; /* delta R,G,B,A per X */
INT32 dzdx; /* delta Z per X */
INT64 dwdx; /* delta W per X */
INT32 drdy, dgdy, dbdy, dady; /* delta R,G,B,A per Y */
INT32 dzdy; /* delta Z per Y */
INT64 dwdy; /* delta W per Y */
INT64 starts0, startt0; /* starting S,T (14.18) */
INT64 startw0; /* starting W (2.30) */
INT64 ds0dx, dt0dx; /* delta S,T per X */
INT64 dw0dx; /* delta W per X */
INT64 ds0dy, dt0dy; /* delta S,T per Y */
INT64 dw0dy; /* delta W per Y */
INT32 lodbase0; /* used during rasterization */
INT64 starts0, startt0; /* starting S,T (14.18) */
INT64 startw0; /* starting W (2.30) */
INT64 ds0dx, dt0dx; /* delta S,T per X */
INT64 dw0dx; /* delta W per X */
INT64 ds0dy, dt0dy; /* delta S,T per Y */
INT64 dw0dy; /* delta W per Y */
INT32 lodbase0; /* used during rasterization */
INT64 starts1, startt1; /* starting S,T (14.18) */
INT64 startw1; /* starting W (2.30) */
INT64 ds1dx, dt1dx; /* delta S,T per X */
INT64 dw1dx; /* delta W per X */
INT64 ds1dy, dt1dy; /* delta S,T per Y */
INT64 dw1dy; /* delta W per Y */
INT32 lodbase1; /* used during rasterization */
INT64 starts1, startt1; /* starting S,T (14.18) */
INT64 startw1; /* starting W (2.30) */
INT64 ds1dx, dt1dx; /* delta S,T per X */
INT64 dw1dx; /* delta W per X */
INT64 ds1dy, dt1dy; /* delta S,T per Y */
INT64 dw1dy; /* delta W per Y */
INT32 lodbase1; /* used during rasterization */
UINT16 dither[16]; /* dither matrix, for fastfill */
UINT16 dither[16]; /* dither matrix, for fastfill */
};
typedef struct _banshee_info banshee_info;
struct _banshee_info
{
UINT32 io[0x40]; /* I/O registers */
UINT32 agp[0x80]; /* AGP registers */
UINT8 vga[0x20]; /* VGA registers */
UINT8 crtc[0x27]; /* VGA CRTC registers */
UINT8 seq[0x05]; /* VGA sequencer registers */
UINT8 gc[0x05]; /* VGA graphics controller registers */
UINT8 att[0x15]; /* VGA attribute registers */
UINT8 attff; /* VGA attribute flip-flop */
UINT32 io[0x40]; /* I/O registers */
UINT32 agp[0x80]; /* AGP registers */
UINT8 vga[0x20]; /* VGA registers */
UINT8 crtc[0x27]; /* VGA CRTC registers */
UINT8 seq[0x05]; /* VGA sequencer registers */
UINT8 gc[0x05]; /* VGA graphics controller registers */
UINT8 att[0x15]; /* VGA attribute registers */
UINT8 attff; /* VGA attribute flip-flop */
};
/* typedef struct _voodoo_state voodoo_state; -- declared above */
struct _voodoo_state
{
UINT8 index; /* index of board */
const device_config *screen; /* the screen we are acting on */
UINT8 type; /* type of system */
UINT8 chipmask; /* mask for which chips are available */
UINT32 freq; /* operating frequency */
attoseconds_t attoseconds_per_cycle;/* attoseconds per cycle */
UINT32 extra_cycles; /* extra cycles not yet accounted for */
int trigger; /* trigger used for stalling */
UINT8 index; /* index of board */
const device_config *device; /* pointer to our containing device */
const device_config *screen; /* the screen we are acting on */
UINT8 type; /* type of system */
UINT8 chipmask; /* mask for which chips are available */
UINT32 freq; /* operating frequency */
attoseconds_t attoseconds_per_cycle; /* attoseconds per cycle */
UINT32 extra_cycles; /* extra cycles not yet accounted for */
int trigger; /* trigger used for stalling */
voodoo_reg reg[0x400]; /* raw registers */
const UINT8 *regaccess; /* register access array */
const char *const *regnames; /* register names array */
UINT8 alt_regmap; /* enable alternate register map? */
voodoo_reg reg[0x400]; /* raw registers */
const UINT8 * regaccess; /* register access array */
const char *const * regnames; /* register names array */
UINT8 alt_regmap; /* enable alternate register map? */
pci_state pci; /* PCI state */
dac_state dac; /* DAC state */
pci_state pci; /* PCI state */
dac_state dac; /* DAC state */
fbi_state fbi; /* FBI states */
tmu_state tmu[MAX_TMU]; /* TMU states */
tmu_shared_state tmushare; /* TMU shared state */
banshee_info banshee; /* Banshee state */
fbi_state fbi; /* FBI states */
tmu_state tmu[MAX_TMU]; /* TMU states */
tmu_shared_state tmushare; /* TMU shared state */
banshee_info banshee; /* Banshee state */
poly_manager *poly; /* polygon manager */
stats_block *thread_stats; /* per-thread statistics */
poly_manager * poly; /* polygon manager */
stats_block * thread_stats; /* per-thread statistics */
voodoo_stats stats; /* internal statistics */
voodoo_stats stats; /* internal statistics */
offs_t last_status_pc; /* PC of last status read (for logging) */
UINT32 last_status_value; /* value of last status read (for logging) */
offs_t last_status_pc; /* PC of last status read (for logging) */
UINT32 last_status_value; /* value of last status read (for logging) */
int next_rasterizer; /* next rasterizer index */
raster_info rasterizer[MAX_RASTERIZERS]; /* array of rasterizers */
raster_info *raster_hash[RASTER_HASH_SIZE]; /* hash table of rasterizers */
int next_rasterizer; /* next rasterizer index */
raster_info rasterizer[MAX_RASTERIZERS]; /* array of rasterizers */
raster_info * raster_hash[RASTER_HASH_SIZE]; /* hash table of rasterizers */
};

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,10 @@
**************************************************************************/
#define MAX_VOODOO 2
/***************************************************************************
CONSTANTS
***************************************************************************/
/* enumeration specifying which model of Voodoo we are emulating */
enum
@ -18,34 +21,99 @@ enum
MAX_VOODOO_TYPES
};
void voodoo_start(int which, const device_config *screen, int type, int fbmem_in_mb, int tmem0_in_mb, int tmem1_in_mb);
int voodoo_update(int which, bitmap_t *bitmap, const rectangle *cliprect);
void voodoo_reset(int which);
void voodoo_exit(int which);
int voodoo_get_type(int which);
int voodoo_is_stalled(int which);
void voodoo_set_init_enable(int which, UINT32 newval);
void voodoo_set_vblank_callback(int which, void (*vblank)(running_machine *, int));
void voodoo_set_stall_callback(int which, void (*stall)(running_machine *, int));
READ32_HANDLER( voodoo_0_r );
WRITE32_HANDLER( voodoo_0_w );
#define STD_VOODOO_1_CLOCK 50000000
#define STD_VOODOO_2_CLOCK 90000000
#define STD_VOODOO_BANSHEE_CLOCK 90000000
#define STD_VOODOO_3_CLOCK 132000000
READ32_HANDLER( voodoo_1_r );
WRITE32_HANDLER( voodoo_1_w );
READ32_HANDLER( banshee_0_r );
WRITE32_HANDLER( banshee_0_w );
READ32_HANDLER( banshee_fb_0_r );
WRITE32_HANDLER( banshee_fb_0_w );
READ32_HANDLER( banshee_io_0_r );
WRITE32_HANDLER( banshee_io_0_w );
READ32_HANDLER( banshee_rom_0_r );
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
READ32_HANDLER( banshee_1_r );
WRITE32_HANDLER( banshee_1_w );
READ32_HANDLER( banshee_fb_1_r );
WRITE32_HANDLER( banshee_fb_1_w );
READ32_HANDLER( banshee_io_1_r );
WRITE32_HANDLER( banshee_io_1_w );
READ32_HANDLER( banshee_rom_1_r );
typedef void (*voodoo_vblank_func)(const device_config *device, int state);
typedef void (*voodoo_stall_func)(const device_config *device, int state);
typedef struct _voodoo_config voodoo_config;
struct _voodoo_config
{
int type;
UINT32 clock;
UINT8 fbmem;
UINT8 tmumem0;
UINT8 tmumem1;
const char * screen;
voodoo_vblank_func vblank;
voodoo_stall_func stall;
};
/***************************************************************************
DEVICE CONFIGURATION MACROS
***************************************************************************/
#define MDRV_3DFX_VOODOO_ADD(_tag, _type, _clock, _fbmem, _screen) \
MDRV_DEVICE_ADD(_tag, VOODOO_GRAPHICS) \
MDRV_DEVICE_CONFIG_DATA32(voodoo_config, type, _type) \
MDRV_DEVICE_CONFIG_DATA32(voodoo_config, clock, _clock) \
MDRV_DEVICE_CONFIG_DATA32(voodoo_config, fbmem, _fbmem) \
MDRV_DEVICE_CONFIG_DATAPTR(voodoo_config, screen, _screen)
#define MDRV_3DFX_VOODOO_1_ADD(_tag, _clock, _fbmem, _screen) \
MDRV_3DFX_VOODOO_ADD(_tag, VOODOO_1, _clock, _fbmem, _screen)
#define MDRV_3DFX_VOODOO_2_ADD(_tag, _clock, _fbmem, _screen) \
MDRV_3DFX_VOODOO_ADD(_tag, VOODOO_2, _clock, _fbmem, _screen)
#define MDRV_3DFX_VOODOO_BANSHEE_ADD(_tag, _clock, _fbmem, _screen) \
MDRV_3DFX_VOODOO_ADD(_tag, VOODOO_BANSHEE, _clock, _fbmem, _screen)
#define MDRV_3DFX_VOODOO_3_ADD(_tag, _clock, _fbmem, _screen) \
MDRV_3DFX_VOODOO_ADD(_tag, VOODOO_3, _clock, _fbmem, _screen)
#define MDRV_3DFX_VOODOO_TMU_MEMORY(_tmu, _tmumem) \
MDRV_DEVICE_CONFIG_DATA32(voodoo_config, tmumem##_tmu, _tmumem)
#define MDRV_3DFX_VOODOO_VBLANK(_vblank) \
MDRV_DEVICE_CONFIG_DATAPTR(voodoo_config, vblank, _vblank)
#define MDRV_3DFX_VOODOO_STALL(_stall) \
MDRV_DEVICE_CONFIG_DATAPTR(voodoo_config, stall, _stall)
#define MDRV_3DFX_VOODOO_MODIFY(_tag) \
MDRV_DEVICE_MODIFY(_tag, VOODOO_GRAPHICS)
#define MDRV_3DFX_VOODOO_REMOVE(_tag) \
MDRV_DEVICE_REMOVE(_tag, VOODOO_GRAPHICS)
/***************************************************************************
FUNCTION PROTOTYPES
***************************************************************************/
int voodoo_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect);
int voodoo_get_type(const device_config *device);
int voodoo_is_stalled(const device_config *device);
void voodoo_set_init_enable(const device_config *device, UINT32 newval);
READ32_DEVICE_HANDLER( voodoo_r );
WRITE32_DEVICE_HANDLER( voodoo_w );
READ32_DEVICE_HANDLER( banshee_r );
WRITE32_DEVICE_HANDLER( banshee_w );
READ32_DEVICE_HANDLER( banshee_fb_r );
WRITE32_DEVICE_HANDLER( banshee_fb_w );
READ32_DEVICE_HANDLER( banshee_io_r );
WRITE32_DEVICE_HANDLER( banshee_io_w );
READ32_DEVICE_HANDLER( banshee_rom_r );
/* ----- device interface ----- */
/* device get info callback */
#define VOODOO_GRAPHICS DEVICE_GET_INFO_NAME(voodoo)
DEVICE_GET_INFO( voodoo );

View File

@ -71,27 +71,18 @@ static WRITE32_HANDLER( paletteram32_w )
palette_set_color_rgb(machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
}
static void voodoo_vblank_0(running_machine *machine, int param)
static void voodoo_vblank_0(const device_config *device, int param)
{
cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
cpunum_set_input_line(device->machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
}
static void voodoo_vblank_1(running_machine *machine, int param)
static void voodoo_vblank_1(const device_config *device, int param)
{
cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE);
cpunum_set_input_line(device->machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE);
}
static VIDEO_START( hangplt )
{
const device_config *left_screen = device_list_find_by_tag(machine->config->devicelist, VIDEO_SCREEN, "left");
const device_config *right_screen = device_list_find_by_tag(machine->config->devicelist, VIDEO_SCREEN, "right");
voodoo_start(0, left_screen, VOODOO_1, 2, 4, 4);
voodoo_start(1, right_screen, VOODOO_1, 2, 4, 4);
voodoo_set_vblank_callback(0, voodoo_vblank_0);
voodoo_set_vblank_callback(1, voodoo_vblank_1);
K001604_vh_start(machine, 0);
K001604_vh_start(machine, 1);
}
@ -99,26 +90,27 @@ static VIDEO_START( hangplt )
static VIDEO_UPDATE( hangplt )
{
const device_config *left_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "left");
const device_config *right_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "right");
fillbitmap(bitmap, screen->machine->pens[0], cliprect);
if (screen == left_screen)
if (strcmp(screen->tag, "left") == 0)
{
const device_config *voodoo = device_list_find_by_tag(screen->machine->config->devicelist, VOODOO_GRAPHICS, "voodoo0");
K001604_tile_update(screen->machine, 0);
// K001604_draw_back_layer(bitmap, cliprect);
voodoo_update(0, bitmap, cliprect);
voodoo_update(voodoo, bitmap, cliprect);
K001604_draw_front_layer(0, bitmap, cliprect);
}
else if (screen == right_screen)
else if (strcmp(screen->tag, "right") == 0)
{
const device_config *voodoo = device_list_find_by_tag(screen->machine->config->devicelist, VOODOO_GRAPHICS, "voodoo1");
K001604_tile_update(screen->machine, 1);
// K001604_draw_back_layer(bitmap, cliprect);
voodoo_update(1, bitmap, cliprect);
voodoo_update(voodoo, bitmap, cliprect);
K001604_draw_front_layer(1, bitmap, cliprect);
}
@ -487,9 +479,9 @@ static ADDRESS_MAP_START( hangplt_sharc0_map, ADDRESS_SPACE_DATA, 32 )
AM_RANGE(0x0400000, 0x041ffff) AM_READWRITE(cgboard_0_shared_sharc_r, cgboard_0_shared_sharc_w)
AM_RANGE(0x0500000, 0x05fffff) AM_READWRITE(dsp_dataram0_r, dsp_dataram0_w)
AM_RANGE(0x1400000, 0x14fffff) AM_RAM
AM_RANGE(0x2400000, 0x27fffff) AM_READWRITE(nwk_voodoo_0_r, voodoo_0_w)
AM_RANGE(0x2400000, 0x27fffff) AM_DEVREADWRITE(VOODOO_GRAPHICS, "voodoo0", nwk_voodoo_0_r, voodoo_w)
AM_RANGE(0x3400000, 0x34000ff) AM_READWRITE(cgboard_0_comm_sharc_r, cgboard_0_comm_sharc_w)
AM_RANGE(0x3401000, 0x34fffff) AM_WRITE(nwk_fifo_0_w)
AM_RANGE(0x3401000, 0x34fffff) AM_DEVWRITE(VOODOO_GRAPHICS, "voodoo0", nwk_fifo_0_w)
AM_RANGE(0x3500000, 0x3507fff) AM_READWRITE(K033906_0_r, K033906_0_w)
AM_RANGE(0x3600000, 0x37fffff) AM_ROMBANK(5)
ADDRESS_MAP_END
@ -498,9 +490,9 @@ static ADDRESS_MAP_START( hangplt_sharc1_map, ADDRESS_SPACE_DATA, 32 )
AM_RANGE(0x0400000, 0x041ffff) AM_READWRITE(cgboard_1_shared_sharc_r, cgboard_1_shared_sharc_w)
AM_RANGE(0x0500000, 0x05fffff) AM_READWRITE(dsp_dataram1_r, dsp_dataram1_w)
AM_RANGE(0x1400000, 0x14fffff) AM_RAM
AM_RANGE(0x2400000, 0x27fffff) AM_READWRITE(nwk_voodoo_1_r, voodoo_1_w)
AM_RANGE(0x2400000, 0x27fffff) AM_DEVREADWRITE(VOODOO_GRAPHICS, "voodoo1", nwk_voodoo_1_r, voodoo_w)
AM_RANGE(0x3400000, 0x34000ff) AM_READWRITE(cgboard_1_comm_sharc_r, cgboard_1_comm_sharc_w)
AM_RANGE(0x3401000, 0x34fffff) AM_WRITE(nwk_fifo_1_w)
AM_RANGE(0x3401000, 0x34fffff) AM_DEVWRITE(VOODOO_GRAPHICS, "voodoo1", nwk_fifo_1_w)
AM_RANGE(0x3500000, 0x3507fff) AM_READWRITE(K033906_1_r, K033906_1_w)
AM_RANGE(0x3600000, 0x37fffff) AM_ROMBANK(6)
ADDRESS_MAP_END
@ -779,6 +771,16 @@ static MACHINE_DRIVER_START( hangplt )
MDRV_MACHINE_START(gticlub)
MDRV_MACHINE_RESET(hangplt)
MDRV_3DFX_VOODOO_1_ADD("voodoo0", STD_VOODOO_1_CLOCK, 2, "left")
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 2)
MDRV_3DFX_VOODOO_TMU_MEMORY(1, 2)
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_0)
MDRV_3DFX_VOODOO_1_ADD("voodoo1", STD_VOODOO_1_CLOCK, 2, "right")
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 2)
MDRV_3DFX_VOODOO_TMU_MEMORY(1, 2)
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_1)
/* video hardware */
MDRV_PALETTE_LENGTH(65536)

View File

@ -579,64 +579,23 @@ static WRITE32_HANDLER(K037122_reg_w)
COMBINE_DATA( K037122_reg[chip] + offset );
}
static int voodoo_version = 0;
static void voodoo_vblank_0(running_machine *machine, int param)
static void voodoo_vblank_0(const device_config *device, int param)
{
cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
cpunum_set_input_line(device->machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
}
static void voodoo_vblank_1(running_machine *machine, int param)
static void voodoo_vblank_1(const device_config *device, int param)
{
cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE);
}
static void hornet_exit(running_machine *machine)
{
voodoo_exit(0);
}
static void hornet_2board_exit(running_machine *machine)
{
voodoo_exit(0);
voodoo_exit(1);
cpunum_set_input_line(device->machine, 0, INPUT_LINE_IRQ1, ASSERT_LINE);
}
static VIDEO_START( hornet )
{
add_exit_callback(machine, hornet_exit);
if (voodoo_version == 0)
voodoo_start(0, machine->primary_screen, VOODOO_1, 2, 4, 0);
else
voodoo_start(0, machine->primary_screen, VOODOO_2, 2, 4, 0);
voodoo_set_vblank_callback(0, voodoo_vblank_0);
K037122_vh_start(machine, 0);
}
static VIDEO_START( hornet_2board )
{
const device_config *left_screen = device_list_find_by_tag(machine->config->devicelist, VIDEO_SCREEN, "left");
const device_config *right_screen = device_list_find_by_tag(machine->config->devicelist, VIDEO_SCREEN, "right");
add_exit_callback(machine, hornet_2board_exit);
if (voodoo_version == 0)
{
voodoo_start(0, left_screen, VOODOO_1, 2, 4, 0);
voodoo_start(1, right_screen, VOODOO_1, 2, 4, 0);
}
else
{
voodoo_start(0, left_screen, VOODOO_2, 2, 4, 0);
voodoo_start(1, right_screen, VOODOO_2, 2, 4, 0);
}
voodoo_set_vblank_callback(0, voodoo_vblank_0);
voodoo_set_vblank_callback(1, voodoo_vblank_1);
K037122_vh_start(machine, 0);
K037122_vh_start(machine, 1);
}
@ -644,7 +603,9 @@ static VIDEO_START( hornet_2board )
static VIDEO_UPDATE( hornet )
{
voodoo_update(0, bitmap, cliprect);
const device_config *voodoo = device_list_find_by_tag(screen->machine->config->devicelist, VOODOO_GRAPHICS, "voodoo0");
voodoo_update(voodoo, bitmap, cliprect);
K037122_tile_update(screen->machine, 0);
K037122_tile_draw(screen->machine, 0, bitmap, cliprect);
@ -656,20 +617,19 @@ static VIDEO_UPDATE( hornet )
static VIDEO_UPDATE( hornet_2board )
{
const device_config *left_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "left");
const device_config *right_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "right");
if (screen == left_screen)
if (strcmp(screen->tag, "left") == 0)
{
voodoo_update(0, bitmap, cliprect);
const device_config *voodoo = device_list_find_by_tag(screen->machine->config->devicelist, VOODOO_GRAPHICS, "voodoo0");
voodoo_update(voodoo, bitmap, cliprect);
/* TODO: tilemaps per screen */
K037122_tile_update(screen->machine, 0);
K037122_tile_draw(screen->machine, 0, bitmap, cliprect);
}
else if (screen == right_screen)
else if (strcmp(screen->tag, "right") == 0)
{
voodoo_update(1, bitmap, cliprect);
const device_config *voodoo = device_list_find_by_tag(screen->machine->config->devicelist, VOODOO_GRAPHICS, "voodoo1");
voodoo_update(voodoo, bitmap, cliprect);
/* TODO: tilemaps per screen */
K037122_tile_update(screen->machine, 1);
@ -818,7 +778,7 @@ static ADDRESS_MAP_START( sharc0_map, ADDRESS_SPACE_DATA, 32 )
AM_RANGE(0x0400000, 0x041ffff) AM_READWRITE(cgboard_0_shared_sharc_r, cgboard_0_shared_sharc_w)
AM_RANGE(0x0500000, 0x05fffff) AM_READWRITE(dsp_dataram0_r, dsp_dataram0_w)
AM_RANGE(0x1400000, 0x14fffff) AM_RAM
AM_RANGE(0x2400000, 0x27fffff) AM_READWRITE(voodoo_0_r, voodoo_0_w)
AM_RANGE(0x2400000, 0x27fffff) AM_DEVREADWRITE(VOODOO_GRAPHICS, "voodoo0", voodoo_r, voodoo_w)
AM_RANGE(0x3400000, 0x34000ff) AM_READWRITE(cgboard_0_comm_sharc_r, cgboard_0_comm_sharc_w)
AM_RANGE(0x3500000, 0x35000ff) AM_READWRITE(K033906_0_r, K033906_0_w)
AM_RANGE(0x3600000, 0x37fffff) AM_ROMBANK(5)
@ -828,7 +788,7 @@ static ADDRESS_MAP_START( sharc1_map, ADDRESS_SPACE_DATA, 32 )
AM_RANGE(0x0400000, 0x041ffff) AM_READWRITE(cgboard_1_shared_sharc_r, cgboard_1_shared_sharc_w)
AM_RANGE(0x0500000, 0x05fffff) AM_READWRITE(dsp_dataram1_r, dsp_dataram1_w)
AM_RANGE(0x1400000, 0x14fffff) AM_RAM
AM_RANGE(0x2400000, 0x27fffff) AM_READWRITE(voodoo_1_r, voodoo_1_w)
AM_RANGE(0x2400000, 0x27fffff) AM_DEVREADWRITE(VOODOO_GRAPHICS, "voodoo1", voodoo_r, voodoo_w)
AM_RANGE(0x3400000, 0x34000ff) AM_READWRITE(cgboard_1_comm_sharc_r, cgboard_1_comm_sharc_w)
AM_RANGE(0x3500000, 0x35000ff) AM_READWRITE(K033906_1_r, K033906_1_w)
AM_RANGE(0x3600000, 0x37fffff) AM_ROMBANK(6)
@ -1003,6 +963,10 @@ static MACHINE_DRIVER_START( hornet )
MDRV_NVRAM_HANDLER( timekeeper_0 )
MDRV_3DFX_VOODOO_1_ADD("voodoo0", STD_VOODOO_1_CLOCK, 2, "main")
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 4)
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_0)
/* video hardware */
MDRV_SCREEN_ADD("main", RASTER)
MDRV_SCREEN_REFRESH_RATE(60)
@ -1051,6 +1015,15 @@ static MACHINE_DRIVER_START( hornet_2board )
MDRV_VIDEO_START(hornet_2board)
MDRV_VIDEO_UPDATE(hornet_2board)
MDRV_3DFX_VOODOO_REMOVE("voodoo0")
MDRV_3DFX_VOODOO_1_ADD("voodoo0", STD_VOODOO_1_CLOCK, 2, "left")
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 4)
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_0)
MDRV_3DFX_VOODOO_1_ADD("voodoo1", STD_VOODOO_1_CLOCK, 2, "right")
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 4)
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_1)
/* video hardware */
MDRV_PALETTE_LENGTH(65536)
@ -1069,6 +1042,20 @@ static MACHINE_DRIVER_START( hornet_2board )
MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 383)
MACHINE_DRIVER_END
static MACHINE_DRIVER_START( hornet_2board_v2 )
MDRV_IMPORT_FROM(hornet_2board)
MDRV_3DFX_VOODOO_REMOVE("voodoo0")
MDRV_3DFX_VOODOO_2_ADD("voodoo0", STD_VOODOO_2_CLOCK, 2, "left")
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 4)
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_0)
MDRV_3DFX_VOODOO_REMOVE("voodoo1")
MDRV_3DFX_VOODOO_2_ADD("voodoo1", STD_VOODOO_2_CLOCK, 2, "right")
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 4)
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_1)
MACHINE_DRIVER_END
/*****************************************************************************/
@ -1274,7 +1261,6 @@ static DRIVER_INIT(gradius4)
backup_ram[0x0e] = 0x02; // checksum
backup_ram[0x0f] = 0xd7; // checksum
voodoo_version = 0;
init_hornet(machine);
}
@ -1308,7 +1294,6 @@ static DRIVER_INIT(nbapbp)
backup_ram[0x0e] = (checksum >> 8) & 0xff; // checksum
backup_ram[0x0f] = (checksum >> 0) & 0xff; // checksum
voodoo_version = 0;
init_hornet(machine);
}
@ -1342,7 +1327,6 @@ static DRIVER_INIT(terabrst)
backup_ram[0x0e] = (checksum >> 8) & 0xff; // checksum
backup_ram[0x0f] = (checksum >> 0) & 0xff; // checksum
voodoo_version = 0;
init_hornet_2board(machine);
}
@ -1376,7 +1360,6 @@ static DRIVER_INIT(sscope)
backup_ram[0x0e] = (checksum >> 8) & 0xff; // checksum
backup_ram[0x0f] = (checksum >> 0) & 0xff; // checksum
voodoo_version = 0;
init_hornet_2board(machine);
}
@ -1438,7 +1421,6 @@ static DRIVER_INIT(sscope2)
backup_ram[0x1f4e] = (checksum >> 8) & 0xff; // checksum
backup_ram[0x1f4f] = (checksum >> 0) & 0xff; // checksum
voodoo_version = 1;
init_hornet_2board(machine);
}
@ -1579,9 +1561,9 @@ ROM_END
/*************************************************************************/
GAME( 1998, gradius4, 0, hornet, hornet, gradius4, ROT0, "Konami", "Gradius 4: Fukkatsu", GAME_IMPERFECT_SOUND )
GAME( 1998, nbapbp, 0, hornet, hornet, nbapbp, ROT0, "Konami", "NBA Play By Play", GAME_IMPERFECT_SOUND )
GAMEL( 1998, terabrst, 0, hornet_2board, hornet, terabrst, ROT0, "Konami", "Teraburst", GAME_IMPERFECT_SOUND, layout_dualhsxs )
GAMEL( 2000, sscope, 0, hornet_2board, sscope, sscope, ROT0, "Konami", "Silent Scope (ver UAB)", GAME_IMPERFECT_SOUND|GAME_NOT_WORKING, layout_dualhsxs )
GAMEL( 2000, sscopea, sscope, hornet_2board, sscope, sscope, ROT0, "Konami", "Silent Scope (ver UAA)", GAME_IMPERFECT_SOUND|GAME_NOT_WORKING, layout_dualhsxs )
GAMEL( 2000, sscope2, 0, hornet_2board, sscope, sscope2, ROT0, "Konami", "Silent Scope 2", GAME_IMPERFECT_SOUND|GAME_NOT_WORKING, layout_dualhsxs )
GAME( 1998, gradius4, 0, hornet, hornet, gradius4, ROT0, "Konami", "Gradius 4: Fukkatsu", GAME_IMPERFECT_SOUND )
GAME( 1998, nbapbp, 0, hornet, hornet, nbapbp, ROT0, "Konami", "NBA Play By Play", GAME_IMPERFECT_SOUND )
GAMEL( 1998, terabrst, 0, hornet_2board, hornet, terabrst, ROT0, "Konami", "Teraburst", GAME_IMPERFECT_SOUND, layout_dualhsxs )
GAMEL( 2000, sscope, 0, hornet_2board, sscope, sscope, ROT0, "Konami", "Silent Scope (ver UAB)", GAME_IMPERFECT_SOUND|GAME_NOT_WORKING, layout_dualhsxs )
GAMEL( 2000, sscopea, sscope, hornet_2board, sscope, sscope, ROT0, "Konami", "Silent Scope (ver UAA)", GAME_IMPERFECT_SOUND|GAME_NOT_WORKING, layout_dualhsxs )
GAMEL( 2000, sscope2, 0, hornet_2board_v2, sscope, sscope2, ROT0, "Konami", "Silent Scope 2", GAME_IMPERFECT_SOUND|GAME_NOT_WORKING, layout_dualhsxs )

View File

@ -521,25 +521,24 @@ READ32_HANDLER(K001604_reg_r)
static void voodoo_vblank_0(running_machine *machine, int param)
static void voodoo_vblank_0(const device_config *device, int param)
{
cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
cpunum_set_input_line(device->machine, 0, INPUT_LINE_IRQ0, ASSERT_LINE);
}
static VIDEO_START( nwktr )
{
voodoo_start(0, machine->primary_screen, VOODOO_1, 2, 2, 2);
voodoo_set_vblank_callback(0, voodoo_vblank_0);
K001604_vh_start(machine, 0);
}
static VIDEO_UPDATE( nwktr )
{
const device_config *voodoo = device_list_find_by_tag(screen->machine->config->devicelist, VOODOO_GRAPHICS, "voodoo");
fillbitmap(bitmap, screen->machine->pens[0], cliprect);
voodoo_update(0, bitmap, cliprect);
voodoo_update(voodoo, bitmap, cliprect);
K001604_tile_update(screen->machine, 0);
K001604_draw_front_layer(0, bitmap, cliprect);
@ -817,7 +816,7 @@ static ADDRESS_MAP_START( sharc_map, ADDRESS_SPACE_DATA, 32 )
AM_RANGE(0x0400000, 0x041ffff) AM_READWRITE(cgboard_0_shared_sharc_r, cgboard_0_shared_sharc_w)
AM_RANGE(0x0500000, 0x05fffff) AM_READWRITE(dsp_dataram_r, dsp_dataram_w)
AM_RANGE(0x1400000, 0x14fffff) AM_RAM
AM_RANGE(0x2400000, 0x27fffff) AM_READWRITE(nwk_voodoo_0_r, nwk_voodoo_0_w)
AM_RANGE(0x2400000, 0x27fffff) AM_DEVREADWRITE(VOODOO_GRAPHICS, "voodoo", nwk_voodoo_0_r, nwk_voodoo_0_w)
AM_RANGE(0x3400000, 0x34000ff) AM_READWRITE(cgboard_0_comm_sharc_r, cgboard_0_comm_sharc_w)
AM_RANGE(0x3500000, 0x35000ff) AM_READWRITE(K033906_0_r, K033906_0_w)
AM_RANGE(0x3600000, 0x37fffff) AM_ROMBANK(5)
@ -923,6 +922,11 @@ static MACHINE_DRIVER_START( nwktr )
MDRV_MACHINE_RESET(nwktr)
MDRV_NVRAM_HANDLER( timekeeper_0 )
MDRV_3DFX_VOODOO_1_ADD("voodoo", STD_VOODOO_1_CLOCK, 2, "main")
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 2)
MDRV_3DFX_VOODOO_TMU_MEMORY(1, 2)
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_0)
/* video hardware */
MDRV_SCREEN_ADD("main", RASTER)
MDRV_SCREEN_REFRESH_RATE(60)

View File

@ -430,6 +430,7 @@ static UINT32 *rombase;
static struct galileo_data galileo;
static struct widget_data widget;
static const device_config *voodoo_device;
static UINT8 voodoo_stalled;
static UINT8 cpu_stalled_on_voodoo;
static UINT32 cpu_stalled_offset;
@ -469,7 +470,7 @@ static void update_vblank_irq(running_machine *machine);
static void galileo_reset(void);
static TIMER_CALLBACK( galileo_timer_callback );
static void galileo_perform_dma(running_machine *machine, int which);
static void voodoo_stall(running_machine *machine, int stall);
static void voodoo_stall(const device_config *device, int stall);
static void widget_reset(running_machine *machine);
static void update_widget_irq(running_machine *machine);
@ -481,37 +482,9 @@ static void update_widget_irq(running_machine *machine);
*
*************************************/
static void seattle_exit(running_machine *machine)
{
voodoo_exit(0);
}
static VIDEO_START( seattle )
{
add_exit_callback(machine, seattle_exit);
voodoo_start(0, machine->primary_screen, VOODOO_1, 2, 4, 0);
voodoo_set_vblank_callback(0, vblank_assert);
voodoo_set_stall_callback(0, voodoo_stall);
}
static VIDEO_START( flagstaff )
{
add_exit_callback(machine, seattle_exit);
voodoo_start(0, machine->primary_screen, VOODOO_1, 2, 4, 4);
voodoo_set_vblank_callback(0, vblank_assert);
voodoo_set_stall_callback(0, voodoo_stall);
}
static VIDEO_UPDATE( seattle )
{
return voodoo_update(0, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED;
return voodoo_update(voodoo_device, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED;
}
@ -522,8 +495,16 @@ static VIDEO_UPDATE( seattle )
*
*************************************/
static MACHINE_RESET( seattle )
static MACHINE_START( seattle )
{
voodoo_device = device_list_find_by_tag(machine->config->devicelist, VOODOO_GRAPHICS, "voodoo");
/* allocate timers for the galileo */
galileo.timer[0].timer = timer_alloc(galileo_timer_callback, NULL);
galileo.timer[1].timer = timer_alloc(galileo_timer_callback, NULL);
galileo.timer[2].timer = timer_alloc(galileo_timer_callback, NULL);
galileo.timer[3].timer = timer_alloc(galileo_timer_callback, NULL);
/* set the fastest DRC options, but strict verification */
cpunum_set_info_int(0, CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
@ -539,12 +520,11 @@ static MACHINE_RESET( seattle )
cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff);
cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase);
cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1);
}
/* allocate timers for the galileo */
galileo.timer[0].timer = timer_alloc(galileo_timer_callback, NULL);
galileo.timer[1].timer = timer_alloc(galileo_timer_callback, NULL);
galileo.timer[2].timer = timer_alloc(galileo_timer_callback, NULL);
galileo.timer[3].timer = timer_alloc(galileo_timer_callback, NULL);
static MACHINE_RESET( seattle )
{
galileo.dma_active = -1;
vblank_irq_num = 0;
@ -565,8 +545,6 @@ static MACHINE_RESET( seattle )
/* reset the other devices */
galileo_reset();
devtag_reset(machine, IDE_CONTROLLER, "ide");
voodoo_reset(0);
if (board_config == SEATTLE_WIDGET_CONFIG)
widget_reset(machine);
if (board_config == FLAGSTAFF_CONFIG)
@ -829,7 +807,7 @@ static void pci_3dfx_w(UINT8 reg, UINT8 type, UINT32 data)
break;
case 0x10: /* initEnable register */
voodoo_set_init_enable(0, data);
voodoo_set_init_enable(voodoo_device, data);
break;
}
if (LOG_PCI)
@ -1017,7 +995,7 @@ static void galileo_perform_dma(running_machine *machine, int which)
}
/* write the data and advance */
voodoo_0_w(machine, (dstaddr & 0xffffff) / 4, program_read_dword(srcaddr), 0xffffffff);
voodoo_w(voodoo_device, (dstaddr & 0xffffff) / 4, program_read_dword(srcaddr), 0xffffffff);
srcaddr += srcinc;
dstaddr += dstinc;
bytesleft -= 4;
@ -1294,12 +1272,12 @@ static WRITE32_HANDLER( galileo_w )
*
*************************************/
static WRITE32_HANDLER( seattle_voodoo_w )
static WRITE32_DEVICE_HANDLER( seattle_voodoo_w )
{
/* if we're not stalled, just write and get out */
if (!voodoo_stalled)
{
voodoo_0_w(machine, offset, data, mem_mask);
voodoo_w(device, offset, data, mem_mask);
return;
}
@ -1319,7 +1297,7 @@ static WRITE32_HANDLER( seattle_voodoo_w )
}
static void voodoo_stall(running_machine *machine, int stall)
static void voodoo_stall(const device_config *device, int stall)
{
/* set the new state */
voodoo_stalled = stall;
@ -1355,7 +1333,7 @@ static void voodoo_stall(running_machine *machine, int stall)
/* resume execution */
cpuintrf_push_context(0);
galileo_perform_dma(machine, which);
galileo_perform_dma(device->machine, which);
cpuintrf_pop_context();
break;
}
@ -1365,12 +1343,12 @@ static void voodoo_stall(running_machine *machine, int stall)
{
/* if the CPU had a pending write, do it now */
if (cpu_stalled_on_voodoo)
voodoo_0_w(machine, cpu_stalled_offset, cpu_stalled_data, cpu_stalled_mem_mask);
voodoo_w(device, cpu_stalled_offset, cpu_stalled_data, cpu_stalled_mem_mask);
cpu_stalled_on_voodoo = FALSE;
/* resume CPU execution */
if (LOG_DMA) logerror("Resuming CPU on voodoo\n");
cpu_trigger(machine, 45678);
cpu_trigger(device->machine, 45678);
}
}
}
@ -1720,7 +1698,7 @@ PCI Mem = 08000000-09FFFFFF
static ADDRESS_MAP_START( seattle_map, ADDRESS_SPACE_PROGRAM, 32 )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_BASE(&rambase) // wg3dh only has 4MB; sfrush, blitz99 8MB
AM_RANGE(0x08000000, 0x08ffffff) AM_READWRITE(voodoo_0_r, seattle_voodoo_w)
AM_RANGE(0x08000000, 0x08ffffff) AM_DEVREADWRITE(VOODOO_GRAPHICS, "voodoo", voodoo_r, seattle_voodoo_w)
AM_RANGE(0x0a000000, 0x0a0003ff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_controller32_r, ide_controller32_w)
AM_RANGE(0x0a00040c, 0x0a00040f) AM_NOP // IDE-related, but annoying
AM_RANGE(0x0a000f00, 0x0a000f07) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ide_bus_master32_r, ide_bus_master32_w)
@ -2455,11 +2433,17 @@ static MACHINE_DRIVER_START( seattle_common )
MDRV_CPU_CONFIG(config)
MDRV_CPU_PROGRAM_MAP(seattle_map,0)
MDRV_MACHINE_START(seattle)
MDRV_MACHINE_RESET(seattle)
MDRV_NVRAM_HANDLER(generic_1fill)
MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt)
MDRV_3DFX_VOODOO_1_ADD("voodoo", STD_VOODOO_1_CLOCK, 2, "main")
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 4)
MDRV_3DFX_VOODOO_VBLANK(vblank_assert)
MDRV_3DFX_VOODOO_STALL(voodoo_stall)
/* video hardware */
MDRV_SCREEN_ADD("main", RASTER)
MDRV_SCREEN_REFRESH_RATE(57)
@ -2467,7 +2451,6 @@ static MACHINE_DRIVER_START( seattle_common )
MDRV_SCREEN_SIZE(640, 480)
MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 479)
MDRV_VIDEO_START(seattle)
MDRV_VIDEO_UPDATE(seattle)
/* sound hardware */
@ -2498,7 +2481,10 @@ MACHINE_DRIVER_END
static MACHINE_DRIVER_START( flagstaff )
MDRV_IMPORT_FROM(seattle_common)
MDRV_CPU_REPLACE("main", R5000LE, SYSTEM_CLOCK*4)
MDRV_VIDEO_START(flagstaff)
MDRV_3DFX_VOODOO_MODIFY("voodoo")
MDRV_3DFX_VOODOO_TMU_MEMORY(1, 4)
MDRV_IMPORT_FROM(cage_seattle)
MACHINE_DRIVER_END

View File

@ -475,7 +475,7 @@ static UINT8 cmos_unlocked;
static UINT32 *timekeeper_nvram;
static size_t timekeeper_nvram_size;
static UINT8 voodoo_type;
static const device_config *voodoo_device;
static UINT8 dcs_idma_cs;
static int dynamic_count;
@ -501,7 +501,6 @@ static struct dynamic_address
*
*************************************/
static void vblank_assert(running_machine *machine, int state);
static TIMER_CALLBACK( nile_timer_callback );
static void ide_interrupt(const device_config *device, int state);
static void remap_dynamic_addresses(running_machine *machine);
@ -514,42 +513,9 @@ static void remap_dynamic_addresses(running_machine *machine);
*
*************************************/
static void vegas_exit(running_machine *machine)
{
voodoo_exit(0);
}
static VIDEO_START( vegas_voodoo2 )
{
add_exit_callback(machine, vegas_exit);
voodoo_start(0, machine->primary_screen, VOODOO_2, 2, 4, 4);
voodoo_set_vblank_callback(0, vblank_assert);
}
static VIDEO_START( vegas_voodoo_banshee )
{
add_exit_callback(machine, vegas_exit);
voodoo_start(0, machine->primary_screen, VOODOO_BANSHEE, 16, 16, 0);
voodoo_set_vblank_callback(0, vblank_assert);
}
static VIDEO_START( vegas_voodoo3 )
{
add_exit_callback(machine, vegas_exit);
voodoo_start(0, machine->primary_screen, VOODOO_3, 16, 16, 16);
voodoo_set_vblank_callback(0, vblank_assert);
}
static VIDEO_UPDATE( vegas )
{
return voodoo_update(0, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED;
return voodoo_update(voodoo_device, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED;
}
@ -560,8 +526,24 @@ static VIDEO_UPDATE( vegas )
*
*************************************/
static MACHINE_RESET( vegas )
static MACHINE_START( vegas )
{
voodoo_device = device_list_find_by_tag(machine->config->devicelist, VOODOO_GRAPHICS, "voodoo");
/* allocate timers for the NILE */
timer[0] = timer_alloc(NULL, NULL);
timer[1] = timer_alloc(NULL, NULL);
timer[2] = timer_alloc(nile_timer_callback, NULL);
timer[3] = timer_alloc(nile_timer_callback, NULL);
/* identify our sound board */
if (mame_find_cpu_index(machine, "dsio") != -1)
dcs_idma_cs = 6;
else if (mame_find_cpu_index(machine, "denver") != -1)
dcs_idma_cs = 7;
else
dcs_idma_cs = 0;
/* set the fastest DRC options, but strict verification */
cpunum_set_info_int(0, CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY + MIPS3DRC_FLUSH_PC);
@ -577,13 +559,11 @@ static MACHINE_RESET( vegas )
cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff);
cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase);
cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1);
}
/* allocate timers for the NILE */
timer[0] = timer_alloc(NULL, NULL);
timer[1] = timer_alloc(NULL, NULL);
timer[2] = timer_alloc(nile_timer_callback, NULL);
timer[3] = timer_alloc(nile_timer_callback, NULL);
static MACHINE_RESET( vegas )
{
/* reset dynamic addressing */
memset(nile_regs, 0, 0x1000);
memset(pci_ide_regs, 0, sizeof(pci_ide_regs));
@ -597,23 +577,12 @@ static MACHINE_RESET( vegas )
}
/* reset subsystems */
devtag_reset(machine, IDE_CONTROLLER, "ide");
voodoo_reset(0);
smc91c94_reset(machine);
/* initialize IRQ states */
ide_irq_state = 0;
nile_irq_state = 0;
sio_irq_state = 0;
/* find out what type of voodoo we have */
voodoo_type = voodoo_get_type(0);
if (mame_find_cpu_index(machine, "dsio") != -1)
dcs_idma_cs = 6;
else if (mame_find_cpu_index(machine, "denver") != -1)
dcs_idma_cs = 7;
else
dcs_idma_cs = 0;
}
@ -806,6 +775,7 @@ static WRITE32_HANDLER( pci_ide_w )
static READ32_HANDLER( pci_3dfx_r )
{
int voodoo_type = voodoo_get_type(voodoo_device);
UINT32 result = pci_3dfx_regs[offset];
switch (offset)
@ -838,6 +808,8 @@ static READ32_HANDLER( pci_3dfx_r )
static WRITE32_HANDLER( pci_3dfx_w )
{
int voodoo_type = voodoo_get_type(voodoo_device);
pci_3dfx_regs[offset] = data;
switch (offset)
@ -875,7 +847,7 @@ static WRITE32_HANDLER( pci_3dfx_w )
break;
case 0x10: /* initEnable register */
voodoo_set_init_enable(0, data);
voodoo_set_init_enable(voodoo_device, data);
break;
}
@ -1569,6 +1541,7 @@ INLINE void _add_dynamic_device_address(const device_config *device, offs_t star
static void remap_dynamic_addresses(running_machine *machine)
{
const device_config *ide = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide");
int voodoo_type = voodoo_get_type(voodoo_device);
offs_t base;
int addr;
@ -1667,24 +1640,24 @@ static void remap_dynamic_addresses(running_machine *machine)
if (base >= ramsize && base < 0x20000000)
{
if (voodoo_type == VOODOO_2)
add_dynamic_address(base + 0x000000, base + 0xffffff, voodoo_0_r, voodoo_0_w);
add_dynamic_device_address(voodoo_device, base + 0x000000, base + 0xffffff, voodoo_r, voodoo_w);
else
add_dynamic_address(base + 0x000000, base + 0x1ffffff, banshee_0_r, banshee_0_w);
add_dynamic_device_address(voodoo_device, base + 0x000000, base + 0x1ffffff, banshee_r, banshee_w);
}
if (voodoo_type >= VOODOO_BANSHEE)
{
base = pci_3dfx_regs[0x05] & 0xfffffff0;
if (base >= ramsize && base < 0x20000000)
add_dynamic_address(base + 0x0000000, base + 0x1ffffff, banshee_fb_0_r, banshee_fb_0_w);
add_dynamic_device_address(voodoo_device, base + 0x0000000, base + 0x1ffffff, banshee_fb_r, banshee_fb_w);
base = pci_3dfx_regs[0x06] & 0xfffffff0;
if (base >= ramsize && base < 0x20000000)
add_dynamic_address(base + 0x0000000, base + 0x00000ff, banshee_io_0_r, banshee_io_0_w);
add_dynamic_device_address(voodoo_device, base + 0x0000000, base + 0x00000ff, banshee_io_r, banshee_io_w);
base = pci_3dfx_regs[0x0c] & 0xffff0000;
if (base >= ramsize && base < 0x20000000)
add_dynamic_address(base + 0x0000000, base + 0x000ffff, banshee_rom_0_r, NULL);
add_dynamic_device_address(voodoo_device, base + 0x0000000, base + 0x000ffff, banshee_rom_r, NULL);
}
}
@ -2231,11 +2204,17 @@ static MACHINE_DRIVER_START( vegascore )
MDRV_CPU_CONFIG(config)
MDRV_CPU_PROGRAM_MAP(vegas_map_8mb,0)
MDRV_MACHINE_START(vegas)
MDRV_MACHINE_RESET(vegas)
MDRV_NVRAM_HANDLER(timekeeper_save)
MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt)
MDRV_3DFX_VOODOO_2_ADD("voodoo", STD_VOODOO_2_CLOCK, 2, "main")
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 4)
MDRV_3DFX_VOODOO_TMU_MEMORY(1, 4)
MDRV_3DFX_VOODOO_VBLANK(vblank_assert)
/* video hardware */
MDRV_SCREEN_ADD("main", RASTER)
MDRV_SCREEN_REFRESH_RATE(57)
@ -2243,7 +2222,6 @@ static MACHINE_DRIVER_START( vegascore )
MDRV_SCREEN_SIZE(640, 480)
MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 479)
MDRV_VIDEO_START(vegas_voodoo2)
MDRV_VIDEO_UPDATE(vegas)
MACHINE_DRIVER_END
@ -2256,41 +2234,54 @@ MACHINE_DRIVER_END
static MACHINE_DRIVER_START( vegas250 )
MDRV_IMPORT_FROM(vegascore)
MDRV_CPU_REPLACE("main", R5000LE, SYSTEM_CLOCK*2.5)
MDRV_IMPORT_FROM(dcs2_audio_2104)
MDRV_CPU_REPLACE("main", R5000LE, SYSTEM_CLOCK*2.5)
MACHINE_DRIVER_END
static MACHINE_DRIVER_START( vegas32m )
MDRV_IMPORT_FROM(vegascore)
MDRV_IMPORT_FROM(dcs2_audio_dsio)
MDRV_CPU_MODIFY("main")
MDRV_CPU_PROGRAM_MAP(vegas_map_32mb,0)
MDRV_IMPORT_FROM(dcs2_audio_dsio)
MACHINE_DRIVER_END
static MACHINE_DRIVER_START( vegasban )
MDRV_IMPORT_FROM(vegascore)
MDRV_IMPORT_FROM(dcs2_audio_2104)
MDRV_CPU_MODIFY("main")
MDRV_CPU_PROGRAM_MAP(vegas_map_32mb,0)
MDRV_IMPORT_FROM(dcs2_audio_2104)
MDRV_VIDEO_START(vegas_voodoo_banshee)
MDRV_3DFX_VOODOO_REMOVE("voodoo")
MDRV_3DFX_VOODOO_BANSHEE_ADD("voodoo", STD_VOODOO_BANSHEE_CLOCK, 16, "main")
MDRV_3DFX_VOODOO_VBLANK(vblank_assert)
MACHINE_DRIVER_END
static MACHINE_DRIVER_START( vegasv3 )
MDRV_IMPORT_FROM(vegas32m)
MDRV_CPU_REPLACE("main", RM7000LE, SYSTEM_CLOCK*2.5)
MDRV_VIDEO_START(vegas_voodoo3)
MDRV_3DFX_VOODOO_REMOVE("voodoo")
MDRV_3DFX_VOODOO_3_ADD("voodoo", STD_VOODOO_3_CLOCK, 16, "main")
MDRV_3DFX_VOODOO_VBLANK(vblank_assert)
MACHINE_DRIVER_END
static MACHINE_DRIVER_START( denver )
MDRV_IMPORT_FROM(vegascore)
MDRV_IMPORT_FROM(dcs2_audio_denver)
MDRV_CPU_REPLACE("main", RM7000LE, SYSTEM_CLOCK*2.5)
MDRV_CPU_PROGRAM_MAP(vegas_map_32mb,0)
MDRV_VIDEO_START(vegas_voodoo3)
MDRV_IMPORT_FROM(dcs2_audio_denver)
MDRV_3DFX_VOODOO_REMOVE("voodoo")
MDRV_3DFX_VOODOO_3_ADD("voodoo", STD_VOODOO_3_CLOCK, 16, "main")
MDRV_3DFX_VOODOO_VBLANK(vblank_assert)
MACHINE_DRIVER_END
@ -2582,7 +2573,6 @@ static DRIVER_INIT( cartfury )
/*************************************
*
* Game drivers

View File

@ -39,21 +39,10 @@
static UINT8 backup_ram[0x2000];
static void viper_exit(running_machine *machine)
{
voodoo_exit(0);
}
static VIDEO_START(viper)
{
add_exit_callback(machine, viper_exit);
voodoo_start(0, machine->primary_screen, VOODOO_3, 16, 16, 16);
}
static VIDEO_UPDATE(viper)
{
return voodoo_update(0, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED;
const device_config *device = device_list_find_by_tag(screen->machine->config->devicelist, VOODOO_GRAPHICS, "voodoo");
return voodoo_update(device, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED;
}
@ -527,6 +516,7 @@ static void voodoo3_pci_w(int function, int reg, UINT32 data, UINT32 mem_mask)
}
}
#if 0
static READ64_HANDLER(voodoo3_io_r)
{
return read64be_with_32le_handler(banshee_io_0_r, machine, offset, mem_mask);
@ -556,7 +546,7 @@ static WRITE64_HANDLER(voodoo3_lfb_w)
// printf("voodoo3_lfb_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, activecpu_get_pc());
write64be_with_32le_handler(banshee_fb_0_w, machine, offset, data, mem_mask);
}
#endif
static READ64_HANDLER(m48t58_r)
@ -592,9 +582,9 @@ static WRITE64_HANDLER(m48t58_w)
static ADDRESS_MAP_START(viper_map, ADDRESS_SPACE_PROGRAM, 64)
AM_RANGE(0x00000000, 0x00ffffff) AM_MIRROR(0x1000000) AM_RAM
AM_RANGE(0x80000000, 0x800fffff) AM_READWRITE(epic_64be_r, epic_64be_w)
AM_RANGE(0x82000000, 0x83ffffff) AM_READWRITE(voodoo3_r, voodoo3_w)
AM_RANGE(0x84000000, 0x85ffffff) AM_READWRITE(voodoo3_lfb_r, voodoo3_lfb_w)
AM_RANGE(0xfe800000, 0xfe8000ff) AM_READWRITE(voodoo3_io_r, voodoo3_io_w)
AM_RANGE(0x82000000, 0x83ffffff) AM_DEVREADWRITE32(VOODOO_GRAPHICS, "voodoo", banshee_r, banshee_w, U64(0xffffffffffffffff))
AM_RANGE(0x84000000, 0x85ffffff) AM_DEVREADWRITE32(VOODOO_GRAPHICS, "voodoo", banshee_fb_r, banshee_fb_w, U64(0xffffffffffffffff))
AM_RANGE(0xfe800000, 0xfe8000ff) AM_DEVREADWRITE32(VOODOO_GRAPHICS, "voodoo", banshee_io_r, banshee_io_w, U64(0xffffffffffffffff))
AM_RANGE(0xfec00000, 0xfedfffff) AM_READWRITE(pci_config_addr_r, pci_config_addr_w)
AM_RANGE(0xfee00000, 0xfeefffff) AM_READWRITE(pci_config_data_r, pci_config_data_w)
AM_RANGE(0xff300000, 0xff300fff) AM_DEVREADWRITE(IDE_CONTROLLER, "ide", ata_r, ata_w)
@ -643,6 +633,7 @@ static MACHINE_DRIVER_START(viper)
MDRV_NVRAM_HANDLER(timekeeper_0)
MDRV_IDE_CONTROLLER_ADD("ide", 0, ide_interrupt)
MDRV_3DFX_VOODOO_3_ADD("voodoo", STD_VOODOO_3_CLOCK, 16, "main")
/* video hardware */
MDRV_SCREEN_ADD("main", RASTER)
@ -653,7 +644,6 @@ static MACHINE_DRIVER_START(viper)
MDRV_PALETTE_LENGTH(65536)
MDRV_VIDEO_START(viper)
MDRV_VIDEO_UPDATE(viper)
/* sound hardware */

View File

@ -435,7 +435,7 @@ static UINT32 K033906_r(int chip, int reg)
return 0;
}
static void K033906_w(int chip, int reg, UINT32 data)
static void K033906_w(running_machine *machine, int chip, int reg, UINT32 data)
{
switch(reg)
{
@ -466,7 +466,8 @@ static void K033906_w(int chip, int reg, UINT32 data)
case 0x10: // initEnable
{
voodoo_set_init_enable(chip, data);
const device_config *device = device_list_find_by_index(machine->config->devicelist, VOODOO_GRAPHICS, chip);
voodoo_set_init_enable(device, data);
break;
}
@ -505,7 +506,7 @@ WRITE32_HANDLER(K033906_0_w)
{
if (pci_bridge_enable[0])
{
K033906_w(0, offset, data);
K033906_w(machine, 0, offset, data);
}
else
{
@ -536,7 +537,7 @@ WRITE32_HANDLER(K033906_1_w)
{
if (pci_bridge_enable[1])
{
K033906_w(1, offset, data);
K033906_w(machine, 1, offset, data);
}
else
{
@ -546,7 +547,7 @@ WRITE32_HANDLER(K033906_1_w)
/*****************************************************************************/
WRITE32_HANDLER(nwk_fifo_0_w)
WRITE32_DEVICE_HANDLER(nwk_fifo_0_w)
{
if (nwk_device_sel[0] & 0x01)
{
@ -559,11 +560,11 @@ WRITE32_HANDLER(nwk_fifo_0_w)
}
else
{
voodoo_0_w(machine, offset ^ 0x80000, data, mem_mask);
voodoo_w(device, offset ^ 0x80000, data, mem_mask);
}
}
WRITE32_HANDLER(nwk_fifo_1_w)
WRITE32_DEVICE_HANDLER(nwk_fifo_1_w)
{
if (nwk_device_sel[1] & 0x01)
{
@ -576,11 +577,11 @@ WRITE32_HANDLER(nwk_fifo_1_w)
}
else
{
voodoo_1_w(machine, offset ^ 0x80000, data, mem_mask);
voodoo_w(device, offset ^ 0x80000, data, mem_mask);
}
}
READ32_HANDLER(nwk_voodoo_0_r)
READ32_DEVICE_HANDLER(nwk_voodoo_0_r)
{
if ((nwk_device_sel[0] == 0x4) && offset >= 0x100000 && offset < 0x200000)
{
@ -588,11 +589,11 @@ READ32_HANDLER(nwk_voodoo_0_r)
}
else
{
return voodoo_0_r(machine, offset, mem_mask);
return voodoo_r(device, offset, mem_mask);
}
}
READ32_HANDLER(nwk_voodoo_1_r)
READ32_DEVICE_HANDLER(nwk_voodoo_1_r)
{
if ((nwk_device_sel[1] == 0x4) && offset >= 0x100000 && offset < 0x200000)
{
@ -600,11 +601,11 @@ READ32_HANDLER(nwk_voodoo_1_r)
}
else
{
return voodoo_1_r(machine, offset, mem_mask);
return voodoo_r(device, offset, mem_mask);
}
}
WRITE32_HANDLER(nwk_voodoo_0_w)
WRITE32_DEVICE_HANDLER(nwk_voodoo_0_w)
{
if (nwk_device_sel[0] & 0x01)
{
@ -617,11 +618,11 @@ WRITE32_HANDLER(nwk_voodoo_0_w)
}
else
{
voodoo_0_w(machine, offset, data, mem_mask);
voodoo_w(device, offset, data, mem_mask);
}
}
WRITE32_HANDLER(nwk_voodoo_1_w)
WRITE32_DEVICE_HANDLER(nwk_voodoo_1_w)
{
if (nwk_device_sel[1] & 0x01)
{
@ -634,7 +635,7 @@ WRITE32_HANDLER(nwk_voodoo_1_w)
}
else
{
voodoo_1_w(machine, offset, data, mem_mask);
voodoo_w(device, offset, data, mem_mask);
}
}

View File

@ -32,12 +32,12 @@ WRITE32_HANDLER(K033906_0_w);
READ32_HANDLER(K033906_1_r);
WRITE32_HANDLER(K033906_1_w);
WRITE32_HANDLER(nwk_fifo_0_w);
WRITE32_HANDLER(nwk_fifo_1_w);
READ32_HANDLER(nwk_voodoo_0_r);
READ32_HANDLER(nwk_voodoo_1_r);
WRITE32_HANDLER(nwk_voodoo_0_w);
WRITE32_HANDLER(nwk_voodoo_1_w);
WRITE32_DEVICE_HANDLER(nwk_fifo_0_w);
WRITE32_DEVICE_HANDLER(nwk_fifo_1_w);
READ32_DEVICE_HANDLER(nwk_voodoo_0_r);
READ32_DEVICE_HANDLER(nwk_voodoo_1_r);
WRITE32_DEVICE_HANDLER(nwk_voodoo_0_w);
WRITE32_DEVICE_HANDLER(nwk_voodoo_1_w);
void draw_7segment_led(bitmap_t *bitmap, int x, int y, UINT8 value);