Previous 15994 Revisions Next

r8169 Wednesday 26th May, 2010 at 12:01:54 UTC by Fabio Priuli
[SNES] Hopefully fixed SRAM issues introduced in svn.7797
[src/mame/machine]snes.c

src/mame/machine/snes.c
r8168r8169
999999      }
10001000      else if ((state->cart[0].mode == SNES_MODE_21) && (state->cart[0].sram > 0))
10011001      {
1002         int mask = (state->cart[0].sram - 1) | 0xff0000;   /* Limit SRAM size to what's actually present */
1003         value = snes_ram[0x300000 + (offset & mask)];
1002//         int mask = state->cart[0].sram - 1;   /* Limit SRAM size to what's actually present */
1003         value = snes_ram[0x300000 + offset];
10041004      }
10051005      else
10061006      {
r8168r8169
11231123   {
11241124      if (state->cart[0].sram > 0)
11251125      {
1126         int mask = (state->cart[0].sram - 1) | 0xff0000;   /* Limit SRAM size to what's actually present */
1126         int mask = state->cart[0].sram - 1;   /* Limit SRAM size to what's actually present */
11271127         value = snes_ram[0x700000 + (offset & mask)];
11281128      }
11291129      else
r8168r8169
11621162            value = memory_read_byte(space, offset);
11631163         else if ((offset >= 0x300000) && (state->cart[0].sram > 0))
11641164         {
1165            int mask = (state->cart[0].sram - 1) | 0xff0000;   /* Limit SRAM size to what's actually present */
1166            value = snes_ram[0x800000 + (offset & mask)];
1165//            int mask = state->cart[0].sram - 1;   /* Limit SRAM size to what's actually present */
1166            value = snes_ram[0x800000 + offset];
11671167         }
11681168         else                  /* Area 0x6000-0x8000 with offset < 0x300000 is reserved */
11691169         {
r8168r8169
13241324      }
13251325      else if ((state->cart[0].mode == SNES_MODE_21) && (state->cart[0].sram > 0))
13261326      {
1327         int mask = (state->cart[0].sram - 1) | 0xff0000;   /* Limit SRAM size to what's actually present */
1328         snes_ram[0x300000 + (offset & mask)] = data;
1327//         int mask = state->cart[0].sram - 1;   /* Limit SRAM size to what's actually present */
1328         snes_ram[0x300000 + offset] = data;
13291329      }
13301330      else
13311331         logerror("snes_w_bank2: Attempt to write to reserved address: %X = %02x\n", offset + 0x300000, data);
r8168r8169
13891389   {
13901390      if (state->cart[0].sram > 0)
13911391      {
1392         int mask = (state->cart[0].sram - 1) | 0xff0000;   /* Limit SRAM size to what's actually present */
1393         snes_ram[0x700000 + (offset & mask)] = data;
1392         int mask = state->cart[0].sram - 1;   /* Limit SRAM size to what's actually present */
1393         snes_ram[0x700000 +  + (offset & mask)] = data;
13941394      }
13951395      else
13961396         logerror("snes_w_bank5: Attempt to write to reserved address: %X = %02x\n", offset + 0x700000, data);
r8168r8169
14231423            memory_write_byte(space, offset, data);
14241424         else if ((offset >= 0x300000) && (state->cart[0].sram > 0))
14251425         {
1426            int mask = (state->cart[0].sram - 1) | 0xff0000;   /* Limit SRAM size to what's actually present */
1427            snes_ram[0x800000 + (offset & mask)] = data;
1426//            int mask = state->cart[0].sram - 1;   /* Limit SRAM size to what's actually present */
1427            snes_ram[0x800000 + offset] = data;
14281428         }
14291429         else   /* Area in 0x6000-0x8000 && offset < 0x300000 is Reserved! */
14301430            logerror("snes_w_bank6: Attempt to write to reserved address: %X = %02x\n", offset + 0x800000, data);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team