Files
nunuhara_xsystem4/pms.h
T
Nunuhara Cabbage d3de009e1d Import CG reading code from xsystem35
Plus a bit of SACT2 implementation, and fix a bug where global arrays
were not initialized properly.
2019-11-15 19:01:08 -08:00

71 lines
2.4 KiB
C

/*
* pms.h extract 8/16 bit PMS cg
*
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
* 1998- <masaki-c@is.aist-nara.ac.jp>
* 2019 Nunuhara Cabbage <nunuhara@haniwa.technology>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @version 1.1 00/09/17 rewrite for changeing interface
*/
#ifndef SYSTEM4_PMS_H
#define SYSTEM4_PMS_H
#include <stdbool.h>
#include <stdint.h>
#include "cg.h"
struct pms_header {
int pmsVer; // pms data version
int pmsHdrSize; // size of header
int pmsBpp; // pms data depth, 8 or 16
int pmsBppS; // shadow data depth, if exists
int pmsSf; // sprite flag (not used?)
int pmsBf; // pallet bank
int pmsX0; // display location x
int pmsY0; // display location y
int pmsXW; // image width
int pmsYW; // image height
int pmsDp; // pointer to data
int pmsPp; // pointer to pallet or shadow
int pmsCp; // pointer to comment
};
/*
* pmsBppS
* If pmsBpp is 16 and pmsPp is not 0, shadow (alpha data) is exists and
* pmsBppS shows shadow's depth (normally 8).
*
* pmsBf
* If pmsBpp is 8, pmsBf determine which pallets is used in this data and
* needed to copy. The pmsBf is mask and if bit is on then copy.
* For example, if pmsBf=0xff00, then copy pal[128] ~ pal[255].
*
* pmsPp
* If pmsBpp is 8 then this is pointer to pallet. If pmsBpp is 16 and
* pmsPp is not 0, then shadow is exists and this is pointer to it's data.
*
*/
bool pms256_checkfmt(uint8_t *data);
struct cg *pms256_extract(uint8_t *data);
bool pms64k_checkfmt(uint8_t *data);
struct cg *pms64k_extract(uint8_t *data);
struct cg *pms_getpal(uint8_t *data);
#endif /* SYSTEM4_PMS_H */