summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2025-10-14 01:35:55 +1100
committer Vas Crabb <vas@vastheman.com>2025-10-14 01:35:55 +1100
commitbb532d39a122454f00d239d6db918710f24116d9 (patch)
treefa84f2a0371eb49e8809a7887f4f06502f84feaa
parent50c45145df872116ce1bf8ad2771b59c16e3b5c3 (diff)
-video/ef9345.cpp: Added a side effects check, tried to clean up a little.
-nintendo/nes.cpp, nes.xml: Use uppercase for filters like most consoles, avoid unnecessarily replacing device. -machine/z80dma.h: Keep member declarations together. -sinclair/specnext_dma.cpp: Tidy.
-rw-r--r--hash/nes.xml36
-rw-r--r--src/devices/machine/z80dma.h4
-rw-r--r--src/devices/video/ef9345.cpp169
-rw-r--r--src/mame/nintendo/nes.cpp4
-rw-r--r--src/mame/sinclair/specnext_dma.cpp7
5 files changed, 104 insertions, 116 deletions
diff --git a/hash/nes.xml b/hash/nes.xml
index 1b524ce8056..9198be5412c 100644
--- a/hash/nes.xml
+++ b/hash/nes.xml
@@ -11837,7 +11837,7 @@ license:CC0-1.0
<info name="serial" value="HVC-BS"/>
<info name="release" value="19840621"/>
<info name="alt_title" value="ファミリーベーシック"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="fc_keyboard" />
<part name="cart" interface="nes_cart">
<feature name="slot" value="hvc_basic" />
@@ -11864,7 +11864,7 @@ license:CC0-1.0
<info name="serial" value="HVC-BS"/>
<info name="release" value="19840621"/>
<info name="alt_title" value="ファミリーベーシック"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="fc_keyboard" />
<part name="cart" interface="nes_cart">
<feature name="slot" value="hvc_basic" />
@@ -11891,7 +11891,7 @@ license:CC0-1.0
<info name="serial" value="HVC-VT"/>
<info name="release" value="19850221"/>
<info name="alt_title" value="ファミリーベーシックV3"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="fc_keyboard" />
<part name="cart" interface="nes_cart">
<feature name="slot" value="hvc_basic" />
@@ -12159,7 +12159,7 @@ license:CC0-1.0
<info name="serial" value="FT-01"/>
<info name="release" value="19861112"/>
<info name="alt_title" value="ファミリートレーナー① アスレチックワールド"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="family_trainer"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="cnrom" />
@@ -12181,7 +12181,7 @@ license:CC0-1.0
<info name="serial" value="FT-01"/>
<info name="release" value="19861112"/>
<info name="alt_title" value="ファミリートレーナー① アスレチックワールド"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="family_trainer"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="cnrom" />
@@ -12203,7 +12203,7 @@ license:CC0-1.0
<info name="serial" value="FT-02"/>
<info name="release" value="19861223"/>
<info name="alt_title" value="ファミリートレーナー② ランニングスタジアム"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="family_trainer"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="cnrom" />
@@ -12225,7 +12225,7 @@ license:CC0-1.0
<info name="serial" value="FT-03"/>
<info name="release" value="19870226"/>
<info name="alt_title" value="ファミリートレーナー③ エアロビスタジオ"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="family_trainer"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="bandai_pt554" />
@@ -12251,7 +12251,7 @@ license:CC0-1.0
<info name="serial" value="FT-04"/>
<info name="release" value="19870528"/>
<info name="alt_title" value="ファミリートレーナー④ ジョギングレース"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="family_trainer"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="cnrom" />
@@ -12273,7 +12273,7 @@ license:CC0-1.0
<info name="serial" value="FT-05"/>
<info name="release" value="19870731"/>
<info name="alt_title" value="ファミリートレーナー⑤ 迷路大作戦"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="family_trainer"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="discrete_74x161" />
@@ -12295,7 +12295,7 @@ license:CC0-1.0
<info name="serial" value="FT-07"/>
<info name="release" value="19871127"/>
<info name="alt_title" value="ファミリートレーナー⑦ ファミトレ大運動会"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="family_trainer"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="cnrom" />
@@ -12317,7 +12317,7 @@ license:CC0-1.0
<info name="serial" value="FT-08"/>
<info name="release" value="19871201"/>
<info name="alt_title" value="ファミリートレーナー⑧ 突撃!風雲たけし城"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="family_trainer"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="cnrom" />
@@ -12339,7 +12339,7 @@ license:CC0-1.0
<info name="serial" value="FT-09"/>
<info name="release" value="19881220"/>
<info name="alt_title" value="ファミリートレーナー⑨ 風雲たけし城二"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="family_trainer"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="gxrom" />
@@ -44357,7 +44357,7 @@ We should eventually add it to MAME as a separate driver with a NES CPU and a GB
<description>Playbox BASIC (Japan, V1.0)</description>
<year>198?</year>
<publisher>Nintendo / Hudson Soft / Sharp</publisher>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="fc_keyboard" />
<part name="cart" interface="nes_cart">
<feature name="slot" value="hvc_basic" />
@@ -44379,7 +44379,7 @@ We should eventually add it to MAME as a separate driver with a NES CPU and a GB
<description>Playbox BASIC (Japan, V0.0)</description>
<year>198?</year>
<publisher>Nintendo / Hudson Soft / Sharp</publisher>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="fc_keyboard" />
<part name="cart" interface="nes_cart">
<feature name="slot" value="hvc_basic" />
@@ -46863,7 +46863,7 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
<info name="serial" value="HVC-BS"/>
<info name="release" value="19840621"/>
<info name="alt_title" value="ファミリーベーシック"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="fc_keyboard" />
<part name="cart" interface="nes_cart">
<feature name="slot" value="hvc_basic" />
@@ -46904,7 +46904,7 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
<description>Family Trainer 10 - Rairai Kyonshiizu - Baby Kyonshii no Amida Daibouken (Japan, prototype)</description>
<year>1989</year>
<publisher>Bandai</publisher>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="family_trainer"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="cnrom" />
@@ -46927,7 +46927,7 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
<info name="serial" value="FT-10"/>
<info name="release" value="19890131"/>
<info name="alt_title" value="来来キョンシーズ ベビーキョンシーのあみだ大冒険"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="family_trainer"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="cnrom" />
@@ -46951,7 +46951,7 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
<info name="serial" value="FT-06"/>
<info name="release" value="19870801"/>
<info name="alt_title" value="ファミリートレーナー⑥ マンハッタンポリス"/>
- <sharedfeat name="compatibility" value="exp" />
+ <sharedfeat name="compatibility" value="EXP" />
<sharedfeat name="exp_default" value="family_trainer"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="discrete_74x161" />
diff --git a/src/devices/machine/z80dma.h b/src/devices/machine/z80dma.h
index 0fc175a43ac..3d80d0f3af4 100644
--- a/src/devices/machine/z80dma.h
+++ b/src/devices/machine/z80dma.h
@@ -129,11 +129,11 @@ protected:
virtual TIMER_CALLBACK_MEMBER(clock_w);
- emu_timer *m_timer;
-
u16 &REG(unsigned m, unsigned s) noexcept { return m_regs[REGNUM(m, s)]; }
static constexpr unsigned REGNUM(unsigned m, unsigned s) { return (m << 3) + s; }
+ emu_timer *m_timer;
+
u16 m_addressA;
u16 m_addressB;
u16 m_count;
diff --git a/src/devices/video/ef9345.cpp b/src/devices/video/ef9345.cpp
index 80556b9bbd8..8dff1a41cc0 100644
--- a/src/devices/video/ef9345.cpp
+++ b/src/devices/video/ef9345.cpp
@@ -17,6 +17,8 @@
#include "screen.h"
+#include <algorithm>
+
#define MODE24x40 0
#define MODEVAR40 1
@@ -533,9 +535,8 @@ void ef9345_device::quadrichrome40(uint8_t c, uint8_t b, uint8_t a, uint16_t x,
//B3-5 = set number
//A0-6 = 4 color palette
- uint8_t i, j, n, col[8], pix[80];
- uint8_t lowresolution = (b & 0x02) >> 1, ramx, ramy, ramblock;
- uint16_t ramindex;
+ uint8_t col[8], pix[80];
+ const uint8_t lowresolution = BIT(b, 1);
if (m_variant == EF9345_MODE::TYPE_TS9347)
{
@@ -543,34 +544,30 @@ void ef9345_device::quadrichrome40(uint8_t c, uint8_t b, uint8_t a, uint16_t x,
return;
}
- //quadrichrome don't suppor double size
+ //quadrichrome don't support double size
m_last_dial[x] = 0;
//initialize the color table
- for (j = 1, n = 0, i = 0; i < 8; i++)
+ for (uint8_t n = 0, i = 0; i < 8; i++)
{
col[i] = 7;
- if (a & j)
+ if (BIT(a, i))
col[n++] = i;
-
- j <<= 1;
}
//find block number in ram
- ramblock = 0;
- if (b & 0x20) ramblock |= 4; //B5
- if (b & 0x08) ramblock |= 2; //B3
- if (b & 0x10) ramblock |= 1; //B4
+ const uint8_t ramblock = bitswap<3>(b, 5, 3, 4); // B5 B3 B4
//find character address in ram
- ramx = c & 0x03;
- ramy =(c & 0x7f) >> 2;
- ramindex = 0x0800 * ramblock + 0x40 * ramy + ramx;
- if (lowresolution) ramindex += 5 * (b & 0x04);
+ const uint8_t ramx = c & 0x03;
+ const uint8_t ramy = (c >> 2) & 0x1f;
+ uint16_t ramindex = (0x0800 * ramblock) + (0x40 * ramy) + ramx;
+ if (lowresolution)
+ ramindex += 5 * (b & 0x04);
//fill pixel table
- for (i = 0, j = 0; i < 10; i++)
+ for (uint8_t i = 0, j = 0; i < 10; i++)
{
uint8_t ch = read_char(0x0c, ramindex + 4 * (i >> lowresolution));
pix[j] = pix[j + 1] = col[(ch & 0x03) >> 0]; j += 2;
@@ -586,13 +583,12 @@ void ef9345_device::quadrichrome40(uint8_t c, uint8_t b, uint8_t a, uint16_t x,
void ef9345_device::bichrome80(uint8_t c, uint8_t a, uint16_t x, uint16_t y, bool cursor)
{
uint8_t c0, c1, pix[60];
- uint16_t i, j, d;
- bool insert = BIT(m_dor, (a & 1) ? 7 : 3); //insert = DOR7/DOR3
- c1 = (a & 1) ? (m_dor >> 4) & 7 : m_dor & 7; //foreground color = DOR
- c0 = m_mat & 7; //background color = MAT
+ const bool insert = BIT(m_dor, (a & 1) ? 7 : 3); //insert = DOR7/DOR3
+ c1 = (m_dor >> ((a & 1) ? 4 : 0)) & 7; //foreground color = DOR
+ c0 = m_mat & 7; //background color = MAT
- if (m_variant == EF9345_MODE::TYPE_TS9347 || (c & 0x80) == 0) //alphanumeric G0 set
+ if (m_variant == EF9345_MODE::TYPE_TS9347 || !BIT(c, 7)) //alphanumeric G0 set
{
// On the TS9347, G11 comes right after G0 starting from char 128.
uint8_t index = (c & 0x80) ? 3 : 0;
@@ -602,26 +598,26 @@ void ef9345_device::bichrome80(uint8_t c, uint8_t a, uint16_t x, uint16_t y, boo
//A2: F = flash
//A3: N = negative
//C0-6: character code
- bool underline = (a & 2) >> 1;
- bool flash = (a & 4) >> 2;
- bool negative = (a & 8) >> 3;
+ bool underline = BIT(a, 1);
+ bool flash = BIT(a, 2);
+ bool negative = BIT(a, 3);
bool cursor_underline;
std::tie(c0, c1, cursor_underline) = makecolors(c0, c1, insert, flash, false, negative, cursor);
underline ^= cursor_underline;
- d = ((c & 0x7f) >> 2) * 0x40 + (c & 0x03); //char position
+ const uint16_t d = ((c >> 2) & 0x1f) * 0x40 + (c & 0x03); //char position
- for (i=0, j=0; i < 10; i++)
+ for (uint16_t i=0, j=0; i < 10; i++)
{
uint8_t ch = read_char(index, d + 4 * i);
for (uint8_t b=0; b<6; b++)
- pix[j++] = (ch & (1<<b)) ? c1 : c0;
+ pix[j++] = BIT(ch, b) ? c1 : c0;
}
//draw the underline
if (underline)
- memset(&pix[54], c1, 6);
+ std::fill_n(&pix[54], 6, c1);
}
else //dedicated mosaic set (EF9345 only)
{
@@ -632,29 +628,29 @@ void ef9345_device::bichrome80(uint8_t c, uint8_t a, uint16_t x, uint16_t y, boo
bool cursor_underline;
std::tie(c0, c1, cursor_underline) = makecolors(c0, c1, insert, false, false, false, cursor);
- pix[ 0] = (c & 0x01) ? c1 : c0;
- pix[ 3] = (c & 0x02) ? c1 : c0;
- pix[12] = (c & 0x04) ? c1 : c0;
- pix[15] = (c & 0x08) ? c1 : c0;
- pix[24] = (c & 0x10) ? c1 : c0;
- pix[27] = (c & 0x20) ? c1 : c0;
- pix[36] = (c & 0x40) ? c1 : c0;
- pix[39] = (a & 0x02) ? c1 : c0;
- pix[48] = (a & 0x04) ? c1 : c0;
- pix[51] = (a & 0x08) ? c1 : c0;
-
- for (i = 0; i < 60; i += 12)
+ pix[ 0] = BIT(c, 0) ? c1 : c0;
+ pix[ 3] = BIT(c, 1) ? c1 : c0;
+ pix[12] = BIT(c, 2) ? c1 : c0;
+ pix[15] = BIT(c, 3) ? c1 : c0;
+ pix[24] = BIT(c, 4) ? c1 : c0;
+ pix[27] = BIT(c, 5) ? c1 : c0;
+ pix[36] = BIT(c, 6) ? c1 : c0;
+ pix[39] = BIT(a, 1) ? c1 : c0;
+ pix[48] = BIT(a, 2) ? c1 : c0;
+ pix[51] = BIT(a, 3) ? c1 : c0;
+
+ for (uint16_t i = 0; i < 60; i += 12)
{
pix[i + 6] = pix[i];
pix[i + 9] = pix[i + 3];
}
- for (i = 0; i < 60; i += 3)
+ for (uint16_t i = 0; i < 60; i += 3)
pix[i + 2] = pix[i + 1] = pix[i];
//draw the underline
if (cursor_underline)
- memset(&pix[54], c1, 6);
+ std::fill_n(&pix[54], 6, c1);
}
draw_char_80(pix, x + 1, y + 1);
@@ -663,18 +659,15 @@ void ef9345_device::bichrome80(uint8_t c, uint8_t a, uint16_t x, uint16_t y, boo
// generate 16 bits 40 columns char
void ef9345_device::makechar_16x40(uint16_t x, uint16_t y)
{
- uint8_t a, b, c0, c1, i, f, m, n, u, type, dial;
- uint16_t address, iblock;
+ const uint16_t iblock = (m_mat & 0x80 && y > 1) ? indexblock(x, y / 2) : indexblock(x, y);
+ const uint8_t a = m_videoram->read_byte(m_block + iblock);
+ const uint8_t b = m_videoram->read_byte(m_block + iblock + 0x0800);
- iblock = (m_mat & 0x80 && y > 1) ? indexblock(x, y / 2) : indexblock(x, y);
- a = m_videoram->read_byte(m_block + iblock);
- b = m_videoram->read_byte(m_block + iblock + 0x0800);
-
- dial = get_dial(x, (a & 0x80) ? 0 : (((a & 0x20) >> 5) | ((a & 0x10) >> 3)));
+ const uint8_t dial = get_dial(x, BIT(a, 7) ? 0 : bitswap<2>(a, 4, 5));
//type and address of the char
- type = ((b & 0x80) >> 4) | ((a & 0x80) >> 6);
- address = ((b & 0x7f) >> 2) * 0x40 + (b & 0x03);
+ uint8_t type = ((b & 0x80) >> 4) | ((a & 0x80) >> 6);
+ uint16_t address = ((b >> 2) & 0x1f) * 0x40 + (b & 0x03);
//reset attributes latch
if (x == 0)
@@ -699,13 +692,13 @@ void ef9345_device::makechar_16x40(uint16_t x, uint16_t y)
}
//char attributes
- c0 = m_latchc0; //background
- c1 = a & 0x07; //foreground
- i = m_latchi; //insert mode
- f = (a & 0x08) >> 3; //flash
- m = m_latchm; //conceal
- n = (a & 0x80) ? 0: ((a & 0x40) >> 6); //negative
- u = m_latchu; //underline
+ const uint8_t c0 = m_latchc0; //background
+ const uint8_t c1 = a & 0x07; //foreground
+ const uint8_t i = m_latchi; //insert mode
+ const uint8_t f = BIT(a, 3); //flash
+ const uint8_t m = m_latchm; //conceal
+ const uint8_t n = BIT(a, 7) ? 0 : BIT(a, 6); //negative
+ const uint8_t u = m_latchu; //underline
bichrome40(type, address, dial, iblock, x, y, c0, c1, i, f, m, n, u);
}
@@ -713,13 +706,10 @@ void ef9345_device::makechar_16x40(uint16_t x, uint16_t y)
// generate 24 bits 40 columns char
void ef9345_device::makechar_24x40(uint16_t x, uint16_t y)
{
- uint8_t a, b, c, c0, c1, i, f, m, n, u, type, dial;
- uint16_t address, iblock;
-
- iblock = (m_mat & 0x80 && y > 1) ? indexblock(x, y / 2) : indexblock(x, y);
- c = m_videoram->read_byte(m_block + iblock);
- b = m_videoram->read_byte(m_block + iblock + 0x0800);
- a = m_videoram->read_byte(m_block + iblock + 0x1000);
+ const uint16_t iblock = (m_mat & 0x80 && y > 1) ? indexblock(x, y / 2) : indexblock(x, y);
+ const uint8_t c = m_videoram->read_byte(m_block + iblock);
+ const uint8_t b = m_videoram->read_byte(m_block + iblock + 0x0800);
+ const uint8_t a = m_videoram->read_byte(m_block + iblock + 0x1000);
if ((b & 0xc0) == 0xc0)
{
@@ -727,22 +717,22 @@ void ef9345_device::makechar_24x40(uint16_t x, uint16_t y)
return;
}
- dial = get_dial(x, (b & 0x02) + ((b & 0x08) >> 3));
+ const uint8_t dial = get_dial(x, bitswap<2>(b, 1, 3));
//type and address of the char
- address = ((c & 0x7f) >> 2) * 0x40 + (c & 0x03);
- type = (b & 0xf0) >> 4;
+ const uint16_t address = ((c >> 2) & 0x1f) * 0x40 + (c & 0x03);
+ uint8_t type = (b & 0xf0) >> 4;
if (m_variant == EF9345_MODE::TYPE_TS9347 && !(type & 0x8))
type &= 0x3; // drop the i2 bit, which is not part of the type
//char attributes
- c0 = a & 0x07; //background
- c1 = (a & 0x70) >> 4; //foreground
- i = b & 0x01; //insert
- f = (a & 0x08) >> 3; //flash
- m = (b & 0x04) >> 2; //conceal
- n = ((a & 0x80) >> 7); //negative
- u = (((b & 0x60) == 0) || ((b & 0xc0) == 0x40)) ? ((b & 0x10) >> 4) : 0; //underline
+ const uint8_t c0 = a & 0x07; //background
+ const uint8_t c1 = (a >> 4) & 0x07; //foreground
+ const uint8_t i = BIT(b, 0); //insert
+ const uint8_t f = BIT(a, 3); //flash
+ const uint8_t m = BIT(b, 2); //conceal
+ const uint8_t n = BIT(a, 7); //negative
+ const uint8_t u = (((b & 0x60) == 0) || ((b & 0xc0) == 0x40)) ? BIT(b, 4) : 0; //underline
bichrome40(type, address, dial, iblock, x, y, c0, c1, i, f, m, n, u);
}
@@ -750,14 +740,14 @@ void ef9345_device::makechar_24x40(uint16_t x, uint16_t y)
// generate 12 bits 80 columns char
void ef9345_device::makechar_12x80(uint16_t x, uint16_t y)
{
- uint16_t iblock = indexblock(x, y);
- bool cursor_odd = BIT(m_registers[7], 7);
+ const uint16_t iblock = indexblock(x, y);
+ const bool cursor_odd = BIT(m_registers[7], 7);
//test if the cursor is on one of the two characters that we are rendering.
uint8_t i = (m_registers[6] & 0x1f);
if (i < 8)
i &= 1;
- bool cursor = iblock == 0x40 * i + (m_registers[7] & 0x3f);
+ const bool cursor = iblock == (0x40 * i + (m_registers[7] & 0x3f));
bichrome80(m_videoram->read_byte(m_block + iblock), (m_videoram->read_byte(m_block + iblock + 0x1000) >> 4) & 0x0f, 2 * x, y, cursor && !cursor_odd);
bichrome80(m_videoram->read_byte(m_block + iblock + 0x0800), m_videoram->read_byte(m_block + iblock + 0x1000) & 0x0f, 2 * x + 1, y, cursor && cursor_odd);
@@ -1085,8 +1075,6 @@ uint32_t ef9345_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
void ef9345_device::update_scanline(uint16_t scanline)
{
- uint16_t i;
-
if (scanline == 250)
{
// We are past the end of the screen, clear the VSYNC flag.
@@ -1121,12 +1109,12 @@ void ef9345_device::update_scanline(uint16_t scanline)
// Update the first row of text.
if (m_pat & 1)
{
- for (i = 0; i < 40; i++)
+ for (uint16_t i = 0; i < 40; i++)
makechar(i, (scanline / 10));
}
else
{
- for (i = 0; i < 42; i++)
+ for (uint16_t i = 0; i < 42; i++)
draw_char_40(m_border, i, 1);
}
}
@@ -1135,7 +1123,7 @@ void ef9345_device::update_scanline(uint16_t scanline)
// Update the current row.
if (m_pat & 2)
{
- for (i = 0; i < 40; i++)
+ for (uint16_t i = 0; i < 40; i++)
makechar(i, (scanline / 10));
}
else
@@ -1148,14 +1136,14 @@ void ef9345_device::update_scanline(uint16_t scanline)
// Update the current row.
if (m_variant == EF9345_MODE::TYPE_TS9347)
{
- for (i = 0; i < 40; i++)
+ for (uint16_t i = 0; i < 40; i++)
makechar(i, (scanline / 10));
}
else
{
if (m_pat & 4) // Lower bulk enable
{
- for (i = 0; i < 40; i++)
+ for (uint16_t i = 0; i < 40; i++)
makechar(i, (scanline / 10));
}
else
@@ -1176,12 +1164,11 @@ uint8_t ef9345_device::data_r(offs_t offset)
if (offset & 7)
return m_registers[offset & 7];
- if (m_bf)
- m_state |= 0x80;
- else
- m_state &= 0x7f;
+ const uint8_t result = m_bf ? (m_state | 0x80) : (m_state & 0x7f);
+ if (!machine().side_effects_disabled())
+ m_state = result;
- return m_state;
+ return result;
}
void ef9345_device::data_w(offs_t offset, uint8_t data)
diff --git a/src/mame/nintendo/nes.cpp b/src/mame/nintendo/nes.cpp
index b1fcccae244..061f7427d52 100644
--- a/src/mame/nintendo/nes.cpp
+++ b/src/mame/nintendo/nes.cpp
@@ -436,7 +436,7 @@ void nes_state::nes(machine_config &config)
NES_CONTROL_PORT(config, m_special, nes_control_special_devices, nullptr).set_screen_tag(m_screen);
NES_CART_SLOT(config, m_cartslot, NTSC_APU_CLOCK, nes_cart, nullptr).set_must_be_loaded(true);
- SOFTWARE_LIST(config, "cart_list").set_original("nes").set_filter("!exp");
+ SOFTWARE_LIST(config, "cart_list").set_original("nes").set_filter("!EXP");
SOFTWARE_LIST(config, "ade_list").set_original("nes_ade"); // Camerica/Codemasters Aladdin Deck Enhancer mini-carts
SOFTWARE_LIST(config, "ntb_list").set_original("nes_ntbrom"); // Sunsoft Nantettate! Baseball mini-carts
SOFTWARE_LIST(config, "kstudio_list").set_original("nes_kstudio"); // Bandai Karaoke Studio expansion carts
@@ -473,7 +473,7 @@ void nes_state::famicom(machine_config &config)
NES_CONTROL_PORT(config.replace(), m_ctrl2, fc_control_port2_devices, "joypad").set_screen_tag(m_screen);
NES_CONTROL_PORT(config, m_exp, fc_expansion_devices, nullptr).set_screen_tag(m_screen);
- SOFTWARE_LIST(config.replace(), "cart_list").set_original("nes");
+ subdevice<software_list_device>("cart_list")->set_filter(nullptr);
SOFTWARE_LIST(config, "flop_list").set_original("famicom_flop");
SOFTWARE_LIST(config, "cass_list").set_original("famicom_cass");
}
diff --git a/src/mame/sinclair/specnext_dma.cpp b/src/mame/sinclair/specnext_dma.cpp
index 84dd09d20d7..6ad53e10474 100644
--- a/src/mame/sinclair/specnext_dma.cpp
+++ b/src/mame/sinclair/specnext_dma.cpp
@@ -64,12 +64,13 @@ void specnext_dma_device::write(u8 data)
}
else
{
- int nreg = m_regs_follow[m_cur_follow];
- if(nreg == REGNUM(2, 1))
+ const u8 nreg = m_regs_follow[m_cur_follow];
+ if (nreg == REGNUM(2, 1))
{
if (data & 0x20)
m_regs_follow[m_num_follow++] = GET_REGNUM(ZXN_PRESCALER);
- } else if(nreg == REGNUM(2, 2))
+ }
+ else if (nreg == REGNUM(2, 2))
{
m_r2_portB_preescaler_s = data;
}