trunk/src/mame/drivers/opwolf.c
| r29462 | r29463 | |
| 680 | 680 | MACHINE DRIVERS |
| 681 | 681 | ***********************************************************/ |
| 682 | 682 | |
| 683 | | static const pc080sn_interface opwolf_pc080sn_intf = |
| 684 | | { |
| 685 | | 1, /* gfxnum */ |
| 686 | | 0, 0, 0, 0 /* x_offset, y_offset, y_invert, dblwidth */ |
| 687 | | }; |
| 688 | | |
| 689 | 683 | static MACHINE_CONFIG_START( opwolf, opwolf_state ) |
| 690 | 684 | |
| 691 | 685 | /* basic machine hardware */ |
| r29462 | r29463 | |
| 713 | 707 | MCFG_PALETTE_ADD("palette", 8192) |
| 714 | 708 | MCFG_PALETTE_FORMAT(xxxxRRRRGGGGBBBB) |
| 715 | 709 | |
| 716 | | MCFG_PC080SN_ADD("pc080sn", opwolf_pc080sn_intf) |
| 710 | MCFG_DEVICE_ADD("pc080sn", PC080SN, 0) |
| 711 | MCFG_PC080SN_GFX_REGION(1) |
| 717 | 712 | MCFG_PC080SN_GFXDECODE("gfxdecode") |
| 718 | 713 | MCFG_PC080SN_PALETTE("palette") |
| 719 | 714 | |
| r29462 | r29463 | |
| 778 | 773 | MCFG_PALETTE_ADD("palette", 8192) |
| 779 | 774 | MCFG_PALETTE_FORMAT(xxxxRRRRGGGGBBBB) |
| 780 | 775 | |
| 781 | | MCFG_PC080SN_ADD("pc080sn", opwolf_pc080sn_intf) |
| 776 | MCFG_DEVICE_ADD("pc080sn", PC080SN, 0) |
| 777 | MCFG_PC080SN_GFX_REGION(1) |
| 782 | 778 | MCFG_PC080SN_GFXDECODE("gfxdecode") |
| 783 | 779 | MCFG_PC080SN_PALETTE("palette") |
| 784 | 780 | |
trunk/src/mame/drivers/rastan.c
| r29462 | r29463 | |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | |
| 359 | | static const pc080sn_interface rastan_pc080sn_intf = |
| 360 | | { |
| 361 | | 0, /* gfxnum */ |
| 362 | | 0, 0, 0, 0 /* x_offset, y_offset, y_invert, dblwidth */ |
| 363 | | }; |
| 364 | | |
| 365 | 359 | static MACHINE_CONFIG_START( rastan, rastan_state ) |
| 366 | 360 | |
| 367 | 361 | /* basic machine hardware */ |
| r29462 | r29463 | |
| 388 | 382 | MCFG_PALETTE_ADD("palette", 8192) |
| 389 | 383 | MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) |
| 390 | 384 | |
| 391 | | MCFG_PC080SN_ADD("pc080sn", rastan_pc080sn_intf) |
| 385 | MCFG_DEVICE_ADD("pc080sn", PC080SN, 0) |
| 392 | 386 | MCFG_PC080SN_GFXDECODE("gfxdecode") |
| 393 | 387 | MCFG_PC080SN_PALETTE("palette") |
| 394 | 388 | |
trunk/src/mame/drivers/rainbow.c
| r29462 | r29463 | |
| 619 | 619 | MACHINE DRIVERS |
| 620 | 620 | ***********************************************************/ |
| 621 | 621 | |
| 622 | | static const pc080sn_interface rbisland_pc080sn_intf = |
| 623 | | { |
| 624 | | 1, /* gfxnum */ |
| 625 | | 0, 0, 0, 0 /* x_offset, y_offset, y_invert, dblwidth */ |
| 626 | | }; |
| 627 | | |
| 628 | | static const pc080sn_interface jumping_pc080sn_intf = |
| 629 | | { |
| 630 | | 1, /* gfxnum */ |
| 631 | | 0, 0, 1, 0 /* x_offset, y_offset, y_invert, dblwidth */ |
| 632 | | }; |
| 633 | | |
| 634 | 622 | void rbisland_state::machine_start() |
| 635 | 623 | { |
| 636 | 624 | } |
| r29462 | r29463 | |
| 661 | 649 | MCFG_PALETTE_ADD("palette", 8192) |
| 662 | 650 | MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) |
| 663 | 651 | |
| 664 | | MCFG_PC080SN_ADD("pc080sn", rbisland_pc080sn_intf) |
| 652 | MCFG_DEVICE_ADD("pc080sn", PC080SN, 0) |
| 653 | MCFG_PC080SN_GFX_REGION(1) |
| 665 | 654 | MCFG_PC080SN_GFXDECODE("gfxdecode") |
| 666 | 655 | MCFG_PC080SN_PALETTE("palette") |
| 667 | 656 | |
| r29462 | r29463 | |
| 713 | 702 | |
| 714 | 703 | MCFG_VIDEO_START_OVERRIDE(rbisland_state,jumping) |
| 715 | 704 | |
| 716 | | MCFG_PC080SN_ADD("pc080sn", jumping_pc080sn_intf) |
| 705 | MCFG_DEVICE_ADD("pc080sn", PC080SN, 0) |
| 706 | MCFG_PC080SN_GFX_REGION(1) |
| 707 | MCFG_PC080SN_YINVERT(1) |
| 717 | 708 | MCFG_PC080SN_GFXDECODE("gfxdecode") |
| 718 | 709 | MCFG_PC080SN_PALETTE("palette") |
| 719 | 710 | |
trunk/src/mame/drivers/topspeed.c
| r29462 | r29463 | |
| 525 | 525 | DEVICES |
| 526 | 526 | ***********************************************************/ |
| 527 | 527 | |
| 528 | | static const pc080sn_interface pc080sn_intf = |
| 529 | | { |
| 530 | | 1, // gfxnum |
| 531 | | 0, 8, 0, 0 // x_offset, y_offset, y_invert, dblwidth |
| 532 | | }; |
| 533 | | |
| 534 | 528 | static Z80CTC_INTERFACE( ctc_intf ) |
| 535 | 529 | { |
| 536 | 530 | DEVCB_NULL, // Interrupt handler |
| r29462 | r29463 | |
| 591 | 585 | |
| 592 | 586 | MCFG_Z80CTC_ADD("ctc", XTAL_16MHz / 4, ctc_intf) |
| 593 | 587 | |
| 594 | | MCFG_PC080SN_ADD("pc080sn_1", pc080sn_intf) |
| 588 | MCFG_DEVICE_ADD("pc080sn_1", PC080SN, 0) |
| 589 | MCFG_PC080SN_GFX_REGION(1) |
| 590 | MCFG_PC080SN_OFFSETS(0, 8) |
| 595 | 591 | MCFG_PC080SN_GFXDECODE("gfxdecode") |
| 596 | 592 | MCFG_PC080SN_PALETTE("palette") |
| 597 | | MCFG_PC080SN_ADD("pc080sn_2", pc080sn_intf) |
| 593 | |
| 594 | MCFG_DEVICE_ADD("pc080sn_2", PC080SN, 0) |
| 595 | MCFG_PC080SN_GFX_REGION(1) |
| 596 | MCFG_PC080SN_OFFSETS(0, 8) |
| 598 | 597 | MCFG_PC080SN_GFXDECODE("gfxdecode") |
| 599 | 598 | MCFG_PC080SN_PALETTE("palette") |
| 600 | 599 | |
trunk/src/mame/drivers/darius.c
| r29462 | r29463 | |
| 784 | 784 | MACHINE DRIVERS |
| 785 | 785 | ***********************************************************/ |
| 786 | 786 | |
| 787 | | static const pc080sn_interface darius_pc080sn_intf = |
| 788 | | { |
| 789 | | 1, /* gfxnum */ |
| 790 | | -16, 8, 0, 1 /* x_offset, y_offset, y_invert, dblwidth */ |
| 791 | | }; |
| 792 | | |
| 793 | 787 | void darius_state::darius_postload() |
| 794 | 788 | { |
| 795 | 789 | parse_control(); |
| r29462 | r29463 | |
| 891 | 885 | MCFG_SCREEN_UPDATE_DRIVER(darius_state, screen_update_darius_right) |
| 892 | 886 | MCFG_SCREEN_PALETTE("palette") |
| 893 | 887 | |
| 894 | | |
| 895 | | MCFG_PC080SN_ADD("pc080sn", darius_pc080sn_intf) |
| 888 | MCFG_DEVICE_ADD("pc080sn", PC080SN, 0) |
| 889 | MCFG_PC080SN_GFX_REGION(1) |
| 890 | MCFG_PC080SN_OFFSETS(-16, 8) |
| 891 | MCFG_PC080SN_YINVERT(0) |
| 892 | MCFG_PC080SN_DBLWIDTH(1) |
| 896 | 893 | MCFG_PC080SN_GFXDECODE("gfxdecode") |
| 897 | 894 | MCFG_PC080SN_PALETTE("palette") |
| 898 | 895 | |
trunk/src/mame/video/pc080sn.c
| r29462 | r29463 | |
| 52 | 52 | pc080sn_device::pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 53 | 53 | : device_t(mconfig, PC080SN, "Taito PC080SN", tag, owner, clock, "pc080sn", __FILE__), |
| 54 | 54 | m_ram(NULL), |
| 55 | m_gfxnum(0), |
| 56 | m_x_offset(0), |
| 57 | m_y_offset(0), |
| 58 | m_y_invert(0), |
| 59 | m_dblwidth(0), |
| 55 | 60 | m_gfxdecode(*this), |
| 56 | 61 | m_palette(*this) |
| 57 | 62 | //m_bg_ram[0](NULL), |
| r29462 | r29463 | |
| 82 | 87 | } |
| 83 | 88 | |
| 84 | 89 | //------------------------------------------------- |
| 85 | | // device_config_complete - perform any |
| 86 | | // operations now that the configuration is |
| 87 | | // complete |
| 88 | | //------------------------------------------------- |
| 89 | | |
| 90 | | void pc080sn_device::device_config_complete() |
| 91 | | { |
| 92 | | // inherit a copy of the static data |
| 93 | | const pc080sn_interface *intf = reinterpret_cast<const pc080sn_interface *>(static_config()); |
| 94 | | if (intf != NULL) |
| 95 | | *static_cast<pc080sn_interface *>(this) = *intf; |
| 96 | | |
| 97 | | // or initialize to defaults if none provided |
| 98 | | else |
| 99 | | { |
| 100 | | } |
| 101 | | } |
| 102 | | |
| 103 | | //------------------------------------------------- |
| 104 | 90 | // device_start - device-specific startup |
| 105 | 91 | //------------------------------------------------- |
| 106 | 92 | |
trunk/src/mame/video/pc080sn.h
| r29462 | r29463 | |
| 1 | 1 | #ifndef __PC080SN_H__ |
| 2 | 2 | #define __PC080SN_H__ |
| 3 | 3 | |
| 4 | | struct pc080sn_interface |
| 4 | class pc080sn_device : public device_t |
| 5 | 5 | { |
| 6 | | int m_gfxnum; |
| 7 | | |
| 8 | | int m_x_offset, m_y_offset; |
| 9 | | int m_y_invert; |
| 10 | | int m_dblwidth; |
| 11 | | }; |
| 12 | | |
| 13 | | class pc080sn_device : public device_t, |
| 14 | | public pc080sn_interface |
| 15 | | { |
| 16 | 6 | public: |
| 17 | 7 | pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 18 | 8 | ~pc080sn_device() {} |
| r29462 | r29463 | |
| 20 | 10 | // static configuration |
| 21 | 11 | static void static_set_gfxdecode_tag(device_t &device, const char *tag); |
| 22 | 12 | static void static_set_palette_tag(device_t &device, const char *tag); |
| 23 | | |
| 13 | static void set_gfx_region(device_t &device, int gfxregion) { downcast<pc080sn_device &>(device).m_gfxnum = gfxregion; } |
| 14 | static void set_yinvert(device_t &device, int y_inv) { downcast<pc080sn_device &>(device).m_y_invert = y_inv; } |
| 15 | static void set_dblwidth(device_t &device, int dblwidth) { downcast<pc080sn_device &>(device).m_dblwidth = dblwidth; } |
| 16 | static void set_offsets(device_t &device, int x_offset, int y_offset) |
| 17 | { |
| 18 | pc080sn_device &dev = downcast<pc080sn_device &>(device); |
| 19 | dev.m_x_offset = x_offset; |
| 20 | dev.m_y_offset = y_offset; |
| 21 | } |
| 22 | |
| 24 | 23 | DECLARE_READ16_MEMBER( word_r ); |
| 25 | 24 | DECLARE_WRITE16_MEMBER( word_w ); |
| 26 | 25 | DECLARE_WRITE16_MEMBER( xscroll_word_w ); |
| r29462 | r29463 | |
| 48 | 47 | |
| 49 | 48 | protected: |
| 50 | 49 | // device-level overrides |
| 51 | | virtual void device_config_complete(); |
| 52 | 50 | virtual void device_start(); |
| 53 | 51 | |
| 54 | 52 | private: |
| r29462 | r29463 | |
| 62 | 60 | int m_bgscrollx[2], m_bgscrolly[2]; |
| 63 | 61 | |
| 64 | 62 | tilemap_t *m_tilemap[2]; |
| 63 | |
| 64 | int m_gfxnum; |
| 65 | int m_x_offset, m_y_offset; |
| 66 | int m_y_invert; |
| 67 | int m_dblwidth; |
| 68 | |
| 65 | 69 | required_device<gfxdecode_device> m_gfxdecode; |
| 66 | 70 | required_device<palette_device> m_palette; |
| 67 | 71 | }; |
| 68 | 72 | |
| 69 | 73 | extern const device_type PC080SN; |
| 70 | 74 | |
| 71 | | #define MCFG_PC080SN_ADD(_tag, _interface) \ |
| 72 | | MCFG_DEVICE_ADD(_tag, PC080SN, 0) \ |
| 73 | | MCFG_DEVICE_CONFIG(_interface) |
| 74 | 75 | |
| 76 | #define MCFG_PC080SN_GFX_REGION(_region) \ |
| 77 | pc080sn_device::set_gfx_region(*device, _region); |
| 78 | |
| 79 | #define MCFG_PC080SN_OFFSETS(_xoffs, _yoffs) \ |
| 80 | pc080sn_device::set_offsets(*device, _xoffs, _yoffs); |
| 81 | |
| 82 | #define MCFG_PC080SN_YINVERT(_yinv) \ |
| 83 | pc080sn_device::set_yinvert(*device, _yinv); |
| 84 | |
| 85 | #define MCFG_PC080SN_DBLWIDTH(_dbl) \ |
| 86 | pc080sn_device::set_dblwidth(*device, _dbl); |
| 87 | |
| 75 | 88 | #define MCFG_PC080SN_GFXDECODE(_gfxtag) \ |
| 76 | 89 | pc080sn_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); |
| 77 | 90 | |