summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author fulivi <fulivi@users.noreply.github.com>2020-05-31 18:31:49 +0200
committer GitHub <noreply@github.com>2020-05-31 12:31:49 -0400
commitb2991c51fe744bf898445ae2f52eee35b2feabe8 (patch)
tree59003dedac2f65e63b470d281ca11bd4e1097d40
parentd423a969694fac98825fc96a4ef8001ace599f01 (diff)
Bug fixes for hp9845c & remote488 (#6772)
* hp9845: fixed a graphic memory addressing bug (nw) * remote488: fixed a signal corruption bug in IEEE488 remotizer (nw)
-rw-r--r--src/devices/bus/ieee488/remote488.cpp8
-rw-r--r--src/mame/drivers/hp9845.cpp42
2 files changed, 10 insertions, 40 deletions
diff --git a/src/devices/bus/ieee488/remote488.cpp b/src/devices/bus/ieee488/remote488.cpp
index 233b5e9b758..e40e55765f0 100644
--- a/src/devices/bus/ieee488/remote488.cpp
+++ b/src/devices/bus/ieee488/remote488.cpp
@@ -487,32 +487,24 @@ void remote488_device::update_signals_from_rem(uint8_t to_set , uint8_t to_clear
m_in_signals |= to_set;
m_in_signals &= ~to_clear;
diff ^= m_in_signals;
- m_out_signals = m_in_signals;
//LOG("REM SIG %02x %02x\n" , m_in_signals , diff);
m_no_propagation = true;
- uint8_t tmp = m_out_signals;
if (BIT(diff , SIGNAL_ATN_BIT)) {
m_bus->atn_w(this , BIT(m_in_signals , SIGNAL_ATN_BIT));
- COPY_BIT(m_bus->atn_r() , tmp , SIGNAL_ATN_BIT);
}
if (BIT(diff , SIGNAL_IFC_BIT)) {
m_bus->ifc_w(this , BIT(m_in_signals , SIGNAL_IFC_BIT));
- COPY_BIT(m_bus->ifc_r() , tmp , SIGNAL_IFC_BIT);
}
if (BIT(diff , SIGNAL_REN_BIT)) {
m_bus->ren_w(this , BIT(m_in_signals , SIGNAL_REN_BIT));
- COPY_BIT(m_bus->ren_r() , tmp , SIGNAL_REN_BIT);
}
if (BIT(diff , SIGNAL_SRQ_BIT)) {
m_bus->srq_w(this , BIT(m_in_signals , SIGNAL_SRQ_BIT));
- COPY_BIT(m_bus->srq_r() , tmp , SIGNAL_SRQ_BIT);
}
m_no_propagation = false;
-
- update_state(tmp);
}
void remote488_device::update_signal(signal_bit bit , int state)
diff --git a/src/mame/drivers/hp9845.cpp b/src/mame/drivers/hp9845.cpp
index 383f64b1efe..ac6c63de9f0 100644
--- a/src/mame/drivers/hp9845.cpp
+++ b/src/mame/drivers/hp9845.cpp
@@ -1993,7 +1993,6 @@ private:
void graphic_video_render(unsigned video_scanline);
virtual void plot(uint16_t x, uint16_t y, bool draw_erase) override;
- void check_io_counter_restore();
void advance_io_counter();
virtual void advance_gv_fsm(bool ds , bool trigger) override;
virtual void update_graphic_bits() override;
@@ -2012,7 +2011,6 @@ private:
uint16_t m_gv_music_memory;
uint8_t m_gv_cursor_color;
uint8_t m_gv_plane;
- bool m_gv_plane_wrap;
bool m_gv_lp_int_latched;
bool m_gv_sk_int_latched;
};
@@ -2076,7 +2074,6 @@ void hp9845c_state::machine_reset()
// TODO: correct?
m_gv_cursor_color = 7;
m_gv_plane = 0;
- m_gv_plane_wrap = false;
m_gv_lp_int_latched = false;
m_gv_sk_int_latched = false;
}
@@ -2402,21 +2399,6 @@ void hp9845c_state::plot(uint16_t x, uint16_t y, bool draw_erase)
}
}
-void hp9845c_state::check_io_counter_restore()
-{
- if (m_gv_last_cmd != m_gv_cmd) {
- // restore memory counter
- m_gv_io_counter = get_gv_mem_addr(m_gv_word_x_position , m_gv_word_y_position);
- // no auto-increment when switching commands
- if (m_gv_plane_wrap) {
- m_gv_plane = 2;
- } else if (m_gv_plane > 0) {
- m_gv_plane--;
- }
- m_gv_last_cmd = m_gv_cmd;
- }
-}
-
void hp9845c_state::advance_io_counter()
{
m_gv_plane++;
@@ -2427,7 +2409,6 @@ void hp9845c_state::advance_io_counter()
} else {
m_gv_plane = 2;
}
- m_gv_plane_wrap = true;
}
}
@@ -2450,22 +2431,18 @@ void hp9845c_state::advance_gv_fsm(bool ds , bool trigger)
// inital state (same as GV_STAT_RESET), command received
if (m_gv_cmd == 0x1) {
// read words command
- check_io_counter_restore();
- LOG("read words, last = %x\n", m_gv_last_cmd);
- m_gv_fsm_state = GV_STAT_WAIT_MEM_0; // -> read stream
- m_gv_last_cmd = m_gv_cmd;
+ LOG("read words\n");
+ m_gv_fsm_state = GV_STAT_WAIT_TRIG_0;
} else if (ds) {
if ((m_gv_cmd == 0x0) || (m_gv_cmd == 0x2)) {
// write words & clear/set words commands
- check_io_counter_restore();
- if (m_gv_cmd == 0x2) LOG("clear/set words, last = %x\n", m_gv_last_cmd);
- else LOG("write words, last = %x\n", m_gv_last_cmd);
+ if (m_gv_cmd == 0x2) LOG("clear/set words\n");
+ else LOG("write words\n");
m_gv_fsm_state = GV_STAT_WAIT_TRIG_1; // -> write stream
} else {
// any other command
m_gv_fsm_state = GV_STAT_WAIT_TRIG_0; // -> wait for trigger
}
- m_gv_last_cmd = m_gv_cmd;
} else {
get_out = true;
}
@@ -2475,19 +2452,18 @@ void hp9845c_state::advance_gv_fsm(bool ds , bool trigger)
// process data on R4 or R6
if (act_trig) {
switch (m_gv_cmd) {
+ case 1: // read words command
+ break;
case 0x8: // load X I/O address
m_gv_word_x_position = ~m_gv_data_w & 0x3f; // 0..34
LOG("load X I/O adress = %04x\n", m_gv_word_x_position);
m_gv_io_counter = get_gv_mem_addr(m_gv_word_x_position , m_gv_word_y_position);
m_gv_plane = 0;
- m_gv_plane_wrap = false;
break;
case 0x9: // load Y I/O address
m_gv_word_y_position = ~m_gv_data_w & 0x1ff; // 0..454
LOG("load Y I/O adress = %04x\n", m_gv_word_y_position);
m_gv_io_counter = get_gv_mem_addr(m_gv_word_x_position , m_gv_word_y_position);
- m_gv_plane = 0;
- m_gv_plane_wrap = false;
break;
case 0xa: // load memory control
m_gv_memory_control = m_gv_data_w & 0x7f;
@@ -2518,7 +2494,9 @@ void hp9845c_state::advance_gv_fsm(bool ds , bool trigger)
default:
logerror("unknown 98770A command = %d, parm = 0x%04x\n", m_gv_cmd, m_gv_data_w);
}
- if (m_gv_cmd == 0xd) {
+ if (m_gv_cmd == 1) { // Read words
+ m_gv_fsm_state = GV_STAT_WAIT_MEM_0;
+ } else if (m_gv_cmd == 0xd) {
m_gv_fsm_state = GV_STAT_WAIT_DS_2; // -> get second data word
} else {
get_out = true;
@@ -2548,7 +2526,7 @@ void hp9845c_state::advance_gv_fsm(bool ds , bool trigger)
// wait for data word to be read
if (ds) {
// -- next word
- m_gv_fsm_state = GV_STAT_WAIT_MEM_0; // -> process data word
+ m_gv_fsm_state = GV_STAT_WAIT_TRIG_0; // -> process data word
} else {
// -- done
get_out = true;