Depending on the settings in the *.cfg file you're using for the C64, cc65 banks out the BASIC ROM for continuous RAM from $0800 to $CFFF.pallas wrote:works on vic-20 but crashes (like if you run/stop+restore) on c64.Code: Select all
#elif defined(__C64__) //POKEW(47, size); optional //POKEW(49, size); optional asm("jsr $E518"); // Initialize I/O asm("jsr $E453"); // initialize vectors asm("jsr $E3BF"); // initialize basic ram // currently doesn't work: looks like it crashes before doing the relink asm("jsr $A659"); // clr + reset stack asm("jsr $A533"); // relink basic code asm("jmp $A7AE"); // run #endif
If you set the CPU port register $01 to the standard value (#$37) between these two groups of JSRs, it should work.
Of course, this relies upon that the code in question itself isn't made invisible as it's overlaid by the BASIC ROM, also the rest of the C program would expect the original memory configuration, but as these lines are the last to be executed by the C program, this shouldn't matter.