/* Get base address. */
gtk_tree_model_get(model, &iter, COL_ADDRESS, &str, -1);
/* Get base address. */
gtk_tree_model_get(model, &iter, COL_ADDRESS, &str, -1);
address = asciihex2int(str);
/* Convert column number (1, 2, 3...) to index (0, 1, 2...) */
address += (column - COL_DATA0);
address = asciihex2int(str);
/* Convert column number (1, 2, 3...) to index (0, 1, 2...) */
address += (column - COL_DATA0);
log_info("Address: $%02X", address);
log_info(" old value: $%02X", old);
/* Convert new value (asciihex) to integer. */
new = asciihex2int(new_str);
log_info("Address: $%02X", address);
log_info(" old value: $%02X", old);
/* Convert new value (asciihex) to integer. */
new = asciihex2int(new_str);
- if ((new < 0) || (new > 255)) {
- log_info(" new value: out of range");
- new = old; /* Put back old value... */
+ if (asciihex2int_get_error()) {
+ log_warn(" new value: invalid");
+ return;
+ } else if ((new < 0) || (new > 255)) {
+ log_warn(" new value: out of range");
+ return;
} else {
log_info(" new value: $%02X", new);
}
/* Store new value in emulator memory. */
} else {
log_info(" new value: $%02X", new);
}
/* Store new value in emulator memory. */
crc_new = crc32(0L, Z_NULL, 0);
crc_new = crc32(crc_new, buf8, cfg->bytes_per_row);
crc_new = crc32(0L, Z_NULL, 0);
crc_new = crc32(crc_new, buf8, cfg->bytes_per_row);
gtk_list_store_set(store, &iter, COL_ADDRESS, str, -1);
for (col = 0; col < cfg->bytes_per_row; col++) {
gtk_list_store_set(store, &iter, COL_ADDRESS, str, -1);
for (col = 0; col < cfg->bytes_per_row; col++) {