Skip to content

Adding your game to xinOS

Sammy Hajhamid edited this page Jan 19, 2020 · 3 revisions

Overview

Once you've created your main method, you will need to add it to the index of games that xinOS holds and recompile the operating system. It's a lot easier than it sounds, so let's go through it!

xinOS holds its list of games in a file called game_list.h in src/games/game_list.h. The variable you care about is called games, which is the actual array that contains the games.

Each game in the list has 3 parameters. The name of the game, the author of the game, and a pointer to the main function of the game. Here's an example of a game registry in the array.

{.name = "xinSnake", .author = "pepsipu", .init = xs_main}

The first two are self-explanatory, but let's talk about the main function. The init attribute is the memory address to actual main function code. xinOS will call this function when your game is launched. This main function should take in no parameters and return an integer as a status code.

That's it! No special build options or anything, just add an entry and you're done.

Clone this wiki locally