summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/calomega.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/calomega.cpp')
-rw-r--r--src/mame/video/calomega.cpp36
1 files changed, 16 insertions, 20 deletions
diff --git a/src/mame/video/calomega.cpp b/src/mame/video/calomega.cpp
index 6d58d21f52e..b5a1c3a9e78 100644
--- a/src/mame/video/calomega.cpp
+++ b/src/mame/video/calomega.cpp
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders: Roberto Fresca
+// copyright-holders: Roberto Fresca, Grull Osgo
/***********************************************
.-----------------------------------------.
@@ -7,7 +7,7 @@
| CAL OMEGA / CEI / UCMC |
| SYSTEMS 903 / 904 / 905 / 906-III |
| |
- | Driver by Roberto Fresca. |
+ | Driver by Roberto Fresca & Grull Osgo |
| |
'-----------------------------------------'
@@ -39,12 +39,12 @@ TILE_GET_INFO_MEMBER(calomega_state::get_bg_tile_info)
--xx xx-- tiles color.
---- --x- tiles bank.
x--- ---x extended tiles addressing.
- -x-- ---- seems unused. */
-
+ -x-- ---- seems unused.
+*/
int attr = m_colorram[tile_index];
- int code = ((attr & 1) << 8) | m_videoram[tile_index]; // bit 0 extends the the tiles addressing
- int bank = (attr & 0x02) >> 1; // bit 1 switch the gfx banks
- int color = (attr & 0x3c) >> 2; // bits 2-3-4-5 for color
+ int code = ((attr & 1) << 8) | m_videoram[tile_index]; // bit 0 extends the the tiles addressing.
+ int bank = (attr & 0x02) >> 1; // bit 1 switch the gfx banks.
+ int color = (attr & 0x3c) >> 2; // bits 2-3-4-5 for color.
tileinfo.set(bank, code, color, 0);
}
@@ -57,13 +57,17 @@ void calomega_state::video_start()
uint32_t calomega_state::screen_update_calomega(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
+ if(r_pot != m_red->read()) { r_pot = m_red->read() * 2.55; calomega_palette(*m_palette);}
+ if(g_pot != m_grn->read()) { g_pot = m_grn->read() * 2.55; calomega_palette(*m_palette);}
+ if(b_pot != m_blu->read()) { b_pot = m_blu->read() * 2.55; calomega_palette(*m_palette);}
+
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
void calomega_state::calomega_palette(palette_device &palette) const
{
-/* the proms are 256x4 bit, but the games only seem to need the first 128 entries,
+/* The proms are 256 x 4 bits, but the games only seem to need the first 128 entries,
and the rest of the PROM data looks like junk rather than valid colors
prom bits
@@ -72,17 +76,9 @@ void calomega_state::calomega_palette(palette_device &palette) const
--x- green component
-x-- blue component
x--- foreground (colors with this bit set are full brightness,
- colors with it clear are attenuated by the background color pots)
+ colors with it clear are attenuated by the analogic color pots)
*/
- // TODO: hook pots up as PORT_ADJUSTERs instead of hard coding them here
-
- // let's make the BG a little darker than FG blue
- constexpr int r_pot = 0x00;
- constexpr int g_pot = 0x00;
- constexpr int b_pot = 0xc0;
-
- // 00000BGR
uint8_t const *const color_prom = memregion("proms")->base();
if (!color_prom)
return;
@@ -93,13 +89,13 @@ void calomega_state::calomega_palette(palette_device &palette) const
int const fg = BIT(nibble, 3);
- // red component
+ // red component
int const r = BIT(nibble, 0) * (fg ? 0xff : r_pot);
- // green component
+ // green component
int const g = BIT(nibble, 1) * (fg ? 0xff : g_pot);
- // blue component
+ // blue component
int const b = BIT(nibble, 2) * (fg ? 0xff : b_pot);
palette.set_pen_color(i, rgb_t(r, g, b));