--- uae/src/include/drawing.h 2018/04/24 16:57:05 1.1.1.9 +++ uae/src/include/drawing.h 2018/04/24 17:06:02 1.1.1.12 @@ -26,10 +26,10 @@ /* We ignore that many lores pixels at the start of the display. These are * invisible anyway due to hardware DDF limits. */ -#define DISPLAY_LEFT_SHIFT 0x38 +#define DISPLAY_LEFT_SHIFT 0x40 #define PIXEL_XPOS(HPOS) (((HPOS)*2 - DISPLAY_LEFT_SHIFT + DIW_DDF_OFFSET - 1) << lores_shift) -#define max_diwlastword (PIXEL_XPOS(maxhpos)) +#define max_diwlastword (PIXEL_XPOS(maxhpos) + 16) extern int lores_factor, lores_shift, sprite_width; @@ -39,11 +39,23 @@ STATIC_INLINE int coord_hw_to_window_x ( return x << lores_shift; } +STATIC_INLINE int coord_window_to_hw_x (int x) +{ + x >>= lores_shift; + return x + DISPLAY_LEFT_SHIFT; +} + STATIC_INLINE int coord_diw_to_window_x (int x) { return (x - DISPLAY_LEFT_SHIFT + DIW_DDF_OFFSET - 1) << lores_shift; } +STATIC_INLINE int coord_window_to_diw_x (int x) +{ + x = coord_window_to_hw_x (x); + return x - DIW_DDF_OFFSET; +} + extern int framecnt; @@ -122,7 +134,11 @@ struct color_change { }; /* 440 rather than 880, since sprites are always lores. */ -#define MAX_SPR_PIXELS (((MAXVPOS + 1)*2 + 1) * 440) +#define MAX_PIXELS_PER_LINE 1760 + +/* No divisors for MAX_PIXELS_PER_LINE; we support AGA and may one day + want to use SHRES sprites. */ +#define MAX_SPR_PIXELS (((MAXVPOS + 1)*2 + 1) * MAX_PIXELS_PER_LINE) struct sprite_entry { @@ -165,14 +181,14 @@ struct decision { int ctable; uae_u16 bplcon0, bplcon2; - uae_u16 fmode, bplcon4; + uae_u16 bplcon3, bplcon4; uae_u8 nr_planes; uae_u8 bplres; + unsigned int any_hires_sprites:1; + unsigned int ham_seen:1; + unsigned int ham_at_start:1; }; -extern int fetchmode, prefetch, fetchsize, fetchstart, fetchstart_shift; -extern void expand_fetchmodes (int, int); - /* Anything related to changes in hw registers during the DDF for one * line. */ struct draw_info { @@ -222,8 +238,6 @@ extern void notice_interlace_seen (void) /* Finally, stuff that shouldn't really be shared. */ extern int thisframe_first_drawn_line, thisframe_last_drawn_line; -extern uae_u16 clxdat, clxcon; -extern int clx_sprmask; extern int diwfirstword,diwlastword; #define IHF_SCROLLLOCK 0