diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-07-07 19:33:33 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-07-07 19:33:33 -0700 |
commit | 8af1d14863bb6ffad2c50b5275a848240c68c62e (patch) | |
tree | 0dc5406aafc64451f594ace900d3847e6559d9e1 /tern.c | |
parent | 358991e7fef42ae206231aabfeee045e5214dbe4 (diff) |
Add support for reading cartridge memory map from ROM database, though without EEPROM support for now
Diffstat (limited to 'tern.c')
-rw-r--r-- | tern.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -107,7 +107,11 @@ void * tern_find_ptr_default(tern_node * head, char * key, void * def) { tern_val ret; if (tern_find(head, key, &ret)) { - return ret.ptrval; + if (ret.intval & 1) { + return (void *)(ret.intval & ~1); + } else { + return ret.ptrval; + } } return def; } @@ -193,7 +197,7 @@ void tern_foreach_int(tern_node *head, iter_fun fun, void *data, char *keybuf, i tern_foreach_int(head->straight.next, fun, data, keybuf, pos+1); } if (head->right) { - tern_foreach_int(head->left, fun, data, keybuf, pos); + tern_foreach_int(head->right, fun, data, keybuf, pos); } } |