mirror of
https://github.com/holub/mame
synced 2025-05-24 23:05:32 +03:00
Added preliminary device versions of all the Konami custom ICs currently emulated in machine/konamiic.c and video/konamiic.c.
In particular, device-fied Konami 007121, 051733 and 053251 work fine and combatsc.c, contra.c, crshrace.c, f1gp.c, fastlane.c, flkatck.c, hcastle.c, labyrunr.c and suprslam.c have been converted to use the new code. Side notes: * chips which have their own tilemap in MAME (e.g. 056832 and 052109) are not working yet, and other chips cannot be fully tested because they're used together with these... it's still wip * some cleanup is in order (especially for interfaces), once I get the remaining chips to working state * converting the drivers above, I noticed that f1gp2 was only using half of the k053936 regs: this is now fixed and, even if I don't know of any visible improvements, now there are definitely less unmapped writes logged by the debugger ;)
This commit is contained in:
parent
d8e3212c7b
commit
bf07322216
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -3360,6 +3360,8 @@ src/mame/video/kncljoe.c svneol=native#text/plain
|
||||
src/mame/video/konamigx.c svneol=native#text/plain
|
||||
src/mame/video/konamiic.c svneol=native#text/plain
|
||||
src/mame/video/konamiic.h svneol=native#text/plain
|
||||
src/mame/video/konicdev.c svneol=native#text/plain
|
||||
src/mame/video/konicdev.h svneol=native#text/plain
|
||||
src/mame/video/kopunch.c svneol=native#text/plain
|
||||
src/mame/video/ksayakyu.c svneol=native#text/plain
|
||||
src/mame/video/kyugo.c svneol=native#text/plain
|
||||
|
@ -126,6 +126,7 @@ Dip location and recommended settings verified with the US manual
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "sound/2203intf.h"
|
||||
#include "sound/upd7759.h"
|
||||
#include "video/konicdev.h"
|
||||
|
||||
/* from video/combasc.c */
|
||||
PALETTE_INIT( combasc );
|
||||
@ -573,6 +574,9 @@ static MACHINE_DRIVER_START( combasc )
|
||||
MDRV_VIDEO_START(combasc)
|
||||
MDRV_VIDEO_UPDATE(combasc)
|
||||
|
||||
MDRV_K007121_ADD("k007121_1")
|
||||
MDRV_K007121_ADD("k007121_2")
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
|
@ -19,7 +19,8 @@ Dip locations and factory settings verified with manual
|
||||
#include "driver.h"
|
||||
#include "cpu/m6809/m6809.h"
|
||||
#include "sound/2151intf.h"
|
||||
#include "konamipt.h"
|
||||
#include "includes/konamipt.h"
|
||||
#include "video/konicdev.h"
|
||||
|
||||
extern UINT8 *contra_fg_vram,*contra_fg_cram;
|
||||
extern UINT8 *contra_bg_vram,*contra_bg_cram;
|
||||
@ -213,6 +214,9 @@ static MACHINE_DRIVER_START( contra )
|
||||
MDRV_VIDEO_START(contra)
|
||||
MDRV_VIDEO_UPDATE(contra)
|
||||
|
||||
MDRV_K007121_ADD("k007121_1")
|
||||
MDRV_K007121_ADD("k007121_2")
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
@ -246,7 +250,7 @@ ROM_START( contra )
|
||||
ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */
|
||||
|
||||
ROM_REGION( 0x0001, "pals", 0 )
|
||||
ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */
|
||||
ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */
|
||||
ROM_END
|
||||
|
||||
ROM_START( contra1 )
|
||||
@ -273,7 +277,7 @@ ROM_START( contra1 )
|
||||
ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */
|
||||
|
||||
ROM_REGION( 0x0001, "pals", 0 )
|
||||
ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */
|
||||
ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */
|
||||
ROM_END
|
||||
|
||||
ROM_START( contrab )
|
||||
@ -339,7 +343,7 @@ ROM_START( contraj )
|
||||
ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */
|
||||
|
||||
ROM_REGION( 0x0001, "pals", 0 )
|
||||
ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */
|
||||
ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */
|
||||
ROM_END
|
||||
|
||||
ROM_START( contrajb )
|
||||
@ -405,7 +409,7 @@ ROM_START( gryzor )
|
||||
ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */
|
||||
|
||||
ROM_REGION( 0x0001, "pals", 0 )
|
||||
ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */
|
||||
ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */
|
||||
ROM_END
|
||||
|
||||
ROM_START( gryzora )
|
||||
@ -432,7 +436,7 @@ ROM_START( gryzora )
|
||||
ROM_LOAD( "633f11.20g", 0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) ) /* 007121 #1 char lookup table */
|
||||
|
||||
ROM_REGION( 0x0001, "pals", 0 )
|
||||
ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */
|
||||
ROM_LOAD( "007766.20d.bin", 0x0000, 0x0001, NO_DUMP ) /* PAL16L8A-2CN */
|
||||
ROM_END
|
||||
|
||||
|
||||
|
@ -129,9 +129,9 @@ Dip locations verified with Service Mode.
|
||||
#include "driver.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "sound/2610intf.h"
|
||||
#include "crshrace.h"
|
||||
#include "video/konicdev.h"
|
||||
#include "includes/crshrace.h"
|
||||
|
||||
|
||||
#define CRSHRACE_3P_HACK 0
|
||||
@ -206,7 +206,7 @@ static ADDRESS_MAP_START( crshrace_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0xfff008, 0xfff009) AM_WRITE(sound_command_w)
|
||||
AM_RANGE(0xfff00a, 0xfff00b) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0xfff00e, 0xfff00f) AM_READ_PORT("P3")
|
||||
AM_RANGE(0xfff020, 0xfff03f) AM_WRITEONLY AM_BASE(&K053936_0_ctrl)
|
||||
AM_RANGE(0xfff020, 0xfff03f) AM_DEVWRITE("k053936", k053936_ctrl_w)
|
||||
AM_RANGE(0xfff044, 0xfff047) AM_WRITEONLY // ??? moves during race
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -436,6 +436,11 @@ static const ym2610_interface ym2610_config =
|
||||
irqhandler
|
||||
};
|
||||
|
||||
static const k053936_interface crshrace_k053936_intf =
|
||||
{
|
||||
1, -48, -21, /* wrap, xoff, yoff */
|
||||
0 /* linectrl_size */
|
||||
};
|
||||
|
||||
|
||||
static MACHINE_DRIVER_START( crshrace )
|
||||
@ -461,6 +466,8 @@ static MACHINE_DRIVER_START( crshrace )
|
||||
MDRV_GFXDECODE(crshrace)
|
||||
MDRV_PALETTE_LENGTH(2048)
|
||||
|
||||
MDRV_K053936_ADD("k053936", crshrace_k053936_intf)
|
||||
|
||||
MDRV_VIDEO_START(crshrace)
|
||||
MDRV_VIDEO_EOF(crshrace)
|
||||
MDRV_VIDEO_UPDATE(crshrace)
|
||||
|
@ -22,10 +22,10 @@ f1gp2:
|
||||
#include "driver.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "f1gp.h"
|
||||
#include "video/konicdev.h"
|
||||
#include "sound/2610intf.h"
|
||||
#include "sound/okim6295.h"
|
||||
#include "includes/f1gp.h"
|
||||
|
||||
|
||||
static UINT16 *sharedram;
|
||||
@ -115,7 +115,7 @@ static ADDRESS_MAP_START( f1gp_cpu1_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0xfff006, 0xfff007) AM_READ_PORT("DSW2")
|
||||
AM_RANGE(0xfff008, 0xfff009) AM_READ(command_pending_r)
|
||||
AM_RANGE(0xfff008, 0xfff009) AM_WRITE(sound_command_w)
|
||||
AM_RANGE(0xfff040, 0xfff05f) AM_WRITEONLY AM_BASE(&K053936_0_ctrl)
|
||||
AM_RANGE(0xfff040, 0xfff05f) AM_DEVWRITE("k053936", k053936_ctrl_w)
|
||||
AM_RANGE(0xfff050, 0xfff051) AM_READ_PORT("DSW3")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -135,7 +135,7 @@ static ADDRESS_MAP_START( f1gp2_cpu1_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0xfff006, 0xfff007) AM_READ_PORT("DSW2")
|
||||
AM_RANGE(0xfff008, 0xfff009) AM_READWRITE(command_pending_r, sound_command_w)
|
||||
AM_RANGE(0xfff00a, 0xfff00b) AM_READ_PORT("DSW3")
|
||||
AM_RANGE(0xfff020, 0xfff02f) AM_WRITEONLY AM_BASE(&K053936_0_ctrl)
|
||||
AM_RANGE(0xfff020, 0xfff03f) AM_DEVWRITE("k053936", k053936_ctrl_w)
|
||||
AM_RANGE(0xfff044, 0xfff047) AM_WRITE(f1gp_fgscroll_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -420,6 +420,17 @@ static const ym2610_interface ym2610_config =
|
||||
irqhandler
|
||||
};
|
||||
|
||||
static const k053936_interface f1gp_k053936_intf =
|
||||
{
|
||||
1, -58, -2, /* wrap, xoff, yoff */
|
||||
0 /* linectrl_size */
|
||||
};
|
||||
|
||||
static const k053936_interface f1gp2_k053936_intf =
|
||||
{
|
||||
1, -48, -21, /* wrap, xoff, yoff */
|
||||
0 /* linectrl_size */
|
||||
};
|
||||
|
||||
|
||||
static MACHINE_DRIVER_START( f1gp )
|
||||
@ -452,6 +463,8 @@ static MACHINE_DRIVER_START( f1gp )
|
||||
MDRV_VIDEO_START(f1gp)
|
||||
MDRV_VIDEO_UPDATE(f1gp)
|
||||
|
||||
MDRV_K053936_ADD("k053936", f1gp_k053936_intf)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
@ -513,6 +526,9 @@ static MACHINE_DRIVER_START( f1gp2 )
|
||||
MDRV_SCREEN_MODIFY("screen")
|
||||
MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
|
||||
|
||||
MDRV_DEVICE_REMOVE("k053936")
|
||||
MDRV_K053936_ADD("k053936", f1gp2_k053936_intf)
|
||||
|
||||
MDRV_VIDEO_START(f1gp2)
|
||||
MDRV_VIDEO_UPDATE(f1gp2)
|
||||
MACHINE_DRIVER_END
|
||||
|
@ -13,9 +13,9 @@ TODO:
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "cpu/hd6309/hd6309.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "sound/k007232.h"
|
||||
#include "konamipt.h"
|
||||
#include "includes/konamipt.h"
|
||||
#include "video/konicdev.h"
|
||||
|
||||
/* from video/fastlane.c */
|
||||
extern UINT8 *fastlane_k007121_regs,*fastlane_videoram1,*fastlane_videoram2;
|
||||
@ -27,22 +27,25 @@ VIDEO_UPDATE( fastlane );
|
||||
|
||||
static INTERRUPT_GEN( fastlane_interrupt )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(device->machine, "k007121");
|
||||
if (cpu_getiloops(device) == 0)
|
||||
{
|
||||
if (K007121_ctrlram[0][0x07] & 0x02)
|
||||
if (k007121_ctrlram_r(k007121, 7) & 0x02)
|
||||
cpu_set_input_line(device, HD6309_IRQ_LINE, HOLD_LINE);
|
||||
}
|
||||
else if (cpu_getiloops(device) % 2)
|
||||
{
|
||||
if (K007121_ctrlram[0][0x07] & 0x01)
|
||||
if (k007121_ctrlram_r(k007121, 7) & 0x01)
|
||||
cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( k007121_registers_w )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(space->machine, "k007121");
|
||||
|
||||
if (offset < 8)
|
||||
K007121_ctrl_0_w(space,offset,data);
|
||||
k007121_ctrl_w(k007121, offset, data);
|
||||
else /* scroll registers */
|
||||
fastlane_k007121_regs[offset] = data;
|
||||
}
|
||||
@ -92,7 +95,7 @@ static ADDRESS_MAP_START( fastlane_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0c00, 0x0c00) AM_WRITE(fastlane_bankswitch_w) /* bankswitch control */
|
||||
AM_RANGE(0x0d00, 0x0d0d) AM_DEVREADWRITE("konami1", fastlane_k007232_r, fastlane_k007232_w) /* 007232 registers (chip 1) */
|
||||
AM_RANGE(0x0e00, 0x0e0d) AM_DEVREADWRITE("konami2", fastlane_k007232_r, fastlane_k007232_w) /* 007232 registers (chip 2) */
|
||||
AM_RANGE(0x0f00, 0x0f1f) AM_READWRITE(K051733_r, K051733_w) /* 051733 (protection) */
|
||||
AM_RANGE(0x0f00, 0x0f1f) AM_DEVREADWRITE("k051733", k051733_r, k051733_w) /* 051733 (protection) */
|
||||
AM_RANGE(0x1000, 0x17ff) AM_RAM AM_BASE_GENERIC(paletteram) /* Palette RAM */
|
||||
AM_RANGE(0x1800, 0x1fff) AM_RAM /* Work RAM */
|
||||
AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(fastlane_vram1_w) AM_BASE(&fastlane_videoram1) /* Video RAM (chip 1) */
|
||||
@ -225,6 +228,9 @@ static MACHINE_DRIVER_START( fastlane )
|
||||
MDRV_VIDEO_START(fastlane)
|
||||
MDRV_VIDEO_UPDATE(fastlane)
|
||||
|
||||
MDRV_K007121_ADD("k007121")
|
||||
MDRV_K051733_ADD("k051733")
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
|
@ -15,7 +15,8 @@ TO DO:
|
||||
#include "cpu/hd6309/hd6309.h"
|
||||
#include "sound/2151intf.h"
|
||||
#include "sound/k007232.h"
|
||||
#include "konamipt.h"
|
||||
#include "video/konicdev.h"
|
||||
#include "includes/konamipt.h"
|
||||
|
||||
/* from video/flkatck.c */
|
||||
VIDEO_START( flkatck );
|
||||
@ -234,6 +235,8 @@ static MACHINE_DRIVER_START( flkatck )
|
||||
MDRV_VIDEO_START(flkatck)
|
||||
MDRV_VIDEO_UPDATE(flkatck)
|
||||
|
||||
MDRV_K007121_ADD("k007121")
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
|
@ -12,7 +12,8 @@
|
||||
#include "sound/3812intf.h"
|
||||
#include "sound/k007232.h"
|
||||
#include "sound/k051649.h"
|
||||
#include "konamipt.h"
|
||||
#include "video/konicdev.h"
|
||||
#include "includes/konamipt.h"
|
||||
|
||||
PALETTE_INIT( hcastle );
|
||||
VIDEO_UPDATE( hcastle );
|
||||
@ -215,6 +216,9 @@ static MACHINE_DRIVER_START( hcastle )
|
||||
MDRV_VIDEO_START(hcastle)
|
||||
MDRV_VIDEO_UPDATE(hcastle)
|
||||
|
||||
MDRV_K007121_ADD("k007121_1")
|
||||
MDRV_K007121_ADD("k007121_2")
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
|
@ -11,9 +11,9 @@ Driver by Nicola Salmoria
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "cpu/hd6309/hd6309.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "sound/2203intf.h"
|
||||
#include "konamipt.h"
|
||||
#include "video/konicdev.h"
|
||||
#include "includes/konamipt.h"
|
||||
|
||||
/* from video/labyrunr.c */
|
||||
extern UINT8 *labyrunr_videoram1,*labyrunr_videoram2,*labyrunr_scrollram;
|
||||
@ -25,14 +25,16 @@ VIDEO_UPDATE( labyrunr );
|
||||
|
||||
static INTERRUPT_GEN( labyrunr_interrupt )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(device->machine, "k007121");
|
||||
|
||||
if (cpu_getiloops(device) == 0)
|
||||
{
|
||||
if (K007121_ctrlram[0][0x07] & 0x02)
|
||||
if (k007121_ctrlram_r(k007121, 7) & 0x02)
|
||||
cpu_set_input_line(device, HD6309_IRQ_LINE, HOLD_LINE);
|
||||
}
|
||||
else if (cpu_getiloops(device) % 2)
|
||||
{
|
||||
if (K007121_ctrlram[0][0x07] & 0x01)
|
||||
if (k007121_ctrlram_r(k007121, 7) & 0x01)
|
||||
cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
}
|
||||
@ -54,7 +56,7 @@ if (data & 0xe0) popmessage("bankswitch %02x",data);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( labyrunr_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x0007) AM_WRITE(K007121_ctrl_0_w)
|
||||
AM_RANGE(0x0000, 0x0007) AM_DEVWRITE("k007121", k007121_ctrl_w)
|
||||
AM_RANGE(0x0020, 0x005f) AM_RAM AM_BASE(&labyrunr_scrollram)
|
||||
AM_RANGE(0x0800, 0x0800) AM_DEVREADWRITE("ym1", ym2203_read_port_r, ym2203_write_port_w)
|
||||
AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("ym1", ym2203_status_port_r, ym2203_control_port_w)
|
||||
@ -64,7 +66,7 @@ static ADDRESS_MAP_START( labyrunr_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0a01, 0x0a01) AM_READ_PORT("P1")
|
||||
AM_RANGE(0x0b00, 0x0b00) AM_READ_PORT("SYSTEM")
|
||||
AM_RANGE(0x0c00, 0x0c00) AM_WRITE(labyrunr_bankswitch_w)
|
||||
AM_RANGE(0x0d00, 0x0d1f) AM_READWRITE(K051733_r, K051733_w)
|
||||
AM_RANGE(0x0d00, 0x0d1f) AM_DEVREADWRITE("k051733", k051733_r, k051733_w)
|
||||
AM_RANGE(0x0e00, 0x0e00) AM_WRITE(watchdog_reset_w)
|
||||
AM_RANGE(0x1000, 0x10ff) AM_RAM AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0x1800, 0x1fff) AM_RAM
|
||||
@ -213,6 +215,9 @@ static MACHINE_DRIVER_START( labyrunr )
|
||||
MDRV_VIDEO_START(labyrunr)
|
||||
MDRV_VIDEO_UPDATE(labyrunr)
|
||||
|
||||
MDRV_K007121_ADD("k007121")
|
||||
MDRV_K051733_ADD("k051733")
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
|
@ -83,7 +83,7 @@ EB26IC73.BIN 27C240 / Main Program
|
||||
#include "driver.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
#include "sound/2610intf.h"
|
||||
|
||||
|
||||
@ -143,10 +143,10 @@ static ADDRESS_MAP_START( suprslam_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0xfe0000, 0xfe0fff) AM_RAM_WRITE(suprslam_screen_videoram_w) AM_BASE(&suprslam_screen_videoram)
|
||||
AM_RANGE(0xff0000, 0xff1fff) AM_RAM_WRITE(suprslam_bg_videoram_w) AM_BASE(&suprslam_bg_videoram)
|
||||
// AM_RANGE(0xff2000, 0xff203f) AM_RAM /* ?? */
|
||||
AM_RANGE(0xff8000, 0xff8fff) AM_RAM AM_BASE(&K053936_0_linectrl)
|
||||
AM_RANGE(0xff8000, 0xff8fff) AM_DEVREADWRITE("k053936", k053936_linectrl_r, k053936_linectrl_w)
|
||||
AM_RANGE(0xff9000, 0xff9001) AM_WRITE(sound_command_w)
|
||||
AM_RANGE(0xffa000, 0xffafff) AM_RAM_WRITE(paletteram16_xGGGGGBBBBBRRRRR_word_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0xffd000, 0xffd01f) AM_WRITEONLY AM_BASE(&K053936_0_ctrl)
|
||||
AM_RANGE(0xffd000, 0xffd01f) AM_DEVWRITE("k053936", k053936_ctrl_w)
|
||||
AM_RANGE(0xffe000, 0xffe001) AM_WRITE(suprslam_bank_w)
|
||||
AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("P1")
|
||||
AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("P2")
|
||||
@ -297,6 +297,12 @@ static const ym2610_interface ym2610_config =
|
||||
|
||||
/*** MACHINE DRIVER **********************************************************/
|
||||
|
||||
static const k053936_interface suprslam_k053936_intf =
|
||||
{
|
||||
1, -45, -21, /* wrap, xoff, yoff */
|
||||
0x1000 /* linectrl_size */
|
||||
};
|
||||
|
||||
static MACHINE_DRIVER_START( suprslam )
|
||||
MDRV_CPU_ADD("maincpu", M68000, 16000000)
|
||||
MDRV_CPU_PROGRAM_MAP(suprslam_map)
|
||||
@ -322,6 +328,8 @@ static MACHINE_DRIVER_START( suprslam )
|
||||
MDRV_VIDEO_START(suprslam)
|
||||
MDRV_VIDEO_UPDATE(suprslam)
|
||||
|
||||
MDRV_K053936_ADD("k053936", suprslam_k053936_intf)
|
||||
|
||||
MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
|
||||
MDRV_SOUND_ADD("ymsnd", YM2610, 8000000)
|
||||
|
@ -844,7 +844,7 @@ $(MAMEOBJ)/konami.a: \
|
||||
$(DRIVERS)/xmen.o $(VIDEO)/xmen.o \
|
||||
$(DRIVERS)/yiear.o $(VIDEO)/yiear.o \
|
||||
$(DRIVERS)/zr107.o \
|
||||
$(MACHINE)/konamiic.o $(VIDEO)/konamiic.o \
|
||||
$(MACHINE)/konamiic.o $(VIDEO)/konamiic.o $(VIDEO)/konicdev.o \
|
||||
|
||||
$(MAMEOBJ)/maygay.a: \
|
||||
$(DRIVERS)/maygay1b.o \
|
||||
|
@ -7,7 +7,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "driver.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
|
||||
static tilemap *bg_tilemap[2];
|
||||
static tilemap *textlayer;
|
||||
@ -127,6 +127,8 @@ static void set_pens(running_machine *machine)
|
||||
|
||||
static TILE_GET_INFO( get_tile_info0 )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(machine, "k007121_1");
|
||||
UINT8 ctrl_6 = k007121_ctrlram_r(k007121, 6);
|
||||
UINT8 attributes = combasc_page[0][tile_index];
|
||||
int bank = 4*((combasc_vreg & 0x0f) - 1);
|
||||
int number,color;
|
||||
@ -138,7 +140,7 @@ static TILE_GET_INFO( get_tile_info0 )
|
||||
if (attributes & 0x10) bank += 2;
|
||||
if (attributes & 0x20) bank += 4;
|
||||
|
||||
color = ((K007121_ctrlram[0][6]&0x10)*2+16) + (attributes & 0x0f);
|
||||
color = ((ctrl_6 & 0x10) * 2 + 16) + (attributes & 0x0f);
|
||||
|
||||
number = combasc_page[0][tile_index + 0x400] + 256*bank;
|
||||
|
||||
@ -152,6 +154,8 @@ static TILE_GET_INFO( get_tile_info0 )
|
||||
|
||||
static TILE_GET_INFO( get_tile_info1 )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(machine, "k007121_2");
|
||||
UINT8 ctrl_6 = k007121_ctrlram_r(k007121, 6);
|
||||
UINT8 attributes = combasc_page[1][tile_index];
|
||||
int bank = 4*((combasc_vreg >> 4) - 1);
|
||||
int number, color;
|
||||
@ -163,7 +167,7 @@ static TILE_GET_INFO( get_tile_info1 )
|
||||
if (attributes & 0x10) bank += 2;
|
||||
if (attributes & 0x20) bank += 4;
|
||||
|
||||
color = ((K007121_ctrlram[1][6]&0x10)*2+16+4*16) + (attributes & 0x0f);
|
||||
color = ((ctrl_6 & 0x10) * 2 + 16 + 4 * 16) + (attributes & 0x0f);
|
||||
|
||||
number = combasc_page[1][tile_index + 0x400] + 256*bank;
|
||||
|
||||
@ -444,7 +448,9 @@ MACHINE_RESET( combasc )
|
||||
|
||||
WRITE8_HANDLER( combasc_pf_control_w )
|
||||
{
|
||||
K007121_ctrl_w(space->machine,combasc_video_circuit,offset,data);
|
||||
const char *chiptag = combasc_video_circuit ? "k007121_2" : "k007121_1";
|
||||
const device_config *k007121 = devtag_get_device(space->machine, chiptag);
|
||||
k007121_ctrl_w(k007121, offset, data);
|
||||
|
||||
if (offset == 7)
|
||||
tilemap_set_flip(bg_tilemap[combasc_video_circuit],(data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
|
||||
@ -478,19 +484,23 @@ WRITE8_HANDLER( combasc_scrollram_w )
|
||||
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *source,int circuit,UINT32 pri_mask)
|
||||
{
|
||||
int base_color = (circuit*4)*16+(K007121_ctrlram[circuit][6]&0x10)*2;
|
||||
const char *chiptag = circuit ? "k007121_2" : "k007121_1";
|
||||
const device_config *k007121 = devtag_get_device(machine, chiptag);
|
||||
int base_color = (circuit * 4) * 16 + (k007121_ctrlram_r(k007121, 6) & 0x10) * 2;
|
||||
|
||||
K007121_sprites_draw(circuit,bitmap,cliprect,machine->gfx,machine->colortable,source,base_color,0,0,pri_mask);
|
||||
k007121_sprites_draw(k007121, bitmap, cliprect, machine->gfx[circuit], machine->colortable, source, base_color, 0, 0, pri_mask);
|
||||
}
|
||||
|
||||
|
||||
VIDEO_UPDATE( combasc )
|
||||
{
|
||||
const device_config *k007121_1 = devtag_get_device(screen->machine, "k007121_1");
|
||||
const device_config *k007121_2 = devtag_get_device(screen->machine, "k007121_2");
|
||||
int i;
|
||||
|
||||
set_pens(screen->machine);
|
||||
|
||||
if (K007121_ctrlram[0][0x01] & 0x02)
|
||||
if (k007121_ctrlram_r(k007121_1, 1) & 0x02)
|
||||
{
|
||||
tilemap_set_scroll_rows(bg_tilemap[0],32);
|
||||
for (i = 0;i < 32;i++)
|
||||
@ -499,10 +509,10 @@ VIDEO_UPDATE( combasc )
|
||||
else
|
||||
{
|
||||
tilemap_set_scroll_rows(bg_tilemap[0],1);
|
||||
tilemap_set_scrollx(bg_tilemap[0],0,K007121_ctrlram[0][0x00] | ((K007121_ctrlram[0][0x01] & 0x01) << 8));
|
||||
tilemap_set_scrollx(bg_tilemap[0],0,k007121_ctrlram_r(k007121_1, 0) | ((k007121_ctrlram_r(k007121_1, 1) & 0x01) << 8));
|
||||
}
|
||||
|
||||
if (K007121_ctrlram[1][0x01] & 0x02)
|
||||
if (k007121_ctrlram_r(k007121_2, 1) & 0x02)
|
||||
{
|
||||
tilemap_set_scroll_rows(bg_tilemap[1],32);
|
||||
for (i = 0;i < 32;i++)
|
||||
@ -511,11 +521,11 @@ VIDEO_UPDATE( combasc )
|
||||
else
|
||||
{
|
||||
tilemap_set_scroll_rows(bg_tilemap[1],1);
|
||||
tilemap_set_scrollx(bg_tilemap[1],0,K007121_ctrlram[1][0x00] | ((K007121_ctrlram[1][0x01] & 0x01) << 8));
|
||||
tilemap_set_scrollx(bg_tilemap[1],0,k007121_ctrlram_r(k007121_2, 0) | ((k007121_ctrlram_r(k007121_2, 1) & 0x01) << 8));
|
||||
}
|
||||
|
||||
tilemap_set_scrolly(bg_tilemap[0],0,K007121_ctrlram[0][0x02]);
|
||||
tilemap_set_scrolly(bg_tilemap[1],0,K007121_ctrlram[1][0x02]);
|
||||
tilemap_set_scrolly(bg_tilemap[0],0,k007121_ctrlram_r(k007121_1, 2));
|
||||
tilemap_set_scrolly(bg_tilemap[1],0,k007121_ctrlram_r(k007121_2, 2));
|
||||
|
||||
bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
|
||||
|
||||
@ -542,7 +552,7 @@ VIDEO_UPDATE( combasc )
|
||||
draw_sprites(screen->machine,bitmap,cliprect,private_spriteram[0],0,0x4444);
|
||||
}
|
||||
|
||||
if (K007121_ctrlram[0][0x01] & 0x08)
|
||||
if (k007121_ctrlram_r(k007121_1, 1) & 0x08)
|
||||
{
|
||||
for (i = 0;i < 32;i++)
|
||||
{
|
||||
@ -552,7 +562,7 @@ VIDEO_UPDATE( combasc )
|
||||
}
|
||||
|
||||
/* chop the extreme columns if necessary */
|
||||
if (K007121_ctrlram[0][0x03] & 0x40)
|
||||
if (k007121_ctrlram_r(k007121_1, 3) & 0x40)
|
||||
{
|
||||
rectangle clip;
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "driver.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
|
||||
//static int spriteram_offset;
|
||||
static UINT8 *private_spriteram_2,*private_spriteram;
|
||||
@ -84,68 +84,83 @@ static void set_pens(running_machine *machine)
|
||||
|
||||
static TILE_GET_INFO( get_fg_tile_info )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(machine, "k007121_1");
|
||||
UINT8 ctrl_3 = k007121_ctrlram_r(k007121, 3);
|
||||
UINT8 ctrl_4 = k007121_ctrlram_r(k007121, 4);
|
||||
UINT8 ctrl_5 = k007121_ctrlram_r(k007121, 5);
|
||||
UINT8 ctrl_6 = k007121_ctrlram_r(k007121, 6);
|
||||
int attr = contra_fg_cram[tile_index];
|
||||
int bit0 = (K007121_ctrlram[0][0x05] >> 0) & 0x03;
|
||||
int bit1 = (K007121_ctrlram[0][0x05] >> 2) & 0x03;
|
||||
int bit2 = (K007121_ctrlram[0][0x05] >> 4) & 0x03;
|
||||
int bit3 = (K007121_ctrlram[0][0x05] >> 6) & 0x03;
|
||||
int bit0 = (ctrl_5 >> 0) & 0x03;
|
||||
int bit1 = (ctrl_5 >> 2) & 0x03;
|
||||
int bit2 = (ctrl_5 >> 4) & 0x03;
|
||||
int bit3 = (ctrl_5 >> 6) & 0x03;
|
||||
int bank = ((attr & 0x80) >> 7) |
|
||||
((attr >> (bit0+2)) & 0x02) |
|
||||
((attr >> (bit1+1)) & 0x04) |
|
||||
((attr >> (bit2 )) & 0x08) |
|
||||
((attr >> (bit3-1)) & 0x10) |
|
||||
((K007121_ctrlram[0][0x03] & 0x01) << 5);
|
||||
int mask = (K007121_ctrlram[0][0x04] & 0xf0) >> 4;
|
||||
((attr >> (bit0 + 2)) & 0x02) |
|
||||
((attr >> (bit1 + 1)) & 0x04) |
|
||||
((attr >> (bit2 )) & 0x08) |
|
||||
((attr >> (bit3 - 1)) & 0x10) |
|
||||
((ctrl_3 & 0x01) << 5);
|
||||
int mask = (ctrl_4 & 0xf0) >> 4;
|
||||
|
||||
bank = (bank & ~(mask << 1)) | ((K007121_ctrlram[0][0x04] & mask) << 1);
|
||||
bank = (bank & ~(mask << 1)) | ((ctrl_4 & mask) << 1);
|
||||
|
||||
SET_TILE_INFO(
|
||||
0,
|
||||
contra_fg_vram[tile_index]+bank*256,
|
||||
((K007121_ctrlram[0][6]&0x30)*2+16)+(attr&7),
|
||||
contra_fg_vram[tile_index] + bank * 256,
|
||||
((ctrl_6 & 0x30) * 2 + 16) + (attr & 7),
|
||||
0);
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( get_bg_tile_info )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(machine, "k007121_2");
|
||||
UINT8 ctrl_3 = k007121_ctrlram_r(k007121, 3);
|
||||
UINT8 ctrl_4 = k007121_ctrlram_r(k007121, 4);
|
||||
UINT8 ctrl_5 = k007121_ctrlram_r(k007121, 5);
|
||||
UINT8 ctrl_6 = k007121_ctrlram_r(k007121, 6);
|
||||
int attr = contra_bg_cram[tile_index];
|
||||
int bit0 = (K007121_ctrlram[1][0x05] >> 0) & 0x03;
|
||||
int bit1 = (K007121_ctrlram[1][0x05] >> 2) & 0x03;
|
||||
int bit2 = (K007121_ctrlram[1][0x05] >> 4) & 0x03;
|
||||
int bit3 = (K007121_ctrlram[1][0x05] >> 6) & 0x03;
|
||||
int bit0 = (ctrl_5 >> 0) & 0x03;
|
||||
int bit1 = (ctrl_5 >> 2) & 0x03;
|
||||
int bit2 = (ctrl_5 >> 4) & 0x03;
|
||||
int bit3 = (ctrl_5 >> 6) & 0x03;
|
||||
int bank = ((attr & 0x80) >> 7) |
|
||||
((attr >> (bit0+2)) & 0x02) |
|
||||
((attr >> (bit1+1)) & 0x04) |
|
||||
((attr >> (bit2 )) & 0x08) |
|
||||
((attr >> (bit3-1)) & 0x10) |
|
||||
((K007121_ctrlram[1][0x03] & 0x01) << 5);
|
||||
int mask = (K007121_ctrlram[1][0x04] & 0xf0) >> 4;
|
||||
((attr >> (bit0 + 2)) & 0x02) |
|
||||
((attr >> (bit1 + 1)) & 0x04) |
|
||||
((attr >> (bit2 )) & 0x08) |
|
||||
((attr >> (bit3 - 1)) & 0x10) |
|
||||
((ctrl_3 & 0x01) << 5);
|
||||
int mask = (ctrl_4 & 0xf0) >> 4;
|
||||
|
||||
bank = (bank & ~(mask << 1)) | ((K007121_ctrlram[0][0x04] & mask) << 1);
|
||||
// 2009-12 FP: TO BE VERIFIED - old code used ctrl4 from chip 0?!?
|
||||
bank = (bank & ~(mask << 1)) | ((ctrl_4 & mask) << 1);
|
||||
|
||||
SET_TILE_INFO(
|
||||
1,
|
||||
contra_bg_vram[tile_index]+bank*256,
|
||||
((K007121_ctrlram[1][6]&0x30)*2+16)+(attr&7),
|
||||
contra_bg_vram[tile_index] + bank * 256,
|
||||
((ctrl_6 & 0x30) * 2 + 16) + (attr & 7),
|
||||
0);
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( get_tx_tile_info )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(machine, "k007121_1");
|
||||
UINT8 ctrl_5 = k007121_ctrlram_r(k007121, 5);
|
||||
UINT8 ctrl_6 = k007121_ctrlram_r(k007121, 6);
|
||||
int attr = contra_text_cram[tile_index];
|
||||
int bit0 = (K007121_ctrlram[0][0x05] >> 0) & 0x03;
|
||||
int bit1 = (K007121_ctrlram[0][0x05] >> 2) & 0x03;
|
||||
int bit2 = (K007121_ctrlram[0][0x05] >> 4) & 0x03;
|
||||
int bit3 = (K007121_ctrlram[0][0x05] >> 6) & 0x03;
|
||||
int bit0 = (ctrl_5 >> 0) & 0x03;
|
||||
int bit1 = (ctrl_5 >> 2) & 0x03;
|
||||
int bit2 = (ctrl_5 >> 4) & 0x03;
|
||||
int bit3 = (ctrl_5 >> 6) & 0x03;
|
||||
int bank = ((attr & 0x80) >> 7) |
|
||||
((attr >> (bit0+2)) & 0x02) |
|
||||
((attr >> (bit1+1)) & 0x04) |
|
||||
((attr >> (bit2 )) & 0x08) |
|
||||
((attr >> (bit3-1)) & 0x10);
|
||||
((attr >> (bit0 + 2)) & 0x02) |
|
||||
((attr >> (bit1 + 1)) & 0x04) |
|
||||
((attr >> (bit2 )) & 0x08) |
|
||||
((attr >> (bit3 - 1)) & 0x10);
|
||||
|
||||
SET_TILE_INFO(
|
||||
0,
|
||||
contra_text_vram[tile_index]+bank*256,
|
||||
((K007121_ctrlram[0][6]&0x30)*2+16)+(attr&7),
|
||||
contra_text_vram[tile_index] + bank * 256,
|
||||
((ctrl_6 & 0x30) * 2 + 16) + (attr & 7),
|
||||
0);
|
||||
}
|
||||
|
||||
@ -221,42 +236,48 @@ WRITE8_HANDLER( contra_text_cram_w )
|
||||
|
||||
WRITE8_HANDLER( contra_K007121_ctrl_0_w )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(space->machine, "k007121_1");
|
||||
UINT8 ctrl_6 = k007121_ctrlram_r(k007121, 6);
|
||||
|
||||
if (offset == 3)
|
||||
{
|
||||
if ((data&0x8)==0)
|
||||
if ((data & 0x8) == 0)
|
||||
memcpy(private_spriteram,space->machine->generic.spriteram.u8+0x800,0x800);
|
||||
else
|
||||
memcpy(private_spriteram,space->machine->generic.spriteram.u8,0x800);
|
||||
}
|
||||
if (offset == 6)
|
||||
{
|
||||
if (K007121_ctrlram[0][6] != data)
|
||||
tilemap_mark_all_tiles_dirty( fg_tilemap );
|
||||
if (ctrl_6 != data)
|
||||
tilemap_mark_all_tiles_dirty(fg_tilemap);
|
||||
}
|
||||
if (offset == 7)
|
||||
tilemap_set_flip(fg_tilemap,(data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
|
||||
|
||||
K007121_ctrl_0_w(space,offset,data);
|
||||
k007121_ctrl_w(k007121, offset, data);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( contra_K007121_ctrl_1_w )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(space->machine, "k007121_2");
|
||||
UINT8 ctrl_6 = k007121_ctrlram_r(k007121, 6);
|
||||
|
||||
if (offset == 3)
|
||||
{
|
||||
if ((data&0x8)==0)
|
||||
if ((data & 0x8) == 0)
|
||||
memcpy(private_spriteram_2,space->machine->generic.spriteram.u8+0x2800,0x800);
|
||||
else
|
||||
memcpy(private_spriteram_2,space->machine->generic.spriteram.u8+0x2000,0x800);
|
||||
}
|
||||
if (offset == 6)
|
||||
{
|
||||
if (K007121_ctrlram[1][6] != data )
|
||||
tilemap_mark_all_tiles_dirty( bg_tilemap );
|
||||
if (ctrl_6 != data )
|
||||
tilemap_mark_all_tiles_dirty(bg_tilemap);
|
||||
}
|
||||
if (offset == 7)
|
||||
tilemap_set_flip(bg_tilemap,(data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
|
||||
|
||||
K007121_ctrl_1_w(space,offset,data);
|
||||
k007121_ctrl_w(k007121, offset, data);
|
||||
}
|
||||
|
||||
|
||||
@ -269,17 +290,25 @@ WRITE8_HANDLER( contra_K007121_ctrl_1_w )
|
||||
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank )
|
||||
{
|
||||
const char *chiptag = bank ? "k007121_2" : "k007121_1";
|
||||
const device_config *k007121 = devtag_get_device(machine, chiptag);
|
||||
int base_color = (k007121_ctrlram_r(k007121, 6) & 0x30) * 2;
|
||||
const UINT8 *source;
|
||||
int base_color = (K007121_ctrlram[bank][6]&0x30)*2;
|
||||
|
||||
if (bank==0) source=private_spriteram;
|
||||
else source=private_spriteram_2;
|
||||
|
||||
K007121_sprites_draw(bank,bitmap,cliprect,machine->gfx,machine->colortable,source,base_color,40,0,-1);
|
||||
k007121_sprites_draw(k007121,bitmap,cliprect,machine->gfx[bank],machine->colortable,source,base_color,40,0,-1);
|
||||
}
|
||||
|
||||
VIDEO_UPDATE( contra )
|
||||
{
|
||||
const device_config *k007121_1 = devtag_get_device(screen->machine, "k007121_1");
|
||||
const device_config *k007121_2 = devtag_get_device(screen->machine, "k007121_2");
|
||||
UINT8 ctrl_1_0 = k007121_ctrlram_r(k007121_1, 0);
|
||||
UINT8 ctrl_1_2 = k007121_ctrlram_r(k007121_1, 2);
|
||||
UINT8 ctrl_2_0 = k007121_ctrlram_r(k007121_2, 0);
|
||||
UINT8 ctrl_2_2 = k007121_ctrlram_r(k007121_2, 2);
|
||||
rectangle bg_finalclip = bg_clip;
|
||||
rectangle fg_finalclip = fg_clip;
|
||||
rectangle tx_finalclip = tx_clip;
|
||||
@ -290,10 +319,10 @@ VIDEO_UPDATE( contra )
|
||||
|
||||
set_pens(screen->machine);
|
||||
|
||||
tilemap_set_scrollx( fg_tilemap,0, K007121_ctrlram[0][0x00] - 40 );
|
||||
tilemap_set_scrolly( fg_tilemap,0, K007121_ctrlram[0][0x02] );
|
||||
tilemap_set_scrollx( bg_tilemap,0, K007121_ctrlram[1][0x00] - 40 );
|
||||
tilemap_set_scrolly( bg_tilemap,0, K007121_ctrlram[1][0x02] );
|
||||
tilemap_set_scrollx( fg_tilemap, 0, ctrl_1_0 - 40 );
|
||||
tilemap_set_scrolly( fg_tilemap, 0, ctrl_1_2 );
|
||||
tilemap_set_scrollx( bg_tilemap, 0, ctrl_2_0 - 40 );
|
||||
tilemap_set_scrolly( bg_tilemap, 0, ctrl_2_2 );
|
||||
|
||||
tilemap_draw( bitmap,&bg_finalclip, bg_tilemap, 0 ,0);
|
||||
tilemap_draw( bitmap,&fg_finalclip, fg_tilemap, 0 ,0);
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "driver.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "crshrace.h"
|
||||
#include "video/konicdev.h"
|
||||
#include "includes/crshrace.h"
|
||||
|
||||
|
||||
UINT16 *crshrace_videoram1,*crshrace_videoram2;
|
||||
@ -44,9 +44,6 @@ VIDEO_START( crshrace )
|
||||
tilemap1 = tilemap_create(machine, get_tile_info1,tilemap_scan_rows,16,16,64,64);
|
||||
tilemap2 = tilemap_create(machine, get_tile_info2,tilemap_scan_rows, 8, 8,64,64);
|
||||
|
||||
K053936_wraparound_enable(0, 1);
|
||||
K053936_set_offset(0, -48, -21);
|
||||
|
||||
tilemap_set_transparent_pen(tilemap1,0x0f);
|
||||
tilemap_set_transparent_pen(tilemap2,0xff);
|
||||
}
|
||||
@ -177,9 +174,10 @@ static void draw_bg(bitmap_t *bitmap,const rectangle *cliprect)
|
||||
}
|
||||
|
||||
|
||||
static void draw_fg(bitmap_t *bitmap,const rectangle *cliprect)
|
||||
static void draw_fg(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
K053936_0_zoom_draw(bitmap,cliprect,tilemap1,0,0,1);
|
||||
const device_config *k053936 = devtag_get_device(machine, "k053936");
|
||||
k053936_zoom_draw(k053936, bitmap,cliprect,tilemap1,0,0,1);
|
||||
}
|
||||
|
||||
|
||||
@ -198,12 +196,12 @@ VIDEO_UPDATE( crshrace )
|
||||
case 0x00: /* high score screen */
|
||||
draw_sprites(screen->machine,bitmap,cliprect);
|
||||
draw_bg(bitmap,cliprect);
|
||||
draw_fg(bitmap,cliprect);
|
||||
draw_fg(screen->machine,bitmap,cliprect);
|
||||
break;
|
||||
case 0x01:
|
||||
case 0x02:
|
||||
draw_bg(bitmap,cliprect);
|
||||
draw_fg(bitmap,cliprect);
|
||||
draw_fg(screen->machine,bitmap,cliprect);
|
||||
draw_sprites(screen->machine,bitmap,cliprect);
|
||||
break;
|
||||
default:
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "driver.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
#include "f1gp.h"
|
||||
|
||||
|
||||
@ -54,18 +54,16 @@ static TILE_GET_INFO( get_fg_tile_info )
|
||||
|
||||
VIDEO_START( f1gp )
|
||||
{
|
||||
roz_tilemap = tilemap_create(machine, f1gp_get_roz_tile_info,tilemap_scan_rows,16,16,64,64);
|
||||
fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8,64,32);
|
||||
roz_tilemap = tilemap_create(machine, f1gp_get_roz_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
|
||||
fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
|
||||
|
||||
K053936_wraparound_enable(0, 1);
|
||||
K053936_set_offset(0, -58, -2);
|
||||
|
||||
tilemap_set_transparent_pen(fg_tilemap,0xff);
|
||||
tilemap_set_transparent_pen(fg_tilemap, 0xff);
|
||||
|
||||
zoomdata = (UINT16 *)memory_region(machine, "gfx4");
|
||||
gfx_element_set_source(machine->gfx[3], (UINT8 *)zoomdata);
|
||||
}
|
||||
|
||||
|
||||
VIDEO_START( f1gpb )
|
||||
{
|
||||
roz_tilemap = tilemap_create(machine, f1gp_get_roz_tile_info,tilemap_scan_rows,16,16,64,64);
|
||||
@ -79,17 +77,14 @@ VIDEO_START( f1gpb )
|
||||
|
||||
VIDEO_START( f1gp2 )
|
||||
{
|
||||
roz_tilemap = tilemap_create(machine, f1gp2_get_roz_tile_info,tilemap_scan_rows,16,16,64,64);
|
||||
fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8,64,32);
|
||||
roz_tilemap = tilemap_create(machine, f1gp2_get_roz_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
|
||||
fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
|
||||
|
||||
K053936_wraparound_enable(0, 1);
|
||||
K053936_set_offset(0, -48, -21);
|
||||
tilemap_set_transparent_pen(fg_tilemap, 0xff);
|
||||
tilemap_set_transparent_pen(roz_tilemap, 0x0f);
|
||||
|
||||
tilemap_set_transparent_pen(fg_tilemap,0xff);
|
||||
tilemap_set_transparent_pen(roz_tilemap,0x0f);
|
||||
|
||||
tilemap_set_scrolldx(fg_tilemap,-80,0);
|
||||
tilemap_set_scrolldy(fg_tilemap,-26,0);
|
||||
tilemap_set_scrolldx(fg_tilemap, -80, 0);
|
||||
tilemap_set_scrolldy(fg_tilemap, -26, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -316,9 +311,11 @@ static void f1gpb_draw_sprites(running_machine *machine, bitmap_t *bitmap,const
|
||||
|
||||
VIDEO_UPDATE( f1gp )
|
||||
{
|
||||
const device_config *k053936 = devtag_get_device(screen->machine, "k053936");
|
||||
|
||||
bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
|
||||
|
||||
K053936_0_zoom_draw(bitmap,cliprect,roz_tilemap,0,0,1);
|
||||
k053936_zoom_draw(k053936, bitmap, cliprect, roz_tilemap, 0, 0, 1);
|
||||
|
||||
tilemap_draw(bitmap,cliprect,fg_tilemap,0,1);
|
||||
|
||||
@ -437,6 +434,8 @@ static void f1gp2_draw_sprites(running_machine *machine,bitmap_t *bitmap,const r
|
||||
|
||||
VIDEO_UPDATE( f1gp2 )
|
||||
{
|
||||
const device_config *k053936 = devtag_get_device(screen->machine, "k053936");
|
||||
|
||||
if (gfxctrl & 4) /* blank screen */
|
||||
bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
|
||||
else
|
||||
@ -444,18 +443,18 @@ VIDEO_UPDATE( f1gp2 )
|
||||
switch (gfxctrl & 3)
|
||||
{
|
||||
case 0:
|
||||
K053936_0_zoom_draw(bitmap,cliprect,roz_tilemap,TILEMAP_DRAW_OPAQUE,0,1);
|
||||
k053936_zoom_draw(k053936, bitmap, cliprect, roz_tilemap, TILEMAP_DRAW_OPAQUE, 0, 1);
|
||||
f1gp2_draw_sprites(screen->machine,bitmap,cliprect);
|
||||
tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
|
||||
break;
|
||||
case 1:
|
||||
K053936_0_zoom_draw(bitmap,cliprect,roz_tilemap,TILEMAP_DRAW_OPAQUE,0,1);
|
||||
k053936_zoom_draw(k053936, bitmap, cliprect, roz_tilemap, TILEMAP_DRAW_OPAQUE, 0, 1);
|
||||
tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
|
||||
f1gp2_draw_sprites(screen->machine,bitmap,cliprect);
|
||||
break;
|
||||
case 2:
|
||||
tilemap_draw(bitmap,cliprect,fg_tilemap,TILEMAP_DRAW_OPAQUE,0);
|
||||
K053936_0_zoom_draw(bitmap,cliprect,roz_tilemap,0,0,1);
|
||||
k053936_zoom_draw(k053936, bitmap, cliprect, roz_tilemap, 0, 0, 1);
|
||||
f1gp2_draw_sprites(screen->machine,bitmap,cliprect);
|
||||
break;
|
||||
#ifdef MAME_DEBUG
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "driver.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
|
||||
UINT8 *fastlane_k007121_regs,*fastlane_videoram1,*fastlane_videoram2;
|
||||
static tilemap *layer0, *layer1;
|
||||
@ -50,21 +50,25 @@ static void set_pens(running_machine *machine)
|
||||
|
||||
static TILE_GET_INFO( get_tile_info0 )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(machine, "k007121");
|
||||
UINT8 ctrl_3 = k007121_ctrlram_r(k007121, 3);
|
||||
UINT8 ctrl_4 = k007121_ctrlram_r(k007121, 4);
|
||||
UINT8 ctrl_5 = k007121_ctrlram_r(k007121, 5);
|
||||
int attr = fastlane_videoram1[tile_index];
|
||||
int code = fastlane_videoram1[tile_index + 0x400];
|
||||
int bit0 = (K007121_ctrlram[0][0x05] >> 0) & 0x03;
|
||||
int bit1 = (K007121_ctrlram[0][0x05] >> 2) & 0x03;
|
||||
int bit2 = (K007121_ctrlram[0][0x05] >> 4) & 0x03;
|
||||
int bit3 = (K007121_ctrlram[0][0x05] >> 6) & 0x03;
|
||||
int bit0 = (ctrl_5 >> 0) & 0x03;
|
||||
int bit1 = (ctrl_5 >> 2) & 0x03;
|
||||
int bit2 = (ctrl_5 >> 4) & 0x03;
|
||||
int bit3 = (ctrl_5 >> 6) & 0x03;
|
||||
int bank = ((attr & 0x80) >> 7) |
|
||||
((attr >> (bit0+2)) & 0x02) |
|
||||
((attr >> (bit1+1)) & 0x04) |
|
||||
((attr >> (bit2 )) & 0x08) |
|
||||
((attr >> (bit3-1)) & 0x10) |
|
||||
((K007121_ctrlram[0][0x03] & 0x01) << 5);
|
||||
int mask = (K007121_ctrlram[0][0x04] & 0xf0) >> 4;
|
||||
((ctrl_3 & 0x01) << 5);
|
||||
int mask = (ctrl_4 & 0xf0) >> 4;
|
||||
|
||||
bank = (bank & ~(mask << 1)) | ((K007121_ctrlram[0][0x04] & mask) << 1);
|
||||
bank = (bank & ~(mask << 1)) | ((ctrl_4 & mask) << 1);
|
||||
|
||||
SET_TILE_INFO(
|
||||
0,
|
||||
@ -75,21 +79,25 @@ static TILE_GET_INFO( get_tile_info0 )
|
||||
|
||||
static TILE_GET_INFO( get_tile_info1 )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(machine, "k007121");
|
||||
UINT8 ctrl_3 = k007121_ctrlram_r(k007121, 3);
|
||||
UINT8 ctrl_4 = k007121_ctrlram_r(k007121, 4);
|
||||
UINT8 ctrl_5 = k007121_ctrlram_r(k007121, 5);
|
||||
int attr = fastlane_videoram2[tile_index];
|
||||
int code = fastlane_videoram2[tile_index + 0x400];
|
||||
int bit0 = (K007121_ctrlram[0][0x05] >> 0) & 0x03;
|
||||
int bit1 = (K007121_ctrlram[0][0x05] >> 2) & 0x03;
|
||||
int bit2 = (K007121_ctrlram[0][0x05] >> 4) & 0x03;
|
||||
int bit3 = (K007121_ctrlram[0][0x05] >> 6) & 0x03;
|
||||
int bit0 = (ctrl_5 >> 0) & 0x03;
|
||||
int bit1 = (ctrl_5 >> 2) & 0x03;
|
||||
int bit2 = (ctrl_5 >> 4) & 0x03;
|
||||
int bit3 = (ctrl_5 >> 6) & 0x03;
|
||||
int bank = ((attr & 0x80) >> 7) |
|
||||
((attr >> (bit0+2)) & 0x02) |
|
||||
((attr >> (bit1+1)) & 0x04) |
|
||||
((attr >> (bit2 )) & 0x08) |
|
||||
((attr >> (bit3-1)) & 0x10) |
|
||||
((K007121_ctrlram[0][0x03] & 0x01) << 5);
|
||||
int mask = (K007121_ctrlram[0][0x04] & 0xf0) >> 4;
|
||||
((ctrl_3 & 0x01) << 5);
|
||||
int mask = (ctrl_4 & 0xf0) >> 4;
|
||||
|
||||
bank = (bank & ~(mask << 1)) | ((K007121_ctrlram[0][0x04] & mask) << 1);
|
||||
bank = (bank & ~(mask << 1)) | ((ctrl_4 & mask) << 1);
|
||||
|
||||
SET_TILE_INFO(
|
||||
0,
|
||||
@ -147,6 +155,7 @@ WRITE8_HANDLER( fastlane_vram2_w )
|
||||
|
||||
VIDEO_UPDATE( fastlane )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(screen->machine, "k007121");
|
||||
rectangle finalclip0 = clip0, finalclip1 = clip1;
|
||||
int i, xoffs;
|
||||
|
||||
@ -156,14 +165,14 @@ VIDEO_UPDATE( fastlane )
|
||||
set_pens(screen->machine);
|
||||
|
||||
/* set scroll registers */
|
||||
xoffs = K007121_ctrlram[0][0x00];
|
||||
xoffs = k007121_ctrlram_r(k007121, 0);
|
||||
for( i=0; i<32; i++ ){
|
||||
tilemap_set_scrollx(layer0, i, fastlane_k007121_regs[0x20 + i] + xoffs - 40);
|
||||
}
|
||||
tilemap_set_scrolly( layer0, 0, K007121_ctrlram[0][0x02] );
|
||||
tilemap_set_scrolly(layer0, 0, k007121_ctrlram_r(k007121, 2));
|
||||
|
||||
tilemap_draw(bitmap,&finalclip0,layer0,0,0);
|
||||
K007121_sprites_draw(0,bitmap,cliprect,screen->machine->gfx,screen->machine->colortable,screen->machine->generic.spriteram.u8,0,40,0,-1);
|
||||
k007121_sprites_draw(k007121,bitmap,cliprect,screen->machine->gfx[0],screen->machine->colortable,screen->machine->generic.spriteram.u8,0,40,0,-1);
|
||||
tilemap_draw(bitmap,&finalclip1,layer1,0,0);
|
||||
return 0;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "driver.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
|
||||
static tilemap *k007121_tilemap[2];
|
||||
static rectangle k007121_clip[2];
|
||||
@ -24,23 +24,29 @@ static int k007121_flip_screen = 0;
|
||||
|
||||
static TILE_GET_INFO( get_tile_info_A )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(machine, "k007121");
|
||||
UINT8 ctrl_0 = k007121_ctrlram_r(k007121, 0);
|
||||
UINT8 ctrl_2 = k007121_ctrlram_r(k007121, 2);
|
||||
UINT8 ctrl_3 = k007121_ctrlram_r(k007121, 3);
|
||||
UINT8 ctrl_4 = k007121_ctrlram_r(k007121, 4);
|
||||
UINT8 ctrl_5 = k007121_ctrlram_r(k007121, 5);
|
||||
int attr = k007121_ram[tile_index];
|
||||
int code = k007121_ram[tile_index+0x400];
|
||||
int bit0 = (K007121_ctrlram[0][0x05] >> 0) & 0x03;
|
||||
int bit1 = (K007121_ctrlram[0][0x05] >> 2) & 0x03;
|
||||
int bit2 = (K007121_ctrlram[0][0x05] >> 4) & 0x03;
|
||||
int bit3 = (K007121_ctrlram[0][0x05] >> 6) & 0x03;
|
||||
int bit0 = (ctrl_5 >> 0) & 0x03;
|
||||
int bit1 = (ctrl_5 >> 2) & 0x03;
|
||||
int bit2 = (ctrl_5 >> 4) & 0x03;
|
||||
int bit3 = (ctrl_5 >> 6) & 0x03;
|
||||
int bank = ((attr & 0x80) >> 7) |
|
||||
((attr >> (bit0+2)) & 0x02) |
|
||||
((attr >> (bit1+1)) & 0x04) |
|
||||
((attr >> (bit2 )) & 0x08) |
|
||||
((attr >> (bit3-1)) & 0x10) |
|
||||
((K007121_ctrlram[0][0x03] & 0x01) << 5);
|
||||
int mask = (K007121_ctrlram[0][0x04] & 0xf0) >> 4;
|
||||
((ctrl_3 & 0x01) << 5);
|
||||
int mask = (ctrl_4 & 0xf0) >> 4;
|
||||
|
||||
bank = (bank & ~(mask << 1)) | ((K007121_ctrlram[0][0x04] & mask) << 1);
|
||||
bank = (bank & ~(mask << 1)) | ((ctrl_4 & mask) << 1);
|
||||
|
||||
if ((attr == 0x0d) && (!(K007121_ctrlram[0][0])) && (!(K007121_ctrlram[0][2])))
|
||||
if ((attr == 0x0d) && (!ctrl_0) && (!ctrl_2))
|
||||
bank = 0; /* this allows the game to print text
|
||||
in all banks selected by the k007121 */
|
||||
|
||||
@ -98,10 +104,11 @@ WRITE8_HANDLER( flkatck_k007121_w )
|
||||
|
||||
WRITE8_HANDLER( flkatck_k007121_regs_w )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(space->machine, "k007121");
|
||||
switch (offset)
|
||||
{
|
||||
case 0x04: /* ROM bank select */
|
||||
if (data != K007121_ctrlram[0][0x04])
|
||||
if (data != k007121_ctrlram_r(k007121, 4))
|
||||
tilemap_mark_all_tiles_dirty_all(space->machine);
|
||||
break;
|
||||
|
||||
@ -112,7 +119,7 @@ WRITE8_HANDLER( flkatck_k007121_regs_w )
|
||||
break;
|
||||
}
|
||||
|
||||
K007121_ctrl_0_w(space,offset,data);
|
||||
k007121_ctrl_w(k007121, offset, data);
|
||||
}
|
||||
|
||||
|
||||
@ -131,14 +138,10 @@ WRITE8_HANDLER( flkatck_k007121_regs_w )
|
||||
|
||||
VIDEO_UPDATE( flkatck )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(screen->machine, "k007121");
|
||||
rectangle final_clip[2];
|
||||
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||
|
||||
#if 0
|
||||
popmessage("%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x %02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x",
|
||||
K007121_ctrlram[0][0x00],K007121_ctrlram[0][0x01],K007121_ctrlram[0][0x02],K007121_ctrlram[0][0x03],K007121_ctrlram[0][0x04],K007121_ctrlram[0][0x05],K007121_ctrlram[0][0x06],K007121_ctrlram[0][0x07],
|
||||
K007121_ctrlram[1][0x00],K007121_ctrlram[1][0x01],K007121_ctrlram[1][0x02],K007121_ctrlram[1][0x03],K007121_ctrlram[1][0x04],K007121_ctrlram[1][0x05],K007121_ctrlram[1][0x06],K007121_ctrlram[1][0x07]);
|
||||
#endif
|
||||
if (k007121_flip_screen)
|
||||
{
|
||||
k007121_clip[0] = *visarea;
|
||||
@ -147,9 +150,9 @@ popmessage("%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x %02x-%02x-%02x-%02x-%02x-%0
|
||||
k007121_clip[1] = *visarea;
|
||||
k007121_clip[1].min_x = k007121_clip[1].max_x-40;
|
||||
|
||||
tilemap_set_scrollx(k007121_tilemap[0],0,K007121_ctrlram[0][0x00] - 56 );
|
||||
tilemap_set_scrolly(k007121_tilemap[0],0,K007121_ctrlram[0][0x02]);
|
||||
tilemap_set_scrollx(k007121_tilemap[1],0,-16);
|
||||
tilemap_set_scrollx(k007121_tilemap[0], 0, k007121_ctrlram_r(k007121, 0) - 56 );
|
||||
tilemap_set_scrolly(k007121_tilemap[0], 0, k007121_ctrlram_r(k007121, 2));
|
||||
tilemap_set_scrollx(k007121_tilemap[1], 0, -16);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -160,8 +163,8 @@ popmessage("%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x %02x-%02x-%02x-%02x-%02x-%0
|
||||
k007121_clip[1].max_x = 39;
|
||||
k007121_clip[1].min_x = 0;
|
||||
|
||||
tilemap_set_scrollx(k007121_tilemap[0],0,K007121_ctrlram[0][0x00] - 40 );
|
||||
tilemap_set_scrolly(k007121_tilemap[0],0,K007121_ctrlram[0][0x02]);
|
||||
tilemap_set_scrollx(k007121_tilemap[0],0,k007121_ctrlram_r(k007121, 0) - 40 );
|
||||
tilemap_set_scrolly(k007121_tilemap[0],0,k007121_ctrlram_r(k007121, 2));
|
||||
tilemap_set_scrollx(k007121_tilemap[1],0,0);
|
||||
}
|
||||
|
||||
@ -173,7 +176,7 @@ popmessage("%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x %02x-%02x-%02x-%02x-%02x-%0
|
||||
|
||||
/* draw the graphics */
|
||||
tilemap_draw(bitmap,&final_clip[0],k007121_tilemap[0],0,0);
|
||||
K007121_sprites_draw(0,bitmap,cliprect,screen->machine->gfx,NULL,&k007121_ram[0x1000],0,40,0,-1);
|
||||
k007121_sprites_draw(k007121,bitmap,cliprect,screen->machine->gfx[0],NULL,&k007121_ram[0x1000],0,40,0,-1);
|
||||
tilemap_draw(bitmap,&final_clip[1],k007121_tilemap[1],0,0);
|
||||
return 0;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "driver.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
|
||||
UINT8 *hcastle_pf1_videoram,*hcastle_pf2_videoram;
|
||||
static int gfx_bank;
|
||||
@ -76,10 +76,13 @@ static TILEMAP_MAPPER( tilemap_scan )
|
||||
|
||||
static TILE_GET_INFO( get_fg_tile_info )
|
||||
{
|
||||
int bit0 = (K007121_ctrlram[0][0x05] >> 0) & 0x03;
|
||||
int bit1 = (K007121_ctrlram[0][0x05] >> 2) & 0x03;
|
||||
int bit2 = (K007121_ctrlram[0][0x05] >> 4) & 0x03;
|
||||
int bit3 = (K007121_ctrlram[0][0x05] >> 6) & 0x03;
|
||||
const device_config *k007121 = devtag_get_device(machine, "k007121_1");
|
||||
UINT8 ctrl_5 = k007121_ctrlram_r(k007121, 5);
|
||||
UINT8 ctrl_6 = k007121_ctrlram_r(k007121, 6);
|
||||
int bit0 = (ctrl_5 >> 0) & 0x03;
|
||||
int bit1 = (ctrl_5 >> 2) & 0x03;
|
||||
int bit2 = (ctrl_5 >> 4) & 0x03;
|
||||
int bit3 = (ctrl_5 >> 6) & 0x03;
|
||||
int attr = hcastle_pf1_videoram[tile_index];
|
||||
int tile = hcastle_pf1_videoram[tile_index + 0x400];
|
||||
int color = attr & 0x7;
|
||||
@ -92,16 +95,19 @@ static TILE_GET_INFO( get_fg_tile_info )
|
||||
SET_TILE_INFO(
|
||||
0,
|
||||
tile + bank*0x100 + pf1_bankbase,
|
||||
((K007121_ctrlram[0][6]&0x30)*2+16) + color,
|
||||
((ctrl_6 & 0x30) * 2 + 16) + color,
|
||||
0);
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( get_bg_tile_info )
|
||||
{
|
||||
int bit0 = (K007121_ctrlram[1][0x05] >> 0) & 0x03;
|
||||
int bit1 = (K007121_ctrlram[1][0x05] >> 2) & 0x03;
|
||||
int bit2 = (K007121_ctrlram[1][0x05] >> 4) & 0x03;
|
||||
int bit3 = (K007121_ctrlram[1][0x05] >> 6) & 0x03;
|
||||
const device_config *k007121 = devtag_get_device(machine, "k007121_2");
|
||||
UINT8 ctrl_5 = k007121_ctrlram_r(k007121, 5);
|
||||
UINT8 ctrl_6 = k007121_ctrlram_r(k007121, 6);
|
||||
int bit0 = (ctrl_5 >> 0) & 0x03;
|
||||
int bit1 = (ctrl_5 >> 2) & 0x03;
|
||||
int bit2 = (ctrl_5 >> 4) & 0x03;
|
||||
int bit3 = (ctrl_5 >> 6) & 0x03;
|
||||
int attr = hcastle_pf2_videoram[tile_index];
|
||||
int tile = hcastle_pf2_videoram[tile_index + 0x400];
|
||||
int color = attr & 0x7;
|
||||
@ -114,7 +120,7 @@ static TILE_GET_INFO( get_bg_tile_info )
|
||||
SET_TILE_INFO(
|
||||
1,
|
||||
tile + bank*0x100 + pf2_bankbase,
|
||||
((K007121_ctrlram[1][6]&0x30)*2+16) + color,
|
||||
((ctrl_6 & 0x30) * 2 + 16) + color,
|
||||
0);
|
||||
}
|
||||
|
||||
@ -128,8 +134,8 @@ static TILE_GET_INFO( get_bg_tile_info )
|
||||
|
||||
VIDEO_START( hcastle )
|
||||
{
|
||||
fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan,8,8,64,32);
|
||||
bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan, 8,8,64,32);
|
||||
fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan, 8, 8, 64, 32);
|
||||
bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan, 8, 8, 64, 32);
|
||||
|
||||
tilemap_set_transparent_pen(fg_tilemap,0);
|
||||
}
|
||||
@ -166,6 +172,7 @@ READ8_HANDLER( hcastle_gfxbank_r )
|
||||
|
||||
WRITE8_HANDLER( hcastle_pf1_control_w )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(space->machine, "k007121_1");
|
||||
if (offset==3)
|
||||
{
|
||||
if ((data&0x8)==0)
|
||||
@ -177,11 +184,12 @@ WRITE8_HANDLER( hcastle_pf1_control_w )
|
||||
{
|
||||
tilemap_set_flip(fg_tilemap, (data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
|
||||
}
|
||||
K007121_ctrl_0_w(space,offset,data);
|
||||
k007121_ctrl_w(k007121, offset, data);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( hcastle_pf2_control_w )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(space->machine, "k007121_2");
|
||||
if (offset==3)
|
||||
{
|
||||
if ((data&0x8)==0)
|
||||
@ -193,21 +201,35 @@ WRITE8_HANDLER( hcastle_pf2_control_w )
|
||||
{
|
||||
tilemap_set_flip(bg_tilemap, (data & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
|
||||
}
|
||||
K007121_ctrl_1_w(space,offset,data);
|
||||
k007121_ctrl_w(k007121, offset, data);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *sbank, int bank )
|
||||
{
|
||||
const char *chiptag = bank ? "k007121_2" : "k007121_1";
|
||||
const device_config *k007121 = devtag_get_device(machine, chiptag);
|
||||
int base_color = (k007121_ctrlram_r(k007121, 6) & 0x30) * 2;
|
||||
int bank_base = (bank == 0) ? 0x4000 * (gfx_bank & 1) : 0;
|
||||
K007121_sprites_draw(bank,bitmap,cliprect,machine->gfx,machine->colortable,sbank,(K007121_ctrlram[bank][6]&0x30)*2,0,bank_base,-1);
|
||||
|
||||
k007121_sprites_draw(k007121, bitmap, cliprect,machine->gfx[bank], machine->colortable, sbank, base_color, 0, bank_base, -1);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
VIDEO_UPDATE( hcastle )
|
||||
{
|
||||
const device_config *k007121_1 = devtag_get_device(screen->machine, "k007121_1");
|
||||
const device_config *k007121_2 = devtag_get_device(screen->machine, "k007121_2");
|
||||
UINT8 ctrl_1_0 = k007121_ctrlram_r(k007121_1, 0);
|
||||
UINT8 ctrl_1_1 = k007121_ctrlram_r(k007121_1, 1);
|
||||
UINT8 ctrl_1_2 = k007121_ctrlram_r(k007121_1, 2);
|
||||
UINT8 ctrl_1_3 = k007121_ctrlram_r(k007121_1, 3);
|
||||
UINT8 ctrl_2_0 = k007121_ctrlram_r(k007121_2, 0);
|
||||
UINT8 ctrl_2_1 = k007121_ctrlram_r(k007121_2, 1);
|
||||
UINT8 ctrl_2_2 = k007121_ctrlram_r(k007121_2, 2);
|
||||
UINT8 ctrl_2_3 = k007121_ctrlram_r(k007121_2, 3);
|
||||
static int old_pf1,old_pf2;
|
||||
|
||||
set_pens(screen->machine);
|
||||
@ -215,8 +237,8 @@ VIDEO_UPDATE( hcastle )
|
||||
pf1_bankbase = 0x0000;
|
||||
pf2_bankbase = 0x4000 * ((gfx_bank & 2) >> 1);
|
||||
|
||||
if (K007121_ctrlram[0][3] & 0x01) pf1_bankbase += 0x2000;
|
||||
if (K007121_ctrlram[1][3] & 0x01) pf2_bankbase += 0x2000;
|
||||
if (ctrl_1_3 & 0x01) pf1_bankbase += 0x2000;
|
||||
if (ctrl_2_3 & 0x01) pf2_bankbase += 0x2000;
|
||||
|
||||
if (pf1_bankbase != old_pf1)
|
||||
tilemap_mark_all_tiles_dirty(fg_tilemap);
|
||||
@ -227,13 +249,13 @@ VIDEO_UPDATE( hcastle )
|
||||
old_pf1 = pf1_bankbase;
|
||||
old_pf2 = pf2_bankbase;
|
||||
|
||||
tilemap_set_scrolly(bg_tilemap,0,K007121_ctrlram[1][2]);
|
||||
tilemap_set_scrollx(bg_tilemap,0,((K007121_ctrlram[1][1]<<8)+K007121_ctrlram[1][0]));
|
||||
tilemap_set_scrolly(fg_tilemap,0,K007121_ctrlram[0][2]);
|
||||
tilemap_set_scrollx(fg_tilemap,0,((K007121_ctrlram[0][1]<<8)+K007121_ctrlram[0][0]));
|
||||
tilemap_set_scrolly(bg_tilemap,0,ctrl_2_2);
|
||||
tilemap_set_scrollx(bg_tilemap,0,((ctrl_2_1<<8)+ctrl_2_0));
|
||||
tilemap_set_scrolly(fg_tilemap,0,ctrl_1_2);
|
||||
tilemap_set_scrollx(fg_tilemap,0,((ctrl_1_1<<8)+ctrl_1_0));
|
||||
|
||||
// /* Sprite priority */
|
||||
// if (K007121_ctrlram[0][3]&0x20)
|
||||
// if (ctrl_1_3 & 0x20)
|
||||
if ((gfx_bank & 0x04) == 0)
|
||||
{
|
||||
tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
|
||||
|
9632
src/mame/video/konicdev.c
Normal file
9632
src/mame/video/konicdev.c
Normal file
File diff suppressed because it is too large
Load Diff
744
src/mame/video/konicdev.h
Normal file
744
src/mame/video/konicdev.h
Normal file
@ -0,0 +1,744 @@
|
||||
/*************************************************************************
|
||||
|
||||
konicdev.h
|
||||
|
||||
Implementation of various Konami custom IC used for video
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
#include "devcb.h"
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
TYPE DEFINITIONS
|
||||
***************************************************************************/
|
||||
|
||||
typedef void (*k007342_callback)(int tmap, int bank, int *code, int *color, int *flags);
|
||||
typedef void (*k007420_callback)(int *code, int *color);
|
||||
typedef void (*k052109_callback)(int layer, int bank, int *code, int *color, int *flags, int *priority);
|
||||
typedef void (*k051960_callback)(int *code, int *color, int *priority, int *shadow);
|
||||
typedef void (*k05324x_callback)(int *code, int *color, int *priority);
|
||||
typedef void (*k051316_callback)(int *code, int *color, int *flags);
|
||||
typedef void (*k056832_callback)(int layer, int *code, int *color, int *flags);
|
||||
typedef void (*k056800_irq_cb)(running_machine *, int);
|
||||
|
||||
|
||||
typedef struct _k007342_interface k007342_interface;
|
||||
struct _k007342_interface
|
||||
{
|
||||
int gfxnum;
|
||||
k007342_callback callback;
|
||||
};
|
||||
|
||||
typedef struct _k007420_interface k007420_interface;
|
||||
struct _k007420_interface
|
||||
{
|
||||
int gfxnum;
|
||||
k007420_callback callback;
|
||||
};
|
||||
|
||||
typedef struct _k052109_interface k052109_interface;
|
||||
struct _k052109_interface
|
||||
{
|
||||
const char *gfx_memory_region;
|
||||
int plane_order;
|
||||
k052109_callback callback;
|
||||
};
|
||||
|
||||
typedef struct _k051960_interface k051960_interface;
|
||||
struct _k051960_interface
|
||||
{
|
||||
const char *gfx_memory_region;
|
||||
int plane_order;
|
||||
k051960_callback callback;
|
||||
};
|
||||
|
||||
typedef struct _k05324x_interface k05324x_interface;
|
||||
struct _k05324x_interface
|
||||
{
|
||||
const char *gfx_memory_region;
|
||||
int plane_order;
|
||||
k05324x_callback callback;
|
||||
};
|
||||
|
||||
typedef struct _k053247_interface k053247_interface;
|
||||
struct _k053247_interface
|
||||
{
|
||||
const char *screen;
|
||||
const char *gfx_memory_region;
|
||||
int plane_order;
|
||||
int dx, dy;
|
||||
k05324x_callback callback;
|
||||
};
|
||||
|
||||
typedef struct _k051316_interface k051316_interface;
|
||||
struct _k051316_interface
|
||||
{
|
||||
const char *gfx_memory_region;
|
||||
int bpp, pen_is_mask, transparent_pen;
|
||||
k051316_callback callback;
|
||||
};
|
||||
|
||||
typedef struct _k053936_interface k053936_interface;
|
||||
struct _k053936_interface
|
||||
{
|
||||
int wrap, xoff, yoff;
|
||||
int linectrl_size;
|
||||
};
|
||||
|
||||
typedef struct _k056832_interface k056832_interface;
|
||||
struct _k056832_interface
|
||||
{
|
||||
const char *gfx_memory_region;
|
||||
int bpp;
|
||||
int big;
|
||||
// int (*scrolld)[4][2]; // 2009-12 FP: what were these for? they are never used as of 0.135
|
||||
int djmain_hack;
|
||||
k056832_callback callback;
|
||||
|
||||
const char *k055555;
|
||||
};
|
||||
|
||||
typedef struct _k054338_interface k054338_interface;
|
||||
struct _k054338_interface
|
||||
{
|
||||
const char *screen;
|
||||
const char *k055555;
|
||||
};
|
||||
|
||||
typedef struct _k053250_interface k053250_interface;
|
||||
struct _k053250_interface
|
||||
{
|
||||
const char *screen;
|
||||
const char *region;
|
||||
};
|
||||
|
||||
typedef struct _k056800_interface k056800_interface;
|
||||
struct _k056800_interface
|
||||
{
|
||||
k056800_irq_cb irq_cb;
|
||||
};
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
FUNCTION PROTOTYPES
|
||||
***************************************************************************/
|
||||
|
||||
DEVICE_GET_INFO( k007121 );
|
||||
DEVICE_GET_INFO( k007342 );
|
||||
DEVICE_GET_INFO( k007420 );
|
||||
DEVICE_GET_INFO( k052109 );
|
||||
DEVICE_GET_INFO( k051960 );
|
||||
DEVICE_GET_INFO( k05324x );
|
||||
DEVICE_GET_INFO( k053247 );
|
||||
DEVICE_GET_INFO( k055673 );
|
||||
DEVICE_GET_INFO( k051316 );
|
||||
DEVICE_GET_INFO( k053936 );
|
||||
DEVICE_GET_INFO( k053251 );
|
||||
DEVICE_GET_INFO( k054000 );
|
||||
DEVICE_GET_INFO( k051733 );
|
||||
DEVICE_GET_INFO( k056832 );
|
||||
DEVICE_GET_INFO( k055555 );
|
||||
DEVICE_GET_INFO( k054338 );
|
||||
DEVICE_GET_INFO( k053250 );
|
||||
DEVICE_GET_INFO( k053252 );
|
||||
DEVICE_GET_INFO( k056800 );
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define K007121 DEVICE_GET_INFO_NAME( k007121 )
|
||||
|
||||
#define MDRV_K007121_ADD(_tag) \
|
||||
MDRV_DEVICE_ADD(_tag, K007121, 0)
|
||||
|
||||
#define K007342 DEVICE_GET_INFO_NAME( k007342 )
|
||||
|
||||
#define MDRV_K007342_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K007342, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
#define K007420 DEVICE_GET_INFO_NAME( k007420 )
|
||||
|
||||
#define MDRV_K007420_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K007420, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
#define K052109 DEVICE_GET_INFO_NAME( k052109 )
|
||||
|
||||
#define MDRV_K052109_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K052109, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
#define K051960 DEVICE_GET_INFO_NAME( k051960 )
|
||||
|
||||
#define MDRV_K051960_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K051960, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
#define K053244 DEVICE_GET_INFO_NAME( k05324x )
|
||||
#define K053245 DEVICE_GET_INFO_NAME( k05324x )
|
||||
|
||||
#define MDRV_K053244_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K053244, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
#define MDRV_K053245_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K053245, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
#define K053246 DEVICE_GET_INFO_NAME( k053247 )
|
||||
#define K053247 DEVICE_GET_INFO_NAME( k053247 )
|
||||
|
||||
#define MDRV_K053246_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K053246, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
#define MDRV_K053247_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K053247, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
#define K055673 DEVICE_GET_INFO_NAME( k055673 )
|
||||
|
||||
#define MDRV_K055673_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K055673, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
#define K051316 DEVICE_GET_INFO_NAME( k051316 )
|
||||
|
||||
#define MDRV_K051316_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K051316, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
#define K053936 DEVICE_GET_INFO_NAME( k053936 )
|
||||
|
||||
#define MDRV_K053936_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K053936, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
#define K053251 DEVICE_GET_INFO_NAME( k053251 )
|
||||
|
||||
#define MDRV_K053251_ADD(_tag) \
|
||||
MDRV_DEVICE_ADD(_tag, K053251, 0)
|
||||
|
||||
#define K054000 DEVICE_GET_INFO_NAME( k054000 )
|
||||
|
||||
#define MDRV_K054000_ADD(_tag) \
|
||||
MDRV_DEVICE_ADD(_tag, K054000, 0)
|
||||
|
||||
#define K051733 DEVICE_GET_INFO_NAME( k051733 )
|
||||
|
||||
#define MDRV_K051733_ADD(_tag) \
|
||||
MDRV_DEVICE_ADD(_tag, K051733, 0)
|
||||
|
||||
#define K056832 DEVICE_GET_INFO_NAME( k056832 )
|
||||
|
||||
#define MDRV_K056832_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K056832, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
#define K055555 DEVICE_GET_INFO_NAME( k055555 )
|
||||
|
||||
#define MDRV_K055555_ADD(_tag) \
|
||||
MDRV_DEVICE_ADD(_tag, K055555, 0)
|
||||
|
||||
#define K054338 DEVICE_GET_INFO_NAME( k054338 )
|
||||
|
||||
#define MDRV_K054338_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K054338, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
#define K053250 DEVICE_GET_INFO_NAME( k053250 )
|
||||
|
||||
#define MDRV_K053250_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K053250, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
#define K053252 DEVICE_GET_INFO_NAME( k053252 )
|
||||
|
||||
#define MDRV_K053252_ADD(_tag) \
|
||||
MDRV_DEVICE_ADD(_tag, K053252, 0)
|
||||
|
||||
#define K056800 DEVICE_GET_INFO_NAME( k056800 )
|
||||
|
||||
#define MDRV_K056800_ADD(_tag, _interface) \
|
||||
MDRV_DEVICE_ADD(_tag, K056800, 0) \
|
||||
MDRV_DEVICE_CONFIG(_interface)
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
HELPERS FOR DRIVERS
|
||||
***************************************************************************/
|
||||
|
||||
/* helper function to join two 16-bit ROMs and form a 32-bit data stream */
|
||||
void konamid_rom_deinterleave_2(running_machine *machine, const char *mem_region);
|
||||
void konamid_rom_deinterleave_2_half(running_machine *machine, const char *mem_region);
|
||||
/* helper function to join four 16-bit ROMs and form a 64-bit data stream */
|
||||
void konamid_rom_deinterleave_4(running_machine *machine, const char *mem_region);
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE I/O FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
/** Konami 007121 **/
|
||||
WRITE8_DEVICE_HANDLER( k007121_ctrlram_w ); // FIXME: this is probably unused: writes to ctrlram should use ctrl_w below!
|
||||
READ8_DEVICE_HANDLER( k007121_ctrlram_r );
|
||||
WRITE8_DEVICE_HANDLER( k007121_ctrl_w );
|
||||
|
||||
/* shall we move source in the interface? */
|
||||
/* also notice that now we directly pass *gfx[chip] instead of **gfx !! */
|
||||
void k007121_sprites_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, gfx_element *gfx, colortable_t *ctable,
|
||||
const UINT8 *source, int base_color, int global_x_offset, int bank_base, UINT32 pri_mask );
|
||||
|
||||
|
||||
/** Konami 007342 **/
|
||||
READ8_DEVICE_HANDLER( k007342_r );
|
||||
WRITE8_DEVICE_HANDLER( k007342_w );
|
||||
READ8_DEVICE_HANDLER( k007342_scroll_r );
|
||||
WRITE8_DEVICE_HANDLER( k007342_scroll_w );
|
||||
WRITE8_DEVICE_HANDLER( k007342_vreg_w );
|
||||
|
||||
void k007342_tilemap_update(const device_config *device);
|
||||
void k007342_tilemap_set_enable(const device_config *device, int layer, int enable);
|
||||
void k007342_tilemap_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int num, int flags, UINT32 priority);
|
||||
int k007342_is_INT_enabled(const device_config *device);
|
||||
|
||||
|
||||
/** Konami 007420 **/
|
||||
#define k007420_SPRITERAM_SIZE 0x200
|
||||
|
||||
READ8_DEVICE_HANDLER( k007420_r );
|
||||
WRITE8_DEVICE_HANDLER( k007420_w );
|
||||
|
||||
void k007420_sprites_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect);
|
||||
void k007420_set_banklimit(const device_config *device, int limit);
|
||||
|
||||
|
||||
/** Konami 052109 **/
|
||||
/*
|
||||
You don't have to decode the graphics: the vh_start() routines will do that
|
||||
for you, using the plane order passed.
|
||||
Of course the ROM data must be in the correct order. This is a way to ensure
|
||||
that the ROM test will pass.
|
||||
The konami_rom_deinterleave() function above will do the reorganization for
|
||||
you in most cases (but see tmnt.c for additional bit rotations or byte
|
||||
permutations which may be required).
|
||||
*/
|
||||
#define NORMAL_PLANE_ORDER 0x0123
|
||||
#define REVERSE_PLANE_ORDER 0x3210
|
||||
#define GRADIUS3_PLANE_ORDER 0x1111
|
||||
|
||||
|
||||
/*
|
||||
The callback is passed:
|
||||
- layer number (0 = FIX, 1 = A, 2 = B)
|
||||
- bank (range 0-3, output of the pins CAB1 and CAB2)
|
||||
- code (range 00-FF, output of the pins VC3-VC10)
|
||||
NOTE: code is in the range 0000-FFFF for X-Men, which uses extra RAM
|
||||
- color (range 00-FF, output of the pins COL0-COL7)
|
||||
The callback must put:
|
||||
- in code the resulting tile number
|
||||
- in color the resulting color index
|
||||
- if necessary, put flags and/or priority for the TileMap code in the tile_info
|
||||
structure (e.g. TILE_FLIPX). Note that TILE_FLIPY is handled internally by the
|
||||
chip so it must not be set by the callback.
|
||||
*/
|
||||
|
||||
READ8_DEVICE_HANDLER( k052109_r );
|
||||
WRITE8_DEVICE_HANDLER( k052109_w );
|
||||
READ16_DEVICE_HANDLER( k052109_word_r );
|
||||
WRITE16_DEVICE_HANDLER( k052109_word_w );
|
||||
READ16_DEVICE_HANDLER( k052109_lsb_r );
|
||||
WRITE16_DEVICE_HANDLER( k052109_lsb_w );
|
||||
|
||||
void k052109_set_RMRD_line(const device_config *device, int state);
|
||||
int k052109_get_RMRD_line(const device_config *device);
|
||||
void k052109_tilemap_update(const device_config *device);
|
||||
int k052109_is_IRQ_enabled(const device_config *device);
|
||||
void k052109_set_layer_offsets(const device_config *device, int layer, int dx, int dy);
|
||||
|
||||
void k052109_get_tmap(const device_config *device, tilemap *tilemap, int index);
|
||||
void k052109_get_tmaps_all(const device_config *device, tilemap *tilemap0, tilemap *tilemap1, tilemap *tilemap2);
|
||||
|
||||
void k052109_postload_tileflip_reset( const device_config *device ); // this has to be added to POSTLOAD functions in each driver
|
||||
|
||||
|
||||
/** Konami 051960 / 051937 **/
|
||||
/*
|
||||
The callback is passed:
|
||||
- code (range 00-1FFF, output of the pins CA5-CA17)
|
||||
- color (range 00-FF, output of the pins OC0-OC7). Note that most of the
|
||||
time COL7 seems to be "shadow", but not always (e.g. Aliens).
|
||||
The callback must put:
|
||||
- in code the resulting sprite number
|
||||
- in color the resulting color index
|
||||
- if necessary, in priority the priority of the sprite wrt tilemaps
|
||||
- if necessary, alter shadow to indicate whether the sprite has shadows enabled.
|
||||
shadow is preloaded with color & 0x80 so it doesn't need to be changed unless
|
||||
the game has special treatment (Aliens)
|
||||
*/
|
||||
|
||||
READ8_DEVICE_HANDLER( k051960_r );
|
||||
WRITE8_DEVICE_HANDLER( k051960_w );
|
||||
READ16_DEVICE_HANDLER( k051960_word_r );
|
||||
WRITE16_DEVICE_HANDLER( k051960_word_w );
|
||||
|
||||
READ8_DEVICE_HANDLER( k051937_r );
|
||||
WRITE8_DEVICE_HANDLER( k051937_w );
|
||||
READ16_DEVICE_HANDLER( k051937_word_r );
|
||||
WRITE16_DEVICE_HANDLER( k051937_word_w );
|
||||
|
||||
void k051960_sprites_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int min_priority, int max_priority);
|
||||
int k051960_is_IRQ_enabled(const device_config *device);
|
||||
int k051960_is_NMI_enabled(const device_config *device);
|
||||
void k051960_set_sprite_offsets(const device_config *device, int dx, int dy);
|
||||
|
||||
#if 0 // to be moved in the specific drivers!
|
||||
/* special handling for the chips sharing address space */
|
||||
READ8_HANDLER( k052109_051960_r );
|
||||
WRITE8_HANDLER( k052109_051960_w );
|
||||
#endif
|
||||
|
||||
|
||||
/** Konami 053244 / 053245 **/
|
||||
READ16_DEVICE_HANDLER( k053245_word_r );
|
||||
WRITE16_DEVICE_HANDLER( k053245_word_w );
|
||||
READ8_DEVICE_HANDLER( k053245_r );
|
||||
WRITE8_DEVICE_HANDLER( k053245_w );
|
||||
READ8_DEVICE_HANDLER( k053244_r );
|
||||
WRITE8_DEVICE_HANDLER( k053244_w );
|
||||
READ16_DEVICE_HANDLER( k053244_lsb_r );
|
||||
WRITE16_DEVICE_HANDLER( k053244_lsb_w );
|
||||
READ16_DEVICE_HANDLER( k053244_word_r );
|
||||
WRITE16_DEVICE_HANDLER( k053244_word_w );
|
||||
void k053244_bankselect(const device_config *device, int bank); /* used by TMNT2, Asterix and Premier Soccer for ROM testing */
|
||||
void k053245_sprites_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect);
|
||||
void k053245_sprites_draw_lethal(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); /* for lethal enforcers */
|
||||
void k053245_clear_buffer(const device_config *device);
|
||||
void k053245_set_sprite_offs(const device_config *device, int offsx, int offsy);
|
||||
|
||||
|
||||
|
||||
/** Konami 053246 / 053247 / 055673 **/
|
||||
#define K055673_LAYOUT_GX 0
|
||||
#define K055673_LAYOUT_RNG 1
|
||||
#define K055673_LAYOUT_LE2 2
|
||||
#define K055673_LAYOUT_GX6 3
|
||||
|
||||
READ16_DEVICE_HANDLER( k055673_rom_word_r );
|
||||
READ16_DEVICE_HANDLER( k055673_GX6bpp_rom_word_r );
|
||||
|
||||
/*
|
||||
Callback procedures for non-standard shadows:
|
||||
|
||||
1) translate shadow code to the correct 2-bit form (0=off, 1-3=style)
|
||||
2) shift shadow code left by K053247_SHDSHIFT and add the K053247_CUSTOMSHADOW flag
|
||||
3) combine the result with sprite color
|
||||
*/
|
||||
#define K053247_CUSTOMSHADOW 0x20000000
|
||||
#define K053247_SHDSHIFT 20
|
||||
|
||||
READ8_DEVICE_HANDLER( k053247_r );
|
||||
WRITE8_DEVICE_HANDLER( k053247_w );
|
||||
READ16_DEVICE_HANDLER( k053247_word_r );
|
||||
WRITE16_DEVICE_HANDLER( k053247_word_w );
|
||||
READ32_DEVICE_HANDLER( k053247_long_r );
|
||||
WRITE32_DEVICE_HANDLER( k053247_long_w );
|
||||
WRITE16_DEVICE_HANDLER( k053247_reg_word_w ); // "OBJSET2" registers
|
||||
WRITE32_DEVICE_HANDLER( k053247_reg_long_w );
|
||||
|
||||
void k053247_sprites_draw(const device_config *device, bitmap_t *bitmap,const rectangle *cliprect);
|
||||
int k053247_read_register(const device_config *device, int regnum);
|
||||
void k053247_set_sprite_offs(const device_config *device, int offsx, int offsy);
|
||||
void k053247_wraparound_enable(const device_config *device, int status);
|
||||
void k05324x_set_z_rejection(const device_config *device, int zcode); // common to k053244/5
|
||||
void k053247_set_z_rejection(const device_config *device, int zcode); // common to k053246/7
|
||||
//void k053247_export_config(UINT16 **ram, gfx_element **gfx, void (**callback)(int *, int *, int *), int *dx, int *dy);
|
||||
|
||||
READ8_DEVICE_HANDLER( k053246_r );
|
||||
WRITE8_DEVICE_HANDLER( k053246_w );
|
||||
READ16_DEVICE_HANDLER( k053246_word_r );
|
||||
WRITE16_DEVICE_HANDLER( k053246_word_w );
|
||||
READ32_DEVICE_HANDLER( k053246_long_r );
|
||||
WRITE32_DEVICE_HANDLER( k053246_long_w );
|
||||
|
||||
void k053246_set_OBJCHA_line(const device_config *device, int state);
|
||||
int k053246_is_IRQ_enabled(const device_config *device);
|
||||
int k053246_read_register(const device_config *device, int regnum);
|
||||
|
||||
/** Konami 051316 **/
|
||||
/*
|
||||
The callback is passed:
|
||||
- code (range 00-FF, contents of the first tilemap RAM byte)
|
||||
- color (range 00-FF, contents of the first tilemap RAM byte). Note that bit 6
|
||||
seems to be hardcoded as flip X.
|
||||
The callback must put:
|
||||
- in code the resulting tile number
|
||||
- in color the resulting color index
|
||||
- if necessary, put flags for the TileMap code in the tile_info
|
||||
structure (e.g. TILE_FLIPX)
|
||||
*/
|
||||
|
||||
READ8_DEVICE_HANDLER( k051316_r );
|
||||
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);
|
||||
void k051316_set_offset(const device_config *device, int xoffs, int yoffs);
|
||||
|
||||
|
||||
/** Konami 053936 **/
|
||||
WRITE16_DEVICE_HANDLER( k053936_ctrl_w );
|
||||
READ16_DEVICE_HANDLER( k053936_ctrl_r ); // FIXME: this is probably unused... to be checked!
|
||||
WRITE16_DEVICE_HANDLER( k053936_linectrl_w );
|
||||
READ16_DEVICE_HANDLER( k053936_linectrl_r );
|
||||
void k053936_zoom_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, tilemap *tmap, int flags, UINT32 priority, int glfgreat_hack);
|
||||
void k053936_wraparound_enable(const device_config *device, int status);
|
||||
void k053936_set_offset(const device_config *device, int xoffs, int yoffs);
|
||||
|
||||
|
||||
/** Konami 053251 **/
|
||||
/*
|
||||
Note: k053251_w() automatically does a tilemap_mark_all_tiles_dirty(ALL_TILEMAPS)
|
||||
when some palette index changes. If ALL_TILEMAPS is too expensive, use
|
||||
k053251_set_tilemaps() to indicate which tilemap is associated with each index.
|
||||
*/
|
||||
WRITE8_DEVICE_HANDLER( k053251_w );
|
||||
WRITE16_DEVICE_HANDLER( k053251_lsb_w );
|
||||
WRITE16_DEVICE_HANDLER( k053251_msb_w );
|
||||
//enum { K053251_CI0=0,K053251_CI1,K053251_CI2,K053251_CI3,K053251_CI4 };
|
||||
int k053251_get_priority(const device_config *device, int ci);
|
||||
int k053251_get_palette_index(const device_config *device, int ci);
|
||||
void k053251_set_tilemaps(const device_config *device, tilemap *ci0,tilemap *ci1,tilemap *ci2,tilemap *ci3,tilemap *ci4);
|
||||
void k053251_postload_reset_indexes(const device_config *device);
|
||||
|
||||
|
||||
/** Konami 054000 **/
|
||||
WRITE8_DEVICE_HANDLER( k054000_w );
|
||||
READ8_DEVICE_HANDLER( k054000_r );
|
||||
WRITE16_DEVICE_HANDLER( k054000_lsb_w );
|
||||
READ16_DEVICE_HANDLER( k054000_lsb_r );
|
||||
|
||||
|
||||
/** Konami 051733 **/
|
||||
WRITE8_DEVICE_HANDLER( k051733_w );
|
||||
READ8_DEVICE_HANDLER( k051733_r );
|
||||
|
||||
|
||||
/** Konami 056832 **/
|
||||
void k056832_SetExtLinescroll(const device_config *device); /* Lethal Enforcers */
|
||||
|
||||
#define K056832_DRAW_FLAG_FORCE_XYSCROLL 0x00800000
|
||||
|
||||
READ16_DEVICE_HANDLER( k056832_ram_word_r );
|
||||
WRITE16_DEVICE_HANDLER( k056832_ram_word_w );
|
||||
READ16_DEVICE_HANDLER( k056832_ram_half_word_r );
|
||||
WRITE16_DEVICE_HANDLER( k056832_ram_half_word_w );
|
||||
READ16_DEVICE_HANDLER( k056832_5bpp_rom_word_r );
|
||||
READ32_DEVICE_HANDLER( k056832_5bpp_rom_long_r );
|
||||
READ32_DEVICE_HANDLER( k056832_6bpp_rom_long_r );
|
||||
READ16_DEVICE_HANDLER( k056832_rom_word_r );
|
||||
READ16_DEVICE_HANDLER( k056832_mw_rom_word_r );
|
||||
READ16_DEVICE_HANDLER( k056832_bishi_rom_word_r );
|
||||
READ16_DEVICE_HANDLER( k056832_old_rom_word_r );
|
||||
READ16_DEVICE_HANDLER( k056832_rom_word_8000_r );
|
||||
WRITE16_DEVICE_HANDLER( k056832_word_w ); // "VRAM" registers
|
||||
WRITE16_DEVICE_HANDLER( k056832_b_word_w );
|
||||
READ8_DEVICE_HANDLER( k056832_ram_code_lo_r );
|
||||
READ8_DEVICE_HANDLER( k056832_ram_code_hi_r );
|
||||
READ8_DEVICE_HANDLER( k056832_ram_attr_lo_r );
|
||||
READ8_DEVICE_HANDLER( k056832_ram_attr_hi_r );
|
||||
WRITE8_DEVICE_HANDLER( k056832_ram_code_lo_w );
|
||||
WRITE8_DEVICE_HANDLER( k056832_ram_code_hi_w );
|
||||
WRITE8_DEVICE_HANDLER( k056832_ram_attr_lo_w );
|
||||
WRITE8_DEVICE_HANDLER( k056832_ram_attr_hi_w );
|
||||
WRITE8_DEVICE_HANDLER( k056832_w );
|
||||
WRITE8_DEVICE_HANDLER( k056832_b_w );
|
||||
void k056832_mark_plane_dirty(const device_config *device, int num);
|
||||
void k056832_MarkAllTilemapsDirty(const device_config *device);
|
||||
void k056832_tilemap_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int num, UINT32 flags, UINT32 priority);
|
||||
void k056832_tilemap_draw_dj(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority);
|
||||
void k056832_set_LayerAssociation(const device_config *device, int status);
|
||||
int k056832_get_LayerAssociation(const device_config *device);
|
||||
void k056832_set_LayerOffset(const device_config *device, int layer, int offsx, int offsy);
|
||||
void k056832_set_LSRAMPage(const device_config *device, int logical_page, int physical_page, int physical_offset);
|
||||
void k056832_set_UpdateMode(const device_config *device, int mode);
|
||||
void k056832_linemap_enable(const device_config *device, int enable);
|
||||
int k056832_is_IRQ_enabled(const device_config *device, int irqline);
|
||||
void k056832_read_AVAC(const device_config *device, int *mode, int *data);
|
||||
int k056832_read_register(const device_config *device, int regnum);
|
||||
int k056832_get_current_rambank(const device_config *device);
|
||||
int k056832_get_lookup(const device_config *device, int bits); /* Asterix */
|
||||
void k056832_set_tile_bank(const device_config *device, int bank); /* Asterix */
|
||||
|
||||
READ32_DEVICE_HANDLER( k056832_ram_long_r );
|
||||
READ32_DEVICE_HANDLER( k056832_rom_long_r );
|
||||
WRITE32_DEVICE_HANDLER( k056832_ram_long_w );
|
||||
WRITE32_DEVICE_HANDLER( k056832_long_w );
|
||||
WRITE32_DEVICE_HANDLER( k056832_b_long_w );
|
||||
|
||||
/* bit depths for the 56832 */
|
||||
#define K056832_BPP_4 0
|
||||
#define K056832_BPP_5 1
|
||||
#define K056832_BPP_6 2
|
||||
#define K056832_BPP_8 3
|
||||
#define K056832_BPP_4dj 4
|
||||
#define K056832_BPP_8LE 5
|
||||
|
||||
/** Konami 055555 **/
|
||||
void k055555_write_reg(const device_config *device, UINT8 regnum, UINT8 regdat);
|
||||
WRITE16_DEVICE_HANDLER( k055555_word_w );
|
||||
WRITE32_DEVICE_HANDLER( k055555_long_w );
|
||||
int k055555_read_register(const device_config *device, int regnum);
|
||||
int k055555_get_palette_index(const device_config *device, int idx);
|
||||
|
||||
|
||||
/* K055555 registers */
|
||||
/* priority inputs */
|
||||
#define K55_PALBASE_BG 0 // background palette
|
||||
#define K55_CONTROL 1 // control register
|
||||
#define K55_COLSEL_0 2 // layer A, B color depth
|
||||
#define K55_COLSEL_1 3 // layer C, D color depth
|
||||
#define K55_COLSEL_2 4 // object, S1 color depth
|
||||
#define K55_COLSEL_3 5 // S2, S3 color depth
|
||||
|
||||
#define K55_PRIINP_0 7 // layer A pri 0
|
||||
#define K55_PRIINP_1 8 // layer A pri 1
|
||||
#define K55_PRIINP_2 9 // layer A "COLPRI"
|
||||
#define K55_PRIINP_3 10 // layer B pri 0
|
||||
#define K55_PRIINP_4 11 // layer B pri 1
|
||||
#define K55_PRIINP_5 12 // layer B "COLPRI"
|
||||
#define K55_PRIINP_6 13 // layer C pri
|
||||
#define K55_PRIINP_7 14 // layer D pri
|
||||
#define K55_PRIINP_8 15 // OBJ pri
|
||||
#define K55_PRIINP_9 16 // sub 1 (GP:PSAC) pri
|
||||
#define K55_PRIINP_10 17 // sub 2 (GX:PSAC) pri
|
||||
#define K55_PRIINP_11 18 // sub 3 pri
|
||||
|
||||
#define K55_OINPRI_ON 19 // object priority bits selector
|
||||
|
||||
#define K55_PALBASE_A 23 // layer A palette
|
||||
#define K55_PALBASE_B 24 // layer B palette
|
||||
#define K55_PALBASE_C 25 // layer C palette
|
||||
#define K55_PALBASE_D 26 // layer D palette
|
||||
#define K55_PALBASE_OBJ 27 // OBJ palette
|
||||
#define K55_PALBASE_SUB1 28 // SUB1 palette
|
||||
#define K55_PALBASE_SUB2 29 // SUB2 palette
|
||||
#define K55_PALBASE_SUB3 30 // SUB3 palette
|
||||
|
||||
#define K55_BLEND_ENABLES 33 // blend enables for tilemaps
|
||||
#define K55_VINMIX_ON 34 // additional blend enables for tilemaps
|
||||
#define K55_OSBLEND_ENABLES 35 // obj/sub blend enables
|
||||
#define K55_OSBLEND_ON 36 // not sure, related to obj/sub blend
|
||||
|
||||
#define K55_SHAD1_PRI 37 // shadow/highlight 1 priority
|
||||
#define K55_SHAD2_PRI 38 // shadow/highlight 2 priority
|
||||
#define K55_SHAD3_PRI 39 // shadow/highlight 3 priority
|
||||
#define K55_SHD_ON 40 // shadow/highlight
|
||||
#define K55_SHD_PRI_SEL 41 // shadow/highlight
|
||||
|
||||
#define K55_VBRI 42 // VRAM layer brightness enable
|
||||
#define K55_OSBRI 43 // obj/sub brightness enable, part 1
|
||||
#define K55_OSBRI_ON 44 // obj/sub brightness enable, part 2
|
||||
#define K55_INPUT_ENABLES 45 // input enables
|
||||
|
||||
/* bit masks for the control register */
|
||||
#define K55_CTL_GRADDIR 0x01 // 0=vertical, 1=horizontal
|
||||
#define K55_CTL_GRADENABLE 0x02 // 0=BG is base color only, 1=gradient
|
||||
#define K55_CTL_FLIPPRI 0x04 // 0=standard Konami priority, 1=reverse
|
||||
#define K55_CTL_SDSEL 0x08 // 0=normal shadow timing, 1=(not used by GX)
|
||||
|
||||
/* bit masks for the input enables */
|
||||
#define K55_INP_VRAM_A 0x01
|
||||
#define K55_INP_VRAM_B 0x02
|
||||
#define K55_INP_VRAM_C 0x04
|
||||
#define K55_INP_VRAM_D 0x08
|
||||
#define K55_INP_OBJ 0x10
|
||||
#define K55_INP_SUB1 0x20
|
||||
#define K55_INP_SUB2 0x40
|
||||
#define K55_INP_SUB3 0x80
|
||||
|
||||
|
||||
/** Konami 054338 **/
|
||||
/* mixer/alpha blender */
|
||||
|
||||
WRITE16_DEVICE_HANDLER( k054338_word_w ); // "CLCT" registers
|
||||
WRITE32_DEVICE_HANDLER( k054338_long_w );
|
||||
int k054338_read_register(const device_config *device, int reg);
|
||||
void k054338_update_all_shadows(const device_config *device, int rushingheroes_hack); // called at the beginning of VIDEO_UPDATE()
|
||||
void k054338_fill_solid_bg(const device_config *device, bitmap_t *bitmap); // solid backcolor fill
|
||||
void k054338_fill_backcolor(const device_config *device, bitmap_t *bitmap, int mode); // unified fill, 0=solid, 1=gradient
|
||||
int k054338_set_alpha_level(const device_config *device, int pblend); // blend style 0-2
|
||||
void k054338_invert_alpha(const device_config *device, int invert); // 0=0x00(invis)-0x1f(solid), 1=0x1f(invis)-0x00(solod)
|
||||
//void K054338_export_config(const device_config *device, int **shdRGB);
|
||||
|
||||
#define K338_REG_BGC_R 0
|
||||
#define K338_REG_BGC_GB 1
|
||||
#define K338_REG_SHAD1R 2
|
||||
#define K338_REG_BRI3 11
|
||||
#define K338_REG_PBLEND 13
|
||||
#define K338_REG_CONTROL 15
|
||||
|
||||
#define K338_CTL_KILL 0x01 /* 0 = no video output, 1 = enable */
|
||||
#define K338_CTL_MIXPRI 0x02
|
||||
#define K338_CTL_SHDPRI 0x04
|
||||
#define K338_CTL_BRTPRI 0x08
|
||||
#define K338_CTL_WAILSL 0x10
|
||||
#define K338_CTL_CLIPSL 0x20
|
||||
|
||||
|
||||
/** Konami 053250 **/
|
||||
WRITE16_DEVICE_HANDLER( k053250_0_w );
|
||||
READ16_DEVICE_HANDLER( k053250_0_r );
|
||||
WRITE16_DEVICE_HANDLER( k053250_0_ram_w );
|
||||
READ16_DEVICE_HANDLER( k053250_0_ram_r );
|
||||
READ16_DEVICE_HANDLER( k053250_0_rom_r );
|
||||
WRITE16_DEVICE_HANDLER( k053250_1_w );
|
||||
READ16_DEVICE_HANDLER( k053250_1_r );
|
||||
WRITE16_DEVICE_HANDLER( k053250_1_ram_w );
|
||||
READ16_DEVICE_HANDLER( k053250_1_ram_r );
|
||||
READ16_DEVICE_HANDLER( k053250_1_rom_r );
|
||||
|
||||
// K053250_draw() control flags
|
||||
#define K053250_WRAP500 0x01
|
||||
#define K053250_OVERDRIVE 0x02
|
||||
|
||||
void k053250_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int colorbase, int flags, int pri);
|
||||
void k053250_set_LayerOffset(const device_config *device, int offsx, int offsy);
|
||||
void k053250_unpack_pixels(running_machine *machine, const char *region);
|
||||
void k053250_dma(const device_config *device, int limiter);
|
||||
|
||||
|
||||
/** Konami 053252 **/
|
||||
/* CRT and interrupt control unit */
|
||||
READ16_DEVICE_HANDLER( k053252_word_r ); // CCU registers
|
||||
WRITE16_DEVICE_HANDLER( k053252_word_w );
|
||||
WRITE32_DEVICE_HANDLER( k053252_long_w );
|
||||
|
||||
|
||||
// debug handlers
|
||||
READ16_DEVICE_HANDLER( k056832_word_r ); // VACSET
|
||||
READ16_DEVICE_HANDLER( k056832_b_word_r ); // VSCCS (board dependent)
|
||||
READ16_DEVICE_HANDLER( k053246_reg_word_r ); // OBJSET1
|
||||
READ16_DEVICE_HANDLER( k053247_reg_word_r ); // OBJSET2
|
||||
READ16_DEVICE_HANDLER( k053251_lsb_r ); // PCU1
|
||||
READ16_DEVICE_HANDLER( k053251_msb_r ); // PCU1
|
||||
READ16_DEVICE_HANDLER( k055555_word_r ); // PCU2
|
||||
READ16_DEVICE_HANDLER( k054338_word_r ); // CLTC
|
||||
|
||||
READ32_DEVICE_HANDLER( k056832_long_r ); // VACSET
|
||||
READ32_DEVICE_HANDLER( k053247_reg_long_r ); // OBJSET2
|
||||
READ32_DEVICE_HANDLER( k055555_long_r ); // PCU2
|
||||
|
||||
READ16_DEVICE_HANDLER( k053244_reg_word_r ); // OBJSET0
|
||||
|
||||
|
||||
/** Konami 056800 **/
|
||||
READ32_DEVICE_HANDLER( K056800_host_r );
|
||||
WRITE32_DEVICE_HANDLER( K056800_host_w );
|
||||
READ16_DEVICE_HANDLER( K056800_sound_r );
|
||||
WRITE16_DEVICE_HANDLER( K056800_sound_w );
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "driver.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
|
||||
UINT8 *labyrunr_videoram1,*labyrunr_videoram2,*labyrunr_scrollram;
|
||||
static tilemap *layer0, *layer1;
|
||||
@ -68,51 +68,61 @@ static void set_pens(running_machine *machine)
|
||||
|
||||
static TILE_GET_INFO( get_tile_info0 )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(machine, "k007121");
|
||||
UINT8 ctrl_3 = k007121_ctrlram_r(k007121, 3);
|
||||
UINT8 ctrl_4 = k007121_ctrlram_r(k007121, 4);
|
||||
UINT8 ctrl_5 = k007121_ctrlram_r(k007121, 5);
|
||||
UINT8 ctrl_6 = k007121_ctrlram_r(k007121, 6);
|
||||
int attr = labyrunr_videoram1[tile_index];
|
||||
int code = labyrunr_videoram1[tile_index + 0x400];
|
||||
int bit0 = (K007121_ctrlram[0][0x05] >> 0) & 0x03;
|
||||
int bit1 = (K007121_ctrlram[0][0x05] >> 2) & 0x03;
|
||||
int bit2 = (K007121_ctrlram[0][0x05] >> 4) & 0x03;
|
||||
int bit3 = (K007121_ctrlram[0][0x05] >> 6) & 0x03;
|
||||
int bit0 = (ctrl_5 >> 0) & 0x03;
|
||||
int bit1 = (ctrl_5 >> 2) & 0x03;
|
||||
int bit2 = (ctrl_5 >> 4) & 0x03;
|
||||
int bit3 = (ctrl_5 >> 6) & 0x03;
|
||||
int bank = ((attr & 0x80) >> 7) |
|
||||
((attr >> (bit0+2)) & 0x02) |
|
||||
((attr >> (bit1+1)) & 0x04) |
|
||||
((attr >> (bit2 )) & 0x08) |
|
||||
((attr >> (bit3-1)) & 0x10) |
|
||||
((K007121_ctrlram[0][0x03] & 0x01) << 5);
|
||||
int mask = (K007121_ctrlram[0][0x04] & 0xf0) >> 4;
|
||||
((ctrl_3 & 0x01) << 5);
|
||||
int mask = (ctrl_4 & 0xf0) >> 4;
|
||||
|
||||
bank = (bank & ~(mask << 1)) | ((K007121_ctrlram[0][0x04] & mask) << 1);
|
||||
bank = (bank & ~(mask << 1)) | ((ctrl_4 & mask) << 1);
|
||||
|
||||
SET_TILE_INFO(
|
||||
0,
|
||||
code+bank*256,
|
||||
((K007121_ctrlram[0][6]&0x30)*2+16)+(attr&7),
|
||||
((ctrl_6 & 0x30) * 2 + 16)+(attr & 7),
|
||||
0);
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( get_tile_info1 )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(machine, "k007121");
|
||||
UINT8 ctrl_3 = k007121_ctrlram_r(k007121, 3);
|
||||
UINT8 ctrl_4 = k007121_ctrlram_r(k007121, 4);
|
||||
UINT8 ctrl_5 = k007121_ctrlram_r(k007121, 5);
|
||||
UINT8 ctrl_6 = k007121_ctrlram_r(k007121, 6);
|
||||
int attr = labyrunr_videoram2[tile_index];
|
||||
int code = labyrunr_videoram2[tile_index + 0x400];
|
||||
int bit0 = (K007121_ctrlram[0][0x05] >> 0) & 0x03;
|
||||
int bit1 = (K007121_ctrlram[0][0x05] >> 2) & 0x03;
|
||||
int bit2 = (K007121_ctrlram[0][0x05] >> 4) & 0x03;
|
||||
int bit3 = (K007121_ctrlram[0][0x05] >> 6) & 0x03;
|
||||
int bit0 = (ctrl_5 >> 0) & 0x03;
|
||||
int bit1 = (ctrl_5 >> 2) & 0x03;
|
||||
int bit2 = (ctrl_5 >> 4) & 0x03;
|
||||
int bit3 = (ctrl_5 >> 6) & 0x03;
|
||||
int bank = ((attr & 0x80) >> 7) |
|
||||
((attr >> (bit0+2)) & 0x02) |
|
||||
((attr >> (bit1+1)) & 0x04) |
|
||||
((attr >> (bit2 )) & 0x08) |
|
||||
((attr >> (bit3-1)) & 0x10) |
|
||||
((K007121_ctrlram[0][0x03] & 0x01) << 5);
|
||||
int mask = (K007121_ctrlram[0][0x04] & 0xf0) >> 4;
|
||||
((ctrl_3 & 0x01) << 5);
|
||||
int mask = (ctrl_4 & 0xf0) >> 4;
|
||||
|
||||
bank = (bank & ~(mask << 1)) | ((K007121_ctrlram[0][0x04] & mask) << 1);
|
||||
bank = (bank & ~(mask << 1)) | ((ctrl_4 & mask) << 1);
|
||||
|
||||
SET_TILE_INFO(
|
||||
0,
|
||||
code+bank*256,
|
||||
((K007121_ctrlram[0][6]&0x30)*2+16)+(attr&7),
|
||||
((ctrl_6 & 0x30) * 2 + 16) + (attr & 7),
|
||||
0);
|
||||
}
|
||||
|
||||
@ -171,6 +181,8 @@ WRITE8_HANDLER( labyrunr_vram2_w )
|
||||
|
||||
VIDEO_UPDATE( labyrunr )
|
||||
{
|
||||
const device_config *k007121 = devtag_get_device(screen->machine, "k007121");
|
||||
UINT8 ctrl_0 = k007121_ctrlram_r(k007121, 0);
|
||||
rectangle finalclip0, finalclip1;
|
||||
|
||||
set_pens(screen->machine);
|
||||
@ -178,7 +190,7 @@ VIDEO_UPDATE( labyrunr )
|
||||
bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
|
||||
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
|
||||
|
||||
if(~K007121_ctrlram[0][3] & 0x20)
|
||||
if(~k007121_ctrlram_r(k007121, 3) & 0x20)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -188,20 +200,20 @@ VIDEO_UPDATE( labyrunr )
|
||||
sect_rect(&finalclip0, cliprect);
|
||||
sect_rect(&finalclip1, cliprect);
|
||||
|
||||
tilemap_set_scrollx(layer0,0,K007121_ctrlram[0][0x00] - 40);
|
||||
tilemap_set_scrollx(layer0,0,ctrl_0 - 40);
|
||||
tilemap_set_scrollx(layer1,0,0);
|
||||
|
||||
for(i = 0; i < 32; i++)
|
||||
{
|
||||
/* enable colscroll */
|
||||
if((K007121_ctrlram[0][1] & 6) == 6) // it's probably just one bit, but it's only used once in the game so I don't know which it's
|
||||
tilemap_set_scrolly(layer0,(i+2) & 0x1f,K007121_ctrlram[0][0x02] + labyrunr_scrollram[i]);
|
||||
if((k007121_ctrlram_r(k007121, 1) & 6) == 6) // it's probably just one bit, but it's only used once in the game so I don't know which it's
|
||||
tilemap_set_scrolly(layer0,(i+2) & 0x1f,k007121_ctrlram_r(k007121, 2) + labyrunr_scrollram[i]);
|
||||
else
|
||||
tilemap_set_scrolly(layer0,(i+2) & 0x1f,K007121_ctrlram[0][0x02]);
|
||||
tilemap_set_scrolly(layer0,(i+2) & 0x1f,k007121_ctrlram_r(k007121, 2));
|
||||
}
|
||||
|
||||
tilemap_draw(bitmap,&finalclip0,layer0,TILEMAP_DRAW_OPAQUE,0);
|
||||
K007121_sprites_draw(0,bitmap,cliprect,screen->machine->gfx,screen->machine->colortable,screen->machine->generic.spriteram.u8,(K007121_ctrlram[0][6]&0x30)*2,40,0,(K007121_ctrlram[0][3] & 0x40) >> 5);
|
||||
k007121_sprites_draw(k007121,bitmap,cliprect,screen->machine->gfx[0],screen->machine->colortable,screen->machine->generic.spriteram.u8,(k007121_ctrlram_r(k007121, 6) & 0x30) * 2, 40,0,(k007121_ctrlram_r(k007121, 3) & 0x40) >> 5);
|
||||
/* we ignore the transparency because layer1 is drawn only at the top of the screen also covering sprites */
|
||||
tilemap_draw(bitmap,&finalclip1,layer1,TILEMAP_DRAW_OPAQUE,0);
|
||||
}
|
||||
@ -214,12 +226,12 @@ VIDEO_UPDATE( labyrunr )
|
||||
finalclip0.min_y = finalclip1.min_y = cliprect->min_y;
|
||||
finalclip0.max_y = finalclip1.max_y = cliprect->max_y;
|
||||
|
||||
if(K007121_ctrlram[0][1] & 1)
|
||||
if(k007121_ctrlram_r(k007121, 1) & 1)
|
||||
{
|
||||
finalclip0.min_x = cliprect->max_x - K007121_ctrlram[0][0x00] + 8;
|
||||
finalclip0.min_x = cliprect->max_x - ctrl_0 + 8;
|
||||
finalclip0.max_x = cliprect->max_x;
|
||||
|
||||
if(K007121_ctrlram[0][0x00] >= 40)
|
||||
if(ctrl_0 >= 40)
|
||||
{
|
||||
finalclip1.min_x = cliprect->min_x;
|
||||
}
|
||||
@ -227,15 +239,15 @@ VIDEO_UPDATE( labyrunr )
|
||||
{
|
||||
use_clip3[0] = 1;
|
||||
|
||||
finalclip1.min_x = 40 - K007121_ctrlram[0][0x00];
|
||||
finalclip1.min_x = 40 - ctrl_0;
|
||||
}
|
||||
|
||||
finalclip1.max_x = cliprect->max_x - K007121_ctrlram[0][0x00] + 8;
|
||||
finalclip1.max_x = cliprect->max_x - ctrl_0 + 8;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if(K007121_ctrlram[0][0x00] >= 40)
|
||||
if(ctrl_0 >= 40)
|
||||
{
|
||||
finalclip0.min_x = cliprect->min_x;
|
||||
}
|
||||
@ -243,12 +255,12 @@ VIDEO_UPDATE( labyrunr )
|
||||
{
|
||||
use_clip3[1] = 1;
|
||||
|
||||
finalclip0.min_x = 40 - K007121_ctrlram[0][0x00];
|
||||
finalclip0.min_x = 40 - ctrl_0;
|
||||
}
|
||||
|
||||
finalclip0.max_x = cliprect->max_x - K007121_ctrlram[0][0x00] + 8;
|
||||
finalclip0.max_x = cliprect->max_x - ctrl_0 + 8;
|
||||
|
||||
finalclip1.min_x = cliprect->max_x - K007121_ctrlram[0][0x00] + 8;
|
||||
finalclip1.min_x = cliprect->max_x - ctrl_0 + 8;
|
||||
finalclip1.max_x = cliprect->max_x;
|
||||
}
|
||||
|
||||
@ -257,11 +269,11 @@ VIDEO_UPDATE( labyrunr )
|
||||
finalclip3.min_y = cliprect->min_y;
|
||||
finalclip3.max_y = cliprect->max_y;
|
||||
finalclip3.min_x = cliprect->min_x;
|
||||
finalclip3.max_x = 40 - K007121_ctrlram[0][0x00] - 8;
|
||||
finalclip3.max_x = 40 - ctrl_0 - 8;
|
||||
}
|
||||
|
||||
tilemap_set_scrollx(layer0,0,K007121_ctrlram[0][0x00] - 40);
|
||||
tilemap_set_scrollx(layer1,0,K007121_ctrlram[0][0x00] - 40);
|
||||
tilemap_set_scrollx(layer0,0,ctrl_0 - 40);
|
||||
tilemap_set_scrollx(layer1,0,ctrl_0 - 40);
|
||||
|
||||
tilemap_draw(bitmap,&finalclip0,layer0,0,1);
|
||||
if(use_clip3[0]) tilemap_draw(bitmap,&finalclip3,layer0,0,1);
|
||||
@ -269,7 +281,7 @@ VIDEO_UPDATE( labyrunr )
|
||||
tilemap_draw(bitmap,&finalclip1,layer1,0,1);
|
||||
if(use_clip3[1]) tilemap_draw(bitmap,&finalclip3,layer1,0,1);
|
||||
|
||||
K007121_sprites_draw(0,bitmap,cliprect,screen->machine->gfx,screen->machine->colortable,screen->machine->generic.spriteram.u8,(K007121_ctrlram[0][6]&0x30)*2,40,0,(K007121_ctrlram[0][3] & 0x40) >> 5);
|
||||
k007121_sprites_draw(k007121,bitmap,cliprect,screen->machine->gfx[0],screen->machine->colortable,screen->machine->generic.spriteram.u8,(k007121_ctrlram_r(k007121, 6) & 0x30) * 2,40,0,(k007121_ctrlram_r(k007121, 3) & 0x40) >> 5);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Super Slams - video, see notes in driver file */
|
||||
|
||||
#include "driver.h"
|
||||
#include "video/konamiic.h"
|
||||
#include "video/konicdev.h"
|
||||
|
||||
|
||||
UINT16 *suprslam_screen_videoram, *suprslam_bg_videoram,*suprslam_sp_videoram, *suprslam_spriteram;
|
||||
@ -142,16 +142,15 @@ VIDEO_START( suprslam )
|
||||
suprslam_bg_tilemap = tilemap_create(machine, get_suprslam_bg_tile_info,tilemap_scan_rows, 16, 16,64,64);
|
||||
suprslam_screen_tilemap = tilemap_create(machine, get_suprslam_tile_info,tilemap_scan_rows, 8, 8,64,32);
|
||||
|
||||
K053936_wraparound_enable(0, 1);
|
||||
K053936_set_offset(0, -45, -21);
|
||||
|
||||
tilemap_set_transparent_pen(suprslam_screen_tilemap,15);
|
||||
}
|
||||
|
||||
VIDEO_UPDATE( suprslam )
|
||||
{
|
||||
const device_config *k053936 = devtag_get_device(screen->machine, "k053936");
|
||||
|
||||
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
|
||||
K053936_0_zoom_draw(bitmap,cliprect,suprslam_bg_tilemap,0,0,1);
|
||||
k053936_zoom_draw(k053936, bitmap,cliprect,suprslam_bg_tilemap,0,0,1);
|
||||
draw_sprites(screen->machine, bitmap, cliprect);
|
||||
tilemap_draw(bitmap,cliprect,suprslam_screen_tilemap,0,0);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user