aboutsummaryrefslogtreecommitdiff
path: root/src/state.h
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2016-03-16 11:31:21 +0000
committerIan C <ianc@noddybox.co.uk>2016-03-16 11:31:21 +0000
commit4564c7906be89463b8f9637685e1785dd900f4b3 (patch)
treec80bcbcbca885485199ae77960570e973328c03a /src/state.h
parente23a3e98bf4afc6bc900a427c20c01feac476d1a (diff)
Updated banking to work with output.
Diffstat (limited to 'src/state.h')
-rw-r--r--src/state.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/state.h b/src/state.h
index e10463c..247124f 100644
--- a/src/state.h
+++ b/src/state.h
@@ -39,13 +39,12 @@ typedef enum
} WordMode;
-typedef struct mbnk
+typedef struct
{
unsigned number; /* The bank number, 0 .. n */
Byte memory[BANK_SIZE]; /* The memory in that bank */
int min_address_used; /* Will be BANK_SIZE if not used */
int max_address_used; /* Will be -1 if not used */
- struct mbnk *next; /* The next memory bank */
} MemoryBank;
/* ---------------------------------------- INTERFACES
@@ -119,10 +118,14 @@ void PCWriteWord(int i);
void PCWriteWordMode(int i, WordMode mode);
-/* Gets a list of the banks used. A NULL return means no memory was written
- to at all.
+/* Gets a list of the banks used as an array of pointers. A NULL return means
+ no memory was written to at all.
+
+ *count will be updated with the number of banks used, or zero if no memory
+ was written to. Note that banks may not be contiguously numbered, but will
+ be in ascending order.
*/
-const MemoryBank *MemoryBanks(void);
+MemoryBank **MemoryBanks(int *count);
/* Read a byte from the current bank.