Previous 199869 Revisions Next

r20268 Monday 14th January, 2013 at 19:19:01 UTC by Angelo Salese
More clean-ups
[src/mess/drivers]smc777.c

trunk/src/mess/drivers/smc777.c
r20267r20268
3232public:
3333   smc777_state(const machine_config &mconfig, device_type type, const char *tag)
3434      : driver_device(mconfig, type, tag),
35   m_maincpu(*this, "maincpu"),
36   m_crtc(*this, "crtc"),
37   m_fdc(*this, "fdc"),
3538   m_sn(*this, "sn1")
3639   { }
3740
41   required_device<cpu_device> m_maincpu;
42   required_device<mc6845_device> m_crtc;
43   required_device<mb8876_device> m_fdc;
3844   optional_device<sn76489a_device> m_sn;
3945
4046   UINT8 *m_ipl_rom;
r20267r20268
243249   if(offset == 0)
244250   {
245251      m_addr_latch = data;
246      //mc6845_address_w(machine().device("crtc"), 0,data);
252      //mc6845_address_w(m_crtc, 0,data);
247253   }
248254   else
249255   {
r20267r20268
254260      else if(m_addr_latch == 0x0f)
255261         m_cursor_addr = (m_cursor_addr & 0x3f00) | (data & 0xff);
256262
257      //mc6845_register_w(machine().device("crtc"), 0,data);
263      //mc6845_register_w(m_crtc, 0,data);
258264   }
259265}
260266
r20267r20268
358364
359365READ8_MEMBER(smc777_state::smc777_fdc1_r)
360366{
361   device_t* dev = machine().device("fdc");
362
363367   check_floppy_inserted(machine());
364368
365369   switch(offset)
366370   {
367371      case 0x00:
368         return wd17xx_status_r(dev,space, offset) ^ 0xff;
372         return wd17xx_status_r(m_fdc,space, offset) ^ 0xff;
369373      case 0x01:
370         return wd17xx_track_r(dev,space, offset) ^ 0xff;
374         return wd17xx_track_r(m_fdc,space, offset) ^ 0xff;
371375      case 0x02:
372         return wd17xx_sector_r(dev,space, offset) ^ 0xff;
376         return wd17xx_sector_r(m_fdc,space, offset) ^ 0xff;
373377      case 0x03:
374         return wd17xx_data_r(dev,space, offset) ^ 0xff;
378         return wd17xx_data_r(m_fdc,space, offset) ^ 0xff;
375379      case 0x04: //irq / drq status
376380         //popmessage("%02x %02x\n",m_fdc_irq_flag,m_fdc_drq_flag);
377381
r20267r20268
383387
384388WRITE8_MEMBER(smc777_state::smc777_fdc1_w)
385389{
386   device_t* dev = machine().device("fdc");
387
388390   check_floppy_inserted(machine());
389391
390392   switch(offset)
391393   {
392394      case 0x00:
393         wd17xx_command_w(dev,space, offset,data ^ 0xff);
395         wd17xx_command_w(m_fdc,space, offset,data ^ 0xff);
394396         break;
395397      case 0x01:
396         wd17xx_track_w(dev,space, offset,data ^ 0xff);
398         wd17xx_track_w(m_fdc,space, offset,data ^ 0xff);
397399         break;
398400      case 0x02:
399         wd17xx_sector_w(dev,space, offset,data ^ 0xff);
401         wd17xx_sector_w(m_fdc,space, offset,data ^ 0xff);
400402         break;
401403      case 0x03:
402         wd17xx_data_w(dev,space, offset,data ^ 0xff);
404         wd17xx_data_w(m_fdc,space, offset,data ^ 0xff);
403405         break;
404406      case 0x04:
405407         // ---- xxxx select floppy drive (yes, 15 of them, A to P)
406         wd17xx_set_drive(dev,data & 0x01);
407         //  wd17xx_set_side(dev,(data & 0x10)>>4);
408         wd17xx_set_drive(m_fdc,data & 0x01);
409         //  wd17xx_set_side(m_fdc,(data & 0x10)>>4);
408410         if(data & 0xf0)
409411            printf("floppy access %02x\n",data);
410412         break;
r20267r20268
955957void smc777_state::machine_start()
956958{
957959   m_ipl_rom = memregion("ipl")->base();
958   m_work_ram = auto_alloc_array(machine(), UINT8, 0x10000);
959   m_vram = auto_alloc_array(machine(), UINT8, 0x800);
960   m_attr = auto_alloc_array(machine(), UINT8, 0x800);
961   m_gvram = auto_alloc_array(machine(), UINT8, 0x8000);
962   m_pcg = auto_alloc_array(machine(), UINT8, 0x800);
960   m_work_ram = auto_alloc_array_clear(machine(), UINT8, 0x10000);
961   m_vram = auto_alloc_array_clear(machine(), UINT8, 0x800);
962   m_attr = auto_alloc_array_clear(machine(), UINT8, 0x800);
963   m_gvram = auto_alloc_array_clear(machine(), UINT8, 0x8000);
964   m_pcg = auto_alloc_array_clear(machine(), UINT8, 0x800);
963965
964966   state_save_register_global_pointer(machine(), m_work_ram, 0x10000);
965967   state_save_register_global_pointer(machine(), m_vram, 0x800);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team