Nice to see some active PCE homebrew.
Slight hijack of thread: Click the big banner in my signature, lol. There is some other active stuff,
So does C program code get good performance on the PCE?
No. Not at all. If you are making a game that isn't action packed like a shmup, it'll be just fine. It's great for RPGs. Anything that involves alot of things going on on screen at the same time, has problems. HuC is pisspoor at generating certain things in assembly.
Arrays being the big one, and lets be honest, who the hell doesn't use arrays for things in C?
If you plan to do a homebrew and don't want to do Assembly, you better plan something simple otherwise, chances are you'll need to twiddle around with assembly within the C code to make it work good. Insanity was done largely in C, but assembly was required to solve the problem of having no struct functionality, and the problem of array indexing being a disaster. Sure Insanity isn't exactly action packed, but it is possible to have 10 robots, 10 enemy shots, You, and Your shot all on screen at the same time. The collision checking then becomes a bit of a problem. If there weren't so many possibilities of collisions, it would be alot simpler. Platforming games, and RPGs seem to be two things that are C friendly. Anything involving a ton of sprite collision checking, is not so good.
I suspect something like Keith Courage or even Bonk could be done entirely in C.
For Insanity though:
You have to check all 10 robots against all 10 robots plus you.. Thats 110 checks.
Then you check All 10 robots for wall collisions. 10 checks that are slow because the built in tile functions suck.
Then you check all 10 robot shots to all 10 robots plus you. Thats another 110 checks.
Then you check the shots vs. walls, so 10 more slow checks...
and then your shot vs all 10 robots AND their shots (you can shoot their shots), so 20 checks.
along with you vs walls.
Alot of checking that needs to be done in one vsync. Alot of array indexing would be used in C.
Inefficient array indexing. Along with slow map tile checks. Definitely not going to work out so good with the slow HuC stuff. Go Go Gadget Assembly.
and yes the only old CPU that really manages C code well is the 68k. The Amiga uses a 68k, and youd be amazed what you can do on that machine in C without ever having to touch assembly.
Ecco the dolphin on Sega was written entirely in C.