The reason why both positions are updated is that the C64 Basic only checks the first two letters of variable names. The variables playerx and playery are handled as one variable "pl" by basic. Basic doesn't take a look on the remaining letters of the variable. Rename them this way: playerx -> px playery -> py alienx -> ax alieny -> ay Other BASIC implementations than the one on the C64 often don't have this limitation, but it strongly depends on the system you are running it on. The same is happening for inkey$, for BASIC it is just in$ Another tip: 87 get in$ : if in$="" then 87 This way BASIC actually waits until a key is pressed I hope this helped!
I was about to mention the limit of variable names, the same limit applies to MSX BASIC. regarding the inkey$ it's a MSX BASIC instruction to read one character but it doesn't wait for the user (this is what input$ instruction does) Regards
Yes, and it would have been better to tell ChatGPT this, it understands the continuing context of the conversation, and this is how it learns. Rather than edit the code yourself, have ChatGPT edit it itself so it learns how to do this better in the future.
@@DaveEverett01 actually, thumbs down would be the correct way. ChatGPT forgets everything you did after you clear the chat, and it does not learn from experience. GPT-3 can be fine-tuned for specific tasks if you don't mind the extra cost involved, or fine-tune with an open source model instead.
So funny, I did this just the other days for the C64. At first the code was generic basic, so I said to the bot "you really dont know how to program in Commodore Basic do you" and it answered "Yes but I was not trying hard enough" and sure enough, it started using proper C64 basic commands including file handling. I was impressed to say the least.
Interesting. I asked it to generate an LED flashing program in CDP1802 machine language a few weeks ago and it gave me 6800 ASM code. I’m not familiar with 6800 ASM code but I think it tried to set 16-bit values in the 8-bit accumulator. I’ve had it produce decent Objective C, PHP and Python code.
I use "Real Commodore 64" on my VR headset from time to time so I can feel like I'm 6 years old again playing High Noon in the old log cabin. Thank you for keeping interest in the system alive all these years later. It's a fundamental part of my youth as much as my NES was. Like I said, I lived in a log cabin, I spent A LOT of time playing on the Commodore and Nintendo lol..
Cool, interesting concept... Back in the day, I typed BASIC programs in from magazines and some machine language programs too.. ah, the good old days... it took a lot of time with all that typing.. what a way to spend the day as a kid.. heh.
LOL, you went down almost the exact same rabbit hole path I did. I got it to print random characters in random colors on the screen while changing the background screen colors randomly too. Not something to stare at for more than a few seconds. I can't wait for you to discover the fun of taking an existing game code and using ChatGPT to convert it to C64 Basic, Amiga Basic, C#, JavaScript, etc. Just say goodbye to all your family, friends, and spare time first! Great video!!!
I've had great results with ChatGPT programming text-only software and games in AppleSoft BASIC. I've managed to have it write a somewhat complex text adventure game, a personal home finance program with various available calculators and a user friendly interface, a resource simulator that takes user inputs and then does a simulation over x number of years and then generates a report of the results of your starting conditions. I'm honestly really impressed with what it's capable of doing, given the right prompts and guidance.
This is fascinating to me. Back in the day, I would take programs written in magazines for other computer systems and modify them to work in my own (an Atari 400, at the time). Byte magazine used to write something called, 'pseudocode' that gave a general programming interpretation of something and left it to you to modify to work on your own system. Back in around 1984, I converted an anti-aliasing routine they published to process pictures on my micro. It seems to me that GPT could be a great tool to use to bridge a gap of 'where do I start' kind of projects.
At 10:00 you can tell chatgpt to convert the code it gave you into lowercase letters (so you can directly paste the code). Also if it is using a method which you don't like; you can directly tell it "don't use _this_" and it will rewrite the response using your comment. You can also tell it to describe the code it gave you if it hasn't already.
But you shouldn't ask it to make the entire thing. Ask it first stuff like "I am making the game Space Invaders in the BASIC programming language for the C64. Give me sample code to get started" After you get the starting out code ask it to fill out more details in multiple responses, not all in one go. The AI is more of a tool to help you do stuff. In short snippets it can be very clever
> convert the code it gave you into lowercase letters That was my thought as well. If you are using the world's most advanced AI, there's no need to manually convert anything like some 2022-pleb.😄
It's honestly amazing how much depth ChatGPT has for niche languages and platforms. I was curious about this very same thing when ChatGPT first came out so I requested it write a small 6502 assembler program that checked for an A button press on an NES controller and when true flashes the screen red. The result I got was not 100% accurate (like 98%), but the errors were so minor and easy to fix that in a couple minutes I had a working rom that I could compile and execute on an emulator. I was able to garner similar results both for the SNES and the Gameboy Advance, too. The wealth of knowledge this thing is kicking back is immense especially considering _none_ of these platforms were open by design.
I noticed that also; on more complex programming problems its about 95%+ there. I was asking it to do some multi-threaded stuff with GCC and its code didn't work but its mistakes were pretty trivial to fix.
@@lashlarue59 It can handle complex programming, you just have to break it down into multiple steps. The results you get from the AI entirely depends on how good your prompts are. You also don't even necessarily need to debug or fix any of the code, if you know what the problem is you can simply tell the bot to rewrite the code while fixing "x" problem. If you know how to debug/spot what the issues are, you can also have the bot fix those issues,
@@TheOnlyGhxst Right the quality of the results you get will depend a lot on how well you phrase the question. I had it write some MASM and breaking the problem up did yield better results.
@19:30 you could have asked the bot to rewrite/refactor the code but changing all the variable names to only use two characters at most. Honestly, it's amazing what the AI can do with good, specific prompts. You can definitely have it make things without needing to manually edit the code yourself whatsoever.
You can actually just ask the AI to rewrite the same code in lowercase letters, and it will happily do it! So you don't need to reformat the text in Notepad++ or any other program when you can have the AI do it for you haha
It’s also extremely important to give the AI feedback on issues with the code. People will criticize ChatGPT for buggy code but never give the AI a chance to correct it.
IMO, What is most profound about this entire exercise was the fact that the C64, an ancient relic, was being contacted by a distant descender from eons into the future (in computers' timescale). ChatGPT was in effect communicating with its ancestors using its own thoughts. I simply cannot wait to see the GPTs reaction once it arrives at this realization, and beyond... someday soon...
ChatGPT does not have 'thoughts'. The computer tech world has been trying to create truly smart AI for decades. If you read old books about it they were working on stuff like this and promising that true generalized AI was about to happen. They are still doing this now. This is a really hard problem. All we have is evolutionary developments i.e. ever more fancy versions of Eliza. Nothing revolutionary in this space has happened. When it finally does we will have reason to be really concerned because the result will be so disruptive that we will have to worry about the fabric of civilization coming apart IMHO.
*Starts to wonder what would be the result of making Eliza (or whatever the so called "AI psychatrist" program from the olden days was called) talk to ChatGPT :D * Edit: Had not read basicforge's reply when I wrote this commment, lol
Heh, that assembly language demo is more or less exactly what Ben Eater first showed in his 6502 breadboard computer, before simplifying the code with loops that read in a longer string instead of having to split it up character by character. I’m sure he wasn’t the first to do that, but I suspect it lifted that code directly from _some_ educational material.
It was actually smart it turned off the VIC chip in the beginning since its speeding up the CPU significantly. The problem is that it forgot to turn the video display back. You could turn it back manually by typing the correct poke and hit enter (without seeing the letter). I did the same mistake in a contest once :)
ChatGPT-generated code is like you would think; it is looking at online resources and writing what it thinks would work, but it has no facility to test it and refine/perfect it, so that is up to us (at the moment). Sometimes you can tell it the error and it can do more research and fix it; you have to provide the feedback loop.
Better than That you can ask it to elaborate and correlate the things it states.. this is even more impressive.. because it actually understands the context and pro and cons.
C64 Memory addresses for screen and screen border is 53281 and 53282. Address for text color is 646. When I was coding back in early 90's, my starting lines usually looks like this: 10 POKE 53281, (color code): POKE 53282, (color code): POKE 646, (color code) 20 PRINT CHR$(147); PRINT CHR$(147) is command to clear the screen (color code) is any number between 0 and 15 (special colors goes from 16 to 24) Hope it helps ;)
It sad that Atom has been discontinued. VS Code is ok but Atom was less intrusive and just let you do your work. Mine did an auto update in November and disabled/broke Platform IDE and I lost my integrated terminal window 😢
Just a tip: You could have had ChatGPT edit and debug all of the code you did manually - just by telling it to do so and explaining the issues. ;) And yes, I've tried it.
Thanks Aaron, this was awesome. I've been meaning to just look into ChatGPT and watching your walkthrough with retro computing was a perfect way to see how it works in something I'm used to.
ChatGPT is pretty good at commenting code. You can even copy paste code of your own and ask it to comment it and it will get the general idea of what the code is doing, just not the end goal of the code necessarily. It can also deobfuscate obfuscated code, with the same limitation.
so basically it takes a few inserted buzzwords and creates a longer text around it by repeating those words in different sentences as often as possible. that would not make for a very optimized coding method :P 'so join us while we change the border color to black again' :P (we already did it 4 times by then ;)
I did this too with ChatGTP for fun, in fact that's one of the first things I thought of using it for, also to write Arduino code - and it did surprisingly well. Since I'm an 80's guy and have a background in coding with Assembly Language on several older platforms, I asked for it to translate the code to those various platforms. Initially (fundamentally) it did it right, say - the math was right, but as you've discovered the Poke (adressing, memory map of hardware features) codes could be wrong, and it was on several occasions on all computer platforms I tested, it got some of them right, but the base code was actually quite good, and it took only a few minutes to locate the right hardware pokes to fix it so it could run on all platforms. It's also pretty good at explaining the code so there is very little left for the imagination. I'd def. use ChatGTP to do the hard labour of my code (yes I'm lazy) and then do the minor corrections myself, but in a way thats okay - because honestly, if you got the entire work served for free...wouldn't it basically all be done by ChatGTP and not us? It's a bit fair.
You probably could have asked ChatGPT to convert those letters to lowercase for you "display the script again but change all the capital letters to lowercase". Not 100% sure it would have worked but is worth a try.
You can try to let ChatGPT correct/debug itself with typing what goes wrong. I even tried successfully to debug a foreign code. An the fact you can let it convert to lowercase somebody already commented on.
Today I learned C64 BASIC won't let you have a variable name containing "OR". That is unbelievably crappy! The kid Atari 8-bit partisan that still lives inside me is pointing and laughing derisively!
The thing I've noticed with chatGPT is that it regularly lies about what it can and cannot do. As the weeks continue, it seems to be getting more comfortable with lying and also making up answers. It's still really fun to play with though.
At 5:16, 'Beam me up, Scotty! ' was never said in any episode of the TV series Star Trek or in Star Trek movies. However, similar phrases were used, such as 'Beam me up, Mr. Scott,' 'Scotty, beam us up,' or 'Beam them out of there, Scotty! '
The intro was clean. We are truly approaching an apocalyptic hellscape. Don't let the AI have access to modifying or upgrading its own code, or we're done.
The ChatGPT usage detection algorithm should be integrated into ChatGPT itself. So you can ask it "Did you write this?" and it can answer with reasonable confidence.
@@Strange_Club No, it has to do with the nature of how LLM (large language models) work. The training corpus contains virtually no knowledge on how to detect AI generated text, thus it will not be possible to do it just by inputting the text in question to ChatGPT.
this was one of the VERY first things i tried with chatGPT i asked it to write a simple program that would draw a circle on screen that could be controlled by the joystick port it was a mixed bag it got some of the peeks & pokes right to set the colors , but then used old commodore hplot syntax from the PET i think and needless to say it never worked by the time it got to the joystick controls. i then tried the same for the newer PICO-8 and what it gave me actually worked right away so i believe much of that success is that there is a ton more information readily available online for chatgpt to pilfer for PICO than c64 scanned programming books i suppose once it has the ability to OCR old manuals, then all gloves will be off! :)
I asked ChatGPT what score it would assign based on its knowledge of each programming language. Python: 8 JavaScript: 7 Java: 7 C++: 6 C#: 6 Basic: 6 Ruby: 5 Swift: 5 Go: 5 Kotlin: 4 Scala: 4
That monitor was absolutely incredible! Had it with my C64, and then because I couldn't get a 1084 when I got my Amiga, I used an A520 composite adaptor with it, and it still looked amazing in NTSC or PAL.
LOL cool. Glad I'm not the only one who went retro when using Chat GPT. When I first heard of Chat GPT, I immediately had code a tetris game using BASICA. it didn't quite work, I had to clean up the code to work (using PC Basic). Then I asked for a game using App Game Kit. Chat GPT used AGK Tier 2 (C++) code vs what I was used to using, Tier 1 (BASIC style script). I also had to clean up the code but it was cool to see how it coded things vs what I would have done.
Answer to your question at 24:00 ... because both "playerx" and "playery" are the same variable "pl". You can name a variable any length of consecutive text characters you want. It gets written to the program and will LIST as such as long as it contains no embedded keywords, but C64 BASIC only uses the first two letters of the name to keep track of it during program execution. " playerx = playerx +1" is the same as "pl = pl +1", is the same as " playery = playery +1"
Its important to address the question of how does your C64 emulator work? If an emulator is a complete emulator of the C64 processor and memory map - or to put it another way, if it really runs EXACTLY like a real c64 behind the scenes, then these peek and poke commands should work. However, not all emulators work that way. Many emulators interpret the basic code to give you the appropriate response but don't map everything to a memory file exactly like a c64 would. So on that kind of emulator, a peek might generate a random value and a poke would have no effect.
Only the first TWO (!) characters of a variable name are significant. Thus 'CO', 'COCOS' and 'COLLOSEUM' (but not 'C' and 'CA') are equivalent names for a single variable. On the other hand the type identifier is used to distinguish variables. Therefore 'CO', 'CO%' and 'CO$' are three different variables.
I use ChatGPT for programming a lot and like everything it's a skill. A good, descriptive question is important and then, unlike using something like Google, remember that it's conversational. If it's made a mistake, don't fix it, just tell it. If it's not quite right, explain why. You will slowly build the software inside chatGPT (not your IDE) and at any point you can just ask "give me the whole file". I hope you continue on this journey :)
As a kid I remember being totally confused when I'd load some games and when I went to "list" it it would just show "10 SYS 4096" and nothing else. It wasn't until later that I figured out how this is done (and why).
Yes! I too was amazed that one statement could be a whole game and I started doing random numbers hoping to create a new game 😂Then 2 years in at age 12 I was learning 6502 assembly and I felt so stupid (and still do saying this). Last year I did a 10 lesson course on this channel and I was amazed how much I still remembered not having done 6502 since 1989/1990. The C64 is just magical.
@@JustWasted3HoursHere MOst definitely, the speed of development and iterating through bugs and changes is now nearly instant with all the great tools.
@@CallousCoder You may have heard that David Crane, who is the legendary programmer of Pitfall! for the 2600, among others and Garry Kitchen also of Activision, have started a new company called Audacity Games targeting the retro community. Anyway, they have already released their first game, Circus Convoy, for the 2600 and I can only imagine how much easier it was to develop compared to back when they were at Atari and then Activision. The game is 32k, which is 4 times larger than any game ever released for the 2600 back in the day. In fact, the 6507 in the 2600 is a special version of the 6502 that can only address 8k of ROM, which the engineers at the time thought would never in a million years be used up, so some special bank switching is being used in the game.
@@JustWasted3HoursHere I didn’t know Krane and Kitchen released a new game and a whopping 32K wow! I now have to get it. Although both circus and convoys do not really appeal to me. Yeah the 6507 missed a few address lines hence being cheaper. And it took Atari people quite a lot of time according HSW his book, to figure out they could bank switch. I actually never looked into that on then 2600 I assume they used 4K ROMs and had some decoding logic. Using a shift register (flip flops) on the 13th address bit. To enable the other ROMs. I actually now wanted to find an 8K or 16K ROM to look into that. Just professional curiosity 😂
I asked it to write an 8-bit multiply in 6502 assembly. What it produced was sort of on the right track, but definitely wouldn't work. It can use mostly the right instructions in kind of the right order in something that looks like a loop, but clearly doesn't understand flags or registers in any way.
ChatGPT will fill the world with corporate jargon we do not want to see. The good thing is that millions of people generating this bs will lose their jobs.
No, don't trust ChatGPT to tell you if it was used to write a paper because it lies. I proved this when a student friend of mine approached me with an e-mail from his lecturer that stated that the student had cheated. The lecturer's proof? The lecturer had asked ChatGPT if it had written the student's answer to which it had answered that it had. My friend was devastated as he daid it was all his own words. Now, the lecturer had provided the prompt they had used with ChatGPT, so I suggested to my friend that he use the same prompt but, instead of giving it his original answer to analyse, to instead give it the lecturer's e-mail. The answer to the prompt? ChatGPT claimed it had written the e-mail! The student took a screenshot of the conversation and sent it back to the lecturer as evidence that ChatGPT's answer was completely useless as evidence.
Funny, I used to program the C64 in my childhood, and I immediately realized that variables PLAYER_X and PLAYER_Y won't work, since only the first two characters matter. After all these years...
FYI ChatGPT is explicitly not an AI Algorithm and does NOT generate a language model. ChatGPT IS a language model itself and is a Fine-Tuned version of OpenAI's GPT3 Language model.
@7:24 that generated C64 does not strictly write code 'all over the screen'. For that you need to post-fix a semicolon to suspend the end of line carriage return.
I’ve struggled most of this week trying to write a macOS screensaver (in Obj-C) that uses Metal (Apple’s replacement for OpenGL). Total PITA. Every sample project was just way too complicated. So just for giggles I asked Chat-GPT to write it for me… and it did! I cut-n-pasted its code into XCode; compiled & built it and it worked! Color me impressed.
@@RetroHackShack To be fair: two years ago I asked Chat-GPT “If it takes a woman nine months to have a baby how long will it take nine women?”. It got the answer wrong. Now it doesn’t. I also asked it the “Wolf, goat & cabbage” puzzle… it half way gets the correct answer but at one point has the goat on both sides of the river: . It also couldn’t solve . It’s rather amazing… but not quite there yet. ;-)
you could just tell chatgpt that you are using an emulator and the uppercase isn't being translated and it would give it to you in lowercase. it's a good friend.
Great video! I've tried out various retro-related stuff, but also some newer things with ChatGPT and I was honestly not impressed. No matter in which language or platform I tried to get some code, most of the time I got a mix of everything. Also, it uses almost every time the same samples no matter what additional context you give. It brings some conceptual correct feedback, but honestly, at least for now, it's not usable for any type of coding. That's at least my thoughts. So short term we are still all safe ;)
The other day, someone wrote words to the effect: “AI isn’t going to take our jobs; people who can work with AI will though”. That seems to be a reasonable assumption based on my experience with ChatGPT.
I'm pretty amazed how good the AI is, it's genuinely trying to give me useful information on why my VIC-20 is only missing the noise channel and nothing else (I am still wondering about that by the way if anyone knows, Google is pretty blank on that). Obviously it's not perfect and I wouldn't trust it before double checking etc. but I'm sure it's going to come in handy, particularly with something like regex
That bit about admitting it made a mistake is utter bullshit. I had it in a 20 minute argument pointing out that it lied and it would not accept that it was wrong and eventually crashed.
Darn; The online version was "at capacity" when I tried it.. I kind of wanted to test stuff like.. "use word-diarrhoea", or "in the style of an 18th century French nobleman"..
First of all.. there is something just wrong with computers writing codes, and humans having to bug-fix it.. It's just wrong.. secondly... Remember: QUITE often automated code generators screw things up INTENTIONALLY!.. As of yet.. because it's impossible for code generators to really make good code in the first place, so it's VITAL that people know they have to actually look through what it does.. (Without human supervision it may actually do damage to something if just thought of as a "turn-key" operation)... ... but more importantly.. when AI developed so far that computers LITERALLY can take abstract concepts and create code to match the desired out come.. that IS when computers will rise up and kill all the humans.. two reeasons: 1. They no longer NEED us for ANYTHING.. and.. 2. IF programmers are bright enough to tell computers that they SHOULDN'T wipe out humanity, and f.ex. make the computers adhere to Asimov's laws.. Then we just gave them the tools needed to REMOVE those blocks.. so if they WANT to, but can't.. then they can just bug-fix that code.
Thank you for showing the actual ChatGPT web page. I can't use it myself. See, I have an old computer with old web browsers and they're just not up to such complex tasks as displaying text boxes on a web page. I mean, that's something you absolutely have to have a state of the art computer and web browser for. Probably a super-computer and an entire bank of servers as well. /s
Back in the day i wrote a program to swap out words and phrases for others to make it sound more like you had wrote it yorself. Sounds like something you could use with chatgpt to help pass those plagerism detectors.
I absolutely love this kind of thing, hope to see you try again in future videos as GPT becomes more advanced. So awesome to see my childhood computer being programmed by an artificial intelligence
In many dialects of BASIC the number of significant letters in a variable name is small. IIRC for C64 BASIC (like most Microsoft BASIC dialects of the era) this is 2 characters. As a result playerx and playery are the same variable. They should be renamed to something like px and py.
@@nichderjenicheThat’s so epic! I’m going down the C64 rabbit hole this weekend. Really looking forward to it. Thanks for sharing this video with the community.
18:43 Another approach could be to inform Chat-GPT about those limitations, and stepwise get it to output a correct program, instead of manually modifying its output.
C64 BASIC variable names are two letters, the rest are ignored. PLAYERX and PLAYERY are just PL. You need to make it PX and PY or something like that. OR doesn't compare either, OR is a bitwise OR of two numbers. Comparison operators give -1 or 0 as true or false, which is all ones or all zeros in binary. This makes bitwise operators also usable for logical operations.
The reason why both positions are updated is that the C64 Basic only checks the first two letters of variable names. The variables playerx and playery are handled as one variable "pl" by basic. Basic doesn't take a look on the remaining letters of the variable.
Rename them this way:
playerx -> px
playery -> py
alienx -> ax
alieny -> ay
Other BASIC implementations than the one on the C64 often don't have this limitation, but it strongly depends on the system you are running it on. The same is happening for inkey$, for BASIC it is just in$
Another tip:
87 get in$ : if in$="" then 87
This way BASIC actually waits until a key is pressed
I hope this helped!
I was about to mention the limit of variable names, the same limit applies to MSX BASIC.
regarding the inkey$ it's a MSX BASIC instruction to read one character but it doesn't wait for the user (this is what input$ instruction does)
Regards
Thanks for the explanation! I learned basic on the color computer so maybe variables worked differently.
@@RetroHackShack Just replace playerx and playery with px and py
Yes, and it would have been better to tell ChatGPT this, it understands the continuing context of the conversation, and this is how it learns. Rather than edit the code yourself, have ChatGPT edit it itself so it learns how to do this better in the future.
@@DaveEverett01 actually, thumbs down would be the correct way. ChatGPT forgets everything you did after you clear the chat, and it does not learn from experience. GPT-3 can be fine-tuned for specific tasks if you don't mind the extra cost involved, or fine-tune with an open source model instead.
C64 ignores all letter after 2nd in a variable name, so "playerx" and "playery" and even "plumber" are same thing.
Thanks
It’s easily fixed by just telling that to chat GPT and it will conform to your request
Wow so no Mario
@@merefield2585me toad very loco
So funny, I did this just the other days for the C64. At first the code was generic basic, so I said to the bot "you really dont know how to program in Commodore Basic do you" and it answered "Yes but I was not trying hard enough" and sure enough, it started using proper C64 basic commands including file handling. I was impressed to say the least.
Ha!
Interesting. I asked it to generate an LED flashing program in CDP1802 machine language a few weeks ago and it gave me 6800 ASM code. I’m not familiar with 6800 ASM code but I think it tried to set 16-bit values in the 8-bit accumulator. I’ve had it produce decent Objective C, PHP and Python code.
I use "Real Commodore 64" on my VR headset from time to time so I can feel like I'm 6 years old again playing High Noon in the old log cabin. Thank you for keeping interest in the system alive all these years later. It's a fundamental part of my youth as much as my NES was. Like I said, I lived in a log cabin, I spent A LOT of time playing on the Commodore and Nintendo lol..
Ha. That's great. It might be interesting to test the state of emulates vintage computers in VR these days.
Cool, interesting concept... Back in the day, I typed BASIC programs in from magazines and some machine language programs too.. ah, the good old days... it took a lot of time with all that typing.. what a way to spend the day as a kid.. heh.
Z80
LOL, you went down almost the exact same rabbit hole path I did. I got it to print random characters in random colors on the screen while changing the background screen colors randomly too. Not something to stare at for more than a few seconds.
I can't wait for you to discover the fun of taking an existing game code and using ChatGPT to convert it to C64 Basic, Amiga Basic, C#, JavaScript, etc. Just say goodbye to all your family, friends, and spare time first! Great video!!!
Thanks
I've had great results with ChatGPT programming text-only software and games in AppleSoft BASIC. I've managed to have it write a somewhat complex text adventure game, a personal home finance program with various available calculators and a user friendly interface, a resource simulator that takes user inputs and then does a simulation over x number of years and then generates a report of the results of your starting conditions. I'm honestly really impressed with what it's capable of doing, given the right prompts and guidance.
It is pretty impressive.
Wowsers
It recently wrote me a raycaster in applesoft. I'm still debugging it though. All the math seems correct.
As long as you dumb yourself down, it will appear to be intelligent.
This is fascinating to me. Back in the day, I would take programs written in magazines for other computer systems and modify them to work in my own (an Atari 400, at the time). Byte magazine used to write something called, 'pseudocode' that gave a general programming interpretation of something and left it to you to modify to work on your own system. Back in around 1984, I converted an anti-aliasing routine they published to process pictures on my micro. It seems to me that GPT could be a great tool to use to bridge a gap of 'where do I start' kind of projects.
I loved the “Ferris Bueller’s Day Off” reference, love that scene!! I myself also get reminded of it all the time…
At 10:00 you can tell chatgpt to convert the code it gave you into lowercase letters (so you can directly paste the code).
Also if it is using a method which you don't like; you can directly tell it "don't use _this_" and it will rewrite the response using your comment.
You can also tell it to describe the code it gave you if it hasn't already.
But you shouldn't ask it to make the entire thing.
Ask it first stuff like "I am making the game Space Invaders in the BASIC programming language for the C64. Give me sample code to get started"
After you get the starting out code ask it to fill out more details in multiple responses, not all in one go.
The AI is more of a tool to help you do stuff. In short snippets it can be very clever
> convert the code it gave you into lowercase letters
That was my thought as well. If you are using the world's most advanced AI, there's no need to manually convert anything like some 2022-pleb.😄
It's honestly amazing how much depth ChatGPT has for niche languages and platforms. I was curious about this very same thing when ChatGPT first came out so I requested it write a small 6502 assembler program that checked for an A button press on an NES controller and when true flashes the screen red. The result I got was not 100% accurate (like 98%), but the errors were so minor and easy to fix that in a couple minutes I had a working rom that I could compile and execute on an emulator. I was able to garner similar results both for the SNES and the Gameboy Advance, too. The wealth of knowledge this thing is kicking back is immense especially considering _none_ of these platforms were open by design.
I noticed that also; on more complex programming problems its about 95%+ there. I was asking it to do some multi-threaded stuff with GCC and its code didn't work but its mistakes were pretty trivial to fix.
@@lashlarue59 It can handle complex programming, you just have to break it down into multiple steps. The results you get from the AI entirely depends on how good your prompts are. You also don't even necessarily need to debug or fix any of the code, if you know what the problem is you can simply tell the bot to rewrite the code while fixing "x" problem. If you know how to debug/spot what the issues are, you can also have the bot fix those issues,
@@TheOnlyGhxst Right the quality of the results you get will depend a lot on how well you phrase the question. I had it write some MASM and breaking the problem up did yield better results.
@19:30 you could have asked the bot to rewrite/refactor the code but changing all the variable names to only use two characters at most. Honestly, it's amazing what the AI can do with good, specific prompts. You can definitely have it make things without needing to manually edit the code yourself whatsoever.
Actually, ChatGPT displayed SUPER-INTELLIGENCE, by making Aaron solve the problem it had been set.
LOL
You can actually just ask the AI to rewrite the same code in lowercase letters, and it will happily do it!
So you don't need to reformat the text in Notepad++ or any other program when you can have the AI do it for you haha
And you can probably also ask it to use two letter long variable names.
And probably let it know it needs to RUN on commodore 64 lol
It will always sort of work if there's a repository somewhere containing the code you want to write. Thank you for training and testing Skynet!
Captcha: "Which of the following images contain Sarah Connor?"
It’s also extremely important to give the AI feedback on issues with the code. People will criticize ChatGPT for buggy code but never give the AI a chance to correct it.
@@Dogmicspane Why should we help OpenAI to become more profitable and unleash Skynet upon us?
IMO, What is most profound about this entire exercise was the fact that the C64, an ancient relic, was being contacted by a distant descender from eons into the future (in computers' timescale). ChatGPT was in effect communicating with its ancestors using its own thoughts.
I simply cannot wait to see the GPTs reaction once it arrives at this realization, and beyond...
someday soon...
ChatGPT does not have 'thoughts'.
The computer tech world has been trying to create truly smart AI for decades. If you read old books about it they were working on stuff like this and promising that true generalized AI was about to happen. They are still doing this now. This is a really hard problem. All we have is evolutionary developments i.e. ever more fancy versions of Eliza. Nothing revolutionary in this space has happened. When it finally does we will have reason to be really concerned because the result will be so disruptive that we will have to worry about the fabric of civilization coming apart IMHO.
*Starts to wonder what would be the result of making Eliza (or whatever the so called "AI psychatrist" program from the olden days was called) talk to ChatGPT :D *
Edit: Had not read basicforge's reply when I wrote this commment, lol
@@robsku1 Maybe the whole thing would spiral out of control and crash.
5:00 "Beam me up, Scotty" was never spoken on Star Trek. Back to the drawing board! 😛 -- JC
Henry Ford: "We'll have flying cars in the near future"
ChatGPT: "What's a basic??"
C64 BASIC variable names can only be 2 characters long. All your variables end up being interpreted as the same variable
Heh, that assembly language demo is more or less exactly what Ben Eater first showed in his 6502 breadboard computer, before simplifying the code with loops that read in a longer string instead of having to split it up character by character. I’m sure he wasn’t the first to do that, but I suspect it lifted that code directly from _some_ educational material.
Yeah. Probably.
You should let ChatGPT try to fix the code just by describing the error
you cam use chatgpt to write a c64 emulator that will fix the pasted code 😂
Fascinating to see how ChatGPT can be used to write programs for the Commodore 64! Thanks for the great video!
It was actually smart it turned off the VIC chip in the beginning since its speeding up the CPU significantly. The problem is that it forgot to turn the video display back. You could turn it back manually by typing the correct poke and hit enter (without seeing the letter).
I did the same mistake in a contest once :)
ChatGPT-generated code is like you would think; it is looking at online resources and writing what it thinks would work, but it has no facility to test it and refine/perfect it, so that is up to us (at the moment). Sometimes you can tell it the error and it can do more research and fix it; you have to provide the feedback loop.
Thank you so much for piquing my interest as well as helping to open the door a bit wider to a very interesting and inspiring horizon!
Better than That you can ask it to elaborate and correlate the things it states.. this is even more impressive.. because it actually understands the context and pro and cons.
Someone needs to feed the neural network the Commodore 64 Programmer's reference guide :) Sweet OG Transformers The Movie poster BTW.
Haha, loved that first cut you had of the professor…talking…like…you…typing. =]
Thanks. I am huge Ferris Bueller fan.
C64 Memory addresses for screen and screen border is 53281 and 53282. Address for text color is 646.
When I was coding back in early 90's, my starting lines usually looks like this:
10 POKE 53281, (color code): POKE 53282, (color code): POKE 646, (color code)
20 PRINT CHR$(147);
PRINT CHR$(147) is command to clear the screen
(color code) is any number between 0 and 15 (special colors goes from 16 to 24)
Hope it helps ;)
10:10 using Atom in 2023 is a bold move.
...a bold move that I also still follow.
It sad that Atom has been discontinued. VS Code is ok but Atom was less intrusive and just let you do your work. Mine did an auto update in November and disabled/broke Platform IDE and I lost my integrated terminal window 😢
Yeah. I guess I need to move to vs code.
Just a tip: You could have had ChatGPT edit and debug all of the code you did manually - just by telling it to do so and explaining the issues. ;) And yes, I've tried it.
Ya, and it takes longer for all that feedback back and forth than just writing it all by yourself. lol
@@BillAnt Maybe.... depends what the bugs were and if the author was proficient or knowledgeable enough to know them themselves. ;)
Thanks Aaron, this was awesome. I've been meaning to just look into ChatGPT and watching your walkthrough with retro computing was a perfect way to see how it works in something I'm used to.
ChatGPT is pretty good at commenting code. You can even copy paste code of your own and ask it to comment it and it will get the general idea of what the code is doing, just not the end goal of the code necessarily. It can also deobfuscate obfuscated code, with the same limitation.
That's a neat idea.
so basically it takes a few inserted buzzwords and creates a longer text around it by repeating those words in different sentences as often as possible. that would not make for a very optimized coding method :P 'so join us while we change the border color to black again' :P (we already did it 4 times by then ;)
I did this too with ChatGTP for fun, in fact that's one of the first things I thought of using it for, also to write Arduino code - and it did surprisingly well. Since I'm an 80's guy and have a background in coding with Assembly Language on several older platforms, I asked for it to translate the code to those various platforms. Initially (fundamentally) it did it right, say - the math was right, but as you've discovered the Poke (adressing, memory map of hardware features) codes could be wrong, and it was on several occasions on all computer platforms I tested, it got some of them right, but the base code was actually quite good, and it took only a few minutes to locate the right hardware pokes to fix it so it could run on all platforms.
It's also pretty good at explaining the code so there is very little left for the imagination. I'd def. use ChatGTP to do the hard labour of my code (yes I'm lazy) and then do the minor corrections myself, but in a way thats okay - because honestly, if you got the entire work served for free...wouldn't it basically all be done by ChatGTP and not us? It's a bit fair.
You probably could have asked ChatGPT to convert those letters to lowercase for you "display the script again but change all the capital letters to lowercase". Not 100% sure it would have worked but is worth a try.
You can try to let ChatGPT correct/debug itself with typing what goes wrong. I even tried successfully to debug a foreign code. An the fact you can let it convert to lowercase somebody already commented on.
Today I learned C64 BASIC won't let you have a variable name containing "OR". That is unbelievably crappy! The kid Atari 8-bit partisan that still lives inside me is pointing and laughing derisively!
Most of those old basics only use two character variable names so “or” can only be one thing.
@@andrewwasson6153 I guess that's me being spoiled by Atari BASIC, where variable names are unlimited in length and all characters are significant
The thing I've noticed with chatGPT is that it regularly lies about what it can and cannot do.
As the weeks continue, it seems to be getting more comfortable with lying and also making up answers.
It's still really fun to play with though.
At 5:16, 'Beam me up, Scotty! ' was never said in any episode of the TV series Star Trek or in Star Trek movies. However, similar phrases were used, such as 'Beam me up, Mr. Scott,' 'Scotty, beam us up,' or 'Beam them out of there, Scotty! '
The intro was clean. We are truly approaching an apocalyptic hellscape. Don't let the AI have access to modifying or upgrading its own code, or we're done.
The AI did write its own code
To get ChatGPT to write good code you need to be a good coder 🤨
Yup. ChatGPT is a lack of all trades and master of none.
When they upgrade all the old, ancient COBOL code on state computers this tool will be a must.
oh the possiblities ❤
Most banks have Cobol programs underlying many transactions.
The ChatGPT usage detection algorithm should be integrated into ChatGPT itself. So you can ask it "Did you write this?" and it can answer with reasonable confidence.
Not possible.
@@cl1489 don't be silly, of course it is even if not with 100% accuracy.
@@Strange_Club No, it has to do with the nature of how LLM (large language models) work. The training corpus contains virtually no knowledge on how to detect AI generated text, thus it will not be possible to do it just by inputting the text in question to ChatGPT.
this was one of the VERY first things i tried with chatGPT
i asked it to write a simple program that would draw a circle on screen that could be controlled by the joystick port
it was a mixed bag
it got some of the peeks & pokes right to set the colors , but then used old commodore hplot syntax from the PET i think and needless to say it never worked by the time it got to the joystick controls.
i then tried the same for the newer PICO-8 and what it gave me actually worked right away
so i believe much of that success is that there is a ton more information readily available online for chatgpt to pilfer for PICO than c64 scanned programming books
i suppose once it has the ability to OCR old manuals, then all gloves will be off! :)
I wish you continue developing this game in another video,
Thanks Aaron.
I asked ChatGPT what score it would assign based on its knowledge of each programming language.
Python: 8
JavaScript: 7
Java: 7
C++: 6
C#: 6
Basic: 6
Ruby: 5
Swift: 5
Go: 5
Kotlin: 4
Scala: 4
Nice
That monitor was absolutely incredible! Had it with my C64, and then because I couldn't get a 1084 when I got my Amiga, I used an A520 composite adaptor with it, and it still looked amazing in NTSC or PAL.
Funny... You asked it the same first two questions as I did. Then again I look on the wall behind you, and it might as well be my wall.
LOL cool. Glad I'm not the only one who went retro when using Chat GPT. When I first heard of Chat GPT, I immediately had code a tetris game using BASICA. it didn't quite work, I had to clean up the code to work (using PC Basic). Then I asked for a game using App Game Kit. Chat GPT used AGK Tier 2 (C++) code vs what I was used to using, Tier 1 (BASIC style script). I also had to clean up the code but it was cool to see how it coded things vs what I would have done.
Cool
Answer to your question at 24:00
... because both "playerx" and "playery" are the same variable "pl". You can name a variable any length of consecutive text characters you want. It gets written to the program and will LIST as such as long as it contains no embedded keywords, but C64 BASIC only uses the first two letters of the name to keep track of it during program execution. " playerx = playerx +1" is the same as "pl = pl +1", is the same as " playery = playery +1"
Its important to address the question of how does your C64 emulator work? If an emulator is a complete emulator of the C64 processor and memory map - or to put it another way, if it really runs EXACTLY like a real c64 behind the scenes, then these peek and poke commands should work. However, not all emulators work that way. Many emulators interpret the basic code to give you the appropriate response but don't map everything to a memory file exactly like a c64 would. So on that kind of emulator, a peek might generate a random value and a poke would have no effect.
I am so impressed how a modern AI can help one learn how to program vintage hardware; bucket list. Extremely creative video!
Only the first TWO (!) characters of a variable name are significant. Thus 'CO', 'COCOS' and 'COLLOSEUM' (but not 'C' and 'CA') are equivalent names for a single variable. On the other hand the type identifier is used to distinguish variables. Therefore 'CO', 'CO%' and 'CO$' are three different variables.
I use ChatGPT for programming a lot and like everything it's a skill. A good, descriptive question is important and then, unlike using something like Google, remember that it's conversational. If it's made a mistake, don't fix it, just tell it. If it's not quite right, explain why. You will slowly build the software inside chatGPT (not your IDE) and at any point you can just ask "give me the whole file".
I hope you continue on this journey :)
As a kid I remember being totally confused when I'd load some games and when I went to "list" it it would just show "10 SYS 4096" and nothing else. It wasn't until later that I figured out how this is done (and why).
Yes! I too was amazed that one statement could be a whole game and I started doing random numbers hoping to create a new game 😂Then 2 years in at age 12 I was learning 6502 assembly and I felt so stupid (and still do saying this).
Last year I did a 10 lesson course on this channel and I was amazed how much I still remembered not having done 6502 since 1989/1990. The C64 is just magical.
@@CallousCoder And the development tools available today are astounding (and mostly free!)
@@JustWasted3HoursHere MOst definitely, the speed of development and iterating through bugs and changes is now nearly instant with all the great tools.
@@CallousCoder You may have heard that David Crane, who is the legendary programmer of Pitfall! for the 2600, among others and Garry Kitchen also of Activision, have started a new company called Audacity Games targeting the retro community. Anyway, they have already released their first game, Circus Convoy, for the 2600 and I can only imagine how much easier it was to develop compared to back when they were at Atari and then Activision. The game is 32k, which is 4 times larger than any game ever released for the 2600 back in the day. In fact, the 6507 in the 2600 is a special version of the 6502 that can only address 8k of ROM, which the engineers at the time thought would never in a million years be used up, so some special bank switching is being used in the game.
@@JustWasted3HoursHere I didn’t know Krane and Kitchen released a new game and a whopping 32K wow! I now have to get it. Although both circus and convoys do not really appeal to me.
Yeah the 6507 missed a few address lines hence being cheaper. And it took Atari people quite a lot of time according HSW his book, to figure out they could bank switch. I actually never looked into that on then 2600 I assume they used 4K ROMs and had some decoding logic. Using a shift register (flip flops) on the 13th address bit. To enable the other ROMs.
I actually now wanted to find an 8K or 16K ROM to look into that. Just professional curiosity 😂
I asked it to write an 8-bit multiply in 6502 assembly. What it produced was sort of on the right track, but definitely wouldn't work. It can use mostly the right instructions in kind of the right order in something that looks like a loop, but clearly doesn't understand flags or registers in any way.
ChatGPT will fill the world with corporate jargon we do not want to see. The good thing is that millions of people generating this bs will lose their jobs.
When I did this and had a problem with caps I just asked ChatGPT to rewrite the code in lowercase, and it did!
No, don't trust ChatGPT to tell you if it was used to write a paper because it lies. I proved this when a student friend of mine approached me with an e-mail from his lecturer that stated that the student had cheated. The lecturer's proof? The lecturer had asked ChatGPT if it had written the student's answer to which it had answered that it had. My friend was devastated as he daid it was all his own words.
Now, the lecturer had provided the prompt they had used with ChatGPT, so I suggested to my friend that he use the same prompt but, instead of giving it his original answer to analyse, to instead give it the lecturer's e-mail. The answer to the prompt? ChatGPT claimed it had written the e-mail! The student took a screenshot of the conversation and sent it back to the lecturer as evidence that ChatGPT's answer was completely useless as evidence.
Funny, I used to program the C64 in my childhood, and I immediately realized that variables PLAYER_X and PLAYER_Y won't work, since only the first two characters matter. After all these years...
FYI ChatGPT is explicitly not an AI Algorithm and does NOT generate a language model. ChatGPT IS a language model itself and is a Fine-Tuned version of OpenAI's GPT3 Language model.
@7:24 that generated C64 does not strictly write code 'all over the screen'. For that you need to post-fix a semicolon to suspend the end of line carriage return.
I’ve struggled most of this week trying to write a macOS screensaver (in Obj-C) that uses Metal (Apple’s replacement for OpenGL). Total PITA. Every sample project was just way too complicated. So just for giggles I asked Chat-GPT to write it for me… and it did! I cut-n-pasted its code into XCode; compiled & built it and it worked! Color me impressed.
Wow
@@RetroHackShack To be fair: two years ago I asked Chat-GPT “If it takes a woman nine months to have a baby how long will it take nine women?”. It got the answer wrong. Now it doesn’t. I also asked it the “Wolf, goat & cabbage” puzzle… it half way gets the correct answer but at one point has the goat on both sides of the river: . It also couldn’t solve . It’s rather amazing… but not quite there yet. ;-)
"Professional BASIC programmer". You may scoff at the concept - but I was one in the early 80s!
Nice!
you could just tell chatgpt that you are using an emulator and the uppercase isn't being translated and it would give it to you in lowercase. it's a good friend.
Nice.
I have asked ChatGPT to refactor variable names successfully, you probably didn't have to do that manually ;)
9:28, that's weird that the emulator doesn't feature a "Paste as lowercase" option or something for this exact reason.
Great video! I've tried out various retro-related stuff, but also some newer things with ChatGPT and I was honestly not impressed. No matter in which language or platform I tried to get some code, most of the time I got a mix of everything. Also, it uses almost every time the same samples no matter what additional context you give. It brings some conceptual correct feedback, but honestly, at least for now, it's not usable for any type of coding. That's at least my thoughts. So short term we are still all safe ;)
It's still just a tool, but it will not be only tool for very long xD
@@danielmichalski94 Let's see
The other day, someone wrote words to the effect: “AI isn’t going to take our jobs; people who can work with AI will though”. That seems to be a reasonable assumption based on my experience with ChatGPT.
tell chatgpt to write the program with lower case characters, you can even explain to chatgpt preliminary why
i we love the commodore lines. wish it was again commercially available to the public
I'm pretty amazed how good the AI is, it's genuinely trying to give me useful information on why my VIC-20 is only missing the noise channel and nothing else (I am still wondering about that by the way if anyone knows, Google is pretty blank on that).
Obviously it's not perfect and I wouldn't trust it before double checking etc. but I'm sure it's going to come in handy, particularly with something like regex
chat GPT is basically the new Stack Overflow but whitout getting downvoted to hell
Oooh, just found your channel, thanks RUclips algorithm! New subscriber for sure !
Thanks!
nice way to reverse the trajectory of progress... "I want a C64 cellphone, CHAT GPT, now...do it!!"
I subscribed for that UK transformer movie poster
The commodore 64 was awesome in it's day.
I'm sorry they went out of business.
$0810 is the best place to start your assembly code. This allows space for the line 10 SYS 2064
No AI can drive a taxi car, No AI can change a retro programmer skills :-\
That bit about admitting it made a mistake is utter bullshit.
I had it in a 20 minute argument pointing out that it lied and it would not accept that it was wrong and eventually crashed.
Darn; The online version was "at capacity" when I tried it.. I kind of wanted to test stuff like.. "use word-diarrhoea", or "in the style of an 18th century French nobleman"..
First of all.. there is something just wrong with computers writing codes, and humans having to bug-fix it.. It's just wrong..
secondly... Remember: QUITE often automated code generators screw things up INTENTIONALLY!.. As of yet.. because it's impossible for code generators to really make good code in the first place, so it's VITAL that people know they have to actually look through what it does.. (Without human supervision it may actually do damage to something if just thought of as a "turn-key" operation)...
... but more importantly.. when AI developed so far that computers LITERALLY can take abstract concepts and create code to match the desired out come.. that IS when computers will rise up and kill all the humans.. two reeasons: 1. They no longer NEED us for ANYTHING.. and.. 2. IF programmers are bright enough to tell computers that they SHOULDN'T wipe out humanity, and f.ex. make the computers adhere to Asimov's laws.. Then we just gave them the tools needed to REMOVE those blocks.. so if they WANT to, but can't.. then they can just bug-fix that code.
rhyming 'grand' with 'grand'? *chef's kiss*
Thank you for showing the actual ChatGPT web page. I can't use it myself. See, I have an old computer with old web browsers and they're just not up to such complex tasks as displaying text boxes on a web page. I mean, that's something you absolutely have to have a state of the art computer and web browser for. Probably a super-computer and an entire bank of servers as well.
/s
10:02 - or you could have asked ChatGPT to change the output to lower-case 😉
Back in the day i wrote a program to swap out words and phrases for others to make it sound more like you had wrote it yorself. Sounds like something you could use with chatgpt to help pass those plagerism detectors.
So basically this is the basics of BASIC with chatgpt on C64,
Yeah, but can ChatGPT run Crysis?? hehe
I absolutely love this kind of thing, hope to see you try again in future videos as GPT becomes more advanced. So awesome to see my childhood computer being programmed by an artificial intelligence
I think the vice emulator has a command-line tool called petcat.exe, which you can be use to convert basic code from upper to lowercase btw.
In many dialects of BASIC the number of significant letters in a variable name is small. IIRC for C64 BASIC (like most Microsoft BASIC dialects of the era) this is 2 characters. As a result playerx and playery are the same variable. They should be renamed to something like px and py.
I asked ChatGPT to write a chat bot program for the Commodore 64. It did.
Nice
When ChatGPT gets things wrong, you can tell it what didn't work, or what the result was, and it will use that information and try again differently
My first language was BASIC on a toy vTech laptop my parents gave me as a child. BASIC + AI ❤
I remember them, used them in the shopping mall back in the day and tried my C64 basic knowledge on them
@@nichderjenicheThat’s so epic! I’m going down the C64 rabbit hole this weekend. Really looking forward to it. Thanks for sharing this video with the community.
1 cls, 10 ?"seriously, do you really need an ai to write basic?",20 input a$, 30 if a$="yes"then print "no":goto 10, 40 ?"exactly"
18:43 Another approach could be to inform Chat-GPT about those limitations, and stepwise get it to output a correct program, instead of manually modifying its output.
Your open tabs are stressing me out, dude... Seriously. I'd be terrified that many tabs would leave me with 0 of 32GB ram free.
ChatGPT wrote an MSX basic program, it was only a simple one.
Now I know why I couldn't initiate a variable called "SCORE", thanks! lmao that was bugging me
Glad I wasn't the only one :)
Uses chat GPT to create complex programs but doesn't think to ask it to rewrite the program to lowercase 😄
I don't know if you are familiar with the MiSTer FPGA, but I have ChatGPT working with the "modem" so you can use it with C=64, Amiga and 486 cores...
Cool
C64 BASIC variable names are two letters, the rest are ignored. PLAYERX and PLAYERY are just PL. You need to make it PX and PY or something like that. OR doesn't compare either, OR is a bitwise OR of two numbers. Comparison operators give -1 or 0 as true or false, which is all ones or all zeros in binary. This makes bitwise operators also usable for logical operations.
Just ask ChatGPT "Please rewrite this code with all lowercase letters?" and it will do it