summaryrefslogtreecommitdiffstats
path: root/warp/move.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2020-11-10 22:42:19 +0000
committerchristos <christos@NetBSD.org>2020-11-10 22:42:19 +0000
commita6ad8fb14c6bed68eb8b37750e1b2fea36a8c908 (patch)
tree96a006165d8615e5e0cb4e78ef064e66b8e16437 /warp/move.c
parent1bb28c57a5d2c06152fff5de57a902bec60cc30d (diff)
downloadbsdgames-darwin-a6ad8fb14c6bed68eb8b37750e1b2fea36a8c908.tar.gz
bsdgames-darwin-a6ad8fb14c6bed68eb8b37750e1b2fea36a8c908.tar.zst
bsdgames-darwin-a6ad8fb14c6bed68eb8b37750e1b2fea36a8c908.zip
Time warp forward 34 years so that it compiles (but not work)
Diffstat (limited to 'warp/move.c')
-rw-r--r--warp/move.c114
1 files changed, 52 insertions, 62 deletions
diff --git a/warp/move.c b/warp/move.c
index f022e13b..363ad00a 100644
--- a/warp/move.c
+++ b/warp/move.c
@@ -28,18 +28,17 @@
#include "move.h"
void
-move_init()
+move_init(void)
{
;
}
void
-bounce(obj)
-Reg4 OBJECT *obj;
+bounce(OBJECT *obj)
{
- Reg1 int x;
- Reg2 int y;
- Reg3 int count=0;
+ int x;
+ int y;
+ int count=0;
y = (obj->posy - sgn(obj->vely) + YSIZE00) % YSIZE;
x = (obj->posx - sgn(obj->velx) + XSIZE00) % XSIZE;
@@ -66,12 +65,12 @@ Reg4 OBJECT *obj;
}
void
-move_universe()
+move_universe(void)
{
- Reg1 OBJECT *curobj;
- Reg2 int x;
- Reg3 int y;
- Reg4 OBJECT *temp;
+ OBJECT *curobj;
+ int x;
+ int y;
+ OBJECT *temp;
OBJECT *thenext;
for (curobj = movers; curobj != &root; curobj = curobj->next) {
@@ -128,7 +127,7 @@ move_universe()
movers->prev = curobj;
}
}
- if (temp = occupant[y][x]) { /* already occupied? */
+ if ((temp = occupant[y][x]) != NULL) { /* already occupied? */
if (!temp->contend) {
if (temp->type == Torp) {
if (temp->image == '+')
@@ -141,7 +140,7 @@ move_universe()
}
yblasted[y] |= 1;
xblasted[x] |= 1;
- blasted = TRUE;
+ blasted = true;
curobj->contend = temp;
occupant[y][x] = curobj;
switch (curobj->type) {
@@ -199,14 +198,14 @@ move_universe()
blast[y][x] += 100000;
yblasted[y] |= 1;
xblasted[x] |= 1;
- blasted = TRUE;
+ blasted = true;
}
}
}
if (blasted) {
- Reg7 int minxblast = -1;
- Reg8 int maxxblast = -2;
- Reg5 long tmpblast;
+ int minxblast = -1;
+ int maxxblast = -2;
+ long tmpblast;
blasted = numamoebas;
for (x=0; x<XSIZE; x++) {
@@ -223,7 +222,7 @@ move_universe()
for (x=minxblast; x<=maxxblast; x++) {
tmpblast = blast[y][x];
if (numamoebas && amb[y][x] == '~') {
- if (temp = occupant[y][x]) {
+ if ((temp = occupant[y][x]) != NULL) {
if (temp->image == '&')
tmpblast >>= 1;
else if (temp->type == Web)
@@ -237,7 +236,7 @@ move_universe()
yblasted[y] = 2;
}
if (tmpblast) {
- Reg6 OBJECT *biggie = 0;
+ OBJECT *biggie = 0;
blast[y][x] = 0;
temp = occupant[y][x];
@@ -457,13 +456,13 @@ move_universe()
numinhab--;
/* FALL THROUGH */
case '*':
- banging = TRUE;
+ banging = true;
numstars--;
break;
case '|': case '-': case '/': case '\\':
tmpblast = 100000;
make_blast(y,x,curobj->mass,1);
- banging = TRUE;
+ banging = true;
deados = 0;
break;
case 'x':
@@ -547,7 +546,7 @@ move_universe()
do_bangs();
if (numcrushes && movers->type == Crusher)
movers->vely = 0;
- if (curobj = base) {
+ if ((curobj = base) != NULL) {
char ch;
curobj->velx = 0;
@@ -563,7 +562,7 @@ move_universe()
setimage(curobj, ch);
}
}
- if (curobj = ent) {
+ if ((curobj = ent) != NULL) {
char ch;
if (entmode == 0) {
@@ -606,15 +605,12 @@ move_universe()
}
int
-lookaround(y, x, what)
-Reg1 int y;
-Reg2 int x;
-Reg4 char what;
+lookaround(int y, int x, char what)
{
- Reg3 OBJECT *obj;
- Reg5 int count=0;
- Reg6 int xp;
- Reg7 int xm;
+ OBJECT *obj;
+ int count=0;
+ int xp;
+ int xm;
if ((obj=occupant[y][xp=(x+XSIZE01)%XSIZE])&&obj->type == what) /* 0, 1 */
count++;
@@ -636,45 +632,39 @@ Reg4 char what;
}
int
-lookfor(y, x, what)
-Reg1 int y;
-Reg2 int x;
-Reg4 char what;
+lookfor(int y, int x, char what)
{
- Reg3 OBJECT *obj;
- Reg5 int xp;
- Reg6 int xm;
+ OBJECT *obj;
+ int xp;
+ int xm;
- if ((obj=occupant[y][xp=(x+XSIZE01)%XSIZE])&&obj->type == what ||/* 0, 1 */
- (obj=occupant[y][xm=(x+XSIZE99)%XSIZE])&&obj->type == what ||/* 0, -1 */
- (obj=occupant[y=(y+YSIZE99)%YSIZE][xp])&&obj->type == what ||/* -1, 1 */
- (obj=occupant[y][x])&&obj->type == what ||/* -1, 0 */
- (obj=occupant[y][xm])&&obj->type == what ||/* -1,-1 */
- (obj=occupant[y=(y+2)%YSIZE][xp])&&obj->type == what ||/* 1, 1 */
- (obj=occupant[y][x])&&obj->type == what ||/* 1, 0 */
- (obj=occupant[y][xm])&&obj->type == what) /* 1, -1 */
+ if (((obj=occupant[y][xp=(x+XSIZE01)%XSIZE])&&obj->type == what)||/* 0, 1 */
+ ((obj=occupant[y][xm=(x+XSIZE99)%XSIZE])&&obj->type == what)||/* 0, -1 */
+ ((obj=occupant[y=(y+YSIZE99)%YSIZE][xp])&&obj->type == what)||/* -1, 1 */
+ ((obj=occupant[y][x])&&obj->type == what) ||/* -1, 0 */
+ ((obj=occupant[y][xm])&&obj->type == what) ||/* -1,-1 */
+ ((obj=occupant[y=(y+2)%YSIZE][xp])&&obj->type == what) ||/* 1, 1 */
+ ((obj=occupant[y][x])&&obj->type == what) ||/* 1, 0 */
+ ((obj=occupant[y][xm])&&obj->type == what)) /* 1, -1 */
return(1);
return (0);
}
OBJECT*
-lookimg(y, x, what)
-Reg1 int y;
-Reg2 int x;
-Reg4 char what;
+lookimg(int y, int x, char what)
{
- Reg3 OBJECT *obj;
- Reg5 int xp;
- Reg6 int xm;
+ OBJECT *obj;
+ int xp;
+ int xm;
- if ((obj=occupant[y][xp=(x+XSIZE01)%XSIZE])&&obj->image==what ||/* 0, 1 */
- (obj=occupant[y][xm=(x+XSIZE99)%XSIZE])&&obj->image==what ||/* 0, -1 */
- (obj=occupant[y=(y+YSIZE99)%YSIZE][xp])&&obj->image==what ||/* -1, 1 */
- (obj=occupant[y][x])&&obj->image==what ||/* -1, 0 */
- (obj=occupant[y][xm])&&obj->image==what ||/* -1,-1 */
- (obj=occupant[y=(y+2)%YSIZE][xp])&&obj->image==what ||/* 1, 1 */
- (obj=occupant[y][x])&&obj->image==what ||/* 1, 0 */
- (obj=occupant[y][xm])&&obj->image==what) /* 1, -1 */
+ if (((obj=occupant[y][xp=(x+XSIZE01)%XSIZE])&&obj->image==what)||/* 0, 1 */
+ ((obj=occupant[y][xm=(x+XSIZE99)%XSIZE])&&obj->image==what)||/* 0, -1 */
+ ((obj=occupant[y=(y+YSIZE99)%YSIZE][xp])&&obj->image==what)||/* -1, 1 */
+ ((obj=occupant[y][x])&&obj->image==what) ||/* -1, 0 */
+ ((obj=occupant[y][xm])&&obj->image==what) ||/* -1,-1 */
+ ((obj=occupant[y=(y+2)%YSIZE][xp])&&obj->image==what) ||/* 1, 1 */
+ ((obj=occupant[y][x])&&obj->image==what) ||/* 1, 0 */
+ ((obj=occupant[y][xm])&&obj->image==what)) /* 1, -1 */
return obj;
- return Null(OBJECT*);
+ return NULL;
}