[A86] Re: assembly, programing and games


[Prev][Next][Index][Thread]

[A86] Re: assembly, programing and games




Well, right.  It doesn't clear the entire memory area, or any portion of it.
Just like in C, you can never assume that memory is initialized to a
specific value.  This can sometimes be helpful in finding bugs, especially
random crashes.  Initialize all memory that you are using with an odd value,
like $cd, at program start.  If it crashes or behaves weirdly everytime
after that, you know that it was because some code was making incorrect
assumptions about memory (fortunately, a C compiler can warn you about this
in many cases).

The reason I mentioned the problem with the program not being copied
everytime is because I think it bit me in Zelda 86 (I grabbed the code for
disabling it from there).  I believe the problem had something to do with
the save game data or the defaults for them getting screwed up when the
program was run a second time.  Then again, maybe I was just paranoid :)

> Actually I've seen a few times that when you run a program that is shorter
> right after you run the first program and then run the first one again it
> still has the 'saved' data still there too. so its always got to
> reinitialize the data that changes just in case






References: