view 2 sprites in cbm prg studio

JMP $FCE2
peppe56
Member
Member
Posts: 3
Joined: Thu May 13, 2021 9:01 am
Contact:

view 2 sprites in cbm prg studio

Post by peppe56 »

hello, i was wondering how i can view 2 sprites with cbm prg studio.
I entered incbin "sprite1.bin" - incbin "sprite3.bin"
but it doesn't work for me, where is the mistake
this is my listing.
sorry for english, used google translator
thank you


; 10 SYS (2064)

*=$0801

BYTE $0E, $08, $0A, $00, $9E, $20, $28, $32, $30, $36, $34, $29, $00, $00, $00

*=$3000 ; Sprite data memory
incbin "sprite1.bin"
incbin "sprite3.bin"


*=$0810

lda #00 ;A= 0 (colora di nero sfondo e bordo)
sta $d020 ;53280 (bordo)
sta $d021 ;53281 (sfondo)

lda #$03 ;sprite 0 e 1 (
sta $d015 ;Poke53269,3 (abilita lo sprite 0 e 1)

lda #$c0 ;a=192 ($c0= 192 dec.) -Point to address $3000
sta $07f8 ;poke2040 ($07f8 = 2040 dec) ottiene i dati per
;lo sprite1 dalla locazione 192

lda #$c01 ;a=193 ($c1= 193 dec.) -Point to address $3040
sta $07f9 ;lo sprite1 dalla locazione 193

lda#$07 ;colore giallo sprite 0
sta$d027 ;colore spite 0


lda #$60 ;A=96 ($60 = 96 dec) - Set sprite position
sta $d000 ;POKE53248 (posizione X sprite 0)
sta $d001 ;POKE53249 (posizione Y sprite 0)

lda #$75 ;A=96 ($75 = 117 dec) - Set sprite position
sta $d002 ;POKE53250 (posizione X sprite 0)
sta $d003 ;POKE53251 (posizione Y sprite 0)

rts


peppe56
Member
Member
Posts: 3
Joined: Thu May 13, 2021 9:01 am
Contact:

Re: view 2 sprites in cbm prg studio

Post by peppe56 »

friends thanks anyway, I solved the problem, I noticed that the sprite 3 pointer code was not positioned correctly. this is the correct code, I accept suggestions to improve the code
; 10 SYS (2064)

*=$0801

BYTE $0E, $08, $0A, $00, $9E, $20, $28, $32, $30, $36, $34, $29, $00, $00, $00

*=$3000 ; Sprite data memory

incbin "sprite1.bin"
incbin "sprite3.bin"

*=$0810

lda #00 ;A= 0 (colora di nero sfondo e bordo)
sta $d020 ;53280 (bordo)
sta $d021 ;53281 (sfondo)

lda #$03 ;sprite 0 e 1 (
sta $d015 ;Poke53269,3 (abilita lo sprite 0 e 1)

lda #$c0 ;a=192 ($c0= 192 dec.) -Point to address $3000
sta $07f8 ;poke2040 ($07f8 = 2040 dec) ottiene i dati per
;lo sprite1 dalla locazione 192

lda#$07 ;colore giallo sprite 0
sta$d027 ;colore spite 0

lda #$60 ;A=96 ($60 = 96 dec) - Set sprite position
sta $d000 ;POKE53248 (posizione X sprite 0)
sta $d001 ;POKE53249 (posizione Y sprite 0)

lda #$c1 ;a=193 ($c0= 193 dec.) -Point to address $3040
sta $07f9 ;poke2041 ($07f9 = 2041 dec) ottiene i dati per
;lo sprite1 dalla locazione 193

lda #$70 ;A=96 ($70 = 112 dec) - Set sprite position
sta $d002 ;POKE53249 (posizione X sprite 1)
sta $d003 ;POKE53250 (posizione Y sprite 1)

rts
Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 2 guests