Graphics Library for CX16 C cc65 Projects

For posting library code and examples.
Post Reply
User avatar
Dr.J
Posts: 13
Joined: Sun Dec 24, 2023 12:16 am
Location: United States
Contact:

Graphics Library for CX16 C cc65 Projects

Post by Dr.J »

I'm happy to announce the release of the first version of my Xist16 graphics library for C projects on the Commander X16 using the cc65 compiler! It has built-in functions for:

* Loading and managing graphics
* Animated sprites
* Animated tiles
* Text-drawing functions
* Built-in PRNG that's fast, with good unpredictability and distribution, with a period of 65,536

I've applied performance optimizations and stress-tested it with 33 simultaneous animated sprites and hundreds of animated tiles without slowdown, so the performance seems adequate for producing some real games with it.

I've published it under the MIT license, so you can do whatever you want with it provided you give attribution and don't hold me liable if you somehow manage to blow yourself up with it :P

It's available for download here:
https://github.com/DoctorJWW/Xist16

Aside from the (thorough) documentation that comes with the Github repo, I also posted a tutorial video showing how to set it up and use its functions to quick-start your own C projects for the X16:
https://www.youtube.com/watch?v=0EhJtpzhRpA

I sincerely hope some folks get some good use out of this library. If you make anything cool with it, feel free to drop me a line.

Enjoy!

-Dr.J
User avatar
desertfish
Posts: 1073
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: Graphics Library for CX16 C cc65 Projects

Post by desertfish »

Wow obviously a lot of thought and effort has gone into the software and the docs, nice work
(I scanned through your video a bit and it looks quite solid. But personally I don't use C so I remained at the surface)

I'm reading about a "xist IMG file format" for graphics.
I'd like to mention the BMX bitmap image format that was created by our community at the end of last year , you can read about it here viewtopic.php?t=6945
Maybe you can integrate it?
User avatar
Dr.J
Posts: 13
Joined: Sun Dec 24, 2023 12:16 am
Location: United States
Contact:

Re: Graphics Library for CX16 C cc65 Projects

Post by Dr.J »

Thanks, I'll give it a look! I might be pretty slow to integrate it though, because I'm getting pretty impatient to start working on my own games :D

But of course it's an open-source project, so if anyone wants to add BMX integration to the library and open a PR they're more than welcome to :P

-Dr.J
User avatar
Dr.J
Posts: 13
Joined: Sun Dec 24, 2023 12:16 am
Location: United States
Contact:

Re: Graphics Library for CX16 C cc65 Projects

Post by Dr.J »

Although, in the event that I do get the time to add BMX support in the near future, does somebody have:

-An example of a BMX image
-And a screenshot of what it should look like when rendered on the CX16

That'd help a lot for testing purposes to make sure I implemented the spec correctly.

-Dr.J
User avatar
desertfish
Posts: 1073
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: Graphics Library for CX16 C cc65 Projects

Post by desertfish »

Sure here is robospider.bmx (zipped, because this board doesn't allow .bmx file extension here)
Screenshot_20240208_002719.png
Screenshot_20240208_002719.png (33.67 KiB) Viewed 2476 times
Attachments
robospider.zip
(11.76 KiB) Downloaded 149 times
Post Reply