Previous 199869 Revisions Next

r24009 Sunday 30th June, 2013 at 02:59:40 UTC by Tafoid
Modernization of the remainder of taitoic as well as the deco_bac06 device.  [Osso]
[src/mame/drivers]actfancr.c asuka.c dec0.c dec8.c galastrm.c groundfx.c gunbustr.c madmotor.c ninjaw.c othunder.c pcktgal.c slapshot.c stadhero.c superchs.c taito_b.c taito_f2.c taito_z.c undrfire.c warriorb.c
[src/mame/includes]actfancr.h asuka.h dec8.h galastrm.h groundfx.h gunbustr.h madmotor.h ninjaw.h othunder.h pcktgal.h stadhero.h superchs.h taito_f2.h taito_z.h undrfire.h warriorb.h
[src/mame/video]actfancr.c dec0.c dec8.c decbac06.c decbac06.h galastrm.c groundfx.c gunbustr.c madmotor.c ninjaw.c othunder.c pcktgal.c slapshot.c stadhero.c superchs.c taito_b.c taito_f2.c taito_z.c taitoic.c taitoic.h undrfire.c warriorb.c

trunk/src/mame/drivers/taito_b.c
r24008r24009
474474
475475
476476#define TC0180VCU_MEMRW( ADDR )                                         \
477   AM_RANGE(ADDR+0x00000, ADDR+0x0ffff) AM_DEVREADWRITE_LEGACY("tc0180vcu", tc0180vcu_word_r, tc0180vcu_word_w)    \
477   AM_RANGE(ADDR+0x00000, ADDR+0x0ffff) AM_DEVREADWRITE("tc0180vcu", tc0180vcu_device, word_r, word_w)    \
478478   AM_RANGE(ADDR+0x10000, ADDR+0x1197f) AM_RAM AM_SHARE("spriteram")   \
479479   AM_RANGE(ADDR+0x11980, ADDR+0x137ff) AM_RAM                 \
480   AM_RANGE(ADDR+0x13800, ADDR+0x13fff) AM_DEVREADWRITE_LEGACY("tc0180vcu", tc0180vcu_scroll_r, tc0180vcu_scroll_w)    \
481   AM_RANGE(ADDR+0x18000, ADDR+0x1801f) AM_DEVREADWRITE_LEGACY("tc0180vcu", tc0180vcu_ctrl_r, tc0180vcu_ctrl_w)        \
480   AM_RANGE(ADDR+0x13800, ADDR+0x13fff) AM_DEVREADWRITE("tc0180vcu", tc0180vcu_device, scroll_r, scroll_w)    \
481   AM_RANGE(ADDR+0x18000, ADDR+0x1801f) AM_DEVREADWRITE("tc0180vcu", tc0180vcu_device, ctrl_r, ctrl_w)        \
482482   AM_RANGE(ADDR+0x40000, ADDR+0x7ffff) AM_READWRITE(tc0180vcu_framebuffer_word_r, tc0180vcu_framebuffer_word_w)
483483
484484
trunk/src/mame/drivers/taito_f2.c
r24008r24009
265265#include "cpu/z80/z80.h"
266266#include "includes/taitoipt.h"
267267#include "cpu/m68000/m68000.h"
268#include "video/taitoic.h"
269268#include "audio/taitosnd.h"
270#include "machine/taitoio.h"
271269#include "includes/taito_f2.h"
272270#include "sound/2203intf.h"
273271#include "sound/2610intf.h"
r24008r24009
689687static ADDRESS_MAP_START( finalb_map, AS_PROGRAM, 16, taitof2_state )
690688   AM_RANGE(0x000000, 0x03ffff) AM_ROM
691689   AM_RANGE(0x100000, 0x10ffff) AM_RAM
692   AM_RANGE(0x200000, 0x200007) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_word_w)    /* palette */
690   AM_RANGE(0x200000, 0x200007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, word_w)    /* palette */
693691   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
694692   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
695693   AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
r24008r24009
764762static ADDRESS_MAP_START( qtorimon_map, AS_PROGRAM, 16, taitof2_state )
765763   AM_RANGE(0x000000, 0x07ffff) AM_ROM
766764   AM_RANGE(0x100000, 0x10ffff) AM_RAM
767   AM_RANGE(0x200000, 0x200007) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_word_w)    /* palette */
765   AM_RANGE(0x200000, 0x200007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, word_w)    /* palette */
768766   AM_RANGE(0x500000, 0x50000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
769767   AM_RANGE(0x600000, 0x600001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00)
770768   AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00)
r24008r24009
790788static ADDRESS_MAP_START( quizhq_map, AS_PROGRAM, 16, taitof2_state )
791789   AM_RANGE(0x000000, 0x0bffff) AM_ROM
792790   AM_RANGE(0x100000, 0x10ffff) AM_RAM
793   AM_RANGE(0x200000, 0x200007) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_word_w)    /* palette */
791   AM_RANGE(0x200000, 0x200007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, word_w)    /* palette */
794792   AM_RANGE(0x500004, 0x500005) AM_WRITE(growl_coin_word_w)
795793   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSWB")
796794   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("IN0")
r24008r24009
862860   AM_RANGE(0x000000, 0x0fffff) AM_ROM
863861   AM_RANGE(0x110000, 0x11ffff) AM_RAM   /* "sram" */
864862   AM_RANGE(0x120000, 0x12ffff) AM_RAM
865   AM_RANGE(0x200000, 0x200007) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_word_w)    /* palette */
863   AM_RANGE(0x200000, 0x200007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, word_w)    /* palette */
866864   AM_RANGE(0x300000, 0x30000f) AM_READ(mjnquest_dsw_r)
867865   AM_RANGE(0x310000, 0x310001) AM_READ(mjnquest_input_r)
868866   AM_RANGE(0x320000, 0x320001) AM_WRITE(mjnquest_inputselect_w)
r24008r24009
881879   AM_RANGE(0x100000, 0x10ffff) AM_RAM
882880   AM_RANGE(0x200000, 0x20ffff) AM_RAM AM_SHARE("spriteram")
883881   AM_RANGE(0x300000, 0x30000f) AM_WRITE(taitof2_spritebank_w) /* updated at $a6e, off irq5 */
884   AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_word_r, tc0480scp_word_w)     /* tilemaps */
885   AM_RANGE(0x430000, 0x43002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w)
882   AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, word_r, word_w)     /* tilemaps */
883   AM_RANGE(0x430000, 0x43002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, ctrl_word_r, ctrl_word_w)
886884   AM_RANGE(0x500000, 0x50001f) AM_DEVWRITE8("tc0360pri", tc0360pri_device, write, 0x00ff)  /* 500002 written like a watchdog?! */
887885   AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
888886   AM_RANGE(0x700006, 0x700007) AM_WRITE(taitof2_4p_coin_word_w)
r24008r24009
997995   AM_RANGE(0x100000, 0x10ffff) AM_RAM
998996   AM_RANGE(0x300000, 0x30ffff) AM_RAM AM_SHARE("spriteram")
999997//  AM_RANGE(0x42000c, 0x42000f) AM_WRITENOP   /* zeroed */
1000   AM_RANGE(0x500000, 0x50ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_word_r, tc0480scp_word_w)     /* tilemaps */
1001   AM_RANGE(0x530000, 0x53002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w)
998   AM_RANGE(0x500000, 0x50ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, word_r, word_w)     /* tilemaps */
999   AM_RANGE(0x530000, 0x53002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, ctrl_word_r, ctrl_word_w)
10021000   AM_RANGE(0x600000, 0x60001f) AM_DEVWRITE8("tc0360pri", tc0360pri_device, write, 0x00ff)
10031001   AM_RANGE(0x700000, 0x703fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
10041002   AM_RANGE(0x800000, 0x80000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_wordswap_r, halfword_wordswap_w)
r24008r24009
10431041   AM_RANGE(0x100000, 0x10ffff) AM_RAM
10441042   AM_RANGE(0x200000, 0x20ffff) AM_RAM AM_SHARE("spriteram")
10451043   AM_RANGE(0x300000, 0x30000f) AM_WRITE(taitof2_spritebank_w)
1046   AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_word_r, tc0480scp_word_w)     /* tilemaps */
1044   AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, word_r, word_w)     /* tilemaps */
10471045//    AM_RANGE(0x42000c, 0x42000f) AM_WRITENOP   /* zeroed */
1048   AM_RANGE(0x430000, 0x43002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w)
1046   AM_RANGE(0x430000, 0x43002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, ctrl_word_r, ctrl_word_w)
10491047   AM_RANGE(0x500000, 0x50001f) AM_DEVWRITE8("tc0360pri", tc0360pri_device, write, 0x00ff)  /* uses 500002 like a watchdog !? */
10501048   AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
10511049   AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSWA")
trunk/src/mame/drivers/groundfx.c
r24008r24009
6464
6565#include "emu.h"
6666#include "cpu/m68000/m68000.h"
67#include "video/taitoic.h"
6867#include "machine/eeprom.h"
6968#include "sound/es5506.h"
7069#include "audio/taito_en.h"
r24008r24009
228227   AM_RANGE(0x500000, 0x500007) AM_WRITE(groundfx_input_w) /* eeprom etc. */
229228   AM_RANGE(0x600000, 0x600003) AM_READWRITE(groundfx_adc_r,groundfx_adc_w)
230229   AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_SHARE("snd_shared")
231   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_long_r, tc0480scp_long_w)      /* tilemaps */
232   AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_long_r, tc0480scp_ctrl_long_w)  // debugging
230   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, long_r, long_w)      /* tilemaps */
231   AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, ctrl_long_r, ctrl_long_w)  // debugging
233232   AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, long_r, long_w)    /* piv tilemaps */
234233   AM_RANGE(0x920000, 0x92000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_long_r, ctrl_long_w)
235234   AM_RANGE(0xa00000, 0xa0ffff) AM_RAM_WRITE(color_ram_w) AM_SHARE("paletteram") /* palette ram */
trunk/src/mame/drivers/madmotor.c
r24008r24009
1919#include "sound/2151intf.h"
2020#include "sound/okim6295.h"
2121#include "includes/madmotor.h"
22#include "video/decbac06.h"
2322#include "video/decmxc06.h"
2423
2524/******************************************************************************/
r24008r24009
3938
4039static ADDRESS_MAP_START( madmotor_map, AS_PROGRAM, 16, madmotor_state )
4140   AM_RANGE(0x000000, 0x07ffff) AM_ROM
42   AM_RANGE(0x180000, 0x180007) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_0_w)                          /* text layer */
43   AM_RANGE(0x180010, 0x180017) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_1_w)
44   AM_RANGE(0x184000, 0x18407f) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
41   AM_RANGE(0x180000, 0x180007) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_0_w)                          /* text layer */
42   AM_RANGE(0x180010, 0x180017) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_1_w)
43   AM_RANGE(0x184000, 0x18407f) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_colscroll_r, pf_colscroll_w)
4544   AM_RANGE(0x184080, 0x1843ff) AM_RAM
46   AM_RANGE(0x184400, 0x1847ff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
47   AM_RANGE(0x188000, 0x189fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
45   AM_RANGE(0x184400, 0x1847ff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_rowscroll_r, pf_rowscroll_w)
46   AM_RANGE(0x188000, 0x189fff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_data_r, pf_data_w)
4847   AM_RANGE(0x18c000, 0x18c001) AM_NOP
49   AM_RANGE(0x190000, 0x190007) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_0_w)                          /* text layer */
50   AM_RANGE(0x190010, 0x190017) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_1_w)
51   AM_RANGE(0x198000, 0x1987ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
48   AM_RANGE(0x190000, 0x190007) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control_0_w)                          /* text layer */
49   AM_RANGE(0x190010, 0x190017) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control_1_w)
50   AM_RANGE(0x198000, 0x1987ff) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_data_r, pf_data_w)
5251   AM_RANGE(0x19c000, 0x19c001) AM_READNOP
53   AM_RANGE(0x1a0000, 0x1a0007) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_0_w)                          /* text layer */
54   AM_RANGE(0x1a0010, 0x1a0017) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_1_w)
55   AM_RANGE(0x1a4000, 0x1a4fff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
52   AM_RANGE(0x1a0000, 0x1a0007) AM_DEVWRITE("tilegen3", deco_bac06_device, pf_control_0_w)                          /* text layer */
53   AM_RANGE(0x1a0010, 0x1a0017) AM_DEVWRITE("tilegen3", deco_bac06_device, pf_control_1_w)
54   AM_RANGE(0x1a4000, 0x1a4fff) AM_DEVREADWRITE("tilegen3", deco_bac06_device, pf_data_r, pf_data_w)
5655   AM_RANGE(0x3e0000, 0x3e3fff) AM_RAM
5756   AM_RANGE(0x3e8000, 0x3e87ff) AM_RAM AM_SHARE("spriteram")
5857   AM_RANGE(0x3f0000, 0x3f07ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram")
r24008r24009
253252   MCFG_PALETTE_LENGTH(1024)
254253
255254   MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
256   deco_bac06_device::set_gfx_region_wide(*device, 0,0,0);
255   deco_bac06_device::set_gfx_region_wide(*device,0,0,0);
257256   MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0)
258   deco_bac06_device::set_gfx_region_wide(*device, 0,1,0);
257   deco_bac06_device::set_gfx_region_wide(*device,0,1,0);
259258   MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0)
260   deco_bac06_device::set_gfx_region_wide(*device, 0,2,1);
259   deco_bac06_device::set_gfx_region_wide(*device,0,2,1);
261260
262261   MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
263262   deco_mxc06_device::set_gfx_region(*device, 3);
trunk/src/mame/drivers/undrfire.c
r24008r24009
188188
189189#include "emu.h"
190190#include "cpu/m68000/m68000.h"
191#include "video/taitoic.h"
192191#include "machine/eeprom.h"
193192#include "sound/es5506.h"
194193#include "audio/taito_en.h"
r24008r24009
487486   AM_RANGE(0x500000, 0x500007) AM_READWRITE(undrfire_input_r, undrfire_input_w)       /* eerom etc. */
488487   AM_RANGE(0x600000, 0x600007) AM_READWRITE(unknown_hardware_r, unknown_int_req_w)    /* int request for unknown hardware */
489488   AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_SHARE("snd_shared")
490   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_long_r, tc0480scp_long_w)        /* tilemaps */
491   AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_long_r, tc0480scp_ctrl_long_w)
489   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, long_r, long_w)        /* tilemaps */
490   AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, ctrl_long_r, ctrl_long_w)
492491   AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, long_r, long_w)        /* piv tilemaps */
493492   AM_RANGE(0x920000, 0x92000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_long_r, ctrl_long_w)
494493   AM_RANGE(0xa00000, 0xa0ffff) AM_RAM_WRITE(color_ram_w) AM_SHARE("paletteram")
r24008r24009
506505   AM_RANGE(0x500000, 0x500007) AM_READWRITE(undrfire_input_r, undrfire_input_w)
507506   AM_RANGE(0x600000, 0x600007) AM_READWRITE(cbombers_adc_r, cbombers_adc_w)
508507   AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_SHARE("snd_shared")
509   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_long_r, tc0480scp_long_w)        /* tilemaps */
510   AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_long_r, tc0480scp_ctrl_long_w)
508   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, long_r, long_w)        /* tilemaps */
509   AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, ctrl_long_r, ctrl_long_w)
511510   AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, long_r, long_w)        /* piv tilemaps */
512511   AM_RANGE(0x920000, 0x92000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_long_r, ctrl_long_w)
513512   AM_RANGE(0xa00000, 0xa0ffff) AM_RAM_WRITE(color_ram_w) AM_SHARE("paletteram")
r24008r24009
520519static ADDRESS_MAP_START( cbombers_cpub_map, AS_PROGRAM, 16, undrfire_state )
521520   AM_RANGE(0x000000, 0x03ffff) AM_ROM
522521   AM_RANGE(0x400000, 0x40ffff) AM_RAM /* local ram */
523//  AM_RANGE(0x600000, 0x60ffff) AM_DEVWRITE_LEGACY("tc0480scp", tc0480scp_word_w) /* Only written upon errors */
522//  AM_RANGE(0x600000, 0x60ffff) AM_DEVWRITE("tc0480scp", tc0480scp_device, word_w) /* Only written upon errors */
524523   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(shared_ram_r, shared_ram_w)
525524//  AM_RANGE(0xa00000, 0xa001ff) AM_RAM /* Extra road control?? */
526525ADDRESS_MAP_END
trunk/src/mame/drivers/actfancr.c
r24008r24009
2929#include "sound/3812intf.h"
3030#include "sound/okim6295.h"
3131#include "includes/actfancr.h"
32#include "video/decbac06.h"
3332#include "video/decmxc06.h"
3433
3534/******************************************************************************/
r24008r24009
7372
7473static ADDRESS_MAP_START( actfan_map, AS_PROGRAM, 8, actfancr_state )
7574   AM_RANGE(0x000000, 0x02ffff) AM_ROM
76   AM_RANGE(0x060000, 0x060007) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control0_8bit_w)
77   AM_RANGE(0x060010, 0x06001f) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control1_8bit_swap_w)
78   AM_RANGE(0x062000, 0x063fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_8bit_swap_r, deco_bac06_pf_data_8bit_swap_w)
79   AM_RANGE(0x070000, 0x070007) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control0_8bit_w)
80   AM_RANGE(0x070010, 0x07001f) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control1_8bit_swap_w)
81   AM_RANGE(0x072000, 0x0727ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_8bit_swap_r, deco_bac06_pf_data_8bit_swap_w)
75   AM_RANGE(0x060000, 0x060007) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control0_8bit_w)
76   AM_RANGE(0x060010, 0x06001f) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control1_8bit_swap_w)
77   AM_RANGE(0x062000, 0x063fff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_data_8bit_swap_r, pf_data_8bit_swap_w)
78   AM_RANGE(0x070000, 0x070007) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control0_8bit_w)
79   AM_RANGE(0x070010, 0x07001f) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control1_8bit_swap_w)
80   AM_RANGE(0x072000, 0x0727ff) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_data_8bit_swap_r, pf_data_8bit_swap_w)
8281   AM_RANGE(0x100000, 0x1007ff) AM_RAM AM_SHARE("spriteram")
8382   AM_RANGE(0x110000, 0x110001) AM_WRITE(actfancr_buffer_spriteram_w)
8483   AM_RANGE(0x120000, 0x1205ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_le_w) AM_SHARE("paletteram")
r24008r24009
9392
9493static ADDRESS_MAP_START( triothep_map, AS_PROGRAM, 8, actfancr_state )
9594   AM_RANGE(0x000000, 0x03ffff) AM_ROM
96   AM_RANGE(0x040000, 0x040007) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control0_8bit_w)
97   AM_RANGE(0x040010, 0x04001f) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control1_8bit_swap_w)
98   AM_RANGE(0x044000, 0x045fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_8bit_swap_r, deco_bac06_pf_data_8bit_swap_w)
99   AM_RANGE(0x046400, 0x0467ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_rowscroll_8bit_swap_r, deco_bac06_pf_rowscroll_8bit_swap_w)
100   AM_RANGE(0x060000, 0x060007) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control0_8bit_w)
101   AM_RANGE(0x060010, 0x06001f) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control1_8bit_swap_w)
102   AM_RANGE(0x064000, 0x0647ff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_8bit_swap_r, deco_bac06_pf_data_8bit_swap_w)
103   AM_RANGE(0x066400, 0x0667ff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_rowscroll_8bit_swap_r, deco_bac06_pf_rowscroll_8bit_swap_w)
95   AM_RANGE(0x040000, 0x040007) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control0_8bit_w)
96   AM_RANGE(0x040010, 0x04001f) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control1_8bit_swap_w)
97   AM_RANGE(0x044000, 0x045fff) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_data_8bit_swap_r, pf_data_8bit_swap_w)
98   AM_RANGE(0x046400, 0x0467ff) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_rowscroll_8bit_swap_r, pf_rowscroll_8bit_swap_w)
99   AM_RANGE(0x060000, 0x060007) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control0_8bit_w)
100   AM_RANGE(0x060010, 0x06001f) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control1_8bit_swap_w)
101   AM_RANGE(0x064000, 0x0647ff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_data_8bit_swap_r, pf_data_8bit_swap_w)
102   AM_RANGE(0x066400, 0x0667ff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_rowscroll_8bit_swap_r, pf_rowscroll_8bit_swap_w)
104103   AM_RANGE(0x100000, 0x100001) AM_WRITE(actfancr_sound_w)
105104   AM_RANGE(0x110000, 0x110001) AM_WRITE(actfancr_buffer_spriteram_w)
106105   AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_SHARE("spriteram")
r24008r24009
331330   MCFG_PALETTE_LENGTH(768)
332331
333332   MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
334   deco_bac06_device::set_gfx_region_wide(*device, 2,2,2);
333   deco_bac06_device::set_gfx_region_wide(*device,2,2,2);
335334   MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0)
336   deco_bac06_device::set_gfx_region_wide(*device, 0,0,0);
335   deco_bac06_device::set_gfx_region_wide(*device,0,0,0);
337336
338337   MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
339338   deco_mxc06_device::set_gfx_region(*device, 1);
r24008r24009
381380   MCFG_PALETTE_LENGTH(768)
382381
383382   MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
384   deco_bac06_device::set_gfx_region_wide(*device, 2,2,0);
383   deco_bac06_device::set_gfx_region_wide(*device,2,2,0);
385384   MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0)
386   deco_bac06_device::set_gfx_region_wide(*device, 0,0,0);
385   deco_bac06_device::set_gfx_region_wide(*device,0,0,0);
387386
388387   MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
389388   deco_mxc06_device::set_gfx_region(*device, 1);
trunk/src/mame/drivers/galastrm.c
r24008r24009
3939
4040#include "emu.h"
4141#include "cpu/m68000/m68000.h"
42#include "video/taitoic.h"
4342#include "machine/eeprom.h"
4443#include "sound/es5506.h"
4544#include "audio/taito_en.h"
r24008r24009
179178   AM_RANGE(0x40fff0, 0x40fff3) AM_WRITENOP
180179   AM_RANGE(0x500000, 0x500007) AM_READWRITE(galastrm_adstick_ctrl_r, galastrm_adstick_ctrl_w)
181180   AM_RANGE(0x600000, 0x6007ff) AM_RAM AM_SHARE("snd_shared")                              /* Sound shared ram */
182   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_long_r, tc0480scp_long_w)        /* tilemaps */
183   AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_long_r, tc0480scp_ctrl_long_w)
181   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, long_r, long_w)        /* tilemaps */
182   AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, ctrl_long_r, ctrl_long_w)
184183   AM_RANGE(0x900000, 0x900003) AM_WRITE(galastrm_palette_w)                               /* TC0110PCR */
185184   AM_RANGE(0xb00000, 0xb00003) AM_WRITE(galastrm_tc0610_0_w)                              /* TC0610 */
186185   AM_RANGE(0xc00000, 0xc00003) AM_WRITE(galastrm_tc0610_1_w)
trunk/src/mame/drivers/warriorb.c
r24008r24009
147147#include "cpu/z80/z80.h"
148148#include "rendlay.h"
149149#include "cpu/m68000/m68000.h"
150#include "video/taitoic.h"
151150#include "audio/taitosnd.h"
152151#include "sound/2610intf.h"
153152#include "sound/flt_vol.h"
r24008r24009
156155
157156
158157
159
160
161
162158/***********************************************************
163159                          SOUND
164160***********************************************************/
r24008r24009
228224   AM_RANGE(0x220000, 0x22000f) AM_DEVREADWRITE("tc0100scn_1", tc0100scn_device, ctrl_word_r, ctrl_word_w)
229225   AM_RANGE(0x240000, 0x253fff) AM_DEVREADWRITE("tc0100scn_2", tc0100scn_device, word_r, word_w)      /* tilemaps (2nd screen) */
230226   AM_RANGE(0x260000, 0x26000f) AM_DEVREADWRITE("tc0100scn_2", tc0100scn_device, ctrl_word_r, ctrl_word_w)
231   AM_RANGE(0x400000, 0x400007) AM_DEVREADWRITE_LEGACY("tc0110pcr_1", tc0110pcr_word_r, tc0110pcr_step1_word_w)    /* palette (1st screen) */
232   AM_RANGE(0x420000, 0x420007) AM_DEVREADWRITE_LEGACY("tc0110pcr_2", tc0110pcr_word_r, tc0110pcr_step1_word_w)    /* palette (2nd screen) */
227   AM_RANGE(0x400000, 0x400007) AM_DEVREADWRITE("tc0110pcr_1", tc0110pcr_device, word_r, step1_word_w)    /* palette (1st screen) */
228   AM_RANGE(0x420000, 0x420007) AM_DEVREADWRITE("tc0110pcr_2", tc0110pcr_device, word_r, step1_word_w)    /* palette (2nd screen) */
233229   AM_RANGE(0x600000, 0x6013ff) AM_RAM AM_SHARE("spriteram")
234230   AM_RANGE(0x800000, 0x80000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
235231//  AM_RANGE(0x820000, 0x820001) AM_WRITENOP    // ???
r24008r24009
243239   AM_RANGE(0x320000, 0x32000f) AM_DEVREADWRITE("tc0100scn_1", tc0100scn_device, ctrl_word_r, ctrl_word_w)
244240   AM_RANGE(0x340000, 0x353fff) AM_DEVREADWRITE("tc0100scn_2", tc0100scn_device, word_r, word_w)      /* tilemaps (2nd screen) */
245241   AM_RANGE(0x360000, 0x36000f) AM_DEVREADWRITE("tc0100scn_2", tc0100scn_device, ctrl_word_r, ctrl_word_w)
246   AM_RANGE(0x400000, 0x400007) AM_DEVREADWRITE_LEGACY("tc0110pcr_1", tc0110pcr_word_r, tc0110pcr_step1_word_w)    /* palette (1st screen) */
247   AM_RANGE(0x420000, 0x420007) AM_DEVREADWRITE_LEGACY("tc0110pcr_2", tc0110pcr_word_r, tc0110pcr_step1_word_w)    /* palette (2nd screen) */
242   AM_RANGE(0x400000, 0x400007) AM_DEVREADWRITE("tc0110pcr_1", tc0110pcr_device, word_r, step1_word_w)    /* palette (1st screen) */
243   AM_RANGE(0x420000, 0x420007) AM_DEVREADWRITE("tc0110pcr_2", tc0110pcr_device, word_r, step1_word_w)    /* palette (2nd screen) */
248244   AM_RANGE(0x600000, 0x6013ff) AM_RAM AM_SHARE("spriteram")
249245   AM_RANGE(0x800000, 0x80000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w)
250246//  AM_RANGE(0x820000, 0x820001) AM_WRITENOP    // ? uses bits 0,2,3
trunk/src/mame/drivers/dec0.c
r24008r24009
281281
282282static ADDRESS_MAP_START( dec0_map, AS_PROGRAM, 16, dec0_state )
283283   AM_RANGE(0x000000, 0x05ffff) AM_ROM
284   AM_RANGE(0x240000, 0x240007) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_0_w)                          /* text layer */
285   AM_RANGE(0x240010, 0x240017) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_1_w)
286   AM_RANGE(0x242000, 0x24207f) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
287   AM_RANGE(0x242400, 0x2427ff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
284   AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_0_w)                          /* text layer */
285   AM_RANGE(0x240010, 0x240017) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_1_w)
286   AM_RANGE(0x242000, 0x24207f) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_colscroll_r, pf_colscroll_w)
287   AM_RANGE(0x242400, 0x2427ff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_rowscroll_r, pf_rowscroll_w)
288288   AM_RANGE(0x242800, 0x243fff) AM_RAM                                                     /* Robocop only */
289   AM_RANGE(0x244000, 0x245fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
289   AM_RANGE(0x244000, 0x245fff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_data_r, pf_data_w)
290290
291   AM_RANGE(0x246000, 0x246007) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_0_w)                                  /* first tile layer */
292   AM_RANGE(0x246010, 0x246017) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_1_w)
293   AM_RANGE(0x248000, 0x24807f) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
294   AM_RANGE(0x248400, 0x2487ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
295   AM_RANGE(0x24a000, 0x24a7ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
291   AM_RANGE(0x246000, 0x246007) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control_0_w)                                  /* first tile layer */
292   AM_RANGE(0x246010, 0x246017) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control_1_w)
293   AM_RANGE(0x248000, 0x24807f) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_colscroll_r, pf_colscroll_w)
294   AM_RANGE(0x248400, 0x2487ff) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_rowscroll_r, pf_rowscroll_w)
295   AM_RANGE(0x24a000, 0x24a7ff) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_data_r, pf_data_w)
296296
297   AM_RANGE(0x24c000, 0x24c007) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_0_w)                              /* second tile layer */
298   AM_RANGE(0x24c010, 0x24c017) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_1_w)
299   AM_RANGE(0x24c800, 0x24c87f) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
300   AM_RANGE(0x24cc00, 0x24cfff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
301   AM_RANGE(0x24d000, 0x24d7ff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
297   AM_RANGE(0x24c000, 0x24c007) AM_DEVWRITE("tilegen3", deco_bac06_device, pf_control_0_w)                              /* second tile layer */
298   AM_RANGE(0x24c010, 0x24c017) AM_DEVWRITE("tilegen3", deco_bac06_device, pf_control_1_w)
299   AM_RANGE(0x24c800, 0x24c87f) AM_DEVREADWRITE("tilegen3", deco_bac06_device, pf_colscroll_r, pf_colscroll_w)
300   AM_RANGE(0x24cc00, 0x24cfff) AM_DEVREADWRITE("tilegen3", deco_bac06_device, pf_rowscroll_r, pf_rowscroll_w)
301   AM_RANGE(0x24d000, 0x24d7ff) AM_DEVREADWRITE("tilegen3", deco_bac06_device, pf_data_r, pf_data_w)
302302
303303   AM_RANGE(0x300000, 0x30001f) AM_READ(dec0_rotary_r)
304304   AM_RANGE(0x30c000, 0x30c00b) AM_READ(dec0_controls_r)
r24008r24009
319319static ADDRESS_MAP_START( hippodrm_sub_map, AS_PROGRAM, 8, dec0_state )
320320   AM_RANGE(0x000000, 0x00ffff) AM_ROM
321321   AM_RANGE(0x180000, 0x1800ff) AM_READWRITE(hippodrm_shared_r, hippodrm_shared_w)
322   AM_RANGE(0x1a0000, 0x1a0007) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control0_8bit_packed_w)
323   AM_RANGE(0x1a0010, 0x1a001f) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control1_8bit_swap_w)
324   AM_RANGE(0x1a1000, 0x1a17ff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_8bit_swap_r, deco_bac06_pf_data_8bit_swap_w)
322   AM_RANGE(0x1a0000, 0x1a0007) AM_DEVWRITE("tilegen3", deco_bac06_device, pf_control0_8bit_packed_w)
323   AM_RANGE(0x1a0010, 0x1a001f) AM_DEVWRITE("tilegen3", deco_bac06_device, pf_control1_8bit_swap_w)
324   AM_RANGE(0x1a1000, 0x1a17ff) AM_DEVREADWRITE("tilegen3", deco_bac06_device, pf_data_8bit_swap_r, pf_data_8bit_swap_w)
325325   AM_RANGE(0x1d0000, 0x1d00ff) AM_READWRITE(hippodrm_prot_r, hippodrm_prot_w)
326326   AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") /* Main ram */
327327   AM_RANGE(0x1ff400, 0x1ff403) AM_DEVWRITE("sub", h6280_device, irq_status_w)
r24008r24009
423423{
424424   address_space& space = m_maincpu->space(AS_PROGRAM);
425425
426   deco_bac06_device *tilegen1 = (deco_bac06_device*)m_tilegen1;
427   deco_bac06_device *tilegen2 = (deco_bac06_device*)m_tilegen2;
428
429426   space.install_write_handler( 0x240000, 0x24ffff, write16_delegate(FUNC(dec0_state::unmapped_w),this));
430427
431428   space.install_write_handler( 0x24a000, 0x24a001, write16_delegate(FUNC(dec0_state::slyspy_state_w),this));
r24008r24009
434431   switch (type)
435432   {
436433      case 0:
437         space.install_legacy_write_handler( *tilegen2, 0x240000, 0x240007, FUNC(deco_bac06_pf_control_0_w));
438         space.install_legacy_write_handler( *tilegen2, 0x240010, 0x240017, FUNC(deco_bac06_pf_control_1_w));
434         space.install_write_handler(0x240000, 0x240007, write16_delegate(FUNC(deco_bac06_device::pf_control_0_w), (deco_bac06_device*)m_tilegen2));
435         space.install_write_handler(0x240010, 0x240017, write16_delegate(FUNC(deco_bac06_device::pf_control_1_w), (deco_bac06_device*)m_tilegen2));
439436
440         space.install_legacy_write_handler( *tilegen2, 0x242000, 0x24207f, FUNC(deco_bac06_pf_colscroll_w));
441         space.install_legacy_write_handler( *tilegen2, 0x242400, 0x2427ff, FUNC(deco_bac06_pf_rowscroll_w));
437         space.install_write_handler(0x242000, 0x24207f, write16_delegate(FUNC(deco_bac06_device::pf_colscroll_w), (deco_bac06_device*)m_tilegen2));
438         space.install_write_handler(0x242400, 0x2427ff, write16_delegate(FUNC(deco_bac06_device::pf_rowscroll_w), (deco_bac06_device*)m_tilegen2));
442439
443         space.install_legacy_write_handler( *tilegen2, 0x246000, 0x247fff, FUNC(deco_bac06_pf_data_w));
440         space.install_write_handler(0x246000, 0x247fff, write16_delegate(FUNC(deco_bac06_device::pf_data_w), (deco_bac06_device*)m_tilegen2));
444441
445         space.install_legacy_write_handler( *tilegen1, 0x248000, 0x280007, FUNC(deco_bac06_pf_control_0_w));
446         space.install_legacy_write_handler( *tilegen1, 0x248010, 0x280017, FUNC(deco_bac06_pf_control_1_w));
442         space.install_write_handler(0x248000, 0x280007, write16_delegate(FUNC(deco_bac06_device::pf_control_0_w), (deco_bac06_device*)m_tilegen1));
443         space.install_write_handler(0x248010, 0x280017, write16_delegate(FUNC(deco_bac06_device::pf_control_1_w), (deco_bac06_device*)m_tilegen1));
447444
448         space.install_legacy_write_handler( *tilegen1, 0x24c000, 0x24c07f, FUNC(deco_bac06_pf_colscroll_w));
449         space.install_legacy_write_handler( *tilegen1, 0x24c400, 0x24c7ff, FUNC(deco_bac06_pf_rowscroll_w));
445         space.install_write_handler(0x24c000, 0x24c07f, write16_delegate(FUNC(deco_bac06_device::pf_colscroll_w), (deco_bac06_device*)m_tilegen1));
446         space.install_write_handler(0x24c400, 0x24c7ff, write16_delegate(FUNC(deco_bac06_device::pf_rowscroll_w), (deco_bac06_device*)m_tilegen1));
450447
451         space.install_legacy_write_handler( *tilegen1, 0x24e000, 0x24ffff, FUNC(deco_bac06_pf_data_w));
448         space.install_write_handler(0x24e000, 0x24ffff, write16_delegate(FUNC(deco_bac06_device::pf_data_w), (deco_bac06_device*)m_tilegen1));
452449
453450         break;
454451
r24008r24009
456453         // 0x240000 - 0x241fff not mapped
457454         // 0x242000 - 0x243fff not mapped
458455         // 0x246000 - 0x247fff not mapped
459         space.install_legacy_write_handler( *tilegen1, 0x248000, 0x249fff, FUNC(deco_bac06_pf_data_w));
460         space.install_legacy_write_handler( *tilegen2, 0x24c000, 0x24dfff, FUNC(deco_bac06_pf_data_w));
456         space.install_write_handler(0x248000, 0x249fff, write16_delegate(FUNC(deco_bac06_device::pf_data_w), (deco_bac06_device*)m_tilegen1));
457         space.install_write_handler(0x24c000, 0x24dfff, write16_delegate(FUNC(deco_bac06_device::pf_data_w), (deco_bac06_device*)m_tilegen2));
461458         // 0x24e000 - 0x24ffff not mapped
462459         break;
463460
464461      case 2:
465         space.install_legacy_write_handler( *tilegen2, 0x240000, 0x241fff, FUNC(deco_bac06_pf_data_w));
466         space.install_legacy_write_handler( *tilegen1, 0x242000, 0x243fff, FUNC(deco_bac06_pf_data_w));
462         space.install_write_handler(0x240000, 0x241fff, write16_delegate(FUNC(deco_bac06_device::pf_data_w), (deco_bac06_device*)m_tilegen2));
463         space.install_write_handler(0x242000, 0x243fff, write16_delegate(FUNC(deco_bac06_device::pf_data_w), (deco_bac06_device*)m_tilegen1));
467464         // 0x242000 - 0x243fff not mapped
468465         // 0x246000 - 0x247fff not mapped
469466         // 0x248000 - 0x249fff not mapped
470467         // 0x24c000 - 0x24dfff not mapped
471         space.install_legacy_write_handler( *tilegen1, 0x24e000, 0x24ffff, FUNC(deco_bac06_pf_data_w));
468         space.install_write_handler(0x24e000, 0x24ffff, write16_delegate(FUNC(deco_bac06_device::pf_data_w), (deco_bac06_device*)m_tilegen1));
472469         break;
473470
474471      case 3:
475         space.install_legacy_write_handler( *tilegen1, 0x240000, 0x241fff, FUNC(deco_bac06_pf_data_w));
472         space.install_write_handler(0x240000, 0x241fff, write16_delegate(FUNC(deco_bac06_device::pf_data_w), (deco_bac06_device*)m_tilegen1));
476473         // 0x242000 - 0x243fff not mapped
477474         // 0x246000 - 0x247fff not mapped
478         space.install_legacy_write_handler( *tilegen2, 0x248000, 0x249fff, FUNC(deco_bac06_pf_data_w));
475         space.install_write_handler(0x248000, 0x249fff, write16_delegate(FUNC(deco_bac06_device::pf_data_w), (deco_bac06_device*)m_tilegen2));
479476         // 0x24c000 - 0x24dfff not mapped
480477         // 0x24e000 - 0x24ffff not mapped
481478         break;
r24008r24009
495492   /* The location of p1 & pf2 can change in the 240000 - 24ffff region according to protection */
496493
497494   /* Pf3 is unaffected by protection */
498   AM_RANGE(0x300000, 0x300007) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_0_w)
499   AM_RANGE(0x300010, 0x300017) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_1_w)
500   AM_RANGE(0x300800, 0x30087f) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
501   AM_RANGE(0x300c00, 0x300fff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
502   AM_RANGE(0x301000, 0x3017ff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
495   AM_RANGE(0x300000, 0x300007) AM_DEVWRITE("tilegen3", deco_bac06_device, pf_control_0_w)
496   AM_RANGE(0x300010, 0x300017) AM_DEVWRITE("tilegen3", deco_bac06_device, pf_control_1_w)
497   AM_RANGE(0x300800, 0x30087f) AM_DEVREADWRITE("tilegen3", deco_bac06_device, pf_colscroll_r, pf_colscroll_w)
498   AM_RANGE(0x300c00, 0x300fff) AM_DEVREADWRITE("tilegen3", deco_bac06_device, pf_rowscroll_r, pf_rowscroll_w)
499   AM_RANGE(0x301000, 0x3017ff) AM_DEVREADWRITE("tilegen3", deco_bac06_device, pf_data_r, pf_data_w)
503500
504501   AM_RANGE(0x304000, 0x307fff) AM_RAM AM_SHARE("ram") /* Sly spy main ram */
505502   AM_RANGE(0x308000, 0x3087ff) AM_RAM AM_SHARE("spriteram")   /* Sprites */
r24008r24009
520517   AM_RANGE(0x180008, 0x18000f) AM_WRITENOP /* ?? watchdog ?? */
521518   AM_RANGE(0x1a0000, 0x1a0001) AM_WRITE(midres_sound_w)
522519
523   AM_RANGE(0x200000, 0x200007) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_0_w)
524   AM_RANGE(0x200010, 0x200017) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_1_w)
525   AM_RANGE(0x220000, 0x2207ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
526   AM_RANGE(0x220800, 0x220fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w) /* mirror address used in end sequence */
527   AM_RANGE(0x240000, 0x24007f) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
528   AM_RANGE(0x240400, 0x2407ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
520   AM_RANGE(0x200000, 0x200007) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control_0_w)
521   AM_RANGE(0x200010, 0x200017) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control_1_w)
522   AM_RANGE(0x220000, 0x2207ff) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_data_r, pf_data_w)
523   AM_RANGE(0x220800, 0x220fff) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_data_r, pf_data_w) /* mirror address used in end sequence */
524   AM_RANGE(0x240000, 0x24007f) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_colscroll_r, pf_colscroll_w)
525   AM_RANGE(0x240400, 0x2407ff) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_rowscroll_r, pf_rowscroll_w)
529526
530   AM_RANGE(0x280000, 0x280007) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_0_w)
531   AM_RANGE(0x280010, 0x280017) AM_DEVWRITE_LEGACY("tilegen3", deco_bac06_pf_control_1_w)
532   AM_RANGE(0x2a0000, 0x2a07ff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
533   AM_RANGE(0x2c0000, 0x2c007f) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
534   AM_RANGE(0x2c0400, 0x2c07ff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
527   AM_RANGE(0x280000, 0x280007) AM_DEVWRITE("tilegen3", deco_bac06_device, pf_control_0_w)
528   AM_RANGE(0x280010, 0x280017) AM_DEVWRITE("tilegen3", deco_bac06_device, pf_control_1_w)
529   AM_RANGE(0x2a0000, 0x2a07ff) AM_DEVREADWRITE("tilegen3", deco_bac06_device, pf_data_r, pf_data_w)
530   AM_RANGE(0x2c0000, 0x2c007f) AM_DEVREADWRITE("tilegen3", deco_bac06_device, pf_colscroll_r, pf_colscroll_w)
531   AM_RANGE(0x2c0400, 0x2c07ff) AM_DEVREADWRITE("tilegen3", deco_bac06_device, pf_rowscroll_r, pf_rowscroll_w)
535532
536   AM_RANGE(0x300000, 0x300007) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_0_w)
537   AM_RANGE(0x300010, 0x300017) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_1_w)
538   AM_RANGE(0x320000, 0x321fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
539   AM_RANGE(0x340000, 0x34007f) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
540   AM_RANGE(0x340400, 0x3407ff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
533   AM_RANGE(0x300000, 0x300007) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_0_w)
534   AM_RANGE(0x300010, 0x300017) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_1_w)
535   AM_RANGE(0x320000, 0x321fff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_data_r, pf_data_w)
536   AM_RANGE(0x340000, 0x34007f) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_colscroll_r, pf_colscroll_w)
537   AM_RANGE(0x340400, 0x3407ff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_rowscroll_r, pf_rowscroll_w)
541538
542539   AM_RANGE(0x320000, 0x321fff) AM_RAM
543540ADDRESS_MAP_END
r24008r24009
603600   AM_RANGE(0x242000, 0x24207f) AM_RAM
604601   AM_RANGE(0x242400, 0x2427ff) AM_RAM
605602   AM_RANGE(0x242800, 0x243fff) AM_RAM
606   AM_RANGE(0x244000, 0x245fff) AM_RAM AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
603   AM_RANGE(0x244000, 0x245fff) AM_RAM AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_data_r, pf_data_w)
607604
608605   AM_RANGE(0x246000, 0x246007) AM_RAM         /* first tile layer */
609606   AM_RANGE(0x246010, 0x246017) AM_RAM
610607   AM_RANGE(0x248000, 0x24807f) AM_RAM
611608   AM_RANGE(0x248400, 0x2487ff) AM_RAM
612   AM_RANGE(0x24a000, 0x24a7ff) AM_RAM AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
609   AM_RANGE(0x24a000, 0x24a7ff) AM_RAM AM_DEVREADWRITE("tilegen2",deco_bac06_device, pf_data_r, pf_data_w)
613610
614611   AM_RANGE(0x24c000, 0x24c007) AM_RAM         /* second tile layer */
615612   AM_RANGE(0x24c010, 0x24c017) AM_RAM
616613   AM_RANGE(0x24c800, 0x24c87f) AM_RAM
617614   AM_RANGE(0x24cc00, 0x24cfff) AM_RAM
618   AM_RANGE(0x24d000, 0x24d7ff) AM_RAM AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
615   AM_RANGE(0x24d000, 0x24d7ff) AM_RAM AM_DEVREADWRITE("tilegen3", deco_bac06_device, pf_data_r, pf_data_w)
619616
620617   AM_RANGE(0x300000, 0x30001f) AM_READ(dec0_rotary_r)
621618   AM_RANGE(0x30c000, 0x30c00b) AM_READ(dec0_controls_r)
r24008r24009
633630
634631static ADDRESS_MAP_START( secretab_map, AS_PROGRAM, 16, dec0_automat_state )
635632   AM_RANGE(0x000000, 0x05ffff) AM_ROM
636//  AM_RANGE(0x240000, 0x240007) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_0_w)
637//  AM_RANGE(0x240010, 0x240017) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control_1_w)
638   AM_RANGE(0x246000, 0x247fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
639//  AM_RANGE(0x240000, 0x24007f) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
640//  AM_RANGE(0x240400, 0x2407ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
633//  AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control_0_w)
634//  AM_RANGE(0x240010, 0x240017) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control_1_w)
635   AM_RANGE(0x246000, 0x247fff) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_data_r, pf_data_w)
636//  AM_RANGE(0x240000, 0x24007f) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_colscroll_r, pf_colscroll_w)
637//  AM_RANGE(0x240400, 0x2407ff) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_rowscroll_r, pf_rowscroll_w)
641638
642//  AM_RANGE(0x200000, 0x300007) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_0_w)
643//  AM_RANGE(0x300010, 0x300017) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_1_w)
644   AM_RANGE(0x24e000, 0x24ffff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
645//  AM_RANGE(0x340000, 0x34007f) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_colscroll_r, deco_bac06_pf_colscroll_w)
646//  AM_RANGE(0x340400, 0x3407ff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_rowscroll_r, deco_bac06_pf_rowscroll_w)
639//  AM_RANGE(0x200000, 0x300007) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_0_w)
640//  AM_RANGE(0x300010, 0x300017) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_1_w)
641   AM_RANGE(0x24e000, 0x24ffff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_data_r, pf_data_w)
642//  AM_RANGE(0x340000, 0x34007f) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_colscroll_r, pf_colscroll_w)
643//  AM_RANGE(0x340400, 0x3407ff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_rowscroll_r, pf_rowscroll_w)
647644
648645   AM_RANGE(0x314008, 0x31400f) AM_READ(slyspy_controls_r)
649646//  AM_RANGE(0x314000, 0x314003) AM_WRITE(slyspy_control_w)
r24008r24009
652649   AM_RANGE(0x300010, 0x300017) AM_RAM
653650   AM_RANGE(0x300800, 0x30087f) AM_RAM
654651   AM_RANGE(0x300c00, 0x300fff) AM_RAM
655   AM_RANGE(0x301000, 0x3017ff) AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
652   AM_RANGE(0x301000, 0x3017ff) AM_DEVREADWRITE("tilegen3", deco_bac06_device, pf_data_r, pf_data_w)
656653   AM_RANGE(0x301800, 0x307fff) AM_RAM AM_SHARE("ram") /* Sly spy main ram */
657654   AM_RANGE(0x310000, 0x3107ff) AM_READWRITE(automat_palette_r, automat_palette_w) AM_SHARE("paletteram")
658655   AM_RANGE(0xb08000, 0xb08fff) AM_RAM AM_SHARE("spriteram") /* Sprites */
r24008r24009
13141311   MCFG_PALETTE_LENGTH(1024)
13151312
13161313   MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
1317   deco_bac06_device::set_gfx_region_wide(*device, 0,0,0);
1314   deco_bac06_device::set_gfx_region_wide(*device,0,0,0);
13181315   MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0)
1319   deco_bac06_device::set_gfx_region_wide(*device, 0,1,0);
1316   deco_bac06_device::set_gfx_region_wide(*device,0,1,0);
13201317   MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0)
1321   deco_bac06_device::set_gfx_region_wide(*device, 0,2,0);
1318   deco_bac06_device::set_gfx_region_wide(*device,0,2,0);
13221319
13231320   MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
13241321   deco_mxc06_device::set_gfx_region(*device, 3);
r24008r24009
14151412   MCFG_VIDEO_START_OVERRIDE(dec0_state,dec0_nodma)
14161413
14171414   MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
1418   deco_bac06_device::set_gfx_region_wide(*device, 0,0,0);
1415   deco_bac06_device::set_gfx_region_wide(*device,0,0,0);
14191416   MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0)
1420   deco_bac06_device::set_gfx_region_wide(*device, 0,1,0);
1417   deco_bac06_device::set_gfx_region_wide(*device,0,1,0);
14211418   MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0)
1422   deco_bac06_device::set_gfx_region_wide(*device, 0,2,0);
1419   deco_bac06_device::set_gfx_region_wide(*device,0,2,0);
14231420
14241421   MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
14251422   deco_mxc06_device::set_gfx_region(*device, 3);
r24008r24009
14681465   MCFG_VIDEO_START_OVERRIDE(dec0_state,dec0_nodma)
14691466
14701467   MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
1471   deco_bac06_device::set_gfx_region_wide(*device, 0,0,0);
1468   deco_bac06_device::set_gfx_region_wide(*device,0,0,0);
14721469   MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0)
1473   deco_bac06_device::set_gfx_region_wide(*device, 0,1,0);
1470   deco_bac06_device::set_gfx_region_wide(*device,0,1,0);
14741471   MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0)
1475   deco_bac06_device::set_gfx_region_wide(*device, 0,2,0);
1472   deco_bac06_device::set_gfx_region_wide(*device,0,2,0);
14761473
14771474   MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
14781475   deco_mxc06_device::set_gfx_region(*device, 3);
trunk/src/mame/drivers/othunder.c
r24008r24009
236236#include "cpu/z80/z80.h"
237237#include "cpu/m68000/m68000.h"
238238#include "machine/eeprom.h"
239#include "video/taitoic.h"
240#include "machine/taitoio.h"
241239#include "audio/taitosnd.h"
242240#include "sound/2610intf.h"
243241#include "sound/flt_vol.h"
r24008r24009
456454   AM_RANGE(0x090000, 0x09000f) AM_READWRITE(othunder_tc0220ioc_r, othunder_tc0220ioc_w)
457455//  AM_RANGE(0x090006, 0x090007) AM_WRITE(eeprom_w)
458456//  AM_RANGE(0x09000c, 0x09000d) AM_WRITENOP   /* ?? (keeps writing 0x77) */
459   AM_RANGE(0x100000, 0x100007) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_rbswap_word_w)   /* palette */
457   AM_RANGE(0x100000, 0x100007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, step1_rbswap_word_w)   /* palette */
460458   AM_RANGE(0x200000, 0x20ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
461459   AM_RANGE(0x220000, 0x22000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
462460   AM_RANGE(0x300000, 0x300003) AM_READWRITE(othunder_sound_r, othunder_sound_w)
trunk/src/mame/drivers/gunbustr.c
r24008r24009
4343
4444#include "emu.h"
4545#include "cpu/m68000/m68000.h"
46#include "video/taitoic.h"
4746#include "machine/eeprom.h"
4847#include "sound/es5506.h"
4948#include "audio/taito_en.h"
r24008r24009
167166   AM_RANGE(0x400004, 0x400007) AM_READ_PORT("SYSTEM")
168167   AM_RANGE(0x400000, 0x400007) AM_WRITE(gunbustr_input_w)                                         /* eerom etc. */
169168   AM_RANGE(0x500000, 0x500003) AM_READWRITE(gunbustr_gun_r, gunbustr_gun_w)                       /* gun coord read */
170   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_long_r, tc0480scp_long_w)
171   AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_long_r, tc0480scp_ctrl_long_w)
169   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, long_r, long_w)
170   AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, ctrl_long_r, ctrl_long_w)
172171   AM_RANGE(0x900000, 0x901fff) AM_RAM_WRITE(gunbustr_palette_w) AM_SHARE("paletteram")            /* Palette ram */
173172   AM_RANGE(0xc00000, 0xc03fff) AM_RAM                                                             /* network ram ?? */
174173ADDRESS_MAP_END
trunk/src/mame/drivers/ninjaw.c
r24008r24009
315315#include "emu.h"
316316#include "cpu/z80/z80.h"
317317#include "cpu/m68000/m68000.h"
318#include "video/taitoic.h"
319#include "machine/taitoio.h"
320318#include "audio/taitosnd.h"
321319#include "sound/2610intf.h"
322320#include "sound/flt_vol.h"
r24008r24009
430428   AM_RANGE(0x2e0000, 0x2e000f) AM_DEVREADWRITE("tc0100scn_2", tc0100scn_device, ctrl_word_r, ctrl_word_w)
431429   AM_RANGE(0x300000, 0x313fff) AM_DEVREADWRITE("tc0100scn_3", tc0100scn_device, word_r, word_w)      /* tilemaps (3rd screen) */
432430   AM_RANGE(0x320000, 0x32000f) AM_DEVREADWRITE("tc0100scn_3", tc0100scn_device, ctrl_word_r, ctrl_word_w)
433   AM_RANGE(0x340000, 0x340007) AM_DEVREADWRITE_LEGACY("tc0110pcr_1", tc0110pcr_word_r, tc0110pcr_step1_word_w)        /* palette (1st screen) */
434   AM_RANGE(0x350000, 0x350007) AM_DEVREADWRITE_LEGACY("tc0110pcr_2", tc0110pcr_word_r, tc0110pcr_step1_word_w)        /* palette (2nd screen) */
435   AM_RANGE(0x360000, 0x360007) AM_DEVREADWRITE_LEGACY("tc0110pcr_3", tc0110pcr_word_r, tc0110pcr_step1_word_w)        /* palette (3rd screen) */
431   AM_RANGE(0x340000, 0x340007) AM_DEVREADWRITE("tc0110pcr_1", tc0110pcr_device, word_r, step1_word_w)        /* palette (1st screen) */
432   AM_RANGE(0x350000, 0x350007) AM_DEVREADWRITE("tc0110pcr_2", tc0110pcr_device, word_r, step1_word_w)        /* palette (2nd screen) */
433   AM_RANGE(0x360000, 0x360007) AM_DEVREADWRITE("tc0110pcr_3", tc0110pcr_device, word_r, step1_word_w)        /* palette (3rd screen) */
436434ADDRESS_MAP_END
437435
438436// NB there could be conflicts between which cpu writes what to the
r24008r24009
446444   AM_RANGE(0x240000, 0x24ffff) AM_RAM AM_SHARE("share1")
447445   AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE("spriteram")
448446   AM_RANGE(0x280000, 0x293fff) AM_DEVREAD("tc0100scn_1", tc0100scn_device, word_r) AM_WRITE(tc0100scn_triple_screen_w) /* tilemaps (1st screen/all screens) */
449   AM_RANGE(0x340000, 0x340007) AM_DEVREADWRITE_LEGACY("tc0110pcr_1", tc0110pcr_word_r, tc0110pcr_step1_word_w)        /* palette (1st screen) */
450   AM_RANGE(0x350000, 0x350007) AM_DEVREADWRITE_LEGACY("tc0110pcr_2", tc0110pcr_word_r, tc0110pcr_step1_word_w)        /* palette (2nd screen) */
451   AM_RANGE(0x360000, 0x360007) AM_DEVREADWRITE_LEGACY("tc0110pcr_3", tc0110pcr_word_r, tc0110pcr_step1_word_w)        /* palette (3rd screen) */
447   AM_RANGE(0x340000, 0x340007) AM_DEVREADWRITE("tc0110pcr_1", tc0110pcr_device, word_r, step1_word_w)        /* palette (1st screen) */
448   AM_RANGE(0x350000, 0x350007) AM_DEVREADWRITE("tc0110pcr_2", tc0110pcr_device, word_r, step1_word_w)        /* palette (2nd screen) */
449   AM_RANGE(0x360000, 0x360007) AM_DEVREADWRITE("tc0110pcr_3", tc0110pcr_device, word_r, step1_word_w)        /* palette (3rd screen) */
452450ADDRESS_MAP_END
453451
454452static ADDRESS_MAP_START( darius2_master_map, AS_PROGRAM, 16, ninjaw_state )
r24008r24009
466464   AM_RANGE(0x2e0000, 0x2e000f) AM_DEVREADWRITE("tc0100scn_2", tc0100scn_device, ctrl_word_r, ctrl_word_w)
467465   AM_RANGE(0x300000, 0x313fff) AM_DEVREADWRITE("tc0100scn_3", tc0100scn_device, word_r, word_w)      /* tilemaps (3rd screen) */
468466   AM_RANGE(0x320000, 0x32000f) AM_DEVREADWRITE("tc0100scn_3", tc0100scn_device, ctrl_word_r, ctrl_word_w)
469   AM_RANGE(0x340000, 0x340007) AM_DEVREADWRITE_LEGACY("tc0110pcr_1", tc0110pcr_word_r, tc0110pcr_step1_word_w)        /* palette (1st screen) */
470   AM_RANGE(0x350000, 0x350007) AM_DEVREADWRITE_LEGACY("tc0110pcr_2", tc0110pcr_word_r, tc0110pcr_step1_word_w)        /* palette (2nd screen) */
471   AM_RANGE(0x360000, 0x360007) AM_DEVREADWRITE_LEGACY("tc0110pcr_3", tc0110pcr_word_r, tc0110pcr_step1_word_w)        /* palette (3rd screen) */
467   AM_RANGE(0x340000, 0x340007) AM_DEVREADWRITE("tc0110pcr_1", tc0110pcr_device, word_r, step1_word_w)        /* palette (1st screen) */
468   AM_RANGE(0x350000, 0x350007) AM_DEVREADWRITE("tc0110pcr_2", tc0110pcr_device, word_r, step1_word_w)        /* palette (2nd screen) */
469   AM_RANGE(0x360000, 0x360007) AM_DEVREADWRITE("tc0110pcr_3", tc0110pcr_device, word_r, step1_word_w)        /* palette (3rd screen) */
472470ADDRESS_MAP_END
473471
474472static ADDRESS_MAP_START( darius2_slave_map, AS_PROGRAM, 16, ninjaw_state )
trunk/src/mame/drivers/dec8.c
r24008r24009
4949#include "sound/3526intf.h"
5050#include "sound/msm5205.h"
5151#include "includes/dec8.h"
52#include "video/decbac06.h"
5352#include "video/decmxc06.h"
5453#include "video/deckarn.h"
5554#include "machine/deco222.h"
r24008r24009
706705   AM_RANGE(0x0000, 0x0fff) AM_RAM
707706   AM_RANGE(0x1000, 0x17ff) AM_RAM
708707   AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(dec8_videoram_w) AM_SHARE("videoram")
709   AM_RANGE(0x2000, 0x27ff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_8bit_r, deco_bac06_pf_data_8bit_w)
708   AM_RANGE(0x2000, 0x27ff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_data_8bit_r, pf_data_8bit_w)
710709   AM_RANGE(0x2800, 0x2bff) AM_RAM // colscroll? mirror?
711   AM_RANGE(0x2c00, 0x2fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_rowscroll_8bit_r, deco_bac06_pf_rowscroll_8bit_w)
710   AM_RANGE(0x2c00, 0x2fff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_rowscroll_8bit_r, pf_rowscroll_8bit_w)
712711   AM_RANGE(0x3000, 0x37ff) AM_RAM AM_SHARE("spriteram")
713712   AM_RANGE(0x3800, 0x3800) AM_READ_PORT("IN0")    /* Player 1 */
714713   AM_RANGE(0x3800, 0x3800) AM_WRITE(dec8_sound_w)
r24008r24009
716715   AM_RANGE(0x3802, 0x3802) AM_READ_PORT("IN2")    /* Player 3 */
717716   AM_RANGE(0x3803, 0x3803) AM_READ_PORT("DSW0")   /* Start buttons + VBL */
718717   AM_RANGE(0x3820, 0x3820) AM_READ_PORT("DSW1")   /* Dip */
719   AM_RANGE(0x3820, 0x3827) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control0_8bit_w)
720   AM_RANGE(0x3830, 0x383f) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_control1_8bit_r, deco_bac06_pf_control1_8bit_w)
718   AM_RANGE(0x3820, 0x3827) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control0_8bit_w)
719   AM_RANGE(0x3830, 0x383f) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_control1_8bit_r, pf_control1_8bit_w)
721720   AM_RANGE(0x3840, 0x3840) AM_READ(i8751_h_r)
722721   AM_RANGE(0x3840, 0x3840) AM_WRITE(ghostb_bank_w)
723722   AM_RANGE(0x3860, 0x3860) AM_READ(i8751_l_r)
r24008r24009
772771   AM_RANGE(0x0f00, 0x0fff) AM_RAM
773772   AM_RANGE(0x1000, 0x1fff) AM_RAM AM_SHARE("share2")
774773   AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(dec8_videoram_w) AM_SHARE("videoram")
775   AM_RANGE(0x2800, 0x2fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_8bit_r, deco_bac06_pf_data_8bit_w)
774   AM_RANGE(0x2800, 0x2fff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_data_8bit_r, pf_data_8bit_w)
776775   AM_RANGE(0x3000, 0x37ff) AM_RAM AM_SHARE("spriteram") /* Sprites */
777776   AM_RANGE(0x3800, 0x3bff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_be_w) AM_SHARE("paletteram")
778777   AM_RANGE(0x3c00, 0x3c00) AM_READ_PORT("IN0")
r24008r24009
780779   AM_RANGE(0x3c02, 0x3c02) AM_READ_PORT("IN2")    /* VBL & coins */
781780   AM_RANGE(0x3c03, 0x3c03) AM_READ_PORT("DSW0")   /* Dip 1 */
782781   AM_RANGE(0x3c04, 0x3c04) AM_READ_PORT("DSW1")
783   AM_RANGE(0x3c00, 0x3c07) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control0_8bit_w)
784   AM_RANGE(0x3c10, 0x3c1f) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control1_8bit_w)
782   AM_RANGE(0x3c00, 0x3c07) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control0_8bit_w)
783   AM_RANGE(0x3c10, 0x3c1f) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control1_8bit_w)
785784   AM_RANGE(0x3c80, 0x3c80) AM_WRITE(dec8_mxc06_karn_buffer_spriteram_w)   /* DMA */
786785   AM_RANGE(0x3d00, 0x3d00) AM_WRITE(dec8_bank_w)          /* BNKS */
787786   AM_RANGE(0x3d80, 0x3d80) AM_WRITE(dec8_sound_w)         /* SOUN */
r24008r24009
824823
825824static ADDRESS_MAP_START( cobra_map, AS_PROGRAM, 8, dec8_state )
826825   AM_RANGE(0x0000, 0x07ff) AM_RAM
827   AM_RANGE(0x0800, 0x0fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_8bit_r, deco_bac06_pf_data_8bit_w)
828   AM_RANGE(0x1000, 0x17ff) AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_8bit_r, deco_bac06_pf_data_8bit_w)
826   AM_RANGE(0x0800, 0x0fff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_data_8bit_r, pf_data_8bit_w)
827   AM_RANGE(0x1000, 0x17ff) AM_DEVREADWRITE("tilegen2", deco_bac06_device, pf_data_8bit_r, pf_data_8bit_w)
829828   AM_RANGE(0x1800, 0x1fff) AM_RAM
830829   AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(dec8_videoram_w) AM_SHARE("videoram")
831830   AM_RANGE(0x2800, 0x2fff) AM_RAM AM_SHARE("spriteram")
r24008r24009
835834   AM_RANGE(0x3801, 0x3801) AM_READ_PORT("IN1")    /* Player 2 */
836835   AM_RANGE(0x3802, 0x3802) AM_READ_PORT("DSW0")   /* Dip 1 */
837836   AM_RANGE(0x3803, 0x3803) AM_READ_PORT("DSW1")   /* Dip 2 */
838   AM_RANGE(0x3800, 0x3807) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control0_8bit_w)
839   AM_RANGE(0x3810, 0x381f) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control1_8bit_w)
837   AM_RANGE(0x3800, 0x3807) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control0_8bit_w)
838   AM_RANGE(0x3810, 0x381f) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control1_8bit_w)
840839   AM_RANGE(0x3a00, 0x3a00) AM_READ_PORT("IN2")    /* VBL & coins */
841   AM_RANGE(0x3a00, 0x3a07) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control0_8bit_w)
842   AM_RANGE(0x3a10, 0x3a1f) AM_DEVWRITE_LEGACY("tilegen2", deco_bac06_pf_control1_8bit_w)
840   AM_RANGE(0x3a00, 0x3a07) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control0_8bit_w)
841   AM_RANGE(0x3a10, 0x3a1f) AM_DEVWRITE("tilegen2", deco_bac06_device, pf_control1_8bit_w)
843842   AM_RANGE(0x3c00, 0x3c00) AM_WRITE(dec8_bank_w)
844843   AM_RANGE(0x3c02, 0x3c02) AM_WRITE(dec8_mxc06_karn_buffer_spriteram_w) /* DMA */
845844   AM_RANGE(0x3e00, 0x3e00) AM_WRITE(dec8_sound_w)
r24008r24009
22122211   MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
22132212
22142213   MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
2215   deco_bac06_device::set_gfx_region_wide(*device, 2,2,0);
2214   deco_bac06_device::set_gfx_region_wide(*device,2,2,0);
22162215
22172216   MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0)
22182217   deco_karnovsprites_device::set_gfx_region(*device, 1);
r24008r24009
23192318   MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
23202319
23212320   MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
2322   deco_bac06_device::set_gfx_region_wide(*device, 2,2,0);
2321   deco_bac06_device::set_gfx_region_wide(*device,2,2,0);
23232322
23242323   MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
23252324   deco_mxc06_device::set_gfx_region(*device, 1);
r24008r24009
24092408   MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
24102409
24112410   MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
2412   deco_bac06_device::set_gfx_region_wide(*device, 2,2,0);
2411   deco_bac06_device::set_gfx_region_wide(*device,2,2,0);
24132412   MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0)
2414   deco_bac06_device::set_gfx_region_wide(*device, 3,3,0);
2413   deco_bac06_device::set_gfx_region_wide(*device,3,3,0);
24152414
24162415   MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
24172416   deco_mxc06_device::set_gfx_region(*device, 1);
trunk/src/mame/drivers/stadhero.c
r24008r24009
2727#include "sound/3812intf.h"
2828#include "sound/okim6295.h"
2929#include "includes/stadhero.h"
30#include "video/decbac06.h"
3130#include "video/decmxc06.h"
3231
3332/******************************************************************************/
r24008r24009
7271static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, stadhero_state )
7372   AM_RANGE(0x000000, 0x01ffff) AM_ROM
7473   AM_RANGE(0x200000, 0x2007ff) AM_RAM_WRITE(stadhero_pf1_data_w) AM_SHARE("pf1_data")
75   AM_RANGE(0x240000, 0x240007) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_0_w)                          /* text layer */
76   AM_RANGE(0x240010, 0x240017) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control_1_w)
77   AM_RANGE(0x260000, 0x261fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
74   AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_0_w)                          /* text layer */
75   AM_RANGE(0x240010, 0x240017) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_1_w)
76   AM_RANGE(0x260000, 0x261fff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_data_r, pf_data_w)
7877   AM_RANGE(0x30c000, 0x30c00b) AM_READWRITE(stadhero_control_r, stadhero_control_w)
7978   AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram")
8079   AM_RANGE(0xff8000, 0xffbfff) AM_RAM /* Main ram */
r24008r24009
241240   MCFG_PALETTE_LENGTH(1024)
242241
243242   MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
244   deco_bac06_device::set_gfx_region_wide(*device, 1,1,2);
243   deco_bac06_device::set_gfx_region_wide(*device,1,1,2);
245244
246245   MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
247246   deco_mxc06_device::set_gfx_region(*device, 2);
trunk/src/mame/drivers/taito_z.c
r24008r24009
969969#include "includes/taitoipt.h"
970970#include "cpu/m68000/m68000.h"
971971#include "machine/eeprom.h"
972#include "video/taitoic.h"
973#include "audio/taitosnd.h"
974972#include "sound/2610intf.h"
975973#include "sound/flt_vol.h"
976#include "machine/taitoio.h"
977974#include "includes/taito_z.h"
978975
979976#include "contcirc.lh"
r24008r24009
14961493   AM_RANGE(0x080000, 0x083fff) AM_RAM
14971494   AM_RANGE(0x084000, 0x087fff) AM_RAM AM_SHARE("share1")
14981495   AM_RANGE(0x090000, 0x090001) AM_WRITE(contcirc_out_w)    /* road palette bank, sub CPU reset, 3d glasses control */
1499   AM_RANGE(0x100000, 0x100007) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_rbswap_word_w)   /* palette */
1496   AM_RANGE(0x100000, 0x100007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, step1_rbswap_word_w)   /* palette */
15001497   AM_RANGE(0x200000, 0x20ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
15011498   AM_RANGE(0x220000, 0x22000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
1502   AM_RANGE(0x300000, 0x301fff) AM_DEVREADWRITE_LEGACY("tc0150rod", tc0150rod_word_r, tc0150rod_word_w)    /* "root ram" */
1499   AM_RANGE(0x300000, 0x301fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_device, word_r, word_w)    /* "root ram" */
15031500   AM_RANGE(0x400000, 0x4006ff) AM_RAM AM_SHARE("spriteram")
15041501ADDRESS_MAP_END
15051502
r24008r24009
15221519   AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, port_r, port_w, 0x00ff)
15231520   AM_RANGE(0x800000, 0x800001) AM_WRITE(chasehq_cpua_ctrl_w)
15241521   AM_RANGE(0x820000, 0x820003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w)
1525   AM_RANGE(0xa00000, 0xa00007) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_word_w)  /* palette */
1522   AM_RANGE(0xa00000, 0xa00007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, step1_word_w)  /* palette */
15261523   AM_RANGE(0xc00000, 0xc0ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
15271524   AM_RANGE(0xc20000, 0xc2000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
15281525   AM_RANGE(0xd00000, 0xd007ff) AM_RAM AM_SHARE("spriteram")
r24008r24009
15331530   AM_RANGE(0x000000, 0x01ffff) AM_ROM
15341531   AM_RANGE(0x100000, 0x103fff) AM_RAM
15351532   AM_RANGE(0x108000, 0x10bfff) AM_RAM AM_SHARE("share1")
1536   AM_RANGE(0x800000, 0x801fff) AM_DEVREADWRITE_LEGACY("tc0150rod", tc0150rod_word_r, tc0150rod_word_w)
1533   AM_RANGE(0x800000, 0x801fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_device, word_r, word_w)
15371534ADDRESS_MAP_END
15381535
15391536
r24008r24009
15431540   AM_RANGE(0x104000, 0x107fff) AM_RAM AM_SHARE("share1")
15441541   AM_RANGE(0x200000, 0x200001) AM_WRITE(cpua_ctrl_w)  // works without?
15451542   AM_RANGE(0x300000, 0x3006ff) AM_RAM AM_SHARE("spriteram")
1546   AM_RANGE(0x400000, 0x401fff) AM_DEVREADWRITE_LEGACY("tc0150rod", tc0150rod_word_r, tc0150rod_word_w)    /* "root ram" ??? */
1547   AM_RANGE(0x500000, 0x500007) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_rbswap_word_w)   /* palette */
1543   AM_RANGE(0x400000, 0x401fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_device, word_r, word_w)    /* "root ram" ??? */
1544   AM_RANGE(0x500000, 0x500007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, step1_rbswap_word_w)   /* palette */
15481545   AM_RANGE(0x600000, 0x60ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
15491546   AM_RANGE(0x620000, 0x62000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
15501547ADDRESS_MAP_END
r24008r24009
15941591   AM_RANGE(0x600000, 0x600007) AM_DEVREADWRITE8("ymsnd", ym2610_device, read, write, 0x00ff)
15951592   AM_RANGE(0x60000c, 0x60000d) AM_NOP // interrupt controller?
15961593   AM_RANGE(0x60000e, 0x60000f) AM_NOP
1597   AM_RANGE(0x800000, 0x801fff) AM_DEVREADWRITE_LEGACY("tc0150rod", tc0150rod_word_r, tc0150rod_word_w)
1594   AM_RANGE(0x800000, 0x801fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_device, word_r, word_w)
15981595ADDRESS_MAP_END
15991596
16001597
r24008r24009
16181615   AM_RANGE(0x000000, 0x01ffff) AM_ROM
16191616   AM_RANGE(0x200000, 0x203fff) AM_RAM
16201617   AM_RANGE(0x208000, 0x20bfff) AM_RAM AM_SHARE("share1")
1621   AM_RANGE(0xa00000, 0xa01fff) AM_DEVREADWRITE_LEGACY("tc0150rod", tc0150rod_word_r, tc0150rod_word_w)
1618   AM_RANGE(0xa00000, 0xa01fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_device, word_r, word_w)
16221619ADDRESS_MAP_END
16231620
16241621
r24008r24009
16291626   AM_RANGE(0x400000, 0x40000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
16301627   AM_RANGE(0x800000, 0x800001) AM_WRITE(cpua_ctrl_w)
16311628   AM_RANGE(0x820000, 0x820003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w)
1632   AM_RANGE(0xa00000, 0xa00007) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_word_w)  /* palette */
1629   AM_RANGE(0xa00000, 0xa00007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, step1_word_w)  /* palette */
16331630   AM_RANGE(0xc00000, 0xc0ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
16341631   AM_RANGE(0xc20000, 0xc2000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
16351632   AM_RANGE(0xd00000, 0xd007ff) AM_RAM AM_SHARE("spriteram")
r24008r24009
16411638   AM_RANGE(0x000000, 0x03ffff) AM_ROM
16421639   AM_RANGE(0x100000, 0x103fff) AM_RAM
16431640   AM_RANGE(0x104000, 0x107fff) AM_RAM AM_SHARE("share1")
1644   AM_RANGE(0x800000, 0x801fff) AM_DEVREADWRITE_LEGACY("tc0150rod", tc0150rod_word_r, tc0150rod_word_w)
1641   AM_RANGE(0x800000, 0x801fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_device, word_r, word_w)
16451642ADDRESS_MAP_END
16461643
16471644
r24008r24009
16501647   AM_RANGE(0x100000, 0x103fff) AM_RAM
16511648   AM_RANGE(0x104000, 0x107fff) AM_RAM AM_SHARE("share1")
16521649   AM_RANGE(0x200000, 0x200001) AM_WRITE(cpua_ctrl_w)  // not needed, but it's probably like the others
1653   AM_RANGE(0x300000, 0x300007) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_word_w)  /* palette */
1654   AM_RANGE(0x800000, 0x801fff) AM_DEVREADWRITE_LEGACY("tc0150rod", tc0150rod_word_r, tc0150rod_word_w)
1650   AM_RANGE(0x300000, 0x300007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, step1_word_w)  /* palette */
1651   AM_RANGE(0x800000, 0x801fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_device, word_r, word_w)
16551652   AM_RANGE(0xa00000, 0xa0ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
16561653   AM_RANGE(0xa20000, 0xa2000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
16571654   AM_RANGE(0xc40000, 0xc403ff) AM_RAM AM_SHARE("spriteram")
r24008r24009
16761673   AM_RANGE(0x500000, 0x5005ff) AM_RAM AM_SHARE("spriteram")
16771674   AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
16781675   AM_RANGE(0x920000, 0x92000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
1679   AM_RANGE(0xb00000, 0xb00007) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_rbswap_word_w)   /* palette */
1676   AM_RANGE(0xb00000, 0xb00007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, step1_rbswap_word_w)   /* palette */
16801677ADDRESS_MAP_END
16811678
16821679static ADDRESS_MAP_START( spacegun_cpub_map, AS_PROGRAM, 16, taitoz_state )
r24008r24009
17021699   AM_RANGE(0x600000, 0x600001) AM_WRITE(dblaxle_cpua_ctrl_w)  /* could this be causing int6 ? */
17031700   AM_RANGE(0x620000, 0x620003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w)
17041701   AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
1705   AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_word_r, tc0480scp_word_w)      /* tilemap mirror */
1706   AM_RANGE(0xa00000, 0xa0ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_word_r, tc0480scp_word_w)      /* tilemaps */
1707   AM_RANGE(0xa30000, 0xa3002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w)
1702   AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, word_r, word_w)      /* tilemap mirror */
1703   AM_RANGE(0xa00000, 0xa0ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, word_r, word_w)      /* tilemaps */
1704   AM_RANGE(0xa30000, 0xa3002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, ctrl_word_r, ctrl_word_w)
17081705   AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_SHARE("spriteram") /* mostly unused ? */
17091706   AM_RANGE(0xc08000, 0xc08001) AM_READWRITE(sci_spriteframe_r, sci_spriteframe_w) /* set in int6, seems to stay zero */
17101707ADDRESS_MAP_END
r24008r24009
17131710   AM_RANGE(0x000000, 0x03ffff) AM_ROM
17141711   AM_RANGE(0x100000, 0x103fff) AM_RAM
17151712   AM_RANGE(0x110000, 0x11ffff) AM_RAM AM_SHARE("share1")
1716   AM_RANGE(0x300000, 0x301fff) AM_DEVREADWRITE_LEGACY("tc0150rod", tc0150rod_word_r, tc0150rod_word_w)
1713   AM_RANGE(0x300000, 0x301fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_device, word_r, word_w)
17171714   AM_RANGE(0x500000, 0x503fff) AM_RAM /* network ram ? (see Gunbustr) */
17181715ADDRESS_MAP_END
17191716
r24008r24009
17271724   AM_RANGE(0x500002, 0x500003) AM_WRITE(cpua_ctrl_w)
17281725   AM_RANGE(0x520000, 0x520003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w)
17291726   AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
1730   AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_word_r, tc0480scp_word_w)      /* tilemaps */
1731   AM_RANGE(0x930000, 0x93002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w)
1727   AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, word_r, word_w)      /* tilemaps */
1728   AM_RANGE(0x930000, 0x93002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, ctrl_word_r, ctrl_word_w)
17321729   AM_RANGE(0xb00000, 0xb03fff) AM_RAM AM_SHARE("spriteram") /* mostly unused ? */
17331730   AM_RANGE(0xb08000, 0xb08001) AM_READWRITE(sci_spriteframe_r, sci_spriteframe_w) /* alternates 0/0x100 */
17341731ADDRESS_MAP_END
r24008r24009
17371734   AM_RANGE(0x000000, 0x03ffff) AM_ROM
17381735   AM_RANGE(0x400000, 0x403fff) AM_RAM
17391736   AM_RANGE(0x410000, 0x41ffff) AM_RAM AM_SHARE("share1")
1740   AM_RANGE(0xa00000, 0xa01fff) AM_DEVREADWRITE_LEGACY("tc0150rod", tc0150rod_word_r, tc0150rod_word_w)
1737   AM_RANGE(0xa00000, 0xa01fff) AM_DEVREADWRITE("tc0150rod", tc0150rod_device, word_r, word_w)
17411738   AM_RANGE(0xd00000, 0xd03fff) AM_RAM /* network ram ? */
17421739ADDRESS_MAP_END
17431740
trunk/src/mame/drivers/pcktgal.c
r24008r24009
1818#include "sound/3812intf.h"
1919#include "sound/msm5205.h"
2020#include "includes/pcktgal.h"
21#include "video/decbac06.h"
2221#include "machine/deco222.h"
2322
2423/***************************************************************************/
r24008r24009
7170
7271static ADDRESS_MAP_START( pcktgal_map, AS_PROGRAM, 8, pcktgal_state )
7372   AM_RANGE(0x0000, 0x07ff) AM_RAM
74   AM_RANGE(0x0800, 0x0fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_8bit_r, deco_bac06_pf_data_8bit_w)
73   AM_RANGE(0x0800, 0x0fff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_data_8bit_r, pf_data_8bit_w)
7574   AM_RANGE(0x1000, 0x11ff) AM_RAM AM_SHARE("spriteram")
7675   AM_RANGE(0x1800, 0x1800) AM_READ_PORT("P1")
77   AM_RANGE(0x1800, 0x1807) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control0_8bit_w)
78   AM_RANGE(0x1810, 0x181f) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_control1_8bit_r, deco_bac06_pf_control1_8bit_w)
76   AM_RANGE(0x1800, 0x1807) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control0_8bit_w)
77   AM_RANGE(0x1810, 0x181f) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_control1_8bit_r, pf_control1_8bit_w)
7978
8079   AM_RANGE(0x1a00, 0x1a00) AM_READ_PORT("P2") AM_WRITE(pcktgal_sound_w)
8180   AM_RANGE(0x1c00, 0x1c00) AM_READ_PORT("DSW") AM_WRITE(pcktgal_bank_w)
r24008r24009
246245
247246
248247   MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
249   deco_bac06_device::set_gfx_region_wide(*device, 0,0,0);
248   deco_bac06_device::set_gfx_region_wide(*device,0,0,0);
250249
251250   /* sound hardware */
252251   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/mame/drivers/asuka.c
r24008r24009
217217#include "cpu/z180/z180.h"
218218#include "cpu/m68000/m68000.h"
219219#include "includes/taitoipt.h"
220#include "video/taitoic.h"
221220#include "audio/taitosnd.h"
222221#include "sound/2610intf.h"
223222#include "sound/2151intf.h"
r24008r24009
315314   AM_RANGE(0x000000, 0x03ffff) AM_ROM
316315   AM_RANGE(0x080000, 0x0fffff) AM_ROM
317316   AM_RANGE(0x10c000, 0x10ffff) AM_RAM
318   AM_RANGE(0x200000, 0x200007) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_word_w)
317   AM_RANGE(0x200000, 0x200007) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, step1_word_w)
319318   AM_RANGE(0x390000, 0x390001) AM_READ_PORT("DSWA")
320319   AM_RANGE(0x3a0000, 0x3a0001) AM_WRITE(asuka_spritectrl_w)
321320   AM_RANGE(0x3b0000, 0x3b0001) AM_READ_PORT("DSWB")
r24008r24009
335334   AM_RANGE(0x000000, 0x0fffff) AM_ROM
336335   AM_RANGE(0x100000, 0x103fff) AM_RAM
337336   AM_RANGE(0x1076f0, 0x1076f1) AM_READNOP /* Mofflott init does dummy reads here */
338   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_word_w)
337   AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, step1_word_w)
339338   AM_RANGE(0x3a0000, 0x3a0003) AM_WRITE(asuka_spritectrl_w)
340339   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff)
341340   AM_RANGE(0x3e0002, 0x3e0003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff)
r24008r24009
354353   AM_RANGE(0x100000, 0x107fff) AM_RAM
355354   AM_RANGE(0x800000, 0x800fff) AM_READWRITE(cadash_share_r,cadash_share_w)    /* network ram */
356355   AM_RANGE(0x900000, 0x90000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
357   AM_RANGE(0xa00000, 0xa0000f) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_4bpg_word_w)
356   AM_RANGE(0xa00000, 0xa0000f) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, step1_4bpg_word_w)
358357   AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("pc090oj", pc090oj_device, word_r, word_w)  /* sprite ram */
359358   AM_RANGE(0xc00000, 0xc0ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w)    /* tilemaps */
360359   AM_RANGE(0xc20000, 0xc2000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w)
r24008r24009
362361
363362static ADDRESS_MAP_START( eto_map, AS_PROGRAM, 16   /* N.B. tc100scn mirror overlaps spriteram */, asuka_state )
364363   AM_RANGE(0x000000, 0x0fffff) AM_ROM
365   AM_RANGE(0x100000, 0x10000f) AM_DEVREADWRITE_LEGACY("tc0110pcr", tc0110pcr_word_r, tc0110pcr_step1_word_w)
364   AM_RANGE(0x100000, 0x10000f) AM_DEVREADWRITE("tc0110pcr", tc0110pcr_device, word_r, step1_word_w)
366365   AM_RANGE(0x200000, 0x203fff) AM_RAM
367366   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff)
368367   AM_RANGE(0x400000, 0x40000f) AM_DEVREAD8("tc0220ioc", tc0220ioc_device, read, 0x00ff)   /* service mode mirror */
trunk/src/mame/drivers/superchs.c
r24008r24009
3939
4040#include "emu.h"
4141#include "cpu/m68000/m68000.h"
42#include "video/taitoic.h"
4342#include "machine/eeprom.h"
4443#include "sound/es5506.h"
4544#include "audio/taito_en.h"
r24008r24009
195194   AM_RANGE(0x000000, 0x0fffff) AM_ROM
196195   AM_RANGE(0x100000, 0x11ffff) AM_RAM AM_SHARE("ram")
197196   AM_RANGE(0x140000, 0x141fff) AM_RAM AM_SHARE("spriteram")
198   AM_RANGE(0x180000, 0x18ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_long_r, tc0480scp_long_w)
199   AM_RANGE(0x1b0000, 0x1b002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_long_r, tc0480scp_ctrl_long_w)
197   AM_RANGE(0x180000, 0x18ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, long_r, long_w)
198   AM_RANGE(0x1b0000, 0x1b002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, ctrl_long_r, ctrl_long_w)
200199   AM_RANGE(0x200000, 0x20ffff) AM_RAM AM_SHARE("shared_ram")
201200   AM_RANGE(0x240000, 0x240003) AM_WRITE(cpua_ctrl_w)
202201   AM_RANGE(0x280000, 0x287fff) AM_RAM_WRITE(superchs_palette_w) AM_SHARE("paletteram")
r24008r24009
208207static ADDRESS_MAP_START( superchs_cpub_map, AS_PROGRAM, 16, superchs_state )
209208   AM_RANGE(0x000000, 0x03ffff) AM_ROM
210209   AM_RANGE(0x200000, 0x20ffff) AM_RAM
211   AM_RANGE(0x600000, 0x60ffff) AM_DEVWRITE_LEGACY("tc0480scp", tc0480scp_word_w) /* Only written upon errors */
210   AM_RANGE(0x600000, 0x60ffff) AM_DEVWRITE("tc0480scp", tc0480scp_device, word_w) /* Only written upon errors */
212211   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(shared_ram_r, shared_ram_w)
213212   AM_RANGE(0xa00000, 0xa001ff) AM_RAM /* Extra road control?? */
214213ADDRESS_MAP_END
trunk/src/mame/drivers/slapshot.c
r24008r24009
134134#include "emu.h"
135135#include "cpu/z80/z80.h"
136136#include "cpu/m68000/m68000.h"
137#include "video/taitoic.h"
138137#include "audio/taitosnd.h"
139138#include "sound/2610intf.h"
140139#include "machine/timekpr.h"
141#include "machine/taitoio.h"
142140#include "includes/slapshot.h"
143141
144142
r24008r24009
287285   AM_RANGE(0x500000, 0x50ffff) AM_RAM /* main RAM */
288286   AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("spriteram")   /* sprite ram */
289287   AM_RANGE(0x700000, 0x701fff) AM_RAM AM_SHARE("spriteext")   /* debugging */
290   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_word_r, tc0480scp_word_w)    /* tilemaps */
291   AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w)
288   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, word_r, word_w)    /* tilemaps */
289   AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, ctrl_word_r, ctrl_word_w)
292290   AM_RANGE(0x900000, 0x907fff) AM_READWRITE(color_ram_word_r, color_ram_word_w) AM_SHARE("color_ram") /* 8bpg palette */
293291   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE8("mk48t08", timekeeper_device, read, write, 0xff00) /* nvram (only low bytes used) */
294292   AM_RANGE(0xb00000, 0xb0001f) AM_DEVWRITE8("tc0360pri", tc0360pri_device, write, 0xff00)  /* priority chip */
r24008r24009
302300   AM_RANGE(0x500000, 0x50ffff) AM_RAM /* main RAM */
303301   AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("spriteram")   /* sprite ram */
304302   AM_RANGE(0x700000, 0x701fff) AM_RAM AM_SHARE("spriteext")   /* debugging */
305   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_word_r, tc0480scp_word_w)    /* tilemaps */
306   AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE_LEGACY("tc0480scp", tc0480scp_ctrl_word_r, tc0480scp_ctrl_word_w)
303   AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, word_r, word_w)    /* tilemaps */
304   AM_RANGE(0x830000, 0x83002f) AM_DEVREADWRITE("tc0480scp", tc0480scp_device, ctrl_word_r, ctrl_word_w)
307305   AM_RANGE(0x900000, 0x907fff) AM_READWRITE(color_ram_word_r, color_ram_word_w) AM_SHARE("color_ram") /* 8bpg palette */
308306   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE8("mk48t08", timekeeper_device, read, write, 0xff00) /* nvram (only low bytes used) */
309307   AM_RANGE(0xb00000, 0xb0001f) AM_DEVWRITE8("tc0360pri", tc0360pri_device, write, 0xff00)  /* priority chip */
trunk/src/mame/includes/undrfire.h
r24008r24009
11#include "machine/eeprom.h"
2#include "video/taitoic.h"
3
24struct tempsprite
35{
46   int gfx;
r24008r24009
2224      m_maincpu(*this, "maincpu"),
2325      m_subcpu(*this, "sub"),
2426      m_tc0100scn(*this, "tc0100scn"),
27      m_tc0480scp(*this, "tc0480scp"),
2528      m_eeprom(*this, "eeprom"),
2629      m_ram(*this, "ram"),
2730      m_shared_ram(*this, "shared_ram"),
r24008r24009
3033   required_device<cpu_device> m_maincpu;
3134   optional_device<cpu_device> m_subcpu;
3235   required_device<tc0100scn_device> m_tc0100scn;
36   required_device<tc0480scp_device> m_tc0480scp;
3337   required_device<eeprom_device> m_eeprom;
3438   optional_shared_ptr<UINT32> m_ram;
3539   optional_shared_ptr<UINT32> m_shared_ram;
trunk/src/mame/includes/asuka.h
r24008r24009
2424      m_msm(*this, "msm"),
2525      m_pc090oj(*this, "pc090oj"),
2626      m_tc0100scn(*this, "tc0100scn"),
27      m_tc0110pcr(*this, "tc0110pcr"),
2728      m_tc0220ioc(*this, "tc0220ioc") { }
2829
2930   /* memory pointers */
r24008r24009
5354   optional_device<msm5205_device> m_msm;
5455   required_device<pc090oj_device> m_pc090oj;
5556   required_device<tc0100scn_device> m_tc0100scn;
57   required_device<tc0110pcr_device> m_tc0110pcr;
5658   optional_device<tc0220ioc_device> m_tc0220ioc;
5759   DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
5860   DECLARE_WRITE8_MEMBER(asuka_msm5205_address_w);
trunk/src/mame/includes/stadhero.h
r24008r24009
1#include "video/decbac06.h"
2
13class stadhero_state : public driver_device
24{
35public:
r24008r24009
35   stadhero_state(const machine_config &mconfig, device_type type, const char *tag)
46      : driver_device(mconfig, type, tag),
5      m_pf1_data(*this, "pf1_data"),
7      m_maincpu(*this, "maincpu"),
8      m_audiocpu(*this, "audiocpu"),
9      m_tilegen1(*this, "tilegen1"),
610      m_spriteram(*this, "spriteram"),
7      m_maincpu(*this, "maincpu"),
8      m_audiocpu(*this, "audiocpu")  { }
11      m_pf1_data(*this, "pf1_data") { }
912
13   required_device<cpu_device> m_maincpu;
14   required_device<cpu_device> m_audiocpu;
15   required_device<deco_bac06_device> m_tilegen1;
16   required_shared_ptr<UINT16> m_spriteram;
1017   required_shared_ptr<UINT16> m_pf1_data;
1118   tilemap_t *m_pf1_tilemap;
1219   int m_flipscreen;
13   required_shared_ptr<UINT16> m_spriteram;
1420   DECLARE_READ16_MEMBER(stadhero_control_r);
1521   DECLARE_WRITE16_MEMBER(stadhero_control_w);
r24008r24009
1925   virtual void video_start();
2026   UINT32 screen_update_stadhero(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
2127   DECLARE_WRITE_LINE_MEMBER(irqhandler);
22   required_device<cpu_device> m_maincpu;
23   required_device<cpu_device> m_audiocpu;
2428};
trunk/src/mame/includes/actfancr.h
r24008r24009
1#include "video/decbac06.h"
2
13/*************************************************************************
24
35    Act Fancer
r24008r24009
1113      : driver_device(mconfig, type, tag),
1214      m_main_ram(*this, "main_ram"),
1315      m_maincpu(*this, "maincpu"),
14      m_audiocpu(*this, "audiocpu"){ }
16      m_audiocpu(*this, "audiocpu"),
17      m_tilegen1(*this, "tilegen1"),
18      m_tilegen2(*this, "tilegen2") { }
1519
1620   /* memory pointers */
1721   required_shared_ptr<UINT8> m_main_ram;
r24008r24009
2630   /* devices */
2731   required_device<cpu_device> m_maincpu;
2832   required_device<cpu_device> m_audiocpu;
33   required_device<deco_bac06_device> m_tilegen1;
34   required_device<deco_bac06_device> m_tilegen2;
2935   DECLARE_WRITE8_MEMBER(triothep_control_select_w);
3036   DECLARE_READ8_MEMBER(triothep_control_r);
3137   DECLARE_WRITE8_MEMBER(actfancr_sound_w);
trunk/src/mame/includes/galastrm.h
r24008r24009
2626      m_spriteram(*this,"spriteram") ,
2727      m_maincpu(*this, "maincpu"),
2828      m_eeprom(*this, "eeprom"),
29      m_tc0100scn(*this, "tc0100scn") { }
29      m_tc0100scn(*this, "tc0100scn"),
30      m_tc0480scp(*this, "tc0480scp") { }
3031
3132   required_shared_ptr<UINT32> m_ram;
3233   required_shared_ptr<UINT32> m_spriteram;
r24008r24009
3435   required_device<cpu_device> m_maincpu;
3536   required_device<eeprom_device> m_eeprom;
3637   required_device<tc0100scn_device> m_tc0100scn;
38   required_device<tc0480scp_device> m_tc0480scp;
3739   UINT16 m_coin_word;
3840   UINT16 m_frame_counter;
3941   int m_tc0110pcr_addr;
trunk/src/mame/includes/ninjaw.h
r24008r24009
77#include "machine/taitoio.h"
88#include "sound/flt_vol.h"
99#include "audio/taitosnd.h"
10#include "video/taitoic.h"
1011
1112class ninjaw_state : public driver_device
1213{
r24008r24009
2122      m_tc0100scn_1(*this, "tc0100scn_1"),
2223      m_tc0100scn_2(*this, "tc0100scn_2"),
2324      m_tc0100scn_3(*this, "tc0100scn_3"),
25      m_tc0110pcr_1(*this, "tc0110pcr_1"),
26      m_tc0110pcr_2(*this, "tc0110pcr_2"),
27      m_tc0110pcr_3(*this, "tc0110pcr_3"),
2428      m_tc0220ioc(*this, "tc0220ioc"),
2529      m_2610_1l(*this, "2610.1.l"),
2630      m_2610_1r(*this, "2610.1.r"),
r24008r24009
4347   required_device<tc0100scn_device> m_tc0100scn_1;
4448   required_device<tc0100scn_device> m_tc0100scn_2;
4549   required_device<tc0100scn_device> m_tc0100scn_3;
50   required_device<tc0110pcr_device> m_tc0110pcr_1;
51   required_device<tc0110pcr_device> m_tc0110pcr_2;
52   required_device<tc0110pcr_device> m_tc0110pcr_3;
4653   required_device<tc0220ioc_device> m_tc0220ioc;
4754   required_device<filter_volume_device> m_2610_1l;
4855   required_device<filter_volume_device> m_2610_1r;
trunk/src/mame/includes/taito_z.h
r24008r24009
88#include "machine/taitoio.h"
99#include "audio/taitosnd.h"
1010#include "machine/eeprom.h"
11#include "video/taitoic.h"
1112
1213class taitoz_state : public driver_device
1314{
r24008r24009
2829      m_tc0480scp(*this, "tc0480scp"),
2930      m_tc0150rod(*this, "tc0150rod"),
3031      m_tc0100scn(*this, "tc0100scn"),
32      m_tc0110pcr(*this, "tc0110pcr"),
3133      m_tc0220ioc(*this, "tc0220ioc"),
3234      m_tc0510nio(*this, "tc0510nio"),
3335      m_tc0140syt(*this, "tc0140syt") { }
r24008r24009
5456   optional_device<tc0480scp_device> m_tc0480scp;
5557   optional_device<tc0150rod_device> m_tc0150rod;
5658   optional_device<tc0100scn_device> m_tc0100scn;
59   optional_device<tc0110pcr_device> m_tc0110pcr;
5760   optional_device<tc0220ioc_device> m_tc0220ioc;
5861   optional_device<tc0510nio_device> m_tc0510nio;
5962   required_device<tc0140syt_device> m_tc0140syt;
trunk/src/mame/includes/warriorb.h
r24008r24009
77#include "sound/flt_vol.h"
88#include "audio/taitosnd.h"
99#include "machine/taitoio.h"
10#include "video/taitoic.h"
1011
1112class warriorb_state : public driver_device
1213{
r24008r24009
1920      m_tc0140syt(*this, "tc0140syt"),
2021      m_tc0100scn_1(*this, "tc0100scn_1"),
2122      m_tc0100scn_2(*this, "tc0100scn_2"),
23      m_tc0110pcr_1(*this, "tc0110pcr_1"),
24      m_tc0110pcr_2(*this, "tc0110pcr_2"),
2225      m_tc0220ioc(*this, "tc0220ioc"),
2326      m_tc0510nio(*this, "tc0510nio"),
2427      m_2610_1l(*this, "2610.1.l"),
r24008r24009
3942   required_device<tc0140syt_device> m_tc0140syt;
4043   required_device<tc0100scn_device> m_tc0100scn_1;
4144   required_device<tc0100scn_device> m_tc0100scn_2;
45   required_device<tc0110pcr_device> m_tc0110pcr_1;
46   required_device<tc0110pcr_device> m_tc0110pcr_2;
4247   optional_device<tc0220ioc_device> m_tc0220ioc;
4348   optional_device<tc0510nio_device> m_tc0510nio;
4449   required_device<filter_volume_device> m_2610_1l;
trunk/src/mame/includes/superchs.h
r24008r24009
11#include "machine/eeprom.h"
2#include "video/taitoic.h"
3
24struct tempsprite
35{
46   int gfx;
r24008r24009
1921      m_shared_ram(*this,"shared_ram"),
2022      m_maincpu(*this, "maincpu"),
2123      m_subcpu(*this, "sub"),
24      m_tc0480scp(*this, "tc0480scp"),
2225      m_eeprom(*this, "eeprom") { }
2326
2427   UINT16 m_coin_word;
r24008r24009
4548   void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs);
4649   required_device<cpu_device> m_maincpu;
4750   required_device<cpu_device> m_subcpu;
51   required_device<tc0480scp_device> m_tc0480scp;
4852   required_device<eeprom_device> m_eeprom;
4953};
trunk/src/mame/includes/pcktgal.h
r24008r24009
11#include "sound/msm5205.h"
2#include "video/decbac06.h"
23
34class pcktgal_state : public driver_device
45{
56public:
67   pcktgal_state(const machine_config &mconfig, device_type type, const char *tag)
78      : driver_device(mconfig, type, tag),
8      m_spriteram(*this, "spriteram"),
99      m_maincpu(*this, "maincpu"),
1010      m_audiocpu(*this, "audiocpu"),
11      m_msm(*this, "msm") { }
11      m_msm(*this, "msm"),
12      m_tilegen1(*this, "tilegen1"),
13      m_spriteram(*this, "spriteram") { }
1214
13   int m_msm5205next;
14   int m_toggle;
15   required_device<cpu_device> m_maincpu;
16   required_device<cpu_device> m_audiocpu;
17   required_device<msm5205_device> m_msm;
18   required_device<deco_bac06_device> m_tilegen1;
1519   required_shared_ptr<UINT8> m_spriteram;
1620   DECLARE_WRITE8_MEMBER(pcktgal_bank_w);
1721   DECLARE_WRITE8_MEMBER(pcktgal_sound_bank_w);
r24008r24009
1923   DECLARE_WRITE8_MEMBER(pcktgal_adpcm_data_w);
2024   DECLARE_READ8_MEMBER(pcktgal_adpcm_reset_r);
2125   DECLARE_DRIVER_INIT(pcktgal);
26   int m_msm5205next;
27   int m_toggle;
2228   virtual void palette_init();
2329   virtual void machine_start();
2430   UINT32 screen_update_pcktgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
2531   UINT32 screen_update_pcktgalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
2632   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
2733   DECLARE_WRITE_LINE_MEMBER(pcktgal_adpcm_int);
28   required_device<cpu_device> m_maincpu;
29   required_device<cpu_device> m_audiocpu;
30   required_device<msm5205_device> m_msm;
3134};
trunk/src/mame/includes/othunder.h
r24008r24009
88#include "sound/flt_vol.h"
99#include "audio/taitosnd.h"
1010#include "machine/taitoio.h"
11#include "video/taitoic.h"
1112
1213struct othunder_tempsprite
1314{
trunk/src/mame/includes/gunbustr.h
r24008r24009
11#include "machine/eeprom.h"
2#include "video/taitoic.h"
23
34struct tempsprite
45{
r24008r24009
2122   gunbustr_state(const machine_config &mconfig, device_type type, const char *tag)
2223      : driver_device(mconfig, type, tag),
2324      m_maincpu(*this,"maincpu"),
25      m_tc0480scp(*this, "tc0480scp"),
2426      m_ram(*this,"ram"),
2527      m_spriteram(*this,"spriteram"),
2628      m_eeprom(*this, "eeprom")
r24008r24009
2931   }
3032
3133   required_device<cpu_device> m_maincpu;
34   required_device<tc0480scp_device> m_tc0480scp;
3235   required_shared_ptr<UINT32> m_ram;
3336   required_shared_ptr<UINT32> m_spriteram;
3437   required_device<eeprom_device> m_eeprom;
trunk/src/mame/includes/taito_f2.h
r24008r24009
11#include "machine/taitoio.h"
22#include "sound/okim6295.h"
3#include "video/taitoic.h"
34
45struct f2_tempsprite
56{
r24008r24009
2930         m_tc0100scn(*this, "tc0100scn"),
3031         m_tc0100scn_1(*this, "tc0100scn_1"),
3132         m_tc0100scn_2(*this, "tc0100scn_2"),
33         m_tc0110pcr(*this, "tc0110pcr"),
3234         m_tc0360pri(*this, "tc0360pri"),
3335         m_tc0280grd(*this, "tc0280grd"),
3436         m_tc0430grw(*this, "tc0430grw"),
r24008r24009
9496   optional_device<tc0100scn_device> m_tc0100scn;
9597   optional_device<tc0100scn_device> m_tc0100scn_1;
9698   optional_device<tc0100scn_device> m_tc0100scn_2;
99   optional_device<tc0110pcr_device> m_tc0110pcr;
97100   optional_device<tc0360pri_device> m_tc0360pri;
98101   optional_device<tc0280grd_device> m_tc0280grd;
99102   optional_device<tc0280grd_device> m_tc0430grw;
trunk/src/mame/includes/groundfx.h
r24008r24009
2323      m_ram(*this,"ram"),
2424      m_spriteram(*this,"spriteram") ,
2525      m_maincpu(*this, "maincpu"),
26      m_tc0100scn(*this, "tc0100scn")   { }
26      m_tc0100scn(*this, "tc0100scn"),
27      m_tc0480scp(*this, "tc0480scp") { }
2728
2829   required_shared_ptr<UINT32> m_ram;
2930   required_shared_ptr<UINT32> m_spriteram;
3031
3132   required_device<cpu_device> m_maincpu;
3233   required_device<tc0100scn_device> m_tc0100scn;
34   required_device<tc0480scp_device> m_tc0480scp;
3335   
3436   UINT16 m_coin_word;
3537   UINT16 m_frame_counter;
trunk/src/mame/includes/dec8.h
r24008r24009
11#include "video/bufsprite.h"
2#include "video/decbac06.h"
23#include "sound/msm5205.h"
34
45class dec8_state : public driver_device
r24008r24009
1617      m_audiocpu(*this, "audiocpu"),
1718      m_mcu(*this, "mcu"),
1819      m_spriteram(*this, "spriteram") ,
20      m_msm(*this, "msm"),
21      m_tilegen1(*this, "tilegen1"),
22      m_tilegen2(*this, "tilegen2"),
1923      m_videoram(*this, "videoram"),
20      m_bg_data(*this, "bg_data"),
21      m_msm(*this, "msm") { }
24      m_bg_data(*this, "bg_data")   { }
2225
2326   /* devices */
2427   required_device<cpu_device> m_maincpu;
r24008r24009
2629   required_device<cpu_device> m_audiocpu;
2730   optional_device<cpu_device> m_mcu;
2831   required_device<buffered_spriteram8_device> m_spriteram;
32   optional_device<msm5205_device> m_msm;
33   optional_device<deco_bac06_device> m_tilegen1;
34   optional_device<deco_bac06_device> m_tilegen2;
2935
3036   /* memory pointers */
3137   required_shared_ptr<UINT8> m_videoram;
3238   optional_shared_ptr<UINT8> m_bg_data;
3339
34   optional_device<msm5205_device> m_msm;
3540   UINT8 *  m_pf1_data;
3641   UINT8 *  m_row;
3742//  UINT8 *  m_paletteram;    // currently this uses generic palette handling
trunk/src/mame/includes/madmotor.h
r24008r24009
44
55*************************************************************************/
66
7#include "video/decbac06.h"
8
79class madmotor_state : public driver_device
810{
911public:
r24008r24009
1113      : driver_device(mconfig, type, tag),
1214      m_spriteram(*this, "spriteram"),
1315      m_maincpu(*this, "maincpu"),
14      m_audiocpu(*this, "audiocpu"){ }
16      m_audiocpu(*this, "audiocpu"),
17      m_tilegen1(*this, "tilegen1"),
18      m_tilegen2(*this, "tilegen2"),   
19      m_tilegen3(*this, "tilegen3") { }
1520
1621   /* memory pointers */
1722   required_shared_ptr<UINT16> m_spriteram;
r24008r24009
2328   /* devices */
2429   required_device<cpu_device> m_maincpu;
2530   required_device<cpu_device> m_audiocpu;
31   required_device<deco_bac06_device> m_tilegen1;
32   required_device<deco_bac06_device> m_tilegen2;
33   required_device<deco_bac06_device> m_tilegen3;
2634   DECLARE_WRITE16_MEMBER(madmotor_sound_w);
2735   DECLARE_DRIVER_INIT(madmotor);
2836   virtual void machine_start();
trunk/src/mame/video/galastrm.c
r24008r24009
11#include "emu.h"
2#include "video/taitoic.h"
32#include "video/poly.h"
43#include "includes/galastrm.h"
54
r24008r24009
429428
430429UINT32 galastrm_state::screen_update_galastrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
431430{
432   device_t *tc0480scp = machine().device("tc0480scp");
433431   UINT8 layer[5];
434432   UINT8 pivlayer[3];
435433   UINT16 priority;
r24008r24009
439437   rectangle clip(0, screen.width() -1, 0, screen.height() -1);
440438
441439   m_tc0100scn->tilemap_update();
442   tc0480scp_tilemap_update(tc0480scp);
440   m_tc0480scp->tilemap_update();
443441
444   priority = tc0480scp_get_bg_priority(tc0480scp);
442   priority = m_tc0480scp->get_bg_priority();
445443   layer[0] = (priority & 0xf000) >> 12;   /* tells us which bg layer is bottom */
446444   layer[1] = (priority & 0x0f00) >>  8;
447445   layer[2] = (priority & 0x00f0) >>  4;
r24008r24009
462460#if 0
463461   if (layer[0]==0 && layer[1]==3 && layer[2]==2 && layer[3]==1)
464462   {
465      if (!machine().input().code_pressed(KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[0], 0, 1);
466      if (!machine().input().code_pressed(KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[1], 0, 4);
467      if (!machine().input().code_pressed(KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[2], 0, 4);
468      if (!machine().input().code_pressed(KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[3], 0, 4);
463      if (!machine().input().code_pressed(KEYCODE_Z)) m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[0], 0, 1);
464      if (!machine().input().code_pressed(KEYCODE_X)) m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[1], 0, 4);
465      if (!machine().input().code_pressed(KEYCODE_C)) m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[2], 0, 4);
466      if (!machine().input().code_pressed(KEYCODE_V)) m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[3], 0, 4);
469467   }
470468   else
471469   {
472      if (!machine().input().code_pressed(KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[0], 0, 1);
473      if (!machine().input().code_pressed(KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[1], 0, 2);
474      if (!machine().input().code_pressed(KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[2], 0, 4);
475      if (!machine().input().code_pressed(KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[3], 0, 8);
470      if (!machine().input().code_pressed(KEYCODE_Z)) m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[0], 0, 1);
471      if (!machine().input().code_pressed(KEYCODE_X)) m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[1], 0, 2);
472      if (!machine().input().code_pressed(KEYCODE_C)) m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[2], 0, 4);
473      if (!machine().input().code_pressed(KEYCODE_V)) m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[3], 0, 8);
476474   }
477475
478476   if (layer[0]==3 && layer[1]==0 && layer[2]==1 && layer[3]==2)
r24008r24009
501499   priority_bitmap.fill(0, cliprect);
502500   draw_sprites(machine(),bitmap,cliprect,primasks,0);
503501
504   if (!machine().input().code_pressed(KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0);
502   if (!machine().input().code_pressed(KEYCODE_B)) m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[4], 0, 0);
505503   if (!machine().input().code_pressed(KEYCODE_M)) m_tc0100scn->tilemap_draw(bitmap, cliprect, pivlayer[2], 0, 0);
506504
507505
r24008r24009
509507#else
510508   if (layer[0]==0 && layer[1]==3 && layer[2]==2 && layer[3]==1)
511509   {
512      tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[0], 0, 1);
513      tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[1], 0, 4);
514      tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[2], 0, 4);
515      tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[3], 0, 4);
510      m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[0], 0, 1);
511      m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[1], 0, 4);
512      m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[2], 0, 4);
513      m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[3], 0, 4);
516514   }
517515   else
518516   {
519      tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[0], 0, 1);
520      tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[1], 0, 2);
521      tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[2], 0, 4);
522      tc0480scp_tilemap_draw(tc0480scp, m_tmpbitmaps, clip, layer[3], 0, 8);
517      m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[0], 0, 1);
518      m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[1], 0, 2);
519      m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[2], 0, 4);
520      m_tc0480scp->tilemap_draw(m_tmpbitmaps, clip, layer[3], 0, 8);
523521   }
524522
525523   if (layer[0]==3 && layer[1]==0 && layer[2]==1 && layer[3]==2)
r24008r24009
548546   priority_bitmap.fill(0, cliprect);
549547   draw_sprites(bitmap,cliprect,primasks,0);
550548
551   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0);
549   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[4], 0, 0);
552550   m_tc0100scn->tilemap_draw(bitmap, cliprect, pivlayer[2], 0, 0);
553551#endif
554552
trunk/src/mame/video/warriorb.c
r24008r24009
11#include "emu.h"
2#include "video/taitoic.h"
32#include "includes/warriorb.h"
43
54/**********************************************************/
trunk/src/mame/video/dec0.c
r24008r24009
4747{
4848   flip_screen_set(m_tilegen1->get_flip_state());
4949
50   m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
50   m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
5151   m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, 0x08, 0x0f);
52   m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
52   m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
5353
5454   /* HB always keeps pf2 on top of pf3, no need explicitly support priority register */
5555
5656   m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, 0x00, 0x0f);
57   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
57   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
5858   return 0;
5959}
6060
r24008r24009
6767   /* WARNING: inverted wrt Midnight Resistance */
6868   if ((m_pri & 0x01) == 0)
6969   {
70      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
71      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
70      m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
71      m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
7272
7373      if (m_pri & 2)
74         m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
74         m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
7575
7676      m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
7777
7878      if (m_pri & 4)
79         m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
79         m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
8080   }
8181   else
8282   {
83      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
84      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
83      m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
84      m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
8585
8686      if (m_pri & 2)
87         m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
87         m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
8888
8989      m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
9090
9191      if (m_pri & 4)
92         m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
92         m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
9393   }
9494
95   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
95   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
9696   return 0;
9797}
9898
r24008r24009
115115      /* Robocop uses it only for the title screen, so this might be just */
116116      /* completely wrong. The top 8 bits of the register might mean */
117117      /* something (they are 0x80 in midres, 0x00 here) */
118      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
118      m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
119119
120120      if (m_pri & 0x02)
121121         m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
122122
123      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
123      m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
124124   }
125125   else
126126   {
127      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
127      m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
128128
129129      if (m_pri & 0x02)
130130         m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
131131
132      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
132      m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
133133   }
134134
135135   if (m_pri & 0x02)
r24008r24009
137137   else
138138      m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
139139
140   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
140   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
141141   return 0;
142142}
143143
r24008r24009
150150
151151   // the bootleg doesn't write these registers, I think they're hardcoded?, so fake them for compatibility with our implementation..
152152   address_space &space = machine().driver_data()->generic_space();
153   deco_bac06_pf_control_0_w(m_tilegen1,space,0,0x0003, 0x00ff); // 8x8
154   deco_bac06_pf_control_0_w(m_tilegen1,space,1,0x0003, 0x00ff);
155   deco_bac06_pf_control_0_w(m_tilegen1,space,2,0x0000, 0x00ff);
156   deco_bac06_pf_control_0_w(m_tilegen1,space,3,0x0001, 0x00ff); // dimensions
153   m_tilegen1->pf_control_0_w(space,0,0x0003, 0x00ff); // 8x8
154   m_tilegen1->pf_control_0_w(space,1,0x0003, 0x00ff);
155   m_tilegen1->pf_control_0_w(space,2,0x0000, 0x00ff);
156   m_tilegen1->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
157157
158   deco_bac06_pf_control_0_w(m_tilegen2,space,0,0x0082, 0x00ff); // 16x16
159   deco_bac06_pf_control_0_w(m_tilegen2,space,1,0x0000, 0x00ff);
160   deco_bac06_pf_control_0_w(m_tilegen2,space,2,0x0000, 0x00ff);
161   deco_bac06_pf_control_0_w(m_tilegen2,space,3,0x0001, 0x00ff); // dimensions
158   m_tilegen2->pf_control_0_w(space,0,0x0082, 0x00ff); // 16x16
159   m_tilegen2->pf_control_0_w(space,1,0x0000, 0x00ff);
160   m_tilegen2->pf_control_0_w(space,2,0x0000, 0x00ff);
161   m_tilegen2->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
162162
163   deco_bac06_pf_control_0_w(m_tilegen3,space,0,0x0082, 0x00ff); // 16x16
164   deco_bac06_pf_control_0_w(m_tilegen3,space,1,0x0003, 0x00ff);
165   deco_bac06_pf_control_0_w(m_tilegen3,space,2,0x0000, 0x00ff);
166   deco_bac06_pf_control_0_w(m_tilegen3,space,3,0x0001, 0x00ff); // dimensions
163   m_tilegen3->pf_control_0_w(space,0,0x0082, 0x00ff); // 16x16
164   m_tilegen3->pf_control_0_w(space,1,0x0003, 0x00ff);
165   m_tilegen3->pf_control_0_w(space,2,0x0000, 0x00ff);
166   m_tilegen3->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
167167
168168   // scroll registers got written elsewhere, copy them across
169   deco_bac06_pf_control_1_w(m_tilegen1,space,0,0x0000, 0xffff); // no scroll?
170   deco_bac06_pf_control_1_w(m_tilegen1,space,1,0x0000, 0xffff); // no scroll?
169   m_tilegen1->pf_control_1_w(space,0,0x0000, 0xffff); // no scroll?
170   m_tilegen1->pf_control_1_w(space,1,0x0000, 0xffff); // no scroll?
171171
172   deco_bac06_pf_control_1_w(m_tilegen2,space,0,m_automat_scroll_regs[3] - 0x010a, 0xffff);
173   deco_bac06_pf_control_1_w(m_tilegen2,space,1,m_automat_scroll_regs[2], 0xffff);
172   m_tilegen2->pf_control_1_w(space,0,m_automat_scroll_regs[3] - 0x010a, 0xffff);
173   m_tilegen2->pf_control_1_w(space,1,m_automat_scroll_regs[2], 0xffff);
174174
175   deco_bac06_pf_control_1_w(m_tilegen3,space,0,m_automat_scroll_regs[1] - 0x0108, 0xffff);
176   deco_bac06_pf_control_1_w(m_tilegen3,space,1,m_automat_scroll_regs[0], 0xffff);
175   m_tilegen3->pf_control_1_w(space,0,m_automat_scroll_regs[1] - 0x0108, 0xffff);
176   m_tilegen3->pf_control_1_w(space,1,m_automat_scroll_regs[0], 0xffff);
177177
178178
179179   flip_screen_set(m_tilegen1->get_flip_state());
r24008r24009
185185
186186   if (m_pri & 0x01)
187187   {
188      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
188      m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
189189
190190      if (m_pri & 0x02)
191191         m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
192192
193      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
193      m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
194194   }
195195   else
196196   {
197      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
197      m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
198198
199199      if (m_pri & 0x02)
200200         m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
201201
202      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
202      m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
203203   }
204204
205205   if (m_pri & 0x02)
r24008r24009
207207   else
208208      m_spritegen->draw_sprites_bootleg(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
209209
210   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
210   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
211211   return 0;
212212}
213213
r24008r24009
217217
218218   // the bootleg doesn't write these registers, I think they're hardcoded?, so fake them for compatibility with our implementation..
219219   address_space &space = machine().driver_data()->generic_space();
220   deco_bac06_pf_control_0_w(m_tilegen1,space,0,0x0003, 0x00ff); // 8x8
221   deco_bac06_pf_control_0_w(m_tilegen1,space,1,0x0003, 0x00ff);
222   deco_bac06_pf_control_0_w(m_tilegen1,space,2,0x0000, 0x00ff);
223   deco_bac06_pf_control_0_w(m_tilegen1,space,3,0x0001, 0x00ff); // dimensions
220   m_tilegen1->pf_control_0_w(space,0,0x0003, 0x00ff); // 8x8
221   m_tilegen1->pf_control_0_w(space,1,0x0003, 0x00ff);
222   m_tilegen1->pf_control_0_w(space,2,0x0000, 0x00ff);
223   m_tilegen1->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
224224
225   deco_bac06_pf_control_0_w(m_tilegen2,space,0,0x0082, 0x00ff); // 16x16
226   deco_bac06_pf_control_0_w(m_tilegen2,space,1,0x0000, 0x00ff);
227   deco_bac06_pf_control_0_w(m_tilegen2,space,2,0x0000, 0x00ff);
228   deco_bac06_pf_control_0_w(m_tilegen2,space,3,0x0001, 0x00ff); // dimensions
225   m_tilegen2->pf_control_0_w(space,0,0x0082, 0x00ff); // 16x16
226   m_tilegen2->pf_control_0_w(space,1,0x0000, 0x00ff);
227   m_tilegen2->pf_control_0_w(space,2,0x0000, 0x00ff);
228   m_tilegen2->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
229229
230   deco_bac06_pf_control_0_w(m_tilegen3,space,0,0x0082, 0x00ff); // 16x16
231   deco_bac06_pf_control_0_w(m_tilegen3,space,1,0x0003, 0x00ff);
232   deco_bac06_pf_control_0_w(m_tilegen3,space,2,0x0000, 0x00ff);
233   deco_bac06_pf_control_0_w(m_tilegen3,space,3,0x0001, 0x00ff); // dimensions
230   m_tilegen3->pf_control_0_w(space,0,0x0082, 0x00ff); // 16x16
231   m_tilegen3->pf_control_0_w(space,1,0x0003, 0x00ff);
232   m_tilegen3->pf_control_0_w(space,2,0x0000, 0x00ff);
233   m_tilegen3->pf_control_0_w(space,3,0x0001, 0x00ff); // dimensions
234234
235235   // scroll registers got written elsewhere, copy them across
236   deco_bac06_pf_control_1_w(m_tilegen1,space,0,0x0000, 0xffff); // no scroll?
237   deco_bac06_pf_control_1_w(m_tilegen1,space,1,0x0000, 0xffff); // no scroll?
236   m_tilegen1->pf_control_1_w(space,0,0x0000, 0xffff); // no scroll?
237   m_tilegen1->pf_control_1_w(space,1,0x0000, 0xffff); // no scroll?
238238
239   deco_bac06_pf_control_1_w(m_tilegen2,space,0,m_automat_scroll_regs[3] - 0x010a, 0xffff);
240   deco_bac06_pf_control_1_w(m_tilegen2,space,1,m_automat_scroll_regs[2], 0xffff);
239   m_tilegen2->pf_control_1_w(space,0,m_automat_scroll_regs[3] - 0x010a, 0xffff);
240   m_tilegen2->pf_control_1_w(space,1,m_automat_scroll_regs[2], 0xffff);
241241
242   deco_bac06_pf_control_1_w(m_tilegen3,space,0,m_automat_scroll_regs[1] - 0x0108, 0xffff);
243   deco_bac06_pf_control_1_w(m_tilegen3,space,1,m_automat_scroll_regs[0], 0xffff);
242   m_tilegen3->pf_control_1_w(space,0,m_automat_scroll_regs[1] - 0x0108, 0xffff);
243   m_tilegen3->pf_control_1_w(space,1,m_automat_scroll_regs[0], 0xffff);
244244
245245   flip_screen_set(m_tilegen1->get_flip_state());
246246
247   m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
248   m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
247   m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
248   m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
249249
250250   m_spritegen->draw_sprites_bootleg(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
251251
252252   /* Redraw top 8 pens of top 8 palettes over sprites */
253253   if (m_pri&0x80)
254      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
254      m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
255255
256   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
256   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
257257   return 0;
258258}
259259
r24008r24009
267267   /* This game doesn't have the extra playfield chip on the game board, but
268268   the palette does show through. */
269269   bitmap.fill(machine().pens[768], cliprect);
270   m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
270   m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
271271   m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
272   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
272   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
273273   return 0;
274274}
275275
r24008r24009
281281
282282   if (m_pri & 0x01)
283283   {
284      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
285      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
284      m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
285      m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
286286   }
287287   else
288288   {
289      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
290      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
289      m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
290      m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
291291   }
292292
293293   m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
294   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
294   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
295295   return 0;
296296}
297297
r24008r24009
301301{
302302   flip_screen_set(m_tilegen1->get_flip_state());
303303
304   m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
305   m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
304   m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
305   m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
306306
307307   m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
308308
309309   /* Redraw top 8 pens of top 8 palettes over sprites */
310310   if (m_pri&0x80)
311      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
311      m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
312312
313   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
313   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
314314   return 0;
315315}
316316
r24008r24009
328328
329329   if (m_pri & 0x01)
330330   {
331      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
331      m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
332332
333333      if (m_pri & 0x02)
334334         m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
335335
336      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
336      m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
337337   }
338338   else
339339   {
340      m_tilegen3->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
340      m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
341341
342342      if (m_pri & 0x02)
343343         m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f);
344344
345      m_tilegen2->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
345      m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
346346   }
347347
348348   if (m_pri & 0x02)
r24008r24009
350350   else
351351      m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f);
352352
353   m_tilegen1->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
353   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
354354   return 0;
355355}
356356
trunk/src/mame/video/superchs.c
r24008r24009
11#include "emu.h"
2#include "video/taitoic.h"
32#include "includes/superchs.h"
43
54void superchs_state::video_start()
r24008r24009
199198
200199UINT32 superchs_state::screen_update_superchs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
201200{
202   device_t *tc0480scp = machine().device("tc0480scp");
203201   UINT8 layer[5];
204202   UINT16 priority;
205203   static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
206204
207   tc0480scp_tilemap_update(tc0480scp);
205   m_tc0480scp->tilemap_update();
208206
209   priority = tc0480scp_get_bg_priority(tc0480scp);
207   priority = m_tc0480scp->get_bg_priority();
210208   layer[0] = (priority & 0xf000) >> 12;   /* tells us which bg layer is bottom */
211209   layer[1] = (priority & 0x0f00) >>  8;
212210   layer[2] = (priority & 0x00f0) >>  4;
r24008r24009
219217      sprites as pdrawgfx cannot yet cope with more than 4 layers */
220218
221219#ifdef MAME_DEBUG
222   if (!machine().input().code_pressed (KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
223   if (!machine().input().code_pressed (KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
224   if (!machine().input().code_pressed (KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
225   if (!machine().input().code_pressed (KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
226   if (!machine().input().code_pressed (KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);
220   if (!machine().input().code_pressed (KEYCODE_Z)) m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
221   if (!machine().input().code_pressed (KEYCODE_X)) m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[1], 0, 1);
222   if (!machine().input().code_pressed (KEYCODE_C)) m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[2], 0, 2);
223   if (!machine().input().code_pressed (KEYCODE_V)) m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[3], 0, 4);
224   if (!machine().input().code_pressed (KEYCODE_B)) m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[4], 0, 8);
227225   if (!machine().input().code_pressed (KEYCODE_N)) draw_sprites(bitmap, cliprect, primasks, 48, -116);
228226#else
229   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
230   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
231   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
232   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
233   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);    /* text layer */
227   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
228   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[1], 0, 1);
229   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[2], 0, 2);
230   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[3], 0, 4);
231   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[4], 0, 8);    /* text layer */
234232   draw_sprites(bitmap, cliprect, primasks, 48, -116);
235233#endif
236234   return 0;
trunk/src/mame/video/othunder.c
r24008r24009
11#include "emu.h"
2#include "video/taitoic.h"
32#include "includes/othunder.h"
43
54
trunk/src/mame/video/slapshot.c
r24008r24009
11#include "emu.h"
2#include "video/taitoic.h"
32#include "includes/slapshot.h"
43
54/**********************************************************/
r24008r24009
493492
494493   taito_handle_sprite_buffering();
495494
496   tc0480scp_tilemap_update(m_tc0480scp);
495   m_tc0480scp->tilemap_update();
497496
498   priority = tc0480scp_get_bg_priority(m_tc0480scp);
497   priority = m_tc0480scp->get_bg_priority();
499498
500499   layer[0] = (priority & 0xf000) >> 12;   /* tells us which bg layer is bottom */
501500   layer[1] = (priority & 0x0f00) >>  8;
r24008r24009
522521#ifdef MAME_DEBUG
523522   if (m_dislayer[layer[0]] == 0)
524523#endif
525      tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[0], 0, 1);
524      m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[0], 0, 1);
526525
527526#ifdef MAME_DEBUG
528527   if (m_dislayer[layer[1]] == 0)
529528#endif
530      tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[1], 0, 2);
529      m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[1], 0, 2);
531530
532531#ifdef MAME_DEBUG
533532   if (m_dislayer[layer[2]] == 0)
534533#endif
535      tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[2], 0, 4);
534      m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[2], 0, 4);
536535
537536#ifdef MAME_DEBUG
538537   if (m_dislayer[layer[3]] == 0)
539538#endif
540      tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[3], 0, 8);
539      m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[3], 0, 8);
541540
542541   {
543542      int primasks[4] = {0,0,0,0};
r24008r24009
563562#ifdef MAME_DEBUG
564563   if (m_dislayer[layer[4]] == 0)
565564#endif
566   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[4], 0, 0);
565   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[4], 0, 0);
567566   return 0;
568567}
trunk/src/mame/video/gunbustr.c
r24008r24009
11#include "emu.h"
2#include "video/taitoic.h"
32#include "includes/gunbustr.h"
43
54/************************************************************/
r24008r24009
202201
203202UINT32 gunbustr_state::screen_update_gunbustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
204203{
205   device_t *tc0480scp = machine().device("tc0480scp");
206204   UINT8 layer[5];
207205   UINT16 priority;
208206   static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
209207
210   tc0480scp_tilemap_update(tc0480scp);
208   m_tc0480scp->tilemap_update();
211209
212   priority = tc0480scp_get_bg_priority(tc0480scp);
210   priority = m_tc0480scp->get_bg_priority();
213211   layer[0] = (priority & 0xf000) >> 12;   /* tells us which bg layer is bottom */
214212   layer[1] = (priority & 0x0f00) >>  8;
215213   layer[2] = (priority & 0x00f0) >>  4;
r24008r24009
222220      sprites as pdrawgfx cannot yet cope with more than 4 layers */
223221
224222#ifdef MAME_DEBUG
225   if (!machine().input().code_pressed (KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0],TILEMAP_DRAW_OPAQUE, 0);
226   if (!machine().input().code_pressed (KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
227   if (!machine().input().code_pressed (KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
228   if (!machine().input().code_pressed (KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
229   if (!machine().input().code_pressed (KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);
223   if (!machine().input().code_pressed (KEYCODE_Z)) m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[0],TILEMAP_DRAW_OPAQUE, 0);
224   if (!machine().input().code_pressed (KEYCODE_X)) m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[1], 0, 1);
225   if (!machine().input().code_pressed (KEYCODE_C)) m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[2], 0, 2);
226   if (!machine().input().code_pressed (KEYCODE_V)) m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[3], 0, 4);
227   if (!machine().input().code_pressed (KEYCODE_B)) m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[4], 0, 8);
230228   if (!machine().input().code_pressed (KEYCODE_N)) draw_sprites(bitmap, cliprect, primasks, 48, -116);
231229#else
232   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
233   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
234   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
235   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
236   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);    /* text layer */
230   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
231   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[1], 0, 1);
232   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[2], 0, 2);
233   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[3], 0, 4);
234   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[4], 0, 8);    /* text layer */
237235   draw_sprites(bitmap, cliprect, primasks, 48, -116);
238236#endif
239237   return 0;
trunk/src/mame/video/taito_z.c
r24008r24009
11#include "emu.h"
2#include "video/taitoic.h"
32#include "includes/taito_z.h"
43
54/**********************************************************/
r24008r24009
847846
848847   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[0], 0, 0);
849848   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[1], 0, 1);
850   tc0150rod_draw(m_tc0150rod, bitmap, cliprect, -3, m_road_palbank << 6, 1, 0, 1, 2); // -6
849   m_tc0150rod->draw(bitmap, cliprect, -3, m_road_palbank << 6, 1, 0, 1, 2); // -6
851850   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[2], 0, 4);
852851
853852   contcirc_draw_sprites_16x8(bitmap, cliprect, 5); // 7
r24008r24009
874873
875874   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
876875   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[1], 0, 1);
877   tc0150rod_draw(m_tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
876   m_tc0150rod->draw(bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
878877   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[2], 0, 4);
879878
880879   chasehq_draw_sprites_16x16(bitmap, cliprect, 7);
r24008r24009
899898
900899   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
901900   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[1], 0, 1);
902   tc0150rod_draw(m_tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 1, 1, 2);
901   m_tc0150rod->draw(bitmap, cliprect, -1, 0xc0, 0, 1, 1, 2);
903902   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[2], 0, 4);
904903
905904   bshark_draw_sprites_16x8(bitmap, cliprect, 8);
r24008r24009
924923
925924   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
926925   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[1], 0, 1);
927   tc0150rod_draw(m_tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
926   m_tc0150rod->draw(bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
928927   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[2], 0, 4);
929928
930929   sci_draw_sprites_16x8(bitmap, cliprect, 6);
r24008r24009
949948
950949   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
951950   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[1], 0, 1);
952   tc0150rod_draw(m_tc0150rod, bitmap, cliprect, -1, 0, 2, 1, 1, 2);
951   m_tc0150rod->draw(bitmap, cliprect, -1, 0, 2, 1, 1, 2);
953952   m_tc0100scn->tilemap_draw(bitmap, cliprect, layer[2], 0, 4);
954953
955954   aquajack_draw_sprites_16x8(bitmap, cliprect, 3);
r24008r24009
987986   UINT8 layer[5];
988987   UINT16 priority;
989988
990   tc0480scp_tilemap_update(m_tc0480scp);
989   m_tc0480scp->tilemap_update();
991990
992   priority = tc0480scp_get_bg_priority(m_tc0480scp);
991   priority = m_tc0480scp->get_bg_priority();
993992
994993   layer[0] = (priority & 0xf000) >> 12;   /* tells us which bg layer is bottom */
995994   layer[1] = (priority & 0x0f00) >>  8;
r24008r24009
10021001   /* Ensure screen blanked - this shouldn't be necessary! */
10031002   bitmap.fill(0, cliprect);
10041003
1005   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
1006   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[1], 0, 0);
1007   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[2], 0, 1);
1004   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
1005   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[1], 0, 0);
1006   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[2], 0, 1);
10081007
1009   tc0150rod_draw(m_tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
1008   m_tc0150rod->draw(bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
10101009   bshark_draw_sprites_16x8(bitmap, cliprect, 7);
10111010
10121011   /* This layer used for the big numeric displays */
1013   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[3], 0, 4);
1012   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[3], 0, 4);
10141013
1015   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[4], 0, 0);  /* Text layer */
1014   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[4], 0, 0);  /* Text layer */
10161015   return 0;
10171016}
10181017
r24008r24009
10221021   UINT8 layer[5];
10231022   UINT16 priority;
10241023
1025   tc0480scp_tilemap_update(m_tc0480scp);
1024   m_tc0480scp->tilemap_update();
10261025
1027   priority = tc0480scp_get_bg_priority(m_tc0480scp);
1026   priority = m_tc0480scp->get_bg_priority();
10281027
10291028   layer[0] = (priority & 0xf000) >> 12;   /* tells us which bg layer is bottom */
10301029   layer[1] = (priority & 0x0f00) >>  8;
r24008r24009
10371036   /* Ensure screen blanked - this shouldn't be necessary! */
10381037   bitmap.fill(0, cliprect);
10391038
1040   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
1041   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[1], 0, 0);
1042   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[2], 0, 2);
1043   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[3], 0, 2);
1039   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
1040   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[1], 0, 0);
1041   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[2], 0, 2);
1042   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[3], 0, 2);
10441043
1045   tc0150rod_draw(m_tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
1044   m_tc0150rod->draw(bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
10461045   sci_draw_sprites_16x8(bitmap, cliprect, 7);
10471046
1048   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[4], 0, 4);
1047   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[4], 0, 4);
10491048   return 0;
10501049}
trunk/src/mame/video/taito_f2.c
r24008r24009
11#include "emu.h"
2#include "video/taitoic.h"
32#include "includes/taito_f2.h"
43
54/************************************************************
r24008r24009
3332   m_hide_pixels = hide;
3433   m_flip_hide_pixels = flip_hide;
3534
36   m_spriteram_delayed = auto_alloc_array(machine(), UINT16, m_spriteram.bytes() / 2);
37   m_spriteram_buffered = auto_alloc_array(machine(), UINT16, m_spriteram.bytes() / 2);
38   m_spritelist = auto_alloc_array(machine(), struct f2_tempsprite, 0x400);
35   m_spriteram_delayed = auto_alloc_array_clear(machine(), UINT16, m_spriteram.bytes() / 2);
36   m_spriteram_buffered = auto_alloc_array_clear(machine(), UINT16, m_spriteram.bytes() / 2);
37   m_spritelist = auto_alloc_array_clear(machine(), struct f2_tempsprite, 0x400);
3938
4039   for (i = 0; i < 8; i ++)
4140   {
r24008r24009
12721271
12731272   taitof2_handle_sprite_buffering();
12741273
1275   tc0480scp_tilemap_update(m_tc0480scp);
1274   m_tc0480scp->tilemap_update();
12761275
1277   priority = tc0480scp_get_bg_priority(m_tc0480scp);
1276   priority = m_tc0480scp->get_bg_priority();
12781277
12791278   layer[0] = (priority & 0xf000) >> 12;   /* tells us which bg layer is bottom */
12801279   layer[1] = (priority & 0x0f00) >>  8;
r24008r24009
13031302   machine().priority_bitmap.fill(0, cliprect);
13041303   bitmap.fill(0, cliprect);
13051304
1306   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[0], 0 ,1);
1307   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[1], 0, 2);
1308   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[2], 0, 4);
1309   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[3], 0, 8);
1310   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[4], 0, 16);
1305   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[0], 0 ,1);
1306   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[1], 0, 2);
1307   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[2], 0, 4);
1308   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[3], 0, 8);
1309   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[4], 0, 16);
13111310
13121311   draw_sprites(bitmap, cliprect, NULL, 1);
13131312   return 0;
r24008r24009
13251324
13261325   taitof2_handle_sprite_buffering();
13271326
1328   tc0480scp_tilemap_update(m_tc0480scp);
1327   m_tc0480scp->tilemap_update();
13291328
1330   priority = tc0480scp_get_bg_priority(m_tc0480scp);
1329   priority = m_tc0480scp->get_bg_priority();
13311330
13321331   layer[0] = (priority & 0xf000) >> 12;   /* tells us which bg layer is bottom */
13331332   layer[1] = (priority & 0x0f00) >>  8;
r24008r24009
13511350   machine().priority_bitmap.fill(0, cliprect);
13521351   bitmap.fill(0, cliprect);
13531352
1354   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[0], 0 ,1);
1355   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[1], 0, 2);
1356   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[2], 0, 4);
1357   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[3], 0, 8);
1353   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[0], 0 ,1);
1354   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[1], 0, 2);
1355   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[2], 0, 4);
1356   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[3], 0, 8);
13581357
13591358   {
13601359      int primasks[4] = {0,0,0,0};
r24008r24009
13771376   that the FG layer is always on top of sprites.
13781377   */
13791378
1380   tc0480scp_tilemap_draw(m_tc0480scp, bitmap, cliprect, layer[4], 0, 0);
1379   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[4], 0, 0);
13811380   return 0;
13821381}
trunk/src/mame/video/groundfx.c
r24008r24009
11#include "emu.h"
2#include "video/taitoic.h"
32#include "includes/groundfx.h"
43
54/******************************************************************/
r24008r24009
197196UINT32 groundfx_state::screen_update_groundfx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
198197{
199198   address_space &space = machine().driver_data()->generic_space();
200   device_t *tc0480scp = machine().device("tc0480scp");
201199   UINT8 layer[5];
202200   UINT8 pivlayer[3];
203201   UINT16 priority;
204202
205203   m_tc0100scn->tilemap_update();
206   tc0480scp_tilemap_update(tc0480scp);
204   m_tc0480scp->tilemap_update();
207205
208   priority = tc0480scp_get_bg_priority(tc0480scp);
206   priority = m_tc0480scp->get_bg_priority();
209207
210208   layer[0] = (priority & 0xf000) >> 12;   /* tells us which bg layer is bottom */
211209   layer[1] = (priority & 0x0f00) >>  8;
r24008r24009
240238
241239   */
242240   if (m_tc0100scn->long_r(space, 0x4090 / 4, 0xffffffff) ||
243         tc0480scp_long_r(tc0480scp, space, 0x20 / 4, 0xffffffff) == 0x240866)  /* Anything in text layer - really stupid hack */
241         m_tc0480scp->long_r(space, 0x20 / 4, 0xffffffff) == 0x240866)  /* Anything in text layer - really stupid hack */
244242   {
245      tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 2);
246      tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 4);
247      tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 8);
243      m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[1], 0, 2);
244      m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[2], 0, 4);
245      m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[3], 0, 8);
248246
249247      //m_tc0100scn->tilemap_draw(bitmap, cliprect, 0, pivlayer[2], 0, 0);
250248
251      if (tc0480scp_long_r(tc0480scp, space, 0x20 / 4, 0xffffffff) != 0x240866) /* Stupid hack for start of race */
252         tc0480scp_tilemap_draw(tc0480scp, bitmap, m_hack_cliprect, layer[0], 0, 0);
249      if (m_tc0480scp->long_r(space, 0x20 / 4, 0xffffffff) != 0x240866) /* Stupid hack for start of race */
250         m_tc0480scp->tilemap_draw(bitmap, m_hack_cliprect, layer[0], 0, 0);
253251      draw_sprites(bitmap, cliprect, 1, 44, -574);
254252   }
255253   else
256254   {
257      tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], 0, 1);
258      tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 2);
259      tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 4);
260      tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 8);
255      m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[0], 0, 1);
256      m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[1], 0, 2);
257      m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[2], 0, 4);
258      m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[3], 0, 8);
261259
262260      m_tc0100scn->tilemap_draw(bitmap, cliprect, pivlayer[2], 0, 0);
263261
264262      draw_sprites(bitmap, cliprect, 0, 44, -574);
265263   }
266264
267   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0);    /* TC0480SCP text layer */
265   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[4], 0, 0);    /* TC0480SCP text layer */
268266   return 0;
269267}
trunk/src/mame/video/pcktgal.c
r24008r24009
11#include "emu.h"
22#include "includes/pcktgal.h"
3#include "video/decbac06.h"
43
54void pcktgal_state::palette_init()
65{
r24008r24009
6665
6766UINT32 pcktgal_state::screen_update_pcktgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
6867{
69//  flip_screen_set(machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
70   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
68   m_tilegen1->get_flip_state();
69   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
7170   draw_sprites(bitmap, cliprect);
7271   return 0;
7372}
r24008r24009
7574UINT32 pcktgal_state::screen_update_pcktgalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
7675{
7776   // the bootleg doesn't properly set the tilemap registers, because it's on non-original hardware, which probably doesn't have the flexible tilemaps.
78   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw_bootleg(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0, 2);
77   m_tilegen1->deco_bac06_pf_draw_bootleg(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0, 2);
7978   draw_sprites(bitmap, cliprect);
8079   return 0;
8180}
trunk/src/mame/video/ninjaw.c
r24008r24009
11#include "emu.h"
2#include "video/taitoic.h"
32#include "includes/ninjaw.h"
43
54/**********************************************************/
trunk/src/mame/video/madmotor.c
r24008r24009
88
99#include "emu.h"
1010#include "includes/madmotor.h"
11#include "video/decbac06.h"
1211#include "video/decmxc06.h"
1312
1413/******************************************************************************/
r24008r24009
2423
2524UINT32 madmotor_state::screen_update_madmotor(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
2625{
27   flip_screen_set(machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
26   m_tilegen1->get_flip_state();
2827
29//  machine().tilemap().set_flip_all(machine().device<deco_bac06_device>("tilegen1")->get_flip_state() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
28//  machine().tilemap().set_flip_all(m_tilegen1->get_flip_state() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
3029
31   machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
32   machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
30   m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
31   m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
3332   machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram, 0x00, 0x00, 0x0f);
34   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
33   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
3534   return 0;
3635}
trunk/src/mame/video/decbac06.c
r24008r24009
6363#include "emu.h"
6464#include "decbac06.h"
6565
66void deco_bac06_device::set_gfx_region_wide(device_t &device, int region8x8, int region16x16, int wide)
67{
68   deco_bac06_device &dev = downcast<deco_bac06_device &>(device);
69   dev.m_gfxregion8x8 = region8x8;
70   dev.m_gfxregion16x16 = region16x16;
71   dev.m_wide = wide;
72}
73
7466const device_type DECO_BAC06 = &device_creator<deco_bac06_device>;
7567
7668deco_bac06_device::deco_bac06_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
7769   : device_t(mconfig, DECO_BAC06, "decbac06_device", tag, owner, clock, "deco_bac06", __FILE__),
70      m_pf_data(NULL),
71       m_pf_rowscroll(NULL),
72      m_pf_colscroll(NULL),
73      m_tile_region(0),
74      m_gfxcolmask(0),
75      m_rambank(0),
7876      m_gfxregion8x8(0),
7977      m_gfxregion16x16(0),
80      m_wide(0)
78      m_wide(0),
79      m_bppmult(0),
80      m_bppmask(0)
81      //m_pf_control_0[8]
82      //m_pf_control_1[8]
83{
84}
85
86void deco_bac06_device::device_start()
8187{
88   m_pf_data = auto_alloc_array_clear(machine(), UINT16, 0x4000 / 2); // 0x2000 is the maximum needed, some games / chip setups map less and mirror - stadium hero banks this to 0x4000?!
89   m_pf_rowscroll = auto_alloc_array_clear(machine(), UINT16, 0x2000 / 2);
90   m_pf_colscroll = auto_alloc_array_clear(machine(), UINT16, 0x2000 / 2);
91
92   create_tilemaps(m_gfxregion8x8, m_gfxregion16x16);
93   m_gfxcolmask = 0x0f;
94
95   m_bppmult = 0x10;
96   m_bppmask = 0x0f;
97   m_rambank = 0;
98
99   save_pointer(NAME(m_pf_data), 0x4000/2);
100   save_pointer(NAME(m_pf_rowscroll), 0x2000/2);
101   save_pointer(NAME(m_pf_colscroll), 0x2000/2);
102   save_pointer(NAME(m_pf_control_0), 8);
103   save_pointer(NAME(m_pf_control_1), 8);
104
105   save_item(NAME(m_rambank));
82106}
83107
108void deco_bac06_device::device_reset()
109{
110}
111
112void deco_bac06_device::set_gfx_region_wide(device_t &device, int region8x8, int region16x16, int wide)
113{
114   deco_bac06_device &dev = downcast<deco_bac06_device &>(device);
115   dev.m_gfxregion8x8 = region8x8;
116   dev.m_gfxregion16x16 = region16x16;
117   dev.m_wide = wide;
118}
119
84120TILEMAP_MAPPER_MEMBER(deco_bac06_device::tile_shape0_scan)
85121{
86122   return (col & 0xf) + ((row & 0xf) << 4) + ((col & 0x1f0) << 4);
r24008r24009
114150TILE_GET_INFO_MEMBER(deco_bac06_device::get_pf8x8_tile_info)
115151{
116152   if (m_rambank&1) tile_index+=0x1000;
117   int tile=pf_data[tile_index];
153   int tile=m_pf_data[tile_index];
118154   int colourpri=(tile>>12);
119   SET_TILE_INFO_MEMBER(tile_region,tile&0xfff,0,0);
155   SET_TILE_INFO_MEMBER(m_tile_region,tile&0xfff,0,0);
120156   tileinfo.category = colourpri;
121157}
122158
123159TILE_GET_INFO_MEMBER(deco_bac06_device::get_pf16x16_tile_info)
124160{
125161   if (m_rambank&1) tile_index+=0x1000;
126   int tile=pf_data[tile_index];
162   int tile=m_pf_data[tile_index];
127163   int colourpri=(tile>>12);
128   SET_TILE_INFO_MEMBER(tile_region,tile&0xfff,0,0);
164   SET_TILE_INFO_MEMBER(m_tile_region,tile&0xfff,0,0);
129165   tileinfo.category = colourpri;
130166}
131167
132168void deco_bac06_device::create_tilemaps(int region8x8, int region16x16)
133169{
134   tile_region = region8x8;
170   m_tile_region = region8x8;
135171
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);
172   m_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);
173   m_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);
174   m_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);
139175
140   tile_region = region16x16;
176   m_tile_region = region16x16;
141177
142178   if (m_wide==2)
143179   {
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);
180      m_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);
181      m_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);
182      m_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);
147183   }
148184   else if (m_wide==1)
149185   {
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);
186      m_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);
187      m_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);
188      m_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);
153189   }
154190   else
155191   {
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);
192      m_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);
193      m_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);
194      m_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);
159195   }
160196}
161197
162void deco_bac06_device::device_start()
163{
164   pf_data = auto_alloc_array_clear(this->machine(), UINT16, 0x4000 / 2); // 0x2000 is the maximum needed, some games / chip setups map less and mirror - stadium hero banks this to 0x4000?!
165   pf_rowscroll = auto_alloc_array_clear(this->machine(), UINT16, 0x2000 / 2);
166   pf_colscroll = auto_alloc_array_clear(this->machine(), UINT16, 0x2000 / 2);
167
168   create_tilemaps(m_gfxregion8x8, m_gfxregion16x16);
169   m_gfxcolmask = 0x0f;
170
171   m_bppmult = 0x10;
172   m_bppmask = 0x0f;
173   m_rambank = 0;
174
175   save_pointer(NAME(pf_data), 0x4000/2);
176   save_pointer(NAME(pf_rowscroll), 0x2000/2);
177   save_pointer(NAME(pf_colscroll), 0x2000/2);
178   save_pointer(NAME(pf_control_0), 8);
179   save_pointer(NAME(pf_control_1), 8);
180
181   save_item(NAME(m_rambank));
182}
183
184void deco_bac06_device::device_reset()
185{
186}
187
188
189void deco_bac06_device::custom_tilemap_draw(running_machine &machine,
190                        bitmap_ind16 &bitmap,
198void deco_bac06_device::custom_tilemap_draw(bitmap_ind16 &bitmap,
191199                        const rectangle &cliprect,
192200                        tilemap_t *tilemap_ptr,
193201                        const UINT16 *rowscroll_ptr,
r24008r24009
246254   doesn't affect any games.
247255   */
248256
249   if (machine.driver_data()->flip_screen())
257   if (machine().driver_data()->flip_screen())
250258      src_y = (src_bitmap.height() - 256) - scrolly;
251259   else
252260      src_y = scrolly;
r24008r24009
257265      else
258266         src_x=scrollx;
259267
260      if (machine.driver_data()->flip_screen())
268      if (machine().driver_data()->flip_screen())
261269         src_x=(src_bitmap.width() - 256) - src_x;
262270
263271      for (x=0; x<=cliprect.max_x; x++) {
r24008r24009
279287   }
280288}
281289
282void deco_bac06_device::deco_bac06_pf_draw(running_machine &machine,bitmap_ind16 &bitmap,const rectangle &cliprect,int flags,UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition)
290void deco_bac06_device::deco_bac06_pf_draw(bitmap_ind16 &bitmap,const rectangle &cliprect,int flags,UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition)
283291{
284292   tilemap_t* tm = 0;
285293
286   switch (pf_control_0[3]&0x3) {
294   switch (m_pf_control_0[3]&0x3) {
287295      case 0: /* 4x1 */
288         if (pf_control_0[0]&0x1)
289            tm = pf8x8_tilemap[0];
296         if (m_pf_control_0[0]&0x1)
297            tm = m_pf8x8_tilemap[0];
290298         else
291            tm = pf16x16_tilemap[0];
299            tm = m_pf16x16_tilemap[0];
292300         break;
293301
294302      case 1: /* 2x2 */
295303      default:
296         if (pf_control_0[0]&0x1)
297            tm = pf8x8_tilemap[1];
304         if (m_pf_control_0[0]&0x1)
305            tm = m_pf8x8_tilemap[1];
298306         else
299            tm = pf16x16_tilemap[1];
307            tm = m_pf16x16_tilemap[1];
300308         break;
301309
302310      case 2: /* 1x4 */
303         if (pf_control_0[0]&0x1)
304            tm = pf8x8_tilemap[2];
311         if (m_pf_control_0[0]&0x1)
312            tm = m_pf8x8_tilemap[2];
305313         else
306            tm = pf16x16_tilemap[2];
314            tm = m_pf16x16_tilemap[2];
307315         break;
308316   };
309317
310318   if (tm)
311      custom_tilemap_draw(machine,bitmap,cliprect,tm,pf_rowscroll,pf_colscroll,pf_control_0,pf_control_1,flags, penmask, pencondition, colprimask, colpricondition);
319      custom_tilemap_draw(bitmap,cliprect,tm,m_pf_rowscroll,m_pf_colscroll,m_pf_control_0,m_pf_control_1,flags, penmask, pencondition, colprimask, colpricondition);
312320
313321}
314322
315323// used for pocket gal bootleg, which doesn't set registers properly and simply expects a fixed size tilemap.
316void deco_bac06_device::deco_bac06_pf_draw_bootleg(running_machine &machine,bitmap_ind16 &bitmap,const rectangle &cliprect,int flags, int mode, int type)
324void deco_bac06_device::deco_bac06_pf_draw_bootleg(bitmap_ind16 &bitmap,const rectangle &cliprect,int flags, int mode, int type)
317325{
318326   tilemap_t* tm = 0;
319   if (!mode) tm = pf8x8_tilemap[type];
320   else tm = pf16x16_tilemap[type];
327   if (!mode) tm = m_pf8x8_tilemap[type];
328   else tm = m_pf16x16_tilemap[type];
321329
322   custom_tilemap_draw(machine,bitmap,cliprect,tm,pf_rowscroll,pf_colscroll,0,0,flags, 0, 0, 0, 0);
330   custom_tilemap_draw(bitmap,cliprect,tm,m_pf_rowscroll,m_pf_colscroll,0,0,flags, 0, 0, 0, 0);
323331}
324332
325333
326334
327WRITE16_DEVICE_HANDLER( deco_bac06_pf_control_0_w )
335WRITE16_MEMBER( deco_bac06_device::pf_control_0_w )
328336{
329337   offset &= 3;
330   deco_bac06_device *dev = (deco_bac06_device*)device;
338   
339   COMBINE_DATA(&m_pf_control_0[offset]);
331340
332   COMBINE_DATA(&dev->pf_control_0[offset]);
333
334341   if (offset==2)
335342   {
336      int newbank = dev->pf_control_0[offset]&1;
337      if ((newbank&1) != (dev->m_rambank&1))
343      int newbank = m_pf_control_0[offset]&1;
344      if ((newbank&1) != (m_rambank&1))
338345      {
339346         // I don't know WHY Stadium Hero uses this as a bank but the RAM test expects it..
340347         // I'm curious as to if anything else sets it tho
341         if (strcmp(dev->machine().system().name,"stadhero"))
348         if (strcmp(machine().system().name,"stadhero"))
342349            printf("tilemap ram bank change to %d\n", newbank&1);
343350
344         dev->m_rambank = newbank&1;
345         dev->pf8x8_tilemap[0]->mark_all_dirty();
346         dev->pf8x8_tilemap[1]->mark_all_dirty();
347         dev->pf8x8_tilemap[2]->mark_all_dirty();
348         dev->pf16x16_tilemap[0]->mark_all_dirty();
349         dev->pf16x16_tilemap[1]->mark_all_dirty();
350         dev->pf16x16_tilemap[2]->mark_all_dirty();
351         m_rambank = newbank&1;
352         m_pf8x8_tilemap[0]->mark_all_dirty();
353         m_pf8x8_tilemap[1]->mark_all_dirty();
354         m_pf8x8_tilemap[2]->mark_all_dirty();
355         m_pf16x16_tilemap[0]->mark_all_dirty();
356         m_pf16x16_tilemap[1]->mark_all_dirty();
357         m_pf16x16_tilemap[2]->mark_all_dirty();
351358      }
352359   }
353360}
354361
355READ16_DEVICE_HANDLER( deco_bac06_pf_control_1_r )
362READ16_MEMBER( deco_bac06_device::pf_control_1_r )
356363{
357364   offset &= 7;
358   deco_bac06_device *dev = (deco_bac06_device*)device;
359   return dev->pf_control_1[offset];
365   return m_pf_control_1[offset];
360366}
361367
362WRITE16_DEVICE_HANDLER( deco_bac06_pf_control_1_w )
368WRITE16_MEMBER( deco_bac06_device::pf_control_1_w )
363369{
364370   offset &= 7;
365   deco_bac06_device *dev = (deco_bac06_device*)device;
366   COMBINE_DATA(&dev->pf_control_1[offset]);
371   COMBINE_DATA(&m_pf_control_1[offset]);
367372}
368373
369WRITE16_DEVICE_HANDLER( deco_bac06_pf_data_w )
374WRITE16_MEMBER( deco_bac06_device::pf_data_w )
370375{
371   deco_bac06_device *dev = (deco_bac06_device*)device;
372   if (dev->m_rambank&1) offset+=0x1000;
376   if (m_rambank&1) offset+=0x1000;
373377
374   COMBINE_DATA(&dev->pf_data[offset]);
375   dev->pf8x8_tilemap[0]->mark_tile_dirty(offset);
376   dev->pf8x8_tilemap[1]->mark_tile_dirty(offset);
377   dev->pf8x8_tilemap[2]->mark_tile_dirty(offset);
378   dev->pf16x16_tilemap[0]->mark_tile_dirty(offset);
379   dev->pf16x16_tilemap[1]->mark_tile_dirty(offset);
380   dev->pf16x16_tilemap[2]->mark_tile_dirty(offset);
378   COMBINE_DATA(&m_pf_data[offset]);
379   m_pf8x8_tilemap[0]->mark_tile_dirty(offset);
380   m_pf8x8_tilemap[1]->mark_tile_dirty(offset);
381   m_pf8x8_tilemap[2]->mark_tile_dirty(offset);
382   m_pf16x16_tilemap[0]->mark_tile_dirty(offset);
383   m_pf16x16_tilemap[1]->mark_tile_dirty(offset);
384   m_pf16x16_tilemap[2]->mark_tile_dirty(offset);
381385}
382386
383READ16_DEVICE_HANDLER( deco_bac06_pf_data_r )
387READ16_MEMBER( deco_bac06_device::pf_data_r )
384388{
385   deco_bac06_device *dev = (deco_bac06_device*)device;
386   if (dev->m_rambank&1) offset+=0x1000;
389   if (m_rambank&1) offset+=0x1000;
387390
388   return dev->pf_data[offset];
391   return m_pf_data[offset];
389392}
390393
391
392
393WRITE8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_w )
394WRITE8_MEMBER( deco_bac06_device::pf_data_8bit_w )
394395{
395396   if (offset&1)
396      deco_bac06_pf_data_w(device,space,offset/2,data,0x00ff);
397      pf_data_w(space,offset/2,data,0x00ff);
397398   else
398      deco_bac06_pf_data_w(device,space,offset/2,data<<8,0xff00);
399      pf_data_w(space,offset/2,data<<8,0xff00);
399400}
400401
401READ8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_r )
402READ8_MEMBER( deco_bac06_device::pf_data_8bit_r )
402403{
403404   if (offset&1) /* MSB */
404      return deco_bac06_pf_data_r(device,space,offset/2,0x00ff);
405      return pf_data_r(space,offset/2,0x00ff);
405406   else
406      return deco_bac06_pf_data_r(device,space,offset/2,0xff00)>>8;
407      return pf_data_r(space,offset/2,0xff00)>>8;
407408}
408409
409WRITE16_DEVICE_HANDLER( deco_bac06_pf_rowscroll_w )
410WRITE16_MEMBER( deco_bac06_device::pf_rowscroll_w )
410411{
411   deco_bac06_device *dev = (deco_bac06_device*)device;
412   COMBINE_DATA(&dev->pf_rowscroll[offset]);
412   COMBINE_DATA(&m_pf_rowscroll[offset]);
413413}
414414
415WRITE16_DEVICE_HANDLER( deco_bac06_pf_colscroll_w )
415WRITE16_MEMBER( deco_bac06_device::pf_colscroll_w )
416416{
417   deco_bac06_device *dev = (deco_bac06_device*)device;
418   COMBINE_DATA(&dev->pf_colscroll[offset]);
417   COMBINE_DATA(&m_pf_colscroll[offset]);
419418}
420419
421READ16_DEVICE_HANDLER( deco_bac06_pf_rowscroll_r )
420READ16_MEMBER( deco_bac06_device::pf_rowscroll_r )
422421{
423   deco_bac06_device *dev = (deco_bac06_device*)device;
424   return dev->pf_rowscroll[offset];
422   return m_pf_rowscroll[offset];
425423}
426424
427READ16_DEVICE_HANDLER( deco_bac06_pf_colscroll_r )
425READ16_MEMBER( deco_bac06_device::pf_colscroll_r )
428426{
429   deco_bac06_device *dev = (deco_bac06_device*)device;
430   return dev->pf_colscroll[offset];
427   return m_pf_colscroll[offset];
431428}
432429
433430/* used by dec8.c */
434WRITE8_DEVICE_HANDLER( deco_bac06_pf_control0_8bit_w )
431WRITE8_MEMBER( deco_bac06_device::pf_control0_8bit_w )
435432{
436433   if (offset&1)
437      deco_bac06_pf_control_0_w(device,space,offset/2,data,0x00ff); // oscar (mirrors?)
434      pf_control_0_w(space,offset/2,data,0x00ff); // oscar (mirrors?)
438435   else
439      deco_bac06_pf_control_0_w(device,space,offset/2,data,0x00ff);
436      pf_control_0_w(space,offset/2,data,0x00ff);
440437}
441438
442439/* used by dec8.c */
443READ8_DEVICE_HANDLER( deco_bac06_pf_control1_8bit_r )
440READ8_MEMBER( deco_bac06_device::pf_control1_8bit_r )
444441{
445442   if (offset&1)
446      return deco_bac06_pf_control_1_r(device,space,offset/2,0x00ff);
443      return pf_control_1_r(space,offset/2,0x00ff);
447444   else
448      return deco_bac06_pf_control_1_r(device,space,offset/2,0xff00)>>8;
445      return pf_control_1_r(space,offset/2,0xff00)>>8;
449446}
450447
451448/* used by dec8.c */
452WRITE8_DEVICE_HANDLER( deco_bac06_pf_control1_8bit_w )
449WRITE8_MEMBER( deco_bac06_device::pf_control1_8bit_w )
453450{
454451   if (offset<4) // these registers are 16-bit?
455452   {
456453      if (offset&1)
457         deco_bac06_pf_control_1_w(device,space,offset/2,data,0x00ff);
454         pf_control_1_w(space,offset/2,data,0x00ff);
458455      else
459         deco_bac06_pf_control_1_w(device,space,offset/2,data<<8,0xff00);
456         pf_control_1_w(space,offset/2,data<<8,0xff00);
460457   }
461458   else // these registers are 8-bit and mirror? (triothep vs actfancr)
462459   {
463460      if (offset&1)
464         deco_bac06_pf_control_1_w(device,space,offset/2,data,0x00ff);
461         pf_control_1_w(space,offset/2,data,0x00ff);
465462      else
466         deco_bac06_pf_control_1_w(device,space,offset/2,data,0x00ff);
463         pf_control_1_w(space,offset/2,data,0x00ff);
467464   }
468465}
469466
470READ8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_r )
467READ8_MEMBER( deco_bac06_device::pf_rowscroll_8bit_r )
471468{
472469   if (offset&1)
473      return deco_bac06_pf_rowscroll_r(device,space,offset/2,0x00ff);
470      return pf_rowscroll_r(space,offset/2,0x00ff);
474471   else
475      return deco_bac06_pf_rowscroll_r(device,space,offset/2,0xff00)>>8;
472      return pf_rowscroll_r(space,offset/2,0xff00)>>8;
476473}
477474
478475
479WRITE8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_w )
476WRITE8_MEMBER( deco_bac06_device::pf_rowscroll_8bit_w )
480477{
481478   if (offset&1)
482      deco_bac06_pf_rowscroll_w(device,space,offset/2,data,0x00ff);
479      pf_rowscroll_w(space,offset/2,data,0x00ff);
483480   else
484      deco_bac06_pf_rowscroll_w(device,space,offset/2,data<<8,0xff00);
481      pf_rowscroll_w(space,offset/2,data<<8,0xff00);
485482}
486483
487READ8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_swap_r )
484READ8_MEMBER( deco_bac06_device::pf_rowscroll_8bit_swap_r )
488485{
489486   if (offset&1)
490      return deco_bac06_pf_rowscroll_r(device,space,offset/2,0xff00)>>8;
487      return pf_rowscroll_r(space,offset/2,0xff00)>>8;
491488   else
492      return deco_bac06_pf_rowscroll_r(device,space,offset/2,0x00ff);
489      return pf_rowscroll_r(space,offset/2,0x00ff);
493490}
494491
495WRITE8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_swap_w )
492WRITE8_MEMBER( deco_bac06_device::pf_rowscroll_8bit_swap_w )
496493{
497494   if (offset&1)
498      deco_bac06_pf_rowscroll_w(device,space,offset/2,data<<8,0xff00);
495      pf_rowscroll_w(space,offset/2,data<<8,0xff00);
499496   else
500      deco_bac06_pf_rowscroll_w(device,space,offset/2,data,0x00ff);
497      pf_rowscroll_w(space,offset/2,data,0x00ff);
501498}
502499
503500
504501
505502/* used by hippodrm */
506WRITE8_DEVICE_HANDLER( deco_bac06_pf_control0_8bit_packed_w )
503WRITE8_MEMBER( deco_bac06_device::pf_control0_8bit_packed_w )
507504{
508505   if (offset&1)
509      deco_bac06_pf_control_0_w(device,space,offset/2,data<<8,0xff00);
506      pf_control_0_w(space,offset/2,data<<8,0xff00);
510507   else
511      deco_bac06_pf_control_0_w(device,space,offset/2,data,0x00ff);
508      pf_control_0_w(space,offset/2,data,0x00ff);
512509}
513510
514511/* used by hippodrm */
515WRITE8_DEVICE_HANDLER( deco_bac06_pf_control1_8bit_swap_w )
512WRITE8_MEMBER( deco_bac06_device::pf_control1_8bit_swap_w )
516513{
517   deco_bac06_pf_control1_8bit_w(device,space, offset^1, data);
514   pf_control1_8bit_w(space, offset^1, data);
518515}
519516
520517/* used by hippodrm */
521READ8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_swap_r )
518READ8_MEMBER( deco_bac06_device::pf_data_8bit_swap_r )
522519{
523   return deco_bac06_pf_data_8bit_r(device,space, offset^1);
520   return pf_data_8bit_r(space, offset^1);
524521}
525522
526523/* used by hippodrm */
527WRITE8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_swap_w )
524WRITE8_MEMBER( deco_bac06_device::pf_data_8bit_swap_w )
528525{
529   deco_bac06_pf_data_8bit_w(device,space, offset^1, data);
526   pf_data_8bit_w(space, offset^1, data);
530527}
trunk/src/mame/video/decbac06.h
r24008r24009
88
99   static void set_gfx_region_wide(device_t &device, int region8x8, int region16x16, int wide);
1010
11   void set_gfxregion(int region8x8, int region16x16) { m_gfxregion8x8 = region8x8; m_gfxregion16x16 = region16x16; };
11   UINT16* m_pf_data;
12   UINT16* m_pf_rowscroll, *m_pf_colscroll;
1213
13
14   UINT16* pf_data;
15   UINT16* pf_rowscroll, *pf_colscroll;
16
17   tilemap_t* pf8x8_tilemap[3];
18   tilemap_t* pf16x16_tilemap[3];
19   int    tile_region;
14   tilemap_t* m_pf8x8_tilemap[3];
15   tilemap_t* m_pf16x16_tilemap[3];
16   int    m_tile_region;
2017   void create_tilemaps(int region8x8,int region16x16);
21   UINT16 pf_control_0[8];
22   UINT16 pf_control_1[8];
18   UINT16 m_pf_control_0[8];
19   UINT16 m_pf_control_1[8];
2320
24   void deco_bac06_pf_draw(running_machine &machine,bitmap_ind16 &bitmap,const rectangle &cliprect,int flags,UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition);
25   void deco_bac06_pf_draw_bootleg(running_machine &machine,bitmap_ind16 &bitmap,const rectangle &cliprect,int flags, int mode, int type);
21   void deco_bac06_pf_draw(bitmap_ind16 &bitmap,const rectangle &cliprect,int flags,UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition);
22   void deco_bac06_pf_draw_bootleg(bitmap_ind16 &bitmap,const rectangle &cliprect,int flags, int mode, int type);
2623
2724
2825   /* I wonder if pf_control_0 is really registers, or a selection of pins.
r24008r24009
3734     For now we have this get_flip_state function so that drivers can query the bit and set other
3835     flip flags accordingly
3936   */
40   UINT8 get_flip_state(void) { return pf_control_0[0]&0x80; };
37   UINT8 get_flip_state(void) { return m_pf_control_0[0]&0x80; };
4138
4239
4340   void set_colmask(int data) { m_gfxcolmask = data; }
4441   void set_bppmultmask( int mult, int mask ) { m_bppmult = mult; m_bppmask = mask; } // stadium hero has 3bpp tiles
4542   UINT8 m_gfxcolmask;
4643   int m_rambank; // external connection?
44   
45   /* 16-bit accessors */
4746
47   DECLARE_WRITE16_MEMBER( pf_control_0_w );
48   DECLARE_READ16_MEMBER( pf_control_1_r );
49   DECLARE_WRITE16_MEMBER( pf_control_1_w );
50
51   DECLARE_WRITE16_MEMBER( pf_data_w );
52   DECLARE_READ16_MEMBER( pf_data_r );
53   DECLARE_WRITE16_MEMBER( pf_rowscroll_w );
54   DECLARE_READ16_MEMBER( pf_rowscroll_r );
55   DECLARE_WRITE16_MEMBER( pf_colscroll_w );
56   DECLARE_READ16_MEMBER( pf_colscroll_r );
57
58   /* 8-bit accessors */
59
60   /* for dec8.c, pcktgal.c */
61   DECLARE_READ8_MEMBER( pf_data_8bit_r );
62   DECLARE_WRITE8_MEMBER( pf_data_8bit_w );
63   
64   DECLARE_WRITE8_MEMBER( pf_control0_8bit_w );
65   DECLARE_READ8_MEMBER( pf_control1_8bit_r );
66   DECLARE_WRITE8_MEMBER( pf_control1_8bit_w );
67
68   DECLARE_READ8_MEMBER( pf_rowscroll_8bit_r );
69   DECLARE_WRITE8_MEMBER( pf_rowscroll_8bit_w );
70
71   /* for hippodrm (dec0.c) and actfancr / triothep (H6280 based games)*/
72   DECLARE_WRITE8_MEMBER( pf_control0_8bit_packed_w );
73   DECLARE_WRITE8_MEMBER( pf_control1_8bit_swap_w );
74   DECLARE_READ8_MEMBER( pf_data_8bit_swap_r );
75   DECLARE_WRITE8_MEMBER( pf_data_8bit_swap_w );
76   DECLARE_READ8_MEMBER( pf_rowscroll_8bit_swap_r );
77   DECLARE_WRITE8_MEMBER( pf_rowscroll_8bit_swap_w );
78
4879protected:
4980   virtual void device_start();
5081   virtual void device_reset();
r24008r24009
5687   UINT8 m_bppmult;
5788   UINT8 m_bppmask;
5889
59   void custom_tilemap_draw(running_machine &machine,
60                     bitmap_ind16 &bitmap,
90   void custom_tilemap_draw(bitmap_ind16 &bitmap,
6191                     const rectangle &cliprect,
6292                     tilemap_t *tilemap_ptr,
6393                     const UINT16 *rowscroll_ptr,
r24008r24009
78108   TILE_GET_INFO_MEMBER(get_pf16x16_tile_info);
79109};
80110
81/* 16-bit accessors */
82
83DECLARE_WRITE16_DEVICE_HANDLER( deco_bac06_pf_control_0_w );
84DECLARE_READ16_DEVICE_HANDLER( deco_bac06_pf_control_1_r );
85DECLARE_WRITE16_DEVICE_HANDLER( deco_bac06_pf_control_1_w );
86
87DECLARE_WRITE16_DEVICE_HANDLER( deco_bac06_pf_data_w );
88DECLARE_READ16_DEVICE_HANDLER( deco_bac06_pf_data_r );
89DECLARE_WRITE16_DEVICE_HANDLER( deco_bac06_pf_rowscroll_w );
90DECLARE_READ16_DEVICE_HANDLER( deco_bac06_pf_rowscroll_r );
91DECLARE_WRITE16_DEVICE_HANDLER( deco_bac06_pf_colscroll_w );
92DECLARE_READ16_DEVICE_HANDLER( deco_bac06_pf_colscroll_r );
93
94/* 8-bit accessors */
95
96/* for dec8.c, pcktgal.c */
97DECLARE_READ8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_r );
98DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_w );
99
100DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_control0_8bit_w );
101DECLARE_READ8_DEVICE_HANDLER( deco_bac06_pf_control1_8bit_r );
102DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_control1_8bit_w );
103
104DECLARE_READ8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_r );
105DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_w );
106
107/* for hippodrm (dec0.c) and actfancr / triothep (H6280 based games)*/
108DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_control0_8bit_packed_w );
109DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_control1_8bit_swap_w );
110DECLARE_READ8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_swap_r );
111DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_swap_w );
112DECLARE_READ8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_swap_r );
113DECLARE_WRITE8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_swap_w );
114
115111extern const device_type DECO_BAC06;
trunk/src/mame/video/dec8.c
r24008r24009
4343
4444#include "emu.h"
4545#include "includes/dec8.h"
46#include "video/decbac06.h"
4746#include "video/decmxc06.h"
4847#include "video/deckarn.h"
4948
r24008r24009
263262{
264263   flip_screen_set(m_bg_control[0] >> 7);
265264
266   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
265   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
267266   machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x04, 0x00, 0x03);
268   machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
267   m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
269268   machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x04, 0x04, 0x03);
270269   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
271270   return 0;
r24008r24009
294293   m_fix_tilemap->set_transparent_pen(0);
295294
296295   m_game_uses_priority = 0;
297   machine().device<deco_bac06_device>("tilegen1")->set_colmask(0x3);
298   machine().device<deco_bac06_device>("tilegen2")->set_colmask(0x3);
296   m_tilegen1->set_colmask(0x3);
297   m_tilegen2->set_colmask(0x3);
299298}
300299
301300/******************************************************************************/
302301
303302UINT32 dec8_state::screen_update_ghostb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
304303{
305   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
304   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
306305   machine().device<deco_karnovsprites_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 0);
307306   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
308307   return 0;
r24008r24009
327326   m_fix_tilemap->set_transparent_pen(0);
328327
329328   m_game_uses_priority = 0;
330   machine().device<deco_bac06_device>("tilegen1")->set_colmask(0xf);
329   m_tilegen1->set_colmask(0xf);
331330}
332331
333332/******************************************************************************/
r24008r24009
337336   flip_screen_set(m_bg_control[1] >> 7);
338337
339338   // we mimic the priority scheme in dec0.c, this was originally a bit different, so this could be wrong
340   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
339   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
341340   machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x00, 0x00, 0x0f);
342   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x08,0x08,0x08,0x08);
341   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x08,0x08,0x08,0x08);
343342   m_fix_tilemap->draw(bitmap, cliprect, 0, 0);
344343   return 0;
345344}
r24008r24009
364363   m_fix_tilemap->set_transparent_pen(0);
365364
366365   m_game_uses_priority = 1;
367   machine().device<deco_bac06_device>("tilegen1")->set_colmask(0x7);
366   m_tilegen1->set_colmask(0x7);
368367}
369368
370369/******************************************************************************/
trunk/src/mame/video/undrfire.c
r24008r24009
11#include "emu.h"
2#include "video/taitoic.h"
32#include "includes/undrfire.h"
43
54
r24008r24009
346345
347346UINT32 undrfire_state::screen_update_undrfire(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
348347{
349   device_t *tc0480scp = machine().device("tc0480scp");
350348   address_space &space = machine().driver_data()->generic_space();
351349   UINT8 layer[5];
352350   UINT8 pivlayer[3];
r24008r24009
390388#endif
391389
392390   m_tc0100scn->tilemap_update();
393   tc0480scp_tilemap_update(tc0480scp);
391   m_tc0480scp->tilemap_update();
394392
395   priority = tc0480scp_get_bg_priority(tc0480scp);
393   priority = m_tc0480scp->get_bg_priority();
396394
397395   layer[0] = (priority & 0xf000) >> 12;   /* tells us which bg layer is bottom */
398396   layer[1] = (priority & 0x0f00) >>  8;
r24008r24009
420418#ifdef MAME_DEBUG
421419   if (m_dislayer[layer[0]]==0)
422420#endif
423   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], 0, 1);
421   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[0], 0, 1);
424422
425423#ifdef MAME_DEBUG
426424   if (m_dislayer[layer[1]]==0)
427425#endif
428   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 2);
426   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[1], 0, 2);
429427
430428#ifdef MAME_DEBUG
431429   if (m_dislayer[layer[2]]==0)
432430#endif
433   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 4);
431   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[2], 0, 4);
434432
435433#ifdef MAME_DEBUG
436434   if (m_dislayer[layer[3]]==0)
437435#endif
438   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 8);
436   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[3], 0, 8);
439437
440438#ifdef MAME_DEBUG
441439   if (m_dislayer[4]==0)
442440#endif
443441   /* Sprites have variable priority (we kludge this on road levels) */
444442   {
445      if ((tc0480scp_pri_reg_r(tc0480scp, space, 0) & 0x3) == 3)  /* on road levels kludge sprites up 1 priority */
443      if ((m_tc0480scp->pri_reg_r(space, 0) & 0x3) == 3)  /* on road levels kludge sprites up 1 priority */
446444      {
447445         static const int primasks[4] = {0xfff0, 0xff00, 0x0, 0x0};
448446         draw_sprites(bitmap, cliprect, primasks, 44, -574);
r24008r24009
459457#endif
460458   m_tc0100scn->tilemap_draw(bitmap, cliprect, pivlayer[2], 0, 0); /* piv text layer */
461459
462   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0);    /* TC0480SCP text layer */
460   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[4], 0, 0);    /* TC0480SCP text layer */
463461
464462   /* See if we should draw artificial gun targets */
465463   /* (not yet implemented...) */
r24008r24009
488486
489487UINT32 undrfire_state::screen_update_cbombers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
490488{
491   device_t *tc0480scp = machine().device("tc0480scp");
492489   address_space &space = machine().driver_data()->generic_space();
493490   UINT8 layer[5];
494491   UINT8 pivlayer[3];
r24008r24009
532529#endif
533530
534531   m_tc0100scn->tilemap_update();
535   tc0480scp_tilemap_update(tc0480scp);
532   m_tc0480scp->tilemap_update();
536533
537   priority = tc0480scp_get_bg_priority(tc0480scp);
534   priority = m_tc0480scp->get_bg_priority();
538535
539536   layer[0] = (priority & 0xf000) >> 12;   /* tells us which bg layer is bottom */
540537   layer[1] = (priority & 0x0f00) >>  8;
r24008r24009
562559#ifdef MAME_DEBUG
563560   if (m_dislayer[layer[0]]==0)
564561#endif
565   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], 0, 1);
562   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[0], 0, 1);
566563
567564#ifdef MAME_DEBUG
568565   if (m_dislayer[layer[1]]==0)
569566#endif
570   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 2);
567   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[1], 0, 2);
571568
572569#ifdef MAME_DEBUG
573570   if (m_dislayer[layer[2]]==0)
574571#endif
575   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 4);
572   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[2], 0, 4);
576573
577574#ifdef MAME_DEBUG
578575   if (m_dislayer[layer[3]]==0)
579576#endif
580   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 8);
577   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[3], 0, 8);
581578
582579#ifdef MAME_DEBUG
583580   if (m_dislayer[4]==0)
584581#endif
585582   /* Sprites have variable priority (we kludge this on road levels) */
586583   {
587      if ((tc0480scp_pri_reg_r(tc0480scp, space, 0) & 0x3) == 3)  /* on road levels kludge sprites up 1 priority */
584      if ((m_tc0480scp->pri_reg_r(space, 0) & 0x3) == 3)  /* on road levels kludge sprites up 1 priority */
588585      {
589586         static const int primasks[4] = {0xfff0, 0xff00, 0x0, 0x0};
590587         draw_sprites_cbombers(bitmap, cliprect, primasks, 80, -208);
r24008r24009
601598#endif
602599   m_tc0100scn->tilemap_draw(bitmap, cliprect, pivlayer[2], 0, 0); /* piv text layer */
603600
604   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0);    /* TC0480SCP text layer */
601   m_tc0480scp->tilemap_draw(bitmap, cliprect, layer[4], 0, 0);    /* TC0480SCP text layer */
605602
606603/* Enable this to see rotation (?) control words */
607604#if 0
trunk/src/mame/video/stadhero.c
r24008r24009
1212
1313#include "emu.h"
1414#include "includes/stadhero.h"
15#include "video/decbac06.h"
1615#include "video/decmxc06.h"
1716
1817/******************************************************************************/
r24008r24009
2322{
2423//  machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
2524
26   machine().device<deco_bac06_device>("tilegen1")->set_bppmultmask(0x8, 0x7);
27   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
25   m_tilegen1->set_bppmultmask(0x8, 0x7);
26   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
2827   machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram, 0x00, 0x00, 0x0f);
2928   m_pf1_tilemap->draw(bitmap, cliprect, 0,0);
3029   return 0;
trunk/src/mame/video/actfancr.c
r24008r24009
66
77#include "emu.h"
88#include "includes/actfancr.h"
9#include "video/decbac06.h"
109#include "video/decmxc06.h"
1110
1211/******************************************************************************/
r24008r24009
2928   //m_flipscreen = m_control_2[0] & 0x80;
3029   //machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
3130
32   machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
31   m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
3332   machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram16, 0x00, 0x00, 0x0f);
34   machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
33   m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
3534
3635   return 0;
3736}
trunk/src/mame/video/taito_b.c
r24008r24009
259259   rectangle myclip = cliprect;
260260   int x, y;
261261   address_space &space = machine().driver_data()->generic_space();
262   UINT8 video_control = tc0180vcu_get_videoctrl(m_tc0180vcu, space, 0);
263   UINT8 framebuffer_page = tc0180vcu_get_fb_page(m_tc0180vcu, space, 0);
262   UINT8 video_control = m_tc0180vcu->get_videoctrl(space, 0);
263   UINT8 framebuffer_page = m_tc0180vcu->get_fb_page(space, 0);
264264
265265g_profiler.start(PROFILER_USER1);
266266
r24008r24009
362362UINT32 taitob_state::screen_update_taitob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
363363{
364364   address_space &space = machine().driver_data()->generic_space();
365   UINT8 video_control = tc0180vcu_get_videoctrl(m_tc0180vcu, space, 0);
365   UINT8 video_control = m_tc0180vcu->get_videoctrl(space, 0);
366366
367367   if ((video_control & 0x20) == 0)
368368   {
r24008r24009
371371   }
372372
373373   /* Draw playfields */
374   tc0180vcu_tilemap_draw(m_tc0180vcu, bitmap, cliprect, 0, 1);
374   m_tc0180vcu->tilemap_draw(bitmap, cliprect, 0, 1);
375375
376376   draw_framebuffer(bitmap, cliprect, 1);
377377
378   tc0180vcu_tilemap_draw(m_tc0180vcu, bitmap, cliprect, 1, 0);
378   m_tc0180vcu->tilemap_draw(bitmap, cliprect, 1, 0);
379379
380380   if (m_pixel_bitmap)  /* hitice only */
381381   {
r24008r24009
388388
389389   draw_framebuffer(bitmap, cliprect, 0);
390390
391   tc0180vcu_tilemap_draw(m_tc0180vcu, bitmap, cliprect, 2, 0);
391   m_tc0180vcu->tilemap_draw(bitmap, cliprect, 2, 0);
392392
393393   return 0;
394394}
r24008r24009
399399{
400400   address_space &space = machine().driver_data()->generic_space();
401401   const rgb_t *palette = palette_entry_list_adjusted(machine().palette);
402   UINT8 video_control = tc0180vcu_get_videoctrl(m_tc0180vcu, space, 0);
402   UINT8 video_control = m_tc0180vcu->get_videoctrl(space, 0);
403403   int x, y;
404404
405405   /* Video blanked? */
r24008r24009
410410   }
411411
412412   /* Draw the palettized playfields to an indexed bitmap */
413   tc0180vcu_tilemap_draw(m_tc0180vcu, *m_realpunc_bitmap, cliprect, 0, 1);
413   m_tc0180vcu->tilemap_draw(*m_realpunc_bitmap, cliprect, 0, 1);
414414
415415   draw_framebuffer(*m_realpunc_bitmap, cliprect, 1);
416416
417   tc0180vcu_tilemap_draw(m_tc0180vcu, *m_realpunc_bitmap, cliprect, 1, 0);
417   m_tc0180vcu->tilemap_draw(*m_realpunc_bitmap, cliprect, 1, 0);
418418
419419   if (m_realpunc_video_ctrl & 0x0001)
420420      draw_framebuffer(*m_realpunc_bitmap, cliprect, 0);
r24008r24009
470470   if (!(m_realpunc_video_ctrl & 0x0001))
471471      draw_framebuffer(*m_realpunc_bitmap, cliprect, 0);
472472
473   tc0180vcu_tilemap_draw(m_tc0180vcu, *m_realpunc_bitmap, cliprect, 2, 0);
473   m_tc0180vcu->tilemap_draw(*m_realpunc_bitmap, cliprect, 2, 0);
474474
475475   /* Merge the indexed layers with the output bitmap */
476476   for (y = 0; y <= cliprect.max_y; y++)
r24008r24009
493493   if (state)
494494   {
495495      address_space &space = machine().driver_data()->generic_space();
496      UINT8 video_control = tc0180vcu_get_videoctrl(m_tc0180vcu, space, 0);
497      UINT8 framebuffer_page = tc0180vcu_get_fb_page(m_tc0180vcu, space, 0);
496      UINT8 video_control = m_tc0180vcu->get_videoctrl(space, 0);
497      UINT8 framebuffer_page = m_tc0180vcu->get_fb_page(space, 0);
498498
499499      if (~video_control & 0x01)
500500         m_framebuffer[framebuffer_page]->fill(0, machine().primary_screen->visible_area());
r24008r24009
502502      if (~video_control & 0x80)
503503      {
504504         framebuffer_page ^= 1;
505         tc0180vcu_set_fb_page(m_tc0180vcu, space, 0, framebuffer_page);
505         m_tc0180vcu->set_fb_page(space, 0, framebuffer_page);
506506      }
507507
508508      draw_sprites(*m_framebuffer[framebuffer_page], machine().primary_screen->visible_area());
trunk/src/mame/video/taitoic.c
r24008r24009
549549const device_type PC080SN = &device_creator<pc080sn_device>;
550550
551551pc080sn_device::pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
552   : device_t(mconfig, PC080SN, "Taito PC080SN", tag, owner, clock, "pc080sn", __FILE__)
552   : device_t(mconfig, PC080SN, "Taito PC080SN", tag, owner, clock, "pc080sn", __FILE__),
553   m_ram(NULL)
554   //m_bg_ram[0](NULL),
555   //m_bg_ram[1](NULL),
556   //m_bgscroll_ram[0](NULL),
557   //m_bgscroll_ram[1](NULL)
553558{
554559}
555560
r24008r24009
10051010const device_type PC090OJ = &device_creator<pc090oj_device>;
10061011
10071012pc090oj_device::pc090oj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1008   : device_t(mconfig, PC090OJ, "Taito PC090OJ", tag, owner, clock, "pc090oj", __FILE__)
1013   : device_t(mconfig, PC090OJ, "Taito PC090OJ", tag, owner, clock, "pc090oj", __FILE__),
1014   m_ctrl(0),
1015   m_sprite_ctrl(0),
1016   m_ram(NULL),
1017   m_ram_buffered(0)
10091018{
10101019}
10111020
r24008r24009
11761185const device_type TC0080VCO = &device_creator<tc0080vco_device>;
11771186
11781187tc0080vco_device::tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1179   : device_t(mconfig, TC0080VCO, "Taito TC0080VCO", tag, owner, clock, "tc0080vco", __FILE__)
1188   : device_t(mconfig, TC0080VCO, "Taito TC0080VCO", tag, owner, clock, "tc0080vco", __FILE__),
1189   m_ram(NULL),
1190   m_bg0_ram_0(NULL),
1191   m_bg0_ram_1(NULL),
1192   m_bg1_ram_0(NULL),
1193   m_bg1_ram_1(NULL),
1194   m_tx_ram_0(NULL),
1195   m_tx_ram_1(NULL),
1196   m_char_ram(NULL),
1197   m_bgscroll_ram(NULL),
1198    m_chain_ram_0(NULL),
1199   m_chain_ram_1(NULL),
1200   m_spriteram(NULL),
1201   m_scroll_ram(NULL),
1202    m_bg0_scrollx(0),
1203    m_bg0_scrolly(0),
1204    m_bg1_scrollx(0),
1205    m_bg1_scrolly(0),
1206    m_flipscreen(0)
11801207{
11811208}
11821209
r24008r24009
12611288   m_scroll_ram    = m_ram + 0x20800 / 2;
12621289
12631290   /* create the char set (gfx will then be updated dynamically from RAM) */
1264   machine().gfx[m_txnum] = auto_alloc(machine(), gfx_element(machine(), charlayout, (UINT8 *)m_char_ram, 64, 0));
1291   machine().gfx[m_txnum] = auto_alloc_clear(machine(), gfx_element(machine(), charlayout, (UINT8 *)m_char_ram, 64, 0));
12651292
12661293   save_pointer(NAME(m_ram), TC0080VCO_RAM_SIZE / 2);
12671294   machine().save().register_postload(save_prepost_delegate(FUNC(tc0080vco_device::postload), this));
r24008r24009
18101837const device_type TC0100SCN = &device_creator<tc0100scn_device>;
18111838
18121839tc0100scn_device::tc0100scn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1813   : device_t(mconfig, TC0100SCN, "Taito TC0100SCN", tag, owner, clock, "tc0100scn", __FILE__)
1840   : device_t(mconfig, TC0100SCN, "Taito TC0100SCN", tag, owner, clock, "tc0100scn", __FILE__),
1841   m_ram(NULL),
1842   m_bg_ram(NULL),
1843   m_fg_ram(NULL),
1844   m_tx_ram(NULL),
1845   m_char_ram(NULL),
1846   m_bgscroll_ram(NULL),
1847   m_fgscroll_ram(NULL),
1848   m_colscroll_ram(NULL),
1849   m_bgscrollx(0),   
1850   m_bgscrolly(0),
1851   m_fgscrollx(0),
1852   m_fgscrolly(0),
1853   m_bg_col_mult(0),
1854   m_bg_tilemask(0),
1855   m_tx_col_mult(0),
1856   m_gfxbank(0),
1857   m_colbank(0),
1858   m_bg0_colbank(0),
1859   m_bg1_colbank(0),
1860   m_tx_colbank(0),
1861   m_dblwidth(0),
1862   m_screen(NULL)
18141863{
1815   // device stuff
1816   for (int i=0;i<8;i++)
1817      m_ctrl[i] = 0;
1818
1819   m_ram = 0;
1820   m_bg_ram = 0;
1821   m_fg_ram = 0;
1822   m_tx_ram = 0;
1823   m_char_ram = 0;
1824   m_bgscroll_ram = 0;
1825   m_fgscroll_ram = 0;
1826   m_colscroll_ram = 0;
1827
1828   m_bgscrollx = 0;   
1829   m_bgscrolly = 0;
1830   m_fgscrollx = 0;
1831   m_fgscrolly = 0;
1832
1833   m_bg_col_mult = 0;
1834   m_bg_tilemask = 0;
1835   m_tx_col_mult = 0;
1836   m_gfxbank = 0;
1837   m_colbank = 0;
1838   m_bg0_colbank = 0;
1839   m_bg1_colbank = 0;
1840   m_tx_colbank = 0;
1841   m_dblwidth = 0;
1842
1843   //m_tilemap[3][2];
1844   //m_cliprect;
1845
1846   m_screen = 0;
1847
1848   // interface stuff
1849   m_screen_tag = 0;
1850
1851   m_gfxnum = 0;
1852   m_txnum = 0;
1853
1854   m_x_offset = 0;
1855   m_y_offset = 0;
1856   m_flip_xoffs = 0;
1857   m_flip_yoffs = 0;
1858   m_flip_text_xoffs = 0;
1859   m_flip_text_yoffs = 0;
1860
1861   m_multiscrn_xoffs = 0;
1862   m_multiscrn_hack = 0;
1863
18641864}
18651865
18661866//-------------------------------------------------
r24008r24009
19831983                           /* we call this here, so that they can be modified at VIDEO_START*/
19841984
19851985   /* create the char set (gfx will then be updated dynamically from RAM) */
1986   machine().gfx[m_txnum] = auto_alloc(machine(), gfx_element(machine(), tc0100scn_charlayout, (UINT8 *)m_char_ram, 64, 0));
1986   machine().gfx[m_txnum] = auto_alloc_clear(machine(), gfx_element(machine(), tc0100scn_charlayout, (UINT8 *)m_char_ram, 64, 0));
19871987
19881988   save_pointer(NAME(m_ram), TC0100SCN_RAM_SIZE / 2);
19891989   save_item(NAME(m_ctrl));
r24008r24009
24332433const device_type TC0280GRD = &device_creator<tc0280grd_device>;
24342434
24352435tc0280grd_device::tc0280grd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2436   : device_t(mconfig, TC0280GRD, "Taito TC0280GRD & TC0430GRW", tag, owner, clock, "tc0280grd", __FILE__)
2436   : device_t(mconfig, TC0280GRD, "Taito TC0280GRD & TC0430GRW", tag, owner, clock, "tc0280grd", __FILE__),
2437   m_ram(NULL),
2438    //m_ctrl[8](0),
2439   m_base_color(0)
24372440{
24382441}
24392442
r24008r24009
24652468   m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0280grd_device::tc0280grd_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
24662469   m_tilemap->set_transparent_pen(0);
24672470
2468   m_ram = auto_alloc_array(machine(), UINT16, TC0280GRD_RAM_SIZE / 2);
2471   m_ram = auto_alloc_array_clear(machine(), UINT16, TC0280GRD_RAM_SIZE / 2);
24692472
24702473   save_pointer(NAME(m_ram), TC0280GRD_RAM_SIZE / 2);
24712474   save_item(NAME(m_ctrl));
r24008r24009
25992602
26002603tc0360pri_device::tc0360pri_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
26012604   : device_t(mconfig, TC0360PRI, "Taito TC0360PRI", tag, owner, clock, "tc0360pri", __FILE__)
2605   // m_regs[16](0),
26022606{
26032607}
26042608
r24008r24009
26662670/*                                                                         */
26672671/***************************************************************************/
26682672
2669struct tc0480scp_state
2670{
2671   UINT16           ctrl[0x18];
2673#define TC0480SCP_RAM_SIZE 0x10000
2674#define TC0480SCP_TOTAL_CHARS 256
26722675
2673   UINT16 *         ram;
2674   UINT16 *         bg_ram[4];
2675   UINT16 *         tx_ram;
2676   UINT16 *         char_ram;
2677   UINT16 *         bgscroll_ram[4];
2678   UINT16 *         rowzoom_ram[4];
2679   UINT16 *         bgcolumn_ram[4];
2680   int              bgscrollx[4];
2681   int              bgscrolly[4];
2682   int              pri_reg;
26832676
2684   /* We keep two tilemaps for each of the 5 actual tilemaps: one at standard width, one double */
2685   tilemap_t         *tilemap[5][2];
2686   int             bg_gfx, tx_gfx;
2687   INT32           tile_colbase, dblwidth;
2688   int             x_offs, y_offs;
2689   int             text_xoffs, text_yoffs;
2690   int             flip_xoffs, flip_yoffs;
2691};
26922677
2693#define TC0480SCP_RAM_SIZE 0x10000
2694#define TC0480SCP_TOTAL_CHARS 256
2678const device_type TC0480SCP = &device_creator<tc0480scp_device>;
26952679
2696/*****************************************************************************
2697    INLINE FUNCTIONS
2698*****************************************************************************/
2680tc0480scp_device::tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2681   : device_t(mconfig, TC0480SCP, "Taito TC0480SCP", tag, owner, clock, "tc0480scp", __FILE__),
2682   // m_ctrl[0x18](0),
2683   m_ram(NULL),
2684   //m_bg_ram[4](NULL),
2685   m_tx_ram(NULL),
2686   m_char_ram(NULL),
2687   //m_bgscroll_ram[4](NULL),
2688   //m_rowzoom_ram[4](NULL),
2689   //m_bgcolumn_ram[4](NULL),
2690   //m_bgscrollx[4](NULL),
2691   //m_bgscrolly[4](NULL),
2692   m_pri_reg(0),
2693   m_dblwidth(0),
2694   m_x_offs(0)
2695{
2696}
26992697
2700INLINE tc0480scp_state *tc0480scp_get_safe_token( device_t *device )
2698//-------------------------------------------------
2699//  device_config_complete - perform any
2700//  operations now that the configuration is
2701//  complete
2702//-------------------------------------------------
2703
2704void tc0480scp_device::device_config_complete()
27012705{
2702   assert(device != NULL);
2703   assert(device->type() == TC0480SCP);
2706   // inherit a copy of the static data
2707   const tc0480scp_interface *intf = reinterpret_cast<const tc0480scp_interface *>(static_config());
2708   if (intf != NULL)
2709   *static_cast<tc0480scp_interface *>(this) = *intf;
2710   
2711   // or initialize to defaults if none provided
2712   else
2713   {
2714   }
2715}
27042716
2705   return (tc0480scp_state *)downcast<tc0480scp_device *>(device)->token();
2717//-------------------------------------------------
2718//  device_start - device-specific startup
2719//-------------------------------------------------
2720
2721void tc0480scp_device::device_start()
2722{
2723   int i, xd, yd;
2724
2725   m_x_offs = m_x_offset + m_pixels;
2726   
2727   
2728   static const gfx_layout tc0480scp_charlayout =
2729   {
2730      8,8,    /* 8*8 characters */
2731      256,    /* 256 characters */
2732      4,  /* 4 bits per pixel */
2733      { 0, 1, 2, 3 },
2734      { XOR(3)*4, XOR(2)*4, XOR(1)*4, XOR(0)*4, XOR(7)*4, XOR(6)*4, XOR(5)*4, XOR(4)*4 },
2735      { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
2736      32*8    /* every sprite takes 32 consecutive bytes */
2737   };
2738   
2739   
2740   /* Single width versions */
2741   m_tilemap[0][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg0_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
2742   m_tilemap[1][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
2743   m_tilemap[2][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
2744   m_tilemap[3][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg3_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
2745   m_tilemap[4][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
2746
2747   /* Double width versions */
2748   m_tilemap[0][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg0_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
2749   m_tilemap[1][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
2750   m_tilemap[2][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
2751   m_tilemap[3][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::get_bg3_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32);
2752   m_tilemap[4][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0480scp_device::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
2753
2754   for (i = 0; i < 2; i++)
2755   {
2756      m_tilemap[0][i]->set_transparent_pen(0);
2757      m_tilemap[1][i]->set_transparent_pen(0);
2758      m_tilemap[2][i]->set_transparent_pen(0);
2759      m_tilemap[3][i]->set_transparent_pen(0);
2760      m_tilemap[4][i]->set_transparent_pen(0);
2761   }
2762
2763   xd = -m_x_offs;
2764   yd =  m_y_offset;
2765
2766   /* Metalb and Deadconx have minor screenflip issues: blue planet
2767      is off on x axis by 1 and in Deadconx the dark blue screen
2768      between stages also seems off by 1 pixel. */
2769
2770   /* It's not possible to get the text scrolldx calculations
2771      harmonised with the other layers: xd-2, 315-xd is the
2772      next valid pair:- the numbers diverge from xd, 319-xd */
2773
2774   /* Single width offsets */
2775   m_tilemap[0][0]->set_scrolldx(xd,     320 - xd + m_flip_xoffs);
2776   m_tilemap[0][0]->set_scrolldy(yd,     256 - yd + m_flip_yoffs);
2777   m_tilemap[1][0]->set_scrolldx(xd,     320 - xd + m_flip_xoffs);
2778   m_tilemap[1][0]->set_scrolldy(yd,     256 - yd + m_flip_yoffs);
2779   m_tilemap[2][0]->set_scrolldx(xd,     320 - xd + m_flip_xoffs);
2780   m_tilemap[2][0]->set_scrolldy(yd,     256 - yd + m_flip_yoffs);
2781   m_tilemap[3][0]->set_scrolldx(xd,     320 - xd + m_flip_xoffs);
2782   m_tilemap[3][0]->set_scrolldy(yd,     256 - yd + m_flip_yoffs);
2783   m_tilemap[4][0]->set_scrolldx(xd - 3, 316 - xd);   /* text layer */
2784   m_tilemap[4][0]->set_scrolldy(yd,     256 - yd);   /* text layer */
2785
2786   /* Double width offsets */
2787   m_tilemap[0][1]->set_scrolldx(xd,     320 - xd + m_flip_xoffs);
2788   m_tilemap[0][1]->set_scrolldy(yd,     256 - yd + m_flip_yoffs);
2789   m_tilemap[1][1]->set_scrolldx(xd,     320 - xd + m_flip_xoffs);
2790   m_tilemap[1][1]->set_scrolldy(yd,     256 - yd + m_flip_yoffs);
2791   m_tilemap[2][1]->set_scrolldx(xd,     320 - xd + m_flip_xoffs);
2792   m_tilemap[2][1]->set_scrolldy(yd,     256 - yd + m_flip_yoffs);
2793   m_tilemap[3][1]->set_scrolldx(xd,     320 - xd + m_flip_xoffs);
2794   m_tilemap[3][1]->set_scrolldy(yd,     256 - yd + m_flip_yoffs);
2795   m_tilemap[4][1]->set_scrolldx(xd - 3, 317 - xd);   /* text layer */
2796   m_tilemap[4][1]->set_scrolldy(yd,     256 - yd);   /* text layer */
2797
2798   for (i = 0; i < 2; i++)
2799   {
2800      /* Both sets of bg tilemaps scrollable per pixel row */
2801      m_tilemap[0][i]->set_scroll_rows(512);
2802      m_tilemap[1][i]->set_scroll_rows(512);
2803      m_tilemap[2][i]->set_scroll_rows(512);
2804      m_tilemap[3][i]->set_scroll_rows(512);
2805   }
2806
2807   m_ram = auto_alloc_array_clear(machine(), UINT16, TC0480SCP_RAM_SIZE / 2);
2808
2809   set_layer_ptrs();
2810
2811   /* create the char set (gfx will then be updated dynamically from RAM) */
2812   machine().gfx[m_txnum] = auto_alloc_clear(machine(), gfx_element(machine(), tc0480scp_charlayout, (UINT8 *)m_char_ram, 64, 0));
2813
2814   save_pointer(NAME(m_ram), TC0480SCP_RAM_SIZE / 2);
2815   save_item(NAME(m_ctrl));
2816   save_item(NAME(m_dblwidth));
2817   machine().save().register_postload(save_prepost_delegate(FUNC(tc0480scp_device::postload), this));
27062818}
27072819
2708INLINE const tc0480scp_interface *tc0480scp_get_interface( device_t *device )
2820//-------------------------------------------------
2821//  device_reset - device-specific reset
2822//-------------------------------------------------
2823
2824void tc0480scp_device::device_reset()
27092825{
2710   assert(device != NULL);
2711   assert((device->type() == TC0480SCP));
2712   return (const tc0480scp_interface *) device->static_config();
2826   int i;
2827
2828   m_dblwidth = 0;
2829
2830   for (i = 0; i < 0x18; i++)
2831      m_ctrl[i] = 0;
2832
27132833}
27142834
27152835/*****************************************************************************
r24008r24009
27172837*****************************************************************************/
27182838
27192839
2720INLINE void common_get_tc0480bg_tile_info( running_machine &machine, device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum )
2840void tc0480scp_device::common_get_tc0480bg_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum )
27212841{
2722   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
27232842   int code = ram[2 * tile_index + 1] & 0x7fff;
27242843   int attr = ram[2 * tile_index];
2725   SET_TILE_INFO(
2844   SET_TILE_INFO_MEMBER(
27262845         gfxnum,
27272846         code,
2728         (attr & 0xff) + tc0480scp->tile_colbase,
2847         (attr & 0xff) + m_col_base,
27292848         TILE_FLIPYX((attr & 0xc000) >> 14));
27302849}
27312850
2732INLINE void common_get_tc0480tx_tile_info( running_machine &machine, device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum )
2851void tc0480scp_device::common_get_tc0480tx_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum )
27332852{
2734   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
27352853   int attr = ram[tile_index];
2736   SET_TILE_INFO(
2854   SET_TILE_INFO_MEMBER(
27372855         gfxnum,
27382856         attr & 0xff,
2739         ((attr & 0x3f00) >> 8) + tc0480scp->tile_colbase,
2857         ((attr & 0x3f00) >> 8) + m_col_base,
27402858         TILE_FLIPYX((attr & 0xc000) >> 14));
27412859}
27422860
2743TILE_GET_INFO_MEMBER(tc0480scp_device::tc0480scp_get_bg0_tile_info)
2861TILE_GET_INFO_MEMBER(tc0480scp_device::get_bg0_tile_info)
27442862{
2745   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
2746   common_get_tc0480bg_tile_info(machine(), this, tileinfo, tile_index, tc0480scp->bg_ram[0], tc0480scp->bg_gfx );
2863   common_get_tc0480bg_tile_info(tileinfo, tile_index, m_bg_ram[0], m_gfxnum );
27472864}
27482865
2749TILE_GET_INFO_MEMBER(tc0480scp_device::tc0480scp_get_bg1_tile_info)
2866TILE_GET_INFO_MEMBER(tc0480scp_device::get_bg1_tile_info)
27502867{
2751   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
2752   common_get_tc0480bg_tile_info(machine(), this, tileinfo, tile_index, tc0480scp->bg_ram[1], tc0480scp->bg_gfx);
2868   common_get_tc0480bg_tile_info(tileinfo, tile_index, m_bg_ram[1], m_gfxnum);
27532869}
27542870
2755TILE_GET_INFO_MEMBER(tc0480scp_device::tc0480scp_get_bg2_tile_info)
2871TILE_GET_INFO_MEMBER(tc0480scp_device::get_bg2_tile_info)
27562872{
2757   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
2758   common_get_tc0480bg_tile_info(machine(), this, tileinfo, tile_index, tc0480scp->bg_ram[2], tc0480scp->bg_gfx);
2873   common_get_tc0480bg_tile_info(tileinfo, tile_index, m_bg_ram[2], m_gfxnum);
27592874}
27602875
2761TILE_GET_INFO_MEMBER(tc0480scp_device::tc0480scp_get_bg3_tile_info)
2876TILE_GET_INFO_MEMBER(tc0480scp_device::get_bg3_tile_info)
27622877{
2763   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
2764   common_get_tc0480bg_tile_info(machine(), this, tileinfo, tile_index, tc0480scp->bg_ram[3], tc0480scp->bg_gfx);
2878   common_get_tc0480bg_tile_info(tileinfo, tile_index, m_bg_ram[3], m_gfxnum);
27652879}
27662880
2767TILE_GET_INFO_MEMBER(tc0480scp_device::tc0480scp_get_tx_tile_info)
2881TILE_GET_INFO_MEMBER(tc0480scp_device::get_tx_tile_info)
27682882{
2769   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
2770   common_get_tc0480tx_tile_info(machine(), this, tileinfo, tile_index, tc0480scp->tx_ram, tc0480scp->tx_gfx);
2883   common_get_tc0480tx_tile_info(tileinfo, tile_index, m_tx_ram, m_txnum);
27712884}
27722885
2773static const gfx_layout tc0480scp_charlayout =
2886void tc0480scp_device::dirty_tilemaps()
27742887{
2775   8,8,    /* 8*8 characters */
2776   256,    /* 256 characters */
2777   4,  /* 4 bits per pixel */
2778   { 0, 1, 2, 3 },
2779   { XOR(3)*4, XOR(2)*4, XOR(1)*4, XOR(0)*4, XOR(7)*4, XOR(6)*4, XOR(5)*4, XOR(4)*4 },
2780   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
2781   32*8    /* every sprite takes 32 consecutive bytes */
2782};
2783
2784
2785static void tc0480scp_dirty_tilemaps( tc0480scp_state *tc0480scp )
2786{
2787   tc0480scp->tilemap[0][tc0480scp->dblwidth]->mark_all_dirty();
2788   tc0480scp->tilemap[1][tc0480scp->dblwidth]->mark_all_dirty();
2789   tc0480scp->tilemap[2][tc0480scp->dblwidth]->mark_all_dirty();
2790   tc0480scp->tilemap[3][tc0480scp->dblwidth]->mark_all_dirty();
2791   tc0480scp->tilemap[4][tc0480scp->dblwidth]->mark_all_dirty();
2888   m_tilemap[0][m_dblwidth]->mark_all_dirty();
2889   m_tilemap[1][m_dblwidth]->mark_all_dirty();
2890   m_tilemap[2][m_dblwidth]->mark_all_dirty();
2891   m_tilemap[3][m_dblwidth]->mark_all_dirty();
2892   m_tilemap[4][m_dblwidth]->mark_all_dirty();
27922893}
27932894
27942895
2795static void tc0480scp_set_layer_ptrs( tc0480scp_state *tc0480scp )
2896void tc0480scp_device::set_layer_ptrs()
27962897{
2797   if (!tc0480scp->dblwidth)
2898   if (!m_dblwidth)
27982899   {
2799      tc0480scp->bg_ram[0]       = tc0480scp->ram + 0x0000; //0000
2800      tc0480scp->bg_ram[1]       = tc0480scp->ram + 0x0800; //1000
2801      tc0480scp->bg_ram[2]       = tc0480scp->ram + 0x1000; //2000
2802      tc0480scp->bg_ram[3]       = tc0480scp->ram + 0x1800; //3000
2803      tc0480scp->bgscroll_ram[0] = tc0480scp->ram + 0x2000; //4000
2804      tc0480scp->bgscroll_ram[1] = tc0480scp->ram + 0x2200; //4400
2805      tc0480scp->bgscroll_ram[2] = tc0480scp->ram + 0x2400; //4800
2806      tc0480scp->bgscroll_ram[3] = tc0480scp->ram + 0x2600; //4c00
2807      tc0480scp->rowzoom_ram[2]  = tc0480scp->ram + 0x3000; //6000
2808      tc0480scp->rowzoom_ram[3]  = tc0480scp->ram + 0x3200; //6400
2809      tc0480scp->bgcolumn_ram[2] = tc0480scp->ram + 0x3400; //6800
2810      tc0480scp->bgcolumn_ram[3] = tc0480scp->ram + 0x3600; //6c00
2811      tc0480scp->tx_ram          = tc0480scp->ram + 0x6000; //c000
2812      tc0480scp->char_ram    = tc0480scp->ram + 0x7000; //e000
2900      m_bg_ram[0]       = m_ram + 0x0000; //0000
2901      m_bg_ram[1]       = m_ram + 0x0800; //1000
2902      m_bg_ram[2]       = m_ram + 0x1000; //2000
2903      m_bg_ram[3]       = m_ram + 0x1800; //3000
2904      m_bgscroll_ram[0] = m_ram + 0x2000; //4000
2905      m_bgscroll_ram[1] = m_ram + 0x2200; //4400
2906      m_bgscroll_ram[2] = m_ram + 0x2400; //4800
2907      m_bgscroll_ram[3] = m_ram + 0x2600; //4c00
2908      m_rowzoom_ram[2]  = m_ram + 0x3000; //6000
2909      m_rowzoom_ram[3]  = m_ram + 0x3200; //6400
2910      m_bgcolumn_ram[2] = m_ram + 0x3400; //6800
2911      m_bgcolumn_ram[3] = m_ram + 0x3600; //6c00
2912      m_tx_ram          = m_ram + 0x6000; //c000
2913      m_char_ram    = m_ram + 0x7000; //e000
28132914   }
28142915   else
28152916   {
2816      tc0480scp->bg_ram[0]       = tc0480scp->ram + 0x0000; //0000
2817      tc0480scp->bg_ram[1]       = tc0480scp->ram + 0x1000; //2000
2818      tc0480scp->bg_ram[2]       = tc0480scp->ram + 0x2000; //4000
2819      tc0480scp->bg_ram[3]       = tc0480scp->ram + 0x3000; //6000
2820      tc0480scp->bgscroll_ram[0] = tc0480scp->ram + 0x4000; //8000
2821      tc0480scp->bgscroll_ram[1] = tc0480scp->ram + 0x4200; //8400
2822      tc0480scp->bgscroll_ram[2] = tc0480scp->ram + 0x4400; //8800
2823      tc0480scp->bgscroll_ram[3] = tc0480scp->ram + 0x4600; //8c00
2824      tc0480scp->rowzoom_ram[2]  = tc0480scp->ram + 0x5000; //a000
2825      tc0480scp->rowzoom_ram[3]  = tc0480scp->ram + 0x5200; //a400
2826      tc0480scp->bgcolumn_ram[2] = tc0480scp->ram + 0x5400; //a800
2827      tc0480scp->bgcolumn_ram[3] = tc0480scp->ram + 0x5600; //ac00
2828      tc0480scp->tx_ram          = tc0480scp->ram + 0x6000; //c000
2829      tc0480scp->char_ram    = tc0480scp->ram + 0x7000; //e000
2917      m_bg_ram[0]       = m_ram + 0x0000; //0000
2918      m_bg_ram[1]       = m_ram + 0x1000; //2000
2919      m_bg_ram[2]       = m_ram + 0x2000; //4000
2920      m_bg_ram[3]       = m_ram + 0x3000; //6000
2921      m_bgscroll_ram[0] = m_ram + 0x4000; //8000
2922      m_bgscroll_ram[1] = m_ram + 0x4200; //8400
2923      m_bgscroll_ram[2] = m_ram + 0x4400; //8800
2924      m_bgscroll_ram[3] = m_ram + 0x4600; //8c00
2925      m_rowzoom_ram[2]  = m_ram + 0x5000; //a000
2926      m_rowzoom_ram[3]  = m_ram + 0x5200; //a400
2927      m_bgcolumn_ram[2] = m_ram + 0x5400; //a800
2928      m_bgcolumn_ram[3] = m_ram + 0x5600; //ac00
2929      m_tx_ram          = m_ram + 0x6000; //c000
2930      m_char_ram    = m_ram + 0x7000; //e000
28302931   }
28312932}
28322933
2833READ16_DEVICE_HANDLER( tc0480scp_word_r )
2934READ16_MEMBER( tc0480scp_device::word_r )
28342935{
2835   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
2836   return tc0480scp->ram[offset];
2936   return m_ram[offset];
28372937}
28382938
2839WRITE16_DEVICE_HANDLER( tc0480scp_word_w )
2939WRITE16_MEMBER( tc0480scp_device::word_w )
28402940{
2841   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
2941   COMBINE_DATA(&m_ram[offset]);
28422942
2843   COMBINE_DATA(&tc0480scp->ram[offset]);
2844
2845   if (!tc0480scp->dblwidth)
2943   if (!m_dblwidth)
28462944   {
28472945      if (offset < 0x2000)
28482946      {
2849         tc0480scp->tilemap[(offset / 0x800)][tc0480scp->dblwidth]->mark_tile_dirty(((offset % 0x800) / 2));
2947         m_tilemap[(offset / 0x800)][m_dblwidth]->mark_tile_dirty(((offset % 0x800) / 2));
28502948      }
28512949      else if (offset < 0x6000)
28522950      {   /* do nothing */
28532951      }
28542952      else if (offset < 0x7000)
28552953      {
2856         tc0480scp->tilemap[4][tc0480scp->dblwidth]->mark_tile_dirty((offset - 0x6000));
2954         m_tilemap[4][m_dblwidth]->mark_tile_dirty((offset - 0x6000));
28572955      }
28582956      else if (offset <= 0x7fff)
28592957      {
2860         space.machine().gfx[tc0480scp->tx_gfx]->mark_dirty((offset - 0x7000) / 16);
2958         space.machine().gfx[m_txnum]->mark_dirty((offset - 0x7000) / 16);
28612959      }
28622960   }
28632961   else
28642962   {
28652963      if (offset < 0x4000)
28662964      {
2867         tc0480scp->tilemap[(offset / 0x1000)][tc0480scp->dblwidth]->mark_tile_dirty(((offset % 0x1000) / 2));
2965         m_tilemap[(offset / 0x1000)][m_dblwidth]->mark_tile_dirty(((offset % 0x1000) / 2));
28682966      }
28692967      else if (offset < 0x6000)
28702968      {   /* do nothing */
28712969      }
28722970      else if (offset < 0x7000)
28732971      {
2874         tc0480scp->tilemap[4][tc0480scp->dblwidth]->mark_tile_dirty((offset - 0x6000));
2972         m_tilemap[4][m_dblwidth]->mark_tile_dirty((offset - 0x6000));
28752973      }
28762974      else if (offset <= 0x7fff)
28772975      {
2878         space.machine().gfx[tc0480scp->tx_gfx]->mark_dirty((offset - 0x7000) / 16);
2976         space.machine().gfx[m_txnum]->mark_dirty((offset - 0x7000) / 16);
28792977      }
28802978   }
28812979}
28822980
2883READ16_DEVICE_HANDLER( tc0480scp_ctrl_word_r )
2981READ16_MEMBER( tc0480scp_device::ctrl_word_r )
28842982{
2885   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
2886   return tc0480scp->ctrl[offset];
2983   return m_ctrl[offset];
28872984}
28882985
2889WRITE16_DEVICE_HANDLER( tc0480scp_ctrl_word_w )
2986WRITE16_MEMBER( tc0480scp_device::ctrl_word_w )
28902987{
2891   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
2892   int flip = tc0480scp->pri_reg & 0x40;
2988   int flip = m_pri_reg & 0x40;
28932989
2894   COMBINE_DATA(&tc0480scp->ctrl[offset]);
2895   data = tc0480scp->ctrl[offset];
2990   COMBINE_DATA(&m_ctrl[offset]);
2991   data = m_ctrl[offset];
28962992
28972993   switch (offset)
28982994   {
28992995      /* The x offsets of the four bg layers are staggered by intervals of 4 pixels */
29002996      case 0x00:   /* bg0 x */
29012997         if (!flip)  data = -data;
2902         tc0480scp->bgscrollx[0] = data;
2998         m_bgscrollx[0] = data;
29032999         break;
29043000
29053001      case 0x01:   /* bg1 x */
29063002         data += 4;
29073003         if (!flip)  data = -data;
2908         tc0480scp->bgscrollx[1] = data;
3004         m_bgscrollx[1] = data;
29093005         break;
29103006
29113007      case 0x02:   /* bg2 x */
29123008         data += 8;
29133009         if (!flip)  data = -data;
2914         tc0480scp->bgscrollx[2] = data;
3010         m_bgscrollx[2] = data;
29153011         break;
29163012
29173013      case 0x03:   /* bg3 x */
29183014         data += 12;
29193015         if (!flip)  data = -data;
2920         tc0480scp->bgscrollx[3] = data;
3016         m_bgscrollx[3] = data;
29213017         break;
29223018
29233019      case 0x04:   /* bg0 y */
29243020         if (flip)  data = -data;
2925         tc0480scp->bgscrolly[0] = data;
3021         m_bgscrolly[0] = data;
29263022         break;
29273023
29283024      case 0x05:   /* bg1 y */
29293025         if (flip)  data = -data;
2930         tc0480scp->bgscrolly[1] = data;
3026         m_bgscrolly[1] = data;
29313027         break;
29323028
29333029      case 0x06:   /* bg2 y */
29343030         if (flip)  data = -data;
2935         tc0480scp->bgscrolly[2] = data;
3031         m_bgscrolly[2] = data;
29363032         break;
29373033
29383034      case 0x07:   /* bg3 y */
29393035         if (flip)  data = -data;
2940         tc0480scp->bgscrolly[3] = data;
3036         m_bgscrolly[3] = data;
29413037         break;
29423038
29433039      case 0x08:   /* bg0 zoom */
r24008r24009
29493045      case 0x0c:   /* fg (text) x */
29503046
29513047         /* Text layer can be offset from bg0 (e.g. Metalb) */
2952         if (!flip)  data -= tc0480scp->text_xoffs;
2953         if (flip)   data += tc0480scp->text_xoffs;
3048         if (!flip)  data -= m_text_xoffs;
3049         if (flip)   data += m_text_xoffs;
29543050
2955         tc0480scp->tilemap[4][0]->set_scrollx(0, -data);
2956         tc0480scp->tilemap[4][1]->set_scrollx(0, -data);
3051         m_tilemap[4][0]->set_scrollx(0, -data);
3052         m_tilemap[4][1]->set_scrollx(0, -data);
29573053         break;
29583054
29593055      case 0x0d:   /* fg (text) y */
29603056
29613057         /* Text layer can be offset from bg0 (e.g. Slapshot) */
2962         if (!flip)  data -= tc0480scp->text_yoffs;
2963         if (flip)   data += tc0480scp->text_yoffs;
3058         if (!flip)  data -= m_text_yoffs;
3059         if (flip)   data += m_text_yoffs;
29643060
2965         tc0480scp->tilemap[4][0]->set_scrolly(0, -data);
2966         tc0480scp->tilemap[4][1]->set_scrolly(0, -data);
3061         m_tilemap[4][0]->set_scrolly(0, -data);
3062         m_tilemap[4][1]->set_scrolly(0, -data);
29673063         break;
29683064
29693065      /* offset 0x0e unused */
29703066
29713067      case 0x0f:   /* control register */
29723068      {
2973         int old_width = (tc0480scp->pri_reg & 0x80) >> 7;
3069         int old_width = (m_pri_reg & 0x80) >> 7;
29743070         flip = (data & 0x40) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
2975         tc0480scp->pri_reg = data;
3071         m_pri_reg = data;
29763072
2977         tc0480scp->tilemap[0][0]->set_flip(flip);
2978         tc0480scp->tilemap[1][0]->set_flip(flip);
2979         tc0480scp->tilemap[2][0]->set_flip(flip);
2980         tc0480scp->tilemap[3][0]->set_flip(flip);
2981         tc0480scp->tilemap[4][0]->set_flip(flip);
3073         m_tilemap[0][0]->set_flip(flip);
3074         m_tilemap[1][0]->set_flip(flip);
3075         m_tilemap[2][0]->set_flip(flip);
3076         m_tilemap[3][0]->set_flip(flip);
3077         m_tilemap[4][0]->set_flip(flip);
29823078
2983         tc0480scp->tilemap[0][1]->set_flip(flip);
2984         tc0480scp->tilemap[1][1]->set_flip(flip);
2985         tc0480scp->tilemap[2][1]->set_flip(flip);
2986         tc0480scp->tilemap[3][1]->set_flip(flip);
2987         tc0480scp->tilemap[4][1]->set_flip(flip);
3079         m_tilemap[0][1]->set_flip(flip);
3080         m_tilemap[1][1]->set_flip(flip);
3081         m_tilemap[2][1]->set_flip(flip);
3082         m_tilemap[3][1]->set_flip(flip);
3083         m_tilemap[4][1]->set_flip(flip);
29883084
2989         tc0480scp->dblwidth = (tc0480scp->pri_reg & 0x80) >> 7;
3085         m_dblwidth = (m_pri_reg & 0x80) >> 7;
29903086
2991         if (tc0480scp->dblwidth != old_width)   /* tilemap width is changing */
3087         if (m_dblwidth != old_width)   /* tilemap width is changing */
29923088         {
29933089            /* Reinitialise layer pointers */
2994            tc0480scp_set_layer_ptrs(tc0480scp);
3090            set_layer_ptrs();
29953091
29963092            /* and ensure full redraw of tilemaps */
2997            tc0480scp_dirty_tilemaps(tc0480scp);
3093            dirty_tilemaps();
29983094         }
29993095
30003096         break;
r24008r24009
30053101}
30063102
30073103
3008READ32_DEVICE_HANDLER( tc0480scp_ctrl_long_r )
3104READ32_MEMBER( tc0480scp_device::ctrl_long_r )
30093105{
3010   return (tc0480scp_ctrl_word_r(device, space, offset * 2, 0xffff) << 16) | tc0480scp_ctrl_word_r(device, space, offset * 2 + 1, 0xffff);
3106   return (ctrl_word_r(space, offset * 2, 0xffff) << 16) | ctrl_word_r(space, offset * 2 + 1, 0xffff);
30113107}
30123108
30133109/* TODO: byte access ? */
30143110
3015WRITE32_DEVICE_HANDLER( tc0480scp_ctrl_long_w )
3111WRITE32_MEMBER( tc0480scp_device::ctrl_long_w )
30163112{
30173113   if (ACCESSING_BITS_16_31)
3018      tc0480scp_ctrl_word_w(device, space, offset * 2, data >> 16, mem_mask >> 16);
3114      ctrl_word_w(space, offset * 2, data >> 16, mem_mask >> 16);
30193115   if (ACCESSING_BITS_0_15)
3020      tc0480scp_ctrl_word_w(device, space, (offset * 2) + 1, data & 0xffff, mem_mask & 0xffff);
3116      ctrl_word_w(space, (offset * 2) + 1, data & 0xffff, mem_mask & 0xffff);
30213117}
30223118
3023READ32_DEVICE_HANDLER( tc0480scp_long_r )
3119READ32_MEMBER( tc0480scp_device::long_r )
30243120{
3025   return (tc0480scp_word_r(device, space, offset * 2, 0xffff) << 16) | tc0480scp_word_r(device, space, offset * 2 + 1, 0xffff);
3121   return (word_r(space, offset * 2, 0xffff) << 16) | word_r(space, offset * 2 + 1, 0xffff);
30263122}
30273123
3028WRITE32_DEVICE_HANDLER( tc0480scp_long_w )
3124WRITE32_MEMBER( tc0480scp_device::long_w )
30293125{
30303126   if (ACCESSING_BITS_16_31)
30313127   {
3032      int oldword = tc0480scp_word_r(device, space, offset * 2, 0xffff);
3128      int oldword = word_r(space, offset * 2, 0xffff);
30333129      int newword = data >> 16;
30343130      if (!ACCESSING_BITS_16_23)
30353131         newword |= (oldword & 0x00ff);
30363132      if (!ACCESSING_BITS_24_31)
30373133         newword |= (oldword & 0xff00);
3038      tc0480scp_word_w(device, space, offset * 2, newword, 0xffff);
3134      word_w(space, offset * 2, newword, 0xffff);
30393135   }
30403136   if (ACCESSING_BITS_0_15)
30413137   {
3042      int oldword = tc0480scp_word_r(device, space, (offset * 2) + 1, 0xffff);
3138      int oldword = word_r(space, (offset * 2) + 1, 0xffff);
30433139      int newword = data & 0xffff;
30443140      if (!ACCESSING_BITS_0_7)
30453141         newword |= (oldword & 0x00ff);
30463142      if (!ACCESSING_BITS_8_15)
30473143         newword |= (oldword & 0xff00);
3048      tc0480scp_word_w(device, space, (offset * 2) + 1, newword, 0xffff);
3144      word_w(space, (offset * 2) + 1, newword, 0xffff);
30493145   }
30503146}
30513147
30523148
3053void tc0480scp_tilemap_update( device_t *device )
3149void tc0480scp_device::tilemap_update()
30543150{
3055   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
30563151   int layer, zoom, i, j;
3057   int flip = tc0480scp->pri_reg & 0x40;
3152   int flip = m_pri_reg & 0x40;
30583153
30593154   for (layer = 0; layer < 4; layer++)
30603155   {
3061      tc0480scp->tilemap[layer][tc0480scp->dblwidth]->set_scrolly(0, tc0480scp->bgscrolly[layer]);
3062      zoom = 0x10000 + 0x7f - tc0480scp->ctrl[0x08 + layer];
3156      m_tilemap[layer][m_dblwidth]->set_scrolly(0, m_bgscrolly[layer]);
3157      zoom = 0x10000 + 0x7f - m_ctrl[0x08 + layer];
30633158
30643159      if (zoom != 0x10000)    /* can't use scroll rows when zooming */
30653160      {
3066         tc0480scp->tilemap[layer][tc0480scp->dblwidth]->set_scrollx(0, tc0480scp->bgscrollx[layer]);
3161         m_tilemap[layer][m_dblwidth]->set_scrollx(0, m_bgscrollx[layer]);
30673162      }
30683163      else
30693164      {
30703165         for (j = 0; j < 512; j++)
30713166         {
3072            i = tc0480scp->bgscroll_ram[layer][j];
3167            i = m_bgscroll_ram[layer][j];
30733168
30743169            if (!flip)
3075               tc0480scp->tilemap[layer][tc0480scp->dblwidth]->set_scrollx(j & 0x1ff, tc0480scp->bgscrollx[layer] - i);
3170               m_tilemap[layer][m_dblwidth]->set_scrollx(j & 0x1ff, m_bgscrollx[layer] - i);
30763171            else
3077               tc0480scp->tilemap[layer][tc0480scp->dblwidth]->set_scrollx(j & 0x1ff, tc0480scp->bgscrollx[layer] + i);
3172               m_tilemap[layer][m_dblwidth]->set_scrollx(j & 0x1ff, m_bgscrollx[layer] + i);
30783173         }
30793174      }
30803175   }
r24008r24009
31173212
31183213**********************************************************************/
31193214
3120static void tc0480scp_bg01_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority )
3215void tc0480scp_device::bg01_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority )
31213216{
31223217   /* X-axis zoom offers expansion only: 0 = no zoom, 0xff = max
31233218      Y-axis zoom offers expansion/compression: 0x7f = no zoom, 0xff = max
31243219      (0x1a in Footchmp hiscore = shrunk) */
31253220
3126   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
3127   int zoomx = 0x10000 - (tc0480scp->ctrl[0x08 + layer] & 0xff00);
3128   int zoomy = 0x10000 - (((tc0480scp->ctrl[0x08 + layer] & 0xff) - 0x7f) * 512);
3221   int zoomx = 0x10000 - (m_ctrl[0x08 + layer] & 0xff00);
3222   int zoomy = 0x10000 - (((m_ctrl[0x08 + layer] & 0xff) - 0x7f) * 512);
31293223
31303224   if ((zoomx == 0x10000) && (zoomy == 0x10000))   /* no zoom, simple */
31313225   {
31323226      /* Prevent bad things */
3133      tc0480scp->tilemap[layer][tc0480scp->dblwidth]->draw(bitmap, cliprect, flags, priority);
3227      m_tilemap[layer][m_dblwidth]->draw(bitmap, cliprect, flags, priority);
31343228   }
31353229   else    /* zoom */
31363230   {
r24008r24009
31383232      UINT8 *tsrc;
31393233      UINT16 scanline[512];
31403234      UINT32 sx;
3141      bitmap_ind16 &srcbitmap = tc0480scp->tilemap[layer][tc0480scp->dblwidth]->pixmap();
3142      bitmap_ind8 &flagsbitmap = tc0480scp->tilemap[layer][tc0480scp->dblwidth]->flagsmap();
3143      int flip = tc0480scp->pri_reg & 0x40;
3235      bitmap_ind16 &srcbitmap = m_tilemap[layer][m_dblwidth]->pixmap();
3236      bitmap_ind8 &flagsbitmap = m_tilemap[layer][m_dblwidth]->flagsmap();
3237      int flip = m_pri_reg & 0x40;
31443238      int i, y, y_index, src_y_index, row_index;
31453239      int x_index, x_step;
31463240      int machine_flip = 0;   /* for  ROT 180 ? */
r24008r24009
31503244      UINT16 max_y = cliprect.max_y;
31513245
31523246      int width_mask = 0x1ff;
3153      if (tc0480scp->dblwidth)
3247      if (m_dblwidth)
31543248         width_mask = 0x3ff;
31553249
31563250      if (!flip)
31573251      {
3158         sx = ((tc0480scp->bgscrollx[layer] + 15 + layer * 4) << 16) + ((255 - (tc0480scp->ctrl[0x10 + layer] & 0xff)) << 8);
3159         sx += (tc0480scp->x_offs - 15 - layer * 4) * zoomx;
3252         sx = ((m_bgscrollx[layer] + 15 + layer * 4) << 16) + ((255 - (m_ctrl[0x10 + layer] & 0xff)) << 8);
3253         sx += (m_x_offs - 15 - layer * 4) * zoomx;
31603254
3161         y_index = (tc0480scp->bgscrolly[layer] << 16) + ((tc0480scp->ctrl[0x14 + layer] & 0xff) << 8);
3162         y_index -= (tc0480scp->y_offs - min_y) * zoomy;
3255         y_index = (m_bgscrolly[layer] << 16) + ((m_ctrl[0x14 + layer] & 0xff) << 8);
3256         y_index -= (m_y_offset - min_y) * zoomy;
31633257      }
31643258      else    /* TC0480SCP tiles flipscreen */
31653259      {
3166         sx = ((-tc0480scp->bgscrollx[layer] + 15 + layer * 4 + tc0480scp->flip_xoffs ) << 16) + ((255-(tc0480scp->ctrl[0x10 + layer] & 0xff)) << 8);
3167         sx += (tc0480scp->x_offs - 15 - layer * 4) * zoomx;
3260         sx = ((-m_bgscrollx[layer] + 15 + layer * 4 + m_flip_xoffs ) << 16) + ((255-(m_ctrl[0x10 + layer] & 0xff)) << 8);
3261         sx += (m_x_offs - 15 - layer * 4) * zoomx;
31683262
3169         y_index = ((-tc0480scp->bgscrolly[layer] + tc0480scp->flip_yoffs) << 16) + ((tc0480scp->ctrl[0x14 + layer] & 0xff) << 8);
3170         y_index -= (tc0480scp->y_offs - min_y) * zoomy;
3263         y_index = ((-m_bgscrolly[layer] + m_flip_yoffs) << 16) + ((m_ctrl[0x14 + layer] & 0xff) << 8);
3264         y_index -= (m_y_offset - min_y) * zoomy;
31713265      }
31723266
31733267      if (!machine_flip)
r24008r24009
31843278         if (flip)
31853279            row_index = 0x1ff - row_index;
31863280
3187         x_index = sx - ((tc0480scp->bgscroll_ram[layer][row_index] << 16)) - ((tc0480scp->bgscroll_ram[layer][row_index + 0x800] << 8) & 0xffff);
3281         x_index = sx - ((m_bgscroll_ram[layer][row_index] << 16)) - ((m_bgscroll_ram[layer][row_index + 0x800] << 8) & 0xffff);
31883282
31893283         src16 = &srcbitmap.pix16(src_y_index);
31903284         tsrc = &flagsbitmap.pix8(src_y_index);
r24008r24009
32123306            }
32133307         }
32143308
3215         taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, device->machine().priority_bitmap, priority);
3309         taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, machine().priority_bitmap, priority);
32163310
32173311         y_index += zoomy;
32183312         if (!machine_flip)
r24008r24009
32663360
32673361****************************************************************/
32683362
3269static void tc0480scp_bg23_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority )
3363void tc0480scp_device::bg23_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority )
32703364{
3271   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
3272   bitmap_ind16 &srcbitmap = tc0480scp->tilemap[layer][tc0480scp->dblwidth]->pixmap();
3273   bitmap_ind8 &flagsbitmap = tc0480scp->tilemap[layer][tc0480scp->dblwidth]->flagsmap();
3365   bitmap_ind16 &srcbitmap = m_tilemap[layer][m_dblwidth]->pixmap();
3366   bitmap_ind8 &flagsbitmap = m_tilemap[layer][m_dblwidth]->flagsmap();
32743367
32753368   UINT16 *dst16, *src16;
32763369   UINT8 *tsrc;
r24008r24009
32783371   int sx, x_index, x_step;
32793372   UINT32 zoomx, zoomy;
32803373   UINT16 scanline[512];
3281   int flipscreen = tc0480scp->pri_reg & 0x40;
3374   int flipscreen = m_pri_reg & 0x40;
32823375   int machine_flip = 0;   /* for  ROT 180 ? */
32833376
32843377   UINT16 screen_width = 512; //cliprect.width();
r24008r24009
32863379   UINT16 max_y = cliprect.max_y;
32873380
32883381   int width_mask = 0x1ff;
3289   if (tc0480scp->dblwidth)
3382   if (m_dblwidth)
32903383      width_mask = 0x3ff;
32913384
32923385   /* X-axis zoom offers expansion only: 0 = no zoom, 0xff = max
32933386      Y-axis zoom offers expansion/compression: 0x7f = no zoom, 0xff = max
32943387      (0x1a in Footchmp hiscore = shrunk) */
32953388
3296   zoomx = 0x10000 - (tc0480scp->ctrl[0x08 + layer] & 0xff00);
3297   zoomy = 0x10000 - (((tc0480scp->ctrl[0x08 + layer] & 0xff) - 0x7f) * 512);
3389   zoomx = 0x10000 - (m_ctrl[0x08 + layer] & 0xff00);
3390   zoomy = 0x10000 - (((m_ctrl[0x08 + layer] & 0xff) - 0x7f) * 512);
32983391
32993392   if (!flipscreen)
33003393   {
3301      sx = ((tc0480scp->bgscrollx[layer] + 15 + layer * 4) << 16) + ((255-(tc0480scp->ctrl[0x10 + layer] & 0xff)) << 8);
3302      sx += (tc0480scp->x_offs - 15 - layer * 4) * zoomx;
3394      sx = ((m_bgscrollx[layer] + 15 + layer * 4) << 16) + ((255-(m_ctrl[0x10 + layer] & 0xff)) << 8);
3395      sx += (m_x_offs - 15 - layer * 4) * zoomx;
33033396
3304      y_index = (tc0480scp->bgscrolly[layer] << 16) + ((tc0480scp->ctrl[0x14 + layer] & 0xff) << 8);
3305      y_index -= (tc0480scp->y_offs - min_y) * zoomy;
3397      y_index = (m_bgscrolly[layer] << 16) + ((m_ctrl[0x14 + layer] & 0xff) << 8);
3398      y_index -= (m_y_offset - min_y) * zoomy;
33063399   }
33073400   else    /* TC0480SCP tiles flipscreen */
33083401   {
3309      sx = ((-tc0480scp->bgscrollx[layer] + 15 + layer * 4 + tc0480scp->flip_xoffs ) << 16) + ((255 - (tc0480scp->ctrl[0x10 + layer] & 0xff)) << 8);
3310      sx += (tc0480scp->x_offs - 15 - layer * 4) * zoomx;
3402      sx = ((-m_bgscrollx[layer] + 15 + layer * 4 + m_flip_xoffs ) << 16) + ((255 - (m_ctrl[0x10 + layer] & 0xff)) << 8);
3403      sx += (m_x_offs - 15 - layer * 4) * zoomx;
33113404
3312      y_index = ((-tc0480scp->bgscrolly[layer] + tc0480scp->flip_yoffs) << 16) + ((tc0480scp->ctrl[0x14 + layer] & 0xff) << 8);
3313      y_index -= (tc0480scp->y_offs - min_y) * zoomy;
3405      y_index = ((-m_bgscrolly[layer] + m_flip_yoffs) << 16) + ((m_ctrl[0x14 + layer] & 0xff) << 8);
3406      y_index -= (m_y_offset - min_y) * zoomy;
33143407   }
33153408
33163409
r24008r24009
33223415   do
33233416   {
33243417      if (!flipscreen)
3325         src_y_index = ((y_index>>16) + tc0480scp->bgcolumn_ram[layer][(y - tc0480scp->y_offs) & 0x1ff]) & 0x1ff;
3418         src_y_index = ((y_index>>16) + m_bgcolumn_ram[layer][(y - m_y_offset) & 0x1ff]) & 0x1ff;
33263419      else    /* colscroll area is back to front in flipscreen */
3327         src_y_index = ((y_index>>16) + tc0480scp->bgcolumn_ram[layer][0x1ff - ((y - tc0480scp->y_offs) & 0x1ff)]) & 0x1ff;
3420         src_y_index = ((y_index>>16) + m_bgcolumn_ram[layer][0x1ff - ((y - m_y_offset) & 0x1ff)]) & 0x1ff;
33283421
33293422      /* row areas are the same in flipscreen, so we must read in reverse */
33303423      row_index = src_y_index;
33313424      if (flipscreen)
33323425         row_index = 0x1ff - row_index;
33333426
3334      if (tc0480scp->pri_reg & (layer - 1))   /* bit0 enables for BG2, bit1 for BG3 */
3335         row_zoom = tc0480scp->rowzoom_ram[layer][row_index];
3427      if (m_pri_reg & (layer - 1))   /* bit0 enables for BG2, bit1 for BG3 */
3428         row_zoom = m_rowzoom_ram[layer][row_index];
33363429      else
33373430         row_zoom = 0;
33383431
3339      x_index = sx - ((tc0480scp->bgscroll_ram[layer][row_index] << 16)) - ((tc0480scp->bgscroll_ram[layer][row_index + 0x800] << 8) & 0xffff);
3432      x_index = sx - ((m_bgscroll_ram[layer][row_index] << 16)) - ((m_bgscroll_ram[layer][row_index + 0x800] << 8) & 0xffff);
33403433
33413434      /* flawed calc ?? */
3342      x_index -= (tc0480scp->x_offs - 0x1f + layer * 4) * ((row_zoom & 0xff) << 8);
3435      x_index -= (m_x_offs - 0x1f + layer * 4) * ((row_zoom & 0xff) << 8);
33433436
33443437/* We used to kludge 270 multiply factor, before adjusting x_index instead */
33453438
r24008r24009
33763469         }
33773470      }
33783471
3379      taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, device->machine().priority_bitmap, priority);
3472      taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, machine().priority_bitmap, priority);
33803473
33813474      y_index += zoomy;
33823475      if (!machine_flip)
r24008r24009
33883481}
33893482
33903483
3391void tc0480scp_tilemap_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority )
3484void tc0480scp_device::tilemap_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority )
33923485{
3393   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
3394
33953486   /* no layer disable bits */
33963487   switch (layer)
33973488   {
33983489      case 0:
3399         tc0480scp_bg01_draw(device, bitmap, cliprect, 0, flags, priority);
3490         bg01_draw(bitmap, cliprect, 0, flags, priority);
34003491         break;
34013492      case 1:
3402         tc0480scp_bg01_draw(device, bitmap, cliprect, 1, flags, priority);
3493         bg01_draw(bitmap, cliprect, 1, flags, priority);
34033494         break;
34043495      case 2:
3405         tc0480scp_bg23_draw(device, bitmap, cliprect, 2, flags, priority);
3496         bg23_draw(bitmap, cliprect, 2, flags, priority);
34063497         break;
34073498      case 3:
3408         tc0480scp_bg23_draw(device, bitmap, cliprect, 3, flags, priority);
3499         bg23_draw(bitmap, cliprect, 3, flags, priority);
34093500         break;
34103501      case 4:
3411         tc0480scp->tilemap[4][tc0480scp->dblwidth]->draw(bitmap, cliprect, flags, priority);
3502         m_tilemap[4][m_dblwidth]->draw(bitmap, cliprect, flags, priority);
34123503         break;
34133504   }
34143505}
r24008r24009
34273518   0x0321
34283519};
34293520
3430int tc0480scp_get_bg_priority( device_t *device )
3521int tc0480scp_device::get_bg_priority()
34313522{
3432   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
3433   return tc0480scp_bg_pri_lookup[(tc0480scp->pri_reg & 0x1c) >> 2];
3523   return tc0480scp_bg_pri_lookup[(m_pri_reg & 0x1c) >> 2];
34343524}
34353525
34363526// undrfire.c also needs to directly access the priority reg
3437READ8_DEVICE_HANDLER( tc0480scp_pri_reg_r )
3527READ8_MEMBER( tc0480scp_device::pri_reg_r )
34383528{
3439   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
3440   return tc0480scp->pri_reg;
3529   return m_pri_reg;
34413530}
34423531
3443void tc0480scp_device::tc0480scp_postload()
3532void tc0480scp_device::postload()
34443533{
3445   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
3446
34473534   int reg;
3448   int flip = tc0480scp->ctrl[0xf] & 0x40;
3535   int flip = m_ctrl[0xf] & 0x40;
34493536
3450   tc0480scp_set_layer_ptrs(tc0480scp);
3537   set_layer_ptrs();
34513538
3452   tc0480scp->tilemap[0][0]->set_flip(flip);
3453   tc0480scp->tilemap[1][0]->set_flip(flip);
3454   tc0480scp->tilemap[2][0]->set_flip(flip);
3455   tc0480scp->tilemap[3][0]->set_flip(flip);
3456   tc0480scp->tilemap[4][0]->set_flip(flip);
3539   m_tilemap[0][0]->set_flip(flip);
3540   m_tilemap[1][0]->set_flip(flip);
3541   m_tilemap[2][0]->set_flip(flip);
3542   m_tilemap[3][0]->set_flip(flip);
3543   m_tilemap[4][0]->set_flip(flip);
34573544
3458   tc0480scp->tilemap[0][1]->set_flip(flip);
3459   tc0480scp->tilemap[1][1]->set_flip(flip);
3460   tc0480scp->tilemap[2][1]->set_flip(flip);
3461   tc0480scp->tilemap[3][1]->set_flip(flip);
3462   tc0480scp->tilemap[4][1]->set_flip(flip);
3545   m_tilemap[0][1]->set_flip(flip);
3546   m_tilemap[1][1]->set_flip(flip);
3547   m_tilemap[2][1]->set_flip(flip);
3548   m_tilemap[3][1]->set_flip(flip);
3549   m_tilemap[4][1]->set_flip(flip);
34633550
3464   reg = tc0480scp->ctrl[0];
3551   reg = m_ctrl[0];
34653552   if (!flip)  reg = -reg;
3466   tc0480scp->bgscrollx[0] = reg;
3553   m_bgscrollx[0] = reg;
34673554
3468   reg = tc0480scp->ctrl[1] + 4;
3555   reg = m_ctrl[1] + 4;
34693556   if (!flip)  reg = -reg;
3470   tc0480scp->bgscrollx[1] = reg;
3557   m_bgscrollx[1] = reg;
34713558
3472   reg = tc0480scp->ctrl[2] + 8;
3559   reg = m_ctrl[2] + 8;
34733560   if (!flip)  reg = -reg;
3474   tc0480scp->bgscrollx[2] = reg;
3561   m_bgscrollx[2] = reg;
34753562
3476   reg = tc0480scp->ctrl[3] + 12;
3563   reg = m_ctrl[3] + 12;
34773564   if (!flip)  reg = -reg;
3478   tc0480scp->bgscrollx[3] = reg;
3565   m_bgscrollx[3] = reg;
34793566
3480   reg = tc0480scp->ctrl[4];
3567   reg = m_ctrl[4];
34813568   if (!flip)  reg = -reg;
3482   tc0480scp->bgscrolly[0] = reg;
3569   m_bgscrolly[0] = reg;
34833570
3484   reg = tc0480scp->ctrl[5];
3571   reg = m_ctrl[5];
34853572   if (!flip)  reg = -reg;
3486   tc0480scp->bgscrolly[1] = reg;
3573   m_bgscrolly[1] = reg;
34873574
3488   reg = tc0480scp->ctrl[6];
3575   reg = m_ctrl[6];
34893576   if (!flip)  reg = -reg;
3490   tc0480scp->bgscrolly[2] = reg;
3577   m_bgscrolly[2] = reg;
34913578
3492   reg = tc0480scp->ctrl[7];
3579   reg = m_ctrl[7];
34933580   if (!flip)  reg = -reg;
3494   tc0480scp->bgscrolly[3] = reg;
3581   m_bgscrolly[3] = reg;
34953582
3496   reg = tc0480scp->ctrl[0x0c];
3497   if (!flip)  reg -= tc0480scp->text_xoffs;
3498   if (flip)   reg += tc0480scp->text_xoffs;
3499   tc0480scp->tilemap[4][0]->set_scrollx(0, -reg);
3500   tc0480scp->tilemap[4][1]->set_scrollx(0, -reg);
3583   reg = m_ctrl[0x0c];
3584   if (!flip)  reg -= m_text_xoffs;
3585   if (flip)   reg += m_text_xoffs;
3586   m_tilemap[4][0]->set_scrollx(0, -reg);
3587   m_tilemap[4][1]->set_scrollx(0, -reg);
35013588
3502   reg = tc0480scp->ctrl[0x0d];
3503   if (!flip)  reg -= tc0480scp->text_yoffs;
3504   if (flip)   reg += tc0480scp->text_yoffs;
3505   tc0480scp->tilemap[4][0]->set_scrolly(0, -reg);
3506   tc0480scp->tilemap[4][1]->set_scrolly(0, -reg);
3589   reg = m_ctrl[0x0d];
3590   if (!flip)  reg -= m_text_yoffs;
3591   if (flip)   reg += m_text_yoffs;
3592   m_tilemap[4][0]->set_scrolly(0, -reg);
3593   m_tilemap[4][1]->set_scrolly(0, -reg);
35073594}
35083595
3596/***************************************************************************/
3597/*                                                                         */
3598/*                              TC0150ROD                                  */
3599/*                                                                         */
3600/***************************************************************************/
35093601
3602#define TC0150ROD_RAM_SIZE 0x2000
35103603
3511const device_type TC0480SCP = &device_creator<tc0480scp_device>;
35123604
3513tc0480scp_device::tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
3514   : device_t(mconfig, TC0480SCP, "Taito TC0480SCP", tag, owner, clock, "tc0480scp", __FILE__)
3605
3606const device_type TC0150ROD = &device_creator<tc0150rod_device>;
3607
3608tc0150rod_device::tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
3609   : device_t(mconfig, TC0150ROD, "Taito TC0150ROD", tag, owner, clock, "tc0150rod", __FILE__),
3610   m_ram(NULL)
35153611{
3516   m_token = global_alloc_clear(tc0480scp_state);
35173612}
35183613
35193614//-------------------------------------------------
r24008r24009
35223617//  complete
35233618//-------------------------------------------------
35243619
3525void tc0480scp_device::device_config_complete()
3620void tc0150rod_device::device_config_complete()
35263621{
3527}
3528
3529//-------------------------------------------------
3530//  device_start - device-specific startup
3531//-------------------------------------------------
3532
3533void tc0480scp_device::device_start()
3534{
3535   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
3536   const tc0480scp_interface *intf = tc0480scp_get_interface(this);
3537   int i, xd, yd;
3538
3539   /* use the given gfx set for bg/tx tiles */
3540   tc0480scp->bg_gfx = intf->gfxnum;
3541   tc0480scp->tx_gfx = intf->txnum;
3542
3543   tc0480scp->tile_colbase = intf->col_base;
3544   tc0480scp->text_xoffs = intf->text_xoffs;
3545   tc0480scp->text_yoffs = intf->text_yoffs;
3546   tc0480scp->flip_xoffs = intf->flip_xoffs;   /* for most games (-1,0) */
3547   tc0480scp->flip_yoffs = intf->flip_yoffs;
3548   tc0480scp->x_offs = intf->x_offset + intf->pixels;
3549   tc0480scp->y_offs = intf->y_offset;
3550
3551   /* Single width versions */
3552   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);
3553   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);
3554   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);
3555   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);
3556   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);
3557
3558   /* Double width versions */
3559   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);
3560   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);
3561   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);
3562   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);
3563   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);
3564
3565   for (i = 0; i < 2; i++)
3622   // inherit a copy of the static data
3623   const tc0150rod_interface *intf = reinterpret_cast<const tc0150rod_interface *>(static_config());
3624   if (intf != NULL)
3625   *static_cast<tc0150rod_interface *>(this) = *intf;
3626   
3627   // or initialize to defaults if none provided
3628   else
35663629   {
3567      tc0480scp->tilemap[0][i]->set_transparent_pen(0);
3568      tc0480scp->tilemap[1][i]->set_transparent_pen(0);
3569      tc0480scp->tilemap[2][i]->set_transparent_pen(0);
3570      tc0480scp->tilemap[3][i]->set_transparent_pen(0);
3571      tc0480scp->tilemap[4][i]->set_transparent_pen(0);
35723630   }
3573
3574   xd = -tc0480scp->x_offs;
3575   yd =  tc0480scp->y_offs;
3576
3577   /* Metalb and Deadconx have minor screenflip issues: blue planet
3578      is off on x axis by 1 and in Deadconx the dark blue screen
3579      between stages also seems off by 1 pixel. */
3580
3581   /* It's not possible to get the text scrolldx calculations
3582      harmonised with the other layers: xd-2, 315-xd is the
3583      next valid pair:- the numbers diverge from xd, 319-xd */
3584
3585   /* Single width offsets */
3586   tc0480scp->tilemap[0][0]->set_scrolldx(xd,     320 - xd + tc0480scp->flip_xoffs);
3587   tc0480scp->tilemap[0][0]->set_scrolldy(yd,     256 - yd + tc0480scp->flip_yoffs);
3588   tc0480scp->tilemap[1][0]->set_scrolldx(xd,     320 - xd + tc0480scp->flip_xoffs);
3589   tc0480scp->tilemap[1][0]->set_scrolldy(yd,     256 - yd + tc0480scp->flip_yoffs);
3590   tc0480scp->tilemap[2][0]->set_scrolldx(xd,     320 - xd + tc0480scp->flip_xoffs);
3591   tc0480scp->tilemap[2][0]->set_scrolldy(yd,     256 - yd + tc0480scp->flip_yoffs);
3592   tc0480scp->tilemap[3][0]->set_scrolldx(xd,     320 - xd + tc0480scp->flip_xoffs);
3593   tc0480scp->tilemap[3][0]->set_scrolldy(yd,     256 - yd + tc0480scp->flip_yoffs);
3594   tc0480scp->tilemap[4][0]->set_scrolldx(xd - 3, 316 - xd);   /* text layer */
3595   tc0480scp->tilemap[4][0]->set_scrolldy(yd,     256 - yd);   /* text layer */
3596
3597   /* Double width offsets */
3598   tc0480scp->tilemap[0][1]->set_scrolldx(xd,     320 - xd + tc0480scp->flip_xoffs);
3599   tc0480scp->tilemap[0][1]->set_scrolldy(yd,     256 - yd + tc0480scp->flip_yoffs);
3600   tc0480scp->tilemap[1][1]->set_scrolldx(xd,     320 - xd + tc0480scp->flip_xoffs);
3601   tc0480scp->tilemap[1][1]->set_scrolldy(yd,     256 - yd + tc0480scp->flip_yoffs);
3602   tc0480scp->tilemap[2][1]->set_scrolldx(xd,     320 - xd + tc0480scp->flip_xoffs);
3603   tc0480scp->tilemap[2][1]->set_scrolldy(yd,     256 - yd + tc0480scp->flip_yoffs);
3604   tc0480scp->tilemap[3][1]->set_scrolldx(xd,     320 - xd + tc0480scp->flip_xoffs);
3605   tc0480scp->tilemap[3][1]->set_scrolldy(yd,     256 - yd + tc0480scp->flip_yoffs);
3606   tc0480scp->tilemap[4][1]->set_scrolldx(xd - 3, 317 - xd);   /* text layer */
3607   tc0480scp->tilemap[4][1]->set_scrolldy(yd,     256 - yd);   /* text layer */
3608
3609   for (i = 0; i < 2; i++)
3610   {
3611      /* Both sets of bg tilemaps scrollable per pixel row */
3612      tc0480scp->tilemap[0][i]->set_scroll_rows(512);
3613      tc0480scp->tilemap[1][i]->set_scroll_rows(512);
3614      tc0480scp->tilemap[2][i]->set_scroll_rows(512);
3615      tc0480scp->tilemap[3][i]->set_scroll_rows(512);
3616   }
3617
3618   tc0480scp->ram = auto_alloc_array_clear(machine(), UINT16, TC0480SCP_RAM_SIZE / 2);
3619
3620   tc0480scp_set_layer_ptrs(tc0480scp);
3621
3622   /* create the char set (gfx will then be updated dynamically from RAM) */
3623   machine().gfx[tc0480scp->tx_gfx] = auto_alloc(machine(), gfx_element(machine(), tc0480scp_charlayout, (UINT8 *)tc0480scp->char_ram, 64, 0));
3624
3625   save_pointer(NAME(tc0480scp->ram), TC0480SCP_RAM_SIZE / 2);
3626   save_item(NAME(tc0480scp->ctrl));
3627   save_item(NAME(tc0480scp->dblwidth));
3628   machine().save().register_postload(save_prepost_delegate(FUNC(tc0480scp_device::tc0480scp_postload), this));
36293631}
36303632
36313633//-------------------------------------------------
3632//  device_reset - device-specific reset
3634//  device_start - device-specific startup
36333635//-------------------------------------------------
36343636
3635void tc0480scp_device::device_reset()
3637void tc0150rod_device::device_start()
36363638{
3637   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(this);
3638   int i;
3639   m_ram = auto_alloc_array_clear(machine(), UINT16, TC0150ROD_RAM_SIZE / 2);
36393640
3640   tc0480scp->dblwidth = 0;
3641
3642   for (i = 0; i < 0x18; i++)
3643      tc0480scp->ctrl[i] = 0;
3644
3641   save_pointer(NAME(m_ram), TC0150ROD_RAM_SIZE / 2);
36453642}
36463643
36473644
3648/***************************************************************************/
3649/*                                                                         */
3650/*                              TC0150ROD                                  */
3651/*                                                                         */
3652/***************************************************************************/
3653
3654struct tc0150rod_state
3655{
3656   UINT16 *        ram;
3657
3658   const char      *gfx_region;    /* gfx region for the road */
3659};
3660
3661#define TC0150ROD_RAM_SIZE 0x2000
3662
36633645/*****************************************************************************
3664    INLINE FUNCTIONS
3665*****************************************************************************/
3666
3667INLINE tc0150rod_state *tc0150rod_get_safe_token( device_t *device )
3668{
3669   assert(device != NULL);
3670   assert(device->type() == TC0150ROD);
3671
3672   return (tc0150rod_state *)downcast<tc0150rod_device *>(device)->token();
3673}
3674
3675INLINE const tc0150rod_interface *tc0150rod_get_interface( device_t *device )
3676{
3677   assert(device != NULL);
3678   assert((device->type() == TC0150ROD));
3679   return (const tc0150rod_interface *) device->static_config();
3680}
3681
3682/*****************************************************************************
36833646    DEVICE HANDLERS
36843647*****************************************************************************/
36853648
3686READ16_DEVICE_HANDLER( tc0150rod_word_r )
3649READ16_MEMBER( tc0150rod_device::word_r )
36873650{
3688   tc0150rod_state *tc0150rod = tc0150rod_get_safe_token(device);
3689   return tc0150rod->ram[offset];
3651   return m_ram[offset];
36903652}
36913653
3692WRITE16_DEVICE_HANDLER( tc0150rod_word_w )
3654WRITE16_MEMBER( tc0150rod_device::word_w )
36933655{
3694   tc0150rod_state *tc0150rod = tc0150rod_get_safe_token(device);
3695   COMBINE_DATA(&tc0150rod->ram[offset]);
3656   COMBINE_DATA(&m_ram[offset]);
36963657}
36973658
36983659/******************************************************************************
r24008r24009
38583819
38593820******************************************************************************/
38603821
3861void tc0150rod_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs, int palette_offs, int type, int road_trans, UINT32 low_priority, UINT32 high_priority )
3822void tc0150rod_device::draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs, int palette_offs, int type, int road_trans, UINT32 low_priority, UINT32 high_priority )
38623823{
3863   tc0150rod_state *tc0150rod = tc0150rod_get_safe_token(device);
3864
3865#ifdef MAME_DEBUG
3824   #ifdef MAME_DEBUG
38663825   static int dislayer[6]; /* Road Layer toggles to help get road correct */
3867#endif
3826   #endif
38683827
38693828   int x_offs = 0xa7;  /* Increasing this shifts road to right */
38703829   UINT16 scanline[512];
38713830   UINT16 roada_line[512], roadb_line[512];
38723831   UINT16 *dst16;
38733832   UINT16 *roada, *roadb;
3874   UINT16 *roadgfx = (UINT16 *)device->machine().root_device().memregion(tc0150rod->gfx_region)->base();
3833   UINT16 *roadgfx = (UINT16 *)machine().root_device().memregion(m_gfx_region)->base();
38753834
38763835   UINT16 pixel, color, gfx_word;
38773836   UINT16 roada_clipl, roada_clipr, roada_bodyctrl;
r24008r24009
38813840   int x_index, roadram_index, roadram2_index, i;
38823841   int xoffset, paloffs, palloffs, palroffs;
38833842   int road_gfx_tilenum, colbank, road_center;
3884   int road_ctrl = tc0150rod->ram[0xfff];
3843   int road_ctrl = m_ram[0xfff];
38853844   int left_edge, right_edge, begin, end, right_over, left_over;
38863845   int line_needs_drawing, draw_top_road_line, background_only;
38873846
r24008r24009
39023861   int priority_switch_line = (road_ctrl & 0x00ff) - y_offs;
39033862
39043863#ifdef MAME_DEBUG
3905   if (device->machine().input().code_pressed_once (KEYCODE_X))
3864   if (machine().input().code_pressed_once (KEYCODE_X))
39063865   {
39073866      dislayer[0] ^= 1;
39083867      popmessage("RoadA body: %01x",dislayer[0]);
39093868   }
39103869
3911   if (device->machine().input().code_pressed_once (KEYCODE_C))
3870   if (machine().input().code_pressed_once (KEYCODE_C))
39123871   {
39133872      dislayer[1] ^= 1;
39143873      popmessage("RoadA l-edge: %01x",dislayer[1]);
39153874   }
39163875
3917   if (device->machine().input().code_pressed_once (KEYCODE_V))
3876   if (machine().input().code_pressed_once (KEYCODE_V))
39183877   {
39193878      dislayer[2] ^= 1;
39203879      popmessage("RoadA r-edge: %01x",dislayer[2]);
39213880   }
39223881
3923   if (device->machine().input().code_pressed_once (KEYCODE_B))
3882   if (machine().input().code_pressed_once (KEYCODE_B))
39243883   {
39253884      dislayer[3] ^= 1;
39263885      popmessage("RoadB body: %01x",dislayer[3]);
39273886   }
39283887
3929   if (device->machine().input().code_pressed_once (KEYCODE_N))
3888   if (machine().input().code_pressed_once (KEYCODE_N))
39303889   {
39313890      dislayer[4] ^= 1;
39323891      popmessage("RoadB l-edge: %01x",dislayer[4]);
39333892   }
3934   if (device->machine().input().code_pressed_once (KEYCODE_M))
3893   if (machine().input().code_pressed_once (KEYCODE_M))
39353894   {
39363895      dislayer[5] ^= 1;
39373896      popmessage("RoadB r-edge: %01x",dislayer[5]);
r24008r24009
39713930      priorities[4] = 3;
39723931      priorities[5] = 4;
39733932
3974      roada_clipr    = tc0150rod->ram[roadram_index];
3975      roada_clipl    = tc0150rod->ram[roadram_index + 1];
3976      roada_bodyctrl = tc0150rod->ram[roadram_index + 2];
3977      roadb_clipr    = tc0150rod->ram[roadram2_index];
3978      roadb_clipl    = tc0150rod->ram[roadram2_index + 1];
3979      roadb_bodyctrl = tc0150rod->ram[roadram2_index + 2];
3933      roada_clipr    = m_ram[roadram_index];
3934      roada_clipl    = m_ram[roadram_index + 1];
3935      roada_bodyctrl = m_ram[roadram_index + 2];
3936      roadb_clipr    = m_ram[roadram2_index];
3937      roadb_clipl    = m_ram[roadram2_index + 1];
3938      roadb_bodyctrl = m_ram[roadram2_index + 2];
39803939
39813940      /* Not very logical, but seems to work */
39823941      if (roada_bodyctrl & 0x2000)    priorities[2] += 2;
r24008r24009
40013960      palloffs =(roada_clipl & 0x1000) >> 11;
40023961      xoffset  = roada_bodyctrl & 0x7ff;
40033962      paloffs  =(roada_bodyctrl & 0x1800) >> 11;
4004      colbank  =(tc0150rod->ram[roadram_index + 3] & 0xf000) >> 10;
4005      road_gfx_tilenum = tc0150rod->ram[roadram_index + 3] & 0x3ff;
3963      colbank  =(m_ram[roadram_index + 3] & 0xf000) >> 10;
3964      road_gfx_tilenum = m_ram[roadram_index + 3] & 0x3ff;
40063965      right_over = 0;
40073966      left_over = 0;
40083967
r24008r24009
41904149      palloffs = (roadb_clipl & 0x1000) >> 11;
41914150      xoffset  =  roadb_bodyctrl & 0x7ff;
41924151      paloffs  = (roadb_bodyctrl & 0x1800) >> 11;
4193      colbank  = (tc0150rod->ram[roadram2_index + 3] & 0xf000) >> 10;
4194      road_gfx_tilenum = tc0150rod->ram[roadram2_index + 3] & 0x3ff;
4152      colbank  = (m_ram[roadram2_index + 3] & 0xf000) >> 10;
4153      road_gfx_tilenum = m_ram[roadram2_index + 3] & 0x3ff;
41954154      right_over = 0;
41964155      left_over = 0;
41974156
r24008r24009
44184377            }
44194378         }
44204379
4421         taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, 1, ROT0, device->machine().priority_bitmap, (y > priority_switch_line) ? high_priority : low_priority);
4380         taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, 1, ROT0, machine().priority_bitmap, (y > priority_switch_line) ? high_priority : low_priority);
44224381      }
44234382
44244383      y++;
r24008r24009
44354394#endif
44364395}
44374396
4438/*****************************************************************************
4439    DEVICE INTERFACE
4440*****************************************************************************/
44414397
4442static DEVICE_START( tc0150rod )
4443{
4444   tc0150rod_state *tc0150rod = tc0150rod_get_safe_token(device);
4445   const tc0150rod_interface *intf = tc0150rod_get_interface(device);
4398/***************************************************************************/
4399/*                                                                         */
4400/*                              TC0110PCR                                  */
4401/*                                                                         */
4402/***************************************************************************/
44464403
4447   tc0150rod->gfx_region = intf->gfx_region;
4404#define TC0110PCR_RAM_SIZE 0x2000
44484405
4449   tc0150rod->ram = auto_alloc_array(device->machine(), UINT16, TC0150ROD_RAM_SIZE / 2);
44504406
4451   device->save_pointer(NAME(tc0150rod->ram), TC0150ROD_RAM_SIZE / 2);
4407const device_type TC0110PCR = &device_creator<tc0110pcr_device>;
44524408
4453}
4454
4455const device_type TC0150ROD = &device_creator<tc0150rod_device>;
4456
4457tc0150rod_device::tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
4458   : device_t(mconfig, TC0150ROD, "Taito TC0150ROD", tag, owner, clock, "tc0150rod", __FILE__)
4409tc0110pcr_device::tc0110pcr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
4410   : device_t(mconfig, TC0110PCR, "Taito TC0110PCR", tag, owner, clock, "tc0110pcr", __FILE__),
4411      m_ram(NULL),
4412      m_type(0),
4413      m_addr(0)
44594414{
4460   m_token = global_alloc_clear(tc0150rod_state);
44614415}
44624416
44634417//-------------------------------------------------
r24008r24009
44664420//  complete
44674421//-------------------------------------------------
44684422
4469void tc0150rod_device::device_config_complete()
4423void tc0110pcr_device::device_config_complete()
44704424{
4425   // inherit a copy of the static data
4426   const tc0110pcr_interface *intf = reinterpret_cast<const tc0110pcr_interface *>(static_config());
4427   if (intf != NULL)
4428   *static_cast<tc0110pcr_interface *>(this) = *intf;
4429   
4430   // or initialize to defaults if none provided
4431   else
4432   {
4433   }
44714434}
44724435
44734436//-------------------------------------------------
44744437//  device_start - device-specific startup
44754438//-------------------------------------------------
44764439
4477void tc0150rod_device::device_start()
4440void tc0110pcr_device::device_start()
44784441{
4479   DEVICE_START_NAME( tc0150rod )(this);
4480}
4442   m_ram = auto_alloc_array_clear(machine(), UINT16, TC0110PCR_RAM_SIZE);
44814443
4444   save_pointer(NAME(m_ram), TC0110PCR_RAM_SIZE);
4445   save_item(NAME(m_type));
4446   machine().save().register_postload(save_prepost_delegate(FUNC(tc0110pcr_device::restore_colors), this));
44824447
4483/***************************************************************************/
4484/*                                                                         */
4485/*                              TC0110PCR                                  */
4486/*                                                                         */
4487/***************************************************************************/
4448}
44884449
4489struct tc0110pcr_state
4490{
4491   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
4492   UINT16 *     ram;
4493   int          type;
4494   int          addr;
4495   int          pal_offs;
4496   running_machine *m_machine;
4497};
4450//-------------------------------------------------
4451//  device_reset - device-specific reset
4452//-------------------------------------------------
44984453
4499#define TC0110PCR_RAM_SIZE 0x2000
4500
4501/*****************************************************************************
4502    INLINE FUNCTIONS
4503*****************************************************************************/
4504
4505INLINE tc0110pcr_state *tc0110pcr_get_safe_token( device_t *device )
4454void tc0110pcr_device::device_reset()
45064455{
4507   assert(device != NULL);
4508   assert(device->type() == TC0110PCR);
4509
4510   return (tc0110pcr_state *)downcast<tc0110pcr_device *>(device)->token();
4456   m_type = 0;    /* default, xBBBBBGGGGGRRRRR */
45114457}
45124458
4513INLINE const tc0110pcr_interface *tc0110pcr_get_interface( device_t *device )
4514{
4515   assert(device != NULL);
4516   assert((device->type() == TC0110PCR));
4517   return (const tc0110pcr_interface *) device->static_config();
4518}
4519
45204459/*****************************************************************************
45214460    DEVICE HANDLERS
45224461*****************************************************************************/
45234462
4524void tc0110pcr_device::tc0110pcr_restore_colors()
4463void tc0110pcr_device::restore_colors()
45254464{
4526   tc0110pcr_state *tc0110pcr = tc0110pcr_get_safe_token(this);
4527
45284465   int i, color, r = 0, g = 0, b = 0;
45294466
45304467   for (i = 0; i < (256 * 16); i++)
45314468   {
4532      color = tc0110pcr->ram[i];
4469      color = m_ram[i];
45334470
4534      switch (tc0110pcr->type)
4471      switch (m_type)
45354472      {
45364473         case 0x00:
45374474         {
r24008r24009
45584495         }
45594496      }
45604497
4561      palette_set_color(tc0110pcr->machine(), i + (tc0110pcr->pal_offs << 12), MAKE_RGB(r, g, b));
4498      palette_set_color(machine(), i + (m_pal_offs << 12), MAKE_RGB(r, g, b));
45624499   }
45634500}
45644501
45654502
4566READ16_DEVICE_HANDLER( tc0110pcr_word_r )
4503READ16_MEMBER(tc0110pcr_device::word_r )
45674504{
4568   tc0110pcr_state *tc0110pcr = tc0110pcr_get_safe_token(device);
4569
45704505   switch (offset)
45714506   {
45724507      case 1:
4573         return tc0110pcr->ram[tc0110pcr->addr];
4508         return m_ram[m_addr];
45744509
45754510      default:
45764511//logerror("PC %06x: warning - read TC0110PCR address %02x\n",space.device().safe_pc(),offset);
r24008r24009
45784513   }
45794514}
45804515
4581WRITE16_DEVICE_HANDLER( tc0110pcr_word_w )
4516WRITE16_MEMBER(tc0110pcr_device::word_w )
45824517{
4583   tc0110pcr_state *tc0110pcr = tc0110pcr_get_safe_token(device);
4584
45854518   switch (offset)
45864519   {
45874520      case 0:
45884521         /* In test mode game writes to odd register number so (data>>1) */
4589         tc0110pcr->addr = (data >> 1) & 0xfff;
4522         m_addr = (data >> 1) & 0xfff;
45904523         if (data > 0x1fff)
45914524            logerror ("Write to palette index > 0x1fff\n");
45924525         break;
45934526
45944527      case 1:
4595         tc0110pcr->ram[tc0110pcr->addr] = data & 0xffff;
4596         palette_set_color_rgb(space.machine(), tc0110pcr->addr, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
4528         m_ram[m_addr] = data & 0xffff;
4529         palette_set_color_rgb(space.machine(), m_addr, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
45974530         break;
45984531
45994532      default:
r24008r24009
46024535   }
46034536}
46044537
4605WRITE16_DEVICE_HANDLER( tc0110pcr_step1_word_w )
4538WRITE16_MEMBER(tc0110pcr_device::step1_word_w )
46064539{
4607   tc0110pcr_state *tc0110pcr = tc0110pcr_get_safe_token(device);
4608
46094540   switch (offset)
46104541   {
46114542      case 0:
4612         tc0110pcr->addr = data & 0xfff;
4543         m_addr = data & 0xfff;
46134544         if (data > 0xfff)
4614            logerror ("Write to palette index (color area %d) > 0xfff\n", tc0110pcr->pal_offs);
4545            logerror ("Write to palette index (color area %d) > 0xfff\n", m_pal_offs);
46154546         break;
46164547
46174548      case 1:
4618         tc0110pcr->ram[tc0110pcr->addr] = data & 0xffff;
4619         palette_set_color_rgb(space.machine(), tc0110pcr->addr + (tc0110pcr->pal_offs << 12), pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
4549         m_ram[m_addr] = data & 0xffff;
4550         palette_set_color_rgb(space.machine(), m_addr + (m_pal_offs << 12), pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
46204551         break;
46214552
46224553      default:
r24008r24009
46254556   }
46264557}
46274558
4628WRITE16_DEVICE_HANDLER( tc0110pcr_step1_rbswap_word_w )
4559WRITE16_MEMBER(tc0110pcr_device::step1_rbswap_word_w )
46294560{
4630   tc0110pcr_state *tc0110pcr = tc0110pcr_get_safe_token(device);
4561   m_type = 1;    /* xRRRRRGGGGGBBBBB */
46314562
4632   tc0110pcr->type = 1;    /* xRRRRRGGGGGBBBBB */
4633
46344563   switch (offset)
46354564   {
46364565      case 0:
4637         tc0110pcr->addr = data & 0xfff;
4566         m_addr = data & 0xfff;
46384567         if (data > 0xfff)
46394568            logerror ("Write to palette index > 0xfff\n");
46404569         break;
46414570
46424571      case 1:
4643         tc0110pcr->ram[tc0110pcr->addr] = data & 0xffff;
4644         palette_set_color_rgb(space.machine(), tc0110pcr->addr, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
4572         m_ram[m_addr] = data & 0xffff;
4573         palette_set_color_rgb(space.machine(), m_addr, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
46454574         break;
46464575
46474576      default:
r24008r24009
46504579   }
46514580}
46524581
4653WRITE16_DEVICE_HANDLER( tc0110pcr_step1_4bpg_word_w )
4582WRITE16_MEMBER(tc0110pcr_device::step1_4bpg_word_w )
46544583{
4655   tc0110pcr_state *tc0110pcr = tc0110pcr_get_safe_token(device);
4584   m_type = 2;    /* xxxxBBBBGGGGRRRR */
46564585
4657   tc0110pcr->type = 2;    /* xxxxBBBBGGGGRRRR */
4658
46594586   switch (offset)
46604587   {
46614588      case 0:
4662         tc0110pcr->addr = data & 0xfff;
4589         m_addr = data & 0xfff;
46634590         if (data > 0xfff)
46644591            logerror ("Write to palette index > 0xfff\n");
46654592         break;
46664593
46674594      case 1:
4668         tc0110pcr->ram[tc0110pcr->addr] = data & 0xffff;
4669         palette_set_color_rgb(space.machine(), tc0110pcr->addr, pal4bit(data >> 0), pal4bit(data >> 4), pal4bit(data >> 8));
4595         m_ram[m_addr] = data & 0xffff;
4596         palette_set_color_rgb(space.machine(), m_addr, pal4bit(data >> 0), pal4bit(data >> 4), pal4bit(data >> 8));
46704597         break;
46714598
46724599      default:
r24008r24009
46754602   }
46764603}
46774604
4678/*****************************************************************************
4679    DEVICE INTERFACE
4680*****************************************************************************/
46814605
4682const device_type TC0110PCR = &device_creator<tc0110pcr_device>;
46834606
4684tc0110pcr_device::tc0110pcr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
4685   : device_t(mconfig, TC0110PCR, "Taito TC0110PCR", tag, owner, clock, "tc0110pcr", __FILE__)
4607/***************************************************************************/
4608/*                                                                         */
4609/*                                TC0180VCU                                */
4610/*                                                                         */
4611/***************************************************************************/
4612
4613
4614#define TC0180VCU_RAM_SIZE          0x10000
4615#define TC0180VCU_SCROLLRAM_SIZE    0x0800
4616
4617
4618const device_type TC0180VCU = &device_creator<tc0180vcu_device>;
4619
4620tc0180vcu_device::tc0180vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
4621   : device_t(mconfig, TC0180VCU, "Taito TC0180VCU", tag, owner, clock, "tc0180vcu", __FILE__),
4622   m_ram(NULL),
4623   //m_scrollram(NULL),
4624   //m_bg_rambank(0),
4625   //m_fg_rambank(0),
4626   //m_tx_rambank(0),
4627   m_framebuffer_page(0),
4628   m_video_control(0)
46864629{
4687   m_token = global_alloc_clear(tc0110pcr_state);
46884630}
46894631
46904632//-------------------------------------------------
r24008r24009
46934635//  complete
46944636//-------------------------------------------------
46954637
4696void tc0110pcr_device::device_config_complete()
4638void tc0180vcu_device::device_config_complete()
46974639{
4640   // inherit a copy of the static data
4641   const tc0180vcu_interface *intf = reinterpret_cast<const tc0180vcu_interface *>(static_config());
4642   if (intf != NULL)
4643   *static_cast<tc0180vcu_interface *>(this) = *intf;
4644   
4645   // or initialize to defaults if none provided
4646   else
4647   {
4648   }
46984649}
46994650
47004651//-------------------------------------------------
47014652//  device_start - device-specific startup
47024653//-------------------------------------------------
47034654
4704void tc0110pcr_device::device_start()
4655void tc0180vcu_device::device_start()
47054656{
4706   tc0110pcr_state *tc0110pcr = tc0110pcr_get_safe_token(this);
4707   const tc0110pcr_interface *intf = tc0110pcr_get_interface(this);
4657   m_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0180vcu_device::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
4658   m_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0180vcu_device::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
4659   m_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0180vcu_device::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
47084660
4709   tc0110pcr->m_machine = &machine();
4661   m_tilemap[1]->set_transparent_pen(0);
4662   m_tilemap[2]->set_transparent_pen(0);
47104663
4711   tc0110pcr->pal_offs = intf->pal_offs;
4664   m_tilemap[0]->set_scrolldx(0, 24 * 8);
4665   m_tilemap[1]->set_scrolldx(0, 24 * 8);
4666   m_tilemap[2]->set_scrolldx(0, 24 * 8);
47124667
4713   tc0110pcr->ram = auto_alloc_array(machine(), UINT16, TC0110PCR_RAM_SIZE);
4668   m_ram = auto_alloc_array_clear(machine(), UINT16, TC0180VCU_RAM_SIZE / 2);
4669   m_scrollram = auto_alloc_array_clear(machine(), UINT16, TC0180VCU_SCROLLRAM_SIZE / 2);
47144670
4715   save_pointer(NAME(tc0110pcr->ram), TC0110PCR_RAM_SIZE);
4716   save_item(NAME(tc0110pcr->type));
4717   machine().save().register_postload(save_prepost_delegate(FUNC(tc0110pcr_device::tc0110pcr_restore_colors), this));
4671   save_pointer(NAME(m_ram), TC0180VCU_RAM_SIZE / 2);
4672   save_pointer(NAME(m_scrollram), TC0180VCU_SCROLLRAM_SIZE / 2);
47184673
4674   save_item(NAME(m_bg_rambank));
4675   save_item(NAME(m_fg_rambank));
4676   save_item(NAME(m_tx_rambank));
4677
4678   save_item(NAME(m_framebuffer_page));
4679
4680   save_item(NAME(m_video_control));
4681   save_item(NAME(m_ctrl));
47194682}
47204683
47214684//-------------------------------------------------
47224685//  device_reset - device-specific reset
47234686//-------------------------------------------------
47244687
4725void tc0110pcr_device::device_reset()
4688void tc0180vcu_device::device_reset()
47264689{
4727   tc0110pcr_state *tc0110pcr =  tc0110pcr_get_safe_token(this);
4728   tc0110pcr->type = 0;    /* default, xBBBBBGGGGGRRRRR */
4729}
4690   int i;
47304691
4692   for (i = 0; i < 0x10; i++)
4693      m_ctrl[i] = 0;
47314694
4732/***************************************************************************/
4733/*                                                                         */
4734/*                                TC0180VCU                                */
4735/*                                                                         */
4736/***************************************************************************/
4695   m_bg_rambank[0] = 0;
4696   m_bg_rambank[1] = 0;
4697   m_fg_rambank[0] = 0;
4698   m_fg_rambank[1] = 0;
4699   m_tx_rambank = 0;
47374700
4738struct tc0180vcu_state
4739{
4740   UINT16         ctrl[0x10];
4741
4742   UINT16 *       ram;
4743   UINT16 *       scrollram;
4744
4745   tilemap_t        *tilemap[3];
4746
4747   UINT16         bg_rambank[2], fg_rambank[2], tx_rambank;
4748   UINT8          framebuffer_page;
4749   UINT8          video_control;
4750
4751   int            bg_color_base;
4752   int            fg_color_base;
4753   int            tx_color_base;
4754};
4755
4756#define TC0180VCU_RAM_SIZE          0x10000
4757#define TC0180VCU_SCROLLRAM_SIZE    0x0800
4758
4759/*****************************************************************************
4760    INLINE FUNCTIONS
4761*****************************************************************************/
4762
4763INLINE tc0180vcu_state *tc0180vcu_get_safe_token( device_t *device )
4764{
4765   assert(device != NULL);
4766   assert(device->type() == TC0180VCU);
4767
4768   return (tc0180vcu_state *)downcast<tc0180vcu_device *>(device)->token();
4701   m_framebuffer_page = 0;
4702   m_video_control = 0;
47694703}
47704704
4771INLINE const tc0180vcu_interface *tc0180vcu_get_interface( device_t *device )
4772{
4773   assert(device != NULL);
4774   assert((device->type() == TC0180VCU));
4775   return (const tc0180vcu_interface *) device->static_config();
4776}
47774705
47784706/*****************************************************************************
47794707    DEVICE HANDLERS
r24008r24009
48224750*
48234751*/
48244752
4825READ8_DEVICE_HANDLER( tc0180vcu_get_fb_page )
4753READ8_MEMBER( tc0180vcu_device::get_fb_page )
48264754{
4827   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
4828   return tc0180vcu->framebuffer_page;
4755   return m_framebuffer_page;
48294756}
48304757
4831WRITE8_DEVICE_HANDLER( tc0180vcu_set_fb_page )
4758WRITE8_MEMBER( tc0180vcu_device::set_fb_page )
48324759{
4833   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
4834   tc0180vcu->framebuffer_page = data;
4760   m_framebuffer_page = data;
48354761}
48364762
4837READ8_DEVICE_HANDLER( tc0180vcu_get_videoctrl )
4763READ8_MEMBER( tc0180vcu_device::get_videoctrl )
48384764{
4839   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
4840   return tc0180vcu->video_control;
4765   return m_video_control;
48414766}
48424767
4843static void tc0180vcu_video_control( device_t *device, UINT8 data )
4768void tc0180vcu_device::video_control( UINT8 data )
48444769{
4845   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
48464770#if 0
4847   if (data != tc0180vcu->video_control)
4771   if (data != m_video_control)
48484772      popmessage("video control = %02x", data);
48494773#endif
48504774
4851   tc0180vcu->video_control = data;
4775   m_video_control = data;
48524776
4853   if (tc0180vcu->video_control & 0x80)
4854      tc0180vcu->framebuffer_page = (~tc0180vcu->video_control & 0x40) >> 6;
4777   if (m_video_control & 0x80)
4778      m_framebuffer_page = (~m_video_control & 0x40) >> 6;
48554779
4856   device->machine().tilemap().set_flip_all((tc0180vcu->video_control & 0x10) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0 );
4780   machine().tilemap().set_flip_all((m_video_control & 0x10) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0 );
48574781}
48584782
4859READ16_DEVICE_HANDLER( tc0180vcu_ctrl_r )
4783READ16_MEMBER( tc0180vcu_device::ctrl_r )
48604784{
4861   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
4862   return tc0180vcu->ctrl[offset];
4785   return m_ctrl[offset];
48634786}
48644787
4865WRITE16_DEVICE_HANDLER( tc0180vcu_ctrl_w )
4788WRITE16_MEMBER( tc0180vcu_device::ctrl_w )
48664789{
4867   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
4868   UINT16 oldword = tc0180vcu->ctrl[offset];
4790   UINT16 oldword = m_ctrl[offset];
48694791
4870   COMBINE_DATA (&tc0180vcu->ctrl[offset]);
4792   COMBINE_DATA (&m_ctrl[offset]);
48714793
4872   if (oldword != tc0180vcu->ctrl[offset])
4794   if (oldword != m_ctrl[offset])
48734795   {
48744796      if (ACCESSING_BITS_8_15)
48754797      {
48764798         switch(offset)
48774799         {
48784800         case 0:
4879            tc0180vcu->tilemap[1]->mark_all_dirty();
4880            tc0180vcu->fg_rambank[0] = (((tc0180vcu->ctrl[offset] >> 8) & 0x0f) << 12);
4881            tc0180vcu->fg_rambank[1] = (((tc0180vcu->ctrl[offset] >> 12) & 0x0f) << 12);
4801            m_tilemap[1]->mark_all_dirty();
4802            m_fg_rambank[0] = (((m_ctrl[offset] >> 8) & 0x0f) << 12);
4803            m_fg_rambank[1] = (((m_ctrl[offset] >> 12) & 0x0f) << 12);
48824804            break;
48834805         case 1:
4884            tc0180vcu->tilemap[0]->mark_all_dirty();
4885            tc0180vcu->bg_rambank[0] = (((tc0180vcu->ctrl[offset] >> 8) & 0x0f) << 12);
4886            tc0180vcu->bg_rambank[1] = (((tc0180vcu->ctrl[offset] >> 12) & 0x0f) << 12);
4806            m_tilemap[0]->mark_all_dirty();
4807            m_bg_rambank[0] = (((m_ctrl[offset] >> 8) & 0x0f) << 12);
4808            m_bg_rambank[1] = (((m_ctrl[offset] >> 12) & 0x0f) << 12);
48874809            break;
48884810         case 4:
48894811         case 5:
4890            tc0180vcu->tilemap[2]->mark_all_dirty();
4812            m_tilemap[2]->mark_all_dirty();
48914813            break;
48924814         case 6:
4893            tc0180vcu->tilemap[2]->mark_all_dirty();
4894            tc0180vcu->tx_rambank = (((tc0180vcu->ctrl[offset] >> 8) & 0x0f) << 11);
4815            m_tilemap[2]->mark_all_dirty();
4816            m_tx_rambank = (((m_ctrl[offset] >> 8) & 0x0f) << 11);
48954817            break;
48964818         case 7:
4897            tc0180vcu_video_control(device, (tc0180vcu->ctrl[offset] >> 8) & 0xff);
4819            video_control((m_ctrl[offset] >> 8) & 0xff);
48984820            break;
48994821         default:
49004822            break;
r24008r24009
49054827
49064828TILE_GET_INFO_MEMBER(tc0180vcu_device::get_bg_tile_info)
49074829{
4908   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(this);
4909   int tile  = tc0180vcu->ram[tile_index + tc0180vcu->bg_rambank[0]];
4910   int color = tc0180vcu->ram[tile_index + tc0180vcu->bg_rambank[1]];
4830   int tile  = m_ram[tile_index + m_bg_rambank[0]];
4831   int color = m_ram[tile_index + m_bg_rambank[1]];
49114832
49124833   SET_TILE_INFO_MEMBER(
49134834      1,
49144835      tile,
4915      tc0180vcu->bg_color_base + (color & 0x3f),
4836      m_bg_color_base + (color & 0x3f),
49164837      TILE_FLIPYX((color & 0x00c0) >> 6));
49174838}
49184839
49194840TILE_GET_INFO_MEMBER(tc0180vcu_device::get_fg_tile_info)
49204841{
4921   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(this);
4922   int tile  = tc0180vcu->ram[tile_index + tc0180vcu->fg_rambank[0]];
4923   int color = tc0180vcu->ram[tile_index + tc0180vcu->fg_rambank[1]];
4842   int tile  = m_ram[tile_index + m_fg_rambank[0]];
4843   int color = m_ram[tile_index + m_fg_rambank[1]];
49244844
49254845   SET_TILE_INFO_MEMBER(
49264846      1,
49274847      tile,
4928      tc0180vcu->fg_color_base + (color & 0x3f),
4848      m_fg_color_base + (color & 0x3f),
49294849      TILE_FLIPYX((color & 0x00c0) >> 6));
49304850}
49314851
49324852TILE_GET_INFO_MEMBER(tc0180vcu_device::get_tx_tile_info)
49334853{
4934   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(this);
4935   int tile = tc0180vcu->ram[tile_index + tc0180vcu->tx_rambank];
4854   int tile = m_ram[tile_index + m_tx_rambank];
49364855
49374856   SET_TILE_INFO_MEMBER(
49384857      0,
4939      (tile & 0x07ff) | ((tc0180vcu->ctrl[4 + ((tile & 0x800) >> 11)]>>8) << 11),
4940      tc0180vcu->tx_color_base + ((tile >> 12) & 0x0f),
4858      (tile & 0x07ff) | ((m_ctrl[4 + ((tile & 0x800) >> 11)]>>8) << 11),
4859      m_tx_color_base + ((tile >> 12) & 0x0f),
49414860      0);
49424861}
49434862
4944READ16_DEVICE_HANDLER( tc0180vcu_scroll_r )
4863READ16_MEMBER( tc0180vcu_device::scroll_r )
49454864{
4946   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
4947   return tc0180vcu->scrollram[offset];
4865   return m_scrollram[offset];
49484866}
49494867
4950WRITE16_DEVICE_HANDLER( tc0180vcu_scroll_w )
4868WRITE16_MEMBER( tc0180vcu_device::scroll_w )
49514869{
4952   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
4953   COMBINE_DATA(&tc0180vcu->scrollram[offset]);
4870   COMBINE_DATA(&m_scrollram[offset]);
49544871}
49554872
4956READ16_DEVICE_HANDLER( tc0180vcu_word_r )
4873READ16_MEMBER( tc0180vcu_device::word_r )
49574874{
4958   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
4959   return tc0180vcu->ram[offset];
4875   return m_ram[offset];
49604876}
49614877
4962WRITE16_DEVICE_HANDLER( tc0180vcu_word_w )
4878WRITE16_MEMBER( tc0180vcu_device::word_w )
49634879{
4964   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
4965   COMBINE_DATA(&tc0180vcu->ram[offset]);
4880   COMBINE_DATA(&m_ram[offset]);
49664881
4967   if ((offset & 0x7000) == tc0180vcu->fg_rambank[0] || (offset & 0x7000) == tc0180vcu->fg_rambank[1])
4968      tc0180vcu->tilemap[1]->mark_tile_dirty(offset & 0x0fff);
4882   if ((offset & 0x7000) == m_fg_rambank[0] || (offset & 0x7000) == m_fg_rambank[1])
4883      m_tilemap[1]->mark_tile_dirty(offset & 0x0fff);
49694884
4970   if ((offset & 0x7000) == tc0180vcu->bg_rambank[0] || (offset & 0x7000) == tc0180vcu->bg_rambank[1])
4971      tc0180vcu->tilemap[0]->mark_tile_dirty(offset & 0x0fff);
4885   if ((offset & 0x7000) == m_bg_rambank[0] || (offset & 0x7000) == m_bg_rambank[1])
4886      m_tilemap[0]->mark_tile_dirty(offset & 0x0fff);
49724887
4973   if ((offset & 0x7800) == tc0180vcu->tx_rambank)
4974      tc0180vcu->tilemap[2]->mark_tile_dirty(offset & 0x7ff);
4888   if ((offset & 0x7800) == m_tx_rambank)
4889      m_tilemap[2]->mark_tile_dirty(offset & 0x7ff);
49754890}
49764891
4977void tc0180vcu_tilemap_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int tmap_num, int plane )
4892void tc0180vcu_device::tilemap_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int tmap_num, int plane )
49784893{
4979   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
4980
49814894   assert(tmap_num < 3);
49824895
49834896   if (tmap_num == 2)
4984      tc0180vcu->tilemap[2]->draw(bitmap, cliprect, 0, 0);    /* not much to do for tx_tilemap */
4897      m_tilemap[2]->draw(bitmap, cliprect, 0, 0);    /* not much to do for tx_tilemap */
49854898   else
49864899   {
49874900      /*plane = 0 fg tilemap*/
r24008r24009
49924905      int lines_per_block;    /* number of lines scrolled by the same amount (per one scroll value) */
49934906      int number_of_blocks;   /* number of such blocks per _screen_ (256 lines) */
49944907
4995      lines_per_block = 256 - (tc0180vcu->ctrl[2 + plane] >> 8);
4908      lines_per_block = 256 - (m_ctrl[2 + plane] >> 8);
49964909      number_of_blocks = 256 / lines_per_block;
49974910
49984911      my_clip.min_x = cliprect.min_x;
r24008r24009
50004913
50014914      for (i = 0; i < number_of_blocks; i++)
50024915      {
5003         scrollx = tc0180vcu->scrollram[plane * 0x200 + i * 2 * lines_per_block];
5004         scrolly = tc0180vcu->scrollram[plane * 0x200 + i * 2 * lines_per_block + 1];
4916         scrollx = m_scrollram[plane * 0x200 + i * 2 * lines_per_block];
4917         scrolly = m_scrollram[plane * 0x200 + i * 2 * lines_per_block + 1];
50054918
50064919         my_clip.min_y = i * lines_per_block;
50074920         my_clip.max_y = (i + 1) * lines_per_block - 1;
50084921
5009         if (tc0180vcu->video_control & 0x10)   /*flip screen*/
4922         if (m_video_control & 0x10)   /*flip screen*/
50104923         {
50114924            my_clip.min_y = bitmap.height() - 1 - (i + 1) * lines_per_block - 1;
50124925            my_clip.max_y = bitmap.height() - 1 - i * lines_per_block;
r24008r24009
50164929
50174930         if (my_clip.min_y <= my_clip.max_y)
50184931         {
5019            tc0180vcu->tilemap[tmap_num]->set_scrollx(0, -scrollx);
5020            tc0180vcu->tilemap[tmap_num]->set_scrolly(0, -scrolly);
5021            tc0180vcu->tilemap[tmap_num]->draw(bitmap, my_clip, 0, 0);
4932            m_tilemap[tmap_num]->set_scrollx(0, -scrollx);
4933            m_tilemap[tmap_num]->set_scrolly(0, -scrolly);
4934            m_tilemap[tmap_num]->draw(bitmap, my_clip, 0, 0);
50224935         }
50234936      }
50244937   }
50254938}
5026
5027const device_type TC0180VCU = &device_creator<tc0180vcu_device>;
5028
5029tc0180vcu_device::tc0180vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5030   : device_t(mconfig, TC0180VCU, "Taito TC0180VCU", tag, owner, clock, "tc0180vcu", __FILE__)
5031{
5032   m_token = global_alloc_clear(tc0180vcu_state);
5033}
5034
5035//-------------------------------------------------
5036//  device_config_complete - perform any
5037//  operations now that the configuration is
5038//  complete
5039//-------------------------------------------------
5040
5041void tc0180vcu_device::device_config_complete()
5042{
5043}
5044
5045//-------------------------------------------------
5046//  device_start - device-specific startup
5047//-------------------------------------------------
5048
5049void tc0180vcu_device::device_start()
5050{
5051   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(this);
5052   const tc0180vcu_interface *intf = tc0180vcu_get_interface(this);
5053
5054   tc0180vcu->bg_color_base = intf->bg_color_base;
5055   tc0180vcu->fg_color_base = intf->fg_color_base;
5056   tc0180vcu->tx_color_base = intf->tx_color_base;
5057
5058   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);
5059   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);
5060   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);
5061
5062   tc0180vcu->tilemap[1]->set_transparent_pen(0);
5063   tc0180vcu->tilemap[2]->set_transparent_pen(0);
5064
5065   tc0180vcu->tilemap[0]->set_scrolldx(0, 24 * 8);
5066   tc0180vcu->tilemap[1]->set_scrolldx(0, 24 * 8);
5067   tc0180vcu->tilemap[2]->set_scrolldx(0, 24 * 8);
5068
5069   tc0180vcu->ram = auto_alloc_array_clear(machine(), UINT16, TC0180VCU_RAM_SIZE / 2);
5070   tc0180vcu->scrollram = auto_alloc_array_clear(machine(), UINT16, TC0180VCU_SCROLLRAM_SIZE / 2);
5071
5072   save_pointer(NAME(tc0180vcu->ram), TC0180VCU_RAM_SIZE / 2);
5073   save_pointer(NAME(tc0180vcu->scrollram), TC0180VCU_SCROLLRAM_SIZE / 2);
5074
5075   save_item(NAME(tc0180vcu->bg_rambank));
5076   save_item(NAME(tc0180vcu->fg_rambank));
5077   save_item(NAME(tc0180vcu->tx_rambank));
5078
5079   save_item(NAME(tc0180vcu->framebuffer_page));
5080
5081   save_item(NAME(tc0180vcu->video_control));
5082   save_item(NAME(tc0180vcu->ctrl));
5083}
5084
5085//-------------------------------------------------
5086//  device_reset - device-specific reset
5087//-------------------------------------------------
5088
5089void tc0180vcu_device::device_reset()
5090{
5091   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(this);
5092   int i;
5093
5094   for (i = 0; i < 0x10; i++)
5095      tc0180vcu->ctrl[i] = 0;
5096
5097   tc0180vcu->bg_rambank[0] = 0;
5098   tc0180vcu->bg_rambank[1] = 0;
5099   tc0180vcu->fg_rambank[0] = 0;
5100   tc0180vcu->fg_rambank[1] = 0;
5101   tc0180vcu->tx_rambank = 0;
5102
5103   tc0180vcu->framebuffer_page = 0;
5104   tc0180vcu->video_control = 0;
5105}
trunk/src/mame/video/taitoic.h
r24008r24009
99#ifndef _TAITOIC_H_
1010#define _TAITOIC_H_
1111
12#include "devlegcy.h"
13
1412/***************************************************************************
1513    TYPE DEFINITIONS
1614***************************************************************************/
r24008r24009
6967
7068struct tc0480scp_interface
7169{
72   int                gfxnum;
73   int                txnum;
70   int                m_gfxnum;
71   int                m_txnum;
7472
75   int                pixels;
73   int                m_pixels;
7674
77   int                x_offset, y_offset;
78   int                text_xoffs, text_yoffs;
79   int                flip_xoffs, flip_yoffs;
75   int                m_x_offset, m_y_offset;
76   int                m_text_xoffs, m_text_yoffs;
77   int                m_flip_xoffs, m_flip_yoffs;
8078
81   int                col_base;
79   int                m_col_base;
8280};
8381
8482
8583struct tc0150rod_interface
8684{
87   const char      *gfx_region;    /* gfx region for the road */
85   const char      *m_gfx_region;    /* gfx region for the road */
8886};
8987
9088
9189struct tc0110pcr_interface
9290{
93   int               pal_offs;
91   int               m_pal_offs;
9492};
9593
9694struct tc0180vcu_interface
9795{
98   int            bg_color_base;
99   int            fg_color_base;
100   int            tx_color_base;
96   int            m_bg_color_base;
97   int            m_fg_color_base;
98   int            m_tx_color_base;
10199};
102100
103101class pc080sn_device : public device_t,
r24008r24009
411409
412410extern const device_type TC0360PRI;
413411
414class tc0480scp_device : public device_t
412class tc0480scp_device : public device_t,
413                                 public tc0480scp_interface
415414{
416415public:
417416   tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
418   ~tc0480scp_device() { global_free(m_token); }
417   ~tc0480scp_device() {}
419418
420   // access to legacy token
421   void *token() const { assert(m_token != NULL); return m_token; }
422   void tc0480scp_postload();
419   /* When writing a driver, pass zero for the text and flip offsets initially:
420   then tweak them once you have the 4 bg layer positions correct. Col_base
421   may be needed when tilemaps use a palette area from sprites. */
422
423   DECLARE_READ16_MEMBER( word_r );
424   DECLARE_WRITE16_MEMBER( word_w );
425   DECLARE_READ16_MEMBER( ctrl_word_r );
426   DECLARE_WRITE16_MEMBER( ctrl_word_w );
427
428   /* Functions for use with 68020 (Super-Z system) */
429   DECLARE_READ32_MEMBER( long_r );
430   DECLARE_WRITE32_MEMBER( long_w );
431   DECLARE_READ32_MEMBER( ctrl_long_r );
432   DECLARE_WRITE32_MEMBER( ctrl_long_w );
433
434   void tilemap_update();
435   void tilemap_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority);
436
437   /* Returns the priority order of the bg tilemaps set in the internal
438   register. The order in which the four layers should be drawn is
439   returned in the lowest four nibbles  (msn = bottom layer; lsn = top) */
440   int get_bg_priority();
441
442   /* Undrfire needs to read this for a sprite/tile priority hack */
443   DECLARE_READ8_MEMBER( pri_reg_r );
444   
445   void postload();
446   
423447protected:
424448   // device-level overrides
425449   virtual void device_config_complete();
426450   virtual void device_start();
427451   virtual void device_reset();
452   
428453private:
429454   // internal state
430   void *m_token;
455   UINT16           m_ctrl[0x18];
431456
432   TILE_GET_INFO_MEMBER(tc0480scp_get_bg0_tile_info);
433   TILE_GET_INFO_MEMBER(tc0480scp_get_bg1_tile_info);
434   TILE_GET_INFO_MEMBER(tc0480scp_get_bg2_tile_info);
435   TILE_GET_INFO_MEMBER(tc0480scp_get_bg3_tile_info);
436   TILE_GET_INFO_MEMBER(tc0480scp_get_tx_tile_info);
457   UINT16 *         m_ram;
458   UINT16 *         m_bg_ram[4];
459   UINT16 *         m_tx_ram;
460   UINT16 *         m_char_ram;
461   UINT16 *         m_bgscroll_ram[4];
462   UINT16 *         m_rowzoom_ram[4];
463   UINT16 *         m_bgcolumn_ram[4];
464   int              m_bgscrollx[4];
465   int              m_bgscrolly[4];
466   int              m_pri_reg;
467
468   /* We keep two tilemaps for each of the 5 actual tilemaps: one at standard width, one double */
469   tilemap_t         *m_tilemap[5][2];
470   INT32           m_dblwidth;
471   int             m_x_offs;
472
473   void common_get_tc0480bg_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum );
474   void common_get_tc0480tx_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum );
475   
476   TILE_GET_INFO_MEMBER(get_bg0_tile_info);
477   TILE_GET_INFO_MEMBER(get_bg1_tile_info);
478   TILE_GET_INFO_MEMBER(get_bg2_tile_info);
479   TILE_GET_INFO_MEMBER(get_bg3_tile_info);
480   TILE_GET_INFO_MEMBER(get_tx_tile_info);
481   
482   void dirty_tilemaps();
483   void set_layer_ptrs();
484   void bg01_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority );
485   void bg23_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority );
437486};
438487
439488extern const device_type TC0480SCP;
440489
441class tc0150rod_device : public device_t
490class tc0150rod_device : public device_t,
491                               public tc0150rod_interface
442492{
443493public:
444494   tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
445   ~tc0150rod_device() { global_free(m_token); }
495   ~tc0150rod_device() {}
446496
447   // access to legacy token
448   void *token() const { assert(m_token != NULL); return m_token; }
497   DECLARE_READ16_MEMBER( word_r );
498   DECLARE_WRITE16_MEMBER( word_w );
499   void draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs, int palette_offs, int type, int road_trans, UINT32 low_priority, UINT32 high_priority);
500   
449501protected:
450502   // device-level overrides
451503   virtual void device_config_complete();
452504   virtual void device_start();
505   
453506private:
454507   // internal state
455   void *m_token;
508   UINT16 *        m_ram;
456509};
457510
458511extern const device_type TC0150ROD;
459512
460class tc0110pcr_device : public device_t
513class tc0110pcr_device : public device_t,
514                                public tc0110pcr_interface
461515{
462516public:
463517   tc0110pcr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
464   ~tc0110pcr_device() { global_free(m_token); }
518   ~tc0110pcr_device() {}
465519
466   // access to legacy token
467   void *token() const { assert(m_token != NULL); return m_token; }
468   void tc0110pcr_restore_colors();
520   DECLARE_READ16_MEMBER( word_r );
521   DECLARE_WRITE16_MEMBER( word_w ); /* color index goes up in step of 2 */
522   DECLARE_WRITE16_MEMBER( step1_word_w );   /* color index goes up in step of 1 */
523   DECLARE_WRITE16_MEMBER( step1_rbswap_word_w );    /* swaps red and blue components */
524   DECLARE_WRITE16_MEMBER( step1_4bpg_word_w );  /* only 4 bits per color gun */
525
526   void restore_colors();
527   
469528protected:
470529   // device-level overrides
471530   virtual void device_config_complete();
472531   virtual void device_start();
473532   virtual void device_reset();
533   
474534private:
475   // internal state
476   void *m_token;
535   UINT16 *     m_ram;
536   int          m_type;
537   int          m_addr;
477538};
478539
479540extern const device_type TC0110PCR;
480541
481class tc0180vcu_device : public device_t
542class tc0180vcu_device : public device_t,
543                                 public tc0180vcu_interface
482544{
483545public:
484546   tc0180vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
485   ~tc0180vcu_device() { global_free(m_token); }
547   ~tc0180vcu_device() {}
548   
549   DECLARE_READ8_MEMBER( get_fb_page );
550   DECLARE_WRITE8_MEMBER( set_fb_page );
551   DECLARE_READ8_MEMBER( get_videoctrl );
552   DECLARE_READ16_MEMBER( ctrl_r );
553   DECLARE_WRITE16_MEMBER( ctrl_w );
554   DECLARE_READ16_MEMBER( scroll_r );
555   DECLARE_WRITE16_MEMBER( scroll_w );
556   DECLARE_READ16_MEMBER( word_r );
557   DECLARE_WRITE16_MEMBER( word_w );
558   void tilemap_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int tmap_num, int plane);
486559
487   // access to legacy token
488   void *token() const { assert(m_token != NULL); return m_token; }
489560protected:
490561   // device-level overrides
491562   virtual void device_config_complete();
492563   virtual void device_start();
493564   virtual void device_reset();
494private:
565
566   private:
495567   // internal state
496   void *m_token;
568   UINT16         m_ctrl[0x10];
497569
570   UINT16 *       m_ram;
571   UINT16 *       m_scrollram;
572
573   tilemap_t      *m_tilemap[3];
574
575   UINT16         m_bg_rambank[2], m_fg_rambank[2], m_tx_rambank;
576   UINT8          m_framebuffer_page;
577   UINT8          m_video_control;
578
498579   TILE_GET_INFO_MEMBER(get_bg_tile_info);
499580   TILE_GET_INFO_MEMBER(get_fg_tile_info);
500581   TILE_GET_INFO_MEMBER(get_tx_tile_info);
582   
583   void video_control( UINT8 data );
501584};
502585
503586extern const device_type TC0180VCU;
r24008r24009
550633   MCFG_DEVICE_ADD(_tag, TC0180VCU, 0) \
551634   MCFG_DEVICE_CONFIG(_interface)
552635
553
554/***************************************************************************
555    DEVICE I/O FUNCTIONS
556***************************************************************************/
557
558
559/** TC0480SCP **/
560/* When writing a driver, pass zero for the text and flip offsets initially:
561   then tweak them once you have the 4 bg layer positions correct. Col_base
562   may be needed when tilemaps use a palette area from sprites. */
563
564DECLARE_READ16_DEVICE_HANDLER( tc0480scp_word_r );
565DECLARE_WRITE16_DEVICE_HANDLER( tc0480scp_word_w );
566DECLARE_READ16_DEVICE_HANDLER( tc0480scp_ctrl_word_r );
567DECLARE_WRITE16_DEVICE_HANDLER( tc0480scp_ctrl_word_w );
568
569/* Functions for use with 68020 (Super-Z system) */
570DECLARE_READ32_DEVICE_HANDLER( tc0480scp_long_r );
571DECLARE_WRITE32_DEVICE_HANDLER( tc0480scp_long_w );
572DECLARE_READ32_DEVICE_HANDLER( tc0480scp_ctrl_long_r );
573DECLARE_WRITE32_DEVICE_HANDLER( tc0480scp_ctrl_long_w );
574
575void tc0480scp_tilemap_update(device_t *device);
576void tc0480scp_tilemap_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority);
577
578/* Returns the priority order of the bg tilemaps set in the internal
579   register. The order in which the four layers should be drawn is
580   returned in the lowest four nibbles  (msn = bottom layer; lsn = top) */
581int tc0480scp_get_bg_priority(device_t *device);
582
583/* Undrfire needs to read this for a sprite/tile priority hack */
584DECLARE_READ8_DEVICE_HANDLER( tc0480scp_pri_reg_r );
585
586
587/** TC0150ROD **/
588DECLARE_READ16_DEVICE_HANDLER( tc0150rod_word_r );
589DECLARE_WRITE16_DEVICE_HANDLER( tc0150rod_word_w );
590void tc0150rod_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs, int palette_offs, int type, int road_trans, UINT32 low_priority, UINT32 high_priority);
591
592
593/** TC0110PCR **/
594DECLARE_READ16_DEVICE_HANDLER( tc0110pcr_word_r );
595DECLARE_WRITE16_DEVICE_HANDLER( tc0110pcr_word_w ); /* color index goes up in step of 2 */
596DECLARE_WRITE16_DEVICE_HANDLER( tc0110pcr_step1_word_w );   /* color index goes up in step of 1 */
597DECLARE_WRITE16_DEVICE_HANDLER( tc0110pcr_step1_rbswap_word_w );    /* swaps red and blue components */
598DECLARE_WRITE16_DEVICE_HANDLER( tc0110pcr_step1_4bpg_word_w );  /* only 4 bits per color gun */
599
600
601/** TC0180VCU **/
602DECLARE_READ8_DEVICE_HANDLER( tc0180vcu_get_fb_page );
603DECLARE_WRITE8_DEVICE_HANDLER( tc0180vcu_set_fb_page );
604DECLARE_READ8_DEVICE_HANDLER( tc0180vcu_get_videoctrl );
605DECLARE_READ16_DEVICE_HANDLER( tc0180vcu_ctrl_r );
606DECLARE_WRITE16_DEVICE_HANDLER( tc0180vcu_ctrl_w );
607DECLARE_READ16_DEVICE_HANDLER( tc0180vcu_scroll_r );
608DECLARE_WRITE16_DEVICE_HANDLER( tc0180vcu_scroll_w );
609DECLARE_READ16_DEVICE_HANDLER( tc0180vcu_word_r );
610DECLARE_WRITE16_DEVICE_HANDLER( tc0180vcu_word_w );
611void tc0180vcu_tilemap_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int tmap_num, int plane);
612636#endif

Previous 199869 Revisions Next


© 1997-2024 The MAME Team