namcos2/c355 sprites: color 0xfe is for a palette offset instead of shadow [dink, hap]

This commit is contained in:
hap 2021-04-01 21:01:36 +02:00
parent 91fdb8adca
commit 0d897d07e6
14 changed files with 27 additions and 36 deletions

View File

@ -2985,6 +2985,8 @@ 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_c45road.cpp",
MAME_DIR .. "src/mame/video/namco_c45road.h",
MAME_DIR .. "src/mame/video/namco_c169roz.cpp",
MAME_DIR .. "src/mame/video/namco_c169roz.h",
MAME_DIR .. "src/mame/video/namco_c355spr.cpp",
@ -3082,8 +3084,6 @@ files {
MAME_DIR .. "src/mame/audio/namco54.h",
MAME_DIR .. "src/mame/video/namco_c116.cpp",
MAME_DIR .. "src/mame/video/namco_c116.h",
MAME_DIR .. "src/mame/video/c45.cpp",
MAME_DIR .. "src/mame/video/c45.h",
}
createMAMEProjects(_target, _subtarget, "nasco")

View File

@ -986,7 +986,7 @@ void namconb1_state::namconb1(machine_config &config)
m_screen->screen_vblank().set(FUNC(namconb1_state::screen_vblank));
m_screen->set_palette(m_c116);
NAMCO_C355SPR(config, m_c355spr, 0);
NAMCO_C355SPR(config, m_c355spr);
m_c355spr->set_screen(m_screen);
m_c355spr->set_palette(m_c116);
m_c355spr->set_scroll_offsets(0x26, 0x19);
@ -995,12 +995,12 @@ void namconb1_state::namconb1(machine_config &config)
m_c355spr->set_buffer(2); // triple buffered
m_c355spr->set_color_base(0);
NAMCO_C123TMAP(config, m_c123tmap, 0);
NAMCO_C123TMAP(config, m_c123tmap);
m_c123tmap->set_palette(m_c116);
m_c123tmap->set_tile_callback(namco_c123tmap_device::c123_tilemap_delegate(&namconb1_state::NB1TilemapCB, this));
m_c123tmap->set_color_base(0x1000);
NAMCO_C116(config, m_c116, 0);
NAMCO_C116(config, m_c116);
m_c116->enable_shadows();
SPEAKER(config, "lspeaker").front_left();
@ -1021,7 +1021,7 @@ void namconb1_state::namconb2(machine_config &config)
m_screen->set_screen_update(FUNC(namconb1_state::screen_update_namconb2));
NAMCO_C169ROZ(config, m_c169roz, 0);
NAMCO_C169ROZ(config, m_c169roz);
m_c169roz->set_palette(m_c116);
m_c169roz->set_is_namcofl(false);
m_c169roz->set_ram_words(0x20000 / 2);

View File

@ -1641,7 +1641,7 @@ via software as INT1
void namcos2_state::configure_c116_standard(machine_config &config)
{
NAMCO_C116(config, m_c116, 0);
NAMCO_C116(config, m_c116);
m_c116->enable_shadows();
}
@ -1761,7 +1761,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(namcos2_state::screen_scanline)
void namcos2_state::configure_c123tmap_standard(machine_config &config)
{
NAMCO_C123TMAP(config, m_c123tmap, 0);
NAMCO_C123TMAP(config, m_c123tmap);
m_c123tmap->set_palette(m_c116);
m_c123tmap->set_tile_callback(namco_c123tmap_device::c123_tilemap_delegate(&namcos2_state::TilemapCB, this));
m_c123tmap->set_color_base(16*256);
@ -1769,7 +1769,7 @@ void namcos2_state::configure_c123tmap_standard(machine_config &config)
void namcos2_state::configure_c169roz_standard(machine_config &config)
{
NAMCO_C169ROZ(config, m_c169roz, 0);
NAMCO_C169ROZ(config, m_c169roz);
m_c169roz->set_palette(m_c116);
m_c169roz->set_is_namcofl(false);
m_c169roz->set_ram_words(0x10000/2);
@ -1778,7 +1778,7 @@ void namcos2_state::configure_c169roz_standard(machine_config &config)
void namcos2_state::configure_c355spr_standard(machine_config &config)
{
NAMCO_C355SPR(config, m_c355spr, 0);
NAMCO_C355SPR(config, m_c355spr);
m_c355spr->set_screen(m_screen);
m_c355spr->set_palette(m_c116);
m_c355spr->set_scroll_offsets(0x26, 0x19);
@ -1789,7 +1789,7 @@ void namcos2_state::configure_c355spr_standard(machine_config &config)
void namcos2_state::configure_c45road_standard(machine_config &config)
{
NAMCO_C45_ROAD(config, m_c45_road, 0);
NAMCO_C45_ROAD(config, m_c45_road);
m_c45_road->set_palette(m_c116);
}

View File

@ -343,7 +343,7 @@ void tceptor_state::tceptor(machine_config &config)
GFXDECODE(config, m_gfxdecode, m_palette, gfx_tceptor);
PALETTE(config, m_palette, FUNC(tceptor_state::tceptor_palette), 4096, 1024);
NAMCO_C45_ROAD(config, m_c45_road, 0);
NAMCO_C45_ROAD(config, m_c45_road);
m_c45_road->set_palette(m_palette);
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);

View File

@ -16,7 +16,7 @@
#include "machine/namco_c148.h"
#include "machine/timer.h"
#include "sound/c140.h"
#include "video/c45.h"
#include "video/namco_c45road.h"
#include "video/namco_c116.h"
#include "machine/namco65.h"
#include "machine/namco68.h"

View File

@ -7,7 +7,7 @@
#include "cpu/m6502/m65c02.h"
#include "sound/namco.h"
#include "video/c45.h"
#include "video/namco_c45road.h"
#include "emupal.h"
#include "screen.h"
#include "tilemap.h"

View File

@ -6,7 +6,6 @@
#pragma once
//***************************************************************************
// TYPE DEFINITIONS
//***************************************************************************
@ -18,7 +17,7 @@ class namco_c116_device :
{
public:
//construction/destruction
namco_c116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
namco_c116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
// configuration
void enable_shadows() { m_enable_shadows = true; }
@ -44,7 +43,7 @@ private:
std::vector<uint8_t> m_ram_g;
std::vector<uint8_t> m_ram_b;
uint16_t m_regs[8];
bool m_enable_shadows; // are shadows enabled?
bool m_enable_shadows; // are shadows enabled?
};
DECLARE_DEVICE_TYPE(NAMCO_C116, namco_c116_device)

View File

@ -13,7 +13,7 @@ class namco_c123tmap_device : public device_t, public device_gfx_interface
{
public:
// construction/destruction
namco_c123tmap_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
namco_c123tmap_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
void set_color_base(int color) { m_color_base = color; }
void set_offset(int xoffs, int yoffs)

View File

@ -13,7 +13,7 @@ class namco_c169roz_device : public device_t, public device_gfx_interface
{
public:
// construction/destruction
namco_c169roz_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
namco_c169roz_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
void set_is_namcofl(bool state) { m_is_namcofl = state; }
void set_ram_words(uint32_t size) { m_ramsize = size; }

View File

@ -133,9 +133,6 @@ void namco_c355spr_device::zdrawgfxzoom(
void namco_c355spr_device::copybitmap(bitmap_ind16 &dest_bmp, const rectangle &clip, u8 pri)
{
device_palette_interface &palette = gfx(0)->palette();
const int shadow_offset = (palette.shadows_enabled()) ? palette.entries() : 0;
const pen_t black = palette.black_pen();
if (m_palxor)
{
for (int y = clip.min_y; y <= clip.max_y; y++)
@ -186,10 +183,9 @@ void namco_c355spr_device::copybitmap(bitmap_ind16 &dest_bmp, const rectangle &c
{
if ((c & 0xff) != 0xff)
{
if (c == 0xffe && shadow_offset)
if (c == 0xffe)
{
if (dest[x] != black)
dest[x] |= shadow_offset;
dest[x] |= 0x800;
}
else
{
@ -206,8 +202,6 @@ void namco_c355spr_device::copybitmap(bitmap_ind16 &dest_bmp, const rectangle &c
void namco_c355spr_device::copybitmap(bitmap_rgb32 &dest_bmp, const rectangle &clip, u8 pri)
{
device_palette_interface &palette = gfx(0)->palette();
const int shadow_offset = (palette.shadows_enabled()) ? palette.entries() : 0;
const pen_t black = palette.black_pen();
const pen_t *pal = &palette.pen(gfx(0)->colorbase());
if (m_palxor)
{
@ -264,10 +258,9 @@ void namco_c355spr_device::copybitmap(bitmap_rgb32 &dest_bmp, const rectangle &c
{
if ((c & 0xff) != 0xff)
{
if (c == 0xffe && shadow_offset)
if (c == 0xffe)
{
if (srcrender[x] != black)
srcrender[x] |= shadow_offset;
srcrender[x] |= 0x800;
}
else
{

View File

@ -12,7 +12,7 @@ class namco_c355spr_device : public device_t, public device_gfx_interface, publi
{
public:
// construction/destruction
namco_c355spr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
namco_c355spr_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
void set_color_base(u16 base) { m_colbase = base; }
void set_scroll_offsets(int x, int y) { m_scrolloffs[0] = x; m_scrolloffs[1] = y; }

View File

@ -37,7 +37,7 @@
*/
#include "emu.h"
#include "video/c45.h"
#include "video/namco_c45road.h"
//****************************************************************************

View File

@ -19,7 +19,7 @@ class namco_c45_road_device : public device_t, public device_gfx_interface, publ
{
public:
// construction/destruction
namco_c45_road_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
namco_c45_road_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
void map(address_map &map);

View File

@ -50,7 +50,6 @@ void namcos2_sprite_device::zdrawgfxzoom(
if (gfx)
{
device_palette_interface &palette = gfx->palette();
const int shadow_offset = (palette.shadows_enabled()) ? palette.entries() : 0;
const pen_t *pal = &palette.pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
const u8 *source_base = gfx->get_data(code % gfx->elements());
const int sprite_screen_height = (scaley * gfx->height() + 0x8000) >> 16;
@ -160,9 +159,9 @@ void namcos2_sprite_device::zdrawgfxzoom(
{
if (pri[x] <= zpos)
{
if (color == 0xf && c==0xfe && shadow_offset)
if (color == 0xf && c == 0xfe)
{
dest[x] |= shadow_offset;
dest[x] |= 0x800;
}
else
{