/***************************************************************************************1* Genesis Plus2* I/O controller3*4* Support for Master System (315-5216, 315-5237 & 315-5297), Game Gear & Mega Drive I/O chips5*6* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald (original code)7* Copyright (C) 2007-2013 Eke-Eke (Genesis Plus GX)8*9* Redistribution and use of this code or any derivative works are permitted10* provided that the following conditions are met:11*12* - Redistributions may not be sold, nor may they be used in a commercial13* product or activity.14*15* - Redistributions that are modified from the original source must include the16* complete source code, including the source code for all components used by a17* binary built from the modified sources. However, as a special exception, the18* source code distributed need not include anything that is normally distributed19* (in either source or binary form) with the major components (compiler, kernel,20* and so on) of the operating system on which the executable runs, unless that21* component itself accompanies the executable.22*23* - Redistributions must reproduce the above copyright notice, this list of24* conditions and the following disclaimer in the documentation and/or other25* materials provided with the distribution.26*27* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"28* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE29* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE30* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE31* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR32* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF33* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS34* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN35* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)36* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE37* POSSIBILITY OF SUCH DAMAGE.38*39****************************************************************************************/4041#ifndef _IO_CTRL_H_42#define _IO_CTRL_H_4344#define IO_RESET_HI 0x1045#define IO_CONT1_HI 0x204647#define REGION_JAPAN_NTSC 0x0048#define REGION_JAPAN_PAL 0x4049#define REGION_USA 0x8050#define REGION_EUROPE 0xC05152/* Global variables */53extern uint8 io_reg[0x10];54extern uint8 region_code;5556/* Function prototypes */57extern void io_init(void);58extern void io_reset(void);59extern void io_68k_write(unsigned int offset, unsigned int data);60extern unsigned int io_68k_read(unsigned int offset);61extern void io_z80_write(unsigned int offset, unsigned int data, unsigned int cycles);62extern unsigned int io_z80_read(unsigned int offset);63extern void io_gg_write(unsigned int offset, unsigned int data);64extern unsigned int io_gg_read(unsigned int offset);6566#endif /* _IO_CTRL_H_ */67686970