Previous 15994 Revisions Next

r12019 Tuesday 21st June, 2011 at 20:45:30 UTC by Curt Coder
[MPZ80] Added DJ2/DB memory map. (nw)
[src/mess/machine]s100_dj2db.c s100_dj2db.h

src/mess/machine/s100_dj2db.c
r12018r12019
3333//-------------------------------------------------
3434
3535ROM_START( dj2db )
36   ROM_REGION( 0x400, "dj2db", 0 )
36   ROM_REGION( 0x400, "dj2db", ROMREGION_INVERT ) // TODO does not invert currently
3737   ROM_LOAD( "bv-2 f8.11d", 0x000, 0x400, CRC(b6218d0b) SHA1(e4b2ae886c0dd7717e2e02ae2e202115d8ec2def) )
3838
3939   ROM_REGION( 0x220, "proms", 0 )
r12018r12019
269269void s100_dj2db_device::device_start()
270270{
271271   m_s100 = machine().device<s100_device>("s100");
272
273   m_rom = subregion("dj2db")->base();
274   m_ram = auto_alloc_array(machine(), UINT8, 0x400);
272275}
273276
274277
r12018r12019
287290
288291UINT8 s100_dj2db_device::s100_smemr_r(offs_t offset)
289292{
290   return 0;
293   UINT8 data = 0;
294   
295   if ((offset >= 0xf800) && (offset < 0xfbf8))
296   {
297      data = m_rom[offset & 0x3ff] ^ 0xff; // TODO remove ^0xff once ROMREGION_INVERT has been fixed
298   }
299   else if (offset == 0xfbf8)
300   {
301      // UART inverted data
302   }
303   else if (offset == 0xfbf9)
304   {
305      // UART inverted status
306   }
307   else if (offset == 0xfbfa)
308   {
309      // disk jockey status
310   }
311   else if ((offset >= 0xfbfc) && (offset < 0xfc00))
312   {
313      data = wd17xx_r(m_fdc, offset & 0x03);
314   }
315   else if ((offset >= 0xfc00) && (offset < 0x10000))
316   {
317      data = m_ram[offset & 0x3ff];
318   }
319   
320   return data;
291321}
292322
293323
r12018r12019
297327
298328void s100_dj2db_device::s100_mwrt_w(offs_t offset, UINT8 data)
299329{
330   if (offset == 0xfbf8)
331   {
332      // UART inverted data
333   }
334   else if (offset == 0xfbf9)
335   {
336      // disk jockey function
337   }
338   else if (offset == 0xfbfa)
339   {
340      // drive control register
341   }
342   else if ((offset >= 0xfbfc) && (offset < 0xfc00))
343   {
344      wd17xx_w(m_fdc, offset & 0x03, data);
345   }
346   else if ((offset >= 0xfc00) && (offset < 0x10000))
347   {
348      m_ram[offset & 0x3ff] = data;
349   }
300350}
301351
302352
src/mess/machine/s100_dj2db.h
r12018r12019
6363   required_device<com8116_device> m_dbrg;
6464   device_t *m_image0;
6565   device_t *m_image1;
66   
67   UINT8 *m_rom;
68   UINT8 *m_ram;
6669};
6770
6871

Previous 15994 Revisions Next


© 1998-2018 The MESS Team