Porting to a new system

From Yabause
(Redirected from NewPort)
Jump to: navigation, search
Warning Information on this page is out of date
Yabause Manual
For users
For developers


So you've decided you want to see Yabause on a new OS, Video game system or architecture. Great! It's good the see the interest. This document is definitely for you. The first thing you will have to keep in mind however, is the only way this is going to happen is if -you- yourself write the code necessary for it to work. Also too, if you want your source code included with our main source code, you're going to have to continue to maintain it. Ok? Great! Let's continue.

Basic Source Code Information

Ok, the first thing you should know is that Yabause is written entirely in C code. That means you're going to have to have some kind of C compiler to compile the source code. Once you've made sure of that, create a new subdirectory to hold your port-specific files(we usually like putting under the /src directory, so like /src/myportname). Next create some new files to hold your source. We usually use yui.c as our main source file. Ok, now basically you're going to need the following functions and variables defined in your source code:


There's a few functions that each port must implement, their definitions are usually in yui.h

void YuiErrorMsg(const char *string);

This function is called by Yabause when an error happens, the string parameter should be displayed to the user.

void YuiVideoResize(unsigned int w, unsigned int h, int isfullscreen);

This function asks the port to resize its window or to switch to fullscreen.

void YuiSetVideoAttribute(int type, int val);

This function asks the port to set a video attribute.

int YuiSetVideoMode(int width, int height, int bpp, int fullscreen);

Asks the port to initialize video output.

void YuiSwapBuffers();

Asks the port to update the display.