-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiled CC65 C PRG does not rerun #438
Comments
This isn't a problem of the emulator. |
Hi Irmen |
As far as I'm aware this has never worked well as it is a characteristic of the code generated by cc65. You will likely find better help with this issue by asking it on the Commander X16 forum and/or the Discord - a lot of people in both places there are using CC65. What I do know is that Prog8 creates explicit circuitry in the outputted PRG to clear/reinitialize all variables at startup, so prog8 programs are able to be re-run multiple times by default. But prog8 is not C |
@Robbie3: As for other compilers, you might want to try out vbcc. It does have an X16 port though it says in the documentation (section 14.19) that it is a rushed port. In terms of the compiler itself, I would expect vbcc to outperform cc65; at least in terms of supported C features it is quite superior. I don't know and haven't looked at how its runtime lib handles static initialisation. For it is the runtime library, more than the compiler itself, that determines the restartability that you are asking about. I have encountered the same question when writing the runtime library for cc64. The trade-off is between restartability and available memory: Either you treat the static initialisation data as constant and copy it over to the live location of the static vars. Then your code is restartable and also ROM-compatible. Or you let the live location of the static vars be the same as the location of the static initialisation data. Then you have more memory available as you save the extra memory for the static initialisation data, but your code can't safely restart, and can't be placed in ROM. For cc64 I chose to copy the data, so cc64 binaries can be restarted. |
Hi
A simple CC65 (latest Oct 22 version) compiled HelloWorld.C, as mentions by Matt Heffernan in YT video t0jU2MjvCM0 @15:03, does not rerun in the r40 and r41 version of the emulator. instead of rerun, the emulator jumps into a debug mode.
load "helloworld.prg" (works)
run (works)
run (results in debug mode, see attached screenshot)
Rerunning the compiled C PRG works in r38.
kind regards, rob
The text was updated successfully, but these errors were encountered: