1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-12-01 13:50:30 +00:00
8bitworkshop/presets/coleco/simplemusic.c

36 lines
1.4 KiB
C
Raw Normal View History

2019-12-03 04:16:11 +00:00
/*
This demonstrates the cvu_play_music() function.
Command-line tools generate the music file from ABC source files.
For more information, see:
http://www.colecovision.eu/ColecoVision/development/tutorial2.shtml
*/
2017-05-02 13:09:53 +00:00
#include <stdint.h>
const uint16_t notes[] = { 12846, 12334, 11086, 10062, 10062, 9806, 10062, 10574, 11086, 10062, 11086, 12430, 11042, 12334, 12878, 14158, 14158, 12878, 13390, 13646, 10574, 9806, 10574, 12430, 12846, 12334, 11086, 10062, 10062, 9806, 10062, 10574, 11086, 10062, 11086, 12430, 11054, 12334, 12878, 14158, 14158, 12878, 13390, 13646, 10574, 10062, 10062, 10126, 11054, 12334, 12878, 14158, 13902, 14158, 14670, 14158, 13646, 12878, 13390, 13646, 3918, 12878, 14158, 13902, 12878, 12366, 12878, 12366, 12878, 11086, 10062, 9870, 12334, 11054, 11086, 10062, 10062, 9806, 10062, 10574, 11086, 10062, 11086, 12430, 11054, 12334, 12878, 14158, 14158, 12878, 13390, 13646, 10574, 10062, 10062, 10126, 0xffff };
#include <cv.h>
#include <cvu_sound.h>
2017-05-02 13:09:53 +00:00
struct cvu_music music;
2019-12-03 04:16:11 +00:00
// change screen colors to show how long the music
// routine takes to run after screen interrupt
2017-05-02 13:09:53 +00:00
void play(void)
{
2019-12-03 04:16:11 +00:00
cv_set_colors(CV_COLOR_BLACK, CV_COLOR_BLUE);
cvu_play_music(&music);
cv_set_colors(CV_COLOR_BLACK, CV_COLOR_BLACK);
2017-05-02 13:09:53 +00:00
}
void main(void)
{
2019-12-03 04:16:11 +00:00
cvu_init_music(&music);
music.notes = notes;
cv_set_vint_handler(&play);
cv_set_screen_active(true);
for(;;);
2017-05-02 13:09:53 +00:00
}