Mercurial > repos > blastem
annotate vgmplay.c @ 761:ffb8cc5845fa
Add support for making a "portable" build on OSX to Makefile
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 28 Jun 2015 17:16:24 -0700 |
parents | 019d27995e32 |
children | 724bbec47f86 |
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 | 9 #include "config.h" |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 #include <stdint.h> |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 #include <stdio.h> |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 #define MCLKS_NTSC 53693175 |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 #define MCLKS_PAL 53203395 |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 #define MCLKS_PER_68K 7 |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 #define MCLKS_PER_YM MCLKS_PER_68K |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 #define MCLKS_PER_Z80 15 |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 #define MCLKS_PER_PSG (MCLKS_PER_Z80*16) |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 #pragma pack(push, 1) |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 typedef struct { |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 char ident[4]; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 uint32_t eof_offset; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
25 uint32_t version; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
26 uint32_t sn76489_clk; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
27 uint32_t ym2413_clk; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
28 uint32_t gd3_offset; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
29 uint32_t num_samples; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
30 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
|
31 uint32_t loop_samples; |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
32 uint32_t rate; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
33 uint16_t sn76489_fb; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
34 uint8_t sn76489_shift; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
35 uint8_t sn76489_flags; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
36 uint32_t ym2612_clk; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
37 uint32_t ym2151_clk; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
38 uint32_t data_offset; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
39 uint32_t sega_pcm_clk; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
40 uint32_t sega_pcm_reg; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
41 } vgm_header; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
42 |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
43 enum { |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
44 CMD_PSG_STEREO = 0x4F, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
45 CMD_PSG, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
46 CMD_YM2413, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
47 CMD_YM2612_0, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
48 CMD_YM2612_1, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
49 CMD_YM2151, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
50 CMD_YM2203, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
51 CMD_YM2608_0, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
52 CMD_YM2608_1, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
53 CMD_YM2610_0, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
54 CMD_YM2610_1, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
55 CMD_YM3812, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
56 CMD_YM3526, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
57 CMD_Y8950, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
58 CMD_YMZ280B, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
59 CMD_YMF262_0, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
60 CMD_YMF262_1, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
61 CMD_WAIT = 0x61, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
62 CMD_WAIT_60, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
63 CMD_WAIT_50, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
64 CMD_END = 0x66, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
65 CMD_DATA, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
66 CMD_PCM_WRITE, |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
67 CMD_WAIT_SHORT = 0x70, |
511
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
68 CMD_YM2612_DAC = 0x80, |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
69 CMD_DAC_STREAM_SETUP = 0x90, |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
70 CMD_DAC_STREAM_DATA, |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
71 CMD_DAC_STREAM_FREQ, |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
72 CMD_DAC_STREAM_START, |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
73 CMD_DAC_STREAM_STOP, |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
74 CMD_DAC_STREAM_STARTFAST, |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
75 CMD_DATA_SEEK = 0xE0 |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
76 }; |
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 enum { |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
79 DATA_YM2612_PCM = 0 |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
80 }; |
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 #pragma pack(pop) |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
83 |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
84 void handle_keydown(int keycode) |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
85 { |
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 void handle_keyup(int keycode) |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
89 { |
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 |
466 | 92 void handle_joydown(int joystick, int button) |
93 { | |
94 } | |
95 | |
96 void handle_joyup(int joystick, int button) | |
97 { | |
98 } | |
99 | |
100 void handle_joy_dpad(int joystick, int dpadnum, uint8_t value) | |
101 { | |
102 } | |
103 | |
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
|
104 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
|
105 |
409
c1bddeadc566
Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents:
408
diff
changeset
|
106 #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
|
107 #define MAX_SOUND_CYCLES 100000 |
466 | 108 tern_node * config; |
409
c1bddeadc566
Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents:
408
diff
changeset
|
109 |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
110 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
|
111 { |
511
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
112 while (cycles > MAX_SOUND_CYCLES) |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
113 { |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
114 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
|
115 cycles -= MAX_SOUND_CYCLES; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
116 } |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
117 *current_cycle += cycles; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
118 psg_run(p_context, *current_cycle); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
119 ym_run(y_context, *current_cycle); |
466 | 120 |
409
c1bddeadc566
Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents:
408
diff
changeset
|
121 if (*current_cycle > CYCLE_LIMIT) { |
c1bddeadc566
Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents:
408
diff
changeset
|
122 *current_cycle -= CYCLE_LIMIT; |
c1bddeadc566
Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents:
408
diff
changeset
|
123 p_context->cycles -= CYCLE_LIMIT; |
c1bddeadc566
Process events in vgm player so that quitting works
Mike Pavone <pavone@retrodev.com>
parents:
408
diff
changeset
|
124 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
|
125 process_events(); |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
126 } |
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 |
511
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
129 typedef struct { |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
130 struct data_block *next; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
131 uint8_t *data; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
132 uint32_t size; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
133 uint8_t type; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
134 } data_block; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
135 |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
136 int main(int argc, char ** argv) |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
137 { |
511
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
138 data_block *blocks = NULL; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
139 data_block *seek_block = NULL; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
140 uint32_t seek_offset; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
141 uint32_t block_offset; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
142 |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
143 uint32_t fps = 60; |
466 | 144 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
|
145 render_init(320, 240, "vgm play", 60, 0); |
466 | 146 |
514
f66c78cbdcaa
Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents:
512
diff
changeset
|
147 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
|
148 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
|
149 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
|
150 } |
466 | 151 |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
152 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
|
153 ym_init(&y_context, render_sample_rate(), MCLKS_NTSC, MCLKS_PER_YM, render_audio_buffer(), opts); |
466 | 154 |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
155 psg_context p_context; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
156 psg_init(&p_context, render_sample_rate(), MCLKS_NTSC, MCLKS_PER_PSG, render_audio_buffer()); |
466 | 157 |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
158 FILE * f = fopen(argv[1], "rb"); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
159 vgm_header header; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
160 fread(&header, sizeof(header), 1, f); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
161 if (header.version < 0x150 || !header.data_offset) { |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
162 header.data_offset = 0xC; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
163 } |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
164 fseek(f, header.data_offset + 0x34, SEEK_SET); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
165 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
|
166 uint8_t * data = malloc(data_size); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
167 fread(data, 1, data_size, f); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
168 fclose(f); |
466 | 169 |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
170 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
|
171 uint32_t loop_count = 2; |
466 | 172 |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
173 uint8_t * end = data + data_size; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
174 uint8_t * cur = data; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
175 uint32_t current_cycle = 0; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
176 while (cur < end) { |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
177 uint8_t cmd = *(cur++); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
178 switch(cmd) |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
179 { |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
180 case CMD_PSG_STEREO: |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
181 //ignore for now |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
182 cur++; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
183 break; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
184 case CMD_PSG: |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
185 psg_write(&p_context, *(cur++)); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
186 break; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
187 case CMD_YM2612_0: |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
188 ym_address_write_part1(&y_context, *(cur++)); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
189 ym_data_write(&y_context, *(cur++)); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
190 break; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
191 case CMD_YM2612_1: |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
192 ym_address_write_part2(&y_context, *(cur++)); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
193 ym_data_write(&y_context, *(cur++)); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
194 break; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
195 case CMD_WAIT: { |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
196 uint32_t wait_time = *(cur++); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
197 wait_time |= *(cur++) << 8; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
198 wait_time *= mclks_sample; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
199 wait(&y_context, &p_context, ¤t_cycle, wait_time); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
200 break; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
201 } |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
202 case CMD_WAIT_60: |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
203 wait(&y_context, &p_context, ¤t_cycle, 735 * mclks_sample); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
204 break; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
205 case CMD_WAIT_50: |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
206 wait(&y_context, &p_context, ¤t_cycle, 882 * mclks_sample); |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
207 break; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
208 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
|
209 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
|
210 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
|
211 } else { |
f66c78cbdcaa
Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents:
512
diff
changeset
|
212 //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
|
213 return 0; |
f66c78cbdcaa
Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents:
512
diff
changeset
|
214 } |
f66c78cbdcaa
Implement per-channel wave logging and primitive looping support in vgm player.
Michael Pavone <pavone@retrodev.com>
parents:
512
diff
changeset
|
215 break; |
511
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
216 case CMD_DATA: { |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
217 cur++; //skip compat command |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
218 uint8_t data_type = *(cur++); |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
219 uint32_t data_size = *(cur++); |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
220 data_size |= *(cur++) << 8; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
221 data_size |= *(cur++) << 16; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
222 data_size |= *(cur++) << 24; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
223 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
|
224 data_block ** curblock = &blocks; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
225 while(*curblock) |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
226 { |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
227 curblock = &((*curblock)->next); |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
228 } |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
229 *curblock = malloc(sizeof(data_block)); |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
230 (*curblock)->size = data_size; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
231 (*curblock)->type = data_type; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
232 (*curblock)->data = cur; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
233 (*curblock)->next = NULL; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
234 } else { |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
235 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
|
236 } |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
237 cur += data_size; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
238 break; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
239 } |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
240 case CMD_DATA_SEEK: { |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
241 uint32_t new_offset = *(cur++); |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
242 new_offset |= *(cur++) << 8; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
243 new_offset |= *(cur++) << 16; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
244 new_offset |= *(cur++) << 24; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
245 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
|
246 seek_block = blocks; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
247 seek_offset = 0; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
248 block_offset = 0; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
249 } |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
250 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
|
251 { |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
252 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
|
253 seek_block = seek_block->next; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
254 block_offset = 0; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
255 } |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
256 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
|
257 seek_offset = new_offset; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
258 break; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
259 } |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
260 |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
261 default: |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
262 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
|
263 uint32_t wait_time = (cmd & 0xF) + 1; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
264 wait_time *= mclks_sample; |
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
265 wait(&y_context, &p_context, ¤t_cycle, wait_time); |
511
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
266 } 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
|
267 if (seek_block) { |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
268 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
|
269 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
|
270 seek_offset++; |
6800d30437c9
Increment sample pointer after reading a sample in VGM player
Michael Pavone <pavone@retrodev.com>
parents:
511
diff
changeset
|
271 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
|
272 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
|
273 block_offset = 0; |
6800d30437c9
Increment sample pointer after reading a sample in VGM player
Michael Pavone <pavone@retrodev.com>
parents:
511
diff
changeset
|
274 } |
511
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
275 } else { |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
276 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
|
277 } |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
278 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
|
279 if (wait_time) |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
280 { |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
281 wait_time *= mclks_sample; |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
282 wait(&y_context, &p_context, ¤t_cycle, wait_time); |
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
283 } |
408
a13a83934ba3
Add primitive vgm player for testing
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
284 } else { |
511
2c1679058727
Add support for VGM 1.50 PCM data blocks
Michael Pavone <pavone@retrodev.com>
parents:
505
diff
changeset
|
285 printf("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
|
286 exit(1); |
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 } |