Previous 199869 Revisions Next

r17692 Friday 7th September, 2012 at 09:14:36 UTC by Miodrag Milanović
tilemap_create_device users modernized (no whatsnew)
[src/emu]tilemap.h
[src/mame/video]decbac06.c decbac06.h deco16ic.c deco16ic.h gp9001.c gp9001.h kaneko_tmap.c kaneko_tmap.h konicdev.c konicdev.h segaic24.c segaic24.h taitoic.c taitoic.h

trunk/src/mame/video/decbac06.c
r17691r17692
8181{
8282}
8383
84
85
86
87static TILEMAP_MAPPER( tile_shape0_scan )
84TILEMAP_MAPPER_MEMBER(deco_bac06_device::tile_shape0_scan)
8885{
8986   return (col & 0xf) + ((row & 0xf) << 4) + ((col & 0x1f0) << 4);
9087}
9188
92static TILEMAP_MAPPER( tile_shape1_scan )
89TILEMAP_MAPPER_MEMBER(deco_bac06_device::tile_shape1_scan)
9390{
9491   return (col & 0xf) + ((row & 0x1f) << 4) + ((col & 0xf0) << 5);
9592}
9693
97static TILEMAP_MAPPER( tile_shape2_scan )
94TILEMAP_MAPPER_MEMBER(deco_bac06_device::tile_shape2_scan)
9895{
9996   return (col & 0xf) + ((row & 0x3f) << 4) + ((col & 0x70) << 6);
10097}
10198
102static TILEMAP_MAPPER( tile_shape0_8x8_scan )
99TILEMAP_MAPPER_MEMBER(deco_bac06_device::tile_shape0_8x8_scan)
103100{
104101   return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x60) << 5);
105102}
106103
107static TILEMAP_MAPPER( tile_shape1_8x8_scan )
104TILEMAP_MAPPER_MEMBER(deco_bac06_device::tile_shape1_8x8_scan)
108105{
109106   return (col & 0x1f) + ((row & 0x1f) << 5) + ((row & 0x20) << 5) + ((col & 0x20) << 6);
110107}
111108
112static TILEMAP_MAPPER( tile_shape2_8x8_scan )
109TILEMAP_MAPPER_MEMBER(deco_bac06_device::tile_shape2_8x8_scan)
113110{
114111   return (col & 0x1f) + ((row & 0x7f) << 5);
115112}
116113
117
118
119
120
121static TILE_GET_INFO_DEVICE( get_pf8x8_tile_info )
114TILE_GET_INFO_MEMBER(deco_bac06_device::get_pf8x8_tile_info)
122115{
123
124   deco_bac06_device *dev = (deco_bac06_device*)device;
125   if (dev->m_rambank&1) tile_index+=0x1000;
126   int tile=dev->pf_data[tile_index];
116   if (m_rambank&1) tile_index+=0x1000;
117   int tile=pf_data[tile_index];
127118   int colourpri=(tile>>12);
128   SET_TILE_INFO_DEVICE(dev->tile_region,tile&0xfff,0,0);
119   SET_TILE_INFO_MEMBER(tile_region,tile&0xfff,0,0);
129120   tileinfo.category = colourpri;
130121}
131122
132static TILE_GET_INFO_DEVICE( get_pf16x16_tile_info )
123TILE_GET_INFO_MEMBER(deco_bac06_device::get_pf16x16_tile_info)
133124{
134   deco_bac06_device *dev = (deco_bac06_device*)device;
135   if (dev->m_rambank&1) tile_index+=0x1000;
136   int tile=dev->pf_data[tile_index];
125   if (m_rambank&1) tile_index+=0x1000;
126   int tile=pf_data[tile_index];
137127   int colourpri=(tile>>12);
138   SET_TILE_INFO_DEVICE(dev->tile_region,tile&0xfff,0,0);
128   SET_TILE_INFO_MEMBER(tile_region,tile&0xfff,0,0);
139129   tileinfo.category = colourpri;
140130}
141131
142
143132void deco_bac06_device::create_tilemaps(int region8x8, int region16x16)
144133{
145134   tile_region = region8x8;
146135
147   pf8x8_tilemap[0] = tilemap_create_device(this, get_pf8x8_tile_info,tile_shape0_8x8_scan, 8, 8,128, 32);
148   pf8x8_tilemap[1] = tilemap_create_device(this, get_pf8x8_tile_info,tile_shape1_8x8_scan, 8, 8, 64, 64);
149   pf8x8_tilemap[2] = tilemap_create_device(this, get_pf8x8_tile_info,tile_shape2_8x8_scan, 8, 8, 32,128);
136   pf8x8_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf8x8_tile_info),this),tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape0_8x8_scan),this), 8, 8,128, 32);
137   pf8x8_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf8x8_tile_info),this),tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape1_8x8_scan),this), 8, 8, 64, 64);
138   pf8x8_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf8x8_tile_info),this),tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape2_8x8_scan),this), 8, 8, 32,128);
150139
151140   tile_region = region16x16;
152141
153142   if (m_wide==2)
154143   {
155      pf16x16_tilemap[0] = tilemap_create_device(this, get_pf16x16_tile_info, tile_shape0_scan, 16, 16, 256, 16);
156      pf16x16_tilemap[1] = tilemap_create_device(this, get_pf16x16_tile_info, tile_shape1_scan,  16, 16,  128, 32);
157      pf16x16_tilemap[2] = tilemap_create_device(this, get_pf16x16_tile_info, tile_shape2_scan,  16, 16,  64, 64);
144      pf16x16_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this), tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape0_scan),this), 16, 16, 256, 16);
145      pf16x16_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this), tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape1_scan),this),  16, 16,  128, 32);
146      pf16x16_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this), tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape2_scan),this),  16, 16,  64, 64);
158147   }
159148   else if (m_wide==1)
160149   {
161      pf16x16_tilemap[0] = tilemap_create_device(this, get_pf16x16_tile_info, tile_shape0_scan, 16, 16, 128, 16);
162      pf16x16_tilemap[1] = tilemap_create_device(this, get_pf16x16_tile_info, tile_shape1_scan,  16, 16,  64, 32);
163      pf16x16_tilemap[2] = tilemap_create_device(this, get_pf16x16_tile_info, tile_shape2_scan,  16, 16,  32, 64);
150      pf16x16_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this), tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape0_scan),this), 16, 16, 128, 16);
151      pf16x16_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this), tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape1_scan),this),  16, 16,  64, 32);
152      pf16x16_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this), tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape2_scan),this),  16, 16,  32, 64);
164153   }
165154   else
166155   {
167      pf16x16_tilemap[0] = tilemap_create_device(this, get_pf16x16_tile_info,tile_shape0_scan,    16,16, 64, 16);
168      pf16x16_tilemap[1] = tilemap_create_device(this, get_pf16x16_tile_info,tile_shape1_scan,    16,16, 32, 32);
169      pf16x16_tilemap[2] = tilemap_create_device(this, get_pf16x16_tile_info,tile_shape2_scan,    16,16, 16, 64);
156      pf16x16_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this),tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape0_scan),this),    16,16, 64, 16);
157      pf16x16_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this),tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape1_scan),this),    16,16, 32, 32);
158      pf16x16_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this),tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape2_scan),this),    16,16, 16, 64);
170159   }
171160}
172161
trunk/src/mame/video/decbac06.h
r17691r17692
5353                     UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition);
5454
5555private:
56
57
56   TILEMAP_MAPPER_MEMBER(tile_shape0_scan);
57   TILEMAP_MAPPER_MEMBER(tile_shape1_scan);
58   TILEMAP_MAPPER_MEMBER(tile_shape2_scan);
59   TILEMAP_MAPPER_MEMBER(tile_shape0_8x8_scan);
60   TILEMAP_MAPPER_MEMBER(tile_shape1_8x8_scan);
61   TILEMAP_MAPPER_MEMBER(tile_shape2_8x8_scan);
62   TILE_GET_INFO_MEMBER(get_pf8x8_tile_info);
63   TILE_GET_INFO_MEMBER(get_pf16x16_tile_info);
5864};
5965
6066/* 16-bit accessors */
trunk/src/mame/video/taitoic.c
r17691r17692
632632         TILE_FLIPYX((attr & 0xc000) >> 14));
633633}
634634
635static TILE_GET_INFO_DEVICE( pc080sn_get_bg_tile_info )
635TILE_GET_INFO_MEMBER(pc080sn_device::pc080sn_get_bg_tile_info)
636636{
637   pc080sn_state *pc080sn = pc080sn_get_safe_token(device);
638   common_get_pc080sn_bg_tile_info(device, tileinfo, tile_index, pc080sn->bg_ram[0], pc080sn->bg_gfx);
637   pc080sn_state *pc080sn = pc080sn_get_safe_token(this);
638   common_get_pc080sn_bg_tile_info(this, tileinfo, tile_index, pc080sn->bg_ram[0], pc080sn->bg_gfx);
639639}
640640
641static TILE_GET_INFO_DEVICE( pc080sn_get_fg_tile_info )
641TILE_GET_INFO_MEMBER(pc080sn_device::pc080sn_get_fg_tile_info)
642642{
643   pc080sn_state *pc080sn = pc080sn_get_safe_token(device);
644   common_get_pc080sn_fg_tile_info(device, tileinfo, tile_index, pc080sn->bg_ram[1], pc080sn->bg_gfx);
643   pc080sn_state *pc080sn = pc080sn_get_safe_token(this);
644   common_get_pc080sn_fg_tile_info(this, tileinfo, tile_index, pc080sn->bg_ram[1], pc080sn->bg_gfx);
645645}
646646
647647
r17691r17692
969969   pc080sn->tilemap[1]->set_flip(flip);
970970}
971971
972/*****************************************************************************
973    DEVICE INTERFACE
974*****************************************************************************/
972const device_type PC080SN = &device_creator<pc080sn_device>;
975973
976static DEVICE_START( pc080sn )
974pc080sn_device::pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
975   : device_t(mconfig, PC080SN, "Taito PC080SN", tag, owner, clock)
977976{
978   pc080sn_state *pc080sn = pc080sn_get_safe_token(device);
979   const pc080sn_interface *intf = pc080sn_get_interface(device);
977   m_token = global_alloc_array_clear(UINT8, sizeof(pc080sn_state));
978}
980979
980//-------------------------------------------------
981//  device_config_complete - perform any
982//  operations now that the configuration is
983//  complete
984//-------------------------------------------------
985
986void pc080sn_device::device_config_complete()
987{
988}
989
990//-------------------------------------------------
991//  device_start - device-specific startup
992//-------------------------------------------------
993
994void pc080sn_device::device_start()
995{
996   pc080sn_state *pc080sn = pc080sn_get_safe_token(this);
997   const pc080sn_interface *intf = pc080sn_get_interface(this);
998
981999   /* use the given gfx set for bg tiles */
9821000   pc080sn->bg_gfx = intf->gfxnum;
9831001
r17691r17692
9881006
9891007   if (!pc080sn->dblwidth)   /* standard tilemaps */
9901008   {
991      pc080sn->tilemap[0] = tilemap_create_device(device, pc080sn_get_bg_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
992      pc080sn->tilemap[1] = tilemap_create_device(device, pc080sn_get_fg_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
1009      pc080sn->tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pc080sn_device::pc080sn_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
1010      pc080sn->tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pc080sn_device::pc080sn_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
9931011   }
9941012   else   /* double width tilemaps */
9951013   {
996      pc080sn->tilemap[0] = tilemap_create_device(device, pc080sn_get_bg_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 128, 64);
997      pc080sn->tilemap[1] = tilemap_create_device(device, pc080sn_get_fg_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 128, 64);
1014      pc080sn->tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pc080sn_device::pc080sn_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64);
1015      pc080sn->tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(pc080sn_device::pc080sn_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64);
9981016   }
9991017
10001018   pc080sn->tilemap[0]->set_transparent_pen(0);
r17691r17692
10111029      pc080sn->tilemap[1]->set_scroll_rows(512);
10121030   }
10131031
1014   pc080sn->ram = auto_alloc_array_clear(device->machine(), UINT16, PC080SN_RAM_SIZE / 2);
1032   pc080sn->ram = auto_alloc_array_clear(machine(), UINT16, PC080SN_RAM_SIZE / 2);
10151033
10161034   pc080sn->bg_ram[0]       = pc080sn->ram + 0x0000 /2;
10171035   pc080sn->bg_ram[1]       = pc080sn->ram + 0x8000 /2;
10181036   pc080sn->bgscroll_ram[0] = pc080sn->ram + 0x4000 /2;
10191037   pc080sn->bgscroll_ram[1] = pc080sn->ram + 0xc000 /2;
10201038
1021   device->save_pointer(NAME(pc080sn->ram), PC080SN_RAM_SIZE / 2);
1022   device->save_item(NAME(pc080sn->ctrl));
1023   device->machine().save().register_postload(save_prepost_delegate(FUNC(pc080sn_restore_scroll), pc080sn));
1039   save_pointer(NAME(pc080sn->ram), PC080SN_RAM_SIZE / 2);
1040   save_item(NAME(pc080sn->ctrl));
1041   machine().save().register_postload(save_prepost_delegate(FUNC(pc080sn_restore_scroll), pc080sn));
1042
10241043}
10251044
1026
10271045/***************************************************************************/
10281046/*                                                                         */
10291047/*                                 PC090OJ                                 */
r17691r17692
12171235   pc090oj->ctrl = 0;
12181236}
12191237
1238const device_type PC090OJ = &device_creator<pc090oj_device>;
12201239
1240pc090oj_device::pc090oj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1241   : device_t(mconfig, PC090OJ, "Taito PC090OJ", tag, owner, clock)
1242{
1243   m_token = global_alloc_array_clear(UINT8, sizeof(pc090oj_state));
1244}
1245
1246//-------------------------------------------------
1247//  device_config_complete - perform any
1248//  operations now that the configuration is
1249//  complete
1250//-------------------------------------------------
1251
1252void pc090oj_device::device_config_complete()
1253{
1254}
1255
1256//-------------------------------------------------
1257//  device_start - device-specific startup
1258//-------------------------------------------------
1259
1260void pc090oj_device::device_start()
1261{
1262   DEVICE_START_NAME( pc090oj )(this);
1263}
1264
1265//-------------------------------------------------
1266//  device_reset - device-specific reset
1267//-------------------------------------------------
1268
1269void pc090oj_device::device_reset()
1270{
1271   DEVICE_RESET_NAME( pc090oj )(this);
1272}
1273
1274
12211275/***************************************************************************/
12221276/*                                                                         */
12231277/*                            TC0080VCO                                    */
r17691r17692
13041358#endif
13051359
13061360
1307static TILE_GET_INFO_DEVICE( tc0080vco_get_bg0_tile_info )
1361TILE_GET_INFO_MEMBER(tc0080vco_device::tc0080vco_get_bg0_tile_info)
13081362{
1309   tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device);
1363   tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(this);
13101364   int color, tile;
13111365
13121366   color = tc0080vco->bg0_ram_1[tile_index] & 0x001f;
r17691r17692
13141368
13151369   tileinfo.category = 0;
13161370
1317   SET_TILE_INFO_DEVICE(
1371   SET_TILE_INFO_MEMBER(
13181372         tc0080vco->bg_gfx,
13191373         tile,
13201374         color,
13211375         TILE_FLIPYX((tc0080vco->bg0_ram_1[tile_index] & 0x00c0) >> 6));
13221376}
13231377
1324static TILE_GET_INFO_DEVICE( tc0080vco_get_bg1_tile_info )
1378TILE_GET_INFO_MEMBER(tc0080vco_device::tc0080vco_get_bg1_tile_info)
13251379{
1326   tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device);
1380   tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(this);
13271381   int color, tile;
13281382
13291383   color = tc0080vco->bg1_ram_1[tile_index] & 0x001f;
r17691r17692
13311385
13321386   tileinfo.category = 0;
13331387
1334   SET_TILE_INFO_DEVICE(
1388   SET_TILE_INFO_MEMBER(
13351389         tc0080vco->bg_gfx,
13361390         tile,
13371391         color,
13381392         TILE_FLIPYX((tc0080vco->bg1_ram_1[tile_index] & 0x00c0) >> 6));
13391393}
13401394
1341static TILE_GET_INFO_DEVICE( tc0080vco_get_tx_tile_info )
1395TILE_GET_INFO_MEMBER(tc0080vco_device::tc0080vco_get_tx_tile_info)
13421396{
1343   tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device);
1397   tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(this);
13441398   int tile;
13451399
13461400   if (!tc0080vco->flipscreen)
r17691r17692
13601414      tileinfo.category = 0;
13611415   }
13621416
1363   SET_TILE_INFO_DEVICE(
1417   SET_TILE_INFO_MEMBER(
13641418         tc0080vco->tx_gfx,
13651419         tile,
13661420         0x40,
r17691r17692
18471901    DEVICE INTERFACE
18481902*****************************************************************************/
18491903
1850static DEVICE_START( tc0080vco )
1904
1905const device_type TC0080VCO = &device_creator<tc0080vco_device>;
1906
1907tc0080vco_device::tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1908   : device_t(mconfig, TC0080VCO, "Taito TC0080VCO", tag, owner, clock)
18511909{
1852   tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device);
1853   const tc0080vco_interface *intf = tc0080vco_get_interface(device);
1910   m_token = global_alloc_array_clear(UINT8, sizeof(tc0080vco_state));
1911}
18541912
1913//-------------------------------------------------
1914//  device_config_complete - perform any
1915//  operations now that the configuration is
1916//  complete
1917//-------------------------------------------------
1918
1919void tc0080vco_device::device_config_complete()
1920{
1921}
1922
1923//-------------------------------------------------
1924//  device_start - device-specific startup
1925//-------------------------------------------------
1926
1927void tc0080vco_device::device_start()
1928{
1929   tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(this);
1930   const tc0080vco_interface *intf = tc0080vco_get_interface(this);
1931
18551932   /* use the given gfx sets for bg/tx tiles*/
18561933   tc0080vco->bg_gfx = intf->gfxnum;
18571934   tc0080vco->tx_gfx = intf->txnum;
r17691r17692
18611938   tc0080vco->bg_flip_yoffs = intf->bg_flip_yoffs;   /* usually -2 */
18621939   tc0080vco->has_tx = intf->has_fg0;   /* for debugging only */
18631940
1864   tc0080vco->tilemap[0] = tilemap_create_device(device, tc0080vco_get_bg0_tile_info, TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
1865   tc0080vco->tilemap[1] = tilemap_create_device(device, tc0080vco_get_bg1_tile_info, TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
1941   tc0080vco->tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0080vco_device::tc0080vco_get_bg0_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
1942   tc0080vco->tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0080vco_device::tc0080vco_get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
18661943
18671944   tc0080vco->tilemap[0]->set_transparent_pen(0);
18681945   tc0080vco->tilemap[1]->set_transparent_pen(0);
r17691r17692
18761953   tc0080vco->tilemap[0]->set_scroll_rows(512);
18771954
18781955   /* Perform extra initialisations for text layer */
1879   tc0080vco->tilemap[2] = tilemap_create_device(device, tc0080vco_get_tx_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
1956   tc0080vco->tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0080vco_device::tc0080vco_get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
18801957
18811958   tc0080vco->tilemap[2]->set_scrolldx(0, 0);
18821959   tc0080vco->tilemap[2]->set_scrolldy(48, -448);
18831960
18841961   tc0080vco->tilemap[2]->set_transparent_pen(0);
18851962
1886   tc0080vco->ram = auto_alloc_array_clear(device->machine(), UINT16, TC0080VCO_RAM_SIZE / 2);
1963   tc0080vco->ram = auto_alloc_array_clear(machine(), UINT16, TC0080VCO_RAM_SIZE / 2);
18871964
18881965   tc0080vco->char_ram      = tc0080vco->ram + 0x00000 / 2;   /* continues at +0x10000 */
18891966   tc0080vco->tx_ram_0      = tc0080vco->ram + 0x01000 / 2;
r17691r17692
19021979   tc0080vco->scroll_ram    = tc0080vco->ram + 0x20800 / 2;
19031980
19041981   /* create the char set (gfx will then be updated dynamically from RAM) */
1905   device->machine().gfx[tc0080vco->tx_gfx] = auto_alloc(device->machine(), gfx_element(device->machine(), tc0080vco_charlayout, (UINT8 *)tc0080vco->char_ram, 64, 0));
1982   machine().gfx[tc0080vco->tx_gfx] = auto_alloc(machine(), gfx_element(machine(), tc0080vco_charlayout, (UINT8 *)tc0080vco->char_ram, 64, 0));
19061983
1907   device->save_pointer(NAME(tc0080vco->ram), TC0080VCO_RAM_SIZE / 2);
1908   device->machine().save().register_postload(save_prepost_delegate(FUNC(tc0080vco_postload), tc0080vco));
1984   save_pointer(NAME(tc0080vco->ram), TC0080VCO_RAM_SIZE / 2);
1985   machine().save().register_postload(save_prepost_delegate(FUNC(tc0080vco_postload), tc0080vco));
19091986}
19101987
19111988/***************************************************************************/
r17691r17692
19692046    DEVICE HANDLERS
19702047*****************************************************************************/
19712048
1972INLINE void common_get_bg0_tile_info( device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth )
2049INLINE void common_get_bg0_tile_info( running_machine &machine, device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth )
19732050{
19742051   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device);
19752052   int code, attr;
r17691r17692
19862063      attr = ram[2 * tile_index];
19872064   }
19882065
1989   SET_TILE_INFO_DEVICE(
2066   SET_TILE_INFO(
19902067         gfxnum,
19912068         code,
19922069         (((attr * tc0100scn->bg_col_mult) + tc0100scn->bg0_colbank) & 0xff) + colbank,
19932070         TILE_FLIPYX((attr & 0xc000) >> 14));
19942071}
19952072
1996INLINE void common_get_bg1_tile_info( device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth )
2073INLINE void common_get_bg1_tile_info( running_machine &machine, device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth )
19972074{
19982075   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device);
19992076   int code, attr;
r17691r17692
20102087      attr = ram[2 * tile_index];
20112088   }
20122089
2013   SET_TILE_INFO_DEVICE(
2090   SET_TILE_INFO(
20142091         gfxnum,
20152092         code,
20162093         (((attr * tc0100scn->bg_col_mult) + tc0100scn->bg1_colbank) & 0xff) + colbank,
20172094         TILE_FLIPYX((attr & 0xc000) >> 14));
20182095}
20192096
2020INLINE void common_get_tx_tile_info( device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth )
2097INLINE void common_get_tx_tile_info( running_machine &machine, device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth )
20212098{
20222099   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device);
20232100   int attr = ram[tile_index];
20242101
2025   SET_TILE_INFO_DEVICE(
2102   SET_TILE_INFO(
20262103         gfxnum,
20272104         attr & 0xff,
20282105         ((((attr >> 6) & 0xfc) * tc0100scn->tx_col_mult + (tc0100scn->tx_colbank << 2)) & 0x3ff) + colbank * 4,
20292106         TILE_FLIPYX((attr & 0xc000) >> 14));
20302107}
20312108
2032static TILE_GET_INFO_DEVICE( tc0100scn_get_bg_tile_info )
2109TILE_GET_INFO_MEMBER(tc0100scn_device::tc0100scn_get_bg_tile_info)
20332110{
2034   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device);
2035   common_get_bg0_tile_info(device, tileinfo, tile_index, tc0100scn->bg_ram, tc0100scn->bg_gfx, tc0100scn->colbank, tc0100scn->dblwidth);
2111   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(this);
2112   common_get_bg0_tile_info(machine(), this, tileinfo, tile_index, tc0100scn->bg_ram, tc0100scn->bg_gfx, tc0100scn->colbank, tc0100scn->dblwidth);
20362113}
20372114
2038static TILE_GET_INFO_DEVICE( tc0100scn_get_fg_tile_info )
2115TILE_GET_INFO_MEMBER(tc0100scn_device::tc0100scn_get_fg_tile_info)
20392116{
2040   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device);
2041   common_get_bg1_tile_info(device, tileinfo, tile_index, tc0100scn->fg_ram, tc0100scn->bg_gfx, tc0100scn->colbank, tc0100scn->dblwidth);
2117   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(this);
2118   common_get_bg1_tile_info(machine(), this, tileinfo, tile_index, tc0100scn->fg_ram, tc0100scn->bg_gfx, tc0100scn->colbank, tc0100scn->dblwidth);
20422119}
20432120
2044static TILE_GET_INFO_DEVICE( tc0100scn_get_tx_tile_info )
2121TILE_GET_INFO_MEMBER(tc0100scn_device::tc0100scn_get_tx_tile_info)
20452122{
2046   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device);
2047   common_get_tx_tile_info(device, tileinfo, tile_index, tc0100scn->tx_ram, tc0100scn->tx_gfx, tc0100scn->colbank, tc0100scn->dblwidth);
2123   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(this);
2124   common_get_tx_tile_info(machine(), this, tileinfo, tile_index, tc0100scn->tx_ram, tc0100scn->tx_gfx, tc0100scn->colbank, tc0100scn->dblwidth);
20482125}
20492126
20502127static const gfx_layout tc0100scn_charlayout =
r17691r17692
24112488   return (tc0100scn->ctrl[6] & 0x8) >> 3;
24122489}
24132490
2414/*****************************************************************************
2415    DEVICE INTERFACE
2416*****************************************************************************/
2491const device_type TC0100SCN = &device_creator<tc0100scn_device>;
24172492
2418static DEVICE_START( tc0100scn )
2493tc0100scn_device::tc0100scn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2494   : device_t(mconfig, TC0100SCN, "Taito TC0100SCN", tag, owner, clock)
24192495{
2420   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device);
2421   const tc0100scn_interface *intf = tc0100scn_get_interface(device);
2496   m_token = global_alloc_array_clear(UINT8, sizeof(tc0100scn_state));
2497}
2498
2499//-------------------------------------------------
2500//  device_config_complete - perform any
2501//  operations now that the configuration is
2502//  complete
2503//-------------------------------------------------
2504
2505void tc0100scn_device::device_config_complete()
2506{
2507}
2508
2509//-------------------------------------------------
2510//  device_start - device-specific startup
2511//-------------------------------------------------
2512
2513void tc0100scn_device::device_start()
2514{
2515   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(this);
2516   const tc0100scn_interface *intf = tc0100scn_get_interface(this);
24222517   int xd, yd;
24232518
2424   tc0100scn->screen = device->machine().device<screen_device>(intf->screen);
2519   tc0100scn->screen = machine().device<screen_device>(intf->screen);
24252520
24262521   /* Set up clipping for multi-TC0100SCN games. We assume
24272522       this code won't ever affect single screen games:
r17691r17692
24352530   tc0100scn->tx_gfx = intf->txnum;
24362531
24372532   /* Single width versions */
2438   tc0100scn->tilemap[0][0] = tilemap_create_device(device, tc0100scn_get_bg_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
2439   tc0100scn->tilemap[1][0] = tilemap_create_device(device, tc0100scn_get_fg_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
2440   tc0100scn->tilemap[2][0] = tilemap_create_device(device, tc0100scn_get_tx_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
2533   tc0100scn->tilemap[0][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::tc0100scn_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
2534   tc0100scn->tilemap[1][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::tc0100scn_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
2535   tc0100scn->tilemap[2][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::tc0100scn_get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
24412536
24422537   /* Double width versions */
2443   tc0100scn->tilemap[0][1] = tilemap_create_device(device, tc0100scn_get_bg_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 128, 64);
2444   tc0100scn->tilemap[1][1] = tilemap_create_device(device, tc0100scn_get_fg_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 128, 64);
2445   tc0100scn->tilemap[2][1] = tilemap_create_device(device, tc0100scn_get_tx_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 128, 32);
2538   tc0100scn->tilemap[0][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::tc0100scn_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64);
2539   tc0100scn->tilemap[1][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::tc0100scn_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64);
2540   tc0100scn->tilemap[2][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::tc0100scn_get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 32);
24462541
24472542   tc0100scn->tilemap[0][0]->set_transparent_pen(0);
24482543   tc0100scn->tilemap[1][0]->set_transparent_pen(0);
r17691r17692
24912586   tc0100scn->bg_col_mult = 1;   /* multiplier for when bg gfx != 4bpp */
24922587   tc0100scn->tx_col_mult = 1;   /* multiplier needed when bg gfx is 6bpp */
24932588
2494   if (device->machine().gfx[intf->gfxnum]->granularity() == 2)   /* Yuyugogo, Yesnoj */
2589   if (machine().gfx[intf->gfxnum]->granularity() == 2)   /* Yuyugogo, Yesnoj */
24952590      tc0100scn->bg_col_mult = 8;
24962591
2497   if (device->machine().gfx[intf->gfxnum]->granularity() == 0x40)   /* Undrfire */
2592   if (machine().gfx[intf->gfxnum]->granularity() == 0x40)   /* Undrfire */
24982593      tc0100scn->tx_col_mult = 4;
24992594
2500//logerror("TC0100SCN bg gfx granularity %04x: multiplier %04x\n", device->machine().gfx[intf->gfxnum]->granularity(), tc0100scn->tx_col_mult);
2595//logerror("TC0100SCN bg gfx granularity %04x: multiplier %04x\n", machine().gfx[intf->gfxnum]->granularity(), tc0100scn->tx_col_mult);
25012596
2502   tc0100scn->ram = auto_alloc_array_clear(device->machine(), UINT16, TC0100SCN_RAM_SIZE / 2);
2597   tc0100scn->ram = auto_alloc_array_clear(machine(), UINT16, TC0100SCN_RAM_SIZE / 2);
25032598
25042599   tc0100scn_set_layer_ptrs(tc0100scn);
25052600
2506   tc0100scn_set_colbanks(device, 0, 0, 0);   /* standard values, only Wgp & multiscreen games change them */
2601   tc0100scn_set_colbanks(this, 0, 0, 0);   /* standard values, only Wgp & multiscreen games change them */
25072602                           /* we call this here, so that they can be modified at VIDEO_START*/
25082603
25092604   /* create the char set (gfx will then be updated dynamically from RAM) */
2510   device->machine().gfx[tc0100scn->tx_gfx] = auto_alloc(device->machine(), gfx_element(device->machine(), tc0100scn_charlayout, (UINT8 *)tc0100scn->char_ram, 64, 0));
2605   machine().gfx[tc0100scn->tx_gfx] = auto_alloc(machine(), gfx_element(machine(), tc0100scn_charlayout, (UINT8 *)tc0100scn->char_ram, 64, 0));
25112606
2512   device->save_pointer(NAME(tc0100scn->ram), TC0100SCN_RAM_SIZE / 2);
2513   device->save_item(NAME(tc0100scn->ctrl));
2514   device->save_item(NAME(tc0100scn->dblwidth));
2515   device->save_item(NAME(tc0100scn->gfxbank));
2516   device->machine().save().register_postload(save_prepost_delegate(FUNC(tc0100scn_postload), tc0100scn));
2607   save_pointer(NAME(tc0100scn->ram), TC0100SCN_RAM_SIZE / 2);
2608   save_item(NAME(tc0100scn->ctrl));
2609   save_item(NAME(tc0100scn->dblwidth));
2610   save_item(NAME(tc0100scn->gfxbank));
2611   machine().save().register_postload(save_prepost_delegate(FUNC(tc0100scn_postload), tc0100scn));
25172612}
25182613
2614//-------------------------------------------------
2615//  device_reset - device-specific reset
2616//-------------------------------------------------
25192617
2520static DEVICE_RESET( tc0100scn )
2618void tc0100scn_device::device_reset()
25212619{
2522   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device);
2620   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(this);
25232621   int i;
25242622
25252623   tc0100scn->dblwidth = 0;
r17691r17692
25282626
25292627   for (i = 0; i < 8; i++)
25302628      tc0100scn->ctrl[i] = 0;
2531
25322629}
25332630
2631
2632
25342633/***************************************************************************/
25352634/*                                                                         */
25362635/*                      TC0280GRD / TC0430GRW                              */
r17691r17692
25732672    DEVICE HANDLERS
25742673*****************************************************************************/
25752674
2576static TILE_GET_INFO_DEVICE( tc0280grd_get_tile_info )
2675TILE_GET_INFO_MEMBER(tc0280grd_device::tc0280grd_get_tile_info)
25772676{
2578   tc0280grd_state *tc0280grd = tc0280grd_get_safe_token(device);
2677   tc0280grd_state *tc0280grd = tc0280grd_get_safe_token(this);
25792678   int attr = tc0280grd->ram[tile_index];
2580   SET_TILE_INFO_DEVICE(
2679   SET_TILE_INFO_MEMBER(
25812680         tc0280grd->gfxnum,
25822681         attr & 0x3fff,
25832682         ((attr & 0xc000) >> 14) + tc0280grd->base_color,
r17691r17692
26782777   zoom_draw(device, bitmap, cliprect, xoffset, yoffset, priority, 1);
26792778}
26802779
2681/*****************************************************************************
2682    DEVICE INTERFACE
2683*****************************************************************************/
2780const device_type TC0280GRD = &device_creator<tc0280grd_device>;
26842781
2685static DEVICE_START( tc0280grd )
2782tc0280grd_device::tc0280grd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2783   : device_t(mconfig, TC0280GRD, "Taito TC0280GRD & TC0430GRW", tag, owner, clock)
26862784{
2687   tc0280grd_state *tc0280grd = tc0280grd_get_safe_token(device);
2688   const tc0280grd_interface *intf = tc0280grd_get_interface(device);
2785   m_token = global_alloc_array_clear(UINT8, sizeof(tc0280grd_state));
2786}
26892787
2788//-------------------------------------------------
2789//  device_config_complete - perform any
2790//  operations now that the configuration is
2791//  complete
2792//-------------------------------------------------
2793
2794void tc0280grd_device::device_config_complete()
2795{
2796}
2797
2798//-------------------------------------------------
2799//  device_start - device-specific startup
2800//-------------------------------------------------
2801
2802void tc0280grd_device::device_start()
2803{
2804   tc0280grd_state *tc0280grd = tc0280grd_get_safe_token(this);
2805   const tc0280grd_interface *intf = tc0280grd_get_interface(this);
2806
26902807   tc0280grd->gfxnum = intf->gfxnum;
26912808
2692   tc0280grd->tilemap = tilemap_create_device(device, tc0280grd_get_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
2809   tc0280grd->tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0280grd_device::tc0280grd_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
26932810   tc0280grd->tilemap->set_transparent_pen(0);
26942811
2695   tc0280grd->ram = auto_alloc_array(device->machine(), UINT16, TC0280GRD_RAM_SIZE / 2);
2812   tc0280grd->ram = auto_alloc_array(machine(), UINT16, TC0280GRD_RAM_SIZE / 2);
26962813
2697   device->save_pointer(NAME(tc0280grd->ram), TC0280GRD_RAM_SIZE / 2);
2698   device->save_item(NAME(tc0280grd->ctrl));
2814   save_pointer(NAME(tc0280grd->ram), TC0280GRD_RAM_SIZE / 2);
2815   save_item(NAME(tc0280grd->ctrl));
26992816}
27002817
2701static DEVICE_RESET( tc0280grd )
2818//-------------------------------------------------
2819//  device_reset - device-specific reset
2820//-------------------------------------------------
2821
2822void tc0280grd_device::device_reset()
27022823{
2703   tc0280grd_state *tc0280grd = tc0280grd_get_safe_token(device);
2824   tc0280grd_state *tc0280grd = tc0280grd_get_safe_token(this);
27042825   int i;
27052826
27062827   for (i = 0; i < 8; i++)
27072828      tc0280grd->ctrl[i] = 0;
2708
27092829}
27102830
2831
27112832/***************************************************************************/
27122833/*                                                                         */
27132834/*                              TC0360PRI                                  */
r17691r17692
27782899
27792900}
27802901
2902const device_type TC0360PRI = &device_creator<tc0360pri_device>;
2903
2904tc0360pri_device::tc0360pri_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2905   : device_t(mconfig, TC0360PRI, "Taito TC0360PRI", tag, owner, clock)
2906{
2907   m_token = global_alloc_array_clear(UINT8, sizeof(tc0360pri_state));
2908}
2909
2910//-------------------------------------------------
2911//  device_config_complete - perform any
2912//  operations now that the configuration is
2913//  complete
2914//-------------------------------------------------
2915
2916void tc0360pri_device::device_config_complete()
2917{
2918}
2919
2920//-------------------------------------------------
2921//  device_start - device-specific startup
2922//-------------------------------------------------
2923
2924void tc0360pri_device::device_start()
2925{
2926   DEVICE_START_NAME( tc0360pri )(this);
2927}
2928
2929//-------------------------------------------------
2930//  device_reset - device-specific reset
2931//-------------------------------------------------
2932
2933void tc0360pri_device::device_reset()
2934{
2935   DEVICE_RESET_NAME( tc0360pri )(this);
2936}
2937
27812938/***************************************************************************/
27822939/*                                                                         */
27832940/*                              TC0480SCP                                  */
r17691r17692
28362993*****************************************************************************/
28372994
28382995
2839INLINE void common_get_tc0480bg_tile_info( device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum )
2996INLINE void common_get_tc0480bg_tile_info( running_machine &machine, device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum )
28402997{
28412998   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
28422999   int code = ram[2 * tile_index + 1] & 0x7fff;
28433000   int attr = ram[2 * tile_index];
2844   SET_TILE_INFO_DEVICE(
3001   SET_TILE_INFO(
28453002         gfxnum,
28463003         code,
28473004         (attr & 0xff) + tc0480scp->tile_colbase,
28483005         TILE_FLIPYX((attr & 0xc000) >> 14));
28493006}
28503007
2851INLINE void common_get_tc0480tx_tile_info( device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum )
3008INLINE void common_get_tc0480tx_tile_info( running_machine &machine, device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum )
28523009{
28533010   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
28543011   int attr = ram[tile_index];
2855   SET_TILE_INFO_DEVICE(
3012   SET_TILE_INFO(
28563013         gfxnum,
28573014         attr & 0xff,
28583015         ((attr & 0x3f00) >> 8) + tc0480scp->tile_colbase,
28593016         TILE_FLIPYX((attr & 0xc000) >> 14));
28603017}
28613018
2862static TILE_GET_INFO_DEVICE( tc0480scp_get_bg0_tile_info )
3019TILE_GET_INFO_MEMBER(tc0480scp_device::tc0480scp_get_bg0_tile_info)
28633020{
2864   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
2865   common_get_tc0480bg_tile_info(device, tileinfo, tile_index, tc0480scp->bg_ram[0], tc0480scp->bg_gfx );
3021   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
3022   common_get_tc0480bg_tile_info(machine(), this, tileinfo, tile_index, tc0480scp->bg_ram[0], tc0480scp->bg_gfx );
28663023}
28673024
2868static TILE_GET_INFO_DEVICE( tc0480scp_get_bg1_tile_info )
3025TILE_GET_INFO_MEMBER(tc0480scp_device::tc0480scp_get_bg1_tile_info)
28693026{
2870   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
2871   common_get_tc0480bg_tile_info(device, tileinfo, tile_index, tc0480scp->bg_ram[1], tc0480scp->bg_gfx);
3027   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
3028   common_get_tc0480bg_tile_info(machine(), this, tileinfo, tile_index, tc0480scp->bg_ram[1], tc0480scp->bg_gfx);
28723029}
28733030
2874static TILE_GET_INFO_DEVICE( tc0480scp_get_bg2_tile_info )
3031TILE_GET_INFO_MEMBER(tc0480scp_device::tc0480scp_get_bg2_tile_info)
28753032{
2876   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
2877   common_get_tc0480bg_tile_info(device, tileinfo, tile_index, tc0480scp->bg_ram[2], tc0480scp->bg_gfx);
3033   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
3034   common_get_tc0480bg_tile_info(machine(), this, tileinfo, tile_index, tc0480scp->bg_ram[2], tc0480scp->bg_gfx);
28783035}
28793036
2880static TILE_GET_INFO_DEVICE( tc0480scp_get_bg3_tile_info )
3037TILE_GET_INFO_MEMBER(tc0480scp_device::tc0480scp_get_bg3_tile_info)
28813038{
2882   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
2883   common_get_tc0480bg_tile_info(device, tileinfo, tile_index, tc0480scp->bg_ram[3], tc0480scp->bg_gfx);
3039   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
3040   common_get_tc0480bg_tile_info(machine(), this, tileinfo, tile_index, tc0480scp->bg_ram[3], tc0480scp->bg_gfx);
28843041}
28853042
2886static TILE_GET_INFO_DEVICE( tc0480scp_get_tx_tile_info )
3043TILE_GET_INFO_MEMBER(tc0480scp_device::tc0480scp_get_tx_tile_info)
28873044{
2888   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
2889   common_get_tc0480tx_tile_info(device, tileinfo, tile_index, tc0480scp->tx_ram, tc0480scp->tx_gfx);
3045   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
3046   common_get_tc0480tx_tile_info(machine(), this, tileinfo, tile_index, tc0480scp->tx_ram, tc0480scp->tx_gfx);
28903047}
28913048
28923049static const gfx_layout tc0480scp_charlayout =
r17691r17692
36233780   tc0480scp->tilemap[4][1]->set_scrolly(0, -reg);
36243781}
36253782
3626/*****************************************************************************
3627    DEVICE INTERFACE
3628*****************************************************************************/
36293783
3630static DEVICE_START( tc0480scp )
3784
3785const device_type TC0480SCP = &device_creator<tc0480scp_device>;
3786
3787tc0480scp_device::tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
3788   : device_t(mconfig, TC0480SCP, "Taito TC0480SCP", tag, owner, clock)
36313789{
3632   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
3633   const tc0480scp_interface *intf = tc0480scp_get_interface(device);
3790   m_token = global_alloc_array_clear(UINT8, sizeof(tc0480scp_state));
3791}
3792
3793//-------------------------------------------------
3794//  device_config_complete - perform any
3795//  operations now that the configuration is
3796//  complete
3797//-------------------------------------------------
3798
3799void tc0480scp_device::device_config_complete()
3800{
3801}
3802
3803//-------------------------------------------------
3804//  device_start - device-specific startup
3805//-------------------------------------------------
3806
3807void tc0480scp_device::device_start()
3808{
3809   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
3810   const tc0480scp_interface *intf = tc0480scp_get_interface(this);
36343811   int i, xd, yd;
36353812
36363813   /* use the given gfx set for bg/tx tiles */
r17691r17692
36463823   tc0480scp->y_offs = intf->y_offset;
36473824
36483825   /* Single width versions */
3649   tc0480scp->tilemap[0][0] = tilemap_create_device(device, tc0480scp_get_bg0_tile_info, TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
3650   tc0480scp->tilemap[1][0] = tilemap_create_device(device, tc0480scp_get_bg1_tile_info, TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
3651   tc0480scp->tilemap[2][0] = tilemap_create_device(device, tc0480scp_get_bg2_tile_info, TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
3652   tc0480scp->tilemap[3][0] = tilemap_create_device(device, tc0480scp_get_bg3_tile_info, TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
3653   tc0480scp->tilemap[4][0] = tilemap_create_device(device, tc0480scp_get_tx_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
3826   tc0480scp->tilemap[0][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::tc0480scp_get_bg0_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
3827   tc0480scp->tilemap[1][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::tc0480scp_get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
3828   tc0480scp->tilemap[2][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::tc0480scp_get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
3829   tc0480scp->tilemap[3][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::tc0480scp_get_bg3_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
3830   tc0480scp->tilemap[4][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::tc0480scp_get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
36543831
36553832   /* Double width versions */
3656   tc0480scp->tilemap[0][1] = tilemap_create_device(device, tc0480scp_get_bg0_tile_info, TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
3657   tc0480scp->tilemap[1][1] = tilemap_create_device(device, tc0480scp_get_bg1_tile_info, TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
3658   tc0480scp->tilemap[2][1] = tilemap_create_device(device, tc0480scp_get_bg2_tile_info, TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
3659   tc0480scp->tilemap[3][1] = tilemap_create_device(device, tc0480scp_get_bg3_tile_info, TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
3660   tc0480scp->tilemap[4][1] = tilemap_create_device(device, tc0480scp_get_tx_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
3833   tc0480scp->tilemap[0][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::tc0480scp_get_bg0_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
3834   tc0480scp->tilemap[1][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::tc0480scp_get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
3835   tc0480scp->tilemap[2][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::tc0480scp_get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
3836   tc0480scp->tilemap[3][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::tc0480scp_get_bg3_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
3837   tc0480scp->tilemap[4][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::tc0480scp_get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
36613838
36623839   for (i = 0; i < 2; i++)
36633840   {
r17691r17692
37123889      tc0480scp->tilemap[3][i]->set_scroll_rows(512);
37133890   }
37143891
3715   tc0480scp->ram = auto_alloc_array_clear(device->machine(), UINT16, TC0480SCP_RAM_SIZE / 2);
3892   tc0480scp->ram = auto_alloc_array_clear(machine(), UINT16, TC0480SCP_RAM_SIZE / 2);
37163893
37173894   tc0480scp_set_layer_ptrs(tc0480scp);
37183895
37193896   /* create the char set (gfx will then be updated dynamically from RAM) */
3720   device->machine().gfx[tc0480scp->tx_gfx] = auto_alloc(device->machine(), gfx_element(device->machine(), tc0480scp_charlayout, (UINT8 *)tc0480scp->char_ram, 64, 0));
3897   machine().gfx[tc0480scp->tx_gfx] = auto_alloc(machine(), gfx_element(machine(), tc0480scp_charlayout, (UINT8 *)tc0480scp->char_ram, 64, 0));
37213898
3722   device->save_pointer(NAME(tc0480scp->ram), TC0480SCP_RAM_SIZE / 2);
3723   device->save_item(NAME(tc0480scp->ctrl));
3724   device->save_item(NAME(tc0480scp->dblwidth));
3725   device->machine().save().register_postload(save_prepost_delegate(FUNC(tc0480scp_postload), tc0480scp));
3899   save_pointer(NAME(tc0480scp->ram), TC0480SCP_RAM_SIZE / 2);
3900   save_item(NAME(tc0480scp->ctrl));
3901   save_item(NAME(tc0480scp->dblwidth));
3902   machine().save().register_postload(save_prepost_delegate(FUNC(tc0480scp_postload), tc0480scp));
37263903}
37273904
3728static DEVICE_RESET( tc0480scp )
3905//-------------------------------------------------
3906//  device_reset - device-specific reset
3907//-------------------------------------------------
3908
3909void tc0480scp_device::device_reset()
37293910{
3730   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
3911   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
37313912   int i;
37323913
37333914   tc0480scp->dblwidth = 0;
r17691r17692
37373918
37383919}
37393920
3921
37403922/***************************************************************************/
37413923/*                                                                         */
37423924/*                              TC0150ROD                                  */
r17691r17692
45454727
45464728}
45474729
4730const device_type TC0150ROD = &device_creator<tc0150rod_device>;
45484731
4732tc0150rod_device::tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
4733   : device_t(mconfig, TC0150ROD, "Taito TC0150ROD", tag, owner, clock)
4734{
4735   m_token = global_alloc_array_clear(UINT8, sizeof(tc0150rod_state));
4736}
4737
4738//-------------------------------------------------
4739//  device_config_complete - perform any
4740//  operations now that the configuration is
4741//  complete
4742//-------------------------------------------------
4743
4744void tc0150rod_device::device_config_complete()
4745{
4746}
4747
4748//-------------------------------------------------
4749//  device_start - device-specific startup
4750//-------------------------------------------------
4751
4752void tc0150rod_device::device_start()
4753{
4754   DEVICE_START_NAME( tc0150rod )(this);
4755}
4756
4757
45494758/***************************************************************************/
45504759/*                                                                         */
45514760/*                              TC0110PCR                                  */
r17691r17692
47674976   tc0110pcr->type = 0;   /* default, xBBBBBGGGGGRRRRR */
47684977}
47694978
4979const device_type TC0110PCR = &device_creator<tc0110pcr_device>;
47704980
4981tc0110pcr_device::tc0110pcr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
4982   : device_t(mconfig, TC0110PCR, "Taito TC0110PCR", tag, owner, clock)
4983{
4984   m_token = global_alloc_array_clear(UINT8, sizeof(tc0110pcr_state));
4985}
4986
4987//-------------------------------------------------
4988//  device_config_complete - perform any
4989//  operations now that the configuration is
4990//  complete
4991//-------------------------------------------------
4992
4993void tc0110pcr_device::device_config_complete()
4994{
4995}
4996
4997//-------------------------------------------------
4998//  device_start - device-specific startup
4999//-------------------------------------------------
5000
5001void tc0110pcr_device::device_start()
5002{
5003   DEVICE_START_NAME( tc0110pcr )(this);
5004}
5005
5006//-------------------------------------------------
5007//  device_reset - device-specific reset
5008//-------------------------------------------------
5009
5010void tc0110pcr_device::device_reset()
5011{
5012   DEVICE_RESET_NAME( tc0110pcr )(this);
5013}
5014
5015
47715016/***************************************************************************/
47725017/*                                                                         */
47735018/*                                TC0180VCU                                */
r17691r17692
49435188   }
49445189}
49455190
4946static TILE_GET_INFO_DEVICE( get_bg_tile_info )
5191TILE_GET_INFO_MEMBER(tc0180vcu_device::get_bg_tile_info)
49475192{
4948   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
5193   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(this);
49495194   int tile  = tc0180vcu->ram[tile_index + tc0180vcu->bg_rambank[0]];
49505195   int color = tc0180vcu->ram[tile_index + tc0180vcu->bg_rambank[1]];
49515196
4952   SET_TILE_INFO_DEVICE(
5197   SET_TILE_INFO_MEMBER(
49535198      1,
49545199      tile,
49555200      tc0180vcu->bg_color_base + (color & 0x3f),
49565201      TILE_FLIPYX((color & 0x00c0) >> 6));
49575202}
49585203
4959static TILE_GET_INFO_DEVICE( get_fg_tile_info )
5204TILE_GET_INFO_MEMBER(tc0180vcu_device::get_fg_tile_info)
49605205{
4961   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
5206   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(this);
49625207   int tile  = tc0180vcu->ram[tile_index + tc0180vcu->fg_rambank[0]];
49635208   int color = tc0180vcu->ram[tile_index + tc0180vcu->fg_rambank[1]];
49645209
4965   SET_TILE_INFO_DEVICE(
5210   SET_TILE_INFO_MEMBER(
49665211      1,
49675212      tile,
49685213      tc0180vcu->fg_color_base + (color & 0x3f),
49695214      TILE_FLIPYX((color & 0x00c0) >> 6));
49705215}
49715216
4972static TILE_GET_INFO_DEVICE( get_tx_tile_info )
5217TILE_GET_INFO_MEMBER(tc0180vcu_device::get_tx_tile_info)
49735218{
4974   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
5219   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(this);
49755220   int tile = tc0180vcu->ram[tile_index + tc0180vcu->tx_rambank];
49765221
4977   SET_TILE_INFO_DEVICE(
5222   SET_TILE_INFO_MEMBER(
49785223      0,
49795224      (tile & 0x07ff) | ((tc0180vcu->ctrl[4 + ((tile & 0x800) >> 11)]>>8) << 11),
49805225      tc0180vcu->tx_color_base + ((tile >> 12) & 0x0f),
r17691r17692
50645309   }
50655310}
50665311
5067/*****************************************************************************
5068    DEVICE INTERFACE
5069*****************************************************************************/
5312const device_type TC0180VCU = &device_creator<tc0180vcu_device>;
50705313
5071static DEVICE_START( tc0180vcu )
5314tc0180vcu_device::tc0180vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5315   : device_t(mconfig, TC0180VCU, "Taito TC0180VCU", tag, owner, clock)
50725316{
5073   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
5074   const tc0180vcu_interface *intf = tc0180vcu_get_interface(device);
5075
5076   tc0180vcu->bg_color_base = intf->bg_color_base;
5077   tc0180vcu->fg_color_base = intf->fg_color_base;
5078   tc0180vcu->tx_color_base = intf->tx_color_base;
5079
5080   tc0180vcu->tilemap[0] = tilemap_create_device(device, get_bg_tile_info, TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
5081   tc0180vcu->tilemap[1] = tilemap_create_device(device, get_fg_tile_info, TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
5082   tc0180vcu->tilemap[2] = tilemap_create_device(device, get_tx_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
5083
5084   tc0180vcu->tilemap[1]->set_transparent_pen(0);
5085   tc0180vcu->tilemap[2]->set_transparent_pen(0);
5086
5087   tc0180vcu->tilemap[0]->set_scrolldx(0, 24 * 8);
5088   tc0180vcu->tilemap[1]->set_scrolldx(0, 24 * 8);
5089   tc0180vcu->tilemap[2]->set_scrolldx(0, 24 * 8);
5090
5091   tc0180vcu->ram = auto_alloc_array_clear(device->machine(), UINT16, TC0180VCU_RAM_SIZE / 2);
5092   tc0180vcu->scrollram = auto_alloc_array_clear(device->machine(), UINT16, TC0180VCU_SCROLLRAM_SIZE / 2);
5093
5094   device->save_pointer(NAME(tc0180vcu->ram), TC0180VCU_RAM_SIZE / 2);
5095   device->save_pointer(NAME(tc0180vcu->scrollram), TC0180VCU_SCROLLRAM_SIZE / 2);
5096
5097   device->save_item(NAME(tc0180vcu->bg_rambank));
5098   device->save_item(NAME(tc0180vcu->fg_rambank));
5099   device->save_item(NAME(tc0180vcu->tx_rambank));
5100
5101   device->save_item(NAME(tc0180vcu->framebuffer_page));
5102
5103   device->save_item(NAME(tc0180vcu->video_control));
5104   device->save_item(NAME(tc0180vcu->ctrl));
5317   m_token = global_alloc_array_clear(UINT8, sizeof(tc0180vcu_state));
51055318}
51065319
5107static DEVICE_RESET( tc0180vcu )
5108{
5109   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
5110   int i;
5111
5112   for (i = 0; i < 0x10; i++)
5113      tc0180vcu->ctrl[i] = 0;
5114
5115   tc0180vcu->bg_rambank[0] = 0;
5116   tc0180vcu->bg_rambank[1] = 0;
5117   tc0180vcu->fg_rambank[0] = 0;
5118   tc0180vcu->fg_rambank[1] = 0;
5119   tc0180vcu->tx_rambank = 0;
5120
5121   tc0180vcu->framebuffer_page = 0;
5122   tc0180vcu->video_control = 0;
5123}
5124
5125const device_type PC080SN = &device_creator<pc080sn_device>;
5126
5127pc080sn_device::pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5128   : device_t(mconfig, PC080SN, "Taito PC080SN", tag, owner, clock)
5129{
5130   m_token = global_alloc_array_clear(UINT8, sizeof(pc080sn_state));
5131}
5132
51335320//-------------------------------------------------
51345321//  device_config_complete - perform any
51355322//  operations now that the configuration is
51365323//  complete
51375324//-------------------------------------------------
51385325
5139void pc080sn_device::device_config_complete()
5326void tc0180vcu_device::device_config_complete()
51405327{
51415328}
51425329
r17691r17692
51445331//  device_start - device-specific startup
51455332//-------------------------------------------------
51465333
5147void pc080sn_device::device_start()
5334void tc0180vcu_device::device_start()
51485335{
5149   DEVICE_START_NAME( pc080sn )(this);
5150}
51515336
5337   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(this);
5338   const tc0180vcu_interface *intf = tc0180vcu_get_interface(this);
51525339
5153const device_type PC090OJ = &device_creator<pc090oj_device>;
5340   tc0180vcu->bg_color_base = intf->bg_color_base;
5341   tc0180vcu->fg_color_base = intf->fg_color_base;
5342   tc0180vcu->tx_color_base = intf->tx_color_base;
51545343
5155pc090oj_device::pc090oj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5156   : device_t(mconfig, PC090OJ, "Taito PC090OJ", tag, owner, clock)
5157{
5158   m_token = global_alloc_array_clear(UINT8, sizeof(pc090oj_state));
5159}
5344   tc0180vcu->tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0180vcu_device::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
5345   tc0180vcu->tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0180vcu_device::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
5346   tc0180vcu->tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0180vcu_device::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
51605347
5161//-------------------------------------------------
5162//  device_config_complete - perform any
5163//  operations now that the configuration is
5164//  complete
5165//-------------------------------------------------
5348   tc0180vcu->tilemap[1]->set_transparent_pen(0);
5349   tc0180vcu->tilemap[2]->set_transparent_pen(0);
51665350
5167void pc090oj_device::device_config_complete()
5168{
5169}
5351   tc0180vcu->tilemap[0]->set_scrolldx(0, 24 * 8);
5352   tc0180vcu->tilemap[1]->set_scrolldx(0, 24 * 8);
5353   tc0180vcu->tilemap[2]->set_scrolldx(0, 24 * 8);
51705354
5171//-------------------------------------------------
5172//  device_start - device-specific startup
5173//-------------------------------------------------
5355   tc0180vcu->ram = auto_alloc_array_clear(machine(), UINT16, TC0180VCU_RAM_SIZE / 2);
5356   tc0180vcu->scrollram = auto_alloc_array_clear(machine(), UINT16, TC0180VCU_SCROLLRAM_SIZE / 2);
51745357
5175void pc090oj_device::device_start()
5176{
5177   DEVICE_START_NAME( pc090oj )(this);
5178}
5358   save_pointer(NAME(tc0180vcu->ram), TC0180VCU_RAM_SIZE / 2);
5359   save_pointer(NAME(tc0180vcu->scrollram), TC0180VCU_SCROLLRAM_SIZE / 2);
51795360
5180//-------------------------------------------------
5181//  device_reset - device-specific reset
5182//-------------------------------------------------
5361   save_item(NAME(tc0180vcu->bg_rambank));
5362   save_item(NAME(tc0180vcu->fg_rambank));
5363   save_item(NAME(tc0180vcu->tx_rambank));
51835364
5184void pc090oj_device::device_reset()
5185{
5186   DEVICE_RESET_NAME( pc090oj )(this);
5187}
5365   save_item(NAME(tc0180vcu->framebuffer_page));
51885366
5189
5190const device_type TC0080VCO = &device_creator<tc0080vco_device>;
5191
5192tc0080vco_device::tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5193   : device_t(mconfig, TC0080VCO, "Taito TC0080VCO", tag, owner, clock)
5194{
5195   m_token = global_alloc_array_clear(UINT8, sizeof(tc0080vco_state));
5367   save_item(NAME(tc0180vcu->video_control));
5368   save_item(NAME(tc0180vcu->ctrl));
51965369}
51975370
51985371//-------------------------------------------------
5199//  device_config_complete - perform any
5200//  operations now that the configuration is
5201//  complete
5202//-------------------------------------------------
5203
5204void tc0080vco_device::device_config_complete()
5205{
5206}
5207
5208//-------------------------------------------------
5209//  device_start - device-specific startup
5210//-------------------------------------------------
5211
5212void tc0080vco_device::device_start()
5213{
5214   DEVICE_START_NAME( tc0080vco )(this);
5215}
5216
5217
5218const device_type TC0100SCN = &device_creator<tc0100scn_device>;
5219
5220tc0100scn_device::tc0100scn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5221   : device_t(mconfig, TC0100SCN, "Taito TC0100SCN", tag, owner, clock)
5222{
5223   m_token = global_alloc_array_clear(UINT8, sizeof(tc0100scn_state));
5224}
5225
5226//-------------------------------------------------
5227//  device_config_complete - perform any
5228//  operations now that the configuration is
5229//  complete
5230//-------------------------------------------------
5231
5232void tc0100scn_device::device_config_complete()
5233{
5234}
5235
5236//-------------------------------------------------
5237//  device_start - device-specific startup
5238//-------------------------------------------------
5239
5240void tc0100scn_device::device_start()
5241{
5242   DEVICE_START_NAME( tc0100scn )(this);
5243}
5244
5245//-------------------------------------------------
52465372//  device_reset - device-specific reset
52475373//-------------------------------------------------
52485374
5249void tc0100scn_device::device_reset()
5375void tc0180vcu_device::device_reset()
52505376{
5251   DEVICE_RESET_NAME( tc0100scn )(this);
5252}
5377   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(this);
5378   int i;
52535379
5380   for (i = 0; i < 0x10; i++)
5381      tc0180vcu->ctrl[i] = 0;
52545382
5255const device_type TC0280GRD = &device_creator<tc0280grd_device>;
5383   tc0180vcu->bg_rambank[0] = 0;
5384   tc0180vcu->bg_rambank[1] = 0;
5385   tc0180vcu->fg_rambank[0] = 0;
5386   tc0180vcu->fg_rambank[1] = 0;
5387   tc0180vcu->tx_rambank = 0;
52565388
5257tc0280grd_device::tc0280grd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5258   : device_t(mconfig, TC0280GRD, "Taito TC0280GRD & TC0430GRW", tag, owner, clock)
5259{
5260   m_token = global_alloc_array_clear(UINT8, sizeof(tc0280grd_state));
5389   tc0180vcu->framebuffer_page = 0;
5390   tc0180vcu->video_control = 0;
52615391}
52625392
5263//-------------------------------------------------
5264//  device_config_complete - perform any
5265//  operations now that the configuration is
5266//  complete
5267//-------------------------------------------------
52685393
5269void tc0280grd_device::device_config_complete()
5270{
5271}
5272
5273//-------------------------------------------------
5274//  device_start - device-specific startup
5275//-------------------------------------------------
5276
5277void tc0280grd_device::device_start()
5278{
5279   DEVICE_START_NAME( tc0280grd )(this);
5280}
5281
5282//-------------------------------------------------
5283//  device_reset - device-specific reset
5284//-------------------------------------------------
5285
5286void tc0280grd_device::device_reset()
5287{
5288   DEVICE_RESET_NAME( tc0280grd )(this);
5289}
5290
5291
5292const device_type TC0360PRI = &device_creator<tc0360pri_device>;
5293
5294tc0360pri_device::tc0360pri_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5295   : device_t(mconfig, TC0360PRI, "Taito TC0360PRI", tag, owner, clock)
5296{
5297   m_token = global_alloc_array_clear(UINT8, sizeof(tc0360pri_state));
5298}
5299
5300//-------------------------------------------------
5301//  device_config_complete - perform any
5302//  operations now that the configuration is
5303//  complete
5304//-------------------------------------------------
5305
5306void tc0360pri_device::device_config_complete()
5307{
5308}
5309
5310//-------------------------------------------------
5311//  device_start - device-specific startup
5312//-------------------------------------------------
5313
5314void tc0360pri_device::device_start()
5315{
5316   DEVICE_START_NAME( tc0360pri )(this);
5317}
5318
5319//-------------------------------------------------
5320//  device_reset - device-specific reset
5321//-------------------------------------------------
5322
5323void tc0360pri_device::device_reset()
5324{
5325   DEVICE_RESET_NAME( tc0360pri )(this);
5326}
5327
5328
5329const device_type TC0480SCP = &device_creator<tc0480scp_device>;
5330
5331tc0480scp_device::tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5332   : device_t(mconfig, TC0480SCP, "Taito TC0480SCP", tag, owner, clock)
5333{
5334   m_token = global_alloc_array_clear(UINT8, sizeof(tc0480scp_state));
5335}
5336
5337//-------------------------------------------------
5338//  device_config_complete - perform any
5339//  operations now that the configuration is
5340//  complete
5341//-------------------------------------------------
5342
5343void tc0480scp_device::device_config_complete()
5344{
5345}
5346
5347//-------------------------------------------------
5348//  device_start - device-specific startup
5349//-------------------------------------------------
5350
5351void tc0480scp_device::device_start()
5352{
5353   DEVICE_START_NAME( tc0480scp )(this);
5354}
5355
5356//-------------------------------------------------
5357//  device_reset - device-specific reset
5358//-------------------------------------------------
5359
5360void tc0480scp_device::device_reset()
5361{
5362   DEVICE_RESET_NAME( tc0480scp )(this);
5363}
5364
5365
5366const device_type TC0150ROD = &device_creator<tc0150rod_device>;
5367
5368tc0150rod_device::tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5369   : device_t(mconfig, TC0150ROD, "Taito TC0150ROD", tag, owner, clock)
5370{
5371   m_token = global_alloc_array_clear(UINT8, sizeof(tc0150rod_state));
5372}
5373
5374//-------------------------------------------------
5375//  device_config_complete - perform any
5376//  operations now that the configuration is
5377//  complete
5378//-------------------------------------------------
5379
5380void tc0150rod_device::device_config_complete()
5381{
5382}
5383
5384//-------------------------------------------------
5385//  device_start - device-specific startup
5386//-------------------------------------------------
5387
5388void tc0150rod_device::device_start()
5389{
5390   DEVICE_START_NAME( tc0150rod )(this);
5391}
5392
5393
5394const device_type TC0110PCR = &device_creator<tc0110pcr_device>;
5395
5396tc0110pcr_device::tc0110pcr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5397   : device_t(mconfig, TC0110PCR, "Taito TC0110PCR", tag, owner, clock)
5398{
5399   m_token = global_alloc_array_clear(UINT8, sizeof(tc0110pcr_state));
5400}
5401
5402//-------------------------------------------------
5403//  device_config_complete - perform any
5404//  operations now that the configuration is
5405//  complete
5406//-------------------------------------------------
5407
5408void tc0110pcr_device::device_config_complete()
5409{
5410}
5411
5412//-------------------------------------------------
5413//  device_start - device-specific startup
5414//-------------------------------------------------
5415
5416void tc0110pcr_device::device_start()
5417{
5418   DEVICE_START_NAME( tc0110pcr )(this);
5419}
5420
5421//-------------------------------------------------
5422//  device_reset - device-specific reset
5423//-------------------------------------------------
5424
5425void tc0110pcr_device::device_reset()
5426{
5427   DEVICE_RESET_NAME( tc0110pcr )(this);
5428}
5429
5430
5431const device_type TC0180VCU = &device_creator<tc0180vcu_device>;
5432
5433tc0180vcu_device::tc0180vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5434   : device_t(mconfig, TC0180VCU, "Taito TC0180VCU", tag, owner, clock)
5435{
5436   m_token = global_alloc_array_clear(UINT8, sizeof(tc0180vcu_state));
5437}
5438
5439//-------------------------------------------------
5440//  device_config_complete - perform any
5441//  operations now that the configuration is
5442//  complete
5443//-------------------------------------------------
5444
5445void tc0180vcu_device::device_config_complete()
5446{
5447}
5448
5449//-------------------------------------------------
5450//  device_start - device-specific startup
5451//-------------------------------------------------
5452
5453void tc0180vcu_device::device_start()
5454{
5455   DEVICE_START_NAME( tc0180vcu )(this);
5456}
5457
5458//-------------------------------------------------
5459//  device_reset - device-specific reset
5460//-------------------------------------------------
5461
5462void tc0180vcu_device::device_reset()
5463{
5464   DEVICE_RESET_NAME( tc0180vcu )(this);
5465}
5466
5467
trunk/src/mame/video/taitoic.h
r17691r17692
121121private:
122122   // internal state
123123   void *m_token;
124   
125   TILE_GET_INFO_MEMBER(pc080sn_get_bg_tile_info);
126   TILE_GET_INFO_MEMBER(pc080sn_get_fg_tile_info);
124127};
125128
126129extern const device_type PC080SN;
r17691r17692
160163private:
161164   // internal state
162165   void *m_token;
166   
167   TILE_GET_INFO_MEMBER(tc0080vco_get_bg0_tile_info);
168   TILE_GET_INFO_MEMBER(tc0080vco_get_bg1_tile_info);
169   TILE_GET_INFO_MEMBER(tc0080vco_get_tx_tile_info);   
163170};
164171
165172extern const device_type TC0080VCO;
r17691r17692
180187private:
181188   // internal state
182189   void *m_token;
190   
191   TILE_GET_INFO_MEMBER(tc0100scn_get_bg_tile_info);
192   TILE_GET_INFO_MEMBER(tc0100scn_get_fg_tile_info);
193   TILE_GET_INFO_MEMBER(tc0100scn_get_tx_tile_info);   
183194};
184195
185196extern const device_type TC0100SCN;
r17691r17692
200211private:
201212   // internal state
202213   void *m_token;
214   
215   TILE_GET_INFO_MEMBER(tc0280grd_get_tile_info);
203216};
204217
205218extern const device_type TC0280GRD;
r17691r17692
241254private:
242255   // internal state
243256   void *m_token;
257     
258   TILE_GET_INFO_MEMBER(tc0480scp_get_bg0_tile_info);
259   TILE_GET_INFO_MEMBER(tc0480scp_get_bg1_tile_info);
260   TILE_GET_INFO_MEMBER(tc0480scp_get_bg2_tile_info);
261   TILE_GET_INFO_MEMBER(tc0480scp_get_bg3_tile_info);
262   TILE_GET_INFO_MEMBER(tc0480scp_get_tx_tile_info);   
244263};
245264
246265extern const device_type TC0480SCP;
r17691r17692
300319private:
301320   // internal state
302321   void *m_token;
322   
323   TILE_GET_INFO_MEMBER(get_bg_tile_info);
324   TILE_GET_INFO_MEMBER(get_fg_tile_info);
325   TILE_GET_INFO_MEMBER(get_tx_tile_info);   
303326};
304327
305328extern const device_type TC0180VCU;
trunk/src/mame/video/segaic24.c
r17691r17692
5151   tileinfo.set(machine(), char_gfx_index, val & tile_mask, (val >> 7) & 0xff, 0);
5252}
5353
54TILE_GET_INFO_DEVICE( segas24_tile::tile_info_0s )
54TILE_GET_INFO_MEMBER(segas24_tile::tile_info_0s)
5555{
56   downcast<segas24_tile *>(device)->tile_info(0x0000, tileinfo, tile_index);
56   tile_info(0x0000, tileinfo, tile_index);
5757}
5858
59TILE_GET_INFO_DEVICE( segas24_tile::tile_info_0w )
59TILE_GET_INFO_MEMBER( segas24_tile::tile_info_0w)
6060{
61   downcast<segas24_tile *>(device)->tile_info(0x1000, tileinfo, tile_index);
61   tile_info(0x1000, tileinfo, tile_index);
6262}
6363
64TILE_GET_INFO_DEVICE( segas24_tile::tile_info_1s )
64TILE_GET_INFO_MEMBER(segas24_tile::tile_info_1s)
6565{
66   downcast<segas24_tile *>(device)->tile_info(0x2000, tileinfo, tile_index);
66   tile_info(0x2000, tileinfo, tile_index);
6767}
6868
69TILE_GET_INFO_DEVICE( segas24_tile::tile_info_1w )
69TILE_GET_INFO_MEMBER(segas24_tile::tile_info_1w)
7070{
71   downcast<segas24_tile *>(device)->tile_info(0x3000, tileinfo, tile_index);
71   tile_info(0x3000, tileinfo, tile_index);
7272}
7373
7474void segas24_tile::device_start()
r17691r17692
8181   char_ram = auto_alloc_array(machine(), UINT16, 0x80000/2);
8282   tile_ram = auto_alloc_array(machine(), UINT16, 0x10000/2);
8383
84   tile_layer[0] = tilemap_create_device(this, tile_info_0s, TILEMAP_SCAN_ROWS,  8, 8, 64, 64);
85   tile_layer[1] = tilemap_create_device(this, tile_info_0w, TILEMAP_SCAN_ROWS,  8, 8, 64, 64);
86   tile_layer[2] = tilemap_create_device(this, tile_info_1s, TILEMAP_SCAN_ROWS,  8, 8, 64, 64);
87   tile_layer[3] = tilemap_create_device(this, tile_info_1w, TILEMAP_SCAN_ROWS,  8, 8, 64, 64);
84   tile_layer[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_0s),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 64);
85   tile_layer[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_0w),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 64);
86   tile_layer[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_1s),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 64);
87   tile_layer[3] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_1w),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 64);
8888
8989   tile_layer[0]->set_transparent_pen(0);
9090   tile_layer[1]->set_transparent_pen(0);
trunk/src/mame/video/segaic24.h
r17691r17692
4949   static const gfx_layout char_layout;
5050
5151   void tile_info(int offset, tile_data &tileinfo, tilemap_memory_index tile_index);
52   static TILE_GET_INFO_DEVICE(tile_info_0s);
53   static TILE_GET_INFO_DEVICE(tile_info_0w);
54   static TILE_GET_INFO_DEVICE(tile_info_1s);
55   static TILE_GET_INFO_DEVICE(tile_info_1w);
52   TILE_GET_INFO_MEMBER(tile_info_0s);
53   TILE_GET_INFO_MEMBER(tile_info_0w);
54   TILE_GET_INFO_MEMBER(tile_info_1s);
55   TILE_GET_INFO_MEMBER(tile_info_1w);
5656
5757   void draw_rect(bitmap_ind16 &bm, bitmap_ind8 &tm, bitmap_ind16 &dm, const UINT16 *mask,
5858               UINT16 tpri, UINT8 lpri, int win, int sx, int sy, int xx1, int yy1, int xx2, int yy2);
trunk/src/mame/video/deco16ic.c
r17691r17692
213213
214214/*****************************************************************************************/
215215
216static TILEMAP_MAPPER( deco16_scan_rows )
216TILEMAP_MAPPER_MEMBER(deco16ic_device::deco16_scan_rows)
217217{
218218   /* logical (col,row) -> memory offset */
219219   return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5) + ((row & 0x20) << 6);
220220}
221221
222static TILE_GET_INFO_DEVICE( get_pf2_tile_info )
222TILE_GET_INFO_MEMBER(deco16ic_device::get_pf2_tile_info)
223223{
224   deco16ic_state *deco16ic = get_safe_token(device);
224   deco16ic_state *deco16ic = get_safe_token(this);
225225   UINT16 tile = deco16ic->pf2_data[tile_index];
226226   UINT8 colour = (tile >> 12) & 0xf;
227227   UINT8 flags = 0;
r17691r17692
240240      }
241241   }
242242
243   SET_TILE_INFO_DEVICE(
243   SET_TILE_INFO_MEMBER(
244244         deco16ic->pf12_16x16_gfx_bank,
245245         (tile & 0xfff) | deco16ic->pf2_bank,
246246         (colour & deco16ic->pf2_colourmask) + deco16ic->pf2_colour_bank,
247247         flags);
248248}
249249
250static TILE_GET_INFO_DEVICE( get_pf1_tile_info )
250TILE_GET_INFO_MEMBER(deco16ic_device::get_pf1_tile_info)
251251{
252   deco16ic_state *deco16ic = get_safe_token(device);
252   deco16ic_state *deco16ic = get_safe_token(this);
253253   UINT16 tile = deco16ic->pf1_data[tile_index];
254254   UINT8 colour = (tile >> 12) & 0xf;
255255   UINT8 flags = 0;
r17691r17692
273273      // Captain America operates this chip in 8bpp mode.
274274      // In 8bpp mode you appear to only get 1 layer, not 2, but you also
275275      // have an extra 2 tile bits, and 2 less colour bits.
276      SET_TILE_INFO_DEVICE(
276      SET_TILE_INFO_MEMBER(
277277            deco16ic->pf12_16x16_gfx_bank,
278278            (tile & 0x3fff) | deco16ic->pf1_bank,
279279            ((colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank)>>2,
r17691r17692
281281   }
282282   else
283283   {
284      SET_TILE_INFO_DEVICE(
284      SET_TILE_INFO_MEMBER(
285285            deco16ic->pf12_16x16_gfx_bank,
286286            (tile & 0xfff) | deco16ic->pf1_bank,
287287            (colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank,
r17691r17692
289289   }
290290}
291291
292static TILE_GET_INFO_DEVICE( get_pf2_tile_info_b )
292TILE_GET_INFO_MEMBER(deco16ic_device::get_pf2_tile_info_b)
293293{
294   deco16ic_state *deco16ic = get_safe_token(device);
294   deco16ic_state *deco16ic = get_safe_token(this);
295295   UINT16 tile = deco16ic->pf2_data[tile_index];
296296   UINT8 colour = (tile >> 12) & 0xf;
297297   UINT8 flags = 0;
r17691r17692
310310      }
311311   }
312312
313   SET_TILE_INFO_DEVICE(
313   SET_TILE_INFO_MEMBER(
314314         deco16ic->pf12_8x8_gfx_bank,
315315         (tile & 0xfff) | deco16ic->pf2_bank,
316316         (colour & deco16ic->pf2_colourmask) + deco16ic->pf2_colour_bank,
317317         flags);
318318}
319319
320static TILE_GET_INFO_DEVICE( get_pf1_tile_info_b )
320TILE_GET_INFO_MEMBER(deco16ic_device::get_pf1_tile_info_b)
321321{
322   deco16ic_state *deco16ic = get_safe_token(device);
322   deco16ic_state *deco16ic = get_safe_token(this);
323323   UINT16 tile = deco16ic->pf1_data[tile_index];
324324   UINT8 colour = (tile >> 12) & 0xf;
325325   UINT8 flags = 0;
r17691r17692
338338      }
339339   }
340340
341   SET_TILE_INFO_DEVICE(
341   SET_TILE_INFO_MEMBER(
342342         deco16ic->pf12_8x8_gfx_bank,
343343         (tile & 0xfff) | deco16ic->pf1_bank,
344344         (colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank,
r17691r17692
899899   custom_tilemap_draw(device, bitmap, cliprect, 0, deco16ic->pf1_tilemap_16x16, 0, deco16ic->pf2_tilemap_16x16, deco16ic->pf1_rowscroll_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff, 0xf, 4, 0xff, flags, priority, is_tattoo);
900900}
901901
902const device_type DECO16IC = &device_creator<deco16ic_device>;
902903
903/*****************************************************************************
904    DEVICE INTERFACE
905*****************************************************************************/
904deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
905   : device_t(mconfig, DECO16IC, "Data East IC 55 / 56 / 74 / 141", tag, owner, clock)
906{
907   m_token = global_alloc_array_clear(UINT8, sizeof(deco16ic_state));
908}
906909
907static DEVICE_START( deco16ic )
910//-------------------------------------------------
911//  device_config_complete - perform any
912//  operations now that the configuration is
913//  complete
914//-------------------------------------------------
915
916void deco16ic_device::device_config_complete()
908917{
909   deco16ic_state *deco16ic = get_safe_token(device);
910   const deco16ic_interface *intf = get_interface(device);
918}
911919
920//-------------------------------------------------
921//  device_start - device-specific startup
922//-------------------------------------------------
923
924void deco16ic_device::device_start()
925{
926   deco16ic_state *deco16ic = get_safe_token(this);
927   const deco16ic_interface *intf = get_interface(this);
928
912929   deco16ic->bank_cb[0] = intf->bank_cb0;
913930   deco16ic->bank_cb[1] = intf->bank_cb1;
914931
r17691r17692
930947   if (intf->full_width12&1)
931948      fullwidth = 1;
932949
933   deco16ic->pf1_tilemap_16x16 =   tilemap_create_device(device, get_pf1_tile_info, deco16_scan_rows, 16, 16, fullwidth ? 64 : 32, fullheight ?64 : 32);
934//  deco16ic->pf1_tilemap_8x8 = tilemap_create_device(device, get_pf1_tile_info_b, TILEMAP_SCAN_ROWS, 8, 8, intf->full_width12 ? 64 : 32, 32);
935   deco16ic->pf1_tilemap_8x8 = tilemap_create_device(device, get_pf1_tile_info_b, TILEMAP_SCAN_ROWS, 8, 8, 64 , 32); // nitroball
950   deco16ic->pf1_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ?64 : 32);
951//  deco16ic->pf1_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, intf->full_width12 ? 64 : 32, 32);
952   deco16ic->pf1_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, 64 , 32); // nitroball
936953
937954   deco16ic->pf12_8x8_gfx_bank = intf->_8x8_gfxregion;
938955   deco16ic->pf12_16x16_gfx_bank = intf->_16x16_gfxregion;
939956
940957   if (intf->split)
941      deco16ic->pf2_tilemap_16x16 =   tilemap_create_device(device, get_pf2_tile_info, deco16_scan_rows, 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32);
958      deco16ic->pf2_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32);
942959   else
943      deco16ic->pf2_tilemap_16x16 =   tilemap_create_device(device, get_pf2_tile_info, deco16_scan_rows, 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32);
960      deco16ic->pf2_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32);
944961
945   deco16ic->pf2_tilemap_8x8 = tilemap_create_device(device, get_pf2_tile_info_b, TILEMAP_SCAN_ROWS, 8, 8, fullwidth ? 64 : 32, fullheight ? 64 : 32);
962   deco16ic->pf2_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, fullwidth ? 64 : 32, fullheight ? 64 : 32);
946963
947964   deco16ic->pf1_tilemap_8x8->set_transparent_pen(0);
948965   deco16ic->pf2_tilemap_8x8->set_transparent_pen(0);
r17691r17692
954971
955972   deco16ic->pf1_8bpp_mode = 0;
956973
957   deco16ic->pf1_data = auto_alloc_array_clear(device->machine(), UINT16, 0x2000 / 2);
958   deco16ic->pf2_data = auto_alloc_array_clear(device->machine(), UINT16, 0x2000 / 2);
959   deco16ic->pf12_control = auto_alloc_array_clear(device->machine(), UINT16, 0x10 / 2);
974   deco16ic->pf1_data = auto_alloc_array_clear(machine(), UINT16, 0x2000 / 2);
975   deco16ic->pf2_data = auto_alloc_array_clear(machine(), UINT16, 0x2000 / 2);
976   deco16ic->pf12_control = auto_alloc_array_clear(machine(), UINT16, 0x10 / 2);
960977
961978
962   device->save_item(NAME(deco16ic->use_custom_pf1));
963   device->save_item(NAME(deco16ic->use_custom_pf2));
964   device->save_item(NAME(deco16ic->pf1_bank));
965   device->save_item(NAME(deco16ic->pf2_bank));
966   device->save_item(NAME(deco16ic->pf12_8x8_gfx_bank));
967   device->save_item(NAME(deco16ic->pf12_16x16_gfx_bank));
968   device->save_item(NAME(deco16ic->pf12_last_small));
969   device->save_item(NAME(deco16ic->pf12_last_big));
979   save_item(NAME(deco16ic->use_custom_pf1));
980   save_item(NAME(deco16ic->use_custom_pf2));
981   save_item(NAME(deco16ic->pf1_bank));
982   save_item(NAME(deco16ic->pf2_bank));
983   save_item(NAME(deco16ic->pf12_8x8_gfx_bank));
984   save_item(NAME(deco16ic->pf12_16x16_gfx_bank));
985   save_item(NAME(deco16ic->pf12_last_small));
986   save_item(NAME(deco16ic->pf12_last_big));
970987
971   device->save_item(NAME(deco16ic->pf1_8bpp_mode));
988   save_item(NAME(deco16ic->pf1_8bpp_mode));
972989
973   device->save_pointer(NAME(deco16ic->pf1_data), 0x2000 / 2);
974   device->save_pointer(NAME(deco16ic->pf2_data), 0x2000 / 2);
975   device->save_pointer(NAME(deco16ic->pf12_control), 0x10 / 2);
976
990   save_pointer(NAME(deco16ic->pf1_data), 0x2000 / 2);
991   save_pointer(NAME(deco16ic->pf2_data), 0x2000 / 2);
992   save_pointer(NAME(deco16ic->pf12_control), 0x10 / 2);
977993}
978994
979static DEVICE_RESET( deco16ic )
995//-------------------------------------------------
996//  device_reset - device-specific reset
997//-------------------------------------------------
998
999void deco16ic_device::device_reset()
9801000{
981   deco16ic_state *deco16ic = get_safe_token(device);
1001   deco16ic_state *deco16ic = get_safe_token(this);
9821002
9831003   deco16ic->pf1_bank = deco16ic->pf2_bank = 0;
9841004   deco16ic->pf12_last_small = deco16ic->pf12_last_big = -1;
r17691r17692
9881008}
9891009
9901010
991const device_type DECO16IC = &device_creator<deco16ic_device>;
992
993deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
994   : device_t(mconfig, DECO16IC, "Data East IC 55 / 56 / 74 / 141", tag, owner, clock)
995{
996   m_token = global_alloc_array_clear(UINT8, sizeof(deco16ic_state));
997}
998
999//-------------------------------------------------
1000//  device_config_complete - perform any
1001//  operations now that the configuration is
1002//  complete
1003//-------------------------------------------------
1004
1005void deco16ic_device::device_config_complete()
1006{
1007}
1008
1009//-------------------------------------------------
1010//  device_start - device-specific startup
1011//-------------------------------------------------
1012
1013void deco16ic_device::device_start()
1014{
1015   DEVICE_START_NAME( deco16ic )(this);
1016}
1017
1018//-------------------------------------------------
1019//  device_reset - device-specific reset
1020//-------------------------------------------------
1021
1022void deco16ic_device::device_reset()
1023{
1024   DEVICE_RESET_NAME( deco16ic )(this);
1025}
1026
1027
trunk/src/mame/video/deco16ic.h
r17691r17692
4242   ~deco16ic_device() { global_free(m_token); }
4343
4444   // access to legacy token
45   void *token() const { assert(m_token != NULL); return m_token; }
45   void *token() const { assert(m_token != NULL); return m_token; }   
4646protected:
4747   // device-level overrides
4848   virtual void device_config_complete();
r17691r17692
5151private:
5252   // internal state
5353   void *m_token;
54
55   TILEMAP_MAPPER_MEMBER(deco16_scan_rows);
56   TILE_GET_INFO_MEMBER(get_pf2_tile_info);
57   TILE_GET_INFO_MEMBER(get_pf1_tile_info);
58   TILE_GET_INFO_MEMBER(get_pf2_tile_info_b);
59   TILE_GET_INFO_MEMBER(get_pf1_tile_info_b);   
5460};
5561
5662extern const device_type DECO16IC;
trunk/src/mame/video/kaneko_tmap.c
r17691r17692
122122   dev.m_invert_flip = invert_flip;
123123}
124124
125void kaneko_view2_tilemap_device::get_tile_info(kaneko_view2_tilemap_device *device, tile_data &tileinfo, tilemap_memory_index tile_index, int _N_)
125void kaneko_view2_tilemap_device::get_tile_info(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_)
126126{
127127   UINT16 code_hi = m_vram[_N_][ 2 * tile_index + 0];
128128   UINT16 code_lo = m_vram[_N_][ 2 * tile_index + 1];
129   SET_TILE_INFO_DEVICE(m_tilebase, code_lo + m_vram_tile_addition[_N_], (code_hi >> 2) & 0x3f, TILE_FLIPXY( code_hi & 3 ));
129   SET_TILE_INFO_MEMBER(m_tilebase, code_lo + m_vram_tile_addition[_N_], (code_hi >> 2) & 0x3f, TILE_FLIPXY( code_hi & 3 ));
130130   tileinfo.category   =   (code_hi >> 8) & 7;
131131}
132132
133static TILE_GET_INFO_DEVICE( get_tile_info_0 ) { kaneko_view2_tilemap_device *dev = (kaneko_view2_tilemap_device*)device;  dev->get_tile_info(dev, tileinfo, tile_index, 0); }
134static TILE_GET_INFO_DEVICE( get_tile_info_1 ) { kaneko_view2_tilemap_device *dev = (kaneko_view2_tilemap_device*)device;  dev->get_tile_info(dev, tileinfo, tile_index, 1); }
133TILE_GET_INFO_MEMBER(kaneko_view2_tilemap_device::get_tile_info_0) { get_tile_info(tileinfo, tile_index, 0); }
134TILE_GET_INFO_MEMBER(kaneko_view2_tilemap_device::get_tile_info_1) { get_tile_info(tileinfo, tile_index, 1); }
135135
136136
137137void kaneko_view2_tilemap_device::device_start()
r17691r17692
142142   m_vscroll[1] = (UINT16*)auto_alloc_array_clear(this->machine(), UINT16, 0x1000/2);
143143   m_regs = (UINT16*)auto_alloc_array_clear(this->machine(), UINT16, 0x20/2);
144144
145   m_tmap[0] = tilemap_create_device(   this, get_tile_info_0, TILEMAP_SCAN_ROWS,
145   m_tmap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kaneko_view2_tilemap_device::get_tile_info_0),this), TILEMAP_SCAN_ROWS,
146146                               16,16, 0x20,0x20   );
147   m_tmap[1] = tilemap_create_device(   this, get_tile_info_1, TILEMAP_SCAN_ROWS,
147   m_tmap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kaneko_view2_tilemap_device::get_tile_info_1),this), TILEMAP_SCAN_ROWS,
148148                               16,16, 0x20,0x20   );
149149
150150   m_tmap[0]->set_transparent_pen(0);
trunk/src/mame/video/kaneko_tmap.h
r17691r17692
2121   tilemap_t* m_tmap[2];
2222   UINT16 m_vram_tile_addition[2]; // galsnew
2323
24   void get_tile_info(kaneko_view2_tilemap_device *device, tile_data &tileinfo, tilemap_memory_index tile_index, int _N_);
24   void get_tile_info(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_);
2525   void kaneko16_vram_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _N_);
2626
2727   // call to do the rendering etc.
r17691r17692
5858   virtual void device_reset();
5959
6060private:
61
62
61   TILE_GET_INFO_MEMBER(get_tile_info_0);
62   TILE_GET_INFO_MEMBER(get_tile_info_1);
6363};
6464
6565
trunk/src/mame/video/konicdev.c
r17691r17692
15771577      k007121->ctrlram[i] = 0;
15781578}
15791579
1580const device_type K007121 = &device_creator<k007121_device>;
15801581
1582k007121_device::k007121_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1583   : device_t(mconfig, K007121, "Konami 007121", tag, owner, clock)
1584{
1585   m_token = global_alloc_array_clear(UINT8, sizeof(k007121_state));
1586}
1587
1588//-------------------------------------------------
1589//  device_config_complete - perform any
1590//  operations now that the configuration is
1591//  complete
1592//-------------------------------------------------
1593
1594void k007121_device::device_config_complete()
1595{
1596}
1597
1598//-------------------------------------------------
1599//  device_start - device-specific startup
1600//-------------------------------------------------
1601
1602void k007121_device::device_start()
1603{
1604   DEVICE_START_NAME( k007121 )(this);
1605}
1606
1607//-------------------------------------------------
1608//  device_reset - device-specific reset
1609//-------------------------------------------------
1610
1611void k007121_device::device_reset()
1612{
1613   DEVICE_RESET_NAME( k007121 )(this);
1614}
1615
15811616/***************************************************************************/
15821617/*                                                                         */
15831618/*                                 007342                                  */
r17691r17692
17781813  color RAM     ----xxxx    depends on external connections (usually color and banking)
17791814*/
17801815
1781static TILEMAP_MAPPER( k007342_scan )
1816TILEMAP_MAPPER_MEMBER(k007342_device::k007342_scan)
17821817{
17831818   /* logical (col,row) -> memory offset */
17841819   return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5);
17851820}
17861821
1787INLINE void k007342_get_tile_info( device_t *device, tile_data &tileinfo, int tile_index, int layer, UINT8 *cram, UINT8 *vram )
1822INLINE void k007342_get_tile_info( running_machine &machine, device_t *device, tile_data &tileinfo, int tile_index, int layer, UINT8 *cram, UINT8 *vram )
17881823{
17891824   k007342_state *k007342 = k007342_get_safe_token(device);
17901825   int color, code, flags;
r17691r17692
17971832
17981833   k007342->callback(device->machine(), layer, k007342->regs[1], &code, &color, &flags);
17991834
1800   SET_TILE_INFO_DEVICE(
1835   SET_TILE_INFO(
18011836         k007342->gfxnum,
18021837         code,
18031838         color,
18041839         flags);
18051840}
18061841
1807static TILE_GET_INFO_DEVICE( k007342_get_tile_info0 )
1842TILE_GET_INFO_MEMBER(k007342_device::k007342_get_tile_info0)
18081843{
1809   k007342_state *k007342 = k007342_get_safe_token(device);
1810   k007342_get_tile_info(device, tileinfo, tile_index, 0, k007342->colorram_0, k007342->videoram_0);
1844   k007342_state *k007342 = k007342_get_safe_token(this);
1845   k007342_get_tile_info(machine(), this, tileinfo, tile_index, 0, k007342->colorram_0, k007342->videoram_0);
18111846}
18121847
1813static TILE_GET_INFO_DEVICE( k007342_get_tile_info1 )
1848TILE_GET_INFO_MEMBER(k007342_device::k007342_get_tile_info1)
18141849{
1815   k007342_state *k007342 = k007342_get_safe_token(device);
1816   k007342_get_tile_info(device, tileinfo, tile_index, 1, k007342->colorram_1, k007342->videoram_1);
1850   k007342_state *k007342 = k007342_get_safe_token(this);
1851   k007342_get_tile_info(machine(), this, tileinfo, tile_index, 1, k007342->colorram_1, k007342->videoram_1);
18171852}
18181853
1854const device_type K007342 = &device_creator<k007342_device>;
18191855
1820/*****************************************************************************
1821    DEVICE INTERFACE
1822*****************************************************************************/
1856k007342_device::k007342_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1857   : device_t(mconfig, K007342, "Konami 007342", tag, owner, clock)
1858{
1859   m_token = global_alloc_array_clear(UINT8, sizeof(k007342_state));
1860}
18231861
1824static DEVICE_START( k007342 )
1862//-------------------------------------------------
1863//  device_config_complete - perform any
1864//  operations now that the configuration is
1865//  complete
1866//-------------------------------------------------
1867
1868void k007342_device::device_config_complete()
18251869{
1826   k007342_state *k007342 = k007342_get_safe_token(device);
1827   const k007342_interface *intf = k007342_get_interface(device);
1870}
18281871
1872//-------------------------------------------------
1873//  device_start - device-specific startup
1874//-------------------------------------------------
1875
1876void k007342_device::device_start()
1877{
1878   k007342_state *k007342 = k007342_get_safe_token(this);
1879   const k007342_interface *intf = k007342_get_interface(this);
1880
18291881   k007342->gfxnum = intf->gfxnum;
18301882   k007342->callback = intf->callback;
18311883
1832   k007342->tilemap[0] = tilemap_create_device(device, k007342_get_tile_info0, k007342_scan, 8, 8, 64, 32);
1833   k007342->tilemap[1] = tilemap_create_device(device, k007342_get_tile_info1, k007342_scan, 8, 8, 64, 32);
1884   k007342->tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k007342_device::k007342_get_tile_info0),this), tilemap_mapper_delegate(FUNC(k007342_device::k007342_scan),this), 8, 8, 64, 32);
1885   k007342->tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k007342_device::k007342_get_tile_info1),this), tilemap_mapper_delegate(FUNC(k007342_device::k007342_scan),this), 8, 8, 64, 32);
18341886
1835   k007342->ram = auto_alloc_array(device->machine(), UINT8, 0x2000);
1836   k007342->scroll_ram = auto_alloc_array(device->machine(), UINT8, 0x0200);
1887   k007342->ram = auto_alloc_array(machine(), UINT8, 0x2000);
1888   k007342->scroll_ram = auto_alloc_array(machine(), UINT8, 0x0200);
18371889
18381890   k007342->colorram_0 = &k007342->ram[0x0000];
18391891   k007342->colorram_1 = &k007342->ram[0x1000];
r17691r17692
18431895   k007342->tilemap[0]->set_transparent_pen(0);
18441896   k007342->tilemap[1]->set_transparent_pen(0);
18451897
1846   device->save_pointer(NAME(k007342->ram), 0x2000);
1847   device->save_pointer(NAME(k007342->scroll_ram), 0x0200);
1848   device->save_item(NAME(k007342->int_enabled));
1849   device->save_item(NAME(k007342->flipscreen));
1850   device->save_item(NAME(k007342->scrollx));
1851   device->save_item(NAME(k007342->scrolly));
1852   device->save_item(NAME(k007342->regs));
1898   save_pointer(NAME(k007342->ram), 0x2000);
1899   save_pointer(NAME(k007342->scroll_ram), 0x0200);
1900   save_item(NAME(k007342->int_enabled));
1901   save_item(NAME(k007342->flipscreen));
1902   save_item(NAME(k007342->scrollx));
1903   save_item(NAME(k007342->scrolly));
1904   save_item(NAME(k007342->regs));
18531905}
18541906
1855static DEVICE_RESET( k007342 )
1907//-------------------------------------------------
1908//  device_reset - device-specific reset
1909//-------------------------------------------------
1910
1911void k007342_device::device_reset()
18561912{
1857   k007342_state *k007342 = k007342_get_safe_token(device);
1913   k007342_state *k007342 = k007342_get_safe_token(this);
18581914   int i;
18591915
18601916   k007342->int_enabled = 0;
r17691r17692
18691925}
18701926
18711927
1928
18721929/***************************************************************************/
18731930/*                                                                         */
18741931/*                                 007420                                  */
r17691r17692
21282185}
21292186
21302187
2188const device_type K007420 = &device_creator<k007420_device>;
2189
2190k007420_device::k007420_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2191   : device_t(mconfig, K007420, "Konami 007420", tag, owner, clock)
2192{
2193   m_token = global_alloc_array_clear(UINT8, sizeof(k007420_state));
2194}
2195
2196//-------------------------------------------------
2197//  device_config_complete - perform any
2198//  operations now that the configuration is
2199//  complete
2200//-------------------------------------------------
2201
2202void k007420_device::device_config_complete()
2203{
2204}
2205
2206//-------------------------------------------------
2207//  device_start - device-specific startup
2208//-------------------------------------------------
2209
2210void k007420_device::device_start()
2211{
2212   DEVICE_START_NAME( k007420 )(this);
2213}
2214
2215//-------------------------------------------------
2216//  device_reset - device-specific reset
2217//-------------------------------------------------
2218
2219void k007420_device::device_reset()
2220{
2221   DEVICE_RESET_NAME( k007420 )(this);
2222}
2223
21312224/***************************************************************************/
21322225/*                                                                         */
21332226/*                                 052109                                  */
r17691r17692
26002693  color RAM    ------xx  depends on external connections (usually banking, flip)
26012694*/
26022695
2603INLINE void k052109_get_tile_info( device_t *device, tile_data &tileinfo, int tile_index, int layer, UINT8 *cram, UINT8 *vram1, UINT8 *vram2 )
2696INLINE void k052109_get_tile_info( running_machine &machine, device_t *device, tile_data &tileinfo, int tile_index, int layer, UINT8 *cram, UINT8 *vram1, UINT8 *vram2 )
26042697{
26052698   k052109_state *k052109 = k052109_get_safe_token(device);
26062699   int flipy = 0;
r17691r17692
26272720   if (flipy && (k052109->tileflip_enable & 2))
26282721      flags |= TILE_FLIPY;
26292722
2630   SET_TILE_INFO_DEVICE(
2723   SET_TILE_INFO(
26312724         k052109->gfxnum,
26322725         code,
26332726         color,
r17691r17692
26362729   tileinfo.category = priority;
26372730}
26382731
2639static TILE_GET_INFO_DEVICE( k052109_get_tile_info0 )
2732TILE_GET_INFO_MEMBER(k052109_device::k052109_get_tile_info0)
26402733{
2641   k052109_state *k052109 = k052109_get_safe_token(device);
2642   k052109_get_tile_info(device, tileinfo, tile_index, 0, k052109->colorram_F, k052109->videoram_F, k052109->videoram2_F);
2734   k052109_state *k052109 = k052109_get_safe_token(this);
2735   k052109_get_tile_info(machine(), this, tileinfo, tile_index, 0, k052109->colorram_F, k052109->videoram_F, k052109->videoram2_F);
26432736}
26442737
2645static TILE_GET_INFO_DEVICE( k052109_get_tile_info1 )
2738TILE_GET_INFO_MEMBER(k052109_device::k052109_get_tile_info1)
26462739{
2647   k052109_state *k052109 = k052109_get_safe_token(device);
2648   k052109_get_tile_info(device, tileinfo, tile_index, 1, k052109->colorram_A, k052109->videoram_A, k052109->videoram2_A);
2740   k052109_state *k052109 = k052109_get_safe_token(this);
2741   k052109_get_tile_info(machine(), this, tileinfo, tile_index, 1, k052109->colorram_A, k052109->videoram_A, k052109->videoram2_A);
26492742}
26502743
2651static TILE_GET_INFO_DEVICE( k052109_get_tile_info2 )
2744TILE_GET_INFO_MEMBER(k052109_device::k052109_get_tile_info2)
26522745{
2653   k052109_state *k052109 = k052109_get_safe_token(device);
2654   k052109_get_tile_info(device, tileinfo, tile_index, 2, k052109->colorram_B, k052109->videoram_B, k052109->videoram2_B);
2746   k052109_state *k052109 = k052109_get_safe_token(this);
2747   k052109_get_tile_info(machine(), this, tileinfo, tile_index, 2, k052109->colorram_B, k052109->videoram_B, k052109->videoram2_B);
26552748}
26562749
26572750
r17691r17692
26642757   k052109->tileflip_enable = ((data & 0x06) >> 1);
26652758}
26662759
2667static DEVICE_START( k052109 )
2760const device_type K052109 = &device_creator<k052109_device>;
2761
2762k052109_device::k052109_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2763   : device_t(mconfig, K052109, "Konami 052109", tag, owner, clock)
26682764{
2669   k052109_state *k052109 = k052109_get_safe_token(device);
2670   const k052109_interface *intf = k052109_get_interface(device);
2671   running_machine &machine = device->machine();
2765   m_token = global_alloc_array_clear(UINT8, sizeof(k052109_state));
2766}
2767
2768//-------------------------------------------------
2769//  device_config_complete - perform any
2770//  operations now that the configuration is
2771//  complete
2772//-------------------------------------------------
2773
2774void k052109_device::device_config_complete()
2775{
2776}
2777
2778//-------------------------------------------------
2779//  device_start - device-specific startup
2780//-------------------------------------------------
2781
2782void k052109_device::device_start()
2783{
2784   k052109_state *k052109 = k052109_get_safe_token(this);
2785   const k052109_interface *intf = k052109_get_interface(this);
26722786   UINT32 total;
26732787   static const gfx_layout charlayout =
26742788   {
r17691r17692
26962810   switch (intf->plane_order)
26972811   {
26982812   case NORMAL_PLANE_ORDER:
2699      total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 32;
2700      decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout, 4);
2813      total = machine().root_device().memregion(intf->gfx_memory_region)->bytes() / 32;
2814      decode_gfx(machine(), intf->gfx_num, machine().root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout, 4);
27012815      break;
27022816
27032817   case GRADIUS3_PLANE_ORDER:
27042818      total = 0x1000;
2705      decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout_gradius3, 4);
2819      decode_gfx(machine(), intf->gfx_num, machine().root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout_gradius3, 4);
27062820      break;
27072821
27082822   default:
r17691r17692
27102824   }
27112825
27122826   /* deinterleave the graphics, if needed */
2713   deinterleave_gfx(machine, intf->gfx_memory_region, intf->deinterleave);
2827   deinterleave_gfx(machine(), intf->gfx_memory_region, intf->deinterleave);
27142828
27152829   k052109->memory_region = intf->gfx_memory_region;
27162830   k052109->gfxnum = intf->gfx_num;
27172831   k052109->callback = intf->callback;
27182832
2719   k052109->tilemap[0] = tilemap_create_device(device, k052109_get_tile_info0, TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
2720   k052109->tilemap[1] = tilemap_create_device(device, k052109_get_tile_info1, TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
2721   k052109->tilemap[2] = tilemap_create_device(device, k052109_get_tile_info2, TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
2833   k052109->tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k052109_device::k052109_get_tile_info0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
2834   k052109->tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k052109_device::k052109_get_tile_info1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
2835   k052109->tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k052109_device::k052109_get_tile_info2),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
27222836
2723   k052109->ram = auto_alloc_array_clear(machine, UINT8, 0x6000);
2837   k052109->ram = auto_alloc_array_clear(machine(), UINT8, 0x6000);
27242838
27252839   k052109->colorram_F = &k052109->ram[0x0000];
27262840   k052109->colorram_A = &k052109->ram[0x0800];
r17691r17692
27362850   k052109->tilemap[1]->set_transparent_pen(0);
27372851   k052109->tilemap[2]->set_transparent_pen(0);
27382852
2739   device->save_pointer(NAME(k052109->ram), 0x6000);
2740   device->save_item(NAME(k052109->rmrd_line));
2741   device->save_item(NAME(k052109->romsubbank));
2742   device->save_item(NAME(k052109->scrollctrl));
2743   device->save_item(NAME(k052109->irq_enabled));
2744   device->save_item(NAME(k052109->charrombank));
2745   device->save_item(NAME(k052109->charrombank_2));
2746   device->save_item(NAME(k052109->dx));
2747   device->save_item(NAME(k052109->dy));
2748   device->save_item(NAME(k052109->has_extra_video_ram));
2749   device->machine().save().register_postload(save_prepost_delegate(FUNC(k052109_tileflip_reset), k052109));
2853   save_pointer(NAME(k052109->ram), 0x6000);
2854   save_item(NAME(k052109->rmrd_line));
2855   save_item(NAME(k052109->romsubbank));
2856   save_item(NAME(k052109->scrollctrl));
2857   save_item(NAME(k052109->irq_enabled));
2858   save_item(NAME(k052109->charrombank));
2859   save_item(NAME(k052109->charrombank_2));
2860   save_item(NAME(k052109->dx));
2861   save_item(NAME(k052109->dy));
2862   save_item(NAME(k052109->has_extra_video_ram));
2863   machine().save().register_postload(save_prepost_delegate(FUNC(k052109_tileflip_reset), k052109));
27502864}
27512865
2752static DEVICE_RESET( k052109 )
2866//-------------------------------------------------
2867//  device_reset - device-specific reset
2868//-------------------------------------------------
2869
2870void k052109_device::device_reset()
27532871{
2754   k052109_state *k052109 = k052109_get_safe_token(device);
2872   k052109_state *k052109 = k052109_get_safe_token(this);
27552873   int i;
27562874
27572875   k052109->rmrd_line = CLEAR_LINE;
r17691r17692
27712889   }
27722890}
27732891
2892
2893
27742894/***************************************************************************/
27752895/*                                                                         */
27762896/*                                 051960                                  */
r17691r17692
33083428   k051960->spriterombank[2] = 0;
33093429}
33103430
3431
3432const device_type K051960 = &device_creator<k051960_device>;
3433
3434k051960_device::k051960_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
3435   : device_t(mconfig, K051960, "Konami 051960", tag, owner, clock)
3436{
3437   m_token = global_alloc_array_clear(UINT8, sizeof(k051960_state));
3438}
3439
3440//-------------------------------------------------
3441//  device_config_complete - perform any
3442//  operations now that the configuration is
3443//  complete
3444//-------------------------------------------------
3445
3446void k051960_device::device_config_complete()
3447{
3448}
3449
3450//-------------------------------------------------
3451//  device_start - device-specific startup
3452//-------------------------------------------------
3453
3454void k051960_device::device_start()
3455{
3456   DEVICE_START_NAME( k051960 )(this);
3457}
3458
3459//-------------------------------------------------
3460//  device_reset - device-specific reset
3461//-------------------------------------------------
3462
3463void k051960_device::device_reset()
3464{
3465   DEVICE_RESET_NAME( k051960 )(this);
3466}
3467
33113468/***************************************************************************/
33123469/*                                                                         */
33133470/*                      05324x Family Sprite Generators                    */
r17691r17692
41034260      k05324x->regs[i] = 0;
41044261}
41054262
4263
4264const device_type K053244 = &device_creator<k05324x_device>;
4265
4266k05324x_device::k05324x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
4267   : device_t(mconfig, K053244, "Konami 053244 & 053245", tag, owner, clock)
4268{
4269   m_token = global_alloc_array_clear(UINT8, sizeof(k05324x_state));
4270}
4271
4272//-------------------------------------------------
4273//  device_config_complete - perform any
4274//  operations now that the configuration is
4275//  complete
4276//-------------------------------------------------
4277
4278void k05324x_device::device_config_complete()
4279{
4280}
4281
4282//-------------------------------------------------
4283//  device_start - device-specific startup
4284//-------------------------------------------------
4285
4286void k05324x_device::device_start()
4287{
4288   DEVICE_START_NAME( k05324x )(this);
4289}
4290
4291//-------------------------------------------------
4292//  device_reset - device-specific reset
4293//-------------------------------------------------
4294
4295void k05324x_device::device_reset()
4296{
4297   DEVICE_RESET_NAME( k05324x )(this);
4298}
4299
41064300/***************************************************************************/
41074301/*                                                                         */
41084302/*                                 053246/053247                           */
r17691r17692
50765270   memset(k053247->kx47_regs, 0, 32);
50775271}
50785272
5273
5274const device_type K055673 = &device_creator<k055673_device>;
5275
5276k055673_device::k055673_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5277   : device_t(mconfig, K055673, "Konami 055673", tag, owner, clock)
5278{
5279   m_token = global_alloc_array_clear(UINT8, sizeof(k053247_state));
5280}
5281
5282//-------------------------------------------------
5283//  device_config_complete - perform any
5284//  operations now that the configuration is
5285//  complete
5286//-------------------------------------------------
5287
5288void k055673_device::device_config_complete()
5289{
5290}
5291
5292//-------------------------------------------------
5293//  device_start - device-specific startup
5294//-------------------------------------------------
5295
5296void k055673_device::device_start()
5297{
5298   DEVICE_START_NAME( k055673 )(this);
5299}
5300
5301//-------------------------------------------------
5302//  device_reset - device-specific reset
5303//-------------------------------------------------
5304
5305void k055673_device::device_reset()
5306{
5307   DEVICE_RESET_NAME( k053247 )(this);
5308}
5309
5310const device_type K053246 = &device_creator<k053247_device>;
5311
5312k053247_device::k053247_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5313   : device_t(mconfig, K053246, "Konami 053246 & 053247", tag, owner, clock)
5314{
5315   m_token = global_alloc_array_clear(UINT8, sizeof(k053247_state));
5316}
5317
5318//-------------------------------------------------
5319//  device_config_complete - perform any
5320//  operations now that the configuration is
5321//  complete
5322//-------------------------------------------------
5323
5324void k053247_device::device_config_complete()
5325{
5326}
5327
5328//-------------------------------------------------
5329//  device_start - device-specific startup
5330//-------------------------------------------------
5331
5332void k053247_device::device_start()
5333{
5334   DEVICE_START_NAME( k053247 )(this);
5335}
5336
5337//-------------------------------------------------
5338//  device_reset - device-specific reset
5339//-------------------------------------------------
5340
5341void k053247_device::device_reset()
5342{
5343   DEVICE_RESET_NAME( k053247 )(this);
5344}
5345
5346
50795347/*
50805348    In a K053247+K055555 setup objects with Z-code 0x00 should be ignored
50815349    when PRFLIP is cleared, while objects with Z-code 0xff should be
r17691r17692
52085476
52095477***************************************************************************/
52105478
5211INLINE void k051316_get_tile_info( device_t *device, tile_data &tileinfo, int tile_index )
5479INLINE void k051316_get_tile_info( running_machine &machine, device_t *device, tile_data &tileinfo, int tile_index )
52125480{
52135481   k051316_state *k051316 = k051316_get_safe_token(device);
52145482   int code = k051316->ram[tile_index];
r17691r17692
52175485
52185486   k051316->callback(device->machine(), &code, &color, &flags);
52195487
5220   SET_TILE_INFO_DEVICE(
5488   SET_TILE_INFO(
52215489         k051316->gfxnum,
52225490         code,
52235491         color,
r17691r17692
52255493}
52265494
52275495
5228static TILE_GET_INFO_DEVICE( k051316_get_tile_info0 ) { k051316_get_tile_info(device, tileinfo, tile_index); }
5496TILE_GET_INFO_MEMBER(k051316_device::k051316_get_tile_info0) { k051316_get_tile_info(machine(), this, tileinfo, tile_index); }
52295497
52305498
52315499void k051316_zoom_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority )
r17691r17692
52735541#endif
52745542}
52755543
5544const device_type K051316 = &device_creator<k051316_device>;
52765545
5277/*****************************************************************************
5278    DEVICE INTERFACE
5279*****************************************************************************/
5546k051316_device::k051316_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5547   : device_t(mconfig, K051316, "Konami 051316", tag, owner, clock)
5548{
5549   m_token = global_alloc_array_clear(UINT8, sizeof(k051316_state));
5550}
52805551
5281static DEVICE_START( k051316 )
5552//-------------------------------------------------
5553//  device_config_complete - perform any
5554//  operations now that the configuration is
5555//  complete
5556//-------------------------------------------------
5557
5558void k051316_device::device_config_complete()
52825559{
5283   k051316_state *k051316 = k051316_get_safe_token(device);
5284   const k051316_interface *intf = k051316_get_interface(device);
5285   running_machine &machine = device->machine();
5560}
52865561
5562//-------------------------------------------------
5563//  device_start - device-specific startup
5564//-------------------------------------------------
5565
5566void k051316_device::device_start()
5567{
5568   k051316_state *k051316 = k051316_get_safe_token(this);
5569   const k051316_interface *intf = k051316_get_interface(this);
5570
52875571   int is_tail2nos = 0;
52885572   UINT32 total;
52895573
r17691r17692
53455629   case -4:
53465630      total = 0x400;
53475631      is_tail2nos = 1;
5348      decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout_tail2nos, 4);
5632      decode_gfx(machine(), intf->gfx_num, machine().root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout_tail2nos, 4);
53495633      break;
53505634
53515635   case 4:
5352      total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 128;
5353      decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout4, 4);
5636      total = machine().root_device().memregion(intf->gfx_memory_region)->bytes() / 128;
5637      decode_gfx(machine(), intf->gfx_num, machine().root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout4, 4);
53545638      break;
53555639
53565640   case 7:
5357      total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 256;
5358      decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout7, 7);
5641      total = machine().root_device().memregion(intf->gfx_memory_region)->bytes() / 256;
5642      decode_gfx(machine(), intf->gfx_num, machine().root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout7, 7);
53595643      break;
53605644
53615645   case 8:
5362      total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 256;
5363      decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout8, 8);
5646      total = machine().root_device().memregion(intf->gfx_memory_region)->bytes() / 256;
5647      decode_gfx(machine(), intf->gfx_num, machine().root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout8, 8);
53645648      break;
53655649
53665650   default:
r17691r17692
53725656   k051316->bpp = is_tail2nos ? 4 : intf->bpp;   // tail2nos is passed with bpp = -4 to setup the custom charlayout!
53735657   k051316->callback = intf->callback;
53745658
5375   k051316->tmap = tilemap_create_device(device, k051316_get_tile_info0, TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
5659   k051316->tmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k051316_device::k051316_get_tile_info0),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
53765660
5377   k051316->ram = auto_alloc_array(machine, UINT8, 0x800);
5661   k051316->ram = auto_alloc_array(machine(), UINT8, 0x800);
53785662
53795663   if (!intf->pen_is_mask)
53805664      k051316->tmap->set_transparent_pen(intf->transparent_pen);
r17691r17692
53885672   k051316->offset[0] = intf->xoffs;
53895673   k051316->offset[1] = intf->yoffs;
53905674
5391   device->save_pointer(NAME(k051316->ram), 0x800);
5392   device->save_item(NAME(k051316->ctrlram));
5393   device->save_item(NAME(k051316->wraparound));
5675   save_pointer(NAME(k051316->ram), 0x800);
5676   save_item(NAME(k051316->ctrlram));
5677   save_item(NAME(k051316->wraparound));
5678
53945679}
53955680
5396static DEVICE_RESET( k051316 )
5681//-------------------------------------------------
5682//  device_reset - device-specific reset
5683//-------------------------------------------------
5684
5685void k051316_device::device_reset()
53975686{
5398   k051316_state *k051316 = k051316_get_safe_token(device);
5687   k051316_state *k051316 = k051316_get_safe_token(this);
53995688
54005689   memset(k051316->ctrlram,  0, 0x10);
54015690}
54025691
5692
54035693/***************************************************************************/
54045694/*                                                                         */
54055695/*                                 053936                                  */
r17691r17692
56255915   memset(k053936->ctrl, 0, 0x20);
56265916}
56275917
5918const device_type K053936 = &device_creator<k053936_device>;
5919
5920k053936_device::k053936_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5921   : device_t(mconfig, K053936, "Konami 053936", tag, owner, clock)
5922{
5923   m_token = global_alloc_array_clear(UINT8, sizeof(k053936_state));
5924}
5925
5926//-------------------------------------------------
5927//  device_config_complete - perform any
5928//  operations now that the configuration is
5929//  complete
5930//-------------------------------------------------
5931
5932void k053936_device::device_config_complete()
5933{
5934}
5935
5936//-------------------------------------------------
5937//  device_start - device-specific startup
5938//-------------------------------------------------
5939
5940void k053936_device::device_start()
5941{
5942   DEVICE_START_NAME( k053936 )(this);
5943}
5944
5945//-------------------------------------------------
5946//  device_reset - device-specific reset
5947//-------------------------------------------------
5948
5949void k053936_device::device_reset()
5950{
5951   DEVICE_RESET_NAME( k053936 )(this);
5952}
5953
5954
5955
56285956/***************************************************************************/
56295957/*                                                                         */
56305958/*                                 053251                                  */
r17691r17692
57796107      k053251->dirty_tmap[i] = 0;
57806108}
57816109
6110const device_type K053251 = &device_creator<k053251_device>;
57826111
6112k053251_device::k053251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
6113   : device_t(mconfig, K053251, "Konami 053251", tag, owner, clock)
6114{
6115   m_token = global_alloc_array_clear(UINT8, sizeof(k053251_state));
6116}
6117
6118//-------------------------------------------------
6119//  device_config_complete - perform any
6120//  operations now that the configuration is
6121//  complete
6122//-------------------------------------------------
6123
6124void k053251_device::device_config_complete()
6125{
6126}
6127
6128//-------------------------------------------------
6129//  device_start - device-specific startup
6130//-------------------------------------------------
6131
6132void k053251_device::device_start()
6133{
6134   DEVICE_START_NAME( k053251 )(this);
6135}
6136
6137//-------------------------------------------------
6138//  device_reset - device-specific reset
6139//-------------------------------------------------
6140
6141void k053251_device::device_reset()
6142{
6143   DEVICE_RESET_NAME( k053251 )(this);
6144}
6145
57836146/***************************************************************************/
57846147/*                                                                         */
57856148/*                                 054000                                  */
r17691r17692
58906253      k054000->regs[i] = 0;
58916254}
58926255
6256const device_type K054000 = &device_creator<k054000_device>;
58936257
6258k054000_device::k054000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
6259   : device_t(mconfig, K054000, "Konami 054000", tag, owner, clock)
6260{
6261   m_token = global_alloc_array_clear(UINT8, sizeof(k054000_state));
6262}
6263
6264//-------------------------------------------------
6265//  device_config_complete - perform any
6266//  operations now that the configuration is
6267//  complete
6268//-------------------------------------------------
6269
6270void k054000_device::device_config_complete()
6271{
6272}
6273
6274//-------------------------------------------------
6275//  device_start - device-specific startup
6276//-------------------------------------------------
6277
6278void k054000_device::device_start()
6279{
6280   DEVICE_START_NAME( k054000 )(this);
6281}
6282
6283//-------------------------------------------------
6284//  device_reset - device-specific reset
6285//-------------------------------------------------
6286
6287void k054000_device::device_reset()
6288{
6289   DEVICE_RESET_NAME( k054000 )(this);
6290}
6291
6292
58946293/***************************************************************************/
58956294/*                                                                         */
58966295/*                                 051733                                  */
r17691r17692
60436442   k051733->rng = 0;
60446443}
60456444
6445const device_type K051733 = &device_creator<k051733_device>;
60466446
6447k051733_device::k051733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
6448   : device_t(mconfig, K051733, "Konami 051733", tag, owner, clock)
6449{
6450   m_token = global_alloc_array_clear(UINT8, sizeof(k051733_state));
6451}
6452
6453//-------------------------------------------------
6454//  device_config_complete - perform any
6455//  operations now that the configuration is
6456//  complete
6457//-------------------------------------------------
6458
6459void k051733_device::device_config_complete()
6460{
6461}
6462
6463//-------------------------------------------------
6464//  device_start - device-specific startup
6465//-------------------------------------------------
6466
6467void k051733_device::device_start()
6468{
6469   DEVICE_START_NAME( k051733 )(this);
6470}
6471
6472//-------------------------------------------------
6473//  device_reset - device-specific reset
6474//-------------------------------------------------
6475
6476void k051733_device::device_reset()
6477{
6478   DEVICE_RESET_NAME( k051733 )(this);
6479}
6480
6481
60476482/***************************************************************************/
60486483/*                                                                         */
60496484/*                                 054157 / 056832                         */
r17691r17692
62486683   return res;
62496684}
62506685
6251INLINE void k056832_get_tile_info( device_t *device, tile_data &tileinfo, int tile_index, int pageIndex )
6686INLINE void k056832_get_tile_info( running_machine &machine, device_t *device, tile_data &tileinfo, int tile_index, int pageIndex )
62526687{
62536688   k056832_state *k056832 = k056832_get_safe_token(device);
62546689   static const struct K056832_SHIFTMASKS
r17691r17692
62876722
62886723   k056832->callback(device->machine(), layer, &code, &color, &flags);
62896724
6290   SET_TILE_INFO_DEVICE(
6725   SET_TILE_INFO(
62916726         k056832->gfxnum,
62926727         code,
62936728         color,
62946729         flags);
62956730}
62966731
6297static TILE_GET_INFO_DEVICE( k056832_get_tile_info0 ) { k056832_get_tile_info(device, tileinfo, tile_index, 0x0); }
6298static TILE_GET_INFO_DEVICE( k056832_get_tile_info1 ) { k056832_get_tile_info(device, tileinfo, tile_index, 0x1); }
6299static TILE_GET_INFO_DEVICE( k056832_get_tile_info2 ) { k056832_get_tile_info(device, tileinfo, tile_index, 0x2); }
6300static TILE_GET_INFO_DEVICE( k056832_get_tile_info3 ) { k056832_get_tile_info(device, tileinfo, tile_index, 0x3); }
6301static TILE_GET_INFO_DEVICE( k056832_get_tile_info4 ) { k056832_get_tile_info(device, tileinfo, tile_index, 0x4); }
6302static TILE_GET_INFO_DEVICE( k056832_get_tile_info5 ) { k056832_get_tile_info(device, tileinfo, tile_index, 0x5); }
6303static TILE_GET_INFO_DEVICE( k056832_get_tile_info6 ) { k056832_get_tile_info(device, tileinfo, tile_index, 0x6); }
6304static TILE_GET_INFO_DEVICE( k056832_get_tile_info7 ) { k056832_get_tile_info(device, tileinfo, tile_index, 0x7); }
6305static TILE_GET_INFO_DEVICE( k056832_get_tile_info8 ) { k056832_get_tile_info(device, tileinfo, tile_index, 0x8); }
6306static TILE_GET_INFO_DEVICE( k056832_get_tile_info9 ) { k056832_get_tile_info(device, tileinfo, tile_index, 0x9); }
6307static TILE_GET_INFO_DEVICE( k056832_get_tile_infoa ) { k056832_get_tile_info(device, tileinfo, tile_index, 0xa); }
6308static TILE_GET_INFO_DEVICE( k056832_get_tile_infob ) { k056832_get_tile_info(device, tileinfo, tile_index, 0xb); }
6309static TILE_GET_INFO_DEVICE( k056832_get_tile_infoc ) { k056832_get_tile_info(device, tileinfo, tile_index, 0xc); }
6310static TILE_GET_INFO_DEVICE( k056832_get_tile_infod ) { k056832_get_tile_info(device, tileinfo, tile_index, 0xd); }
6311static TILE_GET_INFO_DEVICE( k056832_get_tile_infoe ) { k056832_get_tile_info(device, tileinfo, tile_index, 0xe); }
6312static TILE_GET_INFO_DEVICE( k056832_get_tile_infof ) { k056832_get_tile_info(device, tileinfo, tile_index, 0xf); }
6732TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_info0) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0x0); }
6733TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_info1) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0x1); }
6734TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_info2) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0x2); }
6735TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_info3) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0x3); }
6736TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_info4) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0x4); }
6737TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_info5) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0x5); }
6738TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_info6) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0x6); }
6739TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_info7) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0x7); }
6740TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_info8) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0x8); }
6741TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_info9) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0x9); }
6742TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_infoa) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0xa); }
6743TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_infob) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0xb); }
6744TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_infoc) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0xc); }
6745TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_infod) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0xd); }
6746TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_infoe) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0xe); }
6747TILE_GET_INFO_MEMBER(k056832_device::k056832_get_tile_infof) { k056832_get_tile_info(machine(), this, tileinfo, tile_index, 0xf); }
63136748
63146749static void k056832_change_rambank( k056832_state *k056832 )
63156750{
r17691r17692
77548189   k056832_change_rombank(k056832);
77558190}
77568191
7757/*****************************************************************************
7758    DEVICE INTERFACE
7759*****************************************************************************/
77608192
8193
8194const device_type K056832 = &device_creator<k056832_device>;
8195
8196k056832_device::k056832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
8197   : device_t(mconfig, K056832, "Konami 056832", tag, owner, clock)
8198{
8199   m_token = global_alloc_array_clear(UINT8, sizeof(k056832_state));
8200}
8201
8202//-------------------------------------------------
8203//  device_config_complete - perform any
8204//  operations now that the configuration is
8205//  complete
8206//-------------------------------------------------
8207
8208void k056832_device::device_config_complete()
8209{
8210}
8211
8212//-------------------------------------------------
8213//  device_start - device-specific startup
8214//-------------------------------------------------
8215
8216void k056832_device::device_start()
8217{
8218
77618219/* TODO: understand which elements MUST be init here (to keep correct layer
77628220   associations) and which ones can can be init at RESET, if any */
7763static DEVICE_START( k056832 )
7764{
7765   k056832_state *k056832 = k056832_get_safe_token(device);
7766   const k056832_interface *intf = k056832_get_interface(device);
7767   running_machine &machine = device->machine();
8221   k056832_state *k056832 = k056832_get_safe_token(this);
8222   const k056832_interface *intf = k056832_get_interface(this);
77688223   tilemap_t *tmap;
77698224   int i;
77708225   UINT32 total;
r17691r17692
78498304   switch (intf->bpp)
78508305   {
78518306      case K056832_BPP_4:
7852         total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 4);
7853         decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout4, 4);
8307         total = machine().root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 4);
8308         decode_gfx(machine(), intf->gfx_num, machine().root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout4, 4);
78548309         break;
78558310
78568311      case K056832_BPP_5:
7857         total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 5);
7858         decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout5, 4);
8312         total = machine().root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 5);
8313         decode_gfx(machine(), intf->gfx_num, machine().root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout5, 4);
78598314         break;
78608315
78618316      case K056832_BPP_6:
7862         total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 6);
7863         decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout6, 4);
8317         total = machine().root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 6);
8318         decode_gfx(machine(), intf->gfx_num, machine().root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout6, 4);
78648319         break;
78658320
78668321      case K056832_BPP_8:
7867         total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 8);
7868         decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout8, 4);
8322         total = machine().root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 8);
8323         decode_gfx(machine(), intf->gfx_num, machine().root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout8, 4);
78698324         break;
78708325
78718326      case K056832_BPP_8LE:
7872         total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 8);
7873         decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout8le, 4);
8327         total = machine().root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 8);
8328         decode_gfx(machine(), intf->gfx_num, machine().root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout8le, 4);
78748329         break;
78758330
78768331      case K056832_BPP_8TASMAN:
7877         total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 8);
7878         decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout8_tasman, 4);
8332         total = machine().root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 8);
8333         decode_gfx(machine(), intf->gfx_num, machine().root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout8_tasman, 4);
78798334         break;
78808335
78818336      case K056832_BPP_4dj:
7882         total = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 4);
7883         decode_gfx(machine, intf->gfx_num, machine.root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout4dj, 4);
8337         total = machine().root_device().memregion(intf->gfx_memory_region)->bytes() / (i * 4);
8338         decode_gfx(machine(), intf->gfx_num, machine().root_device().memregion(intf->gfx_memory_region)->base(), total, &charlayout4dj, 4);
78848339         break;
78858340
78868341      default:
78878342         fatalerror("Unsupported bpp");
78888343   }
78898344
7890   machine.gfx[intf->gfx_num]->set_granularity(16); /* override */
8345   machine().gfx[intf->gfx_num]->set_granularity(16); /* override */
78918346
78928347   /* deinterleave the graphics, if needed */
7893   deinterleave_gfx(machine, intf->gfx_memory_region, intf->deinterleave);
8348   deinterleave_gfx(machine(), intf->gfx_memory_region, intf->deinterleave);
78948349
78958350   k056832->memory_region = intf->gfx_memory_region;
78968351   k056832->gfxnum = intf->gfx_num;
78978352   k056832->callback = intf->callback;
78988353
7899   k056832->rombase = machine.root_device().memregion(intf->gfx_memory_region)->base();
7900   k056832->num_gfx_banks = machine.root_device().memregion(intf->gfx_memory_region)->bytes() / 0x2000;
8354   k056832->rombase = machine().root_device().memregion(intf->gfx_memory_region)->base();
8355   k056832->num_gfx_banks = machine().root_device().memregion(intf->gfx_memory_region)->bytes() / 0x2000;
79018356   k056832->djmain_hack = intf->djmain_hack;
79028357
79038358   k056832->cur_gfx_banks = 0;
r17691r17692
79238378   k056832->active_layer = 0;
79248379   k056832->linemap_enabled = 0;
79258380
7926   k056832->k055555 = device->machine().device(intf->k055555);
8381   k056832->k055555 = machine().device(intf->k055555);
79278382
79288383   memset(k056832->line_dirty, 0, sizeof(UINT32) * K056832_PAGE_COUNT * 8);
79298384
r17691r17692
79338388      k056832->page_tile_mode[i] = 1;
79348389   }
79358390
7936   k056832->videoram = auto_alloc_array(machine, UINT16, 0x2000 * (K056832_PAGE_COUNT + 1) / 2);
8391   k056832->videoram = auto_alloc_array(machine(), UINT16, 0x2000 * (K056832_PAGE_COUNT + 1) / 2);
79378392
7938   k056832->tilemap[0x0] = tilemap_create_device(device, k056832_get_tile_info0, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7939   k056832->tilemap[0x1] = tilemap_create_device(device, k056832_get_tile_info1, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7940   k056832->tilemap[0x2] = tilemap_create_device(device, k056832_get_tile_info2, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7941   k056832->tilemap[0x3] = tilemap_create_device(device, k056832_get_tile_info3, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7942   k056832->tilemap[0x4] = tilemap_create_device(device, k056832_get_tile_info4, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7943   k056832->tilemap[0x5] = tilemap_create_device(device, k056832_get_tile_info5, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7944   k056832->tilemap[0x6] = tilemap_create_device(device, k056832_get_tile_info6, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7945   k056832->tilemap[0x7] = tilemap_create_device(device, k056832_get_tile_info7, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7946   k056832->tilemap[0x8] = tilemap_create_device(device, k056832_get_tile_info8, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7947   k056832->tilemap[0x9] = tilemap_create_device(device, k056832_get_tile_info9, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7948   k056832->tilemap[0xa] = tilemap_create_device(device, k056832_get_tile_infoa, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7949   k056832->tilemap[0xb] = tilemap_create_device(device, k056832_get_tile_infob, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7950   k056832->tilemap[0xc] = tilemap_create_device(device, k056832_get_tile_infoc, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7951   k056832->tilemap[0xd] = tilemap_create_device(device, k056832_get_tile_infod, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7952   k056832->tilemap[0xe] = tilemap_create_device(device, k056832_get_tile_infoe, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
7953   k056832->tilemap[0xf] = tilemap_create_device(device, k056832_get_tile_infof, TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8393   k056832->tilemap[0x0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_info0),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8394   k056832->tilemap[0x1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_info1),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8395   k056832->tilemap[0x2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_info2),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8396   k056832->tilemap[0x3] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_info3),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8397   k056832->tilemap[0x4] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_info4),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8398   k056832->tilemap[0x5] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_info5),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8399   k056832->tilemap[0x6] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_info6),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8400   k056832->tilemap[0x7] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_info7),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8401   k056832->tilemap[0x8] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_info8),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8402   k056832->tilemap[0x9] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_info9),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8403   k056832->tilemap[0xa] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_infoa),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8404   k056832->tilemap[0xb] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_infob),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8405   k056832->tilemap[0xc] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_infoc),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8406   k056832->tilemap[0xd] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_infod),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8407   k056832->tilemap[0xe] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_infoe),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
8408   k056832->tilemap[0xf] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k056832_device::k056832_get_tile_infof),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
79548409
79558410   for (i = 0; i < K056832_PAGE_COUNT; i++)
79568411   {
r17691r17692
79708425   k056832_change_rambank(k056832);
79718426   k056832_change_rombank(k056832);
79728427
7973   device->save_pointer(NAME(k056832->videoram), 0x10000);
7974   device->save_item(NAME(k056832->regs));
7975   device->save_item(NAME(k056832->regsb));
7976   device->save_item(NAME(k056832->x));
7977   device->save_item(NAME(k056832->y));
7978   device->save_item(NAME(k056832->w));
7979   device->save_item(NAME(k056832->h));
7980   device->save_item(NAME(k056832->dx));
7981   device->save_item(NAME(k056832->dy));
7982   device->save_item(NAME(k056832->layer_tile_mode));
8428   save_pointer(NAME(k056832->videoram), 0x10000);
8429   save_item(NAME(k056832->regs));
8430   save_item(NAME(k056832->regsb));
8431   save_item(NAME(k056832->x));
8432   save_item(NAME(k056832->y));
8433   save_item(NAME(k056832->w));
8434   save_item(NAME(k056832->h));
8435   save_item(NAME(k056832->dx));
8436   save_item(NAME(k056832->dy));
8437   save_item(NAME(k056832->layer_tile_mode));
79838438
7984   device->save_item(NAME(k056832->default_layer_association));
7985   device->save_item(NAME(k056832->active_layer));
7986   device->save_item(NAME(k056832->linemap_enabled));
7987   device->save_item(NAME(k056832->use_ext_linescroll));
7988   device->save_item(NAME(k056832->uses_tile_banks));
7989   device->save_item(NAME(k056832->cur_tile_bank));
7990   device->save_item(NAME(k056832->rom_half));
7991   device->save_item(NAME(k056832->all_lines_dirty));
7992   device->save_item(NAME(k056832->page_tile_mode));
8439   save_item(NAME(k056832->default_layer_association));
8440   save_item(NAME(k056832->active_layer));
8441   save_item(NAME(k056832->linemap_enabled));
8442   save_item(NAME(k056832->use_ext_linescroll));
8443   save_item(NAME(k056832->uses_tile_banks));
8444   save_item(NAME(k056832->cur_tile_bank));
8445   save_item(NAME(k056832->rom_half));
8446   save_item(NAME(k056832->all_lines_dirty));
8447   save_item(NAME(k056832->page_tile_mode));
79938448
79948449   for (i = 0; i < 8; i++)
79958450   {
7996      device->save_item(NAME(k056832->layer_offs[i]), i);
7997      device->save_item(NAME(k056832->lsram_page[i]), i);
8451      save_item(NAME(k056832->layer_offs[i]), i);
8452      save_item(NAME(k056832->lsram_page[i]), i);
79988453   }
79998454
80008455   for (i = 0; i < K056832_PAGE_COUNT; i++)
80018456   {
8002      device->save_item(NAME(k056832->line_dirty[i]), i);
8003      device->save_item(NAME(k056832->all_lines_dirty[i]), i);
8004      device->save_item(NAME(k056832->page_tile_mode[i]), i);
8005      device->save_item(NAME(k056832->last_colorbase[i]), i);
8457      save_item(NAME(k056832->line_dirty[i]), i);
8458      save_item(NAME(k056832->all_lines_dirty[i]), i);
8459      save_item(NAME(k056832->page_tile_mode[i]), i);
8460      save_item(NAME(k056832->last_colorbase[i]), i);
80068461   }
80078462
8008   device->machine().save().register_postload(save_prepost_delegate(FUNC(k056832_postload), k056832));
8463   machine().save().register_postload(save_prepost_delegate(FUNC(k056832_postload), k056832));
80098464}
80108465
8466
80118467/***************************************************************************/
80128468/*                                                                         */
80138469/*                                 055555                                  */
r17691r17692
81278583   memset(k055555->regs, 0, 64 * sizeof(UINT8));
81288584}
81298585
8586const device_type K055555 = &device_creator<k055555_device>;
81308587
8588k055555_device::k055555_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
8589   : device_t(mconfig, K055555, "Konami 055555", tag, owner, clock)
8590{
8591   m_token = global_alloc_array_clear(UINT8, sizeof(k055555_state));
8592}
8593
8594//-------------------------------------------------
8595//  device_config_complete - perform any
8596//  operations now that the configuration is
8597//  complete
8598//-------------------------------------------------
8599
8600void k055555_device::device_config_complete()
8601{
8602}
8603
8604//-------------------------------------------------
8605//  device_start - device-specific startup
8606//-------------------------------------------------
8607
8608void k055555_device::device_start()
8609{
8610   DEVICE_START_NAME( k055555 )(this);
8611}
8612
8613//-------------------------------------------------
8614//  device_reset - device-specific reset
8615//-------------------------------------------------
8616
8617void k055555_device::device_reset()
8618{
8619   DEVICE_RESET_NAME( k055555 )(this);
8620}
8621
81318622/***************************************************************************/
81328623/*                                                                         */
81338624/*                                 054338                                  */
r17691r17692
84318922   memset(k054338->shd_rgb, 0, sizeof(int)*9);
84328923}
84338924
8925const device_type K054338 = &device_creator<k054338_device>;
84348926
8927k054338_device::k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
8928   : device_t(mconfig, K054338, "Konami 054338", tag, owner, clock)
8929{
8930   m_token = global_alloc_array_clear(UINT8, sizeof(k054338_state));
8931}
8932
8933//-------------------------------------------------
8934//  device_config_complete - perform any
8935//  operations now that the configuration is
8936//  complete
8937//-------------------------------------------------
8938
8939void k054338_device::device_config_complete()
8940{
8941}
8942
8943//-------------------------------------------------
8944//  device_start - device-specific startup
8945//-------------------------------------------------
8946
8947void k054338_device::device_start()
8948{
8949   DEVICE_START_NAME( k054338 )(this);
8950}
8951
8952//-------------------------------------------------
8953//  device_reset - device-specific reset
8954//-------------------------------------------------
8955
8956void k054338_device::device_reset()
8957{
8958   DEVICE_RESET_NAME( k054338 )(this);
8959}
8960
8961
84358962// Newer Konami devices
84368963
84378964// from video/gticlub.c
r17691r17692
86079134   memset(k001006->palette, 0, 0x800*sizeof(UINT32));
86089135}
86099136
9137const device_type K001006 = &device_creator<k001006_device>;
86109138
9139k001006_device::k001006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
9140   : device_t(mconfig, K001006, "Konami 001006", tag, owner, clock)
9141{
9142   m_token = global_alloc_array_clear(UINT8, sizeof(k001006_state));
9143}
9144
9145//-------------------------------------------------
9146//  device_config_complete - perform any
9147//  operations now that the configuration is
9148//  complete
9149//-------------------------------------------------
9150
9151void k001006_device::device_config_complete()
9152{
9153}
9154
9155//-------------------------------------------------
9156//  device_start - device-specific startup
9157//-------------------------------------------------
9158
9159void k001006_device::device_start()
9160{
9161   DEVICE_START_NAME( k001006 )(this);
9162}
9163
9164//-------------------------------------------------
9165//  device_reset - device-specific reset
9166//-------------------------------------------------
9167
9168void k001006_device::device_reset()
9169{
9170   DEVICE_RESET_NAME( k001006 )(this);
9171}
9172
86119173/*****************************************************************************/
86129174/* Konami K001005 Custom 3D Pixel Renderer chip (KS10071) */
86139175
r17691r17692
953710099   poly_free(k001005->poly);
953810100}
953910101
10102const device_type K001005 = &device_creator<k001005_device>;
954010103
10104k001005_device::k001005_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10105   : device_t(mconfig, K001005, "Konami 001005", tag, owner, clock)
10106{
10107   m_token = global_alloc_array_clear(UINT8, sizeof(k001005_state));
10108}
10109
10110//-------------------------------------------------
10111//  device_config_complete - perform any
10112//  operations now that the configuration is
10113//  complete
10114//-------------------------------------------------
10115
10116void k001005_device::device_config_complete()
10117{
10118}
10119
10120//-------------------------------------------------
10121//  device_start - device-specific startup
10122//-------------------------------------------------
10123
10124void k001005_device::device_start()
10125{
10126   DEVICE_START_NAME( k001005 )(this);
10127}
10128
10129//-------------------------------------------------
10130//  device_reset - device-specific reset
10131//-------------------------------------------------
10132
10133void k001005_device::device_reset()
10134{
10135   DEVICE_RESET_NAME( k001005 )(this);
10136}
10137
10138//-------------------------------------------------
10139//  device_stop - device-specific stop
10140//-------------------------------------------------
10141
10142void k001005_device::device_stop()
10143{
10144   DEVICE_STOP_NAME( k001005 )(this);
10145}
10146
954110147/***************************************************************************/
954210148/*                                                                         */
954310149/*                                  001604                                 */
r17691r17692
961410220/* FIXME: The TILEMAP_MAPPER below depends on parameters passed by the device interface (being game dependent).
961510221we might simplify the code, by passing the whole TILEMAP_MAPPER as a callback in the interface, but is it really worth? */
961610222
9617static TILEMAP_MAPPER( k001604_scan_layer_8x8_0_size0 )
10223TILEMAP_MAPPER_MEMBER(k001604_device::k001604_scan_layer_8x8_0_size0)
961810224{
961910225   /* logical (col,row) -> memory offset */
962010226   return (row * 128) + col;
962110227}
962210228
9623static TILEMAP_MAPPER( k001604_scan_layer_8x8_0_size1 )
10229TILEMAP_MAPPER_MEMBER(k001604_device::k001604_scan_layer_8x8_0_size1)
962410230{
962510231   /* logical (col,row) -> memory offset */
962610232   return (row * 256) + col;
962710233}
962810234
9629static TILEMAP_MAPPER( k001604_scan_layer_8x8_1_size0 )
10235TILEMAP_MAPPER_MEMBER(k001604_device::k001604_scan_layer_8x8_1_size0)
963010236{
963110237   /* logical (col,row) -> memory offset */
963210238   return (row * 128) + col + 64;
963310239}
963410240
9635static TILEMAP_MAPPER( k001604_scan_layer_8x8_1_size1 )
10241TILEMAP_MAPPER_MEMBER(k001604_device::k001604_scan_layer_8x8_1_size1)
963610242{
963710243   /* logical (col,row) -> memory offset */
963810244   return (row * 256) + col + 64;
963910245}
964010246
9641static TILEMAP_MAPPER( slrasslt_scan_layer_8x8_0_size0 )
10247TILEMAP_MAPPER_MEMBER(k001604_device::slrasslt_scan_layer_8x8_0_size0)
964210248{
964310249   /* logical (col,row) -> memory offset */
964410250   return (row * 128) + col + 16384;
964510251}
964610252
9647static TILEMAP_MAPPER( slrasslt_scan_layer_8x8_1_size0 )
10253TILEMAP_MAPPER_MEMBER(k001604_device::slrasslt_scan_layer_8x8_1_size0)
964810254{
964910255   /* logical (col,row) -> memory offset */
965010256   return (row * 128) + col + 64 + 16384;
965110257}
965210258
9653static TILEMAP_MAPPER( k001604_scan_layer_roz_0_size0 )
10259TILEMAP_MAPPER_MEMBER(k001604_device::k001604_scan_layer_roz_0_size0)
965410260{
965510261   /* logical (col,row) -> memory offset */
965610262   return (row * 128) + col;
965710263}
965810264
9659static TILEMAP_MAPPER( k001604_scan_layer_roz_0_size1 )
10265TILEMAP_MAPPER_MEMBER(k001604_device::k001604_scan_layer_roz_0_size1)
966010266{
966110267   /* logical (col,row) -> memory offset */
966210268   return (row * 256) + col + 128;
966310269}
966410270
9665static TILEMAP_MAPPER( k001604_scan_layer_roz_1_size0 )
10271TILEMAP_MAPPER_MEMBER(k001604_device::k001604_scan_layer_roz_1_size0)
966610272{
966710273   /* logical (col,row) -> memory offset */
966810274   return (row * 128) + col + 64;
966910275}
967010276
9671static TILEMAP_MAPPER( k001604_scan_layer_roz_1_size1 )
10277TILEMAP_MAPPER_MEMBER(k001604_device::k001604_scan_layer_roz_1_size1)
967210278{
967310279   /* logical (col,row) -> memory offset */
967410280   return (row * 256) + col + 128 + 64;
967510281}
967610282
9677static TILE_GET_INFO_DEVICE( k001604_tile_info_layer_8x8 )
10283TILE_GET_INFO_MEMBER(k001604_device::k001604_tile_info_layer_8x8)
967810284{
9679   k001604_state *k001604 = k001604_get_safe_token(device);
10285   k001604_state *k001604 = k001604_get_safe_token(this);
968010286   UINT32 val = k001604->tile_ram[tile_index];
968110287   int color = (val >> 17) & 0x1f;
968210288   int tile = (val & 0x7fff);
r17691r17692
968710293   if (val & 0x800000)
968810294      flags |= TILE_FLIPY;
968910295
9690   SET_TILE_INFO_DEVICE(k001604->gfx_index[0], tile, color, flags);
10296   SET_TILE_INFO_MEMBER(k001604->gfx_index[0], tile, color, flags);
969110297}
969210298
9693static TILE_GET_INFO_DEVICE( k001604_tile_info_layer_roz )
10299TILE_GET_INFO_MEMBER(k001604_device::k001604_tile_info_layer_roz)
969410300{
9695   k001604_state *k001604 = k001604_get_safe_token(device);
10301   k001604_state *k001604 = k001604_get_safe_token(this);
969610302   UINT32 val = k001604->tile_ram[tile_index];
969710303   int flags = 0;
969810304   int color = (val >> 17) & 0x1f;
r17691r17692
970510311
970610312   tile += k001604->roz_size ? 0x800 : 0x2000;
970710313
9708   SET_TILE_INFO_DEVICE(k001604->gfx_index[k001604->roz_size], tile, color, flags);
10314   SET_TILE_INFO_MEMBER(k001604->gfx_index[k001604->roz_size], tile, color, flags);
970910315}
971010316
971110317
r17691r17692
988610492   }
988710493}
988810494
10495const device_type K001604 = &device_creator<k001604_device>;
988910496
9890/*****************************************************************************
9891    DEVICE INTERFACE
9892*****************************************************************************/
10497k001604_device::k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10498   : device_t(mconfig, K001604, "Konami 001604", tag, owner, clock)
10499{
10500   m_token = global_alloc_array_clear(UINT8, sizeof(k001604_state));
10501}
989310502
9894static DEVICE_START( k001604 )
10503//-------------------------------------------------
10504//  device_config_complete - perform any
10505//  operations now that the configuration is
10506//  complete
10507//-------------------------------------------------
10508
10509void k001604_device::device_config_complete()
989510510{
9896   k001604_state *k001604 = k001604_get_safe_token(device);
9897   const k001604_interface *intf = k001604_get_interface(device);
10511}
10512
10513//-------------------------------------------------
10514//  device_start - device-specific startup
10515//-------------------------------------------------
10516
10517void k001604_device::device_start()
10518{
10519   k001604_state *k001604 = k001604_get_safe_token(this);
10520   const k001604_interface *intf = k001604_get_interface(this);
989810521   int roz_tile_size;
989910522
990010523   k001604->layer_size = intf->layer_size;      // 0 -> width = 128 tiles, 1 -> width = 256 tiles
r17691r17692
990310526   k001604->gfx_index[0] = intf->gfx_index_1;
990410527   k001604->gfx_index[1] = intf->gfx_index_2;
990510528
9906   k001604->char_ram = auto_alloc_array(device->machine(), UINT32, 0x200000 / 4);
9907   k001604->tile_ram = auto_alloc_array(device->machine(), UINT32, 0x20000 / 4);
9908   k001604->reg = auto_alloc_array(device->machine(), UINT32, 0x400 / 4);
10529   k001604->char_ram = auto_alloc_array(machine(), UINT32, 0x200000 / 4);
10530   k001604->tile_ram = auto_alloc_array(machine(), UINT32, 0x20000 / 4);
10531   k001604->reg = auto_alloc_array(machine(), UINT32, 0x400 / 4);
990910532
991010533   /* create tilemaps */
991110534   roz_tile_size = k001604->roz_size ? 16 : 8;
r17691r17692
991310536   {
991410537      if (k001604->layer_size)
991510538      {
9916         k001604->layer_8x8[0] = tilemap_create_device(device, k001604_tile_info_layer_8x8, k001604_scan_layer_8x8_0_size1, 8, 8, 64, 64);
9917         k001604->layer_8x8[1] = tilemap_create_device(device, k001604_tile_info_layer_8x8, k001604_scan_layer_8x8_1_size1, 8, 8, 64, 64);
9918         k001604->layer_roz[0] = tilemap_create_device(device, k001604_tile_info_layer_roz, k001604_scan_layer_roz_0_size1, roz_tile_size, roz_tile_size, 64, 64);
9919         k001604->layer_roz[1] = tilemap_create_device(device, k001604_tile_info_layer_roz, k001604_scan_layer_roz_1_size1, roz_tile_size, roz_tile_size, 64, 64);
10539         k001604->layer_8x8[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k001604_device::k001604_tile_info_layer_8x8),this), tilemap_mapper_delegate(FUNC(k001604_device::k001604_scan_layer_8x8_0_size1),this), 8, 8, 64, 64);
10540         k001604->layer_8x8[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k001604_device::k001604_tile_info_layer_8x8),this), tilemap_mapper_delegate(FUNC(k001604_device::k001604_scan_layer_8x8_1_size1),this), 8, 8, 64, 64);
10541         k001604->layer_roz[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k001604_device::k001604_tile_info_layer_roz),this), tilemap_mapper_delegate(FUNC(k001604_device::k001604_scan_layer_roz_0_size1),this), roz_tile_size, roz_tile_size, 64, 64);
10542         k001604->layer_roz[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k001604_device::k001604_tile_info_layer_roz),this), tilemap_mapper_delegate(FUNC(k001604_device::k001604_scan_layer_roz_1_size1),this), roz_tile_size, roz_tile_size, 64, 64);
992010543      }
992110544      else
992210545      {
9923         k001604->layer_8x8[0] = tilemap_create_device(device, k001604_tile_info_layer_8x8, k001604_scan_layer_8x8_0_size0, 8, 8, 64, 64);
9924         k001604->layer_8x8[1] = tilemap_create_device(device, k001604_tile_info_layer_8x8, k001604_scan_layer_8x8_1_size0, 8, 8, 64, 64);
9925         k001604->layer_roz[0] = tilemap_create_device(device, k001604_tile_info_layer_roz, k001604_scan_layer_roz_0_size0, roz_tile_size, roz_tile_size, 128, 64);
9926         k001604->layer_roz[1] = tilemap_create_device(device, k001604_tile_info_layer_roz, k001604_scan_layer_roz_1_size0, roz_tile_size, roz_tile_size, 64, 64);
10546         k001604->layer_8x8[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k001604_device::k001604_tile_info_layer_8x8),this), tilemap_mapper_delegate(FUNC(k001604_device::k001604_scan_layer_8x8_0_size0),this), 8, 8, 64, 64);
10547         k001604->layer_8x8[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k001604_device::k001604_tile_info_layer_8x8),this), tilemap_mapper_delegate(FUNC(k001604_device::k001604_scan_layer_8x8_1_size0),this), 8, 8, 64, 64);
10548         k001604->layer_roz[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k001604_device::k001604_tile_info_layer_roz),this), tilemap_mapper_delegate(FUNC(k001604_device::k001604_scan_layer_roz_0_size0),this), roz_tile_size, roz_tile_size, 128, 64);
10549         k001604->layer_roz[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k001604_device::k001604_tile_info_layer_roz),this), tilemap_mapper_delegate(FUNC(k001604_device::k001604_scan_layer_roz_1_size0),this), roz_tile_size, roz_tile_size, 64, 64);
992710550      }
992810551   }
992910552   else   /* slrasslt has shifted tilemaps (but only has k001604->layer_size =  0) */
993010553   {
9931      k001604->layer_8x8[0] = tilemap_create_device(device, k001604_tile_info_layer_8x8, slrasslt_scan_layer_8x8_0_size0, 8, 8, 64, 64);
9932      k001604->layer_8x8[1] = tilemap_create_device(device, k001604_tile_info_layer_8x8, slrasslt_scan_layer_8x8_1_size0, 8, 8, 64, 64);
9933      k001604->layer_roz[0] = tilemap_create_device(device, k001604_tile_info_layer_roz, k001604_scan_layer_roz_0_size0, roz_tile_size, roz_tile_size, 128, 64);
9934      k001604->layer_roz[1] = tilemap_create_device(device, k001604_tile_info_layer_roz, k001604_scan_layer_roz_1_size0, roz_tile_size, roz_tile_size, 64, 64);
10554      k001604->layer_8x8[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k001604_device::k001604_tile_info_layer_8x8),this), tilemap_mapper_delegate(FUNC(k001604_device::slrasslt_scan_layer_8x8_0_size0),this), 8, 8, 64, 64);
10555      k001604->layer_8x8[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k001604_device::k001604_tile_info_layer_8x8),this), tilemap_mapper_delegate(FUNC(k001604_device::slrasslt_scan_layer_8x8_1_size0),this), 8, 8, 64, 64);
10556      k001604->layer_roz[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k001604_device::k001604_tile_info_layer_roz),this), tilemap_mapper_delegate(FUNC(k001604_device::k001604_scan_layer_roz_0_size0),this), roz_tile_size, roz_tile_size, 128, 64);
10557      k001604->layer_roz[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k001604_device::k001604_tile_info_layer_roz),this), tilemap_mapper_delegate(FUNC(k001604_device::k001604_scan_layer_roz_1_size0),this), roz_tile_size, roz_tile_size, 64, 64);
993510558   }
993610559
993710560   k001604->layer_8x8[0]->set_transparent_pen(0);
993810561   k001604->layer_8x8[1]->set_transparent_pen(0);
993910562
9940   device->machine().gfx[k001604->gfx_index[0]] = auto_alloc(device->machine(), gfx_element(device->machine(), k001604_char_layout_layer_8x8, (UINT8*)&k001604->char_ram[0], device->machine().total_colors() / 16, 0));
9941   device->machine().gfx[k001604->gfx_index[1]] = auto_alloc(device->machine(), gfx_element(device->machine(), k001604_char_layout_layer_16x16, (UINT8*)&k001604->char_ram[0], device->machine().total_colors() / 16, 0));
10563   machine().gfx[k001604->gfx_index[0]] = auto_alloc(machine(), gfx_element(machine(), k001604_char_layout_layer_8x8, (UINT8*)&k001604->char_ram[0], machine().total_colors() / 16, 0));
10564   machine().gfx[k001604->gfx_index[1]] = auto_alloc(machine(), gfx_element(machine(), k001604_char_layout_layer_16x16, (UINT8*)&k001604->char_ram[0], machine().total_colors() / 16, 0));
994210565
9943   device->save_pointer(NAME(k001604->reg), 0x400 / 4);
9944   device->save_pointer(NAME(k001604->char_ram), 0x200000 / 4);
9945   device->save_pointer(NAME(k001604->tile_ram), 0x20000 / 4);
10566   save_pointer(NAME(k001604->reg), 0x400 / 4);
10567   save_pointer(NAME(k001604->char_ram), 0x200000 / 4);
10568   save_pointer(NAME(k001604->tile_ram), 0x20000 / 4);
10569
994610570}
994710571
9948static DEVICE_RESET( k001604 )
10572//-------------------------------------------------
10573//  device_reset - device-specific reset
10574//-------------------------------------------------
10575
10576void k001604_device::device_reset()
994910577{
9950   k001604_state *k001604 = k001604_get_safe_token(device);
10578   k001604_state *k001604 = k001604_get_safe_token(this);
995110579
995210580   memset(k001604->char_ram, 0, 0x200000);
995310581   memset(k001604->tile_ram, 0, 0x10000);
r17691r17692
1001210640   8*128
1001310641};
1001410642
10015static TILE_GET_INFO_DEVICE( k037122_tile_info_layer0 )
10643TILE_GET_INFO_MEMBER(k037122_device::k037122_tile_info_layer0)
1001610644{
10017   k037122_state *k037122 = k037122_get_safe_token(device);
10645   k037122_state *k037122 = k037122_get_safe_token(this);
1001810646   UINT32 val = k037122->tile_ram[tile_index + (0x8000/4)];
1001910647   int color = (val >> 17) & 0x1f;
1002010648   int tile = val & 0x3fff;
r17691r17692
1002510653   if (val & 0x800000)
1002610654      flags |= TILE_FLIPY;
1002710655
10028   SET_TILE_INFO_DEVICE(k037122->gfx_index, tile, color, flags);
10656   SET_TILE_INFO_MEMBER(k037122->gfx_index, tile, color, flags);
1002910657}
1003010658
10031static TILE_GET_INFO_DEVICE( k037122_tile_info_layer1 )
10659TILE_GET_INFO_MEMBER(k037122_device::k037122_tile_info_layer1)
1003210660{
10033   k037122_state *k037122 = k037122_get_safe_token(device);
10661   k037122_state *k037122 = k037122_get_safe_token(this);
1003410662   UINT32 val = k037122->tile_ram[tile_index];
1003510663   int color = (val >> 17) & 0x1f;
1003610664   int tile = val & 0x3fff;
r17691r17692
1004110669   if (val & 0x800000)
1004210670      flags |= TILE_FLIPY;
1004310671
10044   SET_TILE_INFO_DEVICE(k037122->gfx_index, tile, color, flags);
10672   SET_TILE_INFO_MEMBER(k037122->gfx_index, tile, color, flags);
1004510673}
1004610674
1004710675
r17691r17692
1016110789    DEVICE INTERFACE
1016210790*****************************************************************************/
1016310791
10164static DEVICE_START( k037122 )
10792const device_type K037122 = &device_creator<k037122_device>;
10793
10794k037122_device::k037122_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10795   : device_t(mconfig, K037122, "Konami 0371222", tag, owner, clock)
1016510796{
10166   k037122_state *k037122 = k037122_get_safe_token(device);
10167   const k037122_interface *intf = k037122_get_interface(device);
10797   m_token = global_alloc_array_clear(UINT8, sizeof(k037122_state));
10798}
1016810799
10169   k037122->screen = device->machine().device<screen_device>(intf->screen);
10800//-------------------------------------------------
10801//  device_config_complete - perform any
10802//  operations now that the configuration is
10803//  complete
10804//-------------------------------------------------
10805
10806void k037122_device::device_config_complete()
10807{
10808}
10809
10810//-------------------------------------------------
10811//  device_start - device-specific startup
10812//-------------------------------------------------
10813
10814void k037122_device::device_start()
10815{
10816   k037122_state *k037122 = k037122_get_safe_token(this);
10817   const k037122_interface *intf = k037122_get_interface(this);
10818
10819   k037122->screen = machine().device<screen_device>(intf->screen);
1017010820   k037122->gfx_index = intf->gfx_index;
1017110821
10172   k037122->char_ram = auto_alloc_array(device->machine(), UINT32, 0x200000 / 4);
10173   k037122->tile_ram = auto_alloc_array(device->machine(), UINT32, 0x20000 / 4);
10174   k037122->reg = auto_alloc_array(device->machine(), UINT32, 0x400 / 4);
10822   k037122->char_ram = auto_alloc_array(machine(), UINT32, 0x200000 / 4);
10823   k037122->tile_ram = auto_alloc_array(machine(), UINT32, 0x20000 / 4);
10824   k037122->reg = auto_alloc_array(machine(), UINT32, 0x400 / 4);
1017510825
10176   k037122->layer[0] = tilemap_create_device(device, k037122_tile_info_layer0, TILEMAP_SCAN_ROWS, 8, 8, 256, 64);
10177   k037122->layer[1] = tilemap_create_device(device, k037122_tile_info_layer1, TILEMAP_SCAN_ROWS, 8, 8, 128, 64);
10826   k037122->layer[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k037122_device::k037122_tile_info_layer0),this), TILEMAP_SCAN_ROWS, 8, 8, 256, 64);
10827   k037122->layer[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(k037122_device::k037122_tile_info_layer1),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64);
1017810828
1017910829   k037122->layer[0]->set_transparent_pen(0);
1018010830   k037122->layer[1]->set_transparent_pen(0);
1018110831
10182   device->machine().gfx[k037122->gfx_index] = auto_alloc(device->machine(), gfx_element(device->machine(), k037122_char_layout, (UINT8*)k037122->char_ram, device->machine().total_colors() / 16, 0));
10832   machine().gfx[k037122->gfx_index] = auto_alloc(machine(), gfx_element(machine(), k037122_char_layout, (UINT8*)k037122->char_ram, machine().total_colors() / 16, 0));
1018310833
10184   device->save_pointer(NAME(k037122->reg), 0x400 / 4);
10185   device->save_pointer(NAME(k037122->char_ram), 0x200000 / 4);
10186   device->save_pointer(NAME(k037122->tile_ram), 0x20000 / 4);
10834   save_pointer(NAME(k037122->reg), 0x400 / 4);
10835   save_pointer(NAME(k037122->char_ram), 0x200000 / 4);
10836   save_pointer(NAME(k037122->tile_ram), 0x20000 / 4);
10837
1018710838}
1018810839
10189static DEVICE_RESET( k037122 )
10840//-------------------------------------------------
10841//  device_reset - device-specific reset
10842//-------------------------------------------------
10843
10844void k037122_device::device_reset()
1019010845{
10191   k037122_state *k037122 = k037122_get_safe_token(device);
10846   k037122_state *k037122 = k037122_get_safe_token(this);
1019210847
1019310848   memset(k037122->char_ram, 0, 0x200000);
1019410849   memset(k037122->tile_ram, 0, 0x20000);
r17691r17692
1027410929   return(k053244->regs[offset * 2] << 8 | k053244->regs[offset * 2 + 1]);
1027510930}
1027610931
10277const device_type K007121 = &device_creator<k007121_device>;
10278
10279k007121_device::k007121_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10280   : device_t(mconfig, K007121, "Konami 007121", tag, owner, clock)
10281{
10282   m_token = global_alloc_array_clear(UINT8, sizeof(k007121_state));
10283}
10284
10285//-------------------------------------------------
10286//  device_config_complete - perform any
10287//  operations now that the configuration is
10288//  complete
10289//-------------------------------------------------
10290
10291void k007121_device::device_config_complete()
10292{
10293}
10294
10295//-------------------------------------------------
10296//  device_start - device-specific startup
10297//-------------------------------------------------
10298
10299void k007121_device::device_start()
10300{
10301   DEVICE_START_NAME( k007121 )(this);
10302}
10303
10304//-------------------------------------------------
10305//  device_reset - device-specific reset
10306//-------------------------------------------------
10307
10308void k007121_device::device_reset()
10309{
10310   DEVICE_RESET_NAME( k007121 )(this);
10311}
10312
10313
10314const device_type K007342 = &device_creator<k007342_device>;
10315
10316k007342_device::k007342_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10317   : device_t(mconfig, K007342, "Konami 007342", tag, owner, clock)
10318{
10319   m_token = global_alloc_array_clear(UINT8, sizeof(k007342_state));
10320}
10321
10322//-------------------------------------------------
10323//  device_config_complete - perform any
10324//  operations now that the configuration is
10325//  complete
10326//-------------------------------------------------
10327
10328void k007342_device::device_config_complete()
10329{
10330}
10331
10332//-------------------------------------------------
10333//  device_start - device-specific startup
10334//-------------------------------------------------
10335
10336void k007342_device::device_start()
10337{
10338   DEVICE_START_NAME( k007342 )(this);
10339}
10340
10341//-------------------------------------------------
10342//  device_reset - device-specific reset
10343//-------------------------------------------------
10344
10345void k007342_device::device_reset()
10346{
10347   DEVICE_RESET_NAME( k007342 )(this);
10348}
10349
10350
10351const device_type K007420 = &device_creator<k007420_device>;
10352
10353k007420_device::k007420_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10354   : device_t(mconfig, K007420, "Konami 007420", tag, owner, clock)
10355{
10356   m_token = global_alloc_array_clear(UINT8, sizeof(k007420_state));
10357}
10358
10359//-------------------------------------------------
10360//  device_config_complete - perform any
10361//  operations now that the configuration is
10362//  complete
10363//-------------------------------------------------
10364
10365void k007420_device::device_config_complete()
10366{
10367}
10368
10369//-------------------------------------------------
10370//  device_start - device-specific startup
10371//-------------------------------------------------
10372
10373void k007420_device::device_start()
10374{
10375   DEVICE_START_NAME( k007420 )(this);
10376}
10377
10378//-------------------------------------------------
10379//  device_reset - device-specific reset
10380//-------------------------------------------------
10381
10382void k007420_device::device_reset()
10383{
10384   DEVICE_RESET_NAME( k007420 )(this);
10385}
10386
10387
10388const device_type K052109 = &device_creator<k052109_device>;
10389
10390k052109_device::k052109_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10391   : device_t(mconfig, K052109, "Konami 052109", tag, owner, clock)
10392{
10393   m_token = global_alloc_array_clear(UINT8, sizeof(k052109_state));
10394}
10395
10396//-------------------------------------------------
10397//  device_config_complete - perform any
10398//  operations now that the configuration is
10399//  complete
10400//-------------------------------------------------
10401
10402void k052109_device::device_config_complete()
10403{
10404}
10405
10406//-------------------------------------------------
10407//  device_start - device-specific startup
10408//-------------------------------------------------
10409
10410void k052109_device::device_start()
10411{
10412   DEVICE_START_NAME( k052109 )(this);
10413}
10414
10415//-------------------------------------------------
10416//  device_reset - device-specific reset
10417//-------------------------------------------------
10418
10419void k052109_device::device_reset()
10420{
10421   DEVICE_RESET_NAME( k052109 )(this);
10422}
10423
10424
10425const device_type K051960 = &device_creator<k051960_device>;
10426
10427k051960_device::k051960_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10428   : device_t(mconfig, K051960, "Konami 051960", tag, owner, clock)
10429{
10430   m_token = global_alloc_array_clear(UINT8, sizeof(k051960_state));
10431}
10432
10433//-------------------------------------------------
10434//  device_config_complete - perform any
10435//  operations now that the configuration is
10436//  complete
10437//-------------------------------------------------
10438
10439void k051960_device::device_config_complete()
10440{
10441}
10442
10443//-------------------------------------------------
10444//  device_start - device-specific startup
10445//-------------------------------------------------
10446
10447void k051960_device::device_start()
10448{
10449   DEVICE_START_NAME( k051960 )(this);
10450}
10451
10452//-------------------------------------------------
10453//  device_reset - device-specific reset
10454//-------------------------------------------------
10455
10456void k051960_device::device_reset()
10457{
10458   DEVICE_RESET_NAME( k051960 )(this);
10459}
10460
10461
10462const device_type K053244 = &device_creator<k05324x_device>;
10463
10464k05324x_device::k05324x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10465   : device_t(mconfig, K053244, "Konami 053244 & 053245", tag, owner, clock)
10466{
10467   m_token = global_alloc_array_clear(UINT8, sizeof(k05324x_state));
10468}
10469
10470//-------------------------------------------------
10471//  device_config_complete - perform any
10472//  operations now that the configuration is
10473//  complete
10474//-------------------------------------------------
10475
10476void k05324x_device::device_config_complete()
10477{
10478}
10479
10480//-------------------------------------------------
10481//  device_start - device-specific startup
10482//-------------------------------------------------
10483
10484void k05324x_device::device_start()
10485{
10486   DEVICE_START_NAME( k05324x )(this);
10487}
10488
10489//-------------------------------------------------
10490//  device_reset - device-specific reset
10491//-------------------------------------------------
10492
10493void k05324x_device::device_reset()
10494{
10495   DEVICE_RESET_NAME( k05324x )(this);
10496}
10497
10498
10499const device_type K053246 = &device_creator<k053247_device>;
10500
10501k053247_device::k053247_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10502   : device_t(mconfig, K053246, "Konami 053246 & 053247", tag, owner, clock)
10503{
10504   m_token = global_alloc_array_clear(UINT8, sizeof(k053247_state));
10505}
10506
10507//-------------------------------------------------
10508//  device_config_complete - perform any
10509//  operations now that the configuration is
10510//  complete
10511//-------------------------------------------------
10512
10513void k053247_device::device_config_complete()
10514{
10515}
10516
10517//-------------------------------------------------
10518//  device_start - device-specific startup
10519//-------------------------------------------------
10520
10521void k053247_device::device_start()
10522{
10523   DEVICE_START_NAME( k053247 )(this);
10524}
10525
10526//-------------------------------------------------
10527//  device_reset - device-specific reset
10528//-------------------------------------------------
10529
10530void k053247_device::device_reset()
10531{
10532   DEVICE_RESET_NAME( k053247 )(this);
10533}
10534
10535
10536const device_type K055673 = &device_creator<k055673_device>;
10537
10538k055673_device::k055673_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10539   : device_t(mconfig, K055673, "Konami 055673", tag, owner, clock)
10540{
10541   m_token = global_alloc_array_clear(UINT8, sizeof(k053247_state));
10542}
10543
10544//-------------------------------------------------
10545//  device_config_complete - perform any
10546//  operations now that the configuration is
10547//  complete
10548//-------------------------------------------------
10549
10550void k055673_device::device_config_complete()
10551{
10552}
10553
10554//-------------------------------------------------
10555//  device_start - device-specific startup
10556//-------------------------------------------------
10557
10558void k055673_device::device_start()
10559{
10560   DEVICE_START_NAME( k055673 )(this);
10561}
10562
10563//-------------------------------------------------
10564//  device_reset - device-specific reset
10565//-------------------------------------------------
10566
10567void k055673_device::device_reset()
10568{
10569   DEVICE_RESET_NAME( k053247 )(this);
10570}
10571
10572
10573const device_type K051316 = &device_creator<k051316_device>;
10574
10575k051316_device::k051316_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10576   : device_t(mconfig, K051316, "Konami 051316", tag, owner, clock)
10577{
10578   m_token = global_alloc_array_clear(UINT8, sizeof(k051316_state));
10579}
10580
10581//-------------------------------------------------
10582//  device_config_complete - perform any
10583//  operations now that the configuration is
10584//  complete
10585//-------------------------------------------------
10586
10587void k051316_device::device_config_complete()
10588{
10589}
10590
10591//-------------------------------------------------
10592//  device_start - device-specific startup
10593//-------------------------------------------------
10594
10595void k051316_device::device_start()
10596{
10597   DEVICE_START_NAME( k051316 )(this);
10598}
10599
10600//-------------------------------------------------
10601//  device_reset - device-specific reset
10602//-------------------------------------------------
10603
10604void k051316_device::device_reset()
10605{
10606   DEVICE_RESET_NAME( k051316 )(this);
10607}
10608
10609
10610const device_type K053936 = &device_creator<k053936_device>;
10611
10612k053936_device::k053936_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10613   : device_t(mconfig, K053936, "Konami 053936", tag, owner, clock)
10614{
10615   m_token = global_alloc_array_clear(UINT8, sizeof(k053936_state));
10616}
10617
10618//-------------------------------------------------
10619//  device_config_complete - perform any
10620//  operations now that the configuration is
10621//  complete
10622//-------------------------------------------------
10623
10624void k053936_device::device_config_complete()
10625{
10626}
10627
10628//-------------------------------------------------
10629//  device_start - device-specific startup
10630//-------------------------------------------------
10631
10632void k053936_device::device_start()
10633{
10634   DEVICE_START_NAME( k053936 )(this);
10635}
10636
10637//-------------------------------------------------
10638//  device_reset - device-specific reset
10639//-------------------------------------------------
10640
10641void k053936_device::device_reset()
10642{
10643   DEVICE_RESET_NAME( k053936 )(this);
10644}
10645
10646
10647const device_type K053251 = &device_creator<k053251_device>;
10648
10649k053251_device::k053251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10650   : device_t(mconfig, K053251, "Konami 053251", tag, owner, clock)
10651{
10652   m_token = global_alloc_array_clear(UINT8, sizeof(k053251_state));
10653}
10654
10655//-------------------------------------------------
10656//  device_config_complete - perform any
10657//  operations now that the configuration is
10658//  complete
10659//-------------------------------------------------
10660
10661void k053251_device::device_config_complete()
10662{
10663}
10664
10665//-------------------------------------------------
10666//  device_start - device-specific startup
10667//-------------------------------------------------
10668
10669void k053251_device::device_start()
10670{
10671   DEVICE_START_NAME( k053251 )(this);
10672}
10673
10674//-------------------------------------------------
10675//  device_reset - device-specific reset
10676//-------------------------------------------------
10677
10678void k053251_device::device_reset()
10679{
10680   DEVICE_RESET_NAME( k053251 )(this);
10681}
10682
10683
10684const device_type K054000 = &device_creator<k054000_device>;
10685
10686k054000_device::k054000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10687   : device_t(mconfig, K054000, "Konami 054000", tag, owner, clock)
10688{
10689   m_token = global_alloc_array_clear(UINT8, sizeof(k054000_state));
10690}
10691
10692//-------------------------------------------------
10693//  device_config_complete - perform any
10694//  operations now that the configuration is
10695//  complete
10696//-------------------------------------------------
10697
10698void k054000_device::device_config_complete()
10699{
10700}
10701
10702//-------------------------------------------------
10703//  device_start - device-specific startup
10704//-------------------------------------------------
10705
10706void k054000_device::device_start()
10707{
10708   DEVICE_START_NAME( k054000 )(this);
10709}
10710
10711//-------------------------------------------------
10712//  device_reset - device-specific reset
10713//-------------------------------------------------
10714
10715void k054000_device::device_reset()
10716{
10717   DEVICE_RESET_NAME( k054000 )(this);
10718}
10719
10720
10721const device_type K051733 = &device_creator<k051733_device>;
10722
10723k051733_device::k051733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10724   : device_t(mconfig, K051733, "Konami 051733", tag, owner, clock)
10725{
10726   m_token = global_alloc_array_clear(UINT8, sizeof(k051733_state));
10727}
10728
10729//-------------------------------------------------
10730//  device_config_complete - perform any
10731//  operations now that the configuration is
10732//  complete
10733//-------------------------------------------------
10734
10735void k051733_device::device_config_complete()
10736{
10737}
10738
10739//-------------------------------------------------
10740//  device_start - device-specific startup
10741//-------------------------------------------------
10742
10743void k051733_device::device_start()
10744{
10745   DEVICE_START_NAME( k051733 )(this);
10746}
10747
10748//-------------------------------------------------
10749//  device_reset - device-specific reset
10750//-------------------------------------------------
10751
10752void k051733_device::device_reset()
10753{
10754   DEVICE_RESET_NAME( k051733 )(this);
10755}
10756
10757
10758const device_type K056832 = &device_creator<k056832_device>;
10759
10760k056832_device::k056832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10761   : device_t(mconfig, K056832, "Konami 056832", tag, owner, clock)
10762{
10763   m_token = global_alloc_array_clear(UINT8, sizeof(k056832_state));
10764}
10765
10766//-------------------------------------------------
10767//  device_config_complete - perform any
10768//  operations now that the configuration is
10769//  complete
10770//-------------------------------------------------
10771
10772void k056832_device::device_config_complete()
10773{
10774}
10775
10776//-------------------------------------------------
10777//  device_start - device-specific startup
10778//-------------------------------------------------
10779
10780void k056832_device::device_start()
10781{
10782   DEVICE_START_NAME( k056832 )(this);
10783}
10784
10785
10786const device_type K055555 = &device_creator<k055555_device>;
10787
10788k055555_device::k055555_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10789   : device_t(mconfig, K055555, "Konami 055555", tag, owner, clock)
10790{
10791   m_token = global_alloc_array_clear(UINT8, sizeof(k055555_state));
10792}
10793
10794//-------------------------------------------------
10795//  device_config_complete - perform any
10796//  operations now that the configuration is
10797//  complete
10798//-------------------------------------------------
10799
10800void k055555_device::device_config_complete()
10801{
10802}
10803
10804//-------------------------------------------------
10805//  device_start - device-specific startup
10806//-------------------------------------------------
10807
10808void k055555_device::device_start()
10809{
10810   DEVICE_START_NAME( k055555 )(this);
10811}
10812
10813//-------------------------------------------------
10814//  device_reset - device-specific reset
10815//-------------------------------------------------
10816
10817void k055555_device::device_reset()
10818{
10819   DEVICE_RESET_NAME( k055555 )(this);
10820}
10821
10822
10823const device_type K054338 = &device_creator<k054338_device>;
10824
10825k054338_device::k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10826   : device_t(mconfig, K054338, "Konami 054338", tag, owner, clock)
10827{
10828   m_token = global_alloc_array_clear(UINT8, sizeof(k054338_state));
10829}
10830
10831//-------------------------------------------------
10832//  device_config_complete - perform any
10833//  operations now that the configuration is
10834//  complete
10835//-------------------------------------------------
10836
10837void k054338_device::device_config_complete()
10838{
10839}
10840
10841//-------------------------------------------------
10842//  device_start - device-specific startup
10843//-------------------------------------------------
10844
10845void k054338_device::device_start()
10846{
10847   DEVICE_START_NAME( k054338 )(this);
10848}
10849
10850//-------------------------------------------------
10851//  device_reset - device-specific reset
10852//-------------------------------------------------
10853
10854void k054338_device::device_reset()
10855{
10856   DEVICE_RESET_NAME( k054338 )(this);
10857}
10858
10859
10860const device_type K001006 = &device_creator<k001006_device>;
10861
10862k001006_device::k001006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10863   : device_t(mconfig, K001006, "Konami 001006", tag, owner, clock)
10864{
10865   m_token = global_alloc_array_clear(UINT8, sizeof(k001006_state));
10866}
10867
10868//-------------------------------------------------
10869//  device_config_complete - perform any
10870//  operations now that the configuration is
10871//  complete
10872//-------------------------------------------------
10873
10874void k001006_device::device_config_complete()
10875{
10876}
10877
10878//-------------------------------------------------
10879//  device_start - device-specific startup
10880//-------------------------------------------------
10881
10882void k001006_device::device_start()
10883{
10884   DEVICE_START_NAME( k001006 )(this);
10885}
10886
10887//-------------------------------------------------
10888//  device_reset - device-specific reset
10889//-------------------------------------------------
10890
10891void k001006_device::device_reset()
10892{
10893   DEVICE_RESET_NAME( k001006 )(this);
10894}
10895
10896
10897const device_type K001005 = &device_creator<k001005_device>;
10898
10899k001005_device::k001005_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10900   : device_t(mconfig, K001005, "Konami 001005", tag, owner, clock)
10901{
10902   m_token = global_alloc_array_clear(UINT8, sizeof(k001005_state));
10903}
10904
10905//-------------------------------------------------
10906//  device_config_complete - perform any
10907//  operations now that the configuration is
10908//  complete
10909//-------------------------------------------------
10910
10911void k001005_device::device_config_complete()
10912{
10913}
10914
10915//-------------------------------------------------
10916//  device_start - device-specific startup
10917//-------------------------------------------------
10918
10919void k001005_device::device_start()
10920{
10921   DEVICE_START_NAME( k001005 )(this);
10922}
10923
10924//-------------------------------------------------
10925//  device_reset - device-specific reset
10926//-------------------------------------------------
10927
10928void k001005_device::device_reset()
10929{
10930   DEVICE_RESET_NAME( k001005 )(this);
10931}
10932
10933//-------------------------------------------------
10934//  device_stop - device-specific stop
10935//-------------------------------------------------
10936
10937void k001005_device::device_stop()
10938{
10939   DEVICE_STOP_NAME( k001005 )(this);
10940}
10941
10942
10943const device_type K001604 = &device_creator<k001604_device>;
10944
10945k001604_device::k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10946   : device_t(mconfig, K001604, "Konami 001604", tag, owner, clock)
10947{
10948   m_token = global_alloc_array_clear(UINT8, sizeof(k001604_state));
10949}
10950
10951//-------------------------------------------------
10952//  device_config_complete - perform any
10953//  operations now that the configuration is
10954//  complete
10955//-------------------------------------------------
10956
10957void k001604_device::device_config_complete()
10958{
10959}
10960
10961//-------------------------------------------------
10962//  device_start - device-specific startup
10963//-------------------------------------------------
10964
10965void k001604_device::device_start()
10966{
10967   DEVICE_START_NAME( k001604 )(this);
10968}
10969
10970//-------------------------------------------------
10971//  device_reset - device-specific reset
10972//-------------------------------------------------
10973
10974void k001604_device::device_reset()
10975{
10976   DEVICE_RESET_NAME( k001604 )(this);
10977}
10978
10979
10980const device_type K037122 = &device_creator<k037122_device>;
10981
10982k037122_device::k037122_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10983   : device_t(mconfig, K037122, "Konami 0371222", tag, owner, clock)
10984{
10985   m_token = global_alloc_array_clear(UINT8, sizeof(k037122_state));
10986}
10987
10988//-------------------------------------------------
10989//  device_config_complete - perform any
10990//  operations now that the configuration is
10991//  complete
10992//-------------------------------------------------
10993
10994void k037122_device::device_config_complete()
10995{
10996}
10997
10998//-------------------------------------------------
10999//  device_start - device-specific startup
11000//-------------------------------------------------
11001
11002void k037122_device::device_start()
11003{
11004   DEVICE_START_NAME( k037122 )(this);
11005}
11006
11007//-------------------------------------------------
11008//  device_reset - device-specific reset
11009//-------------------------------------------------
11010
11011void k037122_device::device_reset()
11012{
11013   DEVICE_RESET_NAME( k037122 )(this);
11014}
11015
11016
trunk/src/mame/video/konicdev.h
r17691r17692
194194private:
195195   // internal state
196196   void *m_token;
197   
198   TILEMAP_MAPPER_MEMBER(k007342_scan);
199   TILE_GET_INFO_MEMBER(k007342_get_tile_info0);
200   TILE_GET_INFO_MEMBER(k007342_get_tile_info1);
197201};
198202
199203extern const device_type K007342;
r17691r17692
234238private:
235239   // internal state
236240   void *m_token;
241   
242   TILE_GET_INFO_MEMBER(k052109_get_tile_info0);
243   TILE_GET_INFO_MEMBER(k052109_get_tile_info1);
244   TILE_GET_INFO_MEMBER(k052109_get_tile_info2);
237245};
238246
239247extern const device_type K052109;
r17691r17692
336344private:
337345   // internal state
338346   void *m_token;
347   
348   TILE_GET_INFO_MEMBER(k051316_get_tile_info0);
339349};
340350
341351extern const device_type K051316;
r17691r17692
435445private:
436446   // internal state
437447   void *m_token;
448
449   TILE_GET_INFO_MEMBER(k056832_get_tile_info0);
450   TILE_GET_INFO_MEMBER(k056832_get_tile_info1);
451   TILE_GET_INFO_MEMBER(k056832_get_tile_info2);
452   TILE_GET_INFO_MEMBER(k056832_get_tile_info3);
453   TILE_GET_INFO_MEMBER(k056832_get_tile_info4);
454   TILE_GET_INFO_MEMBER(k056832_get_tile_info5);
455   TILE_GET_INFO_MEMBER(k056832_get_tile_info6);
456   TILE_GET_INFO_MEMBER(k056832_get_tile_info7);
457   TILE_GET_INFO_MEMBER(k056832_get_tile_info8);
458   TILE_GET_INFO_MEMBER(k056832_get_tile_info9);
459   TILE_GET_INFO_MEMBER(k056832_get_tile_infoa);
460   TILE_GET_INFO_MEMBER(k056832_get_tile_infob);
461   TILE_GET_INFO_MEMBER(k056832_get_tile_infoc);
462   TILE_GET_INFO_MEMBER(k056832_get_tile_infod);
463   TILE_GET_INFO_MEMBER(k056832_get_tile_infoe);
464   TILE_GET_INFO_MEMBER(k056832_get_tile_infof);
438465};
439466
440467extern const device_type K056832;
r17691r17692
536563private:
537564   // internal state
538565   void *m_token;
566   
567   TILEMAP_MAPPER_MEMBER(k001604_scan_layer_8x8_0_size0);
568   TILEMAP_MAPPER_MEMBER(k001604_scan_layer_8x8_0_size1);
569   TILEMAP_MAPPER_MEMBER(k001604_scan_layer_8x8_1_size0);
570   TILEMAP_MAPPER_MEMBER(k001604_scan_layer_8x8_1_size1);
571   TILEMAP_MAPPER_MEMBER(slrasslt_scan_layer_8x8_0_size0);
572   TILEMAP_MAPPER_MEMBER(slrasslt_scan_layer_8x8_1_size0);
573   TILEMAP_MAPPER_MEMBER(k001604_scan_layer_roz_0_size0);
574   TILEMAP_MAPPER_MEMBER(k001604_scan_layer_roz_0_size1);
575   TILEMAP_MAPPER_MEMBER(k001604_scan_layer_roz_1_size0);
576   TILEMAP_MAPPER_MEMBER(k001604_scan_layer_roz_1_size1);
577   TILE_GET_INFO_MEMBER(k001604_tile_info_layer_8x8);
578   TILE_GET_INFO_MEMBER(k001604_tile_info_layer_roz);
539579};
540580
541581extern const device_type K001604;
r17691r17692
556596private:
557597   // internal state
558598   void *m_token;
599   
600   TILE_GET_INFO_MEMBER(k037122_tile_info_layer0);
601   TILE_GET_INFO_MEMBER(k037122_tile_info_layer1);
559602};
560603
561604extern const device_type K037122;
trunk/src/mame/video/gp9001.c
r17691r17692
233233   return (spacenum == 0) ? &m_space_config : NULL;
234234}
235235
236
237
238
239static TILE_GET_INFO_DEVICE( get_top0_tile_info )
236TILE_GET_INFO_MEMBER(gp9001vdp_device::get_top0_tile_info)
240237{
241238   int color, tile_number, attrib;
242239
243   gp9001vdp_device *vdp = (gp9001vdp_device*)device;
240   attrib = top.vram16[2*tile_index];
244241
245   attrib = vdp->top.vram16[2*tile_index];
242   tile_number = top.vram16[2*tile_index+1];
246243
247   tile_number = vdp->top.vram16[2*tile_index+1];
248
249   if (vdp->gp9001_gfxrom_is_banked)
244   if (gp9001_gfxrom_is_banked)
250245   {
251      tile_number = ( vdp->gp9001_gfxrom_bank[(tile_number >> 13) & 7] << 13 ) | ( tile_number & 0x1fff );
246      tile_number = ( gp9001_gfxrom_bank[(tile_number >> 13) & 7] << 13 ) | ( tile_number & 0x1fff );
252247   }
253248
254249   color = attrib & 0x0fff; // 0x0f00 priority, 0x007f colour
255   SET_TILE_INFO_DEVICE(
256         vdp->tile_region,
250   SET_TILE_INFO_MEMBER(
251         tile_region,
257252         tile_number,
258253         color,
259254         0);
260255   //tileinfo.category = (attrib & 0x0f00) >> 8;
261256}
262257
263
264
265static TILE_GET_INFO_DEVICE( get_fg0_tile_info )
258TILE_GET_INFO_MEMBER(gp9001vdp_device::get_fg0_tile_info)
266259{
267260   int color, tile_number, attrib;
268261
269   gp9001vdp_device *vdp = (gp9001vdp_device*)device;
262   attrib = fg.vram16[2*tile_index];
270263
271   attrib = vdp->fg.vram16[2*tile_index];
264   tile_number = fg.vram16[2*tile_index+1];
272265
273   tile_number = vdp->fg.vram16[2*tile_index+1];
274266
275
276   if (vdp->gp9001_gfxrom_is_banked)
267   if (gp9001_gfxrom_is_banked)
277268   {
278      tile_number = ( vdp->gp9001_gfxrom_bank[(tile_number >> 13) & 7] << 13 ) | ( tile_number & 0x1fff );
269      tile_number = ( gp9001_gfxrom_bank[(tile_number >> 13) & 7] << 13 ) | ( tile_number & 0x1fff );
279270   }
280271
281272   color = attrib & 0x0fff; // 0x0f00 priority, 0x007f colour
282   SET_TILE_INFO_DEVICE(
283         vdp->tile_region,
273   SET_TILE_INFO_MEMBER(
274         tile_region,
284275         tile_number,
285276         color,
286277         0);
287278   //tileinfo.category = (attrib & 0x0f00) >> 8;
288279}
289280
290static TILE_GET_INFO_DEVICE( get_bg0_tile_info )
281TILE_GET_INFO_MEMBER(gp9001vdp_device::get_bg0_tile_info)
291282{
292283   int color, tile_number, attrib;
293   gp9001vdp_device *vdp = (gp9001vdp_device*)device;
284   attrib = bg.vram16[2*tile_index];
294285
295   attrib = vdp->bg.vram16[2*tile_index];
286   tile_number = bg.vram16[2*tile_index+1];
296287
297   tile_number = vdp->bg.vram16[2*tile_index+1];
298
299   if (vdp->gp9001_gfxrom_is_banked)
288   if (gp9001_gfxrom_is_banked)
300289   {
301      tile_number = ( vdp->gp9001_gfxrom_bank[(tile_number >> 13) & 7] << 13 ) | ( tile_number & 0x1fff );
290      tile_number = ( gp9001_gfxrom_bank[(tile_number >> 13) & 7] << 13 ) | ( tile_number & 0x1fff );
302291   }
303292
304293   color = attrib & 0x0fff; // 0x0f00 priority, 0x007f colour
305   SET_TILE_INFO_DEVICE(
306         vdp->tile_region,
294   SET_TILE_INFO_MEMBER(
295         tile_region,
307296         tile_number,
308297         color,
309298         0);
r17691r17692
314303{
315304   tile_region = region;
316305
317   top.tmap = tilemap_create_device(this, get_top0_tile_info,TILEMAP_SCAN_ROWS,16,16,32,32);
318   fg.tmap = tilemap_create_device(this, get_fg0_tile_info,TILEMAP_SCAN_ROWS,16,16,32,32);
319   bg.tmap = tilemap_create_device(this, get_bg0_tile_info,TILEMAP_SCAN_ROWS,16,16,32,32);
306   top.tmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gp9001vdp_device::get_top0_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
307   fg.tmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gp9001vdp_device::get_fg0_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
308   bg.tmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gp9001vdp_device::get_bg0_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
320309
321310   top.tmap->set_transparent_pen(0);
322311   fg.tmap->set_transparent_pen(0);
trunk/src/mame/video/gp9001.h
r17691r17692
7272
7373   address_space_config      m_space_config;
7474   UINT8                  m_gfxregion;
75   
76   TILE_GET_INFO_MEMBER(get_top0_tile_info);
77   TILE_GET_INFO_MEMBER(get_fg0_tile_info);
78   TILE_GET_INFO_MEMBER(get_bg0_tile_info);   
7579};
7680
7781extern const device_type GP9001_VDP;
trunk/src/emu/tilemap.h
r17691r17692
433433
434434// legacy callbacks
435435typedef void (*tile_get_info_func)(running_machine &machine, tile_data &tileinfo, tilemap_memory_index tile_index, void *param);
436typedef void (*tile_get_info_device_func)(device_t *device, tile_data &tileinfo, tilemap_memory_index tile_index, void *param);
437436typedef tilemap_memory_index (*tilemap_mapper_func)(running_machine &machine, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
438437
439438
r17691r17692
676675// function definition for a get info callback
677676#define TILE_GET_INFO(_name)         void _name(running_machine &machine, tile_data &tileinfo, tilemap_memory_index tile_index, void *param)
678677#define TILE_GET_INFO_MEMBER(_name)      void _name(tile_data &tileinfo, tilemap_memory_index tile_index, void *param)
679#define TILE_GET_INFO_DEVICE(_name)      void _name(device_t *device, tile_data &tileinfo, tilemap_memory_index tile_index, void *param)
680678
681679// function definition for a logical-to-memory mapper
682680#define TILEMAP_MAPPER(_name)         tilemap_memory_index _name(running_machine &machine, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
r17691r17692
685683// useful macro inside of a TILE_GET_INFO callback to set tile information
686684#define SET_TILE_INFO(GFX,CODE,COLOR,FLAGS)         tileinfo.set(machine, GFX, CODE, COLOR, FLAGS)
687685#define SET_TILE_INFO_MEMBER(GFX,CODE,COLOR,FLAGS)  tileinfo.set(machine(), GFX, CODE, COLOR, FLAGS)
688#define SET_TILE_INFO_DEVICE(GFX,CODE,COLOR,FLAGS)  tileinfo.set(device->machine(), GFX, CODE, COLOR, FLAGS)
689686
690687// Macros for setting tile attributes in the TILE_GET_INFO callback:
691688//   TILE_FLIP_YX assumes that flipy is in bit 1 and flipx is in bit 0
r17691r17692
709706inline tilemap_t *tilemap_create(running_machine &machine, tile_get_info_func tile_get_info, tilemap_standard_mapper mapper, int tilewidth, int tileheight, int cols, int rows)
710707{ return &machine.tilemap().create(tilemap_get_info_delegate(tile_get_info, "", &machine), mapper, tilewidth, tileheight, cols, rows); }
711708
712// create a new tilemap that is owned by a device
713inline tilemap_t *tilemap_create_device(device_t *device, tile_get_info_device_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows)
714{ return &device->machine().tilemap().create(tilemap_get_info_delegate(tile_get_info, "", device), tilemap_mapper_delegate(mapper, "", &device->machine()), tilewidth, tileheight, cols, rows); }
715709
716inline tilemap_t *tilemap_create_device(device_t *device, tile_get_info_device_func tile_get_info, tilemap_standard_mapper mapper, int tilewidth, int tileheight, int cols, int rows)
717{ return &device->machine().tilemap().create(tilemap_get_info_delegate(tile_get_info, "", device), mapper, tilewidth, tileheight, cols, rows); }
718
719
720
721710//**************************************************************************
722711//  INLINE FUNCTIONS
723712//**************************************************************************

Previous 199869 Revisions Next


© 1997-2024 The MAME Team