|
|
1.1 root 1: /*
2: Hatari
3: */
4:
5: extern short int PendingInterruptCount;
6: extern int SoundCycles;
7:
8:
9: /*extern unsigned long Regs[16+1];*/
10: /*extern unsigned short int SR,SR_Before;*/
11: /*extern unsigned long PC;*/
12: /*extern unsigned long *Reg_SuperSP,*Reg_UserSP;*/
13:
14: #ifndef UAESYSDEPS
15: #include "sysdeps.h"
16: #endif
17: #ifndef UAEMEMORY
18: #include "memory.h"
19: #endif
20: #ifndef UAENEWCPU
21: #include "newcpu.h"
22: #endif
23: #define Regs regs.regs /* Ouah - uggly hack - FIXME! */
24: #define SR regs.sr
25: #define PC regs.pc
26: #define Reg_SuperSP regs.isp
27: #define Reg_UserSP regs.usp
28:
29:
30: /* Offset ST address to PC pointer: */
31: #define STRAM_ADDR(Var) ( (unsigned long)STRam+((unsigned long)Var&0x00ffffff) )
32:
33: /*-----------------------------------------------------------------------*/
34: /* Offsets from memory space program counter to immediate data(in wrong endian) */
35: #define IMM_BYTE SIZE_BYTE /* Byte offset */
36: #define IMM_WORD
37: #define IMM_LONG
38:
39: /*-----------------------------------------------------------------------*/
40: /* Set clock times for each instruction, see '68000 timing' pages for details */
41: /* NOTE All times are rounded up to nearest 4 cycles */
42: #define ROUND_CYCLES_TO4(var) (((int)(var)+3)&0xfffffffc)
43:
44: static inline void ADD_CYCLES(op,r,w)
45: {
46: PendingInterruptCount-= (op+3)&0xfffffffc;
47: SoundCycles += (op+3)&0xfffffffc;
48: }
49:
50:
51: //-----------------------------------------------------------------------
52: // Decode table structure offsets, see 'DecodeTable[]' MUST match 'decode.inc'
53: #define DECODE_CYCLES 0 // Cycles for this instruction, includes <ea> etc...
54: #define DECODE_FUNCTION 4 // Decode function to call
55: #define DECODE_EA 8 // <ea> Decode function
56: #define DECODE_1 12 // src/dest parameters
57: #define DECODE_2 16
58: #define DECODE_DISASS 20 // Disassembly function
59: #define SIZEOF_DECODE 8
60:
61: //-----------------------------------------------------------------------
62: #define PENDING_INTERRUPT_FLAG_MFP 0x0001 // 'PendingInterruptFlag' masks, MUST match 'decode.inc'
63: #define PENDING_INTERRUPT_FLAG_TRACE 0x0002
64: #define CLEAR_PENDING_INTERRUPT_FLAG_MFP 0xfffe
65: #define CLEAR_PENDING_INTERRUPT_FLAG_TRACE 0xfffd
66:
67: //-----------------------------------------------------------------------
68: #define INSTRUCTION_HISTORY_SIZE 8192 // MUST be ^2, and MUST match 'decode.inc'
69: #define INSTRUCTION_HISTORY_MASK (INSTRUCTION_HISTORY_SIZE-1)
70:
71: //-----------------------------------------------------------------------
72: #define NUM_BREAKPOINTS 8 // MUST match 'decode.inc'
73:
74: //-----------------------------------------------------------------------
75: // 68000 instruction emulation functions
76:
77: /*
78: extern unsigned char PCCodeTable_NZVC[4096];
79: extern unsigned char PCCodeTable_NZV_CX_SAME[4096];
80: extern unsigned long ShiftCycleTable_ByteWord[64];
81: extern unsigned long ShiftCycleTable_Long[64];
82: extern int InsPC;
83: extern BOOL bInSuperMode;
84: extern unsigned long StackSave;
85: extern unsigned long DecodeTable[65536*SIZEOF_DECODE];
86: extern unsigned long InstructionHistory[INSTRUCTION_HISTORY_SIZE];
87: extern int InstructionHistoryIndex;
88: extern unsigned long BreakPointInstruction;
89: extern unsigned long AddressBreakpoints[NUM_BREAKPOINTS];
90: extern unsigned long BreakOnAddress;
91: extern unsigned long CPUStopped;
92: */
93: extern unsigned long EmuCCode;
94: extern unsigned char STRam[16*1024*1024];
95: extern short int PendingInterruptFlag;
96: extern void *PendingInterruptFunction;
97: extern unsigned long STRamEnd;
98: extern unsigned long STRamEnd_BusErr;
99: extern unsigned long ExceptionVector;
100: extern unsigned long BusAddressLocation;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.