|
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]
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.
|