Skip to content

Commit

Permalink
move frotz interpreter files into target static lib
Browse files Browse the repository at this point in the history
  • Loading branch information
spathiwa committed Jun 6, 2015
1 parent 7b23166 commit 0b7382e
Show file tree
Hide file tree
Showing 6 changed files with 283 additions and 56 deletions.
311 changes: 267 additions & 44 deletions Frotz.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/common/fastmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ static long mem_diff (zbyte *a, zbyte *b, zword mem_size, zbyte *diff)
unsigned size = mem_size;
zbyte *p = diff;
unsigned j;
zbyte c;
zbyte c = 0;

for (;;) {
for (j = 0; size > 0 && (c = *a++ ^ *b++) == 0; j++)
Expand Down
2 changes: 1 addition & 1 deletion src/ios/ui_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <ctype.h>

/* We will use our own private getopt functions. */
#include "getopt.h"
//#include "getopt.h"

#include <termios.h>

Expand Down
18 changes: 10 additions & 8 deletions src/ios/ui_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ static struct timeval global_timeout;
#define RING_DEC( ptr, beg, end) (ptr > (beg) ? --ptr : (ptr = (end)))
#define RING_INC( ptr, beg, end) (ptr < (end) ? ++ptr : (ptr = (beg)))

#define MAX_HISTORY 20
static char *history_buffer[MAX_HISTORY];
static char **history_next = history_buffer; /* Next available slot. */
static char **history_view = history_buffer; /* What the user is looking at. */
#define history_end (history_buffer + MAX_HISTORY - 1)
//#define MAX_HISTORY 20
//static char *history_buffer[MAX_HISTORY];
//static char **history_next = history_buffer; /* Next available slot. */
//static char **history_view = history_buffer; /* What the user is looking at. */
//#define history_end (history_buffer + MAX_HISTORY - 1)

extern bool is_terminator (zchar);
extern void read_string (int, zchar *);
Expand Down Expand Up @@ -94,7 +94,7 @@ static int timeout_to_ms()
if (diff.tv_sec < 0) return 0;
if (diff.tv_sec >= INT_MAX / 1000 - 1) /* Paranoia... */
return INT_MAX - 1000;
return diff.tv_sec * 1000 + diff.tv_usec / 1000;
return (int)(diff.tv_sec * 1000 + diff.tv_usec / 1000);
}

/*
Expand Down Expand Up @@ -228,7 +228,7 @@ static int unix_read_char(int extkeys)
}
}


#if 0
/*
* unix_add_to_history
*
Expand Down Expand Up @@ -295,7 +295,7 @@ static int unix_history_forward(zchar *str, int searchlen, int maxlen)
strcpy((char *)str + searchlen, *history_view + searchlen);
return 1;
}

#endif


/*
Expand Down Expand Up @@ -441,6 +441,7 @@ static bool ui_read_line(char *s, char *prompt, bool show_cursor,
return FALSE;
}

#if 0
/* Read a line that is not part of z-machine input (more prompts and
* filename requests). */
static void ui_read_misc_line(char *s, char *prompt)
Expand All @@ -449,6 +450,7 @@ static void ui_read_misc_line(char *s, char *prompt)
/* Remove terminating newline */
s[strlen(s) - 1] = '\0';
}
#endif

/* For allowing the user to input in a single line keys to be returned
* for several consecutive calls to read_char, with no screen update
Expand Down
2 changes: 2 additions & 0 deletions src/ios/ui_pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ static struct {
} *pict_info;
static int num_pictures = 0;

#if 0 // unused
static unsigned char lookupb(unsigned char *p, int n)
{
return p[n];
Expand All @@ -65,6 +66,7 @@ static int round_div(int x, int y)
quotient++;
return quotient;
}
#endif

/* Convert a Z picture number to an index into pict_info. */
static int z_num_to_index(int n)
Expand Down
4 changes: 2 additions & 2 deletions src/ios/ui_text.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ cell *screen_data = NULL;
cellcolor *screen_colors = NULL;

static cell make_cell(int style, char c) {return (style << 8) | (0xff & c);}
static char cell_char(cell c) {return c & 0xff;}
static int cell_style(cell c) {return c >> 8;}
//static char cell_char(cell c) {return c & 0xff;}
//static int cell_style(cell c) {return c >> 8;}

/* A cell's style is REVERSE_STYLE, normal (0), or PICTURE_STYLE.
* PICTURE_STYLE means the character is part of an ascii image outline
Expand Down

0 comments on commit 0b7382e

Please sign in to comment.