|
|
|
@ -282,6 +282,10 @@ module DFHack
|
|
|
|
|
DFHack.memory_read_int32(@_memaddr) & 0xffffffff
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def _setp(v)
|
|
|
|
|
DFHack.memory_write_int32(@_memaddr, v)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def _get
|
|
|
|
|
addr = _getp
|
|
|
|
|
return if addr == 0
|
|
|
|
@ -294,7 +298,15 @@ module DFHack
|
|
|
|
|
case v
|
|
|
|
|
when Pointer; DFHack.memory_write_int32(@_memaddr, v._getp)
|
|
|
|
|
when MemStruct; DFHack.memory_write_int32(@_memaddr, v._memaddr)
|
|
|
|
|
when Integer; DFHack.memory_write_int32(@_memaddr, v)
|
|
|
|
|
when Integer
|
|
|
|
|
if @_tg and @_tg.kind_of?(MemHack::Number)
|
|
|
|
|
if _getp == 0
|
|
|
|
|
_setp(DFHack.malloc(@_tg._bits/8))
|
|
|
|
|
end
|
|
|
|
|
@_tg._at(_getp)._set(v)
|
|
|
|
|
else
|
|
|
|
|
DFHack.memory_write_int32(@_memaddr, v)
|
|
|
|
|
end
|
|
|
|
|
when nil; DFHack.memory_write_int32(@_memaddr, 0)
|
|
|
|
|
else _get._set(v)
|
|
|
|
|
end
|
|
|
|
|