Annotation of hatari/src/cpu/custom.h, revision 1.1.1.4

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);
1.1.1.4 ! root       22: extern void custom_reset (bool hardreset, bool keyboardreset);
1.1       root       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);
1.1.1.4 ! root       33: extern void init_hz_normal (void);
1.1       root       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
1.1.1.4 ! root       77: #define SPCFLAG_CHECK 32768
1.1       root       78: 
                     79: extern uae_u16 adkcon;
                     80: 
                     81: extern unsigned int joy0dir, joy1dir;
                     82: extern int joy0button, joy1button;
                     83: 
                     84: extern void INTREQ (uae_u16);
                     85: extern void INTREQ_0 (uae_u16);
                     86: extern void INTREQ_f (uae_u16);
                     87: extern void send_interrupt (int num, int delay);
                     88: extern uae_u16 INTREQR (void);
                     89: 
                     90: 
                     91: #define DMA_AUD0      0x0001
                     92: #define DMA_AUD1      0x0002
                     93: #define DMA_AUD2      0x0004
                     94: #define DMA_AUD3      0x0008
                     95: #define DMA_DISK      0x0010
                     96: #define DMA_SPRITE    0x0020
                     97: #define DMA_BLITTER   0x0040
                     98: #define DMA_COPPER    0x0080
                     99: #define DMA_BITPLANE  0x0100
                    100: #define DMA_MASTER    0x0200
                    101: #define DMA_BLITPRI   0x0400
                    102: 
                    103: #define CYCLE_REFRESH  0x01
                    104: #define CYCLE_STROBE   0x02
                    105: #define CYCLE_MISC     0x04
                    106: #define CYCLE_SPRITE   0x08
                    107: #define CYCLE_COPPER   0x10
                    108: #define CYCLE_BLITTER  0x20
                    109: #define CYCLE_CPU      0x40
                    110: #define CYCLE_CPUNASTY 0x80
                    111: 
                    112: #ifdef AGA
                    113: /* AGA mode color lookup tables */
                    114: extern unsigned int xredcolors[256], xgreencolors[256], xbluecolors[256];
                    115: #endif
                    116: extern int xredcolor_s, xredcolor_b, xredcolor_m;
                    117: extern int xgreencolor_s, xgreencolor_b, xgreencolor_m;
                    118: extern int xbluecolor_s, xbluecolor_b, xbluecolor_m;
                    119: 
                    120: #define RES_LORES 0
                    121: #define RES_HIRES 1
                    122: #define RES_SUPERHIRES 2
                    123: #define RES_MAX 2
                    124: #define VRES_NONDOUBLE 0
                    125: #define VRES_DOUBLE 1
                    126: #define VRES_MAX 1
                    127: 
                    128: /* calculate shift depending on resolution (replaced "decided_hires ? 4 : 8") */
                    129: #define RES_SHIFT(res) ((res) == RES_LORES ? 8 : (res) == RES_HIRES ? 4 : 2)
                    130: 
                    131: /* get resolution from bplcon0 */
                    132: #if AMIGA_ONLY
                    133: STATIC_INLINE int GET_RES_DENISE (uae_u16 con0)
                    134: {
                    135:     if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE))
                    136:        con0 &= ~0x40;
                    137:     return ((con0) & 0x8000) ? RES_HIRES : ((con0) & 0x40) ? RES_SUPERHIRES : RES_LORES;
                    138: }
                    139: STATIC_INLINE int GET_RES_AGNUS (uae_u16 con0)
                    140: {
                    141:     if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS))
                    142:        con0 &= ~0x40;
                    143:     return ((con0) & 0x8000) ? RES_HIRES : ((con0) & 0x40) ? RES_SUPERHIRES : RES_LORES;
                    144: }
                    145: #endif // AMIGA_ONLY
                    146: 
                    147: /* get sprite width from FMODE */
                    148: #define GET_SPRITEWIDTH(FMODE) ((((FMODE) >> 2) & 3) == 3 ? 64 : (((FMODE) >> 2) & 3) == 0 ? 16 : 32)
                    149: /* Compute the number of bitplanes from a value written to BPLCON0  */
                    150: STATIC_INLINE int GET_PLANES(uae_u16 bplcon0)
                    151: {
                    152:     if ((bplcon0 & 0x0010) && (bplcon0 & 0x7000))
                    153:        return 0;
                    154:     if (bplcon0 & 0x0010)
                    155:        return 8;
                    156:     return (bplcon0 >> 12) & 7;
                    157: }
                    158: 
                    159: extern void fpscounter_reset (void);
                    160: extern unsigned long idletime;
                    161: extern int lightpen_x, lightpen_y, lightpen_cx, lightpen_cy;
                    162: 
                    163: struct customhack {
                    164:     uae_u16 v;
                    165:     int vpos, hpos;
                    166: };
                    167: void customhack_put (struct customhack *ch, uae_u16 v, int hpos);
                    168: uae_u16 customhack_get (struct customhack *ch, int hpos);
                    169: extern void alloc_cycle_ext (int, int);
                    170: extern bool ispal (void);
                    171: extern int inprec_open(char *fname, int record);
                    172: extern void sleep_millis (int ms);
                    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 */
1.1.1.4 ! root      181: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.