It is currently Wed Jun 28, 2017 7:09 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: Koei bytecode
PostPosted: Mon Jun 12, 2017 5:40 pm 
Offline

Joined: Mon Nov 10, 2008 3:09 pm
Posts: 367
Oziphantom wrote:
Why not look at and extract the 16bit KOEI titles to see if they already have the above in 16bit?


Apparently their early SNES titles (e.g. Romance of the Three Kingdoms II) do use the same bytecode. Because the virtual machine has no support for an address space larger than 16 bits, they have to constantly copy bytecode and data overlays into RAM, simulating a bankswitched 64K machine.

I had a very brief look at a couple of later SNES Koei games (Uncharted Waters 2 and Genghis Khan 2) and they both look like compiler-generated 65816 code (tons of stack-relative addressing, etc.). So it looks like Koei switched to a different compiler at some point, one that produced native 65816 rather than bytecode. It's a bit interesting that the Famicom version of Genghis Khan 2 (Aoki Ookami to Shiroki Mejika: Genchou Hishi) is interpreted while the SNES version is native 65816.


Top
 Profile  
 
 Post subject: Re: Koei bytecode
PostPosted: Fri Jun 16, 2017 6:29 am 
Offline

Joined: Mon Nov 10, 2008 3:09 pm
Posts: 367
I'm now investigating the assembly language initialization/NMI/syscall code, or "BIOS" as Koei apparently called it. In the MMC5 games there appear to be three major versions of the BIOS: one used in Nobunaga's Ambition 2, Bandit Kings, Ishin no Arashi and Rot3K2 (with minor changes per game); one used in Uncharted Waters and L'Empereur; and a final version used in Gemfire, Genghis Khan 2 and Nobunaga's Ambition 3 (aka Lord of Darkness on the SNES and Genesis).

The US versions of Nobunaga's Ambition 2, Bandit Kings and Rot3K2 are actually kind of hybrids between BIOS version 1 and 2: the RAM addresses they use are version 1 (a ton of variables got shuffled in and out of zero page between the versions--I guess someone did some profiling :)) but a number of code changes from version 2 were backported in. The backported changes appear to be mainly sound related--version 1 uses the MMC5 channels exclusively for melodic sound effects, but of course those channels aren't usable on a stock NES, so they had to backport the version 2 sound engine which can share channels between BGM and effects in order to move those sound effects to the built-in APU channels.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group