comparison blastem.c @ 407:c3abc4ada43d

Add support for logging YM2612 channels to WAVE files
author Mike Pavone <pavone@retrodev.com>
date Sun, 16 Jun 2013 17:57:57 -0700
parents 042c4ba4a838
children dbf4e1c86f3c
comparison
equal deleted inserted replaced
406:b1bc1947d949 407:c3abc4ada43d
1917 } 1917 }
1918 detect_region(); 1918 detect_region();
1919 int width = -1; 1919 int width = -1;
1920 int height = -1; 1920 int height = -1;
1921 int debug = 0; 1921 int debug = 0;
1922 int ym_log = 0;
1922 FILE *address_log = NULL; 1923 FILE *address_log = NULL;
1923 for (int i = 2; i < argc; i++) { 1924 for (int i = 2; i < argc; i++) {
1924 if (argv[i][0] == '-') { 1925 if (argv[i][0] == '-') {
1925 switch(argv[i][1]) { 1926 switch(argv[i][1]) {
1926 case 'd': 1927 case 'd':
1961 default: 1962 default:
1962 fprintf(stderr, "'%c' is not a valid region character for the -r option\n", argv[i][0]); 1963 fprintf(stderr, "'%c' is not a valid region character for the -r option\n", argv[i][0]);
1963 return 1; 1964 return 1;
1964 } 1965 }
1965 break; 1966 break;
1967 case 'y':
1968 ym_log = 1;
1969 break;
1966 default: 1970 default:
1967 fprintf(stderr, "Unrecognized switch %s\n", argv[i]); 1971 fprintf(stderr, "Unrecognized switch %s\n", argv[i]);
1968 return 1; 1972 return 1;
1969 } 1973 }
1970 } else if (width < 0) { 1974 } else if (width < 0) {
1987 vdp_context v_context; 1991 vdp_context v_context;
1988 1992
1989 init_vdp_context(&v_context); 1993 init_vdp_context(&v_context);
1990 1994
1991 ym2612_context y_context; 1995 ym2612_context y_context;
1992 ym_init(&y_context, render_sample_rate(), fps == 60 ? MCLKS_NTSC : MCLKS_PAL, MCLKS_PER_YM, render_audio_buffer()); 1996 ym_init(&y_context, render_sample_rate(), fps == 60 ? MCLKS_NTSC : MCLKS_PAL, MCLKS_PER_YM, render_audio_buffer(), ym_log ? YM_OPT_WAVE_LOG : 0);
1993 1997
1994 psg_context p_context; 1998 psg_context p_context;
1995 psg_init(&p_context, render_sample_rate(), fps == 60 ? MCLKS_NTSC : MCLKS_PAL, MCLKS_PER_PSG, render_audio_buffer()); 1999 psg_init(&p_context, render_sample_rate(), fps == 60 ? MCLKS_NTSC : MCLKS_PAL, MCLKS_PER_PSG, render_audio_buffer());
1996 2000
1997 z80_context z_context; 2001 z80_context z_context;