1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-11-27 20:51:17 +00:00

Don't try to call resolv() if resolv is NULL

This commit is contained in:
Peter Evans 2018-01-23 21:18:42 -06:00
parent 80136e9360
commit 1751a7af1f

View File

@ -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);
if (resolv) {
eff_value = resolv(cpu); 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;