-
Notifications
You must be signed in to change notification settings - Fork 2
Adding your game to xinOS
Sammy Hajhamid edited this page Jan 16, 2020
·
3 revisions
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.