-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path70_SIDinfo.ino
150 lines (128 loc) · 5.91 KB
/
70_SIDinfo.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
char SIDinfo_filetype [8] ;
char SIDinfo_name [33] ;
char SIDinfo_author [33] ;
char SIDinfo_released [33] ;
char SIDinfo_VIDEO [14] ;
char SIDinfo_CLOCK [7] ;
char SIDinfo_PLAYABLE [6];
char SIDinfo_MODEL [20];
char SIDinfo_PLAYLIST [10];
char SIDinfo_RANDOM [4];
void infoSID() {
// - PSID (0x50534944)
// - RSID (0x52534944)
strcpy (SIDinfo_filetype, "UNKNOWN"); // if PSID/RSID check fail
if ( (PEEK (0x380 + 00) == 0x50) & (PEEK (0x380 + 01) == 0x53) & (PEEK (0x380 + 02) == 0x49) & (PEEK (0x380 + 03) == 0x44) ) {
strcpy (SIDinfo_filetype, "PSID");
}
if ( (PEEK (0x380 + 00) == 0x52) & (PEEK (0x380 + 01) == 0x53) & (PEEK (0x380 + 02) == 0x49) & (PEEK (0x380 + 03) == 0x44) ) {
strcpy (SIDinfo_filetype, "RSID");
}
strcpy (SIDinfo_name, "");
for (int cc = 0; cc < 0x20; cc = cc + 1) {
SIDinfo_name[cc] = (PEEK (0x380 + 0x16 + cc));
if (cc == 0x1f) {
SIDinfo_name[0x20] = 0; // null terminating string
}
}
strcpy (SIDinfo_author, "");
for (int cc = 0; cc < 0x20; cc = cc + 1) {
SIDinfo_author[cc] = (PEEK (0x380 + 0x36 + cc));
if (cc == 0x1f) {
SIDinfo_author[0x20] = 0; // null terminating string
}
}
strcpy (SIDinfo_released, "");
for (int cc = 0; cc < 0x20; cc = cc + 1) {
SIDinfo_released[cc] = (PEEK (0x380 + 0x56 + cc));
if (cc == 0x1f) {
SIDinfo_released[0x20] = 0; // null terminating string
}
}
switch (VIDEO_TYPE) {
case 0:
strcpy (SIDinfo_VIDEO, "UNKNOWN");
break;
case 1:
strcpy (SIDinfo_VIDEO, "PAL");
break;
case 2:
strcpy (SIDinfo_VIDEO, "NTSC");
break;
case 3:
strcpy (SIDinfo_VIDEO, "PAL and NTSC");
break;
}
switch (SUBTUNE_SPEED) {
case 0:
strcpy (SIDinfo_CLOCK, "VIC II");
break;
case 1:
strcpy (SIDinfo_CLOCK, "CIA");
break;
}
if (PLAYABLE_SID) {
strcpy (SIDinfo_PLAYABLE, "OK");
} else {
strcpy (SIDinfo_PLAYABLE, "ERROR");
}
switch (MODEL_TYPE) {
case 0:
strcpy (SIDinfo_MODEL, "UNKNOWN");
break;
case 1:
strcpy (SIDinfo_MODEL, "MOS6581");
break;
case 2:
strcpy (SIDinfo_MODEL, "MOS8580");
break;
case 3:
strcpy (SIDinfo_MODEL, "MOS6581 and MOS8580");
break;
}
debugPrintTXTln ("");
debugPrintTXTln ("--------------------------------------------------------------------");
debugPrintTXT ("Name: "); debugPrintTXT (SIDinfo_name); debugPrintTXTln ("");
debugPrintTXT ("Author: "); debugPrintTXT (SIDinfo_author); debugPrintTXTln ("");
debugPrintTXT ("Released: "); debugPrintTXT (SIDinfo_released); debugPrintTXTln ("");
debugPrintTXTln ("--------------------------------------------------------------------");
debugPrintTXT ("Tune: "); debugPrintNUMBER(SID_current_tune); debugPrintTXT ("/"); debugPrintNUMBER(SID_number_of_tunes); debugPrintTXT (" ("); debugPrintNUMBER(SID_default_tune); debugPrintTXT (")") ; debugPrintTXTln ("");
debugPrintTXT ("File: "); debugPrintNUMBER(current_file); debugPrintTXT("/"); debugPrintNUMBER(total_sid_files); debugPrintTXTln("");
debugPrintTXT ("Folder: "); debugPrintNUMBER(current_folder + 1); debugPrintTXT("/"); debugPrintNUMBER(NUMBER_OF_FOLDERS); debugPrintTXTln(" ");
debugPrintTXT ("Path: "); debugPrintTXT (SID_DIR_name); debugPrintTXT (SID_filename); debugPrintTXTln ("");
debugPrintTXTln ("--------------------------------------------------------------------");
debugPrintTXT ("Size: "); debugPrintNUMBER(SID_data_size); debugPrintTXT(" bytes"); debugPrintTXTln (" ");
debugPrintTXT ("Type: "); debugPrintTXT (SIDinfo_filetype); debugPrintTXTln ("");
debugPrintTXT ("Range: "); debugPrintNUMBERHEX(SID_load_start); debugPrintTXT(" - "); debugPrintNUMBERHEX(SID_load_end); debugPrintTXTln ("");
debugPrintTXT ("Init: "); debugPrintNUMBERHEX(SID_init); debugPrintTXTln ("");
debugPrintTXT ("Play: "); debugPrintNUMBERHEX(SID_play); debugPrintTXTln ("");
debugPrintTXT ("Video: "); debugPrintTXT (SIDinfo_VIDEO); debugPrintTXTln ("");
debugPrintTXT ("Clock: "); debugPrintTXT (SIDinfo_CLOCK); debugPrintTXT (" ("); debugPrintNUMBER(SID_speed); debugPrintTXT (")") ; debugPrintTXTln ("");
debugPrintTXT ("SID model: "); debugPrintTXT (SIDinfo_MODEL); debugPrintTXTln ("");
debugPrintTXTln ("--------------------------------------------------------------------");
}
// calculate free unused RAM
void HELP () {
debugPrintTXTln ("");
debugPrintTXT (" **** STM32 SID PLAYER **** ");
debugPrintTXTln ("");
debugPrintNUMBER ((RAM_SIZE >> 10) + 1);
debugPrintTXT ("K RAM SYSTEM ");
debugPrintNUMBER (FreeBytes());
debugPrintTXT (" BYTES FREE");
debugPrintTXTln ("");
debugPrintNUMBER (uint32_t(1000000 / multiplier));
debugPrintTXT ("Hz Sample ");
debugPrintNUMBER (uint32_t( (1000000 / period) / 1000));
debugPrintTXTln ("KHz PWM frequency");
debugPrintTXTln ("");
debugPrintTXTln ("Button press BUTTON_PREV ( << ) BUTTON_PLAY ( > / || ) BUTTON_NEXT ( >> ) ");
debugPrintTXTln (" 1 play previous tune play / pause toggle play next tune ");
debugPrintTXTln (" 2 play previous file restart tune play next file ");
debugPrintTXTln (" 3 play previous folder restart tune's time play next folder ");
debugPrintTXTln (" 4 play first folder from playlist SID INFO play last folder from playlist ");
debugPrintTXTln (" 5 HELP HELP HELP ");
debugPrintTXTln ("holding Channel 1 OFF Channel 2 OFF Channel 3 OFF ");
debugPrintTXTln ("");
debugPrintTXTln ("READY.");
}