- Changed TLC34076 and games using it to RGB32

- Removed global Machine variable where possible
This commit is contained in:
Zsolt Vasvari 2008-01-14 02:38:35 +00:00
parent 25926f51b8
commit 171060dca7
20 changed files with 283 additions and 317 deletions

2
.gitattributes vendored
View File

@ -2279,7 +2279,6 @@ src/mame/includes/tatsumi.h svneol=native#text/plain
src/mame/includes/taxidrvr.h svneol=native#text/plain
src/mame/includes/thedeep.h svneol=native#text/plain
src/mame/includes/thunderj.h svneol=native#text/plain
src/mame/includes/tickee.h svneol=native#text/plain
src/mame/includes/tnzs.h svneol=native#text/plain
src/mame/includes/toaplan1.h svneol=native#text/plain
src/mame/includes/toobin.h svneol=native#text/plain
@ -3168,7 +3167,6 @@ src/mame/video/thunderx.c svneol=native#text/plain
src/mame/video/tia.c svneol=native#text/plain
src/mame/video/tia.h svneol=native#text/plain
src/mame/video/tiamc1.c svneol=native#text/plain
src/mame/video/tickee.c svneol=native#text/plain
src/mame/video/tigeroad.c svneol=native#text/plain
src/mame/video/timelimt.c svneol=native#text/plain
src/mame/video/timeplt.c svneol=native#text/plain

View File

@ -16,6 +16,7 @@ static UINT8 palettedata[3];
static UINT8 writeindex, readindex;
static UINT8 dacbits;
static rgb_t pens[0x100];
#define PALETTE_WRITE_ADDR 0x00
#define PALETTE_DATA 0x01
@ -33,29 +34,42 @@ static UINT8 dacbits;
/*************************************
*
* Palette update
* Retrieve Current Palette
*
*************************************/
static void update_palette(int which)
pen_t *tlc34076_get_pens(void)
{
int totalcolors = (Machine->drv->total_colors <= 256) ? Machine->drv->total_colors : 256;
int i, mask = regs[PIXEL_READ_MASK];
offs_t i;
for (i = 0; i < totalcolors; i++)
if (which == -1 || (i & mask) == which)
for (i = 0; i < 0x100; i++)
{
int r, g, b;
if ((i & regs[PIXEL_READ_MASK]) == i)
{
int r = local_paletteram[3 * i + 0];
int g = local_paletteram[3 * i + 1];
int b = local_paletteram[3 * i + 2];
r = local_paletteram[3 * i + 0];
g = local_paletteram[3 * i + 1];
b = local_paletteram[3 * i + 2];
if (dacbits == 6)
{
r = pal6bit(r);
g = pal6bit(g);
b = pal6bit(b);
}
palette_set_color(Machine, i, MAKE_RGB(r, g, b));
}
else
{
r = 0;
g = 0;
b = 0;
}
pens[i] = MAKE_RGB(r, g, b);
}
return pens;
}
@ -68,13 +82,9 @@ static void update_palette(int which)
void tlc34076_reset(int dacwidth)
{
/* set the DAC width */
assert_always((dacbits == 6) || (dacbits != 8), "tlc34076_reset: dacwidth must be 6 or 8!");
dacbits = dacwidth;
if (dacbits != 6 && dacbits != 8)
{
logerror("tlc34076_reset: dacwidth must be 6 or 8!\n");
dacbits = 6;
}
/* reset the registers */
regs[PIXEL_READ_MASK] = 0xff;
@ -156,7 +166,6 @@ WRITE8_HANDLER( tlc34076_w )
local_paletteram[3 * regs[PALETTE_WRITE_ADDR] + 0] = palettedata[0];
local_paletteram[3 * regs[PALETTE_WRITE_ADDR] + 1] = palettedata[1];
local_paletteram[3 * regs[PALETTE_WRITE_ADDR] + 2] = palettedata[2];
update_palette(regs[PALETTE_WRITE_ADDR]);
writeindex = 0;
regs[PALETTE_WRITE_ADDR]++;
}
@ -219,11 +228,6 @@ WRITE8_HANDLER( tlc34076_w )
*/
break;
case PIXEL_READ_MASK:
case PALETTE_PAGE:
update_palette(-1);
break;
case RESET_STATE:
tlc34076_reset(dacbits);
break;

View File

@ -9,6 +9,8 @@
void tlc34076_reset(int dacwidth);
pen_t *tlc34076_get_pens(void);
READ8_HANDLER( tlc34076_r );
WRITE8_HANDLER( tlc34076_w );

View File

@ -35,6 +35,7 @@ struct tms34061_data
UINT8 * shiftreg;
emu_timer * timer;
struct tms34061_interface intf;
running_machine *machine;
};
@ -74,10 +75,11 @@ static TIMER_CALLBACK( tms34061_interrupt );
*
*************************************/
void tms34061_start(const struct tms34061_interface *interface)
void tms34061_start(running_machine *machine, const struct tms34061_interface *interface)
{
/* reset the data */
memset(&tms34061, 0, sizeof(tms34061));
tms34061.machine = machine;
tms34061.intf = *interface;
tms34061.vrammask = tms34061.intf.vramsize - 1;
@ -135,9 +137,9 @@ INLINE void update_interrupts(void)
{
/* if the status bit is set, and ints are enabled, turn it on */
if ((tms34061.regs[TMS34061_STATUS] & 0x0001) && (tms34061.regs[TMS34061_CONTROL1] & 0x0400))
(*tms34061.intf.interrupt)(ASSERT_LINE);
(*tms34061.intf.interrupt)(tms34061.machine, ASSERT_LINE);
else
(*tms34061.intf.interrupt)(CLEAR_LINE);
(*tms34061.intf.interrupt)(tms34061.machine, CLEAR_LINE);
}
}

View File

@ -37,26 +37,26 @@ enum
/* interface structure */
struct tms34061_interface
{
int scrnum; /* the screen we are acting on */
UINT8 rowshift; /* VRAM address is (row << rowshift) | col */
UINT32 vramsize; /* size of video RAM */
void (*interrupt)(int state); /* interrupt gen callback */
int scrnum; /* the screen we are acting on */
UINT8 rowshift; /* VRAM address is (row << rowshift) | col */
UINT32 vramsize; /* size of video RAM */
void (*interrupt)(running_machine *machine, int state); /* interrupt gen callback */
};
/* display state structure */
struct tms34061_display
{
UINT8 blanked; /* true if blanked */
UINT8 * vram; /* base of VRAM */
UINT8 * latchram; /* base of latch RAM */
UINT16 * regs; /* pointer to array of registers */
offs_t dispstart; /* display start */
UINT8 blanked; /* true if blanked */
UINT8 *vram; /* base of VRAM */
UINT8 *latchram; /* base of latch RAM */
UINT16 *regs; /* pointer to array of registers */
offs_t dispstart; /* display start */
};
/* starts/stops the emulator */
void tms34061_start(const struct tms34061_interface *interface);
void tms34061_start(running_machine *machine, const struct tms34061_interface *interface);
/* reads/writes to the 34061 */
UINT8 tms34061_r(int col, int row, int func);

View File

@ -38,7 +38,7 @@ static UINT8 prot_output_bit;
static UINT8 prot_bit_index;
static UINT16 prot_save;
static void (*protection_handler)(void);
static void (*protection_handler)(running_machine *);
@ -152,14 +152,14 @@ static READ16_HANDLER( ultennis_hack_r )
*
*************************************/
static void ultennis_protection(void)
static void ultennis_protection(running_machine *machine)
{
/* check the command byte */
switch (prot_input[0])
{
case 0x00: /* reset */
prot_input_index = prot_output_index = 0;
prot_output[0] = mame_rand(Machine);
prot_output[0] = mame_rand(machine);
break;
case 0x01: /* 01 aaaa bbbb cccc dddd (xxxx) */
@ -242,14 +242,14 @@ static void ultennis_protection(void)
}
static void cheesech_protection(void)
static void cheesech_protection(running_machine *machine)
{
/* check the command byte */
switch (prot_input[0])
{
case 0x00: /* reset */
prot_input_index = prot_output_index = 0;
prot_output[0] = mame_rand(Machine);
prot_output[0] = mame_rand(machine);
break;
case 0x01: /* 01 aaaa bbbb (xxxx) */
@ -302,7 +302,7 @@ static void cheesech_protection(void)
}
static void stonebal_protection(void)
static void stonebal_protection(running_machine *machine)
{
/* check the command byte */
switch (prot_input[0])
@ -394,7 +394,7 @@ static WRITE16_HANDLER( protection_bit_w )
prot_bit_index = 0;
/* update the protection state */
(*protection_handler)();
(*protection_handler)(Machine);
}
}
@ -733,15 +733,13 @@ static MACHINE_DRIVER_START( artmagic )
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
MDRV_PALETTE_LENGTH(256)
MDRV_SCREEN_ADD("main", 0)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK_40MHz/6, 428, 0, 320, 313, 0, 256)
MDRV_VIDEO_START(artmagic)
MDRV_VIDEO_UPDATE(tms340x0)
MDRV_SCREEN_ADD("main", 0)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK_40MHz/6, 428, 0, 320, 313, 0, 256)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")

View File

@ -354,15 +354,13 @@ static MACHINE_DRIVER_START( btoads )
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
MDRV_PALETTE_LENGTH(256)
MDRV_SCREEN_ADD("main", 0)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MDRV_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 640, 0, 512, 257, 0, 224)
MDRV_VIDEO_START(btoads)
MDRV_VIDEO_UPDATE(tms340x0)
MDRV_SCREEN_ADD("main", 0)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
MDRV_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 640, 0, 512, 257, 0, 224)
/* sound hardware */
MDRV_SPEAKER_STANDARD_STEREO("left", "right")

View File

@ -349,29 +349,27 @@ static const struct YM2203interface ym2203_interface =
static MACHINE_DRIVER_START( capbowl )
/* basic machine hardware */
MDRV_CPU_ADD_TAG("main", M6809E, MASTER_CLOCK)
MDRV_CPU_ADD_TAG("main", M6809E, MASTER_CLOCK/4)
MDRV_CPU_PROGRAM_MAP(capbowl_map,0)
MDRV_CPU_VBLANK_INT(capbowl_interrupt,1)
MDRV_CPU_ADD(M6809E, MASTER_CLOCK)
/* audio CPU */
MDRV_CPU_ADD(M6809E, MASTER_CLOCK/4)
MDRV_CPU_PROGRAM_MAP(sound_map,0)
MDRV_SCREEN_REFRESH_RATE(57)
MDRV_MACHINE_RESET(capbowl)
MDRV_NVRAM_HANDLER(capbowl)
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MDRV_SCREEN_SIZE(360, 256)
MDRV_SCREEN_VISIBLE_AREA(0, 359, 0, 244)
MDRV_PALETTE_LENGTH(4096)
MDRV_VIDEO_START(capbowl)
MDRV_VIDEO_UPDATE(capbowl)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
MDRV_SCREEN_SIZE(360, 256)
MDRV_SCREEN_VISIBLE_AREA(0, 359, 0, 244)
MDRV_SCREEN_REFRESH_RATE(57)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")

View File

@ -78,7 +78,8 @@ static TIMER_CALLBACK( nvram_write_timeout );
static void amerdart_scanline(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params)
{
UINT16 *vram = &vram_base[(params->rowaddr << 8) & 0xff00];
UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
rgb_t pens[16];
int coladdr = params->coladdr;
int x;
@ -87,16 +88,16 @@ static void amerdart_scanline(running_machine *machine, int screen, mame_bitmap
for (x = 0; x < 16; x++)
{
UINT16 pal = vram_base[x];
palette_set_color_rgb(machine, scanline * 16 + x, pal4bit(pal >> 4), pal4bit(pal >> 8), pal4bit(pal >> 12));
pens[x] = MAKE_RGB(pal4bit(pal >> 4), pal4bit(pal >> 8), pal4bit(pal >> 12));
}
for (x = params->heblnk; x < params->hsblnk; x += 4)
{
UINT16 pixels = vram[coladdr++ & 0xff];
dest[x + 0] = scanline * 16 + ((pixels >> 0) & 15);
dest[x + 1] = scanline * 16 + ((pixels >> 4) & 15);
dest[x + 2] = scanline * 16 + ((pixels >> 8) & 15);
dest[x + 3] = scanline * 16 + ((pixels >> 12) & 15);
dest[x + 0] = pens[(pixels >> 0) & 15];
dest[x + 1] = pens[(pixels >> 4) & 15];
dest[x + 2] = pens[(pixels >> 8) & 15];
dest[x + 3] = pens[(pixels >> 12) & 15];
}
}
@ -104,15 +105,16 @@ static void amerdart_scanline(running_machine *machine, int screen, mame_bitmap
static void coolpool_scanline(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params)
{
UINT16 *vram = &vram_base[(params->rowaddr << 8) & 0x1ff00];
UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
rgb_t *pens = tlc34076_get_pens();
int coladdr = params->coladdr;
int x;
for (x = params->heblnk; x < params->hsblnk; x += 2)
{
UINT16 pixels = vram[coladdr++ & 0xff];
dest[x + 0] = pixels & 0xff;
dest[x + 1] = pixels >> 8;
dest[x + 0] = pens[pixels & 0xff];
dest[x + 1] = pens[pixels >> 8];
}
}
@ -686,7 +688,7 @@ static MACHINE_DRIVER_START( amerdart )
MDRV_CPU_CONFIG(tms_config_amerdart)
MDRV_CPU_PROGRAM_MAP(amerdart_map,0)
MDRV_CPU_ADD(TMS32010, 15000000/2)
MDRV_CPU_ADD(TMS32010, 15000000/8)
MDRV_CPU_FLAGS(CPU_DISABLE)
MDRV_CPU_PROGRAM_MAP(amerdart_dsp_map,0)
@ -695,14 +697,12 @@ static MACHINE_DRIVER_START( amerdart )
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
MDRV_PALETTE_LENGTH(16*256)
MDRV_VIDEO_UPDATE(tms340x0)
MDRV_SCREEN_ADD("main", 0)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
MDRV_SCREEN_RAW_PARAMS(40000000/6, 212*2, 0, 161*2, 262, 0, 241)
MDRV_VIDEO_UPDATE(tms340x0)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")
@ -727,14 +727,12 @@ static MACHINE_DRIVER_START( coolpool )
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
MDRV_PALETTE_LENGTH(256)
MDRV_VIDEO_UPDATE(tms340x0)
MDRV_SCREEN_ADD("main", 0)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
MDRV_SCREEN_RAW_PARAMS(40000000/6, 424, 0, 320, 262, 0, 240)
MDRV_VIDEO_UPDATE(tms340x0)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")

View File

@ -463,7 +463,6 @@
#include "sound/2203intf.h"
#include "sound/3812intf.h"
#include "sound/okim6295.h"
#include <math.h>
#define FULL_LOGGING 0
@ -538,7 +537,7 @@ static const struct via6522_interface via_interface =
*
*************************************/
void itech8_update_interrupts(int periodic, int tms34061, int blitter)
void itech8_update_interrupts(running_machine *machine, int periodic, int tms34061, int blitter)
{
/* update the states */
if (periodic != -1) periodic_int = periodic;
@ -546,7 +545,7 @@ void itech8_update_interrupts(int periodic, int tms34061, int blitter)
if (blitter != -1) blitter_int = blitter;
/* handle the 6809 case */
if (Machine->drv->cpu[0].type == CPU_M6809)
if (machine->drv->cpu[0].type == CPU_M6809)
{
/* just modify lines that have changed */
if (periodic != -1) cpunum_set_input_line(0, INPUT_LINE_NMI, periodic ? ASSERT_LINE : CLEAR_LINE);
@ -582,8 +581,8 @@ void itech8_update_interrupts(int periodic, int tms34061, int blitter)
static INTERRUPT_GEN( generate_nmi )
{
/* signal the NMI */
itech8_update_interrupts(1, -1, -1);
itech8_update_interrupts(0, -1, -1);
itech8_update_interrupts(machine, 1, -1, -1);
itech8_update_interrupts(machine, 0, -1, -1);
if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", video_screen_get_vpos(0));
}
@ -1774,12 +1773,11 @@ static MACHINE_DRIVER_START( itech8_core_lo )
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MDRV_SCREEN_SIZE(512, 263)
MDRV_PALETTE_LENGTH(256)
MDRV_VIDEO_START(itech8)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
MDRV_SCREEN_SIZE(512, 263)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")

View File

@ -18,12 +18,119 @@
#include "cpu/tms34010/tms34010.h"
#include "machine/ticket.h"
#include "video/tlc34076.h"
#include "tickee.h"
#include "sound/ay8910.h"
UINT16 *tickee_control;
/* local variables */
static UINT16 *tickee_control;
static UINT16 *tickee_vram;
static emu_timer *setup_gun_timer;
/*************************************
*
* Compute X/Y coordinates
*
*************************************/
INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *y)
{
*x = (((readinputport(4 + player * 2) & 0xff) * (machine->screen[0].visarea.max_x - machine->screen[0].visarea.min_x)) >> 8) + machine->screen[0].visarea.min_x;
*y = (((readinputport(5 + player * 2) & 0xff) * (machine->screen[0].visarea.max_y - machine->screen[0].visarea.min_y)) >> 8) + machine->screen[0].visarea.min_y;
}
/*************************************
*
* Light gun interrupts
*
*************************************/
static TIMER_CALLBACK( trigger_gun_interrupt )
{
/* fire the IRQ at the correct moment */
cpunum_set_input_line(0, param, ASSERT_LINE);
}
static TIMER_CALLBACK( clear_gun_interrupt )
{
/* clear the IRQ on the next scanline? */
cpunum_set_input_line(0, param, CLEAR_LINE);
}
static TIMER_CALLBACK( setup_gun_interrupts )
{
int beamx, beamy;
/* set a timer to do this again next frame */
timer_adjust(setup_gun_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
/* only do work if the palette is flashed */
if (!tickee_control[2])
return;
/* generate interrupts for player 1's gun */
get_crosshair_xy(machine, 0, &beamx, &beamy);
timer_set(video_screen_get_time_until_pos(0, beamy, beamx + 50), NULL, 0, trigger_gun_interrupt);
timer_set(video_screen_get_time_until_pos(0, beamy + 1, beamx + 50), NULL, 0, clear_gun_interrupt);
/* generate interrupts for player 2's gun */
get_crosshair_xy(machine, 1, &beamx, &beamy);
timer_set(video_screen_get_time_until_pos(0, beamy, beamx + 50), NULL, 1, trigger_gun_interrupt);
timer_set(video_screen_get_time_until_pos(0, beamy + 1, beamx + 50), NULL, 1, clear_gun_interrupt);
}
/*************************************
*
* Video startup
*
*************************************/
static VIDEO_START( tickee )
{
/* start a timer going on the first scanline of every frame */
setup_gun_timer = timer_alloc(setup_gun_interrupts, NULL);
timer_adjust(setup_gun_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
}
/*************************************
*
* Video update
*
*************************************/
static void scanline_update(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params)
{
UINT16 *src = &tickee_vram[(params->rowaddr << 8) & 0x3ff00];
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
rgb_t *pens = tlc34076_get_pens();
int coladdr = params->coladdr << 1;
int x;
/* blank palette: fill with pen 255 */
if (tickee_control[2])
{
for (x = params->heblnk; x < params->hsblnk; x++)
dest[x] = pens[0xff];
}
else
/* copy the non-blanked portions of this scanline */
for (x = params->heblnk; x < params->hsblnk; x += 2)
{
UINT16 pixels = src[coladdr++ & 0xff];
dest[x + 0] = pens[pixels & 0xff];
dest[x + 1] = pens[pixels >> 8];
}
}
/*************************************
@ -287,7 +394,7 @@ static const tms34010_config tms_config =
0, /* the screen operated on */
14318180/2, /* pixel clock */
1, /* pixels per clock */
tickee_scanline_update, /* scanline callback */
scanline_update, /* scanline callback */
NULL, /* generate interrupt */
NULL, /* write to shiftreg function */
NULL /* read from shiftreg function */
@ -313,15 +420,13 @@ static MACHINE_DRIVER_START( tickee )
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
MDRV_PALETTE_LENGTH(256)
MDRV_SCREEN_ADD("main", 0)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MDRV_SCREEN_RAW_PARAMS(14318180/2, 444, 0, 320, 233, 0, 200)
MDRV_VIDEO_START(tickee)
MDRV_VIDEO_UPDATE(tms340x0)
MDRV_SCREEN_ADD("main", 0)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
MDRV_SCREEN_RAW_PARAMS(14318180/2, 444, 0, 320, 233, 0, 200)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")

View File

@ -48,7 +48,8 @@ static MACHINE_RESET( xtheball )
static void xtheball_scanline_update(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params)
{
UINT16 *srcbg = &vram_bg[(params->rowaddr << 8) & 0xff00];
UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
rgb_t *pens = tlc34076_get_pens();
int coladdr = params->coladdr;
int x;
@ -63,8 +64,8 @@ static void xtheball_scanline_update(running_machine *machine, int screen, mame_
UINT16 fgpix = srcfg[coladdr & 0xff];
UINT16 bgpix = srcbg[coladdr & 0xff];
dest[x + 0] = ((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix & 0xff);
dest[x + 1] = ((fgpix & 0xff00) != 0) ? (fgpix >> 8) : (bgpix >> 8);
dest[x + 0] = pens[((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix & 0xff)];
dest[x + 1] = pens[((fgpix & 0xff00) != 0) ? (fgpix >> 8) : (bgpix >> 8)];
}
}
else
@ -78,8 +79,8 @@ static void xtheball_scanline_update(running_machine *machine, int screen, mame_
UINT16 fgpix = srcfg[(coladdr >> 1) & 0xff] >> (8 * (coladdr & 1));
UINT16 bgpix = srcbg[coladdr & 0xff];
dest[x + 0] = ((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix & 0xff);
dest[x + 1] = ((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix >> 8);
dest[x + 0] = pens[((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix & 0xff)];
dest[x + 1] = pens[((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix >> 8)];
}
}
@ -365,16 +366,14 @@ static MACHINE_DRIVER_START( xtheball )
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
MDRV_PALETTE_LENGTH(256)
MDRV_VIDEO_UPDATE(tms340x0)
MDRV_SCREEN_ADD("main", 0)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
MDRV_SCREEN_SIZE(512,256)
MDRV_SCREEN_VISIBLE_AREA(0,511, 24,247)
MDRV_SCREEN_REFRESH_RATE(60)
MDRV_VIDEO_UPDATE(tms340x0)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")

View File

@ -7,7 +7,7 @@
/*----------- defined in drivers/itech8.c -----------*/
void itech8_update_interrupts(int periodic, int tms34061, int blitter);
void itech8_update_interrupts(running_machine *machine, int periodic, int tms34061, int blitter);
/*----------- defined in machine/slikshot.c -----------*/

View File

@ -1,18 +0,0 @@
/*************************************************************************
Raster Elite Tickee Tickats hardware
**************************************************************************/
/*----------- defined in drivers/tickee.c -----------*/
extern UINT16 *tickee_control;
/*----------- defined in video/tickee.c -----------*/
extern UINT16 *tickee_vram;
VIDEO_START( tickee );
void tickee_scanline_update(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params);

View File

@ -1606,7 +1606,7 @@ $(MAMEOBJ)/misc.a: \
$(DRIVERS)/thayers.o \
$(DRIVERS)/thedeep.o $(VIDEO)/thedeep.o \
$(DRIVERS)/tiamc1.o $(VIDEO)/tiamc1.o $(AUDIO)/tiamc1.o \
$(DRIVERS)/tickee.o $(VIDEO)/tickee.o \
$(DRIVERS)/tickee.o \
$(DRIVERS)/truco.o $(VIDEO)/truco.o \
$(DRIVERS)/trucocl.o $(VIDEO)/trucocl.o \
$(DRIVERS)/trvmadns.o \

View File

@ -8,6 +8,7 @@
#include "profiler.h"
#include "cpu/tms34010/tms34010.h"
#include "cpu/tms34010/34010ops.h"
#include "video/tlc34076.h"
#include "artmagic.h"
@ -349,11 +350,12 @@ void artmagic_scanline(running_machine *machine, int screen, mame_bitmap *bitmap
{
offs_t offset = (params->rowaddr << 12) & 0x7ff000;
UINT16 *vram = address_to_vram(&offset);
UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
rgb_t *pens = tlc34076_get_pens();
int coladdr = params->coladdr << 1;
int x;
vram += offset;
for (x = params->heblnk; x < params->hsblnk; x++)
dest[x] = vram[coladdr++ & 0x1ff] & 0xff;
dest[x] = pens[vram[coladdr++ & 0x1ff] & 0xff];
}

View File

@ -347,7 +347,8 @@ void btoads_scanline_update(running_machine *machine, int screen, mame_bitmap *b
UINT16 *bg0_base = &btoads_vram_bg0[(fulladdr + (yscroll0 << 10)) & 0x3fc00];
UINT16 *bg1_base = &btoads_vram_bg1[(fulladdr + (yscroll1 << 10)) & 0x3fc00];
UINT8 *spr_base = &vram_fg_display[fulladdr & 0x3fc00];
UINT16 *dst = BITMAP_ADDR16(bitmap, scanline, 0);
UINT32 *dst = BITMAP_ADDR32(bitmap, scanline, 0);
rgb_t *pens = tlc34076_get_pens();
int coladdr = fulladdr & 0x3ff;
int x;
@ -369,8 +370,8 @@ void btoads_scanline_update(running_machine *machine, int screen, mame_bitmap *b
if (sprpix && !(sprpix & 0x80))
{
dst[x + 0] = sprpix;
dst[x + 1] = sprpix;
dst[x + 0] = pens[sprpix];
dst[x + 1] = pens[sprpix];
}
else
{
@ -379,22 +380,22 @@ void btoads_scanline_update(running_machine *machine, int screen, mame_bitmap *b
UINT8 sprpix = spr_base[coladdr & 0xff];
if (bg1pix & 0x80)
dst[x + 0] = bg1pix & 0xff;
dst[x + 0] = pens[bg1pix & 0xff];
else if (sprpix)
dst[x + 0] = sprpix;
dst[x + 0] = pens[sprpix];
else if (bg1pix & 0xff)
dst[x + 0] = bg1pix & 0xff;
dst[x + 0] = pens[bg1pix & 0xff];
else
dst[x + 0] = bg0pix & 0xff;
dst[x + 0] = pens[bg0pix & 0xff];
if (bg1pix & 0x8000)
dst[x + 1] = bg1pix >> 8;
dst[x + 1] = pens[bg1pix >> 8];
else if (sprpix)
dst[x + 1] = sprpix;
dst[x + 1] = pens[sprpix];
else if (bg1pix >> 8)
dst[x + 1] = bg1pix >> 8;
dst[x + 1] = pens[bg1pix >> 8];
else
dst[x + 1] = bg0pix >> 8;
dst[x + 1] = pens[bg0pix >> 8];
}
}
break;
@ -414,8 +415,8 @@ void btoads_scanline_update(running_machine *machine, int screen, mame_bitmap *b
if (sprpix && !(sprpix & 0x80))
{
dst[x + 0] = sprpix;
dst[x + 1] = sprpix;
dst[x + 0] = pens[sprpix];
dst[x + 1] = pens[sprpix];
}
else
{
@ -423,22 +424,22 @@ void btoads_scanline_update(running_machine *machine, int screen, mame_bitmap *b
UINT16 bg1pix = bg1_base[(coladdr + xscroll1) & 0xff];
if (bg0pix & 0xff)
dst[x + 0] = bg0pix & 0xff;
dst[x + 0] = pens[bg0pix & 0xff];
else if (bg1pix & 0x80)
dst[x + 0] = bg1pix & 0xff;
dst[x + 0] = pens[bg1pix & 0xff];
else if (sprpix)
dst[x + 0] = sprpix;
dst[x + 0] = pens[sprpix];
else
dst[x + 0] = bg1pix & 0xff;
dst[x + 0] = pens[bg1pix & 0xff];
if (bg0pix >> 8)
dst[x + 1] = bg0pix >> 8;
dst[x + 1] = pens[bg0pix >> 8];
else if (bg1pix & 0x8000)
dst[x + 1] = bg1pix >> 8;
dst[x + 1] = pens[bg1pix >> 8];
else if (sprpix)
dst[x + 1] = sprpix;
dst[x + 1] = pens[sprpix];
else
dst[x + 1] = bg1pix >> 8;
dst[x + 1] = pens[bg1pix >> 8];
}
}
break;
@ -456,8 +457,8 @@ void btoads_scanline_update(running_machine *machine, int screen, mame_bitmap *b
if (sprpix)
{
dst[x + 0] = sprpix;
dst[x + 1] = sprpix;
dst[x + 0] = pens[sprpix];
dst[x + 1] = pens[sprpix];
}
else
{
@ -465,14 +466,14 @@ void btoads_scanline_update(running_machine *machine, int screen, mame_bitmap *b
UINT16 bg1pix = bg1_base[(coladdr + xscroll1) & 0xff];
if (bg1pix & 0xff)
dst[x + 0] = bg1pix & 0xff;
dst[x + 0] = pens[bg1pix & 0xff];
else
dst[x + 0] = bg0pix & 0xff;
dst[x + 0] = pens[bg0pix & 0xff];
if (bg1pix >> 8)
dst[x + 1] = bg1pix >> 8;
dst[x + 1] = pens[bg1pix >> 8];
else
dst[x + 1] = bg0pix >> 8;
dst[x + 1] = pens[bg0pix >> 8];
}
}
break;
@ -493,26 +494,26 @@ void btoads_scanline_update(running_machine *machine, int screen, mame_bitmap *b
UINT8 sprpix = spr_base[coladdr & 0xff];
if (bg1pix & 0x80)
dst[x + 0] = bg1pix & 0xff;
dst[x + 0] = pens[bg1pix & 0xff];
else if (sprpix & 0x80)
dst[x + 0] = sprpix;
dst[x + 0] = pens[sprpix];
else if (bg1pix & 0xff)
dst[x + 0] = bg1pix & 0xff;
dst[x + 0] = pens[bg1pix & 0xff];
else if (sprpix)
dst[x + 0] = sprpix;
dst[x + 0] = pens[sprpix];
else
dst[x + 0] = bg0pix & 0xff;
dst[x + 0] = pens[bg0pix & 0xff];
if (bg1pix & 0x8000)
dst[x + 1] = bg1pix >> 8;
dst[x + 1] = pens[bg1pix >> 8];
else if (sprpix & 0x80)
dst[x + 1] = sprpix;
dst[x + 1] = pens[sprpix];
else if (bg1pix >> 8)
dst[x + 1] = bg1pix >> 8;
dst[x + 1] = pens[bg1pix >> 8];
else if (sprpix)
dst[x + 1] = sprpix;
dst[x + 1] = pens[sprpix];
else
dst[x + 1] = bg0pix >> 8;
dst[x + 1] = pens[bg0pix >> 8];
}
break;
}

View File

@ -21,7 +21,7 @@ static offs_t blitter_addr;
*
*************************************/
static void generate_interrupt(int state)
static void generate_interrupt(running_machine *machine, int state)
{
cpunum_set_input_line(0, M6809_FIRQ_LINE, state);
}
@ -45,7 +45,7 @@ static const struct tms34061_interface tms34061intf =
VIDEO_START( capbowl )
{
/* initialize TMS34061 emulation */
tms34061_start(&tms34061intf);
tms34061_start(machine, &tms34061intf);
}
@ -156,6 +156,14 @@ READ8_HANDLER( bowlrama_blitter_r )
*
*************************************/
INLINE rgb_t pen_for_pixel(UINT8 *src, UINT8 pix)
{
return MAKE_RGB(pal4bit(src[(pix << 1) + 0] >> 0),
pal4bit(src[(pix << 1) + 1] >> 4),
pal4bit(src[(pix << 1) + 1] >> 0));
}
VIDEO_UPDATE( capbowl )
{
struct tms34061_display state;
@ -174,23 +182,14 @@ VIDEO_UPDATE( capbowl )
/* now regenerate the bitmap */
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
UINT8 *src = &state.vram[256 * y];
int ybase = 16 * y;
UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
/* first update the palette for this scanline */
for (x = 0; x < 16; x++)
{
palette_set_color_rgb(machine, ybase + x, pal4bit(src[0]), pal4bit(src[1] >> 4), pal4bit(src[1]));
src += 2;
}
/* expand row to 8bpp */
for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
{
int pix = src[x/2];
*dest++ = ybase + (pix >> 4);
*dest++ = ybase + (pix & 0x0f);
UINT8 pix = src[32 + (x / 2)];
*dest++ = pen_for_pixel(src, pix >> 4);
*dest++ = pen_for_pixel(src, pix & 0x0f);
}
}
return 0;

View File

@ -162,9 +162,9 @@ static UINT32 grom_size;
*
*************************************/
static void generate_interrupt(int state)
static void generate_interrupt(running_machine *machine, int state)
{
itech8_update_interrupts(-1, state, -1);
itech8_update_interrupts(machine, -1, state, -1);
if (FULL_LOGGING && state) logerror("------------ DISPLAY INT (%d) --------------\n", video_screen_get_vpos(0));
}
@ -189,7 +189,7 @@ static const struct tms34061_interface tms34061intf =
VIDEO_START( itech8 )
{
/* initialize TMS34061 emulation */
tms34061_start(&tms34061intf);
tms34061_start(machine, &tms34061intf);
/* get the TMS34061 display state */
tms34061_get_display_state(&tms_state);
@ -443,7 +443,7 @@ static TIMER_CALLBACK( blitter_done )
{
/* turn off blitting and generate an interrupt */
blit_in_progress = 0;
itech8_update_interrupts(-1, -1, 1);
itech8_update_interrupts(machine, -1, -1, 1);
if (FULL_LOGGING) logerror("------------ BLIT DONE (%d) --------------\n", video_screen_get_vpos(0));
}
@ -469,7 +469,7 @@ READ8_HANDLER( itech8_blitter_r )
/* a read from offset 3 clears the interrupt and returns the status */
if (offset == 3)
{
itech8_update_interrupts(-1, -1, 0);
itech8_update_interrupts(Machine, -1, -1, 0);
if (blit_in_progress)
result |= 0x80;
else
@ -573,6 +573,7 @@ VIDEO_UPDATE( itech8_2layer )
{
UINT32 page_offset;
int x, y;
rgb_t *pens = tlc34076_get_pens();
/* first get the current display state */
tms34061_get_display_state(&tms_state);
@ -592,12 +593,12 @@ VIDEO_UPDATE( itech8_2layer )
{
UINT8 *base0 = &tms_state.vram[(0x00000 + page_offset + y * 256) & 0x3ffff];
UINT8 *base2 = &tms_state.vram[(0x20000 + page_offset + y * 256) & 0x3ffff];
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
for (x = cliprect->min_x; x <= cliprect->max_x; x++)
{
int pix0 = base0[x] & 0x0f;
dest[x] = pix0 ? pix0 : base2[x];
dest[x] = pens[pix0 ? pix0 : base2[x]];
}
}
return 0;
@ -608,6 +609,7 @@ VIDEO_UPDATE( itech8_2page )
{
UINT32 page_offset;
int x, y;
rgb_t *pens = tlc34076_get_pens();
/* first get the current display state */
tms34061_get_display_state(&tms_state);
@ -625,10 +627,10 @@ VIDEO_UPDATE( itech8_2page )
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
{
UINT8 *base = &tms_state.vram[(page_offset + y * 256) & 0x3ffff];
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
for (x = cliprect->min_x; x <= cliprect->max_x; x++)
dest[x] = base[x];
dest[x] = pens[base[x]];
}
return 0;
}
@ -638,6 +640,7 @@ VIDEO_UPDATE( itech8_2page_large )
{
UINT32 page_offset;
int x, y;
rgb_t *pens = tlc34076_get_pens();
/* first get the current display state */
tms34061_get_display_state(&tms_state);
@ -658,12 +661,12 @@ VIDEO_UPDATE( itech8_2page_large )
{
UINT8 *base = &tms_state.vram[(page_offset + y * 256) & 0x3ffff];
UINT8 *latch = &tms_state.latchram[(page_offset + y * 256) & 0x3ffff];
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
{
dest[x + 0] = (latch[x/2] & 0xf0) | (base[x/2] >> 4);
dest[x + 1] = ((latch[x/2] << 4) & 0xf0) | (base[x/2] & 0x0f);
dest[x + 0] = pens[(latch[x/2] & 0xf0) | (base[x/2] >> 4)];
dest[x + 1] = pens[((latch[x/2] << 4) & 0xf0) | (base[x/2] & 0x0f)];
}
}
return 0;

View File

@ -1,121 +0,0 @@
/***************************************************************************
Raster Elite Tickee Tickats hardware
***************************************************************************/
#include "driver.h"
#include "cpu/tms34010/tms34010.h"
#include "tickee.h"
UINT16 *tickee_vram;
/* local variables */
static emu_timer *setup_gun_timer;
/*************************************
*
* Compute X/Y coordinates
*
*************************************/
INLINE void get_crosshair_xy(int player, int *x, int *y)
{
*x = (((readinputport(4 + player * 2) & 0xff) * (Machine->screen[0].visarea.max_x - Machine->screen[0].visarea.min_x)) >> 8) + Machine->screen[0].visarea.min_x;
*y = (((readinputport(5 + player * 2) & 0xff) * (Machine->screen[0].visarea.max_y - Machine->screen[0].visarea.min_y)) >> 8) + Machine->screen[0].visarea.min_y;
}
/*************************************
*
* Light gun interrupts
*
*************************************/
static TIMER_CALLBACK( trigger_gun_interrupt )
{
/* fire the IRQ at the correct moment */
cpunum_set_input_line(0, param, ASSERT_LINE);
}
static TIMER_CALLBACK( clear_gun_interrupt )
{
/* clear the IRQ on the next scanline? */
cpunum_set_input_line(0, param, CLEAR_LINE);
}
static TIMER_CALLBACK( setup_gun_interrupts )
{
int beamx, beamy;
/* set a timer to do this again next frame */
timer_adjust(setup_gun_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
/* only do work if the palette is flashed */
if (!tickee_control[2])
return;
/* generate interrupts for player 1's gun */
get_crosshair_xy(0, &beamx, &beamy);
timer_set(video_screen_get_time_until_pos(0, beamy, beamx + 50), NULL, 0, trigger_gun_interrupt);
timer_set(video_screen_get_time_until_pos(0, beamy + 1, beamx + 50), NULL, 0, clear_gun_interrupt);
/* generate interrupts for player 2's gun */
get_crosshair_xy(1, &beamx, &beamy);
timer_set(video_screen_get_time_until_pos(0, beamy, beamx + 50), NULL, 1, trigger_gun_interrupt);
timer_set(video_screen_get_time_until_pos(0, beamy + 1, beamx + 50), NULL, 1, clear_gun_interrupt);
}
/*************************************
*
* Video startup
*
*************************************/
VIDEO_START( tickee )
{
/* start a timer going on the first scanline of every frame */
setup_gun_timer = timer_alloc(setup_gun_interrupts, NULL);
timer_adjust(setup_gun_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
}
/*************************************
*
* Video update
*
*************************************/
void tickee_scanline_update(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params)
{
UINT16 *src = &tickee_vram[(params->rowaddr << 8) & 0x3ff00];
UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
int coladdr = params->coladdr << 1;
int x;
/* blank palette: fill with pen 255 */
if (tickee_control[2])
{
for (x = params->heblnk; x < params->hsblnk; x++)
dest[x] = 0xff;
return;
}
/* copy the non-blanked portions of this scanline */
for (x = params->heblnk; x < params->hsblnk; x += 2)
{
UINT16 pixels = src[coladdr++ & 0xff];
dest[x + 0] = pixels & 0xff;
dest[x + 1] = pixels >> 8;
}
}