Hello Everyone,
Ive been messing around with some code ive found on a past forum and im running into a problem when i run it in Nesticle, heres the code:
The problem is that when i view it in Nesticle i can only see a blank tile screen(like the one in NGC)and i can only see the graphics i created in the Patterntable menu. Viewing the nametable menu in Nesticle only gives me a view off the blank screen and my graphics all mixed up on the top row. Is anyone haveing this problem when your runnin this code. What am i doing wrong to get it to work in the pattern table but not in the nametable. *When i open my graphics file i created in YY-CHR in NGC there is only the default tile screen in the nametable menu and the pallete data does not tranfer.* Any suggestions?
P.S. Do i really need a nametable file can i just use .chr and .pal for this code? What is the difference between nametables and pattern tables? I know the difference logic wise but i cant seem to understand or visualize there correlation in code.
Ive been messing around with some code ive found on a past forum and im running into a problem when i run it in Nesticle, heres the code:
Code:
.inesprg 1
.ineschr 1
.inesmir 1
.inesmap 0
.org $8000
.bank 0
addrLO = $00
addrHI = $01
Start:
SEI
CLD
LDA #$00
STA $2000
STA $2001
LDX #$02
begloop:
LDA $2002
BPL begloop
DEX
BPL begloop
TXS
lda #%00001000
sta $2000
lda #%00011110
sta $2001
lda #$3F ;set ppu to start of palette
sta $2006
lda #$00
sta $2006
ldx #$00
loadpal:
lda titlepal, x ;loads a 32 byte palette
sta $2007
inx
cpx #$20 ;gotta be one extra b/c of inx
bne loadpal
Loop:
jsr vwait
lda #$20 ;set ppu to start of VRAM
sta $2006
lda #$20
sta $2006
lda #low(lvl1sht)
sta addrLO
lda #high(lvl1sht)
sta addrHI
jsr loadlevel1
; other junk to try and implement later goes around here
loadlevel1:
ldx #4
ldy #0
feedlevel1:
lda (addrLO), y
sta $2007
iny
bne feedlevel1
inc addrHI
dex
bne feedlevel1
rts
jmp Loop
vwait:
lda $2002
bpl vwait
rts
titlepal:
.incbin "Graphics.pal"
.bank 1 ;needed or NESASM gets cranky
.org $FFFA ;ditto
.dw 0 ;(NMI_Routine)
.dw Start ;(Reset_Routine)
.dw 0 ;(IRQ_Routine)
.bank 2
.org $C000
.incbin "graphics.chr"
.bank 3
.org $D000
lvl1sht: .incbin "Graphics.nam"
.ineschr 1
.inesmir 1
.inesmap 0
.org $8000
.bank 0
addrLO = $00
addrHI = $01
Start:
SEI
CLD
LDA #$00
STA $2000
STA $2001
LDX #$02
begloop:
LDA $2002
BPL begloop
DEX
BPL begloop
TXS
lda #%00001000
sta $2000
lda #%00011110
sta $2001
lda #$3F ;set ppu to start of palette
sta $2006
lda #$00
sta $2006
ldx #$00
loadpal:
lda titlepal, x ;loads a 32 byte palette
sta $2007
inx
cpx #$20 ;gotta be one extra b/c of inx
bne loadpal
Loop:
jsr vwait
lda #$20 ;set ppu to start of VRAM
sta $2006
lda #$20
sta $2006
lda #low(lvl1sht)
sta addrLO
lda #high(lvl1sht)
sta addrHI
jsr loadlevel1
; other junk to try and implement later goes around here
loadlevel1:
ldx #4
ldy #0
feedlevel1:
lda (addrLO), y
sta $2007
iny
bne feedlevel1
inc addrHI
dex
bne feedlevel1
rts
jmp Loop
vwait:
lda $2002
bpl vwait
rts
titlepal:
.incbin "Graphics.pal"
.bank 1 ;needed or NESASM gets cranky
.org $FFFA ;ditto
.dw 0 ;(NMI_Routine)
.dw Start ;(Reset_Routine)
.dw 0 ;(IRQ_Routine)
.bank 2
.org $C000
.incbin "graphics.chr"
.bank 3
.org $D000
lvl1sht: .incbin "Graphics.nam"
The problem is that when i view it in Nesticle i can only see a blank tile screen(like the one in NGC)and i can only see the graphics i created in the Patterntable menu. Viewing the nametable menu in Nesticle only gives me a view off the blank screen and my graphics all mixed up on the top row. Is anyone haveing this problem when your runnin this code. What am i doing wrong to get it to work in the pattern table but not in the nametable. *When i open my graphics file i created in YY-CHR in NGC there is only the default tile screen in the nametable menu and the pallete data does not tranfer.* Any suggestions?
P.S. Do i really need a nametable file can i just use .chr and .pal for this code? What is the difference between nametables and pattern tables? I know the difference logic wise but i cant seem to understand or visualize there correlation in code.