mirror of
https://github.com/copy/v86.git
synced 2025-12-31 04:23:15 +00:00
rewrite some assertions to speed up port io in debug mode
This commit is contained in:
parent
8daade0267
commit
80917ab8b9
1 changed files with 2 additions and 2 deletions
|
|
@ -364,7 +364,7 @@ IO.prototype.port_read8 = function(port_addr)
|
|||
}
|
||||
var value = entry.read8.call(entry.device, port_addr);
|
||||
dbg_assert(typeof value === "number");
|
||||
dbg_assert(value < 0x100 && value >= 0, "8 bit port returned large value: " + h(port_addr));
|
||||
if(value < 0 || value >= 0x100) dbg_assert(false, "8 bit port returned large value: " + h(port_addr));
|
||||
return value;
|
||||
};
|
||||
|
||||
|
|
@ -381,7 +381,7 @@ IO.prototype.port_read16 = function(port_addr)
|
|||
}
|
||||
var value = entry.read16.call(entry.device, port_addr);
|
||||
dbg_assert(typeof value === "number");
|
||||
dbg_assert(value < 0x10000 && value >= 0, "16 bit port returned large value: " + h(port_addr));
|
||||
if(value < 0 || value >= 0x10000) dbg_assert(false, "16 bit port returned large value: " + h(port_addr));
|
||||
return value;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue