Continued implementing the Instruction Pointer
This commit is contained in:
parent
46170dd5b7
commit
309dcb5a02
4 changed files with 54 additions and 3 deletions
13
pkg/pointer/storage-offset.go
Normal file
13
pkg/pointer/storage-offset.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package pointer
|
||||
|
||||
func (p Pointer) GetStorageOffset() (x, y int) {
|
||||
return p.sox, p.soy
|
||||
}
|
||||
|
||||
func (p *Pointer) CalculateNewStorageOffset() {
|
||||
p.sox, p.soy = p.x+p.delta.x, p.y+p.delta.y
|
||||
}
|
||||
|
||||
func (p *Pointer) SetStorageOffset(x, y int) {
|
||||
p.sox, p.soy = x, y
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue