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 Coding > Reliable REU detection
2023-10-26 04:26
Fungus

Registered: Sep 2002
Posts: 617
Reliable REU detection

I've been struggling with this for days. I can detect any REU size except 256K.

From what I understand, I should be able to write data to bank 4, and read back and get crap instead, but I'm getting valid data back.

I don't know if this is a problem with the real thing or a vice issue.

Doesn't anyone have a SIMPLE way to check this, most routines I've found are overly complex for such things. Either the memory is mirrored, or its open bus. It can't be both.
2023-10-26 13:55
tlr

Registered: Sep 2003
Posts: 1714
Quoting Fungus
Doesn't anyone have a SIMPLE way to check this, most routines I've found are overly complex for such things. Either the memory is mirrored, or its open bus. It can't be both.

It has to be either of those for a given REU implementation yes. You don't know which though. For a stock 256KiB REU it is supposedly open bus for the upper 256KiB of an 512KiB address space.

If confused, I would recommend scanning whatever REU implementation you want to target to see which areas are mirrors and which are unmapped. This way you can decide on how to proceed.
2023-10-26 14:08
chatGPZ

Registered: Dec 2001
Posts: 11116
And... there is no SIMPLE way :) That's why so many detection routines "out there" are broken (even the one on codebase is problematic, unfortunately)

Also, when testing, make sure to really test on actual REUs. Not some reimplementation like that on 1541U - those are all broken one way or another. (recent VICE should be somewhat correct, except for some very obscure timing quirks that don't matter for this)
2023-10-26 18:28
Fungus

Registered: Sep 2002
Posts: 617
Yeah, I've decided it's just too much bother to support something that is effectively broken.

Good ole commodore engineers.
2023-10-26 18:34
chatGPZ

Registered: Dec 2001
Posts: 11116
Its not "broken" at all

edit, for the records - MacBacon provided a working one (and i replaced the buggy one on codebase) https://codebase64.org/doku.php?id=base:reu_detect
2023-10-27 10:25
Trash

Registered: Jan 2002
Posts: 122
If all banks are mapped but not there, write a single byte (starting with 0) to address 0 in each bank, count that value up by one and then read back address 0 from the first bank, it should contain 0 on a 16mb reu, 128 on a 8mb reu and so on.
2023-10-27 11:00
Mr. SID

Registered: Jan 2003
Posts: 421
Quote: Its not "broken" at all

edit, for the records - MacBacon provided a working one (and i replaced the buggy one on codebase) https://codebase64.org/doku.php?id=base:reu_detect


Yes, this seems very similar to the method I use in Sonic, which I've tested on everything and the kitchen sink (except TC64).
2023-10-27 11:24
Fungus

Registered: Sep 2002
Posts: 617
Thanks I've had a look at it. Although as I said if a bank has a floating bus, I should be able to detect that as is. I'm not sure what the error is, but I'll try again later.

Trash: That's what doesn't work, that was the first thing I did.
2023-10-27 14:26
chatGPZ

Registered: Dec 2001
Posts: 11116
The nice thing with this method is that it works right also on broken implementations (which mirror bank 4-7 in 256k REU)
2023-10-27 19:09
Frantic

Registered: Mar 2003
Posts: 1627
Quote: Its not "broken" at all

edit, for the records - MacBacon provided a working one (and i replaced the buggy one on codebase) https://codebase64.org/doku.php?id=base:reu_detect


Thanks!
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
mutetus/Ald ^ Ons
Knight Rider/TREX
Black/Angels
Grue/Extend
Guests online: 126
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Logo Graphicians
1 Sander  (10)
2 Facet  (9.7)
3 Mermaid  (9.4)
4 Pal  (9.4)
5 Shine  (9.3)

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