Ive been working on this demo taking away values and adding different ones to try and figure out how to write my own codes. Here are a Jumpy Demo ive cut up to only display the backround, text and the sprite:
!. What ive been doing is Changing the values in TEXT3(look above). Orginally the value #$2c was a #$4c. But i changed it to #$3c so it would say only "This is a Jumpy SPrite demo" By changing the value to #$2c it says " this is a". WHat is going on here? Is this an address or value?
2. Why does he load these values into the ram ive never seen this before?
Can someone please help????????
Thanks in advance,
EL
Code:
.inesprg 1
.ineschr 1
.inesmir 1
.inesmap 0
.org $8000
.bank 0
Start:
lda #$70 ; The folowing instructions store some data in the
sta $6000 ; RAM. [u]<---Question 2[/u]
lda #$CF
sta $6001
lda #$00
sta $6005
lda #%00001000
sta $2000
lda #%00011110
sta $2001
lda #$3f
sta $2006
lda #$00
sta $2006
ldx #$00
loadpal:
lda pallete, x ; loads pallete value into the Acummulator
sta $2007 ; writes the valeu to the pallete
inx
cpx #$20
bne loadpal
text:
lda #$20
sta $2006
lda #$20
sta $2006
ldx #$20
text3: ; Draws the text part of the background
lda map, x
sta $2007
inx
cpx #$2c ;[u]<----Question 1.[/u]
bne text3
ldx #$00
lda #$23
sta $2006
lda #$60
sta $2006
ldx #$00
background: ; Draws the upper part of the floor
lda map, x
sta $2007
inx
cpx #$20
bne background
ldx #$00
background2: ; Draws the lower part of the floor
ldy map, x
iny
iny
sty $2007
inx
cpx #$20
bne background2
drawsprite:
lda #$00
sta $2003
lda #$00
sta $2003
lda $6001 ; Y
sta $2004
lda #$04 ; tile nummer
sta $2004
lda $%0000010 ; collor + artibytees
sta $2004
lda $6000 ; X
sta $2004
rts
pallete:
.db $32,$01,$06,$2A,$32,$03,$10,$00
.db $32,$38,$33,$3C,$32,$21,$26,$02
.db $32,$16,$12,$14,$32,$07,$17,$27
.db $32,$0B,$07,$2D,$32,$3A,$35,$31
map:
.db $26,$27,$26,$27,$26,$27,$26,$27,$26,$27 ;Floor
.db $26,$27,$26,$27,$26,$27,$26,$27,$26,$27
.db $26,$27,$26,$27,$26,$27,$26,$27,$26,$27
.db $26,$27,$00
.db $00,$1d,$11,$12,$1c,$00,$12,$1c,$00,$0a ;Text
.db $00,$13,$1e,$16,$19,$12,$17,$10,$00,$1c
.db $19,$1b,$12,$1d,$0e,$00,$00
.db $0b,$22,$00,$2b,$2c,$2d,$2e,$00,$04,$2a,$07
.db $2a,$02,$24,$24,$02
.bank 1
.org $FFFA
.dw 0 ;(NMI_Routine)
.dw Start ;(Reset_Routine)
.dw 0 ;(IRQ_Routine)
.bank 2
.org $0000
.incbin "jumpy.chr"
.ineschr 1
.inesmir 1
.inesmap 0
.org $8000
.bank 0
Start:
lda #$70 ; The folowing instructions store some data in the
sta $6000 ; RAM. [u]<---Question 2[/u]
lda #$CF
sta $6001
lda #$00
sta $6005
lda #%00001000
sta $2000
lda #%00011110
sta $2001
lda #$3f
sta $2006
lda #$00
sta $2006
ldx #$00
loadpal:
lda pallete, x ; loads pallete value into the Acummulator
sta $2007 ; writes the valeu to the pallete
inx
cpx #$20
bne loadpal
text:
lda #$20
sta $2006
lda #$20
sta $2006
ldx #$20
text3: ; Draws the text part of the background
lda map, x
sta $2007
inx
cpx #$2c ;[u]<----Question 1.[/u]
bne text3
ldx #$00
lda #$23
sta $2006
lda #$60
sta $2006
ldx #$00
background: ; Draws the upper part of the floor
lda map, x
sta $2007
inx
cpx #$20
bne background
ldx #$00
background2: ; Draws the lower part of the floor
ldy map, x
iny
iny
sty $2007
inx
cpx #$20
bne background2
drawsprite:
lda #$00
sta $2003
lda #$00
sta $2003
lda $6001 ; Y
sta $2004
lda #$04 ; tile nummer
sta $2004
lda $%0000010 ; collor + artibytees
sta $2004
lda $6000 ; X
sta $2004
rts
pallete:
.db $32,$01,$06,$2A,$32,$03,$10,$00
.db $32,$38,$33,$3C,$32,$21,$26,$02
.db $32,$16,$12,$14,$32,$07,$17,$27
.db $32,$0B,$07,$2D,$32,$3A,$35,$31
map:
.db $26,$27,$26,$27,$26,$27,$26,$27,$26,$27 ;Floor
.db $26,$27,$26,$27,$26,$27,$26,$27,$26,$27
.db $26,$27,$26,$27,$26,$27,$26,$27,$26,$27
.db $26,$27,$00
.db $00,$1d,$11,$12,$1c,$00,$12,$1c,$00,$0a ;Text
.db $00,$13,$1e,$16,$19,$12,$17,$10,$00,$1c
.db $19,$1b,$12,$1d,$0e,$00,$00
.db $0b,$22,$00,$2b,$2c,$2d,$2e,$00,$04,$2a,$07
.db $2a,$02,$24,$24,$02
.bank 1
.org $FFFA
.dw 0 ;(NMI_Routine)
.dw Start ;(Reset_Routine)
.dw 0 ;(IRQ_Routine)
.bank 2
.org $0000
.incbin "jumpy.chr"
!. What ive been doing is Changing the values in TEXT3(look above). Orginally the value #$2c was a #$4c. But i changed it to #$3c so it would say only "This is a Jumpy SPrite demo" By changing the value to #$2c it says " this is a". WHat is going on here? Is this an address or value?
2. Why does he load these values into the ram ive never seen this before?
Can someone please help????????
Thanks in advance,
EL