News: 11 March 2016 - Forum Rules

Author Topic: How compile .ips source?  (Read 2944 times)

darthvaderx

  • Full Member
  • ***
  • Posts: 243
    • View Profile
How compile .ips source?
« on: February 11, 2019, 10:44:09 pm »
I recently found on the internet the source for a patch to add SRAM save on NES Willow and that came with these instructions:

'### Compiling

* Extract and copy the files and folders where you want to, e.g. C:\WillowPatch
* Place your Willow ROM as WILLOW.NES in the folder
* Add the bin folder to the environment PATH variable
* Run compile.bat from the command line.

This will compile the assembly files in the src folder and generate the following files:

* WILLOW.bin
* WILLOW.LST
* WILLOW.SYM

The WILLOW.bin file will be copied to the build folder AS WILLOW.IPS along with the ROM, and IPS
will patch the ROM using WILLOW.IPS

## Notes

The assembly entry point is Willow.asm. IPS_NES.INC sets up the macros necessary to generate a patch file.

The generated WILLOW.BIN is actually an IPS file that can be applied using your favorite patching application
to a clean iNES-headered Willow ROM'


I tried to follow these instructions but something always goes wrong, In Windows 10 I used vDOS but it did not work and in Windows 7 the following message appears'.ips file not found' appears, what could I be doing wrong?

See my hacks channel including some of my works:

https://www.youtube.com/user/MyWashington2/videos

Jorpho

  • Hero Member
  • *****
  • Posts: 5002
  • The cat screams with the voice of a man.
    • View Profile
Re: How compile .ips source?
« Reply #1 on: February 12, 2019, 12:57:07 am »
Well, this is not a standard operation and it is going to depend on the specific details of the patch.  So, it's over here, if anyone else is wondering:
https://github.com/RupertAvery/WillowPatch

So, the problem is that if you just try to download the source from there, Github by default makes everything in the download use LF instead of CR-LF, and X816.exe doesn't like that at all! Unfortunately I am completely unfamiliar with Github and I don't know how you're supposed to get around that.

I don't think I should spread this around and I don't even know if this was generated properly, but here's the IPS I got:
https://file.town/download/46k8fe1fuy3fwqbam7utckyf9

Spoiled are my unnecessary ramblings.
Spoiler:
I can't get it to work either.  I can tell you that unless you're running the 32-bit version of Windows 7 (or unless you have "XP Mode"), it's not going to work there either – Windows 7 x64 is just as lacking in MS-DOS mode as Windows 10.

Anyway, in DOSBox, for some reason X816 refuses to recognize the closing quote in
Code: [Select]
.INCSRC "IPS_NES.INC"
I tried manually cutting-and-patching the contents of the .inc file (and the other .asm files) into willow.asm, but the resulting WILLOW.BIN was zero bytes!

Before I go mashing this into a virtual machine, perhaps someone else would like to chime in?

ETA: Okay, if you replace all the LF in willow.asm with CR-LF, X816 kind of works properly, but it hangs on "pass 1".

ETA2: If you replace only the first LF with CR-LF, the build completes, but WILLOW.BIN is zero bytes again.

ETA3: If you replace all of the LF with CR-LF in each of the files, the thing finally behaves and spits out an 854-byte file.
Spoiler:
« Last Edit: February 12, 2019, 02:12:40 am by Jorpho »
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

darthvaderx

  • Full Member
  • ***
  • Posts: 243
    • View Profile
Re: How compile .ips source?
« Reply #2 on: February 12, 2019, 10:25:36 am »
Thank you for your attention and work.
Unfortunately the game resets every time you press start. :(
See my hacks channel including some of my works:

https://www.youtube.com/user/MyWashington2/videos

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7209
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: How compile .ips source?
« Reply #3 on: February 12, 2019, 04:36:43 pm »
It's beyond the needs of this question, but I'm amazed someone would write a program to generate an IPS rather than just providing an IPS.
Or since IPS is such a simple format, patch the ROM directly. (which is what I did for the one patch I released with a custom patcher)
"My watch says 30 chickens" Google, 2018

Jorpho

  • Hero Member
  • *****
  • Posts: 5002
  • The cat screams with the voice of a man.
    • View Profile
Re: How compile .ips source?
« Reply #4 on: February 12, 2019, 10:27:53 pm »
Thank you for your attention and work.
Unfortunately the game resets every time you press start. :(
All right, I might have messed up.  That's what I get for trying to mash my head against this so late at night.

I was a little more thorough this time (I did a proper conversion using unix2dos.exe instead of trying to do it manually) and got a different result.  This should work:
https://file.town/download/y8fx0xtymlddxxum7pvc8m0xj
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

darthvaderx

  • Full Member
  • ***
  • Posts: 243
    • View Profile
Re: How compile .ips source?
« Reply #5 on: February 13, 2019, 12:11:37 am »
Thank you very much and I'm sorry for the headache I caused you. :laugh:
But the hack now simply WORKS PERFECTLY ...
But contrary to what is said on the original website you must hit the Select + A and then B to save, then it is assumed that this version is prior to the final.

Original website (dead download link): http://endersoft.blogspot.com/search/label/NES

Post from the hack author on the RHDN, where he answers my question but does not give me the .ips file:

http://www.romhacking.net/forum/index.php?topic=5832.msg349493#msg349493

Thanks again... :beer:

(I will not submit it to the RHDN because it depends on the author's will as this is not its final version.)
« Last Edit: February 13, 2019, 12:53:49 am by darthvaderx »
See my hacks channel including some of my works:

https://www.youtube.com/user/MyWashington2/videos

CountBuggula

  • Jr. Member
  • **
  • Posts: 19
    • View Profile
    • Fate of the Galaxy
Re: How compile .ips source?
« Reply #6 on: October 07, 2019, 05:11:43 pm »
All right, I might have messed up.  That's what I get for trying to mash my head against this so late at night.

I was a little more thorough this time (I did a proper conversion using unix2dos.exe instead of trying to do it manually) and got a different result.  This should work:
https://file.town/download/y8fx0xtymlddxxum7pvc8m0xj

The download link you posted is no longer active.  Since this isn't getting a proper release (at least not for now) could you please re-post it or send me a link in DM?  Thanks!

Jorpho

  • Hero Member
  • *****
  • Posts: 5002
  • The cat screams with the voice of a man.
    • View Profile
Re: How compile .ips source?
« Reply #7 on: October 08, 2019, 11:07:16 pm »
Really, what I did was simple enough to duplicate.  You'll need to persuade DOSBox to run the compiler, and you'll need to convert the source files with unix2dos.exe (or some similar program – lots of text editors can do it).

But it looks like I still have the IPS around.
https://file.town/download/g9545vi37xiatyorkxe9notwy (stats code z2kidwodsj9er2bfbby0qgadk )
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

CoolieCoolster

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
Re: How compile .ips source?
« Reply #8 on: September 26, 2021, 11:13:19 am »
As the latest download link doesn't work either, and I'm compiling all SRAM hacks I can find into one list, I thought I would link to a compiled version of the IPS file hosted on my wiki that shouldn't go missing any time soon: https://wiki.funkey-project.com/wiki/File:Willow.ips.