News: 11 March 2016 - Forum Rules, Mobile Version
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia

Author Topic: Ghostbusters NES (Fuel change)  (Read 215 times)

tkabt06

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Ghostbusters NES (Fuel change)
« on: April 16, 2018, 01:02:09 am »
Hi. I want the fuel to last longer in the game. I downloaded another romhack (SMS edition for NES) and there it seems like the fuel is never ending. I want something in between. How can I do that?

Psyklax

  • Hero Member
  • *****
  • Posts: 603
    • View Profile
    • Psyklax Translations
Re: Ghostbusters NES (Fuel change)
« Reply #1 on: April 16, 2018, 01:56:37 am »
You'll need assembly. First you use FCEUX's RAM Search to pinpoint the location of your fuel in RAM, then use breakpoints to find the instruction that modifies it, and from there work to change it. The last part is the tricky part, and I'm too tired to get into it now. :)

nesrocks

  • Sr. Member
  • ****
  • Posts: 482
    • View Profile
Re: Ghostbusters NES (Fuel change)
« Reply #2 on: April 16, 2018, 10:48:05 am »
Are you aware that I'm making a hack for this game? I'm curious as to what your intentions are  ;D
The fuel is stored in RAM $3B and $3C.

Here's the code that handles fuel consumption:
Code: [Select]
spend fuel:
 00:A2B7:A5 3B     LDA $003B = #$01
 00:A2B9:4A        LSR
 00:A2BA:90 08     BCC $A2C4
 00:A2BC:A5 3C     LDA $003C = #$B8
 00:A2BE:F0 07     BEQ out of fuel
>00:A2C0:C6 3C     DEC $003C = #$B8
 00:A2C2:A9 80     LDA #$80
 00:A2C4:85 3B     STA $003B = #$01
 00:A2C6:60        RTS -----------------------------------------

So here's the new code for you:
Code: [Select]
spend fuel:
 00:A2B7:C6 3B     DEC $003B = #$63
 00:A2B9:F0 01     BEQ $A2BC
 00:A2BB:60        RTS -----------------------------------------
 00:A2BC:A5 3C     LDA $003C = #$B5
 00:A2BE:F0 07     BEQ out of fuel
 00:A2C0:C6 3C     DEC $003C = #$B5
 00:A2C2:A9 FF     LDA #$FF                 <--- adjust this #$FF to smaller values so the fuel is spent more rapidly. #$FF is the slowest possible consumption using this code.
 00:A2C4:85 3B     STA $003B = #$63
 00:A2C6:60        RTS ----------------------
« Last Edit: April 16, 2018, 11:20:13 am by nesrocks »

tkabt06

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Ghostbusters NES (Fuel change)
« Reply #3 on: April 17, 2018, 04:31:04 am »
Yes I am. It looked really nice.
Actually I am just making a translation to Swedish but when I was doing that I also decided to make some graphics and gameplay adjustements. So my hack will be in swedish :)

April 17, 2018, 05:28:56 am - (Auto Merged - Double Posts are not allowed before 7 days.)
And also- Thank you! I will see if I manage to change the fuel-code. I am not very good at this. I have just been doing translations before.

April 17, 2018, 11:20:18 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Nope - sorry I just don't get where to go and change something.
« Last Edit: April 17, 2018, 11:20:18 am by tkabt06 »

nesrocks

  • Sr. Member
  • ****
  • Posts: 482
    • View Profile
Re: Ghostbusters NES (Fuel change)
« Reply #4 on: April 17, 2018, 12:47:23 pm »
Copy this (ctrl+C):
C63BF00160A53CF007C63CA9FF

Then open fceux, open the rom, open the hex editor. Then hit Ctrl+G, type 22C7, hit enter.
Then ctrl+v.

That should do it.
Don't forget to save, of course. And always work with backups so you can revert errors.

Just so you know it worked, open the debugger, and at the "seek to" field, type A2B7 and click the "seek to" button. The code should change to match the one I posted, minus the comments I added like "out of fuel" etc.
« Last Edit: April 17, 2018, 01:09:17 pm by nesrocks »