trunk/src/mame/drivers/segaxbd.c
| r249136 | r249137 | |
| 371 | 371 | : segaxbd_new_state(mconfig, type, tag), |
| 372 | 372 | m_subpcb(*this, "subpcb") |
| 373 | 373 | { |
| 374 | | for (int i = 0; i < 0x10; i++) |
| 374 | for (int i = 0; i < 0x800; i++) |
| 375 | 375 | { |
| 376 | | shareram1[i] = 0x00; |
| 377 | | shareram2[i] = 0x00; |
| 376 | shareram[i] = 0x0000; |
| 378 | 377 | } |
| 378 | rampage1 = 0x0000; |
| 379 | rampage2 = 0x0000; |
| 379 | 380 | } |
| 380 | 381 | |
| 381 | | |
| 382 | 382 | required_device<segaxbd_state> m_subpcb; |
| 383 | 383 | |
| 384 | | DECLARE_READ16_MEMBER(shareram1_r) { return shareram1[offset]; } |
| 385 | | DECLARE_WRITE16_MEMBER(shareram1_w) { COMBINE_DATA(&shareram1[offset]); } |
| 386 | | DECLARE_READ16_MEMBER(shareram2_r) { return shareram2[offset]; } |
| 387 | | DECLARE_WRITE16_MEMBER(shareram2_w) {COMBINE_DATA(&shareram2[offset]); } |
| 384 | DECLARE_READ16_MEMBER(shareram1_r) { |
| 385 | if (offset < 0x10) { |
| 386 | int address = (rampage1 << 4) + offset; |
| 387 | return shareram[address]; |
| 388 | } |
| 389 | return 0xffff; |
| 390 | } |
| 391 | DECLARE_WRITE16_MEMBER(shareram1_w) { |
| 392 | if (offset < 0x10) { |
| 393 | int address = (rampage1 << 4) + offset; |
| 394 | COMBINE_DATA(&shareram[address]); |
| 395 | } else if (offset == 0x10) { |
| 396 | rampage1 = data & 0x00FF; |
| 397 | } |
| 398 | } |
| 399 | DECLARE_READ16_MEMBER(shareram2_r) { |
| 400 | if (offset < 0x10) { |
| 401 | int address = (rampage2 << 4) + offset; |
| 402 | return shareram[address]; |
| 403 | } |
| 404 | return 0xffff; |
| 405 | } |
| 406 | DECLARE_WRITE16_MEMBER(shareram2_w) { |
| 407 | if (offset < 0x10) { |
| 408 | int address = (rampage2 << 4) + offset; |
| 409 | COMBINE_DATA(&shareram[address]); |
| 410 | } else if (offset == 0x10) { |
| 411 | rampage2 = data & 0x007F; |
| 412 | } |
| 413 | } |
| 388 | 414 | |
| 389 | 415 | DECLARE_DRIVER_INIT(gprider_double); |
| 390 | 416 | |
| 391 | | |
| 392 | | UINT16 shareram1[0x20]; |
| 393 | | UINT16 shareram2[0x20]; |
| 417 | UINT16 shareram[0x800]; |
| 418 | UINT16 rampage1; |
| 419 | UINT16 rampage2; |
| 394 | 420 | }; |
| 395 | 421 | |
| 396 | 422 | //************************************************************************** |
| r249136 | r249137 | |
| 3750 | 3776 | m_mainpcb->install_gprider(); |
| 3751 | 3777 | m_subpcb->install_gprider(); |
| 3752 | 3778 | |
| 3753 | | m_mainpcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2F0000, 0x2F003f, read16_delegate(FUNC(segaxbd_new_state_double::shareram2_r), this), write16_delegate(FUNC(segaxbd_new_state_double::shareram1_w), this)); |
| 3754 | | m_subpcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2F0000, 0x2F003f, read16_delegate(FUNC(segaxbd_new_state_double::shareram1_r), this), write16_delegate(FUNC(segaxbd_new_state_double::shareram2_w), this)); |
| 3779 | m_mainpcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2F0000, 0x2F003f, read16_delegate(FUNC(segaxbd_new_state_double::shareram1_r), this), write16_delegate(FUNC(segaxbd_new_state_double::shareram1_w), this)); |
| 3780 | m_subpcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2F0000, 0x2F003f, read16_delegate(FUNC(segaxbd_new_state_double::shareram2_r), this), write16_delegate(FUNC(segaxbd_new_state_double::shareram2_w), this)); |
| 3755 | 3781 | } |
| 3756 | 3782 | |
| 3757 | 3783 | |