Previous 15994 Revisions Next

r3680 Thursday 27th November, 2008 at 20:30:21 UTC by Miodrag Milanović
ti99, aim, pdp1,tx0,samcoupe,veb enable
[src/mess]mess.mak messdriv.c
[src/mess/drivers]einstein.c samcoupe.c ti990_10.c ti990_4.c ti99_2.c tm990189.c
[src/mess/machine]990_hd.c 990_tap.c 99_dsk.c 99_ide.c 99_peb.c 99_peb.h aim65.c geneve.c pdp1.c samcoupe.c ti99_4x.c tx0.c
[src/mess/video]733_asr.c aim65.c dl1416.c pdp1.c tx0.c

src/mess/video/pdp1.c
r3679r3680
303303static void pdp1_draw_panel(running_machine *machine, bitmap_t *bitmap)
304304{
305305   /* 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);
314314
315315   /* 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));
319319   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));
329329
330330   /* column 3: power, single step, single inst, sense, flags, instr... */
331331   pdp1_draw_led(machine, bitmap, x_panel_col3_offset, y_panel_power_offset, 1);   /* always on */
332332   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);
341341}
342342
343343
src/mess/video/aim65.c
r3679r3680
8484
8585TIMER_CALLBACK(aim65_printer_timer)
8686{
87   via_0_cb1_w(machine, 0, printer_level);
88   via_0_ca1_w(machine, 0, !printer_level);
87   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
88   via_0_cb1_w(space, 0, printer_level);
89   via_0_ca1_w(space, 0, !printer_level);
8990   printer_level = !printer_level;
9091   aim65_printer_inc();
9192}
r3679r3680
9798   {
9899      aim65_printer_cr();
99100      timer_adjust_periodic(print_timer, attotime_zero, 0, ATTOTIME_IN_USEC(10));
100      via_0_cb1_w(machine, 0, 0);
101      via_0_cb1_w(space, 0, 0);
101102      printer_level = 1;
102103   }
103104   else
src/mess/video/tx0.c
r3679r3680
292292   int i;
293293
294294   /* 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);
305305   for (i=0; i<16; i++)
306306   {
307307      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);
309309      tx0_draw_switch(machine, bitmap, x_panel_col1a_offset+168, y_panel_tss_offset+8+i*8, (lr_sel >> i) & 1);
310310   }
311311
312312   /* 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);
324324}
325325
326326
src/mess/video/dl1416.c
r3679r3680
124124static DEVICE_START( dl1416 )
125125{
126126   dl1416_t *dl1416 = device->token;
127   char unique_tag[30];
128
129127   /* validate arguments */
130128   assert(device->tag != NULL);
131129   assert(strlen(device->tag) < 20);
r3679r3680
133131   dl1416->intf = device->static_config;
134132
135133   /* register for state saving */
136   state_save_combine_module_and_tag(unique_tag, "dl1416", device->tag);
137
138   state_save_register_item(unique_tag, 0, dl1416->chip_enable);
139   state_save_register_item(unique_tag, 0, dl1416->cursor_enable);
140   state_save_register_item(unique_tag, 0, dl1416->write_enable);
141   state_save_register_item_array(unique_tag, 0, dl1416->cursor_ram);
134   state_save_register_item("dl1416", NULL, 0, dl1416->chip_enable);
135   state_save_register_item("dl1416", NULL, 0, dl1416->cursor_enable);
136   state_save_register_item("dl1416", NULL, 0, dl1416->write_enable);
137   state_save_register_item_array("dl1416", NULL, 0, dl1416->cursor_ram);
142138   return DEVICE_START_OK;
143139}
144140
src/mess/video/733_asr.c
r3679r3680
412412
413413WRITE8_HANDLER(asr733_0_cru_w)
414414{
415   asr733_cru_w(machine, offset, data, 0);
415   asr733_cru_w(space->machine, offset, data, 0);
416416}
417417
418418
src/mess/messdriv.c
r3679r3680
308308   /* COMMODORE */
309309   DRIVER( kim1 )      /* Commodore (MOS) KIM-1 1975                  */
310310//128u4   DRIVER( sym1 )      /* Synertek SYM-1                           */
311//128u4   DRIVER( aim65 )      /* Rockwell AIM65                           */
311   DRIVER( aim65 )      /* Rockwell AIM65                           */
312312
313313   DRIVER( pet2001 )   /* PET 2001                                 */
314314   DRIVER( pet2001n )   /* PET 2001-N                              */
r3679r3680
521521   DRIVER( ip244415 )
522522
523523   /* TEXAS INSTRUMENTS */
524//128u4   DRIVER( ti990_10 )   /* 1975 TI 990/10                           */
525//128u4   DRIVER( ti990_4 )   /* 1976 TI 990/4                           */
526//128u4   DRIVER( 990189 )   /* 1978 TM 990/189                           */
527//128u4   DRIVER( 990189v )   /* 1980 TM 990/189 with Color Video Board         */
524   DRIVER( ti990_10 )   /* 1975 TI 990/10                           */
525   DRIVER( ti990_4 )   /* 1976 TI 990/4                           */
526   DRIVER( 990189 )   /* 1978 TM 990/189                           */
527   DRIVER( 990189v )   /* 1980 TM 990/189 with Color Video Board         */
528528
529//128u4   DRIVER( ti99_224 )   /* 1983 TI 99/2 (24kb ROMs)                     */
530//128u4   DRIVER( ti99_232 )   /* 1983 TI 99/2 (32kb ROMs)                     */
531//128u4   DRIVER( ti99_4 )   /* 1979 TI-99/4                              */
532//128u4   DRIVER( ti99_4e )   /* 1980 TI-99/4 with 50Hz video                  */
533//128u4   DRIVER( ti99_4a )   /* 1981 TI-99/4A                           */
534//128u4   DRIVER( ti99_4ae )   /* 1981 TI-99/4A with 50Hz video               */
535//128u4   DRIVER( ti99_4ev)   /* 1994 TI-99/4A with EVPC video card            */
536//128u4   DRIVER( ti99_8 )   /* 1983 TI-99/8                              */
537//128u4   DRIVER( ti99_8e )   /* 1983 TI-99/8 with 50Hz video                  */
529   DRIVER( ti99_224 )   /* 1983 TI 99/2 (24kb ROMs)                     */
530   DRIVER( ti99_232 )   /* 1983 TI 99/2 (32kb ROMs)                     */
531   DRIVER( ti99_4 )   /* 1979 TI-99/4                              */
532   DRIVER( ti99_4e )   /* 1980 TI-99/4 with 50Hz video                  */
533   DRIVER( ti99_4a )   /* 1981 TI-99/4A                           */
534   DRIVER( ti99_4ae )   /* 1981 TI-99/4A with 50Hz video               */
535   DRIVER( ti99_4ev)   /* 1994 TI-99/4A with EVPC video card            */
536   DRIVER( ti99_8 )   /* 1983 TI-99/8                              */
537   DRIVER( ti99_8e )   /* 1983 TI-99/8 with 50Hz video                  */
538538
539539   /* TI 99 clones */
540540   DRIVER( tutor)      /* 1983? Tomy Tutor                           */
541//128u4   DRIVER( geneve )   /* 1987? Myarc Geneve 9640                     */
542//128u4   DRIVER( genmod )   /* 199?? Myarc Geneve 9640                     */
543//128u4   DRIVER( ti99_4p )   /* 1996 SNUG 99/4P (a.k.a. SGCPU)               */
541   DRIVER( geneve )   /* 1987? Myarc Geneve 9640                     */
542   DRIVER( genmod )   /* 199?? Myarc Geneve 9640                     */
543   DRIVER( ti99_4p )   /* 1996 SNUG 99/4P (a.k.a. SGCPU)               */
544544
545545   DRIVER( avigo )      /*                                       */
546546
r3679r3680
571571   DRIVER( apfimag )
572572
573573   /* Tatung */
574//128u4   DRIVER( einstein )
575//128u4   DRIVER( einstei2 )
574   DRIVER( einstein )
575   DRIVER( einstei2 )
576576
577577   /* INTELLIGENT SOFTWARE */
578578   DRIVER( ep128 )      /* Enterprise 128 k                           */
r3679r3680
582582
583583   /* VEB MIKROELEKTRONIK */
584584   /* KC compact is partial CPC compatible */
585//128u4   DRIVER( kc85_4 )   /* VEB KC 85/4                              */
586//128u4   DRIVER( kc85_3 )   /* VEB KC 85/3                              */
587//128u4   DRIVER( kc85_4d )   /* VEB KC 85/4 with disk interface               */
585   DRIVER( kc85_4 )   /* VEB KC 85/4                              */
586   DRIVER( kc85_3 )   /* VEB KC 85/3                              */
587   DRIVER( kc85_4d )   /* VEB KC 85/4 with disk interface               */
588588
589589   /* MICROBEE SYSTEMS */
590590   DRIVER( mbee )      /* Microbee 16 Standard or Plus                  */
r3679r3680
793793   DRIVER( nascom2 )   /* 1979 Nascom 2                           */
794794
795795   /* MILES GORDON TECHNOLOGY */
796//128u4   DRIVER( samcoupe )   /* 1989 Sam Coupe                           */
796   DRIVER( samcoupe )   /* 1989 Sam Coupe                           */
797797
798798   /* MOTOROLA */
799799   DRIVER( mekd2 )      /* 1977 Motorola Evaluation Kit                  */
800800
801801   /* DEC */
802//128u4   DRIVER( pdp1 )      /* 1961 DEC PDP1                           */
802   DRIVER( pdp1 )      /* 1961 DEC PDP1                           */
803803
804804   /* MEMOTECH */
805805   DRIVER( mtx512 )   /* 1983 Memotech MTX 512                     */
r3679r3680
901901   DRIVER(oscnano)
902902
903903   /* MIT */
904//128u4   DRIVER( tx0_64kw )   /* April 1956 MIT TX-0 (64kw RAM)               */
905//128u4   DRIVER( tx0_8kw )   /* 1962 MIT TX-0 (8kw RAM)                     */
904   DRIVER( tx0_64kw )   /* April 1956 MIT TX-0 (64kw RAM)               */
905   DRIVER( tx0_8kw )   /* 1962 MIT TX-0 (8kw RAM)                     */
906906
907907   /* Luxor Datorer AB */
908908   DRIVER( abc80 )
src/mess/machine/pdp1.c
r3679r3680
528528               tape_reader.rcl = 0;
529529               if (tape_reader.rcp)
530530               {
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 */
532532                  pdp1_pulse_iot_done();
533533               }
534534               else
r3679r3680
596596void iot_rpa(int op2, int nac, int mb, int *io, int ac)
597597{
598598   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));
600600
601601   begin_tape_read(0, nac);
602602}
r3679r3680
633633void iot_rpb(int op2, int nac, int mb, int *io, int ac)
634634{
635635   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));
637637
638638   begin_tape_read(1, nac);
639639}
r3679r3680
644644void iot_rrb(int op2, int nac, int mb, int *io, int ac)
645645{
646646   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));
648648
649649   *io = tape_reader.rb;
650650   io_status &= ~io_st_ptr;
r3679r3680
667667void iot_ppa(int op2, int nac, int mb, int *io, int ac)
668668{
669669   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));
671671
672672   tape_write(*io & 0377);
673673   io_status &= ~io_st_ptp;
r3679r3680
675675   if (LOG_IOT_OVERLAP)
676676   {
677677      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));
679679   }
680680
681681   timer_adjust_oneshot(tape_puncher.timer, ATTOTIME_IN_USEC(15800), nac);
r3679r3680
695695void iot_ppb(int op2, int nac, int mb, int *io, int ac)
696696{
697697   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));
699699
700700   tape_write((*io >> 12) | 0200);
701701   io_status &= ~io_st_ptp;
r3679r3680
703703   if (LOG_IOT_OVERLAP)
704704   {
705705      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));
707707   }
708708   timer_adjust_oneshot(tape_puncher.timer, ATTOTIME_IN_USEC(15800), nac);
709709}
r3679r3680
863863   int ch, delay;
864864
865865   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));
867867
868868   ch = (*io) & 077;
869869
r3679r3680
891891   if (LOG_IOT_OVERLAP)
892892   {
893893      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));
895895   }
896896
897897   timer_adjust_oneshot(typewriter.tyo_timer, ATTOTIME_IN_MSEC(delay), nac);
r3679r3680
914914void iot_tyi(int op2, int nac, int mb, int *io, int ac)
915915{
916916   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));
918918
919919   *io = typewriter.tb;
920920   if (! (io_status & io_st_tyi))
r3679r3680
993993   {
994994      io_status |= io_st_pen;
995995
996      cpu_set_reg(machine->cpu[0], PDP1_PF3, 1);
996      cpu_set_reg(Machine->cpu[0], PDP1_PF3, 1);
997997   }
998998
999999   if (nac)
r3679r3680
10041004         /* note that overlap detection is incomplete: it will only work if both DPY
10051005         instructions require a completion pulse */
10061006         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));
10081008      }
10091009      timer_adjust_oneshot(dpy_timer, ATTOTIME_IN_USEC(50), 0);
10101010   }
r3679r3680
11331133   {
11341134      if ((parallel_drum.wfb >= 1) && (parallel_drum.wfb <= 22))
11351135      {
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));
11371137      }
11381138
11391139      if ((parallel_drum.rfb >= 1) && (parallel_drum.rfb <= 22))
11401140      {
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));
11421142      }
11431143
11441144      parallel_drum.wc = (parallel_drum.wc+1) & 07777;
r3679r3680
11471147      if (parallel_drum.wc)
11481148         delay = attotime_add(delay, PARALLEL_DRUM_WORD_TIME);
11491149   } 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));
11511151   /* 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);
11531153}
11541154
11551155void iot_dra(int op2, int nac, int mb, int *io, int ac)
r3679r3680
12161216void iot_cks(int op2, int nac, int mb, int *io, int ac)
12171217{
12181218   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));
12201220
12211221   *io = io_status;
12221222}
r3679r3680
13461346*/
13471347INTERRUPT_GEN( pdp1_interrupt )
13481348{
1349   running_machine *machine = device->machine;
13491350   int control_keys;
13501351   int tw_keys;
13511352   int ta_keys;
r3679r3680
13591360   int ta_transitions;
13601361
13611362
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"));
13631364
13641365   /* read new state of control keys */
1365   control_keys = input_port_read(machine, "CSW");
1366   control_keys = input_port_read(device->machine, "CSW");
13661367
13671368   if (control_keys & pdp1_control)
13681369   {
r3679r3680
13711372
13721373      if (control_transitions & pdp1_extend)
13731374      {
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));
13751376      }
13761377      if (control_transitions & pdp1_start_nobrk)
13771378      {
13781379         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);
13841385      }
13851386      if (control_transitions & pdp1_start_brk)
13861387      {
13871388         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);
13931394      }
13941395      if (control_transitions & pdp1_stop)
13951396      {
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
13981399                                 (i.e. data), whereas a real pdp-1 stops after reading
13991400                                 an odd-numbered word (i.e. dio instruciton) */
14001401      }
14011402      if (control_transitions & pdp1_continue)
14021403      {
1403         cpu_set_reg(machine->cpu[0], PDP1_RUN, 1);
1404         cpu_set_reg(device, PDP1_RUN, 1);
14041405      }
14051406      if (control_transitions & pdp1_examine)
14061407      {
14071408         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 */
14111412
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));
14141415      }
14151416      if (control_transitions & pdp1_deposit)
14161417      {
14171418         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 */
14221423
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));
14251426      }
14261427      if (control_transitions & pdp1_read_in)
14271428      {   /* set cpu to read instructions from perforated tape */
14281429         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);
14361437      }
14371438      if (control_transitions & pdp1_reader)
14381439      {
r3679r3680
14421443      }
14431444      if (control_transitions & pdp1_single_step)
14441445      {
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));
14461447      }
14471448      if (control_transitions & pdp1_single_inst)
14481449      {
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));
14501451      }
14511452
14521453      /* remember new state of control keys */
r3679r3680
14601461      tw_transitions = tw_keys & (~ old_tw_keys);
14611462
14621463      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);
14641465
14651466      /* remember new state of test word keys */
14661467      old_tw_keys = tw_keys;
r3679r3680
14731474      ta_transitions = ta_keys & (~ old_ta_keys);
14741475
14751476      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);
14771478
14781479      /* remember new state of test word keys */
14791480      old_ta_keys = ta_keys;
src/mess/machine/990_hd.c
r3679r3680
484484/*
485485   Handle the store registers command: read the drive geometry.
486486*/
487static void store_registers(void)
487static void store_registers(running_machine *machine)
488488{
489489   int dma_address;
490490   int byte_count;
r3679r3680
530530   if (! (hdc.w[1] & w1_transfer_inhibit))
531531      for (i=0; i<real_word_count; i++)
532532      {
533         program_write_word_16be(dma_address, buffer[i]);
533         memory_write_word_16be(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM),dma_address, buffer[i]);
534534         dma_address = (dma_address + 2) & 0x1ffffe;
535535      }
536536
r3679r3680
613613/*
614614   Handle the read data command: read a variable number of sectors from disk.
615615*/
616static void read_data(void)
616static void read_data(running_machine *machine)
617617{
618618   int dma_address;
619619   int byte_count;
r3679r3680
685685      if (! (hdc.w[1] & w1_transfer_inhibit))
686686         for (i=0; i<bytes_read; i+=2)
687687         {
688            program_write_word_16be(dma_address, (((int) buffer[i]) << 8) | buffer[i+1]);
688            memory_write_word_16be(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM),dma_address, (((int) buffer[i]) << 8) | buffer[i+1]);
689689            dma_address = (dma_address + 2) & 0x1ffffe;
690690         }
691691
r3679r3680
713713/*
714714   Handle the write data command: write a variable number of sectors from disk.
715715*/
716static void write_data(void)
716static void write_data(running_machine *machine)
717717{
718718   int dma_address;
719719   int byte_count;
r3679r3680
781781      /* DMA */
782782      for (i=0; (i<byte_count) && (i<hdc.d[dsk_sel].bytes_per_sector); i+=2)
783783      {
784         word = program_read_word_16be(dma_address);
784         word = memory_read_word_16be(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM),dma_address);
785785         buffer[i] = word >> 8;
786786         buffer[i+1] = word & 0xff;
787787
r3679r3680
825825/*
826826   Handle the unformatted read command: read drive geometry information.
827827*/
828static void unformatted_read(void)
828static void unformatted_read(running_machine *machine)
829829{
830830   int dma_address;
831831   int byte_count;
r3679r3680
888888   if (! (hdc.w[1] & w1_transfer_inhibit))
889889      for (i=0; i<real_word_count; i++)
890890      {
891         program_write_word_16be(dma_address, buffer[i]);
891         memory_write_word_16be(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM),dma_address, buffer[i]);
892892         dma_address = (dma_address + 2) & 0x1ffffe;
893893      }
894894
r3679r3680
931931/*
932932   Parse command code and execute the command.
933933*/
934static void execute_command(void)
934static void execute_command(running_machine *machine)
935935{
936936   /* hack */
937937   hdc.w[0] &= 0xff;
r3679r3680
944944   case 0x00: //0b000:
945945      /* store registers */
946946      logerror("store registers\n");
947      store_registers();
947      store_registers(machine);
948948      break;
949949   case 0x01: //0b001:
950950      /* write format */
r3679r3680
954954   case 0x02: //0b010:
955955      /* read data */
956956      logerror("read data\n");
957      read_data();
957      read_data(machine);
958958      break;
959959   case 0x03: //0b011:
960960      /* write data */
961961      logerror("write data\n");
962      write_data();
962      write_data(machine);
963963      break;
964964   case 0x04: //0b100:
965965      /* unformatted read */
966966      logerror("unformatted read\n");
967      unformatted_read();
967      unformatted_read(machine);
968968      break;
969969   case 0x05: //0b101:
970970      /* unformatted write */
r3679r3680
10191019
10201020         if ((offset == 7) && (old_data & w7_idle) && ! (data & w7_idle))
10211021         {   /* idle has been cleared: start command execution */
1022            execute_command();
1022            execute_command(space->machine);
10231023         }
10241024      }
10251025   }
src/mess/machine/99_dsk.c
r3679r3680
575575   switch (offset)
576576   {
577577   case 0x1FF0:               /* Status register */
578      return (wd17xx_status_r(machine, offset) ^ 0xFF);
578      return (wd17xx_status_r(space, offset) ^ 0xFF);
579579      break;
580580   case 0x1FF2:               /* Track register */
581      return wd17xx_track_r(machine, offset) ^ 0xFF;
581      return wd17xx_track_r(space, offset) ^ 0xFF;
582582      break;
583583   case 0x1FF4:               /* Sector register */
584      return wd17xx_sector_r(machine, offset) ^ 0xFF;
584      return wd17xx_sector_r(space, offset) ^ 0xFF;
585585      break;
586586   case 0x1FF6:               /* Data register */
587      return wd17xx_data_r(machine, offset) ^ 0xFF;
587      return wd17xx_data_r(space, offset) ^ 0xFF;
588588      break;
589589   default:                  /* DSR ROM */
590590      return ti99_disk_DSR[offset];
r3679r3680
602602   switch (offset)
603603   {
604604   case 0x1FF8:               /* Command register */
605      wd17xx_command_w(machine, offset, data);
605      wd17xx_command_w(space, offset, data);
606606      break;
607607   case 0x1FFA:               /* Track register */
608      wd17xx_track_w(machine, offset, data);
608      wd17xx_track_w(space, offset, data);
609609      break;
610610   case 0x1FFC:               /* Sector register */
611      wd17xx_sector_w(machine, offset, data);
611      wd17xx_sector_w(space, offset, data);
612612      break;
613613   case 0x1FFE:               /* Data register */
614      wd17xx_data_w(machine, offset, data);
614      wd17xx_data_w(space, offset, data);
615615      break;
616616   }
617617}
r3679r3680
10471047         switch (offset)
10481048         {
10491049         case 0x1FF0:               /* Status register */
1050            reply = wd17xx_status_r(machine, offset);
1050            reply = wd17xx_status_r(space, offset);
10511051            break;
10521052         case 0x1FF2:               /* Track register */
1053            reply = wd17xx_track_r(machine, offset);
1053            reply = wd17xx_track_r(space, offset);
10541054            break;
10551055         case 0x1FF4:               /* Sector register */
1056            reply = wd17xx_sector_r(machine, offset);
1056            reply = wd17xx_sector_r(space, offset);
10571057            break;
10581058         case 0x1FF6:               /* Data register */
1059            reply = wd17xx_data_r(machine, offset);
1059            reply = wd17xx_data_r(space, offset);
10601060            break;
10611061         default:
10621062            reply = 0;
r3679r3680
10911091         switch (offset)
10921092         {
10931093         case 0x1FF8:               /* Command register */
1094            wd17xx_command_w(machine, offset, data);
1094            wd17xx_command_w(space, offset, data);
10951095            break;
10961096         case 0x1FFA:               /* Track register */
1097            wd17xx_track_w(machine, offset, data);
1097            wd17xx_track_w(space, offset, data);
10981098            break;
10991099         case 0x1FFC:               /* Sector register */
1100            wd17xx_sector_w(machine, offset, data);
1100            wd17xx_sector_w(space, offset, data);
11011101            break;
11021102         case 0x1FFE:               /* Data register */
1103            wd17xx_data_w(machine, offset, data);
1103            wd17xx_data_w(space, offset, data);
11041104            break;
11051105         }
11061106      }
src/mess/machine/aim65.c
r3679r3680
9090static WRITE8_HANDLER( aim65_pia_a_w )
9191{
9292   pia_a = data;
93   aim65_pia(machine);
93   aim65_pia(space->machine);
9494}
9595
9696
9797static WRITE8_HANDLER( aim65_pia_b_w )
9898{
9999   pia_b = data;
100   aim65_pia(machine);
100   aim65_pia(space->machine);
101101}
102102
103103
r3679r3680
184184
185185static READ8_HANDLER( aim65_via0_b_r )
186186{
187   return input_port_read(machine, "switches");
187   return input_port_read(space->machine, "switches");
188188}
189189
190190
r3679r3680
220220DRIVER_INIT( aim65 )
221221{
222222   /* Init RAM */
223   memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM,
223   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
224   
225   memory_install_readwrite8_handler(space,
224226      0, mess_ram_size - 1, 0, 0, SMH_BANK1, SMH_BANK1);
225227   memory_set_bankptr(machine, 1, mess_ram);
226228
227229   if (mess_ram_size < 4 * 1024)
228      memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM,
230      memory_install_readwrite8_handler(space,
229231         mess_ram_size, 0x0fff, 0, 0, SMH_NOP, SMH_NOP);
230232
231233   pia_config(0, &pia);
232234
233235   via_config(0, &via0);
234   via_0_cb1_w(machine, 1, 1);
235   via_0_ca1_w(machine, 1, 0);
236   via_0_cb1_w(space, 1, 1);
237   via_0_ca1_w(space, 1, 0);
236238
237239   via_config(1, &user_via);
238240   via_reset();
src/mess/machine/tx0.c
r3679r3680
335335         if (data & 0100)
336336         {
337337            /* read current AC */
338            ac = cpunum_get_reg(0, TX0_AC);
338            ac = cpu_get_reg(Machine->cpu[0], TX0_AC);
339339            /* cycle right */
340340            ac = (ac >> 1) | ((ac & 1) << 17);
341341            /* shuffle and insert data into AC */
342342            ac = (ac /*& 0333333*/) | ((data & 001) << 17) | ((data & 002) << 13) | ((data & 004) << 9) | ((data & 010) << 5) | ((data & 020) << 1) | ((data & 040) >> 3);
343343            /* write modified AC */
344            cpu_set_reg(machine->cpu[0], TX0_AC, ac);
344            cpu_set_reg(Machine->cpu[0], TX0_AC, ac);
345345
346346            tape_reader.rc = (tape_reader.rc+1) & 3;
347347
348348            if (tape_reader.rc == 0)
349349            {   /* IO complete */
350350               tape_reader.rcl = 0;
351               tx0_pulse_io_complete();
351               cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0);
352352            }
353353         }
354354      }
r3679r3680
366366*/
367367static TIMER_CALLBACK(puncher_callback)
368368{
369   tx0_pulse_io_complete();
369   cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0);
370370}
371371
372372/*
r3679r3680
393393   int ac;
394394
395395   /* read current AC */
396   ac = cpunum_get_reg(0, TX0_AC);
396   ac = cpu_get_reg(Machine->cpu[0], TX0_AC);
397397   /* shuffle and punch 6-bit word */
398398   tape_write(((ac & 0100000) >> 15) | ((ac & 0010000) >> 11) | ((ac & 0001000) >> 7) | ((ac & 0000100) >> 3) | ((ac & 0000010) << 1) | ((ac & 0000001) << 5));
399399
r3679r3680
408408   int ac;
409409
410410   /* read current AC */
411   ac = cpunum_get_reg(0, TX0_AC);
411   ac = cpu_get_reg(Machine->cpu[0], TX0_AC);
412412   /* shuffle and punch 6-bit word */
413413   tape_write(((ac & 0100000) >> 15) | ((ac & 0010000) >> 11) | ((ac & 0001000) >> 7) | ((ac & 0000100) >> 3) | ((ac & 0000010) << 1) | ((ac & 0000001) << 5) | 0100);
414414
r3679r3680
454454*/
455455static TIMER_CALLBACK(prt_callback)
456456{
457   tx0_pulse_io_complete();
457   cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0);
458458}
459459
460460/*
r3679r3680
466466   int ch;
467467
468468   /* read current AC */
469   ac = cpunum_get_reg(0, TX0_AC);
469   ac = cpu_get_reg(Machine->cpu[0], TX0_AC);
470470   /* shuffle and print 6-bit word */
471471   ch = ((ac & 0100000) >> 15) | ((ac & 0010000) >> 11) | ((ac & 0001000) >> 7) | ((ac & 0000100) >> 3) | ((ac & 0000010) << 1) | ((ac & 0000001) << 5);
472472   typewriter_out(Machine, ch);
r3679r3680
480480*/
481481static TIMER_CALLBACK(dis_callback)
482482{
483   tx0_pulse_io_complete();
483   cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0);
484484}
485485
486486/*
r3679r3680
492492   int x;
493493   int y;
494494
495   ac = cpunum_get_reg(0, TX0_AC);
495   ac = cpu_get_reg(Machine->cpu[0], TX0_AC);
496496   x = ac >> 9;
497497   y = ac & 0777;
498498   tx0_plot(x, y);
r3679r3680
595595      if ((magtape.state == MTS_SELECTED) || ((magtape.state == MTS_SELECTING) && (magtape.command == 2)))
596596      {   /* unit has become unavailable */
597597         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);
599599         schedule_unselect();
600600      }
601601   }
r3679r3680
618618      {
619619         int mar;
620620
621         mar = cpunum_get_reg(0, TX0_MAR);
621         mar = cpu_get_reg(Machine->cpu[0], TX0_MAR);
622622
623623         if ((mar & 03) != 1)
624624         {   /* unimplemented device: remain in unselected state and set rwc
625625            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);
627627         }
628628         else
629629         {
r3679r3680
638638         }
639639
640640         magtape.sel_pending = FALSE;
641         tx0_pulse_io_complete();
641         cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0);
642642      }
643643      break;
644644
r3679r3680
681681         if (image_ftell(magtape.img) == 0)
682682         {   /* tape at ldp */
683683            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);
685685            schedule_unselect();
686686         }
687687         else if (image_fseek(magtape.img, -1, SEEK_CUR))
r3679r3680
750750                     logerror("invalid longitudinal parity\n");
751751                  /* set EOR and unselect... */
752752                  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);
754754                  schedule_unselect();
755755                  magtape.irg_pos = MTIRGP_ENDMINUS1;
756756               }
r3679r3680
806806               /*image_unload(magtape.img);*/
807807               /* Or do we stop at EOT mark??? */
808808               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);
810810               schedule_unselect();
811811            }
812812         }
r3679r3680
823823                  if (magtape.cpy_pending)
824824                  {   /* read command */
825825                     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)
828828                                          | ((buf & 040) << 12) | ((buf & 020) << 10) | ((buf & 010) << 8) | ((buf & 004) << 6) | ((buf & 002) << 4) | ((buf & 001) << 2));
829829                     /* check parity */
830830                     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);
832832                  }
833833                  else
834834                  {   /* space command */
r3679r3680
847847               }
848848               if (!magtape.u.read.space_flag)
849849               {
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)
851851                                       | ((buf & 040) << 12) | ((buf & 020) << 10) | ((buf & 010) << 8) | ((buf & 004) << 6) | ((buf & 002) << 4) | ((buf & 001) << 2));
852852                  /* check parity */
853853                  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);
855855               }
856856               magtape.u.read.state = MTRDS_STATE2;
857857               break;
r3679r3680
865865               }
866866               if (!magtape.u.read.space_flag)
867867               {
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)
869869                                       | ((buf & 040) << 12) | ((buf & 020) << 10) | ((buf & 010) << 8) | ((buf & 004) << 6) | ((buf & 002) << 4) | ((buf & 001) << 2));
870870                  /* check parity */
871871                  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);
873873                  /* synchronize with cpy instruction */
874874                  if (magtape.cpy_pending)
875                     tx0_pulse_io_complete();
875                     cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0);
876876                  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);
878878               }
879879               magtape.u.read.state = MTRDS_STATE3;
880880               break;
r3679r3680
886886                  magtape.u.read.state = MTRDS_STATE1;
887887                  if (!magtape.u.read.space_flag)
888888                  {
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)
890890                                          | ((buf & 040) << 12) | ((buf & 020) << 10) | ((buf & 010) << 8) | ((buf & 004) << 6) | ((buf & 002) << 4) | ((buf & 001) << 2));
891891                     /* check parity */
892892                     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);
894894                  }
895895               }
896896               else
r3679r3680
930930                  logerror("invalid longitudinal parity\n");
931931                  /* no idea if the original tx-0 magtape controller
932932                  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);
934934               }
935935               /* set EOR and unselect... */
936936               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);
938938               schedule_unselect();
939939               magtape.irg_pos = MTIRGP_START;
940940               break;
r3679r3680
972972            if (magtape.u.write.counter)
973973            {
974974               magtape.u.write.counter--;
975               lr = cpunum_get_reg(0, TX0_LR);
975               lr = cpu_get_reg(Machine->cpu[0], TX0_LR);
976976               buf = ((lr >> 10) & 040) | ((lr >> 8) & 020) | ((lr >> 6) & 010) | ((lr >> 4) & 004) | ((lr >> 2) & 002) | (lr & 001);
977977               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);
979979            }
980980            else
981981            {
982982               if (magtape.cpy_pending)
983983               {
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);
986986                  buf = ((lr >> 10) & 040) | ((lr >> 8) & 020) | ((lr >> 6) & 010) | ((lr >> 4) & 004) | ((lr >> 2) & 002) | (lr & 001);
987987                  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);
989989                  magtape.u.write.counter = 2;
990990                  break;
991991               }
r3679r3680
10621062   case MTS_UNSELECTED:
10631063   case MTS_UNSELECTING:
10641064      /* ignore instruction and set rwc flag? */
1065      tx0_pulse_io_complete();
1065      cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0);
10661066      break;
10671067
10681068   case MTS_SELECTING:
r3679r3680
10721072      case 0:   /* backspace */
10731073      case 2:   /* rewind */
10741074         /* ignore instruction and set rwc flag? */
1075         tx0_pulse_io_complete();
1075         cpu_set_reg(Machine->cpu[0], TX0_IO_COMPLETE, 0);
10761076         break;
10771077      case 1:   /* read */
10781078      case 3:   /* write */
r3679r3680
11391139         previous LR */
11401140         lr = (1 << 17) | ((charcode & 040) << 10) | ((charcode & 020) << 8) | ((charcode & 010) << 6) | ((charcode & 004) << 4) | ((charcode & 002) << 2) | ((charcode & 001) << 1);
11411141         /* write modified LR */
1142         cpu_set_reg(machine->cpu[0], TX0_LR, lr);
1142         cpu_set_reg(Machine->cpu[0], TX0_LR, lr);
11431143         tx0_typewriter_drawchar(machine, charcode);   /* we want to echo input */
11441144         break;
11451145      }
r3679r3680
11661166
11671167
11681168   /* read new state of control keys */
1169   control_keys = input_port_read(machine, "CSW");
1169   control_keys = input_port_read(device->machine, "CSW");
11701170
11711171   if (control_keys & tx0_control)
11721172   {
r3679r3680
11751175
11761176      if (control_transitions & tx0_stop_cyc0)
11771177      {
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));
11791179      }
11801180      if (control_transitions & tx0_stop_cyc1)
11811181      {
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));
11831183      }
11841184      if (control_transitions & tx0_gbl_cm_sel)
11851185      {
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));
11871187      }
11881188      if (control_transitions & tx0_stop)
11891189      {
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);
11921192      }
11931193      if (control_transitions & tx0_restart)
11941194      {
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);
11971197      }
11981198      if (control_transitions & tx0_read_in)
11991199      {   /* 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);
12031203      }
12041204      if (control_transitions & tx0_toggle_dn)
12051205      {
r3679r3680
12171217      {
12181218         if (tsr_index >= 2)
12191219         {
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)));
12221222         }
12231223      }
12241224      if (control_transitions & tx0_lr_sel)
12251225      {
12261226         if (tsr_index >= 2)
12271227         {
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))));
12301230         }
12311231      }
12321232
r3679r3680
12351235
12361236
12371237      /* 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");
12391239
12401240      /* compute transitions */
12411241      tsr_transitions = tsr_keys & (~ old_tsr_keys);
12421242
12431243      /* update toggle switch register */
12441244      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);
12461246
12471247      /* remember new state of toggle switch register keys */
12481248      old_tsr_keys = tsr_keys;
r3679r3680
12521252      old_control_keys = 0;
12531253      old_tsr_keys = 0;
12541254
1255      tx0_keyboard(machine);
1255      tx0_keyboard(device->machine);
12561256   }
12571257}
12581258
src/mess/machine/99_peb.c
r3679r3680
122122   {
123123      struct
124124      {
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) */
127127      } width_8bit;
128128      struct
129129      {
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) */
132132      } width_16bit;
133133   } w;
134134} ti99_4p_peb_card_handlers_t;
r3679r3680
335335   port = (offset & 0x00f0) >> 4;
336336   handler = expansion_ports[port].cru_read;
337337
338   reply = (handler) ? (*handler)(machine, offset & 0xf) : 0;
338   reply = (handler) ? (*handler)(space->machine, offset & 0xf) : 0;
339339
340340   return reply;
341341}
r3679r3680
352352   handler = expansion_ports[port].cru_write;
353353
354354   if (handler)
355      (*handler)(machine, offset & 0x7f, data);
355      (*handler)(space->machine, offset & 0x7f, data);
356356
357357   /* expansion card enable? */
358358   if ((offset & 0x7f) == 0)
r3679r3680
378378READ16_HANDLER ( ti99_4x_peb_r )
379379{
380380   int reply = 0;
381   read8_machine_func handler;
381   read8_space_func handler;
382382
383   activecpu_adjust_icount(-4);
383   cpu_adjust_icount(space->machine->cpu[0],-4);
384384
385385   if (active_card != -1)
386386   {
387387      handler = expansion_ports[active_card].mem_read;
388388      if (handler)
389389      {
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;
392392      }
393393   }
394394
r3679r3680
400400*/
401401WRITE16_HANDLER ( ti99_4x_peb_w )
402402{
403   write8_machine_func handler;
403   write8_space_func handler;
404404
405   activecpu_adjust_icount(-4);
405   cpu_adjust_icount(space->machine->cpu[0],-4);
406406
407407   /* simulate byte write */
408408   data = (tmp_buffer & ~mem_mask) | (data & mem_mask);
r3679r3680
412412      handler = expansion_ports[active_card].mem_write;
413413      if (handler)
414414      {
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);
417417      }
418418   }
419419}
r3679r3680
431431   port = (offset & 0x00f0) >> 4;
432432   handler = expansion_ports[port].cru_read;
433433
434   reply = (handler) ? (*handler)(machine, offset & 0xf) : 0;
434   reply = (handler) ? (*handler)(space->machine, offset & 0xf) : 0;
435435
436436   return reply;
437437}
r3679r3680
448448   handler = expansion_ports[port].cru_write;
449449
450450   if (handler)
451      (*handler)(machine, offset & 0x7f, data);
451      (*handler)(space->machine, offset & 0x7f, data);
452452
453453   /* expansion card enable? */
454454   if ((offset & 0x7f) == 0)
r3679r3680
474474 READ8_HANDLER ( geneve_peb_r )
475475{
476476   int reply = 0;
477   read8_machine_func handler;
477   read8_space_func handler;
478478
479   activecpu_adjust_icount(-8);
479   cpu_adjust_icount(space->machine->cpu[0],-8);
480480
481481   if (active_card != -1)
482482   {
483483            handler = expansion_ports[active_card].mem_read;
484484      if (handler)
485         reply = (*handler)(machine, offset);
485         reply = (*handler)(space, offset);
486486   }
487487
488488   return reply;
r3679r3680
493493*/
494494WRITE8_HANDLER ( geneve_peb_w )
495495{
496   write8_machine_func handler;
496   write8_space_func handler;
497497
498   activecpu_adjust_icount(-8);
498   cpu_adjust_icount(space->machine->cpu[0],-8);
499499
500500   if (active_card != -1)
501501   {
502502      handler = expansion_ports[active_card].mem_write;
503503      if (handler)
504         (*handler)(machine, offset, data);
504         (*handler)(space, offset, data);
505505   }
506506}
507507
r3679r3680
517517   port = (offset & 0x01f0) >> 4;
518518   handler = expansion_ports[port].cru_read;
519519
520   reply = (handler) ? (*handler)(machine, offset & 0xf) : 0;
520   reply = (handler) ? (*handler)(space->machine, offset & 0xf) : 0;
521521
522522   return reply;
523523}
r3679r3680
534534   handler = expansion_ports[port].cru_write;
535535
536536   if (handler)
537      (*handler)(machine, offset & 0x7f, data);
537      (*handler)(space->machine, offset & 0x7f, data);
538538
539539   /* expansion card enable? */
540540   if ((offset & 0x7f) == 0)
r3679r3680
560560 READ8_HANDLER ( ti99_8_peb_r )
561561{
562562   int reply = 0;
563   read8_machine_func handler;
563   read8_space_func handler;
564564
565   activecpu_adjust_icount(-4);
565   cpu_adjust_icount(space->machine->cpu[0],-4);
566566
567567   if (active_card != -1)
568568   {
569569      handler = expansion_ports[active_card].mem_read;
570570      if (handler)
571         reply = (*handler)(machine, offset);
571         reply = (*handler)(space, offset);
572572   }
573573
574574   return reply;
r3679r3680
579579*/
580580WRITE8_HANDLER ( ti99_8_peb_w )
581581{
582   write8_machine_func handler;
582   write8_space_func handler;
583583
584   activecpu_adjust_icount(-4);
584   cpu_adjust_icount(space->machine->cpu[0],-4);
585585
586586   if (active_card != -1)
587587   {
588588      handler = expansion_ports[active_card].mem_write;
589589      if (handler)
590         (*handler)(machine, offset, data);
590         (*handler)(space, offset, data);
591591   }
592592}
593593
r3679r3680
603603   port = offset >> 4;
604604   handler = ti99_4p_expansion_ports[port].cru_read;
605605
606   reply = (handler) ? (*handler)(machine, offset & 0xf) : 0;
606   reply = (handler) ? (*handler)(space->machine, offset & 0xf) : 0;
607607
608608   return reply;
609609}
r3679r3680
620620   handler = ti99_4p_expansion_ports[port].cru_write;
621621
622622   if (handler)
623      (*handler)(machine, offset & 0x7f, data);
623      (*handler)(space->machine, offset & 0x7f, data);
624624
625625   /* expansion card enable? */
626626   if ((offset & 0x7f) == 0)
r3679r3680
664664READ16_HANDLER ( ti99_4p_peb_r )
665665{
666666   int reply = 0;
667   read8_machine_func handler;
668   read16_machine_func handler16;
667   read8_space_func handler;
668   read16_space_func handler16;
669669
670670
671671   if (active_card == -1)
672      activecpu_adjust_icount(-4);   /* ??? */
672      cpu_adjust_icount(space->machine->cpu[0],-4);   /* ??? */
673673   else
674674   {
675675
676676      if (ti99_4p_expansion_ports[active_card].width == width_8bit)
677677      {
678         activecpu_adjust_icount(-4);
678         cpu_adjust_icount(space->machine->cpu[0],-4);
679679
680680         handler = ti99_4p_expansion_ports[active_card].w.width_8bit.mem_read;
681681         if (handler)
682682         {
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;
685685         }
686686      }
687687      else
688688      {
689         activecpu_adjust_icount(-1);   /* ??? */
689         cpu_adjust_icount(space->machine->cpu[0],-1);   /* ??? */
690690
691691         handler16 = ti99_4p_expansion_ports[active_card].w.width_16bit.mem_read;
692692         if (handler16)
693            reply = (*handler16)(machine, offset, /*mem_mask*/0xffff);
693            reply = (*handler16)(space, offset, /*mem_mask*/0xffff);
694694      }
695695   }
696696
r3679r3680
714714*/
715715WRITE16_HANDLER ( ti99_4p_peb_w )
716716{
717   write8_machine_func handler;
718   write16_machine_func handler16;
717   write8_space_func handler;
718   write16_space_func handler16;
719719
720720   if (active_card == -1)
721      activecpu_adjust_icount(-4);   /* ??? */
721      cpu_adjust_icount(space->machine->cpu[0],-4);   /* ??? */
722722   else
723723   {
724724      /* simulate byte write */
r3679r3680
726726
727727      if (ti99_4p_expansion_ports[active_card].width == width_8bit)
728728      {
729         activecpu_adjust_icount(-4);
729         cpu_adjust_icount(space->machine->cpu[0],-4);
730730
731731         handler = ti99_4p_expansion_ports[active_card].w.width_8bit.mem_write;
732732         if (handler)
733733         {
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);
736736         }
737737      }
738738      else
739739      {
740         activecpu_adjust_icount(-1);   /* ??? */
740         cpu_adjust_icount(space->machine->cpu[0],-1);   /* ??? */
741741
742742         handler16 = ti99_4p_expansion_ports[active_card].w.width_16bit.mem_write;
743743         if (handler16)
744            (*handler16)(machine, offset, data, /*mem_mask*/0xffff);
744            (*handler16)(space, offset, data, /*mem_mask*/0xffff);
745745      }
746746   }
747747}
src/mess/machine/99_peb.h
r3679r3680
1616   cru_read_handler cru_read;      /* card CRU read handler */
1717   cru_write_handler cru_write;   /* card CRU handler */
1818
19   read8_machine_func mem_read;      /* card mem read handler (8 bits) */
20   write8_machine_func mem_write;   /* card mem write handler (8 bits) */
19   read8_space_func mem_read;      /* card mem read handler (8 bits) */
20   write8_space_func mem_write;   /* card mem write handler (8 bits) */
2121} ti99_peb_card_handlers_t;
2222
2323/*
r3679r3680
3030   cru_read_handler cru_read;      /* card CRU read handler */
3131   cru_write_handler cru_write;   /* card CRU handler */
3232
33   read16_machine_func mem_read;      /* card mem read handler (16 bits) */
34   write16_machine_func mem_write;      /* card mem write handler (16 bits) */
33   read16_space_func mem_read;      /* card mem read handler (16 bits) */
34   write16_space_func mem_write;      /* card mem write handler (16 bits) */
3535} ti99_peb_16bit_card_handlers_t;
3636
3737/* masks for ila and ilb */
src/mess/machine/samcoupe.c
r3679r3680
2424
2525static void samcoupe_update_bank(running_machine *machine, int bank, UINT8 *memory, int is_readonly)
2626{
27   read8_machine_func rh = SMH_NOP;
28   write8_machine_func wh = SMH_NOP;
27   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
28   read8_space_func rh = SMH_NOP;
29   write8_space_func wh = SMH_NOP;
2930
3031   if (memory)
3132   {
32      memory_set_bankptr(bank, memory);
33      rh = (read8_machine_func) (STATIC_BANK1 + (FPTR)bank - 1);
34      wh = is_readonly ? SMH_UNMAP : (write8_machine_func) (STATIC_BANK1 + (FPTR)bank - 1);
33      memory_set_bankptr(machine,bank, memory);
34      rh = (read8_space_func) (STATIC_BANK1 + (FPTR)bank - 1);
35      wh = is_readonly ? SMH_UNMAP : (write8_space_func) (STATIC_BANK1 + (FPTR)bank - 1);
3536   }
3637
37   memory_install_read8_handler(machine, 0,  ADDRESS_SPACE_PROGRAM, ((bank-1) * 0x4000), ((bank-1) * 0x4000) + 0x3FFF, 0, 0, rh);
38   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, ((bank-1) * 0x4000), ((bank-1) * 0x4000) + 0x3FFF, 0, 0, wh);
38   memory_install_read8_handler(space, ((bank-1) * 0x4000), ((bank-1) * 0x4000) + 0x3FFF, 0, 0, rh);
39   memory_install_write8_handler(space, ((bank-1) * 0x4000), ((bank-1) * 0x4000) + 0x3FFF, 0, 0, wh);
3940}
4041
4142
r3679r3680
142143   /* external RAM enabled? */
143144   if (samcoupe_regs.hmpr & HMPR_MCNTRL)
144145   {
145      samcoupe_install_ext_mem(machine);
146      samcoupe_install_ext_mem(space->machine);
146147   }
147148}
148149
149150
150151static READ8_HANDLER( samcoupe_rtc_r )
151152{
152   const device_config *rtc = device_list_find_by_tag(machine->config->devicelist, MSM6242, "sambus_clock");
153   const device_config *rtc = device_list_find_by_tag(space->machine->config->devicelist, MSM6242, "sambus_clock");
153154   return msm6242_r(rtc, offset >> 12);
154155}
155156
156157
157158static WRITE8_HANDLER( samcoupe_rtc_w )
158159{
159   const device_config *rtc = device_list_find_by_tag(machine->config->devicelist, MSM6242, "sambus_clock");
160   const device_config *rtc = device_list_find_by_tag(space->machine->config->devicelist, MSM6242, "sambus_clock");
160161   msm6242_w(rtc, offset >> 12, data);
161162}
162163
163164
164165MACHINE_RESET( samcoupe )
165166{
167   const address_space *spaceio = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO);
166168   memset(&samcoupe_regs, 0, sizeof(samcoupe_regs));
167169   
168170   samcoupe_regs.lmpr = 0x0f;      /* ROM0 paged in, ROM1 paged out RAM Banks */
r3679r3680
174176   if (input_port_read(machine, "config") & 0x01)
175177   {
176178      /* install RTC */
177      memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0xef, 0xef, 0xffff, 0xff00, samcoupe_rtc_r, samcoupe_rtc_w);
179      memory_install_readwrite8_handler(spaceio, 0xef, 0xef, 0xffff, 0xff00, samcoupe_rtc_r, samcoupe_rtc_w);
178180   }
179181   else
180182   {
181183      /* no RTC support */
182      memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_IO, 0xef, 0xef, 0xffff, 0xff00, SMH_UNMAP, SMH_UNMAP);
184      memory_install_readwrite8_handler(spaceio, 0xef, 0xef, 0xffff, 0xff00, SMH_UNMAP, SMH_UNMAP);
183185   }
184186
185187   samcoupe_update_memory(machine);
src/mess/machine/990_tap.c
r3679r3680
223223/*
224224   Handle the read binary forward command: read the next record on tape.
225225*/
226static void cmd_read_binary_forward(void)
226static void cmd_read_binary_forward(running_machine *machine)
227227{
228228   UINT8 buffer[256];
229229   int reclen;
r3679r3680
359359      /* DMA */
360360      for (i=0; i<bytes_read; i+=2)
361361      {
362         program_write_word_16be(dma_address, (((int) buffer[i]) << 8) | buffer[i+1]);
362         memory_write_word_16be(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM),dma_address, (((int) buffer[i]) << 8) | buffer[i+1]);
363363         dma_address = (dma_address + 2) & 0x1ffffe;
364364      }
365365
r3679r3680
868868/*
869869   Parse command code and execute the command.
870870*/
871static void execute_command(void)
871static void execute_command(running_machine *machine)
872872{
873873   /* hack */
874874   tpc.w[0] &= 0xff;
r3679r3680
904904   case 0x04:
905905      /* read binary forward */
906906      logerror("read binary forward\n");
907      cmd_read_binary_forward();
907      cmd_read_binary_forward(machine);
908908      break;
909909   case 0x05:
910910      /* record skip forward - not tested */
r3679r3680
983983
984984         if ((offset == 7) && (old_data & w7_idle) && ! (data & w7_idle))
985985         {   /* idle has been cleared: start command execution */
986            execute_command();
986            execute_command(space->machine);
987987         }
988988      }
989989   }
src/mess/machine/geneve.c
r3679r3680
181181};
182182
183183/* tms9995_ICount: used to implement memory waitstates (hack) */
184/* NPW 23-Feb-2004 - externs no longer needed because we now use activecpu_adjust_icount() */
184/* NPW 23-Feb-2004 - externs no longer needed because we now use cpu_adjust_icount(space->machine->cpu[0],) */
185185
186186
187187
r3679r3680
331331   if (++line_count == 262)
332332   {
333333      line_count = 0;
334      poll_keyboard(machine);
335      poll_mouse(machine);
334      poll_keyboard(device->machine);
335      poll_mouse(device->machine);
336336   }
337337}
338338
r3679r3680
368368*/
369369static  READ8_HANDLER ( geneve_speech_r )
370370{
371   activecpu_adjust_icount(-8);      /* this is just a minimum, it can be more */
371   cpu_adjust_icount(space->machine->cpu[0],-8);      /* this is just a minimum, it can be more */
372372
373   return tms5220_status_r(machine, offset);
373   return tms5220_status_r(space, offset);
374374}
375375
376376#if 0
r3679r3680
394394*/
395395static WRITE8_HANDLER ( geneve_speech_w )
396396{
397   activecpu_adjust_icount(-32*4);      /* this is just an approx. minimum, it can be much more */
397   cpu_adjust_icount(space->machine->cpu[0],-32*4);      /* this is just an approx. minimum, it can be much more */
398398
399399#if 1
400400   /* the stupid design of the tms5220 core means that ready is cleared when
r3679r3680
408408
409409      logerror("time to ready: %f -> %d\n", attotime_to_double(time_to_ready), (int) cycles_to_ready);
410410
411      activecpu_adjust_icount(-cycles_to_ready);
411      cpu_adjust_icount(space->machine->cpu[0],-cycles_to_ready);
412412      timer_set(attotime_zero, NULL, 0, /*speech_kludge_callback*/NULL);
413413   }
414414#endif
415415
416   tms5220_data_w(machine, offset, data);
416   tms5220_data_w(space, offset, data);
417417}
418418
419419READ8_HANDLER ( geneve_r )
r3679r3680
435435         {
436436         case 0xf100:
437437         case 0xf108:      /* mirror? */
438            return v9938_0_vram_r(machine, 0);
438            return v9938_0_vram_r(space, 0);
439439
440440         case 0xf102:
441441         case 0xf10a:      /* mirror? */
442            return v9938_0_status_r(machine, 0);
442            return v9938_0_status_r(space, 0);
443443
444444         case 0xf110:
445445         case 0xf111:
r3679r3680
535535            {
536536               if (offset & 2)
537537               {   /* read VDP status */
538                  return v9938_0_status_r(machine, 0);
538                  return v9938_0_status_r(space, 0);
539539               }
540540               else
541541               {   /* read VDP RAM */
542                  return v9938_0_vram_r(machine, 0);
542                  return v9938_0_vram_r(space, 0);
543543               }
544544            }
545545            return 0;
r3679r3680
548548            /* speech read */
549549            if ((! (offset & 1)) && has_speech)
550550            {
551               return geneve_speech_r(machine, 0);
551               return geneve_speech_r(space, 0);
552552            }
553553            return 0;
554554
r3679r3680
643643#endif
644644   case 0xba:
645645      /* DSR space */
646      return geneve_peb_r(machine, offset);
646      return geneve_peb_r(space, offset);
647647
648648   case 0xbc:
649649      /* speech space */
650650      if (has_speech)
651651      {
652652         if ((offset >= 0x1000) && (offset < 0x1400) && (! (offset & 1)))
653            return geneve_speech_r(machine, 0);
653            return geneve_speech_r(space, 0);
654654         else
655655            return 0;
656656      }
r3679r3680
679679         {
680680         case 0xf100:
681681         case 0xf108:      /* mirror? */
682            v9938_0_vram_w(machine, 0, data);
682            v9938_0_vram_w(space, 0, data);
683683            return;
684684
685685         case 0xf102:
686686         case 0xf10a:      /* mirror? */
687            v9938_0_command_w(machine, 0, data);
687            v9938_0_command_w(space, 0, data);
688688            return;
689689
690690         case 0xf104:
691691         case 0xf10c:      /* mirror? */
692            v9938_0_palette_w(machine, 0, data);
692            v9938_0_palette_w(space, 0, data);
693693            return;
694694
695695         case 0xf106:
696696         case 0xf10e:      /* mirror? */
697            v9938_0_register_w(machine, 0, data);
697            v9938_0_register_w(space, 0, data);
698698            return;
699699
700700         case 0xf110:
r3679r3680
713713            return*/
714714
715715         case 0xf120:
716            sn76496_0_w(machine, 0, data);
716            sn76496_0_w(space, 0, data);
717717            break;
718718
719719         case 0xf130:
r3679r3680
797797         {
798798         case 1:
799799            /* sound write */
800            sn76496_0_w(machine, 0, data);
800            sn76496_0_w(space, 0, data);
801801            return;
802802
803803         case 3:
r3679r3680
809809               {
810810               case 0:
811811                  /* write VDP RAM */
812                  v9938_0_vram_w(machine, 0, data);
812                  v9938_0_vram_w(space, 0, data);
813813                  break;
814814               case 1:
815815                  /* write VDP address */
816                  v9938_0_command_w(machine, 0, data);
816                  v9938_0_command_w(space, 0, data);
817817                  break;
818818               case 2:
819819                  /* write palette */
820                  v9938_0_palette_w(machine, 0, data);
820                  v9938_0_palette_w(space, 0, data);
821821                  break;
822822               case 3:
823823                  /* write register */
824                  v9938_0_register_w(machine, 0, data);
824                  v9938_0_register_w(space, 0, data);
825825                  break;
826826               }
827827            }
r3679r3680
831831            /* speech write */
832832            if ((! (offset & 1)) && has_speech)
833833            {
834               geneve_speech_w(machine, 0, data);
834               geneve_speech_w(space, 0, data);
835835            }
836836            return;
837837
r3679r3680
935935#endif
936936   case 0xba:
937937      /* DSR space */
938      geneve_peb_w(machine, offset, data);
938      geneve_peb_w(space, offset, data);
939939      return;
940940
941941   case 0xbc:
r3679r3680
943943      if (has_speech)
944944      {
945945         if ((offset >= 0x1400) && (offset < 0x1800) && (! (offset & 1)))
946            geneve_speech_w(machine, 0, data);
946            geneve_speech_w(space, 0, data);
947947         return;
948948      }
949949
r3679r3680
10041004      }
10051005   }
10061006
1007   geneve_peb_cru_w(machine, offset, data);
1007   geneve_peb_cru_w(space, offset, data);
10081008}
10091009
10101010/*===========================================================================*/
src/mess/machine/99_ide.c
r3679r3680
249249      case 2:      /* IDE registers set 1 (CS1Fx) */
250250         if (tms9995_mode ? (!(offset & 1)) : (offset & 1))
251251         {   /* first read triggers 16-bit read cycle */
252            const device_config *ide_device = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide");
252            const device_config *ide_device = device_list_find_by_tag(space->machine->config->devicelist, IDE_CONTROLLER, "ide");
253253            input_latch = (! (offset & 0x10)) ? ide_bus_r(ide_device, 0, (offset >> 1) & 0x7) : 0;
254254         }
255255
r3679r3680
261261      case 3:      /* IDE registers set 2 (CS3Fx) */
262262         if (tms9995_mode ? (!(offset & 1)) : (offset & 1))
263263         {   /* first read triggers 16-bit read cycle */
264            const device_config *ide_device = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide");
264            const device_config *ide_device = device_list_find_by_tag(space->machine->config->devicelist, IDE_CONTROLLER, "ide");
265265            input_latch = (! (offset & 0x10)) ? ide_bus_r(ide_device, 1, (offset >> 1) & 0x7) : 0;
266266         }
267267
r3679r3680
327327
328328         if (tms9995_mode ? (offset & 1) : (!(offset & 1)))
329329         {   /* second write triggers 16-bit write cycle */
330            const device_config *ide_device = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide");
330            const device_config *ide_device = device_list_find_by_tag(space->machine->config->devicelist, IDE_CONTROLLER, "ide");
331331            ide_bus_w(ide_device, 0, (offset >> 1) & 0x7, output_latch);
332332         }
333333         break;
r3679r3680
345345
346346         if (tms9995_mode ? (offset & 1) : (!(offset & 1)))
347347         {   /* second write triggers 16-bit write cycle */
348            const device_config *ide_device = device_list_find_by_tag(machine->config->devicelist, IDE_CONTROLLER, "ide");
348            const device_config *ide_device = device_list_find_by_tag(space->machine->config->devicelist, IDE_CONTROLLER, "ide");
349349            ide_bus_w(ide_device, 1, (offset >> 1) & 0x7, output_latch);
350350         }
351351         break;
src/mess/machine/ti99_4x.c
r3679r3680
385385
386386/* tms9900_ICount: used to implement memory waitstates (hack) */
387387/* 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],) */
389389
390390
391391
r3679r3680
775775*/
776776MACHINE_RESET( ti99 )
777777{
778   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
778779   /*console_GROMs.data_ptr = memory_region(machine, region_grom);*/
779780   console_GROMs.addr = 0;
780781
r3679r3680
858859
859860      if (ti99_model != model_99_8)
860861      {
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);
863864
864865         sndti_set_info_int(SOUND_TMS5220, 0, SNDINFO_INT_TMS5220_VARIANT, variant_tmc0285);
865866      }
r3679r3680
868869   {
869870      if (ti99_model != model_99_8)
870871      {
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);
873874      }
874875   }
875876
r3679r3680
877878   {
878879   case xRAM_kind_none:
879880   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);
884885      break;
885886   case xRAM_kind_TI:
886887      ti99_TIxram_init(machine);
r3679r3680
981982*/
982983INTERRUPT_GEN( ti99_vblank_interrupt )
983984{
984   TMS9928A_interrupt(machine);
985   TMS9928A_interrupt(device->machine);
985986   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;
988989   if (has_mecmouse)
989      mecmouse_poll(machine);
990      mecmouse_poll(device->machine);
990991}
991992
992993INTERRUPT_GEN( ti99_4ev_hblank_interrupt )
r3679r3680
996997   if (++line_count == 262)
997998   {
998999      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;
10001001      if (has_mecmouse)
1001         mecmouse_poll(machine);
1002         mecmouse_poll(device->machine);
10021003   }
10031004}
10041005
r3679r3680
10291030*/
10301031READ16_HANDLER ( ti99_nop_8_r )
10311032{
1032   activecpu_adjust_icount(-4);
1033   cpu_adjust_icount(space->machine->cpu[0],-4);
10331034
10341035   return (0);
10351036}
10361037
10371038WRITE16_HANDLER ( ti99_nop_8_w )
10381039{
1039   activecpu_adjust_icount(-4);
1040   cpu_adjust_icount(space->machine->cpu[0],-4);
10401041}
10411042
10421043/*
r3679r3680
10541055*/
10551056READ16_HANDLER ( ti99_cart_r )
10561057{
1057   activecpu_adjust_icount(-4);
1058   cpu_adjust_icount(space->machine->cpu[0],-4);
10581059
10591060   if (hsgpl_crdena)
10601061      /* hsgpl is enabled */
1061      return ti99_hsgpl_rom6_r(machine, offset, mem_mask);
1062      return ti99_hsgpl_rom6_r(space, offset, mem_mask);
10621063
10631064   if (cartridge_mbx && (offset >= 0x0600) && (offset <= 0x07fe))
10641065      return (cartridge_pages[0])[offset];
r3679r3680
10681069
10691070WRITE16_HANDLER ( ti99_cart_w )
10701071{
1071   activecpu_adjust_icount(-4);
1072   cpu_adjust_icount(space->machine->cpu[0],-4);
10721073
10731074   if (hsgpl_crdena)
10741075      /* hsgpl is enabled */
1075      ti99_hsgpl_rom6_w(machine, offset, data, mem_mask);
1076      ti99_hsgpl_rom6_w(space, offset, data, mem_mask);
10761077   else if (cartridge_minimemory && offset >= 0x800)
10771078      /* handle minimem RAM */
10781079      COMBINE_DATA(current_page_ptr+offset);
r3679r3680
10981099   if (ti99_4p_internal_rom6_enable)
10991100      return ti99_4p_internal_ROM6[offset];
11001101
1101   activecpu_adjust_icount(-4);
1102   cpu_adjust_icount(space->machine->cpu[0],-4);
11021103
11031104   if (hsgpl_crdena)
11041105      /* hsgpl is enabled */
1105      return ti99_hsgpl_rom6_r(machine, offset, mem_mask);
1106      return ti99_hsgpl_rom6_r(space, offset, mem_mask);
11061107
11071108   return 0;
11081109}
r3679r3680
11111112{
11121113   if (ti99_4p_internal_rom6_enable)
11131114   {
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));
11151116      return;
11161117   }
11171118
1118   activecpu_adjust_icount(-4);
1119   cpu_adjust_icount(space->machine->cpu[0],-4);
11191120
11201121   if (hsgpl_crdena)
11211122      /* hsgpl is enabled */
1122      ti99_hsgpl_rom6_w(machine, offset, data, mem_mask);
1123      ti99_hsgpl_rom6_w(space, offset, data, mem_mask);
11231124}
11241125
11251126/*---------------------------------------------------------------------------*/
r3679r3680
11571158*/
11581159WRITE16_HANDLER ( ti99_wsnd_w )
11591160{
1160   activecpu_adjust_icount(-4);
1161   cpu_adjust_icount(space->machine->cpu[0],-4);
11611162
1162   sn76496_0_w(machine, offset, (data >> 8) & 0xff);
1163   sn76496_0_w(space, offset, (data >> 8) & 0xff);
11631164}
11641165
11651166/*
r3679r3680
11671168*/
11681169READ16_HANDLER ( ti99_rvdp_r )
11691170{
1170   activecpu_adjust_icount(-4);
1171   cpu_adjust_icount(space->machine->cpu[0],-4);
11711172
11721173   if (offset & 1)
11731174   {   /* read VDP status */
1174      return ((int) TMS9928A_register_r(machine, 0)) << 8;
1175      return ((int) TMS9928A_register_r(space, 0)) << 8;
11751176   }
11761177   else
11771178   {   /* read VDP RAM */
1178      return ((int) TMS9928A_vram_r(machine, 0)) << 8;
1179      return ((int) TMS9928A_vram_r(space, 0)) << 8;
11791180   }
11801181}
11811182
r3679r3680
11841185*/
11851186WRITE16_HANDLER ( ti99_wvdp_w )
11861187{
1187   activecpu_adjust_icount(-4);
1188   cpu_adjust_icount(space->machine->cpu[0],-4);
11881189
11891190   if (offset & 1)
11901191   {   /* write VDP address */
1191      TMS9928A_register_w(machine, 0, (data >> 8) & 0xff);
1192      TMS9928A_register_w(space, 0, (data >> 8) & 0xff);
11921193   }
11931194   else
11941195   {   /* write VDP data */
1195      TMS9928A_vram_w(machine, 0, (data >> 8) & 0xff);
1196      TMS9928A_vram_w(space, 0, (data >> 8) & 0xff);
11961197   }
11971198}
11981199
r3679r3680
12011202*/
12021203READ16_HANDLER ( ti99_rv38_r )
12031204{
1204   activecpu_adjust_icount(-4);
1205   cpu_adjust_icount(space->machine->cpu[0],-4);
12051206
12061207   if (offset & 1)
12071208   {   /* read VDP status */
1208      return ((int) v9938_0_status_r(machine, 0)) << 8;
1209      return ((int) v9938_0_status_r(space, 0)) << 8;
12091210   }
12101211   else
12111212   {   /* read VDP RAM */
1212      return ((int) v9938_0_vram_r(machine, 0)) << 8;
1213      return ((int) v9938_0_vram_r(space, 0)) << 8;
12131214   }
12141215}
12151216
r3679r3680
12181219*/
12191220WRITE16_HANDLER ( ti99_wv38_w )
12201221{
1221   activecpu_adjust_icount(-4);
1222   cpu_adjust_icount(space->machine->cpu[0],-4);
12221223
12231224   switch (offset & 3)
12241225   {
12251226   case 0:
12261227      /* write VDP data */
1227      v9938_0_vram_w(machine, 0, (data >> 8) & 0xff);
1228      v9938_0_vram_w(space, 0, (data >> 8) & 0xff);
12281229      break;
12291230   case 1:
12301231      /* write VDP address */
1231      v9938_0_command_w(machine, 0, (data >> 8) & 0xff);
1232      v9938_0_command_w(space, 0, (data >> 8) & 0xff);
12321233      break;
12331234   case 2:
12341235      /* write VDP palette */
1235      v9938_0_palette_w(machine, 0, (data >> 8) & 0xff);
1236      v9938_0_palette_w(space, 0, (data >> 8) & 0xff);
12361237      break;
12371238   case 3:
12381239      /* write VDP register */
1239      v9938_0_register_w(machine, 0, (data >> 8) & 0xff);
1240      v9938_0_register_w(space, 0, (data >> 8) & 0xff);
12401241      break;
12411242   }
12421243}
r3679r3680
12461247*/
12471248static READ16_HANDLER ( ti99_rspeech_r )
12481249{
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 */
12501251
1251   return ((int) tms5220_status_r(machine, offset)) << 8;
1252   return ((int) tms5220_status_r(space, offset)) << 8;
12521253}
12531254
12541255#if 0
r3679r3680
12721273*/
12731274static WRITE16_HANDLER ( ti99_wspeech_w )
12741275{
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 */
12761277
12771278#if 1
12781279   /* the stupid design of the tms5220 core means that ready is cleared when
r3679r3680
12861287
12871288      logerror("time to ready: %f -> %d\n", attotime_to_double(time_to_ready), (int) cycles_to_ready);
12881289
1289      activecpu_adjust_icount(-cycles_to_ready);
1290      cpu_adjust_icount(space->machine->cpu[0],-cycles_to_ready);
12901291      timer_set(attotime_zero, NULL, 0, /*speech_kludge_callback*/NULL);
12911292   }
12921293#endif
12931294
1294   tms5220_data_w(machine, offset, (data >> 8) & 0xff);
1295   tms5220_data_w(space, offset, (data >> 8) & 0xff);
12951296}
12961297
12971298/*
r3679r3680
13021303   int reply;
13031304
13041305
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? */
13061307
13071308   if (offset & 1)
13081309   {   /* read GPL address */
r3679r3680
13331334
13341335   if (hsgpl_crdena)
13351336      /* 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);
13371338
13381339   return reply;
13391340}
r3679r3680
13431344*/
13441345WRITE16_HANDLER ( ti99_wgpl_w )
13451346{
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? */
13471348
13481349   if (offset & 1)
13491350   {   /* write GPL address */
r3679r3680
13811382   }
13821383
13831384   if (hsgpl_crdena)
1384      ti99_hsgpl_gpl_w(machine, offset, data, mem_mask);
1385      ti99_hsgpl_gpl_w(space, offset, data, mem_mask);
13851386}
13861387
13871388/*
r3679r3680
13891390*/
13901391READ16_HANDLER ( ti99_4p_rgpl_r )
13911392{
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? */
13931394
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*/;
13951396}
13961397
13971398/*
r3679r3680
13991400*/
14001401WRITE16_HANDLER ( ti99_4p_wgpl_w )
14011402{
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? */
14031404
14041405   /*if (hsgpl_crdena)*/
1405      ti99_hsgpl_gpl_w(machine, offset, data, mem_mask);
1406      ti99_hsgpl_gpl_w(space, offset, data, mem_mask);
14061407}
14071408
14081409
r3679r3680
14521453               {
14531454                  if (offset & 2)
14541455                     /* read VDP status */
1455                     reply = TMS9928A_register_r(machine, 0);
1456                     reply = TMS9928A_register_r(space, 0);
14561457                  else
14571458                     /* read VDP RAM */
1458                     reply = TMS9928A_vram_r(machine, 0);
1459                     reply = TMS9928A_vram_r(space, 0);
14591460               }
14601461            }
14611462            else
r3679r3680
14701471            /* speech read */
14711472            if (! (offset & 1))
14721473            {
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);
14751476            }
14761477            break;
14771478
14781479         case 6:
14791480            /* GPL read */
14801481            if (! (offset & 1))
1481               reply = ti99_rgpl_r(machine, offset >> 1, 0) >> 8;
1482               reply = ti99_rgpl_r(space, offset >> 1, 0) >> 8;
14821483            break;
14831484
14841485         default:
r3679r3680
15231524
15241525      case 2:
15251526         /* DSR space */
1526         reply = ti99_8_peb_r(machine, offset & 0x1fff);
1527         reply = ti99_8_peb_r(space, offset & 0x1fff);
15271528         break;
15281529
15291530      case 3:
r3679r3680
15821583         case 1:
15831584            /* sound write + RAM */
15841585            if (offset < 0x8410)
1585               sn76496_0_w(machine, offset, data);
1586               sn76496_0_w(space, offset, data);
15861587            else
15871588               sRAM_ptr_8[offset & 0x1fff] = data;
15881589            break;
r3679r3680
16231624            {
16241625               if (offset & 2)
16251626                  /* read VDP status */
1626                  TMS9928A_register_w(machine, 0, data);
1627                  TMS9928A_register_w(space, 0, data);
16271628               else
16281629                  /* read VDP RAM */
1629                  TMS9928A_vram_w(machine, 0, data);
1630                  TMS9928A_vram_w(space, 0, data);
16301631            }
16311632            break;
16321633
r3679r3680
16341635            /* speech write */
16351636            if (! (offset & 1))
16361637            {
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 */
16381639
16391640               /* the stupid design of the tms5220 core means that ready is cleared when
16401641               there are 15 bytes in FIFO.  It should be 16.  Of course, if it were the
r3679r3680
16491650                  logerror("time to ready: %f -> %d\n", attotime_to_double(time_to_ready)
16501651                     , (int) cycles_to_ready);
16511652
1652                  activecpu_adjust_icount(-cycles_to_ready);
1653                  cpu_adjust_icount(space->machine->cpu[0],-cycles_to_ready);
16531654                  timer_set(attotime_zero, NULL, 0, /*speech_kludge_callback*/NULL);
16541655               }
16551656
1656               tms5220_data_w(machine, offset, data);
1657               tms5220_data_w(space, offset, data);
16571658            }
16581659            break;
16591660
16601661         case 7:
16611662            /* GPL write */
16621663            if (! (offset & 1))
1663               ti99_wgpl_w(machine, offset >> 1, data << 8, 0);
1664               ti99_wgpl_w(space, offset >> 1, data << 8, 0);
16641665            break;
16651666
16661667         default:
r3679r3680
17001701
17011702      case 2:
17021703         /* DSR space */
1703         ti99_8_peb_w(machine, offset & 0x1fff, data);
1704         ti99_8_peb_w(space, offset & 0x1fff, data);
17041705         break;
17051706
17061707      case 3:
r3679r3680
26922693
26932694static void ti99_TIxram_init(running_machine *machine)
26942695{
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);
26992702}
27002703
27012704/* low 8 kb: 0x2000-0x3fff */
27022705static READ16_HANDLER ( ti99_TIxramlow_r )
27032706{
2704   activecpu_adjust_icount(-4);
2707   cpu_adjust_icount(space->machine->cpu[0],-4);
27052708
27062709   return xRAM_ptr[offset];
27072710}
27082711
27092712static WRITE16_HANDLER ( ti99_TIxramlow_w )
27102713{
2711   activecpu_adjust_icount(-4);
2714   cpu_adjust_icount(space->machine->cpu[0],-4);
27122715
27132716   COMBINE_DATA(xRAM_ptr + offset);
27142717}
r3679r3680
27162719/* high 24 kb: 0xa000-0xffff */
27172720static READ16_HANDLER ( ti99_TIxramhigh_r )
27182721{
2719   activecpu_adjust_icount(-4);
2722   cpu_adjust_icount(space->machine->cpu[0],-4);
27202723
27212724   return xRAM_ptr[offset+0x1000];
27222725}
27232726
27242727static WRITE16_HANDLER ( ti99_TIxramhigh_w )
27252728{
2726   activecpu_adjust_icount(-4);
2729   cpu_adjust_icount(space->machine->cpu[0],-4);
27272730
27282731   COMBINE_DATA(xRAM_ptr + offset+0x1000);
27292732}
r3679r3680
27662769{
27672770   int i;
27682771
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);
27692778
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
27752779   ti99_peb_set_card_handlers(0x1e00, & sAMS_expansion_handlers);
27762780
27772781   sAMS_mapper_on = 0;
r3679r3680
28042808/* low 8 kb: 0x2000-0x3fff */
28052809static READ16_HANDLER ( ti99_sAMSxramlow_r )
28062810{
2807   activecpu_adjust_icount(-4);
2811   cpu_adjust_icount(space->machine->cpu[0],-4);
28082812
28092813   if (sAMS_mapper_on)
28102814      return xRAM_ptr[(offset&0x7ff)+sAMSlookup[(0x1000+offset)>>11]];
r3679r3680
28142818
28152819static WRITE16_HANDLER ( ti99_sAMSxramlow_w )
28162820{
2817   activecpu_adjust_icount(-4);
2821   cpu_adjust_icount(space->machine->cpu[0],-4);
28182822
28192823   if (sAMS_mapper_on)
28202824      COMBINE_DATA(xRAM_ptr + (offset&0x7ff)+sAMSlookup[(0x1000+offset)>>11]);
r3679r3680
28252829/* high 24 kb: 0xa000-0xffff */
28262830static READ16_HANDLER ( ti99_sAMSxramhigh_r )
28272831{
2828   activecpu_adjust_icount(-4);
2832   cpu_adjust_icount(space->machine->cpu[0],-4);
28292833
28302834   if (sAMS_mapper_on)
28312835      return xRAM_ptr[(offset&0x7ff)+sAMSlookup[(0x5000+offset)>>11]];
r3679r3680
28352839
28362840static WRITE16_HANDLER ( ti99_sAMSxramhigh_w )
28372841{
2838   activecpu_adjust_icount(-4);
2842   cpu_adjust_icount(space->machine->cpu[0],-4);
28392843
28402844   if (sAMS_mapper_on)
28412845      COMBINE_DATA(xRAM_ptr + (offset&0x7ff)+sAMSlookup[(0x5000+offset)>>11]);
r3679r3680
28772881   int i;
28782882
28792883   /* 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);*/
28962900
28972901   ti99_peb_set_16bit_card_handlers(0x1e00, & ti99_4p_mapper_handlers);
28982902
r3679r3680
29072911      {
29082912      case 2:
29092913      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));
29112915         break;
29122916
29132917      case 10:
r3679r3680
29162920      case 13:
29172921      case 14:
29182922      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));
29202924         break;
29212925      }
29222926   }
r3679r3680
29422946            {
29432947            case 2:
29442948            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)));
29462950               break;
29472951
29482952            case 10:
r3679r3680
29512955            case 13:
29522956            case 14:
29532957            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)));
29552959               break;
29562960            }
29572961         }
r3679r3680
29802984      {
29812985      case 2:
29822986      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]);
29842988         break;
29852989
29862990      case 10:
r3679r3680
29892993      case 13:
29902994      case 14:
29912995      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]);
29932997         break;
29942998      }
29952999   }
r3679r3680
30283032/* set up myarc handlers, and set initial state */
30293033static void ti99_myarcxram_init(running_machine *machine)
30303034{
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);
30353041
30363042   switch (xRAM_kind)
30373043   {
r3679r3680
30963102/* low 8 kb: 0x2000-0x3fff */
30973103static READ16_HANDLER ( ti99_myarcxramlow_r )
30983104{
3099   activecpu_adjust_icount(-4);
3105   cpu_adjust_icount(space->machine->cpu[0],-4);
31003106
31013107   return xRAM_ptr[myarc_cur_page_offset + offset];
31023108}
31033109
31043110static WRITE16_HANDLER ( ti99_myarcxramlow_w )
31053111{
3106   activecpu_adjust_icount(-4);
3112   cpu_adjust_icount(space->machine->cpu[0],-4);
31073113
31083114   COMBINE_DATA(xRAM_ptr + myarc_cur_page_offset + offset);
31093115}
r3679r3680
31113117/* high 24 kb: 0xa000-0xffff */
31123118static READ16_HANDLER ( ti99_myarcxramhigh_r )
31133119{
3114   activecpu_adjust_icount(-4);
3120   cpu_adjust_icount(space->machine->cpu[0],-4);
31153121
31163122   return xRAM_ptr[myarc_cur_page_offset + offset+0x1000];
31173123}
31183124
31193125static WRITE16_HANDLER ( ti99_myarcxramhigh_w )
31203126{
3121   activecpu_adjust_icount(-4);
3127   cpu_adjust_icount(space->machine->cpu[0],-4);
31223128
31233129   COMBINE_DATA(xRAM_ptr + myarc_cur_page_offset + offset+0x1000);
31243130}
src/mess/mess.mak
r3679r3680
432432   $(MESSOBJ)/pc.a \
433433   $(MESSOBJ)/sgi.a \
434434   $(MESSOBJ)/pcshare.a \
435   $(MESSOBJ)/pdp1.a \
435436   $(MESSOBJ)/pel.a \
436437   $(MESSOBJ)/pk8020.a \
437438   $(MESSOBJ)/pmd85.a \
r3679r3680
439440   $(MESSOBJ)/primo.a \
440441   $(MESSOBJ)/radio.a \
441442   $(MESSOBJ)/rca.a \
443   $(MESSOBJ)/rockwell.a \
442444   $(MESSOBJ)/rt1715.a \
445   $(MESSOBJ)/samcoupe.a \
443446   $(MESSOBJ)/sapi1.a \
444447   $(MESSOBJ)/sega.a \
445448   $(MESSOBJ)/sharp.a \
r3679r3680
450453   $(MESSOBJ)/ssystem3.a \
451454   $(MESSOBJ)/super80.a \
452455   $(MESSOBJ)/tangerin.a \
456   $(MESSOBJ)/tatung.a \
453457   $(MESSOBJ)/telmac.a \
454458   $(MESSOBJ)/thomson.a \
455459   $(MESSOBJ)/ti85.a \
456460   $(MESSOBJ)/tiger.a \
461   $(MESSOBJ)/ti99.a \
457462   $(MESSOBJ)/trs80.a \
458463   $(MESSOBJ)/tutor.a \
464   $(MESSOBJ)/tx0.a \
459465   $(MESSOBJ)/ut88.a \
460466   $(MESSOBJ)/vc4000.a \
461467   $(MESSOBJ)/veb.a \
r3679r3680
476482#   $(MESSOBJ)/mephisto.a \
477483#   $(MESSOBJ)/mk1.a \
478484#   $(MESSOBJ)/multitch.a \
479#   $(MESSOBJ)/pdp1.a \
480#   $(MESSOBJ)/rockwell.a \
481#   $(MESSOBJ)/samcoupe.a \
482485#   $(MESSOBJ)/svi.a \
483486#   $(MESSOBJ)/svision.a \
484487#   $(MESSOBJ)/synertec.a \
485#   $(MESSOBJ)/tatung.a \
486488#   $(MESSOBJ)/teamconc.a \
487#   $(MESSOBJ)/ti99.a \
488#   $(MESSOBJ)/tx0.a \
489489
490490
491491
src/mess/drivers/ti990_4.c
r3679r3680
6363static INTERRUPT_GEN( ti990_4_line_interrupt )
6464{
6565#if VIDEO_911
66   vdt911_keyboard(machine, 0);
66   vdt911_keyboard(device->machine, 0);
6767#else
68   asr733_keyboard(machine, 0);
68   asr733_keyboard(device->machine, 0);
6969#endif
7070
7171   ti990_line_interrupt();
r3679r3680
9595static WRITE8_HANDLER ( lrex_callback )
9696{
9797   /* right??? */
98   ti990_hold_load(machine);
98   ti990_hold_load(space->machine);
9999}
100100
101101#if VIDEO_911
src/mess/drivers/tm990189.c
r3679r3680
553553   case 5: /* CKON: set DECKCONTROL */
554554      LED_state |= 0x20;
555555      {
556         const device_config *img = device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" );
556         const device_config *img = device_list_find_by_tag( space->machine->config->devicelist, CASSETTE, "cassette" );
557557         cassette_change_state(img, CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
558558      }
559559      break;
r3679r3680
561561   case 6: /* CKOF: clear DECKCONTROL */
562562      LED_state &= ~0x20;
563563      {
564         const device_config *img = device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" );
564         const device_config *img = device_list_find_by_tag( space->machine->config->devicelist, CASSETTE, "cassette" );
565565         cassette_change_state(img, CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
566566      }
567567      break;
568568
569569   case 7: /* LREX: trigger LOAD */
570      hold_load(machine);
570      hold_load(space->machine);
571571      break;
572572   }
573573}
r3679r3680
604604    it. */
605605
606606   if (offset & 2)
607      reply = TMS9928A_register_r(machine, 0);
607      reply = TMS9928A_register_r(space, 0);
608608   else
609      reply = TMS9928A_vram_r(machine, 0);
609      reply = TMS9928A_vram_r(space, 0);
610610
611611   if (!(offset & 1))
612612      bogus_read_save = reply;
r3679r3680
621621   if (offset & 1)
622622   {
623623      if (offset & 2)
624         TMS9928A_register_w(machine, 0, data);
624         TMS9928A_register_w(space, 0, data);
625625      else
626         TMS9928A_vram_w(machine, 0, data);
626         TMS9928A_vram_w(space, 0, data);
627627   }
628628}
629629
630630static READ8_HANDLER(video_joy_r)
631631{
632   int reply = input_port_read(machine, "BUTTONS");
632   int reply = input_port_read(space->machine, "BUTTONS");
633633
634634
635635   if (attotime_compare(timer_timeleft(joy1x_timer), attotime_zero) < 0)
r3679r3680
649649
650650static WRITE8_HANDLER(video_joy_w)
651651{
652   timer_reset(joy1x_timer, ATTOTIME_IN_USEC(input_port_read(machine, "JOY1_X")*28+28));
653   timer_reset(joy1y_timer, ATTOTIME_IN_USEC(input_port_read(machine, "JOY1_Y")*28+28));
654   timer_reset(joy2x_timer, ATTOTIME_IN_USEC(input_port_read(machine, "JOY2_X")*28+28));
655   timer_reset(joy2y_timer, ATTOTIME_IN_USEC(input_port_read(machine, "JOY2_Y")*28+28));
652   timer_reset(joy1x_timer, ATTOTIME_IN_USEC(input_port_read(space->machine, "JOY1_X")*28+28));
653   timer_reset(joy1y_timer, ATTOTIME_IN_USEC(input_port_read(space->machine, "JOY1_Y")*28+28));
654   timer_reset(joy2x_timer, ATTOTIME_IN_USEC(input_port_read(space->machine, "JOY2_X")*28+28));
655   timer_reset(joy2y_timer, ATTOTIME_IN_USEC(input_port_read(space->machine, "JOY2_Y")*28+28));
656656}
657657
658658
src/mess/drivers/ti990_10.c
r3679r3680
9393
9494static INTERRUPT_GEN( ti990_10_line_interrupt )
9595{
96   vdt911_keyboard(machine, 0);
96   vdt911_keyboard(device->machine, 0);
9797
9898   ti990_line_interrupt();
9999}
src/mess/drivers/einstein.c
r3679r3680
290290      case 5:
291291      case 6:
292292      case 7:
293         return einstein_80col_ram_r(machine, offset);
293         return einstein_80col_ram_r(space, offset);
294294      case 0x0c:
295         return einstein_80col_state_r(machine, offset);
295         return einstein_80col_state_r(space, offset);
296296      default:
297297         break;
298298   }
r3679r3680
312312      case 5:
313313      case 6:
314314      case 7:
315         einstein_80col_ram_w(machine, offset,data);
315         einstein_80col_ram_w(space, offset,data);
316316         break;
317317      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 );
319319         break;
320320      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 );
322322         break;
323323      default:
324324         break;
r3679r3680
573573
574574   if (offset & 0x01)
575575   {
576      return TMS9928A_register_r(machine, offset & 0x01);
576      return TMS9928A_register_r(space, offset & 0x01);
577577   }
578578
579   return TMS9928A_vram_r(machine, offset & 0x01);
579   return TMS9928A_vram_r(space, offset & 0x01);
580580}
581581
582582static WRITE8_HANDLER(einstein_vdp_w)
r3679r3680
585585
586586   if (offset & 0x01)
587587   {
588      TMS9928A_register_w(machine, offset & 0x01,data);
588      TMS9928A_register_w(space, offset & 0x01,data);
589589      return;
590590   }
591591
592   TMS9928A_vram_w(machine, offset & 0x01,data);
592   TMS9928A_vram_w(space, offset & 0x01,data);
593593}
594594
595595static WRITE8_HANDLER(einstein_fdc_w)
596596{
597597   int reg = offset & 0x03;
598598
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);
600600
601601   switch (reg)
602602   {
603603      case 0:
604604      {
605         wd17xx_command_w(machine, reg, data);
605         wd17xx_command_w(space, reg, data);
606606      }
607607      break;
608608
609609      case 1:
610610      {
611         wd17xx_track_w(machine, reg, data);
611         wd17xx_track_w(space, reg, data);
612612      }
613613      break;
614614
615615      case 2:
616616      {
617         wd17xx_sector_w(machine, reg, data);
617         wd17xx_sector_w(space, reg, data);
618618      }
619619      break;
620620
621621      case 3:
622622      {
623         wd17xx_data_w(machine, reg, data);
623         wd17xx_data_w(space, reg, data);
624624      }
625625      break;
626626   }
r3679r3680
631631{
632632   int reg = offset & 0x03;
633633
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);
635635
636636   switch (reg)
637637   {
638638      case 0:
639639      {
640         return wd17xx_status_r(machine, reg);
640         return wd17xx_status_r(space, reg);
641641      }
642642      break;
643643
644644      case 1:
645645      {
646         return wd17xx_track_r(machine, reg);
646         return wd17xx_track_r(space, reg);
647647      }
648648      break;
649649
650650      case 2:
651651      {
652         return wd17xx_sector_r(machine, reg);
652         return wd17xx_sector_r(space, reg);
653653      }
654654      break;
655655
656656      case 3:
657657      {
658         return wd17xx_data_r(machine, reg);
658         return wd17xx_data_r(space, reg);
659659      }
660660      break;
661661   }
r3679r3680
699699
700700   if ((reg)==0)
701701   {
702      msm8251_data_w(machine, reg,data);
702      msm8251_data_w(space, reg,data);
703703      return;
704704   }
705705
706   msm8251_control_w(machine, reg,data);
706   msm8251_control_w(space, reg,data);
707707}
708708
709709
r3679r3680
715715
716716   if ((reg)==0)
717717   {
718      return msm8251_data_r(machine, reg);
718      return msm8251_data_r(space, reg);
719719   }
720720
721   return msm8251_status_r(machine, reg);
721   return msm8251_status_r(space, reg);
722722}
723723
724724/*
r3679r3680
757757      /* case 0 and 1 are not handled */
758758      case 2:
759759      {
760         ay8910_control_port_0_w(machine, 0, data);
760         ay8910_control_port_0_w(space, 0, data);
761761      }
762762      break;
763763
764764      case 3:
765765      {
766         ay8910_write_port_0_w(machine, 0, data);
766         ay8910_write_port_0_w(space, 0, data);
767767      }
768768      break;
769769
r3679r3680
780780   {
781781      /* case 0 and 1 are not handled */
782782      case 2:
783         return ay8910_read_port_0_r(machine, 0);
783         return ay8910_read_port_0_r(space, 0);
784784
785785      default:
786786         break;
r3679r3680
824824   /* bit 1: select drive 1 */
825825   /* bit 0: select drive 0 */
826826
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);
828828
829829   wd17xx_set_side((data>>4) & 0x01);
830830
r3679r3680
852852static WRITE8_HANDLER(einstein_rom_w)
853853{
854854   einstein_rom_enabled^=1;
855   einstein_page_rom(machine);
855   einstein_page_rom(space->machine);
856856}
857857
858858static READ8_HANDLER(einstein_key_int_r)
r3679r3680
863863   /* clear key int. a read of this I/O port will do this or a reset */
864864   einstein_int &= ~EINSTEIN_KEY_INT;
865865
866   einstein_update_interrupts(machine);
866   einstein_update_interrupts(space->machine);
867867
868868   centronics_write_handshake(0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
869869   centronics_handshake = centronics_read_handshake(0);
r3679r3680
876876   /* bit 2: 1=printer busy */
877877   /* bit 1: fire 1 */
878878   /* 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;
880880
881881   /* error? */
882882   if (centronics_handshake & CENTRONICS_NO_ERROR)
r3679r3680
926926      einstein_int_mask |= EINSTEIN_KEY_INT;
927927   }
928928
929   einstein_update_interrupts(machine);
929   einstein_update_interrupts(space->machine);
930930}
931931
932932static WRITE8_HANDLER(einstein_adc_int_w)
r3679r3680
946946      einstein_int_mask |= EINSTEIN_ADC_INT;
947947   }
948948
949   einstein_update_interrupts(machine);
949   einstein_update_interrupts(space->machine);
950950}
951951
952952static WRITE8_HANDLER(einstein_fire_int_w)
r3679r3680
967967      einstein_int_mask |= EINSTEIN_FIRE_INT;
968968   }
969969
970   einstein_update_interrupts(machine);
970   einstein_update_interrupts(space->machine);
971971}
972972
973973
r3679r3680
983983      case 0x05:
984984      case 0x06:
985985      case 0x07:
986         return einstein_psg_r(machine, offset);
986         return einstein_psg_r(space, offset);
987987      case 0x08:
988988      case 0x09:
989989      case 0x0a:
r3679r3680
992992      case 0x0d:
993993      case 0x0e:
994994      case 0x0f:
995         return einstein_vdp_r(machine, offset);
995         return einstein_vdp_r(space, offset);
996996      case 0x10:
997997      case 0x11:
998998      case 0x12:
r3679r3680
10011001      case 0x15:
10021002      case 0x16:
10031003      case 0x17:
1004         return einstein_serial_r(machine, offset);
1004         return einstein_serial_r(space, offset);
10051005      case 0x18:
10061006      case 0x19:
10071007      case 0x1a:
r3679r3680
10101010      case 0x1d:
10111011      case 0x1e:
10121012      case 0x1f:
1013         return einstein_fdc_r(machine, offset);
1013         return einstein_fdc_r(space, offset);
10141014      case 0x20:
1015         return einstein_key_int_r(machine, offset);
1015         return einstein_key_int_r(space, offset);
10161016      case 0x28:
10171017      case 0x29:
10181018      case 0x2a:
r3679r3680
10211021      case 0x2d:
10221022      case 0x2e:
10231023      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);
10251025      case 0x30:
10261026      case 0x31:
10271027      case 0x32:
r3679r3680
10301030      case 0x35:
10311031      case 0x36:
10321032      case 0x37:
1033         return einstein_pio_r(machine, offset);
1033         return einstein_pio_r(space, offset);
10341034      case 0x40:
10351035      case 0x41:
10361036      case 0x42:
r3679r3680
10471047      case 0x4d:
10481048      case 0x4e:
10491049      case 0x4f:
1050         return einstein_80col_r(machine, offset);
1050         return einstein_80col_r(space, offset);
10511051
10521052      default:
10531053         break;
r3679r3680
10701070      case 0x05:
10711071      case 0x06:
10721072      case 0x07:
1073         einstein_psg_w(machine, offset,data);
1073         einstein_psg_w(space, offset,data);
10741074         return;
10751075      case 0x08:
10761076      case 0x09:
r3679r3680
10801080      case 0x0d:
10811081      case 0x0e:
10821082      case 0x0f:
1083         einstein_vdp_w(machine, offset,data);
1083         einstein_vdp_w(space, offset,data);
10841084         return;
10851085      case 0x10:
10861086      case 0x11:
r3679r3680
10901090      case 0x15:
10911091      case 0x16:
10921092      case 0x17:
1093         einstein_serial_w(machine, offset,data);
1093         einstein_serial_w(space, offset,data);
10941094         return;
10951095      case 0x18:
10961096      case 0x19:
r3679r3680
11001100      case 0x1d:
11011101      case 0x1e:
11021102      case 0x1f:
1103         einstein_fdc_w(machine, offset,data);
1103         einstein_fdc_w(space, offset,data);
11041104         return;
11051105      case 0x20:
1106         einstein_key_int_w(machine, offset,data);
1106         einstein_key_int_w(space, offset,data);
11071107         return;
11081108      case 0x21:
1109         einstein_adc_int_w(machine, offset,data);
1109         einstein_adc_int_w(space, offset,data);
11101110         return;
11111111      case 0x23:
1112         einstein_drive_w(machine, offset,data);
1112         einstein_drive_w(space, offset,data);
11131113         return;
11141114      case 0x24:
1115         einstein_rom_w(machine, offset,data);
1115         einstein_rom_w(space, offset,data);
11161116         return;
11171117      case 0x25:
1118         einstein_fire_int_w(machine, offset,data);
1118         einstein_fire_int_w(space, offset,data);
11191119         return;
11201120      case 0x28:
11211121      case 0x29:
r3679r3680
11251125      case 0x2d:
11261126      case 0x2e:
11271127      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);
11291129         return;
11301130      case 0x30:
11311131      case 0x31:
r3679r3680
11351135      case 0x35:
11361136      case 0x36:
11371137      case 0x37:
1138         einstein_pio_w(machine, offset,data);
1138         einstein_pio_w(space, offset,data);
11391139         return;
11401140      case 0x40:
11411141      case 0x41:
r3679r3680
11531153      case 0x4d:
11541154      case 0x4e:
11551155      case 0x4f:
1156         einstein_80col_w(machine, offset,data);
1156         einstein_80col_w(space, offset,data);
11571157         return;
11581158
11591159      default:
r3679r3680
11761176      case 0x05:
11771177      case 0x06:
11781178      case 0x07:
1179         return einstein_psg_r(machine, offset);
1179         return einstein_psg_r(space, offset);
11801180      case 0x08:
11811181      case 0x09:
11821182      case 0x0a:
r3679r3680
11851185      case 0x0d:
11861186      case 0x0e:
11871187      case 0x0f:
1188         return einstein_vdp_r(machine, offset);
1188         return einstein_vdp_r(space, offset);
11891189      case 0x10:
11901190      case 0x11:
11911191      case 0x12:
r3679r3680
11941194      case 0x15:
11951195      case 0x16:
11961196      case 0x17:
1197         return einstein_serial_r(machine, offset);
1197         return einstein_serial_r(space, offset);
11981198      case 0x18:
11991199      case 0x19:
12001200      case 0x1a:
r3679r3680
12031203      case 0x1d:
12041204      case 0x1e:
12051205      case 0x1f:
1206         return einstein_fdc_r(machine, offset);
1206         return einstein_fdc_r(space, offset);
12071207      case 0x20:
1208         return einstein_key_int_r(machine, offset);
1208         return einstein_key_int_r(space, offset);
12091209      case 0x28:
12101210      case 0x29:
12111211      case 0x2a:
r3679r3680
12141214      case 0x2d:
12151215      case 0x2e:
12161216      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);
12181218      case 0x30:
12191219      case 0x31:
12201220      case 0x32:
r3679r3680
12231223      case 0x35:
12241224      case 0x36:
12251225      case 0x37:
1226         return einstein_pio_r(machine, offset);
1226         return einstein_pio_r(space, offset);
12271227
12281228      default:
12291229         break;
r3679r3680
12461246      case 0x05:
12471247      case 0x06:
12481248      case 0x07:
1249         einstein_psg_w(machine, offset,data);
1249         einstein_psg_w(space, offset,data);
12501250         return;
12511251      case 0x08:
12521252      case 0x09:
r3679r3680
12561256      case 0x0d:
12571257      case 0x0e:
12581258      case 0x0f:
1259         einstein_vdp_w(machine, offset,data);
1259         einstein_vdp_w(space, offset,data);
12601260         return;
12611261      case 0x10:
12621262      case 0x11:
r3679r3680
12661266      case 0x15:
12671267      case 0x16:
12681268      case 0x17:
1269         einstein_serial_w(machine, offset,data);
1269         einstein_serial_w(space, offset,data);
12701270         return;
12711271      case 0x18:
12721272      case 0x19:
r3679r3680
12761276      case 0x1d:
12771277      case 0x1e:
12781278      case 0x1f:
1279         einstein_fdc_w(machine, offset,data);
1279         einstein_fdc_w(space, offset,data);
12801280         return;
12811281      case 0x20:
1282         einstein_key_int_w(machine, offset,data);
1282         einstein_key_int_w(space, offset,data);
12831283         return;
12841284      case 0x21:
1285         einstein_adc_int_w(machine, offset,data);
1285         einstein_adc_int_w(space, offset,data);
12861286         return;
12871287      case 0x23:
1288         einstein_drive_w(machine, offset,data);
1288         einstein_drive_w(space, offset,data);
12891289         return;
12901290      case 0x24:
1291         einstein_rom_w(machine, offset,data);
1291         einstein_rom_w(space, offset,data);
12921292         return;
12931293      case 0x25:
1294         einstein_fire_int_w(machine, offset,data);
1294         einstein_fire_int_w(space, offset,data);
12951295         return;
12961296      case 0x28:
12971297      case 0x29:
r3679r3680
13011301      case 0x2d:
13021302      case 0x2e:
13031303      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);
13051305         return;
13061306      case 0x30:
13071307      case 0x31:
r3679r3680
13111311      case 0x35:
13121312      case 0x36:
13131313      case 0x37:
1314         einstein_pio_w(machine, offset,data);
1314         einstein_pio_w(space, offset,data);
13151315         return;
13161316
13171317      default:
r3679r3680
14551455   einstein_int_mask = 0;
14561456   floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_SS_40);
14571457
1458   cpunum_set_irq_callback(0, einstein_cpu_acknowledge_int);
1458   cpu_set_irq_callback(machine->cpu[0], einstein_cpu_acknowledge_int);
14591459
14601460   /* the einstein keyboard can generate a interrupt */
14611461   /* the int is actually clocked at the system clock 4Mhz, but this would be too fast for our
r3679r3680
15951595//  logerror("line: %02x\n",einstein_keyboard_line);
15961596
15971597   /* re-scan the keyboard */
1598   einstein_scan_keyboard(machine);
1598   einstein_scan_keyboard(space->machine);
15991599}
16001600
16011601static READ8_HANDLER(einstein_port_b_read)
16021602{
1603   einstein_scan_keyboard(machine);
1603   einstein_scan_keyboard(space->machine);
16041604
16051605//  logerror("key: %02x\n",einstein_keyboard_data);
16061606
src/mess/drivers/ti99_2.c
r3679r3680
9595   ROM_paged = 1;
9696}
9797
98#define TI99_2_32_ROMPAGE0 (memory_region(machine, "main")+0x4000)
99#define TI99_2_32_ROMPAGE1 (memory_region(machine, "main")+0x10000)
98#define TI99_2_32_ROMPAGE0 (memory_region(space->machine, "main")+0x4000)
99#define TI99_2_32_ROMPAGE1 (memory_region(space->machine, "main")+0x10000)
100100
101101static MACHINE_RESET( ti99_2 )
102102{
103103   if (! ROM_paged)
104104      memory_set_bankptr(machine, 1, memory_region(machine, "main")+0x4000);
105105   else
106      memory_set_bankptr(machine, 1, TI99_2_32_ROMPAGE0);
106      memory_set_bankptr(machine, 1, (memory_region(machine, "main")+0x4000));
107107}
108108
109109static INTERRUPT_GEN( ti99_2_vblank_interrupt )
110110{
111111   /* We trigger a level-4 interrupt.  The PULSE_LINE is a mere guess. */
112   cpu_set_input_line(machine->cpu[0], 1, PULSE_LINE);
112   cpu_set_input_line(device, 1, PULSE_LINE);
113113}
114114
115115
r3679r3680
213213   /* now, we handle ROM paging */
214214   if (ROM_paged)
215215   {   /* if we have paged ROMs, page according to S0 keyboard interface line */
216      memory_set_bankptr(machine, 1, (KeyRow == 0) ? TI99_2_32_ROMPAGE1 : TI99_2_32_ROMPAGE0);
216      memory_set_bankptr(space->machine, 1, (KeyRow == 0) ? TI99_2_32_ROMPAGE1 : TI99_2_32_ROMPAGE0);
217217   }
218218}
219219
r3679r3680
249249{
250250   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
251251
252   return input_port_read(machine, keynames[KeyRow]);
252   return input_port_read(space->machine, keynames[KeyRow]);
253253}
254254
255255static  READ8_HANDLER ( ti99_2_read_misc_cru )
src/mess/drivers/samcoupe.c
r3679r3680
8787   /* bit 1 and 2 select the controller register */
8888   switch (offset & 0x03)
8989   {
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);
9494   }
9595
9696   return 0xff;
r3679r3680
106106   /* bit 1 and 2 select the controller register */
107107   switch (offset & 0x03)
108108   {
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;
113113   }
114114}
115115
r3679r3680
121121   if (offset & 0x100)
122122   {
123123      /* 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;
126126   }
127127   else
128128   {
129129      /* 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;
131131   }
132132
133133   return data;
r3679r3680
145145   UINT8 data = 0xe0;
146146   UINT8 row = ~(offset >> 8);
147147
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;
156156
157157   return data | samcoupe_regs.status;
158158}
r3679r3680
173173static WRITE8_HANDLER( samcoupe_lmpr_w )
174174{
175175   samcoupe_regs.lmpr = data;
176   samcoupe_update_memory(machine);
176   samcoupe_update_memory(space->machine);
177177}
178178
179179
r3679r3680
186186static WRITE8_HANDLER( samcoupe_hmpr_w )
187187{
188188   samcoupe_regs.hmpr = data;
189   samcoupe_update_memory(machine);
189   samcoupe_update_memory(space->machine);
190190}
191191
192192
r3679r3680
199199static WRITE8_HANDLER( samcoupe_vmpr_w )
200200{
201201   samcoupe_regs.vmpr = data;
202   samcoupe_update_memory(machine);
202   samcoupe_update_memory(space->machine);
203203}
204204
205205
r3679r3680
223223
224224   if (row == 0)
225225   {
226      data &= input_port_read(machine, "keyboard_row_ff") & 0x1f;
226      data &= input_port_read(space->machine, "keyboard_row_ff") & 0x1f;
227227   }
228228   else
229229   {
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;
238238   }
239239
240240   return data | 0xe0;
r3679r3680
252252
253253static READ8_HANDLER( samcoupe_attributes_r )
254254{
255   if (video_screen_get_vblank(machine->primary_screen))
255   if (video_screen_get_vblank(space->machine->primary_screen))
256256   {
257257      /* Border areas return 0xff */
258258      return 0xff;
r3679r3680
269269static WRITE8_HANDLER( samcoupe_sound_w )
270270{
271271   if (offset & 0x100)
272      saa1099_control_port_0_w(machine, 0, data);
272      saa1099_control_port_0_w(space, 0, data);
273273   else
274      saa1099_write_port_0_w(machine, 0, data);
274      saa1099_write_port_0_w(space, 0, data);
275275}
276276
277277
r3679r3680
335335static INTERRUPT_GEN( samcoupe_frame_interrupt )
336336{
337337   /* signal frame interrupt */
338   samcoupe_irq(machine, 0x08);
338   samcoupe_irq(device->machine, 0x08);
339339}
340340
341341

Previous 15994 Revisions Next


© 1998-2018 The MESS Team