Post by bjonte on Jul 6, 2020 9:09:15 GMT
I have been debugging an issue for hours now and I start to run out of options. I have ram bank 0 enabled, shared memory 0-$4000, code at $6000 roughly and I attempt to copy from C128 to REU. Whatever I do, the ram that's stored on the REU is fetched from bank 1. I tried immediate transfer and the delayed transfer that is triggered by a write to $ff00 and even if I point at bank 0 the data is copied from bank 1.
The thing is, if I make a stand-alone program that does this simple store and fetch, it works as intended. In fact I have REU detection code that's running a bit earlier in the program that works. So it looks like I do something to lock the REU into only accessing bank 1. Speed is 1 MHz, interrupts are disabled, nmi is disabled. How is this possible?
Here's a hex dump of the relevant code.
6370: a9 00 lda #C128_CLOCK_SPEED_1_MHZ
6372: 8d 30 d0 sta C128_CLOCK_SPEED
6375: a9 b8 lda #<hex
6377: 8d 02 df sta reu::C64BASE
637a: a9 63 lda #>hex
637c: 8d 03 df sta reu::C64BASE + 1
637f: a9 00 lda #0
6381: 8d 04 df sta reu::REUBASE
6384: a9 00 lda #0
6386: 8d 05 df sta reu::REUBASE + 1
6389: a9 00 lda #0
638b: 8d 06 df sta reu::REUBASE + 2
638e: a9 00 lda #0
6390: 8d 07 df sta reu::TRANSLEN
6393: a9 01 lda #1
6395: 8d 08 df sta reu::TRANSLEN + 1
6398: a9 00 lda #0
639a: 8d 0a df sta reu::CONTROL
639d: a9 a0 lda #reu::EXECUTE | reu::LOAD | reu::TRANSFER_C64_REU
639f: 8d 01 df sta reu::COMMAND
63a2: a9 3e lda #MMUCR_RAM_BANK_0 | MMUCR_4000_RAM | MMUCR_8000_RAM | MMUCR_C000_RAM | MMUCR_D000_IO
63a4: 8d 00 ff sta MMUCR