|
|
1.1.1.3 root 1: /*
1.1 root 2: * UAE - The Un*x Amiga Emulator
1.1.1.3 root 3: *
1.1 root 4: * custom chip support
5: *
6: * (c) 1995 Bernd Schmidt
7: */
8:
1.1.1.7 root 9: /* These are the masks that are ORed together in the chipset_mask option.
10: * If CSMASK_AGA is set, the ECS bits are guaranteed to be set as well. */
11: #define CSMASK_ECS_AGNUS 1
12: #define CSMASK_ECS_DENISE 2
13: #define CSMASK_AGA 4
14:
1.1.1.15 root 15: uae_u32 get_copper_address(int copno);
16:
1.1.1.5 root 17: extern void custom_init (void);
18: extern void customreset (void);
19: extern int intlev (void);
20: extern void dumpcustom (void);
1.1 root 21:
1.1.1.5 root 22: extern void do_disk (void);
1.1.1.9 root 23: extern void do_copper (void);
1.1 root 24:
1.1.1.3 root 25: extern void notice_new_xcolors (void);
26: extern void notice_screen_contents_lost (void);
1.1.1.5 root 27: extern void init_row_map (void);
1.1.1.3 root 28:
1.1.1.15 root 29: extern void custom_prepare_savestate (void);
30:
1.1.1.3 root 31: extern int picasso_requested_on;
32: extern int picasso_on;
33:
34: /* Set to 1 to leave out the current frame in average frame time calculation.
35: * Useful if the debugger was active. */
1.1 root 36: extern int bogusframe;
37:
1.1.1.3 root 38: extern uae_u16 dmacon;
39: extern uae_u16 intena,intreq;
1.1.1.2 root 40:
41: extern int current_hpos (void);
1.1.1.3 root 42: extern int vpos;
1.1.1.2 root 43:
1.1.1.15 root 44: extern int find_copper_record (uaecptr, int *, int *);
45:
1.1.1.12 root 46: extern int n_frames;
47:
1.1.1.8 root 48: STATIC_INLINE int dmaen (unsigned int dmamask)
1.1 root 49: {
50: return (dmamask & dmacon) && (dmacon & 0x200);
51: }
52:
53: #define SPCFLAG_STOP 2
1.1.1.9 root 54: #define SPCFLAG_COPPER 4
55: #define SPCFLAG_INT 8
56: #define SPCFLAG_BRK 16
1.1 root 57: #define SPCFLAG_EXTRA_CYCLES 32
58: #define SPCFLAG_TRACE 64
59: #define SPCFLAG_DOTRACE 128
60: #define SPCFLAG_DOINT 256
61: #define SPCFLAG_BLTNASTY 512
62: #define SPCFLAG_EXEC 1024
1.1.1.2 root 63: #define SPCFLAG_MODE_CHANGE 8192
1.1 root 64:
1.1.1.3 root 65: extern uae_u16 adkcon;
1.1 root 66:
1.1.1.3 root 67: extern unsigned int joy0dir, joy1dir;
68: extern int joy0button, joy1button;
69:
1.1.1.4 root 70: extern void INTREQ (uae_u16);
1.1.1.15 root 71: extern void INTREQ_0 (uae_u16);
1.1.1.4 root 72: extern uae_u16 INTREQR (void);
1.1 root 73:
1.1.1.7 root 74: /* maximums for statically allocated tables */
75:
76: #define MAXHPOS 227
77: #define MAXVPOS 312
78:
79: /* PAL/NTSC values */
80:
1.1.1.2 root 81: /* The HRM says: The vertical blanking area (PAL) ranges from line 0 to line 29,
82: * and no data can be displayed there. Nevertheless, we lose some overscan data
1.1.1.7 root 83: * if minfirstline is set to 29. */
84:
85: #define MAXHPOS_PAL 227
86: #define MAXHPOS_NTSC 227
87: #define MAXVPOS_PAL 312
88: #define MAXVPOS_NTSC 262
89: #define MINFIRSTLINE_PAL 21
90: #define MINFIRSTLINE_NTSC 18
91: #define VBLANK_ENDLINE_PAL 29
92: #define VBLANK_ENDLINE_NTSC 24
93: #define VBLANK_HZ_PAL 50
94: #define VBLANK_HZ_NTSC 60
95:
96: extern int maxhpos, maxvpos, minfirstline, vblank_endline, numscrlines, vblank_hz;
97: extern unsigned long syncbase;
98: #define NUMSCRLINES (maxvpos+1-minfirstline+1)
1.1 root 99:
100: #define DMA_AUD0 0x0001
101: #define DMA_AUD1 0x0002
102: #define DMA_AUD2 0x0004
103: #define DMA_AUD3 0x0008
104: #define DMA_DISK 0x0010
105: #define DMA_SPRITE 0x0020
106: #define DMA_BLITTER 0x0040
107: #define DMA_COPPER 0x0080
108: #define DMA_BITPLANE 0x0100
1.1.1.10 root 109: #define DMA_MASTER 0x0200
1.1 root 110: #define DMA_BLITPRI 0x0400
1.1.1.2 root 111:
112: extern unsigned long frametime, timeframes;
113:
1.1.1.14 root 114: /* 100 words give you 1600 horizontal pixels. Should be more than enough for
115: * superhires. Don't forget to update the definition in genp2c.c as well.
116: * needs to be larger for superhires support */
117: #define MAX_WORDS_PER_LINE 100
1.1.1.3 root 118:
119: extern uae_u32 hirestab_h[256][2];
120: extern uae_u32 lorestab_h[256][4];
121:
122: extern uae_u32 hirestab_l[256][1];
123: extern uae_u32 lorestab_l[256][2];
1.1.1.11 root 124:
125: /* AGA mode color lookup tables */
126: extern unsigned int xredcolors[256], xgreencolors[256], xbluecolors[256];
1.1.1.13 root 127:
1.1.1.16! root 128: extern int bpl_off[8];
1.1.1.15 root 129:
1.1.1.13 root 130: /* get resolution from bplcon0 */
131: #define GET_RES(CON0) (((CON0) & 0x8000) ? RES_HIRES : ((CON0) & 0x40) ? RES_SUPERHIRES : RES_LORES)
132: /* get sprite width from FMODE */
133: #define GET_SPRITEWIDTH(FMODE) ((((FMODE) >> 2) & 3) == 3 ? 64 : (((FMODE) >> 2) & 3) == 0 ? 16 : 32)
134: /* Compute the number of bitplanes from a value written to BPLCON0 */
135: #define GET_PLANES(x) ((((x) >> 12) & 7) | (((x) & 0x10) >> 1))
136:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.