Just as an update, we are about 75 frames ahead of dezbeast's run up to Chill Penguin's door.
And now for some disassembly results.
Here's the RNG cycling subroutine (849086 - 84909F):
$84/9086 08 PHP
$84/9087 C2 20 REP #$20
$84/9089 AD A6 0B LDA $0BA6 [$86:0BA6] A:0000 X:0004 Y:009C P:envmXdiZc
$84/908C 0A ASL A A:9D2A X:0004 Y:009C P:eNvmXdizc
$84/908D 18 CLC A:3A54 X:0004 Y:009C P:envmXdizC
$84/908E 6D A6 0B ADC $0BA6 [$86:0BA6] A:3A54 X:0004 Y:009C P:envmXdizc
$84/9091 EB XBA A:D77E X:0004 Y:009C P:eNvmXdizc
$84/9092 E2 20 SEP #$20 A:7ED7 X:0004 Y:009C P:eNvmXdizc
$84/9094 8D A7 0B STA $0BA7 [$86:0BA7] A:7ED7 X:0004 Y:009C P:eNvMXdizc
$84/9097 18 CLC A:7ED7 X:0004 Y:009C P:eNvMXdizc
$84/9098 6D A6 0B ADC $0BA6 [$86:0BA6] A:7ED7 X:0004 Y:009C P:eNvMXdizc
$84/909B 8D A6 0B STA $0BA6 [$86:0BA6] A:7E01 X:0004 Y:009C P:envMXdizC
$84/909E 28 PLP A:7E01 X:0004 Y:009C P:envMXdizC
$84/909F 6B RTL A:7E01 X:0004 Y:009C P:envMXdiZc
The majority of the time it is called, it cuts back to 809A9A with instruction JSR $D1ED. However, the times which it doesn't are interesting.
** Item drops
I'll spare you the assembly language and just cut to the results. The item drop subroutine (at least part of it; there's some stuff that depends on enemy) is at 84AE8D-84AE99. It uses the following lookup table, starting at 86BB9F:
no le LE we WE XL
CF 10 10 08 08 01 00 00 (unknown)
9E 20 20 10 10 02 00 00 (normal)
C0 00 00 20 20 00 00 00 (unknown)
80 40 40 00 00 00 00 00 (spike drop enemies in intro stage)
C0 00 20 00 20 00 00 00 (unknown)
00 3C 3C 3C 3C 10 00 00 (minibosses)
80 00 00 00 00 80 00 00 (bubble bat in armadillo stage)
For the normal (i.e. most enemies) one, the first 0x9E numbers (0x00-0x9D) drop nothing, then the next 0x20 numbers (0x9E-0xBD) drop small life energy, and so on (0xBE-0xDD for big life energy, 0xDE-0xED for small weapon energy, 0xEE-0xFD for big weapon energy, and 0xFE-0xFF for extra life).
Note that some enemies don't even have drops, and so do not access this table.
** Chill Penguin's behavior
Chill Penguin's actions are given by the subroutine at 81C019-81C033. The action is determined by the previous action, and the last digit of the RNG value. It uses a table (starting at 86C45B):
0 1 2 3 4 5 6 7 8 9 A B C D E F
0: 0 2 2 4 4 4 4 4 4 4 6 6 8 8 8 8
2: 0 0 2 4 4 6 6 6 6 6 6 6 8 8 8 8
4: 0 0 0 0 2 4 6 6 8 8 8 8 8 8 8 8
6: 0 0 0 0 0 0 0 2 2 2 2 4 4 6 8 8
8: 0 0 0 0 2 2 2 2 2 2 2 4 4 6 6 8
where 0 is ice block, 2 is jump - ice wind, 4 is slide, 6 is jump - direct, and 8 is ice penguin. If there are ice penguins already (even if made offscreen; see both published runs), instead Chill Penguin will do ice block. This is useful to increase the probability of using ice block.
** Bospider
Whether Bospider throws out spiders first is determined by the subroutine starting at 82DE46. If the RNG value mod 4 is 0, then he throws spiders and changes lines; otherwise he doesn't.
The wires are more interesting. Here's how they are determined (subroutine 82DD56-82DDA2):
* There are eight wires.
* Wires are determined from the bottom up.
* A left wire is represented by 0, middle wire by 1, and right wire by 2.
* The bottom wire is determined by taking RNG value mod 4. If it is 3, it becomes 0.
* Each new wire is determined by the RNG value mod 2, and the previous wire. It basically works like this: take the value of the previous wire, and add 1 (mod 3) if RNG value is even, and 2 (mod 3) if RNG value is odd, and the new value is the new wire. Note that the new wire cannot be the same as the previous. The RNG values cycle on each determination.
For the beginning of Bospider's battle, Bospider moves slowly until first crossing a wire. I looked at the following possible layouts (note: the layouts pictured are just one of two layouts that result in the same thing):
Just a straight drop. The fastest one, probability 3/512 of occurring.
One crossing. Tied for second fastest, probability 4/512. 4 frames slower than the first one.
Two crossings. Tied for second fastest, probability 3/512. 4 frames slower than the first one.
There is some other stuff I tried (like Boomer Kuwanger) but Kuwanger's AI is hard to decipher and seems non-logical. By the way,
Geiger's snes9x debugger is what I used for all of this.