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

Author Topic: Looking for a push in the right direction (North & South NES)  (Read 2221 times)

Goose

  • Newbie
  • *
  • Posts: 2
    • View Profile
Hi,

I just started getting into game hacking and have no experience with Assembler and basic knowledge of various other languages. One game I've always wanted to modify is "North & South" on the NES which I still play to this day. There are some elements to the game that are missing or could be improved in my opinion.

I've made some progress using the tools in FCEUX for very basic RAM modifications.

6000-60F0
6/12 = Artillery units
7/14 = Cavalry units
8/16 = Infantry units

Changing these worked like a charm where you can actually add more troops to a unit than the game allows.



0484 and 0485
Changes the amount of gold each player has which gives you additional troops for the first few turns.

Other values that I've found changes the COM/MAN selection, skill level, starting options, starting year and so forth. I'd like to make some ROM changes to make these options permanent.

What I would like to alter is the following:

he game has four different scenarios to play. 1961, 1962, 1963 and 1964. Each scenario has a preset number of units per player, location of these units and states that each side owns.

1. I would like to figure out how to change these scenarios. Especially adding more units and altering their starting location. I've tried to monitor the RAM changes that are different for each scenario with little luck. Ultimately I need to figure out where these conditions are stores in the ROM so that the change can be permanent. At the start of the game I guess that the value from address 0482 is read. Where do I go next? Debug the code for when 0482 is read and then trace from there?

What I've been unable to understand is the relation between the RAM and ROM for a value like 0482. The starting value for 0482 in ROM is "05" while in RAM it is "00". I'm guessing at the start of the game instructions are sent to change this value to "00". So let's say I want the starting value of "0482" in RAM to be "02", how do I go about changing this?



2. Like stated before, based on the scenario each player gets a certain number of units. I've found these to be stored in the 6000-address range where 6000-6070 holds the unit stats for player 1 and 6080-60F0 for player 2. I thought it would be easy to add/remove units here but I can't wrap my head around it. For instance, moving 6080-6083 to 6010-6013 and zero out 6080-6083 "should" change the player 2 unit to a player 1 unit but this is not the case.  The result is a bunch of issues where the active player spawns an unlimited amount of units and can move anywhere. How do I go about finding where else in the code the information for the units is held?



There are some rules the game follows that I would like to change as well.

Removing the check for capturing forts. This occurs when a player enters a state belonging to the other player and the state has a fort. This triggers a boring mini-game to capture the fort. Would it be possible to bypass this line of the code and jump directly to the piece of code that concludes the attack on the fort (basically capturing the state where the fort is located)?

Another issue that plagued the game was the stalemate that would occur on certain maps where the attacker was bound to lose and there was no incentive for either play to attack. What I would like to modify is the condition for when a battle ends. The current condition is simple, when one side has lost all units the battle is over. What I would like to add is a timer that ends the battle in a draw after X-seconds. Is this doable?

Lastly (my list of "want-to-do" is long).
 I wanted to see if anyone has implemented a menu-hack, similar to the old cheat menus from the C64/Amiga/Dos-days, that would let you change options from a interface with the controller. What I would like to do is to go from the intro, to the menu and then straight to the game without having to access the existing menu at all. Has this been done before?

Sorry for the long post but was hoping for some assistance or a nudge in the right direction from someone with more experience. I understand that learning 6502 Assembler would be ideal and probably required for some of the changes listed above. However I think it will be difficult to transfer what's learned by reading books into actual scenarios and was hoping for a couple of examples which has always been my preferred way of learning.

Thanks for your time!

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7102
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Looking for a push in the right direction (North & South NES)
« Reply #1 on: June 30, 2014, 01:15:09 pm »
What I've been unable to understand is the relation between the RAM and ROM for a value like 0482. The starting value for 0482 in ROM is "05" while in RAM it is "00". I'm guessing at the start of the game instructions are sent to change this value to "00". So let's say I want the starting value of "0482" in RAM to be "02", how do I go about changing this?
There isn't a relation between ROM (CPU 8000+) and RAM (0000-07FF for console RAM and 6000-7FFF cart RAM).
Code in the former changes the latter.
If you want to change RAM, you need to find the code that changes it.
It can be found by using the Breakpoint feature in the debugger in FCEUX to show code when certain address is accessed/modified but it may have limited usefulness if you don't know 6502 ASM.
Those "rules changes" would definitely need ASM knowledge (and probably a lot of time to disassemble and figure out significant amounts of game code).
"My watch says 30 chickens" Google, 2018

Jorpho

  • Hero Member
  • *****
  • Posts: 4789
  • The cat screams with the voice of a man.
    • View Profile
Re: Looking for a push in the right direction (North & South NES)
« Reply #2 on: July 01, 2014, 12:18:34 am »
Wasn't there also a DOS version of this game?  It might just be easier to make some hacks of that game rather than swinging away at the NES version.  (Or it might not.)
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Goose

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Looking for a push in the right direction (North & South NES)
« Reply #3 on: July 01, 2014, 12:47:00 am »
There isn't a relation between ROM (CPU 8000+) and RAM (0000-07FF for console RAM and 6000-7FFF cart RAM).
Code in the former changes the latter.
If you want to change RAM, you need to find the code that changes it.
It can be found by using the Breakpoint feature in the debugger in FCEUX to show code when certain address is accessed/modified but it may have limited usefulness if you don't know 6502 ASM.
Those "rules changes" would definitely need ASM knowledge (and probably a lot of time to disassemble and figure out significant amounts of game code).

Thanks.

I get that part since it would be impossible to change anything other than simple variables without proper understanding of the language. What I was hoping for were code examples that were similar to what I was asking for. I found some material that was interesting such as this introduction to 6502 ASM and practical usage. http://www.nintendoage.com/forum/messageview.cfm?catid=22&threadid=7155

Wasn't there also a DOS version of this game?  It might just be easier to make some hacks of that game rather than swinging away at the NES version.  (Or it might not.)

North & South was released for multiple systems, C64, Amiga, Atari, DOS and some others and they even did a remake for PC as well as an IOS version very recently.

The NES version is actually inferior to the others (less options, feature to retreat was removed, rain doesn't cause attrition etc.) but to me this is more of a hobby project to see what can be done.