gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > HDMA

#20899 - LOst? - Wed May 19, 2004 2:21 pm

Okay, HDMA sounds really interesting. Mostly because it's something that was built into GBA to handle raster effects automatically.

Still with mode 7 tutorials and Cowbit documention, I don't get what I want.

I don't want to do mode 7. I want to do horizontal raster scrolling.

I set off the HDMA durring VBlank. I set it to repeat itself, and to do all these things that other "commercial" games do. Yes I had to debug the games to find the flags since no tutorial take them up.

Interesting how it turned out to be. First of all, I hate the first scanline! I just hate how it is drawn the last frame instead of the current. How much I try to fix this, I fail. I rearrange the whole code but still that stupid mother ****** is drawn the last frame.

And not only that. The game isn't running at 60 fps. WTF! In one emulator it runs correctly, in another (VisualBoy Advance) it just speeds away giving tearings and other funny effects that helps me with my future development of 2d games for GBA.

Yea, and now the GBA is dying. The DS is on its way, And I have still not completed one singe GBA game because of the unsychronized hardware >.<

Is this the end? Why is hardware always in the way of my projects >.<

#20909 - Miked0801 - Wed May 19, 2004 7:03 pm

Quote:

Why is hardware always in the way of my projects >.<


Because if it wasn't, any PC programmer could do a GBA game and they would be no challenge :)

I'll let others handle the HDMA question as my experience here isn't enough to safely help you :)

#20928 - tepples - Thu May 20, 2004 3:48 am

I've done rot/scale HDMA just fine. I'll help:

LOst? wrote:
First of all, I hate the first scanline! I just hate how it is drawn the last frame instead of the current. How much I try to fix this, I fail. I rearrange the whole code but still that stupid mother ****** is drawn the last frame.

Here's what you do: Set the registers for scanline 1 manually during vblank, and then set the HDMA start pointer to the data for scanline 1.

Quote:
And not only that. The game isn't running at 60 fps. WTF! In one emulator it runs correctly, in another (VisualBoy Advance) it just speeds away giving tearings and other funny effects that helps me with my future development of 2d games for GBA.

How does it go on hardware, if you have any? Are you making sure to wait for the start of vblank before changing things? And are you making sure to turn OFF the channel before rewriting the source address register?
Code:
/* It should look roughly like this: */
DMA[0].control = 0;
DMA[0].src = whatever;
DMA[0].dst = &(BGSCROLL[0].x);
DMA[0].count = 1;
DMA[0].control = whatever;

_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.