Minor fixes for auto height

This commit is contained in:
Dimitris Panokostas 2020-05-26 00:48:38 +02:00
parent acdb252c6a
commit 018e28d4b8
3 changed files with 22 additions and 19 deletions

View file

@ -4657,12 +4657,12 @@ void init_hz_normal (void)
init_hz (false);
}
// ric - for auto zoom
// for auto zoom
int hstrt;
int hstop;
int vstrt;
int vstop;
//end ric
static void calcdiw (void)
{
hstrt = (diwstrt & 0xFF) << 2;
@ -7262,9 +7262,9 @@ static void do_sprites (int hpos)
if (minspr == maxspr)
return;
for (int i = minspr; i <= maxspr; i++) {
int cycle = -1;
int num = (i - SPR0_HPOS) / 4;
for (auto i = minspr; i <= maxspr; i++) {
auto cycle = -1;
const auto num = (i - SPR0_HPOS) / 4;
switch ((i - SPR0_HPOS) & 3)
{
case 0:
@ -7286,8 +7286,9 @@ static void do_sprites (int hpos)
static void init_sprites (void)
{
for (int i = 0; i < MAX_SPRITES; i++) {
struct sprite *s = &spr[i];
for (auto& i : spr)
{
auto* const s = &i;
s->pos = 0;
s->ctl = 0;
}
@ -7336,9 +7337,10 @@ static void init_hardware_frame (void)
first_bplcon0 = 0;
autoscale_bordercolors = 0;
for (int i = 0; i < MAX_SPRITES; i++) {
spr[i].ptxhpos = MAXHPOS;
spr[i].ptxvpos2 = -1;
for (auto& i : spr)
{
i.ptxhpos = MAXHPOS;
i.ptxvpos2 = -1;
}
plf_state = plf_end;
}

View file

@ -3279,12 +3279,12 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in
static void center_image(void)
{
struct amigadisplay* ad = &adisplays;
struct vidbuf_description* vidinfo = &ad->gfxvidinfo;
int prev_x_adjust = visible_left_border;
int prev_y_adjust = thisframe_y_adjust;
auto ad = &adisplays;
auto vidinfo = &ad->gfxvidinfo;
auto prev_x_adjust = visible_left_border;
auto prev_y_adjust = thisframe_y_adjust;
int w = vidinfo->drawbuffer.inwidth;
auto w = vidinfo->drawbuffer.inwidth;
if (currprefs.gfx_xcenter && !currprefs.gf[0].gfx_filter_autoscale && max_diwstop > 0) {
if (max_diwstop - min_diwstart < w && currprefs.gfx_xcenter == 2)

View file

@ -717,17 +717,17 @@ void flush_screen(struct vidbuffer* vidbuffer, int ystart, int ystop)
{
if (vidbuffer->bufmem == nullptr) return; // no buffer allocated return
static int last_g_autozoom;
static int last_autoheight;
if (currprefs.gfx_auto_height)
{
static int last_vstrt, last_vstop, new_height;
if (last_g_autozoom != currprefs.gfx_auto_height || last_vstrt != vstrt || last_vstop != vstop)
if (last_autoheight != currprefs.gfx_auto_height || last_vstrt != vstrt || last_vstop != vstop)
{
last_vstrt = vstrt;
last_vstop = vstop;
auto start_y = minfirstline; // minfirstline = first line to be written to screen buffer
auto stop_y = 270 + minfirstline; // last line to be written to screen buffer
auto stop_y = 274 + minfirstline; // last line to be written to screen buffer
if (vstrt > minfirstline)
start_y = vstrt; // if vstrt > minfirstline then there is a black border
if (start_y > 200)
@ -736,6 +736,7 @@ void flush_screen(struct vidbuffer* vidbuffer, int ystart, int ystop)
stop_y = vstop; // if vstop < stop_y then there is a black border
new_height = stop_y - start_y;
if (new_height < 200)
new_height = 200;
if (new_height != currprefs.gfx_monitor.gfx_size.height)
@ -748,7 +749,7 @@ void flush_screen(struct vidbuffer* vidbuffer, int ystart, int ystop)
}
}
last_g_autozoom = currprefs.gfx_auto_height;
last_autoheight = currprefs.gfx_auto_height;
}
void update_display(struct uae_prefs* p)