Homebrew Need help to compile fceux gx

Cecilmax

Well-Known Member
OP
Member
Joined
Mar 7, 2015
Messages
444
Trophies
0
Age
42
XP
1,115
Country
Canada
Hello guys,

I try to compile the last version of fceu gx without touching it to understand how to compile it and I have that error:

c:/fceugx-3.3.9/fceugx-3.3.9/source/fceugx.h:92:21: error: 'MAXPATHLEN' was not declared in this scope

any idea what I am missing ?

thanks for your help :)
 
Last edited by Cecilmax,

Cecilmax

Well-Known Member
OP
Member
Joined
Mar 7, 2015
Messages
444
Trophies
0
Age
42
XP
1,115
Country
Canada
I have fixed the error, there some lib missing, but now I have theses errors. I think there is missing some libs again. Can someone post a link with a tutorial to install a working compiling environement for widnows ? :) Its a real pain to try each time until we have all the necessary lib to compile :)

c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.8.2/../../../../powerpc-eabi/bin/ld.exe: cannot find -lmxml
c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.8.2/../../../../powerpc-eabi/bin/ld.exe: cannot find -lwupc
c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.8.2/../../../../powerpc-eabi/bin/ld.exe: cannot find -lvorbisidec
 

Cecilmax

Well-Known Member
OP
Member
Joined
Mar 7, 2015
Messages
444
Trophies
0
Age
42
XP
1,115
Country
Canada
Hello guys, I have found the necessary libs, but now I am stuck with this error. Any ideas ?


"make" -f Makefile.wii
make[1]: Entering directory `/c/projects/wii/fceugx-3.3.9'
linking ... fceugx-wii.elf
c:/devkitPro/portlibs/ppc/lib\libmxml.a(mxml-file.o): In function `mxml_get_entity':
mxml-file.c:(.text+0x400): undefined reference to `__locale_ctype_ptr'
c:/devkitPro/portlibs/ppc/lib\libmxml.a(mxml-string.o): In function `_mxml_vsnprintf':
mxml-string.c:(.text+0x33c): undefined reference to `__locale_ctype_ptr'
mxml-string.c:(.text+0x3a0): undefined reference to `__locale_ctype_ptr'
gcvideo.o: In function `FindVideoMode()':
c:/projects/wii/fceugx-3.3.9/source/gcvideo.cpp:464: undefined reference to `TVPal576IntDfScale'
c:/projects/wii/fceugx-3.3.9/source/gcvideo.cpp:464: undefined reference to `TVPal576IntDfScale'
c:/devkitPro/libogc/lib/wii\libfat.a(directory.o): In function `_FAT_directory_entryGetAlias':
C:/Users/davem/projects/devkitpro/libnds-master/libfat/libogc/../source/directory.c:225: undefined reference to `__locale_ctype_ptr'
C:/Users/davem/projects/devkitpro/libnds-master/libfat/libogc/../source/directory.c:233: undefined reference to `__locale_ctype_ptr'
collect2: ld returned 1 exit status
make[2]: *** [/c/projects/wii/fceugx-3.3.9/executables/fceugx-wii.elf] Error 1
make[1]: *** [build_wii] Error 2
make[1]: Leaving directory `/c/projects/wii/fceugx-3.3.9'
"make": *** [wii] Error 2

> Process Exit Code: 2
> Time Taken: 00:22
 

Cecilmax

Well-Known Member
OP
Member
Joined
Mar 7, 2015
Messages
444
Trophies
0
Age
42
XP
1,115
Country
Canada
Nobody can help ? Im going insane trying to compile it lol

--------------------- MERGED ---------------------------

I installed the last devkitpro with all the libs and portlibs.

As for the devkitppc, I have try both r24 version, r25, r26 and also the last version with no success.
 

GreyWolf

Well-Known Member
Member
Joined
Mar 2, 2015
Messages
5,401
Trophies
0
Age
52
XP
1,488
Country
United States
TVPal576IntDfScale is now TVPal574IntDfScale. It's the same value.

I'm not sure what the _locale_ctype_ptr error is without seeing the line it's complaining about. You may need to recompile libmxml and make sure your source tree doesn't have something like a custom fat library that needs to be recompiled, too.
 
Last edited by GreyWolf,

Cecilmax

Well-Known Member
OP
Member
Joined
Mar 7, 2015
Messages
444
Trophies
0
Age
42
XP
1,115
Country
Canada
TVPal576IntDfScale is now TVPal574IntDfScale. It's the same value.

I'm not sure what the _locale_ctype_ptr error is without seeing the line it's complaining about. You may need to recompile libmxml and make sure your source tree doesn't have something like a custom fat library that needs to be recompiled, too.

Thanks for your help :) I just change it and I don't have the TVPal error anymore.

I am confused a lot about which version of devkitpro to install, I try different scenario and I got differents errors of compilation.

My first try, I installed devkitpro with the last libogc and the last devkitppc.
If I try to compile it, here is the error I have:

heatmgr.cpp
In file included from c:/projects/wii/fceugx/source/cheatmgr.cpp:15:0:
c:/projects/wii/fceugx/source/fceugx.h:86:18: error: 'MAXPATHLEN' was not declared in this scope
char LoadFolder[MAXPATHLEN]; // Path to game files
^~~~~~~~~~
c:/projects/wii/fceugx/source/fceugx.h:87:22: error: 'MAXPATHLEN' was not declared in this scope
char LastFileLoaded[MAXPATHLEN]; //Last file loaded filename
^~~~~~~~~~
c:/projects/wii/fceugx/source/fceugx.h:88:18: error: 'MAXPATHLEN' was not declared in this scope
char SaveFolder[MAXPATHLEN]; // Path to save files
^~~~~~~~~~
c:/projects/wii/fceugx/source/fceugx.h:89:19: error: 'MAXPATHLEN' was not declared in this scope
char CheatFolder[MAXPATHLEN]; // Path to cheat files
^~~~~~~~~~
c:/projects/wii/fceugx/source/fceugx.h:90:25: error: 'MAXPATHLEN' was not declared in this scope
char ScreenshotsFolder[MAXPATHLEN]; //Path to screenshots files
^~~~~~~~~~
c:/projects/wii/fceugx/source/fceugx.h:92:21: error: 'MAXPATHLEN' was not declared in this scope
char Exit_Dol_File[MAXPATHLEN]; // Exit Path
^~~~~~~~~~
In file included from c:/projects/wii/fceugx/source/cheatmgr.cpp:18:0:
c:/projects/wii/fceugx/source/filebrowser.h:26:11: error: 'MAXPATHLEN' was not declared in this scope
char dir[MAXPATHLEN + 1]; // directory path of browserList
^~~~~~~~~~
c:/projects/wii/fceugx/source/filebrowser.h:58:20: error: 'MAXPATHLEN' was not declared in this scope
extern char szname[MAXPATHLEN];

--------------------- MERGED ---------------------------

Thanks for your help :) I just change it and I don't have the TVPal error anymore.

I am confused a lot about which version of devkitpro to install, I try different scenario and I got differents errors of compilation.

My first try, I installed devkitpro with the last libogc and the last devkitppc.
If I try to compile it, here is the error I have:

heatmgr.cpp
In file included from c:/projects/wii/fceugx/source/cheatmgr.cpp:15:0:
c:/projects/wii/fceugx/source/fceugx.h:86:18: error: 'MAXPATHLEN' was not declared in this scope
char LoadFolder[MAXPATHLEN]; // Path to game files
^~~~~~~~~~
c:/projects/wii/fceugx/source/fceugx.h:87:22: error: 'MAXPATHLEN' was not declared in this scope
char LastFileLoaded[MAXPATHLEN]; //Last file loaded filename
^~~~~~~~~~
c:/projects/wii/fceugx/source/fceugx.h:88:18: error: 'MAXPATHLEN' was not declared in this scope
char SaveFolder[MAXPATHLEN]; // Path to save files
^~~~~~~~~~
c:/projects/wii/fceugx/source/fceugx.h:89:19: error: 'MAXPATHLEN' was not declared in this scope
char CheatFolder[MAXPATHLEN]; // Path to cheat files
^~~~~~~~~~
c:/projects/wii/fceugx/source/fceugx.h:90:25: error: 'MAXPATHLEN' was not declared in this scope
char ScreenshotsFolder[MAXPATHLEN]; //Path to screenshots files
^~~~~~~~~~
c:/projects/wii/fceugx/source/fceugx.h:92:21: error: 'MAXPATHLEN' was not declared in this scope
char Exit_Dol_File[MAXPATHLEN]; // Exit Path
^~~~~~~~~~
In file included from c:/projects/wii/fceugx/source/cheatmgr.cpp:18:0:
c:/projects/wii/fceugx/source/filebrowser.h:26:11: error: 'MAXPATHLEN' was not declared in this scope
char dir[MAXPATHLEN + 1]; // directory path of browserList
^~~~~~~~~~
c:/projects/wii/fceugx/source/filebrowser.h:58:20: error: 'MAXPATHLEN' was not declared in this scope
extern char szname[MAXPATHLEN];

I also installed the necessary portlibs into devkitpro/portlibs/ppc/
and I got compiling error that he cannot find the libs lmxml and all the others, until I manualy copy them into devkitpro/libogc/includes/ (for the .h files) and copying all .a into devkitpro/libogc/lib/wii/

Why it doesn't work out of the box if I let them into portlibs folder ?
 

GreyWolf

Well-Known Member
Member
Joined
Mar 2, 2015
Messages
5,401
Trophies
0
Age
52
XP
1,488
Country
United States
You'll probably have to upgrade a bunch of stuff.

For that, add "#include <sys/param.h>" to the top of fceugx.h.

Also, in Makefile.Wii in the CFLAGS section add "-D_GNU_SOURCE" or you will get errors with some string functions.

--------------------- MERGED ---------------------------

The libmxml on SourceForge is compiled for the older version of devkitPro. I'll attach a zip with a recompiled library file and header.
 

Attachments

  • mxml-2.6.zip
    70.3 KB · Views: 118

Cecilmax

Well-Known Member
OP
Member
Joined
Mar 7, 2015
Messages
444
Trophies
0
Age
42
XP
1,115
Country
Canada
You'll probably have to upgrade a bunch of stuff.

For that, add "#include <sys/param.h>" to the top of fceugx.h.

Also, in Makefile.Wii in the CFLAGS section add "-D_GNU_SOURCE" or you will get errors with some string functions.

--------------------- MERGED ---------------------------

The libmxml on SourceForge is compiled for the older version of devkitPro. I'll attach a zip with a recompiled library file and header.

I just add the include, and the error of maxpathlen is fixed, thank you very much :)

I add the flag in makefile.wii and I also replace the mxml files with the one you attached.

Now I get this error when I compile:

> "make"
"make" -f Makefile.wii
make[1]: Entering directory `/c/projects/wii/fceugx'
fceugx.cpp
c:/projects/wii/fceugx/source/fceugx.cpp:333:1: error: invalid conversion from 'ssize_t (*)(_reent*, int, const char*, size_t) {aka int (*)(_reent*, int, const char*, unsigned int)}' to 'ssize_t (*)(_reent*, void*, const char*, size_t) {aka int (*)(_reent*, void*, const char*, unsigned int)}' [-fpermissive]
};
^
c:/projects/wii/fceugx/source/fceugx.cpp: In function 'int main(int, char**)':
c:/projects/wii/fceugx/source/fceugx.cpp:435:27: warning: argument to 'sizeof' in 'void* memset(void*, int, size_t)' call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
memset(FDSBIOS, 0, sizeof(FDSBIOS)); // clear FDS BIOS memory
^
c:/projects/wii/fceugx/source/fceugx.cpp:467:55: warning: format '%x' expects argument of type 'unsigned int*', but argument 3 has type 'u32* {aka long unsigned int*}' [-Wformat=]
sscanf(argv[4], "%08x", &GCSettings.Exit_Channel[0]);
^
c:/projects/wii/fceugx/source/fceugx.cpp:468:55: warning: format '%x' expects argument of type 'unsigned int*', but argument 3 has type 'u32* {aka long unsigned int*}' [-Wformat=]
sscanf(argv[5], "%08x", &GCSettings.Exit_Channel[1]);
^
make[2]: *** [fceugx.o] Error 1
make[1]: *** [build_wii] Error 2
make[1]: Leaving directory `/c/projects/wii/fceugx'
"make": *** [wii] Error 2

> Process Exit Code: 2
> Time Taken: 00:10
 

Cecilmax

Well-Known Member
OP
Member
Joined
Mar 7, 2015
Messages
444
Trophies
0
Age
42
XP
1,115
Country
Canada
I just try to replace devkitppc folder last version with r24 version, I don't have the errors above but now I got this error:

linking ... fceugx-wii.elf
c:/devkitPro/libogc/lib/wii\libmxml.a(mxml-file.o): In function `mxml_get_entity':
mxml-file.c:(.text+0x400): undefined reference to `__locale_ctype_ptr'
c:/devkitPro/libogc/lib/wii\libfat.a(directory.o): In function `_FAT_directory_entryGetAlias':
C:/Users/davem/projects/devkitpro/libnds-master/libfat/libogc/../source/directory.c:225: undefined reference to `__locale_ctype_ptr'
C:/Users/davem/projects/devkitpro/libnds-master/libfat/libogc/../source/directory.c:233: undefined reference to `__locale_ctype_ptr'
c:/devkitPro/libogc/lib/wii\libogc.a(ipc.o): In function `__ios_ioctlvformat_parse':
C:/Users/davem/projects/devkitpro/libogc/libogc/ipc.c:487: undefined reference to `__locale_ctype_ptr'
C:/Users/davem/projects/devkitpro/libogc/libogc/ipc.c:589: undefined reference to `__locale_ctype_ptr'
c:/devkitPro/libogc/lib/wii\libtinysmb.a(smb.o):C:/Users/davem/projects/devkitpro/libogc/libtinysmb/smb.c:1096: more undefined references to `__locale_ctype_ptr' follow
collect2: ld returned 1 exit status
make[2]: *** [/c/projects/wii/fceugx/executables/fceugx-wii.elf] Error 1
make[1]: *** [build_wii] Error 2
make[1]: Leaving directory `/c/projects/wii/fceugx'
"make": *** [wii] Error 2
 

Cecilmax

Well-Known Member
OP
Member
Joined
Mar 7, 2015
Messages
444
Trophies
0
Age
42
XP
1,115
Country
Canada
You'll probably have to upgrade a bunch of stuff.

For that, add "#include <sys/param.h>" to the top of fceugx.h.

Also, in Makefile.Wii in the CFLAGS section add "-D_GNU_SOURCE" or you will get errors with some string functions.

--------------------- MERGED ---------------------------

The libmxml on SourceForge is compiled for the older version of devkitPro. I'll attach a zip with a recompiled library file and header.

May I ask you a favor ? If you can build a successful env and send me back the devkitpro folder as a zip ? :) I can pay you for your time :) I try to make this work since 5 days lol
 

Cecilmax

Well-Known Member
OP
Member
Joined
Mar 7, 2015
Messages
444
Trophies
0
Age
42
XP
1,115
Country
Canada
Nobody can help ? It seem I am not using the right ppc libs libgoc libs and portlibs libs to compile. There is no documentation anywhere to get the right libs.
 

Cecilmax

Well-Known Member
OP
Member
Joined
Mar 7, 2015
Messages
444
Trophies
0
Age
42
XP
1,115
Country
Canada
Hello guys, I need help on this one. I have successfully compile the source. I try to modify the size of overscan black borders size. If I set the borderheight and borderwith to 8, it work just fine, if I set it to 4, it work too, but if I try to set it to 2, the render is very ugly. Any idea why ?

****************************************************************************
* RenderFrame
*
* Render a single frame
****************************************************************************/

void RenderFrame(unsigned char *XBuf)
{
// Ensure previous vb has complete
while ((LWP_ThreadIsSuspended (vbthread) == 0) || (copynow == GX_TRUE))
usleep (50);

// swap framebuffers
whichfb ^= 1;

// video has changed
if(UpdateVideo && geniestage != 1)
{
UpdateVideo = 0;
ResetVideo_Emu(); // reset video to emulator rendering settings
}

int width, height;

u8 borderheight = 0;
u8 borderwidth = 0;


// 0 = off, 1 = vertical, 2 = horizontal, 3 = both
if(GCSettings.hideoverscan == 1 || GCSettings.hideoverscan == 3)
borderheight = GCSettings.overscanVertical;
if(GCSettings.hideoverscan >= 2)
borderwidth = GCSettings.overscanHorizontal;

if (geniestage == 1)
{
UpdateVideo = 1;
borderwidth = 0;
borderheight = 0;
}

u16 *texture = (unsigned short *)texturemem + (borderheight << 8) + (borderwidth << 2);
u8 *src1 = XBuf + (borderheight << 8) + borderwidth;
u8 *src2 = XBuf + (borderheight << 8) + borderwidth + 256;
u8 *src3 = XBuf + (borderheight << 8) + borderwidth + 512;
u8 *src4 = XBuf + (borderheight << 8) + borderwidth + 768;

// fill the texture
for (height = 0; height < 240 - (borderheight << 1); height += 4)
{
for (width = 0; width < 256 - (borderwidth << 1); width += 4)
{
// Row one
//2 shift 1 = 4
//2 shift 3 = 16
//2 shift 8 = 512

//4 shift 8 1024
//4 shift 3 32
//4 shift 1 8
*texture++ = rgb565[*src1++];
*texture++ = rgb565[*src1++];
*texture++ = rgb565[*src1++];
*texture++ = rgb565[*src1++];

// Row two
*texture++ = rgb565[*src2++];
*texture++ = rgb565[*src2++];
*texture++ = rgb565[*src2++];
*texture++ = rgb565[*src2++];

// Row three
*texture++ = rgb565[*src3++];
*texture++ = rgb565[*src3++];
*texture++ = rgb565[*src3++];
*texture++ = rgb565[*src3++];

// Row four
*texture++ = rgb565[*src4++];
*texture++ = rgb565[*src4++];
*texture++ = rgb565[*src4++];
*texture++ = rgb565[*src4++];
}
src1 += 768 + (borderwidth << 1); // line 4*N
src2 += 768 + (borderwidth << 1); // line 4*(N+1)
src3 += 768 + (borderwidth << 1); // line 4*(N+2)
src4 += 768 + (borderwidth << 1); // line 4*(N+3)

texture += (borderwidth << 3);
}

// load texture into GX
DCFlushRange(texturemem, TEX_WIDTH * TEX_HEIGHT * 4);

// clear texture objects
GX_InvalidateTexAll();

// render textured quad
draw_square(view);
GX_DrawDone();

if(ScreenshotRequested)
{
if(GCSettings.render == 0) // we can't take a screenshot in Original mode
{
oldRenderMode = 0;
GCSettings.render = 2; // switch to unfiltered mode
UpdateVideo = 1; // request the switch
}
else
{
ScreenshotRequested = 0;
TakeScreenshot();
if(oldRenderMode != -1)
{
GCSettings.render = oldRenderMode;
oldRenderMode = -1;
}
ConfigRequested = 1;
}
}

// EFB is ready to be copied into XFB
VIDEO_SetNextFramebuffer(xfb[whichfb]);
VIDEO_Flush();

copynow = GX_TRUE;

// Return to caller, don't waste time waiting for vb
LWP_ResumeThread (vbthread);
}
 

Cecilmax

Well-Known Member
OP
Member
Joined
Mar 7, 2015
Messages
444
Trophies
0
Age
42
XP
1,115
Country
Canada
Does any one know how to reach Tantric ? maybe he is the only one who can help me with that part, since I am not familiar with the code, for him it could take couple of min to lead me to the right direction to change that function to have overscan of 2 instead of 8 :)
 

GreyWolf

Well-Known Member
Member
Joined
Mar 2, 2015
Messages
5,401
Trophies
0
Age
52
XP
1,488
Country
United States
Does any one know how to reach Tantric ? maybe he is the only one who can help me with that part, since I am not familiar with the code, for him it could take couple of min to lead me to the right direction to change that function to have overscan of 2 instead of 8 :)

You could try opening an issue on GitHub with what you want help with and see if he responds.

He also has an account here. http://gbatemp.net/members/tantric.66260/
 
Last edited by GreyWolf,

Cecilmax

Well-Known Member
OP
Member
Joined
Mar 7, 2015
Messages
444
Trophies
0
Age
42
XP
1,115
Country
Canada
It doesn't look like it but I think the forum software will send him an e-mail unless he disabled it.

I try to go with logic to adapt the code to support borderwidth and borderheight of 2, but I just dont get it lol do you have any idea when you look at the code ? :)
 
Last edited by Cecilmax,
General chit-chat
Help Users
    Veho @ Veho: Hey Tom.