/******************************************************************************
*
* Copyright (C) 2007-2017  Brian Berlin
* 
* 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 3 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, see <http://www.gnu.org/licenses/>
*
******************************************************************************
*
* FILENAME: cart.h
*
* DESCRIPTION:  This contains function declartions for cart functions
*
* AUTHORS:  bberlin
*
* CHANGE LOG
*
*  VER     DATE     CHANGED BY   DESCRIPTION OF CHANGE
* ------  --------  ----------   ------------------------------------
* 0.5.0   02/05/07  bberlin      Creation
******************************************************************************/
#ifndef cart_h
#define cart_h

#include "media.h"

typedef enum {
    CART_MIN,
    CART_32K,
    CART_16K_TWO_CHIP,
    CART_16K_ONE_CHIP,
    CART_16K_BE,
    CART_32K_BE,
    CART_40K,
    CART_64K,
    CART_8K,
    CART_4K,
    CART_512K_HYBRID,
    CART_PC_8K,
    CART_PC_16K,
    CART_PC_32K,
    CART_PC_40K,
    CART_PC_RIGHT,
    CART_XEGS,
    CART_SWXEGS,
    CART_MEGA,
    CART_OSS,
    CART_OSS2,
    CART_ATMAX,
    CART_ATRAX,
    CART_WILL,
    CART_SDX,
    CART_EXP,
    CART_DIAMOND,
    CART_PHOENIX,
    CART_BLIZZARD,
    CART_CART,
    CART_FLOPPY,
    CART_CASSETTE,
    CART_EXE,
    CART_BASIC
} e_cart_type;

typedef struct {
    t_media media_info;
    int loaded;
} t_cart;

void cart_init ( void );
void cart_exit ( void );
int cart_open ( char *file, unsigned char *buffer, int size, unsigned long crc, 
                                                   e_cart_type mapping );
char * cart_get_mapping_string ( e_cart_type type, char *desc );

#endif
