mirror of
https://github.com/pevans/erc-c.git
synced 2024-12-21 23:29:16 +00:00
Add writeaddr command
This commit is contained in:
parent
06bf63ecb2
commit
09f7152e07
@ -72,5 +72,6 @@ extern DEBUG_CMD(jump);
|
||||
extern DEBUG_CMD(printaddr);
|
||||
extern DEBUG_CMD(printstate);
|
||||
extern DEBUG_CMD(resume);
|
||||
extern DEBUG_CMD(writeaddr);
|
||||
|
||||
#endif
|
||||
|
@ -192,3 +192,9 @@ DEBUG_CMD(jump)
|
||||
mos6502 *cpu = (mos6502 *)vm_di_get(VM_CPU);
|
||||
cpu->PC = args->addr1;
|
||||
}
|
||||
|
||||
DEBUG_CMD(writeaddr)
|
||||
{
|
||||
mos6502 *cpu = (mos6502 *)vm_di_get(VM_CPU);
|
||||
mos6502_set(cpu, args->addr1, args->addr2);
|
||||
}
|
||||
|
@ -109,9 +109,18 @@ Test(vm_debug, cmd_printaddr)
|
||||
cr_assert_str_eq(buf, "$7F\n");
|
||||
}
|
||||
|
||||
Test(vm_debug, jump)
|
||||
Test(vm_debug, cmd_jump)
|
||||
{
|
||||
args.addr1 = 123;
|
||||
vm_debug_cmd_jump(&args);
|
||||
cr_assert_eq(mach->cpu->PC, 123);
|
||||
}
|
||||
|
||||
Test(vm_debug, cmd_writeaddr)
|
||||
{
|
||||
args.addr1 = 123;
|
||||
args.addr2 = 0xf5;
|
||||
|
||||
vm_debug_cmd_writeaddr(&args);
|
||||
cr_assert_eq(mos6502_get(mach->cpu, args.addr1), args.addr2);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user