mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
Create address_space_debug_wrapper to deal with pedantic but common issue (nw)
This commit is contained in:
parent
4cc2a6b599
commit
cb8d322890
@ -475,6 +475,33 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// ======================> address_space_debug_wrapper
|
||||
|
||||
// wrapper for temporarily setting the debug flag on a memory space (especially one being accessed through another space)
|
||||
class address_space_debug_wrapper
|
||||
{
|
||||
public:
|
||||
// construction
|
||||
address_space_debug_wrapper(address_space &space, bool debugger_access)
|
||||
: m_target(space)
|
||||
, m_prev_debugger_access(space.debugger_access())
|
||||
{
|
||||
space.set_debugger_access(debugger_access);
|
||||
}
|
||||
|
||||
// destruction
|
||||
~address_space_debug_wrapper() { m_target.set_debugger_access(m_prev_debugger_access); }
|
||||
|
||||
// getter
|
||||
address_space &space() const { return m_target; }
|
||||
|
||||
private:
|
||||
// internal state
|
||||
address_space &m_target;
|
||||
const bool m_prev_debugger_access;
|
||||
};
|
||||
|
||||
|
||||
// ======================> memory_block
|
||||
|
||||
// a memory block is a chunk of RAM associated with a range of memory in a device's address space
|
||||
|
@ -488,7 +488,8 @@ READ_LINE_MEMBER(skylncr_state::mbutrfly_prot_r)
|
||||
|
||||
READ8_MEMBER(skylncr_state::bdream97_opcode_r)
|
||||
{
|
||||
return m_maincpu->space(AS_PROGRAM).read_byte(offset) ^ 0x80;
|
||||
address_space_debug_wrapper program(m_maincpu->space(AS_PROGRAM), space.debugger_access());
|
||||
return program.space().read_byte(offset) ^ 0x80;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user