aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2012-04-22 23:35:16 +0000
committerDimitri Sokolyuk <demon@dim13.org>2012-04-22 23:35:16 +0000
commit958f6b5bd834121362183f33cabd1d75290429ab (patch)
tree320ff517e5b7d23c4a4ad20d0048d4e382abed34
parentf8b1782dba2462403f1df62ecd1f8d94068ece4e (diff)
misc
-rw-r--r--emu.c8
-rw-r--r--gramar.y6
-rw-r--r--gui.c13
3 files changed, 18 insertions, 9 deletions
diff --git a/emu.c b/emu.c
index 9a4d947..2f4a428 100644
--- a/emu.c
+++ b/emu.c
@@ -18,11 +18,11 @@
#include <stdio.h>
#include "dcpu16.h"
-unsigned short *mem;
-unsigned short *reg;
+static unsigned short *mem;
+static unsigned short *reg;
-unsigned short skip = 0;
-unsigned short run = 1;
+static unsigned short skip = 0;
+static unsigned short run = 1;
void ext(unsigned short *a, unsigned short *b);
void set(unsigned short *a, unsigned short *b);
diff --git a/gramar.y b/gramar.y
index 1267201..7222723 100644
--- a/gramar.y
+++ b/gramar.y
@@ -40,9 +40,9 @@ struct pair {
char *label;
} *stack, *ref;
-int sp = 0;
-int rp = 0;
-int pc = 0;
+static int sp = 0;
+static int rp = 0;
+static int pc = 0;
unsigned short *buffer;
char **label;
diff --git a/gui.c b/gui.c
index b44a0ca..cd3384b 100644
--- a/gui.c
+++ b/gui.c
@@ -54,8 +54,17 @@ SDL_Color color[0x10] = {
void
setpixel(SDL_Surface *s, int x, int y, Uint8 c)
{
- Uint8 *buf = (Uint8 *)s->pixels + y * s->pitch + x;
- *buf = c;
+ Uint8 *p = (Uint8 *)s->pixels + y * s->pitch + x;
+
+ *p = c;
+}
+
+Uint8
+getpixel(SDL_Surface *s, int x, int y)
+{
+ Uint8 *p = (Uint8 *)s->pixels + y * s->pitch + x;
+
+ return *p;
}
void