(nw) mbee: fixed stupid error causing random crash in mbee56/mbee128.

This commit is contained in:
Robbbert 2020-06-19 00:39:29 +10:00
parent 9b80f38c2c
commit 5992d320a2
2 changed files with 8 additions and 18 deletions

View File

@ -303,8 +303,6 @@ void mbee_state::setup_banks(uint8_t data, bool first_time, uint8_t b_mask)
if (!BIT(data, 5))
b_byte &= 0xfb; // U42/1 - S17 only valid if S5 is on
mem.unmap_read (b_vid, b_vid + 0xfff);
if (!BIT(b_byte, 4))
{
// select video
@ -334,8 +332,6 @@ void mbee_state::setup_banks(uint8_t data, bool first_time, uint8_t b_mask)
if (!BIT(data, 5))
b_byte &= 0xfb; // U42/1 - S17 only valid if S5 is on
mem.unmap_write (b_vid, b_vid + 0xfff);
if (!BIT(b_byte, 4))
{
// select video
@ -436,13 +432,6 @@ uint8_t mbee_state::telcom_high_r()
void mbee_state::machine_start()
{
// must init these vars here, or weird random crashes can occur when scroll lock pressed
m_fdc_rq = 0;
m_08 = 0;
m_0a = 0;
m_0b = 0;
m_1c = 0;
save_item(NAME(m_features));
save_item(NAME(m_size));
save_item(NAME(m_b7_rtc));
@ -513,8 +502,8 @@ void mbee_state::machine_start()
}
else
{
m_pram = make_unique_clear<u8[]>(0x0800);
save_pointer(NAME(m_pram), 0x0800);
m_pram = make_unique_clear<u8[]>(0x1000);
save_pointer(NAME(m_pram), 0x1000);
}
// Banked systems

View File

@ -63,7 +63,7 @@ WRITE_LINE_MEMBER( mbee_state::crtc_vs )
uint8_t mbee_state::video_low_r(offs_t offset)
{
if (BIT(m_features, 3) && ((m_1c & 0x9f) == 0x90))
if ((m_1c & 0x9f) == 0x90)
return m_aram[offset];
else
if (m_0b)
@ -77,7 +77,7 @@ void mbee_state::video_low_w(offs_t offset, uint8_t data)
if (BIT(m_1c, 4))
{
// non-premium attribute writes are discarded
if (BIT(m_features, 3) && BIT(m_1c, 7))
if (BIT(m_1c, 7))
m_aram[offset] = data;
}
else
@ -86,7 +86,7 @@ void mbee_state::video_low_w(offs_t offset, uint8_t data)
uint8_t mbee_state::video_high_r(offs_t offset)
{
if (BIT(m_08, 6))
if (BIT(m_08, 6) && BIT(m_features, 0))
return m_cram[offset];
else
return m_pram[(((m_1c & 15) + 1) << 11) | offset];
@ -94,7 +94,7 @@ uint8_t mbee_state::video_high_r(offs_t offset)
void mbee_state::video_high_w(offs_t offset, uint8_t data)
{
if (BIT(m_08, 6) && (~m_0b & 1))
if (BIT(m_08, 6) && (m_0b==0) && BIT(m_features, 0))
m_cram[offset] = data;
else
m_pram[(((m_1c & 15) + 1) << 11) | offset] = data;
@ -102,7 +102,8 @@ void mbee_state::video_high_w(offs_t offset, uint8_t data)
void mbee_state::port0b_w(uint8_t data)
{
m_0b = data & 1;
if (BIT(m_features, 0))
m_0b = data & 1;
}
uint8_t mbee_state::port08_r()