Previous 199869 Revisions Next

r29419 Monday 7th April, 2014 at 12:19:01 UTC by Fabio Priuli
k001604: converted to use devcb2. nw.
[src/mame/drivers]cobra.c gticlub.c nwk-tr.c zr107.c
[src/mame/video]k001604.c k001604.h

trunk/src/mame/drivers/cobra.c
r29418r29419
10221022
10231023
10241024
1025
1026
1027
1028
1029
10301025/*****************************************************************************/
10311026
10321027int cobra_state::decode_debug_state_value(int v)
r29418r29419
31303125};
31313126
31323127
3133static 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
31413128WRITE_LINE_MEMBER(cobra_state::ide_interrupt)
31423129{
31433130   if (state == CLEAR_LINE)
r29418r29419
32313218   MCFG_M48T58_ADD("m48t58")
32323219
32333220   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?
32353228   MCFG_K001604_GFXDECODE("gfxdecode")
32363229   MCFG_K001604_PALETTE("palette")
32373230
trunk/src/mame/drivers/gticlub.c
r29418r29419
792792   1
793793};
794794
795static 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};
802795
803static 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
811static 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
819static 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
828796MACHINE_RESET_MEMBER(gticlub_state,gticlub)
829797{
830798   m_dsp->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
r29418r29419
986954   MCFG_VIDEO_START_OVERRIDE(gticlub_state,gticlub)
987955
988956   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)
990964   MCFG_K001604_GFXDECODE("gfxdecode")
991965   MCFG_K001604_PALETTE("palette")
992966
r29418r29419
1015989   MCFG_ADC1038_ADD("adc1038", thunderh_adc1038_intf)
1016990
1017991   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)
1019999   MCFG_K001604_GFXDECODE("gfxdecode")
10201000   MCFG_K001604_PALETTE("palette")
10211001MACHINE_CONFIG_END
r29418r29419
11091089
11101090   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
11111091
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)
11131099   MCFG_K001604_GFXDECODE("gfxdecode")
11141100   MCFG_K001604_PALETTE("palette")
11151101
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)
11171109   MCFG_K001604_GFXDECODE("gfxdecode")
11181110   MCFG_K001604_PALETTE("palette")
11191111
trunk/src/mame/drivers/zr107.c
r29418r29419
800800MACHINE_CONFIG_END
801801
802802
803static 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
811803static MACHINE_CONFIG_START( jetwave, zr107_state )
812804
813805   /* basic machine hardware */
r29418r29419
841833
842834   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
843835
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)
845843   MCFG_K001604_GFXDECODE("gfxdecode")
846844   MCFG_K001604_PALETTE("palette")
847845
trunk/src/mame/drivers/nwk-tr.c
r29418r29419
714714   "voodoo"
715715};
716716
717static 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
724static 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
731717void nwktr_state::machine_reset()
732718{
733719   m_dsp->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
r29418r29419
776762
777763   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
778764
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?
780772   MCFG_K001604_GFXDECODE("gfxdecode")
781773   MCFG_K001604_PALETTE("palette")
782774
r29418r29419
793785static MACHINE_CONFIG_DERIVED( thrilld, nwktr )
794786
795787   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?
797795   MCFG_K001604_GFXDECODE("gfxdecode")
798796   MCFG_K001604_PALETTE("palette")
799797MACHINE_CONFIG_END
trunk/src/mame/video/k001604.c
r29418r29419
1717
1818k001604_device::k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1919   : 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),
2026   m_tile_ram(NULL),
2127   m_char_ram(NULL),
2228   m_reg(NULL),
r29418r29419
3844}
3945
4046//-------------------------------------------------
41//  device_config_complete - perform any
42//  operations now that the configuration is
43//  complete
44//-------------------------------------------------
45
46void 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//-------------------------------------------------
6647//  device_start - device-specific startup
6748//-------------------------------------------------
6849
trunk/src/mame/video/k001604.h
r29418r29419
33#define __K001604_H__
44
55
6struct k001604_interface
6class k001604_device : public device_t
77{
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
17class k001604_device : public device_t,
18                              public k001604_interface
19{
208public:
219   k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
2210   ~k001604_device() {}
r29418r29419
2412   // static configuration
2513   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
2614   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   
2822   void draw_back_layer( bitmap_rgb32 &bitmap, const rectangle &cliprect );
2923   void draw_front_layer( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect );
3024   DECLARE_WRITE32_MEMBER( tile_w );
r29418r29419
3630
3731protected:
3832   // device-level overrides
39   virtual void device_config_complete();
4033   virtual void device_start();
4134   virtual void device_reset();
4235private:
4336   // 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;
4646   int            m_gfx_index[2];
4747
4848   UINT32 *       m_tile_ram;
r29418r29419
6464extern const device_type K001604;
6565
6666
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);
7069
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);
7472
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
7585#define MCFG_K001604_GFXDECODE(_gfxtag) \
7686   k001604_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
7787

Previous 199869 Revisions Next


© 1997-2024 The MAME Team