MMC3 Split Scroll Help! (4-screen)

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
Yoshimaster96
Posts: 16
Joined: Sat Jan 09, 2016 5:30 pm

MMC3 Split Scroll Help! (4-screen)

Post by Yoshimaster96 »

After the following subroutine is called:

Code: Select all

EnableHUD:
	lda #$C0
	sta $C000
	sta $C001
	sta $E001
	rts
There is no split scrolling. The HUD should start on row 192 on screen. The HUD starts on row 192 of the bottom left nametable (0x2800). The game has 4-screen scrolling.

Here is the NMI routine:

Code: Select all

NMI:
	lda #$08
	sta $2006
	lda #$00
	sta $2005
	sta $2005
	sta $2006
	rti
And the IRQ routine:

Code: Select all

Interrupt:
	rti
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: MMC3 Split Scroll Help! (4-screen)

Post by tokumaru »

The NMI handler is supposed to set the scroll for the gameplay window, using $2000 and $2005 ($2006 should only be used for setting the scroll mid-screen), and the IRQ handler is supposed to set the scroll for the status bar, using $2005 and $2006.

Also keep an eye on the I (interrupt inhibit) flag, which must be cleared so that IRQs can fire. Note that you can't CLI inside the NMI handler, because when NMIs and IRQs fire, the status flags (including I) are automatically saved on the stack and restored when you RTI, so whatever you do with these flags inside the NMI and IRQ handlers is lost when you RTI.
Post Reply