src/emu/cpu/tms9900/tms9995.c
| r15582 | r15583 | |
| 1118 | 1118 | } |
| 1119 | 1119 | } |
| 1120 | 1120 | } |
| 1121 | | } while (m_icount>0); |
| 1121 | } while (m_icount>0 && !m_reset); |
| 1122 | 1122 | if (VERBOSE>5) LOG("tms9995: cycles expired; will return soon.\n"); |
| 1123 | 1123 | } |
| 1124 | 1124 | |
| r15582 | r15583 | |
| 1133 | 1133 | */ |
| 1134 | 1134 | void tms9995_device::execute_set_input(int irqline, int state) |
| 1135 | 1135 | { |
| 1136 | | if (irqline == INPUT_LINE_NMI) |
| 1136 | if (irqline==INPUT_LINE_99XX_RESET && state==ASSERT_LINE) |
| 1137 | 1137 | { |
| 1138 | | m_nmi_active = (state==ASSERT_LINE); |
| 1139 | | if (VERBOSE>3) LOG("tms9995: NMI interrupt line state=%d\n", state); |
| 1138 | m_reset = true; |
| 1140 | 1139 | } |
| 1141 | 1140 | else |
| 1142 | 1141 | { |
| 1143 | | if (irqline == 1) |
| 1142 | if (irqline == INPUT_LINE_NMI) |
| 1144 | 1143 | { |
| 1145 | | m_int1_active = m_flag[2] = (state==ASSERT_LINE); |
| 1146 | | if (VERBOSE>3) LOG("tms9995: Line INT1 state=%d\n", state); |
| 1144 | m_nmi_active = (state==ASSERT_LINE); |
| 1145 | if (VERBOSE>3) LOG("tms9995: NMI interrupt line state=%d\n", state); |
| 1147 | 1146 | } |
| 1148 | 1147 | else |
| 1149 | 1148 | { |
| 1150 | | if (irqline == 4) |
| 1149 | if (irqline == INPUT_LINE_99XX_INT1) |
| 1151 | 1150 | { |
| 1152 | | if (VERBOSE>3) LOG("tms9995: Line INT4/EC state=%d\n", state); |
| 1153 | | if (m_flag[0]==false) |
| 1151 | m_int1_active = m_flag[2] = (state==ASSERT_LINE); |
| 1152 | if (VERBOSE>3) LOG("tms9995: Line INT1 state=%d\n", state); |
| 1153 | } |
| 1154 | else |
| 1155 | { |
| 1156 | if (irqline == INPUT_LINE_99XX_INT4) |
| 1154 | 1157 | { |
| 1155 | | if (VERBOSE>7) LOG("tms9995: set as interrupt\n"); |
| 1156 | | m_int4_active = m_flag[4] = (state==ASSERT_LINE); |
| 1158 | if (VERBOSE>3) LOG("tms9995: Line INT4/EC state=%d\n", state); |
| 1159 | if (m_flag[0]==false) |
| 1160 | { |
| 1161 | if (VERBOSE>7) LOG("tms9995: set as interrupt\n"); |
| 1162 | m_int4_active = m_flag[4] = (state==ASSERT_LINE); |
| 1163 | } |
| 1164 | else |
| 1165 | { |
| 1166 | if (VERBOSE>7) LOG("tms9995: set as event count\n"); |
| 1167 | trigger_decrementer(); |
| 1168 | } |
| 1157 | 1169 | } |
| 1158 | 1170 | else |
| 1159 | 1171 | { |
| 1160 | | if (VERBOSE>7) LOG("tms9995: set as event count\n"); |
| 1161 | | trigger_decrementer(); |
| 1172 | if (VERBOSE>0) LOG("tms9995: Accessed invalid interrupt line %d\n", irqline); |
| 1162 | 1173 | } |
| 1163 | 1174 | } |
| 1164 | | else |
| 1165 | | { |
| 1166 | | if (VERBOSE>0) LOG("tms9995: Accessed invalid interrupt line %d\n", irqline); |
| 1167 | | } |
| 1168 | 1175 | } |
| 1169 | 1176 | } |
| 1170 | 1177 | } |
src/emu/cpu/tms9900/tms9900.c
| r15582 | r15583 | |
| 1154 | 1154 | } |
| 1155 | 1155 | } |
| 1156 | 1156 | } |
| 1157 | | } while (m_icount>0); |
| 1157 | } while (m_icount>0 && !m_reset); |
| 1158 | 1158 | if (VERBOSE>6) LOG("tms99xx: cycles expired; will return soon.\n"); |
| 1159 | 1159 | } |
| 1160 | 1160 | |
| r15582 | r15583 | |
| 1165 | 1165 | */ |
| 1166 | 1166 | void tms99xx_device::execute_set_input(int irqline, int state) |
| 1167 | 1167 | { |
| 1168 | | if (irqline == INPUT_LINE_NMI) |
| 1168 | if (irqline==INPUT_LINE_99XX_RESET && state==ASSERT_LINE) |
| 1169 | 1169 | { |
| 1170 | | m_load_state = (state==ASSERT_LINE); |
| 1171 | | m_irq_level = -1; |
| 1170 | m_reset = true; |
| 1172 | 1171 | } |
| 1173 | 1172 | else |
| 1174 | 1173 | { |
| 1175 | | m_irq_state = (state==ASSERT_LINE); |
| 1176 | | if (state==ASSERT_LINE) |
| 1174 | if (irqline == INPUT_LINE_NMI) |
| 1177 | 1175 | { |
| 1178 | | m_irq_level = get_intlevel(state); |
| 1179 | | if (VERBOSE>6) LOG("tms99xx: interrupt line %d = %d, level=%d, ST=%04x\n", irqline, state, m_irq_level, ST); |
| 1176 | m_load_state = (state==ASSERT_LINE); |
| 1177 | m_irq_level = -1; |
| 1180 | 1178 | } |
| 1181 | 1179 | else |
| 1182 | 1180 | { |
| 1183 | | if (VERBOSE>6) LOG("tms99xx: cleared interrupt line %d\n", irqline); |
| 1181 | m_irq_state = (state==ASSERT_LINE); |
| 1182 | if (state==ASSERT_LINE) |
| 1183 | { |
| 1184 | m_irq_level = get_intlevel(state); |
| 1185 | if (VERBOSE>6) LOG("tms99xx: interrupt line %d = %d, level=%d, ST=%04x\n", irqline, state, m_irq_level, ST); |
| 1186 | } |
| 1187 | else |
| 1188 | { |
| 1189 | if (VERBOSE>6) LOG("tms99xx: cleared interrupt line %d\n", irqline); |
| 1190 | } |
| 1184 | 1191 | } |
| 1185 | 1192 | } |
| 1186 | 1193 | } |
| r15582 | r15583 | |
| 2543 | 2550 | |
| 2544 | 2551 | UINT32 tms99xx_device::execute_input_lines() const |
| 2545 | 2552 | { |
| 2546 | | return 1; |
| 2553 | return 2; |
| 2547 | 2554 | } |
| 2548 | 2555 | |
| 2549 | 2556 | // clocks to cycles, cycles to clocks = id |