mirror of
https://github.com/holub/mame
synced 2025-04-29 03:20:50 +03:00
Bug fixes for hp9845c & remote488 (#6772)
* hp9845: fixed a graphic memory addressing bug (nw) * remote488: fixed a signal corruption bug in IEEE488 remotizer (nw)
This commit is contained in:
parent
d423a96969
commit
b2991c51fe
@ -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_set;
|
||||||
m_in_signals &= ~to_clear;
|
m_in_signals &= ~to_clear;
|
||||||
diff ^= m_in_signals;
|
diff ^= m_in_signals;
|
||||||
m_out_signals = m_in_signals;
|
|
||||||
|
|
||||||
//LOG("REM SIG %02x %02x\n" , m_in_signals , diff);
|
//LOG("REM SIG %02x %02x\n" , m_in_signals , diff);
|
||||||
m_no_propagation = true;
|
m_no_propagation = true;
|
||||||
uint8_t tmp = m_out_signals;
|
|
||||||
|
|
||||||
if (BIT(diff , SIGNAL_ATN_BIT)) {
|
if (BIT(diff , SIGNAL_ATN_BIT)) {
|
||||||
m_bus->atn_w(this , BIT(m_in_signals , 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)) {
|
if (BIT(diff , SIGNAL_IFC_BIT)) {
|
||||||
m_bus->ifc_w(this , BIT(m_in_signals , 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)) {
|
if (BIT(diff , SIGNAL_REN_BIT)) {
|
||||||
m_bus->ren_w(this , BIT(m_in_signals , 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)) {
|
if (BIT(diff , SIGNAL_SRQ_BIT)) {
|
||||||
m_bus->srq_w(this , BIT(m_in_signals , 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;
|
m_no_propagation = false;
|
||||||
|
|
||||||
update_state(tmp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void remote488_device::update_signal(signal_bit bit , int state)
|
void remote488_device::update_signal(signal_bit bit , int state)
|
||||||
|
@ -1993,7 +1993,6 @@ private:
|
|||||||
void graphic_video_render(unsigned video_scanline);
|
void graphic_video_render(unsigned video_scanline);
|
||||||
virtual void plot(uint16_t x, uint16_t y, bool draw_erase) override;
|
virtual void plot(uint16_t x, uint16_t y, bool draw_erase) override;
|
||||||
|
|
||||||
void check_io_counter_restore();
|
|
||||||
void advance_io_counter();
|
void advance_io_counter();
|
||||||
virtual void advance_gv_fsm(bool ds , bool trigger) override;
|
virtual void advance_gv_fsm(bool ds , bool trigger) override;
|
||||||
virtual void update_graphic_bits() override;
|
virtual void update_graphic_bits() override;
|
||||||
@ -2012,7 +2011,6 @@ private:
|
|||||||
uint16_t m_gv_music_memory;
|
uint16_t m_gv_music_memory;
|
||||||
uint8_t m_gv_cursor_color;
|
uint8_t m_gv_cursor_color;
|
||||||
uint8_t m_gv_plane;
|
uint8_t m_gv_plane;
|
||||||
bool m_gv_plane_wrap;
|
|
||||||
bool m_gv_lp_int_latched;
|
bool m_gv_lp_int_latched;
|
||||||
bool m_gv_sk_int_latched;
|
bool m_gv_sk_int_latched;
|
||||||
};
|
};
|
||||||
@ -2076,7 +2074,6 @@ void hp9845c_state::machine_reset()
|
|||||||
// TODO: correct?
|
// TODO: correct?
|
||||||
m_gv_cursor_color = 7;
|
m_gv_cursor_color = 7;
|
||||||
m_gv_plane = 0;
|
m_gv_plane = 0;
|
||||||
m_gv_plane_wrap = false;
|
|
||||||
m_gv_lp_int_latched = false;
|
m_gv_lp_int_latched = false;
|
||||||
m_gv_sk_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()
|
void hp9845c_state::advance_io_counter()
|
||||||
{
|
{
|
||||||
m_gv_plane++;
|
m_gv_plane++;
|
||||||
@ -2427,7 +2409,6 @@ void hp9845c_state::advance_io_counter()
|
|||||||
} else {
|
} else {
|
||||||
m_gv_plane = 2;
|
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
|
// inital state (same as GV_STAT_RESET), command received
|
||||||
if (m_gv_cmd == 0x1) {
|
if (m_gv_cmd == 0x1) {
|
||||||
// read words command
|
// read words command
|
||||||
check_io_counter_restore();
|
LOG("read words\n");
|
||||||
LOG("read words, last = %x\n", m_gv_last_cmd);
|
m_gv_fsm_state = GV_STAT_WAIT_TRIG_0;
|
||||||
m_gv_fsm_state = GV_STAT_WAIT_MEM_0; // -> read stream
|
|
||||||
m_gv_last_cmd = m_gv_cmd;
|
|
||||||
} else if (ds) {
|
} else if (ds) {
|
||||||
if ((m_gv_cmd == 0x0) || (m_gv_cmd == 0x2)) {
|
if ((m_gv_cmd == 0x0) || (m_gv_cmd == 0x2)) {
|
||||||
// write words & clear/set words commands
|
// write words & clear/set words commands
|
||||||
check_io_counter_restore();
|
if (m_gv_cmd == 0x2) LOG("clear/set words\n");
|
||||||
if (m_gv_cmd == 0x2) LOG("clear/set words, last = %x\n", m_gv_last_cmd);
|
else LOG("write words\n");
|
||||||
else LOG("write words, last = %x\n", m_gv_last_cmd);
|
|
||||||
m_gv_fsm_state = GV_STAT_WAIT_TRIG_1; // -> write stream
|
m_gv_fsm_state = GV_STAT_WAIT_TRIG_1; // -> write stream
|
||||||
} else {
|
} else {
|
||||||
// any other command
|
// any other command
|
||||||
m_gv_fsm_state = GV_STAT_WAIT_TRIG_0; // -> wait for trigger
|
m_gv_fsm_state = GV_STAT_WAIT_TRIG_0; // -> wait for trigger
|
||||||
}
|
}
|
||||||
m_gv_last_cmd = m_gv_cmd;
|
|
||||||
} else {
|
} else {
|
||||||
get_out = true;
|
get_out = true;
|
||||||
}
|
}
|
||||||
@ -2475,19 +2452,18 @@ void hp9845c_state::advance_gv_fsm(bool ds , bool trigger)
|
|||||||
// process data on R4 or R6
|
// process data on R4 or R6
|
||||||
if (act_trig) {
|
if (act_trig) {
|
||||||
switch (m_gv_cmd) {
|
switch (m_gv_cmd) {
|
||||||
|
case 1: // read words command
|
||||||
|
break;
|
||||||
case 0x8: // load X I/O address
|
case 0x8: // load X I/O address
|
||||||
m_gv_word_x_position = ~m_gv_data_w & 0x3f; // 0..34
|
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);
|
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_io_counter = get_gv_mem_addr(m_gv_word_x_position , m_gv_word_y_position);
|
||||||
m_gv_plane = 0;
|
m_gv_plane = 0;
|
||||||
m_gv_plane_wrap = false;
|
|
||||||
break;
|
break;
|
||||||
case 0x9: // load Y I/O address
|
case 0x9: // load Y I/O address
|
||||||
m_gv_word_y_position = ~m_gv_data_w & 0x1ff; // 0..454
|
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);
|
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_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;
|
break;
|
||||||
case 0xa: // load memory control
|
case 0xa: // load memory control
|
||||||
m_gv_memory_control = m_gv_data_w & 0x7f;
|
m_gv_memory_control = m_gv_data_w & 0x7f;
|
||||||
@ -2518,7 +2494,9 @@ void hp9845c_state::advance_gv_fsm(bool ds , bool trigger)
|
|||||||
default:
|
default:
|
||||||
logerror("unknown 98770A command = %d, parm = 0x%04x\n", m_gv_cmd, m_gv_data_w);
|
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
|
m_gv_fsm_state = GV_STAT_WAIT_DS_2; // -> get second data word
|
||||||
} else {
|
} else {
|
||||||
get_out = true;
|
get_out = true;
|
||||||
@ -2548,7 +2526,7 @@ void hp9845c_state::advance_gv_fsm(bool ds , bool trigger)
|
|||||||
// wait for data word to be read
|
// wait for data word to be read
|
||||||
if (ds) {
|
if (ds) {
|
||||||
// -- next word
|
// -- 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 {
|
} else {
|
||||||
// -- done
|
// -- done
|
||||||
get_out = true;
|
get_out = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user