-
Hi, Also I am the proud owner of a OrangeCard. I am doing some baby steps but have some great idea's. I have the following simple test program. Now the PEEK only works the 'first time'. POKE 4096,0; at the c64/c128 before I do the RVSYS$40000000 I do get the black border as first one and the @ sign at screen location $0500. POKE 4096,1; at the c64/c128 side, But that doesn't happen....... )-8 Only when I do; POKE 4096,1; The program starts again and shows the white border and A character as first one. What is going wrong?
I also tried to use; I am sure it is something simple but I have tried a lot already and are just overlooking it. ============================================================= #define PEEK(addr) (*((volatile uint8_t *)(void )(addr))) void main(void) while(1){ for(count=0; count < 10000000;count++); for(count=0; count < 10000000;count++); for(count=0; count < 10000000;count++); for(count=0; count < 10000000;count++); for(count=0; count < 10000000;count++); for(count=0; count < 10000000;count++); for(count=0; count < 10000000;count++); for(count=0; count < 10000000;count++); |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Because the C64 memory space is in the address range 0x0000-0xFFFF, it falls in the range covered by the RiscV core's data cache (any address with the MSB not set is cacheable in the simple setup used). Thus, once you read a value it will end up in the data cache, and stay there until that cache line gets evicted. The You can use this macro to flush the data cache from inside your RiscV code:
However, if you only want to pass some small message from the C64 side to the RiscV, a better option may be to use the mailbox area, which is uncached on the RiscV side. Please see the documentation for details. |
Beta Was this translation helpful? Give feedback.
Because the C64 memory space is in the address range 0x0000-0xFFFF, it falls in the range covered by the RiscV core's data cache (any address with the MSB not set is cacheable in the simple setup used). Thus, once you read a value it will end up in the data cache, and stay there until that cache line gets evicted. The
RVSYS
command flushes both the data and instruction cache before starting the code, which is why re-issuing theRVSYS
command fixes the problem for you.You can use this macro to flush the data cache from inside your RiscV code:
However, if you only want to pass some small message from the C64 side to the RiscV, a b…