summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2021-09-02 23:19:15 +0200
committer hap <happppp@users.noreply.github.com>2021-09-02 23:19:15 +0200
commitd15fc6c284533f1e60f06de01c47f7c25e7c75b6 (patch)
tree9bd417c071f27d6e8f35965a6733bd57b06e7722 /src/mame/video
parent26db143614adfc77b35583bc757cecf20281c110 (diff)
n8080: merge some input ports, remove tag lookups
Diffstat (limited to 'src/mame/video')
-rw-r--r--src/mame/video/n8080.cpp47
1 files changed, 21 insertions, 26 deletions
diff --git a/src/mame/video/n8080.cpp b/src/mame/video/n8080.cpp
index 7d7a7147d02..c80fb805e07 100644
--- a/src/mame/video/n8080.cpp
+++ b/src/mame/video/n8080.cpp
@@ -33,11 +33,11 @@ void helifire_state::helifire_palette(palette_device &palette) const
{
int const level = 0xff * exp(-3 * i / 255.); // capacitor discharge
- palette.set_pen_color(0x000 + 8 + i, rgb_t(0x00, 0x00, level)); // shades of blue
- palette.set_pen_color(0x100 + 8 + i, rgb_t(0x00, 0xc0, level)); // shades of blue w/ green star
+ palette.set_pen_color(0x000 + 8 + i, rgb_t(0x00, 0x00, level)); // shades of blue
+ palette.set_pen_color(0x100 + 8 + i, rgb_t(0x00, 0xc0, level)); // shades of blue w/ green star
- palette.set_pen_color(0x200 + 8 + i, rgb_t(level, 0x00, 0x00)); // shades of red
- palette.set_pen_color(0x300 + 8 + i, rgb_t(level, 0xc0, 0x00)); // shades of red w/ green star
+ palette.set_pen_color(0x200 + 8 + i, rgb_t(level, 0x00, 0x00)); // shades of red
+ palette.set_pen_color(0x300 + 8 + i, rgb_t(level, 0xc0, 0x00)); // shades of red w/ green star
}
}
@@ -129,7 +129,7 @@ uint32_t spacefev_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
uint8_t mask = flip_screen() ? 0xff : 0x00;
uint8_t const *pRAM = m_videoram;
- uint8_t const *const pPROM = memregion("proms")->base();
+ uint8_t const *const pPROM = m_prom->base();
for (int y = 0; y < 256; y++)
{
@@ -154,12 +154,12 @@ uint32_t spacefev_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
{
static const uint8_t ufo_color[] =
{
- 1, /* red */
- 2, /* green */
- 7, /* white */
- 3, /* yellow */
- 5, /* magenta */
- 6, /* cyan */
+ 1, // red
+ 2, // green
+ 7, // white
+ 3, // yellow
+ 5, // magenta
+ 6, // cyan
};
int cycle = screen.frame_number() / 32;
@@ -193,7 +193,7 @@ uint32_t sheriff_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
uint8_t mask = flip_screen() ? 0xff : 0x00;
uint8_t const *pRAM = m_videoram;
- uint8_t const *const pPROM = memregion("proms")->base();
+ uint8_t const *const pPROM = m_prom->base();
for (int y = 0; y < 256; y++)
{
@@ -226,8 +226,8 @@ uint32_t sheriff_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
uint32_t helifire_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- int SUN_BRIGHTNESS = ioport("POT0")->read();
- int SEA_BRIGHTNESS = ioport("POT1")->read();
+ const int SUN_BRIGHTNESS = m_pot[0]->read();
+ const int SEA_BRIGHTNESS = m_pot[1]->read();
static const int wave[8] = { 0, 1, 2, 2, 2, 1, 0, 0 };
@@ -240,16 +240,14 @@ uint32_t helifire_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
int level = 120 + wave[m_mv & 7];
- /* draw sky */
-
+ // draw sky
for (int x = level; x < 256; x++)
{
pLine[x] = 0x200 + 8 + SUN_BRIGHTNESS + x - level;
}
- /* draw stars */
-
- if (m_mv % 8 == 4) /* upper half */
+ // draw stars
+ if (m_mv % 8 == 4) // upper half
{
int step = (320 * (m_mv - 0)) % sizeof m_LSFR;
@@ -262,7 +260,7 @@ uint32_t helifire_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
pLine[0x80 + data] |= 0x100;
}
- if (m_mv % 8 == 5) /* lower half */
+ if (m_mv % 8 == 5) // lower half
{
int step = (320 * (m_mv - 1)) % sizeof m_LSFR;
@@ -275,15 +273,13 @@ uint32_t helifire_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
pLine[0x00 + data] |= 0x100;
}
- /* draw sea */
-
+ // draw sea
for (int x = 0; x < level; x++)
{
pLine[x] = 8 + SEA_BRIGHTNESS + x;
}
- /* draw foreground */
-
+ // draw foreground
for (int x = 0; x < 256; x += 8)
{
int offset = 32 * y + (x >> 3);
@@ -307,8 +303,7 @@ uint32_t helifire_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
}
}
- /* next line */
-
+ // next line
next_line();
}