From 958f6b5bd834121362183f33cabd1d75290429ab Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 22 Apr 2012 23:35:16 +0000 Subject: misc --- emu.c | 8 ++++---- gramar.y | 6 +++--- gui.c | 13 +++++++++++-- 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 #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 -- cgit v1.2.3