trunk/src/mame/drivers/cobra.c
| r29418 | r29419 | |
| 1022 | 1022 | |
| 1023 | 1023 | |
| 1024 | 1024 | |
| 1025 | | |
| 1026 | | |
| 1027 | | |
| 1028 | | |
| 1029 | | |
| 1030 | 1025 | /*****************************************************************************/ |
| 1031 | 1026 | |
| 1032 | 1027 | int cobra_state::decode_debug_state_value(int v) |
| r29418 | r29419 | |
| 3130 | 3125 | }; |
| 3131 | 3126 | |
| 3132 | 3127 | |
| 3133 | | static const k001604_interface cobra_k001604_intf = |
| 3134 | | { |
| 3135 | | 0, 1, /* gfx index 1 & 2 */ |
| 3136 | | 0, 1, /* layer_size, roz_size */ |
| 3137 | | 0 /* slrasslt hack */ |
| 3138 | | }; |
| 3139 | | |
| 3140 | | |
| 3141 | 3128 | WRITE_LINE_MEMBER(cobra_state::ide_interrupt) |
| 3142 | 3129 | { |
| 3143 | 3130 | if (state == CLEAR_LINE) |
| r29418 | r29419 | |
| 3231 | 3218 | MCFG_M48T58_ADD("m48t58") |
| 3232 | 3219 | |
| 3233 | 3220 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) |
| 3234 | | MCFG_K001604_ADD("k001604", cobra_k001604_intf) // on the LAN board in Racing Jam DX |
| 3221 | MCFG_DEVICE_ADD("k001604", K001604, 0) // on the LAN board in Racing Jam DX |
| 3222 | MCFG_K001604_GFX_INDEX1(0) |
| 3223 | MCFG_K001604_GFX_INDEX2(1) |
| 3224 | MCFG_K001604_LAYER_SIZE(0) |
| 3225 | MCFG_K001604_ROZ_SIZE(1) |
| 3226 | MCFG_K001604_TXT_OFFSET(0) // correct? |
| 3227 | MCFG_K001604_ROZ_OFFSET(0) // correct? |
| 3235 | 3228 | MCFG_K001604_GFXDECODE("gfxdecode") |
| 3236 | 3229 | MCFG_K001604_PALETTE("palette") |
| 3237 | 3230 | |
trunk/src/mame/drivers/gticlub.c
| r29418 | r29419 | |
| 792 | 792 | 1 |
| 793 | 793 | }; |
| 794 | 794 | |
| 795 | | static const k001604_interface gticlub_k001604_intf = |
| 796 | | { |
| 797 | | 1, 2, /* gfx index 1 & 2 */ |
| 798 | | 1, 1, /* layer_size, roz_size */ |
| 799 | | 0, /* text layer mem offset */ |
| 800 | | 0, /* roz layer mem offset */ |
| 801 | | }; |
| 802 | 795 | |
| 803 | | static const k001604_interface slrasslt_k001604_intf = |
| 804 | | { |
| 805 | | 1, 2, /* gfx index 1 & 2 */ |
| 806 | | 0, 0, /* layer_size, roz_size */ |
| 807 | | 16384, /* text layer mem offset */ |
| 808 | | 0, /* roz layer mem offset */ |
| 809 | | }; |
| 810 | | |
| 811 | | static const k001604_interface hangplt_k001604_intf_l = |
| 812 | | { |
| 813 | | 1, 2, /* gfx index 1 & 2 */ |
| 814 | | 0, 1, /* layer_size, roz_size */ |
| 815 | | 0, /* text layer mem offset */ |
| 816 | | 16384, /* roz layer mem offset */ |
| 817 | | }; |
| 818 | | |
| 819 | | static const k001604_interface hangplt_k001604_intf_r = |
| 820 | | { |
| 821 | | 3, 4, /* gfx index 1 & 2 */ |
| 822 | | 0, 1, /* layer_size, roz_size */ |
| 823 | | 0, /* text layer mem offset */ |
| 824 | | 16384, /* roz layer mem offset */ |
| 825 | | }; |
| 826 | | |
| 827 | | |
| 828 | 796 | MACHINE_RESET_MEMBER(gticlub_state,gticlub) |
| 829 | 797 | { |
| 830 | 798 | m_dsp->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
| r29418 | r29419 | |
| 986 | 954 | MCFG_VIDEO_START_OVERRIDE(gticlub_state,gticlub) |
| 987 | 955 | |
| 988 | 956 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) |
| 989 | | MCFG_K001604_ADD("k001604_1", gticlub_k001604_intf) |
| 957 | MCFG_DEVICE_ADD("k001604_1", K001604, 0) |
| 958 | MCFG_K001604_GFX_INDEX1(1) |
| 959 | MCFG_K001604_GFX_INDEX2(2) |
| 960 | MCFG_K001604_LAYER_SIZE(1) |
| 961 | MCFG_K001604_ROZ_SIZE(1) |
| 962 | MCFG_K001604_TXT_OFFSET(0) |
| 963 | MCFG_K001604_ROZ_OFFSET(0) |
| 990 | 964 | MCFG_K001604_GFXDECODE("gfxdecode") |
| 991 | 965 | MCFG_K001604_PALETTE("palette") |
| 992 | 966 | |
| r29418 | r29419 | |
| 1015 | 989 | MCFG_ADC1038_ADD("adc1038", thunderh_adc1038_intf) |
| 1016 | 990 | |
| 1017 | 991 | MCFG_DEVICE_REMOVE("k001604_1") |
| 1018 | | MCFG_K001604_ADD("k001604_1", slrasslt_k001604_intf) |
| 992 | MCFG_DEVICE_ADD("k001604_1", K001604, 0) |
| 993 | MCFG_K001604_GFX_INDEX1(1) |
| 994 | MCFG_K001604_GFX_INDEX2(2) |
| 995 | MCFG_K001604_LAYER_SIZE(0) |
| 996 | MCFG_K001604_ROZ_SIZE(0) |
| 997 | MCFG_K001604_TXT_OFFSET(16384) |
| 998 | MCFG_K001604_ROZ_OFFSET(0) |
| 1019 | 999 | MCFG_K001604_GFXDECODE("gfxdecode") |
| 1020 | 1000 | MCFG_K001604_PALETTE("palette") |
| 1021 | 1001 | MACHINE_CONFIG_END |
| r29418 | r29419 | |
| 1109 | 1089 | |
| 1110 | 1090 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) |
| 1111 | 1091 | |
| 1112 | | MCFG_K001604_ADD("k001604_1", hangplt_k001604_intf_l) |
| 1092 | MCFG_DEVICE_ADD("k001604_1", K001604, 0) |
| 1093 | MCFG_K001604_GFX_INDEX1(1) |
| 1094 | MCFG_K001604_GFX_INDEX2(2) |
| 1095 | MCFG_K001604_LAYER_SIZE(0) |
| 1096 | MCFG_K001604_ROZ_SIZE(1) |
| 1097 | MCFG_K001604_TXT_OFFSET(0) |
| 1098 | MCFG_K001604_ROZ_OFFSET(16384) |
| 1113 | 1099 | MCFG_K001604_GFXDECODE("gfxdecode") |
| 1114 | 1100 | MCFG_K001604_PALETTE("palette") |
| 1115 | 1101 | |
| 1116 | | MCFG_K001604_ADD("k001604_2", hangplt_k001604_intf_r) |
| 1102 | MCFG_DEVICE_ADD("k001604_2", K001604, 0) |
| 1103 | MCFG_K001604_GFX_INDEX1(3) |
| 1104 | MCFG_K001604_GFX_INDEX2(4) |
| 1105 | MCFG_K001604_LAYER_SIZE(0) |
| 1106 | MCFG_K001604_ROZ_SIZE(1) |
| 1107 | MCFG_K001604_TXT_OFFSET(0) |
| 1108 | MCFG_K001604_ROZ_OFFSET(16384) |
| 1117 | 1109 | MCFG_K001604_GFXDECODE("gfxdecode") |
| 1118 | 1110 | MCFG_K001604_PALETTE("palette") |
| 1119 | 1111 | |
trunk/src/mame/drivers/zr107.c
| r29418 | r29419 | |
| 800 | 800 | MACHINE_CONFIG_END |
| 801 | 801 | |
| 802 | 802 | |
| 803 | | static const k001604_interface jetwave_k001604_intf = |
| 804 | | { |
| 805 | | 0, 1, /* gfx index 1 & 2 */ |
| 806 | | 0, 0, /* layer_size, roz_size */ |
| 807 | | 0, /* text layer mem offset */ |
| 808 | | 16384, /* roz layer mem offset */ |
| 809 | | }; |
| 810 | | |
| 811 | 803 | static MACHINE_CONFIG_START( jetwave, zr107_state ) |
| 812 | 804 | |
| 813 | 805 | /* basic machine hardware */ |
| r29418 | r29419 | |
| 841 | 833 | |
| 842 | 834 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) |
| 843 | 835 | |
| 844 | | MCFG_K001604_ADD("k001604", jetwave_k001604_intf) |
| 836 | MCFG_DEVICE_ADD("k001604", K001604, 0) |
| 837 | MCFG_K001604_GFX_INDEX1(0) |
| 838 | MCFG_K001604_GFX_INDEX2(1) |
| 839 | MCFG_K001604_LAYER_SIZE(0) |
| 840 | MCFG_K001604_ROZ_SIZE(0) |
| 841 | MCFG_K001604_TXT_OFFSET(0) |
| 842 | MCFG_K001604_ROZ_OFFSET(16384) |
| 845 | 843 | MCFG_K001604_GFXDECODE("gfxdecode") |
| 846 | 844 | MCFG_K001604_PALETTE("palette") |
| 847 | 845 | |
trunk/src/mame/drivers/nwk-tr.c
| r29418 | r29419 | |
| 714 | 714 | "voodoo" |
| 715 | 715 | }; |
| 716 | 716 | |
| 717 | | static const k001604_interface racingj_k001604_intf = |
| 718 | | { |
| 719 | | 0, 1, /* gfx index 1 & 2 */ |
| 720 | | 0, 1, /* layer_size, roz_size */ |
| 721 | | 0 /* slrasslt hack */ |
| 722 | | }; |
| 723 | | |
| 724 | | static const k001604_interface thrilld_k001604_intf = |
| 725 | | { |
| 726 | | 0, 1, /* gfx index 1 & 2 */ |
| 727 | | 1, 1, /* layer_size, roz_size */ |
| 728 | | 0 /* slrasslt hack */ |
| 729 | | }; |
| 730 | | |
| 731 | 717 | void nwktr_state::machine_reset() |
| 732 | 718 | { |
| 733 | 719 | m_dsp->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
| r29418 | r29419 | |
| 776 | 762 | |
| 777 | 763 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) |
| 778 | 764 | |
| 779 | | MCFG_K001604_ADD("k001604", racingj_k001604_intf) |
| 765 | MCFG_DEVICE_ADD("k001604", K001604, 0) |
| 766 | MCFG_K001604_GFX_INDEX1(0) |
| 767 | MCFG_K001604_GFX_INDEX2(1) |
| 768 | MCFG_K001604_LAYER_SIZE(0) |
| 769 | MCFG_K001604_ROZ_SIZE(1) |
| 770 | MCFG_K001604_TXT_OFFSET(0) // correct? |
| 771 | MCFG_K001604_ROZ_OFFSET(0) // correct? |
| 780 | 772 | MCFG_K001604_GFXDECODE("gfxdecode") |
| 781 | 773 | MCFG_K001604_PALETTE("palette") |
| 782 | 774 | |
| r29418 | r29419 | |
| 793 | 785 | static MACHINE_CONFIG_DERIVED( thrilld, nwktr ) |
| 794 | 786 | |
| 795 | 787 | MCFG_DEVICE_REMOVE("k001604") |
| 796 | | MCFG_K001604_ADD("k001604", thrilld_k001604_intf) |
| 788 | MCFG_DEVICE_ADD("k001604", K001604, 0) |
| 789 | MCFG_K001604_GFX_INDEX1(0) |
| 790 | MCFG_K001604_GFX_INDEX2(1) |
| 791 | MCFG_K001604_LAYER_SIZE(1) |
| 792 | MCFG_K001604_ROZ_SIZE(1) |
| 793 | MCFG_K001604_TXT_OFFSET(0) // correct? |
| 794 | MCFG_K001604_ROZ_OFFSET(0) // correct? |
| 797 | 795 | MCFG_K001604_GFXDECODE("gfxdecode") |
| 798 | 796 | MCFG_K001604_PALETTE("palette") |
| 799 | 797 | MACHINE_CONFIG_END |
trunk/src/mame/video/k001604.c
| r29418 | r29419 | |
| 17 | 17 | |
| 18 | 18 | k001604_device::k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 19 | 19 | : device_t(mconfig, K001604, "Konami 001604", tag, owner, clock, "k001604", __FILE__), |
| 20 | m_gfx_index_1(0), |
| 21 | m_gfx_index_2(0), |
| 22 | m_layer_size(0), |
| 23 | m_roz_size(0), |
| 24 | m_txt_mem_offset(0), |
| 25 | m_roz_mem_offset(0), |
| 20 | 26 | m_tile_ram(NULL), |
| 21 | 27 | m_char_ram(NULL), |
| 22 | 28 | m_reg(NULL), |
| r29418 | r29419 | |
| 38 | 44 | } |
| 39 | 45 | |
| 40 | 46 | //------------------------------------------------- |
| 41 | | // device_config_complete - perform any |
| 42 | | // operations now that the configuration is |
| 43 | | // complete |
| 44 | | //------------------------------------------------- |
| 45 | | |
| 46 | | void k001604_device::device_config_complete() |
| 47 | | { |
| 48 | | // inherit a copy of the static data |
| 49 | | const k001604_interface *intf = reinterpret_cast<const k001604_interface *>(static_config()); |
| 50 | | if (intf != NULL) |
| 51 | | *static_cast<k001604_interface *>(this) = *intf; |
| 52 | | |
| 53 | | // or initialize to defaults if none provided |
| 54 | | else |
| 55 | | { |
| 56 | | m_gfx_index_1 = 0; |
| 57 | | m_gfx_index_2 = 0; |
| 58 | | m_layer_size = 0; |
| 59 | | m_roz_size = 0; |
| 60 | | m_txt_mem_offset = 0; |
| 61 | | m_roz_mem_offset = 0; |
| 62 | | } |
| 63 | | } |
| 64 | | |
| 65 | | //------------------------------------------------- |
| 66 | 47 | // device_start - device-specific startup |
| 67 | 48 | //------------------------------------------------- |
| 68 | 49 | |
trunk/src/mame/video/k001604.h
| r29418 | r29419 | |
| 3 | 3 | #define __K001604_H__ |
| 4 | 4 | |
| 5 | 5 | |
| 6 | | struct k001604_interface |
| 6 | class k001604_device : public device_t |
| 7 | 7 | { |
| 8 | | int m_gfx_index_1; |
| 9 | | int m_gfx_index_2; |
| 10 | | int m_layer_size; // 0 -> width = 128 tiles, 1 -> width = 256 tiles |
| 11 | | int m_roz_size; // 0 -> 8x8, 1 -> 16x16 |
| 12 | | int m_txt_mem_offset; |
| 13 | | int m_roz_mem_offset; |
| 14 | | }; |
| 15 | | |
| 16 | | |
| 17 | | class k001604_device : public device_t, |
| 18 | | public k001604_interface |
| 19 | | { |
| 20 | 8 | public: |
| 21 | 9 | k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 22 | 10 | ~k001604_device() {} |
| r29418 | r29419 | |
| 24 | 12 | // static configuration |
| 25 | 13 | static void static_set_gfxdecode_tag(device_t &device, const char *tag); |
| 26 | 14 | static void static_set_palette_tag(device_t &device, const char *tag); |
| 27 | | |
| 15 | static void set_gfx_index_1(device_t &device, int idx) { downcast<k001604_device &>(device).m_gfx_index_1 = idx; } |
| 16 | static void set_gfx_index_2(device_t &device, int idx) { downcast<k001604_device &>(device).m_gfx_index_2 = idx; } |
| 17 | static void set_layer_size(device_t &device, int size) { downcast<k001604_device &>(device).m_layer_size = size; } |
| 18 | static void set_roz_size(device_t &device, int size) { downcast<k001604_device &>(device).m_roz_size = size; } |
| 19 | static void set_txt_mem_offset(device_t &device, int offs) { downcast<k001604_device &>(device).m_txt_mem_offset = offs; } |
| 20 | static void set_roz_mem_offset(device_t &device, int offs) { downcast<k001604_device &>(device).m_roz_mem_offset = offs; } |
| 21 | |
| 28 | 22 | void draw_back_layer( bitmap_rgb32 &bitmap, const rectangle &cliprect ); |
| 29 | 23 | void draw_front_layer( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ); |
| 30 | 24 | DECLARE_WRITE32_MEMBER( tile_w ); |
| r29418 | r29419 | |
| 36 | 30 | |
| 37 | 31 | protected: |
| 38 | 32 | // device-level overrides |
| 39 | | virtual void device_config_complete(); |
| 40 | 33 | virtual void device_start(); |
| 41 | 34 | virtual void device_reset(); |
| 42 | 35 | private: |
| 43 | 36 | // internal state |
| 44 | | tilemap_t *m_layer_8x8[2]; |
| 45 | | tilemap_t *m_layer_roz; |
| 37 | int m_gfx_index_1; |
| 38 | int m_gfx_index_2; |
| 39 | int m_layer_size; // 0 -> width = 128 tiles, 1 -> width = 256 tiles |
| 40 | int m_roz_size; // 0 -> 8x8, 1 -> 16x16 |
| 41 | int m_txt_mem_offset; |
| 42 | int m_roz_mem_offset; |
| 43 | |
| 44 | tilemap_t *m_layer_8x8[2]; |
| 45 | tilemap_t *m_layer_roz; |
| 46 | 46 | int m_gfx_index[2]; |
| 47 | 47 | |
| 48 | 48 | UINT32 * m_tile_ram; |
| r29418 | r29419 | |
| 64 | 64 | extern const device_type K001604; |
| 65 | 65 | |
| 66 | 66 | |
| 67 | | #define MCFG_K001604_ADD(_tag, _interface) \ |
| 68 | | MCFG_DEVICE_ADD(_tag, K001604, 0) \ |
| 69 | | MCFG_DEVICE_CONFIG(_interface) |
| 67 | #define MCFG_K001604_GFX_INDEX1(_idx) \ |
| 68 | k001604_device::set_gfx_index_1(*device, _idx); |
| 70 | 69 | |
| 71 | | #define MCFG_K001604_MODIFY(_tag, _interface) \ |
| 72 | | MCFG_DEVICE_MODIFY(_tag) \ |
| 73 | | MCFG_DEVICE_CONFIG(_interface) |
| 70 | #define MCFG_K001604_GFX_INDEX2(_idx) \ |
| 71 | k001604_device::set_gfx_index_2(*device, _idx); |
| 74 | 72 | |
| 73 | #define MCFG_K001604_LAYER_SIZE(_size) \ |
| 74 | k001604_device::set_layer_size(*device, _size); |
| 75 | |
| 76 | #define MCFG_K001604_ROZ_SIZE(_size) \ |
| 77 | k001604_device::set_roz_size(*device, _size); |
| 78 | |
| 79 | #define MCFG_K001604_TXT_OFFSET(_offs) \ |
| 80 | k001604_device::set_txt_mem_offset(*device, _offs); |
| 81 | |
| 82 | #define MCFG_K001604_ROZ_OFFSET(_offs) \ |
| 83 | k001604_device::set_roz_mem_offset(*device, _offs); |
| 84 | |
| 75 | 85 | #define MCFG_K001604_GFXDECODE(_gfxtag) \ |
| 76 | 86 | k001604_device::static_set_gfxdecode_tag(*device, "^" _gfxtag); |
| 77 | 87 | |