{"id":15049467,"url":"https://github.com/Clownacy/clownmdemu-core","last_synced_at":"2025-10-31T04:32:06.766Z","repository":{"id":38792256,"uuid":"411461100","full_name":"Clownacy/clownmdemu-core","owner":"Clownacy","description":"Sega Mega Drive/Sega Genesis emulator that emphasises portability.","archived":false,"fork":false,"pushed_at":"2025-10-24T00:51:38.000Z","size":2553,"stargazers_count":103,"open_issues_count":22,"forks_count":9,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-10-24T02:54:13.133Z","etag":null,"topics":["68000","68k","ansi-c","emulator","genesis","m68k","mega-cd","mega-drive","megadrive","motorola-68000","sega-cd","sega-genesis","sega-mega-drive","sn76489","sn76496","yamaha","ym2612","ym3438","z80","zilog"],"latest_commit_sha":null,"homepage":"https://clownacy.wordpress.com/tag/clownmdemu/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Clownacy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"Clownacy"}},"created_at":"2021-09-28T22:56:58.000Z","updated_at":"2025-10-24T00:51:42.000Z","dependencies_parsed_at":"2024-02-12T23:26:34.856Z","dependency_job_id":"ecc970fd-4e5d-4e42-9017-cd3a3acbb023","html_url":"https://github.com/Clownacy/clownmdemu-core","commit_stats":null,"previous_names":["clownacy/clownmdemu-core","clownacy/clownmdemu"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Clownacy/clownmdemu-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clownacy%2Fclownmdemu-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clownacy%2Fclownmdemu-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clownacy%2Fclownmdemu-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clownacy%2Fclownmdemu-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Clownacy","download_url":"https://codeload.github.com/Clownacy/clownmdemu-core/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clownacy%2Fclownmdemu-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281930990,"owners_count":26585787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-31T02:00:07.401Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["68000","68k","ansi-c","emulator","genesis","m68k","mega-cd","mega-drive","megadrive","motorola-68000","sega-cd","sega-genesis","sega-mega-drive","sn76489","sn76496","yamaha","ym2612","ym3438","z80","zilog"],"created_at":"2024-09-24T21:20:37.298Z","updated_at":"2025-10-31T04:32:06.421Z","avatar_url":"https://github.com/Clownacy.png","language":"C","funding_links":["https://github.com/sponsors/Clownacy"],"categories":[],"sub_categories":[],"readme":"# Overview\n\nThis is ClownMDEmu, a Sega Mega Drive (a.k.a. Sega Genesis) emulator.\n\nSome standard features of the Mega Drive are currently unemulated (see\n`TODO.md` for more information).\n\nThis repository contains ClownMDEmu's emulation core. It is intended to be\nself-contained and highly-portable.\n\n\n# Frontends\n\nTo actually run software with ClownMDEmu, a frontend is needed.\nCurrently there are two official frontends:\n- The standalone frontend, which includes a variety of debugging menus:\n  https://github.com/Clownacy/clownmdemu-frontend\n- The libretro frontend, for use with libretro implementations such as\n  RetroArch and clownlibretro:\n  https://github.com/Clownacy/clownmdemu-libretro\n\n\n# Design\n\nThe emulation core's code adheres to the following principles, emphasising\nminimalism and portability:\n\n- Use C89. This is required in order to support as many compilers as possible.\n  Ideally, the code should be valid C++ as well, in order to support both C and\n  C++ compilers.\n\n- Use integer-only logic. The Sega Mega Drive/Sega Genesis had no support for\n  floating point types. Therefore, emulating it should not require floating\n  point types. Additionally, floating point types are prone to rounding error\n  and other precision issues, so I do not trust them. I am also concerned about\n  their performance compared to integers, especially on lower-end hardware.\n\n  - There is one exception to this rule: functions relating to generating\n    'constant' data. The reasoning for this is that platforms with poor\n    floating-point support can have this data be computed at build-time and\n    embedded into the executable.\n\n- Do not use dynamic memory. Memory allocation is slow, will cause memory leaks\n  when not correctly freed, and can cause software to fail mid-execution when\n  memory is exhausted, which is more effort to account for than it is worth.\n\n- Use no global state. All state should be kept in a struct which functions\n  access through a pointer, allowing for such things as simple fast save-state\n  support as well as the possibility of running multiple instances of the\n  emulator at once. Note that the state must not contain pointers, so that it\n  is relocatable and position-independent. Likewise, the state must not depend\n  on outside state, so that it is useable across multiple executions of the\n  emulator.\n\n- Operate within the guarantees of the C standard: no undefined behaviour and\n  no implementation-defined behaviour.\n\n  - Do not depend on integer type sizes. 'char', 'short', 'int', and 'long' may\n    be different sizes on different platforms, so do not rely on their ability\n    to hold (or not hold) values larger than their standard capacities:\n    - -127 to 127 for 'signed char'.\n    - 0 to 255 for 'unsigned char'.\n    - -32767 to 32767 for 'short' and 'int'.\n    - 0 to 65535 for 'unsigned short' and 'unsigned int'.\n    - -2147483647 to 2147483647 for 'long'.\n    - 0 to 4294967295 for 'unsigned long'.\n\n  - Do not assume that 'char' is always signed by default; it is not. For\n    instance, it is unsigned by default on ARM CPUs.\n\n  - Do not rely on C language extensions.\n\n  - Do not rely on endianness. Code should work correctly on both little-endian\n    and big-endian CPUs.\n\n  - Do not rely on signed number representation. That is to say, do not assume\n    that negative numbers are represented in binary as two's complement.\n\n- Use original code. No emulation components should be taken from other\n  emulators or libraries. For example, rather than use something like\n  [Musashi](https://github.com/kstenerud/Musashi), the 68000 emulation core is\n  custom. Likewise, a custom YM2612 emulation core is used instead of\n  [Nuked-OPN2](https://github.com/nukeykt/Nuked-OPN2).\n\nThe emulation core is implemented as a library, with all platform-specific logic\nbeing relegated to a separate frontend program.\n\nClownMDEmu attempts to balance correctness with performance, acting as a more\nhigh-level emulator than accuracy-focussed alternatives may.\n\nThe core exposes a relatively low-level interface: audio from the FM and PSG\nare output separately at their native sample rates, and video is output a\nsingle scanline at a time in its native indexed format. This is to give the\nfrontend the most flexibility in how it can process the data for delivery to\nthe user. For instance, if the platform can play multiple separate audio\nstreams at once, then the frontend can skip the expensive steps of audio\nresampling and mixing.\n\n\n# Compiling\n\nClownMDEmu can be built using CMake, however it should not be hard to make the\ncore use a different build system if necessary as its build process is not\ncomplicated.\n\nBe aware that this repo uses Git submodules; use `git submodule update --init`\nto pull in these submodules before compiling.\n\n\n# Licence\n\nClownMDEmu is free software, licensed under the AGPLv3 (or any later version).\nSee `LICENCE.txt` for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FClownacy%2Fclownmdemu-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FClownacy%2Fclownmdemu-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FClownacy%2Fclownmdemu-core/lists"}