Language…
16 users online: Batata Douce, buzz_lightzyear, Chambo, Dark Prince, ForthRightMC, Fozymandias, Gorry, Green, LadiesMan217, MellowYouth, Mischievous Marc, Rauf, Raychu2021,  Ringo, SiameseTwins, sinseiga - Guests: 259 - Bots: 248
Users: 64,795 (2,376 active)
Latest user: mathew

SMB3 Airship style autoscroll/camera bob

OpenASM

Title:
SMB3 Airship style autoscroll/camera bob

Type:
Whatever you feel would work, Preferably compatible with https://www.smwcentral.net/?p=section&a=details&id=23117

Description:
Pretty simple (atleast in concept..) trying to get the bobbing autoscroll vibes from the airship levels of smb3, and was kinda suprised that there isn't already something to achieve this :(
I dont care too much if the bullets follow the bobs or not, would be a nice touch but is definitely not a requirement, (Especially if its more effort than its worth).

References:
I have this code from the JUMP base ROM which should fulfill your requirements:

Code
main: 	LDA $9D
	ORA $13D4|!addr
	BNE .end

	LDA $14
	LSR
LSR
	BCC .end

	LDX $1444|!addr
	LDA.l otherbank1F_data,x
	INX
	STX $1444|!addr
	CMP #$01
	BEQ .up
	CMP #$02
	BEQ .down
.end
	RTL
.up
	STZ $55		; Make sure that new tiles are uploaded from the top of the screen
	REP #$30	; 16-bit (accumulator).
	DEC $1464|!addr	; Make the screen scroll upwards automatically.
	SEP #$30	; 8-bit (accumulator).
	RTL
.down
	LDA #$02	;\ Make sure that new tiles are uploaded from the bottom of the screen
	STA $55		;/
	REP #$20	; 16-bit (accumulator).
	INC $1464|!addr	; Make the screen scroll downwards automatically.
	SEP #$20	; 8-bit (accumulator).
	RTL

otherbank1F:
.data
	db $00,$00,$00,$00,$00,$00,$00,$01,$00,$00,$00,$00,$00,$01,$00,$00,$00,$00,$01,$00,$00,$00,$01,$00,$00,$01,$00,$01,$00,$01,$00,$01
	db $00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01
	db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01
	db $00,$01,$00,$01,$00,$01,$00,$00,$01,$00,$00,$00,$01,$00,$00,$00,$00,$01,$00,$00,$00,$00,$00,$01,$00,$00,$00,$00,$00,$00,$00,$01

	db $00,$00,$00,$00,$00,$00,$00,$02,$00,$00,$00,$00,$00,$02,$00,$00,$00,$00,$02,$00,$00,$00,$02,$00,$00,$02,$00,$02,$00,$02,$00,$02
	db $00,$02,$00,$02,$00,$02,$00,$02,$00,$02,$00,$02,$00,$02,$00,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02
	db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$02,$00,$02,$00,$02,$00,$02,$00,$02,$00,$02,$00,$02,$00,$02
	db $00,$02,$00,$02,$00,$02,$00,$00,$02,$00,$00,$00,$02,$00,$00,$00,$00,$02,$00,$00,$00,$00,$00,$02,$00,$00,$00,$00,$00,$00,$00,$02


If you want to customize the scrolling, you need to understand the '.data' table. The first four lines of the table are responsible for moving the camera up whereas the last four lines are responsible for moving the camera down. This is dictated by the following three values:

$00 means the camera will stop scrolling;
$01 means the camera will scroll up; and
$02 means the camera will scroll down.

The last four lines should have the same pattern as the first four lines, but with the $01's replaced with $02's, of course. Editing the table may be quite trial-and-error, but eventually you will get used to it.

One benefit of this code is that stationary sprites like piranha plants and shooters will follow layer 1 normally since the camera is being moved, not any layers. The other benefit is that it works fine with the vanilla auto-scrollers (though I don't recommend you to use the special auto-scrollers). However, the most important note is that you should disable vertical scrolling at will. The layer 2 auto-scroll UberASM you linked should theoretically work fine, but I didn't try it myself.

Hope this helps! If you have any more questions, I'll clarify them.
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

Originally posted by Anas
I have this code from the JUMP base ROM which should fulfill your requirements:

Code
main: 	LDA $9D
	ORA $13D4|!base2
	BNE .end

	LDA $14
	LSR
LSR
	BCC .end

	LDX $1444|!base2
	LDA.l otherbank1F_data,x
	INX
	STX $1444|!base2
	CMP #$01
	BEQ .up
	CMP #$02
	BEQ .down
.end
	RTL
.up
	STZ $55		; Make sure that new tiles are uploaded from the top of the screen
	REP #$30	; 16-bit (accumulator).
	DEC $1464|!addr	; Make the screen scroll upwards automatically.
	SEP #$30	; 8-bit (accumulator).
	RTL
.down
	LDA #$02	;\ Make sure that new tiles are uploaded from the bottom of the screen
	STA $55		;/
	REP #$20	; 16-bit (accumulator).
	INC $1464|!addr	; Make the screen scroll downwards automatically.
	SEP #$20	; 8-bit (accumulator).
	RTL

otherbank1F:
.data
	db $00,$00,$00,$00,$00,$00,$00,$01,$00,$00,$00,$00,$00,$01,$00,$00,$00,$00,$01,$00,$00,$00,$01,$00,$00,$01,$00,$01,$00,$01,$00,$01
	db $00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01
	db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01
	db $00,$01,$00,$01,$00,$01,$00,$00,$01,$00,$00,$00,$01,$00,$00,$00,$00,$01,$00,$00,$00,$00,$00,$01,$00,$00,$00,$00,$00,$00,$00,$01

	db $00,$00,$00,$00,$00,$00,$00,$02,$00,$00,$00,$00,$00,$02,$00,$00,$00,$00,$02,$00,$00,$00,$02,$00,$00,$02,$00,$02,$00,$02,$00,$02
	db $00,$02,$00,$02,$00,$02,$00,$02,$00,$02,$00,$02,$00,$02,$00,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02
	db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$00,$02,$00,$02,$00,$02,$00,$02,$00,$02,$00,$02,$00,$02,$00,$02
	db $00,$02,$00,$02,$00,$02,$00,$00,$02,$00,$00,$00,$02,$00,$00,$00,$00,$02,$00,$00,$00,$00,$00,$02,$00,$00,$00,$00,$00,$00,$00,$02


If you want to customize the scrolling, you need to understand the '.data' table. The first four lines of the table are responsible for moving the camera up whereas the last four lines are responsible for moving the camera down. This is dictated by the following three values:

$00 means the camera will stop scrolling;
$01 means the camera will scroll up; and
$02 means the camera will scroll down.

The last four lines should have the same pattern as the first four lines, but with the $01's replaced with $02's, of course. Editing the table may be quite trial-and-error, but eventually you will get used to it.

One benefit of this code is that stationary sprites like piranha plants and shooters will follow layer 1 normally since the camera is being moved, not any layers. The other benefit is that it works fine with the vanilla auto-scrollers (though I don't recommend you to use the special auto-scrollers). However, the most important note is that you should disable vertical scrolling at will. The layer 2 auto-scroll UberASM you linked should theoretically work fine, but I didn't try it myself.

Hope this helps! If you have any more questions, I'll clarify them.


I still know next to nothing ASM wise, would I be inserting this as is(besides changing the speed it bobs at)?
Yeah, just insert as-is.
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

Originally posted by Anas
Yeah, just insert as-is.


I just needed to deal with the !base2 labels, and it worked out, so yeah this is perfect, thank you!
Originally posted by illusionhill
Originally posted by Anas
Yeah, just insert as-is.


I just needed to deal with the !base2 labels, and it worked out, so yeah this is perfect, thank you!


Oof, lemme fix that.
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

Your request has been automatically canceled and archived as it is older than 30 days and has not been claimed. More information on why this happens can be found here.

Please feel free to re-request it again by making a new thread, or request something else.

OpenASM