The Commodore VIC-20 and earlier versions of the Commodore 64 have a bug in their BASIC INPUT statement. If the programmer-specified prompt is longer than a screen line, then the prompt gets stored along with the user's response in the variable. In the case of a numeric variable, this causes an endless ?REDO FROM START error loop. After demonstrating the bug and that it was fixed in C64 KERNAL V3, and how to quickly identify what KERNAL version your C64 has, we'll get to the cause of the bug in KERNAL V2 and the way it was fixed in KERNAL V3, and see if we can't backport this fix to the VIC-20 in the form of a patch. Finally, our very own Mr. Doornbos demonstrates the patched VIC-20 KERNAL on real hardware using a ROM Emulator.
Links mentioned:
Mr. Doornbos' blog: https://imapenguin.com/
My previous KERNAL revisions video: https://www.youtube.com/watch?v=If4mcprqBZw
To support 8-Bit Show And Tell:
Become a patron: https://patreon.com/8BitShowAndTell
One-time donation: https://paypal.me/8BitShowAndTell
2nd channel: https://www.youtube.com/channel/UCAgWzEh5c8391eJnELDy9OA
More info about the ROM Emulator:
https://mygeekyhobby.com/2020/07/05/eprom-emulator/https://github.com/Kris-Sekula/EPROM-EMU-NG
VIC-20 KERNAL ROM patch:
The patch should be applied to VIC-20 KERNAL ROM binary file kernal.901486-06.bin (NTSC) or kernal.901486-07.bin (PAL).
30 bytes at offset $597 of file: 20 7e ea a9 15 e8 b4 d9 30 06 18 69 16 e8 10 f6 85 d5 4c b2 ea e4 c9 f0 03 4c 19 e7 60 ea
2 bytes at offset $63D: ac e5
Index:
0:00 INPUT example
1:40 Demonstrating the bug on VIC
3:54 Demonstrating the bug on C64, fixed on KERNAL V3
5:55 How to identify your C64 KERNAL version
9:21 KERNAL V2 Bug Walkthrough
14:26 KERNAL V2 Bug Explanation
20:08 KERNAL V3 Bug Fix
26:40 Backport the C64 V3 Fix to the VIC-20?
28:55 The VIC-20 Patch
31:25 Testing the patch: Mr. Doornbos: imapenguin.com
34:40 Thanks to my patrons
95 Comments