@@ -66,6 +66,8 @@ def save_dasm(self, f):
66
66
step = 0
67
67
for i in range (0 , len (self .source )):
68
68
il = self .source [i ]
69
+ if not has_steps :
70
+ il .indent = ""
69
71
line = il .line ()
70
72
tokens = line .split ()
71
73
if tokens [0 ] == '+' :
@@ -220,6 +222,12 @@ def pre_process(self, iline):
220
222
221
223
def save_exec (self , f ):
222
224
prefix = None
225
+ print ("if (m_wait_state)" , file = f )
226
+ print ("{" , file = f )
227
+ print ("\t m_icount = 0; // stalled" , file = f )
228
+ print ("\t return;" , file = f )
229
+ print ("}" , file = f )
230
+ print ("while (true) {" , file = f )
223
231
print ("switch (u8(m_ref >> 16)) // prefix" , file = f )
224
232
print ("{" , file = f )
225
233
for opc in self .opcode_info :
@@ -237,18 +245,16 @@ def save_exec(self, f):
237
245
print ("\t switch (u8(m_ref >> 8)) // opcode" , file = f )
238
246
print ("\t {" , file = f )
239
247
print ("\t case 0x%s:" % (opc .code [2 :]), file = f )
240
- #print("\t{", file=f)
241
248
opc .save_dasm (f )
242
- #print("\t}", file=f)
243
- print ("\t \t break;" , file = f )
249
+ print ("\t \t goto rop;" , file = f )
244
250
print ("" , file = f )
245
251
print ("\t } // switch opcode" , file = f )
246
252
print ("}" , file = f )
247
253
print ("break; // prefix: 0x%s" % (prefix ), file = f )
248
254
print ("" , file = f )
249
255
print ("} // switch prefix" , file = f )
250
256
print ("" , file = f )
251
- print ("m_ref = 0xffff00; " , file = f )
257
+ print ("} // while (true) " , file = f )
252
258
253
259
def main (argv ):
254
260
if len (argv ) != 3 and len (argv ) != 4 :
0 commit comments