Join us on Discord!
You can help CodeWalrus stay online by donating here.

C support in KOS

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

Previous topic - Next topic

0 Members and 2 Guests 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.

Dream of 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.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Max Leiter

#17


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:

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

Dream of 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).
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Max Leiter

#21
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)

Dream of 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.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

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 :)
  • Calculators owned: TI-86 (now broken), TI SR-56, TI-Nspire CX CAS, TI-84+ SE, TI-84+ SE, TI-85, TI-73 Explorer VS, ViewScreen, TI-84+ CSE, TI-83+ SE

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 :( )

Dream of 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.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal