mirror of
https://github.com/holub/mame
synced 2025-06-30 16:00:01 +03:00
(MESS) mpt02: Fixed CDP1864 colors. [Curt Coder, Guru]
This commit is contained in:
parent
f7654641d7
commit
a0258d1b2c
@ -61,29 +61,36 @@ const device_type CDP1864 = &device_creator<cdp1864_device>;
|
||||
|
||||
inline void cdp1864_device::initialize_palette()
|
||||
{
|
||||
double res_total = m_chr_r + m_chr_g + m_chr_b + m_chr_bkg;
|
||||
const int resistances_r[] = { m_chr_r };
|
||||
const int resistances_g[] = { m_chr_g };
|
||||
const int resistances_b[] = { m_chr_b };
|
||||
|
||||
int weight_r = (m_chr_r / res_total) * 100;
|
||||
int weight_g = (m_chr_g / res_total) * 100;
|
||||
int weight_b = (m_chr_b / res_total) * 100;
|
||||
int weight_bkg = (m_chr_bkg / res_total) * 100;
|
||||
double color_weights_r[1], color_weights_g[1], color_weights_b[1];
|
||||
double color_weights_bkg_r[1], color_weights_bkg_g[1], color_weights_bkg_b[1];
|
||||
|
||||
for (int i = 0; i < 16; i++)
|
||||
compute_resistor_weights(0, 0xff, -1.0,
|
||||
1, resistances_r, color_weights_r, 0, m_chr_bkg,
|
||||
1, resistances_g, color_weights_g, 0, m_chr_bkg,
|
||||
1, resistances_b, color_weights_b, 0, m_chr_bkg);
|
||||
|
||||
compute_resistor_weights(0, 0xff, -1.0,
|
||||
1, resistances_r, color_weights_bkg_r, m_chr_bkg, 0,
|
||||
1, resistances_g, color_weights_bkg_g, m_chr_bkg, 0,
|
||||
1, resistances_b, color_weights_bkg_b, m_chr_bkg, 0);
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
int luma = 0;
|
||||
|
||||
luma += (i & 4) ? weight_r : 0;
|
||||
luma += (i & 1) ? weight_g : 0;
|
||||
luma += (i & 2) ? weight_b : 0;
|
||||
luma += (i & 8) ? 0 : weight_bkg;
|
||||
|
||||
luma = (luma * 0xff) / 100;
|
||||
|
||||
int r = (i & 4) ? luma : 0;
|
||||
int g = (i & 1) ? luma : 0;
|
||||
int b = (i & 2) ? luma : 0;
|
||||
UINT8 r = combine_1_weights(color_weights_r, BIT(i, 0));
|
||||
UINT8 b = combine_1_weights(color_weights_b, BIT(i, 1));
|
||||
UINT8 g = combine_1_weights(color_weights_g, BIT(i, 2));
|
||||
|
||||
m_palette[i] = MAKE_RGB(r, g, b);
|
||||
|
||||
r = combine_1_weights(color_weights_bkg_r, BIT(i, 0));
|
||||
b = combine_1_weights(color_weights_bkg_b, BIT(i, 1));
|
||||
g = combine_1_weights(color_weights_bkg_g, BIT(i, 2));
|
||||
|
||||
m_palette[i + 8] = MAKE_RGB(r, g, b);
|
||||
}
|
||||
}
|
||||
|
||||
@ -358,11 +365,7 @@ WRITE8_MEMBER( cdp1864_device::step_bgcolor_w )
|
||||
m_disp = 1;
|
||||
|
||||
m_bgcolor++;
|
||||
|
||||
if (m_bgcolor > 3)
|
||||
{
|
||||
m_bgcolor = 0;
|
||||
}
|
||||
m_bgcolor &= 0x03;
|
||||
}
|
||||
|
||||
|
||||
@ -455,11 +458,12 @@ UINT32 cdp1864_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap
|
||||
if (m_disp)
|
||||
{
|
||||
copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect);
|
||||
m_bitmap.fill(CDP1864_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8, cliprect);
|
||||
m_bitmap.fill(m_palette[CDP1864_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8], cliprect);
|
||||
}
|
||||
else
|
||||
{
|
||||
bitmap.fill(get_black_pen(machine()), cliprect);
|
||||
bitmap.fill(m_palette[0], cliprect);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@
|
||||
#define __CDP1864__
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/resnet.h"
|
||||
|
||||
|
||||
|
||||
|
@ -175,6 +175,7 @@ double compute_resistor_weights(
|
||||
#define combine_4_weights(tab,w0,w1,w2,w3) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2) + (tab)[3]*(w3)) + 0.5))
|
||||
#define combine_3_weights(tab,w0,w1,w2) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2)) + 0.5))
|
||||
#define combine_2_weights(tab,w0,w1) ((int)(((tab)[0]*(w0) + (tab)[1]*(w1)) + 0.5))
|
||||
#define combine_1_weights(tab,w0) ((int)(((tab)[0]*(w0) + 0.5)))
|
||||
|
||||
|
||||
|
||||
|
@ -592,7 +592,7 @@ static MACHINE_CONFIG_START( mpt02, mpt02_state )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
|
||||
|
||||
MCFG_CDP1864_ADD(CDP1864_TAG, SCREEN_TAG, CDP1864_CLOCK, GND, INPUTLINE(CDP1802_TAG, COSMAC_INPUT_LINE_INT), INPUTLINE(CDP1802_TAG, COSMAC_INPUT_LINE_DMAOUT), INPUTLINE(CDP1802_TAG, COSMAC_INPUT_LINE_EF1), NULL, READLINE(mpt02_state, rdata_r), READLINE(mpt02_state, bdata_r), READLINE(mpt02_state, gdata_r))
|
||||
MCFG_CDP1864_CHROMINANCE(RES_K(2.2), RES_K(1), RES_K(5.1), RES_K(4.7)) // unverified
|
||||
MCFG_CDP1864_CHROMINANCE(RES_K(4.7), RES_K(8.2), RES_K(4.7), RES_K(22))
|
||||
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
|
||||
|
||||
@ -655,10 +655,10 @@ DRIVER_INIT_MEMBER(studio2_state,studio2)
|
||||
|
||||
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */
|
||||
CONS( 1977, studio2, 0, 0, studio2, studio2, studio2_state, studio2, "RCA", "Studio II", GAME_SUPPORTS_SAVE )
|
||||
CONS( 1978, visicom, studio2,0, visicom, studio2, studio2_state, studio2, "Toshiba", "Visicom COM-100 (Japan)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
|
||||
CONS( 1978, mpt02, studio2,0, mpt02, studio2, studio2_state, studio2, "Soundic", "Victory MPT-02 Home TV Programmer (Austria)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
|
||||
CONS( 1978, mpt02h, studio2,0, mpt02, studio2, studio2_state, studio2, "Hanimex", "MPT-02 Jeu TV Programmable (France)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE)
|
||||
CONS( 1978, mtc9016, studio2,0, mpt02, studio2, studio2_state, studio2, "Mustang", "9016 Telespiel Computer (Germany)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
|
||||
CONS( 1978, shmc1200, studio2,0, mpt02, studio2, studio2_state, studio2, "Sheen", "1200 Micro Computer (Australia)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
|
||||
CONS( 1978, cm1200, studio2,0, mpt02, studio2, studio2_state, studio2, "Conic", "M-1200 (?)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
|
||||
CONS( 1978, apollo80, studio2,0, mpt02, studio2, studio2_state, studio2, "Academy", "Apollo 80 (Germany)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
|
||||
CONS( 1978, visicom, studio2,0, visicom, studio2, studio2_state, studio2, "Toshiba", "Visicom COM-100 (Japan)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
|
||||
CONS( 1978, mpt02, studio2,0, mpt02, studio2, studio2_state, studio2, "Soundic", "Victory MPT-02 Home TV Programmer (Austria)", GAME_SUPPORTS_SAVE )
|
||||
CONS( 1978, mpt02h, studio2,0, mpt02, studio2, studio2_state, studio2, "Hanimex", "MPT-02 Jeu TV Programmable (France)", GAME_SUPPORTS_SAVE)
|
||||
CONS( 1978, mtc9016, studio2,0, mpt02, studio2, studio2_state, studio2, "Mustang", "9016 Telespiel Computer (Germany)", GAME_SUPPORTS_SAVE )
|
||||
CONS( 1978, shmc1200, studio2,0, mpt02, studio2, studio2_state, studio2, "Sheen", "1200 Micro Computer (Australia)", GAME_SUPPORTS_SAVE )
|
||||
CONS( 1978, cm1200, studio2,0, mpt02, studio2, studio2_state, studio2, "Conic", "M-1200 (?)", GAME_SUPPORTS_SAVE )
|
||||
CONS( 1978, apollo80, studio2,0, mpt02, studio2, studio2_state, studio2, "Academy", "Apollo 80 (Germany)", GAME_SUPPORTS_SAVE )
|
||||
|
Loading…
Reference in New Issue
Block a user