2018-02-23 17:14:06 +01:00
|
|
|
diff -rupN tint-0.04+nmu1/config.h tint/config.h
|
|
|
|
--- tint-0.04+nmu1/config.h 2001-12-08 00:03:24.000000000 +0100
|
|
|
|
+++ tint/config.h 2018-02-23 12:00:00.000000000 +0200
|
2017-08-13 19:38:41 +02:00
|
|
|
@@ -29,7 +29,15 @@
|
2008-04-15 18:47:20 +02:00
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#include <libpayload.h>
|
|
|
|
+#include <curses.h>
|
2008-05-13 23:29:48 +02:00
|
|
|
+
|
2017-08-13 19:38:41 +02:00
|
|
|
+#define curs_set(x)
|
|
|
|
+#define USE_RAND
|
2008-04-15 18:47:20 +02:00
|
|
|
+
|
|
|
|
/* Score file */
|
|
|
|
+#if 0
|
|
|
|
const char scorefile[] = SCOREFILE;
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
#endif /* #ifndef CONFIG_H */
|
2018-02-23 17:14:06 +01:00
|
|
|
diff -rupN tint-0.04+nmu1/engine.c tint/engine.c
|
|
|
|
--- tint-0.04+nmu1/engine.c 2005-07-17 13:26:22.000000000 +0200
|
|
|
|
+++ tint/engine.c 2018-02-23 12:00:00.000000000 +0200
|
2016-05-27 23:44:47 +02:00
|
|
|
@@ -27,10 +27,13 @@
|
2008-04-15 18:47:20 +02:00
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#include "config.h"
|
|
|
|
+
|
|
|
|
+#if 0
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2016-05-27 23:44:47 +02:00
|
|
|
-#include "typedefs.h"
|
2008-04-15 18:47:20 +02:00
|
|
|
#include "utils.h"
|
2016-05-27 23:44:47 +02:00
|
|
|
#include "io.h"
|
|
|
|
#include "engine.h"
|
2018-02-23 17:14:06 +01:00
|
|
|
diff -rupN tint-0.04+nmu1/engine.h tint/engine.h
|
|
|
|
--- tint-0.04+nmu1/engine.h 2001-12-07 16:48:08.000000000 +0100
|
|
|
|
+++ tint/engine.h 2018-02-23 12:00:00.000000000 +0200
|
2016-05-27 23:44:47 +02:00
|
|
|
@@ -29,7 +29,7 @@
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
-#include "typedefs.h" /* bool */
|
|
|
|
+#include "curses.h" /* bool */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Macros
|
2018-02-23 17:14:06 +01:00
|
|
|
diff -rupN tint-0.04+nmu1/io.c tint/io.c
|
|
|
|
--- tint-0.04+nmu1/io.c 2010-06-23 15:05:12.000000000 +0100
|
|
|
|
+++ tint/io.c 2018-02-23 12:00:00.000000000 +0200
|
2008-04-15 18:47:20 +02:00
|
|
|
@@ -27,9 +27,13 @@
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#include "config.h"
|
|
|
|
+
|
|
|
|
+#if 0
|
|
|
|
#include <stdarg.h> /* va_list(), va_start(), va_end() */
|
|
|
|
#include <sys/time.h> /* gettimeofday() */
|
|
|
|
#include <unistd.h> /* gettimeofday() */
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2018-02-23 17:14:06 +01:00
|
|
|
#include "io.h"
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2018-02-23 17:14:06 +01:00
|
|
|
@@ -68,7 +72,11 @@ static int in_timeleft;
|
2008-04-15 18:47:20 +02:00
|
|
|
/* Initialize screen */
|
|
|
|
void io_init ()
|
|
|
|
{
|
|
|
|
+ curses_enable_serial(0);
|
|
|
|
+ curses_enable_vga(1);
|
|
|
|
initscr ();
|
|
|
|
+ halfdelay(1);
|
|
|
|
+ timeout(1);
|
|
|
|
start_color ();
|
|
|
|
curs_set (CURSOR_INVISIBLE);
|
|
|
|
out_attr = A_NORMAL;
|
2018-02-23 17:14:06 +01:00
|
|
|
@@ -177,11 +185,17 @@ void out_beep ()
|
2008-04-15 18:47:20 +02:00
|
|
|
/* Read a character. Please note that you MUST call in_timeout() before in_getch() */
|
|
|
|
int in_getch ()
|
|
|
|
{
|
|
|
|
+#if 0
|
|
|
|
struct timeval starttv,endtv;
|
|
|
|
+#endif
|
|
|
|
int ch;
|
|
|
|
+#if 0
|
|
|
|
timeout (in_timeleft / 1000);
|
|
|
|
gettimeofday (&starttv,NULL);
|
|
|
|
+#endif
|
|
|
|
ch = getch ();
|
|
|
|
+ mdelay(150);
|
|
|
|
+#if 0
|
|
|
|
gettimeofday (&endtv,NULL);
|
|
|
|
/* Timeout? */
|
|
|
|
if (ch == ERR)
|
2018-02-23 17:14:06 +01:00
|
|
|
@@ -199,6 +213,7 @@ int in_getch ()
|
2008-04-15 18:47:20 +02:00
|
|
|
in_timeleft -= endtv.tv_usec;
|
|
|
|
if (in_timeleft <= 0) in_timeleft = in_timetotal;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
return ch;
|
|
|
|
}
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2018-02-23 17:14:06 +01:00
|
|
|
diff -rupN tint-0.04+nmu1/io.h tint/io.h
|
|
|
|
--- tint-0.04+nmu1/io.h 2010-06-23 14:55:03.000000000 +0100
|
|
|
|
+++ tint/io.h 2018-02-23 12:00:00.000000000 +0200
|
|
|
|
@@ -29,9 +29,8 @@
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2016-05-27 23:44:47 +02:00
|
|
|
-
|
2018-02-23 17:14:06 +01:00
|
|
|
+
|
|
|
|
#include <curses.h>
|
|
|
|
-#include <wchar.h>
|
2016-05-27 23:44:47 +02:00
|
|
|
-
|
2018-02-23 17:14:06 +01:00
|
|
|
+
|
|
|
|
/*
|
|
|
|
* Colors
|
|
|
|
*/
|
|
|
|
diff -rupN tint-0.04+nmu1/Makefile tint/Makefile
|
|
|
|
--- tint-0.04+nmu1/Makefile 2010-06-23 15:06:11.000000000 +0200
|
|
|
|
+++ tint/Makefile 2018-02-23 12:00:00.000000000 +0200
|
|
|
|
@@ -1,0 +1,106 @@
|
|
|
|
+
|
|
|
|
+# -*- sh -*-
|
|
|
|
+
|
|
|
|
+# Copyright (c) Abraham vd Merwe <abz@blio.net>
|
|
|
|
+# All rights reserved.
|
|
|
|
+#
|
|
|
|
+# Redistribution and use in source and binary forms, with or without
|
|
|
|
+# modification, are permitted provided that the following conditions
|
|
|
|
+# are met:
|
|
|
|
+# 1. Redistributions of source code must retain the above copyright
|
|
|
|
+# notice, this list of conditions and the following disclaimer.
|
|
|
|
+#
|
|
|
|
+# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
+# notice, this list of conditions and the following disclaimer in the
|
|
|
|
+# documentation and/or other materials provided with the distribution.
|
|
|
|
+# 3. Neither the name of the author nor the names of other contributors
|
|
|
|
+# may be used to endorse or promote products derived from this software
|
|
|
|
+# without specific prior written permission.
|
|
|
|
+#
|
|
|
|
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
+
|
2016-05-27 23:44:47 +02:00
|
|
|
+# in addition to the dependency below, create the file if it doesn't exist
|
|
|
|
+# to silence warnings about a file that would be generated anyway.
|
|
|
|
+$(if $(wildcard .xcompile),,$(eval $(shell ../../../../util/xcompile/xcompile $(XGCCPATH) > .xcompile || rm -f .xcompile)))
|
|
|
|
+.xcompile: ../../../../util/xcompile/xcompile
|
|
|
|
+
|
|
|
|
+CONFIG_COMPILER_GCC := y
|
|
|
|
+ARCH-y := x86_32
|
|
|
|
+
|
|
|
|
+include .xcompile
|
|
|
|
+
|
|
|
|
+src := $(CURDIR)
|
|
|
|
+srctree := $(src)
|
|
|
|
+tint_obj := $(src)/build
|
|
|
|
+
|
|
|
|
+LIBCONFIG_PATH := $(realpath ../../../libpayload)
|
|
|
|
+LIBPAYLOAD_DIR := $(tint_obj)/libpayload
|
|
|
|
+HAVE_LIBPAYLOAD := $(wildcard $(LIBPAYLOAD_DIR)/lib/libpayload.a)
|
|
|
|
+LIB_CONFIG ?= configs/defconfig-tinycurses
|
|
|
|
+
|
|
|
|
+# CFLAGS := -Wall -Werror -Os
|
|
|
|
+CFLAGS := -Wall -g -Os
|
|
|
|
+TARGET := tint
|
|
|
|
+OBJS := $(TARGET).o engine.o io.o utils.o
|
|
|
|
+
|
|
|
|
+ARCH-y := x86_32
|
|
|
|
+
|
|
|
|
+CC := $(CC_$(ARCH-y))
|
|
|
|
+AS := $(AS_$(ARCH-y))
|
|
|
|
+OBJCOPY := $(OBJCOPY_$(ARCH-y))
|
|
|
|
+
|
|
|
|
+LPCC := CC="$(CC)" $(LIBPAYLOAD_DIR)/bin/lpgcc
|
|
|
|
+LPAS := AS="$(AS)" $(LIBPAYLOAD_DIR)/bin/lpas
|
|
|
|
+
|
|
|
|
+# Make is silent per default, but 'make V=1' will show all compiler calls.
|
|
|
|
+ifneq ($(V),1)
|
|
|
|
+Q := @
|
2018-02-23 17:14:06 +01:00
|
|
|
+endif
|
|
|
|
+
|
2016-05-27 23:44:47 +02:00
|
|
|
+all: $(TARGET).elf
|
|
|
|
+# printf" CC $(CC)\n"
|
|
|
|
+
|
|
|
|
+$(TARGET).elf: $(OBJS) libpayload
|
|
|
|
+ $(Q)printf " LPCC $(subst $(shell pwd)/,,$(@))\n"
|
|
|
|
+ $(Q)$(LPCC) -o $@ $(OBJS)
|
|
|
|
+ $(Q)$(OBJCOPY) --only-keep-debug $@ tint.debug
|
|
|
|
+ $(Q)$(OBJCOPY) --strip-debug $@
|
|
|
|
+ $(Q)$(OBJCOPY) --add-gnu-debuglink=tint.debug $@
|
|
|
|
+
|
|
|
|
+%.o: %.c libpayload
|
|
|
|
+ $(Q)printf " LPCC $(subst $(shell pwd)/,,$(@))\n"
|
|
|
|
+ $(Q)$(LPCC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
|
|
+
|
|
|
|
+%.S.o: %.S libpayload
|
|
|
|
+ $(Q)printf " LPAS $(subst $(shell pwd)/,,$(@))\n"
|
|
|
|
+ $(Q)$(LPAS) $(ASFLAGS) --32 -o $@ $<
|
|
|
|
+
|
|
|
|
+ifneq ($(strip $(HAVE_LIBPAYLOAD)),)
|
|
|
|
+libpayload:
|
|
|
|
+ $(Q)printf "Found Libpayload $(LIBPAYLOAD_DIR).\n"
|
2018-02-23 17:14:06 +01:00
|
|
|
+else
|
2016-05-27 23:44:47 +02:00
|
|
|
+libpayload:
|
|
|
|
+ $(Q)printf "Building libpayload @ $(LIBCONFIG_PATH).\n"
|
|
|
|
+ $(Q)make -C $(LIBCONFIG_PATH) distclean
|
|
|
|
+ $(Q)make -C $(LIBCONFIG_PATH) defconfig KBUILD_DEFCONFIG=$(LIB_CONFIG)
|
|
|
|
+ $(Q)make -C $(LIBCONFIG_PATH) DESTDIR=$(tint_obj) install
|
2018-02-23 17:14:06 +01:00
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+clean:
|
2016-05-27 23:44:47 +02:00
|
|
|
+ $(Q)rm -f $(TARGET).elf $(TARGET).debug *.o
|
|
|
|
+ $(Q)rm .xcompile
|
2018-02-23 17:14:06 +01:00
|
|
|
+
|
|
|
|
+distclean: clean
|
2016-05-27 23:44:47 +02:00
|
|
|
+ $(Q)rm -rf $(tint_obj)
|
2018-02-23 17:14:06 +01:00
|
|
|
+
|
2016-05-27 23:44:47 +02:00
|
|
|
+
|
|
|
|
+.PHONY: all clean do-it-all depend with-depends without-depends debian postinst
|
2018-02-23 17:14:06 +01:00
|
|
|
diff -rupN tint-0.04+nmu1/tint.c tint/tint.c
|
|
|
|
--- tint-0.04+nmu1/tint.c 2010-08-08 19:42:50.000000000 +0200
|
|
|
|
+++ tint/tint.c 2018-02-23 12:00:00.000000000 +0200
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -1,4 +1,3 @@
|
|
|
|
-
|
|
|
|
/*
|
|
|
|
* Copyright (c) Abraham vd Merwe <abz@blio.net>
|
|
|
|
* All rights reserved.
|
|
|
|
@@ -27,6 +26,7 @@
|
2008-04-15 18:47:20 +02:00
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2016-05-27 23:44:47 +02:00
|
|
|
@@ -34,8 +34,8 @@
|
2008-04-15 18:47:20 +02:00
|
|
|
#include <pwd.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2016-05-27 23:44:47 +02:00
|
|
|
-#include "typedefs.h"
|
2008-04-15 18:47:20 +02:00
|
|
|
#include "utils.h"
|
2016-05-27 23:44:47 +02:00
|
|
|
#include "io.h"
|
|
|
|
#include "config.h"
|
2018-02-23 17:14:06 +01:00
|
|
|
@@ -306,4 +306,4 @@
|
|
|
|
/* Header for scorefile */
|
|
|
|
-#define SCORE_HEADER "Tint 0.02b (c) Abraham vd Merwe - Scores"
|
|
|
|
+#define SCORE_HEADER "Tint 0.04+nmu1 (c) Abraham vd Merwe - Scores"
|
|
|
|
-
|
|
|
|
+
|
|
|
|
/* Header for score title */
|
|
|
|
@@ -322,6 +322,7 @@ typedef struct
|
2008-04-15 18:47:20 +02:00
|
|
|
time_t timestamp;
|
|
|
|
} score_t;
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
static void getname (char *name)
|
|
|
|
{
|
|
|
|
struct passwd *pw = getpwuid (geteuid ());
|
2018-02-23 17:14:06 +01:00
|
|
|
@@ -338,7 +339,9 @@ static void getname (char *name)
|
2008-04-15 18:47:20 +02:00
|
|
|
name[NAMELEN - 1] = '\0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
static void err1 ()
|
|
|
|
{
|
|
|
|
fprintf (stderr,"Error creating %s\n",scorefile);
|
2018-02-23 17:14:06 +01:00
|
|
|
@@ -350,10 +353,11 @@ static void err2 ()
|
2008-04-15 18:47:20 +02:00
|
|
|
fprintf (stderr,"Error writing to %s\n",scorefile);
|
|
|
|
exit (EXIT_FAILURE);
|
|
|
|
}
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
void showplayerstats (engine_t *engine)
|
|
|
|
{
|
|
|
|
- fprintf (stderr,
|
|
|
|
+ printf (
|
|
|
|
"\n\t PLAYER STATISTICS\n\n\t"
|
|
|
|
"Score %11d\n\t"
|
|
|
|
"Efficiency %11d\n\t"
|
2018-02-23 17:14:06 +01:00
|
|
|
@@ -361,6 +365,7 @@ void showplayerstats (engine_t *engine)
|
2008-04-15 18:47:20 +02:00
|
|
|
GETSCORE (engine->score),engine->status.efficiency,GETSCORE (engine->score) / getsum ());
|
|
|
|
}
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
static void createscores (int score)
|
|
|
|
{
|
|
|
|
FILE *handle;
|
2018-02-23 17:14:06 +01:00
|
|
|
@@ -395,7 +400,9 @@ static void createscores (int score)
|
2008-04-15 18:47:20 +02:00
|
|
|
fprintf (stderr,"%s",scoretitle);
|
|
|
|
fprintf (stderr,"\t 1* %7d %s\n\n",score,scores[0].name);
|
|
|
|
}
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
static int cmpscores (const void *a,const void *b)
|
|
|
|
{
|
|
|
|
int result;
|
2018-02-23 17:14:06 +01:00
|
|
|
@@ -413,7 +420,9 @@ static int cmpscores (const void *a,cons
|
2008-04-15 18:47:20 +02:00
|
|
|
/* timestamps is equal */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
static void savescores (int score)
|
|
|
|
{
|
|
|
|
FILE *handle;
|
2018-02-23 17:14:06 +01:00
|
|
|
@@ -491,11 +500,13 @@ static void savescores (int score)
|
2008-04-15 18:47:20 +02:00
|
|
|
}
|
|
|
|
fprintf (stderr,"\n");
|
|
|
|
}
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/***************************************************************************/
|
|
|
|
/***************************************************************************/
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
static void showhelp ()
|
|
|
|
{
|
2018-02-23 17:14:06 +01:00
|
|
|
fprintf (stderr,"USAGE: tint [-h] [-l level] [-n] [-d] [-b char]\n");
|
|
|
|
@@ -506,9 +517,11 @@ static void showhelp ()
|
|
|
|
fprintf (stderr," -b <char> Use this character to draw blocks instead of spaces\n");
|
2008-04-15 18:47:20 +02:00
|
|
|
exit (EXIT_FAILURE);
|
|
|
|
}
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
static void parse_options (int argc,char *argv[])
|
|
|
|
{
|
|
|
|
+#if 0
|
|
|
|
int i = 1;
|
|
|
|
while (i < argc)
|
|
|
|
{
|
2018-02-23 17:14:06 +01:00
|
|
|
@@ -544,10 +557,12 @@ static void parse_options (int argc,char
|
2008-04-15 18:47:20 +02:00
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
}
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
static void choose_level ()
|
|
|
|
{
|
|
|
|
+#if 0
|
|
|
|
char buf[NAMELEN];
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
do
|
2018-02-23 17:14:06 +01:00
|
|
|
@@ -557,6 +572,8 @@ static void choose_level ()
|
2008-04-15 18:47:20 +02:00
|
|
|
buf[strlen (buf) - 1] = '\0';
|
|
|
|
}
|
|
|
|
while (!str2int (&level,buf) || level < MINLEVEL || level > MAXLEVEL);
|
|
|
|
+#endif
|
|
|
|
+ level = 1;
|
|
|
|
}
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
/***************************************************************************/
|
2018-02-23 17:14:06 +01:00
|
|
|
@@ -569,6 +586,8 @@ int main (int argc,char *argv[])
|
2017-03-10 21:39:52 +01:00
|
|
|
int ch;
|
|
|
|
engine_t engine;
|
|
|
|
/* Initialize */
|
2019-03-06 01:55:15 +01:00
|
|
|
+ if (CONFIG(LP_USB))
|
2017-03-10 21:39:52 +01:00
|
|
|
+ usb_initialize();
|
|
|
|
rand_init (); /* must be called before engine_init () */
|
|
|
|
engine_init (&engine,score_function); /* must be called before using engine.curshape */
|
|
|
|
finished = shownext = FALSE;
|
2018-02-23 17:42:40 +01:00
|
|
|
@@ -632,13 +651,15 @@ int main (int argc,char *argv[])
|
|
|
|
/* pause */
|
|
|
|
case 'p':
|
|
|
|
out_setcolor (COLOR_WHITE,COLOR_BLACK);
|
|
|
|
- out_gotoxy ((out_width () - 34) / 2,out_height () - 2);
|
|
|
|
+ out_gotoxy ((out_width () - 34) / 2,out_height () / 2);
|
|
|
|
out_printf ("Paused - Press any key to continue");
|
|
|
|
+ refresh ();
|
|
|
|
while ((ch = in_getch ()) == ERR) ; /* Wait for a key to be pressed */
|
|
|
|
in_flush (); /* Clear keyboard buffer */
|
|
|
|
- out_gotoxy ((out_width () - 34) / 2,out_height () - 2);
|
|
|
|
+ out_gotoxy ((out_width () - 34) / 2,out_height () / 2);
|
|
|
|
out_printf (" ");
|
|
|
|
+ refresh ();
|
|
|
|
break;
|
|
|
|
/* unknown keypress */
|
|
|
|
default:
|
|
|
|
out_beep ();
|
|
|
|
@@ -673,11 +694,31 @@ int main (int argc,char *argv[])
|
2018-02-23 17:14:06 +01:00
|
|
|
/* Restore console settings and exit */
|
|
|
|
io_close ();
|
|
|
|
+#if 0
|
|
|
|
/* Don't bother the player if he want's to quit */
|
2008-04-15 18:47:20 +02:00
|
|
|
if (ch != 'q')
|
|
|
|
{
|
2018-02-23 17:14:06 +01:00
|
|
|
+#endif
|
2008-04-15 18:47:20 +02:00
|
|
|
showplayerstats (&engine);
|
|
|
|
+#if 0
|
|
|
|
savescores (GETSCORE (engine.score));
|
|
|
|
}
|
2018-02-23 17:14:06 +01:00
|
|
|
+#endif
|
2018-02-23 17:32:15 +01:00
|
|
|
+ printf("Press 'q' to reboot...\n");
|
2008-04-15 18:47:20 +02:00
|
|
|
+ refresh();
|
2018-02-23 17:32:15 +01:00
|
|
|
+ for (;;) {
|
|
|
|
+ in_flush ();
|
|
|
|
+ while ((ch = in_getch ()) == ERR) ; /* Wait for a key to be pressed */
|
|
|
|
+ if (ch == 'q') { /* reboot */
|
|
|
|
+ outb(0x6, 0xcf9);
|
|
|
|
+ for(;;); //halt();
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ in_flush ();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
exit (EXIT_SUCCESS);
|
|
|
|
+#endif
|
|
|
|
}
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2018-02-23 17:14:06 +01:00
|
|
|
diff -rupN tint-0.04+nmu1/utils.c tint/utils.c
|
|
|
|
--- tint-0.04+nmu1/utils.c 2001-12-07 16:49:19.000000000 +0100
|
|
|
|
+++ tint/utils.c 2018-02-23 12:00:00.000000000 +0200
|
2016-05-27 23:44:47 +02:00
|
|
|
@@ -27,11 +27,13 @@
|
2008-04-15 18:47:20 +02:00
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#include "config.h"
|
|
|
|
+
|
|
|
|
+#if 0
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <limits.h>
|
2016-05-27 23:44:47 +02:00
|
|
|
-
|
|
|
|
-#include "typedefs.h"
|
2008-04-15 18:47:20 +02:00
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2016-05-27 23:44:47 +02:00
|
|
|
/*
|
|
|
|
* Initialize random number generator
|
2017-08-13 19:38:41 +02:00
|
|
|
@@ -61,6 +63,7 @@ int rand_value (int range)
|
2008-04-15 18:47:20 +02:00
|
|
|
* Convert an str to long. Returns TRUE if successful,
|
|
|
|
* FALSE otherwise.
|
|
|
|
*/
|
|
|
|
+#if 0
|
|
|
|
bool str2int (int *i,const char *str)
|
|
|
|
{
|
|
|
|
char *endptr;
|
2017-08-13 19:38:41 +02:00
|
|
|
@@ -69,3 +72,4 @@ bool str2int (int *i,const char *str)
|
2008-04-15 18:47:20 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#endif
|
2018-02-23 17:14:06 +01:00
|
|
|
diff -rupN tint-0.04+nmu1/utils.h tint/utils.h
|
|
|
|
--- tint-0.04+nmu1/utils.h 2001-12-07 16:49:35.000000000 +0100
|
|
|
|
+++ tint/utils.h 2018-02-23 12:00:00.000000000 +0200
|
2016-05-27 23:44:47 +02:00
|
|
|
@@ -29,7 +29,7 @@
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
-#include "typedefs.h"
|
|
|
|
+#include <curses.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize random number generator
|