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 > Detecting REU + VICE
2009-01-08 00:29
AlexC

Registered: Jan 2008
Posts: 293
Detecting REU + VICE

I'm looking for reliable method of detecting REU on different machines (c64/128) and VICE. Either I'm doing something wrong or the only really stable method (without actually writing to REU banks like shown here: http://www.codebase64.org/doku.php?id=base:reu_detect) is this one:

lda #$00
sta $df00
cmp $df00
beq noreu

The following code fails on my C128D:
http://www.willcox.de/index2.htm

At this point I don't need the size of REU as I assume that every single one will provide me with 128KB at least and this is as much as I need.

Thanks in advance
 
... 32 posts hidden. Click here to view all posts....
 
2009-01-09 00:47
DemongerX
Account closed

Registered: Jun 2002
Posts: 137
I've always been able to use my SSv5 with my 1764 ram expander, using one of the port expanders. I know some of them wouldn't allow concurrent use by different carts, but the one I use does. Been great for file copying use, especially 1581 disks in 1 pass.

DemongerX
2017-02-07 01:01
Bacchus

Registered: Jan 2002
Posts: 154
Bumping an old thread to seek advice. It's not like you concluded an example that seems to be agreeable.

Assumption: If the REU is in, $df00 should give a consistent value, but it doesn't necessarily have to be 0, does it? If there is no REU then $df00 could vary. If you read it once you could be be unlucky.

What about this? Read the $DF00 to get what is there (staic value from REU or random from unallocated mem). Then read it again 256 times and compare with the first read. If it fails one of the times it's likely so that $df00 is flickering ram and there is no REU. If it stays consistent over 256 reads, it's likely REU.

My Code:

start lda #00
sta $d020
sta $d021

tax
lda $df00
morecmp cmp $df00
bne noreu ;Assuming REU is not there
inx
bne morecmp

jmp reufound ;Assuming REU IS there

noreu
2017-02-07 01:03
Bacchus

Registered: Jan 2002
Posts: 154
I have to comment the codebase example:

reudetect lda #1
sta $0286 ; textcolor white
lda #00
sta $d020
sta $d021
sta banks
sta reubase
cmp reubase
beq noreu
bne unsafe
unsafe lda reubase

What did the guy drink? "bne unsafe", and then on the next line the label unsafe. I'm sure this is not done to produce that compensating extra cycle for stable rasters ...
2017-02-07 03:28
TWW

Registered: Jul 2009
Posts: 541
I really have no experience with programming REU but in my head, Commodore should have documented with the original REU units if there is a reliable way to detect them.

Further if this is not the case, I would probably write some data to the REU and then verify the same data is being fed back. Then repeat for N banks to determine the size of the REU.
2017-02-07 08:39
JackAsser

Registered: Jun 2002
Posts: 1987
What's wrong with n2c's suggestion?

1) Do a read from REU memory
2) Write some stuff to the address you read from
3) Read back the stuff
4) If they differ => no REU
5) If they do not differ => REU, restore memory corrupted using the backup from 1)
2017-02-07 09:33
AlexC

Registered: Jan 2008
Posts: 293
Somehow I can't belive that through all those years nobody came up with definitive solution for the problem. Agree with JA: what is wrong with this solution?
2017-02-07 19:33
chatGPZ

Registered: Dec 2001
Posts: 11088
i'd do this:
- write $ff to some location
- set up DMA REU->C64 for a single byte, target on the choosen location
- trigger DMA
- check if still $ff, no -> REU present
(need to repeat incase the byte in reu was $ff)
- write $00 to that location
- trigger DMA
- check if still $00, no -> REU present
- else -> no REU present

or you could do what eg wheels does, i extracted the check once: https://sourceforge.net/p/vice-emu/code/HEAD/tree/testprogs/REU.. (this also detects the amount of REU RAM, i think)
2017-02-07 22:13
Bamse

Registered: Apr 2013
Posts: 7
Just thinking:
Set up a dma for some bytes, no fixed address, execute with autoload off, then reload $df04 (or was it?). Increased value = REU present.
2017-02-07 22:24
lft

Registered: Jul 2007
Posts: 369
Another option is to run some non-destructive operation such as REU compare, and measure if there were lost cycles, and how many.

There's one thing I don't quite see, however. What is the point of detecting a REU if you aren't planning to use it? And when you use it, you'll trash whatever ramdisk was there. So why exactly do programs in general need non-destructive REU detection?

I think it makes more sense to warn the user that the REU is about to be used (whether it exists or not), and wait for a go-ahead. Also, REUs are often virtual these days, and this approach would provide an opportunity to enable the REU while the program is running.
2017-02-07 23:31
chatGPZ

Registered: Dec 2001
Posts: 11088
or pop it into the c64! (rock'n'roll!)
Previous - 1 | 2 | 3 | 4 | 5 - 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
nucleus/TempesT
LKP/CFN
Zardax/Artline Designs
Mason/Unicess
t0m3000/ibex-crew
algorithm
Slimex
Guests online: 342
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 No Bounds  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 Party Elk 2  (9.7)
2 Cubic Dream  (9.6)
3 Copper Booze  (9.5)
4 Rainbow Connection  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Onscreen 5k  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Nostalgia  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 MWS  (9.6)

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