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 |
58 |
|
|
59 |
|
extern int broken_in; |
60 |
|
|
61 |
< |
typedef unsigned long REGPARAM2 cpuop_func (uae_u32) REGPARAM; |
61 |
> |
typedef void REGPARAM2 cpuop_func (uae_u32) REGPARAM; |
62 |
|
|
63 |
|
struct cputbl { |
64 |
|
cpuop_func *handler; |
66 |
|
uae_u16 opcode; |
67 |
|
}; |
68 |
|
|
69 |
< |
extern unsigned long REGPARAM2 op_illg (uae_u32) REGPARAM; |
69 |
> |
extern void REGPARAM2 op_illg (uae_u32) REGPARAM; |
70 |
|
|
71 |
|
typedef char flagtype; |
72 |
|
|
143 |
|
|
144 |
|
static __inline__ void fill_prefetch_0 (void) |
145 |
|
{ |
146 |
+ |
#if USE_PREFETCH_BUFFER |
147 |
|
uae_u32 r; |
148 |
|
#ifdef UNALIGNED_PROFITABLE |
149 |
|
r = *(uae_u32 *)regs.pc_p; |
152 |
|
r = do_get_mem_long ((uae_u32 *)regs.pc_p); |
153 |
|
do_put_mem_long (®s.prefetch, r); |
154 |
|
#endif |
155 |
+ |
#endif |
156 |
|
} |
157 |
|
|
158 |
|
#if 0 |
193 |
|
#if !defined USE_COMPILER |
194 |
|
static __inline__ void m68k_setpc (uaecptr newpc) |
195 |
|
{ |
196 |
+ |
#if REAL_ADDRESSING || DIRECT_ADDRESSING |
197 |
+ |
regs.pc_p = get_real_address(newpc); |
198 |
+ |
#else |
199 |
|
regs.pc_p = regs.pc_oldp = get_real_address(newpc); |
200 |
|
regs.pc = newpc; |
201 |
+ |
#endif |
202 |
|
} |
203 |
|
#else |
204 |
|
extern void m68k_setpc (uaecptr newpc); |
206 |
|
|
207 |
|
static __inline__ uaecptr m68k_getpc (void) |
208 |
|
{ |
209 |
+ |
#if REAL_ADDRESSING || DIRECT_ADDRESSING |
210 |
+ |
return get_virtual_address(regs.pc_p); |
211 |
+ |
#else |
212 |
|
return regs.pc + ((char *)regs.pc_p - (char *)regs.pc_oldp); |
213 |
< |
} |
202 |
< |
|
203 |
< |
static __inline__ uaecptr m68k_getpc_p (uae_u8 *p) |
204 |
< |
{ |
205 |
< |
return regs.pc + ((char *)p - (char *)regs.pc_oldp); |
213 |
> |
#endif |
214 |
|
} |
215 |
|
|
216 |
|
#ifdef USE_COMPILER |
223 |
|
#define m68k_setpc_rte m68k_setpc |
224 |
|
#endif |
225 |
|
|
226 |
+ |
static __inline__ void m68k_do_rts(void) |
227 |
+ |
{ |
228 |
+ |
m68k_setpc(get_long(m68k_areg(regs, 7))); |
229 |
+ |
m68k_areg(regs, 7) += 4; |
230 |
+ |
} |
231 |
+ |
|
232 |
+ |
static __inline__ void m68k_do_bsr(uaecptr oldpc, uae_s32 offset) |
233 |
+ |
{ |
234 |
+ |
m68k_areg(regs, 7) -= 4; |
235 |
+ |
put_long(m68k_areg(regs, 7), oldpc); |
236 |
+ |
m68k_incpc(offset); |
237 |
+ |
} |
238 |
+ |
|
239 |
+ |
static __inline__ void m68k_do_jsr(uaecptr oldpc, uaecptr dest) |
240 |
+ |
{ |
241 |
+ |
m68k_areg(regs, 7) -= 4; |
242 |
+ |
put_long(m68k_areg(regs, 7), oldpc); |
243 |
+ |
m68k_setpc(dest); |
244 |
+ |
} |
245 |
+ |
|
246 |
|
static __inline__ void m68k_setstopped (int stop) |
247 |
|
{ |
248 |
|
regs.stopped = stop; |
264 |
|
extern void m68k_divl (uae_u32, uae_u32, uae_u16, uaecptr); |
265 |
|
extern void m68k_mull (uae_u32, uae_u32, uae_u16); |
266 |
|
extern void init_m68k (void); |
267 |
+ |
extern void exit_m68k (void); |
268 |
|
extern void m68k_go (int); |
269 |
|
extern void m68k_dumpstate (uaecptr *); |
270 |
|
extern void m68k_disasm (uaecptr, uaecptr *, int); |
281 |
|
extern void fsave_opp (uae_u32); |
282 |
|
extern void frestore_opp (uae_u32); |
283 |
|
|
284 |
+ |
extern void fpu_set_integral_fpu (bool is_integral); |
285 |
+ |
extern void fpu_init (void); |
286 |
+ |
extern void fpu_exit (void); |
287 |
+ |
extern void fpu_reset (void); |
288 |
+ |
|
289 |
|
/* Opcode of faulting instruction */ |
290 |
|
extern uae_u16 last_op_for_exception_3; |
291 |
|
/* PC at fault time */ |
308 |
|
|
309 |
|
extern cpuop_func *cpufunctbl[65536] ASM_SYM_FOR_FUNC ("cpufunctbl"); |
310 |
|
|
311 |
+ |
#endif /* NEWCPU_H */ |