Previous 15994 Revisions Next

r5017 Saturday 13th June, 2009 at 23:17:29 UTC by Barry Rodewald
[FM7] Added DIP switches and implemented DOS and BASIC modes.
[src/mess/drivers]fm7.c
[src/mess/formats]fm7_dsk.c

src/mess/formats/fm7_dsk.c
r5016r5017
8080   if(offset > tag->image_size)
8181      return 0;
8282
83   logerror("d77_get_sector_offset - returns %08x\n",offset+16);
83   logerror("d77_get_sector_offset - track %i, side %i, returns %08x\n",track,head,offset+16);
8484   return offset + 16;   
8585}
8686
r5016r5017
134134
135135static floperr_t d77_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buffer_len)
136136{
137   logerror("D77: about to read track %i, sector %02x, side %i\n",track,sector,head);
138137   return d77_read_sector(floppy,head,track,sector,buffer,buffer_len);
139138}
140139
src/mess/drivers/fm7.c
r5016r5017
844844   AM_RANGE(0xfd38,0xfd3f) AM_READWRITE(fm7_palette_r,fm7_palette_w)
845845   AM_RANGE(0xfd40,0xfdff) AM_READ(fm7_unknown_r)
846846   // Boot ROM
847   AM_RANGE(0xfe00,0xffdf) AM_ROM AM_REGION("basic",0x0000)
847   AM_RANGE(0xfe00,0xffdf) AM_ROMBANK(2)
848848   AM_RANGE(0xffe0,0xffef) AM_RAM
849849   AM_RANGE(0xfff0,0xffff) AM_READWRITE(vector_r,vector_w)
850850ADDRESS_MAP_END
r5016r5017
993993  PORT_BIT(0x00000008,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("CAP") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE
994994  PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("GRAPH") PORT_CODE(KEYCODE_RALT)
995995  PORT_BIT(0x00000020,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Kana") PORT_CODE(KEYCODE_RCONTROL) PORT_TOGGLE
996
997  PORT_START("DSW")
998  PORT_DIPNAME(0x01,0x00,"Switch A") PORT_DIPLOCATION("SWA:1")
999  PORT_DIPSETTING(0x00,DEF_STR( Off ))
1000  PORT_DIPSETTING(0x01,DEF_STR( On ))
1001  PORT_DIPNAME(0x02,0x00,"Boot mode") PORT_DIPLOCATION("SWA:2")
1002  PORT_DIPSETTING(0x00,"BASIC")
1003  PORT_DIPSETTING(0x02,"DOS")
1004  PORT_DIPNAME(0x04,0x00,"FM-8 Compatibility mode") PORT_DIPLOCATION("SWA:3")
1005  PORT_DIPSETTING(0x00,DEF_STR( Off ))
1006  PORT_DIPSETTING(0x04,DEF_STR( On ))
1007  PORT_DIPNAME(0x08,0x00,"Switch D") PORT_DIPLOCATION("SWA:4")
1008  PORT_DIPSETTING(0x00,DEF_STR( Off ))
1009  PORT_DIPSETTING(0x08,DEF_STR( On ))
9961010INPUT_PORTS_END
9971011
9981012static DRIVER_INIT(fm7)
r5016r5017
10401054   fm7_psg_regsel = 0;
10411055   fdc_side = 0;
10421056   fdc_drive = 0;
1057   
1058   // set boot mode
1059   if(input_port_read(machine,"DSW") & 0x02)
1060   {  // DOS mode
1061      memory_set_bankptr(machine,2,memory_region(machine,"dos"));
1062   }
1063   else
1064   {  // BASIC mode
1065      memory_set_bankptr(machine,2,memory_region(machine,"basic"));
1066   }
10431067}
10441068
10451069static VIDEO_START( fm7 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team