Previous 199869 Revisions Next

r22081 Monday 25th March, 2013 at 16:15:22 UTC by Angelo Salese
Hooked up DIPs, tries to read from the FDC
[src/mess/drivers]mz3500.c

trunk/src/mess/drivers/mz3500.c
r22080r22081
44
55   preliminary driver by Angelo Salese
66
7   Notes:
8   Sub-CPU test meanings:
9   * RA (tests RAM, first is work RAM, other two are shared RAM banks)
10   * VR (tests VRAM)
11   * CRT interface test:
12      - 40x20
13      - 80x25
14      - monochrome attribute test
15      - 80x25 color test (text B-R-G-W, border: black, blue, red, green, black)
16      - 40x20 color test (text B-R-G-W, border: black, blue, red, green, black)
17   * Speaker test
18   * PR (Printer interface test)
19   * LP (Light pen test)
20   * RS (RS-232C interface test)
21
722***************************************************************************/
823
924
r22080r22081
4459   UINT8 m_ma,m_mo,m_ms,m_me2,m_me1;
4560   UINT8 m_crtc[0x10];
4661
62   UINT8 m_fdd_sel;
63
4764   DECLARE_READ8_MEMBER(mz3500_master_mem_r);
4865   DECLARE_WRITE8_MEMBER(mz3500_master_mem_w);
4966   DECLARE_READ8_MEMBER(mz3500_ipl_r);
r22080r22081
119136   UINT8 width80;
120137   UINT8 char_size;
121138   UINT8 hires;
139   UINT8 color_mode;
122140
123141//   popmessage("%02x",state->m_crtc[6]);
124142
143   color_mode = state->m_crtc[4] & 1;
125144   width80 = (state->m_crtc[5] & 2) >> 1;
126145   hires = (state->m_crtc[6] & 1);
127146   char_size = (hires) ? 16 : 8;
r22080r22081
143162            int res_x,res_y;
144163            int pen;
145164
146            /* TODO: color attribute needs double check */
147
148165            if(yi >= char_size)
149166               pen = -1;
150167            else
151168            {
152               if(state->m_crtc[4] & 1)
153                  pen = (tile_data >> (7-xi)) & 1 ? (attr >> 1) : -1;
169               if(color_mode)
170                  pen = (tile_data >> (7-xi)) & 1 ? (attr ^ 7) : -1;
154171               else
172               {
173                  /* TODO: "highlight"  */
174                  //if(attr & 4)
175                  //   tile_data ^= 0xff;
176
177                  if(attr & 1) // VL
178                     tile_data |= 8;
179
180                  /* TODO: correct position of HL */
181                  if(attr & 2 && yi == char_size/2) // HL
182                     tile_data |= 0xff;
183
184                  /* TODO: blink (bit 3) */
185
155186                  pen = (tile_data >> (7-xi)) & 1 ? 7 : -1;
187               }
156188            }
157189
158190            res_x = x * 8 + xi;
r22080r22081
419451
420452READ8_MEMBER(mz3500_state::mz3500_fdc_r)
421453{
454   static const char *const m_fddnames[4] = { "upd765a:0", "upd765a:1", "upd765a:2", "upd765a:3"};
455
422456   /*
423457   ---- -x-- Motor
424458   ---- --x- Index
425459   ---- ---x Drq
426460   */
427461   floppy_image_device *floppy;
428   floppy = machine().device<floppy_connector>(":upd765a:0")->get_device();
462   floppy = machine().device<floppy_connector>(m_fddnames[m_fdd_sel])->get_device();
429463
430464   return floppy->idx_r() << 1;
431465}
r22080r22081
439473   ---x ---- motor on signal
440474   ---- xxxx Select FDD 0-3 (bit-wise)
441475   */
476   static const char *const m_fddnames[4] = { "upd765a:0", "upd765a:1", "upd765a:2", "upd765a:3"};
477
478   for(int i=0;i<4;i++)
479   {
480      if(data & 1 << i)
481      {
482         m_fdd_sel = i;
483         break;
484      }
485   }
486
487   machine().device<floppy_connector>(m_fddnames[m_fdd_sel])->get_device()->mon_w(data & 0x10 ? ASSERT_LINE : CLEAR_LINE);
488
442489}
443490
444491static ADDRESS_MAP_START( mz3500_master_map, AS_PROGRAM, 8, mz3500_state )
r22080r22081
447494
448495static ADDRESS_MAP_START( mz3500_master_io, AS_IO, 8, mz3500_state )
449496   ADDRESS_MAP_GLOBAL_MASK(0xff)
497//   ADDRESS_MAP_UNMAP_HIGH
450498//  AM_RANGE(0xe4, 0xe7) SFD upd765
451499//   AM_RANGE(0xe8, 0xeb) SFD I/O port and DMAC chip select
452500//   AM_RANGE(0xec, 0xef) irq signal from slave to master CPU
r22080r22081
464512
465513static ADDRESS_MAP_START( mz3500_slave_io, AS_IO, 8, mz3500_state )
466514   ADDRESS_MAP_GLOBAL_MASK(0xff)
515   ADDRESS_MAP_UNMAP_HIGH
467516//   AM_RANGE(0x00, 0x0f) f/f and irq to master CPU
468517//   AM_RANGE(0x10, 0x1f) i8251
469518//   AM_RANGE(0x20, 0x2f) pit8253
470519//   AM_RANGE(0x30, 0x3f) i8255
471//   AM_RANGE(0x40, 0x4f) 8-bit input port
520   AM_RANGE(0x40, 0x40) AM_READ_PORT("DSW")
472521   AM_RANGE(0x50, 0x5f) AM_RAM_WRITE(mz3500_crtc_w)
473522   AM_RANGE(0x60, 0x61) AM_DEVREADWRITE("upd7220_gfx", upd7220_device, read, write)
474523   AM_RANGE(0x70, 0x71) AM_DEVREADWRITE("upd7220_chr", upd7220_device, read, write)
475524ADDRESS_MAP_END
476525
477526static INPUT_PORTS_START( mz3500 )
478   /* dummy active high structure */
479   PORT_START("SYSA")
527   PORT_START("DSW")
480528   PORT_DIPNAME( 0x01, 0x00, "SYSA" )
481529   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
482530   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r22080r22081
498546   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
499547   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
500548   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
501   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
502   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
503   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
549   PORT_DIPNAME( 0x80, 0x80, "Sub-CPU Test" )
550   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
551   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
504552
505553   /* dummy active low structure */
506554   PORT_START("DSWA")
r22080r22081
615663   MCFG_CPU_PROGRAM_MAP(mz3500_slave_map)
616664   MCFG_CPU_IO_MAP(mz3500_slave_io)
617665
666   MCFG_QUANTUM_PERFECT_CPU("master")
667
618668   MCFG_UPD765A_ADD("upd765a", true, true)
619669   MCFG_FLOPPY_DRIVE_ADD("upd765a:0", mz3500_floppies, "525hd", 0, floppy_image_device::default_floppy_formats)
620670   MCFG_FLOPPY_DRIVE_ADD("upd765a:1", mz3500_floppies, "525hd", 0, floppy_image_device::default_floppy_formats)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team