Previous 199869 Revisions Next

r36085 Monday 23rd February, 2015 at 16:48:04 UTC by Alex W. Jackson
thedeep.c: use configured banking (nw)
[/branches/kale/src/mame/drivers]thedeep.c
[/branches/kale/src/mame/includes]thedeep.h

branches/kale/src/mame/drivers/thedeep.c
r244596r244597
5151
5252void thedeep_state::machine_start()
5353{
54   membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000);
5455   save_item(NAME(m_nmi_enable));
5556   save_item(NAME(m_protection_command));
5657   save_item(NAME(m_protection_data));
5758   save_item(NAME(m_protection_index));
5859   save_item(NAME(m_protection_irq));
59   save_item(NAME(m_rombank));
6060   save_item(NAME(m_mcu_p3_reg));
6161}
6262
6363void thedeep_state::machine_reset()
6464{
65   membank("bank1")->set_base(memregion("maincpu")->base() + 0x10000 + 0 * 0x4000);
65   membank("bank1")->set_entry(0);
6666   m_scroll[0] = 0;
6767   m_scroll[1] = 0;
6868   m_scroll[2] = 0;
r244596r244597
7070   m_protection_command = 0;
7171   m_protection_index = -1;
7272   m_protection_irq = 0;
73   m_rombank = -1;
7473}
7574
7675WRITE8_MEMBER(thedeep_state::protection_w)
r244596r244597
9089      case 0x31:
9190      case 0x32:
9291      case 0x33:
93      {
94         UINT8 *rom;
95         int new_rombank = m_protection_command & 3;
96         if (m_rombank == new_rombank)   break;
97         m_rombank = new_rombank;
98         rom = memregion("maincpu")->base();
99         membank("bank1")->set_base(rom + 0x10000 + m_rombank * 0x4000);
100
101      }
92         membank("bank1")->set_entry(m_protection_command & 3);
10293      break;
10394
10495      case 0x59:
r244596r244597
195186
196187***************************************************************************/
197188
198void thedeep_state::maincpu_bankswitch(UINT8 bank_trig)
199{
200   UINT8 *rom;
201   int new_rombank = bank_trig & 3;
202
203   if (m_rombank == new_rombank)
204      return;
205   m_rombank = new_rombank;
206   rom = memregion("maincpu")->base();
207   membank("bank1")->set_base(rom + 0x10000 + m_rombank * 0x4000);
208
209}
210
211189WRITE8_MEMBER(thedeep_state::p1_w)
212190{
213191   flip_screen_set((data & 1) ^ 1);
214   maincpu_bankswitch((data & 6) >> 1);
192   membank("bank1")->set_entry((data & 6) >> 1);
215193   logerror("P1 %02x\n",data);
216194}
217195
branches/kale/src/mame/includes/thedeep.h
r244596r244597
3131   UINT8 m_protection_data;
3232   int m_protection_index;
3333   int m_protection_irq;
34   int m_rombank;
3534   tilemap_t *m_tilemap_0;
3635   tilemap_t *m_tilemap_1;
3736   UINT8 m_mcu_p3_reg;
r244596r244597
6261   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6362   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
6463   
65   void maincpu_bankswitch(UINT8 bank_trig);
6664   INTERRUPT_GEN_MEMBER(mcu_irq);
6765   TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
6866};


Previous 199869 Revisions Next


© 1997-2024 The MAME Team