I will post some updates here sometimes as I go through the game.
I used Emulicious to explore the code with the debugger, I found out how the enemies spawn works
the game track the screen progress this way
- every 8 pixels up the RAM 0x019A is increase, let's call it sub-Y
- then every 8 sub-Y the ram 0x019B is increase, let's call it Y
there are 2 tables in the rom for defining the spawn X, Y and type
- Table Y & sub-Y position, reference in RAM 0X01E8
- Table Type & X position reference in RAM 0x01EE
I've parse the ROM tables in a spreadsheet
https://docs.google.com/spreadsheets/d/1JMGR7M0yEuznjJpkRyIYJlGb-e69qx5x_0drpwkoW-U/edit?usp=sharing
every time the sub-Y or Y position change, the game check if Y, sub-Y & X match a spawn from the table.
there are 4 slots for enemies spawn (0x07C0, 0x07F0, 0x0820, 0x0850) the game would look if one slot is free.
when there is no match from the table, the slots will be populated with a generic enemy (e.g. round 1 --> 14) with a random X position and a random sub type
I will explore more about those sub-type, for instance the generic type 14, has 2 different behaviour: shoot 2 time + walk or walk faster and 1 shot
as soon as a an enemy die / despawn, the game will very shortly spawn a new one, from the table or a random generic enemy
also found out there are some hidden big bonus arrow ammo!
in the code (ROM 0x02912), the game check
- if an enemy is killed on the 2nd shot
- if an RNG value (RAM 0x081B) or (RAM 0x0C818) match the RAM 0x0246 (probably about screen progress)
then the game give 150 ammos! ($96)