Debugger (eg, "eb" or "ew") can now patch ROMs if a physical (%%) address is used

This commit is contained in:
Jeff Parsons 2015-11-07 09:52:54 -08:00
commit ec16cf78be
4 changed files with 19 additions and 4 deletions

View file

@ -2104,6 +2104,8 @@ if (DEBUGGER) {
/**
* setByte(dbgAddr, b, inc)
*
* NOTE: If you need to patch a ROM, you MUST use the ROM location's physical address.
*
* WARNING: Be careful with the editing commands that use function, because we don't have a safe
* counterpart to cpu.probeAddr().
*
@ -2116,7 +2118,11 @@ if (DEBUGGER) {
{
var addr = this.getAddr(dbgAddr, true, 1);
if (addr !== X86.ADDR_INVALID) {
this.cpu.setByte(addr, b);
if (dbgAddr.type != Debugger.ADDRTYPE.PHYSICAL) {
this.cpu.setByte(addr, b);
} else {
this.bus.setByteDirect(addr, b);
}
if (inc) this.incAddr(dbgAddr, inc);
this.cpu.updateCPU(true); // we set fForce to true in case video memory was the target
}
@ -2125,6 +2131,8 @@ if (DEBUGGER) {
/**
* setShort(dbgAddr, w, inc)
*
* NOTE: If you need to patch a ROM, you MUST use the ROM location's physical address.
*
* WARNING: Be careful with the editing commands that use function, because we don't have a safe
* counterpart to cpu.probeAddr().
*
@ -2137,7 +2145,11 @@ if (DEBUGGER) {
{
var addr = this.getAddr(dbgAddr, true, 2);
if (addr !== X86.ADDR_INVALID) {
this.cpu.setShort(addr, w);
if (dbgAddr.type != Debugger.ADDRTYPE.PHYSICAL) {
this.cpu.setShort(addr, w);
} else {
this.bus.setShortDirect(addr, w);
}
if (inc) this.incAddr(dbgAddr, inc);
this.cpu.updateCPU(true); // we set fForce to true in case video memory was the target
}