Debugger (eg, "eb" or "ew") can now patch ROMs if a physical (%%) address is used
This commit is contained in:
parent
d8ae5337ee
commit
ec16cf78be
4 changed files with 19 additions and 4 deletions
|
|
@ -131,6 +131,7 @@ function Computer(parmsComputer, parmsMachine, fSuspended) {
|
|||
this.nBusWidth = parmsComputer['busWidth'] || parmsComputer['buswidth'];
|
||||
this.resume = Computer.RESUME_NONE;
|
||||
this.sStateData = null;
|
||||
this.fStateData = false; // remembers if sStateData was loaded
|
||||
this.fServerState = false;
|
||||
this.url = parmsMachine? parmsMachine['url'] : null;
|
||||
|
||||
|
|
@ -331,6 +332,7 @@ Computer.prototype.onLoadSetReady = function(sStateFile, sStateData, nErrorCode)
|
|||
{
|
||||
if (!nErrorCode) {
|
||||
this.sStateData = sStateData;
|
||||
this.fStateData = true;
|
||||
if (DEBUG && this.messageEnabled()) {
|
||||
this.printMessage("loaded state file " + sStateFile.replace(this.sUserID || "xxx", "xxx"));
|
||||
}
|
||||
|
|
@ -609,7 +611,7 @@ Computer.prototype.powerRestore = function(component, stateComputer, fRepower, f
|
|||
* TODO: Considering doing this in ALL cases, not just in situations where a
|
||||
* 'state' exists but we're not actually resuming from it.
|
||||
*/
|
||||
if (this.sStatePath && !this.sStateData) {
|
||||
if (this.sStatePath && !this.fStateData) {
|
||||
stateComputer.clear();
|
||||
this.resume = Computer.RESUME_NONE;
|
||||
web.reloadPage();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue