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