Yup i can see the imagz now and yes that s it :p
Could you please explain the bullet slot system in a bit more detail ?
All this is very interesting
I think you wonder how bullets work, there you go (that s all based on my memory of it i may be a little off depending on game implementations):
The bullets are all properly cleared at the start of a level. (zeroed for all but Y value which is FFed).
When an enemy fires a bullet, it creates a spawn entry which in turn translates to the copy of the master values from the bullet type table (in CPU area) to the definitive bullets entry in memory at the proper location (at the first available space).
It starts its life as a spawning bullet, which is in fact the plumet you can see when en ennemy fires some types of bullets. A plumet does not collide.
Luckily i have an old description table at hand here :p
The bullet has:
status byte (plumet, active, destroyed) with the 4th bit indicating if the bullet collides or not.
Y value (CAVE float,word, 1 byte for int value and 1byte for decimal value)
Y conv. parameter, word, used to convert gamespace to screenspace iirc
sprite offset, dword
sprite format, word
bullet cancel sprite offset end, dword
bullet cancel sprite to sprite max, dword
speed manipulation counter, byte
speed manipulation counter max, byte (0 for infinite)
Y speed, cave float (updated from a precalc table for elyptic moves)
X speed, cave float (updated from a precalc table for elyptic moves)
pointer to the sprite frame handling
user counter byte
user counter max (0 for infinite) byte
entry trace A+B 2 words (i don't remember what it is used to diagnose sorryyyy, i just remember it is a slight alteration of the original speed reading)
user counter 2 byte
user counter 2 max byte
working value 1 byte
working value 1 byte
Initial Speed Y cave float
Initial Speed X cave float
Looping count A
Looping count B
user counter 3
user counter 3 max
user counter 4
user counter 4 max
bullet speed, cave float
Aaanyway, once the creation is done, after exhausting the plummet animation, the bullet transforms into a real bullet, the 4th bit is flipped.
at each frame, some key positions are checked (Y value iirc) and if they are set, the number of bullets entries available increase accordingly.
At each frame, the bullet position (center) is checked against gameworld boundaries, if they are outside, the status is set to 0, the type to 0 and the Y position to FFFF.
at each frame if the bullet is set to be collision detected it is checked against the player collision box through successive testing (i put a description in the development part of the forum somewhere with the exact code), if collision happens, tough luck, you die.
at each frame the collision bit is flipped.
at each frame the sprite frame is changed, the change of frame and looping are handled by the routine at the pointer contained in the bullet structure.
The bullets Y and X positions are altered with the Y speed and X speed values. These values depending on the bullet type is either fixed or changing. When they are changing, their value is read from a table of Y+X speed entries. The various user counters are used to control the way speed values are read.
I don't know if that answers your question xD