From 7237def9b068c5b184cd38041d7eac5fdf8a9438 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sat, 11 Oct 2014 20:32:17 -0700 Subject: Add support for disassembling VOS program modules --- tern.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tern.h') diff --git a/tern.h b/tern.h index e95e0c9..cdf6948 100644 --- a/tern.h +++ b/tern.h @@ -8,6 +8,8 @@ #include +#define MAX_INT_KEY_SIZE (sizeof(uint32_t) + 2) + typedef union { void *ptrval; intptr_t intval; @@ -31,5 +33,6 @@ tern_node * tern_insert_int(tern_node * head, char * key, intptr_t value); void * tern_find_ptr_default(tern_node * head, char * key, void * def); void * tern_find_ptr(tern_node * head, char * key); tern_node * tern_insert_ptr(tern_node * head, char * key, void * value); +char * tern_int_key(uint32_t key, char * buf); #endif //TERN_H_ -- cgit v1.2.3 From 0be7e726ad839d36d50db630b24ea0f1dc141c08 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sun, 5 Jul 2015 14:21:34 -0700 Subject: WIP changes to support reading cart memory map from ROM DB --- tern.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tern.h') diff --git a/tern.h b/tern.h index cdf6948..c708110 100644 --- a/tern.h +++ b/tern.h @@ -25,6 +25,8 @@ typedef struct tern_node { char el; } tern_node; +typedef void (*iter_fun)(char *key, tern_val val, void *data); + tern_node * tern_insert(tern_node * head, char * key, tern_val value); int tern_find(tern_node * head, char * key, tern_val *ret); tern_node * tern_find_prefix(tern_node * head, char * key); @@ -32,7 +34,12 @@ intptr_t tern_find_int(tern_node * head, char * key, intptr_t def); tern_node * tern_insert_int(tern_node * head, char * key, intptr_t value); void * tern_find_ptr_default(tern_node * head, char * key, void * def); void * tern_find_ptr(tern_node * head, char * key); +tern_val tern_find_path_default(tern_node *head, char *key, tern_val def); +tern_val tern_find_path(tern_node *head, char *key); tern_node * tern_insert_ptr(tern_node * head, char * key, void * value); +tern_node * tern_insert_node(tern_node *head, char *key, tern_node *value); +uint32_t tern_count(tern_node *head); char * tern_int_key(uint32_t key, char * buf); +tern_node * tern_get_node(tern_val value); #endif //TERN_H_ -- cgit v1.2.3 From 8af1d14863bb6ffad2c50b5275a848240c68c62e Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 7 Jul 2015 19:33:33 -0700 Subject: Add support for reading cartridge memory map from ROM database, though without EEPROM support for now --- tern.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tern.h') diff --git a/tern.h b/tern.h index c708110..5c0dcfd 100644 --- a/tern.h +++ b/tern.h @@ -39,6 +39,7 @@ tern_val tern_find_path(tern_node *head, char *key); tern_node * tern_insert_ptr(tern_node * head, char * key, void * value); tern_node * tern_insert_node(tern_node *head, char *key, tern_node *value); uint32_t tern_count(tern_node *head); +void tern_foreach(tern_node *head, iter_fun fun, void *data); char * tern_int_key(uint32_t key, char * buf); tern_node * tern_get_node(tern_val value); -- cgit v1.2.3