Previous 199869 Revisions Next

r21799 Monday 11th March, 2013 at 11:53:09 UTC by Fabio Priuli
(MESS) snes: cleaned up snesnew memory handlers. nw.
[src/mess/drivers]snes.c

trunk/src/mess/drivers/snes.c
r21798r21799
15861586   DECLARE_WRITE8_MEMBER( snesbsx_hi_w );
15871587   DECLARE_READ8_MEMBER( snesbsx_lo_r );
15881588   DECLARE_WRITE8_MEMBER( snesbsx_lo_w );
1589   DECLARE_READ8_MEMBER( snesnew_lo_r );
1590   DECLARE_READ8_MEMBER( snesnew_hi_r );
1591   DECLARE_WRITE8_MEMBER( snesnew_lo_w );
1592   DECLARE_WRITE8_MEMBER( snesnew_hi_w );
15931589
15941590   optional_device<sns_cart_slot_device> m_slotcart;
15951591   int m_type;
15961592};
15971593
1594//---------------------------------------------------------------------------------
1595// LoROM & LoROM + BSX slot & LoROM + some add-on chips
1596//---------------------------------------------------------------------------------
15981597
1599// FIXME: merge these add-on specific maps into something more sane!
1600
16011598// In general LoROM games have perfect mirror between 0x00-0x7d and 0x80-0xff
16021599// But BSX+LoROM games use different read handlers (to access ROM beyond 2MB)
16031600// so we use two different set of handlers...
16041601
1605// LoROM
1602// Also we have here LoROM + CX4, until the Hitachi CPU is emulated,
1603// and the LoROM + Seta DSP, because their chip_read/chip_write need global offset
16061604
16071605READ8_MEMBER( snsnew_state::snes20_hi_r )
16081606{
16091607   UINT16 address = offset & 0xffff;
16101608
1609   // take care of add-on IO
1610   if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
1611         && (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000))
1612      return m_slotcart->m_cart->chip_read(space, offset);
1613   else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
1614         && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000))
1615      return m_slotcart->m_cart->chip_read(space, offset);
1616   else if (m_slotcart->get_type() == SNES_CX4
1617         && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))    // hack until we emulate the real CPU
1618      return CX4_read((offset & 0xffff) - 0x6000);
1619
16111620   if (offset < 0x400000)
16121621   {
16131622      if (address < 0x2000)
r21798r21799
16541663{
16551664   UINT16 address = offset & 0xffff;
16561665
1657   if (m_type == SNES_SUFAMITURBO && address >= 0x8000 && ((offset >= 0x600000 && offset < 0x640000) || (offset >= 0x700000 && offset < 0x740000)))
1666   // take care of add-on IO
1667   if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
1668         && (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000))
1669   { m_slotcart->m_cart->chip_write(space, offset, data); return; }
1670   else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
1671         && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000))
1672   { m_slotcart->m_cart->chip_write(space, offset, data); return; }
1673   else if (m_slotcart->get_type() == SNES_CX4
1674         && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))    // hack until we emulate the real CPU
1675   { CX4_write(space.machine(), (offset & 0xffff) - 0x6000, data); return; }
1676   else if (m_type == SNES_SUFAMITURBO
1677         && address >= 0x8000 && ((offset >= 0x600000 && offset < 0x640000) || (offset >= 0x700000 && offset < 0x740000)))
16581678   { m_slotcart->m_cart->write_h(space, offset, data); return; }
16591679
16601680   if (offset < 0x400000)
r21798r21799
16811701{
16821702   UINT16 address = offset & 0xffff;
16831703
1704   // take care of add-on IO
1705   if ((m_slotcart->get_type() == SNES_ST010 /*|| m_slotcart->get_type() == SNES_ST011*/) // why does this break moritash?
1706         && (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000))
1707      return m_slotcart->m_cart->chip_read(space, offset);
1708   else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
1709         && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000))
1710      return m_slotcart->m_cart->chip_read(space, offset);
1711   else if (m_slotcart->get_type() == SNES_CX4
1712         && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))    // hack until we emulate the real CPU
1713      return CX4_read((offset & 0xffff) - 0x6000);
1714
16841715   if (offset < 0x400000)
16851716   {
16861717      if (address < 0x2000)
r21798r21799
17251756
17261757WRITE8_MEMBER( snsnew_state::snes20_lo_w )
17271758{
1728   if (m_type == SNES_SUFAMITURBO && (offset & 0xffff) >= 0x8000 && ((offset >= 0x600000 && offset < 0x640000) || (offset >= 0x700000 && offset < 0x740000)))
1759   if (m_type == SNES_SUFAMITURBO
1760            && (offset & 0xffff) >= 0x8000 && ((offset >= 0x600000 && offset < 0x640000) || (offset >= 0x700000 && offset < 0x740000)))
17291761   { m_slotcart->m_cart->write_l(space, offset, data); return; }
1762   else if (m_slotcart->get_type() == SNES_BANANA
1763            && (offset & 0x78000) == 0x8000)
1764   {
1765//      printf("lo write %x\n", offset);
1766      m_slotcart->m_cart->chip_write(space, offset, data);
1767      return;
1768   }
17301769
1770   // other add-on writes matches the hi handler
17311771   snes20_hi_w(space, offset, data, 0xff);
17321772}
17331773
17341774
1735// HiROM
1775//---------------------------------------------------------------------------------
1776// HiROM & HiROM + BSX slot
1777//---------------------------------------------------------------------------------
17361778
17371779READ8_MEMBER( snsnew_state::snes21_lo_r )
17381780{
r21798r21799
18581900   }
18591901}
18601902
1861// SuperFX / GSU
1903//---------------------------------------------------------------------------------
1904// LoROM + SuperFX / GSU
1905//---------------------------------------------------------------------------------
18621906
18631907READ8_MEMBER( snsnew_state::snessfx_hi_r )
18641908{
r21798r21799
19381982   snessfx_hi_w(space, offset, data, 0xff);
19391983}
19401984
1941// SPC-7110
1985//---------------------------------------------------------------------------------
1986// HiROM + SPC-7110
1987//---------------------------------------------------------------------------------
19421988
19431989READ8_MEMBER( snsnew_state::snes7110_hi_r )
19441990{
r21798r21799
20342080}
20352081
20362082
2037// S-DD1
2083//---------------------------------------------------------------------------------
2084// LoROM + S-DD1
2085//---------------------------------------------------------------------------------
20382086
20392087READ8_MEMBER( snsnew_state::snessdd1_lo_r )
20402088{
r21798r21799
21022150}
21032151
21042152
2105// BS-X (Base unit)
2153//---------------------------------------------------------------------------------
2154// LoROM + BS-X (Base unit)
2155//---------------------------------------------------------------------------------
21062156
21072157READ8_MEMBER( snsnew_state::snesbsx_hi_r )
21082158{
r21798r21799
22002250}
22012251
22022252
2203READ8_MEMBER( snsnew_state::snesnew_lo_r )
2204{
2205   // take care of add-on IO
2206   if (m_slotcart->get_type() == SNES_DSP
2207            && (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
2208      return m_slotcart->m_cart->chip_read(space, offset & 0x7fff);
2209   else if (m_slotcart->get_type() == SNES_DSP_2MB
2210            && (offset >= 0x600000 && offset < 0x700000 && (offset & 0x8000) == 0x0000))
2211      return m_slotcart->m_cart->chip_read(space, offset & 0x7fff);   
2212   else if (m_slotcart->get_type() == SNES_DSP_MODE21
2213            && (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
2214      return m_slotcart->m_cart->chip_read(space, offset & 0x1fff);
2215   else if (m_slotcart->get_type() == SNES_DSP4
2216            && (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
2217      return m_slotcart->m_cart->chip_read(space, offset & 0x7fff);
2218   else if (m_slotcart->get_type() == SNES_OBC1
2219            && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
2220      return m_slotcart->m_cart->chip_read(space, offset);
2221   else if ((m_slotcart->get_type() == SNES_ST010 /*|| m_slotcart->get_type() == SNES_ST011*/) // why does this break moritash?
2222            && (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000))
2223      return m_slotcart->m_cart->chip_read(space, offset);
2224   else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
2225            && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000))
2226      return m_slotcart->m_cart->chip_read(space, offset);
2227   else if (m_slotcart->get_type() == SNES_SRTC
2228            && (offset < 0x400000 && (offset & 0xffff) == 0x2800))
2229      return m_slotcart->m_cart->chip_read(space, offset & 0xffff);
2230   else if (m_slotcart->get_type() == SNES_CX4
2231            && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))   // hack until we emulate the real CPU
2232      return CX4_read((offset & 0xffff) - 0x6000);
2233   else
2234   {
2235      switch (m_type)
2236      {
2237         case SNES_MODE20:
2238         case SNES_CX4:
2239         case SNES_ST010:
2240         case SNES_ST011:
2241         case SNES_DSP:
2242         case SNES_DSP_2MB:
2243         case SNES_DSP4:
2244         case SNES_OBC1:
2245         case SNES_SUFAMITURBO:
2246         case SNES_BSXLO:
2247         case SNES_POKEMON:
2248         case SNES_BANANA:
2249            return snes20_lo_r(space, offset, 0xff);
2250
2251         case SNES_MODE21:
2252         case SNES_DSP_MODE21:
2253         case SNES_SRTC:
2254         case SNES_BSXHI:
2255            return snes21_lo_r(space, offset, 0xff);
2256
2257         case SNES_SFX:
2258            return snessfx_lo_r(space, offset, 0xff);
2259
2260         case SNES_SPC7110:
2261         case SNES_SPC7110_RTC:
2262            return snes7110_lo_r(space, offset, 0xff);
2263
2264         case SNES_SDD1:
2265            return snessdd1_lo_r(space, offset, 0xff);
2266
2267         case SNES_BSX:
2268            return snesbsx_lo_r(space, offset, 0xff);
2269      }
2270   }
2271   return snes_open_bus_r(space, 0);
2272}
2273
2274READ8_MEMBER( snsnew_state::snesnew_hi_r )
2275{
2276   // take care of add-on IO
2277   if (m_slotcart->get_type() == SNES_DSP
2278            && (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
2279      return m_slotcart->m_cart->chip_read(space, offset & 0x7fff);
2280   else if (m_slotcart->get_type() == SNES_DSP_2MB
2281            && (offset >= 0x600000 && offset < 0x700000 && (offset & 0x8000) == 0x0000))
2282      return m_slotcart->m_cart->chip_read(space, offset & 0x7fff);   
2283   else if (m_slotcart->get_type() == SNES_DSP_MODE21
2284            && (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
2285      return m_slotcart->m_cart->chip_read(space, offset & 0x1fff);
2286   else if (m_slotcart->get_type() == SNES_DSP4
2287            && (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
2288      return m_slotcart->m_cart->chip_read(space, offset & 0x7fff);
2289   else if (m_slotcart->get_type() == SNES_OBC1
2290            && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
2291      return m_slotcart->m_cart->chip_read(space, offset);
2292   else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
2293            && (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000))
2294      return m_slotcart->m_cart->chip_read(space, offset);
2295   else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
2296            && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000))
2297      return m_slotcart->m_cart->chip_read(space, offset);
2298   else if (m_slotcart->get_type() == SNES_SRTC
2299            && (offset < 0x400000 && (offset & 0xffff) == 0x2800))
2300      return m_slotcart->m_cart->chip_read(space, offset & 0xffff);
2301   else if (m_slotcart->get_type() == SNES_CX4
2302            && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))   // hack until we emulate the real CPU
2303      return CX4_read((offset & 0xffff) - 0x6000);
2304   else if ((m_slotcart->get_type() == SNES_POKEMON || m_slotcart->get_type() == SNES_BANANA)
2305            && (offset & 0x70000) == 0x0000)
2306   {
2307//      printf("hi read %x\n", offset);
2308      return m_slotcart->m_cart->chip_read(space, offset);
2309   }
2310   else
2311   {
2312      switch (m_type)
2313      {
2314         case SNES_MODE20:
2315         case SNES_CX4:
2316         case SNES_ST010:
2317         case SNES_ST011:
2318         case SNES_DSP:
2319         case SNES_DSP_2MB:
2320         case SNES_DSP4:
2321         case SNES_OBC1:
2322         case SNES_SUFAMITURBO:
2323         case SNES_BSXLO:
2324         case SNES_POKEMON:
2325         case SNES_BANANA:
2326            return snes20_hi_r(space, offset, 0xff);
2327
2328         case SNES_MODE21:
2329         case SNES_DSP_MODE21:
2330         case SNES_SRTC:
2331         case SNES_BSXHI:
2332            return snes21_hi_r(space, offset, 0xff);
2333
2334         case SNES_SFX:
2335            return snessfx_hi_r(space, offset, 0xff);
2336
2337         case SNES_SPC7110:
2338         case SNES_SPC7110_RTC:
2339            return snes7110_hi_r(space, offset, 0xff);
2340
2341         case SNES_SDD1:
2342            return snessdd1_hi_r(space, offset, 0xff);
2343
2344         case SNES_BSX:
2345            return snesbsx_hi_r(space, offset, 0xff);
2346      }
2347   }
2348   return snes_open_bus_r(space, 0);
2349}
2350
2351WRITE8_MEMBER( snsnew_state::snesnew_lo_w )
2352{
2353   // take care of add-on IO
2354   if (m_slotcart->get_type() == SNES_DSP
2355            && (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
2356      m_slotcart->m_cart->chip_write(space, offset & 0x7fff, data);
2357   else if (m_slotcart->get_type() == SNES_DSP_2MB
2358            && (offset >= 0x600000 && offset < 0x700000 && (offset & 0x8000) == 0x0000))
2359      m_slotcart->m_cart->chip_write(space, offset & 0x7fff, data);
2360   else if (m_slotcart->get_type() == SNES_DSP_MODE21
2361            && (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
2362      m_slotcart->m_cart->chip_write(space, offset & 0x1fff, data);
2363   else if (m_slotcart->get_type() == SNES_DSP4
2364            && (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
2365      m_slotcart->m_cart->chip_write(space, offset & 0x7fff, data);
2366   else if (m_slotcart->get_type() == SNES_OBC1
2367            && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
2368      m_slotcart->m_cart->chip_write(space, offset, data);
2369   else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
2370            && (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000))
2371      m_slotcart->m_cart->chip_write(space, offset, data);
2372   else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
2373            && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000))
2374      m_slotcart->m_cart->chip_write(space, offset, data);
2375   else if (m_slotcart->get_type() == SNES_SRTC
2376            && (offset < 0x400000 && (offset & 0xffff) == 0x2801))
2377      m_slotcart->m_cart->chip_write(space, offset & 0xffff, data);
2378   else if (m_slotcart->get_type() == SNES_CX4
2379            && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))   // hack until we emulate the real CPU
2380      CX4_write(space.machine(), (offset & 0xffff) - 0x6000, data);
2381   else if (m_slotcart->get_type() == SNES_BANANA
2382            && (offset & 0x78000) == 0x8000)
2383   {
2384//      printf("lo write %x\n", offset);
2385      m_slotcart->m_cart->chip_write(space, offset, data);
2386   }
2387   else
2388   {
2389      switch (m_type)
2390      {
2391         case SNES_MODE20:
2392         case SNES_CX4:
2393         case SNES_ST010:
2394         case SNES_ST011:
2395         case SNES_DSP:
2396         case SNES_DSP_2MB:
2397         case SNES_DSP4:
2398         case SNES_OBC1:
2399         case SNES_SUFAMITURBO:
2400         case SNES_BSXLO:
2401         case SNES_POKEMON:
2402         case SNES_BANANA:
2403            snes20_lo_w(space, offset, data, 0xff);
2404            break;
2405
2406         case SNES_MODE21:
2407         case SNES_DSP_MODE21:
2408         case SNES_SRTC:
2409         case SNES_BSXHI:
2410            snes21_lo_w(space, offset, data, 0xff);
2411            break;
2412
2413         case SNES_SFX:
2414            snessfx_lo_w(space, offset, data, 0xff);
2415            break;
2416
2417         case SNES_SPC7110:
2418         case SNES_SPC7110_RTC:
2419            snes7110_lo_w(space, offset, data, 0xff);
2420            break;
2421
2422         case SNES_SDD1:
2423            snessdd1_lo_w(space, offset, data, 0xff);
2424            break;
2425
2426         case SNES_BSX:
2427            snesbsx_lo_w(space, offset, data, 0xff);
2428            break;
2429      }
2430   }
2431}
2432
2433WRITE8_MEMBER( snsnew_state::snesnew_hi_w )
2434{
2435   // take care of add-on IO
2436   if (m_slotcart->get_type() == SNES_DSP
2437            && (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
2438      m_slotcart->m_cart->chip_write(space, offset & 0x7fff, data);
2439   else if (m_slotcart->get_type() == SNES_DSP_2MB
2440            && (offset >= 0x600000 && offset < 0x700000 && (offset & 0x8000) == 0x0000))
2441      m_slotcart->m_cart->chip_write(space, offset & 0x7fff, data);
2442   else if (m_slotcart->get_type() == SNES_DSP_MODE21
2443            && (offset < 0x200000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
2444      m_slotcart->m_cart->chip_write(space, offset & 0x1fff, data);
2445   else if (m_slotcart->get_type() == SNES_DSP4
2446            && (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
2447      m_slotcart->m_cart->chip_write(space, offset & 0x7fff, data);
2448   else if (m_slotcart->get_type() == SNES_OBC1
2449            && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))
2450      return m_slotcart->m_cart->chip_write(space, offset, data);
2451   else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
2452            && (offset >= 0x600000 && offset < 0x680000 && (offset & 0xffff) < 0x4000))
2453      m_slotcart->m_cart->chip_write(space, offset, data);
2454   else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
2455            && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000))
2456      m_slotcart->m_cart->chip_write(space, offset, data);
2457   else if (m_slotcart->get_type() == SNES_SRTC
2458            && (offset < 0x400000 && (offset & 0xffff) == 0x2801))
2459      m_slotcart->m_cart->chip_write(space, offset & 0xffff, data);
2460   else if (m_slotcart->get_type() == SNES_CX4
2461            && (offset < 0x400000 && (offset & 0xffff) >= 0x6000 && (offset & 0xffff) < 0x8000))   // hack until we emulate the real CPU
2462      CX4_write(space.machine(), (offset & 0xffff) - 0x6000, data);
2463   else if ((m_slotcart->get_type() == SNES_POKEMON)
2464            && (offset & 0x70000) == 0x0000)
2465   {
2466//      printf("hi write %x\n", offset);
2467      m_slotcart->m_cart->chip_write(space, offset, data);
2468   }
2469   else
2470   {
2471      switch (m_type)
2472      {
2473         case SNES_MODE20:
2474         case SNES_CX4:
2475         case SNES_ST010:
2476         case SNES_ST011:
2477         case SNES_DSP:
2478         case SNES_DSP_2MB:
2479         case SNES_DSP4:
2480         case SNES_OBC1:
2481         case SNES_SUFAMITURBO:
2482         case SNES_BSXLO:
2483         case SNES_POKEMON:
2484         case SNES_BANANA:
2485            snes20_hi_w(space, offset, data, 0xff);
2486            break;
2487
2488         case SNES_MODE21:
2489         case SNES_DSP_MODE21:
2490         case SNES_SRTC:
2491         case SNES_BSXHI:
2492            snes21_hi_w(space, offset, data, 0xff);
2493            break;
2494
2495         case SNES_SFX:
2496            snessfx_hi_w(space, offset, data, 0xff);
2497            break;
2498
2499         case SNES_SPC7110:
2500         case SNES_SPC7110_RTC:
2501            snes7110_hi_w(space, offset, data, 0xff);
2502            break;
2503
2504         case SNES_SDD1:
2505            snessdd1_hi_w(space, offset, data, 0xff);
2506            break;
2507
2508         case SNES_BSX:
2509            snesbsx_hi_w(space, offset, data, 0xff);
2510            break;
2511      }
2512   }
2513}
2514
2515
25162253static ADDRESS_MAP_START( snesnew_map, AS_PROGRAM, 8, snsnew_state )
2517   AM_RANGE(0x000000, 0x7dffff) AM_READWRITE(snesnew_lo_r, snesnew_lo_w)
2254   AM_RANGE(0x000000, 0x7dffff) AM_READWRITE(snes20_lo_r, snes20_lo_w)
25182255   AM_RANGE(0x7e0000, 0x7fffff) AM_RAM                 /* 8KB Low RAM, 24KB High RAM, 96KB Expanded RAM */
2519   AM_RANGE(0x800000, 0xffffff) AM_READWRITE(snesnew_hi_r, snesnew_hi_w)
2256   AM_RANGE(0x800000, 0xffffff) AM_READWRITE(snes20_hi_r, snes20_hi_w)
25202257ADDRESS_MAP_END
25212258
25222259static SLOT_INTERFACE_START(snes_cart)
r21798r21799
25552292   MACHINE_START_CALL(snes_mess);
25562293
25572294   // in progress...
2558#if 0
25592295   switch (state->m_type)
25602296   {
25612297      case SNES_MODE20:
25622298      case SNES_BSXLO:
25632299      case SNES_SUFAMITURBO:
2564      case SNES_POKEMON:
25652300      case SNES_BANANA:
2566      case SNES_CX4:      // this still uses the old simulation instead of emulating the CPU
2567      case SNES_ST010:   // this requires two diff kinds of chip access, so we handle it in snes20_lo/hi_r/w
2568      case SNES_ST011:   // this requires two diff kinds of chip access, so we handle it in snes20_lo/hi_r/w
2569         break;         
2301      case SNES_CX4:      // this still uses the old simulation instead of emulating the CPU
2302      case SNES_ST010:    // this requires two diff kinds of chip access, so we handle it in snes20_lo/hi_r/w
2303      case SNES_ST011:    // this requires two diff kinds of chip access, so we handle it in snes20_lo/hi_r/w
2304         break;
2305      case SNES_POKEMON:
2306         machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x800000, 0x80ffff, 0, 0x780000, read8_delegate(FUNC(device_sns_cart_interface::chip_read),state->m_slotcart->m_cart));
2307         machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x800000, 0x80ffff, 0, 0x780000, write8_delegate(FUNC(device_sns_cart_interface::chip_write),state->m_slotcart->m_cart));
2308//          set_5a22_map(*state->m_maincpu);
2309         break;
25702310      case SNES_DSP:
25712311         machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x208000, 0x20ffff, 0, 0x9f0000, read8_delegate(FUNC(device_sns_cart_interface::chip_read),state->m_slotcart->m_cart));
25722312         machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x208000, 0x20ffff, 0, 0x9f0000, write8_delegate(FUNC(device_sns_cart_interface::chip_write),state->m_slotcart->m_cart));
2573         break;         
2313         break;
25742314      case SNES_DSP_2MB:
25752315         machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x600000, 0x607fff, 0, 0x8f0000, read8_delegate(FUNC(device_sns_cart_interface::chip_read),state->m_slotcart->m_cart));
25762316         machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x600000, 0x607fff, 0, 0x8f0000, write8_delegate(FUNC(device_sns_cart_interface::chip_write),state->m_slotcart->m_cart));
r21798r21799
26072347         machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snsnew_state::snessfx_lo_r),state), write8_delegate(FUNC(snsnew_state::snessfx_lo_w),state));
26082348         machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snsnew_state::snessfx_hi_r),state), write8_delegate(FUNC(snsnew_state::snessfx_hi_w),state));
26092349         set_5a22_map(*state->m_maincpu);
2610         break;         
2350         break;
26112351      case SNES_SPC7110:
26122352      case SNES_SPC7110_RTC:
26132353         machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snsnew_state::snes7110_lo_r),state), write8_delegate(FUNC(snsnew_state::snes7110_lo_w),state));
r21798r21799
26252365         set_5a22_map(*state->m_maincpu);
26262366         break;
26272367   }
2628#endif
26292368}
26302369
26312370static MACHINE_CONFIG_START( snesnew, snsnew_state )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team