diff options
Diffstat (limited to 'src/mame/drivers/fidel6502.cpp')
-rw-r--r-- | src/mame/drivers/fidel6502.cpp | 81 |
1 files changed, 40 insertions, 41 deletions
diff --git a/src/mame/drivers/fidel6502.cpp b/src/mame/drivers/fidel6502.cpp index 08b725beed3..b7d10af30f3 100644 --- a/src/mame/drivers/fidel6502.cpp +++ b/src/mame/drivers/fidel6502.cpp @@ -235,7 +235,7 @@ CPU is a R65C02P4, running at 4MHz NE556 dual-timer IC: - timer#1, one-shot at power-on, to CPU _RESET -- timer#2: R1=82K+50K pot at 26K, R2=1K, C=22nf, to CPU _IRQ: ~596Hz, active low=15.25us +- timer#2: R1=82K+50K pot at 26K, R2=1K, C=22nF, to CPU _IRQ: ~596Hz, active low=15.25us Memory map: ----------- @@ -383,8 +383,7 @@ I/O is via TTL, very similar to Designer Display ******************************************************************************/ -#include "emu.h" -#include "includes/fidelz80.h" +#include "includes/fidelbase.h" #include "cpu/m6502/m6502.h" #include "cpu/m6502/r65c02.h" #include "cpu/m6502/m65sc02.h" @@ -409,11 +408,11 @@ I/O is via TTL, very similar to Designer Display #include "fidel_su9.lh" // clickable -class fidel6502_state : public fidelz80base_state +class fidel6502_state : public fidelbase_state { public: fidel6502_state(const machine_config &mconfig, device_type type, const char *tag) - : fidelz80base_state(mconfig, type, tag), + : fidelbase_state(mconfig, type, tag), m_ppi8255(*this, "ppi8255"), m_cart(*this, "cartslot") { } @@ -535,7 +534,7 @@ WRITE8_MEMBER(fidel6502_state::csc_pia0_pb_w) READ8_MEMBER(fidel6502_state::csc_pia0_pb_r) { // d2: printer? - uint8_t data = 0x04; + u8 data = 0x04; // d3: TSI BUSY line if (m_speech->busy_r()) @@ -679,7 +678,7 @@ WRITE8_MEMBER(fidel6502_state::eas_ppi_portc_w) READ8_MEMBER(fidel6502_state::eas_ppi_portb_r) { // d0: printer? white wire from LED pcb - uint8_t data = 1; + u8 data = 1; // d1: TSI BUSY line data |= (m_speech->busy_r()) ? 2 : 0; @@ -712,7 +711,7 @@ WRITE8_MEMBER(fidel6502_state::sc9_control_w) { // d0-d3: 74245 P0-P3 // 74245 Q0-Q8: input mux, led select - uint16_t sel = 1 << (data & 0xf) & 0x3ff; + u16 sel = 1 << (data & 0xf) & 0x3ff; m_inp_mux = sel & 0x1ff; sc9_prepare_display(); @@ -748,7 +747,7 @@ WRITE8_MEMBER(fidel6502_state::sc12_control_w) { // d0-d3: 7442 a0-a3 // 7442 0-8: led data, input mux - uint16_t sel = 1 << (data & 0xf) & 0x3ff; + u16 sel = 1 << (data & 0xf) & 0x3ff; m_inp_mux = sel & 0x1ff; // 7442 9: speaker out @@ -803,24 +802,24 @@ READ8_MEMBER(fidel6502_state::fexcelv_speech_r) WRITE8_MEMBER(fidel6502_state::fexcel_ttl_w) { // a0-a2,d0: 74259(1) - uint8_t mask = 1 << offset; + u8 mask = 1 << offset; m_led_select = (m_led_select & ~mask) | ((data & 1) ? mask : 0); // 74259 Q0-Q3: 7442 a0-a3 // 7442 0-8: led data, input mux - uint16_t sel = 1 << (m_led_select & 0xf) & 0x3ff; - uint8_t led_data = sel & 0xff; + u16 sel = 1 << (m_led_select & 0xf) & 0x3ff; + u8 led_data = sel & 0xff; m_inp_mux = sel & 0x1ff; // 7442 9: speaker out m_dac->write(BIT(sel, 9)); // 74259 Q4-Q7,Q2,Q1: digit/led select (active low) - uint8_t led_sel = ~BITSWAP8(m_led_select,0,3,1,2,7,6,5,4) & 0x3f; + u8 led_sel = ~BITSWAP8(m_led_select,0,3,1,2,7,6,5,4) & 0x3f; // a0-a2,d1: digit segment data (model 6093) m_7seg_data = (m_7seg_data & ~mask) | ((data & 2) ? mask : 0); - uint8_t seg_data = BITSWAP8(m_7seg_data,0,1,3,2,7,5,6,4); + u8 seg_data = BITSWAP8(m_7seg_data,0,1,3,2,7,5,6,4); // update display: 4 7seg leds, 2*8 chessboard leds for (int i = 0; i < 6; i++) @@ -850,7 +849,7 @@ WRITE8_MEMBER(fidel6502_state::fexcel_ttl_w) READ8_MEMBER(fidel6502_state::fexcelb_ttl_r) { // a0-a2,d6: from speech board: language switches and TSI BUSY line, otherwise tied to VCC - uint8_t d6 = (m_inp_matrix[9].read_safe(0xff) >> offset & 1) ? 0x40 : 0; + u8 d6 = (m_inp_matrix[9].read_safe(0xff) >> offset & 1) ? 0x40 : 0; // a0-a2,d7: multiplexed inputs (active low) return d6 | ((read_inputs(9) >> offset & 1) ? 0 : 0x80); @@ -858,7 +857,7 @@ READ8_MEMBER(fidel6502_state::fexcelb_ttl_r) READ8_MEMBER(fidel6502_state::fexcel_ttl_r) { - uint8_t d7 = 0x80; + u8 d7 = 0x80; // 74259(1) Q7 + 74251 I0: battery status if (m_inp_mux == 1 && ~m_led_select & 0x80) @@ -878,15 +877,15 @@ READ8_MEMBER(fidel6502_state::fexcel_ttl_r) WRITE8_MEMBER(fidel6502_state::fdesdis_control_w) { - uint8_t q3_old = m_led_select & 8; + u8 q3_old = m_led_select & 8; // a0-a2,d7: 74259 - uint8_t mask = 1 << offset; + u8 mask = 1 << offset; m_led_select = (m_led_select & ~mask) | ((data & 0x80) ? mask : 0); // 74259 Q4-Q7: 7442 a0-a3 // 7442 0-8: led data, input mux - uint16_t sel = 1 << (m_led_select >> 4 & 0xf) & 0x3ff; + u16 sel = 1 << (m_led_select >> 4 & 0xf) & 0x3ff; m_inp_mux = sel & 0x1ff; // 7442 9: speaker out @@ -913,7 +912,7 @@ WRITE8_MEMBER(fidel6502_state::fdesdis_control_w) WRITE8_MEMBER(fidel6502_state::fdesdis_lcd_w) { // a0-a2,d0-d3: 4*74259 to lcd digit segments - uint32_t mask = BITSWAP8(1 << offset,3,7,6,0,1,2,4,5); + u32 mask = BITSWAP8(1 << offset,3,7,6,0,1,2,4,5); for (int i = 0; i < 4; i++) { m_7seg_data = (m_7seg_data & ~mask) | ((data >> i & 1) ? 0 : mask); @@ -943,12 +942,12 @@ DRIVER_INIT_MEMBER(fidel6502_state, fdesdis) WRITE8_MEMBER(fidel6502_state::chesster_control_w) { // a0-a2,d7: 74259(1) - uint8_t mask = 1 << offset; + u8 mask = 1 << offset; m_led_select = (m_led_select & ~mask) | ((data & 0x80) ? mask : 0); // 74259 Q4-Q7: 7442 a0-a3 // 7442 0-8: led data, input mux - uint16_t sel = 1 << (m_led_select >> 4 & 0xf) & 0x3ff; + u16 sel = 1 << (m_led_select >> 4 & 0xf) & 0x3ff; m_inp_mux = sel & 0x1ff; // 74259 Q0,Q1: led select (active low) @@ -1554,7 +1553,7 @@ static MACHINE_CONFIG_START( rsc, fidel6502_state ) MCFG_PIA_CA2_HANDLER(WRITELINE(fidel6502_state, csc_pia1_ca2_w)) MCFG_PIA_CB2_HANDLER(WRITELINE(fidel6502_state, csc_pia1_cb2_w)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_fidel_rsc_v2) /* sound hardware */ @@ -1569,7 +1568,7 @@ static MACHINE_CONFIG_START( csc, fidel6502_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M6502, 3900000/2) // from 3.9MHz resonator MCFG_CPU_PROGRAM_MAP(csc_map) - MCFG_CPU_PERIODIC_INT_DRIVER(fidelz80base_state, irq0_line_hold, 600) // 38400kHz/64 + MCFG_CPU_PERIODIC_INT_DRIVER(fidel6502_state, irq0_line_hold, 600) // 38400kHz/64 MCFG_DEVICE_ADD("pia0", PIA6821, 0) MCFG_PIA_READPB_HANDLER(READ8(fidel6502_state, csc_pia0_pb_r)) @@ -1586,7 +1585,7 @@ static MACHINE_CONFIG_START( csc, fidel6502_state ) MCFG_PIA_CA2_HANDLER(WRITELINE(fidel6502_state, csc_pia1_ca2_w)) MCFG_PIA_CB2_HANDLER(WRITELINE(fidel6502_state, csc_pia1_cb2_w)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_fidel_csc) /* sound hardware */ @@ -1614,7 +1613,7 @@ static MACHINE_CONFIG_START( eas, fidel6502_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", R65C02, XTAL_3MHz) MCFG_CPU_PROGRAM_MAP(eas_map) - MCFG_CPU_PERIODIC_INT_DRIVER(fidelz80base_state, irq0_line_hold, 600) // guessed + MCFG_CPU_PERIODIC_INT_DRIVER(fidel6502_state, irq0_line_hold, 600) // guessed MCFG_DEVICE_ADD("ppi8255", I8255, 0) // port B: input, port A & C: output MCFG_I8255_OUT_PORTA_CB(WRITE8(fidel6502_state, eas_ppi_porta_w)) @@ -1623,7 +1622,7 @@ static MACHINE_CONFIG_START( eas, fidel6502_state ) MCFG_NVRAM_ADD_0FILL("nvram") - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_fidel_eas) /* sound hardware */ @@ -1639,7 +1638,7 @@ static MACHINE_CONFIG_START( eas, fidel6502_state ) /* cartridge */ MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "fidel_scc") MCFG_GENERIC_EXTENSIONS("bin,dat") - MCFG_GENERIC_LOAD(fidelz80base_state, scc_cartridge) + MCFG_GENERIC_LOAD(fidelbase_state, scc_cartridge) MCFG_SOFTWARE_LIST_ADD("cart_list", "fidel_scc") MACHINE_CONFIG_END @@ -1648,7 +1647,7 @@ static MACHINE_CONFIG_DERIVED( eag, eas ) /* basic machine hardware */ MCFG_CPU_REPLACE("maincpu", R65C02, XTAL_5MHz) // R65C02P4 MCFG_CPU_PROGRAM_MAP(eag_map) - MCFG_CPU_PERIODIC_INT_DRIVER(fidelz80base_state, irq0_line_hold, 600) // guessed + MCFG_CPU_PERIODIC_INT_DRIVER(fidel6502_state, irq0_line_hold, 600) // guessed MCFG_DEFAULT_LAYOUT(layout_fidel_eag) MACHINE_CONFIG_END @@ -1658,11 +1657,11 @@ static MACHINE_CONFIG_START( sc9, fidel6502_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M6502, 1400000) // from ceramic resonator "681 JSA", measured MCFG_CPU_PROGRAM_MAP(sc9_map) - MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_on", fidel6502_state, irq_on, attotime::from_hz(610)) // from 555 timer (22nf, 102K, 2.7K) + MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_on", fidel6502_state, irq_on, attotime::from_hz(610)) // from 555 timer (22nF, 102K, 2.7K) MCFG_TIMER_START_DELAY(attotime::from_hz(610) - attotime::from_usec(41)) // active for 41us MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(610)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_fidel_sc9) /* sound hardware */ @@ -1674,7 +1673,7 @@ static MACHINE_CONFIG_START( sc9, fidel6502_state ) /* cartridge */ MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "fidel_scc") MCFG_GENERIC_EXTENSIONS("bin,dat") - MCFG_GENERIC_LOAD(fidelz80base_state, scc_cartridge) + MCFG_GENERIC_LOAD(fidelbase_state, scc_cartridge) MCFG_SOFTWARE_LIST_ADD("cart_list", "fidel_scc") MACHINE_CONFIG_END @@ -1699,11 +1698,11 @@ static MACHINE_CONFIG_START( sc12, fidel6502_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", R65C02, XTAL_4MHz) MCFG_CPU_PROGRAM_MAP(sc12_map) - MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_on", fidel6502_state, irq_on, attotime::from_hz(596)) // from 556 timer (22nf, 82K+26K, 1K) + MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_on", fidel6502_state, irq_on, attotime::from_hz(596)) // from 556 timer (22nF, 82K+26K, 1K) MCFG_TIMER_START_DELAY(attotime::from_hz(596) - attotime::from_nsec(15250)) // active for 15.25us MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(596)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_fidel_sc12) /* sound hardware */ @@ -1715,7 +1714,7 @@ static MACHINE_CONFIG_START( sc12, fidel6502_state ) /* cartridge */ MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "fidel_scc") MCFG_GENERIC_EXTENSIONS("bin,dat") - MCFG_GENERIC_LOAD(fidelz80base_state, scc_cartridge) + MCFG_GENERIC_LOAD(fidelbase_state, scc_cartridge) MCFG_SOFTWARE_LIST_ADD("cart_list", "fidel_scc") MACHINE_CONFIG_END @@ -1724,11 +1723,11 @@ static MACHINE_CONFIG_START( fexcel, fidel6502_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M65SC02, XTAL_12MHz/4) // G65SC102P-3, 12.0M ceramic resonator MCFG_CPU_PROGRAM_MAP(fexcel_map) - MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_on", fidel6502_state, irq_on, attotime::from_hz(630)) // from 556 timer (22nf, 102K, 1K) + MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_on", fidel6502_state, irq_on, attotime::from_hz(630)) // from 556 timer (22nF, 102K, 1K) MCFG_TIMER_START_DELAY(attotime::from_hz(630) - attotime::from_nsec(15250)) // active for 15.25us MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(630)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_fidel_ex) /* sound hardware */ @@ -1761,7 +1760,7 @@ static MACHINE_CONFIG_DERIVED( fdes2000, fexcel ) // change irq timer frequency MCFG_DEVICE_REMOVE("irq_on") MCFG_DEVICE_REMOVE("irq_off") - MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_on", fidel6502_state, irq_on, attotime::from_hz(585)) // from 556 timer (22nf, 110K, 1K) + MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_on", fidel6502_state, irq_on, attotime::from_hz(585)) // from 556 timer (22nF, 110K, 1K) MCFG_TIMER_START_DELAY(attotime::from_hz(585) - attotime::from_nsec(15250)) // active for 15.25us MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(585)) @@ -1787,11 +1786,11 @@ static MACHINE_CONFIG_START( fdes2100d, fidel6502_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M65C02, XTAL_6MHz) // W65C02P-6 MCFG_CPU_PROGRAM_MAP(fdesdis_map) - MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_on", fidel6502_state, irq_on, attotime::from_hz(630)) // from 556 timer (22nf, 102K, 1K) + MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_on", fidel6502_state, irq_on, attotime::from_hz(630)) // from 556 timer (22nF, 102K, 1K) MCFG_TIMER_START_DELAY(attotime::from_hz(630) - attotime::from_nsec(15250)) // active for 15.25us MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(630)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_fidel_desdis) /* sound hardware */ @@ -1817,7 +1816,7 @@ static MACHINE_CONFIG_START( chesster, fidel6502_state ) MCFG_TIMER_START_DELAY(attotime::from_hz(9615) - attotime::from_nsec(2600)) // active for 2.6us MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(9615)) - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_fidel_chesster) /* sound hardware */ |