summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2020-03-24 12:16:00 -0400
committer AJR <ajrhacker@users.noreply.github.com>2020-03-24 12:17:18 -0400
commitd1f029ca2c7e5bd1dd5119bdc3e21702506b4d4c (patch)
treef40df49e9016fbfc006efb1ce4a0b418cfcf156c /src/devices
parent36bd4c4cabe535f0da3f87b711096cad0c5579ec (diff)
exelv.cpp: More accurate clocks (nw)
tms7000: Add divide-by-4 mask option for clocking (nw) tms3556: Stop defaulting device clock and disable read side effects for debugging (nw)
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/cpu/tms7000/tms7000.cpp3
-rw-r--r--src/devices/cpu/tms7000/tms7000.h11
-rw-r--r--src/devices/video/tms3556.cpp50
-rw-r--r--src/devices/video/tms3556.h2
4 files changed, 40 insertions, 26 deletions
diff --git a/src/devices/cpu/tms7000/tms7000.cpp b/src/devices/cpu/tms7000/tms7000.cpp
index 9fbfdf50d9b..e749ba31fc7 100644
--- a/src/devices/cpu/tms7000/tms7000.cpp
+++ b/src/devices/cpu/tms7000/tms7000.cpp
@@ -121,7 +121,8 @@ tms7000_device::tms7000_device(const machine_config &mconfig, device_type type,
m_program_config("program", ENDIANNESS_BIG, 8, 16, 0, internal),
m_port_in_cb(*this),
m_port_out_cb(*this),
- m_info_flags(info_flags)
+ m_info_flags(info_flags),
+ m_divider(2)
{
}
diff --git a/src/devices/cpu/tms7000/tms7000.h b/src/devices/cpu/tms7000/tms7000.h
index 054d054a7f6..6fbc0d27f53 100644
--- a/src/devices/cpu/tms7000/tms7000.h
+++ b/src/devices/cpu/tms7000/tms7000.h
@@ -45,6 +45,10 @@ public:
auto in_porte() { return m_port_in_cb[4].bind(); }
auto out_porte() { return m_port_out_cb[4].bind(); }
+ // clock divider mask option
+ void set_divide_by_2() { m_divider = 2; }
+ void set_divide_by_4() { m_divider = 4; }
+
DECLARE_READ8_MEMBER(tms7000_unmapped_rf_r) { if (!machine().side_effects_disabled()) logerror("'%s' (%04X): unmapped_rf_r @ $%04x\n", tag(), m_pc, offset + 0x80); return 0; };
DECLARE_WRITE8_MEMBER(tms7000_unmapped_rf_w) { logerror("'%s' (%04X): unmapped_rf_w @ $%04x = $%02x\n", tag(), m_pc, offset + 0x80, data); };
@@ -80,8 +84,8 @@ protected:
virtual void device_reset() override;
// device_execute_interface overrides
- virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 2 - 1) / 2; } // internal /2 divider
- virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * 2); } // internal /2 divider
+ virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + m_divider - 1) / 2; }
+ virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const noexcept override { return (cycles * m_divider); }
virtual uint32_t execute_min_cycles() const noexcept override { return 5; }
virtual uint32_t execute_max_cycles() const noexcept override { return 49; }
virtual uint32_t execute_input_lines() const noexcept override { return 2; }
@@ -106,7 +110,8 @@ protected:
devcb_read8::array<5> m_port_in_cb;
devcb_write8::array<5> m_port_out_cb;
- uint32_t m_info_flags;
+ const uint32_t m_info_flags;
+ unsigned m_divider;
address_space *m_program;
memory_access_cache<0, 0, ENDIANNESS_BIG> *m_cache;
diff --git a/src/devices/video/tms3556.cpp b/src/devices/video/tms3556.cpp
index b530303379e..0b4f37c8e24 100644
--- a/src/devices/video/tms3556.cpp
+++ b/src/devices/video/tms3556.cpp
@@ -183,33 +183,40 @@ uint32_t tms3556_device::screen_update(screen_device &screen, bitmap_ind16 &bitm
uint8_t tms3556_device::vram_r()
{
uint8_t ret;
- if (m_bamp_written) {
- m_bamp_written=false;
- m_vdp_acmpxy_mode=dma_write;
- if (m_init_read)
- m_vdp_acmp=VDP_BAMP;
- else
- m_vdp_acmp=(VDP_BAMP-1)&0xFFFF;
- }
+ if (!machine().side_effects_disabled()) {
+ if (m_bamp_written) {
+ m_bamp_written=false;
+ m_vdp_acmpxy_mode=dma_write;
+ if (m_init_read)
+ m_vdp_acmp=VDP_BAMP;
+ else
+ m_vdp_acmp=(VDP_BAMP-1)&0xFFFF;
+ }
- if (m_row_col_written) {
- m_row_col_written=0;
- m_vdp_acmpxy_mode=dma_read;
- if (m_init_read)
- m_vdp_acmpxy=m_colrow;
- else
- m_vdp_acmpxy=(m_colrow-1)&0xFFFF;
+ if (m_row_col_written) {
+ m_row_col_written=0;
+ m_vdp_acmpxy_mode=dma_read;
+ if (m_init_read)
+ m_vdp_acmpxy=m_colrow;
+ else
+ m_vdp_acmpxy=(m_colrow-1)&0xFFFF;
+ }
+
+ m_init_read=false;
}
- m_init_read=false;
if (m_vdp_acmpxy_mode==dma_read) {
ret=readbyte(m_vdp_acmpxy);
- m_vdp_acmpxy++;
- if (m_vdp_acmpxy==VDP_BAMTF) m_vdp_acmpxy=VDP_BAMP;
+ if (!machine().side_effects_disabled()) {
+ m_vdp_acmpxy++;
+ if (m_vdp_acmpxy==VDP_BAMTF) m_vdp_acmpxy=VDP_BAMP;
+ }
} else {
ret=readbyte(m_vdp_acmp);
- m_vdp_acmp++;
- if (m_vdp_acmp==VDP_BAMTF) m_vdp_acmp=VDP_BAMP;
+ if (!machine().side_effects_disabled()) {
+ m_vdp_acmp++;
+ if (m_vdp_acmp==VDP_BAMTF) m_vdp_acmp=VDP_BAMP;
+ }
}
return ret;
}
@@ -254,7 +261,8 @@ uint8_t tms3556_device::reg_r(offs_t offset)
LOG("TMS3556 Reg Read: %06x\n", offset);
int reply = 0; // FIXME : will send internal status (VBL, HBL...)
- m_reg_access_phase = 0;
+ if (!machine().side_effects_disabled())
+ m_reg_access_phase = 0;
return reply;
}
diff --git a/src/devices/video/tms3556.h b/src/devices/video/tms3556.h
index 51dd3ca5ac8..40ed3fce4fc 100644
--- a/src/devices/video/tms3556.h
+++ b/src/devices/video/tms3556.h
@@ -38,7 +38,7 @@ public:
static constexpr unsigned TOTAL_HEIGHT = 250 + TOP_BORDER + BOTTOM_BORDER;
// construction/destruction
- tms3556_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+ tms3556_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
uint8_t vram_r();
void vram_w(uint8_t data);