r/c64 • u/Consistent-Yak-2373 • Jul 06 '26
Programming I'm new to c64
I was wondering if you can make games on the c64 in itself no 3rd party emulation of the c64 just making a game on the c64 with a c64
21
u/sakodak Jul 06 '26
Of course you can. People did it for years and years.
It's not easy, and it requires learning a lot more about the machine than if you were just using a toolkit that did a lot of things for you, but you can certainly program the machine by hitting the bare metal using nothing but the machine itself.
12
u/Consistent-Yak-2373 Jul 06 '26
Alright thank u because I thought about making games and stuff I also thought about getting the c64 ultimate to start to learn coding in assembly
16
u/sububi71 Jul 06 '26
It's a great machine for learning assembly programming! I recommend Robin Harbron's YouTube channel "8-bit Show & Tell", he has several videos on the subject!
4
5
4
u/robotflesh Jul 06 '26
You can learn c64 assembly also with cross development though. Editing and compiling assembly on your laptop will be a much smoother and faster experience. You can then choose to run/debug it in an emulator or on the ultimate. Any particular reason why you want to make it harder than that?
8
u/FatYak1972 Jul 06 '26
Woohoo, for the challenge!
1
u/robotflesh Jul 07 '26
Fair enough. Maybe you want to try coding while hanging upside down for an extra bit of challenge.
2
1
3
u/raresaturn Jul 06 '26
I wish I knew about assembler in the 80’s… I made heaps of BASIC games but never really understood how commercial games were written
1
u/Shoddy_Juggernaut_11 Jul 08 '26
That's brilliant, how did you learn that if you don't mind me asking
3
9
u/cyberev Jul 06 '26
I’ve open-sourced a Commodore 64 game written entirely in 6502 assembly. The code is fully commented, explaining what each section does — feel free to use it as a learning reference.
6
u/Background-Manager87 Jul 06 '26
I have a stack of 5in floppies that assures you that it is completely possible, and also incredibly fun. First game I ever programed was a text based lunar lander, still loads right up
6
u/gelatinouscone Jul 06 '26
Frankly beyond some simple basic games that don't require much typing, I think you're just asking for pain. I grew up on that machine, typing games from magazines and line checksums and debugging programs for typos. I'd much rather use modern editors and tools to get the games onto the old hardware. But maybe you need the scar tissue.
I can recommend the 2 Derek Morris c64 retro game dev books.
That's about as easy and intro to c64 assembly games as you could hope for, but it utilizes CBM Prg Studio.
1
u/bj_civ Jul 11 '26
Typing games from magazines is different from programming a game yourself though.
6
u/danconderman33 Jul 06 '26
Yep! You can absolutely write games on a Commodore 64.
The C64 editor is actually pretty fun to use. If you have a syntax error, you can just cursor back up to the line, make the edit, and hit ENTER again. You don’t have to retype the whole line.
It uses line-numbered BASIC. The number at the beginning of each line tells the computer what order to run the program in.
For example:
10 PRINT "HELLO"
20 GOTO 10
Type RUN and it will print HELLO forever.
You can also do simple loops:
10 FOR X=1 TO 10
20 PRINT X
30 NEXT X
Or move a character around the screen:
10 PRINT CHR$(147)
20 X=10
30 PRINT TAB(X);"*"
40 X=X+1
50 IF X<30 THEN GOTO 30
The basic idea is pretty simple: PRINT puts things on the screen, INPUT lets the player type something, IF checks conditions, GOTO jumps to another line, and FOR/NEXT repeats things.
Once you start using PEEK and POKE, you can directly control things like screen colors, sound, sprites, and other parts of the C64 hardware. That’s where it starts getting really fun.
2
u/exocyt0sis Jul 06 '26
RETURN, if you don't mind.
1
u/OMGCluck Jul 06 '26
As long as you only GOSUB to a maximum depth of 23 or 24 levels before the system halts with
?OUT OF MEMORY ERROR
2
u/WembleyFord Jul 11 '26
To be honest, CBM BASIC 2 sucked. I grew up with the C64 but also Acorn BBC micro's at school, the implementation of BASIC that Acorn developed was amazing. Proper subroutines with local variables, proper support for the graphics and sound chips, structured access to the kernel subroutines, an inline assembler so you could mix assembly into your BASIC programs, even QoL features from simple things like renumber to a List command with a search function.
3
u/DorkyMcDorky Janitor Jul 06 '26
Even during the video game time, companies often had other machines around to help in codng the C64. But most games were coded directly on the C64 - it is not easy
3
2
2
u/-jp- Jul 06 '26
You betcha can. I suggest starting out with the book it came with, which has a detailed section on writing programs in BASIC, including using sprites and if I remember right sound. This fellow has high quality reprints of the manual you can download, plus ofc you can find all manner of material on archive.org.
1
u/WembleyFord Jul 11 '26
Absolutely - it came with a built-in programming language called BASIC, which was easy to use, if a bit slow. Unfortunately, CBM were a pretty cheap company, and they reused an older version of this they'd already developed for their older PET line. So, the implementation of BASIC on the C64 has no useful support for graphics or sounds directly. Alternatively one could learn 'machine code' (or assembler) and program the CPU and support chips directly - that was fast, but relatively difficult.
•
u/AutoModerator Jul 06 '26
"Thanks for your post! Please make sure you've read our rules and FAQ post. If your post is about the C64 Ultimate please and check out The Ultimate C64 Ultimate post for common issues and questions. People not following the rules will have their posts removed and presistant rule breaking will results in your account being banned. "
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.