cake
/
libg1m
Archived
1
0
Fork 0

Corrected mistake.

This commit is contained in:
Thomas Touhey 2016-12-28 20:55:07 +01:00
parent d79c8fac6a
commit a11dc9e42b
7 changed files with 22 additions and 21 deletions

View File

@ -166,7 +166,8 @@ typedef enum {
g1m_type_eact = 0x04,
g1m_type_pict = 0x08,
g1m_type_lang = 0x10,
g1m_type_fkey = 0x20
g1m_type_fkey = 0x20,
g1m_type_storage = 0x40
} g1m_type_t;
/* platform */
@ -174,9 +175,7 @@ typedef enum {
g1m_platform_none = 0x00,
g1m_platform_fx = 0x01,
g1m_platform_cp = 0x02,
g1m_platform_cg = 0x04,
g1m_platform_fx_raw = 0x08
g1m_platform_cg = 0x04
} g1m_platform_t;
/* handle */

View File

@ -82,7 +82,7 @@ struct standard_header {
# include <libg1m/format/addin.h>
# include <libg1m/format/eact.h>
# include <libg1m/format/mcs.h>
# include <libg1m/format/mcsraw.h>
# include <libg1m/format/storage.h>
# include <libg1m/format/picture.h>
# include <libg1m/format/lang.h>
# include <libg1m/format/fkey.h>

View File

@ -1,16 +1,16 @@
/* ************************************************************************** */
/* _____ _ */
/* libg1m/format/mcsraw.h |_ _|__ _ _| |__ ___ _ _ */
/* libg1m/format/storage.h |_ _|__ _ _| |__ ___ _ _ */
/* | Project: libg1m | |/ _ \| | | | '_ \ / _ \ | | | */
/* | | (_) | |_| | | | | __/ |_| | */
/* By: thomas <thomas@touhey.fr> |_|\___/ \__,_|_| |_|\___|\__, |.fr */
/* Last updated: 2016/12/25 13:39:13 |___/ */
/* */
/* ************************************************************************** */
#ifndef LIBG1M_FORMAT_MCSRAW_H
# define LIBG1M_FORMAT_MCSRAW_H
#ifndef LIBG1M_FORMAT_STORAGE_H
# define LIBG1M_FORMAT_STORAGE_H
/* Raw MCS files (G1S) contain backups of the raw MCS.
/* Storage files (G1S) contain backups of the storage memory.
*
* According to Simon Lothar, the files contain zeroes up to 0x00270000
* (the location of the MCS in real fx-9860 calculators), then it has the
@ -20,4 +20,4 @@
* The structure has been documented by Simon Lothar, but I haven't
* worked on it yet: TODO. */
#endif /* LIBG1M_FORMAT_MCSRAW_H */
#endif /* LIBG1M_FORMAT_STORAGE_H */

View File

@ -77,8 +77,6 @@ int g1m_parse_c2p(g1m_t *handle, FILE *stream,
struct standard_header *std);
int g1m_parse_mcs(g1m_t *handle, FILE *stream,
struct standard_header *std);
int g1m_parse_mcsraw(g1m_t *handle, FILE *stream,
struct standard_header *std);
int g1m_parse_eact(g1m_t * handle, FILE *stream,
struct standard_header *std);
int g1m_parse_addin(g1m_t *handle, FILE *stream,
@ -91,6 +89,8 @@ int g1m_parse_lang_cg(g1m_t *handle, FILE *stream,
struct standard_header *std);
int g1m_parse_fkey(g1m_t *handle, FILE *stream,
struct standard_header *std);
int g1m_parse_storage(g1m_t *handle, FILE *stream,
struct standard_header *std);
/* others */
int g1m_parse_fkey_cg_content(g1m_t *handle, FILE *stream,

View File

@ -34,8 +34,6 @@ static struct corresp parsing_functions[] = {
g1m_parse_mcs},
{g1m_platform_cg, g1m_type_mcs,
g1m_parse_mcs},
{g1m_platform_fx_raw, g1m_type_mcs,
g1m_parse_mcsraw},
/* language files */
{g1m_platform_fx, g1m_type_lang,
@ -59,6 +57,10 @@ static struct corresp parsing_functions[] = {
{g1m_platform_cp, g1m_type_pict,
g1m_parse_c2p},
/* storage */
{g1m_platform_none, g1m_type_storage,
g1m_parse_storage},
{0, 0, NULL}
};

View File

@ -1,6 +1,6 @@
/* ************************************************************************** */
/* _____ _ */
/* parse/mcsraw.c |_ _|__ _ _| |__ ___ _ _ */
/* parse/storage.c |_ _|__ _ _| |__ ___ _ _ */
/* | Project: libg1m | |/ _ \| | | | '_ \ / _ \ | | | */
/* | | (_) | |_| | | | | __/ |_| | */
/* By: thomas <thomas@touhey.fr> |_|\___/ \__,_|_| |_|\___|\__, |.fr */
@ -10,8 +10,8 @@
#include <libg1m/internals.h>
/**
* g1m_parse_mcsraw:
* Parse archives.
* g1m_parse_storage:
* Parse storage files.
*
* @arg handle the libg1m handle.
* @arg stream the stream to read from.
@ -19,7 +19,7 @@
* @return the error code (0 if ok).
*/
int g1m_parse_mcsraw(g1m_t *handle, FILE *stream,
int g1m_parse_storage(g1m_t *handle, FILE *stream,
struct standard_header *std)
{
(void)std;
@ -27,8 +27,8 @@ int g1m_parse_mcsraw(g1m_t *handle, FILE *stream,
SKIP(0x270000 - sizeof(struct standard_header))
/* then read and stuff... not yet. */
log_error("Raw MCS archives are not managed yet.");
(void)handle;
log_error("Storage files are not managed yet.");
handle->type = 0x00;
/* no error */
return (0);

View File

@ -121,7 +121,7 @@ struct ext_corresp {
/* Extension correspondances */
static struct ext_corresp ext_types[] = {
/* raw MCS */
{"g1s", "Raw Bfile backup", g1m_platform_fx_raw, g1m_type_mcs},
{"g1s", "Storage file", g1m_platform_none, g1m_type_storage},
/* fx types with non-checked header */
{"g1l", "fx language file", g1m_platform_fx, g1m_type_lang},