Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > C64 Compatibility with C128 in depth
2023-09-30 23:31
Mr SQL

Registered: Feb 2023
Posts: 158
C64 Compatibility with C128 in depth

Very educational video on 8-bit show and tell:

http://www.youtube.com/watch?v=Ial2VSAu7tw

Robin illustrates using the built-in dissembler/Editor Assembler to correct hotspots where the C128 is incompatible with the C64.

The C128 is still closely compatible for having enhancements to the same hardware. I remember when the CoCo III came out the GIME did not fully emulate the 6847 VDG creating more incompatibilities, particularly with the semigraphics modes.

Interesting commentary at the end of the video regarding the C64 mode being better for game development.
 
... 25 posts hidden. Click here to view all posts....
 
2023-10-02 06:51
Mr SQL

Registered: Feb 2023
Posts: 158
Quote: Relying on default values is never a good idea. Always check individual bits. Bit 6 and 7 of $0001 were formerly unused on the C64 so i guess using it to add some extra features for the extended C128 keyboard was a tolerable change? Thats perhaps why the caps-lock key needed to have an extra bit while not influencing other cruical registers? Just wild guessing.

It is described here http://www.zimmers.net/anonftp/pub/cbm/maps/C128_Mapping.pdf
(Pages 17/18 in the book, 14/15 in the pdf)


I like that Compute manual, great reference book!

This change looks very redundant, it seems like that bit is used just to make it easier to tell if shift-lock is on without using the keyboard matrix. Maybe they should have deactivated it for closer C64 compatibility.

I think that could be a trap for C64 programmers using a C128. I remember it taking some time to figure out how to check for shift-lock on the 64, If I had a C128 instead I might have ended up using that feature in C64 mode to see if shift-lock was on and then the code would never have worked on an actual C64.

The shift-lock key is a very cool key because it's the only toggle switch on the machine besides the power switch.
2023-10-02 08:07
MagerValp

Registered: Dec 2001
Posts: 1082
You seem to be missing the point. Robin intentionally wrote a buggy program to demonstrate the incompatibility. Of course it works if you properly check the bit.
2023-10-02 08:46
oziphantom

Registered: Oct 2014
Posts: 502
it's the "caps lock" not "shift lock" key.

It's a tricky one as you could fix it with writing $6F to 0, but then if the person just so happens to have caps lock engaged it would damage the CPU.

Can't Bit 4 change as well? Does a datacassette nominally put out a 1 or tri-state unless being actively driven by Tape data?
2023-10-02 10:05
Fungus

Registered: Sep 2002
Posts: 746
Quote: it's the "caps lock" not "shift lock" key.

It's a tricky one as you could fix it with writing $6F to 0, but then if the person just so happens to have caps lock engaged it would damage the CPU.

Can't Bit 4 change as well? Does a datacassette nominally put out a 1 or tri-state unless being actively driven by Tape data?


How would setting the data port to output or input damage the CPU? That sounds wrong to me.

Yes Robin said he intentionally wrote the program to demonstrate the bug. You misinterpret things when you glaze over stuff thinking you're right by default and the other person is wrong.

Of course not checking bits exclusively is bad practice, Robin knows that too. But older programmers made stuff for the C64 without any consideration for things like the 128, or even different versions of the C64. Hence why a lot of graphics look like crap on C64C and SIDs sound like crap on the 8580, or vice versa. Shouldn't even be on a horse about such things imo.

I missed the fact initially that the C128 has more stuff connected to the CPU port. I don't program the 128, nor do I care about it or issues related to it because my personal opinion is that it should have never been made and is an abomination. It's a miracle the thing even works (and sometimes doesn't).
2023-10-02 11:35
Martin Piper

Registered: Nov 2007
Posts: 739
It depends on how "CAPLK SENSE" is driven: http://www.zimmers.net/anonftp/pub/cbm/schematics/computers/c12..

CPU U6 pin 24 (P6)

If that pin is set to output by the DDR (which is normally input) and if it drives a logic level driven opposite to the input logic level from caps lock, it might drain quite a bit of current.
2023-10-02 11:44
Fungus

Registered: Sep 2002
Posts: 746
CMOS doesn't usually have that problem, they are open drain iirc. That would make the disk drives blow up if that was the case, and maybe some of the old chips do, but the later ones don't.
2023-10-02 12:01
tlr

Registered: Sep 2003
Posts: 1807
Quote: CMOS doesn't usually have that problem, they are open drain iirc. That would make the disk drives blow up if that was the case, and maybe some of the old chips do, but the later ones don't.

CMOS, where? CMOS is mostly push-pull. C=Complementary.

The IEC bus does have open collector drivers through the use of TTL 7406 buffers. But some of the NMOS in/outs of the CIAs have at least some push-pull capability.
2023-10-02 12:38
chatGPZ

Registered: Dec 2001
Posts: 11510
There is no problem at all with setting the DDR to whatever value. Common practise too :)

That said, he missed one thing, which is in practise more of a problem than the extra bit in the CPU port: The connection of SRQIN and Tape Read can cause weird problems, when a drive that uses SRQIN is connected (ie 1571)
2023-10-02 15:30
ws

Registered: Apr 2012
Posts: 251
Can someone with a C128 check if, if you type LOAD and press Enter in C64 Mode and then press Caps Lock instead of the Play button on the datasette, does the ROM routine see that as a confirmation that Play has been pressed on Tape?

(That would be a bug, i guess)

Further, does the pressing of the play button on tape still get confirmed with the LOAD comand, if Caps Lock is pressed?

If not so, that could be considered a bug (in the Kernel).
2023-10-02 15:41
chatGPZ

Registered: Dec 2001
Posts: 11510
No need to try, just look at the code
http://unusedino.de/ec64/technical/aay/c64/romea31.htm
http://unusedino.de/ec64/technical/aay/c64/romf875.htm
http://unusedino.de/ec64/technical/aay/c64/romfba6.htm
http://unusedino.de/ec64/technical/aay/c64/romfcca.htm

It all does proper bit operations, so no problem with the extra bits
Previous - 1 | 2 | 3 | 4 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
JLD/Finnish Gold
Guests online: 216
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Uncensored  (9.5)
9 Wonderland XIV  (9.5)
10 No Bounds  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 OTD  (9.8)
3 Antitrack  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.072 sec.