summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/drivers/tispeak.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mess/drivers/tispeak.c')
-rw-r--r--src/mess/drivers/tispeak.c77
1 files changed, 66 insertions, 11 deletions
diff --git a/src/mess/drivers/tispeak.c b/src/mess/drivers/tispeak.c
index f7e38da925d..f8fd1f15ed1 100644
--- a/src/mess/drivers/tispeak.c
+++ b/src/mess/drivers/tispeak.c
@@ -10,9 +10,18 @@
#include "cpu/tms0980/tms0980.h"
#include "sound/tms5110.h"
#include "machine/tms6100.h"
+#include "bus/generic/slot.h"
+#include "bus/generic/carts.h"
#include "tispeak.lh"
+// The master clock is a single stage RC oscillator into TMS5100 RCOSC:
+// C is 68pf, R is a 50kohm trimpot wich is set to 33.6kohm. CPUCLK is this/2, ROMCLK is this/4.
+// The osc freq curve is unknown. Let's assume it is set to the default frequency,
+// which is 640kHz according to the TMS5100 documentation.
+
+#define MASTER_CLOCK (640000)
+
class tispeak_state : public driver_device
{
@@ -22,6 +31,7 @@ public:
m_maincpu(*this, "maincpu"),
m_tms5100(*this, "tms5100"),
m_tms6100(*this, "tms6100"),
+ m_cart(*this, "cartslot"),
m_filoff_timer(*this, "filoff"),
m_button_matrix(*this, "IN")
{ }
@@ -29,6 +39,7 @@ public:
required_device<tms0270_cpu_device> m_maincpu;
required_device<tms5100_device> m_tms5100;
required_device<tms6100_device> m_tms6100;
+ optional_device<generic_slot_device> m_cart;
required_device<timer_device> m_filoff_timer;
required_ioport_array<9> m_button_matrix;
@@ -50,6 +61,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(auto_power_off);
void power_off();
+ DECLARE_DEVICE_IMAGE_LOAD_MEMBER(tispeak_cartridge);
virtual void machine_reset();
virtual void machine_start();
};
@@ -58,6 +70,31 @@ public:
/***************************************************************************
+ File Handling
+
+***************************************************************************/
+
+DEVICE_IMAGE_LOAD_MEMBER(tispeak_state, tispeak_cartridge)
+{
+ UINT32 size = m_cart->common_get_size("rom");
+
+ // max size is 16KB
+ if (size > 0x4000)
+ {
+ image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid file size");
+ return IMAGE_INIT_FAIL;
+ }
+
+ m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
+ return IMAGE_INIT_PASS;
+}
+
+
+
+/***************************************************************************
+
VFD Display
***************************************************************************/
@@ -188,12 +225,12 @@ INPUT_CHANGED_MEMBER(tispeak_state::power_button)
{
int on = (int)(FPTR)param;
- if (on)
+ if (on && !m_power_on)
{
m_power_on = 1;
m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
}
- else if (m_power_on)
+ else if (!on && m_power_on)
power_off();
}
@@ -345,15 +382,24 @@ void tispeak_state::machine_start()
save_item(NAME(m_o));
save_item(NAME(m_filament_on));
save_item(NAME(m_power_on));
+
+ // init cartridge
+ astring region_tag;
+ memory_region *src = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG));
+ if (src)
+ {
+ UINT8 *dest_ptr = memregion("tms6100")->base() + 0x8000;
+ memcpy(dest_ptr, src->base(), src->bytes());
+ }
}
-static MACHINE_CONFIG_START( snspell, tispeak_state )
+static MACHINE_CONFIG_START( snmath, tispeak_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS0270, XTAL_640kHz/2)
+ MCFG_CPU_ADD("maincpu", TMS0270, MASTER_CLOCK/2)
MCFG_TMS1XXX_READ_K_CB(READ8(tispeak_state, snspell_read_k))
- MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tispeak_state, snspell_write_o))
+ MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tispeak_state, snmath_write_o))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(tispeak_state, snspell_write_r))
MCFG_TMS1XXX_POWER_OFF_CB(WRITELINE(tispeak_state, auto_power_off))
@@ -367,10 +413,10 @@ static MACHINE_CONFIG_START( snspell, tispeak_state )
/* no video! */
/* sound hardware */
- MCFG_DEVICE_ADD("tms6100", TMS6100, 0)
+ MCFG_DEVICE_ADD("tms6100", TMS6100, MASTER_CLOCK/4)
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("tms5100", TMS5100, XTAL_640kHz)
+ MCFG_SOUND_ADD("tms5100", TMS5100, MASTER_CLOCK)
MCFG_TMS5110_M0_CB(DEVWRITELINE("tms6100", tms6100_device, tms6100_m0_w))
MCFG_TMS5110_M1_CB(DEVWRITELINE("tms6100", tms6100_device, tms6100_m1_w))
MCFG_TMS5110_ADDR_CB(DEVWRITE8("tms6100", tms6100_device, tms6100_addr_w))
@@ -379,11 +425,18 @@ static MACHINE_CONFIG_START( snspell, tispeak_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( snmath, snspell )
+static MACHINE_CONFIG_DERIVED( snspell, snmath )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
- MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tispeak_state, snmath_write_o))
+ MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tispeak_state, snspell_write_o))
+
+ /* cartridge */
+ MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "snspell")
+ MCFG_GENERIC_EXTENSIONS("vsm")
+ MCFG_GENERIC_LOAD(tispeak_state, tispeak_cartridge)
+
+ MCFG_SOFTWARE_LIST_ADD("cart_list", "snspell")
MACHINE_CONFIG_END
@@ -405,14 +458,16 @@ ROM_START( snspell )
ROM_REGION( 1246, "maincpu:opla", 0 )
ROM_LOAD( "tms0270_tmc0271_opla.pla", 0, 1246, CRC(9ebe12ab) SHA1(acb4e07ba26f2daca5f1c234885ac0371c7ce87f) )
- ROM_REGION( 0x8000, "tms6100", 0 )
+ ROM_REGION( 0xc000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff = space reserved for cartridge
ROM_LOAD( "tmc0351.vsm", 0x0000, 0x4000, CRC(beea3373) SHA1(8b0f7586d2f12c3d4a885fdb528cf23feffa1a3b) )
ROM_LOAD( "tmc0352.vsm", 0x4000, 0x4000, CRC(d51f0587) SHA1(ddaa484be1bba5fef46b481cafae517e4acaa8ed) )
ROM_END
ROM_START( snmath )
ROM_REGION( 0x1000, "maincpu", 0 )
- ROM_LOAD( "us4946391_t2074", 0x0000, 0x1000, BAD_DUMP CRC(011f0c2d) SHA1(d2e14d72e03ca864abd51da78ffb71a9da82f624) ) // typed in from patent 4946391, verified with source code (mark BAD_DUMP just to be unsure)
+ // typed in from patent 4946391, verified with source code (mark BAD_DUMP just to be unsure)
+ // BTANB note: Mix It does not work at all, this is an original bug in the prototype. There are probably other minor bugs too.
+ ROM_LOAD( "us4946391_t2074", 0x0000, 0x1000, BAD_DUMP CRC(011f0c2d) SHA1(d2e14d72e03ca864abd51da78ffb71a9da82f624) )
ROM_REGION( 1246, "maincpu:ipla", 0 )
ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) )