#include "cpu8051.h"
#include "regwin.h"
#include "memwin.h"
+#include "emugtk.h"
#define DATA_COLS 16 /* Must be a power of 2 */
#define DATA_ROWS_INT (INT_MEM_SIZE / DATA_COLS)
columnptr = g_object_get_data(G_OBJECT(cell), "column");
column = GPOINTER_TO_UINT(columnptr);
+ /* Memory ID is passed as renderer object data */
memory_id_ptr = g_object_get_data(G_OBJECT(cell), "memory_id");
memory_id = GPOINTER_TO_UINT(memory_id_ptr);
* Make sure to update all registers and memory.
* For example, BANKed registers depends on internal memory.
*/
- regwin_Show();
+ emugtk_UpdateDisplay();
};
static void
gtk_tree_view_get_model(
GTK_TREE_VIEW(listview)));
- /* Add column index, used when editing the cell. */
+ /* Add column index and memory_id, used when editing the cell. */
g_object_set_data(G_OBJECT(renderer), "column",
GUINT_TO_POINTER(i));
g_object_set_data(G_OBJECT(renderer), "memory_id",
GUINT_TO_POINTER(memory_id));
- sprintf(col_name, "B%02d", i - COL_DATA0);
+ /* Use two digits only if DATA_ROWS > 10 */
+ if (DATA_COLS < 10)
+ sprintf(col_name, "B%1d", i - COL_DATA0);
+ else
+ sprintf(col_name, "B%02d", i - COL_DATA0);
column = gtk_tree_view_column_new_with_attributes(
col_name, renderer, "text", i, NULL);
return frame;
}
-/* Dump up to 256 bytes from Address in Memory (direct addressing) */
+/* Dump internal or external memory. */
void
-memwin_DumpD(int memory_id)
+memwin_refresh(int memory_id)
{
int row;
unsigned int Address;
GtkWidget *memlist;
int data_rows;
- log_info("memwin_DumpD()");
-
Address = 0;
if (memory_id == INT_MEM_ID) {