From 5af8cdc7a21df00bd16a34bde1561bb52e549c9e Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Fri, 4 Jan 2019 19:13:47 -0800 Subject: Old changes to OLP analyzer script for analyzing Z80 memory requests --- analyze_olp.py | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'analyze_olp.py') diff --git a/analyze_olp.py b/analyze_olp.py index abcc107..3e96597 100755 --- a/analyze_olp.py +++ b/analyze_olp.py @@ -148,6 +148,30 @@ def analyze_vram(chanmap, datafile): print 'refresh @ {0}'.format(num) state = 'begin' last = sample + +def analyze_z80_mreq(chanmap, datafile): + m1 = chanmap['!M1'] + mreq = chanmap['!MREQ'] + addressMask = 0x3FF + last = None + lastWasM1 = False + for line in datafile.readlines(): + line = line.strip() + if line and not line.startswith(';'): + sample,_,num = line.partition('@') + sample = int(sample, 16) + if not (last is None): + if detect_rise(last, sample, mreq): + address = last & addressMask + if detect_low(last, m1): + print 'M1 read {0:02X} @ {1}'.format(address, num) + lastWasM1 = True + elif lastWasM1: + print 'Refresh {0:02X} @ {1}'.format(address, num) + lastWasM1 = False + else: + print 'Access {0:02X} @ {1}'.format(address, num) + last = sample def main(args): if len(args) < 2: @@ -163,10 +187,11 @@ def main(args): chanmap[channels[i]] = i datafile = olpfile.open('data.ols') #analyze_delays(chanmap, datafile) - analyze_vram(chanmap, datafile) - datafile.close() - #datafile = olpfile.open('data.ols') + #analyze_vram(chanmap, datafile) #analyze_refresh(chanmap, datafile) + analyze_z80_mreq(chanmap, datafile) + datafile.close() + if __name__ == '__main__': main(argv) -- cgit v1.2.3