Language…
20 users online: akawo, Alex No, CroNo, DanMario24YT, Fullcannon, Gemini0, Golden Yoshi, Gulaschko, Hammerer, kurtistrydiz,  MarioFanGamer, MarkVD100, Maw, mtheordinarygamer, rafaelfutbal, Rykon-V73, Spedinja, steelsburg, superbot12, Tulip Time Scholarship Games - Guests: 284 - Bots: 494
Users: 64,795 (2,370 active)
Latest user: mathew

Single Screen v1.2

UberASM Repository → Single Screen v1.2

Submission Details

Name: Single Screen v1.2
Author: TheBiob
Added:
Version History: View
Type: Level, Game Mode
Includes GFX: No
Includes Hijack: Yes
Featured: No
Description: This will make the game only show one screen and scroll to the next when the player reaches it.

Uses 4 bytes of freeram as well as a hijack to disable the invisible screen barriers.

V1.1 Changes
Now works with LM3 level sizes
Start can optionally be aligned to a screen but isn't required to anymore
Options to disable horizontal/vertical scrolling separately
More options to change the size of the screen/when the scrolling triggers
Removed the "code per screen" feature since I think it doesn't really work with big level sizes*

V1.2 Changes
Fixed graphics bugging out when pausing the game during a screen transition.
You can choose between pausing the transition or not allowing to pause during transitions.

(Requested by Final Theory)

*yeah, I'm just lazy, if you need that feature you probably know what you're doing anyway so add it yourself.

Note: for best results, combine with the sprite scroll fix patch (be sure to change the default free RAM). Without this, sprites may not spawn when the screen is scrolled leftwards.
Tags: horizontal lorom sa-1 screen scrolling scrolling
Comments: 37 (jump to comments)
Rating:
3.0 (1 rating)
No rating
Download 2.33 KiB | 889 downloads

Screenshots

Comments (37)

MarcosMoutta Link
the sprite scroll fix patch literally breaks this
why would you tell people to use that
bucketofwetsocks Link
Thank you @Koopster for posting your fix for the damage routine!
HammerBrother Link
Uhh, there are some issues with the lock flag ($9D), when taking damage, somehow $9D is set to ZERO every frame, near the end of the file:
Code
.done
if !DEF_blackout == !true
	LDA #$0F
	STA $0DAE|!addr
endif
	STZ $9D	; > Unpause game
RTL

assert !DEF_screen_width%!DEF_horz_scroll_speed == 0, "The horizontal scroll speed must be divisible by the screen width."
assert !DEF_screen_height%!DEF_vert_scroll_speed == 0, "The vertical scroll speed must be divisible by the screen height."


You didn't make sure that it only does this once (not constantly (every frame)). If you look at my screen scrolling pipes, the code that returns Mario back to normal does this once is by having the revert code reset the RAM state (sets it to #$00). On the next frame, upon executing uberasm tool code again, it first checks if the RAM state is (already) $00, then skip all that code (including clearing out $9D, the controls, etc.):


You should also note that uberasm tool's level and gamemode 14 executes just before executing $00CDE8 (only runs if $71 isn't $0B), which will later process sprites afterwards. Meaning if you just set $9D, it won't freeze sprites, unless you perform a similar move what I did on setting $71 without messing up the HDMA:
Code
	org $00C5CE				;\fix hdma issues (like message box) when setting
		autoclean JSL FixHDMA		;/$7E0071 to #$0B ($00cde8 constantly sets $9D to $00 when $71 is $00.).
		NOP #4
;...
FixHDMA: ;>JSL from $00C5CE
	LDA $0D9B|!addr
	CMP #$C1
	BNE .NormalLevel

	.BowserFight
	;Restore code
	STZ.W $0D9F|!addr		;>no HDMA!
	LDA.B #$01			;\
	STA.W $1B88|!addr		;/ message box is expanding

	.NormalLevel
	RTL

If you don't want these issues, consider this instead.
Masked Man Link
Reminds of Super Mario Bros. Special, as well as the Legend of Zelda.
MarsAmPear Link
Originally posted by TheBiob
Originally posted by mateochips
I think that the hijack for this asm and the prep patch for Horizontal/Vertical Level Wrap have conflicts, and I've found a weird and very specific problem as a result: in levels with vertical wrap, trying to use a wall-running triangle activates side exit. lol

They do conflict, the vert wrap hijack is a more general version which includes the condition this one uses so you should be able to remove the hijack in this one and have it work fine if you've patched the level wrap one.

Commented it out and everything seems to indeed work fine. Thanks #smw{:TUP:}
 Kevin Link
Originally posted by mateochips
I think that the hijack for this asm and the prep patch for Horizontal/Vertical Level Wrap have conflicts, and I've found a weird and very specific problem as a result: in levels with vertical wrap, trying to use a wall-running triangle activates side exit. lol

Yeah, don't patch the VertPrep file and in the vertical wrap uberasm file change "SEC : ROR $1B96|!addr" to "LDA #$AC : STA $1B96|!addr".
TheBiob Author Link
Originally posted by mateochips
I think that the hijack for this asm and the prep patch for Horizontal/Vertical Level Wrap have conflicts, and I've found a weird and very specific problem as a result: in levels with vertical wrap, trying to use a wall-running triangle activates side exit. lol

They do conflict, the vert wrap hijack is a more general version which includes the condition this one uses so you should be able to remove the hijack in this one and have it work fine if you've patched the level wrap one.
MarsAmPear Link
I think that the hijack for this asm and the prep patch for Horizontal/Vertical Level Wrap have conflicts, and I've found a weird and very specific problem as a result: in levels with vertical wrap, trying to use a wall-running triangle activates side exit. lol
 Kevin Link
While this works fine in in horizontal levels (normal and tall), it doesn't seem to work vertically in standard vertical levels. A temporary fix is to add this at the start of main:
Code
	lda $5B
	lsr
	bcc +
	stz $0E
	lda $5F
	sta $0F
	bra ++
+	rep #$20
	lda $13D7|!addr
	sta $0E
	sep #$20
++

then replace "CMP $13D7|!addr" later in the code with "CMP $0E" (apparently LM doesn't set $13D7 to a meaningful value in vertical levels).
 Thomas Link
Originally posted by BrownBuddy
I am having difficulty with getting the vertical scroll to work while horizontal scroll works fine. Does anyone have any ideas why this would happen? I'm guessing its something to do with the !RAM_l1VertTo?

Make sure you have a big enough area for the screen to scroll to. The patch won't scroll vertically if the screen would end up outside the level by doing so (you will have to use horizontal level modes with at least a vertical height of 0x20 tiles to do this with the default settings). If you're trying to get it to scroll downwards, keep in mind that the bottom of the level is also limited by the last screen an object is placed on, similar to vertical levels; to make sure the level scrolls downward to the size you see in LM, just stick a single object somewhere at the very bottom of the level.
BrownBuddy Link
I am having difficulty with getting the vertical scroll to work while horizontal scroll works fine. Does anyone have any ideas why this would happen? I'm guessing its something to do with the !RAM_l1VertTo?
TheBiob Author Link
Originally posted by Deeke
Originally posted by Deeke
There's only one thing I want to bring up:

Guess I'm not done with requests. Is there any way to make it so that the the screen transitions only horizontally or vertically, and otherwise scrolls as normal?


The code already allows that. Check the asm for customization options.


Originally posted by Koopster
I was having trouble with the death routine as well which I initially though was a free RAM conflict, but it wasn't the case. I'm not sure if this is a retry exclusive issue, but death sets $9D to #$30 and this patch immediately sets to #$01, and I tracked that down as the reason why Mario's animation counter went bonkers. I fixed this issue by adding the following check under main:

Code
LDA $9D
CMP #$30
BNE +
RTL
+

edit: this doesn't only affect death, but any other instances of the original game setting its freeze flag as well. I came up with another fix. Under main:, replace the first LDA #$01 with:

Code
LDA $9D
BEQ +
EOR #$FF
BEQ +
RTL
+
LDA #$FF

I don't think the original game ever sets the value #$FF, so this should be safe. The problem here is that this code always clears the freeze flag when it ends, so that last snippet should stop it from running at all if the game is already frozen for another reason.


Interesting, can't say I've ever ran into problems with it but I guess that makes sense. I'm not sure that check takes everything into account but neither do I know why the retry uses $9D for anything death related in the first place.

The way it currently sets $9D was never optimal in the first place, I was just too lazy to come up with a better way so that's something I should probably look into if I ever decide to work on this again.
 Deeke Link
Originally posted by Deeke
There's only one thing I want to bring up:

Guess I'm not done with requests. Is there any way to make it so that the the screen transitions only horizontally or vertically, and otherwise scrolls as normal?
 Koopster Link
I was having trouble with the death routine as well which I initially though was a free RAM conflict, but it wasn't the case. I'm not sure if this is a retry exclusive issue, but death sets $9D to #$30 and this patch immediately sets to #$01, and I tracked that down as the reason why Mario's animation counter went bonkers. I fixed this issue by adding the following check under main:

Code
LDA $9D
CMP #$30
BNE +
RTL
+

edit: this doesn't only affect death, but any other instances of the original game setting its freeze flag as well. I came up with another fix. Under main:, replace the first LDA #$01 with:

Code
LDA $9D
BEQ +
EOR #$FF
BEQ +
RTL
+
LDA #$FF

I don't think the original game ever sets the value #$FF, so this should be safe. The problem here is that this code always clears the freeze flag when it ends, so that last snippet should stop it from running at all if the game is already frozen for another reason.
TheBiob Author Link
Originally posted by FedoraFriday
While I like this patch, I just find it far too buggy (for my ROM anyway). I tried removing it by just running it with UBERASM and removing it from the level, but doing so crashes the game on load-up. If I leave it as is its fine, if I move it to another level ID its fine, but as soon as I take it out or modify it somehow it crashes the game. Also it does something funky with the death routine, not sure whats going on.


I'd recommend reading the readme included in the download #tb{;)}
This uberasm applies a small hijack for the screen barrier which needs the "remove.asm" patch to be properly removed



Don't know about the death routine being buggy, might be a freeram conflict, this uberasm uses a pretty common freeram address so not changing it might lead to issues
FedoraFriday Link
While I like this patch, I just find it far too buggy (for my ROM anyway). I tried removing it by just running it with UBERASM and removing it from the level, but doing so crashes the game on load-up. If I leave it as is its fine, if I move it to another level ID its fine, but as soon as I take it out or modify it somehow it crashes the game. Also it does something funky with the death routine, not sure whats going on.
 Koopster Link
Thank you so much for this!
 Deeke Link
This is a fantastic routine, and it's surprisingly great for cutscenes.
There's only one thing I want to bring up: the "cut to black" setting feels too jarring. Could there be an option to make it fade to black and back very quickly (or any configurable time)?
AuraDee Link
Tested with BSNES v87 (BizHawk), LM 3.11, SA-1 v1.32, UberASM Tool 1.4.
Works as intended, accepted.
 Thomas From older version: Single screen v1.1 Link
Originally posted by Stiviboy
doesn't work with the airjump uberasm.

Probably because they share the same free RAM (both use $60). Change the free RAM address for one of them to another empty address and that should fix it.
(you should check this by default when combining pretty much any uberasm codes, as many use the same free RAM addresses)
 Stivi From older version: Single screen v1.1 Link
doesn't work with the airjump uberasm.
 Thomas From older version: Single screen v1.1 Link
Seems to work perfectly. Also added SA-1 support, along with a readme to direct to the sprite scroll fix patch in case people don't see the note in the description/comments.
Tested with: LM 3.04, UberASMTool 1.4, SA-1 1.32, Snes9x 1.60.
Nowieso From older version: Single screen v1.1 Link
Here is a bug I want to report:

If you pause while the screen scrolls, you get stuck between the two screens and all sprites despawn.
TheBiob Author From older version: Single screen v1.1 Link
Or change them in the screen scrolling pipes but yeah, the default addresses are pretty commonly used as some kind of general purpose freeram among resources.
Nowieso From older version: Single screen v1.1 Link
Using this ends up in a softlock when the screen scrolls for me.
Using Lunar Magic 3.04.

Edit:
Fixed. If you use the Screen Scrolling Pipes, you can not use the default freeRAM. Replace them with these if you have any issues with this code:

Code
!RAM_l1HorzTo = $0F3A	; 2 byte freeram
!RAM_l1VertTo = $0F3C ; 2 byte freeram



zacmario From older version: Single screen Link
I wish this had a gif :(
JP32 From older version: Single screen v1.1 Link
Use this patch additionally if you have problems with sprites not spawning.
System64 From older version: Single screen Link
Thank you! it works! Can I downgrade the version of Lunar Magic without errors, glitches, ... with my hack?
TheBiob Author From older version: Single screen Link
Yeah, it's a Lunar Magic 3.xx issue, to make it work in the standard sized levels change the !RAM_locked freeram to something else, usually the default is free but the new scrolling system uses it so it breaks.
Most likely won't work for any of the new level sizes, still want to fix that at some point, but that might take a while.
System64 From older version: Single screen Link
I have softlockes when I go to the next or previous screen. How can I fix that please? Thanks!
FedoraFriday From older version: Single screen Link
Slight overlook: if you are in a sliding animation while the screen is scrolling, you will be sent back to the previous screen and get softlocked. Or, an enemy can come kill you or something. If you’re using this patch, don’t have any levels where you slide around. :P
mish1 From older version: Single screen Link
Is it similar to like the NES Megaman games?
TheBiob Author From older version: Single screen Link
You can remove everything related to !RAM_l1VertTo.

This should work.
 Hobz From older version: Single screen Link
awesome stuff, works great! Is there a way to disable the vertical scrolling, so it only scrolls horizontally?
 HuFlungDu From older version: Single screen Link
This is cool as shit.

Updated for SA-1 compatibility.

Be sure if you are using this to watch every entrance to the level, not just the main one. If any entrance is off center from a screen boundary, it will create garbage tiles.
HammerBrother From older version: Single screen Link
Gif please?
Final Theory From older version: Single screen Link
YES! Thank you so much!