From: izydorst Date: Sun, 17 Jul 2005 11:59:46 +0000 (+0000) Subject: Stefan Haubenthal's patch for Contiki port X-Git-Tag: V2.12.0~314 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e642fbbbeae6918f21c202b89538a80f4ae3ddbe;p=cc65 Stefan Haubenthal's patch for Contiki port git-svn-id: svn://svn.cc65.org/cc65/trunk@3529 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/doc/geos.sgml b/doc/geos.sgml index b1ec523a7..acfb15654 100644 --- a/doc/geos.sgml +++ b/doc/geos.sgml @@ -6,7 +6,7 @@ GEOSLib docs <author>Maciej Witkowiak, <htmlurl url="mailto:ytm@elysium.pl" name="ytm@elysium.pl"> -<date>v1.5, 26.12.1999, 2000, 2001, 2002, 2003 +<date>v1.5, 26.12.1999, 2000, 2001, 2002, 2003, 2005 <abstract> This is the documentation of cc65's GEOSLib, but information contained here may be also useful for writing GEOS applications in general. @@ -53,6 +53,8 @@ changed between <tt/tgi_init/ and <tt/tgi_done/. It is safe to use these standard includes and their contents: <tt/assert.h, conio.h, dio.h, errno.h, em.h, geos.h, joystick.h, modload.h, mouse.h, stdlib.h, string.h, tgi.h, time.h/ <p> +For <tt/time.h/ functions <tt/systime()/ and <tt/clock/ note that the resolution is one second. +<p> It was not tested enough, but functions from these includes might work under GEOS: <tt/rs232.h, zlib.h/ <p> diff --git a/include/geos.h b/include/geos.h index f70a88b6e..9c44bbdb8 100644 --- a/include/geos.h +++ b/include/geos.h @@ -2,7 +2,7 @@ Supreme GEOS header file includes all other headers - Maciej 'YTM/Alliance' Witkowiak, 27.10.1999 + Maciej 'YTM/Elysium' Witkowiak, 27.10.1999 */ @@ -67,10 +67,41 @@ #include <geos/gdlgbox.h> #endif - +/* Character codes $80-$8F */ +/* 1 */ +/* 2 4 */ +/* 8 */ +#define CH_HLINE 128|0|2|4|0 +#define CH_VLINE 128|1|0|0|8 +#define CH_ULCORNER 128|1|2|0|0 +#define CH_URCORNER 128|1|0|4|0 +#define CH_LLCORNER 128|0|2|0|8 +#define CH_LRCORNER 128|0|0|4|8 +#define CH_TTEE 128|1|2|4|0 +#define CH_RTEE 128|1|0|4|8 +#define CH_BTEE 128|0|2|4|8 +#define CH_LTEE 128|1|2|0|8 +#define CH_CROSS 128|1|2|4|8 + +/* Additional key defines */ +#define CH_F1 133 +#define CH_F2 137 +#define CH_F3 134 +#define CH_F4 138 +#define CH_F5 135 +#define CH_F6 139 +#define CH_F7 136 +#define CH_F8 140 + +#define CH_CURS_UP 145 +#define CH_CURS_DOWN 17 +#define CH_CURS_LEFT 157 +#define CH_CURS_RIGHT 29 +#define CH_DEL 20 +#define CH_INS 148 +#define CH_ENTER '\n' +#define CH_STOP 3 +#define CH_ESC 27 /* End of geos.h */ #endif - - - diff --git a/include/time.h b/include/time.h index 7ed6a9c70..7cff2d7c3 100644 --- a/include/time.h +++ b/include/time.h @@ -96,6 +96,9 @@ unsigned _clocks_per_sec (void); #elif defined(__NES__) # define CLK_TCK 50 /* POSIX */ # define CLOCKS_PER_SEC 50 /* ANSI */ +#elif defined(__GEOS__) +# define CLK_TCK 1 /* POSIX */ +# define CLOCKS_PER_SEC 1 /* ANSI */ #endif diff --git a/libsrc/geos/system/systime.c b/libsrc/geos/system/systime.c index 14e56641a..b3d4ab11f 100644 --- a/libsrc/geos/system/systime.c +++ b/libsrc/geos/system/systime.c @@ -27,3 +27,8 @@ struct tm currentTime; } +clock_t clock(void) { + + return _systime(); + +}