@@ -288,10 +288,6 @@ crt_init(struct CRT *v, int w, int h, int f, unsigned char *out)
288288
289289}
290290
291- /* search windows, in samples */
292- #define HSYNC_WINDOW 6
293- #define VSYNC_WINDOW 6
294-
295291extern void
296292crt_demodulate (struct CRT * v , int noise )
297293{
@@ -344,7 +340,7 @@ crt_demodulate(struct CRT *v, int noise)
344340 * The signal needs to be integrated to lessen
345341 * the noise in the signal.
346342 */
347- for (i = - VSYNC_WINDOW ; i < VSYNC_WINDOW ; i ++ ) {
343+ for (i = - CRT_VSYNC_WINDOW ; i < CRT_VSYNC_WINDOW ; i ++ ) {
348344 line = POSMOD (v -> vsync + i , CRT_VRES );
349345 sig = v -> inp + line * CRT_HRES ;
350346 s = 0 ;
@@ -353,7 +349,7 @@ crt_demodulate(struct CRT *v, int noise)
353349 /* increase the multiplier to make the vsync
354350 * more stable when there is a lot of noise
355351 */
356- if (s <= (94 * SYNC_LEVEL )) {
352+ if (s <= (CRT_VSYNC_THRESH * SYNC_LEVEL )) {
357353 goto vsync_found ;
358354 }
359355 }
@@ -407,9 +403,9 @@ crt_demodulate(struct CRT *v, int noise)
407403 ln = (POSMOD (line + v -> vsync , CRT_VRES )) * CRT_HRES ;
408404 sig = v -> inp + ln + v -> hsync ;
409405 s = 0 ;
410- for (i = - HSYNC_WINDOW ; i < HSYNC_WINDOW ; i ++ ) {
406+ for (i = - CRT_HSYNC_WINDOW ; i < CRT_HSYNC_WINDOW ; i ++ ) {
411407 s += sig [SYNC_BEG + i ];
412- if (s <= (4 * SYNC_LEVEL )) {
408+ if (s <= (CRT_HSYNC_THRESH * SYNC_LEVEL )) {
413409 break ;
414410 }
415411 }
0 commit comments