Code Monkey home page Code Monkey logo

libevmu's Issues

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.

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?

audio emulation innacuracies

1 - the Timer 1 base clock comes from the CPU's clock making it go high pitched on RC clock mode and nearly supersonic on CF clock mode, the emulator just sets the Timer 1 base clock to quartz/6 always regardless of the CPU clock

  • fixing this should fix shenmue's goodies startup music and timing since Timer 0 and its prescaler follows this same behaviour, EVMU appears to treat it as a clock multiplier (?)

2 - the Timer 1 mode 3 is not implemented, with this mode you can set a clock double function by setting the enable bits to "01" making the range on quartz mode /6 to go from F-1 trough F-8 instead of F-1 trough F-7.

  • no game appears to use this behaviour

2.1 - additionally this mode adds another sound layer that makes a sort of strobe pattern, it's very audible on quartz mode and always follows the pitch of T1LR, setting T1HR has no effects on it unless you set it to $FF which will mute the pattern, the pattern have octaves that can be enabled or disabled trough the T1HC register, "1" bits will enable the octave while "0" bits will mask it out, up to 8 octaves can be heard assuming T1HR is below $80, the way the octaves stack is by each octave being around 90 degrees out of phase with each other, making a pattern like this
octave 1 __|___|___|___|___|___|___|___|_
octave 0 ____|_______|_______|_______|___
result = __|_|_|___|_|_|___|_|_|___|_|_|_
the output appears to be ORed with the PWM output

  • no game appears uses this mode

3 - the sample rate output of the emulator assumes quartz output only, the hardware should emit up to 2MHz tones using the clock double mode

  • changing sample rate to a higher number and use resampling for higher tones should create an output closer to that of the real machine, however the VMU seems to have a strong high-pass on the ports even with direct speaker wire recordings

4 - direct sound mode is not emulated, toggling Port 1 bit 7 with the corresponding P1DDR set to "0" does not alter the sound output

  • i don't know of any games that use this

5 - the PWM comparator seems to compare itself on every timer cycle instead of only once

  • fixing this should allow pac-man to output audio

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.