--- uae/src/include/drawing.h 2018/04/24 16:45:11 1.1.1.3 +++ uae/src/include/drawing.h 2018/04/24 16:50:22 1.1.1.6 @@ -29,17 +29,25 @@ #define MAX_PLANES 6 #endif +#define RES_LORES 0 +#define RES_HIRES 1 +#define RES_SUPERHIRES 2 + +/* calculate shift depending on resolution (replaced "decided_hires ? 4 : 8") (TW) */ +#define RES_SHIFT(res) ((res) == RES_LORES ? 8 : (res) == RES_HIRES ? 4 : 2) +#define RES_ADJUST(res) ((res) == RES_LORES ? 8 : (res) == RES_HIRES ? 4 : 2) + /* 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 PIXEL_XPOS(HPOS) (((HPOS)*2 - DISPLAY_LEFT_SHIFT) << lores_shift) /* @@@ Is maxhpos + 4 - 1 correct? (4 less isn't enough) */ -#define max_diwlastword (PIXEL_XPOS(maxhpos + 4 -1)) +#define max_diwlastword (PIXEL_XPOS(maxhpos + 4 - 1)) extern int lores_factor, lores_shift, sprite_width; -static __inline__ int coord_hw_to_native_x (int x) +STATIC_INLINE int coord_hw_to_native_x (int x) { x -= DISPLAY_LEFT_SHIFT; return x << lores_shift; @@ -89,7 +97,7 @@ struct delay_change { }; /* Way too much... */ -#define MAX_REG_CHANGE ((maxvpos+1) * 2 * maxhpos) +#define MAX_REG_CHANGE ((MAXVPOS + 1) * 2 * MAXHPOS) #ifdef OS_WITHOUT_MEMORY_MANAGEMENT extern struct sprite_draw *sprite_positions[2]; @@ -103,7 +111,7 @@ extern struct color_change color_changes extern struct delay_change delay_changes[MAX_REG_CHANGE]; #endif -extern struct color_entry color_tables[2][(maxvpos+1) * 2]; +extern struct color_entry color_tables[2][(MAXVPOS+1) * 2]; extern struct color_entry *curr_color_tables, *prev_color_tables; extern struct sprite_draw *curr_sprite_positions, *prev_sprite_positions; @@ -141,10 +149,10 @@ struct draw_info { int nr_color_changes, nr_sprites; }; -extern struct decision line_decisions[2 * (maxvpos+1) + 1]; -extern struct draw_info line_drawinfo[2][2 * (maxvpos+1) + 1]; +extern struct decision line_decisions[2 * (MAXVPOS+1) + 1]; +extern struct draw_info line_drawinfo[2][2 * (MAXVPOS+1) + 1]; -extern uae_u8 line_data[(maxvpos+1) * 2][MAX_PLANES * MAX_WORDS_PER_LINE * 2]; +extern uae_u8 line_data[(MAXVPOS+1) * 2][MAX_PLANES * MAX_WORDS_PER_LINE * 2]; /* Functions in drawing.c. */ extern int coord_native_to_amiga_y (int); @@ -189,15 +197,15 @@ extern int diwfirstword,diwlastword; extern int inhibit_frame; -static __inline__ void set_inhibit_frame (int bit) +STATIC_INLINE void set_inhibit_frame (int bit) { inhibit_frame |= 1 << bit; } -static __inline__ void clear_inhibit_frame (int bit) +STATIC_INLINE void clear_inhibit_frame (int bit) { inhibit_frame &= ~(1 << bit); } -static __inline__ void toggle_inhibit_frame (int bit) +STATIC_INLINE void toggle_inhibit_frame (int bit) { inhibit_frame ^= ~(1 << bit); }