/******************************************************************************
*
* Copyright (C) 2004-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: kat5200.h
*
* DESCRIPTION:  This contains console struct and functions used in main
*
* AUTHORS:  bberlin
*
* CHANGE LOG
*
*  VER     DATE     CHANGED BY   DESCRIPTION OF CHANGE
* ------  --------  ----------   ------------------------------------
* 0.1     07/18/04  bberlin      Creation
* 0.2     12/09/04  bberlin      Added 4K cart, mapping parameter
* 0.5.0   09/01/06  bberlin      Added video_group,sound_group to 'cart_5200'
* 0.7.0   02/07/17  bberlin      Added LAST_VERSION to help with config 
*                                    locations
******************************************************************************/
#ifndef kat5200_h
#define kat5200_h

#include "core/console.h"

#define KSTATUS_DEBUG 0x1
#define KSTATUS_GUI 0x2
#define KSTATUS_RUN 0x4
#define KSTATUS_INPUT 0x8
#define KSTATUS_LAUNCH 0x10
#define KSTATUS_EXIT 0x20
#define KSTATUS_BACK 0x40
#define KSTATUS_LAUNCH_NO_RST 0x80

#define NTSC_SCREEN_TIME  29773
#define NTSC_V_BLANK_TIME 22*114
#define NTSC_SCAN_LINES   240

#define VERSION "1.0.2"
#define LAST_VERSION "0.9.1"

int run_system ( void );
void run_frame(void);
int load_os ( char *filename, e_machine_type type );
int kat5200_launch( unsigned int kstatus );
void kat5200_set_status(unsigned int status);
unsigned int kat5200_get_status(void);
void kat5200_exit( void );

#endif
