Trilotracker with an external SCC in DOS mode

By Mumbly

Expert (116)

Аватар пользователя Mumbly

30-12-2022, 17:29

Hello,

I'm trying to migrate from Vortex2 to Trilotracker, to start with, I've recently integrate the TT replayer library
in assembly in my code (PSG+SCC version), and it works, BUT only when I'm building a ROM, with an SCC mapper.
I'm just wondering if somebody has already integrate TT replayer in a DOS program, with an external SCC ?

regards,

Для того, чтобы оставить комментарий, необходимо регистрация или !login

By aoineko

Paladin (1004)

Аватар пользователя aoineko

31-12-2022, 12:43

I'm at the same point. I converted the TriloTracker SCC replayer to MSXgl some time ago but it only work for game inside a SCC cartridge. I see the modification to do to make it usable with external SCC but I was waiting for the new replayer the author was working on (along with FM replayer).
Now both are available so I'll work on it in the coming days.
I'll let you know if/when I suceed. Smile

By NYYRIKKI

Enlighted (6067)

Аватар пользователя NYYRIKKI

31-12-2022, 13:16

You may find these routines helpful:
https://www.msx.org/wiki/Konami_SCC/SCC%2B_Programming

By Huey

Prophet (2694)

Аватар пользователя Huey

31-12-2022, 14:19

There is a compiler option for this in the code:

;define EXTERNAL_SCC
define INTERNAL_SCC ; For internal no slot select is needed.

Just uncomment EXTERNAL and comment the INTERNAL_SCC line and fill the correct SLOT of the SCC cartridge in the variable SCC_slot.

Feel free to email me (see profile) if you need help.

By Mumbly

Expert (116)

Аватар пользователя Mumbly

01-01-2023, 12:30

Thanks for the feedback, I wasn’t aware that the latest version includes those capabilities, thanks for the information, I’ll have a look this week.

By Mumbly

Expert (116)

Аватар пользователя Mumbly

03-01-2023, 17:12

I presume that if I'm using TTReplayer in a DOS environment, I don't need anymore the piece of code above, which is always provided in a ROM example of the TTReplayer integration, right ?

; put the same primary-secondary slot in page #8000-#BFFF than the page frame #4000-#7FFF
call 0x138 ; get into A primary slot
rrca
rrca
and 0x03 ; isolate slot for page #4000-#7FFF
ld c,a
ld b,0
ld hl,0xfcc1 ; get subslot flag (bit 7) for this primary slot
add hl,bc
or (hl) ; bit 0-1: primary slot for page #4000-#7fff bit 7 secondary slot (set if secondary)
ld b,a ; save a into b
inc hl
inc hl
inc hl
inc hl
ld a,(hl) ; get the state value of the secondary slot register
and 0x0c ; select only page #4000-#7fff, isolate bit 2-3
or b ; prepare the slotId: bit 0-1: main slot, bit 2-3: subslot state page bit7: bit flag for subslot
; l=#c5 - #c8 ????, should be 0
ld h,0x80 ;
call 0x24 ; Selects the specified slot input A=SlotId, HL= page should be #8000, not #80c5-c8

By Mumbly

Expert (116)

Аватар пользователя Mumbly

09-01-2023, 00:06

Ok, I presume that the following piece of code in the Trilotracker replay module swaps the primary slot from the current one to the SCC slot (page 2 - 8000 to BFFF)

EXTERNAL_SCC has been enabled

IFDEF EXTERNAL_SCC
;--- Init the SCC (waveforms too)
ld a,(SCC_slot)
ld h,0x80
call enaslt
ENDIF

to put back the source slot back after Scc register set

IFDEF EXTERNAL_SCC
ld a,(mapper_slot)
ld h,0x80
call enaslt
ENDIF

I have put/detected an SCC cartridge on primary slot 1, meaning set the SCC_slot value with #01 value

here is how I set the different slot variables:

; detect primary/secondary slot of the #8000 to #7FFF
in a, (#a8)
rrca
rrca
rrca
rrca
and #03
ld c,a
ld b,0
ld hl,0xfcc1
add hl,bc
or (hl)
ld b,a
inc hl
inc hl
inc hl
inc hl
ld a,(hl)
and #0c
or b
; save the primary slot Id
ld (mapper_slot),a

ld a,#01 ; I've put an SCC in primary slot 1 as detected
ld (SCC_slot),a

I would be gratefull if somebody tells me what I missed

I have the impression that the slot swap doesn't operate ?

By Huey

Prophet (2694)

Аватар пользователя Huey

29-01-2023, 15:24

Updated Github with with an example for playback under DOS: https://github.com/cornelisser/TriloTracker-Re-player/tree/m...

By ARTRAG

Enlighted (6935)

Аватар пользователя ARTRAG

30-01-2023, 08:18

The link is broken...

By aoineko

Paladin (1004)

Аватар пользователя aoineko

30-01-2023, 08:22