mirror of
https://github.com/holub/mame
synced 2025-04-25 09:50:04 +03:00
disable: reverse polarity (nw)
This commit is contained in:
parent
f2aaf2eaa8
commit
b39dcdc613
@ -929,7 +929,7 @@ device_t* debugger_cpu::expression_get_device(const char *tag)
|
||||
space
|
||||
-------------------------------------------------*/
|
||||
|
||||
u64 debugger_cpu::expression_read_memory(void *param, const char *name, expression_space spacenum, u32 address, int size, bool with_se)
|
||||
u64 debugger_cpu::expression_read_memory(void *param, const char *name, expression_space spacenum, u32 address, int size, bool disable_se)
|
||||
{
|
||||
switch (spacenum)
|
||||
{
|
||||
@ -951,7 +951,7 @@ u64 debugger_cpu::expression_read_memory(void *param, const char *name, expressi
|
||||
if (memory->has_space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL)))
|
||||
{
|
||||
address_space &space = memory->space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL));
|
||||
if (!with_se) {
|
||||
if (disable_se) {
|
||||
auto dis = m_machine.disable_side_effect();
|
||||
return read_memory(space, space.address_to_byte(address), size, true);
|
||||
} else
|
||||
@ -978,7 +978,7 @@ u64 debugger_cpu::expression_read_memory(void *param, const char *name, expressi
|
||||
if (memory->has_space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_PHYSICAL)))
|
||||
{
|
||||
address_space &space = memory->space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_PHYSICAL));
|
||||
if (!with_se) {
|
||||
if (disable_se) {
|
||||
auto dis = m_machine.disable_side_effect();
|
||||
return read_memory(space, space.address_to_byte(address), size, false);
|
||||
} else
|
||||
@ -999,7 +999,7 @@ u64 debugger_cpu::expression_read_memory(void *param, const char *name, expressi
|
||||
device = get_visible_cpu();
|
||||
memory = &device->memory();
|
||||
}
|
||||
if (!with_se) {
|
||||
if (disable_se) {
|
||||
auto dis = m_machine.disable_side_effect();
|
||||
return expression_read_program_direct(memory->space(AS_PROGRAM), (spacenum == EXPSPACE_OPCODE), address, size);
|
||||
} else
|
||||
@ -1019,7 +1019,7 @@ u64 debugger_cpu::expression_read_memory(void *param, const char *name, expressi
|
||||
device = get_visible_cpu();
|
||||
memory = &device->memory();
|
||||
}
|
||||
if (!with_se) {
|
||||
if (disable_se) {
|
||||
auto dis = m_machine.disable_side_effect();
|
||||
return expression_read_program_direct(memory->space(AS_DECRYPTED_OPCODES), (spacenum == EXPSPACE_OPCODE), address, size);
|
||||
} else
|
||||
@ -1147,7 +1147,7 @@ u64 debugger_cpu::expression_read_memory_region(const char *rgntag, offs_t addre
|
||||
space
|
||||
-------------------------------------------------*/
|
||||
|
||||
void debugger_cpu::expression_write_memory(void *param, const char *name, expression_space spacenum, u32 address, int size, u64 data, bool with_se)
|
||||
void debugger_cpu::expression_write_memory(void *param, const char *name, expression_space spacenum, u32 address, int size, u64 data, bool disable_se)
|
||||
{
|
||||
device_t *device = nullptr;
|
||||
device_memory_interface *memory;
|
||||
@ -1168,7 +1168,7 @@ void debugger_cpu::expression_write_memory(void *param, const char *name, expres
|
||||
if (memory->has_space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL)))
|
||||
{
|
||||
address_space &space = memory->space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_LOGICAL));
|
||||
if (!with_se) {
|
||||
if (disable_se) {
|
||||
auto dis = m_machine.disable_side_effect();
|
||||
write_memory(space, space.address_to_byte(address), data, size, true);
|
||||
} else
|
||||
@ -1190,7 +1190,7 @@ void debugger_cpu::expression_write_memory(void *param, const char *name, expres
|
||||
if (memory->has_space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_PHYSICAL)))
|
||||
{
|
||||
address_space &space = memory->space(AS_PROGRAM + (spacenum - EXPSPACE_PROGRAM_PHYSICAL));
|
||||
if (!with_se) {
|
||||
if (disable_se) {
|
||||
auto dis = m_machine.disable_side_effect();
|
||||
write_memory(space, space.address_to_byte(address), data, size, false);
|
||||
} else
|
||||
@ -1206,7 +1206,7 @@ void debugger_cpu::expression_write_memory(void *param, const char *name, expres
|
||||
device = get_visible_cpu();
|
||||
memory = &device->memory();
|
||||
}
|
||||
if (!with_se) {
|
||||
if (disable_se) {
|
||||
auto dis = m_machine.disable_side_effect();
|
||||
expression_write_program_direct(memory->space(AS_PROGRAM), (spacenum == EXPSPACE_OPCODE), address, size, data);
|
||||
} else
|
||||
@ -1221,7 +1221,7 @@ void debugger_cpu::expression_write_memory(void *param, const char *name, expres
|
||||
device = get_visible_cpu();
|
||||
memory = &device->memory();
|
||||
}
|
||||
if (!with_se) {
|
||||
if (disable_se) {
|
||||
auto dis = m_machine.disable_side_effect();
|
||||
expression_write_program_direct(memory->space(AS_DECRYPTED_OPCODES), (spacenum == EXPSPACE_OPCODE), address, size, data);
|
||||
} else
|
||||
|
@ -578,10 +578,10 @@ private:
|
||||
static const size_t NUM_TEMP_VARIABLES;
|
||||
|
||||
/* expression handlers */
|
||||
u64 expression_read_memory(void *param, const char *name, expression_space space, u32 address, int size, bool with_se);
|
||||
u64 expression_read_memory(void *param, const char *name, expression_space space, u32 address, int size, bool disable_se);
|
||||
u64 expression_read_program_direct(address_space &space, int opcode, offs_t address, int size);
|
||||
u64 expression_read_memory_region(const char *rgntag, offs_t address, int size);
|
||||
void expression_write_memory(void *param, const char *name, expression_space space, u32 address, int size, u64 data, bool with_se);
|
||||
void expression_write_memory(void *param, const char *name, expression_space space, u32 address, int size, u64 data, bool disable_se);
|
||||
void expression_write_program_direct(address_space &space, int opcode, offs_t address, int size, u64 data);
|
||||
void expression_write_memory_region(const char *rgntag, offs_t address, int size, u64 data);
|
||||
expression_error::error_code expression_validate(void *param, const char *name, expression_space space);
|
||||
|
@ -517,7 +517,7 @@ expression_error::error_code symbol_table::memory_valid(const char *name, expres
|
||||
// memory_value - return a value read from memory
|
||||
//-------------------------------------------------
|
||||
|
||||
u64 symbol_table::memory_value(const char *name, expression_space space, u32 offset, int size, bool with_se)
|
||||
u64 symbol_table::memory_value(const char *name, expression_space space, u32 offset, int size, bool disable_se)
|
||||
{
|
||||
// walk up the table hierarchy to find the owner
|
||||
for (symbol_table *symtable = this; symtable != nullptr; symtable = symtable->m_parent)
|
||||
@ -525,7 +525,7 @@ u64 symbol_table::memory_value(const char *name, expression_space space, u32 off
|
||||
{
|
||||
expression_error::error_code err = symtable->m_memory_valid(symtable->m_memory_param, name, space);
|
||||
if (err != expression_error::NO_SUCH_MEMORY_SPACE && symtable->m_memory_read != nullptr)
|
||||
return symtable->m_memory_read(symtable->m_memory_param, name, space, offset, size, with_se);
|
||||
return symtable->m_memory_read(symtable->m_memory_param, name, space, offset, size, disable_se);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
@ -536,7 +536,7 @@ u64 symbol_table::memory_value(const char *name, expression_space space, u32 off
|
||||
// set_memory_value - write a value to memory
|
||||
//-------------------------------------------------
|
||||
|
||||
void symbol_table::set_memory_value(const char *name, expression_space space, u32 offset, int size, u64 value, bool with_se)
|
||||
void symbol_table::set_memory_value(const char *name, expression_space space, u32 offset, int size, u64 value, bool disable_se)
|
||||
{
|
||||
// walk up the table hierarchy to find the owner
|
||||
for (symbol_table *symtable = this; symtable != nullptr; symtable = symtable->m_parent)
|
||||
@ -544,7 +544,7 @@ void symbol_table::set_memory_value(const char *name, expression_space space, u3
|
||||
{
|
||||
expression_error::error_code err = symtable->m_memory_valid(symtable->m_memory_param, name, space);
|
||||
if (err != expression_error::NO_SUCH_MEMORY_SPACE && symtable->m_memory_write != nullptr)
|
||||
symtable->m_memory_write(symtable->m_memory_param, name, space, offset, size, value, with_se);
|
||||
symtable->m_memory_write(symtable->m_memory_param, name, space, offset, size, value, disable_se);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -876,9 +876,9 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *&
|
||||
// check for memory @ operators
|
||||
if ((string[0] == '@' || string[0] == '!') && (buffer.back() == 'b' || buffer.back() == 'w' || buffer.back() == 'd' || buffer.back() == 'q'))
|
||||
{
|
||||
bool with_se = string[0] == '!';
|
||||
bool disable_se = string[0] == '@';
|
||||
string += 1;
|
||||
return parse_memory_operator(token, buffer.c_str(), with_se);
|
||||
return parse_memory_operator(token, buffer.c_str(), disable_se);
|
||||
}
|
||||
|
||||
// empty string is automatically invalid
|
||||
@ -1098,7 +1098,7 @@ void parsed_expression::parse_quoted_string(parse_token &token, const char *&str
|
||||
// forms of memory operators
|
||||
//-------------------------------------------------
|
||||
|
||||
void parsed_expression::parse_memory_operator(parse_token &token, const char *string, bool with_se)
|
||||
void parsed_expression::parse_memory_operator(parse_token &token, const char *string, bool disable_se)
|
||||
{
|
||||
// if there is a '.', it means we have a name
|
||||
const char *startstring = string;
|
||||
@ -1175,7 +1175,7 @@ void parsed_expression::parse_memory_operator(parse_token &token, const char *st
|
||||
}
|
||||
|
||||
// configure the token
|
||||
token.configure_operator(TVL_MEMORYAT, 2).set_memory_size(memsize).set_memory_space(memspace).set_memory_source(namestring).set_memory_side_effect(with_se);
|
||||
token.configure_operator(TVL_MEMORYAT, 2).set_memory_size(memsize).set_memory_space(memspace).set_memory_source(namestring).set_memory_side_effect(disable_se);
|
||||
}
|
||||
|
||||
|
||||
|
@ -161,8 +161,8 @@ public:
|
||||
|
||||
// callback functions for memory reads/writes
|
||||
typedef std::function<expression_error::error_code(void *cbparam, const char *name, expression_space space)> valid_func;
|
||||
typedef std::function<u64(void *cbparam, const char *name, expression_space space, u32 offset, int size, bool with_se)> read_func;
|
||||
typedef std::function<void(void *cbparam, const char *name, expression_space space, u32 offset, int size, u64 value, bool with_se)> write_func;
|
||||
typedef std::function<u64(void *cbparam, const char *name, expression_space space, u32 offset, int size, bool disable_se)> read_func;
|
||||
typedef std::function<void(void *cbparam, const char *name, expression_space space, u32 offset, int size, u64 value, bool disable_se)> write_func;
|
||||
|
||||
enum read_write
|
||||
{
|
||||
@ -195,8 +195,8 @@ public:
|
||||
|
||||
// memory accessors
|
||||
expression_error::error_code memory_valid(const char *name, expression_space space);
|
||||
u64 memory_value(const char *name, expression_space space, u32 offset, int size, bool with_se);
|
||||
void set_memory_value(const char *name, expression_space space, u32 offset, int size, u64 value, bool with_se);
|
||||
u64 memory_value(const char *name, expression_space space, u32 offset, int size, bool disable_se);
|
||||
void set_memory_value(const char *name, expression_space space, u32 offset, int size, u64 value, bool disable_se);
|
||||
|
||||
private:
|
||||
// internal state
|
||||
@ -314,7 +314,7 @@ private:
|
||||
parse_token &set_right_to_left() { assert(m_type == OPERATOR); m_flags |= TIN_RIGHT_TO_LEFT_MASK; return *this; }
|
||||
parse_token &set_memory_space(expression_space space) { assert(m_type == OPERATOR || m_type == MEMORY); m_flags = (m_flags & ~TIN_MEMORY_SPACE_MASK) | ((space << TIN_MEMORY_SPACE_SHIFT) & TIN_MEMORY_SPACE_MASK); return *this; }
|
||||
parse_token &set_memory_size(int log2ofbits) { assert(m_type == OPERATOR || m_type == MEMORY); m_flags = (m_flags & ~TIN_MEMORY_SIZE_MASK) | ((log2ofbits << TIN_MEMORY_SIZE_SHIFT) & TIN_MEMORY_SIZE_MASK); return *this; }
|
||||
parse_token &set_memory_side_effect(bool with_se) { assert(m_type == OPERATOR || m_type == MEMORY); m_flags = with_se ? m_flags | TIN_SIDE_EFFECT_MASK : m_flags & ~TIN_SIDE_EFFECT_MASK; return *this; }
|
||||
parse_token &set_memory_side_effect(bool disable_se) { assert(m_type == OPERATOR || m_type == MEMORY); m_flags = disable_se ? m_flags | TIN_SIDE_EFFECT_MASK : m_flags & ~TIN_SIDE_EFFECT_MASK; return *this; }
|
||||
parse_token &set_memory_source(const char *string) { assert(m_type == OPERATOR || m_type == MEMORY); m_string = string; return *this; }
|
||||
|
||||
// access
|
||||
@ -363,7 +363,7 @@ private:
|
||||
void parse_number(parse_token &token, const char *string, int base, expression_error::error_code errcode);
|
||||
void parse_quoted_char(parse_token &token, const char *&string);
|
||||
void parse_quoted_string(parse_token &token, const char *&string);
|
||||
void parse_memory_operator(parse_token &token, const char *string, bool with_se);
|
||||
void parse_memory_operator(parse_token &token, const char *string, bool disable_se);
|
||||
void normalize_operator(parse_token *prevtoken, parse_token &thistoken);
|
||||
void infix_to_postfix();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user