Тёмный

Oscar64, C compiler for Commodore 64 

Josip Retro Bits
Подписаться 1,9 тыс.
Просмотров 1,6 тыс.
50% 1

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

Наука

Опубликовано:

 

25 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 31   
@anon_y_mousse
@anon_y_mousse 4 месяца назад
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 4 месяца назад
Yes, it is amazing that we have so many languages to program for C64. Nice code, I like it :) Thank You!
@DrMortalWombat
@DrMortalWombat 4 месяца назад
Thank you for taking a look at oscar, I always enjoy your videos
@JosipRetroBits
@JosipRetroBits 4 месяца назад
Thank You very much and sorry for my late reply :)
4 месяца назад
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 4 месяца назад
Seams like a very good project to me, but now it's a question of further development... not do die in vain :) Cheers!
@MrGareth1973
@MrGareth1973 4 месяца назад
Great video Josip! Thank you.
@JosipRetroBits
@JosipRetroBits 4 месяца назад
Glad you liked it :) Cheers!
@MattKasdorf
@MattKasdorf 4 месяца назад
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 4 месяца назад
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 4 месяца назад
From what I read it's an interpreted language. Just like basic.
@8bitsinthebasement
@8bitsinthebasement 4 месяца назад
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 4 месяца назад
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...
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 3 месяца назад
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 3 месяца назад
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!
@CaptainCommodore
@CaptainCommodore 4 месяца назад
That looks really cool 😎
@JosipRetroBits
@JosipRetroBits 4 месяца назад
Thank You Lee :)
@bblevins
@bblevins 4 месяца назад
This is a fun video! You could do a series: "Learn C the retro way"
@JosipRetroBits
@JosipRetroBits 4 месяца назад
Thank You very much. Perhaps I should, You think that people would be interested? Cheers!
@bblevins
@bblevins 4 месяца назад
I know I'd be. coding C on the c64 looks fun.
@petersoumanis5494
@petersoumanis5494 4 месяца назад
​@@JosipRetroBitsbut use a PDP11, after all that is what C is based on
@svenvandevelde1
@svenvandevelde1 4 месяца назад
great!
@JosipRetroBits
@JosipRetroBits 4 месяца назад
Thank You :)
@MarcusLlewellyn
@MarcusLlewellyn 4 месяца назад
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 4 месяца назад
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!
@RandomBitzzz
@RandomBitzzz 4 месяца назад
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 4 месяца назад
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 4 месяца назад
Now get Rust to compile for C64
@JosipRetroBits
@JosipRetroBits 4 месяца назад
Well, someone needs to write a compiler :) Or do something like Rust to C and C to C64 machine code.
@8bitHamburger
@8bitHamburger 3 месяца назад
Lets compile better games now :)
@JosipRetroBits
@JosipRetroBits 3 месяца назад
Games get better and better every year, for sure :) Cheers!
Далее
My Own 3b1b Animation Engine but in C
2:06:44
Просмотров 59 тыс.
Thank you 3M❤️#thankyou #shorts
00:14
Просмотров 7 млн
Why do C Programmers Always Obfuscate Their Code?
2:01:57
10 Games Where The C64 Kicked Nintendo's Ass
10:08
Просмотров 77 тыс.
Reverse Engineering Game Code from the Neutral Zone
40:59
10x Faster Than C64 BASIC? Hare Basic
48:01
Просмотров 30 тыс.
TempleOS in Qemu
32:50
Просмотров 257 тыс.
I Found My Ultimate Commodore 64
22:33
Просмотров 58 тыс.
сюрприз
1:00
Просмотров 1,6 млн
Неразрушаемый смартфон
1:00
Просмотров 1,6 млн