Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc-extra / emu / rrgb / z80.h
blobfd6bb00409626d1d3ad8266ff0200e5929f8556f
1 /* Miscellaneous definitions for xz80, copyright (C) 1994 Ian Collier.
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 #define Z80_quit 1
19 #define Z80_NMI 2
20 #define Z80_reset 3
21 #define Z80_load 4
22 #define Z80_save 5
23 #define Z80_log 6
25 #define SEG_SIZE 8192
26 #define NUM_SEGS (65536/SEG_SIZE)
28 #define DMAP 1
29 #define DPROFILE 2
30 #define DSTARTDEBUG 4
31 #define DSOCKETS 8
32 #define DTIMERINT 16
33 #define DLIMITEDRUN 32
35 #ifdef SEG
36 extern unsigned char *segments[];
37 extern char bank_file_name[];
38 void switchBank( int segment, unsigned bank );
39 #endif
41 void profile(void);
43 extern unsigned char mem[];
44 extern int memattr[];
45 extern int hsize,vsize;
46 extern volatile int interrupted;
47 extern int forceok;
48 extern unsigned short breakpoints[5];
49 extern unsigned long tstates;
50 extern int flags;
52 extern int mainloop(int flags);
53 int handle_sys(int scall, int parameter);
55 typedef struct sfunction mfunction;
56 typedef struct sfunction *pmfunction;
58 struct sfunction {
59 int addr;
60 int num_calls;
61 int tstates;
62 int start;
63 pmfunction next;
66 extern pmfunction fun_first;
68 #define fetch(x) (mem[x])
69 #define fetch2(x) ((mem[x+1]<<8)|mem[x])
71 #define store( addr, value ) mem[addr]=value;
73 #define store2b(addr,hi,lo) \
74 mem[addr]=(lo);\
75 mem[addr+1]=(hi);
77 #define store2(x,y) store2b(x,(y)>>8,(y)&255)
79 #ifdef __GNUC__
80 static void inline storefunc(unsigned short ad,unsigned char b){
81 store(ad,b);
84 #undef store
85 #define store(x,y) storefunc(x,y)
87 static void inline store2func(unsigned short ad,unsigned char b1,unsigned char b2){
88 store2b(ad,b1,b2);
90 #undef store2b
91 #define store2b(x,hi,lo) store2func(x,hi,lo)
92 #endif
94 #define bc ((b<<8)|c)
95 #define de ((d<<8)|e)
96 #define hl ((h<<8)|l)