mirror of
https://github.com/holub/mame
synced 2025-06-05 20:33:45 +03:00
split namco c169 roz chip, c123 tilemap chip and c355 sprite chip from namcos2 shared state by making them devices (#3991)
* split namco c169 roz chip from namcos2 by making it a device (nw) some reorganization still needed (eg move init stuff to config) * push on this way, old non-device code was working by chance (nw) * use std::fill instead of memset * tidy (nw) * split out the c355 sprites into a device too (nw) * this isn't used (nw) * also not used (nw) * split out c123 tilemap chip * modern here too (nw) * namco system2 sprite chip is a device, move content of machine/namcoic.h to a text file in 'etc' as it's not really code at all, and the cpp file is no longer needed * Namco System 2 ROZ is a device (so only gets created on games that have it, avoids a crash in old code in tilemap viewer) * untangle namcofl from namcos2 now that things are devices * untangle namconb1 from namcos2 * untangle gal3.cpp from namcos2 * untangle namcos2 and namcos21 - part 1 (ugly part) * untangle system2 and system21, part 2 * use c68 for c68 based games in namcos21.cpp and some cleanup / notes / reorganization / default nvrams * naming cleanups (nw) * c123 - move init to device config * c169 init -> device config * c355 init -> device config * new clones Four Trax (Japan) [ShouTime, The Dumping Union] note, one of the gfx roms in the MAME set has an 'fx2' label, it should be verified. also replaced the ROMs for the fourtraxa set, the old ones had a 0x00 fill instead of a 0xff fill but were otherwise identical, it's a weird mod of the World set that hides most of the advertising banners, replacing them with generic ones, presumably for legal reasons?
This commit is contained in:
parent
3c03e7de35
commit
49a2c27151
@ -2744,8 +2744,6 @@ files {
|
||||
MAME_DIR .. "src/mame/drivers/namcofl.cpp",
|
||||
MAME_DIR .. "src/mame/includes/namcofl.h",
|
||||
MAME_DIR .. "src/mame/video/namcofl.cpp",
|
||||
MAME_DIR .. "src/mame/machine/namcoic.cpp",
|
||||
MAME_DIR .. "src/mame/machine/namcoic.h",
|
||||
MAME_DIR .. "src/mame/drivers/namcona1.cpp",
|
||||
MAME_DIR .. "src/mame/includes/namcona1.h",
|
||||
MAME_DIR .. "src/mame/video/namcona1.cpp",
|
||||
@ -2775,6 +2773,16 @@ files {
|
||||
MAME_DIR .. "src/mame/includes/namcos2.h",
|
||||
MAME_DIR .. "src/mame/machine/namcos2.cpp",
|
||||
MAME_DIR .. "src/mame/video/namcos2.cpp",
|
||||
MAME_DIR .. "src/mame/video/namco_c169roz.cpp",
|
||||
MAME_DIR .. "src/mame/video/namco_c169roz.h",
|
||||
MAME_DIR .. "src/mame/video/namco_c355spr.cpp",
|
||||
MAME_DIR .. "src/mame/video/namco_c355spr.h",
|
||||
MAME_DIR .. "src/mame/video/namco_c123tmap.cpp",
|
||||
MAME_DIR .. "src/mame/video/namco_c123tmap.h",
|
||||
MAME_DIR .. "src/mame/video/namcos2_sprite.cpp",
|
||||
MAME_DIR .. "src/mame/video/namcos2_sprite.h",
|
||||
MAME_DIR .. "src/mame/video/namcos2_roz.cpp",
|
||||
MAME_DIR .. "src/mame/video/namcos2_roz.h",
|
||||
MAME_DIR .. "src/mame/drivers/namcos21.cpp",
|
||||
MAME_DIR .. "src/mame/includes/namcos21.h",
|
||||
MAME_DIR .. "src/mame/video/namcos21.cpp",
|
||||
|
@ -127,8 +127,6 @@ better notes (complete chip lists) for each board still needed
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/namcos2.h"
|
||||
#include "machine/namcoic.h"
|
||||
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/tms32025/tms32025.h"
|
||||
@ -136,21 +134,28 @@ better notes (complete chip lists) for each board still needed
|
||||
#include "sound/c140.h"
|
||||
#include "rendlay.h"
|
||||
#include "speaker.h"
|
||||
#include "video/namco_c355spr.h"
|
||||
|
||||
#define NAMCOS21_NUM_COLORS 0x8000
|
||||
|
||||
class gal3_state : public namcos2_shared_state
|
||||
class gal3_state : public driver_device
|
||||
{
|
||||
public:
|
||||
gal3_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
namcos2_shared_state(mconfig, type, tag) ,
|
||||
driver_device(mconfig, type, tag),
|
||||
m_c355spr(*this, "c355spr"),
|
||||
m_palette(*this, "palette"),
|
||||
m_rso_shared_ram(*this, "rso_shared_ram"),
|
||||
m_generic_paletteram_16(*this, "paletteram"),
|
||||
m_c140_16a(*this, "c140_16a"),
|
||||
m_c140_16g(*this, "c140_16g") { }
|
||||
m_c140_16g(*this, "c140_16g")
|
||||
{ }
|
||||
|
||||
void gal3(machine_config &config);
|
||||
|
||||
private:
|
||||
required_device<namco_c355spr_device> m_c355spr;
|
||||
required_device<palette_device> m_palette;
|
||||
uint16_t m_namcos21_video_enable;
|
||||
required_shared_ptr<uint16_t> m_rso_shared_ram;
|
||||
optional_shared_ptr<uint16_t> m_generic_paletteram_16;
|
||||
@ -182,12 +187,6 @@ private:
|
||||
VIDEO_START_MEMBER(gal3_state,gal3)
|
||||
{
|
||||
m_generic_paletteram_16.allocate(0x10000);
|
||||
|
||||
c355_obj_init(
|
||||
0, /* gfx bank */
|
||||
0xf, /* reverse palette mapping */
|
||||
namcos2_shared_state::c355_obj_code2tile_delegate() );
|
||||
|
||||
}
|
||||
|
||||
/* FIXME: this code has simply been copypasted from namcos21.c
|
||||
@ -228,14 +227,14 @@ uint32_t gal3_state::screen_update_gal3(screen_device &screen, bitmap_rgb32 &bit
|
||||
|
||||
for( pri=0; pri<pivot; pri++ )
|
||||
{
|
||||
c355_obj_draw(screen, bitmap, cliprect, pri);
|
||||
m_c355spr->draw(screen, bitmap, cliprect, pri);
|
||||
}
|
||||
|
||||
/* CopyVisiblePolyFrameBuffer( bitmap, cliprect,0,0x7fbf );
|
||||
|
||||
for( pri=pivot; pri<15; pri++ )
|
||||
{
|
||||
c355_obj_draw(screen, bitmap, cliprect, pri);
|
||||
m_c355spr->draw(screen, bitmap, cliprect, pri);
|
||||
}*/
|
||||
|
||||
// CPU Diag LEDs
|
||||
@ -377,14 +376,14 @@ void gal3_state::cpu_slv_map(address_map &map)
|
||||
/// AM_RANGE(0xf1440000, 0xf1440003) AM_READWRITE(pointram_data_r,pointram_data_w)
|
||||
/// AM_RANGE(0x440002, 0x47ffff) AM_WRITENOP /* (frame buffer?) */
|
||||
/// AM_RANGE(0xf1480000, 0xf14807ff) AM_READWRITE(namcos21_depthcue_r,namcos21_depthcue_w)
|
||||
map(0xf1700000, 0xf170ffff).rw(FUNC(gal3_state::c355_obj_ram_r), FUNC(gal3_state::c355_obj_ram_w)).share("objram");
|
||||
map(0xf1720000, 0xf1720007).rw(FUNC(gal3_state::c355_obj_position_r), FUNC(gal3_state::c355_obj_position_w));
|
||||
map(0xf1700000, 0xf170ffff).rw(m_c355spr, FUNC(namco_c355spr_device::spriteram_r), FUNC(namco_c355spr_device::spriteram_w)).share("objram");
|
||||
map(0xf1720000, 0xf1720007).rw(m_c355spr, FUNC(namco_c355spr_device::position_r), FUNC(namco_c355spr_device::position_w));
|
||||
map(0xf1740000, 0xf175ffff).rw(FUNC(gal3_state::paletteram32_r), FUNC(gal3_state::paletteram32_w));
|
||||
map(0xf1760000, 0xf1760003).rw(FUNC(gal3_state::namcos21_video_enable_r), FUNC(gal3_state::namcos21_video_enable_w));
|
||||
|
||||
map(0xf2200000, 0xf220ffff).ram();
|
||||
map(0xf2700000, 0xf270ffff).ram(); //AM_READWRITE16(c355_obj_ram_r,c355_obj_ram_w,0xffffffff) AM_SHARE("objram")
|
||||
map(0xf2720000, 0xf2720007).ram(); //AM_READWRITE16(c355_obj_position_r,c355_obj_position_w,0xffffffff)
|
||||
map(0xf2700000, 0xf270ffff).ram(); //AM_READWRITE16(spriteram_r,spriteram_w,0xffffffff) AM_SHARE("objram")
|
||||
map(0xf2720000, 0xf2720007).ram(); //AM_READWRITE16(position_r,position_w,0xffffffff)
|
||||
map(0xf2740000, 0xf275ffff).ram(); //AM_READWRITE(paletteram16_r,paletteram16_w) AM_SHARE("paletteram")
|
||||
map(0xf2760000, 0xf2760003).ram(); //AM_READWRITE(namcos21_video_enable_r,namcos21_video_enable_w)
|
||||
}
|
||||
@ -654,6 +653,14 @@ MACHINE_CONFIG_START(gal3_state::gal3)
|
||||
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_namcos21)
|
||||
MCFG_PALETTE_ADD("palette", NAMCOS21_NUM_COLORS)
|
||||
|
||||
NAMCO_C355SPR(config, m_c355spr, 0);
|
||||
m_c355spr->set_palette_tag("palette");
|
||||
m_c355spr->set_gfxdecode_tag("gfxdecode");
|
||||
m_c355spr->set_is_namcofl(false);
|
||||
m_c355spr->set_tile_callback(namco_c355spr_device::c355_obj_code2tile_delegate());
|
||||
m_c355spr->set_palxor(0xf); // reverse mapping
|
||||
m_c355spr->set_gfxregion(0);
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(gal3_state,gal3)
|
||||
|
||||
SPEAKER(config, "lspeaker").front_left();
|
||||
|
@ -159,7 +159,6 @@ OSC3: 48.384MHz
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/namcofl.h"
|
||||
#include "machine/namcoic.h"
|
||||
|
||||
#include "cpu/i960/i960.h"
|
||||
#include "sound/c352.h"
|
||||
@ -225,11 +224,11 @@ void namcofl_state::namcofl_mem(address_map &map)
|
||||
map(0x30300000, 0x30303fff).ram(); /* COMRAM */
|
||||
map(0x30380000, 0x303800ff).r(FUNC(namcofl_state::fl_network_r)); /* network registers */
|
||||
map(0x30400000, 0x30407fff).r(m_c116, FUNC(namco_c116_device::read)).w(FUNC(namcofl_state::namcofl_c116_w));
|
||||
map(0x30800000, 0x3080ffff).rw(FUNC(namcofl_state::c123_tilemap_videoram_r), FUNC(namcofl_state::c123_tilemap_videoram_w));
|
||||
map(0x30a00000, 0x30a0003f).rw(FUNC(namcofl_state::c123_tilemap_control_r), FUNC(namcofl_state::c123_tilemap_control_w));
|
||||
map(0x30c00000, 0x30c1ffff).rw(FUNC(namcofl_state::c169_roz_videoram_r), FUNC(namcofl_state::c169_roz_videoram_w)).share("rozvideoram");
|
||||
map(0x30d00000, 0x30d0001f).rw(FUNC(namcofl_state::c169_roz_control_r), FUNC(namcofl_state::c169_roz_control_w));
|
||||
map(0x30e00000, 0x30e1ffff).rw(FUNC(namcofl_state::c355_obj_ram_r), FUNC(namcofl_state::c355_obj_ram_w)).share("objram");
|
||||
map(0x30800000, 0x3080ffff).rw(m_c123tmap, FUNC(namco_c123tmap_device::videoram_r), FUNC(namco_c123tmap_device::videoram_w));
|
||||
map(0x30a00000, 0x30a0003f).rw(m_c123tmap, FUNC(namco_c123tmap_device::control_r), FUNC(namco_c123tmap_device::control_w));
|
||||
map(0x30c00000, 0x30c1ffff).rw(m_c169roz, FUNC(namco_c169roz_device::videoram_r), FUNC(namco_c169roz_device::videoram_w));
|
||||
map(0x30d00000, 0x30d0001f).rw(m_c169roz, FUNC(namco_c169roz_device::control_r), FUNC(namco_c169roz_device::control_w));
|
||||
map(0x30e00000, 0x30e1ffff).rw(m_c355spr, FUNC(namco_c355spr_device::spriteram_r), FUNC(namco_c355spr_device::spriteram_w)).share("objram");
|
||||
map(0x30f00000, 0x30f0000f).ram(); /* NebulaM2 code says this is int enable at 0000, int request at 0004, but doesn't do much about it */
|
||||
map(0x40000000, 0x4000005f).rw(FUNC(namcofl_state::namcofl_sysreg_r), FUNC(namcofl_state::namcofl_sysreg_w));
|
||||
map(0xfffffffc, 0xffffffff).r(FUNC(namcofl_state::fl_unk1_r));
|
||||
@ -607,6 +606,28 @@ MACHINE_CONFIG_START(namcofl_state::namcofl)
|
||||
|
||||
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_namcofl)
|
||||
|
||||
NAMCO_C169ROZ(config, m_c169roz, 0);
|
||||
m_c169roz->set_gfxdecode_tag("gfxdecode");
|
||||
m_c169roz->set_is_namcofl(true);
|
||||
m_c169roz->set_ram_words(0x20000/2);
|
||||
m_c169roz->set_tile_callback(namco_c169roz_device::c169_tilemap_delegate(&namcofl_state::RozCB, this));
|
||||
m_c169roz->set_maskregion_tag(NAMCOFL_ROTMASKREGION);
|
||||
m_c169roz->set_gfxregion(NAMCOFL_ROTGFX);
|
||||
|
||||
NAMCO_C355SPR(config, m_c355spr, 0);
|
||||
m_c355spr->set_palette_tag("palette");
|
||||
m_c355spr->set_gfxdecode_tag("gfxdecode");
|
||||
m_c355spr->set_is_namcofl(true);
|
||||
m_c355spr->set_tile_callback(namco_c355spr_device::c355_obj_code2tile_delegate(&namcofl_state::FLobjcode2tile, this));
|
||||
m_c355spr->set_palxor(0x0);
|
||||
m_c355spr->set_gfxregion(NAMCOFL_SPRITEGFX);
|
||||
|
||||
NAMCO_C123TMAP(config, m_c123tmap, 0);
|
||||
m_c123tmap->set_gfxdecode_tag("gfxdecode");
|
||||
m_c123tmap->set_tile_callback(namco_c123tmap_device::c123_tilemap_delegate(&namcofl_state::TilemapCB, this));
|
||||
m_c123tmap->set_maskregion_tag(NAMCOFL_TILEMASKREGION);
|
||||
m_c123tmap->set_gfxregion(NAMCOFL_TILEGFX);
|
||||
|
||||
NAMCO_C116(config, m_c116, 0);
|
||||
m_c116->set_palette(m_palette);
|
||||
|
||||
@ -804,13 +825,11 @@ void namcofl_state::common_init()
|
||||
void namcofl_state::init_speedrcr()
|
||||
{
|
||||
common_init();
|
||||
m_gametype = NAMCOFL_SPEED_RACER;
|
||||
}
|
||||
|
||||
void namcofl_state::init_finalapr()
|
||||
{
|
||||
common_init();
|
||||
m_gametype = NAMCOFL_FINAL_LAP_R;
|
||||
}
|
||||
|
||||
GAME( 1995, speedrcr, 0, namcofl, speedrcr, namcofl_state, init_speedrcr, ROT0, "Namco", "Speed Racer", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE )
|
||||
|
@ -272,7 +272,6 @@ GFX: Custom 145 ( 80 pin PQFP)
|
||||
*/
|
||||
#include "emu.h"
|
||||
#include "includes/namconb1.h"
|
||||
#include "machine/namcoic.h"
|
||||
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "machine/namcomcu.h"
|
||||
@ -700,10 +699,10 @@ void namconb1_state::namconb1_am(address_map &map)
|
||||
map(0x208000, 0x2fffff).ram();
|
||||
map(0x400000, 0x40001f).rw(FUNC(namconb1_state::namconb1_cpureg_r), FUNC(namconb1_state::namconb1_cpureg_w));
|
||||
map(0x580000, 0x5807ff).rw(m_eeprom, FUNC(eeprom_parallel_28xx_device::read), FUNC(eeprom_parallel_28xx_device::write));
|
||||
map(0x600000, 0x61ffff).rw(FUNC(namconb1_state::c355_obj_ram_r), FUNC(namconb1_state::c355_obj_ram_w)).share("objram");
|
||||
map(0x620000, 0x620007).rw(FUNC(namconb1_state::c355_obj_position_r), FUNC(namconb1_state::c355_obj_position_w));
|
||||
map(0x640000, 0x64ffff).rw(FUNC(namconb1_state::c123_tilemap_videoram_r), FUNC(namconb1_state::c123_tilemap_videoram_w));
|
||||
map(0x660000, 0x66003f).rw(FUNC(namconb1_state::c123_tilemap_control_r), FUNC(namconb1_state::c123_tilemap_control_w));
|
||||
map(0x600000, 0x61ffff).rw(m_c355spr, FUNC(namco_c355spr_device::spriteram_r), FUNC(namco_c355spr_device::spriteram_w)).share("objram");
|
||||
map(0x620000, 0x620007).rw(m_c355spr, FUNC(namco_c355spr_device::position_r), FUNC(namco_c355spr_device::position_w));
|
||||
map(0x640000, 0x64ffff).rw(m_c123tmap, FUNC(namco_c123tmap_device::videoram_r), FUNC(namco_c123tmap_device::videoram_w));
|
||||
map(0x660000, 0x66003f).rw(m_c123tmap, FUNC(namco_c123tmap_device::control_r), FUNC(namco_c123tmap_device::control_w));
|
||||
map(0x680000, 0x68000f).ram().share("spritebank32");
|
||||
map(0x6e0000, 0x6e001f).r(FUNC(namconb1_state::custom_key_r)).nopw();
|
||||
map(0x700000, 0x707fff).rw(m_c116, FUNC(namco_c116_device::read), FUNC(namco_c116_device::write));
|
||||
@ -717,13 +716,13 @@ void namconb1_state::namconb2_am(address_map &map)
|
||||
map(0x200000, 0x207fff).rw(FUNC(namconb1_state::share_r), FUNC(namconb1_state::share_w));
|
||||
map(0x208000, 0x2fffff).ram();
|
||||
map(0x400000, 0x4fffff).rom().region("data", 0);
|
||||
map(0x600000, 0x61ffff).rw(FUNC(namconb1_state::c355_obj_ram_r), FUNC(namconb1_state::c355_obj_ram_w)).share("objram");
|
||||
map(0x620000, 0x620007).rw(FUNC(namconb1_state::c355_obj_position_r), FUNC(namconb1_state::c355_obj_position_w));
|
||||
map(0x600000, 0x61ffff).rw(m_c355spr, FUNC(namco_c355spr_device::spriteram_r), FUNC(namco_c355spr_device::spriteram_w)).share("objram");
|
||||
map(0x620000, 0x620007).rw(m_c355spr, FUNC(namco_c355spr_device::position_r), FUNC(namco_c355spr_device::position_w));
|
||||
map(0x640000, 0x64000f).ram(); /* unknown xy offset */
|
||||
map(0x680000, 0x68ffff).rw(FUNC(namconb1_state::c123_tilemap_videoram_r), FUNC(namconb1_state::c123_tilemap_videoram_w));
|
||||
map(0x6c0000, 0x6c003f).rw(FUNC(namconb1_state::c123_tilemap_control_r), FUNC(namconb1_state::c123_tilemap_control_w));
|
||||
map(0x700000, 0x71ffff).rw(FUNC(namconb1_state::c169_roz_videoram_r), FUNC(namconb1_state::c169_roz_videoram_w)).share("rozvideoram");
|
||||
map(0x740000, 0x74001f).rw(FUNC(namconb1_state::c169_roz_control_r), FUNC(namconb1_state::c169_roz_control_w));
|
||||
map(0x680000, 0x68ffff).rw(m_c123tmap, FUNC(namco_c123tmap_device::videoram_r), FUNC(namco_c123tmap_device::videoram_w));
|
||||
map(0x6c0000, 0x6c003f).rw(m_c123tmap, FUNC(namco_c123tmap_device::control_r), FUNC(namco_c123tmap_device::control_w));
|
||||
map(0x700000, 0x71ffff).rw(m_c169roz, FUNC(namco_c169roz_device::videoram_r), FUNC(namco_c169roz_device::videoram_w));
|
||||
map(0x740000, 0x74001f).rw(m_c169roz, FUNC(namco_c169roz_device::control_r), FUNC(namco_c169roz_device::control_w));
|
||||
map(0x800000, 0x807fff).rw(m_c116, FUNC(namco_c116_device::read), FUNC(namco_c116_device::write));
|
||||
map(0x900008, 0x90000f).ram().share("spritebank32");
|
||||
map(0x940000, 0x94000f).ram().share("tilebank32");
|
||||
@ -1096,6 +1095,20 @@ MACHINE_CONFIG_START(namconb1_state::namconb1)
|
||||
MCFG_PALETTE_ADD("palette", 0x2000)
|
||||
MCFG_PALETTE_ENABLE_SHADOWS()
|
||||
|
||||
NAMCO_C355SPR(config, m_c355spr, 0);
|
||||
m_c355spr->set_palette_tag("palette");
|
||||
m_c355spr->set_gfxdecode_tag("gfxdecode");
|
||||
m_c355spr->set_is_namcofl(false);
|
||||
m_c355spr->set_tile_callback(namco_c355spr_device::c355_obj_code2tile_delegate(&namconb1_state::NB1objcode2tile, this));
|
||||
m_c355spr->set_palxor(0x0);
|
||||
m_c355spr->set_gfxregion(NAMCONB1_SPRITEGFX);
|
||||
|
||||
NAMCO_C123TMAP(config, m_c123tmap, 0);
|
||||
m_c123tmap->set_gfxdecode_tag("gfxdecode");
|
||||
m_c123tmap->set_tile_callback(namco_c123tmap_device::c123_tilemap_delegate(&namconb1_state::NB1TilemapCB, this));
|
||||
m_c123tmap->set_maskregion_tag(NAMCONB1_TILEMASKREGION);
|
||||
m_c123tmap->set_gfxregion(NAMCONB1_TILEGFX);
|
||||
|
||||
NAMCO_C116(config, m_c116, 0);
|
||||
m_c116->set_palette(m_palette);
|
||||
|
||||
@ -1119,17 +1132,37 @@ MACHINE_CONFIG_START(namconb1_state::namconb2)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(namconb1_state, screen_update_namconb2)
|
||||
|
||||
MCFG_DEVICE_REPLACE("gfxdecode", GFXDECODE, "palette", gfx_namconb2)
|
||||
|
||||
NAMCO_C169ROZ(config, m_c169roz, 0);
|
||||
m_c169roz->set_gfxdecode_tag("gfxdecode");
|
||||
m_c169roz->set_is_namcofl(false);
|
||||
m_c169roz->set_ram_words(0x20000/2);
|
||||
m_c169roz->set_maskregion_tag(NAMCONB1_ROTMASKREGION);
|
||||
m_c169roz->set_gfxregion(NAMCONB1_ROTGFX);
|
||||
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(namconb1_state::machbrkr)
|
||||
namconb2(config);
|
||||
|
||||
m_c123tmap->set_tile_callback(namco_c123tmap_device::c123_tilemap_delegate(&namconb1_state::NB2TilemapCB_machbrkr, this));
|
||||
|
||||
m_c169roz->set_tile_callback(namco_c169roz_device::c169_tilemap_delegate(&namconb1_state::NB2RozCB_machbrkr, this));
|
||||
|
||||
m_c355spr->set_tile_callback(namco_c355spr_device::c355_obj_code2tile_delegate(&namconb1_state::NB2objcode2tile_machbrkr, this));
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(namconb1_state,machbrkr)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(namconb1_state::outfxies)
|
||||
namconb2(config);
|
||||
|
||||
m_c123tmap->set_tile_callback(namco_c123tmap_device::c123_tilemap_delegate(&namconb1_state::NB2TilemapCB_outfxies, this));
|
||||
|
||||
m_c169roz->set_tile_callback(namco_c169roz_device::c169_tilemap_delegate(&namconb1_state::NB2RozCB_outfxies, this));
|
||||
|
||||
m_c355spr->set_tile_callback(namco_c355spr_device::c355_obj_code2tile_delegate(&namconb1_state::NB2objcode2tile_outfxies, this));
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(namconb1_state,outfxies)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
@ -451,7 +451,6 @@ $a00000 checks have been seen on the Final Lap boards.
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/namcos2.h"
|
||||
#include "machine/namcoic.h"
|
||||
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/m6805/m6805.h"
|
||||
@ -595,8 +594,8 @@ WRITE8_MEMBER(namcos2_state::dpram_byte_w)
|
||||
void namcos2_state::namcos2_68k_default_cpu_board_am(address_map &map)
|
||||
{
|
||||
map(0x200000, 0x3fffff).rom().region("data_rom", 0);
|
||||
map(0x400000, 0x41ffff).rw(FUNC(namcos2_state::c123_tilemap_videoram_r), FUNC(namcos2_state::c123_tilemap_videoram_w));
|
||||
map(0x420000, 0x42003f).rw(FUNC(namcos2_state::c123_tilemap_control_r), FUNC(namcos2_state::c123_tilemap_control_w));
|
||||
map(0x400000, 0x41ffff).rw(m_c123tmap, FUNC(namco_c123tmap_device::videoram_r), FUNC(namco_c123tmap_device::videoram_w));
|
||||
map(0x420000, 0x42003f).rw(m_c123tmap, FUNC(namco_c123tmap_device::control_r), FUNC(namco_c123tmap_device::control_w));
|
||||
map(0x440000, 0x44ffff).r(FUNC(namcos2_state::c116_r)).w(m_c116, FUNC(namco_c116_device::write)).umask16(0x00ff).cswidth(16);
|
||||
map(0x460000, 0x460fff).mirror(0xf000).rw(FUNC(namcos2_state::dpram_word_r), FUNC(namcos2_state::dpram_word_w));
|
||||
map(0x480000, 0x483fff).rw(m_sci, FUNC(namco_c139_device::ram_r), FUNC(namco_c139_device::ram_w));
|
||||
@ -610,7 +609,7 @@ void namcos2_state::common_default_am(address_map &map)
|
||||
namcos2_68k_default_cpu_board_am(map);
|
||||
map(0xc00000, 0xc03fff).ram().share("spriteram");
|
||||
map(0xc40000, 0xc40001).rw(FUNC(namcos2_state::gfx_ctrl_r), FUNC(namcos2_state::gfx_ctrl_w));
|
||||
map(0xc80000, 0xc9ffff).ram().w(FUNC(namcos2_state::rozram_word_w)).share("rozram");
|
||||
map(0xc80000, 0xc9ffff).ram().w(m_ns2roz, FUNC(namcos2_roz_device::rozram_word_w)).share("rozram");
|
||||
map(0xcc0000, 0xcc000f).ram().share("rozctrl");
|
||||
map(0xd00000, 0xd0000f).rw(FUNC(namcos2_state::namcos2_68k_key_r), FUNC(namcos2_state::namcos2_68k_key_w));
|
||||
}
|
||||
@ -667,7 +666,7 @@ void namcos2_state::slave_finallap_am(address_map &map)
|
||||
void namcos2_state::common_sgunner_am(address_map &map)
|
||||
{
|
||||
namcos2_68k_default_cpu_board_am(map);
|
||||
map(0x800000, 0x8141ff).rw(FUNC(namcos2_state::c355_obj_ram_r), FUNC(namcos2_state::c355_obj_ram_w));
|
||||
map(0x800000, 0x8141ff).rw(m_c355spr, FUNC(namco_c355spr_device::spriteram_r), FUNC(namco_c355spr_device::spriteram_w));
|
||||
map(0x818000, 0x818001).nopw();
|
||||
map(0xa00000, 0xa0000f).rw(FUNC(namcos2_state::namcos2_68k_key_r), FUNC(namcos2_state::namcos2_68k_key_w));
|
||||
}
|
||||
@ -695,8 +694,8 @@ void namcos2_state::common_metlhawk_am(address_map &map)
|
||||
{
|
||||
namcos2_68k_default_cpu_board_am(map);
|
||||
map(0xc00000, 0xc03fff).ram().share("spriteram");
|
||||
map(0xc40000, 0xc4ffff).rw(FUNC(namcos2_state::c169_roz_videoram_r), FUNC(namcos2_state::c169_roz_videoram_w)).share("rozvideoram");
|
||||
map(0xd00000, 0xd0001f).rw(FUNC(namcos2_state::c169_roz_control_r), FUNC(namcos2_state::c169_roz_control_w));
|
||||
map(0xc40000, 0xc4ffff).rw(m_c169roz, FUNC(namco_c169roz_device::videoram_r), FUNC(namco_c169roz_device::videoram_w));
|
||||
map(0xd00000, 0xd0001f).rw(m_c169roz, FUNC(namco_c169roz_device::control_r), FUNC(namco_c169roz_device::control_w));
|
||||
map(0xe00000, 0xe00001).rw(FUNC(namcos2_state::gfx_ctrl_r), FUNC(namcos2_state::gfx_ctrl_w)); /* ??? */
|
||||
}
|
||||
|
||||
@ -719,35 +718,59 @@ void namcos2_state::slave_metlhawk_am(address_map &map)
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
void namcos2_state::common_luckywld_am(address_map &map)
|
||||
void namcos2_state::common_suzuka8h_am(address_map &map)
|
||||
{
|
||||
namcos2_68k_default_cpu_board_am(map);
|
||||
map(0x800000, 0x8141ff).rw(FUNC(namcos2_state::c355_obj_ram_r), FUNC(namcos2_state::c355_obj_ram_w));
|
||||
map(0x800000, 0x8141ff).rw(m_c355spr, FUNC(namco_c355spr_device::spriteram_r), FUNC(namco_c355spr_device::spriteram_w));
|
||||
map(0x818000, 0x818001).noprw(); /* enable? */
|
||||
map(0x81a000, 0x81a001).nopw(); /* enable? */
|
||||
map(0x840000, 0x840001).nopr();
|
||||
map(0x900000, 0x900007).rw(FUNC(namcos2_state::c355_obj_position_r), FUNC(namcos2_state::c355_obj_position_w));
|
||||
map(0x900000, 0x900007).rw(m_c355spr, FUNC(namco_c355spr_device::position_r), FUNC(namco_c355spr_device::position_w));
|
||||
map(0xa00000, 0xa1ffff).rw(m_c45_road, FUNC(namco_c45_road_device::read), FUNC(namco_c45_road_device::write));
|
||||
map(0xc00000, 0xc0ffff).rw(FUNC(namcos2_state::c169_roz_videoram_r), FUNC(namcos2_state::c169_roz_videoram_w)).share("rozvideoram");
|
||||
map(0xd00000, 0xd0001f).rw(FUNC(namcos2_state::c169_roz_control_r), FUNC(namcos2_state::c169_roz_control_w));
|
||||
map(0xf00000, 0xf00007).rw(FUNC(namcos2_state::namcos2_68k_key_r), FUNC(namcos2_state::namcos2_68k_key_w));
|
||||
}
|
||||
|
||||
void namcos2_state::master_luckywld_am(address_map &map)
|
||||
|
||||
void namcos2_state::master_suzuka8h_am(address_map &map)
|
||||
{
|
||||
common_luckywld_am(map);
|
||||
common_suzuka8h_am(map);
|
||||
map(0x000000, 0x03ffff).rom();
|
||||
map(0x100000, 0x10ffff).bankrw(NAMCOS2_68K_MASTER_RAM);
|
||||
map(0x180000, 0x183fff).rw(FUNC(namcos2_state::namcos2_68k_eeprom_r), FUNC(namcos2_state::namcos2_68k_eeprom_w)).umask16(0x00ff);
|
||||
map(0x1c0000, 0x1fffff).m(m_master_intc, FUNC(namco_c148_device::map));
|
||||
map(0xc00000, 0xc0ffff).ram(); // is roz hardware populated?
|
||||
map(0xd00000, 0xd0001f).ram(); // is roz hardware populated?
|
||||
}
|
||||
|
||||
void namcos2_state::slave_suzuka8h_am(address_map &map)
|
||||
{
|
||||
common_suzuka8h_am(map);
|
||||
map(0x000000, 0x03ffff).rom();
|
||||
map(0x100000, 0x13ffff).bankrw(NAMCOS2_68K_SLAVE_RAM);
|
||||
map(0x1c0000, 0x1fffff).m(m_slave_intc, FUNC(namco_c148_device::map));
|
||||
map(0xc00000, 0xc0ffff).ram(); // is roz hardware populated?
|
||||
map(0xd00000, 0xd0001f).ram(); // is roz hardware populated?
|
||||
}
|
||||
|
||||
void namcos2_state::master_luckywld_am(address_map &map)
|
||||
{
|
||||
common_suzuka8h_am(map);
|
||||
map(0x000000, 0x03ffff).rom();
|
||||
map(0x100000, 0x10ffff).bankrw(NAMCOS2_68K_MASTER_RAM);
|
||||
map(0x180000, 0x183fff).rw(FUNC(namcos2_state::namcos2_68k_eeprom_r), FUNC(namcos2_state::namcos2_68k_eeprom_w)).umask16(0x00ff);
|
||||
map(0x1c0000, 0x1fffff).m(m_master_intc, FUNC(namco_c148_device::map));
|
||||
map(0xc00000, 0xc0ffff).rw(m_c169roz, FUNC(namco_c169roz_device::videoram_r), FUNC(namco_c169roz_device::videoram_w));
|
||||
map(0xd00000, 0xd0001f).rw(m_c169roz, FUNC(namco_c169roz_device::control_r), FUNC(namco_c169roz_device::control_w));
|
||||
}
|
||||
|
||||
void namcos2_state::slave_luckywld_am(address_map &map)
|
||||
{
|
||||
common_luckywld_am(map);
|
||||
common_suzuka8h_am(map);
|
||||
map(0x000000, 0x03ffff).rom();
|
||||
map(0x100000, 0x13ffff).bankrw(NAMCOS2_68K_SLAVE_RAM);
|
||||
map(0x1c0000, 0x1fffff).m(m_slave_intc, FUNC(namco_c148_device::map));
|
||||
map(0xc00000, 0xc0ffff).rw(m_c169roz, FUNC(namco_c169roz_device::videoram_r), FUNC(namco_c169roz_device::videoram_w));
|
||||
map(0xd00000, 0xd0001f).rw(m_c169roz, FUNC(namco_c169roz_device::control_r), FUNC(namco_c169roz_device::control_w));
|
||||
}
|
||||
|
||||
/*************************************************************/
|
||||
@ -1690,6 +1713,15 @@ TIMER_DEVICE_CALLBACK_MEMBER(namcos2_state::screen_scanline)
|
||||
}
|
||||
}
|
||||
|
||||
void namcos2_state::configure_c123tmap_standard(machine_config &config)
|
||||
{
|
||||
NAMCO_C123TMAP(config, m_c123tmap, 0);
|
||||
m_c123tmap->set_gfxdecode_tag("gfxdecode");
|
||||
m_c123tmap->set_tile_callback(namco_c123tmap_device::c123_tilemap_delegate(&namcos2_state::TilemapCB, this));
|
||||
m_c123tmap->set_maskregion_tag("gfx4");
|
||||
m_c123tmap->set_gfxregion(2);
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_START(namcos2_state::base_noio)
|
||||
MCFG_DEVICE_ADD("maincpu", M68000, M68K_CPU_CLOCK) /* 12.288MHz (49.152MHz OSC/4) */
|
||||
MCFG_DEVICE_PROGRAM_MAP(master_default_am)
|
||||
@ -1700,8 +1732,8 @@ MACHINE_CONFIG_START(namcos2_state::base_noio)
|
||||
|
||||
MCFG_DEVICE_ADD("audiocpu", MC6809E, M68B09_CPU_CLOCK) /* 2.048MHz (49.152MHz OSC/24) - Sound handling */
|
||||
MCFG_DEVICE_PROGRAM_MAP(sound_default_am)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_shared_state, irq0_line_hold, 2*60)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_shared_state, irq1_line_hold, 120)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_state, irq0_line_hold, 2*60)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_state, irq1_line_hold, 120)
|
||||
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(12000)) /* CPU slices per frame */
|
||||
|
||||
@ -1719,6 +1751,19 @@ MACHINE_CONFIG_START(namcos2_state::base_noio)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(namcos2_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
configure_c123tmap_standard(config);
|
||||
|
||||
NAMCOS2_SPRITE(config, m_ns2sprite, 0);
|
||||
m_ns2sprite->set_palette_tag("palette");
|
||||
m_ns2sprite->set_gfxdecode_tag("gfxdecode");
|
||||
m_ns2sprite->set_spriteram_tag("spriteram");
|
||||
|
||||
NAMCOS2_ROZ(config, m_ns2roz, 0);
|
||||
m_ns2roz->set_palette_tag("palette");
|
||||
m_ns2roz->set_gfxdecode_tag("gfxdecode");
|
||||
m_ns2roz->set_rozram_tag("rozram");
|
||||
m_ns2roz->set_rozctrl_tag("rozctrl");
|
||||
|
||||
configure_c116_standard(config);
|
||||
|
||||
MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, "palette", gfx_namcos2)
|
||||
@ -1785,8 +1830,8 @@ MACHINE_CONFIG_START(namcos2_state::gollygho)
|
||||
|
||||
MCFG_DEVICE_ADD("audiocpu", MC6809E, M68B09_CPU_CLOCK) /* 2.048MHz (49.152MHz OSC/24) - Sound handling */
|
||||
MCFG_DEVICE_PROGRAM_MAP(sound_default_am)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_shared_state, irq0_line_hold, 2*60)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_shared_state, irq1_line_hold, 120)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_state, irq0_line_hold, 2*60)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_state, irq1_line_hold, 120)
|
||||
|
||||
configure_c65_standard(config);
|
||||
|
||||
@ -1808,6 +1853,19 @@ MACHINE_CONFIG_START(namcos2_state::gollygho)
|
||||
|
||||
MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, "palette", gfx_namcos2)
|
||||
|
||||
configure_c123tmap_standard(config);
|
||||
|
||||
NAMCOS2_SPRITE(config, m_ns2sprite, 0);
|
||||
m_ns2sprite->set_palette_tag("palette");
|
||||
m_ns2sprite->set_gfxdecode_tag("gfxdecode");
|
||||
m_ns2sprite->set_spriteram_tag("spriteram");
|
||||
|
||||
NAMCOS2_ROZ(config, m_ns2roz, 0);
|
||||
m_ns2roz->set_palette_tag("palette");
|
||||
m_ns2roz->set_gfxdecode_tag("gfxdecode");
|
||||
m_ns2roz->set_rozram_tag("rozram");
|
||||
m_ns2roz->set_rozctrl_tag("rozctrl");
|
||||
|
||||
configure_c116_standard(config);
|
||||
|
||||
SPEAKER(config, "lspeaker").front_left();
|
||||
@ -1835,8 +1893,8 @@ MACHINE_CONFIG_START(namcos2_state::finallap_noio)
|
||||
|
||||
MCFG_DEVICE_ADD("audiocpu", MC6809E, M68B09_CPU_CLOCK) /* 2.048MHz (49.152MHz OSC/24) - Sound handling */
|
||||
MCFG_DEVICE_PROGRAM_MAP(sound_default_am)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_shared_state, irq0_line_hold, 2*60)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_shared_state, irq1_line_hold, 120)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_state, irq0_line_hold, 2*60)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_state, irq1_line_hold, 120)
|
||||
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* CPU slices per frame */
|
||||
|
||||
@ -1856,6 +1914,13 @@ MACHINE_CONFIG_START(namcos2_state::finallap_noio)
|
||||
|
||||
MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, "palette", gfx_finallap)
|
||||
|
||||
configure_c123tmap_standard(config);
|
||||
|
||||
NAMCOS2_SPRITE(config, m_ns2sprite, 0);
|
||||
m_ns2sprite->set_palette_tag("palette");
|
||||
m_ns2sprite->set_gfxdecode_tag("gfxdecode");
|
||||
m_ns2sprite->set_spriteram_tag("spriteram");
|
||||
|
||||
configure_c116_standard(config);
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(namcos2_state, finallap)
|
||||
@ -1890,6 +1955,9 @@ MACHINE_CONFIG_END
|
||||
// finalap2 has different mangle
|
||||
MACHINE_CONFIG_START(namcos2_state::finalap2)
|
||||
finallap(config);
|
||||
|
||||
m_c123tmap->set_tile_callback(namco_c123tmap_device::c123_tilemap_delegate(&namcos2_state::TilemapCB_finalap2, this));
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(namcos2_state, finalap2)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
@ -1909,8 +1977,8 @@ MACHINE_CONFIG_START(namcos2_state::sgunner)
|
||||
|
||||
MCFG_DEVICE_ADD("audiocpu", MC6809E, M68B09_CPU_CLOCK) /* 2.048MHz (49.152MHz OSC/24) - Sound handling */
|
||||
MCFG_DEVICE_PROGRAM_MAP(sound_default_am)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_shared_state, irq0_line_hold, 2*60)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_shared_state, irq1_line_hold, 120)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_state, irq0_line_hold, 2*60)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_state, irq1_line_hold, 120)
|
||||
|
||||
configure_c65_standard(config);
|
||||
|
||||
@ -1932,6 +2000,16 @@ MACHINE_CONFIG_START(namcos2_state::sgunner)
|
||||
|
||||
MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, "palette", gfx_sgunner)
|
||||
|
||||
NAMCO_C355SPR(config, m_c355spr, 0);
|
||||
m_c355spr->set_palette_tag("palette");
|
||||
m_c355spr->set_gfxdecode_tag("gfxdecode");
|
||||
m_c355spr->set_is_namcofl(false);
|
||||
m_c355spr->set_tile_callback(namco_c355spr_device::c355_obj_code2tile_delegate());
|
||||
m_c355spr->set_palxor(0x0);
|
||||
m_c355spr->set_gfxregion(0);
|
||||
|
||||
configure_c123tmap_standard(config);
|
||||
|
||||
configure_c116_standard(config);
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(namcos2_state, sgunner)
|
||||
@ -1959,8 +2037,8 @@ MACHINE_CONFIG_START(namcos2_state::sgunner2)
|
||||
|
||||
MCFG_DEVICE_ADD("audiocpu", MC6809E, M68B09_CPU_CLOCK) /* 2.048MHz (49.152MHz OSC/24) - Sound handling */
|
||||
MCFG_DEVICE_PROGRAM_MAP(sound_default_am)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_shared_state, irq0_line_hold, 2*60)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_shared_state, irq1_line_hold, 120)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_state, irq0_line_hold, 2*60)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_state, irq1_line_hold, 120)
|
||||
|
||||
configure_c68_standard(config);
|
||||
|
||||
@ -1982,6 +2060,16 @@ MACHINE_CONFIG_START(namcos2_state::sgunner2)
|
||||
|
||||
MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, "palette", gfx_sgunner)
|
||||
|
||||
NAMCO_C355SPR(config, m_c355spr, 0);
|
||||
m_c355spr->set_palette_tag("palette");
|
||||
m_c355spr->set_gfxdecode_tag("gfxdecode");
|
||||
m_c355spr->set_is_namcofl(false);
|
||||
m_c355spr->set_tile_callback(namco_c355spr_device::c355_obj_code2tile_delegate());
|
||||
m_c355spr->set_palxor(0x0);
|
||||
m_c355spr->set_gfxregion(0);
|
||||
|
||||
configure_c123tmap_standard(config);
|
||||
|
||||
configure_c116_standard(config);
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(namcos2_state, sgunner)
|
||||
@ -1999,18 +2087,18 @@ MACHINE_CONFIG_START(namcos2_state::sgunner2)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(namcos2_state::luckywld)
|
||||
MACHINE_CONFIG_START(namcos2_state::suzuka8h)
|
||||
MCFG_DEVICE_ADD("maincpu", M68000, M68K_CPU_CLOCK) /* 12.288MHz (49.152MHz OSC/4) */
|
||||
MCFG_DEVICE_PROGRAM_MAP(master_luckywld_am)
|
||||
MCFG_DEVICE_PROGRAM_MAP(master_suzuka8h_am)
|
||||
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", namcos2_state, screen_scanline, "screen", 0, 1)
|
||||
|
||||
MCFG_DEVICE_ADD("slave", M68000, M68K_CPU_CLOCK) /* 12.288MHz (49.152MHz OSC/4) */
|
||||
MCFG_DEVICE_PROGRAM_MAP(slave_luckywld_am)
|
||||
MCFG_DEVICE_PROGRAM_MAP(slave_suzuka8h_am)
|
||||
|
||||
MCFG_DEVICE_ADD("audiocpu", MC6809E, M68B09_CPU_CLOCK) /* 2.048MHz (49.152MHz OSC/24) - Sound handling */
|
||||
MCFG_DEVICE_PROGRAM_MAP(sound_default_am)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_shared_state, irq0_line_hold, 2*60)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_shared_state, irq1_line_hold, 120)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_state, irq0_line_hold, 2*60)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_state, irq1_line_hold, 120)
|
||||
|
||||
configure_c68_standard(config);
|
||||
|
||||
@ -2032,6 +2120,16 @@ MACHINE_CONFIG_START(namcos2_state::luckywld)
|
||||
|
||||
MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, "palette", gfx_luckywld)
|
||||
|
||||
NAMCO_C355SPR(config, m_c355spr, 0);
|
||||
m_c355spr->set_palette_tag("palette");
|
||||
m_c355spr->set_gfxdecode_tag("gfxdecode");
|
||||
m_c355spr->set_is_namcofl(false);
|
||||
m_c355spr->set_tile_callback(namco_c355spr_device::c355_obj_code2tile_delegate());
|
||||
m_c355spr->set_palxor(0x0);
|
||||
m_c355spr->set_gfxregion(0);
|
||||
|
||||
configure_c123tmap_standard(config);
|
||||
|
||||
configure_c116_standard(config);
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(namcos2_state, luckywld)
|
||||
@ -2052,6 +2150,26 @@ MACHINE_CONFIG_START(namcos2_state::luckywld)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 0.80)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(namcos2_state::luckywld)
|
||||
suzuka8h(config);
|
||||
|
||||
MCFG_DEVICE_MODIFY("maincpu")
|
||||
MCFG_DEVICE_PROGRAM_MAP(master_luckywld_am)
|
||||
|
||||
MCFG_DEVICE_MODIFY("slave")
|
||||
MCFG_DEVICE_PROGRAM_MAP(slave_luckywld_am)
|
||||
|
||||
|
||||
NAMCO_C169ROZ(config, m_c169roz, 0);
|
||||
m_c169roz->set_gfxdecode_tag("gfxdecode");
|
||||
m_c169roz->set_is_namcofl(false);
|
||||
m_c169roz->set_ram_words(0x10000/2);
|
||||
m_c169roz->set_tile_callback(namco_c169roz_device::c169_tilemap_delegate(&namcos2_state::RozCB_luckywld, this));
|
||||
m_c169roz->set_maskregion_tag("gfx5");
|
||||
m_c169roz->set_gfxregion(1);
|
||||
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(namcos2_state::metlhawk)
|
||||
MCFG_DEVICE_ADD("maincpu", M68000, M68K_CPU_CLOCK) /* 12.288MHz (49.152MHz OSC/4) */
|
||||
MCFG_DEVICE_PROGRAM_MAP(master_metlhawk_am)
|
||||
@ -2062,8 +2180,8 @@ MACHINE_CONFIG_START(namcos2_state::metlhawk)
|
||||
|
||||
MCFG_DEVICE_ADD("audiocpu", MC6809E, M68B09_CPU_CLOCK) /* 2.048MHz (49.152MHz OSC/24) - Sound handling */
|
||||
MCFG_DEVICE_PROGRAM_MAP(sound_default_am)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_shared_state, irq0_line_hold, 2*60)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_shared_state, irq1_line_hold, 120)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_state, irq0_line_hold, 2*60)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(namcos2_state, irq1_line_hold, 120)
|
||||
|
||||
configure_c65_standard(config);
|
||||
|
||||
@ -2085,6 +2203,21 @@ MACHINE_CONFIG_START(namcos2_state::metlhawk)
|
||||
|
||||
MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, "palette", gfx_metlhawk)
|
||||
|
||||
NAMCO_C169ROZ(config, m_c169roz, 0);
|
||||
m_c169roz->set_gfxdecode_tag("gfxdecode");
|
||||
m_c169roz->set_is_namcofl(false);
|
||||
m_c169roz->set_ram_words(0x10000/2);
|
||||
m_c169roz->set_tile_callback(namco_c169roz_device::c169_tilemap_delegate(&namcos2_state::RozCB_metlhawk, this));
|
||||
m_c169roz->set_maskregion_tag("gfx5");
|
||||
m_c169roz->set_gfxregion(1);
|
||||
|
||||
configure_c123tmap_standard(config);
|
||||
|
||||
NAMCOS2_SPRITE(config, m_ns2sprite, 0);
|
||||
m_ns2sprite->set_palette_tag("palette");
|
||||
m_ns2sprite->set_gfxdecode_tag("gfxdecode");
|
||||
m_ns2sprite->set_spriteram_tag("spriteram");
|
||||
|
||||
configure_c116_standard(config);
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(namcos2_state, metlhawk)
|
||||
@ -3608,10 +3741,75 @@ ROM_START( fourtrax )
|
||||
ROM_LOAD( "fx_voi-1.3m", 0x000000, 0x080000, CRC(6173364f) SHA1(cc426f49b7e87b11f1f51e8e10db7cad87ffb44d) )
|
||||
ROM_END
|
||||
|
||||
ROM_START( fourtraxj )
|
||||
ROM_REGION( 0x040000, "maincpu", 0 ) /* Master CPU */
|
||||
ROM_LOAD16_BYTE( "fx1_mp0.11d", 0x000000, 0x020000, CRC(35a690b1) SHA1(0e5157d0b1b54aaac22f725e712bb61104f199e3) )
|
||||
ROM_LOAD16_BYTE( "fx1_mp1.13d", 0x000001, 0x020000, CRC(005bda8b) SHA1(2f258a30ff307e06b715321e48b3b649bce6648a) )
|
||||
|
||||
ROM_REGION( 0x040000, "slave", 0 ) /* Slave CPU */
|
||||
ROM_LOAD16_BYTE( "fx1_sp0.11k", 0x000000, 0x020000, CRC(48548e78) SHA1(b3a9de8682fe63c1c3ecab3e3f9380a884efd4af) ) // same content as fx2 set, different label
|
||||
ROM_LOAD16_BYTE( "fx1_sp1.13k", 0x000001, 0x020000, CRC(d2861383) SHA1(36be5a8c8a19f35f9a9bd3ef725a83c5e58ccbe0) ) // same content as fx2 set, different label
|
||||
|
||||
ROM_REGION( 0x020000, "audiocpu", 0 ) /* Sound CPU (Banked) */
|
||||
ROM_LOAD( "fx1_sd0.7j", 0x000000, 0x020000, CRC(acccc934) SHA1(98f1a823ba7e3f258a73d5780953f9339d438e1a) )
|
||||
|
||||
ROM_REGION( 0x8000, "c65mcu:external", ROMREGION_ERASE00 ) /* I/O MCU */
|
||||
ROM_LOAD( "sys2c65c.bin", 0x000000, 0x008000, CRC(a5b2a4ff) SHA1(068bdfcc71a5e83706e8b23330691973c1c214dc) )
|
||||
|
||||
ROM_REGION( 0x400000, "gfx1", 0 ) /* Sprites */
|
||||
ROM_LOAD( "fx_obj-0.4c", 0x000000, 0x040000, CRC(1aa60ffa) SHA1(1fa625a52c763b8db718af14e9f3cc3e076ff83b) )
|
||||
ROM_LOAD( "fx_obj-1.3c", 0x040000, 0x040000, CRC(7509bc09) SHA1(823d8d884afc685dda26c1256c2d241c7f626f9e) )
|
||||
ROM_LOAD( "fx_obj-4.4a", 0x080000, 0x040000, CRC(30add52a) SHA1(ff782d9dca96967233e435c3dd7d69ffde45db43) )
|
||||
ROM_LOAD( "fx_obj-5.3a", 0x0c0000, 0x040000, CRC(e3cd2776) SHA1(6155e9ad90b8a885125c8a76e9c068247e7693ae) )
|
||||
ROM_LOAD( "fx_obj-8.8c", 0x100000, 0x040000, CRC(b165acab) SHA1(86bd2cc22e25ddbf73e62426762aa72205868660) )
|
||||
ROM_LOAD( "fx_obj-9.7c", 0x140000, 0x040000, CRC(90f0735b) SHA1(2adbe72c6547075c0cc0386789cc1b8c1a0bc84f) )
|
||||
ROM_LOAD( "fx_obj-12.8a", 0x180000, 0x040000, CRC(f5e23b78) SHA1(99896bd7c6663e3f57cb5d206964b81b5d64c8b6) )
|
||||
ROM_LOAD( "fx_obj-13.7a", 0x1c0000, 0x040000, CRC(04a25007) SHA1(0c33450b0d6907754dbf1914849d1630baa824bd) )
|
||||
ROM_LOAD( "fx_obj2.2c", 0x200000, 0x040000, CRC(243affc7) SHA1(738d62960e79b95079b2208ec48fa0f3738c7611) )
|
||||
ROM_LOAD( "fx_obj-3.1c", 0x240000, 0x040000, CRC(b7e5d17d) SHA1(3d8ea7cbf33b595ddf739024e8d0fccd5f9e073b) )
|
||||
ROM_LOAD( "fx_obj6.2a", 0x280000, 0x040000, CRC(a2d5ce4a) SHA1(bbe9df3914632a573a95fcba76442404d149fb9d) )
|
||||
ROM_LOAD( "fx_obj7.1a", 0x2c0000, 0x040000, CRC(4d91c929) SHA1(97470a4ad7b28df83c632bfc8c309b24701275fe) )
|
||||
ROM_LOAD( "fx_obj10.6c", 0x300000, 0x040000, CRC(7a01e86f) SHA1(5fde10e53cb192df0f3873cd6d59c725430948f5) )
|
||||
ROM_LOAD( "fx_obj-11.5c", 0x340000, 0x040000, CRC(514b3fe5) SHA1(19562ba2ac04a16d335bdc81b34d929f7ff9161c) )
|
||||
ROM_LOAD( "fx_obj-14.6a", 0x380000, 0x040000, CRC(c1658c77) SHA1(ec689d0e5cf95085c193aa8949c6ec6e7243338b) )
|
||||
ROM_LOAD( "fx_obj15.5a", 0x3c0000, 0x040000, CRC(2bc909b3) SHA1(29c668d6d12ccdee25e97373bc4786894858d463) )
|
||||
|
||||
ROM_REGION( 0x400000, "gfx2", 0 ) /* Tiles */
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx_chr-0.11n", 0x000000, CRC(6658c1c3) SHA1(64b5466e0f94cf5f3cb92915a26331748f67041a) )
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx_chr-1.11p", 0x080000, CRC(3a888943) SHA1(6540b417003045dfa1401a1ff04ac55b86cc177f) )
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx2_ch2.11r", 0x100000, CRC(fdf1e86b) SHA1(91a61c10a9e92f8bbc26ffc9cb72deb31378a843) ) // should this be the same, fx2 is the world set label, needs checking
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx_chr-3.11s", 0x180000, CRC(47fa7e61) SHA1(cc2eed81ddb4f942dd7a07e474760e4608eb4da0) )
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx_chr-4.9n", 0x200000, CRC(c720c5f5) SHA1(f68f369bbefe01c770314ea597dd88587638c62a) )
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx_chr-5.9p", 0x280000, CRC(9eacdbc8) SHA1(ca4061afc9e61eeb543f2a3740812abf6a1049bc) )
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx_chr-6.9r", 0x300000, CRC(c3dba42e) SHA1(2b5a8fabec11ccd44156ecfccf86fc713845d262) )
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx_chr-7.9s", 0x380000, CRC(c009f3ae) SHA1(394beed29bda97f4f5ba532bc0bd22177154746b) )
|
||||
|
||||
ROM_REGION( 0x400000, "gfx3", ROMREGION_ERASEFF ) /* ROZ Tiles */
|
||||
/* No ROZ files in zip */
|
||||
|
||||
ROM_REGION( 0x080000, "gfx4", 0 ) /* Mask shape */
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx_sha.7n", 0x000000, CRC(f7aa4af7) SHA1(b18ffda9e35beb0f072825e2899691be370f33b1) )
|
||||
|
||||
ROM_REGION16_BE( 0x200000, "data_rom", 0 ) /* Shared data roms */
|
||||
NAMCOS2_DATA_LOAD_E_256K( "fx_dat0.13s", 0x000000, CRC(63abf69b) SHA1(6776991eeff434bf9720f49ad6e62c37fc7ddf40) )
|
||||
NAMCOS2_DATA_LOAD_O_256K( "fx_dat1.13r", 0x000000, CRC(725bed14) SHA1(bbf886ac7f8c2c7857bc0b5d7f8fc7e63e8e9559) )
|
||||
NAMCOS2_DATA_LOAD_E_256K( "fx_dat2.13p", 0x100000, CRC(71e4a5a0) SHA1(a0188c920a43c5e69e25464627094b6b6ed26a59) )
|
||||
NAMCOS2_DATA_LOAD_O_256K( "fx_dat3.13n", 0x100000, CRC(605725f7) SHA1(b94ce0ec37f879a5e46a097058cb2dd57e2281f1) )
|
||||
|
||||
ROM_REGION( 0x100, "c45_road:clut", 0 ) /* prom for road colors */
|
||||
ROM_LOAD( "fx1_1.5b", 0, 0x100, CRC(85ffd753) SHA1(7dbc8c295204877f41289141a146aa4f5f9f9c96) )
|
||||
|
||||
ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */
|
||||
ROM_LOAD( "fx_voi-1.3m", 0x000000, 0x080000, CRC(6173364f) SHA1(cc426f49b7e87b11f1f51e8e10db7cad87ffb44d) )
|
||||
ROM_END
|
||||
|
||||
// this is a strange, it's based on the fx2 set, but with one of the 68k pair modified (21 bytes changed) and a unique GFX rom?
|
||||
// changes seem to be related to the trackside advertising banners
|
||||
ROM_START( fourtraxa )
|
||||
ROM_REGION( 0x040000, "maincpu", 0 ) /* Master CPU */
|
||||
ROM_LOAD16_BYTE( "fx4_mp0.11d", 0x000000, 0x020000, CRC(f87b3dce) SHA1(a0534c47c3197e38dc277d6b91d6d990a89844df) )
|
||||
ROM_LOAD16_BYTE( "fx4_mp1.13d", 0x000001, 0x020000, CRC(d82f7c20) SHA1(a818ff89362044a5257a0a9b701feaad84496d88) )
|
||||
// the old dump of this set only differed in having a 0x00 fill in the 2nd half instead of a 0xff fill
|
||||
ROM_LOAD16_BYTE( "fx4_mp0a.11d", 0x000000, 0x020000, CRC(f147cd6b) SHA1(7cdadd68d55dd8fa9b19cbee1434d9266ae1f4b9) ) // == fx2_mp0.11d
|
||||
ROM_LOAD16_BYTE( "fx4_mp1a.13d", 0x000001, 0x020000, CRC(d1138c85) SHA1(32bf68ae36f72b84f3c3df28425147b6aaac1edf) )
|
||||
|
||||
ROM_REGION( 0x040000, "slave", 0 ) /* Slave CPU */
|
||||
ROM_LOAD16_BYTE( "fx1_sp0.11k", 0x000000, 0x020000, CRC(41687edd) SHA1(1e79dc9abe5614f836e89b376be1dc70deaac889) )
|
||||
@ -3644,7 +3842,7 @@ ROM_START( fourtraxa )
|
||||
ROM_REGION( 0x400000, "gfx2", 0 ) /* Tiles */
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx_chr-0.11n", 0x000000, CRC(6658c1c3) SHA1(64b5466e0f94cf5f3cb92915a26331748f67041a) )
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx_chr-1.11p", 0x080000, CRC(3a888943) SHA1(6540b417003045dfa1401a1ff04ac55b86cc177f) )
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx4_ch2.11r", 0x100000, CRC(a5d1ab10) SHA1(8624ef0911c57155b46e184d10cb122d4a41a2de) )
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx4_ch-2a.11r",0x100000, CRC(a5d1ab10) SHA1(8624ef0911c57155b46e184d10cb122d4a41a2de) ) // unique to this set, mask ROM intentionally replaced
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx_chr-3.11s", 0x180000, CRC(47fa7e61) SHA1(cc2eed81ddb4f942dd7a07e474760e4608eb4da0) )
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx_chr-4.9n", 0x200000, CRC(c720c5f5) SHA1(f68f369bbefe01c770314ea597dd88587638c62a) )
|
||||
NAMCOS2_GFXROM_LOAD_128K( "fx_chr-5.9p", 0x280000, CRC(9eacdbc8) SHA1(ca4061afc9e61eeb543f2a3740812abf6a1049bc) )
|
||||
@ -5678,7 +5876,8 @@ GAME( 1988, pheliosj, phelios, base2, base, namcos2_state, init_pheli
|
||||
GAME( 1989, dirtfoxj, 0, base2, dirtfox, namcos2_state, init_dirtfoxj, ROT90, "Namco", "Dirt Fox (Japan)", MACHINE_NODEVICE_LAN )
|
||||
|
||||
GAMEL( 1989, fourtrax, 0, finallap, fourtrax, namcos2_state, init_fourtrax, ROT0, "Namco", "Four Trax (World)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN, layout_finallap )
|
||||
GAMEL( 1989, fourtraxa, fourtrax, finallap, fourtrax, namcos2_state, init_fourtrax, ROT0, "Namco", "Four Trax (Asia)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN, layout_finallap ) // believed to be Asia due to the 4 appended to the changed ROMs. All other games with 2 are marked World and with 1 are marked Japan.
|
||||
GAMEL( 1989, fourtraxj, fourtrax, finallap, fourtrax, namcos2_state, init_fourtrax, ROT0, "Namco", "Four Trax (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN, layout_finallap )
|
||||
GAMEL( 1989, fourtraxa, fourtrax, finallap, fourtrax, namcos2_state, init_fourtrax, ROT0, "Namco (Atari license?)", "Four Trax (US?, censored banners)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN, layout_finallap ) // boards using the ROM code FX4 were produced for Atari? there's no US region warning or Atari copyright tho, modded version of the World code
|
||||
|
||||
GAME( 1989, valkyrie, 0, base3, base, namcos2_state, init_valkyrie, ROT90, "Namco", "Valkyrie No Densetsu (Japan)", 0 )
|
||||
|
||||
@ -5728,15 +5927,15 @@ GAMEL( 1992, finalap3bl, finalap3, finalap3, finalap3, namcos2_state, init_final
|
||||
GAME( 1992, luckywld, 0, luckywld, luckywld, namcos2_state, init_luckywld, ROT0, "Namco", "Lucky & Wild", 0 )
|
||||
GAME( 1992, luckywldj, luckywld, luckywld, luckywld, namcos2_state, init_luckywld, ROT0, "Namco", "Lucky & Wild (Japan)", 0 )
|
||||
|
||||
GAME( 1992, suzuka8h, 0, luckywld, suzuka, namcos2_state, init_suzuka8h, ROT0, "Namco", "Suzuka 8 Hours (World, Rev C)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN )
|
||||
GAME( 1992, suzuka8hj, suzuka8h, luckywld, suzuka, namcos2_state, init_suzuka8h, ROT0, "Namco", "Suzuka 8 Hours (Japan, Rev B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN )
|
||||
GAME( 1992, suzuka8h, 0, suzuka8h, suzuka, namcos2_state, init_suzuka8h, ROT0, "Namco", "Suzuka 8 Hours (World, Rev C)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN )
|
||||
GAME( 1992, suzuka8hj, suzuka8h, suzuka8h, suzuka, namcos2_state, init_suzuka8h, ROT0, "Namco", "Suzuka 8 Hours (Japan, Rev B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN )
|
||||
|
||||
GAME( 1992, sws, 0, base_c68, base, namcos2_state, init_sws, ROT0, "Namco", "Super World Stadium (Japan)", 0 )
|
||||
|
||||
GAME( 1992, sws92, 0, base_c68, base, namcos2_state, init_sws92, ROT0, "Namco", "Super World Stadium '92 (Japan)", 0 )
|
||||
GAME( 1992, sws92g, sws92, base_c68, base, namcos2_state, init_sws92g, ROT0, "Namco", "Super World Stadium '92 Gekitouban (Japan)", 0 )
|
||||
|
||||
GAME( 1993, suzuk8h2, 0, luckywld, suzuka, namcos2_state, init_suzuk8h2, ROT0, "Namco", "Suzuka 8 Hours 2 (World, Rev B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN )
|
||||
GAME( 1993, suzuk8h2j, suzuk8h2, luckywld, suzuka, namcos2_state, init_suzuk8h2, ROT0, "Namco", "Suzuka 8 Hours 2 (Japan, Rev B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN )
|
||||
GAME( 1993, suzuk8h2, 0, suzuka8h, suzuka, namcos2_state, init_suzuk8h2, ROT0, "Namco", "Suzuka 8 Hours 2 (World, Rev B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN )
|
||||
GAME( 1993, suzuk8h2j, suzuk8h2, suzuka8h, suzuka, namcos2_state, init_suzuk8h2, ROT0, "Namco", "Suzuka 8 Hours 2 (Japan, Rev B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN )
|
||||
|
||||
GAME( 1993, sws93, 0, base_c68, base, namcos2_state, init_sws93, ROT0, "Namco", "Super World Stadium '93 (Japan)", 0 )
|
||||
GAME( 1993, sws93, 0, base_c68, base, namcos2_state, init_sws93, ROT0, "Namco", "Super World Stadium '93 (Japan)", 0 ) // this appears to have a subtitle, what is it?
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,11 +1,13 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Phil Stroffolino
|
||||
/* namcoic.h
|
||||
|
||||
System 21 here presumably refers to the Winning Run PCB, not the later games?
|
||||
|
||||
Custom Chips: Final Lap Assault LuckyWld System21 NA1/2 NB1/2
|
||||
C45 Land Generator * *
|
||||
C65 I/O Controller * *
|
||||
C68 * *
|
||||
C65 I/O Controller (older) * *
|
||||
C67 TMS320C25 (DSP int rom)
|
||||
C68 I/O Controller (newer) * *
|
||||
C70 *
|
||||
C95 * *
|
||||
C102 ROZ:Memory Access Control *
|
||||
@ -86,17 +88,3 @@ C146 - Steers the Decode Object Pixel data to the correct line buffer A or B
|
||||
ROZ
|
||||
---
|
||||
C102 - Controls CPU access to ROZ Memory Area.
|
||||
*/
|
||||
|
||||
/***********************************************************************************/
|
||||
|
||||
#ifndef MAME_MACHINE_NAMCOIC_H
|
||||
#define MAME_MACHINE_NAMCOIC_H
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
|
||||
/***********************************************************************************/
|
||||
|
||||
#endif // MAME_MACHINE_NAMCOIC_H
|
@ -1,8 +1,12 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:R. Belmont, ElSemi
|
||||
|
||||
#include "namcos2.h"
|
||||
#include "machine/timer.h"
|
||||
#include "screen.h"
|
||||
#include "video/namco_c123tmap.h"
|
||||
#include "video/namco_c116.h"
|
||||
#include "video/namco_c169roz.h"
|
||||
#include "video/namco_c355spr.h"
|
||||
|
||||
#define NAMCOFL_HTOTAL (288) /* wrong */
|
||||
#define NAMCOFL_HBSTART (288)
|
||||
@ -19,11 +23,18 @@
|
||||
#define NAMCOFL_SPRITEGFX 1
|
||||
#define NAMCOFL_ROTGFX 2
|
||||
|
||||
class namcofl_state : public namcos2_shared_state
|
||||
class namcofl_state : public driver_device
|
||||
{
|
||||
public:
|
||||
namcofl_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
namcos2_shared_state(mconfig, type, tag),
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_palette(*this, "palette"),
|
||||
m_c116(*this, "c116"),
|
||||
m_screen(*this, "screen"),
|
||||
m_c123tmap(*this, "c123tmap"),
|
||||
m_c169roz(*this, "c169roz"),
|
||||
m_c355spr(*this, "c355spr"),
|
||||
m_mcu(*this, "mcu"),
|
||||
m_in0(*this, "IN0"),
|
||||
m_in1(*this, "IN1"),
|
||||
@ -40,6 +51,13 @@ public:
|
||||
void init_finalapr();
|
||||
|
||||
private:
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<namco_c116_device> m_c116;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<namco_c123tmap_device> m_c123tmap;
|
||||
required_device<namco_c169roz_device> m_c169roz;
|
||||
required_device<namco_c355spr_device> m_c355spr;
|
||||
required_device<cpu_device> m_mcu;
|
||||
required_ioport m_in0;
|
||||
required_ioport m_in1;
|
||||
|
@ -6,9 +6,13 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "namcos2.h"
|
||||
#include "machine/eeprompar.h"
|
||||
#include "machine/timer.h"
|
||||
#include "screen.h"
|
||||
#include "video/namco_c116.h"
|
||||
#include "video/namco_c355spr.h"
|
||||
#include "video/namco_c123tmap.h"
|
||||
#include "video/namco_c169roz.h"
|
||||
|
||||
#define NAMCONB1_HTOTAL (288) /* wrong */
|
||||
#define NAMCONB1_HBSTART (288)
|
||||
@ -25,11 +29,21 @@
|
||||
#define NAMCONB1_SPRITEGFX 1
|
||||
#define NAMCONB1_ROTGFX 2
|
||||
|
||||
class namconb1_state : public namcos2_shared_state
|
||||
|
||||
|
||||
class namconb1_state : public driver_device
|
||||
{
|
||||
public:
|
||||
namconb1_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
namcos2_shared_state(mconfig, type, tag),
|
||||
driver_device(mconfig, type, tag),
|
||||
m_gametype(0),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_palette(*this, "palette"),
|
||||
m_c116(*this, "c116"),
|
||||
m_c123tmap(*this, "c123tmap"),
|
||||
m_c355spr(*this, "c355spr"),
|
||||
m_c169roz(*this, "c169roz"),
|
||||
m_screen(*this, "screen"),
|
||||
m_mcu(*this, "mcu"),
|
||||
m_eeprom(*this, "eeprom"),
|
||||
m_p1(*this, "P1"),
|
||||
@ -63,6 +77,31 @@ public:
|
||||
void init_gslgr94u();
|
||||
|
||||
private:
|
||||
int m_gametype;
|
||||
enum
|
||||
{
|
||||
/* Namco NB1 */
|
||||
NAMCONB1_NEBULRAY = 0x2000,
|
||||
NAMCONB1_GUNBULET,
|
||||
NAMCONB1_GSLGR94U,
|
||||
NAMCONB1_GSLGR94J,
|
||||
NAMCONB1_SWS95,
|
||||
NAMCONB1_SWS96,
|
||||
NAMCONB1_SWS97,
|
||||
NAMCONB1_VSHOOT,
|
||||
|
||||
/* Namco NB2 */
|
||||
NAMCONB2_OUTFOXIES,
|
||||
NAMCONB2_MACH_BREAKERS,
|
||||
};
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<namco_c116_device> m_c116;
|
||||
required_device<namco_c123tmap_device> m_c123tmap;
|
||||
required_device<namco_c355spr_device> m_c355spr;
|
||||
optional_device<namco_c169roz_device> m_c169roz; // NB1 only, not NA1
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<cpu_device> m_mcu;
|
||||
required_device<eeprom_parallel_28xx_device> m_eeprom;
|
||||
required_ioport m_p1;
|
||||
|
@ -20,283 +20,55 @@
|
||||
#include "video/namco_c116.h"
|
||||
#include "machine/namco65.h"
|
||||
#include "machine/namco68.h"
|
||||
|
||||
#include "cpu/m6502/m3745x.h"
|
||||
#include "video/namco_c169roz.h"
|
||||
#include "video/namco_c355spr.h"
|
||||
#include "video/namco_c123tmap.h"
|
||||
#include "video/namcos2_sprite.h"
|
||||
#include "video/namcos2_roz.h"
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
|
||||
/* CPU reference numbers */
|
||||
|
||||
#define CPU_MASTER 0
|
||||
#define CPU_SLAVE 1
|
||||
#define CPU_SOUND 2
|
||||
#define CPU_MCU 3
|
||||
#define CPU_GPU 5
|
||||
|
||||
|
||||
/*********************************************/
|
||||
/* IF GAME SPECIFIC HACKS ARE REQUIRED THEN */
|
||||
/* USE THE m_gametype MEMBER TO FIND */
|
||||
/* OUT WHAT GAME IS RUNNING */
|
||||
/*********************************************/
|
||||
|
||||
enum
|
||||
{
|
||||
/* Namco System 2 */
|
||||
NAMCOS2_ASSAULT = 0x1000,
|
||||
NAMCOS2_ASSAULT_JP,
|
||||
NAMCOS2_ASSAULT_PLUS,
|
||||
NAMCOS2_BUBBLE_TROUBLE,
|
||||
NAMCOS2_BURNING_FORCE,
|
||||
NAMCOS2_COSMO_GANG,
|
||||
NAMCOS2_COSMO_GANG_US,
|
||||
NAMCOS2_DIRT_FOX,
|
||||
NAMCOS2_DIRT_FOX_JP,
|
||||
NAMCOS2_DRAGON_SABER,
|
||||
NAMCOS2_FINAL_LAP,
|
||||
NAMCOS2_FINAL_LAP_2,
|
||||
NAMCOS2_FINAL_LAP_3,
|
||||
NAMCOS2_FINEST_HOUR,
|
||||
NAMCOS2_FOUR_TRAX,
|
||||
NAMCOS2_GOLLY_GHOST,
|
||||
NAMCOS2_LUCKY_AND_WILD,
|
||||
NAMCOS2_MARVEL_LAND,
|
||||
NAMCOS2_METAL_HAWK,
|
||||
NAMCOS2_MIRAI_NINJA,
|
||||
NAMCOS2_ORDYNE,
|
||||
NAMCOS2_PHELIOS,
|
||||
NAMCOS2_ROLLING_THUNDER_2,
|
||||
NAMCOS2_STEEL_GUNNER,
|
||||
NAMCOS2_STEEL_GUNNER_2,
|
||||
NAMCOS2_SUPER_WSTADIUM,
|
||||
NAMCOS2_SUPER_WSTADIUM_92,
|
||||
NAMCOS2_SUPER_WSTADIUM_92T,
|
||||
NAMCOS2_SUPER_WSTADIUM_93,
|
||||
NAMCOS2_SUZUKA_8_HOURS,
|
||||
NAMCOS2_SUZUKA_8_HOURS_2,
|
||||
NAMCOS2_VALKYRIE,
|
||||
NAMCOS2_KYUUKAI_DOUCHUUKI,
|
||||
|
||||
/* Namco System21 */
|
||||
NAMCOS21_AIRCOMBAT,
|
||||
NAMCOS21_STARBLADE,
|
||||
NAMCOS21_CYBERSLED,
|
||||
NAMCOS21_SOLVALOU,
|
||||
NAMCOS21_WINRUN91,
|
||||
NAMCOS21_DRIVERS_EYES,
|
||||
|
||||
/* Namco NB1 */
|
||||
NAMCONB1_NEBULRAY,
|
||||
NAMCONB1_GUNBULET,
|
||||
NAMCONB1_GSLGR94U,
|
||||
NAMCONB1_GSLGR94J,
|
||||
NAMCONB1_SWS95,
|
||||
NAMCONB1_SWS96,
|
||||
NAMCONB1_SWS97,
|
||||
NAMCONB1_VSHOOT,
|
||||
|
||||
/* Namco NB2 */
|
||||
NAMCONB2_OUTFOXIES,
|
||||
NAMCONB2_MACH_BREAKERS,
|
||||
|
||||
/* Namco System FL */
|
||||
NAMCOFL_SPEED_RACER,
|
||||
NAMCOFL_FINAL_LAP_R
|
||||
};
|
||||
|
||||
// fix me -- most of this should be devices eventually
|
||||
class namcos2_shared_state : public driver_device
|
||||
{
|
||||
public:
|
||||
namcos2_shared_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_dspmaster(*this, "dspmaster")
|
||||
, m_dspslave(*this, "dspslave")
|
||||
, m_gametype(0)
|
||||
, m_c140(*this, "c140")
|
||||
, m_c116(*this, "c116")
|
||||
, m_master_intc(*this, "master_intc")
|
||||
, m_slave_intc(*this, "slave_intc")
|
||||
, m_sci(*this, "sci")
|
||||
, m_gpu(*this, "gpu")
|
||||
, m_c169_roz_videoram(*this, "rozvideoram", 0)
|
||||
, m_c169_roz_gfxbank(0)
|
||||
, m_c169_roz_mask(nullptr)
|
||||
, m_c355_obj_gfxbank(0)
|
||||
, m_c355_obj_palxor(0)
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_audiocpu(*this, "audiocpu")
|
||||
, m_slave(*this, "slave")
|
||||
, m_c65(*this, "c65mcu")
|
||||
, m_c68(*this, "c68mcu")
|
||||
, m_gfxdecode(*this, "gfxdecode")
|
||||
, m_screen(*this, "screen")
|
||||
, m_palette(*this, "palette")
|
||||
, m_audiobank(*this, "audiobank")
|
||||
{ }
|
||||
|
||||
optional_device<cpu_device> m_dspmaster;
|
||||
optional_device<cpu_device> m_dspslave;
|
||||
|
||||
int m_gametype;
|
||||
|
||||
protected:
|
||||
optional_device<c140_device> m_c140;
|
||||
optional_device<namco_c116_device> m_c116;
|
||||
optional_device<namco_c148_device> m_master_intc;
|
||||
optional_device<namco_c148_device> m_slave_intc;
|
||||
optional_device<namco_c139_device> m_sci;
|
||||
optional_device<cpu_device> m_gpu; //to be moved to namco21_state after disentangling
|
||||
|
||||
// game type helpers
|
||||
bool is_system21();
|
||||
|
||||
std::unique_ptr<uint8_t[]> m_eeprom;
|
||||
|
||||
DECLARE_WRITE8_MEMBER(sound_reset_w);
|
||||
DECLARE_WRITE8_MEMBER(system_reset_w);
|
||||
void reset_all_subcpus(int state);
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(screen_scanline);
|
||||
|
||||
// C123 Tilemap Emulation
|
||||
// TODO: merge with namcos1.cpp implementation and convert to device
|
||||
DECLARE_WRITE16_MEMBER( c123_tilemap_videoram_w );
|
||||
DECLARE_READ16_MEMBER( c123_tilemap_videoram_r );
|
||||
DECLARE_WRITE16_MEMBER( c123_tilemap_control_w );
|
||||
DECLARE_READ16_MEMBER( c123_tilemap_control_r );
|
||||
template<int Offset> TILE_GET_INFO_MEMBER( get_tile_info );
|
||||
typedef delegate<void (uint16_t, int*, int*)> c123_tilemap_delegate;
|
||||
void c123_tilemap_init(int gfxbank, void *pMaskROM, c123_tilemap_delegate tilemap_cb);
|
||||
void c123_tilemap_invalidate(void);
|
||||
void c123_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri);
|
||||
void c123_SetTilemapVideoram(int offset, uint16_t newword);
|
||||
void c123_SetTilemapControl(int offset, uint16_t newword);
|
||||
|
||||
struct c123_mTilemapInfo
|
||||
{
|
||||
uint16_t control[0x40/2];
|
||||
/**
|
||||
* [0x1] 0x02/2 tilemap#0.scrollx
|
||||
* [0x3] 0x06/2 tilemap#0.scrolly
|
||||
* [0x5] 0x0a/2 tilemap#1.scrollx
|
||||
* [0x7] 0x0e/2 tilemap#1.scrolly
|
||||
* [0x9] 0x12/2 tilemap#2.scrollx
|
||||
* [0xb] 0x16/2 tilemap#2.scrolly
|
||||
* [0xd] 0x1a/2 tilemap#3.scrollx
|
||||
* [0xf] 0x1e/2 tilemap#3.scrolly
|
||||
* 0x20/2 priority
|
||||
* 0x30/2 color
|
||||
*/
|
||||
tilemap_t *tmap[6];
|
||||
std::unique_ptr<uint16_t[]> videoram;
|
||||
int gfxbank;
|
||||
uint8_t *maskBaseAddr;
|
||||
c123_tilemap_delegate cb;
|
||||
};
|
||||
|
||||
c123_mTilemapInfo m_c123_TilemapInfo;
|
||||
|
||||
// C169 ROZ Layer Emulation
|
||||
typedef delegate<void (uint16_t, int*, int*, int)> c169_tilemap_delegate;
|
||||
void c169_roz_init(int gfxbank, const char *maskregion, c169_tilemap_delegate tilemap_cb);
|
||||
void c169_roz_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri);
|
||||
DECLARE_READ16_MEMBER( c169_roz_control_r );
|
||||
DECLARE_WRITE16_MEMBER( c169_roz_control_w );
|
||||
DECLARE_READ16_MEMBER( c169_roz_videoram_r );
|
||||
DECLARE_WRITE16_MEMBER( c169_roz_videoram_w );
|
||||
|
||||
c169_tilemap_delegate m_c169_cb;
|
||||
struct roz_parameters
|
||||
{
|
||||
uint32_t left, top, size;
|
||||
uint32_t startx, starty;
|
||||
int incxx, incxy, incyx, incyy;
|
||||
int color, priority;
|
||||
int wrap;
|
||||
};
|
||||
void c169_roz_unpack_params(const uint16_t *source, roz_parameters ¶ms);
|
||||
void c169_roz_draw_helper(screen_device &screen, bitmap_ind16 &bitmap, tilemap_t &tmap, const rectangle &clip, const roz_parameters ¶ms);
|
||||
void c169_roz_draw_scanline(screen_device &screen, bitmap_ind16 &bitmap, int line, int which, int pri, const rectangle &cliprect);
|
||||
void c169_roz_get_info(tile_data &tileinfo, int tile_index, int which);
|
||||
template<int Which> TILE_GET_INFO_MEMBER( c169_roz_get_info );
|
||||
TILEMAP_MAPPER_MEMBER( c169_roz_mapper );
|
||||
|
||||
static const int ROZ_TILEMAP_COUNT = 2;
|
||||
tilemap_t *m_c169_roz_tilemap[ROZ_TILEMAP_COUNT];
|
||||
uint16_t m_c169_roz_control[0x20/2];
|
||||
optional_shared_ptr<uint16_t> m_c169_roz_videoram;
|
||||
int m_c169_roz_gfxbank;
|
||||
uint8_t *m_c169_roz_mask;
|
||||
uint32_t m_c169_roz_rammask;
|
||||
|
||||
// C355 Motion Object Emulation
|
||||
typedef delegate<int (int)> c355_obj_code2tile_delegate;
|
||||
// for pal_xor, supply either 0x0 (normal) or 0xf (palette mapping reversed)
|
||||
void c355_obj_init(int gfxbank, int pal_xor, c355_obj_code2tile_delegate code2tile);
|
||||
int c355_obj_default_code2tile(int code);
|
||||
void c355_obj_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri);
|
||||
void c355_obj_draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int pri);
|
||||
DECLARE_READ16_MEMBER( c355_obj_ram_r );
|
||||
DECLARE_WRITE16_MEMBER( c355_obj_ram_w );
|
||||
DECLARE_READ16_MEMBER( c355_obj_position_r );
|
||||
DECLARE_WRITE16_MEMBER( c355_obj_position_w );
|
||||
DECLARE_MACHINE_START(namcos2);
|
||||
DECLARE_MACHINE_RESET(namcos2);
|
||||
|
||||
// C355 Motion Object internals
|
||||
template<class _BitmapClass>
|
||||
void c355_obj_draw_sprite(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, const uint16_t *pSource, int pri, int zpos);
|
||||
template<class _BitmapClass>
|
||||
void c355_obj_draw_list(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int pri, const uint16_t *pSpriteList16, const uint16_t *pSpriteTable);
|
||||
|
||||
c355_obj_code2tile_delegate m_c355_obj_code2tile;
|
||||
int m_c355_obj_gfxbank;
|
||||
int m_c355_obj_palxor;
|
||||
uint16_t m_c355_obj_position[4];
|
||||
uint16_t m_c355_obj_ram[0x20000/2];
|
||||
|
||||
uint8_t m_player_mux;
|
||||
inline void namcoic_get_tile_info(tile_data &tileinfo,int tile_index,uint16_t *vram);
|
||||
|
||||
// general
|
||||
void zdrawgfxzoom(screen_device &screen, bitmap_ind16 &dest_bmp, const rectangle &clip, gfx_element *gfx, uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos);
|
||||
void zdrawgfxzoom(screen_device &screen, bitmap_rgb32 &dest_bmp, const rectangle &clip, gfx_element *gfx, uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos);
|
||||
|
||||
DECLARE_WRITE8_MEMBER( namcos2_68k_eeprom_w );
|
||||
DECLARE_READ8_MEMBER( namcos2_68k_eeprom_r );
|
||||
|
||||
DECLARE_WRITE8_MEMBER( namcos2_sound_bankselect_w );
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<cpu_device> m_audiocpu;
|
||||
optional_device<cpu_device> m_slave;
|
||||
optional_device<namcoc65_device> m_c65;
|
||||
optional_device<namcoc68_device> m_c68;
|
||||
|
||||
optional_device<gfxdecode_device> m_gfxdecode;
|
||||
optional_device<screen_device> m_screen;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
optional_memory_bank m_audiobank;
|
||||
};
|
||||
|
||||
class namcos2_state : public namcos2_shared_state
|
||||
class namcos2_state : public driver_device
|
||||
{
|
||||
public:
|
||||
namcos2_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
namcos2_shared_state(mconfig, type, tag),
|
||||
driver_device(mconfig, type, tag),
|
||||
m_gametype(0),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_slave(*this, "slave"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_c65(*this, "c65mcu"),
|
||||
m_c68(*this, "c68mcu"),
|
||||
m_c140(*this, "c140"),
|
||||
m_c116(*this, "c116"),
|
||||
m_c123tmap(*this, "c123tmap"),
|
||||
m_master_intc(*this, "master_intc"),
|
||||
m_slave_intc(*this, "slave_intc"),
|
||||
m_sci(*this, "sci"),
|
||||
m_c169roz(*this, "c169roz"),
|
||||
m_c355spr(*this, "c355spr"),
|
||||
m_palette(*this, "palette"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_screen(*this, "screen"),
|
||||
m_audiobank(*this, "audiobank"),
|
||||
m_dpram(*this, "dpram"),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_rozram(*this, "rozram"),
|
||||
m_roz_ctrl(*this, "rozctrl"),
|
||||
m_c45_road(*this, "c45_road")
|
||||
m_c45_road(*this, "c45_road"),
|
||||
m_ns2sprite(*this, "s2sprite"),
|
||||
m_ns2roz(*this, "s2roz")
|
||||
{ }
|
||||
|
||||
void configure_c116_standard(machine_config &config);
|
||||
void configure_c148_standard(machine_config &config);
|
||||
void configure_c65_standard(machine_config &config);
|
||||
void configure_c68_standard(machine_config &config);
|
||||
void configure_c123tmap_standard(machine_config &config);
|
||||
void metlhawk(machine_config &config);
|
||||
void gollygho(machine_config &config);
|
||||
void assaultp(machine_config &config);
|
||||
@ -307,6 +79,7 @@ public:
|
||||
void finallap_c68(machine_config &config);
|
||||
void finalap2(machine_config &config);
|
||||
void finalap3(machine_config &config);
|
||||
void suzuka8h(machine_config &config);
|
||||
void luckywld(machine_config &config);
|
||||
void base3(machine_config &config);
|
||||
void sgunner(machine_config &config);
|
||||
@ -349,11 +122,80 @@ public:
|
||||
void init_rthun2();
|
||||
|
||||
private:
|
||||
|
||||
enum
|
||||
{
|
||||
/* Namco System 2 */
|
||||
NAMCOS2_ASSAULT = 0x1000,
|
||||
NAMCOS2_ASSAULT_JP,
|
||||
NAMCOS2_ASSAULT_PLUS,
|
||||
NAMCOS2_BUBBLE_TROUBLE,
|
||||
NAMCOS2_BURNING_FORCE,
|
||||
NAMCOS2_COSMO_GANG,
|
||||
NAMCOS2_COSMO_GANG_US,
|
||||
NAMCOS2_DIRT_FOX,
|
||||
NAMCOS2_DIRT_FOX_JP,
|
||||
NAMCOS2_DRAGON_SABER,
|
||||
NAMCOS2_FINAL_LAP,
|
||||
NAMCOS2_FINAL_LAP_2,
|
||||
NAMCOS2_FINAL_LAP_3,
|
||||
NAMCOS2_FINEST_HOUR,
|
||||
NAMCOS2_FOUR_TRAX,
|
||||
NAMCOS2_GOLLY_GHOST,
|
||||
NAMCOS2_LUCKY_AND_WILD,
|
||||
NAMCOS2_MARVEL_LAND,
|
||||
NAMCOS2_METAL_HAWK,
|
||||
NAMCOS2_MIRAI_NINJA,
|
||||
NAMCOS2_ORDYNE,
|
||||
NAMCOS2_PHELIOS,
|
||||
NAMCOS2_ROLLING_THUNDER_2,
|
||||
NAMCOS2_STEEL_GUNNER,
|
||||
NAMCOS2_STEEL_GUNNER_2,
|
||||
NAMCOS2_SUPER_WSTADIUM,
|
||||
NAMCOS2_SUPER_WSTADIUM_92,
|
||||
NAMCOS2_SUPER_WSTADIUM_92T,
|
||||
NAMCOS2_SUPER_WSTADIUM_93,
|
||||
NAMCOS2_SUZUKA_8_HOURS,
|
||||
NAMCOS2_SUZUKA_8_HOURS_2,
|
||||
NAMCOS2_VALKYRIE,
|
||||
NAMCOS2_KYUUKAI_DOUCHUUKI,
|
||||
};
|
||||
|
||||
int m_gametype;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<cpu_device> m_slave;
|
||||
optional_device<cpu_device> m_audiocpu;
|
||||
optional_device<namcoc65_device> m_c65;
|
||||
optional_device<namcoc68_device> m_c68;
|
||||
optional_device<c140_device> m_c140;
|
||||
optional_device<namco_c116_device> m_c116;
|
||||
optional_device<namco_c123tmap_device> m_c123tmap;
|
||||
optional_device<namco_c148_device> m_master_intc;
|
||||
optional_device<namco_c148_device> m_slave_intc;
|
||||
optional_device<namco_c139_device> m_sci;
|
||||
optional_device<namco_c169roz_device> m_c169roz;
|
||||
optional_device<namco_c355spr_device> m_c355spr;
|
||||
required_device<palette_device> m_palette;
|
||||
optional_device<gfxdecode_device> m_gfxdecode;
|
||||
optional_device<screen_device> m_screen;
|
||||
optional_memory_bank m_audiobank;
|
||||
|
||||
std::unique_ptr<uint8_t[]> m_eeprom;
|
||||
|
||||
DECLARE_READ16_MEMBER(dpram_word_r);
|
||||
DECLARE_WRITE16_MEMBER(dpram_word_w);
|
||||
DECLARE_READ8_MEMBER(dpram_byte_r);
|
||||
DECLARE_WRITE8_MEMBER(dpram_byte_w);
|
||||
|
||||
DECLARE_WRITE8_MEMBER( namcos2_68k_eeprom_w );
|
||||
DECLARE_READ8_MEMBER( namcos2_68k_eeprom_r );
|
||||
|
||||
DECLARE_WRITE8_MEMBER( namcos2_sound_bankselect_w );
|
||||
|
||||
DECLARE_WRITE8_MEMBER(sound_reset_w);
|
||||
DECLARE_WRITE8_MEMBER(system_reset_w);
|
||||
void reset_all_subcpus(int state);
|
||||
|
||||
virtual void video_start() override;
|
||||
void video_start_finallap();
|
||||
void video_start_finalap2();
|
||||
@ -367,33 +209,30 @@ private:
|
||||
uint32_t screen_update_metlhawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_sgunner(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
TILE_GET_INFO_MEMBER( roz_tile_info );
|
||||
|
||||
DECLARE_READ8_MEMBER( c116_r );
|
||||
DECLARE_WRITE16_MEMBER( rozram_word_w );
|
||||
|
||||
DECLARE_READ16_MEMBER( gfx_ctrl_r );
|
||||
DECLARE_WRITE16_MEMBER( gfx_ctrl_w );
|
||||
|
||||
void draw_sprite_init();
|
||||
DECLARE_MACHINE_START(namcos2);
|
||||
DECLARE_MACHINE_RESET(namcos2);
|
||||
|
||||
void create_shadow_table();
|
||||
void apply_clip( rectangle &clip, const rectangle &cliprect );
|
||||
void draw_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri, int control );
|
||||
void draw_sprites_metalhawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri );
|
||||
|
||||
int get_pos_irq_scanline() { return (m_c116->get_reg(5) - 32) & 0xff; }
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(screen_scanline);
|
||||
|
||||
required_shared_ptr<uint8_t> m_dpram; /* 2Kx8 */
|
||||
optional_shared_ptr<uint16_t> m_spriteram;
|
||||
optional_shared_ptr<uint16_t> m_rozram;
|
||||
optional_shared_ptr<uint16_t> m_roz_ctrl;
|
||||
tilemap_t *m_tilemap_roz;
|
||||
uint16_t m_gfx_ctrl;
|
||||
uint16_t m_serial_comms_ctrl[0x8];
|
||||
unsigned m_finallap_prot_count;
|
||||
int m_sendval;
|
||||
|
||||
optional_device<namco_c45_road_device> m_c45_road;
|
||||
optional_device<namcos2_sprite_device> m_ns2sprite;
|
||||
optional_device<namcos2_roz_device> m_ns2roz;
|
||||
|
||||
DECLARE_READ16_MEMBER( namcos2_68k_key_r );
|
||||
DECLARE_WRITE16_MEMBER( namcos2_68k_key_w );
|
||||
@ -410,11 +249,12 @@ private:
|
||||
|
||||
void common_default_am(address_map &map);
|
||||
void common_finallap_am(address_map &map);
|
||||
void common_luckywld_am(address_map &map);
|
||||
void common_suzuka8h_am(address_map &map);
|
||||
void common_metlhawk_am(address_map &map);
|
||||
void common_sgunner_am(address_map &map);
|
||||
void master_default_am(address_map &map);
|
||||
void master_finallap_am(address_map &map);
|
||||
void master_suzuka8h_am(address_map &map);
|
||||
void master_luckywld_am(address_map &map);
|
||||
void master_metlhawk_am(address_map &map);
|
||||
void master_sgunner_am(address_map &map);
|
||||
@ -422,25 +262,13 @@ private:
|
||||
void namcos2_68k_default_cpu_board_am(address_map &map);
|
||||
void slave_default_am(address_map &map);
|
||||
void slave_finallap_am(address_map &map);
|
||||
void slave_suzuka8h_am(address_map &map);
|
||||
void slave_luckywld_am(address_map &map);
|
||||
void slave_metlhawk_am(address_map &map);
|
||||
void slave_sgunner_am(address_map &map);
|
||||
void sound_default_am(address_map &map);
|
||||
};
|
||||
|
||||
/*----------- defined in video/namcos2.c -----------*/
|
||||
|
||||
#define NAMCOS21_NUM_COLORS 0x8000
|
||||
|
||||
/**************************************************************/
|
||||
/* ROZ - Rotate & Zoom memory function handlers */
|
||||
/**************************************************************/
|
||||
|
||||
/*----------- defined in machine/namcos2.c -----------*/
|
||||
|
||||
extern void (*namcos2_kickstart)(running_machine &machine, int internal);
|
||||
|
||||
|
||||
/**************************************************************/
|
||||
/* Non-shared memory custom IO device - IRQ/Inputs/Outputs */
|
||||
/**************************************************************/
|
||||
|
@ -8,15 +8,28 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "namcos2.h"
|
||||
|
||||
#include "machine/namcoio_gearbox.h"
|
||||
#include "machine/timer.h"
|
||||
#include "machine/namco_c139.h"
|
||||
#include "machine/namco_c148.h"
|
||||
#include "machine/timer.h"
|
||||
#include "sound/c140.h"
|
||||
#include "video/c45.h"
|
||||
#include "machine/namco65.h"
|
||||
#include "machine/namco68.h"
|
||||
#include "video/namco_c355spr.h"
|
||||
#include "video/namcos2_sprite.h"
|
||||
#include "video/namcos2_roz.h"
|
||||
|
||||
|
||||
#define NAMCOS21_POLY_FRAME_WIDTH 496
|
||||
#define NAMCOS21_POLY_FRAME_HEIGHT 480
|
||||
|
||||
#define WINRUN_MAX_POLY_PARAM (1+256*3)
|
||||
|
||||
#define NAMCOS21_NUM_COLORS 0x8000
|
||||
|
||||
#define DSP_BUF_MAX (4096*12)
|
||||
struct dsp_state
|
||||
{
|
||||
@ -46,12 +59,38 @@ struct edge
|
||||
};
|
||||
|
||||
|
||||
class namcos21_state : public namcos2_shared_state
|
||||
class namcos21_state : public driver_device
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{ /* Namco System21 */
|
||||
NAMCOS21_AIRCOMBAT = 0x4000,
|
||||
NAMCOS21_STARBLADE,
|
||||
NAMCOS21_CYBERSLED,
|
||||
NAMCOS21_SOLVALOU,
|
||||
NAMCOS21_WINRUN91,
|
||||
NAMCOS21_DRIVERS_EYES,
|
||||
};
|
||||
|
||||
namcos21_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
namcos2_shared_state(mconfig, type, tag),
|
||||
driver_device(mconfig, type, tag),
|
||||
m_master_dsp_code(*this,"master_dsp_code"),
|
||||
m_gametype(0),
|
||||
m_dspmaster(*this, "dspmaster"),
|
||||
m_dspslave(*this, "dspslave"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_slave(*this, "slave"),
|
||||
m_c65(*this, "c65mcu"),
|
||||
m_c68(*this, "c68mcu"),
|
||||
m_sci(*this, "sci"),
|
||||
m_master_intc(*this, "master_intc"),
|
||||
m_slave_intc(*this, "slave_intc"),
|
||||
m_c140(*this, "c140"),
|
||||
m_c355spr(*this, "c355spr"),
|
||||
m_palette(*this, "palette"),
|
||||
m_screen(*this, "screen"),
|
||||
m_audiobank(*this, "audiobank"),
|
||||
m_winrun_dspbios(*this,"winrun_dspbios"),
|
||||
m_winrun_polydata(*this,"winrun_polydata"),
|
||||
m_dspram16(*this,"dspram16"),
|
||||
@ -80,7 +119,27 @@ public:
|
||||
void clear_poly_framebuffer();
|
||||
std::unique_ptr<dsp_state> m_mpDspState;
|
||||
|
||||
int m_gametype;
|
||||
|
||||
optional_device<cpu_device> m_dspmaster;
|
||||
optional_device<cpu_device> m_dspslave;
|
||||
|
||||
private:
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<cpu_device> m_audiocpu;
|
||||
optional_device<cpu_device> m_slave;
|
||||
optional_device<namcoc65_device> m_c65;
|
||||
optional_device<namcoc68_device> m_c68;
|
||||
optional_device<namco_c139_device> m_sci;
|
||||
optional_device<namco_c148_device> m_master_intc;
|
||||
optional_device<namco_c148_device> m_slave_intc;
|
||||
optional_device<c140_device> m_c140;
|
||||
optional_device<namco_c355spr_device> m_c355spr;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
optional_device<screen_device> m_screen;
|
||||
optional_memory_bank m_audiobank;
|
||||
|
||||
optional_shared_ptr<uint16_t> m_winrun_dspbios;
|
||||
optional_shared_ptr<uint16_t> m_winrun_polydata;
|
||||
optional_shared_ptr<uint16_t> m_dspram16;
|
||||
@ -179,12 +238,27 @@ private:
|
||||
DECLARE_WRITE16_MEMBER(winrun_gpu_videoram_w);
|
||||
DECLARE_READ16_MEMBER(winrun_gpu_videoram_r);
|
||||
|
||||
DECLARE_WRITE8_MEMBER( namcos2_68k_eeprom_w );
|
||||
DECLARE_READ8_MEMBER( namcos2_68k_eeprom_r );
|
||||
|
||||
DECLARE_WRITE8_MEMBER( namcos2_sound_bankselect_w );
|
||||
|
||||
DECLARE_WRITE8_MEMBER(sound_reset_w);
|
||||
DECLARE_WRITE8_MEMBER(system_reset_w);
|
||||
void reset_all_subcpus(int state);
|
||||
|
||||
// game type helpers
|
||||
bool is_system21();
|
||||
|
||||
std::unique_ptr<uint8_t[]> m_eeprom;
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(screen_scanline);
|
||||
|
||||
uint8_t m_gearbox_state;
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(driveyes_gearbox_r);
|
||||
|
||||
DECLARE_MACHINE_START(namcos21);
|
||||
DECLARE_MACHINE_RESET(namcos21);
|
||||
DECLARE_VIDEO_START(namcos21);
|
||||
uint32_t screen_update_namcos21(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_winrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
@ -205,6 +279,7 @@ private:
|
||||
void winrun_flush_poly();
|
||||
void init(int game_type);
|
||||
void configure_c65_namcos21(machine_config &config);
|
||||
void configure_c68_namcos21(machine_config &config);
|
||||
void common_map(address_map &map);
|
||||
void driveyes_common_map(address_map &map);
|
||||
void driveyes_master_map(address_map &map);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,6 @@ Namco System II
|
||||
#include "machine/nvram.h"
|
||||
|
||||
|
||||
void (*namcos2_kickstart)(running_machine &machine, int internal);
|
||||
|
||||
|
||||
READ16_MEMBER( namcos2_state::namcos2_finallap_prot_r )
|
||||
@ -69,42 +68,40 @@ READ16_MEMBER( namcos2_state::namcos2_finallap_prot_r )
|
||||
/* Perform basic machine initialisation */
|
||||
/*************************************************************/
|
||||
|
||||
#define m_eeprom_size 0x2000
|
||||
|
||||
WRITE8_MEMBER(namcos2_shared_state::sound_reset_w)
|
||||
// S2 copy
|
||||
|
||||
MACHINE_START_MEMBER(namcos2_state,namcos2)
|
||||
{
|
||||
if (data & 0x01)
|
||||
{
|
||||
/* Resume execution */
|
||||
m_audiocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
|
||||
m_maincpu->yield();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Suspend execution */
|
||||
m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
|
||||
}
|
||||
m_eeprom = std::make_unique<uint8_t[]>(0x2000);
|
||||
subdevice<nvram_device>("nvram")->set_base(m_eeprom.get(), 0x2000);
|
||||
|
||||
if (namcos2_kickstart != nullptr)
|
||||
if (m_audiobank)
|
||||
{
|
||||
//printf( "dspkick=0x%x\n", data );
|
||||
if (data & 0x04)
|
||||
{
|
||||
(*namcos2_kickstart)(machine(), 1);
|
||||
}
|
||||
uint32_t max = memregion("audiocpu")->bytes() / 0x4000;
|
||||
for (int i = 0; i < 0x10; i++)
|
||||
m_audiobank->configure_entry(i, memregion("audiocpu")->base() + (i % max) * 0x4000);
|
||||
|
||||
m_audiobank->set_entry(0);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO:
|
||||
WRITE8_MEMBER(namcos2_shared_state::system_reset_w)
|
||||
MACHINE_RESET_MEMBER(namcos2_state, namcos2)
|
||||
{
|
||||
reset_all_subcpus(data & 1 ? CLEAR_LINE : ASSERT_LINE);
|
||||
// address_space &space = m_maincpu->space(AS_PROGRAM);
|
||||
address_space &audio_space = m_audiocpu->space(AS_PROGRAM);
|
||||
|
||||
if (data & 0x01)
|
||||
m_maincpu->yield();
|
||||
/* Initialise the bank select in the sound CPU */
|
||||
namcos2_sound_bankselect_w(audio_space, 0, 0); /* Page in bank 0 */
|
||||
|
||||
m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE );
|
||||
|
||||
/* Place CPU2 & CPU3 into the reset condition */
|
||||
reset_all_subcpus(ASSERT_LINE);
|
||||
}
|
||||
|
||||
void namcos2_shared_state::reset_all_subcpus(int state)
|
||||
|
||||
void namcos2_state::reset_all_subcpus(int state)
|
||||
{
|
||||
m_slave->set_input_line(INPUT_LINE_RESET, state);
|
||||
if (m_c68)
|
||||
@ -119,66 +116,41 @@ void namcos2_shared_state::reset_all_subcpus(int state)
|
||||
{
|
||||
logerror("no MCU to reset?\n");
|
||||
}
|
||||
}
|
||||
|
||||
switch( m_gametype )
|
||||
WRITE8_MEMBER(namcos2_state::sound_reset_w)
|
||||
{
|
||||
if (data & 0x01)
|
||||
{
|
||||
case NAMCOS21_SOLVALOU:
|
||||
case NAMCOS21_STARBLADE:
|
||||
case NAMCOS21_AIRCOMBAT:
|
||||
case NAMCOS21_CYBERSLED:
|
||||
m_dspmaster->set_input_line(INPUT_LINE_RESET, state);
|
||||
m_dspslave->set_input_line(INPUT_LINE_RESET, state);
|
||||
break;
|
||||
|
||||
// case NAMCOS21_WINRUN91:
|
||||
// case NAMCOS21_DRIVERS_EYES:
|
||||
default:
|
||||
break;
|
||||
/* Resume execution */
|
||||
m_audiocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
|
||||
m_maincpu->yield();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Suspend execution */
|
||||
m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
MACHINE_START_MEMBER(namcos2_shared_state,namcos2)
|
||||
WRITE8_MEMBER(namcos2_state::system_reset_w)
|
||||
{
|
||||
namcos2_kickstart = nullptr;
|
||||
m_eeprom = std::make_unique<uint8_t[]>(m_eeprom_size);
|
||||
subdevice<nvram_device>("nvram")->set_base(m_eeprom.get(), m_eeprom_size);
|
||||
reset_all_subcpus(data & 1 ? CLEAR_LINE : ASSERT_LINE);
|
||||
|
||||
if (m_audiobank)
|
||||
{
|
||||
uint32_t max = memregion("audiocpu")->bytes() / 0x4000;
|
||||
for (int i = 0; i < 0x10; i++)
|
||||
m_audiobank->configure_entry(i, memregion("audiocpu")->base() + (i % max) * 0x4000);
|
||||
|
||||
m_audiobank->set_entry(0);
|
||||
}
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(namcos2_shared_state, namcos2)
|
||||
{
|
||||
// address_space &space = m_maincpu->space(AS_PROGRAM);
|
||||
address_space &audio_space = m_audiocpu->space(AS_PROGRAM);
|
||||
|
||||
/* Initialise the bank select in the sound CPU */
|
||||
namcos2_sound_bankselect_w(audio_space, 0, 0); /* Page in bank 0 */
|
||||
|
||||
m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE );
|
||||
|
||||
/* Place CPU2 & CPU3 into the reset condition */
|
||||
reset_all_subcpus(ASSERT_LINE);
|
||||
|
||||
m_player_mux = 0;
|
||||
if (data & 0x01)
|
||||
m_maincpu->yield();
|
||||
}
|
||||
|
||||
/*************************************************************/
|
||||
/* EEPROM Load/Save and read/write handling */
|
||||
/*************************************************************/
|
||||
|
||||
WRITE8_MEMBER( namcos2_shared_state::namcos2_68k_eeprom_w )
|
||||
WRITE8_MEMBER( namcos2_state::namcos2_68k_eeprom_w )
|
||||
{
|
||||
m_eeprom[offset] = data;
|
||||
}
|
||||
|
||||
READ8_MEMBER( namcos2_shared_state::namcos2_68k_eeprom_r )
|
||||
READ8_MEMBER( namcos2_state::namcos2_68k_eeprom_r )
|
||||
{
|
||||
return m_eeprom[offset];
|
||||
}
|
||||
@ -420,28 +392,12 @@ WRITE16_MEMBER( namcos2_state::namcos2_68k_key_w )
|
||||
#define LINE_LENGTH (FRAME_TIME/NO_OF_LINES)
|
||||
|
||||
|
||||
bool namcos2_shared_state::is_system21()
|
||||
{
|
||||
switch (m_gametype)
|
||||
{
|
||||
case NAMCOS21_AIRCOMBAT:
|
||||
case NAMCOS21_STARBLADE:
|
||||
case NAMCOS21_CYBERSLED:
|
||||
case NAMCOS21_SOLVALOU:
|
||||
case NAMCOS21_WINRUN91:
|
||||
case NAMCOS21_DRIVERS_EYES:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************/
|
||||
/* Sound sub-system */
|
||||
/**************************************************************/
|
||||
|
||||
WRITE8_MEMBER( namcos2_shared_state::namcos2_sound_bankselect_w )
|
||||
WRITE8_MEMBER( namcos2_state::namcos2_sound_bankselect_w )
|
||||
{
|
||||
m_audiobank->set_entry(data>>4);
|
||||
}
|
||||
|
@ -29137,6 +29137,7 @@ finallapjb // 87.12 Final Lap
|
||||
finallapjc // 87.12 Final Lap
|
||||
finehour // (c) 1989 (Japan)
|
||||
fourtrax // 89.11
|
||||
fourtraxj // 89.11
|
||||
fourtraxa // 89.11
|
||||
gollygho // 91.7 Golly Ghost
|
||||
kyukaidk // (c) 1990 (Japan, new version)
|
||||
|
185
src/mame/video/namco_c123tmap.cpp
Normal file
185
src/mame/video/namco_c123tmap.cpp
Normal file
@ -0,0 +1,185 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood, Phil Stroffolino
|
||||
|
||||
/*
|
||||
C123 Tilemaps
|
||||
used by
|
||||
namcos2.cpp (all games)
|
||||
namcofl.cpp (all games)
|
||||
namconb1.cpp (all games)
|
||||
|
||||
should be used by
|
||||
namcos1.cpp (all games)
|
||||
|
||||
(TODO: merge with namcos1.cpp implementation)
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "namco_c123tmap.h"
|
||||
|
||||
DEFINE_DEVICE_TYPE(NAMCO_C123TMAP, namco_c123tmap_device, "namco_c123tmap", "Namco C123 (4x + 2x Tilemaps)")
|
||||
|
||||
namco_c123tmap_device::namco_c123tmap_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
|
||||
device_t(mconfig, NAMCO_C123TMAP, tag, owner, clock),
|
||||
m_gfxdecode(*this, finder_base::DUMMY_TAG),
|
||||
m_maskregion(*this, finder_base::DUMMY_TAG)
|
||||
{
|
||||
}
|
||||
|
||||
void namco_c123tmap_device::device_start()
|
||||
{
|
||||
m_tilemapinfo.maskBaseAddr = m_maskregion->base();
|
||||
|
||||
m_tilemapinfo.videoram = std::make_unique<uint16_t[]>(0x10000);
|
||||
|
||||
/* four scrolling tilemaps */
|
||||
m_tilemapinfo.tmap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(namco_c123tmap_device::get_tile_info<0x0000>), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||
m_tilemapinfo.tmap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(namco_c123tmap_device::get_tile_info<0x1000>), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||
m_tilemapinfo.tmap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(namco_c123tmap_device::get_tile_info<0x2000>), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||
m_tilemapinfo.tmap[3] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(namco_c123tmap_device::get_tile_info<0x3000>), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||
|
||||
/* two non-scrolling tilemaps */
|
||||
m_tilemapinfo.tmap[4] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(namco_c123tmap_device::get_tile_info<0x4008>), this), TILEMAP_SCAN_ROWS, 8, 8, 36, 28);
|
||||
m_tilemapinfo.tmap[5] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(namco_c123tmap_device::get_tile_info<0x4408>), this), TILEMAP_SCAN_ROWS, 8, 8, 36, 28);
|
||||
|
||||
/* define offsets for scrolling */
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
static const int adj[4] = { 4,2,1,0 };
|
||||
int dx = 44 + adj[i];
|
||||
m_tilemapinfo.tmap[i]->set_scrolldx(-dx, 288 + dx);
|
||||
m_tilemapinfo.tmap[i]->set_scrolldy(-24, 224 + 24);
|
||||
}
|
||||
|
||||
|
||||
save_item(NAME(m_tilemapinfo.control));
|
||||
save_pointer(NAME(m_tilemapinfo.videoram), 0x10000);
|
||||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
void namco_c123tmap_device::mark_all_dirty(void)
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
m_tilemapinfo.tmap[i]->mark_all_dirty();
|
||||
}
|
||||
} /* namco_tilemap_invalidate */
|
||||
|
||||
template<int Offset>
|
||||
TILE_GET_INFO_MEMBER(namco_c123tmap_device::get_tile_info)
|
||||
{
|
||||
const uint16_t *vram = &m_tilemapinfo.videoram[Offset];
|
||||
int tile, mask;
|
||||
m_tilemapinfo.cb(vram[tile_index], &tile, &mask);
|
||||
tileinfo.mask_data = m_tilemapinfo.maskBaseAddr + mask * 8;
|
||||
SET_TILE_INFO_MEMBER(m_tilemapinfo.gfxbank, tile, 0, 0);
|
||||
} /* get_tile_info */
|
||||
|
||||
void namco_c123tmap_device::draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri)
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
/* note: priority is only in range 0..7, but Point Blank uses 0xf to hide a layer */
|
||||
if ((m_tilemapinfo.control[0x20 / 2 + i] & 0xf) == pri)
|
||||
{
|
||||
int color = m_tilemapinfo.control[0x30 / 2 + i] & 0x07;
|
||||
m_tilemapinfo.tmap[i]->set_palette_offset(color * 256);
|
||||
m_tilemapinfo.tmap[i]->draw(screen, bitmap, cliprect, 0, 0);
|
||||
}
|
||||
}
|
||||
} /* draw */
|
||||
|
||||
void namco_c123tmap_device::set_tilemap_videoram(int offset, uint16_t newword)
|
||||
{
|
||||
m_tilemapinfo.videoram[offset] = newword;
|
||||
if (offset < 0x4000)
|
||||
{
|
||||
m_tilemapinfo.tmap[offset >> 12]->mark_tile_dirty(offset & 0xfff);
|
||||
}
|
||||
else if (offset >= 0x8010 / 2 && offset < 0x87f0 / 2)
|
||||
{ /* fixed plane#1 */
|
||||
offset -= 0x8010 / 2;
|
||||
m_tilemapinfo.tmap[4]->mark_tile_dirty(offset);
|
||||
}
|
||||
else if (offset >= 0x8810 / 2 && offset < 0x8ff0 / 2)
|
||||
{ /* fixed plane#2 */
|
||||
offset -= 0x8810 / 2;
|
||||
m_tilemapinfo.tmap[5]->mark_tile_dirty(offset);
|
||||
}
|
||||
} /* SetTilemapVideoram */
|
||||
|
||||
WRITE16_MEMBER(namco_c123tmap_device::videoram_w)
|
||||
{
|
||||
uint16_t newword = m_tilemapinfo.videoram[offset];
|
||||
COMBINE_DATA(&newword);
|
||||
set_tilemap_videoram(offset, newword);
|
||||
}
|
||||
|
||||
READ16_MEMBER(namco_c123tmap_device::videoram_r)
|
||||
{
|
||||
return m_tilemapinfo.videoram[offset];
|
||||
}
|
||||
|
||||
void namco_c123tmap_device::set_tilemap_control(int offset, uint16_t newword)
|
||||
{
|
||||
m_tilemapinfo.control[offset] = newword;
|
||||
if (offset < 0x20 / 2)
|
||||
{
|
||||
if (offset == 0x02 / 2)
|
||||
{
|
||||
/* all planes are flipped X+Y from D15 of this word */
|
||||
int attrs = (newword & 0x8000) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
|
||||
int i;
|
||||
for (i = 0; i <= 5; i++)
|
||||
{
|
||||
m_tilemapinfo.tmap[i]->set_flip(attrs);
|
||||
}
|
||||
}
|
||||
}
|
||||
newword &= 0x1ff;
|
||||
if (m_tilemapinfo.control[0x02 / 2] & 0x8000)
|
||||
{
|
||||
newword = -newword;
|
||||
}
|
||||
switch (offset)
|
||||
{
|
||||
case 0x02 / 2:
|
||||
m_tilemapinfo.tmap[0]->set_scrollx(0, newword);
|
||||
break;
|
||||
case 0x06 / 2:
|
||||
m_tilemapinfo.tmap[0]->set_scrolly(0, newword);
|
||||
break;
|
||||
case 0x0a / 2:
|
||||
m_tilemapinfo.tmap[1]->set_scrollx(0, newword);
|
||||
break;
|
||||
case 0x0e / 2:
|
||||
m_tilemapinfo.tmap[1]->set_scrolly(0, newword);
|
||||
break;
|
||||
case 0x12 / 2:
|
||||
m_tilemapinfo.tmap[2]->set_scrollx(0, newword);
|
||||
break;
|
||||
case 0x16 / 2:
|
||||
m_tilemapinfo.tmap[2]->set_scrolly(0, newword);
|
||||
break;
|
||||
case 0x1a / 2:
|
||||
m_tilemapinfo.tmap[3]->set_scrollx(0, newword);
|
||||
break;
|
||||
case 0x1e / 2:
|
||||
m_tilemapinfo.tmap[3]->set_scrolly(0, newword);
|
||||
break;
|
||||
}
|
||||
} /* SetTilemapControl */
|
||||
|
||||
WRITE16_MEMBER(namco_c123tmap_device::control_w)
|
||||
{
|
||||
uint16_t newword = m_tilemapinfo.control[offset];
|
||||
COMBINE_DATA(&newword);
|
||||
set_tilemap_control(offset, newword);
|
||||
}
|
||||
|
||||
READ16_MEMBER(namco_c123tmap_device::control_r)
|
||||
{
|
||||
return m_tilemapinfo.control[offset];
|
||||
}
|
||||
|
74
src/mame/video/namco_c123tmap.h
Normal file
74
src/mame/video/namco_c123tmap.h
Normal file
@ -0,0 +1,74 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#ifndef MAME_VIDEO_NAMCO_C123TMAP_H
|
||||
#define MAME_VIDEO_NAMCO_C123TMAP_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "screen.h"
|
||||
#include "emupal.h"
|
||||
|
||||
class namco_c123tmap_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
namco_c123tmap_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
template <typename T> void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward<T>(tag)); }
|
||||
template <typename T> void set_maskregion_tag(T &&tag) { m_maskregion.set_tag(std::forward<T>(tag)); }
|
||||
void set_gfxregion(int region) { m_tilemapinfo.gfxbank = region; }
|
||||
|
||||
typedef delegate<void(uint16_t, int*, int*)> c123_tilemap_delegate;
|
||||
void set_tile_callback(c123_tilemap_delegate tilemap_cb) { m_tilemapinfo.cb = tilemap_cb; }
|
||||
|
||||
DECLARE_WRITE16_MEMBER(videoram_w);
|
||||
DECLARE_READ16_MEMBER(videoram_r);
|
||||
DECLARE_WRITE16_MEMBER(control_w);
|
||||
DECLARE_READ16_MEMBER(control_r);
|
||||
|
||||
void mark_all_dirty(void);
|
||||
void draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
template<int Offset> TILE_GET_INFO_MEMBER(get_tile_info);
|
||||
void set_tilemap_videoram(int offset, uint16_t newword);
|
||||
void set_tilemap_control(int offset, uint16_t newword);
|
||||
|
||||
struct info
|
||||
{
|
||||
uint16_t control[0x40 / 2];
|
||||
/**
|
||||
* [0x1] 0x02/2 tilemap#0.scrollx
|
||||
* [0x3] 0x06/2 tilemap#0.scrolly
|
||||
* [0x5] 0x0a/2 tilemap#1.scrollx
|
||||
* [0x7] 0x0e/2 tilemap#1.scrolly
|
||||
* [0x9] 0x12/2 tilemap#2.scrollx
|
||||
* [0xb] 0x16/2 tilemap#2.scrolly
|
||||
* [0xd] 0x1a/2 tilemap#3.scrollx
|
||||
* [0xf] 0x1e/2 tilemap#3.scrolly
|
||||
* 0x20/2 priority
|
||||
* 0x30/2 color
|
||||
*/
|
||||
tilemap_t *tmap[6];
|
||||
std::unique_ptr<uint16_t[]> videoram;
|
||||
int gfxbank;
|
||||
uint8_t *maskBaseAddr;
|
||||
c123_tilemap_delegate cb;
|
||||
};
|
||||
|
||||
info m_tilemapinfo;
|
||||
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_memory_region m_maskregion;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(NAMCO_C123TMAP, namco_c123tmap_device)
|
||||
|
||||
#endif // MAME_VIDEO_NAMCO_C123TMAP_H
|
||||
|
264
src/mame/video/namco_c169roz.cpp
Normal file
264
src/mame/video/namco_c169roz.cpp
Normal file
@ -0,0 +1,264 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood, Phil Stroffolino
|
||||
/******************************************************************************
|
||||
|
||||
Namco C169 (ROZ - Rotate and Zoom)
|
||||
|
||||
Advanced rotate-zoom chip manages two layers.
|
||||
Each layer uses a designated subset of a master 256x256 tile tilemap (4096x4096 pixels).
|
||||
Each layer has configurable color and tile banking.
|
||||
ROZ attributes may be specified independently for each scanline.
|
||||
|
||||
Used by:
|
||||
Namco NB2 - The Outfoxies, Mach Breakers
|
||||
Namco System 2 - Metal Hawk, Lucky and Wild
|
||||
Namco System FL - Final Lap R, Speed Racer
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "namco_c169roz.h"
|
||||
|
||||
DEFINE_DEVICE_TYPE(NAMCO_C169ROZ, namco_c169roz_device, "namco_c169roz", "Namco C169 (ROZ)")
|
||||
|
||||
namco_c169roz_device::namco_c169roz_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
|
||||
device_t(mconfig, NAMCO_C169ROZ, tag, owner, clock),
|
||||
m_gfx_region(0),
|
||||
m_mask(nullptr),
|
||||
m_is_namcofl(false),
|
||||
m_gfxdecode(*this, finder_base::DUMMY_TAG),
|
||||
m_maskregion(*this, finder_base::DUMMY_TAG)
|
||||
{
|
||||
}
|
||||
|
||||
void namco_c169roz_device::device_start()
|
||||
{
|
||||
m_mask = m_maskregion->base();
|
||||
|
||||
m_videoram.resize(m_ramsize);
|
||||
std::fill(std::begin(m_videoram), std::end(m_videoram), 0x0000);
|
||||
|
||||
m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode,
|
||||
tilemap_get_info_delegate(FUNC(namco_c169roz_device::get_info<0>), this),
|
||||
tilemap_mapper_delegate(FUNC(namco_c169roz_device::mapper), this),
|
||||
16, 16,
|
||||
256, 256);
|
||||
|
||||
m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode,
|
||||
tilemap_get_info_delegate(FUNC(namco_c169roz_device::get_info<1>), this),
|
||||
tilemap_mapper_delegate(FUNC(namco_c169roz_device::mapper), this),
|
||||
16, 16,
|
||||
256, 256);
|
||||
|
||||
save_item(NAME(m_control));
|
||||
save_item(NAME(m_videoram));
|
||||
}
|
||||
|
||||
|
||||
// for bank changes
|
||||
void namco_c169roz_device::mark_all_dirty()
|
||||
{
|
||||
for (auto & elem : m_tilemap)
|
||||
elem->mark_all_dirty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Graphics ROM addressing varies across games.
|
||||
* (mostly scrambling, which could be handled in the game inits, but NB1 also has banking)
|
||||
*/
|
||||
template<int Which>
|
||||
TILE_GET_INFO_MEMBER(namco_c169roz_device::get_info)
|
||||
{
|
||||
int tile = 0, mask = 0;
|
||||
m_c169_cb(m_videoram[tile_index&(m_ramsize-1)] & 0x3fff, &tile, &mask, Which); // need to mask with ramsize because the nb1/fl games have twice as much RAM, presumably the tilemaps mirror in ns2?
|
||||
|
||||
tileinfo.mask_data = m_mask + 32 * mask;
|
||||
SET_TILE_INFO_MEMBER(m_gfx_region, tile, 0/*color*/, 0/*flag*/);
|
||||
}
|
||||
|
||||
TILEMAP_MAPPER_MEMBER( namco_c169roz_device::mapper )
|
||||
{
|
||||
return ((col & 0x80) << 8) | ((row & 0xff) << 7) | (col & 0x7f);
|
||||
}
|
||||
|
||||
void namco_c169roz_device::unpack_params(const uint16_t *source, roz_parameters ¶ms)
|
||||
{
|
||||
const int xoffset = 36, yoffset = 3;
|
||||
|
||||
/**
|
||||
* x-------.-------- disable layer
|
||||
* ----x---.-------- wrap?
|
||||
* ------xx.-------- size
|
||||
* --------.xxxx---- priority
|
||||
* --------.----xxxx color
|
||||
*/
|
||||
|
||||
uint16_t temp = source[1];
|
||||
params.wrap = BIT(~temp, 11);
|
||||
params.size = 512 << ((temp & 0x0300) >> 8);
|
||||
if (m_is_namcofl)
|
||||
params.color = (temp & 0x0007) * 256;
|
||||
else
|
||||
params.color = (temp & 0x000f) * 256;
|
||||
params.priority = (temp & 0x00f0) >> 4;
|
||||
|
||||
temp = source[2];
|
||||
params.left = (temp & 0x7000) >> 3;
|
||||
if (temp & 0x8000) temp |= 0xf000; else temp &= 0x0fff; // sign extend
|
||||
params.incxx = int16_t(temp);
|
||||
|
||||
temp = source[3];
|
||||
params.top = (temp&0x7000)>>3;
|
||||
if (temp & 0x8000) temp |= 0xf000; else temp &= 0x0fff; // sign extend
|
||||
params.incxy = int16_t(temp);
|
||||
|
||||
temp = source[4];
|
||||
if (temp & 0x8000) temp |= 0xf000; else temp &= 0x0fff; // sign extend
|
||||
params.incyx = int16_t(temp);
|
||||
|
||||
temp = source[5];
|
||||
if (temp & 0x8000) temp |= 0xf000; else temp &= 0x0fff; // sign extend
|
||||
params.incyy = int16_t(temp);
|
||||
|
||||
params.startx = int16_t(source[6]);
|
||||
params.starty = int16_t(source[7]);
|
||||
params.startx <<= 4;
|
||||
params.starty <<= 4;
|
||||
|
||||
params.startx += xoffset * params.incxx + yoffset * params.incyx;
|
||||
params.starty += xoffset * params.incxy + yoffset * params.incyy;
|
||||
|
||||
// normalize
|
||||
params.startx <<= 8;
|
||||
params.starty <<= 8;
|
||||
params.incxx <<= 8;
|
||||
params.incxy <<= 8;
|
||||
params.incyx <<= 8;
|
||||
params.incyy <<= 8;
|
||||
}
|
||||
|
||||
void namco_c169roz_device::draw_helper(screen_device &screen, bitmap_ind16 &bitmap, tilemap_t &tmap, const rectangle &clip, const roz_parameters ¶ms)
|
||||
{
|
||||
if (!m_is_namcofl)
|
||||
// if (m_gametype != NAMCOFL_FINAL_LAP_R) // Fix speedrcr some title animations, but broke at road scene
|
||||
{
|
||||
uint32_t size_mask = params.size - 1;
|
||||
bitmap_ind16 &srcbitmap = tmap.pixmap();
|
||||
bitmap_ind8 &flagsbitmap = tmap.flagsmap();
|
||||
uint32_t startx = params.startx + clip.min_x * params.incxx + clip.min_y * params.incyx;
|
||||
uint32_t starty = params.starty + clip.min_x * params.incxy + clip.min_y * params.incyy;
|
||||
int sx = clip.min_x;
|
||||
int sy = clip.min_y;
|
||||
while (sy <= clip.max_y)
|
||||
{
|
||||
int x = sx;
|
||||
uint32_t cx = startx;
|
||||
uint32_t cy = starty;
|
||||
uint16_t *dest = &bitmap.pix(sy, sx);
|
||||
while (x <= clip.max_x)
|
||||
{ // TODO : Wraparound disable isn't implemented
|
||||
uint32_t xpos = (((cx >> 16) & size_mask) + params.left) & 0xfff;
|
||||
uint32_t ypos = (((cy >> 16) & size_mask) + params.top) & 0xfff;
|
||||
if (flagsbitmap.pix(ypos, xpos) & TILEMAP_PIXEL_LAYER0)
|
||||
*dest = srcbitmap.pix(ypos, xpos) + params.color;
|
||||
cx += params.incxx;
|
||||
cy += params.incxy;
|
||||
x++;
|
||||
dest++;
|
||||
}
|
||||
startx += params.incyx;
|
||||
starty += params.incyy;
|
||||
sy++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tmap.set_palette_offset(params.color);
|
||||
tmap.draw_roz(
|
||||
screen,
|
||||
bitmap,
|
||||
clip,
|
||||
params.startx, params.starty,
|
||||
params.incxx, params.incxy,
|
||||
params.incyx, params.incyy,
|
||||
params.wrap,0,0); // wrap, flags, pri
|
||||
}
|
||||
}
|
||||
|
||||
void namco_c169roz_device::draw_scanline(screen_device &screen, bitmap_ind16 &bitmap, int line, int which, int pri, const rectangle &cliprect)
|
||||
{
|
||||
if (line >= cliprect.min_y && line <= cliprect.max_y)
|
||||
{
|
||||
int row = line / 8;
|
||||
int offs = row * 0x100 + (line & 7) * 0x10 + 0xe080;
|
||||
uint16_t *source = &m_videoram[offs / 2];
|
||||
|
||||
// if enabled
|
||||
if ((source[1] & 0x8000) == 0)
|
||||
{
|
||||
roz_parameters params;
|
||||
unpack_params(source, params);
|
||||
|
||||
// check priority
|
||||
if (pri == params.priority)
|
||||
{
|
||||
rectangle clip(0, bitmap.width() - 1, line, line);
|
||||
clip &= cliprect;
|
||||
draw_helper(screen, bitmap, *m_tilemap[which], clip, params);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void namco_c169roz_device::draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri)
|
||||
{
|
||||
int special = (m_is_namcofl) ? 0 : 1;
|
||||
int mode = m_control[0]; // 0x8000 or 0x1000
|
||||
|
||||
for (int which = 1; which >= 0; which--)
|
||||
{
|
||||
const uint16_t *source = &m_control[which * 8];
|
||||
uint16_t attrs = source[1];
|
||||
|
||||
// if enabled
|
||||
if ((attrs & 0x8000) == 0)
|
||||
{
|
||||
// second ROZ layer is configured to use per-scanline registers
|
||||
if (which == special && mode == 0x8000)
|
||||
{
|
||||
for (int line = cliprect.min_y; line <= cliprect.max_y; line++)
|
||||
draw_scanline(screen, bitmap, line, which, pri, cliprect);
|
||||
}
|
||||
else
|
||||
{
|
||||
roz_parameters params;
|
||||
unpack_params(source, params);
|
||||
if (params.priority == pri)
|
||||
draw_helper(screen, bitmap, *m_tilemap[which], cliprect, params);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
READ16_MEMBER( namco_c169roz_device::control_r )
|
||||
{
|
||||
return m_control[offset];
|
||||
}
|
||||
|
||||
WRITE16_MEMBER( namco_c169roz_device::control_w )
|
||||
{
|
||||
COMBINE_DATA(&m_control[offset]);
|
||||
}
|
||||
|
||||
READ16_MEMBER( namco_c169roz_device::videoram_r )
|
||||
{
|
||||
return m_videoram[offset];
|
||||
}
|
||||
|
||||
WRITE16_MEMBER( namco_c169roz_device::videoram_w )
|
||||
{
|
||||
COMBINE_DATA(&m_videoram[offset]);
|
||||
for (auto & elem : m_tilemap)
|
||||
elem->mark_tile_dirty(offset);
|
||||
}
|
||||
|
74
src/mame/video/namco_c169roz.h
Normal file
74
src/mame/video/namco_c169roz.h
Normal file
@ -0,0 +1,74 @@
|
||||
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#ifndef MAME_VIDEO_NAMCO_C169ROZ_H
|
||||
#define MAME_VIDEO_NAMCO_C169ROZ_H
|
||||
|
||||
#pragma once
|
||||
|
||||
class namco_c169roz_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
namco_c169roz_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
template <typename T> void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward<T>(tag)); }
|
||||
void set_is_namcofl(bool state) { m_is_namcofl = state; }
|
||||
void set_ram_words(uint32_t size) { m_ramsize = size; }
|
||||
template <typename T> void set_maskregion_tag(T &&tag) { m_maskregion.set_tag(std::forward<T>(tag)); }
|
||||
void set_gfxregion(int region) { m_gfx_region = region; }
|
||||
|
||||
DECLARE_READ16_MEMBER( control_r );
|
||||
DECLARE_WRITE16_MEMBER( control_w );
|
||||
DECLARE_READ16_MEMBER( videoram_r );
|
||||
DECLARE_WRITE16_MEMBER( videoram_w );
|
||||
|
||||
typedef delegate<void (uint16_t, int*, int*, int)> c169_tilemap_delegate;
|
||||
void set_tile_callback(c169_tilemap_delegate tilemap_cb) { m_c169_cb = tilemap_cb; }
|
||||
|
||||
void draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri);
|
||||
void mark_all_dirty();
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
|
||||
c169_tilemap_delegate m_c169_cb;
|
||||
struct roz_parameters
|
||||
{
|
||||
uint32_t left, top, size;
|
||||
uint32_t startx, starty;
|
||||
int incxx, incxy, incyx, incyy;
|
||||
int color, priority;
|
||||
int wrap;
|
||||
};
|
||||
void unpack_params(const uint16_t *source, roz_parameters ¶ms);
|
||||
void draw_helper(screen_device &screen, bitmap_ind16 &bitmap, tilemap_t &tmap, const rectangle &clip, const roz_parameters ¶ms);
|
||||
void draw_scanline(screen_device &screen, bitmap_ind16 &bitmap, int line, int which, int pri, const rectangle &cliprect);
|
||||
void get_info(tile_data &tileinfo, int tile_index, int which);
|
||||
template<int Which> TILE_GET_INFO_MEMBER( get_info );
|
||||
TILEMAP_MAPPER_MEMBER( mapper );
|
||||
|
||||
static const int ROZ_TILEMAP_COUNT = 2;
|
||||
tilemap_t *m_tilemap[ROZ_TILEMAP_COUNT];
|
||||
uint16_t m_control[0x20/2];
|
||||
std::vector<uint16_t> m_videoram;
|
||||
int m_gfx_region;
|
||||
uint8_t *m_mask;
|
||||
uint32_t m_ramsize;
|
||||
|
||||
// per-game hacks
|
||||
bool m_is_namcofl;
|
||||
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_memory_region m_maskregion;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(NAMCO_C169ROZ, namco_c169roz_device)
|
||||
|
||||
#endif // MAME_VIDEO_NAMCO_C169ROZ_H
|
||||
|
450
src/mame/video/namco_c355spr.cpp
Normal file
450
src/mame/video/namco_c355spr.cpp
Normal file
@ -0,0 +1,450 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood, Phil Stroffolino
|
||||
|
||||
/*
|
||||
C355 Zooming sprites
|
||||
used by
|
||||
namcofl.cpp (all games)
|
||||
namconb1.cpp (all games)
|
||||
gal3.cpp (all games)
|
||||
namcos21.cpp (Driver's Eyes, Solvalou, Starblade, Air Combat, Cyber Sled) (everything except Winning Run series)
|
||||
namcos2.cpp (Steel Gunner, Steel Gunner 2, Lucky & Wild, Suzuka 8 Hours, Suzuka 8 Hours 2)
|
||||
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "namco_c355spr.h"
|
||||
|
||||
DEFINE_DEVICE_TYPE(NAMCO_C355SPR, namco_c355spr_device, "namco_c355spr", "Namco C355 (Sprites)")
|
||||
|
||||
namco_c355spr_device::namco_c355spr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
|
||||
device_t(mconfig, NAMCO_C355SPR, tag, owner, clock),
|
||||
m_gfx_region(0),
|
||||
m_palxor(0),
|
||||
m_is_namcofl(false),
|
||||
m_gfxdecode(*this, finder_base::DUMMY_TAG),
|
||||
m_palette(*this, finder_base::DUMMY_TAG)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
void namco_c355spr_device::zdrawgfxzoom(
|
||||
screen_device &screen,
|
||||
bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_element *gfx,
|
||||
uint32_t code,uint32_t color,int flipx,int flipy,int sx,int sy,
|
||||
int scalex, int scaley, int zpos )
|
||||
{
|
||||
if (!scalex || !scaley) return;
|
||||
if (dest_bmp.bpp() == 16)
|
||||
{
|
||||
if( gfx )
|
||||
{
|
||||
int shadow_offset = (m_palette->shadows_enabled())?m_palette->entries():0;
|
||||
const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
|
||||
const uint8_t *source_base = gfx->get_data(code % gfx->elements());
|
||||
int sprite_screen_height = (scaley*gfx->height()+0x8000)>>16;
|
||||
int sprite_screen_width = (scalex*gfx->width()+0x8000)>>16;
|
||||
if (sprite_screen_width && sprite_screen_height)
|
||||
{
|
||||
/* compute sprite increment per screen pixel */
|
||||
int dx = (gfx->width()<<16)/sprite_screen_width;
|
||||
int dy = (gfx->height()<<16)/sprite_screen_height;
|
||||
|
||||
int ex = sx+sprite_screen_width;
|
||||
int ey = sy+sprite_screen_height;
|
||||
|
||||
int x_index_base;
|
||||
int y_index;
|
||||
|
||||
if( flipx )
|
||||
{
|
||||
x_index_base = (sprite_screen_width-1)*dx;
|
||||
dx = -dx;
|
||||
}
|
||||
else
|
||||
{
|
||||
x_index_base = 0;
|
||||
}
|
||||
|
||||
if( flipy )
|
||||
{
|
||||
y_index = (sprite_screen_height-1)*dy;
|
||||
dy = -dy;
|
||||
}
|
||||
else
|
||||
{
|
||||
y_index = 0;
|
||||
}
|
||||
|
||||
if( sx < clip.min_x)
|
||||
{ /* clip left */
|
||||
int pixels = clip.min_x-sx;
|
||||
sx += pixels;
|
||||
x_index_base += pixels*dx;
|
||||
}
|
||||
if( sy < clip.min_y )
|
||||
{ /* clip top */
|
||||
int pixels = clip.min_y-sy;
|
||||
sy += pixels;
|
||||
y_index += pixels*dy;
|
||||
}
|
||||
if( ex > clip.max_x+1 )
|
||||
{ /* clip right */
|
||||
int pixels = ex-clip.max_x-1;
|
||||
ex -= pixels;
|
||||
}
|
||||
if( ey > clip.max_y+1 )
|
||||
{ /* clip bottom */
|
||||
int pixels = ey-clip.max_y-1;
|
||||
ey -= pixels;
|
||||
}
|
||||
|
||||
if( ex>sx )
|
||||
{ /* skip if inner loop doesn't draw anything */
|
||||
int y;
|
||||
bitmap_ind8 &priority_bitmap = screen.priority();
|
||||
if( priority_bitmap.valid() )
|
||||
{
|
||||
for( y=sy; y<ey; y++ )
|
||||
{
|
||||
const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes();
|
||||
uint16_t *dest = &dest_bmp.pix16(y);
|
||||
uint8_t *pri = &priority_bitmap.pix8(y);
|
||||
int x, x_index = x_index_base;
|
||||
if( m_palxor )
|
||||
{
|
||||
for( x=sx; x<ex; x++ )
|
||||
{
|
||||
int c = source[x_index>>16];
|
||||
if( c != 0xff )
|
||||
{
|
||||
if( pri[x]<=zpos )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
case 0:
|
||||
dest[x] = 0x4000|(dest[x]&0x1fff);
|
||||
break;
|
||||
case 1:
|
||||
dest[x] = 0x6000|(dest[x]&0x1fff);
|
||||
break;
|
||||
default:
|
||||
dest[x] = pal[c];
|
||||
break;
|
||||
}
|
||||
pri[x] = zpos;
|
||||
}
|
||||
}
|
||||
x_index += dx;
|
||||
}
|
||||
y_index += dy;
|
||||
}
|
||||
else
|
||||
{
|
||||
for( x=sx; x<ex; x++ )
|
||||
{
|
||||
int c = source[x_index>>16];
|
||||
if( c != 0xff )
|
||||
{
|
||||
if( pri[x]<=zpos )
|
||||
{
|
||||
if( color == 0xf && c==0xfe && shadow_offset )
|
||||
{
|
||||
dest[x] |= shadow_offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
dest[x] = pal[c];
|
||||
}
|
||||
pri[x] = zpos;
|
||||
}
|
||||
}
|
||||
x_index += dx;
|
||||
}
|
||||
y_index += dy;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* zdrawgfxzoom */
|
||||
|
||||
void namco_c355spr_device::zdrawgfxzoom(
|
||||
screen_device &screen,
|
||||
bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx,
|
||||
uint32_t code,uint32_t color,int flipx,int flipy,int sx,int sy,
|
||||
int scalex, int scaley, int zpos )
|
||||
{
|
||||
/* nop */
|
||||
}
|
||||
|
||||
void namco_c355spr_device::device_start()
|
||||
{
|
||||
//m_spriteram.resize(m_ramsize);
|
||||
std::fill(std::begin(m_spriteram), std::end(m_spriteram), 0x0000); // needed for Nebulas Ray
|
||||
std::fill(std::begin(m_position), std::end(m_position), 0x0000);
|
||||
|
||||
save_item(NAME(m_spriteram));
|
||||
save_item(NAME(m_position));
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
WRITE16_MEMBER( namco_c355spr_device::position_w )
|
||||
{
|
||||
COMBINE_DATA(&m_position[offset]);
|
||||
}
|
||||
READ16_MEMBER( namco_c355spr_device::position_r )
|
||||
{
|
||||
return m_position[offset];
|
||||
}
|
||||
|
||||
/**************************************************************************************************************/
|
||||
|
||||
/**
|
||||
* 0x00000 sprite attr (page0)
|
||||
* 0x02000 sprite list (page0)
|
||||
*
|
||||
* 0x02400 window attributes
|
||||
* 0x04000 format
|
||||
* 0x08000 tile
|
||||
* 0x10000 sprite attr (page1)
|
||||
* 0x14000 sprite list (page1)
|
||||
*/
|
||||
template<class _BitmapClass>
|
||||
void namco_c355spr_device::draw_sprite(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, const uint16_t *pSource, int pri, int zpos )
|
||||
{
|
||||
uint16_t *spriteram16 = m_spriteram;
|
||||
unsigned screen_height_remaining, screen_width_remaining;
|
||||
unsigned source_height_remaining, source_width_remaining;
|
||||
int hpos,vpos;
|
||||
uint16_t hsize,vsize;
|
||||
uint16_t palette;
|
||||
uint16_t linkno;
|
||||
uint16_t offset;
|
||||
uint16_t format;
|
||||
int tile_index;
|
||||
int num_cols,num_rows;
|
||||
int dx,dy;
|
||||
int row,col;
|
||||
int sx,sy,tile;
|
||||
int flipx,flipy;
|
||||
uint32_t zoomx, zoomy;
|
||||
int tile_screen_width;
|
||||
int tile_screen_height;
|
||||
const uint16_t *spriteformat16 = &spriteram16[0x4000/2];
|
||||
const uint16_t *spritetile16 = &spriteram16[0x8000/2];
|
||||
int color;
|
||||
const uint16_t *pWinAttr;
|
||||
rectangle clip;
|
||||
int xscroll, yscroll;
|
||||
|
||||
/**
|
||||
* ----xxxx-------- window select
|
||||
* --------xxxx---- priority
|
||||
* ------------xxxx palette select
|
||||
*/
|
||||
palette = pSource[6];
|
||||
if( pri != ((palette>>4)&0xf) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
linkno = pSource[0]; /* LINKNO */
|
||||
offset = pSource[1]; /* OFFSET */
|
||||
hpos = pSource[2]; /* HPOS 0x000..0x7ff (signed) */
|
||||
vpos = pSource[3]; /* VPOS 0x000..0x7ff (signed) */
|
||||
hsize = pSource[4]; /* HSIZE max 0x3ff pixels */
|
||||
vsize = pSource[5]; /* VSIZE max 0x3ff pixels */
|
||||
/* pSource[6] contains priority/palette */
|
||||
/* pSource[7] is used in Lucky & Wild, possibly for sprite-road priority */
|
||||
|
||||
if( linkno*4>=0x4000/2 ) return; /* avoid garbage memory reads */
|
||||
|
||||
xscroll = (int16_t)m_position[1];
|
||||
yscroll = (int16_t)m_position[0];
|
||||
|
||||
// xscroll &= 0x3ff; if( xscroll & 0x200 ) xscroll |= ~0x3ff;
|
||||
xscroll &= 0x1ff; if( xscroll & 0x100 ) xscroll |= ~0x1ff;
|
||||
yscroll &= 0x1ff; if( yscroll & 0x100 ) yscroll |= ~0x1ff;
|
||||
|
||||
if( bitmap.width() > 384 )
|
||||
{ /* Medium Resolution: System21 adjust */
|
||||
xscroll = (int16_t)m_position[1];
|
||||
xscroll &= 0x3ff; if( xscroll & 0x200 ) xscroll |= ~0x3ff;
|
||||
if( yscroll<0 )
|
||||
{ /* solvalou */
|
||||
yscroll += 0x20;
|
||||
}
|
||||
yscroll += 0x10;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_is_namcofl)
|
||||
{ /* Namco FL: don't adjust and things line up fine */
|
||||
}
|
||||
else
|
||||
{ /* Namco NB1, Namco System 2 */
|
||||
xscroll += 0x26;
|
||||
yscroll += 0x19;
|
||||
}
|
||||
}
|
||||
|
||||
hpos -= xscroll;
|
||||
vpos -= yscroll;
|
||||
pWinAttr = &spriteram16[0x2400/2+((palette>>8)&0xf)*4];
|
||||
clip.set(pWinAttr[0] - xscroll, pWinAttr[1] - xscroll, pWinAttr[2] - yscroll, pWinAttr[3] - yscroll);
|
||||
clip &= cliprect;
|
||||
hpos&=0x7ff; if( hpos&0x400 ) hpos |= ~0x7ff; /* sign extend */
|
||||
vpos&=0x7ff; if( vpos&0x400 ) vpos |= ~0x7ff; /* sign extend */
|
||||
|
||||
tile_index = spriteformat16[linkno*4+0];
|
||||
format = spriteformat16[linkno*4+1];
|
||||
dx = spriteformat16[linkno*4+2];
|
||||
dy = spriteformat16[linkno*4+3];
|
||||
num_cols = (format>>4)&0xf;
|
||||
num_rows = (format)&0xf;
|
||||
|
||||
if( num_cols == 0 ) num_cols = 0x10;
|
||||
flipx = (hsize&0x8000)?1:0;
|
||||
hsize &= 0x3ff;//0x1ff;
|
||||
if( hsize == 0 ) return;
|
||||
zoomx = (hsize<<16)/(num_cols*16);
|
||||
dx = (dx*zoomx+0x8000)>>16;
|
||||
if( flipx )
|
||||
{
|
||||
hpos += dx;
|
||||
}
|
||||
else
|
||||
{
|
||||
hpos -= dx;
|
||||
}
|
||||
|
||||
if( num_rows == 0 ) num_rows = 0x10;
|
||||
flipy = (vsize&0x8000)?1:0;
|
||||
vsize &= 0x3ff;
|
||||
if( vsize == 0 ) return;
|
||||
zoomy = (vsize<<16)/(num_rows*16);
|
||||
dy = (dy*zoomy+0x8000)>>16;
|
||||
if( flipy )
|
||||
{
|
||||
vpos += dy;
|
||||
}
|
||||
else
|
||||
{
|
||||
vpos -= dy;
|
||||
}
|
||||
|
||||
color = (palette&0xf)^m_palxor;
|
||||
|
||||
source_height_remaining = num_rows*16;
|
||||
screen_height_remaining = vsize;
|
||||
sy = vpos;
|
||||
for( row=0; row<num_rows; row++ )
|
||||
{
|
||||
tile_screen_height = 16*screen_height_remaining/source_height_remaining;
|
||||
zoomy = (screen_height_remaining<<16)/source_height_remaining;
|
||||
if( flipy )
|
||||
{
|
||||
sy -= tile_screen_height;
|
||||
}
|
||||
source_width_remaining = num_cols*16;
|
||||
screen_width_remaining = hsize;
|
||||
sx = hpos;
|
||||
for( col=0; col<num_cols; col++ )
|
||||
{
|
||||
tile_screen_width = 16*screen_width_remaining/source_width_remaining;
|
||||
zoomx = (screen_width_remaining<<16)/source_width_remaining;
|
||||
if( flipx )
|
||||
{
|
||||
sx -= tile_screen_width;
|
||||
}
|
||||
tile = spritetile16[tile_index++];
|
||||
if( (tile&0x8000)==0 )
|
||||
{
|
||||
zdrawgfxzoom(
|
||||
screen,
|
||||
bitmap,
|
||||
clip,
|
||||
m_gfxdecode->gfx(m_gfx_region),
|
||||
m_code2tile(tile) + offset,
|
||||
color,
|
||||
flipx,flipy,
|
||||
sx,sy,
|
||||
zoomx, zoomy, zpos );
|
||||
}
|
||||
if( !flipx )
|
||||
{
|
||||
sx += tile_screen_width;
|
||||
}
|
||||
screen_width_remaining -= tile_screen_width;
|
||||
source_width_remaining -= 16;
|
||||
} /* next col */
|
||||
if( !flipy )
|
||||
{
|
||||
sy += tile_screen_height;
|
||||
}
|
||||
screen_height_remaining -= tile_screen_height;
|
||||
source_height_remaining -= 16;
|
||||
} /* next row */
|
||||
}
|
||||
|
||||
|
||||
int namco_c355spr_device::default_code2tile(int code)
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
template<class _BitmapClass>
|
||||
void namco_c355spr_device::draw_list(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int pri, const uint16_t *pSpriteList16, const uint16_t *pSpriteTable)
|
||||
{
|
||||
int i;
|
||||
/* draw the sprites */
|
||||
for( i=0; i<256; i++ )
|
||||
{
|
||||
uint16_t which = pSpriteList16[i];
|
||||
draw_sprite(screen, bitmap, cliprect, &pSpriteTable[(which&0xff)*8], pri, i );
|
||||
if( which&0x100 ) break;
|
||||
}
|
||||
}
|
||||
|
||||
void namco_c355spr_device::draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri)
|
||||
{
|
||||
// int offs = spriteram16[0x18000/2]; /* end-of-sprite-list */
|
||||
if (pri == 0)
|
||||
screen.priority().fill(0, cliprect);
|
||||
|
||||
// if (offs == 0) // boot
|
||||
// TODO: solvalou service mode wants 0x14000/2 & 0x00000/2
|
||||
draw_list(screen, bitmap, cliprect, pri, &m_spriteram[0x02000/2], &m_spriteram[0x00000/2]);
|
||||
// else
|
||||
draw_list(screen, bitmap, cliprect, pri, &m_spriteram[0x14000/2], &m_spriteram[0x10000/2]);
|
||||
}
|
||||
|
||||
void namco_c355spr_device::draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int pri)
|
||||
{
|
||||
// int offs = spriteram16[0x18000/2]; /* end-of-sprite-list */
|
||||
if (pri == 0)
|
||||
screen.priority().fill(0, cliprect);
|
||||
|
||||
// if (offs == 0) // boot
|
||||
draw_list(screen, bitmap, cliprect, pri, &m_spriteram[0x02000/2], &m_spriteram[0x00000/2]);
|
||||
// else
|
||||
draw_list(screen, bitmap, cliprect, pri, &m_spriteram[0x14000/2], &m_spriteram[0x10000/2]);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER( namco_c355spr_device::spriteram_w )
|
||||
{
|
||||
COMBINE_DATA(&m_spriteram[offset]);
|
||||
}
|
||||
|
||||
READ16_MEMBER( namco_c355spr_device::spriteram_r )
|
||||
{
|
||||
return m_spriteram[offset];
|
||||
}
|
||||
|
81
src/mame/video/namco_c355spr.h
Normal file
81
src/mame/video/namco_c355spr.h
Normal file
@ -0,0 +1,81 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#ifndef MAME_VIDEO_NAMCO_C355SPR_H
|
||||
#define MAME_VIDEO_NAMCO_C355SPR_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "screen.h"
|
||||
#include "emupal.h"
|
||||
|
||||
class namco_c355spr_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
namco_c355spr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
template <typename T> void set_palette_tag(T &&tag) { m_palette.set_tag(std::forward<T>(tag)); }
|
||||
template <typename T> void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward<T>(tag)); }
|
||||
void set_is_namcofl(bool state) { m_is_namcofl = state; }
|
||||
//void set_ram_words(uint32_t size) { m_ramsize = size; }
|
||||
void set_palxor(int palxor) { m_palxor = palxor; }
|
||||
void set_gfxregion(int region) { m_gfx_region = region; }
|
||||
|
||||
DECLARE_READ16_MEMBER( spriteram_r );
|
||||
DECLARE_WRITE16_MEMBER( spriteram_w );
|
||||
DECLARE_READ16_MEMBER( position_r );
|
||||
DECLARE_WRITE16_MEMBER( position_w );
|
||||
|
||||
typedef delegate<int (int)> c355_obj_code2tile_delegate;
|
||||
void set_tile_callback(c355_obj_code2tile_delegate cb)
|
||||
{
|
||||
if (!cb.isnull())
|
||||
m_code2tile = cb;
|
||||
else
|
||||
m_code2tile = c355_obj_code2tile_delegate(&namco_c355spr_device::default_code2tile, this);
|
||||
}
|
||||
|
||||
void draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri);
|
||||
void draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int pri);
|
||||
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
|
||||
// general
|
||||
void zdrawgfxzoom(screen_device &screen, bitmap_ind16 &dest_bmp, const rectangle &clip, gfx_element *gfx, uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos);
|
||||
void zdrawgfxzoom(screen_device &screen, bitmap_rgb32 &dest_bmp, const rectangle &clip, gfx_element *gfx, uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos);
|
||||
|
||||
// C355 Motion Object Emulation
|
||||
// for pal_xor, supply either 0x0 (normal) or 0xf (palette mapping reversed)
|
||||
int default_code2tile(int code);
|
||||
|
||||
// C355 Motion Object internals
|
||||
template<class _BitmapClass>
|
||||
void draw_sprite(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, const uint16_t *pSource, int pri, int zpos);
|
||||
template<class _BitmapClass>
|
||||
void draw_list(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int pri, const uint16_t *pSpriteList16, const uint16_t *pSpriteTable);
|
||||
|
||||
c355_obj_code2tile_delegate m_code2tile;
|
||||
int m_gfx_region;
|
||||
int m_palxor;
|
||||
uint16_t m_position[4];
|
||||
uint16_t m_spriteram[0x20000/2];
|
||||
//std::vector<uint16_t> m_spriteram;
|
||||
|
||||
bool m_is_namcofl;
|
||||
//uint32_t m_ramsize;
|
||||
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(NAMCO_C355SPR, namco_c355spr_device)
|
||||
|
||||
#endif // MAME_VIDEO_NAMCO_C355SPR_H
|
||||
|
@ -5,9 +5,6 @@
|
||||
#include "emu.h"
|
||||
#include "includes/namcofl.h"
|
||||
|
||||
#include "machine/namcoic.h"
|
||||
|
||||
|
||||
/* nth_word32 is a general-purpose utility function, which allows us to
|
||||
* read from 32-bit aligned memory as if it were an array of 16 bit words.
|
||||
*/
|
||||
@ -69,10 +66,13 @@ uint32_t namcofl_state::screen_update_namcofl(screen_device &screen, bitmap_ind1
|
||||
|
||||
for( pri=0; pri<16; pri++ )
|
||||
{
|
||||
c169_roz_draw(screen, bitmap, cliprect, pri);
|
||||
if((pri&1)==0)
|
||||
c123_tilemap_draw( screen, bitmap, cliprect, pri>>1 );
|
||||
c355_obj_draw(screen, bitmap, cliprect, pri );
|
||||
m_c169roz->draw(screen, bitmap, cliprect, pri);
|
||||
if ((pri & 1) == 0)
|
||||
{
|
||||
m_c123tmap->draw(screen, bitmap, cliprect, pri >> 1);
|
||||
}
|
||||
|
||||
m_c355spr->draw(screen, bitmap, cliprect, pri );
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -96,7 +96,5 @@ int namcofl_state::FLobjcode2tile(int code)
|
||||
|
||||
VIDEO_START_MEMBER(namcofl_state,namcofl)
|
||||
{
|
||||
c123_tilemap_init(NAMCOFL_TILEGFX, memregion(NAMCOFL_TILEMASKREGION)->base(), namcos2_shared_state::c123_tilemap_delegate(&namcofl_state::TilemapCB, this));
|
||||
c355_obj_init(NAMCOFL_SPRITEGFX,0x0,namcos2_shared_state::c355_obj_code2tile_delegate(&namcofl_state::FLobjcode2tile, this));
|
||||
c169_roz_init(NAMCOFL_ROTGFX,NAMCOFL_ROTMASKREGION,namcos2_shared_state::c169_tilemap_delegate(&namcofl_state::RozCB, this));
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,6 @@
|
||||
#include "emu.h"
|
||||
#include "includes/namconb1.h"
|
||||
|
||||
#include "machine/namcoic.h"
|
||||
|
||||
|
||||
/* nth_word32 is a general-purpose utility function, which allows us to
|
||||
* read from 32-bit aligned memory as if it were an array of 16 bit words.
|
||||
*/
|
||||
@ -94,20 +91,20 @@ void namconb1_state::video_update_common(screen_device &screen, bitmap_ind16 &bi
|
||||
{
|
||||
for( pri=0; pri<16; pri++ )
|
||||
{
|
||||
c169_roz_draw(screen, bitmap, cliprect, pri);
|
||||
if( (pri&1)==0 )
|
||||
m_c169roz->draw(screen, bitmap, cliprect, pri);
|
||||
if ((pri & 1) == 0)
|
||||
{
|
||||
c123_tilemap_draw( screen, bitmap, cliprect, pri/2 );
|
||||
m_c123tmap->draw( screen, bitmap, cliprect, pri/2 );
|
||||
}
|
||||
c355_obj_draw(screen, bitmap, cliprect, pri );
|
||||
m_c355spr->draw(screen, bitmap, cliprect, pri );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for( pri=0; pri<8; pri++ )
|
||||
{
|
||||
c123_tilemap_draw( screen, bitmap, cliprect, pri );
|
||||
c355_obj_draw(screen, bitmap, cliprect, pri );
|
||||
m_c123tmap->draw( screen, bitmap, cliprect, pri );
|
||||
m_c355spr->draw(screen, bitmap, cliprect, pri );
|
||||
}
|
||||
}
|
||||
} /* video_update_common */
|
||||
@ -141,9 +138,6 @@ int namconb1_state::NB1objcode2tile( int code )
|
||||
|
||||
VIDEO_START_MEMBER(namconb1_state,namconb1)
|
||||
{
|
||||
c123_tilemap_init(NAMCONB1_TILEGFX, memregion(NAMCONB1_TILEMASKREGION)->base(), namcos2_shared_state::c123_tilemap_delegate(&namconb1_state::NB1TilemapCB, this));
|
||||
c355_obj_init(NAMCONB1_SPRITEGFX,0x0,namcos2_shared_state::c355_obj_code2tile_delegate(&namconb1_state::NB1objcode2tile, this));
|
||||
|
||||
save_item(NAME(m_tilemap_tile_bank));
|
||||
} /* namconb1 */
|
||||
|
||||
@ -154,8 +148,7 @@ WRITE32_MEMBER(namconb1_state::rozbank32_w)
|
||||
uint32_t old_data = m_rozbank32[offset];
|
||||
COMBINE_DATA(&m_rozbank32[offset]);
|
||||
if (m_rozbank32[offset] != old_data)
|
||||
for (auto & elem : m_c169_roz_tilemap)
|
||||
elem->mark_all_dirty();
|
||||
m_c169roz->mark_all_dirty();
|
||||
}
|
||||
|
||||
uint32_t namconb1_state::screen_update_namconb2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
@ -174,7 +167,7 @@ uint32_t namconb1_state::screen_update_namconb2(screen_device &screen, bitmap_in
|
||||
|
||||
if( memcmp(m_tilemap_tile_bank,m_tilebank32,sizeof(m_tilemap_tile_bank))!=0 )
|
||||
{
|
||||
c123_tilemap_invalidate();
|
||||
m_c123tmap->mark_all_dirty();
|
||||
memcpy(m_tilemap_tile_bank,m_tilebank32,sizeof(m_tilemap_tile_bank));
|
||||
}
|
||||
video_update_common( screen, bitmap, clip, 1 );
|
||||
@ -199,18 +192,12 @@ int namconb1_state::NB2objcode2tile_outfxies( int code )
|
||||
|
||||
VIDEO_START_MEMBER(namconb1_state,machbrkr)
|
||||
{
|
||||
c123_tilemap_init(NAMCONB1_TILEGFX, memregion(NAMCONB1_TILEMASKREGION)->base(), namcos2_shared_state::c123_tilemap_delegate(&namconb1_state::NB2TilemapCB_machbrkr, this));
|
||||
c355_obj_init(NAMCONB1_SPRITEGFX,0x0,namcos2_shared_state::c355_obj_code2tile_delegate(&namconb1_state::NB2objcode2tile_machbrkr, this));
|
||||
c169_roz_init(NAMCONB1_ROTGFX,NAMCONB1_ROTMASKREGION,namcos2_shared_state::c169_tilemap_delegate(&namconb1_state::NB2RozCB_machbrkr, this));
|
||||
|
||||
save_item(NAME(m_tilemap_tile_bank));
|
||||
} /* machbrkr */
|
||||
|
||||
VIDEO_START_MEMBER(namconb1_state,outfxies)
|
||||
{
|
||||
c123_tilemap_init(NAMCONB1_TILEGFX, memregion(NAMCONB1_TILEMASKREGION)->base(), namcos2_shared_state::c123_tilemap_delegate(&namconb1_state::NB2TilemapCB_outfxies, this));
|
||||
c355_obj_init(NAMCONB1_SPRITEGFX,0x0,namcos2_shared_state::c355_obj_code2tile_delegate(&namconb1_state::NB2objcode2tile_outfxies, this));
|
||||
c169_roz_init(NAMCONB1_ROTGFX,NAMCONB1_ROTMASKREGION,namcos2_shared_state::c169_tilemap_delegate(&namconb1_state::NB2RozCB_outfxies, this));
|
||||
|
||||
save_item(NAME(m_tilemap_tile_bank));
|
||||
} /* outfxies */
|
||||
|
||||
|
||||
|
@ -29,270 +29,21 @@ void namcos2_state::TilemapCB_finalap2(uint16_t code, int *tile, int *mask)
|
||||
* ---- ---- xxxx ---- always zero?
|
||||
* ---- ---- ---- xxxx sprite bank
|
||||
*/
|
||||
READ16_MEMBER( namcos2_state::gfx_ctrl_r )
|
||||
READ16_MEMBER(namcos2_state::gfx_ctrl_r)
|
||||
{
|
||||
return m_gfx_ctrl;
|
||||
}
|
||||
|
||||
WRITE16_MEMBER( namcos2_state::gfx_ctrl_w )
|
||||
WRITE16_MEMBER(namcos2_state::gfx_ctrl_w)
|
||||
{
|
||||
COMBINE_DATA(&m_gfx_ctrl);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER( namcos2_state::roz_tile_info )
|
||||
{
|
||||
int tile = m_rozram[tile_index];
|
||||
SET_TILE_INFO_MEMBER(3,tile,0/*color*/,0);
|
||||
}
|
||||
|
||||
struct roz_param
|
||||
{
|
||||
uint32_t size;
|
||||
uint32_t startx,starty;
|
||||
int incxx,incxy,incyx,incyy;
|
||||
int color;
|
||||
int wrap;
|
||||
};
|
||||
|
||||
static inline void
|
||||
draw_roz_helper_block(const struct roz_param *rozInfo, int destx, int desty,
|
||||
int srcx, int srcy, int width, int height,
|
||||
bitmap_ind16 &destbitmap, bitmap_ind8 &flagsbitmap,
|
||||
bitmap_ind16 &srcbitmap, uint32_t size_mask)
|
||||
{
|
||||
int desty_end = desty + height;
|
||||
|
||||
int end_incrx = rozInfo->incyx - (width * rozInfo->incxx);
|
||||
int end_incry = rozInfo->incyy - (width * rozInfo->incxy);
|
||||
|
||||
uint16_t *dest = &destbitmap.pix16(desty, destx);
|
||||
int dest_rowinc = destbitmap.rowpixels() - width;
|
||||
|
||||
while (desty < desty_end)
|
||||
{
|
||||
uint16_t *dest_end = dest + width;
|
||||
while (dest < dest_end)
|
||||
{
|
||||
uint32_t xpos = (srcx >> 16);
|
||||
uint32_t ypos = (srcy >> 16);
|
||||
|
||||
if (rozInfo->wrap)
|
||||
{
|
||||
xpos &= size_mask;
|
||||
ypos &= size_mask;
|
||||
}
|
||||
else if ((xpos > rozInfo->size) || (ypos >= rozInfo->size))
|
||||
{
|
||||
goto L_SkipPixel;
|
||||
}
|
||||
|
||||
if (flagsbitmap.pix8(ypos, xpos) & TILEMAP_PIXEL_LAYER0)
|
||||
{
|
||||
*dest = srcbitmap.pix16(ypos, xpos) + rozInfo->color;
|
||||
}
|
||||
|
||||
L_SkipPixel:
|
||||
|
||||
srcx += rozInfo->incxx;
|
||||
srcy += rozInfo->incxy;
|
||||
dest++;
|
||||
}
|
||||
srcx += end_incrx;
|
||||
srcy += end_incry;
|
||||
dest += dest_rowinc;
|
||||
desty++;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
draw_roz_helper(
|
||||
screen_device &screen,
|
||||
bitmap_ind16 &bitmap,
|
||||
tilemap_t *tmap,
|
||||
const rectangle &clip,
|
||||
const struct roz_param *rozInfo )
|
||||
{
|
||||
tmap->set_palette_offset(rozInfo->color );
|
||||
|
||||
if( bitmap.bpp() == 16 )
|
||||
{
|
||||
/* On many processors, the simple approach of an outer loop over the
|
||||
rows of the destination bitmap with an inner loop over the columns
|
||||
of the destination bitmap has poor performance due to the order
|
||||
that memory in the source bitmap is referenced when rotation
|
||||
approaches 90 or 270 degrees. The reason is that the inner loop
|
||||
ends up reading pixels not sequentially in the source bitmap, but
|
||||
instead at rozInfo->incxx increments, which is at its maximum at 90
|
||||
degrees of rotation. This means that only a few (or as few as
|
||||
one) source pixels are in each cache line at a time.
|
||||
|
||||
Instead of the above, this code iterates in NxN blocks through the
|
||||
destination bitmap. This has more overhead when there is little or
|
||||
no rotation, but much better performance when there is closer to 90
|
||||
degrees of rotation (as long as the chunk of the source bitmap that
|
||||
corresponds to an NxN destination block fits in cache!).
|
||||
|
||||
N is defined by ROZ_BLOCK_SIZE below; the best N is one that is as
|
||||
big as possible but at the same time not too big to prevent all of
|
||||
the source bitmap pixels from fitting into cache at the same time.
|
||||
Keep in mind that the block of source pixels used can be somewhat
|
||||
scattered in memory. 8x8 works well on the few processors that
|
||||
were tested; 16x16 seems to work even better for more modern
|
||||
processors with larger caches, but since 8x8 works well enough and
|
||||
is less likely to result in cache misses on processors with smaller
|
||||
caches, it is used.
|
||||
*/
|
||||
|
||||
#define ROZ_BLOCK_SIZE 8
|
||||
|
||||
uint32_t size_mask = rozInfo->size - 1;
|
||||
bitmap_ind16 &srcbitmap = tmap->pixmap();
|
||||
bitmap_ind8 &flagsbitmap = tmap->flagsmap();
|
||||
uint32_t srcx = (rozInfo->startx + (clip.min_x * rozInfo->incxx) +
|
||||
(clip.min_y * rozInfo->incyx));
|
||||
uint32_t srcy = (rozInfo->starty + (clip.min_x * rozInfo->incxy) +
|
||||
(clip.min_y * rozInfo->incyy));
|
||||
int destx = clip.min_x;
|
||||
int desty = clip.min_y;
|
||||
|
||||
int row_count = (clip.max_y - desty) + 1;
|
||||
int row_block_count = row_count / ROZ_BLOCK_SIZE;
|
||||
int row_extra_count = row_count % ROZ_BLOCK_SIZE;
|
||||
|
||||
int column_count = (clip.max_x - destx) + 1;
|
||||
int column_block_count = column_count / ROZ_BLOCK_SIZE;
|
||||
int column_extra_count = column_count % ROZ_BLOCK_SIZE;
|
||||
|
||||
int row_block_size_incxx = ROZ_BLOCK_SIZE * rozInfo->incxx;
|
||||
int row_block_size_incxy = ROZ_BLOCK_SIZE * rozInfo->incxy;
|
||||
int row_block_size_incyx = ROZ_BLOCK_SIZE * rozInfo->incyx;
|
||||
int row_block_size_incyy = ROZ_BLOCK_SIZE * rozInfo->incyy;
|
||||
|
||||
int i,j;
|
||||
|
||||
// Do the block rows
|
||||
for (i = 0; i < row_block_count; i++)
|
||||
{
|
||||
int sx = srcx;
|
||||
int sy = srcy;
|
||||
int dx = destx;
|
||||
// Do the block columns
|
||||
for (j = 0; j < column_block_count; j++)
|
||||
{
|
||||
draw_roz_helper_block(rozInfo, dx, desty, sx, sy, ROZ_BLOCK_SIZE,
|
||||
ROZ_BLOCK_SIZE, bitmap, flagsbitmap, srcbitmap, size_mask);
|
||||
// Increment to the next block column
|
||||
sx += row_block_size_incxx;
|
||||
sy += row_block_size_incxy;
|
||||
dx += ROZ_BLOCK_SIZE;
|
||||
}
|
||||
// Do the extra columns
|
||||
if (column_extra_count)
|
||||
{
|
||||
draw_roz_helper_block(rozInfo, dx, desty, sx, sy, column_extra_count,
|
||||
ROZ_BLOCK_SIZE, bitmap, flagsbitmap, srcbitmap, size_mask);
|
||||
}
|
||||
// Increment to the next row block
|
||||
srcx += row_block_size_incyx;
|
||||
srcy += row_block_size_incyy;
|
||||
desty += ROZ_BLOCK_SIZE;
|
||||
}
|
||||
// Do the extra rows
|
||||
if (row_extra_count)
|
||||
{
|
||||
// Do the block columns
|
||||
for (i = 0; i < column_block_count; i++)
|
||||
{
|
||||
draw_roz_helper_block(rozInfo, destx, desty, srcx, srcy, ROZ_BLOCK_SIZE,
|
||||
row_extra_count, bitmap, flagsbitmap, srcbitmap, size_mask);
|
||||
srcx += row_block_size_incxx;
|
||||
srcy += row_block_size_incxy;
|
||||
destx += ROZ_BLOCK_SIZE;
|
||||
}
|
||||
// Do the extra columns
|
||||
if (column_extra_count)
|
||||
{
|
||||
draw_roz_helper_block(rozInfo, destx, desty, srcx, srcy, column_extra_count,
|
||||
row_extra_count, bitmap, flagsbitmap, srcbitmap, size_mask);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tmap->draw_roz(screen,
|
||||
bitmap, clip,
|
||||
rozInfo->startx, rozInfo->starty,
|
||||
rozInfo->incxx, rozInfo->incxy,
|
||||
rozInfo->incyx, rozInfo->incyy,
|
||||
rozInfo->wrap,0,0); // wrap, flags, pri
|
||||
}
|
||||
}
|
||||
|
||||
void namcos2_state::draw_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
const int xoffset = 38,yoffset = 0;
|
||||
struct roz_param rozParam;
|
||||
|
||||
rozParam.color = (m_gfx_ctrl & 0x0f00);
|
||||
rozParam.incxx = (int16_t)m_roz_ctrl[0];
|
||||
rozParam.incxy = (int16_t)m_roz_ctrl[1];
|
||||
rozParam.incyx = (int16_t)m_roz_ctrl[2];
|
||||
rozParam.incyy = (int16_t)m_roz_ctrl[3];
|
||||
rozParam.startx = (int16_t)m_roz_ctrl[4];
|
||||
rozParam.starty = (int16_t)m_roz_ctrl[5];
|
||||
rozParam.size = 2048;
|
||||
rozParam.wrap = 1;
|
||||
|
||||
|
||||
switch( m_roz_ctrl[7] )
|
||||
{
|
||||
case 0x4400: /* (2048x2048) */
|
||||
break;
|
||||
|
||||
case 0x4488: /* attract mode */
|
||||
rozParam.wrap = 0;
|
||||
break;
|
||||
|
||||
case 0x44cc: /* stage1 demo */
|
||||
rozParam.wrap = 0;
|
||||
break;
|
||||
|
||||
case 0x44ee: /* (256x256) used in Dragon Saber */
|
||||
rozParam.wrap = 0;
|
||||
rozParam.size = 256;
|
||||
break;
|
||||
}
|
||||
|
||||
rozParam.startx <<= 4;
|
||||
rozParam.starty <<= 4;
|
||||
rozParam.startx += xoffset * rozParam.incxx + yoffset * rozParam.incyx;
|
||||
rozParam.starty += xoffset * rozParam.incxy + yoffset * rozParam.incyy;
|
||||
|
||||
rozParam.startx<<=8;
|
||||
rozParam.starty<<=8;
|
||||
rozParam.incxx<<=8;
|
||||
rozParam.incxy<<=8;
|
||||
rozParam.incyx<<=8;
|
||||
rozParam.incyy<<=8;
|
||||
|
||||
draw_roz_helper( screen, bitmap, m_tilemap_roz, cliprect, &rozParam );
|
||||
}
|
||||
|
||||
WRITE16_MEMBER( namcos2_state::rozram_word_w )
|
||||
{
|
||||
COMBINE_DATA(&m_rozram[offset]);
|
||||
m_tilemap_roz->mark_tile_dirty(offset);
|
||||
//if( machine().input().code_pressed(KEYCODE_Q) )
|
||||
//{
|
||||
// machine().debug_break();
|
||||
//}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
READ8_MEMBER( namcos2_state::c116_r )
|
||||
READ8_MEMBER(namcos2_state::c116_r)
|
||||
{
|
||||
if( (offset&0x1800) == 0x1800 )
|
||||
if ((offset & 0x1800) == 0x1800)
|
||||
{
|
||||
/* palette register */
|
||||
offset &= 0x180f;
|
||||
@ -300,17 +51,17 @@ READ8_MEMBER( namcos2_state::c116_r )
|
||||
/* registers 6,7: unmapped? */
|
||||
if (offset > 0x180b) return 0xff; // fix for finallap boot
|
||||
}
|
||||
return m_c116->read(space,offset,mem_mask);
|
||||
return m_c116->read(space, offset, mem_mask);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
void namcos2_state::draw_sprite_init()
|
||||
void namcos2_state::create_shadow_table()
|
||||
{
|
||||
/* set table for sprite color == 0x0f */
|
||||
for( int i = 0; i<16*256; i++ )
|
||||
for (int i = 0; i < 16 * 256; i++)
|
||||
{
|
||||
m_palette->shadow_table()[i] = i+0x2000;
|
||||
m_palette->shadow_table()[i] = i + 0x2000;
|
||||
}
|
||||
}
|
||||
|
||||
@ -318,13 +69,10 @@ void namcos2_state::draw_sprite_init()
|
||||
|
||||
void namcos2_state::video_start()
|
||||
{
|
||||
c123_tilemap_init(2, memregion("gfx4")->base(), namcos2_shared_state::c123_tilemap_delegate(&namcos2_state::TilemapCB, this));
|
||||
m_tilemap_roz = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(namcos2_state::roz_tile_info), this), TILEMAP_SCAN_ROWS, 8,8,256,256);
|
||||
m_tilemap_roz->set_transparent_pen(0xff);
|
||||
draw_sprite_init();
|
||||
create_shadow_table();
|
||||
}
|
||||
|
||||
void namcos2_state::apply_clip( rectangle &clip, const rectangle &cliprect )
|
||||
void namcos2_state::apply_clip(rectangle &clip, const rectangle &cliprect)
|
||||
{
|
||||
clip.min_x = m_c116->get_reg(0) - 0x4a;
|
||||
clip.max_x = m_c116->get_reg(1) - 0x4a - 1;
|
||||
@ -339,23 +87,26 @@ uint32_t namcos2_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
|
||||
rectangle clip;
|
||||
int pri;
|
||||
|
||||
bitmap.fill(m_palette->black_pen(), cliprect );
|
||||
apply_clip( clip, cliprect );
|
||||
bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
apply_clip(clip, cliprect);
|
||||
|
||||
/* HACK: enable ROZ layer only if it has priority > 0 */
|
||||
m_tilemap_roz->enable((m_gfx_ctrl & 0x7000) ? 1 : 0);
|
||||
bool roz_enable = ((m_gfx_ctrl & 0x7000) ? true : false);
|
||||
|
||||
for( pri=0; pri<16; pri++ )
|
||||
for (pri = 0; pri < 16; pri++)
|
||||
{
|
||||
if( (pri&1)==0 )
|
||||
if ((pri & 1) == 0)
|
||||
{
|
||||
c123_tilemap_draw( screen, bitmap, clip, pri/2 );
|
||||
m_c123tmap->draw(screen, bitmap, clip, pri / 2);
|
||||
|
||||
if( ((m_gfx_ctrl & 0x7000) >> 12)==pri/2 )
|
||||
if (roz_enable)
|
||||
{
|
||||
draw_roz(screen, bitmap,clip);
|
||||
if (((m_gfx_ctrl & 0x7000) >> 12) == pri / 2)
|
||||
{
|
||||
m_ns2roz->draw_roz(screen, bitmap, clip, m_gfx_ctrl);
|
||||
}
|
||||
}
|
||||
draw_sprites(screen, bitmap, clip, pri/2, m_gfx_ctrl );
|
||||
m_ns2sprite->draw_sprites(screen, bitmap, clip, pri / 2, m_gfx_ctrl);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -365,14 +116,12 @@ uint32_t namcos2_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
|
||||
|
||||
void namcos2_state::video_start_finallap()
|
||||
{
|
||||
c123_tilemap_init(2,memregion("gfx4")->base(),namcos2_shared_state::c123_tilemap_delegate(&namcos2_state::TilemapCB, this));
|
||||
draw_sprite_init();
|
||||
create_shadow_table();
|
||||
}
|
||||
|
||||
void namcos2_state::video_start_finalap2()
|
||||
{
|
||||
c123_tilemap_init(2,memregion("gfx4")->base(),namcos2_shared_state::c123_tilemap_delegate(&namcos2_state::TilemapCB_finalap2, this));
|
||||
draw_sprite_init();
|
||||
create_shadow_table();
|
||||
}
|
||||
|
||||
uint32_t namcos2_state::screen_update_finallap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
@ -380,17 +129,17 @@ uint32_t namcos2_state::screen_update_finallap(screen_device &screen, bitmap_ind
|
||||
rectangle clip;
|
||||
int pri;
|
||||
|
||||
bitmap.fill(m_palette->black_pen(), cliprect );
|
||||
apply_clip( clip, cliprect );
|
||||
bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
apply_clip(clip, cliprect);
|
||||
|
||||
for( pri=0; pri<16; pri++ )
|
||||
for (pri = 0; pri < 16; pri++)
|
||||
{
|
||||
if( (pri&1)==0 )
|
||||
if ((pri & 1) == 0)
|
||||
{
|
||||
c123_tilemap_draw( screen, bitmap, clip, pri/2 );
|
||||
m_c123tmap->draw(screen, bitmap, clip, pri / 2);
|
||||
}
|
||||
m_c45_road->draw(bitmap,clip,pri);
|
||||
draw_sprites(screen,bitmap,clip,pri,m_gfx_ctrl );
|
||||
m_c45_road->draw(bitmap, clip, pri);
|
||||
m_ns2sprite->draw_sprites(screen, bitmap, clip, pri, m_gfx_ctrl);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -404,10 +153,10 @@ void namcos2_state::RozCB_luckywld(uint16_t code, int *tile, int *mask, int whic
|
||||
uint16_t mangle = bitswap<11>(code & 0x31ff, 13, 12, 8, 7, 6, 5, 4, 3, 2, 1, 0);
|
||||
switch ((code >> 9) & 7)
|
||||
{
|
||||
case 0x00: mangle += 0x1c00; break; // Plus, NOT OR
|
||||
case 0x01: mangle |= 0x0800; break;
|
||||
case 0x02: mangle |= 0x0000; break;
|
||||
default: break;
|
||||
case 0x00: mangle += 0x1c00; break; // Plus, NOT OR
|
||||
case 0x01: mangle |= 0x0800; break;
|
||||
case 0x02: mangle |= 0x0000; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
*tile = mangle;
|
||||
@ -415,12 +164,6 @@ void namcos2_state::RozCB_luckywld(uint16_t code, int *tile, int *mask, int whic
|
||||
|
||||
void namcos2_state::video_start_luckywld()
|
||||
{
|
||||
c123_tilemap_init(2,memregion("gfx4")->base(),namcos2_shared_state::c123_tilemap_delegate(&namcos2_state::TilemapCB, this));
|
||||
c355_obj_init( 0, 0x0, namcos2_shared_state::c355_obj_code2tile_delegate() );
|
||||
if( m_gametype==NAMCOS2_LUCKY_AND_WILD )
|
||||
{
|
||||
c169_roz_init(1, "gfx5", namcos2_shared_state::c169_tilemap_delegate(&namcos2_state::RozCB_luckywld, this));
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t namcos2_state::screen_update_luckywld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
@ -428,21 +171,21 @@ uint32_t namcos2_state::screen_update_luckywld(screen_device &screen, bitmap_ind
|
||||
rectangle clip;
|
||||
int pri;
|
||||
|
||||
bitmap.fill(m_palette->black_pen(), cliprect );
|
||||
apply_clip( clip, cliprect );
|
||||
bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
apply_clip(clip, cliprect);
|
||||
|
||||
for( pri=0; pri<16; pri++ )
|
||||
for (pri = 0; pri < 16; pri++)
|
||||
{
|
||||
if( (pri&1)==0 )
|
||||
if ((pri & 1) == 0)
|
||||
{
|
||||
c123_tilemap_draw( screen, bitmap, clip, pri/2 );
|
||||
m_c123tmap->draw(screen, bitmap, clip, pri / 2);
|
||||
}
|
||||
m_c45_road->draw(bitmap,clip,pri);
|
||||
if( m_gametype==NAMCOS2_LUCKY_AND_WILD )
|
||||
{
|
||||
c169_roz_draw(screen, bitmap, clip, pri);
|
||||
}
|
||||
c355_obj_draw(screen, bitmap, clip, pri );
|
||||
m_c45_road->draw(bitmap, clip, pri);
|
||||
|
||||
if (m_c169roz)
|
||||
m_c169roz->draw(screen, bitmap, clip, pri);
|
||||
|
||||
m_c355spr->draw(screen, bitmap, clip, pri);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -451,8 +194,6 @@ uint32_t namcos2_state::screen_update_luckywld(screen_device &screen, bitmap_ind
|
||||
|
||||
void namcos2_state::video_start_sgunner()
|
||||
{
|
||||
c123_tilemap_init(2,memregion("gfx4")->base(),namcos2_shared_state::c123_tilemap_delegate(&namcos2_state::TilemapCB, this));
|
||||
c355_obj_init( 0, 0x0, namcos2_shared_state::c355_obj_code2tile_delegate() );
|
||||
}
|
||||
|
||||
uint32_t namcos2_state::screen_update_sgunner(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
@ -460,13 +201,13 @@ uint32_t namcos2_state::screen_update_sgunner(screen_device &screen, bitmap_ind1
|
||||
rectangle clip;
|
||||
int pri;
|
||||
|
||||
bitmap.fill(m_palette->black_pen(), cliprect );
|
||||
apply_clip( clip, cliprect );
|
||||
bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
apply_clip(clip, cliprect);
|
||||
|
||||
for( pri=0; pri<8; pri++ )
|
||||
for (pri = 0; pri < 8; pri++)
|
||||
{
|
||||
c123_tilemap_draw( screen, bitmap, clip, pri );
|
||||
c355_obj_draw(screen, bitmap, clip, pri );
|
||||
m_c123tmap->draw(screen, bitmap, clip, pri);
|
||||
m_c355spr->draw(screen, bitmap, clip, pri);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -482,8 +223,6 @@ void namcos2_state::RozCB_metlhawk(uint16_t code, int *tile, int *mask, int whic
|
||||
|
||||
void namcos2_state::video_start_metlhawk()
|
||||
{
|
||||
c123_tilemap_init(2,memregion("gfx4")->base(),namcos2_shared_state::c123_tilemap_delegate(&namcos2_state::TilemapCB, this));
|
||||
c169_roz_init(1, "gfx5", namcos2_shared_state::c169_tilemap_delegate(&namcos2_state::RozCB_metlhawk, this));
|
||||
}
|
||||
|
||||
uint32_t namcos2_state::screen_update_metlhawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
@ -491,17 +230,17 @@ uint32_t namcos2_state::screen_update_metlhawk(screen_device &screen, bitmap_ind
|
||||
rectangle clip;
|
||||
int pri;
|
||||
|
||||
bitmap.fill(m_palette->black_pen(), cliprect );
|
||||
apply_clip( clip, cliprect );
|
||||
bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
apply_clip(clip, cliprect);
|
||||
|
||||
for( pri=0; pri<16; pri++ )
|
||||
for (pri = 0; pri < 16; pri++)
|
||||
{
|
||||
if( (pri&1)==0 )
|
||||
if ((pri & 1) == 0)
|
||||
{
|
||||
c123_tilemap_draw( screen, bitmap, clip, pri/2 );
|
||||
m_c123tmap->draw(screen, bitmap, clip, pri / 2);
|
||||
}
|
||||
c169_roz_draw(screen, bitmap, clip, pri);
|
||||
draw_sprites_metalhawk(screen,bitmap,clip,pri );
|
||||
m_c169roz->draw(screen, bitmap, clip, pri);
|
||||
m_ns2sprite->draw_sprites_metalhawk(screen, bitmap, clip, pri);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -27,9 +27,6 @@ Namco System 21 Video Hardware
|
||||
#include "emu.h"
|
||||
#include "includes/namcos21.h"
|
||||
|
||||
#include "machine/namcoic.h"
|
||||
|
||||
|
||||
#define FRAMEBUFFER_SIZE_IN_BYTES (sizeof(uint16_t)*NAMCOS21_POLY_FRAME_WIDTH*NAMCOS21_POLY_FRAME_HEIGHT)
|
||||
|
||||
READ16_MEMBER(namcos21_state::winrun_gpu_color_r)
|
||||
@ -368,10 +365,6 @@ VIDEO_START_MEMBER(namcos21_state,namcos21)
|
||||
m_maskram = std::make_unique<uint8_t[]>(0x80000);
|
||||
}
|
||||
allocate_poly_framebuffer();
|
||||
c355_obj_init(
|
||||
0, /* gfx bank */
|
||||
0xf, /* reverse palette mapping */
|
||||
namcos2_shared_state::c355_obj_code2tile_delegate() );
|
||||
}
|
||||
|
||||
uint32_t namcos21_state::screen_update_namcos21(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
@ -381,22 +374,22 @@ uint32_t namcos21_state::screen_update_namcos21(screen_device &screen, bitmap_in
|
||||
int pri;
|
||||
bitmap.fill(0xff, cliprect );
|
||||
|
||||
c355_obj_draw(screen, bitmap, cliprect, 2 );
|
||||
//c355_obj_draw(screen, bitmap, cliprect, 14 ); //driver's eyes
|
||||
m_c355spr->draw(screen, bitmap, cliprect, 2 );
|
||||
//draw(screen, bitmap, cliprect, 14 ); //driver's eyes
|
||||
|
||||
copy_visible_poly_framebuffer(bitmap, cliprect, 0x7fc0, 0x7ffe);
|
||||
|
||||
c355_obj_draw(screen, bitmap, cliprect, 0 );
|
||||
c355_obj_draw(screen, bitmap, cliprect, 1 );
|
||||
m_c355spr->draw(screen, bitmap, cliprect, 0 );
|
||||
m_c355spr->draw(screen, bitmap, cliprect, 1 );
|
||||
|
||||
copy_visible_poly_framebuffer(bitmap, cliprect, 0, 0x7fbf);
|
||||
|
||||
/* draw high priority 2d sprites */
|
||||
for( pri=pivot; pri<8; pri++ )
|
||||
{
|
||||
c355_obj_draw(screen, bitmap, cliprect, pri );
|
||||
m_c355spr->draw(screen, bitmap, cliprect, pri );
|
||||
}
|
||||
// c355_obj_draw(screen, bitmap, cliprect, 15 ); //driver's eyes
|
||||
// draw(screen, bitmap, cliprect, 15 ); //driver's eyes
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -407,20 +400,22 @@ uint32_t namcos21_state::screen_update_driveyes(screen_device &screen, bitmap_in
|
||||
int pri;
|
||||
bitmap.fill(0xff, cliprect );
|
||||
|
||||
c355_obj_draw(screen, bitmap, cliprect, 2 );
|
||||
c355_obj_draw(screen, bitmap, cliprect, 14 ); //driver's eyes
|
||||
m_c355spr->draw(screen, bitmap, cliprect, 2 );
|
||||
m_c355spr->draw(screen, bitmap, cliprect, 14 ); //driver's eyes
|
||||
|
||||
copy_visible_poly_framebuffer(bitmap, cliprect, 0x7fc0, 0x7ffe);
|
||||
|
||||
c355_obj_draw(screen, bitmap, cliprect, 0 );
|
||||
c355_obj_draw(screen, bitmap, cliprect, 1 );
|
||||
m_c355spr->draw(screen, bitmap, cliprect, 0 );
|
||||
m_c355spr->draw(screen, bitmap, cliprect, 1 );
|
||||
|
||||
copy_visible_poly_framebuffer(bitmap, cliprect, 0, 0x7fbf);
|
||||
|
||||
for( pri=pivot; pri<8; pri++ )
|
||||
c355_obj_draw(screen, bitmap, cliprect, pri );
|
||||
for (pri = pivot; pri < 8; pri++)
|
||||
{
|
||||
m_c355spr->draw(screen, bitmap, cliprect, pri);
|
||||
}
|
||||
|
||||
c355_obj_draw(screen, bitmap, cliprect, 15 ); //driver's eyes
|
||||
m_c355spr->draw(screen, bitmap, cliprect, 15 ); //driver's eyes
|
||||
|
||||
return 0;
|
||||
|
||||
|
282
src/mame/video/namcos2_roz.cpp
Normal file
282
src/mame/video/namcos2_roz.cpp
Normal file
@ -0,0 +1,282 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood, Phil Stroffolino
|
||||
|
||||
/*
|
||||
Namco System 2 ROZ Tilemap - found on Namco System 2 video board (standard type)
|
||||
|
||||
based on namcoic.txt this probably consists of the following
|
||||
C102 - Controls CPU access to ROZ Memory Area.
|
||||
(anything else?)
|
||||
|
||||
used by the following drivers
|
||||
namcos2.cpp (all games EXCEPT Final Lap 1,2,3 , Lucky & Wild , Steel Gunner 1,2 , Suzuka 8 Hours 1,2 , Metal Hawk)
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "namcos2_roz.h"
|
||||
|
||||
DEFINE_DEVICE_TYPE(NAMCOS2_ROZ, namcos2_roz_device, "namcos2_sprite", "Namco Sysem 2 ROZ (C102)")
|
||||
|
||||
namcos2_roz_device::namcos2_roz_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
|
||||
device_t(mconfig, NAMCOS2_ROZ, tag, owner, clock),
|
||||
m_rozram(*this, finder_base::DUMMY_TAG),
|
||||
m_roz_ctrl(*this, finder_base::DUMMY_TAG),
|
||||
m_gfxdecode(*this, finder_base::DUMMY_TAG),
|
||||
m_palette(*this, finder_base::DUMMY_TAG)
|
||||
{
|
||||
}
|
||||
|
||||
void namcos2_roz_device::device_start()
|
||||
{
|
||||
m_tilemap_roz = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(namcos2_roz_device::roz_tile_info), this), TILEMAP_SCAN_ROWS, 8, 8, 256, 256);
|
||||
m_tilemap_roz->set_transparent_pen(0xff);
|
||||
}
|
||||
|
||||
|
||||
TILE_GET_INFO_MEMBER(namcos2_roz_device::roz_tile_info)
|
||||
{
|
||||
int tile = m_rozram[tile_index];
|
||||
SET_TILE_INFO_MEMBER(3, tile, 0/*color*/, 0);
|
||||
}
|
||||
|
||||
struct roz_param
|
||||
{
|
||||
uint32_t size;
|
||||
uint32_t startx, starty;
|
||||
int incxx, incxy, incyx, incyy;
|
||||
int color;
|
||||
int wrap;
|
||||
};
|
||||
|
||||
static inline void
|
||||
draw_roz_helper_block(const struct roz_param *rozInfo, int destx, int desty,
|
||||
int srcx, int srcy, int width, int height,
|
||||
bitmap_ind16 &destbitmap, bitmap_ind8 &flagsbitmap,
|
||||
bitmap_ind16 &srcbitmap, uint32_t size_mask)
|
||||
{
|
||||
int desty_end = desty + height;
|
||||
|
||||
int end_incrx = rozInfo->incyx - (width * rozInfo->incxx);
|
||||
int end_incry = rozInfo->incyy - (width * rozInfo->incxy);
|
||||
|
||||
uint16_t *dest = &destbitmap.pix16(desty, destx);
|
||||
int dest_rowinc = destbitmap.rowpixels() - width;
|
||||
|
||||
while (desty < desty_end)
|
||||
{
|
||||
uint16_t *dest_end = dest + width;
|
||||
while (dest < dest_end)
|
||||
{
|
||||
uint32_t xpos = (srcx >> 16);
|
||||
uint32_t ypos = (srcy >> 16);
|
||||
|
||||
if (rozInfo->wrap)
|
||||
{
|
||||
xpos &= size_mask;
|
||||
ypos &= size_mask;
|
||||
}
|
||||
else if ((xpos > rozInfo->size) || (ypos >= rozInfo->size))
|
||||
{
|
||||
goto L_SkipPixel;
|
||||
}
|
||||
|
||||
if (flagsbitmap.pix8(ypos, xpos) & TILEMAP_PIXEL_LAYER0)
|
||||
{
|
||||
*dest = srcbitmap.pix16(ypos, xpos) + rozInfo->color;
|
||||
}
|
||||
|
||||
L_SkipPixel:
|
||||
|
||||
srcx += rozInfo->incxx;
|
||||
srcy += rozInfo->incxy;
|
||||
dest++;
|
||||
}
|
||||
srcx += end_incrx;
|
||||
srcy += end_incry;
|
||||
dest += dest_rowinc;
|
||||
desty++;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
draw_roz_helper(
|
||||
screen_device &screen,
|
||||
bitmap_ind16 &bitmap,
|
||||
tilemap_t *tmap,
|
||||
const rectangle &clip,
|
||||
const struct roz_param *rozInfo)
|
||||
{
|
||||
tmap->set_palette_offset(rozInfo->color);
|
||||
|
||||
if (bitmap.bpp() == 16)
|
||||
{
|
||||
/* On many processors, the simple approach of an outer loop over the
|
||||
rows of the destination bitmap with an inner loop over the columns
|
||||
of the destination bitmap has poor performance due to the order
|
||||
that memory in the source bitmap is referenced when rotation
|
||||
approaches 90 or 270 degrees. The reason is that the inner loop
|
||||
ends up reading pixels not sequentially in the source bitmap, but
|
||||
instead at rozInfo->incxx increments, which is at its maximum at 90
|
||||
degrees of rotation. This means that only a few (or as few as
|
||||
one) source pixels are in each cache line at a time.
|
||||
|
||||
Instead of the above, this code iterates in NxN blocks through the
|
||||
destination bitmap. This has more overhead when there is little or
|
||||
no rotation, but much better performance when there is closer to 90
|
||||
degrees of rotation (as long as the chunk of the source bitmap that
|
||||
corresponds to an NxN destination block fits in cache!).
|
||||
|
||||
N is defined by ROZ_BLOCK_SIZE below; the best N is one that is as
|
||||
big as possible but at the same time not too big to prevent all of
|
||||
the source bitmap pixels from fitting into cache at the same time.
|
||||
Keep in mind that the block of source pixels used can be somewhat
|
||||
scattered in memory. 8x8 works well on the few processors that
|
||||
were tested; 16x16 seems to work even better for more modern
|
||||
processors with larger caches, but since 8x8 works well enough and
|
||||
is less likely to result in cache misses on processors with smaller
|
||||
caches, it is used.
|
||||
*/
|
||||
|
||||
#define ROZ_BLOCK_SIZE 8
|
||||
|
||||
uint32_t size_mask = rozInfo->size - 1;
|
||||
bitmap_ind16 &srcbitmap = tmap->pixmap();
|
||||
bitmap_ind8 &flagsbitmap = tmap->flagsmap();
|
||||
uint32_t srcx = (rozInfo->startx + (clip.min_x * rozInfo->incxx) +
|
||||
(clip.min_y * rozInfo->incyx));
|
||||
uint32_t srcy = (rozInfo->starty + (clip.min_x * rozInfo->incxy) +
|
||||
(clip.min_y * rozInfo->incyy));
|
||||
int destx = clip.min_x;
|
||||
int desty = clip.min_y;
|
||||
|
||||
int row_count = (clip.max_y - desty) + 1;
|
||||
int row_block_count = row_count / ROZ_BLOCK_SIZE;
|
||||
int row_extra_count = row_count % ROZ_BLOCK_SIZE;
|
||||
|
||||
int column_count = (clip.max_x - destx) + 1;
|
||||
int column_block_count = column_count / ROZ_BLOCK_SIZE;
|
||||
int column_extra_count = column_count % ROZ_BLOCK_SIZE;
|
||||
|
||||
int row_block_size_incxx = ROZ_BLOCK_SIZE * rozInfo->incxx;
|
||||
int row_block_size_incxy = ROZ_BLOCK_SIZE * rozInfo->incxy;
|
||||
int row_block_size_incyx = ROZ_BLOCK_SIZE * rozInfo->incyx;
|
||||
int row_block_size_incyy = ROZ_BLOCK_SIZE * rozInfo->incyy;
|
||||
|
||||
int i, j;
|
||||
|
||||
// Do the block rows
|
||||
for (i = 0; i < row_block_count; i++)
|
||||
{
|
||||
int sx = srcx;
|
||||
int sy = srcy;
|
||||
int dx = destx;
|
||||
// Do the block columns
|
||||
for (j = 0; j < column_block_count; j++)
|
||||
{
|
||||
draw_roz_helper_block(rozInfo, dx, desty, sx, sy, ROZ_BLOCK_SIZE,
|
||||
ROZ_BLOCK_SIZE, bitmap, flagsbitmap, srcbitmap, size_mask);
|
||||
// Increment to the next block column
|
||||
sx += row_block_size_incxx;
|
||||
sy += row_block_size_incxy;
|
||||
dx += ROZ_BLOCK_SIZE;
|
||||
}
|
||||
// Do the extra columns
|
||||
if (column_extra_count)
|
||||
{
|
||||
draw_roz_helper_block(rozInfo, dx, desty, sx, sy, column_extra_count,
|
||||
ROZ_BLOCK_SIZE, bitmap, flagsbitmap, srcbitmap, size_mask);
|
||||
}
|
||||
// Increment to the next row block
|
||||
srcx += row_block_size_incyx;
|
||||
srcy += row_block_size_incyy;
|
||||
desty += ROZ_BLOCK_SIZE;
|
||||
}
|
||||
// Do the extra rows
|
||||
if (row_extra_count)
|
||||
{
|
||||
// Do the block columns
|
||||
for (i = 0; i < column_block_count; i++)
|
||||
{
|
||||
draw_roz_helper_block(rozInfo, destx, desty, srcx, srcy, ROZ_BLOCK_SIZE,
|
||||
row_extra_count, bitmap, flagsbitmap, srcbitmap, size_mask);
|
||||
srcx += row_block_size_incxx;
|
||||
srcy += row_block_size_incxy;
|
||||
destx += ROZ_BLOCK_SIZE;
|
||||
}
|
||||
// Do the extra columns
|
||||
if (column_extra_count)
|
||||
{
|
||||
draw_roz_helper_block(rozInfo, destx, desty, srcx, srcy, column_extra_count,
|
||||
row_extra_count, bitmap, flagsbitmap, srcbitmap, size_mask);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tmap->draw_roz(screen,
|
||||
bitmap, clip,
|
||||
rozInfo->startx, rozInfo->starty,
|
||||
rozInfo->incxx, rozInfo->incxy,
|
||||
rozInfo->incyx, rozInfo->incyy,
|
||||
rozInfo->wrap, 0, 0); // wrap, flags, pri
|
||||
}
|
||||
}
|
||||
|
||||
void namcos2_roz_device::draw_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t gfx_ctrl)
|
||||
{
|
||||
const int xoffset = 38, yoffset = 0;
|
||||
struct roz_param rozParam;
|
||||
|
||||
rozParam.color = (gfx_ctrl & 0x0f00);
|
||||
rozParam.incxx = (int16_t)m_roz_ctrl[0];
|
||||
rozParam.incxy = (int16_t)m_roz_ctrl[1];
|
||||
rozParam.incyx = (int16_t)m_roz_ctrl[2];
|
||||
rozParam.incyy = (int16_t)m_roz_ctrl[3];
|
||||
rozParam.startx = (int16_t)m_roz_ctrl[4];
|
||||
rozParam.starty = (int16_t)m_roz_ctrl[5];
|
||||
rozParam.size = 2048;
|
||||
rozParam.wrap = 1;
|
||||
|
||||
|
||||
switch (m_roz_ctrl[7])
|
||||
{
|
||||
case 0x4400: /* (2048x2048) */
|
||||
break;
|
||||
|
||||
case 0x4488: /* attract mode */
|
||||
rozParam.wrap = 0;
|
||||
break;
|
||||
|
||||
case 0x44cc: /* stage1 demo */
|
||||
rozParam.wrap = 0;
|
||||
break;
|
||||
|
||||
case 0x44ee: /* (256x256) used in Dragon Saber */
|
||||
rozParam.wrap = 0;
|
||||
rozParam.size = 256;
|
||||
break;
|
||||
}
|
||||
|
||||
rozParam.startx <<= 4;
|
||||
rozParam.starty <<= 4;
|
||||
rozParam.startx += xoffset * rozParam.incxx + yoffset * rozParam.incyx;
|
||||
rozParam.starty += xoffset * rozParam.incxy + yoffset * rozParam.incyy;
|
||||
|
||||
rozParam.startx <<= 8;
|
||||
rozParam.starty <<= 8;
|
||||
rozParam.incxx <<= 8;
|
||||
rozParam.incxy <<= 8;
|
||||
rozParam.incyx <<= 8;
|
||||
rozParam.incyy <<= 8;
|
||||
|
||||
draw_roz_helper(screen, bitmap, m_tilemap_roz, cliprect, &rozParam);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(namcos2_roz_device::rozram_word_w)
|
||||
{
|
||||
COMBINE_DATA(&m_rozram[offset]);
|
||||
m_tilemap_roz->mark_tile_dirty(offset);
|
||||
}
|
||||
|
50
src/mame/video/namcos2_roz.h
Normal file
50
src/mame/video/namcos2_roz.h
Normal file
@ -0,0 +1,50 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#ifndef MAME_VIDEO_NAMCOS2_ROZ_H
|
||||
#define MAME_VIDEO_NAMCOS2_ROZ_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "screen.h"
|
||||
#include "emupal.h"
|
||||
|
||||
|
||||
class namcos2_roz_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
namcos2_roz_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
template <typename T> void set_rozram_tag(T &&tag) { m_rozram.set_tag(std::forward<T>(tag)); }
|
||||
template <typename T> void set_rozctrl_tag(T &&tag) { m_roz_ctrl.set_tag(std::forward<T>(tag)); }
|
||||
template <typename T> void set_palette_tag(T &&tag) { m_palette.set_tag(std::forward<T>(tag)); }
|
||||
template <typename T> void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward<T>(tag)); }
|
||||
|
||||
DECLARE_WRITE16_MEMBER( rozram_word_w );
|
||||
|
||||
void draw_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t gfx_ctrl);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
// general
|
||||
void zdrawgfxzoom(screen_device &screen, bitmap_ind16 &dest_bmp, const rectangle &clip, gfx_element *gfx, uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos);
|
||||
void zdrawgfxzoom(screen_device &screen, bitmap_rgb32 &dest_bmp, const rectangle &clip, gfx_element *gfx, uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos);
|
||||
|
||||
TILE_GET_INFO_MEMBER( roz_tile_info );
|
||||
tilemap_t *m_tilemap_roz;
|
||||
|
||||
required_shared_ptr<uint16_t> m_rozram;
|
||||
required_shared_ptr<uint16_t> m_roz_ctrl;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(NAMCOS2_ROZ, namcos2_roz_device)
|
||||
|
||||
#endif // MAME_VIDEO_NAMCOS2_ROZ_H
|
||||
|
378
src/mame/video/namcos2_sprite.cpp
Normal file
378
src/mame/video/namcos2_sprite.cpp
Normal file
@ -0,0 +1,378 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood, Phil Stroffolino
|
||||
|
||||
/*
|
||||
Namco System 2 Sprites - found on Namco System 2 video board (standard type)
|
||||
|
||||
based on namcoic.txt this probably consists of the following
|
||||
C106 - Generates memory output clocks to generate X-Axis Zoom for Line Buffer Writes
|
||||
C134 - Object Memory Address Generator. Sequences the sprite memory contents to the hardware.
|
||||
C135 - Checks is object is displayed on Current output line.
|
||||
C146 - Steers the Decode Object Pixel data to the correct line buffer A or B
|
||||
|
||||
Metal Hawk requires a different draw function, so might use a different chip unless the hookup is just scrambled (needs checking)
|
||||
|
||||
used by the following drivers
|
||||
namcos2.cpp (all games EXCEPT Steel Gunner, Steel Gunner 2, Lucky & Wild, Suzuka 8 Hours, Suzuka 8 Hours 2 which use the newer Namco NB1 style sprites, see namco_c355spr.cpp)
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "namcos2_sprite.h"
|
||||
|
||||
DEFINE_DEVICE_TYPE(NAMCOS2_SPRITE, namcos2_sprite_device, "namcos2_sprite", "Namco Sysem 2 Sprites (C106,C134,C135,C146)")
|
||||
|
||||
namcos2_sprite_device::namcos2_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
|
||||
device_t(mconfig, NAMCOS2_SPRITE, tag, owner, clock),
|
||||
m_gfxdecode(*this, finder_base::DUMMY_TAG),
|
||||
m_palette(*this, finder_base::DUMMY_TAG),
|
||||
m_spriteram(*this, finder_base::DUMMY_TAG)
|
||||
{
|
||||
}
|
||||
|
||||
void namcos2_sprite_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
void namcos2_sprite_device::zdrawgfxzoom(
|
||||
screen_device &screen,
|
||||
bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_element *gfx,
|
||||
uint32_t code,uint32_t color,int flipx,int flipy,int sx,int sy,
|
||||
int scalex, int scaley, int zpos )
|
||||
{
|
||||
if (!scalex || !scaley) return;
|
||||
if (dest_bmp.bpp() == 16)
|
||||
{
|
||||
if( gfx )
|
||||
{
|
||||
int shadow_offset = (m_palette->shadows_enabled())?m_palette->entries():0;
|
||||
const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
|
||||
const uint8_t *source_base = gfx->get_data(code % gfx->elements());
|
||||
int sprite_screen_height = (scaley*gfx->height()+0x8000)>>16;
|
||||
int sprite_screen_width = (scalex*gfx->width()+0x8000)>>16;
|
||||
if (sprite_screen_width && sprite_screen_height)
|
||||
{
|
||||
/* compute sprite increment per screen pixel */
|
||||
int dx = (gfx->width()<<16)/sprite_screen_width;
|
||||
int dy = (gfx->height()<<16)/sprite_screen_height;
|
||||
|
||||
int ex = sx+sprite_screen_width;
|
||||
int ey = sy+sprite_screen_height;
|
||||
|
||||
int x_index_base;
|
||||
int y_index;
|
||||
|
||||
if( flipx )
|
||||
{
|
||||
x_index_base = (sprite_screen_width-1)*dx;
|
||||
dx = -dx;
|
||||
}
|
||||
else
|
||||
{
|
||||
x_index_base = 0;
|
||||
}
|
||||
|
||||
if( flipy )
|
||||
{
|
||||
y_index = (sprite_screen_height-1)*dy;
|
||||
dy = -dy;
|
||||
}
|
||||
else
|
||||
{
|
||||
y_index = 0;
|
||||
}
|
||||
|
||||
if( sx < clip.min_x)
|
||||
{ /* clip left */
|
||||
int pixels = clip.min_x-sx;
|
||||
sx += pixels;
|
||||
x_index_base += pixels*dx;
|
||||
}
|
||||
if( sy < clip.min_y )
|
||||
{ /* clip top */
|
||||
int pixels = clip.min_y-sy;
|
||||
sy += pixels;
|
||||
y_index += pixels*dy;
|
||||
}
|
||||
if( ex > clip.max_x+1 )
|
||||
{ /* clip right */
|
||||
int pixels = ex-clip.max_x-1;
|
||||
ex -= pixels;
|
||||
}
|
||||
if( ey > clip.max_y+1 )
|
||||
{ /* clip bottom */
|
||||
int pixels = ey-clip.max_y-1;
|
||||
ey -= pixels;
|
||||
}
|
||||
|
||||
if( ex>sx )
|
||||
{ /* skip if inner loop doesn't draw anything */
|
||||
int y;
|
||||
bitmap_ind8 &priority_bitmap = screen.priority();
|
||||
if( priority_bitmap.valid() )
|
||||
{
|
||||
for( y=sy; y<ey; y++ )
|
||||
{
|
||||
const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes();
|
||||
uint16_t *dest = &dest_bmp.pix16(y);
|
||||
uint8_t *pri = &priority_bitmap.pix8(y);
|
||||
int x, x_index = x_index_base;
|
||||
/* this code was previously shared with the c355 where this was needed
|
||||
if( m_palxor )
|
||||
{
|
||||
for( x=sx; x<ex; x++ )
|
||||
{
|
||||
int c = source[x_index>>16];
|
||||
if( c != 0xff )
|
||||
{
|
||||
if( pri[x]<=zpos )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
case 0:
|
||||
dest[x] = 0x4000|(dest[x]&0x1fff);
|
||||
break;
|
||||
case 1:
|
||||
dest[x] = 0x6000|(dest[x]&0x1fff);
|
||||
break;
|
||||
default:
|
||||
dest[x] = pal[c];
|
||||
break;
|
||||
}
|
||||
pri[x] = zpos;
|
||||
}
|
||||
}
|
||||
x_index += dx;
|
||||
}
|
||||
y_index += dy;
|
||||
}
|
||||
else
|
||||
*/
|
||||
{
|
||||
for( x=sx; x<ex; x++ )
|
||||
{
|
||||
int c = source[x_index>>16];
|
||||
if( c != 0xff )
|
||||
{
|
||||
if( pri[x]<=zpos )
|
||||
{
|
||||
if( color == 0xf && c==0xfe && shadow_offset )
|
||||
{
|
||||
dest[x] |= shadow_offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
dest[x] = pal[c];
|
||||
}
|
||||
pri[x] = zpos;
|
||||
}
|
||||
}
|
||||
x_index += dx;
|
||||
}
|
||||
y_index += dy;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* zdrawgfxzoom */
|
||||
|
||||
void namcos2_sprite_device::zdrawgfxzoom(
|
||||
screen_device &screen,
|
||||
bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx,
|
||||
uint32_t code,uint32_t color,int flipx,int flipy,int sx,int sy,
|
||||
int scalex, int scaley, int zpos )
|
||||
{
|
||||
/* nop */
|
||||
}
|
||||
|
||||
void namcos2_sprite_device::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri, int control )
|
||||
{
|
||||
int offset = (control & 0x000f) * (128*4);
|
||||
int loop;
|
||||
if( pri==0 )
|
||||
{
|
||||
screen.priority().fill(0, cliprect );
|
||||
}
|
||||
for( loop=0; loop < 128; loop++ )
|
||||
{
|
||||
/****************************************
|
||||
* word#0
|
||||
* Sprite Y position D00-D08
|
||||
* Sprite Size 16/32 D09
|
||||
* Sprite Size Y D10-D15
|
||||
*
|
||||
* word#1
|
||||
* Sprite Quadrant D00-D01
|
||||
* Sprite Number D02-D12
|
||||
* Sprite ROM Bank select D13
|
||||
* Sprite flip X D14
|
||||
* Sprite flip Y D15
|
||||
*
|
||||
* word#2
|
||||
* Sprite X position D00-D10
|
||||
*
|
||||
* word#3
|
||||
* Sprite priority D00-D02
|
||||
* Sprite colour index D04-D07
|
||||
* Sprite Size X D10-D15
|
||||
*/
|
||||
int word3 = m_spriteram[offset+(loop*4)+3];
|
||||
if( (word3&0xf)==pri )
|
||||
{
|
||||
int word0 = m_spriteram[offset+(loop*4)+0];
|
||||
int word1 = m_spriteram[offset+(loop*4)+1];
|
||||
int offset4 = m_spriteram[offset+(loop*4)+2];
|
||||
|
||||
int sizey=((word0>>10)&0x3f)+1;
|
||||
int sizex=(word3>>10)&0x3f;
|
||||
|
||||
if((word0&0x0200)==0) sizex>>=1;
|
||||
|
||||
if((sizey-1) && sizex )
|
||||
{
|
||||
int color = (word3>>4)&0x000f;
|
||||
int sprn = (word1>>2)&0x7ff;
|
||||
int rgn = (word1&0x2000)?1:0;
|
||||
int ypos = (0x1ff-(word0&0x01ff))-0x50+0x02;
|
||||
int xpos = (offset4&0x03ff)-0x50+0x07;
|
||||
int flipy = word1&0x8000;
|
||||
int flipx = word1&0x4000;
|
||||
int scalex = (sizex<<16)/((word0&0x0200)?0x20:0x10);
|
||||
int scaley = (sizey<<16)/((word0&0x0200)?0x20:0x10);
|
||||
if(scalex && scaley)
|
||||
{
|
||||
gfx_element *gfx = m_gfxdecode->gfx(rgn);
|
||||
|
||||
if( (word0&0x0200)==0 )
|
||||
gfx->set_source_clip((word1&0x0001) ? 16 : 0, 16, (word1&0x0002) ? 16 : 0, 16);
|
||||
else
|
||||
gfx->set_source_clip(0, 32, 0, 32);
|
||||
|
||||
zdrawgfxzoom(
|
||||
screen,
|
||||
bitmap,
|
||||
cliprect,
|
||||
gfx,
|
||||
sprn,
|
||||
color,
|
||||
flipx,flipy,
|
||||
xpos,ypos,
|
||||
scalex,scaley,
|
||||
loop );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* namcos2_draw_sprites */
|
||||
|
||||
void namcos2_sprite_device::draw_sprites_metalhawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri )
|
||||
{
|
||||
/**
|
||||
* word#0
|
||||
* xxxxxx---------- ysize
|
||||
* ------x--------- sprite tile size
|
||||
* -------xxxxxxxxx screeny
|
||||
*
|
||||
* word#1
|
||||
* --x------------- bank
|
||||
* ----xxxxxxxxxxxx tile
|
||||
*
|
||||
* word#2 (unused)
|
||||
*
|
||||
* word#3
|
||||
* xxxxxx---------- xsize
|
||||
* ------xxxxxxxxxx screenx
|
||||
*
|
||||
* word#4 (unused)
|
||||
* word#5 (unused)
|
||||
*
|
||||
* word#6 (orientation)
|
||||
* ---------------x rot90
|
||||
* --------------x- flipx
|
||||
* -------------x-- flipy
|
||||
* ------------x--- tile size
|
||||
*
|
||||
* word#7
|
||||
* ------------xxxx priority
|
||||
* --------xxxx---- color
|
||||
* x--------------- unknown
|
||||
*/
|
||||
const uint16_t *pSource = m_spriteram;
|
||||
int loop;
|
||||
if( pri==0 )
|
||||
{
|
||||
screen.priority().fill(0, cliprect );
|
||||
}
|
||||
for( loop=0; loop < 128; loop++ )
|
||||
{
|
||||
int ypos = pSource[0];
|
||||
int tile = pSource[1];
|
||||
int xpos = pSource[3];
|
||||
int flags = pSource[6];
|
||||
int attrs = pSource[7];
|
||||
int sizey = ((ypos>>10)&0x3f)+1;
|
||||
int sizex = (xpos>>10)&0x3f;
|
||||
int sprn = (tile>>2)&0x7ff;
|
||||
|
||||
if( tile&0x2000 )
|
||||
{
|
||||
sprn&=0x3ff;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprn|=0x400;
|
||||
}
|
||||
|
||||
if( (sizey-1) && sizex && (attrs&0xf)==pri )
|
||||
{
|
||||
int bBigSprite = (flags&8);
|
||||
int color = (attrs>>4)&0xf;
|
||||
int sx = (xpos&0x03ff)-0x50+0x07;
|
||||
int sy = (0x1ff-(ypos&0x01ff))-0x50+0x02;
|
||||
int flipx = flags&2;
|
||||
int flipy = flags&4;
|
||||
int scalex = (sizex<<16)/(0x20);//(sizex<<16)/(bBigSprite?0x20:0x10); correct formula?
|
||||
int scaley = (sizey<<16)/(bBigSprite?0x20:0x10);
|
||||
|
||||
/* swap xy */
|
||||
int rgn = (flags&0x01) ? 3 : 0;
|
||||
|
||||
gfx_element *gfx = m_gfxdecode->gfx(rgn);
|
||||
|
||||
if( bBigSprite )
|
||||
{
|
||||
if( sizex < 0x20 )
|
||||
{
|
||||
sx -= (0x20-sizex)/0x8;
|
||||
}
|
||||
if( sizey < 0x20 )
|
||||
{
|
||||
sy += (0x20-sizey)/0xC;
|
||||
}
|
||||
gfx->set_source_clip(0, 32, 0, 32);
|
||||
}
|
||||
else
|
||||
gfx->set_source_clip((tile&0x0001) ? 16 : 0, 16, (tile&0x0002) ? 16 : 0, 16);
|
||||
|
||||
zdrawgfxzoom(
|
||||
screen,
|
||||
bitmap,
|
||||
cliprect,
|
||||
gfx,
|
||||
sprn, color,
|
||||
flipx,flipy,
|
||||
sx,sy,
|
||||
scalex, scaley,
|
||||
loop );
|
||||
}
|
||||
pSource += 8;
|
||||
}
|
||||
} /* namcos2_draw_sprites_metalhawk */
|
44
src/mame/video/namcos2_sprite.h
Normal file
44
src/mame/video/namcos2_sprite.h
Normal file
@ -0,0 +1,44 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:David Haywood
|
||||
|
||||
#ifndef MAME_VIDEO_NAMCOS2_SPRITE_H
|
||||
#define MAME_VIDEO_NAMCOS2_SPRITE_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "screen.h"
|
||||
#include "emupal.h"
|
||||
|
||||
class namcos2_sprite_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
namcos2_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
template <typename T> void set_palette_tag(T &&tag) { m_palette.set_tag(std::forward<T>(tag)); }
|
||||
template <typename T> void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward<T>(tag)); }
|
||||
template <typename T> void set_spriteram_tag(T &&tag) { m_spriteram.set_tag(std::forward<T>(tag)); }
|
||||
|
||||
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri, int control );
|
||||
void draw_sprites_metalhawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri );
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
// general
|
||||
void zdrawgfxzoom(screen_device &screen, bitmap_ind16 &dest_bmp, const rectangle &clip, gfx_element *gfx, uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos);
|
||||
void zdrawgfxzoom(screen_device &screen, bitmap_rgb32 &dest_bmp, const rectangle &clip, gfx_element *gfx, uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos);
|
||||
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
required_shared_ptr<uint16_t> m_spriteram;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(NAMCOS2_SPRITE, namcos2_sprite_device)
|
||||
|
||||
#endif // MAME_VIDEO_NAMCOS2_SPRITE_H
|
||||
|
Loading…
Reference in New Issue
Block a user