Previous 199869 Revisions Next

r21601 Tuesday 5th March, 2013 at 18:29:55 UTC by Fabio Priuli
another one. nw.
[src/mess/drivers]snes.c

trunk/src/mess/drivers/snes.c
r21600r21601
6969   DECLARE_WRITE8_MEMBER(snes_input_read);
7070   DECLARE_READ8_MEMBER(snes_oldjoy1_read);
7171   DECLARE_READ8_MEMBER(snes_oldjoy2_read);
72
73   UINT8 m_sfx_ram[0x200000];   // or 0x100000?
7274};
7375
7476/*************************************
r21600r21601
194196   {
195197      if (address >= 0x3000 && address < 0x3300)
196198         return superfx_mmio_read(m_superfx, address);
197      if (address >= 0x6000 && address < 0x8000)   // here it should be snes_ram[0xe00000+...] but there are mirroring issues
198         return superfx_access_ram(m_superfx) ? snes_ram[0xf00000 + (offset & 0x1fff)] : snes_open_bus_r(space, 0);
199      if (address >= 0x6000 && address < 0x8000)
200         return superfx_access_ram(m_superfx) ? m_sfx_ram[offset & 0x1fff] : snes_open_bus_r(space, 0);
199201   }
200202   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
201203      && offset >= 0x400000 && offset < 0x600000)
r21600r21601
213215   }
214216   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
215217      && offset >= 0x600000)
216      return superfx_access_ram(m_superfx) ? snes_ram[0x800000 + offset] : snes_open_bus_r(space, 0);
218      return superfx_access_ram(m_superfx) ? m_sfx_ram[offset & 0xfffff] : snes_open_bus_r(space, 0);
217219
218220   // base cart access
219221   if (offset < 0x300000)
r21600r21601
366368   {
367369      if (address >= 0x3000 && address < 0x3300)
368370      {   superfx_mmio_write(m_superfx, address, data);   return; }
369      if (address >= 0x6000 && address < 0x8000)   // here it should be snes_ram[0xe00000+...] but there are mirroring issues
370      {   snes_ram[0xf00000 + (offset & 0x1fff)] = data;  return; }
371      if (address >= 0x6000 && address < 0x8000)
372      {   m_sfx_ram[offset & 0x1fff] = data;  return; }
371373   }
372374   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
373375      && offset >= 0x600000)
374   {   snes_ram[0x800000 + offset] = data; return; }
376   {   m_sfx_ram[offset & 0xfffff] = data; return; }
375377
376378   // base cart access
377379   if (offset < 0x300000)
r21600r21601
476478READ8_MEMBER( snes_console_state::superfx_r_bank3 )
477479{
478480   /* IMPORTANT: SFX RAM sits in 0x600000-0x7fffff, and it's mirrored in 0xe00000-0xffffff. However, SNES
479    has only access to 0x600000-0x7dffff (because there is WRAM after that), hence we directly use the mirror
480    as the place where to write & read SFX RAM. SNES handlers have been setup accordingly. */
481    has only access to 0x600000-0x7dffff (because there is WRAM after that). */
481482   //printf("superfx_r_bank3: %08x = %02x\n", offset, snes_ram[0xe00000 + offset]);
482   return snes_ram[0xe00000 + offset];
483   return m_sfx_ram[offset & 0xfffff];
483484}
484485
485486WRITE8_MEMBER( snes_console_state::superfx_w_bank3 )
486487{
487488   /* IMPORTANT: SFX RAM sits in 0x600000-0x7fffff, and it's mirrored in 0xe00000-0xffffff. However, SNES
488    has only access to 0x600000-0x7dffff (because there is WRAM after that), hence we directly use the mirror
489    as the place where to write & read SFX RAM. SNES handlers have been setup accordingly. */
489    has only access to 0x600000-0x7dffff (because there is WRAM after that). */
490490   //printf("superfx_w_bank3: %08x = %02x\n", offset, data);
491   snes_ram[0xe00000 + offset] = data;
491   m_sfx_ram[offset & 0xfffff] = data;
492492}
493493
494494/*************************************

Previous 199869 Revisions Next


© 1997-2024 The MAME Team