Has anyone gotten the AYcog demo to work with the C3?
cbmeeks
Posts: 634
Just got my C3 today.
I copied the cybernet.ym file to a microSD card and tried to modify the ExampleAyDumpPlay.spin demo to work with the C3.
I have verified that the SD card is working as I can list the contents of the card. Plus, it correctly identifies the size of the file.
The only audio I hear is what sounds like a constant thrashing sound. Oh, I have copied the relevant C3 source files over to the same directory.
Here is what I am using:
I copied the cybernet.ym file to a microSD card and tried to modify the ExampleAyDumpPlay.spin demo to work with the C3.
I have verified that the SD card is working as I can list the contents of the card. Plus, it correctly identifies the size of the file.
The only audio I hear is what sounds like a constant thrashing sound. Oh, I have copied the relevant C3 source files over to the same directory.
Here is what I am using:
' ' A minimalistic AY/YM dump player. CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 playRate = 50'Hz rightPin = 24 leftPin = 24 VAR byte buffer[100] long filehandle[4] ' generic file handle first_cluster, file_length, curr_pos, directory_entry byte filename[16] long diskbuff_ptr ' generic disk sector buffer, initialized by call to SD driver's Start long mbrbuff_ptr ' master boot record buffer , initialized by call to SD driver's Start long pbrbuff_ptr ' partition boot record , initialized by call to SD driver's Start OBJ AY : "AYcog" SD : "c3_sd_drv_010" PUB Main | bytes_read, display_bytes, index ay.start(rightPin, leftPin) ' Start the emulated AY/YM in a cog sd.Start(@diskbuff_ptr) sd.tvt_pstring(STRING("AY Music Demo")) sd.tvt_out($0D) sd.tvt_out($0D) sd.Set_Debug_Level (sd#DEBUG_OFF) sd.tvt_pstring(STRING("Initializing SPI interface...")) sd.tvt_out($0D) sd.tvt_out($0D) sd.SPI_Init(0) sd.SD_Mount sd.FAT_Read_MBR(mbrbuff_ptr) sd.FAT_Load_Partition_Entry(0, mbrbuff_ptr) sd.FAT_Load_Partition_Boot_Rec(pbrbuff_ptr) ' sd.FAT_Print_Directory sd.tvt_out($0D) sd.tvt_out($0D) sd.tvt_pstring(string("Playing music...")) if ( sd.FAT_File_Open( string("cybernet.ym"), @filehandle) <> -1) repeat index from 0 to (filehandle[1]-1) step 16 waitcnt(cnt + (clkfreq/playRate)) ' Wait one VBL bytes_read := sd.FAT_File_Read(@filehandle, diskbuff_ptr, 16) ay.updateRegisters(@bytes_read) ' Write 16 byte to AYcog
Comments
I have changed the code to:
But all I get is silence.
Based on the original demo (OBEX) the dump file has its header skipped (62 bytes). Where does this happen in your code (I'd expect it after the open call)?