Updated ajax.c, bottom9.c, chqflag.c, rollerg.c, spy.c, surpratk.c to use Konami video devices

This commit is contained in:
Fabio Priuli 2009-12-20 15:18:01 +00:00
parent c328e6c190
commit f0358680a7
15 changed files with 458 additions and 244 deletions

View File

@ -14,21 +14,26 @@ TO DO:
#include "cpu/z80/z80.h"
#include "cpu/m6809/m6809.h"
#include "cpu/konami/konami.h"
#include "video/konamiic.h"
#include "video/konicdev.h"
#include "sound/2151intf.h"
#include "sound/k007232.h"
#include "includes/ajax.h"
#include "konamipt.h"
#include "includes/konamipt.h"
static WRITE8_DEVICE_HANDLER( k007232_extvol_w );
static WRITE8_HANDLER( sound_bank_w );
extern void ajax_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
extern void ajax_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow);
extern void ajax_zoom_callback(running_machine *machine, int *code,int *color,int *flags);
/****************************************************************************/
static ADDRESS_MAP_START( ajax_main_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x01c0) AM_READWRITE(ajax_ls138_f10_r, ajax_ls138_f10_w) /* bankswitch + sound command + FIRQ command */
AM_RANGE(0x0800, 0x0807) AM_READWRITE(K051937_r, K051937_w) /* sprite control registers */
AM_RANGE(0x0c00, 0x0fff) AM_READWRITE(K051960_r, K051960_w) /* sprite RAM 2128SL at J7 */
AM_RANGE(0x0800, 0x0807) AM_DEVREADWRITE("k051960", k051937_r, k051937_w) /* sprite control registers */
AM_RANGE(0x0c00, 0x0fff) AM_DEVREADWRITE("k051960", k051960_r, k051960_w) /* sprite RAM 2128SL at J7 */
AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE_GENERIC(paletteram)/* palette */
AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("share1") /* shared RAM with the 6809 */
AM_RANGE(0x4000, 0x5fff) AM_RAM /* RAM 6264L at K10 */
@ -37,12 +42,12 @@ static ADDRESS_MAP_START( ajax_main_map, ADDRESS_SPACE_PROGRAM, 8 )
ADDRESS_MAP_END
static ADDRESS_MAP_START( ajax_sub_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x07ff) AM_READWRITE(K051316_0_r, K051316_0_w) /* 051316 zoom/rotation layer */
AM_RANGE(0x0800, 0x080f) AM_WRITE(K051316_ctrl_0_w) /* 051316 control registers */
AM_RANGE(0x1000, 0x17ff) AM_READ(K051316_rom_0_r) /* 051316 (ROM test) */
AM_RANGE(0x0000, 0x07ff) AM_DEVREADWRITE("k051316", k051316_r, k051316_w) /* 051316 zoom/rotation layer */
AM_RANGE(0x0800, 0x080f) AM_DEVWRITE("k051316", k051316_ctrl_w) /* 051316 control registers */
AM_RANGE(0x1000, 0x17ff) AM_DEVREAD("k051316", k051316_rom_r) /* 051316 (ROM test) */
AM_RANGE(0x1800, 0x1800) AM_WRITE(ajax_bankswitch_2_w) /* bankswitch control */
AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("share1") /* shared RAM with the 052001 */
AM_RANGE(0x4000, 0x7fff) AM_READWRITE(K052109_r, K052109_w) /* video RAM + color RAM + video registers */
AM_RANGE(0x4000, 0x7fff) AM_DEVREADWRITE("k052109", k052109_r, k052109_w) /* video RAM + color RAM + video registers */
AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank1") /* banked ROM */
AM_RANGE(0xa000, 0xffff) AM_ROM /* ROM I16 */
ADDRESS_MAP_END
@ -180,6 +185,30 @@ static const k007232_interface k007232_interface_2 =
static const k052109_interface ajax_k052109_intf =
{
"gfx1", 0,
NORMAL_PLANE_ORDER,
KONAMI_ROM_DEINTERLEAVE_2,
ajax_tile_callback
};
static const k051960_interface ajax_k051960_intf =
{
"gfx2", 1,
NORMAL_PLANE_ORDER,
KONAMI_ROM_DEINTERLEAVE_2,
ajax_sprite_callback
};
static const k051316_interface ajax_k051316_intf =
{
"gfx3", 2,
7, FALSE, 0,
0, 0, 0,
ajax_zoom_callback
};
static MACHINE_DRIVER_START( ajax )
/* basic machine hardware */
@ -196,7 +225,7 @@ static MACHINE_DRIVER_START( ajax )
MDRV_QUANTUM_TIME(HZ(600))
MDRV_MACHINE_RESET(ajax)
MDRV_MACHINE_START(ajax)
MDRV_MACHINE_START(ajax)
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
@ -212,6 +241,10 @@ static MACHINE_DRIVER_START( ajax )
MDRV_VIDEO_START(ajax)
MDRV_VIDEO_UPDATE(ajax)
MDRV_K052109_ADD("k052109", ajax_k052109_intf)
MDRV_K051960_ADD("k051960", ajax_k051960_intf)
MDRV_K051316_ADD("k051316", ajax_k051316_intf)
/* sound hardware */
MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@ -383,13 +416,6 @@ ROM_START( ajaxj )
ROM_END
static DRIVER_INIT( ajax )
{
konami_rom_deinterleave_2(machine, "gfx1");
konami_rom_deinterleave_2(machine, "gfx2");
}
GAME( 1987, ajax, 0, ajax, ajax, ajax, ROT90, "Konami", "Ajax", GAME_SUPPORTS_SAVE )
GAME( 1987, typhoon, ajax, ajax, ajax, ajax, ROT90, "Konami", "Typhoon", GAME_SUPPORTS_SAVE )
GAME( 1987, ajaxj, ajax, ajax, ajax, ajax, ROT90, "Konami", "Ajax (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1987, ajax, 0, ajax, ajax, 0, ROT90, "Konami", "Ajax", GAME_SUPPORTS_SAVE )
GAME( 1987, typhoon, ajax, ajax, ajax, 0, ROT90, "Konami", "Typhoon", GAME_SUPPORTS_SAVE )
GAME( 1987, ajaxj, ajax, ajax, ajax, 0, ROT90, "Konami", "Ajax (Japan)", GAME_SUPPORTS_SAVE )

View File

@ -16,55 +16,100 @@ To be verified for Main Stadium
#include "cpu/z80/z80.h"
#include "deprecat.h"
#include "cpu/m6809/m6809.h"
#include "video/konamiic.h"
#include "video/konicdev.h"
#include "sound/k007232.h"
#include "konamipt.h"
#include "includes/konamipt.h"
extern int bottom9_video_enable;
VIDEO_START( bottom9 );
VIDEO_UPDATE( bottom9 );
extern void bottom9_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
extern void bottom9_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow);
extern void bottom9_zoom_callback(running_machine *machine, int *code,int *color,int *flags);
static INTERRUPT_GEN( bottom9_interrupt )
{
if (K052109_is_IRQ_enabled())
const device_config *k052109 = devtag_get_device(device->machine, "k052109");
if (k052109_is_irq_enabled(k052109))
cpu_set_input_line(device, 0, HOLD_LINE);
}
static int zoomreadroms,K052109_selected;
static int zoomreadroms, k052109_selected;
static READ8_HANDLER( k052109_051960_r )
{
const device_config *k052109 = devtag_get_device(space->machine, "k052109");
const device_config *k051960 = devtag_get_device(space->machine, "k051960");
if (k052109_get_rmrd_line(k052109) == CLEAR_LINE)
{
if (offset >= 0x3800 && offset < 0x3808)
return k051937_r(k051960, offset - 0x3800);
else if (offset < 0x3c00)
return k052109_r(k052109, offset);
else
return k051960_r(k051960, offset - 0x3c00);
}
else
return k052109_r(k052109, offset);
}
static WRITE8_HANDLER( k052109_051960_w )
{
const device_config *k052109 = devtag_get_device(space->machine, "k052109");
const device_config *k051960 = devtag_get_device(space->machine, "k051960");
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(k051960, offset - 0x3800, data);
else if (offset < 0x3c00)
k052109_w(k052109, offset, data);
else
k051960_w(k051960, offset - 0x3c00, data);
}
static READ8_HANDLER( bottom9_bankedram1_r )
{
if (K052109_selected)
return K052109_051960_r(space,offset);
const device_config *k051316 = devtag_get_device(space->machine, "k051316");
if (k052109_selected)
return k052109_051960_r(space, offset);
else
{
if (zoomreadroms)
return K051316_rom_0_r(space,offset);
return k051316_rom_r(k051316, offset);
else
return K051316_0_r(space,offset);
return k051316_r(k051316,offset);
}
}
static WRITE8_HANDLER( bottom9_bankedram1_w )
{
if (K052109_selected) K052109_051960_w(space,offset,data);
else K051316_0_w(space,offset,data);
const device_config *k051316 = devtag_get_device(space->machine, "k051316");
if (k052109_selected)
k052109_051960_w(space, offset, data);
else
k051316_w(k051316, offset, data);
}
static READ8_HANDLER( bottom9_bankedram2_r )
{
if (K052109_selected) return K052109_051960_r(space,offset + 0x2000);
else return space->machine->generic.paletteram.u8[offset];
if (k052109_selected)
return k052109_051960_r(space, offset + 0x2000);
else
return space->machine->generic.paletteram.u8[offset];
}
static WRITE8_HANDLER( bottom9_bankedram2_w )
{
if (K052109_selected) K052109_051960_w(space,offset + 0x2000,data);
else paletteram_xBBBBBGGGGGRRRRR_be_w(space,offset,data);
if (k052109_selected)
k052109_051960_w(space, offset + 0x2000, data);
else
paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data);
}
static WRITE8_HANDLER( bankswitch_w )
@ -73,22 +118,28 @@ static WRITE8_HANDLER( bankswitch_w )
int offs;
/* bit 0 = RAM bank */
if ((data & 1) == 0) popmessage("bankswitch RAM bank 0");
if ((data & 1) == 0)
popmessage("bankswitch RAM bank 0");
/* bit 1-4 = ROM bank */
if (data & 0x10) offs = 0x20000 + (data & 0x06) * 0x1000;
else offs = 0x10000 + (data & 0x0e) * 0x1000;
if (data & 0x10)
offs = 0x20000 + (data & 0x06) * 0x1000;
else
offs = 0x10000 + (data & 0x0e) * 0x1000;
memory_set_bankptr(space->machine, "bank1",&RAM[offs]);
}
static WRITE8_HANDLER( bottom9_1f90_w )
{
const device_config *k052109 = devtag_get_device(space->machine, "k052109");
/* bits 0/1 = coin counters */
coin_counter_w(space->machine, 0,data & 0x01);
coin_counter_w(space->machine, 1,data & 0x02);
coin_counter_w(space->machine, 0, data & 0x01);
coin_counter_w(space->machine, 1, data & 0x02);
/* bit 2 = enable char ROM reading through the video RAM */
K052109_set_RMRD_line((data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
k052109_set_rmrd_line(k052109, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
/* bit 3 = disable video */
bottom9_video_enable = ~data & 0x08;
@ -97,7 +148,7 @@ static WRITE8_HANDLER( bottom9_1f90_w )
zoomreadroms = data & 0x10;
/* bit 5 = RAM bank */
K052109_selected = data & 0x20;
k052109_selected = data & 0x20;
}
static WRITE8_HANDLER( bottom9_sh_irqtrigger_w )
@ -143,9 +194,9 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x1fd2, 0x1fd2) AM_READ_PORT("P2")
AM_RANGE(0x1fd3, 0x1fd3) AM_READ_PORT("DSW1")
AM_RANGE(0x1fe0, 0x1fe0) AM_READ_PORT("DSW2")
AM_RANGE(0x1ff0, 0x1fff) AM_WRITE(K051316_ctrl_0_w)
AM_RANGE(0x1ff0, 0x1fff) AM_DEVWRITE("k051316", k051316_ctrl_w)
AM_RANGE(0x2000, 0x27ff) AM_READWRITE(bottom9_bankedram2_r, bottom9_bankedram2_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0x0000, 0x3fff) AM_READWRITE(K052109_051960_r, K052109_051960_w)
AM_RANGE(0x0000, 0x3fff) AM_READWRITE(k052109_051960_r, k052109_051960_w)
AM_RANGE(0x4000, 0x5fff) AM_RAM
AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank1")
AM_RANGE(0x8000, 0xffff) AM_ROM
@ -256,6 +307,30 @@ static const k007232_interface k007232_interface_2 =
static const k052109_interface bottom9_k052109_intf =
{
"gfx1", 0,
NORMAL_PLANE_ORDER,
KONAMI_ROM_DEINTERLEAVE_2,
bottom9_tile_callback
};
static const k051960_interface bottom9_k051960_intf =
{
"gfx2", 1,
NORMAL_PLANE_ORDER,
KONAMI_ROM_DEINTERLEAVE_2,
bottom9_sprite_callback
};
static const k051316_interface bottom9_k051316_intf =
{
"gfx3", 2,
4, FALSE, 0,
0, 0, 0,
bottom9_zoom_callback
};
static MACHINE_DRIVER_START( bottom9 )
/* basic machine hardware */
@ -282,6 +357,10 @@ static MACHINE_DRIVER_START( bottom9 )
MDRV_VIDEO_START(bottom9)
MDRV_VIDEO_UPDATE(bottom9)
MDRV_K052109_ADD("k052109", bottom9_k052109_intf)
MDRV_K051960_ADD("k051960", bottom9_k051960_intf)
MDRV_K051316_ADD("k051316", bottom9_k051316_intf)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")
@ -306,8 +385,8 @@ MACHINE_DRIVER_END
ROM_START( bottom9 )
ROM_REGION( 0x28000, "maincpu", 0 ) /* code + banked roms */
ROM_LOAD( "891n03.k17", 0x10000, 0x10000, CRC(8b083ff3) SHA1(045fef944b192e4bb147fa0f28680c0602af7377) )
ROM_LOAD( "891-t02.k15", 0x20000, 0x08000, CRC(2c10ced2) SHA1(ecd43825a67b495cade94a454c96a19143d87760) )
ROM_CONTINUE( 0x08000, 0x08000 )
ROM_LOAD( "891-t02.k15", 0x20000, 0x08000, CRC(2c10ced2) SHA1(ecd43825a67b495cade94a454c96a19143d87760) )
ROM_CONTINUE( 0x08000, 0x08000 )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code */
ROM_LOAD( "891j01.g8", 0x0000, 0x8000, CRC(31b0a0a8) SHA1(8e047f81c19f25de97fa22e70dcfe9e06bfae699) )
@ -363,8 +442,8 @@ ROM_END
ROM_START( bottom9n )
ROM_REGION( 0x28000, "maincpu", 0 ) /* code + banked roms */
ROM_LOAD( "891n03.k17", 0x10000, 0x10000, CRC(8b083ff3) SHA1(045fef944b192e4bb147fa0f28680c0602af7377) )
ROM_LOAD( "891n02.k15", 0x20000, 0x08000, CRC(d44d9ed4) SHA1(2a12bcfba81ab7e074569e2ad2da6a237a1c0ce5) )
ROM_CONTINUE( 0x08000, 0x08000 )
ROM_LOAD( "891n02.k15", 0x20000, 0x08000, CRC(d44d9ed4) SHA1(2a12bcfba81ab7e074569e2ad2da6a237a1c0ce5) )
ROM_CONTINUE( 0x08000, 0x08000 )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code */
ROM_LOAD( "891j01.g8", 0x0000, 0x8000, CRC(31b0a0a8) SHA1(8e047f81c19f25de97fa22e70dcfe9e06bfae699) )
@ -420,8 +499,8 @@ ROM_END
ROM_START( mstadium )
ROM_REGION( 0x28000, "maincpu", 0 ) /* code + banked roms */
ROM_LOAD( "891-403.k17", 0x10000, 0x10000, CRC(1c00c4e8) SHA1(8a3400a8df44f21616422e5af3bca84d0f390f63) )
ROM_LOAD( "891-402.k15", 0x20000, 0x08000, CRC(b850bbce) SHA1(a64300d1b1068e59eb59c427946c9bff164e2da8) )
ROM_CONTINUE( 0x08000, 0x08000 )
ROM_LOAD( "891-402.k15", 0x20000, 0x08000, CRC(b850bbce) SHA1(a64300d1b1068e59eb59c427946c9bff164e2da8) )
ROM_CONTINUE( 0x08000, 0x08000 )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code */
ROM_LOAD( "891w01.g8", 0x0000, 0x8000, CRC(edec565a) SHA1(69cba0d00c6ef76c4ce2b553e3fd15de8abbbf31) )
@ -476,14 +555,6 @@ ROM_END
static DRIVER_INIT( bottom9 )
{
konami_rom_deinterleave_2(machine, "gfx1");
konami_rom_deinterleave_2(machine, "gfx2");
}
GAME( 1989, bottom9, 0, bottom9, bottom9, bottom9, ROT0, "Konami", "Bottom of the Ninth (version T)", 0 )
GAME( 1989, bottom9n, bottom9, bottom9, bottom9, bottom9, ROT0, "Konami", "Bottom of the Ninth (version N)", 0 )
GAME( 1989, mstadium, bottom9, bottom9, mstadium, bottom9, ROT0, "Konami", "Main Stadium (Japan)", 0 )
GAME( 1989, bottom9, 0, bottom9, bottom9, 0, ROT0, "Konami", "Bottom of the Ninth (version T)", 0 )
GAME( 1989, bottom9n, bottom9, bottom9, bottom9, 0, ROT0, "Konami", "Bottom of the Ninth (version N)", 0 )
GAME( 1989, mstadium, bottom9, bottom9, mstadium, 0, ROT0, "Konami", "Main Stadium (Japan)", 0 )

View File

@ -15,13 +15,13 @@ Dip locations and recommended settings verified with manual
#include "deprecat.h"
#include "cpu/z80/z80.h"
#include "cpu/konami/konami.h"
#include "video/konamiic.h"
#include "video/konicdev.h"
#include "sound/2151intf.h"
#include "sound/k007232.h"
#include "chqflag.lh"
static int K051316_readroms;
static int k051316_readroms;
static WRITE8_DEVICE_HANDLER( k007232_extvolume_w );
@ -29,23 +29,28 @@ static WRITE8_DEVICE_HANDLER( k007232_extvolume_w );
VIDEO_START( chqflag );
VIDEO_UPDATE( chqflag );
extern void chqflag_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow);
extern void chqflag_zoom_callback_0(running_machine *machine, int *code,int *color,int *flags);
extern void chqflag_zoom_callback_1(running_machine *machine, int *code,int *color,int *flags);
static INTERRUPT_GEN( chqflag_interrupt )
{
const device_config *k051960 = devtag_get_device(device->machine, "k051960");
if (cpu_getiloops(device) == 0)
{
if (K051960_is_IRQ_enabled())
if (k051960_is_irq_enabled(k051960))
cpu_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
}
else if (cpu_getiloops(device) % 2)
{
if (K051960_is_NMI_enabled())
if (k051960_is_nmi_enabled(k051960))
cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
}
static WRITE8_HANDLER( chqflag_bankswitch_w )
{
const device_config *k051316_1 = devtag_get_device(space->machine, "k051316_1");
int bankaddress;
UINT8 *RAM = memory_region(space->machine, "maincpu");
@ -60,10 +65,10 @@ static WRITE8_HANDLER( chqflag_bankswitch_w )
memory_install_write8_handler(space, 0x1800, 0x1fff, 0, 0, paletteram_xBBBBBGGGGGRRRRR_be_w);
memory_set_bankptr(space->machine, "bank5", space->machine->generic.paletteram.v);
if (K051316_readroms)
memory_install_readwrite8_handler(space, 0x1000, 0x17ff, 0, 0, K051316_rom_0_r, K051316_0_w); /* 051316 #1 (ROM test) */
if (k051316_readroms)
memory_install_readwrite8_device_handler(space, k051316_1, 0x1000, 0x17ff, 0, 0, k051316_rom_r, k051316_w); /* 051316 #1 (ROM test) */
else
memory_install_readwrite8_handler(space, 0x1000, 0x17ff, 0, 0, K051316_0_r, K051316_0_w); /* 051316 #1 */
memory_install_readwrite8_device_handler(space, k051316_1, 0x1000, 0x17ff, 0, 0, k051316_r, k051316_w); /* 051316 #1 */
}
else
{
@ -76,18 +81,19 @@ static WRITE8_HANDLER( chqflag_bankswitch_w )
static WRITE8_HANDLER( chqflag_vreg_w )
{
const device_config *k051316_2 = devtag_get_device(space->machine, "k051316_2");
static int last;
/* bits 0 & 1 = coin counters */
coin_counter_w(space->machine, 1,data & 0x01);
coin_counter_w(space->machine, 0,data & 0x02);
coin_counter_w(space->machine, 1, data & 0x01);
coin_counter_w(space->machine, 0, data & 0x02);
/* bit 4 = enable rom reading thru K051316 #1 & #2 */
K051316_readroms = (data & 0x10);
if (K051316_readroms)
memory_install_read8_handler(space, 0x2800, 0x2fff, 0, 0, K051316_rom_1_r); /* 051316 (ROM test) */
k051316_readroms = (data & 0x10);
if (k051316_readroms)
memory_install_read8_device_handler(space, k051316_2, 0x2800, 0x2fff, 0, 0, k051316_rom_r); /* 051316 (ROM test) */
else
memory_install_read8_handler(space, 0x2800, 0x2fff, 0, 0, K051316_1_r); /* 051316 */
memory_install_read8_device_handler(space, k051316_2, 0x2800, 0x2fff, 0, 0, k051316_r); /* 051316 */
/* Bits 3-7 probably control palette dimming in a similar way to TMNT2/Sunset Riders, */
/* however I don't have enough evidence to determine the exact behaviour. */
@ -152,9 +158,9 @@ static ADDRESS_MAP_START( chqflag_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x0fff) AM_RAM /* RAM */
AM_RANGE(0x1000, 0x17ff) AM_RAMBANK("bank1") /* banked RAM (RAM/051316 (chip 1)) */
AM_RANGE(0x1800, 0x1fff) AM_RAMBANK("bank2") /* palette + RAM */
AM_RANGE(0x2000, 0x2007) AM_READWRITE(K051937_r, K051937_w) /* Sprite control registers */
AM_RANGE(0x2400, 0x27ff) AM_READWRITE(K051960_r, K051960_w) /* Sprite RAM */
AM_RANGE(0x2800, 0x2fff) AM_READ_BANK("bank3") AM_WRITE(K051316_1_w) /* 051316 zoom/rotation (chip 2) */
AM_RANGE(0x2000, 0x2007) AM_DEVREADWRITE("k051960", k051937_r, k051937_w) /* Sprite control registers */
AM_RANGE(0x2400, 0x27ff) AM_DEVREADWRITE("k051960", k051960_r, k051960_w) /* Sprite RAM */
AM_RANGE(0x2800, 0x2fff) AM_READ_BANK("bank3") AM_DEVWRITE("k051316_2", k051316_w) /* 051316 zoom/rotation (chip 2) */
AM_RANGE(0x3000, 0x3000) AM_WRITE(soundlatch_w) /* sound code # */
AM_RANGE(0x3001, 0x3001) AM_WRITE(chqflag_sh_irqtrigger_w) /* cause interrupt on audio CPU */
AM_RANGE(0x3002, 0x3002) AM_WRITE(chqflag_bankswitch_w) /* bankswitch control */
@ -164,9 +170,9 @@ static ADDRESS_MAP_START( chqflag_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x3201, 0x3201) AM_READ_PORT("IN0") /* DIPSW #3, SW 4 */
AM_RANGE(0x3203, 0x3203) AM_READ_PORT("DSW2") /* DIPSW #2 */
AM_RANGE(0x3300, 0x3300) AM_WRITE(watchdog_reset_w) /* watchdog timer */
AM_RANGE(0x3400, 0x341f) AM_READWRITE(K051733_r, K051733_w) /* 051733 (protection) */
AM_RANGE(0x3500, 0x350f) AM_WRITE(K051316_ctrl_0_w) /* 051316 control registers (chip 1) */
AM_RANGE(0x3600, 0x360f) AM_WRITE(K051316_ctrl_1_w) /* 051316 control registers (chip 2) */
AM_RANGE(0x3400, 0x341f) AM_DEVREADWRITE("k051733", k051733_r, k051733_w) /* 051733 (protection) */
AM_RANGE(0x3500, 0x350f) AM_DEVWRITE("k051316_1", k051316_ctrl_w) /* 051316 control registers (chip 1) */
AM_RANGE(0x3600, 0x360f) AM_DEVWRITE("k051316_2", k051316_ctrl_w) /* 051316 control registers (chip 2) */
AM_RANGE(0x3700, 0x3700) AM_WRITE(select_analog_ctrl_w) /* select accelerator/wheel */
AM_RANGE(0x3701, 0x3701) AM_READ_PORT("IN2") /* Brake + Shift + ? */
AM_RANGE(0x3702, 0x3702) AM_READWRITE(analog_read_r, select_analog_ctrl_w) /* accelerator/wheel */
@ -326,6 +332,30 @@ static const k007232_interface k007232_interface_2 =
volume_callback1
};
static const k051960_interface chqflag_k051960_intf =
{
"gfx1", 0,
NORMAL_PLANE_ORDER,
KONAMI_ROM_DEINTERLEAVE_2,
chqflag_sprite_callback
};
static const k051316_interface chqflag_k051316_intf_1 =
{
"gfx2", 1,
4, FALSE, 0,
0, 7, 0,
chqflag_zoom_callback_0
};
static const k051316_interface chqflag_k051316_intf_2 =
{
"gfx3", 2,
8, TRUE, 0xc0,
1, 0, 0,
chqflag_zoom_callback_1
};
static MACHINE_DRIVER_START( chqflag )
/* basic machine hardware */
@ -353,6 +383,11 @@ static MACHINE_DRIVER_START( chqflag )
MDRV_VIDEO_START(chqflag)
MDRV_VIDEO_UPDATE(chqflag)
MDRV_K051960_ADD("k051960", chqflag_k051960_intf)
MDRV_K051316_ADD("k051316_1", chqflag_k051316_intf_1)
MDRV_K051316_ADD("k051316_2", chqflag_k051316_intf_2)
MDRV_K051733_ADD("k051733")
/* sound hardware */
MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@ -384,7 +419,7 @@ ROM_START( chqflag )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the SOUND CPU */
ROM_LOAD( "717e01", 0x000000, 0x008000, CRC(966b8ba8) SHA1(ab7448cb61fa5922b1d8ae5f0d0f42d734ed4f93) )
ROM_REGION( 0x100000, "gfx1", 0 ) /* graphics (addressable by the main CPU) */
ROM_REGION( 0x100000, "gfx1", 0 ) /* graphics (addressable by the main CPU) */
ROM_LOAD( "717e04", 0x000000, 0x080000, CRC(1a50a1cc) SHA1(bc16fab84c637ed124e37b115ddc0149560b727d) ) /* sprites */
ROM_LOAD( "717e05", 0x080000, 0x080000, CRC(46ccb506) SHA1(3ed1f54744fc5cdc0f48e42f250c366267a8199a) ) /* sprites */
@ -414,7 +449,7 @@ ROM_START( chqflagj )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the SOUND CPU */
ROM_LOAD( "717e01", 0x000000, 0x008000, CRC(966b8ba8) SHA1(ab7448cb61fa5922b1d8ae5f0d0f42d734ed4f93) )
ROM_REGION( 0x100000, "gfx1", 0 ) /* graphics (addressable by the main CPU) */
ROM_REGION( 0x100000, "gfx1", 0 ) /* graphics (addressable by the main CPU) */
ROM_LOAD( "717e04", 0x000000, 0x080000, CRC(1a50a1cc) SHA1(bc16fab84c637ed124e37b115ddc0149560b727d) ) /* sprites */
ROM_LOAD( "717e05", 0x080000, 0x080000, CRC(46ccb506) SHA1(3ed1f54744fc5cdc0f48e42f250c366267a8199a) ) /* sprites */
@ -439,8 +474,6 @@ ROM_END
static DRIVER_INIT( chqflag )
{
UINT8 *RAM = memory_region(machine, "maincpu");
konami_rom_deinterleave_2(machine, "gfx1");
machine->generic.paletteram.u8 = &RAM[0x58000];
}

View File

@ -12,7 +12,7 @@ Added dsw locations and verified factory settings based on Guru's notes
#include "driver.h"
#include "cpu/z80/z80.h"
#include "video/konamiic.h"
#include "video/konicdev.h"
#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
#include "machine/eeprom.h"
#include "sound/3812intf.h"
@ -25,13 +25,15 @@ static KONAMI_SETLINES_CALLBACK( rollerg_banking );
VIDEO_START( rollerg );
VIDEO_UPDATE( rollerg );
extern void rollerg_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask);
extern void rollerg_zoom_callback(running_machine *machine, int *code,int *color,int *flags);
static int readzoomroms;
static WRITE8_HANDLER( rollerg_0010_w )
{
logerror("%04x: write %02x to 0010\n",cpu_get_pc(space->cpu),data);
const device_config *k051316 = devtag_get_device(space->machine, "k051316");
logerror("%04x: write %02x to 0010\n",cpu_get_pc(space->cpu),data);
/* bits 0/1 are coin counters */
coin_counter_w(space->machine, 0,data & 0x01);
@ -41,15 +43,18 @@ logerror("%04x: write %02x to 0010\n",cpu_get_pc(space->cpu),data);
readzoomroms = data & 0x04;
/* bit 5 enables 051316 wraparound */
K051316_wraparound_enable(0, data & 0x20);
k051316_wraparound_enable(k051316, data & 0x20);
/* other bits unknown */
}
static READ8_HANDLER( rollerg_K051316_r )
{
if (readzoomroms) return K051316_rom_0_r(space, offset);
else return K051316_0_r(space, offset);
const device_config *k051316 = devtag_get_device(space->machine, "k051316");
if (readzoomroms)
return k051316_rom_r(k051316, offset);
else
return k051316_r(k051316, offset);
}
static READ8_DEVICE_HANDLER( rollerg_sound_r )
@ -92,10 +97,10 @@ static ADDRESS_MAP_START( rollerg_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0060, 0x0060) AM_READ_PORT("DSW2")
AM_RANGE(0x0061, 0x0061) AM_READ(pip_r) /* ????? */
AM_RANGE(0x0100, 0x010f) AM_WRITENOP /* 053252? */
AM_RANGE(0x0200, 0x020f) AM_WRITE(K051316_ctrl_0_w)
AM_RANGE(0x0300, 0x030f) AM_READWRITE(K053244_r,K053244_w)
AM_RANGE(0x0800, 0x0fff) AM_READWRITE(rollerg_K051316_r,K051316_0_w)
AM_RANGE(0x1000, 0x17ff) AM_READWRITE(K053245_r,K053245_w)
AM_RANGE(0x0200, 0x020f) AM_DEVWRITE("k051316", k051316_ctrl_w)
AM_RANGE(0x0300, 0x030f) AM_DEVREADWRITE("k053244", k053244_r, k053244_w)
AM_RANGE(0x0800, 0x0fff) AM_READ(rollerg_K051316_r) AM_DEVWRITE("k051316", k051316_w)
AM_RANGE(0x1000, 0x17ff) AM_DEVREADWRITE("k053244", k053245_r, k053245_w)
AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0x2000, 0x3aff) AM_RAM
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
@ -217,6 +222,23 @@ INPUT_PORTS_END
***************************************************************************/
static const k05324x_interface rollerg_k05324x_intf =
{
"gfx1", 0,
NORMAL_PLANE_ORDER,
-3, -1,
KONAMI_ROM_DEINTERLEAVE_2,
rollerg_sprite_callback
};
static const k051316_interface rollerg_k051316_intf =
{
"gfx2", 1,
4, FALSE, 0,
0, 22, 1,
rollerg_zoom_callback
};
static MACHINE_DRIVER_START( rollerg )
/* basic machine hardware */
@ -244,6 +266,9 @@ static MACHINE_DRIVER_START( rollerg )
MDRV_VIDEO_START(rollerg)
MDRV_VIDEO_UPDATE(rollerg)
MDRV_K053244_ADD("k053244", rollerg_k05324x_intf)
MDRV_K051316_ADD("k051316", rollerg_k051316_intf)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")
@ -328,12 +353,6 @@ static MACHINE_RESET( rollerg )
readzoomroms = 0;
}
static DRIVER_INIT( rollerg )
{
konami_rom_deinterleave_2(machine, "gfx1");
}
GAME( 1991, rollerg, 0, rollerg, rollerg, rollerg, ROT0, "Konami", "Rollergames (US)", 0 )
GAME( 1991, rollergj, rollerg, rollerg, rollerg, rollerg, ROT0, "Konami", "Rollergames (Japan)", 0 )
GAME( 1991, rollerg, 0, rollerg, rollerg, 0, ROT0, "Konami", "Rollergames (US)", 0 )
GAME( 1991, rollergj, rollerg, rollerg, rollerg, 0, ROT0, "Konami", "Rollergames (Japan)", 0 )

View File

@ -20,7 +20,7 @@ Revisions:
#include "driver.h"
#include "cpu/z80/z80.h"
#include "cpu/m6809/m6809.h"
#include "video/konamiic.h"
#include "video/konicdev.h"
#include "sound/3812intf.h"
#include "sound/k007232.h"
#include "konamipt.h"
@ -30,10 +30,14 @@ VIDEO_UPDATE( spy );
static UINT8 *pmcram;
extern void spy_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
extern void spy_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask,int *shadow);
static INTERRUPT_GEN( spy_interrupt )
{
if (K052109_is_IRQ_enabled())
const device_config *k052109 = devtag_get_device(device->machine, "k052109");
if (k052109_is_irq_enabled(k052109))
cpu_set_input_line(device, 0, HOLD_LINE);
}
@ -248,6 +252,7 @@ static void spy_collision(void)
static WRITE8_HANDLER( spy_3f90_w )
{
const device_config *k052109 = devtag_get_device(space->machine, "k052109");
extern int spy_video_enable;
static int old;
@ -290,11 +295,11 @@ static WRITE8_HANDLER( spy_3f90_w )
********************************************************************/
/* bits 0/1 = coin counters */
coin_counter_w(space->machine, 0,data & 0x01);
coin_counter_w(space->machine, 1,data & 0x02);
coin_counter_w(space->machine, 0, data & 0x01);
coin_counter_w(space->machine, 1, data & 0x02);
/* bit 2 = enable char ROM reading through the video RAM */
K052109_set_RMRD_line((data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
k052109_set_rmrd_line(k052109, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
/* bit 3 = disable video */
spy_video_enable = ~(data & 0x08);
@ -351,6 +356,37 @@ static WRITE8_HANDLER( sound_bank_w )
static READ8_HANDLER( k052109_051960_r )
{
const device_config *k052109 = devtag_get_device(space->machine, "k052109");
const device_config *k051960 = devtag_get_device(space->machine, "k051960");
if (k052109_get_rmrd_line(k052109) == CLEAR_LINE)
{
if (offset >= 0x3800 && offset < 0x3808)
return k051937_r(k051960, offset - 0x3800);
else if (offset < 0x3c00)
return k052109_r(k052109, offset);
else
return k051960_r(k051960, offset - 0x3c00);
}
else
return k052109_r(k052109, offset);
}
static WRITE8_HANDLER( k052109_051960_w )
{
const device_config *k052109 = devtag_get_device(space->machine, "k052109");
const device_config *k051960 = devtag_get_device(space->machine, "k051960");
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(k051960, offset - 0x3800, data);
else if (offset < 0x3c00)
k052109_w(k052109, offset, data);
else
k051960_w(k051960, offset - 0x3c00, data);
}
static ADDRESS_MAP_START( spy_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x07ff) AM_READWRITE(spy_bankedram1_r,spy_bankedram1_w) AM_BASE(&ram)
AM_RANGE(0x0800, 0x1aff) AM_RAM
@ -364,7 +400,7 @@ static ADDRESS_MAP_START( spy_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x3fd2, 0x3fd2) AM_READ_PORT("P2")
AM_RANGE(0x3fd3, 0x3fd3) AM_READ_PORT("DSW1")
AM_RANGE(0x3fe0, 0x3fe0) AM_READ_PORT("DSW2")
AM_RANGE(0x2000, 0x5fff) AM_READWRITE(K052109_051960_r,K052109_051960_w)
AM_RANGE(0x2000, 0x5fff) AM_READWRITE(k052109_051960_r, k052109_051960_w)
AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank1")
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@ -373,8 +409,8 @@ static ADDRESS_MAP_START( spy_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0x9000, 0x9000) AM_WRITE(sound_bank_w)
AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE("konami1", k007232_r,k007232_w)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("konami2", k007232_r,k007232_w)
AM_RANGE(0xa000, 0xa00d) AM_DEVREADWRITE("konami1", k007232_r, k007232_w)
AM_RANGE(0xb000, 0xb00d) AM_DEVREADWRITE("konami2", k007232_r, k007232_w)
AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ymsnd", ym3812_r,ym3812_w)
AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_r)
ADDRESS_MAP_END
@ -468,6 +504,22 @@ static const ym3812_interface ym3812_config =
static const k052109_interface spy_k052109_intf =
{
"gfx1", 0,
NORMAL_PLANE_ORDER,
KONAMI_ROM_DEINTERLEAVE_2,
spy_tile_callback
};
static const k051960_interface spy_k051960_intf =
{
"gfx2", 1,
NORMAL_PLANE_ORDER,
KONAMI_ROM_DEINTERLEAVE_2,
spy_sprite_callback
};
static MACHINE_DRIVER_START( spy )
/* basic machine hardware */
@ -494,6 +546,9 @@ static MACHINE_DRIVER_START( spy )
MDRV_VIDEO_START(spy)
MDRV_VIDEO_UPDATE(spy)
MDRV_K052109_ADD("k052109", spy_k052109_intf)
MDRV_K051960_ADD("k051960", spy_k051960_intf)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")
@ -574,18 +629,10 @@ ROM_START( spyu )
ROM_END
static void gfx_untangle(running_machine *machine)
{
konami_rom_deinterleave_2(machine, "gfx1");
konami_rom_deinterleave_2(machine, "gfx2");
}
static DRIVER_INIT( spy )
{
machine->generic.paletteram.u8 = &memory_region(machine, "maincpu")[0x28000];
pmcram = &memory_region(machine, "maincpu")[0x28800];
gfx_untangle(machine);
pmcram = &memory_region(machine, "maincpu")[0x28800];
}

View File

@ -10,27 +10,32 @@ driver by Nicola Salmoria
#include "driver.h"
#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
#include "video/konamiic.h"
#include "video/konicdev.h"
#include "sound/2151intf.h"
#include "konamipt.h"
#include "includes/konamipt.h"
/* prototypes */
static MACHINE_RESET( surpratk );
static KONAMI_SETLINES_CALLBACK( surpratk_banking );
VIDEO_START( surpratk );
VIDEO_UPDATE( surpratk );
extern void surpratk_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
extern void surpratk_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask);
static int videobank;
static UINT8 *ram;
static INTERRUPT_GEN( surpratk_interrupt )
{
if (K052109_is_IRQ_enabled()) cpu_set_input_line(device,0,HOLD_LINE);
const device_config *k052109 = devtag_get_device(device->machine, "k052109");
if (k052109_is_irq_enabled(k052109))
cpu_set_input_line(device,0,HOLD_LINE);
}
static READ8_HANDLER( bankedram_r )
{
const device_config *k053244 = devtag_get_device(space->machine, "k053244");
if (videobank & 0x02)
{
if (videobank & 0x04)
@ -39,13 +44,14 @@ static READ8_HANDLER( bankedram_r )
return space->machine->generic.paletteram.u8[offset];
}
else if (videobank & 0x01)
return K053245_r(space,offset);
return k053245_r(k053244, offset);
else
return ram[offset];
}
static WRITE8_HANDLER( bankedram_w )
{
const device_config *k053244 = devtag_get_device(space->machine, "k053244");
if (videobank & 0x02)
{
if (videobank & 0x04)
@ -54,7 +60,7 @@ static WRITE8_HANDLER( bankedram_w )
paletteram_xBBBBBGGGGGRRRRR_be_w(space,offset,data);
}
else if (videobank & 0x01)
K053245_w(space,offset,data);
k053245_w(k053244, offset, data);
else
ram[offset] = data;
}
@ -70,6 +76,7 @@ logerror("%04x: videobank = %02x\n",cpu_get_pc(space->cpu),data);
static WRITE8_HANDLER( surpratk_5fc0_w )
{
const device_config *k052109 = devtag_get_device(space->machine, "k052109");
if ((data & 0xf4) != 0x10) logerror("%04x: 3fc0 = %02x\n",cpu_get_pc(space->cpu),data);
/* bit 0/1 = coin counters */
@ -77,7 +84,7 @@ static WRITE8_HANDLER( surpratk_5fc0_w )
coin_counter_w(space->machine, 1,data & 0x02);
/* bit 3 = enable char ROM reading through the video RAM */
K052109_set_RMRD_line( ( data & 0x08 ) ? ASSERT_LINE : CLEAR_LINE );
k052109_set_rmrd_line(k052109, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
/* other bits unknown */
}
@ -94,12 +101,12 @@ static ADDRESS_MAP_START( surpratk_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x5f8e, 0x5f8e) AM_READ_PORT("DSW3")
AM_RANGE(0x5f8f, 0x5f8f) AM_READ_PORT("DSW1")
AM_RANGE(0x5f90, 0x5f90) AM_READ_PORT("DSW2")
AM_RANGE(0x5fa0, 0x5faf) AM_READWRITE(K053244_r, K053244_w)
AM_RANGE(0x5fb0, 0x5fbf) AM_WRITE(K053251_w)
AM_RANGE(0x5fa0, 0x5faf) AM_DEVREADWRITE("k053244", k053244_r, k053244_w)
AM_RANGE(0x5fb0, 0x5fbf) AM_DEVWRITE("k053251", k053251_w)
AM_RANGE(0x5fc0, 0x5fc0) AM_READWRITE(watchdog_reset_r, surpratk_5fc0_w)
AM_RANGE(0x5fd0, 0x5fd1) AM_DEVWRITE("ymsnd", ym2151_w)
AM_RANGE(0x5fc4, 0x5fc4) AM_WRITE(surpratk_videobank_w)
AM_RANGE(0x4000, 0x7fff) AM_READWRITE(K052109_r, K052109_w)
AM_RANGE(0x4000, 0x7fff) AM_DEVREADWRITE("k052109", k052109_r, k052109_w)
AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM */
ADDRESS_MAP_END
@ -175,6 +182,23 @@ static const ym2151_interface ym2151_config =
static const k052109_interface surpratk_k052109_intf =
{
"gfx1", 0,
NORMAL_PLANE_ORDER,
KONAMI_ROM_DEINTERLEAVE_2,
surpratk_tile_callback
};
static const k05324x_interface surpratk_k05324x_intf =
{
"gfx2", 1,
NORMAL_PLANE_ORDER,
0, 0,
KONAMI_ROM_DEINTERLEAVE_2,
surpratk_sprite_callback
};
static MACHINE_DRIVER_START( surpratk )
/* basic machine hardware */
@ -196,9 +220,12 @@ static MACHINE_DRIVER_START( surpratk )
MDRV_PALETTE_LENGTH(2048)
MDRV_VIDEO_START(surpratk)
MDRV_VIDEO_UPDATE(surpratk)
MDRV_K052109_ADD("k052109", surpratk_k052109_intf)
MDRV_K053244_ADD("k053244", surpratk_k05324x_intf)
MDRV_K053251_ADD("k053251")
/* sound hardware */
MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@ -285,13 +312,7 @@ static MACHINE_RESET( surpratk )
machine->generic.paletteram.u8 = &memory_region(machine, "maincpu")[0x48000];
}
static DRIVER_INIT( surpratk )
{
konami_rom_deinterleave_2(machine, "gfx1");
konami_rom_deinterleave_2(machine, "gfx2");
}
GAME( 1990, suratk, 0, surpratk, surpratk, surpratk, ROT0, "Konami", "Surprise Attack (World ver. K)", 0 )
GAME( 1990, suratka, suratk, surpratk, surpratk, surpratk, ROT0, "Konami", "Surprise Attack (Asia ver. L)", 0 )
GAME( 1990, suratkj, suratk, surpratk, surpratk, surpratk, ROT0, "Konami", "Surprise Attack (Japan ver. M)", 0 )
GAME( 1990, suratk, 0, surpratk, surpratk, 0, ROT0, "Konami", "Surprise Attack (World ver. K)", 0 )
GAME( 1990, suratka, suratk, surpratk, surpratk, 0, ROT0, "Konami", "Surprise Attack (Asia ver. L)", 0 )
GAME( 1990, suratkj, suratk, surpratk, surpratk, 0, ROT0, "Konami", "Surprise Attack (Japan ver. M)", 0 )

View File

@ -11,7 +11,7 @@
#include "cpu/m6809/m6809.h"
#include "cpu/z80/z80.h"
#include "cpu/konami/konami.h"
#include "video/konamiic.h"
#include "video/konicdev.h"
#include "includes/ajax.h"
static int firq_enable;
@ -180,14 +180,16 @@ WRITE8_HANDLER( ajax_ls138_f10_w )
WRITE8_HANDLER( ajax_bankswitch_2_w )
{
const device_config *k052109 = devtag_get_device(space->machine, "k052109");
const device_config *k051316 = devtag_get_device(space->machine, "k051316");
UINT8 *RAM = memory_region(space->machine, "sub");
int bankaddress;
/* enable char ROM reading through the video RAM */
K052109_set_RMRD_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
k052109_set_rmrd_line(k052109, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
/* bit 5 enables 051316 wraparound */
K051316_wraparound_enable(0, data & 0x20);
k051316_wraparound_enable(k051316, data & 0x20);
/* FIRQ control */
firq_enable = data & 0x10;
@ -211,6 +213,7 @@ MACHINE_RESET( ajax )
INTERRUPT_GEN( ajax_interrupt )
{
if (K051960_is_IRQ_enabled())
const device_config *k051960 = devtag_get_device(device->machine, "k051960");
if (k051960_is_irq_enabled(k051960))
cpu_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
}

View File

@ -7,7 +7,7 @@
***************************************************************************/
#include "driver.h"
#include "video/konamiic.h"
#include "video/konicdev.h"
#include "includes/ajax.h"
@ -21,7 +21,7 @@ static int layer_colorbase[3],sprite_colorbase,zoom_colorbase;
***************************************************************************/
static void tile_callback(int layer,int bank,int *code,int *color,int *flags,int *priority)
void ajax_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority)
{
*code |= ((*color & 0x0f) << 8) | (bank << 12);
*color = layer_colorbase[layer] + ((*color & 0xf0) >> 4);
@ -34,7 +34,7 @@ static void tile_callback(int layer,int bank,int *code,int *color,int *flags,int
***************************************************************************/
static void sprite_callback(int *code,int *color,int *priority,int *shadow)
void ajax_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow)
{
/* priority bits:
4 over zoom (0 = have priority)
@ -56,7 +56,7 @@ static void sprite_callback(int *code,int *color,int *priority,int *shadow)
***************************************************************************/
static void zoom_callback(int *code,int *color,int *flags)
void ajax_zoom_callback(running_machine *machine, int *code,int *color,int *flags)
{
*code |= ((*color & 0x07) << 8);
*color = zoom_colorbase + ((*color & 0x08) >> 3);
@ -76,10 +76,7 @@ VIDEO_START( ajax )
layer_colorbase[2] = 32;
sprite_colorbase = 16;
zoom_colorbase = 6; /* == 48 since it's 7-bit graphics */
K052109_vh_start(machine,"gfx1",NORMAL_PLANE_ORDER,tile_callback);
K051960_vh_start(machine,"gfx2",NORMAL_PLANE_ORDER,sprite_callback);
K051316_vh_start_0(machine,"gfx3",7,FALSE,0,zoom_callback);
state_save_register_global(machine, ajax_priority);
state_save_register_global(machine, ajax_priority);
}
@ -92,26 +89,30 @@ VIDEO_START( ajax )
VIDEO_UPDATE( ajax )
{
K052109_tilemap_update();
const device_config *k051316 = devtag_get_device(screen->machine, "k051316");
const device_config *k052109 = devtag_get_device(screen->machine, "k052109");
const device_config *k051960 = devtag_get_device(screen->machine, "k051960");
k052109_tilemap_update(k052109);
bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,1);
k052109_tilemap_draw(k052109, bitmap, cliprect, 2, 0, 1);
if (ajax_priority)
{
/* basic layer order is B, zoom, A, F */
K051316_zoom_draw_0(bitmap,cliprect,0,4);
tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,2);
k051316_zoom_draw(k051316, bitmap, cliprect, 0, 4);
k052109_tilemap_draw(k052109, bitmap, cliprect, 1, 0, 2);
}
else
{
/* basic layer order is B, A, zoom, F */
tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,2);
K051316_zoom_draw_0(bitmap,cliprect,0,4);
k052109_tilemap_draw(k052109, bitmap, cliprect, 1, 0, 2);
k051316_zoom_draw(k051316, bitmap, cliprect, 0, 4);
}
tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,8);
k052109_tilemap_draw(k052109, bitmap, cliprect, 0, 0, 8);
K051960_sprites_draw(screen->machine,bitmap,cliprect,-1,-1);
k051960_sprites_draw(k051960, bitmap, cliprect, -1, -1);
return 0;
}

View File

@ -1,5 +1,5 @@
#include "driver.h"
#include "video/konamiic.h"
#include "video/konicdev.h"
@ -14,7 +14,7 @@ static int layer_colorbase[3],sprite_colorbase,zoom_colorbase;
***************************************************************************/
static void tile_callback(int layer,int bank,int *code,int *color,int *flags,int *priority)
void bottom9_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority)
{
*code |= (*color & 0x3f) << 8;
*color = layer_colorbase[layer] + ((*color & 0xc0) >> 6);
@ -27,7 +27,7 @@ static void tile_callback(int layer,int bank,int *code,int *color,int *flags,int
***************************************************************************/
static void sprite_callback(int *code,int *color,int *priority,int *shadow)
void bottom9_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow)
{
/* bit 4 = priority over zoom (0 = have priority) */
/* bit 5 = priority over B (1 = have priority) */
@ -42,7 +42,7 @@ static void sprite_callback(int *code,int *color,int *priority,int *shadow)
***************************************************************************/
static void zoom_callback(int *code,int *color,int *flags)
void bottom9_zoom_callback(running_machine *machine, int *code,int *color,int *flags)
{
*flags = (*color & 0x40) ? TILE_FLIPX : 0;
*code |= ((*color & 0x03) << 8);
@ -63,9 +63,6 @@ VIDEO_START( bottom9 )
layer_colorbase[2] = 16;
sprite_colorbase = 32;
zoom_colorbase = 48;
K052109_vh_start(machine,"gfx1",NORMAL_PLANE_ORDER,tile_callback);
K051960_vh_start(machine,"gfx2",NORMAL_PLANE_ORDER,sprite_callback);
K051316_vh_start_0(machine,"gfx3",4,FALSE,0,zoom_callback);
}
@ -78,20 +75,24 @@ VIDEO_START( bottom9 )
VIDEO_UPDATE( bottom9 )
{
K052109_tilemap_update();
const device_config *k052109 = devtag_get_device(screen->machine, "k052109");
const device_config *k051960 = devtag_get_device(screen->machine, "k051960");
const device_config *k051316 = devtag_get_device(screen->machine, "k051316");
k052109_tilemap_update(k052109);
/* note: FIX layer is not used */
bitmap_fill(bitmap,cliprect,layer_colorbase[1]);
// if (bottom9_video_enable)
{
K051960_sprites_draw(screen->machine,bitmap,cliprect,1,1);
K051316_zoom_draw_0(bitmap,cliprect,0,0);
K051960_sprites_draw(screen->machine,bitmap,cliprect,0,0);
tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,0);
k051960_sprites_draw(k051960, bitmap, cliprect, 1, 1);
k051316_zoom_draw(k051316, bitmap, cliprect, 0, 0);
k051960_sprites_draw(k051960, bitmap, cliprect, 0, 0);
k052109_tilemap_draw(k052109, bitmap, cliprect, 2, 0, 0);
/* note that priority 3 is opposite to the basic layer priority! */
/* (it IS used, but hopefully has no effect) */
K051960_sprites_draw(screen->machine,bitmap,cliprect,2,3);
tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,0);
k051960_sprites_draw(k051960, bitmap, cliprect, 2, 3);
k052109_tilemap_draw(k052109, bitmap, cliprect, 1, 0, 0);
}
return 0;
}

View File

@ -7,12 +7,7 @@
***************************************************************************/
#include "driver.h"
#include "video/konamiic.h"
#include "cpu/z80/z80.h"
#define SPRITEROM_MEM_REGION "gfx1"
#define ZOOMROM0_MEM_REGION "gfx2"
#define ZOOMROM1_MEM_REGION "gfx3"
#include "video/konicdev.h"
static int sprite_colorbase,zoom_colorbase[2];
@ -22,7 +17,7 @@ static int sprite_colorbase,zoom_colorbase[2];
***************************************************************************/
static void sprite_callback(int *code,int *color,int *priority,int *shadow)
void chqflag_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow)
{
*priority = (*color & 0x10) >> 4;
*color = sprite_colorbase + (*color & 0x0f);
@ -35,13 +30,12 @@ static void sprite_callback(int *code,int *color,int *priority,int *shadow)
***************************************************************************/
static void zoom_callback_0(int *code,int *color,int *flags)
{
*code |= ((*color & 0x03) << 8);
void chqflag_zoom_callback_0(running_machine *machine, int *code,int *color,int *flags)
{ *code |= ((*color & 0x03) << 8);
*color = zoom_colorbase[0] + ((*color & 0x3c) >> 2);
}
static void zoom_callback_1(int *code,int *color,int *flags)
void chqflag_zoom_callback_1(running_machine *machine, int *code,int *color,int *flags)
{
*flags = TILE_FLIPYX((*color & 0xc0) >> 6);
*code |= ((*color & 0x0f) << 8);
@ -59,13 +53,6 @@ VIDEO_START( chqflag )
sprite_colorbase = 0;
zoom_colorbase[0] = 0x10;
zoom_colorbase[1] = 0x02;
K051960_vh_start(machine,SPRITEROM_MEM_REGION,NORMAL_PLANE_ORDER,sprite_callback);
K051316_vh_start_0(machine,ZOOMROM0_MEM_REGION,4,FALSE,0,zoom_callback_0);
K051316_vh_start_1(machine,ZOOMROM1_MEM_REGION,8,TRUE,0xc0,zoom_callback_1);
K051316_set_offset(0,7,0);
K051316_wraparound_enable(1,1);
}
/***************************************************************************
@ -76,12 +63,16 @@ VIDEO_START( chqflag )
VIDEO_UPDATE( chqflag )
{
bitmap_fill(bitmap,cliprect,0);
const device_config *k051960 = devtag_get_device(screen->machine, "k051960");
const device_config *k051316_1 = devtag_get_device(screen->machine, "k051316_1");
const device_config *k051316_2 = devtag_get_device(screen->machine, "k051316_2");
K051316_zoom_draw_1(bitmap,cliprect,TILEMAP_DRAW_LAYER1,0);
K051960_sprites_draw(screen->machine,bitmap,cliprect,0,0);
K051316_zoom_draw_1(bitmap,cliprect,TILEMAP_DRAW_LAYER0,0);
K051960_sprites_draw(screen->machine,bitmap,cliprect,1,1);
K051316_zoom_draw_0(bitmap,cliprect,0,0);
bitmap_fill(bitmap, cliprect, 0);
k051316_zoom_draw(k051316_2, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
k051960_sprites_draw(k051960, bitmap, cliprect, 0, 0);
k051316_zoom_draw(k051316_2, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
k051960_sprites_draw(k051960, bitmap, cliprect, 1, 1);
k051316_zoom_draw(k051316_1, bitmap, cliprect, 0, 0);
return 0;
}

View File

@ -5170,6 +5170,12 @@ WRITE8_DEVICE_HANDLER( k051316_ctrl_w )
//if (offset >= 0x0c) logerror("%s: write %02x to 051316 reg %x\n", cpuexec_describe_context(device->machine), data, offset);
}
// a few games (ajax, rollerg, etc.) can enable and disable wraparound after start
void k051316_wraparound_enable( const device_config *device, int status )
{
k051316_state *k051316= k051316_get_safe_token(device);
k051316->wraparound = status;
}
/***************************************************************************

View File

@ -498,6 +498,7 @@ WRITE8_DEVICE_HANDLER( k051316_w );
READ8_DEVICE_HANDLER( k051316_rom_r );
WRITE8_DEVICE_HANDLER( k051316_ctrl_w );
void k051316_zoom_draw(const device_config *device, bitmap_t *bitmap,const rectangle *cliprect,int flags,UINT32 priority);
void k051316_wraparound_enable(const device_config *device, int status);
/** Konami 053936 **/

View File

@ -1,5 +1,5 @@
#include "driver.h"
#include "video/konamiic.h"
#include "video/konicdev.h"
static int bg_colorbase,sprite_colorbase,zoom_colorbase;
@ -12,7 +12,7 @@ static int bg_colorbase,sprite_colorbase,zoom_colorbase;
***************************************************************************/
static void sprite_callback(int *code,int *color,int *priority_mask)
void rollerg_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask)
{
#if 0
if (input_code_pressed(machine, KEYCODE_Q) && (*color & 0x80)) *color = rand();
@ -31,7 +31,7 @@ if (input_code_pressed(machine, KEYCODE_R) && (*color & 0x10)) *color = rand();
***************************************************************************/
static void zoom_callback(int *code,int *color,int *flags)
void rollerg_zoom_callback(running_machine *machine, int *code,int *color,int *flags)
{
*flags = TILE_FLIPYX((*color & 0xc0) >> 6);
*code |= ((*color & 0x0f) << 8);
@ -51,11 +51,6 @@ VIDEO_START( rollerg )
bg_colorbase = 16;
sprite_colorbase = 16;
zoom_colorbase = 0;
K053245_vh_start(machine,0,"gfx1",NORMAL_PLANE_ORDER,sprite_callback);
K051316_vh_start_0(machine,"gfx2",4,FALSE,0,zoom_callback);
K051316_set_offset(0, 22, 1);
}
@ -68,9 +63,12 @@ VIDEO_START( rollerg )
VIDEO_UPDATE( rollerg )
{
bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
bitmap_fill(bitmap,cliprect,16 * bg_colorbase);
K051316_zoom_draw_0(bitmap,cliprect,0,1);
K053245_sprites_draw(screen->machine,0,bitmap,cliprect);
const device_config *k053244 = devtag_get_device(screen->machine, "k053244");
const device_config *k051316 = devtag_get_device(screen->machine, "k051316");
bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 16 * bg_colorbase);
k051316_zoom_draw(k051316, bitmap, cliprect, 0, 1);
k053245_sprites_draw(k053244, bitmap, cliprect);
return 0;
}

View File

@ -1,5 +1,5 @@
#include "driver.h"
#include "video/konamiic.h"
#include "video/konicdev.h"
int spy_video_enable;
@ -13,7 +13,7 @@ static int layer_colorbase[3],sprite_colorbase;
***************************************************************************/
static void tile_callback(int layer,int bank,int *code,int *color,int *flags,int *priority)
void spy_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority)
{
*flags = (*color & 0x20) ? TILE_FLIPX : 0;
*code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9)
@ -28,7 +28,7 @@ static void tile_callback(int layer,int bank,int *code,int *color,int *flags,int
***************************************************************************/
static void sprite_callback(int *code,int *color,int *priority_mask,int *shadow)
void spy_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask,int *shadow)
{
/* bit 4 = priority over layer A (0 = have priority) */
/* bit 5 = priority over layer B (1 = have priority) */
@ -52,8 +52,6 @@ VIDEO_START( spy )
layer_colorbase[1] = 0;
layer_colorbase[2] = 16;
sprite_colorbase = 32;
K052109_vh_start(machine,"gfx1",NORMAL_PLANE_ORDER,tile_callback);
K051960_vh_start(machine,"gfx2",NORMAL_PLANE_ORDER,sprite_callback);
}
@ -66,7 +64,10 @@ VIDEO_START( spy )
VIDEO_UPDATE( spy )
{
K052109_tilemap_update();
const device_config *k052109 = devtag_get_device(screen->machine, "k052109");
const device_config *k051960 = devtag_get_device(screen->machine, "k051960");
k052109_tilemap_update(k052109);
bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
@ -74,10 +75,10 @@ VIDEO_UPDATE( spy )
bitmap_fill(bitmap,cliprect,16 * layer_colorbase[0]);
else
{
tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_DRAW_OPAQUE,1);
tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,2);
K051960_sprites_draw(screen->machine,bitmap,cliprect,-1,-1);
tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,0);
k052109_tilemap_draw(k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 1);
k052109_tilemap_draw(k052109, bitmap, cliprect, 2, 0, 2);
k051960_sprites_draw(k051960, bitmap, cliprect, -1, -1);
k052109_tilemap_draw(k052109, bitmap, cliprect, 0, 0, 0);
}
return 0;

View File

@ -1,5 +1,5 @@
#include "driver.h"
#include "video/konamiic.h"
#include "video/konicdev.h"
static int layer_colorbase[3],sprite_colorbase,bg_colorbase;
static int layerpri[3];
@ -11,7 +11,7 @@ static int layerpri[3];
***************************************************************************/
static void tile_callback(int layer,int bank,int *code,int *color,int *flags,int *priority)
void surpratk_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority)
{
*flags = (*color & 0x80) ? TILE_FLIPX : 0;
*code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13);
@ -24,7 +24,7 @@ static void tile_callback(int layer,int bank,int *code,int *color,int *flags,int
***************************************************************************/
static void sprite_callback(int *code,int *color,int *priority_mask)
void surpratk_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask)
{
int pri = 0x20 | ((*color & 0x60) >> 2);
if (pri <= layerpri[2]) *priority_mask = 0;
@ -42,14 +42,6 @@ static void sprite_callback(int *code,int *color,int *priority_mask)
***************************************************************************/
VIDEO_START( surpratk )
{
K053251_vh_start(machine);
K052109_vh_start(machine,"gfx1",NORMAL_PLANE_ORDER,tile_callback);
K053245_vh_start(machine,0,"gfx2",NORMAL_PLANE_ORDER,sprite_callback);
}
/* useful function to sort the three tile layers by priority order */
static void sortlayers(int *layer,int *pri)
{
@ -68,32 +60,35 @@ static void sortlayers(int *layer,int *pri)
VIDEO_UPDATE( surpratk )
{
const device_config *k052109 = devtag_get_device(screen->machine, "k052109");
const device_config *k053244 = devtag_get_device(screen->machine, "k053244");
const device_config *k053251 = devtag_get_device(screen->machine, "k053251");
int layer[3];
bg_colorbase = K053251_get_palette_index(K053251_CI0);
sprite_colorbase = K053251_get_palette_index(K053251_CI1);
layer_colorbase[0] = K053251_get_palette_index(K053251_CI2);
layer_colorbase[1] = K053251_get_palette_index(K053251_CI4);
layer_colorbase[2] = K053251_get_palette_index(K053251_CI3);
bg_colorbase = k053251_get_palette_index(k053251, K053251_CI0);
sprite_colorbase = k053251_get_palette_index(k053251, K053251_CI1);
layer_colorbase[0] = k053251_get_palette_index(k053251, K053251_CI2);
layer_colorbase[1] = k053251_get_palette_index(k053251, K053251_CI4);
layer_colorbase[2] = k053251_get_palette_index(k053251, K053251_CI3);
K052109_tilemap_update();
k052109_tilemap_update(k052109);
layer[0] = 0;
layerpri[0] = K053251_get_priority(K053251_CI2);
layerpri[0] = k053251_get_priority(k053251, K053251_CI2);
layer[1] = 1;
layerpri[1] = K053251_get_priority(K053251_CI4);
layerpri[1] = k053251_get_priority(k053251, K053251_CI4);
layer[2] = 2;
layerpri[2] = K053251_get_priority(K053251_CI3);
layerpri[2] = k053251_get_priority(k053251, K053251_CI3);
sortlayers(layer,layerpri);
sortlayers(layer, layerpri);
bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
bitmap_fill(bitmap,cliprect,16 * bg_colorbase);
tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[0]],0,1);
tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[1]],0,2);
tilemap_draw(bitmap,cliprect,K052109_tilemap[layer[2]],0,4);
bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 16 * bg_colorbase);
k052109_tilemap_draw(k052109, bitmap, cliprect, layer[0], 0, 1);
k052109_tilemap_draw(k052109, bitmap, cliprect, layer[1], 0, 2);
k052109_tilemap_draw(k052109, bitmap, cliprect, layer[2], 0, 4);
K053245_sprites_draw(screen->machine,0,bitmap,cliprect);
k053245_sprites_draw(k053244, bitmap, cliprect);
return 0;
}