Banner
Views: 240,472,507
Time: 2013-06-18 07:25:12 PM
24 users online: aj6666, Aquas, Archie, Carld923, DayFour, Dipalon, f3popy, Golden Yoshi, o HuFlungDu, in3D, Jedi On Safari, King Dedede, kirbymaster1, Koopster, leod, mario and luigi, MarioBros980, Mariohacker14, mogwaimon, omegazeroINFI, Pixels, Reggie, o ShadowPhoenix, THY - Guests: 44 - Bots: 28Users: 23,079 (1,326 active)
Latest: f3popy
Tip: Try not to place secret exits at the very end of levels-- the player will basically have to go through the same level twice.
Layer 3 Background Question
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Layer 3 Background Question
Pages: « 1 »
How to put layer 3 background behind Layer 2 with Ersanio's LevelASM + INIT V1.4.
In levelinit, put in
Code
LDA.b #%00010011
STA $212C
LDA.b #%00000100
STA $212D


That should work.
I'm trying to put LevelASM Patch with xkas0.6, however the Rom have been crashed, how to get it to work.
Originally posted by MarioEdit
In levelinit, put in
Code
LDA.b #%00010011
STA $212C
LDA.b #%00000100
STA $212D


That should work.


That will cause some problems with the statusbar unless you use the sprite statusbar patch or this irq patch I made (witch if you do use be sure to change $212C to $0D9D and $212D to $0D9E). The game does not expect layer 3 to be in the subscreen, so it won't force it in the main screen with the statusbar. My patch fixed that(and copys the mainscreen/subscreen mirrors correctly).

I recommend this instead:
Code
LDA.b #%00010111
STA $212C
LDA.b #%00000000
STA $212D

But this will only work if the level's setting is set to not force layer 3 above everything.

Also, putting this stuff in levelinit instead of levelasm should work better.

I have no idea about the crash though. Maybe you forgot to return?
Last edited on 2011-04-23 12:05:41 PM by KilloZapit.
When I Patch it again The Black Screen is still shown when the SMW Intro is Playing.

Level ASM 1.4
Code
HEADER
LOROM

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Defines
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	!FreeSpace 	= $1D8000	;Point this to some free space in the ROM, preferably below bank $40
	!FreeRAM	= $010B		;<-- It is recommended that you do NOT edit this.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Levelnum.ips disassembly
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

ORG $05D8B9
	JSR Levelnummain

ORG $05DC46
Levelnummain:	LDA $0E  		;Load level number
		STA !FreeRAM		;Store it in free stack RAM
		ASL A    		;Multiply A by 2, probably to recover old code?
		RTS      		;Return from subroutine


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Hijack routine for LevelASM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

ORG $00A242|$800000
	JML MAIN : NOP

org $00A5EE|$800000
        JML INITStart ;Hijack INIT stuff

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;New main code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

ORG !FreeSpace|$800000

db "STAR"				;\
dw MainEnd-MainStart-$01		; |Write RATS tag #1 to protect main code
dw MainEnd-MainStart-$01^$FFFF		;/

MainStart:
MAIN:
	PHB				;\
	PHK				; |Setup program bank
	PLB				;/
	REP #$30			;16-bit AXY
	LDA !FreeRAM			;Load Level Number from stack
	ASL A				;x2
	TAX				;Transfer level # x2 into X
	LDA LevelASMTable,x		;Load table, indexed with X
	STA $00				;Store in $00 and $01
	SEP #$30			;8-bit AXY
	LDX #$00			;Clear X
	JSR ($0000,x)			;And jump to subroutine in pointers
	PLB				;Recover program bank
	LDA $13D4
	BEQ +
	JML $00A25B|$800000
+	JML $00A28A|$800000
INITStart:
        LDA !FreeRAM
        ASL A
        TAX
        LDA LevelInitTable,x
        STA $00
        SEP #$30
        LDX #$00
	PHB
	PHK
	PLB
        JSR ($0000,x)
	PLB
        PHK
        PEA.w RETURNADDR-1
        PEA $84CE
        JML $00919B

RETURNADDR:
	JML $00A5F3


Level INIT
Code
...
levelinit101:
	LDA.b #%00010111
	STA $212C
	LDA.b #%00000100
	STA $212D
	RTS
...


Status Bar IRQ
Code
header
lorom

org $808292
	JML PreStatusBar : NOP : NOP
org $8083AD
	JML PostStatusBar : NOP


!blockaddress = $9F8000
org !blockaddress		; address to put code
; -------------------------------------------
db "STAR"		; Write RATS tag
dw Endcodeblock-Startcodeblock
dw Endcodeblock-Startcodeblock~
; -------------------------------------------
Startcodeblock:		; code starts here
; -------------------------------------------

; Set Status Bar Scroll/Screen/Ect
PreStatusBar:
	; old
	LDY.b #$24               ; \  
	LDA $4211               ;  |(i.e. below the status bar) ; IRQ Flag By H/V Count Timer
	STY $4209               ;  | ; V-Count Timer (Upper 8 Bits)
	STZ $420A               ; /  ; V-Count Timer MSB (Bit 0)
	STZ $11
	LDA.b #$A1
	STA $4200               ; NMI, V/H Count, and Joypad Enable
	STZ $2111
	STZ $2111

	; new

	STZ $2112	
	STZ $2112	
	; Force status bar in main screen
	LDA $0D9D
	ORA.b #$04
	STA $212c
	; set level's Sub Screen
	LDA $0D9E 
	STA $212d
	; return to NMI
	JML $8082B0

PostStatusBar:
	; Set level's CGADSUB
	LDA $40
	STA $2131
	; restore level's normal Main Screen
	LDA $0D9D 
	STA $212c
	; return to IRQ handler
	JML $8083B2

; -------------------------------------------
Endcodeblock:		; code ends here	
; -------------------------------------------


Is there's a way to get the code right to work on my hack.

yczedit: there's really no need to post the 255 unused levelinit labels
Last edited on 2011-04-23 02:11:19 PM by yoshicookiezeus.
Waiittt.... that levelASM file doesn't seem to include the "incsrc" lines needed to make it work...
Originally posted by KilloZapit
Waiittt.... that levelASM file doesn't seem to include the "incsrc" lines needed to make it work...

It doesn't include the level table either, nor does it include the MAIN codes.
I prefer it that way, posting 500 lines of tables could get pretty spammy.
Yeah but my point is, where are they included? Maybe he used the wrong file or something...
Thanks, It's now working, However, the layer 3 BG scrolls the same way as layer 2 BG does, how to change it.
You probably would need to use level asm to alter the scroll rate manually I bet.

Try something like this:
Code
	REP #$20
	LDA $1462
	LSR
	LSR
	STA $22
	SEP #$20

Add more LSR lines to slow it down more, delete them to speed it up
Last edited on 2011-04-23 07:38:09 PM by KilloZapit.
Originally posted by KilloZapit

You probably would need to use level asm to alter the scroll rate manually I bet.

Try something like this:

Code
	REP #$20
	LDA $1462
	LSR
	LSR
	STA $22
	SEP #$20

Add more LSR lines to slow it down more, delete them to speed it up


Where do I put the these codes at the levelASM file at.
in main, in your level number
I put it in main & my level number, but layer 2 & layer 3 BG scrolling the same way, how to set it.
Pages: « 1 »
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Layer 3 Background Question

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

Copyright © 2005 - 2013 - SMW Central
Legal Information - Link To Us


Total queries: 29

Menu