How to compile fceux?

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
nesrocks
Posts: 430
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

How to compile fceux?

Post by nesrocks » Wed Jan 30, 2019 5:24 am

I have downloaded fceux 2.2.3 src from here, but I can't figure out what's needed to compile it (consider I'm a total newbie).
It seems to have visual studio 2010 v100 compatible project files, but I don't have vs 2010 and microsoft says it is not for me. I have vs 2017 but refactoring the solution expectedly generate hundreds of errors. Is there a simpler way than using visual studio?

What I want to do: change a few things on the debugger window, for personal use. Exactly how I want to change it:
Image
Last edited by nesrocks on Fri Mar 08, 2019 8:46 am, edited 2 times in total.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: How to compile fceux?

Post by Zepper » Wed Jan 30, 2019 7:25 am

Code: Select all

To compile and install FCEUX for SDL, follow the instructions in the README-SDL.md file.

Users of Microsoft Visual Studio can use the solution files within the vc directory.
These solution files will compile FCEUX and some included libraries for full functionality.

CMake has been depreciated in favor of scons.  However, if you wish to use it you can find the old cmake build files in the ~attic.
From the file README-SDL:

Code: Select all

1 - Requirements
----------------
* libsdl1.2 - It is strongly recommended that you upgrade to the latest
	version of sdl (1.2.15 at the time of writing).
* scons - Required to build fceux.
* libgtk2.0 (optional) - version >= 2.24 recommended
* libgtk3.0 (optional) - this compiles as of fceux 2.2.0
* liblua5.1 (optional)
* libgd (optional) - required for LOGO and CREATE_AVI options (https://bitbucket.org/libgd/gd-libgd/downloads)
* minizip (optional) - you may chose to use the version of minizip on your system by enabling SYSTEM_MINIZIP in the SConstruct
* c++ compiler -- you may use g++ from gcc or clang++ from llvm.

tepples
Posts: 21720
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: How to compile fceux?

Post by tepples » Wed Jan 30, 2019 7:43 am

This is to compile the SDL version, which has no debugger whatsoever (unless you count debugging the emulator itself in GDB as an indirect means of debugging the ROM).

User avatar
nesrocks
Posts: 430
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: How to compile fceux?

Post by nesrocks » Wed Jan 30, 2019 7:52 am

tepples wrote:This is to compile the SDL version, which has no debugger whatsoever (unless you count debugging the emulator itself in GDB as an indirect means of debugging the ROM).
That's no good then, my goal is rom hacking and rom mapping. What's my alternative for adjusting fceux's debugger UI?
edit: I've found and am installing a Microsoft Visual Studio Ultimate 2010, not sure if that will do.
edit2: Success!! With that it compiled perfectly! Now to do the changes. To anyone wondering, I got it from here https://download.cnet.com/Microsoft-Vis ... 50998.html
edit3: okay that was quick ^^ https://twitter.com/bitinkstudios/statu ... 5763596288
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!

User avatar
rainwarrior
Posts: 7642
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: [Solved] How to compile fceux?

Post by rainwarrior » Thu Jan 31, 2019 1:58 pm

The current github version compiles "right out of the box" for me with VS2017 community, just open the .sln and build.
https://github.com/TASVideos/fceux

I used to use VS2010 express just fine with it in the past, similarly without having to install anything extra, though I was normally getting code from its (now defunct) Sourceforge SVN.

Never tried the source files hosted on the website itself though.

User avatar
nesrocks
Posts: 430
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: [Solved] How to compile fceux?

Post by nesrocks » Thu Jan 31, 2019 2:05 pm

That's interesting. I openend the solution but to compile it is asking me to install Windows SDK 8.1. I'm installing that now.
Anyway, I got a lot done already, the UI now is waaaaay more suited for my romhacking needs, not to mention that I automated a few things. What I need the most right now is some way to rearrange the bookmarks. I'm still very lost in the C++ language to get that done.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!

User avatar
rainwarrior
Posts: 7642
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: [Solved] How to compile fceux?

Post by rainwarrior » Thu Jan 31, 2019 2:11 pm

Oh yeah 2017 community has a lot of install options, maybe I normally pick the set that comes with that SDK already. Thankfully it does a good job of letting you know about those and downloading the needed things, at least within the realm of microsoft-provided libraries anyway.
nesrocks wrote:I'm still very lost in the C++ language to get that done.
FCEUX took me a while to find my way around. It's very old, lots of crust, lots of weird stuff stuck together from various old forks, etc.

User avatar
nesrocks
Posts: 430
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: [Solved] How to compile fceux?

Post by nesrocks » Tue Feb 19, 2019 7:51 pm

So, is there any policy or etiquete on sharing this compiled version? I think it's well more suited for rom hacking and rom mapping and it has increased my productivity by a fair margin. If it's frowned upon to share it then I'll make sure to keep it for myself.

Changes:
- optimized for 1080p displays (everything is more "crammed" and less pleasantly arranged)
- when opening a rom it will automatically open the debugger, the mem viewer, the cheat tool and the code/data logger
- the debugger has received the biggest changes, with much larger bookmarks and slightly larger breakpoints sections
- when adding a bookmark on the debugger, it will automatically add to the bm's name "Bk:#" representing the bank number that bm belongs to. SUPER useful for rom mapping and hacking
- removed the options to break when cpu cycles or instructions were exceeded due to low usage and to maximize free space for the bookmarks
- memory viewer now defaults to gray text to help differentiate highlighted text (data was particularly hard to read, it looked black)
- cheat search also got bigger sections for the cheat list
- added a pad bits reference to the debugger. it's useful for me, I guess
- code data logger also looks a lot more crammed. I removed the "address label logger" options for space

Someone may look down on the few removed features, but it was all done so it could fit on my screen, all at once neatly.

If it was ok to make it public, should something more be changed? Maybe the version number, or something in the about section? Thanks.

Image
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!

User avatar
rainwarrior
Posts: 7642
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: [Solved] How to compile fceux?

Post by rainwarrior » Tue Feb 19, 2019 7:56 pm

It's GPL. Sharing is explicitly allowed, just you gotta share the source you changed too.

But yes, it's good form to clearly mark the build. Put a different filename on it. Update the about text. Put a modified name in the title bar, etc. Try to make it apparent what it is and what it isn't.

For source sharing, the best thing to do is to make a fork on GitHub and upload your changes there. It will make it very easy for others to see what you changed vs. the original, and also make it easier for someone else to apply your changes to a future version of FCEUX if they want to continue it.

User avatar
Dwedit
Posts: 4235
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: [Solved] How to compile fceux?

Post by Dwedit » Fri Feb 22, 2019 6:40 pm

Try using UPX -d to decompress the EXE, then use Resource Hacker to edit the dialogs to your hearts content.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

User avatar
nesrocks
Posts: 430
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: [Solved] How to compile fceux?

Post by nesrocks » Wed Feb 27, 2019 9:38 am

Thanks, Dwedit! I already adjusted the UI using the source code, and I added the automatic bank numbering to bookmarks and changed the default text color for the mem viewr, but this seems very useful to know! Especially if it often works with most or all windows forms programs.
edit: yeah I tried and most programs don't allow me to edit the dialogs. One in particular that I wanted to edit was yy-chr.

@rainwarrior: I'll have to compare files to know what I changed exactly and what was actually necessary to change and revert what was just testing. For now, since nobody is asking me for it, I guess I'll wait. Maybe I'll post about it on RHDN and see what they think.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!

User avatar
Banshaku
Posts: 2325
Joined: Tue Jun 24, 2008 8:38 pm
Location: Fukuoka, Japan
Contact:

Re: [Solved] How to compile fceux?

Post by Banshaku » Wed Feb 27, 2019 8:20 pm

One version of yy-chr (recent one) was remade in .net so I don't know if it does make in difference in how the resources are stored compared to a standard win32 program. I never really tried to check how .net store them so it could be a possibility.

User avatar
nesrocks
Posts: 430
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: [Solved] How to compile fceux?

Post by nesrocks » Wed Feb 27, 2019 8:35 pm

I did check that, but unfortunatelly it was exactly the same.
For the source code, I even tried contacting the author through e-mail (it returned, e-mail was deactivated) and through his site's comment section (there was an error, couldn't post a comment). So no such luck...
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!

User avatar
nesrocks
Posts: 430
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: [Solved] How to compile fceux?

Post by nesrocks » Thu Mar 07, 2019 5:32 pm

I have added an option on the memview (hex editor) to dump more than just the PPU memory. Right now I'm dumping the ppu mem (size $4000) + oam mem ($100) + ppu control (1) + ppu mask (1) registers. I want now to add two bytes to that: fine scroll x and fine scroll y. Is that information accessible in some ram memory or register? Can it be read? If not, I'm having a lot of trouble retrieving it from fceux's source. Any ideas?
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!

User avatar
rainwarrior
Posts: 7642
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: [Solved] How to compile fceux?

Post by rainwarrior » Thu Mar 07, 2019 6:47 pm

nesrocks wrote:I have added an option on the memview (hex editor) to dump more than just the PPU memory. Right now I'm dumping the ppu mem (size $4000) + oam mem ($100) + ppu control (1) + ppu mask (1) registers. I want now to add two bytes to that: fine scroll x and fine scroll y. Is that information accessible in some ram memory or register? Can it be read? If not, I'm having a lot of trouble retrieving it from fceux's source. Any ideas?
In ppu.cpp look for the writes to $2005 and you can find where they go.

You might need to be careful about when during the frame you're attempting to dump these registers, though.

Post Reply