mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
tomy/tomy_princ.cpp: Emulate graphics and inputs (#12428)
This commit is contained in:
parent
72eeb6f664
commit
ae7eb2129d
5 changed files with 1457 additions and 80 deletions
|
@ -4,22 +4,30 @@
|
|||
license:CC0-1.0
|
||||
|
||||
Known undumped titles:
|
||||
New Kazoku de Nengajou
|
||||
- New Kazoku de Nengajou (https://www.youtube.com/watch?v=1eZ72yNZrqc)
|
||||
|
||||
Most (all?) carts share PCB markings: Prin-C E100-T002-11.
|
||||
|
||||
PCBs have surface mount pads for two chips, but only one of them is populated:
|
||||
- Mask ROM carts use U1;
|
||||
- Memory Cassette uses U2 with flash ROM (Fujitsu 29F002T-90);
|
||||
-->
|
||||
|
||||
<softwarelist name="princ" description="Tomy Prin-C cartridges">
|
||||
<software name="bbmaru" supported="no">
|
||||
<software name="bbmaru" supported="yes">
|
||||
<description>Bad Badtz-Maru</description>
|
||||
<year>1996</year>
|
||||
<publisher>Tomy</publisher>
|
||||
<info name="serial" value="IRC #02"/>
|
||||
<part name="rom" interface="princ_cart">
|
||||
<feature name="u1" value="TC534000CF" />
|
||||
<dataarea name="rom" size="0x80000">
|
||||
<rom name="01.bin" size="0x80000" crc="b91a4cb6" sha1="21fcfd16a821796fdf38fe0a23dca93b85fd3339"/>
|
||||
</dataarea>
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="doraemon" supported="no">
|
||||
<software name="doraemon" supported="yes">
|
||||
<description>Doraemon</description> <!-- Character Rom Cassette EX series -->
|
||||
<year>1998</year>
|
||||
<publisher>Tomy</publisher>
|
||||
|
@ -30,58 +38,68 @@ New Kazoku de Nengajou
|
|||
</part>
|
||||
</software>
|
||||
|
||||
<software name="hkitty" supported="no">
|
||||
<software name="hkitty" supported="yes">
|
||||
<description>Hello Kitty</description>
|
||||
<year>1997</year>
|
||||
<publisher>Tomy</publisher>
|
||||
<info name="serial" value="IRC #04"/>
|
||||
<part name="rom" interface="princ_cart">
|
||||
<feature name="u1" value="TC534000CF" />
|
||||
<dataarea name="rom" size="0x80000">
|
||||
<rom name="01.bin" size="0x80000" crc="4f39e051" sha1="4b21bb88797d4edabcdde7c66933f275e85f3dbc"/>
|
||||
</dataarea>
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="hobik" supported="no">
|
||||
<software name="hobik" supported="yes">
|
||||
<description>Hobby Club</description>
|
||||
<year>1996</year>
|
||||
<year>1997</year>
|
||||
<publisher>Tomy</publisher>
|
||||
<info name="alt_title" value="ホビークラブ"/>
|
||||
<info name="serial" value="IRC #06"/>
|
||||
<part name="rom" interface="princ_cart">
|
||||
<feature name="u1" value="TC534000CF" />
|
||||
<dataarea name="rom" size="0x80000">
|
||||
<rom name="01.bin" size="0x80000" crc="ee9f4328" sha1="0a1bb00e261a1076f38cbb2a1337cc146990ed5b"/>
|
||||
</dataarea>
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="kdn" supported="no">
|
||||
<software name="kdn" supported="yes">
|
||||
<description>Kazoku de Nengajou</description>
|
||||
<year>1996</year>
|
||||
<year>1997</year>
|
||||
<publisher>Tomy</publisher>
|
||||
<info name="alt_title" value="家族で年賀状"/>
|
||||
<info name="serial" value="IRC #05"/>
|
||||
<part name="rom" interface="princ_cart">
|
||||
<feature name="u1" value="TC534000CF" />
|
||||
<dataarea name="rom" size="0x80000">
|
||||
<rom name="01.bin" size="0x80000" crc="c6c8f28b" sha1="e182f066084f483f49452f9a8c3b5aa21e404274"/>
|
||||
</dataarea>
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="kno" supported="no">
|
||||
<software name="kno" supported="yes">
|
||||
<description>Kodomo no Omocha</description>
|
||||
<year>1996</year>
|
||||
<publisher>Tomy</publisher>
|
||||
<info name="alt_title" value="こどものおもちゃ"/>
|
||||
<info name="serial" value="IRC #03"/>
|
||||
<part name="rom" interface="princ_cart">
|
||||
<feature name="u1" value="TC534000CF" />
|
||||
<dataarea name="rom" size="0x80000">
|
||||
<rom name="01.bin" size="0x80000" crc="353d4690" sha1="03e7da042a403e7496ea22c11d9f404cf1b7545c"/>
|
||||
</dataarea>
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="pochacco" supported="no">
|
||||
<software name="pochacco" supported="yes">
|
||||
<description>Pochacco</description>
|
||||
<year>1996</year>
|
||||
<publisher>Tomy</publisher>
|
||||
<info name="serial" value="IRC #01"/>
|
||||
<part name="rom" interface="princ_cart">
|
||||
<feature name="u1" value="TC534000CF" />
|
||||
<dataarea name="rom" size="0x80000">
|
||||
<rom name="01.bin" size="0x80000" crc="8cac047a" sha1="bfd26093ff30781f915eca2d61c6025ce4bb7652"/>
|
||||
</dataarea>
|
||||
|
|
|
@ -29,7 +29,13 @@ DEFINE_DEVICE_TYPE(MB90641A, mb90641_device, "mb90641a", "Fujitsu MB90641A")
|
|||
//-------------------------------------------------
|
||||
mb9061x_device::mb9061x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal_map) :
|
||||
f2mc16_device(mconfig, type, tag, owner, clock),
|
||||
m_program_config("program", ENDIANNESS_LITTLE, 8, 24, 0, internal_map)
|
||||
m_program_config("program", ENDIANNESS_LITTLE, 8, 24, 0, internal_map),
|
||||
m_read_port(*this, 0xff),
|
||||
m_write_port(*this),
|
||||
m_read_adcs(*this, 0xff),
|
||||
m_write_adcs(*this),
|
||||
m_read_adcr(*this, 0xff),
|
||||
m_write_adcr(*this)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -77,6 +83,9 @@ void mb9061x_device::execute_set_input(int inputnum, int state)
|
|||
/* MB90610 - "Evaluation device" with extra RAM */
|
||||
void mb90610_device::mb90610_map(address_map &map)
|
||||
{
|
||||
map(0x0001, 0x000a).rw(FUNC(mb9061x_device::port_r), FUNC(mb9061x_device::port_w));
|
||||
map(0x002c, 0x002d).rw(FUNC(mb9061x_device::adcs_r), FUNC(mb9061x_device::adcs_w));
|
||||
map(0x002e, 0x002f).rw(FUNC(mb9061x_device::adcr_r), FUNC(mb9061x_device::adcr_w));
|
||||
map(0x00a9, 0x00a9).rw(FUNC(mb9061x_device::tbtc_r), FUNC(mb9061x_device::tbtc_w));
|
||||
map(0x00b0, 0x00bf).rw(FUNC(mb9061x_device::intc_r), FUNC(mb9061x_device::intc_w));
|
||||
map(0x0100, 0x10ff).ram(); // 4K of internal RAM from 0x100 to 0x1100
|
||||
|
@ -406,6 +415,9 @@ void mb9061x_device::intc_clear_irq(int icr, int vector)
|
|||
/* MB90611 - Production version of this series */
|
||||
void mb90611_device::mb90611_map(address_map &map)
|
||||
{
|
||||
map(0x0001, 0x000a).rw(FUNC(mb9061x_device::port_r), FUNC(mb9061x_device::port_w));
|
||||
map(0x002c, 0x002d).rw(FUNC(mb9061x_device::adcs_r), FUNC(mb9061x_device::adcs_w));
|
||||
map(0x002e, 0x002f).rw(FUNC(mb9061x_device::adcr_r), FUNC(mb9061x_device::adcr_w));
|
||||
map(0x0038, 0x003f).rw(FUNC(mb9061x_device::timer_r), FUNC(mb9061x_device::timer_w));
|
||||
map(0x00a9, 0x00a9).rw(FUNC(mb9061x_device::tbtc_r), FUNC(mb9061x_device::tbtc_w));
|
||||
map(0x00b0, 0x00bf).rw(FUNC(mb9061x_device::intc_r), FUNC(mb9061x_device::intc_w));
|
||||
|
@ -425,6 +437,9 @@ mb90611_device::mb90611_device(const machine_config &mconfig, device_type type,
|
|||
/* MB90641 - no A/D, extra UART and timers, optional internal ROM */
|
||||
void mb90641_device::mb90641_map(address_map &map)
|
||||
{
|
||||
map(0x0001, 0x000a).rw(FUNC(mb9061x_device::port_r), FUNC(mb9061x_device::port_w));
|
||||
map(0x002c, 0x002d).rw(FUNC(mb9061x_device::adcs_r), FUNC(mb9061x_device::adcs_w));
|
||||
map(0x002e, 0x002f).rw(FUNC(mb9061x_device::adcr_r), FUNC(mb9061x_device::adcr_w));
|
||||
map(0x0038, 0x003f).rw(FUNC(mb9061x_device::timer_r), FUNC(mb9061x_device::timer_w));
|
||||
map(0x00a9, 0x00a9).rw(FUNC(mb9061x_device::tbtc_r), FUNC(mb9061x_device::tbtc_w));
|
||||
map(0x00b0, 0x00bf).rw(FUNC(mb9061x_device::intc_r), FUNC(mb9061x_device::intc_w));
|
||||
|
|
|
@ -26,12 +26,61 @@ class mb9061x_device : public f2mc16_device
|
|||
public:
|
||||
const address_space_config m_program_config;
|
||||
|
||||
// port registers
|
||||
enum
|
||||
{
|
||||
PDR1 = 0, PDR2, PDR3, PDR4, PDR5, PDR6, PDR7, PDR8, PDR9, PDRA
|
||||
};
|
||||
|
||||
// interrupts handled by the interrupt controller
|
||||
enum
|
||||
{
|
||||
ICR0 = 0, ICR1, ICR2, ICR3, ICR4, ICR5, ICR6, ICR7, ICR8, ICR9, ICR10, ICR11, ICR12, ICR13, ICR14, ICR15
|
||||
};
|
||||
|
||||
auto read_pdr1() { return m_read_port [PDR1].bind(); }
|
||||
auto write_pdr1() { return m_write_port[PDR1].bind(); }
|
||||
auto read_pdr2() { return m_read_port [PDR2].bind(); }
|
||||
auto write_pdr2() { return m_write_port[PDR2].bind(); }
|
||||
auto read_pdr3() { return m_read_port [PDR3].bind(); }
|
||||
auto write_pdr3() { return m_write_port[PDR3].bind(); }
|
||||
auto read_pdr4() { return m_read_port [PDR4].bind(); }
|
||||
auto write_pdr4() { return m_write_port[PDR4].bind(); }
|
||||
auto read_pdr5() { return m_read_port [PDR5].bind(); }
|
||||
auto write_pdr5() { return m_write_port[PDR5].bind(); }
|
||||
auto read_pdr6() { return m_read_port [PDR6].bind(); }
|
||||
auto write_pdr6() { return m_write_port[PDR6].bind(); }
|
||||
auto read_pdr7() { return m_read_port [PDR7].bind(); }
|
||||
auto write_pdr7() { return m_write_port[PDR7].bind(); }
|
||||
auto read_pdr8() { return m_read_port [PDR8].bind(); }
|
||||
auto write_pdr8() { return m_write_port[PDR8].bind(); }
|
||||
auto read_pdr9() { return m_read_port [PDR9].bind(); }
|
||||
auto write_pdr9() { return m_write_port[PDR9].bind(); }
|
||||
auto read_pdra() { return m_read_port [PDRA].bind(); }
|
||||
auto write_pdra() { return m_write_port[PDRA].bind(); }
|
||||
auto read_adcs() { return m_read_adcs .bind(); }
|
||||
auto write_adcs() { return m_write_adcs.bind(); }
|
||||
auto read_adcr() { return m_read_adcr .bind(); }
|
||||
auto write_adcr() { return m_write_adcr.bind(); }
|
||||
|
||||
// port functions
|
||||
u8 read_port(offs_t offset) { return m_ports[offset]; }
|
||||
void write_port(offs_t offset, u8 data) { m_ports[offset] = data; }
|
||||
u8 port_r(offs_t offset) { return m_read_port[offset](); }
|
||||
void port_w(offs_t offset, u8 data) { write_port(offset, data); m_write_port[offset](0, data); }
|
||||
|
||||
// analog/digital control status functions
|
||||
u16 read_reg_adcs() { return m_adcs; }
|
||||
void write_reg_adcs(offs_t offset, u8 data) { m_adcs = (offset == 0) ? (data | (m_adcs & 0xff00)) : ((data << 8) | (m_adcs & 0x00ff)); }
|
||||
u8 adcs_r(offs_t offset) { return (offset == 0 ? m_read_adcs() : m_read_adcs() >> 8) & 0xff; }
|
||||
void adcs_w(offs_t offset, u8 data) { write_reg_adcs(offset, data); m_write_adcs(offset, data); }
|
||||
|
||||
// analog/digital data functions
|
||||
u16 read_reg_adcr() { return m_adcr; }
|
||||
void write_reg_adcr(offs_t offset, u8 data) { m_adcr = (offset == 0) ? (data | (m_adcr & 0xff00)) : ((data << 8) | (m_adcr & 0x00ff)); }
|
||||
u8 adcr_r(offs_t offset) { return (offset == 0 ? m_read_adcr() : m_read_adcr() >> 8) & 0xff; }
|
||||
void adcr_w(offs_t offset, u8 data) { write_reg_adcr(offset, data); m_write_adcr(offset, data); }
|
||||
|
||||
// timer external counter tick functions
|
||||
void tin0_w(int state);
|
||||
void tin1_w(int state);
|
||||
|
@ -47,6 +96,8 @@ protected:
|
|||
virtual space_config_vector memory_space_config() const override;
|
||||
|
||||
private:
|
||||
static inline constexpr u8 PORT_COUNT = 10;
|
||||
|
||||
// TBC
|
||||
TIMER_CALLBACK_MEMBER(tbtc_tick);
|
||||
u8 tbtc_r();
|
||||
|
@ -66,6 +117,20 @@ private:
|
|||
void recalc_timer(int tnum);
|
||||
void tin_common(int timer, int base, int state);
|
||||
|
||||
// PORTS
|
||||
// TODO: Control input and output values with direction registers
|
||||
u8 m_ports[PORT_COUNT];
|
||||
devcb_read8::array<PORT_COUNT> m_read_port;
|
||||
devcb_write8::array<PORT_COUNT> m_write_port;
|
||||
|
||||
// AD
|
||||
u16 m_adcs;
|
||||
u16 m_adcr;
|
||||
devcb_read16 m_read_adcs;
|
||||
devcb_write8 m_write_adcs;
|
||||
devcb_read16 m_read_adcr;
|
||||
devcb_write8 m_write_adcr;
|
||||
|
||||
u8 m_timer_regs[8];
|
||||
u32 m_timer_hz[2];
|
||||
emu_timer *m_timer[2];
|
||||
|
|
|
@ -44838,8 +44838,9 @@ wardnerjb // bootleg
|
|||
kisssite
|
||||
|
||||
@source:tomy/tomy_princ.cpp
|
||||
princ // Tomy Prin-C (Japan)
|
||||
princnt // Tomy Prin-C (without touch-pad)
|
||||
princnt // Tomy Prin-C (Japan) Rev 1
|
||||
princnt3 // Tomy Prin-C (Japan) Rev 3
|
||||
princ // Tomy Prin-C Tablet (Japan)
|
||||
|
||||
@source:tomy/tutor.cpp
|
||||
pyuuta // 1982 Tomy Pyuuta
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue