Previous 15994 Revisions Next

r12031 Wednesday 22nd June, 2011 at 20:53:41 UTC by Curt Coder
[MPZ80] Added some logic to DJ2DB. (nw)
[src/emu/imagedev]flopdrv.c flopdrv.h
[src/mess/drivers]mpz80.c
[src/mess/machine]s100_dj2db.c s100_dj2db.h s100_mm65k16s.c

src/emu/imagedev/flopdrv.c
r12030r12031
938938      return !floppy_get_heads_per_disk(drive->floppy);
939939}
940940
941READ_LINE_DEVICE_HANDLER( floppy_index_r )
942{
943   floppy_drive *drive = get_safe_token(device);
944   return drive->idx;
945}
946
947READ_LINE_DEVICE_HANDLER( floppy_ready_r )
948{
949   return floppy_drive_get_flag_state(device, FLOPPY_DRIVE_READY);
950}
951
941952/*-------------------------------------------------
942953    DEVICE_IMAGE_SOFTLIST_LOAD(floppy)
943954-------------------------------------------------*/
src/emu/imagedev/flopdrv.h
r12030r12031
174174/* 2-sided disk */
175175READ_LINE_DEVICE_HANDLER( floppy_twosid_r );
176176
177// index pulse
178READ_LINE_DEVICE_HANDLER( floppy_index_r );
179
180// drive ready
181READ_LINE_DEVICE_HANDLER( floppy_ready_r );
182
177183DECLARE_LEGACY_IMAGE_DEVICE(FLOPPY, floppy);
178184
179185extern DEVICE_START( floppy );
src/mess/machine/s100_dj2db.c
r12030r12031
7070//  wd17xx_interface fdc_intf
7171//-------------------------------------------------
7272
73static const floppy_interface dj2db_floppy_interface =
73static const floppy_interface floppy_intf =
7474{
75   DEVCB_NULL,
76   DEVCB_NULL,
77   DEVCB_NULL,
78   DEVCB_NULL,
79   DEVCB_NULL,
80   FLOPPY_STANDARD_8_DSDD,
81   FLOPPY_OPTIONS_NAME(default),
82   "floppy_8",
75    DEVCB_NULL,
76    DEVCB_NULL,
77    DEVCB_NULL,
78    DEVCB_NULL,
79    DEVCB_NULL,
80    FLOPPY_STANDARD_8_DSDD,
81    FLOPPY_OPTIONS_NAME(default),
82    "floppy_8",
8383   NULL
8484};
8585
r12030r12031
9999static MACHINE_CONFIG_FRAGMENT( s100_dj2db )
100100   MCFG_COM8116_ADD(BR1941_TAG, XTAL_5_0688MHz, brg_intf)
101101   MCFG_WD179X_ADD(MB8866_TAG, fdc_intf) // FD1791
102   MCFG_FLOPPY_2_DRIVES_ADD(dj2db_floppy_interface)
102
103   MCFG_FLOPPY_2_DRIVES_ADD(floppy_intf)
103104MACHINE_CONFIG_END
104105
105106
r12030r12031
257258   device_s100_card_interface(mconfig, *this),
258259   device_slot_card_interface(mconfig, *this),
259260   m_fdc(*this, MB8866_TAG),
260   m_dbrg(*this, BR1941_TAG)
261   m_dbrg(*this, BR1941_TAG),
262   m_floppy0(*this, FLOPPY_0),
263   m_floppy1(*this, FLOPPY_1)
261264{
262265}
263266
r12030r12031
291294UINT8 s100_dj2db_device::s100_smemr_r(offs_t offset)
292295{
293296   UINT8 data = 0;
294   
297
295298   if ((offset >= 0xf800) && (offset < 0xfbf8))
296299   {
297      data = m_rom[offset & 0x3ff];
300      data = m_rom[offset & 0x3ff] ^ 0xff;
298301   }
299   else if (offset == 0xfbf8)
302   else if (offset == 0xfbf8) // SERIAL IN
300303   {
301304      // UART inverted data
302305   }
303   else if (offset == 0xfbf9)
306   else if (offset == 0xfbf9) // SERIAL STAT
304307   {
305      // UART inverted status
308      /*
309     
310         bit      description
311         
312         0     
313         1     
314         2     
315         3     
316         4     
317         5     
318         6     
319         7     
320     
321      */
306322   }
307   else if (offset == 0xfbfa)
323   else if (offset == 0xfbfa) // DISK STAT
308324   {
309      // disk jockey status
325      /*
326     
327         bit      description
328         
329         0      HEAD
330         1      DATA RQ
331         2      INT RQ
332         3      _TWO SIDED
333         4      _INDEX
334         5     
335         6     
336         7      _READY
337     
338      */
339     
340      data |= !m_head;
341      data |= !wd17xx_drq_r(m_fdc) << 1;
342      data |= !wd17xx_intrq_r(m_fdc) << 2;
343     
344      device_t *floppy = m_drive ? m_floppy1 : m_floppy0;
345      data |= floppy_twosid_r(floppy) << 3;
346      data |= floppy_index_r(floppy) << 4;
347      data |= floppy_ready_r(floppy) << 7;
310348   }
311349   else if ((offset >= 0xfbfc) && (offset < 0xfc00))
312350   {
r12030r12031
316354   {
317355      data = m_ram[offset & 0x3ff];
318356   }
357   else
358   {
359      return 0;
360   }
319361   
320   return data;
362   // LS241 inverts data
363   return data ^ 0xff;
321364}
322365
323366
r12030r12031
327370
328371void s100_dj2db_device::s100_mwrt_w(offs_t offset, UINT8 data)
329372{
330   if (offset == 0xfbf8)
373   // LS96 inverts data
374   data ^= 0xff;
375
376   if (offset == 0xfbf8) // SERIAL OUT
331377   {
332378      // UART inverted data
333379   }
334   else if (offset == 0xfbf9)
380   else if (offset == 0xfbf9) // DRIVE SEL
335381   {
336      // disk jockey function
382      /*
383     
384         bit      description
385         
386         0      DRIVE 1
387         1      DRIVE 2
388         2      DRIVE 3
389         3      DRIVE 4
390         4      IN USE / SIDE SELECT
391         5      INT ENBL
392         6      _ACCESS ENBL
393         7      START
394     
395      */
396     
397      if (BIT(data, 0)) m_drive = 0;
398      if (BIT(data, 1)) m_drive = 1;
399      //if (BIT(data, 2)) m_drive = 2;
400      //if (BIT(data, 3)) m_drive = 3;
401      wd17xx_set_drive(m_fdc, m_drive);
402     
403      wd17xx_set_side(m_fdc, BIT(data, 4));
404     
405      m_int_enbl = BIT(data, 5);
406      m_access_enbl = BIT(data, 6);
407      m_start = BIT(data, 7);
337408   }
338   else if (offset == 0xfbfa)
409   else if (offset == 0xfbfa) // FUNCTION SEL
339410   {
340      // drive control register
411      /*
412     
413         bit      description
414         
415         0      DOUBLE
416         1      8A SET
417         2      8A CLEAR
418         3      LED
419         4     
420         5     
421         6     
422         7     
423     
424      */
341425   }
426   else if (offset == 0xfbfb) // WAIT ENBL
427   {
428   }
342429   else if ((offset >= 0xfbfc) && (offset < 0xfc00))
343430   {
344431      wd17xx_w(m_fdc, offset & 0x03, data);
src/mess/machine/s100_dj2db.h
r12030r12031
6161   // internal state
6262   required_device<device_t> m_fdc;
6363   required_device<com8116_device> m_dbrg;
64   device_t *m_image0;
65   device_t *m_image1;
64   required_device<device_t> m_floppy0;
65   required_device<device_t> m_floppy1;
6666   
6767   UINT8 *m_rom;
6868   UINT8 *m_ram;
69   int m_drive;
70   int m_head;
71   int m_int_enbl;
72   int m_access_enbl;
73   int m_start;
6974};
7075
7176
src/mess/machine/s100_mm65k16s.c
r12030r12031
218218{
219219   m_s100 = machine().device<s100_device>("s100");
220220
221   m_ram = auto_alloc_array(machine(), UINT8, 0x10000);
221   m_ram = auto_alloc_array_clear(machine(), UINT8, 0x10000);
222222}
223223
224224
r12030r12031
239239{
240240   UINT8 data = 0;
241241
242   if (offset < 0x10000)
242   if (offset < 0xf800)
243243   {
244244      data = m_ram[offset];
245245   }
r12030r12031
254254
255255void s100_mm65k16s_device::s100_mwrt_w(offs_t offset, UINT8 data)
256256{
257   if (offset < 0x10000)
257   if (offset < 0xf800)
258258   {
259259      m_ram[offset] = data;
260260   }
src/mess/drivers/mpz80.c
r12030r12031
1010
1111    TODO:
1212
13    - "M0BAD"
1413    - trap logic
15        - trap reset
1614        - trap stop
1715        - trap aux
1816        - trap halt
r12030r12031
2119        - in/out trap
2220        - read/write trap
2321        - exec trap
24    - memory management
25        - task RAM
26        - mapping RAM
27        - attribute RAM
2822    - front panel LEDs
2923    - keyboard
3024    - I/O
3125        - Mult I/O (8259A PIC, 3x 8250 ACE, uPD1990C RTC, 4K ROM/RAM)
32        - Wunderbus I/O (8259A PIC, 3x 8250 ACE, uPD1990C RTC)
3326    - floppy
3427        - DJ/DMA controller (Z80, 1K RAM, 2/4K ROM, TTL floppy control logic) for 5.25" floppy drives
3528        - DJ2D/B controller for 8" floppy drives
3629    - hard disk
3730        - HDC/DMA controller (Seagate ST-506/Shugart SA1000)
3831        - HDCA controller (Shugart SA4000/Fujitsu M2301B/Winchester M2320B)
39    - memory
40        - MM65K16S (64K RAM, expandable to 1 MB)
4132    - AM9512 FPU
4233    - models
4334        - Decision I Desk Top Model D1 (MPZ80, MM65KS, Wunderbus)
r12030r12031
640631//**************************************************************************
641632
642633//-------------------------------------------------
643//  floppy_interface super6_floppy_interface
644//-------------------------------------------------
645
646static const floppy_interface mpz80_floppy_interface =
647{
648    DEVCB_NULL,
649    DEVCB_NULL,
650    DEVCB_NULL,
651    DEVCB_NULL,
652    DEVCB_NULL,
653    FLOPPY_STANDARD_8_DSDD,
654    FLOPPY_OPTIONS_NAME(default),
655    "floppy_8",
656   NULL
657};
658
659
660//-------------------------------------------------
661634//  GENERIC_TERMINAL_INTERFACE( terminal_intf )
662635//-------------------------------------------------
663636
r12030r12031
788761   MCFG_S100_SLOT_ADD(14, "s100_14", mpz80_s100_cards, NULL)
789762
790763   // devices
791   MCFG_FLOPPY_DRIVE_ADD(FLOPPY_0, mpz80_floppy_interface)
792764   MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf)
793765
794766   // internal ram

Previous 15994 Revisions Next


© 1998-2018 The MESS Team