annotate vgmplay.c @ 803:236a184bf6f0

Merge
author Michael Pavone <pavone@retrodev.com>
date Sun, 26 Jul 2015 16:51:03 -0700
parents 9aff36a172b2
children 3eced113081c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
467
140af5509ce7 Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents: 466
diff changeset
1 /*
140af5509ce7 Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents: 466
diff changeset
2 Copyright 2013 Michael Pavone
505
b7b7a1cab44a The local clone on my laptop got messed up and some changes had not been pushed. This commit represents the status of the working copy from that clone. It unfortunately contains some changes that I did not intend to commit yet, but this seems like the best option at the moment.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
3 This file is part of BlastEm.
467
140af5509ce7 Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents: 466
diff changeset
4 BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text.
140af5509ce7 Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents: 466
diff changeset
5 */
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
6 #include "render.h"
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
7 #include "ym2612.h"
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
8 #include "psg.h"
466
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
9 #include "config.h"
793
9aff36a172b2 Fix missing includes of util.h
Michael Pavone <pavone@retrodev.com>
parents: 792
diff changeset
10 #include "util.h"
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
11 #include <stdint.h>
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
12 #include <stdio.h>
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
13
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
14 #define MCLKS_NTSC 53693175
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
15 #define MCLKS_PAL 53203395
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
16
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
17 #define MCLKS_PER_68K 7
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
18 #define MCLKS_PER_YM MCLKS_PER_68K
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
19 #define MCLKS_PER_Z80 15
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
20 #define MCLKS_PER_PSG (MCLKS_PER_Z80*16)
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
21
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
22 #pragma pack(push, 1)
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
23 typedef struct {
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
24 char ident[4];
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
25 uint32_t eof_offset;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
26 uint32_t version;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
27 uint32_t sn76489_clk;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
28 uint32_t ym2413_clk;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
29 uint32_t gd3_offset;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
30 uint32_t num_samples;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
31 uint32_t loop_offset;
514
f66c78cbdcaa Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents: 512
diff changeset
32 uint32_t loop_samples;
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
33 uint32_t rate;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
34 uint16_t sn76489_fb;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
35 uint8_t sn76489_shift;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
36 uint8_t sn76489_flags;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
37 uint32_t ym2612_clk;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
38 uint32_t ym2151_clk;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
39 uint32_t data_offset;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
40 uint32_t sega_pcm_clk;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
41 uint32_t sega_pcm_reg;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
42 } vgm_header;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
43
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
44 enum {
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
45 CMD_PSG_STEREO = 0x4F,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
46 CMD_PSG,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
47 CMD_YM2413,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
48 CMD_YM2612_0,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
49 CMD_YM2612_1,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
50 CMD_YM2151,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
51 CMD_YM2203,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
52 CMD_YM2608_0,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
53 CMD_YM2608_1,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
54 CMD_YM2610_0,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
55 CMD_YM2610_1,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
56 CMD_YM3812,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
57 CMD_YM3526,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
58 CMD_Y8950,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
59 CMD_YMZ280B,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
60 CMD_YMF262_0,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
61 CMD_YMF262_1,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
62 CMD_WAIT = 0x61,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
63 CMD_WAIT_60,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
64 CMD_WAIT_50,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
65 CMD_END = 0x66,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
66 CMD_DATA,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
67 CMD_PCM_WRITE,
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
68 CMD_WAIT_SHORT = 0x70,
511
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
69 CMD_YM2612_DAC = 0x80,
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
70 CMD_DAC_STREAM_SETUP = 0x90,
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
71 CMD_DAC_STREAM_DATA,
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
72 CMD_DAC_STREAM_FREQ,
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
73 CMD_DAC_STREAM_START,
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
74 CMD_DAC_STREAM_STOP,
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
75 CMD_DAC_STREAM_STARTFAST,
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
76 CMD_DATA_SEEK = 0xE0
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
77 };
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
78
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
79 enum {
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
80 DATA_YM2612_PCM = 0
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
81 };
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
82
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
83 #pragma pack(pop)
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
84
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
85 void handle_keydown(int keycode)
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
86 {
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
87 }
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
88
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
89 void handle_keyup(int keycode)
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
90 {
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
91 }
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
92
466
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
93 void handle_joydown(int joystick, int button)
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
94 {
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
95 }
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
96
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
97 void handle_joyup(int joystick, int button)
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
98 {
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
99 }
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
100
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
101 void handle_joy_dpad(int joystick, int dpadnum, uint8_t value)
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
102 {
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
103 }
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
104
551
16ee0937c676 Fix type mismatch on headless global that was causing a crash in the vgm player on ARM
Michael Pavone <pavone@retrodev.com>
parents: 514
diff changeset
105 int headless = 0;
505
b7b7a1cab44a The local clone on my laptop got messed up and some changes had not been pushed. This commit represents the status of the working copy from that clone. It unfortunately contains some changes that I did not intend to commit yet, but this seems like the best option at the moment.
Michael Pavone <pavone@retrodev.com>
parents: 467
diff changeset
106
409
c1bddeadc566 Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents: 408
diff changeset
107 #define CYCLE_LIMIT MCLKS_NTSC/60
511
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
108 #define MAX_SOUND_CYCLES 100000
466
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
109 tern_node * config;
409
c1bddeadc566 Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents: 408
diff changeset
110
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
111 void wait(ym2612_context * y_context, psg_context * p_context, uint32_t * current_cycle, uint32_t cycles)
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
112 {
511
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
113 while (cycles > MAX_SOUND_CYCLES)
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
114 {
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
115 wait(y_context, p_context, current_cycle, MAX_SOUND_CYCLES);
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
116 cycles -= MAX_SOUND_CYCLES;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
117 }
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
118 *current_cycle += cycles;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
119 psg_run(p_context, *current_cycle);
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
120 ym_run(y_context, *current_cycle);
466
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
121
409
c1bddeadc566 Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents: 408
diff changeset
122 if (*current_cycle > CYCLE_LIMIT) {
c1bddeadc566 Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents: 408
diff changeset
123 *current_cycle -= CYCLE_LIMIT;
c1bddeadc566 Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents: 408
diff changeset
124 p_context->cycles -= CYCLE_LIMIT;
c1bddeadc566 Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents: 408
diff changeset
125 y_context->current_cycle -= CYCLE_LIMIT;
c1bddeadc566 Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents: 408
diff changeset
126 process_events();
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
127 }
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
128 }
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
129
511
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
130 typedef struct {
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
131 struct data_block *next;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
132 uint8_t *data;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
133 uint32_t size;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
134 uint8_t type;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
135 } data_block;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
136
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
137 int main(int argc, char ** argv)
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
138 {
511
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
139 data_block *blocks = NULL;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
140 data_block *seek_block = NULL;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
141 uint32_t seek_offset;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
142 uint32_t block_offset;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
143
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
144 uint32_t fps = 60;
466
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
145 config = load_config(argv[0]);
719
019d27995e32 Upgrade to SDL 2.0 and drop support for the non-OpenGL render path
Michael Pavone <pavone@retrodev.com>
parents: 551
diff changeset
146 render_init(320, 240, "vgm play", 60, 0);
466
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
147
514
f66c78cbdcaa Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents: 512
diff changeset
148 uint32_t opts = 0;
f66c78cbdcaa Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents: 512
diff changeset
149 if (argc >= 3 && !strcmp(argv[2], "-y")) {
f66c78cbdcaa Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents: 512
diff changeset
150 opts |= YM_OPT_WAVE_LOG;
f66c78cbdcaa Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents: 512
diff changeset
151 }
466
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
152
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
153 ym2612_context y_context;
514
f66c78cbdcaa Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents: 512
diff changeset
154 ym_init(&y_context, render_sample_rate(), MCLKS_NTSC, MCLKS_PER_YM, render_audio_buffer(), opts);
466
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
155
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
156 psg_context p_context;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
157 psg_init(&p_context, render_sample_rate(), MCLKS_NTSC, MCLKS_PER_PSG, render_audio_buffer());
466
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
158
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
159 FILE * f = fopen(argv[1], "rb");
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
160 vgm_header header;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
161 fread(&header, sizeof(header), 1, f);
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
162 if (header.version < 0x150 || !header.data_offset) {
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
163 header.data_offset = 0xC;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
164 }
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
165 fseek(f, header.data_offset + 0x34, SEEK_SET);
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
166 uint32_t data_size = header.eof_offset + 4 - (header.data_offset + 0x34);
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
167 uint8_t * data = malloc(data_size);
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
168 fread(data, 1, data_size, f);
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
169 fclose(f);
466
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
170
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
171 uint32_t mclks_sample = MCLKS_NTSC / 44100;
514
f66c78cbdcaa Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents: 512
diff changeset
172 uint32_t loop_count = 2;
466
bc9e0829ffc7 Fix vgmplay
Mike Pavone <pavone@retrodev.com>
parents: 409
diff changeset
173
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
174 uint8_t * end = data + data_size;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
175 uint8_t * cur = data;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
176 uint32_t current_cycle = 0;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
177 while (cur < end) {
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
178 uint8_t cmd = *(cur++);
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
179 switch(cmd)
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
180 {
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
181 case CMD_PSG_STEREO:
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
182 //ignore for now
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
183 cur++;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
184 break;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
185 case CMD_PSG:
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
186 psg_write(&p_context, *(cur++));
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
187 break;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
188 case CMD_YM2612_0:
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
189 ym_address_write_part1(&y_context, *(cur++));
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
190 ym_data_write(&y_context, *(cur++));
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
191 break;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
192 case CMD_YM2612_1:
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
193 ym_address_write_part2(&y_context, *(cur++));
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
194 ym_data_write(&y_context, *(cur++));
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
195 break;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
196 case CMD_WAIT: {
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
197 uint32_t wait_time = *(cur++);
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
198 wait_time |= *(cur++) << 8;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
199 wait_time *= mclks_sample;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
200 wait(&y_context, &p_context, &current_cycle, wait_time);
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
201 break;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
202 }
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
203 case CMD_WAIT_60:
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
204 wait(&y_context, &p_context, &current_cycle, 735 * mclks_sample);
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
205 break;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
206 case CMD_WAIT_50:
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
207 wait(&y_context, &p_context, &current_cycle, 882 * mclks_sample);
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
208 break;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
209 case CMD_END:
514
f66c78cbdcaa Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents: 512
diff changeset
210 if (header.loop_offset && --loop_count) {
f66c78cbdcaa Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents: 512
diff changeset
211 cur = data + header.loop_offset + 0x1C - (header.data_offset + 0x34);
f66c78cbdcaa Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents: 512
diff changeset
212 } else {
f66c78cbdcaa Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents: 512
diff changeset
213 //TODO: fade out
f66c78cbdcaa Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents: 512
diff changeset
214 return 0;
f66c78cbdcaa Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents: 512
diff changeset
215 }
f66c78cbdcaa Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents: 512
diff changeset
216 break;
511
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
217 case CMD_DATA: {
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
218 cur++; //skip compat command
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
219 uint8_t data_type = *(cur++);
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
220 uint32_t data_size = *(cur++);
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
221 data_size |= *(cur++) << 8;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
222 data_size |= *(cur++) << 16;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
223 data_size |= *(cur++) << 24;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
224 if (data_type == DATA_YM2612_PCM) {
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
225 data_block ** curblock = &blocks;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
226 while(*curblock)
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
227 {
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
228 curblock = &((*curblock)->next);
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
229 }
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
230 *curblock = malloc(sizeof(data_block));
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
231 (*curblock)->size = data_size;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
232 (*curblock)->type = data_type;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
233 (*curblock)->data = cur;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
234 (*curblock)->next = NULL;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
235 } else {
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
236 fprintf(stderr, "Skipping data block with unrecognized type %X\n", data_type);
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
237 }
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
238 cur += data_size;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
239 break;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
240 }
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
241 case CMD_DATA_SEEK: {
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
242 uint32_t new_offset = *(cur++);
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
243 new_offset |= *(cur++) << 8;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
244 new_offset |= *(cur++) << 16;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
245 new_offset |= *(cur++) << 24;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
246 if (!seek_block || new_offset < seek_offset) {
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
247 seek_block = blocks;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
248 seek_offset = 0;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
249 block_offset = 0;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
250 }
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
251 while (seek_block && (seek_offset - block_offset + seek_block->size) < new_offset)
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
252 {
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
253 seek_offset += seek_block->size - block_offset;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
254 seek_block = seek_block->next;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
255 block_offset = 0;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
256 }
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
257 block_offset += new_offset-seek_offset;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
258 seek_offset = new_offset;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
259 break;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
260 }
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
261
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
262 default:
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
263 if (cmd >= CMD_WAIT_SHORT && cmd < (CMD_WAIT_SHORT + 0x10)) {
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
264 uint32_t wait_time = (cmd & 0xF) + 1;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
265 wait_time *= mclks_sample;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
266 wait(&y_context, &p_context, &current_cycle, wait_time);
511
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
267 } else if (cmd >= CMD_YM2612_DAC && cmd < CMD_DAC_STREAM_SETUP) {
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
268 if (seek_block) {
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
269 ym_address_write_part1(&y_context, 0x2A);
512
6800d30437c9 Increment sample pointer after reading a sample in VGM player
Michael Pavone <pavone@retrodev.com>
parents: 511
diff changeset
270 ym_data_write(&y_context, seek_block->data[block_offset++]);
6800d30437c9 Increment sample pointer after reading a sample in VGM player
Michael Pavone <pavone@retrodev.com>
parents: 511
diff changeset
271 seek_offset++;
6800d30437c9 Increment sample pointer after reading a sample in VGM player
Michael Pavone <pavone@retrodev.com>
parents: 511
diff changeset
272 if (block_offset > seek_block->size) {
6800d30437c9 Increment sample pointer after reading a sample in VGM player
Michael Pavone <pavone@retrodev.com>
parents: 511
diff changeset
273 seek_block = seek_block->next;
6800d30437c9 Increment sample pointer after reading a sample in VGM player
Michael Pavone <pavone@retrodev.com>
parents: 511
diff changeset
274 block_offset = 0;
6800d30437c9 Increment sample pointer after reading a sample in VGM player
Michael Pavone <pavone@retrodev.com>
parents: 511
diff changeset
275 }
511
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
276 } else {
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
277 fputs("Encountered DAC write command but data seek pointer is invalid!\n", stderr);
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
278 }
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
279 uint32_t wait_time = (cmd & 0xF);
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
280 if (wait_time)
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
281 {
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
282 wait_time *= mclks_sample;
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
283 wait(&y_context, &p_context, &current_cycle, wait_time);
2c1679058727 Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents: 505
diff changeset
284 }
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
285 } else {
792
724bbec47f86 Use a new fatal_error function instead of calling fprintf and exit for fatal errors. This new function more gracefully handles the case in which BlastEm was not started from a terminal or disconnected from ther terminal (Windows).
Michael Pavone <pavone@retrodev.com>
parents: 719
diff changeset
286 fatal_error("unimplemented command: %X at offset %X\n", cmd, (unsigned int)(cur - data - 1));
408
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
287 }
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
288 }
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
289 }
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
290 return 0;
a13a83934ba3 Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
291 }