Results 1 to 4 of 4
  1. #1
    EmuTalk Member Garstyciuks's Avatar
    Join Date
    Jan 2006
    Posts
    152

    What libraries do you use for cross platform emu development?

    Hey, I recently got interested in cross platform development. I have rewritten my chip8 emulator using wxWidgets and SDL. It compiles and runs fine on Windows and Linux, but I can't test it on Mac . Anyway, I wonder how do you get accurate timing and what libraries do you use?



    • Advertising

      advertising
      EmuTalk.net
      has no influence
      on the ads that
      are displayed
        
       

  2. #2
    Boring person
    Join Date
    May 2006
    Posts
    194
    I just use SDL generally, but using timing (I assume you mean functions to get clock counts and delay for periods) functions are usually so simple that it's worthwhile to define some alternatives for the platform and fall back on SDL otherwise.

    Just out of curiosity, what kind of timing are you looking at? And for what application?

  3. #3
    EmuTalk Member Garstyciuks's Avatar
    Join Date
    Jan 2006
    Posts
    152
    I meant about timing emulators. Like how do you get accurate speed of the emulated machines?

  4. #4
    Boring person
    Join Date
    May 2006
    Posts
    194
    Quote Originally Posted by Garstyciuks View Post
    I meant about timing emulators. Like how do you get accurate speed of the emulated machines?
    Usually you just have to keep things timed roughly to one frame, which will usually be at 60Hz or 50Hz. So you emulate the console for roughly N virtual clock cycles, update the video, sound, input, and what have you, then wait until it has been however many milliseconds (or microseconds, if your timing allows them, or whatever denomination it does) since the last update. You can also have it wait if the audio buffer gets too far ahead of the emulated machine. Or you can synchronize to actual vsync if you have them and the platform you're on is at the right rate (I do this on PSP).

    I've seen some advice on this board that you should run each instruction so that it takes roughly what a clock cycle would on the real machine. This isn't practical or very useful advice; for pretty much any machine you'll emulate that amount of time for one cycle is too small to hit precisely with any timing mechanism and you'll spend a huge amount of overhead on this. Synchronizing on video is good because that's basically the most noticeable thing to the player, although it's probably a good idea to have it on video and sound. Both of these things are relatively long cycle periods so there's not a lot of overhead involved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •