Thursday, August 6, 2009

Porting DeSmuME to Wii - Part 3 -

First a progress update: I'm still working really hard on porting over the OpenGL to GX and rewriting portions of OGLRender.cpp to work on Wii. Profetlyn has been helping me a great deal. Hopefully, "part 4" of this port will be up within a week or so explaining how we ported the OpenGL dependent code.

Now onto the content of this post:

In this post, I'd like to explain how the emulator works. No, this isn't a post about how emulation in general works, but instead about how the DeSmuME itself works. Let's get started shall Wii?

There are two main parts of DeSmuME; The core and the GUI.

The core of DeSmuME is essentially a library of functions that when used together properly can emulate a ROM. Each function plays a specific role in the emulation such as one to apply shading to objects and one to output a part of the sound. The source files in the "src" folder are the core of the emulator.

The GUI (GUI = Graphical User Interface) properly uses the core to emulate a ROM. The GUI selects which ROM to emulate, handles the loading of saves/savestates, the application of cheats, and maintains all of the information used by emulator in the RAM. Once the GUI for DeSmuME has selceted a ROM, it calls all of the ncessary functions (in threads of loops of course) to run that ROM. The GUI is inside the "Windows" folder inside the "src" folder. Eventually, it will need to be completely rewritten. The folders "cocoa", "gtk", and "gtk-glade" are ports of the Windows folder used for other platforms (linux, mac, etc.)

Also, for the record, there's an "addons" folder which contains experimental code used to emulate some features of Nintendo DS extensions like the rumble pack and the GBA Slot. Initially, this experimental code will probably not be included in the port to Wii.

For rendering, the emulator uses OpenGL. This will be converted into GX during the ported process. For sound, the emulator uses SDL. There is already a great SDL port for Wii (thanks Tantric :) ), so we will use this port output sound.

To port the emulator, we must first port the emulator's core so that it may be properly used to emulate a ROM on Wii. We must then port (actually, probably rewrite from scratch) the GUI so that we can actually emulate a ROM. Initially, the ported/rewritten GUI will be much simpler than DeSmuME's, but should eventually become fully featured.

profetlyn and I are still looking for some additional coders with a little more knowledge then us to work with us and help us with this port so it goes a little more quickly and accurately. Please contact either of us if you think you can help out.

Click here to read the next part of the port.

Click here to read the previous part of porting DeSmuME.

No comments:

Post a Comment