nesdev.com
http://forums.nesdev.com/

'Wave' scroll effect in VRC7 without graphical glitches?
http://forums.nesdev.com/viewtopic.php?f=2&t=11089
Page 1 of 1

Author:  w7n [ Tue Mar 11, 2014 4:18 am ]
Post subject:  'Wave' scroll effect in VRC7 without graphical glitches?

...Of course, I'm not gonna spend all those code waiting for the HBlank.
I'm trying to make the scroll look like a wave. Assume that the first page and the second page are exactly the same.
The following code is my code, and some graphical glitches appear at the right edge of the screen when running on FCEUX.

I_CW6_0:
;note that IRQControl is #$03

LDA IRQCount
BEQ I_CW6_0_1 ;First IRQ
CMP #$12
BEQ UsualIRQ ;Last IRQ
STA IRQAcknowledge
;IRQLatch or IRQControl doesn't need to be changed

INC IRQCount
LDA FrameCounter
LSR
LSR
CLC
ADC IRQCount
AND #$0F
TAY

LDA IRQScroll
CLC
ADC IRQWaveDif, Y

STA PPU_SCROLL_REG
STA PPU_SCROLL_REG
;LDA IRQPage
;ADC IRQWavePageDif, Y
;AND #$01
;ORA IRQPPU
;STA PPU_CTRL_REG1

RTS

IRQWaveDif:
.DB 0,$FE,$FC,$FB,$FA,$FB,$FC,$FE,0,2,4,5,6,5,4,2
IRQWavePageDif:
.DB 0,$FF,$FF,$FF,$FF,$FF,$FF,$FF,0,0,0,0,0,0,0,0


If the commented code are turned into actual code, there are more graphical glitches.

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/