ugh numbers

This commit is contained in:
George Hotz 2014-08-20 18:46:19 -07:00
parent fa29dce1ed
commit 92ef51f691
2 changed files with 6 additions and 7 deletions

View File

@ -1,5 +1,5 @@
function fhex(a) { function fhex(a) {
p("DANGER, fhex is a bad function"); throw ("DANGER, fhex is a bad function");
return parseInt(a, 16); return parseInt(a, 16);
} }

View File

@ -9,7 +9,6 @@ Deps.autorun(function() { DA("pmaps changed, updating haddrline");
for (k in pmaps) { for (k in pmaps) {
// ignore the memory that's only read from // ignore the memory that's only read from
if (pmaps[k] == "romemory") continue; if (pmaps[k] == "romemory") continue;
//addrs.push(fhex(k));
addrs.push(k); addrs.push(k);
} }
addrs = addrs.sort(bn_cmp); addrs = addrs.sort(bn_cmp);
@ -93,10 +92,10 @@ $(document).ready(function() {
for (i in tt) { for (i in tt) {
var t = tt[i]; var t = tt[i];
if (t.hasClass("pchunk")) { if (t.hasClass("pchunk")) {
var addr = fhex(t.attr('id').split("_")[1]); var addr = t.attr('id').split("_")[1];
var relX = ((e.pageX - t.offset().left)*1.0)/(t.width()); var relX = ((e.pageX - t.offset().left)*1.0)/(t.width());
addr += Math.floor(relX*PAGE_SIZE); var addr_offset = Math.floor(relX*PAGE_SIZE);
return addr return bn_add(addr, addr_offset);
} }
} }
return undefined; return undefined;
@ -105,7 +104,7 @@ $(document).ready(function() {
ee.addEventListener("click", function(e) { ee.addEventListener("click", function(e) {
var addr = get_addr(e); var addr = get_addr(e);
if (addr !== undefined) { if (addr !== undefined) {
update_dview(hex(addr)); update_dview(addr);
} }
return false; return false;
}); });
@ -113,7 +112,7 @@ $(document).ready(function() {
var addr = get_addr(e); var addr = get_addr(e);
if (addr !== undefined) { if (addr !== undefined) {
Session.set("dirtyiaddr", true); Session.set("dirtyiaddr", true);
Session.set('iaddr', hex(addr)); Session.set('iaddr', addr);
} }
e.preventDefault(); e.preventDefault();
return false; return false;