Language…
15 users online:  Anorakun, bd90492,  bebn legg,  DeppySlide, E-man38, FrozenQuills,  idol, IronFoxGaming, Julintendo, LooneySMW, Nimono,  Segment1Zone2, Skewer,  TickTockClock, tjb0607 - Guests: 115 - Bots: 117
Users: 56,287 (2,249 active)
Latest user: rofflecopterful

Horizontal/Vertical Level Wrap

UberASM Repository → Horizontal/Vertical Level Wrap

Submission Details

Name: Horizontal/Vertical Level Wrap
Author: Thomas
Added:
Type: Level
Includes GFX: No
Includes Hijack: Yes
Featured: No
Description: This contains two level routines to wrap Mario/sprites when they cross certain edges of the screen.

One of the routines handles horizontal level wrapping (which links the top and bottom of the screen), while the other handles vertical level wrapping (which links the left and right edges). The latter requires a small additional patch in order to work correctly.

Tester's note: do not use the horizontal wrap with the vertical scroll enabled.
Tags: lorom sa-1
Comments: 20 (jump to comments)
Rating:
5.0 (2 ratings)
No rating
Download 2.18 KiB | 1,562 downloads

Screenshots

View all

Comments (20)

TheBiob Link
Seems like the load code for VertWrap doesn't always set the background position correctly on some scroll settings which can cause snapping at the start. Here's some code that uses LMs settings to set the background position you can use instead:

Code
Load:
	REP #$20
	LDA #!levelShift
	STA $1A
	STA $1462|!addr
	PHK
	PEA .return-1
	PHK
	LDY.b #!bank>>16 : PHY : PLB
	JML $00F79D|!bank
.return
	SEP #$20
	STZ $1411|!addr
	SEC : ROR $1B96|!addr
	RTL
 Thomas Author Link
Originally posted by Yoshioshi59_
it crashes whenever i insert it and i already rremoved one_screen. am i not removing one_screen correctly because i cant think of any other reason

Make sure that you remove the hijack from the single screen code via the following steps, in order:
1) Delete lines 30-42 in one_screen.asm (from the pushpc up to just before the init label).
2) Apply remove.asm from the single screen code.
3) Reapply VertWrapPrep.asm from this code.
4) Reapply UberASM to your ROM.

If that doesn't fix it, either something else is hijacking the same spot (would be something involving passing over the left/right side of the screen), or something you tried when trying to remove the one screen code didn't work correctly and you'll have to restore your hack to an earlier state. If you're not familiar with how to do that, look in LM under File -> Restore -> Restore ROM to Previous State.
Yoshioshi59_ Link
i removed every uberasm patch other than this and inserted the vertwrapprep but vertwrap still crashes the game right after i start it
Yoshioshi59_ Link
it crashes whenever i insert it and i already rremoved one_screen. am i not removing one_screen correctly because i cant think of any other reason
bersi Link
Is there a way to make fireballs work with vertical wrapping?
bucketofwetsocks Link
Originally posted by Nowieso
Are there any known incomatible patches when inserting the VertWrapPrep patch? It teleports me whenever I touch any custom block back to the overworld, and inserting the patch again makes my ROM crash.


I am experiencing the exact same. Does anyone know of a fix?

EDIT: Nevermind! Thanks @Thomas for posting a fix for also using one_screen.asm in the same patch. I initially thought that only applied to using both in the same level.
GrumpyWalrus Link
Is it possible to have the vertical level wrap screen scroll before wrapping? So on a standard vertical level, you could use screen 1A and 1B before it wraps back to 1A?
 Thomas Author Link
Originally posted by Nowieso
Are there any known incomatible patches when inserting the VertWrapPrep patch? It teleports me whenever I touch any custom block back to the overworld, and inserting the patch again makes my ROM crash.

The only one I know of is Biob's single-screen UberASM code, which applies a similar code to mine in order to allow moving off the side of the screen. If you're having issues due to that one, my code already handles the case his was written for so you can fix it by just opening one_screen.asm and deleting lines 30-42 before reinserting. Then, apply his remove.asm file to clean up his code and reapply the VertWrapPrep.asm file from this code.
Nowieso Link
Are there any known incomatible patches when inserting the VertWrapPrep patch? It teleports me whenever I touch any custom block back to the overworld, and inserting the patch again makes my ROM crash.
MagmaMouse Link
is there a way to make it so when a boss is cleared, the horz wrap doesnt kill you?
HammerBrother Link
If this was in 3D, and renders portals, you'll get Manifold Garden, where you'll see repeating structure repeating into the distance.
Koop the Koopa Link
#smw{:TUP:}
shidouri Link
Can someone assist me in getting this up and running?

I used UberASM Tool to add the HorzWrap ASM to a clean SMW ROM (ran once in LM and saved).

I edited my list.txt to:
Code
; Level list. Valid values: 000-1FF.
level:
105		HorzWrap.asm
106		HorzWrap.asm


Ran the tool, responded with:

Code
Building Level ASM...

Processing binary file 'HorzWrap.asm':
  warning: (W1001): Relative patch file path passed to asar_patch_ex() - please
use absolute paths only to prevent undefined behavior!
  Inserted at $909CC7 (PC: 0x81ec7)
  Insert size: 118 (0x76) bytes
  INIT: NULL    - MAIN: $909CC7

Processing binary file 'HorzWrap.asm':
  Insert size: zero bytes

Total 2 files processed.

Total files insert size: 118 (0x0076) bytes
asm/temp.asm:13: warning: (W1001): Relative patch file path passed to asar_patch
_ex() - please use absolute paths only to prevent undefined behavior!
Main patch insert size: 6863 (0x1ACF) bytes

Total: 6981 (0x1B45) bytes

Codes inserted successfully.
Press any key to continue...



...and yet nothing has changed when running the ROM.

Have I missed a vital step?
FragOnCrack Link
Its great so far. I noticed that mario falls off Platforms (f.e. Timed lifts) while vertical wrapping. Other than that super nice!
 Thomas Author Link
Originally posted by Niiiiiiiiiiko
Non SA-1 Ver? :(

It's already non-SA-1 compatible. The SA-1 tag just means it can work with either.
Vivian Darkbloom Link
oh nice, we have vertical level wrapping that isn't janky now!
 Niko0902 Link
Non SA-1 Ver? :(
HammerBrother Link
Noticed an error on the sprite handling:

Code
WrapSprites:
	LDX #$0B


There are 12 sprite slots in vanilla SMW, but for SA-1, there is 22 sprite slots. Change LDX #$0B to LDX.b #!sprite_slots-1 so it is truly a hybrid. The define !sprite_slots is located inside other/macro_library.asm

Best combined with the Level Constrain patch to prevent potential clipping into blocks depending on the Y position of the bottom that teleports the player to the top in horizontal levels if you need the warp at such position. This happened on the original horizontal level wrap sprite generator, where you position yourself so close to the bottom warp as small mario or big crouching mario and can go under the blocks before teleporting. Another thing I recommend is using BMI/BPL instead of BCC/BCS should the user want the teleport barrier be past the top/left of the area.
 Ayami Link
smw hacking is saved

thanks!
Romano338 Link
I've been waiting for this for a loooonnnggg time!!