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.
27 #ifdef ROCKBOX_BIG_ENDIAN
28 #define WORDS_BIGENDIAN
32 #define PRNM(x) z80_ ## x
34 #define PRNM(x) z80x_ ## x
37 #define DANM(x) PRNM(proc).x
42 #ifndef WORDS_BIGENDIAN
44 struct { byte l
, h
, _b2
, _b3
; } s
;
45 struct { dbyte d
, _d1
; } d
;
50 struct { byte _b3
, _b2
, h
, l
; } s
;
51 struct { dbyte _d1
, d
; } d
;
61 /* Do NOT change the order! */
63 union dregp nr
[NUMDREGS
];
64 union dregp br
[BACKDREGS
];
75 #ifdef SPECT_MEM /* WARNING: Do NOT change the order!!! */
106 extern Z80
PRNM(proc
);
108 extern byte
PRNM(inports
)[];
109 extern byte
PRNM(outports
)[];
122 #define BC (DANM(nr)[ZI_BC].d.d)
123 #define DE (DANM(nr)[ZI_DE].d.d)
124 #define HL (DANM(nr)[ZI_HL].d.d)
125 #define AF (DANM(nr)[ZI_AF].d.d)
126 #define IR (DANM(nr)[ZI_IR].d.d)
127 #define IX (DANM(nr)[ZI_IX].d.d)
128 #define IY (DANM(nr)[ZI_IY].d.d)
129 #define PC (DANM(nr)[ZI_PC].d.d)
130 #define SP (DANM(nr)[ZI_SP].d.d)
132 #define BCP (DANM(nr)[ZI_BC].p)
133 #define DEP (DANM(nr)[ZI_DE].p)
134 #define HLP (DANM(nr)[ZI_HL].p)
135 #define PCP (DANM(nr)[ZI_PC].p)
136 #define SPP (DANM(nr)[ZI_SP].p)
137 #define IXP (DANM(nr)[ZI_IX].p)
138 #define IYP (DANM(nr)[ZI_IY].p)
141 #define RB (DANM(nr)[ZI_BC].s.h)
142 #define RC (DANM(nr)[ZI_BC].s.l)
143 #define RD (DANM(nr)[ZI_DE].s.h)
144 #define RE (DANM(nr)[ZI_DE].s.l)
145 #define RH (DANM(nr)[ZI_HL].s.h)
146 #define RL (DANM(nr)[ZI_HL].s.l)
147 #define RA (DANM(nr)[ZI_AF].s.h)
148 #define RF (DANM(nr)[ZI_AF].s.l)
149 #define RI (DANM(nr)[ZI_IR].s.h)
150 #define RR (DANM(nr)[ZI_IR].s.l)
151 #define XH (DANM(nr)[ZI_IX].s.h)
152 #define XL (DANM(nr)[ZI_IX].s.l)
153 #define YH (DANM(nr)[ZI_IY].s.h)
154 #define YL (DANM(nr)[ZI_IY].s.l)
155 #define PCH (DANM(nr)[ZI_PC].s.h)
156 #define PCL (DANM(nr)[ZI_PC].s.l)
157 #define SPH (DANM(nr)[ZI_SP].s.h)
158 #define SPL (DANM(nr)[ZI_SP].s.l)
160 #define BCBK (DANM(br)[ZI_BC].d.d)
161 #define DEBK (DANM(br)[ZI_DE].d.d)
162 #define HLBK (DANM(br)[ZI_HL].d.d)
163 #define AFBK (DANM(br)[ZI_AF].d.d)
165 #define BBK (DANM(br)[ZI_BC].s.h)
166 #define CBK (DANM(br)[ZI_BC].s.l)
167 #define DBK (DANM(br)[ZI_DE].s.h)
168 #define EBK (DANM(br)[ZI_DE].s.l)
169 #define HBK (DANM(br)[ZI_HL].s.h)
170 #define LBK (DANM(br)[ZI_HL].s.l)
171 #define ABK (DANM(br)[ZI_AF].s.h)
172 #define FBK (DANM(br)[ZI_AF].s.l)
178 extern void PRNM(init
)(void);
179 extern int PRNM(step
)(int ticknum
);
181 extern void PRNM(interrupt
)(int data
);
182 extern void PRNM(nmi
)(void);
183 extern void PRNM(reset
)(void);
185 extern void PRNM(pushpc
)(void);
186 extern void PRNM(local_init
)(void);