+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Trying to Unbreak an NES Game
Pages: 1 [2]
Author Topic: Trying to Unbreak an NES Game  (Read 2 times)
Kagemusha
Guest
« Reply #15 on: August 30, 2007, 05:52:58 pm »

Alright, thanks to the big guy, I found out the problem. It turns out that that block of code has more than one entry point and that block of code is essential for the would-be DTE code. Is there a way around this, or should I toss this game aside and try another?
Nightcrawler
Guest
« Reply #16 on: August 31, 2007, 07:29:48 am »

In cases like this where a particular section of code you needed to work with can be gotten to via multiple pieces of code, I sometimes use flags to tell my code what is going on.

For example, you have two entry points to your code right now. You could add another small hack that would set a flag when it's coming from entry point A. Then your code would check that flag and take action if it's coming from entry point A or it would do something else if it's coming from entry point B. Depending on what you intend, you could make the code execute as it originally did in the game for all but code coming from entry point A.

Another option is to take a look at both entry points. Get an overview of what's happening. Why is the routine shared between both entry points? It may then be possible to make a smarter hack that would work as intended without flags in both situations.

Yet a third option would be to do a second hack for one of the entry points so it no longer goes to your new routine. You could hack it so there is now only one entry point and handle the other previous entry point with some new code.

There's usually always a way around these things. You just have to think about your options and decide what's easiest or best for the job.
Neil
Guest
« Reply #17 on: January 01, 2009, 09:51:05 pm »

-necrobump to save a thread from the great board prune of 2009-
Pages: 1 [2]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC