hi all
I have a doubt about the sprite 0 hit...
Our ultimate goal is detecting multiple sprites using zapper. For this I have started detecting single white on the screen which seemed to work well, but unfortunately its not working now . So, I had to start from the basics and now I find that the sprite 0 hit is not working perfectly, So could you please help me figuring out the problem....
Here is the code chunks I added....:
NMI:
jsr update_sprites
jsr gun_controller
RTI
update_sprites:
LDA #$00
STA $2003
LDA #$05
STA $4014
RTS
// check whether pressed the gun
gun_controller:
lda $4017
AND #%00010000
bne gun_triggered
RTS
//changes the screen black with 2 sprites
gun_triggered:
jsr changepall;
jsr check_white
RTS
check_white:
poll:
lda $2002
and #%01000000
bne nothing1
JMP poll
RTS
nothing1:
inc $504;
inc $504;
inc $504;
inc $504;
inc $504;
inc $504;
RTS
Here is the complete code link:
http://www.datafilehost.com/download-36e35072.html
Thanks in advance...
I have a doubt about the sprite 0 hit...
Our ultimate goal is detecting multiple sprites using zapper. For this I have started detecting single white on the screen which seemed to work well, but unfortunately its not working now . So, I had to start from the basics and now I find that the sprite 0 hit is not working perfectly, So could you please help me figuring out the problem....
Here is the code chunks I added....:
NMI:
jsr update_sprites
jsr gun_controller
RTI
update_sprites:
LDA #$00
STA $2003
LDA #$05
STA $4014
RTS
// check whether pressed the gun
gun_controller:
lda $4017
AND #%00010000
bne gun_triggered
RTS
//changes the screen black with 2 sprites
gun_triggered:
jsr changepall;
jsr check_white
RTS
check_white:
poll:
lda $2002
and #%01000000
bne nothing1
JMP poll
RTS
nothing1:
inc $504;
inc $504;
inc $504;
inc $504;
inc $504;
inc $504;
RTS
Here is the complete code link:
http://www.datafilehost.com/download-36e35072.html
Thanks in advance...