Hacking Compiling WBFS on Mac OS X

Barbapapa

Well-Known Member
Newcomer
Joined
Mar 14, 2009
Messages
47
Trophies
0
Location
Europe
Website
Visit site
XP
51
Country
Netherlands
I have a MacBook Pro 2.6Ghz Dual Core 2, 4Gb RAM, 10.5.6.
Plugged in my LaCie 120GB Brick drive (USB). Program works like a charm BUT is very slow indeed.
A transfer of House Of The Dead Overkill (a few minutes on my Wii itself) took over half an hour.

But it's SO cool that this program was written, so I am very grateful for it! Patience is a virtue.
 

g3power

Member
Newcomer
Joined
Apr 4, 2009
Messages
11
Trophies
0
XP
26
Country
Afghanistan
It's slow for me, too. About 128 kb/s. Furthermore the drive is very noisy while transferring an iso. It sounds like the head is jumping between sectors that are close together. This leads me to speculate, that there are some issues with the order the data is sent to the drive.

I have also read, that Mac OS X doesn't have a write cache for block devices. So if you don't use a flash device or the drive doesn't do any command reordering by itself you will end up with the behaviour we see.

Someone in this thread requested a caching mechanism. This should help for those with slow transferes. I would like to help in finding a solution, but I can't seem to find a current source package. If someone can tell me where to get one that represents the current efforts I will gladly try to find a solution.
 

darkten

Well-Known Member
Member
Joined
Mar 31, 2009
Messages
174
Trophies
0
XP
304
Country
United States
Ok great...good info. I believe flashsticks are a HORRIBLE was to go; the cheap ones write horribly slow in general and the way wbfs works uses the slowest way possible (on MacOS X)

I'm going to attempt to wedge a 4MB write buffer into the thing...when I find the write code in the wbfs source. This will help on disk-based devices that have their own caches anyway, but for thumb drives, methinks thou art screw-ed
smile.gif


d10
 

darkten

Well-Known Member
Member
Joined
Mar 31, 2009
Messages
174
Trophies
0
XP
304
Country
United States
g3power said:
Someone in this thread requested a caching mechanism. This should help for those with slow transferes. I would like to help in finding a solution, but I can't seem to find a current source package. If someone can tell me where to get one that represents the current efforts I will gladly try to find a solution.

I sent you a PM if you want to get in on this action. Currently, looking at the code, this is working on a 1:1 read/write cycle and I'm not seeing a (good) way to wedge this in the way the code is written currently. Perhaps you might.

We've got a couple of choices here:

1. re-implement this thing to not use fread/fwrite directly to the block device...that is to say, use actual cocoa or carbon code to do this.
2. wedge in a ram write cache for about 4MB of data. Anything over that in my experience leads to diminishing returns.

d10
 

darkten

Well-Known Member
Member
Joined
Mar 31, 2009
Messages
174
Trophies
0
XP
304
Country
United States
Ok...I may have been wrong about the amount of work a wedge might take. The coders amongst us, have a look here:

CODEstatic int wbfs_fwrite_sector(void *_fp,u32 lba,u32 count,void*buf)
{
FILE*fp =_fp;
u64 off = lba;
off*=512ULL;
if (fseeko(fp, off, SEEK_SET))
{
wbfs_error("error seeking in disc file");
return 1;
}
if (fwrite(buf, count*512ULL, 1, fp) != 1){
wbfs_error("error writing disc");
return 1;
}
return 0;

}

We *may* be able to do libwbfs_macosx.c as libwbfs_macosx.m and convert the writes to use NSData maybe, or whatever the Corefoundation equiv is so that it goes around straight fwrite().

Any feedback on this?

d10
 

roku93

Well-Known Member
Member
Joined
Jan 28, 2009
Messages
437
Trophies
0
Age
30
Location
Finland
XP
259
Country
Finland
How about porting the howard c's WBFS managers part that makes channels automatically from the games? I dunno how hard that would be, all the necessary parts are probably not for macs...

But anyways, big thanks for all we've got so far. Makes my life easier...
biggrin.gif
 

joda

Well-Known Member
Member
Joined
Jul 12, 2007
Messages
436
Trophies
0
Location
Umeå
XP
119
Country
roku93 said:
How about porting the howard c's WBFS managers part that makes channels automatically from the games? I dunno how hard that would be, all the necessary parts are probably not for macs...

But anyways, big thanks for all we've got so far. Makes my life easier...
biggrin.gif
This would be awesome, but problem lies in extracting opening.bnr from the disc. As I've understood it HowardC's WBFS manager dynamically links in stuff from WiiScrubber, which is a 100% windoze binary. You'd have to port over the file extraction feature to get this to work. The un-/repacking binaries for wad files are all based on open sourced linux programs, if I don't remember incorrectly. (That's why everyone uses cygwin ports of these.)

HowardC uses my autostart dol for the channels, and that one is easily modified for any game. You can actually even do it with a perl oneliner string replace script ... =)
 

collin

Member
Newcomer
Joined
Nov 16, 2006
Messages
24
Trophies
0
XP
52
Country
darkten said:
QUOTE said:
or give me the source code so I can do it? Thanks.

Nope. Can't have that. You can have the sources to the wbfs bin; we made some mods to make the output easier to parse. I'll put this on my server after I wake from my nap.

Why wouldn't you open source it?
 

joda

Well-Known Member
Member
Joined
Jul 12, 2007
Messages
436
Trophies
0
Location
Umeå
XP
119
Country
collin said:
darkten said:
QUOTE said:
or give me the source code so I can do it? Thanks.

Nope. Can't have that. You can have the sources to the wbfs bin; we made some mods to make the output easier to parse. I'll put this on my server after I wake from my nap.

Why wouldn't you open source it?
Probably because they don't want any half-assed "My new elite nija mod WBFS Mac OS X combo loader extreme" threads with people rereleasing the program with added "features" that don't work and look like the original authors fucked the program up. This since this program is a polished example of Mac splendor ...

Open source is excellent, but it's still up to every developer to decide on that.
 

collin

Member
Newcomer
Joined
Nov 16, 2006
Messages
24
Trophies
0
XP
52
Country
joda said:
Probably because they don't want any half-assed "My new elite nija mod WBFS Mac OS X combo loader extreme" threads with people rereleasing the program with added "features" that don't work and look like the original authors fucked the program up. This since this program is a polished example of Mac splendor ...


So? Let people do that; let them release hacked crap, because if it doesn't work, people won't use it anyway. If it does, this can be a better product. Let people be allowed to add stuff like banner wads without relying on the largesse of d10 and others. Look, if the underlying tool wasn't opened, we would have even been able to port it OS X anyway. The disparity is unfortunate. Is the author looking to sell this app?
 

tps2d

Active Member
Newcomer
Joined
Mar 31, 2009
Messages
34
Trophies
0
XP
2
Country
United States
You have to respect the author's right to keep their source code. They didn't have to make an app at all, just be glad they're releasing it for free.

If you don't like their policy on open source, don't use their program and write your own. Simple as that.
 

roku93

Well-Known Member
Member
Joined
Jan 28, 2009
Messages
437
Trophies
0
Age
30
Location
Finland
XP
259
Country
Finland
There is a half-assed version of Dolphin for OS X, wonder if that would be able to extract the opening.bnr? At least it can in the windows. Source code from that could be used, methinks.
 

joda

Well-Known Member
Member
Joined
Jul 12, 2007
Messages
436
Trophies
0
Location
Umeå
XP
119
Country
tps2d said:
You have to respect the author's right to keep their source code. They didn't have to make an app at all, just be glad they're releasing it for free.

If you don't like their policy on open source, don't use their program and write your own. Simple as that.
+1
 

collin

Member
Newcomer
Joined
Nov 16, 2006
Messages
24
Trophies
0
XP
52
Country
tps2d said:
If you don't like their policy on open source, don't use their program and write your own. Simple as that.

Fair, they have that right and I do love the app and the contributions of the authors. But, I asked a legitimate question. If they said 'no, hate OSS' or 'we plan to commercialize this,' don't care. I was just asking.

tps2d You have to respect the author's right to keep their source code. They didn't have to make an app at all, just be glad they're releasing it for free.

Funny you should ask. I don't see any respect for kwiirk's intellectual property with the .app that is distributed. Had kwiirk better licensed his software, I think the authors would be seriously liable.

Addendum: No .app citation of HBC's work either.

QUOTE(darkten @ Apr 3 2009, 02:22 PM) You can have the sources to the wbfs bin; we made some mods to make the output easier to parse. I'll put this on my server after I wake from my nap.

Yeah, you legally need to do that with GPL.
 

tps2d

Active Member
Newcomer
Joined
Mar 31, 2009
Messages
34
Trophies
0
XP
2
Country
United States
collin said:
Funny you should ask. I don't see any respect for kwiirk's intellectual property with the .app that is distributed. Had kwiirk better licensed his software, I think the authors would be seriously liable.

Addendum: No .app citation of HBC's work either.

I agree.. They should have a "Thanks to Kwiirk" in their About WBFS tab.

However, I believe they are fully within the licensing of wbfs (which is GPL, I believe) by offering any modifications they've made to Kwiirk's source. They do not have to release their own code, just the modifications to the wbfs libraries or command. I'm not sure if GPL requires a derivative work to include credit to the original code in their app, but it's a nice thing to do anyway.
 

collin

Member
Newcomer
Joined
Nov 16, 2006
Messages
24
Trophies
0
XP
52
Country
tps2d said:
However, I believe they are fully within the licensing of wbfs (which is GPL, I believe) by offering any modifications they've made to Kwiirk's source. They do not have to release their own code, just the modifications to the wbfs libraries or command. I'm not sure if GPL requires a derivative work to include credit to the original code in their app, but it's a nice thing to do anyway.

I feel compelled to add that I have nothing against them and am not trying to start a jihad. In fact, I have switch over to the app from using the terminal and appreciate the aesthetics. Clearly the authors are talented.

However, I was wrong -- there is nothing ambiguous about kwiirk's licensing.

wbfs.c said:
// Copyright 2009 Kwiirk
// Licensed under the terms of the GNU GPL, version 2
// http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt

So! §3

QUOTE(the terms of the GNU GPL, version 2)
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,

b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,

c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)

I do believe he must give proper attribution is his application.
 

joda

Well-Known Member
Member
Joined
Jul 12, 2007
Messages
436
Trophies
0
Location
Umeå
XP
119
Country
collin said:
tps2d said:
However, I believe they are fully within the licensing of wbfs (which is GPL, I believe) by offering any modifications they've made to Kwiirk's source. They do not have to release their own code, just the modifications to the wbfs libraries or command. I'm not sure if GPL requires a derivative work to include credit to the original code in their app, but it's a nice thing to do anyway.

I feel compelled to add that I have nothing against them and am not trying to start a jihad. In fact, I have switch over to the app from using the terminal and appreciate the aesthetics. Clearly the authors are talented.

However, I was wrong -- there is nothing ambiguous about kwiirk's licensing.

wbfs.c said:
// Copyright 2009 Kwiirk
// Licensed under the terms of the GNU GPL, version 2
// http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt

So! §3

QUOTE(the terms of the GNU GPL, version 2)
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,

b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,

c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)

I do believe he must give proper attribution is his application.
The paragraph you quote regards only direct derivative work. Since this program is a wrapper, they only have to release the source to the modified, bundled, version of wbfs, which they do. No part of wbfs is in any way integrated in the Cocoa app in itself.
 

collin

Member
Newcomer
Joined
Nov 16, 2006
Messages
24
Trophies
0
XP
52
Country
joda said:
The paragraph you quote regards only direct derivative work. Since this program is a wrapper, they only have to release the source to the modified, bundled, version of wbfs, which they do. No part of wbfs is in any way integrated in the Cocoa app in itself.

Please see §3 clause (b).

QUOTE(Myself quoting the terms of the GNU GPL, version 2)b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,

... which is the minimal legal requirement. Clearly, it is being bundled in executable form (§3) with no written offer (vis-a-vis attribution) and therefore violates said license. I'm not sure that you could reasonably disagree that the implication is that there must be a reference in the bundle -- be it the app itself or the distribution package. And to preempt any counterpoint -- this forum is not the venue for such fulfillments.
 

joda

Well-Known Member
Member
Joined
Jul 12, 2007
Messages
436
Trophies
0
Location
Umeå
XP
119
Country
collin said:
... which is the minimal legal requirement. Clearly, it is being bundled in executable form (§3) with no written offer (vis-a-vis attribution) and therefore violates said license. I'm not sure that you could reasonably disagree that the implication is that there must be a reference in the bundle -- be it the app itself or the distribution package. And to preempt any counterpoint -- this forum is not the venue for such fulfillments.

Well, you are true in that in the original release, no such offer was included. However:
darkten said:
QUOTEor give me the source code so I can do it? Thanks.

Nope. Can't have that. You can have the sources to the wbfs bin; we made some mods to make the output easier to parse. I'll put this on my server after I wake from my nap.

-d10 Want and Woe.
Clearly states that source to the wbfs, which is the only thing under the GPLv2, is going to be available on darkten's server. So, sure, a reference to this is lacking in the official package so far, but I doubt it will in any upcoming release.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    SylverReZ @ SylverReZ: :shy: