trunk/src/mame/drivers/lordgun.c
| r18345 | r18346 | |
| 71 | 71 | |
| 72 | 72 | rom[i] = x; |
| 73 | 73 | } |
| 74 | | |
| 75 | | // Protection |
| 76 | | |
| 77 | | rom[0x14832/2] = 0x6000; // 014832: 6700 0006 beq $1483a (protection) |
| 78 | | rom[0x1587e/2] = 0x6010; // 01587E: 6710 beq $15890 (rom check) |
| 79 | 74 | } |
| 80 | 75 | |
| 81 | 76 | |
| r18345 | r18346 | |
| 134 | 129 | |
| 135 | 130 | ***************************************************************************/ |
| 136 | 131 | |
| 132 | |
| 133 | WRITE16_MEMBER(lordgun_state::lordgun_protection_w) |
| 134 | { |
| 135 | switch (offset & 0x60) |
| 136 | { |
| 137 | // The data written to offsets 0 - 1f is offset * 2 |
| 138 | // Use this write to increment the counter. |
| 139 | case 0x00: |
| 140 | m_lordgun_protection_data++; |
| 141 | return; |
| 142 | |
| 143 | case 0x20: // unused? |
| 144 | case 0x40: // protection results are read back from 40-5f. |
| 145 | return; |
| 146 | |
| 147 | case 0x60: // reset / init |
| 148 | m_lordgun_protection_data = 0; |
| 149 | return; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | READ16_MEMBER(lordgun_state::lordgun_protection_r) |
| 154 | { |
| 155 | // Other offset ranges are not used? |
| 156 | if ((offset & 0x60) == 0x40) |
| 157 | { |
| 158 | // Check to see if counter meets various conditions. |
| 159 | // The results may not be 0010, but this is the only bit |
| 160 | // that is checked by the 68k. |
| 161 | if ((m_lordgun_protection_data & 0x11) == 0x01) |
| 162 | return 0x0010; |
| 163 | |
| 164 | if ((m_lordgun_protection_data & 0x06) == 0x02) |
| 165 | return 0x0010; |
| 166 | |
| 167 | if ((m_lordgun_protection_data & 0x09) == 0x08) |
| 168 | return 0x0010; |
| 169 | |
| 170 | return 0; |
| 171 | } |
| 172 | |
| 173 | return 0; |
| 174 | } |
| 175 | |
| 137 | 176 | WRITE8_MEMBER(lordgun_state::fake_w) |
| 138 | 177 | { |
| 139 | 178 | } |
| r18345 | r18346 | |
| 286 | 325 | AM_RANGE(0x504000, 0x504001) AM_WRITE(lordgun_soundlatch_w) |
| 287 | 326 | AM_RANGE(0x506000, 0x506007) AM_DEVREADWRITE8("ppi8255_0", i8255_device, read, write, 0x00ff) |
| 288 | 327 | AM_RANGE(0x508000, 0x508007) AM_DEVREADWRITE8("ppi8255_1", i8255_device, read, write, 0x00ff) |
| 289 | | AM_RANGE(0x50a900, 0x50a9ff) AM_RAM // protection |
| 328 | AM_RANGE(0x50a900, 0x50a9ff) AM_READWRITE(lordgun_protection_r, lordgun_protection_w) |
| 290 | 329 | ADDRESS_MAP_END |
| 291 | 330 | |
| 292 | 331 | |
| r18345 | r18346 | |
| 1039 | 1078 | |
| 1040 | 1079 | ***************************************************************************/ |
| 1041 | 1080 | |
| 1042 | | GAME( 1994, lordgun, 0, lordgun, lordgun, lordgun_state, lordgun, ROT0, "IGS", "Lord of Gun (USA)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS ) |
| 1081 | GAME( 1994, lordgun, 0, lordgun, lordgun, lordgun_state, lordgun, ROT0, "IGS", "Lord of Gun (USA)", GAME_IMPERFECT_GRAPHICS ) |
| 1043 | 1082 | GAME( 1994, aliencha, 0, aliencha, aliencha, lordgun_state, aliencha, ROT0, "IGS", "Alien Challenge (World)", GAME_UNEMULATED_PROTECTION ) |
| 1044 | 1083 | GAME( 1994, alienchac, aliencha, aliencha, aliencha, lordgun_state, alienchac, ROT0, "IGS", "Alien Challenge (China)", GAME_UNEMULATED_PROTECTION ) |