Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Composing > Proposal for 2SID hardware-compatibility
2013-07-25 10:33
Hermit

Registered: May 2008
Posts: 208
Proposal for 2SID hardware-compatibility

I'm fiddling with 2SID hardware solution right now, and got an idea for a most suitable address for the 2nd SID, which could be compatible with almost all hardware solutions (except $de00, $df00, but they're not good selection anyway due to conflicting with AR,TFR, etc. cartridges.)
In VICE it's easy to set 2nd SID base-address, but it's not the case with real C64.
There's a multiplexer circuitry, which uses one of the address lines between A5..A9 ($20..$200) beside the original $d400..$d7ff chip-select signal. The address-line is hardwired in most of the cases, and not easily selectable/switchable in the real machines.
(Btw. I could solve it by hardware to see 2nd SID both in $d420 and $d500 locations, by "OR"-ing A5 and A8 lines...)

I think using/preferring only base-address $D7E0 for 2nd SID in 2SID programs & music releases would ensure that any of the A5..A9 address lines could select the 2nd SID in the machines, similarly to an "OR" function...
(the address came from this simple calculation: $d400+$20+$40+$80+$100+$200 = $D7E0)

It's easier by software than by hardware.
And VICE's 2nd SID address can be set to $D7E0. If VICE emulates the hardware multiplexor, the $d420, $d500, etc. settings could be fine too in VICE, just as on real C64, all would call 2nd SID at $d7E0
I guess it's not hard to configure in SID-players too...

Just, because 2SIDs seem to get more popular and real machine is always better to compose & listen with :)

Maybe the issue, it's not forward-compatible with 3SID, 4SID, etc solutions.


A further improvement to this 'specification' could be to distinguish mono (6 channels) vs stereo (2x3 channels) SID tunes by the A6 or A7 ($40 or $80) address lines, which seem rarely used for 2nd SID selection...
So in that case SID addresses could follow like this:
$d400..$d41f: 1st SID
$d7a0..$d7bf: 2nd SID, A6 ($40) low - line says "mono"
$d7e0..$d7ff: 2nd SID, A6 ($40) high - line says "stereo"

It was just a idea, i couldn't find this in the forum after some search, maybe it was mentioned before, maybe not...
2013-07-25 14:05
tlr

Registered: Sep 2003
Posts: 1787
Wouldn't it be better just to scan for the SIDs?

It shouldn't be too hard to determine how many unique SIDs there are in the $d400-$d800 range.

1. clear $d400-$d800.
2. set up v3 of sid at $d400 for detection.
3. detect (using $d41b) the aliases that exist for that sid.
4. disable v3 of sid at $d400.
5. go back to 2 but with $d420 as base instead.
Continue until enough sids are found (or $d800 is reached.
2013-07-25 17:38
Kabuto
Account closed

Registered: Sep 2004
Posts: 58
Watch out for the VDC which naturally resides at $D600 in C128, even in C64 mode. Something like that should detect the VDC reliably:

LDX #$12
LDY #$DE

LDA #$0E STA $D626 STX $D627
LDA #$0F STA $D626 STY $D627
LDA #$0E STA $D626 CPX $D627 BNE novdp
LDA #$0F STA $D626 CPY $D627 BNE novdp

This writes 2 values into VDP registers that won't cause havoc (cursor position) and then checks whether these values can be read back.

If a SID is connected instead it'll read from voice 3 osc which will never give such values since its maximum envelope speed is limited.
2013-07-26 08:38
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
Hermit,

you should ask my brother Devia about this, because he and Lotus have made what i think is the ultimate 2sid.

The 2sid that Devia has done, and there is a whitepaper on it, you just plug it on, and go! no soldering, no wires.

Devia and Lotus showed it on LCP 2009 party, but people arent interested to invest money in it, so it was never produced.

naybe youre doing it a bit different, and want a programmable sid address for sid #2 ?

write to devia, ulf@harries.dk
2013-07-26 08:40
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
using d420, d440, d480, d4c0 etc for 2nd sid seems best to me, because all the software that use 2 sids, use one of these adresses.

going d7xx seem weird, then all this software is obsolete! :)
2013-07-26 08:42
chatGPZ

Registered: Dec 2001
Posts: 11350
actually there is a lot of software that uses $de00 =P
2013-07-26 11:11
Hermit

Registered: May 2008
Posts: 208
@SIDwave: The $d7e0 address would trigger all of the mentioned $d420, $d480, etc. addresses with the simple multiplexer solution (like my transistor-based solution). So the old programs mustn't be modified...it's just about new programs to be more compatible with existing hardware...
If there are multiplexers which strictly use certain ranges (e.g. $d420..$d41f and no repeated address), this wouldn't work...

@Groepaz: I like to use fastloader cartridge even if I have 2 SIDs in my machine. I remember my first home-made cartridge, it didn't need the $de00 address and worked with $DE00 SID, but for example, an Action Replay cartridge and the MMC Replay clashed with $de00 IIRC... If it's the case, that's not good if $de00 is used a lot...
I checked: In the shematic of Action Replay cartridge the IO1 ($de00) and IO2 ($df00) (pin 7 and 10 of the expansion port) are connected and used/occupied :(
http://www.zimmers.net/anonftp/pub/cbm/schematics/cartridges/c6..
2013-07-26 15:19
tlr

Registered: Sep 2003
Posts: 1787
Quote: Watch out for the VDC which naturally resides at $D600 in C128, even in C64 mode. Something like that should detect the VDC reliably:

LDX #$12
LDY #$DE

LDA #$0E STA $D626 STX $D627
LDA #$0F STA $D626 STY $D627
LDA #$0E STA $D626 CPX $D627 BNE novdp
LDA #$0F STA $D626 CPY $D627 BNE novdp

This writes 2 values into VDP registers that won't cause havoc (cursor position) and then checks whether these values can be read back.

If a SID is connected instead it'll read from voice 3 osc which will never give such values since its maximum envelope speed is limited.


Thanks for pointing that out. $d626/$d627 would be offset 6/7 in a sid (=V0SR + V1FL). Those are write only and unpredictable on read.

Do I understand correctly that the VDC registers are mirrored every 2 bytes in $d600-$d7ff?

Detecting $de00-$dfff sids is a bit more tricky because of unknown types of carts potentially residing there.

A selection of Scan, Partial Scan (e.g $d400-$d5ff) and manual would be appropriate IMO.
2013-07-26 18:35
Kabuto
Account closed

Registered: Sep 2004
Posts: 58
I read incorrect values from a SID register table written in decimal (instead of hex), sorry :(

And yes, the VDC's 2 external registers repeat again and again from $D600 to $D6FF.

Also, check for further SIDs at $D700 in C128.


Here's a corrected version:


; Disable voice 3 by setting the test bit if there's a SID reachable at $D600. This should ensure that reading the oscillator always yields the same value.

LDA #$FF
STA $D612

; Write test values into VDC's cursor address and read them back.
; If there's a SID it'll read voice 3 osc instead and thus get different values.

LDX #$12
LDY #$DE

LDA #$0E STA $D61A STX $D61B
LDA #$0F STA $D61A STY $D61B
LDA #$0E STA $D61A CPX $D61B BNE novdp
LDA #$0F STA $D61A CPY $D61B BNE novdp
2013-07-26 19:11
tlr

Registered: Sep 2003
Posts: 1787
Another approach would be to detect the fact that the machine is a C128 and skip the $d600-$d6ff area based on that. (or always skip $d600-$d6ff because it's presumably rare as sid placement)

C128 can be detected in a couple of ways. I'm tempted to try the 1/2 MHz variant. i.e switch on 2 MHz in the vb area and verify cpu timing against a cia timer.

Does 2 MHz mode affect the VIC output at all if kept in the upper/lower border?
2013-07-26 19:23
Oswald

Registered: Apr 2002
Posts: 5086
sure, if you open the borders, then instead of $3fff always the (every 2nd) byte is displayed that the cpu read last. risen from oblivion exploited this to display fullscreen & top / bottom border gfx. (hint: many lda #$xx).
 
... 22 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 | 4 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
CyberBrain/NoName
Magnar
Twoflower/ΤRIΛD
Guests online: 82
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Uncensored  (9.6)
7 Wonderland XIV  (9.6)
8 Comaland 100%  (9.6)
9 Fishbomb  (9.6)
10 No Bounds  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Libertongo  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Morph  (9.5)
9 Dawnfall V1.1  (9.5)
10 It's More Fun to Com..  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Nostalgia  (9.3)
5 Censor Design  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Crossbow  (9.8)
4 Lft  (9.8)
5 HCL  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.062 sec.