Previous 199869 Revisions Next

r24016 Sunday 30th June, 2013 at 10:40:37 UTC by Fabio Priuli
Modernized DECO16 IC device [Osso]
[src/mame/drivers]backfire.c boogwing.c cbuster.c cninja.c darkseal.c dassault.c dblewing.c deco156.c deco32.c dietgo.c dreambal.c funkyjet.c mirage.c pktgaldx.c rohga.c simpl156.c sshangha.c supbtime.c tumblep.c vaportra.c
[src/mame/includes]pktgaldx.h supbtime.h vaportra.h
[src/mame/video]boogwing.c cbuster.c cninja.c darkseal.c dassault.c deco16ic.c deco16ic.h deco32.c dietgo.c funkyjet.c pktgaldx.c rohga.c simpl156.c sshangha.c supbtime.c tumblep.c vaportra.c

trunk/src/mame/drivers/deco32.c
r24015r24016
235235#include "includes/deco32.h"
236236#include "sound/2151intf.h"
237237#include "sound/okim6295.h"
238#include "video/deco16ic.h"
239238
240239/**********************************************************************************/
241240
r24015r24016
730729
731730   AM_RANGE(0x178000, 0x178003) AM_WRITE(deco32_pri_w)
732731
733   AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
734   AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
735   AM_RANGE(0x192000, 0x193fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) /* Mirror address - bug in program code */
736   AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
732   AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
733   AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
734   AM_RANGE(0x192000, 0x193fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) /* Mirror address - bug in program code */
735   AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
737736   AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
738737   AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
739738
740   AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
741   AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
742   AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) // unused
739   AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
740   AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
741   AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused
743742   AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
744743   AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused
745744ADDRESS_MAP_END
r24015r24016
761760   AM_RANGE(0x178000, 0x179fff) AM_READWRITE(deco32_spriteram_r, deco32_spriteram_w)
762761   AM_RANGE(0x17c010, 0x17c013) AM_WRITE(deco32_buffer_spriteram_w)
763762
764   AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
765   AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
763   AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
764   AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
766765   AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
767766   AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
768   AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
767   AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
769768
770   AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
771   AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
769   AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
770   AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
772771   AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
773772   AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32")
774   AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
773   AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
775774
776775   AM_RANGE(0x16c000, 0x16c01f) AM_READNOP
777776   AM_RANGE(0x17c000, 0x17c03f) AM_READNOP
r24015r24016
794793   AM_RANGE(0x17c010, 0x17c013) AM_WRITE(deco32_buffer_spriteram_w)
795794   AM_RANGE(0x17c020, 0x17c023) AM_READNOP
796795
797   AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
798   AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
796   AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
797   AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
799798   AM_RANGE(0x192000, 0x193fff)  AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
800799   AM_RANGE(0x194000, 0x195fff)  AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
801   AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
800   AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
802801
803   AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
804   AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
802   AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
803   AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
805804   AM_RANGE(0x1d2000, 0x1d3fff)  AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
806805   AM_RANGE(0x1d4000, 0x1d5fff)  AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32")
807   AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
806   AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
808807
809808   AM_RANGE(0x200000, 0x200fff) AM_READWRITE_LEGACY(deco16_146_fghthist_prot_r, deco16_146_fghthist_prot_w) AM_SHARE("prot32ram")
810809ADDRESS_MAP_END
r24015r24016
821820   AM_RANGE(0x138000, 0x138003) AM_NOP /* Palette dma complete in bit 0x8? ack?  return 0 else tight loop */
822821   AM_RANGE(0x138008, 0x13800b) AM_WRITE(deco32_palette_dma_w)
823822
824   AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
825   AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
826   AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
823   AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
824   AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
825   AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
827826   AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
828827   AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
829828
830   AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
831   AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
832   AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) // unused
829   AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
830   AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
831   AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused
833832   AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
834833   AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused
835834
r24015r24016
872871   AM_RANGE(0x170000, 0x170007) AM_READ(lockload_gun_mirror_r) /* Not on Dragongun */
873872   AM_RANGE(0x178008, 0x17800f) AM_WRITENOP /* Gun read ACK's */
874873
875   AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
876   AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
877   AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
874   AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
875   AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
876   AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
878877   AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
879878   AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
880879
881   AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
882   AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
883   AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) // unused
880   AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
881   AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
882   AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused
884883   AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
885884   AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused
886885
r24015r24016
934933   AM_RANGE(0x17c010, 0x17c013) AM_WRITE(deco32_buffer_spriteram2_w)
935934   AM_RANGE(0x17c018, 0x17c01b) AM_WRITENOP /* Sprite 'CPU' (unused) */
936935
937   AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
938   AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
936   AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
937   AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
939938   AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
940939   AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
941   AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
940   AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
942941
943   AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
944   AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
942   AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
943   AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
945944   AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
946945   AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32")
947   AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
946   AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
948947
949948   AM_RANGE(0x200000, 0x200fff) AM_READWRITE(tattass_prot_r, tattass_prot_w) AM_SHARE("prot32ram")
950949ADDRESS_MAP_END
r24015r24016
975974   AM_RANGE(0x17c010, 0x17c013) AM_WRITE(deco32_buffer_spriteram2_w)
976975   AM_RANGE(0x17c018, 0x17c01b) AM_WRITENOP /* Sprite 'CPU' (unused) */
977976
978   AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
979   AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
977   AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
978   AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
980979   AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
981980   AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
982   AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
981   AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
983982
984   AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
985   AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
983   AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
984   AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
986985   AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
987986   AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32")
988   AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
987   AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
989988
990989   AM_RANGE(0x200000, 0x200fff) AM_READWRITE(nslasher_prot_r, nslasher_prot_w) AM_SHARE("prot32ram")
991990ADDRESS_MAP_END
trunk/src/mame/drivers/dassault.c
r24015r24016
134134#include "sound/2203intf.h"
135135#include "sound/2151intf.h"
136136#include "sound/okim6295.h"
137#include "video/deco16ic.h"
138137#include "video/decocomn.h"
139138
140139/**********************************************************************************/
r24015r24016
227226   AM_RANGE(0x1c000c, 0x1c000d) AM_DEVWRITE("spriteram2", buffered_spriteram16_device, write)
228227   AM_RANGE(0x1c000e, 0x1c000f) AM_WRITE(dassault_control_w)
229228
230   AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
231   AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
229   AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
230   AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
232231   AM_RANGE(0x212000, 0x212fff) AM_WRITEONLY AM_SHARE("pf2_rowscroll")
233   AM_RANGE(0x220000, 0x22000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
232   AM_RANGE(0x220000, 0x22000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
234233
235   AM_RANGE(0x240000, 0x240fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
236   AM_RANGE(0x242000, 0x242fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
234   AM_RANGE(0x240000, 0x240fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w)
235   AM_RANGE(0x242000, 0x242fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w)
237236   AM_RANGE(0x252000, 0x252fff) AM_WRITEONLY AM_SHARE("pf4_rowscroll")
238   AM_RANGE(0x260000, 0x26000f) AM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf_control_w)
237   AM_RANGE(0x260000, 0x26000f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w)
239238
240239   AM_RANGE(0x3f8000, 0x3fbfff) AM_RAM AM_SHARE("ram") /* Main ram */
241240   AM_RANGE(0x3fc000, 0x3fcfff) AM_RAM AM_SHARE("spriteram2") /* Spriteram (2nd) */
trunk/src/mame/drivers/supbtime.c
r24015r24016
2525#include "cpu/h6280/h6280.h"
2626#include "sound/2151intf.h"
2727#include "sound/okim6295.h"
28#include "video/deco16ic.h"
2928#include "includes/supbtime.h"
3029
3130/******************************************************************************/
r24015r24016
6766   AM_RANGE(0x180000, 0x18000f) AM_READ(supbtime_controls_r)
6867   AM_RANGE(0x18000a, 0x18000d) AM_WRITENOP
6968   AM_RANGE(0x1a0000, 0x1a0001) AM_WRITE(sound_w)
70   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_r, deco16ic_pf_control_w)
71   AM_RANGE(0x320000, 0x321fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
72   AM_RANGE(0x322000, 0x323fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
69   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_r, pf_control_w)
70   AM_RANGE(0x320000, 0x321fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
71   AM_RANGE(0x322000, 0x323fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
7372   AM_RANGE(0x340000, 0x3407ff) AM_RAM AM_SHARE("pf1_rowscroll")
7473   AM_RANGE(0x342000, 0x3427ff) AM_RAM AM_SHARE("pf2_rowscroll")
7574ADDRESS_MAP_END
r24015r24016
8281   AM_RANGE(0x180000, 0x18000f) AM_READ(supbtime_controls_r)
8382   AM_RANGE(0x18000a, 0x18000d) AM_WRITENOP
8483   AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM
85   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_r, deco16ic_pf_control_w)
86   AM_RANGE(0x320000, 0x321fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
87   AM_RANGE(0x322000, 0x323fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
84   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_r, pf_control_w)
85   AM_RANGE(0x320000, 0x321fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
86   AM_RANGE(0x322000, 0x323fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
8887   AM_RANGE(0x340000, 0x3407ff) AM_RAM AM_SHARE("pf1_rowscroll") // unused
8988   AM_RANGE(0x342000, 0x3427ff) AM_RAM AM_SHARE("pf2_rowscroll") // unused
9089ADDRESS_MAP_END
trunk/src/mame/drivers/deco156.c
r24015r24016
8585   machine().priority_bitmap.fill(0);
8686   bitmap.fill(0);
8787
88   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
88   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
8989
90   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
90   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
9191   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x800);
92   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
92   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
9393   return 0;
9494}
9595
r24015r24016
147147   AM_RANGE(0x12000c, 0x12000f) AM_WRITE(hvysmsh_oki_0_bank_w)
148148   AM_RANGE(0x140000, 0x140003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x000000ff)
149149   AM_RANGE(0x160000, 0x160003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x000000ff)
150   AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
151   AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
152   AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
150   AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
151   AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
152   AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
153153   AM_RANGE(0x1a0000, 0x1a0fff) AM_READWRITE(wcvol95_pf1_rowscroll_r, wcvol95_pf1_rowscroll_w)
154154   AM_RANGE(0x1a4000, 0x1a4fff) AM_READWRITE(wcvol95_pf2_rowscroll_r, wcvol95_pf2_rowscroll_w)
155155   AM_RANGE(0x1c0000, 0x1c0fff) AM_RAM_WRITE(deco156_nonbuffered_palette_w) AM_SHARE("paletteram")
r24015r24016
159159
160160static ADDRESS_MAP_START( wcvol95_map, AS_PROGRAM, 32, deco156_state )
161161   AM_RANGE(0x000000, 0x0fffff) AM_ROM
162   AM_RANGE(0x100000, 0x10001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
163   AM_RANGE(0x110000, 0x111fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
164   AM_RANGE(0x114000, 0x115fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
162   AM_RANGE(0x100000, 0x10001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
163   AM_RANGE(0x110000, 0x111fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
164   AM_RANGE(0x114000, 0x115fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
165165   AM_RANGE(0x120000, 0x120fff) AM_READWRITE(wcvol95_pf1_rowscroll_r, wcvol95_pf1_rowscroll_w)
166166   AM_RANGE(0x124000, 0x124fff) AM_READWRITE(wcvol95_pf2_rowscroll_r, wcvol95_pf2_rowscroll_w)
167167   AM_RANGE(0x130000, 0x137fff) AM_RAM
trunk/src/mame/drivers/boogwing.c
r24015r24016
8686#include "includes/decoprot.h"
8787#include "sound/2151intf.h"
8888#include "sound/okim6295.h"
89#include "video/deco16ic.h"
9089#include "video/decocomn.h"
9190
9291
r24015r24016
107106   AM_RANGE(0x24e344, 0x24e345) AM_READ_PORT("INPUTS")
108107   AM_RANGE(0x24e000, 0x24e7ff) AM_WRITE_LEGACY(deco16_104_prot_w) AM_SHARE("prot16ram")
109108
110   AM_RANGE(0x260000, 0x26000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
111   AM_RANGE(0x264000, 0x265fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
112   AM_RANGE(0x266000, 0x267fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
109   AM_RANGE(0x260000, 0x26000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
110   AM_RANGE(0x264000, 0x265fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
111   AM_RANGE(0x266000, 0x267fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
113112   AM_RANGE(0x268000, 0x268fff) AM_RAM AM_SHARE("pf1_rowscroll")
114113   AM_RANGE(0x26a000, 0x26afff) AM_RAM AM_SHARE("pf2_rowscroll")
115114
116   AM_RANGE(0x270000, 0x27000f) AM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf_control_w)
117   AM_RANGE(0x274000, 0x275fff) AM_RAM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf1_data_w)
118   AM_RANGE(0x276000, 0x277fff) AM_RAM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf2_data_w)
115   AM_RANGE(0x270000, 0x27000f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w)
116   AM_RANGE(0x274000, 0x275fff) AM_RAM_DEVWRITE("tilegen2", deco16ic_device, pf1_data_w)
117   AM_RANGE(0x276000, 0x277fff) AM_RAM_DEVWRITE("tilegen2", deco16ic_device, pf2_data_w)
119118   AM_RANGE(0x278000, 0x278fff) AM_RAM AM_SHARE("pf3_rowscroll")
120119   AM_RANGE(0x27a000, 0x27afff) AM_RAM AM_SHARE("pf4_rowscroll")
121120
trunk/src/mame/drivers/cninja.c
r24015r24016
5050#include "sound/2203intf.h"
5151#include "sound/2151intf.h"
5252#include "sound/okim6295.h"
53#include "video/deco16ic.h"
5453#include "video/decocomn.h"
5554
5655WRITE16_MEMBER(cninja_state::cninja_sound_w)
r24015r24016
148147WRITE16_MEMBER(cninja_state::cninja_pf12_control_w)
149148{
150149   machine().primary_screen->update_partial(machine().primary_screen->vpos());
151   deco16ic_pf_control_w(m_deco_tilegen1, space, offset, data, mem_mask);
150   m_deco_tilegen1->pf_control_w(space, offset, data, mem_mask);
152151}
153152
154153
155154WRITE16_MEMBER(cninja_state::cninja_pf34_control_w)
156155{
157156   machine().primary_screen->update_partial(machine().primary_screen->vpos());
158   deco16ic_pf_control_w(m_deco_tilegen2, space, offset, data, mem_mask);
157   m_deco_tilegen2->pf_control_w(space, offset, data, mem_mask);
159158}
160159
161160
r24015r24016
163162   AM_RANGE(0x000000, 0x0bffff) AM_ROM
164163
165164   AM_RANGE(0x140000, 0x14000f) AM_WRITE(cninja_pf12_control_w)
166   AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
167   AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
165   AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
166   AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
168167   AM_RANGE(0x14c000, 0x14c7ff) AM_WRITEONLY AM_SHARE("pf1_rowscroll")
169168   AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_SHARE("pf2_rowscroll")
170169
171170   AM_RANGE(0x150000, 0x15000f) AM_WRITE(cninja_pf34_control_w)
172   AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
173   AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
171   AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w)
172   AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w)
174173   AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_SHARE("pf3_rowscroll")
175174   AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_SHARE("pf4_rowscroll")
176175
r24015r24016
192191   AM_RANGE(0x138000, 0x1387ff) AM_RAM AM_SHARE("spriteram") /* bootleg sprite-ram (sprites rewritten here in new format) */
193192
194193   AM_RANGE(0x140000, 0x14000f) AM_WRITE(cninja_pf12_control_w)
195   AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
196   AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
194   AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
195   AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
197196   AM_RANGE(0x14c000, 0x14c7ff) AM_WRITEONLY AM_SHARE("pf1_rowscroll")
198197   AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_SHARE("pf2_rowscroll")
199198
200199   AM_RANGE(0x150000, 0x15000f) AM_WRITE(cninja_pf34_control_w)    // not used / incorrect on this
201   AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
202   AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
200   AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w)
201   AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w)
203202   AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_SHARE("pf3_rowscroll")
204203   AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_SHARE("pf4_rowscroll")
205204
r24015r24016
220219   AM_RANGE(0x000000, 0x0fffff) AM_ROM
221220
222221   AM_RANGE(0x140000, 0x14000f) AM_WRITE(cninja_pf12_control_w)
223   AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
224   AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
222   AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
223   AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
225224   AM_RANGE(0x14c000, 0x14c7ff) AM_RAM AM_SHARE("pf1_rowscroll")
226225   AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_SHARE("pf2_rowscroll")
227226
228227   AM_RANGE(0x150000, 0x15000f) AM_WRITE(cninja_pf34_control_w)
229   AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
230   AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
228   AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w)
229   AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w)
231230   AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_SHARE("pf3_rowscroll")
232231   AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_SHARE("pf4_rowscroll")
233232
r24015r24016
248247   AM_RANGE(0x000000, 0x0fffff) AM_ROM
249248
250249   AM_RANGE(0x140000, 0x14000f) AM_WRITE(cninja_pf12_control_w)
251   AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
252   AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
250   AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
251   AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
253252   AM_RANGE(0x14c000, 0x14c7ff) AM_RAM AM_SHARE("pf1_rowscroll")
254253   AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_SHARE("pf2_rowscroll")
255254
256255   AM_RANGE(0x150000, 0x15000f) AM_WRITE(cninja_pf34_control_w)
257   AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
258   AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
256   AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w)
257   AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w)
259258   AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_SHARE("pf3_rowscroll")
260259   AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_SHARE("pf4_rowscroll")
261260
r24015r24016
284283   AM_RANGE(0x1e0000, 0x1e0001) AM_DEVWRITE("spriteram2", buffered_spriteram16_device, write)
285284
286285   AM_RANGE(0x300000, 0x30000f) AM_WRITE(cninja_pf12_control_w)
287   AM_RANGE(0x304000, 0x305fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
288   AM_RANGE(0x306000, 0x307fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
286   AM_RANGE(0x304000, 0x305fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
287   AM_RANGE(0x306000, 0x307fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
289288   AM_RANGE(0x308000, 0x3087ff) AM_RAM AM_SHARE("pf1_rowscroll")
290289   AM_RANGE(0x30a000, 0x30a7ff) AM_RAM AM_SHARE("pf2_rowscroll")
291290
292291   AM_RANGE(0x310000, 0x31000f) AM_WRITE(cninja_pf34_control_w)
293   AM_RANGE(0x314000, 0x315fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
294   AM_RANGE(0x316000, 0x317fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
292   AM_RANGE(0x314000, 0x315fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w)
293   AM_RANGE(0x316000, 0x317fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w)
295294   AM_RANGE(0x318000, 0x3187ff) AM_RAM AM_SHARE("pf3_rowscroll")
296295   AM_RANGE(0x31a000, 0x31a7ff) AM_RAM AM_SHARE("pf4_rowscroll")
297296
trunk/src/mame/drivers/backfire.c
r24015r24016
5757
5858   /* devices */
5959   required_device<cpu_device> m_maincpu;
60   required_device<device_t> m_deco_tilegen1;
61   required_device<device_t> m_deco_tilegen2;
60   required_device<deco16ic_device> m_deco_tilegen1;
61   required_device<deco16ic_device> m_deco_tilegen2;
6262
6363   required_device<eeprom_device> m_eeprom;
6464
r24015r24016
136136
137137   /* screen 1 uses pf1 as the forground and pf3 as the background */
138138   /* screen 2 uses pf2 as the foreground and pf4 as the background */
139   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
140   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
139   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
140   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
141141
142142   machine().priority_bitmap.fill(0);
143143   bitmap.fill(0x100, cliprect);
144144
145145   if (m_left_priority[0] == 0)
146146   {
147      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 1);
148      deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
147      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 1);
148      m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 2);
149149      m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram_1, 0x800);
150150   }
151151   else if (m_left_priority[0] == 2)
152152   {
153      deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
154      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4);
153      m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 2);
154      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 4);
155155      m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram_1, 0x800);
156156   }
157157   else
r24015r24016
167167
168168   /* screen 1 uses pf1 as the forground and pf3 as the background */
169169   /* screen 2 uses pf2 as the foreground and pf4 as the background */
170   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
171   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
170   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
171   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
172172
173173   machine().priority_bitmap.fill(0);
174174   bitmap.fill(0x500, cliprect);
175175
176176   if (m_right_priority[0] == 0)
177177   {
178      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 1);
179      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
178      m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, 0, 1);
179      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2);
180180      m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram_2, 0x800);
181181   }
182182   else if (m_right_priority[0] == 2)
183183   {
184      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
185      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4);
184      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2);
185      m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, 0, 4);
186186      m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram_2, 0x800);
187187   }
188188   else
r24015r24016
295295
296296static ADDRESS_MAP_START( backfire_map, AS_PROGRAM, 32, backfire_state )
297297   AM_RANGE(0x000000, 0x0fffff) AM_ROM
298   AM_RANGE(0x100000, 0x10001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
299   AM_RANGE(0x110000, 0x111fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
300   AM_RANGE(0x114000, 0x115fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
298   AM_RANGE(0x100000, 0x10001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
299   AM_RANGE(0x110000, 0x111fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
300   AM_RANGE(0x114000, 0x115fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
301301   AM_RANGE(0x120000, 0x120fff) AM_READWRITE(backfire_pf1_rowscroll_r, backfire_pf1_rowscroll_w)
302302   AM_RANGE(0x124000, 0x124fff) AM_READWRITE(backfire_pf2_rowscroll_r, backfire_pf2_rowscroll_w)
303   AM_RANGE(0x130000, 0x13001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
304   AM_RANGE(0x140000, 0x141fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
305   AM_RANGE(0x144000, 0x145fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
303   AM_RANGE(0x130000, 0x13001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
304   AM_RANGE(0x140000, 0x141fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
305   AM_RANGE(0x144000, 0x145fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
306306   AM_RANGE(0x150000, 0x150fff) AM_READWRITE(backfire_pf3_rowscroll_r, backfire_pf3_rowscroll_w)
307307   AM_RANGE(0x154000, 0x154fff) AM_READWRITE(backfire_pf4_rowscroll_r, backfire_pf4_rowscroll_w)
308308   AM_RANGE(0x160000, 0x161fff) AM_WRITE(backfire_nonbuffered_palette_w) AM_SHARE("paletteram")
trunk/src/mame/drivers/simpl156.c
r24015r24016
9494#include "includes/simpl156.h"
9595#include "machine/eeprom.h"
9696#include "sound/okim6295.h"
97#include "video/deco16ic.h"
9897
9998static INPUT_PORTS_START( simpl156 )
10099   PORT_START("IN0")
r24015r24016
243242   AM_RANGE(0x110000, 0x111fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w)
244243   AM_RANGE(0x120000, 0x120fff) AM_READWRITE(simpl156_palette_r, simpl156_palette_w)
245244   AM_RANGE(0x130000, 0x130003) AM_READWRITE(simpl156_system_r, simpl156_eeprom_w)
246   AM_RANGE(0x140000, 0x14001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
247   AM_RANGE(0x150000, 0x151fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
248   AM_RANGE(0x152000, 0x153fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
249   AM_RANGE(0x154000, 0x155fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
245   AM_RANGE(0x140000, 0x14001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
246   AM_RANGE(0x150000, 0x151fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
247   AM_RANGE(0x152000, 0x153fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
248   AM_RANGE(0x154000, 0x155fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
250249   AM_RANGE(0x160000, 0x161fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w)
251250   AM_RANGE(0x164000, 0x165fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w)
252251   AM_RANGE(0x170000, 0x170003) AM_READONLY AM_WRITENOP // ?
r24015r24016
267266   AM_RANGE(0x410000, 0x411fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w)
268267   AM_RANGE(0x420000, 0x420fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w)
269268   AM_RANGE(0x430000, 0x430003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w)
270   AM_RANGE(0x440000, 0x44001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
271   AM_RANGE(0x450000, 0x451fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
272   AM_RANGE(0x452000, 0x453fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
273   AM_RANGE(0x454000, 0x455fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
269   AM_RANGE(0x440000, 0x44001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
270   AM_RANGE(0x450000, 0x451fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
271   AM_RANGE(0x452000, 0x453fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
272   AM_RANGE(0x454000, 0x455fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
274273   AM_RANGE(0x460000, 0x461fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w)
275274   AM_RANGE(0x464000, 0x465fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w)
276275   AM_RANGE(0x470000, 0x470003) AM_READONLY AM_WRITENOP // ??
r24015r24016
288287   AM_RANGE(0x390000, 0x391fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w)
289288   AM_RANGE(0x3a0000, 0x3a0fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w)
290289   AM_RANGE(0x3b0000, 0x3b0003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w)
291   AM_RANGE(0x3c0000, 0x3c001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
292   AM_RANGE(0x3d0000, 0x3d1fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
293   AM_RANGE(0x3d2000, 0x3d3fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
294   AM_RANGE(0x3d4000, 0x3d5fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
290   AM_RANGE(0x3c0000, 0x3c001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
291   AM_RANGE(0x3d0000, 0x3d1fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
292   AM_RANGE(0x3d2000, 0x3d3fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
293   AM_RANGE(0x3d4000, 0x3d5fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
295294   AM_RANGE(0x3e0000, 0x3e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w)
296295   AM_RANGE(0x3e4000, 0x3e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w)
297296   AM_RANGE(0x3f0000, 0x3f0003) AM_READONLY AM_WRITENOP //?
r24015r24016
309308   AM_RANGE(0x690000, 0x691fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w)
310309   AM_RANGE(0x6a0000, 0x6a0fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w)
311310   AM_RANGE(0x6b0000, 0x6b0003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w)
312   AM_RANGE(0x6c0000, 0x6c001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
313   AM_RANGE(0x6d0000, 0x6d1fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
314   AM_RANGE(0x6d2000, 0x6d3fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
315   AM_RANGE(0x6d4000, 0x6d5fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
311   AM_RANGE(0x6c0000, 0x6c001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
312   AM_RANGE(0x6d0000, 0x6d1fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
313   AM_RANGE(0x6d2000, 0x6d3fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
314   AM_RANGE(0x6d4000, 0x6d5fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
316315   AM_RANGE(0x6e0000, 0x6e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w)
317316   AM_RANGE(0x6e4000, 0x6e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w)
318317   AM_RANGE(0x6f0000, 0x6f0003) AM_READONLY AM_WRITENOP // ?
r24015r24016
329328   AM_RANGE(0x190000, 0x191fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w)
330329   AM_RANGE(0x1a0000, 0x1a0fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w)
331330   AM_RANGE(0x1b0000, 0x1b0003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w)
332   AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w)
333   AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
334   AM_RANGE(0x1d2000, 0x1d3fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w)
335   AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w)
331   AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
332   AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
333   AM_RANGE(0x1d2000, 0x1d3fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
334   AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
336335   AM_RANGE(0x1e0000, 0x1e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w)
337336   AM_RANGE(0x1e4000, 0x1e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w)
338337   AM_RANGE(0x1f0000, 0x1f0003) AM_READONLY AM_WRITENOP // ?
trunk/src/mame/drivers/funkyjet.c
r24015r24016
9595#include "includes/funkyjet.h"
9696#include "sound/2151intf.h"
9797#include "sound/okim6295.h"
98#include "video/deco16ic.h"
9998
10099
101100/******************************************************************************/
r24015r24016
108107   AM_RANGE(0x180000, 0x1807ff) AM_READWRITE_LEGACY(deco16_146_funkyjet_prot_r, deco16_146_funkyjet_prot_w) AM_SHARE("prot16ram")
109108   AM_RANGE(0x184000, 0x184001) AM_WRITENOP
110109   AM_RANGE(0x188000, 0x188001) AM_WRITENOP
111   AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
112   AM_RANGE(0x320000, 0x321fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
113   AM_RANGE(0x322000, 0x323fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
110   AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
111   AM_RANGE(0x320000, 0x321fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
112   AM_RANGE(0x322000, 0x323fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
114113   AM_RANGE(0x340000, 0x340bff) AM_RAM AM_SHARE("pf1_rowscroll")
115114   AM_RANGE(0x342000, 0x342bff) AM_RAM AM_SHARE("pf2_rowscroll")
116115ADDRESS_MAP_END
trunk/src/mame/drivers/dreambal.c
r24015r24016
6868UINT32 dreambal_state::screen_update_dreambal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
6969{
7070   address_space &space = generic_space();
71   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
71   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
7272
7373   flip_screen_set(BIT(flip, 7));
74   deco16ic_pf_update(m_deco_tilegen1, NULL, NULL);
74   m_deco_tilegen1->pf_update(NULL, NULL);
7575
7676   bitmap.fill(0, cliprect); /* not Confirmed */
7777   machine().priority_bitmap.fill(0);
7878
79   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
80   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4);
79   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2);
80   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 4);
8181   return 0;
8282}
8383
r24015r24016
8585static ADDRESS_MAP_START( dreambal_map, AS_PROGRAM, 16, dreambal_state )
8686//ADDRESS_MAP_UNMAP_HIGH
8787   AM_RANGE(0x000000, 0x07ffff) AM_ROM
88   AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
88   AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
8989   AM_RANGE(0x101000, 0x101fff) AM_RAM
90   AM_RANGE(0x102000, 0x102fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
90   AM_RANGE(0x102000, 0x102fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
9191   AM_RANGE(0x103000, 0x103fff) AM_RAM
9292
9393   AM_RANGE(0x120000, 0x123fff) AM_RAM
9494   AM_RANGE(0x140000, 0x1403ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram")
95   AM_RANGE(0x161000, 0x16100f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
95   AM_RANGE(0x161000, 0x16100f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
9696
9797   AM_RANGE(0x160088, 0x160089) AM_READ_PORT("INP")
9898   AM_RANGE(0x160292, 0x160293) AM_READ_PORT("SYS")
trunk/src/mame/drivers/cbuster.c
r24015r24016
2323#include "sound/2203intf.h"
2424#include "sound/2151intf.h"
2525#include "sound/okim6295.h"
26#include "video/deco16ic.h"
2726
28
2927WRITE16_MEMBER(cbuster_state::twocrude_control_w)
3028{
3129   switch (offset << 1)
r24015r24016
104102   AM_RANGE(0x000000, 0x07ffff) AM_ROM
105103   AM_RANGE(0x080000, 0x083fff) AM_RAM AM_SHARE("ram")
106104
107   AM_RANGE(0x0a0000, 0x0a1fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
108   AM_RANGE(0x0a2000, 0x0a2fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
105   AM_RANGE(0x0a0000, 0x0a1fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
106   AM_RANGE(0x0a2000, 0x0a2fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
109107   AM_RANGE(0x0a4000, 0x0a47ff) AM_RAM AM_SHARE("pf1_rowscroll")
110108   AM_RANGE(0x0a6000, 0x0a67ff) AM_RAM AM_SHARE("pf2_rowscroll")
111109
112   AM_RANGE(0x0a8000, 0x0a8fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
113   AM_RANGE(0x0aa000, 0x0aafff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
110   AM_RANGE(0x0a8000, 0x0a8fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w)
111   AM_RANGE(0x0aa000, 0x0aafff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w)
114112   AM_RANGE(0x0ac000, 0x0ac7ff) AM_RAM AM_SHARE("pf3_rowscroll")
115113   AM_RANGE(0x0ae000, 0x0ae7ff) AM_RAM AM_SHARE("pf4_rowscroll")
116114
117115   AM_RANGE(0x0b0000, 0x0b07ff) AM_RAM AM_SHARE("spriteram16")
118116   AM_RANGE(0x0b4000, 0x0b4001) AM_WRITENOP
119   AM_RANGE(0x0b5000, 0x0b500f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
120   AM_RANGE(0x0b6000, 0x0b600f) AM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf_control_w)
117   AM_RANGE(0x0b5000, 0x0b500f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
118   AM_RANGE(0x0b6000, 0x0b600f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w)
121119   AM_RANGE(0x0b8000, 0x0b8fff) AM_RAM_WRITE(twocrude_palette_24bit_rg_w) AM_SHARE("paletteram")
122120   AM_RANGE(0x0b9000, 0x0b9fff) AM_RAM_WRITE(twocrude_palette_24bit_b_w) AM_SHARE("paletteram2")
123121   AM_RANGE(0x0bc000, 0x0bc00f) AM_READWRITE(twocrude_control_r, twocrude_control_w)
trunk/src/mame/drivers/tumblep.c
r24015r24016
4747#include "sound/3812intf.h"
4848#include "sound/okim6295.h"
4949#include "includes/tumblep.h"
50#include "video/deco16ic.h"
5150
5251
5352#define TUMBLEP_HACK    0
r24015r24016
117116   AM_RANGE(0x180000, 0x18000f) AM_READ(tumblepop_controls_r)
118117   AM_RANGE(0x18000c, 0x18000d) AM_WRITENOP
119118   AM_RANGE(0x1a0000, 0x1a07ff) AM_RAM AM_SHARE("spriteram")
120   AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
121   AM_RANGE(0x320000, 0x320fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
122   AM_RANGE(0x322000, 0x322fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
119   AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
120   AM_RANGE(0x320000, 0x320fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
121   AM_RANGE(0x322000, 0x322fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
123122   AM_RANGE(0x340000, 0x3407ff) AM_WRITEONLY AM_SHARE("pf1_rowscroll") // unused
124123   AM_RANGE(0x342000, 0x3427ff) AM_WRITEONLY AM_SHARE("pf2_rowscroll") // unused
125124ADDRESS_MAP_END
trunk/src/mame/drivers/mirage.c
r24015r24016
9191UINT32 miragemi_state::screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
9292{
9393   address_space &space = machine().driver_data()->generic_space();
94   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
94   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
9595
9696   flip_screen_set(BIT(flip, 7));
9797
9898   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
9999
100   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
100   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
101101
102102   bitmap.fill(256, cliprect); /* not verified */
103103
104   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
104   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
105105   m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x200, 0x1ff);
106   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
106   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
107107   m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x200, 0x1ff);
108108
109109   return 0;
r24015r24016
143143static ADDRESS_MAP_START( mirage_map, AS_PROGRAM, 16, miragemi_state )
144144   AM_RANGE(0x000000, 0x07ffff) AM_ROM
145145   /* tilemaps */
146   AM_RANGE(0x100000, 0x101fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w) // 0x100000 - 0x101fff tested
147   AM_RANGE(0x102000, 0x103fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w) // 0x102000 - 0x102fff tested
146   AM_RANGE(0x100000, 0x101fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w) // 0x100000 - 0x101fff tested
147   AM_RANGE(0x102000, 0x103fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w) // 0x102000 - 0x102fff tested
148148   /* linescroll */
149149   AM_RANGE(0x110000, 0x110bff) AM_RAM AM_SHARE("pf1_rowscroll")
150150   AM_RANGE(0x112000, 0x112bff) AM_RAM AM_SHARE("pf2_rowscroll")
r24015r24016
155155//  AM_RANGE(0x140006, 0x140007) AM_READ(random_readers)
156156//  AM_RANGE(0x150006, 0x150007) AM_READNOP
157157   AM_RANGE(0x160000, 0x160001) AM_WRITENOP
158   AM_RANGE(0x168000, 0x16800f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
158   AM_RANGE(0x168000, 0x16800f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
159159   AM_RANGE(0x16a000, 0x16a001) AM_WRITENOP
160160   AM_RANGE(0x16c000, 0x16c001) AM_WRITE(okim1_rombank_w)
161161   AM_RANGE(0x16c002, 0x16c003) AM_WRITE(okim0_rombank_w)
trunk/src/mame/drivers/dietgo.c
r24015r24016
2626#include "includes/decocrpt.h"
2727#include "includes/decoprot.h"
2828#include "includes/dietgo.h"
29#include "video/deco16ic.h"
3029#include "video/decocomn.h"
3130
3231static ADDRESS_MAP_START( dietgo_map, AS_PROGRAM, 16, dietgo_state )
3332   AM_RANGE(0x000000, 0x07ffff) AM_ROM
34   AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
35   AM_RANGE(0x210000, 0x211fff) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf1_data_w)
36   AM_RANGE(0x212000, 0x213fff) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf2_data_w)
33   AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
34   AM_RANGE(0x210000, 0x211fff) AM_DEVWRITE("tilegen1", deco16ic_device, pf1_data_w)
35   AM_RANGE(0x212000, 0x213fff) AM_DEVWRITE("tilegen1", deco16ic_device, pf2_data_w)
3736   AM_RANGE(0x220000, 0x2207ff) AM_WRITEONLY AM_SHARE("pf1_rowscroll")
3837   AM_RANGE(0x222000, 0x2227ff) AM_WRITEONLY AM_SHARE("pf2_rowscroll")
3938   AM_RANGE(0x280000, 0x2807ff) AM_RAM AM_SHARE("spriteram")
trunk/src/mame/drivers/pktgaldx.c
r24015r24016
5656#include "cpu/m68000/m68000.h"
5757#include "includes/decocrpt.h"
5858#include "includes/decoprot.h"
59#include "video/deco16ic.h"
6059#include "sound/okim6295.h"
6160#include "includes/pktgaldx.h"
6261#include "video/decocomn.h"
r24015r24016
7372static ADDRESS_MAP_START( pktgaldx_map, AS_PROGRAM, 16, pktgaldx_state )
7473   AM_RANGE(0x000000, 0x07ffff) AM_ROM
7574
76   AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
77   AM_RANGE(0x102000, 0x102fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
75   AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
76   AM_RANGE(0x102000, 0x102fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
7877   AM_RANGE(0x110000, 0x1107ff) AM_RAM AM_SHARE("pf1_rowscroll")
7978   AM_RANGE(0x112000, 0x1127ff) AM_RAM AM_SHARE("pf2_rowscroll")
8079
r24015r24016
8685   AM_RANGE(0x150000, 0x15000f) AM_DEVWRITE8("oki2", okim6295_device, write, 0x00ff)
8786   AM_RANGE(0x150006, 0x150007) AM_DEVREAD8("oki2", okim6295_device, read, 0x00ff)
8887
89   AM_RANGE(0x161800, 0x16180f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
88   AM_RANGE(0x161800, 0x16180f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
9089   AM_RANGE(0x164800, 0x164801) AM_WRITE(pktgaldx_oki_bank_w)
9190   AM_RANGE(0x167800, 0x167fff) AM_READWRITE_LEGACY(deco16_104_pktgaldx_prot_r,deco16_104_pktgaldx_prot_w) AM_SHARE("prot16ram")
9291   AM_RANGE(0x170000, 0x17ffff) AM_RAM
trunk/src/mame/drivers/rohga.c
r24015r24016
133133static ADDRESS_MAP_START( rohga_map, AS_PROGRAM, 16, rohga_state )
134134   AM_RANGE(0x000000, 0x1fffff) AM_ROM
135135
136   AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
137   AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf_control_w)
136   AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
137   AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w)
138138
139139   AM_RANGE(0x280000, 0x2807ff) AM_MIRROR(0x800) AM_READWRITE_LEGACY(deco16_104_rohga_prot_r,deco16_104_rohga_prot_w)  AM_SHARE("prot16ram") /* Protection device */
140140
r24015r24016
147147   AM_RANGE(0x322000, 0x322001) AM_DEVWRITE_LEGACY("deco_common", decocomn_priority_w)
148148   AM_RANGE(0x321100, 0x321101) AM_READ(rohga_irq_ack_r) /* Irq ack?  Value not used */
149149
150   AM_RANGE(0x3c0000, 0x3c1fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
151   AM_RANGE(0x3c2000, 0x3c2fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
152   AM_RANGE(0x3c4000, 0x3c4fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
153   AM_RANGE(0x3c6000, 0x3c6fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
150   AM_RANGE(0x3c0000, 0x3c1fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
151   AM_RANGE(0x3c2000, 0x3c2fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
152   AM_RANGE(0x3c4000, 0x3c4fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w)
153   AM_RANGE(0x3c6000, 0x3c6fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w)
154154
155155   AM_RANGE(0x3c8000, 0x3c8fff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("pf1_rowscroll")
156156   AM_RANGE(0x3ca000, 0x3cafff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("pf2_rowscroll")
r24015r24016
165165static ADDRESS_MAP_START( wizdfire_map, AS_PROGRAM, 16, rohga_state )
166166   AM_RANGE(0x000000, 0x1fffff) AM_ROM
167167
168   AM_RANGE(0x200000, 0x200fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
169   AM_RANGE(0x202000, 0x202fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
170   AM_RANGE(0x208000, 0x208fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
171   AM_RANGE(0x20a000, 0x20afff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
168   AM_RANGE(0x200000, 0x200fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
169   AM_RANGE(0x202000, 0x202fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
170   AM_RANGE(0x208000, 0x208fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w)
171   AM_RANGE(0x20a000, 0x20afff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w)
172172
173173   AM_RANGE(0x20b000, 0x20b3ff) AM_WRITEONLY /* ? Always 0 written */
174174   AM_RANGE(0x20c000, 0x20c7ff) AM_RAM AM_SHARE("pf3_rowscroll")
175175   AM_RANGE(0x20e000, 0x20e7ff) AM_RAM AM_SHARE("pf4_rowscroll")
176176
177   AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
178   AM_RANGE(0x310000, 0x31000f) AM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf_control_w)
177   AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
178   AM_RANGE(0x310000, 0x31000f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w)
179179
180180   AM_RANGE(0x320000, 0x320001) AM_DEVWRITE_LEGACY("deco_common", decocomn_priority_w) /* Priority */
181181   AM_RANGE(0x320002, 0x320003) AM_WRITENOP /* ? */
r24015r24016
196196static ADDRESS_MAP_START( nitrobal_map, AS_PROGRAM, 16, rohga_state )
197197   AM_RANGE(0x000000, 0x1fffff) AM_ROM
198198
199   AM_RANGE(0x200000, 0x200fff) AM_MIRROR(0x1000) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
200   AM_RANGE(0x202000, 0x2027ff) AM_MIRROR(0x800) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
201   AM_RANGE(0x208000, 0x2087ff) AM_MIRROR(0x800) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
202   AM_RANGE(0x20a000, 0x20a7ff) AM_MIRROR(0x800) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
199   AM_RANGE(0x200000, 0x200fff) AM_MIRROR(0x1000) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
200   AM_RANGE(0x202000, 0x2027ff) AM_MIRROR(0x800) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
201   AM_RANGE(0x208000, 0x2087ff) AM_MIRROR(0x800) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w)
202   AM_RANGE(0x20a000, 0x20a7ff) AM_MIRROR(0x800) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w)
203203
204204   AM_RANGE(0x204000, 0x2047ff) AM_RAM AM_SHARE("pf1_rowscroll")
205205   AM_RANGE(0x206000, 0x2067ff) AM_RAM AM_SHARE("pf2_rowscroll")
206206   AM_RANGE(0x20c000, 0x20c7ff) AM_RAM AM_SHARE("pf3_rowscroll")
207207   AM_RANGE(0x20e000, 0x20e7ff) AM_RAM AM_SHARE("pf4_rowscroll")
208208
209   AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
210   AM_RANGE(0x310000, 0x31000f) AM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf_control_w)
209   AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
210   AM_RANGE(0x310000, 0x31000f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w)
211211
212212   AM_RANGE(0x320000, 0x320001) AM_READ_PORT("DSW3") AM_DEVWRITE_LEGACY("deco_common", decocomn_priority_w) /* Priority */
213213   AM_RANGE(0x320002, 0x320003) AM_WRITENOP /* ? */
r24015r24016
228228
229229static ADDRESS_MAP_START( schmeisr_map, AS_PROGRAM, 16, rohga_state )
230230   AM_RANGE(0x000000, 0x0fffff) AM_ROM
231   AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
232   AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf_control_w)
231   AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
232   AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w)
233233   AM_RANGE(0x280000, 0x2807ff) AM_MIRROR(0x800) AM_READWRITE_LEGACY(deco16_104_rohga_prot_r,deco16_104_rohga_prot_w) AM_SHARE("prot16ram") /* Protection device */
234234
235235   AM_RANGE(0x2c0000, 0x2c0001) AM_READ_PORT("DSW3")
r24015r24016
241241   AM_RANGE(0x322000, 0x322001) AM_DEVWRITE_LEGACY("deco_common", decocomn_priority_w)
242242   AM_RANGE(0x321100, 0x321101) AM_WRITE(wizdfire_irq_ack_w)  /* Irq ack?  Value not used */
243243
244   AM_RANGE(0x3c0000, 0x3c1fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
245   AM_RANGE(0x3c2000, 0x3c2fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
246   AM_RANGE(0x3c4000, 0x3c4fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
247   AM_RANGE(0x3c6000, 0x3c6fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
244   AM_RANGE(0x3c0000, 0x3c1fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
245   AM_RANGE(0x3c2000, 0x3c2fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
246   AM_RANGE(0x3c4000, 0x3c4fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w)
247   AM_RANGE(0x3c6000, 0x3c6fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w)
248248   AM_RANGE(0x3c8000, 0x3c8fff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("pf1_rowscroll")
249249   AM_RANGE(0x3ca000, 0x3cafff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("pf2_rowscroll")
250250   AM_RANGE(0x3cc000, 0x3ccfff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("pf3_rowscroll")
trunk/src/mame/drivers/dblewing.c
r24015r24016
112112UINT32 dblewing_state::screen_update_dblewing(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
113113{
114114   address_space &space = generic_space();
115   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
115   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
116116
117117   flip_screen_set(BIT(flip, 7));
118   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
118   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
119119
120120   bitmap.fill(0, cliprect); /* not Confirmed */
121121   machine().priority_bitmap.fill(0);
122122
123   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
124   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4);
123   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2);
124   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 4);
125125   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
126126   return 0;
127127}
r24015r24016
319319static ADDRESS_MAP_START( dblewing_map, AS_PROGRAM, 16, dblewing_state )
320320   AM_RANGE(0x000000, 0x07ffff) AM_ROM
321321
322   AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
323   AM_RANGE(0x102000, 0x102fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
322   AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
323   AM_RANGE(0x102000, 0x102fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
324324   AM_RANGE(0x104000, 0x104fff) AM_RAM AM_SHARE("pf1_rowscroll")
325325   AM_RANGE(0x106000, 0x106fff) AM_RAM AM_SHARE("pf2_rowscroll")
326326
r24015r24016
338338
339339   AM_RANGE(0x284000, 0x284001) AM_RAM
340340   AM_RANGE(0x288000, 0x288001) AM_RAM
341   AM_RANGE(0x28c000, 0x28c00f) AM_RAM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
341   AM_RANGE(0x28c000, 0x28c00f) AM_RAM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
342342   AM_RANGE(0x300000, 0x3007ff) AM_RAM AM_SHARE("spriteram")
343343   AM_RANGE(0x320000, 0x3207ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram")
344344   AM_RANGE(0xff0000, 0xff3fff) AM_MIRROR(0xc000) AM_RAM
trunk/src/mame/drivers/darkseal.c
r24015r24016
2020#include "sound/2151intf.h"
2121#include "sound/okim6295.h"
2222#include "includes/darkseal.h"
23#include "video/deco16ic.h"
2423
2524/******************************************************************************/
2625
r24015r24016
6665   AM_RANGE(0x141000, 0x141fff) AM_RAM_WRITE(darkseal_palette_24bit_b_w) AM_SHARE("paletteram2")
6766   AM_RANGE(0x180000, 0x18000f) AM_READWRITE(darkseal_control_r, darkseal_control_w)
6867
69   AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
70   AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
71   AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf_control_w)
68   AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w)
69   AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w)
70   AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w)
7271
7372   AM_RANGE(0x220000, 0x220fff) AM_RAM AM_SHARE("pf1_rowscroll")
7473   // pf2 & 4 rowscrolls are where? (maybe don't exist?)
7574   AM_RANGE(0x222000, 0x222fff) AM_RAM AM_SHARE("pf3_rowscroll")
7675
77   AM_RANGE(0x260000, 0x261fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
78   AM_RANGE(0x262000, 0x263fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
79   AM_RANGE(0x2a0000, 0x2a000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
76   AM_RANGE(0x260000, 0x261fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
77   AM_RANGE(0x262000, 0x263fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
78   AM_RANGE(0x2a0000, 0x2a000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
8079ADDRESS_MAP_END
8180
8281/******************************************************************************/
trunk/src/mame/drivers/vaportra.c
r24015r24016
1414#include "sound/2203intf.h"
1515#include "sound/2151intf.h"
1616#include "sound/okim6295.h"
17#include "video/deco16ic.h"
1817#include "includes/vaportra.h"
1918#include "video/decmxc06.h"
2019
r24015r24016
5150   AM_RANGE(0x100000, 0x100003) AM_WRITE(vaportra_priority_w)
5251   AM_RANGE(0x100006, 0x100007) AM_WRITE(vaportra_sound_w)
5352   AM_RANGE(0x100000, 0x10000f) AM_READ(vaportra_control_r)
54   AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
55   AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
56   AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf_control_w)
57   AM_RANGE(0x280000, 0x281fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
58   AM_RANGE(0x282000, 0x283fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
59   AM_RANGE(0x2c0000, 0x2c000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
53   AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w)
54   AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w)
55   AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w)
56   AM_RANGE(0x280000, 0x281fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
57   AM_RANGE(0x282000, 0x283fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
58   AM_RANGE(0x2c0000, 0x2c000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
6059   AM_RANGE(0x300000, 0x3009ff) AM_RAM_WRITE(vaportra_palette_24bit_rg_w) AM_SHARE("paletteram")
6160   AM_RANGE(0x304000, 0x3049ff) AM_RAM_WRITE(vaportra_palette_24bit_b_w) AM_SHARE("paletteram2")
6261   AM_RANGE(0x308000, 0x308001) AM_NOP
trunk/src/mame/drivers/sshangha.c
r24015r24016
5151#include "sound/2203intf.h"
5252#include "sound/okim6295.h"
5353#include "includes/sshangha.h"
54#include "video/deco16ic.h"
5554
5655#define SSHANGHA_HACK   0
5756
r24015r24016
155154   AM_RANGE(0x000000, 0x03ffff) AM_ROM
156155   AM_RANGE(0x100000, 0x10000f) AM_RAM AM_SHARE("sound_shared")
157156
158   AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
159   AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
157   AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
158   AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
160159   AM_RANGE(0x204000, 0x2047ff) AM_RAM AM_SHARE("pf1_rowscroll")
161160   AM_RANGE(0x206000, 0x2067ff) AM_RAM AM_SHARE("pf2_rowscroll")
162161   AM_RANGE(0x206800, 0x207fff) AM_RAM
163   AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
162   AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
164163   AM_RANGE(0x320000, 0x320001) AM_WRITE(sshangha_video_w)
165164   AM_RANGE(0x320002, 0x320005) AM_WRITENOP
166165   AM_RANGE(0x320006, 0x320007) AM_READNOP //irq ack
r24015r24016
187186   AM_RANGE(0x084000, 0x0847ff) AM_READ(sshanghb_protection16_r)
188187   AM_RANGE(0x101000, 0x10100f) AM_RAM AM_SHARE("sound_shared") /* the bootleg writes here */
189188
190   AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
191   AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
189   AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w)
190   AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w)
192191   AM_RANGE(0x204000, 0x2047ff) AM_RAM AM_SHARE("pf1_rowscroll")
193192   AM_RANGE(0x206000, 0x2067ff) AM_RAM AM_SHARE("pf2_rowscroll")
194193   AM_RANGE(0x206800, 0x207fff) AM_RAM
195   AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w)
194   AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
196195   AM_RANGE(0x320000, 0x320001) AM_WRITE(sshangha_video_w)
197196   AM_RANGE(0x320002, 0x320005) AM_WRITENOP
198197   AM_RANGE(0x320006, 0x320007) AM_READNOP //irq ack
trunk/src/mame/includes/supbtime.h
r24015r24016
55*************************************************************************/
66
77#include "video/decospr.h"
8#include "video/deco16ic.h"
89
910class supbtime_state : public driver_device
1011{
trunk/src/mame/includes/pktgaldx.h
r24015r24016
55*************************************************************************/
66#include "sound/okim6295.h"
77#include "video/decospr.h"
8#include "video/deco16ic.h"
89
910class pktgaldx_state : public driver_device
1011{
trunk/src/mame/includes/vaportra.h
r24015r24016
55*************************************************************************/
66
77#include "video/bufsprite.h"
8#include "video/deco16ic.h"
89
910class vaportra_state : public driver_device
1011{
trunk/src/mame/video/boogwing.c
r24015r24016
180180UINT32 boogwing_state::screen_update_boogwing(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
181181{
182182   address_space &space = machine().driver_data()->generic_space();
183   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
183   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
184184   UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff);
185185
186186   /* Draw sprite planes to bitmaps for later mixing */
r24015r24016
188188   m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true);
189189
190190   flip_screen_set(BIT(flip, 7));
191   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
192   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
191   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
192   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
193193
194194   /* Draw playfields */
195195   bitmap.fill(machine().pens[0x400], cliprect); /* pen not confirmed */
r24015r24016
199199   // bit&0x4 combines playfields
200200   if ((priority & 0x7) == 0x5)
201201   {
202      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
203      deco16ic_tilemap_12_combine_draw(m_deco_tilegen2, bitmap, cliprect, 0, 32);
202      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
203      m_deco_tilegen2->tilemap_12_combine_draw(bitmap, cliprect, 0, 32);
204204   }
205205   else if ((priority & 0x7) == 0x1 || (priority & 0x7) == 0x2)
206206   {
207      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
208      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 8);
209      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 32);
207      m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
208      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 8);
209      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 32);
210210   }
211211   else if ((priority & 0x7) == 0x3)
212212   {
213      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
214      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 8);
213      m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
214      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 8);
215215
216216      // This mode uses playfield 3 to shadow sprites & playfield 2 (instead of
217217      // regular alpha-blending, the destination is inverted).  Not yet implemented.
218      // deco16ic_tilemap_3_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_ALPHA(0x80), 32);
218      // m_deco_tilegen1->tilemap_3_draw(bitmap, cliprect, TILEMAP_DRAW_ALPHA(0x80), 32);
219219   }
220220   else
221221   {
222      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
223      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 8);
224      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 32);
222      m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
223      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 8);
224      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 32);
225225   }
226226
227227   mix_boogwing(bitmap,cliprect);
228228
229   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
229   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
230230   return 0;
231231}
trunk/src/mame/video/pktgaldx.c
r24015r24016
11#include "emu.h"
2#include "video/deco16ic.h"
32#include "includes/pktgaldx.h"
43
54/* Video on the orginal */
r24015r24016
76UINT32 pktgaldx_state::screen_update_pktgaldx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
87{
98   address_space &space = machine().driver_data()->generic_space();
10   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
9   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
1110
1211   flip_screen_set(BIT(flip, 7));
13   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
12   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
1413
1514   bitmap.fill(0, cliprect); /* not Confirmed */
1615   machine().priority_bitmap.fill(0);
1716
18   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
17   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0);
1918   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400, true);
20   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
19   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
2120   return 0;
2221}
2322
trunk/src/mame/video/cninja.c
r24015r24016
55****************************************************************************/
66
77#include "emu.h"
8#include "video/deco16ic.h"
98#include "includes/cninja.h"
109#include "video/decocomn.h"
1110
r24015r24016
1413VIDEO_START_MEMBER(cninja_state,stoneage)
1514{
1615   /* The bootleg has broken scroll registers */
17   deco16ic_set_scrolldx(m_deco_tilegen1, 3, 0, -10, -10); /* pf4 16x16 tilemap */
18   deco16ic_set_scrolldx(m_deco_tilegen1, 1, 0, -10, -10); /* pf2 16x16 tilemap */
19   deco16ic_set_scrolldx(m_deco_tilegen1, 0, 1, 2, 2); /* pf1 8x8 tilemap */
16   m_deco_tilegen1->set_scrolldx(3, 0, -10, -10); /* pf4 16x16 tilemap */
17   m_deco_tilegen1->set_scrolldx(1, 0, -10, -10); /* pf2 16x16 tilemap */
18   m_deco_tilegen1->set_scrolldx(0, 1, 2, 2); /* pf1 8x8 tilemap */
2019}
2120
2221/******************************************************************************/
r24015r24016
124123UINT32 cninja_state::screen_update_cninja(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
125124{
126125   address_space &space = machine().driver_data()->generic_space();
127   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
126   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
128127
129128   flip_screen_set(BIT(flip, 7));
130   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
131   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
129   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
130   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
132131
133132   /* Draw playfields */
134133   machine().priority_bitmap.fill(0, cliprect);
135134   bitmap.fill(512, cliprect);
136   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
137   deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2);
138   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2);
139   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4);
135   m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
136   m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2);
137   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2);
138   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4);
140139   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
141   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
140   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
142141   return 0;
143142}
144143
145144UINT32 cninja_state::screen_update_cninjabl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
146145{
147146   address_space &space = machine().driver_data()->generic_space();
148   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
147   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
149148
150149   /* force layers to be enabled */
151   deco16ic_set_enable(m_deco_tilegen2, 0, 1 );
152   deco16ic_set_enable(m_deco_tilegen2, 1, 1 );
150   m_deco_tilegen2->set_enable(0, 1 );
151   m_deco_tilegen2->set_enable(1, 1 );
153152
154153   flip_screen_set(BIT(flip, 7));
155   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
156   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
154   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
155   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
157156
158157   /* Draw playfields */
159158   machine().priority_bitmap.fill(0, cliprect);
160159   bitmap.fill(512, cliprect);
161   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
162   deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2);
163   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2);
164   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4);
160   m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
161   m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2);
162   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2);
163   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4);
165164   cninjabl_draw_sprites(bitmap, cliprect);
166   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
165   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
167166   return 0;
168167}
169168
170169UINT32 cninja_state::screen_update_edrandy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
171170{
172171   address_space &space = machine().driver_data()->generic_space();
173   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
172   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
174173
175174   flip_screen_set(BIT(flip, 7));
176   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
177   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
175   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
176   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
178177
179178   machine().priority_bitmap.fill(0, cliprect);
180179   bitmap.fill(0, cliprect);
181   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
182   deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2);
183   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4);
180   m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
181   m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2);
182   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 4);
184183   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
185   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
184   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
186185   return 0;
187186}
188187
189188UINT32 cninja_state::screen_update_robocop2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
190189{
191190   address_space &space = machine().driver_data()->generic_space();
192   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
191   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
193192   UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff);
194193
195194   /* One of the tilemap chips can switch between 2 tilemaps at 4bpp, or 1 at 8bpp */
196195   if (priority & 4)
197196   {
198      deco16ic_set_tilemap_colour_mask(m_deco_tilegen1, 2, 0);
199      deco16ic_set_tilemap_colour_mask(m_deco_tilegen1, 3, 0);
200      deco16ic_pf12_set_gfxbank(m_deco_tilegen2, 0, 4);
197      m_deco_tilegen1->set_tilemap_colour_mask(2, 0);
198      m_deco_tilegen1->set_tilemap_colour_mask(3, 0);
199      m_deco_tilegen2->pf12_set_gfxbank(0, 4);
201200   }
202201   else
203202   {
204      deco16ic_set_tilemap_colour_mask(m_deco_tilegen1, 2, 0xf);
205      deco16ic_set_tilemap_colour_mask(m_deco_tilegen1, 3, 0xf);
206      deco16ic_pf12_set_gfxbank(m_deco_tilegen2, 0, 2);
203      m_deco_tilegen1->set_tilemap_colour_mask(2, 0xf);
204      m_deco_tilegen1->set_tilemap_colour_mask(3, 0xf);
205      m_deco_tilegen2->pf12_set_gfxbank(0, 2);
207206   }
208207
209208   /* Update playfields */
210209   flip_screen_set(BIT(flip, 7));
211   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
212   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
210   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
211   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
213212
214213   /* Draw playfields */
215214   machine().priority_bitmap.fill(0, cliprect);
216215   bitmap.fill(0x200, cliprect);
217216
218217   if ((priority & 4) == 0)
219      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
218      m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
220219
221220   /* Switchable priority */
222221   switch (priority & 0x8)
223222   {
224223      case 8:
225         deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
226         deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4);
224         m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2);
225         m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 4);
227226         break;
228227      default:
229228      case 0:
230         deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2);
231         deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4);
229         m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2);
230         m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 4);
232231         break;
233232   }
234233
235234   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
236   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
235   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
237236   return 0;
238237}
239238
r24015r24016
246245UINT32 cninja_state::screen_update_mutantf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
247246{
248247   address_space &space = machine().driver_data()->generic_space();
249   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
248   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
250249   UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff);
251250
252251
253252   flip_screen_set(BIT(flip, 7));
254   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
255   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
253   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
254   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
256255
257256   /* Draw playfields */
258257   bitmap.fill(0x400, cliprect); /* Confirmed */
r24015r24016
274273   The other bits may control alpha blend on the 2nd sprite chip, or
275274   layer order.
276275   */
277   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
278   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
279   deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
276   m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
277   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0);
278   m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 0);
280279
281280
282281   if (priority & 1)
r24015r24016
289288      m_sprgen2->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 1024+768, 0x0ff, 0x80);  // fixed alpha of 0x80 for this layer?
290289      m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x100, 0x1ff);
291290   }
292   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
291   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
293292   return 0;
294293}
trunk/src/mame/video/dietgo.c
r24015r24016
11#include "emu.h"
2#include "video/deco16ic.h"
32#include "includes/dietgo.h"
43
54UINT32 dietgo_state::screen_update_dietgo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
65{
76   address_space &space = machine().driver_data()->generic_space();
8   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
7   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
98
109   flip_screen_set(BIT(flip, 7));
11   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
10   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
1211
1312   bitmap.fill(256, cliprect); /* not verified */
1413
15   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
16   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
14   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
15   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
1716
1817   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
1918   return 0;
trunk/src/mame/video/simpl156.c
r24015r24016
44
55#include "emu.h"
66#include "includes/simpl156.h"
7#include "video/deco16ic.h"
87
98
109
r24015r24016
2827{
2928   machine().priority_bitmap.fill(0);
3029
31   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
30   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
3231
3332   bitmap.fill(256, cliprect);
3433
35   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
36   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4);
34   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2);
35   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 4);
3736
3837   //FIXME: flip_screen_x should not be written!
3938   flip_screen_set_no_update(1);
trunk/src/mame/video/cbuster.c
r24015r24016
66
77#include "emu.h"
88#include "includes/cbuster.h"
9#include "video/deco16ic.h"
109
1110/******************************************************************************/
1211
r24015r24016
4948UINT32 cbuster_state::screen_update_twocrude(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
5049{
5150   address_space &space = machine().driver_data()->generic_space();
52   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
51   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
5352
5453   flip_screen_set(!BIT(flip, 7));
5554
5655   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram16_buffer, 0x400);
5756
5857
59   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
60   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
58   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
59   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
6160
6261   /* Draw playfields & sprites */
63   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
62   m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
6463   m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0900, 0x100, 0x0ff);
6564   m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0900, 0x0900, 0x500, 0x0ff);
6665
6766   if (m_pri)
6867   {
69      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
70      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
68      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0);
69      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 0);
7170   }
7271   else
7372   {
74      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
75      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
73      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 0);
74      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0);
7675   }
7776
7877   m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0900, 0x100, 0x0ff);
7978   m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0100, 0x0900, 0x500, 0x0ff);
80   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
79   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
8180   return 0;
8281}
trunk/src/mame/video/darkseal.c
r24015r24016
2020
2121#include "emu.h"
2222#include "includes/darkseal.h"
23#include "video/deco16ic.h"
2423
2524/***************************************************************************/
2625
r24015r24016
6362
6463   bitmap.fill(get_black_pen(machine()), cliprect);
6564
66   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf1_rowscroll);
67   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf3_rowscroll);
65   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf1_rowscroll);
66   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf3_rowscroll);
6867
69   deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
70   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
68   m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 0);
69   m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, 0, 0);
7170
72   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
71   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
7372   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400);
74   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
73   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0);
7574
7675   return 0;
7776}
trunk/src/mame/video/vaportra.c
r24015r24016
1010***************************************************************************/
1111
1212#include "emu.h"
13#include "video/deco16ic.h"
1413#include "includes/vaportra.h"
1514#include "video/decmxc06.h"
1615
r24015r24016
5251UINT32 vaportra_state::screen_update_vaportra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
5352{
5453   address_space &space = machine().driver_data()->generic_space();
55   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
54   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
5655   int pri = m_priority[0] & 0x03;
5756
5857   flip_screen_set(!BIT(flip, 7));
59   deco16ic_pf_update(m_deco_tilegen1, 0, 0);
60   deco16ic_pf_update(m_deco_tilegen2, 0, 0);
58   m_deco_tilegen1->pf_update(0, 0);
59   m_deco_tilegen2->pf_update(0, 0);
6160
6261   machine().device<deco_mxc06_device>("spritegen")->set_pri_type(1); // force priorities to be handled in a different way for this driver for now
6362
6463   /* Draw playfields */
6564   if (pri == 0)
6665   {
67      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
68      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
66      m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
67      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 0);
6968      machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f);
70      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
69      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0);
7170   }
7271   else if (pri == 1)
7372   {
74      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
75      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
73      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
74      m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, 0, 0);
7675      machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f);
77      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
76      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0);
7877   }
7978   else if (pri == 2)
8079   {
81      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
82      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
80      m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
81      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0);
8382      machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f);
84      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
83      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 0);
8584   }
8685   else
8786   {
88      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
89      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
87      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
88      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0);
9089      machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f);
91      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
90      m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, 0, 0);
9291   }
9392
9493   machine().device<deco_mxc06_device>("spritegen")->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 1, m_priority[1], 0x0f);
95   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
94   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
9695   return 0;
9796}
trunk/src/mame/video/tumblep.c
r24015r24016
1414***************************************************************************/
1515
1616#include "emu.h"
17#include "video/deco16ic.h"
1817#include "includes/tumblep.h"
1918
2019
2120UINT32 tumblep_state::screen_update_tumblep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
2221{
2322   address_space &space = machine().driver_data()->generic_space();
24   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
23   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
2524
2625   flip_screen_set(BIT(flip, 7));
27   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
26   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
2827
2928   bitmap.fill(256, cliprect); /* not verified */
3029
31   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
32   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
30   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
31   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
3332
3433   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
3534   return 0;
trunk/src/mame/video/sshangha.c
r24015r24016
4040
4141   bitmap.fill(get_black_pen(machine()), cliprect);
4242
43   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
43   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
4444
4545   /* the tilemap 4bpp + 4bpp = 8bpp mixing actually seems external to the tilemap, note video_control is not part of the tilemap chip */
4646   if ((m_video_control&4)==0) {
47      deco16ic_tilemap_12_combine_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0, 1);
47      m_deco_tilegen1->tilemap_12_combine_draw(bitmap, cliprect, 0, 0, 1);
4848      m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff);
4949   }
5050   else {
51      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
51      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0);
5252      m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff);
53      deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
53      m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
5454   }
5555
5656   if (m_spriteram2 != NULL)
trunk/src/mame/video/funkyjet.c
r24015r24016
66
77#include "emu.h"
88#include "includes/funkyjet.h"
9#include "video/deco16ic.h"
109
1110/******************************************************************************/
1211
1312UINT32 funkyjet_state::screen_update_funkyjet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
1413{
1514   address_space &space = machine().driver_data()->generic_space();
16   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
15   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
1716
1817   flip_screen_set(BIT(flip, 7));
19   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
18   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
2019
2120   bitmap.fill(768, cliprect);
22   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
23   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
21   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
22   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
2423   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
2524   return 0;
2625}
trunk/src/mame/video/deco32.c
r24015r24016
11#include "emu.h"
22#include "includes/deco32.h"
3#include "video/deco16ic.h"
43
54/******************************************************************************/
65
r24015r24016
573572   machine().priority_bitmap.fill(0, cliprect);
574573   bitmap.fill(machine().pens[0x000], cliprect); // Palette index not confirmed
575574
576   deco16ic_set_pf1_8bpp_mode(m_deco_tilegen2, 1);
575   m_deco_tilegen2->set_pf1_8bpp_mode(1);
577576
578   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
579   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
577   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
578   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
580579
581580   // pf4 not used (because pf3 is in 8bpp mode)
582581
583582   if ((m_pri&1)==0)
584583   {
585      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 1);
586      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
584      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 1);
585      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2);
587586   }
588587   else
589588   {
590      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 1);
591      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2);
589      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 1);
590      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2);
592591   }
593592
594   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4);
593   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 4);
595594
596595   m_sprgen->set_alt_format(true);
597596   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x400);
r24015r24016
603602{
604603   bitmap.fill(get_black_pen(machine()), cliprect);
605604
606   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
607   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
605   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
606   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
608607
609   //deco16ic_set_pf3_8bpp_mode(m_deco_tilegen1, 1); // despite being 8bpp this doesn't require the same shifting as captaven, why not?
608   //m_deco_tilegen1->set_pf3_8bpp_mode(1); // despite being 8bpp this doesn't require the same shifting as captaven, why not?
610609
611   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0); // it uses pf3 in 8bpp mode instead, like captaven
612   deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
613   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
610   m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, 0, 0); // it uses pf3 in 8bpp mode instead, like captaven
611   m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 0);
612   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0);
614613
615614   // zooming sprite draw is very slow, and sprites are buffered.. however, one of the levels attempts to use
616615   // partial updates for every line, which causes things to be very slow... the sprites appear to support
r24015r24016
627626      rectangle clip(cliprect.min_x, cliprect.max_x, 8, 247);
628627
629628      dragngun_draw_sprites(bitmap,clip,m_spriteram->buffer());
630      deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, clip, 0, 0);
629      m_deco_tilegen1->tilemap_1_draw(bitmap, clip, 0, 0);
631630
632631   }
633632
r24015r24016
640639   machine().priority_bitmap.fill(0, cliprect);
641640   bitmap.fill(machine().pens[0x000], cliprect); // Palette index not confirmed
642641
643   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
644   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
642   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
643   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
645644
646645   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x800, true);
647646
648647   /* Draw screen */
649   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 1);
648   m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, 0, 1);
650649
651650   if(m_pri&1)
652651   {
653      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
652      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2);
654653      m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff);
655      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4);
654      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 4);
656655   }
657656   else
658657   {
659      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2);
658      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2);
660659      m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff);
661      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4);
660      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 4);
662661   }
663662
664663   m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 1024, 0x1ff);
665664
666   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
665   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
667666   return 0;
668667}
669668
r24015r24016
809808UINT32 deco32_state::screen_update_nslasher(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
810809{
811810   int alphaTilemap=0;
812   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
813   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
811   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
812   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
814813
815814   /* This is not a conclusive test for deciding if tilemap needs alpha blending */
816815   if (m_ace_ram[0x17]!=0x0 && m_pri)
r24015r24016
837836   /* Draw playfields & sprites */
838837   if (m_pri&2)
839838   {
840      deco16ic_tilemap_12_combine_draw(m_deco_tilegen2, bitmap, cliprect, 0, 1, 1);
841      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4);
839      m_deco_tilegen2->tilemap_12_combine_draw(bitmap, cliprect, 0, 1, 1);
840      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 4);
842841   }
843842   else
844843   {
845      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 1);
844      m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, 0, 1);
846845      if (m_pri&1)
847846      {
848         deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
847         m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2);
849848         if (alphaTilemap)
850            deco16ic_tilemap_1_draw(m_deco_tilegen2, *m_tilemap_alpha_bitmap, cliprect, 0, 4);
849            m_deco_tilegen2->tilemap_1_draw(*m_tilemap_alpha_bitmap, cliprect, 0, 4);
851850         else
852            deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4);
851            m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 4);
853852      }
854853      else
855854      {
856         deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2);
855         m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2);
857856         if (alphaTilemap)
858            deco16ic_tilemap_2_draw(m_deco_tilegen1, *m_tilemap_alpha_bitmap, cliprect, 0, 4);
857            m_deco_tilegen1->tilemap_2_draw(*m_tilemap_alpha_bitmap, cliprect, 0, 4);
859858         else
860            deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4);
859            m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 4);
861860      }
862861   }
863862
864863   mixDualAlphaSprites(bitmap, cliprect, machine().gfx[3], machine().gfx[4], alphaTilemap);
865864
866   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
865   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
867866   return 0;
868867}
trunk/src/mame/video/rohga.c
r24015r24016
66
77#include "emu.h"
88#include "includes/rohga.h"
9#include "video/deco16ic.h"
109
1110
1211WRITE16_MEMBER(rohga_state::rohga_buffer_spriteram16_w)
r24015r24016
6463UINT32 rohga_state::screen_update_rohga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
6564{
6665   address_space &space = machine().driver_data()->generic_space();
67   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
66   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
6867   UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff);
6968
7069   /* Update playfields */
7170   flip_screen_set(BIT(flip, 7));
72   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
73   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
71   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
72   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
7473
7574   /* Draw playfields */
7675   machine().priority_bitmap.fill(0, cliprect);
r24015r24016
8281      if (priority & 4)
8382      {
8483         // Draw as 1 8BPP layer
85         deco16ic_tilemap_12_combine_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 3);
84         m_deco_tilegen2->tilemap_12_combine_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 3);
8685      }
8786      else
8887      {
8988         // Draw as 2 4BPP layers
90         deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
91         deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2);
89         m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
90         m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2);
9291      }
93      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4);
92      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 4);
9493      break;
9594   case 1:
96      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
97      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2);
98      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4);
95      m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
96      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2);
97      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 4);
9998      break;
10099   case 2:
101      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
102      deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2);
103      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4);
100      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
101      m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, 0, 2);
102      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 4);
104103      break;
105104   }
106105
107106   m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true);
108   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
107   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
109108
110109   return 0;
111110}
r24015r24016
167166UINT32 rohga_state::screen_update_wizdfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
168167{
169168   address_space &space = machine().driver_data()->generic_space();
170   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
169   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
171170   UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff);
172171
173172   /* draw sprite gfx to temp bitmaps */
r24015r24016
176175
177176   /* Update playfields */
178177   flip_screen_set(BIT(flip, 7));
179   deco16ic_pf_update(m_deco_tilegen1, 0, 0);
180   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
178   m_deco_tilegen1->pf_update(0, 0);
179   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
181180
182181   /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */
183182   bitmap.fill(machine().pens[512], cliprect);
184183
185   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
184   m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
186185   m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0600, 0x0600, 0x400, 0x1ff);
187   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
186   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0);
188187   m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0400, 0x0600, 0x400, 0x1ff);
189188
190189   if ((priority & 0x1f) == 0x1f) /* Wizdfire has bit 0x40 always set, Dark Seal 2 doesn't?! */
191      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_ALPHA(0x80), 0);
190      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, TILEMAP_DRAW_ALPHA(0x80), 0);
192191   else
193      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0);
192      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 0);
194193
195194   m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0400, 0x400, 0x1ff); // 0x000 and 0x200 of 0x600
196195
197196   mixwizdfirelayer(bitmap, cliprect, 4, 0x000, 0x000);
198197
199   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
198   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
200199   return 0;
201200}
202201
203202UINT32 rohga_state::screen_update_nitrobal(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
204203{
205204   address_space &space = machine().driver_data()->generic_space();
206   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
205   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
207206
208207   /* draw sprite gfx to temp bitmaps */
209208   m_sprgen1->set_alt_format(true);
r24015r24016
213212
214213   /* Update playfields */
215214   flip_screen_set(BIT(flip, 7));
216   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
217   deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll);
215   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
216   m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll);
218217
219218   /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */
220219   bitmap.fill(machine().pens[512], cliprect);
221220   machine().priority_bitmap.fill(0);
222221
223222   /* pf3 and pf4 are combined into a single 8bpp bitmap */
224   deco16ic_tilemap_12_combine_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
223   m_deco_tilegen2->tilemap_12_combine_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
225224
226   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 16);
225   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 16);
227226
228227   /* ToDo reimplement priorities + mixing / alpha, it was busted worse than this before anyway, so no big loss that we don't do it for now ;-) */
229228   m_sprgen2->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x600, 0xff);
230229   m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x400, 0x1ff);
231230
232231
233   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
232   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
234233   return 0;
235234}
trunk/src/mame/video/deco16ic.c
r24015r24016
164164#include "ui.h"
165165
166166
167struct deco16ic_state
167const device_type DECO16IC = &device_creator<deco16ic_device>;
168
169deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
170   : device_t(mconfig, DECO16IC, "Data East IC 55 / 56 / 74 / 141", tag, owner, clock, "deco16ic", __FILE__),
171   m_screen(NULL),
172   m_pf1_data(NULL),
173   m_pf2_data(NULL),
174   m_pf12_control(NULL),
175   m_pf1_rowscroll_ptr(NULL),
176   m_pf2_rowscroll_ptr(NULL),
177   m_use_custom_pf1(0),
178   m_use_custom_pf2(0),
179   m_pf1_bank(0),
180   m_pf2_bank(0),
181   m_pf12_last_small(0),
182   m_pf12_last_big(0),
183   m_pf1_8bpp_mode(0)
168184{
169   screen_device *screen;
170185
171   UINT16 *pf1_data, *pf2_data;
172   UINT16 *pf12_control;
186}
173187
174   const UINT16 *pf1_rowscroll_ptr, *pf2_rowscroll_ptr;
188//-------------------------------------------------
189//  device_config_complete - perform any
190//  operations now that the configuration is
191//  complete
192//-------------------------------------------------
175193
176   tilemap_t *pf1_tilemap_16x16, *pf2_tilemap_16x16;
177   tilemap_t *pf1_tilemap_8x8, *pf2_tilemap_8x8;
194void deco16ic_device::device_config_complete()
195{
196   // inherit a copy of the static data
197   const deco16ic_interface *intf = reinterpret_cast<const deco16ic_interface *>(static_config());
198   if (intf != NULL)
199   *static_cast<deco16ic_interface *>(this) = *intf;
200   
201   // or initialize to defaults if none provided
202   else
203   {
204   m_screen_tag = "";
205   m_bank_cb0 = NULL;
206   m_bank_cb1 = NULL;
207   }
208}
178209
179   deco16_bank_cb  bank_cb[2];
210//-------------------------------------------------
211//  device_start - device-specific startup
212//-------------------------------------------------
180213
181   int use_custom_pf1, use_custom_pf2;
214void deco16ic_device::device_start()
215{
216   m_bank_cb_func[0] = m_bank_cb0;
217   m_bank_cb_func[1] = m_bank_cb1;
182218
183   int pf1_bank, pf2_bank;
184   int pf12_16x16_gfx_bank, pf12_8x8_gfx_bank;
185   int pf1_colourmask, pf2_colourmask;
186   int pf1_colour_bank, pf2_colour_bank;
187   int pf1_trans_mask, pf2_trans_mask;
219   int fullheight = 0;
220   int fullwidth = 0;
188221
189   int pf12_last_small, pf12_last_big;
222   if (m_full_width12&2)
223      fullheight = 1;
190224
191   int pf1_8bpp_mode;
192};
225   if (m_full_width12&1)
226      fullwidth = 1;
193227
194/*****************************************************************************
195    INLINE FUNCTIONS
196*****************************************************************************/
228   m_pf1_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ?64 : 32);
229//  m_pf1_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, m_full_width12 ? 64 : 32, 32);
230   m_pf1_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, 64 , 32); // nitroball
197231
198INLINE deco16ic_state *get_safe_token( device_t *device )
199{
200   assert(device != NULL);
201   assert(device->type() == DECO16IC);
232   if (m_split)
233      m_pf2_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32);
234   else
235      m_pf2_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32);
202236
203   return (deco16ic_state *)downcast<deco16ic_device *>(device)->token();
237   m_pf2_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, fullwidth ? 64 : 32, fullheight ? 64 : 32);
238
239   m_pf1_tilemap_8x8->set_transparent_pen(0);
240   m_pf2_tilemap_8x8->set_transparent_pen(0);
241   m_pf1_tilemap_16x16->set_transparent_pen(0);
242   m_pf2_tilemap_16x16->set_transparent_pen(0);
243
244   if (m_split) /* Caveman Ninja only */
245      m_pf2_tilemap_16x16->set_transmask(0, 0x00ff, 0xff01);
246
247   m_pf1_8bpp_mode = 0;
248
249   m_pf1_data = auto_alloc_array_clear(machine(), UINT16, 0x2000 / 2);
250   m_pf2_data = auto_alloc_array_clear(machine(), UINT16, 0x2000 / 2);
251   m_pf12_control = auto_alloc_array_clear(machine(), UINT16, 0x10 / 2);
252
253
254   save_item(NAME(m_use_custom_pf1));
255   save_item(NAME(m_use_custom_pf2));
256   save_item(NAME(m_pf1_bank));
257   save_item(NAME(m_pf2_bank));
258   save_item(NAME(m_pf12_8x8_gfx_bank));
259   save_item(NAME(m_pf12_16x16_gfx_bank));
260   save_item(NAME(m_pf12_last_small));
261   save_item(NAME(m_pf12_last_big));
262
263   save_item(NAME(m_pf1_8bpp_mode));
264
265   save_pointer(NAME(m_pf1_data), 0x2000 / 2);
266   save_pointer(NAME(m_pf2_data), 0x2000 / 2);
267   save_pointer(NAME(m_pf12_control), 0x10 / 2);
204268}
205269
206INLINE const deco16ic_interface *get_interface( device_t *device )
270//-------------------------------------------------
271//  device_reset - device-specific reset
272//-------------------------------------------------
273
274void deco16ic_device::device_reset()
207275{
208   assert(device != NULL);
209   assert((device->type() == DECO16IC));
210   return (const deco16ic_interface *) device->static_config();
276   m_pf1_bank = m_pf2_bank = 0;
277   m_pf12_last_small = m_pf12_last_big = -1;
278   m_use_custom_pf1 = m_use_custom_pf2 = 0;
279   m_pf1_rowscroll_ptr = 0;
280   m_pf2_rowscroll_ptr = 0;
211281}
212282
213283/*****************************************************************************************/
r24015r24016
220290
221291TILE_GET_INFO_MEMBER(deco16ic_device::get_pf2_tile_info)
222292{
223   deco16ic_state *deco16ic = get_safe_token(this);
224   UINT16 tile = deco16ic->pf2_data[tile_index];
293   UINT16 tile = m_pf2_data[tile_index];
225294   UINT8 colour = (tile >> 12) & 0xf;
226295   UINT8 flags = 0;
227296
228297   if (tile & 0x8000)
229298   {
230      if ((deco16ic->pf12_control[6] >> 8) & 0x01)
299      if ((m_pf12_control[6] >> 8) & 0x01)
231300      {
232301         flags |= TILE_FLIPX;
233302         colour &= 0x7;
234303      }
235      if ((deco16ic->pf12_control[6] >> 8) & 0x02)
304      if ((m_pf12_control[6] >> 8) & 0x02)
236305      {
237306         flags |= TILE_FLIPY;
238307         colour &= 0x7;
r24015r24016
240309   }
241310
242311   SET_TILE_INFO_MEMBER(
243         deco16ic->pf12_16x16_gfx_bank,
244         (tile & 0xfff) | deco16ic->pf2_bank,
245         (colour & deco16ic->pf2_colourmask) + deco16ic->pf2_colour_bank,
312         m_pf12_16x16_gfx_bank,
313         (tile & 0xfff) | m_pf2_bank,
314         (colour & m_pf2_colourmask) + m_pf2_colour_bank,
246315         flags);
247316}
248317
249318TILE_GET_INFO_MEMBER(deco16ic_device::get_pf1_tile_info)
250319{
251   deco16ic_state *deco16ic = get_safe_token(this);
252   UINT16 tile = deco16ic->pf1_data[tile_index];
320   UINT16 tile = m_pf1_data[tile_index];
253321   UINT8 colour = (tile >> 12) & 0xf;
254322   UINT8 flags = 0;
255323
256324   if (tile & 0x8000)
257325   {
258      if ((deco16ic->pf12_control[6] >> 0) & 0x01)
326      if ((m_pf12_control[6] >> 0) & 0x01)
259327      {
260328         flags |= TILE_FLIPX;
261329         colour &= 0x7;
262330      }
263      if ((deco16ic->pf12_control[6] >> 0) & 0x02)
331      if ((m_pf12_control[6] >> 0) & 0x02)
264332      {
265333         flags |= TILE_FLIPY;
266334         colour &= 0x7;
267335      }
268336   }
269337
270   if (deco16ic->pf1_8bpp_mode)
338   if (m_pf1_8bpp_mode)
271339   {
272340      // Captain America operates this chip in 8bpp mode.
273341      // In 8bpp mode you appear to only get 1 layer, not 2, but you also
274342      // have an extra 2 tile bits, and 2 less colour bits.
275343      SET_TILE_INFO_MEMBER(
276            deco16ic->pf12_16x16_gfx_bank,
277            (tile & 0x3fff) | deco16ic->pf1_bank,
278            ((colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank)>>2,
344            m_pf12_16x16_gfx_bank,
345            (tile & 0x3fff) | m_pf1_bank,
346            ((colour & m_pf1_colourmask) + m_pf1_colour_bank)>>2,
279347            flags);
280348   }
281349   else
282350   {
283351      SET_TILE_INFO_MEMBER(
284            deco16ic->pf12_16x16_gfx_bank,
285            (tile & 0xfff) | deco16ic->pf1_bank,
286            (colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank,
352            m_pf12_16x16_gfx_bank,
353            (tile & 0xfff) | m_pf1_bank,
354            (colour & m_pf1_colourmask) + m_pf1_colour_bank,
287355            flags);
288356   }
289357}
290358
291359TILE_GET_INFO_MEMBER(deco16ic_device::get_pf2_tile_info_b)
292360{
293   deco16ic_state *deco16ic = get_safe_token(this);
294   UINT16 tile = deco16ic->pf2_data[tile_index];
361   UINT16 tile = m_pf2_data[tile_index];
295362   UINT8 colour = (tile >> 12) & 0xf;
296363   UINT8 flags = 0;
297364
298365   if (tile & 0x8000)
299366   {
300      if ((deco16ic->pf12_control[6] >> 8) & 0x01)
367      if ((m_pf12_control[6] >> 8) & 0x01)
301368      {
302369         flags |= TILE_FLIPX;
303370         colour &= 0x7;
304371      }
305      if ((deco16ic->pf12_control[6] >> 8) & 0x02)
372      if ((m_pf12_control[6] >> 8) & 0x02)
306373      {
307374         flags |= TILE_FLIPY;
308375         colour &= 0x7;
r24015r24016
310377   }
311378
312379   SET_TILE_INFO_MEMBER(
313         deco16ic->pf12_8x8_gfx_bank,
314         (tile & 0xfff) | deco16ic->pf2_bank,
315         (colour & deco16ic->pf2_colourmask) + deco16ic->pf2_colour_bank,
380         m_pf12_8x8_gfx_bank,
381         (tile & 0xfff) | m_pf2_bank,
382         (colour & m_pf2_colourmask) + m_pf2_colour_bank,
316383         flags);
317384}
318385
319386TILE_GET_INFO_MEMBER(deco16ic_device::get_pf1_tile_info_b)
320387{
321   deco16ic_state *deco16ic = get_safe_token(this);
322   UINT16 tile = deco16ic->pf1_data[tile_index];
388   UINT16 tile = m_pf1_data[tile_index];
323389   UINT8 colour = (tile >> 12) & 0xf;
324390   UINT8 flags = 0;
325391
326392   if (tile & 0x8000)
327393   {
328      if ((deco16ic->pf12_control[6] >> 0) & 0x01)
394      if ((m_pf12_control[6] >> 0) & 0x01)
329395      {
330396         flags |= TILE_FLIPX;
331397         colour &= 0x7;
332398      }
333      if ((deco16ic->pf12_control[6] >> 0) & 0x02)
399      if ((m_pf12_control[6] >> 0) & 0x02)
334400      {
335401         flags |= TILE_FLIPY;
336402         colour &= 0x7;
r24015r24016
338404   }
339405
340406   SET_TILE_INFO_MEMBER(
341         deco16ic->pf12_8x8_gfx_bank,
342         (tile & 0xfff) | deco16ic->pf1_bank,
343         (colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank,
407         m_pf12_8x8_gfx_bank,
408         (tile & 0xfff) | m_pf1_bank,
409         (colour & m_pf1_colourmask) + m_pf1_colour_bank,
344410         flags);
345411}
346412
r24015r24016
351417    Consider this the 'reference rasterizer' for the 56/74/141 tilemap chips - it implements
352418    simultaneous row & column scroll which the Mame tilemap core cannot do.  It also
353419    implements combining the 4BPP output of two tilemaps into 8BPP output.  This function
354    is automatically called when the tilemap is in a state the cannot be properly rendered
420    is automatically called when the tilemap is in a state that cannot be properly rendered
355421    by the Mame core.
356422*/
357423
358424template<class _BitmapClass>
359static void custom_tilemap_draw(
360   device_t *device,
425void deco16ic_device::custom_tilemap_draw(
361426   _BitmapClass &bitmap,
362427   const rectangle &cliprect,
363428   tilemap_t *tilemap0_8x8,
r24015r24016
377442   int is_tattoo
378443   )
379444{
380   running_machine &machine = device->machine();
381445   tilemap_t *tilemap0 = BIT(control1, 7) ? tilemap0_8x8 : tilemap0_16x16;
382446   tilemap_t *tilemap1 = BIT(control1, 7) ? tilemap1_8x8 : tilemap1_16x16;
383447   const bitmap_ind16 *src_bitmap0 = tilemap0 ? &tilemap0->pixmap() : NULL;
r24015r24016
438502
439503         if ((flags & TILEMAP_DRAW_OPAQUE) || (p & trans_mask))
440504         {
441            bitmap.pix(y, x) = machine.pens[p];
442            if (machine.priority_bitmap.valid())
505            bitmap.pix(y, x) = machine().pens[p];
506            if (machine().priority_bitmap.valid())
443507            {
444               UINT8 *pri = &machine.priority_bitmap.pix8(y);
508               UINT8 *pri = &machine().priority_bitmap.pix8(y);
445509               pri[x] |= priority;
446510            }
447511         }
r24015r24016
454518/******************************************************************************/
455519
456520/* captain america seems to have a similar 8bpp feature to robocop2, investigate merging */
457void deco16ic_set_pf1_8bpp_mode(device_t *device, int mode)
521void deco16ic_device::set_pf1_8bpp_mode(int mode)
458522{
459   deco16ic_state *deco16ic = get_safe_token(device);
460   deco16ic->pf1_8bpp_mode = mode;
523   m_pf1_8bpp_mode = mode;
461524}
462525
463526/* robocop 2 can switch between 2 tilemaps at 4bpp, or 1 at 8bpp */
464void deco16ic_set_tilemap_colour_mask( device_t *device, int tmap, int mask )
527void deco16ic_device::set_tilemap_colour_mask( int tmap, int mask )
465528{
466   deco16ic_state *deco16ic = get_safe_token(device);
467
468529   switch (tmap)
469530   {
470   case 0: deco16ic->pf1_colourmask = mask; break;
471   case 1: deco16ic->pf2_colourmask = mask; break;
531   case 0: m_pf1_colourmask = mask; break;
532   case 1: m_pf2_colourmask = mask; break;
472533   }
473534}
474535
475void deco16ic_pf12_set_gfxbank( device_t *device, int small, int big )
536void deco16ic_device::pf12_set_gfxbank( int small, int big )
476537{
477   deco16ic_state *deco16ic = get_safe_token(device);
478
479   if (deco16ic->pf12_last_big != big)
538   if (m_pf12_last_big != big)
480539   {
481      if (deco16ic->pf1_tilemap_16x16)
482         deco16ic->pf1_tilemap_16x16->mark_all_dirty();
483      if (deco16ic->pf2_tilemap_16x16)
484         deco16ic->pf2_tilemap_16x16->mark_all_dirty();
540      if (m_pf1_tilemap_16x16)
541         m_pf1_tilemap_16x16->mark_all_dirty();
542      if (m_pf2_tilemap_16x16)
543         m_pf2_tilemap_16x16->mark_all_dirty();
485544
486      deco16ic->pf12_last_big = big;
545      m_pf12_last_big = big;
487546   }
488   deco16ic->pf12_16x16_gfx_bank = big;
547   m_pf12_16x16_gfx_bank = big;
489548
490   if (deco16ic->pf12_last_small != small)
549   if (m_pf12_last_small != small)
491550   {
492      if (deco16ic->pf1_tilemap_8x8)
493         deco16ic->pf1_tilemap_8x8->mark_all_dirty();
494      if (deco16ic->pf2_tilemap_8x8)
495         deco16ic->pf2_tilemap_8x8->mark_all_dirty();
551      if (m_pf1_tilemap_8x8)
552         m_pf1_tilemap_8x8->mark_all_dirty();
553      if (m_pf2_tilemap_8x8)
554         m_pf2_tilemap_8x8->mark_all_dirty();
496555
497      deco16ic->pf12_last_small = small;
556      m_pf12_last_small = small;
498557   }
499   deco16ic->pf12_8x8_gfx_bank = small;
558   m_pf12_8x8_gfx_bank = small;
500559}
501560
502561/* stoneage has broken scroll registers */
503void deco16ic_set_scrolldx( device_t *device, int tmap, int size, int dx, int dx_if_flipped )
562void deco16ic_device::set_scrolldx( int tmap, int size, int dx, int dx_if_flipped )
504563{
505   deco16ic_state *deco16ic = get_safe_token(device);
506
507564   switch (tmap)
508565   {
509566   case 0:
510567      if (!size)
511         deco16ic->pf1_tilemap_16x16->set_scrolldx(dx, dx_if_flipped);
568         m_pf1_tilemap_16x16->set_scrolldx(dx, dx_if_flipped);
512569      else
513         deco16ic->pf1_tilemap_8x8->set_scrolldx(dx, dx_if_flipped);
570         m_pf1_tilemap_8x8->set_scrolldx(dx, dx_if_flipped);
514571      break;
515572   case 1:
516573      if (!size)
517         deco16ic->pf2_tilemap_16x16->set_scrolldx(dx, dx_if_flipped);
574         m_pf2_tilemap_16x16->set_scrolldx(dx, dx_if_flipped);
518575      else
519         deco16ic->pf2_tilemap_8x8->set_scrolldx(dx, dx_if_flipped);
576         m_pf2_tilemap_8x8->set_scrolldx(dx, dx_if_flipped);
520577      break;
521578   }
522579}
523580
524581/* cninjabl does not enable background layers */
525void deco16ic_set_enable( device_t *device, int tmap, int enable )
582void deco16ic_device::set_enable( int tmap, int enable )
526583{
527   deco16ic_state *deco16ic = get_safe_token(device);
528
529584   int shift = (tmap & 1) ? 15 : 7;
530   deco16ic->pf12_control[5] &= ~(1 << shift);
531   deco16ic->pf12_control[5] |= (enable & 1) << shift;
585   m_pf12_control[5] &= ~(1 << shift);
586   m_pf12_control[5] |= (enable & 1) << shift;
532587}
533588
534589
535590/******************************************************************************/
536591
537WRITE16_DEVICE_HANDLER( deco16ic_pf1_data_w )
592WRITE16_MEMBER( deco16ic_device::pf1_data_w )
538593{
539   deco16ic_state *deco16ic = get_safe_token(device);
594   COMBINE_DATA(&m_pf1_data[offset]);
540595
541   COMBINE_DATA(&deco16ic->pf1_data[offset]);
542
543   deco16ic->pf1_tilemap_8x8->mark_tile_dirty(offset);
596   m_pf1_tilemap_8x8->mark_tile_dirty(offset);
544597//  if (offset < 0x800)
545      deco16ic->pf1_tilemap_16x16->mark_tile_dirty(offset);
598      m_pf1_tilemap_16x16->mark_tile_dirty(offset);
546599}
547600
548WRITE16_DEVICE_HANDLER( deco16ic_pf2_data_w )
601WRITE16_MEMBER( deco16ic_device::pf2_data_w )
549602{
550   deco16ic_state *deco16ic = get_safe_token(device);
603   COMBINE_DATA(&m_pf2_data[offset]);
551604
552   COMBINE_DATA(&deco16ic->pf2_data[offset]);
553
554   deco16ic->pf2_tilemap_8x8->mark_tile_dirty(offset);
605   m_pf2_tilemap_8x8->mark_tile_dirty(offset);
555606//  if (offset < 0x800)
556      deco16ic->pf2_tilemap_16x16->mark_tile_dirty(offset);
607      m_pf2_tilemap_16x16->mark_tile_dirty(offset);
557608}
558609
559READ16_DEVICE_HANDLER( deco16ic_pf1_data_r )
610READ16_MEMBER( deco16ic_device::pf1_data_r )
560611{
561   deco16ic_state *deco16ic = get_safe_token(device);
562   return deco16ic->pf1_data[offset];
612   return m_pf1_data[offset];
563613}
564614
565READ16_DEVICE_HANDLER( deco16ic_pf2_data_r )
615READ16_MEMBER( deco16ic_device::pf2_data_r )
566616{
567   deco16ic_state *deco16ic = get_safe_token(device);
568   return deco16ic->pf2_data[offset];
617   return m_pf2_data[offset];
569618}
570619
571WRITE16_DEVICE_HANDLER( deco16ic_pf_control_w )
620WRITE16_MEMBER( deco16ic_device::pf_control_w )
572621{
573   deco16ic_state *deco16ic = get_safe_token(device);
574622   space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
575623
576   COMBINE_DATA(&deco16ic->pf12_control[offset]);
624   COMBINE_DATA(&m_pf12_control[offset]);
577625}
578626
579READ16_DEVICE_HANDLER( deco16ic_pf_control_r )
627READ16_MEMBER( deco16ic_device::pf_control_r )
580628{
581   deco16ic_state *deco16ic = get_safe_token(device);
582   return deco16ic->pf12_control[offset];
629   return m_pf12_control[offset];
583630}
584631
585632
586READ32_DEVICE_HANDLER ( deco16ic_pf_control_dword_r )
633READ32_MEMBER( deco16ic_device::pf_control_dword_r )
587634{
588   return deco16ic_pf_control_r(device, space, offset, 0xffff)^0xffff0000;
635   return pf_control_r(space, offset, 0xffff)^0xffff0000;
589636}
590637
591WRITE32_DEVICE_HANDLER( deco16ic_pf_control_dword_w )
638WRITE32_MEMBER( deco16ic_device::pf_control_dword_w )
592639{
593   deco16ic_pf_control_w(device, space, offset, data & 0xffff, mem_mask & 0xffff);
640   pf_control_w(space, offset, data & 0xffff, mem_mask & 0xffff);
594641}
595642
596READ32_DEVICE_HANDLER( deco16ic_pf1_data_dword_r )
643READ32_MEMBER( deco16ic_device::pf1_data_dword_r )
597644{
598   return deco16ic_pf1_data_r(device, space, offset, 0xffff)^0xffff0000;
645   return pf1_data_r(space, offset, 0xffff)^0xffff0000;
599646}
600647
601WRITE32_DEVICE_HANDLER( deco16ic_pf1_data_dword_w )
648WRITE32_MEMBER( deco16ic_device::pf1_data_dword_w )
602649{
603   deco16ic_pf1_data_w(device, space, offset, data & 0xffff, mem_mask & 0xffff);
650   pf1_data_w(space, offset, data & 0xffff, mem_mask & 0xffff);
604651}
605652
606READ32_DEVICE_HANDLER( deco16ic_pf2_data_dword_r )
653READ32_MEMBER( deco16ic_device::pf2_data_dword_r )
607654{
608   return deco16ic_pf2_data_r(device, space, offset, 0xffff)^0xffff0000;
655   return pf2_data_r(space, offset, 0xffff)^0xffff0000;
609656}
610657
611WRITE32_DEVICE_HANDLER( deco16ic_pf2_data_dword_w )
658WRITE32_MEMBER( deco16ic_device::pf2_data_dword_w )
612659{
613   deco16ic_pf2_data_w(device, space, offset, data & 0xffff, mem_mask & 0xffff);
660   pf2_data_w(space, offset, data & 0xffff, mem_mask & 0xffff);
614661}
615662
616663
r24015r24016
765812   return use_custom;
766813}
767814
768void deco16ic_pf_update( device_t *device, const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr )
815void deco16ic_device::pf_update( const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr )
769816{
770   deco16ic_state *deco16ic = get_safe_token(device);
771817   int bank1, bank2;
772818
773819   /* Update scrolling and tilemap enable */
774   deco16ic->pf1_rowscroll_ptr = rowscroll_1_ptr;
775   deco16ic->pf2_rowscroll_ptr = rowscroll_2_ptr;
776   deco16ic->use_custom_pf2 = deco16_pf_update(deco16ic->pf2_tilemap_8x8, deco16ic->pf2_tilemap_16x16, rowscroll_2_ptr, deco16ic->pf12_control[3], deco16ic->pf12_control[4], deco16ic->pf12_control[5] >> 8, deco16ic->pf12_control[6] >> 8);
777   deco16ic->use_custom_pf1 = deco16_pf_update(deco16ic->pf1_tilemap_8x8, deco16ic->pf1_tilemap_16x16, rowscroll_1_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff);
820   m_pf1_rowscroll_ptr = rowscroll_1_ptr;
821   m_pf2_rowscroll_ptr = rowscroll_2_ptr;
822   m_use_custom_pf2 = deco16_pf_update(m_pf2_tilemap_8x8, m_pf2_tilemap_16x16, rowscroll_2_ptr, m_pf12_control[3], m_pf12_control[4], m_pf12_control[5] >> 8, m_pf12_control[6] >> 8);
823   m_use_custom_pf1 = deco16_pf_update(m_pf1_tilemap_8x8, m_pf1_tilemap_16x16, rowscroll_1_ptr, m_pf12_control[1], m_pf12_control[2], m_pf12_control[5] & 0xff, m_pf12_control[6] & 0xff);
778824
779825   /* Update banking and global flip state */
780   if (deco16ic->bank_cb[0])
826   if (m_bank_cb_func[0])
781827   {
782      bank1 = deco16ic->bank_cb[0](deco16ic->pf12_control[7] & 0xff);
828      bank1 = m_bank_cb_func[0](m_pf12_control[7] & 0xff);
783829
784      if (bank1 != deco16ic->pf1_bank)
830      if (bank1 != m_pf1_bank)
785831      {
786         if (deco16ic->pf1_tilemap_8x8)
787            deco16ic->pf1_tilemap_8x8->mark_all_dirty();
788         if (deco16ic->pf1_tilemap_16x16)
789            deco16ic->pf1_tilemap_16x16->mark_all_dirty();
832         if (m_pf1_tilemap_8x8)
833            m_pf1_tilemap_8x8->mark_all_dirty();
834         if (m_pf1_tilemap_16x16)
835            m_pf1_tilemap_16x16->mark_all_dirty();
790836
791         deco16ic->pf1_bank = bank1;
837         m_pf1_bank = bank1;
792838      }
793839   }
794840
795   if (deco16ic->bank_cb[1])
841   if (m_bank_cb_func[1])
796842   {
797      bank2 = deco16ic->bank_cb[1](deco16ic->pf12_control[7] >> 8);
843      bank2 = m_bank_cb_func[1](m_pf12_control[7] >> 8);
798844
799      if (bank2 != deco16ic->pf2_bank)
845      if (bank2 != m_pf2_bank)
800846      {
801         if (deco16ic->pf2_tilemap_8x8)
802            deco16ic->pf2_tilemap_8x8->mark_all_dirty();
803         if (deco16ic->pf2_tilemap_16x16)
804            deco16ic->pf2_tilemap_16x16->mark_all_dirty();
847         if (m_pf2_tilemap_8x8)
848            m_pf2_tilemap_8x8->mark_all_dirty();
849         if (m_pf2_tilemap_16x16)
850            m_pf2_tilemap_16x16->mark_all_dirty();
805851
806         deco16ic->pf2_bank = bank2;
852         m_pf2_bank = bank2;
807853      }
808854   }
809855}
810856
811857/*****************************************************************************************/
812858
813void deco16ic_print_debug_info(device_t *device, bitmap_ind16 &bitmap)
859void deco16ic_device::print_debug_info(bitmap_ind16 &bitmap)
814860{
815   deco16ic_state *deco16ic = get_safe_token(device);
816861   char buf[64*5];
817862
818   if (device->machine().input().code_pressed(KEYCODE_O))
863   if (machine().input().code_pressed(KEYCODE_O))
819864      return;
820865
821   if (deco16ic->pf12_control)
866   if (m_pf12_control)
822867   {
823      sprintf(buf,"%04X %04X %04X %04X\n", deco16ic->pf12_control[0], deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[3]);
824      sprintf(&buf[strlen(buf)],"%04X %04X %04X %04X\n", deco16ic->pf12_control[4], deco16ic->pf12_control[5], deco16ic->pf12_control[6], deco16ic->pf12_control[7]);
868      sprintf(buf,"%04X %04X %04X %04X\n", m_pf12_control[0], m_pf12_control[1], m_pf12_control[2], m_pf12_control[3]);
869      sprintf(&buf[strlen(buf)],"%04X %04X %04X %04X\n", m_pf12_control[4], m_pf12_control[5], m_pf12_control[6], m_pf12_control[7]);
825870   }
826871   else
827872      sprintf(buf, "\n\n");
828873
829   ui_draw_text(&device->machine().render().ui_container(), buf, 60, 40);
874   ui_draw_text(&machine().render().ui_container(), buf, 60, 40);
830875}
831876
832877/*****************************************************************************************/
833878
834879template<class _BitmapClass>
835void deco16ic_tilemap_1_draw_common( device_t *device, _BitmapClass &bitmap, const rectangle &cliprect, int flags, UINT32 priority )
880void deco16ic_device::tilemap_1_draw_common( _BitmapClass &bitmap, const rectangle &cliprect, int flags, UINT32 priority )
836881{
837   deco16ic_state *deco16ic = get_safe_token(device);
838
839   if (deco16ic->use_custom_pf1)
882   if (m_use_custom_pf1)
840883   {
841      custom_tilemap_draw(device, bitmap, cliprect, deco16ic->pf1_tilemap_8x8, deco16ic->pf1_tilemap_16x16, 0, 0, deco16ic->pf1_rowscroll_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff, 0, 0, deco16ic->pf1_trans_mask, flags, priority, 0);
884      custom_tilemap_draw(bitmap, cliprect, m_pf1_tilemap_8x8, m_pf1_tilemap_16x16, 0, 0, m_pf1_rowscroll_ptr, m_pf12_control[1], m_pf12_control[2], m_pf12_control[5] & 0xff, m_pf12_control[6] & 0xff, 0, 0, m_pf1_trans_mask, flags, priority, 0);
842885   }
843886   else
844887   {
845      if (deco16ic->pf1_tilemap_8x8)
846         deco16ic->pf1_tilemap_8x8->draw(bitmap, cliprect, flags, priority);
847      if (deco16ic->pf1_tilemap_16x16)
848         deco16ic->pf1_tilemap_16x16->draw(bitmap, cliprect, flags, priority);
888      if (m_pf1_tilemap_8x8)
889         m_pf1_tilemap_8x8->draw(bitmap, cliprect, flags, priority);
890      if (m_pf1_tilemap_16x16)
891         m_pf1_tilemap_16x16->draw(bitmap, cliprect, flags, priority);
849892   }
850893}
851894
852void deco16ic_tilemap_1_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority )
853{ deco16ic_tilemap_1_draw_common(device, bitmap, cliprect, flags, priority); }
895void deco16ic_device::tilemap_1_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority )
896{ tilemap_1_draw_common(bitmap, cliprect, flags, priority); }
854897
855void deco16ic_tilemap_1_draw( device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority )
856{ deco16ic_tilemap_1_draw_common(device, bitmap, cliprect, flags, priority); }
898void deco16ic_device::tilemap_1_draw( bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority )
899{ tilemap_1_draw_common(bitmap, cliprect, flags, priority); }
857900
858901
859902template<class _BitmapClass>
860void deco16ic_tilemap_2_draw_common(device_t *device, _BitmapClass &bitmap, const rectangle &cliprect, int flags, UINT32 priority)
903void deco16ic_device::tilemap_2_draw_common(_BitmapClass &bitmap, const rectangle &cliprect, int flags, UINT32 priority)
861904{
862   deco16ic_state *deco16ic = get_safe_token(device);
863
864   if (deco16ic->use_custom_pf2)
905   if (m_use_custom_pf2)
865906   {
866      custom_tilemap_draw(device, bitmap, cliprect, deco16ic->pf2_tilemap_8x8, deco16ic->pf2_tilemap_16x16, 0, 0, deco16ic->pf2_rowscroll_ptr, deco16ic->pf12_control[3], deco16ic->pf12_control[4], deco16ic->pf12_control[5] >> 8, deco16ic->pf12_control[6] >> 8, 0, 0, deco16ic->pf2_trans_mask, flags, priority, 0);
907      custom_tilemap_draw(bitmap, cliprect, m_pf2_tilemap_8x8, m_pf2_tilemap_16x16, 0, 0, m_pf2_rowscroll_ptr, m_pf12_control[3], m_pf12_control[4], m_pf12_control[5] >> 8, m_pf12_control[6] >> 8, 0, 0, m_pf2_trans_mask, flags, priority, 0);
867908   }
868909   else
869910   {
870      if (deco16ic->pf2_tilemap_8x8)
871         deco16ic->pf2_tilemap_8x8->draw(bitmap, cliprect, flags, priority);
872      if (deco16ic->pf2_tilemap_16x16)
873         deco16ic->pf2_tilemap_16x16->draw(bitmap, cliprect, flags, priority);
911      if (m_pf2_tilemap_8x8)
912         m_pf2_tilemap_8x8->draw(bitmap, cliprect, flags, priority);
913      if (m_pf2_tilemap_16x16)
914         m_pf2_tilemap_16x16->draw(bitmap, cliprect, flags, priority);
874915   }
875916}
876917
877void deco16ic_tilemap_2_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority )
878{ deco16ic_tilemap_2_draw_common(device, bitmap, cliprect, flags, priority); }
918void deco16ic_device::tilemap_2_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority )
919{ tilemap_2_draw_common(bitmap, cliprect, flags, priority); }
879920
880void deco16ic_tilemap_2_draw( device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority )
881{ deco16ic_tilemap_2_draw_common(device, bitmap, cliprect, flags, priority); }
921void deco16ic_device::tilemap_2_draw( bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority )
922{ tilemap_2_draw_common(bitmap, cliprect, flags, priority); }
882923
883924
884925/*****************************************************************************************/
885926
886927// Combines the output of two 4BPP tilemaps into an 8BPP tilemap
887void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo)
928void deco16ic_device::tilemap_12_combine_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo)
888929{
889   deco16ic_state *deco16ic = get_safe_token(device);
890   custom_tilemap_draw(device, bitmap, cliprect, 0, deco16ic->pf1_tilemap_16x16, 0, deco16ic->pf2_tilemap_16x16, deco16ic->pf1_rowscroll_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff, 0xf, 4, 0xff, flags, priority, is_tattoo);
930   custom_tilemap_draw(bitmap, cliprect, 0, m_pf1_tilemap_16x16, 0, m_pf2_tilemap_16x16, m_pf1_rowscroll_ptr, m_pf12_control[1], m_pf12_control[2], m_pf12_control[5] & 0xff, m_pf12_control[6] & 0xff, 0xf, 4, 0xff, flags, priority, is_tattoo);
891931}
892932
893void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo)
933void deco16ic_device::tilemap_12_combine_draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo)
894934{
895   deco16ic_state *deco16ic = get_safe_token(device);
896   custom_tilemap_draw(device, bitmap, cliprect, 0, deco16ic->pf1_tilemap_16x16, 0, deco16ic->pf2_tilemap_16x16, deco16ic->pf1_rowscroll_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff, 0xf, 4, 0xff, flags, priority, is_tattoo);
935   custom_tilemap_draw(bitmap, cliprect, 0, m_pf1_tilemap_16x16, 0, m_pf2_tilemap_16x16, m_pf1_rowscroll_ptr, m_pf12_control[1], m_pf12_control[2], m_pf12_control[5] & 0xff, m_pf12_control[6] & 0xff, 0xf, 4, 0xff, flags, priority, is_tattoo);
897936}
898
899const device_type DECO16IC = &device_creator<deco16ic_device>;
900
901deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
902   : device_t(mconfig, DECO16IC, "Data East IC 55 / 56 / 74 / 141", tag, owner, clock, "deco16ic", __FILE__)
903{
904   m_token = global_alloc_clear(deco16ic_state);
905}
906
907//-------------------------------------------------
908//  device_config_complete - perform any
909//  operations now that the configuration is
910//  complete
911//-------------------------------------------------
912
913void deco16ic_device::device_config_complete()
914{
915}
916
917//-------------------------------------------------
918//  device_start - device-specific startup
919//-------------------------------------------------
920
921void deco16ic_device::device_start()
922{
923   deco16ic_state *deco16ic = get_safe_token(this);
924   const deco16ic_interface *intf = get_interface(this);
925
926   deco16ic->bank_cb[0] = intf->bank_cb0;
927   deco16ic->bank_cb[1] = intf->bank_cb1;
928
929   deco16ic->pf1_trans_mask = intf->trans_mask1;
930   deco16ic->pf2_trans_mask = intf->trans_mask2;
931
932   deco16ic->pf1_colour_bank = intf->col_base1;
933   deco16ic->pf2_colour_bank = intf->col_base2;
934
935   deco16ic->pf1_colourmask = intf->col_mask1;
936   deco16ic->pf2_colourmask = intf->col_mask2;
937
938   int fullheight = 0;
939   int fullwidth = 0;
940
941   if (intf->full_width12&2)
942      fullheight = 1;
943
944   if (intf->full_width12&1)
945      fullwidth = 1;
946
947   deco16ic->pf1_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ?64 : 32);
948//  deco16ic->pf1_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, intf->full_width12 ? 64 : 32, 32);
949   deco16ic->pf1_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, 64 , 32); // nitroball
950
951   deco16ic->pf12_8x8_gfx_bank = intf->_8x8_gfxregion;
952   deco16ic->pf12_16x16_gfx_bank = intf->_16x16_gfxregion;
953
954   if (intf->split)
955      deco16ic->pf2_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32);
956   else
957      deco16ic->pf2_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32);
958
959   deco16ic->pf2_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, fullwidth ? 64 : 32, fullheight ? 64 : 32);
960
961   deco16ic->pf1_tilemap_8x8->set_transparent_pen(0);
962   deco16ic->pf2_tilemap_8x8->set_transparent_pen(0);
963   deco16ic->pf1_tilemap_16x16->set_transparent_pen(0);
964   deco16ic->pf2_tilemap_16x16->set_transparent_pen(0);
965
966   if (intf->split) /* Caveman Ninja only */
967      deco16ic->pf2_tilemap_16x16->set_transmask(0, 0x00ff, 0xff01);
968
969   deco16ic->pf1_8bpp_mode = 0;
970
971   deco16ic->pf1_data = auto_alloc_array_clear(machine(), UINT16, 0x2000 / 2);
972   deco16ic->pf2_data = auto_alloc_array_clear(machine(), UINT16, 0x2000 / 2);
973   deco16ic->pf12_control = auto_alloc_array_clear(machine(), UINT16, 0x10 / 2);
974
975
976   save_item(NAME(deco16ic->use_custom_pf1));
977   save_item(NAME(deco16ic->use_custom_pf2));
978   save_item(NAME(deco16ic->pf1_bank));
979   save_item(NAME(deco16ic->pf2_bank));
980   save_item(NAME(deco16ic->pf12_8x8_gfx_bank));
981   save_item(NAME(deco16ic->pf12_16x16_gfx_bank));
982   save_item(NAME(deco16ic->pf12_last_small));
983   save_item(NAME(deco16ic->pf12_last_big));
984
985   save_item(NAME(deco16ic->pf1_8bpp_mode));
986
987   save_pointer(NAME(deco16ic->pf1_data), 0x2000 / 2);
988   save_pointer(NAME(deco16ic->pf2_data), 0x2000 / 2);
989   save_pointer(NAME(deco16ic->pf12_control), 0x10 / 2);
990}
991
992//-------------------------------------------------
993//  device_reset - device-specific reset
994//-------------------------------------------------
995
996void deco16ic_device::device_reset()
997{
998   deco16ic_state *deco16ic = get_safe_token(this);
999
1000   deco16ic->pf1_bank = deco16ic->pf2_bank = 0;
1001   deco16ic->pf12_last_small = deco16ic->pf12_last_big = -1;
1002   deco16ic->use_custom_pf1 = deco16ic->use_custom_pf2 = 0;
1003   deco16ic->pf1_rowscroll_ptr = 0;
1004   deco16ic->pf2_rowscroll_ptr = 0;
1005}
trunk/src/mame/video/deco16ic.h
r24015r24016
2323
2424struct deco16ic_interface
2525{
26   const char         *screen;
27   int                split;
28   int                full_width12;
26   const char         *m_screen_tag;
27   int                m_split;
28   int                m_full_width12;
2929
30   int                trans_mask1, trans_mask2;
31   int                col_base1, col_base2;
32   int                col_mask1, col_mask2;
33   deco16_bank_cb     bank_cb0, bank_cb1;
34   int                _8x8_gfxregion, _16x16_gfxregion;
30   int               m_pf1_trans_mask, m_pf2_trans_mask;
31   int               m_pf1_colour_bank, m_pf2_colour_bank;
32   int               m_pf1_colourmask, m_pf2_colourmask;
33   deco16_bank_cb     m_bank_cb0, m_bank_cb1;
34   int               m_pf12_8x8_gfx_bank, m_pf12_16x16_gfx_bank;
3535};
3636
37class deco16ic_device : public device_t
37class deco16ic_device : public device_t,
38                              public deco16ic_interface
3839{
3940public:
4041   deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
41   ~deco16ic_device() { global_free(m_token); }
42   ~deco16ic_device() {}
43   
44   DECLARE_WRITE16_MEMBER( pf1_data_w );
45   DECLARE_WRITE16_MEMBER( pf2_data_w );
4246
43   // access to legacy token
44   void *token() const { assert(m_token != NULL); return m_token; }
47   DECLARE_READ16_MEMBER( pf1_data_r );
48   DECLARE_READ16_MEMBER( pf2_data_r );
49
50   DECLARE_WRITE16_MEMBER( pf_control_w );
51
52   DECLARE_READ16_MEMBER( pf_control_r );
53
54   DECLARE_WRITE32_MEMBER( pf1_data_dword_w );
55   DECLARE_WRITE32_MEMBER( pf2_data_dword_w );
56
57   DECLARE_READ32_MEMBER( pf1_data_dword_r );
58   DECLARE_READ32_MEMBER( pf2_data_dword_r );
59
60   DECLARE_WRITE32_MEMBER( pf_control_dword_w );
61
62   DECLARE_READ32_MEMBER( pf_control_dword_r );
63
64   void print_debug_info(bitmap_ind16 &bitmap);
65
66   void pf_update(const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr);
67   
68   template<class _BitmapClass>
69   void tilemap_1_draw_common(_BitmapClass &bitmap, const rectangle &cliprect, int flags, UINT32 priority);
70   template<class _BitmapClass>
71   void tilemap_2_draw_common(_BitmapClass &bitmap, const rectangle &cliprect, int flags, UINT32 priority);
72   void tilemap_1_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority);
73   void tilemap_1_draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority);
74   void tilemap_2_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority);
75   void tilemap_2_draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority);
76
77   /* used by boogwing, nitrobal */
78   void tilemap_12_combine_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo = false);
79   void tilemap_12_combine_draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo = false);
80
81   /* used by robocop2 */
82   void set_tilemap_colour_mask(int tmap, int mask);
83   void pf12_set_gfxbank(int small, int big);
84
85   /* used by captaven */
86   void set_pf1_8bpp_mode(int mode);
87
88   /* used by stoneage */
89   void set_scrolldx(int tmap, int size, int dx, int dx_if_flipped);
90
91   /* used by cninjabl */
92   void set_enable(int tmap, int enable );
93   
94   template<class _BitmapClass>
95   void custom_tilemap_draw(
96   _BitmapClass &bitmap,
97   const rectangle &cliprect,
98   tilemap_t *tilemap0_8x8,
99   tilemap_t *tilemap0_16x16,
100   tilemap_t *tilemap1_8x8,
101   tilemap_t *tilemap1_16x16,
102   const UINT16 *rowscroll_ptr,
103   const UINT16 scrollx,
104   const UINT16 scrolly,
105   const UINT16 control0,
106   const UINT16 control1,
107   int combine_mask,
108   int combine_shift,
109   int trans_mask,
110   int flags,
111   UINT32 priority,
112   int is_tattoo
113   );
114   
45115protected:
46116   // device-level overrides
47117   virtual void device_config_complete();
48118   virtual void device_start();
49119   virtual void device_reset();
120
50121private:
51122   // internal state
52   void *m_token;
123   screen_device *m_screen;
53124
125   UINT16 *m_pf1_data, *m_pf2_data;
126   UINT16 *m_pf12_control;
127
128   const UINT16 *m_pf1_rowscroll_ptr, *m_pf2_rowscroll_ptr;
129
130   tilemap_t *m_pf1_tilemap_16x16, *m_pf2_tilemap_16x16;
131   tilemap_t *m_pf1_tilemap_8x8, *m_pf2_tilemap_8x8;
132
133   deco16_bank_cb  m_bank_cb_func[2];
134
135   int m_use_custom_pf1, m_use_custom_pf2;
136
137   int m_pf1_bank, m_pf2_bank;
138   
139   int m_pf12_last_small, m_pf12_last_big;
140
141   int m_pf1_8bpp_mode;
142
54143   TILEMAP_MAPPER_MEMBER(deco16_scan_rows);
55144   TILE_GET_INFO_MEMBER(get_pf2_tile_info);
56145   TILE_GET_INFO_MEMBER(get_pf1_tile_info);
r24015r24016
70159   MCFG_DEVICE_ADD(_tag, DECO16IC, 0) \
71160   MCFG_DEVICE_CONFIG(_interface)
72161
73/***************************************************************************
74    DEVICE I/O FUNCTIONS
75***************************************************************************/
76162
77DECLARE_WRITE16_DEVICE_HANDLER( deco16ic_pf1_data_w );
78DECLARE_WRITE16_DEVICE_HANDLER( deco16ic_pf2_data_w );
79
80DECLARE_READ16_DEVICE_HANDLER( deco16ic_pf1_data_r );
81DECLARE_READ16_DEVICE_HANDLER( deco16ic_pf2_data_r );
82
83DECLARE_WRITE16_DEVICE_HANDLER( deco16ic_pf_control_w );
84
85DECLARE_READ16_DEVICE_HANDLER( deco16ic_pf_control_r );
86
87DECLARE_WRITE32_DEVICE_HANDLER( deco16ic_pf1_data_dword_w );
88DECLARE_WRITE32_DEVICE_HANDLER( deco16ic_pf2_data_dword_w );
89
90DECLARE_READ32_DEVICE_HANDLER( deco16ic_pf1_data_dword_r );
91DECLARE_READ32_DEVICE_HANDLER( deco16ic_pf2_data_dword_r );
92
93DECLARE_WRITE32_DEVICE_HANDLER( deco16ic_pf_control_dword_w );
94
95DECLARE_READ32_DEVICE_HANDLER( deco16ic_pf_control_dword_r );
96
97void deco16ic_print_debug_info(device_t *device, bitmap_ind16 &bitmap);
98
99void deco16ic_pf_update(device_t *device, const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr);
100
101void deco16ic_tilemap_1_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority);
102void deco16ic_tilemap_1_draw(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority);
103void deco16ic_tilemap_2_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority);
104void deco16ic_tilemap_2_draw(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority);
105
106/* used by boogwing, nitrobal */
107void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo = false);
108void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo = false);
109
110/* used by robocop2 */
111void deco16ic_set_tilemap_colour_mask(device_t *device, int tmap, int mask);
112void deco16ic_pf12_set_gfxbank(device_t *device, int small, int big);
113
114/* used by captaven */
115void deco16ic_set_pf1_8bpp_mode(device_t *device, int mode);
116
117/* used by stoneage */
118void deco16ic_set_scrolldx(device_t *device, int tmap, int size, int dx, int dx_if_flipped);
119
120/* used by cninjabl */
121void deco16ic_set_enable( device_t *device, int tmap, int enable );
122
123163#endif
trunk/src/mame/video/dassault.c
r24015r24016
1414****************************************************************************/
1515
1616#include "emu.h"
17#include "video/deco16ic.h"
1817#include "includes/dassault.h"
1918#include "video/decocomn.h"
2019
r24015r24016
7675UINT32 dassault_state::screen_update_dassault(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
7776{
7877   address_space &space = machine().driver_data()->generic_space();
79   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
78   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
8079   UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff);
8180
8281   m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, false);
r24015r24016
8685
8786   /* Update tilemaps */
8887   flip_screen_set(BIT(flip, 7));
89   deco16ic_pf_update(m_deco_tilegen1, 0, m_pf2_rowscroll);
90   deco16ic_pf_update(m_deco_tilegen2, 0, m_pf4_rowscroll);
88   m_deco_tilegen1->pf_update(0, m_pf2_rowscroll);
89   m_deco_tilegen2->pf_update(0, m_pf4_rowscroll);
9190
9291   /* Draw playfields/update priority bitmap */
9392   machine().priority_bitmap.fill(0, cliprect);
9493   bitmap.fill(machine().pens[3072], cliprect);
95   deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
94   m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
9695
9796   /* The middle playfields can be swapped priority-wise */
9897   if ((priority & 3) == 0)
9998   {
10099      mixdassaultlayer(bitmap, sprite_bitmap1, cliprect,  0x0600, 0x0600,  0x400, 0xff); // 1
101      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2); // 2
100      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2); // 2
102101      mixdassaultlayer(bitmap, sprite_bitmap1, cliprect,  0x0400, 0x0600,  0x400, 0xff); // 8
103      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 16); // 16
102      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 16); // 16
104103      mixdassaultlayer(bitmap, sprite_bitmap1, cliprect,  0x0200, 0x0600,  0x400, 0xff); // 32
105104      mixdassaultlayer(bitmap, sprite_bitmap2, cliprect,  0x0000, 0x0000,  0x800, 0x80); // 64?
106105      mixdassaultlayer(bitmap, sprite_bitmap1, cliprect,  0x0000, 0x0600,  0x400, 0xff); // 128
r24015r24016
109108   else if ((priority & 3) == 1)
110109   {
111110      mixdassaultlayer(bitmap, sprite_bitmap1, cliprect,  0x0600, 0x0600,  0x400, 0xff); // 1
112      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); // 2
111      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2); // 2
113112      mixdassaultlayer(bitmap, sprite_bitmap1, cliprect,  0x0400, 0x0600,  0x400, 0xff); // 8
114113      mixdassaultlayer(bitmap, sprite_bitmap2, cliprect,  0x0000, 0x0000,  0x800, 0x80); // 16?
115114      mixdassaultlayer(bitmap, sprite_bitmap1, cliprect,  0x0200, 0x0600,  0x400, 0xff); // 32
116      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 64); // 64
115      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 64); // 64
117116      mixdassaultlayer(bitmap, sprite_bitmap1, cliprect,  0x0000, 0x0600,  0x400, 0xff); // 128
118117   }
119118   else if ((priority & 3) == 3)
120119   {
121120      mixdassaultlayer(bitmap, sprite_bitmap1, cliprect,  0x0600, 0x0600,  0x400, 0xff); // 1
122      deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); // 2
121      m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2); // 2
123122      mixdassaultlayer(bitmap, sprite_bitmap1, cliprect,  0x0400, 0x0600,  0x400, 0xff); // 8
124      deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 16); // 16
123      m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 16); // 16
125124      mixdassaultlayer(bitmap, sprite_bitmap1, cliprect,  0x0200, 0x0600,  0x400, 0xff); // 32
126125      mixdassaultlayer(bitmap, sprite_bitmap2, cliprect,  0x0000, 0x0000,  0x800, 0x80); // 64?
127126      mixdassaultlayer(bitmap, sprite_bitmap1, cliprect,  0x0000, 0x0600,  0x400, 0xff); // 128
r24015r24016
131130      /* Unused */
132131   }
133132
134   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
133   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
135134   return 0;
136135}
trunk/src/mame/video/supbtime.c
r24015r24016
1313***************************************************************************/
1414
1515#include "emu.h"
16#include "video/deco16ic.h"
1716#include "includes/supbtime.h"
1817
1918
r24015r24016
2423UINT32 supbtime_state::screen_update_supbtime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
2524{
2625   address_space &space = machine().driver_data()->generic_space();
27   UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff);
26   UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
2827
2928   flip_screen_set(BIT(flip, 7));
30   deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll);
29   m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll);
3130
3231   bitmap.fill(768, cliprect);
3332
34   deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
33   m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0);
3534   m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400);
36   deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0);
35   m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0);
3736   return 0;
3837}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team