diff options
author | cam900 <dbtlrchl@naver.com> | 2018-03-15 21:00:26 +0900 |
---|---|---|
committer | Vas Crabb <cuavas@users.noreply.github.com> | 2018-03-15 23:00:26 +1100 |
commit | 4e349dbd712deded4c4086c14c0c6c4a7c721d2a (patch) | |
tree | f4a6f54a9df4a0091983dccfb6c4baae69a41957 | |
parent | 5d61426a52289643e60afd2c84e35405923995da (diff) |
tecmosys.cpp : Updates (#3309)
* tecmosys.cpp : Add notes, Fix background color, Cleanup bankswitching, Reduce duplicates, Cliprect related mixing, Add object finders instead runtime tag lookup
Demote tecmosys.cpp games with MACHINE_IMPERFECT_GRAPHICS, Because some graphic features(linescroll, mixing) is not perfectly emulated
And Add MACHINE_NO_COCKTAIL tags Because tilemap scroll is wrong when flip screen case
* tecmosys.cpp : Fix drawing at some case
* tecmosys.cpp : Fix sprite drawing
* tecmosys.cpp : Fix compile
* tecmosys.cpp : Fix and minor cleanup transparent drawing
* tecmosys.cpp : Add notes
-rw-r--r-- | src/mame/drivers/tecmosys.cpp | 172 | ||||
-rw-r--r-- | src/mame/includes/tecmosys.h | 90 | ||||
-rw-r--r-- | src/mame/video/tecmosys.cpp | 249 |
3 files changed, 241 insertions, 270 deletions
diff --git a/src/mame/drivers/tecmosys.cpp b/src/mame/drivers/tecmosys.cpp index 61f3d050621..6e8f44e60e4 100644 --- a/src/mame/drivers/tecmosys.cpp +++ b/src/mame/drivers/tecmosys.cpp @@ -4,9 +4,13 @@ Driver by Farfetch'd, David Haywood & Tomasz Slanina Protection simulation by nuapete - ToDo: + TODO: - Dump / Decap MCUs to allow for proper protection emulation. - tkdenshoa pcb shows some garbage sprites at the top during y-scroll + - Flip screen is wrong + - Line scroll is unimplemented(but it seems like unused) + - Unknowns of sprite/tilemap registers + - Verify priority/mixing from real PCB T.Slanina 20040530 : @@ -274,37 +278,51 @@ WRITE16_MEMBER(tecmosys_state::eeprom_w) } } +template<int Layer> +WRITE16_MEMBER(tecmosys_state::vram_w) +{ + COMBINE_DATA(&m_vram[Layer][offset]); + m_tilemap[Layer]->mark_tile_dirty(offset/2); +} + +template<int Layer> +WRITE16_MEMBER(tecmosys_state::lineram_w) +{ + COMBINE_DATA(&m_lineram[Layer][offset]); + if (data!=0x0000) popmessage("non 0 write to bg%01x lineram %04x %04x",Layer,offset,data); +} + void tecmosys_state::main_map(address_map &map) { map(0x000000, 0x0fffff).rom(); map(0x200000, 0x20ffff).ram(); // work ram map(0x210000, 0x210001).nopr(); // single byte overflow on stack defined as 0x210000 - map(0x300000, 0x300fff).ram().w(this, FUNC(tecmosys_state::bg0_tilemap_w)).share("bg0tilemap_ram"); // bg0 ram - map(0x301000, 0x3013ff).ram().w(this, FUNC(tecmosys_state::bg0_tilemap_lineram_w)).share("bg0_lineram");// bg0 linescroll? (guess) + map(0x300000, 0x300fff).ram().w(this, FUNC(tecmosys_state::vram_w<1>)).share("vram_1"); // bg0 ram + map(0x301000, 0x3013ff).ram().w(this, FUNC(tecmosys_state::lineram_w<0>)).share("bg0_lineram");// bg0 linescroll? (guess) - map(0x400000, 0x400fff).ram().w(this, FUNC(tecmosys_state::bg1_tilemap_w)).share("bg1tilemap_ram"); // bg1 ram - map(0x401000, 0x4013ff).ram().w(this, FUNC(tecmosys_state::bg1_tilemap_lineram_w)).share("bg1_lineram");// bg1 linescroll? (guess) + map(0x400000, 0x400fff).ram().w(this, FUNC(tecmosys_state::vram_w<2>)).share("vram_2"); // bg1 ram + map(0x401000, 0x4013ff).ram().w(this, FUNC(tecmosys_state::lineram_w<1>)).share("bg1_lineram");// bg1 linescroll? (guess) - map(0x500000, 0x500fff).ram().w(this, FUNC(tecmosys_state::bg2_tilemap_w)).share("bg2tilemap_ram"); // bg2 ram - map(0x501000, 0x5013ff).ram().w(this, FUNC(tecmosys_state::bg2_tilemap_lineram_w)).share("bg2_lineram"); // bg2 linescroll? (guess) + map(0x500000, 0x500fff).ram().w(this, FUNC(tecmosys_state::vram_w<3>)).share("vram_3"); // bg2 ram + map(0x501000, 0x5013ff).ram().w(this, FUNC(tecmosys_state::lineram_w<2>)).share("bg2_lineram"); // bg2 linescroll? (guess) - map(0x700000, 0x703fff).ram().w(this, FUNC(tecmosys_state::fg_tilemap_w)).share("fgtilemap_ram"); // fix ram + map(0x700000, 0x703fff).ram().w(this, FUNC(tecmosys_state::vram_w<0>)).share("vram_0"); // fix ram map(0x800000, 0x80ffff).ram().share("spriteram"); // obj ram map(0x880000, 0x88000b).r(this, FUNC(tecmosys_state::unk880000_r)); + map(0x880000, 0x88002f).w(this, FUNC(tecmosys_state::unk880000_w)).share("880000regs"); // 10 byte dta@88000c, 880022=watchdog? map(0x900000, 0x907fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // AM_WRITEONLY // obj pal - //AM_RANGE(0x980000, 0x9807ff) AM_WRITEONLY // bg pal - //AM_RANGE(0x980800, 0x980fff) AM_WRITE(paletteram_xGGGGGRRRRRBBBBB_word_w) AM_SHARE("paletteram") // fix pal + //map(0x980000, 0x9807ff).writeonly(); // bg pal + //map(0x980800, 0x980fff).w(this, FUNC(tecmosys_state::paletteram_xGGGGGRRRRRBBBBB_word_w)).share("paletteram"); // fix pal // the two above are as tested by the game code, I've only rolled them into one below to get colours to show right. map(0x980000, 0x980fff).ram().w(this, FUNC(tecmosys_state::tilemap_paletteram16_xGGGGGRRRRRBBBBB_word_w)).share("tmap_palette"); - map(0x880000, 0x88002f).w(this, FUNC(tecmosys_state::unk880000_w)).share("880000regs"); // 10 byte dta@88000c, 880022=watchdog? map(0xa00000, 0xa00001).w(this, FUNC(tecmosys_state::eeprom_w)); - map(0xa80000, 0xa80005).writeonly().share("a80000regs"); // a80000-3 scroll? a80004 inverted ? 3 : 0 - map(0xb00000, 0xb00005).writeonly().share("b00000regs"); // b00000-3 scrool?, b00004 inverted ? 3 : 0 + map(0xa80000, 0xa80005).writeonly().share("scroll_2"); // a80000-3 scroll? a80004 inverted ? 3 : 0 + map(0xb00000, 0xb00005).writeonly().share("scroll_3"); // b00000-3 scrool?, b00004 inverted ? 3 : 0 map(0xb80000, 0xb80001).rw(this, FUNC(tecmosys_state::prot_status_r), FUNC(tecmosys_state::prot_status_w)); - map(0xc00000, 0xc00005).writeonly().share("c00000regs"); // c00000-3 scroll? c00004 inverted ? 13 : 10 - map(0xc80000, 0xc80005).writeonly().share("c80000regs"); // c80000-3 scrool? c80004 inverted ? 3 : 0 + map(0xc00000, 0xc00005).writeonly().share("scroll_0"); // c00000-3 scroll? c00004 inverted ? 13 : 10 + map(0xc80000, 0xc80005).writeonly().share("scroll_1"); // c80000-3 scrool? c80004 inverted ? 3 : 0 map(0xd00000, 0xd00001).portr("P1"); map(0xd00002, 0xd00003).portr("P2"); map(0xd80000, 0xd80001).r(this, FUNC(tecmosys_state::eeprom_r)); @@ -317,26 +335,29 @@ void tecmosys_state::main_map(address_map &map) WRITE8_MEMBER(tecmosys_state::z80_bank_w) { - membank("bank1")->set_entry(data); + m_audiobank->set_entry(data); } WRITE8_MEMBER(tecmosys_state::oki_bank_w) { - uint8_t upperbank = (data & 0x30) >> 4; - uint8_t lowerbank = (data & 0x03) >> 0; - uint8_t* region = memregion("oki")->base(); - - memcpy( region+0x00000, region+0x80000 + lowerbank * 0x20000, 0x20000 ); - memcpy( region+0x20000, region+0x80000 + upperbank * 0x20000, 0x20000 ); + m_okibank[0]->set_entry((data & 0x03) >> 0); + m_okibank[1]->set_entry((data & 0x30) >> 4); } + void tecmosys_state::sound_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("bank1"); + map(0x8000, 0xbfff).bankr("audiobank"); map(0xe000, 0xf7ff).ram(); } +void tecmosys_state::oki_map(address_map &map) +{ + map(0x00000, 0x1ffff).bankr("okibank1"); + map(0x20000, 0x3ffff).bankr("okibank2"); +} + void tecmosys_state::io_map(address_map &map) { map.global_mask(0xff); @@ -350,8 +371,7 @@ void tecmosys_state::io_map(address_map &map) } - -static INPUT_PORTS_START( deroon ) +static INPUT_PORTS_START( tecmosys ) PORT_START("P1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) @@ -398,9 +418,9 @@ static const gfx_layout gfxlayout = 8,8, RGN_FRAC(1,1), 4, - { 0,1,2,3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4}, - { 0*4*8, 1*4*8, 2*4*8, 3*4*8, 4*4*8, 5*4*8, 6*4*8, 7*4*8}, + { STEP8(0,1) }, + { STEP8(0,4) }, + { STEP8(0,4*8) }, 8*8*4 }; @@ -409,33 +429,32 @@ static const gfx_layout gfxlayout2 = 16,16, RGN_FRAC(1,1), 4, - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, - 8*8*4*1+0*4, 8*8*4*1+1*4, 8*8*4*1+2*4, 8*8*4*1+3*4, 8*8*4*1+4*4, 8*8*4*1+5*4,8*8*4*1+6*4, 8*8*4*1+7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, - 8*8*4*2+0*32, 8*8*4*2+1*32, 8*8*4*2+2*32, 8*8*4*2+3*32, 8*8*4*2+4*32, 8*8*4*2+5*32, 8*8*4*2+6*32, 8*8*4*2+7*32 }, - 128*8 + { STEP8(0,1) }, + { STEP8(0,4), STEP8(8*8*4,4) }, + { STEP8(0,4*8), STEP8(8*8*4*2,4*8) }, + 16*16*4 }; static GFXDECODE_START( tecmosys ) - GFXDECODE_ENTRY( "gfx2", 0, gfxlayout, 0x4400, 0x40 ) - GFXDECODE_ENTRY( "gfx3", 0, gfxlayout2, 0x4000, 0x40 ) - GFXDECODE_ENTRY( "gfx4", 0, gfxlayout2, 0x4000, 0x40 ) - GFXDECODE_ENTRY( "gfx5", 0, gfxlayout2, 0x4000, 0x40 ) - + GFXDECODE_ENTRY( "layer0", 0, gfxlayout, 0x4400, 0x40 ) + GFXDECODE_ENTRY( "layer1", 0, gfxlayout2, 0x4000, 0x40 ) + GFXDECODE_ENTRY( "layer2", 0, gfxlayout2, 0x4000, 0x40 ) + GFXDECODE_ENTRY( "layer3", 0, gfxlayout2, 0x4000, 0x40 ) GFXDECODE_END void tecmosys_state::machine_start() { - membank("bank1")->configure_entries(0, 16, memregion("audiocpu")->base(), 0x4000); + m_audiobank->configure_entries(0, 16, memregion("audiocpu")->base(), 0x4000); + for (int bank = 0; bank < 2; bank++) + m_okibank[bank]->configure_entries(0, 4, memregion("oki")->base(), 0x20000); save_item(NAME(m_device_read_ptr)); save_item(NAME(m_device_status)); save_item(NAME(m_device_value)); } -MACHINE_CONFIG_START(tecmosys_state::deroon) +MACHINE_CONFIG_START(tecmosys_state::tecmosys) MCFG_CPU_ADD("maincpu", M68000, XTAL(16'000'000)) MCFG_CPU_PROGRAM_MAP(main_map) MCFG_CPU_VBLANK_INT_DRIVER("screen", tecmosys_state, irq1_line_hold) @@ -447,7 +466,6 @@ MACHINE_CONFIG_START(tecmosys_state::deroon) MCFG_CPU_PROGRAM_MAP(sound_map) MCFG_CPU_IO_MAP(io_map) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", tecmosys) MCFG_EEPROM_SERIAL_93C46_ADD("eeprom") @@ -464,7 +482,6 @@ MACHINE_CONFIG_START(tecmosys_state::deroon) MCFG_PALETTE_ADD("palette", 0x4000+0x800) MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB) - /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -484,6 +501,7 @@ MACHINE_CONFIG_START(tecmosys_state::deroon) MCFG_OKIM6295_ADD("oki", XTAL(16'000'000)/8, PIN7_HIGH) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) + MCFG_DEVICE_ADDRESS_MAP(0, oki_map) MCFG_SOUND_ADD("ymz", YMZ280B, XTAL(16'934'400)) MCFG_SOUND_ROUTE(0, "lspeaker", 0.30) @@ -503,7 +521,7 @@ ROM_START( deroon ) ROM_LOAD( "deroon_68hc11a8.rom", 0x0000, 0x2000, NO_DUMP ) ROM_LOAD( "deroon_68hc11a8.eeprom", 0x2000, 0x0200, NO_DUMP ) - ROM_REGION( 0x2000000, "gfx1", ROMREGION_ERASE00 ) // Sprites (non-tile based) + ROM_REGION( 0x2000000, "sprites", ROMREGION_ERASE00 ) // Sprites (non-tile based) /* all these roms need verifying, they could be half size */ ROM_LOAD16_BYTE( "t101.uah1", 0x0000000, 0x200000, CRC(74baf845) SHA1(935d2954ba227a894542be492654a2750198e1bc) ) @@ -513,23 +531,23 @@ ROM_START( deroon ) /* 0x1000000, 0x400000 - no rom loaded here, these gfx are 4bpp */ ROM_LOAD16_BYTE( "t104.ucl1", 0x1000001, 0x200000, CRC(66eb611a) SHA1(64435d35677fea3c06fdb03c670f3f63ee481c02) ) - ROM_REGION( 0x100000, "gfx2", 0 ) // 8x8 4bpp tiles + ROM_REGION( 0x100000, "layer0", 0 ) // 8x8 4bpp tiles ROM_LOAD( "t301.ubd1", 0x000000, 0x100000, CRC(8b026177) SHA1(3887856bdaec4d9d3669fe3bc958ef186fbe9adb) ) - ROM_REGION( 0x100000, "gfx3", ROMREGION_ERASE00) // 16x16 4bpp tiles + ROM_REGION( 0x100000, "layer1", ROMREGION_ERASE00) // 16x16 4bpp tiles /* not used? */ - ROM_REGION( 0x100000, "gfx4", ROMREGION_ERASE00 ) // 16x16 4bpp tiles + ROM_REGION( 0x100000, "layer2", ROMREGION_ERASE00 ) // 16x16 4bpp tiles ROM_LOAD( "t201.ubb1", 0x000000, 0x100000, CRC(d5a087ac) SHA1(5098160ce7719d93e3edae05f6edd317d4c61f0d) ) - ROM_REGION( 0x100000, "gfx5", ROMREGION_ERASE00 ) // 16x16 4bpp tiles + ROM_REGION( 0x100000, "layer3", ROMREGION_ERASE00 ) // 16x16 4bpp tiles ROM_LOAD( "t202.ubc1", 0x000000, 0x100000, CRC(f051dae1) SHA1(f5677c07fe644b3838657370f0309fb09244c619) ) ROM_REGION( 0x200000, "ymz", 0 ) // YMZ280B Samples ROM_LOAD( "t401.uya1", 0x000000, 0x200000, CRC(92111992) SHA1(ae27e11ae76dec0b9892ad32e1a8bf6ab11f2e6c) ) - ROM_REGION( 0x100000, "oki", 0 ) // M6295 Samples - ROM_LOAD( "t501.uad1", 0x080000, 0x080000, CRC(2fbcfe27) SHA1(f25c830322423f0959a36955edb563a6150f2142) ) + ROM_REGION( 0x80000, "oki", 0 ) // M6295 Samples + ROM_LOAD( "t501.uad1", 0x000000, 0x080000, CRC(2fbcfe27) SHA1(f25c830322423f0959a36955edb563a6150f2142) ) ROM_END ROM_START( tkdensho ) @@ -545,7 +563,7 @@ ROM_START( tkdensho ) ROM_LOAD( "tkdensho_68hc11a8.rom", 0x0000, 0x2000, NO_DUMP ) ROM_LOAD( "tkdensho_68hc11a8.eeprom", 0x2000, 0x0200, NO_DUMP ) - ROM_REGION( 0x4000000, "gfx1", ROMREGION_ERASE00 ) // Graphics - mostly (maybe all?) not tile based + ROM_REGION( 0x4000000, "sprites", ROMREGION_ERASE00 ) // Graphics - mostly (maybe all?) not tile based ROM_LOAD16_BYTE( "ae100h.ah1", 0x0000000, 0x0400000, CRC(06be252b) SHA1(08d1bb569fd2e66e2c2f47da7780b31945232e62) ) ROM_LOAD16_BYTE( "ae100.al1", 0x0000001, 0x0400000, CRC(009cdff4) SHA1(fd88f07313d14fd4429b09a1e8d6b595df3b98e5) ) ROM_LOAD16_BYTE( "ae101h.bh1", 0x0800000, 0x0400000, CRC(f2469eff) SHA1(ba49d15cc7949437ba9f56d9b425a5f0e62137df) ) @@ -556,24 +574,24 @@ ROM_START( tkdensho ) ROM_LOAD16_BYTE( "ae105.fl1", 0x2800001, 0x0400000, CRC(b7f9ebc1) SHA1(987f664072b43a578b39fa6132aaaccc5fe5bfc2) ) ROM_LOAD16_BYTE( "ae106.gl1", 0x3000001, 0x0200000, CRC(7c50374b) SHA1(40865913125230122072bb13f46fb5fb60c088ea) ) - ROM_REGION( 0x080000, "gfx2", 0 ) // 8x8 4bpp tiles + ROM_REGION( 0x080000, "layer0", 0 ) // 8x8 4bpp tiles ROM_LOAD( "ae300w36.bd1", 0x000000, 0x0080000, CRC(e829f29e) SHA1(e56bfe2669ed1d1ae394c644def426db129d97e3) ) - ROM_REGION( 0x100000, "gfx3", 0 ) // 16x16 4bpp tiles + ROM_REGION( 0x100000, "layer1", 0 ) // 16x16 4bpp tiles ROM_LOAD( "ae200w74.ba1", 0x000000, 0x0100000, CRC(c1645041) SHA1(323670a6aa2a4524eb968cc0b4d688098ffeeb12) ) - ROM_REGION( 0x100000, "gfx4", 0 ) // 16x16 4bpp tiles + ROM_REGION( 0x100000, "layer2", 0 ) // 16x16 4bpp tiles ROM_LOAD( "ae201w75.bb1", 0x000000, 0x0100000, CRC(3f63bdff) SHA1(0d3d57fdc0ec4bceef27c11403b3631d23abadbf) ) - ROM_REGION( 0x100000, "gfx5", 0 ) // 16x16 4bpp tiles + ROM_REGION( 0x100000, "layer3", 0 ) // 16x16 4bpp tiles ROM_LOAD( "ae202w76.bc1", 0x000000, 0x0100000, CRC(5cc857ca) SHA1(2553fb5220433acc15dfb726dc064fe333e51d88) ) ROM_REGION( 0x400000, "ymz", 0 ) // YMZ280B Samples ROM_LOAD( "ae400t23.ya1", 0x000000, 0x200000, CRC(c6ffb043) SHA1(e0c6c5f6b840f63c9a685a2c3be66efa4935cbeb) ) ROM_LOAD( "ae401t24.yb1", 0x200000, 0x200000, CRC(d83f1a73) SHA1(412b7ac9ff09a984c28b7d195330d78c4aac3dc5) ) - ROM_REGION( 0x100000, "oki", 0 ) // M6295 Samples - ROM_LOAD( "ae500w07.ad1", 0x080000, 0x080000, CRC(3734f92c) SHA1(048555b5aa89eaf983305c439ba08d32b4a1bb80) ) + ROM_REGION( 0x80000, "oki", 0 ) // M6295 Samples + ROM_LOAD( "ae500w07.ad1", 0x000000, 0x080000, CRC(3734f92c) SHA1(048555b5aa89eaf983305c439ba08d32b4a1bb80) ) ROM_END ROM_START( tkdenshoa ) @@ -589,7 +607,7 @@ ROM_START( tkdenshoa ) ROM_LOAD( "tkdensho_68hc11a8.rom", 0x0000, 0x2000, NO_DUMP ) ROM_LOAD( "tkdensho_68hc11a8.eeprom", 0x2000, 0x0200, NO_DUMP ) - ROM_REGION( 0x4000000, "gfx1", ROMREGION_ERASE00 ) // Graphics - mostly (maybe all?) not tile based + ROM_REGION( 0x4000000, "sprites", ROMREGION_ERASE00 ) // Graphics - mostly (maybe all?) not tile based ROM_LOAD16_BYTE( "ae100h.ah1", 0x0000000, 0x0400000, CRC(06be252b) SHA1(08d1bb569fd2e66e2c2f47da7780b31945232e62) ) ROM_LOAD16_BYTE( "ae100.al1", 0x0000001, 0x0400000, CRC(009cdff4) SHA1(fd88f07313d14fd4429b09a1e8d6b595df3b98e5) ) ROM_LOAD16_BYTE( "ae101h.bh1", 0x0800000, 0x0400000, CRC(f2469eff) SHA1(ba49d15cc7949437ba9f56d9b425a5f0e62137df) ) @@ -600,45 +618,43 @@ ROM_START( tkdenshoa ) ROM_LOAD16_BYTE( "ae105.fl1", 0x2800001, 0x0400000, CRC(b7f9ebc1) SHA1(987f664072b43a578b39fa6132aaaccc5fe5bfc2) ) ROM_LOAD16_BYTE( "ae106.gl1", 0x3000001, 0x0200000, CRC(7c50374b) SHA1(40865913125230122072bb13f46fb5fb60c088ea) ) - ROM_REGION( 0x080000, "gfx2", 0 ) // 8x8 4bpp tiles + ROM_REGION( 0x080000, "layer0", 0 ) // 8x8 4bpp tiles ROM_LOAD( "ae300w36.bd1", 0x000000, 0x0080000, CRC(e829f29e) SHA1(e56bfe2669ed1d1ae394c644def426db129d97e3) ) - ROM_REGION( 0x100000, "gfx3", 0 ) // 16x16 4bpp tiles + ROM_REGION( 0x100000, "layer1", 0 ) // 16x16 4bpp tiles ROM_LOAD( "ae200w74.ba1", 0x000000, 0x0100000, CRC(c1645041) SHA1(323670a6aa2a4524eb968cc0b4d688098ffeeb12) ) - ROM_REGION( 0x100000, "gfx4", 0 ) // 16x16 4bpp tiles + ROM_REGION( 0x100000, "layer2", 0 ) // 16x16 4bpp tiles ROM_LOAD( "ae201w75.bb1", 0x000000, 0x0100000, CRC(3f63bdff) SHA1(0d3d57fdc0ec4bceef27c11403b3631d23abadbf) ) - ROM_REGION( 0x100000, "gfx5", 0 ) // 16x16 4bpp tiles + ROM_REGION( 0x100000, "layer3", 0 ) // 16x16 4bpp tiles ROM_LOAD( "ae202w76.bc1", 0x000000, 0x0100000, CRC(5cc857ca) SHA1(2553fb5220433acc15dfb726dc064fe333e51d88) ) ROM_REGION( 0x400000, "ymz", 0 ) // YMZ280B Samples ROM_LOAD( "ae400t23.ya1", 0x000000, 0x200000, CRC(c6ffb043) SHA1(e0c6c5f6b840f63c9a685a2c3be66efa4935cbeb) ) ROM_LOAD( "ae401t24.yb1", 0x200000, 0x200000, CRC(d83f1a73) SHA1(412b7ac9ff09a984c28b7d195330d78c4aac3dc5) ) - ROM_REGION( 0x100000, "oki", 0 ) // M6295 Samples - ROM_LOAD( "ae500w07.ad1", 0x080000, 0x080000, CRC(3734f92c) SHA1(048555b5aa89eaf983305c439ba08d32b4a1bb80) ) + ROM_REGION( 0x80000, "oki", 0 ) // M6295 Samples + ROM_LOAD( "ae500w07.ad1", 0x000000, 0x080000, CRC(3734f92c) SHA1(048555b5aa89eaf983305c439ba08d32b4a1bb80) ) ROM_END void tecmosys_state::descramble() { - uint8_t *gfxsrc = memregion( "gfx1" )->base(); - size_t srcsize = memregion( "gfx1" )->bytes(); int i; - for (i=0; i < srcsize; i+=4) + for (i=0; i < m_sprite_region.length(); i+=4) { uint8_t tmp[4]; - tmp[2] = ((gfxsrc[i+0]&0xf0)>>0) | ((gfxsrc[i+1]&0xf0)>>4); // 0, 1, 2, 3 8, 9,10,11 - tmp[3] = ((gfxsrc[i+0]&0x0f)<<4) | ((gfxsrc[i+1]&0x0f)<<0); // 4, 5, 6, 7, 12,13,14,15 - tmp[0] = ((gfxsrc[i+2]&0xf0)>>0) | ((gfxsrc[i+3]&0xf0)>>4); // 16,17,18,19, 24,25,26,27 - tmp[1] = ((gfxsrc[i+2]&0x0f)<<4) | ((gfxsrc[i+3]&0x0f)>>0); // 20,21,22,23, 28,29,30,31 + tmp[2] = ((m_sprite_region[i+0]&0xf0)>>0) | ((m_sprite_region[i+1]&0xf0)>>4); // 0, 1, 2, 3 8, 9,10,11 + tmp[3] = ((m_sprite_region[i+0]&0x0f)<<4) | ((m_sprite_region[i+1]&0x0f)<<0); // 4, 5, 6, 7, 12,13,14,15 + tmp[0] = ((m_sprite_region[i+2]&0xf0)>>0) | ((m_sprite_region[i+3]&0xf0)>>4); // 16,17,18,19, 24,25,26,27 + tmp[1] = ((m_sprite_region[i+2]&0x0f)<<4) | ((m_sprite_region[i+3]&0x0f)>>0); // 20,21,22,23, 28,29,30,31 - gfxsrc[i+0] = tmp[0]; - gfxsrc[i+1] = tmp[1]; - gfxsrc[i+2] = tmp[2]; - gfxsrc[i+3] = tmp[3]; + m_sprite_region[i+0] = tmp[0]; + m_sprite_region[i+1] = tmp[1]; + m_sprite_region[i+2] = tmp[2]; + m_sprite_region[i+3] = tmp[3]; } } @@ -660,6 +676,6 @@ DRIVER_INIT_MEMBER(tecmosys_state,tkdensha) prot_init(2); } -GAME( 1995, deroon, 0, deroon, deroon, tecmosys_state, deroon, ROT0, "Tecmo", "Deroon DeroDero", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, tkdensho, 0, deroon, deroon, tecmosys_state, tkdensho, ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960614)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, tkdenshoa, tkdensho, deroon, deroon, tecmosys_state, tkdensha, ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960427)", MACHINE_SUPPORTS_SAVE ) +GAME( 1995, deroon, 0, tecmosys, tecmosys, tecmosys_state, deroon, ROT0, "Tecmo", "Deroon DeroDero", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1996, tkdensho, 0, tecmosys, tecmosys, tecmosys_state, tkdensho, ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960614)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1996, tkdenshoa, tkdensho, tecmosys, tecmosys, tecmosys_state, tkdensha, ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960427)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/tecmosys.h b/src/mame/includes/tecmosys.h index 50ac01c775f..52290361a6b 100644 --- a/src/mame/includes/tecmosys.h +++ b/src/mame/includes/tecmosys.h @@ -16,30 +16,27 @@ class tecmosys_state : public driver_device { public: tecmosys_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_eeprom(*this, "eeprom"), - m_watchdog(*this, "watchdog"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch"), - m_soundnmi(*this, "soundnmi"), - m_spriteram(*this, "spriteram"), - m_tilemap_paletteram16(*this, "tmap_palette"), - m_bg2tilemap_ram(*this, "bg2tilemap_ram"), - m_bg1tilemap_ram(*this, "bg1tilemap_ram"), - m_bg0tilemap_ram(*this, "bg0tilemap_ram"), - m_fgtilemap_ram(*this, "fgtilemap_ram"), - m_bg0tilemap_lineram(*this, "bg0_lineram"), - m_bg1tilemap_lineram(*this, "bg1_lineram"), - m_bg2tilemap_lineram(*this, "bg2_lineram"), - m_a80000regs(*this, "a80000regs"), - m_b00000regs(*this, "b00000regs"), - m_c00000regs(*this, "c00000regs"), - m_c80000regs(*this, "c80000regs"), - m_880000regs(*this, "880000regs") { } + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_audiocpu(*this, "audiocpu") + , m_eeprom(*this, "eeprom") + , m_watchdog(*this, "watchdog") + , m_gfxdecode(*this, "gfxdecode") + , m_screen(*this, "screen") + , m_palette(*this, "palette") + , m_soundlatch(*this, "soundlatch") + , m_soundnmi(*this, "soundnmi") + , m_spriteram(*this, "spriteram") + , m_tilemap_paletteram16(*this, "tmap_palette") + , m_vram(*this, "vram_%u", 0) + , m_lineram(*this, "bg%u_lineram", 0) + , m_scroll(*this, "scroll_%u", 0) + , m_880000regs(*this, "880000regs") + , m_sprite_region(*this, "sprites") + , m_audiobank(*this, "audiobank") + , m_okibank(*this, "okibank%u", 1) + { + } required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; @@ -53,27 +50,21 @@ public: required_shared_ptr<uint16_t> m_spriteram; required_shared_ptr<uint16_t> m_tilemap_paletteram16; - required_shared_ptr<uint16_t> m_bg2tilemap_ram; - required_shared_ptr<uint16_t> m_bg1tilemap_ram; - required_shared_ptr<uint16_t> m_bg0tilemap_ram; - required_shared_ptr<uint16_t> m_fgtilemap_ram; - required_shared_ptr<uint16_t> m_bg0tilemap_lineram; - required_shared_ptr<uint16_t> m_bg1tilemap_lineram; - required_shared_ptr<uint16_t> m_bg2tilemap_lineram; - required_shared_ptr<uint16_t> m_a80000regs; - required_shared_ptr<uint16_t> m_b00000regs; - required_shared_ptr<uint16_t> m_c00000regs; - required_shared_ptr<uint16_t> m_c80000regs; + required_shared_ptr_array<uint16_t, 4> m_vram; + required_shared_ptr_array<uint16_t, 3> m_lineram; + required_shared_ptr_array<uint16_t, 4> m_scroll; required_shared_ptr<uint16_t> m_880000regs; + required_region_ptr<uint8_t> m_sprite_region; + + required_memory_bank m_audiobank; + required_memory_bank_array<2> m_okibank; + int m_spritelist; bitmap_ind16 m_sprite_bitmap; bitmap_ind16 m_tmp_tilemap_composebitmap; bitmap_ind16 m_tmp_tilemap_renderbitmap; - tilemap_t *m_bg0tilemap; - tilemap_t *m_bg1tilemap; - tilemap_t *m_bg2tilemap; - tilemap_t *m_txt_tilemap; + tilemap_t *m_tilemap[4]; uint8_t m_device_read_ptr; uint8_t m_device_status; const struct prot_data* m_device_data; @@ -89,14 +80,9 @@ public: DECLARE_WRITE16_MEMBER(prot_status_w); DECLARE_READ16_MEMBER(prot_data_r); DECLARE_WRITE16_MEMBER(prot_data_w); - DECLARE_WRITE16_MEMBER(bg0_tilemap_w); - DECLARE_WRITE16_MEMBER(bg1_tilemap_w); - DECLARE_WRITE16_MEMBER(bg2_tilemap_w); - DECLARE_WRITE16_MEMBER(fg_tilemap_w); + template<int Layer> DECLARE_WRITE16_MEMBER(vram_w); DECLARE_WRITE16_MEMBER(tilemap_paletteram16_xGGGGGRRRRRBBBBB_word_w); - DECLARE_WRITE16_MEMBER(bg0_tilemap_lineram_w); - DECLARE_WRITE16_MEMBER(bg1_tilemap_lineram_w); - DECLARE_WRITE16_MEMBER(bg2_tilemap_lineram_w); + template<int Layer> DECLARE_WRITE16_MEMBER(lineram_w); DECLARE_READ16_MEMBER(eeprom_r); DECLARE_WRITE16_MEMBER(eeprom_w); @@ -106,21 +92,19 @@ public: virtual void machine_start() override; virtual void video_start() override; - TILE_GET_INFO_MEMBER(get_bg0tile_info); - TILE_GET_INFO_MEMBER(get_bg1tile_info); - TILE_GET_INFO_MEMBER(get_bg2tile_info); - TILE_GET_INFO_MEMBER(get_fg_tile_info); + template<int Layer> TILE_GET_INFO_MEMBER(get_tile_info); uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void prot_init(int which); void prot_reset(); inline void set_color_555(pen_t color, int rshift, int gshift, int bshift, uint16_t data); void render_sprites_to_bitmap(bitmap_rgb32 &bitmap, uint16_t extrax, uint16_t extray ); - void tilemap_copy_to_compose(uint16_t pri); - void do_final_mix(bitmap_rgb32 &bitmap); + void tilemap_copy_to_compose(uint16_t pri, const rectangle &cliprect); + void do_final_mix(bitmap_rgb32 &bitmap, const rectangle &cliprect); void descramble(); - void deroon(machine_config &config); + void tecmosys(machine_config &config); void io_map(address_map &map); void main_map(address_map &map); + void oki_map(address_map &map); void sound_map(address_map &map); }; diff --git a/src/mame/video/tecmosys.cpp b/src/mame/video/tecmosys.cpp index a3af6f5cd95..f84f5c7b742 100644 --- a/src/mame/video/tecmosys.cpp +++ b/src/mame/video/tecmosys.cpp @@ -10,61 +10,13 @@ #include "includes/tecmosys.h" -TILE_GET_INFO_MEMBER(tecmosys_state::get_bg0tile_info) +template<int Layer> +TILE_GET_INFO_MEMBER(tecmosys_state::get_tile_info) { - SET_TILE_INFO_MEMBER(1, - m_bg0tilemap_ram[2*tile_index+1], - (m_bg0tilemap_ram[2*tile_index]&0x3f), - TILE_FLIPYX((m_bg0tilemap_ram[2*tile_index]&0xc0)>>6)); -} - -TILE_GET_INFO_MEMBER(tecmosys_state::get_bg1tile_info) -{ - SET_TILE_INFO_MEMBER(2, - m_bg1tilemap_ram[2*tile_index+1], - (m_bg1tilemap_ram[2*tile_index]&0x3f), - TILE_FLIPYX((m_bg1tilemap_ram[2*tile_index]&0xc0)>>6)); -} - -TILE_GET_INFO_MEMBER(tecmosys_state::get_bg2tile_info) -{ - SET_TILE_INFO_MEMBER(3, - m_bg2tilemap_ram[2*tile_index+1], - (m_bg2tilemap_ram[2*tile_index]&0x3f), - TILE_FLIPYX((m_bg2tilemap_ram[2*tile_index]&0xc0)>>6)); -} - -TILE_GET_INFO_MEMBER(tecmosys_state::get_fg_tile_info) -{ - SET_TILE_INFO_MEMBER(0, - m_fgtilemap_ram[2*tile_index+1], - (m_fgtilemap_ram[2*tile_index]&0x3f), - TILE_FLIPYX((m_fgtilemap_ram[2*tile_index]&0xc0)>>6)); -} - - -WRITE16_MEMBER(tecmosys_state::bg0_tilemap_w) -{ - COMBINE_DATA(&m_bg0tilemap_ram[offset]); - m_bg0tilemap->mark_tile_dirty(offset/2); -} - -WRITE16_MEMBER(tecmosys_state::bg1_tilemap_w) -{ - COMBINE_DATA(&m_bg1tilemap_ram[offset]); - m_bg1tilemap->mark_tile_dirty(offset/2); -} - -WRITE16_MEMBER(tecmosys_state::bg2_tilemap_w) -{ - COMBINE_DATA(&m_bg2tilemap_ram[offset]); - m_bg2tilemap->mark_tile_dirty(offset/2); -} - -WRITE16_MEMBER(tecmosys_state::fg_tilemap_w) -{ - COMBINE_DATA(&m_fgtilemap_ram[offset]); - m_txt_tilemap->mark_tile_dirty(offset/2); + SET_TILE_INFO_MEMBER(Layer, + m_vram[Layer][2*tile_index+1], + (m_vram[Layer][2*tile_index]&0x3f), + TILE_FLIPYX((m_vram[Layer][2*tile_index]&0xc0)>>6)); } @@ -79,29 +31,8 @@ WRITE16_MEMBER(tecmosys_state::tilemap_paletteram16_xGGGGGRRRRRBBBBB_word_w) set_color_555(offset+0x4000, 5, 10, 0, m_tilemap_paletteram16[offset]); } -WRITE16_MEMBER(tecmosys_state::bg0_tilemap_lineram_w) -{ - COMBINE_DATA(&m_bg0tilemap_lineram[offset]); - if (data!=0x0000) popmessage("non 0 write to bg0 lineram %04x %04x",offset,data); -} - -WRITE16_MEMBER(tecmosys_state::bg1_tilemap_lineram_w) -{ - COMBINE_DATA(&m_bg1tilemap_lineram[offset]); - if (data!=0x0000) popmessage("non 0 write to bg1 lineram %04x %04x",offset,data); -} - -WRITE16_MEMBER(tecmosys_state::bg2_tilemap_lineram_w) -{ - COMBINE_DATA(&m_bg2tilemap_lineram[offset]); - if (data!=0x0000) popmessage("non 0 write to bg2 lineram %04x %04x",offset,data); -} - - - void tecmosys_state::render_sprites_to_bitmap(bitmap_rgb32 &bitmap, uint16_t extrax, uint16_t extray ) { - uint8_t *gfxsrc = memregion ( "gfx1" )->base(); int i; /* render sprites (with priority information) to temp bitmap */ @@ -178,7 +109,7 @@ void tecmosys_state::render_sprites_to_bitmap(bitmap_rgb32 &bitmap, uint16_t ext dstptr = &m_sprite_bitmap.pix16(drawy, drawx); - data = (gfxsrc[address]); + data = (m_sprite_region[address]); if(data) dstptr[0] = (data + (colour*0x100)) | (priority << 14); @@ -190,16 +121,16 @@ void tecmosys_state::render_sprites_to_bitmap(bitmap_rgb32 &bitmap, uint16_t ext } } -void tecmosys_state::tilemap_copy_to_compose(uint16_t pri) +void tecmosys_state::tilemap_copy_to_compose(uint16_t pri, const rectangle &cliprect) { int y,x; uint16_t *srcptr; uint16_t *dstptr; - for (y=0;y<240;y++) + for (y=cliprect.min_y;y<=cliprect.max_y;y++) { srcptr = &m_tmp_tilemap_renderbitmap.pix16(y); dstptr = &m_tmp_tilemap_composebitmap.pix16(y); - for (x=0;x<320;x++) + for (x=cliprect.min_x;x<=cliprect.max_x;x++) { if ((srcptr[x]&0xf)!=0x0) dstptr[x] = (srcptr[x]&0x7ff) | pri; @@ -207,7 +138,34 @@ void tecmosys_state::tilemap_copy_to_compose(uint16_t pri) } } -void tecmosys_state::do_final_mix(bitmap_rgb32 &bitmap) +#define DRAW_BLENDED \ + int r,g,b; \ + int r2,g2,b2; \ + b = (colour & 0x000000ff) >> 0; \ + g = (colour & 0x0000ff00) >> 8; \ + r = (colour & 0x00ff0000) >> 16; \ + \ + b2 = (colour2 & 0x000000ff) >> 0; \ + g2 = (colour2 & 0x0000ff00) >> 8; \ + r2 = (colour2 & 0x00ff0000) >> 16; \ + \ + r = (r + r2) >> 1; \ + g = (g + g2) >> 1; \ + b = (b + b2) >> 1; \ + \ + dstptr[x] = b | (g<<8) | (r<<16); + +#define DRAW_BG \ + if (srcptr[x]&0xf) \ + { \ + dstptr[x] = colour; \ + } \ + else \ + { \ + dstptr[x] = m_palette->pen(0x3f00); \ + } + +void tecmosys_state::do_final_mix(bitmap_rgb32 &bitmap, const rectangle &cliprect) { const pen_t *paldata = m_palette->pens(); int y,x; @@ -215,19 +173,21 @@ void tecmosys_state::do_final_mix(bitmap_rgb32 &bitmap) uint16_t *srcptr2; uint32_t *dstptr; - for (y=0;y<240;y++) + for (y=cliprect.min_y;y<=cliprect.max_y;y++) { srcptr = &m_tmp_tilemap_composebitmap.pix16(y); srcptr2 = &m_sprite_bitmap.pix16(y); dstptr = &bitmap.pix32(y); - for (x=0;x<320;x++) + for (x=cliprect.min_x;x<=cliprect.max_x;x++) { uint16_t pri, pri2; uint16_t penvalue; uint16_t penvalue2; uint32_t colour; uint32_t colour2; + uint8_t mask = 0; + bool is_transparent = false; pri = srcptr[x] & 0xc000; pri2 = srcptr2[x] & 0xc000; @@ -235,42 +195,49 @@ void tecmosys_state::do_final_mix(bitmap_rgb32 &bitmap) penvalue = m_tilemap_paletteram16[srcptr[x]&0x7ff]; colour = paldata[(srcptr[x]&0x7ff) | 0x4000]; - if (srcptr2[x]&0x3fff) + if (srcptr2[x]&0xff) { penvalue2 = m_palette->basemem().read(srcptr2[x] & 0x3fff); colour2 = paldata[srcptr2[x]&0x3fff]; + mask = srcptr2[x]&0xff; } - else + else if (srcptr[x]&0xf) { penvalue2 = m_tilemap_paletteram16[srcptr[x]&0x7ff]; colour2 = paldata[(srcptr[x]&0x7ff) | 0x4000]; + mask = srcptr[x]&0xf; } - - if ((penvalue & 0x8000) && (penvalue2 & 0x8000)) // blend + else { - int r,g,b; - int r2,g2,b2; - b = (colour & 0x000000ff) >> 0; - g = (colour & 0x0000ff00) >> 8; - r = (colour & 0x00ff0000) >> 16; - - b2 = (colour2 & 0x000000ff) >> 0; - g2 = (colour2 & 0x0000ff00) >> 8; - r2 = (colour2 & 0x00ff0000) >> 16; - - r = (r + r2) >> 1; - g = (g + g2) >> 1; - b = (b + b2) >> 1; - - dstptr[x] = b | (g<<8) | (r<<16); + penvalue2 = m_palette->basemem().read(0x3f00); + colour2 = paldata[0x3f00]; + is_transparent = true; } - else if (pri2 >= pri) + if (is_transparent) { - dstptr[x] = colour2; + if (((penvalue & 0x8000) && (srcptr[x]&0xf)) && (penvalue2 & 0x8000)) // blend + { + DRAW_BLENDED; + } + else + { + DRAW_BG; + } } else { - dstptr[x] = colour; + if (((penvalue & 0x8000) && (srcptr[x]&0xf)) && ((penvalue2 & 0x8000) && (mask))) // blend + { + DRAW_BLENDED; + } + else if ((pri2 >= pri) && (mask)) + { + dstptr[x] = colour2; + } + else + { + DRAW_BG; + } } } } @@ -279,38 +246,44 @@ void tecmosys_state::do_final_mix(bitmap_rgb32 &bitmap) uint32_t tecmosys_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - bitmap.fill(m_palette->pen(0x4000), cliprect); - - - m_bg0tilemap->set_scrolly(0, m_c80000regs[1]+16); - m_bg0tilemap->set_scrollx(0, m_c80000regs[0]+104); - - m_bg1tilemap->set_scrolly(0, m_a80000regs[1]+17); - m_bg1tilemap->set_scrollx(0, m_a80000regs[0]+106); - - m_bg2tilemap->set_scrolly(0, m_b00000regs[1]+17); - m_bg2tilemap->set_scrollx(0, m_b00000regs[0]+106); + bitmap.fill(0, cliprect); + + // TODO : Verify 0xc00000-0xc00003 scroll both flip screen and normal screen case, Bit 4 of 0xc00004 is unknown + // TODO : is tilemap flip bits is correct? + m_tilemap[0]->set_flip(((m_scroll[0][2] & 1) ? TILEMAP_FLIPX : 0) | ((m_scroll[0][2] & 2) ? TILEMAP_FLIPY : 0) ); + + // TODO : Scroll is wrong/unverified when flip screen case + m_tilemap[1]->set_flip(((m_scroll[1][2] & 1) ? TILEMAP_FLIPX : 0) | ((m_scroll[1][2] & 2) ? TILEMAP_FLIPY : 0) ); + m_tilemap[1]->set_scrolly(0, m_scroll[1][1]+16); + m_tilemap[1]->set_scrollx(0, m_scroll[1][0]+104); + + m_tilemap[2]->set_flip(((m_scroll[2][2] & 1) ? TILEMAP_FLIPX : 0) | ((m_scroll[2][2] & 2) ? TILEMAP_FLIPY : 0) ); + m_tilemap[2]->set_scrolly(0, m_scroll[2][1]+17); + m_tilemap[2]->set_scrollx(0, m_scroll[2][0]+106); + + m_tilemap[3]->set_flip(((m_scroll[3][2] & 1) ? TILEMAP_FLIPX : 0) | ((m_scroll[3][2] & 2) ? TILEMAP_FLIPY : 0) ); + m_tilemap[3]->set_scrolly(0, m_scroll[3][1]+17); + m_tilemap[3]->set_scrollx(0, m_scroll[3][0]+106); m_tmp_tilemap_composebitmap.fill(0, cliprect); m_tmp_tilemap_renderbitmap.fill(0, cliprect); - m_bg0tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); - tilemap_copy_to_compose(0x0000); + m_tilemap[1]->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); + tilemap_copy_to_compose(0x0000, cliprect); m_tmp_tilemap_renderbitmap.fill(0, cliprect); - m_bg1tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); - tilemap_copy_to_compose(0x4000); + m_tilemap[2]->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); + tilemap_copy_to_compose(0x4000, cliprect); m_tmp_tilemap_renderbitmap.fill(0, cliprect); - m_bg2tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); - tilemap_copy_to_compose(0x8000); + m_tilemap[3]->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); + tilemap_copy_to_compose(0x8000, cliprect); m_tmp_tilemap_renderbitmap.fill(0, cliprect); - m_txt_tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); - tilemap_copy_to_compose(0xc000); - + m_tilemap[0]->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); + tilemap_copy_to_compose(0xc000, cliprect); - do_final_mix(bitmap); + do_final_mix(bitmap, cliprect); // prepare sprites for NEXT frame - causes 1 frame palette errors, but prevents sprite lag in tkdensho, which is correct? render_sprites_to_bitmap(bitmap, m_880000regs[0x0], m_880000regs[0x1]); @@ -320,27 +293,25 @@ uint32_t tecmosys_state::screen_update(screen_device &screen, bitmap_rgb32 &bitm void tecmosys_state::video_start() { - m_sprite_bitmap.allocate(320,240); + m_screen->register_screen_bitmap(m_sprite_bitmap); m_sprite_bitmap.fill(0x4000); - - m_tmp_tilemap_composebitmap.allocate(320,240); - m_tmp_tilemap_renderbitmap.allocate(320,240); - + + m_screen->register_screen_bitmap(m_tmp_tilemap_composebitmap); + m_screen->register_screen_bitmap(m_tmp_tilemap_renderbitmap); m_tmp_tilemap_composebitmap.fill(0x0000); m_tmp_tilemap_renderbitmap.fill(0x0000); + m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tecmosys_state::get_tile_info<0>),this),TILEMAP_SCAN_ROWS,8,8,32*2,32*2); + m_tilemap[0]->set_transparent_pen(0); - m_txt_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tecmosys_state::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32*2,32*2); - m_txt_tilemap->set_transparent_pen(0); - - m_bg0tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tecmosys_state::get_bg0tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32); - m_bg0tilemap->set_transparent_pen(0); + m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tecmosys_state::get_tile_info<1>),this),TILEMAP_SCAN_ROWS,16,16,32,32); + m_tilemap[1]->set_transparent_pen(0); - m_bg1tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tecmosys_state::get_bg1tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32); - m_bg1tilemap->set_transparent_pen(0); + m_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tecmosys_state::get_tile_info<2>),this),TILEMAP_SCAN_ROWS,16,16,32,32); + m_tilemap[2]->set_transparent_pen(0); - m_bg2tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tecmosys_state::get_bg2tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32); - m_bg2tilemap->set_transparent_pen(0); + m_tilemap[3] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tecmosys_state::get_tile_info<3>),this),TILEMAP_SCAN_ROWS,16,16,32,32); + m_tilemap[3]->set_transparent_pen(0); save_item(NAME(m_spritelist)); } |