summaryrefslogtreecommitdiff
path: root/bankswap.c
diff options
context:
space:
mode:
authorAstrid Smith2010-06-26 21:33:19 -0700
committerAstrid Smith2010-06-26 21:33:19 -0700
commit69e9fcc59363e3be82d4783bf5fc46daf40bfa15 (patch)
tree40b337db39d33b274d15e7ebe69c0be63d5769dd /bankswap.c
parent4255008dbb6c950ea73280eaef84bc814323ca0e (diff)
Added bank-swapping routines (incomplete: doesn't implement memory map mode 1)
Diffstat (limited to 'bankswap.c')
-rw-r--r--bankswap.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/bankswap.c b/bankswap.c
new file mode 100644
index 0000000..db4931c
--- /dev/null
+++ b/bankswap.c
@@ -0,0 +1,27 @@
+/* Memory bank swapping driver for 680 project.
+ *
+ * Copyright 2010, Astrid Smith
+ * GPL
+ */
+
+#include "asm_vars.h"
+
+void* pages[256];
+
+/* Address 0000 is always bound to ROM page 0. */
+
+/* Process orders to swap bank A (port 06, 0x4000). */
+void bankswap_4000_write(char data)
+{
+ mem_page_1 = pages[data];
+ mem_page_loc_1 = data;
+ return;
+}
+
+/* Process orders to swap bank B (port 07, 0x8000). */
+void bankswap_b_write(char data)
+{
+ mem_page_2 = pages[data];
+ mem_page_loc_2 = data;
+ return;
+}