Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Cega - A cycle accurate emulator for the SG-1000, SMS, and Game Gear

Reply to topic
Author Message
  • Joined: 04 Sep 2021
  • Posts: 7
Reply with quote
Cega - A cycle accurate emulator for the SG-1000, SMS, and Game Gear
Post Posted: Sun Apr 16, 2023 1:20 pm
In the early days of 2021, I decided it was time to write an emulator for the Sega 8-bit family, so in about one month of binge programming, I pumped out the first iteration of Cega, my Sega 8-bit emulator written in C. It has been a few years now and my larger emulation project has gotten more mature, so it is time to start announcing it exists.

The goal of this project was to create a human-readable living document covering the SG-1000, SMS, and Game Gear. I used a "cycle stepped" Z80 to achieve the ultimate level of granularity, and clock every chip one cycle at a time in accordance with a master clock -- it's like FizzBuzz for emulation. This also makes it pretty slow, but speed was not one of the priorities here. All of the source, at least the portions I wrote (everything but the YM2413 and Z80), are heavily documented, mostly with information coming from SMS Power!

I tested the entire SG-1000, SMS, and GG libraries and have 100% compatibility, or at least did at the time I tested. All input devices aside from the Sports Pad are emulated, and Gear to Gear cable support is missing, but otherwise the emulator is feature complete. I've also started adding Mega Drive support, but that is going a little slowly...

That being said, this project is not for everyone. I don't release binaries, and the project is part of my larger project which covers many more consoles and uses a unified frontend with a plugin architecture similar to OpenEmu or libretro, but with a focus on minimalism. Either way, the sources being available and verbosely commented should help achieve the goal of being a good human-readable reference of the systems covered.

Enjoy!

(I can't seem to post links, so I am breaking the links up into chunks)
https://gitlab.com/jgemu/cega
https://jgemu.gitlab.io
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14744
  • Location: London
Reply with quote
Post Posted: Sun Apr 16, 2023 1:32 pm
I made your links work, that’s an anti spam measure we have. The emulator sounds interesting, but it’s definitely limiting to not have binaries… could you at least have public CI producing ephemeral/unsupported binaries?
  View user's profile Send private message Visit poster's website
  • Joined: 04 Sep 2021
  • Posts: 7
Reply with quote
Post Posted: Sun Apr 16, 2023 1:44 pm
Currently it is being packed for Gentoo and Slackware, hopefully more Linux distros later on. I have considered doing CI builds for Windows, but at the moment I'm focusing on finishing up my Neo Geo emulator, and the honest truth is I'm not very knowledgeable about CI. If someone were able to help me out with that, and it would be easy to maintain, then I'd be open to it.

There's also the possibility that I could make a simple SDL2 standalone port at some point if there is any interest in that. I could maybe do that for some of the other emus in my collection too.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14744
  • Location: London
Reply with quote
Post Posted: Sun Apr 16, 2023 2:18 pm
I use appveyor a lot, it ought to be as simple as telling it to run make and then zipping up the results. However it doesn’t do Mac stuff. Other CI platforms are available…

You might find CI useful for the “you broke it” signal, especially if you also have automated tests.
  View user's profile Send private message Visit poster's website
  • Joined: 04 Sep 2021
  • Posts: 7
Reply with quote
Post Posted: Sun Dec 24, 2023 7:24 pm
Today I decided the SMS community deserves a Christmas present, so I have built a Windows binary of Cega.

I originally created my emulator framework to load emulators as plugins, but now I can link emulators to the frontend statically, creating standalone executables for any emulator ported to the framework. That being said, the user experience is not very refined on Windows, but the emulators are functional.

I also built binaries for other emulators I wrote from the ground up (JollyCV for ColecoVision and Geolith for Neo Geo), so I might as well share those too.

To use them, you just need to drag a ROM to the executable. For ColecoVision and Neo Geo you will need to supply your own BIOS images, for SMS/GG you can run without a BIOS image but you are also able to use them if you desire. All emulators should have 100% compatibility with the commercially released libraries. For Neo Geo emulation you need to use .neo files (like the NeoSD uses), there is a set called "LunaGarlic" available that covers the entire MAME library if you do not have the ability to convert from the MAME format.

Cega has some settings related to Mega Drive, because Mega Drive emulation is a work in progress -- it currently only has audio and input. One day I plan to finish the VDP :).

TAB opens the configuration once the emulator is running. Other details are in the README files.

Enjoy!
cega-0.6.0.zip (1.96 MB)
Cega 0.6.0
jollycv-1.0.1.zip (1.76 MB)
JollyCV 1.0.1
geolith-0.1.0.zip (1.84 MB)
Geolith 0.1.0

  View user's profile Send private message Visit poster's website
  • Joined: 16 Apr 2021
  • Posts: 6
Reply with quote
Post Posted: Fri Mar 29, 2024 2:56 am
Thank you so very much for this!!

Since both these three emulators and the frontend appear to have progressed significantly since this release, is there any chance for a new release of these 3 emulators and the frontend you made? :)
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!