From 44a87f8d2941216fc0e9e3e2c63c98dfe7b4e4ab Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Sat, 22 Aug 2015 14:35:57 +0200 Subject: [PATCH] Minor changes to AT29x and logging. --- src/emu/bus/ti99x/genboard.c | 6 +++--- src/emu/machine/at29x.c | 37 ++++++++++++++++-------------------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/emu/bus/ti99x/genboard.c b/src/emu/bus/ti99x/genboard.c index 404f604d1e5..0c021bd0234 100644 --- a/src/emu/bus/ti99x/genboard.c +++ b/src/emu/bus/ti99x/genboard.c @@ -1322,21 +1322,21 @@ WRITE_LINE_MEMBER( geneve_mapper_device::pfm_select_lsb ) { if (state==ASSERT_LINE) m_pfm_bank |= 1; else m_pfm_bank &= 0xfe; - logerror("%s: Setting bank (l) = %d\n", tag(), m_pfm_bank); + if (TRACE_PFM) logerror("%s: Setting bank (l) = %d\n", tag(), m_pfm_bank); } WRITE_LINE_MEMBER( geneve_mapper_device::pfm_select_msb ) { if (state==ASSERT_LINE) m_pfm_bank |= 2; else m_pfm_bank &= 0xfd; - logerror("%s: Setting bank (u) = %d\n", tag(), m_pfm_bank); + if (TRACE_PFM) logerror("%s: Setting bank (u) = %d\n", tag(), m_pfm_bank); } WRITE_LINE_MEMBER( geneve_mapper_device::pfm_output_enable ) { // Negative logic m_pfm_output_enable = (state==CLEAR_LINE); - logerror("%s: PFM output %s\n", tag(), m_pfm_output_enable? "enable" : "disable"); + if (TRACE_PFM) logerror("%s: PFM output %s\n", tag(), m_pfm_output_enable? "enable" : "disable"); } //==================================================================== diff --git a/src/emu/machine/at29x.c b/src/emu/machine/at29x.c index 70affa860ac..0174c355409 100644 --- a/src/emu/machine/at29x.c +++ b/src/emu/machine/at29x.c @@ -221,28 +221,23 @@ READ8_MEMBER( at29x_device::read ) if (m_id_mode) { - switch (offset) + // Experiments showed that the manufacturer code and device code + // are returned for every address 0 and 1 modulo sector_size. + // + if ((offset % m_sector_size)==0) reply = 0x1f; // Manufacturer code + else { - case 0x00000: - reply = 0x1f; // Manufacturer code - break; - - case 0x00001: - reply = m_device_id; // Device code - break; - - // Boot block lockout detection [1] - case 0x00002: - reply = m_lower_bbl? 0xff : 0xfe; - break; - - case 0x7fff2: - reply = m_higher_bbl? 0xff : 0xfe; - break; - - default: - reply = 0; - break; + if ((offset % m_sector_size)==1) reply = m_device_id; // Device code + else + { + // Boot block lockout detection [1] + if (offset == 0x00002) reply = m_lower_bbl? 0xff : 0xfe; + else + { + if (offset == 0x7fff2) reply = m_higher_bbl? 0xff : 0xfe; + else reply = 0; + } + } } } else if ((m_pgm == PGM_2) || (m_pgm == PGM_3))