How can i insert Emulator Mods/Patches into FCEUX?

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

kelvin donna
Posts: 55
Joined: Sat Feb 01, 2020 5:49 am

How can i insert Emulator Mods/Patches into FCEUX?

Post by kelvin donna » Mon Jan 18, 2021 6:20 am

i have found this interesting Patch for FCEUX:
https://github.com/Tippek/fceux-mod

it is a .patch file, but the readme gives no instructions on how to actually insert the mod.
could anyone help me out?

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

Re: How can i insert Emulator Mods/Patches into FCEUX?

Post by Dwedit » Mon Jan 18, 2021 8:40 am

What is "Patch"?

"Patch" is a standard Unix command-line tool, people running Linux usually have this program already. But it's not standard on Windows.
If you have ever installed Git, MinGW, MSYS, or Cygwin, you probably have this program somewhere, look for "patch.exe" in one of those. Otherwise, you can get a standalone version from GnuWin32 (look for "gnuwin32 patch" in a search engine).
In my case, I had a copy from installing Git, located at "C:\Program Files\git\usr\bin\patch.exe"
Patch can only be run from the command line, it has no graphical user interface.
Also, this patch is applied to *source code*, not to an executable. You would have to rebuild the Emulator using a compiler like Visual Studio. It's not like rom hacks with IPS patch files.

When you want to run Patch, you need to track down the exact version of the source code that the patch was created against. In this case, it says "FCEUX 2.2.3", and that seems to be available.

Then you would run "patch -i <file.patch>" when you're inside of the correct directory. If you get errors about missing files, you're in the wrong directory. In this case, I had to be in the "src" directory.
The command I used was:

Code: Select all

cd "C:\<SOME DIRECTORY>\fceux-2.2.3\src"
"C:\Program Files\git\usr\bin\patch.exe" -i ok.patch
Unfortunately

While I was able to successfully run the patch tool, the patches did NOT apply cleanly to the released version of FCEUX 2.2.3.
This means that the author of the patch wasn't basing their work off the released 2.2.3 version, but was using an in-progress development build instead. Some of the hunks did not apply cleanly, for example:

Code: Select all

patching file debug.cpp
Hunk #1 FAILED at 74.
Hunk #2 succeeded at 300 (offset -1 lines).
Hunk #3 FAILED at 332.
Hunk #4 succeeded at 806 with fuzz 2 (offset -50 lines).
2 out of 4 hunks FAILED -- saving rejects to file debug.cpp.rej
It would take a lot of work to figure out exactly which revision was used to create the patch.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

kelvin donna
Posts: 55
Joined: Sat Feb 01, 2020 5:49 am

Re: How can i insert Emulator Mods/Patches into FCEUX?

Post by kelvin donna » Mon Jan 18, 2021 9:05 am

Dwedit wrote:
Mon Jan 18, 2021 8:40 am
What is "Patch"?

"Patch" is a standard Unix command-line tool, people running Linux usually have this program already. But it's not standard on Windows.
If you have ever installed Git, MinGW, MSYS, or Cygwin, you probably have this program somewhere, look for "patch.exe" in one of those. Otherwise, you can get a standalone version from GnuWin32 (look for "gnuwin32 patch" in a search engine).
In my case, I had a copy from installing Git, located at "C:\Program Files\git\usr\bin\patch.exe"
Patch can only be run from the command line, it has no graphical user interface.
Also, this patch is applied to *source code*, not to an executable. You would have to rebuild the Emulator using a compiler like Visual Studio. It's not like rom hacks with IPS patch files.

When you want to run Patch, you need to track down the exact version of the source code that the patch was created against. In this case, it says "FCEUX 2.2.3", and that seems to be available.

Then you would run "patch -i <file.patch>" when you're inside of the correct directory. If you get errors about missing files, you're in the wrong directory. In this case, I had to be in the "src" directory.
The command I used was:

Code: Select all

cd "C:\<SOME DIRECTORY>\fceux-2.2.3\src"
"C:\Program Files\git\usr\bin\patch.exe" -i ok.patch
Unfortunately

While I was able to successfully run the patch tool, the patches did NOT apply cleanly to the released version of FCEUX 2.2.3.
This means that the author of the patch wasn't basing their work off the released 2.2.3 version, but was using an in-progress development build instead. Some of the hunks did not apply cleanly, for example:

Code: Select all

patching file debug.cpp
Hunk #1 FAILED at 74.
Hunk #2 succeeded at 300 (offset -1 lines).
Hunk #3 FAILED at 332.
Hunk #4 succeeded at 806 with fuzz 2 (offset -50 lines).
2 out of 4 hunks FAILED -- saving rejects to file debug.cpp.rej
It would take a lot of work to figure out exactly which revision was used to create the patch.
okay, that seems to do the trick: for programmers only.
aww, i wish there is someway to play my favourite games on miyoo cfw for the powkiddy q90.
or alternatively, we could reprogram that HVCA Emulator to make it compatible for VT03 or even VT369 since we have the source code bits of the needed mappers.
Attachments
mapper419.cpp
(4.81 KiB) Downloaded 39 times
mapper256.cpp
(4.37 KiB) Downloaded 39 times

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

Re: How can i insert Emulator Mods/Patches into FCEUX?

Post by Dwedit » Mon Jan 18, 2021 9:30 am

It's not just a mapper, it's an entirely different console that happens to be based on the NES, but has 4bpp graphics instead of 2bpp.

Sounds like you'd want this feature to be integrated into FCEUMM-libretro so Retroarch would be able to run this.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

kelvin donna
Posts: 55
Joined: Sat Feb 01, 2020 5:49 am

Re: How can i insert Emulator Mods/Patches into FCEUX?

Post by kelvin donna » Mon Jan 18, 2021 9:37 am

Dwedit wrote:
Mon Jan 18, 2021 9:30 am
It's not just a mapper, it's an entirely different console that happens to be based on the NES, but has 4bpp graphics instead of 2bpp.

Sounds like you'd want this feature to be integrated into FCEUMM-libretro so Retroarch would be able to run this.
i know, but it would be still a good idea for reprograming

Yes that is one wish for me, or alternatively, i'd like to have these VT03 games themselves to be downgraded to NES Mode and nothing else.
here are the VT03 games i configured to be VT02 conform:
https://mega.nz/file/Fpd0XTRC#ZH2gsXIQx ... 4peobpa-Uw

kelvin donna
Posts: 55
Joined: Sat Feb 01, 2020 5:49 am

Re: How can i insert Emulator Mods/Patches into FCEUX?

Post by kelvin donna » Tue Jan 19, 2021 5:46 am

Dwedit wrote:
Mon Jan 18, 2021 9:30 am
It's not just a mapper, it's an entirely different console that happens to be based on the NES, but has 4bpp graphics instead of 2bpp.

Sounds like you'd want this feature to be integrated into FCEUMM-libretro so Retroarch would be able to run this.
but actually, if you take the VT02 versions of the games modified by me, it would work, because i downgraded it to VT02 (it removed the PCM automatically.) and if the Mapper together with the submapper is already programmed into the emulator, then it's no big deal anymore

kelvin donna
Posts: 55
Joined: Sat Feb 01, 2020 5:49 am

Re: How can i insert Emulator Mods/Patches into FCEUX?

Post by kelvin donna » Sun Jan 24, 2021 5:28 am

Dwedit wrote:
Mon Jan 18, 2021 9:30 am
It's not just a mapper, it's an entirely different console that happens to be based on the NES, but has 4bpp graphics instead of 2bpp.

Sounds like you'd want this feature to be integrated into FCEUMM-libretro so Retroarch would be able to run this.
Keep your shirt on, i have vt02-ized the games.

that would be cool, having at least retroarch to run this.

User avatar
Cyneprepou4uk
Posts: 12
Joined: Fri Jun 21, 2019 12:20 am
Location: Belarus

Re: How can i insert Emulator Mods/Patches into FCEUX?

Post by Cyneprepou4uk » Tue Jan 26, 2021 3:09 am

This emulator version is modded by a Russian romhacker. It's purpose is to hack existing games to VT03 in order to use 4bpp graphics and/or some of the features listed at GitHub (the list is outdated btw). And then be played on a modded Mednafen emulator.

Check this out
http://www.romhacking.net/forum/index.php?topic=27945.0

http://www.emu-land.net/forum/index.php?topic=81513.0

https://youtu.be/ZRt9DXCbSMY

NewRisingSun
Posts: 1286
Joined: Thu May 19, 2005 11:30 am

Re: How can i insert Emulator Mods/Patches into FCEUX?

Post by NewRisingSun » Tue Jan 26, 2021 3:36 am

Cyneprepou4uk wrote:It's purpose is to hack existing games to VT03
Not actual VT03. It just uses VT03-ish features that are incompatible with an actual VT03. An actual VT03 does not provide you with a second background.

This hack is not a VT03 hack. It's just a graphical enhancement for a highly custom emulator. This sloppy use of terminology is really confusing people.

kelvin donna
Posts: 55
Joined: Sat Feb 01, 2020 5:49 am

Re: How can i insert Emulator Mods/Patches into FCEUX?

Post by kelvin donna » Tue Jan 26, 2021 6:58 am

NewRisingSun wrote:
Tue Jan 26, 2021 3:36 am
Cyneprepou4uk wrote:It's purpose is to hack existing games to VT03
Not actual VT03. It just uses VT03-ish features that are incompatible with an actual VT03. An actual VT03 does not provide you with a second background.

This hack is not a VT03 hack. It's just a graphical enhancement for a highly custom emulator. This sloppy use of terminology is really confusing people.
i'll take your point.
i ran access Block on that Emulator mod and the emulator crashes.
as well as my VT02 Mods, they still don't work.
that's because the already integrated 256 mapper has no "VT02" Support, neither Submappers especially Submapper 13.

kelvin donna
Posts: 55
Joined: Sat Feb 01, 2020 5:49 am

Re: How can i insert Emulator Mods/Patches into FCEUX?

Post by kelvin donna » Tue Jan 26, 2021 7:55 am

NewRisingSun wrote:
Tue Jan 26, 2021 3:36 am
Cyneprepou4uk wrote:It's purpose is to hack existing games to VT03
Not actual VT03. It just uses VT03-ish features that are incompatible with an actual VT03. An actual VT03 does not provide you with a second background.

This hack is not a VT03 hack. It's just a graphical enhancement for a highly custom emulator. This sloppy use of terminology is really confusing people.
and here is the reason, why i think, GBA Ports of VT03/VT369 games/Emulators would be good to have:
you could play those on Various OS and devices, such as the Android, Retropie, etc..., which isn't possible right now.

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

Re: How can i insert Emulator Mods/Patches into FCEUX?

Post by tepples » Tue Jan 26, 2021 12:52 pm

Ever considered joining the gbadev server on Discord so you can learn how to make such an emulator?

kelvin donna
Posts: 55
Joined: Sat Feb 01, 2020 5:49 am

Re: How can i insert Emulator Mods/Patches into FCEUX?

Post by kelvin donna » Wed Jan 27, 2021 6:49 am

tepples wrote:
Tue Jan 26, 2021 12:52 pm
Ever considered joining the gbadev server on Discord so you can learn how to make such an emulator?
no thank you!
Learning to program an supreme emulator from scratch as a newbie would take many years.
alternatively, i could ask for some tips on how to modify Mapper 256.13 VT02 games to work as nes/Famicom via Hex Editor:
(talking about that: https://mega.nz/file/Fpd0XTRC#ZH2gsXIQx ... 4peobpa-Uw)
(Problem is: they don't work on regular NES 256, whereas it works on VT02, due to Subbmappers)

kuja killer
Posts: 112
Joined: Mon May 25, 2009 2:20 pm

Re: How can i insert Emulator Mods/Patches into FCEUX?

Post by kuja killer » Sat Jan 30, 2021 10:03 pm

I just had to comment about this topics title. Cant resist. I always wished it was possible to have online leaderboards in the emus. I actually programmed a fully functional leaderboard into my megaman 3 hack - megaman odyssey years ago, which uses a LUA script i wrote that connects to a website and upload your Time Attack times from the 6000-7FFF saveRAM area to the website or whatever (and reading back data from other players scores. Just like any regular modern game console would showing leaderboards. -- for FCEUX

I had a php script on the other side for the webserver. I did it for testing years ago cause I wanted to see if it was possible, and it really did work 100% --

kinda sucks that the player would have to open up a LUA script in their emulator though to just use it. :( It was just a temporarily site i used called "byte host".
I can imagine it's probably a big problem that the lua script reveals the website used, and all the saveRAM areas used, making it easy for a person to just edit their .SAV files in the hex editor to rig it. :(

But yea i wish something like leaderboards "natively" existed for fceux, nintendulator, nestopia, and/or maybe bizhawk since that one seems to be getting more popular these days.

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

Re: How can i insert Emulator Mods/Patches into FCEUX?

Post by rainwarrior » Sat Jan 30, 2021 11:29 pm

kuja killer wrote:
Sat Jan 30, 2021 10:03 pm
But yea i wish something like leaderboards "natively" existed for fceux, nintendulator, nestopia, and/or maybe bizhawk since that one seems to be getting more popular these days.
Retroarch has an achievement and leaderboard system, which works for a whole bunch of different cores at this point:

https://www.retroarch.com/?page=achievements

https://retroachievements.org/

I doubt you'd get any/all the other stand-alone emulators you mentioned to start using this, but I suppose there's nothing preventing them in theory. If you want it now, though, it's already happening in the land of Retroarch.

Post Reply