[A83] Re: multiple group direct input


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

[A83] Re: multiple group direct input




Yes, I was having this same problem.  If your sprite is actually "going out 
of bounds" it will access parts of memory you are not suppose to, and then 
crash once you try and exit the program.  I am currently implementing 
crashmans "sprclip" that makes it so the sprite will stay on the 
screen.  It is available at ticalc.org.

At 06:57 PM 5/12/2002 -0400, you wrote:

>I've got a direct input loop to detect the arrows or 2nd.  It's always worked
>fine until I added a function to my program...  Now after accessing the newly
>added label, it is sent back to the getkey loop and the arrows work as
>intended but 2nd now crashes.  Below is the getkey loop and the newly added
>segment...
>
>sprite_loopr:
>   call putmyspriter
>   call ionFastCopy
>key_loopr:
>   ld   a,kReset
>   out  (1),A
>   ld   a,Group1
>   out  (1),A
>   in   a,(1)
>   cp   kLeft
>   jp   z,switch_to_left
>   cp   kRight
>   jp   z,move_rightr
>   cp   kUp
>   jp   z,move_upr
>   cp   kDown
>   jp   z,move_downr
>   ld   a,kReset
>   out  (1),A
>   ld   a,Group2
>   out  (1),A
>   in   a,(1)
>   cp   kClear
>   ret  z
>   jr   key_loopr
>...
>out_of_boundsr:
>     call putmysprite10r
>     call ionFastCopy
>     jp sprite_loopr
>
>Is the problem with my 2 group direct input?  I'm inclined to think it may
>because only group2 key crashes.  BUT, it only happens after the
>'out_of_boundsr' label is jumped to.





References: