Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to optimize C code for NGPC?
#11
Quote:In attempting to change TREG0 to some other interval, I discovered I need it set to 1 for udmadac, which uses timer 0 and timer 2.


You have to set it to 4 only for the hblank interrupt of course, not for others (or did I misunderstand? maybe it's not treg0 in your code)

And sometimes, changing the condition order can help if it reduces the number of tests/memory load/...

Code:
    else if(y==60) {if (screenSplit)  SCR2_X=split1; }
    else if(y==100) { if (screenSplit)  SCR2_X=split2; }

here, screenSplit value is only tested for y = 60 and 100 (y is already loaded from mem), in your previous code it's always loaded and tested
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 sodthor - 02-16-2022, 07:25 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)