cake
/
libg1m
Archived
1
0
Fork 0
This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
libg1m/include/libg1m/format.h

67 lines
3.3 KiB
C

/* *****************************************************************************
* libg1m/format.h -- the G1M format description.
* Copyright (C) 2017 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
*
* This file is part of libg1m.
* libg1m is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3.0 of the License,
* or (at your option) any later version.
*
* libg1m is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with libg1m; if not, see <http://www.gnu.org/licenses/>.
* ************************************************************************** */
#ifndef LIBG1M_FORMAT_H
# define LIBG1M_FORMAT_H
# include <stdint.h>
/* Welcome on this new episode of the Monster Circus show! Today we'll present
* to you the different formats surrounding CASIO calculators: open or closed,
* legacy or legacy, obfuscated or not, I hope you'll enjoy them as much
* as I don't! */
/* ************************************************************************** */
/* The CASIOLINK (CAS) format */
/* ************************************************************************** */
/* This is the basic file format that CASIO used until around 2004, when the
* fx-9860G (Graph 85) came out. It is linked with the legacy protocol, which
* cannot be implemented with a good management of this format.
*
* All of the useful structures and constants are in the specific header.
* The function to get the libg1m MCS type out of the string types is in
* `libg1m/formatutils.h`. */
# include <libg1m/format/cas.h>
/* ************************************************************************** */
/* The FXI format */
/* ************************************************************************** */
/* fx-Interface, an old but well done proprietary interface by CASIO, has its
* own format: the FXI format. It's an obfuscated format (althrough the
* obfuscation algorithm has been found).
*
* It starts with the following obfuscated string: */
# define FXI_OBF_MAGIC "\x32\x30" "\xF8\xA1"
# define FXI_DEC_MAGIC "\xD5\xD7" "\x1F\x46" "FX-INTERFACE - YELLOW COMPUTING"
/* Followed by loads of zero, then, the content. The description of the rest
* of the format is described in this header: */
//# include <libg1m/format/fxi.h>
/* ************************************************************************** */
/* The G1M/STD format */
/* ************************************************************************** */
/* Since around 2004, CASIO has adopted a single "superformat"; we call it
* CASIO's standard format, or the G1M format (it doesn't really have a
* *public* name, other than its magics, like USBPower or CASIO).
*
* It doesn't have a single magic string, but a few. But the standard header
* has the same format, so we consider it as the same format. */
# include <libg1m/format/std.h>
#endif /* LIBG1M_FORMAT_H */