The shoutbox is currently out of service. Join us on Discord instead.

C support in KOS

Started by Max Leiter, December 27, 2015, 11:53:26 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Max Leiter

The two finished C tutorials are now live :)
http://www.knightos.org/documentation/tutorials/getting-started-c/

Hopefully people decide to make some C programs, because the KOS program ecosystem is severely lacking.

DJ Omnimaga

Good to see tutorials ready now. :D As for programs, it might take a while before more are made, though, because if even the CE doesn't get many programs, then imagine for a third-party OS. :P But yeah it would definitively be nice to see more games and perhaps math tools for KOS.

Max Leiter

February 12, 2016, 04:11:03 am #17 Last Edit: February 12, 2016, 04:22:05 am by Max Leiter


Began some work on color C bindings tonight, hopefully I'll be able to create a copy of the gfxdemo in C sometime soonish, and I'm on break from school this week so should have plenty of time to.

Here's a higher quality mp4 version of the GIF: https://sr.ht/0IX1.mp4

Max Leiter

Update: The color C bindings have now been merged

Max Leiter

Went ahead and added wrappers for the (action)Pixel kernel functions (invert_pixel, set_pixel, and reset_pixel).
https://github.com/KnightOS/libc/commit/d50ffc682fdf2f44bdffb45f64270f16dfbfdfd9

DJ Omnimaga

Thanks for the update. I'M glad to see more progress on this Max Leiter. I hope that one day we will be able to easily port C games between multiple calculators and KnightOS (even if it means changing the graphics in the monochrome version).

Max Leiter

March 02, 2016, 03:37:31 am #21 Last Edit: March 03, 2016, 02:18:23 am by Max Leiter
Quote from: DJ Omnimaga on March 02, 2016, 03:35:37 am
Thanks for the update. I'M glad to see more progress on this Max Leiter. I hope that one day we will be able to easily port C games between multiple calculators and KnightOS (even if it means changing the graphics in the monochrome version).

I'm currently experimenting porting a Prizm game (Game of Life by @merthsoft) to KnightOS, it's pretty easy so far. The hardest part is making a game made for color calculators look nice on a monochrome screen, but besides that most of the functions have direct "translations." I don't plan to release the game, but will post a finished version here if I ever finish it.

EDIT: Added all the draw_rect() functions/variations, so now the KOS Display section is implemented! (ie www.knightos.org/documentation/reference/display.html)

DJ Omnimaga

Nice that cross calculator brand porting isn't too hard. Monochrome graphics can usually be adapted to just be small rectangles or squares if they can't be converted easily anyway. Even a Pac-Man game would still be enjoyable with 3x3 blocks if that meant the entire board fit on screen without being flipped sideways.

Did you work more on the game, by the way? I am curious if you could post a screenshot.

Ivoah

Quote from: DJ Omnimaga on March 22, 2016, 06:12:10 am
Nice that cross calculator brand porting isn't too hard. Monochrome graphics can usually be adapted to just be small rectangles or squares if they can't be converted easily anyway. Even a Pac-Man game would still be enjoyable with 3x3 blocks if that meant the entire board fit on screen without being flipped sideways.

Porting stuff from TI-OS to KOS is super easy, I managed to port the rubiks cube program, and I still don't even know exactly how it works :)

Max Leiter

Quote from: DJ Omnimaga on March 22, 2016, 06:12:10 am
Nice that cross calculator brand porting isn't too hard. Monochrome graphics can usually be adapted to just be small rectangles or squares if they can't be converted easily anyway. Even a Pac-Man game would still be enjoyable with 3x3 blocks if that meant the entire board fit on screen without being flipped sideways.

Did you work more on the game, by the way? I am curious if you could post a screenshot.


too much relied on colors for it to be ported easily (I couldn't tell if it was working correctly with just black/white, I didnt put much time in it :( )

DJ Omnimaga

Quote from: Ivoah on March 22, 2016, 06:14:31 am
Quote from: DJ Omnimaga on March 22, 2016, 06:12:10 am
Nice that cross calculator brand porting isn't too hard. Monochrome graphics can usually be adapted to just be small rectangles or squares if they can't be converted easily anyway. Even a Pac-Man game would still be enjoyable with 3x3 blocks if that meant the entire board fit on screen without being flipped sideways.

Porting stuff from TI-OS to KOS is super easy, I managed to port the rubiks cube program, and I still don't even know exactly how it works :)
Lol nice. Actually my main difficulty concern was converting a 320x240 game to 96x64, hence my suggestion. But nice to hear. Maybe at one point someone could port various calc games to KOS and make some sort of CW arcade using the emulator. Porting games would probably require the permission of certain authors, though.

Powered by EzPortal