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-08 09:53
AlexC

Registered: Jan 2008
Posts: 293
Thank you Groepaz,

By "stable" I've meant that this is the only method that is not failing on my C128D - not that it would work in 100% - while other examples I've found based on REU register writing failed. I know that this is not the right solution. A simple BASIC loop can be used as an example:

fori=1to10:poke57088,0:?peek(57088):nexti

Any ideas how to detect REU presence in more reliable way? Or is writing to REU memory is the only way?
2009-01-08 10:08
Jetboy

Registered: Jul 2006
Posts: 212
Quote: Thank you Groepaz,

By "stable" I've meant that this is the only method that is not failing on my C128D - not that it would work in 100% - while other examples I've found based on REU register writing failed. I know that this is not the right solution. A simple BASIC loop can be used as an example:

fori=1to10:poke57088,0:?peek(57088):nexti

Any ideas how to detect REU presence in more reliable way? Or is writing to REU memory is the only way?


It is either working 100% or not working at all.
For reliable test you should try writing different values to different REU banks (mapped to the same address), then try reading those values and if they match with what you put there then REU is present (or other compatible device). Value you write should be different for each bank you test, to see if they overwrite.

----
http://colors.collectingsmiles.com
2009-01-08 10:56
enthusi

Registered: May 2004
Posts: 675
there can be only one reason to detect REU - so people dont have to chose/select manually.

PLEASE dont test by poking stuff into REU memory.
I seriously wonder why noone cares...
Among the few constant REU users (not me :)
many use it as ramdrive or to store code etc...
I wouldnt want a PRG to trash my data (secretly!).

It is VERY simple to circumvent this, yet noone does so.
Simply LOAD from REU into some c64-RAM before you try to write.
If write is successfull, restore the data previously fetched from that point.

Voila...
Sorry for smartassing but I dont like the general idea of detecting stuff by destroying it.
Reminds me of my famous CPU-meter: make sure CPU is 100%, then show that.
2009-01-08 13:13
Jetboy

Registered: Jul 2006
Posts: 212
Excuse me my ignorance, but does REU keep its content after power down? I always thought it does not. Never bothered to test it when i had it. It sucked bug time because i was not able to use it and AR at the same time. So the only real usage for me was copying disks in one run without need for additional shuffling. Once the copy session was over i was always disconnecting it to remount AR. When i got REU enabled TASM i was almost totally inactive.

----
http://colors.collectingsmiles.com
2009-01-08 13:43
enthusi

Registered: May 2004
Posts: 675
no, REU forgets mem.
However some might keep it plugged in for that very reason.
(there was some optional unit to power REU via batteries btw, (as for georam) but those were/are rare I'd say.)
2009-01-08 16:12
AlexC

Registered: Jan 2008
Posts: 293
Quote: Excuse me my ignorance, but does REU keep its content after power down? I always thought it does not. Never bothered to test it when i had it. It sucked bug time because i was not able to use it and AR at the same time. So the only real usage for me was copying disks in one run without need for additional shuffling. Once the copy session was over i was always disconnecting it to remount AR. When i got REU enabled TASM i was almost totally inactive.

----
http://colors.collectingsmiles.com


If you have port expander like DataLux you can use RR and REU together as RR is leaving $DF00 line free for exactly that reason. MMC Replay works only with very few machines and very few expanders so it's tricky but if you have RR you should be fine to use both at the same time.
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.
Previous - 1 | 2 | 3 | 4 | 5 | 6 - 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
alwyz/udi
Viti/Hokuto Force
Exploding Fi../Techn..
csabanw
Yogibear/Protovision
CommodoreBlog
Guests online: 137
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 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (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 Musicians
1 Rob Hubbard  (9.7)
2 Jeroen Tel  (9.7)
3 Stinsen  (9.6)
4 Mutetus  (9.6)
5 Linus  (9.6)

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