aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2012-05-02 15:48:25 +0000
committerDimitri Sokolyuk <demon@dim13.org>2012-05-02 15:48:25 +0000
commiteff0a366bbfff5db70778b4c90c8748c1f3bb4fb (patch)
treecd152f48ef26c87b7464082153512150dc073b60
parent7b8d955386457a42a6ed4599994c8f24c4a6dc9b (diff)
device stub
-rw-r--r--dcpu16.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/dcpu16.h b/dcpu16.h
index 8e7b936..4f3522a 100644
--- a/dcpu16.h
+++ b/dcpu16.h
@@ -44,6 +44,21 @@ enum { NOP, JSR, BRK,
#define KEYB 0x9000
#define KEYP 0x9010
+struct device {
+ unsigned int id;
+ unsigned int version;
+ unsigned int manufacturer;
+ void (*cb)(unsigned short *);
+ struct device *next;
+};
+
+struct context {
+ unsigned short mem[MEMSZ];
+ unsigned short reg[nReg];
+ struct device *dev;
+ int ndev;
+};
+
/* display: 32x12 (128x96) + 16 pixel boarder, font 8x4 */
unsigned short *compile(FILE *, size_t);