114 lines
3.4 KiB
C
114 lines
3.4 KiB
C
/* *****************************************************************************
|
|
* libg1m/format/std/addin.h -- the G1M add-in 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_ADDIN_H
|
|
# define LIBG1M_FORMAT_STD_ADDIN_H
|
|
# include <stdint.h>
|
|
# pragma pack(1)
|
|
|
|
/* Add-ins are compiled programs. They only have one G1M part,
|
|
* These add-ins usually have the `g1a`, `g3a` or `c1a` extension. */
|
|
/* ************************************************************************** */
|
|
/* Legacy fx systems add-ins (G1A) */
|
|
/* ************************************************************************** */
|
|
/* G1A subheader is the following: */
|
|
|
|
# define G1A_ICON_WIDTH 30
|
|
# define G1A_ICON_HEIGHT 17
|
|
struct g1a_subheader {
|
|
/* the internal name, of format "@APPNAME".
|
|
* useful for add-ins calling themselves... I guess? */
|
|
uint8_t internal_name[8];
|
|
|
|
/* spacing */
|
|
uint8_t _spacing[3];
|
|
|
|
/* the number of estrips (I don't know yet) */
|
|
uint8_t estrips_count;
|
|
|
|
/* spacing */
|
|
uint8_t _spacing2[4];
|
|
|
|
/* the add-in version, of format "01.23.4567"
|
|
* the "01.23" will be displayed in SYSTEM > VERSION */
|
|
uint8_t version[10];
|
|
|
|
/* spacing */
|
|
uint8_t _spacing3[2];
|
|
|
|
/* the add-in creation type, of format "YYYY.MMDD.HHMM" */
|
|
uint8_t creation_date[14];
|
|
|
|
/* spacing */
|
|
uint8_t _spacing4[2];
|
|
|
|
/* 30x17 pixel menu icon bitmap */
|
|
uint8_t icon[68];
|
|
|
|
/* spacing */
|
|
uint8_t _spacing5[0x144];
|
|
|
|
/* program title */
|
|
uint8_t title[8];
|
|
|
|
/* spacing */
|
|
uint8_t _spacing6[0x14];
|
|
|
|
/* and the filesize of the part! */
|
|
uint32_t filesize;
|
|
|
|
/* spacing */
|
|
uint8_t _spacing7[0xc];
|
|
};
|
|
|
|
/* Then the G1A file will just contain the add-in code and stop. */
|
|
/* ************************************************************************** */
|
|
/* Classpad and Prizm add-ins (C1A, G3A) */
|
|
/* ************************************************************************** */
|
|
/* The two formats both have the Standard Subheader, then, for the C1A,
|
|
* the Classpad-specific subheader, and for the G3A, the Prizm-specific
|
|
* subheader.
|
|
*
|
|
* After this, the G3A subheader looks like this: */
|
|
|
|
# define G3A_ICON_WIDTH 92
|
|
# define G3A_ICON_HEIGHT 64
|
|
struct g3a_subheader {
|
|
/* selected and unselected icon image */
|
|
uint8_t selected_icon_image[0x3000];
|
|
uint8_t unselected_icon_image[0x3000];
|
|
};
|
|
|
|
/* And the C1A subheader goes like this: */
|
|
|
|
# define C1A_ICON_WIDTH 46
|
|
# define C1A_ICON_HEIGHT 30
|
|
struct c1a_subheader {
|
|
/* unknown bytes */
|
|
uint8_t _unknown2[0x2C];
|
|
|
|
/* this is an approximation (46x30 pixels, packed 1-bit) */
|
|
uint8_t icon[172];
|
|
|
|
/* unknown */
|
|
uint8_t _unknown3[0xC54];
|
|
};
|
|
|
|
# pragma pack()
|
|
#endif /* LIBG1M_FORMAT_STD_ADDIN_H */
|