Game patch for Ghosts'n Goblins

This forum is for posting M.A.M.E. arcade cheats. Requests will be fulfilled here....but please keep the requests to the requests forum.
Post Reply
Bugfinder
Posts: 168
Joined: Tue Sep 25, 2001 1:00 am
Location: Rio de Janeiro, Brasil

Game patch for Ghosts'n Goblins

Post by Bugfinder »

Ever wondered... what if you could call the magic bird again, after it had cursed you by turning you into a leaping frog? With this ROM cheat you can call it back infinite times from the same grave :-)

Code: Select all

:gng:20B00000:F6F2:6A2A261F:FFFFFFFF:Renew magic bird
:gng:20B10000:F6F6:860FA72A:FFFFFFFF:Renew magic bird
Bugfinder
------------------------------------------
If there's a bug, I'm gonna find it!
stephh
Posts: 601
Joined: Fri Aug 17, 2001 1:00 am
Location: Paris, France

Re: Game patch for Ghosts'n Goblins

Post by stephh »

Bugfinder wrote: Ever wondered... what if you could call the magic bird again, after it had cursed you by turning you into a leaping frog? With this ROM cheat you can call it back infinite times from the same grave :-)

Code: Select all

:gng:20B00000:F6F2:6A2A261F:FFFFFFFF:Renew magic bird
:gng:20B10000:F6F6:860FA72A:FFFFFFFF:Renew magic bird
Do you have a DASM explanation (as you posted for 'citycon' on MAME Testers board) ?

Speaking about this game, the "trick" which allows you infinite time gives in fact "only" 65535 seconds (= 18 hours 12 minutes and 15 seconds) ...

Steph from The Ultimate Patchers

Visit Image The Ultimate Patchers' site Image
Bugfinder
Posts: 168
Joined: Tue Sep 25, 2001 1:00 am
Location: Rio de Janeiro, Brasil

Re: Game patch for Ghosts'n Goblins

Post by Bugfinder »

Do you have a DASM explanation (as you posted for 'citycon' on MAME Testers board) ?
Here it is...

Code: Select all

Original code:

F6F2: A6 2A       LDA   $000A,Y - load into A the number of hits on that grave
F6F4: 27 1F       BEQ   $F715   - if already is equal to 0, continue to $F715
F6F6: 6A 2A       DEC   $000A,Y - otherwise decrement by 1
F6F8: 26 1B       BNE   $F715   - continue to $F715
[rest of routine that turns you into frog]

Patched code:
F6F2: 6A 2A       DEC   $000A,Y - immediately decrement the number of hits on that grave
F6F4: 26 1F       BNE   $F715   - if not equal to 0, continue to $F715
F6F6: 86 0F       LDA   #$0F    - but if it is, load $0F (15 shots)
F6F8: A7 2A       STA   $000A,Y - store it back
[rest of routine that turns you into frog]
Each time you hit a grave, its number is decreased, from $0F to $00. When it reaches $00, the bird appears. Observe that in the original code, register A is used to check if there is already $00 in the grave address (manipulated as an index), in this case the shot is ignored (bird already appeared for that grave). If it's not $00, it'll be decremented by $01 and if it's still not $00, continue to normal game. But if it's $00 after decremented, the bird appears.

The difference on my patch is, it immediately decrements the address. If the original content of the address is different from $01, the result will not be $00 and will continue the game. But if the address is $01 (last shot), after decremented it will be $00 and won't branch to $F715; instead it will reload the address with $0F and then follow to call the bird. Nice, isn't it?
Speaking about this game, the "trick" which allows you infinite time gives in fact "only" 65535 seconds (= 18 hours 12 minutes and 15 seconds) ...
I came here again just to post my fix to this! I observed that when you are cursed into a frog, addresses $0760-$0761 receives $0400. I changed first at $F57D where it should execute "LDD #$0400", I made a jump to $F510 that (apparently) has random data.

Ghosts'n Goblins: Patch to fix game timer bug

Code: Select all

F510: DC AA       LDD   $AA       - load in AB the current timer
F512: 27 06       BEQ   $F51A     - if equal to zero, jump down
F514: CC 04 00    LDD   #$0400    - continue the prior routine and
F517: 7E F5 80    JMP   $F580     - go back to where it came
F51A: 0C AB       INC   $AB       - add one second
F51C: 20 F6       BRA   $F514     - that's it

:gng:20A00000:F57D:007EF510:00FFFFFF:Patch to fix game timer bug
:gng:20B10000:F510:DCAA2706:FFFFFFFF:Patch to fix game timer bug
:gng:20A10000:F514:00CC0400:00FFFFFF:Patch to fix game timer bug
:gng:20A10000:F517:007EF580:00FFFFFF:Patch to fix game timer bug
:gng:20B10000:F51A:0CAB20F6:FFFFFFFF:Patch to fix game timer bug
If I only knew how to update the calculation the game does to check memory! My wish is that this patched ROM (gg5.bin) could be used in a true arcade board and put back to work again, just like City Connection. I'm sure many arcade operators stopped using these boards because of these nasty bugs. They made profit go downhill badly!

Well, I tried many times and it really seems to work! Can you make further checking?
Bugfinder
------------------------------------------
If there's a bug, I'm gonna find it!
Post Reply