From cfb1fbd0be9109de046ebe3e5c885d808931d0e7 Mon Sep 17 00:00:00 2001 From: David Haywood Date: Fri, 2 Nov 2018 01:15:06 +0000 Subject: Xavix - basic timer, move ekara carts to a Softlist (#4227) * change how colours scale a bit (nw) * basic timer stuff (fixed frequency for now) * ekara now uses a Software List * (nw) --- hash/ekara.xml | 73 ++++++++++++++++++++++++++++++++++++++++++++ src/mame/drivers/xavix.cpp | 75 +++++++++++++++++++++++++++------------------- src/mame/includes/xavix.h | 18 +++++++++++ src/mame/machine/xavix.cpp | 44 +++++++++++++++++++++++++-- src/mame/mame.lst | 5 +--- src/mame/video/xavix.cpp | 12 ++++++-- 6 files changed, 187 insertions(+), 40 deletions(-) create mode 100644 hash/ekara.xml diff --git a/hash/ekara.xml b/hash/ekara.xml new file mode 100644 index 00000000000..d84d7c809e1 --- /dev/null +++ b/hash/ekara.xml @@ -0,0 +1,73 @@ + + + + + + + + + + e-kara US 5-Songs Starter (US-M001) + 2000 + Takara + + + + + + + + + + e-kara US Volume 1 (US-E001) + 2000 + Takara + + + + + + + + + + e-kara US Volume 2 (US-E002) + 2000 + Takara + + + + + + + + diff --git a/src/mame/drivers/xavix.cpp b/src/mame/drivers/xavix.cpp index b79f36fd0dd..40e4cea5d18 100644 --- a/src/mame/drivers/xavix.cpp +++ b/src/mame/drivers/xavix.cpp @@ -612,6 +612,14 @@ static INPUT_PORTS_START( rad_bass ) INPUT_PORTS_END +static INPUT_PORTS_START( ekara ) + PORT_INCLUDE(xavix) + + PORT_MODIFY("IN1") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_POWER_OFF ) PORT_NAME("Power Switch") // pressing this will turn the game off. + +INPUT_PORTS_END + static INPUT_PORTS_START( rad_bassp ) PORT_INCLUDE(rad_bass) @@ -860,6 +868,39 @@ MACHINE_CONFIG_START(xavix_state::xavix2000_i2c_24c02) I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24C02 MACHINE_CONFIG_END + + +DEVICE_IMAGE_LOAD_MEMBER( xavix_ekara_state, ekara_cart ) +{ + uint32_t size = m_cart->common_get_size("rom"); + std::vector temp; + temp.resize(size); + m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); + m_cart->common_load_rom(&temp[0], size, "rom"); + + memcpy(memregion("bios")->base(), &temp[0], size); + + return image_init_result::PASS; +} + + +MACHINE_CONFIG_START(xavix_ekara_state::xavix_ekara) + xavix(config); + + MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "ekara_cart") + MCFG_GENERIC_EXTENSIONS("bin") + MCFG_GENERIC_WIDTH(GENERIC_ROM8_WIDTH) + MCFG_GENERIC_LOAD(xavix_ekara_state, ekara_cart) + + /* software lists */ + MCFG_SOFTWARE_LIST_ADD("cart_list","ekara") + +MACHINE_CONFIG_END + + + + + void xavix_state::init_xavix() { m_rgnlen = memregion("bios")->bytes(); @@ -979,34 +1020,12 @@ ROM_END it etc. */ -#define EKARA_BASE_ROM \ - ROM_LOAD( "ekara.bin", 0x600000, 0x100000, CRC(9b27c4a2) SHA1(d75dda7434933135d2f7e353840a9384e9a0d586) ) - - -ROM_START( eka_base ) +ROM_START( ekara ) ROM_REGION( 0x800000, "bios", ROMREGION_ERASE00 ) - EKARA_BASE_ROM + ROM_LOAD( "ekara.bin", 0x600000, 0x100000, CRC(9b27c4a2) SHA1(d75dda7434933135d2f7e353840a9384e9a0d586) ) ROM_RELOAD(0x000000, 0x100000) ROM_END -ROM_START( eka_strt ) - ROM_REGION( 0x800000, "bios", ROMREGION_ERASE00 ) - EKARA_BASE_ROM - ROM_LOAD( "ekarastartcart.bin", 0x000000, 0x080000, CRC(8c12c0c2) SHA1(8cc1b098894af25a4bfccada884125b66f5fe8b2) ) -ROM_END - -ROM_START( eka_vol1 ) - ROM_REGION( 0x800000, "bios", ROMREGION_ERASE00 ) - EKARA_BASE_ROM - ROM_LOAD( "ekaravol1.bin", 0x000000, 0x100000, CRC(29df4aea) SHA1(b95835aaf8630b61b47e5da0968cd4a1dd3bc517) ) -ROM_END - -ROM_START( eka_vol2 ) - ROM_REGION( 0x800000, "bios", ROMREGION_ERASE00 ) - EKARA_BASE_ROM - ROM_LOAD( "ekaravol2.bin", 0x000000, 0x100000, CRC(6c66772e) SHA1(e1e719df1e51caaafd9b3af187059334f7abbba3) ) -ROM_END - ROM_START( has_wamg ) ROM_REGION( 0x400000, "bios", ROMREGION_ERASE00 ) ROM_LOAD( "minigolf.bin", 0x000000, 0x400000, CRC(35cee2ad) SHA1(c7344e8ba336bc329638485ea571cd731ebf7649) ) @@ -1052,13 +1071,7 @@ CONS( 200?, epo_efdx, 0, 0, xavix_i2c_24c08, xavix, xavix_state, CONS( 200?, has_wamg, 0, 0, xavix, xavix, xavix_state, init_xavix, "Hasbro / Milton Bradley / SSD Company LTD", "TV Wild Adventure Mini Golf", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND) -CONS( 200?, eka_base, 0, 0, xavix, xavix, xavix_state, init_xavix, "Takara / Hasbro / SSD Company LTD", "e-kara (US?)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND|MACHINE_IS_BIOS_ROOT) - -CONS( 200?, eka_strt, eka_base, 0, xavix, xavix, xavix_state, init_xavix, "Takara / Hasbro / SSD Company LTD", "e-kara Starter (US?)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND) - -CONS( 200?, eka_vol1, eka_base, 0, xavix, xavix, xavix_state, init_xavix, "Takara / Hasbro / SSD Company LTD", "e-kara Volume 1 (US?)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND) // insert calls it 'HIT MIX Vol 1' - -CONS( 200?, eka_vol2, eka_base, 0, xavix, xavix , xavix_state, init_xavix, "Takara / Hasbro / SSD Company LTD", "e-kara Volume 2 (US?)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND) // insert calls it 'HIT MIX Vol 2' +CONS( 200?, ekara, 0, 0, xavix_ekara, ekara, xavix_ekara_state, init_xavix, "Takara / Hasbro / SSD Company LTD", "e-kara (US?)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND|MACHINE_IS_BIOS_ROOT) /* The 'XaviXPORT' isn't a real console, more of a TV adapter, all the actual hardware (CPU including video hw, sound hw) is in the cartridges and controllers and can vary between games, see notes at top of driver. diff --git a/src/mame/includes/xavix.h b/src/mame/includes/xavix.h index b9c61a873ce..6f3a08152ff 100644 --- a/src/mame/includes/xavix.h +++ b/src/mame/includes/xavix.h @@ -11,6 +11,8 @@ #include "speaker.h" #include "machine/bankdev.h" #include "machine/i2cmem.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" class xavix_state : public driver_device @@ -314,4 +316,20 @@ void superxavix_lowbus_map(address_map &map); optional_device m_i2cmem; }; +class xavix_ekara_state : public xavix_state +{ +public: + xavix_ekara_state(const machine_config &mconfig, device_type type, const char *tag) + : xavix_state(mconfig, type, tag), + m_cart(*this, "cartslot") + { } + + void xavix_ekara(machine_config &config); + +protected: + required_device m_cart; + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(ekara_cart); + //READ8_MEMBER(cart_r) { return m_cart->read_rom(space, offset); } +}; + #endif // MAME_INCLUDES_XAVIX_H diff --git a/src/mame/machine/xavix.cpp b/src/mame/machine/xavix.cpp index 80362a38434..4704fd2ca5f 100644 --- a/src/mame/machine/xavix.cpp +++ b/src/mame/machine/xavix.cpp @@ -400,8 +400,39 @@ READ8_MEMBER(xavix_state::timer_status_r) WRITE8_MEMBER(xavix_state::timer_control_w) { - LOG("%s: timer_control_w %02x\n", machine().describe_context(), data); + /* timer is actively used by + ttv_lotr, ttv_sw, drgqst, has_wamg, rad_rh, eka_*, epo_efdx, rad_bass, rad_bb2 + + gets turned on briefly during the bootup of rad_crdn, but then off again + + runs during rad_fb / rad_madf, but with IRQs turned off + + disabled for rad_snow, rad_ping, rad_mtrk, rad_box, *nostalgia, ttv_mx, xavtenni + */ + + //LOG("%s: timer_control_w %02x\n", machine().describe_context(), data); m_timer_control = data; + + if (data & 0x80) // tends to read+write address to ack interrupts, assume it's similar to other things and top bit will clear IRQ (usually gets written all the time when starting timer) + { + if (m_irqsource & 0x10) + { + m_irqsource &= ~0x10; + update_irqs(); + } + } + + // has_wamg, ttv_sw, eka_*, rad_bass set bit 0x02 too (maybe reload related?) + + // rad_fb / rad_madf don't set bit 0x40 (and doesn't seem to have a valid interrupt handler for timer, so probably means it generates no IRQ?) + if (data & 0x01) // timer start? + { + m_freq_timer->adjust(attotime::from_usec(50000)); + } + else + { + m_freq_timer->adjust(attotime::never, 0); + } } WRITE8_MEMBER(xavix_state::timer_baseval_w) @@ -449,7 +480,16 @@ WRITE8_MEMBER(xavix_state::timer_freq_w) TIMER_CALLBACK_MEMBER(xavix_state::freq_timer_done) { - + if (m_timer_control & 0x40) // Timer IRQ enable? + { + m_irqsource |= 0x10; + m_timer_control |= 0x80; + update_irqs(); + } + + //logerror("freq_timer_done\n"); + // reload + //m_freq_timer->adjust(attotime::from_usec(50000)); } diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 0408fb03071..c10f0cc92bd 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -39532,10 +39532,7 @@ rad_fb // epo_efdx // rad_rh // has_wamg // -eka_base // -eka_strt // -eka_vol1 // -eka_vol2 // +ekara // xavtenni // ttv_sw // ttv_lotr // diff --git a/src/mame/video/xavix.cpp b/src/mame/video/xavix.cpp index 08dca3a2527..7730560db9f 100644 --- a/src/mame/video/xavix.cpp +++ b/src/mame/video/xavix.cpp @@ -86,14 +86,20 @@ void xavix_state::handle_palette(screen_device &screen, bitmap_ind16 &bitmap, co //if (h_raw > 24) // LOG("hraw >24 (%02x)\n", h_raw); - //if (l_raw > 17) - // LOG("lraw >17 (%02x)\n", l_raw); + //if (l_raw > 24) + // LOG("lraw >24 (%02x)\n", l_raw); //if (s_raw > 7) // LOG("s_raw >5 (%02x)\n", s_raw); - double l = (double)l_raw / 17.0f; + double l = (double)l_raw / 24.0f; // ekara and drgqst go up to 23 during fades, expect that to be brightest + l = l * (std::atan(1)*2); // does not appear to be a linear curve + l = std::sin(l); + double s = (double)s_raw / 7.0f; + s = s * (std::atan(1)*2); // does not appear to be a linear curve + s = std::sin(s); + double h = (double)h_raw / 24.0f; // hue values 24-31 render as transparent double r, g, b; -- cgit v1.2.3