[A83] Re: 83p Problem with moving a sprite


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

[A83] Re: 83p Problem with moving a sprite




You need to learn perhaps the most important programming skill there is:
debugging.  There are really two ways to debug assembly code.  The first way
is to just stare at it until you figure out what is wrong.  The second way
is to use a debugger like VTI (which you are very lucky to have).  Load your
program into VTI.  Then, start up the debugger, and set a breakpoint on the
starting address of your routine.  Then, step through the routine.  Keep an
eye on your registers, and possibly a location in memory.  You will then be
able to see exactly what the routine IS doing, instead of what you think it
SHOULD be doing.  If you ask other people to debug your code for you
everytime you have a problem, then you can't really write code.  Debugging
is usually the hardest part of programming.(until you hit that point when
you write perfect assembly code at least 95% of the time, which takes about
a year of experience).

> Hi.  I wrote this sprite routine that displays an 8x8 sprite, checks for
> input, clears that sprite, jumps to input commans (ex. if the left key was
> pressed) and then draws the second sprite in the series.  It switches
> between the two two sprites everytime it loops.  Now here is my problem,
it
> moves to the right just fine, but on certain spots when you move to the
left
> it gets stuck.  The getting stuck is always in the same place, and I
cannot
> figure out why.  PLEASE HELP ME!  Thanks in advance.






Follow-Ups: References: