X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=src%2Fgtk%2Fpgmwin.c;h=d1ad01055c310668d7d3910695fa2ed6c81782f4;hb=f7e3f1d8d0438f52e4f988a12318075cc1b43568;hp=5439936a83b27bee0d9efdd6a9350fc36707b231;hpb=5419d1bd9d2faae98c78da740634b972e8f5aac1;p=emu8051.git diff --git a/src/gtk/pgmwin.c b/src/gtk/pgmwin.c index 5439936..d1ad010 100644 --- a/src/gtk/pgmwin.c +++ b/src/gtk/pgmwin.c @@ -16,6 +16,7 @@ #include "common.h" #include "memory.h" #include "cpu8051.h" +#include "opcodes.h" #include "pgmwin.h" #include "hexfile.h" @@ -133,6 +134,7 @@ pgmwin_sel_changed_event(GtkWidget *widget, GdkEvent *event, gpointer data) gtk_tree_model_get(model, &iter, COL_ADDR, &str_addr, -1); /* Convert hex address in ASCII to integer. */ + /* No need to check error, has already been validated. */ val = asciihex2int(str_addr); log_debug(" row address is: $%04X", val); @@ -259,17 +261,16 @@ pgmwin_refresh(void) /* Display base address. */ int2asciihex(address, str, 4); - gtk_list_store_set(store, &iter, COL_ADDR, str, -1); - opcode = memory_read8(PGM_MEM_ID, address); - inst_size = cpu8051_get_instruction_size(opcode); + opcode = mem_read8(PGM_MEM_ID, address); + inst_size = opcodes_get_instr_size(opcode); /* Display instruction hex bytes. */ for (k = 0, col_id = COL_B0; k < 3; k++, col_id++) { if (k < inst_size) - int2asciihex(memory_read8(PGM_MEM_ID, - address + k), + int2asciihex(mem_read8(PGM_MEM_ID, + address + k), str, 2); else str[0] = '\0'; @@ -279,11 +280,10 @@ pgmwin_refresh(void) } /* Display instruction menmonic. */ - cpu8051_disasm_mnemonic(opcode, str); + (void) cpu8051_disasm_mnemonic(opcode, str); gtk_list_store_set(store, &iter, COL_INST, str, -1); /* Display instruction arguments (if applicable). */ - str[0] = '\0'; cpu8051_disasm_args(address, str); gtk_list_store_set(store, &iter, COL_ARGS, str, -1);