Banner
Views: 1,004,286,481
Time:
8 users online: fathy2001, Feryncesco, fryingpan21, GiraffeKiller, Link13, MarioSonic4life, Mathos, SuperMarioMan32 - Guests: 65 - Bots: 137 Users: 54,874 (2,021 active)
Latest: Knetog
Tip: A power-up is most useful to a player shortly after the midway point.
Not logged in.
HDMA errors because of DMA?
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - HDMA errors because of DMA?
Pages: « 1 » Link
I'm running into a problem with my hdma gradient when vwf_dialogues does dma to backup my layer 3 image.
For 1 frame after my layer 3 disappears my hdma gradient is a mess of colors like in the image below

This doesn't happen every time which makes it quite difficult to pin down the problem.

This is the dma code i from vwf (with the call that causes the problem):
Code
;%dmatransfer(#$01,#$81,#$39,".b #!backupram>>16",".b $01",".b $00",#$0800)
macro dmatransfer(channel, dmasettings, destination, sourcebank, sourcehigh, sourcelow, bytes)
	lda <dmasettings>
	sta $4300
	lda <destination>
	sta $4301
	lda<sourcelow>	; I put the label close to the opcode
	sta $4302	; to allow length definitions
	lda<sourcehigh>
	sta $4303
	lda<sourcebank>
	sta $4304
	rep #$20
	lda <bytes>
	sta $4305
	sep #$20
	lda <channel>
	sta $420B
endmacro


and this is my hdma creation code (only runs during init):
Code
	STZ $4330
	LDA #$02
	STA $4340
	LDA #$32
	STA $4331
	STA $4341
	REP #$20
	LDA.w #Gradient1_BlueTable
	STA $4332
	LDA.w #Gradient1_RedGreenTable
	STA $4342
	SEP #$20
	LDA.b #Gradient1_BlueTable>>16
	STA $4334
	LDA.b #Gradient1_BlueTable>>16
	STA $4344
	LDA #$18
	TSB $6D9F


The project uses the sa-1 chip.
I tried looking into dma transfer stuff and hdma using regs.txt but wasn't able to find something obviously wrong with the code.
But someone will probably prove me wrong #tb{XD}
As far as I know there are no other dma calls there.
Does anybody have a clue what's wrong or where I can examine further?

--------------------
My Youtube channel

Currently working on:
Project C

Finished project:
That error is actually well known. What happens here is that too much stuff happens in v-blank and it messes up HDMA for the frame v-blank is overshoot. There isn't much you can do about it besides optimising the NMI routine or handle VRAM access in multiple frames.
uff

ok, I'll see what I can do about that. Thanks for the advice.

--------------------
My Youtube channel

Currently working on:
Project C

Finished project:
Pages: « 1 » Link
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - HDMA errors because of DMA?

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

Copyright © 2005 - 2022 - SMW Central
Legal Information - Privacy Policy - Link To Us


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy
  • sm64romhacks