Previous 199869 Revisions Next

r18382 Tuesday 9th October, 2012 at 14:33:03 UTC by Miodrag Milanović
Changed b2m to use new wd1773 core, and updated core to set head signal when seek is done,system still doesn't boot (no whatsnew)
[src/mess/drivers]b2m.c
[src/mess/includes]b2m.h
[src/mess/machine]b2m.c wd1772.c wd1772.h

trunk/src/mess/includes/b2m.h
r18381r18382
1010#include "machine/i8255.h"
1111#include "machine/pit8253.h"
1212#include "machine/pic8259.h"
13#include "machine/wd1772.h"
1314#include "sound/speaker.h"
1415#include "sound/wave.h"
1516
r18381r18382
3536   UINT8 m_vblank_state;
3637
3738   /* devices */
38   device_t *m_fdc;
39   wd1773_t *m_fdc;
3940   device_t *m_pic;
4041   device_t *m_speaker;
4142   DECLARE_READ8_MEMBER(b2m_keyboard_r);
trunk/src/mess/drivers/b2m.c
r18381r18382
1414#include "machine/pit8253.h"
1515#include "machine/pic8259.h"
1616#include "machine/i8251.h"
17#include "machine/wd17xx.h"
17#include "formats/hxcmfm_dsk.h"
18#include "formats/mfi_dsk.h"
1819#include "imagedev/flopdrv.h"
19#include "formats/basicdsk.h"
20#include "machine/wd1772.h"
2021#include "machine/ram.h"
2122#include "includes/b2m.h"
2223
r18381r18382
3940   AM_RANGE(0x10, 0x13) AM_READWRITE(b2m_palette_r,b2m_palette_w)
4041   AM_RANGE(0x14, 0x15) AM_DEVREADWRITE_LEGACY("pic8259", pic8259_r, pic8259_w )
4142   AM_RANGE(0x18, 0x18) AM_DEVREADWRITE("uart", i8251_device, data_r, data_w)
42   AM_RANGE(0x19, 0x19)  AM_DEVREADWRITE("uart", i8251_device, status_r, control_w)
43   AM_RANGE(0x1c, 0x1c) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_status_r,wd17xx_command_w)
44   AM_RANGE(0x1d, 0x1d) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_track_r,wd17xx_track_w)
45   AM_RANGE(0x1e, 0x1e) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_sector_r,wd17xx_sector_w)
46   AM_RANGE(0x1f, 0x1f) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_data_r,wd17xx_data_w)
43   AM_RANGE(0x19, 0x19) AM_DEVREADWRITE("uart", i8251_device, status_r, control_w)
44   AM_RANGE(0x1c, 0x1f) AM_DEVREADWRITE("wd1793", wd1773_t, read, write)
4745ADDRESS_MAP_END
4846
4947static ADDRESS_MAP_START( b2m_rom_io, AS_IO, 8, b2m_state )
r18381r18382
175173   PORT_CONFSETTING(   0x01, "Color")
176174   PORT_CONFSETTING(   0x00, "B/W")
177175INPUT_PORTS_END
178
176/*
179177static LEGACY_FLOPPY_OPTIONS_START(b2m)
180178   LEGACY_FLOPPY_OPTION(b2m, "cpm", "Bashkiria-2M disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
181179      HEADS([2])
r18381r18382
184182      SECTOR_LENGTH([1024])
185183      FIRST_SECTOR_ID([1]))
186184LEGACY_FLOPPY_OPTIONS_END
185*/
187186
188static const floppy_interface b2m_floppy_interface =
189{
190   DEVCB_NULL,
191   DEVCB_NULL,
192   DEVCB_NULL,
193   DEVCB_NULL,
194   DEVCB_NULL,
195   FLOPPY_STANDARD_5_25_DSHD,
196   LEGACY_FLOPPY_OPTIONS_NAME(b2m),
197   NULL,
187static const floppy_format_type floppy_formats[] = {
188   FLOPPY_MFM_FORMAT, FLOPPY_MFI_FORMAT,
198189   NULL
199190};
200191
192static SLOT_INTERFACE_START( b2m_floppies )
193   SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
194SLOT_INTERFACE_END
195
196
201197/* Machine driver */
202198static MACHINE_CONFIG_START( b2m, b2m_state )
203199    /* basic machine hardware */
r18381r18382
236232   /* uart */
237233   MCFG_I8251_ADD("uart", default_i8251_interface)
238234
239   MCFG_FD1793_ADD("wd1793", default_wd17xx_interface_2_drives )
235   MCFG_WD1773x_ADD("wd1793", XTAL_8MHz )
240236
241   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(b2m_floppy_interface)
237   MCFG_FLOPPY_DRIVE_ADD("fd0", b2m_floppies, "525dd", 0, floppy_formats)
238   MCFG_FLOPPY_DRIVE_ADD("fd1", b2m_floppies, "525dd", 0, floppy_formats)
242239
243240   /* internal ram */
244241   MCFG_RAM_ADD(RAM_TAG)
trunk/src/mess/machine/wd1772.c
r18381r18382
255255         break;
256256
257257      case SEEK_DONE:
258         if (!has_motor()) status |= S_HLD;
259
258260         if(command & 0x04) {
259261            sub_state = SCAN_ID;
260262            counter = 0;
trunk/src/mess/machine/wd1772.h
r18381r18382
209209      S_CRC  = 0x08,
210210      S_RNF  = 0x10,
211211      S_SPIN = 0x20,
212      S_HLD  = 0x20,
212213      S_DDM  = 0x20,
213214      S_WP   = 0x40,
214      S_MON  = 0x80
215      S_MON  = 0x80,
216      S_NRDY = 0x80
215217   };
216218
217219   floppy_image_device *floppy;
trunk/src/mess/machine/b2m.c
r18381r18382
1212#include "imagedev/cassette.h"
1313#include "machine/i8255.h"
1414#include "machine/pit8253.h"
15#include "machine/wd17xx.h"
15#include "machine/wd1772.h"
1616#include "machine/pic8259.h"
1717#include "machine/i8251.h"
1818#include "includes/b2m.h"
r18381r18382
206206{
207207   UINT8 drive = ((data >> 1) & 1) ^ 1;
208208   UINT8 side  = (data  & 1) ^ 1;
209   floppy_mon_w(floppy_get_device(machine(), 0), 1);
210   floppy_mon_w(floppy_get_device(machine(), 1), 1);
209   
210   static const char *names[] = { "fd0", "fd1"};
211   floppy_image_device *floppy = NULL;
212   floppy_connector *con = machine().device<floppy_connector>(names[drive]);
213   if(con)
214      floppy = con->get_device();
211215
216   floppy->mon_w(0);
217   m_fdc->set_floppy(floppy);
212218   if (m_b2m_drive!=drive) {
213      wd17xx_set_drive(m_fdc,drive);
214      floppy_mon_w(floppy_get_device(machine(), 0), 0);
215      floppy_drive_set_ready_state(floppy_get_device(machine(), 0), 1, 1);
216219      m_b2m_drive = drive;
217220   }
218   if (m_b2m_side!=side) {
219      wd17xx_set_side(m_fdc,side);
220      floppy_mon_w(floppy_get_device(machine(), 1), 0);
221      floppy_drive_set_ready_state(floppy_get_device(machine(), 1), 1, 1);
221   floppy->ss_w(side);
222   if (m_b2m_side!=side) {   
222223      m_b2m_side = side;
223224   }
224   wd17xx_dden_w(m_fdc, 0);
225225}
226226
227227I8255A_INTERFACE( b2m_ppi8255_interface_2 )
r18381r18382
312312void b2m_state::machine_start()
313313{
314314   m_pic = machine().device("pic8259");
315   m_fdc = machine().device("wd1793");
315   m_fdc = machine().device<wd1773_t>("wd1793");
316316   m_speaker = machine().device(SPEAKER_TAG);
317317
318   wd17xx_set_pause_time(m_fdc,10);
319
320318   /* register for state saving */
321319   save_item(NAME(m_b2m_8255_porta));
322320   save_item(NAME(m_b2m_video_scroll));

Previous 199869 Revisions Next


© 1997-2024 The MAME Team