Previous 199869 Revisions Next

r21602 Tuesday 5th March, 2013 at 18:49:26 UTC by Fabio Priuli
this should be more accurate. nw.
[src/mess/drivers]snes.c

trunk/src/mess/drivers/snes.c
r21601r21602
7070   DECLARE_READ8_MEMBER(snes_oldjoy1_read);
7171   DECLARE_READ8_MEMBER(snes_oldjoy2_read);
7272
73   UINT8 m_sfx_ram[0x200000];   // or 0x100000?
73   UINT8 m_sfx_ram[0x200000];  // or 0x100000?
7474};
7575
7676/*************************************
r21601r21602
191191   if ((m_has_addon_chip == HAS_SPC7110 || m_has_addon_chip == HAS_SPC7110_RTC)
192192      && offset >= 0x500000 && offset < 0x510000)
193193      return spc7110_mmio_read(space, 0x4800);
194   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
195      && offset < 0x400000)
196   {
197      if (address >= 0x3000 && address < 0x3300)
198         return superfx_mmio_read(m_superfx, address);
199      if (address >= 0x6000 && address < 0x8000)
200         return superfx_access_ram(m_superfx) ? m_sfx_ram[offset & 0x1fff] : snes_open_bus_r(space, 0);
201   }
202   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
203      && offset >= 0x400000 && offset < 0x600000)
204   {
205      if (superfx_access_rom(m_superfx))
206         return snes_ram[offset];
207      else
208      {
209         static const UINT8 sfx_data[16] = {
210            0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01,
211            0x00, 0x01, 0x08, 0x01, 0x00, 0x01, 0x0c, 0x01,
212         };
213         return sfx_data[offset & 0x0f];
214      }
215   }
216   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
217      && offset >= 0x600000)
218      return superfx_access_ram(m_superfx) ? m_sfx_ram[offset & 0xfffff] : snes_open_bus_r(space, 0);
194   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL)
195      return space.read_byte(offset + 0x800000);     // [00-7f] same as [80-ff]
219196
220197   // base cart access
221198   if (offset < 0x300000)
r21601r21602
286263   if ((m_has_addon_chip == HAS_SPC7110 || m_has_addon_chip == HAS_SPC7110_RTC)
287264      && offset >= 0x500000)
288265      return spc7110_bank7_read(space, offset - 0x400000);
289   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL)
290      return space.read_byte(offset);     // [80-ff] same as [00-7f]
266   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
267      && offset < 0x400000)
268   {
269      if (address >= 0x3000 && address < 0x3300)
270         return superfx_mmio_read(m_superfx, address);
271      if (address >= 0x6000 && address < 0x8000)
272         return superfx_access_ram(m_superfx) ? m_sfx_ram[offset & 0x1fff] : snes_open_bus_r(space, 0);
273   }
274   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
275      && offset >= 0x400000 && offset < 0x600000)
276   {
277      if (superfx_access_rom(m_superfx))
278         return snes_ram[offset];
279      else
280      {
281         static const UINT8 sfx_data[16] = {
282            0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01,
283            0x00, 0x01, 0x08, 0x01, 0x00, 0x01, 0x0c, 0x01,
284         };
285         return sfx_data[offset & 0x0f];
286      }
287   }
288   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
289      && offset >= 0x600000)
290      return superfx_access_ram(m_superfx) ? m_sfx_ram[offset & 0xfffff] : snes_open_bus_r(space, 0);
291291
292292   // base cart access
293293   if (offset < 0x400000)
r21601r21602
363363      if (offset >= 0x300000 && offset < 0x310000 && address >= 0x6000 && address < 0x8000)
364364      {   snes_ram[0x306000 + (address & 0x1fff)] = data; return; }
365365   }
366   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
367         && offset < 0x400000)
368   {
369      if (address >= 0x3000 && address < 0x3300)
370      {   superfx_mmio_write(m_superfx, address, data);   return; }
371      if (address >= 0x6000 && address < 0x8000)
372      {   m_sfx_ram[offset & 0x1fff] = data;  return; }
373   }
374   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
375      && offset >= 0x600000)
376   {   m_sfx_ram[offset & 0xfffff] = data; return; }
366   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL)
367   {   space.write_byte(offset + 0x800000, data); return; }       // [00-7f] same as [80-ff]
377368
378369   // base cart access
379370   if (offset < 0x300000)
r21601r21602
455446      if (offset >= 0x300000 && offset < 0x310000 && address >= 0x6000 && address < 0x8000)
456447      {   snes_ram[0x306000 + (address & 0x1fff)] = data; return; }
457448   }
458   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL)
459   {   space.write_byte(offset, data); return; }       // [80-ff] same as [00-7f]
449   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
450      && offset < 0x400000)
451   {
452      if (address >= 0x3000 && address < 0x3300)
453      {   superfx_mmio_write(m_superfx, address, data);   return; }
454      if (address >= 0x6000 && address < 0x8000)
455      {   m_sfx_ram[offset & 0x1fff] = data;  return; }
456   }
457   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
458      && offset >= 0x600000)
459   {   m_sfx_ram[offset & 0xfffff] = data; return; }
460460
461461   // base cart access
462462   if (offset < 0x400000)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team