Code Monkey home page Code Monkey logo

libevmu's Introduction


libEVMU

libElysianVMU

C17-Based library for emulating the Sega Dreamcast's Visual Memory Unit
Explore the docs »

Accurate · Full-Featured · Cross-Platform

Overview

libElysianVMU (libEVMU) is a standalone emulator core of the Sega Dreamcast's 8-bit Visual Memory Unit (VMU), written in C17. It is the core powering the ElysianVMU emulator for Windows, MacOS, and Linux, which has been separated from any platform-specific back-end or UI front-end. Several years of meticulous research and reverse engineering have gone into the creation of this core, which has now been open-sourced in hopes of benefitting the Dreamcast community at-large.

Goals

The primary goal of libEVMU is to provide a one-stop, all-encompassing framework exposing everything the VMU has to offer in a standard C codebase that can be ported to any platform or wrapped to any language, allowing for everyone to use it in their projects and to benefit from a common codebase. At a high-level, this goal encompasses:

  • Fully and accurately emulating the VMU as a standalone gaming device
  • Providing tooling and APIs around its filesystem and all relevant file formats
  • Meticulously documenting every aspect of the codebase to expose everything that was previously undiscovered
  • Being performant enough to be ported to a Sega Saturn, N64, or toaster oven
  • Offering a high-level entity/component-based API that is intuitive and easy to work with
  • Allowing for modeling exotic, customized, nonstandard VMUs with extended volumes or capabilities
  • Providing low-level hooks for supporting debuggers and high-level tooling
  • Rigorously unit testing all aspects of the codebase to ensure correctness

Features

  • Battery
    • Emulated low-voltage signal
  • BIOS Support
    • Official (US and Japanese)
      • Skip directly to GAME
      • Modify date/time
    • Emulated Software back-end
  • Buzzer
    • Creates and manages PCM buffers for audio back-end
  • File System
    • Import + export files
    • Formatting
    • Defragmentation
    • Unlock/lock extra flash blocks
    • Diagnostics and validation
    • Changing volume icons or color
    • Loading custom ICONDATA
    • Modifying copy protection bits
    • Loading a GAME file from only a VMS and no VMI
    • Recalculating checksums
    • Extracting and texturing icons
    • Extracting and texturing eyecatches
    • Supported File Formats
      • .VMI
      • .VMS
      • .DCI
      • .DCM
      • .flash
      • .bin
  • Gamepad
    • Polling or event-driven input back-ends
    • Supports turbo buttons, slow motion, and fast-forward
  • LCD Screen
    • Emulated pixel ghosting and grayscale effects
    • Extra options for bilinear filtering, color inversion, etc
    • Provides a simple virtual framebuffer abstraction for renderer back-end
    • Provides asynchronous screen refresh callbacks, only when contents change

Platforms

libEVMU is being actively tested in CI on the following targets:

  • Windows
  • MacOS
  • Linux
  • Sega Dreamcast
  • Sony PSVita
  • WebAssembly
  • iOS
  • Android

Compilers

libEVMU is being built in CI with the following compilers:

  • GCC
  • Clang
  • MinGW-w64
  • Emscripten

NOTE: Microsoft Visual Studio support is currently a work in progress!

Building

Building is done with standard CMake. You should be able to open CMakeLists.txt directly as a project file in most IDEs such as XCode, Qt Creator, CLion, etc if you wish to build from a UI.

First, ensure submodules are installed with:

git submodule update --init --recursive

To build the project and its unit tests from the command-line, you can do the following:

mkdir build
cd build
cmake -DEVMU_ENABLE_TESTS=ON ..
cmake --build . 

Credits

Author

  • Falco Girgis

Contributors

  • Colton Pawielski
  • jvsTSX

Collaborators

  • Andrew Apperley
  • Patrick Kowalik
  • Walter Tetzner
  • Tulio Goncalves
  • Kresna Susila
  • Sam Hellawell

Special Thanks

  • Marcus Comstedt
  • Ruslan Rostovtsev
  • Shirobon
  • Deunan Knute
  • Dmitry Grinberg
  • RinMaru
  • UltimaNumber
  • Joseph-Eugene Winzer

libevmu's People

Contributors

cepawiel avatar cykoder avatar gyrovorbis avatar jvstsx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

libevmu's Issues

How to download

I want to run some VMU games on Windows. But this github page doesnt have a Windows x86_64 binary to download and run.
Is this a libretro core, or do I have to build it myself, or am i missing the point?

loading up DCI files.

#include <evmu/hw/evmu_device.h>
#include <evmu/hw/evmu_rom.h>
#include <evmu/hw/evmu_lcd.h>
#include <evmu/fs/evmu_file_manager.h>

int main(int argc, char* argv[]) {
    // create a VMU
    EvmuDevice* pDevice = EvmuDevice_create();

    // load a BIOS (if we were given one as the first cmdline argument)
    if(argc >= 2)
        EvmuRom_loadBios(pDevice->pRom, argv[1]);

    // load a ROM (if we were given one as the 2nd cmdline argument)
    if(argc >= 3)
         EvmuFileManager_load(pDevice->pFileMgr, argv[2]);

    // infinite loop
    while(1) {
        // Run the emulator for 1ms
        EvmuIBehavior_update(EVMU_IBEHAVIOR(pDevice), 1000000); 

        // Check if the display needs to be updated
        if(pDevice->pLcd->screenChanged) {
             // iterate over all pixels
             for(unsigned h = 0; h < EVMU_LCD_PIXEL_HEIGHT; ++h)  {
                 for(unsigned w = 0; w < EVMU_LCD_PIXEL_WIDTH; ++w) {
                     // fetch the pixel value for the current location
                     const GblBool pixel = EvmuLcd_pixel(pDevice->pLcd, w, h);
                     // print X for black pixels, nothing for white
                     printf(pixel? "X" : " ");
                 }
                 // start next row
                 printf("\n");
             }
             // Tell EVMU the screen hasn't changed since we updated
             pDevice->pLcd->screenChanged = GBL_FALSE;
        }
    }

    // Release/free the VMU device
    EvmuDevice_unref(pDevice);

    return 0;
}

When using this to load up a DCI file get the following error.

X : Failed to load file due to legacy libGyro reest: Failed to open file!
@ EvmuFileManager_load(..): .../lib/source/fs/evmu_file_manager.c:716

Im assuming it is some error loading up standalone dci files. tried with and without the bios with and without using the .dci file extension in the cli argument and with / without having the actual file extension being .dci
But only got that specific warning when I ran ./test rom.dci so I suspect it issue is not on my end.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.