 |
|
 |
|
| HDMA Effects 1.0 |
|
Forum Index - SMW Hacking - Resource and Tool Releases - HDMA Effects 1.0 |
|
|
|
|
| Posted on 2010-10-03 10:02:08 AM |
Link | Quote |
|
After a long time thinking whether to release this or not I just decided to do so.
These files are mainly HDMA effects (gradients, wave effects, multiple background scrolling) ready to be inserted to your ROM with the usage of LevelASM 1.4 by Ersanio (detailed readme inside)
HDMA Bug Fixed 4.0 is included as well!!
Here are a few examples of gradients
Brightness Gradient

Fog Variant 1

Blue Gradient

Desert Gradient

Underwater Gradient

Yoshi's Island Gradient

And many more gradients! (Pictures inside as well)
Also some scrolling screenshots (sometimes hard to see though)
Horizontal Layer 1+2 Scrolling

Multiple Background Scrolling

Vertical Layer 1+2 Scrolling

And of course, the download link:
Grab it here.
Enjoy!
|
|
| Posted on 2010-10-03 10:20:54 AM |
Link | Quote |
|
These are awesome, Ice Man! =D
Just wondering though, would it be possible to mix the gradients with the Scrolling effects?
Say I want a level to utilize both the desert gradient, as well as Vertical Layer 1+2 Scrolling, what would I have to do then?
|
|
| Posted on 2010-10-03 10:28:55 AM |
Link | Quote |
|
Originally posted by SindJust wondering though, would it be possible to mix the gradients with the Scrolling effects?
Say I want a level to utilize both the desert gradient, as well as Vertical Layer 1+2 Scrolling, what would I have to do then?
It's possible as long as you have enough unused HDMA channels. I'm not sure how many unused channels SMW has, though. I think it's either 3 or 5 and some HDMA effects use multiple channels.
|
|
| Posted on 2010-10-03 10:33:41 AM |
Link | Quote |
|
Wow! I was waiting so long for these effects, and they were finally released! Thank you very much Ice Man!
I personally prefer to do JSL to the effect and put the effect on the end of Level ASM instead of putting the effects one by one in a freespace of my ROM. The advantage is to save 8 bytes of RATS tag per effect.
EDIT: Also, It's possible to use HDMA on the overworld, like you did in Toad's World?
|
| Last edited on 2010-10-03 10:36:25 AM by Yan. |
|
| Posted on 2010-10-03 10:34:10 AM |
Link | Quote |
|
Just make sure the HDMA channel you are using is free.
Example waves:
Code REP #$20 ;\ Set processor 16 bit
LDA #$0E02 ;| $4330 = $210E
STA $4330 ;| $4331 = Mode 02
LDA #$9E00 ;|
STA $4332 ;| Destination: $7F9E00
LDY #$7F ;| (low and high byte)
STY $4334 ;|
LDA #$1002 ;| $4340 = $2110
STA $4340 ;| $4341 = Mode 02
LDA #$9E00 ;|
STA $4342 ;| Destination: $7F9E00
LDY #$7F ;| (low and high byte)
STY $4344 ;|
SEP #$20 ;/ Set processor 8 bit
LDA #$18 ;\ Enable HDMA
TSB $0D9F ;/ on channel 3,4
As you can see it uses $433x and $434x but $435x is free. Using the blue,red or green gradients should work fine since they only use $435x for HDMA channel. Combining them is possible, just JSL to each in the current level.
Even if you would use mode $02 for the Yoshi's Island gradients, you still wouldn't be able to properly combine that with a wave effect, sadly, since other HDMA channels in SMW are taken already 
Mode $02 would look like this btw:
Code REP #$20 ;\ Set processor 16 bit
LDA #$3202 ;| $4330 = $2132
STA $4330 ;| $4331 = Mode 02
LDA #Color_Red_Green;| Get gradient pointer
STA $4332 ;| low and high byte
PHK ;| Get bank
PLY ;|
STY $4334 ;| Store to address bank
LDA #$3200 ;| $4350 = $2132
STA $4340 ;| $4351 = Mode 00
LDA #Color_Blue ;| Get gradient pointer
STA $4342 ;| low and high byte
STY $4344 ;| Store to address bank
SEP #$20 ;/ Set processor 8 bit
LDA #$18 ;\ Enable HDMA
TSB $0D9F ;| on channel 3,4,5
RTL ;/ Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Table Settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Color_Red:
db $08,$26,$4E
db $08,$27,$4F
db $08,$28,$50
db $08,$29,$51
db $06,$2A,$52
db $02,$2A,$53
db $03,$2B,$53
db $05,$2B,$54
db $08,$2C,$55
db $08,$2D,$56
db $04,$2E,$57
db $02,$2F,$57
db $02,$2F,$58
db $03,$30,$58
db $01,$30,$59
db $04,$31,$59
db $06,$32,$5A
db $05,$33,$5B
db $05,$34,$5C
db $08,$35,$5D
db $08,$36,$5E
db $06,$37,$5F
db $05,$38,$5F
db $05,$39,$5F
db $04,$3A,$5F
db $03,$3B,$5F
db $03,$3C,$5F
db $03,$3D,$5F
db $03,$3E,$5F
db $21,$3F,$5F
db $05,$3E,$5F
db $05,$3D,$5F
db $06,$3C,$5F
db $03,$3B,$5E
db $02,$3A,$5E
db $01,$3A,$5D
db $03,$39,$5D
db $01,$38,$5D
db $02,$38,$5C
db $04,$37,$5C
db $02,$36,$5B
db $03,$35,$5B
db $03,$34,$5B
db $02,$33,$5A
db $01,$32,$5A
db $08,$33,$5A
db $00
Color_Blue:
db $08,$95
db $08,$96
db $10,$97
db $08,$98
db $08,$99
db $10,$9A
db $18,$9B
db $08,$9C
db $08,$9D
db $08,$9E
db $01,$9F
db $05,$9E
db $05,$9D
db $06,$9C
db $08,$9B
db $0B,$9A
db $03,$9B
db $03,$9C
db $03,$9D
db $03,$9E
db $01,$9F
db $03,$9E
db $03,$9D
db $03,$9C
db $03,$9B
db $14,$9A
db $08,$99
db $08,$98
db $08,$97
db $0B,$96
db $00
Not only does it save space but also one HDMA channel. Oddly enough I haven't changed that in the package but that's not too much of a problem.
@RPGHacker: We can only use channel 3,4,5 as far as I know.
0,1,2 are used for VRAM uploading while 6,7 is used for DMA stuff (goal, windowing, etc). However, channel 6 seems to be unused on the overworld.
@Logup, of course it is possible using OWASM but you will have to change the RTL to RTS instead and for the waves you will use $1A-$22 instead of $1462-$1468 for layer 1 and 2 positions. Also, you won't save 8 bytes by using JSL. The RATS tag is pretty important unless you want another program to overwrite this code. D:
Edit: Feel free to download the latest version of OWASM here:
Download
This one saves everywhere, no more save prompts (disabled for HDMA effects).
Gradients etc can be used on the init routines while scrolling should be used in the main routines!
NOTE: Changing the brightness may only work in the main routines, not approved!
|
| Last edited on 2010-10-03 10:49:25 AM by Ice Man. |
|
| Posted on 2010-10-03 10:47:42 AM |
Link | Quote |
|
But the Level ASM already has a RATS tag. So all of these subcodes are protected, if I put all codes inside Level ASM. (Or am I mistaken?)
Also, I will try to put OWASM in my hack and see if this works.
|
| Last edited on 2010-10-03 10:50:48 AM by Yan. |
|
| Posted on 2010-10-03 10:50:53 AM |
Link | Quote |
|
|
LevelASM isn't the HDMA package. You will have to insert each effect to a different free spot, unless including the file(s) with LevelASM itself, then you can remove the RATS tag, of course.
|
|
| Posted on 2010-10-03 10:56:32 AM |
Link | Quote |
|
But that's what I mean:
Code
level2:
RTS
level3:
JSL HDMA_DIAGONAL_L1_WAVES
RTS
level4:
RTS
...
HDMA_DIAGONAL_L1_WAVES:
(hdma code here, without RATS and macros)

The HDMA is inside levelASM. Thus I would not be saving 8 bytes?
|
| Last edited on 2010-10-03 11:00:10 AM by Yan. |
|
| Posted on 2010-10-03 11:00:23 AM |
Link | Quote |
|
|
Ah, that works, too. Once specified in levelmain.asm or levelinit.asm with a label, you can remove the RATS tag and just JSL to that label, sure.
|
|
| Posted on 2010-10-03 11:43:06 AM |
Link | Quote |
|
It's possible to combine this Diagonal Layer 1 Waves effect with this gradient? And how I can learn to combine the channels of HDMA?
Code
LDA #$00
STA $4330
LDA #$02
STA $4340
LDA #$32
STA $4331
STA $4341
REP #$20
LDA.w #.Table2
STA $4332
LDA.w #.Table1
STA $4342
SEP #$20
LDA.b #.Table2>>16
STA $4334
LDA.b #.Table1>>16
STA $4344
LDA #$18
TSB $0D9F
RTS
.Table1
db $0B,$2E,$46
db $02,$2E,$47
db $0C,$2F,$47
db $08,$30,$47
db $0F,$30,$48
db $03,$31,$48
db $03,$32,$48
db $01,$32,$49
db $0A,$33,$49
db $09,$34,$49
db $0A,$35,$4A
db $09,$36,$4A
db $09,$37,$4B
db $01,$38,$4B
db $03,$38,$4C
db $03,$38,$4D
db $03,$38,$4E
db $03,$39,$4F
db $03,$39,$50
db $03,$39,$51
db $02,$3A,$52
db $03,$3A,$53
db $03,$3A,$54
db $02,$3A,$55
db $01,$3B,$55
db $02,$3B,$56
db $02,$3B,$57
db $03,$3B,$58
db $01,$3B,$59
db $01,$3C,$59
db $01,$37,$4B
db $02,$36,$4B
db $05,$36,$4A
db $06,$35,$4A
db $07,$34,$49
db $05,$33,$49
db $02,$33,$48
db $07,$32,$48
db $04,$31,$48
db $01,$30,$48
db $02,$30,$47
db $03,$2F,$47
db $03,$2E,$47
db $03,$2D,$47
db $01,$2C,$47
db $02,$2C,$46
db $03,$2B,$46
db $03,$2A,$46
db $04,$29,$46
db $02,$28,$46
db $01,$28,$45
db $04,$27,$45
db $03,$26,$45
db $09,$26,$46
db $00
.Table2
db $08,$8C
db $08,$8D
db $08,$8E
db $08,$8F
db $04,$90
db $0A,$91
db $10,$92
db $08,$91
db $07,$90
db $06,$8F
db $05,$8E
db $06,$8D
db $05,$8C
db $0C,$8B
db $12,$8C
db $0C,$8D
db $02,$8C
db $06,$8D
db $07,$8E
db $07,$8F
db $09,$90
db $0A,$91
db $07,$90
db $07,$8F
db $07,$8E
db $06,$8D
db $0F,$8C
db $00
|
| Last edited on 2010-10-03 11:44:14 AM by Yan. |
|
| Posted on 2010-10-03 11:46:54 AM |
Link | Quote |
|
Yes, the layer 1 waves effect can be combined with it.
As you can see the layer 1 waves uses $433x meaning channel 3. Your code uses $433x and $434x meaning channel 3 and 4.
Replace the code with:
Code LDA #$00
STA $4340
LDA #$02
STA $4350
LDA #$32
STA $4341
STA $4351
REP #$20
LDA.w #.Table2
STA $4342
LDA.w #.Table1
STA $4352
SEP #$20
LDA.b #.Table2>>16
STA $4344
LDA.b #.Table1>>16
STA $4354
LDA #$30
TSB $0D9F
RTS
Also, this is not my code at all that you are using.
|
|
| Posted on 2010-10-03 01:25:14 PM |
Link | Quote |
|
|
Woow, this is awesome, Ice Man! Now we can use more scrolling and waving HDMA! The readme helps a lot, it's nicely detailed. Great work!
|
|
| Posted on 2010-10-03 01:51:02 PM |
Link | Quote |
|
OK, I'm having a little trouble.
in levelcode.asm
Codelevel102:
JSL $329C00
in hdmaeffect.asm (actually the Horizontal Waves one)
Code
lorom ;\ ROM is LoRom
header ;| and has a header
org $329C00 ;/ Address to insert code
in hdma.asm
Code
org $3F8000 ;| CHANGE THIS TO SOME FREE SPACE!!!!
The BAT file I created reads xkas hdmaeffect.asm romname.smc (actually Mario.smc)
---------
I insert all of that into the ROM, but when I head to level 102 in the game itself, the damn thing just crashes on me (black screen, sometimes some screwy sounds.) As usual with me, it's probably something simple that I'm overlooking.
|
|
| Posted on 2010-10-03 01:54:49 PM |
Link | Quote |
|
|
This is really neat, Ice Man. And the instructions explain things nice and easy. One question though: For the backgroung scrolling and the automated version, how can I make it scroll from the bottom faster towards the top, being slow? In the one I've seen, it's the other way around.
|
|
| Posted on 2010-10-03 01:57:20 PM |
Link | Quote |
|
Yeah, I can see the error already.
Codelevel102:
JSL $329C00
If you properly read the readme you would know to add $08 bytes to the original inserted location for the RATS tag, meaning JSL $329C00 in levelcode.asm becomes JSL $329C08
@Ripperon. I'm not too sure but try replacing the LSR A with ASL A.
LSR A = Divide
ASL A = Multiplicate
However, ASL can be pretty fast and screw things up.
What you can do to is reverse the RAM registers used.
E.g.
CodeLDA $1466
STA $7F9B01
LSR A
STA $7F9B04
etc etc
with
CodeLDA $1466
STA $7FB004
LSR A
STA $7F9B01
etc etc
|
| Last edited on 2010-10-03 01:58:46 PM by Ice Man. |
|
| Posted on 2010-10-03 03:11:38 PM |
Link | Quote |
|
How I can reduce the speed of scrooling in all scanlines? LSR don't work for me. It loops every time the background.
Code
REP #$20 ;\ Set processor 16 bit
LDA #$0F02 ;| $4330 = $210F
STA $4330 ;| $4331 = Mode 02
LDA #$9B00 ;|
STA $4332 ;| Destination: $7F9B00
LDY #$7F ;| (low and high byte)
STY $4334 ;|
SEP #$20 ;/ Set processor 8 bit
LDA #$08 ;\ Enable HDMA
TSB $0D9F ;/ on channel 3
LDX #$12 ;| Data size ($0F bytes)
Loop:
LDA Scroll_Table,x ;\
STA $7F9B00,x ;| Load scoll range
DEX ;| table config
BPL Loop ;/
Start:
LDA #$DF ;\ Size of very 1st row
SEC ;| Size can be $C0-$FF
SBC $1468 ;| Enables auto-scrolling
INC A ;| for the range specified
STA $7F9B00 ;/
REP #$20 ;\ Set processor 16 bit
LDA $13 ;\ Speed how much
AND #$00FF ;| the range should scroll
ASL A ;| Scroll 4th row
STA $7F9B04 ;| slower than 3rd
CLC ;| not recommended!!
ADC $1466 ;| Scroll the row
AND #$01FF ;| automatically
STA $7F9B0D ;| at normal speed
ASL A ;| Scroll 2nd row
STA $7F9B0A ;| slower than 4th
ASL A ;| Scroll 3rd row
STA $7F9B07 ;| slower than 3rd
ASL A ;| Scroll 4th row
STA $7F9B04 ;| slower than 2nd
ASL A ;| Scroll 4th row
STA $7F9B01 ;| slower than 1st
SEP #$20 ;\ Set processor 8 bit
RTL ;/ Return
Scroll_Table:
db $10,$00,$00
db $20,$00,$00
db $20,$00,$00
db $07,$00,$00
db $08,$00,$00
db $81,$00,$00
RTS
|
|
| Posted on 2010-10-04 09:46:15 AM |
Link | Quote |
|
First of all, you do not need the RTS after the table. It's protected already and doesn't need to be returned.
Try replacing this:
Code LDA $13 ;\ Speed how much
AND #$00FF ;| the range should scroll
ASL A ;| Scroll 4th row
with:
Code LDA $13 ;\ Speed how much
AND #$00FF ;| the range should scroll
|
|
| Posted on 2010-10-04 12:07:06 PM |
Link | Quote |
|
|
I have a question. What would I do if I want scrolling on layer 3 rather than Layer 2? Or perhaps both?
|
|
| Posted on 2010-10-04 12:40:43 PM |
Link | Quote |
|
Assuming it's horizontal scrolling, this is what your code would look like for layer 3 and layer 2 + layer 3.
Layer 3 only:
Code;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;HDMA Multiple Background Scroll
;by Ice Man
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
lorom ;\ ROM is LoRom
header ;| and has a header
org $228000 ;/ Address to insert code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;RATS Tag Macro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
macro RATS_start(id)
db "STAR"
dw RATS_Endcode<id>-RATS_Startcode<id>
dw RATS_Endcode<id>-RATS_Startcode<id>^#$FFFF
RATS_Startcode<id>:
endmacro
macro RATS_end(id)
RATS_Endcode<id>:
endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;HDMA Channel Settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%RATS_start(0)
REP #$20 ;\ Set processor 16 bit
LDA #$1102 ;| $4330 = $2111
STA $4330 ;| $4331 = Mode 02
LDA #$9B00 ;|
STA $4332 ;| Destination: $7F9B00
LDY #$7F ;| (low and high byte)
STY $4334 ;|
SEP #$20 ;/ Set processor 8 bit
LDA #$08 ;\ Enable HDMA
TSB $0D9F ;/ on channel 3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;HDMA Main Code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LDX #$0C ;| Data size ($0C bytes)
Loop:
LDA Scroll_Table,X ;\
STA $7F9B00,X ;| Load scoll range
DEX ;| table config
BPL Loop ;/
Start:
REP #$20 ;\ Set processor 16 bit
LDA $22 ;| Scroll 1st row
STA $7F9B01 ;| at normal speed
LSR A ;| Scroll 2nd row
STA $7F9B04 ;| slower than 1st
LSR A ;| Scroll 3rd row
STA $7F9B07 ;| slower than 2nd
LSR A ;| Scroll 4th row
STA $7F9B0A ;| slower than 3rd
SEP #$20 ;| Set processor 8 bit
RTL ;/ Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Table Settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Scroll_Table:
db $38,$00,$00
db $38,$00,$00
db $38,$00,$00
db $38,$00,$00
%RATS_end(0)
Layer 2 + Layer 3:
Code;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;HDMA Multiple Background Scroll
;by Ice Man
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
lorom ;\ ROM is LoRom
header ;| and has a header
org $228000 ;/ Address to insert code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;RATS Tag Macro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
macro RATS_start(id)
db "STAR"
dw RATS_Endcode<id>-RATS_Startcode<id>
dw RATS_Endcode<id>-RATS_Startcode<id>^#$FFFF
RATS_Startcode<id>:
endmacro
macro RATS_end(id)
RATS_Endcode<id>:
endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;HDMA Channel Settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%RATS_start(0)
REP #$20 ;\ Set processor 16 bit
LDA #$0F02 ;| $4330 = $210F
STA $4330 ;| $4331 = Mode 02
LDA #$9B00 ;|
STA $4332 ;| Destination: $7F9B00
LDY #$7F ;| (low and high byte)
STY $4334 ;|
LDA #$1102 ;| $4330 = $2111
STA $4340 ;| $4331 = Mode 02
LDA #$9C00 ;|
STA $4342 ;| Destination: $7F9B00
LDY #$7F ;| (low and high byte)
STY $4344 ;|
SEP #$20 ;/ Set processor 8 bit
LDA #$18 ;\ Enable HDMA
TSB $0D9F ;/ on channel 3,4
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;HDMA Main Code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Layer 2
LDX #$0C ;| Data size ($0C bytes)
Loop:
LDA Scroll_Table,X ;\
STA $7F9B00,X ;| Load scoll range
DEX ;| table config
BPL Loop ;/
Start:
REP #$20 ;\ Set processor 16 bit
LDA $1466 ;| Scroll 1st row
STA $7F9B01 ;| at normal speed
LSR A ;| Scroll 2nd row
STA $7F9B04 ;| slower than 1st
LSR A ;| Scroll 3rd row
STA $7F9B07 ;| slower than 2nd
LSR A ;| Scroll 4th row
STA $7F9B0A ;| slower than 3rd
SEP #$20 ;| Set processor 8 bit
;Layer 3
LDX #$0C ;| Data size ($0C bytes)
Loop:
LDA Scroll_Table_2,X;\
STA $7F9C00,X ;| Load scoll range
DEX ;| table config
BPL Loop ;/
Start:
REP #$20 ;\ Set processor 16 bit
LDA $22 ;| Scroll 1st row
STA $7F9C01 ;| at normal speed
LSR A ;| Scroll 2nd row
STA $7F9C04 ;| slower than 1st
LSR A ;| Scroll 3rd row
STA $7F9C07 ;| slower than 2nd
LSR A ;| Scroll 4th row
STA $7F9C0A ;| slower than 3rd
SEP #$20 ;| Set processor 8 bit
RTL ;/ Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Table Settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Scroll_Table:
db $38,$00,$00
db $38,$00,$00
db $38,$00,$00
db $38,$00,$00
Scroll_Table_2:
db $38,$00,$00
db $38,$00,$00
db $38,$00,$00
db $38,$00,$00
%RATS_end(0)
Also, you may want to check this link to know which registers to use for scrolling: SNES Hardware Registers
|
|
| Posted on 2010-10-04 10:07:17 PM |
Link | Quote |
|
|
Thank you a lot Ice Man. I searched everywhere for hdma scrolling effects code without success, and here it is. I didn't want to use d4's hdma kit because it was buggy.
|
|
|
|
|
|
|
Forum Index - SMW Hacking - Resource and Tool Releases - HDMA Effects 1.0 |
|
|
 |
|
 |
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 UsTotal queries: 28
|
|
|
|