Previous 199869 Revisions Next

r23696 Friday 14th June, 2013 at 04:48:44 UTC by smf
derive chihiro's baseboard ide from ide mass storage device (nw)
[src/emu/machine]idehd.c idehd.h
[src/mame/drivers]chihiro.c

trunk/src/emu/machine/idehd.c
r23695r23696
159159}
160160
161161
162void ide_hdd_device::ide_build_features()
162void ide_mass_storage_device::ide_build_features()
163163{
164164   memset(m_features, 0, IDE_DISK_SECTOR_SIZE);
165165   int total_sectors = m_num_cylinders * m_num_heads * m_num_sectors;
r23695r23696
376376   set_dmarq(CLEAR_LINE);
377377}
378378
379void ide_mass_storage_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
380{
381   switch(id)
382   {
383   case TID_DELAYED_INTERRUPT:
384      m_status &= ~IDE_STATUS_BUSY;
385      set_irq(ASSERT_LINE);
386      break;
387
388   case TID_DELAYED_INTERRUPT_BUFFER_READY:
389      m_status &= ~IDE_STATUS_BUSY;
390      m_status |= IDE_STATUS_BUFFER_READY;
391      set_irq(ASSERT_LINE);
392      break;
393
394   case TID_RESET_CALLBACK:
395      reset();
396      break;
397
398   case TID_SECURITY_ERROR_DONE:
399      /* clear error state */
400      m_status &= ~IDE_STATUS_ERROR;
401      m_status |= IDE_STATUS_DRIVE_READY;
402      break;
403
404   case TID_READ_SECTOR_DONE_CALLBACK:
405      read_sector_done();
406      break;
407
408   case TID_WRITE_SECTOR_DONE_CALLBACK:
409      write_sector_done();
410      break;
411   }
412}
413
379414void ide_mass_storage_device::signal_delayed_interrupt(attotime time, int buffer_ready)
380415{
381416   /* clear buffer ready and set the busy flag */
r23695r23696
13681403   }
13691404}
13701405
1371void ide_mass_storage_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
1372{
1373   switch(id)
1374   {
1375   case TID_DELAYED_INTERRUPT:
1376      m_status &= ~IDE_STATUS_BUSY;
1377      set_irq(ASSERT_LINE);
1378      break;
1379
1380   case TID_DELAYED_INTERRUPT_BUFFER_READY:
1381      m_status &= ~IDE_STATUS_BUSY;
1382      m_status |= IDE_STATUS_BUFFER_READY;
1383      set_irq(ASSERT_LINE);
1384      break;
1385
1386   case TID_RESET_CALLBACK:
1387      reset();
1388      break;
1389
1390   case TID_SECURITY_ERROR_DONE:
1391      /* clear error state */
1392      m_status &= ~IDE_STATUS_ERROR;
1393      m_status |= IDE_STATUS_DRIVE_READY;
1394      break;
1395
1396   case TID_READ_SECTOR_DONE_CALLBACK:
1397      read_sector_done();
1398      break;
1399
1400   case TID_WRITE_SECTOR_DONE_CALLBACK:
1401      write_sector_done();
1402      break;
1403   }
1404}
1405
14061406//-------------------------------------------------
14071407//  read device key
14081408//-------------------------------------------------
trunk/src/emu/machine/idehd.h
r23695r23696
7777
7878   void set_irq(int state);
7979   void set_dmarq(int state);
80   void ide_build_features();
8081
8182   UINT8           m_gnetreadlock;
8283
r23695r23696
142143   ide_hdd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
143144   ide_hdd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
144145
145   virtual int  read_sector(UINT32 lba, void *buffer) { return hard_disk_read(m_disk, lba, buffer); }
146   virtual int  write_sector(UINT32 lba, const void *buffer) { return hard_disk_write(m_disk, lba, buffer); }
146   virtual int read_sector(UINT32 lba, void *buffer) { return hard_disk_read(m_disk, lba, buffer); }
147   virtual int write_sector(UINT32 lba, const void *buffer) { return hard_disk_write(m_disk, lba, buffer); }
147148
148149protected:
149150   // device-level overrides
r23695r23696
155156   virtual bool is_ready() { return (m_disk != NULL); }
156157   virtual void read_key(UINT8 key[]);
157158
158   void ide_build_features();
159
160159   chd_file       *m_handle;
161160   hard_disk_file *m_disk;
162161};
trunk/src/mame/drivers/chihiro.c
r23695r23696
26562656
26572657// ======================> ide_baseboard_device
26582658
2659class ide_baseboard_device : public ide_hdd_device
2659class ide_baseboard_device : public ide_mass_storage_device
26602660{
26612661public:
26622662   // construction/destruction
r23695r23696
26842684//-------------------------------------------------
26852685
26862686ide_baseboard_device::ide_baseboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2687   : ide_hdd_device(mconfig, IDE_BASEBOARD, "IDE Baseboard", tag, owner, clock, "ide_baseboard", __FILE__)
2687   : ide_mass_storage_device(mconfig, IDE_BASEBOARD, "IDE Baseboard", tag, owner, clock, "ide_baseboard", __FILE__)
26882688{
26892689}
26902690

Previous 199869 Revisions Next


© 1997-2024 The MAME Team