trunk/src/mame/drivers/moo.c
| r29478 | r29479 | |
| 541 | 541 | moo_sprite_callback |
| 542 | 542 | }; |
| 543 | 543 | |
| 544 | | static const k054338_interface moo_k054338_intf = |
| 545 | | { |
| 546 | | 0, |
| 547 | | "none" |
| 548 | | }; |
| 549 | | |
| 550 | 544 | static k054539_interface k054539_config; |
| 551 | 545 | |
| 552 | 546 | static MACHINE_CONFIG_START( moo, moo_state ) |
| r29478 | r29479 | |
| 590 | 584 | MCFG_K056832_ADD("k056832", moo_k056832_intf) |
| 591 | 585 | MCFG_K056832_GFXDECODE("gfxdecode") |
| 592 | 586 | MCFG_K056832_PALETTE("palette") |
| 587 | |
| 593 | 588 | MCFG_K053251_ADD("k053251") |
| 594 | | MCFG_K054338_ADD("k054338", moo_k054338_intf) |
| 595 | 589 | |
| 590 | MCFG_DEVICE_ADD("k054338", K054338, 0) |
| 591 | |
| 596 | 592 | /* sound hardware */ |
| 597 | 593 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 598 | 594 | |
| r29478 | r29479 | |
| 640 | 636 | MCFG_K056832_ADD("k056832", moo_k056832_intf) |
| 641 | 637 | MCFG_K056832_GFXDECODE("gfxdecode") |
| 642 | 638 | MCFG_K056832_PALETTE("palette") |
| 639 | |
| 643 | 640 | MCFG_K053251_ADD("k053251") |
| 644 | | MCFG_K054338_ADD("k054338", moo_k054338_intf) |
| 645 | 641 | |
| 642 | MCFG_DEVICE_ADD("k054338", K054338, 0) |
| 643 | |
| 646 | 644 | /* sound hardware */ |
| 647 | 645 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 648 | 646 | |
trunk/src/mame/drivers/bishi.c
| r29478 | r29479 | |
| 372 | 372 | bishi_tile_callback, "none" |
| 373 | 373 | }; |
| 374 | 374 | |
| 375 | | static const k054338_interface bishi_k054338_intf = |
| 376 | | { |
| 377 | | 0, |
| 378 | | "none" |
| 379 | | }; |
| 380 | | |
| 381 | 375 | void bishi_state::machine_start() |
| 382 | 376 | { |
| 383 | 377 | save_item(NAME(m_cur_control)); |
| r29478 | r29479 | |
| 416 | 410 | MCFG_K056832_ADD("k056832", bishi_k056832_intf) |
| 417 | 411 | MCFG_K056832_GFXDECODE("gfxdecode") |
| 418 | 412 | MCFG_K056832_PALETTE("palette") |
| 419 | | MCFG_K054338_ADD("k054338", bishi_k054338_intf) |
| 413 | |
| 414 | MCFG_DEVICE_ADD("k054338", K054338, 0) |
| 415 | // FP 201404: any reason why this is not connected to the k055555 below? |
| 416 | |
| 420 | 417 | MCFG_K055555_ADD("k055555") |
| 421 | 418 | |
| 422 | 419 | /* sound hardware */ |
trunk/src/mame/drivers/xexex.c
| r29478 | r29479 | |
| 460 | 460 | ym_set_mixing |
| 461 | 461 | }; |
| 462 | 462 | |
| 463 | | static const k054338_interface xexex_k054338_intf = |
| 464 | | { |
| 465 | | 0, |
| 466 | | "none" |
| 467 | | }; |
| 468 | | |
| 469 | 463 | static const k056832_interface xexex_k056832_intf = |
| 470 | 464 | { |
| 471 | 465 | "gfx1", 0, |
| r29478 | r29479 | |
| 570 | 564 | MCFG_K053246_PALETTE("palette") |
| 571 | 565 | MCFG_K053250_ADD("k053250", "palette", "screen", -5, -16) |
| 572 | 566 | MCFG_K053251_ADD("k053251") |
| 567 | |
| 573 | 568 | MCFG_DEVICE_ADD("k053252", K053252, XTAL_32MHz/4) |
| 574 | | MCFG_K054338_ADD("k054338", xexex_k054338_intf) |
| 575 | 569 | |
| 570 | MCFG_DEVICE_ADD("k054338", K054338, 0) |
| 571 | |
| 576 | 572 | /* sound hardware */ |
| 577 | 573 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 578 | 574 | |
trunk/src/mame/video/k054338.c
| r29478 | r29479 | |
| 1 | 1 | |
| 2 | 2 | #include "emu.h" |
| 3 | 3 | #include "k054338.h" |
| 4 | | #include "k055555.h" |
| 5 | 4 | |
| 6 | 5 | |
| 7 | 6 | #define VERBOSE 0 |
| r29478 | r29479 | |
| 237 | 236 | |
| 238 | 237 | k054338_device::k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 239 | 238 | : device_t(mconfig, K054338, "Konami 054338", tag, owner, clock, "k054338", __FILE__), |
| 240 | | device_video_interface(mconfig, *this) |
| 239 | device_video_interface(mconfig, *this), |
| 240 | m_alpha_inv(0), |
| 241 | m_k055555_tag("") |
| 241 | 242 | //m_regs[32], |
| 242 | 243 | //m_shd_rgb[9], |
| 243 | 244 | { |
| 244 | 245 | } |
| 245 | 246 | |
| 246 | 247 | //------------------------------------------------- |
| 247 | | // device_config_complete - perform any |
| 248 | | // operations now that the configuration is |
| 249 | | // complete |
| 250 | | //------------------------------------------------- |
| 251 | | |
| 252 | | void k054338_device::device_config_complete() |
| 253 | | { |
| 254 | | // inherit a copy of the static data |
| 255 | | const k054338_interface *intf = reinterpret_cast<const k054338_interface *>(static_config()); |
| 256 | | if (intf != NULL) |
| 257 | | *static_cast<k054338_interface *>(this) = *intf; |
| 258 | | |
| 259 | | // or initialize to defaults if none provided |
| 260 | | else |
| 261 | | { |
| 262 | | m_alpha_inv = 0; |
| 263 | | m_k055555_tag = ""; |
| 264 | | }; |
| 265 | | } |
| 266 | | |
| 267 | | //------------------------------------------------- |
| 268 | 248 | // device_start - device-specific startup |
| 269 | 249 | //------------------------------------------------- |
| 270 | 250 | |
trunk/src/mame/video/k054338.h
| r29478 | r29479 | |
| 1 | | |
| 2 | 1 | #pragma once |
| 3 | 2 | #ifndef __K054338_H__ |
| 4 | 3 | #define __K054338_H__ |
| 5 | 4 | |
| 6 | 5 | #include "k055555.h" |
| 7 | 6 | |
| 8 | | #define MCFG_K054338_ADD(_tag, _interface) \ |
| 9 | | MCFG_DEVICE_ADD(_tag, K054338, 0) \ |
| 10 | | MCFG_DEVICE_CONFIG(_interface) |
| 11 | 7 | |
| 12 | | |
| 13 | | |
| 14 | 8 | /* K054338 mixer/alpha blender */ |
| 15 | 9 | void K054338_vh_start(running_machine &machine, k055555_device* k055555); |
| 16 | 10 | DECLARE_WRITE16_HANDLER( K054338_word_w ); // "CLCT" registers |
| r29478 | r29479 | |
| 38 | 32 | #define K338_CTL_CLIPSL 0x20 |
| 39 | 33 | |
| 40 | 34 | |
| 41 | | struct k054338_interface |
| 42 | | { |
| 43 | | int m_alpha_inv; |
| 44 | | const char *m_k055555_tag; |
| 45 | | }; |
| 46 | | |
| 47 | | |
| 48 | 35 | class k054338_device : public device_t, |
| 49 | | public device_video_interface, |
| 50 | | public k054338_interface |
| 36 | public device_video_interface |
| 51 | 37 | { |
| 52 | 38 | public: |
| 53 | 39 | k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 54 | 40 | ~k054338_device() {} |
| 55 | 41 | |
| 42 | // static configuration |
| 43 | static void set_mixer_tag(device_t &device, const char *tag) { downcast<k054338_device &>(device).m_k055555_tag = tag; } |
| 44 | static void set_yinvert(device_t &device, int alpha_inv) { downcast<k054338_device &>(device).m_alpha_inv = alpha_inv; } |
| 45 | |
| 56 | 46 | DECLARE_WRITE16_MEMBER( word_w ); // "CLCT" registers |
| 57 | 47 | DECLARE_WRITE32_MEMBER( long_w ); |
| 58 | 48 | |
| r29478 | r29479 | |
| 68 | 58 | |
| 69 | 59 | protected: |
| 70 | 60 | // device-level overrides |
| 71 | | virtual void device_config_complete(); |
| 72 | 61 | virtual void device_start(); |
| 73 | 62 | virtual void device_reset(); |
| 74 | 63 | |
| 75 | 64 | private: |
| 76 | 65 | // internal state |
| 77 | | UINT16 m_regs[32]; |
| 78 | | int m_shd_rgb[9]; |
| 66 | UINT16 m_regs[32]; |
| 67 | int m_shd_rgb[9]; |
| 68 | int m_alpha_inv; |
| 69 | const char *m_k055555_tag; |
| 79 | 70 | |
| 80 | 71 | k055555_device *m_k055555; /* used to fill BG color */ |
| 81 | 72 | }; |
| 82 | 73 | |
| 83 | 74 | extern const device_type K054338; |
| 84 | 75 | |
| 76 | |
| 77 | #define MCFG_K054338_MIXER(_tag) \ |
| 78 | k054338_device::set_mixer_tag(*device, _tag); |
| 79 | |
| 80 | #define MCFG_K054338_ALPHAINV(_alphainv) \ |
| 81 | k054338_device::set_alpha_invert(*device, _alphainv); |
| 82 | |
| 83 | |
| 85 | 84 | #endif |