This project implements a simple round-robin task scheduler for the Nintendo Game Boy using C. It is designed to allow developers to manage multiple tasks in a preempitve multitasking environment on the Game Boy platform.
- Dev Environment: GBDK
- C Compiler: Compatible with GBDK (ANSI C subset)
- Game Boy Emulator: Recommended for testing, e.g., emulicious.
The round-robin scheduler alternates between registered tasks during the Game Boy’s main loop. Each task gets a predefined time slice before control is handed to the next task in the queue.
ScheduGB/
├── obj/ # Directory for compiled object files
├── src/ # Source code
│ ├── main.c # Main entry point for the program
│ ├── scheduler.c # Scheduler implementation
│ └── scheduler.h # Scheduler header file
├── .gitignore # Files and directories to be ignored by Git
├── compile.bat # Batch script to build the project (for Windows)
├── Makefile # Makefile for building the project (for Linux/macOS)
└── README.md # Project documentation
git clone https://github.com/Manucar/ScheduGB.git
cd ScheduGBEdit the scheduler.c file to add your tasks in the static table. Each task should follow this simple structure:
void task1(void) {
// Your task code here
}
void task2(void) {
// Your task code here
}Start the scheduler in the main function:
void main(void)
{
scheduler_start();
}On Windows, run the compile.bat script in the root directory:
.\compile.batOn Linux/macOS, use the provided Makefile:
makeThe compiled ROM file will be placed in the obj/ directory.
Run it in your preferred Game Boy emulator.
The given example in the main.c file is printing on the console:
⚠️ Work in Progress:
This project is still under development. Features, structure, and functionality are subject to change. Feel free to explore, test, or contribute, but please note that bugs and incomplete features may exist.
