Add bounded logical Z80 disassembly to shared MCP
This commit is contained in:
@@ -100,7 +100,7 @@ function exports.startplugin()
|
||||
instruction_step=true,step_over=true,step_out=true,
|
||||
bank_guard=true,deferred_breakpoints=true,console_print=true,
|
||||
shares=true,screen_pixels=true,screen_snapshot=snapdir~=nil,
|
||||
program_memory=true,list_ports=true},state=state}
|
||||
program_memory=true,list_ports=true,disassemble_logical=true},state=state}
|
||||
elseif command=="snapshot" then
|
||||
local result={state=state,time=now(),paused=machine().paused}
|
||||
local screen=first_screen()
|
||||
@@ -200,6 +200,23 @@ function exports.startplugin()
|
||||
end
|
||||
return {space="program",address=address,length=length,
|
||||
hex=table.concat(bytes),generation=generation}
|
||||
elseif command=="disassemble_logical" then
|
||||
stopped(request)
|
||||
local address=number(args.address,0xffff)
|
||||
local length=number(args.length,256)
|
||||
assert(length>=1 and address+length<=0x10000,
|
||||
"Дизассемблирование за пределами logical Z80")
|
||||
local path=directory.."/_disasm.txt"
|
||||
os.remove(path) -- Не возвращать файл от прежней команды при ошибке MAME.
|
||||
machine().debugger:command(string.format("dasm %s,0x%X,%d",path,address,length))
|
||||
local size=lfs.attributes(path,"size")
|
||||
assert(size and size>0 and size<=65536,"MAME не создал ограниченный disasm-файл")
|
||||
local file=assert(io.open(path,"rb"))
|
||||
local output=file:read("*a")
|
||||
file:close()
|
||||
os.remove(path)
|
||||
return {space="logical_z80",address=address,length=length,
|
||||
text=output,generation=generation}
|
||||
elseif command=="list_ports" then
|
||||
local result={ports={},truncated=false}
|
||||
local fields_seen=0
|
||||
|
||||
Reference in New Issue
Block a user