SID Test
Added SID tests. Not working at the moment on my K, although they should, since they just use the startup chord.
This commit is contained in:
parent
773579d865
commit
ffb9ff3314
|
@ -5,8 +5,9 @@
|
|||
#include "timers.h"
|
||||
#include "sound_cmds.h"
|
||||
#include "sound_reg.h"
|
||||
#include "snd/psg.h"
|
||||
#include "snd/opl2.h"
|
||||
#include "snd/psg.h"
|
||||
#include "snd/sid.h"
|
||||
#include "dev/midi.h"
|
||||
|
||||
/*
|
||||
|
@ -44,6 +45,28 @@ short psg_test(short channel, int argc, char * argv[]) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Play a sound on the SID
|
||||
*/
|
||||
short sid_test(short channel, int argc, char * argv[]) {
|
||||
short i;
|
||||
unsigned char reg;
|
||||
unsigned char data;
|
||||
long target_time;
|
||||
unsigned char * opm_base = OPM_INT_BASE;
|
||||
|
||||
if (argc >= 2) {
|
||||
/* Allow the user to select the external OPM */
|
||||
if ((strcmp(argv[1], "ext") == 0) || (strcmp(argv[1], "EXT") == 0)) {
|
||||
sid_test_external();
|
||||
} else {
|
||||
sid_test_internal();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Test tone for OPM: register, value
|
||||
*/
|
||||
|
|
|
@ -10,6 +10,11 @@
|
|||
*/
|
||||
extern short psg_test(short channel, int argc, char * argv[]);
|
||||
|
||||
/*
|
||||
* Play a sound on the SID
|
||||
*/
|
||||
extern short sid_test(short channel, int argc, char * argv[]);
|
||||
|
||||
/*
|
||||
* Play a sound on the OPL3
|
||||
*/
|
||||
|
@ -20,6 +25,11 @@ extern short opl3_test(short channel, int argc, char * argv[]);
|
|||
*/
|
||||
extern short opm_test(short channel, int argc, char * argv[]);
|
||||
|
||||
/*
|
||||
* Play a sound on the OPN
|
||||
*/
|
||||
extern short opn_test(short channel, int argc, char * argv[]);
|
||||
|
||||
/*
|
||||
* Perform a transmit test on the MIDI ports
|
||||
*/
|
||||
|
|
|
@ -546,6 +546,7 @@ const t_cli_test_feature cli_test_features[] = {
|
|||
#if MODEL == MODEL_FOENIX_A2560K
|
||||
{"RECALIBRATE", "RECALIBRATE: recalibrate the floppy drive", cli_test_recalibrate},
|
||||
{"SEEK", "SEEK <track>: move the floppy drive head to a track", cli_test_seek},
|
||||
{"SID", "SID [EXT|INT]: test the SID sound chips", sid_test},
|
||||
#endif
|
||||
{"UART","UART: test the serial port",cli_test_uart},
|
||||
{"END", "END", 0}
|
||||
|
|
3078
src/foenixmcp.s68
3078
src/foenixmcp.s68
File diff suppressed because it is too large
Load diff
6116
src/mapfile
6116
src/mapfile
File diff suppressed because it is too large
Load diff
|
@ -149,9 +149,10 @@ void sid_test_internal() {
|
|||
*SID_INT_R_MODE_VOL = 0;
|
||||
}
|
||||
|
||||
void sid_text_external() {
|
||||
void sid_test_external() {
|
||||
unsigned char i;
|
||||
unsigned int j;
|
||||
unsigned int j;
|
||||
long jiffies;
|
||||
|
||||
#if MODEL == MODEL_FOENIX_A2560K
|
||||
|
||||
|
@ -190,8 +191,8 @@ void sid_text_external() {
|
|||
*SID_EXT_L_V1_CTRL = 0x11;
|
||||
*SID_EXT_R_V1_CTRL = 0x11;
|
||||
|
||||
for (j=0 ; j<65536; j++);
|
||||
|
||||
jiffies = rtc_get_jiffies() + 3;
|
||||
while (jiffies > rtc_get_jiffies());
|
||||
|
||||
*SID_EXT_L_V2_FREQ_LO = 49;
|
||||
*SID_EXT_L_V2_FREQ_HI = 8;
|
||||
|
@ -201,7 +202,8 @@ void sid_text_external() {
|
|||
*SID_EXT_L_V2_CTRL = 0x11;
|
||||
*SID_EXT_R_V2_CTRL = 0x11;
|
||||
|
||||
for (j=0 ; j<65536; j++);
|
||||
jiffies = rtc_get_jiffies() + 3;
|
||||
while (jiffies > rtc_get_jiffies());
|
||||
|
||||
*SID_EXT_L_V3_FREQ_LO = 135;
|
||||
*SID_EXT_L_V3_FREQ_HI = 33;
|
||||
|
@ -211,25 +213,34 @@ void sid_text_external() {
|
|||
*SID_EXT_L_V3_CTRL = 0x11;
|
||||
*SID_EXT_R_V3_CTRL = 0x11;
|
||||
|
||||
for (j=0 ; j<262144; j++);
|
||||
jiffies = rtc_get_jiffies() + 25;
|
||||
while (jiffies > rtc_get_jiffies());
|
||||
|
||||
*SID_EXT_L_V1_CTRL = 0x10;
|
||||
*SID_EXT_R_V1_CTRL = 0x10;
|
||||
for (j=0 ; j<8192 ; j++);
|
||||
|
||||
jiffies = rtc_get_jiffies() + 3;
|
||||
while (jiffies > rtc_get_jiffies());
|
||||
|
||||
*SID_EXT_L_V2_CTRL = 0x10;
|
||||
*SID_EXT_R_V2_CTRL = 0x10;
|
||||
for (j=0 ; j<8192 ; j++);
|
||||
|
||||
jiffies = rtc_get_jiffies() + 3;
|
||||
while (jiffies > rtc_get_jiffies());
|
||||
|
||||
*SID_EXT_L_V2_CTRL = 0x10;
|
||||
*SID_EXT_R_V2_CTRL = 0x10;
|
||||
for (j=0 ; j<32768 ; j++);
|
||||
|
||||
jiffies = rtc_get_jiffies() + 10;
|
||||
while (jiffies > rtc_get_jiffies());
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
|
||||
for (j=0 ; j<1024 ; j++);
|
||||
|
||||
*SID_EXT_L_MODE_VOL = 15 - i;
|
||||
*SID_EXT_R_MODE_VOL = 15 - i;
|
||||
}
|
||||
|
||||
*SID_EXT_L_MODE_VOL = 0;
|
||||
*SID_EXT_R_MODE_VOL = 0;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue