summaryrefslogtreecommitdiff
path: root/arm9/source/devices/memory.h
diff options
context:
space:
mode:
Diffstat (limited to 'arm9/source/devices/memory.h')
-rw-r--r--arm9/source/devices/memory.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/arm9/source/devices/memory.h b/arm9/source/devices/memory.h
new file mode 100644
index 0000000..0abff16
--- /dev/null
+++ b/arm9/source/devices/memory.h
@@ -0,0 +1,42 @@
+#ifndef MEMORY_H_
+ #define MEMORY_H_
+
+ #define HEAP_SIZE (4096*3)
+
+ typedef struct {
+ u8 id; // Unique non-zero identifier for this memory device.
+
+ u16 offset1; // Bedrock offset value for head 1
+ u8 page1; // Bedrock address value for head 1
+ u8 byte1; // Bedrock address value for head 1
+ u16 offset2; // Bedrock offset value for head 2
+ u8 page2; // Bedrock address value for head 2
+ u8 byte2; // Bedrock address value for head 2
+
+ u16 count_write; // write cache for page count
+ u16 count; // number of pages allocated for this bedrock
+ u16 copy_write; // write cache for page copy length
+
+ u8 *point1; // pointer to current page for head 1
+ u8 *point2; // pointer to current page for head 2
+
+ u8* cache1[256];
+ u8* cache2[256];
+ } MemoryDevice ;
+
+ u8 mem_read1(MemoryDevice *mem);
+ u8 mem_read2(MemoryDevice *mem);
+ void mem_write1(MemoryDevice *mem, u8 value);
+ void mem_write2(MemoryDevice *mem, u8 value);
+
+ void mem_load_cache1(MemoryDevice *mem);
+ void mem_load_cache2(MemoryDevice *mem);
+ void mem_get_page1(MemoryDevice *mem);
+ void mem_get_page2(MemoryDevice *mem);
+
+
+ void mem_allocate(MemoryDevice *mem);
+ void mem_do_copy(MemoryDevice *mem);
+
+
+#endif