Initial Agat support

This commit is contained in:
Konstantin
2025-06-04 22:51:17 +03:00
parent 58171691d0
commit de524a6561
27 changed files with 735 additions and 2 deletions

67
include/agat.h Normal file
View File

@@ -0,0 +1,67 @@
#ifndef _AGAT_H
#define _AGAT_H
/* Check for errors */
#if !defined(__AGAT__)
# error This module may only be used when compiling for the Agat!
#endif
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* Color defines */
#define COLOR_BLACK 0x00
#define COLOR_RED 0x01
#define COLOR_GREEN 0x02
#define COLOR_YELLOW 0x03
#define COLOR_BLUE 0x04
#define COLOR_MAGENTA 0x05
#define COLOR_CYAN 0x06
#define COLOR_WHITE 0x07
/* Characters codes */
#define CH_ENTER 0x0D
#define CH_ESC 0x1B
#define CH_CURS_LEFT 0x08
#define CH_CURS_RIGHT 0x15
/* Masks for joy_read */
#define JOY_UP_MASK 0x10
#define JOY_DOWN_MASK 0x20
#define JOY_LEFT_MASK 0x04
#define JOY_RIGHT_MASK 0x08
#define JOY_BTN_1_MASK 0x40
#define JOY_BTN_2_MASK 0x80
/* Return codes for get_ostype */
#define AGAT_UNKNOWN 0x00
#define AGAT_7 0x10 /* Agat 7 */
#define AGAT_9 0x20 /* Agat 9 */
/*****************************************************************************/
/* Code */
/*****************************************************************************/
unsigned char get_ostype (void);
/* Get the machine type. Returns one of the AGAT_xxx codes. */
void rebootafterexit (void);
/* Reboot machine after program termination has completed. */
/* The following #defines will cause the matching functions calls in conio.h
** to be overlaid by macros with the same names, saving the function call
** overhead.
*/
#define _bgcolor(color) COLOR_BLACK
#define _bordercolor(color) COLOR_BLACK
/* End of agat.h */
#endif //_AGAT_H