mirror of
https://github.com/holub/mame
synced 2025-05-23 06:08:48 +03:00
updated gradius3.c, mainevt.c & gijoe.c to use Konami video devices
This commit is contained in:
parent
b1293d18ac
commit
707c4d14cc
@ -38,15 +38,18 @@ Known Issues
|
||||
|
||||
#include "driver.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "machine/eeprom.h"
|
||||
#include "sound/k054539.h"
|
||||
#include "konamipt.h"
|
||||
#include "includes/konamipt.h"
|
||||
|
||||
VIDEO_START( gijoe );
|
||||
VIDEO_UPDATE( gijoe );
|
||||
|
||||
extern void gijoe_sprite_callback(running_machine *machine, int *code, int *color, int *priority_mask);
|
||||
extern void gijoe_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags);
|
||||
|
||||
static UINT16 *gijoe_workram;
|
||||
static UINT16 cur_control2;
|
||||
static int init_eeprom_count;
|
||||
@ -106,7 +109,9 @@ static READ16_HANDLER( control2_r )
|
||||
|
||||
static WRITE16_HANDLER( control2_w )
|
||||
{
|
||||
if(ACCESSING_BITS_0_7) {
|
||||
const device_config *k053246 = devtag_get_device(space->machine, "k053246");
|
||||
if(ACCESSING_BITS_0_7)
|
||||
{
|
||||
/* bit 0 is data */
|
||||
/* bit 1 is cs (active low) */
|
||||
/* bit 2 is clock (active high) */
|
||||
@ -120,17 +125,18 @@ static WRITE16_HANDLER( control2_w )
|
||||
cur_control2 = data;
|
||||
|
||||
/* bit 6 = enable sprite ROM reading */
|
||||
K053246_set_OBJCHA_line((data & 0x0040) ? ASSERT_LINE : CLEAR_LINE);
|
||||
k053246_set_objcha_line(k053246, (data & 0x0040) ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
static void gijoe_objdma(running_machine *machine)
|
||||
{
|
||||
const device_config *k053246 = devtag_get_device(machine, "k053246");
|
||||
UINT16 *src_head, *src_tail, *dst_head, *dst_tail;
|
||||
|
||||
src_head = machine->generic.spriteram.u16;
|
||||
src_tail = machine->generic.spriteram.u16 + 255*8;
|
||||
K053247_export_config(&dst_head, 0, 0, 0, 0);
|
||||
k053247_get_ram(k053246, &dst_head);
|
||||
dst_tail = dst_head + 255*8;
|
||||
|
||||
for (; src_head<=src_tail; src_head+=8)
|
||||
@ -156,10 +162,14 @@ static TIMER_CALLBACK( dmaend_callback )
|
||||
|
||||
static INTERRUPT_GEN( gijoe_interrupt )
|
||||
{
|
||||
// global interrupt masking (*this game only)
|
||||
if (!K056832_is_IRQ_enabled(0)) return;
|
||||
const device_config *k053246 = devtag_get_device(device->machine, "k053246");
|
||||
const device_config *k056832 = devtag_get_device(device->machine, "k056832");
|
||||
|
||||
if (K053246_is_IRQ_enabled())
|
||||
// global interrupt masking (*this game only)
|
||||
if (!k056832_is_irq_enabled(k056832, 0))
|
||||
return;
|
||||
|
||||
if (k053246_is_irq_enabled(k053246))
|
||||
{
|
||||
gijoe_objdma(device->machine);
|
||||
|
||||
@ -174,7 +184,8 @@ static INTERRUPT_GEN( gijoe_interrupt )
|
||||
|
||||
static WRITE16_HANDLER( sound_cmd_w )
|
||||
{
|
||||
if(ACCESSING_BITS_0_7) {
|
||||
if(ACCESSING_BITS_0_7)
|
||||
{
|
||||
data &= 0xff;
|
||||
soundlatch_w(space, 0, data);
|
||||
}
|
||||
@ -206,16 +217,16 @@ static MACHINE_START( gijoe )
|
||||
static ADDRESS_MAP_START( gijoe_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x000000, 0x0fffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x100fff) AM_RAM AM_BASE_GENERIC(spriteram) // Sprites
|
||||
AM_RANGE(0x110000, 0x110007) AM_WRITE(K053246_word_w)
|
||||
AM_RANGE(0x120000, 0x121fff) AM_READWRITE(K056832_ram_word_r, K056832_ram_word_w) // Graphic planes
|
||||
AM_RANGE(0x122000, 0x123fff) AM_READWRITE(K056832_ram_word_r, K056832_ram_word_w) // Graphic planes mirror read
|
||||
AM_RANGE(0x130000, 0x131fff) AM_READ(K056832_rom_word_r) // Passthrough to tile roms
|
||||
AM_RANGE(0x160000, 0x160007) AM_WRITE(K056832_b_word_w) // VSCCS (board dependent)
|
||||
AM_RANGE(0x110000, 0x110007) AM_DEVWRITE("k053246", k053246_word_w)
|
||||
AM_RANGE(0x120000, 0x121fff) AM_DEVREADWRITE("k056832", k056832_ram_word_r, k056832_ram_word_w) // Graphic planes
|
||||
AM_RANGE(0x122000, 0x123fff) AM_DEVREADWRITE("k056832", k056832_ram_word_r, k056832_ram_word_w) // Graphic planes mirror read
|
||||
AM_RANGE(0x130000, 0x131fff) AM_DEVREAD("k056832", k056832_rom_word_r) // Passthrough to tile roms
|
||||
AM_RANGE(0x160000, 0x160007) AM_DEVWRITE("k056832", k056832_b_word_w) // VSCCS (board dependent)
|
||||
AM_RANGE(0x170000, 0x170001) AM_WRITENOP // Watchdog
|
||||
AM_RANGE(0x180000, 0x18ffff) AM_RAM AM_BASE(&gijoe_workram) // Main RAM. Spec. 180000-1803ff, 180400-187fff
|
||||
AM_RANGE(0x190000, 0x190fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0x1a0000, 0x1a001f) AM_WRITE(K053251_lsb_w)
|
||||
AM_RANGE(0x1b0000, 0x1b003f) AM_WRITE(K056832_word_w)
|
||||
AM_RANGE(0x1a0000, 0x1a001f) AM_DEVWRITE("k053251", k053251_lsb_w)
|
||||
AM_RANGE(0x1b0000, 0x1b003f) AM_DEVWRITE("k056832", k056832_word_w)
|
||||
AM_RANGE(0x1c000c, 0x1c000d) AM_WRITE(sound_cmd_w)
|
||||
AM_RANGE(0x1c0014, 0x1c0015) AM_READ(sound_status_r)
|
||||
AM_RANGE(0x1c0000, 0x1c001f) AM_RAM
|
||||
@ -225,12 +236,12 @@ static ADDRESS_MAP_START( gijoe_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x1e4000, 0x1e4001) AM_READ_PORT("SYSTEM")
|
||||
AM_RANGE(0x1e4002, 0x1e4003) AM_READ(control1_r)
|
||||
AM_RANGE(0x1e8000, 0x1e8001) AM_READWRITE(control2_r, control2_w)
|
||||
AM_RANGE(0x1f0000, 0x1f0001) AM_READ(K053246_word_r)
|
||||
AM_RANGE(0x1f0000, 0x1f0001) AM_DEVREAD("k053246", k053246_word_r)
|
||||
#if JOE_DEBUG
|
||||
AM_RANGE(0x110000, 0x110007) AM_READ(K053246_reg_word_r)
|
||||
AM_RANGE(0x160000, 0x160007) AM_READ(K056832_b_word_r)
|
||||
AM_RANGE(0x1a0000, 0x1a001f) AM_READ(K053251_lsb_r)
|
||||
AM_RANGE(0x1b0000, 0x1b003f) AM_READ(K056832_word_r)
|
||||
AM_RANGE(0x110000, 0x110007) AM_DEVREAD("k053246", k053246_reg_word_r)
|
||||
AM_RANGE(0x160000, 0x160007) AM_DEVREAD("k056832", k056832_b_word_r)
|
||||
AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREAD("k053251", k053251_lsb_r)
|
||||
AM_RANGE(0x1b0000, 0x1b003f) AM_DEVREAD("k056832", k056832_word_r)
|
||||
#endif
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -288,6 +299,25 @@ static const k054539_interface k054539_config =
|
||||
sound_nmi
|
||||
};
|
||||
|
||||
static const k056832_interface gijoe_k056832_intf =
|
||||
{
|
||||
"gfx1", 0,
|
||||
K056832_BPP_4,
|
||||
1, 0,
|
||||
KONAMI_ROM_DEINTERLEAVE_2,
|
||||
gijoe_tile_callback, "none"
|
||||
};
|
||||
|
||||
static const k053247_interface gijoe_k053247_intf =
|
||||
{
|
||||
"screen",
|
||||
"gfx2", 1,
|
||||
NORMAL_PLANE_ORDER,
|
||||
-37, 20,
|
||||
KONAMI_ROM_DEINTERLEAVE_4,
|
||||
gijoe_sprite_callback
|
||||
};
|
||||
|
||||
static MACHINE_DRIVER_START( gijoe )
|
||||
|
||||
/* basic machine hardware */
|
||||
@ -316,6 +346,10 @@ static MACHINE_DRIVER_START( gijoe )
|
||||
MDRV_VIDEO_START(gijoe)
|
||||
MDRV_VIDEO_UPDATE(gijoe)
|
||||
|
||||
MDRV_K056832_ADD("k056832", gijoe_k056832_intf)
|
||||
MDRV_K053246_ADD("k053246", gijoe_k053247_intf)
|
||||
MDRV_K053251_ADD("k053251")
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
@ -398,12 +432,7 @@ ROM_START( gijoej )
|
||||
ROM_LOAD( "069a04", 0x000000, 0x200000, CRC(11d6dcd6) SHA1(04cbff9f61cd8641db538db809ddf20da29fd5ac) )
|
||||
ROM_END
|
||||
|
||||
static DRIVER_INIT( gijoe )
|
||||
{
|
||||
konami_rom_deinterleave_2(machine, "gfx1");
|
||||
konami_rom_deinterleave_4(machine, "gfx2");
|
||||
}
|
||||
|
||||
GAME( 1992, gijoe, 0, gijoe, gijoe, gijoe, ROT0, "Konami", "GI Joe (World)", 0)
|
||||
GAME( 1992, gijoeu, gijoe, gijoe, gijoe, gijoe, ROT0, "Konami", "GI Joe (US)", 0)
|
||||
GAME( 1992, gijoej, gijoe, gijoe, gijoe, gijoe, ROT0, "Konami", "GI Joe (Japan)", 0)
|
||||
GAME( 1992, gijoe, 0, gijoe, gijoe, 0, ROT0, "Konami", "GI Joe (World)", 0)
|
||||
GAME( 1992, gijoeu, gijoe, gijoe, gijoe, 0, ROT0, "Konami", "GI Joe (US)", 0)
|
||||
GAME( 1992, gijoej, gijoe, gijoe, gijoe, 0, ROT0, "Konami", "GI Joe (Japan)", 0)
|
||||
|
@ -20,12 +20,12 @@ Added dsw locations and verified factory setting based on Guru's notes
|
||||
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "sound/2151intf.h"
|
||||
#include "sound/k007232.h"
|
||||
#include "konamipt.h"
|
||||
#include "includes/konamipt.h"
|
||||
|
||||
extern UINT16 *gradius3_gfxram;
|
||||
extern int gradius3_priority;
|
||||
@ -34,44 +34,53 @@ READ16_HANDLER( gradius3_gfxrom_r );
|
||||
WRITE16_HANDLER( gradius3_gfxram_w );
|
||||
VIDEO_UPDATE( gradius3 );
|
||||
|
||||
extern void gradius3_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask,int *shadow);
|
||||
extern void gradius3_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
|
||||
|
||||
|
||||
static READ16_HANDLER( K052109_halfword_r )
|
||||
{
|
||||
return K052109_r(space,offset);
|
||||
const device_config *k052109 = devtag_get_device(space->machine, "k052109");
|
||||
return k052109_r(k052109, offset);
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( K052109_halfword_w )
|
||||
{
|
||||
const device_config *k052109 = devtag_get_device(space->machine, "k052109");
|
||||
if (ACCESSING_BITS_0_7)
|
||||
K052109_w(space,offset,data & 0xff);
|
||||
k052109_w(k052109, offset, data & 0xff);
|
||||
|
||||
/* is this a bug in the game or something else? */
|
||||
if (!ACCESSING_BITS_0_7)
|
||||
K052109_w(space,offset,(data >> 8) & 0xff);
|
||||
k052109_w(k052109, offset, (data >> 8) & 0xff);
|
||||
// logerror("%06x half %04x = %04x\n",cpu_get_pc(space->cpu),offset,data);
|
||||
}
|
||||
|
||||
static READ16_HANDLER( K051937_halfword_r )
|
||||
{
|
||||
return K051937_r(space,offset);
|
||||
const device_config *k051960 = devtag_get_device(space->machine, "k051960");
|
||||
return k051937_r(k051960, offset);
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( K051937_halfword_w )
|
||||
{
|
||||
const device_config *k051960 = devtag_get_device(space->machine, "k051960");
|
||||
|
||||
if (ACCESSING_BITS_0_7)
|
||||
K051937_w(space,offset,data & 0xff);
|
||||
k051937_w(k051960, offset, data & 0xff);
|
||||
}
|
||||
|
||||
static READ16_HANDLER( K051960_halfword_r )
|
||||
{
|
||||
return K051960_r(space,offset);
|
||||
const device_config *k051960 = devtag_get_device(space->machine, "k051960");
|
||||
return k051960_r(k051960, offset);
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( K051960_halfword_w )
|
||||
{
|
||||
const device_config *k051960 = devtag_get_device(space->machine, "k051960");
|
||||
if (ACCESSING_BITS_0_7)
|
||||
K051960_w(space,offset,data & 0xff);
|
||||
k051960_w(k051960, offset, data & 0xff);
|
||||
}
|
||||
|
||||
|
||||
@ -287,6 +296,22 @@ static const k007232_interface k007232_config =
|
||||
|
||||
|
||||
|
||||
static const k052109_interface gradius3_k052109_intf =
|
||||
{
|
||||
"gfx1", 0,
|
||||
GRADIUS3_PLANE_ORDER,
|
||||
KONAMI_ROM_DEINTERLEAVE_NONE,
|
||||
gradius3_tile_callback
|
||||
};
|
||||
|
||||
static const k051960_interface gradius3_k051960_intf =
|
||||
{
|
||||
"gfx2", 1,
|
||||
GRADIUS3_PLANE_ORDER,
|
||||
KONAMI_ROM_DEINTERLEAVE_2,
|
||||
gradius3_sprite_callback
|
||||
};
|
||||
|
||||
static MACHINE_DRIVER_START( gradius3 )
|
||||
|
||||
/* basic machine hardware */
|
||||
@ -321,6 +346,9 @@ static MACHINE_DRIVER_START( gradius3 )
|
||||
MDRV_VIDEO_START(gradius3)
|
||||
MDRV_VIDEO_UPDATE(gradius3)
|
||||
|
||||
MDRV_K052109_ADD("k052109", gradius3_k052109_intf)
|
||||
MDRV_K051960_ADD("k051960", gradius3_k051960_intf)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
@ -471,13 +499,7 @@ ROM_START( gradius3e )
|
||||
ROM_END
|
||||
|
||||
|
||||
static DRIVER_INIT( gradius3 )
|
||||
{
|
||||
konami_rom_deinterleave_2(machine, "gfx2");
|
||||
}
|
||||
|
||||
|
||||
|
||||
GAME( 1989, gradius3, 0, gradius3, gradius3, gradius3, ROT0, "Konami", "Gradius III (Japan)", 0 )
|
||||
GAME( 1989, gradius3a, gradius3, gradius3, gradius3, gradius3, ROT0, "Konami", "Gradius III (Asia)", 0 )
|
||||
GAME( 1989, gradius3e, gradius3, gradius3, gradius3, gradius3, ROT0, "Konami", "Gradius III (World ?)", 0 )
|
||||
GAME( 1989, gradius3, 0, gradius3, gradius3, 0, ROT0, "Konami", "Gradius III (Japan)", 0 )
|
||||
GAME( 1989, gradius3a, gradius3, gradius3, gradius3, 0, ROT0, "Konami", "Gradius III (Asia)", 0 )
|
||||
GAME( 1989, gradius3e, gradius3, gradius3, gradius3, 0, ROT0, "Konami", "Gradius III (World ?)", 0 )
|
||||
|
@ -23,23 +23,29 @@ Notes:
|
||||
#include "driver.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "cpu/hd6309/hd6309.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
#include "cpu/m6809/m6809.h"
|
||||
#include "sound/2151intf.h"
|
||||
#include "sound/k007232.h"
|
||||
#include "sound/upd7759.h"
|
||||
#include "konamipt.h"
|
||||
#include "includes/konamipt.h"
|
||||
|
||||
VIDEO_UPDATE( mainevt );
|
||||
VIDEO_UPDATE( dv );
|
||||
VIDEO_START( mainevt );
|
||||
VIDEO_START( dv );
|
||||
|
||||
extern void mainevt_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
|
||||
extern void dv_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
|
||||
extern void mainevt_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask,int *shadow);
|
||||
extern void dv_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow);
|
||||
|
||||
|
||||
static INTERRUPT_GEN( mainevt_interrupt )
|
||||
{
|
||||
if (K052109_is_IRQ_enabled())
|
||||
const device_config *k052109 = devtag_get_device(device->machine, "k052109");
|
||||
|
||||
if (k052109_is_irq_enabled(k052109))
|
||||
irq0_line_hold(device);
|
||||
}
|
||||
|
||||
@ -60,6 +66,7 @@ static INTERRUPT_GEN( dv_interrupt )
|
||||
|
||||
static WRITE8_HANDLER( mainevt_bankswitch_w )
|
||||
{
|
||||
const device_config *k052109 = devtag_get_device(space->machine, "k052109");
|
||||
UINT8 *RAM = memory_region(space->machine, "maincpu");
|
||||
int bankaddress;
|
||||
|
||||
@ -71,7 +78,7 @@ static WRITE8_HANDLER( mainevt_bankswitch_w )
|
||||
// palette_selected = data & 0x20;
|
||||
|
||||
/* bit 6 = 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 7 = NINITSET (unknown) */
|
||||
|
||||
@ -139,6 +146,37 @@ static WRITE8_DEVICE_HANDLER( dv_sh_bankswitch_w )
|
||||
k007232_set_bank( device, bank_A, bank_B );
|
||||
}
|
||||
|
||||
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( mainevt_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x1f80, 0x1f80) AM_WRITE(mainevt_bankswitch_w)
|
||||
@ -156,7 +194,7 @@ static ADDRESS_MAP_START( mainevt_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x1f9a, 0x1f9a) AM_READ_PORT("P4")
|
||||
AM_RANGE(0x1f9b, 0x1f9b) AM_READ_PORT("DSW2")
|
||||
|
||||
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, 0x5dff) AM_RAM
|
||||
AM_RANGE(0x5e00, 0x5fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE_GENERIC(paletteram)
|
||||
@ -178,9 +216,9 @@ static ADDRESS_MAP_START( devstors_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x1f97, 0x1f97) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0x1f98, 0x1f98) AM_READ_PORT("DSW3")
|
||||
AM_RANGE(0x1f9b, 0x1f9b) AM_READ_PORT("DSW2")
|
||||
AM_RANGE(0x1fa0, 0x1fbf) AM_READWRITE(K051733_r,K051733_w)
|
||||
AM_RANGE(0x1fa0, 0x1fbf) AM_DEVREADWRITE("k051733", k051733_r, k051733_w)
|
||||
|
||||
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, 0x5dff) AM_RAM
|
||||
AM_RANGE(0x5e00, 0x5fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_be_w) AM_BASE_GENERIC(paletteram)
|
||||
@ -373,6 +411,22 @@ static const k007232_interface k007232_config =
|
||||
volume_callback /* external port callback */
|
||||
};
|
||||
|
||||
static const k052109_interface mainevt_k052109_intf =
|
||||
{
|
||||
"gfx1", 0,
|
||||
NORMAL_PLANE_ORDER,
|
||||
KONAMI_ROM_DEINTERLEAVE_2,
|
||||
mainevt_tile_callback
|
||||
};
|
||||
|
||||
static const k051960_interface mainevt_k051960_intf =
|
||||
{
|
||||
"gfx2", 1,
|
||||
NORMAL_PLANE_ORDER,
|
||||
KONAMI_ROM_DEINTERLEAVE_2,
|
||||
mainevt_sprite_callback
|
||||
};
|
||||
|
||||
static MACHINE_DRIVER_START( mainevt )
|
||||
|
||||
/* basic machine hardware */
|
||||
@ -399,6 +453,9 @@ static MACHINE_DRIVER_START( mainevt )
|
||||
MDRV_VIDEO_START(mainevt)
|
||||
MDRV_VIDEO_UPDATE(mainevt)
|
||||
|
||||
MDRV_K052109_ADD("k052109", mainevt_k052109_intf)
|
||||
MDRV_K051960_ADD("k051960", mainevt_k051960_intf)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
@ -412,6 +469,22 @@ static MACHINE_DRIVER_START( mainevt )
|
||||
MACHINE_DRIVER_END
|
||||
|
||||
|
||||
static const k052109_interface dv_k052109_intf =
|
||||
{
|
||||
"gfx1", 0,
|
||||
NORMAL_PLANE_ORDER,
|
||||
KONAMI_ROM_DEINTERLEAVE_2,
|
||||
dv_tile_callback
|
||||
};
|
||||
|
||||
static const k051960_interface dv_k051960_intf =
|
||||
{
|
||||
"gfx2", 1,
|
||||
NORMAL_PLANE_ORDER,
|
||||
KONAMI_ROM_DEINTERLEAVE_2,
|
||||
dv_sprite_callback
|
||||
};
|
||||
|
||||
static MACHINE_DRIVER_START( devstors )
|
||||
|
||||
/* basic machine hardware */
|
||||
@ -438,6 +511,10 @@ static MACHINE_DRIVER_START( devstors )
|
||||
MDRV_VIDEO_START(dv)
|
||||
MDRV_VIDEO_UPDATE(dv)
|
||||
|
||||
MDRV_K052109_ADD("k052109", dv_k052109_intf)
|
||||
MDRV_K051960_ADD("k051960", dv_k051960_intf)
|
||||
MDRV_K051733_ADD("k051733")
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
@ -684,19 +761,11 @@ ROM_END
|
||||
|
||||
|
||||
|
||||
static DRIVER_INIT( mainevt )
|
||||
{
|
||||
konami_rom_deinterleave_2(machine, "gfx1");
|
||||
konami_rom_deinterleave_2(machine, "gfx2");
|
||||
}
|
||||
|
||||
|
||||
|
||||
GAME( 1988, mainevt, 0, mainevt, mainevt, mainevt, ROT0, "Konami", "The Main Event (4 Players ver. Y)", 0 )
|
||||
GAME( 1988, mainevto, mainevt, mainevt, mainevt, mainevt, ROT0, "Konami", "The Main Event (4 Players ver. F)", 0 )
|
||||
GAME( 1988, mainevt2p,mainevt, mainevt, mainev2p, mainevt, ROT0, "Konami", "The Main Event (2 Players ver. X)", 0 )
|
||||
GAME( 1988, ringohja, mainevt, mainevt, mainev2p, mainevt, ROT0, "Konami", "Ring no Ohja (Japan 2 Players ver. N)", 0 )
|
||||
GAME( 1988, devstors, 0, devstors, devstors, mainevt, ROT90, "Konami", "Devastators (ver. Z)", 0 )
|
||||
GAME( 1988, devstors2,devstors, devstors, devstor2, mainevt, ROT90, "Konami", "Devastators (ver. X)", 0 )
|
||||
GAME( 1988, devstors3,devstors, devstors, devstors, mainevt, ROT90, "Konami", "Devastators (ver. V)", 0 )
|
||||
GAME( 1988, garuka, devstors, devstors, devstor2, mainevt, ROT90, "Konami", "Garuka (Japan ver. W)", 0 )
|
||||
GAME( 1988, mainevt, 0, mainevt, mainevt, 0, ROT0, "Konami", "The Main Event (4 Players ver. Y)", 0 )
|
||||
GAME( 1988, mainevto, mainevt, mainevt, mainevt, 0, ROT0, "Konami", "The Main Event (4 Players ver. F)", 0 )
|
||||
GAME( 1988, mainevt2p,mainevt, mainevt, mainev2p, 0, ROT0, "Konami", "The Main Event (2 Players ver. X)", 0 )
|
||||
GAME( 1988, ringohja, mainevt, mainevt, mainev2p, 0, ROT0, "Konami", "Ring no Ohja (Japan 2 Players ver. N)", 0 )
|
||||
GAME( 1988, devstors, 0, devstors, devstors, 0, ROT90, "Konami", "Devastators (ver. Z)", 0 )
|
||||
GAME( 1988, devstors2,devstors, devstors, devstor2, 0, ROT90, "Konami", "Devastators (ver. X)", 0 )
|
||||
GAME( 1988, devstors3,devstors, devstors, devstors, 0, ROT90, "Konami", "Devastators (ver. V)", 0 )
|
||||
GAME( 1988, garuka, devstors, devstors, devstor2, 0, ROT90, "Konami", "Garuka (Japan ver. W)", 0 )
|
||||
|
@ -1,12 +1,12 @@
|
||||
#include "driver.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
|
||||
|
||||
static int AVAC_bits[4], AVAC_occupancy[4];
|
||||
static int layer_colorbase[4], layer_pri[4];
|
||||
static int AVAC_vrc, sprite_colorbase;
|
||||
|
||||
static void gijoe_sprite_callback(int *code, int *color, int *priority_mask)
|
||||
void gijoe_sprite_callback(running_machine *machine, int *code, int *color, int *priority_mask)
|
||||
{
|
||||
int pri, c = *color;
|
||||
|
||||
@ -21,7 +21,7 @@ static void gijoe_sprite_callback(int *code, int *color, int *priority_mask)
|
||||
*color = sprite_colorbase | (c & 0x001f);
|
||||
}
|
||||
|
||||
static void gijoe_tile_callback(int layer, int *code, int *color, int *flags)
|
||||
void gijoe_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags)
|
||||
{
|
||||
int tile = *code;
|
||||
|
||||
@ -39,16 +39,14 @@ static void gijoe_tile_callback(int layer, int *code, int *color, int *flags)
|
||||
|
||||
VIDEO_START( gijoe )
|
||||
{
|
||||
const device_config *k056832 = devtag_get_device(machine, "k056832");
|
||||
int i;
|
||||
|
||||
K053251_vh_start(machine);
|
||||
K056832_vh_start(machine, "gfx1", K056832_BPP_4, 1, NULL, gijoe_tile_callback, 0);
|
||||
k056832_linemap_enable(k056832, 1);
|
||||
|
||||
K056832_linemap_enable(1);
|
||||
for (i = 0; i < 4; i++)
|
||||
AVAC_occupancy[i] = 0;
|
||||
|
||||
K053247_vh_start(machine, "gfx2", -37, 20, NORMAL_PLANE_ORDER, gijoe_sprite_callback);
|
||||
|
||||
for (i=0; i<4; i++) AVAC_occupancy[i] = 0;
|
||||
AVAC_vrc = 0xffff;
|
||||
}
|
||||
|
||||
@ -73,17 +71,22 @@ static void sortlayers(int *layer, int *pri)
|
||||
|
||||
VIDEO_UPDATE( gijoe )
|
||||
{
|
||||
const device_config *k056832 = devtag_get_device(screen->machine, "k056832");
|
||||
const device_config *k053251 = devtag_get_device(screen->machine, "k053251");
|
||||
const device_config *k053246 = devtag_get_device(screen->machine, "k053246");
|
||||
static const int K053251_CI[4] = { K053251_CI1, K053251_CI2, K053251_CI3, K053251_CI4 };
|
||||
int layer[4];
|
||||
int vrc_mode, vrc_new, colorbase_new, primode, dirty, i;
|
||||
int mask = 0;
|
||||
|
||||
// update tile offsets
|
||||
K056832_read_AVAC(&vrc_mode, &vrc_new);
|
||||
k056832_read_avac(k056832, &vrc_mode, &vrc_new);
|
||||
|
||||
if (vrc_mode)
|
||||
{
|
||||
for (dirty=0xf000; dirty; dirty>>=4) if ((AVAC_vrc & dirty) != (vrc_new & dirty)) mask |= dirty;
|
||||
for (dirty = 0xf000; dirty; dirty >>= 4)
|
||||
if ((AVAC_vrc & dirty) != (vrc_new & dirty))
|
||||
mask |= dirty;
|
||||
|
||||
AVAC_vrc = vrc_new;
|
||||
AVAC_bits[0] = vrc_new<<4 & 0xf000;
|
||||
@ -95,17 +98,26 @@ VIDEO_UPDATE( gijoe )
|
||||
AVAC_bits[3] = AVAC_bits[2] = AVAC_bits[1] = AVAC_bits[0] = 0xf000;
|
||||
|
||||
// update color info and refresh tilemaps
|
||||
sprite_colorbase = K053251_get_palette_index(K053251_CI0);
|
||||
sprite_colorbase = k053251_get_palette_index(k053251, K053251_CI0);
|
||||
|
||||
for (i=0; i<4; i++)
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
dirty = 0;
|
||||
|
||||
colorbase_new = K053251_get_palette_index(K053251_CI[i]);
|
||||
if (layer_colorbase[i] != colorbase_new) { layer_colorbase[i] = colorbase_new; dirty = 1; }
|
||||
if (AVAC_occupancy[i] & mask) dirty = 1;
|
||||
colorbase_new = k053251_get_palette_index(k053251, K053251_CI[i]);
|
||||
if (layer_colorbase[i] != colorbase_new)
|
||||
{
|
||||
layer_colorbase[i] = colorbase_new;
|
||||
dirty = 1;
|
||||
}
|
||||
if (AVAC_occupancy[i] & mask)
|
||||
dirty = 1;
|
||||
|
||||
if (dirty) { AVAC_occupancy[i] = 0; K056832_mark_plane_dirty(i); }
|
||||
if (dirty)
|
||||
{
|
||||
AVAC_occupancy[i] = 0;
|
||||
k056832_mark_plane_dirty(k056832, i);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -114,43 +126,43 @@ VIDEO_UPDATE( gijoe )
|
||||
written to the layer's X-scroll register otherwise the chip expects totally
|
||||
different alignment values.
|
||||
*/
|
||||
if (K056832_read_register(0x14) == 2)
|
||||
if (k056832_read_register(k056832, 0x14) == 2)
|
||||
{
|
||||
K056832_set_LayerOffset(0, 2, 0);
|
||||
K056832_set_LayerOffset(1, 4, 0);
|
||||
K056832_set_LayerOffset(2, 6, 0); // 7?
|
||||
K056832_set_LayerOffset(3, 8, 0);
|
||||
k056832_set_layer_offs(k056832, 0, 2, 0);
|
||||
k056832_set_layer_offs(k056832, 1, 4, 0);
|
||||
k056832_set_layer_offs(k056832, 2, 6, 0); // 7?
|
||||
k056832_set_layer_offs(k056832, 3, 8, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
K056832_set_LayerOffset(0, 0, 0);
|
||||
K056832_set_LayerOffset(1, 8, 0);
|
||||
K056832_set_LayerOffset(2, 14, 0);
|
||||
K056832_set_LayerOffset(3, 16, 0); // smaller?
|
||||
k056832_set_layer_offs(k056832, 0, 0, 0);
|
||||
k056832_set_layer_offs(k056832, 1, 8, 0);
|
||||
k056832_set_layer_offs(k056832, 2, 14, 0);
|
||||
k056832_set_layer_offs(k056832, 3, 16, 0); // smaller?
|
||||
}
|
||||
|
||||
// seems to switch the K053251 between different priority modes, detail unknown
|
||||
primode = K053251_get_priority(K053251_CI1);
|
||||
primode = k053251_get_priority(k053251, K053251_CI1);
|
||||
|
||||
layer[0] = 0;
|
||||
layer_pri[0] = 0; // not sure
|
||||
layer[1] = 1;
|
||||
layer_pri[1] = K053251_get_priority(K053251_CI2);
|
||||
layer_pri[1] = k053251_get_priority(k053251, K053251_CI2);
|
||||
layer[2] = 2;
|
||||
layer_pri[2] = K053251_get_priority(K053251_CI3);
|
||||
layer_pri[2] = k053251_get_priority(k053251, K053251_CI3);
|
||||
layer[3] = 3;
|
||||
layer_pri[3] = K053251_get_priority(K053251_CI4);
|
||||
layer_pri[3] = k053251_get_priority(k053251, K053251_CI4);
|
||||
|
||||
sortlayers(layer, layer_pri);
|
||||
|
||||
bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
|
||||
bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
|
||||
|
||||
K056832_tilemap_draw(screen->machine, bitmap,cliprect, layer[0], 0, 1);
|
||||
K056832_tilemap_draw(screen->machine, bitmap,cliprect, layer[1], 0, 2);
|
||||
K056832_tilemap_draw(screen->machine, bitmap,cliprect, layer[2], 0, 4);
|
||||
K056832_tilemap_draw(screen->machine, bitmap,cliprect, layer[3], 0, 8);
|
||||
k056832_tilemap_draw(k056832, bitmap,cliprect, layer[0], 0, 1);
|
||||
k056832_tilemap_draw(k056832, bitmap,cliprect, layer[1], 0, 2);
|
||||
k056832_tilemap_draw(k056832, bitmap,cliprect, layer[2], 0, 4);
|
||||
k056832_tilemap_draw(k056832, bitmap,cliprect, layer[3], 0, 8);
|
||||
|
||||
K053247_sprites_draw(screen->machine, bitmap, cliprect);
|
||||
k053247_sprites_draw(k053246, bitmap, cliprect);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "driver.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
|
||||
|
||||
#define TOTAL_CHARS 0x1000
|
||||
@ -17,7 +17,7 @@ static int layer_colorbase[3],sprite_colorbase;
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
static void gradius3_tile_callback(int layer,int bank,int *code,int *color,int *flags,int *priority)
|
||||
void gradius3_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority)
|
||||
{
|
||||
/* (color & 0x02) is flip y handled internally by the 052109 */
|
||||
*code |= ((*color & 0x01) << 8) | ((*color & 0x1c) << 7);
|
||||
@ -32,7 +32,7 @@ static void gradius3_tile_callback(int layer,int bank,int *code,int *color,int *
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
static void gradius3_sprite_callback(int *code,int *color,int *priority_mask,int *shadow)
|
||||
void gradius3_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask,int *shadow)
|
||||
{
|
||||
#define L0 0xaa
|
||||
#define L1 0xcc
|
||||
@ -60,21 +60,21 @@ static void gradius3_sprite_callback(int *code,int *color,int *priority_mask,int
|
||||
|
||||
VIDEO_START( gradius3 )
|
||||
{
|
||||
const device_config *k052109 = devtag_get_device(machine, "k052109");
|
||||
const device_config *k051960 = devtag_get_device(machine, "k051960");
|
||||
int i;
|
||||
|
||||
layer_colorbase[0] = 0;
|
||||
layer_colorbase[1] = 32;
|
||||
layer_colorbase[2] = 48;
|
||||
sprite_colorbase = 16;
|
||||
K052109_vh_start(machine,"gfx1",GRADIUS3_PLANE_ORDER,gradius3_tile_callback);
|
||||
K051960_vh_start(machine,"gfx2",GRADIUS3_PLANE_ORDER,gradius3_sprite_callback);
|
||||
|
||||
K052109_set_layer_offsets(2, -2, 0);
|
||||
K051960_set_sprite_offsets(2, 0);
|
||||
k052109_set_layer_offsets(k052109, 2, -2, 0);
|
||||
k051960_set_sprite_offsets(k051960, 2, 0);
|
||||
|
||||
/* re-decode the sprites because the ROMs are connected to the custom IC differently
|
||||
from how they are connected to the CPU. */
|
||||
for (i = 0;i < TOTAL_SPRITES;i++)
|
||||
for (i = 0; i < TOTAL_SPRITES; i++)
|
||||
gfx_element_mark_dirty(machine->gfx[1],i);
|
||||
|
||||
gfx_element_set_source(machine->gfx[0], (UINT8 *)gradius3_gfxram);
|
||||
@ -113,28 +113,29 @@ WRITE16_HANDLER( gradius3_gfxram_w )
|
||||
|
||||
VIDEO_UPDATE( gradius3 )
|
||||
{
|
||||
const address_space *space = cputag_get_address_space(screen->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
||||
const device_config *k052109 = devtag_get_device(screen->machine, "k052109");
|
||||
const device_config *k051960 = devtag_get_device(screen->machine, "k051960");
|
||||
|
||||
/* TODO: this kludge enforces the char banks. For some reason, they don't work otherwise. */
|
||||
K052109_w(space,0x1d80,0x10);
|
||||
K052109_w(space,0x1f00,0x32);
|
||||
k052109_w(k052109, 0x1d80, 0x10);
|
||||
k052109_w(k052109, 0x1f00, 0x32);
|
||||
|
||||
K052109_tilemap_update();
|
||||
k052109_tilemap_update(k052109);
|
||||
|
||||
bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
|
||||
if (gradius3_priority == 0)
|
||||
{
|
||||
tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_DRAW_OPAQUE,2);
|
||||
tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,4);
|
||||
tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,1);
|
||||
k052109_tilemap_draw(k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 2);
|
||||
k052109_tilemap_draw(k052109, bitmap, cliprect, 2, 0, 4);
|
||||
k052109_tilemap_draw(k052109, bitmap, cliprect, 0, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
tilemap_draw(bitmap,cliprect,K052109_tilemap[0],TILEMAP_DRAW_OPAQUE,1);
|
||||
tilemap_draw(bitmap,cliprect,K052109_tilemap[1],0,2);
|
||||
tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,4);
|
||||
k052109_tilemap_draw(k052109, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 1);
|
||||
k052109_tilemap_draw(k052109, bitmap, cliprect, 1, 0, 2);
|
||||
k052109_tilemap_draw(k052109, bitmap, cliprect, 2, 0, 4);
|
||||
}
|
||||
|
||||
K051960_sprites_draw(screen->machine,bitmap,cliprect,-1,-1);
|
||||
k051960_sprites_draw(k051960, bitmap, cliprect, -1, -1);
|
||||
return 0;
|
||||
}
|
||||
|
@ -2376,6 +2376,12 @@ void k052109_get_tmap( const device_config *device, tilemap **tilemap, int tmap_
|
||||
*tilemap = k052109->tilemap[tmap_num];
|
||||
}
|
||||
|
||||
void k052109_tilemap_mark_dirty( const device_config *device, int tmap_num )
|
||||
{
|
||||
k052109_state *k052109 = k052109_get_safe_token(device);
|
||||
tilemap_mark_all_tiles_dirty(k052109->tilemap[tmap_num]);
|
||||
}
|
||||
|
||||
|
||||
void k052109_tilemap_update( const device_config *device )
|
||||
{
|
||||
@ -4964,6 +4970,8 @@ static DEVICE_START( k055673 )
|
||||
16*16*6
|
||||
};
|
||||
|
||||
k053247->screen = devtag_get_device(device->machine, intf->screen);
|
||||
|
||||
K055673_rom = (UINT16 *)memory_region(machine, intf->gfx_memory_region);
|
||||
|
||||
/* decode the graphics */
|
||||
@ -5680,9 +5688,10 @@ WRITE8_DEVICE_HANDLER( k053251_w )
|
||||
if (k053251->palette_index[i] != newind)
|
||||
{
|
||||
k053251->palette_index[i] = newind;
|
||||
// k053251->dirty_tmap[i] = 1;
|
||||
if (k053251->tmaps[i])
|
||||
tilemap_mark_all_tiles_dirty(k053251->tmaps[i]); }
|
||||
k053251->dirty_tmap[i] = 1;
|
||||
// if (k053251->tmaps[i])
|
||||
// tilemap_mark_all_tiles_dirty(k053251->tmaps[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!k053251->tilemaps_set)
|
||||
@ -5697,9 +5706,10 @@ WRITE8_DEVICE_HANDLER( k053251_w )
|
||||
if (k053251->palette_index[3 + i] != newind)
|
||||
{
|
||||
k053251->palette_index[3 + i] = newind;
|
||||
// k053251->dirty_tmap[3 + i] = 1;
|
||||
if (k053251->tmaps[3 + i])
|
||||
tilemap_mark_all_tiles_dirty(k053251->tmaps[3 + i]); }
|
||||
k053251->dirty_tmap[3 + i] = 1;
|
||||
// if (k053251->tmaps[3 + i])
|
||||
// tilemap_mark_all_tiles_dirty(k053251->tmaps[3 + i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!k053251->tilemaps_set)
|
||||
|
@ -369,6 +369,7 @@ void k052109_set_layer_offsets(const device_config *device, int layer, int dx, i
|
||||
// WIP code while trying to convert/cleanup glfgreat
|
||||
void k052109_get_tmap(const device_config *device, tilemap **tilemap, int tmap_num);
|
||||
tilemap *k052109_get_tilemap(const device_config *device, int tmap_num);
|
||||
void k052109_tilemap_mark_dirty(const device_config *device, int tmap_num);
|
||||
|
||||
void k052109_tilemap_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int tmap_num, UINT32 flags, UINT8 priority);
|
||||
void k052109_postload_tileflip_reset( const device_config *device ); // this has to be added to POSTLOAD functions in each driver
|
||||
|
@ -7,7 +7,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "driver.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
|
||||
|
||||
static int layer_colorbase[3],sprite_colorbase;
|
||||
@ -20,7 +20,7 @@ static int layer_colorbase[3],sprite_colorbase;
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
static void mainevt_tile_callback(int layer,int bank,int *code,int *color,int *flags,int *priority)
|
||||
void mainevt_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority)
|
||||
{
|
||||
*flags = (*color & 0x02) ? TILE_FLIPX : 0;
|
||||
|
||||
@ -30,7 +30,7 @@ static void mainevt_tile_callback(int layer,int bank,int *code,int *color,int *f
|
||||
*color = layer_colorbase[layer] + ((*color & 0xc0) >> 6);
|
||||
}
|
||||
|
||||
static void dv_tile_callback(int layer,int bank,int *code,int *color,int *flags,int *priority)
|
||||
void dv_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority)
|
||||
{
|
||||
/* (color & 0x02) is flip y handled internally by the 052109 */
|
||||
*code |= ((*color & 0x01) << 8) | ((*color & 0x3c) << 7);
|
||||
@ -44,7 +44,7 @@ static void dv_tile_callback(int layer,int bank,int *code,int *color,int *flags,
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
static void mainevt_sprite_callback(int *code,int *color,int *priority_mask,int *shadow)
|
||||
void mainevt_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask,int *shadow)
|
||||
{
|
||||
/* bit 5 = priority over layer B (has precedence) */
|
||||
/* bit 6 = HALF priority over layer B (used for crowd when you get out of the ring) */
|
||||
@ -56,7 +56,7 @@ static void mainevt_sprite_callback(int *code,int *color,int *priority_mask,int
|
||||
*color = sprite_colorbase + (*color & 0x03);
|
||||
}
|
||||
|
||||
static void dv_sprite_callback(int *code,int *color,int *priority,int *shadow)
|
||||
void dv_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow)
|
||||
{
|
||||
/* TODO: the priority/shadow handling (bits 5-7) seems to be quite complex (see PROM) */
|
||||
*color = sprite_colorbase + (*color & 0x07);
|
||||
@ -71,9 +71,6 @@ VIDEO_START( mainevt )
|
||||
layer_colorbase[1] = 8;
|
||||
layer_colorbase[2] = 4;
|
||||
sprite_colorbase = 12;
|
||||
|
||||
K052109_vh_start(machine,"gfx1",NORMAL_PLANE_ORDER,mainevt_tile_callback);
|
||||
K051960_vh_start(machine,"gfx2",NORMAL_PLANE_ORDER,mainevt_sprite_callback);
|
||||
}
|
||||
|
||||
VIDEO_START( dv )
|
||||
@ -82,34 +79,37 @@ VIDEO_START( dv )
|
||||
layer_colorbase[1] = 0;
|
||||
layer_colorbase[2] = 4;
|
||||
sprite_colorbase = 8;
|
||||
|
||||
K052109_vh_start(machine,"gfx1",NORMAL_PLANE_ORDER,dv_tile_callback);
|
||||
K051960_vh_start(machine,"gfx2",NORMAL_PLANE_ORDER,dv_sprite_callback);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
VIDEO_UPDATE( mainevt )
|
||||
{
|
||||
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);
|
||||
tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_DRAW_OPAQUE,1);
|
||||
tilemap_draw(bitmap,cliprect,K052109_tilemap[2],1,2); /* low priority part of layer */
|
||||
tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,4); /* high priority part of layer */
|
||||
tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,8);
|
||||
k052109_tilemap_draw(k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 1);
|
||||
k052109_tilemap_draw(k052109, bitmap, cliprect, 2, 1, 2); /* low priority part of layer */
|
||||
k052109_tilemap_draw(k052109, bitmap, cliprect, 2, 0, 4); /* high priority part of layer */
|
||||
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;
|
||||
}
|
||||
|
||||
VIDEO_UPDATE( dv )
|
||||
{
|
||||
K052109_tilemap_update();
|
||||
const device_config *k052109 = devtag_get_device(screen->machine, "k052109");
|
||||
const device_config *k051960 = devtag_get_device(screen->machine, "k051960");
|
||||
|
||||
tilemap_draw(bitmap,cliprect,K052109_tilemap[1],TILEMAP_DRAW_OPAQUE,0);
|
||||
tilemap_draw(bitmap,cliprect,K052109_tilemap[2],0,0);
|
||||
K051960_sprites_draw(screen->machine,bitmap,cliprect,0,0);
|
||||
tilemap_draw(bitmap,cliprect,K052109_tilemap[0],0,0);
|
||||
k052109_tilemap_update(k052109);
|
||||
|
||||
k052109_tilemap_draw(k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 0);
|
||||
k052109_tilemap_draw(k052109, bitmap, cliprect, 2, 0, 0);
|
||||
k051960_sprites_draw(k051960, bitmap, cliprect, 0, 0);
|
||||
k052109_tilemap_draw(k052109, bitmap, cliprect, 0, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user