-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finished music! Now ready for release :D
- Loading branch information
Showing
11 changed files
with
126 additions
and
31 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include <kernel/vesa/graphics.c> | ||
#include <music/music_list.h> | ||
#include <kernel/utils/misc.c> | ||
#include <kernel/utils/rand.c> | ||
|
||
#define XM_BIG_MAIN_COLOR 0x363333 // 0x2f3032 | ||
#define XM_BIG_SECOND_COLOR 0x272121 // 0x383a56 | ||
#define XM_BIG_HIGHLIGHT_2 0xe16428 // 0xb0a565 | ||
#define XM_BIG_HIGHLIGHT_1 0xf6e9e9 // 0xede68a | ||
|
||
// shift the RBG888 colors into RBG565, with a small loss of detail | ||
#define XM_MAIN_COLOR (((XM_BIG_MAIN_COLOR&0xf80000)>>8) + ((XM_BIG_MAIN_COLOR&0xfc00)>>5) + ((XM_BIG_MAIN_COLOR&0xf8)>>3)) | ||
#define XM_SECOND_COLOR (((XM_BIG_SECOND_COLOR&0xf80000)>>8) + ((XM_BIG_SECOND_COLOR&0xfc00)>>5) + ((XM_BIG_SECOND_COLOR&0xf8)>>3)) | ||
#define XM_HIGHLIGHT_2 (((XM_BIG_HIGHLIGHT_2&0xf80000)>>8) + ((XM_BIG_HIGHLIGHT_2&0xfc00)>>5) + ((XM_BIG_HIGHLIGHT_2&0xf8)>>3)) | ||
#define XM_HIGHLIGHT_1 (((XM_BIG_HIGHLIGHT_1&0xf80000)>>8) + ((XM_BIG_HIGHLIGHT_1&0xfc00)>>5) + ((XM_BIG_HIGHLIGHT_1&0xf8)>>3)) | ||
|
||
#define RAND "Now playing a random song." | ||
#define XM_TITLE "XinMusic" | ||
|
||
int xm_main() { | ||
uint32_t song_index = max_rand(sizeof(songs) / sizeof(struct song_entry) - 1); | ||
draw_background(XM_SECOND_COLOR); | ||
draw_square_size(center_x(160, vbe_info->width), 20, 40, 160, XM_MAIN_COLOR); | ||
draw_string(XM_TITLE, center_x(string_len(XM_TITLE) * 8, vbe_info->width), 32, XM_HIGHLIGHT_1); | ||
draw_square_size(center_x(190, vbe_info->width), 80, 80, 190, XM_MAIN_COLOR); | ||
draw_string(songs[song_index].song_name, center_x(string_len(songs[song_index].song_name) * 8, vbe_info->width), 80 + 16, XM_HIGHLIGHT_2); | ||
draw_string(songs[song_index].porter, center_x(string_len(songs[song_index].porter) * 8, vbe_info->width), 80 + 40, XM_HIGHLIGHT_1); | ||
draw_string(RAND, center_x(string_len(RAND) * 8, vbe_info->width), vbe_info->height / 2, XM_HIGHLIGHT_1); | ||
play_song_by_index(song_index); | ||
exit_to_main(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "../beep_structure.c" | ||
|
||
struct beep lose[] = { | ||
{.freq = 130, .len = 100, .delay = 0}, | ||
{.freq = 262, .len = 100, .delay = 0}, | ||
{.freq = 330, .len = 100, .delay = 0}, | ||
{.freq = 392, .len = 100, .delay = 0}, | ||
{.freq = 523, .len = 100, .delay = 0}, | ||
{.freq = 660, .len = 100, .delay = 0}, | ||
{.freq = 784, .len = 300, .delay = 0}, | ||
{.freq = 660, .len = 300, .delay = 0}, | ||
{.freq = 146, .len = 100, .delay = 0}, | ||
{.freq = 262, .len = 100, .delay = 0}, | ||
{.freq = 311, .len = 100, .delay = 0}, | ||
{.freq = 415, .len = 100, .delay = 0}, | ||
{.freq = 523, .len = 100, .delay = 0}, | ||
{.freq = 622, .len = 100, .delay = 0}, | ||
{.freq = 831, .len = 300, .delay = 0}, | ||
{.freq = 622, .len = 300, .delay = 0}, | ||
{.freq = 155, .len = 100, .delay = 0}, | ||
{.freq = 294, .len = 100, .delay = 0}, | ||
{.freq = 349, .len = 100, .delay = 0}, | ||
{.freq = 466, .len = 100, .delay = 0}, | ||
{.freq = 588, .len = 100, .delay = 0}, | ||
{.freq = 699, .len = 100, .delay = 0}, | ||
{.freq = 933, .len = 300, .delay = 0}, | ||
{.freq = 933, .len = 100, .delay = 0}, | ||
{.freq = 933, .len = 100, .delay = 0}, | ||
{.freq = 933, .len = 100, .delay = 0}, | ||
{.freq = 1047, .len = 400, .delay = 0}, | ||
}; |