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/fkey.h

69 lines
2.9 KiB
C

/* *****************************************************************************
* libg1m/format/fkey.h -- the G1M function keys file 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_FKEY_H
# define LIBG1M_FORMAT_FKEY_H
# include <libg1m.h>
# pragma pack(1)
/* Function keys are the little boxes at the bottom with text in it, to tell
* you what you're going to access if you press F1-F6. */
/* ************************************************************************** */
/* G1N - Function-keys files for fx calculators */
/* ************************************************************************** */
/* In G1Ns, function keys are 19x8 1-bit with fill bits images.
*
* TODO: it is unknown yet how to identify G1N files, as no non-community-made
* one of them was found and the calculator software just skips
* StandardHeader. It has to be found for a correct integration in libg1m!
*
* The format looks a lot like G1L files. The header is the following: */
# define FKEY_WIDTH 24
# define FKEY_HEIGHT 8
struct g1n_subheader {
/* usually "PowerUSB" */
uint8_t identifier[8];
/* useless data */
uint8_t _useless[4];
/* number of icons */
uint16_t fkey_count;
};
/* Then there is a table of 16-bits offsets (iconXXX - icon0), then the icons.
* The first "icon" is in fact the name of the language. */
/* ************************************************************************** */
/* G3L-N - Function-keys files for CG calculators */
/* ************************************************************************** */
/* G3L-N have exactly the same header and subheader as G3Ls, except
* the magic field is "0201" and not "0401" like for "normal" G3Ls.
*
* TODO: it is unknown yet how to identify G3N files using the StandardHeader,
* as no non-community-made one of them was found and the calculator software
* just skips StandardHeader. It has to be found for a correct integration
* in libg1m!
*
* In G3L-Ns, function keys are 64x24 1-bit images. */
# define FKEY3_WIDTH 64
# define FKEY3_HEIGHT 24
# pragma pack()
#endif /* LIBG1M_FORMAT_FKEY_H */