mirror of
https://github.com/holub/mame
synced 2025-10-06 09:00:04 +03:00
plugins/cheat: translate debugger expressions by space index as the debugger does (nw)
pc9801: use correct video clock, fixes policenauts video speed (nw)
This commit is contained in:
parent
72cfcbd39e
commit
6efb37250f
@ -54,27 +54,46 @@ local function xml_parse(data)
|
|||||||
return xml_table
|
return xml_table
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local cpu_spaces = {}
|
||||||
|
|
||||||
|
for tag, device in pairs(manager:machine().devices) do
|
||||||
|
local sp
|
||||||
|
for name, space in pairs(device.spaces) do
|
||||||
|
if not sp then
|
||||||
|
sp = {}
|
||||||
|
cpu_spaces[tag] = sp
|
||||||
|
end
|
||||||
|
sp[space.index] = space.name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function xml.conv_cheat(data)
|
function xml.conv_cheat(data)
|
||||||
local spaces, regions, output
|
local spaces, regions, output
|
||||||
data = xml_parse(data)
|
data = xml_parse(data)
|
||||||
|
|
||||||
local function convert_expr(data)
|
local function convert_expr(data)
|
||||||
local write = false
|
local write = false
|
||||||
|
|
||||||
local function convert_memref(cpu, phys, space, width, addr, rw)
|
local function convert_memref(cpu, phys, space, width, addr, rw)
|
||||||
|
-- debug expressions address spaces by index not by name
|
||||||
|
local function get_space_name(index)
|
||||||
|
return cpu_spaces[":" .. cpu][index]
|
||||||
|
end
|
||||||
|
|
||||||
local mod = ""
|
local mod = ""
|
||||||
local count
|
local count
|
||||||
if space == "p" then
|
if space == "p" then
|
||||||
fullspace = "program"
|
fullspace = get_space_name(0)
|
||||||
elseif space == "d" then
|
elseif space == "d" then
|
||||||
fullspace = "data"
|
fullspace = get_space_name(1)
|
||||||
elseif space == "i" then
|
elseif space == "i" then
|
||||||
fullspace = "io"
|
fullspace = get_space_name(2)
|
||||||
elseif space == "r" then
|
elseif space == "r" then
|
||||||
fullspace = "program"
|
fullspace = get_space_name(0)
|
||||||
mod = "direct_"
|
mod = "direct_"
|
||||||
space = "p"
|
space = "p"
|
||||||
elseif space == "o" then
|
elseif space == "o" then
|
||||||
fullspace = "decrypted_opcodes"
|
fullspace = get_space_name(3)
|
||||||
mod = "direct_"
|
mod = "direct_"
|
||||||
space = "o"
|
space = "o"
|
||||||
end
|
end
|
||||||
|
@ -1441,8 +1441,9 @@ void lua_engine::initialize()
|
|||||||
"write_direct_u32", &addr_space::direct_mem_write<uint32_t>,
|
"write_direct_u32", &addr_space::direct_mem_write<uint32_t>,
|
||||||
"write_direct_i64", &addr_space::direct_mem_write<int64_t>,
|
"write_direct_i64", &addr_space::direct_mem_write<int64_t>,
|
||||||
"write_direct_u64", &addr_space::direct_mem_write<uint64_t>,
|
"write_direct_u64", &addr_space::direct_mem_write<uint64_t>,
|
||||||
"name", sol::property(&addr_space::name),
|
"name", sol::property([](addr_space &sp) { return sp.space.name(); }),
|
||||||
"shift", sol::property([](addr_space &sp) { return sp.space.addr_shift(); }),
|
"shift", sol::property([](addr_space &sp) { return sp.space.addr_shift(); }),
|
||||||
|
"index", sol::property([](addr_space &sp) { return sp.space.spacenum(); }),
|
||||||
"map", sol::property([this](addr_space &sp) {
|
"map", sol::property([this](addr_space &sp) {
|
||||||
address_space &space = sp.space;
|
address_space &space = sp.space;
|
||||||
sol::table map = sol().create_table();
|
sol::table map = sol().create_table();
|
||||||
|
@ -138,7 +138,6 @@ private:
|
|||||||
template<typename T> void log_mem_write(offs_t address, T val);
|
template<typename T> void log_mem_write(offs_t address, T val);
|
||||||
template<typename T> T direct_mem_read(offs_t address);
|
template<typename T> T direct_mem_read(offs_t address);
|
||||||
template<typename T> void direct_mem_write(offs_t address, T val);
|
template<typename T> void direct_mem_write(offs_t address, T val);
|
||||||
const char *name() const { return space.name(); }
|
|
||||||
|
|
||||||
address_space &space;
|
address_space &space;
|
||||||
device_memory_interface &dev;
|
device_memory_interface &dev;
|
||||||
|
@ -2333,12 +2333,12 @@ MACHINE_CONFIG_START(pc9801_state::pc9801_common)
|
|||||||
MCFG_SCREEN_UPDATE_DRIVER(pc9801_state, screen_update)
|
MCFG_SCREEN_UPDATE_DRIVER(pc9801_state, screen_update)
|
||||||
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(pc9801_state, vrtc_irq))
|
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(pc9801_state, vrtc_irq))
|
||||||
|
|
||||||
MCFG_DEVICE_ADD("upd7220_chr", UPD7220, 5000000/2)
|
MCFG_DEVICE_ADD("upd7220_chr", UPD7220, 21.0526_MHz_XTAL / 8)
|
||||||
MCFG_DEVICE_ADDRESS_MAP(0, upd7220_1_map)
|
MCFG_DEVICE_ADDRESS_MAP(0, upd7220_1_map)
|
||||||
MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(pc9801_state, hgdc_draw_text)
|
MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(pc9801_state, hgdc_draw_text)
|
||||||
MCFG_UPD7220_VSYNC_CALLBACK(DEVWRITELINE("upd7220_btm", upd7220_device, ext_sync_w))
|
MCFG_UPD7220_VSYNC_CALLBACK(DEVWRITELINE("upd7220_btm", upd7220_device, ext_sync_w))
|
||||||
|
|
||||||
MCFG_DEVICE_ADD("upd7220_btm", UPD7220, 5000000/2)
|
MCFG_DEVICE_ADD("upd7220_btm", UPD7220, 21.0526_MHz_XTAL / 8)
|
||||||
MCFG_DEVICE_ADDRESS_MAP(0, upd7220_2_map)
|
MCFG_DEVICE_ADDRESS_MAP(0, upd7220_2_map)
|
||||||
MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(pc9801_state, hgdc_display_pixels)
|
MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(pc9801_state, hgdc_display_pixels)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user