From c763459e3ebd4a3f0e4466fb696ee531106469f6 Mon Sep 17 00:00:00 2001
From: mamehaze <140764005+mamehaze@users.noreply.github.com>
Date: Fri, 11 Apr 2025 16:11:24 +0100
Subject: [PATCH] added a tvdear cart (#13574)
New software list items marked not working
------------------------------------------
Illust-Cassette No. 2 - Bad Badtz-Maru [TeamEurope]
---
hash/tvdear.xml | 12 +++++++++++-
src/mame/skeleton/tvdear.cpp | 20 ++++++++++++++++++++
2 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/hash/tvdear.xml b/hash/tvdear.xml
index 406b3072c70..5e116bd3363 100644
--- a/hash/tvdear.xml
+++ b/hash/tvdear.xml
@@ -9,12 +9,22 @@ license:CC0-1.0
Known undumped carts:
Illust-Cassette No. 1 - Pochacco
- Illust-Cassette No. 2 - Bad Badtz-Maru
There is also a Memory Cassette that may not contain any ROM.
-->
+
+ Illust-Cassette No. 2 - Bad Badtz-Maru
+ 1995
+ Takara
+
+
+
+
+
+
+
Shoujo Manga Collection
1996
diff --git a/src/mame/skeleton/tvdear.cpp b/src/mame/skeleton/tvdear.cpp
index 3a224e2438d..2b3d9edd1ce 100644
--- a/src/mame/skeleton/tvdear.cpp
+++ b/src/mame/skeleton/tvdear.cpp
@@ -4,6 +4,9 @@
// TV Word Processor, with printer
#include "emu.h"
+
+#include "bus/generic/carts.h"
+#include "bus/generic/slot.h"
#include "cpu/nec/v25.h"
#include "softlist_dev.h"
@@ -16,6 +19,7 @@ public:
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "systemcpu")
, m_keyboard(*this, "KEY%u", 0U)
+ , m_cart(*this, "cartslot")
{
}
@@ -32,8 +36,11 @@ private:
void mem_map(address_map &map);
void io_map(address_map &map);
+ DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load);
+
required_device m_maincpu;
required_ioport_array<10> m_keyboard;
+ required_device m_cart;
u8 m_p0 = 0;
};
@@ -175,6 +182,16 @@ static INPUT_PORTS_START(tvdear)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Key 0017")
INPUT_PORTS_END
+DEVICE_IMAGE_LOAD_MEMBER(tvdear_state::cart_load)
+{
+ uint32_t const size = m_cart->common_get_size("rom");
+
+ m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
+ return std::make_pair(std::error_condition(), std::string());
+}
+
void tvdear_state::tvdear(machine_config &config)
{
V25(config, m_maincpu, 16000000); // NEC D70320DGJ-8; XTAL marked 16AKSS5HT
@@ -186,6 +203,9 @@ void tvdear_state::tvdear(machine_config &config)
//MB90076(config, "tvvc", 14318181); // XTAL marked 14AKSS5JT
+ GENERIC_CARTSLOT(config, m_cart, generic_linear_slot, "tvdear_cart");
+ m_cart->set_device_load(FUNC(tvdear_state::cart_load));
+
SOFTWARE_LIST(config, "cart_list").set_original("tvdear");
}