News: 11 March 2016 - Forum Rules

Author Topic: HDMA Effecting Layers?  (Read 2240 times)

justin3009

  • Hero Member
  • *****
  • Posts: 1664
  • Welp
    • View Profile
HDMA Effecting Layers?
« on: July 11, 2014, 09:48:01 pm »
I'm VERY confused on how this works and I can't for the life of me find it in any document.  If it is in any of the ones I've read, then I'm clearly missing something.

What the heck dictates what layers HDMA effects?

This is for Tales of Phantasia but I'm trying an experiment to see if I can change which layer HDMA effects on the 'Custom' screen and I cannot figure it out.  Is it multitudes of bytes that do so or is it just a single byte change to tell which BG to use?  I really don't understand.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

Bregalad

  • Hero Member
  • *****
  • Posts: 2763
    • View Profile
Re: HDMA Effecting Layers?
« Reply #1 on: July 12, 2014, 05:20:36 am »
HDMA doesn't "effect layers", HDMA writes to PPU registers (or sometimes other registers) during HBlank.

This is well documented, just look at any SNES doc, what HDMA does depends on which registers it writes to.

justin3009

  • Hero Member
  • *****
  • Posts: 1664
  • Welp
    • View Profile
Re: HDMA Effecting Layers?
« Reply #2 on: July 12, 2014, 08:10:00 am »
I really must be missing something then. I messed with many of the registers and it didn't so a thing except screw up BG3, which I suppose is a step but I couldn't get it to effect anything else at all.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

Bregalad

  • Hero Member
  • *****
  • Posts: 2763
    • View Profile
Re: HDMA Effecting Layers?
« Reply #3 on: July 12, 2014, 08:19:44 am »
Without any kind of pictures it's impossible to follow what you are talking about.

One common use of HDMA is to change the scrolling midframe for a vast panoply of effects. Is it what you are talking about ?
Seems each BG layer of the SNES has 2 scrolling registers for X and Y directions, and the registers themselves are 16-bit, you need to write twice to change all the scrolling bits (except if the BG map is only 32x32, where 8-bit is enough and high bits can be ignored).

In all cases, HDMA can affect scrolling of any layers just by changing which registers it will write to.

justin3009

  • Hero Member
  • *****
  • Posts: 1664
  • Welp
    • View Profile
Re: HDMA Effecting Layers?
« Reply #4 on: July 12, 2014, 10:01:04 am »
Edit: ...figured it out.

Code: [Select]
$C2/7618 A9 12       LDA #$12                A:0002 X:0008 Y:06B2 P:envMxdizC
$C2/761A 8D 61 43    STA $4361  [$00:4361]   A:0012 X:0008 Y:06B2 P:envMxdizC

Changed A9 12 to A9 0E and it's effecting Layer 1 ~_~  That simple of a change OF COURSE.

Edit 2: Does anyone have a method they tend to use for a 'smooth' scrolling effect?  I'm not quite sure how to actually pull that off.  Even seeing a few other games code and TOP's doesn't help one bit.  It seems pretty scattered.
« Last Edit: July 12, 2014, 03:57:21 pm by justin3009 »
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'