Oscar64, C compiler for Commodore 64

  Рет қаралды 1,703

Josip Retro Bits

Josip Retro Bits

Күн бұрын

In this video we explore Oscar 64, a very powerful C compiler for Commodore 64. Floats, Pointers, Recursion, dedicated C64 libraries and a bunch of Examples and Demos, Oscar 64 has it all.
☕ If You like this video you can buy me a coffee: ko-fi.com/josipretrobits ☕
OSCAR64:
========
github.com/drmortalwombat/osc...
SOURCE CODES:
==============
github.com/josipk/Commodore64...
INDEX:
======
0:00 - Intro
0:58 - VCCC 2023 and Diamond shape
4:07 - Diamond shape in C
8:47 - Compiling with Oscar64
9:53 - Compiling the same code with GCC
12:13 - Pointers vs Peek&Poke
22:15 - Recursion
30:06 - Oscar64 Examples and Demos
39:16 - The End
CHECK OUT:
==========
‪@8BitRetroReFix‬
‪@CaptainCommodore‬
‪@Retro4u‬
‪@8bitsinthebasement‬
‪@TimsRetroCorner‬
‪@Alices.Retro.Wonderland‬
CHECK OUT MY OTHER COMMODORE/ACORN VIDEOS:
==========================================
🕹️ Commodore 64 Programming: • Commodore 64 Programming
🕹️ Commodore 64 Hardware Videos: • Commodore 64
🕹️ Commodore 64 Plus/4 Videos: • Commodore Plus/4
🕹️ Acorn Electron Videos: • Acorn Electron
🕹️ Commodore 64 Games and Demos: • Retro Games and Demos
🕹️ The Pong Game Projects: • The Pong Game Projects
#commdore64 #c64 #cprogramming #clanguage #oscar64 #vccc2023 #basic #pointers #recursion #retrocomputing

Пікірлер: 32
@anon_y_mousse
@anon_y_mousse 5 ай бұрын
Interesting that someone would write a modern compiler for such an old platform. I especially like that the code sample you showed was using #embed, so hopefully that means they'll support C23. Your loop on the starfield didn't need to use floor or floats at all. I rewrote it with a ternary which should make it more portable to systems that might not use ASCII or PETSCII. for ( int i = -9; i < 10; i++, fputc( ' ', stdout ) ) for ( int j = 0; j < 19; j++ ) fputc( ((i*i-j*j)%6)?' ':'*', stdout ); // This takes advantage of the fact that you're clearly just testing if there's a remainder and discarding the result of the division anyway.
@JosipRetroBits
@JosipRetroBits 5 ай бұрын
Yes, it is amazing that we have so many languages to program for C64. Nice code, I like it :) Thank You!
@DrMortalWombat
@DrMortalWombat 5 ай бұрын
Thank you for taking a look at oscar, I always enjoy your videos
@JosipRetroBits
@JosipRetroBits 5 ай бұрын
Thank You very much and sorry for my late reply :)
5 ай бұрын
As much as this is a "we did it because we can" project, it seems surprisingly more useful and productive than I've expected. Very cool.
@JosipRetroBits
@JosipRetroBits 5 ай бұрын
Seams like a very good project to me, but now it's a question of further development... not do die in vain :) Cheers!
@8bitsinthebasement
@8bitsinthebasement 5 ай бұрын
Really interesting, I love the fact that you can compile generic code to multiple systems. If ever I decide to give C a go I'll look into Oscar, thanks Josip :)
@JosipRetroBits
@JosipRetroBits 5 ай бұрын
Thank You Peter :) I never thought that we will be able to program in C for Commodore 64, but we have so many options these days. Not to mention BASIC for ATARI 2600 :) crazy...
@MrGareth1973
@MrGareth1973 5 ай бұрын
Great video Josip! Thank you.
@JosipRetroBits
@JosipRetroBits 5 ай бұрын
Glad you liked it :) Cheers!
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 4 ай бұрын
The 6502 has this exception philosophy when it needs to carry over to the high byte. The GitHub about Oscar says that C needs to support datatypes > char . But often in my code I have small numbers. I cannot guarantee it, though. Or I have a loop and the high byte stays fixed most of the time. So usually you write an outer loop for the high byte. Pointers are either immediates or stored in the zero page. Both times: 16 bit. I argue about speed, not code density. Floats for example should stay in interpreted code.
@JosipRetroBits
@JosipRetroBits 4 ай бұрын
Yes, Oscar64 is a 16bit based C language; latter in assembly it gets converted to 8bit. 8bit char, or 8bit int, or byte is the same or it should be. For execution speed; it's a ok for convenience of easy coding :) Thank You for watching :) Cheers!
@MattKasdorf
@MattKasdorf 5 ай бұрын
The Oscar64 code for the diamonds didn't seem to run much faster than the BASIC, might you do a speed comparison of BASIC, cc65, Oscar64, and assembly?
@JosipRetroBits
@JosipRetroBits 5 ай бұрын
Yes, it was a bit slow, You are not the first how ask for speed comparison, So Yap, I should make a video about it :) Thank You for watching, Cheers!
@rjc199
@rjc199 5 ай бұрын
From what I read it's an interpreted language. Just like basic.
@CaptainCommodore
@CaptainCommodore 5 ай бұрын
That looks really cool 😎
@JosipRetroBits
@JosipRetroBits 5 ай бұрын
Thank You Lee :)
@bblevins
@bblevins 5 ай бұрын
This is a fun video! You could do a series: "Learn C the retro way"
@JosipRetroBits
@JosipRetroBits 5 ай бұрын
Thank You very much. Perhaps I should, You think that people would be interested? Cheers!
@bblevins
@bblevins 5 ай бұрын
I know I'd be. coding C on the c64 looks fun.
@PSjustanormalguy
@PSjustanormalguy 5 ай бұрын
​@@JosipRetroBitsbut use a PDP11, after all that is what C is based on
@svenvandevelde1
@svenvandevelde1 5 ай бұрын
great!
@JosipRetroBits
@JosipRetroBits 5 ай бұрын
Thank You :)
@MarcusLlewellyn
@MarcusLlewellyn 5 ай бұрын
Thanks for this! I saw Oscar64's repo, but since I lack experience with C on the C64/128, I wasn't sure how this measured up to cc65 in terms of speed and optimization. I'm still not sure which is better, honestly. Particularly for someone just diving into C on the 6502 architecture.
@JosipRetroBits
@JosipRetroBits 5 ай бұрын
This is how I see it; CC65 if faster, but Oscar64 is a bit easier to use, especially for making games and working with VICII registers. Thank You for watching :) Cheers!
@agpxnet
@agpxnet Күн бұрын
@@JosipRetroBits Absolutely not. Oscar64 generate by far faster code than CC65. Don't use floating point on C64, use fixed point math.
@RandomBitzzz
@RandomBitzzz 5 ай бұрын
Any idea on how well Oscar64 optimizes the code during the compile? The diamond program seemed kind of slow when you ran it.
@JosipRetroBits
@JosipRetroBits 5 ай бұрын
It uses pre-written asembler routines. Yes, I've notice also, if You "printf" anything on the screen it's quite a slower then cc65. Cheers!
@raidensama1511
@raidensama1511 5 ай бұрын
Now get Rust to compile for C64
@JosipRetroBits
@JosipRetroBits 5 ай бұрын
Well, someone needs to write a compiler :) Or do something like Rust to C and C to C64 machine code.
@8bitHamburger
@8bitHamburger 4 ай бұрын
Lets compile better games now :)
@JosipRetroBits
@JosipRetroBits 4 ай бұрын
Games get better and better every year, for sure :) Cheers!
Morse Code Keyer and Commodore 64 | Part One
28:58
Josip Retro Bits
Рет қаралды 415
BASIC 60th Birthday | Commodore 64 | #basic60th
51:12
Josip Retro Bits
Рет қаралды 1 М.
MISS CIRCLE STUDENTS BULLY ME!
00:12
Andreas Eskander
Рет қаралды 16 МЛН
БАБУШКИН КОМПОТ В СОЛО
00:23
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 15 МЛН
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 61 МЛН
НРАВИТСЯ ЭТОТ ФОРМАТ??
00:37
МЯТНАЯ ФАНТА
Рет қаралды 6 МЛН
Assembly Programming Using Commodore 64 Kernal Routines
55:38
Josip Retro Bits
Рет қаралды 4,9 М.
Programming a Commodore 64 hurts my brain...
6:45
Bandwidth
Рет қаралды 73 М.
Coding a plasma effect demo on the Commodore 64 (tutorial DIY)
12:30
Commodore 64 & 6510 retro-programming
Рет қаралды 2,1 М.
programming c on the c64
29:01
The Highlander71
Рет қаралды 13 М.
Compiling C for the Apple ][ (using cc65)
14:24
Cinemint Tech Tips
Рет қаралды 999
FairLight & Genesis Project - The Ghost (C64 Demo)
8:33
FairLight - Home of the Real Crackers
Рет қаралды 16 М.
Yie Ar Kung-Fu Longplay (Arcade) [QHD]
12:10
AL82 Retrogaming Longplays
Рет қаралды 80 М.
Keyboard Reset Circuit for Commodore 64 | Mods and Repairs
31:07
Josip Retro Bits
Рет қаралды 677
НЕ БЕРУ APPLE VISION PRO!
0:37
ТЕСЛЕР
Рет қаралды 320 М.
iPhone socket cleaning #Fixit
0:30
Tamar DB (mt)
Рет қаралды 16 МЛН
Сколько реально стоит ПК Величайшего?
0:37
Kumanda İle Bilgisayarı Yönetmek #shorts
0:29
Osman Kabadayı
Рет қаралды 1,8 МЛН
Looks very comfortable. #leddisplay #ledscreen #ledwall #eagerled
0:19
LED Screen Factory-EagerLED
Рет қаралды 3 МЛН