Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to optimize C code for NGPC?
#14
I succeeded in getting my game to run too fast on real hardware, which is great!  Big Grin  I can always make it run slower.

I kept playing around with TREG0 intervals of 2, 4 and 8 and mostly ended up with broken behavior in my hbl.

The main event I needed to have happen was when RAS_Y is 8.  Some very important stuff happens then because vbl is responsible for displaying the row of HUD tiles by moving scroll plane 1 down and moving the sprite offset down.  At RAS_Y==8, scroll plane 1 and sprite offset go back to what they should be.  As far as I was seeing, it was never getting to RAS_Y==8.

Well, I attempted an interval value of 3 and my HUD started behaving again, so it then occurred to me that RAS_Y starts at 0 and I was off by 1, so when it got through 3 intervals, it was at RAS_Y==8.

So I set the TREG0 interval to 9 and have events at RAS_Y of 8, 62 and 98.

udmadac does not seem to be negatively affected by the change to TREG0, at least I don't think it has been. Sounds still play at what sounds like a normal speed to me.
Reply


Messages In This Thread
RE: How to optimize C code for NGPC? - by sodthor - 02-11-2022, 07:43 PM
RE: How to optimize C code for NGPC? - by sodthor - 02-11-2022, 08:49 PM
RE: How to optimize C code for NGPC? - by sodthor - 02-14-2022, 05:33 AM
RE: How to optimize C code for NGPC? - by sodthor - 02-14-2022, 06:29 PM
RE: How to optimize C code for NGPC? - by sodthor - 02-14-2022, 09:16 PM
RE: How to optimize C code for NGPC? - by sodthor - 02-15-2022, 03:38 AM
RE: How to optimize C code for NGPC? - by sodthor - 02-15-2022, 04:17 AM
RE: How to optimize C code for NGPC? - by winteriscoming - 02-16-2022, 05:15 AM
RE: How to optimize C code for NGPC? - by sodthor - 02-16-2022, 07:25 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)