projects
/
emu8051.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove duplicate code for disassembly
[emu8051.git]
/
src
/
gtk
/
pgmwin.c
diff --git
a/src/gtk/pgmwin.c
b/src/gtk/pgmwin.c
index
f2c6a8c
..
2bd00d9
100644
(file)
--- a/
src/gtk/pgmwin.c
+++ b/
src/gtk/pgmwin.c
@@
-24,8
+24,7
@@
static GtkWidget *pgmlist;
#define LIST_VIEW_NAME "Program"
#define DATA_ROWS 100
#define LIST_VIEW_NAME "Program"
#define DATA_ROWS 100
-enum
-{
+enum {
COL_BREAKPT = 0,
COL_ADDR,
COL_B0,
COL_BREAKPT = 0,
COL_ADDR,
COL_B0,
@@
-72,7
+71,8
@@
pgmwin_init_store(void)
if (row == 0)
gtk_list_store_set(store, &iter, COL_COLOR, "red", -1);
else
if (row == 0)
gtk_list_store_set(store, &iter, COL_COLOR, "red", -1);
else
- gtk_list_store_set(store, &iter, COL_COLOR, "black", -1);
+ gtk_list_store_set(store, &iter, COL_COLOR, "black",
+ -1);
}
return store;
}
return store;
@@
-137,7
+137,7
@@
pgmwin_sel_changed_event(GtkWidget *widget, GdkEvent *event, gpointer data)
log_debug(" row address is: $%04X", val);
log_debug(" row address is: $%04X", val);
-
ToggleBreakpoint
(val);
+
breakpoint_toggle
(val);
pgmwin_refresh();
g_free(str_addr);
pgmwin_refresh();
g_free(str_addr);
@@
-183,7
+183,7
@@
pgmwin_init(void)
gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
g_signal_connect(selection, "changed",
gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
g_signal_connect(selection, "changed",
- G_CALLBACK(pgmwin_sel_changed_event), NULL);
+
G_CALLBACK(pgmwin_sel_changed_event), NULL);
pgmwin_init_columns();
pgmwin_init_columns();
@@
-203,9
+203,9
@@
pgmwin_refresh(void)
{
int row;
GtkListStore *store;
{
int row;
GtkListStore *store;
- unsigned int
A
ddress;
+ unsigned int
a
ddress;
-
A
ddress = cpu8051.pc;
+
a
ddress = cpu8051.pc;
store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(pgmlist)));
store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(pgmlist)));
@@
-215,8
+215,8
@@
pgmwin_refresh(void)
char str[128];
int k;
int col_id;
char str[128];
int k;
int col_id;
- int
InstS
ize;
- unsigned char
OpC
ode;
+ int
inst_s
ize;
+ unsigned char
opc
ode;
if (row == 0) {
/* Get first row in list store */
if (row == 0) {
/* Get first row in list store */
@@
-233,7
+233,7
@@
pgmwin_refresh(void)
return;
}
return;
}
- if (
A
ddress > 0xFFFF) {
+ if (
a
ddress > 0xFFFF) {
/*
* Not the most elegant solution, but it works to not
* display instructions past last address, 0xFFFF.
/*
* Not the most elegant solution, but it works to not
* display instructions past last address, 0xFFFF.
@@
-250,7
+250,7
@@
pgmwin_refresh(void)
-1);
} else {
/* Display breakpoints. */
-1);
} else {
/* Display breakpoints. */
- if (
IsBreakpoint(A
ddress))
+ if (
breakpoint_is_defined(a
ddress))
sprintf(str, "*");
else
str[0] = '\0';
sprintf(str, "*");
else
str[0] = '\0';
@@
-258,35
+258,34
@@
pgmwin_refresh(void)
gtk_list_store_set(store, &iter, COL_BREAKPT, str, -1);
/* Display base address. */
gtk_list_store_set(store, &iter, COL_BREAKPT, str, -1);
/* Display base address. */
- int2asciihex(Address, str, 4);
-
+ int2asciihex(address, str, 4);
gtk_list_store_set(store, &iter, COL_ADDR, str, -1);
gtk_list_store_set(store, &iter, COL_ADDR, str, -1);
-
OpCode = memory_read8(PGM_MEM_ID, A
ddress);
-
InstSize = cpu8051_get_instruction_size(OpC
ode);
+
opcode = memory_read8(PGM_MEM_ID, a
ddress);
+
inst_size = cpu8051_get_instruction_size(opc
ode);
/* Display instruction hex bytes. */
for (k = 0, col_id = COL_B0; k < 3; k++, col_id++) {
/* Display instruction hex bytes. */
for (k = 0, col_id = COL_B0; k < 3; k++, col_id++) {
- if (k <
InstS
ize)
+ if (k <
inst_s
ize)
int2asciihex(memory_read8(PGM_MEM_ID,
int2asciihex(memory_read8(PGM_MEM_ID,
-
A
ddress + k),
+
a
ddress + k),
str, 2);
else
str[0] = '\0';
str, 2);
else
str[0] = '\0';
- gtk_list_store_set(store, &iter, col_id, str, -1);
+ gtk_list_store_set(store, &iter, col_id, str,
+ -1);
}
/* Display instruction menmonic. */
}
/* Display instruction menmonic. */
-
cpu8051_disasm_mnemonic(OpC
ode, str);
+
(void) cpu8051_disasm_mnemonic(opc
ode, str);
gtk_list_store_set(store, &iter, COL_INST, str, -1);
/* Display instruction arguments (if applicable). */
gtk_list_store_set(store, &iter, COL_INST, str, -1);
/* Display instruction arguments (if applicable). */
- str[0] = '\0';
- cpu8051_disasm_args(Address, str);
+ cpu8051_disasm_args(address, str);
gtk_list_store_set(store, &iter, COL_ARGS, str, -1);
gtk_list_store_set(store, &iter, COL_ARGS, str, -1);
-
Address += InstS
ize;
+
address += inst_s
ize;
}
}
}
}
}
}