From 0b9da464cdba4a73eb4e5852bfa3a9d5c4d30cc7 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Sat, 8 Apr 2017 20:43:46 -0400 Subject: [PATCH] updated .gitmodules --- .gitmodules | 6 ++--- Makefile | 12 ++++++++++ presets/vicdual/snake1.c | 48 ++++++++++++++++++++-------------------- tools/Makefile | 2 +- 4 files changed, 40 insertions(+), 28 deletions(-) create mode 100644 Makefile diff --git a/.gitmodules b/.gitmodules index 7f876bc1..29332c16 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,10 +9,10 @@ url = git@github.com:sehugg/codemirror [submodule "octokat.js"] path = octokat.js - url = ./octokat.js + url = https://github.com/philschatz/octokat.js [submodule "tss"] path = tss - url = ./tss + url = https://github.com/toyoshim/tss [submodule "FileSaver.js"] path = FileSaver.js - url = ./FileSaver.js + url = https://github.com/eligrey/FileSaver.js diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..04e2f82c --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ + +check: + closure-compiler src/*.js src/cpu/*.js src/platform/*.js > /dev/null + +lint: + gjslint -r src + +archive: + mkdir -p release + git-archive-all --prefix 8bitworkshop-1.1/ release/8bitworkshop-1.1.tgz + #git archive --output release/8bitworkshop-1.1.tgz --prefix 8bitworkshop-1.1/ 1.1 + diff --git a/presets/vicdual/snake1.c b/presets/vicdual/snake1.c index 3c124879..1fe5de8b 100644 --- a/presets/vicdual/snake1.c +++ b/presets/vicdual/snake1.c @@ -88,7 +88,7 @@ const byte font8x8[0x100][8] = { const char BOX_CHARS[8] = { 218, 191, 192, 217, 196, 196, 179, 179 }; -void draw_box(byte x, byte y, byte x2, byte y2, const char* chars) { +void draw_box(byte x, byte y, byte x2, byte y2, const char chars[]) { byte x1 = x; putchar(x, y, chars[2]); putchar(x2, y, chars[3]); @@ -128,42 +128,42 @@ void reset_players() { players[0].collided = players[1].collided = 0; } -void draw_player(Player* p) { - putchar(p->x, p->y, p->head_attr); +void draw_player(byte p) { + putchar(players[p].x, players[p].y, players[p].head_attr); } -void erase_player(Player* p) { - putchar(p->x, p->y, p->tail_attr); +void erase_player(byte p) { + putchar(players[p].x, players[p].y, players[p].tail_attr); } -void move_player(Player* p) { +void move_player(byte p) { erase_player(p); - p->x += DIR_X[p->dir]; - p->y += DIR_Y[p->dir]; - if (getchar(p->x, p->y) != CHAR(' ')) - p->collided = 1; + players[p].x += DIR_X[players[p].dir]; + players[p].y += DIR_Y[players[p].dir]; + if (getchar(players[p].x, players[p].y) != CHAR(' ')) + players[p].collided = 1; draw_player(p); } -void human_control(Player* p) { +void human_control(byte p) { Direction dir = 0xff; if (LEFT1) dir = D_LEFT; if (RIGHT1) dir = D_RIGHT; if (UP1) dir = D_UP; if (DOWN1) dir = D_DOWN; // don't let the player reverse - if (dir != 0xff && dir != (p->dir ^ 2)) { - p->dir = dir; + if (dir != 0xff && dir != (players[p].dir ^ 2)) { + players[p].dir = dir; } } -void ai_control(Player* p) { +void ai_control(byte p) { byte x,y; - Direction dir = p->dir; - x = p->x + DIR_X[dir]; - y = p->y + DIR_Y[dir]; + Direction dir = players[p].dir; + x = players[p].x + DIR_X[dir]; + y = players[p].y + DIR_Y[dir]; if (getchar(x,y) != CHAR(' ')) { - p->dir = (dir + 1) & 3; + players[p].dir = (dir + 1) & 3; } } @@ -175,8 +175,8 @@ void flash_colliders() { if (players[1].collided) players[1].head_attr ^= 0x80; wait_for_vsync(); wait_for_vsync(); - draw_player(&players[0]); - draw_player(&players[1]); + draw_player(0); + draw_player(1); palette = i; } palette = 0; @@ -185,13 +185,13 @@ void flash_colliders() { void make_move() { byte i; for (i=0; i