trunk/src/mame/drivers/spinb.c
| r32203 | r32204 | |
| 15 | 15 | soundcard. |
| 16 | 16 | |
| 17 | 17 | Status |
| 18 | | - Bushido: If you quickly press 5 you get a sound. |
| 19 | | - Mach 2: Makes a sound if 5 pressed |
| 20 | | - Jolly Park: Display flashes. After a few moments it plays music |
| 18 | - Bushido: Displays Bushido logo. If you quickly press 5 you get a sound. |
| 19 | - Mach 2: Displays Mach2 logo. Makes a sound if 5 pressed |
| 20 | - Jolly Park: Displays the Spinball logo. After a few moments it plays music |
| 21 | 21 | - Verne's World: Display flashes for a second then goes blank. After a few moments music plays. |
| 22 | 22 | |
| 23 | 23 | ToDo: |
| 24 | | - Inputs and outputs (copied from inder.c) |
| 24 | - Inputs and outputs (currently a copy of inder.c) |
| 25 | 25 | - DMD doesn't act on commands |
| 26 | 26 | - Electronic volume control on the music card |
| 27 | | - Display on jolypark and vrnwrld has dots of 2 intensities |
| 28 | 27 | |
| 28 | |
| 29 | 29 | ****************************************************************************************************/ |
| 30 | 30 | |
| 31 | 31 | #include "machine/genpin.h" |
| r32203 | r32204 | |
| 67 | 67 | DECLARE_WRITE8_MEMBER(ppi60b_w); |
| 68 | 68 | DECLARE_WRITE8_MEMBER(ppi64c_w); |
| 69 | 69 | DECLARE_READ8_MEMBER(sw_r); |
| 70 | | DECLARE_WRITE8_MEMBER(sw_w); |
| 71 | 70 | DECLARE_WRITE8_MEMBER(dmdram_w); |
| 72 | 71 | DECLARE_READ8_MEMBER(dmdram_r); |
| 73 | 72 | DECLARE_READ8_MEMBER(sndcmd_r); |
| r32203 | r32204 | |
| 85 | 84 | DECLARE_DRIVER_INIT(game0); |
| 86 | 85 | DECLARE_DRIVER_INIT(game1); |
| 87 | 86 | DECLARE_DRIVER_INIT(game2); |
| 87 | DECLARE_PALETTE_INIT(spinb); |
| 88 | 88 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 89 | | //UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 90 | 89 | private: |
| 91 | 90 | bool m_pc0a; |
| 92 | 91 | bool m_pc0m; |
| r32203 | r32204 | |
| 109 | 108 | UINT8 *m_p_music; |
| 110 | 109 | UINT8 *m_p_dmdcpu; |
| 111 | 110 | virtual void machine_reset(); |
| 111 | virtual void machine_start(); |
| 112 | 112 | required_device<cpu_device> m_maincpu; |
| 113 | 113 | required_device<cpu_device> m_audiocpu; |
| 114 | 114 | required_device<cpu_device> m_musiccpu; |
| r32203 | r32204 | |
| 304 | 304 | break; |
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | | |
| 308 | | if (m_dmdbank==3) |
| 309 | | { |
| 310 | | m_p32 = 4; |
| 311 | | m_dmdcpu->set_input_line(MCS51_INT0_LINE, CLEAR_LINE); |
| 312 | | } |
| 313 | 307 | } |
| 314 | 308 | |
| 315 | 309 | READ8_MEMBER( spinb_state::p3_r ) |
| r32203 | r32204 | |
| 341 | 335 | return m_switches[m_row]->read(); |
| 342 | 336 | } |
| 343 | 337 | |
| 344 | | WRITE8_MEMBER( spinb_state::sw_w ) |
| 345 | | { |
| 346 | | m_row = offset; |
| 347 | | } |
| 348 | | |
| 349 | 338 | WRITE8_MEMBER( spinb_state::sndcmd_w ) |
| 350 | 339 | { |
| 351 | 340 | m_sndcmd = data; |
| r32203 | r32204 | |
| 373 | 362 | return m_p_dmdcpu[0x80000 + offset + (m_dmdextaddr << 16)]; |
| 374 | 363 | } |
| 375 | 364 | |
| 365 | m_p32 = 4; |
| 366 | m_dmdcpu->set_input_line(MCS51_INT0_LINE, CLEAR_LINE); |
| 376 | 367 | return m_dmdcmd; |
| 377 | 368 | } |
| 378 | 369 | |
| r32203 | r32204 | |
| 537 | 528 | m_row = 0; |
| 538 | 529 | } |
| 539 | 530 | |
| 531 | void spinb_state::machine_start() |
| 532 | { |
| 533 | save_item(NAME(m_dmdram)); // make it visible in the debugger |
| 534 | } |
| 535 | |
| 540 | 536 | DRIVER_INIT_MEMBER( spinb_state, game0 ) |
| 541 | 537 | { |
| 542 | 538 | m_p_audio = memregion("audiorom")->base(); |
| r32203 | r32204 | |
| 560 | 556 | m_game = 2; |
| 561 | 557 | } |
| 562 | 558 | |
| 559 | PALETTE_INIT_MEMBER( spinb_state, spinb ) |
| 560 | { |
| 561 | palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); |
| 562 | palette.set_pen_color(1, rgb_t(0xf7, 0xaa, 0x00)); |
| 563 | palette.set_pen_color(2, rgb_t(0x7c, 0x55, 0x00)); |
| 564 | } |
| 565 | |
| 563 | 566 | UINT32 spinb_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 564 | 567 | { |
| 565 | | UINT8 y,gfx; |
| 568 | UINT8 y,gfx,gfx1; |
| 566 | 569 | UINT16 sy=0,ma,x; |
| 567 | 570 | address_space &internal = m_dmdcpu->space(AS_DATA); |
| 568 | 571 | ma = internal.read_byte(0x05) << 8; // find where display memory is |
| 569 | | ma &= 0xfe00; |
| 570 | 572 | |
| 571 | | for(y=0; y<32; y++) |
| 573 | if (m_game) |
| 572 | 574 | { |
| 573 | | UINT16 *p = &bitmap.pix16(sy++); |
| 574 | | for(x = 0; x < 16; x++) |
| 575 | ma = ((ma - 0x200) & 0x1c00) + 0x200; |
| 576 | |
| 577 | for(y=0; y<32; y++) |
| 575 | 578 | { |
| 576 | | gfx = m_dmdram[ma++]; |
| 579 | UINT16 *p = &bitmap.pix16(sy++); |
| 580 | for(x = 0; x < 16; x++) |
| 581 | { |
| 582 | gfx = m_dmdram[ma+0x200]; |
| 583 | gfx1 = m_dmdram[ma++]; |
| 577 | 584 | |
| 578 | | *p++ = BIT(gfx, 0); |
| 579 | | *p++ = BIT(gfx, 1); |
| 580 | | *p++ = BIT(gfx, 2); |
| 581 | | *p++ = BIT(gfx, 3); |
| 582 | | *p++ = BIT(gfx, 4); |
| 583 | | *p++ = BIT(gfx, 5); |
| 584 | | *p++ = BIT(gfx, 6); |
| 585 | | *p++ = BIT(gfx, 7); |
| 585 | *p++ = BIT(gfx1, 0) ? 1 : BIT(gfx, 0) ? 2 : 0; |
| 586 | *p++ = BIT(gfx1, 1) ? 1 : BIT(gfx, 1) ? 2 : 0; |
| 587 | *p++ = BIT(gfx1, 2) ? 1 : BIT(gfx, 2) ? 2 : 0; |
| 588 | *p++ = BIT(gfx1, 3) ? 1 : BIT(gfx, 3) ? 2 : 0; |
| 589 | *p++ = BIT(gfx1, 4) ? 1 : BIT(gfx, 4) ? 2 : 0; |
| 590 | *p++ = BIT(gfx1, 5) ? 1 : BIT(gfx, 5) ? 2 : 0; |
| 591 | *p++ = BIT(gfx1, 6) ? 1 : BIT(gfx, 6) ? 2 : 0; |
| 592 | *p++ = BIT(gfx1, 7) ? 1 : BIT(gfx, 7) ? 2 : 0; |
| 593 | } |
| 586 | 594 | } |
| 587 | 595 | } |
| 596 | else |
| 597 | { |
| 598 | ma &= 0x1e00; |
| 599 | |
| 600 | for(y=0; y<32; y++) |
| 601 | { |
| 602 | UINT16 *p = &bitmap.pix16(sy++); |
| 603 | for(x = 0; x < 16; x++) |
| 604 | { |
| 605 | gfx = m_dmdram[ma++]; |
| 606 | |
| 607 | *p++ = BIT(gfx, 0); |
| 608 | *p++ = BIT(gfx, 1); |
| 609 | *p++ = BIT(gfx, 2); |
| 610 | *p++ = BIT(gfx, 3); |
| 611 | *p++ = BIT(gfx, 4); |
| 612 | *p++ = BIT(gfx, 5); |
| 613 | *p++ = BIT(gfx, 6); |
| 614 | *p++ = BIT(gfx, 7); |
| 615 | } |
| 616 | } |
| 617 | } |
| 588 | 618 | return 0; |
| 589 | 619 | } |
| 590 | 620 | |
| r32203 | r32204 | |
| 611 | 641 | MCFG_SCREEN_SIZE(128, 32) |
| 612 | 642 | MCFG_SCREEN_VISIBLE_AREA(0, 127, 0, 31) |
| 613 | 643 | MCFG_SCREEN_PALETTE("palette") |
| 614 | | MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette") |
| 644 | MCFG_PALETTE_ADD( "palette", 3 ) |
| 645 | MCFG_PALETTE_INIT_OWNER(spinb_state, spinb) |
| 615 | 646 | |
| 616 | 647 | /* Sound */ |
| 617 | 648 | MCFG_FRAGMENT_ADD( genpin_audio ) |