Tuesday, August 4, 2009

Porting DeSmuME to Wii - Part 1 -

One of the most highly requested Wii Homebrew applications is a Nintendo DS Emulator. And why not? The Wii is certainly capable of handling the task with it's PowerPC processor more than ten times faster than the DS's ARM processor. The Wii also has more than ten times the amount of RAM then the DS. So I honestly don't see why this isn't possible to do. I'm almost certain we could get most (if not all) games running at full speed using just a basic interpreter emulator.

So I decided to do a bit of more research on the topic and looked through all of the open-source Nintendo DS Emulators available. The best (by far) was DeSmuME. It's been hailed as the best working Nintendo DS Emulator and many hackers have used it to test homebrew because the source for it is relatively simple (so modifications can be easily made).

So I downloaded the source to the latest release 0.9.4 and will be working on porting it as much as I can. Readers beware: I may never finish this port or just give up on it sometime in the process of porting - this is really complex stuff (far harder than anything I've ever done before). I'll be releasing the source code (and a detailed blog post on what I've done so far) every step of the way.

The first thing to do when porting anything to the Wii is to set up the project so that it compiles under libogc. I'll be using the Programmer's Notepad (PNP) IDE, so I've set up my enviroment to compensate for PNP with the proper .pnroj and .pnps files. I've made a makefile that starts at the src folder in DeSmuME - so that way I'm not tasking myself with doing any major rearranging of directories at all.

So, I now have DeSmuME set-up to be compiling under libogc. The first few files actually compile fine, and then of course there are some errors that pop up of things that need to be compensated for. None of the errors are really "bad" so far and I've already worked through quite a few of them already (this work is not present in the download at the bottom of the page).

So now that the DeSmuME is setup to be compiling under libogc, we just need to actually sit down and port the thing so that it does compile and then work. I'm expecting this won't be too bad as I've read through all of the source before even setting up for libogc and there's nothing that complex that needs to be seriously rewritten. I'm looking for collaborators on this project, and I will consider setting up an svn (on google) if I can find some people who would truly commit to working on this with me. I may not (and don't be surprised if this happens - it most likely will) be able to complete this project on my own. I will continue to keep my blog updated on the status of this project.

You can download the latest source code so far for my port of DeSmuME to Wii by clicking here.

Click here to read the next part of the port.

5 comments:

  1. I'll help you all the way with everything but exact code help. You already know that I'm not too good at that part ;)

    ReplyDelete
  2. Thanks :)

    I've already got about a 1/4th of the "core" of the emulator compiling under libogc (changes I made will be in part 2) so hopefully I'll be able to get more serious things rolling sooner than later with this.

    ReplyDelete
  3. I'll help with everything I can! I've been considering trying to do this (porting DeSmuME) myself, but I've never really started. (Don't exepect the incredible help as I'm not an expert in this subject, but whatever I can do, I will be glad to do). e-mail me at profetylen@hotmail.com if you want my help.

    ReplyDelete
  4. Thanks profetlyn :)

    I'll definitely take you up on your offer, expect an e-mail later today with a few more details on the subject.

    For now, I'd reccomend downloading the revision I posted and seeing how far you can get with trying to compile it.

    Thanks again for the offer, I really want to see this project become a reality which is why I took it up and am keeping the community informed every step of the way.

    ReplyDelete
  5. i can't get it to do anything :( it just comes up:
    > "make"

    > Failed to create process: The system cannot find the file specified.

    > Process Exit Code: 0
    > Time Taken: 00:00

    ReplyDelete