EASy68K
http://easy68k.com/EASy68Kforum/

Bug I just cannot resolve
http://easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=1514
Page 1 of 1

Author:  ESmith [ Sun Nov 29, 2015 5:29 pm ]
Post subject:  Bug I just cannot resolve

I have recently taken the latest versions of the 3 games I made using Easy68K ( Alien Invasion, Pucky, and Protector) and combined them into one program that is menu driven ( you choose the desired game after each game ends). The issue is this: the player movement is not properly recognized in the Pucky game after the Protector game has been played ( the left and up commands are not recognized). I am using the move #19 , d0 followed by populating d1 with up,down,left, right , and then trap #15 followed by the btst function to detect movements.

Again, the only time this occurs is after the Protector game has been played. If the Pucky game is played first or if it is played following the Alien Invasion game the movements work fine. I have tried many different things to no avail.
I do not expect anyone to look at my code, which is over 50000 lines, but just wondering if there is anything obvious that I am not considering that could cause this type of issue.
ESmith

Author:  profkelly [ Mon Nov 30, 2015 3:52 pm ]
Post subject:  Re: Bug I just cannot resolve

Check for variables that are not being initialized in each game's code. The simulator starts by filling memory with all $FFs. If one of the variables is shared by two or more games it may not be in the same state after playing a game.

Author:  ESmith [ Sat Dec 12, 2015 3:09 pm ]
Post subject:  Re: Bug I just cannot resolve

Thanks, I am still stumped after trying a few fixes.
I think I have it where everything is reinitialized.

However, it seems to me like the only relevant items are the contents of d0 and d1.
I am clearing both prior to the move #19,d0 and trap #15 movement detection sequence.
How could the contents of other memory affect this routine? Perhaps it has to do with the memory allocation architecture ? Is the other game somehow writing into the space that controls the trap #15 internal routines? Again, I am not an expert programmer.

I also cannot stop the program right before that step to check the contents of registers, unless there is a way to build an interrupt into the code?, or I suppose I could do a simhalt?........

I would be happy to send you the file so you could experience what I am seeing. Thanks again for your indulgence!

Author:  ESmith [ Sun Dec 13, 2015 3:14 am ]
Post subject:  Got it!

You were right.
It took putting in a few well-placed halts to find it, but I should have caught it earlier.

Turns out I had variables called moveright, moveleft, moveup, movedown in the Protector, which would be set to 1 or 0 .
and I had not variables but subroutines of the same names in Pucky.

I did not remember this! So I guess the subroutine names were associated with memory addresses, and the Protector game was changing the addresses, so when the move subroutines were called in Pucky following Protector, the addresses were somehow invalid.

Thanks for the tip. I should have asked sooner...

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/