How exactly is split-screen scrolling done on the MMC3? I have tried out some code:
Now, the screen does scroll properly, so I know the IRQ is executing, but the scrolling does not split-screen. Now I did read Kevin's document on the MMC3, but that only talks about the IRQ and not how it relates to scrolling. Right here:
http://www.tripoint.org/kevtris/mappers/mmc3/
Perhaps somebody could tell me what I'm doing wrong and perhaps point me in the right direction? Even better, could they correct my code?
Thanks. ^_^
Code:
;NMI
nmi:
sei
pha
txa
pha
tya
pha
lda $2002
lda #$00
sta $2006
sta $2006
lda #$01
sta <$80
jsr text_code
lda <$1a
bne scroll
endnmi:
lda #$00
sta <$80
pla
tay
pla
tax
pla
rti
scroll:
lda <$1b
ora <$17
beq goone
jmp endnmi
goone:
lda <$82
bne endnmi
lda #$c1
sta $c000
sta $c001
sta $e001
lda #$01
sta <$81
sta <$82
cli
jmp endnmi
;IRQ/BRK
irq:
sei
pha
tya
pha
txa
pha
lda <$81
beq endirq
sta $e001
lda $2002
lda #00
sta $2006
sta $2006
inc <$30
lda $2002
lda <$30
sta $2005
sta $2005
sta $e000
lda #00
sta <$81
sta <$82
endirq:
pla
tax
pla
tay
pla
rti
nmi:
sei
pha
txa
pha
tya
pha
lda $2002
lda #$00
sta $2006
sta $2006
lda #$01
sta <$80
jsr text_code
lda <$1a
bne scroll
endnmi:
lda #$00
sta <$80
pla
tay
pla
tax
pla
rti
scroll:
lda <$1b
ora <$17
beq goone
jmp endnmi
goone:
lda <$82
bne endnmi
lda #$c1
sta $c000
sta $c001
sta $e001
lda #$01
sta <$81
sta <$82
cli
jmp endnmi
;IRQ/BRK
irq:
sei
pha
tya
pha
txa
pha
lda <$81
beq endirq
sta $e001
lda $2002
lda #00
sta $2006
sta $2006
inc <$30
lda $2002
lda <$30
sta $2005
sta $2005
sta $e000
lda #00
sta <$81
sta <$82
endirq:
pla
tax
pla
tay
pla
rti
Now, the screen does scroll properly, so I know the IRQ is executing, but the scrolling does not split-screen. Now I did read Kevin's document on the MMC3, but that only talks about the IRQ and not how it relates to scrolling. Right here:
http://www.tripoint.org/kevtris/mappers/mmc3/
Perhaps somebody could tell me what I'm doing wrong and perhaps point me in the right direction? Even better, could they correct my code?
Thanks. ^_^