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

Author Topic: Tracking down Magic Sword (SNES) timer in RAM  (Read 5039 times)

zonk47

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Tracking down Magic Sword (SNES) timer in RAM
« on: April 24, 2016, 04:38:10 pm »
I'm trying to locate the health down timer count in Magic Sword. What would be the easiest way to do it?
A good slave does not realize he is one; the best slave will not accept that he has become one.

mz

  • Sr. Member
  • ****
  • Posts: 447
  • Whore
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #1 on: April 24, 2016, 04:42:04 pm »
Use the RAM/Cheat Search function in any SNES emulator that supports it: BizHawk, MAME, Snes9x-rr, lsnes, ZSNES, etc.

Guide for absolute newbies: http://tasvideos.org/MemorySearch.html
There has to be a better life.

zonk47

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #2 on: April 24, 2016, 06:37:00 pm »
Why is there no tool that identifies continuous counters for me?
A good slave does not realize he is one; the best slave will not accept that he has become one.

mz

  • Sr. Member
  • ****
  • Posts: 447
  • Whore
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #3 on: April 24, 2016, 06:49:24 pm »
There is, it's called RAM/Cheat Search.
There has to be a better life.

zonk47

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #4 on: April 24, 2016, 06:57:44 pm »
There is, it's called RAM/Cheat Search.

No it doesn't.
A good slave does not realize he is one; the best slave will not accept that he has become one.

mz

  • Sr. Member
  • ****
  • Posts: 447
  • Whore
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #5 on: April 24, 2016, 07:04:43 pm »
You may want to learn how to use it.
There has to be a better life.

Seihen

  • Sr. Member
  • ****
  • Posts: 404
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #6 on: April 24, 2016, 07:08:49 pm »
Why is there no tool that identifies continuous counters for me?

Because every game does it differently and it's such a edge-case feature that it wouldn't really benefit many people other than you?

Oh, and RAM/Cheat searching works just as well.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7037
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #7 on: April 24, 2016, 10:10:27 pm »
I will give a third opinion that it is what RAM/Cheat search is for. Find a tutorial on that.
A counter is going to be a value either going up all the time or going down all the time. The cheat search option you're looking for is something like "unknown value", "relative value" or so on.
I'm sure I could find the value in a few minutes myself but I'm not going to, I'll leave it as an exercise for you.

Sorry, zonk, debuggers can help you find the data but they won't magically find it for you.
ROMhacking is not about having tools for EVERYTHING down to the tiniest, most mundane tasks.
"My watch says 30 chickens" Google, 2018

fusaru

  • Jr. Member
  • **
  • Posts: 22
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #8 on: April 25, 2016, 01:52:08 am »
You can also dump the RAM twice in a situation were as little as possible changes (no background animations, no enemies on screen) and look for differences in a hex editor that offers a compare option. If the emulator allows on-the-fly editing of ram values, change them and see what happens ingame. Those emulator cheat search options sound a lot better and easier to use though.
(MD hacks):
Complete --> see contributions page
Twin Hawk (arcade graphics), Toki

SunGodPortal

  • Hero Member
  • *****
  • Posts: 2919
  • 2 + 2 = 5
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #9 on: April 25, 2016, 02:16:07 am »
When I was fiddling around with the NES Castlevanias I just opened up FCEUX's RAM viewer (showed a bunch of hex) and it was pretty obvious where the time was stored because it was continuously decreasing at a consistent rate. Is there not a SNES emu with the same feature?
Cigarettes, ice-cream, figurines of the Virgin Mary...

zonk47

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #10 on: April 25, 2016, 04:53:50 am »
When I was fiddling around with the NES Castlevanias I just opened up FCEUX's RAM viewer (showed a bunch of hex) and it was pretty obvious where the time was stored because it was continuously decreasing at a consistent rate. Is there not a SNES emu with the same feature?

There is but there is just so much RAM in the SNES that it's hard to pin down.
A good slave does not realize he is one; the best slave will not accept that he has become one.

zhade

  • Full Member
  • ***
  • Posts: 193
    • View Profile
    • zhaDe's stuff
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #11 on: April 25, 2016, 09:07:40 am »
I don't really know what you mean by "the health down timer count" but altho having some expectations about how the game will handle the thing you are looking for (like how you expect it to be a counter) might help you find the address in less than a minute sometimes, it can also lead you to a dead end if your expectations are wrong, so I would advise not sticking too strongly to it and go with comparative = and != if all else fails.

zonk47

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #12 on: April 25, 2016, 09:16:34 am »
In the game you lose health over time. This is a holdover from the arcade version which was made as unfair as possible for quarters yadda yadda.

There are very few downward counters in the game but a number of upward ones. I froze a couple of addresses that seemed to be rising slowly and that seemed to eliminate the health loss.
A good slave does not realize he is one; the best slave will not accept that he has become one.

VicVergil

  • Hero Member
  • *****
  • Posts: 725
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #13 on: April 25, 2016, 05:10:38 pm »
How about you start with the visible result first (the health bar itself), and then try using the debugger (tracer and write breakpoint on HP RAM address) to track down the cause causing it to change (or more specifically, decrease) later?
The health bar RAM address shouldn't be that hard to find. Chances are someone online found it already and posted it to a cheat side as an infinite HP code.

There is but there is just so much RAM in the SNES that it's hard to pin down.

I'd hate to hear what you think about anything released after it then.

SunGodPortal

  • Hero Member
  • *****
  • Posts: 2919
  • 2 + 2 = 5
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #14 on: April 25, 2016, 07:59:44 pm »
Quote
There is but there is just so much RAM in the SNES that it's hard to pin down.

It's been a while since I've played Magic Sword. Was there a timer or graphic on screen that indicated the timer you are looking for? One of the things that made the timer easy to find in Castlevania was that the time values in RAM changed at the exact same time as the numbers on screen, so all I really had to do was have the play screen and the RAM viewer on screen and then just sort of focus on all of it rather than the details and it was easy to see what on screen was synced with the values in RAM. That was really handy when testing a bunch of the other values in RAM because once I started to run out of time in-game I could just throw some random numbers in and have all the time I needed.
Cigarettes, ice-cream, figurines of the Virgin Mary...

VicVergil

  • Hero Member
  • *****
  • Posts: 725
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #15 on: April 25, 2016, 09:11:30 pm »
It's been a while since I've played Magic Sword. Was there a timer or graphic on screen that indicated the timer you are looking for?

It seems the protagonist's HP decreases gradually over time (slowly) anyways even without taking damage. Kind of like the Boss HP meter in Valis IV. There's no onscreen timer. However, there's still the HP meter itself.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7037
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #16 on: April 26, 2016, 06:41:58 pm »
It's been a while since I've played Magic Sword. Was there a timer or graphic on screen that indicated the timer you are looking for? One of the things that made the timer easy to find in Castlevania was that the time values in RAM changed at the exact same time as the numbers on screen, so all I really had to do was have the play screen and the RAM viewer on screen and then just sort of focus on all of it rather than the details and it was easy to see what on screen was synced with the values in RAM. That was really handy when testing a bunch of the other values in RAM because once I started to run out of time in-game I could just throw some random numbers in and have all the time I needed.
It's not a visible timer. The player just suddenly loses health at periodic intervals. It's a bit of a sneaky thing, as its infrequent enough players may not notice apart from taking actual hits. But if you stand there for a couple minutes at the start and shoot whatever comes at you, you'll notice the health bar occasionally dropping on its own.
Then the process would be like:
1.) Start a new Relative/Comparative search.
2.) Wait a couple frames.
3.) Search for a smaller value.
4.) Repeat until only a few possible values remain.
5.) If no results found for a smaller value, try the whole process over looking for a higher value.
"My watch says 30 chickens" Google, 2018

chillyfeez

  • Hero Member
  • *****
  • Posts: 834
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #17 on: April 27, 2016, 01:17:55 am »
For finding timers in SNES, I find simply looking at live RAM to be pretty easy.
The hex viewer in geiger's can be resized, limited only by the size of your screen.
So, stretch it to show 0x200 bytes at a time. Watch a second or two of the game go by. If the timer is there, you'll see it. If not, hit page down and try again. It really won't take that long...
Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

zonk47

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #18 on: April 27, 2016, 10:01:27 pm »
That would be easy except in Magic Sword enemies never stop coming. Anyway I managed to freeze the timer (which counts upward) and grinded enough on the flying imps to kick the game's ass without dying. That is why the health leak exists, in that otherwise you can grind health (as your "health levels" are like energy tanks in Metroid) and beat the whole game in a couple hours.
A good slave does not realize he is one; the best slave will not accept that he has become one.

SunGodPortal

  • Hero Member
  • *****
  • Posts: 2919
  • 2 + 2 = 5
    • View Profile
Re: Tracking down Magic Sword (SNES) timer in RAM
« Reply #19 on: April 28, 2016, 12:18:06 am »
Quote
That would be easy except in Magic Sword enemies never stop coming. Anyway I managed to freeze the timer (which counts upward) and grinded enough on the flying imps to kick the game's ass without dying. That is why the health leak exists, in that otherwise you can grind health (as your "health levels" are like energy tanks in Metroid) and beat the whole game in a couple hours.

Cool. You should post the info or make a patch. I'd like to replay this game some time in the near future and this would make the game a lot more fun.
Cigarettes, ice-cream, figurines of the Virgin Mary...