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

Author Topic: toggling ASM hacks in-game rather than saving completely new ROMs  (Read 1533 times)

starfishmaster

  • Jr. Member
  • **
  • Posts: 28
    • View Profile
I have a few different hacks for NFL Blitz 2000 (N64) that change the gamplay. Each of them are fairly simple, usually just changing constants or a few hex lines here or there. Can these changes be added to the game rather than compiling completely new ROMs with each specific change? For instance, I have 2 hacks, low gravity and fast tackling, that would be cool to turn on and off during the game (plus would be easier to just toggle them rather than booting up a whole new ROM). I know gameshark codes can modify the code, but as far as I'm aware, they can only modify the last 4 values of an address (out of 8 total). This can work in some cases, but others cannot. If I'm wrong (and the GS actually  can modify a whole address), that would be perfect. Does anyone know if this is the case? Otherwise, does anyone know a different way to modify the ASM in game so I can toggle certain functions?

FAST6191

  • Hero Member
  • *****
  • Posts: 2561
    • View Profile
Re: toggling ASM hacks in-game rather than saving completely new ROMs
« Reply #1 on: March 12, 2016, 12:02:20 pm »
It can vary with the system you are editing. If the game stores the binary or values you are editing in runtime memory at some point then you can edit those with a conventional cheat. For instance the DS binary is copied to in game memory to run so you can edit it with a conventional cheat, and as the DS also features IF style patching then you should be able to edit the overlays as well but enough of that. If it is more like the GBA (or most older consoles) then it will be read directly from the ROM and you will need a device with ROM patching codes, such a feat traditionally being taken care of by the game genies. Looking at things the N64 does this but it can also change depending upon what the game is doing, aka dynamic allocation, which makes sense given the N64 was usually programmed in C (hence the whole dynamic recompilation thing that emulators use).

On the matter of cheats then for most systems with then there is a nice wiki called enhacklopedia, it gets mirrored around a lot and sometimes hosts of it go down or change (lots of drama in cheat making world) but a search for enhacklopedia will hopefully get you a mirror. Anyway http://doc.kodewerx.org/hacking_n64.html#gs_code_types works at time of posting and covers the various cheats.

If you are still on cheats then ones that get toggled would usually be dubbed button activator cheats, though some do it with conditional cheats by reading the control states.
Several hackers have been seen to make their own little activator engine and add it to games to allow them to enable or disable things with a button combo. You can go a lot more complex and tell a game to read a value out of memory rather than from the ROM if you want and then figure out a way to set that with a key press in game. You will tend not to see much discussion on things like this as it is assumed that if you know what you are doing that this is obvious and that is probably a good assumption.

zonk47

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: toggling ASM hacks in-game rather than saving completely new ROMs
« Reply #2 on: March 12, 2016, 02:56:39 pm »
I think what he's asking is if there are emulators which will skip over ASM instructions automatically. I think there may be a few but not many. In any case, you can do this easily enough by using GG/cheat system to write all the addresses between the start address of the instruction you want to kill and the start address of the next instruction you want to keep to the NOP code (you'll have to look at an opcode table for this; to find one, google "[CPU name here] opcodes").

Of course, you could always institute a button mask check in the game itself to turn those values on/off/clear/whatever in RAM depending on say, a certain combination of buttons pressed. Would not be an easy hack, though.
« Last Edit: March 12, 2016, 03:11:27 pm by zonk47 »
A good slave does not realize he is one; the best slave will not accept that he has become one.

starfishmaster

  • Jr. Member
  • **
  • Posts: 28
    • View Profile
Re: toggling ASM hacks in-game rather than saving completely new ROMs
« Reply #3 on: March 13, 2016, 08:35:22 am »
So what you said is somewhat what I want to do. Using gameshark would be ideal, but like I said I'm pretty sure it can only modify the last 4 digits out of 8 total. I know all the different opcodes (which the first 4 digits will set along with registers usually), I just can't edit them using GS. I was wondering if there was another way to do it (your second button check thing is probably it, but would be too difficult for me to worry about).

justin3009

  • Hero Member
  • *****
  • Posts: 1611
  • Welp
    • View Profile
Re: toggling ASM hacks in-game rather than saving completely new ROMs
« Reply #4 on: March 13, 2016, 09:59:52 am »
The other option I can think of minus button pressing, though probably more convoluted, is find areas of RAM that go completely unused and have them be the toggles for the codes.

So if there was a specific area that needed new data and only toggleable with a certain value set in RAM, it'd check that area and if it's active, change it.  It'd be a simple one-byte RAM change but there'd have to be more checks in ROM and what else.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

zonk47

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: toggling ASM hacks in-game rather than saving completely new ROMs
« Reply #5 on: March 14, 2016, 05:26:10 am »
You're gonna have to decide if it's worth it to you to make the effort. I estimate that if you tried, it'd take you between 3 and 4 weeks because you have no previous experience.

One thing you will have to do before anything else though, is map that input loop.
A good slave does not realize he is one; the best slave will not accept that he has become one.

starfishmaster

  • Jr. Member
  • **
  • Posts: 28
    • View Profile
Re: toggling ASM hacks in-game rather than saving completely new ROMs
« Reply #6 on: March 14, 2016, 10:56:01 am »
Yea I have never tried messing with button activators. I may try playing around with it a bit to see what I can come up with. Having this would be the ideal situation, but it maybe near impossible for my level of skill.

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: toggling ASM hacks in-game rather than saving completely new ROMs
« Reply #7 on: March 15, 2016, 08:17:57 am »
There is also the option of examining the game code in detail. Perhaps it already stores the data in ram? If not, then yes, the simplest option is to just edit the code to make it do that. Then you can add in code wherever you want to that edits the ram.