trunk/src/mame/includes/btime.h
| r17534 | r17535 | |
| 1 | /*************************************************************************** |
| 1 | 2 | |
| 3 | Burger Time hardware |
| 4 | |
| 5 | ***************************************************************************/ |
| 6 | |
| 2 | 7 | class btime_state : public driver_device |
| 3 | 8 | { |
| 4 | 9 | public: |
| 5 | 10 | btime_state(const machine_config &mconfig, device_type type, const char *tag) |
| 6 | | : driver_device(mconfig, type, tag) , |
| 11 | : driver_device(mconfig, type, tag), |
| 7 | 12 | m_rambase(*this, "rambase"), |
| 8 | 13 | m_videoram(*this, "videoram"), |
| 9 | 14 | m_colorram(*this, "colorram"), |
| r17534 | r17535 | |
| 12 | 17 | m_lnc_charbank(*this, "lnc_charbank"), |
| 13 | 18 | m_deco_charram(*this, "deco_charram"), |
| 14 | 19 | m_spriteram(*this, "spriteram"), |
| 15 | | m_audio_rambase(*this, "audio_rambase"){ } |
| 20 | m_audio_rambase(*this, "audio_rambase") |
| 21 | { } |
| 16 | 22 | |
| 17 | 23 | /* memory pointers */ |
| 18 | 24 | optional_shared_ptr<UINT8> m_rambase; |
| r17534 | r17535 | |
| 48 | 54 | /* devices */ |
| 49 | 55 | device_t *m_maincpu; |
| 50 | 56 | device_t *m_audiocpu; |
| 57 | |
| 51 | 58 | DECLARE_WRITE8_MEMBER(audio_nmi_enable_w); |
| 52 | 59 | DECLARE_WRITE8_MEMBER(lnc_w); |
| 53 | 60 | DECLARE_WRITE8_MEMBER(mmonkey_w); |
| r17534 | r17535 | |
| 80 | 87 | DECLARE_INPUT_CHANGED_MEMBER(coin_inserted_irq_lo); |
| 81 | 88 | DECLARE_INPUT_CHANGED_MEMBER(coin_inserted_nmi_lo); |
| 82 | 89 | DECLARE_WRITE8_MEMBER(ay_audio_nmi_enable_w); |
| 90 | |
| 83 | 91 | DECLARE_DRIVER_INIT(btime); |
| 84 | 92 | DECLARE_DRIVER_INIT(tisland); |
| 85 | 93 | DECLARE_DRIVER_INIT(cookrace); |
| r17534 | r17535 | |
| 90 | 98 | DECLARE_DRIVER_INIT(protennb); |
| 91 | 99 | DECLARE_DRIVER_INIT(disco); |
| 92 | 100 | DECLARE_DRIVER_INIT(lnc); |
| 93 | | DECLARE_DRIVER_INIT(rockduck); |
| 94 | 101 | }; |
| 95 | 102 | |
| 96 | 103 | |
| r17534 | r17535 | |
| 114 | 121 | SCREEN_UPDATE_IND16( disco ); |
| 115 | 122 | SCREEN_UPDATE_IND16( eggs ); |
| 116 | 123 | |
| 117 | | |
trunk/src/mame/drivers/btime.c
| r17534 | r17535 | |
| 159 | 159 | |
| 160 | 160 | |
| 161 | 161 | |
| 162 | static UINT8 *decrypted; // TODO: put me in btime class |
| 162 | 163 | |
| 163 | | |
| 164 | | |
| 165 | | static UINT8 *decrypted; |
| 166 | | |
| 167 | 164 | WRITE8_MEMBER(btime_state::audio_nmi_enable_w) |
| 168 | 165 | { |
| 169 | | |
| 170 | 166 | /* for most games, this serves as the NMI enable for the audio CPU; however, |
| 171 | 167 | lnc and disco use bit 0 of the first AY-8910's port A instead; many other |
| 172 | 168 | games also write there in addition to this address */ |
| r17534 | r17535 | |
| 179 | 175 | |
| 180 | 176 | WRITE8_MEMBER(btime_state::ay_audio_nmi_enable_w) |
| 181 | 177 | { |
| 182 | | |
| 183 | 178 | /* port A bit 0, when 1, inhibits the NMI */ |
| 184 | 179 | if (m_audio_nmi_enable_type == AUDIO_ENABLE_AY8910) |
| 185 | 180 | { |
| r17534 | r17535 | |
| 210 | 205 | UINT8 *src, *src1; |
| 211 | 206 | int addr, addr1; |
| 212 | 207 | |
| 213 | | |
| 214 | 208 | /* the encryption is a simple bit rotation: 76543210 -> 65342710, but */ |
| 215 | 209 | /* with a catch: it is only applied if the previous instruction did a */ |
| 216 | 210 | /* memory write. Also, only opcodes at addresses with this bit pattern: */ |
| r17534 | r17535 | |
| 237 | 231 | |
| 238 | 232 | WRITE8_MEMBER(btime_state::lnc_w) |
| 239 | 233 | { |
| 240 | | |
| 241 | 234 | if (offset <= 0x3bff) ; |
| 242 | 235 | else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space, offset - 0x3c00, data); return; } |
| 243 | 236 | else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(space, offset - 0x7c00, data); return; } |
| r17534 | r17535 | |
| 257 | 250 | |
| 258 | 251 | WRITE8_MEMBER(btime_state::mmonkey_w) |
| 259 | 252 | { |
| 260 | | |
| 261 | 253 | if (offset <= 0x3bff) ; |
| 262 | 254 | else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space, offset - 0x3c00, data); return; } |
| 263 | 255 | else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(space, offset - 0x7c00, data); return; } |
| r17534 | r17535 | |
| 276 | 268 | |
| 277 | 269 | WRITE8_MEMBER(btime_state::btime_w) |
| 278 | 270 | { |
| 279 | | |
| 280 | 271 | if (offset <= 0x07ff) ; |
| 281 | 272 | else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(space, offset - 0x0c00, data); |
| 282 | 273 | else if (offset >= 0x1000 && offset <= 0x17ff) ; |
| r17534 | r17535 | |
| 294 | 285 | |
| 295 | 286 | WRITE8_MEMBER(btime_state::tisland_w) |
| 296 | 287 | { |
| 297 | | |
| 298 | 288 | if (offset <= 0x07ff) ; |
| 299 | 289 | else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(space, offset - 0x0c00, data); |
| 300 | 290 | else if (offset >= 0x1000 && offset <= 0x17ff) ; |
| r17534 | r17535 | |
| 314 | 304 | |
| 315 | 305 | WRITE8_MEMBER(btime_state::zoar_w) |
| 316 | 306 | { |
| 317 | | |
| 318 | 307 | if (offset <= 0x07ff) ; |
| 319 | 308 | else if (offset >= 0x8000 && offset <= 0x87ff) ; |
| 320 | 309 | else if (offset >= 0x8800 && offset <= 0x8bff) btime_mirrorvideoram_w(space, offset - 0x8800, data); |
| r17534 | r17535 | |
| 333 | 322 | |
| 334 | 323 | WRITE8_MEMBER(btime_state::disco_w) |
| 335 | 324 | { |
| 336 | | |
| 337 | 325 | if (offset <= 0x04ff) ; |
| 338 | 326 | else if (offset >= 0x2000 && offset <= 0x7fff) deco_charram_w(space, offset - 0x2000, data); |
| 339 | 327 | else if (offset >= 0x8000 && offset <= 0x881f) ; |
| r17534 | r17535 | |
| 517 | 505 | |
| 518 | 506 | INPUT_CHANGED_MEMBER(btime_state::coin_inserted_irq_hi) |
| 519 | 507 | { |
| 520 | | |
| 521 | 508 | if (newval) |
| 522 | 509 | device_set_input_line(m_maincpu, 0, HOLD_LINE); |
| 523 | 510 | } |
| 524 | 511 | |
| 525 | 512 | INPUT_CHANGED_MEMBER(btime_state::coin_inserted_irq_lo) |
| 526 | 513 | { |
| 527 | | |
| 528 | 514 | if (!newval) |
| 529 | 515 | device_set_input_line(m_maincpu, 0, HOLD_LINE); |
| 530 | 516 | } |
trunk/src/mame/drivers/scregg.c
| r17534 | r17535 | |
| 7 | 7 | driver by Nicola Salmoria |
| 8 | 8 | |
| 9 | 9 | To Do: |
| 10 | | Sprite Priorities in Dommy |
| 10 | - Sprite Priorities in dommy |
| 11 | - Where is IRQ ack in dommy? |
| 11 | 12 | |
| 12 | 13 | |
| 13 | 14 | Rock Duck |
| r17534 | r17535 | |
| 54 | 55 | #include "sound/ay8910.h" |
| 55 | 56 | #include "includes/btime.h" |
| 56 | 57 | |
| 58 | class scregg_state : public btime_state |
| 59 | { |
| 60 | public: |
| 61 | scregg_state(const machine_config &mconfig, device_type type, const char *tag) |
| 62 | : btime_state(mconfig, type, tag) { } |
| 57 | 63 | |
| 64 | DECLARE_WRITE8_MEMBER(dommy_coincounter_w); |
| 65 | |
| 66 | DECLARE_DRIVER_INIT(rockduck); |
| 67 | }; |
| 68 | |
| 69 | |
| 70 | |
| 58 | 71 | static TIMER_DEVICE_CALLBACK( scregg_interrupt ) |
| 59 | 72 | { |
| 60 | | btime_state *state = timer.machine().driver_data<btime_state>(); |
| 73 | scregg_state *state = timer.machine().driver_data<scregg_state>(); |
| 61 | 74 | device_set_input_line(state->m_maincpu, 0, (param & 8) ? HOLD_LINE : CLEAR_LINE); |
| 62 | 75 | } |
| 63 | 76 | |
| 64 | | static WRITE8_HANDLER( dommy_coincounter_w ) |
| 77 | WRITE8_MEMBER(scregg_state::dommy_coincounter_w) |
| 65 | 78 | { |
| 66 | | coin_counter_w(space->machine(), 0, data & 0x40); |
| 67 | | coin_counter_w(space->machine(), 1, data & 0x80); |
| 79 | coin_counter_w(machine(), 0, data & 0x40); |
| 80 | coin_counter_w(machine(), 1, data & 0x80); |
| 68 | 81 | } |
| 69 | 82 | |
| 70 | 83 | |
| 71 | | static ADDRESS_MAP_START( dommy_map, AS_PROGRAM, 8, btime_state ) |
| 84 | static ADDRESS_MAP_START( dommy_map, AS_PROGRAM, 8, scregg_state ) |
| 72 | 85 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 73 | 86 | AM_RANGE(0x2000, 0x23ff) AM_RAM AM_SHARE("videoram") |
| 74 | 87 | AM_RANGE(0x2400, 0x27ff) AM_RAM AM_SHARE("colorram") |
| 75 | 88 | AM_RANGE(0x2800, 0x2bff) AM_READWRITE(btime_mirrorvideoram_r, btime_mirrorvideoram_w) |
| 76 | | AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW1") AM_WRITE_LEGACY(dommy_coincounter_w) |
| 89 | AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW1") AM_WRITE(dommy_coincounter_w) |
| 77 | 90 | AM_RANGE(0x4001, 0x4001) AM_READ_PORT("DSW2") AM_WRITE(btime_video_control_w) |
| 78 | 91 | /* AM_RANGE(0x4004, 0x4004) */ /* this is read */ |
| 79 | 92 | AM_RANGE(0x4002, 0x4002) AM_READ_PORT("P1") |
| r17534 | r17535 | |
| 84 | 97 | ADDRESS_MAP_END |
| 85 | 98 | |
| 86 | 99 | |
| 87 | | static ADDRESS_MAP_START( eggs_map, AS_PROGRAM, 8, btime_state ) |
| 100 | static ADDRESS_MAP_START( eggs_map, AS_PROGRAM, 8, scregg_state ) |
| 88 | 101 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 89 | 102 | AM_RANGE(0x1000, 0x13ff) AM_RAM AM_SHARE("videoram") |
| 90 | 103 | AM_RANGE(0x1400, 0x17ff) AM_RAM AM_SHARE("colorram") |
| r17534 | r17535 | |
| 215 | 228 | |
| 216 | 229 | static MACHINE_START( scregg ) |
| 217 | 230 | { |
| 218 | | btime_state *state = machine.driver_data<btime_state>(); |
| 231 | scregg_state *state = machine.driver_data<scregg_state>(); |
| 219 | 232 | |
| 220 | 233 | state->m_maincpu = machine.device("maincpu"); |
| 221 | 234 | state->m_audiocpu = NULL; |
| r17534 | r17535 | |
| 228 | 241 | |
| 229 | 242 | static MACHINE_RESET( scregg ) |
| 230 | 243 | { |
| 231 | | btime_state *state = machine.driver_data<btime_state>(); |
| 244 | scregg_state *state = machine.driver_data<scregg_state>(); |
| 232 | 245 | |
| 233 | 246 | state->m_btime_palette = 0; |
| 234 | 247 | state->m_bnj_scroll1 = 0; |
| r17534 | r17535 | |
| 239 | 252 | state->m_btime_tilemap[3] = 0; |
| 240 | 253 | } |
| 241 | 254 | |
| 242 | | static MACHINE_CONFIG_START( dommy, btime_state ) |
| 255 | static MACHINE_CONFIG_START( dommy, scregg_state ) |
| 243 | 256 | |
| 244 | 257 | /* basic machine hardware */ |
| 245 | 258 | MCFG_CPU_ADD("maincpu", M6502, XTAL_12MHz/8) |
| r17534 | r17535 | |
| 271 | 284 | MACHINE_CONFIG_END |
| 272 | 285 | |
| 273 | 286 | |
| 274 | | static MACHINE_CONFIG_START( scregg, btime_state ) |
| 287 | static MACHINE_CONFIG_START( scregg, scregg_state ) |
| 275 | 288 | |
| 276 | 289 | /* basic machine hardware */ |
| 277 | 290 | MCFG_CPU_ADD("maincpu", M6502, XTAL_12MHz/8) |
| r17534 | r17535 | |
| 392 | 405 | ROM_END |
| 393 | 406 | |
| 394 | 407 | |
| 395 | | DRIVER_INIT_MEMBER(btime_state,rockduck) |
| 408 | DRIVER_INIT_MEMBER(scregg_state,rockduck) |
| 396 | 409 | { |
| 397 | 410 | // rd2.rdh and rd1.rdj are bitswapped, but not rd3.rdg .. are they really from the same board? |
| 398 | 411 | int x; |
| r17534 | r17535 | |
| 406 | 419 | } |
| 407 | 420 | |
| 408 | 421 | |
| 409 | | GAME( 1983, dommy, 0, dommy, scregg, driver_device, 0, ROT270, "Technos Japan", "Dommy", GAME_SUPPORTS_SAVE ) |
| 410 | | GAME( 1983, scregg, 0, scregg, scregg, driver_device, 0, ROT270, "Technos Japan", "Scrambled Egg", GAME_SUPPORTS_SAVE ) |
| 411 | | GAME( 1983, eggs, scregg, scregg, scregg, driver_device, 0, ROT270, "Technos Japan / Universal USA", "Eggs", GAME_SUPPORTS_SAVE ) |
| 412 | | GAME( 1983, rockduck, 0, scregg, rockduck, btime_state, rockduck, ROT270, "Datel SAS", "Rock Duck (prototype?)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) |
| 422 | GAME( 1983, dommy, 0, dommy, scregg, driver_device, 0, ROT270, "Technos Japan", "Dommy", GAME_SUPPORTS_SAVE ) |
| 423 | GAME( 1983, scregg, 0, scregg, scregg, driver_device, 0, ROT270, "Technos Japan", "Scrambled Egg", GAME_SUPPORTS_SAVE ) |
| 424 | GAME( 1983, eggs, scregg, scregg, scregg, driver_device, 0, ROT270, "Technos Japan (Universal USA license)", "Eggs (USA)", GAME_SUPPORTS_SAVE ) |
| 425 | GAME( 1983, rockduck, 0, scregg, rockduck, scregg_state, rockduck, ROT270, "Datel SAS", "Rock Duck (prototype?)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) |