| |
AlexC
Registered: Jan 2008 Posts: 299 |
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.... |
| |
Trash
Registered: Jan 2002 Posts: 122 |
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
|
| |
Bacchus
Registered: Jan 2002 Posts: 156 |
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? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
its not pseudo-random, it (open i/o) returns the last value that was on the bus, just like on the real thing :) |
| |
Bacchus
Registered: Jan 2002 Posts: 156 |
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 |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
doh - that code can not work when the first thing you are doing is switching off the I/O =) |
| |
Bacchus
Registered: Jan 2002 Posts: 156 |
Goepaz - it also doesn't work swapping in the I/O. |
| |
Trash
Registered: Jan 2002 Posts: 122 |
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. |
| |
Bacchus
Registered: Jan 2002 Posts: 156 |
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 |
| |
ThunderBlade
Registered: Jan 2002 Posts: 77 |
I want to put a non-intrusive (read-only) REU detection routine in my kernal ROM, so it's executed upon reset. So I see immediately if I have my REU enabled (in 1541Ultimate) or not.
I like the idea of reading $df00, it's the REU status register and as suggested, reading it a couple of times and it never changes, I should be fine. BUT! Action Replay also has stable values at $df00. And 1541U supports tons of other freezers and CRTs that *may* have stable values at $df00.
What's your opinion... currently I think it could be safe to read the other REU registers like C64 address, Interrupt Mask register etc. If they are there with default values (after initial test of stable value at $df00) it should be safe to assume an REU. The values seem to be reset to default upon reset of the C64/1541U... |
| |
Burglar
Registered: Dec 2004 Posts: 1101 |
so, instruct reu to copy data from reu to c64, if data was overwritten, you got a reu enabled. |
Previous - 1 | 2 | 3 | 4 | 5 - Next |