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/std/lang.h

80 lines
2.8 KiB
C

/* *****************************************************************************
* libg1m/format/std/lang.h -- the G1M language 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_STD_LANG_H
# define LIBG1M_FORMAT_STD_LANG_H
# include <libg1m.h>
# pragma pack(1)
/* ************************************************************************** */
/* G1L - Language files for fx calculators */
/* ************************************************************************** */
/* It all starts with a header: */
struct g1l_subheader {
/* identifier: is "PowerUSB" on original things */
uint8_t identifier[8];
/* OS information (raw binary format), e.g. 0x02,0x09 for 2.09. */
uint8_t os_major;
uint8_t os_minor;
/* unknown bytes */
uint8_t _unknown[2];
/* message count */
uint16_t message_count;
};
/* Then comes a list of offsets, and the messages.
*
* Each element of the offsets list is 16-bytes long.
* It is relative to the first element (which starts right after the
* offsets list - no alignment).
*
* The messages are null-terminated - once you get the offsets, you get
* them completely. */
/* ************************************************************************** */
/* G3L - Language files for Prizm */
/* ************************************************************************** */
/* G3L and G3N start with the StandardHeader and the Standard sub-Header,
* then the Prizm-specific subheader. After this, both the G3L and G3N
* have this language header: */
struct g3l_lang_header {
/* sequence: '4C 59 37 35 35 00 00 00 02' (LY755 ) */
uint8_t sequence[9];
/* unused byte. */
uint8_t unused;
/* number of messages ("possibly 0 base indexed") */
uint32_t num;
/* unused bytes */
uint8_t unused2[2];
};
/* Then we have offsets of all messages (4 bytes each),
* then messages themselves, zero-terminated.
*
* And don't forget the footer (see `libg1m/format/std.h`) */
# pragma pack()
#endif /* LIBG1M_FORMAT_STD_LANG_H */