mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
Implemented device version of the deco16ic tilemap chip [Fabio Priuli]
Converted backfire.c, boogwing.c, dietgo.c, mirage.c, pktgaldx.c, simpl156.c, supbtime.c, tumblep.c to use the device-fied video chips [Fabio Priuli] Added driver data struct and save states to the following drivers: dietgo.c, mirage.c, pktgaldx.c, supbtime.c and tumblep.c [Fabio Priuli] side note: the device-fied code (currently included in video/decodev.c) still needs various refinements, but I will clean it up after all the drivers have been converted.
This commit is contained in:
parent
bc4ac8206f
commit
9c435fdb38
6
.gitattributes
vendored
6
.gitattributes
vendored
@ -2479,6 +2479,7 @@ src/mame/includes/deco32.h svneol=native#text/plain
|
||||
src/mame/includes/decocrpt.h svneol=native#text/plain
|
||||
src/mame/includes/decoprot.h svneol=native#text/plain
|
||||
src/mame/includes/deniam.h svneol=native#text/plain
|
||||
src/mame/includes/dietgo.h svneol=native#text/plain
|
||||
src/mame/includes/djboy.h svneol=native#text/plain
|
||||
src/mame/includes/dkong.h svneol=native#text/plain
|
||||
src/mame/includes/docastle.h svneol=native#text/plain
|
||||
@ -2710,6 +2711,7 @@ src/mame/includes/pgm.h svneol=native#text/plain
|
||||
src/mame/includes/phoenix.h svneol=native#text/plain
|
||||
src/mame/includes/pitnrun.h svneol=native#text/plain
|
||||
src/mame/includes/pk8000.h svneol=native#text/plain
|
||||
src/mame/includes/pktgaldx.h svneol=native#text/plain
|
||||
src/mame/includes/playch10.h svneol=native#text/plain
|
||||
src/mame/includes/playmark.h svneol=native#text/plain
|
||||
src/mame/includes/polepos.h svneol=native#text/plain
|
||||
@ -2783,6 +2785,7 @@ src/mame/includes/stlforce.h svneol=native#text/plain
|
||||
src/mame/includes/stv.h svneol=native#text/plain
|
||||
src/mame/includes/subs.h svneol=native#text/plain
|
||||
src/mame/includes/suna8.h svneol=native#text/plain
|
||||
src/mame/includes/supbtime.h svneol=native#text/plain
|
||||
src/mame/includes/suprnova.h svneol=native#text/plain
|
||||
src/mame/includes/suprridr.h svneol=native#text/plain
|
||||
src/mame/includes/suprslam.h svneol=native#text/plain
|
||||
@ -2823,6 +2826,7 @@ src/mame/includes/trackfld.h svneol=native#text/plain
|
||||
src/mame/includes/triplhnt.h svneol=native#text/plain
|
||||
src/mame/includes/tubep.h svneol=native#text/plain
|
||||
src/mame/includes/tumbleb.h svneol=native#text/plain
|
||||
src/mame/includes/tumblep.h svneol=native#text/plain
|
||||
src/mame/includes/tunhunt.h svneol=native#text/plain
|
||||
src/mame/includes/turbo.h svneol=native#text/plain
|
||||
src/mame/includes/twin16.h svneol=native#text/plain
|
||||
@ -3352,6 +3356,8 @@ src/mame/video/deco16ic.c svneol=native#text/plain
|
||||
src/mame/video/deco32.c svneol=native#text/plain
|
||||
src/mame/video/deco_mlc.c svneol=native#text/plain
|
||||
src/mame/video/decocass.c svneol=native#text/plain
|
||||
src/mame/video/decodev.c svneol=native#text/plain
|
||||
src/mame/video/decodev.h svneol=native#text/plain
|
||||
src/mame/video/deniam.c svneol=native#text/plain
|
||||
src/mame/video/dietgo.c svneol=native#text/plain
|
||||
src/mame/video/digdug.c svneol=native#text/plain
|
||||
|
@ -18,9 +18,12 @@
|
||||
#include "sound/okim6295.h"
|
||||
#include "sound/ymz280b.h"
|
||||
#include "cpu/arm/arm.h"
|
||||
#include "includes/deco16ic.h"
|
||||
#include "video/decodev.h"
|
||||
#include "rendlay.h"
|
||||
|
||||
static UINT16 *backfire_pf1_rowscroll,*backfire_pf2_rowscroll;
|
||||
static UINT16 *backfire_pf3_rowscroll,*backfire_pf4_rowscroll;
|
||||
|
||||
static UINT32 *backfire_spriteram32_1;
|
||||
static UINT32 *backfire_spriteram32_2;
|
||||
static UINT32 *backfire_mainram;
|
||||
@ -32,56 +35,20 @@ static UINT32 *backfire_left_priority, *backfire_right_priority;
|
||||
|
||||
/* I'm using the functions in deco16ic.c ... same chips, why duplicate code? */
|
||||
|
||||
static int backfire_bank_callback(int bank)
|
||||
{
|
||||
// mame_printf_debug("bank callback %04x\n",bank); // bit 1 gets set too?
|
||||
|
||||
bank = bank >> 4;
|
||||
|
||||
bank = (bank & 1) | ( (bank & 4) >> 1 ) | ((bank & 2) << 1);
|
||||
|
||||
return bank * 0x1000;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static VIDEO_START(backfire)
|
||||
{
|
||||
/* allocate the ram as 16-bit (we do it here because the CPU is 32-bit) */
|
||||
deco16_pf1_data = auto_alloc_array(machine, UINT16, 0x2000/2);
|
||||
deco16_pf2_data = auto_alloc_array(machine, UINT16, 0x2000/2);
|
||||
deco16_pf3_data = auto_alloc_array(machine, UINT16, 0x2000/2);
|
||||
deco16_pf4_data = auto_alloc_array(machine, UINT16, 0x2000/2);
|
||||
deco16_pf1_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2);
|
||||
deco16_pf2_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2);
|
||||
deco16_pf3_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2);
|
||||
deco16_pf4_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2);
|
||||
deco16_pf12_control = auto_alloc_array(machine, UINT16, 0x10/2);
|
||||
deco16_pf34_control =auto_alloc_array(machine, UINT16, 0x10/2);
|
||||
backfire_pf1_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2);
|
||||
backfire_pf2_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2);
|
||||
backfire_pf3_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2);
|
||||
backfire_pf4_rowscroll = auto_alloc_array(machine, UINT16, 0x0800/2);
|
||||
|
||||
/* and register the allocated ram so that save states still work */
|
||||
state_save_register_global_pointer(machine, deco16_pf1_data, 0x2000/2);
|
||||
state_save_register_global_pointer(machine, deco16_pf2_data, 0x2000/2);
|
||||
state_save_register_global_pointer(machine, deco16_pf3_data, 0x2000/2);
|
||||
state_save_register_global_pointer(machine, deco16_pf4_data, 0x2000/2);
|
||||
state_save_register_global_pointer(machine, deco16_pf1_rowscroll, 0x800/2);
|
||||
state_save_register_global_pointer(machine, deco16_pf2_rowscroll, 0x800/2);
|
||||
state_save_register_global_pointer(machine, deco16_pf3_rowscroll, 0x800/2);
|
||||
state_save_register_global_pointer(machine, deco16_pf4_rowscroll, 0x800/2);
|
||||
state_save_register_global_pointer(machine, deco16_pf12_control, 0x10/2);
|
||||
state_save_register_global_pointer(machine, deco16_pf34_control, 0x10/2);
|
||||
|
||||
deco16_2_video_init(machine, 0);
|
||||
|
||||
deco16_pf1_colour_bank = 0x00;
|
||||
deco16_pf2_colour_bank = 0x40;
|
||||
deco16_pf3_colour_bank = 0x10;
|
||||
deco16_pf4_colour_bank = 0x50;
|
||||
|
||||
deco16_set_tilemap_bank_callback(0, backfire_bank_callback);
|
||||
deco16_set_tilemap_bank_callback(1, backfire_bank_callback);
|
||||
deco16_set_tilemap_bank_callback(2, backfire_bank_callback);
|
||||
deco16_set_tilemap_bank_callback(3, backfire_bank_callback);
|
||||
state_save_register_global_pointer(machine, backfire_pf1_rowscroll, 0x800/2);
|
||||
state_save_register_global_pointer(machine, backfire_pf2_rowscroll, 0x800/2);
|
||||
state_save_register_global_pointer(machine, backfire_pf3_rowscroll, 0x800/2);
|
||||
state_save_register_global_pointer(machine, backfire_pf4_rowscroll, 0x800/2);
|
||||
|
||||
backfire_left = auto_bitmap_alloc(machine, 80*8, 32*8, BITMAP_FORMAT_INDEXED16);
|
||||
backfire_right = auto_bitmap_alloc(machine, 80*8, 32*8, BITMAP_FORMAT_INDEXED16);
|
||||
@ -167,34 +134,35 @@ static void draw_sprites(running_machine *machine,bitmap_t *bitmap,const rectang
|
||||
|
||||
|
||||
|
||||
static VIDEO_UPDATE(backfire)
|
||||
static VIDEO_UPDATE( backfire )
|
||||
{
|
||||
running_device *left_screen = devtag_get_device(screen->machine, "lscreen");
|
||||
running_device *right_screen = devtag_get_device(screen->machine, "rscreen");
|
||||
running_device *deco16ic = devtag_get_device(screen->machine, "deco_custom");
|
||||
|
||||
/* screen 1 uses pf1 as the forground and pf3 as the background */
|
||||
/* screen 2 uses pf2 as the foreground and pf4 as the background */
|
||||
|
||||
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
|
||||
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
|
||||
decodev_pf12_update(deco16ic, backfire_pf1_rowscroll, backfire_pf2_rowscroll);
|
||||
decodev_pf34_update(deco16ic, backfire_pf3_rowscroll, backfire_pf4_rowscroll);
|
||||
|
||||
if (screen == left_screen)
|
||||
{
|
||||
|
||||
bitmap_fill(screen->machine->priority_bitmap,NULL,0);
|
||||
bitmap_fill(bitmap,cliprect,0x100);
|
||||
bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
|
||||
bitmap_fill(bitmap, cliprect, 0x100);
|
||||
|
||||
if (backfire_left_priority[0] == 0)
|
||||
{
|
||||
deco16_tilemap_3_draw(screen,bitmap,cliprect,0,1);
|
||||
deco16_tilemap_1_draw(screen,bitmap,cliprect,0,2);
|
||||
draw_sprites(screen->machine,bitmap,cliprect,backfire_spriteram32_1,3);
|
||||
decodev_tilemap_3_draw(deco16ic, bitmap, cliprect, 0, 1);
|
||||
decodev_tilemap_1_draw(deco16ic, bitmap, cliprect, 0, 2);
|
||||
draw_sprites(screen->machine, bitmap, cliprect, backfire_spriteram32_1, 3);
|
||||
}
|
||||
else if (backfire_left_priority[0] == 2)
|
||||
{
|
||||
deco16_tilemap_1_draw(screen,bitmap,cliprect,0,2);
|
||||
deco16_tilemap_3_draw(screen,bitmap,cliprect,0,4);
|
||||
draw_sprites(screen->machine,bitmap,cliprect,backfire_spriteram32_1,3);
|
||||
decodev_tilemap_1_draw(deco16ic, bitmap, cliprect, 0, 2);
|
||||
decodev_tilemap_3_draw(deco16ic, bitmap, cliprect, 0, 4);
|
||||
draw_sprites(screen->machine, bitmap, cliprect, backfire_spriteram32_1, 3);
|
||||
}
|
||||
else
|
||||
popmessage( "unknown left priority %08x", backfire_left_priority[0] );
|
||||
@ -206,15 +174,15 @@ static VIDEO_UPDATE(backfire)
|
||||
|
||||
if (backfire_right_priority[0] == 0)
|
||||
{
|
||||
deco16_tilemap_4_draw(screen,bitmap,cliprect,0,1);
|
||||
deco16_tilemap_2_draw(screen,bitmap,cliprect,0,2);
|
||||
draw_sprites(screen->machine,bitmap,cliprect,backfire_spriteram32_2,4);
|
||||
decodev_tilemap_4_draw(deco16ic, bitmap, cliprect, 0, 1);
|
||||
decodev_tilemap_2_draw(deco16ic, bitmap, cliprect, 0, 2);
|
||||
draw_sprites(screen->machine, bitmap, cliprect, backfire_spriteram32_2, 4);
|
||||
}
|
||||
else if (backfire_right_priority[0] == 2)
|
||||
{
|
||||
deco16_tilemap_2_draw(screen,bitmap,cliprect,0,2);
|
||||
deco16_tilemap_4_draw(screen,bitmap,cliprect,0,4);
|
||||
draw_sprites(screen->machine,bitmap,cliprect,backfire_spriteram32_2,4);
|
||||
decodev_tilemap_2_draw(deco16ic, bitmap, cliprect, 0, 2);
|
||||
decodev_tilemap_4_draw(deco16ic, bitmap, cliprect, 0, 4);
|
||||
draw_sprites(screen->machine, bitmap, cliprect, backfire_spriteram32_2, 4);
|
||||
}
|
||||
else
|
||||
popmessage( "unknown right priority %08x", backfire_right_priority[0] );
|
||||
@ -259,7 +227,7 @@ static WRITE32_DEVICE_HANDLER(backfire_eeprom_w)
|
||||
}
|
||||
|
||||
|
||||
static WRITE32_HANDLER(wcvol95_nonbuffered_palette_w)
|
||||
static WRITE32_HANDLER(backfire_nonbuffered_palette_w)
|
||||
{
|
||||
COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
|
||||
palette_set_color_rgb(space->machine,offset,pal5bit(space->machine->generic.paletteram.u32[offset] >> 0),pal5bit(space->machine->generic.paletteram.u32[offset] >> 5),pal5bit(space->machine->generic.paletteram.u32[offset] >> 10));
|
||||
@ -267,26 +235,15 @@ static WRITE32_HANDLER(wcvol95_nonbuffered_palette_w)
|
||||
|
||||
/* map 32-bit writes to 16-bit */
|
||||
|
||||
static READ32_HANDLER( backfire_pf1_rowscroll_r ) { return deco16_pf1_rowscroll[offset]^0xffff0000; }
|
||||
static READ32_HANDLER( backfire_pf2_rowscroll_r ) { return deco16_pf2_rowscroll[offset]^0xffff0000; }
|
||||
static READ32_HANDLER( backfire_pf3_rowscroll_r ) { return deco16_pf3_rowscroll[offset]^0xffff0000; }
|
||||
static READ32_HANDLER( backfire_pf4_rowscroll_r ) { return deco16_pf4_rowscroll[offset]^0xffff0000; }
|
||||
static WRITE32_HANDLER( backfire_pf1_rowscroll_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf1_rowscroll[offset]); }
|
||||
static WRITE32_HANDLER( backfire_pf2_rowscroll_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf2_rowscroll[offset]); }
|
||||
static WRITE32_HANDLER( backfire_pf3_rowscroll_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf3_rowscroll[offset]); }
|
||||
static WRITE32_HANDLER( backfire_pf4_rowscroll_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf4_rowscroll[offset]); }
|
||||
static READ32_HANDLER ( backfire_pf12_control_r ) { return deco16_pf12_control[offset]^0xffff0000; }
|
||||
static READ32_HANDLER ( backfire_pf34_control_r ) { return deco16_pf34_control[offset]^0xffff0000; }
|
||||
static WRITE32_HANDLER( backfire_pf12_control_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf12_control[offset]); }
|
||||
static WRITE32_HANDLER( backfire_pf34_control_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&deco16_pf34_control[offset]); }
|
||||
static READ32_HANDLER( backfire_pf1_data_r ) { return deco16_pf1_data[offset]^0xffff0000; }
|
||||
static READ32_HANDLER( backfire_pf2_data_r ) { return deco16_pf2_data[offset]^0xffff0000; }
|
||||
static READ32_HANDLER( backfire_pf3_data_r ) { return deco16_pf3_data[offset]^0xffff0000; }
|
||||
static READ32_HANDLER( backfire_pf4_data_r ) { return deco16_pf4_data[offset]^0xffff0000; }
|
||||
static WRITE32_HANDLER( backfire_pf1_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf1_data_w(space,offset,data,mem_mask); }
|
||||
static WRITE32_HANDLER( backfire_pf2_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf2_data_w(space,offset,data,mem_mask); }
|
||||
static WRITE32_HANDLER( backfire_pf3_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf3_data_w(space,offset,data,mem_mask); }
|
||||
static WRITE32_HANDLER( backfire_pf4_data_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; deco16_pf4_data_w(space,offset,data,mem_mask); }
|
||||
static READ32_HANDLER( backfire_pf1_rowscroll_r ) { return backfire_pf1_rowscroll[offset]^0xffff0000; }
|
||||
static READ32_HANDLER( backfire_pf2_rowscroll_r ) { return backfire_pf2_rowscroll[offset]^0xffff0000; }
|
||||
static READ32_HANDLER( backfire_pf3_rowscroll_r ) { return backfire_pf3_rowscroll[offset]^0xffff0000; }
|
||||
static READ32_HANDLER( backfire_pf4_rowscroll_r ) { return backfire_pf4_rowscroll[offset]^0xffff0000; }
|
||||
static WRITE32_HANDLER( backfire_pf1_rowscroll_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&backfire_pf1_rowscroll[offset]); }
|
||||
static WRITE32_HANDLER( backfire_pf2_rowscroll_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&backfire_pf2_rowscroll[offset]); }
|
||||
static WRITE32_HANDLER( backfire_pf3_rowscroll_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&backfire_pf3_rowscroll[offset]); }
|
||||
static WRITE32_HANDLER( backfire_pf4_rowscroll_w ) { data &=0x0000ffff; mem_mask &=0x0000ffff; COMBINE_DATA(&backfire_pf4_rowscroll[offset]); }
|
||||
|
||||
|
||||
#ifdef UNUSED_FUNCTION
|
||||
READ32_HANDLER( backfire_unknown_wheel_r )
|
||||
@ -308,18 +265,18 @@ READ32_HANDLER( backfire_wheel2_r )
|
||||
|
||||
static ADDRESS_MAP_START( backfire_map, ADDRESS_SPACE_PROGRAM, 32 )
|
||||
AM_RANGE(0x000000, 0x0fffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x10001f) AM_READWRITE( backfire_pf12_control_r, backfire_pf12_control_w)
|
||||
AM_RANGE(0x110000, 0x111fff) AM_READWRITE( backfire_pf1_data_r, backfire_pf1_data_w)
|
||||
AM_RANGE(0x114000, 0x115fff) AM_READWRITE( backfire_pf2_data_r, backfire_pf2_data_w)
|
||||
AM_RANGE(0x120000, 0x120fff) AM_READWRITE( backfire_pf1_rowscroll_r, backfire_pf1_rowscroll_w)
|
||||
AM_RANGE(0x124000, 0x124fff) AM_READWRITE( backfire_pf2_rowscroll_r, backfire_pf2_rowscroll_w)
|
||||
AM_RANGE(0x130000, 0x13001f) AM_READWRITE( backfire_pf34_control_r, backfire_pf34_control_w)
|
||||
AM_RANGE(0x140000, 0x141fff) AM_READWRITE( backfire_pf3_data_r, backfire_pf3_data_w)
|
||||
AM_RANGE(0x144000, 0x145fff) AM_READWRITE( backfire_pf4_data_r, backfire_pf4_data_w)
|
||||
AM_RANGE(0x150000, 0x150fff) AM_READWRITE( backfire_pf3_rowscroll_r, backfire_pf3_rowscroll_w)
|
||||
AM_RANGE(0x154000, 0x154fff) AM_READWRITE( backfire_pf4_rowscroll_r, backfire_pf4_rowscroll_w)
|
||||
AM_RANGE(0x160000, 0x161fff) AM_WRITE(wcvol95_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0x170000, 0x177fff) AM_RAM AM_BASE( &backfire_mainram )// main ram
|
||||
AM_RANGE(0x100000, 0x10001f) AM_DEVREADWRITE("deco_custom", decodev_pf12_control_dword_r, decodev_pf12_control_dword_w)
|
||||
AM_RANGE(0x110000, 0x111fff) AM_DEVREADWRITE("deco_custom", decodev_pf1_data_dword_r, decodev_pf1_data_dword_w)
|
||||
AM_RANGE(0x114000, 0x115fff) AM_DEVREADWRITE("deco_custom", decodev_pf2_data_dword_r, decodev_pf2_data_dword_w)
|
||||
AM_RANGE(0x120000, 0x120fff) AM_READWRITE(backfire_pf1_rowscroll_r, backfire_pf1_rowscroll_w)
|
||||
AM_RANGE(0x124000, 0x124fff) AM_READWRITE(backfire_pf2_rowscroll_r, backfire_pf2_rowscroll_w)
|
||||
AM_RANGE(0x130000, 0x13001f) AM_DEVREADWRITE("deco_custom", decodev_pf34_control_dword_r, decodev_pf34_control_dword_w)
|
||||
AM_RANGE(0x140000, 0x141fff) AM_DEVREADWRITE("deco_custom", decodev_pf3_data_dword_r, decodev_pf3_data_dword_w)
|
||||
AM_RANGE(0x144000, 0x145fff) AM_DEVREADWRITE("deco_custom", decodev_pf4_data_dword_r, decodev_pf4_data_dword_w)
|
||||
AM_RANGE(0x150000, 0x150fff) AM_READWRITE(backfire_pf3_rowscroll_r, backfire_pf3_rowscroll_w)
|
||||
AM_RANGE(0x154000, 0x154fff) AM_READWRITE(backfire_pf4_rowscroll_r, backfire_pf4_rowscroll_w)
|
||||
AM_RANGE(0x160000, 0x161fff) AM_WRITE(backfire_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0x170000, 0x177fff) AM_RAM AM_BASE(&backfire_mainram )// main ram
|
||||
|
||||
// AM_RANGE(0x180010, 0x180013) AM_RAM AM_BASE(&backfire_180010) // always 180010 ?
|
||||
// AM_RANGE(0x188010, 0x188013) AM_RAM AM_BASE(&backfire_188010) // always 188010 ?
|
||||
@ -462,6 +419,28 @@ static INTERRUPT_GEN( deco32_vbl_interrupt )
|
||||
|
||||
|
||||
|
||||
static int backfire_bank_callback( int bank )
|
||||
{
|
||||
// mame_printf_debug("bank callback %04x\n",bank); // bit 1 gets set too?
|
||||
bank = bank >> 4;
|
||||
bank = (bank & 1) | ((bank & 4) >> 1) | ((bank & 2) << 1);
|
||||
|
||||
return bank * 0x1000;
|
||||
}
|
||||
|
||||
static const deco16ic_interface backfire_deco16ic_intf =
|
||||
{
|
||||
"lscreen",
|
||||
0, 0, 1,
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
|
||||
0x00, 0x40, 0x10, 0x50, /* color base */
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */
|
||||
backfire_bank_callback,
|
||||
backfire_bank_callback,
|
||||
backfire_bank_callback,
|
||||
backfire_bank_callback
|
||||
};
|
||||
|
||||
static MACHINE_DRIVER_START( backfire )
|
||||
|
||||
/* basic machine hardware */
|
||||
@ -493,6 +472,8 @@ static MACHINE_DRIVER_START( backfire )
|
||||
MDRV_VIDEO_START(backfire)
|
||||
MDRV_VIDEO_UPDATE(backfire)
|
||||
|
||||
MDRV_DECO16IC_ADD("deco_custom", backfire_deco16ic_intf)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
|
@ -82,11 +82,14 @@
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/h6280/h6280.h"
|
||||
#include "includes/decocrpt.h"
|
||||
#include "includes/deco16ic.h"
|
||||
#include "video/decodev.h"
|
||||
#include "includes/decoprot.h"
|
||||
#include "sound/2151intf.h"
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
extern UINT16 *boogwing_pf1_rowscroll,*boogwing_pf2_rowscroll;
|
||||
extern UINT16 *boogwing_pf3_rowscroll,*boogwing_pf4_rowscroll;
|
||||
|
||||
VIDEO_START(boogwing);
|
||||
VIDEO_UPDATE(boogwing);
|
||||
|
||||
@ -96,7 +99,7 @@ static ADDRESS_MAP_START( boogwing_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x000000, 0x0fffff) AM_ROM
|
||||
AM_RANGE(0x200000, 0x20ffff) AM_RAM
|
||||
|
||||
AM_RANGE(0x220000, 0x220001) AM_WRITE(deco16_priority_w)
|
||||
AM_RANGE(0x220000, 0x220001) AM_DEVWRITE("deco_custom", decodev_priority_w)
|
||||
AM_RANGE(0x220002, 0x22000f) AM_NOP
|
||||
|
||||
AM_RANGE(0x240000, 0x240001) AM_WRITE(buffer_spriteram16_w)
|
||||
@ -109,22 +112,22 @@ static ADDRESS_MAP_START( boogwing_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x24e344, 0x24e345) AM_READ_PORT("INPUTS")
|
||||
AM_RANGE(0x24e000, 0x24e7ff) AM_WRITE(deco16_104_prot_w) AM_BASE(&deco16_prot_ram)
|
||||
|
||||
AM_RANGE(0x260000, 0x26000f) AM_WRITEONLY AM_BASE(&deco16_pf12_control)
|
||||
AM_RANGE(0x264000, 0x265fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data)
|
||||
AM_RANGE(0x266000, 0x267fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data)
|
||||
AM_RANGE(0x268000, 0x268fff) AM_RAM AM_BASE(&deco16_pf1_rowscroll)
|
||||
AM_RANGE(0x26a000, 0x26afff) AM_RAM AM_BASE(&deco16_pf2_rowscroll)
|
||||
AM_RANGE(0x260000, 0x26000f) AM_DEVWRITE("deco_custom", decodev_pf12_control_w)
|
||||
AM_RANGE(0x264000, 0x265fff) AM_RAM_DEVWRITE("deco_custom", decodev_pf1_data_w)
|
||||
AM_RANGE(0x266000, 0x267fff) AM_RAM_DEVWRITE("deco_custom", decodev_pf2_data_w)
|
||||
AM_RANGE(0x268000, 0x268fff) AM_RAM AM_BASE(&boogwing_pf1_rowscroll)
|
||||
AM_RANGE(0x26a000, 0x26afff) AM_RAM AM_BASE(&boogwing_pf2_rowscroll)
|
||||
|
||||
AM_RANGE(0x270000, 0x27000f) AM_WRITEONLY AM_BASE(&deco16_pf34_control)
|
||||
AM_RANGE(0x274000, 0x275fff) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data)
|
||||
AM_RANGE(0x276000, 0x277fff) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data)
|
||||
AM_RANGE(0x278000, 0x278fff) AM_RAM AM_BASE(&deco16_pf3_rowscroll)
|
||||
AM_RANGE(0x27a000, 0x27afff) AM_RAM AM_BASE(&deco16_pf4_rowscroll)
|
||||
AM_RANGE(0x270000, 0x27000f) AM_DEVWRITE("deco_custom", decodev_pf34_control_w)
|
||||
AM_RANGE(0x274000, 0x275fff) AM_RAM_DEVWRITE("deco_custom", decodev_pf3_data_w)
|
||||
AM_RANGE(0x276000, 0x277fff) AM_RAM_DEVWRITE("deco_custom", decodev_pf4_data_w)
|
||||
AM_RANGE(0x278000, 0x278fff) AM_RAM AM_BASE(&boogwing_pf3_rowscroll)
|
||||
AM_RANGE(0x27a000, 0x27afff) AM_RAM AM_BASE(&boogwing_pf4_rowscroll)
|
||||
|
||||
AM_RANGE(0x280000, 0x28000f) AM_NOP // ?
|
||||
AM_RANGE(0x282000, 0x282001) AM_NOP // Palette setup?
|
||||
AM_RANGE(0x282008, 0x282009) AM_WRITE(deco16_palette_dma_w)
|
||||
AM_RANGE(0x284000, 0x285fff) AM_WRITE(deco16_buffered_palette_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0x282008, 0x282009) AM_DEVWRITE("deco_custom", decodev_palette_dma_w)
|
||||
AM_RANGE(0x284000, 0x285fff) AM_DEVWRITE("deco_custom", decodev_buffered_palette_w) AM_BASE_GENERIC(paletteram)
|
||||
|
||||
AM_RANGE(0x3c0000, 0x3c004f) AM_RAM // ?
|
||||
ADDRESS_MAP_END
|
||||
@ -146,13 +149,13 @@ ADDRESS_MAP_END
|
||||
/**********************************************************************************/
|
||||
|
||||
static INPUT_PORTS_START( boogwing )
|
||||
PORT_START("SYSTEM") /* 16bit */
|
||||
PORT_START("SYSTEM")
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
|
||||
|
||||
PORT_START("DSW") /* 16bit */
|
||||
PORT_START("DSW")
|
||||
PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x0001, DEF_STR( 2C_1C ) )
|
||||
@ -200,7 +203,7 @@ static INPUT_PORTS_START( boogwing )
|
||||
PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
|
||||
PORT_START("INPUTS") /* 16bit */
|
||||
PORT_START("INPUTS")
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
|
||||
@ -295,6 +298,34 @@ static const ym2151_interface ym2151_config =
|
||||
};
|
||||
|
||||
|
||||
static int boogwing_bank_callback(const int bank)
|
||||
{
|
||||
return ((bank >> 4) & 0x7) * 0x1000;
|
||||
}
|
||||
|
||||
static int boogwing_bank_callback2(const int bank)
|
||||
{
|
||||
int offset = ((bank >> 4) & 0x7) * 0x1000;
|
||||
if ((bank & 0xf) == 0xa)
|
||||
offset += 0x800; // strange - transporter level
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
static const deco16ic_interface boogwing_deco16ic_intf =
|
||||
{
|
||||
"screen",
|
||||
0, 0, 1,
|
||||
0x0f, 0x1f, 0x0f, 0x0f, /* trans masks (pf2 has 5bpp graphics) */
|
||||
0, 0, 0, 16, /* color base (pf2 is non default) */
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */
|
||||
NULL,
|
||||
boogwing_bank_callback,
|
||||
boogwing_bank_callback2,
|
||||
boogwing_bank_callback2
|
||||
};
|
||||
|
||||
|
||||
static MACHINE_DRIVER_START( boogwing )
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", M68000, 14000000) /* DE102 */
|
||||
@ -320,6 +351,8 @@ static MACHINE_DRIVER_START( boogwing )
|
||||
MDRV_VIDEO_START(boogwing)
|
||||
MDRV_VIDEO_UPDATE(boogwing)
|
||||
|
||||
MDRV_DECO16IC_ADD("deco_custom", boogwing_deco16ic_intf)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
|
@ -11,21 +11,19 @@
|
||||
#include "sound/okim6295.h"
|
||||
#include "includes/decocrpt.h"
|
||||
#include "includes/decoprot.h"
|
||||
#include "includes/deco16ic.h"
|
||||
|
||||
VIDEO_UPDATE( dietgo );
|
||||
VIDEO_START( dietgo );
|
||||
#include "includes/dietgo.h"
|
||||
#include "video/decodev.h"
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( dietgo_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x000000, 0x07ffff) AM_ROM
|
||||
AM_RANGE(0x200000, 0x20000f) AM_WRITEONLY AM_BASE(&deco16_pf12_control)
|
||||
AM_RANGE(0x210000, 0x211fff) AM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data)
|
||||
AM_RANGE(0x212000, 0x213fff) AM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data)
|
||||
AM_RANGE(0x220000, 0x2207ff) AM_WRITEONLY AM_BASE(&deco16_pf1_rowscroll)
|
||||
AM_RANGE(0x222000, 0x2227ff) AM_WRITEONLY AM_BASE(&deco16_pf2_rowscroll)
|
||||
AM_RANGE(0x280000, 0x2807ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
|
||||
AM_RANGE(0x300000, 0x300bff) AM_RAM_WRITE(deco16_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE("deco_custom", decodev_pf12_control_w)
|
||||
AM_RANGE(0x210000, 0x211fff) AM_DEVWRITE("deco_custom", decodev_pf1_data_w)
|
||||
AM_RANGE(0x212000, 0x213fff) AM_DEVWRITE("deco_custom", decodev_pf2_data_w)
|
||||
AM_RANGE(0x220000, 0x2207ff) AM_WRITEONLY AM_BASE_MEMBER(dietgo_state, pf1_rowscroll)
|
||||
AM_RANGE(0x222000, 0x2227ff) AM_WRITEONLY AM_BASE_MEMBER(dietgo_state, pf2_rowscroll)
|
||||
AM_RANGE(0x280000, 0x2807ff) AM_RAM AM_BASE_SIZE_MEMBER(dietgo_state, spriteram, spriteram_size)
|
||||
AM_RANGE(0x300000, 0x300bff) AM_RAM_DEVWRITE("deco_custom", decodev_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0x340000, 0x3407ff) AM_READWRITE(dietgo_104_prot_r, dietgo_104_prot_w)
|
||||
AM_RANGE(0x380000, 0x38ffff) AM_RAM // mainram
|
||||
ADDRESS_MAP_END
|
||||
@ -53,7 +51,7 @@ static INPUT_PORTS_START( dietgo )
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_VBLANK )
|
||||
|
||||
PORT_START("IN1") /* 16bit */
|
||||
PORT_START("IN1")
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
|
||||
@ -71,7 +69,7 @@ static INPUT_PORTS_START( dietgo )
|
||||
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
|
||||
|
||||
PORT_START("DSW") /* Dip switch bank 1 */
|
||||
PORT_START("DSW")
|
||||
PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x0001, DEF_STR( 2C_1C ) )
|
||||
@ -97,7 +95,6 @@ static INPUT_PORTS_START( dietgo )
|
||||
PORT_DIPSETTING( 0x0080, "1 Start/1 Continue" )
|
||||
PORT_DIPSETTING( 0x0000, "2 Start/1 Continue" )
|
||||
|
||||
/* Dip switch bank 2 */
|
||||
PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
|
||||
PORT_DIPSETTING( 0x0100, "1" )
|
||||
PORT_DIPSETTING( 0x0000, "2" )
|
||||
@ -164,7 +161,8 @@ GFXDECODE_END
|
||||
|
||||
static void sound_irq(running_device *device, int state)
|
||||
{
|
||||
cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */
|
||||
dietgo_state *driver_state = (dietgo_state *)device->machine->driver_data;
|
||||
cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
@ -172,7 +170,40 @@ static const ym2151_interface ym2151_config =
|
||||
sound_irq
|
||||
};
|
||||
|
||||
|
||||
static int dietgo_bank_callback(const int bank)
|
||||
{
|
||||
return ((bank >> 4) & 0x7) * 0x1000;
|
||||
}
|
||||
|
||||
static const deco16ic_interface dietgo_deco16ic_intf =
|
||||
{
|
||||
"screen",
|
||||
1, 0, 1,
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
|
||||
0, 16, 0, 16, /* color base (default values) */
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */
|
||||
dietgo_bank_callback,
|
||||
dietgo_bank_callback,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
static MACHINE_START( dietgo )
|
||||
{
|
||||
dietgo_state *state = (dietgo_state *)machine->driver_data;
|
||||
|
||||
state->maincpu = devtag_get_device(machine, "maincpu");
|
||||
state->audiocpu = devtag_get_device(machine, "audiocpu");
|
||||
state->deco16ic = devtag_get_device(machine, "deco_custom");
|
||||
}
|
||||
|
||||
static MACHINE_DRIVER_START( dietgo )
|
||||
|
||||
/* driver data */
|
||||
MDRV_DRIVER_DATA(dietgo_state)
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", M68000, XTAL_28MHz/2) /* DE102 (verified on pcb) */
|
||||
MDRV_CPU_PROGRAM_MAP(dietgo_map)
|
||||
@ -181,6 +212,8 @@ static MACHINE_DRIVER_START( dietgo )
|
||||
MDRV_CPU_ADD("audiocpu", H6280, XTAL_32_22MHz/4/3) /* Custom chip 45; XIN is 32.220MHZ/4, verified on pcb */
|
||||
MDRV_CPU_PROGRAM_MAP(sound_map)
|
||||
|
||||
MDRV_MACHINE_START(dietgo)
|
||||
|
||||
/* video hardware */
|
||||
MDRV_SCREEN_ADD("screen", RASTER)
|
||||
MDRV_SCREEN_REFRESH_RATE(58)
|
||||
@ -192,9 +225,10 @@ static MACHINE_DRIVER_START( dietgo )
|
||||
MDRV_PALETTE_LENGTH(1024)
|
||||
MDRV_GFXDECODE(dietgo)
|
||||
|
||||
MDRV_VIDEO_START(dietgo)
|
||||
MDRV_VIDEO_UPDATE(dietgo)
|
||||
|
||||
MDRV_DECO16IC_ADD("deco_custom", dietgo_deco16ic_intf)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
@ -334,7 +368,7 @@ static DRIVER_INIT( dietgo )
|
||||
deco102_decrypt_cpu(machine, "maincpu", 0xe9ba, 0x01, 0x19);
|
||||
}
|
||||
|
||||
GAME( 1992, dietgo, 0, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (Euro v1.1 1992.09.26)", 0 )
|
||||
GAME( 1992, dietgoe, dietgo, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (Euro v1.1 1992.08.04)" , 0) // weird, still version 1.1 but different date
|
||||
GAME( 1992, dietgou, dietgo, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (USA v1.1 1992.09.26)", 0 )
|
||||
GAME( 1992, dietgoj, dietgo, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (Japan v1.1 1992.09.26)", 0 )
|
||||
GAME( 1992, dietgo, 0, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (Euro v1.1 1992.09.26)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1992, dietgoe, dietgo, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (Euro v1.1 1992.08.04)" , GAME_SUPPORTS_SAVE ) // weird, still version 1.1 but different date
|
||||
GAME( 1992, dietgou, dietgo, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (USA v1.1 1992.09.26)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1992, dietgoj, dietgo, dietgo, dietgo, dietgo, ROT0, "Data East Corporation", "Diet Go Go (Japan v1.1 1992.09.26)", GAME_SUPPORTS_SAVE )
|
||||
|
@ -36,30 +36,56 @@ MR_01-.3A [a0b758aa]
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "includes/decocrpt.h"
|
||||
#include "includes/decoprot.h"
|
||||
#include "includes/deco16ic.h"
|
||||
#include "video/decodev.h"
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect, int pri)
|
||||
typedef struct _mirage_state mirage_state;
|
||||
struct _mirage_state
|
||||
{
|
||||
UINT16 *spriteram16 = machine->generic.spriteram.u16;
|
||||
/* memory pointers */
|
||||
UINT16 * pf1_rowscroll;
|
||||
UINT16 * pf2_rowscroll;
|
||||
UINT16 * spriteram;
|
||||
// UINT16 * paletteram; // currently this uses generic palette handling (in decodev.c)
|
||||
size_t spriteram_size;
|
||||
|
||||
/* misc */
|
||||
UINT32 mux_data;
|
||||
|
||||
/* devices */
|
||||
running_device *maincpu;
|
||||
running_device *audiocpu;
|
||||
running_device *deco16ic;
|
||||
running_device *oki_sfx;
|
||||
running_device *oki_bgm;
|
||||
};
|
||||
|
||||
|
||||
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
|
||||
{
|
||||
mirage_state *state = (mirage_state *)machine->driver_data;
|
||||
UINT16 *spriteram = state->spriteram;
|
||||
int offs;
|
||||
|
||||
for (offs = 0;offs < 0x400;offs += 4)
|
||||
for (offs = 0; offs < 0x400; offs += 4)
|
||||
{
|
||||
int x,y,sprite,colour,multi,fx,fy,inc,flash,mult;
|
||||
int x, y, sprite, colour, multi, fx, fy, inc, flash, mult;
|
||||
|
||||
sprite = spriteram16[offs+1];
|
||||
if (!sprite) continue;
|
||||
sprite = spriteram[offs + 1];
|
||||
if (!sprite)
|
||||
continue;
|
||||
|
||||
y = spriteram16[offs];
|
||||
flash=y&0x1000;
|
||||
y = spriteram[offs];
|
||||
flash = y & 0x1000;
|
||||
|
||||
if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue;
|
||||
if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1))
|
||||
continue;
|
||||
|
||||
if (pri != ((y & 0x8000)>>15)) continue;
|
||||
if (pri != ((y & 0x8000) >> 15))
|
||||
continue;
|
||||
|
||||
x = spriteram16[offs+2];
|
||||
colour = (x >>9) & 0x1f;
|
||||
x = spriteram[offs + 2];
|
||||
colour = (x >> 9) & 0x1f;
|
||||
|
||||
fx = y & 0x2000;
|
||||
fy = y & 0x4000;
|
||||
@ -71,9 +97,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
if (x >= 320) x -= 512;
|
||||
if (y >= 256) y -= 512;
|
||||
y = 240 - y;
|
||||
x = 304 - x;
|
||||
x = 304 - x;
|
||||
|
||||
if (x>320) continue;
|
||||
if (x > 320)
|
||||
continue;
|
||||
|
||||
sprite &= ~multi;
|
||||
if (fy)
|
||||
@ -86,13 +113,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
|
||||
if (flip_screen_get(machine))
|
||||
{
|
||||
y=240-y;
|
||||
x=304-x;
|
||||
if (fx) fx=0; else fx=1;
|
||||
if (fy) fy=0; else fy=1;
|
||||
mult=16;
|
||||
y =240 - y;
|
||||
x =304 - x;
|
||||
if (fx) fx = 0; else fx = 1;
|
||||
if (fy) fy = 0; else fy = 1;
|
||||
mult = 16;
|
||||
}
|
||||
else mult=-16;
|
||||
else mult = -16;
|
||||
|
||||
while (multi >= 0)
|
||||
{
|
||||
@ -107,44 +134,35 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
}
|
||||
}
|
||||
|
||||
static int mirage_bank_callback(const int bank)
|
||||
static VIDEO_UPDATE( mirage )
|
||||
{
|
||||
return ((bank>>4)&0x7) * 0x1000;
|
||||
}
|
||||
mirage_state *state = (mirage_state *)screen->machine->driver_data;
|
||||
UINT16 flip = decodev_pf12_control_r(state->deco16ic, 0, 0xffff);
|
||||
|
||||
static VIDEO_START(mirage)
|
||||
{
|
||||
deco16_1_video_init(machine);
|
||||
flip_screen_set(screen->machine, BIT(flip, 7));
|
||||
decodev_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll);
|
||||
|
||||
deco16_set_tilemap_bank_callback(0, mirage_bank_callback);
|
||||
deco16_set_tilemap_bank_callback(1, mirage_bank_callback);
|
||||
}
|
||||
bitmap_fill(bitmap, cliprect, 256); /* not verified */
|
||||
|
||||
static VIDEO_UPDATE(mirage)
|
||||
{
|
||||
flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
|
||||
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
|
||||
|
||||
bitmap_fill(bitmap,cliprect,256); /* not verified */
|
||||
|
||||
deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
|
||||
draw_sprites(screen->machine,bitmap,cliprect,1);
|
||||
deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0);
|
||||
draw_sprites(screen->machine,bitmap,cliprect,0);
|
||||
decodev_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
draw_sprites(screen->machine, bitmap, cliprect, 1);
|
||||
decodev_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0);
|
||||
draw_sprites(screen->machine, bitmap, cliprect, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static UINT32 mux_data;
|
||||
|
||||
static WRITE16_HANDLER( mirage_mux_w )
|
||||
{
|
||||
mux_data = data & 0x1f;
|
||||
mirage_state *state = (mirage_state *)space->machine->driver_data;
|
||||
state->mux_data = data & 0x1f;
|
||||
}
|
||||
|
||||
static READ16_HANDLER( mirage_input_r )
|
||||
{
|
||||
switch(mux_data & 0x1f)
|
||||
mirage_state *state = (mirage_state *)space->machine->driver_data;
|
||||
switch (state->mux_data & 0x1f)
|
||||
{
|
||||
case 0x01: return input_port_read(space->machine, "KEY0");
|
||||
case 0x02: return input_port_read(space->machine, "KEY1");
|
||||
@ -158,32 +176,34 @@ static READ16_HANDLER( mirage_input_r )
|
||||
|
||||
static WRITE16_HANDLER( okim1_rombank_w )
|
||||
{
|
||||
okim6295_set_bank_base(devtag_get_device(space->machine, "oki_sfx"), 0x40000 * (data & 0x3));
|
||||
mirage_state *state = (mirage_state *)space->machine->driver_data;
|
||||
okim6295_set_bank_base(state->oki_sfx, 0x40000 * (data & 0x3));
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( okim0_rombank_w )
|
||||
{
|
||||
/*bits 4-6 used on POST? */
|
||||
mirage_state *state = (mirage_state *)space->machine->driver_data;
|
||||
|
||||
okim6295_set_bank_base(devtag_get_device(space->machine, "oki_bgm"), 0x40000 * (data & 0x7));
|
||||
/*bits 4-6 used on POST? */
|
||||
okim6295_set_bank_base(state->oki_bgm, 0x40000 * (data & 0x7));
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( mirage_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x000000, 0x07ffff) AM_ROM
|
||||
/* tilemaps */
|
||||
AM_RANGE(0x100000, 0x101fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data) // 0x100000 - 0x101fff tested
|
||||
AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data) // 0x102000 - 0x102fff tested
|
||||
AM_RANGE(0x100000, 0x101fff) AM_RAM_DEVWRITE("deco_custom", decodev_pf1_data_w) // 0x100000 - 0x101fff tested
|
||||
AM_RANGE(0x102000, 0x103fff) AM_RAM_DEVWRITE("deco_custom", decodev_pf2_data_w) // 0x102000 - 0x102fff tested
|
||||
/* linescroll */
|
||||
AM_RANGE(0x110000, 0x110bff) AM_RAM AM_BASE(&deco16_pf1_rowscroll)
|
||||
AM_RANGE(0x112000, 0x112bff) AM_RAM AM_BASE(&deco16_pf2_rowscroll)
|
||||
AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_GENERIC(spriteram)
|
||||
AM_RANGE(0x110000, 0x110bff) AM_RAM AM_BASE_MEMBER(mirage_state, pf1_rowscroll)
|
||||
AM_RANGE(0x112000, 0x112bff) AM_RAM AM_BASE_MEMBER(mirage_state, pf2_rowscroll)
|
||||
AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_SIZE_MEMBER(mirage_state, spriteram, spriteram_size)
|
||||
AM_RANGE(0x130000, 0x1307ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0x140000, 0x14000f) AM_DEVREADWRITE8("oki_sfx", okim6295_r, okim6295_w, 0x00ff)
|
||||
AM_RANGE(0x150000, 0x15000f) AM_DEVREADWRITE8("oki_bgm", okim6295_r, okim6295_w, 0x00ff)
|
||||
// AM_RANGE(0x140006, 0x140007) AM_READ(random_readers)
|
||||
// AM_RANGE(0x150006, 0x150007) AM_READNOP
|
||||
AM_RANGE(0x160000, 0x160001) AM_WRITENOP
|
||||
AM_RANGE(0x168000, 0x16800f) AM_WRITEONLY AM_BASE(&deco16_pf12_control)
|
||||
AM_RANGE(0x168000, 0x16800f) AM_DEVWRITE("deco_custom", decodev_pf12_control_w)
|
||||
AM_RANGE(0x16a000, 0x16a001) AM_WRITENOP
|
||||
AM_RANGE(0x16c000, 0x16c001) AM_WRITE(okim1_rombank_w)
|
||||
AM_RANGE(0x16c002, 0x16c003) AM_WRITE(okim0_rombank_w)
|
||||
@ -203,74 +223,74 @@ static INPUT_PORTS_START( mirage )
|
||||
PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK )
|
||||
PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Flip_Screen ) )
|
||||
PORT_DIPSETTING( 0x0020, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0040, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0080, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0100, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0200, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0400, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0800, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x4000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPSETTING( 0x0020, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0040, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0080, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0100, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0200, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0400, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x0800, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x4000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
|
||||
|
||||
PORT_START("KEY0")
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A )
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_E )
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_I )
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_M )
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 )
|
||||
PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A )
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_E )
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_I )
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_M )
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 )
|
||||
PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("KEY1")
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_C )
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_G )
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_K )
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
|
||||
PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_C )
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_G )
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_K )
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
|
||||
PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("KEY2")
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
|
||||
PORT_BIT( 0xfff7, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0xfff7, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("KEY3")
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_B )
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_F )
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J )
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_N )
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_B )
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_F )
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J )
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_N )
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
|
||||
PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("KEY4")
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_D )
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_H )
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_L )
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
|
||||
PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_D )
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_H )
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_L )
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
|
||||
PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
@ -315,14 +335,57 @@ static GFXDECODE_START( mirage )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
static int mirage_bank_callback( const int bank )
|
||||
{
|
||||
return ((bank >> 4) & 0x7) * 0x1000;
|
||||
}
|
||||
|
||||
static const deco16ic_interface mirage_deco16ic_intf =
|
||||
{
|
||||
"screen",
|
||||
1, 0, 1,
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
|
||||
0, 16, 0, 16, /* color base (default values) */
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */
|
||||
mirage_bank_callback,
|
||||
mirage_bank_callback,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
static MACHINE_START( mirage )
|
||||
{
|
||||
mirage_state *state = (mirage_state *)machine->driver_data;
|
||||
|
||||
state->maincpu = devtag_get_device(machine, "maincpu");
|
||||
state->deco16ic = devtag_get_device(machine, "deco_custom");
|
||||
state->oki_sfx = devtag_get_device(machine, "oki_sfx");
|
||||
state->oki_bgm = devtag_get_device(machine, "oki_bgm");
|
||||
|
||||
state_save_register_global(machine, state->mux_data);
|
||||
}
|
||||
|
||||
static MACHINE_RESET( mirage )
|
||||
{
|
||||
mirage_state *state = (mirage_state *)machine->driver_data;
|
||||
|
||||
state->mux_data = 0;
|
||||
}
|
||||
|
||||
static MACHINE_DRIVER_START( mirage )
|
||||
|
||||
/* driver data */
|
||||
MDRV_DRIVER_DATA(mirage_state)
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", M68000, 28000000/2)
|
||||
MDRV_CPU_PROGRAM_MAP(mirage_map)
|
||||
MDRV_CPU_VBLANK_INT("screen", irq6_line_hold)
|
||||
|
||||
MDRV_MACHINE_START(mirage)
|
||||
MDRV_MACHINE_RESET(mirage)
|
||||
|
||||
/* video hardware */
|
||||
MDRV_SCREEN_ADD("screen", RASTER)
|
||||
MDRV_SCREEN_REFRESH_RATE(58)
|
||||
@ -334,9 +397,10 @@ static MACHINE_DRIVER_START( mirage )
|
||||
MDRV_GFXDECODE(mirage)
|
||||
MDRV_PALETTE_LENGTH(1024)
|
||||
|
||||
MDRV_VIDEO_START(mirage)
|
||||
MDRV_VIDEO_UPDATE(mirage)
|
||||
|
||||
MDRV_DECO16IC_ADD("deco_custom", mirage_deco16ic_intf)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
@ -380,4 +444,4 @@ static DRIVER_INIT( mirage )
|
||||
deco56_decrypt_gfx(machine, "gfx1");
|
||||
}
|
||||
|
||||
GAME( 1994, mirage, 0, mirage, mirage, mirage, ROT0, "Mitchell", "Mirage Youjuu Mahjongden (Japan)", 0 )
|
||||
GAME( 1994, mirage, 0, mirage, mirage, mirage, ROT0, "Mitchell", "Mirage Youjuu Mahjongden (Japan)", GAME_SUPPORTS_SAVE )
|
||||
|
@ -56,16 +56,10 @@ bootleg todo:
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "includes/decocrpt.h"
|
||||
#include "includes/decoprot.h"
|
||||
#include "includes/deco16ic.h"
|
||||
#include "video/decodev.h"
|
||||
#include "sound/okim6295.h"
|
||||
#include "includes/pktgaldx.h"
|
||||
|
||||
VIDEO_START(pktgaldx);
|
||||
VIDEO_UPDATE(pktgaldx);
|
||||
VIDEO_START(pktgaldb);
|
||||
VIDEO_UPDATE(pktgaldb);
|
||||
|
||||
extern UINT16* pcktgaldb_fgram;
|
||||
extern UINT16* pcktgaldb_sprites;
|
||||
|
||||
/**********************************************************************************/
|
||||
|
||||
@ -79,20 +73,20 @@ static WRITE16_DEVICE_HANDLER(pktgaldx_oki_bank_w)
|
||||
static ADDRESS_MAP_START( pktgaldx_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x000000, 0x07ffff) AM_ROM
|
||||
|
||||
AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data)
|
||||
AM_RANGE(0x102000, 0x102fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data)
|
||||
AM_RANGE(0x110000, 0x1107ff) AM_RAM AM_BASE(&deco16_pf1_rowscroll)
|
||||
AM_RANGE(0x112000, 0x1127ff) AM_RAM AM_BASE(&deco16_pf2_rowscroll)
|
||||
AM_RANGE(0x100000, 0x100fff) AM_RAM_DEVWRITE("deco_custom", decodev_pf1_data_w)
|
||||
AM_RANGE(0x102000, 0x102fff) AM_RAM_DEVWRITE("deco_custom", decodev_pf2_data_w)
|
||||
AM_RANGE(0x110000, 0x1107ff) AM_RAM AM_BASE_MEMBER(pktgaldx_state, pf1_rowscroll)
|
||||
AM_RANGE(0x112000, 0x1127ff) AM_RAM AM_BASE_MEMBER(pktgaldx_state, pf2_rowscroll)
|
||||
|
||||
AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
|
||||
AM_RANGE(0x130000, 0x130fff) AM_RAM_WRITE(deco16_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_SIZE_MEMBER(pktgaldx_state, spriteram, spriteram_size)
|
||||
AM_RANGE(0x130000, 0x130fff) AM_RAM_DEVWRITE("deco_custom", decodev_nonbuffered_palette_w) AM_BASE_GENERIC(paletteram)
|
||||
|
||||
AM_RANGE(0x140000, 0x14000f) AM_DEVWRITE8("oki1", okim6295_w, 0x00ff)
|
||||
AM_RANGE(0x140006, 0x140007) AM_DEVREAD8("oki1", okim6295_r, 0x00ff)
|
||||
AM_RANGE(0x150000, 0x15000f) AM_DEVWRITE8("oki2", okim6295_w, 0x00ff)
|
||||
AM_RANGE(0x150006, 0x150007) AM_DEVREAD8("oki2", okim6295_r, 0x00ff)
|
||||
|
||||
AM_RANGE(0x161800, 0x16180f) AM_WRITEONLY AM_BASE(&deco16_pf12_control)
|
||||
AM_RANGE(0x161800, 0x16180f) AM_DEVWRITE("deco_custom", decodev_pf12_control_w)
|
||||
AM_RANGE(0x164800, 0x164801) AM_DEVWRITE("oki2", pktgaldx_oki_bank_w)
|
||||
AM_RANGE(0x167800, 0x167fff) AM_READWRITE(deco16_104_pktgaldx_prot_r,deco16_104_pktgaldx_prot_w) AM_BASE(&deco16_prot_ram)
|
||||
AM_RANGE(0x170000, 0x17ffff) AM_RAM
|
||||
@ -127,9 +121,9 @@ cpu #0 (PC=0000923C): unmapped program memory word read from 00167DB2 & 00FF
|
||||
|
||||
static ADDRESS_MAP_START( pktgaldb_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x000000, 0x0fffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x100fff) AM_RAM AM_BASE(&pcktgaldb_fgram) // fgram on original?
|
||||
AM_RANGE(0x100000, 0x100fff) AM_RAM AM_BASE_MEMBER(pktgaldx_state, pktgaldb_fgram) // fgram on original?
|
||||
AM_RANGE(0x102000, 0x102fff) AM_RAM // bgram on original?
|
||||
AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE(&pcktgaldb_sprites)
|
||||
AM_RANGE(0x120000, 0x123fff) AM_RAM AM_BASE_MEMBER(pktgaldx_state, pktgaldb_sprites)
|
||||
|
||||
AM_RANGE(0x130000, 0x130fff) AM_RAM // palette on original?
|
||||
|
||||
@ -298,12 +292,44 @@ static GFXDECODE_START( bootleg )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
static int pktgaldx_bank_callback( const int bank )
|
||||
{
|
||||
return ((bank >> 4) & 0x7) * 0x1000;
|
||||
}
|
||||
|
||||
static const deco16ic_interface pktgaldx_deco16ic_intf =
|
||||
{
|
||||
"screen",
|
||||
1, 0, 1,
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
|
||||
0, 16, 0, 16, /* color base (default values) */
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */
|
||||
NULL,
|
||||
pktgaldx_bank_callback,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static MACHINE_START( pktgaldx )
|
||||
{
|
||||
pktgaldx_state *state = (pktgaldx_state *)machine->driver_data;
|
||||
|
||||
state->maincpu = devtag_get_device(machine, "maincpu");
|
||||
state->deco16ic = devtag_get_device(machine, "deco_custom");
|
||||
}
|
||||
|
||||
static MACHINE_DRIVER_START( pktgaldx )
|
||||
|
||||
/* driver data */
|
||||
MDRV_DRIVER_DATA(pktgaldx_state)
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", M68000, 14000000)
|
||||
MDRV_CPU_PROGRAM_MAP(pktgaldx_map)
|
||||
MDRV_CPU_VBLANK_INT("screen", irq6_line_hold)
|
||||
|
||||
MDRV_MACHINE_START(pktgaldx)
|
||||
|
||||
/* video hardware */
|
||||
MDRV_SCREEN_ADD("screen", RASTER)
|
||||
MDRV_SCREEN_REFRESH_RATE(58)
|
||||
@ -315,9 +341,10 @@ static MACHINE_DRIVER_START( pktgaldx )
|
||||
MDRV_PALETTE_LENGTH(4096)
|
||||
MDRV_GFXDECODE(pktgaldx)
|
||||
|
||||
MDRV_VIDEO_START(pktgaldx)
|
||||
MDRV_VIDEO_UPDATE(pktgaldx)
|
||||
|
||||
MDRV_DECO16IC_ADD("deco_custom", pktgaldx_deco16ic_intf)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
@ -334,11 +361,17 @@ MACHINE_DRIVER_END
|
||||
|
||||
|
||||
static MACHINE_DRIVER_START( pktgaldb )
|
||||
|
||||
/* driver data */
|
||||
MDRV_DRIVER_DATA(pktgaldx_state)
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", M68000, 16000000)
|
||||
MDRV_CPU_PROGRAM_MAP(pktgaldb_map)
|
||||
MDRV_CPU_VBLANK_INT("screen", irq6_line_hold)
|
||||
|
||||
MDRV_MACHINE_START(pktgaldx)
|
||||
|
||||
/* video hardware */
|
||||
MDRV_SCREEN_ADD("screen", RASTER)
|
||||
MDRV_SCREEN_REFRESH_RATE(58)
|
||||
@ -350,7 +383,6 @@ static MACHINE_DRIVER_START( pktgaldb )
|
||||
MDRV_PALETTE_LENGTH(4096)
|
||||
MDRV_GFXDECODE(bootleg)
|
||||
|
||||
MDRV_VIDEO_START(pktgaldb)
|
||||
MDRV_VIDEO_UPDATE(pktgaldb)
|
||||
|
||||
/* sound hardware */
|
||||
@ -433,6 +465,6 @@ static DRIVER_INIT( pktgaldx )
|
||||
deco102_decrypt_cpu(machine, "maincpu", 0x42ba, 0x00, 0x00);
|
||||
}
|
||||
|
||||
GAME( 1992, pktgaldx, 0, pktgaldx, pktgaldx, pktgaldx, ROT0, "Data East Corporation", "Pocket Gal Deluxe (Euro v3.00)", 0 )
|
||||
GAME( 1993, pktgaldxj, pktgaldx, pktgaldx, pktgaldx, pktgaldx, ROT0, "Nihon System", "Pocket Gal Deluxe (Japan v3.00)", 0 )
|
||||
GAME( 1992, pktgaldxb, pktgaldx, pktgaldb, pktgaldx, 0, ROT0, "bootleg", "Pocket Gal Deluxe (Euro v3.00, bootleg)", GAME_IMPERFECT_GRAPHICS )
|
||||
GAME( 1992, pktgaldx, 0, pktgaldx, pktgaldx, pktgaldx, ROT0, "Data East Corporation", "Pocket Gal Deluxe (Euro v3.00)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1993, pktgaldxj, pktgaldx, pktgaldx, pktgaldx, pktgaldx, ROT0, "Nihon System", "Pocket Gal Deluxe (Japan v3.00)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1992, pktgaldxb, pktgaldx, pktgaldb, pktgaldx, 0, ROT0, "bootleg", "Pocket Gal Deluxe (Euro v3.00, bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
|
||||
|
@ -90,13 +90,13 @@ Are the OKI M6295 clocks from Heavy Smash are correct at least for the Mitchell
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/decocrpt.h"
|
||||
#include "includes/deco32.h"
|
||||
#include "cpu/arm/arm.h"
|
||||
#include "machine/eeprom.h"
|
||||
#include "sound/okim6295.h"
|
||||
#include "includes/deco16ic.h"
|
||||
#include "video/decodev.h"
|
||||
|
||||
static UINT32 *simpl156_systemram;
|
||||
extern UINT16 *simpl156_pf1_rowscroll,*simpl156_pf2_rowscroll;
|
||||
|
||||
extern VIDEO_START( simpl156 );
|
||||
extern VIDEO_UPDATE( simpl156 );
|
||||
@ -221,7 +221,7 @@ static WRITE32_HANDLER( simpl156_mainram_w )
|
||||
|
||||
static READ32_HANDLER( simpl156_pf1_rowscroll_r )
|
||||
{
|
||||
return deco16_pf1_rowscroll[offset]^0xffff0000;
|
||||
return simpl156_pf1_rowscroll[offset]^0xffff0000;
|
||||
}
|
||||
|
||||
static WRITE32_HANDLER( simpl156_pf1_rowscroll_w )
|
||||
@ -229,12 +229,12 @@ static WRITE32_HANDLER( simpl156_pf1_rowscroll_w )
|
||||
data &=0x0000ffff;
|
||||
mem_mask &=0x0000ffff;
|
||||
|
||||
COMBINE_DATA(&deco16_pf1_rowscroll[offset]);
|
||||
COMBINE_DATA(&simpl156_pf1_rowscroll[offset]);
|
||||
}
|
||||
|
||||
static READ32_HANDLER( simpl156_pf2_rowscroll_r )
|
||||
{
|
||||
return deco16_pf2_rowscroll[offset]^0xffff0000;
|
||||
return simpl156_pf2_rowscroll[offset]^0xffff0000;
|
||||
}
|
||||
|
||||
static WRITE32_HANDLER( simpl156_pf2_rowscroll_w )
|
||||
@ -242,47 +242,7 @@ static WRITE32_HANDLER( simpl156_pf2_rowscroll_w )
|
||||
data &=0x0000ffff;
|
||||
mem_mask &=0x0000ffff;
|
||||
|
||||
COMBINE_DATA(&deco16_pf2_rowscroll[offset]);
|
||||
}
|
||||
|
||||
static READ32_HANDLER ( simpl156_pf12_control_r )
|
||||
{
|
||||
return deco16_pf12_control[offset]^0xffff0000;
|
||||
}
|
||||
|
||||
static WRITE32_HANDLER( simpl156_pf12_control_w )
|
||||
{
|
||||
data &=0x0000ffff;
|
||||
mem_mask &=0x0000ffff;
|
||||
|
||||
COMBINE_DATA(&deco16_pf12_control[offset]);
|
||||
}
|
||||
|
||||
|
||||
static READ32_HANDLER( simpl156_pf1_data_r )
|
||||
{
|
||||
return deco16_pf1_data[offset]^0xffff0000;
|
||||
}
|
||||
|
||||
static WRITE32_HANDLER( simpl156_pf1_data_w )
|
||||
{
|
||||
data &=0x0000ffff;
|
||||
mem_mask &=0x0000ffff;
|
||||
|
||||
deco16_pf1_data_w(space,offset,data,mem_mask);
|
||||
}
|
||||
|
||||
static READ32_HANDLER( simpl156_pf2_data_r )
|
||||
{
|
||||
return deco16_pf2_data[offset]^0xffff0000;
|
||||
}
|
||||
|
||||
|
||||
static WRITE32_HANDLER( simpl156_pf2_data_w )
|
||||
{
|
||||
data &=0x0000ffff;
|
||||
mem_mask &=0x0000ffff;
|
||||
deco16_pf2_data_w(space,offset,data,mem_mask);
|
||||
COMBINE_DATA(&simpl156_pf2_rowscroll[offset]);
|
||||
}
|
||||
|
||||
/* Memory Map controled by PALs */
|
||||
@ -294,10 +254,10 @@ static ADDRESS_MAP_START( joemacr_map, ADDRESS_SPACE_PROGRAM, 32 )
|
||||
AM_RANGE(0x110000, 0x111fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) AM_BASE_SIZE_GENERIC(spriteram)
|
||||
AM_RANGE(0x120000, 0x120fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w)
|
||||
AM_RANGE(0x130000, 0x130003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w)
|
||||
AM_RANGE(0x140000, 0x14001f) AM_READWRITE(simpl156_pf12_control_r, simpl156_pf12_control_w)
|
||||
AM_RANGE(0x150000, 0x151fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w)
|
||||
AM_RANGE(0x152000, 0x153fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w)
|
||||
AM_RANGE(0x154000, 0x155fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w)
|
||||
AM_RANGE(0x140000, 0x14001f) AM_DEVREADWRITE("deco_custom", decodev_pf12_control_dword_r, decodev_pf12_control_dword_w)
|
||||
AM_RANGE(0x150000, 0x151fff) AM_DEVREADWRITE("deco_custom", decodev_pf1_data_dword_r, decodev_pf1_data_dword_w)
|
||||
AM_RANGE(0x152000, 0x153fff) AM_DEVREADWRITE("deco_custom", decodev_pf1_data_dword_r, decodev_pf1_data_dword_w)
|
||||
AM_RANGE(0x154000, 0x155fff) AM_DEVREADWRITE("deco_custom", decodev_pf2_data_dword_r, decodev_pf2_data_dword_w)
|
||||
AM_RANGE(0x160000, 0x161fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w)
|
||||
AM_RANGE(0x164000, 0x165fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w)
|
||||
AM_RANGE(0x170000, 0x170003) AM_READONLY AM_WRITENOP // ?
|
||||
@ -318,10 +278,10 @@ static ADDRESS_MAP_START( chainrec_map, ADDRESS_SPACE_PROGRAM, 32 )
|
||||
AM_RANGE(0x410000, 0x411fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) AM_BASE_SIZE_GENERIC(spriteram)
|
||||
AM_RANGE(0x420000, 0x420fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w)
|
||||
AM_RANGE(0x430000, 0x430003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w)
|
||||
AM_RANGE(0x440000, 0x44001f) AM_READWRITE(simpl156_pf12_control_r, simpl156_pf12_control_w)
|
||||
AM_RANGE(0x450000, 0x451fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w)
|
||||
AM_RANGE(0x452000, 0x453fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w)
|
||||
AM_RANGE(0x454000, 0x455fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w)
|
||||
AM_RANGE(0x440000, 0x44001f) AM_DEVREADWRITE("deco_custom", decodev_pf12_control_dword_r, decodev_pf12_control_dword_w)
|
||||
AM_RANGE(0x450000, 0x451fff) AM_DEVREADWRITE("deco_custom", decodev_pf1_data_dword_r, decodev_pf1_data_dword_w)
|
||||
AM_RANGE(0x452000, 0x453fff) AM_DEVREADWRITE("deco_custom", decodev_pf1_data_dword_r, decodev_pf1_data_dword_w)
|
||||
AM_RANGE(0x454000, 0x455fff) AM_DEVREADWRITE("deco_custom", decodev_pf2_data_dword_r, decodev_pf2_data_dword_w)
|
||||
AM_RANGE(0x460000, 0x461fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w)
|
||||
AM_RANGE(0x464000, 0x465fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w)
|
||||
AM_RANGE(0x470000, 0x470003) AM_READONLY AM_WRITENOP // ??
|
||||
@ -339,10 +299,10 @@ static ADDRESS_MAP_START( magdrop_map, ADDRESS_SPACE_PROGRAM, 32 )
|
||||
AM_RANGE(0x390000, 0x391fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) AM_BASE_SIZE_GENERIC(spriteram)
|
||||
AM_RANGE(0x3a0000, 0x3a0fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w)
|
||||
AM_RANGE(0x3b0000, 0x3b0003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w)
|
||||
AM_RANGE(0x3c0000, 0x3c001f) AM_READWRITE(simpl156_pf12_control_r, simpl156_pf12_control_w)
|
||||
AM_RANGE(0x3d0000, 0x3d1fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w)
|
||||
AM_RANGE(0x3d2000, 0x3d3fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w)
|
||||
AM_RANGE(0x3d4000, 0x3d5fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w)
|
||||
AM_RANGE(0x3c0000, 0x3c001f) AM_DEVREADWRITE("deco_custom", decodev_pf12_control_dword_r, decodev_pf12_control_dword_w)
|
||||
AM_RANGE(0x3d0000, 0x3d1fff) AM_DEVREADWRITE("deco_custom", decodev_pf1_data_dword_r, decodev_pf1_data_dword_w)
|
||||
AM_RANGE(0x3d2000, 0x3d3fff) AM_DEVREADWRITE("deco_custom", decodev_pf1_data_dword_r, decodev_pf1_data_dword_w)
|
||||
AM_RANGE(0x3d4000, 0x3d5fff) AM_DEVREADWRITE("deco_custom", decodev_pf2_data_dword_r, decodev_pf2_data_dword_w)
|
||||
AM_RANGE(0x3e0000, 0x3e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w)
|
||||
AM_RANGE(0x3e4000, 0x3e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w)
|
||||
AM_RANGE(0x3f0000, 0x3f0003) AM_READONLY AM_WRITENOP //?
|
||||
@ -360,10 +320,10 @@ static ADDRESS_MAP_START( magdropp_map, ADDRESS_SPACE_PROGRAM, 32 )
|
||||
AM_RANGE(0x690000, 0x691fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) AM_BASE_SIZE_GENERIC(spriteram)
|
||||
AM_RANGE(0x6a0000, 0x6a0fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w)
|
||||
AM_RANGE(0x6b0000, 0x6b0003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w)
|
||||
AM_RANGE(0x6c0000, 0x6c001f) AM_READWRITE(simpl156_pf12_control_r, simpl156_pf12_control_w)
|
||||
AM_RANGE(0x6d0000, 0x6d1fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w)
|
||||
AM_RANGE(0x6d2000, 0x6d3fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w)
|
||||
AM_RANGE(0x6d4000, 0x6d5fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w)
|
||||
AM_RANGE(0x6c0000, 0x6c001f) AM_DEVREADWRITE("deco_custom", decodev_pf12_control_dword_r, decodev_pf12_control_dword_w)
|
||||
AM_RANGE(0x6d0000, 0x6d1fff) AM_DEVREADWRITE("deco_custom", decodev_pf1_data_dword_r, decodev_pf1_data_dword_w)
|
||||
AM_RANGE(0x6d2000, 0x6d3fff) AM_DEVREADWRITE("deco_custom", decodev_pf1_data_dword_r, decodev_pf1_data_dword_w)
|
||||
AM_RANGE(0x6d4000, 0x6d5fff) AM_DEVREADWRITE("deco_custom", decodev_pf2_data_dword_r, decodev_pf2_data_dword_w)
|
||||
AM_RANGE(0x6e0000, 0x6e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w)
|
||||
AM_RANGE(0x6e4000, 0x6e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w)
|
||||
AM_RANGE(0x6f0000, 0x6f0003) AM_READONLY AM_WRITENOP // ?
|
||||
@ -380,10 +340,10 @@ static ADDRESS_MAP_START( mitchell156_map, ADDRESS_SPACE_PROGRAM, 32 )
|
||||
AM_RANGE(0x190000, 0x191fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) AM_BASE_SIZE_GENERIC(spriteram)
|
||||
AM_RANGE(0x1a0000, 0x1a0fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w)
|
||||
AM_RANGE(0x1b0000, 0x1b0003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w)
|
||||
AM_RANGE(0x1c0000, 0x1c001f) AM_READWRITE(simpl156_pf12_control_r, simpl156_pf12_control_w)
|
||||
AM_RANGE(0x1d0000, 0x1d1fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w)
|
||||
AM_RANGE(0x1d2000, 0x1d3fff) AM_READWRITE(simpl156_pf1_data_r, simpl156_pf1_data_w)
|
||||
AM_RANGE(0x1d4000, 0x1d5fff) AM_READWRITE(simpl156_pf2_data_r, simpl156_pf2_data_w)
|
||||
AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("deco_custom", decodev_pf12_control_dword_r, decodev_pf12_control_dword_w)
|
||||
AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("deco_custom", decodev_pf1_data_dword_r, decodev_pf1_data_dword_w)
|
||||
AM_RANGE(0x1d2000, 0x1d3fff) AM_DEVREADWRITE("deco_custom", decodev_pf1_data_dword_r, decodev_pf1_data_dword_w)
|
||||
AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("deco_custom", decodev_pf2_data_dword_r, decodev_pf2_data_dword_w)
|
||||
AM_RANGE(0x1e0000, 0x1e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w)
|
||||
AM_RANGE(0x1e4000, 0x1e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w)
|
||||
AM_RANGE(0x1f0000, 0x1f0003) AM_READONLY AM_WRITENOP // ?
|
||||
@ -439,6 +399,24 @@ static INTERRUPT_GEN( simpl156_vbl_interrupt )
|
||||
}
|
||||
|
||||
|
||||
static int simpl156_bank_callback(const int bank)
|
||||
{
|
||||
return ((bank >> 4) & 0x7) * 0x1000;
|
||||
}
|
||||
|
||||
static const deco16ic_interface simpl156_deco16ic_intf =
|
||||
{
|
||||
"screen",
|
||||
1, 0, 1,
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
|
||||
0, 16, 0, 16, /* color base (default values) */
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */
|
||||
simpl156_bank_callback,
|
||||
simpl156_bank_callback,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static MACHINE_DRIVER_START( chainrec )
|
||||
/* basic machine hardware */
|
||||
|
||||
@ -461,6 +439,8 @@ static MACHINE_DRIVER_START( chainrec )
|
||||
MDRV_VIDEO_START(simpl156)
|
||||
MDRV_VIDEO_UPDATE(simpl156)
|
||||
|
||||
MDRV_DECO16IC_ADD("deco_custom", simpl156_deco16ic_intf)
|
||||
|
||||
MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
|
||||
|
@ -25,16 +25,15 @@ down hardware (it doesn't write any good sound data btw, mostly zeros).
|
||||
#include "cpu/h6280/h6280.h"
|
||||
#include "sound/2151intf.h"
|
||||
#include "sound/okim6295.h"
|
||||
#include "includes/deco16ic.h"
|
||||
#include "video/decodev.h"
|
||||
#include "includes/supbtime.h"
|
||||
|
||||
VIDEO_START( supbtime );
|
||||
VIDEO_UPDATE( supbtime );
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
static READ16_HANDLER( supbtime_controls_r )
|
||||
{
|
||||
switch (offset<<1)
|
||||
switch (offset << 1)
|
||||
{
|
||||
case 0:
|
||||
return input_port_read(space->machine, "INPUTS");
|
||||
@ -47,14 +46,15 @@ static READ16_HANDLER( supbtime_controls_r )
|
||||
return 0;
|
||||
}
|
||||
|
||||
logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n",cpu_get_pc(space->cpu),offset);
|
||||
logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n", cpu_get_pc(space->cpu), offset);
|
||||
return ~0;
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( sound_w )
|
||||
{
|
||||
supbtime_state *state = (supbtime_state *)space->machine->driver_data;
|
||||
soundlatch_w(space, 0, data & 0xff);
|
||||
cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
|
||||
cpu_set_input_line(state->audiocpu, 0, HOLD_LINE);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
@ -63,32 +63,32 @@ static ADDRESS_MAP_START( supbtime_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x000000, 0x03ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x103fff) AM_RAM
|
||||
AM_RANGE(0x104000, 0x11ffff) AM_WRITENOP /* Nothing there */
|
||||
AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_GENERIC(spriteram)
|
||||
AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_SIZE_MEMBER(supbtime_state, spriteram, spriteram_size)
|
||||
AM_RANGE(0x120800, 0x13ffff) AM_WRITENOP /* Nothing there */
|
||||
AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0x180000, 0x18000f) AM_READ(supbtime_controls_r)
|
||||
AM_RANGE(0x18000a, 0x18000d) AM_WRITENOP
|
||||
AM_RANGE(0x1a0000, 0x1a0001) AM_WRITE(sound_w)
|
||||
AM_RANGE(0x300000, 0x30000f) AM_RAM AM_BASE(&deco16_pf12_control)
|
||||
AM_RANGE(0x320000, 0x321fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data)
|
||||
AM_RANGE(0x322000, 0x323fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data)
|
||||
AM_RANGE(0x340000, 0x3407ff) AM_RAM AM_BASE(&deco16_pf1_rowscroll)
|
||||
AM_RANGE(0x342000, 0x3427ff) AM_RAM AM_BASE(&deco16_pf2_rowscroll)
|
||||
AM_RANGE(0x300000, 0x30000f) AM_RAM_DEVWRITE("deco_custom", decodev_pf12_control_w)
|
||||
AM_RANGE(0x320000, 0x321fff) AM_RAM_DEVWRITE("deco_custom", decodev_pf1_data_w)
|
||||
AM_RANGE(0x322000, 0x323fff) AM_RAM_DEVWRITE("deco_custom", decodev_pf2_data_w)
|
||||
AM_RANGE(0x340000, 0x3407ff) AM_RAM AM_BASE_MEMBER(supbtime_state, pf1_rowscroll)
|
||||
AM_RANGE(0x342000, 0x3427ff) AM_RAM AM_BASE_MEMBER(supbtime_state, pf2_rowscroll)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( chinatwn_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x000000, 0x03ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x100001) AM_WRITE(sound_w)
|
||||
AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_GENERIC(spriteram)
|
||||
AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE_SIZE_MEMBER(supbtime_state, spriteram, spriteram_size)
|
||||
AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0x180000, 0x18000f) AM_READ(supbtime_controls_r)
|
||||
AM_RANGE(0x18000a, 0x18000d) AM_WRITENOP
|
||||
AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM
|
||||
AM_RANGE(0x300000, 0x30000f) AM_RAM AM_BASE(&deco16_pf12_control)
|
||||
AM_RANGE(0x320000, 0x321fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data)
|
||||
AM_RANGE(0x322000, 0x323fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data)
|
||||
AM_RANGE(0x340000, 0x3407ff) AM_RAM AM_BASE(&deco16_pf1_rowscroll) // unused
|
||||
AM_RANGE(0x342000, 0x3427ff) AM_RAM AM_BASE(&deco16_pf2_rowscroll) // unused
|
||||
AM_RANGE(0x300000, 0x30000f) AM_RAM_DEVWRITE("deco_custom", decodev_pf12_control_w)
|
||||
AM_RANGE(0x320000, 0x321fff) AM_RAM_DEVWRITE("deco_custom", decodev_pf1_data_w)
|
||||
AM_RANGE(0x322000, 0x323fff) AM_RAM_DEVWRITE("deco_custom", decodev_pf2_data_w)
|
||||
AM_RANGE(0x340000, 0x3407ff) AM_RAM AM_BASE_MEMBER(supbtime_state, pf1_rowscroll) // unused
|
||||
AM_RANGE(0x342000, 0x3427ff) AM_RAM AM_BASE_MEMBER(supbtime_state, pf2_rowscroll) // unused
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/******************************************************************************/
|
||||
@ -311,7 +311,8 @@ GFXDECODE_END
|
||||
|
||||
static void sound_irq(running_device *device, int state)
|
||||
{
|
||||
cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */
|
||||
supbtime_state *driver_state = (supbtime_state *)device->machine->driver_data;
|
||||
cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
@ -319,8 +320,30 @@ static const ym2151_interface ym2151_config =
|
||||
sound_irq
|
||||
};
|
||||
|
||||
static const deco16ic_interface supbtime_deco16ic_intf =
|
||||
{
|
||||
"screen",
|
||||
1, 0, 1,
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
|
||||
0, 16, 0, 16, /* color base (default values) */
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */
|
||||
NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
static MACHINE_START( supbtime )
|
||||
{
|
||||
supbtime_state *state = (supbtime_state *)machine->driver_data;
|
||||
|
||||
state->maincpu = devtag_get_device(machine, "maincpu");
|
||||
state->audiocpu = devtag_get_device(machine, "audiocpu");
|
||||
state->deco16ic = devtag_get_device(machine, "deco_custom");
|
||||
}
|
||||
|
||||
static MACHINE_DRIVER_START( supbtime )
|
||||
|
||||
/* driver data */
|
||||
MDRV_DRIVER_DATA(supbtime_state)
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", M68000, 14000000)
|
||||
MDRV_CPU_PROGRAM_MAP(supbtime_map)
|
||||
@ -329,6 +352,8 @@ static MACHINE_DRIVER_START( supbtime )
|
||||
MDRV_CPU_ADD("audiocpu", H6280, 32220000/8) /* Custom chip 45, audio section crystal is 32.220 MHz */
|
||||
MDRV_CPU_PROGRAM_MAP(sound_map)
|
||||
|
||||
MDRV_MACHINE_START(supbtime)
|
||||
|
||||
/* video hardware */
|
||||
MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
|
||||
|
||||
@ -342,9 +367,10 @@ static MACHINE_DRIVER_START( supbtime )
|
||||
MDRV_GFXDECODE(supbtime)
|
||||
MDRV_PALETTE_LENGTH(1024)
|
||||
|
||||
MDRV_VIDEO_START(supbtime)
|
||||
MDRV_VIDEO_UPDATE(supbtime)
|
||||
|
||||
MDRV_DECO16IC_ADD("deco_custom", supbtime_deco16ic_intf)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
@ -361,6 +387,9 @@ MACHINE_DRIVER_END
|
||||
|
||||
static MACHINE_DRIVER_START( chinatwn )
|
||||
|
||||
/* driver data */
|
||||
MDRV_DRIVER_DATA(supbtime_state)
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", M68000, 14000000)
|
||||
MDRV_CPU_PROGRAM_MAP(chinatwn_map)
|
||||
@ -369,6 +398,8 @@ static MACHINE_DRIVER_START( chinatwn )
|
||||
MDRV_CPU_ADD("audiocpu", H6280, 32220000/8) /* Custom chip 45, audio section crystal is 32.220 MHz */
|
||||
MDRV_CPU_PROGRAM_MAP(sound_map)
|
||||
|
||||
MDRV_MACHINE_START(supbtime)
|
||||
|
||||
/* video hardware */
|
||||
MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
|
||||
|
||||
@ -382,9 +413,10 @@ static MACHINE_DRIVER_START( chinatwn )
|
||||
MDRV_GFXDECODE(supbtime)
|
||||
MDRV_PALETTE_LENGTH(1024)
|
||||
|
||||
MDRV_VIDEO_START(supbtime)
|
||||
MDRV_VIDEO_UPDATE(supbtime)
|
||||
|
||||
MDRV_DECO16IC_ADD("deco_custom", supbtime_deco16ic_intf)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
@ -479,7 +511,7 @@ ROM_END
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
GAME( 1990, supbtime, 0, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (World, set 1)", 0 )
|
||||
GAME( 1990, supbtimea,supbtime, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (World, set 2)", 0 )
|
||||
GAME( 1990, supbtimej,supbtime, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (Japan)", 0 )
|
||||
GAME( 1991, chinatwn, 0, chinatwn, chinatwn, 0, ROT0, "Data East Corporation", "China Town (Japan)", 0 )
|
||||
GAME( 1990, supbtime, 0, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (World, set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1990, supbtimea,supbtime, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (World, set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1990, supbtimej,supbtime, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (Japan)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1991, chinatwn, 0, chinatwn, chinatwn, 0, ROT0, "Data East Corporation", "China Town (Japan)", GAME_SUPPORTS_SAVE )
|
||||
|
@ -46,19 +46,17 @@ Stephh's notes (based on the games M68000 code and some tests) :
|
||||
#include "sound/2151intf.h"
|
||||
#include "sound/3812intf.h"
|
||||
#include "sound/okim6295.h"
|
||||
#include "includes/deco16ic.h"
|
||||
#include "includes/tumblep.h"
|
||||
#include "video/decodev.h"
|
||||
|
||||
#define TUMBLEP_HACK 0
|
||||
|
||||
VIDEO_START( tumblep );
|
||||
VIDEO_UPDATE( tumblep );
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#ifdef UNUSED_FUNCTION
|
||||
static WRITE16_DEVICE_HANDLER( tumblep_oki_w )
|
||||
{
|
||||
okim6295_w(0,data&0xff);
|
||||
okim6295_w(0, data & 0xff);
|
||||
/* STUFF IN OTHER BYTE TOO..*/
|
||||
}
|
||||
|
||||
@ -70,15 +68,17 @@ static READ16_HANDLER( tumblep_prot_r )
|
||||
|
||||
static WRITE16_HANDLER( tumblep_sound_w )
|
||||
{
|
||||
tumblep_state *state = (tumblep_state *)space->machine->driver_data;
|
||||
soundlatch_w(space, 0, data & 0xff);
|
||||
cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
|
||||
cpu_set_input_line(state->audiocpu, 0, HOLD_LINE);
|
||||
}
|
||||
|
||||
#ifdef UNUSED_FUNCTION
|
||||
static WRITE16_HANDLER( jumppop_sound_w )
|
||||
{
|
||||
tumblep_state *state = (tumblep_state *)space->machine->driver_data;
|
||||
soundlatch_w(space, 0, data & 0xff);
|
||||
cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE );
|
||||
cputag_set_input_line(state->audiocpu, 0, ASSERT_LINE );
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -86,7 +86,7 @@ static WRITE16_HANDLER( jumppop_sound_w )
|
||||
|
||||
static READ16_HANDLER( tumblepop_controls_r )
|
||||
{
|
||||
switch (offset<<1)
|
||||
switch (offset << 1)
|
||||
{
|
||||
case 0:
|
||||
return input_port_read(space->machine, "PLAYERS");
|
||||
@ -116,12 +116,12 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x140000, 0x1407ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0x180000, 0x18000f) AM_READ(tumblepop_controls_r)
|
||||
AM_RANGE(0x18000c, 0x18000d) AM_WRITENOP
|
||||
AM_RANGE(0x1a0000, 0x1a07ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
|
||||
AM_RANGE(0x300000, 0x30000f) AM_WRITEONLY AM_BASE(&deco16_pf12_control)
|
||||
AM_RANGE(0x320000, 0x320fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data)
|
||||
AM_RANGE(0x322000, 0x322fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data)
|
||||
AM_RANGE(0x340000, 0x3407ff) AM_WRITEONLY AM_BASE(&deco16_pf1_rowscroll) // unused
|
||||
AM_RANGE(0x342000, 0x3427ff) AM_WRITEONLY AM_BASE(&deco16_pf2_rowscroll) // unused
|
||||
AM_RANGE(0x1a0000, 0x1a07ff) AM_RAM AM_BASE_SIZE_MEMBER(tumblep_state, spriteram, spriteram_size)
|
||||
AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("deco_custom", decodev_pf12_control_w)
|
||||
AM_RANGE(0x320000, 0x320fff) AM_RAM_DEVWRITE("deco_custom", decodev_pf1_data_w)
|
||||
AM_RANGE(0x322000, 0x322fff) AM_RAM_DEVWRITE("deco_custom", decodev_pf2_data_w)
|
||||
AM_RANGE(0x340000, 0x3407ff) AM_WRITEONLY AM_BASE_MEMBER(tumblep_state, pf1_rowscroll) // unused
|
||||
AM_RANGE(0x342000, 0x3427ff) AM_WRITEONLY AM_BASE_MEMBER(tumblep_state, pf2_rowscroll) // unused
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/******************************************************************************/
|
||||
@ -274,7 +274,8 @@ GFXDECODE_END
|
||||
|
||||
static void sound_irq(running_device *device, int state)
|
||||
{
|
||||
cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */
|
||||
tumblep_state *driver_state = (tumblep_state *)device->machine->driver_data;
|
||||
cpu_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
|
||||
}
|
||||
|
||||
static const ym2151_interface ym2151_config =
|
||||
@ -282,8 +283,30 @@ static const ym2151_interface ym2151_config =
|
||||
sound_irq
|
||||
};
|
||||
|
||||
static const deco16ic_interface tumblep_deco16ic_intf =
|
||||
{
|
||||
"screen",
|
||||
1, 0, 1,
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* trans masks (default values) */
|
||||
0, 16, 0, 16, /* color base (default values) */
|
||||
0x0f, 0x0f, 0x0f, 0x0f, /* color masks (default values) */
|
||||
NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
static MACHINE_START( tumblep )
|
||||
{
|
||||
tumblep_state *state = (tumblep_state *)machine->driver_data;
|
||||
|
||||
state->maincpu = devtag_get_device(machine, "maincpu");
|
||||
state->audiocpu = devtag_get_device(machine, "audiocpu");
|
||||
state->deco16ic = devtag_get_device(machine, "deco_custom");
|
||||
}
|
||||
|
||||
static MACHINE_DRIVER_START( tumblep )
|
||||
|
||||
/* driver data */
|
||||
MDRV_DRIVER_DATA(tumblep_state)
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", M68000, 14000000)
|
||||
MDRV_CPU_PROGRAM_MAP(main_map)
|
||||
@ -292,6 +315,8 @@ static MACHINE_DRIVER_START( tumblep )
|
||||
MDRV_CPU_ADD("audiocpu", H6280, 32220000/8) /* Custom chip 45; Audio section crystal is 32.220 MHz */
|
||||
MDRV_CPU_PROGRAM_MAP(sound_map)
|
||||
|
||||
MDRV_MACHINE_START(tumblep)
|
||||
|
||||
/* video hardware */
|
||||
MDRV_SCREEN_ADD("screen", RASTER)
|
||||
MDRV_SCREEN_REFRESH_RATE(58)
|
||||
@ -303,9 +328,10 @@ static MACHINE_DRIVER_START( tumblep )
|
||||
MDRV_GFXDECODE(tumblep)
|
||||
MDRV_PALETTE_LENGTH(1024)
|
||||
|
||||
MDRV_VIDEO_START(tumblep)
|
||||
MDRV_VIDEO_UPDATE(tumblep)
|
||||
|
||||
MDRV_DECO16IC_ADD("deco_custom", tumblep_deco16ic_intf)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
@ -383,6 +409,6 @@ static DRIVER_INIT( tumblep )
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
GAME( 1991, tumblep, 0, tumblep, tumblep, tumblep, ROT0, "Data East Corporation", "Tumble Pop (World)", 0 )
|
||||
GAME( 1991, tumblepj, tumblep, tumblep, tumblep, tumblep, ROT0, "Data East Corporation", "Tumble Pop (Japan)", 0 )
|
||||
GAME( 1991, tumblep, 0, tumblep, tumblep, tumblep, ROT0, "Data East Corporation", "Tumble Pop (World)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1991, tumblepj, tumblep, tumblep, tumblep, tumblep, ROT0, "Data East Corporation", "Tumble Pop (Japan)", GAME_SUPPORTS_SAVE )
|
||||
/* for bootlegs and games on similar hardware see tumbleb.c */
|
||||
|
27
src/mame/includes/dietgo.h
Normal file
27
src/mame/includes/dietgo.h
Normal file
@ -0,0 +1,27 @@
|
||||
/*************************************************************************
|
||||
|
||||
Diet Go Go
|
||||
|
||||
*************************************************************************/
|
||||
|
||||
typedef struct _dietgo_state dietgo_state;
|
||||
struct _dietgo_state
|
||||
{
|
||||
/* memory pointers */
|
||||
UINT16 * pf1_rowscroll;
|
||||
UINT16 * pf2_rowscroll;
|
||||
UINT16 * spriteram;
|
||||
// UINT16 * paletteram; // currently this uses generic palette handling (in decodev.c)
|
||||
size_t spriteram_size;
|
||||
|
||||
/* devices */
|
||||
running_device *maincpu;
|
||||
running_device *audiocpu;
|
||||
running_device *deco16ic;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*----------- defined in video/dietgo.c -----------*/
|
||||
|
||||
VIDEO_UPDATE( dietgo );
|
30
src/mame/includes/pktgaldx.h
Normal file
30
src/mame/includes/pktgaldx.h
Normal file
@ -0,0 +1,30 @@
|
||||
/*************************************************************************
|
||||
|
||||
Pocket Gal Deluxe
|
||||
|
||||
*************************************************************************/
|
||||
|
||||
typedef struct _pktgaldx_state pktgaldx_state;
|
||||
struct _pktgaldx_state
|
||||
{
|
||||
/* memory pointers */
|
||||
UINT16 * pf1_rowscroll;
|
||||
UINT16 * pf2_rowscroll;
|
||||
UINT16 * spriteram;
|
||||
// UINT16 * paletteram; // currently this uses generic palette handling (in decodev.c)
|
||||
size_t spriteram_size;
|
||||
|
||||
UINT16* pktgaldb_fgram;
|
||||
UINT16* pktgaldb_sprites;
|
||||
|
||||
/* devices */
|
||||
running_device *maincpu;
|
||||
running_device *deco16ic;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*----------- defined in video/pktgaldx.c -----------*/
|
||||
|
||||
VIDEO_UPDATE( pktgaldx );
|
||||
VIDEO_UPDATE( pktgaldb );
|
29
src/mame/includes/supbtime.h
Normal file
29
src/mame/includes/supbtime.h
Normal file
@ -0,0 +1,29 @@
|
||||
/*************************************************************************
|
||||
|
||||
Super Burger Time & China Town
|
||||
|
||||
*************************************************************************/
|
||||
|
||||
typedef struct _supbtime_state supbtime_state;
|
||||
struct _supbtime_state
|
||||
{
|
||||
/* memory pointers */
|
||||
UINT16 * pf1_rowscroll;
|
||||
UINT16 * pf2_rowscroll;
|
||||
UINT16 * spriteram;
|
||||
// UINT16 * paletteram; // currently this uses generic palette handling (in decodev.c)
|
||||
size_t spriteram_size;
|
||||
|
||||
/* video-related */
|
||||
|
||||
/* devices */
|
||||
running_device *maincpu;
|
||||
running_device *audiocpu;
|
||||
running_device *deco16ic;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*----------- defined in video/supbtime.c -----------*/
|
||||
|
||||
VIDEO_UPDATE( supbtime );
|
27
src/mame/includes/tumblep.h
Normal file
27
src/mame/includes/tumblep.h
Normal file
@ -0,0 +1,27 @@
|
||||
/*************************************************************************
|
||||
|
||||
Tumble Pop
|
||||
|
||||
*************************************************************************/
|
||||
|
||||
typedef struct _tumblep_state tumblep_state;
|
||||
struct _tumblep_state
|
||||
{
|
||||
/* memory pointers */
|
||||
UINT16 * pf1_rowscroll;
|
||||
UINT16 * pf2_rowscroll;
|
||||
UINT16 * spriteram;
|
||||
// UINT16 * paletteram; // currently this uses generic palette handling (in decodev.c)
|
||||
size_t spriteram_size;
|
||||
|
||||
/* devices */
|
||||
running_device *maincpu;
|
||||
running_device *audiocpu;
|
||||
running_device *deco16ic;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*----------- defined in video/tumblep.c -----------*/
|
||||
|
||||
VIDEO_UPDATE( tumblep );
|
@ -593,6 +593,7 @@ $(MAMEOBJ)/dataeast.a: \
|
||||
$(MACHINE)/decocrpt.o \
|
||||
$(MACHINE)/decoprot.o \
|
||||
$(VIDEO)/deco16ic.o \
|
||||
$(VIDEO)/decodev.o \
|
||||
|
||||
$(MAMEOBJ)/dooyong.a: \
|
||||
$(DRIVERS)/dooyong.o $(VIDEO)/dooyong.o \
|
||||
|
@ -1,10 +1,15 @@
|
||||
#include "emu.h"
|
||||
#include "includes/deco16ic.h"
|
||||
#include "video/decodev.h"
|
||||
|
||||
UINT16 *boogwing_pf1_rowscroll,*boogwing_pf2_rowscroll;
|
||||
UINT16 *boogwing_pf3_rowscroll,*boogwing_pf4_rowscroll;
|
||||
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect, UINT16* spriteram_base, int gfx_region)
|
||||
{
|
||||
running_device *deco16ic = devtag_get_device(machine, "deco_custom");
|
||||
int offs;
|
||||
int flipscreen=!flip_screen_get(machine);
|
||||
UINT16 priority = decodev_priority_r(deco16ic, 0, 0xffff);
|
||||
|
||||
for (offs = 0x400-4;offs >= 0;offs -= 4)
|
||||
{
|
||||
@ -40,7 +45,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
if (spriteram_base[offs+2]&0x2000)
|
||||
alpha = 0x80;
|
||||
|
||||
if (deco16_priority==0x2)
|
||||
if (priority==0x2)
|
||||
{
|
||||
// Additional sprite alpha in this mode
|
||||
if (spriteram_base[offs+2]&0x8000)
|
||||
@ -71,7 +76,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
spri=32;
|
||||
|
||||
// Sprite vs playfield
|
||||
if (deco16_priority==0x1)
|
||||
if (priority==0x1)
|
||||
{
|
||||
if ((spriteram_base[offs+2]&0xc000))
|
||||
pri=16;
|
||||
@ -94,7 +99,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
if (x >= 320) x -= 512;
|
||||
if (y >= 256) y -= 512;
|
||||
y = 240 - y;
|
||||
x = 304 - x;
|
||||
x = 304 - x;
|
||||
|
||||
sprite &= ~multi;
|
||||
if (fy)
|
||||
@ -117,7 +122,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
|
||||
while (multi >= 0)
|
||||
{
|
||||
deco16_pdrawgfx(
|
||||
decodev_pdrawgfx(
|
||||
deco16ic,
|
||||
bitmap, cliprect, machine->gfx[gfx_region],
|
||||
sprite - multi * inc,
|
||||
colour,
|
||||
@ -130,73 +136,64 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
}
|
||||
}
|
||||
|
||||
static int boogwing_bank_callback(const int bank)
|
||||
{
|
||||
return ((bank>>4) & 0x7) * 0x1000;
|
||||
}
|
||||
|
||||
static int boogwing_bank_callback2(const int bank)
|
||||
{
|
||||
int offset=((bank>>4) & 0x7) * 0x1000;
|
||||
if ((bank&0xf)==0xa)
|
||||
offset+=0x800; // strange - transporter level
|
||||
return offset;
|
||||
}
|
||||
|
||||
VIDEO_START(boogwing)
|
||||
{
|
||||
deco16_2_video_init(machine, 0);
|
||||
// deco16_2_video_init(machine, 0);
|
||||
|
||||
deco16_set_tilemap_bank_callback(1,boogwing_bank_callback);
|
||||
deco16_set_tilemap_bank_callback(2,boogwing_bank_callback2);
|
||||
deco16_set_tilemap_bank_callback(3,boogwing_bank_callback2);
|
||||
deco16_set_tilemap_colour_base(1,0);
|
||||
deco16_set_tilemap_transparency_mask(1, 0x1f); // 5bpp graphics
|
||||
// deco16_set_tilemap_bank_callback(1,boogwing_bank_callback);
|
||||
// deco16_set_tilemap_bank_callback(2,boogwing_bank_callback2);
|
||||
// deco16_set_tilemap_bank_callback(3,boogwing_bank_callback2);
|
||||
// deco16_set_tilemap_colour_base(1,0);
|
||||
// deco16_set_tilemap_transparency_mask(1, 0x1f); // 5bpp graphics
|
||||
}
|
||||
|
||||
VIDEO_UPDATE(boogwing)
|
||||
{
|
||||
flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
|
||||
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
|
||||
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
|
||||
running_device *deco16ic = devtag_get_device(screen->machine, "deco_custom");
|
||||
UINT16 flip = decodev_pf12_control_r(deco16ic, 0, 0xffff);
|
||||
UINT16 priority = decodev_priority_r(deco16ic, 0, 0xffff);
|
||||
|
||||
flip_screen_set(screen->machine, BIT(flip, 7));
|
||||
decodev_pf12_update(deco16ic, boogwing_pf1_rowscroll, boogwing_pf2_rowscroll);
|
||||
decodev_pf34_update(deco16ic, boogwing_pf3_rowscroll, boogwing_pf4_rowscroll);
|
||||
|
||||
/* Draw playfields */
|
||||
deco16_clear_sprite_priority_bitmap();
|
||||
bitmap_fill(bitmap,cliprect,screen->machine->pens[0x400]); /* pen not confirmed */
|
||||
bitmap_fill(screen->machine->priority_bitmap,NULL,0);
|
||||
decodev_clear_sprite_priority_bitmap(deco16ic);
|
||||
bitmap_fill(bitmap, cliprect, screen->machine->pens[0x400]); /* pen not confirmed */
|
||||
bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
|
||||
|
||||
// bit&0x8 is definitely some kind of palette effect
|
||||
// bit&0x4 combines playfields
|
||||
if ((deco16_priority&0x7)==0x5)
|
||||
if ((priority & 0x7) == 0x5)
|
||||
{
|
||||
deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
|
||||
deco16_tilemap_34_combine_draw(screen,bitmap,cliprect,0,32);
|
||||
decodev_tilemap_2_draw(deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
decodev_tilemap_34_combine_draw(deco16ic, bitmap, cliprect, 0, 32);
|
||||
}
|
||||
else if ((deco16_priority&0x7)==0x1 || (deco16_priority&0x7)==0x2)
|
||||
else if ((priority & 0x7) == 0x1 || (priority & 0x7) == 0x2)
|
||||
{
|
||||
deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
|
||||
deco16_tilemap_2_draw(screen,bitmap,cliprect,0,8);
|
||||
deco16_tilemap_3_draw(screen,bitmap,cliprect,0,32);
|
||||
decodev_tilemap_4_draw(deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
decodev_tilemap_2_draw(deco16ic, bitmap, cliprect, 0, 8);
|
||||
decodev_tilemap_3_draw(deco16ic, bitmap, cliprect, 0, 32);
|
||||
}
|
||||
else if ((deco16_priority&0x7)==0x3)
|
||||
else if ((priority & 0x7) == 0x3)
|
||||
{
|
||||
deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
|
||||
deco16_tilemap_2_draw(screen,bitmap,cliprect,0,8);
|
||||
decodev_tilemap_4_draw(deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
decodev_tilemap_2_draw(deco16ic, bitmap, cliprect, 0, 8);
|
||||
|
||||
// This mode uses playfield 3 to shadow sprites & playfield 2 (instead of
|
||||
// regular alpha-blending, the destination is inverted). Not yet implemented.
|
||||
// deco16_tilemap_3_draw(screen,bitmap,cliprect,TILEMAP_DRAW_ALPHA(0x80),32);
|
||||
// decodev_tilemap_3_draw(deco16ic, bitmap, cliprect, TILEMAP_DRAW_ALPHA(0x80), 32);
|
||||
}
|
||||
else
|
||||
{
|
||||
deco16_tilemap_4_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
|
||||
deco16_tilemap_3_draw(screen,bitmap,cliprect,0,8);
|
||||
deco16_tilemap_2_draw(screen,bitmap,cliprect,0,32);
|
||||
decodev_tilemap_4_draw(deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
decodev_tilemap_3_draw(deco16ic, bitmap, cliprect, 0, 8);
|
||||
decodev_tilemap_2_draw(deco16ic, bitmap, cliprect, 0, 32);
|
||||
}
|
||||
|
||||
draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 3);
|
||||
draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram2.u16, 4);
|
||||
|
||||
deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0);
|
||||
decodev_tilemap_1_draw(deco16ic, bitmap, cliprect, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
1433
src/mame/video/decodev.c
Normal file
1433
src/mame/video/decodev.c
Normal file
File diff suppressed because it is too large
Load Diff
117
src/mame/video/decodev.h
Normal file
117
src/mame/video/decodev.h
Normal file
@ -0,0 +1,117 @@
|
||||
/*************************************************************************
|
||||
|
||||
decodev.h
|
||||
|
||||
Implementation of various Data East custom video ICs
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
#include "devcb.h"
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
TYPE DEFINITIONS
|
||||
***************************************************************************/
|
||||
|
||||
typedef int (*deco16_bank_cb)( const int bank );
|
||||
|
||||
|
||||
typedef struct _deco16ic_interface deco16ic_interface;
|
||||
struct _deco16ic_interface
|
||||
{
|
||||
const char *screen;
|
||||
int pf12_only;
|
||||
int split;
|
||||
int full_width;
|
||||
|
||||
int trans_mask1, trans_mask2, trans_mask3, trans_mask4;
|
||||
int col_base1, col_base2, col_base3, col_base4;
|
||||
int col_mask1, col_mask2, col_mask3, col_mask4;
|
||||
deco16_bank_cb bank_cb0, bank_cb1, bank_cb2, bank_cb3;
|
||||
};
|
||||
|
||||
/***************************************************************************
|
||||
FUNCTION PROTOTYPES
|
||||
***************************************************************************/
|
||||
|
||||
DEVICE_GET_INFO( deco16ic );
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define DECO16IC DEVICE_GET_INFO_NAME( deco16ic )
|
||||
|
||||
#define MDRV_DECO16IC_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, DECO16IC, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE I/O FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
WRITE16_DEVICE_HANDLER( decodev_pf1_data_w );
|
||||
WRITE16_DEVICE_HANDLER( decodev_pf2_data_w );
|
||||
WRITE16_DEVICE_HANDLER( decodev_pf3_data_w );
|
||||
WRITE16_DEVICE_HANDLER( decodev_pf4_data_w );
|
||||
|
||||
READ16_DEVICE_HANDLER( decodev_pf1_data_r );
|
||||
READ16_DEVICE_HANDLER( decodev_pf2_data_r );
|
||||
READ16_DEVICE_HANDLER( decodev_pf3_data_r );
|
||||
READ16_DEVICE_HANDLER( decodev_pf4_data_r );
|
||||
|
||||
WRITE16_DEVICE_HANDLER( decodev_pf12_control_w );
|
||||
WRITE16_DEVICE_HANDLER( decodev_pf34_control_w );
|
||||
|
||||
READ16_DEVICE_HANDLER( decodev_pf12_control_r );
|
||||
READ16_DEVICE_HANDLER( decodev_pf34_control_r );
|
||||
|
||||
|
||||
WRITE32_DEVICE_HANDLER( decodev_pf1_data_dword_w );
|
||||
WRITE32_DEVICE_HANDLER( decodev_pf2_data_dword_w );
|
||||
WRITE32_DEVICE_HANDLER( decodev_pf3_data_dword_w );
|
||||
WRITE32_DEVICE_HANDLER( decodev_pf4_data_dword_w );
|
||||
|
||||
READ32_DEVICE_HANDLER( decodev_pf1_data_dword_r );
|
||||
READ32_DEVICE_HANDLER( decodev_pf2_data_dword_r );
|
||||
READ32_DEVICE_HANDLER( decodev_pf3_data_dword_r );
|
||||
READ32_DEVICE_HANDLER( decodev_pf4_data_dword_r );
|
||||
|
||||
WRITE32_DEVICE_HANDLER( decodev_pf12_control_dword_w );
|
||||
WRITE32_DEVICE_HANDLER( decodev_pf34_control_dword_w );
|
||||
|
||||
READ32_DEVICE_HANDLER( decodev_pf12_control_dword_r );
|
||||
READ32_DEVICE_HANDLER( decodev_pf34_control_dword_r );
|
||||
|
||||
|
||||
WRITE16_DEVICE_HANDLER( decodev_nonbuffered_palette_w );
|
||||
WRITE16_DEVICE_HANDLER( decodev_buffered_palette_w );
|
||||
WRITE16_DEVICE_HANDLER( decodev_palette_dma_w );
|
||||
|
||||
WRITE16_DEVICE_HANDLER( decodev_priority_w );
|
||||
READ16_DEVICE_HANDLER( decodev_priority_r );
|
||||
|
||||
READ16_DEVICE_HANDLER( decodev_71_r );
|
||||
|
||||
void decodev_print_debug_info(running_device *device, bitmap_t *bitmap);
|
||||
|
||||
void decodev_pf12_update(running_device *device, const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr);
|
||||
void decodev_pf34_update(running_device *device, const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr);
|
||||
|
||||
void decodev_tilemap_1_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
|
||||
void decodev_tilemap_2_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
|
||||
void decodev_tilemap_3_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
|
||||
void decodev_tilemap_4_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
|
||||
|
||||
/* used by boogwing */
|
||||
void decodev_tilemap_34_combine_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
|
||||
|
||||
|
||||
/* used by boogwing */
|
||||
void decodev_clear_sprite_priority_bitmap(running_device *device);
|
||||
void decodev_pdrawgfx(
|
||||
running_device *device,
|
||||
bitmap_t *dest,const rectangle *clip,const gfx_element *gfx,
|
||||
UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
|
||||
int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri,UINT8 alpha);
|
@ -1,24 +1,29 @@
|
||||
#include "emu.h"
|
||||
#include "includes/deco16ic.h"
|
||||
#include "video/decodev.h"
|
||||
#include "includes/dietgo.h"
|
||||
|
||||
static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectangle *cliprect)
|
||||
|
||||
static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect )
|
||||
{
|
||||
UINT16 *spriteram16 = machine->generic.spriteram.u16;
|
||||
dietgo_state *state = (dietgo_state *)machine->driver_data;
|
||||
UINT16 *spriteram = state->spriteram;
|
||||
int offs;
|
||||
|
||||
for (offs = 0;offs < 0x400;offs += 4)
|
||||
for (offs = 0; offs < 0x400; offs += 4)
|
||||
{
|
||||
int x,y,sprite,colour,multi,fx,fy,inc,flash,mult;
|
||||
int x, y, sprite, colour, multi, fx, fy, inc, flash, mult;
|
||||
|
||||
sprite = spriteram16[offs+1];
|
||||
if (!sprite) continue;
|
||||
sprite = spriteram[offs + 1];
|
||||
if (!sprite)
|
||||
continue;
|
||||
|
||||
y = spriteram16[offs];
|
||||
flash=y&0x1000;
|
||||
if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue;
|
||||
y = spriteram[offs];
|
||||
flash = y & 0x1000;
|
||||
if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1))
|
||||
continue;
|
||||
|
||||
x = spriteram16[offs+2];
|
||||
colour = (x >>9) & 0x1f;
|
||||
x = spriteram[offs + 2];
|
||||
colour = (x >> 9) & 0x1f;
|
||||
|
||||
fx = y & 0x2000;
|
||||
fy = y & 0x4000;
|
||||
@ -29,9 +34,10 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectan
|
||||
if (x >= 320) x -= 512;
|
||||
if (y >= 256) y -= 512;
|
||||
y = 240 - y;
|
||||
x = 304 - x;
|
||||
x = 304 - x;
|
||||
|
||||
if (x>320) continue;
|
||||
if (x > 320)
|
||||
continue;
|
||||
|
||||
sprite &= ~multi;
|
||||
if (fy)
|
||||
@ -44,13 +50,13 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectan
|
||||
|
||||
if (flip_screen_get(machine))
|
||||
{
|
||||
y=240-y;
|
||||
x=304-x;
|
||||
if (fx) fx=0; else fx=1;
|
||||
if (fy) fy=0; else fy=1;
|
||||
mult=16;
|
||||
y = 240 - y;
|
||||
x = 304 - x;
|
||||
if (fx) fx = 0; else fx = 1;
|
||||
if (fy) fy = 0; else fy = 1;
|
||||
mult = 16;
|
||||
}
|
||||
else mult=-16;
|
||||
else mult = -16;
|
||||
|
||||
while (multi >= 0)
|
||||
{
|
||||
@ -65,29 +71,20 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectan
|
||||
}
|
||||
}
|
||||
|
||||
static int dietgo_bank_callback(const int bank)
|
||||
|
||||
VIDEO_UPDATE( dietgo )
|
||||
{
|
||||
return ((bank>>4)&0x7) * 0x1000;
|
||||
}
|
||||
dietgo_state *state = (dietgo_state *)screen->machine->driver_data;
|
||||
UINT16 flip = decodev_pf12_control_r(state->deco16ic, 0, 0xffff);
|
||||
|
||||
VIDEO_START(dietgo)
|
||||
{
|
||||
deco16_1_video_init(machine);
|
||||
flip_screen_set(screen->machine, BIT(flip, 7));
|
||||
decodev_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll);
|
||||
|
||||
deco16_set_tilemap_bank_callback(0, dietgo_bank_callback);
|
||||
deco16_set_tilemap_bank_callback(1, dietgo_bank_callback);
|
||||
}
|
||||
bitmap_fill(bitmap, cliprect, 256); /* not verified */
|
||||
|
||||
VIDEO_UPDATE(dietgo)
|
||||
{
|
||||
flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
|
||||
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
|
||||
decodev_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
decodev_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0);
|
||||
|
||||
bitmap_fill(bitmap,cliprect,256); /* not verified */
|
||||
|
||||
deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
|
||||
deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0);
|
||||
|
||||
draw_sprites(screen->machine,bitmap,cliprect);
|
||||
draw_sprites(screen->machine, bitmap, cliprect);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,29 +1,29 @@
|
||||
#include "emu.h"
|
||||
#include "includes/deco16ic.h"
|
||||
#include "video/decodev.h"
|
||||
#include "includes/pktgaldx.h"
|
||||
|
||||
UINT16* pcktgaldb_fgram;
|
||||
UINT16* pcktgaldb_sprites;
|
||||
|
||||
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
|
||||
static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
|
||||
{
|
||||
UINT16 *spriteram16 = machine->generic.spriteram.u16;
|
||||
pktgaldx_state *state = (pktgaldx_state *)machine->driver_data;
|
||||
UINT16 *spriteram = state->spriteram;
|
||||
int offs;
|
||||
int flipscreen=!flip_screen_get(machine);
|
||||
int flipscreen = !flip_screen_get(machine);
|
||||
|
||||
for (offs = 0;offs < 0x400;offs += 4)
|
||||
for (offs = 0; offs < 0x400; offs += 4)
|
||||
{
|
||||
int x,y,sprite,colour,multi,fx,fy,inc,flash,mult;
|
||||
int x, y, sprite, colour, multi, fx, fy, inc, flash, mult;
|
||||
|
||||
sprite = spriteram16[offs+1];
|
||||
if (!sprite) continue;
|
||||
sprite = spriteram[offs+1];
|
||||
if (!sprite)
|
||||
continue;
|
||||
|
||||
y = spriteram16[offs];
|
||||
flash=y&0x1000;
|
||||
if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue;
|
||||
y = spriteram[offs];
|
||||
flash = y & 0x1000;
|
||||
if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1))
|
||||
continue;
|
||||
|
||||
x = spriteram16[offs+2];
|
||||
colour = (x >>9) & 0x1f;
|
||||
x = spriteram[offs + 2];
|
||||
colour = (x >> 9) & 0x1f;
|
||||
|
||||
fx = y & 0x2000;
|
||||
fy = y & 0x4000;
|
||||
@ -34,9 +34,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
if (x >= 320) x -= 512;
|
||||
if (y >= 256) y -= 512;
|
||||
y = 240 - y;
|
||||
x = 304 - x;
|
||||
x = 304 - x;
|
||||
|
||||
if (x>320) continue;
|
||||
if (x > 320)
|
||||
continue;
|
||||
|
||||
sprite &= ~multi;
|
||||
if (fy)
|
||||
@ -49,13 +50,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
|
||||
if (flipscreen)
|
||||
{
|
||||
y=240-y;
|
||||
x=304-x;
|
||||
if (fx) fx=0; else fx=1;
|
||||
if (fy) fy=0; else fy=1;
|
||||
mult=16;
|
||||
y = 240 - y;
|
||||
x = 304 - x;
|
||||
if (fx) fx = 0; else fx = 1;
|
||||
if (fy) fy = 0; else fy = 1;
|
||||
mult = 16;
|
||||
}
|
||||
else mult=-16;
|
||||
else mult = -16;
|
||||
|
||||
while (multi >= 0)
|
||||
{
|
||||
@ -70,88 +71,78 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
}
|
||||
}
|
||||
|
||||
static int pktgaldx_bank_callback(const int bank)
|
||||
{
|
||||
return ((bank>>4) & 0x7) * 0x1000;
|
||||
}
|
||||
|
||||
/* Video on the orginal */
|
||||
VIDEO_START(pktgaldx)
|
||||
|
||||
VIDEO_UPDATE( pktgaldx )
|
||||
{
|
||||
deco16_1_video_init(machine);
|
||||
pktgaldx_state *state = (pktgaldx_state *)screen->machine->driver_data;
|
||||
UINT16 flip = decodev_pf12_control_r(state->deco16ic, 0, 0xffff);
|
||||
|
||||
deco16_set_tilemap_bank_callback(1,pktgaldx_bank_callback);
|
||||
}
|
||||
flip_screen_set(screen->machine, BIT(flip, 7));
|
||||
decodev_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll);
|
||||
|
||||
VIDEO_UPDATE(pktgaldx)
|
||||
{
|
||||
flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
|
||||
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
|
||||
bitmap_fill(bitmap, cliprect, 0); /* not Confirmed */
|
||||
bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
|
||||
|
||||
bitmap_fill(bitmap,cliprect,0); /* not Confirmed */
|
||||
bitmap_fill(screen->machine->priority_bitmap,NULL,0);
|
||||
|
||||
deco16_tilemap_2_draw(screen,bitmap,cliprect,0,0);
|
||||
draw_sprites(screen->machine,bitmap,cliprect);
|
||||
deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0);
|
||||
decodev_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 0);
|
||||
draw_sprites(screen->machine, bitmap, cliprect);
|
||||
decodev_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Video for the bootleg */
|
||||
VIDEO_START(pktgaldb)
|
||||
{
|
||||
}
|
||||
|
||||
VIDEO_UPDATE(pktgaldb)
|
||||
VIDEO_UPDATE( pktgaldb )
|
||||
{
|
||||
int x,y;
|
||||
int offset=0;
|
||||
pktgaldx_state *state = (pktgaldx_state *)screen->machine->driver_data;
|
||||
int x, y;
|
||||
int offset = 0;
|
||||
int tileno;
|
||||
int colour;
|
||||
|
||||
bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
|
||||
|
||||
/* the bootleg seems to treat the tilemaps as sprites */
|
||||
for (offset = 0;offset<0x1600/2;offset+=8)
|
||||
for (offset = 0; offset < 0x1600 / 2; offset += 8)
|
||||
{
|
||||
tileno = pcktgaldb_sprites[offset+3] | (pcktgaldb_sprites[offset+2]<<16);
|
||||
colour = pcktgaldb_sprites[offset+1]>>1;
|
||||
x = pcktgaldb_sprites[offset+0];
|
||||
y = pcktgaldb_sprites[offset+4];
|
||||
tileno = state->pktgaldb_sprites[offset + 3] | (state->pktgaldb_sprites[offset + 2] << 16);
|
||||
colour = state->pktgaldb_sprites[offset + 1] >> 1;
|
||||
x = state->pktgaldb_sprites[offset + 0];
|
||||
y = state->pktgaldb_sprites[offset + 4];
|
||||
|
||||
x-=0xc2;
|
||||
y&=0x1ff;
|
||||
y-=8;
|
||||
x -= 0xc2;
|
||||
y &= 0x1ff;
|
||||
y -= 8;
|
||||
|
||||
drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno^0x1000,colour,0,0,x,y,0);
|
||||
drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], tileno ^ 0x1000, colour, 0, 0, x, y, 0);
|
||||
}
|
||||
|
||||
for (offset = 0x1600/2;offset<0x2000/2;offset+=8)
|
||||
for (offset = 0x1600/2; offset < 0x2000 / 2; offset += 8)
|
||||
{
|
||||
tileno = pcktgaldb_sprites[offset+3] | (pcktgaldb_sprites[offset+2]<<16);
|
||||
colour = pcktgaldb_sprites[offset+1]>>1;
|
||||
x = pcktgaldb_sprites[offset+0]&0x1ff;
|
||||
y = pcktgaldb_sprites[offset+4]&0x0ff;
|
||||
tileno = state->pktgaldb_sprites[offset + 3] | (state->pktgaldb_sprites[offset + 2] << 16);
|
||||
colour = state->pktgaldb_sprites[offset + 1] >> 1;
|
||||
x = state->pktgaldb_sprites[offset + 0] & 0x1ff;
|
||||
y = state->pktgaldb_sprites[offset + 4] & 0x0ff;
|
||||
|
||||
x-=0xc2;
|
||||
y&=0x1ff;
|
||||
y-=8;
|
||||
x -= 0xc2;
|
||||
y &= 0x1ff;
|
||||
y -= 8;
|
||||
|
||||
drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno^0x4000,colour,0,0,x,y,0);
|
||||
drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], tileno ^ 0x4000, colour, 0, 0, x, y, 0);
|
||||
}
|
||||
|
||||
for (offset = 0x2000/2;offset<0x4000/2;offset+=8)
|
||||
for (offset = 0x2000/2; offset < 0x4000 / 2; offset += 8)
|
||||
{
|
||||
tileno = pcktgaldb_sprites[offset+3] | (pcktgaldb_sprites[offset+2]<<16);
|
||||
colour = pcktgaldb_sprites[offset+1]>>1;
|
||||
x = pcktgaldb_sprites[offset+0]&0x1ff;
|
||||
y = pcktgaldb_sprites[offset+4]&0x0ff;
|
||||
tileno = state->pktgaldb_sprites[offset + 3] | (state->pktgaldb_sprites[offset + 2] << 16);
|
||||
colour = state->pktgaldb_sprites[offset + 1] >> 1;
|
||||
x = state->pktgaldb_sprites[offset + 0] & 0x1ff;
|
||||
y = state->pktgaldb_sprites[offset + 4] & 0x0ff;
|
||||
|
||||
x-=0xc2;
|
||||
y&=0x1ff;
|
||||
y-=8;
|
||||
x -= 0xc2;
|
||||
y &= 0x1ff;
|
||||
y -= 8;
|
||||
|
||||
drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno^0x3000,colour,0,0,x,y,0);
|
||||
drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], tileno ^ 0x3000, colour, 0, 0, x, y, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -3,7 +3,9 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/deco16ic.h"
|
||||
#include "video/decodev.h"
|
||||
|
||||
UINT16 *simpl156_pf1_rowscroll,*simpl156_pf2_rowscroll;
|
||||
|
||||
/*
|
||||
|
||||
@ -114,45 +116,29 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
|
||||
VIDEO_UPDATE( simpl156 )
|
||||
{
|
||||
running_device *deco16ic = devtag_get_device(screen->machine, "deco_custom");
|
||||
bitmap_fill(screen->machine->priority_bitmap,NULL,0);
|
||||
|
||||
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
|
||||
decodev_pf12_update(deco16ic, simpl156_pf1_rowscroll, simpl156_pf2_rowscroll);
|
||||
|
||||
bitmap_fill(bitmap,cliprect,256);
|
||||
bitmap_fill(bitmap, cliprect, 256);
|
||||
|
||||
deco16_tilemap_2_draw(screen,bitmap,cliprect,0,2);
|
||||
deco16_tilemap_1_draw(screen,bitmap,cliprect,0,4);
|
||||
decodev_tilemap_2_draw(deco16ic, bitmap, cliprect, 0, 2);
|
||||
decodev_tilemap_1_draw(deco16ic, bitmap, cliprect, 0, 4);
|
||||
|
||||
draw_sprites(screen->machine, bitmap,cliprect);
|
||||
draw_sprites(screen->machine, bitmap, cliprect);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int simpl156_bank_callback(const int bank)
|
||||
{
|
||||
return ((bank>>4)&0x7) * 0x1000;
|
||||
}
|
||||
|
||||
|
||||
VIDEO_START( simpl156 )
|
||||
{
|
||||
/* allocate the ram as 16-bit (we do it here because the CPU is 32-bit) */
|
||||
deco16_pf1_data = auto_alloc_array(machine, UINT16, 0x2000/2);
|
||||
deco16_pf2_data = auto_alloc_array(machine, UINT16, 0x2000/2);
|
||||
deco16_pf1_rowscroll = auto_alloc_array(machine, UINT16, 0x800/2);
|
||||
deco16_pf2_rowscroll = auto_alloc_array(machine, UINT16, 0x800/2);
|
||||
deco16_pf12_control = auto_alloc_array(machine, UINT16, 0x10/2);
|
||||
simpl156_pf1_rowscroll = auto_alloc_array(machine, UINT16, 0x800/2);
|
||||
simpl156_pf2_rowscroll = auto_alloc_array(machine, UINT16, 0x800/2);
|
||||
machine->generic.paletteram.u16 = auto_alloc_array(machine, UINT16, 0x1000/2);
|
||||
|
||||
/* and register the allocated ram so that save states still work */
|
||||
state_save_register_global_pointer(machine, deco16_pf1_data, 0x2000/2);
|
||||
state_save_register_global_pointer(machine, deco16_pf2_data, 0x2000/2);
|
||||
state_save_register_global_pointer(machine, deco16_pf1_rowscroll, 0x800/2);
|
||||
state_save_register_global_pointer(machine, deco16_pf2_rowscroll, 0x800/2);
|
||||
state_save_register_global_pointer(machine, deco16_pf12_control, 0x10/2);
|
||||
state_save_register_global_pointer(machine, simpl156_pf1_rowscroll, 0x800/2);
|
||||
state_save_register_global_pointer(machine, simpl156_pf2_rowscroll, 0x800/2);
|
||||
state_save_register_global_pointer(machine, machine->generic.paletteram.u16, 0x1000/2);
|
||||
|
||||
deco16_1_video_init(machine);
|
||||
|
||||
deco16_set_tilemap_bank_callback(0, simpl156_bank_callback);
|
||||
deco16_set_tilemap_bank_callback(1, simpl156_bank_callback);
|
||||
}
|
||||
|
@ -13,28 +13,32 @@ End sequence uses rowscroll '98 c0' on pf1 (jmp to 1d61a on supbtimj)
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/deco16ic.h"
|
||||
#include "video/decodev.h"
|
||||
#include "includes/supbtime.h"
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
|
||||
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
|
||||
{
|
||||
UINT16 *spriteram16 = machine->generic.spriteram.u16;
|
||||
supbtime_state *state = (supbtime_state *)machine->driver_data;
|
||||
UINT16 *spriteram = state->spriteram;
|
||||
int offs;
|
||||
|
||||
for (offs = 0;offs < 0x400;offs += 4)
|
||||
for (offs = 0; offs < 0x400; offs += 4)
|
||||
{
|
||||
int x,y,sprite,colour,multi,fx,fy,inc,flash,mult;
|
||||
int x, y, sprite, colour, multi, fx, fy, inc, flash, mult;
|
||||
|
||||
sprite = spriteram16[offs+1] & 0x3fff;
|
||||
if (!sprite) continue;
|
||||
sprite = spriteram[offs + 1] & 0x3fff;
|
||||
if (!sprite)
|
||||
continue;
|
||||
|
||||
y = spriteram16[offs];
|
||||
flash=y&0x1000;
|
||||
if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue;
|
||||
y = spriteram[offs];
|
||||
flash = y & 0x1000;
|
||||
if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1))
|
||||
continue;
|
||||
|
||||
x = spriteram16[offs+2];
|
||||
colour = (x >>9) & 0x1f;
|
||||
x = spriteram[offs + 2];
|
||||
colour = (x >> 9) & 0x1f;
|
||||
|
||||
fx = y & 0x2000;
|
||||
fy = y & 0x4000;
|
||||
@ -45,9 +49,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
if (x >= 320) x -= 512;
|
||||
if (y >= 256) y -= 512;
|
||||
y = 240 - y;
|
||||
x = 304 - x;
|
||||
x = 304 - x;
|
||||
|
||||
if (x>320) continue;
|
||||
if (x > 320)
|
||||
continue;
|
||||
|
||||
sprite &= ~multi;
|
||||
if (fy)
|
||||
@ -60,13 +65,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
|
||||
if (flip_screen_get(machine))
|
||||
{
|
||||
y=240-y;
|
||||
x=304-x;
|
||||
if (fx) fx=0; else fx=1;
|
||||
if (fy) fy=0; else fy=1;
|
||||
mult=16;
|
||||
y = 240 - y;
|
||||
x = 304 - x;
|
||||
if (fx) fx = 0; else fx = 1;
|
||||
if (fy) fy = 0; else fy = 1;
|
||||
mult = 16;
|
||||
}
|
||||
else mult=-16;
|
||||
else mult = -16;
|
||||
|
||||
while (multi >= 0)
|
||||
{
|
||||
@ -83,21 +88,18 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
VIDEO_START(supbtime)
|
||||
{
|
||||
deco16_1_video_init(machine);
|
||||
}
|
||||
|
||||
VIDEO_UPDATE(supbtime)
|
||||
{
|
||||
flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
|
||||
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
|
||||
supbtime_state *state = (supbtime_state *)screen->machine->driver_data;
|
||||
UINT16 flip = decodev_pf12_control_r(state->deco16ic, 0, 0xffff);
|
||||
|
||||
bitmap_fill(bitmap,cliprect,768);
|
||||
flip_screen_set(screen->machine, BIT(flip, 7));
|
||||
decodev_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll);
|
||||
|
||||
deco16_tilemap_2_draw(screen,bitmap,cliprect,0,0);
|
||||
draw_sprites(screen->machine, bitmap,cliprect);
|
||||
deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0);
|
||||
bitmap_fill(bitmap, cliprect, 768);
|
||||
|
||||
decodev_tilemap_2_draw(state->deco16ic, bitmap, cliprect, 0, 0);
|
||||
draw_sprites(screen->machine, bitmap, cliprect);
|
||||
decodev_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -14,26 +14,30 @@ to switch between 8*8 tiles and 16*16 tiles.
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/deco16ic.h"
|
||||
#include "video/decodev.h"
|
||||
#include "includes/tumblep.h"
|
||||
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
|
||||
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
|
||||
{
|
||||
UINT16 *spriteram16 = machine->generic.spriteram.u16;
|
||||
tumblep_state *state = (tumblep_state *)machine->driver_data;
|
||||
UINT16 *spriteram = state->spriteram;
|
||||
int offs;
|
||||
|
||||
for (offs = 0;offs < 0x400;offs += 4)
|
||||
for (offs = 0; offs < 0x400; offs += 4)
|
||||
{
|
||||
int x,y,sprite,colour,multi,fx,fy,inc,flash,mult;
|
||||
int x, y, sprite, colour, multi, fx, fy, inc, flash, mult;
|
||||
|
||||
sprite = spriteram16[offs+1];
|
||||
if (!sprite) continue;
|
||||
sprite = spriteram[offs + 1];
|
||||
if (!sprite)
|
||||
continue;
|
||||
|
||||
y = spriteram16[offs];
|
||||
flash=y&0x1000;
|
||||
if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue;
|
||||
y = spriteram[offs];
|
||||
flash = y & 0x1000;
|
||||
if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1))
|
||||
continue;
|
||||
|
||||
x = spriteram16[offs+2];
|
||||
colour = (x >>9) & 0x1f;
|
||||
x = spriteram[offs + 2];
|
||||
colour = (x >> 9) & 0x1f;
|
||||
|
||||
fx = y & 0x2000;
|
||||
fy = y & 0x4000;
|
||||
@ -44,9 +48,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
if (x >= 320) x -= 512;
|
||||
if (y >= 256) y -= 512;
|
||||
y = 240 - y;
|
||||
x = 304 - x;
|
||||
x = 304 - x;
|
||||
|
||||
if (x>320) continue;
|
||||
if (x > 320) continue;
|
||||
|
||||
sprite &= ~multi;
|
||||
if (fy)
|
||||
@ -59,13 +63,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
|
||||
if (flip_screen_get(machine))
|
||||
{
|
||||
y=240-y;
|
||||
x=304-x;
|
||||
if (fx) fx=0; else fx=1;
|
||||
if (fy) fy=0; else fy=1;
|
||||
mult=16;
|
||||
y = 240 - y;
|
||||
x = 304 - x;
|
||||
if (fx) fx = 0; else fx = 1;
|
||||
if (fy) fy = 0; else fy = 1;
|
||||
mult = 16;
|
||||
}
|
||||
else mult=-16;
|
||||
else mult = -16;
|
||||
|
||||
while (multi >= 0)
|
||||
{
|
||||
@ -80,21 +84,19 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
}
|
||||
}
|
||||
|
||||
VIDEO_START(tumblep)
|
||||
VIDEO_UPDATE( tumblep )
|
||||
{
|
||||
deco16_1_video_init(machine);
|
||||
}
|
||||
tumblep_state *state = (tumblep_state *)screen->machine->driver_data;
|
||||
UINT16 flip = decodev_pf12_control_r(state->deco16ic, 0, 0xffff);
|
||||
|
||||
VIDEO_UPDATE(tumblep)
|
||||
{
|
||||
flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
|
||||
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
|
||||
flip_screen_set(screen->machine, BIT(flip, 7));
|
||||
decodev_pf12_update(state->deco16ic, state->pf1_rowscroll, state->pf2_rowscroll);
|
||||
|
||||
bitmap_fill(bitmap,cliprect,256); /* not verified */
|
||||
bitmap_fill(bitmap, cliprect, 256); /* not verified */
|
||||
|
||||
deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
|
||||
deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0);
|
||||
decodev_tilemap_2_draw(state->deco16ic, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
|
||||
decodev_tilemap_1_draw(state->deco16ic, bitmap, cliprect, 0, 0);
|
||||
|
||||
draw_sprites(screen->machine,bitmap,cliprect);
|
||||
draw_sprites(screen->machine, bitmap, cliprect);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user