Skip to content

Commit

Permalink
MEGA65: umon should cpu view writes #411
Browse files Browse the repository at this point in the history
Xemu's "umon" (uart mon) implementation forgot to include support for
the $777xxxx signalled "cpu view" write. It's implemented on reads, just
not on writes. Probably it was my mistake to forget to add the support
for the 's' command as well.
  • Loading branch information
lgblgblgb committed Sep 11, 2024
1 parent 487f7d2 commit 802cdbb
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions targets/mega65/uart_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ static void m65mon_dumpmem28 ( int addr )
umon_printf("%02X", debug_read_linear_byte(addr++));
}

static void m65mon_setmem28 ( int addr, int cnt, Uint8* vals )
{
while (--cnt >= 0)
debug_write_linear_byte(addr++, *(vals++));
}

static void m65mon_set_trace ( int m )
{
paused = m;
Expand Down Expand Up @@ -214,7 +208,7 @@ static int check_end_of_command ( char *p, int error_out )
}


static void setmem28 ( char *param, int addr )
static void m65mon_setmem ( char *param, int addr )
{
char *orig_param = param;
int cnt = 0;
Expand All @@ -228,7 +222,10 @@ static void setmem28 ( char *param, int addr )
for (int idx = 0; idx < cnt; idx++) {
int val;
param = parse_hex_arg(param, &val, 0, 0xFF);
m65mon_setmem28(addr & 0xFFFFFFF, 1, (Uint8*)&val);
if ((addr >> 16) != 0x777)
debug_write_linear_byte(addr & 0xFFFFFFF, val);
else
debug_write_cpu_byte(addr & 0xFFFF, val);
addr++;
}
}
Expand Down Expand Up @@ -293,7 +290,7 @@ static void execute_command ( char *cmd )
break;
case 's':
cmd = parse_hex_arg(cmd, &par1, 0, 0xFFFFFFF);
setmem28(cmd, par1);
m65mon_setmem(cmd, par1);
break;
case 't':
if (!*cmd)
Expand Down

1 comment on commit 802cdbb

@lgblgblgb
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"umon should cpu view writes" is an ugly title for the commit, no verb ;) I meant: "umon should ALLOW cpu-view writes"

Please sign in to comment.