This is getting off-topic from the original thread, so if tepples et al want to edit my earlier posts and split this off into a thread called "koitsu being an old codger", that's fine.
My strong opinion comes from familiarity with the fact that the 65xxx architecture is badly-suited for C. This was a commonly-accepted reality in the Apple IIGS community, which had ORCA/C (commercial at the time, and generally expensive). I was taught repeatedly by people significantly smarter than me that other architectures tend to work better with C (ex. 68K, x86, PIC), mainly due to a wider variety of opcode and addressing mode capabilities and compounded by having substantially more common-use registers. It's "doable" on the 65816, but a lot of CPU time is wasted due aforementioned architecture limits.
Slight divergent story but semi-relevant: when
GNOME came out for the IIGS (that was a UNIX-like environment for the IIGS, written in both C and assembly), one of the very first things people wanted was a C compiler for it (e.g. porting gcc to the IIGS/65816); nope, ORCA/C was it. If you've never heard of GNOME,
here's the old FAQ; Sections 10 and 11 are relevant to this discussion. I remind readers that this was an environment/sub-OS written in the early 90s (91-96), and likewise ORCA/C was from that time as well, so today's C programmers might not like its limited capabilities.
I am not here to say "SNES games in C cannot be done" -- there is evidence in the past of some actual commercial SNES RPGs being written in a very C or C-like language, which was developed by and for the company who made said games -- but rather to say: there really isn't a good C compiler for the 65816 that's available for present-day platforms (i.e. writing C code on x86/x64 that cross-compiles into 65816).
cc65, in my book, falls into that category. It was designed with 6502/65c02 in mind. Could it be enhanced to do a better job with 65816, such as supporting 16-bit operations, comprehending direct page, and making use of 24-bit addressing? Certainly. But my wishful thinking doesn't help improve the situation at all; I don't write compilers, a highly complex topic way above my mental pay grade. I just feel this reality (of the state of tools/compilers for said CPU architecture) is often ignored, trumped by idealistic dreams. Maybe I'm weird: when I look at developing software/programs/whatever for an older architecture/platform, the first thing I do see is what tools/PLs/etc. were used
at the time of its inception and try to use those, because odds are they were chosen for a good reason. SNES games were predominantly written in pure assembly; IIGS things were predominantly written in pure assembly or assembly combo'd with Pascal or BASIC, else (yikes) Hypercard; the few things done in C on the IIGS were often a surprise.
And yes, I'm obviously aware of several NES games being done in C with cc65. I still find that amazing/incredible. But to my knowledge, every single game that's used cc65 has had a substantial amount of assembly involved in the process (read: ca65 is involved) given the nuances and realities of the NES architecture. SNES is no different in this regard.
I'm fine with someone having a different opinion than me, I just come off as candid and brash when it comes to this subject because I come from a IIGS background. I'm often asked to justify my opinion, and my justification lies in the fact that there really aren't many C-based games/titles/anything on the 65816 for reasons covered earlier. If someone wants to be the first to do it, great, but I happen to think it's strange how people want to use a PL on older architectures/platforms that really don't cater well to said PL, rather than just do assembly. It's always C, too -- I never hear of people wanting Fortran or COBOL or Lisp or Forth or ML or Modula-3, it's always C.
Anyway, circling back to C compilers that output 65816: the only alternatives I know of are at this point:
- ORCA/C -- only works on the Apple IIGS, and might not be suitable for other platforms (read: SNES). In other words: I can't say for certain that this compiler could output anything that might run/work on the SNES, given the *tremendous* platform differences between the IIGS and the SNES; I don't know how critical the crt is to it, for example. This compiler used to be commercial. Binaries are for the Apple IIGS, not PC/etc., and compiling the compiler requires ORCA/Pascal (Pascal for IIGS) and ORCA/M (assembler for IIGS). In contrast, I do know factually that there were some SNES programmers back in the 90s who used ORCA/M to do some code for the SNES. But that's not C. ;-)
- lcc-816 -- apparently not so great from what earlier posts. I trust calima's review.
- Toshi Morita's port of lcc 1.9 -- this takes C code and generates assembly intended for the IIGS ORCA/M assembler. I haven't used it; looks to be intended for *IX (ex. Linux, BSD) operating systems, or maybe even GNOME. Certainly could be modified to output code for another assembler (ex. ca65), but it requires the person understand how the DAGs work. Like I said: not for the faint of heart. Worth reading is this thread between a user and Toshi himself.
- Western Design Centre's C compiler -- I haven't used it
I'd urge anyone who has used a C compiler on the SNES to talk about their experience openly and honestly. If you used C for the "general chunk" of your main game, but resorted to assembly for substantially more important bits, please don't omit that, as that's very important.