src/mess/drivers/fmtowns.c
| r14018 | r14019 | |
| 234 | 234 | return 0x00; |
| 235 | 235 | case 0x06: |
| 236 | 236 | //logerror("SYS: (0x26) timer read\n"); |
| 237 | | m_ftimer -= 0x13; |
| 238 | | return m_ftimer; |
| 237 | return m_freerun_timer; |
| 239 | 238 | case 0x07: |
| 240 | | return m_ftimer >> 8; |
| 239 | return m_freerun_timer >> 8; |
| 241 | 240 | case 0x08: |
| 242 | 241 | //logerror("SYS: (0x28) NMI mask read\n"); |
| 243 | 242 | return m_nmi_mask & 0x01; |
| r14018 | r14019 | |
| 359 | 358 | |
| 360 | 359 | WRITE8_MEMBER(towns_state::towns_sys6c_w) |
| 361 | 360 | { |
| 362 | | // logerror("SYS: (0x6c) write to timer (0x%02x)\n",data); |
| 363 | | m_ftimer -= 0x54; |
| 364 | 361 | // halts the CPU for a period of time (exact length unknown) |
| 365 | 362 | device_set_input_line(m_maincpu,INPUT_LINE_HALT,ASSERT_LINE); |
| 366 | 363 | m_towns_wait_timer->adjust(attotime::from_usec(1),0,attotime::never); |
| r14018 | r14019 | |
| 2007 | 2004 | if(tstate->m_towns_timer_mask & 0x01) |
| 2008 | 2005 | { |
| 2009 | 2006 | pic8259_ir0_w(dev, state); |
| 2010 | | if(IRQ_LOG) logerror("PIC: IRQ0 (PIT Timer) set to %i\n",state); |
| 2007 | if(IRQ_LOG) logerror("PIC: IRQ0 (PIT Timer ch0) set to %i\n",state); |
| 2011 | 2008 | } |
| 2012 | 2009 | } |
| 2013 | 2010 | |
| 2014 | 2011 | static WRITE_LINE_DEVICE_HANDLER( towns_pit_out1_changed ) |
| 2015 | 2012 | { |
| 2016 | 2013 | towns_state* tstate = device->machine().driver_data<towns_state>(); |
| 2017 | | // device_t* dev = tstate->m_pic_master; |
| 2014 | device_t* dev = tstate->m_pic_master; |
| 2018 | 2015 | |
| 2019 | 2016 | if(tstate->m_towns_timer_mask & 0x02) |
| 2020 | 2017 | { |
| 2021 | | //pic8259_ir0_w(dev, state); |
| 2018 | pic8259_ir0_w(dev, state); |
| 2019 | if(IRQ_LOG) logerror("PIC: IRQ0 (PIT Timer ch1) set to %i\n",state); |
| 2022 | 2020 | } |
| 2023 | 2021 | } |
| 2024 | 2022 | |
| r14018 | r14019 | |
| 2116 | 2114 | AM_RANGE(0x0010,0x0013) AM_DEVREADWRITE8_LEGACY("pic8259_slave", pic8259_r, pic8259_w, 0x00ff00ff) |
| 2117 | 2115 | AM_RANGE(0x0020,0x0033) AM_READWRITE8(towns_system_r,towns_system_w, 0xffffffff) |
| 2118 | 2116 | AM_RANGE(0x0040,0x0047) AM_DEVREADWRITE8_LEGACY("pit",pit8253_r, pit8253_w, 0x00ff00ff) |
| 2117 | AM_RANGE(0x0050,0x0057) AM_DEVREADWRITE8_LEGACY("pit2",pit8253_r, pit8253_w, 0x00ff00ff) |
| 2119 | 2118 | AM_RANGE(0x0060,0x0063) AM_READWRITE8(towns_port60_r, towns_port60_w, 0x000000ff) |
| 2120 | 2119 | AM_RANGE(0x0068,0x006b) AM_READWRITE8(towns_intervaltimer2_r, towns_intervaltimer2_w, 0xffffffff) |
| 2121 | 2120 | AM_RANGE(0x006c,0x006f) AM_READWRITE8(towns_sys6c_r,towns_sys6c_w, 0x000000ff) |
| r14018 | r14019 | |
| 2492 | 2491 | m_intervaltimer2_irqmask = 1; // masked |
| 2493 | 2492 | m_towns_rtc_timer->adjust(attotime::zero,0,attotime::from_hz(1)); |
| 2494 | 2493 | m_towns_kb_timer->adjust(attotime::zero,0,attotime::from_msec(10)); |
| 2495 | | /* Why does enabling this timer break the driver? */ |
| 2496 | | //m_towns_freerun_counter->adjust(attotime::zero,0,attotime::from_usec(1)); |
| 2494 | m_towns_freerun_counter->adjust(attotime::zero,0,attotime::from_usec(1)); |
| 2497 | 2495 | } |
| 2498 | 2496 | |
| 2499 | 2497 | static const struct pit8253_config towns_pit8253_config = |
| r14018 | r14019 | |
| 2517 | 2515 | } |
| 2518 | 2516 | }; |
| 2519 | 2517 | |
| 2518 | static const struct pit8253_config towns_pit8253_config_2 = |
| 2519 | { |
| 2520 | { |
| 2521 | { |
| 2522 | 307200, |
| 2523 | DEVCB_NULL, |
| 2524 | DEVCB_NULL // reserved |
| 2525 | }, |
| 2526 | { |
| 2527 | 307200, |
| 2528 | DEVCB_NULL, |
| 2529 | DEVCB_NULL // RS-232 |
| 2530 | }, |
| 2531 | { |
| 2532 | 307200, |
| 2533 | DEVCB_NULL, |
| 2534 | DEVCB_NULL // reserved |
| 2535 | } |
| 2536 | } |
| 2537 | }; |
| 2538 | |
| 2520 | 2539 | static READ8_DEVICE_HANDLER( get_slave_ack ) |
| 2521 | 2540 | { |
| 2522 | 2541 | towns_state* state = device->machine().driver_data<towns_state>(); |
| r14018 | r14019 | |
| 2673 | 2692 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 2674 | 2693 | |
| 2675 | 2694 | MCFG_PIT8253_ADD("pit",towns_pit8253_config) |
| 2695 | MCFG_PIT8253_ADD("pit2",towns_pit8253_config_2) |
| 2676 | 2696 | |
| 2677 | 2697 | MCFG_PIC8259_ADD( "pic8259_master", towns_pic8259_master_config ) |
| 2678 | 2698 | |