Previous 199869 Revisions Next

r23155 Saturday 25th May, 2013 at 14:49:38 UTC by Fabio Priuli
(MESS) nes: fixed nvram mirroring in Family Circuit '91 (Namcot-175 board). [Fabio Priuli]
[src/mess/machine]nes_namcot.c nes_namcot.h

trunk/src/mess/machine/nes_namcot.c
r23154r23155
178178
179179   save_item(NAME(m_irq_enable));
180180   save_item(NAME(m_irq_count));
181   save_item(NAME(m_wram_enable));
181   save_item(NAME(m_wram_protect));
182182
183183   m_n163_ram = auto_alloc_array_clear(machine(), UINT8, 0x2000);
184184   save_pointer(NAME(m_n163_ram), 0x2000);
r23154r23155
197197
198198   m_irq_enable = 0;
199199   m_irq_count = 0;
200   m_wram_enable = 0;
200   m_wram_protect = 0;
201201}
202202
203203void nes_namcot163_device::device_start()
r23154r23155
517517READ8_MEMBER(nes_namcot175_device::read_m)
518518{
519519   // the only game supporting this is Family Circuit '91, and it has 2KB of battery
520   if (m_battery && offset < m_battery_size && m_wram_enable)
520   // but it's mirrored up to 8KB (see Sprint Race -> Back Up menu breakage if not)
521   if (m_battery && !m_wram_protect)
521522      return m_battery[offset & (m_battery_size - 1)];
522523
523524   return m_open_bus;   // open bus
r23154r23155
526527WRITE8_MEMBER(nes_namcot175_device::write_m)
527528{
528529   // the only game supporting this is Family Circuit '91, and it has 2KB of battery
529   if (m_battery && offset < m_battery_size && m_wram_enable)
530   // but it's mirrored up to 8KB (see Sprint Race -> Back Up menu breakage if not)
531   if (m_battery && !m_wram_protect)
530532      m_battery[offset & (m_battery_size - 1)] = data;
531533}
532534
r23154r23155
537539   switch (offset & 0x7800)
538540   {
539541      case 0x4000:
540         m_wram_enable = data & 1;
542         m_wram_protect = data & 1;
541543         break;
542544      case 0x6000:
543545         prg8_89(data & 0x3f);
trunk/src/mess/machine/nes_namcot.h
r23154r23155
115115   virtual void pcb_reset();
116116
117117private:
118   UINT8 m_wram_enable;
118   UINT8 m_wram_protect;
119119};
120120
121121

Previous 199869 Revisions Next


© 1997-2024 The MAME Team