diff options
Diffstat (limited to 'src/mame/drivers/fgoal.cpp')
-rw-r--r-- | src/mame/drivers/fgoal.cpp | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/src/mame/drivers/fgoal.cpp b/src/mame/drivers/fgoal.cpp index 3c2d146469d..8aee26d04be 100644 --- a/src/mame/drivers/fgoal.cpp +++ b/src/mame/drivers/fgoal.cpp @@ -19,53 +19,47 @@ Differences between these sets include ***************************************************************************/ #include "emu.h" -#include "cpu/m6800/m6800.h" #include "includes/fgoal.h" +#include "cpu/m6800/m6800.h" int fgoal_state::intensity(int bits) { int v = 0; - /* contrary to the schems pull-up resistors are 270 and not 390 */ + // contrary to the schems pull-up resistors are 270 and not 390 if (1) - { - v += 0x2e; /* 100 + 270 */ - } + v += 0x2e; // 100 + 270 + if (bits & 1) - { - v += 0x27; /* 100 + 330 */ - } + v += 0x27; // 100 + 330 + if (bits & 2) - { - v += 0xaa; /* 100 */ - } + v += 0xaa; // 100 return v; } -PALETTE_INIT_MEMBER(fgoal_state, fgoal) +void fgoal_state::fgoal_palette(palette_device &palette) const { - const uint8_t *color_prom = memregion("proms")->base(); - int i; - - /* for B/W screens PCB can be jumpered to use lower half of PROM */ + // for B/W screens PCB can be jumpered to use lower half of PROM - for (i = 0; i < 128; i++) + uint8_t const *const color_prom = memregion("proms")->base(); + for (int i = 0; i < 128; i++) { - uint8_t color = color_prom[0x80 | i] & 63; + uint8_t const color = color_prom[0x80 | i] & 63; palette.set_pen_color(i, intensity(color >> 4), intensity(color >> 2), intensity(color >> 0)); } - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) { - palette.set_pen_color(128 + 0*8 + i, rgb_t(0x2e,0x80,0x2e)); - palette.set_pen_color(128 + 1*8 + i, rgb_t(0x2e,0x2e,0x2e)); + palette.set_pen_color(128 + 0*8 + i, rgb_t(0x2e, 0x80, 0x2e)); + palette.set_pen_color(128 + 1*8 + i, rgb_t(0x2e, 0x2e, 0x2e)); } - /* ball is a fixed color */ + // ball is a fixed color palette.set_pen_color(128 + 16, intensity(0x38 >> 4), intensity(0x38 >> 2), intensity(0x38 >> 0)); } @@ -371,7 +365,6 @@ MACHINE_CONFIG_START(fgoal_state::fgoal) MCFG_DEVICE_ADD("maincpu", M6800, 10065000 / 10) /* ? */ MCFG_DEVICE_PROGRAM_MAP(cpu_map) - /* add shifter */ MB14241(config, "mb14241"); @@ -381,11 +374,10 @@ MACHINE_CONFIG_START(fgoal_state::fgoal) MCFG_SCREEN_SIZE(256, 263) MCFG_SCREEN_VISIBLE_AREA(0, 255, 16, 255) MCFG_SCREEN_UPDATE_DRIVER(fgoal_state, screen_update) - MCFG_SCREEN_PALETTE("palette") + MCFG_SCREEN_PALETTE(m_palette); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_fgoal) - MCFG_PALETTE_ADD("palette", 128 + 16 + 1) - MCFG_PALETTE_INIT_OWNER(fgoal_state, fgoal) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_fgoal); + PALETTE(config, m_palette, FUNC(fgoal_state::fgoal_palette), 128 + 16 + 1); /* sound hardware */ MACHINE_CONFIG_END |