aboutsummaryrefslogtreecommitdiff
path: root/libmpio
diff options
context:
space:
mode:
authorsalmoon <salmoon>2002-09-15 23:05:25 +0000
committersalmoon <salmoon>2002-09-15 23:05:25 +0000
commit6e7a148d06bafdf02bc873ec1dcaf744a3ebb9a5 (patch)
tree81b77a0e7770a40bd1089d9963846a4dc00e7af6 /libmpio
parentd0d132979a676261eb20248b4a1db5dd132fc611 (diff)
downloadmpiosh-6e7a148d06bafdf02bc873ec1dcaf744a3ebb9a5.tar.gz
mpiosh-6e7a148d06bafdf02bc873ec1dcaf744a3ebb9a5.tar.bz2
mpiosh-6e7a148d06bafdf02bc873ec1dcaf744a3ebb9a5.zip
Fixed model2externalmem function and added command, comments
Diffstat (limited to 'libmpio')
-rw-r--r--libmpio/defs.h13
-rw-r--r--libmpio/io.c7
2 files changed, 12 insertions, 8 deletions
diff --git a/libmpio/defs.h b/libmpio/defs.h
index 0032893..7f247aa 100644
--- a/libmpio/defs.h
+++ b/libmpio/defs.h
@@ -1,7 +1,7 @@
/* -*- linux-c -*- */
/*
- * $Id: defs.h,v 1.4 2002/09/15 12:03:23 germeier Exp $
+ * $Id: defs.h,v 1.5 2002/09/15 23:05:25 salmoon Exp $
*
* Library for USB MPIO-*
*
@@ -61,13 +61,16 @@ typedef enum { GET_VERSION = 0x01,
DEL_BLOCK = 0x04,
GET_SECTOR = 0x06,
GET_SPARE_AREA = 0x07,
- PUT_BLOCK = 0x08 } mpio_cmd_t;
+ PUT_BLOCK = 0x08,
+ MODIFY_FIRMWARE = 0xa0 } mpio_cmd_t;
/* file types on internal memory */
/* found in the code of salmoon, are these needed? -mager */
typedef enum { FTYPE_CONF = 'C',
FTYPE_FONT = 'F',
FTYPE_OTHER = 'H',
+ FTYPE_MEMO = 'M',
+ FTYPE_WAV = 'V',
FTYPE_ENTRY = 'R' } mpio_file_t;
#ifndef NULL
@@ -80,7 +83,7 @@ typedef enum { FTYPE_CONF = 'C',
#define SECTOR_ECC 0x040
#define SECTOR_TRANS (SECTOR_SIZE + SECTOR_ECC)
-#define BLOCK_SECTORS 0x20
+#define BLOCK_SECTORS 0x20 /* 0x10 8MB Smartmedia :salmoon */
#define BLOCK_SIZE (SECTOR_SIZE * BLOCK_SECTORS)
#define BLOCK_TRANS (BLOCK_SIZE + (SECTOR_ECC * BLOCK_SECTORS))
@@ -92,8 +95,8 @@ typedef enum { FTYPE_CONF = 'C',
#define CMD_SIZE 0x40
-#define OFFSET_CIS 0x20
-#define OFFSET_MBR 0x40
+#define OFFSET_CIS 0x20 /* always fixed? :salmoon */
+#define OFFSET_MBR 0x40 /* always fixed? :salmoon */
#define INFO_LINE 81
diff --git a/libmpio/io.c b/libmpio/io.c
index ebce296..778b044 100644
--- a/libmpio/io.c
+++ b/libmpio/io.c
@@ -2,7 +2,7 @@
/*
*
- * $Id: io.c,v 1.12 2002/09/15 12:03:23 germeier Exp $
+ * $Id: io.c,v 1.13 2002/09/15 23:05:25 salmoon Exp $
*
* Library for USB MPIO-*
*
@@ -54,15 +54,16 @@ BYTE
model2externalmem(mpio_model_t model)
{
BYTE m;
-
+
switch(model)
{
case MPIO_MODEL_DMG:
m = 0x80;
+ break;
default:
m = 0x10;
}
-
+
return m;
}