1 /* Header file for the main program. 2 Copyright (C) 1995 Frank D. Cringle. 3 Modifications for CP/M 3.1 Copyright (C) 2000/2004 by Andreas Gerlich (agl) 4 5 This file is part of yaze-ag - yet another Z80 emulator by ag. 6 7 Yaze-ag is free software; you can redistribute it and/or modify it under 8 the terms of the GNU General Public License as published by the Free 9 Software Foundation; either version 2 of the License, or (at your 10 option) any later version. 11 12 This program is distributed in the hope that it will be useful, but 13 WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program; if not, write to the Free Software 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 20 21 #define VERSION "2.51.0" 22 #define DEVVER "rc1" /* developer version */ 23 #define MAINVersion 0x02 24 #define SUBVersion 0x51 25 #define DEVELVersion 0 26 27 /* #define DEVVER "RC4" \* release candidate */ 28 /* Now it is in the Makefiles 29 #define BUILD " (build for INTEL x86_64Bit (core2 Duo))" 30 */ 31 32 #define CCP_LENGTH 0x800 33 #define BDOS_LENGTH 0xe00 34 #define CPM_LENGTH (CCP_LENGTH + BDOS_LENGTH) 35 36 #define CPM_COMMAND_LINE_LENGTH 0x80 37 38 extern int always128; /* is set if all drives uses 128 byte sektors */ 39 40 extern WORD ccp_base; /* base address of ccp */ 41 extern WORD bdos_base; /* base address of bdos */ 42 extern WORD bios_base; /* base address of bios */ 43 extern WORD bios_top; /* end of bios, start of 44 global work area */ 45 46 extern WORD dirbuff; /* common directory buffer for 47 all disks */ 48 extern WORD dptable; /* base of disk parameter 49 headers table */ 50 extern BYTE *global_alv; /* global allocation vector */ 51 52 extern long z3env; /* z-system environment (none if z3env==0) */ 53 54 extern void init_mmu(); 55 extern void bios(int func); 56 extern int bios_init(const char *initfile); 57 extern void initSIGWINSZ(); 58 extern int docmd(char *cmd); 59 extern void monitor(FASTWORK adr); 60 extern int remount(int disk); 61 extern void showdisk(int disk, int verbose); 62 extern void *xmalloc(size_t size); 63 extern char *newstr(const char *str); 64 65 #ifdef USE_GNU_READLINE 66 #include <readline/readline.h> 67 void add_history(char *cmd); 68 #else 69 #define add_history(x) 70 #endif 71 72 #ifdef BSD 73 #if defined(sun) 74 #include <memory.h> 75 #include <string.h> 76 #endif 77 #ifndef strchr 78 #define strchr index 79 #endif 80 #ifndef strrchr 81 #define strrchr rindex 82 #endif 83 #define memclr(p,n) bzero(p,n) 84 #define memcpy(t,f,n) bcopy(f,t,n) 85 #define memcmp(p1,p2,n) bcmp(p1,p2,n) 86 #define memset(p,v,n) \ 87 do { size_t len = n; \ 88 char *p1 = p; \ 89 while (len--) *p1++ = v; \ 90 } while (0) 91 #else 92 #include <string.h> 93 #define memclr(p,n) (void) memset(p,0,n) 94 #endif 95