summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author Couriersud <couriersud@gmx.org>2019-03-06 23:45:51 +0100
committer Couriersud <couriersud@gmx.org>2019-03-06 23:45:51 +0100
commite91d8e693903db25f85190592bfa6f7d7278f7c6 (patch)
tree8c50912a630c04d83b7a5bedae460cf8c24c15a0 /src/devices
parent07485fd7eb00e474d6d8455de923be83a934bb3f (diff)
parenteea8a69fbc583cb032417e0a3491b1179afea2f1 (diff)
Merge branch 'master' of https://github.com/mamedev/mame.git
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/bus/hexbus/hx5102.cpp5
-rw-r--r--src/devices/bus/ti99/gromport/cartridges.cpp8
-rw-r--r--src/devices/bus/ti99/internal/992board.cpp6
-rw-r--r--src/devices/bus/ti99/peb/bwg.cpp4
-rw-r--r--src/devices/bus/ti99/peb/evpc.cpp3
-rw-r--r--src/devices/bus/ti99/peb/hfdc.cpp4
-rw-r--r--src/devices/bus/ti99/peb/ti_fdc.cpp4
-rw-r--r--src/devices/bus/ti99/peb/ti_rs232.cpp6
-rw-r--r--src/devices/bus/ti99/peb/tn_ide.cpp6
-rw-r--r--src/devices/bus/ti99/peb/tn_usbsm.cpp5
-rw-r--r--src/devices/bus/ti99x/990_dk.cpp17
-rw-r--r--src/devices/cpu/amis2000/amis2000.h3
-rw-r--r--src/devices/cpu/amis2000/amis2000op.cpp11
-rw-r--r--src/devices/cpu/tms9900/tms9900.cpp79
-rw-r--r--src/devices/cpu/tms9900/tms9995.cpp63
-rw-r--r--src/devices/cpu/tms9900/tms9995.h2
-rw-r--r--src/devices/machine/tms9901.cpp6
-rw-r--r--src/devices/machine/tms9902.cpp123
-rw-r--r--src/devices/machine/upd765.cpp31
-rw-r--r--src/devices/machine/x2201.cpp11
-rw-r--r--src/devices/machine/x2201.h1
-rw-r--r--src/devices/sound/pokey.cpp87
-rw-r--r--src/devices/sound/pokey.h9
-rw-r--r--src/devices/sound/spkrdev.h4
-rw-r--r--src/devices/video/mc6845.cpp2
25 files changed, 265 insertions, 235 deletions
diff --git a/src/devices/bus/hexbus/hx5102.cpp b/src/devices/bus/hexbus/hx5102.cpp
index bf0f9d541cb..10558fd641d 100644
--- a/src/devices/bus/hexbus/hx5102.cpp
+++ b/src/devices/bus/hexbus/hx5102.cpp
@@ -121,8 +121,7 @@ void hx5102_device::memmap(address_map &map)
*/
void hx5102_device::crumap(address_map &map)
{
- map(0x17e0>>4, 0x17fe>>4).r(FUNC(hx5102_device::cruread));
- map(0x17e0>>1, 0x17fe>>1).w(FUNC(hx5102_device::cruwrite));
+ map(0x17e0, 0x17ff).rw(FUNC(hx5102_device::cruread), FUNC(hx5102_device::cruwrite));
}
hx5102_device::hx5102_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock):
@@ -475,7 +474,7 @@ READ8_MEMBER(hx5102_device::cruread)
crubits |= ((ioport("HXDIP")->read())<<4);
- return crubits;
+ return BIT(crubits, offset);
}
/*
diff --git a/src/devices/bus/ti99/gromport/cartridges.cpp b/src/devices/bus/ti99/gromport/cartridges.cpp
index 7e93029f97f..ddef0c5cd81 100644
--- a/src/devices/bus/ti99/gromport/cartridges.cpp
+++ b/src/devices/bus/ti99/gromport/cartridges.cpp
@@ -826,15 +826,11 @@ READ8Z_MEMBER(ti99_super_cartridge::crureadz)
// SRL R0,1 Restore Bank Number (optional)
// RT
- // Our implementation in MESS always gets 8 bits in one go. Also, the address
- // is twice the bit number. That is, the offset value is always a multiple
- // of 0x10.
-
if ((offset & 0xfff0) == 0x0800)
{
LOGMASKED(LOG_CRU, "CRU accessed at %04x\n", offset);
uint8_t val = 0x02 << (m_ram_page << 1);
- *value = (val >> ((offset - 0x0800)>>1)) & 0xff;
+ *value = BIT(val, (offset & 0x000e) >> 1);
}
}
@@ -1231,7 +1227,7 @@ READ8Z_MEMBER(ti99_pagedcru_cartridge::crureadz)
{
page = page-(bit/2); // 4 page flags per 8 bits
}
- *value = 1 << (page*2+1);
+ *value = (offset & 0x000e) == (page * 4 + 2) ? 1 : 0;
}
}
diff --git a/src/devices/bus/ti99/internal/992board.cpp b/src/devices/bus/ti99/internal/992board.cpp
index 330bcee4566..2f712d92712 100644
--- a/src/devices/bus/ti99/internal/992board.cpp
+++ b/src/devices/bus/ti99/internal/992board.cpp
@@ -458,13 +458,13 @@ void io992_device::device_start()
READ8_MEMBER(io992_device::cruread)
{
- int address = offset << 4;
+ int address = offset << 1;
uint8_t value = 0x7f; // All Hexbus lines high
double inp = 0;
int i;
uint8_t bit = 1;
- switch (address)
+ switch (address & 0xf800)
{
case 0xe000:
// CRU E000-E7fE: Keyboard
@@ -494,7 +494,7 @@ READ8_MEMBER(io992_device::cruread)
LOGMASKED(LOG_CRU, "CRU %04x -> %02x\n", address, value);
- return value;
+ return BIT(value, offset & 7);
}
WRITE8_MEMBER(io992_device::cruwrite)
diff --git a/src/devices/bus/ti99/peb/bwg.cpp b/src/devices/bus/ti99/peb/bwg.cpp
index c7aa2c903b7..e0a1b9c767a 100644
--- a/src/devices/bus/ti99/peb/bwg.cpp
+++ b/src/devices/bus/ti99/peb/bwg.cpp
@@ -338,7 +338,7 @@ READ8Z_MEMBER(snug_bwg_device::crureadz)
if ((offset & 0xff00)==m_cru_base)
{
- if ((offset & 0x00ff)==0)
+ if ((offset & 0x00f0)==0)
{
// Check what drives are not connected
reply = ((m_floppy[0] != nullptr)? 0 : 0x02) // DSK1
@@ -355,7 +355,7 @@ READ8Z_MEMBER(snug_bwg_device::crureadz)
reply |= (m_dip34 << 6);
// Invert all
- *value = ~reply;
+ *value = ~BIT(reply, (offset >> 1) & 7);
}
else
*value = 0;
diff --git a/src/devices/bus/ti99/peb/evpc.cpp b/src/devices/bus/ti99/peb/evpc.cpp
index fc5591112d5..7b2a74658c7 100644
--- a/src/devices/bus/ti99/peb/evpc.cpp
+++ b/src/devices/bus/ti99/peb/evpc.cpp
@@ -323,8 +323,9 @@ READ8Z_MEMBER(snug_enhanced_video_device::crureadz)
{
if ((offset & 0x00f0)==0) // offset 0 delivers bits 0-7 (address 00-0f)
{
- *value = ~(ioport("EVPC-SW1")->read() | (ioport("EVPC-SW3")->read()<<2)
+ uint8_t p = ~(ioport("EVPC-SW1")->read() | (ioport("EVPC-SW3")->read()<<2)
| (ioport("EVPC-SW4")->read()<<3) | (ioport("EVPC-SW8")->read()<<7));
+ *value = BIT(p, (offset >> 1) & 7);
}
}
}
diff --git a/src/devices/bus/ti99/peb/hfdc.cpp b/src/devices/bus/ti99/peb/hfdc.cpp
index 97ac8d403ab..f9c2e9656cc 100644
--- a/src/devices/bus/ti99/peb/hfdc.cpp
+++ b/src/devices/bus/ti99/peb/hfdc.cpp
@@ -376,7 +376,7 @@ READ8Z_MEMBER(myarc_hfdc_device::crureadz)
uint8_t reply;
if ((offset & 0xff00)==m_cru_base)
{
- if ((offset & 0x00ff)==0) // CRU bits 0-7
+ if ((offset & 0x00f0)==0) // CRU bits 0-7
{
if (m_see_switches)
{
@@ -390,7 +390,7 @@ READ8Z_MEMBER(myarc_hfdc_device::crureadz)
if (!m_motor_running) reply |= 0x04;
if (m_wait_for_hd1) reply |= 0x08;
}
- *value = reply;
+ *value = BIT(reply, (offset >> 1) & 7);
}
else // CRU bits 8+
{
diff --git a/src/devices/bus/ti99/peb/ti_fdc.cpp b/src/devices/bus/ti99/peb/ti_fdc.cpp
index 530dc71d987..c2a4fe7490a 100644
--- a/src/devices/bus/ti99/peb/ti_fdc.cpp
+++ b/src/devices/bus/ti99/peb/ti_fdc.cpp
@@ -201,7 +201,7 @@ READ8Z_MEMBER(ti_fdc_device::crureadz)
if ((offset & 0xff00)==m_cru_base)
{
uint8_t reply = 0;
- if ((offset & 0x07) == 0)
+ if ((offset & 0x0070) == 0)
{
// Selected drive
reply |= ((m_DSEL)<<1);
@@ -212,7 +212,7 @@ READ8Z_MEMBER(ti_fdc_device::crureadz)
// Selected side
if (m_SIDSEL==ASSERT_LINE) reply |= 0x80;
}
- *value = reply;
+ *value = BIT(reply, (offset >> 1) & 0x07);
LOGMASKED(LOG_CRU, "Read CRU = %02x\n", *value);
}
}
diff --git a/src/devices/bus/ti99/peb/ti_rs232.cpp b/src/devices/bus/ti99/peb/ti_rs232.cpp
index fb7ce4eaa0a..15194444851 100644
--- a/src/devices/bus/ti99/peb/ti_rs232.cpp
+++ b/src/devices/bus/ti99/peb/ti_rs232.cpp
@@ -254,17 +254,17 @@ READ8Z_MEMBER(ti_rs232_pio_device::crureadz)
if ((m_signals[0] & tms9902_device::CTS)!=0) reply |= 0x20;
if ((m_signals[1] & tms9902_device::CTS)!=0) reply |= 0x40;
if (m_led) reply |= 0x80;
- *value = reply;
+ *value = BIT(reply, (offset>>1) & 7);
return;
}
if ((offset & 0x00c0)==0x0040)
{
- *value = m_uart0->cruread(space, offset>>4, 0xff);
+ *value = m_uart0->cruread(space, offset>>1, 0xff);
return;
}
if ((offset & 0x00c0)==0x0080)
{
- *value = m_uart1->cruread(space, offset>>4, 0xff);
+ *value = m_uart1->cruread(space, offset>>1, 0xff);
return;
}
}
diff --git a/src/devices/bus/ti99/peb/tn_ide.cpp b/src/devices/bus/ti99/peb/tn_ide.cpp
index 243450fd34f..e569fc090b4 100644
--- a/src/devices/bus/ti99/peb/tn_ide.cpp
+++ b/src/devices/bus/ti99/peb/tn_ide.cpp
@@ -71,9 +71,7 @@ READ8Z_MEMBER(nouspikel_ide_interface_device::crureadz)
uint8_t reply = 0;
if ((offset & 0xff00)==m_cru_base)
{
- int bit = (offset >> 4) & 7;
-
- if (bit==0)
+ if ((offset & 0x0070) == 0)
{
reply = m_cru_register & 0x30;
reply |= 8; /* IDE bus IORDY always set */
@@ -84,7 +82,7 @@ READ8Z_MEMBER(nouspikel_ide_interface_device::crureadz)
if (!m_ata_irq)
reply |= 1;
}
- *value = reply;
+ *value = BIT(reply, (offset >> 1) & 7);
}
}
diff --git a/src/devices/bus/ti99/peb/tn_usbsm.cpp b/src/devices/bus/ti99/peb/tn_usbsm.cpp
index c558579445e..f4f198053df 100644
--- a/src/devices/bus/ti99/peb/tn_usbsm.cpp
+++ b/src/devices/bus/ti99/peb/tn_usbsm.cpp
@@ -93,9 +93,8 @@ READ8Z_MEMBER(nouspikel_usb_smartmedia_device::crureadz)
if ((offset & 0xff00)==m_cru_base)
{
uint8_t reply = 0;
- offset &= 3;
- if (offset == 0)
+ if ((offset & 0x0030) == 0)
{
// bit
// 0 >1x00 0: USB Host controller requests interrupt.
@@ -117,7 +116,7 @@ READ8Z_MEMBER(nouspikel_usb_smartmedia_device::crureadz)
else if (!m_smartmedia->is_protected())
reply |= 0x80;
}
- *value = reply;
+ *value = BIT(reply, (offset >> 1) & 7);
}
}
diff --git a/src/devices/bus/ti99x/990_dk.cpp b/src/devices/bus/ti99x/990_dk.cpp
index 118804ddb2b..a634bba7a24 100644
--- a/src/devices/bus/ti99x/990_dk.cpp
+++ b/src/devices/bus/ti99x/990_dk.cpp
@@ -709,19 +709,16 @@ READ8_MEMBER( fd800_legacy_device::cru_r )
{
int reply = 0;
- switch (offset)
+ offset &= 31;
+ if (offset < 16)
{
- case 0:
- case 1:
// receive buffer
- reply = m_recv_buf >> (offset*8);
- break;
-
- case 2:
- case 3:
+ reply = BIT(m_recv_buf, offset);
+ }
+ else
+ {
// status register
- reply = m_stat_reg >> ((offset-2)*8);
- break;
+ reply = BIT(m_stat_reg, offset - 16);
}
return reply;
diff --git a/src/devices/cpu/amis2000/amis2000.h b/src/devices/cpu/amis2000/amis2000.h
index 2739461b44b..58665c7f6bc 100644
--- a/src/devices/cpu/amis2000/amis2000.h
+++ b/src/devices/cpu/amis2000/amis2000.h
@@ -30,12 +30,13 @@ public:
// S2000 has a hardcoded 7seg table, that (unlike S2200) is officially
// uncustomizable, but wildfire proves to be an exception to that rule.
- void set_7seg_table(const u8 *ptr) { m_7seg_table = ptr; }
+ void set_7seg_table(const u8 *ptr) { m_7seg_table = ptr; } // d0=A, d1=B, etc.
void data_64x4(address_map &map);
void data_80x4(address_map &map);
void program_1_5k(address_map &map);
void program_1k(address_map &map);
+
protected:
// construction/destruction
amis2000_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 bu_bits, u8 callstack_bits, u8 callstack_depth, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data)
diff --git a/src/devices/cpu/amis2000/amis2000op.cpp b/src/devices/cpu/amis2000/amis2000op.cpp
index e67ee6d153b..92c2eaae3dc 100644
--- a/src/devices/cpu/amis2000/amis2000op.cpp
+++ b/src/devices/cpu/amis2000/amis2000op.cpp
@@ -220,11 +220,13 @@ void amis2000_base_device::op_disn()
// DISN: set D-latch to ACC+carry via on-die segment decoder
static const u8 lut_segment_decoder[0x10] =
{
- // 0-F digits in bit order [DP]abcdefg
- 0x7e, 0x30, 0x6d, 0x79, 0x33, 0x5b, 0x5f, 0x70, 0x7f, 0x7b, 0x77, 0x1f, 0x4e, 0x3d, 0x4f, 0x47
+ 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, // 0-7
+ 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71 // 8-F
};
- const u8 *ptr = (m_7seg_table != nullptr) ? m_7seg_table : lut_segment_decoder;
- m_d = ptr[m_acc] | (m_carry ? 0x80 : 0x00);
+ const u8 *lut = (m_7seg_table != nullptr) ? m_7seg_table : lut_segment_decoder;
+
+ // segments are in order [DP]abcdefg
+ m_d = bitswap<7>(lut[m_acc],0,1,2,3,4,5,6) | (m_carry ? 0x80 : 0x00);
d_latch_out(true);
}
@@ -500,7 +502,6 @@ void amis2000_base_device::op_rf2()
}
-
// AMI S2152 specific handlers
void amis2152_cpu_device::d2f_timer_clock()
diff --git a/src/devices/cpu/tms9900/tms9900.cpp b/src/devices/cpu/tms9900/tms9900.cpp
index 8f092a3159d..d1576197247 100644
--- a/src/devices/cpu/tms9900/tms9900.cpp
+++ b/src/devices/cpu/tms9900/tms9900.cpp
@@ -182,11 +182,11 @@ tms99xx_device::tms99xx_device(const machine_config &mconfig, device_type type,
: cpu_device(mconfig, type, tag, owner, clock),
m_program_config("program", ENDIANNESS_BIG, data_width, prg_addr_bits),
m_setoffset_config("setoffset", ENDIANNESS_BIG, data_width, prg_addr_bits),
- m_io_config("cru", ENDIANNESS_BIG, 8, cru_addr_bits),
+ m_io_config("cru", ENDIANNESS_LITTLE, 8, cru_addr_bits + 1, 1),
m_prgspace(nullptr),
m_cru(nullptr),
m_prgaddr_mask((1<<prg_addr_bits)-1),
- m_cruaddr_mask((1<<cru_addr_bits)-1),
+ m_cruaddr_mask((2<<cru_addr_bits)-2),
m_clock_out_line(*this),
m_wait_line(*this),
m_holda_line(*this),
@@ -1625,67 +1625,70 @@ void tms99xx_device::register_write()
idempotent (i.e. they must not change the state of the queried device).
Read returns the number of consecutive CRU bits, with increasing CRU address
- from the least significant to the most significant bit; right-aligned
+ from the least significant to the most significant bit; right-aligned (in
+ other words, little-endian as opposed to the big-endian order of memory words).
There seems to be no handling of wait states during CRU operations on the
TMS9900. The TMS9995, in contrast, respects wait states during the transmission
of each single bit.
+ The current emulation of the CRU space involves a 1-bit address shift,
+ reflecting the one-to-one correspondence between CRU bits and words (not
+ bytes) in the lower part of the memory space. (On the TMS9980A and TMS9995,
+ CRUOUT is multiplexed with the least significant address line.) Thus, what
+ TI's documentation calls the software address (the R12 base value plus the
+ bit offset multiplied by 2) is used in address maps and CPU-side operations.
+ MAME's memory architecture automatically translates these to right-justified
+ hardware addresses in the process of decoding offsets for read/write handlers,
+ which is more typical of what peripheral devices expect. (Note also that
+ address spaces do not support data widths narrower than 8 bits, so these
+ handlers must specify 8-bit types despite only one bit being useful.)
+
Usage of this method:
CRU write: First bit is at rightmost position of m_value.
*/
void tms99xx_device::cru_input_operation()
{
- int value, value1;
- int offset, location;
-
- location = (m_cru_address >> 4) & (m_cruaddr_mask>>3);
- offset = (m_cru_address>>1) & 0x07;
-
- // Read 8 bits (containing the desired bits)
- value = m_cru->read_byte(location);
+ offs_t cruaddr = m_cru_address & m_cruaddr_mask;
+ uint16_t value = 0;
- if ((offset + m_count) > 8) // spans two 8 bit cluster
+ for (int i = 0; i < m_count; i++)
{
- // Read next 8 bits
- location = (location + 1) & (m_cruaddr_mask>>3);
- value1 = m_cru->read_byte(location);
- value |= (value1 << 8);
+ // Poll one bit at a time
+ bool cruin = BIT(m_cru->read_byte(cruaddr), 0);
+ if (cruin)
+ value |= 1 << i;
- if ((offset + m_count) > 16) // spans three 8 bit cluster
- {
- // Read next 8 bits
- location = (location + 1) & (m_cruaddr_mask>>3);
- value1 = m_cru->read_byte(location);
- value |= (value1 << 16);
- }
- }
+ if (TRACE_CRU) logerror("CRU input operation, address %04x, value %d\n", cruaddr, cruin ? 1 : 0);
- // On each machine cycle (2 clocks) only one CRU bit is transmitted
- pulse_clock(m_count<<1);
+ // Increment the CRU address
+ cruaddr = (cruaddr + 2) & m_cruaddr_mask;
- // Shift back the bits so that the first bit is at the rightmost place
- m_value = (value >> offset);
+ // On each machine cycle (2 clocks) only one CRU bit is transmitted
+ pulse_clock(2);
+ }
- // Mask out what we want
- m_value &= (0x0000ffff >> (16-m_count));
+ m_value = value;
}
void tms99xx_device::cru_output_operation()
{
- int value;
- int location;
- location = (m_cru_address >> 1) & m_cruaddr_mask;
- value = m_value;
+ offs_t cruaddr = m_cru_address & m_cruaddr_mask;
+ uint16_t value = m_value;
// Write m_count bits from cru_address
- for (int i=0; i < m_count; i++)
+ for (int i = 0; i < m_count; i++)
{
- if (TRACE_CRU) logerror("CRU output operation, address %04x, value %d\n", location<<1, value & 0x01);
- m_cru->write_byte(location, (value & 0x01));
+ if (TRACE_CRU) logerror("CRU output operation, address %04x, value %d\n", cruaddr, BIT(value, 0));
+
+ // Write one bit at a time
+ m_cru->write_byte(cruaddr, BIT(value, 0));
value >>= 1;
- location = (location + 1) & m_cruaddr_mask;
+
+ // Increment the CRU address
+ cruaddr = (cruaddr + 2) & m_cruaddr_mask;
+
pulse_clock(2);
}
}
diff --git a/src/devices/cpu/tms9900/tms9995.cpp b/src/devices/cpu/tms9900/tms9995.cpp
index 67a0439a8ba..ae1b74e8237 100644
--- a/src/devices/cpu/tms9900/tms9995.cpp
+++ b/src/devices/cpu/tms9900/tms9995.cpp
@@ -170,7 +170,7 @@ tms9995_device::tms9995_device(const machine_config &mconfig, device_type type,
PC_debug(0),
m_program_config("program", ENDIANNESS_BIG, 8, 16),
m_setoffset_config("setoffset", ENDIANNESS_BIG, 8, 16),
- m_io_config("cru", ENDIANNESS_BIG, 8, 16),
+ m_io_config("cru", ENDIANNESS_LITTLE, 8, 16, 1),
m_prgspace(nullptr),
m_sospace(nullptr),
m_cru(nullptr),
@@ -288,8 +288,6 @@ void tms9995_device::device_start()
save_item(NAME(m_cru_address));
save_item(NAME(m_cru_value));
save_item(NAME(m_cru_first_read));
- save_item(NAME(m_cru_bits_left));
- save_item(NAME(m_cru_read));
save_pointer(NAME(m_flag),16);
save_item(NAME(IR));
save_item(NAME(m_pre_IR));
@@ -2096,8 +2094,8 @@ void tms9995_device::return_with_address_copy()
*/
-#define CRUREADMASK 0x0fff
-#define CRUWRITEMASK 0x7fff
+#define CRUREADMASK 0xfffe
+#define CRUWRITEMASK 0xfffe
void tms9995_device::cru_output_operation()
{
@@ -2133,7 +2131,7 @@ void tms9995_device::cru_output_operation()
// of the CPU. However, no wait states are generated for internal
// accesses. ([1], section 2.3.3.2)
- m_cru->write_byte((m_cru_address >> 1)& CRUWRITEMASK, (m_cru_value & 0x01));
+ m_cru->write_byte(m_cru_address & CRUWRITEMASK, (m_cru_value & 0x01));
m_cru_value >>= 1;
m_cru_address = (m_cru_address + 2) & 0xfffe;
m_count--;
@@ -2154,55 +2152,28 @@ void tms9995_device::cru_output_operation()
void tms9995_device::cru_input_operation()
{
- uint16_t crubit;
- uint8_t crubyte;
-
- // Reading is different, since MESS uses 8 bit transfers
- // We read 8 bits in one go, then iterate another min(n-1,7) times to allow
- // for wait states.
-
- // read_byte for CRU delivers the first bit on the rightmost position
-
- int offset = (m_cru_address>>1) & 0x07;
-
- if (m_cru_first_read || m_cru_bits_left == 0)
+ if (m_cru_first_read)
{
- // Read next 8 bits
- // 00000000 0rrrrrrr r
- // v
- // ........ ........ X....... ........
- //
- crubyte = m_cru->read_byte((m_cru_address >> 4)& CRUREADMASK);
- LOGMASKED(LOG_DETAIL, "Need to get next 8 bits (addresses %04x-%04x): %02x\n", (m_cru_address&0xfff0)+14, m_cru_address&0xfff0, crubyte);
- m_cru_read = crubyte << 15;
- m_cru_bits_left = 8;
-
- if (m_cru_first_read)
- {
- m_cru_read >>= offset;
- m_cru_bits_left -= offset;
- m_cru_value = 0;
- m_cru_first_read = false;
- m_pass = m_count;
- }
- LOGMASKED(LOG_DETAIL, "adjusted value for shift: %06x\n", m_cru_read);
+ m_cru_value = 0;
+ m_cru_first_read = false;
+ m_pass = m_count;
}
- crubit = (m_cru_read & 0x8000);
+ bool crubit = BIT(m_cru->read_byte(m_cru_address & CRUREADMASK), 0);
m_cru_value = (m_cru_value >> 1) & 0x7fff;
// During internal reading, the CRUIN line will be ignored. We emulate this
// by overwriting the bit which we got from outside. Also, READY is ignored.
if (m_cru_address == 0x1fda)
{
- crubit = m_mid_flag? 0x8000 : 0x0000;
+ crubit = m_mid_flag;
m_check_ready = false;
}
else
{
if ((m_cru_address & 0xffe0)==0x1ee0)
{
- crubit = (m_flag[(m_cru_address>>1)&0x000f]==true)? 0x8000 : 0x0000;
+ crubit = m_flag[(m_cru_address>>1)&0x000f];
m_check_ready = false;
}
else
@@ -2211,18 +2182,14 @@ void tms9995_device::cru_input_operation()
}
}
- LOGMASKED(LOG_CRU, "CRU input operation, address %04x, value %d\n", m_cru_address, (crubit & 0x8000)>>15);
+ LOGMASKED(LOG_CRU, "CRU input operation, address %04x, value %d\n", m_cru_address, crubit ? 1 : 0);
- m_cru_value |= crubit;
+ if (crubit)
+ m_cru_value |= 0x8000;
m_cru_address = (m_cru_address + 2) & 0xfffe;
- m_cru_bits_left--;
- if (m_pass > 1)
- {
- m_cru_read >>= 1;
- }
- else
+ if (m_pass == 1)
{
// This is the final shift. For both byte and word length transfers,
// the first bit is always m_cru_value & 0x0001.
diff --git a/src/devices/cpu/tms9900/tms9995.h b/src/devices/cpu/tms9900/tms9995.h
index 72dfc2960a1..531e5208a41 100644
--- a/src/devices/cpu/tms9900/tms9995.h
+++ b/src/devices/cpu/tms9900/tms9995.h
@@ -245,8 +245,6 @@ private:
uint16_t m_cru_address;
uint16_t m_cru_value;
bool m_cru_first_read;
- int m_cru_bits_left;
- uint32_t m_cru_read;
// CPU-internal CRU flags
bool m_flag[16];
diff --git a/src/devices/machine/tms9901.cpp b/src/devices/machine/tms9901.cpp
index af01c6ac7fe..aadfec82f20 100644
--- a/src/devices/machine/tms9901.cpp
+++ b/src/devices/machine/tms9901.cpp
@@ -279,9 +279,9 @@ READ8_MEMBER( tms9901_device::read )
{
int answer = 0;
- offset &= 0x003;
+ offset &= 0x01f;
- switch (offset)
+ switch (offset >> 3)
{
case 0:
if (m_clock_mode)
@@ -356,7 +356,7 @@ READ8_MEMBER( tms9901_device::read )
break;
}
- return answer;
+ return BIT(answer, offset & 7);
}
/*
diff --git a/src/devices/machine/tms9902.cpp b/src/devices/machine/tms9902.cpp
index 93e48cf03a2..bf0071889f0 100644
--- a/src/devices/machine/tms9902.cpp
+++ b/src/devices/machine/tms9902.cpp
@@ -482,44 +482,105 @@ READ8_MEMBER( tms9902_device::cruread )
{
uint8_t answer = 0;
- offset &= 0x0003;
-
- switch (offset)
+ switch (offset & 31)
{
- case 3: // Bits 31-24
- if (m_INT) answer |= 0x80;
- if (m_LDCTRL || m_LDIR || m_LRDR || m_LXDR || m_BRKON) answer |= 0x40;
- if (m_DSCH) answer |= 0x20;
- if (m_CTSin) answer |= 0x10;
- if (m_DSRin) answer |= 0x08;
- if (m_RTSout) answer |= 0x04;
- if (m_TIMELP) answer |= 0x02;
- if (m_TIMERR) answer |= 0x01;
+ case 31:
+ answer = m_INT;
+ break;
+
+ case 30:
+ answer = (m_LDCTRL || m_LDIR || m_LRDR || m_LXDR || m_BRKON);
+ break;
+
+ case 29:
+ answer = m_DSCH;
+ break;
+
+ case 28:
+ answer = m_CTSin;
+ break;
+
+ case 27:
+ answer = m_DSRin;
+ break;
+
+ case 26:
+ answer = m_RTSout;
+ break;
+
+ case 25:
+ answer = m_TIMELP;
+ break;
+
+ case 24:
+ answer = m_TIMERR;
+ break;
+
+ case 23:
+ answer = m_XSRE;
+ break;
+
+ case 22:
+ answer = m_XBRE;
+ break;
+
+ case 21:
+ answer = m_RBRL;
+ break;
+
+ case 20:
+ answer = (m_DSCH && m_DSCENB);
+ break;
+
+ case 19:
+ answer = (m_TIMELP && m_TIMENB);
+ break;
+
+ case 17:
+ answer = (m_XBRE && m_XBIENB);
+ break;
+
+ case 16:
+ answer = (m_RBRL && m_RIENB);
+ break;
+
+ case 15:
+ answer = m_RIN;
+ break;
+
+ case 14:
+ answer = m_RSBD;
+ break;
+
+ case 13:
+ answer = m_RFBD;
+ break;
+
+ case 12:
+ answer = m_RFER;
+ break;
+
+ case 11:
+ answer = m_ROVER;
break;
- case 2: // Bits 23-16
- if (m_XSRE) answer |= 0x80;
- if (m_XBRE) answer |= 0x40;
- if (m_RBRL) answer |= 0x20;
- if (m_DSCH && m_DSCENB) answer |= 0x10;
- if (m_TIMELP && m_TIMENB) answer |= 0x08;
- if (m_XBRE && m_XBIENB) answer |= 0x02;
- if (m_RBRL && m_RIENB) answer |= 0x01;
+ case 10:
+ answer = m_RPER;
break;
- case 1: // Bits 15-8
- if (m_RIN) answer |= 0x80;
- if (m_RSBD) answer |= 0x40;
- if (m_RFBD) answer |= 0x20;
- if (m_RFER) answer |= 0x10;
- if (m_ROVER) answer |= 0x08;
- if (m_RPER) answer |= 0x04;
- if (m_RPER || m_RFER || m_ROVER) answer |= 0x02;
+ case 9:
+ answer = (m_RPER || m_RFER || m_ROVER);
break;
- case 0: // Bits 7-0
- LOGCRU("Reading received byte = %02x\n", m_RBR);
- answer = m_RBR;
+ case 7:
+ case 6:
+ case 5:
+ case 4:
+ case 3:
+ case 2:
+ case 1:
+ case 0:
+ answer = BIT(m_RBR, offset & 31);
break;
}
if (VERBOSE & LOG_DETAIL) LOGCRU("Reading flag bits %d - %d = %02x\n", ((offset+1)*8-1), offset*8, answer);
diff --git a/src/devices/machine/upd765.cpp b/src/devices/machine/upd765.cpp
index ac5359ae07f..4a55eba7bae 100644
--- a/src/devices/machine/upd765.cpp
+++ b/src/devices/machine/upd765.cpp
@@ -18,6 +18,7 @@
#define LOG_MATCH (1U << 10) // Sector matching
#define LOG_STATE (1U << 11) // State machine
#define LOG_LIVE (1U << 12) // Live states
+#define LOG_DONE (1U << 13) // Command done
#define VERBOSE (LOG_GENERAL | LOG_WARN )
@@ -38,6 +39,7 @@
#define LOGMATCH(...) LOGMASKED(LOG_MATCH, __VA_ARGS__)
#define LOGSTATE(...) LOGMASKED(LOG_STATE, __VA_ARGS__)
#define LOGLIVE(...) LOGMASKED(LOG_LIVE, __VA_ARGS__)
+#define LOGDONE(...) LOGMASKED(LOG_DONE, __VA_ARGS__)
DEFINE_DEVICE_TYPE(UPD765A, upd765a_device, "upd765a", "NEC uPD765A FDC")
DEFINE_DEVICE_TYPE(UPD765B, upd765b_device, "upd765b", "NEC uPD765B FDC")
@@ -1484,7 +1486,7 @@ void upd765_family_device::execute_command(int cmd)
void upd765_family_device::command_end(floppy_info &fi, bool data_completion)
{
- LOGCOMMAND("command done (%s) - %s\n", data_completion ? "data" : "seek", results());
+ LOGDONE("command done (%s) - %s\n", data_completion ? "data" : "seek", results());
fi.main_state = fi.sub_state = IDLE;
if(data_completion)
data_irq = true;
@@ -1756,7 +1758,16 @@ void upd765_family_device::read_data_continue(floppy_info &fi)
fi.sub_state = COMMAND_DONE;
break;
}
+ // MZ: This st1 handling ensures that both HX5102 floppy and the
+ // Speedlock protection scheme are properly working.
+ // a) HX5102 requires that the ND flag not be set when no address
+ // marks could be found on the track at all (particularly due to
+ // wrong density)
+ // b) Speedlock requires the ND flag be set when there are valid
+ // sectors on the track, but the desired sector is missing, also
+ // when it has no valid address marks
st1 &= ~ST1_MA;
+ st1 |= ST1_ND;
if(!sector_matches()) {
if(cur_live.idbuf[0] != command[2]) {
if(cur_live.idbuf[0] == 0xff)
@@ -1768,6 +1779,7 @@ void upd765_family_device::read_data_continue(floppy_info &fi)
live_start(fi, SEARCH_ADDRESS_MARK_HEADER);
return;
}
+ st1 &= ~ST1_ND;
LOGRW("reading sector %02x %02x %02x %02x\n",
cur_live.idbuf[0],
cur_live.idbuf[1],
@@ -1786,11 +1798,6 @@ void upd765_family_device::read_data_continue(floppy_info &fi)
case SCAN_ID_FAILED:
LOGSTATE("SCAN_ID_FAILED\n");
fi.st0 |= ST0_FAIL;
- // MZ: The HX5102 does not correctly detect a FM/MFM mismatch
- // when the ND bit is set, because in the firmware the ND bit wins
- // against MA, and thus concludes that the format is correct
- // but the sector is missing.
- // st1 |= ST1_ND;
fi.sub_state = COMMAND_DONE;
break;
@@ -1862,7 +1869,7 @@ void upd765_family_device::write_data_start(floppy_info &fi)
fi.main_state = WRITE_DATA;
fi.sub_state = HEAD_LOAD;
mfm = command[0] & 0x40;
- LOGRW("command write%s data%s%s cmd=%02x sel=%x chrn=(%d, %d, %d, %d) eot=%02x gpl=%02x dtl=%02x rate=%d\n",
+ LOGCOMMAND("command write%s data%s%s cmd=%02x sel=%x chrn=(%d, %d, %d, %d) eot=%02x gpl=%02x dtl=%02x rate=%d\n",
command[0] & 0x08 ? " deleted" : "",
command[0] & 0x80 ? " mt" : "",
command[0] & 0x40 ? " mfm" : "",
@@ -1930,6 +1937,11 @@ void upd765_family_device::write_data_continue(floppy_info &fi)
break;
}
st1 &= ~ST1_MA;
+ LOGRW("writing sector %02x %02x %02x %02x\n",
+ cur_live.idbuf[0],
+ cur_live.idbuf[1],
+ cur_live.idbuf[2],
+ cur_live.idbuf[3]);
sector_size = calc_sector_size(cur_live.idbuf[3]);
fifo_expect(sector_size, true);
fi.sub_state = SECTOR_WRITTEN;
@@ -2002,7 +2014,7 @@ void upd765_family_device::read_track_start(floppy_info &fi)
mfm = command[0] & 0x40;
sectors_read = 0;
- LOGRW("command read track%s cmd=%02x sel=%x chrn=(%d, %d, %d, %d) eot=%02x gpl=%02x dtl=%02x rate=%d\n",
+ LOGCOMMAND("command read track%s cmd=%02x sel=%x chrn=(%d, %d, %d, %d) eot=%02x gpl=%02x dtl=%02x rate=%d\n",
command[0] & 0x40 ? " mfm" : "",
command[0],
command[1],
@@ -2326,8 +2338,7 @@ void upd765_family_device::read_id_continue(floppy_info &fi)
case SCAN_ID_FAILED:
LOGSTATE("SCAN_ID_FAILED\n");
fi.st0 |= ST0_FAIL;
- // st1 |= ST1_ND|ST1_MA;
- st1 = ST1_MA;
+ st1 |= ST1_ND|ST1_MA;
fi.sub_state = COMMAND_DONE;
break;
diff --git a/src/devices/machine/x2201.cpp b/src/devices/machine/x2201.cpp
index ec252d1b8dd..90d731b7e3e 100644
--- a/src/devices/machine/x2201.cpp
+++ b/src/devices/machine/x2201.cpp
@@ -128,17 +128,6 @@ u8 x2201_device::read(offs_t offset)
//-------------------------------------------------
-// read_byte - read 8 bits of data from RAM
-// (FIXME: remove once CRU reads are 1-bit)
-//-------------------------------------------------
-
-u8 x2201_device::read_byte(offs_t offset)
-{
- return m_ram[offset & 127];
-}
-
-
-//-------------------------------------------------
// write - write one bit of data to RAM
//-------------------------------------------------
diff --git a/src/devices/machine/x2201.h b/src/devices/machine/x2201.h
index 670c69b349c..1d873850df1 100644
--- a/src/devices/machine/x2201.h
+++ b/src/devices/machine/x2201.h
@@ -38,7 +38,6 @@ public:
// read/write handlers
u8 read(offs_t offset);
- u8 read_byte(offs_t offset); // hack
void write(offs_t offset, u8 data);
// control lines
diff --git a/src/devices/sound/pokey.cpp b/src/devices/sound/pokey.cpp
index a7f175ddd1a..231dc01e8bf 100644
--- a/src/devices/sound/pokey.cpp
+++ b/src/devices/sound/pokey.cpp
@@ -161,8 +161,6 @@
#define CLK_28 1
#define CLK_114 2
-static const int clock_divisors[3] = {1, DIV_64, DIV_15};
-
constexpr unsigned pokey_device::FREQ_17_EXACT;
@@ -253,7 +251,8 @@ void pokey_device::device_start()
m_pot_counter = 0;
m_kbd_cnt = 0;
m_out_filter = 0;
- m_output = 0;
+ m_out_raw = 0;
+ m_old_raw_inval = true;
m_kbd_state = 0;
/* reset more internal state */
@@ -435,14 +434,7 @@ void pokey_device::execute_run()
{
do
{
- uint32_t new_out = step_one_clock();
- if (m_output != new_out)
- {
- //printf("forced update %08d %08x\n", m_icount, m_output);
- m_stream->update();
- m_output = new_out;
- }
-
+ step_one_clock();
m_icount--;
} while (m_icount > 0);
@@ -570,25 +562,12 @@ void pokey_device::step_pot()
*
*/
-uint32_t pokey_device::step_one_clock(void)
+void pokey_device::step_one_clock(void)
{
- int const base_clock = (m_AUDCTL & CLK_15KHZ) ? CLK_114 : CLK_28;
-
+ /* Clocks only count if we are not in a reset */
if (m_SKCTL & SK_RESET)
{
- /* Clocks only count if we are not in a reset */
- int clock_triggered[3] = {0,0,0};
- int clk;
- for (clk = 0; clk < 3; clk++)
- {
- m_clock_cnt[clk]++;
- if (m_clock_cnt[clk] >= clock_divisors[clk])
- {
- m_clock_cnt[clk] = 0;
- clock_triggered[clk] = 1;
- }
- }
-
+ /* polynom pointers */
if (++m_p4 == 0x0000f)
m_p4 = 0;
if (++m_p5 == 0x0001f)
@@ -598,7 +577,23 @@ uint32_t pokey_device::step_one_clock(void)
if (++m_p17 == 0x1ffff)
m_p17 = 0;
- clk = (m_AUDCTL & CH1_HICLK) ? CLK_1 : base_clock;
+ /* CLK_1: no presacler */
+ int clock_triggered[3] = {1,0,0};
+ /* CLK_28: prescaler 63.9211 kHz */
+ if (++m_clock_cnt[CLK_28] >= DIV_64)
+ {
+ m_clock_cnt[CLK_28] = 0;
+ clock_triggered[CLK_28] = 1;
+ }
+ /* CLK_114 prescaler 15.6999 kHz */
+ if (++m_clock_cnt[CLK_114] >= DIV_15)
+ {
+ m_clock_cnt[CLK_114] = 0;
+ clock_triggered[CLK_114] = 1;
+ }
+
+ int const base_clock = (m_AUDCTL & CLK_15KHZ) ? CLK_114 : CLK_28;
+ int clk = (m_AUDCTL & CH1_HICLK) ? CLK_1 : base_clock;
if (clock_triggered[clk])
m_channel[CHAN1].inc_chan();
@@ -682,12 +677,23 @@ uint32_t pokey_device::step_one_clock(void)
m_channel[CHAN1].m_filter_sample = 1;
}
- uint32_t sum = 0;
- for (int ch = 0; ch < 4; ch++)
+ if (m_old_raw_inval)
{
- sum |= (((((m_channel[ch].m_output ^ m_channel[ch].m_filter_sample) || (m_channel[ch].m_AUDC & VOLUME_ONLY)) ? (m_channel[ch].m_AUDC & VOLUME_MASK) : 0 )) << (ch * 4));
+ uint32_t sum = 0;
+ for (int ch = 0; ch < 4; ch++)
+ {
+ sum |= (((m_channel[ch].m_output ^ m_channel[ch].m_filter_sample) || (m_channel[ch].m_AUDC & VOLUME_ONLY)) ?
+ ((m_channel[ch].m_AUDC & VOLUME_MASK) << (ch * 4)) : 0);
+ }
+
+ if (m_out_raw != sum)
+ {
+ //printf("forced update %08d %08x\n", m_icount, m_out_raw);
+ m_stream->update();
+ }
+ m_old_raw_inval = false;
+ m_out_raw = sum;
}
- return sum;
}
//-------------------------------------------------
@@ -704,7 +710,7 @@ void pokey_device::sound_stream_update(sound_stream &stream, stream_sample_t **i
{
int32_t out = 0;
for (int i = 0; i < 4; i++)
- out += ((m_output >> (4*i)) & 0x0f);
+ out += ((m_out_raw >> (4*i)) & 0x0f);
out *= POKEY_DEFAULT_GAIN;
out = (out > 0x7fff) ? 0x7fff : out;
while( samples > 0 )
@@ -715,7 +721,7 @@ void pokey_device::sound_stream_update(sound_stream &stream, stream_sample_t **i
}
else if (m_output_type == RC_LOWPASS)
{
- double rTot = m_voltab[m_output];
+ double rTot = m_voltab[m_out_raw];
double V0 = rTot / (rTot+m_r_pullup) * m_v_ref / 5.0 * 32767.0;
double mult = (m_cap == 0.0) ? 1.0 : 1.0 - exp(-(rTot + m_r_pullup) / (m_cap * m_r_pullup * rTot) * m_clock_period.as_double());
@@ -731,7 +737,7 @@ void pokey_device::sound_stream_update(sound_stream &stream, stream_sample_t **i
}
else if (m_output_type == OPAMP_C_TO_GROUND)
{
- double rTot = m_voltab[m_output];
+ double rTot = m_voltab[m_out_raw];
/* In this configuration there is a capacitor in parallel to the pokey output to ground.
* With a LM324 in LTSpice this causes the opamp circuit to oscillate at around 100 kHz.
* We are ignoring the capacitor here, since this oscillation would not be audible.
@@ -753,7 +759,7 @@ void pokey_device::sound_stream_update(sound_stream &stream, stream_sample_t **i
}
else if (m_output_type == OPAMP_LOW_PASS)
{
- double rTot = m_voltab[m_output];
+ double rTot = m_voltab[m_out_raw];
/* This post-pokey stage usually has a low-pass filter behind it
* It is approximated by not adding in VRef below.
*/
@@ -771,7 +777,7 @@ void pokey_device::sound_stream_update(sound_stream &stream, stream_sample_t **i
}
else if (m_output_type == DISCRETE_VAR_R)
{
- int32_t out = m_voltab[m_output];
+ int32_t out = m_voltab[m_out_raw];
while( samples > 0 )
{
*buffer++ = out;
@@ -898,6 +904,7 @@ void pokey_device::write_internal(offs_t offset, uint8_t data)
case AUDC1_C:
LOG_SOUND(("POKEY '%s' AUDC1 $%02x (%s)\n", tag(), data, audc2str(data)));
m_channel[CHAN1].m_AUDC = data;
+ m_old_raw_inval = true;
break;
case AUDF2_C:
@@ -908,6 +915,7 @@ void pokey_device::write_internal(offs_t offset, uint8_t data)
case AUDC2_C:
LOG_SOUND(("POKEY '%s' AUDC2 $%02x (%s)\n", tag(), data, audc2str(data)));
m_channel[CHAN2].m_AUDC = data;
+ m_old_raw_inval = true;
break;
case AUDF3_C:
@@ -918,6 +926,7 @@ void pokey_device::write_internal(offs_t offset, uint8_t data)
case AUDC3_C:
LOG_SOUND(("POKEY '%s' AUDC3 $%02x (%s)\n", tag(), data, audc2str(data)));
m_channel[CHAN3].m_AUDC = data;
+ m_old_raw_inval = true;
break;
case AUDF4_C:
@@ -928,6 +937,7 @@ void pokey_device::write_internal(offs_t offset, uint8_t data)
case AUDC4_C:
LOG_SOUND(("POKEY '%s' AUDC4 $%02x (%s)\n", tag(), data, audc2str(data)));
m_channel[CHAN4].m_AUDC = data;
+ m_old_raw_inval = true;
break;
case AUDCTL_C:
@@ -952,7 +962,7 @@ void pokey_device::write_internal(offs_t offset, uint8_t data)
m_channel[i].m_output = 0;
m_channel[i].m_filter_sample = (i<2 ? 1 : 0);
}
-
+ m_old_raw_inval = true;
break;
case SKREST_C:
@@ -1070,6 +1080,7 @@ inline void pokey_device::process_channel(int ch)
m_channel[ch].m_output = (m_poly9[m_p9] & 1);
else
m_channel[ch].m_output = (m_poly17[m_p17] & 1);
+ m_old_raw_inval = true;
}
}
diff --git a/src/devices/sound/pokey.h b/src/devices/sound/pokey.h
index 0fa9e21a17d..7e63e89e54d 100644
--- a/src/devices/sound/pokey.h
+++ b/src/devices/sound/pokey.h
@@ -264,7 +264,7 @@ private:
static constexpr int POKEY_CHANNELS = 4;
- uint32_t step_one_clock();
+ void step_one_clock();
void step_keyboard();
void step_pot();
@@ -284,10 +284,11 @@ private:
pokey_channel m_channel[POKEY_CHANNELS];
- uint32_t m_output; /* raw output */
- double m_out_filter; /* filtered output */
+ uint32_t m_out_raw; /* raw output */
+ bool m_old_raw_inval; /* true: recalc m_out_raw required */
+ double m_out_filter; /* filtered output */
- int32_t m_clock_cnt[3]; /* clock counters */
+ int32_t m_clock_cnt[3]; /* clock counters */
uint32_t m_p4; /* poly4 index */
uint32_t m_p5; /* poly5 index */
uint32_t m_p9; /* poly9 index */
diff --git a/src/devices/sound/spkrdev.h b/src/devices/sound/spkrdev.h
index 7542d943793..49e953b5d40 100644
--- a/src/devices/sound/spkrdev.h
+++ b/src/devices/sound/spkrdev.h
@@ -21,9 +21,9 @@ public:
~speaker_sound_device() {}
// configuration
- void set_levels(int num_levels, const int16_t *levels) { m_num_levels = num_levels; m_levels = levels;}
+ void set_levels(int num_levels, const int16_t *levels) { m_num_levels = num_levels; m_levels = levels; }
- void level_w(int new_level);
+ void level_w(int new_level); // can use as writeline
protected:
// device-level overrides
diff --git a/src/devices/video/mc6845.cpp b/src/devices/video/mc6845.cpp
index da4a015a1c6..fe8e4a0119b 100644
--- a/src/devices/video/mc6845.cpp
+++ b/src/devices/video/mc6845.cpp
@@ -582,8 +582,6 @@ void mc6845_device::recompute_parameters(bool postload)
m_hsync_off_pos = hsync_off_pos;
m_vsync_on_pos = vsync_on_pos;
m_vsync_off_pos = vsync_off_pos;
- if (!postload) // set m_line_counter to 0 on normal operation, but not on postload
- m_line_counter = 0;
}
}