cake
/
libg1m
Archived
1
0
Fork 0

Added mcs types details, corrected storage files parsing

This commit is contained in:
Thomas Touhey 2016-12-31 12:56:14 +01:00
parent 446e256606
commit 2903f33540
2 changed files with 30 additions and 29 deletions

View File

@ -83,7 +83,7 @@ int g1m_parse_storage(g1m_t *handle, FILE *stream,
SUB(dh, directory)
log_info("[%02d,%02" PRIu16 "] Is a%s directory.", id, entry.uuid,
(special == 0x05) ? " deleted" : "n active");
(special == 0x05) ? "n active" : " deleted");
#if LOGLEVEL <= ll_info
char dirname[25]; rawfctombs(dh->name, 12, dirname);
log_info("- Directory name: %s", dirname);
@ -92,7 +92,7 @@ int g1m_parse_storage(g1m_t *handle, FILE *stream,
SUB(fh, file)
log_info("[%02d,%02" PRIu16 "] Is a%s file.", id, entry.uuid,
(special == 0x05) ? " deleted" : "n active");
(special == 0x05) ? "n active" : " deleted");
#if LOGLEVEL <= ll_info
char filename[25]; rawfctombs(fh->name, 12, filename);
log_info("- File name: %s", filename);

View File

@ -25,7 +25,7 @@ struct type_corresp {
unsigned int flags;
/* information for logging and re-constituting information */
char *dirname;
const char *dirname;
const char *info;
/* libg1m type */
@ -53,33 +53,22 @@ struct group_corresp {
* - 0xfe is more or less the generic type ID for "data".
* - I skipped the 'LISTFILE %d' groups are they are more or less duplicates
* of normal lists.
*/
* - Types with a directory name starting with '@' are app-specific files, with
* the dirname being the internal name of the related application. */
#define TTERM {0, NULL, 0, NULL, NULL, 0}
static struct group_corresp mcs_groups[] = {
/* Main Memory */
{"SETUP", noarg, (struct type_corresp[]){
{0x14, NULL, 0, "$GLOBAL",
{0x14, NULL /* "SETUP" */, 0, "$GLOBAL",
"setup", g1m_mcstype_setup},
{0x00, NULL, 0, "$GLOBAL",
"alpha memory", g1m_mcstype_alphamem},
TTERM
}},
{"ALPHA MEM", noarg, (struct type_corresp[]){
{0x00, NULL, 0, "$GLOBAL",
{0x00, NULL /* "ALPHA MEM" */, 0, "$GLOBAL",
"alpha memory", g1m_mcstype_alphamem},
TTERM
}},
{"CAPT ", arg | arg_is_num, (struct type_corresp[]){
{0x0A, "CAPT", arg | arg_is_num, "@REV2",
"capture", g1m_mcstype_capt},
TTERM
}},
{"PICTURE ", arg | arg_is_num, (struct type_corresp[]){
{0x07, "PICT", arg | arg_is_num, "main",
"picture", g1m_mcstype_pict},
TTERM
}},
{"STRING ", arg | arg_is_num, (struct type_corresp[]){
{0x04, "STR", arg | arg_is_num, "main",
"string", g1m_mcstype_string},
@ -111,9 +100,9 @@ static struct group_corresp mcs_groups[] = {
TTERM
}},
{"Y=DATA", noarg, (struct type_corresp[]){
{0x02, NULL, 0, "main",
{0x02, NULL /* e.g. "1" */, 0, "main",
"unknown", 0x00},
{0x05, NULL, 0, "main",
{0x05, NULL /* "VWIN" */, 0, "main",
"unknown", 0x00},
TTERM
}},
@ -122,12 +111,24 @@ static struct group_corresp mcs_groups[] = {
"unknown", 0x00},
TTERM
}},
{"PICTURE ", arg | arg_is_num, (struct type_corresp[]){
{0x07, "PICT", arg | arg_is_num, "main",
"picture", g1m_mcstype_pict},
TTERM
}},
/* more or less main memory */
{"CAPT ", arg | arg_is_num, (struct type_corresp[]){
{0x0A, "CAPT", arg | arg_is_num, "@REV2",
"capture", g1m_mcstype_capt},
TTERM
}},
/* application-specific data */
{"SYSTEM", noarg, (struct type_corresp[]){
{0xFE, NULL, 0, "@RUNMAT",
{0xFE, NULL /* REPLAY/RUN2D1 */, 0, "@RUNMAT",
"replay", 0x00},
{0x0A, NULL, 0, "@REV2",
{0x0A, NULL /* CLIP/NAT_CLIP */, 0, "@REV2",
"clip", 0x00},
TTERM
}},
@ -137,39 +138,39 @@ static struct group_corresp mcs_groups[] = {
TTERM
}},
{"CONICS", noarg, (struct type_corresp[]){
{0xFE, NULL, 0, "@CONICS",
{0xFE, NULL /* "conicmem" */, 0, "@CONICS",
"conics data", 0x00},
TTERM
}},
{"DYNA MEM", noarg, (struct type_corresp[]){
{0xFE, NULL, 0, "@DYNA",
{0xFE, NULL /* "COND" */, 0, "@DYNA",
"dyna data", 0x00},
TTERM
}},
{"Econ3Now", noarg, (struct type_corresp[]){
{0xFE, NULL, 0, "@E-CON2",
{0xFE, NULL /* "Econ3Now" */, 0, "@E-CON2",
"econ3 data", 0x00},
TTERM
}},
{"FINANCIAL", noarg, (struct type_corresp[]){
{0xFE, NULL, 0, "@FINANCE",
{0xFE, NULL /* "fina_mem" */, 0, "@FINANCE",
"financial data", 0x00},
TTERM
}},
{"RECURSION", noarg, (struct type_corresp[]){
{0xFE, NULL, 0, "@RECUR",
{0xFE, NULL /* "RECRG" */, 0, "@RECUR",
"recursion data", 0x00},
TTERM
}},
{"STAT", noarg, (struct type_corresp[]){
{0xFE, NULL, 0, "@STAT",
{0xFE, NULL /* G_CND/C_CND/STATap/G_CNDEX/STATapX */, 0, "@STAT",
"stat data", 0x00},
{0x05, "STATV", arg | arg_is_num, "main",
"stat data 2?", 0x00},
TTERM
}},
{"TABLE", noarg, (struct type_corresp[]){
{0xFE, NULL, 0, "@TABLE",
{0xFE, NULL /* RANGE */, 0, "@TABLE",
"range data?", 0x00},
TTERM
}},