From e1456c5522aedd3895d6ecb9f136295f85a611c3 Mon Sep 17 00:00:00 2001 From: matsutsuka Date: Wed, 28 Nov 2007 09:38:21 +0000 Subject: [PATCH] Some changes have been applied to support various CTK configurations. --- platform/pc-6001/ctk/ctk_arch-def.h | 31 ++++++++++++++++----- platform/pc-6001/ctk/libconio_arch-small.cS | 17 +++++++++-- platform/pc-6001/ctk/libconio_arch-small.h | 8 +++++- platform/pc-6001/ctk/libconio_arch.h | 4 +-- 4 files changed, 48 insertions(+), 12 deletions(-) diff --git a/platform/pc-6001/ctk/ctk_arch-def.h b/platform/pc-6001/ctk/ctk_arch-def.h index 7c70cd96f..e3b70eadb 100644 --- a/platform/pc-6001/ctk/ctk_arch-def.h +++ b/platform/pc-6001/ctk/ctk_arch-def.h @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ctk_arch-def.h,v 1.3 2007/09/29 04:10:00 matsutsuka Exp $ + * $Id: ctk_arch-def.h,v 1.4 2007/11/28 09:38:21 matsutsuka Exp $ * */ @@ -111,31 +111,48 @@ /* Contiki toolkit options */ +#if defined(CTK_CLIENT) || defined(CTK_SERVER) +/* If network is available, turn all options off by the memory reason */ +#define CTK_CONF_ICONS 0 +#define CTK_CONF_ICON_TEXTMAPS 0 +#define CTK_CONF_WINDOWCLOSE 0 +#define CTK_CONF_WINDOWMOVE 0 +#define CTK_CONF_MENUS 0 +#define CTK_CONF_HYPERLINK 0 +#elif defined(CTK_NOICON) +/* In the case of loader arch, we omit the icons by the memory reason */ +#define CTK_CONF_ICONS 0 +#define CTK_CONF_ICON_TEXTMAPS 0 +#define CTK_CONF_WINDOWCLOSE 1 +#define CTK_CONF_WINDOWMOVE 1 +#define CTK_CONF_MENUS 1 +#define CTK_CONF_HYPERLINK 1 +#else /* CTK_MINIMUM */ /* Toggles support for desktop icons. */ #define CTK_CONF_ICONS 1 /* Define if text icon is used. */ #define CTK_CONF_ICON_TEXTMAPS 1 -/* Define if bitmap icon is used. */ -#define CTK_CONF_ICON_BITMAPS 0 /* Toggles support for closable windows. */ #define CTK_CONF_WINDOWCLOSE 1 /* Toggles support for movable windows. */ #define CTK_CONF_WINDOWMOVE 1 /* Toggles support for menus. */ #define CTK_CONF_MENUS 1 +/* Defines if hyperlink is supported. */ +#define CTK_CONF_HYPERLINK 1 +#endif /* CTK_MINIMUM */ + +/* Define if bitmap icon is used. */ +#define CTK_CONF_ICON_BITMAPS 0 /* Defines the default width of a menu. */ #define CTK_CONF_MENUWIDTH 16 /* Defines if screen saver is supported. */ #define CTK_CONF_SCREENSAVER 0 /* Defines if mouse is supported. */ #define CTK_CONF_MOUSE_SUPPORT 0 -/* Defines if hyperlink is supported. */ -#define CTK_CONF_HYPERLINK 1 /* The maximum number of menu items in each menu. */ #define CTK_CONF_MAXMENUITEMS 4 -//#define CTK_CONF_MAX_REDRAWWIDGETS 2 -//#define CTK_CONF_MAX_REDRAWWINDOWS 2 /* Key used to switch the frontmost window. */ #define CTK_CONF_WINDOWSWITCH_KEY CH_F3 diff --git a/platform/pc-6001/ctk/libconio_arch-small.cS b/platform/pc-6001/ctk/libconio_arch-small.cS index 18408ba3f..1ff865faa 100644 --- a/platform/pc-6001/ctk/libconio_arch-small.cS +++ b/platform/pc-6001/ctk/libconio_arch-small.cS @@ -7,7 +7,7 @@ ;;; ;;; @author Takahide Matsutsuka ;;; -;;; $Id: libconio_arch-small.cS,v 1.1 2007/09/30 12:46:34 matsutsuka Exp $ +;;; $Id: libconio_arch-small.cS,v 1.2 2007/11/28 09:38:21 matsutsuka Exp $ ;;; ;; uses preprocessor to enable definitions @@ -16,6 +16,7 @@ ;; export symbols .globl _clrscr_arch .globl _libputc_arch + .globl _libputs_arch .area _DATA _screen_offset:: @@ -98,5 +99,17 @@ _libputc_arch_scroll_loop: pop hl pop de jr _libputc_arch_putc - + +_libputs_arch: + ld hl, #2 + add hl, sp + ld e, (hl) + inc hl + ld d, (hl) +_libputs_arch_loop: + ld a, (hl) + or a + ret z + call _libputc_asm + jr _libputs_arch_loop _libconio_arch_small_end:: diff --git a/platform/pc-6001/ctk/libconio_arch-small.h b/platform/pc-6001/ctk/libconio_arch-small.h index 4de83ee1c..985a8dee4 100644 --- a/platform/pc-6001/ctk/libconio_arch-small.h +++ b/platform/pc-6001/ctk/libconio_arch-small.h @@ -2,7 +2,13 @@ #define __LIBCONIO_ARCH_MSLL_H__ #include "contiki.h" -void clrscr_arch(); +void clrscr_arch(void); void libputc_arch(unsigned char ch); +void libputs_arch(char* str); + +unsigned char wherex(void); +unsigned char wherey(void); +void gotoxy(unsigned char x, unsigned char y); + #endif /* __LIBCONIO_ARCH_MSLL_H__ */ diff --git a/platform/pc-6001/ctk/libconio_arch.h b/platform/pc-6001/ctk/libconio_arch.h index b468bf5ea..beeeee133 100644 --- a/platform/pc-6001/ctk/libconio_arch.h +++ b/platform/pc-6001/ctk/libconio_arch.h @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: libconio_arch.h,v 1.2 2007/09/29 04:10:00 matsutsuka Exp $ + * $Id: libconio_arch.h,v 1.3 2007/11/28 09:38:21 matsutsuka Exp $ * */ @@ -51,9 +51,9 @@ void cvline_arch(unsigned char length); void clip_arch(unsigned char clip1, unsigned char clip2); void clearto_arch(unsigned char to); void revers_arch(unsigned char reversed); +void gotoxy_arch(unsigned char x, unsigned char y); #endif /* LIBCONIO_CONF_EXPORT */ unsigned char wherex_arch(); unsigned char wherey_arch(); -void gotoxy_arch(unsigned char x, unsigned char y); #endif /* __LIBCONIO_ARCH_H__ */