/*****************************************************************************/ /* */ /* ec65k.h */ /* */ /* EC-65K system specific definitions */ /* */ /* */ /* */ /* (C) 2009 Michiel Broek, */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ /* warranty. In no event will the authors be held liable for any damages */ /* arising from the use of this software. */ /* */ /* Permission is granted to anyone to use this software for any purpose, */ /* including commercial applications, and to alter it and redistribute it */ /* freely, subject to the following restrictions: */ /* */ /* 1. The origin of this software must not be misrepresented; you must not */ /* claim that you wrote the original software. If you use this software */ /* in a product, an acknowledgment in the product documentation would be */ /* appreciated but is not required. */ /* 2. Altered source versions must be plainly marked as such, and must not */ /* be misrepresented as being the original software. */ /* 3. This notice may not be removed or altered from any source */ /* distribution. */ /* */ /*****************************************************************************/ #ifndef _EC65K_H #define _EC65K_H /* Check for errors */ #if !defined(__EC65K__) # error This module may only be used when compiling for the EC-65K! #endif /*****************************************************************************/ /* Data */ /*****************************************************************************/ /* Additional key defines, values after byte */ #define CH_F1 0x3B #define CH_F2 0x3C #define CH_F3 0x3D #define CH_F4 0x3E #define CH_F5 0x3F #define CH_F6 0x40 #define CH_F7 0x41 #define CH_F8 0x42 #define CH_F9 0x43 #define CH_F10 0x44 #define CH_PGUP 0x49 #define CH_PGDN 0x51 #define CH_END 0x4F #define CH_HOME 0x47 #define CH_INS 0x52 /* Keys without */ #define CH_UP 0x0B #define CH_LEFT 0x08 #define CH_DOWN 0x0A #define CH_RIGHT 0x09 /* Color Defines */ #define COLOR_BLACK 0x00 #define COLOR_BLUE 0x01 #define COLOR_GREEN 0x02 #define COLOR_CYAN 0x03 #define COLOR_RED 0x04 #define COLOR_MAGENTA 0x05 #define COLOR_BROWN 0x06 #define COLOR_GRAY 0x07 #define COLOR_DARKGRAY 0x08 #define COLOR_LIGHTBLUE 0x09 #define COLOR_LIGHTGREEN 0x0a #define COLOR_LIGHTCYAN 0x0b #define COLOR_LIGHTRED 0x0c #define COLOR_LIGHTMAGENTA 0x0d #define COLOR_YELLOW 0x0e #define COLOR_WHITE 0x0f /* Characters codes */ #define CH_ENTER 0x0D #define CH_ESC 0x1B #define CH_DEL 0x7E /* back space (delete char to the left) */ /* Valid for charset 4, IBM chars */ #define CH_ULCORNER 0xDA #define CH_URCORNER 0xBF #define CH_LLCORNER 0xC0 #define CH_LRCORNER 0xD9 #define CH_TTEE 0xC2 #define CH_BTEE 0xC1 #define CH_LTEE 0xC3 #define CH_RTEE 0xB4 #define CH_CROSS 0xC5 /*****************************************************************************/ /* Code */ /*****************************************************************************/ /* * Define a structure with the pia register offsets. * * Note: in _pia.h these are defined but wrong, maybe that one is based * on swappped address lines. So we define the structure here but do it * a bit different so that it won't conflict if by accident _pia.h also * is included. */ struct __mc6821 { unsigned char DRA; /* port A data r/w */ unsigned char CRA; /* port A control */ unsigned char DRB; /* port B data r/w */ unsigned char CRB; /* port B control */ }; unsigned char get_ostype (void); /* Get the machine type. Returns one of the OS codes. */ #include <_6545.h> #define CRTC (*(struct __6545*)0xE140) /* 6845 CRT controller */ #define KBDPIA (*(struct __mc6821*)0xE400) /* Keyboard PIA */ #include <_6551.h> #define ACIA (*(struct __6551*)0xE410) /* ACIA port */ #define PRTPIA (*(struct __mc6821*)0xE420) /* Centronics port PIA */ #define MOSIP1 (*(struct __mc6821*)0xE118) /* MOSI IO PIA 1 */ #define MOSIP2 (*(struct __mc6821*)0xE11C) /* MOSI IO PIA 2 */ #define MOSIP3 (*(struct __mc6821*)0xE110) /* MOSI IO PIA 3 */ #define MOSIP4 (*(struct __mc6821*)0xE114) /* MOSI IO PIA 4 */ /* End of ec65k.h */ #endif