comparison vgmplay.c @ 803:236a184bf6f0

Merge
author Michael Pavone <pavone@retrodev.com>
date Sun, 26 Jul 2015 16:51:03 -0700
parents 9aff36a172b2
children 3eced113081c
comparison
equal deleted inserted replaced
802:6811f601008f 803:236a184bf6f0
5 */ 5 */
6 #include "render.h" 6 #include "render.h"
7 #include "ym2612.h" 7 #include "ym2612.h"
8 #include "psg.h" 8 #include "psg.h"
9 #include "config.h" 9 #include "config.h"
10 #include "util.h"
10 #include <stdint.h> 11 #include <stdint.h>
11 #include <stdio.h> 12 #include <stdio.h>
12 13
13 #define MCLKS_NTSC 53693175 14 #define MCLKS_NTSC 53693175
14 #define MCLKS_PAL 53203395 15 #define MCLKS_PAL 53203395
140 uint32_t seek_offset; 141 uint32_t seek_offset;
141 uint32_t block_offset; 142 uint32_t block_offset;
142 143
143 uint32_t fps = 60; 144 uint32_t fps = 60;
144 config = load_config(argv[0]); 145 config = load_config(argv[0]);
145 render_init(320, 240, "vgm play", 60, 0, 0); 146 render_init(320, 240, "vgm play", 60, 0);
146 147
147 uint32_t opts = 0; 148 uint32_t opts = 0;
148 if (argc >= 3 && !strcmp(argv[2], "-y")) { 149 if (argc >= 3 && !strcmp(argv[2], "-y")) {
149 opts |= YM_OPT_WAVE_LOG; 150 opts |= YM_OPT_WAVE_LOG;
150 } 151 }
280 { 281 {
281 wait_time *= mclks_sample; 282 wait_time *= mclks_sample;
282 wait(&y_context, &p_context, &current_cycle, wait_time); 283 wait(&y_context, &p_context, &current_cycle, wait_time);
283 } 284 }
284 } else { 285 } else {
285 printf("unimplemented command: %X at offset %X\n", cmd, (unsigned int)(cur - data - 1)); 286 fatal_error("unimplemented command: %X at offset %X\n", cmd, (unsigned int)(cur - data - 1));
286 exit(1);
287 } 287 }
288 } 288 }
289 } 289 }
290 return 0; 290 return 0;
291 } 291 }