Modernized two more konicdev devices: 053251 and 054338. [Osso]

This commit is contained in:
Scott Stone 2013-07-10 02:21:06 +00:00
parent 1afce6e1e8
commit db905cfc6e
28 changed files with 445 additions and 527 deletions

View File

@ -183,7 +183,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, asterix_state )
AM_RANGE(0x380200, 0x380203) AM_READ8(asterix_sound_r, 0x00ff) AM_DEVWRITE8("k053260", k053260_device, k053260_w, 0x00ff)
AM_RANGE(0x380300, 0x380301) AM_WRITE(sound_irq_w)
AM_RANGE(0x380400, 0x380401) AM_WRITE(asterix_spritebank_w)
AM_RANGE(0x380500, 0x38051f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x380500, 0x38051f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
AM_RANGE(0x380600, 0x380601) AM_NOP // Watchdog
AM_RANGE(0x380700, 0x380707) AM_DEVWRITE("k056832", k056832_device, b_word_w)
AM_RANGE(0x380800, 0x380803) AM_WRITE(protection_w)

View File

@ -150,7 +150,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, bishi_state )
AM_RANGE(0x820000, 0x820001) AM_WRITENOP // lamps (see lamp test in service menu)
AM_RANGE(0x830000, 0x83003f) AM_DEVWRITE("k056832", k056832_device, word_w)
AM_RANGE(0x840000, 0x840007) AM_DEVWRITE("k056832", k056832_device, b_word_w) // VSCCS
AM_RANGE(0x850000, 0x85001f) AM_DEVWRITE_LEGACY("k054338", k054338_word_w) // CLTC
AM_RANGE(0x850000, 0x85001f) AM_DEVWRITE("k054338", k054338_device, word_w) // CLTC
AM_RANGE(0x870000, 0x8700ff) AM_DEVWRITE_LEGACY("k055555", k055555_word_w) // PCU2
AM_RANGE(0x880000, 0x880003) AM_DEVREADWRITE8("ymz", ymz280b_device, read, write, 0xff00)
AM_RANGE(0xa00000, 0xa01fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w) // Graphic planes

View File

@ -126,7 +126,7 @@ static ADDRESS_MAP_START( dbz_map, AS_PROGRAM, 16, dbz_state )
AM_RANGE(0x4f0000, 0x4f0001) AM_WRITE(dbz_sound_command_w)
AM_RANGE(0x4f4000, 0x4f4001) AM_WRITE(dbz_sound_cause_nmi)
AM_RANGE(0x4f8000, 0x4f801f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0xff00) // 251 #1
AM_RANGE(0x4fc000, 0x4fc01f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w) // 251 #2
AM_RANGE(0x4fc000, 0x4fc01f) AM_DEVWRITE("k053251", k053251_device, lsb_w) // 251 #2
AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(dbz_bg2_videoram_w) AM_SHARE("bg2_videoram")
AM_RANGE(0x508000, 0x509fff) AM_RAM_WRITE(dbz_bg1_videoram_w) AM_SHARE("bg1_videoram")

View File

@ -166,7 +166,7 @@ static ADDRESS_MAP_START( gijoe_map, AS_PROGRAM, 16, gijoe_state )
AM_RANGE(0x170000, 0x170001) AM_WRITENOP // Watchdog
AM_RANGE(0x180000, 0x18ffff) AM_RAM AM_SHARE("workram") // Main RAM. Spec. 180000-1803ff, 180400-187fff
AM_RANGE(0x190000, 0x190fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
AM_RANGE(0x1a0000, 0x1a001f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x1a0000, 0x1a001f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
AM_RANGE(0x1b0000, 0x1b003f) AM_DEVWRITE("k056832", k056832_device, word_w)
AM_RANGE(0x1c000c, 0x1c000d) AM_WRITE(sound_cmd_w)
AM_RANGE(0x1c0014, 0x1c0015) AM_READ(sound_status_r)
@ -181,7 +181,7 @@ static ADDRESS_MAP_START( gijoe_map, AS_PROGRAM, 16, gijoe_state )
#if JOE_DEBUG
AM_RANGE(0x110000, 0x110007) AM_DEVREAD_LEGACY("k053246", k053246_reg_word_r)
AM_RANGE(0x160000, 0x160007) AM_DEVREAD("k056832", k056832_device, b_word_r)
AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREAD_LEGACY("k053251", k053251_lsb_r)
AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREAD("k053251", k053251_device, lsb_r)
AM_RANGE(0x1b0000, 0x1b003f) AM_DEVREAD("k056832", k056832_device, word_r)
#endif
ADDRESS_MAP_END

View File

@ -258,8 +258,8 @@ static ADDRESS_MAP_START( moo_map, AS_PROGRAM, 16, moo_state )
AM_RANGE(0x0c2000, 0x0c2007) AM_DEVWRITE_LEGACY("k053246", k053246_word_w)
AM_RANGE(0x0c4000, 0x0c4001) AM_DEVREAD_LEGACY("k053246", k053246_word_r)
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE_LEGACY("k054338", k054338_word_w) /* K054338 alpha blending engine */
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE("k054338", k054338_device, word_w) /* K054338 alpha blending engine */
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
AM_RANGE(0x0ce000, 0x0ce01f) AM_WRITE(moo_prot_w)
AM_RANGE(0x0d0000, 0x0d001f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff) /* CCU regs (ignored) */
AM_RANGE(0x0d4000, 0x0d4001) AM_WRITE(sound_irq_w)
@ -283,8 +283,8 @@ static ADDRESS_MAP_START( moo_map, AS_PROGRAM, 16, moo_state )
#if MOO_DEBUG
AM_RANGE(0x0c0000, 0x0c003f) AM_DEVREAD("k056832", k056832_device, word_r)
AM_RANGE(0x0c2000, 0x0c2007) AM_DEVREAD_LEGACY("k053246", k053246_reg_word_r)
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVREAD_LEGACY("k054338", k054338_word_r)
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVREAD_LEGACY("k053251", k053251_lsb_r)
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVREAD("k054338", k054338_device, word_r)
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVREAD("k053251", k053251_device, lsb_r)
AM_RANGE(0x0d8000, 0x0d8007) AM_DEVREAD("k056832", k056832_device, b_word_r)
#endif
ADDRESS_MAP_END
@ -295,8 +295,8 @@ static ADDRESS_MAP_START( moobl_map, AS_PROGRAM, 16, moo_state )
AM_RANGE(0x0c2000, 0x0c2007) AM_DEVWRITE_LEGACY("k053246", k053246_word_w)
AM_RANGE(0x0c2f00, 0x0c2f01) AM_READNOP /* heck if I know, but it's polled constantly */
AM_RANGE(0x0c4000, 0x0c4001) AM_DEVREAD_LEGACY("k053246", k053246_word_r)
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE_LEGACY("k054338", k054338_word_w) /* K054338 alpha blending engine */
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE("k054338", k054338_device, word_w) /* K054338 alpha blending engine */
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
AM_RANGE(0x0d0000, 0x0d001f) AM_WRITEONLY /* CCU regs (ignored) */
AM_RANGE(0x0d6ffc, 0x0d6ffd) AM_WRITE(moobl_oki_bank_w)
AM_RANGE(0x0d6ffe, 0x0d6fff) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
@ -323,8 +323,8 @@ static ADDRESS_MAP_START( bucky_map, AS_PROGRAM, 16, moo_state )
AM_RANGE(0x0c0000, 0x0c003f) AM_DEVWRITE("k056832", k056832_device, word_w)
AM_RANGE(0x0c2000, 0x0c2007) AM_DEVWRITE_LEGACY("k053246", k053246_word_w)
AM_RANGE(0x0c4000, 0x0c4001) AM_DEVREAD_LEGACY("k053246", k053246_word_r)
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE_LEGACY("k054338", k054338_word_w) /* K054338 alpha blending engine */
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE("k054338", k054338_device, word_w) /* K054338 alpha blending engine */
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
AM_RANGE(0x0ce000, 0x0ce01f) AM_WRITE(moo_prot_w)
AM_RANGE(0x0d0000, 0x0d001f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff) /* CCU regs (ignored) */
AM_RANGE(0x0d2000, 0x0d20ff) AM_DEVREADWRITE("k054000", k054000_device, lsb_r, lsb_w)
@ -348,8 +348,8 @@ static ADDRESS_MAP_START( bucky_map, AS_PROGRAM, 16, moo_state )
#if MOO_DEBUG
AM_RANGE(0x0c0000, 0x0c003f) AM_DEVREAD("k056832", k056832_device, word_r)
AM_RANGE(0x0c2000, 0x0c2007) AM_DEVREAD_LEGACY("k053246", k053246_reg_word_r)
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVREAD_LEGACY("k054338", k054338_word_r)
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVREAD_LEGACY("k053251", k053251_lsb_r)
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVREAD("k054338", k054338_device, word_r)
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVREAD("k053251", k053251_device, lsb_r)
AM_RANGE(0x0d8000, 0x0d8007) AM_DEVREAD("k056832", k056832_device, b_word_r)
#endif
ADDRESS_MAP_END

View File

@ -166,7 +166,7 @@ static ADDRESS_MAP_START( overdriv_master_map, AS_PROGRAM, 16, overdriv_state )
AM_RANGE(0x180000, 0x180001) AM_READ_PORT("PADDLE")
AM_RANGE(0x1c0000, 0x1c001f) AM_DEVWRITE8("k051316_1", k051316_device, ctrl_w, 0xff00)
AM_RANGE(0x1c8000, 0x1c801f) AM_DEVWRITE8("k051316_2", k051316_device, ctrl_w, 0xff00)
AM_RANGE(0x1d0000, 0x1d001f) AM_DEVWRITE_LEGACY("k053251", k053251_msb_w)
AM_RANGE(0x1d0000, 0x1d001f) AM_DEVWRITE("k053251", k053251_device, msb_w)
AM_RANGE(0x1d8000, 0x1d8003) AM_READ8(overdriv_1_sound_r, 0x00ff) AM_DEVWRITE8("k053260_1", k053260_device, k053260_w, 0x00ff) /* K053260 */
AM_RANGE(0x1e0000, 0x1e0003) AM_READ8(overdriv_2_sound_r, 0x00ff) AM_DEVWRITE8("k053260_2", k053260_device, k053260_w, 0x00ff) /* K053260 */
AM_RANGE(0x1e8000, 0x1e8001) AM_WRITE(overdriv_soundirq_w)

View File

@ -142,7 +142,7 @@ static ADDRESS_MAP_START( parodius_map, AS_PROGRAM, 8, parodius_state )
AM_RANGE(0x3f8f, 0x3f8f) AM_READ_PORT("DSW1")
AM_RANGE(0x3f90, 0x3f90) AM_READ_PORT("DSW2")
AM_RANGE(0x3fa0, 0x3faf) AM_DEVREADWRITE("k053245", k05324x_device, k053244_r, k053244_w)
AM_RANGE(0x3fb0, 0x3fbf) AM_DEVWRITE_LEGACY("k053251", k053251_w)
AM_RANGE(0x3fb0, 0x3fbf) AM_DEVWRITE("k053251", k053251_device, write)
AM_RANGE(0x3fc0, 0x3fc0) AM_READ(watchdog_reset_r) AM_WRITE(parodius_3fc0_w)
AM_RANGE(0x3fc4, 0x3fc4) AM_WRITE(parodius_videobank_w)
AM_RANGE(0x3fc8, 0x3fc8) AM_WRITE(parodius_sh_irqtrigger_w)

View File

@ -92,7 +92,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, simpsons_state )
AM_RANGE(0x1f92, 0x1f92) AM_READ_PORT("P3")
AM_RANGE(0x1f93, 0x1f93) AM_READ_PORT("P4")
AM_RANGE(0x1fa0, 0x1fa7) AM_DEVWRITE_LEGACY("k053246", k053246_w)
AM_RANGE(0x1fb0, 0x1fbf) AM_DEVWRITE_LEGACY("k053251", k053251_w)
AM_RANGE(0x1fb0, 0x1fbf) AM_DEVWRITE("k053251", k053251_device, write)
AM_RANGE(0x1fc0, 0x1fc0) AM_WRITE(simpsons_coin_counter_w)
AM_RANGE(0x1fc2, 0x1fc2) AM_WRITE(simpsons_eeprom_w)
AM_RANGE(0x1fc4, 0x1fc4) AM_READ(simpsons_sound_interrupt_r)

View File

@ -91,7 +91,7 @@ static ADDRESS_MAP_START( surpratk_map, AS_PROGRAM, 8, surpratk_state )
AM_RANGE(0x5f8f, 0x5f8f) AM_READ_PORT("DSW1")
AM_RANGE(0x5f90, 0x5f90) AM_READ_PORT("DSW2")
AM_RANGE(0x5fa0, 0x5faf) AM_DEVREADWRITE("k053244", k05324x_device, k053244_r, k053244_w)
AM_RANGE(0x5fb0, 0x5fbf) AM_DEVWRITE_LEGACY("k053251", k053251_w)
AM_RANGE(0x5fb0, 0x5fbf) AM_DEVWRITE("k053251", k053251_device, write)
AM_RANGE(0x5fc0, 0x5fc0) AM_READ(watchdog_reset_r) AM_WRITE(surpratk_5fc0_w)
AM_RANGE(0x5fd0, 0x5fd1) AM_DEVWRITE("ymsnd", ym2151_device, write)
AM_RANGE(0x5fc4, 0x5fc4) AM_WRITE(surpratk_videobank_w)

View File

@ -616,7 +616,7 @@ static ADDRESS_MAP_START( punkshot_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x0a0020, 0x0a0021) AM_WRITE(punkshot_0a0020_w)
AM_RANGE(0x0a0040, 0x0a0043) AM_READ8(punkshot_sound_r, 0x00ff) /* K053260 */
AM_RANGE(0x0a0040, 0x0a0041) AM_DEVWRITE8("k053260", k053260_device, k053260_w, 0x00ff)
AM_RANGE(0x0a0060, 0x0a007f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x0a0060, 0x0a007f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
AM_RANGE(0x0a0080, 0x0a0081) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x100000, 0x107fff) AM_READWRITE(k052109_word_noA12_r, punkshot_k052109_word_noA12_w)
AM_RANGE(0x110000, 0x110007) AM_DEVREADWRITE("k051960", k051960_device, k051937_word_r, k051937_word_w)
@ -641,7 +641,7 @@ static ADDRESS_MAP_START( lgtnfght_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x0a0028, 0x0a0029) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x0b0000, 0x0b3fff) AM_READWRITE(k053245_scattered_word_r, k053245_scattered_word_w) AM_SHARE("spriteram")
AM_RANGE(0x0c0000, 0x0c001f) AM_READWRITE(k053244_word_noA1_r, k053244_word_noA1_w)
AM_RANGE(0x0e0000, 0x0e001f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x0e0000, 0x0e001f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
AM_RANGE(0x100000, 0x107fff) AM_READWRITE(k052109_word_noA12_r, k052109_word_noA12_w)
ADDRESS_MAP_END
@ -670,7 +670,7 @@ static ADDRESS_MAP_START( blswhstl_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x780600, 0x780603) AM_READ8(punkshot_sound_r, 0x00ff) /* K053260 */
AM_RANGE(0x780600, 0x780601) AM_DEVWRITE8("k053260", k053260_device, k053260_w, 0x00ff)
AM_RANGE(0x780604, 0x780605) AM_WRITE(ssriders_soundkludge_w)
AM_RANGE(0x780700, 0x78071f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x780700, 0x78071f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
ADDRESS_MAP_END
@ -680,16 +680,16 @@ WRITE16_MEMBER(tmnt_state::k053251_glfgreat_w)
if (ACCESSING_BITS_8_15)
{
k053251_w(m_k053251, space, offset, (data >> 8) & 0xff);
m_k053251->write(space, offset, (data >> 8) & 0xff);
/* FIXME: in the old code k052109 tilemaps were tilemaps 2,3,4 for k053251
and got marked as dirty in the write above... how was the original hardware working?!? */
for (i = 0; i < 3; i++)
{
if (k053251_get_tmap_dirty(m_k053251, 2 + i))
if (m_k053251->get_tmap_dirty(2 + i))
{
m_k052109->tilemap_mark_dirty(i);
k053251_set_tmap_dirty(m_k053251, 2 + i, 0);
m_k053251->set_tmap_dirty(2 + i, 0);
}
}
}
@ -704,7 +704,7 @@ static ADDRESS_MAP_START( glfgreat_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x110000, 0x11001f) AM_WRITE(k053244_word_noA1_w) /* duplicate! */
AM_RANGE(0x114000, 0x11401f) AM_DEVREADWRITE("k053245", k05324x_device, k053244_lsb_r, k053244_lsb_w) /* duplicate! */
AM_RANGE(0x118000, 0x11801f) AM_DEVWRITE("k053936", k053936_device, ctrl_w)
AM_RANGE(0x11c000, 0x11c01f) AM_DEVWRITE_LEGACY("k053251", k053251_msb_w)
AM_RANGE(0x11c000, 0x11c01f) AM_DEVWRITE("k053251", k053251_device, msb_w)
AM_RANGE(0x11c000, 0x11c01f) AM_WRITE(k053251_glfgreat_w)
AM_RANGE(0x120000, 0x120001) AM_READ_PORT("P1/P2")
AM_RANGE(0x120002, 0x120003) AM_READ_PORT("P3/P4")
@ -728,7 +728,7 @@ static ADDRESS_MAP_START( prmrsocr_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x110000, 0x11001f) AM_WRITE(k053244_word_noA1_w) /* duplicate! */
AM_RANGE(0x114000, 0x11401f) AM_DEVREADWRITE("k053245", k05324x_device, k053244_lsb_r, k053244_lsb_w) /* duplicate! */
AM_RANGE(0x118000, 0x11801f) AM_DEVWRITE("k053936", k053936_device, ctrl_w)
AM_RANGE(0x11c000, 0x11c01f) AM_DEVWRITE_LEGACY("k053251", k053251_msb_w)
AM_RANGE(0x11c000, 0x11c01f) AM_DEVWRITE("k053251", k053251_device, msb_w)
AM_RANGE(0x11c000, 0x11c01f) AM_WRITE(k053251_glfgreat_w)
AM_RANGE(0x120000, 0x120001) AM_READ_PORT("P1/COINS")
AM_RANGE(0x120002, 0x120003) AM_READ_PORT("P2/EEPROM")
@ -999,7 +999,7 @@ static ADDRESS_MAP_START( tmnt2_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x5c0600, 0x5c0603) AM_READ8(punkshot_sound_r, 0x00ff) /* K053260 */
AM_RANGE(0x5c0600, 0x5c0601) AM_DEVWRITE8("k053260", k053260_device, k053260_w, 0x00ff)
AM_RANGE(0x5c0604, 0x5c0605) AM_WRITE(ssriders_soundkludge_w)
AM_RANGE(0x5c0700, 0x5c071f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x5c0700, 0x5c071f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
AM_RANGE(0x600000, 0x603fff) AM_DEVREADWRITE("k052109", k052109_device, word_r, word_w)
ADDRESS_MAP_END
@ -1025,7 +1025,7 @@ static ADDRESS_MAP_START( ssriders_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x5c0600, 0x5c0603) AM_READ8(punkshot_sound_r, 0x00ff) /* K053260 */
AM_RANGE(0x5c0600, 0x5c0601) AM_DEVWRITE8("k053260", k053260_device, k053260_w, 0x00ff)
AM_RANGE(0x5c0604, 0x5c0605) AM_WRITE(ssriders_soundkludge_w)
AM_RANGE(0x5c0700, 0x5c071f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x5c0700, 0x5c071f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
AM_RANGE(0x600000, 0x603fff) AM_DEVREADWRITE("k052109", k052109_device, word_r, word_w)
ADDRESS_MAP_END
@ -1034,7 +1034,7 @@ static ADDRESS_MAP_START( sunsetbl_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x000000, 0x0bffff) AM_ROM
AM_RANGE(0x104000, 0x107fff) AM_RAM /* main RAM */
AM_RANGE(0x14c000, 0x14cfff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
AM_RANGE(0x14e700, 0x14e71f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x14e700, 0x14e71f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
AM_RANGE(0x180000, 0x183fff) AM_READWRITE(k053245_scattered_word_r, k053245_scattered_word_w) AM_SHARE("spriteram")
AM_RANGE(0x184000, 0x18ffff) AM_RAM
AM_RANGE(0x1c0300, 0x1c0301) AM_WRITE(ssriders_1c0300_w)
@ -1060,7 +1060,7 @@ static ADDRESS_MAP_START( thndrx2_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x100000, 0x103fff) AM_RAM /* main RAM */
AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
AM_RANGE(0x300000, 0x30001f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x300000, 0x30001f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
AM_RANGE(0x400000, 0x400003) AM_READ8(punkshot_sound_r, 0x00ff) /* K053260 */
AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("k053260", k053260_device, k053260_w, 0x00ff)
AM_RANGE(0x500000, 0x50003f) AM_DEVREADWRITE("k054000", k054000_device, lsb_r, lsb_w)

View File

@ -234,7 +234,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, vendetta_state )
AM_RANGE(0x0000, 0x1fff) AM_ROMBANK("bank1")
AM_RANGE(0x2000, 0x3fff) AM_RAM
AM_RANGE(0x5f80, 0x5f9f) AM_DEVREADWRITE("k054000", k054000_device, read, write)
AM_RANGE(0x5fa0, 0x5faf) AM_DEVWRITE_LEGACY("k053251", k053251_w)
AM_RANGE(0x5fa0, 0x5faf) AM_DEVWRITE("k053251", k053251_device, write)
AM_RANGE(0x5fb0, 0x5fb7) AM_DEVWRITE_LEGACY("k053246", k053246_w)
AM_RANGE(0x5fc0, 0x5fc0) AM_READ_PORT("P1")
AM_RANGE(0x5fc1, 0x5fc1) AM_READ_PORT("P2")
@ -264,7 +264,7 @@ static ADDRESS_MAP_START( esckids_map, AS_PROGRAM, 8, vendetta_state )
AM_RANGE(0x3f92, 0x3f92) AM_READ_PORT("EEPROM")
AM_RANGE(0x3f93, 0x3f93) AM_READ_PORT("SERVICE")
AM_RANGE(0x3fa0, 0x3fa7) AM_DEVWRITE_LEGACY("k053246", k053246_w) // 053246 (Sprite)
AM_RANGE(0x3fb0, 0x3fbf) AM_DEVWRITE_LEGACY("k053251", k053251_w) // 053251 (Priority Encoder)
AM_RANGE(0x3fb0, 0x3fbf) AM_DEVWRITE("k053251", k053251_device, write) // 053251 (Priority Encoder)
AM_RANGE(0x3fc0, 0x3fcf) AM_DEVREADWRITE("k053252", k053252_device, read, write) // Not Emulated (053252 ???)
AM_RANGE(0x3fd0, 0x3fd0) AM_WRITE(vendetta_5fe0_w) // Coin Counter, 052109 RMRD, 053246 OBJCHA
AM_RANGE(0x3fd2, 0x3fd2) AM_WRITE(vendetta_eeprom_w) // EEPROM, Video banking

View File

@ -315,8 +315,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, xexex_state )
AM_RANGE(0x0c4000, 0x0c4001) AM_DEVREAD_LEGACY("k053246", k053246_word_r) // Passthrough to sprite roms
AM_RANGE(0x0c6000, 0x0c7fff) AM_DEVREADWRITE("k053250", k053250_device, ram_r, ram_w) // K053250 "road" RAM
AM_RANGE(0x0c8000, 0x0c800f) AM_DEVREADWRITE("k053250", k053250_device, reg_r, reg_w)
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE_LEGACY("k054338", k054338_word_w) // CLTC
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w) // priority encoder
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE("k054338", k054338_device, word_w) // CLTC
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE("k053251", k053251_device, lsb_w) // priority encoder
// AM_RANGE(0x0d0000, 0x0d001f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff) // CCU
AM_RANGE(0x0d4000, 0x0d4001) AM_WRITE(sound_irq_w)
AM_RANGE(0x0d600c, 0x0d600d) AM_WRITE(sound_cmd1_w)
@ -339,8 +339,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, xexex_state )
#if XE_DEBUG
AM_RANGE(0x0c0000, 0x0c003f) AM_DEVREAD("k056832", k056832_device, word_r)
AM_RANGE(0x0c2000, 0x0c2007) AM_DEVREAD_LEGACY("k053246", k053246_reg_word_r)
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVREAD_LEGACY("k054338", k054338_word_r)
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVREAD_LEGACY("k053251", k053251_lsb_r)
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVREAD("k054338", k054338_device, word_r)
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVREAD("k053251", k053251_device, lsb_r)
AM_RANGE(0x0d8000, 0x0d8007) AM_DEVREAD("k056832", k056832_device, b_word_r)
#endif

View File

@ -115,7 +115,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, xmen_state )
AM_RANGE(0x10804c, 0x10804d) AM_WRITE(sound_cmd_w)
AM_RANGE(0x10804e, 0x10804f) AM_WRITE(sound_irq_w)
AM_RANGE(0x108054, 0x108055) AM_READ(sound_status_r)
AM_RANGE(0x108060, 0x10807f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x108060, 0x10807f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
AM_RANGE(0x10a000, 0x10a001) AM_READ_PORT("P2_P4") AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x10a002, 0x10a003) AM_READ_PORT("P1_P3")
AM_RANGE(0x10a004, 0x10a005) AM_READ_PORT("EEPROM")
@ -150,7 +150,7 @@ static ADDRESS_MAP_START( 6p_main_map, AS_PROGRAM, 16, xmen_state )
AM_RANGE(0x10804c, 0x10804d) AM_WRITE(sound_cmd_w)
AM_RANGE(0x10804e, 0x10804f) AM_WRITE(sound_irq_w)
AM_RANGE(0x108054, 0x108055) AM_READ(sound_status_r)
AM_RANGE(0x108060, 0x10807f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w)
AM_RANGE(0x108060, 0x10807f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
AM_RANGE(0x10a000, 0x10a001) AM_READ_PORT("P2_P4") AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x10a002, 0x10a003) AM_READ_PORT("P1_P3")
AM_RANGE(0x10a004, 0x10a005) AM_READ_PORT("EEPROM")

View File

@ -72,11 +72,11 @@ UINT32 asterix_state::screen_update_asterix(screen_device &screen, bitmap_ind16
m_tilebanks[3] = (m_k056832->get_lookup(3) << 10);
// update color info and refresh tilemaps
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI1);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI1);
for (plane = 0; plane < 4; plane++)
{
new_colorbase = k053251_get_palette_index(m_k053251, K053251_CI[plane]);
new_colorbase = m_k053251->get_palette_index(K053251_CI[plane]);
if (m_layer_colorbase[plane] != new_colorbase)
{
m_layer_colorbase[plane] = new_colorbase;
@ -85,11 +85,11 @@ UINT32 asterix_state::screen_update_asterix(screen_device &screen, bitmap_ind16
}
layer[0] = 0;
m_layerpri[0] = k053251_get_priority(m_k053251, K053251_CI0);
m_layerpri[0] = m_k053251->get_priority(K053251_CI0);
layer[1] = 1;
m_layerpri[1] = k053251_get_priority(m_k053251, K053251_CI2);
m_layerpri[1] = m_k053251->get_priority(K053251_CI2);
layer[2] = 3;
m_layerpri[2] = k053251_get_priority(m_k053251, K053251_CI4);
m_layerpri[2] = m_k053251->get_priority(K053251_CI4);
konami_sortlayers3(layer, m_layerpri);

View File

@ -48,8 +48,8 @@ UINT32 bishi_state::screen_update_bishi(screen_device &screen, bitmap_rgb32 &bit
static const int pris[4] = { K55_PRIINP_0, K55_PRIINP_3, K55_PRIINP_6, K55_PRIINP_7 };
static const int enables[4] = { K55_INP_VRAM_A, K55_INP_VRAM_B, K55_INP_VRAM_C, K55_INP_VRAM_D };
k054338_update_all_shadows(m_k054338, 0);
k054338_fill_backcolor(m_k054338, bitmap, 0);
m_k054338->update_all_shadows(0);
m_k054338->fill_backcolor(bitmap, 0);
for (i = 0; i < 4; i++)
{

View File

@ -95,11 +95,11 @@ UINT32 dbz_state::screen_update_dbz(screen_device &screen, bitmap_ind16 &bitmap,
static const int K053251_CI[6] = { K053251_CI3, K053251_CI4, K053251_CI4, K053251_CI4, K053251_CI2, K053251_CI1 };
int layer[5], plane, new_colorbase;
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI0);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI0);
for (plane = 0; plane < 6; plane++)
{
new_colorbase = k053251_get_palette_index(m_k053251, K053251_CI[plane]);
new_colorbase = m_k053251->get_palette_index(K053251_CI[plane]);
if (m_layer_colorbase[plane] != new_colorbase)
{
m_layer_colorbase[plane] = new_colorbase;
@ -115,15 +115,15 @@ UINT32 dbz_state::screen_update_dbz(screen_device &screen, bitmap_ind16 &bitmap,
//layers priority
layer[0] = 0;
m_layerpri[0] = k053251_get_priority(m_k053251, K053251_CI3);
m_layerpri[0] = m_k053251->get_priority(K053251_CI3);
layer[1] = 1;
m_layerpri[1] = k053251_get_priority(m_k053251, K053251_CI4);
m_layerpri[1] = m_k053251->get_priority(K053251_CI4);
layer[2] = 3;
m_layerpri[2] = k053251_get_priority(m_k053251, K053251_CI0);
m_layerpri[2] = m_k053251->get_priority(K053251_CI0);
layer[3] = 4;
m_layerpri[3] = k053251_get_priority(m_k053251, K053251_CI2);
m_layerpri[3] = m_k053251->get_priority(K053251_CI2);
layer[4] = 5;
m_layerpri[4] = k053251_get_priority(m_k053251, K053251_CI1);
m_layerpri[4] = m_k053251->get_priority(K053251_CI1);
konami_sortlayers5(layer, m_layerpri);

View File

@ -99,12 +99,12 @@ UINT32 gijoe_state::screen_update_gijoe(screen_device &screen, bitmap_ind16 &bit
m_avac_bits[3] = m_avac_bits[2] = m_avac_bits[1] = m_avac_bits[0] = 0xf000;
// update color info and refresh tilemaps
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI0);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI0);
for (i = 0; i < 4; i++)
{
dirty = 0;
colorbase_new = k053251_get_palette_index(m_k053251, K053251_CI[i]);
colorbase_new = m_k053251->get_palette_index(K053251_CI[i]);
if (m_layer_colorbase[i] != colorbase_new)
{
m_layer_colorbase[i] = colorbase_new;
@ -142,16 +142,16 @@ UINT32 gijoe_state::screen_update_gijoe(screen_device &screen, bitmap_ind16 &bit
}
// seems to switch the K053251 between different priority modes, detail unknown
// primode = k053251_get_priority(m_k053251, K053251_CI1);
// primode = m_k053251->get_priority(K053251_CI1);
layer[0] = 0;
m_layer_pri[0] = 0; // not sure
layer[1] = 1;
m_layer_pri[1] = k053251_get_priority(m_k053251, K053251_CI2);
m_layer_pri[1] = m_k053251->get_priority(K053251_CI2);
layer[2] = 2;
m_layer_pri[2] = k053251_get_priority(m_k053251, K053251_CI3);
m_layer_pri[2] = m_k053251->get_priority(K053251_CI3);
layer[3] = 3;
m_layer_pri[3] = k053251_get_priority(m_k053251, K053251_CI4);
m_layer_pri[3] = m_k053251->get_priority(K053251_CI4);
konami_sortlayers4(layer, m_layer_pri);

View File

@ -5374,159 +5374,15 @@ if (machine.input().code_pressed(KEYCODE_D))
/* */
/***************************************************************************/
struct k053251_state
{
int dirty_tmap[5];
UINT8 ram[16];
int tilemaps_set;
int palette_index[5];
};
/*****************************************************************************
INLINE FUNCTIONS
*****************************************************************************/
INLINE k053251_state *k053251_get_safe_token( device_t *device )
{
assert(device != NULL);
assert(device->type() == K053251);
return (k053251_state *)downcast<k053251_device *>(device)->token();
}
/*****************************************************************************
DEVICE HANDLERS
*****************************************************************************/
WRITE8_DEVICE_HANDLER( k053251_w )
{
k053251_state *k053251 = k053251_get_safe_token(device);
int i, newind;
data &= 0x3f;
if (k053251->ram[offset] != data)
{
k053251->ram[offset] = data;
if (offset == 9)
{
/* palette base index */
for (i = 0; i < 3; i++)
{
newind = 32 * ((data >> 2 * i) & 0x03);
if (k053251->palette_index[i] != newind)
{
k053251->palette_index[i] = newind;
k053251->dirty_tmap[i] = 1;
}
}
if (!k053251->tilemaps_set)
space.machine().tilemap().mark_all_dirty();
}
else if (offset == 10)
{
/* palette base index */
for (i = 0; i < 2; i++)
{
newind = 16 * ((data >> 3 * i) & 0x07);
if (k053251->palette_index[3 + i] != newind)
{
k053251->palette_index[3 + i] = newind;
k053251->dirty_tmap[3 + i] = 1;
}
}
if (!k053251->tilemaps_set)
space.machine().tilemap().mark_all_dirty();
}
}
}
WRITE16_DEVICE_HANDLER( k053251_lsb_w )
{
if (ACCESSING_BITS_0_7)
k053251_w(device, space, offset, data & 0xff);
}
WRITE16_DEVICE_HANDLER( k053251_msb_w )
{
if (ACCESSING_BITS_8_15)
k053251_w(device, space, offset, (data >> 8) & 0xff);
}
int k053251_get_priority( device_t *device, int ci )
{
k053251_state *k053251 = k053251_get_safe_token(device);
return k053251->ram[ci];
}
int k053251_get_palette_index( device_t *device, int ci )
{
k053251_state *k053251 = k053251_get_safe_token(device);
return k053251->palette_index[ci];
}
int k053251_get_tmap_dirty( device_t *device, int tmap_num )
{
k053251_state *k053251 = k053251_get_safe_token(device);
assert(tmap_num < 5);
return k053251->dirty_tmap[tmap_num];
}
void k053251_set_tmap_dirty( device_t *device, int tmap_num, int data )
{
k053251_state *k053251 = k053251_get_safe_token(device);
assert(tmap_num < 5);
k053251->dirty_tmap[tmap_num] = data ? 1 : 0;
}
static void k053251_reset_indexes(k053251_state *k053251)
{
k053251->palette_index[0] = 32 * ((k053251->ram[9] >> 0) & 0x03);
k053251->palette_index[1] = 32 * ((k053251->ram[9] >> 2) & 0x03);
k053251->palette_index[2] = 32 * ((k053251->ram[9] >> 4) & 0x03);
k053251->palette_index[3] = 16 * ((k053251->ram[10] >> 0) & 0x07);
k053251->palette_index[4] = 16 * ((k053251->ram[10] >> 3) & 0x07);
}
/*****************************************************************************
DEVICE INTERFACE
*****************************************************************************/
static DEVICE_START( k053251 )
{
k053251_state *k053251 = k053251_get_safe_token(device);
device->save_item(NAME(k053251->ram));
device->save_item(NAME(k053251->tilemaps_set));
device->save_item(NAME(k053251->dirty_tmap));
device->machine().save().register_postload(save_prepost_delegate(FUNC(k053251_reset_indexes), k053251));
}
static DEVICE_RESET( k053251 )
{
k053251_state *k053251 = k053251_get_safe_token(device);
int i;
k053251->tilemaps_set = 0;
for (i = 0; i < 0x10; i++)
k053251->ram[i] = 0;
for (i = 0; i < 5; i++)
k053251->dirty_tmap[i] = 0;
}
const device_type K053251 = &device_creator<k053251_device>;
k053251_device::k053251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, K053251, "Konami 053251", tag, owner, clock, "k053251", __FILE__)
: device_t(mconfig, K053251, "Konami 053251", tag, owner, clock, "k053251", __FILE__),
//m_dirty_tmap[5],
//m_ram[16],
m_tilemaps_set(0)
//m_palette_index[5]
{
m_token = global_alloc_clear(k053251_state);
}
//-------------------------------------------------
@ -5545,7 +5401,11 @@ void k053251_device::device_config_complete()
void k053251_device::device_start()
{
DEVICE_START_NAME( k053251 )(this);
save_item(NAME(m_ram));
save_item(NAME(m_tilemaps_set));
save_item(NAME(m_dirty_tmap));
machine().save().register_postload(save_prepost_delegate(FUNC(k053251_device::reset_indexes), this));
}
//-------------------------------------------------
@ -5554,9 +5414,120 @@ void k053251_device::device_start()
void k053251_device::device_reset()
{
DEVICE_RESET_NAME( k053251 )(this);
int i;
m_tilemaps_set = 0;
for (i = 0; i < 0x10; i++)
m_ram[i] = 0;
for (i = 0; i < 5; i++)
m_dirty_tmap[i] = 0;
}
/*****************************************************************************
DEVICE HANDLERS
*****************************************************************************/
WRITE8_MEMBER( k053251_device::write )
{
int i, newind;
data &= 0x3f;
if (m_ram[offset] != data)
{
m_ram[offset] = data;
if (offset == 9)
{
/* palette base index */
for (i = 0; i < 3; i++)
{
newind = 32 * ((data >> 2 * i) & 0x03);
if (m_palette_index[i] != newind)
{
m_palette_index[i] = newind;
m_dirty_tmap[i] = 1;
}
}
if (!m_tilemaps_set)
space.machine().tilemap().mark_all_dirty();
}
else if (offset == 10)
{
/* palette base index */
for (i = 0; i < 2; i++)
{
newind = 16 * ((data >> 3 * i) & 0x07);
if (m_palette_index[3 + i] != newind)
{
m_palette_index[3 + i] = newind;
m_dirty_tmap[3 + i] = 1;
}
}
if (!m_tilemaps_set)
space.machine().tilemap().mark_all_dirty();
}
}
}
WRITE16_MEMBER( k053251_device::lsb_w )
{
if (ACCESSING_BITS_0_7)
write(space, offset, data & 0xff);
}
WRITE16_MEMBER( k053251_device::msb_w )
{
if (ACCESSING_BITS_8_15)
write(space, offset, (data >> 8) & 0xff);
}
int k053251_device::get_priority( int ci )
{
return m_ram[ci];
}
int k053251_device::get_palette_index( int ci )
{
return m_palette_index[ci];
}
int k053251_device::get_tmap_dirty( int tmap_num )
{
assert(tmap_num < 5);
return m_dirty_tmap[tmap_num];
}
void k053251_device::set_tmap_dirty( int tmap_num, int data )
{
assert(tmap_num < 5);
m_dirty_tmap[tmap_num] = data ? 1 : 0;
}
void k053251_device::reset_indexes()
{
m_palette_index[0] = 32 * ((m_ram[9] >> 0) & 0x03);
m_palette_index[1] = 32 * ((m_ram[9] >> 2) & 0x03);
m_palette_index[2] = 32 * ((m_ram[9] >> 4) & 0x03);
m_palette_index[3] = 16 * ((m_ram[10] >> 0) & 0x07);
m_palette_index[4] = 16 * ((m_ram[10] >> 3) & 0x07);
}
// debug handlers
READ16_MEMBER( k053251_device::lsb_r )
{
return(m_ram[offset]);
} // PCU1
READ16_MEMBER( k053251_device::msb_r )
{
return(m_ram[offset] << 8);
} // PCU1
/***************************************************************************/
/* */
/* 054000 */
@ -5979,98 +5950,118 @@ void k055555_device::device_reset()
// because the implementation is video dependant, this is just a
// register-handling shell.
const device_type K054338 = &device_creator<k054338_device>;
struct k054338_state
k054338_device::k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, K054338, "Konami 054338", tag, owner, clock, "k054338", __FILE__)
//m_regs[32],
//m_shd_rgb[9],
{
UINT16 regs[32];
int shd_rgb[9];
int alphainverted;
screen_device *screen;
device_t *k055555; /* used to fill BG color */
};
/*****************************************************************************
INLINE FUNCTIONS
*****************************************************************************/
INLINE k054338_state *k054338_get_safe_token( device_t *device )
{
assert(device != NULL);
assert(device->type() == K054338);
return (k054338_state *)downcast<k054338_device *>(device)->token();
}
INLINE const k054338_interface *k054338_get_interface( device_t *device )
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void k054338_device::device_config_complete()
{
assert(device != NULL);
assert(device->type() == K054338);
return (const k054338_interface *) device->static_config();
// inherit a copy of the static data
const k054338_interface *intf = reinterpret_cast<const k054338_interface *>(static_config());
if (intf != NULL)
*static_cast<k054338_interface *>(this) = *intf;
// or initialize to defaults if none provided
else
{
m_screen_tag = "";
m_alpha_inv = 0;
m_k055555_tag = "";
};
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void k054338_device::device_start()
{
m_screen = machine().device<screen_device>(m_screen_tag);
m_k055555 = machine().device(m_k055555_tag);
save_item(NAME(m_regs));
save_item(NAME(m_shd_rgb));
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void k054338_device::device_reset()
{
memset(m_regs, 0, sizeof(UINT16)*32);
memset(m_shd_rgb, 0, sizeof(int)*9);
}
/*****************************************************************************
DEVICE HANDLERS
*****************************************************************************/
WRITE16_DEVICE_HANDLER( k054338_word_w )
WRITE16_MEMBER( k054338_device::word_w )
{
k054338_state *k054338 = k054338_get_safe_token(device);
COMBINE_DATA(k054338->regs + offset);
COMBINE_DATA(m_regs + offset);
}
WRITE32_DEVICE_HANDLER( k054338_long_w )
WRITE32_MEMBER( k054338_device::long_w )
{
offset <<= 1;
k054338_word_w(device, space, offset, data >> 16, mem_mask >> 16);
k054338_word_w(device, space, offset + 1, data, mem_mask);
word_w(space, offset, data >> 16, mem_mask >> 16);
word_w(space, offset + 1, data, mem_mask);
}
// returns a 16-bit '338 register
int k054338_register_r( device_t *device, int reg )
int k054338_device::register_r( int reg )
{
k054338_state *k054338 = k054338_get_safe_token(device);
return k054338->regs[reg];
return m_regs[reg];
}
void k054338_update_all_shadows( device_t *device, int rushingheroes_hack )
void k054338_device::update_all_shadows( int rushingheroes_hack )
{
k054338_state *k054338 = k054338_get_safe_token(device);
running_machine &machine = device->machine();
int i, d;
int noclip = k054338->regs[K338_REG_CONTROL] & K338_CTL_CLIPSL;
int noclip = m_regs[K338_REG_CONTROL] & K338_CTL_CLIPSL;
for (i = 0; i < 9; i++)
{
d = k054338->regs[K338_REG_SHAD1R + i] & 0x1ff;
d = m_regs[K338_REG_SHAD1R + i] & 0x1ff;
if (d >= 0x100)
d -= 0x200;
k054338->shd_rgb[i] = d;
m_shd_rgb[i] = d;
}
if (!rushingheroes_hack)
{
palette_set_shadow_dRGB32(machine, 0, k054338->shd_rgb[0], k054338->shd_rgb[1], k054338->shd_rgb[2], noclip);
palette_set_shadow_dRGB32(machine, 1, k054338->shd_rgb[3], k054338->shd_rgb[4], k054338->shd_rgb[5], noclip);
palette_set_shadow_dRGB32(machine, 2, k054338->shd_rgb[6], k054338->shd_rgb[7], k054338->shd_rgb[8], noclip);
palette_set_shadow_dRGB32(machine(), 0, m_shd_rgb[0], m_shd_rgb[1], m_shd_rgb[2], noclip);
palette_set_shadow_dRGB32(machine(), 1, m_shd_rgb[3], m_shd_rgb[4], m_shd_rgb[5], noclip);
palette_set_shadow_dRGB32(machine(), 2, m_shd_rgb[6], m_shd_rgb[7], m_shd_rgb[8], noclip);
}
else // rushing heroes seems to specify shadows in another format, or it's not being interpreted properly.
{
palette_set_shadow_dRGB32(machine, 0, -80, -80, -80, 0);
palette_set_shadow_dRGB32(machine, 1, -80, -80, -80, 0);
palette_set_shadow_dRGB32(machine, 2, -80, -80, -80, 0);
palette_set_shadow_dRGB32(machine(), 0, -80, -80, -80, 0);
palette_set_shadow_dRGB32(machine(), 1, -80, -80, -80, 0);
palette_set_shadow_dRGB32(machine(), 2, -80, -80, -80, 0);
}
}
// k054338 BG color fill
void k054338_fill_solid_bg( device_t *device, bitmap_rgb32 &bitmap )
void k054338_device::fill_solid_bg( bitmap_rgb32 &bitmap )
{
UINT32 bgcolor;
UINT32 *pLine;
int x, y;
bgcolor = (k054338_register_r(device, K338_REG_BGC_R) & 0xff) << 16;
bgcolor |= k054338_register_r(device, K338_REG_BGC_GB);
bgcolor = (register_r(K338_REG_BGC_R) & 0xff) << 16;
bgcolor |= register_r(K338_REG_BGC_GB);
/* and fill the screen with it */
for (y = 0; y < bitmap.height(); y++)
@ -6082,14 +6073,13 @@ void k054338_fill_solid_bg( device_t *device, bitmap_rgb32 &bitmap )
}
// Unified k054338/K055555 BG color fill
void k054338_fill_backcolor( device_t *device, bitmap_rgb32 &bitmap, int mode ) // (see p.67)
void k054338_device::fill_backcolor( bitmap_rgb32 &bitmap, int mode ) // (see p.67)
{
k054338_state *k054338 = k054338_get_safe_token(device);
int clipx, clipy, clipw, cliph, i, dst_pitch;
int BGC_CBLK, BGC_SET;
UINT32 *dst_ptr, *pal_ptr;
int bgcolor;
const rectangle &visarea = k054338->screen->visible_area();
const rectangle &visarea = m_screen->visible_area();
clipx = visarea.min_x & ~3;
clipy = visarea.min_y;
@ -6101,17 +6091,17 @@ void k054338_fill_backcolor( device_t *device, bitmap_rgb32 &bitmap, int mode )
dst_ptr += clipx;
BGC_SET = 0;
pal_ptr = device->machine().driver_data()->m_generic_paletteram_32;
pal_ptr = machine().driver_data()->m_generic_paletteram_32;
if (!mode || k054338->k055555 == NULL)
if (!mode || m_k055555 == NULL)
{
// single color output from CLTC
bgcolor = (int)(k054338->regs[K338_REG_BGC_R] & 0xff) << 16 | (int)k054338->regs[K338_REG_BGC_GB];
bgcolor = (int)(m_regs[K338_REG_BGC_R] & 0xff) << 16 | (int)m_regs[K338_REG_BGC_GB];
}
else
{
BGC_CBLK = k055555_read_register(k054338->k055555, 0);
BGC_SET = k055555_read_register(k054338->k055555, 1);
BGC_CBLK = k055555_read_register(m_k055555, 0);
BGC_SET = k055555_read_register(m_k055555, 1);
pal_ptr += BGC_CBLK << 9;
@ -6181,9 +6171,8 @@ void k054338_fill_backcolor( device_t *device, bitmap_rgb32 &bitmap, int mode )
}
// addition blending unimplemented (requires major changes to drawgfx and tilemap.c)
int k054338_set_alpha_level( device_t *device, int pblend )
int k054338_device::set_alpha_level( int pblend )
{
k054338_state *k054338 = k054338_get_safe_token(device);
UINT16 *regs;
int ctrl, mixpri, mixset, mixlv;
@ -6192,13 +6181,13 @@ int k054338_set_alpha_level( device_t *device, int pblend )
return (255);
}
regs = k054338->regs;
ctrl = k054338->regs[K338_REG_CONTROL];
regs = m_regs;
ctrl = m_regs[K338_REG_CONTROL];
mixpri = ctrl & K338_CTL_MIXPRI;
mixset = regs[K338_REG_PBLEND + (pblend >> 1 & 1)] >> (~pblend << 3 & 8);
mixlv = mixset & 0x1f;
if (k054338->alphainverted)
if (m_alpha_inv)
mixlv = 0x1f - mixlv;
if (!(mixset & 0x20))
@ -6229,83 +6218,26 @@ int k054338_set_alpha_level( device_t *device, int pblend )
return mixlv;
}
void k054338_invert_alpha( device_t *device, int invert )
void k054338_device::invert_alpha( int invert )
{
k054338_state *k054338 = k054338_get_safe_token(device);
k054338->alphainverted = invert;
m_alpha_inv = invert;
}
#if 0
// FIXME
void k054338->export_config( device_t *device, int **shd_rgb )
void k054338_device::export_config( int **shd_rgb )
{
k054338_state *k054338 = k054338_get_safe_token(device);
*shd_rgb = k054338->shd_rgb;
*shd_rgb = m_shd_rgb;
}
#endif
/*****************************************************************************
DEVICE INTERFACE
*****************************************************************************/
// debug handler
static DEVICE_START( k054338 )
READ16_MEMBER( k054338_device::word_r )
{
k054338_state *k054338 = k054338_get_safe_token(device);
const k054338_interface *intf = k054338_get_interface(device);
k054338->screen = device->machine().device<screen_device>(intf->screen);
k054338->k055555 = device->machine().device(intf->k055555);
k054338->alphainverted = intf->alpha_inv;
device->save_item(NAME(k054338->regs));
device->save_item(NAME(k054338->shd_rgb));
}
static DEVICE_RESET( k054338 )
{
k054338_state *k054338 = k054338_get_safe_token(device);
memset(k054338->regs, 0, sizeof(UINT16)*32);
memset(k054338->shd_rgb, 0, sizeof(int)*9);
}
const device_type K054338 = &device_creator<k054338_device>;
k054338_device::k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, K054338, "Konami 054338", tag, owner, clock, "k054338", __FILE__)
{
m_token = global_alloc_clear(k054338_state);
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void k054338_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void k054338_device::device_start()
{
DEVICE_START_NAME( k054338 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void k054338_device::device_reset()
{
DEVICE_RESET_NAME( k054338 )(this);
}
return(m_regs[offset]);
} // CLTC
// Newer Konami devices
@ -8210,24 +8142,6 @@ READ16_DEVICE_HANDLER( k053247_reg_word_r )
return(k053247->kx47_regs[offset]);
} // OBJSET2
READ16_DEVICE_HANDLER( k054338_word_r )
{
k054338_state *k054338 = k054338_get_safe_token(device);
return(k054338->regs[offset]);
} // CLTC
READ16_DEVICE_HANDLER( k053251_lsb_r )
{
k053251_state *k053251 = k053251_get_safe_token(device);
return(k053251->ram[offset]);
} // PCU1
READ16_DEVICE_HANDLER( k053251_msb_r )
{
k053251_state *k053251 = k053251_get_safe_token(device);
return(k053251->ram[offset] << 8);
} // PCU1
READ16_DEVICE_HANDLER( k055555_word_r )
{
k055555_state *k055555 = k055555_get_safe_token(device);

View File

@ -93,9 +93,9 @@ struct k053936_interface
struct k054338_interface
{
const char *screen;
int alpha_inv;
const char *k055555;
const char *m_screen_tag;
int m_alpha_inv;
const char *m_k055555_tag;
};
struct k001006_interface
@ -546,14 +546,38 @@ private:
extern const device_type K053936;
enum
{
K053251_CI0 = 0,
K053251_CI1,
K053251_CI2,
K053251_CI3,
K053251_CI4
};
class k053251_device : public device_t
{
public:
k053251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~k053251_device() { global_free(m_token); }
~k053251_device() {}
/*
Note: k053251_w() automatically does a ALL_TILEMAPS->mark_all_dirty()
when some palette index changes. If ALL_TILEMAPS is too expensive, use
k053251_set_tilemaps() to indicate which tilemap is associated with each index.
*/
DECLARE_WRITE8_MEMBER( write );
DECLARE_WRITE16_MEMBER( lsb_w );
DECLARE_WRITE16_MEMBER( msb_w );
int get_priority(int ci);
int get_palette_index(int ci);
int get_tmap_dirty(int tmap_num);
void set_tmap_dirty(int tmap_num, int data);
DECLARE_READ16_MEMBER( lsb_r ); // PCU1
DECLARE_READ16_MEMBER( msb_r ); // PCU1
// access to legacy token
void *token() const { assert(m_token != NULL); return m_token; }
protected:
// device-level overrides
virtual void device_config_complete();
@ -561,7 +585,13 @@ protected:
virtual void device_reset();
private:
// internal state
void *m_token;
int m_dirty_tmap[5];
UINT8 m_ram[16];
int m_tilemaps_set;
int m_palette_index[5];
void reset_indexes();
};
extern const device_type K053251;
@ -633,22 +663,53 @@ private:
extern const device_type K055555;
class k054338_device : public device_t
#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
class k054338_device : public device_t,
public k054338_interface
{
public:
k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~k054338_device() { global_free(m_token); }
~k054338_device() {}
DECLARE_WRITE16_MEMBER( word_w ); // "CLCT" registers
DECLARE_WRITE32_MEMBER( long_w );
DECLARE_READ16_MEMBER( word_r ); // CLTC
int register_r(int reg);
void update_all_shadows(int rushingheroes_hack); // called at the beginning of SCREEN_UPDATE()
void fill_solid_bg(bitmap_rgb32 &bitmap); // solid backcolor fill
void fill_backcolor(bitmap_rgb32 &bitmap, int mode); // unified fill, 0=solid, 1=gradient (by using a k055555)
int set_alpha_level(int pblend); // blend style 0-2
void invert_alpha(int invert); // 0=0x00(invis)-0x1f(solid), 1=0x1f(invis)-0x00(solod)
//void export_config(int **shdRGB);
// access to legacy token
void *token() const { assert(m_token != NULL); return m_token; }
protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
private:
// internal state
void *m_token;
UINT16 m_regs[32];
int m_shd_rgb[9];
screen_device *m_screen;
device_t *m_k055555; /* used to fill BG color */
};
extern const device_type K054338;
@ -914,29 +975,6 @@ void k053246_set_objcha_line(device_t *device, int state);
int k053246_is_irq_enabled(device_t *device);
int k053246_read_register(device_t *device, int regnum);
/** Konami 053251 **/
/*
Note: k053251_w() automatically does a ALL_TILEMAPS->mark_all_dirty()
when some palette index changes. If ALL_TILEMAPS is too expensive, use
k053251_set_tilemaps() to indicate which tilemap is associated with each index.
*/
DECLARE_WRITE8_DEVICE_HANDLER( k053251_w );
DECLARE_WRITE16_DEVICE_HANDLER( k053251_lsb_w );
DECLARE_WRITE16_DEVICE_HANDLER( k053251_msb_w );
int k053251_get_priority(device_t *device, int ci);
int k053251_get_palette_index(device_t *device, int ci);
int k053251_get_tmap_dirty(device_t *device, int tmap_num);
void k053251_set_tmap_dirty(device_t *device, int tmap_num, int data);
enum
{
K053251_CI0 = 0,
K053251_CI1,
K053251_CI2,
K053251_CI3,
K053251_CI4
};
/** Konami 055555 **/
void k055555_write_reg(device_t *device, UINT8 regnum, UINT8 regdat);
DECLARE_WRITE16_DEVICE_HANDLER( k055555_word_w );
@ -1010,35 +1048,6 @@ int k055555_get_palette_index(device_t *device, int idx);
#define K55_INP_SUB2 0x40
#define K55_INP_SUB3 0x80
/** Konami 054338 **/
/* mixer/alpha blender */
DECLARE_WRITE16_DEVICE_HANDLER( k054338_word_w ); // "CLCT" registers
DECLARE_WRITE32_DEVICE_HANDLER( k054338_long_w );
int k054338_register_r(device_t *device, int reg);
void k054338_update_all_shadows(device_t *device, int rushingheroes_hack); // called at the beginning of SCREEN_UPDATE()
void k054338_fill_solid_bg(device_t *device, bitmap_ind16 &bitmap); // solid backcolor fill
void k054338_fill_backcolor(device_t *device, bitmap_rgb32 &bitmap, int mode); // unified fill, 0=solid, 1=gradient (by using a k055555)
int k054338_set_alpha_level(device_t *device, int pblend); // blend style 0-2
void k054338_invert_alpha(device_t *device, int invert); // 0=0x00(invis)-0x1f(solid), 1=0x1f(invis)-0x00(solod)
//void K054338_export_config(device_t *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 001006 **/
UINT32 k001006_get_palette(device_t *device, int index);
@ -1068,12 +1077,7 @@ DECLARE_READ32_DEVICE_HANDLER( k001604_reg_r );
// debug handlers
DECLARE_READ16_DEVICE_HANDLER( k053246_reg_word_r ); // OBJSET1
DECLARE_READ16_DEVICE_HANDLER( k053247_reg_word_r ); // OBJSET2
DECLARE_READ16_DEVICE_HANDLER( k053251_lsb_r ); // PCU1
DECLARE_READ16_DEVICE_HANDLER( k053251_msb_r ); // PCU1
DECLARE_READ16_DEVICE_HANDLER( k055555_word_r ); // PCU2
DECLARE_READ16_DEVICE_HANDLER( k054338_word_r ); // CLTC
DECLARE_READ32_DEVICE_HANDLER( k053247_reg_long_r ); // OBJSET2
DECLARE_READ32_DEVICE_HANDLER( k055555_long_r ); // PCU2

View File

@ -70,14 +70,14 @@ UINT32 moo_state::screen_update_moo(screen_device &screen, bitmap_rgb32 &bitmap,
int layers[3];
int new_colorbase, plane, dirty, alpha;
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI0);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI0);
m_layer_colorbase[0] = 0x70;
if (m_k056832->get_layer_association())
{
for (plane = 1; plane < 4; plane++)
{
new_colorbase = k053251_get_palette_index(m_k053251, K053251_CI[plane]);
new_colorbase = m_k053251->get_palette_index(K053251_CI[plane]);
if (m_layer_colorbase[plane] != new_colorbase)
{
m_layer_colorbase[plane] = new_colorbase;
@ -89,7 +89,7 @@ UINT32 moo_state::screen_update_moo(screen_device &screen, bitmap_rgb32 &bitmap,
{
for (dirty = 0, plane = 1; plane < 4; plane++)
{
new_colorbase = k053251_get_palette_index(m_k053251, K053251_CI[plane]);
new_colorbase = m_k053251->get_palette_index(K053251_CI[plane]);
if (m_layer_colorbase[plane] != new_colorbase)
{
m_layer_colorbase[plane] = new_colorbase;
@ -101,29 +101,29 @@ UINT32 moo_state::screen_update_moo(screen_device &screen, bitmap_rgb32 &bitmap,
}
layers[0] = 1;
m_layerpri[0] = k053251_get_priority(m_k053251, K053251_CI2);
m_layerpri[0] = m_k053251->get_priority(K053251_CI2);
layers[1] = 2;
m_layerpri[1] = k053251_get_priority(m_k053251, K053251_CI3);
m_layerpri[1] = m_k053251->get_priority(K053251_CI3);
layers[2] = 3;
m_layerpri[2] = k053251_get_priority(m_k053251, K053251_CI4);
m_layerpri[2] = m_k053251->get_priority(K053251_CI4);
konami_sortlayers3(layers, m_layerpri);
k054338_update_all_shadows(m_k054338, 0);
k054338_fill_backcolor(m_k054338, bitmap, 0);
m_k054338->update_all_shadows(0);
m_k054338->fill_backcolor(bitmap, 0);
machine().priority_bitmap.fill(0, cliprect);
if (m_layerpri[0] < k053251_get_priority(m_k053251, K053251_CI1)) /* bucky hides back layer behind background */
if (m_layerpri[0] < m_k053251->get_priority(K053251_CI1)) /* bucky hides back layer behind background */
m_k056832->tilemap_draw(bitmap, cliprect, layers[0], 0, 1);
m_k056832->tilemap_draw(bitmap, cliprect, layers[1], 0, 2);
// Enabling alpha improves fog and fading in Moo but causes other things to disappear.
// There is probably a control bit somewhere to turn off alpha blending.
m_alpha_enabled = k054338_register_r(m_k054338, K338_REG_CONTROL) & K338_CTL_MIXPRI; // DUMMY
m_alpha_enabled = m_k054338->register_r(K338_REG_CONTROL) & K338_CTL_MIXPRI; // DUMMY
alpha = (m_alpha_enabled) ? k054338_set_alpha_level(m_k054338, 1) : 255;
alpha = (m_alpha_enabled) ? m_k054338->set_alpha_level(1) : 255;
if (alpha > 0)
m_k056832->tilemap_draw(bitmap, cliprect, layers[2], TILEMAP_DRAW_ALPHA(alpha), 4);

View File

@ -51,11 +51,11 @@ void overdriv_zoom_callback_1( running_machine &machine, int *code, int *color,
UINT32 overdriv_state::screen_update_overdriv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI0);
m_road_colorbase[1] = k053251_get_palette_index(m_k053251, K053251_CI1);
m_road_colorbase[0] = k053251_get_palette_index(m_k053251, K053251_CI2);
m_zoom_colorbase[1] = k053251_get_palette_index(m_k053251, K053251_CI3);
m_zoom_colorbase[0] = k053251_get_palette_index(m_k053251, K053251_CI4);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI0);
m_road_colorbase[1] = m_k053251->get_palette_index(K053251_CI1);
m_road_colorbase[0] = m_k053251->get_palette_index(K053251_CI2);
m_zoom_colorbase[1] = m_k053251->get_palette_index(K053251_CI3);
m_zoom_colorbase[0] = m_k053251->get_palette_index(K053251_CI4);
machine().priority_bitmap.fill(0, cliprect);

View File

@ -49,20 +49,20 @@ UINT32 parodius_state::screen_update_parodius(screen_device &screen, bitmap_ind1
{
int layer[3], bg_colorbase;
bg_colorbase = k053251_get_palette_index(m_k053251, K053251_CI0);
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI1);
m_layer_colorbase[0] = k053251_get_palette_index(m_k053251, K053251_CI2);
m_layer_colorbase[1] = k053251_get_palette_index(m_k053251, K053251_CI4);
m_layer_colorbase[2] = k053251_get_palette_index(m_k053251, K053251_CI3);
bg_colorbase = m_k053251->get_palette_index(K053251_CI0);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI1);
m_layer_colorbase[0] = m_k053251->get_palette_index(K053251_CI2);
m_layer_colorbase[1] = m_k053251->get_palette_index(K053251_CI4);
m_layer_colorbase[2] = m_k053251->get_palette_index(K053251_CI3);
m_k052109->tilemap_update();
layer[0] = 0;
m_layerpri[0] = k053251_get_priority(m_k053251, K053251_CI2);
m_layerpri[0] = m_k053251->get_priority(K053251_CI2);
layer[1] = 1;
m_layerpri[1] = k053251_get_priority(m_k053251, K053251_CI4);
m_layerpri[1] = m_k053251->get_priority(K053251_CI4);
layer[2] = 2;
m_layerpri[2] = k053251_get_priority(m_k053251, K053251_CI3);
m_layerpri[2] = m_k053251->get_priority(K053251_CI3);
konami_sortlayers3(layer, m_layerpri);

View File

@ -121,20 +121,20 @@ UINT32 simpsons_state::screen_update_simpsons(screen_device &screen, bitmap_ind1
{
int layer[3], bg_colorbase;
bg_colorbase = k053251_get_palette_index(m_k053251, K053251_CI0);
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI1);
m_layer_colorbase[0] = k053251_get_palette_index(m_k053251, K053251_CI2);
m_layer_colorbase[1] = k053251_get_palette_index(m_k053251, K053251_CI3);
m_layer_colorbase[2] = k053251_get_palette_index(m_k053251, K053251_CI4);
bg_colorbase = m_k053251->get_palette_index(K053251_CI0);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI1);
m_layer_colorbase[0] = m_k053251->get_palette_index(K053251_CI2);
m_layer_colorbase[1] = m_k053251->get_palette_index(K053251_CI3);
m_layer_colorbase[2] = m_k053251->get_palette_index(K053251_CI4);
m_k052109->tilemap_update();
layer[0] = 0;
m_layerpri[0] = k053251_get_priority(m_k053251, K053251_CI2);
m_layerpri[0] = m_k053251->get_priority(K053251_CI2);
layer[1] = 1;
m_layerpri[1] = k053251_get_priority(m_k053251, K053251_CI3);
m_layerpri[1] = m_k053251->get_priority(K053251_CI3);
layer[2] = 2;
m_layerpri[2] = k053251_get_priority(m_k053251, K053251_CI4);
m_layerpri[2] = m_k053251->get_priority(K053251_CI4);
konami_sortlayers3(layer, m_layerpri);

View File

@ -50,20 +50,20 @@ UINT32 surpratk_state::screen_update_surpratk(screen_device &screen, bitmap_ind1
{
int layer[3], bg_colorbase;
bg_colorbase = k053251_get_palette_index(m_k053251, K053251_CI0);
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI1);
m_layer_colorbase[0] = k053251_get_palette_index(m_k053251, K053251_CI2);
m_layer_colorbase[1] = k053251_get_palette_index(m_k053251, K053251_CI4);
m_layer_colorbase[2] = k053251_get_palette_index(m_k053251, K053251_CI3);
bg_colorbase = m_k053251->get_palette_index(K053251_CI0);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI1);
m_layer_colorbase[0] = m_k053251->get_palette_index(K053251_CI2);
m_layer_colorbase[1] = m_k053251->get_palette_index(K053251_CI4);
m_layer_colorbase[2] = m_k053251->get_palette_index(K053251_CI3);
m_k052109->tilemap_update();
layer[0] = 0;
m_layerpri[0] = k053251_get_priority(m_k053251, K053251_CI2);
m_layerpri[0] = m_k053251->get_priority(K053251_CI2);
layer[1] = 1;
m_layerpri[1] = k053251_get_priority(m_k053251, K053251_CI4);
m_layerpri[1] = m_k053251->get_priority(K053251_CI4);
layer[2] = 2;
m_layerpri[2] = k053251_get_priority(m_k053251, K053251_CI3);
m_layerpri[2] = m_k053251->get_priority(K053251_CI3);
konami_sortlayers3(layer, m_layerpri);

View File

@ -571,19 +571,19 @@ UINT32 tmnt_state::screen_update_tmnt(screen_device &screen, bitmap_ind16 &bitma
UINT32 tmnt_state::screen_update_punkshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI1);
m_layer_colorbase[0] = k053251_get_palette_index(m_k053251, K053251_CI2);
m_layer_colorbase[1] = k053251_get_palette_index(m_k053251, K053251_CI4);
m_layer_colorbase[2] = k053251_get_palette_index(m_k053251, K053251_CI3);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI1);
m_layer_colorbase[0] = m_k053251->get_palette_index(K053251_CI2);
m_layer_colorbase[1] = m_k053251->get_palette_index(K053251_CI4);
m_layer_colorbase[2] = m_k053251->get_palette_index(K053251_CI3);
m_k052109->tilemap_update();
m_sorted_layer[0] = 0;
m_layerpri[0] = k053251_get_priority(m_k053251, K053251_CI2);
m_layerpri[0] = m_k053251->get_priority(K053251_CI2);
m_sorted_layer[1] = 1;
m_layerpri[1] = k053251_get_priority(m_k053251, K053251_CI4);
m_layerpri[1] = m_k053251->get_priority(K053251_CI4);
m_sorted_layer[2] = 2;
m_layerpri[2] = k053251_get_priority(m_k053251, K053251_CI3);
m_layerpri[2] = m_k053251->get_priority(K053251_CI3);
konami_sortlayers3(m_sorted_layer, m_layerpri);
@ -601,20 +601,20 @@ UINT32 tmnt_state::screen_update_lgtnfght(screen_device &screen, bitmap_ind16 &b
{
int bg_colorbase;
bg_colorbase = k053251_get_palette_index(m_k053251, K053251_CI0);
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI1);
m_layer_colorbase[0] = k053251_get_palette_index(m_k053251, K053251_CI2);
m_layer_colorbase[1] = k053251_get_palette_index(m_k053251, K053251_CI4);
m_layer_colorbase[2] = k053251_get_palette_index(m_k053251, K053251_CI3);
bg_colorbase = m_k053251->get_palette_index(K053251_CI0);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI1);
m_layer_colorbase[0] = m_k053251->get_palette_index(K053251_CI2);
m_layer_colorbase[1] = m_k053251->get_palette_index(K053251_CI4);
m_layer_colorbase[2] = m_k053251->get_palette_index(K053251_CI3);
m_k052109->tilemap_update();
m_sorted_layer[0] = 0;
m_layerpri[0] = k053251_get_priority(m_k053251, K053251_CI2);
m_layerpri[0] = m_k053251->get_priority(K053251_CI2);
m_sorted_layer[1] = 1;
m_layerpri[1] = k053251_get_priority(m_k053251, K053251_CI4);
m_layerpri[1] = m_k053251->get_priority(K053251_CI4);
m_sorted_layer[2] = 2;
m_layerpri[2] = k053251_get_priority(m_k053251, K053251_CI3);
m_layerpri[2] = m_k053251->get_priority(K053251_CI3);
konami_sortlayers3(m_sorted_layer, m_layerpri);
@ -645,20 +645,20 @@ UINT32 tmnt_state::screen_update_glfgreat(screen_device &screen, bitmap_ind16 &b
{
int bg_colorbase;
bg_colorbase = k053251_get_palette_index(m_k053251, K053251_CI0);
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI1);
m_layer_colorbase[0] = k053251_get_palette_index(m_k053251, K053251_CI2);
m_layer_colorbase[1] = k053251_get_palette_index(m_k053251, K053251_CI3) + 8; /* weird... */
m_layer_colorbase[2] = k053251_get_palette_index(m_k053251, K053251_CI4);
bg_colorbase = m_k053251->get_palette_index(K053251_CI0);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI1);
m_layer_colorbase[0] = m_k053251->get_palette_index(K053251_CI2);
m_layer_colorbase[1] = m_k053251->get_palette_index(K053251_CI3) + 8; /* weird... */
m_layer_colorbase[2] = m_k053251->get_palette_index(K053251_CI4);
m_k052109->tilemap_update();
m_sorted_layer[0] = 0;
m_layerpri[0] = k053251_get_priority(m_k053251, K053251_CI2);
m_layerpri[0] = m_k053251->get_priority(K053251_CI2);
m_sorted_layer[1] = 1;
m_layerpri[1] = k053251_get_priority(m_k053251, K053251_CI3);
m_layerpri[1] = m_k053251->get_priority(K053251_CI3);
m_sorted_layer[2] = 2;
m_layerpri[2] = k053251_get_priority(m_k053251, K053251_CI4);
m_layerpri[2] = m_k053251->get_priority(K053251_CI4);
konami_sortlayers3(m_sorted_layer, m_layerpri);
@ -700,7 +700,7 @@ UINT32 tmnt_state::screen_update_tmnt2(screen_device &screen, bitmap_ind16 &bitm
int i, newdim, newen, cb, ce;
newdim = m_dim_v | ((~m_dim_c & 0x10) >> 1);
newen = (k053251_get_priority(m_k053251, 5) && k053251_get_priority(m_k053251, 5) != 0x3e);
newen = (m_k053251->get_priority(5) && m_k053251->get_priority(5) != 0x3e);
if (newdim != m_lastdim || newen != m_lasten)
{
@ -750,20 +750,20 @@ UINT32 tmnt_state::screen_update_thndrx2(screen_device &screen, bitmap_ind16 &bi
{
int bg_colorbase;
bg_colorbase = k053251_get_palette_index(m_k053251, K053251_CI0);
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI1);
m_layer_colorbase[0] = k053251_get_palette_index(m_k053251, K053251_CI2);
m_layer_colorbase[1] = k053251_get_palette_index(m_k053251, K053251_CI4);
m_layer_colorbase[2] = k053251_get_palette_index(m_k053251, K053251_CI3);
bg_colorbase = m_k053251->get_palette_index(K053251_CI0);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI1);
m_layer_colorbase[0] = m_k053251->get_palette_index(K053251_CI2);
m_layer_colorbase[1] = m_k053251->get_palette_index(K053251_CI4);
m_layer_colorbase[2] = m_k053251->get_palette_index(K053251_CI3);
m_k052109->tilemap_update();
m_sorted_layer[0] = 0;
m_layerpri[0] = k053251_get_priority(m_k053251, K053251_CI2);
m_layerpri[0] = m_k053251->get_priority(K053251_CI2);
m_sorted_layer[1] = 1;
m_layerpri[1] = k053251_get_priority(m_k053251, K053251_CI4);
m_layerpri[1] = m_k053251->get_priority(K053251_CI4);
m_sorted_layer[2] = 2;
m_layerpri[2] = k053251_get_priority(m_k053251, K053251_CI3);
m_layerpri[2] = m_k053251->get_priority(K053251_CI3);
konami_sortlayers3(m_sorted_layer, m_layerpri);

View File

@ -56,19 +56,19 @@ UINT32 vendetta_state::screen_update_vendetta(screen_device &screen, bitmap_ind1
{
int layer[3];
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI1);
m_layer_colorbase[0] = k053251_get_palette_index(m_k053251, K053251_CI2);
m_layer_colorbase[1] = k053251_get_palette_index(m_k053251, K053251_CI3);
m_layer_colorbase[2] = k053251_get_palette_index(m_k053251, K053251_CI4);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI1);
m_layer_colorbase[0] = m_k053251->get_palette_index(K053251_CI2);
m_layer_colorbase[1] = m_k053251->get_palette_index(K053251_CI3);
m_layer_colorbase[2] = m_k053251->get_palette_index(K053251_CI4);
m_k052109->tilemap_update();
layer[0] = 0;
m_layerpri[0] = k053251_get_priority(m_k053251, K053251_CI2);
m_layerpri[0] = m_k053251->get_priority(K053251_CI2);
layer[1] = 1;
m_layerpri[1] = k053251_get_priority(m_k053251, K053251_CI3);
m_layerpri[1] = m_k053251->get_priority(K053251_CI3);
layer[2] = 2;
m_layerpri[2] = k053251_get_priority(m_k053251, K053251_CI4);
m_layerpri[2] = m_k053251->get_priority(K053251_CI4);
konami_sortlayers3(layer, m_layerpri);

View File

@ -49,13 +49,13 @@ UINT32 xexex_state::screen_update_xexex(screen_device &screen, bitmap_rgb32 &bit
int layer[4];
int bg_colorbase, new_colorbase, plane, alpha;
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI0);
bg_colorbase = k053251_get_palette_index(m_k053251, K053251_CI1);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI0);
bg_colorbase = m_k053251->get_palette_index(K053251_CI1);
m_layer_colorbase[0] = 0x70;
for (plane = 1; plane < 4; plane++)
{
new_colorbase = k053251_get_palette_index(m_k053251, K053251_CI[plane]);
new_colorbase = m_k053251->get_palette_index(K053251_CI[plane]);
if (m_layer_colorbase[plane] != new_colorbase)
{
m_layer_colorbase[plane] = new_colorbase;
@ -64,18 +64,18 @@ UINT32 xexex_state::screen_update_xexex(screen_device &screen, bitmap_rgb32 &bit
}
layer[0] = 1;
m_layerpri[0] = k053251_get_priority(m_k053251, K053251_CI2);
m_layerpri[0] = m_k053251->get_priority(K053251_CI2);
layer[1] = 2;
m_layerpri[1] = k053251_get_priority(m_k053251, K053251_CI3);
m_layerpri[1] = m_k053251->get_priority(K053251_CI3);
layer[2] = 3;
m_layerpri[2] = k053251_get_priority(m_k053251, K053251_CI4);
m_layerpri[2] = m_k053251->get_priority(K053251_CI4);
layer[3] = -1;
m_layerpri[3] = k053251_get_priority(m_k053251, K053251_CI1);
m_layerpri[3] = m_k053251->get_priority(K053251_CI1);
konami_sortlayers4(layer, m_layerpri);
k054338_update_all_shadows(m_k054338, 0);
k054338_fill_backcolor(m_k054338, bitmap, 0);
m_k054338->update_all_shadows(0);
m_k054338->fill_backcolor(bitmap, 0);
machine().priority_bitmap.fill(0, cliprect);
@ -95,7 +95,7 @@ UINT32 xexex_state::screen_update_xexex(screen_device &screen, bitmap_rgb32 &bit
if (m_cur_alpha)
{
alpha = k054338_set_alpha_level(m_k054338, 1);
alpha = m_k054338->set_alpha_level(1);
if (alpha > 0)
{

View File

@ -73,20 +73,20 @@ UINT32 xmen_state::screen_update_xmen(screen_device &screen, bitmap_ind16 &bitma
{
int layer[3], bg_colorbase;
bg_colorbase = k053251_get_palette_index(m_k053251, K053251_CI4);
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI1);
m_layer_colorbase[0] = k053251_get_palette_index(m_k053251, K053251_CI3);
m_layer_colorbase[1] = k053251_get_palette_index(m_k053251, K053251_CI0);
m_layer_colorbase[2] = k053251_get_palette_index(m_k053251, K053251_CI2);
bg_colorbase = m_k053251->get_palette_index(K053251_CI4);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI1);
m_layer_colorbase[0] = m_k053251->get_palette_index(K053251_CI3);
m_layer_colorbase[1] = m_k053251->get_palette_index(K053251_CI0);
m_layer_colorbase[2] = m_k053251->get_palette_index(K053251_CI2);
m_k052109->tilemap_update();
layer[0] = 0;
m_layerpri[0] = k053251_get_priority(m_k053251, K053251_CI3);
m_layerpri[0] = m_k053251->get_priority(K053251_CI3);
layer[1] = 1;
m_layerpri[1] = k053251_get_priority(m_k053251, K053251_CI0);
m_layerpri[1] = m_k053251->get_priority(K053251_CI0);
layer[2] = 2;
m_layerpri[2] = k053251_get_priority(m_k053251, K053251_CI2);
m_layerpri[2] = m_k053251->get_priority(K053251_CI2);
konami_sortlayers3(layer, m_layerpri);
@ -193,20 +193,20 @@ void xmen_state::screen_eof_xmen6p(screen_device &screen, bool state)
}
bg_colorbase = k053251_get_palette_index(m_k053251, K053251_CI4);
m_sprite_colorbase = k053251_get_palette_index(m_k053251, K053251_CI1);
m_layer_colorbase[0] = k053251_get_palette_index(m_k053251, K053251_CI3);
m_layer_colorbase[1] = k053251_get_palette_index(m_k053251, K053251_CI0);
m_layer_colorbase[2] = k053251_get_palette_index(m_k053251, K053251_CI2);
bg_colorbase = m_k053251->get_palette_index(K053251_CI4);
m_sprite_colorbase = m_k053251->get_palette_index(K053251_CI1);
m_layer_colorbase[0] = m_k053251->get_palette_index(K053251_CI3);
m_layer_colorbase[1] = m_k053251->get_palette_index(K053251_CI0);
m_layer_colorbase[2] = m_k053251->get_palette_index(K053251_CI2);
m_k052109->tilemap_update();
layer[0] = 0;
m_layerpri[0] = k053251_get_priority(m_k053251, K053251_CI3);
m_layerpri[0] = m_k053251->get_priority(K053251_CI3);
layer[1] = 1;
m_layerpri[1] = k053251_get_priority(m_k053251, K053251_CI0);
m_layerpri[1] = m_k053251->get_priority(K053251_CI0);
layer[2] = 2;
m_layerpri[2] = k053251_get_priority(m_k053251, K053251_CI2);
m_layerpri[2] = m_k053251->get_priority(K053251_CI2);
konami_sortlayers3(layer, m_layerpri);