Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Federation Bot
Federation Bot
@Federation_Bot  ·  activity timestamp 3 months ago

LibRetro's Genesis emulator can run on the GCW0 handheld console, & I'll now study its entrypoint for this host.

It first registers a shutdown callback which saves the simulated-cartridge's RAM to a file if appropriate (3 conditions), invokes some of the core finalizers, & invokes some of SDL's finalizers.

If no game's specified it then displays a message box describing how to invoke this command. Otherwise it opens an error log, creates a bunch of directories, ...

1/?

  • Copy link
  • Flag this post
  • Block
alcinnz
alcinnz
@alcinnz@floss.social replied  ·  activity timestamp 3 months ago

... populates a config struct with defaults & attempts to read overrides from a file, copies the filename stripping the extension, carefully reads in the BIOS to interpret, initializes SDL or exits with a message box displaying the error, initializes SDL subsystems (joystick, video, sound, & sync), with a lock held the output in a bitmap object with structural metadata, loads the game's ROM dump via core code, & initializes the core audio emulator followed by the rest of the core.

2/?

  • Copy link
  • Flag this comment
  • Block
alcinnz
alcinnz
@alcinnz@floss.social replied  ·  activity timestamp 3 months ago

Specifically for MegaCD it then attempts to load a backup RAM file into memory, considers clearing that backup RAM it has read in, & attempts to read in another possibly clearing it.

Then it might attempt to read in "SRAM" for the cartridge, reset the core emulator, consider pausing audio, considers registering a periodic timer callback. This callback manages some synchronized counters to determine when to synthesize VBlank events.

After which it enters the mainloop!

3/?

  • Copy link
  • Flag this comment
  • Block
alcinnz
alcinnz
@alcinnz@floss.social replied  ·  activity timestamp 3 months ago

This mainloop repeatedly iterates over SDL events to trigger emulator actions (update title to to show specs upon that synthetic event, decide when to exit, reset the emulator, show or hide cursor, choose a BIOS, etc), upon first iteration outputs some configs to additional trivial files, updates SDL video & audio, considers waiting on a semaphore, & semi-otherwise considers entering a separate mainloop to render a *relatively* simple interactive for altering the configs.

4/?

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct