From 021de49f8e3d1c3b9f8e6e13df0ee7f2552c7b7a Mon Sep 17 00:00:00 2001 From: germeier Date: Thu, 26 Jun 2003 19:53:58 +0000 Subject: added support for font file handling - added command font_upload to mpiosh - restore font file after a format --- libmpio/defs.h | 4 ++-- libmpio/mpio.h | 9 +++++++-- libmpio/src/directory.c | 8 +++++--- libmpio/src/mpio.c | 14 +++++++++++++- 4 files changed, 27 insertions(+), 8 deletions(-) (limited to 'libmpio') diff --git a/libmpio/defs.h b/libmpio/defs.h index cd0def3..dd3cd09 100644 --- a/libmpio/defs.h +++ b/libmpio/defs.h @@ -1,5 +1,5 @@ /* - * $Id: defs.h,v 1.26 2003/04/27 12:08:20 germeier Exp $ + * $Id: defs.h,v 1.27 2003/06/26 19:53:58 germeier Exp $ * * libmpio - a library for accessing Digit@lways MPIO players * Copyright (C) 2002, 2003 Markus Germeier @@ -63,7 +63,6 @@ typedef enum { GET_VERSION = 0x01, MODIFY_FIRMWARE = 0xa0 } mpio_cmd_t; /* file types on internal memory */ -/* found in the code of salmoon, are these needed? -mager */ typedef enum { FTYPE_CHAN = 0x00, FTYPE_MUSIC = 0x01, FTYPE_CONF = 'C', @@ -79,6 +78,7 @@ typedef enum { FTYPE_CHAN = 0x00, #define MPIO_CONFIG_FILE "CONFIG.DAT" #define MPIO_CHANNEL_FILE "FMCONFIG.DAT" #define MPIO_MPIO_RECORD "MPIO RECORD" +#define MPIO_FONT_FON "FONT.FON" /* type of callback functions */ typedef BYTE (*mpio_callback_t)(int, int) ; diff --git a/libmpio/mpio.h b/libmpio/mpio.h index 999b0db..6a1e18c 100644 --- a/libmpio/mpio.h +++ b/libmpio/mpio.h @@ -1,5 +1,5 @@ /* - * $Id: mpio.h,v 1.21 2003/04/27 12:08:20 germeier Exp $ + * $Id: mpio.h,v 1.22 2003/06/26 19:53:58 germeier Exp $ * * libmpio - a library for accessing Digit@lways MPIO players * Copyright (C) 2002, 2003 Markus Germeier @@ -122,7 +122,12 @@ int mpio_file_get_to_memory(mpio_t *, mpio_mem_t, mpio_filename_t, /* ... memory pointer, size of file */ int mpio_file_put_from_memory(mpio_t *, mpio_mem_t, mpio_filename_t, mpio_filetype_t, mpio_callback_t, - BYTE *, int); + BYTE *, int); + +/* check if file exists on selected memory */ +/* return pointer to file dentry if file exists */ +BYTE *mpio_file_exists(mpio_t *, mpio_mem_t, mpio_filename_t); + /* * rename a file on the MPIO diff --git a/libmpio/src/directory.c b/libmpio/src/directory.c index 200d1e9..394e193 100644 --- a/libmpio/src/directory.c +++ b/libmpio/src/directory.c @@ -1,5 +1,5 @@ /* - * $Id: directory.c,v 1.5 2003/06/16 10:25:03 germeier Exp $ + * $Id: directory.c,v 1.6 2003/06/26 19:53:58 germeier Exp $ * * libmpio - a library for accessing Digit@lways MPIO players * Copyright (C) 2002, 2003 Markus Germeier @@ -519,8 +519,10 @@ mpio_dentry_filename_write(mpio_t *m, mpio_mem_t mem, BYTE *p, j++; } - f_8_3[6]='~'; - f_8_3[7]='0'; + while(mpio_dentry_find_name_8_3(m, mem, f_8_3)) { + f_8_3[6]='~'; + f_8_3[7]='0'; + } while(mpio_dentry_find_name_8_3(m, mem, f_8_3)) f_8_3[7]++; diff --git a/libmpio/src/mpio.c b/libmpio/src/mpio.c index 133ac9c..1dfa192 100644 --- a/libmpio/src/mpio.c +++ b/libmpio/src/mpio.c @@ -1,5 +1,5 @@ /* - * $Id: mpio.c,v 1.4 2003/05/19 17:30:58 germeier Exp $ + * $Id: mpio.c,v 1.5 2003/06/26 19:53:58 germeier Exp $ * * libmpio - a library for accessing Digit@lways MPIO players * Copyright (C) 2002, 2003 Markus Germeier @@ -1160,6 +1160,18 @@ mpio_file_del(mpio_t *m, mpio_mem_t mem, mpio_filename_t filename, return MPIO_OK; } +BYTE * +mpio_file_exists(mpio_t *m, mpio_mem_t mem, mpio_filename_t filename) { + BYTE *p; + /* find file */ + p = mpio_dentry_find_name(m, mem, filename); + if (!p) + p = mpio_dentry_find_name_8_3(m, mem, filename); + + return p; +} + + int mpio_sync(mpio_t *m, mpio_mem_t mem) { -- cgit v1.2.3