Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C64] strange issue with scandoubler and SD card #147

Open
nippur72 opened this issue May 21, 2020 · 14 comments
Open

[C64] strange issue with scandoubler and SD card #147

nippur72 opened this issue May 21, 2020 · 14 comments

Comments

@nippur72
Copy link
Contributor

I have a strange issue with the C64 core that is driving me mad.

After the recent updates, the C64 always starts in scandoubler mode, regardless of the scandoubler_disable=0 setting in the mist.ini file.

And when I open the F12 menu for loading a file (.PRG or .D64), the SD card shows a corrupted directory.

The old core (c64_191220.rbf) works perfectly fine as well as the other cores. C64 cores newer than 191220 all show the same problematic behavior.

I updated to latest firmware and formatted the SD card putting fresh new files to no avail.

I was able to trace back in time and this commit is the one where the issues started to appear. But looking at the committed code I can't figure what is happening and why isn't working correctly.

Do you have any clue?

Should I assume my board is defective? (or non Mist-compatible as it's a Mistica). A friend who has another Mistica does not have my issues.

@gyurco
Copy link
Contributor

gyurco commented May 21, 2020

Try set ROM_DIRECT_UPLOAD => 1 to 0 for user_io to check if it is caused by the direct SD-Card - FPGA SPI communication.

@nippur72
Copy link
Contributor Author

I just did that, and now it works!!! The core boots in 15Khz as expected and the files in the SD card are ok.

Is this a bug or is my board defective?

@gyurco
Copy link
Contributor

gyurco commented May 22, 2020

Did you try it with other SD Card?
This feature is used in minimig-hdd from the beginning, it's strange why there's a problem only in the C64 core. Maybe because it is used for boot ROM downloading?

@harbaum
Copy link
Contributor

harbaum commented May 22, 2020

Core download in the Genesis core also has issues for me since the direct approach is being used. Initial Download of fpgagen.rom always fails. First manual download via OSD also always fails. Second manual download always succeeds.

Interestingly not a single byte arrives in memory. If there's a rom image still in ram it doesn't get corrupted/replaced by the first two Download attempts.

Since this is very reliable I assume it's a simple setup problem. The fact that the c64 also reliably does something wrong sounds like a logical error and not like a glitch or noise or ....

@gyurco
Copy link
Contributor

gyurco commented May 22, 2020

As it seems to happen only with boot ROM downloading, and "the SD card shows a corrupted directory", maybe something in the firmware? Or three-stating of SPI_MISO is not working well? But I don't see a problem with the code.
Would be interesting to capture some SPI communications when the issue hits. Unfortunately(?) it never happens to me.

@nippur72
Copy link
Contributor Author

I tried with a different SD card brand and it works!

So the issue is caused by SAMSUNG SD cards: I've tried two different "SAMSUNG EVO PLUS 1 32 GB", and they both don't work with the C64 core. I copied the exact same files, I've even tried to format them to 32 kb cluster, but the result it's always the same.

What do you think is the source of incompatibility? It's because the card is "SDHC" and not simple "SD" ?

@gyurco
Copy link
Contributor

gyurco commented May 23, 2020

I don't think so. I'm using a SanDisk Ultra SDHC card currently. Probably something weird happens on the SPI bus with your cards.
I still wonder about those marks:
https://github.com/mist-devel/mist-firmware/blob/master/fat.c#L1216

Finally: I could reproduce the issue with FPGAGEN. If I have a genesis.rom, then the initial loading, and the next load from OSD fail. If I don't have a genesis.rom, then the loading from the OSD always works. I'll try to fix it, and then we can see if the C64 problem is the same. However I'm afraid, it is not.

@gyurco
Copy link
Contributor

gyurco commented May 23, 2020

Hmm, FPGAGEN issue is because the downloader doesn't work during reset, and the ARM sets status[0] during the initial boot ROM upload. I wonder why it did work before.

@gyurco
Copy link
Contributor

gyurco commented May 23, 2020

Found it: it worked, because the CFG loader loaded the reset value from the .cfg, too (which was obviously a non-reset state). This change prevented to mess with reset:
mist-devel/mist-firmware@e648509#diff-03554b634dd123239aa8d64c6e5741e3L314
But caused reset held until the initial download finished (which is the original intention, I think). And the un-reset override didn't work until the cfg is created, thus GENESIS.ROM didn't work until a CFG is actually saved (pretty messy behavior).

However I'm afraid all of these nothing to do with the C64 issue.

@retrofun
Copy link

But now the new cores 200523 don't start when there is no GENESIS.ROM present!
No video signal, no OSD.

Previous cores work fine (fpgagen_20200314.rbf & fpgagen_svp_20191125.rbf).

@gyurco
Copy link
Contributor

gyurco commented May 23, 2020

Ooops, more testing next time...

@gyurco
Copy link
Contributor

gyurco commented May 23, 2020

Now it should be OK. Btw, is it working with the problematic SD cards? Also all recent cores from Jotego are using the direct ROM download.

@harbaum
Copy link
Contributor

harbaum commented May 23, 2020

Excellent. Genesis works like a charm. My 11 year old is seriously impressed that someone from half around the globe just fixed his problem :-)

@gyurco
Copy link
Contributor

gyurco commented May 23, 2020

I'm not that far away :) Greetings to her/him from Hungary!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants