summaryrefslogtreecommitdiff
path: root/design/mock/context.py
diff options
context:
space:
mode:
Diffstat (limited to 'design/mock/context.py')
-rw-r--r--design/mock/context.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/design/mock/context.py b/design/mock/context.py
index 5549d02..2e8b450 100644
--- a/design/mock/context.py
+++ b/design/mock/context.py
@@ -99,6 +99,7 @@ def held_cell(g, x, y, w, h, k=1):
MINIMAP = 0 # a pane with its own minimap: the frame this much wider than its content
+HEX0X = False # the introduction's offsets: `0x` from 0x10 up (`-8`, `+0x10`)
def tag(g, x, y, w, h, title, focus=False, note=None):
@@ -407,9 +408,10 @@ def stack(g, y, rows, frames, note=None, rsp=None, roles=None, touched=(), chain
ys.append(yy)
if pins:
pin(g, RX + 16, yy, pins, STACK)
- if rsp is not None: # the offset from rsp, pwndbg's way: +18
+ if rsp is not None: # the offset from rsp, pwndbg's way: +18 (the introduction's +0x18)
off = slot - rsp
- g.t(RX + 172, b(yy), ("+%x" % off) if off >= 0 else ("-%x" % -off), S, FAINT, MONO, "end")
+ p = "0x" if HEX0X and abs(off) >= 0x10 else ""
+ g.t(RX + 172, b(yy), ("+%s%x" % (p, off)) if off >= 0 else ("-%s%x" % (p, -off)), S, FAINT, MONO, "end")
end_x = room.get(i, RX + CW - 136)
if marks and marks[0].get("free"): # above rsp: not the stack's yet; its word faint, no chain
g.t(first, b(yy), "%x" % slot, S, mix(STACK, PAGE, 0.6), MONO)