diff --git a/src/mame/drivers/gaiden.cpp b/src/mame/drivers/gaiden.cpp index ab8880c7c30..67daef9ff66 100644 --- a/src/mame/drivers/gaiden.cpp +++ b/src/mame/drivers/gaiden.cpp @@ -667,10 +667,10 @@ static const gfx_layout tilelayout = 8,8, /* tile size */ RGN_FRAC(1,1), /* number of tiles */ 4, /* 4 bits per pixel */ - { 0, 1, 2, 3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 /* offset to next tile */ + { STEP4(0,1) }, /* the bitplanes are packed in one nibble */ + { STEP8(0,4) }, + { STEP8(0,4*8) }, + 4*8*8 /* offset to next tile */ }; static const gfx_layout tile2layout = @@ -678,31 +678,17 @@ static const gfx_layout tile2layout = 16,16, /* tile size */ RGN_FRAC(1,1), /* number of tiles */ 4, /* 4 bits per pixel */ - { 0, 1, 2, 3 }, /* the bitplanes are packed in one nibble */ - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, - 32*8+0*4, 32*8+1*4, 32*8+2*4, 32*8+3*4, - 32*8+4*4, 32*8+5*4, 32*8+6*4, 32*8+7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, - 16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32}, - 128*8 /* offset to next tile */ -}; - -static const gfx_layout spritelayout = -{ - 8,8, /* sprites size */ - RGN_FRAC(1,2), /* number of sprites */ - 4, /* 4 bits per pixel */ - { 0, 1, 2, 3 }, /* the bitplanes are packed in one nibble */ - { 0,4,RGN_FRAC(1,2),4+RGN_FRAC(1,2),8,12,8+RGN_FRAC(1,2),12+RGN_FRAC(1,2) }, - { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, - 16*8 /* offset to next sprite */ + { STEP4(0,1) }, /* the bitplanes are packed in one nibble */ + { STEP8(0,4), STEP8(4*8*8,4) }, + { STEP8(0,4*8), STEP8(4*8*8*2,4*8) }, + 4*8*8*2*2 /* offset to next tile */ }; static GFXDECODE_START( gfx_gaiden ) - GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0x100, 16 ) /* tiles 8x8 */ - GFXDECODE_ENTRY( "gfx2", 0, tile2layout, 0x000, 0x1000 ) /* tiles 16x16 */ - GFXDECODE_ENTRY( "gfx3", 0, tile2layout, 0x000, 0x1000 ) /* tiles 16x16 (only colors 0x00-0x0f and 0x80-0x8f are used) */ - GFXDECODE_ENTRY( "gfx4", 0, spritelayout, 0x000, 0x1000 ) /* sprites 8x8 (only colors 0x00-0x0f and 0x80-0x8f are used) */ + GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0x100, 16 ) /* tiles 8x8 */ + GFXDECODE_ENTRY( "gfx2", 0, tile2layout, 0x000, 0x100 ) /* tiles 16x16 */ + GFXDECODE_ENTRY( "gfx3", 0, tile2layout, 0x000, 0x100 ) /* tiles 16x16 (only colors 0x00-0x0f and 0x80-0x8f are used) */ + GFXDECODE_ENTRY( "gfx4", 0, tilelayout, 0x000, 0x100 ) /* sprites 8x8 (only colors 0x00-0x0f and 0x80-0x8f are used) */ GFXDECODE_END static const gfx_layout mastninj_tile2layout = @@ -778,6 +764,8 @@ MACHINE_CONFIG_START(gaiden_state::shadoww) WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ + BUFFERED_SPRITERAM16(config, m_spriteram); + MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(59.17) /* verified on pcb */ MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) @@ -792,13 +780,13 @@ MACHINE_CONFIG_START(gaiden_state::shadoww) MCFG_DEVICE_ADD("spritegen", TECMO_SPRITE, 0) MCFG_TECMO_SPRITE_GFX_REGION(3) - MCFG_DEVICE_ADD("mixer", TECMO_MIXER, 0) - MCFG_TECMO_MIXER_SHIFTS(10,9,4) - MCFG_TECMO_MIXER_BLENDCOLS( 0x0400 + 0x300, 0x0400 + 0x200, 0x0400 + 0x100, 0x0400 + 0x000 ) - MCFG_TECMO_MIXER_REGULARCOLS( 0x0000 + 0x300, 0x0000 + 0x200, 0x0000 + 0x100, 0x0000 + 0x000 ) - MCFG_TECMO_MIXER_BLENDSOURCE( 0x0800 + 0x000, 0x0800 + 0x200) - MCFG_TECMO_MIXER_REVSPRITETILE - MCFG_TECMO_MIXER_BGPEN(0x000 + 0x200) + TECMO_MIXER(config, m_mixer, 0); + m_mixer->set_mixer_shifts(10,9,4); + m_mixer->set_blendcols( 0x0400 + 0x300, 0x0400 + 0x200, 0x0400 + 0x100, 0x0400 + 0x000 ); + m_mixer->set_regularcols( 0x0000 + 0x300, 0x0000 + 0x200, 0x0000 + 0x100, 0x0000 + 0x000 ); + m_mixer->set_blendsource( 0x0800 + 0x000, 0x0800 + 0x200); + m_mixer->set_revspritetile(); + m_mixer->set_bgpen(0x000 + 0x200, 0x400 + 0x200); MCFG_VIDEO_START_OVERRIDE(gaiden_state,gaiden) @@ -845,6 +833,11 @@ MACHINE_CONFIG_START(gaiden_state::raiga) MCFG_MACHINE_RESET_OVERRIDE(gaiden_state,raiga) MCFG_VIDEO_START_OVERRIDE(gaiden_state,raiga) + + MCFG_SCREEN_MODIFY("screen") + MCFG_SCREEN_UPDATE_DRIVER(gaiden_state, screen_update_raiga) + MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("spriteram", buffered_spriteram16_device, vblank_copy_rising)) + MACHINE_CONFIG_END MACHINE_CONFIG_START(gaiden_state::drgnbowl) @@ -859,6 +852,8 @@ MACHINE_CONFIG_START(gaiden_state::drgnbowl) MCFG_DEVICE_IO_MAP(drgnbowl_sound_port_map) /* video hardware */ + BUFFERED_SPRITERAM16(config, m_spriteram); + MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) @@ -1017,6 +1012,8 @@ MACHINE_CONFIG_START(gaiden_state::mastninj) WATCHDOG_TIMER(config, "watchdog"); /* video hardware */ + BUFFERED_SPRITERAM16(config, m_spriteram); + MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) @@ -1100,17 +1097,17 @@ ROM_START( shadoww ) ROM_REGION( 0x100000, "gfx4", 0 ) /* Should all these roms be 0x10000 bytes on this board? */ - ROM_LOAD( "6.3m", 0x000000, 0x20000, CRC(e7ccdf9f) SHA1(80ffcefc95660471124898a9c2bee55df36bda13) ) /* sprites A1 */ - ROM_LOAD( "8.3n", 0x020000, 0x20000, CRC(7ef7f880) SHA1(26ba9a76adce24beea3cffa1cb95aeafe6f82f96) ) /* sprites B1 */ - ROM_LOAD( "10.3r", 0x040000, 0x20000, CRC(a6451dec) SHA1(553e7a1453b59055fa0b10ca04125543d9f8987c) ) /* sprites C1 */ - ROM_LOAD( "shadoww_12a.xx", 0x060000, 0x10000, CRC(9bb07731) SHA1(b799b1958dc9b84797fdab2591e33bd5d28884a3) ) /* sprites D1 */ - ROM_LOAD( "shadoww_12b.xx", 0x070000, 0x10000, CRC(a4a950a2) SHA1(9766b5e88edd16554e59179a37cca49d29f83367) ) /* sprites D1 */ + ROM_LOAD16_BYTE( "6.3m", 0x000000, 0x20000, CRC(e7ccdf9f) SHA1(80ffcefc95660471124898a9c2bee55df36bda13) ) /* sprites A1 */ + ROM_LOAD16_BYTE( "8.3n", 0x040000, 0x20000, CRC(7ef7f880) SHA1(26ba9a76adce24beea3cffa1cb95aeafe6f82f96) ) /* sprites B1 */ + ROM_LOAD16_BYTE( "10.3r", 0x080000, 0x20000, CRC(a6451dec) SHA1(553e7a1453b59055fa0b10ca04125543d9f8987c) ) /* sprites C1 */ + ROM_LOAD16_BYTE( "shadoww_12a.xx", 0x0c0000, 0x10000, CRC(9bb07731) SHA1(b799b1958dc9b84797fdab2591e33bd5d28884a3) ) /* sprites D1 */ + ROM_LOAD16_BYTE( "shadoww_12b.xx", 0x0e0000, 0x10000, CRC(a4a950a2) SHA1(9766b5e88edd16554e59179a37cca49d29f83367) ) /* sprites D1 */ - ROM_LOAD( "7.1m", 0x080000, 0x20000, CRC(016bec95) SHA1(6a6757c52ca9a2398ea43d1af4a8d5adde6f4cd2) ) /* sprites A2 */ - ROM_LOAD( "9.1n", 0x0a0000, 0x20000, CRC(6e9b7fd3) SHA1(c86ff61844fc94c02625bb812b9062d0649c8fdf) ) /* sprites B2 */ - ROM_LOAD( "11.1r", 0x0c0000, 0x20000, CRC(7fbfdf5e) SHA1(ab67b72dcadb5f2236d29de751de5bf890a9e423) ) /* sprites C2 */ - ROM_LOAD( "shadoww_13a.xx", 0x0e0000, 0x10000, CRC(996d2fa5) SHA1(a32526949af3635914927ebbbe684c3de9562a9d) ) /* sprites D2 */ - ROM_LOAD( "shadoww_13b.xx", 0x0f0000, 0x10000, CRC(b8df8a34) SHA1(6810f7961052a983b8c78b42d550038051012c6d) ) /* sprites D2 */ + ROM_LOAD16_BYTE( "7.1m", 0x000001, 0x20000, CRC(016bec95) SHA1(6a6757c52ca9a2398ea43d1af4a8d5adde6f4cd2) ) /* sprites A2 */ + ROM_LOAD16_BYTE( "9.1n", 0x040001, 0x20000, CRC(6e9b7fd3) SHA1(c86ff61844fc94c02625bb812b9062d0649c8fdf) ) /* sprites B2 */ + ROM_LOAD16_BYTE( "11.1r", 0x080001, 0x20000, CRC(7fbfdf5e) SHA1(ab67b72dcadb5f2236d29de751de5bf890a9e423) ) /* sprites C2 */ + ROM_LOAD16_BYTE( "shadoww_13a.xx", 0x0c0001, 0x10000, CRC(996d2fa5) SHA1(a32526949af3635914927ebbbe684c3de9562a9d) ) /* sprites D2 */ + ROM_LOAD16_BYTE( "shadoww_13b.xx", 0x0e0001, 0x10000, CRC(b8df8a34) SHA1(6810f7961052a983b8c78b42d550038051012c6d) ) /* sprites D2 */ ROM_REGION( 0x40000, "oki", 0 ) /* 128k for ADPCM samples - sound chip is OKIM6295 */ ROM_LOAD( "4.4a", 0x0000, 0x20000, CRC(b0e0faf9) SHA1(2275d2ef5eee356ccf80b9e9644d16fc30a4d107) ) /* samples */ @@ -1141,17 +1138,17 @@ ROM_START( shadowwa ) ROM_REGION( 0x100000, "gfx4", 0 ) /* Should all these roms be 0x10000 bytes on this board? */ - ROM_LOAD( "6.3m", 0x000000, 0x20000, CRC(e7ccdf9f) SHA1(80ffcefc95660471124898a9c2bee55df36bda13) ) /* sprites A1 */ - ROM_LOAD( "8.3n", 0x020000, 0x20000, CRC(7ef7f880) SHA1(26ba9a76adce24beea3cffa1cb95aeafe6f82f96) ) /* sprites B1 */ - ROM_LOAD( "10.3r", 0x040000, 0x20000, CRC(a6451dec) SHA1(553e7a1453b59055fa0b10ca04125543d9f8987c) ) /* sprites C1 */ - ROM_LOAD( "shadoww_12a.xx", 0x060000, 0x10000, CRC(9bb07731) SHA1(b799b1958dc9b84797fdab2591e33bd5d28884a3) ) /* sprites D1 */ - ROM_LOAD( "shadoww_12b.xx", 0x070000, 0x10000, CRC(a4a950a2) SHA1(9766b5e88edd16554e59179a37cca49d29f83367) ) /* sprites D1 */ + ROM_LOAD16_BYTE( "6.3m", 0x000000, 0x20000, CRC(e7ccdf9f) SHA1(80ffcefc95660471124898a9c2bee55df36bda13) ) /* sprites A1 */ + ROM_LOAD16_BYTE( "8.3n", 0x040000, 0x20000, CRC(7ef7f880) SHA1(26ba9a76adce24beea3cffa1cb95aeafe6f82f96) ) /* sprites B1 */ + ROM_LOAD16_BYTE( "10.3r", 0x080000, 0x20000, CRC(a6451dec) SHA1(553e7a1453b59055fa0b10ca04125543d9f8987c) ) /* sprites C1 */ + ROM_LOAD16_BYTE( "shadoww_12a.xx", 0x0c0000, 0x10000, CRC(9bb07731) SHA1(b799b1958dc9b84797fdab2591e33bd5d28884a3) ) /* sprites D1 */ + ROM_LOAD16_BYTE( "shadoww_12b.xx", 0x0e0000, 0x10000, CRC(a4a950a2) SHA1(9766b5e88edd16554e59179a37cca49d29f83367) ) /* sprites D1 */ - ROM_LOAD( "7.1m", 0x080000, 0x20000, CRC(016bec95) SHA1(6a6757c52ca9a2398ea43d1af4a8d5adde6f4cd2) ) /* sprites A2 */ - ROM_LOAD( "9.1n", 0x0a0000, 0x20000, CRC(6e9b7fd3) SHA1(c86ff61844fc94c02625bb812b9062d0649c8fdf) ) /* sprites B2 */ - ROM_LOAD( "11.1r", 0x0c0000, 0x20000, CRC(7fbfdf5e) SHA1(ab67b72dcadb5f2236d29de751de5bf890a9e423) ) /* sprites C2 */ - ROM_LOAD( "shadoww_13a.xx", 0x0e0000, 0x10000, CRC(996d2fa5) SHA1(a32526949af3635914927ebbbe684c3de9562a9d) ) /* sprites D2 */ - ROM_LOAD( "shadoww_13b.xx", 0x0f0000, 0x10000, CRC(b8df8a34) SHA1(6810f7961052a983b8c78b42d550038051012c6d) ) /* sprites D2 */ + ROM_LOAD16_BYTE( "7.1m", 0x000001, 0x20000, CRC(016bec95) SHA1(6a6757c52ca9a2398ea43d1af4a8d5adde6f4cd2) ) /* sprites A2 */ + ROM_LOAD16_BYTE( "9.1n", 0x040001, 0x20000, CRC(6e9b7fd3) SHA1(c86ff61844fc94c02625bb812b9062d0649c8fdf) ) /* sprites B2 */ + ROM_LOAD16_BYTE( "11.1r", 0x080001, 0x20000, CRC(7fbfdf5e) SHA1(ab67b72dcadb5f2236d29de751de5bf890a9e423) ) /* sprites C2 */ + ROM_LOAD16_BYTE( "shadoww_13a.xx", 0x0c0001, 0x10000, CRC(996d2fa5) SHA1(a32526949af3635914927ebbbe684c3de9562a9d) ) /* sprites D2 */ + ROM_LOAD16_BYTE( "shadoww_13b.xx", 0x0e0001, 0x10000, CRC(b8df8a34) SHA1(6810f7961052a983b8c78b42d550038051012c6d) ) /* sprites D2 */ ROM_REGION( 0x40000, "oki", 0 ) /* 128k for ADPCM samples - sound chip is OKIM6295 */ ROM_LOAD( "4.4a", 0x0000, 0x20000, CRC(b0e0faf9) SHA1(2275d2ef5eee356ccf80b9e9644d16fc30a4d107) ) /* samples */ @@ -1181,15 +1178,15 @@ ROM_START( gaiden ) ROM_LOAD( "21.4b", 0x060000, 0x20000, CRC(1ac892f5) SHA1(28364266ca9d1955fb7953f5c2d6f35e114beec6) ) ROM_REGION( 0x100000, "gfx4", 0 ) - ROM_LOAD( "6.3m", 0x000000, 0x20000, CRC(e7ccdf9f) SHA1(80ffcefc95660471124898a9c2bee55df36bda13) ) /* sprites A1 */ - ROM_LOAD( "8.3n", 0x020000, 0x20000, CRC(7ef7f880) SHA1(26ba9a76adce24beea3cffa1cb95aeafe6f82f96) ) /* sprites B1 */ - ROM_LOAD( "10.3r", 0x040000, 0x20000, CRC(a6451dec) SHA1(553e7a1453b59055fa0b10ca04125543d9f8987c) ) /* sprites C1 */ - ROM_LOAD( "gaiden_12.3s", 0x060000, 0x20000, CRC(90f1e13a) SHA1(3fe9fe62aa9e92c871c791a3b11f96c9a48099a9) ) /* sprites D1 */ + ROM_LOAD16_BYTE( "6.3m", 0x000000, 0x20000, CRC(e7ccdf9f) SHA1(80ffcefc95660471124898a9c2bee55df36bda13) ) /* sprites A1 */ + ROM_LOAD16_BYTE( "8.3n", 0x040000, 0x20000, CRC(7ef7f880) SHA1(26ba9a76adce24beea3cffa1cb95aeafe6f82f96) ) /* sprites B1 */ + ROM_LOAD16_BYTE( "10.3r", 0x080000, 0x20000, CRC(a6451dec) SHA1(553e7a1453b59055fa0b10ca04125543d9f8987c) ) /* sprites C1 */ + ROM_LOAD16_BYTE( "gaiden_12.3s", 0x0c0000, 0x20000, CRC(90f1e13a) SHA1(3fe9fe62aa9e92c871c791a3b11f96c9a48099a9) ) /* sprites D1 */ - ROM_LOAD( "7.1m", 0x080000, 0x20000, CRC(016bec95) SHA1(6a6757c52ca9a2398ea43d1af4a8d5adde6f4cd2) ) /* sprites A2 */ - ROM_LOAD( "9.1n", 0x0a0000, 0x20000, CRC(6e9b7fd3) SHA1(c86ff61844fc94c02625bb812b9062d0649c8fdf) ) /* sprites B2 */ - ROM_LOAD( "11.1r", 0x0c0000, 0x20000, CRC(7fbfdf5e) SHA1(ab67b72dcadb5f2236d29de751de5bf890a9e423) ) /* sprites C2 */ - ROM_LOAD( "gaiden_13.1s", 0x0e0000, 0x20000, CRC(7d9f5c5e) SHA1(200102532ea9a88c7c708e03f8893c46dff827d1) ) /* sprites D2 */ + ROM_LOAD16_BYTE( "7.1m", 0x000001, 0x20000, CRC(016bec95) SHA1(6a6757c52ca9a2398ea43d1af4a8d5adde6f4cd2) ) /* sprites A2 */ + ROM_LOAD16_BYTE( "9.1n", 0x040001, 0x20000, CRC(6e9b7fd3) SHA1(c86ff61844fc94c02625bb812b9062d0649c8fdf) ) /* sprites B2 */ + ROM_LOAD16_BYTE( "11.1r", 0x080001, 0x20000, CRC(7fbfdf5e) SHA1(ab67b72dcadb5f2236d29de751de5bf890a9e423) ) /* sprites C2 */ + ROM_LOAD16_BYTE( "gaiden_13.1s", 0x0c0001, 0x20000, CRC(7d9f5c5e) SHA1(200102532ea9a88c7c708e03f8893c46dff827d1) ) /* sprites D2 */ ROM_REGION( 0x40000, "oki", 0 ) /* 128k for ADPCM samples - sound chip is OKIM6295 */ ROM_LOAD( "4.4a", 0x0000, 0x20000, CRC(b0e0faf9) SHA1(2275d2ef5eee356ccf80b9e9644d16fc30a4d107) ) /* samples */ @@ -1220,17 +1217,17 @@ ROM_START( ryukendn ) ROM_REGION( 0x100000, "gfx4", 0 ) /* Should all these roms be 0x10000 bytes on this board? */ - ROM_LOAD( "6.3m", 0x000000, 0x20000, CRC(e7ccdf9f) SHA1(80ffcefc95660471124898a9c2bee55df36bda13) ) /* sprites A1 */ - ROM_LOAD( "8.3n", 0x020000, 0x20000, CRC(7ef7f880) SHA1(26ba9a76adce24beea3cffa1cb95aeafe6f82f96) ) /* sprites B1 */ - ROM_LOAD( "10.3r", 0x040000, 0x20000, CRC(a6451dec) SHA1(553e7a1453b59055fa0b10ca04125543d9f8987c) ) /* sprites C1 */ - ROM_LOAD( "shadoww_12a.xx", 0x060000, 0x10000, CRC(9bb07731) SHA1(b799b1958dc9b84797fdab2591e33bd5d28884a3) ) /* sprites D1 */ - ROM_LOAD( "ryukendn_12b.xx", 0x070000, 0x10000, CRC(1773628a) SHA1(e7eacc880f2a4174f17b263bedf8c1bc64007dbd) ) /* sprites D1 */ + ROM_LOAD16_BYTE( "6.3m", 0x000000, 0x20000, CRC(e7ccdf9f) SHA1(80ffcefc95660471124898a9c2bee55df36bda13) ) /* sprites A1 */ + ROM_LOAD16_BYTE( "8.3n", 0x040000, 0x20000, CRC(7ef7f880) SHA1(26ba9a76adce24beea3cffa1cb95aeafe6f82f96) ) /* sprites B1 */ + ROM_LOAD16_BYTE( "10.3r", 0x080000, 0x20000, CRC(a6451dec) SHA1(553e7a1453b59055fa0b10ca04125543d9f8987c) ) /* sprites C1 */ + ROM_LOAD16_BYTE( "shadoww_12a.xx", 0x0c0000, 0x10000, CRC(9bb07731) SHA1(b799b1958dc9b84797fdab2591e33bd5d28884a3) ) /* sprites D1 */ + ROM_LOAD16_BYTE( "ryukendn_12b.xx", 0x0e0000, 0x10000, CRC(1773628a) SHA1(e7eacc880f2a4174f17b263bedf8c1bc64007dbd) ) /* sprites D1 */ - ROM_LOAD( "7.1m", 0x080000, 0x20000, CRC(016bec95) SHA1(6a6757c52ca9a2398ea43d1af4a8d5adde6f4cd2) ) /* sprites A2 */ - ROM_LOAD( "9.1n", 0x0a0000, 0x20000, CRC(6e9b7fd3) SHA1(c86ff61844fc94c02625bb812b9062d0649c8fdf) ) /* sprites B2 */ - ROM_LOAD( "11.1r", 0x0c0000, 0x20000, CRC(7fbfdf5e) SHA1(ab67b72dcadb5f2236d29de751de5bf890a9e423) ) /* sprites C2 */ - ROM_LOAD( "shadoww_13a.xx", 0x0e0000, 0x10000, CRC(996d2fa5) SHA1(a32526949af3635914927ebbbe684c3de9562a9d) ) /* sprites D2 */ - ROM_LOAD( "ryukendn_13b.xx", 0x0f0000, 0x10000, CRC(1f43c507) SHA1(29f655442c16677855073284c7ab41059c99c497) ) /* sprites D2 */ + ROM_LOAD16_BYTE( "7.1m", 0x000001, 0x20000, CRC(016bec95) SHA1(6a6757c52ca9a2398ea43d1af4a8d5adde6f4cd2) ) /* sprites A2 */ + ROM_LOAD16_BYTE( "9.1n", 0x040001, 0x20000, CRC(6e9b7fd3) SHA1(c86ff61844fc94c02625bb812b9062d0649c8fdf) ) /* sprites B2 */ + ROM_LOAD16_BYTE( "11.1r", 0x080001, 0x20000, CRC(7fbfdf5e) SHA1(ab67b72dcadb5f2236d29de751de5bf890a9e423) ) /* sprites C2 */ + ROM_LOAD16_BYTE( "shadoww_13a.xx", 0x0c0001, 0x10000, CRC(996d2fa5) SHA1(a32526949af3635914927ebbbe684c3de9562a9d) ) /* sprites D2 */ + ROM_LOAD16_BYTE( "ryukendn_13b.xx", 0x0e0001, 0x10000, CRC(1f43c507) SHA1(29f655442c16677855073284c7ab41059c99c497) ) /* sprites D2 */ ROM_REGION( 0x40000, "oki", 0 ) /* 128k for ADPCM samples - sound chip is OKIM6295 */ ROM_LOAD( "4.4a", 0x0000, 0x20000, CRC(b0e0faf9) SHA1(2275d2ef5eee356ccf80b9e9644d16fc30a4d107) ) /* samples */ @@ -1270,15 +1267,15 @@ ROM_START( ryukendna ) ROM_LOAD( "21.4b", 0x060000, 0x20000, CRC(1ac892f5) SHA1(28364266ca9d1955fb7953f5c2d6f35e114beec6) ) ROM_REGION( 0x100000, "gfx4", 0 ) - ROM_LOAD( "6.3m", 0x000000, 0x20000, CRC(e7ccdf9f) SHA1(80ffcefc95660471124898a9c2bee55df36bda13) ) /* sprites A1 */ - ROM_LOAD( "8.3n", 0x020000, 0x20000, CRC(7ef7f880) SHA1(26ba9a76adce24beea3cffa1cb95aeafe6f82f96) ) /* sprites B1 */ - ROM_LOAD( "10.3r", 0x040000, 0x20000, CRC(a6451dec) SHA1(553e7a1453b59055fa0b10ca04125543d9f8987c) ) /* sprites C1 */ - ROM_LOAD( "12.3s", 0x060000, 0x20000, CRC(277204f0) SHA1(918e05f10959f2b50c16b6e0dc62e3076c99250e) ) /* sprites D1 */ + ROM_LOAD16_BYTE( "6.3m", 0x000000, 0x20000, CRC(e7ccdf9f) SHA1(80ffcefc95660471124898a9c2bee55df36bda13) ) /* sprites A1 */ + ROM_LOAD16_BYTE( "8.3n", 0x040000, 0x20000, CRC(7ef7f880) SHA1(26ba9a76adce24beea3cffa1cb95aeafe6f82f96) ) /* sprites B1 */ + ROM_LOAD16_BYTE( "10.3r", 0x080000, 0x20000, CRC(a6451dec) SHA1(553e7a1453b59055fa0b10ca04125543d9f8987c) ) /* sprites C1 */ + ROM_LOAD16_BYTE( "12.3s", 0x0c0000, 0x20000, CRC(277204f0) SHA1(918e05f10959f2b50c16b6e0dc62e3076c99250e) ) /* sprites D1 */ - ROM_LOAD( "7.1m", 0x080000, 0x20000, CRC(016bec95) SHA1(6a6757c52ca9a2398ea43d1af4a8d5adde6f4cd2) ) /* sprites A2 */ - ROM_LOAD( "9.1n", 0x0a0000, 0x20000, CRC(6e9b7fd3) SHA1(c86ff61844fc94c02625bb812b9062d0649c8fdf) ) /* sprites B2 */ - ROM_LOAD( "11.1r", 0x0c0000, 0x20000, CRC(7fbfdf5e) SHA1(ab67b72dcadb5f2236d29de751de5bf890a9e423) ) /* sprites C2 */ - ROM_LOAD( "13.1s", 0x0e0000, 0x20000, CRC(4e56a508) SHA1(f89a6037e602b26d6ce11859e0b43a602b50d985) ) /* sprites D2 */ + ROM_LOAD16_BYTE( "7.1m", 0x000001, 0x20000, CRC(016bec95) SHA1(6a6757c52ca9a2398ea43d1af4a8d5adde6f4cd2) ) /* sprites A2 */ + ROM_LOAD16_BYTE( "9.1n", 0x040001, 0x20000, CRC(6e9b7fd3) SHA1(c86ff61844fc94c02625bb812b9062d0649c8fdf) ) /* sprites B2 */ + ROM_LOAD16_BYTE( "11.1r", 0x080001, 0x20000, CRC(7fbfdf5e) SHA1(ab67b72dcadb5f2236d29de751de5bf890a9e423) ) /* sprites C2 */ + ROM_LOAD16_BYTE( "13.1s", 0x0c0001, 0x20000, CRC(4e56a508) SHA1(f89a6037e602b26d6ce11859e0b43a602b50d985) ) /* sprites D2 */ ROM_REGION( 0x40000, "oki", 0 ) /* 128k for ADPCM samples - sound chip is OKIM6295 */ ROM_LOAD( "4.4a", 0x0000, 0x20000, CRC(b0e0faf9) SHA1(2275d2ef5eee356ccf80b9e9644d16fc30a4d107) ) /* samples */ @@ -1366,8 +1363,8 @@ ROM_START( wildfang ) /* Dipswitch selectable title of Wild Fang or Tecmo Knight ROM_LOAD( "tkni6.bin", 0x000000, 0x80000, CRC(f68fafb1) SHA1(aeca38eaea2f6dfc484e48ac1114c0c4abaafb9c) ) ROM_REGION( 0x100000, "gfx4", 0 ) - ROM_LOAD( "tkni9.bin", 0x000000, 0x80000, CRC(d22f4239) SHA1(360a9a821faabe911eef407ef85452d8b706538f) ) /* sprites */ - ROM_LOAD( "tkni8.bin", 0x080000, 0x80000, CRC(4931b184) SHA1(864e827ac109c0ee52a898034c021cd5e92ff000) ) /* sprites */ + ROM_LOAD16_BYTE( "tkni9.bin", 0x000000, 0x80000, CRC(d22f4239) SHA1(360a9a821faabe911eef407ef85452d8b706538f) ) /* sprites */ + ROM_LOAD16_BYTE( "tkni8.bin", 0x000001, 0x80000, CRC(4931b184) SHA1(864e827ac109c0ee52a898034c021cd5e92ff000) ) /* sprites */ ROM_REGION( 0x40000, "oki", 0 ) /* 128k for ADPCM samples - sound chip is OKIM6295 */ ROM_LOAD( "tkni4.bin", 0x0000, 0x20000, CRC(a7a1dbcf) SHA1(2fee1d9745ce2ab54b0b9cbb6ab2e66ba9677245) ) /* samples */ @@ -1397,8 +1394,8 @@ ROM_START( wildfangs ) /* Wild Fang - No title change option */ ROM_LOAD( "tkni6.bin", 0x000000, 0x80000, CRC(f68fafb1) SHA1(aeca38eaea2f6dfc484e48ac1114c0c4abaafb9c) ) ROM_REGION( 0x100000, "gfx4", 0 ) - ROM_LOAD( "tkni9.bin", 0x000000, 0x80000, CRC(d22f4239) SHA1(360a9a821faabe911eef407ef85452d8b706538f) ) /* sprites */ - ROM_LOAD( "tkni8.bin", 0x080000, 0x80000, CRC(4931b184) SHA1(864e827ac109c0ee52a898034c021cd5e92ff000) ) /* sprites */ + ROM_LOAD16_BYTE( "tkni9.bin", 0x000000, 0x80000, CRC(d22f4239) SHA1(360a9a821faabe911eef407ef85452d8b706538f) ) /* sprites */ + ROM_LOAD16_BYTE( "tkni8.bin", 0x000001, 0x80000, CRC(4931b184) SHA1(864e827ac109c0ee52a898034c021cd5e92ff000) ) /* sprites */ ROM_REGION( 0x40000, "oki", 0 ) /* 128k for ADPCM samples - sound chip is OKIM6295 */ ROM_LOAD( "tkni4.bin", 0x0000, 0x20000, CRC(a7a1dbcf) SHA1(2fee1d9745ce2ab54b0b9cbb6ab2e66ba9677245) ) /* samples */ @@ -1425,8 +1422,8 @@ ROM_START( tknight ) /* Tecmo Knight - No title change option */ ROM_LOAD( "tkni6.bin", 0x000000, 0x80000, CRC(f68fafb1) SHA1(aeca38eaea2f6dfc484e48ac1114c0c4abaafb9c) ) ROM_REGION( 0x100000, "gfx4", 0 ) - ROM_LOAD( "tkni9.bin", 0x000000, 0x80000, CRC(d22f4239) SHA1(360a9a821faabe911eef407ef85452d8b706538f) ) /* sprites */ - ROM_LOAD( "tkni8.bin", 0x080000, 0x80000, CRC(4931b184) SHA1(864e827ac109c0ee52a898034c021cd5e92ff000) ) /* sprites */ + ROM_LOAD16_BYTE( "tkni9.bin", 0x000000, 0x80000, CRC(d22f4239) SHA1(360a9a821faabe911eef407ef85452d8b706538f) ) /* sprites */ + ROM_LOAD16_BYTE( "tkni8.bin", 0x000001, 0x80000, CRC(4931b184) SHA1(864e827ac109c0ee52a898034c021cd5e92ff000) ) /* sprites */ ROM_REGION( 0x40000, "oki", 0 ) /* 128k for ADPCM samples - sound chip is OKIM6295 */ ROM_LOAD( "tkni4.bin", 0x0000, 0x20000, CRC(a7a1dbcf) SHA1(2fee1d9745ce2ab54b0b9cbb6ab2e66ba9677245) ) /* samples */ @@ -1453,8 +1450,8 @@ ROM_START( stratof ) ROM_LOAD( "b-4b", 0x00000, 0x80000, CRC(89468b84) SHA1(af60fe957c98fa3f00623d420a0941a941f5bc6b) ) ROM_REGION( 0x100000, "gfx4", 0 ) - ROM_LOAD( "b-2m", 0x00000, 0x80000, CRC(5794ec32) SHA1(07e78d8bcb2373da77ef9f8cde6a01f384f8bf7e) ) - ROM_LOAD( "b-1m", 0x80000, 0x80000, CRC(b0de0ded) SHA1(45c74d0c58e3e73c79e587722d9fea9f7ba9cb0a) ) + ROM_LOAD16_BYTE( "b-2m", 0x00000, 0x80000, CRC(5794ec32) SHA1(07e78d8bcb2373da77ef9f8cde6a01f384f8bf7e) ) + ROM_LOAD16_BYTE( "b-1m", 0x00001, 0x80000, CRC(b0de0ded) SHA1(45c74d0c58e3e73c79e587722d9fea9f7ba9cb0a) ) ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "a-4a.4", 0x00000, 0x20000, CRC(ef9acdcf) SHA1(8d62a666843f0cb22e8926ae18a961052d4f9ed5) ) @@ -1481,8 +1478,8 @@ ROM_START( raiga ) ROM_LOAD( "b-4b", 0x00000, 0x80000, CRC(89468b84) SHA1(af60fe957c98fa3f00623d420a0941a941f5bc6b) ) ROM_REGION( 0x100000, "gfx4", 0 ) - ROM_LOAD( "b-2m", 0x00000, 0x80000, CRC(5794ec32) SHA1(07e78d8bcb2373da77ef9f8cde6a01f384f8bf7e) ) - ROM_LOAD( "b-1m", 0x80000, 0x80000, CRC(b0de0ded) SHA1(45c74d0c58e3e73c79e587722d9fea9f7ba9cb0a) ) + ROM_LOAD16_BYTE( "b-2m", 0x00000, 0x80000, CRC(5794ec32) SHA1(07e78d8bcb2373da77ef9f8cde6a01f384f8bf7e) ) + ROM_LOAD16_BYTE( "b-1m", 0x00001, 0x80000, CRC(b0de0ded) SHA1(45c74d0c58e3e73c79e587722d9fea9f7ba9cb0a) ) ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "a-4a.4", 0x00000, 0x20000, CRC(ef9acdcf) SHA1(8d62a666843f0cb22e8926ae18a961052d4f9ed5) ) diff --git a/src/mame/drivers/spbactn.cpp b/src/mame/drivers/spbactn.cpp index f6a0fa0a961..a7d0aa95bc5 100644 --- a/src/mame/drivers/spbactn.cpp +++ b/src/mame/drivers/spbactn.cpp @@ -365,9 +365,9 @@ static const gfx_layout spritelayout = }; static GFXDECODE_START( gfx_spbactn ) - GFXDECODE_ENTRY( "gfx1", 0, fgtilelayout, 0x0200, 16 + 240 ) - GFXDECODE_ENTRY( "gfx2", 0, bgtilelayout, 0x0300, 16 + 128 ) - GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0x0000, 0x1000 ) + GFXDECODE_ENTRY( "gfx1", 0, fgtilelayout, 0x0200, 16 + 240 ) + GFXDECODE_ENTRY( "gfx2", 0, bgtilelayout, 0x0300, 16 + 128 ) + GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0x0000, 0x100 ) GFXDECODE_END @@ -437,12 +437,13 @@ MACHINE_CONFIG_START(spbactn_state::spbactn) MCFG_DEVICE_ADD("spritegen", TECMO_SPRITE, 0) MCFG_TECMO_SPRITE_GFX_REGION(2) - MCFG_DEVICE_ADD("mixer", TECMO_MIXER, 0) - MCFG_TECMO_MIXER_SHIFTS(8,10,4) - MCFG_TECMO_MIXER_BLENDCOLS( 0x0000 + 0x300, 0x0000 + 0x200, 0x0000 + 0x100, 0x0000 + 0x000 ) - MCFG_TECMO_MIXER_REGULARCOLS( 0x0800 + 0x300, 0x0800 + 0x200, 0x0800 + 0x100, 0x0800 + 0x000 ) - MCFG_TECMO_MIXER_BLENDSOURCE( 0x1000 + 0x000, 0x1000 + 0x100) - MCFG_TECMO_MIXER_BGPEN(0x800 + 0x300) + + TECMO_MIXER(config, m_mixer, 0); + m_mixer->set_mixer_shifts(8,10,4); + m_mixer->set_blendcols( 0x0000 + 0x300, 0x0000 + 0x200, 0x0000 + 0x100, 0x0000 + 0x000 ); + m_mixer->set_regularcols( 0x0800 + 0x300, 0x0800 + 0x200, 0x0800 + 0x100, 0x0800 + 0x000 ); + m_mixer->set_blendsource( 0x1000 + 0x000, 0x1000 + 0x100); + m_mixer->set_bgpen(0x800 + 0x300, 0x000 + 0x300); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -491,12 +492,13 @@ MACHINE_CONFIG_START(spbactn_state::spbactnp) MCFG_DEVICE_ADD("spritegen", TECMO_SPRITE, 0) MCFG_TECMO_SPRITE_GFX_REGION(2) - MCFG_DEVICE_ADD("mixer", TECMO_MIXER, 0) - MCFG_TECMO_MIXER_SHIFTS(12,14,8) - MCFG_TECMO_MIXER_BLENDCOLS( 0x0000 + 0x300, 0x0000 + 0x200, 0x0000 + 0x100, 0x0000 + 0x000 ) - MCFG_TECMO_MIXER_REGULARCOLS( 0x0800 + 0x300, 0x0800 + 0x200, 0x0800 + 0x100, 0x0800 + 0x000 ) - MCFG_TECMO_MIXER_BLENDSOURCE( 0x1000 + 0x000, 0x1000 + 0x100) - MCFG_TECMO_MIXER_BGPEN(0x800 + 0x300) + + TECMO_MIXER(config, m_mixer, 0); + m_mixer->set_mixer_shifts(12,14,8); + m_mixer->set_blendcols( 0x0000 + 0x300, 0x0000 + 0x200, 0x0000 + 0x100, 0x0000 + 0x000 ); + m_mixer->set_regularcols( 0x0800 + 0x300, 0x0800 + 0x200, 0x0800 + 0x100, 0x0800 + 0x000 ); + m_mixer->set_blendsource( 0x1000 + 0x000, 0x1000 + 0x100); + m_mixer->set_bgpen(0x800 + 0x300, 0x000 + 0x300); /* sound hardware - different? */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/tecmo16.cpp b/src/mame/drivers/tecmo16.cpp index 969d7690f33..9e2682cd4b9 100644 --- a/src/mame/drivers/tecmo16.cpp +++ b/src/mame/drivers/tecmo16.cpp @@ -13,7 +13,11 @@ driver by Hau, Nicola Salmoria special thanks to Nekomata, NTD & code-name'Siberia' TODO: -- wrong background in fstarfrc title (Video ref. -> https://www.youtube.com/watch?v=EXBTNk-0ejk) +- wrong background in fstarfrc title + (Video ref. -> + https://www.youtube.com/watch?v=EXBTNk-0ejk, + https://www.youtube.com/watch?v=5iZtgWqUz6c, + https://www.youtube.com/watch?v=cgj81VA7j_Y) - there could be some priorities problems in riot (more noticeable in level 2) @@ -55,6 +59,7 @@ void tecmo16_state::fstarfrc_map(address_map &map) map(0x150030, 0x150031).portr("DSW2").nopw(); /* ??? */ map(0x150040, 0x150041).portr("DSW1"); map(0x150050, 0x150051).portr("P1_P2"); +// map(0x160000, 0x160001).nopr(); /* ??? Read at every scene changes */ map(0x160000, 0x160001).w(FUNC(tecmo16_state::scroll_char_x_w)); map(0x16000c, 0x16000d).w(FUNC(tecmo16_state::scroll_x_w)); map(0x160012, 0x160013).w(FUNC(tecmo16_state::scroll_y_w)); @@ -319,42 +324,29 @@ INPUT_PORTS_END static const gfx_layout charlayout = { 8,8, /* 8*8 characters */ - 4096, /* 4096 characters */ + RGN_FRAC(1,1), /* 4096 characters */ 4, /* 4 bits per pixel */ - { 0, 1, 2, 3 }, /* the bitplanes are packed in one nibble */ - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 /* every char takes 32 consecutive bytes */ + { STEP4(0,1) }, /* the bitplanes are packed in one nibble */ + { STEP8(0,4) }, + { STEP8(0,4*8) }, + 4*8*8 /* every char takes 32 consecutive bytes */ }; static const gfx_layout tilelayout = { 16,16, /* 16*16 tiles */ - 8192, /* 8192 tiles */ + RGN_FRAC(1,1), /* 8192 tiles */ 4, /* 4 bits per pixel */ - { 0, 1, 2, 3 }, /* the bitplanes are packed in one nibble */ - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, - 32*8+0*4, 32*8+1*4, 32*8+2*4, 32*8+3*4, 32*8+4*4, 32*8+5*4, 32*8+6*4, 32*8+7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, - 16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32 }, - 128*8 /* every sprite takes 128 consecutive bytes */ -}; - -static const gfx_layout spritelayout = -{ - 8,8, /* 8*8 sprites */ - 32768, /* 32768 sprites */ - 4, /* 4 bits per pixel */ - { 0, 1, 2, 3 }, /* the bitplanes are packed in one nibble */ - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 32*8 /* every sprite takes 32 consecutive bytes */ + { STEP4(0,1) }, /* the bitplanes are packed in one nibble */ + { STEP8(0,4), STEP8(4*8*8,4) }, + { STEP8(0,4*8), STEP8(4*8*8*2,4*8) }, + 4*8*8*2*2 /* every tile takes 128 consecutive bytes */ }; static GFXDECODE_START( gfx_tecmo16 ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 1*16*16, 16 ) - GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0, 0x1000 ) - GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0, 0x1000 ) + GFXDECODE_ENTRY( "gfx1", 0, charlayout, 1*16*16, 16 ) + GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0, 0x100 ) + GFXDECODE_ENTRY( "gfx3", 0, charlayout, 0, 0x100 ) GFXDECODE_END /******************************************************************************/ @@ -375,12 +367,15 @@ MACHINE_CONFIG_START(tecmo16_state::fstarfrc) MCFG_QUANTUM_TIME(attotime::from_hz(600)) /* video hardware */ + BUFFERED_SPRITERAM16(config, m_spriteram); + MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) MCFG_SCREEN_UPDATE_DRIVER(tecmo16_state, screen_update) + MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("spriteram", buffered_spriteram16_device, vblank_copy_rising)) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tecmo16) MCFG_PALETTE_ADD_INIT_BLACK("palette", 4096) @@ -389,13 +384,13 @@ MACHINE_CONFIG_START(tecmo16_state::fstarfrc) MCFG_DEVICE_ADD("spritegen", TECMO_SPRITE, 0) MCFG_TECMO_SPRITE_GFX_REGION(2) - MCFG_DEVICE_ADD("mixer", TECMO_MIXER, 0) - MCFG_TECMO_MIXER_SHIFTS(10,9,4) - MCFG_TECMO_MIXER_BLENDCOLS( 0x0400 + 0x300, 0x0400 + 0x200, 0x0400 + 0x100, 0x0400 + 0x000 ) - MCFG_TECMO_MIXER_REGULARCOLS( 0x0000 + 0x300, 0x0000 + 0x200, 0x0000 + 0x100, 0x0000 + 0x000 ) - MCFG_TECMO_MIXER_BLENDSOURCE( 0x0800 + 0x000, 0x0800 + 0x100) // riot seems to set palettes in 0x800 + 0x200, could be more to this.. - MCFG_TECMO_MIXER_REVSPRITETILE - MCFG_TECMO_MIXER_BGPEN(0x000 + 0x300) + TECMO_MIXER(config, m_mixer, 0); + m_mixer->set_mixer_shifts(10,9,4); + m_mixer->set_blendcols( 0x0400 + 0x300, 0x0400 + 0x200, 0x0400 + 0x100, 0x0400 + 0x000 ); + m_mixer->set_regularcols( 0x0000 + 0x300, 0x0000 + 0x200, 0x0000 + 0x100, 0x0000 + 0x000 ); + m_mixer->set_blendsource( 0x0800 + 0x000, 0x0800 + 0x100); // riot seems to set palettes in 0x800 + 0x200, could be more to this.. + m_mixer->set_revspritetile(); + m_mixer->set_bgpen(0x000 + 0x300, 0x400 + 0x300); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/includes/gaiden.h b/src/mame/includes/gaiden.h index 90da74e9b24..4b15168682b 100644 --- a/src/mame/includes/gaiden.h +++ b/src/mame/includes/gaiden.h @@ -14,6 +14,7 @@ #include "machine/gen_latch.h" #include "machine/74157.h" #include "sound/msm5205.h" +#include "video/bufsprite.h" #include "video/tecmo_spr.h" #include "video/tecmo_mix.h" #include "emupal.h" @@ -54,7 +55,7 @@ public: private: /* memory pointers */ required_shared_ptr_array m_videoram; - required_shared_ptr m_spriteram; + required_device m_spriteram; optional_memory_bank m_adpcm_bank; /* video-related */ @@ -64,6 +65,7 @@ private: bitmap_ind16 m_sprite_bitmap; bitmap_ind16 m_tile_bitmap_bg; bitmap_ind16 m_tile_bitmap_fg; + bitmap_ind16 m_tile_bitmap_tx; uint16_t m_tx_scroll_x; uint16_t m_tx_scroll_y; uint16_t m_bg_scroll_x; @@ -127,7 +129,9 @@ private: DECLARE_VIDEO_START(gaiden); DECLARE_VIDEO_START(drgnbowl); DECLARE_VIDEO_START(raiga); + DECLARE_WRITE_LINE_MEMBER(screen_vblank); uint32_t screen_update_gaiden(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_raiga(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_drgnbowl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void drgnbowl_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void descramble_drgnbowl(int descramble_cpu); diff --git a/src/mame/includes/tecmo16.h b/src/mame/includes/tecmo16.h index 90421fb19f5..aad2da80a91 100644 --- a/src/mame/includes/tecmo16.h +++ b/src/mame/includes/tecmo16.h @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Hau, Nicola Salmoria +#include "video/bufsprite.h" #include "video/tecmo_spr.h" #include "video/tecmo_mix.h" #include "emupal.h" @@ -9,8 +10,8 @@ class tecmo16_state : public driver_device { public: - tecmo16_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + tecmo16_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_gfxdecode(*this, "gfxdecode"), @@ -44,7 +45,7 @@ private: required_shared_ptr m_videoram2; required_shared_ptr m_colorram2; required_shared_ptr m_charram; - required_shared_ptr m_spriteram; + required_device m_spriteram; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; @@ -52,6 +53,7 @@ private: bitmap_ind16 m_sprite_bitmap; bitmap_ind16 m_tile_bitmap_bg; bitmap_ind16 m_tile_bitmap_fg; + bitmap_ind16 m_tile_bitmap_tx; int m_flipscreen; int m_game_is_riot; uint16_t m_scroll_x_w; diff --git a/src/mame/video/gaiden.cpp b/src/mame/video/gaiden.cpp index d66dc509bf2..a0f74e8954e 100644 --- a/src/mame/video/gaiden.cpp +++ b/src/mame/video/gaiden.cpp @@ -74,6 +74,7 @@ VIDEO_START_MEMBER(gaiden_state,gaiden) /* set up tile layers */ m_screen->register_screen_bitmap(m_tile_bitmap_bg); m_screen->register_screen_bitmap(m_tile_bitmap_fg); + m_screen->register_screen_bitmap(m_tile_bitmap_tx); m_background = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(gaiden_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); m_foreground = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(gaiden_state::get_fg_tile_info_raiga),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); @@ -97,6 +98,7 @@ VIDEO_START_MEMBER(gaiden_state,raiga) /* set up tile layers */ m_screen->register_screen_bitmap(m_tile_bitmap_bg); m_screen->register_screen_bitmap(m_tile_bitmap_fg); + m_screen->register_screen_bitmap(m_tile_bitmap_tx); m_background = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(gaiden_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); m_foreground = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(gaiden_state::get_fg_tile_info_raiga),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); @@ -108,6 +110,7 @@ VIDEO_START_MEMBER(gaiden_state,raiga) /* set up sprites */ m_screen->register_screen_bitmap(m_sprite_bitmap); + } VIDEO_START_MEMBER(gaiden_state,drgnbowl) @@ -253,7 +256,7 @@ WRITE16_MEMBER(gaiden_state::tx_videoram_w) void gaiden_state::drgnbowl_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint16_t *spriteram = m_spriteram; + uint16_t const *const spriteram = m_spriteram->live(); // not buffered? int i, code, color, x, y, flipx, flipy, priority_mask; for( i = 0; i < 0x800/2; i += 4 ) @@ -295,18 +298,37 @@ uint32_t gaiden_state::screen_update_gaiden(screen_device &screen, bitmap_rgb32 { m_tile_bitmap_bg.fill(0, cliprect); m_tile_bitmap_fg.fill(0, cliprect); + m_tile_bitmap_tx.fill(0, cliprect); m_sprite_bitmap.fill(0, cliprect); bitmap.fill(0, cliprect); - m_sprgen->gaiden_draw_sprites(screen, m_gfxdecode, cliprect, m_spriteram, m_sprite_sizey, flip_screen() ? -m_spr_offset_y : m_spr_offset_y, flip_screen(), m_sprite_bitmap); + // non buffered? + m_sprgen->gaiden_draw_sprites(screen, m_gfxdecode, cliprect, m_spriteram->live(), m_sprite_sizey, flip_screen() ? -m_spr_offset_y : m_spr_offset_y, flip_screen(), m_sprite_bitmap); m_background->draw(screen, m_tile_bitmap_bg, cliprect, 0, 0); m_foreground->draw(screen, m_tile_bitmap_fg, cliprect, 0, 0); + m_text_layer->draw(screen, m_tile_bitmap_tx, cliprect, 0, 0); - m_mixer->mix_bitmaps(screen, bitmap, cliprect, *m_palette, &m_tile_bitmap_bg, &m_tile_bitmap_fg, (bitmap_ind16*)nullptr, &m_sprite_bitmap); + m_mixer->mix_bitmaps(screen, bitmap, cliprect, *m_palette, &m_tile_bitmap_bg, &m_tile_bitmap_fg, &m_tile_bitmap_tx, &m_sprite_bitmap); - // todo, this should go through the mixer! - m_text_layer->draw(screen, bitmap, cliprect, 0, 0); + return 0; +} +uint32_t gaiden_state::screen_update_raiga(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + m_tile_bitmap_bg.fill(0, cliprect); + m_tile_bitmap_fg.fill(0, cliprect); + m_tile_bitmap_tx.fill(0, cliprect); + bitmap.fill(0, cliprect); + + m_background->draw(screen, m_tile_bitmap_bg, cliprect, 0, 0); + m_foreground->draw(screen, m_tile_bitmap_fg, cliprect, 0, 0); + m_text_layer->draw(screen, m_tile_bitmap_tx, cliprect, 0, 0); + + m_mixer->mix_bitmaps(screen, bitmap, cliprect, *m_palette, &m_tile_bitmap_bg, &m_tile_bitmap_fg, &m_tile_bitmap_tx, &m_sprite_bitmap); + + // raiga sprite has 2 frame lags + m_sprite_bitmap.fill(0, cliprect); + m_sprgen->gaiden_draw_sprites(screen, m_gfxdecode, cliprect, m_spriteram->buffer(), m_sprite_sizey, flip_screen() ? -m_spr_offset_y : m_spr_offset_y, flip_screen(), m_sprite_bitmap); return 0; } diff --git a/src/mame/video/tecmo16.cpp b/src/mame/video/tecmo16.cpp index e256f9b1fc2..dbd5da59a7d 100644 --- a/src/mame/video/tecmo16.cpp +++ b/src/mame/video/tecmo16.cpp @@ -69,6 +69,7 @@ void tecmo16_state::video_start() /* set up tile layers */ m_screen->register_screen_bitmap(m_tile_bitmap_bg); m_screen->register_screen_bitmap(m_tile_bitmap_fg); + m_screen->register_screen_bitmap(m_tile_bitmap_tx); /* set up sprites */ m_screen->register_screen_bitmap(m_sprite_bitmap); @@ -93,6 +94,7 @@ VIDEO_START_MEMBER(tecmo16_state,ginkun) /* set up tile layers */ m_screen->register_screen_bitmap(m_tile_bitmap_bg); m_screen->register_screen_bitmap(m_tile_bitmap_fg); + m_screen->register_screen_bitmap(m_tile_bitmap_tx); /* set up sprites */ m_screen->register_screen_bitmap(m_sprite_bitmap); @@ -115,6 +117,7 @@ VIDEO_START_MEMBER(tecmo16_state,riot) /* set up tile layers */ m_screen->register_screen_bitmap(m_tile_bitmap_bg); m_screen->register_screen_bitmap(m_tile_bitmap_fg); + m_screen->register_screen_bitmap(m_tile_bitmap_tx); /* set up sprites */ m_screen->register_screen_bitmap(m_sprite_bitmap); @@ -219,20 +222,19 @@ uint32_t tecmo16_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma { m_tile_bitmap_bg.fill(0, cliprect); m_tile_bitmap_fg.fill(0, cliprect); - m_sprite_bitmap.fill(0, cliprect); + m_tile_bitmap_tx.fill(0, cliprect); bitmap.fill(0, cliprect); - if (m_game_is_riot) m_sprgen->gaiden_draw_sprites(screen, m_gfxdecode, cliprect, m_spriteram, 0, 0, flip_screen(), m_sprite_bitmap); - else m_sprgen->gaiden_draw_sprites(screen, m_gfxdecode, cliprect, m_spriteram, 2, 0, flip_screen(), m_sprite_bitmap); - m_bg_tilemap->draw(screen, m_tile_bitmap_bg, cliprect, 0, 0); m_fg_tilemap->draw(screen, m_tile_bitmap_fg, cliprect, 0, 0); + m_tx_tilemap->draw(screen, m_tile_bitmap_tx, cliprect, 0, 0); - m_mixer->mix_bitmaps(screen, bitmap, cliprect, *m_palette, &m_tile_bitmap_bg, &m_tile_bitmap_fg, (bitmap_ind16*)nullptr, &m_sprite_bitmap); - - // todo, this should go through the mixer! - m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); + m_mixer->mix_bitmaps(screen, bitmap, cliprect, *m_palette, &m_tile_bitmap_bg, &m_tile_bitmap_fg, &m_tile_bitmap_tx, &m_sprite_bitmap); + // 2 frame sprite lags + m_sprite_bitmap.fill(0, cliprect); + if (m_game_is_riot) m_sprgen->gaiden_draw_sprites(screen, m_gfxdecode, cliprect, m_spriteram->buffer(), 0, 0, flip_screen(), m_sprite_bitmap); + else m_sprgen->gaiden_draw_sprites(screen, m_gfxdecode, cliprect, m_spriteram->buffer(), 2, 0, flip_screen(), m_sprite_bitmap); return 0; } diff --git a/src/mame/video/tecmo_mix.cpp b/src/mame/video/tecmo_mix.cpp index e89423232c2..abcdbca4017 100644 --- a/src/mame/video/tecmo_mix.cpp +++ b/src/mame/video/tecmo_mix.cpp @@ -27,8 +27,10 @@ tecmo_mix_device::tecmo_mix_device(const machine_config &mconfig, const char *ta m_txregular_comp(0), m_spregular_comp(0), - m_revspritetile(0), - m_bgpen(0) + m_bgpen(0), + m_bgpen_blend(0), + + m_revspritetile(0) { } @@ -79,6 +81,9 @@ void tecmo_mix_device::mix_bitmaps(screen_device &screen, bitmap_rgb32 &bitmap, uint16_t *sd2 = &bitmap_sp->pix16(y); uint16_t *fg = &bitmap_fg->pix16(y); uint16_t *bg = &bitmap_bg->pix16(y); + uint16_t *tx = nullptr; + if (bitmap_tx != nullptr) + tx = &bitmap_tx->pix16(y); for (x = cliprect.min_x; x <= cliprect.max_x; x++) { @@ -99,11 +104,19 @@ void tecmo_mix_device::mix_bitmaps(screen_device &screen, bitmap_rgb32 &bitmap, uint16_t bgpixel = (bg[x]); bgpixel &= 0xff; + uint16_t txpixel = (bitmap_tx != nullptr) ? (tx[x]) : 0; + txpixel &= 0xff; + if (sprpixel&0xf) { if (m_sprpri == (0 ^ m_revspritetile)) // behind all { - if (fgpixel & 0xf) // is the fg used? + if (txpixel & 0xf) + { + // solid TX + dd[x] = paldata[txpixel + m_txregular_comp]; + } + else if (fgpixel & 0xf) // is the fg used? { if (fgbln) { @@ -115,7 +128,7 @@ void tecmo_mix_device::mix_bitmaps(screen_device &screen, bitmap_rgb32 &bitmap, dd[x] = paldata[fgpixel + m_fgregular_comp]; } } - else if (bgpixel & 0x0f) + else if (bgpixel & 0xf) { // solid BG dd[x] = paldata[bgpixel + m_bgregular_comp]; @@ -135,7 +148,12 @@ void tecmo_mix_device::mix_bitmaps(screen_device &screen, bitmap_rgb32 &bitmap, } else if (m_sprpri == (1 ^ m_revspritetile)) // above bg, behind tx, fg { - if (fgpixel & 0xf) // is the fg used? + if (txpixel & 0xf) + { + // solid TX + dd[x] = paldata[txpixel + m_txregular_comp]; + } + else if (fgpixel & 0xf) // is the fg used? { if (fgbln) { @@ -162,10 +180,16 @@ void tecmo_mix_device::mix_bitmaps(screen_device &screen, bitmap_rgb32 &bitmap, { if (m_sprbln) { - // needs if bgpixel & 0xf check? - - //fg isn't used, sprite is used and blended with bg? -- used on trail of ball / flippers (looks odd) -- some ninja gaiden enemy deaths (when behind fg) (looks ok?) (maybe we need to check for colour saturation?) - dd[x] = sum_colors(paldata, bgpixel + m_bgblend_comp, sprpixel + m_spblend_source); + if (bgpixel & 0xf) + { + //fg isn't used, sprite is used and blended with bg? -- used on trail of ball / flippers (looks odd) -- some ninja gaiden enemy deaths (when behind fg) (looks ok?) (maybe we need to check for colour saturation?) + dd[x] = sum_colors(paldata, bgpixel + m_bgblend_comp, sprpixel + m_spblend_source); + } + else + { + //fg isn't used, sprite is used and blended with bg? -- used on trail of ball / flippers (looks odd) -- some ninja gaiden enemy deaths (when behind fg) (looks ok?) (maybe we need to check for colour saturation?) + dd[x] = sum_colors(paldata, m_bgpen_blend, sprpixel + m_spblend_source); + } } else { @@ -175,10 +199,64 @@ void tecmo_mix_device::mix_bitmaps(screen_device &screen, bitmap_rgb32 &bitmap, } } else if (m_sprpri == (2 ^ m_revspritetile)) // above bg,fg, behind tx + { + if (txpixel & 0xf) + { + // solid TX + dd[x] = paldata[txpixel + m_txregular_comp]; + } + else + { + if (m_sprbln) + { + if (fgpixel & 0xf) // is the fg used? + { + if (fgbln) + { + // blended sprite over blended fg pixel? + dd[x] = machine().rand(); + } + else + { + // blended sprite over solid fgpixel? + dd[x] = sum_colors(paldata, fgpixel + m_fgblend_comp, sprpixel + m_spblend_source); + } + } + else if (bgpixel & 0xf) + { + // blended sprite over solid bg pixel + dd[x] = sum_colors(paldata, bgpixel + m_bgblend_comp, sprpixel + m_spblend_source); + // dd[x] = machine().rand(); + } + else + { + // blended sprite over solid bg pixel + dd[x] = sum_colors(paldata, m_bgpen_blend, sprpixel + m_spblend_source); + // dd[x] = machine().rand(); + } + } + else + { + dd[x] = paldata[sprpixel + m_spregular_comp]; + //dd[x] = machine().rand(); + // the bad tiles on the wildfang map (shown between levels) are drawn here.. why? looks like they should be transparent? + // most wildfang sprites use this and are fine, so what's going wrong? + } + } + } + + else if (m_sprpri == (3 ^ m_revspritetile)) // above all? { if (m_sprbln) { - if (fgpixel & 0xf) // is the fg used? + // unusued by this game? + //dd[x] = machine().rand(); + if (txpixel & 0xf) + { + // blended sprite over solid txpixel? + dd[x] = sum_colors(paldata, txpixel + m_txblend_comp, sprpixel + m_spblend_source); + } + else if (fgpixel & 0xf) // is the fg used? { if (fgbln) { @@ -191,28 +269,16 @@ void tecmo_mix_device::mix_bitmaps(screen_device &screen, bitmap_rgb32 &bitmap, dd[x] = sum_colors(paldata, fgpixel + m_fgblend_comp, sprpixel + m_spblend_source); } } - else // needs if bgpixel & 0xf check? + else if (bgpixel & 0xf) { // blended sprite over solid bg pixel dd[x] = sum_colors(paldata, bgpixel + m_bgblend_comp, sprpixel + m_spblend_source); - // dd[x] = machine().rand(); } - } - else - { - dd[x] = paldata[sprpixel + m_spregular_comp]; - //dd[x] = machine().rand(); - // the bad tiles on the wildfang map (shown between levels) are drawn here.. why? looks like they should be transparent? - // most wildfang sprites use this and are fine, so what's going wrong? - } - } - - else if (m_sprpri == (3 ^ m_revspritetile)) // above all? - { - if (m_sprbln) - { - // unusued by this game? - dd[x] = machine().rand(); + else + { + // blended sprite over solid bg pixel + dd[x] = sum_colors(paldata, m_bgpen_blend, sprpixel + m_spblend_source); + } } else { @@ -223,20 +289,30 @@ void tecmo_mix_device::mix_bitmaps(screen_device &screen, bitmap_rgb32 &bitmap, } else // NON SPRITE CASES { - if (fgpixel & 0x0f) + if (txpixel & 0xf) + { + // solid TX + dd[x] = paldata[txpixel + m_txregular_comp]; + } + else if (fgpixel & 0xf) { if (fgbln) { - // needs if bgpixel & 0xf check? - dd[x] = sum_colors(paldata, fgpixel + m_fgblend_source, bgpixel + m_bgblend_comp); - + if (bgpixel & 0xf) + { + dd[x] = sum_colors(paldata, fgpixel + m_fgblend_source, bgpixel + m_bgblend_comp); + } + else + { + dd[x] = sum_colors(paldata, fgpixel + m_fgblend_source, m_bgpen_blend); + } } else { dd[x] = paldata[fgpixel + m_fgregular_comp]; } } - else if (bgpixel & 0x0f) + else if (bgpixel & 0xf) { dd[x] = paldata[bgpixel + m_bgregular_comp]; } diff --git a/src/mame/video/tecmo_mix.h b/src/mame/video/tecmo_mix.h index ee0681d5a72..69b3d5ef326 100644 --- a/src/mame/video/tecmo_mix.h +++ b/src/mame/video/tecmo_mix.h @@ -40,8 +40,12 @@ public: m_spblend_source = spblend_source; m_fgblend_source = fgblend_source; } + void set_bgpen(int bgpen, int bgpen_blend) + { + m_bgpen = bgpen; + m_bgpen_blend = bgpen_blend; + } void set_revspritetile() { m_revspritetile = 3; } - void set_bgpen(int bgpen) { m_bgpen = bgpen; } protected: virtual void device_start() override; @@ -67,8 +71,10 @@ protected: int m_txregular_comp; int m_spregular_comp; - int m_revspritetile; int m_bgpen; + int m_bgpen_blend; + + int m_revspritetile; private: uint32_t sum_colors(const pen_t *pal, int c1_idx, int c2_idx); @@ -78,22 +84,4 @@ DECLARE_DEVICE_TYPE(TECMO_MIXER, tecmo_mix_device) -#define MCFG_TECMO_MIXER_SHIFTS(_sprpri_shift, _sprbln_shift, _sprcol_shift) \ - downcast(*device).set_mixer_shifts(_sprpri_shift, _sprbln_shift, _sprcol_shift); - -#define MCFG_TECMO_MIXER_BLENDCOLS(_bgblend_comp, _fgblend_comp, _txblend_comp, _spblend_comp) \ - downcast(*device).set_blendcols(_bgblend_comp, _fgblend_comp, _txblend_comp, _spblend_comp); - -#define MCFG_TECMO_MIXER_REGULARCOLS(_bgregular_comp, _fgregular_comp, _txregular_comp, _spregular_comp) \ - downcast(*device).set_regularcols(_bgregular_comp, _fgregular_comp, _txregular_comp, _spregular_comp); - -#define MCFG_TECMO_MIXER_BLENDSOURCE(_spblend_source, _fgblend_source) \ - downcast(*device).set_blendsource(_spblend_source, _fgblend_source); - -#define MCFG_TECMO_MIXER_REVSPRITETILE \ - downcast(*device).set_revspritetile(); - -#define MCFG_TECMO_MIXER_BGPEN(_bgpen) \ - downcast(*device).set_bgpen(_bgpen); - #endif // MAME_VIDEO_TECMO_MIX_H