]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
framecounter change
authorToni Wilen <twilen@winuae.net>
Tue, 16 May 2023 17:02:04 +0000 (20:02 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 16 May 2023 17:02:04 +0000 (20:02 +0300)
custom.cpp
debug.cpp
newcpu.cpp
od-win32/avioutput.cpp
od-win32/direct3d.cpp
od-win32/direct3d11.cpp
od-win32/lcd.cpp
sana2.cpp

index 6b5ae6ab924c47f80373620d47b18960d4c5c3f5..8719083e083223cae7d8a30d904bcd31384e5245 100644 (file)
@@ -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);
        }
index a7e182968bf78e8f7570f08540c5cb3b15827c0c..f590e727b40b440f22b8f755acdbd966f5ea8a91 100644 (file)
--- 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) {
index bf74d13590904edfb6c43b8feb7c1f845ecea64c..83dfed6fcbebcb09c02b8436038bca65c46b0702 100644 (file)
@@ -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) {
index add6a7486105654d3207574b49d38a019adef90f..690dd3821110d09f0f0974daa57953620115f9ee 100644 (file)
@@ -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;
index c9ae056973699b381fafbef80eabbee61f7275f7..969f34bb2a90c0f38b2b69b71f86cf322a7e6301 100644 (file)
@@ -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)))
index 1f1643c89e4ec0f11baebafec13afadaaaf905fb..128b8e16a3893cb8e80c6885033cf7745a28e6e1 100644 (file)
@@ -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;
index c93f2e77a2f608cfcf98ac3a33e0cfed2d4ecdf9..6eebb43e7309f5d7cfaea5c6a07cf50c3ca7eba7 100644 (file)
@@ -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);
index 6d52f70de99c29eafbabfbee02c76cb42a99a3d6..e865f5c16ed1eacc691470751d41cae18d2f330a 100644 (file)
--- 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;