Previous 199869 Revisions Next

r21595 Tuesday 5th March, 2013 at 13:15:46 UTC by Fabio Priuli
re-srcclean'd. nw.
[src/mess/drivers]snes.c

trunk/src/mess/drivers/snes.c
r21594r21595
4545public:
4646   snes_console_state(const machine_config &mconfig, device_type type, const char *tag)
4747      : snes_state(mconfig, type, tag)
48   { }   
49   
48   { }
49
5050   DECLARE_READ8_MEMBER( spc_ram_100_r );
5151   DECLARE_WRITE8_MEMBER( spc_ram_100_w );
5252   UINT8 st010_read_ram(UINT16 addr);
r21594r21595
6868   void snes_input_read_superscope( int port );
6969   DECLARE_WRITE8_MEMBER(snes_input_read);
7070   DECLARE_READ8_MEMBER(snes_oldjoy1_read);
71   DECLARE_READ8_MEMBER(snes_oldjoy2_read);   
71   DECLARE_READ8_MEMBER(snes_oldjoy2_read);
7272};
7373
7474/*************************************
r21594r21595
103103{
104104   UINT16 temp = m_upd96050->dataram_r(addr/2);
105105   UINT8 res;
106   
106
107107   if (addr & 1)
108108   {
109109      res = temp>>8;
r21594r21595
112112   {
113113      res = temp & 0xff;
114114   }
115   
115
116116   return res;
117117}
118118
119119void snes_console_state::st010_write_ram(UINT16 addr, UINT8 data)
120120{
121121   UINT16 temp = m_upd96050->dataram_r(addr/2);
122   
122
123123   if (addr & 1)
124124   {
125125      temp &= 0xff;
r21594r21595
130130      temp &= 0xff00;
131131      temp |= data;
132132   }
133   
133
134134   m_upd96050->dataram_w(addr/2, temp);
135135}
136136
137137
138138READ8_MEMBER( snes_console_state::snes_lo_r )
139{   
139{
140140   UINT16 address = offset & 0xffff;
141141
142142   // take care of add-on chip access
143   if (m_has_addon_chip == HAS_OBC1
143   if (m_has_addon_chip == HAS_OBC1
144144      && (offset < 0x400000 && address >= 0x6000 && address < 0x8000))
145145      return obc1_read(space, offset, mem_mask);
146   if (m_has_addon_chip == HAS_CX4
146   if (m_has_addon_chip == HAS_CX4
147147      && (offset < 0x400000 && address >= 0x6000 && address < 0x8000))
148148      return CX4_read(address - 0x6000);
149149   if (m_has_addon_chip == HAS_RTC
r21594r21595
156156      if (offset == 0x600000 || offset == 0x600001)
157157         return (offset & 1) ? st010_get_sr() : st010_get_dr();
158158   }
159   if (m_cart[0].mode == SNES_MODE_21 && m_has_addon_chip == HAS_DSP1
159   if (m_cart[0].mode == SNES_MODE_21 && m_has_addon_chip == HAS_DSP1
160160      && (offset < 0x200000 && address >= 0x6000 && address < 0x8000))
161161      return (address < 0x7000) ? dsp_get_dr() : dsp_get_sr();
162162   if (m_cart[0].mode == SNES_MODE_20 && m_has_addon_chip == HAS_DSP1)
r21594r21595
165165         return (address < 0xc000) ? dsp_get_dr() : dsp_get_sr();
166166      if (offset >= 0x600000 && offset < 0x700000 && (offset & 0x8000) == 0x0000)
167167         return (address < 0x4000) ? dsp_get_dr() : dsp_get_sr();
168   }   
168   }
169169   if ((m_has_addon_chip == HAS_DSP2 || m_has_addon_chip == HAS_DSP3)
170170      && (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
171171      return (address < 0xc000) ? dsp_get_dr() : dsp_get_sr();
172   if (m_has_addon_chip == HAS_DSP4
172   if (m_has_addon_chip == HAS_DSP4
173173      && (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
174174      return (address < 0xc000) ? dsp_get_dr() : dsp_get_sr();
175175   if (m_has_addon_chip == HAS_SDD1
r21594r21595
177177      return sdd1_mmio_read(space, (UINT32)address);
178178   if ((m_has_addon_chip == HAS_SPC7110 || m_has_addon_chip == HAS_SPC7110_RTC)
179179      && offset < 0x400000)
180   {   
180   {
181181      UINT16 limit = (m_has_addon_chip == HAS_SPC7110_RTC) ? 0x4842 : 0x483f;
182182      if (address >= 0x4800 && address <= limit)
183183         return spc7110_mmio_read(space, (UINT32)address);
r21594r21595
191191      return spc7110_mmio_read(space, 0x4800);
192192   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
193193      && offset < 0x400000)
194   {   
194   {
195195      if (address >= 0x3000 && address < 0x3300)
196196         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
197      if (address >= 0x6000 && address < 0x8000)  // here it should be snes_ram[0xe00000+...] but there are mirroring issues
198198         return superfx_access_ram(m_superfx) ? snes_ram[0xf00000 + (offset & 0x1fff)] : snes_open_bus_r(space, 0);
199199   }
200200   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
r21594r21595
214214   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
215215      && offset >= 0x600000)
216216      return superfx_access_ram(m_superfx) ? snes_ram[0x800000 + offset] : snes_open_bus_r(space, 0);
217   
217
218218   // base cart access
219219   if (offset < 0x300000)
220220      return snes_r_bank1(space, offset, 0xff);
r21594r21595
226226      return snes_r_bank4(space, offset - 0x600000, 0xff);
227227   else
228228      return snes_r_bank5(space, offset - 0x700000, 0xff);
229}   
229}
230230
231231READ8_MEMBER( snes_console_state::snes_hi_r )
232232{
233233   UINT16 address = offset & 0xffff;
234   
234
235235   // take care of add-on chip access
236   if (m_has_addon_chip == HAS_OBC1
236   if (m_has_addon_chip == HAS_OBC1
237237      && (offset < 0x400000 && address >= 0x6000 && address < 0x8000))
238238      return obc1_read(space, offset, mem_mask);
239   if (m_has_addon_chip == HAS_CX4
239   if (m_has_addon_chip == HAS_CX4
240240      && (offset < 0x400000 && address >= 0x6000 && address < 0x8000))
241241      return CX4_read(address - 0x6000);
242242   if (m_has_addon_chip == HAS_RTC
r21594r21595
249249      if (offset == 0x600000 || offset == 0x600001)
250250         return (offset & 1) ? st010_get_sr() : st010_get_dr();
251251   }
252   if (m_cart[0].mode == SNES_MODE_21 && m_has_addon_chip == HAS_DSP1
252   if (m_cart[0].mode == SNES_MODE_21 && m_has_addon_chip == HAS_DSP1
253253      && (offset < 0x200000 && address >= 0x6000 && address < 0x8000))
254254      return (address < 0x7000) ? dsp_get_dr() : dsp_get_sr();
255255   if (m_cart[0].mode == SNES_MODE_20 && m_has_addon_chip == HAS_DSP1)
r21594r21595
262262   if ((m_has_addon_chip == HAS_DSP2 || m_has_addon_chip == HAS_DSP3)
263263      && (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
264264      return (address < 0xc000) ? dsp_get_dr() : dsp_get_sr();
265   if (m_has_addon_chip == HAS_DSP4
265   if (m_has_addon_chip == HAS_DSP4
266266      && (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
267267      return (address < 0xc000) ? dsp_get_dr() : dsp_get_sr();
268268   if (m_has_addon_chip == HAS_SDD1
r21594r21595
272272      return sdd1_read(space.machine(), offset - 0x400000);
273273   if ((m_has_addon_chip == HAS_SPC7110 || m_has_addon_chip == HAS_SPC7110_RTC)
274274      && offset < 0x400000)
275   {   
275   {
276276      UINT16 limit = (m_has_addon_chip == HAS_SPC7110_RTC) ? 0x4842 : 0x483f;
277277      if (address >= 0x4800 && address <= limit)
278278         return spc7110_mmio_read(space, (UINT32)address);
r21594r21595
281281      if (offset >= 0x300000 && offset < 0x310000 && address >= 0x6000 && address < 0x8000)
282282         return snes_ram[0x306000 + (address & 0x1fff)];
283283   }
284   if ((m_has_addon_chip == HAS_SPC7110 || m_has_addon_chip == HAS_SPC7110_RTC)
284   if ((m_has_addon_chip == HAS_SPC7110 || m_has_addon_chip == HAS_SPC7110_RTC)
285285      && offset >= 0x500000)
286286      return spc7110_bank7_read(space, offset - 0x400000);
287287   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL)
288      return space.read_byte(offset);      // [80-ff] same as [00-7f]
289   
288      return space.read_byte(offset);     // [80-ff] same as [00-7f]
289
290290   // base cart access
291291   if (offset < 0x400000)
292292      return snes_r_bank6(space, offset, 0xff);
293293   else
294294      return snes_r_bank7(space, offset - 0x400000, 0xff);
295}   
295}
296296
297297WRITE8_MEMBER( snes_console_state::snes_lo_w )
298298{
299299   UINT16 address = offset & 0xffff;
300   
300
301301   // take care of add-on chip access
302   if (m_has_addon_chip == HAS_OBC1
302   if (m_has_addon_chip == HAS_OBC1
303303      && (offset < 0x400000 && address >= 0x6000 && address < 0x8000))
304   {   obc1_write(space, offset, data, mem_mask);   return;   }
305   if (m_has_addon_chip == HAS_CX4
304   {   obc1_write(space, offset, data, mem_mask);  return; }
305   if (m_has_addon_chip == HAS_CX4
306306      && (offset < 0x400000 && address >= 0x6000 && address < 0x8000))
307   {   CX4_write(space.machine(), address - 0x6000, data);   return;   }
307   {   CX4_write(space.machine(), address - 0x6000, data); return; }
308308   if (m_has_addon_chip == HAS_RTC
309309      && (offset < 0x400000 && (address == 0x2800 || address == 0x2801)))
310   {   srtc_write(space.machine(), offset, data);   return;   }
310   {   srtc_write(space.machine(), offset, data);  return; }
311311   if (m_has_addon_chip == HAS_ST010 || m_has_addon_chip == HAS_ST011)
312312   {
313313      if (offset >= 0x680000 && offset < 0x700000 && address < 0x1000)
314      {   st010_write_ram(address, data);   return;   }
314      {   st010_write_ram(address, data); return; }
315315      if (offset == 0x600000)
316      {   st010_set_dr(data);   return;   }
316      {   st010_set_dr(data); return; }
317317      if (offset == 0x600001)
318      {   st010_set_sr(data);   return;   }
318      {   st010_set_sr(data); return; }
319319   }
320   if (m_cart[0].mode == SNES_MODE_21 && m_has_addon_chip == HAS_DSP1
320   if (m_cart[0].mode == SNES_MODE_21 && m_has_addon_chip == HAS_DSP1
321321      && (offset < 0x200000 && address >= 0x6000 && address < 0x8000))
322   {   dsp_set_dr(data);   return;   }
322   {   dsp_set_dr(data);   return; }
323323   if (m_cart[0].mode == SNES_MODE_20 && m_has_addon_chip == HAS_DSP1)
324324   {
325325      if (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000)
326      {   dsp_set_dr(data);   return;   }
326      {   dsp_set_dr(data);   return; }
327327      if (offset >= 0x600000 && offset < 0x700000 && (offset & 0x8000) == 0x0000)
328      {   dsp_set_dr(data);   return;   }
328      {   dsp_set_dr(data);   return; }
329329   }
330330   if ((m_has_addon_chip == HAS_DSP2 || m_has_addon_chip == HAS_DSP3)
331331      && (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
332332   {
333333      if (address < 0xc000)
334      {   dsp_set_dr(data);   return;   }
334      {   dsp_set_dr(data);   return; }
335335      else
336      {   dsp_set_sr(data);   return;   }
336      {   dsp_set_sr(data);   return; }
337337   }
338   if (m_has_addon_chip == HAS_DSP4
338   if (m_has_addon_chip == HAS_DSP4
339339      && (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
340340   {
341341      if (address < 0xc000)
342      {   dsp_set_dr(data);   return;   }
342      {   dsp_set_dr(data);   return; }
343343      else
344      {   dsp_set_sr(data);   return;   }
344      {   dsp_set_sr(data);   return; }
345345   }
346346   if (m_has_addon_chip == HAS_SDD1 && offset < 0x400000)
347347   {
r21594r21595
352352      }
353353   }
354354   if ((m_has_addon_chip == HAS_SPC7110 || m_has_addon_chip == HAS_SPC7110_RTC) && offset < 0x400000)
355   {   
355   {
356356      UINT16 limit = (m_has_addon_chip == HAS_SPC7110_RTC) ? 0x4842 : 0x483f;
357357      if (address >= 0x4800 && address <= limit)
358      {   spc7110_mmio_write(space.machine(), (UINT32)address, data);   return;   }
358      {   spc7110_mmio_write(space.machine(), (UINT32)address, data); return; }
359359      if (offset < 0x10000 && address >= 0x6000 && address < 0x8000)
360      {   snes_ram[0x306000 + (address & 0x1fff)] = data;   return;   }
360      {   snes_ram[0x306000 + (address & 0x1fff)] = data; return; }
361361      if (offset >= 0x300000 && offset < 0x310000 && address >= 0x6000 && address < 0x8000)
362      {   snes_ram[0x306000 + (address & 0x1fff)] = data;   return;   }
362      {   snes_ram[0x306000 + (address & 0x1fff)] = data; return; }
363363   }
364364   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
365       && offset < 0x400000)
366   {   
365         && offset < 0x400000)
366   {
367367      if (address >= 0x3000 && address < 0x3300)
368      {   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;   }
368      {   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; }
371371   }
372372   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL
373373      && offset >= 0x600000)
374   {   snes_ram[0x800000 + offset] = data;   return;   }
375   
374   {   snes_ram[0x800000 + offset] = data; return; }
375
376376   // base cart access
377377   if (offset < 0x300000)
378378      snes_w_bank1(space, offset, data, 0xff);
r21594r21595
384384      snes_w_bank4(space, offset - 0x600000, data, 0xff);
385385   else
386386      snes_w_bank5(space, offset - 0x700000, data, 0xff);
387}   
387}
388388
389389WRITE8_MEMBER( snes_console_state::snes_hi_w )
390390{
391391   UINT16 address = offset & 0xffff;
392   
392
393393   // take care of add-on chip access
394   if (m_has_addon_chip == HAS_OBC1
394   if (m_has_addon_chip == HAS_OBC1
395395      && (offset < 0x400000 && address >= 0x6000 && address < 0x8000))
396   {   obc1_write(space, offset, data, mem_mask);   return;   }
397   if (m_has_addon_chip == HAS_CX4
396   {   obc1_write(space, offset, data, mem_mask);  return; }
397   if (m_has_addon_chip == HAS_CX4
398398      && (offset < 0x400000 && address >= 0x6000 && address < 0x8000))
399   {   CX4_write(space.machine(), address - 0x6000, data);   return;   }
399   {   CX4_write(space.machine(), address - 0x6000, data); return; }
400400   if (m_has_addon_chip == HAS_RTC
401401      && (offset < 0x400000 && (address == 0x2800 || address == 0x2801)))
402   {   srtc_write(space.machine(), offset, data);   return;   }
402   {   srtc_write(space.machine(), offset, data);  return; }
403403   if (m_has_addon_chip == HAS_ST010 || m_has_addon_chip == HAS_ST011)
404404   {
405405      if (offset >= 0x680000 && offset < 0x700000 && address < 0x1000)
406      {   st010_write_ram(address, data);   return;   }
406      {   st010_write_ram(address, data); return; }
407407      if (offset == 0x600000)
408      {   st010_set_dr(data);   return;   }
408      {   st010_set_dr(data); return; }
409409      if (offset == 0x600001)
410      {   st010_set_sr(data);   return;   }
410      {   st010_set_sr(data); return; }
411411   }
412   if (m_cart[0].mode == SNES_MODE_21 && m_has_addon_chip == HAS_DSP1
412   if (m_cart[0].mode == SNES_MODE_21 && m_has_addon_chip == HAS_DSP1
413413      && (offset < 0x200000 && address >= 0x6000 && address < 0x8000))
414   {   dsp_set_dr(data);   return;   }
414   {   dsp_set_dr(data);   return; }
415415   if (m_cart[0].mode == SNES_MODE_20 && m_has_addon_chip == HAS_DSP1)
416416   {
417417      if (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000)
418      {   dsp_set_dr(data);   return;   }
418      {   dsp_set_dr(data);   return; }
419419      if (offset >= 0x600000 && offset < 0x700000 && (offset & 0x8000) == 0x0000)
420      {   dsp_set_dr(data);   return;   }
421   }   
420      {   dsp_set_dr(data);   return; }
421   }
422422   if ((m_has_addon_chip == HAS_DSP2 || m_has_addon_chip == HAS_DSP3)
423423      && (offset >= 0x200000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
424424   {
425425      if (address < 0xc000)
426      {   dsp_set_dr(data);   return;   }
426      {   dsp_set_dr(data);   return; }
427427      else
428      {   dsp_set_sr(data);   return;   }
428      {   dsp_set_sr(data);   return; }
429429   }
430   if (m_has_addon_chip == HAS_DSP4
430   if (m_has_addon_chip == HAS_DSP4
431431      && (offset >= 0x300000 && offset < 0x400000 && (offset & 0x8000) == 0x8000))
432432   {
433433      if (address < 0xc000)
434      {   dsp_set_dr(data);   return;   }
434      {   dsp_set_dr(data);   return; }
435435      else
436      {   dsp_set_sr(data);   return;   }
436      {   dsp_set_sr(data);   return; }
437437   }
438438   if (m_has_addon_chip == HAS_SDD1 && offset < 0x400000)
439439   {
r21594r21595
444444      }
445445   }
446446   if ((m_has_addon_chip == HAS_SPC7110 || m_has_addon_chip == HAS_SPC7110_RTC) && offset < 0x400000)
447   {   
447   {
448448      UINT16 limit = (m_has_addon_chip == HAS_SPC7110_RTC) ? 0x4842 : 0x483f;
449449      if (address >= 0x4800 && address <= limit)
450      {   spc7110_mmio_write(space.machine(), (UINT32)address, data);   return;   }
450      {   spc7110_mmio_write(space.machine(), (UINT32)address, data); return; }
451451      if (offset < 0x10000 && address >= 0x6000 && address < 0x8000)
452      {   snes_ram[0x306000 + (address & 0x1fff)] = data;   return;   }
452      {   snes_ram[0x306000 + (address & 0x1fff)] = data; return; }
453453      if (offset >= 0x300000 && offset < 0x310000 && address >= 0x6000 && address < 0x8000)
454      {   snes_ram[0x306000 + (address & 0x1fff)] = data;   return;   }
454      {   snes_ram[0x306000 + (address & 0x1fff)] = data; return; }
455455   }
456456   if (m_has_addon_chip == HAS_SUPERFX && m_superfx != NULL)
457   {   space.write_byte(offset, data);   return;   }      // [80-ff] same as [00-7f]
458   
457   {   space.write_byte(offset, data); return; }       // [80-ff] same as [00-7f]
458
459459   // base cart access
460460   if (offset < 0x400000)
461461      snes_w_bank6(space, offset, data, 0xff);
462462   else
463463      snes_w_bank7(space, offset, data - 0x400000, 0xff);
464}   
464}
465465
466466READ8_MEMBER( snes_console_state::superfx_r_bank1 )
467467{
r21594r21595
11171117
11181118   machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(snes_machine_stop),&machine));
11191119   MACHINE_START_CALL(snes);
1120   
1120
11211121   switch (state->m_has_addon_chip)
11221122   {
11231123      case HAS_SDD1:
r21594r21595
11471147   state->m_io_read = write8_delegate(FUNC(snes_console_state::snes_input_read),state);
11481148   state->m_oldjoy1_read = read8_delegate(FUNC(snes_console_state::snes_oldjoy1_read),state);
11491149   state->m_oldjoy2_read = read8_delegate(FUNC(snes_console_state::snes_oldjoy2_read),state);
1150   
1150
11511151   // see if there's a uPD7725 DSP in the machine config
11521152   state->m_upd7725 = machine.device<upd7725_device>("dsp");
1153   
1153
11541154   // if we have a DSP, halt it for the moment
11551155   if (state->m_upd7725)
11561156      machine.device("dsp")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
1157   
1157
11581158   // ditto for a uPD96050 (Seta ST-010 or ST-011)
11591159   state->m_upd96050 = machine.device<upd96050_device>("setadsp");
11601160   if (state->m_upd96050)
11611161      machine.device("setadsp")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
1162   
1162
11631163   switch (state->m_has_addon_chip)
11641164   {
11651165      case HAS_DSP1:
r21594r21595
11751175            state->m_has_addon_chip = HAS_NONE; // prevent crash trying to access NULL device
11761176         }
11771177         break;
1178         
1178
11791179      case HAS_RTC:
11801180         srtc_init(machine);
11811181         break;
1182         
1182
11831183      case HAS_OBC1:
11841184         obc1_init(machine);
11851185         break;
1186         
1186
11871187      case HAS_ST010:
11881188      case HAS_ST011:
11891189         // cartridge uses the DSP, let 'er rip
r21594r21595
11951195            state->m_has_addon_chip = HAS_NONE; // prevent crash trying to access NULL device
11961196         }
11971197         break;
1198         
1198
11991199      default:
12001200         break;
12011201   }
r21594r21595
14871487   snsnew_state(const machine_config &mconfig, device_type type, const char *tag)
14881488      : snes_console_state(mconfig, type, tag),
14891489      m_slotcart(*this, "snsslot")
1490   { }   
1491   
1490   { }
1491
14921492   DECLARE_READ8_MEMBER( snes20_hi_r );
14931493   DECLARE_WRITE8_MEMBER( snes20_hi_w );
14941494   DECLARE_READ8_MEMBER( snes20_lo_r );
r21594r21595
15341534READ8_MEMBER( snsnew_state::snes20_hi_r )
15351535{
15361536   UINT16 address = offset & 0xffff;
1537   
1537
15381538   if (offset < 0x400000)
15391539   {
15401540      if (address < 0x2000)
r21594r21595
15431543         return snes_r_io(space, address);
15441544      if (address >= 0x6000 && address < 0x8000)
15451545         return snes_open_bus_r(space, 0);
1546      if (address >= 0x8000)         
1546      if (address >= 0x8000)
15471547         return m_slotcart->m_cart->read_h(space, offset);
15481548   }
15491549   else if (offset < 0x700000)
r21594r21595
15531553      else
15541554         return m_slotcart->m_cart->read_h(space, offset);
15551555   }
1556   
1556
15571557   // ROM & NVRAM access
15581558   return m_slotcart->m_cart->read_h(space, offset);
1559}   
1559}
15601560
15611561WRITE8_MEMBER( snsnew_state::snes20_hi_w )
15621562{
r21594r21595
15681568      if (address >= 0x2000 && address < 0x6000)
15691569         snes_w_io(space, address, data);
15701570   }
1571   else if (offset >= 0x700000)   // NVRAM access
1571   else if (offset >= 0x700000)    // NVRAM access
15721572   {
15731573      m_slotcart->m_cart->write_h(space, offset, data);
15741574   }
1575}   
1575}
15761576
15771577READ8_MEMBER( snsnew_state::snes20_lo_r )
15781578{
15791579   UINT16 address = offset & 0xffff;
1580   
1580
15811581   if (offset < 0x400000)
15821582   {
15831583      if (address < 0x2000)
r21594r21595
15861586         return snes_r_io(space, address);
15871587      if (address >= 0x6000 && address < 0x8000)
15881588         return snes_open_bus_r(space, 0);
1589      if (address >= 0x8000)         
1589      if (address >= 0x8000)
15901590         return m_slotcart->m_cart->read_l(space, offset);
15911591   }
15921592   else if (offset < 0x700000)
r21594r21595
15961596      else
15971597         return m_slotcart->m_cart->read_l(space, offset);
15981598   }
1599   
1599
16001600   // ROM & NVRAM access
16011601   return m_slotcart->m_cart->read_l(space, offset);
1602}   
1602}
16031603
16041604WRITE8_MEMBER( snsnew_state::snes20_lo_w )
16051605{
16061606   snes20_hi_w(space, offset, data, 0xff);
1607}   
1607}
16081608
16091609
16101610// HiROM
r21594r21595
16121612READ8_MEMBER( snsnew_state::snes21_lo_r )
16131613{
16141614   UINT16 address = offset & 0xffff;
1615   
1615
16161616   if (offset < 0x400000)
16171617   {
16181618      if (address < 0x2000)
r21594r21595
16321632      if (address >= 0x8000)
16331633         return m_slotcart->m_cart->read_l(space, offset);
16341634   }
1635   
1635
16361636   // ROM & NVRAM access
16371637   return m_slotcart->m_cart->read_l(space, offset);
1638}   
1638}
16391639
16401640WRITE8_MEMBER( snsnew_state::snes21_lo_w )
16411641{
r21594r21595
16561656         }
16571657      }
16581658   }
1659   else if (offset >= 0x700000)   // NVRAM access
1659   else if (offset >= 0x700000)    // NVRAM access
16601660      m_slotcart->m_cart->write_l(space, offset, data);
1661}   
1661}
16621662
16631663READ8_MEMBER( snsnew_state::snes21_hi_r )
16641664{
16651665   UINT16 address = offset & 0xffff;
1666   
1666
16671667   if (offset < 0x400000)
16681668   {
16691669      if (address < 0x2000)
r21594r21595
16831683      if (address >= 0x8000)
16841684         return m_slotcart->m_cart->read_h(space, offset);
16851685   }
1686   
1686
16871687   // ROM & NVRAM access
16881688   return m_slotcart->m_cart->read_h(space, offset);
1689}   
1689}
16901690
16911691WRITE8_MEMBER( snsnew_state::snes21_hi_w )
16921692{
r21594r21595
17071707         }
17081708      }
17091709   }
1710   else if (offset >= 0x700000)   // NVRAM access
1710   else if (offset >= 0x700000)    // NVRAM access
17111711      m_slotcart->m_cart->write_h(space, offset, data);
1712}   
1712}
17131713
17141714// SuperFX / GSU
17151715
17161716READ8_MEMBER( snsnew_state::snesfx_hi_r )
17171717{
17181718   UINT16 address = offset & 0xffff;
1719   
1719
17201720   if (offset < 0x400000)
17211721   {
17221722      if (address < 0x2000)
r21594r21595
17301730      }
17311731      if (address >= 0x6000 && address < 0x8000)
17321732      {
1733         return m_slotcart->m_cart->read_h(space, offset);   //RAM
1733         return m_slotcart->m_cart->read_h(space, offset);   //RAM
17341734      }
17351735      if (address >= 0x8000)
1736         return m_slotcart->m_cart->read_h(space, offset);   //ROM
1736         return m_slotcart->m_cart->read_h(space, offset);   //ROM
17371737   }
17381738   else if (offset < 0x600000)
1739      return m_slotcart->m_cart->read_h(space, offset);   //ROM
1740   
1741   return m_slotcart->m_cart->read_h(space, offset);   //RAM
1742}   
1739      return m_slotcart->m_cart->read_h(space, offset);   //ROM
17431740
1741   return m_slotcart->m_cart->read_h(space, offset);   //RAM
1742}
1743
17441744READ8_MEMBER( snsnew_state::snesfx_lo_r )
17451745{
17461746   UINT16 address = offset & 0xffff;
1747   
1747
17481748   if (offset < 0x400000)
17491749   {
17501750      if (address < 0x2000)
r21594r21595
17581758      }
17591759      if (address >= 0x6000 && address < 0x8000)
17601760      {
1761         return m_slotcart->m_cart->read_l(space, offset);   //RAM
1761         return m_slotcart->m_cart->read_l(space, offset);   //RAM
17621762      }
17631763      if (address >= 0x8000)
1764         return m_slotcart->m_cart->read_l(space, offset);   //ROM
1764         return m_slotcart->m_cart->read_l(space, offset);   //ROM
17651765   }
17661766   else if (offset < 0x600000)
1767      return m_slotcart->m_cart->read_l(space, offset);   //ROM
1768   
1769   return m_slotcart->m_cart->read_l(space, offset);   //RAM
1770}   
1767      return m_slotcart->m_cart->read_l(space, offset);   //ROM
17711768
1769   return m_slotcart->m_cart->read_l(space, offset);   //RAM
1770}
1771
17721772WRITE8_MEMBER( snsnew_state::snesfx_hi_w )
17731773{
17741774   UINT16 address = offset & 0xffff;
r21594r21595
17881788   }
17891789   else
17901790      m_slotcart->m_cart->write_h(space, offset, data);
1791}   
1791}
17921792
17931793WRITE8_MEMBER( snsnew_state::snesfx_lo_w )
17941794{
r21594r21595
18091809   }
18101810   else
18111811      m_slotcart->m_cart->write_l(space, offset, data);
1812}   
1812}
18131813
18141814// SPC-7110
18151815
18161816READ8_MEMBER( snsnew_state::snespc7110_hi_r )
18171817{
18181818   UINT16 address = offset & 0xffff;
1819   
1819
18201820   if (offset < 0x400000)
18211821   {
18221822      if (address < 0x2000)
r21594r21595
18261826         UINT16 limit = (m_slotcart->get_type() == SNES_SPC7110_RTC) ? 0x4843 : 0x4840;
18271827         if (address >= 0x4800 && address < limit)
18281828            return m_slotcart->m_cart->chip_read(space, address);
1829         
1829
18301830         return snes_r_io(space, address);
18311831      }
18321832      if (address >= 0x6000 && address < 0x8000)
r21594r21595
18401840         return m_slotcart->m_cart->read_h(space, offset);
18411841   }
18421842   return m_slotcart->m_cart->read_h(space, offset);
1843}   
1843}
18441844
18451845READ8_MEMBER( snsnew_state::snespc7110_lo_r )
18461846{
18471847   UINT16 address = offset & 0xffff;
1848   
1848
18491849   if (offset < 0x400000)
18501850   {
18511851      if (address < 0x2000)
r21594r21595
18551855         UINT16 limit = (m_slotcart->get_type() == SNES_SPC7110_RTC) ? 0x4843 : 0x4840;
18561856         if (address >= 0x4800 && address < limit)
18571857            return m_slotcart->m_cart->chip_read(space, address);
1858         
1858
18591859         return snes_r_io(space, address);
18601860      }
18611861      if (address >= 0x6000 && address < 0x8000)
r21594r21595
18721872      return m_slotcart->m_cart->chip_read(space, 0x4800);
18731873
18741874   return snes_open_bus_r(space, 0);
1875}   
1875}
18761876
18771877WRITE8_MEMBER( snsnew_state::snespc7110_hi_w )
18781878{
r21594r21595
18991899            m_slotcart->m_cart->write_l(space, offset, data);
19001900      }
19011901   }
1902}   
1902}
19031903
19041904WRITE8_MEMBER( snsnew_state::snespc7110_lo_w )
19051905{
r21594r21595
19261926            m_slotcart->m_cart->write_l(space, offset, data);
19271927      }
19281928   }
1929}   
1929}
19301930
19311931
19321932// S-DD1
r21594r21595
19341934READ8_MEMBER( snsnew_state::snesdd1_lo_r )
19351935{
19361936   UINT16 address = offset & 0xffff;
1937   
1937
19381938   if (offset < 0x400000)
19391939   {
19401940      if (address < 0x2000)
r21594r21595
19431943      {
19441944         if (address >= 0x4800 && address < 0x4808)
19451945            return m_slotcart->m_cart->chip_read(space, address);
1946         
1946
19471947         return snes_r_io(space, address);
19481948      }
19491949      if (address >= 0x6000 && address < 0x8000)
r21594r21595
19511951      if (address >= 0x8000)
19521952         return m_slotcart->m_cart->read_l(space, offset);
19531953   }
1954   
1954
19551955   // ROM & NVRAM access
19561956   return m_slotcart->m_cart->read_l(space, offset);
1957}   
1957}
19581958
19591959WRITE8_MEMBER( snsnew_state::snesdd1_lo_w )
19601960{
r21594r21595
19801980   }
19811981   if (offset >= 0x700000 && address < 0x8000 && m_slotcart->m_cart->get_nvram_size())
19821982      return m_slotcart->m_cart->write_l(space, offset, data);
1983}   
1983}
19841984
19851985READ8_MEMBER( snsnew_state::snesdd1_hi_r )
1986{   
1986{
19871987   if (offset >= 0x400000)
19881988      return m_slotcart->m_cart->read_h(space, offset);
1989   else     
1989   else
19901990      return snesdd1_lo_r(space, offset, 0xff);
1991}   
1991}
19921992
19931993WRITE8_MEMBER( snsnew_state::snesdd1_hi_w )
19941994{
19951995   snesdd1_lo_w(space, offset, data, 0xff);
1996}   
1996}
19971997
19981998
19991999// BS-X
r21594r21595
20012001READ8_MEMBER( snsnew_state::snesbsx_hi_r )
20022002{
20032003   UINT16 address = offset & 0xffff;
2004   
2004
20052005   if (offset < 0x400000)
20062006   {
20072007      if (address < 0x2000)
r21594r21595
20162016      }
20172017      if (address >= 0x6000 && address < 0x8000)
20182018      {
2019         if (offset >= 0x200000)         
2019         if (offset >= 0x200000)
20202020            return m_slotcart->m_cart->read_l(space, offset);
20212021         else
20222022            return snes_open_bus_r(space, 0);
20232023      }
2024      if (address >= 0x8000)         
2024      if (address >= 0x8000)
20252025         return m_slotcart->m_cart->read_l(space, offset);
20262026   }
20272027   return m_slotcart->m_cart->read_l(space, offset);
2028}   
2028}
20292029
20302030WRITE8_MEMBER( snsnew_state::snesbsx_hi_w )
20312031{
r21594r21595
20502050      }
20512051      if (address >= 0x6000 && address < 0x8000)
20522052      {
2053         if (offset >= 0x200000)         
2053         if (offset >= 0x200000)
20542054            return m_slotcart->m_cart->write_l(space, offset, data);
20552055      }
2056      if (address >= 0x8000)         
2056      if (address >= 0x8000)
20572057         return m_slotcart->m_cart->write_l(space, offset, data);
20582058   }
20592059   return m_slotcart->m_cart->write_l(space, offset, data);
2060}   
2060}
20612061
20622062READ8_MEMBER( snsnew_state::snesbsx_lo_r )
20632063{
20642064   return snesbsx_hi_r(space, offset, 0xff);
2065}   
2065}
20662066
20672067WRITE8_MEMBER( snsnew_state::snesbsx_lo_w )
20682068{
20692069   snesbsx_hi_w(space, offset, data, 0xff);
2070}   
2070}
20712071
20722072
20732073READ8_MEMBER( snsnew_state::snesnew_lo_r )
r21594r21595
20882088   else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
20892089            && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000))
20902090      return m_slotcart->m_cart->chip_read(space, offset);
2091   else if ((m_slotcart->get_type() == SNES_ST010 /*|| m_slotcart->get_type() == SNES_ST011*/) // why does this freeze moritash?
2092            && (offset == 0x600000 || offset == 0x600001))
2093      return m_slotcart->m_cart->chip_read(space, offset);
20912094   else if (m_slotcart->get_type() == SNES_SRTC
20922095            && (offset < 0x400000 && (offset & 0xffff) == 0x2800))
20932096         return m_slotcart->m_cart->chip_read(space, offset & 0xffff);
r21594r21595
21072110         case SNES_POKEMON:
21082111         case SNES_BANANA:
21092112            return snes20_lo_r(space, offset, 0xff);
2110           
2113
21112114         case SNES_MODE21:
21122115         case SNES_DSP_MODE21:
21132116         case SNES_SRTC:
21142117         case SNES_BSXHI:
21152118            return snes21_lo_r(space, offset, 0xff);
2116           
2119
21172120         case SNES_SFX:
21182121            return snesfx_lo_r(space, offset, 0xff);
2119           
2122
21202123         case SNES_SPC7110:
21212124         case SNES_SPC7110_RTC:
21222125            return snespc7110_lo_r(space, offset, 0xff);
2123           
2126
21242127         case SNES_SDD1:
21252128            return snesdd1_lo_r(space, offset, 0xff);
2126           
2129
21272130         case SNES_BSX:
21282131            return snesbsx_lo_r(space, offset, 0xff);
21292132      }
21302133   }
21312134   return snes_open_bus_r(space, 0);
2132}   
2135}
21332136
21342137READ8_MEMBER( snsnew_state::snesnew_hi_r )
21352138{
r21594r21595
21502153            && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000))
21512154      return m_slotcart->m_cart->chip_read(space, offset);
21522155   else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
2153          && (offset == 0x600000 || offset == 0x600001))
2156            && (offset == 0x600000 || offset == 0x600001))
21542157      return m_slotcart->m_cart->chip_read(space, offset);
21552158   else if (m_slotcart->get_type() == SNES_SRTC
21562159            && (offset < 0x400000 && (offset & 0xffff) == 0x2800))
r21594r21595
21582161   else if ((m_slotcart->get_type() == SNES_POKEMON || m_slotcart->get_type() == SNES_BANANA)
21592162            && (offset & 0x70000) == 0x0000)
21602163   {
2161//      printf("hi read %x\n", offset);
2164//      printf("hi read %x\n", offset);
21622165      return m_slotcart->m_cart->chip_read(space, offset);
21632166   }
21642167   else
r21594r21595
21772180         case SNES_POKEMON:
21782181         case SNES_BANANA:
21792182            return snes20_hi_r(space, offset, 0xff);
2180           
2183
21812184         case SNES_MODE21:
21822185         case SNES_DSP_MODE21:
21832186         case SNES_SRTC:
21842187         case SNES_BSXHI:
21852188            return snes21_hi_r(space, offset, 0xff);
2186           
2189
21872190         case SNES_SFX:
21882191            return snesfx_hi_r(space, offset, 0xff);
2189           
2192
21902193         case SNES_SPC7110:
21912194         case SNES_SPC7110_RTC:
21922195            return snespc7110_hi_r(space, offset, 0xff);
2193           
2196
21942197         case SNES_SDD1:
21952198            return snesdd1_hi_r(space, offset, 0xff);
2196           
2199
21972200         case SNES_BSX:
21982201            return snesbsx_hi_r(space, offset, 0xff);
21992202      }
22002203   }
22012204   return snes_open_bus_r(space, 0);
2202}   
2205}
22032206
22042207WRITE8_MEMBER( snsnew_state::snesnew_lo_w )
22052208{
r21594r21595
22202223            && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000))
22212224      m_slotcart->m_cart->chip_write(space, offset, data);
22222225   else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
2223          && (offset == 0x600000 || offset == 0x600001))
2226            && (offset == 0x600000 || offset == 0x600001))
22242227      m_slotcart->m_cart->chip_write(space, offset, data);
22252228   else if (m_slotcart->get_type() == SNES_SRTC
22262229            && (offset < 0x400000 && (offset & 0xffff) == 0x2801))
r21594r21595
22482251         case SNES_BANANA:
22492252            snes20_lo_w(space, offset, data, 0xff);
22502253            break;
2251           
2254
22522255         case SNES_MODE21:
22532256         case SNES_DSP_MODE21:
22542257         case SNES_SRTC:
22552258         case SNES_BSXHI:
22562259            snes21_lo_w(space, offset, data, 0xff);
22572260            break;
2258           
2261
22592262         case SNES_SFX:
22602263            snesfx_lo_w(space, offset, data, 0xff);
22612264            break;
2262           
2265
22632266         case SNES_SPC7110:
22642267         case SNES_SPC7110_RTC:
22652268            snespc7110_lo_w(space, offset, data, 0xff);
22662269            break;
2267           
2270
22682271         case SNES_SDD1:
22692272            snesdd1_lo_w(space, offset, data, 0xff);
22702273            break;
2271           
2274
22722275         case SNES_BSX:
22732276            snesbsx_lo_w(space, offset, data, 0xff);
22742277            break;
22752278      }
22762279   }
2277}   
2280}
22782281
22792282WRITE8_MEMBER( snsnew_state::snesnew_hi_w )
22802283{
r21594r21595
22952298            && (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x1000))
22962299      m_slotcart->m_cart->chip_write(space, offset, data);
22972300   else if ((m_slotcart->get_type() == SNES_ST010 || m_slotcart->get_type() == SNES_ST011)
2298          && (offset == 0x600000 || offset == 0x600001))
2301            && (offset == 0x600000 || offset == 0x600001))
22992302      m_slotcart->m_cart->chip_write(space, offset, data);
23002303   else if (m_slotcart->get_type() == SNES_SRTC
23012304            && (offset < 0x400000 && (offset & 0xffff) == 0x2801))
r21594r21595
23232326         case SNES_BANANA:
23242327            snes20_hi_w(space, offset, data, 0xff);
23252328            break;
2326           
2329
23272330         case SNES_MODE21:
23282331         case SNES_DSP_MODE21:
23292332         case SNES_SRTC:
23302333         case SNES_BSXHI:
23312334            snes21_hi_w(space, offset, data, 0xff);
23322335            break;
2333           
2336
23342337         case SNES_SFX:
23352338            snesfx_hi_w(space, offset, data, 0xff);
23362339            break;
2337           
2340
23382341         case SNES_SPC7110:
23392342         case SNES_SPC7110_RTC:
23402343            snespc7110_hi_w(space, offset, data, 0xff);
23412344            break;
2342           
2345
23432346         case SNES_SDD1:
23442347            snesdd1_hi_w(space, offset, data, 0xff);
23452348            break;
2346           
2349
23472350         case SNES_BSX:
23482351            snesbsx_hi_w(space, offset, data, 0xff);
23492352            break;
23502353      }
23512354   }
2352}   
2355}
23532356
23542357
23552358static ADDRESS_MAP_START( snesnew_map, AS_PROGRAM, 8, snsnew_state )
r21594r21595
23602363
23612364static SLOT_INTERFACE_START(snes_cart)
23622365   SLOT_INTERFACE_INTERNAL("lorom",         SNS_LOROM)
2363   SLOT_INTERFACE_INTERNAL("lorom_bsx",     SNS_LOROM_BSX)   // LoROM + BS-X slot - unsupported
2364   SLOT_INTERFACE_INTERNAL("lorom_cx4",     SNS_LOROM)   // Cart + CX4 - unsupported
2366   SLOT_INTERFACE_INTERNAL("lorom_bsx",     SNS_LOROM_BSX) // LoROM + BS-X slot - unsupported
2367   SLOT_INTERFACE_INTERNAL("lorom_cx4",     SNS_LOROM) // Cart + CX4 - unsupported
23652368   SLOT_INTERFACE_INTERNAL("lorom_dsp",     SNS_LOROM_NECDSP)
23662369   SLOT_INTERFACE_INTERNAL("lorom_dsp4",    SNS_LOROM_NECDSP)
23672370   SLOT_INTERFACE_INTERNAL("lorom_obc1",    SNS_LOROM_OBC1)
2368   SLOT_INTERFACE_INTERNAL("lorom_sa1",     SNS_LOROM)   // Cart + SA1 - unsupported
2371   SLOT_INTERFACE_INTERNAL("lorom_sa1",     SNS_LOROM) // Cart + SA1 - unsupported
23692372   SLOT_INTERFACE_INTERNAL("lorom_sdd1",    SNS_LOROM_SDD1)
23702373   SLOT_INTERFACE_INTERNAL("lorom_sfx",     SNS_LOROM_SUPERFX)
2371   SLOT_INTERFACE_INTERNAL("lorom_sgb",     SNS_LOROM)   // SuperGB base cart - unsupported
2374   SLOT_INTERFACE_INTERNAL("lorom_sgb",     SNS_LOROM) // SuperGB base cart - unsupported
23722375   SLOT_INTERFACE_INTERNAL("lorom_st010",   SNS_LOROM_SETA10)
23732376   SLOT_INTERFACE_INTERNAL("lorom_st011",   SNS_LOROM_SETA11)
2374   SLOT_INTERFACE_INTERNAL("lorom_st018",   SNS_LOROM)   // Cart + ST018 - unsupported
2375   SLOT_INTERFACE_INTERNAL("lorom_sufami",  SNS_LOROM_SUFAMI)   // Sufami Turbo base cart
2377   SLOT_INTERFACE_INTERNAL("lorom_st018",   SNS_LOROM) // Cart + ST018 - unsupported
2378   SLOT_INTERFACE_INTERNAL("lorom_sufami",  SNS_LOROM_SUFAMI)  // Sufami Turbo base cart
23762379   SLOT_INTERFACE_INTERNAL("hirom",         SNS_HIROM)
2377   SLOT_INTERFACE_INTERNAL("hirom_bsx",     SNS_HIROM_BSX)   // HiROM + BS-X slot - unsupported
2380   SLOT_INTERFACE_INTERNAL("hirom_bsx",     SNS_HIROM_BSX) // HiROM + BS-X slot - unsupported
23782381   SLOT_INTERFACE_INTERNAL("hirom_dsp",     SNS_HIROM_NECDSP)
23792382   SLOT_INTERFACE_INTERNAL("hirom_spc7110", SNS_HIROM_SPC7110)
23802383   SLOT_INTERFACE_INTERNAL("hirom_spcrtc",  SNS_HIROM_SPC7110_RTC)
23812384   SLOT_INTERFACE_INTERNAL("hirom_srtc",    SNS_HIROM_SRTC)
2382   SLOT_INTERFACE_INTERNAL("bsxrom",        SNS_ROM_BSX)   // BS-X base cart - partial support only
2385   SLOT_INTERFACE_INTERNAL("bsxrom",        SNS_ROM_BSX)   // BS-X base cart - partial support only
23832386   // pirate carts
23842387   SLOT_INTERFACE_INTERNAL("lorom_poke",    SNS_LOROM_POKEMON)
23852388SLOT_INTERFACE_END
r21594r21595
24022405         set_5a22_map(*state->m_maincpu);
24032406         break;
24042407      case SNES_DSP_MODE21:
2405//         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x000000, 0x7dffff, FUNC(snes21_lo_r), FUNC(snes21_lo_w));
2406//         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x800000, 0xffffff, FUNC(snes21_hi_r), FUNC(snes21_hi_w));
2407//         machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x006000, 0x007fff, 0x9f0000, 0, read8_delegate(FUNC(device_sns_cart_interface::chip_read),state->m_slotcart->m_cart));
2408//         machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x006000, 0x007fff, 0x9f0000, 0, write8_delegate(FUNC(device_sns_cart_interface::chip_write),state->m_slotcart->m_cart));
2409//         set_5a22_map(*state->m_maincpu);
2408//          machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snsnew_state::snes21_lo_r),state), write8_delegate(FUNC(snsnew_state::snes21_lo_w),state));
2409//          machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snsnew_state::snes21_hi_r),state), write8_delegate(FUNC(snsnew_state::snes21_hi_w),state));
2410//          machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x006000, 0x007fff, 0x9f0000, 0, read8_delegate(FUNC(device_sns_cart_interface::chip_read),state->m_slotcart->m_cart));
2411//          machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x006000, 0x007fff, 0x9f0000, 0, write8_delegate(FUNC(device_sns_cart_interface::chip_write),state->m_slotcart->m_cart));
2412//          set_5a22_map(*state->m_maincpu);
24102413         break;
24112414      case SNES_SRTC:
2412//         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x000000, 0x7dffff, FUNC(snes21_lo_r), FUNC(snes21_lo_w));
2413//         machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x800000, 0xffffff, FUNC(snes21_hi_r), FUNC(snes21_hi_w));
2414//         machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x002800, 0x002800, 0xbf0000, 0, read8_delegate(FUNC(device_sns_cart_interface::chip_read),state->m_slotcart->m_cart));
2415//         machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x002801, 0x002801, 0xbf0000, 0, write8_delegate(FUNC(device_sns_cart_interface::chip_write),state->m_slotcart->m_cart));
2416//         set_5a22_map(*state->m_maincpu);
2415//          machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7dffff, read8_delegate(FUNC(snsnew_state::snes21_lo_r),state), write8_delegate(FUNC(snsnew_state::snes21_lo_w),state));
2416//          machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x800000, 0xffffff, read8_delegate(FUNC(snsnew_state::snes21_hi_r),state), write8_delegate(FUNC(snsnew_state::snes21_hi_w),state));
2417//          machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x002800, 0x002800, 0xbf0000, 0, read8_delegate(FUNC(device_sns_cart_interface::chip_read),state->m_slotcart->m_cart));
2418//          machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x002801, 0x002801, 0xbf0000, 0, write8_delegate(FUNC(device_sns_cart_interface::chip_write),state->m_slotcart->m_cart));
2419//          set_5a22_map(*state->m_maincpu);
24172420         break;
24182421   }
24192422}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team