Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums


Forums > C64 Coding > Detecting REU + VICE
2009-01-08 01:29
AlexC

Registered: Jan 2008
Posts: 235
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
 
... 28 posts hidden. Click here to view all posts....
 
2017-03-19 16:51
Frantic

Registered: Mar 2003
Posts: 1316
Hot Swap Gangsta
2017-05-17 21:17
Bacchus

Registered: Jan 2002
Posts: 53
Comments on a few of the aspects here;

=> My program assumes REU to work and it *will* trash the content. So you should never start it if you want to preserve the REU content. As rightfully asked by LFT, I have no reason what so ever to maintain it's content as it will be trashed anyway when the main code starts. Having a polite scanner that doesn't touch the content is hence sort of pointless IMHO.

=> CRT - I found this method;
http://psw.ca/robin/?page_id=182

He stores value in the registers and read them back. It's different from my store and read back 256 times, but it looks a lot like what you describes. Right?

=> My general concern is hence not to preserve REU but I also want to ensure that cartridges work. A working set-up is to have RetroReplay and REU and I want that to work.
2017-05-18 10:06
Trash

Registered: Jan 2002
Posts: 96
This is a piece of reu-checkcode I have used once upon a time. It isn't optimal in any way and trashes A + X registry and $df01, $df07 and $df08 but it works..


ChekREU  ;returns carry = 1 if REU is present
   sei
   lda $01
   sta store_01 + 1
   and #$30
   sta $01
   ldx #0
   stx $df08
   cpx $d012
   bne * - 3
   dex
   stx $df07
   ldx #%10010011
   stx $df01
store_01
   lda #$00
   sta $01
   lda $d012
   beq noREU
   cli
   sec
   rts
noREU
   cli
   clc
   rts
2017-05-20 10:45
Bacchus

Registered: Jan 2002
Posts: 53
Trash,

Thanx for the snippet. If I get it right you are setting up a compare, and such an operation takes time if the REU is there and no time if the REU isn't there, wherafter you use $D012 to validate if time passed. So the compare itself is not really relevant - it's the difference in duration you're after.

I buy that. It seems like a lot better way of doing it than trusting in memory at $dfxx being unstable where not REU is there.

Groepaz - how does that even work in VICE? Is there some sort of pseudo random return at reading the $dfxx addresses?
2017-05-20 11:18
Groepaz

Registered: Dec 2001
Posts: 8267
its not pseudo-random, it (open i/o) returns the last value that was on the bus, just like on the real thing :)
2017-05-20 11:57
Bacchus

Registered: Jan 2002
Posts: 53
Didn't work :-(

Tried it on Vice but $d012 was 04 regardless if I have enabled or disabled the REU in the settings. Tried it using the REU function in 1541 Ultimate II+ but same result...

// Check REU - based on Trash's code

sei
lda $01
sta store01
and #$30
sta $01

ldx #0
stx $df08
vicloop: cpx $d012
bne vicloop
dex
stx $df07
ldx #%10010011
stx $df01

breakhere: lda store01: #$37
sta $01
lda $d012
bne reufound

noreu: lda #<noreutxt
ldy #>noreutxt
jsr $ab1e
2017-05-20 12:20
Groepaz

Registered: Dec 2001
Posts: 8267
doh - that code can not work when the first thing you are doing is switching off the I/O =)
2017-05-21 20:58
Bacchus

Registered: Jan 2002
Posts: 53
Goepaz - it also doesn't work swapping in the I/O.
2017-05-21 22:23
Trash

Registered: Jan 2002
Posts: 96
I doesnt work because I am stupid and used old code that never worked. I found my detection routine that works without trashing to much stuff:

;-------------------------------------------------------
*= $0810
	sei
;-------------------------------------------------------
		ldx #0
		stx $df08
-		cpx $d012
		bne -
		dex
		stx $df07
; Exchange 255 bytes of c64 and reu memory
		ldx #%10010010
		stx $df01
; Exchange back
		stx $df01
; D012 == 0?
		lda $d012
		bne +
; Yepp, no REU
		lda #0
		sta $d020
		sta $d021
		cli
		jmp *
;-------------------------------------------------------
; No, REU
+	lda #1
	sta $d020
	sta $d021
	cli
	jmp *
;-------------------------------------------------------


The compare didnt work because it stop comparing at any difference.
2017-05-22 11:21
Bacchus

Registered: Jan 2002
Posts: 53
I ran Trash's core core in a continuous loop and then it reset the machine. Setting a source address seems to have fixed that.... Now it works for me!

sei

checkreu: ldx #$05
stx $df02 // Copy to $0500
ldx #0
stx $df03

stx $df08
vicomp: cpx $d012
bne vicomp
dex
stx $df07
// Exchange 255 bytes of c64 and reu memory
ldx #%10010010
stx $df01
// Exchange back
stx $df01

lda $d012
bne reufound
Previous - 1 | 2 | 3 | 4 - 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
Squad333
zscs
algorithm
Matt
knue
Deev/Onslaught
jetan/Albion Crew/Ag..
Guests online: 49
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 Coma Light 13  (9.6)
4 The Shores of Reflec..  (9.6)
5 Lunatico  (9.6)
6 Comaland 100%  (9.5)
7 Incoherent Nightmare  (9.5)
8 Wonderland XII  (9.5)
9 Comaland  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 FMX Music Demo  (9.6)
2 Pandemoniac Part 2 o..  (9.6)
3 Daah, Those Acid Pil..  (9.5)
4 Synthesis  (9.5)
5 Dawnfall V1.1  (9.5)
6 Dawnfall  (9.4)
7 Treu Love [reu]  (9.4)
8 Field Sort  (9.4)
9 Pro Memoria 4  (9.3)
10 KAOS 64  (9.3)
Top Groups
1 Oxyron  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.3)
4 Crest  (9.3)
5 The Judges  (9.3)
Top Fullscreen Graphicians
1 Veto  (9.8)
2 Joe  (9.8)
3 Mirage  (9.7)
4 Jailbird  (9.6)
5 Hein  (9.5)

Home - Disclaimer
Copyright © No Name 2001-2017
Page generated in: 0.35 sec.