trunk/src/mess/drivers/gamate.c
| r242553 | r242554 | |
| 2 | 2 | PeT mess@utanet.at 2007, 2014 |
| 3 | 3 | Peter Wilhelmsen peter.wilhelmsen@gmail.com |
| 4 | 4 | Morten Shearman Kirkegaard morten+gamate@afdelingp.dk |
| 5 | Juan Félix Mateos vectrex@hackermesh.org |
| 5 | 6 | ******************************************************************************/ |
| 6 | 7 | |
| 7 | 8 | #include "emu.h" |
| r242553 | r242554 | |
| 27 | 28 | DECLARE_READ8_MEMBER(protection_r); |
| 28 | 29 | DECLARE_READ8_MEMBER(gamate_cart_protection_r); |
| 29 | 30 | DECLARE_WRITE8_MEMBER(gamate_cart_protection_w); |
| 31 | DECLARE_WRITE8_MEMBER(cart_bankswitchmulti_w); |
| 30 | 32 | DECLARE_WRITE8_MEMBER(cart_bankswitch_w); |
| 31 | 33 | DECLARE_READ8_MEMBER(gamate_video_r); |
| 32 | 34 | DECLARE_READ8_MEMBER(gamate_pad_r); |
| r242553 | r242554 | |
| 134 | 136 | } |
| 135 | 137 | } |
| 136 | 138 | |
| 139 | WRITE8_MEMBER( gamate_state::cart_bankswitchmulti_w ) |
| 140 | { |
| 141 | membank("bankmulti")->set_base(m_cart->get_rom_base()+0x4000*data); |
| 142 | } |
| 143 | |
| 137 | 144 | WRITE8_MEMBER( gamate_state::cart_bankswitch_w ) |
| 138 | 145 | { |
| 139 | 146 | membank("bank")->set_base(m_cart->get_rom_base()+0x4000*data); |
| r242553 | r242554 | |
| 181 | 188 | AM_RANGE(0x5000, 0x5007) AM_READWRITE(gamate_video_r, gamate_video_w) |
| 182 | 189 | AM_RANGE(0x5a00, 0x5a00) AM_READ(protection_r) |
| 183 | 190 | |
| 184 | | AM_RANGE(0x6000, 0x9fff) AM_ROM |
| 191 | AM_RANGE(0x6000, 0x9fff) AM_READ_BANK("bankmulti") |
| 185 | 192 | AM_RANGE(0xa000, 0xdfff) AM_READ_BANK("bank") |
| 186 | 193 | |
| 187 | 194 | AM_RANGE(0x6000, 0x6002) AM_READWRITE(gamate_cart_protection_r, gamate_cart_protection_w) |
| 188 | 195 | // AM_RANGE(0x6000, 0xdfff) AM_READWRITE(gamate_cart_r, gamate_cart_w) |
| 196 | AM_RANGE(0x8000, 0x8000) AM_WRITE(cart_bankswitchmulti_w) |
| 189 | 197 | AM_RANGE(0xc000, 0xc000) AM_WRITE(cart_bankswitch_w) |
| 190 | 198 | |
| 191 | 199 | AM_RANGE(0xf000, 0xffff) AM_ROM AM_SHARE("bios") |
| r242553 | r242554 | |
| 290 | 298 | void gamate_state::machine_start() |
| 291 | 299 | { |
| 292 | 300 | if (m_cart->exists()) { |
| 293 | | m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x9fff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_cart)); |
| 294 | 301 | // m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); |
| 295 | | membank("bank")->set_base(m_cart->get_rom_base()+0x4000); |
| 302 | membank("bankmulti")->set_base(m_cart->get_rom_base()); |
| 303 | membank("bank")->set_base(m_cart->get_rom_base()+0x4000); // bankswitched games in reality no offset |
| 296 | 304 | } |
| 297 | 305 | m_bios[0xdf1]=0xea; m_bios[0xdf2]=0xea; // $47 protection readback |
| 298 | 306 | card_protection.address=0x6005-0x6001; |