trunk/src/emu/cpu/m6809/m6809make.py
| r244736 | r244737 | |
| 77 | 77 | next_dispatch = lines[count+1][percent_pos+1:].strip("\t\n; ") |
| 78 | 78 | |
| 79 | 79 | # If there is no state number associated with the next dispatch, make one |
| 80 | | if not dispatch_to_states.has_key(next_dispatch): |
| 80 | if next_dispatch not in dispatch_to_states: |
| 81 | 81 | dispatch_to_states[next_dispatch] = state |
| 82 | 82 | states_to_dispatch[state] = next_dispatch |
| 83 | 83 | state = state + 1 |
| r244736 | r244737 | |
| 113 | 113 | |
| 114 | 114 | # Output the case labels |
| 115 | 115 | for i in range(0, state): |
| 116 | | print "\tcase %d: goto %s;" % (i, states_to_dispatch[i] if states_to_dispatch.has_key(i) else "state_%s" % str(i)) |
| 116 | print("\tcase %d: goto %s;" % (i, states_to_dispatch.get(i, "state_%d" % i))) |
| 117 | 117 | |
| 118 | 118 | # Output a default case |
| 119 | 119 | print "\tdefault:" |