How to detect the SCC?

ページ 4/5
1 | 2 | 3 | | 5

By aoineko

Paladin (1002)

aoineko さんの画像

25-01-2022, 19:46

Oups. I was speaking about ARTAG's detection algorithm (that is suppose to restore page #2 slot after research).

By gdx

Enlighted (6213)

gdx さんの画像

29-01-2022, 15:04

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.

By sdsnatcher73

Prophet (3954)

sdsnatcher73 さんの画像

29-01-2022, 18:00

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.

By gdx

Enlighted (6213)

gdx さんの画像

30-01-2022, 01:56

sdsnatcher73 wrote:

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.

sdsnatcher73 wrote:

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+.

By gdx

Enlighted (6213)

gdx さんの画像

30-01-2022, 15:04

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).

By ARTRAG

Enlighted (6935)

ARTRAG さんの画像

30-01-2022, 16:27

aoineko wrote:

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

By max_iwamoto

Hero (644)

max_iwamoto さんの画像

30-01-2022, 18:02

sdsnatcher73 wrote:

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:

https://docs.google.com/file/d/0B1kyb4fqWeQ9eGpZTWRMczI3SVU/edit?resourcekey=0-xVTuACP0UnOtxZ48BBk0qg

By gdx

Enlighted (6213)

gdx さんの画像

31-01-2022, 10:47

ARTRAG wrote:

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.

By ro

Scribe (4963)

ro さんの画像

15-07-2022, 15:29

Since we're sharing, lemme give my (regular) SCC search routine. I'll expand it to have SCC-I found too soon Smile

;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

By Grauw

Ascended (10768)

Grauw さんの画像

05-04-2022, 21:08

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.

ページ 4/5
1 | 2 | 3 | | 5