Banner
The Overworld Design Contest ends in
1 MONTH, 5 DAYS, 12 HOURS, 47 MINUTES AND 11 SECONDS
Views: 897,639,568
Time:
18 users online: Alex_X8, Anas, Blizzard Buffalo, blocc,  brickblock369, chickaDEE Magazine, Copyright, detdu,  K.T.B., MarioriaM, Matt, mmBeefStew, MrDoubleA, RanAS, RollingRigatonis, Rykon-V73, Will331999, Wyatt - Guests: 89 - Bots: 88 Users: 50,361 (2,288 active)
Latest: jeyson28
Tip: If you give a Muncher tile custom graphics, it will still act like a coin when a silver P-switch is active, whether it looks like a coin or not. ExAnimation solves this problem.
Not logged in.
Layer 2 moving
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Layer 2 moving
Pages: « 1 » Link
hello, I have problems moving the layer 2, the code I'm using is this:

dcb "INIT"

RTL


dcb "MAIN"

PHB
PHK
PLB
JSR SpriteCode
PLB
RTL

;===================================
;Sprite Function
;===================================

RETURN: RTS


SpriteCode:


JSR Graphics

LDA $9D
BNE RETURN

REP #$20

LDA $1466
CLC
SBC #$0002
STA $1466

SEP #$20

RTS

;===================================
;Graphics Code
;===================================

Graphics:

RTS

And this code do nothing.
also use the Ram $1E but crash.

What am I doing wrong?

(google translate xDD).
------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
try SEC instead of CLC

though that shouldnt be the problem. Also, $1E should work (ive used it before in sprite code), so maybe you have something weird patched

if all else fails, then it's an easy code you can plop into levelasm rather than a sprite.
it doesn't work =(. its a new rom without patches.
------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
romi's spritetool? does the sprite outright crash the rom, or does it crash when you enter the level/screen it's on (when you use $1E)

also, since you're using TRASM format rather than xkas, a .W on the SBC may/may not make a difference (SBC.W #$0002). not sure how picky TRASM is with this stuff, but had you used xkas format it wouldnt (shouldnt) be a problem.


Did you remember to disable Layer 2 horizontal scroll to "none"? Otherwise, the game will automatically reset it's position.
If you want it to still scroll constantly, it's going to take a little more work, though I never managed to figure out how.

EDIT: Oh, also, if it's xkas that's giving you the error, make sure you remembered to expand the ROM first. If you do it with a clean, never-touched ROM, it won't work.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
with level.asm it's works
but when I use it on the screen appears strange line that moves along with the Layer 2.

https://dl.dropboxusercontent.com/s/z23aqmf1yr4rgpn/help.png?token_hash=AAFBpWj3NZvavyKO4wUL6p4ACqeFdWcJA_4mp5v7OnxXLw

also the option only works with none in the h-scroll, which makes the position still on the screen, is there a way to only move to the right in a free?

(google translate, my english is awfull).
------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
i can do it with a sprite in trasm, this code move the layer 2 as a earie, but its leads to appearance of glitched graphics:

dcb "INIT"

LDA #$00
STA $157C,x ;decide si sube o baja

REP #$20

LDA.w #$0000
STA.w $1923;posicion relativa al layer 1 en X del layer 2 inicia en 0
STA.w $1926;velocidad Y del layer 2 inicia en 0

LDA.w $1462
STA.w $1466;setea la posicion del layer 2 = a la posicion del layer 1

SEP #$20

RTL

;iniciaciones

dcb "MAIN"

PHB ;\
PHK ; | Change the data bank to the one our code is running from.
PLB ; | This is a good practice.
JSR SpriteCode ; | Jump to the sprite's function.
PLB ; | Restore old data bank.
RTL ;/ And return.

;===================================
;Sprite Function
;===================================

RETURN: RTS


SpriteCode:


JSR Graphics

LDA $9D ;\
BNE RETURN ;/ If locked, return.

REP #$20

LDA.w $1923
CLC
ADC.w #$0001
STA.w $1923;le sumo 1 a la posicion relativa en X
LDA.w $1462;pongo en el registro a el valor de la posicion del layer 1
CLC
SBC.w $1923;le sumo la posicion relativa en X
STA.w $1466;le seteo el valor a la posicion absoluta en X

SEP #$20

REP #$20

LDA.w $1926
CMP.w #$0009
BMI seguir1

SEP #$20

LDA #$01
STA $157C,x

REP #$20

seguir1:

REP #$20

LDA.w $1926
CMP.w #$FFF8
BPL seguir2

SEP #$20
STZ $157C,x


seguir2:

SEP #$20
LDA $157C,x
BEQ subir ;si es 0 sube si no baja

LDA $13
AND #$01
BEQ seguir3
JMP movY

seguir3:
REP #$20

LDA.w $1926
CLC
SBC.w #$0001
STA.w $1926

SEP #$20

JMP movY;le resta 1 a la velocidad en Y y salta a movY

subir:

REP #$20

LDA.w $1926
CLC
ADC.w #$0001
STA.w $1926

SEP #$20;le suma 1 a la velocidad en Y

movY:

REP #$20

LDA.w $1468
CLC
ADC.w $1926
STA.w $1468

SEP #$20;le suma la velocidad en Y a la posicion en Y

continuar:

RTS

;aca es un buen lugar para poner las sub rutinas

;===================================
;Graphics Code
;===================================

Graphics:

;inserte rutina grafica aca

RTS



how can i fix them?

Mod edit: Fixed image.
------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
The problem is this: https://www.youtube.com/watch?v=DL-ZirHQf_o

anyone know how to fix it?
------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
Pages: « 1 » Link
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Layer 2 moving

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2021 - SMW Central
Legal Information - Privacy Policy - Link To Us


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy
  • sm64romhacks