Oups. I was speaking about ARTAG's detection algorithm (that is suppose to restore page #2 slot after research).
I rewrote my SCC+ detection routine and made a SCC detection routine based on the same principe.
Here is tools that use them:
https://1fichier.com/?c37ua6ubrtamckpkns6p
These routines create a table containing all slot numbers with an SCC/SCC+ inserted. These routines do not modify the state of the slots after execution.
These are test versions. I will put the source code online when they are confirmed. Currently, I don't have any hardware to test.
I will try them on Monday. Will it not be better to combine both and maybe use 1 and 2 results in the table (where 1 is SCC and 2 is SCC+) or something along these lines? Will the SCC detection routine also report SCC+ devices? Just asking to see what is the expected outcome.
Will it not be better to combine both and maybe use 1 and 2 results in the table (where 1 is SCC and 2 is SCC+) or something along these lines?
No, because several MSX have cartridge slot that is not 1 or 2 (and this is not the case of the MFR+SD or the C2 for example). If your program needs 2 SCC, you just need to use any two slot numbers in the table. Slot numbers are displayed x-x but they are in the format F000SSPP in the table. The table ends with 0 but it is easy to replace it by FFh for those who prefer.
Will the SCC detection routine also report SCC+ devices?
Yes SCCSRCH detects also the SCC+ because this device is SCC compatible.
SCCPSRCH detects only SCC+.
I read your question too quickly. I prefer made two separate routines because it complicates the task and increases the program size to do both for a limited advantage. Especially since I made these routines so that they can be used in any environement (ROM, MSX-DOS, BASIC).
Oups. I was speaking about ARTAG's detection algorithm (that is suppose to restore page #2 slot after research).
@aoineko
Actually my algorithm is by Alwin Henseler. Even if it does not leave SCC selected page 2, in Uridium it is not important, as there is a specific function to enable the SCC slot after the music replayer has generated the data and another to restore the rom slot.
@gdx
You link is broken. It seems that 1fichier.com is offline
I will try them on Monday. Will it not be better to combine both and maybe use 1 and 2 results in the table (where 1 is SCC and 2 is SCC+) or something along these lines? Will the SCC detection routine also report SCC+ devices? Just asking to see what is the expected outcome.
At the beginning of this topic, I posted the subroutine that searches all slots and detects SCC and SSC+ (SSC-I). It also can store them in the table (but this part was cut out of it because it was not important to the question). So, I am curious why you cannot use that? It has been tested on many configurations and works 100%. It also takes less space in RAM.
I searched through my archives and found the whole code that was used in the SD-Snatcher translation. It creates a table of all SCC devices, prints them, and lets you choose which one to use. I believe it also lets you play music using SCC even if you choose SCC+ cartridge. Here is the link to that:
https://drive.google.com/file/d/1_n0FckNxCX8qejr8k-Yggvfi51mRdakQ/view?usp=sharing
It should be executed from RAM because it uses a self-modifying code. You need to modify it to use RAM variables if you need to run it from ROM.
Here is the picture of it in action:
You link is broken. It seems that 1fichier.com is offline
It was working fine until a while ago since I just removed it.
I put it on Github with the full documented source code.
https://github.com/gdx-msx/SCCSRCH
https://github.com/gdx-msx/SCCPSRCH
These routines do not modify the RAM in the slots.
Edit: I added the routine alone in the wiki page.
Since we're sharing, lemme give my (regular) SCC search routine. I'll expand it to have SCC-I found too soon
;SCC registers SCCENA: EQU #9000 ;Enable SCC SCCWAV: EQU #9800 ;Start of waveforms SCCWLN: EQU 32 ;Length of one waveform SCCWNM: EQU 4 ;Number of waveforms SCCFRQ: EQU #9880 ;Start of frequency channels SCCFLN: EQU 2 ;Length of one frq SCCFNM: EQU 5 ;Number of frq channels SCCVOL: EQU #988A ;Start of volumes per channel SCCVLN: EQU 1 ;Length of one volume SCCVNM: EQU 5 ;Number of channels for volume SCCCHN: EQU #988F ;Select channel (b0-4) SCCTST: EQU #98E0 ;Find SCC v1.0 ;If found, it gets initialized. ;out: Cy, not found else A=SlotID FSCC: ; LD HL,SCCENA-1 ;regular SCC CALL FSCC.4 RET ;Search slots ;In: HL, pointer to search attributes (for future use) ;out:NC, found + A=slotID FSCC.4: ;LD (.FSCC#),HL LD HL,EXPTBL LD B,4 ;4xPrimSlot LD C,#00 ;slot 0-0 FSCC.0: PUSH BC CALL FSCC.1 POP BC RET NC ;found INC HL INC C ;prim slot +1 DJNZ FSCC.0 SCF ;not found RET .FSCC#: DW 0 ;Search 1 prim slot ;in: HL,EXTTBL ; C,prim slot ;out:Cy, found + A=slotID FSCC.1: LD A,(HL) ;Is this base slot extended? AND #80 LD B,1 JR Z,FSCC.2 ;no, so only search 1 slot LD B,4 ;else, search 4 sec slots FSCC.2: PUSH BC PUSH HL LD A,(HL) ;Get ext bit AND #80 ;Cy=0 OR C LD H,#80 CALL ENASLT CALL FSCC.3 POP HL POP BC LD A,C RET NC ;found ADD A,#04 ;Sec slot +1 LD C,A DJNZ FSCC.2 SCF ;not found RET ;Search for SCC in current slot ;out: Cy,not found FSCC.3: LD HL,SCCENA-1 ;(.FSCC#) CALL ISRAM? CCF RET C INC HL LD (HL),#3F ;activate potential SCC XOR A LD (SCCTST),A LD HL,SCCWAV CALL ISRAM? RET ;Check if the address in HL is R/W RAM ;out: Cy,no ISRAM?: LD A,(HL) LD B,A ;backup CPL LD (HL),A CP (HL) SCF RET NZ LD (HL),B ;restore AND A RET
VGMPlay SCC detection here:
https://hg.sr.ht/~grauw/vgmplay-msx/browse/src/drivers/SCC.a...
https://hg.sr.ht/~grauw/vgmplay-msx/browse/src/drivers/SCCPl...
Two versions, since it needs to detect SCC and SCC+ separately.