BINNAME = frotz.exe\r
LIBRARY = frotz.lib\r
\r
-SOUND_DEF = -DSOUND_SUPPORT\r
-DOS_DEF = -DMSDOS_16BIT\r
+VERSION = "2.45pre"\r
\r
-DEFS = $(SOUND_DEF) $(DOS_DEF)\r
+VER = -DVERSION=$(VERSION)\r
+\r
+DEFS = src\common\defs.h\r
\r
DOS_DIR = src\dos\r
DOS_OBJECTS = $(DOS_DIR)\bcinit.o \\r
\r
.SUFFIXES: .c .o .h\r
\r
+all: defs frotz\r
+\r
+defs: $(DEFS)\r
+$(DEFS):\r
+ @echo "** Generating $@"\r
+ @echo "#ifndef COMMON_DEFINES_H" > $@\r
+ @echo "#define COMMON_DEFINES_H" >> $@\r
+ @echo "#define MSDOS_16BIT" >> $@\r
+ @echo "#define SOUND_SUPPORT" >> $@\r
+ @echo "#endif /* COMMON_DEFINES_H */" >> $@\r
+\r
.c.o:\r
- $(CC) $(CFLAGS) $(DEFS) -I$(DOS_DIR) -I$(CORE_DIR) -c -o$@ $<\r
+ $(CC) $(CFLAGS) $(VER) -I$(DOS_DIR) -I$(CORE_DIR) -c -o$@ $<\r
$(TLIB) $(LIBRARY) +-$@\r
\r
-all: frotz\r
-\r
clean:\r
$(RM) $(CORE_DIR)\*.o\r
$(RM) $(DOS_DIR)\*.o\r
+ $(RM) $(DEFS)\r
$(RM) *.lib\r
$(RM) *.exe\r
$(RM) *.bak\r
#ifndef FROTZ_H_
#define FROTZ_H_
+#include "defs.h"
+
/* Unfortunately, frotz's bool definition conflicts with that of curses.
But since no os_* function uses it, it's safe to let the frotz core see
this definition, but have the unix port see the curses version. */
+#ifndef MSDOS_16BIT
#include "git_hash.h"
+#endif
#ifndef __UNIX_PORT_FILE
#include <signal.h>
#include "setup.h"
-#include "defs.h"
#include "missing.h"
#include "unused.h"
} test;
uint32 val;
- if (sizeof(uint32) != 4 || sizeof(uint16) != 2)
- return bb_err_CompileTime; /* Basic types are the wrong size. */
+// if (sizeof(uint32) != 4 || sizeof(uint16) != 2)
+// return bb_err_CompileTime; /* Basic types are the wrong size. */
test.ch[0] = 0x13;
test.ch[1] = 0x57;
*
*/
-int os_read_file_name (char *file_name, const char *default_name, int flag)
+char *os_read_file_name (const char *default_name, int flag)
{
char *extension;
FILE *fp;
int i;
char *tempname;
+ char file_name[FILENAME_MAX + 1];
/* Turn off playback and recording temporarily */
istream_replay = saved_replay;
ostream_record = saved_record;
- return result;
+ if (!result) return NULL;
+
+ return strdup(file_name);
}/* os_read_file_name */
+
+
+/*
+ * Called regularly by the interpreter, at least every few instructions
+ * (only when interpreting: e.g., not when waiting for input).
+ */
+void os_tick(void)
+{
+ /* do nothing */
+}