| |
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.... |
| |
Mr SQL
Registered: Feb 2023 Posts: 158 |
Quote: It's a good demonstration of why most knowledgeable people prefer written documentation over videos :)
Quote:That caps lock thing with switch sense line has got to be a bug in the rom.
No, the ROM works - its only his BASIC program that is broken :)
Written documentation is great, I particularly found the MOS 6581 datasheet and the C64 memory map most useful:
http://archive.6502.org/datasheets/mos_6581_sid.pdf
https://sta.c64.org/cbm64mem.html
I think overview videos are very useful too, I never know about those specific compatibility issues or the solutions until Robin illustrated them.
What errors did you spot in his BASIC program and why did they cause that compatibility issue? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11510 |
Someone who claims to have written a cycle exact VCS emulator the runs on the C64 should have no problem to spot the problem in the program :) |
| |
Mr SQL
Registered: Feb 2023 Posts: 158 |
Quote: Someone who claims to have written a cycle exact VCS emulator the runs on the C64 should have no problem to spot the problem in the program :)
Well I wish you'd share your findings it sounds intriguing. I'm not as familiar with all of the nuances of the C64/C128 as with the Atari 2600. You wrote C64 and C128 emulators!
I like that ws shared his write-up of the copy protection bug he resolved. That would have been particularly difficult and time consuming to track down and I might not have been able to find the solution. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11510 |
Spotting the problem in the basic program requires zero C64 knowledge, just basic programming 101 |
| |
Mr SQL
Registered: Feb 2023 Posts: 158 |
Quote: Spotting the problem in the basic program requires zero C64 knowledge, just basic programming 101
Very cool, in that case I'm glad you didn't give it away. I will take a look again and see if I can find it. |
| |
Mr SQL
Registered: Feb 2023 Posts: 158 |
Quote: Spotting the problem in the basic program requires zero C64 knowledge, just basic programming 101
OK I took another look and it still looks like a difference on the C128 where bit 6 gets set for memory location 1 unless shift lock is pressed.
Instead of the default of 00110111 or 55 on the C64, Robin get's 01110111 or 119 which is 55+64 indicating the 6th bit is on.
Why is the C128 changing that default? My guess would be bit 6 is reserved for something else on the C128.
His BASIC code looks ok:
10 PRINT PEEK(1):GOTO 10
Is there another section with a BASIC Programming error? |
| |
ws
Registered: Apr 2012 Posts: 251 |
well he actually should have checked for the specific bit, not just compare the entire value. bad practice.
IF PEEK(1) AND 16 = 0 THEN PRINT "BIT 4 IS 0"
IF PEEK(1) AND 16 = 16 THEN PRINT "BIT 4 IS 1"
(given that we count the 8 bits as 0 to 7) |
| |
Mr SQL
Registered: Feb 2023 Posts: 158 |
Quote: well he actually should have checked for the specific bit, not just compare the entire value. bad practice.
IF PEEK(1) AND 16 = 0 THEN PRINT "BIT 4 IS 0"
IF PEEK(1) AND 16 = 16 THEN PRINT "BIT 4 IS 1"
(given that we count the 8 bits as 0 to 7)
Agree this is a best practice for checking the bits individually, but he is checking the default value for the byte at location zero. There are many different ways to program so I can't say his method is wrong.
This still looks like a genuine bug for the default not matching. I took a look at the C64 memory map I linked earlier and it agrees with Robin on the default value, the two highest bits should be off on the C64:
"Default: $37, %00110111" or decimal 55.
Interesting why bit 6 (bit 7 if counting 0 to 7) should be set on the C128. And why does shift-lock turn it back off?? |
| |
Mr SQL
Registered: Feb 2023 Posts: 158 |
Meant to say location 1 :) |
| |
ws
Registered: Apr 2012 Posts: 251 |
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) |
Previous - 1 | 2 | 3 | 4 - Next |