From f953c1d4335dfc861d05b2287f228c9ac21f07f8 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 8 May 2012 20:37:03 +0000 Subject: reduce number of global vars --- dcpu16.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'dcpu16.h') diff --git a/dcpu16.h b/dcpu16.h index 4f3522a..084ca22 100644 --- a/dcpu16.h +++ b/dcpu16.h @@ -44,14 +44,6 @@ 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]; @@ -59,12 +51,20 @@ struct context { int ndev; }; +struct device { + unsigned int id; + unsigned int version; + unsigned int manufacturer; + void (*cb)(struct context *); + struct device *next; +}; + /* display: 32x12 (128x96) + 16 pixel boarder, font 8x4 */ -unsigned short *compile(FILE *, size_t); -int step(unsigned short *, unsigned short *); -void tuiemu(unsigned short *, unsigned short *); -void guiemu(unsigned short *, unsigned short *); -void dumpcode(unsigned short *, unsigned short *); +int compile(FILE *, unsigned short *, size_t); +int step(struct context *); +void tuiemu(struct context *); +void guiemu(struct context *); +void dumpcode(struct context *); #endif -- cgit v1.2.3