Found an error/flub on Konami's part in the actual coding for CV3. Well, it wasn't so much an error but dirty programming, which is kinda surprising when you consider how well thought out the rest of the coding appears to be.
First off, the Winged Demon is bugged like I suspected. It was never meant to be used outside of vertical stages. What happens in horizontal stages is the Winged Demon will increase the amplitude of its waveform then reduce it back down again. After it has returned to its normal amplitude it kicks in to crazy mode and starts spazzing out, jumping to the top of the screen then the bottom of the screen. The reason for this, as I predicted in its programming, is the vertical speed changes from +/-1 to +/-64. I had predicted it would drop off the map and be auto-deleted because I interpreted the +/-64 as +/-208 originally (it was written as $C0 in the code, but was handled as -$C0, which is 64).
Now, Trevor's code shows Konami worked on him first. The code was probably recycled from other games. Either that or they had a different programmer coding him. I haven't delved very far into Trevor's code yet, but just from the jumping code alone I've noticed two things:
1) Trevor uses the same horizontal and vertical movement code structures as enemies, but his code is hard-coded just for him. Enemies and platforms all function in arrays (basically), such that you have code like LDA $041D,X ADC $0538,X STA $041D,X. Since people like Inccubus don't know ASM yet, in GM terms that's basically var1[a]+=var2[a]. In Trevor's case, the code is sliiiiiightly different: LDA $041D CLC (clear the carry bit) ADC $0538 STA $041D. When the game adjusts (in this example) $0538, it does so with soft code just like with enemies, but the actual movement code was hard coded with its own extra address.
2) Trevor's jumping code wastes a lot of memory. It is by far the dirtiest code I've seen in the game yet. Trevor's integral vertical speed (see previous posts) is ultra-hardcoded. Not only does the game actually store Trevor's vertical speeds in the ROM itself (as opposed to enemies and platforms who have their vertical speeds calculated), each step is stored in the ROM. It's the equivalent of a Switch statement in GM:
switch step_counter
{
case 0:
case 1:
case 2:
case 3: vspeed=-5; break;
case 4:
case 5:
case 6:
case 7: vspeed=-3; break;
}Each case has a corresponding address in the ROM (in case you ever wondered why a Switch statement is slightly faster than a bunch of IF statements, that's why). There's something like 26 bytes dedicated just to storing Trevor's actual vertical speed in the ROM.