diff options
| author | 2008-05-15 08:22:17 +0000 | |
|---|---|---|
| committer | 2008-05-15 08:22:17 +0000 | |
| commit | 44fbeff9bf9f303394b927dac4af213218bcc2ff (patch) | |
| tree | 4bec70e4f8c2ef781e066294d1fd5a3320028a56 /src/emu/debug | |
| parent | 1caf8deb7e9fe936e7661aa428e9666ecce3c0bb (diff) | |
From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] Remove opbase globals from the public interface
Hi mamedev,
There are several variables associated with opbase handling which are
global and documented in memory.h and thus their use is not well
controlled. This patch attempts to remedy this. Because they are
used in various inline memory functions, they can't yet be made local
to memory.c, but by rescoping their declaration they can be hidden,
much like we hide totalcpu.
Most of the uses are in OPBASE_HANDLER() macros, so by encapsulating
the opbase state into a struct and adding that to the handler
interface those can be converted to local variable manipulation. There
is one use in missile.c in a MACHINE_START that I simply removed, it
shouldn't be needed.
One side effect of this patch is that the various unsafe memory macros
can't be used directly, they will be a compiler error now. That is
probably for the best.
~aa
Diffstat (limited to 'src/emu/debug')
| -rw-r--r-- | src/emu/debug/debugvw.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/emu/debug/debugvw.c b/src/emu/debug/debugvw.c index c05a28af9e1..ac40410a96a 100644 --- a/src/emu/debug/debugvw.c +++ b/src/emu/debug/debugvw.c @@ -113,8 +113,8 @@ struct _debug_view_disasm UINT8 right_column; /* right column? */ UINT32 backwards_steps; /* number of backwards steps */ UINT32 dasm_width; /* width of the disassembly area */ - UINT8 * last_opcode_base; /* last opcode base */ - UINT8 * last_opcode_arg_base; /* last opcode arg base */ + UINT8 * last_opbase_rom; /* last opbase.rom */ + UINT8 * last_opbase_ram; /* last opbase.ram */ UINT32 last_change_count; /* last comment change count */ offs_t last_pcbyte; /* last PC byte value */ UINT32 active_address; /* the address cursor_row is pointing to */ @@ -1461,6 +1461,7 @@ static void disasm_generate_bytes(offs_t pcbyte, int numbytes, const debug_cpu_i static int disasm_recompute(debug_view *view, offs_t pc, int startline, int lines, int original_cpunum) { + extern opbase_data opbase; debug_view_disasm *dasmdata = view->extra_data; const debug_cpu_info *cpuinfo = debug_get_cpu_info(dasmdata->cpunum); int chunksize, minbytes, maxbytes, maxbytes_clamped; @@ -1596,8 +1597,8 @@ static int disasm_recompute(debug_view *view, offs_t pc, int startline, int line memory_set_opbase(activecpu_get_physical_pc_byte()); /* update opcode base information */ - dasmdata->last_opcode_base = opcode_base; - dasmdata->last_opcode_arg_base = opcode_arg_base; + dasmdata->last_opbase_rom = opbase.rom; + dasmdata->last_opbase_ram = opbase.ram; dasmdata->last_change_count = debug_comment_all_change_count(); /* now longer need to recompute */ @@ -1613,6 +1614,7 @@ static int disasm_recompute(debug_view *view, offs_t pc, int startline, int line static void disasm_update(debug_view *view) { + extern opbase_data opbase; debug_view_disasm *dasmdata = view->extra_data; const debug_cpu_info *cpuinfo = debug_get_cpu_info(dasmdata->cpunum); offs_t pc = cpunum_get_reg(dasmdata->cpunum, REG_PC); @@ -1676,7 +1678,7 @@ static void disasm_update(debug_view *view) } /* if the opcode base has changed, rework things */ - if (opcode_base != dasmdata->last_opcode_base || opcode_arg_base != dasmdata->last_opcode_arg_base) + if (opbase.rom != dasmdata->last_opbase_rom || opbase.ram != dasmdata->last_opbase_ram) dasmdata->recompute = TRUE; /* if the comments have changed, redo it */ |
