kchamp: assume maincpu is 3mhz after all,

quasar: use palxbit functions for effect colors
This commit is contained in:
hap 2024-12-09 00:15:12 +01:00
parent a7cbceda69
commit 28883ca9ee
3 changed files with 11 additions and 30 deletions

View File

@ -459,7 +459,7 @@ void kchamp_state::kchampvs(machine_config &config)
void kchamp_state::kchamp(machine_config &config)
{
// Basic machine hardware
Z80(config, m_maincpu, 8_MHz_XTAL / 2);
Z80(config, m_maincpu, 12_MHz_XTAL / 4);
m_maincpu->set_addrmap(AS_PROGRAM, &kchamp_state::kchamp_map);
m_maincpu->set_addrmap(AS_IO, &kchamp_state::kchamp_io_map);
@ -503,9 +503,10 @@ void kchamp_state::kchamp_arfyc(machine_config &config)
{
kchamp(config);
m_audiocpu->set_clock(XTAL(8'867'238)/2); // 8.867238 MHz xtal / 2, measured on real PCB
m_ay[0]->set_clock(XTAL(8'867'238)/8); // 8.867238 MHz xtal / 8, measured on real PCB
m_ay[1]->set_clock(XTAL(8'867'238)/8); // 8.867238 MHz xtal / 8, measured on real PCB
// different sound hw XTAL, clocks verified on PCB
m_audiocpu->set_clock(8.867238_MHz_XTAL / 2);
m_ay[0]->set_clock(8.867238_MHz_XTAL / 8);
m_ay[1]->set_clock(8.867238_MHz_XTAL / 8);
}

View File

@ -17,7 +17,6 @@
#define COLOR(gfxn,offs) (m_gfxdecode->gfx(gfxn)->colorbase() + offs)
/***************************************************************************
Convert the color PROMs into a more useable format.
@ -25,6 +24,7 @@
Zarzon has a different PROM layout from the others.
***************************************************************************/
void snk6502_state::snk6502_palette(palette_device &palette)
{
uint8_t const *const color_prom = memregion("proms")->base();
@ -56,7 +56,7 @@ void snk6502_state::snk6502_palette(palette_device &palette)
m_palette_val[i] = rgb_t(r, g, b);
}
m_backcolor = 0; // background color can be changed by the game
m_backcolor = 0; // background color can be changed by the game
for (int i = 0; i < TOTAL_COLORS(0); i++)
palette.set_pen_color(COLOR(0, i), m_palette_val[i]);
@ -102,7 +102,6 @@ void snk6502_state::charram_w(offs_t offset, uint8_t data)
void snk6502_state::flipscreen_w(uint8_t data)
{
/* bits 0-2 select background color */
if (m_backcolor != (data & 7))
{
m_backcolor = data & 7;
@ -112,7 +111,6 @@ void snk6502_state::flipscreen_w(uint8_t data)
}
/* bit 3 selects char bank */
int bank = (~data & 0x08) >> 3;
if (m_charbank != bank)
@ -122,7 +120,6 @@ void snk6502_state::flipscreen_w(uint8_t data)
}
/* bit 7 flips screen */
if (flip_screen() != (data & 0x80))
{
flip_screen_set(data & 0x80);
@ -228,7 +225,7 @@ void snk6502_state::satansat_palette(palette_device &palette)
m_palette_val[i] = rgb_t(r, g, b);
}
m_backcolor = 0; // background color can be changed by the game
m_backcolor = 0; // background color can be changed by the game
for (int i = 0; i < TOTAL_COLORS(0); i++)
palette.set_pen_color(COLOR(0, i), m_palette_val[4 * (i % 4) + (i / 4)]);
@ -245,7 +242,6 @@ void snk6502_state::satansat_palette(palette_device &palette)
void snk6502_state::satansat_b002_w(uint8_t data)
{
/* bit 0 flips screen */
if (flip_screen() != (data & 0x01))
{
flip_screen_set(data & 0x01);
@ -261,7 +257,6 @@ void snk6502_state::satansat_b002_w(uint8_t data)
void snk6502_state::satansat_backcolor_w(uint8_t data)
{
/* bits 0-1 select background color. Other bits unused. */
if (m_backcolor != (data & 0x03))
{
m_backcolor = data & 0x03;

View File

@ -164,24 +164,9 @@ void quasar_state::palette(palette_device &palette) const
// effects color map
for (int i = 0; i < 0x100; i++)
{
int bit0, bit1, bit2;
// red component
bit0 = BIT(i, 7);
bit1 = BIT(i, 6);
bit2 = BIT(i, 5);
int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
// green component
bit0 = BIT(i, 4);
bit1 = BIT(i, 3);
bit2 = BIT(i, 2);
int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
// blue component
bit0 = BIT(i, 1);
bit1 = BIT(i, 0);
int const b = 0x4f * bit0 + 0xa8 * bit1;
int const r = pal3bit(bitswap<3>(i, 5, 6, 7));
int const g = pal3bit(bitswap<3>(i, 2, 3, 4));
int const b = pal2bit(bitswap<2>(i, 0, 1));
// 4 intensities
float level = 0.0f;