Language…
5 users online: Dispace, GrenCarret, lordkronos100, paper ness, Saela - Guests: 70 - Bots: 278
Users: 55,722 (2,327 active)
Latest user: pandapand

Background Horizontal scroll

Hey guys i was wondering how you make the background scroll horizontally like on that flying platform(Sprite C1) in SMW but slower and with ASM so i could insert it with levelasm?
Ohhhh. Ben for some reason I thought this was someone else post when you first showed me this earlier today... Yea just a tip maybe provide a link to the video, or be more descriptive. That way there's no confusion. Also Kil said it was HDMA.
There's no HDMA needed to have the BG scroll horizontally.

Code
	STZ $1413			;\ H-Scroll = none
	STZ $1414			;/ V-Scroll = none
	
	LDA $1466			;\ Load layer 2 X-position (low byte)
	CLC				;| 
	ADC #$01			;| Scroll speed = #$01
	STA $1466			;/ Store at layer 2 X-position (low byte)
	
	LDA $1467			;\ Load layer 2 X-position (high byte)
	ADC #$00			;| Do not change!
	STA $1467			;| Store at layer 2 X-position (high byte)
	RTL				;/ Return
Originally posted by Puffy1406
Ohhhh. Ben for some reason I thought this was someone else post when you first showed me this earlier today... Yea just a tip maybe provide a link to the video, or be more descriptive. That way there's no confusion. Also Kil said it was HDMA.


It's only HDMA if you want parallax scrolling. Scrolling layer 2 normally could be done simply with DEC/INC
Originally posted by Ice Man
There's no HDMA needed to have the BG scroll horizontally.

Code
	STZ $1413			;\ H-Scroll = none
	STZ $1414			;/ V-Scroll = none
	
	LDA $1466			;\ Load layer 2 X-position (low byte)
	CLC				;| 
	ADC #$01			;| Scroll speed = #$01
	STA $1466			;/ Store at layer 2 X-position (low byte)
	
	LDA $1467			;\ Load layer 2 X-position (high byte)
	ADC #$00			;| Do not change!
	STA $1467			;| Store at layer 2 X-position (high byte)
	RTL				;/ Return


i tried this but when i enter the level it just crashes after 1 sec
Nevermind got it to work ... :P
Originally posted by BeniBoD
Originally posted by Ice Man
There's no HDMA needed to have the BG scroll horizontally.

Code
	STZ $1413			;\ H-Scroll = none
	STZ $1414			;/ V-Scroll = none
	
	LDA $1466			;\ Load layer 2 X-position (low byte)
	CLC				;| 
	ADC #$01			;| Scroll speed = #$01
	STA $1466			;/ Store at layer 2 X-position (low byte)
	
	LDA $1467			;\ Load layer 2 X-position (high byte)
	ADC #$00			;| Do not change!
	STA $1467			;| Store at layer 2 X-position (high byte)
	RTL				;/ Return


i tried this but when i enter the level it just crashes after 1 sec
Nevermind got it to work ... :P


How?
Im intrested :D
Prolly by changing the RTL to a RTS instead.
Is it possible to make it scroll even slower cause even with 1 it's scrolling to fast?
Code
	STZ $1413			;\ H-Scroll = none
	STZ $1414			;/ V-Scroll = none
LDA $13
AND #$01
BNE Return
	LDA $1466			;\ Load layer 2 X-position (low byte)
	CLC				;| 
	ADC #$01			;| Scroll speed = #$01
	STA $1466			;/ Store at layer 2 X-position (low byte)
	
	LDA $1467			;\ Load layer 2 X-position (high byte)
	ADC #$00			;| Do not change!
	STA $1467			;| Store at layer 2 X-position (high byte)
Return:
	RTL				;/ Return

This'll make it act like speed 0.5.
<blm> zsnes users are the flatearthers of emulation
Yeah, ninja'd, but whatever.

Use this instead:

STZ $1413 ;\ H-Scroll = none
STZ $1414 ;/ V-Scroll = none

LDA $14
AND #$01 ; possible values are #$01, #$03, #$07, #$0F, #$1F, #$3F and #$7F
BEQ .return
LDA $1466 ;\ Load layer 2 X-position (low byte)
CLC ;|
ADC #$01 ;| Scroll speed = #$01
STA $1466 ;/ Store at layer 2 X-position (low byte)

LDA $1467 ;\ Load layer 2 X-position (high byte)
ADC #$00 ;| Do not change!
STA $1467 ;| Store at layer 2 X-position (high byte)
.return
RTL ;/ Return


Using $14 instead of $13 will make the background stop scrolling when entering a pipe, dying, getting a mushroom etc.