From 28883ca9ee19a84b016247ad49bf75e6e8943c16 Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 9 Dec 2024 00:15:12 +0100 Subject: kchamp: assume maincpu is 3mhz after all, quasar: use palxbit functions for effect colors --- src/mame/dataeast/kchamp.cpp | 9 +++++---- src/mame/snk/snk6502_v.cpp | 11 +++-------- src/mame/zaccaria/quasar.cpp | 21 +++------------------ 3 files changed, 11 insertions(+), 30 deletions(-) diff --git a/src/mame/dataeast/kchamp.cpp b/src/mame/dataeast/kchamp.cpp index 94565cb15b5..d16b1bbfdc8 100644 --- a/src/mame/dataeast/kchamp.cpp +++ b/src/mame/dataeast/kchamp.cpp @@ -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); } diff --git a/src/mame/snk/snk6502_v.cpp b/src/mame/snk/snk6502_v.cpp index 8dd23ff3d02..70dd2ac19b6 100644 --- a/src/mame/snk/snk6502_v.cpp +++ b/src/mame/snk/snk6502_v.cpp @@ -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; diff --git a/src/mame/zaccaria/quasar.cpp b/src/mame/zaccaria/quasar.cpp index 76d2f1ec021..5727e34e794 100644 --- a/src/mame/zaccaria/quasar.cpp +++ b/src/mame/zaccaria/quasar.cpp @@ -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; -- cgit v1.2.3