Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working with h-blank interrupt?
#10
I am finding when working with hblank to do gradients, or even simpler solid segments, by setting the bg color that I get great behavior on an emulator, but something much different and less desirable happens on real hardware.

In general, the emulator (vdmgr in this case) seems to run much faster than real hardware, so I'm guessing that's a factor in the change in behavior.

In my case I have the scroll plane 2 segmented into 4 sections, where I control X separately for 3 of them. For each segment, I was applying a different bg color.

On real hardware, the transitions from one segment to the next looked like they were competing for a pixel row, as if the bg color was changing in the middle of the line being drawn. In that line there are a lot of jittery artifacts.

I got to thinking that setting bg color and moving the plane within the same hblank might be too much, so I attempted doing them separately and it didn't improve things much.

I am working in C and have to imagine that most of what I'm doing is not efficient, but I'm not sure what to make of this issue. A lot of it was pulled from sodthor's code linked above, and I have observed his intro working fine on real hardware. Perhaps it's an issue of choosing between either gradient backgrounds or segmented horizontal movement, but not both?

It's a little disappointing, because as I was looking up hblank effects and examples, I saw mention of Castlevania: Rondo of Blood. Knowing what I know now about these effects, I reviewed some videos of Rondo of Blood and was thinking the NGPC could pull of a lot of the same effects, which seem to mostly be gradients and segmented scrolling at the same time.

In addition to the less than ideal effect I'm getting on real hardware, it seems that applying bg colors in hblanks is pretty taxing. The difference between having the bg color changed only 4 times within a vblank, and not doing any bg changes at all, is the difference between a game that's maybe a little too fast (may need to slow it down with timer variables) or one that's too slow (not much I can do to speed it up).

By comparison, before I started working with hblank interrupts, my main loop that controls the character and level drawing/movement was waiting for 150 intervals of a timer variable (just adding to a variable every loop with no artificial waiting). After adding hblank effects, I essentially had to eliminate the timer and do main operations every loop. It makes sense, since adding hblank effects means you're running whatever is in the interrupt 152 times per frame, even if it's just checking that it doesn't have to do anything.

I will have to see if I can replicate my issue in a less complicated program and come up with a simple demo and source code, but I'm curious if anyone else has experience with making use of these effects.
Reply


Messages In This Thread
Working with h-blank interrupt? - by Nnnn - 03-26-2020, 05:30 PM
RE: Working with h-blank interrupt? - by Flavor - 03-27-2020, 01:47 AM
RE: Working with h-blank interrupt? - by Nnnn - 03-27-2020, 02:23 AM
RE: Working with h-blank interrupt? - by Flavor - 03-27-2020, 03:07 AM
RE: Working with h-blank interrupt? - by sodthor - 03-27-2020, 03:20 AM
RE: Working with h-blank interrupt? - by Nnnn - 03-27-2020, 04:00 PM
RE: Working with h-blank interrupt? - by sodthor - 03-28-2020, 04:05 AM
RE: Working with h-blank interrupt? - by Flavor - 03-28-2020, 04:11 AM
RE: Working with h-blank interrupt? - by Nnnn - 03-28-2020, 10:20 PM
RE: Working with h-blank interrupt? - by winteriscoming - 06-24-2020, 01:44 AM
RE: Working with h-blank interrupt? - by sodthor - 06-24-2020, 07:36 PM
RE: Working with h-blank interrupt? - by sodthor - 06-25-2020, 02:44 AM
RE: Working with h-blank interrupt? - by sodthor - 06-25-2020, 04:29 AM
RE: Working with h-blank interrupt? - by sodthor - 06-26-2020, 06:35 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)