| Layer 3 Background Question |
|
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Layer 3 Background Question |
|
Pages: 1  |
|
|
|
| Posted on 2011-04-22 08:29:52 PM |
Link | Quote |
|
How to put layer 3 background behind Layer 2 with Ersanio's LevelASM + INIT V1.4.
|
|
| Posted on 2011-04-22 09:50:30 PM |
Link | Quote |
|
In levelinit, put inCodeLDA.b #%00010011
STA $212C
LDA.b #%00000100
STA $212D
That should work.
|
|
| Posted on 2011-04-22 10:23:49 PM |
Link | Quote |
|
|
I'm trying to put LevelASM Patch with xkas0.6, however the Rom have been crashed, how to get it to work.
|
|
| Posted on 2011-04-23 12:01:35 PM |
Link | Quote |
|
Originally posted by MarioEditIn levelinit, put in CodeLDA.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: CodeLDA.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. |
|
| Posted on 2011-04-23 01:06:30 PM |
Link | Quote |
|
When I Patch it again The Black Screen is still shown when the SMW Intro is Playing.
Level ASM 1.4
CodeHEADER
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 INITCode...
levelinit101:
LDA.b #%00010111
STA $212C
LDA.b #%00000100
STA $212D
RTS
...
Status Bar IRQCodeheader
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. |
|
| Posted on 2011-04-23 01:24:28 PM |
Link | Quote |
|
|
Waiittt.... that levelASM file doesn't seem to include the "incsrc" lines needed to make it work...
|
|
| Posted on 2011-04-23 01:36:30 PM |
Link | Quote |
|
Originally posted by KilloZapitWaiittt.... 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.
|
|
| Posted on 2011-04-23 02:48:31 PM |
Link | Quote |
|
|
Yeah but my point is, where are they included? Maybe he used the wrong file or something...
|
|
| Posted on 2011-04-23 02:52:43 PM |
Link | Quote |
|
|
Thanks, It's now working, However, the layer 3 BG scrolls the same way as layer 2 BG does, how to change it.
|
|
| Posted on 2011-04-23 07:37:47 PM |
Link | Quote |
|
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. |
|
| Posted on 2011-04-24 09:25:48 AM |
Link | Quote |
|
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.
|
|
| Posted on 2011-04-24 02:25:03 PM |
Link | Quote |
|
|
in main, in your level number
|
|
| Posted on 2011-04-27 11:17:28 AM |
Link | Quote |
|
|
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 |