83
83
INVALID_WRITE = ord ('w' )
84
84
MEM_MAP = ord ('M' )
85
85
MEM_UNMAP = ord ('U' )
86
+ MEM_MOVE = ord ('o' )
86
87
MEM_SIZE_8 = 8
87
88
MEM_SIZE_16 = 16
88
89
MEM_SIZE_32 = 32
@@ -243,18 +244,18 @@ def get_reg(reg):
243
244
244
245
245
246
def set_reg (reg , value ):
246
- lib .m68k_set_reg (c_int (reg ), c_uint (value ))
247
+ lib .m68k_set_reg (c_int (reg ), c_uint32 (value ))
247
248
248
249
249
250
def is_valid_instruction (instr , cpu_type ):
250
- return lib .m68k_is_valid_instruction (c_uint (instr ),
251
- c_uint (cpu_type ))
251
+ return lib .m68k_is_valid_instruction (c_uint32 (instr ),
252
+ c_uint32 (cpu_type ))
252
253
253
254
254
255
def disassemble (pc , cpu_type ):
255
256
n = lib .m68k_disassemble (__dis_buf ,
256
- c_uint (pc ),
257
- c_uint (cpu_type ))
257
+ c_uint32 (pc ),
258
+ c_uint32 (cpu_type ))
258
259
return __dis_buf .value .decode ('latin-1' )
259
260
260
261
@@ -265,33 +266,28 @@ def disassemble(pc, cpu_type):
265
266
# Memory API
266
267
267
268
lib .mem_add_memory .restype = c_bool
268
- lib .mem_add_device .restype = c_bool
269
- lib .mem_read_memory .restype = c_uint
269
+ lib .mem_remove_memory .restype = c_bool
270
+ lib .mem_move_memory .restype = c_bool
271
+ lib .mem_read_memory .restype = c_uint32
270
272
271
- device_handler_func_type = CFUNCTYPE (c_uint , c_uint , c_uint , c_uint , c_uint )
272
- trace_handler_func_type = CFUNCTYPE (None , c_uint , c_uint , c_uint , c_uint )
273
- instr_handler_func_type = CFUNCTYPE (None , c_uint )
273
+ device_handler_func_type = CFUNCTYPE (c_int64 , c_uint32 , c_uint32 , c_uint32 , c_uint32 )
274
+ trace_handler_func_type = CFUNCTYPE (None , c_uint32 , c_uint32 , c_uint32 , c_uint32 )
275
+ instr_handler_func_type = CFUNCTYPE (None , c_uint32 )
274
276
275
277
276
278
def mem_add_memory (base , size , writable = True ):
277
- return lib .mem_add_memory (c_uint (base ),
278
- c_uint (size ),
279
+ return lib .mem_add_memory (c_uint32 (base ),
280
+ c_uint32 (size ),
279
281
c_bool (writable ))
280
282
281
283
282
284
def mem_remove_memory (base ):
283
- return lib .mem_remove_memory (c_uint (base ))
285
+ return lib .mem_remove_memory (c_uint32 (base ))
284
286
285
287
286
288
def mem_move_memory (src , dst , size ):
287
- return lib .mem_move_memory (c_uint (src ),
288
- c_uint (dst ),
289
- c_uint (size ))
290
-
291
-
292
- def mem_add_device (base , size ):
293
- return lib .mem_add_device (c_uint (base ),
294
- c_uint (size ))
289
+ return lib .mem_move_memory (c_uint32 (src ),
290
+ c_uint32 (dst ))
295
291
296
292
297
293
def mem_set_device_handler (func ):
@@ -325,15 +321,15 @@ def mem_enable_bus_error(enable=True):
325
321
326
322
327
323
def mem_read_memory (address , size ):
328
- return lib .mem_read_memory (c_uint (address ), c_uint (size ))
324
+ return lib .mem_read_memory (c_uint32 (address ), c_uint32 (size ))
329
325
330
326
331
327
def mem_write_memory (address , size , value ):
332
- lib .mem_write_memory (c_uint (address ), c_uint (size ), c_uint (value ))
328
+ lib .mem_write_memory (c_uint32 (address ), c_uint32 (size ), c_uint32 (value ))
333
329
334
330
335
331
def mem_write_bulk (address , buffer ):
336
- lib .mem_write_bulk (c_uint (address ), c_char_p (bytes (buffer )), c_uint (len (buffer )))
332
+ lib .mem_write_bulk (c_uint32 (address ), c_char_p (bytes (buffer )), c_uint32 (len (buffer )))
337
333
338
334
339
335
# Callback API
0 commit comments