|
|
1.1 root 1: /*
2: * UAE - The Un*x Amiga Emulator
3: *
4: * custom chip support
5: *
6: * (c) 1995 Bernd Schmidt
7: */
8:
9: #ifndef WINUAE_CUSTOM_H
10: #define WINUAE_CUSTOM_H
11:
12: /* These are the masks that are ORed together in the chipset_mask option.
13: * If CSMASK_AGA is set, the ECS bits are guaranteed to be set as well. */
14: #define CSMASK_ECS_AGNUS 1
15: #define CSMASK_ECS_DENISE 2
16: #define CSMASK_AGA 4
17: #define CSMASK_MASK (CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE | CSMASK_AGA)
18:
19: uae_u32 get_copper_address (int copno);
20:
21: extern int custom_init (void);
22: extern void customreset (void);
23: extern int intlev (void);
24: extern void dumpcustom (void);
25: extern void uae_reset (int hardreset);
26:
27: extern void do_disk (void);
28: extern void do_copper (void);
29:
30: extern void notice_new_xcolors (void);
31: extern void notice_screen_contents_lost (void);
32: extern void init_row_map (void);
33: extern void init_hz (void);
34: extern void init_custom (void);
35:
36: extern bool picasso_requested_on;
37: extern bool picasso_on;
38: extern void set_picasso_hack_rate (int hz);
39:
40: /* Set to 1 to leave out the current frame in average frame time calculation.
41: * Useful if the debugger was active. */
42: extern int bogusframe;
43: extern unsigned long int hsync_counter;
44:
45: extern uae_u16 dmacon;
46: extern uae_u16 intena, intreq, intreqr;
47:
48: extern int current_hpos (void);
49: extern int vpos;
50:
51: extern int find_copper_record (uaecptr, int *, int *);
52:
53: extern int n_frames;
54:
55: STATIC_INLINE int dmaen (unsigned int dmamask)
56: {
57: return (dmamask & dmacon) && (dmacon & 0x200);
58: }
59:
60:
61: #define SPCFLAG_STOP 2
62: #define SPCFLAG_COPPER 4
63: #define SPCFLAG_INT 8
64: //#define SPCFLAG_BRK 16
65: //#define SPCFLAG_EXTRA_CYCLES 32
66: //#define SPCFLAG_TRACE 64
67: //#define SPCFLAG_DOTRACE 128
68: //#define SPCFLAG_DOINT 256 /* arg, JIT fails without this.. */
69: #define SPCFLAG_BLTNASTY 512
70: //#define SPCFLAG_EXEC 1024
71: #define SPCFLAG_ACTION_REPLAY 2048
72: #define SPCFLAG_TRAP 4096 /* enforcer-hack */
73: //#define SPCFLAG_MODE_CHANGE 8192
74: #ifdef JIT
75: #define SPCFLAG_END_COMPILE 16384
76: #endif
77:
78: extern uae_u16 adkcon;
79:
80: extern unsigned int joy0dir, joy1dir;
81: extern int joy0button, joy1button;
82:
83: extern void INTREQ (uae_u16);
84: extern void INTREQ_0 (uae_u16);
85: extern void INTREQ_f (uae_u16);
86: extern void send_interrupt (int num, int delay);
87: extern uae_u16 INTREQR (void);
88:
89:
90: #define DMA_AUD0 0x0001
91: #define DMA_AUD1 0x0002
92: #define DMA_AUD2 0x0004
93: #define DMA_AUD3 0x0008
94: #define DMA_DISK 0x0010
95: #define DMA_SPRITE 0x0020
96: #define DMA_BLITTER 0x0040
97: #define DMA_COPPER 0x0080
98: #define DMA_BITPLANE 0x0100
99: #define DMA_MASTER 0x0200
100: #define DMA_BLITPRI 0x0400
101:
102: #define CYCLE_REFRESH 0x01
103: #define CYCLE_STROBE 0x02
104: #define CYCLE_MISC 0x04
105: #define CYCLE_SPRITE 0x08
106: #define CYCLE_COPPER 0x10
107: #define CYCLE_BLITTER 0x20
108: #define CYCLE_CPU 0x40
109: #define CYCLE_CPUNASTY 0x80
110:
111: #ifdef AGA
112: /* AGA mode color lookup tables */
113: extern unsigned int xredcolors[256], xgreencolors[256], xbluecolors[256];
114: #endif
115: extern int xredcolor_s, xredcolor_b, xredcolor_m;
116: extern int xgreencolor_s, xgreencolor_b, xgreencolor_m;
117: extern int xbluecolor_s, xbluecolor_b, xbluecolor_m;
118:
119: #define RES_LORES 0
120: #define RES_HIRES 1
121: #define RES_SUPERHIRES 2
122: #define RES_MAX 2
123: #define VRES_NONDOUBLE 0
124: #define VRES_DOUBLE 1
125: #define VRES_MAX 1
126:
127: /* calculate shift depending on resolution (replaced "decided_hires ? 4 : 8") */
128: #define RES_SHIFT(res) ((res) == RES_LORES ? 8 : (res) == RES_HIRES ? 4 : 2)
129:
130: /* get resolution from bplcon0 */
131: #if AMIGA_ONLY
132: STATIC_INLINE int GET_RES_DENISE (uae_u16 con0)
133: {
134: if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE))
135: con0 &= ~0x40;
136: return ((con0) & 0x8000) ? RES_HIRES : ((con0) & 0x40) ? RES_SUPERHIRES : RES_LORES;
137: }
138: STATIC_INLINE int GET_RES_AGNUS (uae_u16 con0)
139: {
140: if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS))
141: con0 &= ~0x40;
142: return ((con0) & 0x8000) ? RES_HIRES : ((con0) & 0x40) ? RES_SUPERHIRES : RES_LORES;
143: }
144: #endif // AMIGA_ONLY
145:
146: /* get sprite width from FMODE */
147: #define GET_SPRITEWIDTH(FMODE) ((((FMODE) >> 2) & 3) == 3 ? 64 : (((FMODE) >> 2) & 3) == 0 ? 16 : 32)
148: /* Compute the number of bitplanes from a value written to BPLCON0 */
149: STATIC_INLINE int GET_PLANES(uae_u16 bplcon0)
150: {
151: if ((bplcon0 & 0x0010) && (bplcon0 & 0x7000))
152: return 0;
153: if (bplcon0 & 0x0010)
154: return 8;
155: return (bplcon0 >> 12) & 7;
156: }
157:
158: extern void fpscounter_reset (void);
159: extern unsigned long idletime;
160: extern int lightpen_x, lightpen_y, lightpen_cx, lightpen_cy;
161:
162: struct customhack {
163: uae_u16 v;
164: int vpos, hpos;
165: };
166: void customhack_put (struct customhack *ch, uae_u16 v, int hpos);
167: uae_u16 customhack_get (struct customhack *ch, int hpos);
168: extern void alloc_cycle_ext (int, int);
169: extern bool ispal (void);
170: extern int inprec_open(char *fname, int record);
171: extern void sleep_millis (int ms);
172: extern void mmu_do_hit (void);
173:
1.1.1.2 root 174: /* referred by prefetch.h */
175: extern uae_u32 wait_cpu_cycle_read (uaecptr addr, int mode);
176: extern void wait_cpu_cycle_write (uaecptr addr, int mode, uae_u32 v);
177: extern uae_u32 wait_cpu_cycle_read_ce020 (uaecptr addr, int mode);
178: extern void wait_cpu_cycle_write_ce020 (uaecptr addr, int mode, uae_u32 v);
179:
1.1 root 180: #endif /* WINUAE_CUSTOM_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.