Emulators left without USB support

Discussion in 'Wii - Emulation and Homebrew' started by lucor001, Nov 13, 2011.

Nov 13, 2011
  1. lucor001
    OP

    Newcomer lucor001 Member

    Joined:
    Mar 23, 2007
    Messages:
    23
    Country:
    United States
    I got to thinking recently that adding USB support (by loading IOS58) might be possible for some of the emulators that remain without this feature. I noticed fix94 and matguitarist did this for a number of other emulators. I was thinking myself of looking into wii7800 and maybe jzintvwii and seeing if I could add USB support to them.

    I've done a fair amount of coding in years past, and I thought I'd give it a shot. However, just getting started seems to be troublesome. This is really my first venture into coding for the Wii, so I'm not surprised I hit a few roadblocks. For example, has anyone compiled wii7800 from source? How did you get the libraries to link properly? I've gotten devkitPPC setup on my linux machine and am able to get their hello world example working, but I fail on wii7800 in the area of freetype. It appears I'm missing freetype libraries. I've tried to add them to portlibs and such based on some websites out there, but to no avail.

    Am I barking up a tree that will ultimately lead to failure, or does someone have some advice on how to get my tool-chain setup for this task? Any thoughts on what needs to be done to add this feature?

    This is only my 3rd post to GBAtemp, and I hope I added this thread to the correct area. My apologies if I didn't.
    Thanks in advance!
     
    1 person likes this.


  2. giantpune

    Member giantpune GBAtemp Addict

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
    in the portlibs folder, there should be a ppc and a arm subfolder. when you want to add a library into the portlibs, put it inside one of these folders. in this case, you will put freetype in the ppc folder.

    if you do it right, you will end up with this file, among other ones.
    $(DEVKITPRO)/portlibs/ppc/include/freetype2/freetype/freetype.h
     
  3. lucor001
    OP

    Newcomer lucor001 Member

    Joined:
    Mar 23, 2007
    Messages:
    23
    Country:
    United States
    Thanks, that's exactly the directory structure I have (including the environment variable set). It looks like it finds ft2build.h inside of portlibs/ppc/include - but that references freetype/config/ftheaders.h

    which looks to be in the correct place - but can't find it. I'm wondering if there's maybe some other environment variable or maybe LIBS definition in the Makefile I'm missing...
     
  4. sabandellos

    Newcomer sabandellos Advanced Member

    Joined:
    May 28, 2010
    Messages:
    88
    Country:
    Spain
    Very good initiative lucor001.

    It would be a great addition to adding usb support to http://wiibrew.org/wiki/Fuse also!.

    We'll be looking forward to your progress!!!.
     
  5. giantpune

    Member giantpune GBAtemp Addict

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
  6. lucor001
    OP

    Newcomer lucor001 Member

    Joined:
    Mar 23, 2007
    Messages:
    23
    Country:
    United States
    giantpune:
    Thanks, I see where they use that environment variable. I'll see if I can use this on wii7800. I'll look again for anything that might be a environment variable in their makefile as well so see what could be missing. I may also just try checking out fceugx's source and compiling it as well - having a local copy might be helpful in my main goal here.

    abandellos:
    Thanks for the encouragement, but I don't want to get your hopes up. I've had little success so far in compiling much for the Wii, and I have a wife and 2 kids - so my time will be very limited. However, even if I can just figure out one emulator and can document what I did that might be enough for others to work on their favorite emulators. Although, it's also possible it'll be very trivial and I'll do a few - can't tell now :).
     
  7. lucor001
    OP

    Newcomer lucor001 Member

    Joined:
    Mar 23, 2007
    Messages:
    23
    Country:
    United States
    Well, I think I sorted out all of my issues regarding libraries (thanks giantpune). Now it looks like the later devkit / libogc no longer use diropen/dirclose/dirnext and have been replaced by opendir, closedir, readdir (I get why they did this and agree that it was the right thing to do). This change looks to be pretty irritating for readdir - but I'll see if I can figure it out. I did find some relevant threads here on this topic. On the plus side, this code is probably the area I need to be focusing on to add USB support...

    EDIT: That wasn't too bad after all, I think I got that fixed. Now I'm left with some strange stuff in the linking - will continue to look at it.
     
  8. lucor001
    OP

    Newcomer lucor001 Member

    Joined:
    Mar 23, 2007
    Messages:
    23
    Country:
    United States
    Well, I managed to get wii7800 to work from a USB HDD. It's not some landmark achievement, it really boils down to fixing the emulator for the latest devkit and then doing a quick hack to make it work. Instead of being hard-coded to sd:/wii7800/roms (or saves) this version is now hard-coded to usb:/wii7800/roms (or saves) which is all I really wanted. Now, a big TODO would be to add a file browser and do it right, and maybe I'll get to that (it'll depend a lot on the interest from others). If anyone is interested in exactly what I did, you can grep for BPL and find all of my comments.

    For now, I've uploaded my well-commented code and a boot.dol/elf to filehosting.org:

    http://www.filehosting.org/file/details/286461/wii7800-usb.tar.gz

    I hope posting this link is OK, I don't think it qualifies a warez or otherwise. I'm ignorant of GPL licensing issues, but I left all of the headers/text files intact as original and just added comments to the areas of the source I changed. To the best of my knowledge this was open source originally.
     
    1 person likes this.
  9. mightymo77

    Newcomer mightymo77 Advanced Member

    Joined:
    Sep 3, 2011
    Messages:
    57
    Location:
    Hyrule
    Country:
    United States
    Awesome work, thanks!
     
  10. lucor001
    OP

    Newcomer lucor001 Member

    Joined:
    Mar 23, 2007
    Messages:
    23
    Country:
    United States
  11. sabandellos

    Newcomer sabandellos Advanced Member

    Joined:
    May 28, 2010
    Messages:
    88
    Country:
    Spain
  12. mightymo77

    Newcomer mightymo77 Advanced Member

    Joined:
    Sep 3, 2011
    Messages:
    57
    Location:
    Hyrule
    Country:
    United States
    Awesome job. I know you want to get jzintvWii working next. After that look into SMS Plus GX, I think it has the same problem....
     
  13. lucor001
    OP

    Newcomer lucor001 Member

    Joined:
    Mar 23, 2007
    Messages:
    23
    Country:
    United States
    I know there was a request for Fuse as well - I do have some spectrum zx stuff, so that is a possibility.

    I'm having a hard time with jzintvWii - but I'm not ready to give up on it yet. I should note, I use Wiimednafen for SMS which does support USB. You might have reasons for SMS Plus GX that I'm not aware of - but in case you didn't know Wiimenafen is excellent. If you think Wiimednafen doesn't meet your needs then I could look at SMS Plus GX - but I want to be sure to get system coverage as a priority (at least one decent emulator supports USB for all systems, that I use anyway :) ).

    EDIT: I forgot to ask - has anyone actually tried it and verified that it works? I think it requires IOS58 or 61 for USB 2.0 support. However, my Wii has those, so I'm not sure what it does if you don't - it may very well not work.
     
  14. mightymo77

    Newcomer mightymo77 Advanced Member

    Joined:
    Sep 3, 2011
    Messages:
    57
    Location:
    Hyrule
    Country:
    United States
    Yes I did verify that the Wii7800 works by USB.

    Yeah I have Wiimednafen, but just like to have the other options also. If it's quick and easy do it, if not no biggie.
     
  15. lucor001
    OP

    Newcomer lucor001 Member

    Joined:
    Mar 23, 2007
    Messages:
    23
    Country:
    United States
    Thanks for the feedback. I'm going to work on jzintvwii tonight - but if I get stuck I'll d/l the source for Fuse and SMS Plus GX and see what I can learn about them. A night of beer and code, looking forward already.
     
  16. lucor001
    OP

    Newcomer lucor001 Member

    Joined:
    Mar 23, 2007
    Messages:
    23
    Country:
    United States
    I got JzintvWii to work from USB. Here is the RapidShare link:
    https://rapidshare.com/files/801329126/JzintvWii-usb.tar.gz?bin=1

    Give it a run and let me know what you think. I agree that the interface probably needs a little love, but I doubt I'm the one to do it. That's not a slam against the emulator, it works good - but the all text menu's could use a little touching up :).

    On a more practical note, should I start a new thread with the topic collecting the work I've done, or simply continue on with this thread? Either way I'm sure the search works, but not sure what the proper protocol is.

    I've had a chance to look at Fuse and SMS Plus GX. I'm sure what is going on with Fuse, it's going to take some study. SMS Plus GX looks for standard, but it's more complicated than either wii7800 or jzintvwii (it's file browser is much better). I'll see if I can make any headway on either of those.
     
  17. lucor001
    OP

    Newcomer lucor001 Member

    Joined:
    Mar 23, 2007
    Messages:
    23
    Country:
    United States
    mightmo77: SMS GX Plus actually already supports USB loading. Once I got it compiling right I noticed that it had the ability to load properly already. I don't know off hand if it supports USB 2.0 speeds, but it didn't seem to matter much to me.
     
  18. Dogway

    Member Dogway GBAtemp Regular

    Joined:
    Aug 16, 2010
    Messages:
    214
    Country:
    Spain
    I always wonder, if games are loaded into wii ram and played from there, why is it so important USB speed?
     
  19. mightymo77

    Newcomer mightymo77 Advanced Member

    Joined:
    Sep 3, 2011
    Messages:
    57
    Location:
    Hyrule
    Country:
    United States
    I tried actually playing a few Intellivision games with JzintvWii. How the hell do you get the controllers to work? I did press + and switched between wiimote and classic. I'm using classic pro controller, was it intended for the older shittier one? When I tried to just use the wiimote, loaded Popeye for example, all I could do was get him to punch by holding forward and hitting a button. Couldn't get him to move.
     
  20. lucor001
    OP

    Newcomer lucor001 Member

    Joined:
    Mar 23, 2007
    Messages:
    23
    Country:
    United States
    Yeah, the controller interface mystifies me as well. I've been able to figure out most games using the Classic Gaming Pro - the secret I found was that the analog joysticks are used for things I wouldn't normally have guessed (upper left on the right analog joystick usually selects 1 Player for instance).
     

Share This Page