From abd9a7ab8c26c639f37a3ec45e55c272d55fef3a Mon Sep 17 00:00:00 2001
From: DavidHaywood <28625134+DavidHaywood@users.noreply.github.com>
Date: Wed, 20 Mar 2019 16:35:40 +0000
Subject: [PATCH] kill duplicate Sega Beena driver, merge content with existing
one (nw)
---
hash/sega_beena_cart.xml | 27 +++++++----
scripts/target/mame/mess.lua | 1 -
src/mame/drivers/apbeena.cpp | 85 ---------------------------------
src/mame/drivers/sega_beena.cpp | 58 ++++++++++++++++++----
src/mame/mame.lst | 3 --
src/mame/mess.flt | 1 -
6 files changed, 67 insertions(+), 108 deletions(-)
delete mode 100644 src/mame/drivers/apbeena.cpp
diff --git a/hash/sega_beena_cart.xml b/hash/sega_beena_cart.xml
index 95d46c8abbe..a8f5933bffc 100644
--- a/hash/sega_beena_cart.xml
+++ b/hash/sega_beena_cart.xml
@@ -1,18 +1,29 @@
-
-
-
-
- Fresh Pretty Cure
+
+
+ Issho ni Henshin Fresh Pretty Cure
2009
Sega
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua
index 679fd2b198a..4451b161e13 100644
--- a/scripts/target/mame/mess.lua
+++ b/scripts/target/mame/mess.lua
@@ -3040,7 +3040,6 @@ files {
createMESSProjects(_target, _subtarget, "segacons")
files {
- MAME_DIR .. "src/mame/drivers/apbeena.cpp",
MAME_DIR .. "src/mame/drivers/dccons.cpp",
MAME_DIR .. "src/mame/includes/dccons.h",
MAME_DIR .. "src/mame/machine/dccons.cpp",
diff --git a/src/mame/drivers/apbeena.cpp b/src/mame/drivers/apbeena.cpp
deleted file mode 100644
index c83e72ef05e..00000000000
--- a/src/mame/drivers/apbeena.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:R. Belmont
-/***************************************************************************
-
- apbeena.cpp
-
- Skeleton driver for the Sega Advanced Pico BEENA
-
- H/W is custom Sega SoC with ARM7TDMI core at 81 MHz.
-
- TODO:
- Everything!
- Needs the internal BIOS dumped.
-
-***************************************************************************/
-
-#include "emu.h"
-#include "cpu/arm7/arm7.h"
-
-class beena_state : public driver_device
-{
-public:
- beena_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "arm7")
- { }
-
- void beena(machine_config &config);
-
-private:
- void machine_start() override;
- void machine_reset() override;
-
- void beena_arm7_map(address_map &map);
-
- required_device m_maincpu;
-};
-
-void beena_state::beena_arm7_map(address_map &map)
-{
- map(0x00000000, 0x000001ff).rom().region("cart", 0);
- map(0x80000000, 0x807fffff).rom().region("cart", 0);
-}
-
-static INPUT_PORTS_START( beena )
-INPUT_PORTS_END
-
-void beena_state::machine_reset()
-{
-}
-
-void beena_state::machine_start()
-{
-}
-
-void beena_state::beena(machine_config &config)
-{
- ARM7_BE(config, m_maincpu, 81'000'000);
- m_maincpu->set_addrmap(AS_PROGRAM, &beena_state::beena_arm7_map);
-}
-
-ROM_START( apb_frpc )
- ROM_REGION32_BE( 0x80000, "bios", 0 ) // SoC internal BIOS
- ROM_LOAD16_WORD_SWAP( "beenabios.bin", 0x000000, 0x080000, NO_DUMP )
-
- ROM_REGION32_BE( 0x800000, "cart", 0 ) // cartridge ROM
- ROM_LOAD16_WORD_SWAP( "freshprettycure.bin", 0x000000, 0x800000, CRC(afa3466c) SHA1(b49914f97db95f611489487f558d13d7cceb3299) )
-
- ROM_REGION( 0x2000000, "pages", 0 ) // book pages
- ROM_LOAD( "0 - 0010.png", 0x000000, 0x186546b, CRC(6d3d8c91) SHA1(9909322c09277ddd306f10f9a04a897b0fe74961) )
- ROM_LOAD( "0 - 0011.png", 0x000000, 0x179d3a8, CRC(c3911254) SHA1(2d2932e97a0b20a9b5e5fd78a3bbad0f1e146813) )
- ROM_LOAD( "0 - 0005.png", 0x000000, 0x18998f4, CRC(16837cc0) SHA1(eb86b2943cf603a63cd5b94faa0d06ee8a3139d6) )
- ROM_LOAD( "0 - 0007.png", 0x000000, 0x195df07, CRC(efccbb5b) SHA1(83de26d52cb6578d8323551a289223c8a305e37d) )
- ROM_LOAD( "0 - 0008.png", 0x000000, 0x18a9dd8, CRC(7455ebb2) SHA1(34576eee067534535cda838a9e94794e2cfee585) )
- ROM_LOAD( "0 - 0002.png", 0x000000, 0x1e37a3d, CRC(62ae3535) SHA1(d8f6c19c466715df5a568ac7cac8dacb53f2e04a) )
- ROM_LOAD( "0 - 0004.png", 0x000000, 0x19a864d, CRC(edede3ea) SHA1(81914894358c74064aa5f9e980ac37f7140f80c3) )
- ROM_LOAD( "0 - 0003.png", 0x000000, 0x1ce4f16, CRC(fe6c72d9) SHA1(2c4412eb518fbac2e8519c87e53270d960ecab53) )
- ROM_LOAD( "0 - 0009.png", 0x000000, 0x17a5c57, CRC(59ead843) SHA1(29c4cd7929cfd68f41d65024ee5ca3cc62fa4a8b) )
- ROM_LOAD( "0 - 0006.png", 0x000000, 0x195b7e5, CRC(3e307e6d) SHA1(23ed9ab2a4122d7cb33d8d6174ca901b88647b4d) )
- ROM_LOAD( "0 - 0012.png", 0x000000, 0x187a9df, CRC(f1cdc95d) SHA1(aa926c9360edcecdaa3a9ce1b5e17ee61048cee4) )
- ROM_LOAD( "0 - 0001.png", 0x000000, 0x1ca26ec, CRC(d8e18a54) SHA1(887a96931bf622cb673f2550323ad3923eff337e) )
-ROM_END
-
-// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
-CONS( 2009, apb_frpc, 0, 0, beena, beena, beena_state, empty_init, "Sega", "Advanced Pico BEENA: Issho ni Henshin Fresh Pretty Cure", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)
diff --git a/src/mame/drivers/sega_beena.cpp b/src/mame/drivers/sega_beena.cpp
index 10ceb7c14c0..28893dd6a66 100644
--- a/src/mame/drivers/sega_beena.cpp
+++ b/src/mame/drivers/sega_beena.cpp
@@ -1,36 +1,46 @@
// license:BSD-3-Clause
-// copyright-holders:David Haywood
+// copyright-holders:R. Belmont
/******************************************************************************
Sega Beena
- non-video 'book' based learning system, like LeapPad etc.
+ apbeena.cpp
- unknown CPU type (inside Sega custom?)
+ Skeleton driver for the Sega Advanced Pico BEENA
+
+ H/W is custom Sega SoC with ARM7TDMI core at 81 MHz.
+
+ TODO:
+ Everything!
+ Needs the internal BIOS dumped.
+ Component list / PCB diagram
cartridge ROM has 'edinburgh' in the header, maybe a system codename?
ROM is also full of OGG files containing the string 'Encoded with Speex speex-1.0.4'
as well as .mid files for music
- TODO: component list!
-
*******************************************************************************/
#include "emu.h"
#include "bus/generic/slot.h"
#include "bus/generic/carts.h"
+#include "cpu/arm7/arm7.h"
#include "softlist.h"
#include "speaker.h"
+#include "screen.h"
+
class sega_beena_state : public driver_device
{
public:
sega_beena_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "arm7")
, m_cart(*this, "cartslot")
, m_cart_region(nullptr)
+ , m_bank(*this, "cartbank")
{ }
void sega_beena(machine_config &config);
@@ -39,12 +49,24 @@ private:
virtual void machine_start() override;
virtual void machine_reset() override;
+ uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart);
+ void beena_arm7_map(address_map &map);
+
+ required_device m_maincpu;
required_device m_cart;
memory_region *m_cart_region;
+ optional_memory_bank m_bank;
};
+void sega_beena_state::beena_arm7_map(address_map &map)
+{
+ map(0x00000000, 0x000001ff).rom().bankr("cartbank");
+ map(0x80000000, 0x807fffff).rom().bankr("cartbank");
+}
+
void sega_beena_state::machine_start()
{
// if there's a cart, override the standard mapping
@@ -52,6 +74,9 @@ void sega_beena_state::machine_start()
{
std::string region_tag;
m_cart_region = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str());
+
+ m_bank->configure_entries(0, (m_cart_region->bytes() + 0x7fffff) / 0x800000, m_cart_region->base(), 0x800000);
+ m_bank->set_entry(0);
}
}
@@ -66,6 +91,7 @@ DEVICE_IMAGE_LOAD_MEMBER(sega_beena_state, cart)
m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE);
m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
return image_init_result::PASS;
}
@@ -73,11 +99,22 @@ static INPUT_PORTS_START( sega_beena )
INPUT_PORTS_END
+uint32_t sega_beena_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+{
+ return 0;
+}
+
void sega_beena_state::sega_beena(machine_config &config)
{
- // unknown CPU
+ ARM7_BE(config, m_maincpu, 81'000'000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &sega_beena_state::beena_arm7_map);
- // no screen
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(640, 480);
+ screen.set_visarea(0, 640-1, 0, 480-1);
+ screen.set_screen_update(FUNC(sega_beena_state::screen_update));
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
@@ -85,15 +122,16 @@ void sega_beena_state::sega_beena(machine_config &config)
GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "sega_beena_cart");
m_cart->set_width(GENERIC_ROM16_WIDTH);
m_cart->set_device_load(device_image_load_delegate(&sega_beena_state::device_image_load_cart, this));
+ m_cart->set_must_be_loaded(true);
SOFTWARE_LIST(config, "cart_list").set_original("sega_beena_cart");
}
ROM_START( beena )
- ROM_REGION( 0x100000, "maincpu", ROMREGION_ERASEFF )
- // no BIOS or internal to CPU
+ ROM_REGION32_BE( 0x80000, "bios", 0 ) // SoC internal BIOS
+ ROM_LOAD16_WORD_SWAP( "beenabios.bin", 0x000000, 0x080000, NO_DUMP )
ROM_END
// year, name, parent, compat, machine, input, class, init, company, fullname, flags
-CONS( 200?, beena, 0, 0, sega_beena, sega_beena, sega_beena_state, empty_init, "Sega", "Beena", MACHINE_IS_SKELETON )
+CONS( 2009, beena, 0, 0, sega_beena, sega_beena, sega_beena_state, empty_init, "Sega", "Advanced Pico BEENA", MACHINE_IS_SKELETON )
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index b8d84403c57..872d39e9189 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -1292,9 +1292,6 @@ spcpostn // (c) 1986 Sega / Nasco"
@source:anzterm.cpp
anzterm // Burroughs EF315-I220
-@source:apbeena.cpp
-apb_frpc
-
@source:apc.cpp
apc //
diff --git a/src/mame/mess.flt b/src/mame/mess.flt
index a3264c32cb2..4e62ad727fa 100644
--- a/src/mame/mess.flt
+++ b/src/mame/mess.flt
@@ -52,7 +52,6 @@ amstr_pc.cpp
amstrad.cpp
amust.cpp
anzterm.cpp
-apbeena.cpp
apc.cpp
apexc.cpp
apf.cpp