Dead Hackers Society
Other BBSes »
 
 
Demoscene  Coding  CT60  Buy/sell

Atari coding BBS
 
Re: Cause of Error
Posted by: Bod/STAX Aug,01.2012-12:45 

Seems as though it might be the move.l (sp)+,pop method that was causing the problem. I've since changed the code to the following slightly slower method and (fingers crossed) it hasn't crashed so far.

status equ 0
x1 equ 2
y2 equ 4 ; etc, etc...
sprite_size equ 86 ; total structure size

set_up_bullet:

clr.w pop_flag
x set 0
moveq #0,d0
rept 25 ; total number of bullets possible onscreen
tst.w pop_flag
bne .e1
lea bullet_struct+x,a0
move.w status(a0),d0
add.w d0,d0
add.w d0,d0
let .lookup(pc),a1
add.w d0,a1
move.l (a1),a1
jsr (a1)
x set x+sprite_size ;sprite size=size of data structure
endr

.e1: rts

.lookup
dc.l set_up ; dead (free structure)
dc.l return ; being born
dc.l return ; alive
dc.l return ; dying

set_up: move.w #1,status(a0) ; structure now used
move.w plr_struct+x1,x1(a0) ; set bullet x/y
move.w plr_struct+y1,y1(a0)
; now do any other stuff to set up bullet data structure here using
; similar addressing
move.w #-1,pop_flag
rts

pop_flag dc.w 0
bullet_struct ds.b sprite_size*25









[All messages in this thread]    [Start new thread]

Topic Posted by  Date 
Cause of Error Bod/STAX Jul,31.2012-15:39
  Re: Cause of Error sqward Jul,31.2012-16:58
  Re: Cause of Error ggn Jul,31.2012-21:19
    Re: Cause of Error Bod/STAX Aug,01.2012-01:01
      Re: Cause of Error Bod/STAX Aug,01.2012-12:45
        Re: Cause of Error ggn Aug,02.2012-10:06
          Re: Cause of Error Bod/STAX Aug,02.2012-21:53
            Re: Cause of Error Defjam Aug,03.2012-15:31
              Re: Cause of Error spiny Aug,05.2012-11:57


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

What's the anti-troll code?
That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson