EASy68K  
It is currently Fri Jul 21, 2017 2:47 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Nov 29, 2015 5:29 pm 
Offline

Joined: Fri Aug 14, 2015 2:12 pm
Posts: 12
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


Top
 Profile  
 
PostPosted: Mon Nov 30, 2015 3:52 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1039
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.

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Sat Dec 12, 2015 3:09 pm 
Offline

Joined: Fri Aug 14, 2015 2:12 pm
Posts: 12
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!


Top
 Profile  
 
 Post subject: Got it!
PostPosted: Sun Dec 13, 2015 3:14 am 
Offline

Joined: Fri Aug 14, 2015 2:12 pm
Posts: 12
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...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group