Problem:
"F12" -> "Edit"-> "Paste From Clipboard"
Pasting an uppercase BASIC program doesn't work; due to the way C64 is always in "uppercase + symbols" mode by default, and how the BASIC interpretor only accepts lower-case entry in the "uppercase + lowercase" mode. (SHIFT+TAB shortcut).
Suggested Solution:
Three options should be in the Edit menu as follows;
Web-based pastes of C64 programs in uppercase, would, then thus work correctly if you select the 3rd option.
Upon selecting the third item, any pastes of uppercase text gets converted to the C64 uppercase (instead of symbols) in the C64 uppercase+symbols mode, and lowercase (instead of uppercase) in the C64 lowercase+uppercase mode (selectable via SHIFT+TAB).
Case Study:
(A) A lot of online examples are all fully upper case BASIC programs.
(B) I have a paid GPT-4 subscription (superior to the free ChatGPT) and asked it to write a colorfully multicolor Merry Christmas message that worked on only the 2nd try (1 change). The GPT-4 outputted a fully working Commodore 64 program that worked on in VICE. The program was as follows (after moving the clear command to an earlier line)
10 POKE 53280, 5 : REM SET BORDER COLOR TO GREEN
20 POKE 53281, 2 : REM SET BACKGROUND COLOR TO RED
30 POKE 53270, PEEK(53270) OR 16 : REM SET CHARACTER MODE TO MULTICOLOR
40 DATA 5, 14, 5, 14, 5, 14, 5, 14, 5, 14, 5, 14, 5, 14, 5
50 PRINT CHR$(147); : REM CLEAR SCREEN
60 PRINT "MERRY CHRISTMAS!"
70 FOR I = 0 TO 14
80 READ C
90 POKE 55296 + I, C : REM SET MULTICOLORS FOR THE MESSAGE
100 NEXT I
Needless to say, GPT-4 wrote the program in all upper-case, forcing me to use a case converter utility to convert to lower case before paste worked.
Interestingly, GPT-4 understood the meanings of various POKE locations and SYS locations, well enough to create this C64 programming well enough to give me a C64 program written by GPT-4 worked on the 2nd try (after asking it to fix the bugs I told it about, screen-clear was at line 110 instead of 50, remove a REM at end of line 40 to prevent too-long BASIC line, plus change the wrong color value number for green for the first POKE).
P.S. C64 is the computer I started programming on, and learned assembly/raster interrupts on in year 1986-1991. I am the author of a very old little-known indie game called "Space Zoom" which is a (sort of) Uridium clone, which was only distributed via a computer-user group, before the Internet days:
www.lemon64.com/forum/viewtopic.php?t=62416
www.marky.ca/programming/animated-spacezoom.gif
www.marky.ca/files/64/mark64.zip
BTW, in ChatGPT, this is what it looks like this image;
Observe the super-easy "Copy Code" link;

For the "Copy Code" link which I wish I could directly paste into VICE but doesn't work without a case-conversion tool;
I stand corrected, after looking at the image; I did manually remove the "REM" part at the dnd of line 40 due to too-long line, and it got two colors wrong, and it needed to sync the number of DATA parameters to the number of colors. So that's probably counting as a 3rd attempt. (The 1st attempt worked; with some glitches). Either way, far better than GPT 3.5.
Aside: I suspect a future GPT-5 next year (especially with a GPT plugin that allows it to be trained to use a C64 debugger IDE to iterate improvements automatically and recognize the image of the screen -- most programmers takes 2 attempts to get a 10-line program to work anyway). AI is moving incredibly fast, apparently, if it can now do simple poke/data-aware programming like this.
Last edit: Mark Rejhon 2023-03-28
But case is of great importance in text strings such as a$="AAAaaa" or special characters such as Shift+a, this should not be automatically changed to lowercase
Maybe use CBMPrgStudio, it accepts Basic code case-insensitive for commands. This can then be compiled to e.g. PRG. You can specify the path to Vice in PrgStudio, it automatically runs the resulting program in Vice.
I've been doing it this way for a long time.
Last edit: radius75 2023-03-28
**radius75, your comment is a good point about all the unintended consequences about strings. **
Olaf, I asked GPT-4 to do a "smart" case conversion for me, and lo-n-behold, it worked.
So two problems solved:
(A) CBMProgStudio recommendation; or
(B) You can just ask GPT-4 to do the case conversion.
Last edit: Mark Rejhon 2023-03-28
If chatgpt were really intelligent, it would know about the pasting issue, and provide the program in lower case :)
Anyway, when suggesting external programs to do case conversion, I would mention vim:
paste the text into vim, select it all in visual mode (
GV1G) and swap case with the~command. Then you can paste it into Vice.More seriously, given @radius75's comment, if we did case conversion, it would need to be optional. Which right away unfortunately makes it more complicated.
Yes, it apparently is (in GPT-4 mode)
I just asked GPT-4 to do it for me on a different program, and it worked!
It does (currently) have more difficulty with sprites and bitmapped modes, but it can be asked to do simple things like drawing diagonal lines in character mapped mode, or displaying HELLO in rainbow colors all over the screen. It at least knows the common POKE commands, apparently.
Minor quip, there's no RUN key on C64 (though some computers do). And if it displays HELLO at the bottom-right corner, it can overwrite up to 4 bytes beyond the screen.
Not too shabby for one-shot programming in the era before its ability to self-iterate and self-debug (e.g. AI operating an IDE to debug its own programs -- they're working on that for GPT-5 or as a GPT-4 plugin).
Be noted, that GPT is only intelligent enough to do things like these if you select GPT-4 during the paid ChatGPT plus subscription ($20/month):
I've been randomly playing with it to see what capabilities it has. Pushing it further, more complex things are gets glitchy/buggy. Upon asking it to make a SNAKE game in 100% BASIC, it kind of made a SNAKE game upon request, though glitched (a couple of bug fixes worked).
Doesn't know enough about the weird bitmap format to do much useful yet, but when prompted to write a line drawing routine in 100% BASIC (asked to avoid SYS and DATA lines) it finally got the bitmap sorta working and sorta tried to draw a diagonal line across a bitmap screen, albiet in a very glitchy way. So close, so far.
Also it seemed to now understand enough raster interrupts to attempt to create a simple splitscreen (the program needed a few bugfixes though).
Most humans can't write this much code on one shot without debugging it, and iterating (understanding how to debug itself). So 100 lines by a human brain, or 100 lines from an AI brain, neither without debugging -- usually isn't going to run on first try.
Based on what I know they're doing (GPT-4 plugins) and some laboratory work on training an AI to operate an IDE (breakpoints, variable watch, etc), they are fairly close to success there; that's key to large AI-written programs;
My view is that (since they're already training AIs to operate computer applications just by reading a helpfile/instruction manual/screen monitoring), is once a future GPT-5 can be easily taught to learn how to use CBMPrgStudio or other apps, it'll probably be able to iterate its own bugs and create full fancy C64 programs. Funny (and somewhat scary) future.
I misphrased my request (splitscreen between text mode and bitmap mode) but it assumed I wanted a bitmap mode on the opposite edge of scan line 50; I know enough 6502 to debug it manually (it was an ok template) that I could manually correct/edit. Used correctly, it can be a tool for C64 rapid application development as well as teaching tool; as it is able to explain each line to me;
I also noticed my GitHub CoPilot subscription is rapidly getting better (from useless to somewhat-useful), and while it doesn't know C64 stuff (yet), the GPT-4 at least seems to have enough C64 knowledge to show promising things in the future;
AI is useful as a tool, it's not particularly good (yet) but VASTLY better than GPT-3 for sure... Now, let's see what GPT-5 + "VM sandboxed AI IDE self-debugger plugin" can do in 2024-2025... They're already working on that (for non C64 contexts)
BTW -- my interest in this is because I have some really old C64 projects from the 80s. I manually wrote SpaceZoom in SuperMon64 (not assembler text), and wrote about 8 kilobytes of machine language by hand in the late 80s/early 90s plus over 30 kilobytes of level data (IIRC, seven different Uridium style levels), accidentally reinventing RLE compression before I knew about RLE compression, to squeeze giant scrollable levels into limited C64 memory between addresses 2048-53247 so it could load as one block (ignoring BASIC ROM as SpaceZoom didn't need it). It was my flagship C64 project, albiet little-known outside the computer user group I was in. So, eventually would like to pull and decompile/convert to ASM/port it/comment it (semi-automaticaly), just for fun a few years into the future. With the help of AI coding tools, and so I've been closely monitoring GPT-4 capabilities. I'd guesstimate ~2025 that it'll become practical. Just give it the helpfile of CBMPrgStudio and PDFs of the best C64 books, and voila -- it potentially becomes a copilot for me to peek at some of my old nostagilia programming. So that's why I am poking the GPT-4 bear to see how it reacts; and its limitations. It does much better if allowed to self-iterate (which some of the API/plugin developers are discovering); much like a human programmer debugging its own software; in its both text-and-image (screenreader + screenmonitoring) multimodal AI capabilities. Anyway, fancy stuff going on there (both exciting and scary).
Anyway, just wanted to share the state of GPT-4 commodore 64 programming knowledge. It's kinda neat it's already learning well into niche territory.
Last edit: Mark Rejhon 2023-03-28
I am moving this to feature request, knowing we have denied this before.
Basically the reason is, that the copy/paste feature is not ment for those things. Even with converting case pasting a non trivial program will not work (an can not). That is why the petcat utility exists.
Ticket moved from /p/vice-emu/bugs/1856/
Can't be converted: