From 14b3e963b7b31914fd8c1489d354e390dbc4dbda Mon Sep 17 00:00:00 2001 From: Vincent Barrilliot Date: Tue, 31 Jan 2023 22:00:36 +0100 Subject: [PATCH] Adapt sound test commands mostly --- src/cli/sound_cmds.c | 21 +-- src/cli/test_cmd2.c | 16 ++- src/include/A2560U/sound_a2560u.h | 213 +++++++++++++++--------------- src/snd/sid.c | 9 +- 4 files changed, 131 insertions(+), 128 deletions(-) diff --git a/src/cli/sound_cmds.c b/src/cli/sound_cmds.c index e704536..bbaae48 100644 --- a/src/cli/sound_cmds.c +++ b/src/cli/sound_cmds.c @@ -69,12 +69,6 @@ short psg_test(short channel, int argc, const char * argv[]) { * Play a sound on the SID */ short sid_test(short channel, int argc, const char * argv[]) { - short i; - unsigned char reg; - unsigned char data; - long target_time; - volatile unsigned char * opm_base = OPM_INT_BASE; - #if MODEL == MODEL_FOENIX_A2560K if (argc >= 2) { /* Allow the user to select the external OPM */ @@ -91,7 +85,7 @@ short sid_test(short channel, int argc, const char * argv[]) { return 0; } - +#if MODEL == MODEL_FOENIX_A2560K void Test_EXT_FM2151( void ) { unsigned char i; @@ -202,6 +196,7 @@ short sid_test(short channel, int argc, const char * argv[]) { * EXT_OPM_08_KEY_ON_OFF = 0x00; } +#endif void Test_EXT_FM2612( void ) { unsigned char i; @@ -452,7 +447,7 @@ short sid_test(short channel, int argc, const char * argv[]) { for (j=0 ; j<262144; j++); } - +#if MODEL == MODEL_FOENIX_A2560K /* * Test tone for OPM: register, value */ @@ -654,6 +649,7 @@ short opn_test(short channel, int argc, const char * argv[]) { return 0; } +#endif const unsigned char opl3_tone_on[] = { 0x01,0x00, /* initialise */ @@ -738,11 +734,11 @@ short opl3_test(short channel, int argc, const char * argv[]) { return 0; } +#if MODEL == MODEL_FOENIX_A2560K /* * Perform a transmit test on the MIDI ports */ short midi_tx_test(short channel, int argc, const char * argv[]) { -#if MODEL == MODEL_FOENIX_A2560K const char note_on[] = { 0x90, 0x3c, 0x3f }; const char note_off[] = { 0x80, 0x3c, 0x00 }; char message[80]; @@ -784,7 +780,7 @@ short midi_tx_test(short channel, int argc, const char * argv[]) { print(channel, message); return 0; } -#endif + return 0; } @@ -792,7 +788,6 @@ short midi_tx_test(short channel, int argc, const char * argv[]) { * Perform a receive test on the MIDI ports */ short midi_rx_test(short channel, int argc, const char * argv[]) { -#if MODEL == MODEL_FOENIX_A2560K char message[80]; unsigned short scancode = 0; int i; @@ -834,7 +829,6 @@ short midi_rx_test(short channel, int argc, const char * argv[]) { print(channel, message); return 0; } -#endif return 0; } @@ -842,7 +836,6 @@ short midi_rx_test(short channel, int argc, const char * argv[]) { * Perform a loopback test on the MIDI ports */ short midi_loop_test(short channel, int argc, const char * argv[]) { -#if MODEL == MODEL_FOENIX_A2560K char message[80]; unsigned short scancode = 0; unsigned char output; @@ -891,6 +884,6 @@ short midi_loop_test(short channel, int argc, const char * argv[]) { print(channel, message); return 0; } -#endif return 0; } +#endif // Testing of MIDI for A2560K diff --git a/src/cli/test_cmd2.c b/src/cli/test_cmd2.c index 138ca2d..2153ef4 100644 --- a/src/cli/test_cmd2.c +++ b/src/cli/test_cmd2.c @@ -58,14 +58,14 @@ short kbd_break() { * Test the PS/2 keyboard */ short cli_test_ps2(short channel, int argc, const char * argv[]) { - char message[80]; + const char help[] = "Press keys on a PS/2 keyboard... CTRL-C to quit.\n"; unsigned short scancode = 0; - sprintf(message, "Press keys on a PS/2 keyboard... CTRL-C to quit.\n"); - sys_chan_write(channel, message, strlen(message)); + sys_chan_write(channel, help, strlen(help)); do { if (scancode != 0) { + char message[80]; sprintf(message, "Scan code: %04x\n", scancode); sys_chan_write(channel, message, strlen(message)); } @@ -863,16 +863,22 @@ const t_cli_test_feature cli_test_features[] = { #if MODEL == MODEL_FOENIX_A2560K {"FDC", "FDC DSKCHG | [ [WRITE ]]: test reading/writing the MBR from the floppy drive", cli_test_fdc}, {"GAMEPAD", "GAMEPAD [0 | 1]: test SNES gamepads", cli_test_gamepad}, +#endif {"JOY", "JOY: test the joystick", cli_test_joystick}, -#endif +#if MODEL == MODEL_FOENIX_A2560K {"LPT", "LPT: test the parallel port", cli_test_lpt}, +#endif {"MEM", "MEM [SYS|MERA]: test reading and writing of system or MERA memory", cli_mem_test}, +#if MODEL == MODEL_FOENIX_A2560K {"MIDILOOP", "MIDILOOP: perform a loopback test on the MIDI ports", midi_loop_test}, {"MIDIRX", "MIDIRX: perform a receive test on the MIDI ports", midi_rx_test}, {"MIDITX", "MIDITX: send a note to a MIDI keyboard", midi_tx_test}, +#endif {"OPL3", "OPL3: test the OPL3 sound chip", opl3_test}, +#if MODEL == MODEL_FOENIX_A2560K {"OPN", "OPN [EXT|INT]: test the OPN sound chip", opn_test}, {"OPM", "OPM [EXT|INT]: test the OPM sound chip", opm_test}, +#endif {"PANIC", "PANIC: test the kernel panic mechanism", cli_test_panic}, {"PS2", "PS2: test the PS/2 keyboard", cli_test_ps2}, {"PSG", "PSG [EXT|INTL|INTR|INTS]: test the PSG sound chip", psg_test}, @@ -880,8 +886,8 @@ const t_cli_test_feature cli_test_features[] = { #if MODEL == MODEL_FOENIX_A2560K {"RECALIBRATE", "RECALIBRATE: recalibrate the floppy drive", cli_test_recalibrate}, {"SEEK", "SEEK : move the floppy drive head to a track", cli_test_seek}, - {"SID", "SID [EXT|INT]: test the SID sound chips", sid_test}, #endif + {"SID", "SID [EXT|INT]: test the SID sound chips", sid_test}, {"UART","UART [1|2]: test the serial port",cli_test_uart}, {"TEXTSCROLL", "TEXTSCROLL [byte|word]: fills the text memory with A..Z then scroll one char to the left", cli_test_textscroll}, {"END", "END", 0} diff --git a/src/include/A2560U/sound_a2560u.h b/src/include/A2560U/sound_a2560u.h index 80174d2..5a06630 100644 --- a/src/include/A2560U/sound_a2560u.h +++ b/src/include/A2560U/sound_a2560u.h @@ -5,130 +5,129 @@ #ifndef __SOUND_A2560U_H #define __SOUND_A2560U_H -#define PSG_PORT ((volatile unsigned char *)0x00B20130) /* Control register for the SN76489 */ -#define OPL3_PORT ((volatile unsigned char *)0x00B20200) /* Access port for the OPL3 */ -#define OPM_INT_BASE ((volatile unsigned char *)0x00B20C00) /* Internal OPM base address */ -#define OPN2_INT_BASE ((volatile unsigned char *)0x00B20A00) /* Internal OPN2 base address */ -#define CODEC ((volatile unsigned short *)0x00B20E00) /* Control register for the CODEC */ +#include + +#define PSG_PORT ((volatile uint8_t *)0x00B20130) /* Control register for the SN76489 */ +#define OPL3_PORT ((volatile uint8_t *)0x00B20200) /* Access port for the OPL3 */ +#define CODEC ((volatile uint16_t *)0x00B20E00) /* Control register for the CODEC */ +#define N_SIDS 2 /* Number of SIDs supported by the system */ +#define SID_INT_L ((volatile uint8_t *)0x00B21000) /* Left SID base */ +#define SID_INT_R ((volatile uint8_t *)0x00B21200) /* Right SID base */ +#define SID_INT_N ((volatile uint8_t *)0x00B21400) /* Both SIDs */ /* - * A2560U supports two external, physical SID chips. - * It also implements the Gideon FPGA based SID in either stereo or mono (neutral) form - * - * $00C21000..$00C211FF - Internal SID Left - * $00C21200..$00C213FF - Internal SID Right - * $00C21400..$00C215FF - Internal SID Neutral + * A2560U supports two SIDs emulated in the FPGA. */ /* * Internal SID Left Channel */ -#define SID_INT_L_V1_FREQ_LO ((unsigned char *)0x00B21000) -#define SID_INT_L_V1_FREQ_HI ((unsigned char *)0x00B21001) -#define SID_INT_L_V1_PW_LO ((unsigned char *)0x00B21002) -#define SID_INT_L_V1_PW_HI ((unsigned char *)0x00B21003) -#define SID_INT_L_V1_CTRL ((unsigned char *)0x00B21004) -#define SID_INT_L_V1_ATCK_DECY ((unsigned char *)0x00B21005) -#define SID_INT_L_V1_SSTN_RLSE ((unsigned char *)0x00B21006) -#define SID_INT_L_V2_FREQ_LO ((unsigned char *)0x00B21007) -#define SID_INT_L_V2_FREQ_HI ((unsigned char *)0x00B21008) -#define SID_INT_L_V2_PW_LO ((unsigned char *)0x00B21009) -#define SID_INT_L_V2_PW_HI ((unsigned char *)0x00B2100A) -#define SID_INT_L_V2_CTRL ((unsigned char *)0x00B2100B) -#define SID_INT_L_V2_ATCK_DECY ((unsigned char *)0x00B2100C) -#define SID_INT_L_V2_SSTN_RLSE ((unsigned char *)0x00B2100D) -#define SID_INT_L_V3_FREQ_LO ((unsigned char *)0x00B2100E) -#define SID_INT_L_V3_FREQ_HI ((unsigned char *)0x00B2100F) -#define SID_INT_L_V3_PW_LO ((unsigned char *)0x00B21010) -#define SID_INT_L_V3_PW_HI ((unsigned char *)0x00B21011) -#define SID_INT_L_V3_CTRL ((unsigned char *)0x00B21012) -#define SID_INT_L_V3_ATCK_DECY ((unsigned char *)0x00B21013) -#define SID_INT_L_V3_SSTN_RLSE ((unsigned char *)0x00B21014) -#define SID_INT_L_FC_LO ((unsigned char *)0x00B21015) -#define SID_INT_L_FC_HI ((unsigned char *)0x00B21016) -#define SID_INT_L_RES_FILT ((unsigned char *)0x00B21017) -#define SID_INT_L_MODE_VOL ((unsigned char *)0x00B21018) -#define SID_INT_L_POT_X ((unsigned char *)0x00B21019) -#define SID_INT_L_POT_Y ((unsigned char *)0x00B2101A) -#define SID_INT_L_OSC3_RND ((unsigned char *)0x00B2101B) -#define SID_INT_L_ENV3 ((unsigned char *)0x00B2101C) -#define SID_INT_L_NOT_USED0 ((unsigned char *)0x00B2101D) -#define SID_INT_L_NOT_USED1 ((unsigned char *)0x00B2101E) -#define SID_INT_L_NOT_USED2 ((unsigned char *)0x00B2101F) +#define SID_INT_L_V1_FREQ_LO ((uint8_t *)SID_INT_L) +#define SID_INT_L_V1_FREQ_HI ((uint8_t *)SID_INT_L+1) +#define SID_INT_L_V1_PW_LO ((uint8_t *)SID_INT_L+2) +#define SID_INT_L_V1_PW_HI ((uint8_t *)SID_INT_L+3) +#define SID_INT_L_V1_CTRL ((uint8_t *)SID_INT_L+4) +#define SID_INT_L_V1_ATCK_DECY ((uint8_t *)SID_INT_L+5) +#define SID_INT_L_V1_SSTN_RLSE ((uint8_t *)SID_INT_L+6) +#define SID_INT_L_V2_FREQ_LO ((uint8_t *)SID_INT_L+7) +#define SID_INT_L_V2_FREQ_HI ((uint8_t *)SID_INT_L+8) +#define SID_INT_L_V2_PW_LO ((uint8_t *)SID_INT_L+9) +#define SID_INT_L_V2_PW_HI ((uint8_t *)SID_INT_L+10) +#define SID_INT_L_V2_CTRL ((uint8_t *)SID_INT_L+11) +#define SID_INT_L_V2_ATCK_DECY ((uint8_t *)SID_INT_L+12) +#define SID_INT_L_V2_SSTN_RLSE ((uint8_t *)SID_INT_L+13) +#define SID_INT_L_V3_FREQ_LO ((uint8_t *)SID_INT_L+14) +#define SID_INT_L_V3_FREQ_HI ((uint8_t *)SID_INT_L+15) +#define SID_INT_L_V3_PW_LO ((uint8_t *)SID_INT_L+16) +#define SID_INT_L_V3_PW_HI ((uint8_t *)SID_INT_L+17) +#define SID_INT_L_V3_CTRL ((uint8_t *)SID_INT_L+18) +#define SID_INT_L_V3_ATCK_DECY ((uint8_t *)SID_INT_L+19) +#define SID_INT_L_V3_SSTN_RLSE ((uint8_t *)SID_INT_L+20) +#define SID_INT_L_FC_LO ((uint8_t *)SID_INT_L+21) +#define SID_INT_L_FC_HI ((uint8_t *)SID_INT_L+22) +#define SID_INT_L_RES_FILT ((uint8_t *)SID_INT_L+23) +#define SID_INT_L_MODE_VOL ((uint8_t *)SID_INT_L+24) +#define SID_INT_L_POT_X ((uint8_t *)SID_INT_L+25) +#define SID_INT_L_POT_Y ((uint8_t *)SID_INT_L+26) +#define SID_INT_L_OSC3_RND ((uint8_t *)SID_INT_L+27) +#define SID_INT_L_ENV3 ((uint8_t *)SID_INT_L+28) +#define SID_INT_L_NOT_USED0 ((uint8_t *)SID_INT_L+29) +#define SID_INT_L_NOT_USED1 ((uint8_t *)SID_INT_L+30) +#define SID_INT_L_NOT_USED2 ((uint8_t *)SID_INT_L+31) /* * Internal SID Right Channel */ -#define SID_INT_R_V1_FREQ_LO ((unsigned char *)0x00B21200) -#define SID_INT_R_V1_FREQ_HI ((unsigned char *)0x00B21201) -#define SID_INT_R_V1_PW_LO ((unsigned char *)0x00B21202) -#define SID_INT_R_V1_PW_HI ((unsigned char *)0x00B21203) -#define SID_INT_R_V1_CTRL ((unsigned char *)0x00B21204) -#define SID_INT_R_V1_ATCK_DECY ((unsigned char *)0x00B21205) -#define SID_INT_R_V1_SSTN_RLSE ((unsigned char *)0x00B21206) -#define SID_INT_R_V2_FREQ_LO ((unsigned char *)0x00B21207) -#define SID_INT_R_V2_FREQ_HI ((unsigned char *)0x00B21208) -#define SID_INT_R_V2_PW_LO ((unsigned char *)0x00B21209) -#define SID_INT_R_V2_PW_HI ((unsigned char *)0x00B2120A) -#define SID_INT_R_V2_CTRL ((unsigned char *)0x00B2120B) -#define SID_INT_R_V2_ATCK_DECY ((unsigned char *)0x00B2120C) -#define SID_INT_R_V2_SSTN_RLSE ((unsigned char *)0x00B2120D) -#define SID_INT_R_V3_FREQ_LO ((unsigned char *)0x00B2120E) -#define SID_INT_R_V3_FREQ_HI ((unsigned char *)0x00B2120F) -#define SID_INT_R_V3_PW_LO ((unsigned char *)0x00B21210) -#define SID_INT_R_V3_PW_HI ((unsigned char *)0x00B21211) -#define SID_INT_R_V3_CTRL ((unsigned char *)0x00B21212) -#define SID_INT_R_V3_ATCK_DECY ((unsigned char *)0x00B21213) -#define SID_INT_R_V3_SSTN_RLSE ((unsigned char *)0x00B21214) -#define SID_INT_R_FC_LO ((unsigned char *)0x00B21215) -#define SID_INT_R_FC_HI ((unsigned char *)0x00B21216) -#define SID_INT_R_RES_FILT ((unsigned char *)0x00B21217) -#define SID_INT_R_MODE_VOL ((unsigned char *)0x00B21218) -#define SID_INT_R_POT_X ((unsigned char *)0x00B21219) -#define SID_INT_R_POT_Y ((unsigned char *)0x00B2121A) -#define SID_INT_R_OSC3_RND ((unsigned char *)0x00B2121B) -#define SID_INT_R_ENV3 ((unsigned char *)0x00B2121C) -#define SID_INT_R_NOT_USED0 ((unsigned char *)0x00B2121D) -#define SID_INT_R_NOT_USED1 ((unsigned char *)0x00B2121E) -#define SID_INT_R_NOT_USED2 ((unsigned char *)0x00B2121F) +#define SID_INT_R_V1_FREQ_LO ((uint8_t *)SID_INT_R) +#define SID_INT_R_V1_FREQ_HI ((uint8_t *)SID_INT_R+1) +#define SID_INT_R_V1_PW_LO ((uint8_t *)SID_INT_R+2) +#define SID_INT_R_V1_PW_HI ((uint8_t *)SID_INT_R+3) +#define SID_INT_R_V1_CTRL ((uint8_t *)SID_INT_R+4) +#define SID_INT_R_V1_ATCK_DECY ((uint8_t *)SID_INT_R+5) +#define SID_INT_R_V1_SSTN_RLSE ((uint8_t *)SID_INT_R+6) +#define SID_INT_R_V2_FREQ_LO ((uint8_t *)SID_INT_R+7) +#define SID_INT_R_V2_FREQ_HI ((uint8_t *)SID_INT_R+8) +#define SID_INT_R_V2_PW_LO ((uint8_t *)SID_INT_R+9) +#define SID_INT_R_V2_PW_HI ((uint8_t *)SID_INT_R+10) +#define SID_INT_R_V2_CTRL ((uint8_t *)SID_INT_R+11) +#define SID_INT_R_V2_ATCK_DECY ((uint8_t *)SID_INT_R+12) +#define SID_INT_R_V2_SSTN_RLSE ((uint8_t *)SID_INT_R+13) +#define SID_INT_R_V3_FREQ_LO ((uint8_t *)SID_INT_R+14) +#define SID_INT_R_V3_FREQ_HI ((uint8_t *)SID_INT_R+15) +#define SID_INT_R_V3_PW_LO ((uint8_t *)SID_INT_R+16) +#define SID_INT_R_V3_PW_HI ((uint8_t *)SID_INT_R+17) +#define SID_INT_R_V3_CTRL ((uint8_t *)SID_INT_R+18) +#define SID_INT_R_V3_ATCK_DECY ((uint8_t *)SID_INT_R+19) +#define SID_INT_R_V3_SSTN_RLSE ((uint8_t *)SID_INT_R+20) +#define SID_INT_R_FC_LO ((uint8_t *)SID_INT_R+21) +#define SID_INT_R_FC_HI ((uint8_t *)SID_INT_R+22) +#define SID_INT_R_RES_FILT ((uint8_t *)SID_INT_R+23) +#define SID_INT_R_MODE_VOL ((uint8_t *)SID_INT_R+24) +#define SID_INT_R_POT_X ((uint8_t *)SID_INT_R+25) +#define SID_INT_R_POT_Y ((uint8_t *)SID_INT_R+26) +#define SID_INT_R_OSC3_RND ((uint8_t *)SID_INT_R+27) +#define SID_INT_R_ENV3 ((uint8_t *)SID_INT_R+28) +#define SID_INT_R_NOT_USED0 ((uint8_t *)SID_INT_R+29) +#define SID_INT_R_NOT_USED1 ((uint8_t *)SID_INT_R+30) +#define SID_INT_R_NOT_USED2 ((uint8_t *)SID_INT_R+31) /* * Internal SID Neutral Channel - When writting here, the value is written in R and L Channel at the same time */ -#define SID_INT_N_V1_FREQ_LO ((unsigned char *)0x00B21400) -#define SID_INT_N_V1_FREQ_HI ((unsigned char *)0x00B21401) -#define SID_INT_N_V1_PW_LO ((unsigned char *)0x00B21402) -#define SID_INT_N_V1_PW_HI ((unsigned char *)0x00B21403) -#define SID_INT_N_V1_CTRL ((unsigned char *)0x00B21404) -#define SID_INT_N_V1_ATCK_DECY ((unsigned char *)0x00B21405) -#define SID_INT_N_V1_SSTN_RLSE ((unsigned char *)0x00B21406) -#define SID_INT_N_V2_FREQ_LO ((unsigned char *)0x00B21407) -#define SID_INT_N_V2_FREQ_HI ((unsigned char *)0x00B21408) -#define SID_INT_N_V2_PW_LO ((unsigned char *)0x00B21409) -#define SID_INT_N_V2_PW_HI ((unsigned char *)0x00B2140A) -#define SID_INT_N_V2_CTRL ((unsigned char *)0x00B2140B) -#define SID_INT_N_V2_ATCK_DECY ((unsigned char *)0x00B2140C) -#define SID_INT_N_V2_SSTN_RLSE ((unsigned char *)0x00B2140D) -#define SID_INT_N_V3_FREQ_LO ((unsigned char *)0x00B2140E) -#define SID_INT_N_V3_FREQ_HI ((unsigned char *)0x00B2140F) -#define SID_INT_N_V3_PW_LO ((unsigned char *)0x00B21410) -#define SID_INT_N_V3_PW_HI ((unsigned char *)0x00B21411) -#define SID_INT_N_V3_CTRL ((unsigned char *)0x00B21412) -#define SID_INT_N_V3_ATCK_DECY ((unsigned char *)0x00B21413) -#define SID_INT_N_V3_SSTN_RLSE ((unsigned char *)0x00B21414) -#define SID_INT_N_FC_LO ((unsigned char *)0x00B21415) -#define SID_INT_N_FC_HI ((unsigned char *)0x00B21416) -#define SID_INT_N_RES_FILT ((unsigned char *)0x00B21417) -#define SID_INT_N_MODE_VOL ((unsigned char *)0x00B21418) -#define SID_INT_N_POT_X ((unsigned char *)0x00B21419) -#define SID_INT_N_POT_Y ((unsigned char *)0x00B2141A) -#define SID_INT_N_OSC3_RND ((unsigned char *)0x00B2141B) -#define SID_INT_N_ENV3 ((unsigned char *)0x00B2141C) -#define SID_INT_N_NOT_USED0 ((unsigned char *)0x00B2141D) -#define SID_INT_N_NOT_USED1 ((unsigned char *)0x00B2141E) -#define SID_INT_N_NOT_USED2 ((unsigned char *)0x00B2141F) +#define SID_INT_N_V1_FREQ_LO ((uint8_t *)SID_INT_N) +#define SID_INT_N_V1_FREQ_HI ((uint8_t *)SID_INT_N+1) +#define SID_INT_N_V1_PW_LO ((uint8_t *)SID_INT_N+2) +#define SID_INT_N_V1_PW_HI ((uint8_t *)SID_INT_N+3) +#define SID_INT_N_V1_CTRL ((uint8_t *)SID_INT_N+4) +#define SID_INT_N_V1_ATCK_DECY ((uint8_t *)SID_INT_N+5) +#define SID_INT_N_V1_SSTN_RLSE ((uint8_t *)SID_INT_N+6) +#define SID_INT_N_V2_FREQ_LO ((uint8_t *)SID_INT_N+7) +#define SID_INT_N_V2_FREQ_HI ((uint8_t *)SID_INT_N+8) +#define SID_INT_N_V2_PW_LO ((uint8_t *)SID_INT_N+9) +#define SID_INT_N_V2_PW_HI ((uint8_t *)SID_INT_N+10) +#define SID_INT_N_V2_CTRL ((uint8_t *)SID_INT_N+11) +#define SID_INT_N_V2_ATCK_DECY ((uint8_t *)SID_INT_N+12) +#define SID_INT_N_V2_SSTN_RLSE ((uint8_t *)SID_INT_N+13) +#define SID_INT_N_V3_FREQ_LO ((uint8_t *)SID_INT_N+14) +#define SID_INT_N_V3_FREQ_HI ((uint8_t *)SID_INT_N+15) +#define SID_INT_N_V3_PW_LO ((uint8_t *)SID_INT_N+16) +#define SID_INT_N_V3_PW_HI ((uint8_t *)SID_INT_N+17) +#define SID_INT_N_V3_CTRL ((uint8_t *)SID_INT_N+18) +#define SID_INT_N_V3_ATCK_DECY ((uint8_t *)SID_INT_N+19) +#define SID_INT_N_V3_SSTN_RLSE ((uint8_t *)SID_INT_N+20) +#define SID_INT_N_FC_LO ((uint8_t *)SID_INT_N+21) +#define SID_INT_N_FC_HI ((uint8_t *)SID_INT_N+22) +#define SID_INT_N_RES_FILT ((uint8_t *)SID_INT_N+23) +#define SID_INT_N_MODE_VOL ((uint8_t *)SID_INT_N+24) +#define SID_INT_N_POT_X ((uint8_t *)SID_INT_N+25) +#define SID_INT_N_POT_Y ((uint8_t *)SID_INT_N+26) +#define SID_INT_N_OSC3_RND ((uint8_t *)SID_INT_N+27) +#define SID_INT_N_ENV3 ((uint8_t *)SID_INT_N+28) +#define SID_INT_N_NOT_USED0 ((uint8_t *)SID_INT_N+29) +#define SID_INT_N_NOT_USED1 ((uint8_t *)SID_INT_N+30) +#define SID_INT_N_NOT_USED2 ((uint8_t *)SID_INT_N+31) #endif diff --git a/src/snd/sid.c b/src/snd/sid.c index 6cd6fac..2c50066 100644 --- a/src/snd/sid.c +++ b/src/snd/sid.c @@ -2,6 +2,11 @@ * Implementation of the SID code */ +#include "log_level.h" +#ifndef DEFAULT_LOG_LEVEL + #define DEFAULT_LOG_LEVEL LOG_TRACE +#endif + #include "snd/sid.h" #include "sound_reg.h" #include "dev/rtc.h" @@ -44,7 +49,7 @@ void sid_init(short sid) { volatile unsigned char *sid_base = sid_get_base(sid); if (sid_base) { int offset; - for (offset = 0; offset < 25; offset++) { + for (offset = 0; offset < 32; offset++) { // 32 is the number of register of a SID sid_base[offset] = 0; } } @@ -55,7 +60,7 @@ void sid_init(short sid) { */ void sid_init_all() { int sid; - for (sid = 0; sid < 5; sid++) { + for (sid = 0; sid < N_SIDS; sid++) { sid_init(sid); } }