Previous 15994 Revisions Next

r13893 Friday 6th January, 2012 at 11:27:58 UTC by Miodrag Milanović
rm380z: started cleanup (no whatsnew)
[src/mess/drivers]rm380z.c

src/mess/drivers/rm380z.c
r13892r13893
105105   DECLARE_READ8_MEMBER( videoram_read );
106106   DECLARE_WRITE8_MEMBER( videoram_write );
107107
108   DECLARE_READ8_MEMBER(rm380z_io_r);
109   DECLARE_WRITE8_MEMBER(rm380z_io_w);
108   DECLARE_WRITE8_MEMBER(disk_0_control);
110109
111110   int keyboard_decode();
112111};
r13892r13893
322321      if ((offset>=0x0000)&&(offset<0x1000))
323322      {
324323         // ROM
325         return state->m_cos_rom[offset];
324         return state->m_cos_rom[offset+ 0xe000];
326325      }
327326      else if ((offset>=0x1c00)&&(offset<=0x1dff))
328327      {
329         return m_cos_rom[offset-0x800];
328         return m_cos_rom[offset];
330329      }
331330      else if ((offset>=0x1000)&&(offset<0x4000))
332331      {
r13892r13893
450449//
451450
452451
453WRITE8_MEMBER( rm380z_state::rm380z_io_w )
452WRITE8_MEMBER( rm380z_state::disk_0_control )
454453{
455   UINT8 portnum=offset&0xff;
456454   device_t *fdc = machine().device("wd1771");
457455   
458   //printf("port write of [%x] at [%x] from PC [%x]\n",data,portnum,cpu_get_pc(machine().device("maincpu")));
456   printf("disk drive port0 write [%x]\n",data);
459457   
460   if (portnum==0xc0)
458   // drive port0
459   if (data&0x01)
461460   {
462      wd17xx_command_w(fdc, 0, data);
463      //printf("wrote command [%x] to floppy disk\n",data);
461      // drive select bit 0
462      wd17xx_set_drive(fdc,0);
464463   }
465   else if (portnum==0xc1)
464   
465   if (data&0x08)
466466   {
467      wd17xx_track_w(fdc, 0, data);
468      //printf("wrote track data [%x] to floppy disk\n",data);
467      // motor on
469468   }
470   else if (portnum==0xc2)
469   
470   // "MSEL (dir/side select bit)
471   if (data&0x20)
471472   {
472      wd17xx_sector_w(fdc, 0, data);
473      //printf("wrote sector data [%x] to floppy disk\n",data);
473      wd17xx_set_side(fdc,1);
474474   }
475   else if (portnum==0xc3)
475   else
476476   {
477      wd17xx_data_w(fdc, 0, data);
478      //printf("wrote data [%x] to floppy disk\n",data);
477      wd17xx_set_side(fdc,0);
479478   }
480   else if (portnum==0xc4)
479   
480   // set drive en- (?)
481   if (data&0x40)
481482   {
482      printf("disk drive port0 write [%x]\n",data);
483     
484      // drive port0
485      if (data&0x01)
486      {
487         // drive select bit 0
488         wd17xx_set_drive(fdc,0);
489      }
490     
491      if (data&0x08)
492      {
493         // motor on
494      }
495     
496      // "MSEL (dir/side select bit)
497      if (data&0x20)
498      {
499         wd17xx_set_side(fdc,1);
500      }
501      else
502      {
503         wd17xx_set_side(fdc,0);
504      }
505     
506      // set drive en- (?)
507      if (data&0x40)
508      {
509      }
510483   }
511484}
512485
513READ8_MEMBER( rm380z_state::rm380z_io_r )
514{
515   UINT8 retval=0;
516   UINT8 portnum=offset&0xff;
517   device_t *fdc = machine().device("wd1771");
518
519   //printf("port read at [%x] from PC [%x]\n",portnum,cpu_get_pc(machine().device("maincpu")));
520
521   if (portnum==0xc0)
522   {
523      retval=wd17xx_status_r(fdc,0);
524      //printf("disk drive status read is [%x]\n",retval);
525   }
526   else if (portnum==0xc1)
527   {
528      retval=wd17xx_track_r(fdc, 0);
529      //printf("disk drive track read is [%x]\n",retval);
530   }
531   else if (portnum==0xc2)
532   {
533      retval=wd17xx_sector_r(fdc, 0);
534      //printf("disk drive sector read is [%x]\n",retval);
535   }
536   else if (portnum==0xc3)
537   {
538      retval=wd17xx_data_r(fdc, 0);
539      //printf("disk drive data read [%x] at PC [%x]\n",retval,cpu_get_pc(machine().device("maincpu")));
540   }
541   else if (portnum==0xcc)
542   {
543      // CTC (?)
544      return 0x00;
545   }
546   else
547   {
548      printf("other disk drive port read [%x] PC [%x]\n",portnum,cpu_get_pc(machine().device("maincpu")));
549      return 0x00;
550   }
551
552   return retval;
553}
554
555486static ADDRESS_MAP_START(rm380z_mem, AS_PROGRAM, 8, rm380z_state)
556487   AM_RANGE( 0x0000, 0xdfff ) AM_READWRITE(main_read,main_write)
557   AM_RANGE( 0xe000, 0xefff ) AM_ROM AM_REGION("maincpu", 0)
488   AM_RANGE( 0xe000, 0xefff ) AM_ROM
558489   AM_RANGE( 0xf000, 0xf5ff ) AM_READWRITE(videoram_read,videoram_write)
559   AM_RANGE( 0xf600, 0xf9ff ) AM_ROM AM_REGION("maincpu", 0x1000)      /* Extra ROM space for COS4.0 */
490   AM_RANGE( 0xf600, 0xf9ff ) AM_ROM /* Extra ROM space for COS4.0 */
560491   AM_RANGE( 0xfa00, 0xfbfb ) AM_RAM
561492   AM_RANGE( 0xfbfc, 0xfbff ) AM_READWRITE( port_fbfc_read, port_fbfc_write )
562493   AM_RANGE( 0xfc00, 0xffff ) AM_RAM
r13892r13893
568499
569500static ADDRESS_MAP_START( rm380z_io , AS_IO, 8, rm380z_state)
570501   ADDRESS_MAP_GLOBAL_MASK(0xff)
571   AM_RANGE(0x0000, 0xffff) AM_READWRITE(rm380z_io_r, rm380z_io_w)
572//   AM_RANGE(0xc3, 0xc3) AM_DEVWRITE_LEGACY("wd1771", wd17xx_command_w)
573//   AM_RANGE(0xc1, 0xc1) AM_DEVREADWRITE_LEGACY("wd1771", wd17xx_track_r, wd17xx_track_w)
574//   AM_RANGE(0xc2, 0xc2) AM_DEVREADWRITE_LEGACY("wd1771", wd17xx_sector_r, wd17xx_sector_w)
575//   AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE_LEGACY("wd1771", wd17xx_data_r, wd17xx_data_w)
502   AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE_LEGACY("wd1771", wd17xx_status_r, wd17xx_command_w)
503   AM_RANGE(0xc1, 0xc1) AM_DEVREADWRITE_LEGACY("wd1771", wd17xx_track_r, wd17xx_track_w)
504   AM_RANGE(0xc2, 0xc2) AM_DEVREADWRITE_LEGACY("wd1771", wd17xx_sector_r, wd17xx_sector_w)
505   AM_RANGE(0xc3, 0xc3) AM_DEVREADWRITE_LEGACY("wd1771", wd17xx_data_r, wd17xx_data_w)   
506   AM_RANGE(0xc4, 0xc4) AM_WRITE(disk_0_control)
507   AM_RANGE(0xcc, 0xcc) AM_NOP // CTC (?)
576508ADDRESS_MAP_END
577509
578510//
r13892r13893
755687{
756688   rm380z_state *state = screen.machine().driver_data<rm380z_state>();
757689
758   unsigned char* pChar=screen.machine().region("maincpu")->base()+0x1600;
690   unsigned char* pChar=screen.machine().region("gfx")->base();
759691   UINT16* scrptr = &bitmap.pix16(0, 0);
760692
761693   for (int row=0;row<screenrows;row++)
r13892r13893
813745
814746/* ROM definition */
815747ROM_START( rm380z )
816   ROM_REGION( 0x1600+0x1680, "maincpu", 0 )
817   ROM_LOAD( "cos40b-m.bin", 0x0000, 0x1000, CRC(1f0b3a5c) SHA1(0b29cb2a3b7eaa3770b34f08c4fd42844f42700f))
818   ROM_LOAD( "cos40b-m_f600-f9ff.bin", 0x1000, 0x400, CRC(e3397d9d) SHA1(490a0c834b0da392daf782edc7d51ca8f0668b1a))
819   ROM_LOAD( "cos40b-m_1c00-1dff.bin", 0x1400, 0x200, CRC(0f759f44) SHA1(9689c1c1faa62c56def999cbedbbb0c8d928dcff))
820   ROM_LOAD( "ch3.raw", 0x1600, 0x1680, CRC(e0b10221) SHA1(95304ccad9a7af49d79a349feb2bc23035f90abc))
748   ROM_REGION( 0x10000, "maincpu", 0 )
749   ROM_LOAD( "cos40b-m_1c00-1dff.bin", 0x1c00, 0x0200, CRC(0f759f44) SHA1(9689c1c1faa62c56def999cbedbbb0c8d928dcff))
750   ROM_LOAD( "cos40b-m.bin",          0xe000, 0x1000, CRC(1f0b3a5c) SHA1(0b29cb2a3b7eaa3770b34f08c4fd42844f42700f))
751   ROM_LOAD( "cos40b-m_f600-f9ff.bin", 0xf600, 0x0400, CRC(e3397d9d) SHA1(490a0c834b0da392daf782edc7d51ca8f0668b1a))
752   ROM_REGION( 0x1680, "gfx", 0 )
753   ROM_LOAD( "ch3.raw", 0x0000, 0x1680, CRC(e0b10221) SHA1(95304ccad9a7af49d79a349feb2bc23035f90abc))
821754ROM_END
822755
823756/* Driver */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team