src/mess/video/pdp1.c
| r3679 | r3680 | |
| 303 | 303 | static void pdp1_draw_panel(running_machine *machine, bitmap_t *bitmap) |
| 304 | 304 | { |
| 305 | 305 | /* column 1: registers, test word, test address */ |
| 306 | | pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset+2*8, y_panel_pc_offset+8, cpunum_get_reg(0, PDP1_PC), 16); |
| 307 | | pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset+2*8, y_panel_ma_offset+8, cpunum_get_reg(0, PDP1_MA), 16); |
| 308 | | pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_mb_offset+8, cpunum_get_reg(0, PDP1_MB), 18); |
| 309 | | pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_ac_offset+8, cpunum_get_reg(0, PDP1_AC), 18); |
| 310 | | pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_io_offset+8, cpunum_get_reg(0, PDP1_IO), 18); |
| 311 | | pdp1_draw_switch(machine, bitmap, x_panel_col1_offset, y_panel_ta_offset+8, cpunum_get_reg(0, PDP1_EXTEND_SW)); |
| 312 | | pdp1_draw_multipleswitch(machine, bitmap, x_panel_col1_offset+2*8, y_panel_ta_offset+8, cpunum_get_reg(0, PDP1_TA), 16); |
| 313 | | pdp1_draw_multipleswitch(machine, bitmap, x_panel_col1_offset, y_panel_tw_offset+8, cpunum_get_reg(0, PDP1_TW), 18); |
| 306 | pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset+2*8, y_panel_pc_offset+8, cpu_get_reg(machine->cpu[0], PDP1_PC), 16); |
| 307 | pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset+2*8, y_panel_ma_offset+8, cpu_get_reg(machine->cpu[0], PDP1_MA), 16); |
| 308 | pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_mb_offset+8, cpu_get_reg(machine->cpu[0], PDP1_MB), 18); |
| 309 | pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_ac_offset+8, cpu_get_reg(machine->cpu[0], PDP1_AC), 18); |
| 310 | pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_io_offset+8, cpu_get_reg(machine->cpu[0], PDP1_IO), 18); |
| 311 | pdp1_draw_switch(machine, bitmap, x_panel_col1_offset, y_panel_ta_offset+8, cpu_get_reg(machine->cpu[0], PDP1_EXTEND_SW)); |
| 312 | pdp1_draw_multipleswitch(machine, bitmap, x_panel_col1_offset+2*8, y_panel_ta_offset+8, cpu_get_reg(machine->cpu[0], PDP1_TA), 16); |
| 313 | pdp1_draw_multipleswitch(machine, bitmap, x_panel_col1_offset, y_panel_tw_offset+8, cpu_get_reg(machine->cpu[0], PDP1_TW), 18); |
| 314 | 314 | |
| 315 | 315 | /* column 2: 1-bit indicators */ |
| 316 | | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_run_offset, cpunum_get_reg(0, PDP1_RUN)); |
| 317 | | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_cyc_offset, cpunum_get_reg(0, PDP1_CYC)); |
| 318 | | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_defer_offset, cpunum_get_reg(0, PDP1_DEFER)); |
| 316 | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_run_offset, cpu_get_reg(machine->cpu[0], PDP1_RUN)); |
| 317 | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_cyc_offset, cpu_get_reg(machine->cpu[0], PDP1_CYC)); |
| 318 | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_defer_offset, cpu_get_reg(machine->cpu[0], PDP1_DEFER)); |
| 319 | 319 | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_hs_cyc_offset, 0); /* not emulated */ |
| 320 | | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_brk_ctr_1_offset, cpunum_get_reg(0, PDP1_BRK_CTR) & 1); |
| 321 | | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_brk_ctr_2_offset, cpunum_get_reg(0, PDP1_BRK_CTR) & 2); |
| 322 | | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ov_offset, cpunum_get_reg(0, PDP1_OV)); |
| 323 | | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_rim_offset, cpunum_get_reg(0, PDP1_RIM)); |
| 324 | | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_sbm_offset, cpunum_get_reg(0, PDP1_SBM)); |
| 325 | | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_exd_offset, cpunum_get_reg(0, PDP1_EXD)); |
| 326 | | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ioh_offset, cpunum_get_reg(0, PDP1_IOH)); |
| 327 | | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ioc_offset, cpunum_get_reg(0, PDP1_IOC)); |
| 328 | | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ios_offset, cpunum_get_reg(0, PDP1_IOS)); |
| 320 | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_brk_ctr_1_offset, cpu_get_reg(machine->cpu[0], PDP1_BRK_CTR) & 1); |
| 321 | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_brk_ctr_2_offset, cpu_get_reg(machine->cpu[0], PDP1_BRK_CTR) & 2); |
| 322 | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ov_offset, cpu_get_reg(machine->cpu[0], PDP1_OV)); |
| 323 | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_rim_offset, cpu_get_reg(machine->cpu[0], PDP1_RIM)); |
| 324 | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_sbm_offset, cpu_get_reg(machine->cpu[0], PDP1_SBM)); |
| 325 | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_exd_offset, cpu_get_reg(machine->cpu[0], PDP1_EXD)); |
| 326 | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ioh_offset, cpu_get_reg(machine->cpu[0], PDP1_IOH)); |
| 327 | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ioc_offset, cpu_get_reg(machine->cpu[0], PDP1_IOC)); |
| 328 | pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ios_offset, cpu_get_reg(machine->cpu[0], PDP1_IOS)); |
| 329 | 329 | |
| 330 | 330 | /* column 3: power, single step, single inst, sense, flags, instr... */ |
| 331 | 331 | pdp1_draw_led(machine, bitmap, x_panel_col3_offset, y_panel_power_offset, 1); /* always on */ |
| 332 | 332 | pdp1_draw_switch(machine, bitmap, x_panel_col3_offset+8, y_panel_power_offset, 1); /* always on */ |
| 333 | | pdp1_draw_led(machine, bitmap, x_panel_col3_offset, y_panel_sngl_step_offset, cpunum_get_reg(0, PDP1_SNGL_STEP)); |
| 334 | | pdp1_draw_switch(machine, bitmap, x_panel_col3_offset+8, y_panel_sngl_step_offset, cpunum_get_reg(0, PDP1_SNGL_STEP)); |
| 335 | | pdp1_draw_led(machine, bitmap, x_panel_col3_offset, y_panel_sngl_inst_offset, cpunum_get_reg(0, PDP1_SNGL_INST)); |
| 336 | | pdp1_draw_switch(machine, bitmap, x_panel_col3_offset+8, y_panel_sngl_inst_offset, cpunum_get_reg(0, PDP1_SNGL_INST)); |
| 337 | | pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_ss_offset+8, cpunum_get_reg(0, PDP1_SS), 6); |
| 338 | | pdp1_draw_multipleswitch(machine, bitmap, x_panel_col3_offset, y_panel_ss_offset+2*8, cpunum_get_reg(0, PDP1_SS), 6); |
| 339 | | pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_pf_offset+8, cpunum_get_reg(0, PDP1_PF), 6); |
| 340 | | pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_ir_offset+8, cpunum_get_reg(0, PDP1_IR), 5); |
| 333 | pdp1_draw_led(machine, bitmap, x_panel_col3_offset, y_panel_sngl_step_offset, cpu_get_reg(machine->cpu[0], PDP1_SNGL_STEP)); |
| 334 | pdp1_draw_switch(machine, bitmap, x_panel_col3_offset+8, y_panel_sngl_step_offset, cpu_get_reg(machine->cpu[0], PDP1_SNGL_STEP)); |
| 335 | pdp1_draw_led(machine, bitmap, x_panel_col3_offset, y_panel_sngl_inst_offset, cpu_get_reg(machine->cpu[0], PDP1_SNGL_INST)); |
| 336 | pdp1_draw_switch(machine, bitmap, x_panel_col3_offset+8, y_panel_sngl_inst_offset, cpu_get_reg(machine->cpu[0], PDP1_SNGL_INST)); |
| 337 | pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_ss_offset+8, cpu_get_reg(machine->cpu[0], PDP1_SS), 6); |
| 338 | pdp1_draw_multipleswitch(machine, bitmap, x_panel_col3_offset, y_panel_ss_offset+2*8, cpu_get_reg(machine->cpu[0], PDP1_SS), 6); |
| 339 | pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_pf_offset+8, cpu_get_reg(machine->cpu[0], PDP1_PF), 6); |
| 340 | pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_ir_offset+8, cpu_get_reg(machine->cpu[0], PDP1_IR), 5); |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | |
src/mess/video/tx0.c
| r3679 | r3680 | |
| 292 | 292 | int i; |
| 293 | 293 | |
| 294 | 294 | /* column 1: registers, test accumulator, test buffer, toggle switch storage */ |
| 295 | | tx0_draw_multipleled(machine, bitmap, x_panel_col1b_offset+2*8, y_panel_pc_offset+8, cpunum_get_reg(0, TX0_PC), 16); |
| 296 | | tx0_draw_multipleled(machine, bitmap, x_panel_col1b_offset+2*8, y_panel_mar_offset+8, cpunum_get_reg(0, TX0_MAR), 16); |
| 297 | | tx0_draw_multipleled(machine, bitmap, x_panel_col1b_offset, y_panel_mbr_offset+8, cpunum_get_reg(0, TX0_MBR), 18); |
| 298 | | tx0_draw_multipleled(machine, bitmap, x_panel_col1b_offset, y_panel_ac_offset+8, cpunum_get_reg(0, TX0_AC), 18); |
| 299 | | tx0_draw_multipleled(machine, bitmap, x_panel_col1b_offset, y_panel_lr_offset+8, cpunum_get_reg(0, TX0_LR), 18); |
| 300 | | tx0_draw_multipleled(machine, bitmap, x_panel_col1b_offset+4*8, y_panel_xr_offset+8, cpunum_get_reg(0, TX0_XR), 14); |
| 301 | | tx0_draw_multipleswitch(machine, bitmap, x_panel_col1b_offset, y_panel_tbr_offset+8, cpunum_get_reg(0, TX0_TBR), 18); |
| 302 | | tx0_draw_multipleswitch(machine, bitmap, x_panel_col1b_offset, y_panel_tac_offset+8, cpunum_get_reg(0, TX0_TAC), 18); |
| 303 | | cm_sel = cpunum_get_reg(0, TX0_CM_SEL); |
| 304 | | lr_sel = cpunum_get_reg(0, TX0_LR_SEL); |
| 295 | tx0_draw_multipleled(machine, bitmap, x_panel_col1b_offset+2*8, y_panel_pc_offset+8, cpu_get_reg(machine->cpu[0], TX0_PC), 16); |
| 296 | tx0_draw_multipleled(machine, bitmap, x_panel_col1b_offset+2*8, y_panel_mar_offset+8, cpu_get_reg(machine->cpu[0], TX0_MAR), 16); |
| 297 | tx0_draw_multipleled(machine, bitmap, x_panel_col1b_offset, y_panel_mbr_offset+8, cpu_get_reg(machine->cpu[0], TX0_MBR), 18); |
| 298 | tx0_draw_multipleled(machine, bitmap, x_panel_col1b_offset, y_panel_ac_offset+8, cpu_get_reg(machine->cpu[0], TX0_AC), 18); |
| 299 | tx0_draw_multipleled(machine, bitmap, x_panel_col1b_offset, y_panel_lr_offset+8, cpu_get_reg(machine->cpu[0], TX0_LR), 18); |
| 300 | tx0_draw_multipleled(machine, bitmap, x_panel_col1b_offset+4*8, y_panel_xr_offset+8, cpu_get_reg(machine->cpu[0], TX0_XR), 14); |
| 301 | tx0_draw_multipleswitch(machine, bitmap, x_panel_col1b_offset, y_panel_tbr_offset+8, cpu_get_reg(machine->cpu[0], TX0_TBR), 18); |
| 302 | tx0_draw_multipleswitch(machine, bitmap, x_panel_col1b_offset, y_panel_tac_offset+8, cpu_get_reg(machine->cpu[0], TX0_TAC), 18); |
| 303 | cm_sel = cpu_get_reg(machine->cpu[0], TX0_CM_SEL); |
| 304 | lr_sel = cpu_get_reg(machine->cpu[0], TX0_LR_SEL); |
| 305 | 305 | for (i=0; i<16; i++) |
| 306 | 306 | { |
| 307 | 307 | tx0_draw_switch(machine, bitmap, x_panel_col1a_offset+16, y_panel_tss_offset+8+i*8, (cm_sel >> i) & 1); |
| 308 | | tx0_draw_multipleswitch(machine, bitmap, x_panel_col1a_offset+24, y_panel_tss_offset+8+i*8, cpunum_get_reg(0, TX0_TSS00+i), 18); |
| 308 | tx0_draw_multipleswitch(machine, bitmap, x_panel_col1a_offset+24, y_panel_tss_offset+8+i*8, cpu_get_reg(machine->cpu[0], TX0_TSS00+i), 18); |
| 309 | 309 | tx0_draw_switch(machine, bitmap, x_panel_col1a_offset+168, y_panel_tss_offset+8+i*8, (lr_sel >> i) & 1); |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | /* column 2: stop c0, stop c1, cm sel, 1-bit indicators, instr, flags */ |
| 313 | | tx0_draw_switch(machine, bitmap, x_panel_col2_offset, y_panel_stop_c0_offset, cpunum_get_reg(0, TX0_STOP_CYC0)); |
| 314 | | tx0_draw_switch(machine, bitmap, x_panel_col2_offset, y_panel_stop_c1_offset, cpunum_get_reg(0, TX0_STOP_CYC1)); |
| 315 | | tx0_draw_switch(machine, bitmap, x_panel_col2_offset, y_panel_gbl_cm_sel_offset, cpunum_get_reg(0, TX0_GBL_CM_SEL)); |
| 316 | | tx0_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_run_offset, cpunum_get_reg(0, TX0_RUN)); |
| 317 | | tx0_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_cycle1_offset, cpunum_get_reg(0, TX0_CYCLE) & 1); |
| 318 | | tx0_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_cycle2_offset, cpunum_get_reg(0, TX0_CYCLE) & 2); |
| 319 | | tx0_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_rim_offset, cpunum_get_reg(0, TX0_RIM)); |
| 320 | | tx0_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ioh_offset, cpunum_get_reg(0, TX0_IOH)); |
| 321 | | tx0_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ios_offset, cpunum_get_reg(0, TX0_IOS)); |
| 322 | | tx0_draw_multipleled(machine, bitmap, x_panel_col2_offset, y_panel_ir_offset+8, cpunum_get_reg(0, TX0_IR), 5); |
| 323 | | tx0_draw_multipleled(machine, bitmap, x_panel_col2_offset, y_panel_pf_offset+8, cpunum_get_reg(0, TX0_PF), 6); |
| 313 | tx0_draw_switch(machine, bitmap, x_panel_col2_offset, y_panel_stop_c0_offset, cpu_get_reg(machine->cpu[0], TX0_STOP_CYC0)); |
| 314 | tx0_draw_switch(machine, bitmap, x_panel_col2_offset, y_panel_stop_c1_offset, cpu_get_reg(machine->cpu[0], TX0_STOP_CYC1)); |
| 315 | tx0_draw_switch(machine, bitmap, x_panel_col2_offset, y_panel_gbl_cm_sel_offset, cpu_get_reg(machine->cpu[0], TX0_GBL_CM_SEL)); |
| 316 | tx0_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_run_offset, cpu_get_reg(machine->cpu[0], TX0_RUN)); |
| 317 | tx0_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_cycle1_offset, cpu_get_reg(machine->cpu[0], TX0_CYCLE) & 1); |
| 318 | tx0_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_cycle2_offset, cpu_get_reg(machine->cpu[0], TX0_CYCLE) & 2); |
| 319 | tx0_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_rim_offset, cpu_get_reg(machine->cpu[0], TX0_RIM)); |
| 320 | tx0_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ioh_offset, cpu_get_reg(machine->cpu[0], TX0_IOH)); |
| 321 | tx0_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ios_offset, cpu_get_reg(machine->cpu[0], TX0_IOS)); |
| 322 | tx0_draw_multipleled(machine, bitmap, x_panel_col2_offset, y_panel_ir_offset+8, cpu_get_reg(machine->cpu[0], TX0_IR), 5); |
| 323 | tx0_draw_multipleled(machine, bitmap, x_panel_col2_offset, y_panel_pf_offset+8, cpu_get_reg(machine->cpu[0], TX0_PF), 6); |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | |
src/mess/machine/pdp1.c
| r3679 | r3680 | |
| 528 | 528 | tape_reader.rcl = 0; |
| 529 | 529 | if (tape_reader.rcp) |
| 530 | 530 | { |
| 531 | | cpu_set_reg(machine->cpu[0], PDP1_IO, tape_reader.rb); /* transfer reader buffer to IO */ |
| 531 | cpu_set_reg(Machine->cpu[0], PDP1_IO, tape_reader.rb); /* transfer reader buffer to IO */ |
| 532 | 532 | pdp1_pulse_iot_done(); |
| 533 | 533 | } |
| 534 | 534 | else |
| r3679 | r3680 | |
| 596 | 596 | void iot_rpa(int op2, int nac, int mb, int *io, int ac) |
| 597 | 597 | { |
| 598 | 598 | if (LOG_IOT_EXTRA) |
| 599 | | logerror("Warning, RPA instruction not fully emulated: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 599 | logerror("Warning, RPA instruction not fully emulated: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpu_get_reg(Machine->cpu[0], PDP1_PC)); |
| 600 | 600 | |
| 601 | 601 | begin_tape_read(0, nac); |
| 602 | 602 | } |
| r3679 | r3680 | |
| 633 | 633 | void iot_rpb(int op2, int nac, int mb, int *io, int ac) |
| 634 | 634 | { |
| 635 | 635 | if (LOG_IOT_EXTRA) |
| 636 | | logerror("Warning, RPB instruction not fully emulated: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 636 | logerror("Warning, RPB instruction not fully emulated: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpu_get_reg(Machine->cpu[0], PDP1_PC)); |
| 637 | 637 | |
| 638 | 638 | begin_tape_read(1, nac); |
| 639 | 639 | } |
| r3679 | r3680 | |
| 644 | 644 | void iot_rrb(int op2, int nac, int mb, int *io, int ac) |
| 645 | 645 | { |
| 646 | 646 | if (LOG_IOT_EXTRA) |
| 647 | | logerror("RRB instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 647 | logerror("RRB instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpu_get_reg(Machine->cpu[0], PDP1_PC)); |
| 648 | 648 | |
| 649 | 649 | *io = tape_reader.rb; |
| 650 | 650 | io_status &= ~io_st_ptr; |
| r3679 | r3680 | |
| 667 | 667 | void iot_ppa(int op2, int nac, int mb, int *io, int ac) |
| 668 | 668 | { |
| 669 | 669 | if (LOG_IOT_EXTRA) |
| 670 | | logerror("PPA instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 670 | logerror("PPA instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpu_get_reg(Machine->cpu[0], PDP1_PC)); |
| 671 | 671 | |
| 672 | 672 | tape_write(*io & 0377); |
| 673 | 673 | io_status &= ~io_st_ptp; |
| r3679 | r3680 | |
| 675 | 675 | if (LOG_IOT_OVERLAP) |
| 676 | 676 | { |
| 677 | 677 | if (timer_enable(tape_puncher.timer, 0)) |
| 678 | | logerror("Error: overlapped PPA/PPB instructions: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 678 | logerror("Error: overlapped PPA/PPB instructions: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpu_get_reg(Machine->cpu[0], PDP1_PC)); |
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | timer_adjust_oneshot(tape_puncher.timer, ATTOTIME_IN_USEC(15800), nac); |
| r3679 | r3680 | |
| 695 | 695 | void iot_ppb(int op2, int nac, int mb, int *io, int ac) |
| 696 | 696 | { |
| 697 | 697 | if (LOG_IOT_EXTRA) |
| 698 | | logerror("PPB instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 698 | logerror("PPB instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpu_get_reg(Machine->cpu[0], PDP1_PC)); |
| 699 | 699 | |
| 700 | 700 | tape_write((*io >> 12) | 0200); |
| 701 | 701 | io_status &= ~io_st_ptp; |
| r3679 | r3680 | |
| 703 | 703 | if (LOG_IOT_OVERLAP) |
| 704 | 704 | { |
| 705 | 705 | if (timer_enable(tape_puncher.timer, 0)) |
| 706 | | logerror("Error: overlapped PPA/PPB instructions: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 706 | logerror("Error: overlapped PPA/PPB instructions: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpu_get_reg(Machine->cpu[0], PDP1_PC)); |
| 707 | 707 | } |
| 708 | 708 | timer_adjust_oneshot(tape_puncher.timer, ATTOTIME_IN_USEC(15800), nac); |
| 709 | 709 | } |
| r3679 | r3680 | |
| 863 | 863 | int ch, delay; |
| 864 | 864 | |
| 865 | 865 | if (LOG_IOT_EXTRA) |
| 866 | | logerror("Warning, TYO instruction not fully emulated: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 866 | logerror("Warning, TYO instruction not fully emulated: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpu_get_reg(Machine->cpu[0], PDP1_PC)); |
| 867 | 867 | |
| 868 | 868 | ch = (*io) & 077; |
| 869 | 869 | |
| r3679 | r3680 | |
| 891 | 891 | if (LOG_IOT_OVERLAP) |
| 892 | 892 | { |
| 893 | 893 | if (timer_enable(typewriter.tyo_timer, 0)) |
| 894 | | logerror("Error: overlapped TYO instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 894 | logerror("Error: overlapped TYO instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpu_get_reg(Machine->cpu[0], PDP1_PC)); |
| 895 | 895 | } |
| 896 | 896 | |
| 897 | 897 | timer_adjust_oneshot(typewriter.tyo_timer, ATTOTIME_IN_MSEC(delay), nac); |
| r3679 | r3680 | |
| 914 | 914 | void iot_tyi(int op2, int nac, int mb, int *io, int ac) |
| 915 | 915 | { |
| 916 | 916 | if (LOG_IOT_EXTRA) |
| 917 | | logerror("Warning, TYI instruction not fully emulated: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 917 | logerror("Warning, TYI instruction not fully emulated: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpu_get_reg(Machine->cpu[0], PDP1_PC)); |
| 918 | 918 | |
| 919 | 919 | *io = typewriter.tb; |
| 920 | 920 | if (! (io_status & io_st_tyi)) |
| r3679 | r3680 | |
| 993 | 993 | { |
| 994 | 994 | io_status |= io_st_pen; |
| 995 | 995 | |
| 996 | | cpu_set_reg(machine->cpu[0], PDP1_PF3, 1); |
| 996 | cpu_set_reg(Machine->cpu[0], PDP1_PF3, 1); |
| 997 | 997 | } |
| 998 | 998 | |
| 999 | 999 | if (nac) |
| r3679 | r3680 | |
| 1004 | 1004 | /* note that overlap detection is incomplete: it will only work if both DPY |
| 1005 | 1005 | instructions require a completion pulse */ |
| 1006 | 1006 | if (timer_enable(dpy_timer, 0)) |
| 1007 | | logerror("Error: overlapped DPY instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 1007 | logerror("Error: overlapped DPY instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpu_get_reg(Machine->cpu[0], PDP1_PC)); |
| 1008 | 1008 | } |
| 1009 | 1009 | timer_adjust_oneshot(dpy_timer, ATTOTIME_IN_USEC(50), 0); |
| 1010 | 1010 | } |
| r3679 | r3680 | |
| 1133 | 1133 | { |
| 1134 | 1134 | if ((parallel_drum.wfb >= 1) && (parallel_drum.wfb <= 22)) |
| 1135 | 1135 | { |
| 1136 | | drum_write(parallel_drum.wfb-1, dc, READ_PDP_18BIT(parallel_drum.wcl)); |
| 1136 | drum_write(parallel_drum.wfb-1, dc, (signed)memory_read_dword_32be(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM),parallel_drum.wcl<<2)); |
| 1137 | 1137 | } |
| 1138 | 1138 | |
| 1139 | 1139 | if ((parallel_drum.rfb >= 1) && (parallel_drum.rfb <= 22)) |
| 1140 | 1140 | { |
| 1141 | | WRITE_PDP_18BIT(parallel_drum.wcl, drum_read(parallel_drum.rfb-1, dc)); |
| 1141 | memory_write_dword_32be(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM),parallel_drum.wcl<<2, drum_read(parallel_drum.rfb-1, dc)); |
| 1142 | 1142 | } |
| 1143 | 1143 | |
| 1144 | 1144 | parallel_drum.wc = (parallel_drum.wc+1) & 07777; |
| r3679 | r3680 | |
| 1147 | 1147 | if (parallel_drum.wc) |
| 1148 | 1148 | delay = attotime_add(delay, PARALLEL_DRUM_WORD_TIME); |
| 1149 | 1149 | } while (parallel_drum.wc); |
| 1150 | | activecpu_adjust_icount(-ATTOTIME_TO_CYCLES(0, delay)); |
| 1150 | cpu_adjust_icount(Machine->cpu[0],-ATTOTIME_TO_CYCLES(0, delay)); |
| 1151 | 1151 | /* if no error, skip */ |
| 1152 | | cpu_set_reg(machine->cpu[0], PDP1_PC, cpunum_get_reg(0, PDP1_PC)+1); |
| 1152 | cpu_set_reg(Machine->cpu[0], PDP1_PC, cpu_get_reg(Machine->cpu[0], PDP1_PC)+1); |
| 1153 | 1153 | } |
| 1154 | 1154 | |
| 1155 | 1155 | void iot_dra(int op2, int nac, int mb, int *io, int ac) |
| r3679 | r3680 | |
| 1216 | 1216 | void iot_cks(int op2, int nac, int mb, int *io, int ac) |
| 1217 | 1217 | { |
| 1218 | 1218 | if (LOG_IOT_EXTRA) |
| 1219 | | logerror("CKS instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 1219 | logerror("CKS instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpu_get_reg(Machine->cpu[0], PDP1_PC)); |
| 1220 | 1220 | |
| 1221 | 1221 | *io = io_status; |
| 1222 | 1222 | } |
| r3679 | r3680 | |
| 1346 | 1346 | */ |
| 1347 | 1347 | INTERRUPT_GEN( pdp1_interrupt ) |
| 1348 | 1348 | { |
| 1349 | running_machine *machine = device->machine; |
| 1349 | 1350 | int control_keys; |
| 1350 | 1351 | int tw_keys; |
| 1351 | 1352 | int ta_keys; |
| r3679 | r3680 | |
| 1359 | 1360 | int ta_transitions; |
| 1360 | 1361 | |
| 1361 | 1362 | |
| 1362 | | cpu_set_reg(machine->cpu[0], PDP1_SS, input_port_read(machine, "SENSE")); |
| 1363 | cpu_set_reg(device, PDP1_SS, input_port_read(device->machine, "SENSE")); |
| 1363 | 1364 | |
| 1364 | 1365 | /* read new state of control keys */ |
| 1365 | | control_keys = input_port_read(machine, "CSW"); |
| 1366 | control_keys = input_port_read(device->machine, "CSW"); |
| 1366 | 1367 | |
| 1367 | 1368 | if (control_keys & pdp1_control) |
| 1368 | 1369 | { |
| r3679 | r3680 | |
| 1371 | 1372 | |
| 1372 | 1373 | if (control_transitions & pdp1_extend) |
| 1373 | 1374 | { |
| 1374 | | cpu_set_reg(machine->cpu[0], PDP1_EXTEND_SW, ! cpunum_get_reg(0, PDP1_EXTEND_SW)); |
| 1375 | cpu_set_reg(device, PDP1_EXTEND_SW, ! cpu_get_reg(device, PDP1_EXTEND_SW)); |
| 1375 | 1376 | } |
| 1376 | 1377 | if (control_transitions & pdp1_start_nobrk) |
| 1377 | 1378 | { |
| 1378 | 1379 | pdp1_pulse_start_clear(); /* pulse Start Clear line */ |
| 1379 | | cpu_set_reg(machine->cpu[0], PDP1_EXD, cpunum_get_reg(0, PDP1_EXTEND_SW)); |
| 1380 | | cpu_set_reg(machine->cpu[0], PDP1_SBM, 0); |
| 1381 | | cpu_set_reg(machine->cpu[0], PDP1_OV, 0); |
| 1382 | | cpu_set_reg(machine->cpu[0], PDP1_PC, cpunum_get_reg(0, PDP1_TA)); |
| 1383 | | cpu_set_reg(machine->cpu[0], PDP1_RUN, 1); |
| 1380 | cpu_set_reg(device, PDP1_EXD, cpu_get_reg(device, PDP1_EXTEND_SW)); |
| 1381 | cpu_set_reg(device, PDP1_SBM, 0); |
| 1382 | cpu_set_reg(device, PDP1_OV, 0); |
| 1383 | cpu_set_reg(device, PDP1_PC, cpu_get_reg(device, PDP1_TA)); |
| 1384 | cpu_set_reg(device, PDP1_RUN, 1); |
| 1384 | 1385 | } |
| 1385 | 1386 | if (control_transitions & pdp1_start_brk) |
| 1386 | 1387 | { |
| 1387 | 1388 | pdp1_pulse_start_clear(); /* pulse Start Clear line */ |
| 1388 | | cpu_set_reg(machine->cpu[0], PDP1_EXD, cpunum_get_reg(0, PDP1_EXTEND_SW)); |
| 1389 | | cpu_set_reg(machine->cpu[0], PDP1_SBM, 1); |
| 1390 | | cpu_set_reg(machine->cpu[0], PDP1_OV, 0); |
| 1391 | | cpu_set_reg(machine->cpu[0], PDP1_PC, cpunum_get_reg(0, PDP1_TA)); |
| 1392 | | cpu_set_reg(machine->cpu[0], PDP1_RUN, 1); |
| 1389 | cpu_set_reg(device, PDP1_EXD, cpu_get_reg(device, PDP1_EXTEND_SW)); |
| 1390 | cpu_set_reg(device, PDP1_SBM, 1); |
| 1391 | cpu_set_reg(device, PDP1_OV, 0); |
| 1392 | cpu_set_reg(device, PDP1_PC, cpu_get_reg(device, PDP1_TA)); |
| 1393 | cpu_set_reg(device, PDP1_RUN, 1); |
| 1393 | 1394 | } |
| 1394 | 1395 | if (control_transitions & pdp1_stop) |
| 1395 | 1396 | { |
| 1396 | | cpu_set_reg(machine->cpu[0], PDP1_RUN, 0); |
| 1397 | | cpu_set_reg(machine->cpu[0], PDP1_RIM, 0); /* bug : we stop after reading an even-numbered word |
| 1397 | cpu_set_reg(device, PDP1_RUN, 0); |
| 1398 | cpu_set_reg(device, PDP1_RIM, 0); /* bug : we stop after reading an even-numbered word |
| 1398 | 1399 | (i.e. data), whereas a real pdp-1 stops after reading |
| 1399 | 1400 | an odd-numbered word (i.e. dio instruciton) */ |
| 1400 | 1401 | } |
| 1401 | 1402 | if (control_transitions & pdp1_continue) |
| 1402 | 1403 | { |
| 1403 | | cpu_set_reg(machine->cpu[0], PDP1_RUN, 1); |
| 1404 | cpu_set_reg(device, PDP1_RUN, 1); |
| 1404 | 1405 | } |
| 1405 | 1406 | if (control_transitions & pdp1_examine) |
| 1406 | 1407 | { |
| 1407 | 1408 | pdp1_pulse_start_clear(); /* pulse Start Clear line */ |
| 1408 | | cpu_set_reg(machine->cpu[0], PDP1_PC, cpunum_get_reg(0, PDP1_TA)); |
| 1409 | | cpu_set_reg(machine->cpu[0], PDP1_MA, cpunum_get_reg(0, PDP1_PC)); |
| 1410 | | cpu_set_reg(machine->cpu[0], PDP1_IR, LAC); /* this instruction is actually executed */ |
| 1409 | cpu_set_reg(device, PDP1_PC, cpu_get_reg(device, PDP1_TA)); |
| 1410 | cpu_set_reg(device, PDP1_MA, cpu_get_reg(device, PDP1_PC)); |
| 1411 | cpu_set_reg(device, PDP1_IR, LAC); /* this instruction is actually executed */ |
| 1411 | 1412 | |
| 1412 | | cpu_set_reg(machine->cpu[0], PDP1_MB, READ_PDP_18BIT(cpunum_get_reg(0, PDP1_MA))); |
| 1413 | | cpu_set_reg(machine->cpu[0], PDP1_AC, cpunum_get_reg(0, PDP1_MB)); |
| 1413 | cpu_set_reg(device, PDP1_MB, (signed)memory_read_dword_32be(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), PDP1_MA<<2)); |
| 1414 | cpu_set_reg(device, PDP1_AC, cpu_get_reg(device, PDP1_MB)); |
| 1414 | 1415 | } |
| 1415 | 1416 | if (control_transitions & pdp1_deposit) |
| 1416 | 1417 | { |
| 1417 | 1418 | pdp1_pulse_start_clear(); /* pulse Start Clear line */ |
| 1418 | | cpu_set_reg(machine->cpu[0], PDP1_PC, cpunum_get_reg(0, PDP1_TA)); |
| 1419 | | cpu_set_reg(machine->cpu[0], PDP1_MA, cpunum_get_reg(0, PDP1_PC)); |
| 1420 | | cpu_set_reg(machine->cpu[0], PDP1_AC, cpunum_get_reg(0, PDP1_TW)); |
| 1421 | | cpu_set_reg(machine->cpu[0], PDP1_IR, DAC); /* this instruction is actually executed */ |
| 1419 | cpu_set_reg(device, PDP1_PC, cpu_get_reg(device, PDP1_TA)); |
| 1420 | cpu_set_reg(device, PDP1_MA, cpu_get_reg(device, PDP1_PC)); |
| 1421 | cpu_set_reg(device, PDP1_AC, cpu_get_reg(device, PDP1_TW)); |
| 1422 | cpu_set_reg(device, PDP1_IR, DAC); /* this instruction is actually executed */ |
| 1422 | 1423 | |
| 1423 | | cpu_set_reg(machine->cpu[0], PDP1_MB, cpunum_get_reg(0, PDP1_AC)); |
| 1424 | | WRITE_PDP_18BIT(cpunum_get_reg(0, PDP1_MA), cpunum_get_reg(0, PDP1_MB)); |
| 1424 | cpu_set_reg(device, PDP1_MB, cpu_get_reg(device, PDP1_AC)); |
| 1425 | memory_write_dword_32be(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM),cpu_get_reg(device, PDP1_MA)<<2, cpu_get_reg(device, PDP1_MB)); |
| 1425 | 1426 | } |
| 1426 | 1427 | if (control_transitions & pdp1_read_in) |
| 1427 | 1428 | { /* set cpu to read instructions from perforated tape */ |
| 1428 | 1429 | pdp1_pulse_start_clear(); /* pulse Start Clear line */ |
| 1429 | | cpu_set_reg(machine->cpu[0], PDP1_PC, (cpunum_get_reg(0, PDP1_TA) & 0170000) |
| 1430 | | | (cpunum_get_reg(0, PDP1_PC) & 0007777)); /* transfer ETA to EPC */ |
| 1431 | | /*cpu_set_reg(machine->cpu[0], PDP1_MA, cpunum_get_reg(0, PDP1_PC));*/ |
| 1432 | | cpu_set_reg(machine->cpu[0], PDP1_EXD, cpunum_get_reg(0, PDP1_EXTEND_SW)); |
| 1433 | | cpu_set_reg(machine->cpu[0], PDP1_OV, 0); /* right??? */ |
| 1434 | | cpu_set_reg(machine->cpu[0], PDP1_RUN, 0); |
| 1435 | | cpu_set_reg(machine->cpu[0], PDP1_RIM, 1); |
| 1430 | cpu_set_reg(device, PDP1_PC, ( cpu_get_reg(device, PDP1_TA) & 0170000) |
| 1431 | | (cpu_get_reg(device, PDP1_PC) & 0007777)); /* transfer ETA to EPC */ |
| 1432 | /*cpu_set_reg(machine->cpu[0], PDP1_MA, cpu_get_reg(machine->cpu[0], PDP1_PC));*/ |
| 1433 | cpu_set_reg(device, PDP1_EXD, cpu_get_reg(device, PDP1_EXTEND_SW)); |
| 1434 | cpu_set_reg(device, PDP1_OV, 0); /* right??? */ |
| 1435 | cpu_set_reg(device, PDP1_RUN, 0); |
| 1436 | cpu_set_reg(device, PDP1_RIM, 1); |
| 1436 | 1437 | } |
| 1437 | 1438 | if (control_transitions & pdp1_reader) |
| 1438 | 1439 | { |
| r3679 | r3680 | |
| 1442 | 1443 | } |
| 1443 | 1444 | if (control_transitions & pdp1_single_step) |
| 1444 | 1445 | { |
| 1445 | | cpu_set_reg(machine->cpu[0], PDP1_SNGL_STEP, ! cpunum_get_reg(0, PDP1_SNGL_STEP)); |
| 1446 | cpu_set_reg(device, PDP1_SNGL_STEP, ! cpu_get_reg(device, PDP1_SNGL_STEP)); |
| 1446 | 1447 | } |
| 1447 | 1448 | if (control_transitions & pdp1_single_inst) |
| 1448 | 1449 | { |
| 1449 | | cpu_set_reg(machine->cpu[0], PDP1_SNGL_INST, ! cpunum_get_reg(0, PDP1_SNGL_INST)); |
| 1450 | cpu_set_reg(device, PDP1_SNGL_INST, ! cpu_get_reg(device, PDP1_SNGL_INST)); |
| 1450 | 1451 | } |
| 1451 | 1452 | |
| 1452 | 1453 | /* remember new state of control keys */ |
| r3679 | r3680 | |
| 1460 | 1461 | tw_transitions = tw_keys & (~ old_tw_keys); |
| 1461 | 1462 | |
| 1462 | 1463 | if (tw_transitions) |
| 1463 | | cpu_set_reg(machine->cpu[0], PDP1_TW, cpunum_get_reg(0, PDP1_TW) ^ tw_transitions); |
| 1464 | cpu_set_reg(device, PDP1_TW, cpu_get_reg(device, PDP1_TW) ^ tw_transitions); |
| 1464 | 1465 | |
| 1465 | 1466 | /* remember new state of test word keys */ |
| 1466 | 1467 | old_tw_keys = tw_keys; |
| r3679 | r3680 | |
| 1473 | 1474 | ta_transitions = ta_keys & (~ old_ta_keys); |
| 1474 | 1475 | |
| 1475 | 1476 | if (ta_transitions) |
| 1476 | | cpu_set_reg(machine->cpu[0], PDP1_TA, cpunum_get_reg(0, PDP1_TA) ^ ta_transitions); |
| 1477 | cpu_set_reg(device, PDP1_TA, cpu_get_reg(device, PDP1_TA) ^ ta_transitions); |
| 1477 | 1478 | |
| 1478 | 1479 | /* remember new state of test word keys */ |
| 1479 | 1480 | old_ta_keys = ta_keys; |
src/mess/machine/tx0.c
| r3679 | r3680 | |
| 335 | 335 | if (data & 0100) |
| 336 | 336 | { |
| 337 | 337 | /* read current AC */ |
| 338 | | ac = cpunum_get_reg(0, TX0_AC); |
| 338 | ac = cpu_get_reg(Machine->cpu[0], TX0_AC); |
| 339 | 339 | /* cycle right */ |
| 340 | 340 | ac = (ac >> 1) | ((ac & 1) << 17); |
| 341 | 341 | /* shuffle and insert data into AC */ |
| 342 | 342 | ac = (ac /*& 0333333*/) | ((data & 001) << 17) | ((data & 002) << 13) | ((data & 004) << 9) | ((data & 010) << 5) | ((data & 020) << 1) | ((data & 040) >> 3); |
| 343 | 343 | /* write modified AC */ |
| 344 | | cpu_set_reg(machine->cpu[0], TX0_AC, ac); |
| 344 | cpu_set_reg(Machine->cpu[0], TX0_AC, ac); |
| 345 | 345 | |
| 346 | 346 | tape_reader.rc = (tape_reader.rc+1) & 3; |
| 347 | 347 | |
| 348 | 348 | if (tape_reader.rc == 0) |
| 349 | 349 | { /* IO complete */ |
| 350 | 350 | tape_reader.rcl = 0; |
| 351 | | tx0_pulse_io_complete(); |
| 351 | cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | } |
| r3679 | r3680 | |
| 366 | 366 | */ |
| 367 | 367 | static TIMER_CALLBACK(puncher_callback) |
| 368 | 368 | { |
| 369 | | tx0_pulse_io_complete(); |
| 369 | cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | /* |
| r3679 | r3680 | |
| 393 | 393 | int ac; |
| 394 | 394 | |
| 395 | 395 | /* read current AC */ |
| 396 | | ac = cpunum_get_reg(0, TX0_AC); |
| 396 | ac = cpu_get_reg(Machine->cpu[0], TX0_AC); |
| 397 | 397 | /* shuffle and punch 6-bit word */ |
| 398 | 398 | tape_write(((ac & 0100000) >> 15) | ((ac & 0010000) >> 11) | ((ac & 0001000) >> 7) | ((ac & 0000100) >> 3) | ((ac & 0000010) << 1) | ((ac & 0000001) << 5)); |
| 399 | 399 | |
| r3679 | r3680 | |
| 408 | 408 | int ac; |
| 409 | 409 | |
| 410 | 410 | /* read current AC */ |
| 411 | | ac = cpunum_get_reg(0, TX0_AC); |
| 411 | ac = cpu_get_reg(Machine->cpu[0], TX0_AC); |
| 412 | 412 | /* shuffle and punch 6-bit word */ |
| 413 | 413 | tape_write(((ac & 0100000) >> 15) | ((ac & 0010000) >> 11) | ((ac & 0001000) >> 7) | ((ac & 0000100) >> 3) | ((ac & 0000010) << 1) | ((ac & 0000001) << 5) | 0100); |
| 414 | 414 | |
| r3679 | r3680 | |
| 454 | 454 | */ |
| 455 | 455 | static TIMER_CALLBACK(prt_callback) |
| 456 | 456 | { |
| 457 | | tx0_pulse_io_complete(); |
| 457 | cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | /* |
| r3679 | r3680 | |
| 466 | 466 | int ch; |
| 467 | 467 | |
| 468 | 468 | /* read current AC */ |
| 469 | | ac = cpunum_get_reg(0, TX0_AC); |
| 469 | ac = cpu_get_reg(Machine->cpu[0], TX0_AC); |
| 470 | 470 | /* shuffle and print 6-bit word */ |
| 471 | 471 | ch = ((ac & 0100000) >> 15) | ((ac & 0010000) >> 11) | ((ac & 0001000) >> 7) | ((ac & 0000100) >> 3) | ((ac & 0000010) << 1) | ((ac & 0000001) << 5); |
| 472 | 472 | typewriter_out(Machine, ch); |
| r3679 | r3680 | |
| 480 | 480 | */ |
| 481 | 481 | static TIMER_CALLBACK(dis_callback) |
| 482 | 482 | { |
| 483 | | tx0_pulse_io_complete(); |
| 483 | cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | /* |
| r3679 | r3680 | |
| 492 | 492 | int x; |
| 493 | 493 | int y; |
| 494 | 494 | |
| 495 | | ac = cpunum_get_reg(0, TX0_AC); |
| 495 | ac = cpu_get_reg(Machine->cpu[0], TX0_AC); |
| 496 | 496 | x = ac >> 9; |
| 497 | 497 | y = ac & 0777; |
| 498 | 498 | tx0_plot(x, y); |
| r3679 | r3680 | |
| 595 | 595 | if ((magtape.state == MTS_SELECTED) || ((magtape.state == MTS_SELECTING) && (magtape.command == 2))) |
| 596 | 596 | { /* unit has become unavailable */ |
| 597 | 597 | magtape.state = MTS_UNSELECTING; |
| 598 | | cpu_set_reg(machine->cpu[0], TX0_PF, cpunum_get_reg(0, TX0_PF) | PF_RWC); |
| 598 | cpu_set_reg(Machine->cpu[0], TX0_PF, cpu_get_reg(Machine->cpu[0], TX0_PF) | PF_RWC); |
| 599 | 599 | schedule_unselect(); |
| 600 | 600 | } |
| 601 | 601 | } |
| r3679 | r3680 | |
| 618 | 618 | { |
| 619 | 619 | int mar; |
| 620 | 620 | |
| 621 | | mar = cpunum_get_reg(0, TX0_MAR); |
| 621 | mar = cpu_get_reg(Machine->cpu[0], TX0_MAR); |
| 622 | 622 | |
| 623 | 623 | if ((mar & 03) != 1) |
| 624 | 624 | { /* unimplemented device: remain in unselected state and set rwc |
| 625 | 625 | flag? */ |
| 626 | | cpu_set_reg(machine->cpu[0], TX0_PF, cpunum_get_reg(0, TX0_PF) | PF_RWC); |
| 626 | cpu_set_reg(Machine->cpu[0], TX0_PF, cpu_get_reg(Machine->cpu[0], TX0_PF) | PF_RWC); |
| 627 | 627 | } |
| 628 | 628 | else |
| 629 | 629 | { |
| r3679 | r3680 | |
| 638 | 638 | } |
| 639 | 639 | |
| 640 | 640 | magtape.sel_pending = FALSE; |
| 641 | | tx0_pulse_io_complete(); |
| 641 | cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 642 | 642 | } |
| 643 | 643 | break; |
| 644 | 644 | |
| r3679 | r3680 | |
| 681 | 681 | if (image_ftell(magtape.img) == 0) |
| 682 | 682 | { /* tape at ldp */ |
| 683 | 683 | magtape.state = MTS_UNSELECTING; |
| 684 | | cpu_set_reg(machine->cpu[0], TX0_PF, cpunum_get_reg(0, TX0_PF) | PF_RWC); |
| 684 | cpu_set_reg(Machine->cpu[0], TX0_PF, cpu_get_reg(Machine->cpu[0], TX0_PF) | PF_RWC); |
| 685 | 685 | schedule_unselect(); |
| 686 | 686 | } |
| 687 | 687 | else if (image_fseek(magtape.img, -1, SEEK_CUR)) |
| r3679 | r3680 | |
| 750 | 750 | logerror("invalid longitudinal parity\n"); |
| 751 | 751 | /* set EOR and unselect... */ |
| 752 | 752 | magtape.state = MTS_UNSELECTING; |
| 753 | | cpu_set_reg(machine->cpu[0], TX0_PF, cpunum_get_reg(0, TX0_PF) | PF_EOR); |
| 753 | cpu_set_reg(Machine->cpu[0], TX0_PF, cpu_get_reg(Machine->cpu[0], TX0_PF) | PF_EOR); |
| 754 | 754 | schedule_unselect(); |
| 755 | 755 | magtape.irg_pos = MTIRGP_ENDMINUS1; |
| 756 | 756 | } |
| r3679 | r3680 | |
| 806 | 806 | /*image_unload(magtape.img);*/ |
| 807 | 807 | /* Or do we stop at EOT mark??? */ |
| 808 | 808 | magtape.state = MTS_UNSELECTING; |
| 809 | | cpu_set_reg(machine->cpu[0], TX0_PF, cpunum_get_reg(0, TX0_PF) | PF_EOT); |
| 809 | cpu_set_reg(Machine->cpu[0], TX0_PF, cpu_get_reg(Machine->cpu[0], TX0_PF) | PF_EOT); |
| 810 | 810 | schedule_unselect(); |
| 811 | 811 | } |
| 812 | 812 | } |
| r3679 | r3680 | |
| 823 | 823 | if (magtape.cpy_pending) |
| 824 | 824 | { /* read command */ |
| 825 | 825 | magtape.u.read.space_flag = FALSE; |
| 826 | | tx0_pulse_io_complete(); |
| 827 | | cpu_set_reg(machine->cpu[0], TX0_LR, ((cpunum_get_reg(0, TX0_LR) >> 1) & 0333333) |
| 826 | cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 827 | cpu_set_reg(Machine->cpu[0], TX0_LR, ((cpu_get_reg(Machine->cpu[0], TX0_LR) >> 1) & 0333333) |
| 828 | 828 | | ((buf & 040) << 12) | ((buf & 020) << 10) | ((buf & 010) << 8) | ((buf & 004) << 6) | ((buf & 002) << 4) | ((buf & 001) << 2)); |
| 829 | 829 | /* check parity */ |
| 830 | 830 | if (! (((buf ^ (buf >> 1) ^ (buf >> 2) ^ (buf >> 3) ^ (buf >> 4) ^ (buf >> 5) ^ (buf >> 6) ^ (buf >> 7)) & 1) ^ magtape.binary_flag)) |
| 831 | | cpu_set_reg(machine->cpu[0], TX0_PF, cpunum_get_reg(0, TX0_PF) | PF_PC); |
| 831 | cpu_set_reg(Machine->cpu[0], TX0_PF, cpu_get_reg(Machine->cpu[0], TX0_PF) | PF_PC); |
| 832 | 832 | } |
| 833 | 833 | else |
| 834 | 834 | { /* space command */ |
| r3679 | r3680 | |
| 847 | 847 | } |
| 848 | 848 | if (!magtape.u.read.space_flag) |
| 849 | 849 | { |
| 850 | | cpu_set_reg(machine->cpu[0], TX0_LR, ((cpunum_get_reg(0, TX0_LR) >> 1) & 0333333) |
| 850 | cpu_set_reg(Machine->cpu[0], TX0_LR, ((cpu_get_reg(Machine->cpu[0], TX0_LR) >> 1) & 0333333) |
| 851 | 851 | | ((buf & 040) << 12) | ((buf & 020) << 10) | ((buf & 010) << 8) | ((buf & 004) << 6) | ((buf & 002) << 4) | ((buf & 001) << 2)); |
| 852 | 852 | /* check parity */ |
| 853 | 853 | if (! (((buf ^ (buf >> 1) ^ (buf >> 2) ^ (buf >> 3) ^ (buf >> 4) ^ (buf >> 5) ^ (buf >> 6) ^ (buf >> 7)) & 1) ^ magtape.binary_flag)) |
| 854 | | cpu_set_reg(machine->cpu[0], TX0_PF, cpunum_get_reg(0, TX0_PF) | PF_PC); |
| 854 | cpu_set_reg(Machine->cpu[0], TX0_PF, cpu_get_reg(Machine->cpu[0], TX0_PF) | PF_PC); |
| 855 | 855 | } |
| 856 | 856 | magtape.u.read.state = MTRDS_STATE2; |
| 857 | 857 | break; |
| r3679 | r3680 | |
| 865 | 865 | } |
| 866 | 866 | if (!magtape.u.read.space_flag) |
| 867 | 867 | { |
| 868 | | cpu_set_reg(machine->cpu[0], TX0_LR, ((cpunum_get_reg(0, TX0_LR) >> 1) & 0333333) |
| 868 | cpu_set_reg(Machine->cpu[0], TX0_LR, ((cpu_get_reg(Machine->cpu[0], TX0_LR) >> 1) & 0333333) |
| 869 | 869 | | ((buf & 040) << 12) | ((buf & 020) << 10) | ((buf & 010) << 8) | ((buf & 004) << 6) | ((buf & 002) << 4) | ((buf & 001) << 2)); |
| 870 | 870 | /* check parity */ |
| 871 | 871 | if (! (((buf ^ (buf >> 1) ^ (buf >> 2) ^ (buf >> 3) ^ (buf >> 4) ^ (buf >> 5) ^ (buf >> 6) ^ (buf >> 7)) & 1) ^ magtape.binary_flag)) |
| 872 | | cpu_set_reg(machine->cpu[0], TX0_PF, cpunum_get_reg(0, TX0_PF) | PF_PC); |
| 872 | cpu_set_reg(Machine->cpu[0], TX0_PF, cpu_get_reg(Machine->cpu[0], TX0_PF) | PF_PC); |
| 873 | 873 | /* synchronize with cpy instruction */ |
| 874 | 874 | if (magtape.cpy_pending) |
| 875 | | tx0_pulse_io_complete(); |
| 875 | cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 876 | 876 | else |
| 877 | | cpu_set_reg(machine->cpu[0], TX0_PF, cpunum_get_reg(0, TX0_PF) | PF_RWC); |
| 877 | cpu_set_reg(Machine->cpu[0], TX0_PF, cpu_get_reg(Machine->cpu[0], TX0_PF) | PF_RWC); |
| 878 | 878 | } |
| 879 | 879 | magtape.u.read.state = MTRDS_STATE3; |
| 880 | 880 | break; |
| r3679 | r3680 | |
| 886 | 886 | magtape.u.read.state = MTRDS_STATE1; |
| 887 | 887 | if (!magtape.u.read.space_flag) |
| 888 | 888 | { |
| 889 | | cpu_set_reg(machine->cpu[0], TX0_LR, ((cpunum_get_reg(0, TX0_LR) >> 1) & 0333333) |
| 889 | cpu_set_reg(Machine->cpu[0], TX0_LR, ((cpu_get_reg(Machine->cpu[0], TX0_LR) >> 1) & 0333333) |
| 890 | 890 | | ((buf & 040) << 12) | ((buf & 020) << 10) | ((buf & 010) << 8) | ((buf & 004) << 6) | ((buf & 002) << 4) | ((buf & 001) << 2)); |
| 891 | 891 | /* check parity */ |
| 892 | 892 | if (! (((buf ^ (buf >> 1) ^ (buf >> 2) ^ (buf >> 3) ^ (buf >> 4) ^ (buf >> 5) ^ (buf >> 6) ^ (buf >> 7)) & 1) ^ magtape.binary_flag)) |
| 893 | | cpu_set_reg(machine->cpu[0], TX0_PF, cpunum_get_reg(0, TX0_PF) | PF_PC); |
| 893 | cpu_set_reg(Machine->cpu[0], TX0_PF, cpu_get_reg(Machine->cpu[0], TX0_PF) | PF_PC); |
| 894 | 894 | } |
| 895 | 895 | } |
| 896 | 896 | else |
| r3679 | r3680 | |
| 930 | 930 | logerror("invalid longitudinal parity\n"); |
| 931 | 931 | /* no idea if the original tx-0 magtape controller |
| 932 | 932 | checks parity, but can't harm if we do */ |
| 933 | | cpu_set_reg(machine->cpu[0], TX0_PF, cpunum_get_reg(0, TX0_PF) | PF_PC); |
| 933 | cpu_set_reg(Machine->cpu[0], TX0_PF, cpu_get_reg(Machine->cpu[0], TX0_PF) | PF_PC); |
| 934 | 934 | } |
| 935 | 935 | /* set EOR and unselect... */ |
| 936 | 936 | magtape.state = MTS_UNSELECTING; |
| 937 | | cpu_set_reg(machine->cpu[0], TX0_PF, cpunum_get_reg(0, TX0_PF) | PF_EOR); |
| 937 | cpu_set_reg(Machine->cpu[0], TX0_PF, cpu_get_reg(Machine->cpu[0], TX0_PF) | PF_EOR); |
| 938 | 938 | schedule_unselect(); |
| 939 | 939 | magtape.irg_pos = MTIRGP_START; |
| 940 | 940 | break; |
| r3679 | r3680 | |
| 972 | 972 | if (magtape.u.write.counter) |
| 973 | 973 | { |
| 974 | 974 | magtape.u.write.counter--; |
| 975 | | lr = cpunum_get_reg(0, TX0_LR); |
| 975 | lr = cpu_get_reg(Machine->cpu[0], TX0_LR); |
| 976 | 976 | buf = ((lr >> 10) & 040) | ((lr >> 8) & 020) | ((lr >> 6) & 010) | ((lr >> 4) & 004) | ((lr >> 2) & 002) | (lr & 001); |
| 977 | 977 | buf |= ((buf << 1) ^ (buf << 2) ^ (buf << 3) ^ (buf << 4) ^ (buf << 5) ^ (buf << 6) ^ ((!magtape.binary_flag) << 6)) & 0100; |
| 978 | | cpu_set_reg(machine->cpu[0], TX0_LR, lr >> 1); |
| 978 | cpu_set_reg(Machine->cpu[0], TX0_LR, lr >> 1); |
| 979 | 979 | } |
| 980 | 980 | else |
| 981 | 981 | { |
| 982 | 982 | if (magtape.cpy_pending) |
| 983 | 983 | { |
| 984 | | tx0_pulse_io_complete(); |
| 985 | | lr = cpunum_get_reg(0, TX0_LR); |
| 984 | cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 985 | lr = cpu_get_reg(Machine->cpu[0], TX0_LR); |
| 986 | 986 | buf = ((lr >> 10) & 040) | ((lr >> 8) & 020) | ((lr >> 6) & 010) | ((lr >> 4) & 004) | ((lr >> 2) & 002) | (lr & 001); |
| 987 | 987 | buf |= ((buf << 1) ^ (buf << 2) ^ (buf << 3) ^ (buf << 4) ^ (buf << 5) ^ (buf << 6) ^ ((!magtape.binary_flag) << 6)) & 0100; |
| 988 | | cpu_set_reg(machine->cpu[0], TX0_LR, lr >> 1); |
| 988 | cpu_set_reg(Machine->cpu[0], TX0_LR, lr >> 1); |
| 989 | 989 | magtape.u.write.counter = 2; |
| 990 | 990 | break; |
| 991 | 991 | } |
| r3679 | r3680 | |
| 1062 | 1062 | case MTS_UNSELECTED: |
| 1063 | 1063 | case MTS_UNSELECTING: |
| 1064 | 1064 | /* ignore instruction and set rwc flag? */ |
| 1065 | | tx0_pulse_io_complete(); |
| 1065 | cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 1066 | 1066 | break; |
| 1067 | 1067 | |
| 1068 | 1068 | case MTS_SELECTING: |
| r3679 | r3680 | |
| 1072 | 1072 | case 0: /* backspace */ |
| 1073 | 1073 | case 2: /* rewind */ |
| 1074 | 1074 | /* ignore instruction and set rwc flag? */ |
| 1075 | | tx0_pulse_io_complete(); |
| 1075 | cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0); |
| 1076 | 1076 | break; |
| 1077 | 1077 | case 1: /* read */ |
| 1078 | 1078 | case 3: /* write */ |
| r3679 | r3680 | |
| 1139 | 1139 | previous LR */ |
| 1140 | 1140 | lr = (1 << 17) | ((charcode & 040) << 10) | ((charcode & 020) << 8) | ((charcode & 010) << 6) | ((charcode & 004) << 4) | ((charcode & 002) << 2) | ((charcode & 001) << 1); |
| 1141 | 1141 | /* write modified LR */ |
| 1142 | | cpu_set_reg(machine->cpu[0], TX0_LR, lr); |
| 1142 | cpu_set_reg(Machine->cpu[0], TX0_LR, lr); |
| 1143 | 1143 | tx0_typewriter_drawchar(machine, charcode); /* we want to echo input */ |
| 1144 | 1144 | break; |
| 1145 | 1145 | } |
| r3679 | r3680 | |
| 1166 | 1166 | |
| 1167 | 1167 | |
| 1168 | 1168 | /* read new state of control keys */ |
| 1169 | | control_keys = input_port_read(machine, "CSW"); |
| 1169 | control_keys = input_port_read(device->machine, "CSW"); |
| 1170 | 1170 | |
| 1171 | 1171 | if (control_keys & tx0_control) |
| 1172 | 1172 | { |
| r3679 | r3680 | |
| 1175 | 1175 | |
| 1176 | 1176 | if (control_transitions & tx0_stop_cyc0) |
| 1177 | 1177 | { |
| 1178 | | cpu_set_reg(machine->cpu[0], TX0_STOP_CYC0, !cpunum_get_reg(0, TX0_STOP_CYC0)); |
| 1178 | cpu_set_reg(device->machine->cpu[0], TX0_STOP_CYC0, !cpu_get_reg(device->machine->cpu[0], TX0_STOP_CYC0)); |
| 1179 | 1179 | } |
| 1180 | 1180 | if (control_transitions & tx0_stop_cyc1) |
| 1181 | 1181 | { |
| 1182 | | cpu_set_reg(machine->cpu[0], TX0_STOP_CYC1, !cpunum_get_reg(0, TX0_STOP_CYC1)); |
| 1182 | cpu_set_reg(device->machine->cpu[0], TX0_STOP_CYC1, !cpu_get_reg(device->machine->cpu[0], TX0_STOP_CYC1)); |
| 1183 | 1183 | } |
| 1184 | 1184 | if (control_transitions & tx0_gbl_cm_sel) |
| 1185 | 1185 | { |
| 1186 | | cpu_set_reg(machine->cpu[0], TX0_GBL_CM_SEL, !cpunum_get_reg(0, TX0_GBL_CM_SEL)); |
| 1186 | cpu_set_reg(device->machine->cpu[0], TX0_GBL_CM_SEL, !cpu_get_reg(device->machine->cpu[0], TX0_GBL_CM_SEL)); |
| 1187 | 1187 | } |
| 1188 | 1188 | if (control_transitions & tx0_stop) |
| 1189 | 1189 | { |
| 1190 | | cpu_set_reg(machine->cpu[0], TX0_RUN, 0); |
| 1191 | | cpu_set_reg(machine->cpu[0], TX0_RIM, 0); |
| 1190 | cpu_set_reg(device->machine->cpu[0], TX0_RUN, 0); |
| 1191 | cpu_set_reg(device->machine->cpu[0], TX0_RIM, 0); |
| 1192 | 1192 | } |
| 1193 | 1193 | if (control_transitions & tx0_restart) |
| 1194 | 1194 | { |
| 1195 | | cpu_set_reg(machine->cpu[0], TX0_RUN, 1); |
| 1196 | | cpu_set_reg(machine->cpu[0], TX0_RIM, 0); |
| 1195 | cpu_set_reg(device->machine->cpu[0], TX0_RUN, 1); |
| 1196 | cpu_set_reg(device->machine->cpu[0], TX0_RIM, 0); |
| 1197 | 1197 | } |
| 1198 | 1198 | if (control_transitions & tx0_read_in) |
| 1199 | 1199 | { /* set cpu to read instructions from perforated tape */ |
| 1200 | | tx0_pulse_reset(); |
| 1201 | | cpu_set_reg(machine->cpu[0], TX0_RUN, 0); |
| 1202 | | cpu_set_reg(machine->cpu[0], TX0_RIM, 1); |
| 1200 | cpu_set_reg(Machine->cpu[0], TX0_RESET, 0); |
| 1201 | cpu_set_reg(device->machine->cpu[0], TX0_RUN, 0); |
| 1202 | cpu_set_reg(device->machine->cpu[0], TX0_RIM, 1); |
| 1203 | 1203 | } |
| 1204 | 1204 | if (control_transitions & tx0_toggle_dn) |
| 1205 | 1205 | { |
| r3679 | r3680 | |
| 1217 | 1217 | { |
| 1218 | 1218 | if (tsr_index >= 2) |
| 1219 | 1219 | { |
| 1220 | | UINT32 cm_sel = (UINT32) cpunum_get_reg(0, TX0_CM_SEL); |
| 1221 | | cpu_set_reg(machine->cpu[0], TX0_CM_SEL, cm_sel ^ (1 << (tsr_index - 2))); |
| 1220 | UINT32 cm_sel = (UINT32) cpu_get_reg(device->machine->cpu[0], TX0_CM_SEL); |
| 1221 | cpu_set_reg(device->machine->cpu[0], TX0_CM_SEL, cm_sel ^ (1 << (tsr_index - 2))); |
| 1222 | 1222 | } |
| 1223 | 1223 | } |
| 1224 | 1224 | if (control_transitions & tx0_lr_sel) |
| 1225 | 1225 | { |
| 1226 | 1226 | if (tsr_index >= 2) |
| 1227 | 1227 | { |
| 1228 | | UINT32 lr_sel = (UINT32) cpunum_get_reg(0, TX0_LR_SEL); |
| 1229 | | cpu_set_reg(machine->cpu[0], TX0_LR_SEL, (lr_sel ^ (1 << (tsr_index - 2)))); |
| 1228 | UINT32 lr_sel = (UINT32) cpu_get_reg(device->machine->cpu[0], TX0_LR_SEL); |
| 1229 | cpu_set_reg(device->machine->cpu[0], TX0_LR_SEL, (lr_sel ^ (1 << (tsr_index - 2)))); |
| 1230 | 1230 | } |
| 1231 | 1231 | } |
| 1232 | 1232 | |
| r3679 | r3680 | |
| 1235 | 1235 | |
| 1236 | 1236 | |
| 1237 | 1237 | /* handle toggle switch register keys */ |
| 1238 | | tsr_keys = (input_port_read(machine, "MSW") << 16) | input_port_read(machine, "LSW"); |
| 1238 | tsr_keys = (input_port_read(device->machine, "MSW") << 16) | input_port_read(device->machine, "LSW"); |
| 1239 | 1239 | |
| 1240 | 1240 | /* compute transitions */ |
| 1241 | 1241 | tsr_transitions = tsr_keys & (~ old_tsr_keys); |
| 1242 | 1242 | |
| 1243 | 1243 | /* update toggle switch register */ |
| 1244 | 1244 | if (tsr_transitions) |
| 1245 | | cpu_set_reg(machine->cpu[0], TX0_TBR+tsr_index, cpunum_get_reg(0, TX0_TBR+tsr_index) ^ tsr_transitions); |
| 1245 | cpu_set_reg(device->machine->cpu[0], TX0_TBR+tsr_index, cpu_get_reg(device->machine->cpu[0], TX0_TBR+tsr_index) ^ tsr_transitions); |
| 1246 | 1246 | |
| 1247 | 1247 | /* remember new state of toggle switch register keys */ |
| 1248 | 1248 | old_tsr_keys = tsr_keys; |
| r3679 | r3680 | |
| 1252 | 1252 | old_control_keys = 0; |
| 1253 | 1253 | old_tsr_keys = 0; |
| 1254 | 1254 | |
| 1255 | | tx0_keyboard(machine); |
| 1255 | tx0_keyboard(device->machine); |
| 1256 | 1256 | } |
| 1257 | 1257 | } |
| 1258 | 1258 | |
src/mess/machine/99_peb.c
| r3679 | r3680 | |
| 122 | 122 | { |
| 123 | 123 | struct |
| 124 | 124 | { |
| 125 | | read8_machine_func mem_read; /* card mem read handler (8 bits) */ |
| 126 | | write8_machine_func mem_write; /* card mem write handler (8 bits) */ |
| 125 | read8_space_func mem_read; /* card mem read handler (8 bits) */ |
| 126 | write8_space_func mem_write; /* card mem write handler (8 bits) */ |
| 127 | 127 | } width_8bit; |
| 128 | 128 | struct |
| 129 | 129 | { |
| 130 | | read16_machine_func mem_read; /* card mem read handler (16 bits) */ |
| 131 | | write16_machine_func mem_write; /* card mem write handler (16 bits) */ |
| 130 | read16_space_func mem_read; /* card mem read handler (16 bits) */ |
| 131 | write16_space_func mem_write; /* card mem write handler (16 bits) */ |
| 132 | 132 | } width_16bit; |
| 133 | 133 | } w; |
| 134 | 134 | } ti99_4p_peb_card_handlers_t; |
| r3679 | r3680 | |
| 335 | 335 | port = (offset & 0x00f0) >> 4; |
| 336 | 336 | handler = expansion_ports[port].cru_read; |
| 337 | 337 | |
| 338 | | reply = (handler) ? (*handler)(machine, offset & 0xf) : 0; |
| 338 | reply = (handler) ? (*handler)(space->machine, offset & 0xf) : 0; |
| 339 | 339 | |
| 340 | 340 | return reply; |
| 341 | 341 | } |
| r3679 | r3680 | |
| 352 | 352 | handler = expansion_ports[port].cru_write; |
| 353 | 353 | |
| 354 | 354 | if (handler) |
| 355 | | (*handler)(machine, offset & 0x7f, data); |
| 355 | (*handler)(space->machine, offset & 0x7f, data); |
| 356 | 356 | |
| 357 | 357 | /* expansion card enable? */ |
| 358 | 358 | if ((offset & 0x7f) == 0) |
| r3679 | r3680 | |
| 378 | 378 | READ16_HANDLER ( ti99_4x_peb_r ) |
| 379 | 379 | { |
| 380 | 380 | int reply = 0; |
| 381 | | read8_machine_func handler; |
| 381 | read8_space_func handler; |
| 382 | 382 | |
| 383 | | activecpu_adjust_icount(-4); |
| 383 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 384 | 384 | |
| 385 | 385 | if (active_card != -1) |
| 386 | 386 | { |
| 387 | 387 | handler = expansion_ports[active_card].mem_read; |
| 388 | 388 | if (handler) |
| 389 | 389 | { |
| 390 | | reply = (*handler)(machine, (offset << 1) + 1); |
| 391 | | reply |= ((unsigned) (*handler)(machine, offset << 1)) << 8; |
| 390 | reply = (*handler)(space, (offset << 1) + 1); |
| 391 | reply |= ((unsigned) (*handler)(space, offset << 1)) << 8; |
| 392 | 392 | } |
| 393 | 393 | } |
| 394 | 394 | |
| r3679 | r3680 | |
| 400 | 400 | */ |
| 401 | 401 | WRITE16_HANDLER ( ti99_4x_peb_w ) |
| 402 | 402 | { |
| 403 | | write8_machine_func handler; |
| 403 | write8_space_func handler; |
| 404 | 404 | |
| 405 | | activecpu_adjust_icount(-4); |
| 405 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 406 | 406 | |
| 407 | 407 | /* simulate byte write */ |
| 408 | 408 | data = (tmp_buffer & ~mem_mask) | (data & mem_mask); |
| r3679 | r3680 | |
| 412 | 412 | handler = expansion_ports[active_card].mem_write; |
| 413 | 413 | if (handler) |
| 414 | 414 | { |
| 415 | | (*handler)(machine, (offset << 1) + 1, data & 0xff); |
| 416 | | (*handler)(machine, offset << 1, (data >> 8) & 0xff); |
| 415 | (*handler)(space, (offset << 1) + 1, data & 0xff); |
| 416 | (*handler)(space, offset << 1, (data >> 8) & 0xff); |
| 417 | 417 | } |
| 418 | 418 | } |
| 419 | 419 | } |
| r3679 | r3680 | |
| 431 | 431 | port = (offset & 0x00f0) >> 4; |
| 432 | 432 | handler = expansion_ports[port].cru_read; |
| 433 | 433 | |
| 434 | | reply = (handler) ? (*handler)(machine, offset & 0xf) : 0; |
| 434 | reply = (handler) ? (*handler)(space->machine, offset & 0xf) : 0; |
| 435 | 435 | |
| 436 | 436 | return reply; |
| 437 | 437 | } |
| r3679 | r3680 | |
| 448 | 448 | handler = expansion_ports[port].cru_write; |
| 449 | 449 | |
| 450 | 450 | if (handler) |
| 451 | | (*handler)(machine, offset & 0x7f, data); |
| 451 | (*handler)(space->machine, offset & 0x7f, data); |
| 452 | 452 | |
| 453 | 453 | /* expansion card enable? */ |
| 454 | 454 | if ((offset & 0x7f) == 0) |
| r3679 | r3680 | |
| 474 | 474 | READ8_HANDLER ( geneve_peb_r ) |
| 475 | 475 | { |
| 476 | 476 | int reply = 0; |
| 477 | | read8_machine_func handler; |
| 477 | read8_space_func handler; |
| 478 | 478 | |
| 479 | | activecpu_adjust_icount(-8); |
| 479 | cpu_adjust_icount(space->machine->cpu[0],-8); |
| 480 | 480 | |
| 481 | 481 | if (active_card != -1) |
| 482 | 482 | { |
| 483 | 483 | handler = expansion_ports[active_card].mem_read; |
| 484 | 484 | if (handler) |
| 485 | | reply = (*handler)(machine, offset); |
| 485 | reply = (*handler)(space, offset); |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | return reply; |
| r3679 | r3680 | |
| 493 | 493 | */ |
| 494 | 494 | WRITE8_HANDLER ( geneve_peb_w ) |
| 495 | 495 | { |
| 496 | | write8_machine_func handler; |
| 496 | write8_space_func handler; |
| 497 | 497 | |
| 498 | | activecpu_adjust_icount(-8); |
| 498 | cpu_adjust_icount(space->machine->cpu[0],-8); |
| 499 | 499 | |
| 500 | 500 | if (active_card != -1) |
| 501 | 501 | { |
| 502 | 502 | handler = expansion_ports[active_card].mem_write; |
| 503 | 503 | if (handler) |
| 504 | | (*handler)(machine, offset, data); |
| 504 | (*handler)(space, offset, data); |
| 505 | 505 | } |
| 506 | 506 | } |
| 507 | 507 | |
| r3679 | r3680 | |
| 517 | 517 | port = (offset & 0x01f0) >> 4; |
| 518 | 518 | handler = expansion_ports[port].cru_read; |
| 519 | 519 | |
| 520 | | reply = (handler) ? (*handler)(machine, offset & 0xf) : 0; |
| 520 | reply = (handler) ? (*handler)(space->machine, offset & 0xf) : 0; |
| 521 | 521 | |
| 522 | 522 | return reply; |
| 523 | 523 | } |
| r3679 | r3680 | |
| 534 | 534 | handler = expansion_ports[port].cru_write; |
| 535 | 535 | |
| 536 | 536 | if (handler) |
| 537 | | (*handler)(machine, offset & 0x7f, data); |
| 537 | (*handler)(space->machine, offset & 0x7f, data); |
| 538 | 538 | |
| 539 | 539 | /* expansion card enable? */ |
| 540 | 540 | if ((offset & 0x7f) == 0) |
| r3679 | r3680 | |
| 560 | 560 | READ8_HANDLER ( ti99_8_peb_r ) |
| 561 | 561 | { |
| 562 | 562 | int reply = 0; |
| 563 | | read8_machine_func handler; |
| 563 | read8_space_func handler; |
| 564 | 564 | |
| 565 | | activecpu_adjust_icount(-4); |
| 565 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 566 | 566 | |
| 567 | 567 | if (active_card != -1) |
| 568 | 568 | { |
| 569 | 569 | handler = expansion_ports[active_card].mem_read; |
| 570 | 570 | if (handler) |
| 571 | | reply = (*handler)(machine, offset); |
| 571 | reply = (*handler)(space, offset); |
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | return reply; |
| r3679 | r3680 | |
| 579 | 579 | */ |
| 580 | 580 | WRITE8_HANDLER ( ti99_8_peb_w ) |
| 581 | 581 | { |
| 582 | | write8_machine_func handler; |
| 582 | write8_space_func handler; |
| 583 | 583 | |
| 584 | | activecpu_adjust_icount(-4); |
| 584 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 585 | 585 | |
| 586 | 586 | if (active_card != -1) |
| 587 | 587 | { |
| 588 | 588 | handler = expansion_ports[active_card].mem_write; |
| 589 | 589 | if (handler) |
| 590 | | (*handler)(machine, offset, data); |
| 590 | (*handler)(space, offset, data); |
| 591 | 591 | } |
| 592 | 592 | } |
| 593 | 593 | |
| r3679 | r3680 | |
| 603 | 603 | port = offset >> 4; |
| 604 | 604 | handler = ti99_4p_expansion_ports[port].cru_read; |
| 605 | 605 | |
| 606 | | reply = (handler) ? (*handler)(machine, offset & 0xf) : 0; |
| 606 | reply = (handler) ? (*handler)(space->machine, offset & 0xf) : 0; |
| 607 | 607 | |
| 608 | 608 | return reply; |
| 609 | 609 | } |
| r3679 | r3680 | |
| 620 | 620 | handler = ti99_4p_expansion_ports[port].cru_write; |
| 621 | 621 | |
| 622 | 622 | if (handler) |
| 623 | | (*handler)(machine, offset & 0x7f, data); |
| 623 | (*handler)(space->machine, offset & 0x7f, data); |
| 624 | 624 | |
| 625 | 625 | /* expansion card enable? */ |
| 626 | 626 | if ((offset & 0x7f) == 0) |
| r3679 | r3680 | |
| 664 | 664 | READ16_HANDLER ( ti99_4p_peb_r ) |
| 665 | 665 | { |
| 666 | 666 | int reply = 0; |
| 667 | | read8_machine_func handler; |
| 668 | | read16_machine_func handler16; |
| 667 | read8_space_func handler; |
| 668 | read16_space_func handler16; |
| 669 | 669 | |
| 670 | 670 | |
| 671 | 671 | if (active_card == -1) |
| 672 | | activecpu_adjust_icount(-4); /* ??? */ |
| 672 | cpu_adjust_icount(space->machine->cpu[0],-4); /* ??? */ |
| 673 | 673 | else |
| 674 | 674 | { |
| 675 | 675 | |
| 676 | 676 | if (ti99_4p_expansion_ports[active_card].width == width_8bit) |
| 677 | 677 | { |
| 678 | | activecpu_adjust_icount(-4); |
| 678 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 679 | 679 | |
| 680 | 680 | handler = ti99_4p_expansion_ports[active_card].w.width_8bit.mem_read; |
| 681 | 681 | if (handler) |
| 682 | 682 | { |
| 683 | | reply = (*handler)(machine, (offset << 1) + 1); |
| 684 | | reply |= ((unsigned) (*handler)(machine, offset << 1)) << 8; |
| 683 | reply = (*handler)(space, (offset << 1) + 1); |
| 684 | reply |= ((unsigned) (*handler)(space, offset << 1)) << 8; |
| 685 | 685 | } |
| 686 | 686 | } |
| 687 | 687 | else |
| 688 | 688 | { |
| 689 | | activecpu_adjust_icount(-1); /* ??? */ |
| 689 | cpu_adjust_icount(space->machine->cpu[0],-1); /* ??? */ |
| 690 | 690 | |
| 691 | 691 | handler16 = ti99_4p_expansion_ports[active_card].w.width_16bit.mem_read; |
| 692 | 692 | if (handler16) |
| 693 | | reply = (*handler16)(machine, offset, /*mem_mask*/0xffff); |
| 693 | reply = (*handler16)(space, offset, /*mem_mask*/0xffff); |
| 694 | 694 | } |
| 695 | 695 | } |
| 696 | 696 | |
| r3679 | r3680 | |
| 714 | 714 | */ |
| 715 | 715 | WRITE16_HANDLER ( ti99_4p_peb_w ) |
| 716 | 716 | { |
| 717 | | write8_machine_func handler; |
| 718 | | write16_machine_func handler16; |
| 717 | write8_space_func handler; |
| 718 | write16_space_func handler16; |
| 719 | 719 | |
| 720 | 720 | if (active_card == -1) |
| 721 | | activecpu_adjust_icount(-4); /* ??? */ |
| 721 | cpu_adjust_icount(space->machine->cpu[0],-4); /* ??? */ |
| 722 | 722 | else |
| 723 | 723 | { |
| 724 | 724 | /* simulate byte write */ |
| r3679 | r3680 | |
| 726 | 726 | |
| 727 | 727 | if (ti99_4p_expansion_ports[active_card].width == width_8bit) |
| 728 | 728 | { |
| 729 | | activecpu_adjust_icount(-4); |
| 729 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 730 | 730 | |
| 731 | 731 | handler = ti99_4p_expansion_ports[active_card].w.width_8bit.mem_write; |
| 732 | 732 | if (handler) |
| 733 | 733 | { |
| 734 | | (*handler)(machine, (offset << 1) + 1, data & 0xff); |
| 735 | | (*handler)(machine, offset << 1, (data >> 8) & 0xff); |
| 734 | (*handler)(space, (offset << 1) + 1, data & 0xff); |
| 735 | (*handler)(space, offset << 1, (data >> 8) & 0xff); |
| 736 | 736 | } |
| 737 | 737 | } |
| 738 | 738 | else |
| 739 | 739 | { |
| 740 | | activecpu_adjust_icount(-1); /* ??? */ |
| 740 | cpu_adjust_icount(space->machine->cpu[0],-1); /* ??? */ |
| 741 | 741 | |
| 742 | 742 | handler16 = ti99_4p_expansion_ports[active_card].w.width_16bit.mem_write; |
| 743 | 743 | if (handler16) |
| 744 | | (*handler16)(machine, offset, data, /*mem_mask*/0xffff); |
| 744 | (*handler16)(space, offset, data, /*mem_mask*/0xffff); |
| 745 | 745 | } |
| 746 | 746 | } |
| 747 | 747 | } |
src/mess/machine/ti99_4x.c
| r3679 | r3680 | |
| 385 | 385 | |
| 386 | 386 | /* tms9900_ICount: used to implement memory waitstates (hack) */ |
| 387 | 387 | /* tms9995_ICount: used to implement memory waitstates (hack) */ |
| 388 | | /* NPW 23-Feb-2004 - externs no longer needed because we now use activecpu_adjust_icount() */ |
| 388 | /* NPW 23-Feb-2004 - externs no longer needed because we now use cpu_adjust_icount(space->machine->cpu[0],) */ |
| 389 | 389 | |
| 390 | 390 | |
| 391 | 391 | |
| r3679 | r3680 | |
| 775 | 775 | */ |
| 776 | 776 | MACHINE_RESET( ti99 ) |
| 777 | 777 | { |
| 778 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 778 | 779 | /*console_GROMs.data_ptr = memory_region(machine, region_grom);*/ |
| 779 | 780 | console_GROMs.addr = 0; |
| 780 | 781 | |
| r3679 | r3680 | |
| 858 | 859 | |
| 859 | 860 | if (ti99_model != model_99_8) |
| 860 | 861 | { |
| 861 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x93ff, 0, 0, ti99_rspeech_r); |
| 862 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9400, 0x97ff, 0, 0, ti99_wspeech_w); |
| 862 | memory_install_read16_handler(space, 0x9000, 0x93ff, 0, 0, ti99_rspeech_r); |
| 863 | memory_install_write16_handler(space, 0x9400, 0x97ff, 0, 0, ti99_wspeech_w); |
| 863 | 864 | |
| 864 | 865 | sndti_set_info_int(SOUND_TMS5220, 0, SNDINFO_INT_TMS5220_VARIANT, variant_tmc0285); |
| 865 | 866 | } |
| r3679 | r3680 | |
| 868 | 869 | { |
| 869 | 870 | if (ti99_model != model_99_8) |
| 870 | 871 | { |
| 871 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x93ff, 0, 0, ti99_nop_8_r); |
| 872 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9400, 0x97ff, 0, 0, ti99_nop_8_w); |
| 872 | memory_install_read16_handler(space, 0x9000, 0x93ff, 0, 0, ti99_nop_8_r); |
| 873 | memory_install_write16_handler(space, 0x9400, 0x97ff, 0, 0, ti99_nop_8_w); |
| 873 | 874 | } |
| 874 | 875 | } |
| 875 | 876 | |
| r3679 | r3680 | |
| 877 | 878 | { |
| 878 | 879 | case xRAM_kind_none: |
| 879 | 880 | default: |
| 880 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_nop_8_r); |
| 881 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_nop_8_w); |
| 882 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_nop_8_r); |
| 883 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_nop_8_w); |
| 881 | memory_install_read16_handler(space, 0x2000, 0x3fff, 0, 0, ti99_nop_8_r); |
| 882 | memory_install_write16_handler(space, 0x2000, 0x3fff, 0, 0, ti99_nop_8_w); |
| 883 | memory_install_read16_handler(space, 0xa000, 0xffff, 0, 0, ti99_nop_8_r); |
| 884 | memory_install_write16_handler(space, 0xa000, 0xffff, 0, 0, ti99_nop_8_w); |
| 884 | 885 | break; |
| 885 | 886 | case xRAM_kind_TI: |
| 886 | 887 | ti99_TIxram_init(machine); |
| r3679 | r3680 | |
| 981 | 982 | */ |
| 982 | 983 | INTERRUPT_GEN( ti99_vblank_interrupt ) |
| 983 | 984 | { |
| 984 | | TMS9928A_interrupt(machine); |
| 985 | TMS9928A_interrupt(device->machine); |
| 985 | 986 | if (has_handset) |
| 986 | | ti99_handset_task(machine); |
| 987 | | has_mecmouse = (input_port_read(machine, "CFG") >> config_mecmouse_bit) & config_mecmouse_mask; |
| 987 | ti99_handset_task(device->machine); |
| 988 | has_mecmouse = (input_port_read(device->machine, "CFG") >> config_mecmouse_bit) & config_mecmouse_mask; |
| 988 | 989 | if (has_mecmouse) |
| 989 | | mecmouse_poll(machine); |
| 990 | mecmouse_poll(device->machine); |
| 990 | 991 | } |
| 991 | 992 | |
| 992 | 993 | INTERRUPT_GEN( ti99_4ev_hblank_interrupt ) |
| r3679 | r3680 | |
| 996 | 997 | if (++line_count == 262) |
| 997 | 998 | { |
| 998 | 999 | line_count = 0; |
| 999 | | has_mecmouse = (input_port_read(machine, "CFG") >> config_mecmouse_bit) & config_mecmouse_mask; |
| 1000 | has_mecmouse = (input_port_read(device->machine, "CFG") >> config_mecmouse_bit) & config_mecmouse_mask; |
| 1000 | 1001 | if (has_mecmouse) |
| 1001 | | mecmouse_poll(machine); |
| 1002 | mecmouse_poll(device->machine); |
| 1002 | 1003 | } |
| 1003 | 1004 | } |
| 1004 | 1005 | |
| r3679 | r3680 | |
| 1029 | 1030 | */ |
| 1030 | 1031 | READ16_HANDLER ( ti99_nop_8_r ) |
| 1031 | 1032 | { |
| 1032 | | activecpu_adjust_icount(-4); |
| 1033 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 1033 | 1034 | |
| 1034 | 1035 | return (0); |
| 1035 | 1036 | } |
| 1036 | 1037 | |
| 1037 | 1038 | WRITE16_HANDLER ( ti99_nop_8_w ) |
| 1038 | 1039 | { |
| 1039 | | activecpu_adjust_icount(-4); |
| 1040 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 1040 | 1041 | } |
| 1041 | 1042 | |
| 1042 | 1043 | /* |
| r3679 | r3680 | |
| 1054 | 1055 | */ |
| 1055 | 1056 | READ16_HANDLER ( ti99_cart_r ) |
| 1056 | 1057 | { |
| 1057 | | activecpu_adjust_icount(-4); |
| 1058 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 1058 | 1059 | |
| 1059 | 1060 | if (hsgpl_crdena) |
| 1060 | 1061 | /* hsgpl is enabled */ |
| 1061 | | return ti99_hsgpl_rom6_r(machine, offset, mem_mask); |
| 1062 | return ti99_hsgpl_rom6_r(space, offset, mem_mask); |
| 1062 | 1063 | |
| 1063 | 1064 | if (cartridge_mbx && (offset >= 0x0600) && (offset <= 0x07fe)) |
| 1064 | 1065 | return (cartridge_pages[0])[offset]; |
| r3679 | r3680 | |
| 1068 | 1069 | |
| 1069 | 1070 | WRITE16_HANDLER ( ti99_cart_w ) |
| 1070 | 1071 | { |
| 1071 | | activecpu_adjust_icount(-4); |
| 1072 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 1072 | 1073 | |
| 1073 | 1074 | if (hsgpl_crdena) |
| 1074 | 1075 | /* hsgpl is enabled */ |
| 1075 | | ti99_hsgpl_rom6_w(machine, offset, data, mem_mask); |
| 1076 | ti99_hsgpl_rom6_w(space, offset, data, mem_mask); |
| 1076 | 1077 | else if (cartridge_minimemory && offset >= 0x800) |
| 1077 | 1078 | /* handle minimem RAM */ |
| 1078 | 1079 | COMBINE_DATA(current_page_ptr+offset); |
| r3679 | r3680 | |
| 1098 | 1099 | if (ti99_4p_internal_rom6_enable) |
| 1099 | 1100 | return ti99_4p_internal_ROM6[offset]; |
| 1100 | 1101 | |
| 1101 | | activecpu_adjust_icount(-4); |
| 1102 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 1102 | 1103 | |
| 1103 | 1104 | if (hsgpl_crdena) |
| 1104 | 1105 | /* hsgpl is enabled */ |
| 1105 | | return ti99_hsgpl_rom6_r(machine, offset, mem_mask); |
| 1106 | return ti99_hsgpl_rom6_r(space, offset, mem_mask); |
| 1106 | 1107 | |
| 1107 | 1108 | return 0; |
| 1108 | 1109 | } |
| r3679 | r3680 | |
| 1111 | 1112 | { |
| 1112 | 1113 | if (ti99_4p_internal_rom6_enable) |
| 1113 | 1114 | { |
| 1114 | | ti99_4p_internal_ROM6 = (UINT16 *) (memory_region(machine, "main") + (FPTR)((offset & 1) ? offset_rom6b_4p : offset_rom6_4p)); |
| 1115 | ti99_4p_internal_ROM6 = (UINT16 *) (memory_region(space->machine, "main") + (FPTR)((offset & 1) ? offset_rom6b_4p : offset_rom6_4p)); |
| 1115 | 1116 | return; |
| 1116 | 1117 | } |
| 1117 | 1118 | |
| 1118 | | activecpu_adjust_icount(-4); |
| 1119 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 1119 | 1120 | |
| 1120 | 1121 | if (hsgpl_crdena) |
| 1121 | 1122 | /* hsgpl is enabled */ |
| 1122 | | ti99_hsgpl_rom6_w(machine, offset, data, mem_mask); |
| 1123 | ti99_hsgpl_rom6_w(space, offset, data, mem_mask); |
| 1123 | 1124 | } |
| 1124 | 1125 | |
| 1125 | 1126 | /*---------------------------------------------------------------------------*/ |
| r3679 | r3680 | |
| 1157 | 1158 | */ |
| 1158 | 1159 | WRITE16_HANDLER ( ti99_wsnd_w ) |
| 1159 | 1160 | { |
| 1160 | | activecpu_adjust_icount(-4); |
| 1161 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 1161 | 1162 | |
| 1162 | | sn76496_0_w(machine, offset, (data >> 8) & 0xff); |
| 1163 | sn76496_0_w(space, offset, (data >> 8) & 0xff); |
| 1163 | 1164 | } |
| 1164 | 1165 | |
| 1165 | 1166 | /* |
| r3679 | r3680 | |
| 1167 | 1168 | */ |
| 1168 | 1169 | READ16_HANDLER ( ti99_rvdp_r ) |
| 1169 | 1170 | { |
| 1170 | | activecpu_adjust_icount(-4); |
| 1171 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 1171 | 1172 | |
| 1172 | 1173 | if (offset & 1) |
| 1173 | 1174 | { /* read VDP status */ |
| 1174 | | return ((int) TMS9928A_register_r(machine, 0)) << 8; |
| 1175 | return ((int) TMS9928A_register_r(space, 0)) << 8; |
| 1175 | 1176 | } |
| 1176 | 1177 | else |
| 1177 | 1178 | { /* read VDP RAM */ |
| 1178 | | return ((int) TMS9928A_vram_r(machine, 0)) << 8; |
| 1179 | return ((int) TMS9928A_vram_r(space, 0)) << 8; |
| 1179 | 1180 | } |
| 1180 | 1181 | } |
| 1181 | 1182 | |
| r3679 | r3680 | |
| 1184 | 1185 | */ |
| 1185 | 1186 | WRITE16_HANDLER ( ti99_wvdp_w ) |
| 1186 | 1187 | { |
| 1187 | | activecpu_adjust_icount(-4); |
| 1188 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 1188 | 1189 | |
| 1189 | 1190 | if (offset & 1) |
| 1190 | 1191 | { /* write VDP address */ |
| 1191 | | TMS9928A_register_w(machine, 0, (data >> 8) & 0xff); |
| 1192 | TMS9928A_register_w(space, 0, (data >> 8) & 0xff); |
| 1192 | 1193 | } |
| 1193 | 1194 | else |
| 1194 | 1195 | { /* write VDP data */ |
| 1195 | | TMS9928A_vram_w(machine, 0, (data >> 8) & 0xff); |
| 1196 | TMS9928A_vram_w(space, 0, (data >> 8) & 0xff); |
| 1196 | 1197 | } |
| 1197 | 1198 | } |
| 1198 | 1199 | |
| r3679 | r3680 | |
| 1201 | 1202 | */ |
| 1202 | 1203 | READ16_HANDLER ( ti99_rv38_r ) |
| 1203 | 1204 | { |
| 1204 | | activecpu_adjust_icount(-4); |
| 1205 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 1205 | 1206 | |
| 1206 | 1207 | if (offset & 1) |
| 1207 | 1208 | { /* read VDP status */ |
| 1208 | | return ((int) v9938_0_status_r(machine, 0)) << 8; |
| 1209 | return ((int) v9938_0_status_r(space, 0)) << 8; |
| 1209 | 1210 | } |
| 1210 | 1211 | else |
| 1211 | 1212 | { /* read VDP RAM */ |
| 1212 | | return ((int) v9938_0_vram_r(machine, 0)) << 8; |
| 1213 | return ((int) v9938_0_vram_r(space, 0)) << 8; |
| 1213 | 1214 | } |
| 1214 | 1215 | } |
| 1215 | 1216 | |
| r3679 | r3680 | |
| 1218 | 1219 | */ |
| 1219 | 1220 | WRITE16_HANDLER ( ti99_wv38_w ) |
| 1220 | 1221 | { |
| 1221 | | activecpu_adjust_icount(-4); |
| 1222 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 1222 | 1223 | |
| 1223 | 1224 | switch (offset & 3) |
| 1224 | 1225 | { |
| 1225 | 1226 | case 0: |
| 1226 | 1227 | /* write VDP data */ |
| 1227 | | v9938_0_vram_w(machine, 0, (data >> 8) & 0xff); |
| 1228 | v9938_0_vram_w(space, 0, (data >> 8) & 0xff); |
| 1228 | 1229 | break; |
| 1229 | 1230 | case 1: |
| 1230 | 1231 | /* write VDP address */ |
| 1231 | | v9938_0_command_w(machine, 0, (data >> 8) & 0xff); |
| 1232 | v9938_0_command_w(space, 0, (data >> 8) & 0xff); |
| 1232 | 1233 | break; |
| 1233 | 1234 | case 2: |
| 1234 | 1235 | /* write VDP palette */ |
| 1235 | | v9938_0_palette_w(machine, 0, (data >> 8) & 0xff); |
| 1236 | v9938_0_palette_w(space, 0, (data >> 8) & 0xff); |
| 1236 | 1237 | break; |
| 1237 | 1238 | case 3: |
| 1238 | 1239 | /* write VDP register */ |
| 1239 | | v9938_0_register_w(machine, 0, (data >> 8) & 0xff); |
| 1240 | v9938_0_register_w(space, 0, (data >> 8) & 0xff); |
| 1240 | 1241 | break; |
| 1241 | 1242 | } |
| 1242 | 1243 | } |
| r3679 | r3680 | |
| 1246 | 1247 | */ |
| 1247 | 1248 | static READ16_HANDLER ( ti99_rspeech_r ) |
| 1248 | 1249 | { |
| 1249 | | activecpu_adjust_icount(-(18+3)); /* this is just a minimum, it can be more */ |
| 1250 | cpu_adjust_icount(space->machine->cpu[0],-(18+3)); /* this is just a minimum, it can be more */ |
| 1250 | 1251 | |
| 1251 | | return ((int) tms5220_status_r(machine, offset)) << 8; |
| 1252 | return ((int) tms5220_status_r(space, offset)) << 8; |
| 1252 | 1253 | } |
| 1253 | 1254 | |
| 1254 | 1255 | #if 0 |
| r3679 | r3680 | |
| 1272 | 1273 | */ |
| 1273 | 1274 | static WRITE16_HANDLER ( ti99_wspeech_w ) |
| 1274 | 1275 | { |
| 1275 | | activecpu_adjust_icount(-(54+3)); /* this is just an approx. minimum, it can be much more */ |
| 1276 | cpu_adjust_icount(space->machine->cpu[0],-(54+3)); /* this is just an approx. minimum, it can be much more */ |
| 1276 | 1277 | |
| 1277 | 1278 | #if 1 |
| 1278 | 1279 | /* the stupid design of the tms5220 core means that ready is cleared when |
| r3679 | r3680 | |
| 1286 | 1287 | |
| 1287 | 1288 | logerror("time to ready: %f -> %d\n", attotime_to_double(time_to_ready), (int) cycles_to_ready); |
| 1288 | 1289 | |
| 1289 | | activecpu_adjust_icount(-cycles_to_ready); |
| 1290 | cpu_adjust_icount(space->machine->cpu[0],-cycles_to_ready); |
| 1290 | 1291 | timer_set(attotime_zero, NULL, 0, /*speech_kludge_callback*/NULL); |
| 1291 | 1292 | } |
| 1292 | 1293 | #endif |
| 1293 | 1294 | |
| 1294 | | tms5220_data_w(machine, offset, (data >> 8) & 0xff); |
| 1295 | tms5220_data_w(space, offset, (data >> 8) & 0xff); |
| 1295 | 1296 | } |
| 1296 | 1297 | |
| 1297 | 1298 | /* |
| r3679 | r3680 | |
| 1302 | 1303 | int reply; |
| 1303 | 1304 | |
| 1304 | 1305 | |
| 1305 | | activecpu_adjust_icount(-4 /*20+3*/); /* from 4 to 23? */ |
| 1306 | cpu_adjust_icount(space->machine->cpu[0],-4 /*20+3*/); /* from 4 to 23? */ |
| 1306 | 1307 | |
| 1307 | 1308 | if (offset & 1) |
| 1308 | 1309 | { /* read GPL address */ |
| r3679 | r3680 | |
| 1333 | 1334 | |
| 1334 | 1335 | if (hsgpl_crdena) |
| 1335 | 1336 | /* hsgpl buffers are stronger than console GROM buffers */ |
| 1336 | | reply = ti99_hsgpl_gpl_r(machine, offset, mem_mask); |
| 1337 | reply = ti99_hsgpl_gpl_r(space, offset, mem_mask); |
| 1337 | 1338 | |
| 1338 | 1339 | return reply; |
| 1339 | 1340 | } |
| r3679 | r3680 | |
| 1343 | 1344 | */ |
| 1344 | 1345 | WRITE16_HANDLER ( ti99_wgpl_w ) |
| 1345 | 1346 | { |
| 1346 | | activecpu_adjust_icount(-4/*20+3*/); /* from 4 to 23? */ |
| 1347 | cpu_adjust_icount(space->machine->cpu[0],-4/*20+3*/); /* from 4 to 23? */ |
| 1347 | 1348 | |
| 1348 | 1349 | if (offset & 1) |
| 1349 | 1350 | { /* write GPL address */ |
| r3679 | r3680 | |
| 1381 | 1382 | } |
| 1382 | 1383 | |
| 1383 | 1384 | if (hsgpl_crdena) |
| 1384 | | ti99_hsgpl_gpl_w(machine, offset, data, mem_mask); |
| 1385 | ti99_hsgpl_gpl_w(space, offset, data, mem_mask); |
| 1385 | 1386 | } |
| 1386 | 1387 | |
| 1387 | 1388 | /* |
| r3679 | r3680 | |
| 1389 | 1390 | */ |
| 1390 | 1391 | READ16_HANDLER ( ti99_4p_rgpl_r ) |
| 1391 | 1392 | { |
| 1392 | | activecpu_adjust_icount(-4); /* HSGPL is located on 8-bit bus? */ |
| 1393 | cpu_adjust_icount(space->machine->cpu[0],-4); /* HSGPL is located on 8-bit bus? */ |
| 1393 | 1394 | |
| 1394 | | return /*hsgpl_crdena ?*/ ti99_hsgpl_gpl_r(machine, offset, mem_mask) /*: 0*/; |
| 1395 | return /*hsgpl_crdena ?*/ ti99_hsgpl_gpl_r(space, offset, mem_mask) /*: 0*/; |
| 1395 | 1396 | } |
| 1396 | 1397 | |
| 1397 | 1398 | /* |
| r3679 | r3680 | |
| 1399 | 1400 | */ |
| 1400 | 1401 | WRITE16_HANDLER ( ti99_4p_wgpl_w ) |
| 1401 | 1402 | { |
| 1402 | | activecpu_adjust_icount(-4); /* HSGPL is located on 8-bit bus? */ |
| 1403 | cpu_adjust_icount(space->machine->cpu[0],-4); /* HSGPL is located on 8-bit bus? */ |
| 1403 | 1404 | |
| 1404 | 1405 | /*if (hsgpl_crdena)*/ |
| 1405 | | ti99_hsgpl_gpl_w(machine, offset, data, mem_mask); |
| 1406 | ti99_hsgpl_gpl_w(space, offset, data, mem_mask); |
| 1406 | 1407 | } |
| 1407 | 1408 | |
| 1408 | 1409 | |
| r3679 | r3680 | |
| 1452 | 1453 | { |
| 1453 | 1454 | if (offset & 2) |
| 1454 | 1455 | /* read VDP status */ |
| 1455 | | reply = TMS9928A_register_r(machine, 0); |
| 1456 | reply = TMS9928A_register_r(space, 0); |
| 1456 | 1457 | else |
| 1457 | 1458 | /* read VDP RAM */ |
| 1458 | | reply = TMS9928A_vram_r(machine, 0); |
| 1459 | reply = TMS9928A_vram_r(space, 0); |
| 1459 | 1460 | } |
| 1460 | 1461 | } |
| 1461 | 1462 | else |
| r3679 | r3680 | |
| 1470 | 1471 | /* speech read */ |
| 1471 | 1472 | if (! (offset & 1)) |
| 1472 | 1473 | { |
| 1473 | | activecpu_adjust_icount(-16*4); /* this is just a minimum, it can be more */ |
| 1474 | | reply = tms5220_status_r(machine, 0); |
| 1474 | cpu_adjust_icount(space->machine->cpu[0],-16*4); /* this is just a minimum, it can be more */ |
| 1475 | reply = tms5220_status_r(space, 0); |
| 1475 | 1476 | } |
| 1476 | 1477 | break; |
| 1477 | 1478 | |
| 1478 | 1479 | case 6: |
| 1479 | 1480 | /* GPL read */ |
| 1480 | 1481 | if (! (offset & 1)) |
| 1481 | | reply = ti99_rgpl_r(machine, offset >> 1, 0) >> 8; |
| 1482 | reply = ti99_rgpl_r(space, offset >> 1, 0) >> 8; |
| 1482 | 1483 | break; |
| 1483 | 1484 | |
| 1484 | 1485 | default: |
| r3679 | r3680 | |
| 1523 | 1524 | |
| 1524 | 1525 | case 2: |
| 1525 | 1526 | /* DSR space */ |
| 1526 | | reply = ti99_8_peb_r(machine, offset & 0x1fff); |
| 1527 | reply = ti99_8_peb_r(space, offset & 0x1fff); |
| 1527 | 1528 | break; |
| 1528 | 1529 | |
| 1529 | 1530 | case 3: |
| r3679 | r3680 | |
| 1582 | 1583 | case 1: |
| 1583 | 1584 | /* sound write + RAM */ |
| 1584 | 1585 | if (offset < 0x8410) |
| 1585 | | sn76496_0_w(machine, offset, data); |
| 1586 | sn76496_0_w(space, offset, data); |
| 1586 | 1587 | else |
| 1587 | 1588 | sRAM_ptr_8[offset & 0x1fff] = data; |
| 1588 | 1589 | break; |
| r3679 | r3680 | |
| 1623 | 1624 | { |
| 1624 | 1625 | if (offset & 2) |
| 1625 | 1626 | /* read VDP status */ |
| 1626 | | TMS9928A_register_w(machine, 0, data); |
| 1627 | TMS9928A_register_w(space, 0, data); |
| 1627 | 1628 | else |
| 1628 | 1629 | /* read VDP RAM */ |
| 1629 | | TMS9928A_vram_w(machine, 0, data); |
| 1630 | TMS9928A_vram_w(space, 0, data); |
| 1630 | 1631 | } |
| 1631 | 1632 | break; |
| 1632 | 1633 | |
| r3679 | r3680 | |
| 1634 | 1635 | /* speech write */ |
| 1635 | 1636 | if (! (offset & 1)) |
| 1636 | 1637 | { |
| 1637 | | activecpu_adjust_icount(-48*4); /* this is just an approx. minimum, it can be much more */ |
| 1638 | cpu_adjust_icount(space->machine->cpu[0],-48*4); /* this is just an approx. minimum, it can be much more */ |
| 1638 | 1639 | |
| 1639 | 1640 | /* the stupid design of the tms5220 core means that ready is cleared when |
| 1640 | 1641 | there are 15 bytes in FIFO. It should be 16. Of course, if it were the |
| r3679 | r3680 | |
| 1649 | 1650 | logerror("time to ready: %f -> %d\n", attotime_to_double(time_to_ready) |
| 1650 | 1651 | , (int) cycles_to_ready); |
| 1651 | 1652 | |
| 1652 | | activecpu_adjust_icount(-cycles_to_ready); |
| 1653 | cpu_adjust_icount(space->machine->cpu[0],-cycles_to_ready); |
| 1653 | 1654 | timer_set(attotime_zero, NULL, 0, /*speech_kludge_callback*/NULL); |
| 1654 | 1655 | } |
| 1655 | 1656 | |
| 1656 | | tms5220_data_w(machine, offset, data); |
| 1657 | tms5220_data_w(space, offset, data); |
| 1657 | 1658 | } |
| 1658 | 1659 | break; |
| 1659 | 1660 | |
| 1660 | 1661 | case 7: |
| 1661 | 1662 | /* GPL write */ |
| 1662 | 1663 | if (! (offset & 1)) |
| 1663 | | ti99_wgpl_w(machine, offset >> 1, data << 8, 0); |
| 1664 | ti99_wgpl_w(space, offset >> 1, data << 8, 0); |
| 1664 | 1665 | break; |
| 1665 | 1666 | |
| 1666 | 1667 | default: |
| r3679 | r3680 | |
| 1700 | 1701 | |
| 1701 | 1702 | case 2: |
| 1702 | 1703 | /* DSR space */ |
| 1703 | | ti99_8_peb_w(machine, offset & 0x1fff, data); |
| 1704 | ti99_8_peb_w(space, offset & 0x1fff, data); |
| 1704 | 1705 | break; |
| 1705 | 1706 | |
| 1706 | 1707 | case 3: |
| r3679 | r3680 | |
| 2692 | 2693 | |
| 2693 | 2694 | static void ti99_TIxram_init(running_machine *machine) |
| 2694 | 2695 | { |
| 2695 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_TIxramlow_r); |
| 2696 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_TIxramlow_w); |
| 2697 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_TIxramhigh_r); |
| 2698 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_TIxramhigh_w); |
| 2696 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 2697 | |
| 2698 | memory_install_read16_handler(space, 0x2000, 0x3fff, 0, 0, ti99_TIxramlow_r); |
| 2699 | memory_install_write16_handler(space, 0x2000, 0x3fff, 0, 0, ti99_TIxramlow_w); |
| 2700 | memory_install_read16_handler(space, 0xa000, 0xffff, 0, 0, ti99_TIxramhigh_r); |
| 2701 | memory_install_write16_handler(space, 0xa000, 0xffff, 0, 0, ti99_TIxramhigh_w); |
| 2699 | 2702 | } |
| 2700 | 2703 | |
| 2701 | 2704 | /* low 8 kb: 0x2000-0x3fff */ |
| 2702 | 2705 | static READ16_HANDLER ( ti99_TIxramlow_r ) |
| 2703 | 2706 | { |
| 2704 | | activecpu_adjust_icount(-4); |
| 2707 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 2705 | 2708 | |
| 2706 | 2709 | return xRAM_ptr[offset]; |
| 2707 | 2710 | } |
| 2708 | 2711 | |
| 2709 | 2712 | static WRITE16_HANDLER ( ti99_TIxramlow_w ) |
| 2710 | 2713 | { |
| 2711 | | activecpu_adjust_icount(-4); |
| 2714 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 2712 | 2715 | |
| 2713 | 2716 | COMBINE_DATA(xRAM_ptr + offset); |
| 2714 | 2717 | } |
| r3679 | r3680 | |
| 2716 | 2719 | /* high 24 kb: 0xa000-0xffff */ |
| 2717 | 2720 | static READ16_HANDLER ( ti99_TIxramhigh_r ) |
| 2718 | 2721 | { |
| 2719 | | activecpu_adjust_icount(-4); |
| 2722 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 2720 | 2723 | |
| 2721 | 2724 | return xRAM_ptr[offset+0x1000]; |
| 2722 | 2725 | } |
| 2723 | 2726 | |
| 2724 | 2727 | static WRITE16_HANDLER ( ti99_TIxramhigh_w ) |
| 2725 | 2728 | { |
| 2726 | | activecpu_adjust_icount(-4); |
| 2729 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 2727 | 2730 | |
| 2728 | 2731 | COMBINE_DATA(xRAM_ptr + offset+0x1000); |
| 2729 | 2732 | } |
| r3679 | r3680 | |
| 2766 | 2769 | { |
| 2767 | 2770 | int i; |
| 2768 | 2771 | |
| 2772 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 2773 | |
| 2774 | memory_install_read16_handler(space, 0x2000, 0x3fff, 0, 0, ti99_sAMSxramlow_r); |
| 2775 | memory_install_write16_handler(space, 0x2000, 0x3fff, 0, 0, ti99_sAMSxramlow_w); |
| 2776 | memory_install_read16_handler(space, 0xa000, 0xffff, 0, 0, ti99_sAMSxramhigh_r); |
| 2777 | memory_install_write16_handler(space, 0xa000, 0xffff, 0, 0, ti99_sAMSxramhigh_w); |
| 2769 | 2778 | |
| 2770 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_sAMSxramlow_r); |
| 2771 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_sAMSxramlow_w); |
| 2772 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_sAMSxramhigh_r); |
| 2773 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_sAMSxramhigh_w); |
| 2774 | | |
| 2775 | 2779 | ti99_peb_set_card_handlers(0x1e00, & sAMS_expansion_handlers); |
| 2776 | 2780 | |
| 2777 | 2781 | sAMS_mapper_on = 0; |
| r3679 | r3680 | |
| 2804 | 2808 | /* low 8 kb: 0x2000-0x3fff */ |
| 2805 | 2809 | static READ16_HANDLER ( ti99_sAMSxramlow_r ) |
| 2806 | 2810 | { |
| 2807 | | activecpu_adjust_icount(-4); |
| 2811 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 2808 | 2812 | |
| 2809 | 2813 | if (sAMS_mapper_on) |
| 2810 | 2814 | return xRAM_ptr[(offset&0x7ff)+sAMSlookup[(0x1000+offset)>>11]]; |
| r3679 | r3680 | |
| 2814 | 2818 | |
| 2815 | 2819 | static WRITE16_HANDLER ( ti99_sAMSxramlow_w ) |
| 2816 | 2820 | { |
| 2817 | | activecpu_adjust_icount(-4); |
| 2821 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 2818 | 2822 | |
| 2819 | 2823 | if (sAMS_mapper_on) |
| 2820 | 2824 | COMBINE_DATA(xRAM_ptr + (offset&0x7ff)+sAMSlookup[(0x1000+offset)>>11]); |
| r3679 | r3680 | |
| 2825 | 2829 | /* high 24 kb: 0xa000-0xffff */ |
| 2826 | 2830 | static READ16_HANDLER ( ti99_sAMSxramhigh_r ) |
| 2827 | 2831 | { |
| 2828 | | activecpu_adjust_icount(-4); |
| 2832 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 2829 | 2833 | |
| 2830 | 2834 | if (sAMS_mapper_on) |
| 2831 | 2835 | return xRAM_ptr[(offset&0x7ff)+sAMSlookup[(0x5000+offset)>>11]]; |
| r3679 | r3680 | |
| 2835 | 2839 | |
| 2836 | 2840 | static WRITE16_HANDLER ( ti99_sAMSxramhigh_w ) |
| 2837 | 2841 | { |
| 2838 | | activecpu_adjust_icount(-4); |
| 2842 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 2839 | 2843 | |
| 2840 | 2844 | if (sAMS_mapper_on) |
| 2841 | 2845 | COMBINE_DATA(xRAM_ptr + (offset&0x7ff)+sAMSlookup[(0x5000+offset)>>11]); |
| r3679 | r3680 | |
| 2877 | 2881 | int i; |
| 2878 | 2882 | |
| 2879 | 2883 | /* Not required at run-time */ |
| 2880 | | /*memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, SMH_BANK3); |
| 2881 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2fff, SMH_BANK3); |
| 2882 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, SMH_BANK4); |
| 2883 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3fff, SMH_BANK4); |
| 2884 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xafff, SMH_BANK5); |
| 2885 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xafff, SMH_BANK5); |
| 2886 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xbfff, SMH_BANK6); |
| 2887 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb000, 0xbfff, SMH_BANK6); |
| 2888 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, SMH_BANK7); |
| 2889 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, SMH_BANK7); |
| 2890 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, SMH_BANK8); |
| 2891 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd000, 0xdfff, SMH_BANK8); |
| 2892 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, SMH_BANK9); |
| 2893 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, SMH_BANK9); |
| 2894 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, SMH_BANK10); |
| 2895 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf000, 0xffff, SMH_BANK10);*/ |
| 2884 | /*memory_install_read16_handler(space, 0x2000, 0x2fff, SMH_BANK3); |
| 2885 | memory_install_write16_handler(space, 0x2000, 0x2fff, SMH_BANK3); |
| 2886 | memory_install_read16_handler(space, 0x3000, 0x3fff, SMH_BANK4); |
| 2887 | memory_install_write16_handler(space, 0x3000, 0x3fff, SMH_BANK4); |
| 2888 | memory_install_read16_handler(space, 0xa000, 0xafff, SMH_BANK5); |
| 2889 | memory_install_write16_handler(space, 0xa000, 0xafff, SMH_BANK5); |
| 2890 | memory_install_read16_handler(space, 0xb000, 0xbfff, SMH_BANK6); |
| 2891 | memory_install_write16_handler(space, 0xb000, 0xbfff, SMH_BANK6); |
| 2892 | memory_install_read16_handler(space, 0xc000, 0xcfff, SMH_BANK7); |
| 2893 | memory_install_write16_handler(space, 0xc000, 0xcfff, SMH_BANK7); |
| 2894 | memory_install_read16_handler(space, 0xd000, 0xdfff, SMH_BANK8); |
| 2895 | memory_install_write16_handler(space, 0xd000, 0xdfff, SMH_BANK8); |
| 2896 | memory_install_read16_handler(space, 0xe000, 0xefff, SMH_BANK9); |
| 2897 | memory_install_write16_handler(space, 0xe000, 0xefff, SMH_BANK9); |
| 2898 | memory_install_read16_handler(space, 0xf000, 0xffff, SMH_BANK10); |
| 2899 | memory_install_write16_handler(space, 0xf000, 0xffff, SMH_BANK10);*/ |
| 2896 | 2900 | |
| 2897 | 2901 | ti99_peb_set_16bit_card_handlers(0x1e00, & ti99_4p_mapper_handlers); |
| 2898 | 2902 | |
| r3679 | r3680 | |
| 2907 | 2911 | { |
| 2908 | 2912 | case 2: |
| 2909 | 2913 | case 3: |
| 2910 | | memory_set_bankptr(3+(i-2), xRAM_ptr + (i<<11)); |
| 2914 | memory_set_bankptr(machine,3+(i-2), xRAM_ptr + (i<<11)); |
| 2911 | 2915 | break; |
| 2912 | 2916 | |
| 2913 | 2917 | case 10: |
| r3679 | r3680 | |
| 2916 | 2920 | case 13: |
| 2917 | 2921 | case 14: |
| 2918 | 2922 | case 15: |
| 2919 | | memory_set_bankptr(5+(i-10), xRAM_ptr + (i<<11)); |
| 2923 | memory_set_bankptr(machine,5+(i-10), xRAM_ptr + (i<<11)); |
| 2920 | 2924 | break; |
| 2921 | 2925 | } |
| 2922 | 2926 | } |
| r3679 | r3680 | |
| 2942 | 2946 | { |
| 2943 | 2947 | case 2: |
| 2944 | 2948 | case 3: |
| 2945 | | memory_set_bankptr(3+(i-2), xRAM_ptr + (ti99_4p_mapper_on ? (ti99_4p_mapper_lookup[i]) : (i<<11))); |
| 2949 | memory_set_bankptr(machine,3+(i-2), xRAM_ptr + (ti99_4p_mapper_on ? (ti99_4p_mapper_lookup[i]) : (i<<11))); |
| 2946 | 2950 | break; |
| 2947 | 2951 | |
| 2948 | 2952 | case 10: |
| r3679 | r3680 | |
| 2951 | 2955 | case 13: |
| 2952 | 2956 | case 14: |
| 2953 | 2957 | case 15: |
| 2954 | | memory_set_bankptr(5+(i-10), xRAM_ptr + (ti99_4p_mapper_on ? (ti99_4p_mapper_lookup[i]) : (i<<11))); |
| 2958 | memory_set_bankptr(machine,5+(i-10), xRAM_ptr + (ti99_4p_mapper_on ? (ti99_4p_mapper_lookup[i]) : (i<<11))); |
| 2955 | 2959 | break; |
| 2956 | 2960 | } |
| 2957 | 2961 | } |
| r3679 | r3680 | |
| 2980 | 2984 | { |
| 2981 | 2985 | case 2: |
| 2982 | 2986 | case 3: |
| 2983 | | memory_set_bankptr(3+(page-2), xRAM_ptr+ti99_4p_mapper_lookup[page]); |
| 2987 | memory_set_bankptr(space->machine,3+(page-2), xRAM_ptr+ti99_4p_mapper_lookup[page]); |
| 2984 | 2988 | break; |
| 2985 | 2989 | |
| 2986 | 2990 | case 10: |
| r3679 | r3680 | |
| 2989 | 2993 | case 13: |
| 2990 | 2994 | case 14: |
| 2991 | 2995 | case 15: |
| 2992 | | memory_set_bankptr(5+(page-10), xRAM_ptr+ti99_4p_mapper_lookup[page]); |
| 2996 | memory_set_bankptr(space->machine,5+(page-10), xRAM_ptr+ti99_4p_mapper_lookup[page]); |
| 2993 | 2997 | break; |
| 2994 | 2998 | } |
| 2995 | 2999 | } |
| r3679 | r3680 | |
| 3028 | 3032 | /* set up myarc handlers, and set initial state */ |
| 3029 | 3033 | static void ti99_myarcxram_init(running_machine *machine) |
| 3030 | 3034 | { |
| 3031 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_myarcxramlow_r); |
| 3032 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, ti99_myarcxramlow_w); |
| 3033 | | memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_myarcxramhigh_r); |
| 3034 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xffff, 0, 0, ti99_myarcxramhigh_w); |
| 3035 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 3036 | |
| 3037 | memory_install_read16_handler(space, 0x2000, 0x3fff, 0, 0, ti99_myarcxramlow_r); |
| 3038 | memory_install_write16_handler(space, 0x2000, 0x3fff, 0, 0, ti99_myarcxramlow_w); |
| 3039 | memory_install_read16_handler(space, 0xa000, 0xffff, 0, 0, ti99_myarcxramhigh_r); |
| 3040 | memory_install_write16_handler(space, 0xa000, 0xffff, 0, 0, ti99_myarcxramhigh_w); |
| 3035 | 3041 | |
| 3036 | 3042 | switch (xRAM_kind) |
| 3037 | 3043 | { |
| r3679 | r3680 | |
| 3096 | 3102 | /* low 8 kb: 0x2000-0x3fff */ |
| 3097 | 3103 | static READ16_HANDLER ( ti99_myarcxramlow_r ) |
| 3098 | 3104 | { |
| 3099 | | activecpu_adjust_icount(-4); |
| 3105 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 3100 | 3106 | |
| 3101 | 3107 | return xRAM_ptr[myarc_cur_page_offset + offset]; |
| 3102 | 3108 | } |
| 3103 | 3109 | |
| 3104 | 3110 | static WRITE16_HANDLER ( ti99_myarcxramlow_w ) |
| 3105 | 3111 | { |
| 3106 | | activecpu_adjust_icount(-4); |
| 3112 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 3107 | 3113 | |
| 3108 | 3114 | COMBINE_DATA(xRAM_ptr + myarc_cur_page_offset + offset); |
| 3109 | 3115 | } |
| r3679 | r3680 | |
| 3111 | 3117 | /* high 24 kb: 0xa000-0xffff */ |
| 3112 | 3118 | static READ16_HANDLER ( ti99_myarcxramhigh_r ) |
| 3113 | 3119 | { |
| 3114 | | activecpu_adjust_icount(-4); |
| 3120 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 3115 | 3121 | |
| 3116 | 3122 | return xRAM_ptr[myarc_cur_page_offset + offset+0x1000]; |
| 3117 | 3123 | } |
| 3118 | 3124 | |
| 3119 | 3125 | static WRITE16_HANDLER ( ti99_myarcxramhigh_w ) |
| 3120 | 3126 | { |
| 3121 | | activecpu_adjust_icount(-4); |
| 3127 | cpu_adjust_icount(space->machine->cpu[0],-4); |
| 3122 | 3128 | |
| 3123 | 3129 | COMBINE_DATA(xRAM_ptr + myarc_cur_page_offset + offset+0x1000); |
| 3124 | 3130 | } |
src/mess/drivers/einstein.c
| r3679 | r3680 | |
| 290 | 290 | case 5: |
| 291 | 291 | case 6: |
| 292 | 292 | case 7: |
| 293 | | return einstein_80col_ram_r(machine, offset); |
| 293 | return einstein_80col_ram_r(space, offset); |
| 294 | 294 | case 0x0c: |
| 295 | | return einstein_80col_state_r(machine, offset); |
| 295 | return einstein_80col_state_r(space, offset); |
| 296 | 296 | default: |
| 297 | 297 | break; |
| 298 | 298 | } |
| r3679 | r3680 | |
| 312 | 312 | case 5: |
| 313 | 313 | case 6: |
| 314 | 314 | case 7: |
| 315 | | einstein_80col_ram_w(machine, offset,data); |
| 315 | einstein_80col_ram_w(space, offset,data); |
| 316 | 316 | break; |
| 317 | 317 | case 8: |
| 318 | | mc6845_address_w( devtag_get_token(machine, MC6845, "crtc"), offset, data ); |
| 318 | mc6845_address_w( devtag_get_token(space->machine, MC6845, "crtc"), offset, data ); |
| 319 | 319 | break; |
| 320 | 320 | case 9: |
| 321 | | mc6845_register_w( devtag_get_token(machine, MC6845, "crtc"), offset, data ); |
| 321 | mc6845_register_w( devtag_get_token(space->machine, MC6845, "crtc"), offset, data ); |
| 322 | 322 | break; |
| 323 | 323 | default: |
| 324 | 324 | break; |
| r3679 | r3680 | |
| 573 | 573 | |
| 574 | 574 | if (offset & 0x01) |
| 575 | 575 | { |
| 576 | | return TMS9928A_register_r(machine, offset & 0x01); |
| 576 | return TMS9928A_register_r(space, offset & 0x01); |
| 577 | 577 | } |
| 578 | 578 | |
| 579 | | return TMS9928A_vram_r(machine, offset & 0x01); |
| 579 | return TMS9928A_vram_r(space, offset & 0x01); |
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 582 | static WRITE8_HANDLER(einstein_vdp_w) |
| r3679 | r3680 | |
| 585 | 585 | |
| 586 | 586 | if (offset & 0x01) |
| 587 | 587 | { |
| 588 | | TMS9928A_register_w(machine, offset & 0x01,data); |
| 588 | TMS9928A_register_w(space, offset & 0x01,data); |
| 589 | 589 | return; |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | | TMS9928A_vram_w(machine, offset & 0x01,data); |
| 592 | TMS9928A_vram_w(space, offset & 0x01,data); |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | 595 | static WRITE8_HANDLER(einstein_fdc_w) |
| 596 | 596 | { |
| 597 | 597 | int reg = offset & 0x03; |
| 598 | 598 | |
| 599 | | logerror("fdc w: PC: %04x %04x %02x\n",activecpu_get_pc(),offset,data); |
| 599 | logerror("fdc w: PC: %04x %04x %02x\n",cpu_get_pc(space->machine->cpu[0]),offset,data); |
| 600 | 600 | |
| 601 | 601 | switch (reg) |
| 602 | 602 | { |
| 603 | 603 | case 0: |
| 604 | 604 | { |
| 605 | | wd17xx_command_w(machine, reg, data); |
| 605 | wd17xx_command_w(space, reg, data); |
| 606 | 606 | } |
| 607 | 607 | break; |
| 608 | 608 | |
| 609 | 609 | case 1: |
| 610 | 610 | { |
| 611 | | wd17xx_track_w(machine, reg, data); |
| 611 | wd17xx_track_w(space, reg, data); |
| 612 | 612 | } |
| 613 | 613 | break; |
| 614 | 614 | |
| 615 | 615 | case 2: |
| 616 | 616 | { |
| 617 | | wd17xx_sector_w(machine, reg, data); |
| 617 | wd17xx_sector_w(space, reg, data); |
| 618 | 618 | } |
| 619 | 619 | break; |
| 620 | 620 | |
| 621 | 621 | case 3: |
| 622 | 622 | { |
| 623 | | wd17xx_data_w(machine, reg, data); |
| 623 | wd17xx_data_w(space, reg, data); |
| 624 | 624 | } |
| 625 | 625 | break; |
| 626 | 626 | } |
| r3679 | r3680 | |
| 631 | 631 | { |
| 632 | 632 | int reg = offset & 0x03; |
| 633 | 633 | |
| 634 | | logerror("fdc r: PC: %04x %04x\n",activecpu_get_pc(),offset); |
| 634 | logerror("fdc r: PC: %04x %04x\n",cpu_get_pc(space->machine->cpu[0]),offset); |
| 635 | 635 | |
| 636 | 636 | switch (reg) |
| 637 | 637 | { |
| 638 | 638 | case 0: |
| 639 | 639 | { |
| 640 | | return wd17xx_status_r(machine, reg); |
| 640 | return wd17xx_status_r(space, reg); |
| 641 | 641 | } |
| 642 | 642 | break; |
| 643 | 643 | |
| 644 | 644 | case 1: |
| 645 | 645 | { |
| 646 | | return wd17xx_track_r(machine, reg); |
| 646 | return wd17xx_track_r(space, reg); |
| 647 | 647 | } |
| 648 | 648 | break; |
| 649 | 649 | |
| 650 | 650 | case 2: |
| 651 | 651 | { |
| 652 | | return wd17xx_sector_r(machine, reg); |
| 652 | return wd17xx_sector_r(space, reg); |
| 653 | 653 | } |
| 654 | 654 | break; |
| 655 | 655 | |
| 656 | 656 | case 3: |
| 657 | 657 | { |
| 658 | | return wd17xx_data_r(machine, reg); |
| 658 | return wd17xx_data_r(space, reg); |
| 659 | 659 | } |
| 660 | 660 | break; |
| 661 | 661 | } |
| r3679 | r3680 | |
| 699 | 699 | |
| 700 | 700 | if ((reg)==0) |
| 701 | 701 | { |
| 702 | | msm8251_data_w(machine, reg,data); |
| 702 | msm8251_data_w(space, reg,data); |
| 703 | 703 | return; |
| 704 | 704 | } |
| 705 | 705 | |
| 706 | | msm8251_control_w(machine, reg,data); |
| 706 | msm8251_control_w(space, reg,data); |
| 707 | 707 | } |
| 708 | 708 | |
| 709 | 709 | |
| r3679 | r3680 | |
| 715 | 715 | |
| 716 | 716 | if ((reg)==0) |
| 717 | 717 | { |
| 718 | | return msm8251_data_r(machine, reg); |
| 718 | return msm8251_data_r(space, reg); |
| 719 | 719 | } |
| 720 | 720 | |
| 721 | | return msm8251_status_r(machine, reg); |
| 721 | return msm8251_status_r(space, reg); |
| 722 | 722 | } |
| 723 | 723 | |
| 724 | 724 | /* |
| r3679 | r3680 | |
| 757 | 757 | /* case 0 and 1 are not handled */ |
| 758 | 758 | case 2: |
| 759 | 759 | { |
| 760 | | ay8910_control_port_0_w(machine, 0, data); |
| 760 | ay8910_control_port_0_w(space, 0, data); |
| 761 | 761 | } |
| 762 | 762 | break; |
| 763 | 763 | |
| 764 | 764 | case 3: |
| 765 | 765 | { |
| 766 | | ay8910_write_port_0_w(machine, 0, data); |
| 766 | ay8910_write_port_0_w(space, 0, data); |
| 767 | 767 | } |
| 768 | 768 | break; |
| 769 | 769 | |
| r3679 | r3680 | |
| 780 | 780 | { |
| 781 | 781 | /* case 0 and 1 are not handled */ |
| 782 | 782 | case 2: |
| 783 | | return ay8910_read_port_0_r(machine, 0); |
| 783 | return ay8910_read_port_0_r(space, 0); |
| 784 | 784 | |
| 785 | 785 | default: |
| 786 | 786 | break; |
| r3679 | r3680 | |
| 824 | 824 | /* bit 1: select drive 1 */ |
| 825 | 825 | /* bit 0: select drive 0 */ |
| 826 | 826 | |
| 827 | | logerror("drive w: PC: %04x %04x %02x\n",activecpu_get_pc(),offset,data); |
| 827 | logerror("drive w: PC: %04x %04x %02x\n",cpu_get_pc(space->machine->cpu[0]),offset,data); |
| 828 | 828 | |
| 829 | 829 | wd17xx_set_side((data>>4) & 0x01); |
| 830 | 830 | |
| r3679 | r3680 | |
| 852 | 852 | static WRITE8_HANDLER(einstein_rom_w) |
| 853 | 853 | { |
| 854 | 854 | einstein_rom_enabled^=1; |
| 855 | | einstein_page_rom(machine); |
| 855 | einstein_page_rom(space->machine); |
| 856 | 856 | } |
| 857 | 857 | |
| 858 | 858 | static READ8_HANDLER(einstein_key_int_r) |
| r3679 | r3680 | |
| 863 | 863 | /* clear key int. a read of this I/O port will do this or a reset */ |
| 864 | 864 | einstein_int &= ~EINSTEIN_KEY_INT; |
| 865 | 865 | |
| 866 | | einstein_update_interrupts(machine); |
| 866 | einstein_update_interrupts(space->machine); |
| 867 | 867 | |
| 868 | 868 | centronics_write_handshake(0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET); |
| 869 | 869 | centronics_handshake = centronics_read_handshake(0); |
| r3679 | r3680 | |
| 876 | 876 | /* bit 2: 1=printer busy */ |
| 877 | 877 | /* bit 1: fire 1 */ |
| 878 | 878 | /* bit 0: fire 0 */ |
| 879 | | data = ((input_port_read(machine, "EXTRA") & 0x07)<<5) | (input_port_read(machine, "BUTTONS") & 0x03) | 0x01c; |
| 879 | data = ((input_port_read(space->machine, "EXTRA") & 0x07)<<5) | (input_port_read(space->machine, "BUTTONS") & 0x03) | 0x01c; |
| 880 | 880 | |
| 881 | 881 | /* error? */ |
| 882 | 882 | if (centronics_handshake & CENTRONICS_NO_ERROR) |
| r3679 | r3680 | |
| 926 | 926 | einstein_int_mask |= EINSTEIN_KEY_INT; |
| 927 | 927 | } |
| 928 | 928 | |
| 929 | | einstein_update_interrupts(machine); |
| 929 | einstein_update_interrupts(space->machine); |
| 930 | 930 | } |
| 931 | 931 | |
| 932 | 932 | static WRITE8_HANDLER(einstein_adc_int_w) |
| r3679 | r3680 | |
| 946 | 946 | einstein_int_mask |= EINSTEIN_ADC_INT; |
| 947 | 947 | } |
| 948 | 948 | |
| 949 | | einstein_update_interrupts(machine); |
| 949 | einstein_update_interrupts(space->machine); |
| 950 | 950 | } |
| 951 | 951 | |
| 952 | 952 | static WRITE8_HANDLER(einstein_fire_int_w) |
| r3679 | r3680 | |
| 967 | 967 | einstein_int_mask |= EINSTEIN_FIRE_INT; |
| 968 | 968 | } |
| 969 | 969 | |
| 970 | | einstein_update_interrupts(machine); |
| 970 | einstein_update_interrupts(space->machine); |
| 971 | 971 | } |
| 972 | 972 | |
| 973 | 973 | |
| r3679 | r3680 | |
| 983 | 983 | case 0x05: |
| 984 | 984 | case 0x06: |
| 985 | 985 | case 0x07: |
| 986 | | return einstein_psg_r(machine, offset); |
| 986 | return einstein_psg_r(space, offset); |
| 987 | 987 | case 0x08: |
| 988 | 988 | case 0x09: |
| 989 | 989 | case 0x0a: |
| r3679 | r3680 | |
| 992 | 992 | case 0x0d: |
| 993 | 993 | case 0x0e: |
| 994 | 994 | case 0x0f: |
| 995 | | return einstein_vdp_r(machine, offset); |
| 995 | return einstein_vdp_r(space, offset); |
| 996 | 996 | case 0x10: |
| 997 | 997 | case 0x11: |
| 998 | 998 | case 0x12: |
| r3679 | r3680 | |
| 1001 | 1001 | case 0x15: |
| 1002 | 1002 | case 0x16: |
| 1003 | 1003 | case 0x17: |
| 1004 | | return einstein_serial_r(machine, offset); |
| 1004 | return einstein_serial_r(space, offset); |
| 1005 | 1005 | case 0x18: |
| 1006 | 1006 | case 0x19: |
| 1007 | 1007 | case 0x1a: |
| r3679 | r3680 | |
| 1010 | 1010 | case 0x1d: |
| 1011 | 1011 | case 0x1e: |
| 1012 | 1012 | case 0x1f: |
| 1013 | | return einstein_fdc_r(machine, offset); |
| 1013 | return einstein_fdc_r(space, offset); |
| 1014 | 1014 | case 0x20: |
| 1015 | | return einstein_key_int_r(machine, offset); |
| 1015 | return einstein_key_int_r(space, offset); |
| 1016 | 1016 | case 0x28: |
| 1017 | 1017 | case 0x29: |
| 1018 | 1018 | case 0x2a: |
| r3679 | r3680 | |
| 1021 | 1021 | case 0x2d: |
| 1022 | 1022 | case 0x2e: |
| 1023 | 1023 | case 0x2f: |
| 1024 | | return einstein_ctc_r( device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc"), offset); |
| 1024 | return einstein_ctc_r( device_list_find_by_tag(space->machine->config->devicelist, Z80CTC, "z80ctc"), offset); |
| 1025 | 1025 | case 0x30: |
| 1026 | 1026 | case 0x31: |
| 1027 | 1027 | case 0x32: |
| r3679 | r3680 | |
| 1030 | 1030 | case 0x35: |
| 1031 | 1031 | case 0x36: |
| 1032 | 1032 | case 0x37: |
| 1033 | | return einstein_pio_r(machine, offset); |
| 1033 | return einstein_pio_r(space, offset); |
| 1034 | 1034 | case 0x40: |
| 1035 | 1035 | case 0x41: |
| 1036 | 1036 | case 0x42: |
| r3679 | r3680 | |
| 1047 | 1047 | case 0x4d: |
| 1048 | 1048 | case 0x4e: |
| 1049 | 1049 | case 0x4f: |
| 1050 | | return einstein_80col_r(machine, offset); |
| 1050 | return einstein_80col_r(space, offset); |
| 1051 | 1051 | |
| 1052 | 1052 | default: |
| 1053 | 1053 | break; |
| r3679 | r3680 | |
| 1070 | 1070 | case 0x05: |
| 1071 | 1071 | case 0x06: |
| 1072 | 1072 | case 0x07: |
| 1073 | | einstein_psg_w(machine, offset,data); |
| 1073 | einstein_psg_w(space, offset,data); |
| 1074 | 1074 | return; |
| 1075 | 1075 | case 0x08: |
| 1076 | 1076 | case 0x09: |
| r3679 | r3680 | |
| 1080 | 1080 | case 0x0d: |
| 1081 | 1081 | case 0x0e: |
| 1082 | 1082 | case 0x0f: |
| 1083 | | einstein_vdp_w(machine, offset,data); |
| 1083 | einstein_vdp_w(space, offset,data); |
| 1084 | 1084 | return; |
| 1085 | 1085 | case 0x10: |
| 1086 | 1086 | case 0x11: |
| r3679 | r3680 | |
| 1090 | 1090 | case 0x15: |
| 1091 | 1091 | case 0x16: |
| 1092 | 1092 | case 0x17: |
| 1093 | | einstein_serial_w(machine, offset,data); |
| 1093 | einstein_serial_w(space, offset,data); |
| 1094 | 1094 | return; |
| 1095 | 1095 | case 0x18: |
| 1096 | 1096 | case 0x19: |
| r3679 | r3680 | |
| 1100 | 1100 | case 0x1d: |
| 1101 | 1101 | case 0x1e: |
| 1102 | 1102 | case 0x1f: |
| 1103 | | einstein_fdc_w(machine, offset,data); |
| 1103 | einstein_fdc_w(space, offset,data); |
| 1104 | 1104 | return; |
| 1105 | 1105 | case 0x20: |
| 1106 | | einstein_key_int_w(machine, offset,data); |
| 1106 | einstein_key_int_w(space, offset,data); |
| 1107 | 1107 | return; |
| 1108 | 1108 | case 0x21: |
| 1109 | | einstein_adc_int_w(machine, offset,data); |
| 1109 | einstein_adc_int_w(space, offset,data); |
| 1110 | 1110 | return; |
| 1111 | 1111 | case 0x23: |
| 1112 | | einstein_drive_w(machine, offset,data); |
| 1112 | einstein_drive_w(space, offset,data); |
| 1113 | 1113 | return; |
| 1114 | 1114 | case 0x24: |
| 1115 | | einstein_rom_w(machine, offset,data); |
| 1115 | einstein_rom_w(space, offset,data); |
| 1116 | 1116 | return; |
| 1117 | 1117 | case 0x25: |
| 1118 | | einstein_fire_int_w(machine, offset,data); |
| 1118 | einstein_fire_int_w(space, offset,data); |
| 1119 | 1119 | return; |
| 1120 | 1120 | case 0x28: |
| 1121 | 1121 | case 0x29: |
| r3679 | r3680 | |
| 1125 | 1125 | case 0x2d: |
| 1126 | 1126 | case 0x2e: |
| 1127 | 1127 | case 0x2f: |
| 1128 | | einstein_ctc_w( device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc"), offset,data); |
| 1128 | einstein_ctc_w( device_list_find_by_tag(space->machine->config->devicelist, Z80CTC, "z80ctc"), offset,data); |
| 1129 | 1129 | return; |
| 1130 | 1130 | case 0x30: |
| 1131 | 1131 | case 0x31: |
| r3679 | r3680 | |
| 1135 | 1135 | case 0x35: |
| 1136 | 1136 | case 0x36: |
| 1137 | 1137 | case 0x37: |
| 1138 | | einstein_pio_w(machine, offset,data); |
| 1138 | einstein_pio_w(space, offset,data); |
| 1139 | 1139 | return; |
| 1140 | 1140 | case 0x40: |
| 1141 | 1141 | case 0x41: |
| r3679 | r3680 | |
| 1153 | 1153 | case 0x4d: |
| 1154 | 1154 | case 0x4e: |
| 1155 | 1155 | case 0x4f: |
| 1156 | | einstein_80col_w(machine, offset,data); |
| 1156 | einstein_80col_w(space, offset,data); |
| 1157 | 1157 | return; |
| 1158 | 1158 | |
| 1159 | 1159 | default: |
| r3679 | r3680 | |
| 1176 | 1176 | case 0x05: |
| 1177 | 1177 | case 0x06: |
| 1178 | 1178 | case 0x07: |
| 1179 | | return einstein_psg_r(machine, offset); |
| 1179 | return einstein_psg_r(space, offset); |
| 1180 | 1180 | case 0x08: |
| 1181 | 1181 | case 0x09: |
| 1182 | 1182 | case 0x0a: |
| r3679 | r3680 | |
| 1185 | 1185 | case 0x0d: |
| 1186 | 1186 | case 0x0e: |
| 1187 | 1187 | case 0x0f: |
| 1188 | | return einstein_vdp_r(machine, offset); |
| 1188 | return einstein_vdp_r(space, offset); |
| 1189 | 1189 | case 0x10: |
| 1190 | 1190 | case 0x11: |
| 1191 | 1191 | case 0x12: |
| r3679 | r3680 | |
| 1194 | 1194 | case 0x15: |
| 1195 | 1195 | case 0x16: |
| 1196 | 1196 | case 0x17: |
| 1197 | | return einstein_serial_r(machine, offset); |
| 1197 | return einstein_serial_r(space, offset); |
| 1198 | 1198 | case 0x18: |
| 1199 | 1199 | case 0x19: |
| 1200 | 1200 | case 0x1a: |
| r3679 | r3680 | |
| 1203 | 1203 | case 0x1d: |
| 1204 | 1204 | case 0x1e: |
| 1205 | 1205 | case 0x1f: |
| 1206 | | return einstein_fdc_r(machine, offset); |
| 1206 | return einstein_fdc_r(space, offset); |
| 1207 | 1207 | case 0x20: |
| 1208 | | return einstein_key_int_r(machine, offset); |
| 1208 | return einstein_key_int_r(space, offset); |
| 1209 | 1209 | case 0x28: |
| 1210 | 1210 | case 0x29: |
| 1211 | 1211 | case 0x2a: |
| r3679 | r3680 | |
| 1214 | 1214 | case 0x2d: |
| 1215 | 1215 | case 0x2e: |
| 1216 | 1216 | case 0x2f: |
| 1217 | | return einstein_ctc_r( device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc"), offset); |
| 1217 | return einstein_ctc_r( device_list_find_by_tag(space->machine->config->devicelist, Z80CTC, "z80ctc"), offset); |
| 1218 | 1218 | case 0x30: |
| 1219 | 1219 | case 0x31: |
| 1220 | 1220 | case 0x32: |
| r3679 | r3680 | |
| 1223 | 1223 | case 0x35: |
| 1224 | 1224 | case 0x36: |
| 1225 | 1225 | case 0x37: |
| 1226 | | return einstein_pio_r(machine, offset); |
| 1226 | return einstein_pio_r(space, offset); |
| 1227 | 1227 | |
| 1228 | 1228 | default: |
| 1229 | 1229 | break; |
| r3679 | r3680 | |
| 1246 | 1246 | case 0x05: |
| 1247 | 1247 | case 0x06: |
| 1248 | 1248 | case 0x07: |
| 1249 | | einstein_psg_w(machine, offset,data); |
| 1249 | einstein_psg_w(space, offset,data); |
| 1250 | 1250 | return; |
| 1251 | 1251 | case 0x08: |
| 1252 | 1252 | case 0x09: |
| r3679 | r3680 | |
| 1256 | 1256 | case 0x0d: |
| 1257 | 1257 | case 0x0e: |
| 1258 | 1258 | case 0x0f: |
| 1259 | | einstein_vdp_w(machine, offset,data); |
| 1259 | einstein_vdp_w(space, offset,data); |
| 1260 | 1260 | return; |
| 1261 | 1261 | case 0x10: |
| 1262 | 1262 | case 0x11: |
| r3679 | r3680 | |
| 1266 | 1266 | case 0x15: |
| 1267 | 1267 | case 0x16: |
| 1268 | 1268 | case 0x17: |
| 1269 | | einstein_serial_w(machine, offset,data); |
| 1269 | einstein_serial_w(space, offset,data); |
| 1270 | 1270 | return; |
| 1271 | 1271 | case 0x18: |
| 1272 | 1272 | case 0x19: |
| r3679 | r3680 | |
| 1276 | 1276 | case 0x1d: |
| 1277 | 1277 | case 0x1e: |
| 1278 | 1278 | case 0x1f: |
| 1279 | | einstein_fdc_w(machine, offset,data); |
| 1279 | einstein_fdc_w(space, offset,data); |
| 1280 | 1280 | return; |
| 1281 | 1281 | case 0x20: |
| 1282 | | einstein_key_int_w(machine, offset,data); |
| 1282 | einstein_key_int_w(space, offset,data); |
| 1283 | 1283 | return; |
| 1284 | 1284 | case 0x21: |
| 1285 | | einstein_adc_int_w(machine, offset,data); |
| 1285 | einstein_adc_int_w(space, offset,data); |
| 1286 | 1286 | return; |
| 1287 | 1287 | case 0x23: |
| 1288 | | einstein_drive_w(machine, offset,data); |
| 1288 | einstein_drive_w(space, offset,data); |
| 1289 | 1289 | return; |
| 1290 | 1290 | case 0x24: |
| 1291 | | einstein_rom_w(machine, offset,data); |
| 1291 | einstein_rom_w(space, offset,data); |
| 1292 | 1292 | return; |
| 1293 | 1293 | case 0x25: |
| 1294 | | einstein_fire_int_w(machine, offset,data); |
| 1294 | einstein_fire_int_w(space, offset,data); |
| 1295 | 1295 | return; |
| 1296 | 1296 | case 0x28: |
| 1297 | 1297 | case 0x29: |
| r3679 | r3680 | |
| 1301 | 1301 | case 0x2d: |
| 1302 | 1302 | case 0x2e: |
| 1303 | 1303 | case 0x2f: |
| 1304 | | einstein_ctc_w( device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc"), offset,data); |
| 1304 | einstein_ctc_w( device_list_find_by_tag(space->machine->config->devicelist, Z80CTC, "z80ctc"), offset,data); |
| 1305 | 1305 | return; |
| 1306 | 1306 | case 0x30: |
| 1307 | 1307 | case 0x31: |
| r3679 | r3680 | |
| 1311 | 1311 | case 0x35: |
| 1312 | 1312 | case 0x36: |
| 1313 | 1313 | case 0x37: |
| 1314 | | einstein_pio_w(machine, offset,data); |
| 1314 | einstein_pio_w(space, offset,data); |
| 1315 | 1315 | return; |
| 1316 | 1316 | |
| 1317 | 1317 | default: |
| r3679 | r3680 | |
| 1455 | 1455 | einstein_int_mask = 0; |
| 1456 | 1456 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_SS_40); |
| 1457 | 1457 | |
| 1458 | | cpunum_set_irq_callback(0, einstein_cpu_acknowledge_int); |
| 1458 | cpu_set_irq_callback(machine->cpu[0], einstein_cpu_acknowledge_int); |
| 1459 | 1459 | |
| 1460 | 1460 | /* the einstein keyboard can generate a interrupt */ |
| 1461 | 1461 | /* the int is actually clocked at the system clock 4Mhz, but this would be too fast for our |
| r3679 | r3680 | |
| 1595 | 1595 | // logerror("line: %02x\n",einstein_keyboard_line); |
| 1596 | 1596 | |
| 1597 | 1597 | /* re-scan the keyboard */ |
| 1598 | | einstein_scan_keyboard(machine); |
| 1598 | einstein_scan_keyboard(space->machine); |
| 1599 | 1599 | } |
| 1600 | 1600 | |
| 1601 | 1601 | static READ8_HANDLER(einstein_port_b_read) |
| 1602 | 1602 | { |
| 1603 | | einstein_scan_keyboard(machine); |
| 1603 | einstein_scan_keyboard(space->machine); |
| 1604 | 1604 | |
| 1605 | 1605 | // logerror("key: %02x\n",einstein_keyboard_data); |
| 1606 | 1606 | |
src/mess/drivers/samcoupe.c
| r3679 | r3680 | |
| 87 | 87 | /* bit 1 and 2 select the controller register */ |
| 88 | 88 | switch (offset & 0x03) |
| 89 | 89 | { |
| 90 | | case 0: return wd17xx_status_r(machine, 0); |
| 91 | | case 1: return wd17xx_track_r(machine, 0); |
| 92 | | case 2: return wd17xx_sector_r(machine, 0); |
| 93 | | case 3: return wd17xx_data_r(machine, 0); |
| 90 | case 0: return wd17xx_status_r(space, 0); |
| 91 | case 1: return wd17xx_track_r(space, 0); |
| 92 | case 2: return wd17xx_sector_r(space, 0); |
| 93 | case 3: return wd17xx_data_r(space, 0); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | return 0xff; |
| r3679 | r3680 | |
| 106 | 106 | /* bit 1 and 2 select the controller register */ |
| 107 | 107 | switch (offset & 0x03) |
| 108 | 108 | { |
| 109 | | case 0: wd17xx_command_w(machine, 0, data); break; |
| 110 | | case 1: wd17xx_track_w(machine, 0, data); break; |
| 111 | | case 2: wd17xx_sector_w(machine, 0, data); break; |
| 112 | | case 3: wd17xx_data_w(machine, 0, data); break; |
| 109 | case 0: wd17xx_command_w(space, 0, data); break; |
| 110 | case 1: wd17xx_track_w(space, 0, data); break; |
| 111 | case 2: wd17xx_sector_w(space, 0, data); break; |
| 112 | case 3: wd17xx_data_w(space, 0, data); break; |
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| r3679 | r3680 | |
| 121 | 121 | if (offset & 0x100) |
| 122 | 122 | { |
| 123 | 123 | /* return either the current line or 192 for the vblank area */ |
| 124 | | int line = video_screen_get_vpos(machine->primary_screen); |
| 125 | | data = video_screen_get_vblank(machine->primary_screen) ? 192 : line; |
| 124 | int line = video_screen_get_vpos(space->machine->primary_screen); |
| 125 | data = video_screen_get_vblank(space->machine->primary_screen) ? 192 : line; |
| 126 | 126 | } |
| 127 | 127 | else |
| 128 | 128 | { |
| 129 | 129 | /* horizontal position is encoded into bits 3 to 8 */ |
| 130 | | data = video_screen_get_hpos(machine->primary_screen) & 0xfc; |
| 130 | data = video_screen_get_hpos(space->machine->primary_screen) & 0xfc; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | return data; |
| r3679 | r3680 | |
| 145 | 145 | UINT8 data = 0xe0; |
| 146 | 146 | UINT8 row = ~(offset >> 8); |
| 147 | 147 | |
| 148 | | if (row & 0x80) data &= input_port_read(machine, "keyboard_row_7f") & 0xe0; |
| 149 | | if (row & 0x40) data &= input_port_read(machine, "keyboard_row_bf") & 0xe0; |
| 150 | | if (row & 0x20) data &= input_port_read(machine, "keyboard_row_df") & 0xe0; |
| 151 | | if (row & 0x10) data &= input_port_read(machine, "keyboard_row_ef") & 0xe0; |
| 152 | | if (row & 0x08) data &= input_port_read(machine, "keyboard_row_f7") & 0xe0; |
| 153 | | if (row & 0x04) data &= input_port_read(machine, "keyboard_row_fb") & 0xe0; |
| 154 | | if (row & 0x02) data &= input_port_read(machine, "keyboard_row_fd") & 0xe0; |
| 155 | | if (row & 0x01) data &= input_port_read(machine, "keyboard_row_fe") & 0xe0; |
| 148 | if (row & 0x80) data &= input_port_read(space->machine, "keyboard_row_7f") & 0xe0; |
| 149 | if (row & 0x40) data &= input_port_read(space->machine, "keyboard_row_bf") & 0xe0; |
| 150 | if (row & 0x20) data &= input_port_read(space->machine, "keyboard_row_df") & 0xe0; |
| 151 | if (row & 0x10) data &= input_port_read(space->machine, "keyboard_row_ef") & 0xe0; |
| 152 | if (row & 0x08) data &= input_port_read(space->machine, "keyboard_row_f7") & 0xe0; |
| 153 | if (row & 0x04) data &= input_port_read(space->machine, "keyboard_row_fb") & 0xe0; |
| 154 | if (row & 0x02) data &= input_port_read(space->machine, "keyboard_row_fd") & 0xe0; |
| 155 | if (row & 0x01) data &= input_port_read(space->machine, "keyboard_row_fe") & 0xe0; |
| 156 | 156 | |
| 157 | 157 | return data | samcoupe_regs.status; |
| 158 | 158 | } |
| r3679 | r3680 | |
| 173 | 173 | static WRITE8_HANDLER( samcoupe_lmpr_w ) |
| 174 | 174 | { |
| 175 | 175 | samcoupe_regs.lmpr = data; |
| 176 | | samcoupe_update_memory(machine); |
| 176 | samcoupe_update_memory(space->machine); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | |
| r3679 | r3680 | |
| 186 | 186 | static WRITE8_HANDLER( samcoupe_hmpr_w ) |
| 187 | 187 | { |
| 188 | 188 | samcoupe_regs.hmpr = data; |
| 189 | | samcoupe_update_memory(machine); |
| 189 | samcoupe_update_memory(space->machine); |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | |
| r3679 | r3680 | |
| 199 | 199 | static WRITE8_HANDLER( samcoupe_vmpr_w ) |
| 200 | 200 | { |
| 201 | 201 | samcoupe_regs.vmpr = data; |
| 202 | | samcoupe_update_memory(machine); |
| 202 | samcoupe_update_memory(space->machine); |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | |
| r3679 | r3680 | |
| 223 | 223 | |
| 224 | 224 | if (row == 0) |
| 225 | 225 | { |
| 226 | | data &= input_port_read(machine, "keyboard_row_ff") & 0x1f; |
| 226 | data &= input_port_read(space->machine, "keyboard_row_ff") & 0x1f; |
| 227 | 227 | } |
| 228 | 228 | else |
| 229 | 229 | { |
| 230 | | if (row & 0x80) data &= input_port_read(machine, "keyboard_row_7f") & 0x1f; |
| 231 | | if (row & 0x40) data &= input_port_read(machine, "keyboard_row_bf") & 0x1f; |
| 232 | | if (row & 0x20) data &= input_port_read(machine, "keyboard_row_df") & 0x1f; |
| 233 | | if (row & 0x10) data &= input_port_read(machine, "keyboard_row_ef") & 0x1f; |
| 234 | | if (row & 0x08) data &= input_port_read(machine, "keyboard_row_f7") & 0x1f; |
| 235 | | if (row & 0x04) data &= input_port_read(machine, "keyboard_row_fb") & 0x1f; |
| 236 | | if (row & 0x02) data &= input_port_read(machine, "keyboard_row_fd") & 0x1f; |
| 237 | | if (row & 0x01) data &= input_port_read(machine, "keyboard_row_fe") & 0x1f; |
| 230 | if (row & 0x80) data &= input_port_read(space->machine, "keyboard_row_7f") & 0x1f; |
| 231 | if (row & 0x40) data &= input_port_read(space->machine, "keyboard_row_bf") & 0x1f; |
| 232 | if (row & 0x20) data &= input_port_read(space->machine, "keyboard_row_df") & 0x1f; |
| 233 | if (row & 0x10) data &= input_port_read(space->machine, "keyboard_row_ef") & 0x1f; |
| 234 | if (row & 0x08) data &= input_port_read(space->machine, "keyboard_row_f7") & 0x1f; |
| 235 | if (row & 0x04) data &= input_port_read(space->machine, "keyboard_row_fb") & 0x1f; |
| 236 | if (row & 0x02) data &= input_port_read(space->machine, "keyboard_row_fd") & 0x1f; |
| 237 | if (row & 0x01) data &= input_port_read(space->machine, "keyboard_row_fe") & 0x1f; |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | return data | 0xe0; |
| r3679 | r3680 | |
| 252 | 252 | |
| 253 | 253 | static READ8_HANDLER( samcoupe_attributes_r ) |
| 254 | 254 | { |
| 255 | | if (video_screen_get_vblank(machine->primary_screen)) |
| 255 | if (video_screen_get_vblank(space->machine->primary_screen)) |
| 256 | 256 | { |
| 257 | 257 | /* Border areas return 0xff */ |
| 258 | 258 | return 0xff; |
| r3679 | r3680 | |
| 269 | 269 | static WRITE8_HANDLER( samcoupe_sound_w ) |
| 270 | 270 | { |
| 271 | 271 | if (offset & 0x100) |
| 272 | | saa1099_control_port_0_w(machine, 0, data); |
| 272 | saa1099_control_port_0_w(space, 0, data); |
| 273 | 273 | else |
| 274 | | saa1099_write_port_0_w(machine, 0, data); |
| 274 | saa1099_write_port_0_w(space, 0, data); |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| r3679 | r3680 | |
| 335 | 335 | static INTERRUPT_GEN( samcoupe_frame_interrupt ) |
| 336 | 336 | { |
| 337 | 337 | /* signal frame interrupt */ |
| 338 | | samcoupe_irq(machine, 0x08); |
| 338 | samcoupe_irq(device->machine, 0x08); |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | |