trunk/src/mame/drivers/taito_o.c
| r29459 | r29460 | |
| 230 | 230 | DEVCB_NULL, DEVCB_NULL, |
| 231 | 231 | }; |
| 232 | 232 | |
| 233 | | static const tc0080vco_interface parentj_intf = |
| 234 | | { |
| 235 | | 0, 1, /* gfxnum, txnum */ |
| 236 | | 1, 1, -2, |
| 237 | | 0 |
| 238 | | }; |
| 239 | | |
| 240 | 233 | void taitoo_state::machine_start() |
| 241 | 234 | { |
| 242 | 235 | } |
| r29459 | r29460 | |
| 260 | 253 | MCFG_PALETTE_ADD("palette", 33*16) |
| 261 | 254 | MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) |
| 262 | 255 | |
| 263 | | MCFG_TC0080VCO_ADD("tc0080vco", parentj_intf) |
| 256 | MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0) |
| 257 | MCFG_TC0080VCO_GFX_REGION(0) |
| 258 | MCFG_TC0080VCO_TX_REGION(1) |
| 259 | MCFG_TC0080VCO_OFFSETS(1, 1) |
| 260 | MCFG_TC0080VCO_BGFLIP_OFFS(-2) |
| 264 | 261 | MCFG_TC0080VCO_GFXDECODE("gfxdecode") |
| 265 | 262 | MCFG_TC0080VCO_PALETTE("palette") |
| 266 | 263 | |
trunk/src/mame/drivers/taito_h.c
| r29459 | r29460 | |
| 646 | 646 | } |
| 647 | 647 | |
| 648 | 648 | |
| 649 | | static const tc0080vco_interface syvalion_tc0080vco_intf = |
| 650 | | { |
| 651 | | 0, 1, /* gfxnum, txnum */ |
| 652 | | 1, 1, -2, |
| 653 | | 1 |
| 654 | | }; |
| 655 | | |
| 656 | | static const tc0080vco_interface recordbr_tc0080vco_intf = |
| 657 | | { |
| 658 | | 0, 1, /* gfxnum, txnum */ |
| 659 | | 1, 1, -2, |
| 660 | | 0 |
| 661 | | }; |
| 662 | | |
| 663 | 649 | static MACHINE_CONFIG_START( syvalion, taitoh_state ) |
| 664 | 650 | |
| 665 | 651 | /* basic machine hardware */ |
| r29459 | r29460 | |
| 693 | 679 | MCFG_PALETTE_ADD("palette", 33*16) |
| 694 | 680 | MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) |
| 695 | 681 | |
| 696 | | MCFG_TC0080VCO_ADD("tc0080vco", syvalion_tc0080vco_intf) |
| 682 | MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0) |
| 683 | MCFG_TC0080VCO_GFX_REGION(0) |
| 684 | MCFG_TC0080VCO_TX_REGION(1) |
| 685 | MCFG_TC0080VCO_OFFSETS(1, 1) |
| 686 | MCFG_TC0080VCO_BGFLIP_OFFS(-2) |
| 697 | 687 | MCFG_TC0080VCO_GFXDECODE("gfxdecode") |
| 698 | 688 | MCFG_TC0080VCO_PALETTE("palette") |
| 699 | 689 | |
| r29459 | r29460 | |
| 745 | 735 | MCFG_PALETTE_ADD("palette", 32*16) |
| 746 | 736 | MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) |
| 747 | 737 | |
| 748 | | MCFG_TC0080VCO_ADD("tc0080vco", recordbr_tc0080vco_intf) |
| 738 | MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0) |
| 739 | MCFG_TC0080VCO_GFX_REGION(0) |
| 740 | MCFG_TC0080VCO_TX_REGION(1) |
| 741 | MCFG_TC0080VCO_OFFSETS(1, 1) |
| 742 | MCFG_TC0080VCO_BGFLIP_OFFS(-2) |
| 749 | 743 | MCFG_TC0080VCO_GFXDECODE("gfxdecode") |
| 750 | 744 | MCFG_TC0080VCO_PALETTE("palette") |
| 751 | 745 | |
| r29459 | r29460 | |
| 805 | 799 | MCFG_PALETTE_ADD("palette", 33*16) |
| 806 | 800 | MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) |
| 807 | 801 | |
| 808 | | MCFG_TC0080VCO_ADD("tc0080vco", recordbr_tc0080vco_intf) |
| 802 | MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0) |
| 803 | MCFG_TC0080VCO_GFX_REGION(0) |
| 804 | MCFG_TC0080VCO_TX_REGION(1) |
| 805 | MCFG_TC0080VCO_OFFSETS(1, 1) |
| 806 | MCFG_TC0080VCO_BGFLIP_OFFS(-2) |
| 809 | 807 | MCFG_TC0080VCO_GFXDECODE("gfxdecode") |
| 810 | 808 | MCFG_TC0080VCO_PALETTE("palette") |
| 811 | 809 | |
trunk/src/mame/drivers/taitoair.c
| r29459 | r29460 | |
| 638 | 638 | MACHINE DRIVERS |
| 639 | 639 | ************************************************************/ |
| 640 | 640 | |
| 641 | | static const tc0080vco_interface airsys_tc0080vco_intf = |
| 642 | | { |
| 643 | | 0, 1, /* gfxnum, txnum */ |
| 644 | | 1, 1, -2, |
| 645 | | 0 |
| 646 | | }; |
| 647 | | |
| 648 | 641 | void taitoair_state::machine_start() |
| 649 | 642 | { |
| 650 | 643 | UINT8 *ROM = memregion("audiocpu")->base(); |
| r29459 | r29460 | |
| 716 | 709 | |
| 717 | 710 | MCFG_PALETTE_ADD_INIT_BLACK("palette", 512*16+512*16) |
| 718 | 711 | |
| 719 | | MCFG_TC0080VCO_ADD("tc0080vco", airsys_tc0080vco_intf) |
| 712 | MCFG_DEVICE_ADD("tc0080vco", TC0080VCO, 0) |
| 713 | MCFG_TC0080VCO_GFX_REGION(0) |
| 714 | MCFG_TC0080VCO_TX_REGION(1) |
| 715 | MCFG_TC0080VCO_OFFSETS(1, 1) |
| 716 | MCFG_TC0080VCO_BGFLIP_OFFS(-2) |
| 720 | 717 | MCFG_TC0080VCO_GFXDECODE("gfxdecode") |
| 721 | 718 | MCFG_TC0080VCO_PALETTE("palette") |
| 722 | 719 | |
trunk/src/mame/video/tc0080vco.c
| r29459 | r29460 | |
| 95 | 95 | m_bg1_scrollx(0), |
| 96 | 96 | m_bg1_scrolly(0), |
| 97 | 97 | m_flipscreen(0), |
| 98 | m_gfxnum(0), |
| 99 | m_txnum(0), |
| 100 | m_bg_xoffs(0), |
| 101 | m_bg_yoffs(0), |
| 102 | m_bg_flip_yoffs(0), |
| 103 | m_has_fg0(1), |
| 98 | 104 | m_gfxdecode(*this), |
| 99 | 105 | m_palette(*this) |
| 100 | 106 | { |
| r29459 | r29460 | |
| 121 | 127 | } |
| 122 | 128 | |
| 123 | 129 | //------------------------------------------------- |
| 124 | | // device_config_complete - perform any |
| 125 | | // operations now that the configuration is |
| 126 | | // complete |
| 127 | | //------------------------------------------------- |
| 128 | | |
| 129 | | void tc0080vco_device::device_config_complete() |
| 130 | | { |
| 131 | | // inherit a copy of the static data |
| 132 | | const tc0080vco_interface *intf = reinterpret_cast<const tc0080vco_interface *>(static_config()); |
| 133 | | if (intf != NULL) |
| 134 | | *static_cast<tc0080vco_interface *>(this) = *intf; |
| 135 | | |
| 136 | | // or initialize to defaults if none provided |
| 137 | | else |
| 138 | | { |
| 139 | | } |
| 140 | | } |
| 141 | | |
| 142 | | //------------------------------------------------- |
| 143 | 130 | // device_start - device-specific startup |
| 144 | 131 | //------------------------------------------------- |
| 145 | 132 | |
trunk/src/mame/video/tc0080vco.h
| r29459 | r29460 | |
| 1 | 1 | #ifndef __TC0080VCO_H__ |
| 2 | 2 | #define __TC0080VCO_H__ |
| 3 | 3 | |
| 4 | | struct tc0080vco_interface |
| 4 | class tc0080vco_device : public device_t |
| 5 | 5 | { |
| 6 | | int m_gfxnum; |
| 7 | | int m_txnum; |
| 8 | | |
| 9 | | int m_bg_xoffs, m_bg_yoffs; |
| 10 | | int m_bg_flip_yoffs; |
| 11 | | |
| 12 | | int m_has_fg0; /* for debug */ |
| 13 | | }; |
| 14 | | |
| 15 | | class tc0080vco_device : public device_t, |
| 16 | | public tc0080vco_interface |
| 17 | | { |
| 18 | 6 | public: |
| 19 | 7 | tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 20 | 8 | ~tc0080vco_device() {} |
| r29459 | r29460 | |
| 22 | 10 | // static configuration |
| 23 | 11 | static void static_set_gfxdecode_tag(device_t &device, const char *tag); |
| 24 | 12 | static void static_set_palette_tag(device_t &device, const char *tag); |
| 25 | | |
| 13 | static void set_gfx_region(device_t &device, int gfxnum) { downcast<tc0080vco_device &>(device).m_gfxnum = gfxnum; } |
| 14 | static void set_tx_region(device_t &device, int txnum) { downcast<tc0080vco_device &>(device).m_txnum = txnum; } |
| 15 | static void set_offsets(device_t &device, int x_offset, int y_offset) |
| 16 | { |
| 17 | tc0080vco_device &dev = downcast<tc0080vco_device &>(device); |
| 18 | dev.m_bg_xoffs = x_offset; |
| 19 | dev.m_bg_yoffs = y_offset; |
| 20 | } |
| 21 | static void set_bgflip_yoffs(device_t &device, int offs) { downcast<tc0080vco_device &>(device).m_bg_flip_yoffs = offs; } |
| 22 | |
| 26 | 23 | DECLARE_READ16_MEMBER( word_r ); |
| 27 | 24 | DECLARE_WRITE16_MEMBER( word_w ); |
| 28 | 25 | |
| 29 | 26 | void tilemap_update(); |
| 30 | 27 | void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority); |
| 28 | void set_fg0_debug(bool debug) { m_has_fg0 = debug ? 0 : 1; } |
| 31 | 29 | |
| 32 | 30 | DECLARE_READ16_MEMBER( cram_0_r ); |
| 33 | 31 | DECLARE_READ16_MEMBER( cram_1_r ); |
| r29459 | r29460 | |
| 37 | 35 | READ_LINE_MEMBER( flipscreen_r ); |
| 38 | 36 | void postload(); |
| 39 | 37 | |
| 40 | | protected: |
| 38 | protected: |
| 41 | 39 | // device-level overrides |
| 42 | | virtual void device_config_complete(); |
| 43 | 40 | virtual void device_start(); |
| 44 | 41 | |
| 45 | | private: |
| 42 | private: |
| 46 | 43 | // internal state |
| 47 | 44 | UINT16 * m_ram; |
| 48 | 45 | UINT16 * m_bg0_ram_0; |
| r29459 | r29460 | |
| 54 | 51 | UINT16 * m_char_ram; |
| 55 | 52 | UINT16 * m_bgscroll_ram; |
| 56 | 53 | |
| 57 | | /* FIXME: This sprite related stuff still needs to be accessed in |
| 58 | | video/taito_h */ |
| 54 | /* FIXME: This sprite related stuff still needs to be accessed in video/taito_h */ |
| 59 | 55 | UINT16 * m_chain_ram_0; |
| 60 | 56 | UINT16 * m_chain_ram_1; |
| 61 | 57 | UINT16 * m_spriteram; |
| r29459 | r29460 | |
| 66 | 62 | UINT16 m_bg1_scrollx; |
| 67 | 63 | UINT16 m_bg1_scrolly; |
| 68 | 64 | |
| 69 | | tilemap_t *m_tilemap[3]; |
| 65 | tilemap_t *m_tilemap[3]; |
| 70 | 66 | |
| 71 | 67 | INT32 m_flipscreen; |
| 68 | |
| 69 | int m_gfxnum; |
| 70 | int m_txnum; |
| 71 | int m_bg_xoffs, m_bg_yoffs; |
| 72 | int m_bg_flip_yoffs; |
| 73 | int m_has_fg0; // for debug, it can be enabled with set_fg0_debug(true) |
| 74 | |
| 72 | 75 | required_device<gfxdecode_device> m_gfxdecode; |
| 73 | 76 | required_device<palette_device> m_palette; |
| 74 | 77 | |
| r29459 | r29460 | |
| 81 | 84 | |
| 82 | 85 | extern const device_type TC0080VCO; |
| 83 | 86 | |
| 84 | | #define MCFG_TC0080VCO_ADD(_tag, _interface) \ |
| 85 | | MCFG_DEVICE_ADD(_tag, TC0080VCO, 0) \ |
| 86 | | MCFG_DEVICE_CONFIG(_interface) |
| 87 | #define MCFG_TC0080VCO_GFX_REGION(_region) \ |
| 88 | tc0080vco_device::set_gfx_region(*device, _region); |
| 87 | 89 | |
| 90 | #define MCFG_TC0080VCO_TX_REGION(_region) \ |
| 91 | tc0080vco_device::set_tx_region(*device, _region); |
| 92 | |
| 93 | #define MCFG_TC0080VCO_OFFSETS(_xoffs, _yoffs) \ |
| 94 | tc0080vco_device::set_offsets(*device, _xoffs, _yoffs); |
| 95 | |
| 96 | #define MCFG_TC0080VCO_BGFLIP_OFFS(_offs) \ |
| 97 | tc0080vco_device::set_bgflip_yoffs(*device, _offs); |
| 98 | |
| 88 | 99 | #define MCFG_TC0080VCO_GFXDECODE(_gfxtag) \ |
| 89 | 100 | tc0080vco_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); |
| 90 | 101 | |