| Comprehensive HDMA guide |
|
Forum Index - SMW Hacking - General SMW Hacking Help - Tutorials - Comprehensive HDMA guide |
|
|
|
|
| Posted on 2010-04-07 03:44:31 PM |
Link | Quote |
|
Originally posted by SLHey Kaijyuu... if I have well understood you code, it's like:
Indirect
RAM RAM
scanline count + pointer [updating] value depending on layer X/Y position [updating]
I find my method (the one you can see in my numerous PMs :p) a bit easier (and faster?):
Indirect
ROM RAM
scanline count + pointer [frame depending] value depending on layer X/Y position [updating]
What's your opinion about this?
The indirect table can go in ROM or RAM, it doesn't matter. I stuck it in RAM here because I changed it a lot to produce the effect. Were I to not modify it in-game, I probably would've left it in ROM.
QuoteAlso, I didn't understand how you avoid the "changing table glitch" without double-buffering...
I didn't avoid it, actually. It still happens, It's just that the glitch here is mostly unnoticeable.
Difficult to explain exactly why it's not noticeable... The scanline count that is changed is near the top of the screen. However, levelasm code is done near the middle of the screen. Both have to be done at the same time for a noticeable glitch to occur, otherwise you just have a small one like here, where I think all that happens is a single scanline is skipped.
|
|
| Posted on 2010-04-07 03:58:41 PM |
Link | Quote |
|
Oh ok...
I definitely find my method easier :p
Last question: while double-buffering, isn't that true that you have small lateness of one frame? I mean, the table is uploaded frame X, but is really loaded with HDMA at frame X+1, so there's a sort of latency?
|
|
| Posted on 2010-04-07 04:00:30 PM |
Link | Quote |
|
|
Yes, very true.
|
|
| Posted on 2010-05-13 07:24:16 PM |
Link | Quote |
|
|
I pasted one of the codes directly into LevelASM and inserted with Xkas. When I opened up the ROM in my emulator, I heard the music but nothing was on the screen. I put the HDMA on C7, the title screen level. Any help? P.S. I used the 3rd code for a color gradient.
|
|
| Posted on 2010-07-11 01:01:52 PM |
Link | Quote |
|

Could you make a easy code, the darkness is only at the top?
|
|
| Posted on 2010-07-11 01:21:09 PM |
Link | Quote |
|
QuoteCould you make a easy code, the darkness is only at the top?
Code REP #$20 ; 16 bit A
LDA #$0000 ; $43X0 = 00
STA $4330 ; $43x1 = 00
LDA #LVL1BRIGHT ; get pointer to brightness table
STA $4332 ; store it to low and high byte pointer
PHK ; get bank
PLY ;
STY $4334 ; store to bank pointer byte
SEP #$20 ; 8 bit A
LDA #$08 ; Enable HDMA on channel 3
TSB $0D9F ;
RTS ; return
LVL1BRIGHT:
db $03,$00
db $03,$01
db $03,$02
db $03,$03
db $03,$04
db $03,$05
db $03,$06
db $03,$07
db $03,$08
db $03,$09
db $03,$0A
db $03,$0B
db $03,$0C
db $03,$0D
db $03,$0E
db $80,$0F
db $80,$0F
db $80,$0F
db $80,$0F
db $80,$0F
db $80,$0F
db $80,$0F
db $80,$0F
db $80,$0F
db $80,$0F
db $80,$0F
db $80,$0F
db $80,$0F
db $80,$0F
db $80,$0F
db $00
|
|
| Posted on 2010-08-17 05:12:52 PM |
Link | Quote |
|
|
How could one go about making a translucent color gradient that appears above Layer 1, Layer 2 and sprites, similar to the darkness gradient in the examples? What I would like to pull of is some sort of fiery glowing effect that would appear over everything at the bottom of the screen.
|
|
| Posted on 2010-08-17 06:18:20 PM |
Link | Quote |
|
That would require some color addition and stuff. Try this code:
LDA #$2F
STA $40
LDA #$02
STA $44
LDA #$1F
STA $0D9D
LDA #$00
STA $0D9E
It'll mess up sprite priorities iirc. I'm not sure how to go about fixing that. Try messing around with the underlined numbers, right now all layers go to the mainscreen.
|
|
| Posted on 2010-08-21 12:04:33 PM |
Link | Quote |
|
|
Thanks for the code everest700
|
|
| Posted on 2010-09-07 08:23:17 PM |
Link | Quote |
|
|
I'm trying to use the wavy background code, but it says level6 is already used. Same thing with levelinit6.
|
|
| Posted on 2010-09-09 12:31:16 AM |
Link | Quote |
|
Change the labels to something unique. I was lazy and copy/pasted code from my levelasm
|
|
| Posted on 2010-09-16 09:08:09 PM |
Link | Quote |
|
Originally posted by KaijyuuIf BRA only means woman's underwear to you, then you need to go look up an ASM tutorial.
Bra = Underwear?
|
|
| Posted on 2010-09-17 03:43:47 AM |
Link | Quote |
|
Most the time, yes.
|
|
| Posted on 2010-09-18 03:53:11 AM |
Link | Quote |
|
Originally posted by Kaijyuu
Most the time, yes.

-No Responce-
|
|
| Posted on 2011-08-07 02:46:24 AM |
Link | Quote |
|
Wow this tutorial...
I've searched so long and finally...
YOU JUST ROCK!!!
|
| Last edited on 2011-08-08 09:36:56 AM by Torchkas. |
|
| Posted on 2011-08-09 05:50:27 AM |
Link | Quote |
|
Here's a question: Can you have to HDMA in one level?
- BlackMageMario
|
|
| Posted on 2011-08-09 07:18:34 AM |
Link | Quote |
|
Yes that's possible via levelASM.
Actually it's only possible via levelASM or a generator.
This is for making your own HDMA you know.
|
|
| Posted on 2011-08-15 02:04:09 PM |
Link | Quote |
|
Originally posted by BlackMageMarioHere's a question: Can you have to HDMA in one level?
- BlackMageMario
In terms of gradients, you can really only have 1 per level (excluding a brightness gradient), since having more than 1 color gradient seems kinda silly. You can definitely have, say, wavy HDMA and a color gradient in the same level, though.
(this is assuming you mean "two" and not "to")
|
|
| Posted on 2012-03-07 02:03:48 PM |
Link | Quote |
|
I am at the beginnig of learning HDMA coding. Is it normal that the regs.txt file is so messed up? I canīt look through this mess... And how many scanlines has a screen. I
|
| Last edited on 2012-03-08 09:42:30 AM by Vink. |
|
| Posted on 2012-03-19 06:08:30 PM |
Link | Quote |
|
regs.txt looks complicated to anyone. The average person doesn't really need to know everything on it anyways.
A screen is usually 224 scanlines (E0), pretty much the height of a ZSNES snapshot.
|
|
|
|
|
|
|
Forum Index - SMW Hacking - General SMW Hacking Help - Tutorials - Comprehensive HDMA guide |