It is currently Tue Oct 17, 2017 6:31 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: devving woes
PostPosted: Sun Feb 13, 2005 5:38 pm 
anybody know how i can display a sprite?
here's my sc.
i can't seem to get it to work.
any suggestions?
-thanks
Code:
   .inesprg 1
   .inesmap 0
   .ineschr 1
   .inesmir 1

   .bank 1
   .org $fffa
   .dw 0
   .dw start
   .dw 0

   .bank 2
   .org $0000
back:   .incbin "our2.bkg"
sprite:   .incbin "MT.spr"

   .bank 0
   .org $0300
Sprite_y:   .db 20
Sprite_t:   .db 2
Sprite_a:   .db 05
Sprite_x:   .db 8

   .org $8000
start:
   lda #$ff
   sta $400c
   lda #$50
   sta $400e
   lda #$ab
   sta $440f
   
   lda #%10010111
   sta $4000
   lda #$ab
   sta $4001

   lda #%00011011
   sta $4015

vblank:
   lda $2002
   bpl vblank
   
   
   lda #%00001000
   sta $2000
   lda #$%00111111
   sta $2001

   lda #$20
   sta $2006
   lda #00
   sta $2006
   


map:   lda mmp, y
   sta 2007
   iny
   cpy #32
   bne map

   lda #$3f
   sta $2006
   ldx #0
   ldy #0
   stx $2006
pall:   
   lda palt, x
   sta $2007
   inx
   cpx #$10
   bne pall
   


www:   
   lda $2002
   bpl www
sp_on:   
   lda #3
   sta $4014

   lda #$1
   sta $4016
   lda #$0
   sta $4016
   
   lda $4016
   and #1
   bne adown
   lda $4016
   and #1
   bne bdown
   lda $4016
   and #1
   bne select
   lda $4016
   and #1
   bne strt
   lda $4016
   and #1
   bne up
   lda $4016
   and #1
   bne down
   lda $4016
   and #1
   bne left
   lda $4016
   and #1
   bne right

adown:      
   jmp sp_on
bdown:
   jmp sp_on
select:
   jmp sp_on
strt:
   jmp sp_on
up:   
   lda Sprite_y
   sbc #1
   sta Sprite_y
   jmp sp_on
down:
   lda Sprite_y
   adc #1
   sta Sprite_y
   jmp sp_on
left:   lda Sprite_x
   sbc #1
   sta Sprite_x
   jmp sp_on
right:   lda Sprite_x
   adc #1
   sta Sprite_x
   jmp sp_on
   

forever:
   jmp forever

palt:   .incbin "mine.pal"
mmp:   .incbin "340.map"


Top
  
 
 Post subject:
PostPosted: Sun Feb 13, 2005 7:55 pm 
I edited your post to add code tags.

It looks like you didn't load the palette fully. The first 16 bytes is the background, next 16 is sprites.


Top
  
 
 Post subject:
PostPosted: Sun Feb 13, 2005 8:06 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3470
Location: Indianapolis
Whoops, I wasn't logged in.

But also, the starting values of your sprites aren't being set. You need something like this, with your table in ROM.

Code:
lda Sprite_y,x
sta $300,x

Sprite_y:   .db 20
Sprite_t:   .db 2
Sprite_a:   .db 05
Sprite_x:   .db 8


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group