2 * Copyright (C) 1996-1998 Szeredi Miklos
3 * Email: mszeredi@inf.bme.hu
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version. See the file COPYING.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #elif defined(__BIG_ENDIAN__)
27 /* defined by preprocessor */
28 # define WORDS_BIGENDIAN
29 #elif !defined(__LITTLE_ENDIAN__)
30 /* try with types.h and endian.h */
31 /* Hack: GYGWIN doesn't have endian.h, but we know it is LITTLE ENDIAN */
33 # include <sys/types.h>
34 # if defined(_BIG_ENDIAN)
35 # define WORDS_BIGENDIAN
36 # elif !defined(_LITTLE_ENDIAN)
38 # if BYTE_ORDER == BIG_ENDIAN
39 # define WORDS_BIGENDIAN
46 #define PRNM(x) z80_ ## x
48 #define PRNM(x) z80x_ ## x
51 #define DANM(x) PRNM(proc).x
56 #ifndef WORDS_BIGENDIAN
58 struct { byte l
, h
, _b2
, _b3
; } s
;
59 struct { dbyte d
, _d1
; } d
;
64 struct { byte _b3
, _b2
, h
, l
; } s
;
65 struct { dbyte _d1
, d
; } d
;
75 /* Do NOT change the order! */
77 union dregp nr
[NUMDREGS
];
78 union dregp br
[BACKDREGS
];
89 #ifdef SPECT_MEM /* WARNING: Do NOT change the order!!! */
113 byte
*fe_inport_high
;
121 extern Z80
PRNM(proc
);
123 extern byte
PRNM(inports
)[];
124 extern byte
PRNM(outports
)[];
137 #define BC (DANM(nr)[ZI_BC].d.d)
138 #define DE (DANM(nr)[ZI_DE].d.d)
139 #define HL (DANM(nr)[ZI_HL].d.d)
140 #define AF (DANM(nr)[ZI_AF].d.d)
141 #define IR (DANM(nr)[ZI_IR].d.d)
142 #define IX (DANM(nr)[ZI_IX].d.d)
143 #define IY (DANM(nr)[ZI_IY].d.d)
144 #define PC (DANM(nr)[ZI_PC].d.d)
145 #define SP (DANM(nr)[ZI_SP].d.d)
147 #define BCP (DANM(nr)[ZI_BC].p)
148 #define DEP (DANM(nr)[ZI_DE].p)
149 #define HLP (DANM(nr)[ZI_HL].p)
150 #define PCP (DANM(nr)[ZI_PC].p)
151 #define SPP (DANM(nr)[ZI_SP].p)
152 #define IXP (DANM(nr)[ZI_IX].p)
153 #define IYP (DANM(nr)[ZI_IY].p)
156 #define RB (DANM(nr)[ZI_BC].s.h)
157 #define RC (DANM(nr)[ZI_BC].s.l)
158 #define RD (DANM(nr)[ZI_DE].s.h)
159 #define RE (DANM(nr)[ZI_DE].s.l)
160 #define RH (DANM(nr)[ZI_HL].s.h)
161 #define RL (DANM(nr)[ZI_HL].s.l)
162 #define RA (DANM(nr)[ZI_AF].s.h)
163 #define RF (DANM(nr)[ZI_AF].s.l)
164 #define RI (DANM(nr)[ZI_IR].s.h)
165 #define RR (DANM(nr)[ZI_IR].s.l)
166 #define XH (DANM(nr)[ZI_IX].s.h)
167 #define XL (DANM(nr)[ZI_IX].s.l)
168 #define YH (DANM(nr)[ZI_IY].s.h)
169 #define YL (DANM(nr)[ZI_IY].s.l)
170 #define PCH (DANM(nr)[ZI_PC].s.h)
171 #define PCL (DANM(nr)[ZI_PC].s.l)
172 #define SPH (DANM(nr)[ZI_SP].s.h)
173 #define SPL (DANM(nr)[ZI_SP].s.l)
175 #define BCBK (DANM(br)[ZI_BC].d.d)
176 #define DEBK (DANM(br)[ZI_DE].d.d)
177 #define HLBK (DANM(br)[ZI_HL].d.d)
178 #define AFBK (DANM(br)[ZI_AF].d.d)
180 #define BBK (DANM(br)[ZI_BC].s.h)
181 #define CBK (DANM(br)[ZI_BC].s.l)
182 #define DBK (DANM(br)[ZI_DE].s.h)
183 #define EBK (DANM(br)[ZI_DE].s.l)
184 #define HBK (DANM(br)[ZI_HL].s.h)
185 #define LBK (DANM(br)[ZI_HL].s.l)
186 #define ABK (DANM(br)[ZI_AF].s.h)
187 #define FBK (DANM(br)[ZI_AF].s.l)
193 extern void PRNM(init
)(void);
194 extern int PRNM(step
)(int ticknum
);
196 extern void PRNM(interrupt
)(int data
);
197 extern void PRNM(nmi
)(void);
198 extern void PRNM(reset
)(void);
200 extern void PRNM(pushpc
)(void);
201 extern void PRNM(local_init
)(void);