How would one get started writing a core?

The information on this seems to be really sparse. Lots of info from players of RetroArch looking to solve technical problems to get their games running, but very little on how you’d start writing a core.

This is a C/C++ thing and I’m using Windows 10 so I figure I would download Visual Studio for C++, clone the libretro Git repository and … then what?

I kind of have this nagging dream that it would be really cool to implement a rhythm game like Frets On Fire / Phase Shift, maybe with features like Rock Band Unplugged that would go through libretro so it would run on everything. Songs in the Phase Shift file format would be what this core loads as content instead of ROMs. But it would probably be extremely difficult. I figure just trying to make tic-tac-toe or something would be a good way to learn the API to start with. LOL, maybe even tic-tac-toe with netplay

1 Like

For porting an existing program to libretro, you’re basically taking their main runloop and copying the functions into the appropriate libretro functions in the libretro.c/pp file. For programs that already use SDL1.2, you can use r-type’s libretro-sdl thing to do most of the heavy lifting (Note: I haven’t used it myself but it seems to be pretty powerful).

If you’re wanting to write a program from scratch to be libretro-compliant from the start, this blog is a good place to start (good reading anyway!): https://beardypig.github.io/2016/01/22/emulator-build-along-2/

1 Like

Has anybody done this using Bash on Ubuntu on Windows? :slight_smile:

1 Like

Sounds great! I am thinking of making an Paint application as an first project!