|
|
1.1 ! root 1: /* fossdefs.h */ ! 2: ! 3: /* FOSSIL (FSC-15) structure and constant definitions */ ! 4: ! 5: /* $Id: fossdefs.h,v 1.2 2006/05/10 03:21:28 rswindell Exp $ */ ! 6: ! 7: /**************************************************************************** ! 8: * @format.tab-size 4 (Plain Text/Source Code File Header) * ! 9: * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * ! 10: * * ! 11: * Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html * ! 12: * * ! 13: * This program is free software; you can redistribute it and/or * ! 14: * modify it under the terms of the GNU General Public License * ! 15: * as published by the Free Software Foundation; either version 2 * ! 16: * of the License, or (at your option) any later version. * ! 17: * See the GNU General Public License for more details: gpl.txt or * ! 18: * http://www.fsf.org/copyleft/gpl.html * ! 19: * * ! 20: * Anonymous FTP access to the most recent released source is available at * ! 21: * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * ! 22: * * ! 23: * Anonymous CVS access to the development source and modification history * ! 24: * is available at cvs.synchro.net:/cvsroot/sbbs, example: * ! 25: * cvs -d :pserver:[email protected]:/cvsroot/sbbs login * ! 26: * (just hit return, no password is necessary) * ! 27: * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src * ! 28: * * ! 29: * For Synchronet coding style and modification guidelines, see * ! 30: * http://www.synchro.net/source.html * ! 31: * * ! 32: * You are encouraged to submit any modifications (preferably in Unix diff * ! 33: * format) via e-mail to [email protected] * ! 34: * * ! 35: * Note: If this box doesn't appear square, then you need to fix your tabs. * ! 36: ****************************************************************************/ ! 37: ! 38: #ifndef _FOSSDEFS_H ! 39: #define _FOSSDEFS_H ! 40: ! 41: #include <gen_defs.h> ! 42: ! 43: #define FOSSIL_REVISION 5 /* the latest and greatest (and last?) */ ! 44: #define FOSSIL_INTERRUPT 0x14 /* x86 interrupt 14h */ ! 45: #define FOSSIL_SIGNATURE 0x1954 /* magic number */ ! 46: ! 47: /* FOSSIL functions (in AH) */ ! 48: #define FOSSIL_FUNC_SET_RATE 0x00 ! 49: #define FOSSIL_FUNC_PUT_CHAR 0x01 /* transmit with wait */ ! 50: #define FOSSIL_FUNC_GET_CHAR 0x02 /* receive char, with wait */ ! 51: #define FOSSIL_FUNC_GET_STATUS 0x03 ! 52: #define FOSSIL_FUNC_INIT 0x04 ! 53: #define FOSSIL_FUNC_UNINIT 0x05 ! 54: #define FOSSIL_FUNC_DTR 0x06 ! 55: #define FOSSIL_FUNC_GET_TIMER 0x07 ! 56: #define FOSSIL_FUNC_FLUSH_OUT 0x08 ! 57: #define FOSSIL_FUNC_PURGE_OUT 0x09 ! 58: #define FOSSIL_FUNC_PURGE_IN 0x0a ! 59: #define FOSSIL_FUNC_WRITE_CHAR 0x0b /* transmit no wait */ ! 60: #define FOSSIL_FUNC_PEEK 0x0c /* non-destructive read ahead */ ! 61: #define FOSSIL_FUNC_GET_KB 0x0d /* keyboard read no wait */ ! 62: #define FOSSIL_FUNC_GET_KB_WAIT 0x0e /* keyboard read with wait */ ! 63: #define FOSSIL_FUNC_FLOW_CTRL 0x0f /* enable/disable flow control */ ! 64: #define FOSSIL_FUNC_CTRL_C 0x10 /* Ctrl-C/K checking */ ! 65: #define FOSSIL_FUNC_SET_CURSOR 0x11 ! 66: #define FOSSIL_FUNC_GET_CURSOR 0x12 ! 67: #define FOSSIL_FUNC_ANSI_PRINT 0x13 ! 68: #define FOSSIL_FUNC_WATCHDOG 0x14 /* enable/disable watchdog processing */ ! 69: #define FOSSIL_FUNC_BIOS_PRINT 0x15 ! 70: #define FOSSIL_FUNC_TIMER_CHAIN 0x16 /* insert/deleted timer callbacks */ ! 71: #define FOSSIL_FUNC_REBOOT 0x17 ! 72: #define FOSSIL_FUNC_READ_BLOCK 0x18 /* read block, no wait */ ! 73: #define FOSSIL_FUNC_WRITE_BLOCK 0x19 /* write block, no wait */ ! 74: #define FOSSIL_FUNC_BREAK 0x1a ! 75: #define FOSSIL_FUNC_GET_INFO 0x1b ! 76: ! 77: #define FOSSIL_FUNC_HIGHEST FOSSIL_FUNC_GET_INFO ! 78: ! 79: #define FOSSIL_BAUD_RATE_SHIFT 5 ! 80: #define FOSSIL_BAUD_RATE_MASK 0xe0 /* 11100000 */ ! 81: #define FOSSIL_BAUD_RATE_300 0x40 /* 010xxxxx */ ! 82: #define FOSSIL_BAUD_RATE_600 0x60 /* 011xxxxx */ ! 83: #define FOSSIL_BAUD_RATE_1200 0x80 /* 100xxxxx */ ! 84: #define FOSSIL_BAUD_RATE_2400 0xa0 /* 101xxxxx */ ! 85: #define FOSSIL_BAUD_RATE_4800 0xc0 /* 110xxxxx */ ! 86: #define FOSSIL_BAUD_RATE_9600 0xe0 /* 111xxxxx */ ! 87: #define FOSSIL_BAUD_RATE_19200 0x00 /* 000xxxxx - replaces old 110 baud */ ! 88: #define FOSSIL_BAUD_RATE_38400 0x20 /* 001xxxxx - replaces old 150 baud */ ! 89: ! 90: unsigned fossil_baud_rate[] = { ! 91: 19200 ! 92: ,38400 ! 93: ,300 ! 94: ,600 ! 95: ,1200 ! 96: ,2400 ! 97: ,4800 ! 98: ,9600 ! 99: }; ! 100: ! 101: #define FOSSIL_PARITY_SHIFT 3 ! 102: #define FOSSIL_PARITY_MASK 0x18 /* 00011000 */ ! 103: #define FOSSIL_PARITY_NONE 0x00 /* xxx00xxx (and xxx10xxx) */ ! 104: #define FOSSIL_PARITY_ODD 0x08 /* xxx01xxx */ ! 105: #define FOSSIL_PARITY_EVEN 0x18 /* xxx11xxx */ ! 106: ! 107: char fossil_parity[] = { 'N', 'O', 'N', 'E' }; ! 108: ! 109: #define FOSSIL_STOP_BITS_SHIFT 2 ! 110: #define FOSSIL_STOP_BITS_MASK 0x04 /* 00000100 */ ! 111: #define FOSSIL_STOP_BITS_1 0x00 /* xxxxx0xx */ ! 112: #define FOSSIL_STOP_BITS_2 0x04 /* xxxxx1xx */ ! 113: ! 114: unsigned fossil_stop_bits[] = { 1, 2 }; ! 115: ! 116: #define FOSSIL_DATA_BITS_SHIFT 0 ! 117: #define FOSSIL_DATA_BITS_MASK 0x03 /* 00000011 */ ! 118: #define FOSSIL_DATA_BITS_5 0x00 /* xxxxxx00 */ ! 119: #define FOSSIL_DATA_BITS_6 0x01 /* xxxxxx01 */ ! 120: #define FOSSIL_DATA_BITS_7 0x02 /* xxxxxx10 */ ! 121: #define FOSSIL_DATA_BITS_8 0x03 /* xxxxxx11 */ ! 122: ! 123: unsigned fossil_data_bits[] = { 5, 6, 7, 8 }; ! 124: ! 125: #if defined(__GNUC__) ! 126: #define PACKED_STRUCT __attribute__((packed)) ! 127: #else /* non-GCC compiler */ ! 128: #pragma pack(push) ! 129: #pragma pack(1) ! 130: #define PACKED_STRUCT ! 131: #endif ! 132: ! 133: typedef struct { ! 134: WORD info_size; ! 135: BYTE curr_fossil; ! 136: BYTE curr_rev; ! 137: DWORD id_string; ! 138: WORD inbuf_size; ! 139: WORD inbuf_free; ! 140: WORD outbuf_size; ! 141: WORD outbuf_free; ! 142: BYTE screen_width; ! 143: BYTE screen_height; ! 144: BYTE baud_rate; ! 145: } PACKED_STRUCT fossil_info_t; ! 146: ! 147: #if !defined(__GNUC__) ! 148: #pragma pack(pop) /* original packing */ ! 149: #endif ! 150: ! 151: #endif /* Don't add anything after this line */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.