/* ScummVM - Graphic Adventure Engine
 *
 * ScummVM is the legal property of its developers, whose names
 * are too numerous to list here. Please refer to the COPYRIGHT
 * file distributed with this source distribution.
 *
 * 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/>.
 *
 */

#ifndef MADS_CORE_MCGA_H
#define MADS_CORE_MCGA_H

#include "mads/madsv2/core/general.h"
#include "mads/madsv2/core/font.h"

namespace MADS {
namespace MADSV2 {

extern int  mcga_retrace_computed;
extern word mcga_retrace_ticks;
extern int  mcga_retrace_max_colors;
extern int  mcga_retrace_max_bytes;

extern word mcga_palette_update;
extern int  mcga_palette_fast;
extern word mcga_shakes;

/**
 * Given X and Y, sets pixel to color C
 */
extern void mcga_put_pixel(word x, word y, byte c);

/**
 * Given X and Y, gets pixel at that location
 */
extern byte mcga_get_pixel(word x, word y);

/**
 * Given home and size of window, opens it.  Returns pointer
 * to data for that window.  This pointer must be passed to
 * closewindow_mcga to be closed properly.  Data is stored
 * thus:  X(l,h),Y(l,h),XSIZE(l,h),YSIZE(l,h),<data>
 * where <data> is xsize*ysize bytes.
 */
extern byte *mcga_open_window(word x, word y, word xsize, word ysize);

/**
 * Given a pointer generated by openwindow_mcga, closes the window.
 */
extern void mcga_close_window(byte *win);

extern void mcga_setpal(Palette *pal);

extern void mcga_getpal(Palette *pal);

extern void mcga_cls(byte inp);

extern void mcga_retrace();

extern void mcga_setpal_range(Palette *pal, int first_color, int num_colors);

extern void mcga_compute_retrace_parameters();

extern void mcga_shake();

extern void mcga_reset();

} // namespace MADSV2
} // namespace MADS

#endif
