anybody know how i can display a sprite?
here's my sc.
i can't seem to get it to work.
any suggestions?
-thanks
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"
.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"