| |
Jammer
Registered: Nov 2002 Posts: 1336 |
C64/C128 combo program compilation
Question might turn out plainly stupid so bear with me but I'm total noob on C128.
Can C64 program be compiled to run both on C64 and C128 in its native 128k mode if it has appropriate branches in code? Or it's always two separate tailored builds?
I've already learnt that C128 program startup is either $1C01 or $4001 but if C128 startup was embedded at the right spot, would it still launch? |
|
... 35 posts hidden. Click here to view all posts.... |
| |
chatGPZ
Registered: Dec 2001 Posts: 11390 |
for that, just always do the d030 switching in the border. no need to detect anything :) (and then it will automagically also work with other turbos that use that bit) |
| |
Krill
Registered: Apr 2002 Posts: 2981 |
Quoting JammerOne-filed C64 fps game which runs at slightly better framerate if it detects C128 😃 So not running in native C-128 mode? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11390 |
BTW, crafting a file that would load and start in c128 mode instead of c64 mode (and still works in c64 mode) is probably possible too (not trivial, and you'll be forced to load ,8 only in one of the modes). I doubt it makes sense for the sort of thing you have in mind though :) |
| |
Krill
Registered: Apr 2002 Posts: 2981 |
Quoting chatGPZand you'll be forced to load ,8 only in one of the modes) Could be quite possible to craft an ",8,1" (or BLOAD) autorun program that would work in both C-64 and native C-128 modes.
But then again, quite pointless when there is a boot block (plus not a sensible notion of "one-filer" on C-128). |
| |
chatGPZ
Registered: Dec 2001 Posts: 11390 |
oh yeah, with autorun. sure. even more messier :=) |
| |
tlr
Registered: Sep 2003 Posts: 1791 |
For the record, it's quite common to have load addr independent sys starts on the vic20 because the basic start may be at different addresses depending on memory expansion.
Simply include $2c/PEEK(44) in your address calculations.
Using this method you can make a binary that starts from basic on most/all commodore 8-bits. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: for that, just always do the d030 switching in the border. no need to detect anything :) (and then it will automagically also work with other turbos that use that bit)
As GP said. Just flip the bit in the border regardless if it's a C128 or C64. It doesn't matter for the C64, and a C128 user will get the boost. No problems. |
| |
MagerValp
Registered: Dec 2001 Posts: 1078 |
Quoting tlrSimply include $2c/PEEK(44) in your address calculations.
Using this method you can make a binary that starts from basic on most/all commodore 8-bits.
In C128 mode basic start is at $2d/$2e instead, so it requires a little more logic. Certainly still doable, but I don't think I've seen a ready to use basic stub for both C64 and C128? |
| |
Jammer
Registered: Nov 2002 Posts: 1336 |
If I can switch to 2MHz in C64 mode as well, that's perfectly what I need. Thanks! |
| |
oziphantom
Registered: Oct 2014 Posts: 490 |
just doing 2Mhz in the borders, leaves a lot of performance on the table though. If you are doing a native version then you can make full use of the 128.
But if you want to do it in a single load that might be a problem, you would probably need to load "128 patches" after the main binary to replace the 64 versions with the faster 128 versions. |
Previous - 1 | 2 | 3 | 4 | 5 - Next |