Previous 15994 Revisions Next

r13848 Wednesday 4th January, 2012 at 08:07:21 UTC by Curt Coder
[V1050] Implemented SASI ACK/RST pulses. (nw)

[scsibus.c] Increment command index on acknowledge instead of data read, since Visual 1050 BIOS skips the message byte read and just acks it. [Curt Coder]
[src/mess/drivers]v1050.c
[src/mess/includes]v1050.h
[src/mess/machine]scsibus.c

src/mess/machine/scsibus.c
r13847r13848
172172
173173        case SCSI_PHASE_STATUS :
174174            result=bus->status;      // return command status
175            bus->cmd_idx++;
176175            break;
177176
178177        case SCSI_PHASE_MESSAGE_IN :
179178            result=0;              // no errors for the time being !
180            bus->cmd_idx++;
181179            break;
182180    }
183181
r13847r13848
287285READ_LINE_DEVICE_HANDLER( scsi_io_r ) { return get_scsi_line(device, SCSI_LINE_IO); }
288286READ_LINE_DEVICE_HANDLER( scsi_msg_r ) { return get_scsi_line(device, SCSI_LINE_MSG); }
289287READ_LINE_DEVICE_HANDLER( scsi_req_r ) { return get_scsi_line(device, SCSI_LINE_REQ); }
290READ_LINE_DEVICE_HANDLER( scsi_ack_r ) { return get_scsi_line(device, SCSI_LINE_RESET); }
291READ_LINE_DEVICE_HANDLER( scsi_rst_r ) { return get_scsi_line(device, SCSI_LINE_ACK); }
288READ_LINE_DEVICE_HANDLER( scsi_ack_r ) { return get_scsi_line(device, SCSI_LINE_ACK); }
289READ_LINE_DEVICE_HANDLER( scsi_rst_r ) { return get_scsi_line(device, SCSI_LINE_RESET); }
292290
293291void set_scsi_line(device_t *device, UINT8 line, UINT8 state)
294292{
r13847r13848
720718                    else
721719                        scsi_out_line_change(device,SCSI_LINE_REQ,0);
722720                }
723                else
721            else
722            {
723               bus->cmd_idx++;
724724                    scsi_out_line_change(device,SCSI_LINE_REQ,1);
725            }
725726            }
726727            break;
727728
r13847r13848
741742                        scsi_out_line_change(device,SCSI_LINE_REQ,0);
742743                }
743744                else
745            {
746               bus->cmd_idx++;
744747                    scsi_out_line_change(device,SCSI_LINE_REQ,1);
748            }
745749            }
746750            break;
747751    }
src/mess/includes/v1050.h
r13847r13848
4040#define CENTRONICS_TAG         "centronics"
4141#define TIMER_KB_TAG         "timer_kb"
4242#define TIMER_SIO_TAG         "timer_sio"
43#define TIMER_ACK_TAG         "timer_ack"
44#define TIMER_RST_TAG         "timer_rst"
4345#define SASIBUS_TAG            "sasi"
4446
4547#define V1050_VIDEORAM_SIZE      0x8000
r13847r13848
7274        m_floppy0(*this, FLOPPY_0),
7375        m_floppy1(*this, FLOPPY_1),
7476        m_timer_sio(*this, TIMER_SIO_TAG),
77        m_timer_ack(*this, TIMER_ACK_TAG),
78        m_timer_rst(*this, TIMER_RST_TAG),
7579        m_sasibus(*this, SASIBUS_TAG)
7680   { }
7781
r13847r13848
8892   required_device<device_t> m_floppy0;
8993   required_device<device_t> m_floppy1;
9094   required_device<timer_device> m_timer_sio;
95   required_device<timer_device> m_timer_ack;
96   required_device<timer_device> m_timer_rst;
9197   required_device<device_t> m_sasibus;
9298
9399   virtual void machine_start();
r13847r13848
124130   DECLARE_READ8_MEMBER( videoram_r );
125131   DECLARE_WRITE8_MEMBER( videoram_w );
126132   DECLARE_WRITE_LINE_MEMBER( crtc_vs_w );
127   DECLARE_READ8_MEMBER( sasi_data_r );
128   DECLARE_WRITE8_MEMBER( sasi_data_w );
129133   DECLARE_READ8_MEMBER( sasi_status_r );
130134   DECLARE_WRITE8_MEMBER( sasi_ctrl_w );
131135
src/mess/drivers/v1050.c
r13847r13848
100100    - keyboard beeper (NE555 wired in strange mix of astable/monostable modes)
101101    - Winchester (Tandon TM501/CMI CM-5412 10MB drive on Xebec S1410 controller)
102102
103      chdman -createblankhd tm501.chd 306 2 17 512
103104        chdman -createblankhd cm5412.chd 306 4 17 512
104105
105106*/
r13847r13848
342343   device_set_input_line(m_subcpu, INPUT_LINE_IRQ0, CLEAR_LINE);
343344}
344345
345READ8_MEMBER( v1050_state::sasi_data_r )
346{
347   // read data
348   UINT8 data = scsi_data_r(m_sasibus);
349
350   logerror("SASI data read %02x\n", data);
351   
352   // acknowledge
353   scsi_ack_w(m_sasibus, 0);
354
355   return data;
356}
357
358WRITE8_MEMBER( v1050_state::sasi_data_w )
359{
360   logerror("SASI data write %02x\n", data);
361
362   // write data
363   scsi_data_w(m_sasibus, data);
364   
365   // acknowledge
366   scsi_ack_w(m_sasibus, 0);
367}
368
369346READ8_MEMBER( v1050_state::sasi_status_r )
370347{
371348   /*
r13847r13848
394371   return data;
395372}
396373
374static TIMER_DEVICE_CALLBACK( sasi_ack_tick )
375{
376   v1050_state *state = timer.machine().driver_data<v1050_state>();
377
378   scsi_ack_w(state->m_sasibus, 1);
379}
380
381static TIMER_DEVICE_CALLBACK( sasi_rst_tick )
382{
383   v1050_state *state = timer.machine().driver_data<v1050_state>();
384
385   scsi_rst_w(state->m_sasibus, 1);
386}
387
397388WRITE8_MEMBER( v1050_state::sasi_ctrl_w )
398389{
399390   /*
r13847r13848
412403   */
413404
414405   scsi_sel_w(m_sasibus, !BIT(data, 0));
415   scsi_ack_w(m_sasibus, BIT(data, 1));
416   scsi_rst_w(m_sasibus, !BIT(data, 7));
406   
407   if (BIT(data, 1))
408   {
409      // send acknowledge pulse
410      scsi_ack_w(m_sasibus, 0);
411     
412      m_timer_ack->adjust(attotime::from_nsec(100));
413   }
414   
415   if (BIT(data, 7))
416   {
417      // send reset pulse
418      scsi_rst_w(m_sasibus, 0);
419     
420      m_timer_rst->adjust(attotime::from_nsec(100));
421   }
417422}
418423
419424// Memory Maps
r13847r13848
444449   AM_RANGE(0xb0, 0xb0) AM_READWRITE(dint_clr_r, dint_clr_w)
445450   AM_RANGE(0xc0, 0xc0) AM_WRITE(v1050_i8214_w)
446451   AM_RANGE(0xd0, 0xd0) AM_WRITE(bank_w)
447   AM_RANGE(0xe0, 0xe0) AM_READWRITE(sasi_data_r, sasi_data_w)
452   AM_RANGE(0xe0, 0xe0) AM_DEVREADWRITE_LEGACY(SASIBUS_TAG, scsi_data_r, scsi_data_w)
448453   AM_RANGE(0xe1, 0xe1) AM_READWRITE(sasi_status_r, sasi_ctrl_w)
449454ADDRESS_MAP_END
450455
r13847r13848
11111116   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(v1050_floppy_interface)
11121117   MCFG_TIMER_ADD_PERIODIC(TIMER_KB_TAG, kb_8251_tick, attotime::from_hz((double)XTAL_16MHz/4/13/8))
11131118   MCFG_TIMER_ADD(TIMER_SIO_TAG, sio_8251_tick)
1119   
1120   // SASI bus
11141121    MCFG_SCSIBUS_ADD(SASIBUS_TAG, sasi_intf)
1122   MCFG_TIMER_ADD(TIMER_ACK_TAG, sasi_ack_tick)
1123   MCFG_TIMER_ADD(TIMER_RST_TAG, sasi_rst_tick)
11151124   MCFG_HARDDISK_ADD("harddisk0")
1125   
1126   // keyboard
11161127   MCFG_V1050_KEYBOARD_ADD()
11171128
11181129   // software lists

Previous 15994 Revisions Next


© 1998-2018 The MESS Team