trunk/src/mess/drivers/ticalc1x.c
| r244937 | r244938 | |
| 14 | 14 | |
| 15 | 15 | #include "emu.h" |
| 16 | 16 | #include "cpu/tms0980/tms0980.h" |
| 17 | #include "sound/speaker.h" |
| 17 | 18 | |
| 19 | // internal artwork |
| 18 | 20 | #include "ti1270.lh" |
| 19 | 21 | #include "ti30.lh" |
| 20 | 22 | #include "tisr16.lh" |
| r244937 | r244938 | |
| 27 | 29 | ticalc1x_state(const machine_config &mconfig, device_type type, const char *tag) |
| 28 | 30 | : driver_device(mconfig, type, tag), |
| 29 | 31 | m_maincpu(*this, "maincpu"), |
| 30 | | m_button_matrix(*this, "IN") |
| 32 | m_inp_matrix(*this, "IN"), |
| 33 | m_speaker(*this, "speaker"), |
| 34 | m_display_wait(33), |
| 35 | m_display_maxy(1), |
| 36 | m_display_maxx(0) |
| 31 | 37 | { } |
| 32 | 38 | |
| 39 | // devices |
| 33 | 40 | required_device<cpu_device> m_maincpu; |
| 34 | | optional_ioport_array<11> m_button_matrix; // up to 11 rows |
| 41 | optional_ioport_array<11> m_inp_matrix; // max 11 |
| 42 | optional_device<speaker_sound_device> m_speaker; |
| 35 | 43 | |
| 36 | | UINT16 m_r; |
| 37 | | UINT16 m_o; |
| 38 | | bool m_power_on; |
| 44 | // misc common |
| 45 | UINT16 m_r; // MCU R-pins data |
| 46 | UINT16 m_o; // MCU O-pins data |
| 47 | UINT16 m_inp_mux; // multiplexed inputs mask |
| 48 | bool m_power_on; // TMS0980 power-on state |
| 39 | 49 | |
| 40 | | UINT16 m_display_state[0x10]; |
| 41 | | UINT16 m_display_cache[0x10]; |
| 42 | | UINT8 m_display_decay[0x100]; |
| 50 | UINT8 read_inputs(int columns); |
| 51 | DECLARE_INPUT_CHANGED_MEMBER(tms0980_power_button); |
| 52 | DECLARE_WRITE_LINE_MEMBER(tms0980_auto_power_off); |
| 43 | 53 | |
| 54 | virtual void machine_reset(); |
| 55 | virtual void machine_start(); |
| 56 | |
| 57 | // display common |
| 58 | int m_display_wait; // led/lamp off-delay in microseconds (default 33ms) |
| 59 | int m_display_maxy; // display matrix number of rows |
| 60 | int m_display_maxx; // display matrix number of columns |
| 61 | |
| 62 | UINT32 m_display_state[0x20]; // display matrix rows data |
| 63 | UINT16 m_7seg_mask[0x20]; // if not 0, display matrix row is a 7seg, mask indicates connected segments |
| 64 | UINT32 m_display_cache[0x20]; // (internal use) |
| 65 | UINT8 m_display_decay[0x20][0x20]; // (internal use) |
| 66 | |
| 67 | TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); |
| 68 | void display_update(); |
| 69 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); |
| 70 | |
| 71 | // calculator-specific handlers |
| 44 | 72 | DECLARE_READ8_MEMBER(tisr16_read_k); |
| 45 | 73 | DECLARE_WRITE16_MEMBER(tisr16_write_o); |
| 46 | 74 | DECLARE_WRITE16_MEMBER(tisr16_write_r); |
| r244937 | r244938 | |
| 57 | 85 | DECLARE_READ8_MEMBER(ti30_read_k); |
| 58 | 86 | DECLARE_WRITE16_MEMBER(ti30_write_o); |
| 59 | 87 | DECLARE_WRITE16_MEMBER(ti30_write_r); |
| 88 | }; |
| 60 | 89 | |
| 61 | | DECLARE_INPUT_CHANGED_MEMBER(power_button); |
| 62 | | DECLARE_WRITE_LINE_MEMBER(auto_power_off); |
| 63 | 90 | |
| 64 | | TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); |
| 65 | | void display_update(); |
| 91 | // machine_start/reset |
| 66 | 92 | |
| 67 | | virtual void machine_reset(); |
| 68 | | virtual void machine_start(); |
| 69 | | }; |
| 93 | void ticalc1x_state::machine_start() |
| 94 | { |
| 95 | // zerofill |
| 96 | memset(m_display_state, 0, sizeof(m_display_state)); |
| 97 | memset(m_display_cache, 0, sizeof(m_display_cache)); |
| 98 | memset(m_display_decay, 0, sizeof(m_display_decay)); |
| 99 | memset(m_7seg_mask, 0, sizeof(m_7seg_mask)); |
| 100 | |
| 101 | m_o = 0; |
| 102 | m_r = 0; |
| 103 | m_inp_mux = 0; |
| 104 | m_power_on = false; |
| 70 | 105 | |
| 106 | // register for savestates |
| 107 | save_item(NAME(m_display_maxy)); |
| 108 | save_item(NAME(m_display_maxx)); |
| 109 | save_item(NAME(m_display_wait)); |
| 71 | 110 | |
| 111 | save_item(NAME(m_display_state)); |
| 112 | save_item(NAME(m_display_cache)); |
| 113 | save_item(NAME(m_display_decay)); |
| 114 | save_item(NAME(m_7seg_mask)); |
| 72 | 115 | |
| 116 | save_item(NAME(m_o)); |
| 117 | save_item(NAME(m_r)); |
| 118 | save_item(NAME(m_inp_mux)); |
| 119 | save_item(NAME(m_power_on)); |
| 120 | } |
| 121 | |
| 122 | void ticalc1x_state::machine_reset() |
| 123 | { |
| 124 | m_power_on = true; |
| 125 | } |
| 126 | |
| 127 | |
| 128 | |
| 73 | 129 | /*************************************************************************** |
| 74 | 130 | |
| 75 | | LED Display |
| 131 | Helper Functions |
| 76 | 132 | |
| 77 | 133 | ***************************************************************************/ |
| 78 | 134 | |
| 79 | | // Devices with TMS09x0 strobe the outputs very fast, it is unnoticeable to the user. |
| 135 | // The device may strobe the outputs very fast, it is unnoticeable to the user. |
| 80 | 136 | // To prevent flickering here, we need to simulate a decay. |
| 81 | 137 | |
| 82 | | // decay time, in steps of 1ms |
| 83 | | #define DISPLAY_DECAY_TIME 50 |
| 84 | | |
| 85 | 138 | void ticalc1x_state::display_update() |
| 86 | 139 | { |
| 87 | | UINT16 active_state[0x10]; |
| 140 | UINT32 active_state[0x20]; |
| 88 | 141 | |
| 89 | | for (int i = 0; i < 0x10; i++) |
| 142 | for (int y = 0; y < m_display_maxy; y++) |
| 90 | 143 | { |
| 91 | | active_state[i] = 0; |
| 144 | active_state[y] = 0; |
| 92 | 145 | |
| 93 | | for (int j = 0; j < 0x10; j++) |
| 146 | for (int x = 0; x < m_display_maxx; x++) |
| 94 | 147 | { |
| 95 | | int di = j << 4 | i; |
| 96 | | |
| 97 | 148 | // turn on powered segments |
| 98 | | if (m_power_on && m_display_state[i] >> j & 1) |
| 99 | | m_display_decay[di] = DISPLAY_DECAY_TIME; |
| 149 | if (m_power_on && m_display_state[y] >> x & 1) |
| 150 | m_display_decay[y][x] = m_display_wait; |
| 100 | 151 | |
| 101 | 152 | // determine active state |
| 102 | | int ds = (m_display_decay[di] != 0) ? 1 : 0; |
| 103 | | active_state[i] |= (ds << j); |
| 153 | int ds = (m_display_decay[y][x] != 0) ? 1 : 0; |
| 154 | active_state[y] |= (ds << x); |
| 104 | 155 | } |
| 105 | 156 | } |
| 106 | 157 | |
| 107 | 158 | // on difference, send to output |
| 108 | | for (int i = 0; i < 0x10; i++) |
| 109 | | if (m_display_cache[i] != active_state[i]) |
| 159 | for (int y = 0; y < m_display_maxy; y++) |
| 160 | if (m_display_cache[y] != active_state[y]) |
| 110 | 161 | { |
| 111 | | output_set_digit_value(i, active_state[i]); |
| 162 | if (m_7seg_mask[y] != 0) |
| 163 | output_set_digit_value(y, active_state[y] & m_7seg_mask[y]); |
| 112 | 164 | |
| 113 | | for (int j = 0; j < 8; j++) |
| 114 | | output_set_lamp_value(i*10 + j, active_state[i] >> j & 1); |
| 165 | const int mul = (m_display_maxx <= 10) ? 10 : 100; |
| 166 | for (int x = 0; x < m_display_maxx; x++) |
| 167 | output_set_lamp_value(y * mul + x, active_state[y] >> x & 1); |
| 115 | 168 | } |
| 116 | 169 | |
| 117 | 170 | memcpy(m_display_cache, active_state, sizeof(m_display_cache)); |
| r244937 | r244938 | |
| 120 | 173 | TIMER_DEVICE_CALLBACK_MEMBER(ticalc1x_state::display_decay_tick) |
| 121 | 174 | { |
| 122 | 175 | // slowly turn off unpowered segments |
| 123 | | for (int i = 0; i < 0x100; i++) |
| 124 | | if (!(m_display_state[i & 0xf] >> (i>>4) & 1) && m_display_decay[i]) |
| 125 | | m_display_decay[i]--; |
| 176 | for (int y = 0; y < m_display_maxy; y++) |
| 177 | for (int x = 0; x < m_display_maxx; x++) |
| 178 | if (!(m_display_state[y] >> x & 1) && m_display_decay[y][x] != 0) |
| 179 | m_display_decay[y][x]--; |
| 180 | |
| 181 | display_update(); |
| 182 | } |
| 126 | 183 | |
| 184 | void ticalc1x_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) |
| 185 | { |
| 186 | m_display_maxx = maxx; |
| 187 | m_display_maxy = maxy; |
| 188 | |
| 189 | // update current state |
| 190 | UINT32 mask = (1 << maxx) - 1; |
| 191 | for (int y = 0; y < maxy; y++) |
| 192 | m_display_state[y] = (sety >> y & 1) ? (setx & mask) : 0; |
| 193 | |
| 127 | 194 | display_update(); |
| 128 | 195 | } |
| 129 | 196 | |
| 130 | 197 | |
| 198 | UINT8 ticalc1x_state::read_inputs(int columns) |
| 199 | { |
| 200 | UINT8 ret = 0; |
| 131 | 201 | |
| 202 | // read selected input rows |
| 203 | for (int i = 0; i < columns; i++) |
| 204 | if (m_inp_mux >> i & 1) |
| 205 | ret |= m_inp_matrix[i]->read(); |
| 206 | |
| 207 | return ret; |
| 208 | } |
| 209 | |
| 210 | |
| 211 | // devices with a TMS0980 can auto power-off |
| 212 | |
| 213 | WRITE_LINE_MEMBER(ticalc1x_state::tms0980_auto_power_off) |
| 214 | { |
| 215 | if (state) |
| 216 | { |
| 217 | m_power_on = false; |
| 218 | m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | INPUT_CHANGED_MEMBER(ticalc1x_state::tms0980_power_button) |
| 223 | { |
| 224 | m_power_on = (bool)(FPTR)param; |
| 225 | m_maincpu->set_input_line(INPUT_LINE_RESET, m_power_on ? CLEAR_LINE : ASSERT_LINE); |
| 226 | } |
| 227 | |
| 228 | |
| 229 | |
| 132 | 230 | /*************************************************************************** |
| 133 | 231 | |
| 134 | 232 | I/O |
| r244937 | r244938 | |
| 159 | 257 | // read selected button rows |
| 160 | 258 | for (int i = 0; i < 11; i++) |
| 161 | 259 | if (m_r >> i & 1) |
| 162 | | k |= m_button_matrix[i]->read(); |
| 260 | k |= m_inp_matrix[i]->read(); |
| 163 | 261 | |
| 164 | 262 | return k; |
| 165 | 263 | } |
| r244937 | r244938 | |
| 191 | 289 | // read selected button rows |
| 192 | 290 | for (int i = 0; i < 7; i++) |
| 193 | 291 | if (m_o >> (i+1) & 1) |
| 194 | | k |= m_button_matrix[i]->read(); |
| 292 | k |= m_inp_matrix[i]->read(); |
| 195 | 293 | |
| 196 | 294 | return k; |
| 197 | 295 | } |
| 198 | 296 | |
| 199 | 297 | WRITE16_MEMBER(ticalc1x_state::ti1270_write_r) |
| 200 | 298 | { |
| 299 | m_display_maxx = 8; |
| 300 | m_display_maxy = 8; |
| 301 | |
| 201 | 302 | // R0-R7: select digit (right-to-left) |
| 202 | 303 | for (int i = 0; i < 8; i++) |
| 304 | { |
| 305 | m_7seg_mask[i] = 0xff; |
| 203 | 306 | m_display_state[i] = (data >> i & 1) ? m_o : 0; |
| 307 | } |
| 204 | 308 | |
| 205 | 309 | display_update(); |
| 206 | 310 | } |
| r244937 | r244938 | |
| 222 | 326 | // read selected button rows |
| 223 | 327 | for (int i = 0; i < 4; i++) |
| 224 | 328 | if (m_o >> (i+1) & 1) |
| 225 | | k |= m_button_matrix[i]->read(); |
| 329 | k |= m_inp_matrix[i]->read(); |
| 226 | 330 | |
| 227 | 331 | return k; |
| 228 | 332 | } |
| 229 | 333 | |
| 230 | 334 | WRITE16_MEMBER(ticalc1x_state::wizatron_write_r) |
| 231 | 335 | { |
| 336 | m_display_maxx = 8; |
| 337 | m_display_maxy = 9; |
| 338 | |
| 232 | 339 | // R0-R8: select digit (right-to-left) |
| 233 | 340 | // note: 3rd digit is custom(not 7seg), for math symbols |
| 234 | 341 | for (int i = 0; i < 9; i++) |
| 342 | { |
| 343 | m_7seg_mask[i] = 0x7f; |
| 235 | 344 | m_display_state[i] = (data >> i & 1) ? m_o : 0; |
| 345 | } |
| 236 | 346 | |
| 237 | 347 | // 6th digit only has A and G for = |
| 238 | 348 | m_display_state[3] &= 0x41; |
| r244937 | r244938 | |
| 256 | 366 | READ8_MEMBER(ticalc1x_state::ti30_read_k) |
| 257 | 367 | { |
| 258 | 368 | // the Vss row is always on |
| 259 | | UINT8 k = m_button_matrix[8]->read(); |
| 369 | UINT8 k = m_inp_matrix[8]->read(); |
| 260 | 370 | |
| 261 | 371 | // read selected button rows |
| 262 | 372 | for (int i = 0; i < 8; i++) |
| 263 | 373 | if (m_o >> i & 1) |
| 264 | | k |= m_button_matrix[i]->read(); |
| 374 | k |= m_inp_matrix[i]->read(); |
| 265 | 375 | |
| 266 | 376 | return k; |
| 267 | 377 | } |
| 268 | 378 | |
| 269 | 379 | WRITE16_MEMBER(ticalc1x_state::ti30_write_r) |
| 270 | 380 | { |
| 381 | m_display_maxx = 8; |
| 382 | m_display_maxy = 9; |
| 383 | |
| 271 | 384 | // R0-R8: select digit |
| 272 | 385 | UINT8 o = BITSWAP8(m_o,7,5,2,1,4,0,6,3); |
| 273 | 386 | for (int i = 0; i < 9; i++) |
| 387 | { |
| 388 | m_7seg_mask[i] = 0xff; |
| 274 | 389 | m_display_state[i] = (data >> i & 1) ? o : 0; |
| 390 | } |
| 275 | 391 | |
| 276 | 392 | // 1st digit only has segments B,F,G,DP |
| 277 | 393 | m_display_state[0] &= 0xe2; |
| r244937 | r244938 | |
| 294 | 410 | |
| 295 | 411 | ***************************************************************************/ |
| 296 | 412 | |
| 297 | | INPUT_CHANGED_MEMBER(ticalc1x_state::power_button) |
| 298 | | { |
| 299 | | m_power_on = (bool)(FPTR)param; |
| 300 | | m_maincpu->set_input_line(INPUT_LINE_RESET, m_power_on ? CLEAR_LINE : ASSERT_LINE); |
| 301 | | } |
| 302 | | |
| 303 | 413 | static INPUT_PORTS_START( tisr16 ) |
| 304 | 414 | PORT_START("IN.0") // R0 |
| 305 | 415 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| r244937 | r244938 | |
| 496 | 606 | |
| 497 | 607 | // note: even though power buttons are on the matrix, they are not CPU-controlled |
| 498 | 608 | PORT_START("IN.8") // Vss! |
| 499 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGUP) PORT_CODE(KEYCODE_DEL) PORT_NAME("ON/C") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, power_button, (void *)true) |
| 609 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGUP) PORT_CODE(KEYCODE_DEL) PORT_NAME("ON/C") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, tms0980_power_button, (void *)true) |
| 500 | 610 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_NAME("1/x") |
| 501 | 611 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_NAME(UTF8_SQUAREROOT"x") |
| 502 | 612 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_NAME("x" UTF8_POW_2) |
| 503 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("OFF") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, power_button, (void *)false) |
| 613 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("OFF") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, tms0980_power_button, (void *)false) |
| 504 | 614 | INPUT_PORTS_END |
| 505 | 615 | |
| 506 | 616 | |
| r244937 | r244938 | |
| 559 | 669 | |
| 560 | 670 | // note: even though power buttons are on the matrix, they are not CPU-controlled |
| 561 | 671 | PORT_START("IN.8") // Vss! |
| 562 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_PGUP) PORT_NAME("C/ON") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, power_button, (void *)true) |
| 672 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_PGUP) PORT_NAME("C/ON") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, tms0980_power_button, (void *)true) |
| 563 | 673 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_NAME("DEC") |
| 564 | 674 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_NAME("OCT") |
| 565 | 675 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_NAME("HEX") |
| 566 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("OFF") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, power_button, (void *)false) |
| 676 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("OFF") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, tms0980_power_button, (void *)false) |
| 567 | 677 | INPUT_PORTS_END |
| 568 | 678 | |
| 569 | 679 | |
| r244937 | r244938 | |
| 623 | 733 | |
| 624 | 734 | // note: even though power buttons are on the matrix, they are not CPU-controlled |
| 625 | 735 | PORT_START("IN.8") // Vss! |
| 626 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGUP) PORT_CODE(KEYCODE_DEL) PORT_NAME("ON/C") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, power_button, (void *)true) |
| 736 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGUP) PORT_CODE(KEYCODE_DEL) PORT_NAME("ON/C") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, tms0980_power_button, (void *)true) |
| 627 | 737 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_NAME("2nd") |
| 628 | 738 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_NAME("x" UTF8_POW_2" " UTF8_SQUAREROOT"x") |
| 629 | 739 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_NAME("ln(x) e" UTF8_POW_X) |
| 630 | | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("OFF") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, power_button, (void *)false) |
| 740 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("OFF") PORT_CHANGED_MEMBER(DEVICE_SELF, ticalc1x_state, tms0980_power_button, (void *)false) |
| 631 | 741 | INPUT_PORTS_END |
| 632 | 742 | |
| 633 | 743 | |
| r244937 | r244938 | |
| 638 | 748 | |
| 639 | 749 | ***************************************************************************/ |
| 640 | 750 | |
| 641 | | WRITE_LINE_MEMBER(ticalc1x_state::auto_power_off) |
| 642 | | { |
| 643 | | // TMS0980 auto power-off opcode |
| 644 | | if (state) |
| 645 | | { |
| 646 | | m_power_on = false; |
| 647 | | m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
| 648 | | } |
| 649 | | } |
| 650 | | |
| 651 | | |
| 652 | | void ticalc1x_state::machine_reset() |
| 653 | | { |
| 654 | | m_power_on = true; |
| 655 | | } |
| 656 | | |
| 657 | | void ticalc1x_state::machine_start() |
| 658 | | { |
| 659 | | // zerofill |
| 660 | | memset(m_display_state, 0, sizeof(m_display_state)); |
| 661 | | memset(m_display_cache, 0, sizeof(m_display_cache)); |
| 662 | | memset(m_display_decay, 0, sizeof(m_display_decay)); |
| 663 | | |
| 664 | | m_r = 0; |
| 665 | | m_o = 0; |
| 666 | | m_power_on = false; |
| 667 | | |
| 668 | | // register for savestates |
| 669 | | save_item(NAME(m_display_state)); |
| 670 | | save_item(NAME(m_display_cache)); |
| 671 | | save_item(NAME(m_display_decay)); |
| 672 | | |
| 673 | | save_item(NAME(m_r)); |
| 674 | | save_item(NAME(m_o)); |
| 675 | | save_item(NAME(m_power_on)); |
| 676 | | } |
| 677 | | |
| 678 | | |
| 679 | 751 | static MACHINE_CONFIG_START( tisr16, ticalc1x_state ) |
| 680 | 752 | |
| 681 | 753 | /* basic machine hardware */ |
| r244937 | r244938 | |
| 739 | 811 | MCFG_TMS1XXX_READ_K_CB(READ8(ticalc1x_state, ti30_read_k)) |
| 740 | 812 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ticalc1x_state, ti30_write_o)) |
| 741 | 813 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ticalc1x_state, ti30_write_r)) |
| 742 | | MCFG_TMS1XXX_POWER_OFF_CB(WRITELINE(ticalc1x_state, auto_power_off)) |
| 814 | MCFG_TMS1XXX_POWER_OFF_CB(WRITELINE(ticalc1x_state, tms0980_auto_power_off)) |
| 743 | 815 | |
| 744 | 816 | MCFG_DEFAULT_LAYOUT(layout_ti30) |
| 745 | 817 | MACHINE_CONFIG_END |