aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2025-03-10 22:07:56 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2025-03-10 22:07:56 +0100
commitd8847d6eb13162ac2bae191e176bff18a8161245 (patch)
treeb857360eec7d81ea4ccfa4207cc2926f3163fb7f /README.md
parent23fda2e0742a9a87fc499816a0872926a1fb570b (diff)
downloadlist.nes-d8847d6eb13162ac2bae191e176bff18a8161245.tar.gz
list.nes-d8847d6eb13162ac2bae191e176bff18a8161245.zip
Allow base pointers to be configurable
The `ptr` and the `last` pointers can then be configured when including them by simply setting an alternative definition. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'README.md')
-rw-r--r--README.md14
1 files changed, 11 insertions, 3 deletions
diff --git a/README.md b/README.md
index 0210740..3e170a7 100644
--- a/README.md
+++ b/README.md
@@ -32,9 +32,17 @@ ready to be used.
As for the memory mapping, please do note that this library needs 4 bytes in
order to store two 16-bit pointers that keep track of the list. By default these
4 bytes are located at \$60-\$63. If that clashes with something from your code,
-simply change these variables, named `List::ptr` and `List::last`. Each of these
-pointers are 16-bit long (hence 2 bytes long), and they don't need to be in
-continguous memory locations.
+you can provide alternative locations by defining `LIST_PTR_ADDRESS` and
+`LIST_LAST_ADDRESS`. So:
+
+```assembly
+;; Let's say that you want one pointer in $80-$81, and the other at $90-$91.
+LIST_PTR_ADDRESS = $80
+LIST_LAST_ADDRESS = $90
+
+;; And then include the library.
+.include "<vendor directory>/list.s"
+```
### Creating a list