trunk/src/mess/drivers/gamate.c
| r244912 | r244913 | |
| 78 | 78 | emu_timer *timer1; |
| 79 | 79 | emu_timer *timer2; |
| 80 | 80 | UINT8 bank_multi; |
| 81 | UINT8 *m_cart_ptr; |
| 81 | 82 | }; |
| 82 | 83 | |
| 83 | 84 | WRITE8_MEMBER( gamate_state::gamate_cart_protection_w ) |
| r244912 | r244913 | |
| 91 | 92 | card_protection.bit_shifter++; |
| 92 | 93 | if (card_protection.bit_shifter>=8) |
| 93 | 94 | { |
| 94 | | card_protection.cartridge_byte=m_cart->get_rom_base()[card_protection.address++]; |
| 95 | card_protection.cartridge_byte=m_cart_ptr[card_protection.address++]; |
| 95 | 96 | card_protection.bit_shifter=0; |
| 96 | 97 | } |
| 97 | 98 | break; |
| r244912 | r244913 | |
| 103 | 104 | UINT8 ret=1; |
| 104 | 105 | if (card_protection.bit_shifter==7 && card_protection.unprotected) |
| 105 | 106 | { |
| 106 | | ret=m_cart->get_rom_base()[bank_multi*0x4000]; |
| 107 | ret=m_cart_ptr[bank_multi*0x4000]; |
| 107 | 108 | } |
| 108 | 109 | else |
| 109 | 110 | { |
| r244912 | r244913 | |
| 135 | 136 | // writes 0x20 |
| 136 | 137 | card_protection.address=0x6005-0x6001; |
| 137 | 138 | card_protection.bit_shifter=0; |
| 138 | | card_protection.cartridge_byte=m_cart->get_rom_base()[card_protection.address++];//m_cart_rom[card_protection.address++]; |
| 139 | card_protection.cartridge_byte=m_cart_ptr[card_protection.address++]; //m_cart_rom[card_protection.address++]; |
| 139 | 140 | card_protection.failed=false; |
| 140 | 141 | card_protection.unprotected=false; |
| 141 | 142 | } |
| r244912 | r244913 | |
| 183 | 184 | WRITE8_MEMBER( gamate_state::cart_bankswitchmulti_w ) |
| 184 | 185 | { |
| 185 | 186 | bank_multi=data; |
| 186 | | membank("bankmulti")->set_base(m_cart->get_rom_base()+0x4000*data+1); |
| 187 | membank("bankmulti")->set_base(m_cart_ptr+0x4000*data+1); |
| 187 | 188 | } |
| 188 | 189 | |
| 189 | 190 | WRITE8_MEMBER( gamate_state::cart_bankswitch_w ) |
| 190 | 191 | { |
| 191 | | membank("bank")->set_base(m_cart->get_rom_base()+0x4000*data); |
| 192 | membank("bank")->set_base(m_cart_ptr+0x4000*data); |
| 192 | 193 | } |
| 193 | 194 | |
| 194 | 195 | READ8_MEMBER( gamate_state::gamate_video_r ) |
| r244912 | r244913 | |
| 314 | 315 | |
| 315 | 316 | void gamate_state::machine_start() |
| 316 | 317 | { |
| 318 | m_cart_ptr = memregion("maincpu")->base() + 0x6000; |
| 317 | 319 | if (m_cart->exists()) |
| 318 | 320 | { |
| 319 | 321 | // m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); |
| 322 | m_cart_ptr = m_cart->get_rom_base(); |
| 320 | 323 | membank("bankmulti")->set_base(m_cart->get_rom_base()+1); |
| 321 | 324 | membank("bank")->set_base(m_cart->get_rom_base()+0x4000); // bankswitched games in reality no offset |
| 322 | 325 | } |