SCC detection (Development Foros MSX)MSX Resource Center            
                       
English Nederlands Espa�ol Portugu�s Russian                  
 Noticias
   Página principal
  Almacén de noticias
  Temas de noticias

 Recursos
   Foros MSX
  Artículos
  Analisis
  Informe de ferias/RUs
  Álbum de fotos
  Ferias y encuentros
  Encuestas
  Enlaces
  Buscar

 Software
   Descargas
  Tienda Online

 MRC
   Quiénes somos
  Únete a nuestro equipo
  Donar
  Políticas
  Contacta con nosotros
  Enlázanos
  Estadísticas

 Buscar
 
  

  

 Login
 

Login

Contraseña




¿Aún no tienes una cuenta? ¡Conviértete en miembro del MSX Resource Center! ¡Únete a nosotros!.


 Estadísticas
 

Hay 46 invitados y 1 miembro en línea

Eres un usuario anónimo.
 

Foros MSX


Foros MSX

Development - SCC detection

Autor

SCC detection

pitpan
msx master
Mensajes: 1418
Publicado: Enero 31 2003, 16:29   
Hey! How can I detect if a cartridge with SCC is plugged into the computer? Following Sean Young's documents seems so easy: verify if in a ROM slot, after bank-switching, there is or there is not RAM in certain addresses. BUT: how can I do this with expanded slots? (I do need code, please). And what about doing this with computers that have RAM in slots 1 or 2??? Note that SCC cartridge has not its ROM enabled (switch modification ON).

Thank you!



Edu R.


Latok
msx master
Mensajes: 1735
Publicado: Enero 31 2003, 17:18   
The subslot SCC detection is a real problem. I have a slotexpander and most programs who claim to detect SCC cartridges don't coz I have it plugged into a subslot and it is often not recognized. The thing is, the SCC music DOES work though.....So......erhm.....I don't really care



It's an interesting question though. Many programmers could learn from the answer to this question. Simply because I see many programs don't detect the SCC correctly....



Erhm....I don't have the answer
GuyveR800
msx guru
Mensajes: 3048
Publicado: Enero 31 2003, 17:58   
You can also ask questions like these on IRC channel #msxdev on the Rizon network.



To detect a SCC in a subslot requires quite a bit of code. Here's the code from my PSG/FM/SCC music player:



ld de,SearchSCC

ld hl,SCCSlot

call Search

;



Search:

ld [.srch_s],de ; insert search routine address

ld [.srch_p],de

ld [.read_s],hl ; insert address to store slotnr in

ld [.read_p],hl

ld [hl],0 ; reset slotnr



ld b,4

.pri_l: push bc

ld a,4

sub b

ld c,a

ld hl,EXPTBL

add a,l

ld l,a

ld a,[hl]

add a,a

jr nc,.notExp



ld b,4 ; slot is expanded

.exp_l: push bc

ld a,24h

sub b

rlca

rlca

or c

ld [.temp],a



.srch_s: equ $+1

call 0



.read_s: equ $+1

ld a,[0]



or a

pop bc

jr nz,.end

djnz .exp_l

.nextpri:

pop bc

djnz .pri_l

ret



.notExp: ; slot is not expanded

ld a,c

ld [.temp],a



.srch_p: equ $+1

call 0



.read_p: equ $+1

ld a,[0]



or a

jp z,.nextpri

.end: pop bc

ret



.temp: db 0



SearchSCC:

ld hl,[F343h] ; read RAM Slot for page 2

cp l

scf

ret z



ld a,[Search.temp]

ld b,a

and 3

rrca

rrca

ld e,a

rrca

rrca

or e

ld [WriteSCC.PriSlot],a

ld e,a

in a,[A8h]

ld [.restoreA8],a

and 00001111b

or e

out [A8h],a

ld a,b

and 00001100b

rlca

rlca

ld [WriteSCC.SecSlot],a

ld e,a

ld a,[FFFFh]

cpl

ld [.restoreFFFF],a

and 11001111b

or e

ld [ffffh],a

ld hl,9000h

ld de,9800h

ld c,[hl]

ld [hl],3fh

ex de,hl

ld a,[hl]

cpl

ld [hl],a

cp [hl]

cpl

ld [hl],a

ex de,hl

scf

jr nz,.end



ld [hl],0

ex de,hl

ld a,[hl]

cpl

ld [hl],a

cp [hl]

cpl

ld [hl],a

ex de,hl

scf

jr z,.end

ld a,b

ld [SCCSlot],a

or a



.end: ld [hl],c

.restoreFFFF: equ $+1

ld a,0

ld [ffffh],a

.restoreA8: equ $+1

ld a,0

out [a8h],a

ret
pitpan
msx master
Mensajes: 1418
Publicado: Enero 31 2003, 23:22   
Thank you very much for you patience and your code in asm. Now I have to study it and adapt the code to work in my own program (tiny arcade game). SCC sounds cool, the sound is cleaner than PSG or FM-PAC. I will publish my game soon, I hope!


Grauw
msx professional
Mensajes: 1006
Publicado: Febrero 01 2003, 20:01   
Mind you that you can only detect the SCC if you have a 'proper' SCC switch, or if it isn't 'proper', you switched the game 'on' after your MSX has started.



~Grauw
BiFi
msx guru
Mensajes: 3142
Publicado: Febrero 03 2003, 21:38   
Quote:

The subslot SCC detection is a real problem. I have a slotexpander and most programs who claim to detect SCC cartridges don't coz I have it plugged into a subslot and it is often not recognized. The thing is, the SCC music DOES work though.....So......erhm.....I don't really care

It's an interesting question though. Many programmers could learn from the answer to this question. Simply because I see many programs don't detect the SCC correctly....



There is a work-around to this. It seems for some reason subslot 3 in every slotexpander behaves exactly the same as it was an unexpanded slot. So putting your SCC in subslot 3 should solve this problem, even when the detection routine is bound to search in just primary slots. I've never had any real problems detecting SCC's in any subslot. A Sound Cartridge (as in the Snatcher and SD-Snatcher cartridges) does have a problem detecting the RAM for some strange reason. Haven't found a solution to that yet.
 
 







(c) 1994 - 2009 Fundación MSX Resource Center. MSX es una marca registrada de MSX Licensing Corporation