Language…
8 users online:  Atari2.0, Cristian Cardoso, Isikoro, marvisjj, masl, RenkoV2, SpacePea,  Telinc1 - Guests: 243 - Bots: 330
Users: 64,795 (2,377 active)
Latest user: mathew

Overworld HDMA?

I see it in a lot of hacks, but I don't see any tools used to do it. How can I have HDMA gradients in my overworld and submaps?
your simplistic human mind cannot possibly comprehend the complexities of my thoughts


Overworld HDMA is basically done the same as level HDMA: either use EffecTool to generate the code or write it yourself, then insert it with UberASM and run it for that submap (there's a space in the 'list' file for overworld ASM files).

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
The "problem" with the overworld is that most HDMA (as in, what people usually mean when they say that word) targets the background, the overworld however, doesn't have any tiles that have transparency by default. Thus, you can't see the background.
Eg. When you delete a tile in the OW editor, it turns into a water tile rather than "no tile". You need some custom graphics to be able to see the HDMA.
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
Originally posted by Thomas
Overworld HDMA is basically done the same as level HDMA: either use EffecTool to generate the code or write it yourself, then insert it with UberASM and run it for that submap (there's a space in the 'list' file for overworld ASM files).

I keep getting this error:
Code
Processing binary file 'hdma.asm':
  hdma.asm:16: warning: This freespace appears to be leaked. [freecode]
  Inserted at $809234 (PC: 0x1434)
  Insert size: 1254208 (0x132340) bytes
  hdma.asm: error: Missing init/main/nmi label.
Press any key to continue...

your simplistic human mind cannot possibly comprehend the complexities of my thoughts
Assuming hdma.asm is just the code effectool gave you, you'll need to add "init:" at the top of the file and change the RTS to RTL
Originally posted by TheBiob
Assuming hdma.asm is just the code effectool gave you, you'll need to add "init:" at the top of the file and change the RTS to RTL

RTS?
your simplistic human mind cannot possibly comprehend the complexities of my thoughts
Code generated by effectool should have an RTS just before the hdma table. You'll need to change that to RTL if you're using the tool version of uberasm.
Not sure if bumping ancient topics like this is okay, but I still need help with this

UberASM successfully inserts the code, but when I enter the submap that the code was inserted into, the game crashes and plays the 'course clear' fanfare of all things for some reason, and I'm not sure what's going on. Here's my list, if it helps:

Code
verbose: on

; UberASM Tool code list.
; You can use the same .asm file for multiple levels/OW/etc. for saving space.

; Level list. Valid values: 000-1FF.
level:

; OW list. Valid values: 0 = Main map; 1 = Yoshi's Island; 2 = Vanilla Dome;
; 3 = Forest of Illusion; 4 = Valley of Bowser; 5 = Special World; and
; 6 = Star World.
overworld:
2		grape.asm
; Insert files here

; Game mode list. Valid values: 00-FF.
gamemode:
; Insert files here

global:		other/global_code.asm	; global code.
statusbar:	other/status_code.asm	; status bar code.
macrolib:	other/macro_library.asm	; macro library.
sprite:		$7FAC80			; 38 (SNES) or 68 (SA-1) bytes of free RAM.
rom:		smow.smc			; ROM file to use.


As well as the HDMA code:
Code
; To be inserted as generator with SpriteTool (as number D0 - FF).

print "INIT ",pc
print "MAIN ",pc
PHB : PHK : PLB
JSR Sprite
PLB
RTL


Sprite:

	REP #$20

print "INIT ",pc
print "MAIN ",pc
PHB : PHK : PLB
JSR Sprite
PLB
RTL


Sprite:

	REP #$20
init:
	LDA #$3202
	STA $4330
	LDA #.RedGreenTable
	STA $4332
	LDY.b #.RedGreenTable>>16
	STY $4334
	LDA #$3200
	STA $4340
	LDA #.BlueTable
	STA $4342
	LDY.b #.BlueTable>>16
	STY $4344
	SEP #$20
	LDA #$18
	TSB $0D9F
	RTL

.RedGreenTable:           ; 
   db $0A : db $47, $27   ; 
   db $20 : db $46, $26   ; 
   db $1F : db $45, $25   ; 
   db $20 : db $44, $24   ; 
   db $1E : db $43, $23   ; 
   db $20 : db $42, $22   ; 
   db $1D : db $41, $21   ; 
   db $1C : db $40, $20   ; 
   db $00                 ; 
   db $00                 ; 

.BlueTable:          ; 
   db $13 : db $8C   ; 
   db $10 : db $8B   ; 
   db $12 : db $8A   ; 
   db $11 : db $89   ; 
   db $13 : db $88   ; 
   db $10 : db $87   ; 
   db $12 : db $86   ; 
   db $11 : db $85   ; 
   db $11 : db $84   ; 
   db $12 : db $83   ; 
   db $11 : db $82   ; 
   db $11 : db $81   ; 
   db $0F : db $80   ; 
   db $00            ; 

Said code is in the overworld folder.
your simplistic human mind cannot possibly comprehend the complexities of my thoughts
Quote
Code
print "INIT ",pc
print "MAIN ",pc
PHB : PHK : PLB
JSR Sprite
PLB
RTL


Sprite:

	REP #$20

print "INIT ",pc
print "MAIN ",pc
PHB : PHK : PLB
JSR Sprite
PLB
RTL

Well... that serves really no function so you can delete that. And the reason for the crash is simply because you had put the init label at the wrong place – it is supposed to be right before the "REP #$20" (where the second Sprite label is) but putting it after makes the processor treat 16-bit constants as 8-bit constants which often causes for crashes.

In other words, here is the fixed code:
Code
init:
	REP #$20
	LDA #$3202
	STA $4330
	LDA #.RedGreenTable
	STA $4332
	LDY.b #.RedGreenTable>>16
	STY $4334
	LDA #$3200
	STA $4340
	LDA #.BlueTable
	STA $4342
	LDY.b #.BlueTable>>16
	STY $4344
	SEP #$20
	LDA #$18
	TSB $0D9F
	RTL

.RedGreenTable:           ; 
   db $0A : db $47, $27   ; 
   db $20 : db $46, $26   ; 
   db $1F : db $45, $25   ; 
   db $20 : db $44, $24   ; 
   db $1E : db $43, $23   ; 
   db $20 : db $42, $22   ; 
   db $1D : db $41, $21   ; 
   db $1C : db $40, $20   ; 
   db $00                 ; 
   db $00                 ; 

.BlueTable:          ; 
   db $13 : db $8C   ; 
   db $10 : db $8B   ; 
   db $12 : db $8A   ; 
   db $11 : db $89   ; 
   db $13 : db $88   ; 
   db $10 : db $87   ; 
   db $12 : db $86   ; 
   db $11 : db $85   ; 
   db $11 : db $84   ; 
   db $12 : db $83   ; 
   db $11 : db $82   ; 
   db $11 : db $81   ; 
   db $0F : db $80   ; 
   db $00            ;


Edit: And I have got a question for you: How in the world could you have messed up the code? I mean, you used to marker for init and main code for sprites (that's the "print "INIT ",pc" and "print "MAIN ",pc"), place it twice and even put the init label right after a vital command?
I just thought I had to put "init" at the top of the code. I don't know the first thing about ASM, so I honestly have no clue what I'm doing lmao

But in any case, it's working just fine now, so thanks.
your simplistic human mind cannot possibly comprehend the complexities of my thoughts
it's that simple, i know how to do it
just wanted to show an example ;)