summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine
diff options
context:
space:
mode:
author Michael Zapf <Michael.Zapf@mizapf.de>2015-08-22 14:35:57 +0200
committer Michael Zapf <Michael.Zapf@mizapf.de>2015-08-22 14:35:57 +0200
commit44a87f8d2941216fc0e9e3e2c63c98dfe7b4e4ab (patch)
tree40b89e7610373951ec1e15d40cd18e33e7f34489 /src/emu/machine
parent5072c4d0bde8a5ed0a901b2cdb73801e37f7e113 (diff)
Minor changes to AT29x and logging.
Diffstat (limited to 'src/emu/machine')
-rw-r--r--src/emu/machine/at29x.c37
1 files changed, 16 insertions, 21 deletions
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))