karnov.cpp - all games use the Deco RM-C3 palette. This is really just a documentation change as the previous colour weighting was correct so there is no visual difference with this change

This commit is contained in:
Bryan McPhail 2017-06-29 04:46:30 -04:00
parent 5f5fd16ad5
commit 23ce1f5b45
3 changed files with 4 additions and 64 deletions

View File

@ -826,8 +826,7 @@ static MACHINE_CONFIG_START( karnov )
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", karnov)
MCFG_PALETTE_ADD("palette", 1024)
MCFG_PALETTE_INIT_OWNER(karnov_state, karnov)
MCFG_DECO_RMC3_ADD_PROMS("palette","proms",1024) // xxxxBBBBGGGGRRRR with custom weighting
MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0)
MCFG_DECO_KARNOVSPRITES_GFX_REGION(2)
@ -905,8 +904,7 @@ static MACHINE_CONFIG_START( wndrplnt )
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", karnov)
MCFG_PALETTE_ADD("palette", 1024)
MCFG_PALETTE_INIT_OWNER(karnov_state, karnov)
MCFG_DECO_RMC3_ADD_PROMS("palette","proms",1024) // xxxxBBBBGGGGRRRR with custom weighting
MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0)
MCFG_DECO_KARNOVSPRITES_GFX_REGION(2)

View File

@ -9,6 +9,7 @@
#include "machine/gen_latch.h"
#include "video/bufsprite.h"
#include "video/deckarn.h"
#include "video/decrmc3.h"
class karnov_state : public driver_device
{
@ -32,7 +33,7 @@ public:
required_device<buffered_spriteram16_device> m_spriteram;
required_device<deco_karnovsprites_device> m_spritegen;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<deco_rmc3_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
/* memory pointers */
@ -69,7 +70,6 @@ public:
TILE_GET_INFO_MEMBER(get_fix_tile_info);
virtual void machine_start() override;
virtual void machine_reset() override;
DECLARE_PALETTE_INIT(karnov);
DECLARE_VIDEO_START(karnov);
DECLARE_VIDEO_START(wndrplnt);
uint32_t screen_update_karnov(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);

View File

@ -9,64 +9,6 @@
#include "emu.h"
#include "includes/karnov.h"
/***************************************************************************
Convert the color PROMs into a more useable format.
Karnov has two 1024x8 palette PROM.
I don't know the exact values of the resistors between the RAM and the
RGB output. I assumed these values (the same as Commando)
bit 7 -- 220 ohm resistor -- GREEN
-- 470 ohm resistor -- GREEN
-- 1 kohm resistor -- GREEN
-- 2.2kohm resistor -- GREEN
-- 220 ohm resistor -- RED
-- 470 ohm resistor -- RED
-- 1 kohm resistor -- RED
bit 0 -- 2.2kohm resistor -- RED
bit 7 -- unused
-- unused
-- unused
-- unused
-- 220 ohm resistor -- BLUE
-- 470 ohm resistor -- BLUE
-- 1 kohm resistor -- BLUE
bit 0 -- 2.2kohm resistor -- BLUE
***************************************************************************/
PALETTE_INIT_MEMBER(karnov_state, karnov)
{
const uint8_t *color_prom = memregion("proms")->base();
int i;
for (i = 0; i < palette.entries(); i++)
{
int bit0, bit1, bit2, bit3, r, g, b;
bit0 = (color_prom[0] >> 0) & 0x01;
bit1 = (color_prom[0] >> 1) & 0x01;
bit2 = (color_prom[0] >> 2) & 0x01;
bit3 = (color_prom[0] >> 3) & 0x01;
r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
bit0 = (color_prom[0] >> 4) & 0x01;
bit1 = (color_prom[0] >> 5) & 0x01;
bit2 = (color_prom[0] >> 6) & 0x01;
bit3 = (color_prom[0] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
bit0 = (color_prom[palette.entries()] >> 0) & 0x01;
bit1 = (color_prom[palette.entries()] >> 1) & 0x01;
bit2 = (color_prom[palette.entries()] >> 2) & 0x01;
bit3 = (color_prom[palette.entries()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette.set_pen_color(i, rgb_t(r, g, b));
color_prom++;
}
}
void karnov_state::karnov_flipscreen_w( int data )
{
m_flipscreen = data;