6 |
|
* Copyright 1995 Bernd Schmidt |
7 |
|
*/ |
8 |
|
|
9 |
+ |
#ifndef NEWCPU_H |
10 |
+ |
#define NEWCPU_H |
11 |
+ |
|
12 |
|
#define SPCFLAG_STOP 2 |
13 |
|
#define SPCFLAG_DISK 4 |
14 |
|
#define SPCFLAG_INT 8 |
21 |
|
#define SPCFLAG_EXEC 1024 |
22 |
|
#define SPCFLAG_MODE_CHANGE 8192 |
23 |
|
|
21 |
– |
#ifndef SET_CFLG |
22 |
– |
|
23 |
– |
#define SET_CFLG(x) (CFLG = (x)) |
24 |
– |
#define SET_NFLG(x) (NFLG = (x)) |
25 |
– |
#define SET_VFLG(x) (VFLG = (x)) |
26 |
– |
#define SET_ZFLG(x) (ZFLG = (x)) |
27 |
– |
#define SET_XFLG(x) (XFLG = (x)) |
28 |
– |
|
29 |
– |
#define GET_CFLG CFLG |
30 |
– |
#define GET_NFLG NFLG |
31 |
– |
#define GET_VFLG VFLG |
32 |
– |
#define GET_ZFLG ZFLG |
33 |
– |
#define GET_XFLG XFLG |
34 |
– |
|
35 |
– |
#define CLEAR_CZNV do { \ |
36 |
– |
SET_CFLG (0); \ |
37 |
– |
SET_ZFLG (0); \ |
38 |
– |
SET_NFLG (0); \ |
39 |
– |
SET_VFLG (0); \ |
40 |
– |
} while (0) |
41 |
– |
|
42 |
– |
#define COPY_CARRY (SET_XFLG (GET_CFLG)) |
43 |
– |
#endif |
44 |
– |
|
24 |
|
extern int areg_byteinc[]; |
25 |
|
extern int imm8_table[]; |
26 |
|
|
119 |
|
|
120 |
|
static __inline__ void fill_prefetch_0 (void) |
121 |
|
{ |
122 |
+ |
#if USE_PREFETCH_BUFFER |
123 |
|
uae_u32 r; |
124 |
|
#ifdef UNALIGNED_PROFITABLE |
125 |
|
r = *(uae_u32 *)regs.pc_p; |
128 |
|
r = do_get_mem_long ((uae_u32 *)regs.pc_p); |
129 |
|
do_put_mem_long (®s.prefetch, r); |
130 |
|
#endif |
131 |
+ |
#endif |
132 |
|
} |
133 |
|
|
134 |
|
#if 0 |
169 |
|
#if !defined USE_COMPILER |
170 |
|
static __inline__ void m68k_setpc (uaecptr newpc) |
171 |
|
{ |
172 |
+ |
#if REAL_ADDRESSING || DIRECT_ADDRESSING |
173 |
+ |
regs.pc_p = get_real_address(newpc); |
174 |
+ |
#else |
175 |
|
regs.pc_p = regs.pc_oldp = get_real_address(newpc); |
176 |
|
regs.pc = newpc; |
177 |
+ |
#endif |
178 |
|
} |
179 |
|
#else |
180 |
|
extern void m68k_setpc (uaecptr newpc); |
182 |
|
|
183 |
|
static __inline__ uaecptr m68k_getpc (void) |
184 |
|
{ |
185 |
+ |
#if REAL_ADDRESSING || DIRECT_ADDRESSING |
186 |
+ |
return get_virtual_address(regs.pc_p); |
187 |
+ |
#else |
188 |
|
return regs.pc + ((char *)regs.pc_p - (char *)regs.pc_oldp); |
189 |
< |
} |
202 |
< |
|
203 |
< |
static __inline__ uaecptr m68k_getpc_p (uae_u8 *p) |
204 |
< |
{ |
205 |
< |
return regs.pc + ((char *)p - (char *)regs.pc_oldp); |
189 |
> |
#endif |
190 |
|
} |
191 |
|
|
192 |
|
#ifdef USE_COMPILER |
199 |
|
#define m68k_setpc_rte m68k_setpc |
200 |
|
#endif |
201 |
|
|
202 |
+ |
static __inline__ void m68k_do_rts(void) |
203 |
+ |
{ |
204 |
+ |
m68k_setpc(get_long(m68k_areg(regs, 7))); |
205 |
+ |
m68k_areg(regs, 7) += 4; |
206 |
+ |
} |
207 |
+ |
|
208 |
+ |
static __inline__ void m68k_do_bsr(uaecptr oldpc, uae_s32 offset) |
209 |
+ |
{ |
210 |
+ |
m68k_areg(regs, 7) -= 4; |
211 |
+ |
put_long(m68k_areg(regs, 7), oldpc); |
212 |
+ |
m68k_incpc(offset); |
213 |
+ |
} |
214 |
+ |
|
215 |
+ |
static __inline__ void m68k_do_jsr(uaecptr oldpc, uaecptr dest) |
216 |
+ |
{ |
217 |
+ |
m68k_areg(regs, 7) -= 4; |
218 |
+ |
put_long(m68k_areg(regs, 7), oldpc); |
219 |
+ |
m68k_setpc(dest); |
220 |
+ |
} |
221 |
+ |
|
222 |
|
static __inline__ void m68k_setstopped (int stop) |
223 |
|
{ |
224 |
|
regs.stopped = stop; |
225 |
< |
if (stop) |
225 |
> |
/* A traced STOP instruction drops through immediately without |
226 |
> |
actually stopping. */ |
227 |
> |
if (stop && (regs.spcflags & SPCFLAG_DOTRACE) == 0) |
228 |
|
regs.spcflags |= SPCFLAG_STOP; |
229 |
|
} |
230 |
|
|
237 |
|
extern void MakeFromSR (void); |
238 |
|
extern void Exception (int, uaecptr); |
239 |
|
extern void dump_counts (void); |
240 |
< |
extern void m68k_move2c (int, uae_u32 *); |
241 |
< |
extern void m68k_movec2 (int, uae_u32 *); |
240 |
> |
extern int m68k_move2c (int, uae_u32 *); |
241 |
> |
extern int m68k_movec2 (int, uae_u32 *); |
242 |
|
extern void m68k_divl (uae_u32, uae_u32, uae_u16, uaecptr); |
243 |
|
extern void m68k_mull (uae_u32, uae_u32, uae_u16); |
244 |
|
extern void init_m68k (void); |
245 |
+ |
extern void exit_m68k (void); |
246 |
|
extern void m68k_go (int); |
247 |
|
extern void m68k_dumpstate (uaecptr *); |
248 |
|
extern void m68k_disasm (uaecptr, uaecptr *, int); |
259 |
|
extern void fsave_opp (uae_u32); |
260 |
|
extern void frestore_opp (uae_u32); |
261 |
|
|
262 |
+ |
extern void fpu_set_integral_fpu (bool is_integral); |
263 |
+ |
extern void fpu_init (void); |
264 |
+ |
extern void fpu_exit (void); |
265 |
+ |
extern void fpu_reset (void); |
266 |
+ |
|
267 |
|
/* Opcode of faulting instruction */ |
268 |
|
extern uae_u16 last_op_for_exception_3; |
269 |
|
/* PC at fault time */ |
286 |
|
|
287 |
|
extern cpuop_func *cpufunctbl[65536] ASM_SYM_FOR_FUNC ("cpufunctbl"); |
288 |
|
|
289 |
+ |
#endif /* NEWCPU_H */ |