mirror of
https://github.com/pevans/erc-c.git
synced 2024-11-23 23:32:45 +00:00
Don't try to call resolv() if resolv is NULL
This commit is contained in:
parent
80136e9360
commit
1751a7af1f
@ -96,11 +96,13 @@ mos6502_dis_operand(mos6502 *cpu,
|
|||||||
{
|
{
|
||||||
int rel_address;
|
int rel_address;
|
||||||
int ind_address;
|
int ind_address;
|
||||||
vm_8bit eff_value;
|
vm_8bit eff_value = 0;
|
||||||
mos6502_address_resolver resolv;
|
mos6502_address_resolver resolv;
|
||||||
|
|
||||||
resolv = mos6502_get_address_resolver(addr_mode);
|
resolv = mos6502_get_address_resolver(addr_mode);
|
||||||
eff_value = resolv(cpu);
|
if (resolv) {
|
||||||
|
eff_value = resolv(cpu);
|
||||||
|
}
|
||||||
|
|
||||||
switch (addr_mode) {
|
switch (addr_mode) {
|
||||||
case ACC:
|
case ACC:
|
||||||
@ -123,7 +125,7 @@ mos6502_dis_operand(mos6502 *cpu,
|
|||||||
snprintf(s_value, sizeof(s_value), "%02x", eff_value);
|
snprintf(s_value, sizeof(s_value), "%02x", eff_value);
|
||||||
break;
|
break;
|
||||||
case IMP:
|
case IMP:
|
||||||
snprintf(s_value, sizeof(s_value), "%02X", 0);
|
snprintf(s_value, sizeof(s_value), "%02x", 0);
|
||||||
break;
|
break;
|
||||||
case IND:
|
case IND:
|
||||||
ind_address = mos6502_get(cpu, value + 1) << 8;
|
ind_address = mos6502_get(cpu, value + 1) << 8;
|
||||||
|
Loading…
Reference in New Issue
Block a user