diff --git a/hash/kim1_cass.xml b/hash/kim1_cass.xml new file mode 100644 index 00000000000..069a14d5612 --- /dev/null +++ b/hash/kim1_cass.xml @@ -0,0 +1,19 @@ + + + + + + + Microchess + 1976 + Micro-ware Ltd + + + + + + + + + + diff --git a/src/mame/drivers/kim1.cpp b/src/mame/drivers/kim1.cpp index 93caac7ad3e..83fd5eb4fab 100644 --- a/src/mame/drivers/kim1.cpp +++ b/src/mame/drivers/kim1.cpp @@ -27,12 +27,36 @@ 1873 press GO to load tape NOTE: save end address is next address from program end +The cassette interface +====================== +The KIM-1 stores data on cassette using 2 frequencies: ~3700Hz (high) and ~2400Hz +(low). A high tone is output for 9 cycles and a low tone for 6 cycles. A logic bit +is encoded using 3 sequences of high and low tones. It always starts with a high +tone and ends with a low tone. The middle tone is high for a logic 0 and low for +0 logic 1. + +These high and low tone signals are fed to a circuit containing a LM565 PLL and +a 311 comparator. For a high tone a 1 is passed to DB7 of 6530-U2 for a low tone +a 0 is passed. The KIM-1 software measures the time it takes for the signal to +change from 1 to 0. + +Keyboard and Display logic +========================== +PA0-PA6 of 6530-U2 are connected to the columns of the keyboard matrix. These +columns are also connected to segments A-G of the LEDs. PB1-PB3 of 6530-U2 are +connected to a 74145 BCD which connects outputs 0-2 to the rows of the keyboard +matrix. Outputs 4-9 of the 74145 are connected to LEDs U18-U23 + +When a key is pressed the corresponding input to PA0-PA6 is set low and the KIM-1 +software reads this signal. The KIM-1 software sends an output signal to PA0-PA6 +and the corresponding segments of an LED are illuminated. + TODO: - LEDs should be dark at startup (RS key to activate) -- add software list - hook up Single Step dip switch - slots for expansion & application ports - add TTY support +- move functions to machine folder ******************************************************************************/ #include "includes/kim1.h" @@ -111,7 +135,7 @@ static INPUT_PORTS_START( kim1 ) PORT_BIT( 0x01, 0x00, IPT_UNUSED ) INPUT_PORTS_END -// Read from keyboard +// Keyboard input READ8_MEMBER( kim1_state::kim1_u2_read_a ) { UINT8 data = 0xff; @@ -131,7 +155,7 @@ READ8_MEMBER( kim1_state::kim1_u2_read_a ) return data; } -// Write to 7-Segment LEDs +// Display 7-Segment LEDs WRITE8_MEMBER( kim1_state::kim1_u2_write_a ) { UINT8 idx = ( m_u2_port_b >> 1 ) & 0x0f; @@ -222,20 +246,20 @@ void kim1_state::machine_reset() //************************************************************************** static MACHINE_CONFIG_START( kim1, kim1_state ) - // basic machine hardware + /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M6502, 1000000) /* 1 MHz */ MCFG_CPU_PROGRAM_MAP(kim1_map) MCFG_QUANTUM_TIME(attotime::from_hz(60)) - // video hardware + /* video hardware */ MCFG_DEFAULT_LAYOUT( layout_kim1 ) - // sound hardware + /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("dac", DAC, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) - // devices + /* devices */ MCFG_DEVICE_ADD("miot_u2", MOS6530, 1000000) MCFG_MOS6530_IN_PA_CB(READ8(kim1_state, kim1_u2_read_a)) MCFG_MOS6530_OUT_PA_CB(WRITE8(kim1_state, kim1_u2_write_a)) @@ -247,10 +271,15 @@ static MACHINE_CONFIG_START( kim1, kim1_state ) MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_FORMATS(kim1_cassette_formats) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED) + MCFG_CASSETTE_INTERFACE ("kim1_cass") + MCFG_TIMER_DRIVER_ADD_PERIODIC("led_timer", kim1_state, kim1_update_leds, attotime::from_hz(60)) MCFG_TIMER_DRIVER_ADD_PERIODIC("cassette_timer", kim1_state, kim1_cassette_input, attotime::from_hz(44100)) + // software list + MCFG_SOFTWARE_LIST_ADD ("cass_list", "kim1_cass") + MACHINE_CONFIG_END //************************************************************************** @@ -264,8 +293,8 @@ ROM_START(kim1) ROM_END //************************************************************************** -// SYSTEM DRIVERS +// GAME DRIVERS //************************************************************************** -// YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ COMP( 1975, kim1, 0, 0, kim1, kim1, driver_device, 0, "MOS Technologies", "KIM-1" , MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE) diff --git a/src/mame/includes/kim1.h b/src/mame/includes/kim1.h index 255957b0eec..e1e40b76afa 100644 --- a/src/mame/includes/kim1.h +++ b/src/mame/includes/kim1.h @@ -12,6 +12,7 @@ #define __KIM1__ #include "emu.h" +#include "softlist.h" #include "cpu/m6502/m6502.h" #include "machine/mos6530.h" #include "imagedev/cassette.h"