C compiler for the C64 and other 65xx machines.
C compiler for the C64 and other 65xx machines.
I gave cc65 a quick blast a couple of year ago (I think), but didn't get very far with it mostly due to a lack of time, but it did what it was supposed to. It's available here:
http://cc65.github.io/cc65/
There are some samples to look through as well. Enjoy!
Regards,
Shaun.
http://cc65.github.io/cc65/
There are some samples to look through as well. Enjoy!
Regards,
Shaun.
BASIC Programming - making the mistakes so that you don't have to.
Circles and Squares.
Nothing I post here will stand up in a court of law.
Circles and Squares.
Nothing I post here will stand up in a court of law.
- onlineprof2010
- Member
- Posts: 10
- Joined: Fri Oct 03, 2014 12:20 am
- Location: Virginia
- Contact:
Re: C compiler for the C64 and other 65xx machines.
I started looking at cc65. Definitely slower than assembly but a bit faster than BASIC which is good for games. But programming timewise I think I was able to whip up something faster than basic or assembly.
UFO attack .prg file (v1.1)
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
youtube preview
[video][/video]
Looter .prg file (v2.2)
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
youtube preview
[video][/video]
I know, the games are simplistic but considering I never actually completed making a game as a kid I am happy so far.
UFO attack .prg file (v1.1)
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
youtube preview
[video][/video]
Looter .prg file (v2.2)
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
youtube preview
[video][/video]
I know, the games are simplistic but considering I never actually completed making a game as a kid I am happy so far.
Last edited by onlineprof2010 on Fri Nov 28, 2014 7:37 pm, edited 3 times in total.
My homemade games:
http://www.youtube.com/channel/UCjOZC4t_g_O3s9OTT7k_enQ
http://www.youtube.com/channel/UCjOZC4t_g_O3s9OTT7k_enQ
Re: C compiler for the C64 and other 65xx machines.
Now I have slightly improved my BASIC programming skills, I'll have a look again into C for the C64. I think the Mine Sweeper program that I wrote should be easy enough to convert to C and I'd be happy enough if I could manage it as I'm not 1337.
Regards,
Shaun.
Regards,
Shaun.
BASIC Programming - making the mistakes so that you don't have to.
Circles and Squares.
Nothing I post here will stand up in a court of law.
Circles and Squares.
Nothing I post here will stand up in a court of law.
Re: C compiler for the C64 and other 65xx machines.
you should carefully look at the generated code, then you'll quickly notice what the compiler is good at and what doesnt work so great - its surely not quite as good as plain assembly, but you can certainly use it to write *much* faster code than in basicDefinitely slower than assembly but a bit faster than BASIC
- onlineprof2010
- Member
- Posts: 10
- Joined: Fri Oct 03, 2014 12:20 am
- Location: Virginia
- Contact:
Re: C compiler for the C64 and other 65xx machines.
Thanks for the thoughts guys. I think exploring c with c64 is worthwhile. It is a language that follows a standard and it just may be possible to write portable code for the c64 (simple tile based windows games or ones with less than 9 sprites). Like in my game loop, I call a check_collision or update_sprites c function which goes to a c64 layer peeking/poking the sprite locations. But adding these function calls slows things down so I might try making some "inline". I still want to keep them though as I can conceivably replace the c64 layer with another system.
My homemade games:
http://www.youtube.com/channel/UCjOZC4t_g_O3s9OTT7k_enQ
http://www.youtube.com/channel/UCjOZC4t_g_O3s9OTT7k_enQ
- onlineprof2010
- Member
- Posts: 10
- Joined: Fri Oct 03, 2014 12:20 am
- Location: Virginia
- Contact:
Re: C compiler for the C64 and other 65xx machines.
I spent this Saturday morning tweaking the UFO game into an air sea battle game.
[video][/video]
Air Sea Battle PRG download
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
[video][/video]
Air Sea Battle PRG download
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
My homemade games:
http://www.youtube.com/channel/UCjOZC4t_g_O3s9OTT7k_enQ
http://www.youtube.com/channel/UCjOZC4t_g_O3s9OTT7k_enQ
Re: C compiler for the C64 and other 65xx machines.
Thanks for sharing onlineprof2010 it's always great to see what others are up too.
- onlineprof2010
- Member
- Posts: 10
- Joined: Fri Oct 03, 2014 12:20 am
- Location: Virginia
- Contact:
Re: C compiler for the C64 and other 65xx machines.
I decided to do another quick game before I take on something much bigger like my super mario game. I did a PETSCII centipede clone. Some have asked to see 'C' code for learning purposes so I am posting here:
[video][/video]
C Code
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
PRG File to play v2.1
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
[video][/video]
C Code
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
PRG File to play v2.1
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
My homemade games:
http://www.youtube.com/channel/UCjOZC4t_g_O3s9OTT7k_enQ
http://www.youtube.com/channel/UCjOZC4t_g_O3s9OTT7k_enQ
- onlineprof2010
- Member
- Posts: 10
- Joined: Fri Oct 03, 2014 12:20 am
- Location: Virginia
- Contact:
Re: C compiler for the C64 and other 65xx machines.
I know there are probably plenty of tools out there for sprites, but I decided to make my own in excel. After creating the sprite in an excel grid, it spits out data which you can paste into your c code.
Here is the excel spreadsheet:
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
clicking the link will display the spreadsheet through google but there is a download button which makes it easier to view and edit in excel itself.
I used it to do a basic update of my UFO game:
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
On a side note also made some quick updates to my looter and centipede game:
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
Wish I had more time to do this fun stuff!
Here is the excel spreadsheet:
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
clicking the link will display the spreadsheet through google but there is a download button which makes it easier to view and edit in excel itself.
I used it to do a basic update of my UFO game:
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
On a side note also made some quick updates to my looter and centipede game:
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
https://drive.google.com/file/d/0BxrxBh ... sp=sharing
Wish I had more time to do this fun stuff!
My homemade games:
http://www.youtube.com/channel/UCjOZC4t_g_O3s9OTT7k_enQ
http://www.youtube.com/channel/UCjOZC4t_g_O3s9OTT7k_enQ
Re: C compiler for the C64 and other 65xx machines.
I always find it faster and easier to bload sprite data in rather than repoke/recompile/ressemble data statements.
Who is online
Users browsing this forum: No registered users and 9 guests