Jump to content
NHL'94 Forums

How to know if the game is active -- help!


Recommended Posts

I've been unable to figure this one out:

How can you tell, in the RAM, if the game is 'on' or 'off'?

By 'on' I mean the clock is running, by 'off' I mean a whistle has gone, or a goal has been scored, or the period is over etc...

I want to prevent checks after the whistle from counting in the Game Stats. it'd be easy to do, if only I knew how to detect that the play was going or not!

Link to comment
Share on other sites

ok i found something..

you need to look at 2 values (8-bit each)

($ffb8ec) is -1 during most play stoppages, but not goals or when the puck leaves the rink. when the play is on, it's 0. Sometimes it's briefly -1 during gameplay, but this is very rare and only happens for a fraction of a second.

($ffc2ec) is 80 after a goal and when the puck is out of the rink. There is some other situation where it's 64 when the play is stopped.

when the play is on, it's 0, 16, or 24. When you're in a menu screen or instant replay, it's usually a negative value.

You never see ($ffb8ec)==-1 and ($ffc2ec)>=64 at the same time, which is important...

so to know if the game is currently stopped for a whistle, goal, end of period, etc:

if (($ffb8ec) == -1) XOR (($ffc2ec) >= 64) then the play is currently stopped

if (($ffb8ec) == 0) AND (($ffc2ec) < 64) then the play is currently going

In my checking stat hack, i checked to see if the game is running like so:

(D0 is a general purpose CPU data register)

D0 = value from ($ffc2ec) (which might be 0,16,24,64,80...)

D0 = D0/32, discard remainder. if D0 was 0,16,or 24 it'll now be 0 (game on). if it was 64 or 80, it'll be 1 (game off).

D0 = D0 + value from ($ffb8ec)

If (D0 == 0) then the play is on, so record check stats

since you never see ($ffb8ec)==-1 and ($ffc2ec)>=64 at the same time, you never get -1+1=0, which would be a false-positive.

EDIT: found that 64 is also a 'game not on' value for ($ffc2ec). added a pseudo-code method to check for gameplay running.

Link to comment
Share on other sites

Have you found anything regarding the speed of the clock?

(in order to convert it to real-time or simple ticks)

nope. i just gave it a try, but i couldn't see it (well, i have an idea for how it would work, but the cpu speed is too fast to make it easy to find.. i narrowed it down to about 20 ram values and narrowing it further would take time. it's not a priority right now)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Who's Online   0 Members, 0 Anonymous, 55 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...