When the NES is started (with the Power button, not Reset), can I be sure that all RAM values are set to 0 or can they have an arbitrary value?
If they are not guaranteed to be 0, what happens when I declare a variable in Assembly and don't specify a start value?
MyVariable: res 1
Is it set to 0 by the compiler or does it get the value that is currently in memory at this address?
(As far as I know, C initializes all global variables with 0, but leaves local variables uninitialized unless you explicitly do it yourself. How does Assembly handle it?)
Also, another problem:
If the RAM values do not get set to 0 at startup, how do I keep a highscore value when the Reset button is pressed?
There's the same interrupt for Reset and for Power on.
If the RAM isn't guaranteed to be all zeroes when I switch on the NES (or any clone system), how can I make sure that my score gets set to 0 at startup, but not at a reset.
Not overwriting the score at a reset is easy: Just exclude the corresponding memory when you initialize the RAM with 0.
But how do I do set it to 0 when the NES is switched on?
If they are not guaranteed to be 0, what happens when I declare a variable in Assembly and don't specify a start value?
MyVariable: res 1
Is it set to 0 by the compiler or does it get the value that is currently in memory at this address?
(As far as I know, C initializes all global variables with 0, but leaves local variables uninitialized unless you explicitly do it yourself. How does Assembly handle it?)
Also, another problem:
If the RAM values do not get set to 0 at startup, how do I keep a highscore value when the Reset button is pressed?
There's the same interrupt for Reset and for Power on.
If the RAM isn't guaranteed to be all zeroes when I switch on the NES (or any clone system), how can I make sure that my score gets set to 0 at startup, but not at a reset.
Not overwriting the score at a reset is easy: Just exclude the corresponding memory when you initialize the RAM with 0.
But how do I do set it to 0 when the NES is switched on?