On the NESDEV forum, I've just finished a multi-part
technical description based on my reverse engineering of a bytecode interpreter (effectively a virtual CPU) used by the NES ports of Koei's classic strategy simulation games--Nobunaga's Ambition, Genghis Khan, Bandit Kings of Ancient China, etc.
Based on the very close correspondence of the virtual CPU's feature set with C (C-style function calling convention, function pointers, switch tables, bitfields) and additional evidence that the games in question were written in C (strings with C-style format specifiers in the ROMs) I'm 100% certain that the bytecode is the output of some C compiler. What I'm curious about is whether that compiler and the interpreter were developed by Koei in-house, or whether they were a third-party product which Koei licensed and which other contemporary software developers may have used as well (whether for games or for other applications)
I would be interested to hear if my description rings a bell to anyone who was programming 6502 machines in C back in the day.