1 /* $NetBSD: savelev.c,v 1.5 2008/01/28 05:38:54 dholland Exp $ */
3 /* savelev.c Larn is copyrighted 1986 by Noah Morgan. */
6 __RCSID("$NetBSD: savelev.c,v 1.5 2008/01/28 05:38:54 dholland Exp $");
12 * routine to save the present level into storage
18 u_char
*pitem
, *pknow
, *pmitem
;
21 pcel
= &cell
[level
* MAXX
* MAXY
]; /* pointer to this level's
23 pecel
= pcel
+ MAXX
* MAXY
; /* pointer to past end of this
30 while (pcel
< pecel
) {
31 pcel
->mitem
= *pmitem
++;
32 pcel
->hitp
= *phitp
++;
33 pcel
->item
= *pitem
++;
34 pcel
->know
= *pknow
++;
35 pcel
->iarg
= *piarg
++;
41 * routine to restore a level from storage
47 u_char
*pitem
, *pknow
, *pmitem
;
50 pcel
= &cell
[level
* MAXX
* MAXY
]; /* pointer to this level's
52 pecel
= pcel
+ MAXX
* MAXY
; /* pointer to past end of this
59 while (pcel
< pecel
) {
60 *pmitem
++ = pcel
->mitem
;
61 *phitp
++ = pcel
->hitp
;
62 *pitem
++ = pcel
->item
;
63 *pknow
++ = pcel
->know
;
64 *piarg
++ = pcel
->iarg
;