Skip to content

Commit 21d5d9c

Browse files
authored
sega/sega_beena.cpp, carbeena.xml: Add Car Beena and BIOS MIDI PCM ROMs (#12503)
* sega/sega_beena.cpp, carbeena.xml: Add Car Beena and BIOS MIDI PCM ROMs New working software items (carbeena.xml) ------------------------- Car Beena Tentou-you Demo 1 [TeamEurope, QUFB]
1 parent 3f6abb1 commit 21d5d9c

File tree

3 files changed

+153
-40
lines changed

3 files changed

+153
-40
lines changed

hash/carbeena.xml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
3+
<!--
4+
license:CC0-1.0
5+
6+
This cartridge is inserted into the mainboard slot, enclosed inside the console.
7+
-->
8+
<softwarelist name="carbeena" description="Car Beena cartridge">
9+
10+
<software name="carbeena" supported="yes">
11+
<description>Car Beena Tentou-you Demo 1</description>
12+
<year>2009</year>
13+
<publisher>Sega Toys</publisher>
14+
<notes>Info from header</notes>
15+
<info name="alt_title" value="カービーナてんとうデモよう1"/>
16+
<info name="serial" value="T-150002-1000"/>
17+
<part name="rom" interface="carbeena_cart">
18+
<dataarea name="rom" size="0x800000">
19+
<rom name="en29lv640.ic10" size="0x800000" crc="bf210b18" sha1="7cb3de21ee704fdc836662a41d38698135572c0d"/>
20+
</dataarea>
21+
</part>
22+
</software>
23+
24+
</softwarelist>

src/mame/mame.lst

+1
Original file line numberDiff line numberDiff line change
@@ -39753,6 +39753,7 @@ sderby2 // (c) 1985
3975339753
@source:sega/sega_beena.cpp
3975439754
beena //
3975539755
tvochken //
39756+
carbeena //
3975639757

3975739758
@source:sega/sega_sawatte.cpp
3975839759
sawatte //

src/mame/sega/sega_beena.cpp

+128-40
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
MIDI audio
1212
Peripherals (including the SD-Card adapter)
1313
Component list / PCB diagram
14+
Fix graphical glitches (e.g. 'Car Beena' scrolling background)
15+
Fix test mode for 'Car Beena' (fails on 'Test EEP')
1416
1517
Hardware
1618
--------
@@ -125,6 +127,10 @@
125127
126128
Toggling 'Memory Cache' allows the player to observe differences between test failure and success.
127129
130+
For 'TV Ocha-Ken', hold down A B C, then power on the system, release all buttons, and press B 3 times.
131+
132+
For 'Car Beena', hold down all 3 buttons, turn the handle left to full lock, then power on the system.
133+
128134
*******************************************************************************/
129135

130136
#include "emu.h"
@@ -1724,12 +1730,51 @@ void sega_9h0_0008_state::sega_9h0_0008(machine_config &config)
17241730
}
17251731

17261732

1727-
class sega_beena_state : public sega_9h0_0008_state
1733+
class sega_9h0_0008_cart_state : public sega_9h0_0008_state
17281734
{
17291735
public:
1730-
sega_beena_state(const machine_config &mconfig, device_type type, const char *tag)
1736+
sega_9h0_0008_cart_state(const machine_config &mconfig, device_type type, const char *tag)
17311737
: sega_9h0_0008_state(mconfig, type, tag)
17321738
, m_cart(*this, "cartslot")
1739+
{ }
1740+
1741+
protected:
1742+
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load);
1743+
1744+
required_device<generic_slot_device> m_cart;
1745+
};
1746+
1747+
DEVICE_IMAGE_LOAD_MEMBER(sega_9h0_0008_cart_state::cart_load)
1748+
{
1749+
uint32_t const size = m_cart->common_get_size("rom");
1750+
1751+
m_cart->rom_alloc(size, GENERIC_ROM32_WIDTH, ENDIANNESS_BIG);
1752+
m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
1753+
1754+
if (!image.loaded_through_softlist()) {
1755+
// loadflags weren't parsed, start by manually applying `endianness="big"`,
1756+
// taking into consideration the host's endianness.
1757+
uint32_t *rom32 = reinterpret_cast<uint32_t *>(m_cart->get_rom_base());
1758+
for (size_t i = 0; i < size / 4; i++) {
1759+
rom32[i] = big_endianize_int32(rom32[i]);
1760+
}
1761+
// Afterwards apply `load16_word_swap`, regardless of host's endianness,
1762+
// since this reflects how ROM data was stored, not the CPU's architecture.
1763+
uint16_t *rom16 = reinterpret_cast<uint16_t *>(m_cart->get_rom_base());
1764+
for (size_t i = 0; i < size / 2; i++) {
1765+
rom16[i] = swapendian_int16(rom16[i]);
1766+
}
1767+
}
1768+
1769+
return std::make_pair(std::error_condition(), std::string());
1770+
}
1771+
1772+
1773+
class sega_beena_state : public sega_9h0_0008_cart_state
1774+
{
1775+
public:
1776+
sega_beena_state(const machine_config &mconfig, device_type type, const char *tag)
1777+
: sega_9h0_0008_cart_state(mconfig, type, tag)
17331778
, m_io_page_config(*this, "PAGE_CONFIG")
17341779
, m_io_page(*this, "PAGE")
17351780
, m_io_pad_left(*this, "PAD_LEFT")
@@ -1745,13 +1790,10 @@ class sega_beena_state : public sega_9h0_0008_state
17451790
virtual DECLARE_CROSSHAIR_MAPPER_MEMBER(pen_y_mapper);
17461791

17471792
private:
1748-
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load);
17491793
virtual void install_game_rom() override;
17501794
virtual void update_crosshair(screen_device &screen) override;
17511795
virtual void update_sensors(offs_t offset) override;
17521796

1753-
required_device<generic_slot_device> m_cart;
1754-
17551797
required_ioport m_io_page_config;
17561798
required_ioport m_io_page;
17571799
required_ioport m_io_pad_left;
@@ -1937,31 +1979,6 @@ void sega_beena_state::update_sensors(offs_t offset)
19371979
}
19381980
}
19391981

1940-
DEVICE_IMAGE_LOAD_MEMBER(sega_beena_state::cart_load)
1941-
{
1942-
uint32_t const size = m_cart->common_get_size("rom");
1943-
1944-
m_cart->rom_alloc(size, GENERIC_ROM32_WIDTH, ENDIANNESS_BIG);
1945-
m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
1946-
1947-
if (!image.loaded_through_softlist()) {
1948-
// loadflags weren't parsed, start by manually applying `endianness="big"`,
1949-
// taking into consideration the host's endianness.
1950-
uint32_t *rom32 = reinterpret_cast<uint32_t *>(m_cart->get_rom_base());
1951-
for (size_t i = 0; i < size / 4; i++) {
1952-
rom32[i] = big_endianize_int32(rom32[i]);
1953-
}
1954-
// Afterwards apply `load16_word_swap`, regardless of host's endianness,
1955-
// since this reflects how ROM data was stored, not the CPU's architecture.
1956-
uint16_t *rom16 = reinterpret_cast<uint16_t *>(m_cart->get_rom_base());
1957-
for (size_t i = 0; i < size / 2; i++) {
1958-
rom16[i] = swapendian_int16(rom16[i]);
1959-
}
1960-
}
1961-
1962-
return std::make_pair(std::error_condition(), std::string());
1963-
}
1964-
19651982
CROSSHAIR_MAPPER_MEMBER(sega_beena_state::pen_y_mapper)
19661983
{
19671984
// TODO: Either remove or adapt for Storyware layout
@@ -2134,6 +2151,58 @@ void tvochken_state::install_game_rom()
21342151
}
21352152

21362153

2154+
class carbeena_state : public sega_9h0_0008_cart_state
2155+
{
2156+
public:
2157+
carbeena_state(const machine_config &mconfig, device_type type, const char *tag)
2158+
: sega_9h0_0008_cart_state(mconfig, type, tag)
2159+
, m_io_buttons(*this, "BUTTONS")
2160+
{ }
2161+
2162+
void carbeena(machine_config &config);
2163+
2164+
virtual uint32_t io_expansion_r() override;
2165+
2166+
private:
2167+
virtual void install_game_rom() override;
2168+
2169+
required_ioport m_io_buttons;
2170+
};
2171+
2172+
void carbeena_state::carbeena(machine_config &config)
2173+
{
2174+
sega_9h0_0008(config);
2175+
2176+
GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "carbeena_cart");
2177+
m_cart->set_endian(ENDIANNESS_BIG);
2178+
m_cart->set_width(GENERIC_ROM32_WIDTH);
2179+
m_cart->set_device_load(FUNC(carbeena_state::cart_load));
2180+
m_cart->set_must_be_loaded(false);
2181+
2182+
SOFTWARE_LIST(config, "cart_list").set_original("carbeena_cart");
2183+
}
2184+
2185+
uint32_t carbeena_state::io_expansion_r()
2186+
{
2187+
return m_io_buttons->read() & 0x3f;
2188+
}
2189+
2190+
void carbeena_state::install_game_rom()
2191+
{
2192+
// TODO: These mappings are controlled by program code via writes to 0x60020004 and 0x60020010.
2193+
// Likely only one of them should be mapped at a time (also suggested by test mode, which only
2194+
// outputs 1 size out of 2 installed ROMs).
2195+
if (m_cart->exists()) {
2196+
std::string region_tag;
2197+
memory_region *cart_rom = m_cart->memregion("cart:rom");
2198+
m_maincpu->space(AS_PROGRAM).install_rom(ROM_FLASH_BASE, ROM_FLASH_BASE + 0x7fffff, 0x800000, cart_rom->base());
2199+
}
2200+
2201+
// Despite being a flash ROM, it gets mapped on the base address usually assigned to mask ROMs.
2202+
memory_region *rom = memregion("mainboard_rom");
2203+
m_maincpu->space(AS_PROGRAM).install_rom(ROM_MASK_BASE, ROM_MASK_BASE + 0x7fffff, 0x800000, rom->base());
2204+
}
2205+
21372206
static INPUT_PORTS_START( sega_9h0_0008 )
21382207
PORT_START("VIDEO_CONFIG")
21392208
PORT_CONFNAME( 0x80, 0x00, "Video Output" )
@@ -2207,17 +2276,27 @@ static INPUT_PORTS_START( tvochken )
22072276
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Scan Card") PORT_WRITE_LINE_MEMBER(tvochken_state, scan_card)
22082277
INPUT_PORTS_END
22092278

2279+
static INPUT_PORTS_START( carbeena )
2280+
PORT_INCLUDE( sega_9h0_0008 )
2281+
2282+
PORT_START("BUTTONS")
2283+
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("Handle Left")
2284+
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("Handle Limit") // TODO: Likely set when turning the handle to full lock
2285+
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("Handle Right")
2286+
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Blue Button") // At the right of the center button, despite being mapped to a lower bit
2287+
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Center Button")
2288+
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Yellow Button")
2289+
INPUT_PORTS_END
22102290

22112291
#define ROM_9H0_0008 \
22122292
/* SoC internal BIOS dumped with a JTAG debugger. */ \
22132293
ROM_REGION32_BE( 0x20000, "maincpu", 0 ) \
2214-
ROM_LOAD( "9h0-0008.bios.ic1", 0x00000000, 0x20000, CRC(5471aaf8) SHA1(33d756b6c64afb0fa377b3f85ab74505e9ae2f9c) )
2215-
2216-
// SoC MIDI synthesizer parameters and PCM data.
2217-
// Control ROM doesn't appear to be memory-mapped, so this data will only
2218-
// be usable when the synthesizer gets reverse engineered.
2219-
// ROM_REGION32_BE( 0x8000, "midipcm", 0 )
2220-
// ROM_LOAD( "9h0-0008.midipcm.ic1", 0x00000000, 0x8000, CRC(ed336d29) SHA1(4af7b7cf7fc4fe8b7a514cde91f930a582742509) )
2294+
ROM_LOAD( "9h0-0008.bios.ic1", 0x00000000, 0x20000, CRC(5471aaf8) SHA1(33d756b6c64afb0fa377b3f85ab74505e9ae2f9c) ) \
2295+
/* SoC MIDI synthesizer parameters and PCM data. */ \
2296+
/* Control ROM doesn't appear to be memory-mapped, so this data will only */ \
2297+
/* be usable when the synthesizer gets reverse engineered. */ \
2298+
ROM_REGION32_BE( 0x8000, "midipcm", 0 ) \
2299+
ROM_LOAD( "9h0-0008.midipcm.ic1", 0x00000000, 0x8000, CRC(ed336d29) SHA1(4af7b7cf7fc4fe8b7a514cde91f930a582742509) )
22212300

22222301
ROM_START( beena )
22232302
ROM_9H0_0008
@@ -2230,8 +2309,17 @@ ROM_START( tvochken )
22302309
ROM_LOAD16_WORD_SWAP( "m5m29gt320vp-80.u3", 0x00000000, 0x400000, CRC(75c1fbc1) SHA1(b07adcabaadb8b684335f52dd953f4696585c819) )
22312310
ROM_END
22322311

2312+
ROM_START( carbeena )
2313+
ROM_9H0_0008
2314+
2315+
ROM_REGION32_BE( 0x800000, "mainboard_rom", ROMREGION_ERASEFF )
2316+
ROM_LOAD16_WORD_SWAP( "en29lv640b.ic9", 0x00000000, 0x800000, CRC(ce6649df) SHA1(e09568b93c9ab0901c6eb32d5e0408e484d4c564) )
2317+
ROM_END
2318+
22332319
} // anonymous namespace
22342320

2235-
// year, name, parent, compat, machine, input, class, init, company, fullname, flags
2236-
CONS( 2005, beena, 0, 0, sega_beena, sega_beena, sega_beena_state, empty_init, "Sega", "Advanced Pico BEENA", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_TIMING|MACHINE_IMPERFECT_SOUND )
2237-
CONS( 2005, tvochken, 0, 0, tvochken, tvochken, tvochken_state, empty_init, "Sega", "TV Ocha-Ken", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_TIMING|MACHINE_IMPERFECT_SOUND )
2321+
// year, name, parent, compat, machine, input, class, init, company, fullname, flags
2322+
CONS( 2005, beena, 0, 0, sega_beena, sega_beena, sega_beena_state, empty_init, "Sega Toys", "Advanced Pico BEENA", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_TIMING|MACHINE_IMPERFECT_SOUND )
2323+
CONS( 2005, tvochken, 0, 0, tvochken, tvochken, tvochken_state, empty_init, "Sega Toys", "TV Ocha-Ken", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_TIMING|MACHINE_IMPERFECT_SOUND )
2324+
// Release date 2009-12: http://products.alpine.co.jp/om/owner/product?P1=1632
2325+
CONS( 2009, carbeena, 0, 0, carbeena, carbeena, carbeena_state, empty_init, "Sega Toys / Alpine Electronics, Inc.", "Car Beena", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_TIMING|MACHINE_IMPERFECT_SOUND )

0 commit comments

Comments
 (0)