Mercurial > repos > blastem
comparison analyze_olp.py @ 1696:956c1cce05e2 mame_interp
Merge from default
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 24 Jan 2019 19:15:59 -0800 |
parents | b1ad6339de4f |
children |
comparison
equal
deleted
inserted
replaced
1648:b7ecd0d6a77b | 1696:956c1cce05e2 |
---|---|
146 elif state == 'cas': | 146 elif state == 'cas': |
147 if detect_fall(last, sample, ras): | 147 if detect_fall(last, sample, ras): |
148 print 'refresh @ {0}'.format(num) | 148 print 'refresh @ {0}'.format(num) |
149 state = 'begin' | 149 state = 'begin' |
150 last = sample | 150 last = sample |
151 | |
152 def analyze_z80_mreq(chanmap, datafile): | |
153 m1 = chanmap['!M1'] | |
154 mreq = chanmap['!MREQ'] | |
155 addressMask = 0x3FF | |
156 last = None | |
157 lastWasM1 = False | |
158 for line in datafile.readlines(): | |
159 line = line.strip() | |
160 if line and not line.startswith(';'): | |
161 sample,_,num = line.partition('@') | |
162 sample = int(sample, 16) | |
163 if not (last is None): | |
164 if detect_rise(last, sample, mreq): | |
165 address = last & addressMask | |
166 if detect_low(last, m1): | |
167 print 'M1 read {0:02X} @ {1}'.format(address, num) | |
168 lastWasM1 = True | |
169 elif lastWasM1: | |
170 print 'Refresh {0:02X} @ {1}'.format(address, num) | |
171 lastWasM1 = False | |
172 else: | |
173 print 'Access {0:02X} @ {1}'.format(address, num) | |
174 last = sample | |
151 | 175 |
152 def main(args): | 176 def main(args): |
153 if len(args) < 2: | 177 if len(args) < 2: |
154 print 'Usage: analyze_olp.py filename' | 178 print 'Usage: analyze_olp.py filename' |
155 exit(1) | 179 exit(1) |
161 chanmap = {} | 185 chanmap = {} |
162 for i in xrange(0, len(channels)): | 186 for i in xrange(0, len(channels)): |
163 chanmap[channels[i]] = i | 187 chanmap[channels[i]] = i |
164 datafile = olpfile.open('data.ols') | 188 datafile = olpfile.open('data.ols') |
165 #analyze_delays(chanmap, datafile) | 189 #analyze_delays(chanmap, datafile) |
166 analyze_vram(chanmap, datafile) | 190 #analyze_vram(chanmap, datafile) |
191 #analyze_refresh(chanmap, datafile) | |
192 analyze_z80_mreq(chanmap, datafile) | |
167 datafile.close() | 193 datafile.close() |
168 #datafile = olpfile.open('data.ols') | 194 |
169 #analyze_refresh(chanmap, datafile) | |
170 | 195 |
171 if __name__ == '__main__': | 196 if __name__ == '__main__': |
172 main(argv) | 197 main(argv) |