mrehkopf / sd2snes

SD card based multi-purpose cartridge for the SNES
http://sd2snes.de
GNU General Public License v2.0
590 stars 115 forks source link

Super CIC pair mode not fully working on 0.1.8 #99

Closed josete2k closed 5 years ago

josete2k commented 6 years ago

There are some issues in pair mode with this firmware.

0.1.7e is OK

TheLordkahless214 commented 6 years ago

Also having this issue, system Information reports "SuperCIC Detected, not used" "enhanced" or Pair mode last working correctly for me on 1.7b firmware.

Ramsis-SNES commented 6 years ago

Works just fine:

v1 8 supercic

mrehkopf commented 6 years ago

Thanks for checking @Ramsis-SNES, works fine for me, too. @josete2k @TheLordkahless214 Are you using a menu.bin from a previous firmware release (due to the custom theme hack)? Did you enable SuperCIC in the configuration menu -> SuperCIC settings?

josete2k commented 6 years ago

In my case it's a fresh 0.1.8 install.

Yes I enabled supercic settings.

1chip pal.

Menu 60Hz Roms AUTO

I'm launching all pal roms and the supercic key on my sd2snes is set to pal (because I moded my snes three months ago).

.... But

I'm testing again and now it works

Ramsis-SNES commented 6 years ago

Congratulations! :D

TheLordkahless214 commented 6 years ago

I have tried a fresh installation, with new SD card and nothing but the new firmware folder, enabled SuperCIC from the configuration menu still shows "SuperCIC detected, not used"

mrehkopf commented 6 years ago

Even after another power cycle?

TheLordkahless214 commented 6 years ago

imag0807 imag0808

Yes, I'm not sure what else to try, 1.7b still works fine 1.8 doesn't Edit:I added photos

mrehkopf commented 6 years ago

Might be a good idea to downgrade the firmware step by step and see if it actually still works with an older version (unless you did exactly that recently to determine it worked with 0.1.7b).

TheLordkahless214 commented 6 years ago

I updated my post above with photos, I did exactly that and it stops working at 1.7c

mrehkopf commented 6 years ago

Thanks, I'll see what I can make of that.

TheLordkahless214 commented 6 years ago

You're welcome, and thanks for looking into this, hopefully it's an easy fix

mrehkopf commented 6 years ago

What exact model is your SNES?

TheLordkahless214 commented 6 years ago

It is a Super Famicom, Motherboard revision SNS-CPU-RGB-01

mrehkopf commented 6 years ago

Found the problem. In v0.1.7c the CPU clock was raised back from 86MHz to 96MHz. There is a count loop to determine the CIC status (it measures the toggle frequency of a status output pin on the SuperCIC key). It is a simple loop with a fixed number of iterations without any real time control. The value read back depends on the CPU frequency of the sd2snes and also on the CIC clock frequency coming from the SNES. The SNES CIC frequency can be:

By empirical measure, the firmware currently needs at least 2500 toggles per measurement to detect SuperCIC enhanced mode. On a "3.54MHz" SNES that I have, the measured toggles at 96MHz CPU frequency are around 2775. I do not have a SuperCIC modded "3.072MHz" SNES but in proportion I am expecting the readout to be 2775 * 3.072 / 3.54 = 2408 which is less than 2500 and will prevent SuperCIC pair mode detection. I need to make some more measurements and will then adjust the threshold value so it can detect reliably.

mrehkopf commented 6 years ago

Fixed in b702b16