summaryrefslogtreecommitdiff
path: root/extras/pointers.py
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2013-08-30 13:33:09 -0700
committeryenatch <yenatch@gmail.com>2013-08-30 13:33:09 -0700
commit0b36af8da526ef1389d2c08bb61d6ea5fdb41f2e (patch)
tree243498feeaaa2a3726e8de489d4da0b8202ae95e /extras/pointers.py
parentb86d0da040448f286aa65ff5b2bacb05fff200a8 (diff)
parentd2333a90c9eed0be38d722bfcd0d8b5dee0e56a7 (diff)
Merge pull request #3 from kanzure/proposed-yenatch-master
Proposed merge of kanzure/master into yenatch/master
Diffstat (limited to 'extras/pointers.py')
m---------extras0
-rw-r--r--extras/pointers.py25
2 files changed, 0 insertions, 25 deletions
diff --git a/extras b/extras
new file mode 160000
+Subproject 016f0206b5029fc83a6200be29b0f980c76dfd9
diff --git a/extras/pointers.py b/extras/pointers.py
deleted file mode 100644
index 8fe3df31b..000000000
--- a/extras/pointers.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-Various functions related to pointer and address math. Mostly to avoid
-depedency loops.
-"""
-
-def calculate_bank(address):
- """you are too lazy to divide on your own?"""
- if type(address) == str:
- address = int(address, 16)
- #if 0x4000 <= address <= 0x7FFF:
- # raise Exception, "bank 1 does not exist"
- return int(address) / 0x4000
-
-def calculate_pointer(short_pointer, bank=None):
- """calculates the full address given a 4-byte pointer and bank byte"""
- short_pointer = int(short_pointer)
- if 0x4000 <= short_pointer <= 0x7fff:
- short_pointer -= 0x4000
- bank = int(bank)
- else:
- bank = 0
- pointer = short_pointer + (bank * 0x4000)
- return pointer
-