From: Toni Wilen Date: Tue, 16 May 2023 17:02:04 +0000 (+0300) Subject: framecounter change X-Git-Tag: 5.0.0~36 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=820bee3da90406792e4a6ace109d424824b8df38;p=francis%2Fwinuae.git framecounter change --- diff --git a/custom.cpp b/custom.cpp index 6b5ae6ab..8719083e 100644 --- a/custom.cpp +++ b/custom.cpp @@ -11428,7 +11428,7 @@ static int calculate_lineno(int vp) lineno++; } else if (!interlace_seen && doublescan <= 0 && currprefs.gfx_vresolution && currprefs.gfx_pscanlines > 1) { lineno *= 2; - if (timeframes & 1) { + if (vsync_counter & 1) { lineno++; nextline_how = currprefs.gfx_pscanlines == 3 ? nln_lower_black_always : nln_lower_black; } else { @@ -14384,9 +14384,9 @@ void dumpcustom(void) bplcon0, bplcon1, bplcon2, bplcon3, bplcon4, lof_display, lof_store, hdiwstate == diw_states::DIW_waiting_start ? 0 : 1, vdiwstate == diw_states::DIW_waiting_start ? 0 : 1); - if (timeframes) { + if (timeframes && vsync_counter) { console_out_f(_T("Average frame time: %.2f ms [frames: %d time: %d]\n"), - (double)frametime / timeframes, timeframes, frametime); + (double)frametime / timeframes, vsync_counter, frametime); if (total_skipped) console_out_f(_T("Skipped frames: %d\n"), total_skipped); } diff --git a/debug.cpp b/debug.cpp index a7e18296..f590e727 100644 --- a/debug.cpp +++ b/debug.cpp @@ -2177,7 +2177,7 @@ void record_dma_write(uae_u16 reg, uae_u32 dat, uae_u32 addr, int hpos, int vpos return; dr = &dma_record[dma_record_toggle][vpos * NR_DMA_REC_HPOS + hpos]; - dma_record_frame[dma_record_toggle] = timeframes; + dma_record_frame[dma_record_toggle] = vsync_counter; if (dr->reg != 0xffff) { dr->cf_reg = reg; dr->cf_dat = dat; @@ -2268,7 +2268,7 @@ void record_cia_access(int r, int mask, uae_u16 value, bool rw, int hpos, int vp return; dr = &dma_record[dma_record_toggle][vpos * NR_DMA_REC_HPOS + hpos]; - dma_record_frame[dma_record_toggle] = timeframes; + dma_record_frame[dma_record_toggle] = vsync_counter; if (dr->ciaphase < 0) { return; @@ -2295,7 +2295,7 @@ void record_dma_read(uae_u16 reg, uae_u32 addr, int hpos, int vpos, int type, in return; dr = &dma_record[dma_record_toggle][vpos * NR_DMA_REC_HPOS + hpos]; - dma_record_frame[dma_record_toggle] = timeframes; + dma_record_frame[dma_record_toggle] = vsync_counter; if (dr->reg != 0xffff) { if (dr->reg != reg) { dma_conflict(vpos, hp, dr, reg, false); @@ -7436,7 +7436,7 @@ void debug (void) debugmem_disable(); if (trace_cycles && last_frame >= 0) { - if (last_frame + 2 >= timeframes || trace_cycles > 1) { + if (last_frame + 2 >= vsync_counter || trace_cycles > 1) { evt_t c = last_cycles2 - last_cycles1; uae_u32 cc; if (c >= 0x7fffffff) { diff --git a/newcpu.cpp b/newcpu.cpp index bf74d135..83dfed6f 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -4633,8 +4633,8 @@ static int do_specialties (int cycles) x_do_cycles(8 * CYCLE_UNIT); if (regs.spcflags & SPCFLAG_COPPER) do_copper(); - if (timeframes != vsyncstate) { - vsyncstate = timeframes; + if (vsync_counter != vsyncstate) { + vsyncstate = vsync_counter; vsynccnt--; } } @@ -5300,8 +5300,8 @@ static void run_cpu_thread(void (*f)(void *)) break; } - if (framecnt != timeframes) { - framecnt = timeframes; + if (framecnt != vsync_counter) { + framecnt = vsync_counter; } if (cpu_thread_reset) { diff --git a/od-win32/avioutput.cpp b/od-win32/avioutput.cpp index add6a748..690dd382 100644 --- a/od-win32/avioutput.cpp +++ b/od-win32/avioutput.cpp @@ -1818,7 +1818,7 @@ bool frame_drawn(int monid) StreamSizeAudioExpected += ((float)wfxSrc.Format.nSamplesPerSec) / fps_in_use; if (avioutput_video) { int idiff = (int)(StreamSizeAudioGot - StreamSizeAudioExpected); - if ((timeframes % 5) == 0) + if ((vsync_counter % 5) == 0) write_log(_T("%.1f %.1f %d\n"), StreamSizeAudioExpected, StreamSizeAudioGot, idiff); if (idiff) { StreamSizeAudioGot = StreamSizeAudioExpected; diff --git a/od-win32/direct3d.cpp b/od-win32/direct3d.cpp index c9ae0569..969f34bb 100644 --- a/od-win32/direct3d.cpp +++ b/od-win32/direct3d.cpp @@ -1113,7 +1113,7 @@ static int psEffect_SetTextures (LPDIRECT3DTEXTURE9 lpSource, struct shaderdata } } if (s->framecounterHandle) - s->pEffect->SetFloat(s->framecounterHandle, (FLOAT)timeframes); + s->pEffect->SetFloat(s->framecounterHandle, (FLOAT)vsync_counter); return 1; } @@ -3446,7 +3446,7 @@ static void D3D_render2(struct d3dstruct *d3d, int mode, int monid) texelsize.z = 1; texelsize.w = 1; hr = postEffect->SetVector (d3d->postTexelSize, &texelsize); if (d3d->postFramecounterHandle) - postEffect->SetFloat(d3d->postFramecounterHandle, (FLOAT)timeframes); + postEffect->SetFloat(d3d->postFramecounterHandle, (FLOAT)vsync_counter); if (masktexture) { if (FAILED (hr = postEffect->SetTechnique (d3d->postTechnique))) diff --git a/od-win32/direct3d11.cpp b/od-win32/direct3d11.cpp index 1f1643c8..128b8e16 100644 --- a/od-win32/direct3d11.cpp +++ b/od-win32/direct3d11.cpp @@ -1295,7 +1295,7 @@ static int psEffect_SetTextures(ID3D11Texture2D *lpSourceTex, ID3D11ShaderResour s->m_ScaleEffectHandle->SetFloatVector((float*)&fScale); } if (s->framecounterHandle) { - s->framecounterHandle->SetFloat((float)timeframes); + s->framecounterHandle->SetFloat((float)vsync_counter); } return 1; diff --git a/od-win32/lcd.cpp b/od-win32/lcd.cpp index c93f2e77..6eebb43e 100644 --- a/od-win32/lcd.cpp +++ b/od-win32/lcd.cpp @@ -26,8 +26,6 @@ static volatile int lcd_thread_active; static volatile bool lcd_updated; int logitech_lcd = 1; -extern unsigned long timeframes; - // Do it this way because stupid LogitechLCDLib.lib LogiLcdInit() refuses to link. typedef bool(__cdecl *LOGILCDINIT)(const wchar_t*, int); diff --git a/sana2.cpp b/sana2.cpp index 6d52f70d..e865f5c1 100644 --- a/sana2.cpp +++ b/sana2.cpp @@ -1687,8 +1687,8 @@ static int uaenet_int_handler2(TrapContext *ctx) } while (p) { if (p->drop_start == 0) - p->drop_start = timeframes; - p->drop_count = timeframes; + p->drop_start = vsync_counter; + p->drop_count = vsync_counter; p = p->next; } break;